1
1
import { Meta , StoryObj } from '@storybook/react' ;
2
2
import { fn } from '@storybook/test' ;
3
- import { Button , Dialog , Flex , Radio } from '@strapi/design-system' ;
3
+ import { Button , Dialog , Field , Flex , Radio , SingleSelect , SingleSelectOption } from '@strapi/design-system' ;
4
4
import { WarningCircle } from '@strapi/icons' ;
5
5
import { outdent } from 'outdent' ;
6
6
@@ -33,20 +33,33 @@ const meta: Meta<DialogArgs> = {
33
33
code : outdent `
34
34
<Dialog.Root>
35
35
<Dialog.Trigger>
36
- <Button variant="danger">Delete </Button>
36
+ <Button variant="danger">Choose a fruit </Button>
37
37
</Dialog.Trigger>
38
38
<Dialog.Content>
39
39
<Dialog.Header>Confirmation</Dialog.Header>
40
- <Dialog.Body icon={<WarningCircle fill="danger600" />}>Are you sure you want to delete this?</Dialog.Body>
40
+ <Dialog.Body>
41
+ <Field.Root width="100%">
42
+ <Field.Label>What is your favourite fruit?</Field.Label>
43
+ <SingleSelect placeholder="Pick a fruit...">
44
+ <SingleSelectOption value="apple">Apple</SingleSelectOption>
45
+ <SingleSelectOption value="avocado">Avocado</SingleSelectOption>
46
+ <SingleSelectOption value="banana">Banana</SingleSelectOption>
47
+ <SingleSelectOption value="kiwi">Kiwi</SingleSelectOption>
48
+ <SingleSelectOption value="mango">Mango</SingleSelectOption>
49
+ <SingleSelectOption value="orange">Orange</SingleSelectOption>
50
+ <SingleSelectOption value="strawberry">Strawberry</SingleSelectOption>
51
+ </SingleSelect>
52
+ </Field.Root>
53
+ </Dialog.Body>
41
54
<Dialog.Footer>
42
55
<Dialog.Cancel>
43
56
<Button fullWidth variant="tertiary">
44
57
Cancel
45
58
</Button>
46
59
</Dialog.Cancel>
47
60
<Dialog.Action>
48
- <Button fullWidth variant="danger -light">
49
- Yes, delete
61
+ <Button fullWidth variant="success -light">
62
+ Confirm
50
63
</Button>
51
64
</Dialog.Action>
52
65
</Dialog.Footer>
@@ -60,24 +73,37 @@ const meta: Meta<DialogArgs> = {
60
73
return (
61
74
< Dialog . Root { ...args } >
62
75
< Dialog . Trigger >
63
- < Button variant = "danger" > Delete </ Button >
76
+ < Button variant = "default" > Fruit manager </ Button >
64
77
</ Dialog . Trigger >
65
78
< Dialog . Content
66
79
onOpenAutoFocus = { onOpenAutoFocus }
67
80
onCloseAutoFocus = { onCloseAutoFocus }
68
81
onEscapeKeyDown = { onEscapeKeyDown }
69
82
>
70
83
< Dialog . Header > Confirmation</ Dialog . Header >
71
- < Dialog . Body icon = { icon } > Are you sure you want to delete this?</ Dialog . Body >
84
+ < Dialog . Body >
85
+ < Field . Root width = "100%" >
86
+ < Field . Label > What is your favourite fruit?</ Field . Label >
87
+ < SingleSelect placeholder = "Pick a fruit..." >
88
+ < SingleSelectOption value = "apple" > Apple</ SingleSelectOption >
89
+ < SingleSelectOption value = "avocado" > Avocado</ SingleSelectOption >
90
+ < SingleSelectOption value = "banana" > Banana</ SingleSelectOption >
91
+ < SingleSelectOption value = "kiwi" > Kiwi</ SingleSelectOption >
92
+ < SingleSelectOption value = "mango" > Mango</ SingleSelectOption >
93
+ < SingleSelectOption value = "orange" > Orange</ SingleSelectOption >
94
+ < SingleSelectOption value = "strawberry" > Strawberry</ SingleSelectOption >
95
+ </ SingleSelect >
96
+ </ Field . Root >
97
+ </ Dialog . Body >
72
98
< Dialog . Footer >
73
99
< Dialog . Cancel >
74
100
< Button fullWidth variant = "tertiary" >
75
101
Cancel
76
102
</ Button >
77
103
</ Dialog . Cancel >
78
104
< Dialog . Action >
79
- < Button fullWidth variant = "danger -light" >
80
- Yes, delete
105
+ < Button fullWidth variant = "success -light" >
106
+ Confirm
81
107
</ Button >
82
108
</ Dialog . Action >
83
109
</ Dialog . Footer >
@@ -108,7 +134,7 @@ export const Children = {
108
134
return (
109
135
< Dialog . Root { ...args } >
110
136
< Dialog . Trigger >
111
- < Button variant = "danger" > Delete </ Button >
137
+ < Button variant = "default" > Fruit manager </ Button >
112
138
</ Dialog . Trigger >
113
139
< Dialog . Content
114
140
onOpenAutoFocus = { onOpenAutoFocus }
0 commit comments