@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
|
@@ -12,13 +12,13 @@ export const shadcnBadgeVariants = cva(
|
|
|
12
12
|
'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20',
|
|
13
13
|
outline: 'border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',
|
|
14
14
|
ghost: 'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',
|
|
15
|
-
link: 'text-primary underline-offset-4 hover:underline'
|
|
16
|
-
}
|
|
15
|
+
link: 'text-primary underline-offset-4 hover:underline'
|
|
16
|
+
}
|
|
17
17
|
},
|
|
18
18
|
defaultVariants: {
|
|
19
|
-
variant: 'default'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
19
|
+
variant: 'default'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
export type BadgeVariant = VariantProps<typeof badgeVariants>['variant'];
|
|
@@ -42,8 +42,8 @@ export const ShadcnBadge = React.forwardRef<HTMLElement, BadgeProps>(
|
|
|
42
42
|
{...(props as any)}
|
|
43
43
|
/>
|
|
44
44
|
);
|
|
45
|
-
}
|
|
45
|
+
}
|
|
46
46
|
);
|
|
47
47
|
Badge.displayName = 'Badge';
|
|
48
48
|
|
|
49
|
-
export default ShadcnBadge;
|
|
49
|
+
export default ShadcnBadge;
|
|
@@ -23,7 +23,7 @@ export function ShadcnBreadcrumbList({ className, ...props }: BreadcrumbListProp
|
|
|
23
23
|
data-slot="breadcrumb-list"
|
|
24
24
|
className={cn(
|
|
25
25
|
'gap-1.5 text-sm text-muted-foreground flex flex-wrap items-center wrap-break-word',
|
|
26
|
-
className
|
|
26
|
+
className
|
|
27
27
|
)}
|
|
28
28
|
{...props}
|
|
29
29
|
/>
|
|
@@ -71,7 +71,11 @@ export function BreadcrumbPage({ className, ...props }: BreadcrumbPageProps) {
|
|
|
71
71
|
|
|
72
72
|
export interface ShadcnBreadcrumbSeparatorProps extends React.ComponentProps<'li'> {}
|
|
73
73
|
|
|
74
|
-
export function ShadcnBreadcrumbSeparator({
|
|
74
|
+
export function ShadcnBreadcrumbSeparator({
|
|
75
|
+
children,
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
}: BreadcrumbSeparatorProps) {
|
|
75
79
|
return (
|
|
76
80
|
<li
|
|
77
81
|
data-slot="breadcrumb-separator"
|
|
@@ -15,7 +15,7 @@ export const shadcnButtonVariants = cva(
|
|
|
15
15
|
'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',
|
|
16
16
|
destructive:
|
|
17
17
|
'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
|
|
18
|
-
link: 'text-primary underline-offset-4 hover:underline'
|
|
18
|
+
link: 'text-primary underline-offset-4 hover:underline'
|
|
19
19
|
},
|
|
20
20
|
size: {
|
|
21
21
|
default:
|
|
@@ -28,14 +28,14 @@ export const shadcnButtonVariants = cva(
|
|
|
28
28
|
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
29
29
|
'icon-sm':
|
|
30
30
|
'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
|
|
31
|
-
'icon-lg': 'size-9'
|
|
32
|
-
}
|
|
31
|
+
'icon-lg': 'size-9'
|
|
32
|
+
}
|
|
33
33
|
},
|
|
34
34
|
defaultVariants: {
|
|
35
35
|
variant: 'default',
|
|
36
|
-
size: 'default'
|
|
37
|
-
}
|
|
38
|
-
}
|
|
36
|
+
size: 'default'
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
export interface ShadcnButtonProps
|
|
@@ -78,7 +78,7 @@ export const ShadcnButton = React.forwardRef<HTMLButtonElement | HTMLAnchorEleme
|
|
|
78
78
|
{children}
|
|
79
79
|
</button>
|
|
80
80
|
);
|
|
81
|
-
}
|
|
81
|
+
}
|
|
82
82
|
);
|
|
83
83
|
|
|
84
84
|
Button.displayName = 'Button';
|
|
@@ -9,13 +9,13 @@ export const shadcnButtonGroupVariants = cva(
|
|
|
9
9
|
horizontal:
|
|
10
10
|
'[&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]]:rounded-r-none [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0',
|
|
11
11
|
vertical:
|
|
12
|
-
'[&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! flex-col [&>[data-slot]]:rounded-b-none [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0'
|
|
13
|
-
}
|
|
12
|
+
'[&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! flex-col [&>[data-slot]]:rounded-b-none [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0'
|
|
13
|
+
}
|
|
14
14
|
},
|
|
15
15
|
defaultVariants: {
|
|
16
|
-
orientation: 'horizontal'
|
|
17
|
-
}
|
|
18
|
-
}
|
|
16
|
+
orientation: 'horizontal'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
export type ButtonGroupOrientation = VariantProps<typeof buttonGroupVariants>['orientation'];
|
|
@@ -35,7 +35,7 @@ export const ShadcnButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupPro
|
|
|
35
35
|
{...props}
|
|
36
36
|
/>
|
|
37
37
|
);
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
39
|
);
|
|
40
40
|
ButtonGroup.displayName = 'ButtonGroup';
|
|
41
41
|
|
|
@@ -43,24 +43,25 @@ export interface ShadcnButtonGroupSeparatorProps extends React.ComponentProps<'d
|
|
|
43
43
|
orientation?: 'horizontal' | 'vertical';
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export const ShadcnButtonGroupSeparator = React.forwardRef<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
46
|
+
export const ShadcnButtonGroupSeparator = React.forwardRef<
|
|
47
|
+
HTMLDivElement,
|
|
48
|
+
ButtonGroupSeparatorProps
|
|
49
|
+
>(({ className, orientation = 'vertical', ...props }, ref) => {
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
ref={ref}
|
|
53
|
+
role="separator"
|
|
54
|
+
aria-orientation={orientation}
|
|
55
|
+
data-slot="button-group-separator"
|
|
56
|
+
data-orientation={orientation}
|
|
57
|
+
className={cn(
|
|
58
|
+
'bg-input relative self-stretch data-[orientation=horizontal]:mx-px data-[orientation=horizontal]:w-auto data-[orientation=vertical]:my-px data-[orientation=vertical]:h-auto',
|
|
59
|
+
className
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
});
|
|
64
65
|
ButtonGroupSeparator.displayName = 'ButtonGroupSeparator';
|
|
65
66
|
|
|
66
67
|
export interface ShadcnButtonGroupTextProps extends React.ComponentProps<'div'> {}
|
|
@@ -73,13 +74,13 @@ export const ShadcnButtonGroupText = React.forwardRef<HTMLDivElement, ButtonGrou
|
|
|
73
74
|
data-slot="button-group-text"
|
|
74
75
|
className={cn(
|
|
75
76
|
"gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none",
|
|
76
|
-
className
|
|
77
|
+
className
|
|
77
78
|
)}
|
|
78
79
|
{...props}
|
|
79
80
|
/>
|
|
80
81
|
);
|
|
81
|
-
}
|
|
82
|
+
}
|
|
82
83
|
);
|
|
83
84
|
ButtonGroupText.displayName = 'ButtonGroupText';
|
|
84
85
|
|
|
85
|
-
export default ShadcnButtonGroup;
|
|
86
|
+
export default ShadcnButtonGroup;
|
|
@@ -2,7 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { ChevronLeft, ChevronRight, ChevronDown } from 'lucide-react';
|
|
3
3
|
import { cn } from '@surreal-ui/core';
|
|
4
4
|
|
|
5
|
-
export interface ShadcnCalendarProps extends Omit<
|
|
5
|
+
export interface ShadcnCalendarProps extends Omit<
|
|
6
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
7
|
+
'onChange'
|
|
8
|
+
> {
|
|
6
9
|
value?: Date | string | null;
|
|
7
10
|
defaultValue?: Date | string | null;
|
|
8
11
|
locale?: string;
|
|
@@ -58,9 +61,9 @@ export function ShadcnCalendar({
|
|
|
58
61
|
'September',
|
|
59
62
|
'October',
|
|
60
63
|
'November',
|
|
61
|
-
'December'
|
|
64
|
+
'December'
|
|
62
65
|
],
|
|
63
|
-
[]
|
|
66
|
+
[]
|
|
64
67
|
);
|
|
65
68
|
|
|
66
69
|
const weekdays = React.useMemo(() => {
|
|
@@ -127,7 +130,7 @@ export function ShadcnCalendar({
|
|
|
127
130
|
d.getMonth() === selectedDate.getMonth() &&
|
|
128
131
|
d.getDate() === selectedDate.getDate(),
|
|
129
132
|
isDisabled:
|
|
130
|
-
disableDaysOutsideMonth || (!!minDate && d < minDate) || (!!maxDate && d > maxDate)
|
|
133
|
+
disableDaysOutsideMonth || (!!minDate && d < minDate) || (!!maxDate && d > maxDate)
|
|
131
134
|
});
|
|
132
135
|
}
|
|
133
136
|
|
|
@@ -144,7 +147,7 @@ export function ShadcnCalendar({
|
|
|
144
147
|
isCurrentMonth: true,
|
|
145
148
|
isToday: d.getTime() === today.getTime(),
|
|
146
149
|
isSelected,
|
|
147
|
-
isDisabled: (!!minDate && d < minDate) || (!!maxDate && d > maxDate)
|
|
150
|
+
isDisabled: (!!minDate && d < minDate) || (!!maxDate && d > maxDate)
|
|
148
151
|
});
|
|
149
152
|
|
|
150
153
|
if (currentWeek.length === 7) {
|
|
@@ -168,7 +171,7 @@ export function ShadcnCalendar({
|
|
|
168
171
|
d.getMonth() === selectedDate.getMonth() &&
|
|
169
172
|
d.getDate() === selectedDate.getDate(),
|
|
170
173
|
isDisabled:
|
|
171
|
-
disableDaysOutsideMonth || (!!minDate && d < minDate) || (!!maxDate && d > maxDate)
|
|
174
|
+
disableDaysOutsideMonth || (!!minDate && d < minDate) || (!!maxDate && d > maxDate)
|
|
172
175
|
});
|
|
173
176
|
nextDay++;
|
|
174
177
|
}
|
|
@@ -191,7 +194,7 @@ export function ShadcnCalendar({
|
|
|
191
194
|
data-slot="calendar"
|
|
192
195
|
className={cn(
|
|
193
196
|
'p-3 rounded-lg border border-border bg-background text-foreground shadow-sm inline-block select-none',
|
|
194
|
-
className
|
|
197
|
+
className
|
|
195
198
|
)}
|
|
196
199
|
{...props}
|
|
197
200
|
>
|
|
@@ -250,7 +253,7 @@ export function ShadcnCalendar({
|
|
|
250
253
|
type="button"
|
|
251
254
|
onClick={() =>
|
|
252
255
|
setCurrentMonth(
|
|
253
|
-
new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1)
|
|
256
|
+
new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1)
|
|
254
257
|
)
|
|
255
258
|
}
|
|
256
259
|
aria-label="Previous Month"
|
|
@@ -262,7 +265,7 @@ export function ShadcnCalendar({
|
|
|
262
265
|
type="button"
|
|
263
266
|
onClick={() =>
|
|
264
267
|
setCurrentMonth(
|
|
265
|
-
new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1)
|
|
268
|
+
new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1)
|
|
266
269
|
)
|
|
267
270
|
}
|
|
268
271
|
aria-label="Next Month"
|
|
@@ -304,12 +307,12 @@ export function ShadcnCalendar({
|
|
|
304
307
|
!cell.isSelected &&
|
|
305
308
|
!cell.isDisabled &&
|
|
306
309
|
'hover:bg-accent hover:text-accent-foreground',
|
|
307
|
-
cell.isDisabled && 'pointer-events-none opacity-20'
|
|
310
|
+
cell.isDisabled && 'pointer-events-none opacity-20'
|
|
308
311
|
)}
|
|
309
312
|
>
|
|
310
313
|
{cell.date.getDate()}
|
|
311
314
|
</button>
|
|
312
|
-
))
|
|
315
|
+
))
|
|
313
316
|
)}
|
|
314
317
|
</div>
|
|
315
318
|
</div>
|
|
@@ -327,7 +330,7 @@ export const ShadcnCalendarHeader = React.forwardRef<
|
|
|
327
330
|
ref={ref}
|
|
328
331
|
className={cn(
|
|
329
332
|
'flex h-7 w-full items-center justify-center gap-1.5 text-sm font-medium',
|
|
330
|
-
className
|
|
333
|
+
className
|
|
331
334
|
)}
|
|
332
335
|
{...props}
|
|
333
336
|
/>
|
|
@@ -345,7 +348,7 @@ CalendarMonths.displayName = 'CalendarMonths';
|
|
|
345
348
|
export const CalendarMonth = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
346
349
|
({ className, ...props }, ref) => (
|
|
347
350
|
<div ref={ref} className={cn('flex w-full flex-col gap-4', className)} {...props} />
|
|
348
|
-
)
|
|
351
|
+
)
|
|
349
352
|
);
|
|
350
353
|
CalendarMonth.displayName = 'CalendarMonth';
|
|
351
354
|
|
|
@@ -95,7 +95,7 @@ export const ShadcnCarousel = React.forwardRef<HTMLDivElement, CarouselProps>(
|
|
|
95
95
|
scrollNext();
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
|
-
[orientation, scrollPrev, scrollNext]
|
|
98
|
+
[orientation, scrollPrev, scrollNext]
|
|
99
99
|
);
|
|
100
100
|
|
|
101
101
|
return (
|
|
@@ -107,7 +107,7 @@ export const ShadcnCarousel = React.forwardRef<HTMLDivElement, CarouselProps>(
|
|
|
107
107
|
canScrollPrev,
|
|
108
108
|
canScrollNext,
|
|
109
109
|
orientation,
|
|
110
|
-
handleKeyDown
|
|
110
|
+
handleKeyDown
|
|
111
111
|
}}
|
|
112
112
|
>
|
|
113
113
|
<div
|
|
@@ -123,7 +123,7 @@ export const ShadcnCarousel = React.forwardRef<HTMLDivElement, CarouselProps>(
|
|
|
123
123
|
</div>
|
|
124
124
|
</CarouselContext.Provider>
|
|
125
125
|
);
|
|
126
|
-
}
|
|
126
|
+
}
|
|
127
127
|
);
|
|
128
128
|
Carousel.displayName = 'Carousel';
|
|
129
129
|
|
|
@@ -147,7 +147,7 @@ export const ShadcnCarouselContent = React.forwardRef<HTMLDivElement, CarouselCo
|
|
|
147
147
|
orientation === 'horizontal'
|
|
148
148
|
? '-ms-4 overflow-x-auto snap-x snap-mandatory'
|
|
149
149
|
: '-mt-4 flex-col overflow-y-auto snap-y snap-mandatory',
|
|
150
|
-
className
|
|
150
|
+
className
|
|
151
151
|
)}
|
|
152
152
|
data-embla-container=""
|
|
153
153
|
{...props}
|
|
@@ -156,7 +156,7 @@ export const ShadcnCarouselContent = React.forwardRef<HTMLDivElement, CarouselCo
|
|
|
156
156
|
</div>
|
|
157
157
|
</div>
|
|
158
158
|
);
|
|
159
|
-
}
|
|
159
|
+
}
|
|
160
160
|
);
|
|
161
161
|
CarouselContent.displayName = 'CarouselContent';
|
|
162
162
|
|
|
@@ -175,7 +175,7 @@ export const ShadcnCarouselItem = React.forwardRef<HTMLDivElement, CarouselItemP
|
|
|
175
175
|
className={cn(
|
|
176
176
|
'min-w-0 shrink-0 grow-0 basis-full snap-start',
|
|
177
177
|
orientation === 'horizontal' ? 'ps-4' : 'pt-4',
|
|
178
|
-
className
|
|
178
|
+
className
|
|
179
179
|
)}
|
|
180
180
|
data-embla-slide=""
|
|
181
181
|
{...props}
|
|
@@ -183,7 +183,7 @@ export const ShadcnCarouselItem = React.forwardRef<HTMLDivElement, CarouselItemP
|
|
|
183
183
|
{children}
|
|
184
184
|
</div>
|
|
185
185
|
);
|
|
186
|
-
}
|
|
186
|
+
}
|
|
187
187
|
);
|
|
188
188
|
CarouselItem.displayName = 'CarouselItem';
|
|
189
189
|
|
|
@@ -208,7 +208,7 @@ export const ShadcnCarouselPrevious = React.forwardRef<HTMLButtonElement, Carous
|
|
|
208
208
|
orientation === 'horizontal'
|
|
209
209
|
? 'inset-y-0 -start-12 my-auto'
|
|
210
210
|
: 'start-1/2 -top-12 -translate-x-1/2 rotate-90',
|
|
211
|
-
className
|
|
211
|
+
className
|
|
212
212
|
)}
|
|
213
213
|
onClick={scrollPrev}
|
|
214
214
|
{...props}
|
|
@@ -217,7 +217,7 @@ export const ShadcnCarouselPrevious = React.forwardRef<HTMLButtonElement, Carous
|
|
|
217
217
|
<span className="sr-only">Previous slide</span>
|
|
218
218
|
</button>
|
|
219
219
|
);
|
|
220
|
-
}
|
|
220
|
+
}
|
|
221
221
|
);
|
|
222
222
|
CarouselPrevious.displayName = 'CarouselPrevious';
|
|
223
223
|
|
|
@@ -242,7 +242,7 @@ export const ShadcnCarouselNext = React.forwardRef<HTMLButtonElement, CarouselNe
|
|
|
242
242
|
orientation === 'horizontal'
|
|
243
243
|
? 'inset-y-0 -end-12 my-auto'
|
|
244
244
|
: 'start-1/2 -bottom-12 -translate-x-1/2 rotate-90',
|
|
245
|
-
className
|
|
245
|
+
className
|
|
246
246
|
)}
|
|
247
247
|
onClick={scrollNext}
|
|
248
248
|
{...props}
|
|
@@ -251,7 +251,7 @@ export const ShadcnCarouselNext = React.forwardRef<HTMLButtonElement, CarouselNe
|
|
|
251
251
|
<span className="sr-only">Next slide</span>
|
|
252
252
|
</button>
|
|
253
253
|
);
|
|
254
|
-
}
|
|
254
|
+
}
|
|
255
255
|
);
|
|
256
256
|
CarouselNext.displayName = 'CarouselNext';
|
|
257
257
|
|
|
@@ -260,7 +260,7 @@ export {
|
|
|
260
260
|
CarouselContent as Content,
|
|
261
261
|
CarouselItem as Item,
|
|
262
262
|
CarouselPrevious as Previous,
|
|
263
|
-
CarouselNext as Next
|
|
263
|
+
CarouselNext as Next
|
|
264
264
|
};
|
|
265
265
|
|
|
266
266
|
export default ShadcnCarousel;
|
|
@@ -61,7 +61,7 @@ export const ChartContainer = React.forwardRef<HTMLDivElement, ChartContainerPro
|
|
|
61
61
|
'[&_.lc-tooltip-rects-g]:fill-transparent',
|
|
62
62
|
'[&_.lc-layout-svg-g]:fill-transparent',
|
|
63
63
|
'[&_.lc-root-container]:w-full',
|
|
64
|
-
className
|
|
64
|
+
className
|
|
65
65
|
)}
|
|
66
66
|
{...props}
|
|
67
67
|
>
|
|
@@ -70,13 +70,13 @@ export const ChartContainer = React.forwardRef<HTMLDivElement, ChartContainerPro
|
|
|
70
70
|
</div>
|
|
71
71
|
</ChartContext.Provider>
|
|
72
72
|
);
|
|
73
|
-
}
|
|
73
|
+
}
|
|
74
74
|
);
|
|
75
75
|
ChartContainer.displayName = 'ChartContainer';
|
|
76
76
|
|
|
77
77
|
export const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
78
78
|
const colorConfig = Object.entries(config).filter(
|
|
79
|
-
([, itemConfig]) => itemConfig.theme || itemConfig.color
|
|
79
|
+
([, itemConfig]) => itemConfig.theme || itemConfig.color
|
|
80
80
|
);
|
|
81
81
|
|
|
82
82
|
if (!colorConfig.length) {
|
|
@@ -98,7 +98,7 @@ export const ChartStyle = ({ id, config }: { id: string; config: ChartConfig })
|
|
|
98
98
|
.join('\n');
|
|
99
99
|
return `${prefix} [data-chart=${id}] {\n${declarations}\n}`;
|
|
100
100
|
})
|
|
101
|
-
.join('\n')
|
|
101
|
+
.join('\n')
|
|
102
102
|
}}
|
|
103
103
|
/>
|
|
104
104
|
);
|
|
@@ -119,7 +119,7 @@ export interface ChartTooltipPayloadItem {
|
|
|
119
119
|
export function getPayloadConfigFromPayload(
|
|
120
120
|
config: ChartConfig,
|
|
121
121
|
payload: ChartTooltipPayloadItem,
|
|
122
|
-
key: string
|
|
122
|
+
key: string
|
|
123
123
|
) {
|
|
124
124
|
if (typeof payload !== 'object' || payload === null) return undefined;
|
|
125
125
|
|
|
@@ -154,7 +154,7 @@ export interface ChartTooltipContentProps extends React.ComponentProps<'div'> {
|
|
|
154
154
|
name: string,
|
|
155
155
|
item: ChartTooltipPayloadItem,
|
|
156
156
|
index: number,
|
|
157
|
-
payload: ChartTooltipPayloadItem[]
|
|
157
|
+
payload: ChartTooltipPayloadItem[]
|
|
158
158
|
) => React.ReactNode;
|
|
159
159
|
color?: string;
|
|
160
160
|
}
|
|
@@ -177,7 +177,7 @@ export const ChartTooltipContent = React.forwardRef<HTMLDivElement, ChartTooltip
|
|
|
177
177
|
labelKey,
|
|
178
178
|
...props
|
|
179
179
|
}: ChartTooltipContentProps & { labelClassName?: string },
|
|
180
|
-
ref
|
|
180
|
+
ref
|
|
181
181
|
) => {
|
|
182
182
|
const { config } = useChart();
|
|
183
183
|
|
|
@@ -219,7 +219,7 @@ export const ChartTooltipContent = React.forwardRef<HTMLDivElement, ChartTooltip
|
|
|
219
219
|
data-slot="chart-tooltip"
|
|
220
220
|
className={cn(
|
|
221
221
|
'grid min-w-[9rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',
|
|
222
|
-
className
|
|
222
|
+
className
|
|
223
223
|
)}
|
|
224
224
|
{...props}
|
|
225
225
|
>
|
|
@@ -235,7 +235,7 @@ export const ChartTooltipContent = React.forwardRef<HTMLDivElement, ChartTooltip
|
|
|
235
235
|
key={item.dataKey || item.name || index}
|
|
236
236
|
className={cn(
|
|
237
237
|
'flex w-full items-center gap-2 [&>svg]:size-2.5 [&>svg]:text-muted-foreground',
|
|
238
|
-
indicator === 'dot' && 'items-center'
|
|
238
|
+
indicator === 'dot' && 'items-center'
|
|
239
239
|
)}
|
|
240
240
|
>
|
|
241
241
|
{formatter && item?.value !== undefined && item.name ? (
|
|
@@ -251,13 +251,13 @@ export const ChartTooltipContent = React.forwardRef<HTMLDivElement, ChartTooltip
|
|
|
251
251
|
'h-3.5 w-1': indicator === 'line',
|
|
252
252
|
'w-0 border-[1.5px] border-dashed bg-transparent':
|
|
253
253
|
indicator === 'dashed',
|
|
254
|
-
'my-0.5': nestLabel && indicator === 'dashed'
|
|
255
|
-
}
|
|
254
|
+
'my-0.5': nestLabel && indicator === 'dashed'
|
|
255
|
+
}
|
|
256
256
|
)}
|
|
257
257
|
style={
|
|
258
258
|
{
|
|
259
259
|
'--color-bg': indicatorColor,
|
|
260
|
-
'--color-border': indicatorColor
|
|
260
|
+
'--color-border': indicatorColor
|
|
261
261
|
} as React.CSSProperties
|
|
262
262
|
}
|
|
263
263
|
/>
|
|
@@ -265,7 +265,7 @@ export const ChartTooltipContent = React.forwardRef<HTMLDivElement, ChartTooltip
|
|
|
265
265
|
<div
|
|
266
266
|
className={cn(
|
|
267
267
|
'flex flex-1 justify-between items-center leading-none',
|
|
268
|
-
nestLabel ? 'items-end' : 'items-center'
|
|
268
|
+
nestLabel ? 'items-end' : 'items-center'
|
|
269
269
|
)}
|
|
270
270
|
>
|
|
271
271
|
<div className="grid gap-1.5">
|
|
@@ -288,9 +288,9 @@ export const ChartTooltipContent = React.forwardRef<HTMLDivElement, ChartTooltip
|
|
|
288
288
|
</div>
|
|
289
289
|
</div>
|
|
290
290
|
);
|
|
291
|
-
}
|
|
291
|
+
}
|
|
292
292
|
);
|
|
293
293
|
ChartTooltipContent.displayName = 'ChartTooltipContent';
|
|
294
294
|
|
|
295
295
|
export const ChartTooltip = ChartTooltipContent;
|
|
296
|
-
export default ShadcnChart;
|
|
296
|
+
export default ShadcnChart;
|
|
@@ -30,10 +30,10 @@ export const ShadcnCheckbox = React.forwardRef<HTMLButtonElement, CheckboxProps>
|
|
|
30
30
|
onKeyDown,
|
|
31
31
|
...props
|
|
32
32
|
},
|
|
33
|
-
ref
|
|
33
|
+
ref
|
|
34
34
|
) => {
|
|
35
35
|
const [uncontrolledChecked, setUncontrolledChecked] = React.useState<boolean | 'indeterminate'>(
|
|
36
|
-
indeterminate ? 'indeterminate' : false
|
|
36
|
+
indeterminate ? 'indeterminate' : false
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
const isControlled = checkedProp !== undefined;
|
|
@@ -79,7 +79,7 @@ export const ShadcnCheckbox = React.forwardRef<HTMLButtonElement, CheckboxProps>
|
|
|
79
79
|
disabled={disabled}
|
|
80
80
|
className={cn(
|
|
81
81
|
'peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors group-has-disabled/field:opacity-50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
82
|
-
className
|
|
82
|
+
className
|
|
83
83
|
)}
|
|
84
84
|
onClick={handleClick}
|
|
85
85
|
onKeyDown={handleKeyDown}
|
|
@@ -109,7 +109,7 @@ export const ShadcnCheckbox = React.forwardRef<HTMLButtonElement, CheckboxProps>
|
|
|
109
109
|
)}
|
|
110
110
|
</>
|
|
111
111
|
);
|
|
112
|
-
}
|
|
112
|
+
}
|
|
113
113
|
);
|
|
114
114
|
|
|
115
115
|
Checkbox.displayName = 'Checkbox';
|
|
@@ -35,7 +35,7 @@ export const ShadcnCodeBlock = React.forwardRef<HTMLDivElement, CodeBlockProps>(
|
|
|
35
35
|
children,
|
|
36
36
|
...props
|
|
37
37
|
},
|
|
38
|
-
ref
|
|
38
|
+
ref
|
|
39
39
|
) => {
|
|
40
40
|
const [highlightedLight, setHighlightedLight] = React.useState<string>('');
|
|
41
41
|
const [highlightedDark, setHighlightedDark] = React.useState<string>('');
|
|
@@ -59,12 +59,12 @@ export const ShadcnCodeBlock = React.forwardRef<HTMLDivElement, CodeBlockProps>(
|
|
|
59
59
|
'mr-4',
|
|
60
60
|
'text-right',
|
|
61
61
|
'select-none',
|
|
62
|
-
'text-muted-foreground'
|
|
63
|
-
]
|
|
62
|
+
'text-muted-foreground'
|
|
63
|
+
]
|
|
64
64
|
},
|
|
65
|
-
children: [{ type: 'text', value: String(line) }]
|
|
65
|
+
children: [{ type: 'text', value: String(line) }]
|
|
66
66
|
});
|
|
67
|
-
}
|
|
67
|
+
}
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
const transformers = showLineNumbers ? [lineNumberTransformer] : [];
|
|
@@ -73,13 +73,13 @@ export const ShadcnCodeBlock = React.forwardRef<HTMLDivElement, CodeBlockProps>(
|
|
|
73
73
|
codeToHtml(code, {
|
|
74
74
|
lang: language,
|
|
75
75
|
theme: 'one-light',
|
|
76
|
-
transformers
|
|
76
|
+
transformers
|
|
77
77
|
}),
|
|
78
78
|
codeToHtml(code, {
|
|
79
79
|
lang: language,
|
|
80
80
|
theme: 'one-dark-pro',
|
|
81
|
-
transformers
|
|
82
|
-
})
|
|
81
|
+
transformers
|
|
82
|
+
})
|
|
83
83
|
]);
|
|
84
84
|
|
|
85
85
|
if (isMounted) {
|
|
@@ -110,7 +110,7 @@ export const ShadcnCodeBlock = React.forwardRef<HTMLDivElement, CodeBlockProps>(
|
|
|
110
110
|
ref={ref}
|
|
111
111
|
className={cn(
|
|
112
112
|
'group relative w-full overflow-hidden rounded-md border bg-background dark:bg-neutral-950 text-foreground font-mono text-sm',
|
|
113
|
-
className
|
|
113
|
+
className
|
|
114
114
|
)}
|
|
115
115
|
{...props}
|
|
116
116
|
>
|
|
@@ -118,19 +118,19 @@ export const ShadcnCodeBlock = React.forwardRef<HTMLDivElement, CodeBlockProps>(
|
|
|
118
118
|
<div
|
|
119
119
|
className={cn(
|
|
120
120
|
'overflow-auto dark:hidden [&>pre]:m-0 [&>pre]:bg-background dark:[&>pre]:bg-neutral-950! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm',
|
|
121
|
-
wrap && '[&>pre]:whitespace-pre-wrap [&>pre]:break-words'
|
|
121
|
+
wrap && '[&>pre]:whitespace-pre-wrap [&>pre]:break-words'
|
|
122
122
|
)}
|
|
123
123
|
dangerouslySetInnerHTML={{
|
|
124
|
-
__html: highlightedLight || `<pre class="p-4"><code>${code}</code></pre
|
|
124
|
+
__html: highlightedLight || `<pre class="p-4"><code>${code}</code></pre>`
|
|
125
125
|
}}
|
|
126
126
|
/>
|
|
127
127
|
<div
|
|
128
128
|
className={cn(
|
|
129
129
|
'hidden overflow-auto dark:block [&>pre]:m-0 [&>pre]:bg-background dark:[&>pre]:bg-neutral-950! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm',
|
|
130
|
-
wrap && '[&>pre]:whitespace-pre-wrap [&>pre]:break-words'
|
|
130
|
+
wrap && '[&>pre]:whitespace-pre-wrap [&>pre]:break-words'
|
|
131
131
|
)}
|
|
132
132
|
dangerouslySetInnerHTML={{
|
|
133
|
-
__html: highlightedDark || `<pre class="p-4"><code>${code}</code></pre
|
|
133
|
+
__html: highlightedDark || `<pre class="p-4"><code>${code}</code></pre>`
|
|
134
134
|
}}
|
|
135
135
|
/>
|
|
136
136
|
{children && (
|
|
@@ -140,7 +140,7 @@ export const ShadcnCodeBlock = React.forwardRef<HTMLDivElement, CodeBlockProps>(
|
|
|
140
140
|
</div>
|
|
141
141
|
</CodeBlockContext.Provider>
|
|
142
142
|
);
|
|
143
|
-
}
|
|
143
|
+
}
|
|
144
144
|
);
|
|
145
145
|
CodeBlock.displayName = 'CodeBlock';
|
|
146
146
|
|
|
@@ -183,7 +183,7 @@ export const CodeBlockCopyButton = React.forwardRef<HTMLButtonElement, CodeBlock
|
|
|
183
183
|
onClick={handleCopy}
|
|
184
184
|
className={cn(
|
|
185
185
|
'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-8 w-8 shrink-0 text-muted-foreground hover:text-foreground',
|
|
186
|
-
className
|
|
186
|
+
className
|
|
187
187
|
)}
|
|
188
188
|
{...props}
|
|
189
189
|
>
|
|
@@ -196,7 +196,7 @@ export const CodeBlockCopyButton = React.forwardRef<HTMLButtonElement, CodeBlock
|
|
|
196
196
|
)}
|
|
197
197
|
</button>
|
|
198
198
|
);
|
|
199
|
-
}
|
|
199
|
+
}
|
|
200
200
|
);
|
|
201
201
|
CodeBlockCopyButton.displayName = 'CodeBlockCopyButton';
|
|
202
202
|
|
|
@@ -44,7 +44,7 @@ export function ShadcnCollapsible({
|
|
|
44
44
|
}
|
|
45
45
|
onOpenChange?.(nextOpen);
|
|
46
46
|
},
|
|
47
|
-
[isControlled, onOpenChange]
|
|
47
|
+
[isControlled, onOpenChange]
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
return (
|
|
@@ -90,7 +90,7 @@ export function ShadcnCollapsibleTrigger({
|
|
|
90
90
|
}}
|
|
91
91
|
className={cn(
|
|
92
92
|
'flex items-center justify-between font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
93
|
-
className
|
|
93
|
+
className
|
|
94
94
|
)}
|
|
95
95
|
{...props}
|
|
96
96
|
>
|