@surreal-ui/react 0.5.2 → 0.5.3
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 +6 -0
- package/dist/index.js +346 -365
- package/package.json +2 -2
- package/src/components/GlassmorphismAlert.tsx +4 -1
- package/src/components/GlassmorphismButton.tsx +1 -1
- package/src/components/GlassmorphismEmptyState.tsx +1 -1
- package/src/components/GlassmorphismInputGroup.tsx +1 -1
- package/src/components/GlassmorphismMenubar.tsx +2 -2
- package/src/components/GlassmorphismScrollArea.tsx +1 -1
- package/src/components/GlassmorphismTypography.tsx +1 -1
- package/src/components/MinimalistAccordion.tsx +9 -9
- package/src/components/MinimalistAlert.tsx +4 -1
- package/src/components/MinimalistAlertDialog.tsx +44 -43
- package/src/components/MinimalistAspectRatio.tsx +2 -2
- package/src/components/MinimalistAvatar.tsx +13 -13
- package/src/components/MinimalistBadge.tsx +7 -7
- package/src/components/MinimalistBreadcrumb.tsx +6 -2
- package/src/components/MinimalistButton.tsx +7 -7
- package/src/components/MinimalistButtonGroup.tsx +28 -27
- package/src/components/MinimalistCalendar.tsx +16 -13
- package/src/components/MinimalistCard.tsx +1 -1
- package/src/components/MinimalistCarousel.tsx +12 -12
- package/src/components/MinimalistChart.tsx +15 -15
- package/src/components/MinimalistCheckbox.tsx +4 -4
- package/src/components/MinimalistCodeBlock.tsx +16 -16
- package/src/components/MinimalistCollapsible.tsx +2 -2
- package/src/components/MinimalistCommand.tsx +21 -21
- package/src/components/MinimalistContextMenu.tsx +50 -42
- package/src/components/MinimalistDialog.tsx +12 -8
- package/src/components/MinimalistDrawer.tsx +10 -6
- package/src/components/MinimalistDropdownMenu.tsx +67 -67
- package/src/components/MinimalistEmpty.tsx +8 -8
- package/src/components/MinimalistEmptyState.tsx +1 -1
- package/src/components/MinimalistField.tsx +26 -26
- package/src/components/MinimalistForm.tsx +17 -15
- package/src/components/MinimalistHoverCard.tsx +2 -2
- package/src/components/MinimalistInput.tsx +3 -3
- package/src/components/MinimalistInputGroup.tsx +21 -21
- package/src/components/MinimalistInputOtp.tsx +9 -9
- package/src/components/MinimalistItem.tsx +18 -17
- package/src/components/MinimalistKbd.tsx +3 -3
- package/src/components/MinimalistLabel.tsx +2 -2
- package/src/components/MinimalistMenubar.tsx +14 -14
- package/src/components/MinimalistNativeSelect.tsx +3 -3
- package/src/components/MinimalistNavigationMenu.tsx +8 -8
- package/src/components/MinimalistPagination.tsx +9 -9
- package/src/components/MinimalistPopover.tsx +20 -19
- package/src/components/MinimalistProgress.tsx +2 -2
- package/src/components/MinimalistRadioGroup.tsx +3 -3
- package/src/components/MinimalistRangeCalendar.tsx +15 -15
- package/src/components/MinimalistResizable.tsx +2 -2
- package/src/components/MinimalistScrollArea.tsx +1 -1
- package/src/components/MinimalistSelect.tsx +28 -31
- package/src/components/MinimalistSeparator.tsx +5 -5
- package/src/components/MinimalistSheet.tsx +13 -13
- package/src/components/MinimalistSidebar.tsx +73 -72
- package/src/components/MinimalistSkeleton.tsx +1 -1
- package/src/components/MinimalistSlider.tsx +8 -8
- package/src/components/MinimalistSonner.tsx +4 -4
- package/src/components/MinimalistSpinner.tsx +3 -3
- package/src/components/MinimalistSwitch.tsx +5 -5
- package/src/components/MinimalistTabs.tsx +13 -8
- package/src/components/MinimalistTextarea.tsx +3 -3
- package/src/components/MinimalistToggle.tsx +8 -8
- package/src/components/MinimalistToggleGroup.tsx +18 -17
- package/src/components/MinimalistTooltip.tsx +7 -7
- package/src/components/MinimalistTypography.tsx +1 -1
- package/src/components/NeubrutalismCard.tsx +82 -1
- package/src/components/ShadcnAccordion.tsx +9 -9
- package/src/components/ShadcnAlertDialog.tsx +44 -43
- package/src/components/ShadcnAspectRatio.tsx +2 -2
- package/src/components/ShadcnAvatar.tsx +13 -13
- package/src/components/ShadcnBadge.tsx +7 -7
- package/src/components/ShadcnBreadcrumb.tsx +6 -2
- package/src/components/ShadcnButton.tsx +7 -7
- package/src/components/ShadcnButtonGroup.tsx +28 -27
- package/src/components/ShadcnCalendar.tsx +16 -13
- package/src/components/ShadcnCarousel.tsx +12 -12
- package/src/components/ShadcnChart.tsx +15 -15
- package/src/components/ShadcnCheckbox.tsx +4 -4
- package/src/components/ShadcnCodeBlock.tsx +16 -16
- package/src/components/ShadcnCollapsible.tsx +2 -2
- package/src/components/ShadcnCommand.tsx +21 -21
- package/src/components/ShadcnContextMenu.tsx +50 -42
- package/src/components/ShadcnDialog.tsx +12 -8
- package/src/components/ShadcnDrawer.tsx +10 -6
- package/src/components/ShadcnDropdownMenu.tsx +67 -67
- package/src/components/ShadcnEmpty.tsx +8 -8
- package/src/components/ShadcnField.tsx +26 -26
- package/src/components/ShadcnForm.tsx +17 -15
- package/src/components/ShadcnHoverCard.tsx +2 -2
- package/src/components/ShadcnInput.tsx +3 -3
- package/src/components/ShadcnInputGroup.tsx +21 -21
- package/src/components/ShadcnInputOtp.tsx +9 -9
- package/src/components/ShadcnItem.tsx +18 -17
- package/src/components/ShadcnKbd.tsx +3 -3
- package/src/components/ShadcnLabel.tsx +2 -2
- package/src/components/ShadcnMenubar.tsx +14 -14
- package/src/components/ShadcnNativeSelect.tsx +3 -3
- package/src/components/ShadcnNavigationMenu.tsx +8 -8
- package/src/components/ShadcnPagination.tsx +9 -9
- package/src/components/ShadcnPopover.tsx +20 -19
- package/src/components/ShadcnProgress.tsx +2 -2
- package/src/components/ShadcnRadioGroup.tsx +3 -3
- package/src/components/ShadcnRangeCalendar.tsx +15 -15
- package/src/components/ShadcnSelect.tsx +28 -31
- package/src/components/ShadcnSeparator.tsx +5 -5
- package/src/components/ShadcnSheet.tsx +13 -13
- package/src/components/ShadcnSidebar.tsx +73 -72
- package/src/components/ShadcnSkeleton.tsx +1 -1
- package/src/components/ShadcnSlider.tsx +8 -8
- package/src/components/ShadcnSonner.tsx +4 -4
- package/src/components/ShadcnSpinner.tsx +3 -3
- package/src/components/ShadcnSwitch.tsx +5 -5
- package/src/components/ShadcnTabs.tsx +13 -8
- package/src/components/ShadcnTextarea.tsx +3 -3
- package/src/components/ShadcnToggle.tsx +8 -8
- package/src/components/ShadcnToggleGroup.tsx +18 -17
- package/src/components/ShadcnTooltip.tsx +7 -7
|
@@ -21,7 +21,7 @@ export function ShadcnDropdownMenu({
|
|
|
21
21
|
open: controlledOpen,
|
|
22
22
|
defaultOpen = false,
|
|
23
23
|
onOpenChange,
|
|
24
|
-
children
|
|
24
|
+
children
|
|
25
25
|
}: DropdownMenuProps) {
|
|
26
26
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
|
|
27
27
|
const isControlled = controlledOpen !== undefined;
|
|
@@ -35,7 +35,7 @@ export function ShadcnDropdownMenu({
|
|
|
35
35
|
}
|
|
36
36
|
onOpenChange?.(next);
|
|
37
37
|
},
|
|
38
|
-
[isControlled, open, onOpenChange]
|
|
38
|
+
[isControlled, open, onOpenChange]
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
return (
|
|
@@ -51,29 +51,27 @@ export interface ShadcnDropdownMenuTriggerProps extends React.ButtonHTMLAttribut
|
|
|
51
51
|
asChild?: boolean;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export const ShadcnDropdownMenuTrigger = React.forwardRef<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
);
|
|
54
|
+
export const ShadcnDropdownMenuTrigger = React.forwardRef<
|
|
55
|
+
HTMLButtonElement,
|
|
56
|
+
DropdownMenuTriggerProps
|
|
57
|
+
>(({ className, onClick, ...props }, ref) => {
|
|
58
|
+
const context = React.useContext(DropdownMenuContext);
|
|
59
|
+
return (
|
|
60
|
+
<button
|
|
61
|
+
ref={ref}
|
|
62
|
+
type="button"
|
|
63
|
+
data-slot="dropdown-menu-trigger"
|
|
64
|
+
aria-haspopup="menu"
|
|
65
|
+
aria-expanded={context?.open ?? false}
|
|
66
|
+
className={cn('inline-flex items-center justify-center outline-none select-none', className)}
|
|
67
|
+
onClick={(e) => {
|
|
68
|
+
context?.setOpen((prev) => !prev);
|
|
69
|
+
onClick?.(e);
|
|
70
|
+
}}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
});
|
|
77
75
|
DropdownMenuTrigger.displayName = 'DropdownMenuTrigger';
|
|
78
76
|
|
|
79
77
|
export interface ShadcnDropdownMenuPortalProps {
|
|
@@ -124,14 +122,14 @@ export const ShadcnDropdownMenuContent = React.forwardRef<HTMLDivElement, Dropdo
|
|
|
124
122
|
className={cn(
|
|
125
123
|
'absolute z-50 min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 animate-in fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 overflow-x-hidden overflow-y-auto outline-none',
|
|
126
124
|
align === 'end' ? 'right-0' : align === 'center' ? 'left-1/2 -translate-x-1/2' : 'left-0',
|
|
127
|
-
className
|
|
125
|
+
className
|
|
128
126
|
)}
|
|
129
127
|
{...props}
|
|
130
128
|
>
|
|
131
129
|
{children}
|
|
132
130
|
</div>
|
|
133
131
|
);
|
|
134
|
-
}
|
|
132
|
+
}
|
|
135
133
|
);
|
|
136
134
|
DropdownMenuContent.displayName = 'DropdownMenuContent';
|
|
137
135
|
|
|
@@ -140,7 +138,7 @@ export interface ShadcnDropdownMenuGroupProps extends React.HTMLAttributes<HTMLD
|
|
|
140
138
|
export const ShadcnDropdownMenuGroup = React.forwardRef<HTMLDivElement, DropdownMenuGroupProps>(
|
|
141
139
|
({ className, ...props }, ref) => (
|
|
142
140
|
<div ref={ref} data-slot="dropdown-menu-group" className={cn('w-full', className)} {...props} />
|
|
143
|
-
)
|
|
141
|
+
)
|
|
144
142
|
);
|
|
145
143
|
DropdownMenuGroup.displayName = 'DropdownMenuGroup';
|
|
146
144
|
|
|
@@ -172,7 +170,7 @@ export interface ShadcnDropdownMenuItemProps extends React.HTMLAttributes<HTMLDi
|
|
|
172
170
|
export const ShadcnDropdownMenuItem = React.forwardRef<HTMLDivElement, DropdownMenuItemProps>(
|
|
173
171
|
(
|
|
174
172
|
{ className, inset, variant = 'default', disabled = false, onSelect, onClick, ...props },
|
|
175
|
-
ref
|
|
173
|
+
ref
|
|
176
174
|
) => {
|
|
177
175
|
const context = React.useContext(DropdownMenuContext);
|
|
178
176
|
return (
|
|
@@ -186,7 +184,7 @@ export const ShadcnDropdownMenuItem = React.forwardRef<HTMLDivElement, DropdownM
|
|
|
186
184
|
data-disabled={disabled ? '' : undefined}
|
|
187
185
|
className={cn(
|
|
188
186
|
"gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground",
|
|
189
|
-
className
|
|
187
|
+
className
|
|
190
188
|
)}
|
|
191
189
|
onClick={(e) => {
|
|
192
190
|
if (disabled) return;
|
|
@@ -197,7 +195,7 @@ export const ShadcnDropdownMenuItem = React.forwardRef<HTMLDivElement, DropdownM
|
|
|
197
195
|
{...props}
|
|
198
196
|
/>
|
|
199
197
|
);
|
|
200
|
-
}
|
|
198
|
+
}
|
|
201
199
|
);
|
|
202
200
|
DropdownMenuItem.displayName = 'DropdownMenuItem';
|
|
203
201
|
|
|
@@ -223,7 +221,7 @@ export const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
223
221
|
children,
|
|
224
222
|
...props
|
|
225
223
|
},
|
|
226
|
-
ref
|
|
224
|
+
ref
|
|
227
225
|
) => {
|
|
228
226
|
return (
|
|
229
227
|
<div
|
|
@@ -235,7 +233,7 @@ export const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
235
233
|
data-disabled={disabled ? '' : undefined}
|
|
236
234
|
className={cn(
|
|
237
235
|
"gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground",
|
|
238
|
-
className
|
|
236
|
+
className
|
|
239
237
|
)}
|
|
240
238
|
onClick={(e) => {
|
|
241
239
|
if (disabled) return;
|
|
@@ -257,7 +255,7 @@ export const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
257
255
|
{children}
|
|
258
256
|
</div>
|
|
259
257
|
);
|
|
260
|
-
}
|
|
258
|
+
}
|
|
261
259
|
);
|
|
262
260
|
DropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';
|
|
263
261
|
|
|
@@ -282,7 +280,7 @@ export const DropdownMenuRadioGroup = React.forwardRef<HTMLDivElement, DropdownM
|
|
|
282
280
|
{...props}
|
|
283
281
|
/>
|
|
284
282
|
</RadioGroupContext.Provider>
|
|
285
|
-
)
|
|
283
|
+
)
|
|
286
284
|
);
|
|
287
285
|
DropdownMenuRadioGroup.displayName = 'DropdownMenuRadioGroup';
|
|
288
286
|
|
|
@@ -305,7 +303,7 @@ export const DropdownMenuRadioItem = React.forwardRef<HTMLDivElement, DropdownMe
|
|
|
305
303
|
data-disabled={disabled ? '' : undefined}
|
|
306
304
|
className={cn(
|
|
307
305
|
"gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground",
|
|
308
|
-
className
|
|
306
|
+
className
|
|
309
307
|
)}
|
|
310
308
|
onClick={(e) => {
|
|
311
309
|
if (disabled) return;
|
|
@@ -323,7 +321,7 @@ export const DropdownMenuRadioItem = React.forwardRef<HTMLDivElement, DropdownMe
|
|
|
323
321
|
{children}
|
|
324
322
|
</div>
|
|
325
323
|
);
|
|
326
|
-
}
|
|
324
|
+
}
|
|
327
325
|
);
|
|
328
326
|
DropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';
|
|
329
327
|
|
|
@@ -339,44 +337,46 @@ export const ShadcnDropdownMenuLabel = React.forwardRef<HTMLDivElement, Dropdown
|
|
|
339
337
|
data-inset={inset ? '' : undefined}
|
|
340
338
|
className={cn(
|
|
341
339
|
'px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7 data-[inset]:pl-8',
|
|
342
|
-
className
|
|
340
|
+
className
|
|
343
341
|
)}
|
|
344
342
|
{...props}
|
|
345
343
|
/>
|
|
346
|
-
)
|
|
344
|
+
)
|
|
347
345
|
);
|
|
348
346
|
DropdownMenuLabel.displayName = 'DropdownMenuLabel';
|
|
349
347
|
|
|
350
348
|
export interface ShadcnDropdownMenuSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
351
349
|
|
|
352
|
-
export const ShadcnDropdownMenuSeparator = React.forwardRef<
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
350
|
+
export const ShadcnDropdownMenuSeparator = React.forwardRef<
|
|
351
|
+
HTMLDivElement,
|
|
352
|
+
DropdownMenuSeparatorProps
|
|
353
|
+
>(({ className, ...props }, ref) => (
|
|
354
|
+
<div
|
|
355
|
+
ref={ref}
|
|
356
|
+
role="separator"
|
|
357
|
+
data-slot="dropdown-menu-separator"
|
|
358
|
+
className={cn('-mx-1 my-1 h-px bg-border', className)}
|
|
359
|
+
{...props}
|
|
360
|
+
/>
|
|
361
|
+
));
|
|
363
362
|
DropdownMenuSeparator.displayName = 'DropdownMenuSeparator';
|
|
364
363
|
|
|
365
364
|
export interface ShadcnDropdownMenuShortcutProps extends React.HTMLAttributes<HTMLSpanElement> {}
|
|
366
365
|
|
|
367
|
-
export const ShadcnDropdownMenuShortcut = React.forwardRef<
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
366
|
+
export const ShadcnDropdownMenuShortcut = React.forwardRef<
|
|
367
|
+
HTMLSpanElement,
|
|
368
|
+
DropdownMenuShortcutProps
|
|
369
|
+
>(({ className, ...props }, ref) => (
|
|
370
|
+
<span
|
|
371
|
+
ref={ref}
|
|
372
|
+
data-slot="dropdown-menu-shortcut"
|
|
373
|
+
className={cn(
|
|
374
|
+
'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',
|
|
375
|
+
className
|
|
376
|
+
)}
|
|
377
|
+
{...props}
|
|
378
|
+
/>
|
|
379
|
+
));
|
|
380
380
|
DropdownMenuShortcut.displayName = 'DropdownMenuShortcut';
|
|
381
381
|
|
|
382
382
|
export interface DropdownMenuSubProps {
|
|
@@ -400,14 +400,14 @@ export const DropdownMenuSubTrigger = React.forwardRef<HTMLDivElement, DropdownM
|
|
|
400
400
|
data-inset={inset ? '' : undefined}
|
|
401
401
|
className={cn(
|
|
402
402
|
"gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground",
|
|
403
|
-
className
|
|
403
|
+
className
|
|
404
404
|
)}
|
|
405
405
|
{...props}
|
|
406
406
|
>
|
|
407
407
|
{children}
|
|
408
408
|
<ChevronRight className="ml-auto size-4" />
|
|
409
409
|
</div>
|
|
410
|
-
)
|
|
410
|
+
)
|
|
411
411
|
);
|
|
412
412
|
DropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';
|
|
413
413
|
|
|
@@ -420,11 +420,11 @@ export const DropdownMenuSubContent = React.forwardRef<HTMLDivElement, DropdownM
|
|
|
420
420
|
data-slot="dropdown-menu-sub-content"
|
|
421
421
|
className={cn(
|
|
422
422
|
'min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 hidden group-hover/sub:block absolute left-full top-0 ml-1 z-50 w-auto',
|
|
423
|
-
className
|
|
423
|
+
className
|
|
424
424
|
)}
|
|
425
425
|
{...props}
|
|
426
426
|
/>
|
|
427
|
-
)
|
|
427
|
+
)
|
|
428
428
|
);
|
|
429
429
|
DropdownMenuSubContent.displayName = 'DropdownMenuSubContent';
|
|
430
430
|
|
|
@@ -7,13 +7,13 @@ export const emptyMediaVariants = cva(
|
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
9
|
default: 'bg-transparent',
|
|
10
|
-
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"
|
|
11
|
-
}
|
|
10
|
+
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"
|
|
11
|
+
}
|
|
12
12
|
},
|
|
13
13
|
defaultVariants: {
|
|
14
|
-
variant: 'default'
|
|
15
|
-
}
|
|
16
|
-
}
|
|
14
|
+
variant: 'default'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
export type EmptyMediaVariant = VariantProps<typeof emptyMediaVariants>['variant'];
|
|
@@ -26,7 +26,7 @@ export function ShadcnEmpty({ className, ...props }: EmptyProps) {
|
|
|
26
26
|
data-slot="empty"
|
|
27
27
|
className={cn(
|
|
28
28
|
'gap-4 rounded-xl border border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance',
|
|
29
|
-
className
|
|
29
|
+
className
|
|
30
30
|
)}
|
|
31
31
|
{...props}
|
|
32
32
|
/>
|
|
@@ -80,7 +80,7 @@ export function ShadcnEmptyDescription({ className, ...props }: EmptyDescription
|
|
|
80
80
|
data-slot="empty-description"
|
|
81
81
|
className={cn(
|
|
82
82
|
'text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
|
|
83
|
-
className
|
|
83
|
+
className
|
|
84
84
|
)}
|
|
85
85
|
{...props}
|
|
86
86
|
/>
|
|
@@ -95,7 +95,7 @@ export function ShadcnEmptyContent({ className, ...props }: EmptyContentProps) {
|
|
|
95
95
|
data-slot="empty-content"
|
|
96
96
|
className={cn(
|
|
97
97
|
'gap-2.5 text-sm flex w-full max-w-sm min-w-0 flex-col items-center text-balance',
|
|
98
|
-
className
|
|
98
|
+
className
|
|
99
99
|
)}
|
|
100
100
|
{...props}
|
|
101
101
|
/>
|
|
@@ -10,7 +10,7 @@ export const MinimalistEmptyState: React.FC<MinimalistEmptyStateProps> = ({
|
|
|
10
10
|
title = 'No components found',
|
|
11
11
|
description = 'No components match your search filters. Try clearing filters or run the seed script to populate components.',
|
|
12
12
|
actionText = 'Create Component',
|
|
13
|
-
actionHref = '/studio'
|
|
13
|
+
actionHref = '/studio'
|
|
14
14
|
}) => {
|
|
15
15
|
return (
|
|
16
16
|
<div className="text-center py-16 bg-slate-900/40 border border-dashed border-slate-800 rounded-3xl space-y-4">
|
|
@@ -10,13 +10,13 @@ export const shadcnFieldVariants = cva(
|
|
|
10
10
|
horizontal:
|
|
11
11
|
'cn-field-orientation-horizontal flex-row items-center has-[>[data-slot=field-content]]:items-start [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
12
12
|
responsive:
|
|
13
|
-
'cn-field-orientation-responsive flex-col @md/field-group:flex-row @md/field-group:items-center @md/field-group:has-[>[data-slot=field-content]]:items-start [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'
|
|
14
|
-
}
|
|
13
|
+
'cn-field-orientation-responsive flex-col @md/field-group:flex-row @md/field-group:items-center @md/field-group:has-[>[data-slot=field-content]]:items-start [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'
|
|
14
|
+
}
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: {
|
|
17
|
-
orientation: 'vertical'
|
|
18
|
-
}
|
|
19
|
-
}
|
|
17
|
+
orientation: 'vertical'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
export type FieldOrientation = VariantProps<typeof fieldVariants>['orientation'];
|
|
@@ -41,7 +41,7 @@ export const ShadcnField = React.forwardRef<HTMLDivElement, FieldProps>(
|
|
|
41
41
|
{children}
|
|
42
42
|
</div>
|
|
43
43
|
);
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
45
|
);
|
|
46
46
|
Field.displayName = 'Field';
|
|
47
47
|
|
|
@@ -59,7 +59,7 @@ export const ShadcnFieldContent = React.forwardRef<HTMLDivElement, FieldContentP
|
|
|
59
59
|
{children}
|
|
60
60
|
</div>
|
|
61
61
|
);
|
|
62
|
-
}
|
|
62
|
+
}
|
|
63
63
|
);
|
|
64
64
|
FieldContent.displayName = 'FieldContent';
|
|
65
65
|
|
|
@@ -73,14 +73,14 @@ export const ShadcnFieldDescription = React.forwardRef<HTMLParagraphElement, Fie
|
|
|
73
73
|
data-slot="field-description"
|
|
74
74
|
className={cn(
|
|
75
75
|
'text-left text-sm text-muted-foreground [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance last:mt-0 nth-last-2:-mt-1 [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
|
|
76
|
-
className
|
|
76
|
+
className
|
|
77
77
|
)}
|
|
78
78
|
{...props}
|
|
79
79
|
>
|
|
80
80
|
{children}
|
|
81
81
|
</p>
|
|
82
82
|
);
|
|
83
|
-
}
|
|
83
|
+
}
|
|
84
84
|
);
|
|
85
85
|
FieldDescription.displayName = 'FieldDescription';
|
|
86
86
|
|
|
@@ -92,7 +92,7 @@ export const FieldError = React.forwardRef<HTMLDivElement, FieldErrorProps>(
|
|
|
92
92
|
({ className, errors, children, ...props }, ref) => {
|
|
93
93
|
const hasContent = Boolean(
|
|
94
94
|
children ||
|
|
95
|
-
(errors && errors.length > 0 && (errors.length > 1 || Boolean(errors[0]?.message)))
|
|
95
|
+
(errors && errors.length > 0 && (errors.length > 1 || Boolean(errors[0]?.message)))
|
|
96
96
|
);
|
|
97
97
|
|
|
98
98
|
if (!hasContent) return null;
|
|
@@ -112,13 +112,13 @@ export const FieldError = React.forwardRef<HTMLDivElement, FieldErrorProps>(
|
|
|
112
112
|
) : errors && errors.length > 1 ? (
|
|
113
113
|
<ul className="ml-4 flex list-disc flex-col gap-1">
|
|
114
114
|
{errors.map((error, index) =>
|
|
115
|
-
error?.message ? <li key={index}>{error.message}</li> : null
|
|
115
|
+
error?.message ? <li key={index}>{error.message}</li> : null
|
|
116
116
|
)}
|
|
117
117
|
</ul>
|
|
118
118
|
) : null}
|
|
119
119
|
</div>
|
|
120
120
|
);
|
|
121
|
-
}
|
|
121
|
+
}
|
|
122
122
|
);
|
|
123
123
|
FieldError.displayName = 'FieldError';
|
|
124
124
|
|
|
@@ -132,14 +132,14 @@ export const ShadcnFieldGroup = React.forwardRef<HTMLDivElement, FieldGroupProps
|
|
|
132
132
|
data-slot="field-group"
|
|
133
133
|
className={cn(
|
|
134
134
|
'gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col',
|
|
135
|
-
className
|
|
135
|
+
className
|
|
136
136
|
)}
|
|
137
137
|
{...props}
|
|
138
138
|
>
|
|
139
139
|
{children}
|
|
140
140
|
</div>
|
|
141
141
|
);
|
|
142
|
-
}
|
|
142
|
+
}
|
|
143
143
|
);
|
|
144
144
|
FieldGroup.displayName = 'FieldGroup';
|
|
145
145
|
|
|
@@ -153,14 +153,14 @@ export const ShadcnFieldLabel = React.forwardRef<HTMLLabelElement, FieldLabelPro
|
|
|
153
153
|
data-slot="field-label"
|
|
154
154
|
className={cn(
|
|
155
155
|
'gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 group/field-label peer/field-label flex w-fit cursor-pointer text-sm font-medium text-foreground leading-snug has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',
|
|
156
|
-
className
|
|
156
|
+
className
|
|
157
157
|
)}
|
|
158
158
|
{...props}
|
|
159
159
|
>
|
|
160
160
|
{children}
|
|
161
161
|
</label>
|
|
162
162
|
);
|
|
163
|
-
}
|
|
163
|
+
}
|
|
164
164
|
);
|
|
165
165
|
FieldLabel.displayName = 'FieldLabel';
|
|
166
166
|
|
|
@@ -177,14 +177,14 @@ export const FieldLegend = React.forwardRef<HTMLLegendElement, FieldLegendProps>
|
|
|
177
177
|
data-variant={variant}
|
|
178
178
|
className={cn(
|
|
179
179
|
'mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base text-foreground',
|
|
180
|
-
className
|
|
180
|
+
className
|
|
181
181
|
)}
|
|
182
182
|
{...props}
|
|
183
183
|
>
|
|
184
184
|
{children}
|
|
185
185
|
</legend>
|
|
186
186
|
);
|
|
187
|
-
}
|
|
187
|
+
}
|
|
188
188
|
);
|
|
189
189
|
FieldLegend.displayName = 'FieldLegend';
|
|
190
190
|
|
|
@@ -199,7 +199,7 @@ export const ShadcnFieldSeparator = React.forwardRef<HTMLDivElement, FieldSepara
|
|
|
199
199
|
data-content={Boolean(children)}
|
|
200
200
|
className={cn(
|
|
201
201
|
'-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative flex items-center justify-center',
|
|
202
|
-
className
|
|
202
|
+
className
|
|
203
203
|
)}
|
|
204
204
|
{...props}
|
|
205
205
|
>
|
|
@@ -214,7 +214,7 @@ export const ShadcnFieldSeparator = React.forwardRef<HTMLDivElement, FieldSepara
|
|
|
214
214
|
) : null}
|
|
215
215
|
</div>
|
|
216
216
|
);
|
|
217
|
-
}
|
|
217
|
+
}
|
|
218
218
|
);
|
|
219
219
|
FieldSeparator.displayName = 'FieldSeparator';
|
|
220
220
|
|
|
@@ -228,14 +228,14 @@ export const FieldSet = React.forwardRef<HTMLFieldSetElement, FieldSetProps>(
|
|
|
228
228
|
data-slot="field-set"
|
|
229
229
|
className={cn(
|
|
230
230
|
'gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col border-0 p-0 m-0',
|
|
231
|
-
className
|
|
231
|
+
className
|
|
232
232
|
)}
|
|
233
233
|
{...props}
|
|
234
234
|
>
|
|
235
235
|
{children}
|
|
236
236
|
</fieldset>
|
|
237
237
|
);
|
|
238
|
-
}
|
|
238
|
+
}
|
|
239
239
|
);
|
|
240
240
|
FieldSet.displayName = 'FieldSet';
|
|
241
241
|
|
|
@@ -249,14 +249,14 @@ export const ShadcnFieldTitle = React.forwardRef<HTMLDivElement, FieldTitleProps
|
|
|
249
249
|
data-slot="field-label"
|
|
250
250
|
className={cn(
|
|
251
251
|
'gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center text-foreground',
|
|
252
|
-
className
|
|
252
|
+
className
|
|
253
253
|
)}
|
|
254
254
|
{...props}
|
|
255
255
|
>
|
|
256
256
|
{children}
|
|
257
257
|
</div>
|
|
258
258
|
);
|
|
259
|
-
}
|
|
259
|
+
}
|
|
260
260
|
);
|
|
261
261
|
FieldTitle.displayName = 'FieldTitle';
|
|
262
262
|
|
|
@@ -270,6 +270,6 @@ export {
|
|
|
270
270
|
FieldTitle as Title,
|
|
271
271
|
FieldDescription as Description,
|
|
272
272
|
FieldSeparator as Separator,
|
|
273
|
-
FieldError as Error
|
|
273
|
+
FieldError as Error
|
|
274
274
|
};
|
|
275
|
-
export default MinimalistField;
|
|
275
|
+
export default MinimalistField;
|
|
@@ -19,15 +19,17 @@ export const useFormField = () => {
|
|
|
19
19
|
formItemId: `${id}-form-item`,
|
|
20
20
|
formDescriptionId: `${id}-form-item-description`,
|
|
21
21
|
formMessageId: `${id}-form-item-message`,
|
|
22
|
-
error: itemContext.error
|
|
22
|
+
error: itemContext.error
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export interface ShadcnFormProps extends React.FormHTMLAttributes<HTMLFormElement> {}
|
|
27
27
|
|
|
28
|
-
export const ShadcnForm = React.forwardRef<HTMLFormElement, FormProps>(
|
|
29
|
-
|
|
30
|
-
)
|
|
28
|
+
export const ShadcnForm = React.forwardRef<HTMLFormElement, FormProps>(
|
|
29
|
+
({ className, ...props }, ref) => (
|
|
30
|
+
<form ref={ref} className={cn('space-y-6', className)} {...props} />
|
|
31
|
+
)
|
|
32
|
+
);
|
|
31
33
|
Form.displayName = 'Form';
|
|
32
34
|
|
|
33
35
|
export interface ShadcnFormItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -43,7 +45,7 @@ export const ShadcnFormItem = React.forwardRef<HTMLDivElement, FormItemProps>(
|
|
|
43
45
|
<div ref={ref} data-slot="form-item" className={cn('space-y-2', className)} {...props} />
|
|
44
46
|
</FormItemContext.Provider>
|
|
45
47
|
);
|
|
46
|
-
}
|
|
48
|
+
}
|
|
47
49
|
);
|
|
48
50
|
FormItem.displayName = 'FormItem';
|
|
49
51
|
|
|
@@ -60,12 +62,12 @@ export const ShadcnFormLabel = React.forwardRef<HTMLLabelElement, FormLabelProps
|
|
|
60
62
|
htmlFor={formItemId}
|
|
61
63
|
className={cn(
|
|
62
64
|
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 data-[error]:text-destructive',
|
|
63
|
-
className
|
|
65
|
+
className
|
|
64
66
|
)}
|
|
65
67
|
{...props}
|
|
66
68
|
/>
|
|
67
69
|
);
|
|
68
|
-
}
|
|
70
|
+
}
|
|
69
71
|
);
|
|
70
72
|
FormLabel.displayName = 'FormLabel';
|
|
71
73
|
|
|
@@ -84,7 +86,7 @@ export const ShadcnFormControl = React.forwardRef<HTMLDivElement, FormControlPro
|
|
|
84
86
|
{...props}
|
|
85
87
|
/>
|
|
86
88
|
);
|
|
87
|
-
}
|
|
89
|
+
}
|
|
88
90
|
);
|
|
89
91
|
FormControl.displayName = 'FormControl';
|
|
90
92
|
|
|
@@ -102,7 +104,7 @@ export const ShadcnFormDescription = React.forwardRef<HTMLParagraphElement, Form
|
|
|
102
104
|
{...props}
|
|
103
105
|
/>
|
|
104
106
|
);
|
|
105
|
-
}
|
|
107
|
+
}
|
|
106
108
|
);
|
|
107
109
|
FormDescription.displayName = 'FormDescription';
|
|
108
110
|
|
|
@@ -130,7 +132,7 @@ export const ShadcnFormMessage = React.forwardRef<HTMLParagraphElement, FormMess
|
|
|
130
132
|
{body}
|
|
131
133
|
</p>
|
|
132
134
|
);
|
|
133
|
-
}
|
|
135
|
+
}
|
|
134
136
|
);
|
|
135
137
|
FormMessage.displayName = 'FormMessage';
|
|
136
138
|
|
|
@@ -139,7 +141,7 @@ export interface FormFieldsetProps extends React.FieldsetHTMLAttributes<HTMLFiel
|
|
|
139
141
|
export const FormFieldset = React.forwardRef<HTMLFieldSetElement, FormFieldsetProps>(
|
|
140
142
|
({ className, ...props }, ref) => (
|
|
141
143
|
<fieldset ref={ref} className={cn('space-y-2', className)} {...props} />
|
|
142
|
-
)
|
|
144
|
+
)
|
|
143
145
|
);
|
|
144
146
|
FormFieldset.displayName = 'FormFieldset';
|
|
145
147
|
|
|
@@ -156,7 +158,7 @@ export const FormLegend = React.forwardRef<HTMLLegendElement, FormLegendProps>(
|
|
|
156
158
|
className={cn('text-sm leading-none font-medium data-[error]:text-destructive', className)}
|
|
157
159
|
{...props}
|
|
158
160
|
/>
|
|
159
|
-
)
|
|
161
|
+
)
|
|
160
162
|
);
|
|
161
163
|
FormLegend.displayName = 'FormLegend';
|
|
162
164
|
|
|
@@ -179,11 +181,11 @@ export const ShadcnFormButton = React.forwardRef<HTMLButtonElement, FormButtonPr
|
|
|
179
181
|
variant === 'secondary' && 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
180
182
|
variant === 'ghost' && 'hover:bg-accent hover:text-accent-foreground',
|
|
181
183
|
variant === 'link' && 'text-primary underline-offset-4 hover:underline',
|
|
182
|
-
className
|
|
184
|
+
className
|
|
183
185
|
)}
|
|
184
186
|
{...props}
|
|
185
187
|
/>
|
|
186
|
-
)
|
|
188
|
+
)
|
|
187
189
|
);
|
|
188
190
|
FormButton.displayName = 'FormButton';
|
|
189
191
|
|
|
@@ -197,7 +199,7 @@ export {
|
|
|
197
199
|
FormFieldset as Fieldset,
|
|
198
200
|
FormLegend as Legend,
|
|
199
201
|
FormItem as FormField,
|
|
200
|
-
FormMessage as FormFieldErrors
|
|
202
|
+
FormMessage as FormFieldErrors
|
|
201
203
|
};
|
|
202
204
|
|
|
203
205
|
export default MinimalistForm;
|
|
@@ -26,7 +26,7 @@ const HoverCardContent = React.forwardRef<
|
|
|
26
26
|
data-slot="hover-card-content"
|
|
27
27
|
className={cn(
|
|
28
28
|
'z-50 w-64 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 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 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 origin-(--radix-hover-card-content-transform-origin) outline-hidden',
|
|
29
|
-
className
|
|
29
|
+
className
|
|
30
30
|
)}
|
|
31
31
|
{...props}
|
|
32
32
|
/>
|
|
@@ -42,7 +42,7 @@ export {
|
|
|
42
42
|
ShadcnHoverCard as Root,
|
|
43
43
|
HoverCardTrigger as Trigger,
|
|
44
44
|
HoverCardContent as Content,
|
|
45
|
-
HoverCardPortal as Portal
|
|
45
|
+
HoverCardPortal as Portal
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export default MinimalistHoverCard;
|
|
@@ -11,14 +11,14 @@ export const ShadcnInput = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
11
11
|
data-slot={dataSlot}
|
|
12
12
|
className={cn(
|
|
13
13
|
'h-8 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
14
|
-
className
|
|
14
|
+
className
|
|
15
15
|
)}
|
|
16
16
|
ref={ref}
|
|
17
17
|
{...props}
|
|
18
18
|
/>
|
|
19
19
|
);
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
);
|
|
22
22
|
Input.displayName = 'Input';
|
|
23
23
|
|
|
24
|
-
export default MinimalistInput;
|
|
24
|
+
export default MinimalistInput;
|