@codefast/ui 0.0.50 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ZTEJNUH6.js → chunk-46W6RAYD.js} +1 -1
- package/dist/chunk-46W6RAYD.js.map +1 -0
- package/dist/{chunk-CERSQE5J.js → chunk-4JHGPRLG.js} +1 -1
- package/dist/chunk-4JHGPRLG.js.map +1 -0
- package/dist/{chunk-I6QCJDIF.mjs → chunk-5RENVAXH.mjs} +1 -1
- package/dist/chunk-5RENVAXH.mjs.map +1 -0
- package/dist/{chunk-47CSACCM.mjs → chunk-7ABWX5CF.mjs} +2 -2
- package/dist/chunk-7ABWX5CF.mjs.map +1 -0
- package/dist/{chunk-XHNT6PVI.mjs → chunk-BM5KYF6Y.mjs} +1 -1
- package/dist/chunk-BM5KYF6Y.mjs.map +1 -0
- package/dist/{chunk-P5AV3QU7.mjs → chunk-BNKSZEF2.mjs} +1 -1
- package/dist/chunk-BNKSZEF2.mjs.map +1 -0
- package/dist/{chunk-SDGUDONZ.js → chunk-DCDB56BO.js} +1 -1
- package/dist/chunk-DCDB56BO.js.map +1 -0
- package/dist/{chunk-6FL3EBDQ.mjs → chunk-HMD2ZU33.mjs} +1 -1
- package/dist/chunk-HMD2ZU33.mjs.map +1 -0
- package/dist/{chunk-JOBEKA4M.mjs → chunk-K63K4LTH.mjs} +2 -2
- package/dist/chunk-K63K4LTH.mjs.map +1 -0
- package/dist/{chunk-VXPAGNPJ.js → chunk-LJSD47ZL.js} +1 -1
- package/dist/chunk-LJSD47ZL.js.map +1 -0
- package/dist/{chunk-GDMHMSJ2.mjs → chunk-MFYACCZV.mjs} +1 -1
- package/dist/chunk-MFYACCZV.mjs.map +1 -0
- package/dist/{chunk-LG7ACTRE.js → chunk-PRCS3RWN.js} +1 -1
- package/dist/chunk-PRCS3RWN.js.map +1 -0
- package/dist/{chunk-OP6Q7VT5.js → chunk-RHFF4JNH.js} +1 -1
- package/dist/chunk-RHFF4JNH.js.map +1 -0
- package/dist/{chunk-SCPFGC2X.js → chunk-SCXRD727.js} +1 -1
- package/dist/chunk-SCXRD727.js.map +1 -0
- package/dist/{chunk-X3LRJQM3.js → chunk-VZVI3OHH.js} +2 -2
- package/dist/chunk-VZVI3OHH.js.map +1 -0
- package/dist/{chunk-UYRRHPPH.js → chunk-X4BEEJEW.js} +2 -2
- package/dist/chunk-X4BEEJEW.js.map +1 -0
- package/dist/{chunk-PWF46YXQ.mjs → chunk-Y2GMHG3Z.mjs} +1 -1
- package/dist/chunk-Y2GMHG3Z.mjs.map +1 -0
- package/dist/{chunk-MU2MZ434.mjs → chunk-ZIB4ZTST.mjs} +1 -1
- package/dist/chunk-ZIB4ZTST.mjs.map +1 -0
- package/dist/plugin/animate.plugin.js +1 -1
- package/dist/plugin/animate.plugin.mjs +1 -1
- package/dist/react/accordion.js.map +1 -1
- package/dist/react/accordion.mjs.map +1 -1
- package/dist/react/alert-dialog.js +1 -1
- package/dist/react/alert-dialog.js.map +1 -1
- package/dist/react/alert-dialog.mjs +1 -1
- package/dist/react/alert-dialog.mjs.map +1 -1
- package/dist/react/alert.js.map +1 -1
- package/dist/react/alert.mjs.map +1 -1
- package/dist/react/aspect-ratio.d.mts +1 -1
- package/dist/react/aspect-ratio.d.ts +1 -1
- package/dist/react/aspect-ratio.js.map +1 -1
- package/dist/react/aspect-ratio.mjs.map +1 -1
- package/dist/react/avatar.js.map +1 -1
- package/dist/react/avatar.mjs.map +1 -1
- package/dist/react/badge.js.map +1 -1
- package/dist/react/badge.mjs.map +1 -1
- package/dist/react/blockquote.js.map +1 -1
- package/dist/react/blockquote.mjs.map +1 -1
- package/dist/react/box.js.map +1 -1
- package/dist/react/box.mjs.map +1 -1
- package/dist/react/breadcrumb.js.map +1 -1
- package/dist/react/breadcrumb.mjs.map +1 -1
- package/dist/react/button.js +1 -1
- package/dist/react/button.mjs +1 -1
- package/dist/react/calendar.js +1 -1
- package/dist/react/calendar.js.map +1 -1
- package/dist/react/calendar.mjs +1 -1
- package/dist/react/calendar.mjs.map +1 -1
- package/dist/react/card.js.map +1 -1
- package/dist/react/card.mjs.map +1 -1
- package/dist/react/carousel.js +1 -1
- package/dist/react/carousel.js.map +1 -1
- package/dist/react/carousel.mjs +1 -1
- package/dist/react/carousel.mjs.map +1 -1
- package/dist/react/checkbox-cards.js +1 -1
- package/dist/react/checkbox-cards.js.map +1 -1
- package/dist/react/checkbox-cards.mjs +1 -1
- package/dist/react/checkbox-cards.mjs.map +1 -1
- package/dist/react/checkbox-group.js +1 -1
- package/dist/react/checkbox-group.js.map +1 -1
- package/dist/react/checkbox-group.mjs +1 -1
- package/dist/react/checkbox-group.mjs.map +1 -1
- package/dist/react/checkbox-group.primitive.js +1 -1
- package/dist/react/checkbox-group.primitive.mjs +1 -1
- package/dist/react/checkbox.js.map +1 -1
- package/dist/react/checkbox.mjs.map +1 -1
- package/dist/react/code.js.map +1 -1
- package/dist/react/code.mjs.map +1 -1
- package/dist/react/collapsible.js.map +1 -1
- package/dist/react/collapsible.mjs.map +1 -1
- package/dist/react/command.d.mts +8 -8
- package/dist/react/command.d.ts +8 -8
- package/dist/react/command.js +1 -1
- package/dist/react/command.js.map +1 -1
- package/dist/react/command.mjs +1 -1
- package/dist/react/command.mjs.map +1 -1
- package/dist/react/container.js.map +1 -1
- package/dist/react/container.mjs.map +1 -1
- package/dist/react/context-menu.js.map +1 -1
- package/dist/react/context-menu.mjs.map +1 -1
- package/dist/react/data-table.d.mts +1 -1
- package/dist/react/data-table.d.ts +1 -1
- package/dist/react/data-table.js +1 -1
- package/dist/react/data-table.js.map +1 -1
- package/dist/react/data-table.mjs +1 -1
- package/dist/react/data-table.mjs.map +1 -1
- package/dist/react/dialog.js +1 -1
- package/dist/react/dialog.mjs +1 -1
- package/dist/react/drawer.js.map +1 -1
- package/dist/react/drawer.mjs.map +1 -1
- package/dist/react/dropdown-menu.js +1 -1
- package/dist/react/dropdown-menu.mjs +1 -1
- package/dist/react/em.js.map +1 -1
- package/dist/react/em.mjs.map +1 -1
- package/dist/react/form.js +1 -1
- package/dist/react/form.js.map +1 -1
- package/dist/react/form.mjs +1 -1
- package/dist/react/form.mjs.map +1 -1
- package/dist/react/heading.js.map +1 -1
- package/dist/react/heading.mjs.map +1 -1
- package/dist/react/hover-card.js.map +1 -1
- package/dist/react/hover-card.mjs.map +1 -1
- package/dist/react/input-otp.js.map +1 -1
- package/dist/react/input-otp.mjs.map +1 -1
- package/dist/react/input.js.map +1 -1
- package/dist/react/input.mjs.map +1 -1
- package/dist/react/kbd.js.map +1 -1
- package/dist/react/kbd.mjs.map +1 -1
- package/dist/react/label.js +1 -1
- package/dist/react/label.mjs +1 -1
- package/dist/react/menubar.js.map +1 -1
- package/dist/react/menubar.mjs.map +1 -1
- package/dist/react/navigation-menu.js.map +1 -1
- package/dist/react/navigation-menu.mjs.map +1 -1
- package/dist/react/pagination.js +1 -1
- package/dist/react/pagination.js.map +1 -1
- package/dist/react/pagination.mjs +1 -1
- package/dist/react/pagination.mjs.map +1 -1
- package/dist/react/popover.js.map +1 -1
- package/dist/react/popover.mjs.map +1 -1
- package/dist/react/pre.js.map +1 -1
- package/dist/react/pre.mjs.map +1 -1
- package/dist/react/progress.js.map +1 -1
- package/dist/react/progress.mjs.map +1 -1
- package/dist/react/quote.js.map +1 -1
- package/dist/react/quote.mjs.map +1 -1
- package/dist/react/radio-cards.js.map +1 -1
- package/dist/react/radio-cards.mjs.map +1 -1
- package/dist/react/radio-group.js.map +1 -1
- package/dist/react/radio-group.mjs.map +1 -1
- package/dist/react/radio.js.map +1 -1
- package/dist/react/radio.mjs.map +1 -1
- package/dist/react/resizable.js.map +1 -1
- package/dist/react/resizable.mjs.map +1 -1
- package/dist/react/scroll-area.js.map +1 -1
- package/dist/react/scroll-area.mjs.map +1 -1
- package/dist/react/section.js.map +1 -1
- package/dist/react/section.mjs.map +1 -1
- package/dist/react/select.js +1 -1
- package/dist/react/select.mjs +1 -1
- package/dist/react/separator.js.map +1 -1
- package/dist/react/separator.mjs.map +1 -1
- package/dist/react/sheet.js +1 -1
- package/dist/react/sheet.js.map +1 -1
- package/dist/react/sheet.mjs +1 -1
- package/dist/react/sheet.mjs.map +1 -1
- package/dist/react/skeleton.js.map +1 -1
- package/dist/react/skeleton.mjs.map +1 -1
- package/dist/react/slider.js.map +1 -1
- package/dist/react/slider.mjs.map +1 -1
- package/dist/react/sonner.js.map +1 -1
- package/dist/react/sonner.mjs.map +1 -1
- package/dist/react/spinner.js +1 -1
- package/dist/react/spinner.mjs +1 -1
- package/dist/react/strong.js.map +1 -1
- package/dist/react/strong.mjs.map +1 -1
- package/dist/react/switch.js.map +1 -1
- package/dist/react/switch.mjs.map +1 -1
- package/dist/react/table.js.map +1 -1
- package/dist/react/table.mjs.map +1 -1
- package/dist/react/tabs.js.map +1 -1
- package/dist/react/tabs.mjs.map +1 -1
- package/dist/react/text.js.map +1 -1
- package/dist/react/text.mjs.map +1 -1
- package/dist/react/textarea.js.map +1 -1
- package/dist/react/textarea.mjs.map +1 -1
- package/dist/react/toggle-group.js +1 -1
- package/dist/react/toggle-group.js.map +1 -1
- package/dist/react/toggle-group.mjs +1 -1
- package/dist/react/toggle-group.mjs.map +1 -1
- package/dist/react/toggle.js +1 -1
- package/dist/react/toggle.mjs +1 -1
- package/dist/react/tooltip.js.map +1 -1
- package/dist/react/tooltip.mjs.map +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/tailwind.config.js +1 -1
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.mjs +1 -1
- package/dist/tailwind.config.mjs.map +1 -1
- package/package.json +6 -6
- package/plugin/animate.plugin.ts +2 -5
- package/src/react/accordion.tsx +36 -60
- package/src/react/alert-dialog.tsx +57 -125
- package/src/react/alert.tsx +16 -42
- package/src/react/aspect-ratio.tsx +2 -4
- package/src/react/avatar.tsx +15 -43
- package/src/react/badge.tsx +3 -8
- package/src/react/blockquote.tsx +5 -8
- package/src/react/box.tsx +4 -6
- package/src/react/breadcrumb.tsx +17 -50
- package/src/react/button.tsx +5 -20
- package/src/react/calendar.tsx +5 -22
- package/src/react/card.tsx +22 -56
- package/src/react/carousel.tsx +20 -76
- package/src/react/checkbox-cards.tsx +28 -55
- package/src/react/checkbox-group.primitive.tsx +24 -78
- package/src/react/checkbox-group.tsx +26 -49
- package/src/react/checkbox.tsx +15 -19
- package/src/react/code.tsx +4 -6
- package/src/react/collapsible.tsx +19 -29
- package/src/react/command.tsx +69 -134
- package/src/react/container.tsx +5 -9
- package/src/react/context-menu.tsx +146 -224
- package/src/react/data-table.tsx +16 -44
- package/src/react/dialog.tsx +45 -90
- package/src/react/drawer.tsx +44 -91
- package/src/react/dropdown-menu.tsx +126 -194
- package/src/react/em.tsx +4 -6
- package/src/react/form.tsx +49 -84
- package/src/react/heading.tsx +4 -6
- package/src/react/hover-card.tsx +22 -38
- package/src/react/input-otp.tsx +26 -37
- package/src/react/input.tsx +6 -16
- package/src/react/kbd.tsx +14 -16
- package/src/react/label.tsx +11 -12
- package/src/react/menubar.tsx +129 -208
- package/src/react/navigation-menu.tsx +105 -147
- package/src/react/pagination.tsx +18 -50
- package/src/react/popover.tsx +25 -40
- package/src/react/pre.tsx +4 -6
- package/src/react/progress.tsx +15 -22
- package/src/react/quote.tsx +4 -6
- package/src/react/radio-cards.tsx +7 -27
- package/src/react/radio-group.tsx +7 -27
- package/src/react/radio.tsx +14 -18
- package/src/react/resizable.tsx +2 -7
- package/src/react/scroll-area.tsx +30 -52
- package/src/react/section.tsx +4 -6
- package/src/react/select.tsx +108 -161
- package/src/react/separator.tsx +3 -12
- package/src/react/sheet.tsx +21 -71
- package/src/react/skeleton.tsx +1 -6
- package/src/react/slider.tsx +20 -27
- package/src/react/sonner.tsx +2 -4
- package/src/react/spinner.tsx +2 -7
- package/src/react/strong.tsx +4 -6
- package/src/react/switch.tsx +12 -14
- package/src/react/table.tsx +37 -82
- package/src/react/tabs.tsx +34 -44
- package/src/react/text.tsx +5 -8
- package/src/react/textarea.tsx +12 -14
- package/src/react/toggle-group.tsx +16 -57
- package/src/react/toggle.tsx +8 -15
- package/src/react/tooltip.tsx +24 -39
- package/tailwind.config.ts +2 -2
- package/dist/chunk-47CSACCM.mjs.map +0 -1
- package/dist/chunk-6FL3EBDQ.mjs.map +0 -1
- package/dist/chunk-CERSQE5J.js.map +0 -1
- package/dist/chunk-GDMHMSJ2.mjs.map +0 -1
- package/dist/chunk-I6QCJDIF.mjs.map +0 -1
- package/dist/chunk-JOBEKA4M.mjs.map +0 -1
- package/dist/chunk-LG7ACTRE.js.map +0 -1
- package/dist/chunk-MU2MZ434.mjs.map +0 -1
- package/dist/chunk-OP6Q7VT5.js.map +0 -1
- package/dist/chunk-P5AV3QU7.mjs.map +0 -1
- package/dist/chunk-PWF46YXQ.mjs.map +0 -1
- package/dist/chunk-SCPFGC2X.js.map +0 -1
- package/dist/chunk-SDGUDONZ.js.map +0 -1
- package/dist/chunk-UYRRHPPH.js.map +0 -1
- package/dist/chunk-VXPAGNPJ.js.map +0 -1
- package/dist/chunk-X3LRJQM3.js.map +0 -1
- package/dist/chunk-XHNT6PVI.mjs.map +0 -1
- package/dist/chunk-ZTEJNUH6.js.map +0 -1
package/src/react/breadcrumb.tsx
CHANGED
|
@@ -13,9 +13,9 @@ interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
13
13
|
separator?: React.ReactNode;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const Breadcrumb = React.forwardRef<BreadcrumbElement, BreadcrumbProps>(
|
|
17
|
-
|
|
18
|
-
);
|
|
16
|
+
const Breadcrumb = React.forwardRef<BreadcrumbElement, BreadcrumbProps>(({ ...props }, ref) => (
|
|
17
|
+
<nav ref={ref} aria-label="breadcrumb" {...props} />
|
|
18
|
+
));
|
|
19
19
|
|
|
20
20
|
Breadcrumb.displayName = 'Breadcrumb';
|
|
21
21
|
|
|
@@ -26,10 +26,7 @@ Breadcrumb.displayName = 'Breadcrumb';
|
|
|
26
26
|
type BreadcrumbListElement = HTMLOListElement;
|
|
27
27
|
type BreadcrumbListProps = React.OlHTMLAttributes<HTMLOListElement>;
|
|
28
28
|
|
|
29
|
-
const BreadcrumbList = React.forwardRef<
|
|
30
|
-
BreadcrumbListElement,
|
|
31
|
-
BreadcrumbListProps
|
|
32
|
-
>(({ className, ...props }, ref) => (
|
|
29
|
+
const BreadcrumbList = React.forwardRef<BreadcrumbListElement, BreadcrumbListProps>(({ className, ...props }, ref) => (
|
|
33
30
|
<ol
|
|
34
31
|
ref={ref}
|
|
35
32
|
className={cn(
|
|
@@ -49,15 +46,8 @@ BreadcrumbList.displayName = 'BreadcrumbList';
|
|
|
49
46
|
type BreadcrumbItemElement = HTMLLIElement;
|
|
50
47
|
type BreadcrumbItemProps = React.LiHTMLAttributes<HTMLLIElement>;
|
|
51
48
|
|
|
52
|
-
const BreadcrumbItem = React.forwardRef<
|
|
53
|
-
|
|
54
|
-
BreadcrumbItemProps
|
|
55
|
-
>(({ className, ...props }, ref) => (
|
|
56
|
-
<li
|
|
57
|
-
ref={ref}
|
|
58
|
-
className={cn('inline-flex items-center gap-1.5', className)}
|
|
59
|
-
{...props}
|
|
60
|
-
/>
|
|
49
|
+
const BreadcrumbItem = React.forwardRef<BreadcrumbItemElement, BreadcrumbItemProps>(({ className, ...props }, ref) => (
|
|
50
|
+
<li ref={ref} className={cn('inline-flex items-center gap-1.5', className)} {...props} />
|
|
61
51
|
));
|
|
62
52
|
|
|
63
53
|
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
@@ -68,25 +58,17 @@ BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
|
68
58
|
|
|
69
59
|
type BreadcrumbLinkElement = HTMLAnchorElement;
|
|
70
60
|
|
|
71
|
-
interface BreadcrumbLinkProps
|
|
72
|
-
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
61
|
+
interface BreadcrumbLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
73
62
|
asChild?: boolean;
|
|
74
63
|
}
|
|
75
64
|
|
|
76
|
-
const BreadcrumbLink = React.forwardRef<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
>(({ asChild, className, ...props }, ref) => {
|
|
80
|
-
const Component = asChild ? Slot : 'a';
|
|
65
|
+
const BreadcrumbLink = React.forwardRef<BreadcrumbLinkElement, BreadcrumbLinkProps>(
|
|
66
|
+
({ asChild, className, ...props }, ref) => {
|
|
67
|
+
const Component = asChild ? Slot : 'a';
|
|
81
68
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
className={cn('transition', 'hover:text-foreground', className)}
|
|
86
|
-
{...props}
|
|
87
|
-
/>
|
|
88
|
-
);
|
|
89
|
-
});
|
|
69
|
+
return <Component ref={ref} className={cn('transition', 'hover:text-foreground', className)} {...props} />;
|
|
70
|
+
},
|
|
71
|
+
);
|
|
90
72
|
|
|
91
73
|
BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
92
74
|
|
|
@@ -97,10 +79,7 @@ BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
|
97
79
|
type BreadcrumbPageElement = HTMLSpanElement;
|
|
98
80
|
type BreadcrumbPageProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
99
81
|
|
|
100
|
-
const BreadcrumbPage = React.forwardRef<
|
|
101
|
-
BreadcrumbPageElement,
|
|
102
|
-
BreadcrumbPageProps
|
|
103
|
-
>(({ className, ...props }, ref) => (
|
|
82
|
+
const BreadcrumbPage = React.forwardRef<BreadcrumbPageElement, BreadcrumbPageProps>(({ className, ...props }, ref) => (
|
|
104
83
|
<span
|
|
105
84
|
ref={ref}
|
|
106
85
|
role="link"
|
|
@@ -119,18 +98,9 @@ BreadcrumbPage.displayName = 'BreadcrumbPage';
|
|
|
119
98
|
|
|
120
99
|
type BreadcrumbSeparatorProps = React.LiHTMLAttributes<HTMLLIElement>;
|
|
121
100
|
|
|
122
|
-
function BreadcrumbSeparator({
|
|
123
|
-
children,
|
|
124
|
-
className,
|
|
125
|
-
...props
|
|
126
|
-
}: BreadcrumbSeparatorProps): React.JSX.Element {
|
|
101
|
+
function BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps): React.JSX.Element {
|
|
127
102
|
return (
|
|
128
|
-
<li
|
|
129
|
-
role="presentation"
|
|
130
|
-
aria-hidden="true"
|
|
131
|
-
className={cn('[&>svg]:size-3.5', className)}
|
|
132
|
-
{...props}
|
|
133
|
-
>
|
|
103
|
+
<li role="presentation" aria-hidden="true" className={cn('[&>svg]:size-3.5', className)} {...props}>
|
|
134
104
|
{children ?? <ChevronRightIcon />}
|
|
135
105
|
</li>
|
|
136
106
|
);
|
|
@@ -142,10 +112,7 @@ function BreadcrumbSeparator({
|
|
|
142
112
|
|
|
143
113
|
type BreadcrumbEllipsisProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
144
114
|
|
|
145
|
-
function BreadcrumbEllipsis({
|
|
146
|
-
className,
|
|
147
|
-
...props
|
|
148
|
-
}: BreadcrumbEllipsisProps): React.JSX.Element {
|
|
115
|
+
function BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps): React.JSX.Element {
|
|
149
116
|
return (
|
|
150
117
|
<span
|
|
151
118
|
role="presentation"
|
package/src/react/button.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
3
|
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
-
import { type VariantProps } from 'cva';
|
|
5
4
|
import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
|
|
6
5
|
import { cva } from '../lib/utils';
|
|
7
6
|
import { Spinner } from './spinner';
|
|
7
|
+
import type { VariantProps } from 'cva';
|
|
8
8
|
|
|
9
9
|
/* -----------------------------------------------------------------------------
|
|
10
10
|
* Variant: Button
|
|
@@ -15,14 +15,12 @@ const buttonVariants = cva({
|
|
|
15
15
|
variants: {
|
|
16
16
|
variant: {
|
|
17
17
|
default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow',
|
|
18
|
-
destructive:
|
|
19
|
-
'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',
|
|
18
|
+
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',
|
|
20
19
|
ghost: 'text-foreground hover:bg-accent hover:text-accent-foreground',
|
|
21
20
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
22
21
|
outline:
|
|
23
22
|
'border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground border shadow-sm',
|
|
24
|
-
secondary:
|
|
25
|
-
'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',
|
|
23
|
+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',
|
|
26
24
|
},
|
|
27
25
|
size: {
|
|
28
26
|
default: 'h-10 px-4 gap-2',
|
|
@@ -53,25 +51,12 @@ type ButtonVariantsProps = VariantProps<typeof buttonVariants>;
|
|
|
53
51
|
|
|
54
52
|
type ButtonElement = HTMLButtonElement;
|
|
55
53
|
|
|
56
|
-
interface ButtonProps
|
|
57
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
58
|
-
ButtonVariantsProps {
|
|
54
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ButtonVariantsProps {
|
|
59
55
|
asChild?: boolean;
|
|
60
56
|
}
|
|
61
57
|
|
|
62
58
|
const Button = React.forwardRef<ButtonElement, ButtonProps>(
|
|
63
|
-
(
|
|
64
|
-
{
|
|
65
|
-
children,
|
|
66
|
-
className,
|
|
67
|
-
variant,
|
|
68
|
-
size,
|
|
69
|
-
loading = false,
|
|
70
|
-
asChild = false,
|
|
71
|
-
...props
|
|
72
|
-
},
|
|
73
|
-
ref,
|
|
74
|
-
) => {
|
|
59
|
+
({ children, className, variant, size, loading = false, asChild = false, ...props }, ref) => {
|
|
75
60
|
const Component = asChild ? Slot : 'button';
|
|
76
61
|
const ComponentLoading = asChild ? 'span' : Fragment;
|
|
77
62
|
const disabled = loading || props.disabled;
|
package/src/react/calendar.tsx
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
5
|
-
type DateRange,
|
|
6
|
-
DayPicker,
|
|
7
|
-
type DayPickerProps,
|
|
8
|
-
type StyledComponent,
|
|
9
|
-
} from 'react-day-picker';
|
|
4
|
+
import { type DateRange, DayPicker, type DayPickerProps, type StyledComponent } from 'react-day-picker';
|
|
10
5
|
import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';
|
|
11
6
|
import { cn } from '../lib/utils';
|
|
12
7
|
import { buttonVariants } from './button';
|
|
@@ -15,28 +10,17 @@ import { buttonVariants } from './button';
|
|
|
15
10
|
* Component: Calendar
|
|
16
11
|
* -------------------------------------------------------------------------- */
|
|
17
12
|
|
|
18
|
-
function ChevronLeft({
|
|
19
|
-
children: _,
|
|
20
|
-
...props
|
|
21
|
-
}: StyledComponent): React.JSX.Element {
|
|
13
|
+
function ChevronLeft({ children: _, ...props }: StyledComponent): React.JSX.Element {
|
|
22
14
|
return <ChevronLeftIcon className="size-4" {...props} />;
|
|
23
15
|
}
|
|
24
16
|
|
|
25
|
-
function ChevronRight({
|
|
26
|
-
children: _,
|
|
27
|
-
...props
|
|
28
|
-
}: StyledComponent): React.JSX.Element {
|
|
17
|
+
function ChevronRight({ children: _, ...props }: StyledComponent): React.JSX.Element {
|
|
29
18
|
return <ChevronRightIcon className="size-4" {...props} />;
|
|
30
19
|
}
|
|
31
20
|
|
|
32
21
|
type CalendarProps = DayPickerProps;
|
|
33
22
|
|
|
34
|
-
function Calendar({
|
|
35
|
-
className,
|
|
36
|
-
classNames,
|
|
37
|
-
showOutsideDays = true,
|
|
38
|
-
...props
|
|
39
|
-
}: CalendarProps): React.JSX.Element {
|
|
23
|
+
function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps): React.JSX.Element {
|
|
40
24
|
return (
|
|
41
25
|
<DayPicker
|
|
42
26
|
showOutsideDays={showOutsideDays}
|
|
@@ -75,8 +59,7 @@ function Calendar({
|
|
|
75
59
|
day_outside:
|
|
76
60
|
'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',
|
|
77
61
|
day_disabled: 'text-muted-foreground opacity-50',
|
|
78
|
-
day_range_middle:
|
|
79
|
-
'aria-selected:bg-accent aria-selected:text-accent-foreground',
|
|
62
|
+
day_range_middle: 'aria-selected:bg-accent aria-selected:text-accent-foreground',
|
|
80
63
|
day_hidden: 'invisible',
|
|
81
64
|
...classNames,
|
|
82
65
|
}}
|
package/src/react/card.tsx
CHANGED
|
@@ -8,18 +8,9 @@ import { cn } from '../lib/utils';
|
|
|
8
8
|
type CardElement = HTMLDivElement;
|
|
9
9
|
type CardProps = React.HTMLAttributes<HTMLDivElement>;
|
|
10
10
|
|
|
11
|
-
const Card = React.forwardRef<CardElement, CardProps>(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
ref={ref}
|
|
15
|
-
className={cn(
|
|
16
|
-
'bg-card text-card-foreground rounded-lg border shadow-sm',
|
|
17
|
-
className,
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
),
|
|
22
|
-
);
|
|
11
|
+
const Card = React.forwardRef<CardElement, CardProps>(({ className, ...props }, ref) => (
|
|
12
|
+
<div ref={ref} className={cn('bg-card text-card-foreground rounded-lg border shadow-sm', className)} {...props} />
|
|
13
|
+
));
|
|
23
14
|
|
|
24
15
|
Card.displayName = 'Card';
|
|
25
16
|
|
|
@@ -30,15 +21,9 @@ Card.displayName = 'Card';
|
|
|
30
21
|
type CardHeaderElement = HTMLDivElement;
|
|
31
22
|
type CardHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
32
23
|
|
|
33
|
-
const CardHeader = React.forwardRef<CardHeaderElement, CardHeaderProps>(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
ref={ref}
|
|
37
|
-
className={cn('flex flex-col space-y-1.5 p-6', className)}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
),
|
|
41
|
-
);
|
|
24
|
+
const CardHeader = React.forwardRef<CardHeaderElement, CardHeaderProps>(({ className, ...props }, ref) => (
|
|
25
|
+
<div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
|
|
26
|
+
));
|
|
42
27
|
|
|
43
28
|
CardHeader.displayName = 'CardHeader';
|
|
44
29
|
|
|
@@ -49,17 +34,11 @@ CardHeader.displayName = 'CardHeader';
|
|
|
49
34
|
type CardTitleElement = HTMLParagraphElement;
|
|
50
35
|
type CardTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
51
36
|
|
|
52
|
-
const CardTitle = React.forwardRef<CardTitleElement, CardTitleProps>(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{...props}
|
|
58
|
-
>
|
|
59
|
-
{children}
|
|
60
|
-
</h3>
|
|
61
|
-
),
|
|
62
|
-
);
|
|
37
|
+
const CardTitle = React.forwardRef<CardTitleElement, CardTitleProps>(({ children, className, ...props }, ref) => (
|
|
38
|
+
<h3 ref={ref} className={cn('font-semibold leading-none tracking-tight', className)} {...props}>
|
|
39
|
+
{children}
|
|
40
|
+
</h3>
|
|
41
|
+
));
|
|
63
42
|
|
|
64
43
|
CardTitle.displayName = 'CardTitle';
|
|
65
44
|
|
|
@@ -70,16 +49,11 @@ CardTitle.displayName = 'CardTitle';
|
|
|
70
49
|
type CardDescriptionElement = HTMLParagraphElement;
|
|
71
50
|
type CardDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
72
51
|
|
|
73
|
-
const CardDescription = React.forwardRef<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
ref={ref}
|
|
79
|
-
className={cn('text-muted-foreground text-sm', className)}
|
|
80
|
-
{...props}
|
|
81
|
-
/>
|
|
82
|
-
));
|
|
52
|
+
const CardDescription = React.forwardRef<CardDescriptionElement, CardDescriptionProps>(
|
|
53
|
+
({ className, ...props }, ref) => (
|
|
54
|
+
<p ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
|
|
55
|
+
),
|
|
56
|
+
);
|
|
83
57
|
|
|
84
58
|
CardDescription.displayName = 'CardDescription';
|
|
85
59
|
|
|
@@ -90,11 +64,9 @@ CardDescription.displayName = 'CardDescription';
|
|
|
90
64
|
type CardContentElement = HTMLDivElement;
|
|
91
65
|
type CardContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
92
66
|
|
|
93
|
-
const CardContent = React.forwardRef<CardContentElement, CardContentProps>(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
),
|
|
97
|
-
);
|
|
67
|
+
const CardContent = React.forwardRef<CardContentElement, CardContentProps>(({ className, ...props }, ref) => (
|
|
68
|
+
<div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
|
|
69
|
+
));
|
|
98
70
|
|
|
99
71
|
CardContent.displayName = 'CardContent';
|
|
100
72
|
|
|
@@ -105,15 +77,9 @@ CardContent.displayName = 'CardContent';
|
|
|
105
77
|
type CardFooterElement = HTMLDivElement;
|
|
106
78
|
type CardFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
107
79
|
|
|
108
|
-
const CardFooter = React.forwardRef<CardFooterElement, CardFooterProps>(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
ref={ref}
|
|
112
|
-
className={cn('flex items-center p-6 pt-0', className)}
|
|
113
|
-
{...props}
|
|
114
|
-
/>
|
|
115
|
-
),
|
|
116
|
-
);
|
|
80
|
+
const CardFooter = React.forwardRef<CardFooterElement, CardFooterProps>(({ className, ...props }, ref) => (
|
|
81
|
+
<div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
|
|
82
|
+
));
|
|
117
83
|
|
|
118
84
|
CardFooter.displayName = 'CardFooter';
|
|
119
85
|
|
package/src/react/carousel.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import useEmblaCarousel, {
|
|
5
|
-
type UseEmblaCarouselType,
|
|
6
|
-
} from 'embla-carousel-react';
|
|
4
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';
|
|
7
5
|
import { ArrowLeftIcon, ArrowRightIcon } from '@radix-ui/react-icons';
|
|
8
|
-
import { createContextScope
|
|
6
|
+
import { createContextScope } from '@radix-ui/react-context';
|
|
9
7
|
import { cn } from '../lib/utils';
|
|
10
|
-
import { Button
|
|
8
|
+
import { Button } from './button';
|
|
9
|
+
import type { ButtonProps } from './button';
|
|
10
|
+
import type { Scope } from '@radix-ui/react-context';
|
|
11
11
|
|
|
12
12
|
/* -----------------------------------------------------------------------------
|
|
13
13
|
* Context: Carousel
|
|
@@ -40,8 +40,7 @@ type CarouselContextValue = {
|
|
|
40
40
|
canScrollNext: boolean;
|
|
41
41
|
} & BaseCarouselProps;
|
|
42
42
|
|
|
43
|
-
const [CarouselProvider, useCarouselContext] =
|
|
44
|
-
createCarouselContext<CarouselContextValue>(CAROUSEL_NAME);
|
|
43
|
+
const [CarouselProvider, useCarouselContext] = createCarouselContext<CarouselContextValue>(CAROUSEL_NAME);
|
|
45
44
|
|
|
46
45
|
/* -----------------------------------------------------------------------------
|
|
47
46
|
* Component: Carousel
|
|
@@ -52,16 +51,7 @@ type CarouselProps = React.HTMLAttributes<HTMLDivElement> & BaseCarouselProps;
|
|
|
52
51
|
|
|
53
52
|
const Carousel = React.forwardRef<CarouselElement, CarouselProps>(
|
|
54
53
|
(
|
|
55
|
-
{
|
|
56
|
-
__scopeCarousel,
|
|
57
|
-
children,
|
|
58
|
-
orientation,
|
|
59
|
-
opts,
|
|
60
|
-
setApi,
|
|
61
|
-
plugins,
|
|
62
|
-
className,
|
|
63
|
-
...props
|
|
64
|
-
}: ScopedProps<CarouselProps>,
|
|
54
|
+
{ __scopeCarousel, children, orientation, opts, setApi, plugins, className, ...props }: ScopedProps<CarouselProps>,
|
|
65
55
|
ref,
|
|
66
56
|
) => {
|
|
67
57
|
const [carouselRef, api] = useEmblaCarousel(
|
|
@@ -133,9 +123,7 @@ const Carousel = React.forwardRef<CarouselElement, CarouselProps>(
|
|
|
133
123
|
carouselRef={carouselRef}
|
|
134
124
|
api={api}
|
|
135
125
|
opts={opts}
|
|
136
|
-
orientation={
|
|
137
|
-
orientation ?? (opts?.axis === 'y' ? 'vertical' : 'horizontal')
|
|
138
|
-
}
|
|
126
|
+
orientation={orientation ?? (opts?.axis === 'y' ? 'vertical' : 'horizontal')}
|
|
139
127
|
scrollPrev={scrollPrev}
|
|
140
128
|
scrollNext={scrollNext}
|
|
141
129
|
canScrollPrev={canScrollPrev}
|
|
@@ -167,28 +155,15 @@ const CAROUSEL_CONTENT_NAME = 'CarouselContent';
|
|
|
167
155
|
type CarouselContentElement = HTMLDivElement;
|
|
168
156
|
type CarouselContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
169
157
|
|
|
170
|
-
const CarouselContent = React.forwardRef<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
>(
|
|
174
|
-
(
|
|
175
|
-
{ __scopeCarousel, className, ...props }: ScopedProps<CarouselContentProps>,
|
|
176
|
-
ref,
|
|
177
|
-
) => {
|
|
178
|
-
const { carouselRef, orientation } = useCarouselContext(
|
|
179
|
-
CAROUSEL_CONTENT_NAME,
|
|
180
|
-
__scopeCarousel,
|
|
181
|
-
);
|
|
158
|
+
const CarouselContent = React.forwardRef<CarouselContentElement, CarouselContentProps>(
|
|
159
|
+
({ __scopeCarousel, className, ...props }: ScopedProps<CarouselContentProps>, ref) => {
|
|
160
|
+
const { carouselRef, orientation } = useCarouselContext(CAROUSEL_CONTENT_NAME, __scopeCarousel);
|
|
182
161
|
|
|
183
162
|
return (
|
|
184
163
|
<div ref={carouselRef} className="overflow-hidden">
|
|
185
164
|
<div
|
|
186
165
|
ref={ref}
|
|
187
|
-
className={cn(
|
|
188
|
-
'flex',
|
|
189
|
-
orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',
|
|
190
|
-
className,
|
|
191
|
-
)}
|
|
166
|
+
className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)}
|
|
192
167
|
{...props}
|
|
193
168
|
/>
|
|
194
169
|
</div>
|
|
@@ -208,25 +183,15 @@ type CarouselItemElement = HTMLDivElement;
|
|
|
208
183
|
type CarouselItemProps = React.HTMLAttributes<HTMLDivElement>;
|
|
209
184
|
|
|
210
185
|
const CarouselItem = React.forwardRef<CarouselItemElement, CarouselItemProps>(
|
|
211
|
-
(
|
|
212
|
-
{
|
|
213
|
-
ref,
|
|
214
|
-
) => {
|
|
215
|
-
const { orientation } = useCarouselContext(
|
|
216
|
-
CAROUSEL_ITEM_NAME,
|
|
217
|
-
__scopeCarousel,
|
|
218
|
-
);
|
|
186
|
+
({ __scopeCarousel, className, ...props }: ScopedProps<CarouselItemProps>, ref) => {
|
|
187
|
+
const { orientation } = useCarouselContext(CAROUSEL_ITEM_NAME, __scopeCarousel);
|
|
219
188
|
|
|
220
189
|
return (
|
|
221
190
|
<div
|
|
222
191
|
ref={ref}
|
|
223
192
|
role="group"
|
|
224
193
|
aria-roledescription="slide"
|
|
225
|
-
className={cn(
|
|
226
|
-
'min-w-0 shrink-0 grow-0 basis-full',
|
|
227
|
-
orientation === 'horizontal' ? 'pl-4' : 'pt-4',
|
|
228
|
-
className,
|
|
229
|
-
)}
|
|
194
|
+
className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}
|
|
230
195
|
{...props}
|
|
231
196
|
/>
|
|
232
197
|
);
|
|
@@ -244,24 +209,12 @@ const CAROUSEL_PREVIOUS_NAME = 'CarouselPrevious';
|
|
|
244
209
|
type CarouselPreviousElement = HTMLButtonElement;
|
|
245
210
|
type CarouselPreviousProps = ButtonProps;
|
|
246
211
|
|
|
247
|
-
const CarouselPrevious = React.forwardRef<
|
|
248
|
-
CarouselPreviousElement,
|
|
249
|
-
CarouselPreviousProps
|
|
250
|
-
>(
|
|
212
|
+
const CarouselPrevious = React.forwardRef<CarouselPreviousElement, CarouselPreviousProps>(
|
|
251
213
|
(
|
|
252
|
-
{
|
|
253
|
-
__scopeCarousel,
|
|
254
|
-
className,
|
|
255
|
-
variant = 'outline',
|
|
256
|
-
size = 'icon',
|
|
257
|
-
...props
|
|
258
|
-
}: ScopedProps<CarouselPreviousProps>,
|
|
214
|
+
{ __scopeCarousel, className, variant = 'outline', size = 'icon', ...props }: ScopedProps<CarouselPreviousProps>,
|
|
259
215
|
ref,
|
|
260
216
|
) => {
|
|
261
|
-
const { orientation, scrollPrev, canScrollPrev } = useCarouselContext(
|
|
262
|
-
CAROUSEL_PREVIOUS_NAME,
|
|
263
|
-
__scopeCarousel,
|
|
264
|
-
);
|
|
217
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarouselContext(CAROUSEL_PREVIOUS_NAME, __scopeCarousel);
|
|
265
218
|
|
|
266
219
|
return (
|
|
267
220
|
<Button
|
|
@@ -299,19 +252,10 @@ type CarouselNextProps = ButtonProps;
|
|
|
299
252
|
|
|
300
253
|
const CarouselNext = React.forwardRef<CarouselNextElement, CarouselNextProps>(
|
|
301
254
|
(
|
|
302
|
-
{
|
|
303
|
-
__scopeCarousel,
|
|
304
|
-
className,
|
|
305
|
-
variant = 'outline',
|
|
306
|
-
size = 'icon',
|
|
307
|
-
...props
|
|
308
|
-
}: ScopedProps<CarouselNextProps>,
|
|
255
|
+
{ __scopeCarousel, className, variant = 'outline', size = 'icon', ...props }: ScopedProps<CarouselNextProps>,
|
|
309
256
|
ref,
|
|
310
257
|
) => {
|
|
311
|
-
const { orientation, scrollNext, canScrollNext } = useCarouselContext(
|
|
312
|
-
CAROUSEL_NEXT_NAME,
|
|
313
|
-
__scopeCarousel,
|
|
314
|
-
);
|
|
258
|
+
const { orientation, scrollNext, canScrollNext } = useCarouselContext(CAROUSEL_NEXT_NAME, __scopeCarousel);
|
|
315
259
|
|
|
316
260
|
return (
|
|
317
261
|
<Button
|
|
@@ -9,24 +9,11 @@ import * as CheckboxGroupPrimitive from './checkbox-group.primitive';
|
|
|
9
9
|
* Component: CheckboxCards
|
|
10
10
|
* -------------------------------------------------------------------------- */
|
|
11
11
|
|
|
12
|
-
type CheckboxCardsElement = React.ElementRef<
|
|
13
|
-
|
|
14
|
-
>;
|
|
15
|
-
type CheckboxCardsProps = React.ComponentPropsWithoutRef<
|
|
16
|
-
typeof CheckboxGroupPrimitive.Root
|
|
17
|
-
>;
|
|
12
|
+
type CheckboxCardsElement = React.ElementRef<typeof CheckboxGroupPrimitive.Root>;
|
|
13
|
+
type CheckboxCardsProps = React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Root>;
|
|
18
14
|
|
|
19
|
-
const CheckboxCards = React.forwardRef<
|
|
20
|
-
|
|
21
|
-
CheckboxCardsProps
|
|
22
|
-
>(({ className, ...props }, ref) => {
|
|
23
|
-
return (
|
|
24
|
-
<CheckboxGroupPrimitive.Root
|
|
25
|
-
className={cn('grid gap-2', className)}
|
|
26
|
-
{...props}
|
|
27
|
-
ref={ref}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
15
|
+
const CheckboxCards = React.forwardRef<CheckboxCardsElement, CheckboxCardsProps>(({ className, ...props }, ref) => {
|
|
16
|
+
return <CheckboxGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={ref} />;
|
|
30
17
|
});
|
|
31
18
|
|
|
32
19
|
CheckboxCards.displayName = CheckboxGroupPrimitive.Root.displayName;
|
|
@@ -35,42 +22,33 @@ CheckboxCards.displayName = CheckboxGroupPrimitive.Root.displayName;
|
|
|
35
22
|
* Component: CheckboxCardsItem
|
|
36
23
|
* -------------------------------------------------------------------------- */
|
|
37
24
|
|
|
38
|
-
type CheckboxCardsItemElement = React.ElementRef<
|
|
39
|
-
typeof CheckboxGroupPrimitive.Item
|
|
40
|
-
>;
|
|
25
|
+
type CheckboxCardsItemElement = React.ElementRef<typeof CheckboxGroupPrimitive.Item>;
|
|
41
26
|
|
|
42
|
-
interface CheckboxCardsItemProps
|
|
43
|
-
extends React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Item> {
|
|
27
|
+
interface CheckboxCardsItemProps extends React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Item> {
|
|
44
28
|
checkboxClassName?: string;
|
|
45
29
|
}
|
|
46
30
|
|
|
47
|
-
const CheckboxCardsItem = React.forwardRef<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<CheckIcon className="size-3.5" />
|
|
69
|
-
</CheckboxGroupPrimitive.CheckboxGroupIndicator>
|
|
70
|
-
</CheckboxGroupPrimitive.Item>
|
|
71
|
-
</label>
|
|
72
|
-
);
|
|
73
|
-
});
|
|
31
|
+
const CheckboxCardsItem = React.forwardRef<CheckboxCardsItemElement, CheckboxCardsItemProps>(
|
|
32
|
+
({ children, className, checkboxClassName, ...props }, ref) => {
|
|
33
|
+
return (
|
|
34
|
+
<label className={cn('flex items-center justify-center gap-4 rounded-md border p-4', className)}>
|
|
35
|
+
{children}
|
|
36
|
+
<CheckboxGroupPrimitive.Item
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn(
|
|
39
|
+
'border-input aria-checked:border-primary aria-checked:bg-primary aria-checked:text-primary-foreground peer flex size-4 shrink-0 cursor-pointer rounded-sm border shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
40
|
+
checkboxClassName,
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
>
|
|
44
|
+
<CheckboxGroupPrimitive.CheckboxGroupIndicator className="flex size-full items-center justify-center text-current">
|
|
45
|
+
<CheckIcon className="size-3.5" />
|
|
46
|
+
</CheckboxGroupPrimitive.CheckboxGroupIndicator>
|
|
47
|
+
</CheckboxGroupPrimitive.Item>
|
|
48
|
+
</label>
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
);
|
|
74
52
|
|
|
75
53
|
CheckboxCardsItem.displayName = CheckboxGroupPrimitive.Item.displayName;
|
|
76
54
|
|
|
@@ -78,9 +56,4 @@ CheckboxCardsItem.displayName = CheckboxGroupPrimitive.Item.displayName;
|
|
|
78
56
|
* Exports
|
|
79
57
|
* -------------------------------------------------------------------------- */
|
|
80
58
|
|
|
81
|
-
export {
|
|
82
|
-
CheckboxCards,
|
|
83
|
-
CheckboxCardsItem,
|
|
84
|
-
type CheckboxCardsProps,
|
|
85
|
-
type CheckboxCardsItemProps,
|
|
86
|
-
};
|
|
59
|
+
export { CheckboxCards, CheckboxCardsItem, type CheckboxCardsProps, type CheckboxCardsItemProps };
|