/
1-Button.stories.ts
52 lines (43 loc) · 1.02 KB
/
1-Button.stories.ts
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
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { Button } from '@storybook/angular/demo';
export default {
title: 'Button',
component: Button,
};
export const text = () => ({
component: Button,
props: {
text: 'Hello Button',
},
});
export const emoji = () => ({
component: Button,
props: {
text: '😀 😎 👍 💯',
},
});
emoji.story = {
parameters: { notes: 'My notes on a button with emojis' },
};
export const withSomeEmojiAndAction = () => ({
component: Button,
props: {
text: '😀 😎 👍 💯',
onClick: action('This was clicked OMG'),
},
});
withSomeEmojiAndAction.story = {
name: 'with some emoji and action',
parameters: { notes: 'My notes on a button with emojis' },
};
export const buttonWithLinkToAnotherStory = () => ({
component: Button,
props: {
text: 'Go to Welcome Story',
onClick: linkTo('Welcome'),
},
});
buttonWithLinkToAnotherStory.story = {
name: 'button with link to another story',
};