|
1 | 1 | import React from 'react' |
2 | 2 | import { storiesOf } from '@storybook/react' |
| 3 | +import storiesFromMarkdown from '../../.storybook/lib/storiesFromMarkdown' |
3 | 4 |
|
4 | | -storiesOf('Button', module) |
5 | | - .add('btn', () => ( |
6 | | - <button className='btn'>Button</button> |
7 | | - )) |
8 | | - .add('btn-primary', () => ( |
9 | | - <div className='p-4 d-flex flex-justify-between'> |
10 | | - <button className='btn btn-primary'>Button</button> |
11 | | - <button className='btn btn-primary hover'>hover</button> |
12 | | - <button className='btn btn-primary focus'>focus</button> |
13 | | - <button className='btn btn-primary selected'>selected</button> |
14 | | - <button className='btn btn-primary disabled'>disabled</button> |
15 | | - </div> |
16 | | - )) |
17 | | - .add('btn-danger', () => ( |
18 | | - <div className='p-4 d-flex flex-justify-between'> |
19 | | - <button className='btn btn-danger'>Button</button> |
20 | | - <button className='btn btn-danger hover'>hover</button> |
21 | | - <button className='btn btn-danger focus'>focus</button> |
22 | | - <button className='btn btn-danger selected'>selected</button> |
23 | | - <button className='btn btn-danger disabled'>disabled</button> |
24 | | - </div> |
25 | | - )) |
26 | | - .add('btn-outline', () => ( |
27 | | - <div className='p-4 d-flex flex-justify-between'> |
28 | | - <button className='btn btn-outline'>Button</button> |
29 | | - <button className='btn btn-outline hover'>hover</button> |
30 | | - <button className='btn btn-outline focus'>focus</button> |
31 | | - <button className='btn btn-outline selected'>selected</button> |
32 | | - <button className='btn btn-outline disabled'>disabled</button> |
33 | | - </div> |
34 | | - )) |
35 | | - .add('btn-blue', () => ( |
36 | | - <div className='p-4 d-flex flex-justify-between'> |
37 | | - <button className='btn btn-blue'>Button</button> |
38 | | - <button className='btn btn-blue hover'>hover</button> |
39 | | - <button className='btn btn-blue focus'>focus</button> |
40 | | - <button className='btn btn-blue selected'>selected</button> |
41 | | - <button className='btn btn-blue disabled'>disabled</button> |
42 | | - </div> |
43 | | - )) |
44 | | - .add('btn-purple', () => ( |
45 | | - <div className='p-4 d-flex flex-justify-between'> |
46 | | - <button className='btn btn-purple'>Button</button> |
47 | | - <button className='btn btn-purple hover'>hover</button> |
48 | | - <button className='btn btn-purple focus'>focus</button> |
49 | | - <button className='btn btn-purple selected'>selected</button> |
50 | | - <button className='btn btn-purple disabled'>disabled</button> |
51 | | - </div> |
52 | | - )) |
53 | | - .add('btn-large', () => ( |
54 | | - <div className='f3 p-4'> |
55 | | - <a className="btn btn-large btn-purple mr-6" href="#url" role="button">Large link button</a> |
56 | | - <button className="btn btn-large" type="button">Large button button</button> |
57 | | - </div> |
58 | | - )) |
59 | | - .add('btn-link', () => ( |
60 | | - <div className='p-4 d-flex flex-justify-between'> |
61 | | - <button className='btn-link'>Button</button> |
62 | | - </div> |
63 | | - )) |
| 5 | +const stories = storiesOf('Button', module) |
| 6 | + |
| 7 | +for (const {title, story} of storiesFromMarkdown(require.context('.', true, /\.md$/))) { |
| 8 | + stories.add(title, story) |
| 9 | +} |
0 commit comments