@betterstart/cli 0.1.28 → 0.1.30

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 (65) hide show
  1. package/dist/{chunk-SAPJG4NO.js → chunk-6JCWMKSY.js} +7 -4
  2. package/dist/{chunk-SAPJG4NO.js.map → chunk-6JCWMKSY.js.map} +1 -1
  3. package/dist/cli.js +749 -866
  4. package/dist/cli.js.map +1 -1
  5. package/dist/drizzle-config-EDKOEZ6G.js +7 -0
  6. package/package.json +1 -1
  7. package/templates/ui/accordion.tsx +73 -42
  8. package/templates/ui/alert-dialog.tsx +155 -90
  9. package/templates/ui/alert.tsx +46 -26
  10. package/templates/ui/aspect-ratio.tsx +4 -2
  11. package/templates/ui/avatar.tsx +92 -43
  12. package/templates/ui/badge.tsx +27 -12
  13. package/templates/ui/breadcrumb.tsx +63 -60
  14. package/templates/ui/button-group.tsx +8 -8
  15. package/templates/ui/button.tsx +44 -26
  16. package/templates/ui/calendar.tsx +43 -34
  17. package/templates/ui/card.tsx +71 -34
  18. package/templates/ui/carousel.tsx +111 -115
  19. package/templates/ui/chart.tsx +197 -207
  20. package/templates/ui/checkbox.tsx +21 -20
  21. package/templates/ui/collapsible.tsx +14 -4
  22. package/templates/ui/combobox.tsx +272 -0
  23. package/templates/ui/command.tsx +139 -101
  24. package/templates/ui/context-menu.tsx +214 -156
  25. package/templates/ui/dialog.tsx +118 -77
  26. package/templates/ui/direction.tsx +20 -0
  27. package/templates/ui/drawer.tsx +89 -69
  28. package/templates/ui/dropdown-menu.tsx +228 -164
  29. package/templates/ui/empty.tsx +8 -5
  30. package/templates/ui/field.tsx +25 -32
  31. package/templates/ui/hover-card.tsx +29 -20
  32. package/templates/ui/input-group.tsx +20 -37
  33. package/templates/ui/input-otp.tsx +57 -42
  34. package/templates/ui/input.tsx +14 -17
  35. package/templates/ui/item.tsx +27 -17
  36. package/templates/ui/kbd.tsx +1 -3
  37. package/templates/ui/label.tsx +14 -14
  38. package/templates/ui/markdown-editor.tsx +1 -1
  39. package/templates/ui/menubar.tsx +220 -188
  40. package/templates/ui/native-select.tsx +42 -0
  41. package/templates/ui/navigation-menu.tsx +130 -90
  42. package/templates/ui/pagination.tsx +88 -73
  43. package/templates/ui/popover.tsx +67 -26
  44. package/templates/ui/progress.tsx +24 -18
  45. package/templates/ui/radio-group.tsx +26 -20
  46. package/templates/ui/resizable.tsx +29 -29
  47. package/templates/ui/scroll-area.tsx +47 -38
  48. package/templates/ui/select.tsx +158 -125
  49. package/templates/ui/separator.tsx +21 -19
  50. package/templates/ui/sheet.tsx +104 -95
  51. package/templates/ui/sidebar.tsx +77 -183
  52. package/templates/ui/skeleton.tsx +8 -2
  53. package/templates/ui/slider.tsx +46 -17
  54. package/templates/ui/sonner.tsx +19 -9
  55. package/templates/ui/spinner.tsx +2 -2
  56. package/templates/ui/switch.tsx +24 -20
  57. package/templates/ui/table.tsx +68 -73
  58. package/templates/ui/tabs.tsx +71 -46
  59. package/templates/ui/textarea.tsx +13 -16
  60. package/templates/ui/toggle-group.tsx +57 -28
  61. package/templates/ui/toggle.tsx +21 -20
  62. package/templates/ui/tooltip.tsx +44 -23
  63. package/dist/drizzle-config-KISB26BA.js +0 -7
  64. package/templates/ui/use-mobile.tsx +0 -19
  65. /package/dist/{drizzle-config-KISB26BA.js.map → drizzle-config-EDKOEZ6G.js.map} +0 -0
@@ -33,23 +33,26 @@ function useChart() {
33
33
  return context
34
34
  }
35
35
 
36
- const ChartContainer = React.forwardRef<
37
- HTMLDivElement,
38
- React.ComponentProps<'div'> & {
39
- config: ChartConfig
40
- children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children']
41
- }
42
- >(({ id, className, children, config, ...props }, ref) => {
36
+ function ChartContainer({
37
+ id,
38
+ className,
39
+ children,
40
+ config,
41
+ ...props
42
+ }: React.ComponentProps<'div'> & {
43
+ config: ChartConfig
44
+ children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children']
45
+ }) {
43
46
  const uniqueId = React.useId()
44
47
  const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`
45
48
 
46
49
  return (
47
50
  <ChartContext.Provider value={{ config }}>
48
51
  <div
52
+ data-slot="chart"
49
53
  data-chart={chartId}
50
- ref={ref}
51
54
  className={cn(
52
- "flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
55
+ "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
53
56
  className
54
57
  )}
55
58
  {...props}
@@ -59,8 +62,7 @@ const ChartContainer = React.forwardRef<
59
62
  </div>
60
63
  </ChartContext.Provider>
61
64
  )
62
- })
63
- ChartContainer.displayName = 'Chart'
65
+ }
64
66
 
65
67
  const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
66
68
  const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color)
@@ -93,227 +95,215 @@ ${colorConfig
93
95
 
94
96
  const ChartTooltip = RechartsPrimitive.Tooltip
95
97
 
96
- interface ChartTooltipContentProps extends React.HTMLAttributes<HTMLDivElement> {
97
- active?: boolean
98
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
- payload?: any[]
100
- label?: string
101
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
102
- labelFormatter?: (label: any, payload: any[]) => React.ReactNode
103
- labelClassName?: string
104
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
105
- formatter?: (
106
- value: any,
107
- name: string,
108
- item: any,
109
- index: number,
110
- payload: any[]
111
- ) => React.ReactNode
112
- color?: string
113
- hideLabel?: boolean
114
- hideIndicator?: boolean
115
- indicator?: 'line' | 'dot' | 'dashed'
116
- nameKey?: string
117
- labelKey?: string
118
- }
119
-
120
- const ChartTooltipContent = React.forwardRef<HTMLDivElement, ChartTooltipContentProps>(
121
- (
122
- {
123
- active,
124
- payload,
125
- className,
126
- indicator = 'dot',
127
- hideLabel = false,
128
- hideIndicator = false,
129
- label,
130
- labelFormatter,
131
- labelClassName,
132
- formatter,
133
- color,
134
- nameKey,
135
- labelKey
136
- },
137
- ref
138
- ) => {
139
- const { config } = useChart()
140
-
141
- const tooltipLabel = React.useMemo(() => {
142
- if (hideLabel || !payload?.length) {
143
- return null
144
- }
145
-
146
- const [item] = payload
147
- const key = `${labelKey || item?.dataKey || item?.name || 'value'}`
148
- const itemConfig = getPayloadConfigFromPayload(config, item, key)
149
- const value =
150
- !labelKey && typeof label === 'string'
151
- ? config[label as keyof typeof config]?.label || label
152
- : itemConfig?.label
153
-
154
- if (labelFormatter) {
155
- return (
156
- <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>
157
- )
158
- }
159
-
160
- if (!value) {
161
- return null
162
- }
163
-
164
- return <div className={cn('font-medium', labelClassName)}>{value}</div>
165
- }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey])
166
-
167
- if (!active || !payload?.length) {
98
+ function ChartTooltipContent({
99
+ active,
100
+ payload,
101
+ className,
102
+ indicator = 'dot',
103
+ hideLabel = false,
104
+ hideIndicator = false,
105
+ label,
106
+ labelFormatter,
107
+ labelClassName,
108
+ formatter,
109
+ color,
110
+ nameKey,
111
+ labelKey
112
+ }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
113
+ React.ComponentProps<'div'> & {
114
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
115
+ active?: boolean
116
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
117
+ payload?: any[]
118
+ label?: string
119
+ labelFormatter?: (label: unknown, payload: unknown[]) => React.ReactNode
120
+ formatter?: (
121
+ value: unknown,
122
+ name: string,
123
+ item: unknown,
124
+ index: number,
125
+ payload: unknown[]
126
+ ) => React.ReactNode
127
+ hideLabel?: boolean
128
+ hideIndicator?: boolean
129
+ indicator?: 'line' | 'dot' | 'dashed'
130
+ nameKey?: string
131
+ labelKey?: string
132
+ }) {
133
+ const { config } = useChart()
134
+
135
+ const tooltipLabel = React.useMemo(() => {
136
+ if (hideLabel || !payload?.length) {
168
137
  return null
169
138
  }
170
139
 
171
- const nestLabel = payload.length === 1 && indicator !== 'dot'
172
-
173
- return (
174
- <div
175
- ref={ref}
176
- className={cn(
177
- 'grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',
178
- className
179
- )}
180
- >
181
- {!nestLabel ? tooltipLabel : null}
182
- <div className="grid gap-1.5">
183
- {payload
184
- .filter((item) => item.type !== 'none')
185
- .map((item, index) => {
186
- const key = `${nameKey || item.name || item.dataKey || 'value'}`
187
- const itemConfig = getPayloadConfigFromPayload(config, item, key)
188
- const indicatorColor = color || item.payload.fill || item.color
189
-
190
- return (
191
- <div
192
- key={item.dataKey}
193
- className={cn(
194
- 'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',
195
- indicator === 'dot' && 'items-center'
196
- )}
197
- >
198
- {formatter && item?.value !== undefined && item.name ? (
199
- formatter(item.value, item.name, item, index, item.payload)
200
- ) : (
201
- <>
202
- {itemConfig?.icon ? (
203
- <itemConfig.icon />
204
- ) : (
205
- !hideIndicator && (
206
- <div
207
- className={cn(
208
- 'shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]',
209
- {
210
- 'h-2.5 w-2.5': indicator === 'dot',
211
- 'w-1': indicator === 'line',
212
- 'w-0 border-[1.5px] border-dashed bg-transparent':
213
- indicator === 'dashed',
214
- 'my-0.5': nestLabel && indicator === 'dashed'
215
- }
216
- )}
217
- style={
218
- {
219
- '--color-bg': indicatorColor,
220
- '--color-border': indicatorColor
221
- } as React.CSSProperties
222
- }
223
- />
224
- )
225
- )}
226
- <div
227
- className={cn(
228
- 'flex flex-1 justify-between leading-none',
229
- nestLabel ? 'items-end' : 'items-center'
230
- )}
231
- >
232
- <div className="grid gap-1.5">
233
- {nestLabel ? tooltipLabel : null}
234
- <span className="text-muted-foreground">
235
- {itemConfig?.label || item.name}
236
- </span>
237
- </div>
238
- {item.value && (
239
- <span className="font-mono font-medium tabular-nums text-foreground">
240
- {item.value.toLocaleString()}
241
- </span>
242
- )}
243
- </div>
244
- </>
245
- )}
246
- </div>
247
- )
248
- })}
249
- </div>
250
- </div>
251
- )
252
- }
253
- )
254
- ChartTooltipContent.displayName = 'ChartTooltip'
140
+ const [item] = payload
141
+ const key = `${labelKey || item?.dataKey || item?.name || 'value'}`
142
+ const itemConfig = getPayloadConfigFromPayload(config, item, key)
143
+ const value =
144
+ !labelKey && typeof label === 'string'
145
+ ? config[label as keyof typeof config]?.label || label
146
+ : itemConfig?.label
147
+
148
+ if (labelFormatter) {
149
+ return (
150
+ <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>
151
+ )
152
+ }
255
153
 
256
- const ChartLegend = RechartsPrimitive.Legend
154
+ if (!value) {
155
+ return null
156
+ }
257
157
 
258
- interface ChartLegendContentProps extends React.HTMLAttributes<HTMLDivElement> {
259
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
260
- payload?: any[]
261
- verticalAlign?: 'top' | 'bottom' | 'middle'
262
- hideIcon?: boolean
263
- nameKey?: string
264
- }
158
+ return <div className={cn('font-medium', labelClassName)}>{value}</div>
159
+ }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey])
265
160
 
266
- const ChartLegendContent = React.forwardRef<HTMLDivElement, ChartLegendContentProps>(
267
- ({ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey }, ref) => {
268
- const { config } = useChart()
161
+ if (!active || !payload?.length) {
162
+ return null
163
+ }
269
164
 
270
- if (!payload?.length) {
271
- return null
272
- }
165
+ const nestLabel = payload.length === 1 && indicator !== 'dot'
273
166
 
274
- return (
275
- <div
276
- ref={ref}
277
- className={cn(
278
- 'flex items-center justify-center gap-4',
279
- verticalAlign === 'top' ? 'pb-3' : 'pt-3',
280
- className
281
- )}
282
- >
167
+ return (
168
+ <div
169
+ className={cn(
170
+ 'border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',
171
+ className
172
+ )}
173
+ >
174
+ {!nestLabel ? tooltipLabel : null}
175
+ <div className="grid gap-1.5">
283
176
  {payload
284
177
  .filter((item) => item.type !== 'none')
285
- .map((item) => {
286
- const key = `${nameKey || item.dataKey || 'value'}`
178
+ .map((item, index) => {
179
+ const key = `${nameKey || item.name || item.dataKey || 'value'}`
287
180
  const itemConfig = getPayloadConfigFromPayload(config, item, key)
181
+ const indicatorColor = color || item.payload.fill || item.color
288
182
 
289
183
  return (
290
184
  <div
291
- key={item.value}
185
+ key={item.dataKey}
292
186
  className={cn(
293
- 'flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground'
187
+ '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',
188
+ indicator === 'dot' && 'items-center'
294
189
  )}
295
190
  >
296
- {itemConfig?.icon && !hideIcon ? (
297
- <itemConfig.icon />
191
+ {formatter && item?.value !== undefined && item.name ? (
192
+ formatter(item.value, item.name, item, index, item.payload)
298
193
  ) : (
299
- <div
300
- className="h-2 w-2 shrink-0 rounded-[2px]"
301
- style={{
302
- backgroundColor: item.color
303
- }}
304
- />
194
+ <>
195
+ {itemConfig?.icon ? (
196
+ <itemConfig.icon />
197
+ ) : (
198
+ !hideIndicator && (
199
+ <div
200
+ className={cn(
201
+ 'shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)',
202
+ {
203
+ 'h-2.5 w-2.5': indicator === 'dot',
204
+ 'w-1': indicator === 'line',
205
+ 'w-0 border-[1.5px] border-dashed bg-transparent':
206
+ indicator === 'dashed',
207
+ 'my-0.5': nestLabel && indicator === 'dashed'
208
+ }
209
+ )}
210
+ style={
211
+ {
212
+ '--color-bg': indicatorColor,
213
+ '--color-border': indicatorColor
214
+ } as React.CSSProperties
215
+ }
216
+ />
217
+ )
218
+ )}
219
+ <div
220
+ className={cn(
221
+ 'flex flex-1 justify-between leading-none',
222
+ nestLabel ? 'items-end' : 'items-center'
223
+ )}
224
+ >
225
+ <div className="grid gap-1.5">
226
+ {nestLabel ? tooltipLabel : null}
227
+ <span className="text-muted-foreground">
228
+ {itemConfig?.label || item.name}
229
+ </span>
230
+ </div>
231
+ {item.value && (
232
+ <span className="text-foreground font-mono font-medium tabular-nums">
233
+ {item.value.toLocaleString()}
234
+ </span>
235
+ )}
236
+ </div>
237
+ </>
305
238
  )}
306
- {itemConfig?.label}
307
239
  </div>
308
240
  )
309
241
  })}
310
242
  </div>
311
- )
243
+ </div>
244
+ )
245
+ }
246
+
247
+ const ChartLegend = RechartsPrimitive.Legend
248
+
249
+ function ChartLegendContent({
250
+ className,
251
+ hideIcon = false,
252
+ payload,
253
+ verticalAlign = 'bottom',
254
+ nameKey
255
+ }: React.ComponentProps<'div'> & {
256
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
257
+ payload?: any[]
258
+ verticalAlign?: 'top' | 'bottom' | 'middle'
259
+ hideIcon?: boolean
260
+ nameKey?: string
261
+ }) {
262
+ const { config } = useChart()
263
+
264
+ if (!payload?.length) {
265
+ return null
312
266
  }
313
- )
314
- ChartLegendContent.displayName = 'ChartLegend'
315
267
 
316
- // Helper to extract item config from a payload.
268
+ return (
269
+ <div
270
+ className={cn(
271
+ 'flex items-center justify-center gap-4',
272
+ verticalAlign === 'top' ? 'pb-3' : 'pt-3',
273
+ className
274
+ )}
275
+ >
276
+ {payload
277
+ .filter((item) => item.type !== 'none')
278
+ .map((item) => {
279
+ const key = `${nameKey || item.dataKey || 'value'}`
280
+ const itemConfig = getPayloadConfigFromPayload(config, item, key)
281
+
282
+ return (
283
+ <div
284
+ key={item.value}
285
+ className={cn(
286
+ '[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3'
287
+ )}
288
+ >
289
+ {itemConfig?.icon && !hideIcon ? (
290
+ <itemConfig.icon />
291
+ ) : (
292
+ <div
293
+ className="h-2 w-2 shrink-0 rounded-[2px]"
294
+ style={{
295
+ backgroundColor: item.color
296
+ }}
297
+ />
298
+ )}
299
+ {itemConfig?.label}
300
+ </div>
301
+ )
302
+ })}
303
+ </div>
304
+ )
305
+ }
306
+
317
307
  function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {
318
308
  if (typeof payload !== 'object' || payload === null) {
319
309
  return undefined
@@ -1,27 +1,28 @@
1
1
  'use client'
2
2
 
3
3
  import { cn } from '@cms/utils/cn'
4
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
5
4
  import { Check } from 'lucide-react'
6
- import * as React from 'react'
5
+ import { Checkbox as CheckboxPrimitive } from 'radix-ui'
6
+ import type * as React from 'react'
7
7
 
8
- const Checkbox = React.forwardRef<
9
- React.ElementRef<typeof CheckboxPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
11
- >(({ className, ...props }, ref) => (
12
- <CheckboxPrimitive.Root
13
- ref={ref}
14
- className={cn(
15
- 'grid place-content-center peer size-5 shrink-0 rounded-sm border border-input-border-border bg-input focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
16
- className
17
- )}
18
- {...props}
19
- >
20
- <CheckboxPrimitive.Indicator className={cn('grid place-content-center text-current')}>
21
- <Check className="size-3.5" />
22
- </CheckboxPrimitive.Indicator>
23
- </CheckboxPrimitive.Root>
24
- ))
25
- Checkbox.displayName = CheckboxPrimitive.Root.displayName
8
+ function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
9
+ return (
10
+ <CheckboxPrimitive.Root
11
+ data-slot="checkbox"
12
+ className={cn(
13
+ 'border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3',
14
+ className
15
+ )}
16
+ {...props}
17
+ >
18
+ <CheckboxPrimitive.Indicator
19
+ data-slot="checkbox-indicator"
20
+ className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
21
+ >
22
+ <Check />
23
+ </CheckboxPrimitive.Indicator>
24
+ </CheckboxPrimitive.Root>
25
+ )
26
+ }
26
27
 
27
28
  export { Checkbox }
@@ -1,11 +1,21 @@
1
1
  'use client'
2
2
 
3
- import * as CollapsiblePrimitive from '@radix-ui/react-collapsible'
3
+ import { Collapsible as CollapsiblePrimitive } from 'radix-ui'
4
4
 
5
- const Collapsible = CollapsiblePrimitive.Root
5
+ function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
6
+ return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
7
+ }
6
8
 
7
- const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
9
+ function CollapsibleTrigger({
10
+ ...props
11
+ }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
12
+ return <CollapsiblePrimitive.CollapsibleTrigger data-slot="collapsible-trigger" {...props} />
13
+ }
8
14
 
9
- const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
15
+ function CollapsibleContent({
16
+ ...props
17
+ }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
18
+ return <CollapsiblePrimitive.CollapsibleContent data-slot="collapsible-content" {...props} />
19
+ }
10
20
 
11
21
  export { Collapsible, CollapsibleTrigger, CollapsibleContent }