|
1 | 1 | import React from 'react';
|
2 | 2 | import { storiesOf } from '@storybook/react';
|
3 | 3 | import { withDocs } from 'storybook-readme';
|
4 |
| -import CodeBlock from '../../components/CodeBlock'; |
5 |
| -import ContributeBanner from '../../components/ContributeBanner'; |
6 | 4 |
|
7 | 5 | import Documentation from './docs.md';
|
8 |
| -import Guidelines from './guide.md'; |
9 | 6 |
|
10 |
| -import { |
11 |
| - Select, |
12 |
| - Field, |
13 |
| - Box, |
14 |
| - Heading, |
15 |
| - Text, |
16 |
| - Flex, |
17 |
| - Card, |
18 |
| - Pill, |
19 |
| - |
20 |
| - Radio, |
21 |
| - Link, |
22 |
| -} from 'rimble-ui'; |
| 7 | +import { Select } from 'rimble-ui'; |
23 | 8 |
|
24 |
| -const items = [ |
25 |
| - 'ETH - Ether', |
26 |
| - 'BTC - Bitcoin', |
27 |
| - 'GNO - Gnosis', |
28 |
| - 'GNT - Golem', |
29 |
| - 'REP - Augur', |
| 9 | +const options = [ |
| 10 | + { value: 'ETH', label: 'ETH - Ether'}, |
| 11 | + { value: 'BTC', label: 'BTC - Bitcoin'}, |
| 12 | + { value: 'GNO', label: 'GNO - Gnosis'}, |
| 13 | + { value: 'GNT', label: 'GNT - Golem'}, |
| 14 | + { value: 'REP', label: 'REP - Augur'}, |
30 | 15 | ];
|
31 | 16 |
|
32 |
| -storiesOf('Components/Form/Select', module) |
33 |
| - .add( |
34 |
| - 'Documentation', |
35 |
| - withDocs(Documentation, () => ( |
36 |
| - <Box mx={3}> |
37 |
| - <CodeBlock> |
38 |
| - <Field label="Choose your currency"> |
39 |
| - <Select items={items} required="false" /> |
40 |
| - </Field> |
41 |
| - </CodeBlock> |
42 |
| - </Box> |
43 |
| - )) |
44 |
| - ) |
45 |
| - .add( |
46 |
| - 'Design guidelines', |
47 |
| - withDocs(Guidelines, () => ( |
48 |
| - <Box mx={3}> |
49 |
| - <Box> |
50 |
| - <Heading.h3>Design</Heading.h3> |
51 |
| - <Text> |
52 |
| - Some best practices for using <code>{'Select'}</code> in your |
53 |
| - product. |
54 |
| - </Text> |
55 |
| - </Box> |
56 |
| - <Box> |
57 |
| - <Heading.h4>It's better to show your options</Heading.h4> |
58 |
| - <Text> |
59 |
| - Only use the <code>{'Select'}</code> component when you have a lot |
60 |
| - of options that would clutter your interface. If you've only got a |
61 |
| - few options to choose from it might be better to show them to the |
62 |
| - user with a <code>{'Radio'}</code> component. |
63 |
| - </Text> |
64 |
| - <br /> |
65 |
| - </Box> |
66 |
| - <Flex> |
67 |
| - <Card mx={'auto'} my={3} px={4} width="400px"> |
68 |
| - <Pill mb={3} color={'green'}> |
69 |
| - {'Do'} |
70 |
| - </Pill> |
71 |
| - <br /> |
72 |
| - <br /> |
73 |
| - <Select |
74 |
| - items={[ |
75 |
| - 'ETH - Ether', |
76 |
| - 'BTC - Bitcoin', |
77 |
| - 'GNO - Gnosis', |
78 |
| - 'GNT - Golem', |
79 |
| - 'REP - Augur', |
80 |
| - ]} |
81 |
| - /> |
82 |
| - <br /> |
83 |
| - <br /> |
84 |
| - <Radio label="ETH - Ether" my={2} required="false" /> |
85 |
| - <Radio label="FIAT e.g. USD" my={2} required="false" /> |
86 |
| - </Card> |
87 |
| - <Card mx={'auto'} my={3} px={4} width="400px"> |
88 |
| - <Pill mb={3} color={'red'}> |
89 |
| - {"Don't"} |
90 |
| - </Pill> |
91 |
| - <br /> |
92 |
| - <br /> |
93 |
| - <Select items={['ETH - Ether', 'FIAT e.g. USD']} /> |
94 |
| - </Card> |
95 |
| - </Flex> |
96 |
| - |
97 |
| - <ContributeBanner /> |
98 |
| - </Box> |
99 |
| - )) |
100 |
| - ); |
| 17 | +storiesOf('Components/', module) |
| 18 | + .addDecorator(withDocs(Documentation)) |
| 19 | + .add('Select', () => ( |
| 20 | + <Select options={options} /> |
| 21 | + )) |
0 commit comments