@auto-engineer/generate-react-client 1.21.0 → 1.23.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/starter/.storybook/main.ts +42 -32
  3. package/dist/starter/.storybook/preview.tsx +12 -0
  4. package/dist/starter/src/components/ui/Accordion.stories.tsx +1 -1
  5. package/dist/starter/src/components/ui/Alert.stories.tsx +1 -1
  6. package/dist/starter/src/components/ui/AlertDialog.stories.tsx +1 -1
  7. package/dist/starter/src/components/ui/AspectRatio.stories.tsx +1 -1
  8. package/dist/starter/src/components/ui/Avatar.stories.tsx +1 -1
  9. package/dist/starter/src/components/ui/Badge.stories.tsx +1 -1
  10. package/dist/starter/src/components/ui/Breadcrumb.stories.tsx +1 -1
  11. package/dist/starter/src/components/ui/Button.stories.tsx +1 -1
  12. package/dist/starter/src/components/ui/ButtonGroup.stories.tsx +1 -1
  13. package/dist/starter/src/components/ui/Calendar.stories.tsx +1 -1
  14. package/dist/starter/src/components/ui/Card.stories.tsx +1 -1
  15. package/dist/starter/src/components/ui/Carousel.stories.tsx +1 -1
  16. package/dist/starter/src/components/ui/Chart.stories.tsx +1 -1
  17. package/dist/starter/src/components/ui/Checkbox.stories.tsx +1 -1
  18. package/dist/starter/src/components/ui/Collapsible.stories.tsx +1 -1
  19. package/dist/starter/src/components/ui/Combobox.stories.tsx +1 -1
  20. package/dist/starter/src/components/ui/Command.stories.tsx +1 -1
  21. package/dist/starter/src/components/ui/ContextMenu.stories.tsx +1 -1
  22. package/dist/starter/src/components/ui/DesignSystem-Overview.stories.tsx +738 -0
  23. package/dist/starter/src/components/ui/Dialog.stories.tsx +1 -1
  24. package/dist/starter/src/components/ui/Direction.stories.tsx +1 -1
  25. package/dist/starter/src/components/ui/Drawer.stories.tsx +1 -1
  26. package/dist/starter/src/components/ui/DropdownMenu.stories.tsx +1 -1
  27. package/dist/starter/src/components/ui/Empty.stories.tsx +1 -1
  28. package/dist/starter/src/components/ui/Field.stories.tsx +1 -1
  29. package/dist/starter/src/components/ui/Form.stories.tsx +1 -1
  30. package/dist/starter/src/components/ui/HoverCard.stories.tsx +1 -1
  31. package/dist/starter/src/components/ui/Input.stories.tsx +1 -1
  32. package/dist/starter/src/components/ui/InputGroup.stories.tsx +1 -1
  33. package/dist/starter/src/components/ui/InputOTP.stories.tsx +1 -1
  34. package/dist/starter/src/components/ui/Item.stories.tsx +1 -1
  35. package/dist/starter/src/components/ui/Kbd.stories.tsx +1 -1
  36. package/dist/starter/src/components/ui/Label.stories.tsx +1 -1
  37. package/dist/starter/src/components/ui/Menubar.stories.tsx +1 -1
  38. package/dist/starter/src/components/ui/NativeSelect.stories.tsx +1 -1
  39. package/dist/starter/src/components/ui/NavigationMenu.stories.tsx +1 -1
  40. package/dist/starter/src/components/ui/Pagination.stories.tsx +1 -1
  41. package/dist/starter/src/components/ui/Popover.stories.tsx +1 -1
  42. package/dist/starter/src/components/ui/Progress.stories.tsx +1 -1
  43. package/dist/starter/src/components/ui/RadioGroup.stories.tsx +1 -1
  44. package/dist/starter/src/components/ui/Resizable.stories.tsx +1 -1
  45. package/dist/starter/src/components/ui/ScrollArea.stories.tsx +1 -1
  46. package/dist/starter/src/components/ui/Select.stories.tsx +1 -1
  47. package/dist/starter/src/components/ui/Separator.stories.tsx +1 -1
  48. package/dist/starter/src/components/ui/Sheet.stories.tsx +1 -1
  49. package/dist/starter/src/components/ui/Sidebar.stories.tsx +1 -1
  50. package/dist/starter/src/components/ui/Skeleton.stories.tsx +1 -1
  51. package/dist/starter/src/components/ui/Slider.stories.tsx +1 -1
  52. package/dist/starter/src/components/ui/Sonner.stories.tsx +1 -1
  53. package/dist/starter/src/components/ui/Spinner.stories.tsx +1 -1
  54. package/dist/starter/src/components/ui/Switch.stories.tsx +1 -1
  55. package/dist/starter/src/components/ui/Table.stories.tsx +1 -1
  56. package/dist/starter/src/components/ui/Tabs.stories.tsx +1 -1
  57. package/dist/starter/src/components/ui/Textarea.stories.tsx +1 -1
  58. package/dist/starter/src/components/ui/Toast.stories.tsx +4 -4
  59. package/dist/starter/src/components/ui/Toggle.stories.tsx +1 -1
  60. package/dist/starter/src/components/ui/ToggleGroup.stories.tsx +1 -1
  61. package/dist/starter/src/components/ui/Tooltip.stories.tsx +1 -1
  62. package/package.json +2 -2
@@ -0,0 +1,738 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import type { Meta, StoryObj } from '@storybook/react-vite';
5
+ import { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from '@/components/ui/Avatar';
6
+ import { Badge } from '@/components/ui/Badge';
7
+ import { Button } from '@/components/ui/Button';
8
+ import { ButtonGroup } from '@/components/ui/ButtonGroup';
9
+ import { Checkbox } from '@/components/ui/Checkbox';
10
+ import {
11
+ DropdownMenu,
12
+ DropdownMenuContent,
13
+ DropdownMenuGroup,
14
+ DropdownMenuItem,
15
+ DropdownMenuRadioGroup,
16
+ DropdownMenuRadioItem,
17
+ DropdownMenuSeparator,
18
+ DropdownMenuSub,
19
+ DropdownMenuSubContent,
20
+ DropdownMenuSubTrigger,
21
+ DropdownMenuTrigger,
22
+ } from '@/components/ui/DropdownMenu';
23
+ import {
24
+ Empty,
25
+ EmptyContent,
26
+ EmptyDescription,
27
+ EmptyHeader,
28
+ EmptyMedia,
29
+ EmptyTitle,
30
+ } from '@/components/ui/Empty';
31
+ import {
32
+ Field,
33
+ FieldContent,
34
+ FieldDescription,
35
+ FieldGroup,
36
+ FieldLabel,
37
+ FieldLegend,
38
+ FieldSeparator,
39
+ FieldSet,
40
+ FieldTitle,
41
+ } from '@/components/ui/Field';
42
+ import { Input } from '@/components/ui/Input';
43
+ import {
44
+ InputGroup,
45
+ InputGroupAddon,
46
+ InputGroupButton,
47
+ InputGroupInput,
48
+ InputGroupText,
49
+ InputGroupTextarea,
50
+ } from '@/components/ui/InputGroup';
51
+ import { Item, ItemActions, ItemContent, ItemDescription, ItemMedia, ItemTitle } from '@/components/ui/Item';
52
+ import { RadioGroup, RadioGroupItem } from '@/components/ui/RadioGroup';
53
+ import {
54
+ Select,
55
+ SelectContent,
56
+ SelectGroup,
57
+ SelectItem,
58
+ SelectTrigger,
59
+ SelectValue,
60
+ } from '@/components/ui/Select';
61
+ import { Slider } from '@/components/ui/Slider';
62
+ import { Spinner } from '@/components/ui/Spinner';
63
+ import { Switch } from '@/components/ui/Switch';
64
+ import { Textarea } from '@/components/ui/Textarea';
65
+ import {
66
+ ArchiveIcon,
67
+ ArrowLeftIcon,
68
+ ArrowUpIcon,
69
+ BadgeCheckIcon,
70
+ CalendarPlusIcon,
71
+ ChevronRightIcon,
72
+ ClockIcon,
73
+ InfoIcon,
74
+ ListFilterIcon,
75
+ MailCheckIcon,
76
+ MoreHorizontalIcon,
77
+ PlusIcon,
78
+ SearchIcon,
79
+ TagIcon,
80
+ Trash2Icon,
81
+ } from 'lucide-react';
82
+
83
+ function PaymentMethodDemo() {
84
+ return (
85
+ <div className="w-full max-w-sm">
86
+ <form>
87
+ <FieldGroup>
88
+ <FieldSet>
89
+ <FieldLegend>Payment Method</FieldLegend>
90
+ <FieldDescription>All transactions are secure and encrypted</FieldDescription>
91
+ <FieldGroup>
92
+ <Field>
93
+ <FieldLabel htmlFor="card-name">Name on Card</FieldLabel>
94
+ <Input id="card-name" placeholder="John Doe" />
95
+ </Field>
96
+ <div className="grid grid-cols-3 gap-4">
97
+ <Field className="col-span-2">
98
+ <FieldLabel htmlFor="card-number">Card Number</FieldLabel>
99
+ <Input id="card-number" placeholder="1234 5678 9012 3456" />
100
+ <FieldDescription>Enter your 16-digit number.</FieldDescription>
101
+ </Field>
102
+ <Field className="col-span-1">
103
+ <FieldLabel htmlFor="cvv">CVV</FieldLabel>
104
+ <Input id="cvv" placeholder="123" />
105
+ </Field>
106
+ </div>
107
+ <div className="grid grid-cols-2 gap-4">
108
+ <Field>
109
+ <FieldLabel htmlFor="exp-month">Month</FieldLabel>
110
+ <Select defaultValue="">
111
+ <SelectTrigger id="exp-month">
112
+ <SelectValue placeholder="MM" />
113
+ </SelectTrigger>
114
+ <SelectContent>
115
+ <SelectGroup>
116
+ {['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'].map((month) => (
117
+ <SelectItem key={month} value={month}>
118
+ {month}
119
+ </SelectItem>
120
+ ))}
121
+ </SelectGroup>
122
+ </SelectContent>
123
+ </Select>
124
+ </Field>
125
+ <Field>
126
+ <FieldLabel htmlFor="exp-year">Year</FieldLabel>
127
+ <Select defaultValue="">
128
+ <SelectTrigger id="exp-year">
129
+ <SelectValue placeholder="YYYY" />
130
+ </SelectTrigger>
131
+ <SelectContent>
132
+ <SelectGroup>
133
+ {[2024, 2025, 2026, 2027, 2028, 2029].map((year) => (
134
+ <SelectItem key={year} value={String(year)}>
135
+ {year}
136
+ </SelectItem>
137
+ ))}
138
+ </SelectGroup>
139
+ </SelectContent>
140
+ </Select>
141
+ </Field>
142
+ </div>
143
+ </FieldGroup>
144
+ </FieldSet>
145
+ <FieldSeparator />
146
+ <FieldSet>
147
+ <FieldLegend>Billing Address</FieldLegend>
148
+ <FieldDescription>The billing address associated with your payment method</FieldDescription>
149
+ <FieldGroup>
150
+ <Field orientation="horizontal">
151
+ <Checkbox id="same-as-shipping" defaultChecked />
152
+ <FieldLabel htmlFor="same-as-shipping" className="font-normal">
153
+ Same as shipping address
154
+ </FieldLabel>
155
+ </Field>
156
+ </FieldGroup>
157
+ </FieldSet>
158
+ <FieldSeparator />
159
+ <FieldSet>
160
+ <FieldGroup>
161
+ <Field>
162
+ <FieldLabel htmlFor="comments">Comments</FieldLabel>
163
+ <Textarea id="comments" placeholder="Add any additional comments" />
164
+ </Field>
165
+ </FieldGroup>
166
+ </FieldSet>
167
+ <Field orientation="horizontal">
168
+ <Button type="submit">Submit</Button>
169
+ <Button variant="outline" type="button">
170
+ Cancel
171
+ </Button>
172
+ </Field>
173
+ </FieldGroup>
174
+ </form>
175
+ </div>
176
+ );
177
+ }
178
+
179
+ function EmptyAvatarGroupDemo() {
180
+ return (
181
+ <Empty className="flex-none py-4">
182
+ <EmptyHeader>
183
+ <EmptyMedia>
184
+ <AvatarGroup className="grayscale">
185
+ <Avatar>
186
+ <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
187
+ <AvatarFallback>CN</AvatarFallback>
188
+ </Avatar>
189
+ <Avatar>
190
+ <AvatarImage src="https://github.com/maxleiter.png" alt="@maxleiter" />
191
+ <AvatarFallback>LR</AvatarFallback>
192
+ </Avatar>
193
+ <Avatar>
194
+ <AvatarImage src="https://github.com/evilrabbit.png" alt="@evilrabbit" />
195
+ <AvatarFallback>ER</AvatarFallback>
196
+ </Avatar>
197
+ </AvatarGroup>
198
+ </EmptyMedia>
199
+ <EmptyTitle>No Team Members</EmptyTitle>
200
+ <EmptyDescription>Invite your team to collaborate on this project.</EmptyDescription>
201
+ </EmptyHeader>
202
+ <EmptyContent>
203
+ <Button size="sm">
204
+ <PlusIcon className="mr-2 size-4" />
205
+ Invite Members
206
+ </Button>
207
+ </EmptyContent>
208
+ </Empty>
209
+ );
210
+ }
211
+
212
+ function SpinnerBadgeDemo() {
213
+ return (
214
+ <div className="flex items-center gap-2">
215
+ <Badge>
216
+ <Spinner className="mr-1" />
217
+ Syncing
218
+ </Badge>
219
+ <Badge variant="secondary">
220
+ <Spinner className="mr-1" />
221
+ Updating
222
+ </Badge>
223
+ <Badge variant="outline">
224
+ <Spinner className="mr-1" />
225
+ Loading
226
+ </Badge>
227
+ </div>
228
+ );
229
+ }
230
+
231
+ function ButtonGroupDemo() {
232
+ const [label, setLabel] = React.useState('personal');
233
+
234
+ return (
235
+ <ButtonGroup>
236
+ <ButtonGroup className="hidden sm:flex">
237
+ <Button variant="outline" size="sm" aria-label="Go Back">
238
+ <ArrowLeftIcon className="size-4" />
239
+ </Button>
240
+ </ButtonGroup>
241
+ <ButtonGroup>
242
+ <Button variant="outline" size="sm">
243
+ Archive
244
+ </Button>
245
+ <Button variant="outline" size="sm">
246
+ Report
247
+ </Button>
248
+ </ButtonGroup>
249
+ <ButtonGroup>
250
+ <Button variant="outline" size="sm">
251
+ Snooze
252
+ </Button>
253
+ <DropdownMenu>
254
+ <DropdownMenuTrigger asChild>
255
+ <Button variant="outline" size="sm" aria-label="More Options">
256
+ <MoreHorizontalIcon className="size-4" />
257
+ </Button>
258
+ </DropdownMenuTrigger>
259
+ <DropdownMenuContent align="end" className="w-48">
260
+ <DropdownMenuGroup>
261
+ <DropdownMenuItem>
262
+ <MailCheckIcon className="mr-2 size-4" />
263
+ Mark as Read
264
+ </DropdownMenuItem>
265
+ <DropdownMenuItem>
266
+ <ArchiveIcon className="mr-2 size-4" />
267
+ Archive
268
+ </DropdownMenuItem>
269
+ </DropdownMenuGroup>
270
+ <DropdownMenuSeparator />
271
+ <DropdownMenuGroup>
272
+ <DropdownMenuItem>
273
+ <ClockIcon className="mr-2 size-4" />
274
+ Snooze
275
+ </DropdownMenuItem>
276
+ <DropdownMenuItem>
277
+ <CalendarPlusIcon className="mr-2 size-4" />
278
+ Add to Calendar
279
+ </DropdownMenuItem>
280
+ <DropdownMenuItem>
281
+ <ListFilterIcon className="mr-2 size-4" />
282
+ Add to List
283
+ </DropdownMenuItem>
284
+ <DropdownMenuSub>
285
+ <DropdownMenuSubTrigger>
286
+ <TagIcon className="mr-2 size-4" />
287
+ Label As...
288
+ </DropdownMenuSubTrigger>
289
+ <DropdownMenuSubContent>
290
+ <DropdownMenuRadioGroup value={label} onValueChange={setLabel}>
291
+ <DropdownMenuRadioItem value="personal">Personal</DropdownMenuRadioItem>
292
+ <DropdownMenuRadioItem value="work">Work</DropdownMenuRadioItem>
293
+ <DropdownMenuRadioItem value="other">Other</DropdownMenuRadioItem>
294
+ </DropdownMenuRadioGroup>
295
+ </DropdownMenuSubContent>
296
+ </DropdownMenuSub>
297
+ </DropdownMenuGroup>
298
+ <DropdownMenuSeparator />
299
+ <DropdownMenuGroup>
300
+ <DropdownMenuItem className="text-destructive">
301
+ <Trash2Icon className="mr-2 size-4" />
302
+ Trash
303
+ </DropdownMenuItem>
304
+ </DropdownMenuGroup>
305
+ </DropdownMenuContent>
306
+ </DropdownMenu>
307
+ </ButtonGroup>
308
+ </ButtonGroup>
309
+ );
310
+ }
311
+
312
+ function FieldSliderDemo() {
313
+ const [value, setValue] = React.useState([200, 800]);
314
+ return (
315
+ <div className="w-full max-w-xs">
316
+ <Field>
317
+ <FieldTitle>Price Range</FieldTitle>
318
+ <FieldDescription>
319
+ Set your budget range ($<span className="font-medium tabular-nums">{value[0]}</span> -{' '}
320
+ <span className="font-medium tabular-nums">{value[1]}</span>).
321
+ </FieldDescription>
322
+ <Slider value={value} onValueChange={setValue} max={1000} min={0} step={10} className="mt-2 w-full" />
323
+ </Field>
324
+ </div>
325
+ );
326
+ }
327
+
328
+ function InputGroupDemo() {
329
+ return (
330
+ <div className="grid w-full max-w-xs gap-6">
331
+ <InputGroup>
332
+ <InputGroupInput placeholder="Search..." />
333
+ <InputGroupAddon>
334
+ <SearchIcon className="size-4" />
335
+ </InputGroupAddon>
336
+ <InputGroupAddon align="inline-end">12 results</InputGroupAddon>
337
+ </InputGroup>
338
+ <InputGroup>
339
+ <InputGroupInput placeholder="example.com" className="!pl-1" />
340
+ <InputGroupAddon>
341
+ <InputGroupText>https://</InputGroupText>
342
+ </InputGroupAddon>
343
+ <InputGroupAddon align="inline-end">
344
+ <InputGroupButton className="rounded-full" size="sm" aria-label="Info">
345
+ <InfoIcon className="size-4" />
346
+ </InputGroupButton>
347
+ </InputGroupAddon>
348
+ </InputGroup>
349
+ <InputGroup>
350
+ <InputGroupTextarea placeholder="Ask, Search or Chat..." />
351
+ <InputGroupAddon align="block-end">
352
+ <InputGroupButton variant="outline" className="rounded-full" size="sm" aria-label="Add">
353
+ <PlusIcon className="size-4" />
354
+ </InputGroupButton>
355
+ <InputGroupText className="ml-auto">52% used</InputGroupText>
356
+ <InputGroupButton variant="default" className="rounded-full" size="sm">
357
+ <ArrowUpIcon className="size-4" />
358
+ <span className="sr-only">Send</span>
359
+ </InputGroupButton>
360
+ </InputGroupAddon>
361
+ </InputGroup>
362
+ </div>
363
+ );
364
+ }
365
+
366
+ function ItemDemo() {
367
+ return (
368
+ <div className="flex w-full max-w-xs flex-col gap-6">
369
+ <Item variant="outline">
370
+ <ItemContent>
371
+ <ItemTitle>Two-factor authentication</ItemTitle>
372
+ <ItemDescription>Verify via email or phone number.</ItemDescription>
373
+ </ItemContent>
374
+ <ItemActions>
375
+ <Button size="sm">Enable</Button>
376
+ </ItemActions>
377
+ </Item>
378
+ <Item variant="outline" size="sm" asChild>
379
+ <a href="/profile">
380
+ <ItemMedia>
381
+ <BadgeCheckIcon className="size-5" />
382
+ </ItemMedia>
383
+ <ItemContent>
384
+ <ItemTitle>Your profile has been verified.</ItemTitle>
385
+ </ItemContent>
386
+ <ItemActions>
387
+ <ChevronRightIcon className="size-4" />
388
+ </ItemActions>
389
+ </a>
390
+ </Item>
391
+ </div>
392
+ );
393
+ }
394
+
395
+ function AppearanceSettingsDemo() {
396
+ const [gpuCount, setGpuCount] = React.useState(8);
397
+
398
+ return (
399
+ <FieldSet>
400
+ <FieldGroup>
401
+ <FieldSet>
402
+ <FieldLegend>Compute Environment</FieldLegend>
403
+ <FieldDescription>Select the compute environment for your cluster.</FieldDescription>
404
+ <RadioGroup defaultValue="kubernetes">
405
+ <FieldLabel htmlFor="kubernetes">
406
+ <Field orientation="horizontal">
407
+ <FieldContent>
408
+ <FieldTitle>Kubernetes</FieldTitle>
409
+ <FieldDescription>Run GPU workloads on a K8s configured cluster. This is the default.</FieldDescription>
410
+ </FieldContent>
411
+ <RadioGroupItem value="kubernetes" id="kubernetes" aria-label="Kubernetes" />
412
+ </Field>
413
+ </FieldLabel>
414
+ <FieldLabel htmlFor="vm">
415
+ <Field orientation="horizontal">
416
+ <FieldContent>
417
+ <FieldTitle>Virtual Machine</FieldTitle>
418
+ <FieldDescription>Access a VM configured cluster to run workloads. (Coming soon)</FieldDescription>
419
+ </FieldContent>
420
+ <RadioGroupItem value="vm" id="vm" aria-label="Virtual Machine" />
421
+ </Field>
422
+ </FieldLabel>
423
+ </RadioGroup>
424
+ </FieldSet>
425
+ <FieldSeparator />
426
+ <Field orientation="horizontal">
427
+ <FieldContent>
428
+ <FieldLabel htmlFor="number-of-gpus">Number of GPUs</FieldLabel>
429
+ <FieldDescription>You can add more later.</FieldDescription>
430
+ </FieldContent>
431
+ <div className="flex items-center rounded-md border">
432
+ <Button
433
+ variant="ghost"
434
+ size="sm"
435
+ type="button"
436
+ aria-label="Decrement"
437
+ className="h-9 w-10 rounded-none border-r"
438
+ onClick={() => setGpuCount(Math.max(1, gpuCount - 1))}
439
+ >
440
+ -
441
+ </Button>
442
+ <span className="flex h-9 w-14 items-center justify-center font-mono text-sm">{gpuCount}</span>
443
+ <Button
444
+ variant="ghost"
445
+ size="sm"
446
+ type="button"
447
+ aria-label="Increment"
448
+ className="h-9 w-10 rounded-none border-l"
449
+ onClick={() => setGpuCount(Math.min(99, gpuCount + 1))}
450
+ >
451
+ +
452
+ </Button>
453
+ </div>
454
+ </Field>
455
+ <FieldSeparator />
456
+ <Field orientation="horizontal">
457
+ <FieldContent>
458
+ <FieldLabel htmlFor="tinting">Wallpaper Tinting</FieldLabel>
459
+ <FieldDescription>Allow the wallpaper to be tinted.</FieldDescription>
460
+ </FieldContent>
461
+ <Switch id="tinting" defaultChecked />
462
+ </Field>
463
+ </FieldGroup>
464
+ </FieldSet>
465
+ );
466
+ }
467
+
468
+ function SpinnerEmptyDemo() {
469
+ return (
470
+ <Empty className="w-full max-w-xs py-4">
471
+ <EmptyHeader>
472
+ <EmptyMedia variant="icon">
473
+ <Spinner />
474
+ </EmptyMedia>
475
+ <EmptyTitle>Processing your request</EmptyTitle>
476
+ <EmptyDescription>Please wait while we process your request. Do not refresh the page.</EmptyDescription>
477
+ </EmptyHeader>
478
+ <EmptyContent>
479
+ <Button variant="outline" size="sm">
480
+ Cancel
481
+ </Button>
482
+ </EmptyContent>
483
+ </Empty>
484
+ );
485
+ }
486
+
487
+ function FieldCheckboxDemo() {
488
+ return (
489
+ <FieldLabel htmlFor="checkbox-demo">
490
+ <Field orientation="horizontal">
491
+ <Checkbox id="checkbox-demo" defaultChecked />
492
+ <FieldLabel htmlFor="checkbox-demo" className="font-normal">
493
+ I agree to the terms and conditions
494
+ </FieldLabel>
495
+ </Field>
496
+ </FieldLabel>
497
+ );
498
+ }
499
+
500
+ function Tile({ children, className }: { children: React.ReactNode; className?: string }) {
501
+ return (
502
+ <div className={`rounded-xl border bg-card p-6 ${className ?? ''}`}>
503
+ {children}
504
+ </div>
505
+ );
506
+ }
507
+
508
+ function NotionPromptDemo() {
509
+ return (
510
+ <div className="w-full">
511
+ <InputGroup>
512
+ <InputGroupAddon>
513
+ <Button variant="outline" size="sm" className="h-7 gap-1 px-2 text-xs">
514
+ <PlusIcon className="size-3" />
515
+ Add context
516
+ </Button>
517
+ </InputGroupAddon>
518
+ <InputGroupInput placeholder="Ask, search, or make anything..." />
519
+ </InputGroup>
520
+ </div>
521
+ );
522
+ }
523
+
524
+ function SourceSelectorDemo() {
525
+ return (
526
+ <div className="flex items-center gap-2">
527
+ <Button variant="ghost" size="sm" className="h-8 gap-1.5">
528
+ <span className="size-4 rounded border" />
529
+ Auto
530
+ </Button>
531
+ <Button variant="ghost" size="sm" className="h-8 gap-1.5">
532
+ <span className="size-4 rounded-full border" />
533
+ All Sources
534
+ </Button>
535
+ <Button variant="default" size="sm" className="ml-auto size-8 rounded-full p-0">
536
+ <ArrowUpIcon className="size-4" />
537
+ </Button>
538
+ </div>
539
+ );
540
+ }
541
+
542
+ function UrlBookmarkDemo() {
543
+ return (
544
+ <InputGroup>
545
+ <InputGroupAddon>
546
+ <InfoIcon className="size-4" />
547
+ </InputGroupAddon>
548
+ <InputGroupInput placeholder="https://" className="!pl-0" />
549
+ <InputGroupAddon align="inline-end">
550
+ <Button variant="ghost" size="sm" className="size-6 p-0">
551
+ <svg className="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true">
552
+ <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
553
+ </svg>
554
+ </Button>
555
+ </InputGroupAddon>
556
+ </InputGroup>
557
+ );
558
+ }
559
+
560
+ function PaginationDemo() {
561
+ return (
562
+ <div className="flex items-center gap-2">
563
+ <ButtonGroup>
564
+ <Button variant="outline" size="sm" className="size-8 p-0">1</Button>
565
+ <Button variant="outline" size="sm" className="size-8 p-0">2</Button>
566
+ <Button variant="outline" size="sm" className="size-8 p-0">3</Button>
567
+ </ButtonGroup>
568
+ <ButtonGroup>
569
+ <Button variant="outline" size="sm" className="size-8 p-0">
570
+ <ArrowLeftIcon className="size-4" />
571
+ </Button>
572
+ <Button variant="outline" size="sm" className="size-8 p-0">
573
+ <ChevronRightIcon className="size-4" />
574
+ </Button>
575
+ </ButtonGroup>
576
+ </div>
577
+ );
578
+ }
579
+
580
+ function CopilotDropdownDemo() {
581
+ return (
582
+ <DropdownMenu>
583
+ <DropdownMenuTrigger asChild>
584
+ <Button variant="outline" size="sm" className="gap-1.5">
585
+ <svg className="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true">
586
+ <rect x="3" y="3" width="18" height="18" rx="2" />
587
+ <path d="M3 9h18" />
588
+ </svg>
589
+ Copilot
590
+ </Button>
591
+ </DropdownMenuTrigger>
592
+ <DropdownMenuContent align="end">
593
+ <DropdownMenuItem>Option 1</DropdownMenuItem>
594
+ <DropdownMenuItem>Option 2</DropdownMenuItem>
595
+ </DropdownMenuContent>
596
+ </DropdownMenu>
597
+ );
598
+ }
599
+
600
+ function SurveyOptionsDemo() {
601
+ return (
602
+ <Field className="max-w-xs">
603
+ <FieldTitle>How did you hear about us?</FieldTitle>
604
+ <FieldDescription>Select the option that best describes how you...</FieldDescription>
605
+ <div className="mt-3 flex flex-wrap gap-2">
606
+ <Button variant="outline" size="sm" className="gap-1.5">
607
+ <Checkbox className="size-4" defaultChecked />
608
+ Social Media
609
+ </Button>
610
+ <Button variant="outline" size="sm">Search Engine</Button>
611
+ <Button variant="outline" size="sm">Referral</Button>
612
+ <Button variant="outline" size="sm">Other</Button>
613
+ </div>
614
+ </Field>
615
+ );
616
+ }
617
+
618
+ function DesignSystemOverview() {
619
+ return (
620
+ <div className="mx-auto max-w-7xl p-6">
621
+ <div className="flex flex-col gap-4 sm:flex-row">
622
+ {/* Column 1 - wider for Payment Method */}
623
+ <div className="flex w-full flex-col gap-4 sm:w-auto sm:min-w-[320px] xl:min-w-[340px]">
624
+ <Tile>
625
+ <PaymentMethodDemo />
626
+ </Tile>
627
+ </div>
628
+
629
+ {/* Column 2 */}
630
+ <div className="flex flex-1 flex-col gap-4">
631
+ <Tile>
632
+ <EmptyAvatarGroupDemo />
633
+ </Tile>
634
+ <Tile>
635
+ <SpinnerBadgeDemo />
636
+ </Tile>
637
+ <Tile>
638
+ <NotionPromptDemo />
639
+ </Tile>
640
+ <Tile>
641
+ <InputGroupDemo />
642
+ </Tile>
643
+ <Tile>
644
+ <FieldSliderDemo />
645
+ </Tile>
646
+ </div>
647
+
648
+ {/* Column 3 */}
649
+ <div className="hidden flex-1 flex-col gap-4 lg:flex">
650
+ <Tile>
651
+ <UrlBookmarkDemo />
652
+ </Tile>
653
+ <Tile>
654
+ <ItemDemo />
655
+ </Tile>
656
+ <Tile>
657
+ <SourceSelectorDemo />
658
+ </Tile>
659
+ <Tile>
660
+ <AppearanceSettingsDemo />
661
+ </Tile>
662
+ </div>
663
+
664
+ {/* Column 4 */}
665
+ <div className="hidden flex-1 flex-col gap-4 xl:flex">
666
+ <Tile>
667
+ <ButtonGroupDemo />
668
+ </Tile>
669
+ <Tile>
670
+ <FieldCheckboxDemo />
671
+ </Tile>
672
+ <Tile>
673
+ <PaginationDemo />
674
+ </Tile>
675
+ <Tile>
676
+ <CopilotDropdownDemo />
677
+ </Tile>
678
+ <Tile>
679
+ <SurveyOptionsDemo />
680
+ </Tile>
681
+ <Tile>
682
+ <SpinnerEmptyDemo />
683
+ </Tile>
684
+ </div>
685
+ </div>
686
+
687
+ {/* Overflow for column 3 on small/medium screens */}
688
+ <div className="mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:hidden">
689
+ <Tile>
690
+ <UrlBookmarkDemo />
691
+ </Tile>
692
+ <Tile>
693
+ <ItemDemo />
694
+ </Tile>
695
+ <Tile>
696
+ <SourceSelectorDemo />
697
+ </Tile>
698
+ <Tile>
699
+ <AppearanceSettingsDemo />
700
+ </Tile>
701
+ </div>
702
+
703
+ {/* Overflow for column 4 on medium/large screens */}
704
+ <div className="mt-4 grid grid-cols-2 gap-4 lg:grid-cols-3 xl:hidden">
705
+ <Tile>
706
+ <ButtonGroupDemo />
707
+ </Tile>
708
+ <Tile>
709
+ <FieldCheckboxDemo />
710
+ </Tile>
711
+ <Tile>
712
+ <PaginationDemo />
713
+ </Tile>
714
+ <Tile>
715
+ <CopilotDropdownDemo />
716
+ </Tile>
717
+ <Tile>
718
+ <SurveyOptionsDemo />
719
+ </Tile>
720
+ <Tile>
721
+ <SpinnerEmptyDemo />
722
+ </Tile>
723
+ </div>
724
+ </div>
725
+ );
726
+ }
727
+
728
+ const meta: Meta = {
729
+ title: 'Design System/Overview',
730
+ component: DesignSystemOverview,
731
+ };
732
+ export default meta;
733
+
734
+ type Story = StoryObj;
735
+
736
+ export const Default: Story = {
737
+ render: () => <DesignSystemOverview />,
738
+ };