@a2v2ai/uikit 0.0.1 → 0.0.3
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.stories.tsx +121 -0
- package/Alert/Alert.tsx +71 -0
- package/AlertDialog/AlertDialog.stories.tsx +665 -0
- package/AlertDialog/AlertDialog.tsx +241 -0
- package/Avatar/Avatar.stories.tsx +128 -0
- package/Avatar/Avatar.tsx +71 -0
- package/Badge/Badge.stories.tsx +76 -0
- package/Badge/Badge.tsx +39 -0
- package/Breadcrumb/Breadcrumb.stories.tsx +231 -0
- package/Breadcrumb/Breadcrumb.tsx +114 -0
- package/Button/Button.stories.tsx +684 -0
- package/Button/Button.tsx +90 -0
- package/Calendar/Calendar.stories.tsx +207 -0
- package/Calendar/Calendar.tsx +232 -0
- package/Card/Card.stories.tsx +136 -0
- package/Card/Card.tsx +96 -0
- package/ChatBubble/ChatBubble.stories.tsx +307 -0
- package/ChatBubble/ChatBubble.tsx +167 -0
- package/Checkbox/Checkbox.stories.tsx +137 -0
- package/Checkbox/Checkbox.tsx +53 -0
- package/Drawer/Drawer.stories.tsx +721 -0
- package/Drawer/Drawer.tsx +201 -0
- package/DropdownMenu/DropdownMenu.stories.tsx +251 -0
- package/DropdownMenu/DropdownMenu.tsx +199 -0
- package/ErrorMessage/ErrorMessage.stories.tsx +159 -0
- package/ErrorMessage/ErrorMessage.tsx +55 -0
- package/Flex/Flex.tsx +102 -0
- package/IconButton/IconButton.stories.tsx +566 -0
- package/IconButton/IconButton.tsx +95 -0
- package/Input/Input.stories.tsx +456 -0
- package/Input/Input.tsx +129 -0
- package/InputOTP/InputOTP.stories.tsx +246 -0
- package/InputOTP/InputOTP.tsx +127 -0
- package/Label/Label.stories.tsx +105 -0
- package/Label/Label.tsx +43 -0
- package/Loader/Loader.stories.tsx +170 -0
- package/Loader/Loader.tsx +62 -0
- package/Popover/Popover.stories.tsx +133 -0
- package/Popover/Popover.tsx +31 -0
- package/Progress/Progress.stories.tsx +146 -0
- package/Progress/Progress.tsx +67 -0
- package/README.md +12 -12
- package/RadioGroup/RadioGroup.stories.tsx +159 -0
- package/RadioGroup/RadioGroup.tsx +68 -0
- package/ScrollArea/ScrollArea.stories.tsx +136 -0
- package/ScrollArea/ScrollArea.tsx +46 -0
- package/Select/Select.stories.tsx +242 -0
- package/Select/Select.tsx +180 -0
- package/Separator/Separator.stories.tsx +110 -0
- package/Separator/Separator.tsx +29 -0
- package/Skeleton/Skeleton.stories.tsx +117 -0
- package/Skeleton/Skeleton.tsx +16 -0
- package/Spinner/Spinner.stories.tsx +210 -0
- package/Spinner/Spinner.tsx +78 -0
- package/Switch/Switch.stories.tsx +146 -0
- package/Switch/Switch.tsx +59 -0
- package/Tabs/Tabs.stories.tsx +197 -0
- package/Tabs/Tabs.tsx +74 -0
- package/Textarea/Textarea.stories.tsx +170 -0
- package/Textarea/Textarea.tsx +51 -0
- package/Toast/Toast.stories.tsx +285 -0
- package/Toast/Toast.tsx +59 -0
- package/Tooltip/Tooltip.stories.tsx +463 -0
- package/Tooltip/Tooltip.tsx +96 -0
- package/Typography/Typography.stories.tsx +235 -0
- package/Typography/Typography.tsx +171 -0
- package/helpers.ts +5 -0
- package/icons.ts +2 -0
- package/index.ts +136 -0
- package/lib/utils.ts +15 -0
- package/package.json +4 -1
- package/tsconfig.json +24 -0
- package/Alert/Alert.d.ts +0 -11
- package/Alert/Alert.js +0 -64
- package/AlertDialog/AlertDialog.d.ts +0 -35
- package/AlertDialog/AlertDialog.js +0 -121
- package/Avatar/Avatar.d.ts +0 -12
- package/Avatar/Avatar.js +0 -64
- package/Badge/Badge.d.ts +0 -9
- package/Badge/Badge.js +0 -26
- package/Breadcrumb/Breadcrumb.d.ts +0 -19
- package/Breadcrumb/Breadcrumb.js +0 -65
- package/Button/Button.d.ts +0 -14
- package/Button/Button.js +0 -75
- package/Calendar/Calendar.d.ts +0 -16
- package/Calendar/Calendar.js +0 -113
- package/Card/Card.d.ts +0 -14
- package/Card/Card.js +0 -70
- package/ChatBubble/ChatBubble.d.ts +0 -29
- package/ChatBubble/ChatBubble.js +0 -133
- package/Checkbox/Checkbox.d.ts +0 -10
- package/Checkbox/Checkbox.js +0 -57
- package/Dialog/Dialog.d.ts +0 -35
- package/Dialog/Dialog.js +0 -130
- package/Drawer/Drawer.d.ts +0 -31
- package/Drawer/Drawer.js +0 -69
- package/DropdownMenu/DropdownMenu.d.ts +0 -27
- package/DropdownMenu/DropdownMenu.js +0 -85
- package/ErrorMessage/ErrorMessage.d.ts +0 -27
- package/ErrorMessage/ErrorMessage.js +0 -15
- package/Flex/Flex.d.ts +0 -23
- package/Flex/Flex.js +0 -101
- package/IconButton/IconButton.d.ts +0 -17
- package/IconButton/IconButton.js +0 -85
- package/Input/Input.d.ts +0 -16
- package/Input/Input.js +0 -75
- package/InputOTP/InputOTP.d.ts +0 -18
- package/InputOTP/InputOTP.js +0 -85
- package/Label/Label.d.ts +0 -10
- package/Label/Label.js +0 -57
- package/Loader/Loader.d.ts +0 -18
- package/Loader/Loader.js +0 -67
- package/Popover/Popover.d.ts +0 -7
- package/Popover/Popover.js +0 -49
- package/Progress/Progress.d.ts +0 -13
- package/Progress/Progress.js +0 -71
- package/RadioGroup/RadioGroup.d.ts +0 -11
- package/RadioGroup/RadioGroup.js +0 -64
- package/ScrollArea/ScrollArea.d.ts +0 -5
- package/ScrollArea/ScrollArea.js +0 -48
- package/Select/Select.d.ts +0 -19
- package/Select/Select.js +0 -85
- package/Separator/Separator.d.ts +0 -4
- package/Separator/Separator.js +0 -43
- package/Skeleton/Skeleton.d.ts +0 -4
- package/Skeleton/Skeleton.js +0 -8
- package/Spinner/Spinner.d.ts +0 -15
- package/Spinner/Spinner.js +0 -68
- package/Switch/Switch.d.ts +0 -10
- package/Switch/Switch.js +0 -67
- package/Tabs/Tabs.d.ts +0 -13
- package/Tabs/Tabs.js +0 -64
- package/Textarea/Textarea.d.ts +0 -10
- package/Textarea/Textarea.js +0 -64
- package/Toast/Toast.d.ts +0 -10
- package/Toast/Toast.js +0 -29
- package/Tooltip/Tooltip.d.ts +0 -15
- package/Tooltip/Tooltip.js +0 -68
- package/Typography/Typography.d.ts +0 -15
- package/Typography/Typography.js +0 -125
- package/helpers.d.ts +0 -4
- package/helpers.js +0 -13
- package/icons.d.ts +0 -1
- package/icons.js +0 -18
- package/index.d.ts +0 -35
- package/index.js +0 -183
- package/lib/utils.d.ts +0 -3
- package/lib/utils.js +0 -18
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { Button } from "../Button/Button"
|
|
3
|
+
import { Flex } from "../Flex/Flex"
|
|
4
|
+
import { Typography } from "../Typography/Typography"
|
|
5
|
+
import {
|
|
6
|
+
Drawer,
|
|
7
|
+
DrawerTrigger,
|
|
8
|
+
DrawerContent,
|
|
9
|
+
DrawerHeader,
|
|
10
|
+
DrawerFooter,
|
|
11
|
+
DrawerBody,
|
|
12
|
+
DrawerTitle,
|
|
13
|
+
DrawerDescription,
|
|
14
|
+
DrawerClose,
|
|
15
|
+
} from "./Drawer"
|
|
16
|
+
|
|
17
|
+
const meta: Meta<typeof Drawer> = {
|
|
18
|
+
title: "Components/Drawer",
|
|
19
|
+
component: Drawer,
|
|
20
|
+
parameters: {
|
|
21
|
+
layout: "centered",
|
|
22
|
+
backgrounds: {
|
|
23
|
+
default: "light",
|
|
24
|
+
values: [
|
|
25
|
+
{ name: "dark", value: "#1a1a1a" },
|
|
26
|
+
{ name: "light", value: "#ffffff" },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
tags: ["autodocs"],
|
|
31
|
+
argTypes: {
|
|
32
|
+
direction: {
|
|
33
|
+
control: "select",
|
|
34
|
+
options: ["bottom", "top", "left", "right"],
|
|
35
|
+
description: "Direction the drawer slides in from",
|
|
36
|
+
table: {
|
|
37
|
+
defaultValue: { summary: "bottom" },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
dismissible: {
|
|
41
|
+
control: "boolean",
|
|
42
|
+
description: "Whether clicking outside or dragging dismisses the drawer",
|
|
43
|
+
table: {
|
|
44
|
+
defaultValue: { summary: "true" },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default meta
|
|
51
|
+
type Story = StoryObj<typeof Drawer>
|
|
52
|
+
|
|
53
|
+
export const Default: Story = {
|
|
54
|
+
render: () => (
|
|
55
|
+
<Drawer>
|
|
56
|
+
<DrawerTrigger asChild>
|
|
57
|
+
<Button>Open Drawer</Button>
|
|
58
|
+
</DrawerTrigger>
|
|
59
|
+
<DrawerContent>
|
|
60
|
+
<DrawerHeader>
|
|
61
|
+
<DrawerTitle>Drawer Title</DrawerTitle>
|
|
62
|
+
<DrawerDescription>
|
|
63
|
+
This is a drawer component for React.
|
|
64
|
+
</DrawerDescription>
|
|
65
|
+
</DrawerHeader>
|
|
66
|
+
<DrawerBody>
|
|
67
|
+
<Typography>
|
|
68
|
+
Drawer content goes here. You can put any content inside.
|
|
69
|
+
</Typography>
|
|
70
|
+
</DrawerBody>
|
|
71
|
+
<DrawerFooter>
|
|
72
|
+
<DrawerClose asChild>
|
|
73
|
+
<Button variant="outline">Cancel</Button>
|
|
74
|
+
</DrawerClose>
|
|
75
|
+
<Button>Save</Button>
|
|
76
|
+
</DrawerFooter>
|
|
77
|
+
</DrawerContent>
|
|
78
|
+
</Drawer>
|
|
79
|
+
),
|
|
80
|
+
parameters: {
|
|
81
|
+
docs: {
|
|
82
|
+
source: {
|
|
83
|
+
code: `<Drawer>
|
|
84
|
+
<DrawerTrigger asChild>
|
|
85
|
+
<Button>Open Drawer</Button>
|
|
86
|
+
</DrawerTrigger>
|
|
87
|
+
<DrawerContent>
|
|
88
|
+
<DrawerHeader>
|
|
89
|
+
<DrawerTitle>Drawer Title</DrawerTitle>
|
|
90
|
+
<DrawerDescription>
|
|
91
|
+
This is a drawer component for React.
|
|
92
|
+
</DrawerDescription>
|
|
93
|
+
</DrawerHeader>
|
|
94
|
+
<DrawerBody>
|
|
95
|
+
<Typography>
|
|
96
|
+
Drawer content goes here.
|
|
97
|
+
</Typography>
|
|
98
|
+
</DrawerBody>
|
|
99
|
+
<DrawerFooter>
|
|
100
|
+
<DrawerClose asChild>
|
|
101
|
+
<Button variant="outline">Cancel</Button>
|
|
102
|
+
</DrawerClose>
|
|
103
|
+
<Button>Save</Button>
|
|
104
|
+
</DrawerFooter>
|
|
105
|
+
</DrawerContent>
|
|
106
|
+
</Drawer>`,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const FromTop: Story = {
|
|
113
|
+
render: () => (
|
|
114
|
+
<Drawer direction="top">
|
|
115
|
+
<DrawerTrigger asChild>
|
|
116
|
+
<Button>Open from Top</Button>
|
|
117
|
+
</DrawerTrigger>
|
|
118
|
+
<DrawerContent direction="top">
|
|
119
|
+
<DrawerHeader>
|
|
120
|
+
<DrawerTitle>Top Drawer</DrawerTitle>
|
|
121
|
+
<DrawerDescription>
|
|
122
|
+
This drawer slides in from the top.
|
|
123
|
+
</DrawerDescription>
|
|
124
|
+
</DrawerHeader>
|
|
125
|
+
<DrawerBody>
|
|
126
|
+
<Typography>Content for the top drawer.</Typography>
|
|
127
|
+
</DrawerBody>
|
|
128
|
+
<DrawerFooter>
|
|
129
|
+
<DrawerClose asChild>
|
|
130
|
+
<Button>Close</Button>
|
|
131
|
+
</DrawerClose>
|
|
132
|
+
</DrawerFooter>
|
|
133
|
+
</DrawerContent>
|
|
134
|
+
</Drawer>
|
|
135
|
+
),
|
|
136
|
+
parameters: {
|
|
137
|
+
docs: {
|
|
138
|
+
source: {
|
|
139
|
+
code: `<Drawer direction="top">
|
|
140
|
+
<DrawerTrigger asChild>
|
|
141
|
+
<Button>Open from Top</Button>
|
|
142
|
+
</DrawerTrigger>
|
|
143
|
+
<DrawerContent direction="top">
|
|
144
|
+
<DrawerHeader>
|
|
145
|
+
<DrawerTitle>Top Drawer</DrawerTitle>
|
|
146
|
+
<DrawerDescription>
|
|
147
|
+
This drawer slides in from the top.
|
|
148
|
+
</DrawerDescription>
|
|
149
|
+
</DrawerHeader>
|
|
150
|
+
<DrawerBody>
|
|
151
|
+
<Typography>Content for the top drawer.</Typography>
|
|
152
|
+
</DrawerBody>
|
|
153
|
+
<DrawerFooter>
|
|
154
|
+
<DrawerClose asChild>
|
|
155
|
+
<Button>Close</Button>
|
|
156
|
+
</DrawerClose>
|
|
157
|
+
</DrawerFooter>
|
|
158
|
+
</DrawerContent>
|
|
159
|
+
</Drawer>`,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const FromLeft: Story = {
|
|
166
|
+
render: () => (
|
|
167
|
+
<Drawer direction="left">
|
|
168
|
+
<DrawerTrigger asChild>
|
|
169
|
+
<Button>Open from Left</Button>
|
|
170
|
+
</DrawerTrigger>
|
|
171
|
+
<DrawerContent direction="left" showHandle={false}>
|
|
172
|
+
<DrawerHeader>
|
|
173
|
+
<DrawerTitle>Left Drawer</DrawerTitle>
|
|
174
|
+
<DrawerDescription>
|
|
175
|
+
This drawer slides in from the left.
|
|
176
|
+
</DrawerDescription>
|
|
177
|
+
</DrawerHeader>
|
|
178
|
+
<DrawerBody>
|
|
179
|
+
<Typography>Content for the left drawer.</Typography>
|
|
180
|
+
</DrawerBody>
|
|
181
|
+
<DrawerFooter>
|
|
182
|
+
<DrawerClose asChild>
|
|
183
|
+
<Button>Close</Button>
|
|
184
|
+
</DrawerClose>
|
|
185
|
+
</DrawerFooter>
|
|
186
|
+
</DrawerContent>
|
|
187
|
+
</Drawer>
|
|
188
|
+
),
|
|
189
|
+
parameters: {
|
|
190
|
+
docs: {
|
|
191
|
+
source: {
|
|
192
|
+
code: `<Drawer direction="left">
|
|
193
|
+
<DrawerTrigger asChild>
|
|
194
|
+
<Button>Open from Left</Button>
|
|
195
|
+
</DrawerTrigger>
|
|
196
|
+
<DrawerContent direction="left" showHandle={false}>
|
|
197
|
+
<DrawerHeader>
|
|
198
|
+
<DrawerTitle>Left Drawer</DrawerTitle>
|
|
199
|
+
<DrawerDescription>
|
|
200
|
+
This drawer slides in from the left.
|
|
201
|
+
</DrawerDescription>
|
|
202
|
+
</DrawerHeader>
|
|
203
|
+
<DrawerBody>
|
|
204
|
+
<Typography>Content for the left drawer.</Typography>
|
|
205
|
+
</DrawerBody>
|
|
206
|
+
<DrawerFooter>
|
|
207
|
+
<DrawerClose asChild>
|
|
208
|
+
<Button>Close</Button>
|
|
209
|
+
</DrawerClose>
|
|
210
|
+
</DrawerFooter>
|
|
211
|
+
</DrawerContent>
|
|
212
|
+
</Drawer>`,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export const FromRight: Story = {
|
|
219
|
+
render: () => (
|
|
220
|
+
<Drawer direction="right">
|
|
221
|
+
<DrawerTrigger asChild>
|
|
222
|
+
<Button>Open from Right</Button>
|
|
223
|
+
</DrawerTrigger>
|
|
224
|
+
<DrawerContent direction="right" showHandle={false}>
|
|
225
|
+
<DrawerHeader>
|
|
226
|
+
<DrawerTitle>Right Drawer</DrawerTitle>
|
|
227
|
+
<DrawerDescription>
|
|
228
|
+
This drawer slides in from the right.
|
|
229
|
+
</DrawerDescription>
|
|
230
|
+
</DrawerHeader>
|
|
231
|
+
<DrawerBody>
|
|
232
|
+
<Typography>Content for the right drawer.</Typography>
|
|
233
|
+
</DrawerBody>
|
|
234
|
+
<DrawerFooter>
|
|
235
|
+
<DrawerClose asChild>
|
|
236
|
+
<Button>Close</Button>
|
|
237
|
+
</DrawerClose>
|
|
238
|
+
</DrawerFooter>
|
|
239
|
+
</DrawerContent>
|
|
240
|
+
</Drawer>
|
|
241
|
+
),
|
|
242
|
+
parameters: {
|
|
243
|
+
docs: {
|
|
244
|
+
source: {
|
|
245
|
+
code: `<Drawer direction="right">
|
|
246
|
+
<DrawerTrigger asChild>
|
|
247
|
+
<Button>Open from Right</Button>
|
|
248
|
+
</DrawerTrigger>
|
|
249
|
+
<DrawerContent direction="right" showHandle={false}>
|
|
250
|
+
<DrawerHeader>
|
|
251
|
+
<DrawerTitle>Right Drawer</DrawerTitle>
|
|
252
|
+
<DrawerDescription>
|
|
253
|
+
This drawer slides in from the right.
|
|
254
|
+
</DrawerDescription>
|
|
255
|
+
</DrawerHeader>
|
|
256
|
+
<DrawerBody>
|
|
257
|
+
<Typography>Content for the right drawer.</Typography>
|
|
258
|
+
</DrawerBody>
|
|
259
|
+
<DrawerFooter>
|
|
260
|
+
<DrawerClose asChild>
|
|
261
|
+
<Button>Close</Button>
|
|
262
|
+
</DrawerClose>
|
|
263
|
+
</DrawerFooter>
|
|
264
|
+
</DrawerContent>
|
|
265
|
+
</Drawer>`,
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export const NoHandle: Story = {
|
|
272
|
+
render: () => (
|
|
273
|
+
<Drawer>
|
|
274
|
+
<DrawerTrigger asChild>
|
|
275
|
+
<Button>Open Drawer (No Handle)</Button>
|
|
276
|
+
</DrawerTrigger>
|
|
277
|
+
<DrawerContent showHandle={false}>
|
|
278
|
+
<DrawerHeader>
|
|
279
|
+
<DrawerTitle>No Handle</DrawerTitle>
|
|
280
|
+
<DrawerDescription>
|
|
281
|
+
This drawer has the handle hidden.
|
|
282
|
+
</DrawerDescription>
|
|
283
|
+
</DrawerHeader>
|
|
284
|
+
<DrawerBody>
|
|
285
|
+
<Typography>Content without the drag handle visible.</Typography>
|
|
286
|
+
</DrawerBody>
|
|
287
|
+
<DrawerFooter>
|
|
288
|
+
<DrawerClose asChild>
|
|
289
|
+
<Button>Close</Button>
|
|
290
|
+
</DrawerClose>
|
|
291
|
+
</DrawerFooter>
|
|
292
|
+
</DrawerContent>
|
|
293
|
+
</Drawer>
|
|
294
|
+
),
|
|
295
|
+
parameters: {
|
|
296
|
+
docs: {
|
|
297
|
+
source: {
|
|
298
|
+
code: `<Drawer>
|
|
299
|
+
<DrawerTrigger asChild>
|
|
300
|
+
<Button>Open Drawer (No Handle)</Button>
|
|
301
|
+
</DrawerTrigger>
|
|
302
|
+
<DrawerContent showHandle={false}>
|
|
303
|
+
<DrawerHeader>
|
|
304
|
+
<DrawerTitle>No Handle</DrawerTitle>
|
|
305
|
+
<DrawerDescription>
|
|
306
|
+
This drawer has the handle hidden.
|
|
307
|
+
</DrawerDescription>
|
|
308
|
+
</DrawerHeader>
|
|
309
|
+
<DrawerBody>
|
|
310
|
+
<Typography>Content without the drag handle visible.</Typography>
|
|
311
|
+
</DrawerBody>
|
|
312
|
+
<DrawerFooter>
|
|
313
|
+
<DrawerClose asChild>
|
|
314
|
+
<Button>Close</Button>
|
|
315
|
+
</DrawerClose>
|
|
316
|
+
</DrawerFooter>
|
|
317
|
+
</DrawerContent>
|
|
318
|
+
</Drawer>`,
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export const WithLongContent: Story = {
|
|
325
|
+
render: () => (
|
|
326
|
+
<Drawer>
|
|
327
|
+
<DrawerTrigger asChild>
|
|
328
|
+
<Button>Open with Long Content</Button>
|
|
329
|
+
</DrawerTrigger>
|
|
330
|
+
<DrawerContent>
|
|
331
|
+
<DrawerHeader>
|
|
332
|
+
<DrawerTitle>Scrollable Content</DrawerTitle>
|
|
333
|
+
<DrawerDescription>
|
|
334
|
+
This drawer has scrollable content.
|
|
335
|
+
</DrawerDescription>
|
|
336
|
+
</DrawerHeader>
|
|
337
|
+
<DrawerBody>
|
|
338
|
+
<Flex direction="column" gap={4}>
|
|
339
|
+
{Array.from({ length: 20 }, (_, i) => (
|
|
340
|
+
<Typography key={i}>
|
|
341
|
+
Item {i + 1}: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
342
|
+
</Typography>
|
|
343
|
+
))}
|
|
344
|
+
</Flex>
|
|
345
|
+
</DrawerBody>
|
|
346
|
+
<DrawerFooter>
|
|
347
|
+
<DrawerClose asChild>
|
|
348
|
+
<Button variant="outline">Cancel</Button>
|
|
349
|
+
</DrawerClose>
|
|
350
|
+
<Button>Save</Button>
|
|
351
|
+
</DrawerFooter>
|
|
352
|
+
</DrawerContent>
|
|
353
|
+
</Drawer>
|
|
354
|
+
),
|
|
355
|
+
parameters: {
|
|
356
|
+
docs: {
|
|
357
|
+
source: {
|
|
358
|
+
code: `<Drawer>
|
|
359
|
+
<DrawerTrigger asChild>
|
|
360
|
+
<Button>Open with Long Content</Button>
|
|
361
|
+
</DrawerTrigger>
|
|
362
|
+
<DrawerContent>
|
|
363
|
+
<DrawerHeader>
|
|
364
|
+
<DrawerTitle>Scrollable Content</DrawerTitle>
|
|
365
|
+
<DrawerDescription>
|
|
366
|
+
This drawer has scrollable content.
|
|
367
|
+
</DrawerDescription>
|
|
368
|
+
</DrawerHeader>
|
|
369
|
+
<DrawerBody>
|
|
370
|
+
{/* Long content here - DrawerBody handles scrolling */}
|
|
371
|
+
<Typography>Item 1: Lorem ipsum...</Typography>
|
|
372
|
+
<Typography>Item 2: Lorem ipsum...</Typography>
|
|
373
|
+
{/* ... more items */}
|
|
374
|
+
</DrawerBody>
|
|
375
|
+
<DrawerFooter>
|
|
376
|
+
<DrawerClose asChild>
|
|
377
|
+
<Button variant="outline">Cancel</Button>
|
|
378
|
+
</DrawerClose>
|
|
379
|
+
<Button>Save</Button>
|
|
380
|
+
</DrawerFooter>
|
|
381
|
+
</DrawerContent>
|
|
382
|
+
</Drawer>`,
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export const NonDismissible: Story = {
|
|
389
|
+
render: () => (
|
|
390
|
+
<Drawer dismissible={false}>
|
|
391
|
+
<DrawerTrigger asChild>
|
|
392
|
+
<Button>Open Non-Dismissible Drawer</Button>
|
|
393
|
+
</DrawerTrigger>
|
|
394
|
+
<DrawerContent>
|
|
395
|
+
<DrawerHeader>
|
|
396
|
+
<DrawerTitle>Non-Dismissible Drawer</DrawerTitle>
|
|
397
|
+
<DrawerDescription>
|
|
398
|
+
This drawer cannot be closed by clicking outside or dragging down.
|
|
399
|
+
You must use the close button.
|
|
400
|
+
</DrawerDescription>
|
|
401
|
+
</DrawerHeader>
|
|
402
|
+
<DrawerBody>
|
|
403
|
+
<Typography>
|
|
404
|
+
Use dismissible=false when you need to prevent accidental closure,
|
|
405
|
+
such as during form submissions or important confirmations.
|
|
406
|
+
</Typography>
|
|
407
|
+
</DrawerBody>
|
|
408
|
+
<DrawerFooter>
|
|
409
|
+
<DrawerClose asChild>
|
|
410
|
+
<Button>Close</Button>
|
|
411
|
+
</DrawerClose>
|
|
412
|
+
</DrawerFooter>
|
|
413
|
+
</DrawerContent>
|
|
414
|
+
</Drawer>
|
|
415
|
+
),
|
|
416
|
+
parameters: {
|
|
417
|
+
docs: {
|
|
418
|
+
source: {
|
|
419
|
+
code: `<Drawer dismissible={false}>
|
|
420
|
+
<DrawerTrigger asChild>
|
|
421
|
+
<Button>Open Non-Dismissible Drawer</Button>
|
|
422
|
+
</DrawerTrigger>
|
|
423
|
+
<DrawerContent>
|
|
424
|
+
<DrawerHeader>
|
|
425
|
+
<DrawerTitle>Non-Dismissible Drawer</DrawerTitle>
|
|
426
|
+
<DrawerDescription>
|
|
427
|
+
This drawer cannot be closed by clicking outside.
|
|
428
|
+
</DrawerDescription>
|
|
429
|
+
</DrawerHeader>
|
|
430
|
+
<DrawerBody>
|
|
431
|
+
<Typography>
|
|
432
|
+
Use dismissible={false} to prevent accidental closure.
|
|
433
|
+
</Typography>
|
|
434
|
+
</DrawerBody>
|
|
435
|
+
<DrawerFooter>
|
|
436
|
+
<DrawerClose asChild>
|
|
437
|
+
<Button>Close</Button>
|
|
438
|
+
</DrawerClose>
|
|
439
|
+
</DrawerFooter>
|
|
440
|
+
</DrawerContent>
|
|
441
|
+
</Drawer>`,
|
|
442
|
+
},
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export const Loading: Story = {
|
|
448
|
+
render: () => (
|
|
449
|
+
<Drawer>
|
|
450
|
+
<DrawerTrigger asChild>
|
|
451
|
+
<Button>Open Loading Drawer</Button>
|
|
452
|
+
</DrawerTrigger>
|
|
453
|
+
<DrawerContent loading className="min-h-[300px]">
|
|
454
|
+
<DrawerHeader>
|
|
455
|
+
<DrawerTitle>Loading State</DrawerTitle>
|
|
456
|
+
</DrawerHeader>
|
|
457
|
+
</DrawerContent>
|
|
458
|
+
</Drawer>
|
|
459
|
+
),
|
|
460
|
+
parameters: {
|
|
461
|
+
docs: {
|
|
462
|
+
source: {
|
|
463
|
+
code: `<Drawer>
|
|
464
|
+
<DrawerTrigger asChild>
|
|
465
|
+
<Button>Open Loading Drawer</Button>
|
|
466
|
+
</DrawerTrigger>
|
|
467
|
+
<DrawerContent loading className="min-h-[300px]">
|
|
468
|
+
<DrawerHeader>
|
|
469
|
+
<DrawerTitle>Loading State</DrawerTitle>
|
|
470
|
+
</DrawerHeader>
|
|
471
|
+
</DrawerContent>
|
|
472
|
+
</Drawer>`,
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
},
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export const AllVariants: Story = {
|
|
479
|
+
render: () => (
|
|
480
|
+
<Flex direction="column" gap={8}>
|
|
481
|
+
{/* Directions */}
|
|
482
|
+
<Flex direction="column" gap={4}>
|
|
483
|
+
<Typography variant="h4">Directions</Typography>
|
|
484
|
+
<Flex gap={4} wrap="wrap">
|
|
485
|
+
<Drawer direction="bottom">
|
|
486
|
+
<DrawerTrigger asChild>
|
|
487
|
+
<Button>Bottom</Button>
|
|
488
|
+
</DrawerTrigger>
|
|
489
|
+
<DrawerContent direction="bottom">
|
|
490
|
+
<DrawerHeader>
|
|
491
|
+
<DrawerTitle>Bottom Drawer</DrawerTitle>
|
|
492
|
+
<DrawerDescription>Slides up from bottom</DrawerDescription>
|
|
493
|
+
</DrawerHeader>
|
|
494
|
+
<DrawerBody>
|
|
495
|
+
<Typography>Default direction for mobile-friendly drawers.</Typography>
|
|
496
|
+
</DrawerBody>
|
|
497
|
+
<DrawerFooter>
|
|
498
|
+
<DrawerClose asChild>
|
|
499
|
+
<Button>Close</Button>
|
|
500
|
+
</DrawerClose>
|
|
501
|
+
</DrawerFooter>
|
|
502
|
+
</DrawerContent>
|
|
503
|
+
</Drawer>
|
|
504
|
+
|
|
505
|
+
<Drawer direction="top">
|
|
506
|
+
<DrawerTrigger asChild>
|
|
507
|
+
<Button>Top</Button>
|
|
508
|
+
</DrawerTrigger>
|
|
509
|
+
<DrawerContent direction="top">
|
|
510
|
+
<DrawerHeader>
|
|
511
|
+
<DrawerTitle>Top Drawer</DrawerTitle>
|
|
512
|
+
<DrawerDescription>Slides down from top</DrawerDescription>
|
|
513
|
+
</DrawerHeader>
|
|
514
|
+
<DrawerBody>
|
|
515
|
+
<Typography>Good for notifications or alerts.</Typography>
|
|
516
|
+
</DrawerBody>
|
|
517
|
+
<DrawerFooter>
|
|
518
|
+
<DrawerClose asChild>
|
|
519
|
+
<Button>Close</Button>
|
|
520
|
+
</DrawerClose>
|
|
521
|
+
</DrawerFooter>
|
|
522
|
+
</DrawerContent>
|
|
523
|
+
</Drawer>
|
|
524
|
+
|
|
525
|
+
<Drawer direction="left">
|
|
526
|
+
<DrawerTrigger asChild>
|
|
527
|
+
<Button>Left</Button>
|
|
528
|
+
</DrawerTrigger>
|
|
529
|
+
<DrawerContent direction="left" showHandle={false}>
|
|
530
|
+
<DrawerHeader>
|
|
531
|
+
<DrawerTitle>Left Drawer</DrawerTitle>
|
|
532
|
+
<DrawerDescription>Slides in from left</DrawerDescription>
|
|
533
|
+
</DrawerHeader>
|
|
534
|
+
<DrawerBody>
|
|
535
|
+
<Typography>Great for navigation menus.</Typography>
|
|
536
|
+
</DrawerBody>
|
|
537
|
+
<DrawerFooter>
|
|
538
|
+
<DrawerClose asChild>
|
|
539
|
+
<Button>Close</Button>
|
|
540
|
+
</DrawerClose>
|
|
541
|
+
</DrawerFooter>
|
|
542
|
+
</DrawerContent>
|
|
543
|
+
</Drawer>
|
|
544
|
+
|
|
545
|
+
<Drawer direction="right">
|
|
546
|
+
<DrawerTrigger asChild>
|
|
547
|
+
<Button>Right</Button>
|
|
548
|
+
</DrawerTrigger>
|
|
549
|
+
<DrawerContent direction="right" showHandle={false}>
|
|
550
|
+
<DrawerHeader>
|
|
551
|
+
<DrawerTitle>Right Drawer</DrawerTitle>
|
|
552
|
+
<DrawerDescription>Slides in from right</DrawerDescription>
|
|
553
|
+
</DrawerHeader>
|
|
554
|
+
<DrawerBody>
|
|
555
|
+
<Typography>Ideal for settings or details panels.</Typography>
|
|
556
|
+
</DrawerBody>
|
|
557
|
+
<DrawerFooter>
|
|
558
|
+
<DrawerClose asChild>
|
|
559
|
+
<Button>Close</Button>
|
|
560
|
+
</DrawerClose>
|
|
561
|
+
</DrawerFooter>
|
|
562
|
+
</DrawerContent>
|
|
563
|
+
</Drawer>
|
|
564
|
+
</Flex>
|
|
565
|
+
</Flex>
|
|
566
|
+
|
|
567
|
+
{/* Handle Options */}
|
|
568
|
+
<Flex direction="column" gap={4}>
|
|
569
|
+
<Typography variant="h4">Handle Options</Typography>
|
|
570
|
+
<Flex gap={4} wrap="wrap">
|
|
571
|
+
<Drawer>
|
|
572
|
+
<DrawerTrigger asChild>
|
|
573
|
+
<Button>With Handle</Button>
|
|
574
|
+
</DrawerTrigger>
|
|
575
|
+
<DrawerContent showHandle={true}>
|
|
576
|
+
<DrawerHeader>
|
|
577
|
+
<DrawerTitle>With Handle</DrawerTitle>
|
|
578
|
+
<DrawerDescription>Drag handle is visible</DrawerDescription>
|
|
579
|
+
</DrawerHeader>
|
|
580
|
+
<DrawerBody>
|
|
581
|
+
<Typography>Users can drag to dismiss.</Typography>
|
|
582
|
+
</DrawerBody>
|
|
583
|
+
<DrawerFooter>
|
|
584
|
+
<DrawerClose asChild>
|
|
585
|
+
<Button>Close</Button>
|
|
586
|
+
</DrawerClose>
|
|
587
|
+
</DrawerFooter>
|
|
588
|
+
</DrawerContent>
|
|
589
|
+
</Drawer>
|
|
590
|
+
|
|
591
|
+
<Drawer>
|
|
592
|
+
<DrawerTrigger asChild>
|
|
593
|
+
<Button>Without Handle</Button>
|
|
594
|
+
</DrawerTrigger>
|
|
595
|
+
<DrawerContent showHandle={false}>
|
|
596
|
+
<DrawerHeader>
|
|
597
|
+
<DrawerTitle>Without Handle</DrawerTitle>
|
|
598
|
+
<DrawerDescription>Handle is hidden</DrawerDescription>
|
|
599
|
+
</DrawerHeader>
|
|
600
|
+
<DrawerBody>
|
|
601
|
+
<Typography>Cleaner look for certain use cases.</Typography>
|
|
602
|
+
</DrawerBody>
|
|
603
|
+
<DrawerFooter>
|
|
604
|
+
<DrawerClose asChild>
|
|
605
|
+
<Button>Close</Button>
|
|
606
|
+
</DrawerClose>
|
|
607
|
+
</DrawerFooter>
|
|
608
|
+
</DrawerContent>
|
|
609
|
+
</Drawer>
|
|
610
|
+
</Flex>
|
|
611
|
+
</Flex>
|
|
612
|
+
|
|
613
|
+
{/* Dismissible Options */}
|
|
614
|
+
<Flex direction="column" gap={4}>
|
|
615
|
+
<Typography variant="h4">Dismissible Options</Typography>
|
|
616
|
+
<Flex gap={4} wrap="wrap">
|
|
617
|
+
<Drawer dismissible={true}>
|
|
618
|
+
<DrawerTrigger asChild>
|
|
619
|
+
<Button>Dismissible (Default)</Button>
|
|
620
|
+
</DrawerTrigger>
|
|
621
|
+
<DrawerContent>
|
|
622
|
+
<DrawerHeader>
|
|
623
|
+
<DrawerTitle>Dismissible Drawer</DrawerTitle>
|
|
624
|
+
<DrawerDescription>Can be closed by clicking outside or dragging</DrawerDescription>
|
|
625
|
+
</DrawerHeader>
|
|
626
|
+
<DrawerBody>
|
|
627
|
+
<Typography>Click outside or drag down to close.</Typography>
|
|
628
|
+
</DrawerBody>
|
|
629
|
+
<DrawerFooter>
|
|
630
|
+
<DrawerClose asChild>
|
|
631
|
+
<Button>Close</Button>
|
|
632
|
+
</DrawerClose>
|
|
633
|
+
</DrawerFooter>
|
|
634
|
+
</DrawerContent>
|
|
635
|
+
</Drawer>
|
|
636
|
+
|
|
637
|
+
<Drawer dismissible={false}>
|
|
638
|
+
<DrawerTrigger asChild>
|
|
639
|
+
<Button>Non-Dismissible</Button>
|
|
640
|
+
</DrawerTrigger>
|
|
641
|
+
<DrawerContent>
|
|
642
|
+
<DrawerHeader>
|
|
643
|
+
<DrawerTitle>Non-Dismissible Drawer</DrawerTitle>
|
|
644
|
+
<DrawerDescription>Must use the close button</DrawerDescription>
|
|
645
|
+
</DrawerHeader>
|
|
646
|
+
<DrawerBody>
|
|
647
|
+
<Typography>Cannot be closed by clicking outside or dragging.</Typography>
|
|
648
|
+
</DrawerBody>
|
|
649
|
+
<DrawerFooter>
|
|
650
|
+
<DrawerClose asChild>
|
|
651
|
+
<Button>Close</Button>
|
|
652
|
+
</DrawerClose>
|
|
653
|
+
</DrawerFooter>
|
|
654
|
+
</DrawerContent>
|
|
655
|
+
</Drawer>
|
|
656
|
+
</Flex>
|
|
657
|
+
</Flex>
|
|
658
|
+
|
|
659
|
+
{/* Loading State */}
|
|
660
|
+
<Flex direction="column" gap={4}>
|
|
661
|
+
<Typography variant="h4">Loading State</Typography>
|
|
662
|
+
<Flex gap={4} wrap="wrap">
|
|
663
|
+
<Drawer>
|
|
664
|
+
<DrawerTrigger asChild>
|
|
665
|
+
<Button>Normal Content</Button>
|
|
666
|
+
</DrawerTrigger>
|
|
667
|
+
<DrawerContent loading={false}>
|
|
668
|
+
<DrawerHeader>
|
|
669
|
+
<DrawerTitle>Normal Content</DrawerTitle>
|
|
670
|
+
<DrawerDescription>Content is loaded</DrawerDescription>
|
|
671
|
+
</DrawerHeader>
|
|
672
|
+
<DrawerBody>
|
|
673
|
+
<Typography>Regular drawer content here.</Typography>
|
|
674
|
+
</DrawerBody>
|
|
675
|
+
<DrawerFooter>
|
|
676
|
+
<DrawerClose asChild>
|
|
677
|
+
<Button>Close</Button>
|
|
678
|
+
</DrawerClose>
|
|
679
|
+
</DrawerFooter>
|
|
680
|
+
</DrawerContent>
|
|
681
|
+
</Drawer>
|
|
682
|
+
|
|
683
|
+
<Drawer>
|
|
684
|
+
<DrawerTrigger asChild>
|
|
685
|
+
<Button>Loading State</Button>
|
|
686
|
+
</DrawerTrigger>
|
|
687
|
+
<DrawerContent loading={true} className="min-h-[300px]">
|
|
688
|
+
<DrawerHeader>
|
|
689
|
+
<DrawerTitle>Loading...</DrawerTitle>
|
|
690
|
+
</DrawerHeader>
|
|
691
|
+
</DrawerContent>
|
|
692
|
+
</Drawer>
|
|
693
|
+
</Flex>
|
|
694
|
+
</Flex>
|
|
695
|
+
</Flex>
|
|
696
|
+
),
|
|
697
|
+
parameters: {
|
|
698
|
+
layout: "padded",
|
|
699
|
+
docs: {
|
|
700
|
+
source: {
|
|
701
|
+
code: `// Directions
|
|
702
|
+
<Drawer direction="bottom">...</Drawer>
|
|
703
|
+
<Drawer direction="top">...</Drawer>
|
|
704
|
+
<Drawer direction="left">...</Drawer>
|
|
705
|
+
<Drawer direction="right">...</Drawer>
|
|
706
|
+
|
|
707
|
+
// Handle Options
|
|
708
|
+
<DrawerContent showHandle={true}>...</DrawerContent>
|
|
709
|
+
<DrawerContent showHandle={false}>...</DrawerContent>
|
|
710
|
+
|
|
711
|
+
// Dismissible Options
|
|
712
|
+
<Drawer dismissible={true}>...</Drawer>
|
|
713
|
+
<Drawer dismissible={false}>...</Drawer>
|
|
714
|
+
|
|
715
|
+
// Loading State
|
|
716
|
+
<DrawerContent loading={false}>...</DrawerContent>
|
|
717
|
+
<DrawerContent loading={true}>...</DrawerContent>`,
|
|
718
|
+
},
|
|
719
|
+
},
|
|
720
|
+
},
|
|
721
|
+
}
|