@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/accordion.tsx
CHANGED
|
@@ -9,9 +9,7 @@ import { cn } from '../lib/utils';
|
|
|
9
9
|
* Component: Accordion
|
|
10
10
|
* -------------------------------------------------------------------------- */
|
|
11
11
|
|
|
12
|
-
type AccordionProps = React.ComponentPropsWithoutRef<
|
|
13
|
-
typeof AccordionPrimitive.Root
|
|
14
|
-
>;
|
|
12
|
+
type AccordionProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>;
|
|
15
13
|
const Accordion = AccordionPrimitive.Root;
|
|
16
14
|
|
|
17
15
|
/* -----------------------------------------------------------------------------
|
|
@@ -19,19 +17,10 @@ const Accordion = AccordionPrimitive.Root;
|
|
|
19
17
|
* -------------------------------------------------------------------------- */
|
|
20
18
|
|
|
21
19
|
type AccordionItemElement = React.ElementRef<typeof AccordionPrimitive.Item>;
|
|
22
|
-
type AccordionItemProps = React.ComponentPropsWithoutRef<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const AccordionItem = React.forwardRef<
|
|
27
|
-
AccordionItemElement,
|
|
28
|
-
AccordionItemProps
|
|
29
|
-
>(({ className, ...props }, ref) => (
|
|
30
|
-
<AccordionPrimitive.Item
|
|
31
|
-
ref={ref}
|
|
32
|
-
className={cn('border-b', className)}
|
|
33
|
-
{...props}
|
|
34
|
-
/>
|
|
20
|
+
type AccordionItemProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;
|
|
21
|
+
|
|
22
|
+
const AccordionItem = React.forwardRef<AccordionItemElement, AccordionItemProps>(({ className, ...props }, ref) => (
|
|
23
|
+
<AccordionPrimitive.Item ref={ref} className={cn('border-b', className)} {...props} />
|
|
35
24
|
));
|
|
36
25
|
|
|
37
26
|
AccordionItem.displayName = AccordionPrimitive.Item.displayName;
|
|
@@ -40,31 +29,23 @@ AccordionItem.displayName = AccordionPrimitive.Item.displayName;
|
|
|
40
29
|
* Component: AccordionTrigger
|
|
41
30
|
* -------------------------------------------------------------------------- */
|
|
42
31
|
|
|
43
|
-
type AccordionTriggerElement = React.ElementRef<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
)}
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
{children}
|
|
64
|
-
<ChevronDownIcon className="text-muted-foreground size-4 shrink-0 transition group-data-[state=open]:rotate-180" />
|
|
65
|
-
</AccordionPrimitive.Trigger>
|
|
66
|
-
</AccordionPrimitive.Header>
|
|
67
|
-
));
|
|
32
|
+
type AccordionTriggerElement = React.ElementRef<typeof AccordionPrimitive.Trigger>;
|
|
33
|
+
type AccordionTriggerProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>;
|
|
34
|
+
|
|
35
|
+
const AccordionTrigger = React.forwardRef<AccordionTriggerElement, AccordionTriggerProps>(
|
|
36
|
+
({ children, className, ...props }, ref) => (
|
|
37
|
+
<AccordionPrimitive.Header className="flex">
|
|
38
|
+
<AccordionPrimitive.Trigger
|
|
39
|
+
ref={ref}
|
|
40
|
+
className={cn('group flex flex-1 items-center justify-between py-4 text-sm font-medium', className)}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
<ChevronDownIcon className="text-muted-foreground size-4 shrink-0 transition group-data-[state=open]:rotate-180" />
|
|
45
|
+
</AccordionPrimitive.Trigger>
|
|
46
|
+
</AccordionPrimitive.Header>
|
|
47
|
+
),
|
|
48
|
+
);
|
|
68
49
|
|
|
69
50
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
70
51
|
|
|
@@ -72,25 +53,20 @@ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
|
72
53
|
* Component: AccordionContent
|
|
73
54
|
* -------------------------------------------------------------------------- */
|
|
74
55
|
|
|
75
|
-
type AccordionContentElement = React.ElementRef<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
{...props}
|
|
90
|
-
>
|
|
91
|
-
<div className={cn('pb-4 pt-0', className)}>{children}</div>
|
|
92
|
-
</AccordionPrimitive.Content>
|
|
93
|
-
));
|
|
56
|
+
type AccordionContentElement = React.ElementRef<typeof AccordionPrimitive.Content>;
|
|
57
|
+
type AccordionContentProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>;
|
|
58
|
+
|
|
59
|
+
const AccordionContent = React.forwardRef<AccordionContentElement, AccordionContentProps>(
|
|
60
|
+
({ children, className, ...props }, ref) => (
|
|
61
|
+
<AccordionPrimitive.Content
|
|
62
|
+
ref={ref}
|
|
63
|
+
className="data-[state=open]:animate-collapsible-open data-[state=closed]:animate-collapsible-closed overflow-hidden text-sm"
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
<div className={cn('pb-4 pt-0', className)}>{children}</div>
|
|
67
|
+
</AccordionPrimitive.Content>
|
|
68
|
+
),
|
|
69
|
+
);
|
|
94
70
|
|
|
95
71
|
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
96
72
|
|
|
@@ -16,38 +16,31 @@ const AlertDialog = AlertDialogPrimitive.Root;
|
|
|
16
16
|
* Component: AlertDialogTrigger
|
|
17
17
|
* -------------------------------------------------------------------------- */
|
|
18
18
|
|
|
19
|
-
type AlertDialogTriggerProps = React.ComponentPropsWithoutRef<
|
|
20
|
-
typeof AlertDialogPrimitive.Trigger
|
|
21
|
-
>;
|
|
19
|
+
type AlertDialogTriggerProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Trigger>;
|
|
22
20
|
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
23
21
|
|
|
24
22
|
/* -----------------------------------------------------------------------------
|
|
25
23
|
* Component: AlertDialogContent
|
|
26
24
|
* -------------------------------------------------------------------------- */
|
|
27
25
|
|
|
28
|
-
type AlertDialogContentElement = React.ElementRef<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
)}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
</AlertDialogPrimitive.Portal>
|
|
50
|
-
));
|
|
26
|
+
type AlertDialogContentElement = React.ElementRef<typeof AlertDialogPrimitive.Content>;
|
|
27
|
+
type AlertDialogContentProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>;
|
|
28
|
+
|
|
29
|
+
const AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(
|
|
30
|
+
({ className, ...props }, ref) => (
|
|
31
|
+
<AlertDialogPrimitive.Portal>
|
|
32
|
+
<AlertDialogPrimitive.Overlay className="data-[state=open]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 bg-black/80" />
|
|
33
|
+
<AlertDialogPrimitive.Content
|
|
34
|
+
ref={ref}
|
|
35
|
+
className={cn(
|
|
36
|
+
'bg-background data-[state=open]:animate-in data-[state=open]:animate-duration-200 data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg',
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
</AlertDialogPrimitive.Portal>
|
|
42
|
+
),
|
|
43
|
+
);
|
|
51
44
|
|
|
52
45
|
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
53
46
|
|
|
@@ -57,20 +50,8 @@ AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
|
57
50
|
|
|
58
51
|
type AlertDialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
59
52
|
|
|
60
|
-
function AlertDialogHeader({
|
|
61
|
-
className,
|
|
62
|
-
...props
|
|
63
|
-
}: AlertDialogHeaderProps): React.JSX.Element {
|
|
64
|
-
return (
|
|
65
|
-
<div
|
|
66
|
-
className={cn(
|
|
67
|
-
'flex flex-col space-y-2 text-center',
|
|
68
|
-
'sm:text-left',
|
|
69
|
-
className,
|
|
70
|
-
)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
73
|
-
);
|
|
53
|
+
function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): React.JSX.Element {
|
|
54
|
+
return <div className={cn('flex flex-col space-y-2 text-center', 'sm:text-left', className)} {...props} />;
|
|
74
55
|
}
|
|
75
56
|
|
|
76
57
|
/* -----------------------------------------------------------------------------
|
|
@@ -79,43 +60,22 @@ function AlertDialogHeader({
|
|
|
79
60
|
|
|
80
61
|
type AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
81
62
|
|
|
82
|
-
function AlertDialogFooter({
|
|
83
|
-
className,
|
|
84
|
-
...props
|
|
85
|
-
}: AlertDialogFooterProps): React.JSX.Element {
|
|
86
|
-
return (
|
|
87
|
-
<div
|
|
88
|
-
className={cn(
|
|
89
|
-
'flex flex-col-reverse gap-2',
|
|
90
|
-
'sm:flex-row sm:justify-end',
|
|
91
|
-
className,
|
|
92
|
-
)}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
);
|
|
63
|
+
function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): React.JSX.Element {
|
|
64
|
+
return <div className={cn('flex flex-col-reverse gap-2', 'sm:flex-row sm:justify-end', className)} {...props} />;
|
|
96
65
|
}
|
|
97
66
|
|
|
98
67
|
/* -----------------------------------------------------------------------------
|
|
99
68
|
* Component: AlertDialogTitle
|
|
100
69
|
* -------------------------------------------------------------------------- */
|
|
101
70
|
|
|
102
|
-
type AlertDialogTitleElement = React.ElementRef<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
AlertDialogTitleElement,
|
|
111
|
-
AlertDialogTitleProps
|
|
112
|
-
>(({ className, ...props }, ref) => (
|
|
113
|
-
<AlertDialogPrimitive.Title
|
|
114
|
-
ref={ref}
|
|
115
|
-
className={cn('text-lg font-semibold', className)}
|
|
116
|
-
{...props}
|
|
117
|
-
/>
|
|
118
|
-
));
|
|
71
|
+
type AlertDialogTitleElement = React.ElementRef<typeof AlertDialogPrimitive.Title>;
|
|
72
|
+
type AlertDialogTitleProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>;
|
|
73
|
+
|
|
74
|
+
const AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(
|
|
75
|
+
({ className, ...props }, ref) => (
|
|
76
|
+
<AlertDialogPrimitive.Title ref={ref} className={cn('text-lg font-semibold', className)} {...props} />
|
|
77
|
+
),
|
|
78
|
+
);
|
|
119
79
|
|
|
120
80
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
121
81
|
|
|
@@ -123,48 +83,29 @@ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
|
123
83
|
* Component: AlertDialogDescription
|
|
124
84
|
* -------------------------------------------------------------------------- */
|
|
125
85
|
|
|
126
|
-
type AlertDialogDescriptionElement = React.ElementRef<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
>(({ className, ...props }, ref) => (
|
|
137
|
-
<AlertDialogPrimitive.Description
|
|
138
|
-
ref={ref}
|
|
139
|
-
className={cn('text-muted-foreground text-sm', className)}
|
|
140
|
-
{...props}
|
|
141
|
-
/>
|
|
142
|
-
));
|
|
143
|
-
|
|
144
|
-
AlertDialogDescription.displayName =
|
|
145
|
-
AlertDialogPrimitive.Description.displayName;
|
|
86
|
+
type AlertDialogDescriptionElement = React.ElementRef<typeof AlertDialogPrimitive.Description>;
|
|
87
|
+
type AlertDialogDescriptionProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>;
|
|
88
|
+
|
|
89
|
+
const AlertDialogDescription = React.forwardRef<AlertDialogDescriptionElement, AlertDialogDescriptionProps>(
|
|
90
|
+
({ className, ...props }, ref) => (
|
|
91
|
+
<AlertDialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
|
|
92
|
+
),
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
146
96
|
|
|
147
97
|
/* -----------------------------------------------------------------------------
|
|
148
98
|
* Component: AlertDialogAction
|
|
149
99
|
* -------------------------------------------------------------------------- */
|
|
150
100
|
|
|
151
|
-
type AlertDialogActionElement = React.ElementRef<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
AlertDialogActionElement,
|
|
160
|
-
AlertDialogActionProps
|
|
161
|
-
>(({ className, ...props }, ref) => (
|
|
162
|
-
<AlertDialogPrimitive.Action
|
|
163
|
-
ref={ref}
|
|
164
|
-
className={buttonVariants({ className })}
|
|
165
|
-
{...props}
|
|
166
|
-
/>
|
|
167
|
-
));
|
|
101
|
+
type AlertDialogActionElement = React.ElementRef<typeof AlertDialogPrimitive.Action>;
|
|
102
|
+
type AlertDialogActionProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>;
|
|
103
|
+
|
|
104
|
+
const AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(
|
|
105
|
+
({ className, ...props }, ref) => (
|
|
106
|
+
<AlertDialogPrimitive.Action ref={ref} className={buttonVariants({ className })} {...props} />
|
|
107
|
+
),
|
|
108
|
+
);
|
|
168
109
|
|
|
169
110
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
170
111
|
|
|
@@ -172,23 +113,14 @@ AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
|
172
113
|
* Component: AlertDialogCancel
|
|
173
114
|
* -------------------------------------------------------------------------- */
|
|
174
115
|
|
|
175
|
-
type AlertDialogCancelElement = React.ElementRef<
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
AlertDialogCancelElement,
|
|
184
|
-
AlertDialogCancelProps
|
|
185
|
-
>(({ className, ...props }, ref) => (
|
|
186
|
-
<AlertDialogPrimitive.Cancel
|
|
187
|
-
ref={ref}
|
|
188
|
-
className={buttonVariants({ variant: 'outline', className })}
|
|
189
|
-
{...props}
|
|
190
|
-
/>
|
|
191
|
-
));
|
|
116
|
+
type AlertDialogCancelElement = React.ElementRef<typeof AlertDialogPrimitive.Cancel>;
|
|
117
|
+
type AlertDialogCancelProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>;
|
|
118
|
+
|
|
119
|
+
const AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(
|
|
120
|
+
({ className, ...props }, ref) => (
|
|
121
|
+
<AlertDialogPrimitive.Cancel ref={ref} className={buttonVariants({ variant: 'outline', className })} {...props} />
|
|
122
|
+
),
|
|
123
|
+
);
|
|
192
124
|
|
|
193
125
|
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
194
126
|
|
package/src/react/alert.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type VariantProps } from 'cva';
|
|
3
2
|
import { cn, cva } from '../lib/utils';
|
|
3
|
+
import type { VariantProps } from 'cva';
|
|
4
4
|
|
|
5
5
|
/* -----------------------------------------------------------------------------
|
|
6
6
|
* Variant: Alert
|
|
@@ -11,8 +11,7 @@ const alertVariants = cva({
|
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
13
|
default: 'bg-background text-foreground [&>svg]:text-foreground',
|
|
14
|
-
destructive:
|
|
15
|
-
'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
|
|
14
|
+
destructive: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
|
|
16
15
|
},
|
|
17
16
|
},
|
|
18
17
|
defaultVariants: {
|
|
@@ -29,16 +28,9 @@ type AlertVariantsProps = VariantProps<typeof alertVariants>;
|
|
|
29
28
|
type AlertElement = HTMLDivElement;
|
|
30
29
|
type AlertProps = React.HTMLAttributes<HTMLDivElement> & AlertVariantsProps;
|
|
31
30
|
|
|
32
|
-
const Alert = React.forwardRef<AlertElement, AlertProps>(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
ref={ref}
|
|
36
|
-
role="alert"
|
|
37
|
-
className={alertVariants({ variant, className })}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
),
|
|
41
|
-
);
|
|
31
|
+
const Alert = React.forwardRef<AlertElement, AlertProps>(({ className, variant, ...props }, ref) => (
|
|
32
|
+
<div ref={ref} role="alert" className={alertVariants({ variant, className })} {...props} />
|
|
33
|
+
));
|
|
42
34
|
|
|
43
35
|
Alert.displayName = 'Alert';
|
|
44
36
|
|
|
@@ -49,17 +41,11 @@ Alert.displayName = 'Alert';
|
|
|
49
41
|
type AlertTitleElement = HTMLHeadingElement;
|
|
50
42
|
type AlertTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
51
43
|
|
|
52
|
-
const AlertTitle = React.forwardRef<AlertTitleElement, AlertTitleProps>(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{...props}
|
|
58
|
-
>
|
|
59
|
-
{children}
|
|
60
|
-
</h5>
|
|
61
|
-
),
|
|
62
|
-
);
|
|
44
|
+
const AlertTitle = React.forwardRef<AlertTitleElement, AlertTitleProps>(({ children, className, ...props }, ref) => (
|
|
45
|
+
<h5 ref={ref} className={cn('mb-1 font-medium leading-none tracking-tight', className)} {...props}>
|
|
46
|
+
{children}
|
|
47
|
+
</h5>
|
|
48
|
+
));
|
|
63
49
|
|
|
64
50
|
AlertTitle.displayName = 'AlertTitle';
|
|
65
51
|
|
|
@@ -70,16 +56,11 @@ AlertTitle.displayName = 'AlertTitle';
|
|
|
70
56
|
type AlertDescriptionElement = HTMLDivElement;
|
|
71
57
|
type AlertDescriptionProps = React.HTMLAttributes<HTMLDivElement>;
|
|
72
58
|
|
|
73
|
-
const AlertDescription = React.forwardRef<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
ref={ref}
|
|
79
|
-
className={cn('text-sm [&_p]:leading-relaxed', className)}
|
|
80
|
-
{...props}
|
|
81
|
-
/>
|
|
82
|
-
));
|
|
59
|
+
const AlertDescription = React.forwardRef<AlertDescriptionElement, AlertDescriptionProps>(
|
|
60
|
+
({ className, ...props }, ref) => (
|
|
61
|
+
<div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />
|
|
62
|
+
),
|
|
63
|
+
);
|
|
83
64
|
|
|
84
65
|
AlertDescription.displayName = 'AlertDescription';
|
|
85
66
|
|
|
@@ -87,11 +68,4 @@ AlertDescription.displayName = 'AlertDescription';
|
|
|
87
68
|
* Exports
|
|
88
69
|
* -------------------------------------------------------------------------- */
|
|
89
70
|
|
|
90
|
-
export {
|
|
91
|
-
Alert,
|
|
92
|
-
AlertTitle,
|
|
93
|
-
AlertDescription,
|
|
94
|
-
type AlertProps,
|
|
95
|
-
type AlertTitleProps,
|
|
96
|
-
type AlertDescriptionProps,
|
|
97
|
-
};
|
|
71
|
+
export { Alert, AlertTitle, AlertDescription, type AlertProps, type AlertTitleProps, type AlertDescriptionProps };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import type * as React from 'react';
|
|
4
3
|
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
4
|
+
import type * as React from 'react';
|
|
5
5
|
|
|
6
6
|
/* -----------------------------------------------------------------------------
|
|
7
7
|
* Component: AspectRatio
|
|
8
8
|
* -------------------------------------------------------------------------- */
|
|
9
9
|
|
|
10
|
-
type AspectRatioProps = React.ComponentPropsWithoutRef<
|
|
11
|
-
typeof AspectRatioPrimitive.Root
|
|
12
|
-
>;
|
|
10
|
+
type AspectRatioProps = React.ComponentPropsWithoutRef<typeof AspectRatioPrimitive.Root>;
|
|
13
11
|
const AspectRatio = AspectRatioPrimitive.Root;
|
|
14
12
|
|
|
15
13
|
/* -----------------------------------------------------------------------------
|
package/src/react/avatar.tsx
CHANGED
|
@@ -11,18 +11,13 @@ import { cn } from '../lib/utils';
|
|
|
11
11
|
type AvatarElement = React.ElementRef<typeof AvatarPrimitive.Root>;
|
|
12
12
|
type AvatarProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>;
|
|
13
13
|
|
|
14
|
-
const Avatar = React.forwardRef<AvatarElement, AvatarProps>(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
)}
|
|
22
|
-
{...props}
|
|
23
|
-
/>
|
|
24
|
-
),
|
|
25
|
-
);
|
|
14
|
+
const Avatar = React.forwardRef<AvatarElement, AvatarProps>(({ className, ...props }, ref) => (
|
|
15
|
+
<AvatarPrimitive.Root
|
|
16
|
+
ref={ref}
|
|
17
|
+
className={cn('relative flex size-10 shrink-0 overflow-hidden rounded-full', className)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
));
|
|
26
21
|
|
|
27
22
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
28
23
|
|
|
@@ -31,19 +26,11 @@ Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
|
31
26
|
* -------------------------------------------------------------------------- */
|
|
32
27
|
|
|
33
28
|
type AvatarImageElement = React.ElementRef<typeof AvatarPrimitive.Image>;
|
|
34
|
-
type AvatarImageProps = React.ComponentPropsWithoutRef<
|
|
35
|
-
typeof AvatarPrimitive.Image
|
|
36
|
-
>;
|
|
29
|
+
type AvatarImageProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>;
|
|
37
30
|
|
|
38
|
-
const AvatarImage = React.forwardRef<AvatarImageElement, AvatarImageProps>(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
ref={ref}
|
|
42
|
-
className={cn('aspect-square size-full', className)}
|
|
43
|
-
{...props}
|
|
44
|
-
/>
|
|
45
|
-
),
|
|
46
|
-
);
|
|
31
|
+
const AvatarImage = React.forwardRef<AvatarImageElement, AvatarImageProps>(({ className, ...props }, ref) => (
|
|
32
|
+
<AvatarPrimitive.Image ref={ref} className={cn('aspect-square size-full', className)} {...props} />
|
|
33
|
+
));
|
|
47
34
|
|
|
48
35
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
49
36
|
|
|
@@ -52,20 +39,12 @@ AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
|
52
39
|
* -------------------------------------------------------------------------- */
|
|
53
40
|
|
|
54
41
|
type AvatarFallbackElement = React.ElementRef<typeof AvatarPrimitive.Fallback>;
|
|
55
|
-
type AvatarFallbackProps = React.ComponentPropsWithoutRef<
|
|
56
|
-
typeof AvatarPrimitive.Fallback
|
|
57
|
-
>;
|
|
42
|
+
type AvatarFallbackProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>;
|
|
58
43
|
|
|
59
|
-
const AvatarFallback = React.forwardRef<
|
|
60
|
-
AvatarFallbackElement,
|
|
61
|
-
AvatarFallbackProps
|
|
62
|
-
>(({ className, ...props }, ref) => (
|
|
44
|
+
const AvatarFallback = React.forwardRef<AvatarFallbackElement, AvatarFallbackProps>(({ className, ...props }, ref) => (
|
|
63
45
|
<AvatarPrimitive.Fallback
|
|
64
46
|
ref={ref}
|
|
65
|
-
className={cn(
|
|
66
|
-
'bg-muted flex size-full items-center justify-center rounded-full',
|
|
67
|
-
className,
|
|
68
|
-
)}
|
|
47
|
+
className={cn('bg-muted flex size-full items-center justify-center rounded-full', className)}
|
|
69
48
|
{...props}
|
|
70
49
|
/>
|
|
71
50
|
));
|
|
@@ -76,11 +55,4 @@ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
|
76
55
|
* Exports
|
|
77
56
|
* -------------------------------------------------------------------------- */
|
|
78
57
|
|
|
79
|
-
export {
|
|
80
|
-
Avatar,
|
|
81
|
-
AvatarImage,
|
|
82
|
-
AvatarFallback,
|
|
83
|
-
type AvatarProps,
|
|
84
|
-
type AvatarImageProps,
|
|
85
|
-
type AvatarFallbackProps,
|
|
86
|
-
};
|
|
58
|
+
export { Avatar, AvatarImage, AvatarFallback, type AvatarProps, type AvatarImageProps, type AvatarFallbackProps };
|
package/src/react/badge.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type VariantProps } from 'cva';
|
|
3
2
|
import { cva } from '../lib/utils';
|
|
3
|
+
import type { VariantProps } from 'cva';
|
|
4
4
|
|
|
5
5
|
/* -----------------------------------------------------------------------------
|
|
6
6
|
* Variant: Badge
|
|
@@ -12,8 +12,7 @@ const badgeVariants = cva({
|
|
|
12
12
|
variant: {
|
|
13
13
|
default: 'bg-primary text-primary-foreground border-transparent shadow',
|
|
14
14
|
secondary: 'bg-secondary text-secondary-foreground border-transparent',
|
|
15
|
-
destructive:
|
|
16
|
-
'bg-destructive text-destructive-foreground border-transparent shadow',
|
|
15
|
+
destructive: 'bg-destructive text-destructive-foreground border-transparent shadow',
|
|
17
16
|
outline: 'text-foreground',
|
|
18
17
|
},
|
|
19
18
|
},
|
|
@@ -30,11 +29,7 @@ type BadgeVariantsProps = VariantProps<typeof badgeVariants>;
|
|
|
30
29
|
|
|
31
30
|
type BadgeProps = React.HTMLAttributes<HTMLDivElement> & BadgeVariantsProps;
|
|
32
31
|
|
|
33
|
-
function Badge({
|
|
34
|
-
className,
|
|
35
|
-
variant,
|
|
36
|
-
...props
|
|
37
|
-
}: BadgeProps): React.JSX.Element {
|
|
32
|
+
function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element {
|
|
38
33
|
return <div className={badgeVariants({ variant, className })} {...props} />;
|
|
39
34
|
}
|
|
40
35
|
|
package/src/react/blockquote.tsx
CHANGED
|
@@ -7,18 +7,15 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
7
7
|
|
|
8
8
|
type BlockquoteElement = HTMLQuoteElement;
|
|
9
9
|
|
|
10
|
-
interface BlockquoteProps
|
|
11
|
-
extends React.BlockquoteHTMLAttributes<HTMLQuoteElement> {
|
|
10
|
+
interface BlockquoteProps extends React.BlockquoteHTMLAttributes<HTMLQuoteElement> {
|
|
12
11
|
asChild?: boolean;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
const Blockquote = React.forwardRef<BlockquoteElement, BlockquoteProps>(
|
|
16
|
-
|
|
17
|
-
const Component = asChild ? Slot : 'blockquote';
|
|
14
|
+
const Blockquote = React.forwardRef<BlockquoteElement, BlockquoteProps>(({ asChild, ...props }, ref) => {
|
|
15
|
+
const Component = asChild ? Slot : 'blockquote';
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
);
|
|
17
|
+
return <Component ref={ref} {...props} />;
|
|
18
|
+
});
|
|
22
19
|
|
|
23
20
|
Blockquote.displayName = 'Blockquote';
|
|
24
21
|
|
package/src/react/box.tsx
CHANGED
|
@@ -19,13 +19,11 @@ type BoxProps = (BoxDivProps | BoxSpanProps) & {
|
|
|
19
19
|
asChild?: boolean;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const Box = React.forwardRef<BoxElement, BoxProps>(
|
|
23
|
-
|
|
24
|
-
const Component = asChild ? Slot : Tag;
|
|
22
|
+
const Box = React.forwardRef<BoxElement, BoxProps>(({ as: Tag = 'div', asChild, ...props }, ref) => {
|
|
23
|
+
const Component = asChild ? Slot : Tag;
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
);
|
|
25
|
+
return <Component ref={ref} {...props} />;
|
|
26
|
+
});
|
|
29
27
|
|
|
30
28
|
Box.displayName = 'Box';
|
|
31
29
|
|