@foundrykit/primitives 0.1.0
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/components.json +20 -0
- package/dist/chunk-A3U73FA7.js +33 -0
- package/dist/chunk-AADRFFPH.js +171 -0
- package/dist/chunk-FUWID6MC.js +42 -0
- package/dist/chunk-FYCANIVJ.js +69 -0
- package/dist/chunk-I44GXEPN.js +20 -0
- package/dist/chunk-J4CRGO2P.js +46 -0
- package/dist/chunk-J57CV3VT.js +28 -0
- package/dist/chunk-KZMSLRLW.js +25 -0
- package/dist/chunk-PHMEWMFS.js +233 -0
- package/dist/chunk-QL4XJD7Y.js +24 -0
- package/dist/chunk-SKR3J46C.js +17 -0
- package/dist/chunk-U2EIVYWP.js +33 -0
- package/dist/chunk-UZIMC7AQ.js +63 -0
- package/dist/chunk-VSXKLSEP.js +105 -0
- package/dist/chunk-VVNIYCKH.js +55 -0
- package/dist/chunk-XQAJQKO7.js +47 -0
- package/dist/chunk-YTUI6MCB.js +52 -0
- package/dist/components/avatar/index.cjs +92 -0
- package/dist/components/avatar/index.d.cts +9 -0
- package/dist/components/avatar/index.d.ts +9 -0
- package/dist/components/avatar/index.js +11 -0
- package/dist/components/badge/index.cjs +67 -0
- package/dist/components/badge/index.d.cts +13 -0
- package/dist/components/badge/index.d.ts +13 -0
- package/dist/components/badge/index.js +8 -0
- package/dist/components/breadcrumb/index.cjs +135 -0
- package/dist/components/breadcrumb/index.d.cts +14 -0
- package/dist/components/breadcrumb/index.d.ts +14 -0
- package/dist/components/breadcrumb/index.js +18 -0
- package/dist/components/button/index.cjs +77 -0
- package/dist/components/button/index.d.cts +15 -0
- package/dist/components/button/index.d.ts +15 -0
- package/dist/components/button/index.js +8 -0
- package/dist/components/card/index.cjs +102 -0
- package/dist/components/card/index.d.cts +10 -0
- package/dist/components/card/index.d.ts +10 -0
- package/dist/components/card/index.js +16 -0
- package/dist/components/checkbox/index.cjs +68 -0
- package/dist/components/checkbox/index.d.cts +7 -0
- package/dist/components/checkbox/index.d.ts +7 -0
- package/dist/components/checkbox/index.js +7 -0
- package/dist/components/dropdown/index.cjs +282 -0
- package/dist/components/dropdown/index.d.cts +28 -0
- package/dist/components/dropdown/index.d.ts +28 -0
- package/dist/components/dropdown/index.js +35 -0
- package/dist/components/input/index.cjs +59 -0
- package/dist/components/input/index.d.cts +7 -0
- package/dist/components/input/index.d.ts +7 -0
- package/dist/components/input/index.js +6 -0
- package/dist/components/label/index.cjs +59 -0
- package/dist/components/label/index.d.cts +7 -0
- package/dist/components/label/index.d.ts +7 -0
- package/dist/components/label/index.js +7 -0
- package/dist/components/popover/index.cjs +84 -0
- package/dist/components/popover/index.d.cts +10 -0
- package/dist/components/popover/index.d.ts +10 -0
- package/dist/components/popover/index.js +13 -0
- package/dist/components/radio-group/index.cjs +83 -0
- package/dist/components/radio-group/index.d.cts +8 -0
- package/dist/components/radio-group/index.d.ts +8 -0
- package/dist/components/radio-group/index.js +9 -0
- package/dist/components/select/index.cjs +215 -0
- package/dist/components/select/index.d.cts +18 -0
- package/dist/components/select/index.d.ts +18 -0
- package/dist/components/select/index.js +25 -0
- package/dist/components/separator/index.cjs +63 -0
- package/dist/components/separator/index.d.cts +7 -0
- package/dist/components/separator/index.d.ts +7 -0
- package/dist/components/separator/index.js +7 -0
- package/dist/components/skeleton/index.cjs +41 -0
- package/dist/components/skeleton/index.d.cts +5 -0
- package/dist/components/skeleton/index.d.ts +5 -0
- package/dist/components/skeleton/index.js +6 -0
- package/dist/components/switch/index.cjs +68 -0
- package/dist/components/switch/index.d.cts +7 -0
- package/dist/components/switch/index.d.ts +7 -0
- package/dist/components/switch/index.js +7 -0
- package/dist/components/tabs/index.cjs +107 -0
- package/dist/components/tabs/index.d.cts +10 -0
- package/dist/components/tabs/index.d.ts +10 -0
- package/dist/components/tabs/index.js +13 -0
- package/dist/components/textarea/index.cjs +44 -0
- package/dist/components/textarea/index.d.cts +6 -0
- package/dist/components/textarea/index.d.ts +6 -0
- package/dist/components/textarea/index.js +6 -0
- package/dist/index.cjs +1275 -0
- package/dist/index.d.cts +46 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.js +298 -0
- package/eslint.config.js +4 -0
- package/package.json +67 -0
- package/postcss.config.mjs +6 -0
- package/registry.json +51 -0
- package/src/components/avatar/config.ts +46 -0
- package/src/components/avatar/index.tsx +53 -0
- package/src/components/badge/config.ts +56 -0
- package/src/components/badge/index.tsx +46 -0
- package/src/components/breadcrumb/config.ts +121 -0
- package/src/components/breadcrumb/index.tsx +109 -0
- package/src/components/button/config.ts +76 -0
- package/src/components/button/index.tsx +62 -0
- package/src/components/card/config.ts +89 -0
- package/src/components/card/index.tsx +83 -0
- package/src/components/checkbox/config.ts +46 -0
- package/src/components/checkbox/index.tsx +32 -0
- package/src/components/dialog/config.ts +582 -0
- package/src/components/dialog/index.tsx +143 -0
- package/src/components/dropdown/config.ts +262 -0
- package/src/components/dropdown/index.tsx +257 -0
- package/src/components/input/config.ts +64 -0
- package/src/components/input/index.tsx +25 -0
- package/src/components/label/config.ts +72 -0
- package/src/components/label/index.tsx +24 -0
- package/src/components/popover/config.ts +219 -0
- package/src/components/popover/index.tsx +48 -0
- package/src/components/radio-group/config.ts +303 -0
- package/src/components/radio-group/index.tsx +45 -0
- package/src/components/select/config.ts +277 -0
- package/src/components/select/index.tsx +185 -0
- package/src/components/separator/config.ts +63 -0
- package/src/components/separator/index.tsx +28 -0
- package/src/components/skeleton/config.ts +77 -0
- package/src/components/skeleton/index.tsx +13 -0
- package/src/components/switch/config.ts +165 -0
- package/src/components/switch/index.tsx +31 -0
- package/src/components/tabs/config.ts +335 -0
- package/src/components/tabs/index.tsx +66 -0
- package/src/components/textarea/config.ts +117 -0
- package/src/components/textarea/index.tsx +18 -0
- package/src/index.ts +87 -0
- package/tsconfig.json +9 -0
- package/tsconfig.lint.json +8 -0
- package/tsup.config.ts +29 -0
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
import { ComponentConfig } from '@foundrykit/types';
|
|
2
|
+
|
|
3
|
+
export const dialogConfig: ComponentConfig = {
|
|
4
|
+
name: 'Dialog',
|
|
5
|
+
description: 'A modal dialog component for displaying content in an overlay',
|
|
6
|
+
category: 'primitives',
|
|
7
|
+
tags: ['overlay', 'modal', 'interactive', 'accessible'],
|
|
8
|
+
preview: {
|
|
9
|
+
type: 'static',
|
|
10
|
+
html: '<div class="flex h-12 w-full items-center justify-center rounded-md bg-gray-200"><div class="flex h-9 items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm">Open Dialog</div></div>',
|
|
11
|
+
},
|
|
12
|
+
variants: [
|
|
13
|
+
{
|
|
14
|
+
name: 'Basic',
|
|
15
|
+
description: 'Basic dialog with title and description',
|
|
16
|
+
code: `<Dialog>
|
|
17
|
+
<DialogTrigger asChild>
|
|
18
|
+
<Button variant="outline">Open Dialog</Button>
|
|
19
|
+
</DialogTrigger>
|
|
20
|
+
<DialogContent>
|
|
21
|
+
<DialogHeader>
|
|
22
|
+
<DialogTitle>Dialog Title</DialogTitle>
|
|
23
|
+
<DialogDescription>
|
|
24
|
+
This is a basic dialog example with a title and description.
|
|
25
|
+
</DialogDescription>
|
|
26
|
+
</DialogHeader>
|
|
27
|
+
<DialogFooter>
|
|
28
|
+
<Button type="submit">Save changes</Button>
|
|
29
|
+
</DialogFooter>
|
|
30
|
+
</DialogContent>
|
|
31
|
+
</Dialog>`,
|
|
32
|
+
preview: {
|
|
33
|
+
type: 'component',
|
|
34
|
+
component: 'Dialog',
|
|
35
|
+
props: {
|
|
36
|
+
children: [
|
|
37
|
+
{
|
|
38
|
+
type: 'DialogTrigger',
|
|
39
|
+
props: {
|
|
40
|
+
asChild: true,
|
|
41
|
+
children: {
|
|
42
|
+
type: 'Button',
|
|
43
|
+
props: {
|
|
44
|
+
variant: 'outline',
|
|
45
|
+
children: 'Open Dialog',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'DialogContent',
|
|
52
|
+
props: {
|
|
53
|
+
children: [
|
|
54
|
+
{
|
|
55
|
+
type: 'DialogHeader',
|
|
56
|
+
props: {
|
|
57
|
+
children: [
|
|
58
|
+
{
|
|
59
|
+
type: 'DialogTitle',
|
|
60
|
+
props: { children: 'Dialog Title' },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: 'DialogDescription',
|
|
64
|
+
props: {
|
|
65
|
+
children:
|
|
66
|
+
'This is a basic dialog example with a title and description.',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'DialogFooter',
|
|
74
|
+
props: {
|
|
75
|
+
children: {
|
|
76
|
+
type: 'Button',
|
|
77
|
+
props: {
|
|
78
|
+
type: 'submit',
|
|
79
|
+
children: 'Save changes',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'Form Dialog',
|
|
93
|
+
description: 'Dialog containing a form with input fields',
|
|
94
|
+
code: `<Dialog>
|
|
95
|
+
<DialogTrigger asChild>
|
|
96
|
+
<Button>Edit Profile</Button>
|
|
97
|
+
</DialogTrigger>
|
|
98
|
+
<DialogContent className="sm:max-w-[425px]">
|
|
99
|
+
<DialogHeader>
|
|
100
|
+
<DialogTitle>Edit Profile</DialogTitle>
|
|
101
|
+
<DialogDescription>
|
|
102
|
+
Make changes to your profile here. Click save when you're done.
|
|
103
|
+
</DialogDescription>
|
|
104
|
+
</DialogHeader>
|
|
105
|
+
<div className="grid gap-4 py-4">
|
|
106
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
107
|
+
<Label htmlFor="name" className="text-right">
|
|
108
|
+
Name
|
|
109
|
+
</Label>
|
|
110
|
+
<Input id="name" defaultValue="John Doe" className="col-span-3" />
|
|
111
|
+
</div>
|
|
112
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
113
|
+
<Label htmlFor="email" className="text-right">
|
|
114
|
+
Email
|
|
115
|
+
</Label>
|
|
116
|
+
<Input
|
|
117
|
+
id="email"
|
|
118
|
+
type="email"
|
|
119
|
+
defaultValue="john@example.com"
|
|
120
|
+
className="col-span-3"
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
<DialogFooter>
|
|
125
|
+
<Button type="submit">Save changes</Button>
|
|
126
|
+
</DialogFooter>
|
|
127
|
+
</DialogContent>
|
|
128
|
+
</Dialog>`,
|
|
129
|
+
preview: {
|
|
130
|
+
type: 'component',
|
|
131
|
+
component: 'Dialog',
|
|
132
|
+
props: {
|
|
133
|
+
children: [
|
|
134
|
+
{
|
|
135
|
+
type: 'DialogTrigger',
|
|
136
|
+
props: {
|
|
137
|
+
asChild: true,
|
|
138
|
+
children: {
|
|
139
|
+
type: 'Button',
|
|
140
|
+
props: { children: 'Edit Profile' },
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
type: 'DialogContent',
|
|
146
|
+
props: {
|
|
147
|
+
className: 'sm:max-w-[425px]',
|
|
148
|
+
children: [
|
|
149
|
+
{
|
|
150
|
+
type: 'DialogHeader',
|
|
151
|
+
props: {
|
|
152
|
+
children: [
|
|
153
|
+
{
|
|
154
|
+
type: 'DialogTitle',
|
|
155
|
+
props: { children: 'Edit Profile' },
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
type: 'DialogDescription',
|
|
159
|
+
props: {
|
|
160
|
+
children:
|
|
161
|
+
"Make changes to your profile here. Click save when you're done.",
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
type: 'div',
|
|
169
|
+
props: {
|
|
170
|
+
className: 'grid gap-4 py-4',
|
|
171
|
+
children: [
|
|
172
|
+
{
|
|
173
|
+
type: 'div',
|
|
174
|
+
props: {
|
|
175
|
+
className: 'grid grid-cols-4 items-center gap-4',
|
|
176
|
+
children: [
|
|
177
|
+
{
|
|
178
|
+
type: 'Label',
|
|
179
|
+
props: {
|
|
180
|
+
htmlFor: 'name',
|
|
181
|
+
className: 'text-right',
|
|
182
|
+
children: 'Name',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
type: 'Input',
|
|
187
|
+
props: {
|
|
188
|
+
id: 'name',
|
|
189
|
+
defaultValue: 'John Doe',
|
|
190
|
+
className: 'col-span-3',
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
type: 'div',
|
|
198
|
+
props: {
|
|
199
|
+
className: 'grid grid-cols-4 items-center gap-4',
|
|
200
|
+
children: [
|
|
201
|
+
{
|
|
202
|
+
type: 'Label',
|
|
203
|
+
props: {
|
|
204
|
+
htmlFor: 'email',
|
|
205
|
+
className: 'text-right',
|
|
206
|
+
children: 'Email',
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
type: 'Input',
|
|
211
|
+
props: {
|
|
212
|
+
id: 'email',
|
|
213
|
+
type: 'email',
|
|
214
|
+
defaultValue: 'john@example.com',
|
|
215
|
+
className: 'col-span-3',
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
type: 'DialogFooter',
|
|
226
|
+
props: {
|
|
227
|
+
children: {
|
|
228
|
+
type: 'Button',
|
|
229
|
+
props: {
|
|
230
|
+
type: 'submit',
|
|
231
|
+
children: 'Save changes',
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'Confirmation Dialog',
|
|
245
|
+
description: 'Dialog for confirming destructive actions',
|
|
246
|
+
code: `<Dialog>
|
|
247
|
+
<DialogTrigger asChild>
|
|
248
|
+
<Button variant="destructive">Delete Account</Button>
|
|
249
|
+
</DialogTrigger>
|
|
250
|
+
<DialogContent>
|
|
251
|
+
<DialogHeader>
|
|
252
|
+
<DialogTitle>Are you absolutely sure?</DialogTitle>
|
|
253
|
+
<DialogDescription>
|
|
254
|
+
This action cannot be undone. This will permanently delete your
|
|
255
|
+
account and remove your data from our servers.
|
|
256
|
+
</DialogDescription>
|
|
257
|
+
</DialogHeader>
|
|
258
|
+
<DialogFooter>
|
|
259
|
+
<Button variant="outline">Cancel</Button>
|
|
260
|
+
<Button variant="destructive">Delete Account</Button>
|
|
261
|
+
</DialogFooter>
|
|
262
|
+
</DialogContent>
|
|
263
|
+
</Dialog>`,
|
|
264
|
+
preview: {
|
|
265
|
+
type: 'component',
|
|
266
|
+
component: 'Dialog',
|
|
267
|
+
props: {
|
|
268
|
+
children: [
|
|
269
|
+
{
|
|
270
|
+
type: 'DialogTrigger',
|
|
271
|
+
props: {
|
|
272
|
+
asChild: true,
|
|
273
|
+
children: {
|
|
274
|
+
type: 'Button',
|
|
275
|
+
props: {
|
|
276
|
+
variant: 'destructive',
|
|
277
|
+
children: 'Delete Account',
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
type: 'DialogContent',
|
|
284
|
+
props: {
|
|
285
|
+
children: [
|
|
286
|
+
{
|
|
287
|
+
type: 'DialogHeader',
|
|
288
|
+
props: {
|
|
289
|
+
children: [
|
|
290
|
+
{
|
|
291
|
+
type: 'DialogTitle',
|
|
292
|
+
props: { children: 'Are you absolutely sure?' },
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
type: 'DialogDescription',
|
|
296
|
+
props: {
|
|
297
|
+
children:
|
|
298
|
+
'This action cannot be undone. This will permanently delete your account and remove your data from our servers.',
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
type: 'DialogFooter',
|
|
306
|
+
props: {
|
|
307
|
+
children: [
|
|
308
|
+
{
|
|
309
|
+
type: 'Button',
|
|
310
|
+
props: {
|
|
311
|
+
variant: 'outline',
|
|
312
|
+
children: 'Cancel',
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
type: 'Button',
|
|
317
|
+
props: {
|
|
318
|
+
variant: 'destructive',
|
|
319
|
+
children: 'Delete Account',
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
],
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: 'No Close Button',
|
|
334
|
+
description: 'Dialog without the default close button',
|
|
335
|
+
code: `<Dialog>
|
|
336
|
+
<DialogTrigger asChild>
|
|
337
|
+
<Button variant="outline">Open Custom Dialog</Button>
|
|
338
|
+
</DialogTrigger>
|
|
339
|
+
<DialogContent showCloseButton={false}>
|
|
340
|
+
<DialogHeader>
|
|
341
|
+
<DialogTitle>Custom Dialog</DialogTitle>
|
|
342
|
+
<DialogDescription>
|
|
343
|
+
This dialog doesn't have the default close button. You must use the footer buttons.
|
|
344
|
+
</DialogDescription>
|
|
345
|
+
</DialogHeader>
|
|
346
|
+
<DialogFooter>
|
|
347
|
+
<DialogClose asChild>
|
|
348
|
+
<Button variant="outline">Close</Button>
|
|
349
|
+
</DialogClose>
|
|
350
|
+
<Button>Continue</Button>
|
|
351
|
+
</DialogFooter>
|
|
352
|
+
</DialogContent>
|
|
353
|
+
</Dialog>`,
|
|
354
|
+
preview: {
|
|
355
|
+
type: 'component',
|
|
356
|
+
component: 'Dialog',
|
|
357
|
+
props: {
|
|
358
|
+
children: [
|
|
359
|
+
{
|
|
360
|
+
type: 'DialogTrigger',
|
|
361
|
+
props: {
|
|
362
|
+
asChild: true,
|
|
363
|
+
children: {
|
|
364
|
+
type: 'Button',
|
|
365
|
+
props: {
|
|
366
|
+
variant: 'outline',
|
|
367
|
+
children: 'Open Custom Dialog',
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
type: 'DialogContent',
|
|
374
|
+
props: {
|
|
375
|
+
showCloseButton: false,
|
|
376
|
+
children: [
|
|
377
|
+
{
|
|
378
|
+
type: 'DialogHeader',
|
|
379
|
+
props: {
|
|
380
|
+
children: [
|
|
381
|
+
{
|
|
382
|
+
type: 'DialogTitle',
|
|
383
|
+
props: { children: 'Custom Dialog' },
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
type: 'DialogDescription',
|
|
387
|
+
props: {
|
|
388
|
+
children:
|
|
389
|
+
"This dialog doesn't have the default close button. You must use the footer buttons.",
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
],
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
type: 'DialogFooter',
|
|
397
|
+
props: {
|
|
398
|
+
children: [
|
|
399
|
+
{
|
|
400
|
+
type: 'DialogClose',
|
|
401
|
+
props: {
|
|
402
|
+
asChild: true,
|
|
403
|
+
children: {
|
|
404
|
+
type: 'Button',
|
|
405
|
+
props: {
|
|
406
|
+
variant: 'outline',
|
|
407
|
+
children: 'Close',
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
type: 'Button',
|
|
414
|
+
props: { children: 'Continue' },
|
|
415
|
+
},
|
|
416
|
+
],
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
],
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
],
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
name: 'Large Dialog',
|
|
428
|
+
description: 'Dialog with custom size and scrollable content',
|
|
429
|
+
code: `<Dialog>
|
|
430
|
+
<DialogTrigger asChild>
|
|
431
|
+
<Button>View Details</Button>
|
|
432
|
+
</DialogTrigger>
|
|
433
|
+
<DialogContent className="sm:max-w-[625px] max-h-[80vh] overflow-y-auto">
|
|
434
|
+
<DialogHeader>
|
|
435
|
+
<DialogTitle>Detailed Information</DialogTitle>
|
|
436
|
+
<DialogDescription>
|
|
437
|
+
This dialog contains a lot of content and is scrollable.
|
|
438
|
+
</DialogDescription>
|
|
439
|
+
</DialogHeader>
|
|
440
|
+
<div className="space-y-4">
|
|
441
|
+
<div>
|
|
442
|
+
<h3 className="text-lg font-medium">Section 1</h3>
|
|
443
|
+
<p className="text-sm text-muted-foreground">
|
|
444
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
445
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
446
|
+
veniam, quis nostrud exercitation ullamco laboris.
|
|
447
|
+
</p>
|
|
448
|
+
</div>
|
|
449
|
+
<div>
|
|
450
|
+
<h3 className="text-lg font-medium">Section 2</h3>
|
|
451
|
+
<p className="text-sm text-muted-foreground">
|
|
452
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
|
453
|
+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
|
454
|
+
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
455
|
+
</p>
|
|
456
|
+
</div>
|
|
457
|
+
</div>
|
|
458
|
+
<DialogFooter>
|
|
459
|
+
<Button variant="outline">Cancel</Button>
|
|
460
|
+
<Button>Accept</Button>
|
|
461
|
+
</DialogFooter>
|
|
462
|
+
</DialogContent>
|
|
463
|
+
</Dialog>`,
|
|
464
|
+
preview: {
|
|
465
|
+
type: 'component',
|
|
466
|
+
component: 'Dialog',
|
|
467
|
+
props: {
|
|
468
|
+
children: [
|
|
469
|
+
{
|
|
470
|
+
type: 'DialogTrigger',
|
|
471
|
+
props: {
|
|
472
|
+
asChild: true,
|
|
473
|
+
children: {
|
|
474
|
+
type: 'Button',
|
|
475
|
+
props: { children: 'View Details' },
|
|
476
|
+
},
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
type: 'DialogContent',
|
|
481
|
+
props: {
|
|
482
|
+
className: 'sm:max-w-[625px] max-h-[80vh] overflow-y-auto',
|
|
483
|
+
children: [
|
|
484
|
+
{
|
|
485
|
+
type: 'DialogHeader',
|
|
486
|
+
props: {
|
|
487
|
+
children: [
|
|
488
|
+
{
|
|
489
|
+
type: 'DialogTitle',
|
|
490
|
+
props: { children: 'Detailed Information' },
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
type: 'DialogDescription',
|
|
494
|
+
props: {
|
|
495
|
+
children:
|
|
496
|
+
'This dialog contains a lot of content and is scrollable.',
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
],
|
|
500
|
+
},
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
type: 'div',
|
|
504
|
+
props: {
|
|
505
|
+
className: 'space-y-4',
|
|
506
|
+
children: [
|
|
507
|
+
{
|
|
508
|
+
type: 'div',
|
|
509
|
+
props: {
|
|
510
|
+
children: [
|
|
511
|
+
{
|
|
512
|
+
type: 'h3',
|
|
513
|
+
props: {
|
|
514
|
+
className: 'text-lg font-medium',
|
|
515
|
+
children: 'Section 1',
|
|
516
|
+
},
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
type: 'p',
|
|
520
|
+
props: {
|
|
521
|
+
className: 'text-sm text-muted-foreground',
|
|
522
|
+
children:
|
|
523
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
],
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
type: 'div',
|
|
531
|
+
props: {
|
|
532
|
+
children: [
|
|
533
|
+
{
|
|
534
|
+
type: 'h3',
|
|
535
|
+
props: {
|
|
536
|
+
className: 'text-lg font-medium',
|
|
537
|
+
children: 'Section 2',
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
type: 'p',
|
|
542
|
+
props: {
|
|
543
|
+
className: 'text-sm text-muted-foreground',
|
|
544
|
+
children:
|
|
545
|
+
'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.',
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
],
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
],
|
|
552
|
+
},
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
type: 'DialogFooter',
|
|
556
|
+
props: {
|
|
557
|
+
children: [
|
|
558
|
+
{
|
|
559
|
+
type: 'Button',
|
|
560
|
+
props: {
|
|
561
|
+
variant: 'outline',
|
|
562
|
+
children: 'Cancel',
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
type: 'Button',
|
|
567
|
+
props: { children: 'Accept' },
|
|
568
|
+
},
|
|
569
|
+
],
|
|
570
|
+
},
|
|
571
|
+
},
|
|
572
|
+
],
|
|
573
|
+
},
|
|
574
|
+
},
|
|
575
|
+
],
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
],
|
|
580
|
+
dependencies: ['utils'],
|
|
581
|
+
files: ['components/primitives/dialog/index.tsx'],
|
|
582
|
+
};
|