|
1 | 1 | import * as React from 'react' |
2 | | -import {Box2, Banner} from '.' |
| 2 | +import {Box2} from './box' |
| 3 | +import {Banner, BannerParagraph} from './banner' |
3 | 4 | import * as Sb from '../stories/storybook' |
4 | 5 |
|
5 | 6 | const load = () => { |
6 | 7 | Sb.storiesOf('Common', module) |
7 | 8 | .addDecorator(Sb.scrollViewDecorator) |
8 | 9 | .add('Banner', () => ( |
9 | 10 | <Box2 direction="vertical" fullWidth={true} gap="small"> |
10 | | - <Banner key="1" color="red" text="this is a red banner with no action" /> |
11 | | - <Banner key="2" color="blue" text="this is a blue banner with no action" /> |
12 | | - <Banner key="3" color="yellow" text="this is a yellow banner with no action" /> |
13 | | - <Banner key="4" color="green" text="this is a green banner with no action" /> |
14 | | - <Banner key="5" color="grey" text="this is a grey banner with no action" /> |
15 | | - <Banner |
16 | | - key="6" |
17 | | - color="red" |
18 | | - text="this is a red banner with super long text blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah yes very long" |
19 | | - /> |
20 | | - <Banner |
21 | | - key="7" |
22 | | - color="red" |
23 | | - text="this is a red closable banner with super long text blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah yes very long" |
24 | | - onClose={Sb.action('onClose')} |
25 | | - /> |
26 | | - <Banner key="8" color="red" text="this is a closable red banner" onClose={Sb.action('onClose')} /> |
27 | | - <Banner |
28 | | - key="9" |
29 | | - color="red" |
30 | | - text="this is a red banner with actions and is closable" |
31 | | - onClose={Sb.action('onClose')} |
32 | | - actions={[ |
33 | | - {onClick: Sb.action('onClick-action1'), title: 'action1'}, |
34 | | - {onClick: Sb.action('onClick-action2'), title: 'action2'}, |
35 | | - ]} |
36 | | - /> |
37 | | - <Banner |
38 | | - key="10" |
39 | | - color="red" |
40 | | - text="this is a red banner with actions and super long text blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah yes very long" |
41 | | - actions={[ |
42 | | - {onClick: Sb.action('onClick-action1'), title: 'action1'}, |
43 | | - {onClick: Sb.action('onClick-action2'), title: 'action2'}, |
44 | | - ]} |
45 | | - /> |
46 | | - <Banner |
47 | | - key="10" |
48 | | - color="red" |
49 | | - text="this is a narrow red banner with actions and super long text blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah yes very long" |
50 | | - actions={[ |
51 | | - {onClick: Sb.action('onClick-action1'), title: 'action1'}, |
52 | | - {onClick: Sb.action('onClick-action2'), title: 'action2'}, |
53 | | - ]} |
54 | | - narrow={true} |
55 | | - /> |
| 11 | + <Banner key="1" color="red"> |
| 12 | + This is a red banner with no action. |
| 13 | + </Banner> |
| 14 | + <Banner key="2" color="blue"> |
| 15 | + This is a blue banner with no action. |
| 16 | + </Banner> |
| 17 | + <Banner key="3" color="yellow"> |
| 18 | + This is a yellow banner with no action. |
| 19 | + </Banner> |
| 20 | + <Banner key="4" color="green"> |
| 21 | + This is a green banner with no action. |
| 22 | + </Banner> |
| 23 | + <Banner key="5" color="grey"> |
| 24 | + This is a grey banner with no action. |
| 25 | + </Banner> |
| 26 | + <Banner key="6" color="red"> |
| 27 | + This is a red banner with super long text blah blah blah blah blah blah blah blah blah blah blah |
| 28 | + blah blah blah blah blah blah blah blah blah blah blah blah blah yes very long. |
| 29 | + </Banner> |
| 30 | + <Banner key="7" color="red" onClose={Sb.action('onClose')}> |
| 31 | + This is a red closable banner with super long text blah blah blah blah blah blah blah blah blah blah |
| 32 | + blah blah blah blah blah blah blah blah blah blah blah blah blah blah yes very long. |
| 33 | + </Banner> |
| 34 | + <Banner key="8" color="red" onClose={Sb.action('onClose')}> |
| 35 | + This is a closable red banner. |
| 36 | + </Banner> |
| 37 | + <Banner key="9" color="red" onClose={Sb.action('onClose')}> |
| 38 | + <BannerParagraph |
| 39 | + bannerColor="red" |
| 40 | + content={[ |
| 41 | + 'A banner with array content', |
| 42 | + null && 'not shown', |
| 43 | + ' and ', |
| 44 | + false && 'also not shown', |
| 45 | + 'that has null and false inside.', |
| 46 | + ]} |
| 47 | + /> |
| 48 | + </Banner> |
| 49 | + <Banner key="10" color="red" onClose={Sb.action('onClose')}> |
| 50 | + <BannerParagraph |
| 51 | + bannerColor="red" |
| 52 | + content={[ |
| 53 | + 'A banner with inline actions ', |
| 54 | + {onClick: Sb.action('action1'), text: 'action1'}, |
| 55 | + ' and ', |
| 56 | + {onClick: Sb.action('action2'), text: 'action2'}, |
| 57 | + ' and new line actions.', |
| 58 | + ]} |
| 59 | + /> |
| 60 | + <BannerParagraph |
| 61 | + bannerColor="red" |
| 62 | + content={[ |
| 63 | + {onClick: Sb.action('action3'), text: 'action3'}, |
| 64 | + ', ', |
| 65 | + {onClick: Sb.action('action4'), text: 'action4'}, |
| 66 | + ]} |
| 67 | + /> |
| 68 | + </Banner> |
| 69 | + <Banner key="11" color="red" onClose={Sb.action('onClose')}> |
| 70 | + <BannerParagraph |
| 71 | + bannerColor="red" |
| 72 | + content={[ |
| 73 | + 'Here is a super long banner message with ', |
| 74 | + {onClick: Sb.action('action1'), text: 'action1'}, |
| 75 | + ' and ', |
| 76 | + {onClick: Sb.action('action2'), text: 'action2'}, |
| 77 | + '. Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.', |
| 78 | + ]} |
| 79 | + /> |
| 80 | + </Banner> |
56 | 81 | </Box2> |
57 | 82 | )) |
58 | 83 | } |
|
0 commit comments