@gram-ai/elements 1.25.2 → 1.26.1

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 (162) hide show
  1. package/dist/components/Chat/stories/Charts.stories.d.ts +37 -0
  2. package/dist/components/Chat/stories/GenerativeUI.stories.d.ts +17 -0
  3. package/dist/components/ui/button.d.ts +1 -1
  4. package/dist/components/ui/buttonVariants.d.ts +1 -1
  5. package/dist/components/ui/charts.stories.d.ts +43 -0
  6. package/dist/components/ui/generative-ui.stories.d.ts +53 -0
  7. package/dist/components/ui/tool-ui.d.ts +16 -1
  8. package/dist/elements.cjs +1 -1
  9. package/dist/elements.css +1 -1
  10. package/dist/elements.js +6 -6
  11. package/dist/index-BpJstUh1.cjs +280 -0
  12. package/dist/index-BpJstUh1.cjs.map +1 -0
  13. package/dist/index-CUitXazZ.js +30426 -0
  14. package/dist/index-CUitXazZ.js.map +1 -0
  15. package/dist/index-DdrZQXwQ.cjs +147 -0
  16. package/dist/index-DdrZQXwQ.cjs.map +1 -0
  17. package/dist/index-DfqYP0CD.js +37062 -0
  18. package/dist/index-DfqYP0CD.js.map +1 -0
  19. package/dist/plugins/chart/catalog.d.ts +123 -0
  20. package/dist/plugins/chart/index.d.ts +1 -1
  21. package/dist/plugins/chart/ui/area-chart.d.ts +16 -0
  22. package/dist/plugins/chart/ui/bar-chart.d.ts +16 -0
  23. package/dist/plugins/chart/ui/donut-chart.d.ts +17 -0
  24. package/dist/plugins/chart/ui/index.d.ts +7 -0
  25. package/dist/plugins/chart/ui/line-chart.d.ts +17 -0
  26. package/dist/plugins/chart/ui/pie-chart.d.ts +15 -0
  27. package/dist/plugins/chart/ui/radar-chart.d.ts +14 -0
  28. package/dist/plugins/chart/ui/scatter-chart.d.ts +18 -0
  29. package/dist/plugins/components/MacOSWindowFrame.d.ts +13 -0
  30. package/dist/plugins/components/PluginLoadingState.d.ts +1 -1
  31. package/dist/plugins/generative-ui/catalog.d.ts +293 -0
  32. package/dist/plugins/generative-ui/ui/accordion-wrapper.d.ts +18 -0
  33. package/dist/plugins/generative-ui/ui/accordion.d.ts +7 -0
  34. package/dist/plugins/generative-ui/ui/action-button.d.ts +10 -0
  35. package/dist/plugins/generative-ui/ui/alert-wrapper.d.ts +9 -0
  36. package/dist/plugins/generative-ui/ui/alert.d.ts +9 -0
  37. package/dist/plugins/generative-ui/ui/avatar-wrapper.d.ts +9 -0
  38. package/dist/plugins/generative-ui/ui/avatar.d.ts +11 -0
  39. package/dist/plugins/generative-ui/ui/badge.d.ts +12 -0
  40. package/dist/plugins/generative-ui/ui/button-wrapper.d.ts +15 -0
  41. package/dist/plugins/generative-ui/ui/button.d.ts +10 -0
  42. package/dist/plugins/generative-ui/ui/card-wrapper.d.ts +10 -0
  43. package/dist/plugins/generative-ui/ui/card.d.ts +9 -0
  44. package/dist/plugins/generative-ui/ui/checkbox-wrapper.d.ts +10 -0
  45. package/dist/plugins/generative-ui/ui/checkbox.d.ts +4 -0
  46. package/dist/plugins/generative-ui/ui/data-table.d.ts +10 -0
  47. package/dist/plugins/generative-ui/ui/dialog.d.ts +17 -0
  48. package/dist/plugins/generative-ui/ui/dropdown-menu.d.ts +25 -0
  49. package/dist/plugins/generative-ui/ui/grid.d.ts +6 -0
  50. package/dist/plugins/generative-ui/ui/index.d.ts +40 -0
  51. package/dist/plugins/generative-ui/ui/input-wrapper.d.ts +11 -0
  52. package/dist/plugins/generative-ui/ui/input.d.ts +3 -0
  53. package/dist/plugins/generative-ui/ui/label.d.ts +4 -0
  54. package/dist/plugins/generative-ui/ui/list.d.ts +6 -0
  55. package/dist/plugins/generative-ui/ui/metric.d.ts +7 -0
  56. package/dist/plugins/generative-ui/ui/pagination.d.ts +13 -0
  57. package/dist/plugins/generative-ui/ui/popover.d.ts +10 -0
  58. package/dist/plugins/generative-ui/ui/progress.d.ts +10 -0
  59. package/dist/plugins/generative-ui/ui/radio-group.d.ts +5 -0
  60. package/dist/plugins/generative-ui/ui/select-wrapper.d.ts +13 -0
  61. package/dist/plugins/generative-ui/ui/select.d.ts +15 -0
  62. package/dist/plugins/generative-ui/ui/separator.d.ts +4 -0
  63. package/dist/plugins/generative-ui/ui/skeleton-wrapper.d.ts +9 -0
  64. package/dist/plugins/generative-ui/ui/skeleton.d.ts +2 -0
  65. package/dist/plugins/generative-ui/ui/stack.d.ts +8 -0
  66. package/dist/plugins/generative-ui/ui/switch.d.ts +6 -0
  67. package/dist/plugins/generative-ui/ui/table.d.ts +10 -0
  68. package/dist/plugins/generative-ui/ui/tabs-wrapper.d.ts +21 -0
  69. package/dist/plugins/generative-ui/ui/tabs.d.ts +11 -0
  70. package/dist/plugins/generative-ui/ui/text.d.ts +7 -0
  71. package/dist/plugins/generative-ui/ui/textarea.d.ts +3 -0
  72. package/dist/plugins/generative-ui/ui/tooltip.d.ts +7 -0
  73. package/dist/plugins.cjs +1 -1
  74. package/dist/plugins.js +1 -1
  75. package/dist/{profiler-BaG0scxd.js → profiler-WoFj2UH8.js} +2 -2
  76. package/dist/{profiler-BaG0scxd.js.map → profiler-WoFj2UH8.js.map} +1 -1
  77. package/dist/{profiler-CuqENACf.cjs → profiler-ZLr2-8s7.cjs} +2 -2
  78. package/dist/{profiler-CuqENACf.cjs.map → profiler-ZLr2-8s7.cjs.map} +1 -1
  79. package/dist/{startRecording-BiLmoqZa.cjs → startRecording-BGnWDInp.cjs} +2 -2
  80. package/dist/{startRecording-BiLmoqZa.cjs.map → startRecording-BGnWDInp.cjs.map} +1 -1
  81. package/dist/{startRecording-86bHmd-l.js → startRecording-DzQo16WK.js} +2 -2
  82. package/dist/{startRecording-86bHmd-l.js.map → startRecording-DzQo16WK.js.map} +1 -1
  83. package/package.json +4 -1
  84. package/src/components/Chat/stories/Charts.stories.tsx +260 -0
  85. package/src/components/Chat/stories/ConnectionConfiguration.stories.tsx +6 -6
  86. package/src/components/Chat/stories/GenerativeUI.stories.tsx +113 -0
  87. package/src/components/Replay.stories.tsx +1 -1
  88. package/src/components/Replay.tsx +18 -13
  89. package/src/components/ui/charts.stories.tsx +246 -0
  90. package/src/components/ui/generative-ui.stories.tsx +557 -0
  91. package/src/components/ui/generative-ui.tsx +60 -360
  92. package/src/components/ui/tool-ui.stories.tsx +6 -3
  93. package/src/components/ui/tool-ui.tsx +31 -2
  94. package/src/hooks/useAuth.ts +17 -1
  95. package/src/hooks/useFollowOnSuggestions.ts +6 -1
  96. package/src/plugins/chart/catalog.ts +141 -0
  97. package/src/plugins/chart/component.tsx +79 -125
  98. package/src/plugins/chart/index.ts +141 -89
  99. package/src/plugins/chart/ui/area-chart.tsx +133 -0
  100. package/src/plugins/chart/ui/bar-chart.tsx +137 -0
  101. package/src/plugins/chart/ui/donut-chart.tsx +167 -0
  102. package/src/plugins/chart/ui/index.ts +7 -0
  103. package/src/plugins/chart/ui/line-chart.tsx +135 -0
  104. package/src/plugins/chart/ui/pie-chart.tsx +148 -0
  105. package/src/plugins/chart/ui/radar-chart.tsx +105 -0
  106. package/src/plugins/chart/ui/scatter-chart.tsx +132 -0
  107. package/src/plugins/components/MacOSWindowFrame.tsx +55 -0
  108. package/src/plugins/components/PluginLoadingState.tsx +9 -13
  109. package/src/plugins/generative-ui/catalog.ts +277 -0
  110. package/src/plugins/generative-ui/component.tsx +112 -21
  111. package/src/plugins/generative-ui/index.ts +20 -141
  112. package/src/plugins/generative-ui/ui/accordion-wrapper.tsx +57 -0
  113. package/src/plugins/generative-ui/ui/accordion.tsx +66 -0
  114. package/src/plugins/generative-ui/ui/action-button.tsx +68 -0
  115. package/src/plugins/generative-ui/ui/alert-wrapper.tsx +26 -0
  116. package/src/plugins/generative-ui/ui/alert.tsx +66 -0
  117. package/src/plugins/generative-ui/ui/avatar-wrapper.tsx +22 -0
  118. package/src/plugins/generative-ui/ui/avatar.tsx +109 -0
  119. package/src/plugins/generative-ui/ui/badge.tsx +65 -0
  120. package/src/plugins/generative-ui/ui/button-wrapper.tsx +32 -0
  121. package/src/plugins/generative-ui/ui/button.tsx +65 -0
  122. package/src/plugins/generative-ui/ui/card-wrapper.tsx +36 -0
  123. package/src/plugins/generative-ui/ui/card.tsx +92 -0
  124. package/src/plugins/generative-ui/ui/checkbox-wrapper.tsx +39 -0
  125. package/src/plugins/generative-ui/ui/checkbox.tsx +32 -0
  126. package/src/plugins/generative-ui/ui/data-table.tsx +53 -0
  127. package/src/plugins/generative-ui/ui/dialog.tsx +158 -0
  128. package/src/plugins/generative-ui/ui/dropdown-menu.tsx +257 -0
  129. package/src/plugins/generative-ui/ui/grid.tsx +29 -0
  130. package/src/plugins/generative-ui/ui/index.ts +43 -0
  131. package/src/plugins/generative-ui/ui/input-wrapper.tsx +38 -0
  132. package/src/plugins/generative-ui/ui/input.tsx +21 -0
  133. package/src/plugins/generative-ui/ui/label.tsx +24 -0
  134. package/src/plugins/generative-ui/ui/list.tsx +34 -0
  135. package/src/plugins/generative-ui/ui/metric.tsx +53 -0
  136. package/src/plugins/generative-ui/ui/pagination.tsx +127 -0
  137. package/src/plugins/generative-ui/ui/popover.tsx +89 -0
  138. package/src/plugins/generative-ui/ui/progress.tsx +57 -0
  139. package/src/plugins/generative-ui/ui/radio-group.tsx +45 -0
  140. package/src/plugins/generative-ui/ui/select-wrapper.tsx +41 -0
  141. package/src/plugins/generative-ui/ui/select.tsx +190 -0
  142. package/src/plugins/generative-ui/ui/separator.tsx +28 -0
  143. package/src/plugins/generative-ui/ui/skeleton-wrapper.tsx +30 -0
  144. package/src/plugins/generative-ui/ui/skeleton.tsx +13 -0
  145. package/src/plugins/generative-ui/ui/stack.tsx +54 -0
  146. package/src/plugins/generative-ui/ui/switch.tsx +35 -0
  147. package/src/plugins/generative-ui/ui/table.tsx +116 -0
  148. package/src/plugins/generative-ui/ui/tabs-wrapper.tsx +51 -0
  149. package/src/plugins/generative-ui/ui/tabs.tsx +92 -0
  150. package/src/plugins/generative-ui/ui/text.tsx +33 -0
  151. package/src/plugins/generative-ui/ui/textarea.tsx +18 -0
  152. package/src/plugins/generative-ui/ui/tooltip.tsx +57 -0
  153. package/dist/components/Chat/stories/Plugins.stories.d.ts +0 -12
  154. package/dist/index-B8nSCdu4.cjs +0 -251
  155. package/dist/index-B8nSCdu4.cjs.map +0 -1
  156. package/dist/index-CAtaLV1E.cjs +0 -187
  157. package/dist/index-CAtaLV1E.cjs.map +0 -1
  158. package/dist/index-CJrwma08.js +0 -27232
  159. package/dist/index-CJrwma08.js.map +0 -1
  160. package/dist/index-DLWQ91ow.js +0 -40049
  161. package/dist/index-DLWQ91ow.js.map +0 -1
  162. package/src/components/Chat/stories/Plugins.stories.tsx +0 -158
@@ -0,0 +1,32 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import { CheckIcon } from 'lucide-react'
5
+ import { Checkbox as CheckboxPrimitive } from 'radix-ui'
6
+
7
+ import { cn } from '@/lib/utils'
8
+
9
+ function Checkbox({
10
+ className,
11
+ ...props
12
+ }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
13
+ return (
14
+ <CheckboxPrimitive.Root
15
+ data-slot="checkbox"
16
+ className={cn(
17
+ 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
18
+ className
19
+ )}
20
+ {...props}
21
+ >
22
+ <CheckboxPrimitive.Indicator
23
+ data-slot="checkbox-indicator"
24
+ className="grid place-content-center text-current transition-none"
25
+ >
26
+ <CheckIcon className="size-3.5" />
27
+ </CheckboxPrimitive.Indicator>
28
+ </CheckboxPrimitive.Root>
29
+ )
30
+ }
31
+
32
+ export { Checkbox }
@@ -0,0 +1,53 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import {
5
+ Table,
6
+ TableHeader,
7
+ TableBody,
8
+ TableHead,
9
+ TableRow,
10
+ TableCell,
11
+ } from './table'
12
+ import { cn } from '@/lib/utils'
13
+
14
+ export interface DataTableProps extends React.ComponentProps<'div'> {
15
+ headers?: string[]
16
+ rows: (string | number)[][]
17
+ }
18
+
19
+ /**
20
+ * DataTable adapts the compound Table component to a simple props-based API
21
+ * for use with the json-render catalog.
22
+ */
23
+ export function DataTable({
24
+ headers,
25
+ rows,
26
+ className,
27
+ ...props
28
+ }: DataTableProps) {
29
+ return (
30
+ <div className={cn(className)} {...props}>
31
+ <Table>
32
+ {headers && headers.length > 0 && (
33
+ <TableHeader>
34
+ <TableRow>
35
+ {headers.map((header, i) => (
36
+ <TableHead key={i}>{header}</TableHead>
37
+ ))}
38
+ </TableRow>
39
+ </TableHeader>
40
+ )}
41
+ <TableBody>
42
+ {rows.map((row, rowIndex) => (
43
+ <TableRow key={rowIndex}>
44
+ {row.map((cell, cellIndex) => (
45
+ <TableCell key={cellIndex}>{cell}</TableCell>
46
+ ))}
47
+ </TableRow>
48
+ ))}
49
+ </TableBody>
50
+ </Table>
51
+ </div>
52
+ )
53
+ }
@@ -0,0 +1,158 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import { XIcon } from 'lucide-react'
5
+ import { Dialog as DialogPrimitive } from 'radix-ui'
6
+
7
+ import { cn } from '@/lib/utils'
8
+ import { Button } from '@/components/ui/button'
9
+
10
+ function Dialog({
11
+ ...props
12
+ }: React.ComponentProps<typeof DialogPrimitive.Root>) {
13
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />
14
+ }
15
+
16
+ function DialogTrigger({
17
+ ...props
18
+ }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
19
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
20
+ }
21
+
22
+ function DialogPortal({
23
+ ...props
24
+ }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
25
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
26
+ }
27
+
28
+ function DialogClose({
29
+ ...props
30
+ }: React.ComponentProps<typeof DialogPrimitive.Close>) {
31
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
32
+ }
33
+
34
+ function DialogOverlay({
35
+ className,
36
+ ...props
37
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
38
+ return (
39
+ <DialogPrimitive.Overlay
40
+ data-slot="dialog-overlay"
41
+ className={cn(
42
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
43
+ className
44
+ )}
45
+ {...props}
46
+ />
47
+ )
48
+ }
49
+
50
+ function DialogContent({
51
+ className,
52
+ children,
53
+ showCloseButton = true,
54
+ ...props
55
+ }: React.ComponentProps<typeof DialogPrimitive.Content> & {
56
+ showCloseButton?: boolean
57
+ }) {
58
+ return (
59
+ <DialogPortal data-slot="dialog-portal">
60
+ <DialogOverlay />
61
+ <DialogPrimitive.Content
62
+ data-slot="dialog-content"
63
+ className={cn(
64
+ 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg',
65
+ className
66
+ )}
67
+ {...props}
68
+ >
69
+ {children}
70
+ {showCloseButton && (
71
+ <DialogPrimitive.Close
72
+ data-slot="dialog-close"
73
+ className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
74
+ >
75
+ <XIcon />
76
+ <span className="sr-only">Close</span>
77
+ </DialogPrimitive.Close>
78
+ )}
79
+ </DialogPrimitive.Content>
80
+ </DialogPortal>
81
+ )
82
+ }
83
+
84
+ function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
85
+ return (
86
+ <div
87
+ data-slot="dialog-header"
88
+ className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
89
+ {...props}
90
+ />
91
+ )
92
+ }
93
+
94
+ function DialogFooter({
95
+ className,
96
+ showCloseButton = false,
97
+ children,
98
+ ...props
99
+ }: React.ComponentProps<'div'> & {
100
+ showCloseButton?: boolean
101
+ }) {
102
+ return (
103
+ <div
104
+ data-slot="dialog-footer"
105
+ className={cn(
106
+ 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',
107
+ className
108
+ )}
109
+ {...props}
110
+ >
111
+ {children}
112
+ {showCloseButton && (
113
+ <DialogPrimitive.Close asChild>
114
+ <Button variant="outline">Close</Button>
115
+ </DialogPrimitive.Close>
116
+ )}
117
+ </div>
118
+ )
119
+ }
120
+
121
+ function DialogTitle({
122
+ className,
123
+ ...props
124
+ }: React.ComponentProps<typeof DialogPrimitive.Title>) {
125
+ return (
126
+ <DialogPrimitive.Title
127
+ data-slot="dialog-title"
128
+ className={cn('text-lg leading-none font-semibold', className)}
129
+ {...props}
130
+ />
131
+ )
132
+ }
133
+
134
+ function DialogDescription({
135
+ className,
136
+ ...props
137
+ }: React.ComponentProps<typeof DialogPrimitive.Description>) {
138
+ return (
139
+ <DialogPrimitive.Description
140
+ data-slot="dialog-description"
141
+ className={cn('text-muted-foreground text-sm', className)}
142
+ {...props}
143
+ />
144
+ )
145
+ }
146
+
147
+ export {
148
+ Dialog,
149
+ DialogClose,
150
+ DialogContent,
151
+ DialogDescription,
152
+ DialogFooter,
153
+ DialogHeader,
154
+ DialogOverlay,
155
+ DialogPortal,
156
+ DialogTitle,
157
+ DialogTrigger,
158
+ }
@@ -0,0 +1,257 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react'
5
+ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui'
6
+
7
+ import { cn } from '@/lib/utils'
8
+
9
+ function DropdownMenu({
10
+ ...props
11
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
12
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
13
+ }
14
+
15
+ function DropdownMenuPortal({
16
+ ...props
17
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
18
+ return (
19
+ <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
20
+ )
21
+ }
22
+
23
+ function DropdownMenuTrigger({
24
+ ...props
25
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
26
+ return (
27
+ <DropdownMenuPrimitive.Trigger
28
+ data-slot="dropdown-menu-trigger"
29
+ {...props}
30
+ />
31
+ )
32
+ }
33
+
34
+ function DropdownMenuContent({
35
+ className,
36
+ sideOffset = 4,
37
+ ...props
38
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
39
+ return (
40
+ <DropdownMenuPrimitive.Portal>
41
+ <DropdownMenuPrimitive.Content
42
+ data-slot="dropdown-menu-content"
43
+ sideOffset={sideOffset}
44
+ className={cn(
45
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
46
+ className
47
+ )}
48
+ {...props}
49
+ />
50
+ </DropdownMenuPrimitive.Portal>
51
+ )
52
+ }
53
+
54
+ function DropdownMenuGroup({
55
+ ...props
56
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
57
+ return (
58
+ <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
59
+ )
60
+ }
61
+
62
+ function DropdownMenuItem({
63
+ className,
64
+ inset,
65
+ variant = 'default',
66
+ ...props
67
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
68
+ inset?: boolean
69
+ variant?: 'default' | 'destructive'
70
+ }) {
71
+ return (
72
+ <DropdownMenuPrimitive.Item
73
+ data-slot="dropdown-menu-item"
74
+ data-inset={inset}
75
+ data-variant={variant}
76
+ className={cn(
77
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
78
+ className
79
+ )}
80
+ {...props}
81
+ />
82
+ )
83
+ }
84
+
85
+ function DropdownMenuCheckboxItem({
86
+ className,
87
+ children,
88
+ checked,
89
+ ...props
90
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
91
+ return (
92
+ <DropdownMenuPrimitive.CheckboxItem
93
+ data-slot="dropdown-menu-checkbox-item"
94
+ className={cn(
95
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
96
+ className
97
+ )}
98
+ checked={checked}
99
+ {...props}
100
+ >
101
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
102
+ <DropdownMenuPrimitive.ItemIndicator>
103
+ <CheckIcon className="size-4" />
104
+ </DropdownMenuPrimitive.ItemIndicator>
105
+ </span>
106
+ {children}
107
+ </DropdownMenuPrimitive.CheckboxItem>
108
+ )
109
+ }
110
+
111
+ function DropdownMenuRadioGroup({
112
+ ...props
113
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
114
+ return (
115
+ <DropdownMenuPrimitive.RadioGroup
116
+ data-slot="dropdown-menu-radio-group"
117
+ {...props}
118
+ />
119
+ )
120
+ }
121
+
122
+ function DropdownMenuRadioItem({
123
+ className,
124
+ children,
125
+ ...props
126
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
127
+ return (
128
+ <DropdownMenuPrimitive.RadioItem
129
+ data-slot="dropdown-menu-radio-item"
130
+ className={cn(
131
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
132
+ className
133
+ )}
134
+ {...props}
135
+ >
136
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
137
+ <DropdownMenuPrimitive.ItemIndicator>
138
+ <CircleIcon className="size-2 fill-current" />
139
+ </DropdownMenuPrimitive.ItemIndicator>
140
+ </span>
141
+ {children}
142
+ </DropdownMenuPrimitive.RadioItem>
143
+ )
144
+ }
145
+
146
+ function DropdownMenuLabel({
147
+ className,
148
+ inset,
149
+ ...props
150
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
151
+ inset?: boolean
152
+ }) {
153
+ return (
154
+ <DropdownMenuPrimitive.Label
155
+ data-slot="dropdown-menu-label"
156
+ data-inset={inset}
157
+ className={cn(
158
+ 'px-2 py-1.5 text-sm font-medium data-[inset]:pl-8',
159
+ className
160
+ )}
161
+ {...props}
162
+ />
163
+ )
164
+ }
165
+
166
+ function DropdownMenuSeparator({
167
+ className,
168
+ ...props
169
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
170
+ return (
171
+ <DropdownMenuPrimitive.Separator
172
+ data-slot="dropdown-menu-separator"
173
+ className={cn('bg-border -mx-1 my-1 h-px', className)}
174
+ {...props}
175
+ />
176
+ )
177
+ }
178
+
179
+ function DropdownMenuShortcut({
180
+ className,
181
+ ...props
182
+ }: React.ComponentProps<'span'>) {
183
+ return (
184
+ <span
185
+ data-slot="dropdown-menu-shortcut"
186
+ className={cn(
187
+ 'text-muted-foreground ml-auto text-xs tracking-widest',
188
+ className
189
+ )}
190
+ {...props}
191
+ />
192
+ )
193
+ }
194
+
195
+ function DropdownMenuSub({
196
+ ...props
197
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
198
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
199
+ }
200
+
201
+ function DropdownMenuSubTrigger({
202
+ className,
203
+ inset,
204
+ children,
205
+ ...props
206
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
207
+ inset?: boolean
208
+ }) {
209
+ return (
210
+ <DropdownMenuPrimitive.SubTrigger
211
+ data-slot="dropdown-menu-sub-trigger"
212
+ data-inset={inset}
213
+ className={cn(
214
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
215
+ className
216
+ )}
217
+ {...props}
218
+ >
219
+ {children}
220
+ <ChevronRightIcon className="ml-auto size-4" />
221
+ </DropdownMenuPrimitive.SubTrigger>
222
+ )
223
+ }
224
+
225
+ function DropdownMenuSubContent({
226
+ className,
227
+ ...props
228
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
229
+ return (
230
+ <DropdownMenuPrimitive.SubContent
231
+ data-slot="dropdown-menu-sub-content"
232
+ className={cn(
233
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
234
+ className
235
+ )}
236
+ {...props}
237
+ />
238
+ )
239
+ }
240
+
241
+ export {
242
+ DropdownMenu,
243
+ DropdownMenuPortal,
244
+ DropdownMenuTrigger,
245
+ DropdownMenuContent,
246
+ DropdownMenuGroup,
247
+ DropdownMenuLabel,
248
+ DropdownMenuItem,
249
+ DropdownMenuCheckboxItem,
250
+ DropdownMenuRadioGroup,
251
+ DropdownMenuRadioItem,
252
+ DropdownMenuSeparator,
253
+ DropdownMenuShortcut,
254
+ DropdownMenuSub,
255
+ DropdownMenuSubTrigger,
256
+ DropdownMenuSubContent,
257
+ }
@@ -0,0 +1,29 @@
1
+ import * as React from 'react'
2
+ import { cn } from '@/lib/utils'
3
+
4
+ export interface GridProps extends React.ComponentProps<'div'> {
5
+ columns?: number
6
+ gap?: 'sm' | 'md' | 'lg'
7
+ }
8
+
9
+ const gapClasses = {
10
+ sm: 'gap-2',
11
+ md: 'gap-4',
12
+ lg: 'gap-6',
13
+ }
14
+
15
+ export function Grid({
16
+ columns = 2,
17
+ gap = 'md',
18
+ className,
19
+ ...props
20
+ }: GridProps) {
21
+ return (
22
+ <div
23
+ data-slot="grid"
24
+ className={cn('grid', gapClasses[gap], className)}
25
+ style={{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }}
26
+ {...props}
27
+ />
28
+ )
29
+ }
@@ -0,0 +1,43 @@
1
+ // Vercel shadcn primitives
2
+ export * from './accordion'
3
+ export * from './alert'
4
+ export * from './avatar'
5
+ export * from './badge'
6
+ export * from './button'
7
+ export * from './card'
8
+ export * from './checkbox'
9
+ export * from './dialog'
10
+ export * from './dropdown-menu'
11
+ export * from './input'
12
+ export * from './label'
13
+ export * from './pagination'
14
+ export * from './popover'
15
+ export * from './progress'
16
+ export * from './radio-group'
17
+ export * from './select'
18
+ export * from './separator'
19
+ export * from './skeleton'
20
+ export * from './switch'
21
+ export * from './table'
22
+ export * from './tabs'
23
+ export * from './textarea'
24
+ export * from './tooltip'
25
+
26
+ // json-render catalog wrappers
27
+ export * from './accordion-wrapper'
28
+ export * from './action-button'
29
+ export * from './alert-wrapper'
30
+ export * from './avatar-wrapper'
31
+ export * from './button-wrapper'
32
+ export * from './card-wrapper'
33
+ export * from './checkbox-wrapper'
34
+ export * from './data-table'
35
+ export * from './grid'
36
+ export * from './input-wrapper'
37
+ export * from './list'
38
+ export * from './metric'
39
+ export * from './select-wrapper'
40
+ export * from './skeleton-wrapper'
41
+ export * from './stack'
42
+ export * from './tabs-wrapper'
43
+ export * from './text'
@@ -0,0 +1,38 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import { Input } from './input'
5
+ import { Label } from './label'
6
+
7
+ export interface InputWrapperProps {
8
+ label?: string
9
+ placeholder?: string
10
+ type?: 'text' | 'email' | 'password' | 'number' | 'tel'
11
+ /** Path for form state management (future use) */
12
+ valuePath: string
13
+ }
14
+
15
+ /**
16
+ * Input wrapper that adds label support.
17
+ */
18
+ export function InputWrapper({
19
+ label,
20
+ placeholder,
21
+ type = 'text',
22
+ valuePath,
23
+ }: InputWrapperProps) {
24
+ const id = React.useId()
25
+
26
+ return (
27
+ <div className="flex flex-col gap-1.5">
28
+ {label && <Label htmlFor={id}>{label}</Label>}
29
+ <Input
30
+ id={id}
31
+ type={type}
32
+ placeholder={placeholder}
33
+ name={valuePath}
34
+ data-value-path={valuePath}
35
+ />
36
+ </div>
37
+ )
38
+ }
@@ -0,0 +1,21 @@
1
+ import * as React from 'react'
2
+
3
+ import { cn } from '@/lib/utils'
4
+
5
+ function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
6
+ return (
7
+ <input
8
+ type={type}
9
+ data-slot="input"
10
+ className={cn(
11
+ 'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
12
+ 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
13
+ 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
14
+ className
15
+ )}
16
+ {...props}
17
+ />
18
+ )
19
+ }
20
+
21
+ export { Input }
@@ -0,0 +1,24 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import { Label as LabelPrimitive } from 'radix-ui'
5
+
6
+ import { cn } from '@/lib/utils'
7
+
8
+ function Label({
9
+ className,
10
+ ...props
11
+ }: React.ComponentProps<typeof LabelPrimitive.Root>) {
12
+ return (
13
+ <LabelPrimitive.Root
14
+ data-slot="label"
15
+ className={cn(
16
+ 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
17
+ className
18
+ )}
19
+ {...props}
20
+ />
21
+ )
22
+ }
23
+
24
+ export { Label }
@@ -0,0 +1,34 @@
1
+ import * as React from 'react'
2
+ import { cn } from '@/lib/utils'
3
+
4
+ export interface ListProps {
5
+ items: string[]
6
+ ordered?: boolean
7
+ className?: string
8
+ }
9
+
10
+ export function List({ items, ordered = false, className }: ListProps) {
11
+ const listClasses = cn(
12
+ 'text-foreground space-y-1 pl-4',
13
+ ordered ? 'list-decimal' : 'list-disc',
14
+ className
15
+ )
16
+
17
+ if (ordered) {
18
+ return (
19
+ <ol data-slot="list" className={listClasses}>
20
+ {items.map((item, index) => (
21
+ <li key={index}>{item}</li>
22
+ ))}
23
+ </ol>
24
+ )
25
+ }
26
+
27
+ return (
28
+ <ul data-slot="list" className={listClasses}>
29
+ {items.map((item, index) => (
30
+ <li key={index}>{item}</li>
31
+ ))}
32
+ </ul>
33
+ )
34
+ }