File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ <script >
2+ import { Meta , Template , Story } from " @storybook/addon-svelte-csf"
3+ import { Dialog } from " ../components/mdc"
4+ import { copyAndModifyArgs } from " ./helpers.js"
5+
6+ const args = {
7+ onChosen : e => console .log (e .detail ),
8+ onClosed : () => {},
9+ open: true ,
10+ class: ' ' , // only works for global classes
11+ }
12+ </script >
13+
14+ <Meta
15+ title =" Atoms/Dialog.Alert"
16+ component ={Dialog .Alert }
17+ />
18+
19+ <Template let:args >
20+ <Dialog .Alert {...args } on:chosen ={args .onChosen } on:closed ={args .onClosed }/>
21+ </Template >
22+
23+ <Story
24+ name =" Default"
25+ {args }
26+ />
27+
28+ <Story
29+ name =" Title"
30+ args ={
31+ copyAndModifyArgs (args , {title: ' title' })
32+ }
33+ />
34+
35+ <Story
36+ name =" Default action"
37+ args ={
38+ copyAndModifyArgs (args , {defaultAction: ' cancel' })
39+ }
40+ />
41+
42+ <Story
43+ name =" Buttons"
44+ args ={
45+ copyAndModifyArgs (args , {
46+ buttons: [
47+ {
48+ label: ' quit' ,
49+ action: ' quit' ,
50+ class: ' mdc-dialog__button'
51+ },
52+ {
53+ label: ' discard' ,
54+ action: ' discard' ,
55+ class: ' mdc-dialog__button'
56+ }
57+ ]
58+ })
59+ }
60+ />
You can’t perform that action at this time.
0 commit comments