|
1 | | -import { storiesOf } from '@storybook/web-components'; |
2 | 1 | import { action } from '@storybook/addon-actions'; |
3 | 2 | import { html } from 'lit-html'; |
4 | 3 | import './pushbutton-element'; |
5 | 4 |
|
6 | | -storiesOf('Pushbutton', module) |
7 | | - .addParameters({ component: 'wokwi-pushbutton' }) |
8 | | - .add( |
9 | | - 'Red', |
10 | | - () => |
11 | | - html` |
12 | | - <wokwi-pushbutton |
13 | | - color="red" |
14 | | - @button-press=${action('button-press')} |
15 | | - @button-release=${action('button-release')} |
16 | | - ></wokwi-pushbutton> |
17 | | - ` |
18 | | - ) |
19 | | - .add( |
20 | | - 'Green', |
21 | | - () => |
22 | | - html` |
23 | | - <wokwi-pushbutton |
24 | | - color="green" |
25 | | - @button-press=${action('button-press')} |
26 | | - @button-release=${action('button-release')} |
27 | | - ></wokwi-pushbutton> |
28 | | - ` |
29 | | - ) |
30 | | - .add( |
31 | | - 'Four buttons', |
32 | | - () => |
33 | | - html` |
34 | | - <wokwi-pushbutton |
35 | | - color="red" |
36 | | - @button-press=${action('red button-press')} |
37 | | - @button-release=${action('red button-release')} |
38 | | - ></wokwi-pushbutton> |
39 | | - <wokwi-pushbutton |
40 | | - color="green" |
41 | | - @button-press=${action('green button-press')} |
42 | | - @button-release=${action('green button-release')} |
43 | | - ></wokwi-pushbutton> |
44 | | - <wokwi-pushbutton |
45 | | - color="blue" |
46 | | - @button-press=${action('blue button-press')} |
47 | | - @button-release=${action('blue button-release')} |
48 | | - ></wokwi-pushbutton> |
49 | | - <wokwi-pushbutton |
50 | | - color="white" |
51 | | - @button-press=${action('white button-press')} |
52 | | - @button-release=${action('white button-release')} |
53 | | - ></wokwi-pushbutton> |
54 | | - ` |
55 | | - ); |
| 5 | +export default { |
| 6 | + title: 'Pushbutton', |
| 7 | + component: 'wokwi-pushbutton', |
| 8 | +}; |
| 9 | + |
| 10 | +export const red = () => |
| 11 | + html` |
| 12 | + <wokwi-pushbutton |
| 13 | + color="red" |
| 14 | + @button-press=${action('button-press')} |
| 15 | + @button-release=${action('button-release')} |
| 16 | + ></wokwi-pushbutton> |
| 17 | + `; |
| 18 | + |
| 19 | +export const green = () => |
| 20 | + html` |
| 21 | + <wokwi-pushbutton |
| 22 | + color="green" |
| 23 | + @button-press=${action('button-press')} |
| 24 | + @button-release=${action('button-release')} |
| 25 | + ></wokwi-pushbutton> |
| 26 | + `; |
| 27 | + |
| 28 | +export const fourButtons = () => |
| 29 | + html` |
| 30 | + <wokwi-pushbutton |
| 31 | + color="red" |
| 32 | + @button-press=${action('red button-press')} |
| 33 | + @button-release=${action('red button-release')} |
| 34 | + ></wokwi-pushbutton> |
| 35 | + <wokwi-pushbutton |
| 36 | + color="green" |
| 37 | + @button-press=${action('green button-press')} |
| 38 | + @button-release=${action('green button-release')} |
| 39 | + ></wokwi-pushbutton> |
| 40 | + <wokwi-pushbutton |
| 41 | + color="blue" |
| 42 | + @button-press=${action('blue button-press')} |
| 43 | + @button-release=${action('blue button-release')} |
| 44 | + ></wokwi-pushbutton> |
| 45 | + <wokwi-pushbutton |
| 46 | + color="white" |
| 47 | + @button-press=${action('white button-press')} |
| 48 | + @button-release=${action('white button-release')} |
| 49 | + ></wokwi-pushbutton> |
| 50 | + `; |
0 commit comments