@codefast/ui 0.0.49 → 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-PPEAG5G4.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-JPRGRYAM.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 +5 -5
- 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 +6 -21
- 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-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-JPRGRYAM.js.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-PPEAG5G4.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-XHNT6PVI.mjs.map +0 -1
- package/dist/chunk-ZTEJNUH6.js.map +0 -1
package/src/react/dialog.tsx
CHANGED
|
@@ -16,18 +16,14 @@ const Dialog = DialogPrimitive.Root;
|
|
|
16
16
|
* Component: DialogTrigger
|
|
17
17
|
* -------------------------------------------------------------------------- */
|
|
18
18
|
|
|
19
|
-
type DialogTriggerProps = React.ComponentPropsWithoutRef<
|
|
20
|
-
typeof DialogPrimitive.Trigger
|
|
21
|
-
>;
|
|
19
|
+
type DialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;
|
|
22
20
|
const DialogTrigger = DialogPrimitive.Trigger;
|
|
23
21
|
|
|
24
22
|
/* -----------------------------------------------------------------------------
|
|
25
23
|
* Component: DialogClose
|
|
26
24
|
* -------------------------------------------------------------------------- */
|
|
27
25
|
|
|
28
|
-
type DialogCloseProps = React.ComponentPropsWithoutRef<
|
|
29
|
-
typeof DialogPrimitive.Close
|
|
30
|
-
>;
|
|
26
|
+
type DialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;
|
|
31
27
|
const DialogClose = DialogPrimitive.Close;
|
|
32
28
|
|
|
33
29
|
/* -----------------------------------------------------------------------------
|
|
@@ -35,32 +31,29 @@ const DialogClose = DialogPrimitive.Close;
|
|
|
35
31
|
* -------------------------------------------------------------------------- */
|
|
36
32
|
|
|
37
33
|
type DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;
|
|
38
|
-
type DialogContentProps = React.ComponentPropsWithoutRef<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
</DialogPrimitive.Content>
|
|
62
|
-
</DialogPrimitive.Portal>
|
|
63
|
-
));
|
|
34
|
+
type DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;
|
|
35
|
+
|
|
36
|
+
const DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(
|
|
37
|
+
({ children, className, ...props }, ref) => (
|
|
38
|
+
<DialogPrimitive.Portal>
|
|
39
|
+
<DialogPrimitive.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" />
|
|
40
|
+
<DialogPrimitive.Content
|
|
41
|
+
ref={ref}
|
|
42
|
+
className={cn(
|
|
43
|
+
'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',
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
46
|
+
{...props}
|
|
47
|
+
>
|
|
48
|
+
{children}
|
|
49
|
+
<DialogPrimitive.Close className="data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none">
|
|
50
|
+
<Cross2Icon className="size-4" />
|
|
51
|
+
<span className="sr-only">Close</span>
|
|
52
|
+
</DialogPrimitive.Close>
|
|
53
|
+
</DialogPrimitive.Content>
|
|
54
|
+
</DialogPrimitive.Portal>
|
|
55
|
+
),
|
|
56
|
+
);
|
|
64
57
|
|
|
65
58
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
66
59
|
|
|
@@ -70,19 +63,8 @@ DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
|
70
63
|
|
|
71
64
|
type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
72
65
|
|
|
73
|
-
function DialogHeader({
|
|
74
|
-
className,
|
|
75
|
-
...props
|
|
76
|
-
}: DialogHeaderProps): React.JSX.Element {
|
|
77
|
-
return (
|
|
78
|
-
<div
|
|
79
|
-
className={cn(
|
|
80
|
-
'flex flex-col space-y-1.5 text-center sm:text-left',
|
|
81
|
-
className,
|
|
82
|
-
)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
);
|
|
66
|
+
function DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element {
|
|
67
|
+
return <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />;
|
|
86
68
|
}
|
|
87
69
|
|
|
88
70
|
/* -----------------------------------------------------------------------------
|
|
@@ -91,19 +73,8 @@ function DialogHeader({
|
|
|
91
73
|
|
|
92
74
|
type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
93
75
|
|
|
94
|
-
function DialogFooter({
|
|
95
|
-
className,
|
|
96
|
-
...props
|
|
97
|
-
}: DialogFooterProps): React.JSX.Element {
|
|
98
|
-
return (
|
|
99
|
-
<div
|
|
100
|
-
className={cn(
|
|
101
|
-
'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
|
|
102
|
-
className,
|
|
103
|
-
)}
|
|
104
|
-
{...props}
|
|
105
|
-
/>
|
|
106
|
-
);
|
|
76
|
+
function DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Element {
|
|
77
|
+
return <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />;
|
|
107
78
|
}
|
|
108
79
|
|
|
109
80
|
/* -----------------------------------------------------------------------------
|
|
@@ -111,22 +82,15 @@ function DialogFooter({
|
|
|
111
82
|
* -------------------------------------------------------------------------- */
|
|
112
83
|
|
|
113
84
|
type DialogTitleElement = React.ElementRef<typeof DialogPrimitive.Title>;
|
|
114
|
-
type DialogTitleProps = React.ComponentPropsWithoutRef<
|
|
115
|
-
typeof DialogPrimitive.Title
|
|
116
|
-
>;
|
|
85
|
+
type DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
|
117
86
|
|
|
118
|
-
const DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
)}
|
|
126
|
-
{...props}
|
|
127
|
-
/>
|
|
128
|
-
),
|
|
129
|
-
);
|
|
87
|
+
const DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(({ className, ...props }, ref) => (
|
|
88
|
+
<DialogPrimitive.Title
|
|
89
|
+
ref={ref}
|
|
90
|
+
className={cn('text-lg font-semibold leading-none tracking-tight', className)}
|
|
91
|
+
{...props}
|
|
92
|
+
/>
|
|
93
|
+
));
|
|
130
94
|
|
|
131
95
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
132
96
|
|
|
@@ -134,23 +98,14 @@ DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
|
134
98
|
* Component: DialogDescription
|
|
135
99
|
* -------------------------------------------------------------------------- */
|
|
136
100
|
|
|
137
|
-
type DialogDescriptionElement = React.ElementRef<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
DialogDescriptionElement,
|
|
146
|
-
DialogDescriptionProps
|
|
147
|
-
>(({ className, ...props }, ref) => (
|
|
148
|
-
<DialogPrimitive.Description
|
|
149
|
-
ref={ref}
|
|
150
|
-
className={cn('text-muted-foreground text-sm', className)}
|
|
151
|
-
{...props}
|
|
152
|
-
/>
|
|
153
|
-
));
|
|
101
|
+
type DialogDescriptionElement = React.ElementRef<typeof DialogPrimitive.Description>;
|
|
102
|
+
type DialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
|
103
|
+
|
|
104
|
+
const DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(
|
|
105
|
+
({ className, ...props }, ref) => (
|
|
106
|
+
<DialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
|
|
107
|
+
),
|
|
108
|
+
);
|
|
154
109
|
|
|
155
110
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
156
111
|
|
package/src/react/drawer.tsx
CHANGED
|
@@ -10,34 +10,22 @@ import { cn } from '../lib/utils';
|
|
|
10
10
|
|
|
11
11
|
type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
|
|
12
12
|
|
|
13
|
-
function Drawer({
|
|
14
|
-
shouldScaleBackground
|
|
15
|
-
...props
|
|
16
|
-
}: DrawerProps): React.JSX.Element {
|
|
17
|
-
return (
|
|
18
|
-
<DrawerPrimitive.Root
|
|
19
|
-
shouldScaleBackground={shouldScaleBackground}
|
|
20
|
-
{...props}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
13
|
+
function Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {
|
|
14
|
+
return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;
|
|
23
15
|
}
|
|
24
16
|
|
|
25
17
|
/* -----------------------------------------------------------------------------
|
|
26
18
|
* Component: DrawerTrigger
|
|
27
19
|
* -------------------------------------------------------------------------- */
|
|
28
20
|
|
|
29
|
-
type DrawerTriggerProps = React.ComponentPropsWithoutRef<
|
|
30
|
-
typeof DrawerPrimitive.Trigger
|
|
31
|
-
>;
|
|
21
|
+
type DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;
|
|
32
22
|
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
33
23
|
|
|
34
24
|
/* -----------------------------------------------------------------------------
|
|
35
25
|
* Component: DrawerClose
|
|
36
26
|
* -------------------------------------------------------------------------- */
|
|
37
27
|
|
|
38
|
-
type DrawerCloseProps = React.ComponentPropsWithoutRef<
|
|
39
|
-
typeof DrawerPrimitive.Close
|
|
40
|
-
>;
|
|
28
|
+
type DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;
|
|
41
29
|
const DrawerClose = DrawerPrimitive.Close;
|
|
42
30
|
|
|
43
31
|
/* -----------------------------------------------------------------------------
|
|
@@ -45,29 +33,26 @@ const DrawerClose = DrawerPrimitive.Close;
|
|
|
45
33
|
* -------------------------------------------------------------------------- */
|
|
46
34
|
|
|
47
35
|
type DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;
|
|
48
|
-
type DrawerContentProps = React.ComponentPropsWithoutRef<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
className
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</DrawerPrimitive.Content>
|
|
69
|
-
</DrawerPrimitive.Portal>
|
|
70
|
-
));
|
|
36
|
+
type DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;
|
|
37
|
+
|
|
38
|
+
const DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(
|
|
39
|
+
({ children, className, ...props }, ref) => (
|
|
40
|
+
<DrawerPrimitive.Portal>
|
|
41
|
+
<DrawerPrimitive.Overlay className="fixed inset-0 z-50 bg-black/80" />
|
|
42
|
+
<DrawerPrimitive.Content
|
|
43
|
+
ref={ref}
|
|
44
|
+
className={cn(
|
|
45
|
+
'bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border',
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
<div className="bg-muted mx-auto mt-4 h-2 w-24 rounded-full" />
|
|
51
|
+
{children}
|
|
52
|
+
</DrawerPrimitive.Content>
|
|
53
|
+
</DrawerPrimitive.Portal>
|
|
54
|
+
),
|
|
55
|
+
);
|
|
71
56
|
|
|
72
57
|
DrawerContent.displayName = 'DrawerContent';
|
|
73
58
|
|
|
@@ -77,16 +62,8 @@ DrawerContent.displayName = 'DrawerContent';
|
|
|
77
62
|
|
|
78
63
|
type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
79
64
|
|
|
80
|
-
function DrawerHeader({
|
|
81
|
-
className,
|
|
82
|
-
...props
|
|
83
|
-
}: DrawerHeaderProps): React.JSX.Element {
|
|
84
|
-
return (
|
|
85
|
-
<div
|
|
86
|
-
className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)}
|
|
87
|
-
{...props}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
65
|
+
function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {
|
|
66
|
+
return <div className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)} {...props} />;
|
|
90
67
|
}
|
|
91
68
|
|
|
92
69
|
/* -----------------------------------------------------------------------------
|
|
@@ -95,16 +72,8 @@ function DrawerHeader({
|
|
|
95
72
|
|
|
96
73
|
type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
97
74
|
|
|
98
|
-
function DrawerFooter({
|
|
99
|
-
className,
|
|
100
|
-
...props
|
|
101
|
-
}: DrawerFooterProps): React.JSX.Element {
|
|
102
|
-
return (
|
|
103
|
-
<div
|
|
104
|
-
className={cn('mt-auto flex flex-col gap-2 p-4', className)}
|
|
105
|
-
{...props}
|
|
106
|
-
/>
|
|
107
|
-
);
|
|
75
|
+
function DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {
|
|
76
|
+
return <div className={cn('mt-auto flex flex-col gap-2 p-4', className)} {...props} />;
|
|
108
77
|
}
|
|
109
78
|
|
|
110
79
|
/* -----------------------------------------------------------------------------
|
|
@@ -112,22 +81,15 @@ function DrawerFooter({
|
|
|
112
81
|
* -------------------------------------------------------------------------- */
|
|
113
82
|
|
|
114
83
|
type DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;
|
|
115
|
-
type DrawerTitleProps = React.ComponentPropsWithoutRef<
|
|
116
|
-
typeof DrawerPrimitive.Title
|
|
117
|
-
>;
|
|
84
|
+
type DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;
|
|
118
85
|
|
|
119
|
-
const DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
)}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
),
|
|
130
|
-
);
|
|
86
|
+
const DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (
|
|
87
|
+
<DrawerPrimitive.Title
|
|
88
|
+
ref={ref}
|
|
89
|
+
className={cn('text-lg font-semibold leading-none tracking-tight', className)}
|
|
90
|
+
{...props}
|
|
91
|
+
/>
|
|
92
|
+
));
|
|
131
93
|
|
|
132
94
|
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
133
95
|
|
|
@@ -135,23 +97,14 @@ DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
|
135
97
|
* Component: DrawerDescription
|
|
136
98
|
* -------------------------------------------------------------------------- */
|
|
137
99
|
|
|
138
|
-
type DrawerDescriptionElement = React.ElementRef<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
DrawerDescriptionElement,
|
|
147
|
-
DrawerDescriptionProps
|
|
148
|
-
>(({ className, ...props }, ref) => (
|
|
149
|
-
<DrawerPrimitive.Description
|
|
150
|
-
ref={ref}
|
|
151
|
-
className={cn('text-muted-foreground text-sm', className)}
|
|
152
|
-
{...props}
|
|
153
|
-
/>
|
|
154
|
-
));
|
|
100
|
+
type DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;
|
|
101
|
+
type DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;
|
|
102
|
+
|
|
103
|
+
const DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(
|
|
104
|
+
({ className, ...props }, ref) => (
|
|
105
|
+
<DrawerPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
|
|
106
|
+
),
|
|
107
|
+
);
|
|
155
108
|
|
|
156
109
|
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
157
110
|
|