@betterstart/cli 0.1.28 → 0.1.29
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.
- package/dist/{chunk-SAPJG4NO.js → chunk-6JCWMKSY.js} +7 -4
- package/dist/{chunk-SAPJG4NO.js.map → chunk-6JCWMKSY.js.map} +1 -1
- package/dist/cli.js +742 -869
- package/dist/cli.js.map +1 -1
- package/dist/drizzle-config-EDKOEZ6G.js +7 -0
- package/package.json +1 -1
- package/templates/ui/accordion.tsx +73 -42
- package/templates/ui/alert-dialog.tsx +155 -90
- package/templates/ui/alert.tsx +46 -26
- package/templates/ui/aspect-ratio.tsx +4 -2
- package/templates/ui/avatar.tsx +92 -43
- package/templates/ui/badge.tsx +27 -12
- package/templates/ui/breadcrumb.tsx +63 -60
- package/templates/ui/button-group.tsx +8 -8
- package/templates/ui/button.tsx +44 -26
- package/templates/ui/calendar.tsx +43 -34
- package/templates/ui/card.tsx +71 -34
- package/templates/ui/carousel.tsx +111 -115
- package/templates/ui/chart.tsx +197 -207
- package/templates/ui/checkbox.tsx +21 -20
- package/templates/ui/collapsible.tsx +14 -4
- package/templates/ui/combobox.tsx +272 -0
- package/templates/ui/command.tsx +139 -101
- package/templates/ui/context-menu.tsx +214 -156
- package/templates/ui/dialog.tsx +118 -77
- package/templates/ui/direction.tsx +20 -0
- package/templates/ui/drawer.tsx +89 -69
- package/templates/ui/dropdown-menu.tsx +228 -164
- package/templates/ui/empty.tsx +8 -5
- package/templates/ui/field.tsx +25 -32
- package/templates/ui/hover-card.tsx +29 -20
- package/templates/ui/input-group.tsx +20 -37
- package/templates/ui/input-otp.tsx +57 -42
- package/templates/ui/input.tsx +14 -17
- package/templates/ui/item.tsx +27 -17
- package/templates/ui/kbd.tsx +1 -3
- package/templates/ui/label.tsx +14 -14
- package/templates/ui/markdown-editor.tsx +1 -1
- package/templates/ui/menubar.tsx +220 -188
- package/templates/ui/native-select.tsx +42 -0
- package/templates/ui/navigation-menu.tsx +130 -90
- package/templates/ui/pagination.tsx +88 -73
- package/templates/ui/popover.tsx +67 -26
- package/templates/ui/progress.tsx +24 -18
- package/templates/ui/radio-group.tsx +26 -20
- package/templates/ui/resizable.tsx +29 -29
- package/templates/ui/scroll-area.tsx +47 -38
- package/templates/ui/select.tsx +158 -125
- package/templates/ui/separator.tsx +21 -19
- package/templates/ui/sheet.tsx +104 -95
- package/templates/ui/sidebar.tsx +77 -183
- package/templates/ui/skeleton.tsx +8 -2
- package/templates/ui/slider.tsx +46 -17
- package/templates/ui/sonner.tsx +19 -9
- package/templates/ui/spinner.tsx +2 -2
- package/templates/ui/switch.tsx +24 -20
- package/templates/ui/table.tsx +68 -73
- package/templates/ui/tabs.tsx +71 -46
- package/templates/ui/textarea.tsx +13 -16
- package/templates/ui/toggle-group.tsx +57 -28
- package/templates/ui/toggle.tsx +21 -20
- package/templates/ui/tooltip.tsx +44 -23
- package/dist/drizzle-config-KISB26BA.js +0 -7
- package/templates/ui/use-mobile.tsx +0 -19
- /package/dist/{drizzle-config-KISB26BA.js.map → drizzle-config-EDKOEZ6G.js.map} +0 -0
package/templates/ui/chart.tsx
CHANGED
|
@@ -33,23 +33,26 @@ function useChart() {
|
|
|
33
33
|
return context
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
"
|
|
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
|
-
|
|
97
|
-
active
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
{
|
|
182
|
-
|
|
183
|
-
|
|
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
|
-
|
|
154
|
+
if (!value) {
|
|
155
|
+
return null
|
|
156
|
+
}
|
|
257
157
|
|
|
258
|
-
|
|
259
|
-
|
|
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
|
-
|
|
267
|
-
|
|
268
|
-
|
|
161
|
+
if (!active || !payload?.length) {
|
|
162
|
+
return null
|
|
163
|
+
}
|
|
269
164
|
|
|
270
|
-
|
|
271
|
-
return null
|
|
272
|
-
}
|
|
165
|
+
const nestLabel = payload.length === 1 && indicator !== 'dot'
|
|
273
166
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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.
|
|
185
|
+
key={item.dataKey}
|
|
292
186
|
className={cn(
|
|
293
|
-
'flex items-
|
|
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
|
-
{
|
|
297
|
-
|
|
191
|
+
{formatter && item?.value !== undefined && item.name ? (
|
|
192
|
+
formatter(item.value, item.name, item, index, item.payload)
|
|
298
193
|
) : (
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
-
|
|
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
|
|
5
|
+
import { Checkbox as CheckboxPrimitive } from 'radix-ui'
|
|
6
|
+
import type * as React from 'react'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
3
|
+
import { Collapsible as CollapsiblePrimitive } from 'radix-ui'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
6
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
|
7
|
+
}
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
function CollapsibleTrigger({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
12
|
+
return <CollapsiblePrimitive.CollapsibleTrigger data-slot="collapsible-trigger" {...props} />
|
|
13
|
+
}
|
|
8
14
|
|
|
9
|
-
|
|
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 }
|