create-auto-app 1.34.0 → 1.35.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 (157) hide show
  1. package/package.json +2 -2
  2. package/templates/typical/.context/components-db.json +4006 -0
  3. package/templates/typical/.gitignore +1 -1
  4. package/templates/typical/auto.config.ts +85 -80
  5. package/templates/typical/client/.gitignore +0 -4
  6. package/templates/typical/client/.storybook/main.ts +0 -66
  7. package/templates/typical/client/.storybook/manager-head.html +0 -154
  8. package/templates/typical/client/.storybook/manager.ts +0 -164
  9. package/templates/typical/client/.storybook/preview-head.html +0 -31
  10. package/templates/typical/client/.storybook/preview.tsx +0 -120
  11. package/templates/typical/client/codegen.ts +0 -17
  12. package/templates/typical/client/components.json +0 -29
  13. package/templates/typical/client/index.html +0 -12
  14. package/templates/typical/client/package.json +0 -69
  15. package/templates/typical/client/pnpm-lock.yaml +0 -7868
  16. package/templates/typical/client/public/blank.svg +0 -1
  17. package/templates/typical/client/public/mockServiceWorker.js +0 -336
  18. package/templates/typical/client/src/App.tsx +0 -29
  19. package/templates/typical/client/src/components/.gitkeep +0 -0
  20. package/templates/typical/client/src/components/ui/Accordion.stories.tsx +0 -49
  21. package/templates/typical/client/src/components/ui/Accordion.tsx +0 -55
  22. package/templates/typical/client/src/components/ui/Alert.stories.tsx +0 -29
  23. package/templates/typical/client/src/components/ui/Alert.tsx +0 -56
  24. package/templates/typical/client/src/components/ui/AlertDialog.stories.tsx +0 -67
  25. package/templates/typical/client/src/components/ui/AlertDialog.tsx +0 -178
  26. package/templates/typical/client/src/components/ui/AspectRatio.stories.tsx +0 -35
  27. package/templates/typical/client/src/components/ui/AspectRatio.tsx +0 -13
  28. package/templates/typical/client/src/components/ui/Avatar.stories.tsx +0 -45
  29. package/templates/typical/client/src/components/ui/Avatar.tsx +0 -98
  30. package/templates/typical/client/src/components/ui/Badge.stories.tsx +0 -41
  31. package/templates/typical/client/src/components/ui/Badge.tsx +0 -45
  32. package/templates/typical/client/src/components/ui/Breadcrumb.stories.tsx +0 -54
  33. package/templates/typical/client/src/components/ui/Breadcrumb.tsx +0 -104
  34. package/templates/typical/client/src/components/ui/Button.stories.tsx +0 -102
  35. package/templates/typical/client/src/components/ui/Button.tsx +0 -67
  36. package/templates/typical/client/src/components/ui/ButtonGroup.stories.tsx +0 -32
  37. package/templates/typical/client/src/components/ui/ButtonGroup.tsx +0 -81
  38. package/templates/typical/client/src/components/ui/Calendar.stories.tsx +0 -40
  39. package/templates/typical/client/src/components/ui/Calendar.tsx +0 -165
  40. package/templates/typical/client/src/components/ui/Card.stories.tsx +0 -44
  41. package/templates/typical/client/src/components/ui/Card.tsx +0 -66
  42. package/templates/typical/client/src/components/ui/Carousel.stories.tsx +0 -56
  43. package/templates/typical/client/src/components/ui/Carousel.tsx +0 -225
  44. package/templates/typical/client/src/components/ui/Chart.stories.tsx +0 -39
  45. package/templates/typical/client/src/components/ui/Chart.tsx +0 -305
  46. package/templates/typical/client/src/components/ui/Checkbox.stories.tsx +0 -35
  47. package/templates/typical/client/src/components/ui/Checkbox.tsx +0 -30
  48. package/templates/typical/client/src/components/ui/Collapsible.stories.tsx +0 -58
  49. package/templates/typical/client/src/components/ui/Collapsible.tsx +0 -18
  50. package/templates/typical/client/src/components/ui/Combobox.stories.tsx +0 -75
  51. package/templates/typical/client/src/components/ui/Combobox.tsx +0 -296
  52. package/templates/typical/client/src/components/ui/Command.stories.tsx +0 -71
  53. package/templates/typical/client/src/components/ui/Command.tsx +0 -157
  54. package/templates/typical/client/src/components/ui/ContextMenu.stories.tsx +0 -68
  55. package/templates/typical/client/src/components/ui/ContextMenu.tsx +0 -231
  56. package/templates/typical/client/src/components/ui/DesignSystem-Colors.mdx +0 -68
  57. package/templates/typical/client/src/components/ui/DesignSystem-Colors.stories.tsx +0 -117
  58. package/templates/typical/client/src/components/ui/DesignSystem-Layout.mdx +0 -64
  59. package/templates/typical/client/src/components/ui/DesignSystem-Layout.stories.tsx +0 -167
  60. package/templates/typical/client/src/components/ui/DesignSystem-Overview.stories.tsx +0 -748
  61. package/templates/typical/client/src/components/ui/DesignSystem-Typography.mdx +0 -31
  62. package/templates/typical/client/src/components/ui/DesignSystem-Typography.stories.tsx +0 -80
  63. package/templates/typical/client/src/components/ui/Dialog.stories.tsx +0 -74
  64. package/templates/typical/client/src/components/ui/Dialog.tsx +0 -154
  65. package/templates/typical/client/src/components/ui/Direction.stories.tsx +0 -38
  66. package/templates/typical/client/src/components/ui/Direction.tsx +0 -24
  67. package/templates/typical/client/src/components/ui/Drawer.stories.tsx +0 -70
  68. package/templates/typical/client/src/components/ui/Drawer.tsx +0 -124
  69. package/templates/typical/client/src/components/ui/DropdownMenu.stories.tsx +0 -74
  70. package/templates/typical/client/src/components/ui/DropdownMenu.tsx +0 -239
  71. package/templates/typical/client/src/components/ui/Empty.stories.tsx +0 -37
  72. package/templates/typical/client/src/components/ui/Empty.tsx +0 -98
  73. package/templates/typical/client/src/components/ui/Field.stories.tsx +0 -50
  74. package/templates/typical/client/src/components/ui/Field.tsx +0 -251
  75. package/templates/typical/client/src/components/ui/Form.stories.tsx +0 -45
  76. package/templates/typical/client/src/components/ui/Form.tsx +0 -148
  77. package/templates/typical/client/src/components/ui/HoverCard.stories.tsx +0 -49
  78. package/templates/typical/client/src/components/ui/HoverCard.tsx +0 -39
  79. package/templates/typical/client/src/components/ui/Input.stories.tsx +0 -42
  80. package/templates/typical/client/src/components/ui/Input.tsx +0 -22
  81. package/templates/typical/client/src/components/ui/InputGroup.stories.tsx +0 -53
  82. package/templates/typical/client/src/components/ui/InputGroup.tsx +0 -153
  83. package/templates/typical/client/src/components/ui/InputOTP.stories.tsx +0 -42
  84. package/templates/typical/client/src/components/ui/InputOTP.tsx +0 -72
  85. package/templates/typical/client/src/components/ui/Item.stories.tsx +0 -64
  86. package/templates/typical/client/src/components/ui/Item.tsx +0 -168
  87. package/templates/typical/client/src/components/ui/Kbd.stories.tsx +0 -59
  88. package/templates/typical/client/src/components/ui/Kbd.tsx +0 -22
  89. package/templates/typical/client/src/components/ui/Label.stories.tsx +0 -90
  90. package/templates/typical/client/src/components/ui/Label.tsx +0 -44
  91. package/templates/typical/client/src/components/ui/Menubar.stories.tsx +0 -78
  92. package/templates/typical/client/src/components/ui/Menubar.tsx +0 -251
  93. package/templates/typical/client/src/components/ui/NativeSelect.stories.tsx +0 -45
  94. package/templates/typical/client/src/components/ui/NativeSelect.tsx +0 -50
  95. package/templates/typical/client/src/components/ui/NavigationMenu.stories.tsx +0 -80
  96. package/templates/typical/client/src/components/ui/NavigationMenu.tsx +0 -152
  97. package/templates/typical/client/src/components/ui/Pagination.stories.tsx +0 -77
  98. package/templates/typical/client/src/components/ui/Pagination.tsx +0 -108
  99. package/templates/typical/client/src/components/ui/Popover.stories.tsx +0 -53
  100. package/templates/typical/client/src/components/ui/Popover.tsx +0 -57
  101. package/templates/typical/client/src/components/ui/Progress.stories.tsx +0 -32
  102. package/templates/typical/client/src/components/ui/Progress.tsx +0 -25
  103. package/templates/typical/client/src/components/ui/RadioGroup.stories.tsx +0 -50
  104. package/templates/typical/client/src/components/ui/RadioGroup.tsx +0 -36
  105. package/templates/typical/client/src/components/ui/Resizable.stories.tsx +0 -72
  106. package/templates/typical/client/src/components/ui/Resizable.tsx +0 -54
  107. package/templates/typical/client/src/components/ui/ScrollArea.stories.tsx +0 -45
  108. package/templates/typical/client/src/components/ui/ScrollArea.tsx +0 -51
  109. package/templates/typical/client/src/components/ui/Select.stories.tsx +0 -59
  110. package/templates/typical/client/src/components/ui/Select.tsx +0 -171
  111. package/templates/typical/client/src/components/ui/Separator.stories.tsx +0 -42
  112. package/templates/typical/client/src/components/ui/Separator.tsx +0 -27
  113. package/templates/typical/client/src/components/ui/Sheet.stories.tsx +0 -68
  114. package/templates/typical/client/src/components/ui/Sheet.tsx +0 -115
  115. package/templates/typical/client/src/components/ui/Sidebar.stories.tsx +0 -96
  116. package/templates/typical/client/src/components/ui/Sidebar.tsx +0 -695
  117. package/templates/typical/client/src/components/ui/Skeleton.stories.tsx +0 -40
  118. package/templates/typical/client/src/components/ui/Skeleton.tsx +0 -11
  119. package/templates/typical/client/src/components/ui/Slider.stories.tsx +0 -24
  120. package/templates/typical/client/src/components/ui/Slider.tsx +0 -55
  121. package/templates/typical/client/src/components/ui/Sonner.stories.tsx +0 -45
  122. package/templates/typical/client/src/components/ui/Sonner.tsx +0 -38
  123. package/templates/typical/client/src/components/ui/Spinner.stories.tsx +0 -26
  124. package/templates/typical/client/src/components/ui/Spinner.tsx +0 -13
  125. package/templates/typical/client/src/components/ui/Switch.stories.tsx +0 -39
  126. package/templates/typical/client/src/components/ui/Switch.tsx +0 -35
  127. package/templates/typical/client/src/components/ui/Table.stories.tsx +0 -67
  128. package/templates/typical/client/src/components/ui/Table.tsx +0 -86
  129. package/templates/typical/client/src/components/ui/Tabs.stories.tsx +0 -53
  130. package/templates/typical/client/src/components/ui/Tabs.tsx +0 -75
  131. package/templates/typical/client/src/components/ui/Textarea.stories.tsx +0 -27
  132. package/templates/typical/client/src/components/ui/Textarea.tsx +0 -22
  133. package/templates/typical/client/src/components/ui/Toast.stories.tsx +0 -116
  134. package/templates/typical/client/src/components/ui/Toast.tsx +0 -123
  135. package/templates/typical/client/src/components/ui/Toaster.tsx +0 -32
  136. package/templates/typical/client/src/components/ui/Toggle.stories.tsx +0 -44
  137. package/templates/typical/client/src/components/ui/Toggle.tsx +0 -42
  138. package/templates/typical/client/src/components/ui/ToggleGroup.stories.tsx +0 -61
  139. package/templates/typical/client/src/components/ui/ToggleGroup.tsx +0 -83
  140. package/templates/typical/client/src/components/ui/Tooltip.stories.tsx +0 -42
  141. package/templates/typical/client/src/components/ui/Tooltip.tsx +0 -48
  142. package/templates/typical/client/src/gql/execute.ts +0 -11
  143. package/templates/typical/client/src/gql/fragment-masking.ts +0 -83
  144. package/templates/typical/client/src/gql/gql.ts +0 -9
  145. package/templates/typical/client/src/gql/graphql.ts +0 -182
  146. package/templates/typical/client/src/gql/index.ts +0 -2
  147. package/templates/typical/client/src/graphql/mutations.ts +0 -0
  148. package/templates/typical/client/src/graphql/queries.ts +0 -0
  149. package/templates/typical/client/src/hooks/.gitkeep +0 -0
  150. package/templates/typical/client/src/hooks/use-mobile.ts +0 -19
  151. package/templates/typical/client/src/hooks/use-toast.ts +0 -186
  152. package/templates/typical/client/src/index.css +0 -121
  153. package/templates/typical/client/src/lib/utils.ts +0 -6
  154. package/templates/typical/client/src/main.tsx +0 -5
  155. package/templates/typical/client/tsconfig.app.json +0 -26
  156. package/templates/typical/client/tsconfig.json +0 -10
  157. package/templates/typical/client/vite.config.ts +0 -50
@@ -1,748 +0,0 @@
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-4 gap-4">
97
- <Field className="col-span-3">
98
- <FieldLabel htmlFor="card-number">Card Number</FieldLabel>
99
- <Input id="card-number" placeholder="1234 5678 9012 3456" />
100
- </Field>
101
- <Field className="col-span-1">
102
- <FieldLabel htmlFor="cvv">CVV</FieldLabel>
103
- <Input id="cvv" placeholder="123" />
104
- </Field>
105
- </div>
106
- <FieldDescription className="-mt-2">Enter your 16-digit number.</FieldDescription>
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>
185
- <Avatar>
186
- <AvatarImage src="https://randomuser.me/api/portraits/women/44.jpg" alt="Sarah" />
187
- <AvatarFallback>SA</AvatarFallback>
188
- </Avatar>
189
- <Avatar>
190
- <AvatarImage src="https://randomuser.me/api/portraits/men/32.jpg" alt="James" />
191
- <AvatarFallback>JA</AvatarFallback>
192
- </Avatar>
193
- <Avatar>
194
- <AvatarImage src="https://randomuser.me/api/portraits/women/68.jpg" alt="Maya" />
195
- <AvatarFallback>MA</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-6 gap-0.5 px-1.5 text-[10px]">
514
- <PlusIcon className="size-2.5" />
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
- <svg className="size-4 text-muted-foreground" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true">
547
- <circle cx="12" cy="12" r="10" />
548
- <path d="M2 12h20" />
549
- <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" />
550
- </svg>
551
- </InputGroupAddon>
552
- <InputGroupInput placeholder="https://" />
553
- <InputGroupAddon align="inline-end">
554
- <Button variant="ghost" size="sm" className="size-6 p-0">
555
- <svg className="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true">
556
- <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" />
557
- </svg>
558
- </Button>
559
- </InputGroupAddon>
560
- </InputGroup>
561
- );
562
- }
563
-
564
- function PaginationDemo() {
565
- return (
566
- <div className="flex items-center gap-2">
567
- <ButtonGroup>
568
- <Button variant="outline" size="sm" className="size-8 p-0">1</Button>
569
- <Button variant="outline" size="sm" className="size-8 p-0">2</Button>
570
- <Button variant="outline" size="sm" className="size-8 p-0">3</Button>
571
- </ButtonGroup>
572
- <ButtonGroup>
573
- <Button variant="outline" size="sm" className="size-8 p-0">
574
- <ArrowLeftIcon className="size-4" />
575
- </Button>
576
- <Button variant="outline" size="sm" className="size-8 p-0">
577
- <ChevronRightIcon className="size-4" />
578
- </Button>
579
- </ButtonGroup>
580
- </div>
581
- );
582
- }
583
-
584
- function CopilotDropdownDemo() {
585
- return (
586
- <DropdownMenu>
587
- <DropdownMenuTrigger asChild>
588
- <Button variant="outline" size="sm" className="gap-1.5">
589
- <svg className="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true">
590
- <rect x="3" y="3" width="18" height="18" rx="2" />
591
- <path d="M3 9h18" />
592
- </svg>
593
- Copilot
594
- </Button>
595
- </DropdownMenuTrigger>
596
- <DropdownMenuContent align="end">
597
- <DropdownMenuItem>Option 1</DropdownMenuItem>
598
- <DropdownMenuItem>Option 2</DropdownMenuItem>
599
- </DropdownMenuContent>
600
- </DropdownMenu>
601
- );
602
- }
603
-
604
- function SurveyOptionsDemo() {
605
- return (
606
- <Field className="max-w-xs">
607
- <FieldTitle>How did you hear about us?</FieldTitle>
608
- <FieldDescription>Select the option that best describes how you...</FieldDescription>
609
- <div className="mt-3 flex flex-wrap gap-2">
610
- <div className="inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-input bg-background px-3 py-1.5 text-sm font-medium shadow-xs hover:bg-accent hover:text-accent-foreground">
611
- <Checkbox className="size-4" defaultChecked />
612
- Social Media
613
- </div>
614
- <Button variant="outline" size="sm">Search Engine</Button>
615
- <Button variant="outline" size="sm">Referral</Button>
616
- <Button variant="outline" size="sm">Other</Button>
617
- </div>
618
- </Field>
619
- );
620
- }
621
-
622
- function DesignSystemOverview() {
623
- return (
624
- <div className="mx-auto max-w-7xl p-6">
625
- <header className="mb-10 text-center">
626
- <h1 className="text-3xl font-bold tracking-tight">Design System</h1>
627
- <p className="mt-2 text-muted-foreground">Reusable components that power your UI — explore the sidebar to see each in detail</p>
628
- <p className="mt-2 text-s italic text-muted-foreground/70">Bring your own design system — coming soon!</p>
629
- </header>
630
- <div className="flex flex-col gap-4 sm:flex-row sm:items-start">
631
- {/* Column 1 - Payment Method needs more space */}
632
- <div className="flex flex-[1.3] flex-col gap-4">
633
- <Tile>
634
- <PaymentMethodDemo />
635
- </Tile>
636
- <Tile>
637
- <SourceSelectorDemo />
638
- </Tile>
639
- <Tile>
640
- <CopilotDropdownDemo />
641
- </Tile>
642
- </div>
643
-
644
- {/* Column 2 */}
645
- <div className="flex flex-1 flex-col gap-4">
646
- <Tile>
647
- <EmptyAvatarGroupDemo />
648
- </Tile>
649
- <Tile>
650
- <InputGroupDemo />
651
- </Tile>
652
- <Tile>
653
- <FieldSliderDemo />
654
- </Tile>
655
- </div>
656
-
657
- {/* Column 3 */}
658
- <div className="hidden flex-1 flex-col gap-4 lg:flex">
659
- <Tile>
660
- <UrlBookmarkDemo />
661
- </Tile>
662
- <Tile>
663
- <ItemDemo />
664
- </Tile>
665
- <Tile>
666
- <SpinnerBadgeDemo />
667
- </Tile>
668
- <Tile>
669
- <AppearanceSettingsDemo />
670
- </Tile>
671
- </div>
672
-
673
- {/* Column 4 */}
674
- <div className="hidden flex-1 flex-col gap-4 2xl:flex">
675
- <Tile>
676
- <ButtonGroupDemo />
677
- </Tile>
678
- <Tile>
679
- <FieldCheckboxDemo />
680
- </Tile>
681
- <Tile>
682
- <NotionPromptDemo />
683
- </Tile>
684
- <Tile>
685
- <PaginationDemo />
686
- </Tile>
687
- <Tile>
688
- <SurveyOptionsDemo />
689
- </Tile>
690
- <Tile>
691
- <SpinnerEmptyDemo />
692
- </Tile>
693
- </div>
694
- </div>
695
-
696
- {/* Overflow for column 3 on small/medium screens */}
697
- <div className="mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:hidden">
698
- <Tile>
699
- <UrlBookmarkDemo />
700
- </Tile>
701
- <Tile>
702
- <ItemDemo />
703
- </Tile>
704
- <Tile>
705
- <SpinnerBadgeDemo />
706
- </Tile>
707
- <Tile>
708
- <AppearanceSettingsDemo />
709
- </Tile>
710
- </div>
711
-
712
- {/* Overflow for column 4 on medium/large screens */}
713
- <div className="mt-4 grid grid-cols-2 gap-4 lg:grid-cols-3 2xl:hidden">
714
- <Tile>
715
- <ButtonGroupDemo />
716
- </Tile>
717
- <Tile>
718
- <FieldCheckboxDemo />
719
- </Tile>
720
- <Tile>
721
- <NotionPromptDemo />
722
- </Tile>
723
- <Tile>
724
- <PaginationDemo />
725
- </Tile>
726
- <Tile>
727
- <SurveyOptionsDemo />
728
- </Tile>
729
- <Tile>
730
- <SpinnerEmptyDemo />
731
- </Tile>
732
- </div>
733
- </div>
734
- );
735
- }
736
-
737
- const meta: Meta = {
738
- title: 'Design System/Overview',
739
- component: DesignSystemOverview,
740
- tags: ['!autodocs', '!manifest'],
741
- };
742
- export default meta;
743
-
744
- type Story = StoryObj;
745
-
746
- export const Default: Story = {
747
- render: () => <DesignSystemOverview />,
748
- };