@dinachi/cli 1.0.0 → 1.1.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.
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/templates/accordion/accordion.tsx +5 -1
- package/templates/alert-dialog/alert-dialog.tsx +14 -3
- package/templates/animated-icon/animated-icon.tsx +1 -0
- package/templates/animated-list/animated-list.tsx +2 -1
- package/templates/animated-tabs/animated-tabs.tsx +4 -0
- package/templates/autocomplete/autocomplete.tsx +14 -3
- package/templates/avatar/avatar.tsx +3 -0
- package/templates/badge/badge.tsx +1 -0
- package/templates/button/button.tsx +1 -0
- package/templates/card/card.tsx +6 -1
- package/templates/carousel/carousel.tsx +7 -0
- package/templates/checkbox/checkbox.tsx +1 -0
- package/templates/checkbox-group/checkbox-group.tsx +1 -0
- package/templates/collapsible/collapsible.tsx +3 -1
- package/templates/combobox/combobox.tsx +15 -3
- package/templates/compare-slider/compare-slider.tsx +1 -0
- package/templates/context-menu/context-menu.tsx +61 -14
- package/templates/dialog/dialog.tsx +13 -3
- package/templates/drawer/drawer.tsx +19 -6
- package/templates/expandable-card/expandable-card.tsx +5 -1
- package/templates/field/field.tsx +5 -1
- package/templates/fieldset/fieldset.tsx +2 -0
- package/templates/form/form.tsx +1 -0
- package/templates/hold-to-confirm/hold-to-confirm.tsx +1 -0
- package/templates/input/input.tsx +1 -0
- package/templates/label/label.tsx +1 -0
- package/templates/link/link.tsx +1 -0
- package/templates/load-transition/load-transition.tsx +1 -0
- package/templates/marquee/marquee.tsx +1 -0
- package/templates/menu/menu.tsx +19 -3
- package/templates/menubar/menubar.tsx +15 -3
- package/templates/meter/meter.tsx +5 -1
- package/templates/navigation-menu/navigation-menu.tsx +13 -2
- package/templates/number-field/number-field.tsx +7 -1
- package/templates/number-ticker/number-ticker.tsx +3 -0
- package/templates/otp-field/otp-field.tsx +4 -0
- package/templates/popover/popover.tsx +19 -5
- package/templates/preview-card/preview-card.tsx +11 -3
- package/templates/progress/progress.tsx +5 -1
- package/templates/progress-ring/progress-ring.tsx +1 -0
- package/templates/radio/radio.tsx +3 -0
- package/templates/scroll-area/scroll-area.tsx +14 -4
- package/templates/scroll-progress/scroll-progress.tsx +1 -0
- package/templates/scroll-reveal/scroll-reveal.tsx +1 -0
- package/templates/select/select.tsx +18 -2
- package/templates/separator/separator.tsx +1 -0
- package/templates/skeleton/skeleton.tsx +1 -0
- package/templates/slider/slider.tsx +7 -0
- package/templates/sortable/sortable.tsx +3 -0
- package/templates/stagger-list/stagger-list.tsx +2 -0
- package/templates/streaming-text/streaming-text.tsx +1 -0
- package/templates/swipeable-row/swipeable-row.tsx +1 -0
- package/templates/switch/switch.tsx +2 -0
- package/templates/tabs/tabs.tsx +5 -0
- package/templates/text/text.tsx +1 -0
- package/templates/text-morph/text-morph.tsx +2 -0
- package/templates/text-shimmer/text-shimmer.tsx +1 -0
- package/templates/textarea/textarea.tsx +1 -0
- package/templates/toast/toast.tsx +10 -1
- package/templates/toggle/toggle.tsx +1 -0
- package/templates/toggle-group/toggle-group.tsx +2 -0
- package/templates/toolbar/toolbar.tsx +6 -0
- package/templates/tooltip/tooltip.tsx +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.1.0] - 2026-11-17
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Every exported part that renders an element carries `data-slot` with its
|
|
15
|
+
kebab-case name (`select-trigger`, `slider-thumb`), so styles, tests and agents
|
|
16
|
+
can target a part without a class name.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- `SelectGroup` and `SelectValue` are thin wrappers instead of re-exports of the
|
|
21
|
+
Base UI parts, so they can carry `data-slot`. Props are unchanged.
|
|
22
|
+
|
|
10
23
|
## [1.0.0] - 2026-11-15
|
|
11
24
|
|
|
12
25
|
### Added
|
|
@@ -327,6 +340,7 @@ Re-run `dinachi add select`, `dinachi add slider`, and `dinachi add otp-field`
|
|
|
327
340
|
See [git history](https://github.com/raymond-UI/dinachiUI/commits/main/packages/cli)
|
|
328
341
|
for changes prior to 0.9.0.
|
|
329
342
|
|
|
343
|
+
[1.1.0]: https://github.com/raymond-UI/dinachiUI/releases/tag/cli-v1.1.0
|
|
330
344
|
[1.0.0]: https://github.com/raymond-UI/dinachiUI/releases/tag/cli-v1.0.0
|
|
331
345
|
[0.12.0]: https://github.com/raymond-UI/dinachiUI/releases/tag/cli-v0.12.0
|
|
332
346
|
[0.11.0]: https://github.com/raymond-UI/dinachiUI/releases/tag/cli-v0.11.0
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@ const Accordion = React.forwardRef<
|
|
|
29
29
|
const agent = { value, multiple: Boolean(props.multiple), change };
|
|
30
30
|
return (
|
|
31
31
|
<AccordionAgentContext.Provider value={useHasAgent() ? agent : null}>
|
|
32
|
-
<BaseAccordion.Root ref={ref} data-agent-in={props["aria-label"]} className={cn(className)} {...props} value={value} onValueChange={change} />
|
|
32
|
+
<BaseAccordion.Root data-slot="accordion" ref={ref} data-agent-in={props["aria-label"]} className={cn(className)} {...props} value={value} onValueChange={change} />
|
|
33
33
|
</AccordionAgentContext.Provider>
|
|
34
34
|
);
|
|
35
35
|
});
|
|
@@ -67,6 +67,7 @@ const AccordionItem = React.forwardRef<
|
|
|
67
67
|
return (
|
|
68
68
|
<AccordionPartsContext.Provider value={root ? parts : null}>
|
|
69
69
|
<BaseAccordion.Item
|
|
70
|
+
data-slot="accordion-item"
|
|
70
71
|
ref={ref}
|
|
71
72
|
className={cn("border-b", className)}
|
|
72
73
|
value={value}
|
|
@@ -82,6 +83,7 @@ const AccordionHeader = React.forwardRef<
|
|
|
82
83
|
React.ComponentProps<typeof BaseAccordion.Header>
|
|
83
84
|
>(({ className, ...props }, ref) => (
|
|
84
85
|
<BaseAccordion.Header
|
|
86
|
+
data-slot="accordion-header"
|
|
85
87
|
ref={ref}
|
|
86
88
|
className={cn("flex", className)}
|
|
87
89
|
{...props}
|
|
@@ -96,6 +98,7 @@ const AccordionTrigger = React.forwardRef<
|
|
|
96
98
|
}
|
|
97
99
|
>(({ className, children, ...props }, ref) => (
|
|
98
100
|
<BaseAccordion.Trigger
|
|
101
|
+
data-slot="accordion-trigger"
|
|
99
102
|
ref={useMergedRef(ref, React.useContext(AccordionPartsContext)?.trigger)}
|
|
100
103
|
className={cn(
|
|
101
104
|
"flex flex-1 items-center justify-between py-4 font-medium transition-colors hover:underline",
|
|
@@ -116,6 +119,7 @@ const AccordionPanel = React.forwardRef<
|
|
|
116
119
|
React.ComponentProps<typeof BaseAccordion.Panel>
|
|
117
120
|
>(({ className, children, ...props }, ref) => (
|
|
118
121
|
<BaseAccordion.Panel
|
|
122
|
+
data-slot="accordion-panel"
|
|
119
123
|
ref={useMergedRef(ref, React.useContext(AccordionPartsContext)?.panel)}
|
|
120
124
|
className={cn(
|
|
121
125
|
"overflow-hidden text-sm h-[var(--accordion-panel-height)]",
|
|
@@ -22,9 +22,11 @@ function AlertDialog<Payload>({ open, defaultOpen, onOpenChange, ...props }: Bas
|
|
|
22
22
|
|
|
23
23
|
function AlertDialogTrigger<Payload>({ ref, ...props }: BaseAlertDialog.Trigger.Props<Payload> & React.RefAttributes<HTMLElement>) {
|
|
24
24
|
const parts = React.useContext(AlertDialogAgentContext)
|
|
25
|
-
return <BaseAlertDialog.Trigger<Payload> ref={useMergedRef(ref, parts?.trigger)} {...props} />
|
|
25
|
+
return <BaseAlertDialog.Trigger<Payload> ref={useMergedRef(ref, parts?.trigger)} data-slot="alert-dialog-trigger" {...props} />
|
|
26
|
+
}
|
|
27
|
+
function AlertDialogPortal(props: React.ComponentProps<typeof BaseAlertDialog.Portal>) {
|
|
28
|
+
return <BaseAlertDialog.Portal data-slot="alert-dialog-portal" {...props} />
|
|
26
29
|
}
|
|
27
|
-
const AlertDialogPortal = BaseAlertDialog.Portal
|
|
28
30
|
|
|
29
31
|
const AlertDialogBackdrop = React.forwardRef<
|
|
30
32
|
HTMLDivElement,
|
|
@@ -39,6 +41,7 @@ const AlertDialogBackdrop = React.forwardRef<
|
|
|
39
41
|
"data-[ending-style]:duration-[var(--motion-duration-fast,150ms)]",
|
|
40
42
|
className
|
|
41
43
|
)}
|
|
44
|
+
data-slot="alert-dialog-backdrop"
|
|
42
45
|
{...props}
|
|
43
46
|
/>
|
|
44
47
|
))
|
|
@@ -54,6 +57,7 @@ const AlertDialogViewport = React.forwardRef<
|
|
|
54
57
|
"fixed inset-0 z-50 flex items-center justify-center overflow-auto",
|
|
55
58
|
className
|
|
56
59
|
)}
|
|
60
|
+
data-slot="alert-dialog-viewport"
|
|
57
61
|
{...props}
|
|
58
62
|
/>
|
|
59
63
|
))
|
|
@@ -78,6 +82,7 @@ const AlertDialogPopup = React.forwardRef<
|
|
|
78
82
|
"data-[ending-style]:duration-[var(--motion-duration-fast,150ms)]",
|
|
79
83
|
className
|
|
80
84
|
)}
|
|
85
|
+
data-slot="alert-dialog-popup"
|
|
81
86
|
{...props}
|
|
82
87
|
/>
|
|
83
88
|
))
|
|
@@ -90,6 +95,7 @@ const AlertDialogTitle = React.forwardRef<
|
|
|
90
95
|
<BaseAlertDialog.Title
|
|
91
96
|
ref={ref}
|
|
92
97
|
className={cn("text-lg font-medium leading-none tracking-tight", className)}
|
|
98
|
+
data-slot="alert-dialog-title"
|
|
93
99
|
{...props}
|
|
94
100
|
/>
|
|
95
101
|
))
|
|
@@ -102,6 +108,7 @@ const AlertDialogDescription = React.forwardRef<
|
|
|
102
108
|
<BaseAlertDialog.Description
|
|
103
109
|
ref={ref}
|
|
104
110
|
className={cn("text-sm text-muted-foreground", className)}
|
|
111
|
+
data-slot="alert-dialog-description"
|
|
105
112
|
{...props}
|
|
106
113
|
/>
|
|
107
114
|
))
|
|
@@ -124,6 +131,7 @@ const AlertDialogAction = React.forwardRef<
|
|
|
124
131
|
className,
|
|
125
132
|
)
|
|
126
133
|
}
|
|
134
|
+
data-slot="alert-dialog-action"
|
|
127
135
|
{...props}
|
|
128
136
|
/>
|
|
129
137
|
))
|
|
@@ -147,6 +155,7 @@ const AlertDialogCancel = React.forwardRef<
|
|
|
147
155
|
className,
|
|
148
156
|
)
|
|
149
157
|
}
|
|
158
|
+
data-slot="alert-dialog-cancel"
|
|
150
159
|
{...props}
|
|
151
160
|
/>
|
|
152
161
|
))
|
|
@@ -161,6 +170,7 @@ const AlertDialogHeader = ({
|
|
|
161
170
|
"flex flex-col space-y-2 text-center sm:text-left",
|
|
162
171
|
className
|
|
163
172
|
)}
|
|
173
|
+
data-slot="alert-dialog-header"
|
|
164
174
|
{...props}
|
|
165
175
|
/>
|
|
166
176
|
)
|
|
@@ -175,6 +185,7 @@ const AlertDialogFooter = ({
|
|
|
175
185
|
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end mt-1.5",
|
|
176
186
|
className
|
|
177
187
|
)}
|
|
188
|
+
data-slot="alert-dialog-footer"
|
|
178
189
|
{...props}
|
|
179
190
|
/>
|
|
180
191
|
)
|
|
@@ -187,7 +198,7 @@ const AlertDialogContent = React.forwardRef<
|
|
|
187
198
|
<AlertDialogPortal>
|
|
188
199
|
<AlertDialogBackdrop />
|
|
189
200
|
<AlertDialogViewport>
|
|
190
|
-
<AlertDialogPopup ref={ref} className={className} {...props}>
|
|
201
|
+
<AlertDialogPopup ref={ref} className={className} data-slot="alert-dialog-content" {...props}>
|
|
191
202
|
{children}
|
|
192
203
|
</AlertDialogPopup>
|
|
193
204
|
</AlertDialogViewport>
|
|
@@ -118,6 +118,7 @@ const AnimatedIcon = React.forwardRef<HTMLSpanElement, AnimatedIconProps>(
|
|
|
118
118
|
// `flip` turns around an axis in the plane of the screen, which is a rotation you
|
|
119
119
|
// cannot see without a vanishing point. The others do not need one.
|
|
120
120
|
style={mode === "flip" ? { perspective: 400, ...style } : style}
|
|
121
|
+
data-slot="animated-icon"
|
|
121
122
|
{...props}
|
|
122
123
|
>
|
|
123
124
|
{/* `initial={false}` so the icon is simply present on first paint. An entrance on
|
|
@@ -85,7 +85,7 @@ const AnimatedList = React.forwardRef<HTMLUListElement, AnimatedListProps>(
|
|
|
85
85
|
|
|
86
86
|
return (
|
|
87
87
|
<AnimatedListContext.Provider value={context}>
|
|
88
|
-
<ul ref={ref} className={cn("list-none", className)} {...props}>
|
|
88
|
+
<ul ref={ref} className={cn("list-none", className)} data-slot="animated-list" {...props}>
|
|
89
89
|
<AnimatePresence mode="popLayout" initial={false} custom={dismissed}>
|
|
90
90
|
{children}
|
|
91
91
|
</AnimatePresence>
|
|
@@ -149,6 +149,7 @@ const AnimatedListItem = React.forwardRef<HTMLLIElement, AnimatedListItemProps>(
|
|
|
149
149
|
// for a spring to settle.
|
|
150
150
|
default: { duration: reducedMotion ? 0.2 : duration, ease: EASE_OUT },
|
|
151
151
|
}}
|
|
152
|
+
data-slot="animated-list-item"
|
|
152
153
|
{...props}
|
|
153
154
|
>
|
|
154
155
|
{children}
|
|
@@ -191,6 +191,7 @@ const AnimatedTabs = React.forwardRef<
|
|
|
191
191
|
defaultValue={defaultValue}
|
|
192
192
|
onValueChange={handleValueChange}
|
|
193
193
|
className={cn("w-full", className)}
|
|
194
|
+
data-slot="animated-tabs"
|
|
194
195
|
{...props}
|
|
195
196
|
>
|
|
196
197
|
{children}
|
|
@@ -213,6 +214,7 @@ const AnimatedTabsList = React.forwardRef<
|
|
|
213
214
|
"relative inline-flex items-center gap-0.5 rounded-full bg-muted p-1",
|
|
214
215
|
className
|
|
215
216
|
)}
|
|
217
|
+
data-slot="animated-tabs-list"
|
|
216
218
|
{...props}
|
|
217
219
|
/>
|
|
218
220
|
))
|
|
@@ -252,6 +254,7 @@ const AnimatedTabsTrigger = React.forwardRef<
|
|
|
252
254
|
"[&:not([data-active])]:hover:text-foreground",
|
|
253
255
|
className
|
|
254
256
|
)}
|
|
257
|
+
data-slot="animated-tabs-trigger"
|
|
255
258
|
{...props}
|
|
256
259
|
>
|
|
257
260
|
{isActive && (
|
|
@@ -289,6 +292,7 @@ const AnimatedTabsContent = React.forwardRef<
|
|
|
289
292
|
"mt-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
290
293
|
className
|
|
291
294
|
)}
|
|
295
|
+
data-slot="animated-tabs-content"
|
|
292
296
|
{...props}
|
|
293
297
|
>
|
|
294
298
|
{children}
|
|
@@ -151,13 +151,16 @@ const Autocomplete = AutocompleteRoot as unknown as typeof AutocompletePrimitive
|
|
|
151
151
|
const AutocompleteValue = AutocompletePrimitive.Value
|
|
152
152
|
const AutocompleteCollection = AutocompletePrimitive.Collection
|
|
153
153
|
const AutocompletePortal = AutocompletePrimitive.Portal
|
|
154
|
-
|
|
154
|
+
function AutocompleteInputGroup(props: React.ComponentProps<typeof AutocompletePrimitive.InputGroup>) {
|
|
155
|
+
return <AutocompletePrimitive.InputGroup data-slot="autocomplete-input-group" {...props} />
|
|
156
|
+
}
|
|
155
157
|
|
|
156
158
|
const AutocompleteInput = React.forwardRef<
|
|
157
159
|
React.ComponentRef<typeof AutocompletePrimitive.Input>,
|
|
158
160
|
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.Input>
|
|
159
161
|
>(({ className, ...props }, ref) => (
|
|
160
162
|
<AutocompletePrimitive.Input
|
|
163
|
+
data-slot="autocomplete-input"
|
|
161
164
|
ref={useMergedRef(ref, React.useContext(AutocompleteAgentContext)?.input)}
|
|
162
165
|
className={cn(
|
|
163
166
|
"flex h-10 w-full bg-transparent px-3 py-2 text-sm",
|
|
@@ -176,6 +179,7 @@ const AutocompleteTrigger = React.forwardRef<
|
|
|
176
179
|
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.Trigger>
|
|
177
180
|
>(({ className, children, ...props }, ref) => (
|
|
178
181
|
<AutocompletePrimitive.Trigger
|
|
182
|
+
data-slot="autocomplete-trigger"
|
|
179
183
|
ref={ref}
|
|
180
184
|
className={cn(
|
|
181
185
|
"inline-flex h-10 items-center justify-center px-3",
|
|
@@ -199,6 +203,7 @@ const AutocompleteClear = React.forwardRef<
|
|
|
199
203
|
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.Clear>
|
|
200
204
|
>(({ className, children, ...props }, ref) => (
|
|
201
205
|
<AutocompletePrimitive.Clear
|
|
206
|
+
data-slot="autocomplete-clear"
|
|
202
207
|
ref={ref}
|
|
203
208
|
className={cn(
|
|
204
209
|
"inline-flex h-8 w-8 items-center justify-center rounded-sm text-muted-foreground",
|
|
@@ -221,6 +226,7 @@ const AutocompleteContent = React.forwardRef<
|
|
|
221
226
|
const content = (
|
|
222
227
|
<AutocompletePrimitive.Positioner sideOffset={4}>
|
|
223
228
|
<AutocompletePrimitive.Popup
|
|
229
|
+
data-slot="autocomplete-content"
|
|
224
230
|
ref={ref}
|
|
225
231
|
className={cn(
|
|
226
232
|
"relative z-50 min-w-[var(--anchor-width)] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
@@ -247,6 +253,7 @@ const AutocompleteList = React.forwardRef<
|
|
|
247
253
|
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.List>
|
|
248
254
|
>(({ className, ...props }, ref) => (
|
|
249
255
|
<AutocompletePrimitive.List
|
|
256
|
+
data-slot="autocomplete-list"
|
|
250
257
|
ref={useMergedRef(ref, React.useContext(AutocompleteAgentContext)?.list)}
|
|
251
258
|
className={cn("max-h-80 overflow-y-auto p-1", className)}
|
|
252
259
|
{...props}
|
|
@@ -274,6 +281,7 @@ const AutocompleteItem = React.forwardRef<
|
|
|
274
281
|
|
|
275
282
|
return (
|
|
276
283
|
<AutocompletePrimitive.Item
|
|
284
|
+
data-slot="autocomplete-item"
|
|
277
285
|
ref={useMergedRef(ref, element)}
|
|
278
286
|
className={cn(
|
|
279
287
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm lg:text-base outline-none",
|
|
@@ -294,7 +302,7 @@ const AutocompleteGroup = React.forwardRef<
|
|
|
294
302
|
React.ComponentRef<typeof AutocompletePrimitive.Group>,
|
|
295
303
|
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.Group>
|
|
296
304
|
>(({ className, ...props }, ref) => (
|
|
297
|
-
<AutocompletePrimitive.Group ref={ref} className={cn(className)} {...props} />
|
|
305
|
+
<AutocompletePrimitive.Group data-slot="autocomplete-group" ref={ref} className={cn(className)} {...props} />
|
|
298
306
|
))
|
|
299
307
|
AutocompleteGroup.displayName = "AutocompleteGroup"
|
|
300
308
|
|
|
@@ -303,6 +311,7 @@ const AutocompleteGroupLabel = React.forwardRef<
|
|
|
303
311
|
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.GroupLabel>
|
|
304
312
|
>(({ className, ...props }, ref) => (
|
|
305
313
|
<AutocompletePrimitive.GroupLabel
|
|
314
|
+
data-slot="autocomplete-group-label"
|
|
306
315
|
ref={ref}
|
|
307
316
|
className={cn("px-2 py-1.5 text-xs font-medium text-muted-foreground", className)}
|
|
308
317
|
{...props}
|
|
@@ -315,6 +324,7 @@ const AutocompleteEmpty = React.forwardRef<
|
|
|
315
324
|
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.Empty>
|
|
316
325
|
>(({ className, ...props }, ref) => (
|
|
317
326
|
<AutocompletePrimitive.Empty
|
|
327
|
+
data-slot="autocomplete-empty"
|
|
318
328
|
ref={ref}
|
|
319
329
|
className={cn("p-2 text-center text-sm text-muted-foreground", className)}
|
|
320
330
|
{...props}
|
|
@@ -326,7 +336,7 @@ const AutocompleteStatus = React.forwardRef<
|
|
|
326
336
|
React.ComponentRef<typeof AutocompletePrimitive.Status>,
|
|
327
337
|
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.Status>
|
|
328
338
|
>(({ className, ...props }, ref) => (
|
|
329
|
-
<AutocompletePrimitive.Status ref={ref} className={cn("sr-only", className)} {...props} />
|
|
339
|
+
<AutocompletePrimitive.Status data-slot="autocomplete-status" ref={ref} className={cn("sr-only", className)} {...props} />
|
|
330
340
|
))
|
|
331
341
|
AutocompleteStatus.displayName = "AutocompleteStatus"
|
|
332
342
|
|
|
@@ -335,6 +345,7 @@ const AutocompleteSeparator = React.forwardRef<
|
|
|
335
345
|
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.Separator>
|
|
336
346
|
>(({ className, ...props }, ref) => (
|
|
337
347
|
<AutocompletePrimitive.Separator
|
|
348
|
+
data-slot="autocomplete-separator"
|
|
338
349
|
ref={ref}
|
|
339
350
|
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
340
351
|
{...props}
|
|
@@ -25,6 +25,7 @@ const Avatar = React.forwardRef<
|
|
|
25
25
|
VariantProps<typeof avatarVariants>
|
|
26
26
|
>(({ className, size, ...props }, ref) => (
|
|
27
27
|
<BaseAvatar.Root
|
|
28
|
+
data-slot="avatar"
|
|
28
29
|
ref={ref}
|
|
29
30
|
className={cn(avatarVariants({ size }), className)}
|
|
30
31
|
{...props}
|
|
@@ -37,6 +38,7 @@ const AvatarImage = React.forwardRef<
|
|
|
37
38
|
React.ComponentPropsWithoutRef<typeof BaseAvatar.Image>
|
|
38
39
|
>(({ className, ...props }, ref) => (
|
|
39
40
|
<BaseAvatar.Image
|
|
41
|
+
data-slot="avatar-image"
|
|
40
42
|
ref={ref}
|
|
41
43
|
className={cn(
|
|
42
44
|
"absolute inset-0 z-[1] aspect-square h-full w-full object-cover data-[error]:invisible data-[loading]:invisible",
|
|
@@ -52,6 +54,7 @@ const AvatarFallback = React.forwardRef<
|
|
|
52
54
|
React.ComponentPropsWithoutRef<typeof BaseAvatar.Fallback>
|
|
53
55
|
>(({ className, ...props }, ref) => (
|
|
54
56
|
<BaseAvatar.Fallback
|
|
57
|
+
data-slot="avatar-fallback"
|
|
55
58
|
ref={ref}
|
|
56
59
|
className={cn(
|
|
57
60
|
"absolute inset-0 flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
@@ -59,6 +59,7 @@ const Button = React.forwardRef<HTMLElement, ButtonProps>(
|
|
|
59
59
|
({ className, variant, size, render, nativeButton, ...props }, ref) => {
|
|
60
60
|
return (
|
|
61
61
|
<BaseButton
|
|
62
|
+
data-slot="button"
|
|
62
63
|
className={cn(buttonVariants({ variant, size, className }))}
|
|
63
64
|
ref={ref}
|
|
64
65
|
render={render}
|
package/templates/card/card.tsx
CHANGED
|
@@ -6,6 +6,7 @@ const Card = React.forwardRef<
|
|
|
6
6
|
React.HTMLAttributes<HTMLDivElement>
|
|
7
7
|
>(({ className, ...props }, ref) => (
|
|
8
8
|
<div
|
|
9
|
+
data-slot="card"
|
|
9
10
|
ref={ref}
|
|
10
11
|
className={cn(
|
|
11
12
|
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
@@ -21,6 +22,7 @@ const CardHeader = React.forwardRef<
|
|
|
21
22
|
React.HTMLAttributes<HTMLDivElement>
|
|
22
23
|
>(({ className, ...props }, ref) => (
|
|
23
24
|
<div
|
|
25
|
+
data-slot="card-header"
|
|
24
26
|
ref={ref}
|
|
25
27
|
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
|
26
28
|
{...props}
|
|
@@ -33,6 +35,7 @@ const CardTitle = React.forwardRef<
|
|
|
33
35
|
React.HTMLAttributes<HTMLHeadingElement>
|
|
34
36
|
>(({ className, ...props }, ref) => (
|
|
35
37
|
<h3
|
|
38
|
+
data-slot="card-title"
|
|
36
39
|
ref={ref}
|
|
37
40
|
className={cn(
|
|
38
41
|
"text-2xl font-medium leading-none tracking-tight",
|
|
@@ -48,6 +51,7 @@ const CardDescription = React.forwardRef<
|
|
|
48
51
|
React.HTMLAttributes<HTMLParagraphElement>
|
|
49
52
|
>(({ className, ...props }, ref) => (
|
|
50
53
|
<p
|
|
54
|
+
data-slot="card-description"
|
|
51
55
|
ref={ref}
|
|
52
56
|
className={cn("text-sm text-muted-foreground", className)}
|
|
53
57
|
{...props}
|
|
@@ -59,7 +63,7 @@ const CardContent = React.forwardRef<
|
|
|
59
63
|
HTMLDivElement,
|
|
60
64
|
React.HTMLAttributes<HTMLDivElement>
|
|
61
65
|
>(({ className, ...props }, ref) => (
|
|
62
|
-
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
66
|
+
<div data-slot="card-content" ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
63
67
|
))
|
|
64
68
|
CardContent.displayName = "CardContent"
|
|
65
69
|
|
|
@@ -68,6 +72,7 @@ const CardFooter = React.forwardRef<
|
|
|
68
72
|
React.HTMLAttributes<HTMLDivElement>
|
|
69
73
|
>(({ className, ...props }, ref) => (
|
|
70
74
|
<div
|
|
75
|
+
data-slot="card-footer"
|
|
71
76
|
ref={ref}
|
|
72
77
|
className={cn("flex items-center p-6 pt-0", className)}
|
|
73
78
|
{...props}
|
|
@@ -255,6 +255,7 @@ const Carousel = React.forwardRef<HTMLDivElement, CarouselProps>(
|
|
|
255
255
|
aria-label={label}
|
|
256
256
|
data-disabled={disabled ? "" : undefined}
|
|
257
257
|
className={cn("space-y-4", className)}
|
|
258
|
+
data-slot="carousel"
|
|
258
259
|
{...props}
|
|
259
260
|
>
|
|
260
261
|
{children}
|
|
@@ -343,6 +344,7 @@ const CarouselViewport = React.forwardRef<HTMLDivElement, CarouselViewportProps>
|
|
|
343
344
|
disabled ? "overflow-x-hidden" : "overflow-x-auto",
|
|
344
345
|
className
|
|
345
346
|
)}
|
|
347
|
+
data-slot="carousel-viewport"
|
|
346
348
|
{...props}
|
|
347
349
|
>
|
|
348
350
|
{positioned}
|
|
@@ -363,6 +365,7 @@ const CarouselViewport = React.forwardRef<HTMLDivElement, CarouselViewportProps>
|
|
|
363
365
|
<div
|
|
364
366
|
ref={mergeRefs(ref, scroller)}
|
|
365
367
|
className={cn("overflow-hidden", className)}
|
|
368
|
+
data-slot="carousel-viewport"
|
|
366
369
|
{...props}
|
|
367
370
|
>
|
|
368
371
|
<motion.div
|
|
@@ -410,6 +413,7 @@ const CarouselSlide = React.forwardRef<HTMLDivElement, CarouselSlideProps>(
|
|
|
410
413
|
aria-roledescription="slide"
|
|
411
414
|
aria-label={label ? `${counted}: ${label}` : counted}
|
|
412
415
|
className={cn("w-[72%] shrink-0 snap-start", className)}
|
|
416
|
+
data-slot="carousel-slide"
|
|
413
417
|
{...props}
|
|
414
418
|
/>
|
|
415
419
|
)
|
|
@@ -441,6 +445,7 @@ const CarouselDots = React.forwardRef<HTMLDivElement, CarouselDotsProps>(
|
|
|
441
445
|
role="group"
|
|
442
446
|
aria-label="Choose a slide"
|
|
443
447
|
className={cn("flex gap-1.5", className)}
|
|
448
|
+
data-slot="carousel-dots"
|
|
444
449
|
{...props}
|
|
445
450
|
>
|
|
446
451
|
{Array.from({ length: count }, (_, i) => (
|
|
@@ -482,6 +487,7 @@ const CarouselPrevious = React.forwardRef<HTMLButtonElement, CarouselArrowProps>
|
|
|
482
487
|
data-agent-part={usePart()}
|
|
483
488
|
onClick={(event) => goTo(index - 1, personChange("arrow-press", event.nativeEvent))}
|
|
484
489
|
className={cn(arrowClass, className)}
|
|
490
|
+
data-slot="carousel-previous"
|
|
485
491
|
{...props}
|
|
486
492
|
>
|
|
487
493
|
{children ?? <ChevronIcon direction="left" />}
|
|
@@ -504,6 +510,7 @@ const CarouselNext = React.forwardRef<HTMLButtonElement, CarouselArrowProps>(
|
|
|
504
510
|
data-agent-part={usePart()}
|
|
505
511
|
onClick={(event) => goTo(index + 1, personChange("arrow-press", event.nativeEvent))}
|
|
506
512
|
className={cn(arrowClass, className)}
|
|
513
|
+
data-slot="carousel-next"
|
|
507
514
|
{...props}
|
|
508
515
|
>
|
|
509
516
|
{children ?? <ChevronIcon direction="right" />}
|
|
@@ -63,6 +63,7 @@ const Checkbox = React.forwardRef<
|
|
|
63
63
|
<span className="relative inline-flex [&>input]:!absolute">
|
|
64
64
|
<BaseCheckbox.Root
|
|
65
65
|
ref={mergedRef}
|
|
66
|
+
data-slot="checkbox"
|
|
66
67
|
className={cn(
|
|
67
68
|
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
68
69
|
"data-[checked]:bg-primary data-[checked]:text-primary-foreground",
|
|
@@ -78,6 +78,7 @@ const CheckboxGroup = React.forwardRef<
|
|
|
78
78
|
<AgentGroupContext.Provider value={useHasAgent() ? agent : null}>
|
|
79
79
|
<BaseCheckboxGroup
|
|
80
80
|
ref={mergedRef}
|
|
81
|
+
data-slot="checkbox-group"
|
|
81
82
|
className={cn("flex flex-col items-start gap-1", className)}
|
|
82
83
|
{...props}
|
|
83
84
|
value={value}
|
|
@@ -15,7 +15,7 @@ const Collapsible = React.forwardRef<
|
|
|
15
15
|
const [state, change, parts] = useAgentOpen("disclosure", open, defaultOpen, onOpenChange)
|
|
16
16
|
return (
|
|
17
17
|
<CollapsibleAgentContext.Provider value={useHasAgent() ? parts : null}>
|
|
18
|
-
<BaseCollapsible.Root ref={ref} className={cn("w-full", className)} {...props} open={state} onOpenChange={change} />
|
|
18
|
+
<BaseCollapsible.Root data-slot="collapsible" ref={ref} className={cn("w-full", className)} {...props} open={state} onOpenChange={change} />
|
|
19
19
|
</CollapsibleAgentContext.Provider>
|
|
20
20
|
)
|
|
21
21
|
})
|
|
@@ -26,6 +26,7 @@ const CollapsibleTrigger = React.forwardRef<
|
|
|
26
26
|
React.ComponentPropsWithoutRef<typeof BaseCollapsible.Trigger>
|
|
27
27
|
>(({ className, ...props }, ref) => (
|
|
28
28
|
<BaseCollapsible.Trigger
|
|
29
|
+
data-slot="collapsible-trigger"
|
|
29
30
|
ref={useMergedRef(ref, React.useContext(CollapsibleAgentContext)?.trigger)}
|
|
30
31
|
className={cn(
|
|
31
32
|
"flex w-full items-center justify-between rounded-md p-4 font-medium transition-colors",
|
|
@@ -45,6 +46,7 @@ const CollapsiblePanel = React.forwardRef<
|
|
|
45
46
|
React.ComponentPropsWithoutRef<typeof BaseCollapsible.Panel>
|
|
46
47
|
>(({ className, ...props }, ref) => (
|
|
47
48
|
<BaseCollapsible.Panel
|
|
49
|
+
data-slot="collapsible-panel"
|
|
48
50
|
ref={ref}
|
|
49
51
|
className={cn(
|
|
50
52
|
"overflow-hidden text-sm h-[var(--collapsible-panel-height)]",
|
|
@@ -268,7 +268,9 @@ const Combobox = ComboboxRoot as unknown as typeof ComboboxPrimitive.Root
|
|
|
268
268
|
const ComboboxValue = ComboboxPrimitive.Value
|
|
269
269
|
const ComboboxCollection = ComboboxPrimitive.Collection
|
|
270
270
|
const ComboboxPortal = ComboboxPrimitive.Portal
|
|
271
|
-
|
|
271
|
+
function ComboboxInputGroup(props: React.ComponentProps<typeof ComboboxPrimitive.InputGroup>) {
|
|
272
|
+
return <ComboboxPrimitive.InputGroup data-slot="combobox-input-group" {...props} />
|
|
273
|
+
}
|
|
272
274
|
const createComboboxItems = ComboboxPrimitive.createItems
|
|
273
275
|
|
|
274
276
|
const ComboboxInput = React.forwardRef<
|
|
@@ -276,6 +278,7 @@ const ComboboxInput = React.forwardRef<
|
|
|
276
278
|
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Input>
|
|
277
279
|
>(({ className, ...props }, ref) => (
|
|
278
280
|
<ComboboxPrimitive.Input
|
|
281
|
+
data-slot="combobox-input"
|
|
279
282
|
ref={useMergedRef(ref, React.useContext(ComboboxAgentContext)?.input)}
|
|
280
283
|
className={cn(
|
|
281
284
|
"flex h-10 w-full bg-transparent px-3 py-2 text-sm",
|
|
@@ -294,6 +297,7 @@ const ComboboxTrigger = React.forwardRef<
|
|
|
294
297
|
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Trigger>
|
|
295
298
|
>(({ className, children, ...props }, ref) => (
|
|
296
299
|
<ComboboxPrimitive.Trigger
|
|
300
|
+
data-slot="combobox-trigger"
|
|
297
301
|
ref={ref}
|
|
298
302
|
className={cn(
|
|
299
303
|
"inline-flex h-10 items-center justify-center px-3",
|
|
@@ -317,6 +321,7 @@ const ComboboxClear = React.forwardRef<
|
|
|
317
321
|
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Clear>
|
|
318
322
|
>(({ className, children, ...props }, ref) => (
|
|
319
323
|
<ComboboxPrimitive.Clear
|
|
324
|
+
data-slot="combobox-clear"
|
|
320
325
|
ref={ref}
|
|
321
326
|
className={cn(
|
|
322
327
|
"inline-flex h-8 w-8 items-center justify-center rounded-sm text-muted-foreground",
|
|
@@ -339,6 +344,7 @@ const ComboboxContent = React.forwardRef<
|
|
|
339
344
|
const content = (
|
|
340
345
|
<ComboboxPrimitive.Positioner sideOffset={4}>
|
|
341
346
|
<ComboboxPrimitive.Popup
|
|
347
|
+
data-slot="combobox-content"
|
|
342
348
|
ref={ref}
|
|
343
349
|
className={cn(
|
|
344
350
|
"relative z-50 min-w-[var(--anchor-width)] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
@@ -365,6 +371,7 @@ const ComboboxList = React.forwardRef<
|
|
|
365
371
|
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.List>
|
|
366
372
|
>(({ className, ...props }, ref) => (
|
|
367
373
|
<ComboboxPrimitive.List
|
|
374
|
+
data-slot="combobox-list"
|
|
368
375
|
ref={useMergedRef(ref, React.useContext(ComboboxAgentContext)?.list)}
|
|
369
376
|
className={cn("max-h-80 overflow-y-auto p-1", className)}
|
|
370
377
|
{...props}
|
|
@@ -393,6 +400,7 @@ const ComboboxItem = React.forwardRef<
|
|
|
393
400
|
|
|
394
401
|
return (
|
|
395
402
|
<ComboboxPrimitive.Item
|
|
403
|
+
data-slot="combobox-item"
|
|
396
404
|
ref={useMergedRef(ref, element)}
|
|
397
405
|
className={cn(
|
|
398
406
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
@@ -418,7 +426,7 @@ const ComboboxGroup = React.forwardRef<
|
|
|
418
426
|
React.ComponentRef<typeof ComboboxPrimitive.Group>,
|
|
419
427
|
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Group>
|
|
420
428
|
>(({ className, ...props }, ref) => (
|
|
421
|
-
<ComboboxPrimitive.Group ref={ref} className={cn(className)} {...props} />
|
|
429
|
+
<ComboboxPrimitive.Group data-slot="combobox-group" ref={ref} className={cn(className)} {...props} />
|
|
422
430
|
))
|
|
423
431
|
ComboboxGroup.displayName = "ComboboxGroup"
|
|
424
432
|
|
|
@@ -427,6 +435,7 @@ const ComboboxGroupLabel = React.forwardRef<
|
|
|
427
435
|
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.GroupLabel>
|
|
428
436
|
>(({ className, ...props }, ref) => (
|
|
429
437
|
<ComboboxPrimitive.GroupLabel
|
|
438
|
+
data-slot="combobox-group-label"
|
|
430
439
|
ref={ref}
|
|
431
440
|
className={cn("px-2 py-1.5 text-xs font-medium text-muted-foreground", className)}
|
|
432
441
|
{...props}
|
|
@@ -439,6 +448,7 @@ const ComboboxEmpty = React.forwardRef<
|
|
|
439
448
|
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Empty>
|
|
440
449
|
>(({ className, ...props }, ref) => (
|
|
441
450
|
<ComboboxPrimitive.Empty
|
|
451
|
+
data-slot="combobox-empty"
|
|
442
452
|
ref={ref}
|
|
443
453
|
className={cn("p-2 text-center text-sm text-muted-foreground", className)}
|
|
444
454
|
{...props}
|
|
@@ -450,7 +460,7 @@ const ComboboxStatus = React.forwardRef<
|
|
|
450
460
|
React.ComponentRef<typeof ComboboxPrimitive.Status>,
|
|
451
461
|
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Status>
|
|
452
462
|
>(({ className, ...props }, ref) => (
|
|
453
|
-
<ComboboxPrimitive.Status ref={ref} className={cn("sr-only", className)} {...props} />
|
|
463
|
+
<ComboboxPrimitive.Status data-slot="combobox-status" ref={ref} className={cn("sr-only", className)} {...props} />
|
|
454
464
|
))
|
|
455
465
|
ComboboxStatus.displayName = "ComboboxStatus"
|
|
456
466
|
|
|
@@ -459,6 +469,7 @@ const ComboboxLabel = React.forwardRef<
|
|
|
459
469
|
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Label>
|
|
460
470
|
>(({ className, ...props }, ref) => (
|
|
461
471
|
<ComboboxPrimitive.Label
|
|
472
|
+
data-slot="combobox-label"
|
|
462
473
|
ref={ref}
|
|
463
474
|
className={cn("block text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", className)}
|
|
464
475
|
{...props}
|
|
@@ -471,6 +482,7 @@ const ComboboxSeparator = React.forwardRef<
|
|
|
471
482
|
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Separator>
|
|
472
483
|
>(({ className, ...props }, ref) => (
|
|
473
484
|
<ComboboxPrimitive.Separator
|
|
485
|
+
data-slot="combobox-separator"
|
|
474
486
|
ref={ref}
|
|
475
487
|
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
476
488
|
{...props}
|