-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathstory.js
54 lines (45 loc) · 1.09 KB
/
story.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React from 'react';
import { storiesOf, action } from '@kadira/storybook';
import markdownDecorator, {addWithMarkdown} from '../src';
import Button from './Button';
import readme from '!raw!../README.md';
const inline = `
# Test markdown
### Features
* One
* Two
* Three
`;
const inlineSecond = `
# Second markdown
|Test|Header|
|-|-|
|One|Two|
`;
storiesOf('Button Readme')
.addDecorator(markdownDecorator(readme))
.add(
'simple usage',
() => <Button label="The Button" onClick={action('onClick')} />,
)
.add(
'another usage',
() => <Button label="Another Button" onClick={action('another onClick')} />,
);
storiesOf('Button Inline')
.addDecorator(markdownDecorator(inline))
.add(
'simple usage',
() => <Button label="The Button" onClick={action('onClick')} />,
);
storiesOf('Button Different')
.addWithMarkdown(
'first markdown',
inline,
() => <Button label="The Button" onClick={action('onClick')} />,
)
.addWithMarkdown(
'second markdown',
inlineSecond,
() => <Button label="The Button" onClick={action('onClick')} />,
);