@a2v2ai/uikit 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Alert/Alert.d.ts +13 -0
- package/Alert/Alert.js +64 -0
- package/AlertDialog/AlertDialog.d.ts +43 -0
- package/AlertDialog/AlertDialog.js +121 -0
- package/Avatar/Avatar.d.ts +14 -0
- package/Avatar/Avatar.js +64 -0
- package/Badge/Badge.d.ts +11 -0
- package/Badge/Badge.js +26 -0
- package/Breadcrumb/Breadcrumb.d.ts +19 -0
- package/Breadcrumb/Breadcrumb.js +65 -0
- package/Button/Button.d.ts +20 -0
- package/Button/Button.js +75 -0
- package/Calendar/Calendar.d.ts +16 -0
- package/Calendar/Calendar.js +113 -0
- package/Card/Card.d.ts +16 -0
- package/Card/Card.js +70 -0
- package/ChatBubble/ChatBubble.d.ts +33 -0
- package/ChatBubble/ChatBubble.js +133 -0
- package/Checkbox/Checkbox.d.ts +12 -0
- package/Checkbox/Checkbox.js +57 -0
- package/Dialog/Dialog.d.ts +35 -0
- package/Dialog/Dialog.js +130 -0
- package/Drawer/Drawer.d.ts +33 -0
- package/Drawer/Drawer.js +69 -0
- package/DropdownMenu/DropdownMenu.d.ts +27 -0
- package/DropdownMenu/DropdownMenu.js +85 -0
- package/ErrorMessage/ErrorMessage.d.ts +27 -0
- package/ErrorMessage/ErrorMessage.js +15 -0
- package/Flex/Flex.d.ts +31 -0
- package/Flex/Flex.js +101 -0
- package/IconButton/IconButton.d.ts +23 -0
- package/IconButton/IconButton.js +85 -0
- package/Input/Input.d.ts +22 -0
- package/Input/Input.js +75 -0
- package/InputOTP/InputOTP.d.ts +20 -0
- package/InputOTP/InputOTP.js +85 -0
- package/Label/Label.d.ts +12 -0
- package/Label/Label.js +57 -0
- package/Loader/Loader.d.ts +21 -0
- package/Loader/Loader.js +67 -0
- package/Popover/Popover.d.ts +7 -0
- package/Popover/Popover.js +49 -0
- package/Progress/Progress.d.ts +17 -0
- package/Progress/Progress.js +71 -0
- package/RadioGroup/RadioGroup.d.ts +13 -0
- package/RadioGroup/RadioGroup.js +64 -0
- package/ScrollArea/ScrollArea.d.ts +5 -0
- package/ScrollArea/ScrollArea.js +48 -0
- package/Select/Select.d.ts +21 -0
- package/Select/Select.js +85 -0
- package/Separator/Separator.d.ts +4 -0
- package/Separator/Separator.js +43 -0
- package/Skeleton/Skeleton.d.ts +4 -0
- package/Skeleton/Skeleton.js +8 -0
- package/Spinner/Spinner.d.ts +19 -0
- package/Spinner/Spinner.js +68 -0
- package/Switch/Switch.d.ts +12 -0
- package/Switch/Switch.js +67 -0
- package/Tabs/Tabs.d.ts +15 -0
- package/Tabs/Tabs.js +64 -0
- package/Textarea/Textarea.d.ts +14 -0
- package/Textarea/Textarea.js +64 -0
- package/Toast/Toast.d.ts +12 -0
- package/Toast/Toast.js +29 -0
- package/Tooltip/Tooltip.d.ts +17 -0
- package/Tooltip/Tooltip.js +68 -0
- package/Typography/Typography.d.ts +19 -0
- package/Typography/Typography.js +131 -0
- package/helpers.d.ts +4 -0
- package/helpers.js +13 -0
- package/icons.d.ts +1 -0
- package/icons.js +18 -0
- package/index.css +21 -0
- package/index.d.ts +35 -0
- package/index.js +183 -0
- package/lib/utils.d.ts +3 -0
- package/lib/utils.js +18 -0
- package/package.json +1 -1
- package/Alert/Alert.stories.tsx +0 -121
- package/Alert/Alert.tsx +0 -71
- package/AlertDialog/AlertDialog.stories.tsx +0 -665
- package/AlertDialog/AlertDialog.tsx +0 -241
- package/Avatar/Avatar.stories.tsx +0 -128
- package/Avatar/Avatar.tsx +0 -71
- package/Badge/Badge.stories.tsx +0 -76
- package/Badge/Badge.tsx +0 -39
- package/Breadcrumb/Breadcrumb.stories.tsx +0 -231
- package/Breadcrumb/Breadcrumb.tsx +0 -114
- package/Button/Button.stories.tsx +0 -684
- package/Button/Button.tsx +0 -90
- package/Calendar/Calendar.stories.tsx +0 -207
- package/Calendar/Calendar.tsx +0 -232
- package/Card/Card.stories.tsx +0 -136
- package/Card/Card.tsx +0 -96
- package/ChatBubble/ChatBubble.stories.tsx +0 -307
- package/ChatBubble/ChatBubble.tsx +0 -167
- package/Checkbox/Checkbox.stories.tsx +0 -137
- package/Checkbox/Checkbox.tsx +0 -53
- package/Drawer/Drawer.stories.tsx +0 -721
- package/Drawer/Drawer.tsx +0 -201
- package/DropdownMenu/DropdownMenu.stories.tsx +0 -251
- package/DropdownMenu/DropdownMenu.tsx +0 -199
- package/ErrorMessage/ErrorMessage.stories.tsx +0 -159
- package/ErrorMessage/ErrorMessage.tsx +0 -55
- package/Flex/Flex.tsx +0 -102
- package/IconButton/IconButton.stories.tsx +0 -566
- package/IconButton/IconButton.tsx +0 -95
- package/Input/Input.stories.tsx +0 -456
- package/Input/Input.tsx +0 -129
- package/InputOTP/InputOTP.stories.tsx +0 -246
- package/InputOTP/InputOTP.tsx +0 -127
- package/Label/Label.stories.tsx +0 -105
- package/Label/Label.tsx +0 -43
- package/Loader/Loader.stories.tsx +0 -170
- package/Loader/Loader.tsx +0 -62
- package/Popover/Popover.stories.tsx +0 -133
- package/Popover/Popover.tsx +0 -31
- package/Progress/Progress.stories.tsx +0 -146
- package/Progress/Progress.tsx +0 -67
- package/RadioGroup/RadioGroup.stories.tsx +0 -159
- package/RadioGroup/RadioGroup.tsx +0 -68
- package/ScrollArea/ScrollArea.stories.tsx +0 -136
- package/ScrollArea/ScrollArea.tsx +0 -46
- package/Select/Select.stories.tsx +0 -242
- package/Select/Select.tsx +0 -180
- package/Separator/Separator.stories.tsx +0 -110
- package/Separator/Separator.tsx +0 -29
- package/Skeleton/Skeleton.stories.tsx +0 -117
- package/Skeleton/Skeleton.tsx +0 -16
- package/Spinner/Spinner.stories.tsx +0 -210
- package/Spinner/Spinner.tsx +0 -78
- package/Switch/Switch.stories.tsx +0 -146
- package/Switch/Switch.tsx +0 -59
- package/Tabs/Tabs.stories.tsx +0 -197
- package/Tabs/Tabs.tsx +0 -74
- package/Textarea/Textarea.stories.tsx +0 -170
- package/Textarea/Textarea.tsx +0 -51
- package/Toast/Toast.stories.tsx +0 -285
- package/Toast/Toast.tsx +0 -59
- package/Tooltip/Tooltip.stories.tsx +0 -463
- package/Tooltip/Tooltip.tsx +0 -96
- package/Typography/Typography.stories.tsx +0 -235
- package/Typography/Typography.tsx +0 -171
- package/helpers.ts +0 -5
- package/icons.ts +0 -2
- package/index.ts +0 -136
- package/lib/utils.ts +0 -15
- package/tsconfig.json +0 -24
|
@@ -1,665 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
import { Button } from "../Button/Button"
|
|
3
|
-
import { Input } from "../Input/Input"
|
|
4
|
-
import { Typography } from "../Typography/Typography"
|
|
5
|
-
import {
|
|
6
|
-
AlertDialog,
|
|
7
|
-
AlertDialogTrigger,
|
|
8
|
-
AlertDialogContent,
|
|
9
|
-
AlertDialogHeader,
|
|
10
|
-
AlertDialogFooter,
|
|
11
|
-
AlertDialogTitle,
|
|
12
|
-
AlertDialogDescription,
|
|
13
|
-
AlertDialogBody,
|
|
14
|
-
AlertDialogAction,
|
|
15
|
-
AlertDialogCancel,
|
|
16
|
-
} from "./AlertDialog"
|
|
17
|
-
|
|
18
|
-
const meta: Meta<typeof AlertDialogContent> = {
|
|
19
|
-
title: "Components/AlertDialog",
|
|
20
|
-
component: AlertDialogContent,
|
|
21
|
-
parameters: {
|
|
22
|
-
layout: "centered",
|
|
23
|
-
},
|
|
24
|
-
tags: ["autodocs"],
|
|
25
|
-
argTypes: {
|
|
26
|
-
type: {
|
|
27
|
-
control: "select",
|
|
28
|
-
options: ["desktop", "mobile"],
|
|
29
|
-
description: "The size type of the alert dialog (desktop or mobile)",
|
|
30
|
-
},
|
|
31
|
-
scrollable: {
|
|
32
|
-
control: "boolean",
|
|
33
|
-
description: "Whether the alert dialog content is scrollable",
|
|
34
|
-
},
|
|
35
|
-
showCloseButton: {
|
|
36
|
-
control: "boolean",
|
|
37
|
-
description: "Whether to show the close button",
|
|
38
|
-
},
|
|
39
|
-
closeButtonVariant: {
|
|
40
|
-
control: "select",
|
|
41
|
-
options: ["default", "icon-button"],
|
|
42
|
-
description: "The style variant of the close button",
|
|
43
|
-
},
|
|
44
|
-
loading: {
|
|
45
|
-
control: "boolean",
|
|
46
|
-
description: "Show a loading spinner overlay on the alert dialog",
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default meta
|
|
52
|
-
type Story = StoryObj<typeof AlertDialogContent>
|
|
53
|
-
|
|
54
|
-
export const Default: Story = {
|
|
55
|
-
render: (args) => (
|
|
56
|
-
<AlertDialog>
|
|
57
|
-
<AlertDialogTrigger asChild>
|
|
58
|
-
<Button>Open Alert Dialog</Button>
|
|
59
|
-
</AlertDialogTrigger>
|
|
60
|
-
<AlertDialogContent {...args}>
|
|
61
|
-
<AlertDialogHeader>
|
|
62
|
-
<AlertDialogTitle>Alert Dialog Title</AlertDialogTitle>
|
|
63
|
-
</AlertDialogHeader>
|
|
64
|
-
<AlertDialogBody>
|
|
65
|
-
<AlertDialogDescription>
|
|
66
|
-
This is a description of the alert dialog content. You can add any content here.
|
|
67
|
-
</AlertDialogDescription>
|
|
68
|
-
</AlertDialogBody>
|
|
69
|
-
<AlertDialogFooter>
|
|
70
|
-
<AlertDialogCancel asChild>
|
|
71
|
-
<Button variant="outline">Cancel</Button>
|
|
72
|
-
</AlertDialogCancel>
|
|
73
|
-
<AlertDialogAction asChild>
|
|
74
|
-
<Button>Confirm</Button>
|
|
75
|
-
</AlertDialogAction>
|
|
76
|
-
</AlertDialogFooter>
|
|
77
|
-
</AlertDialogContent>
|
|
78
|
-
</AlertDialog>
|
|
79
|
-
),
|
|
80
|
-
args: {
|
|
81
|
-
type: "desktop",
|
|
82
|
-
scrollable: false,
|
|
83
|
-
showCloseButton: true,
|
|
84
|
-
closeButtonVariant: "default",
|
|
85
|
-
},
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export const Mobile: Story = {
|
|
89
|
-
render: (args) => (
|
|
90
|
-
<AlertDialog>
|
|
91
|
-
<AlertDialogTrigger asChild>
|
|
92
|
-
<Button>Open Mobile Alert Dialog</Button>
|
|
93
|
-
</AlertDialogTrigger>
|
|
94
|
-
<AlertDialogContent {...args}>
|
|
95
|
-
<AlertDialogHeader>
|
|
96
|
-
<AlertDialogTitle>Mobile Alert Dialog</AlertDialogTitle>
|
|
97
|
-
</AlertDialogHeader>
|
|
98
|
-
<AlertDialogBody>
|
|
99
|
-
<AlertDialogDescription>
|
|
100
|
-
This is a mobile-sized alert dialog with narrower width.
|
|
101
|
-
</AlertDialogDescription>
|
|
102
|
-
</AlertDialogBody>
|
|
103
|
-
<AlertDialogFooter>
|
|
104
|
-
<AlertDialogCancel asChild>
|
|
105
|
-
<Button variant="outline">Cancel</Button>
|
|
106
|
-
</AlertDialogCancel>
|
|
107
|
-
<AlertDialogAction asChild>
|
|
108
|
-
<Button>Confirm</Button>
|
|
109
|
-
</AlertDialogAction>
|
|
110
|
-
</AlertDialogFooter>
|
|
111
|
-
</AlertDialogContent>
|
|
112
|
-
</AlertDialog>
|
|
113
|
-
),
|
|
114
|
-
args: {
|
|
115
|
-
type: "mobile",
|
|
116
|
-
showCloseButton: true,
|
|
117
|
-
},
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export const Scrollable: Story = {
|
|
121
|
-
render: (args) => (
|
|
122
|
-
<AlertDialog>
|
|
123
|
-
<AlertDialogTrigger asChild>
|
|
124
|
-
<Button>Open Scrollable Alert Dialog</Button>
|
|
125
|
-
</AlertDialogTrigger>
|
|
126
|
-
<AlertDialogContent {...args}>
|
|
127
|
-
<AlertDialogHeader>
|
|
128
|
-
<AlertDialogTitle>Scrollable Content</AlertDialogTitle>
|
|
129
|
-
</AlertDialogHeader>
|
|
130
|
-
<AlertDialogBody className="max-h-[300px] overflow-y-auto">
|
|
131
|
-
<div className="space-y-4">
|
|
132
|
-
{Array.from({ length: 20 }).map((_, i) => (
|
|
133
|
-
<p key={i} className="text-sm text-grey-600">
|
|
134
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Paragraph {i + 1}.
|
|
135
|
-
</p>
|
|
136
|
-
))}
|
|
137
|
-
</div>
|
|
138
|
-
</AlertDialogBody>
|
|
139
|
-
<AlertDialogFooter>
|
|
140
|
-
<AlertDialogCancel asChild>
|
|
141
|
-
<Button variant="outline">Cancel</Button>
|
|
142
|
-
</AlertDialogCancel>
|
|
143
|
-
<AlertDialogAction asChild>
|
|
144
|
-
<Button>Confirm</Button>
|
|
145
|
-
</AlertDialogAction>
|
|
146
|
-
</AlertDialogFooter>
|
|
147
|
-
</AlertDialogContent>
|
|
148
|
-
</AlertDialog>
|
|
149
|
-
),
|
|
150
|
-
args: {
|
|
151
|
-
type: "desktop",
|
|
152
|
-
scrollable: true,
|
|
153
|
-
},
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export const WithForm: Story = {
|
|
157
|
-
render: (args) => (
|
|
158
|
-
<AlertDialog>
|
|
159
|
-
<AlertDialogTrigger asChild>
|
|
160
|
-
<Button>Upgrade Subscription</Button>
|
|
161
|
-
</AlertDialogTrigger>
|
|
162
|
-
<AlertDialogContent {...args}>
|
|
163
|
-
<AlertDialogHeader>
|
|
164
|
-
<AlertDialogTitle>Alert Dialog title</AlertDialogTitle>
|
|
165
|
-
</AlertDialogHeader>
|
|
166
|
-
<AlertDialogBody>
|
|
167
|
-
<Typography variant="h4" className="mb-2">Upgrade your subscription</Typography>
|
|
168
|
-
<Typography variant="body2" color="grey-500" className="mb-6">
|
|
169
|
-
You have run out of credits. To continue using the platform, please upgrade your subscription.
|
|
170
|
-
</Typography>
|
|
171
|
-
<div className="space-y-4">
|
|
172
|
-
<div>
|
|
173
|
-
<Typography variant="caption" color="grey-600" className="mb-1.5 block uppercase tracking-wider">Card number</Typography>
|
|
174
|
-
<Input placeholder="1234 1234 1234 1234" />
|
|
175
|
-
</div>
|
|
176
|
-
<div className="grid grid-cols-2 gap-4">
|
|
177
|
-
<div>
|
|
178
|
-
<Typography variant="caption" color="grey-600" className="mb-1.5 block uppercase tracking-wider">Expiry</Typography>
|
|
179
|
-
<Input placeholder="MM/YY" />
|
|
180
|
-
</div>
|
|
181
|
-
<div>
|
|
182
|
-
<Typography variant="caption" color="grey-600" className="mb-1.5 block uppercase tracking-wider">CVC</Typography>
|
|
183
|
-
<Input placeholder="CVC" />
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
</AlertDialogBody>
|
|
188
|
-
<AlertDialogFooter>
|
|
189
|
-
<AlertDialogCancel asChild>
|
|
190
|
-
<Button variant="outline">Cancel</Button>
|
|
191
|
-
</AlertDialogCancel>
|
|
192
|
-
<AlertDialogAction asChild>
|
|
193
|
-
<Button>Confirm</Button>
|
|
194
|
-
</AlertDialogAction>
|
|
195
|
-
</AlertDialogFooter>
|
|
196
|
-
</AlertDialogContent>
|
|
197
|
-
</AlertDialog>
|
|
198
|
-
),
|
|
199
|
-
args: {
|
|
200
|
-
type: "desktop",
|
|
201
|
-
showCloseButton: true,
|
|
202
|
-
},
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export const IconButtonClose: Story = {
|
|
206
|
-
render: (args) => (
|
|
207
|
-
<AlertDialog>
|
|
208
|
-
<AlertDialogTrigger asChild>
|
|
209
|
-
<Button>Open with Icon Button Close</Button>
|
|
210
|
-
</AlertDialogTrigger>
|
|
211
|
-
<AlertDialogContent {...args}>
|
|
212
|
-
<AlertDialogHeader>
|
|
213
|
-
<AlertDialogTitle>Icon Button Close</AlertDialogTitle>
|
|
214
|
-
</AlertDialogHeader>
|
|
215
|
-
<AlertDialogBody>
|
|
216
|
-
<AlertDialogDescription>
|
|
217
|
-
This alert dialog uses an icon button style for the close button.
|
|
218
|
-
</AlertDialogDescription>
|
|
219
|
-
</AlertDialogBody>
|
|
220
|
-
<AlertDialogFooter>
|
|
221
|
-
<AlertDialogCancel asChild>
|
|
222
|
-
<Button variant="outline">Cancel</Button>
|
|
223
|
-
</AlertDialogCancel>
|
|
224
|
-
<AlertDialogAction asChild>
|
|
225
|
-
<Button>Confirm</Button>
|
|
226
|
-
</AlertDialogAction>
|
|
227
|
-
</AlertDialogFooter>
|
|
228
|
-
</AlertDialogContent>
|
|
229
|
-
</AlertDialog>
|
|
230
|
-
),
|
|
231
|
-
args: {
|
|
232
|
-
type: "desktop",
|
|
233
|
-
showCloseButton: true,
|
|
234
|
-
closeButtonVariant: "icon-button",
|
|
235
|
-
},
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export const CloseOnly: Story = {
|
|
239
|
-
render: (args) => (
|
|
240
|
-
<AlertDialog>
|
|
241
|
-
<AlertDialogTrigger asChild>
|
|
242
|
-
<Button>Open Close Only Alert Dialog</Button>
|
|
243
|
-
</AlertDialogTrigger>
|
|
244
|
-
<AlertDialogContent {...args}>
|
|
245
|
-
<AlertDialogBody className="pt-8">
|
|
246
|
-
<AlertDialogDescription>
|
|
247
|
-
This alert dialog has only a close button in the header, no title.
|
|
248
|
-
</AlertDialogDescription>
|
|
249
|
-
</AlertDialogBody>
|
|
250
|
-
<AlertDialogFooter>
|
|
251
|
-
<AlertDialogCancel asChild>
|
|
252
|
-
<Button variant="outline">Cancel</Button>
|
|
253
|
-
</AlertDialogCancel>
|
|
254
|
-
<AlertDialogAction asChild>
|
|
255
|
-
<Button>Confirm</Button>
|
|
256
|
-
</AlertDialogAction>
|
|
257
|
-
</AlertDialogFooter>
|
|
258
|
-
</AlertDialogContent>
|
|
259
|
-
</AlertDialog>
|
|
260
|
-
),
|
|
261
|
-
args: {
|
|
262
|
-
type: "desktop",
|
|
263
|
-
showCloseButton: true,
|
|
264
|
-
},
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// Footer Variants
|
|
268
|
-
export const FooterButtonsRight: Story = {
|
|
269
|
-
render: (args) => (
|
|
270
|
-
<AlertDialog>
|
|
271
|
-
<AlertDialogTrigger asChild>
|
|
272
|
-
<Button>2 Buttons Right</Button>
|
|
273
|
-
</AlertDialogTrigger>
|
|
274
|
-
<AlertDialogContent {...args}>
|
|
275
|
-
<AlertDialogHeader>
|
|
276
|
-
<AlertDialogTitle>Footer: 2 Buttons Right</AlertDialogTitle>
|
|
277
|
-
</AlertDialogHeader>
|
|
278
|
-
<AlertDialogBody>
|
|
279
|
-
<AlertDialogDescription>
|
|
280
|
-
Footer with two buttons aligned to the right.
|
|
281
|
-
</AlertDialogDescription>
|
|
282
|
-
</AlertDialogBody>
|
|
283
|
-
<AlertDialogFooter type="buttons-right">
|
|
284
|
-
<AlertDialogCancel asChild>
|
|
285
|
-
<Button variant="outline">Label</Button>
|
|
286
|
-
</AlertDialogCancel>
|
|
287
|
-
<AlertDialogAction asChild>
|
|
288
|
-
<Button>Label</Button>
|
|
289
|
-
</AlertDialogAction>
|
|
290
|
-
</AlertDialogFooter>
|
|
291
|
-
</AlertDialogContent>
|
|
292
|
-
</AlertDialog>
|
|
293
|
-
),
|
|
294
|
-
args: {
|
|
295
|
-
type: "desktop",
|
|
296
|
-
showCloseButton: true,
|
|
297
|
-
},
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
export const FooterFullWidth: Story = {
|
|
301
|
-
render: (args) => (
|
|
302
|
-
<AlertDialog>
|
|
303
|
-
<AlertDialogTrigger asChild>
|
|
304
|
-
<Button>2 Full-width Buttons</Button>
|
|
305
|
-
</AlertDialogTrigger>
|
|
306
|
-
<AlertDialogContent {...args}>
|
|
307
|
-
<AlertDialogHeader>
|
|
308
|
-
<AlertDialogTitle>Footer: 2 Full-width</AlertDialogTitle>
|
|
309
|
-
</AlertDialogHeader>
|
|
310
|
-
<AlertDialogBody>
|
|
311
|
-
<AlertDialogDescription>
|
|
312
|
-
Footer with two full-width buttons.
|
|
313
|
-
</AlertDialogDescription>
|
|
314
|
-
</AlertDialogBody>
|
|
315
|
-
<AlertDialogFooter type="full-width">
|
|
316
|
-
<AlertDialogCancel asChild>
|
|
317
|
-
<Button variant="outline">Label</Button>
|
|
318
|
-
</AlertDialogCancel>
|
|
319
|
-
<AlertDialogAction asChild>
|
|
320
|
-
<Button>Label</Button>
|
|
321
|
-
</AlertDialogAction>
|
|
322
|
-
</AlertDialogFooter>
|
|
323
|
-
</AlertDialogContent>
|
|
324
|
-
</AlertDialog>
|
|
325
|
-
),
|
|
326
|
-
args: {
|
|
327
|
-
type: "desktop",
|
|
328
|
-
showCloseButton: true,
|
|
329
|
-
},
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export const FooterSingleFullWidth: Story = {
|
|
333
|
-
render: (args) => (
|
|
334
|
-
<AlertDialog>
|
|
335
|
-
<AlertDialogTrigger asChild>
|
|
336
|
-
<Button>Single Full-width Button</Button>
|
|
337
|
-
</AlertDialogTrigger>
|
|
338
|
-
<AlertDialogContent {...args}>
|
|
339
|
-
<AlertDialogHeader>
|
|
340
|
-
<AlertDialogTitle>Footer: Single Full-width</AlertDialogTitle>
|
|
341
|
-
</AlertDialogHeader>
|
|
342
|
-
<AlertDialogBody>
|
|
343
|
-
<AlertDialogDescription>
|
|
344
|
-
Footer with a single full-width button.
|
|
345
|
-
</AlertDialogDescription>
|
|
346
|
-
</AlertDialogBody>
|
|
347
|
-
<AlertDialogFooter type="single-full-width">
|
|
348
|
-
<AlertDialogAction asChild>
|
|
349
|
-
<Button>Label</Button>
|
|
350
|
-
</AlertDialogAction>
|
|
351
|
-
</AlertDialogFooter>
|
|
352
|
-
</AlertDialogContent>
|
|
353
|
-
</AlertDialog>
|
|
354
|
-
),
|
|
355
|
-
args: {
|
|
356
|
-
type: "desktop",
|
|
357
|
-
showCloseButton: true,
|
|
358
|
-
},
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
// Loading State
|
|
362
|
-
export const Loading: Story = {
|
|
363
|
-
render: (args) => (
|
|
364
|
-
<AlertDialog>
|
|
365
|
-
<AlertDialogTrigger asChild>
|
|
366
|
-
<Button>Open Loading Alert Dialog</Button>
|
|
367
|
-
</AlertDialogTrigger>
|
|
368
|
-
<AlertDialogContent {...args}>
|
|
369
|
-
<AlertDialogHeader>
|
|
370
|
-
<AlertDialogTitle>Processing...</AlertDialogTitle>
|
|
371
|
-
</AlertDialogHeader>
|
|
372
|
-
<AlertDialogBody>
|
|
373
|
-
<AlertDialogDescription>
|
|
374
|
-
Please wait while we process your request.
|
|
375
|
-
</AlertDialogDescription>
|
|
376
|
-
</AlertDialogBody>
|
|
377
|
-
<AlertDialogFooter>
|
|
378
|
-
<AlertDialogCancel asChild>
|
|
379
|
-
<Button variant="outline" disabled>Cancel</Button>
|
|
380
|
-
</AlertDialogCancel>
|
|
381
|
-
<AlertDialogAction asChild>
|
|
382
|
-
<Button disabled>Confirm</Button>
|
|
383
|
-
</AlertDialogAction>
|
|
384
|
-
</AlertDialogFooter>
|
|
385
|
-
</AlertDialogContent>
|
|
386
|
-
</AlertDialog>
|
|
387
|
-
),
|
|
388
|
-
args: {
|
|
389
|
-
type: "desktop",
|
|
390
|
-
loading: true,
|
|
391
|
-
},
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
// All Variants Story
|
|
395
|
-
export const AllVariants: Story = {
|
|
396
|
-
render: () => (
|
|
397
|
-
<div style={{ overflowX: "auto" }}>
|
|
398
|
-
<div style={{ minWidth: "fit-content" }}>
|
|
399
|
-
<div className="space-y-8">
|
|
400
|
-
{/* AlertDialog Types */}
|
|
401
|
-
<div>
|
|
402
|
-
<Typography variant="h4" className="mb-4">Alert Dialog Types</Typography>
|
|
403
|
-
<div className="flex gap-4 flex-wrap">
|
|
404
|
-
<AlertDialog>
|
|
405
|
-
<AlertDialogTrigger asChild>
|
|
406
|
-
<Button variant="outline">Desktop</Button>
|
|
407
|
-
</AlertDialogTrigger>
|
|
408
|
-
<AlertDialogContent type="desktop">
|
|
409
|
-
<AlertDialogHeader>
|
|
410
|
-
<AlertDialogTitle>Desktop Alert Dialog</AlertDialogTitle>
|
|
411
|
-
</AlertDialogHeader>
|
|
412
|
-
<AlertDialogBody>
|
|
413
|
-
<AlertDialogDescription>This is a desktop-sized alert dialog (max-width: 640px).</AlertDialogDescription>
|
|
414
|
-
</AlertDialogBody>
|
|
415
|
-
<AlertDialogFooter>
|
|
416
|
-
<AlertDialogCancel asChild>
|
|
417
|
-
<Button variant="outline">Cancel</Button>
|
|
418
|
-
</AlertDialogCancel>
|
|
419
|
-
<AlertDialogAction asChild>
|
|
420
|
-
<Button>Confirm</Button>
|
|
421
|
-
</AlertDialogAction>
|
|
422
|
-
</AlertDialogFooter>
|
|
423
|
-
</AlertDialogContent>
|
|
424
|
-
</AlertDialog>
|
|
425
|
-
|
|
426
|
-
<AlertDialog>
|
|
427
|
-
<AlertDialogTrigger asChild>
|
|
428
|
-
<Button variant="outline">Desktop Scrollable</Button>
|
|
429
|
-
</AlertDialogTrigger>
|
|
430
|
-
<AlertDialogContent type="desktop" scrollable>
|
|
431
|
-
<AlertDialogHeader>
|
|
432
|
-
<AlertDialogTitle>Desktop Scrollable</AlertDialogTitle>
|
|
433
|
-
</AlertDialogHeader>
|
|
434
|
-
<AlertDialogBody className="max-h-[200px] overflow-y-auto">
|
|
435
|
-
{Array.from({ length: 10 }).map((_, i) => (
|
|
436
|
-
<p key={i} className="text-sm text-grey-600 mb-2">
|
|
437
|
-
Lorem ipsum dolor sit amet. Paragraph {i + 1}.
|
|
438
|
-
</p>
|
|
439
|
-
))}
|
|
440
|
-
</AlertDialogBody>
|
|
441
|
-
<AlertDialogFooter>
|
|
442
|
-
<AlertDialogCancel asChild>
|
|
443
|
-
<Button variant="outline">Cancel</Button>
|
|
444
|
-
</AlertDialogCancel>
|
|
445
|
-
<AlertDialogAction asChild>
|
|
446
|
-
<Button>Confirm</Button>
|
|
447
|
-
</AlertDialogAction>
|
|
448
|
-
</AlertDialogFooter>
|
|
449
|
-
</AlertDialogContent>
|
|
450
|
-
</AlertDialog>
|
|
451
|
-
|
|
452
|
-
<AlertDialog>
|
|
453
|
-
<AlertDialogTrigger asChild>
|
|
454
|
-
<Button variant="outline">Mobile</Button>
|
|
455
|
-
</AlertDialogTrigger>
|
|
456
|
-
<AlertDialogContent type="mobile">
|
|
457
|
-
<AlertDialogHeader>
|
|
458
|
-
<AlertDialogTitle>Mobile Alert Dialog</AlertDialogTitle>
|
|
459
|
-
</AlertDialogHeader>
|
|
460
|
-
<AlertDialogBody>
|
|
461
|
-
<AlertDialogDescription>This is a mobile-sized alert dialog (max-width: 320px).</AlertDialogDescription>
|
|
462
|
-
</AlertDialogBody>
|
|
463
|
-
<AlertDialogFooter>
|
|
464
|
-
<AlertDialogCancel asChild>
|
|
465
|
-
<Button variant="outline">Cancel</Button>
|
|
466
|
-
</AlertDialogCancel>
|
|
467
|
-
<AlertDialogAction asChild>
|
|
468
|
-
<Button>Confirm</Button>
|
|
469
|
-
</AlertDialogAction>
|
|
470
|
-
</AlertDialogFooter>
|
|
471
|
-
</AlertDialogContent>
|
|
472
|
-
</AlertDialog>
|
|
473
|
-
|
|
474
|
-
<AlertDialog>
|
|
475
|
-
<AlertDialogTrigger asChild>
|
|
476
|
-
<Button variant="outline">Mobile Scrollable</Button>
|
|
477
|
-
</AlertDialogTrigger>
|
|
478
|
-
<AlertDialogContent type="mobile" scrollable>
|
|
479
|
-
<AlertDialogHeader>
|
|
480
|
-
<AlertDialogTitle>Mobile Scrollable</AlertDialogTitle>
|
|
481
|
-
</AlertDialogHeader>
|
|
482
|
-
<AlertDialogBody className="max-h-[200px] overflow-y-auto">
|
|
483
|
-
{Array.from({ length: 10 }).map((_, i) => (
|
|
484
|
-
<p key={i} className="text-sm text-grey-600 mb-2">
|
|
485
|
-
Lorem ipsum. Paragraph {i + 1}.
|
|
486
|
-
</p>
|
|
487
|
-
))}
|
|
488
|
-
</AlertDialogBody>
|
|
489
|
-
<AlertDialogFooter>
|
|
490
|
-
<AlertDialogCancel asChild>
|
|
491
|
-
<Button variant="outline">Cancel</Button>
|
|
492
|
-
</AlertDialogCancel>
|
|
493
|
-
<AlertDialogAction asChild>
|
|
494
|
-
<Button>Confirm</Button>
|
|
495
|
-
</AlertDialogAction>
|
|
496
|
-
</AlertDialogFooter>
|
|
497
|
-
</AlertDialogContent>
|
|
498
|
-
</AlertDialog>
|
|
499
|
-
</div>
|
|
500
|
-
</div>
|
|
501
|
-
|
|
502
|
-
{/* Header Types */}
|
|
503
|
-
<div>
|
|
504
|
-
<Typography variant="h4" className="mb-4">Header Types</Typography>
|
|
505
|
-
<div className="flex gap-4 flex-wrap">
|
|
506
|
-
<AlertDialog>
|
|
507
|
-
<AlertDialogTrigger asChild>
|
|
508
|
-
<Button variant="outline">With Title</Button>
|
|
509
|
-
</AlertDialogTrigger>
|
|
510
|
-
<AlertDialogContent type="desktop">
|
|
511
|
-
<AlertDialogHeader type="header">
|
|
512
|
-
<AlertDialogTitle>Title</AlertDialogTitle>
|
|
513
|
-
</AlertDialogHeader>
|
|
514
|
-
<AlertDialogBody>
|
|
515
|
-
<AlertDialogDescription>Header with title and close button.</AlertDialogDescription>
|
|
516
|
-
</AlertDialogBody>
|
|
517
|
-
<AlertDialogFooter>
|
|
518
|
-
<AlertDialogAction asChild>
|
|
519
|
-
<Button>Confirm</Button>
|
|
520
|
-
</AlertDialogAction>
|
|
521
|
-
</AlertDialogFooter>
|
|
522
|
-
</AlertDialogContent>
|
|
523
|
-
</AlertDialog>
|
|
524
|
-
|
|
525
|
-
<AlertDialog>
|
|
526
|
-
<AlertDialogTrigger asChild>
|
|
527
|
-
<Button variant="outline">Close Only</Button>
|
|
528
|
-
</AlertDialogTrigger>
|
|
529
|
-
<AlertDialogContent type="desktop">
|
|
530
|
-
<AlertDialogBody className="pt-8">
|
|
531
|
-
<AlertDialogDescription>Header with only close button, no title.</AlertDialogDescription>
|
|
532
|
-
</AlertDialogBody>
|
|
533
|
-
<AlertDialogFooter>
|
|
534
|
-
<AlertDialogAction asChild>
|
|
535
|
-
<Button>Confirm</Button>
|
|
536
|
-
</AlertDialogAction>
|
|
537
|
-
</AlertDialogFooter>
|
|
538
|
-
</AlertDialogContent>
|
|
539
|
-
</AlertDialog>
|
|
540
|
-
|
|
541
|
-
<AlertDialog>
|
|
542
|
-
<AlertDialogTrigger asChild>
|
|
543
|
-
<Button variant="outline">Icon Button Close</Button>
|
|
544
|
-
</AlertDialogTrigger>
|
|
545
|
-
<AlertDialogContent type="desktop" closeButtonVariant="icon-button">
|
|
546
|
-
<AlertDialogHeader type="header">
|
|
547
|
-
<AlertDialogTitle>Title</AlertDialogTitle>
|
|
548
|
-
</AlertDialogHeader>
|
|
549
|
-
<AlertDialogBody>
|
|
550
|
-
<AlertDialogDescription>Header with icon button style close.</AlertDialogDescription>
|
|
551
|
-
</AlertDialogBody>
|
|
552
|
-
<AlertDialogFooter>
|
|
553
|
-
<AlertDialogAction asChild>
|
|
554
|
-
<Button>Confirm</Button>
|
|
555
|
-
</AlertDialogAction>
|
|
556
|
-
</AlertDialogFooter>
|
|
557
|
-
</AlertDialogContent>
|
|
558
|
-
</AlertDialog>
|
|
559
|
-
</div>
|
|
560
|
-
</div>
|
|
561
|
-
|
|
562
|
-
{/* Footer Types */}
|
|
563
|
-
<div>
|
|
564
|
-
<Typography variant="h4" className="mb-4">Footer Types</Typography>
|
|
565
|
-
<div className="flex gap-4 flex-wrap">
|
|
566
|
-
<AlertDialog>
|
|
567
|
-
<AlertDialogTrigger asChild>
|
|
568
|
-
<Button variant="outline">2 Buttons Right</Button>
|
|
569
|
-
</AlertDialogTrigger>
|
|
570
|
-
<AlertDialogContent type="desktop">
|
|
571
|
-
<AlertDialogHeader>
|
|
572
|
-
<AlertDialogTitle>2 Buttons Right</AlertDialogTitle>
|
|
573
|
-
</AlertDialogHeader>
|
|
574
|
-
<AlertDialogBody>
|
|
575
|
-
<AlertDialogDescription>Footer with two buttons aligned right.</AlertDialogDescription>
|
|
576
|
-
</AlertDialogBody>
|
|
577
|
-
<AlertDialogFooter type="buttons-right">
|
|
578
|
-
<AlertDialogCancel asChild>
|
|
579
|
-
<Button variant="outline">Label</Button>
|
|
580
|
-
</AlertDialogCancel>
|
|
581
|
-
<AlertDialogAction asChild>
|
|
582
|
-
<Button>Label</Button>
|
|
583
|
-
</AlertDialogAction>
|
|
584
|
-
</AlertDialogFooter>
|
|
585
|
-
</AlertDialogContent>
|
|
586
|
-
</AlertDialog>
|
|
587
|
-
|
|
588
|
-
<AlertDialog>
|
|
589
|
-
<AlertDialogTrigger asChild>
|
|
590
|
-
<Button variant="outline">2 Full-width</Button>
|
|
591
|
-
</AlertDialogTrigger>
|
|
592
|
-
<AlertDialogContent type="desktop">
|
|
593
|
-
<AlertDialogHeader>
|
|
594
|
-
<AlertDialogTitle>2 Full-width Buttons</AlertDialogTitle>
|
|
595
|
-
</AlertDialogHeader>
|
|
596
|
-
<AlertDialogBody>
|
|
597
|
-
<AlertDialogDescription>Footer with two full-width buttons.</AlertDialogDescription>
|
|
598
|
-
</AlertDialogBody>
|
|
599
|
-
<AlertDialogFooter type="full-width">
|
|
600
|
-
<AlertDialogCancel asChild>
|
|
601
|
-
<Button variant="outline">Label</Button>
|
|
602
|
-
</AlertDialogCancel>
|
|
603
|
-
<AlertDialogAction asChild>
|
|
604
|
-
<Button>Label</Button>
|
|
605
|
-
</AlertDialogAction>
|
|
606
|
-
</AlertDialogFooter>
|
|
607
|
-
</AlertDialogContent>
|
|
608
|
-
</AlertDialog>
|
|
609
|
-
|
|
610
|
-
<AlertDialog>
|
|
611
|
-
<AlertDialogTrigger asChild>
|
|
612
|
-
<Button variant="outline">Single Full-width</Button>
|
|
613
|
-
</AlertDialogTrigger>
|
|
614
|
-
<AlertDialogContent type="desktop">
|
|
615
|
-
<AlertDialogHeader>
|
|
616
|
-
<AlertDialogTitle>Single Full-width</AlertDialogTitle>
|
|
617
|
-
</AlertDialogHeader>
|
|
618
|
-
<AlertDialogBody>
|
|
619
|
-
<AlertDialogDescription>Footer with single full-width button.</AlertDialogDescription>
|
|
620
|
-
</AlertDialogBody>
|
|
621
|
-
<AlertDialogFooter type="single-full-width">
|
|
622
|
-
<AlertDialogAction asChild>
|
|
623
|
-
<Button>Label</Button>
|
|
624
|
-
</AlertDialogAction>
|
|
625
|
-
</AlertDialogFooter>
|
|
626
|
-
</AlertDialogContent>
|
|
627
|
-
</AlertDialog>
|
|
628
|
-
</div>
|
|
629
|
-
</div>
|
|
630
|
-
|
|
631
|
-
{/* Special States */}
|
|
632
|
-
<div>
|
|
633
|
-
<Typography variant="h4" className="mb-4">Special States</Typography>
|
|
634
|
-
<div className="flex gap-4 flex-wrap">
|
|
635
|
-
<AlertDialog>
|
|
636
|
-
<AlertDialogTrigger asChild>
|
|
637
|
-
<Button variant="outline">Loading State</Button>
|
|
638
|
-
</AlertDialogTrigger>
|
|
639
|
-
<AlertDialogContent type="desktop" loading>
|
|
640
|
-
<AlertDialogHeader>
|
|
641
|
-
<AlertDialogTitle>Processing...</AlertDialogTitle>
|
|
642
|
-
</AlertDialogHeader>
|
|
643
|
-
<AlertDialogBody>
|
|
644
|
-
<AlertDialogDescription>Please wait while we process your request.</AlertDialogDescription>
|
|
645
|
-
</AlertDialogBody>
|
|
646
|
-
<AlertDialogFooter>
|
|
647
|
-
<AlertDialogCancel asChild>
|
|
648
|
-
<Button variant="outline" disabled>Cancel</Button>
|
|
649
|
-
</AlertDialogCancel>
|
|
650
|
-
<AlertDialogAction asChild>
|
|
651
|
-
<Button disabled>Confirm</Button>
|
|
652
|
-
</AlertDialogAction>
|
|
653
|
-
</AlertDialogFooter>
|
|
654
|
-
</AlertDialogContent>
|
|
655
|
-
</AlertDialog>
|
|
656
|
-
</div>
|
|
657
|
-
</div>
|
|
658
|
-
</div>
|
|
659
|
-
</div>
|
|
660
|
-
</div>
|
|
661
|
-
),
|
|
662
|
-
parameters: {
|
|
663
|
-
layout: "padded",
|
|
664
|
-
},
|
|
665
|
-
}
|