@dailyautomations/ui 1.1.0 → 1.4.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 (109) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/INSTALLATION.md +238 -0
  3. package/MIGRATION.md +207 -0
  4. package/README.md +67 -38
  5. package/dist/components/common/button.js +6 -6
  6. package/dist/components/common/button.js.map +1 -1
  7. package/dist/components/dev/theme-tester.d.ts +2 -0
  8. package/dist/components/dev/theme-tester.d.ts.map +1 -0
  9. package/dist/components/dev/theme-tester.js +105 -0
  10. package/dist/components/dev/theme-tester.js.map +1 -0
  11. package/dist/components/layout/app-shell.d.ts +14 -0
  12. package/dist/components/layout/app-shell.d.ts.map +1 -0
  13. package/dist/components/layout/app-shell.js +25 -0
  14. package/dist/components/layout/app-shell.js.map +1 -0
  15. package/dist/components/ui/alert-dialog.d.ts +15 -0
  16. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  17. package/dist/components/ui/alert-dialog.js +40 -0
  18. package/dist/components/ui/alert-dialog.js.map +1 -0
  19. package/dist/components/ui/avatar.d.ts +7 -0
  20. package/dist/components/ui/avatar.d.ts.map +1 -0
  21. package/dist/components/ui/avatar.js +15 -0
  22. package/dist/components/ui/avatar.js.map +1 -0
  23. package/dist/components/ui/collapsible.d.ts +7 -0
  24. package/dist/components/ui/collapsible.d.ts.map +1 -0
  25. package/dist/components/ui/collapsible.js +15 -0
  26. package/dist/components/ui/collapsible.js.map +1 -0
  27. package/dist/components/ui/confirm-dialog.d.ts +16 -0
  28. package/dist/components/ui/confirm-dialog.d.ts.map +1 -0
  29. package/dist/components/ui/confirm-dialog.js +31 -0
  30. package/dist/components/ui/confirm-dialog.js.map +1 -0
  31. package/dist/components/ui/dropdown-menu.d.ts +25 -0
  32. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  33. package/dist/components/ui/dropdown-menu.js +51 -0
  34. package/dist/components/ui/dropdown-menu.js.map +1 -0
  35. package/dist/components/ui/empty-state.d.ts +14 -0
  36. package/dist/components/ui/empty-state.d.ts.map +1 -0
  37. package/dist/components/ui/empty-state.js +20 -0
  38. package/dist/components/ui/empty-state.js.map +1 -0
  39. package/dist/components/ui/filter-bar.d.ts +29 -0
  40. package/dist/components/ui/filter-bar.d.ts.map +1 -0
  41. package/dist/components/ui/filter-bar.js +19 -0
  42. package/dist/components/ui/filter-bar.js.map +1 -0
  43. package/dist/components/ui/loading-spinner.d.ts +19 -0
  44. package/dist/components/ui/loading-spinner.d.ts.map +1 -0
  45. package/dist/components/ui/loading-spinner.js +28 -0
  46. package/dist/components/ui/loading-spinner.js.map +1 -0
  47. package/dist/components/ui/popover.d.ts +8 -0
  48. package/dist/components/ui/popover.d.ts.map +1 -0
  49. package/dist/components/ui/popover.js +18 -0
  50. package/dist/components/ui/popover.js.map +1 -0
  51. package/dist/components/ui/progress.d.ts +8 -0
  52. package/dist/components/ui/progress.d.ts.map +1 -0
  53. package/dist/components/ui/progress.js +9 -0
  54. package/dist/components/ui/progress.js.map +1 -0
  55. package/dist/components/ui/radio-group.d.ts +6 -0
  56. package/dist/components/ui/radio-group.d.ts.map +1 -0
  57. package/dist/components/ui/radio-group.js +12 -0
  58. package/dist/components/ui/radio-group.js.map +1 -0
  59. package/dist/components/ui/scroll-area.d.ts +6 -0
  60. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  61. package/dist/components/ui/scroll-area.js +14 -0
  62. package/dist/components/ui/scroll-area.js.map +1 -0
  63. package/dist/components/ui/separator.d.ts +7 -0
  64. package/dist/components/ui/separator.d.ts.map +1 -0
  65. package/dist/components/ui/separator.js +9 -0
  66. package/dist/components/ui/separator.js.map +1 -0
  67. package/dist/components/ui/sheet.d.ts +21 -0
  68. package/dist/components/ui/sheet.d.ts.map +1 -0
  69. package/dist/components/ui/sheet.js +50 -0
  70. package/dist/components/ui/sheet.js.map +1 -0
  71. package/dist/components/ui/slider.d.ts +7 -0
  72. package/dist/components/ui/slider.d.ts.map +1 -0
  73. package/dist/components/ui/slider.js +9 -0
  74. package/dist/components/ui/slider.js.map +1 -0
  75. package/dist/components/ui/stat-card.d.ts +23 -0
  76. package/dist/components/ui/stat-card.d.ts.map +1 -0
  77. package/dist/components/ui/stat-card.js +46 -0
  78. package/dist/components/ui/stat-card.js.map +1 -0
  79. package/dist/components/ui/switch.d.ts +7 -0
  80. package/dist/components/ui/switch.d.ts.map +1 -0
  81. package/dist/components/ui/switch.js +9 -0
  82. package/dist/components/ui/switch.js.map +1 -0
  83. package/dist/components/ui/table.d.ts +11 -0
  84. package/dist/components/ui/table.d.ts.map +1 -0
  85. package/dist/components/ui/table.js +28 -0
  86. package/dist/components/ui/table.js.map +1 -0
  87. package/dist/components/ui/tooltip.d.ts +8 -0
  88. package/dist/components/ui/tooltip.d.ts.map +1 -0
  89. package/dist/components/ui/tooltip.js +18 -0
  90. package/dist/components/ui/tooltip.js.map +1 -0
  91. package/dist/config/themes.d.ts +18 -0
  92. package/dist/config/themes.d.ts.map +1 -0
  93. package/dist/config/themes.js +267 -0
  94. package/dist/config/themes.js.map +1 -0
  95. package/dist/index.d.ts +33 -0
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +22 -0
  98. package/dist/index.js.map +1 -1
  99. package/dist/tokens/tailwind.preset.d.ts.map +1 -1
  100. package/dist/tokens/tailwind.preset.js.map +1 -1
  101. package/examples/home-page.tsx +81 -81
  102. package/examples/main.tsx +24 -9
  103. package/examples/pages/ComponentsPage.tsx +726 -0
  104. package/examples/pages/LandingPage.tsx +860 -0
  105. package/examples/pages/index.ts +2 -0
  106. package/examples/styles.css +215 -0
  107. package/package.json +30 -1
  108. package/src/styles/globals.css +161 -7
  109. package/src/styles/theme.css +89 -0
@@ -0,0 +1,726 @@
1
+ import { useState } from 'react'
2
+ import {
3
+ // Common
4
+ Button,
5
+ Card,
6
+ CardHeader,
7
+ CardTitle,
8
+ CardDescription,
9
+ CardContent,
10
+ CardFooter,
11
+ Input,
12
+ Badge,
13
+ Label,
14
+ Textarea,
15
+ Checkbox,
16
+
17
+ // UI
18
+ Alert,
19
+ AlertTitle,
20
+ AlertDescription,
21
+ Skeleton,
22
+ Tabs,
23
+ TabsList,
24
+ TabsTrigger,
25
+ TabsContent,
26
+ Select,
27
+ SelectTrigger,
28
+ SelectValue,
29
+ SelectContent,
30
+ SelectItem,
31
+ Switch,
32
+ Separator,
33
+ Avatar,
34
+ AvatarImage,
35
+ AvatarFallback,
36
+ Progress,
37
+ Tooltip,
38
+ TooltipTrigger,
39
+ TooltipContent,
40
+ TooltipProvider,
41
+ DropdownMenu,
42
+ DropdownMenuTrigger,
43
+ DropdownMenuContent,
44
+ DropdownMenuItem,
45
+ DropdownMenuSeparator,
46
+ Table,
47
+ TableHeader,
48
+ TableBody,
49
+ TableHead,
50
+ TableRow,
51
+ TableCell,
52
+ RadioGroup,
53
+ RadioGroupItem,
54
+ Slider,
55
+
56
+ // Composite
57
+ EmptyState,
58
+ LoadingSpinner,
59
+ LoadingOverlay,
60
+ StatCard,
61
+ FilterBar,
62
+ FilterSelect,
63
+ FilterChip,
64
+
65
+ // Dialogs
66
+ Dialog,
67
+ DialogTrigger,
68
+ DialogContent,
69
+ DialogHeader,
70
+ DialogTitle,
71
+ DialogDescription,
72
+ DialogFooter,
73
+ ConfirmDialog,
74
+ AlertDialog,
75
+ AlertDialogTrigger,
76
+ AlertDialogContent,
77
+ AlertDialogHeader,
78
+ AlertDialogTitle,
79
+ AlertDialogDescription,
80
+ AlertDialogFooter,
81
+ AlertDialogAction,
82
+ AlertDialogCancel,
83
+ Sheet,
84
+ SheetTrigger,
85
+ SheetContent,
86
+ SheetHeader,
87
+ SheetTitle,
88
+ SheetDescription,
89
+ Popover,
90
+ PopoverTrigger,
91
+ PopoverContent,
92
+ Collapsible,
93
+ CollapsibleTrigger,
94
+ CollapsibleContent,
95
+ } from '../../src'
96
+
97
+ function Section({ title, children }: { title: string; children: React.ReactNode }) {
98
+ return (
99
+ <div className="mb-12">
100
+ <h2 className="text-2xl font-bold text-foreground mb-6 pb-2 border-b border-border">
101
+ {title}
102
+ </h2>
103
+ <div className="space-y-6">
104
+ {children}
105
+ </div>
106
+ </div>
107
+ )
108
+ }
109
+
110
+ function ComponentCard({ title, description, children }: { title: string; description?: string; children: React.ReactNode }) {
111
+ return (
112
+ <Card>
113
+ <CardHeader className="pb-3">
114
+ <CardTitle className="text-lg">{title}</CardTitle>
115
+ {description && <CardDescription>{description}</CardDescription>}
116
+ </CardHeader>
117
+ <CardContent>
118
+ {children}
119
+ </CardContent>
120
+ </Card>
121
+ )
122
+ }
123
+
124
+ export function ComponentsPage() {
125
+ const [switchChecked, setSwitchChecked] = useState(false)
126
+ const [checkboxChecked, setCheckboxChecked] = useState(false)
127
+ const [sliderValue, setSliderValue] = useState([50])
128
+ const [progressValue, setProgressValue] = useState(65)
129
+ const [confirmOpen, setConfirmOpen] = useState(false)
130
+ const [isCollapsibleOpen, setIsCollapsibleOpen] = useState(false)
131
+ const [selectedFilter, setSelectedFilter] = useState('')
132
+ const [activeFilters, setActiveFilters] = useState<string[]>(['React', 'TypeScript'])
133
+ const [cardSwitchOn, setCardSwitchOn] = useState(false)
134
+ const [dialogOpen, setDialogOpen] = useState(false)
135
+
136
+ return (
137
+ <TooltipProvider>
138
+ <div className="min-h-screen bg-background">
139
+ {/* Header */}
140
+ <div className="bg-card border-b border-border">
141
+ <div className="max-w-7xl mx-auto px-6 py-12">
142
+ <Badge className="mb-4 bg-primary/10 text-primary border-primary/30">
143
+ Component Library
144
+ </Badge>
145
+ <h1 className="text-4xl font-bold text-foreground mb-4">
146
+ @dailyautomations/ui
147
+ </h1>
148
+ <p className="text-xl text-muted-foreground max-w-2xl">
149
+ A comprehensive collection of React components built with Radix UI primitives,
150
+ styled with Tailwind CSS, and themed for the Daily ecosystem.
151
+ </p>
152
+ </div>
153
+ </div>
154
+
155
+ {/* Content */}
156
+ <div className="max-w-7xl mx-auto px-6 py-12">
157
+
158
+ {/* Buttons */}
159
+ <Section title="Buttons">
160
+ <ComponentCard title="Button Variants" description="Different button styles for various contexts">
161
+ <div className="flex flex-wrap gap-3">
162
+ <Button>Default (Accent)</Button>
163
+ <Button variant="secondary">Secondary (Primary)</Button>
164
+ <Button variant="outline">Outline</Button>
165
+ <Button variant="ghost">Ghost</Button>
166
+ <Button variant="destructive">Destructive</Button>
167
+ <Button variant="link">Link</Button>
168
+ </div>
169
+ </ComponentCard>
170
+
171
+ <ComponentCard title="Button Sizes">
172
+ <div className="flex flex-wrap items-center gap-3">
173
+ <Button size="sm">Small</Button>
174
+ <Button size="default">Default</Button>
175
+ <Button size="lg">Large</Button>
176
+ <Button size="icon">
177
+ <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
178
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
179
+ </svg>
180
+ </Button>
181
+ </div>
182
+ </ComponentCard>
183
+
184
+ <ComponentCard title="Button States">
185
+ <div className="flex flex-wrap gap-3">
186
+ <Button disabled>Disabled</Button>
187
+ <Button loading>Loading</Button>
188
+ </div>
189
+ </ComponentCard>
190
+ </Section>
191
+
192
+ {/* Form Inputs */}
193
+ <Section title="Form Inputs">
194
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
195
+ <ComponentCard title="Input">
196
+ <div className="space-y-4">
197
+ <div>
198
+ <Label htmlFor="email">Email</Label>
199
+ <Input id="email" type="email" placeholder="you@example.com" className="mt-1.5" />
200
+ </div>
201
+ <div>
202
+ <Label htmlFor="disabled">Disabled</Label>
203
+ <Input id="disabled" disabled placeholder="Disabled input" className="mt-1.5" />
204
+ </div>
205
+ </div>
206
+ </ComponentCard>
207
+
208
+ <ComponentCard title="Textarea">
209
+ <div>
210
+ <Label htmlFor="message">Message</Label>
211
+ <Textarea id="message" placeholder="Type your message..." className="mt-1.5" rows={3} />
212
+ </div>
213
+ </ComponentCard>
214
+
215
+ <ComponentCard title="Select">
216
+ <div>
217
+ <Label>Choose an option</Label>
218
+ <Select>
219
+ <SelectTrigger className="mt-1.5">
220
+ <SelectValue placeholder="Select..." />
221
+ </SelectTrigger>
222
+ <SelectContent>
223
+ <SelectItem value="option1">Option 1</SelectItem>
224
+ <SelectItem value="option2">Option 2</SelectItem>
225
+ <SelectItem value="option3">Option 3</SelectItem>
226
+ </SelectContent>
227
+ </Select>
228
+ </div>
229
+ </ComponentCard>
230
+
231
+ <ComponentCard title="Checkbox & Switch">
232
+ <div className="space-y-4">
233
+ <div className="flex items-center gap-2">
234
+ <Checkbox
235
+ id="terms"
236
+ checked={checkboxChecked}
237
+ onCheckedChange={(checked) => setCheckboxChecked(checked as boolean)}
238
+ />
239
+ <Label htmlFor="terms">Accept terms and conditions</Label>
240
+ </div>
241
+ <div className="flex items-center gap-2">
242
+ <Switch
243
+ id="notifications"
244
+ checked={switchChecked}
245
+ onCheckedChange={setSwitchChecked}
246
+ />
247
+ <Label htmlFor="notifications">Enable notifications</Label>
248
+ </div>
249
+ </div>
250
+ </ComponentCard>
251
+
252
+ <ComponentCard title="Radio Group">
253
+ <RadioGroup defaultValue="option1">
254
+ <div className="flex items-center gap-2">
255
+ <RadioGroupItem value="option1" id="r1" />
256
+ <Label htmlFor="r1">Option 1</Label>
257
+ </div>
258
+ <div className="flex items-center gap-2">
259
+ <RadioGroupItem value="option2" id="r2" />
260
+ <Label htmlFor="r2">Option 2</Label>
261
+ </div>
262
+ <div className="flex items-center gap-2">
263
+ <RadioGroupItem value="option3" id="r3" />
264
+ <Label htmlFor="r3">Option 3</Label>
265
+ </div>
266
+ </RadioGroup>
267
+ </ComponentCard>
268
+
269
+ <ComponentCard title="Slider">
270
+ <div className="space-y-4">
271
+ <Label>Volume: {sliderValue[0]}%</Label>
272
+ <div className="border border-border rounded-lg p-4">
273
+ <Slider
274
+ value={sliderValue}
275
+ onValueChange={setSliderValue}
276
+ max={100}
277
+ step={1}
278
+ />
279
+ </div>
280
+ </div>
281
+ </ComponentCard>
282
+ </div>
283
+ </Section>
284
+
285
+ {/* Data Display */}
286
+ <Section title="Data Display">
287
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
288
+ <ComponentCard title="Badges">
289
+ <div className="flex flex-wrap gap-2">
290
+ <Badge>Default</Badge>
291
+ <Badge variant="secondary">Secondary</Badge>
292
+ <Badge variant="outline">Outline</Badge>
293
+ <Badge variant="destructive">Destructive</Badge>
294
+ </div>
295
+ </ComponentCard>
296
+
297
+ <ComponentCard title="Avatar">
298
+ <div className="flex items-center gap-3">
299
+ <Avatar>
300
+ <AvatarImage src="https://github.com/shadcn.png" alt="User" />
301
+ <AvatarFallback>CN</AvatarFallback>
302
+ </Avatar>
303
+ <Avatar>
304
+ <AvatarFallback>JD</AvatarFallback>
305
+ </Avatar>
306
+ <Avatar>
307
+ <AvatarFallback className="bg-primary text-white">AB</AvatarFallback>
308
+ </Avatar>
309
+ </div>
310
+ </ComponentCard>
311
+
312
+ <ComponentCard title="Progress">
313
+ <div className="space-y-4">
314
+ <Progress value={progressValue} />
315
+ <div className="flex gap-2">
316
+ <Button size="sm" variant="outline" onClick={() => setProgressValue(Math.max(0, progressValue - 10))}>
317
+ -10
318
+ </Button>
319
+ <Button size="sm" variant="outline" onClick={() => setProgressValue(Math.min(100, progressValue + 10))}>
320
+ +10
321
+ </Button>
322
+ </div>
323
+ </div>
324
+ </ComponentCard>
325
+
326
+ <ComponentCard title="Skeleton">
327
+ <div className="space-y-3">
328
+ <div className="flex items-center gap-3">
329
+ <Skeleton className="w-10 h-10 rounded-full" />
330
+ <div className="space-y-2">
331
+ <Skeleton className="h-4 w-32" />
332
+ <Skeleton className="h-3 w-24" />
333
+ </div>
334
+ </div>
335
+ </div>
336
+ </ComponentCard>
337
+
338
+ <ComponentCard title="Tooltip">
339
+ <div className="flex gap-3">
340
+ <Tooltip>
341
+ <TooltipTrigger asChild>
342
+ <Button variant="outline">Hover me</Button>
343
+ </TooltipTrigger>
344
+ <TooltipContent>
345
+ <p>This is a tooltip</p>
346
+ </TooltipContent>
347
+ </Tooltip>
348
+ </div>
349
+ </ComponentCard>
350
+
351
+ <ComponentCard title="Separator">
352
+ <div className="space-y-3">
353
+ <p className="text-sm text-muted-foreground">Content above</p>
354
+ <Separator />
355
+ <p className="text-sm text-muted-foreground">Content below</p>
356
+ </div>
357
+ </ComponentCard>
358
+ </div>
359
+ </Section>
360
+
361
+ {/* Stat Cards */}
362
+ <Section title="Stat Cards">
363
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
364
+ <StatCard
365
+ title="Total Revenue"
366
+ value="$45,231.89"
367
+ trend="up"
368
+ trendValue="+20.1%"
369
+ subtitle="from last month"
370
+ />
371
+ <StatCard
372
+ title="Subscriptions"
373
+ value="+2,350"
374
+ trend="up"
375
+ trendValue="+180.1%"
376
+ subtitle="from last month"
377
+ />
378
+ <StatCard
379
+ title="Active Users"
380
+ value="+12,234"
381
+ trend="down"
382
+ trendValue="-5.2%"
383
+ subtitle="from last month"
384
+ />
385
+ <StatCard
386
+ title="Bounce Rate"
387
+ value="24.5%"
388
+ trend="neutral"
389
+ trendValue="+0.0%"
390
+ subtitle="no change"
391
+ />
392
+ </div>
393
+ </Section>
394
+
395
+ {/* Filter Bar */}
396
+ <Section title="Filter Bar">
397
+ <ComponentCard title="Filter Components" description="Select a tag to add it as a filter chip, click X to remove">
398
+ <FilterBar>
399
+ <FilterSelect
400
+ value={selectedFilter}
401
+ onValueChange={(value) => {
402
+ if (value && !activeFilters.includes(value)) {
403
+ setActiveFilters([...activeFilters, value])
404
+ }
405
+ setSelectedFilter('')
406
+ }}
407
+ placeholder="Add filter..."
408
+ options={[
409
+ { label: 'React', value: 'React' },
410
+ { label: 'TypeScript', value: 'TypeScript' },
411
+ { label: 'Tailwind', value: 'Tailwind' },
412
+ { label: 'Node.js', value: 'Node.js' },
413
+ { label: 'GraphQL', value: 'GraphQL' },
414
+ { label: 'Prisma', value: 'Prisma' },
415
+ ].filter(opt => !activeFilters.includes(opt.value))}
416
+ />
417
+ <div className="flex flex-wrap gap-2">
418
+ {activeFilters.map((filter) => (
419
+ <FilterChip
420
+ key={filter}
421
+ label={filter}
422
+ onRemove={() => setActiveFilters(activeFilters.filter(f => f !== filter))}
423
+ />
424
+ ))}
425
+ {activeFilters.length > 0 && (
426
+ <Button
427
+ variant="ghost"
428
+ size="sm"
429
+ className="h-7 text-xs text-muted-foreground hover:text-foreground"
430
+ onClick={() => setActiveFilters([])}
431
+ >
432
+ Clear all
433
+ </Button>
434
+ )}
435
+ </div>
436
+ </FilterBar>
437
+ </ComponentCard>
438
+ </Section>
439
+
440
+ {/* Alerts */}
441
+ <Section title="Alerts & Feedback">
442
+ <div className="space-y-4">
443
+ <Alert>
444
+ <AlertTitle>Default Alert</AlertTitle>
445
+ <AlertDescription>This is a default alert with some information.</AlertDescription>
446
+ </Alert>
447
+ <Alert variant="destructive">
448
+ <AlertTitle>Error Alert</AlertTitle>
449
+ <AlertDescription>Something went wrong. Please try again.</AlertDescription>
450
+ </Alert>
451
+ </div>
452
+
453
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6">
454
+ <ComponentCard title="Loading Spinner">
455
+ <div className="flex items-center gap-6">
456
+ <LoadingSpinner size="sm" />
457
+ <LoadingSpinner size="md" />
458
+ <LoadingSpinner size="lg" />
459
+ </div>
460
+ </ComponentCard>
461
+
462
+ <ComponentCard title="Empty State">
463
+ <EmptyState
464
+ icon={
465
+ <svg className="w-12 h-12" fill="none" stroke="currentColor" viewBox="0 0 24 24">
466
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4" />
467
+ </svg>
468
+ }
469
+ title="No items found"
470
+ description="Get started by creating your first item."
471
+ action={<Button size="sm">Create Item</Button>}
472
+ />
473
+ </ComponentCard>
474
+ </div>
475
+ </Section>
476
+
477
+ {/* Tables */}
478
+ <Section title="Tables">
479
+ <ComponentCard title="Data Table">
480
+ <Table>
481
+ <TableHeader>
482
+ <TableRow>
483
+ <TableHead>Name</TableHead>
484
+ <TableHead>Email</TableHead>
485
+ <TableHead>Status</TableHead>
486
+ <TableHead className="text-right">Amount</TableHead>
487
+ </TableRow>
488
+ </TableHeader>
489
+ <TableBody>
490
+ <TableRow>
491
+ <TableCell className="font-medium">John Doe</TableCell>
492
+ <TableCell>john@example.com</TableCell>
493
+ <TableCell><Badge variant="outline">Active</Badge></TableCell>
494
+ <TableCell className="text-right">$250.00</TableCell>
495
+ </TableRow>
496
+ <TableRow>
497
+ <TableCell className="font-medium">Jane Smith</TableCell>
498
+ <TableCell>jane@example.com</TableCell>
499
+ <TableCell><Badge variant="secondary">Pending</Badge></TableCell>
500
+ <TableCell className="text-right">$150.00</TableCell>
501
+ </TableRow>
502
+ <TableRow>
503
+ <TableCell className="font-medium">Bob Johnson</TableCell>
504
+ <TableCell>bob@example.com</TableCell>
505
+ <TableCell><Badge variant="destructive">Inactive</Badge></TableCell>
506
+ <TableCell className="text-right">$350.00</TableCell>
507
+ </TableRow>
508
+ </TableBody>
509
+ </Table>
510
+ </ComponentCard>
511
+ </Section>
512
+
513
+ {/* Tabs */}
514
+ <Section title="Tabs">
515
+ <ComponentCard title="Tab Navigation">
516
+ <Tabs defaultValue="account">
517
+ <TabsList>
518
+ <TabsTrigger value="account">Account</TabsTrigger>
519
+ <TabsTrigger value="password">Password</TabsTrigger>
520
+ <TabsTrigger value="settings">Settings</TabsTrigger>
521
+ </TabsList>
522
+ <TabsContent value="account" className="mt-4">
523
+ <p className="text-muted-foreground">Manage your account settings and preferences.</p>
524
+ </TabsContent>
525
+ <TabsContent value="password" className="mt-4">
526
+ <p className="text-muted-foreground">Change your password and security settings.</p>
527
+ </TabsContent>
528
+ <TabsContent value="settings" className="mt-4">
529
+ <p className="text-muted-foreground">Configure your application settings.</p>
530
+ </TabsContent>
531
+ </Tabs>
532
+ </ComponentCard>
533
+ </Section>
534
+
535
+ {/* Collapsible */}
536
+ <Section title="Collapsible">
537
+ <ComponentCard title="Expandable Content">
538
+ <Collapsible open={isCollapsibleOpen} onOpenChange={setIsCollapsibleOpen}>
539
+ <div className="flex items-center justify-between">
540
+ <h4 className="text-sm font-semibold">Click to expand</h4>
541
+ <CollapsibleTrigger asChild>
542
+ <Button variant="ghost" size="sm">
543
+ {isCollapsibleOpen ? 'Collapse' : 'Expand'}
544
+ </Button>
545
+ </CollapsibleTrigger>
546
+ </div>
547
+ <CollapsibleContent className="mt-4">
548
+ <div className="rounded-md border border-border px-4 py-3 text-sm text-muted-foreground">
549
+ This content can be collapsed and expanded. Great for FAQs, settings panels, and more.
550
+ </div>
551
+ </CollapsibleContent>
552
+ </Collapsible>
553
+ </ComponentCard>
554
+ </Section>
555
+
556
+ {/* Dialogs & Overlays */}
557
+ <Section title="Dialogs & Overlays">
558
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
559
+ <ComponentCard title="Dialog">
560
+ <Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
561
+ <DialogTrigger asChild>
562
+ <Button variant="outline">Open Dialog</Button>
563
+ </DialogTrigger>
564
+ <DialogContent>
565
+ <DialogHeader>
566
+ <DialogTitle>Dialog Title</DialogTitle>
567
+ <DialogDescription>
568
+ This is a dialog component with header, content, and footer sections.
569
+ </DialogDescription>
570
+ </DialogHeader>
571
+ <div className="py-4">
572
+ <p className="text-muted-foreground">Dialog content goes here.</p>
573
+ </div>
574
+ <DialogFooter>
575
+ <Button variant="outline" onClick={() => setDialogOpen(false)}>Cancel</Button>
576
+ <Button onClick={() => { console.log('Confirmed!'); setDialogOpen(false); }}>Confirm</Button>
577
+ </DialogFooter>
578
+ </DialogContent>
579
+ </Dialog>
580
+ </ComponentCard>
581
+
582
+ <ComponentCard title="Alert Dialog">
583
+ <AlertDialog>
584
+ <AlertDialogTrigger asChild>
585
+ <Button variant="destructive">Delete Item</Button>
586
+ </AlertDialogTrigger>
587
+ <AlertDialogContent>
588
+ <AlertDialogHeader>
589
+ <AlertDialogTitle>Are you sure?</AlertDialogTitle>
590
+ <AlertDialogDescription>
591
+ This action cannot be undone. This will permanently delete the item.
592
+ </AlertDialogDescription>
593
+ </AlertDialogHeader>
594
+ <AlertDialogFooter>
595
+ <AlertDialogCancel>Cancel</AlertDialogCancel>
596
+ <AlertDialogAction>Delete</AlertDialogAction>
597
+ </AlertDialogFooter>
598
+ </AlertDialogContent>
599
+ </AlertDialog>
600
+ </ComponentCard>
601
+
602
+ <ComponentCard title="Confirm Dialog">
603
+ <Button variant="outline" onClick={() => setConfirmOpen(true)}>
604
+ Open Confirm
605
+ </Button>
606
+ <ConfirmDialog
607
+ open={confirmOpen}
608
+ onOpenChange={setConfirmOpen}
609
+ title="Confirm Action"
610
+ description="Are you sure you want to proceed with this action?"
611
+ onConfirm={() => {
612
+ console.log('Confirmed!')
613
+ setConfirmOpen(false)
614
+ }}
615
+ />
616
+ </ComponentCard>
617
+
618
+ <ComponentCard title="Sheet (Drawer)">
619
+ <Sheet>
620
+ <SheetTrigger asChild>
621
+ <Button variant="outline">Open Sheet</Button>
622
+ </SheetTrigger>
623
+ <SheetContent>
624
+ <SheetHeader>
625
+ <SheetTitle>Sheet Title</SheetTitle>
626
+ <SheetDescription>
627
+ This is a slide-out panel, great for mobile navigation or forms.
628
+ </SheetDescription>
629
+ </SheetHeader>
630
+ <div className="py-4">
631
+ <p className="text-muted-foreground">Sheet content goes here.</p>
632
+ </div>
633
+ </SheetContent>
634
+ </Sheet>
635
+ </ComponentCard>
636
+
637
+ <ComponentCard title="Popover">
638
+ <Popover>
639
+ <PopoverTrigger asChild>
640
+ <Button variant="outline">Open Popover</Button>
641
+ </PopoverTrigger>
642
+ <PopoverContent className="w-80">
643
+ <div className="space-y-2">
644
+ <h4 className="font-medium">Popover Title</h4>
645
+ <p className="text-sm text-muted-foreground">
646
+ This is a popover component for displaying additional content.
647
+ </p>
648
+ </div>
649
+ </PopoverContent>
650
+ </Popover>
651
+ </ComponentCard>
652
+
653
+ <ComponentCard title="Dropdown Menu">
654
+ <DropdownMenu>
655
+ <DropdownMenuTrigger asChild>
656
+ <Button variant="outline">Open Menu</Button>
657
+ </DropdownMenuTrigger>
658
+ <DropdownMenuContent>
659
+ <DropdownMenuItem>Profile</DropdownMenuItem>
660
+ <DropdownMenuItem>Settings</DropdownMenuItem>
661
+ <DropdownMenuSeparator />
662
+ <DropdownMenuItem className="text-red-500">Logout</DropdownMenuItem>
663
+ </DropdownMenuContent>
664
+ </DropdownMenu>
665
+ </ComponentCard>
666
+ </div>
667
+ </Section>
668
+
669
+ {/* Cards */}
670
+ <Section title="Cards">
671
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
672
+ <Card>
673
+ <CardHeader>
674
+ <CardTitle>Card Title</CardTitle>
675
+ <CardDescription>Card description text goes here.</CardDescription>
676
+ </CardHeader>
677
+ <CardContent>
678
+ <p className="text-muted-foreground">This is the main content area of the card.</p>
679
+ </CardContent>
680
+ <CardFooter className="flex justify-between">
681
+ <Button variant="outline">Cancel</Button>
682
+ <Button>Save</Button>
683
+ </CardFooter>
684
+ </Card>
685
+
686
+ <Card className="border-primary/50">
687
+ <CardHeader>
688
+ <Badge className="w-fit mb-2">Featured</Badge>
689
+ <CardTitle>Highlighted Card</CardTitle>
690
+ <CardDescription>A card with primary border accent.</CardDescription>
691
+ </CardHeader>
692
+ <CardContent>
693
+ <p className="text-muted-foreground">Use border colors to highlight important cards.</p>
694
+ </CardContent>
695
+ </Card>
696
+
697
+ <Card className={cardSwitchOn ? "border-accent/50 bg-accent/5" : ""}>
698
+ <CardHeader>
699
+ <CardTitle>Interactive Card</CardTitle>
700
+ </CardHeader>
701
+ <CardContent className="space-y-4">
702
+ <div className="flex items-center justify-between">
703
+ <Label htmlFor="card-switch">Enable feature</Label>
704
+ <Switch
705
+ id="card-switch"
706
+ checked={cardSwitchOn}
707
+ onCheckedChange={setCardSwitchOn}
708
+ />
709
+ </div>
710
+ <Separator />
711
+ <div className="flex items-center justify-between">
712
+ <span className="text-sm text-muted-foreground">Status</span>
713
+ <Badge variant={cardSwitchOn ? "default" : "outline"}>
714
+ {cardSwitchOn ? "Enabled" : "Disabled"}
715
+ </Badge>
716
+ </div>
717
+ </CardContent>
718
+ </Card>
719
+ </div>
720
+ </Section>
721
+
722
+ </div>
723
+ </div>
724
+ </TooltipProvider>
725
+ )
726
+ }