@codefast/ui 0.0.50 → 0.0.53
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.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 +5 -20
- package/src/react/calendar.tsx +6 -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/sheet.tsx
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
5
5
|
import { Cross2Icon } from '@radix-ui/react-icons';
|
|
6
|
-
import { type VariantProps } from 'cva';
|
|
7
6
|
import { cn, cva } from '../lib/utils';
|
|
7
|
+
import type { VariantProps } from 'cva';
|
|
8
8
|
|
|
9
9
|
/* -----------------------------------------------------------------------------
|
|
10
10
|
* Variant: Sheet
|
|
@@ -40,18 +40,14 @@ const Sheet = SheetPrimitive.Root;
|
|
|
40
40
|
* Component: SheetTrigger
|
|
41
41
|
* -------------------------------------------------------------------------- */
|
|
42
42
|
|
|
43
|
-
type SheetTriggerProps = React.ComponentPropsWithoutRef<
|
|
44
|
-
typeof SheetPrimitive.Trigger
|
|
45
|
-
>;
|
|
43
|
+
type SheetTriggerProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Trigger>;
|
|
46
44
|
const SheetTrigger = SheetPrimitive.Trigger;
|
|
47
45
|
|
|
48
46
|
/* -----------------------------------------------------------------------------
|
|
49
47
|
* Component: SheetClose
|
|
50
48
|
* -------------------------------------------------------------------------- */
|
|
51
49
|
|
|
52
|
-
type SheetCloseProps = React.ComponentPropsWithoutRef<
|
|
53
|
-
typeof SheetPrimitive.Close
|
|
54
|
-
>;
|
|
50
|
+
type SheetCloseProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Close>;
|
|
55
51
|
const SheetClose = SheetPrimitive.Close;
|
|
56
52
|
|
|
57
53
|
/* -----------------------------------------------------------------------------
|
|
@@ -59,20 +55,13 @@ const SheetClose = SheetPrimitive.Close;
|
|
|
59
55
|
* -------------------------------------------------------------------------- */
|
|
60
56
|
|
|
61
57
|
type SheetContentElement = React.ElementRef<typeof SheetPrimitive.Content>;
|
|
62
|
-
type SheetContentProps = React.ComponentPropsWithoutRef<
|
|
63
|
-
typeof SheetPrimitive.Content
|
|
64
|
-
> &
|
|
65
|
-
SheetVariantsProps;
|
|
58
|
+
type SheetContentProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> & SheetVariantsProps;
|
|
66
59
|
|
|
67
60
|
const SheetContent = React.forwardRef<SheetContentElement, SheetContentProps>(
|
|
68
61
|
({ children, side = 'right', className, ...props }, ref) => (
|
|
69
62
|
<SheetPrimitive.Portal>
|
|
70
63
|
<SheetPrimitive.Overlay className="data-[state=closed]:animate-duration-300 data-[state=open]:animate-duration-500 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 bg-black/80" />
|
|
71
|
-
<SheetPrimitive.Content
|
|
72
|
-
ref={ref}
|
|
73
|
-
className={sheetVariants({ side, className })}
|
|
74
|
-
{...props}
|
|
75
|
-
>
|
|
64
|
+
<SheetPrimitive.Content ref={ref} className={sheetVariants({ side, className })} {...props}>
|
|
76
65
|
{children}
|
|
77
66
|
<SheetPrimitive.Close className="data-[state=open]:bg-secondary 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">
|
|
78
67
|
<Cross2Icon className="size-4" />
|
|
@@ -91,19 +80,8 @@ SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
|
91
80
|
|
|
92
81
|
type SheetHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
93
82
|
|
|
94
|
-
function SheetHeader({
|
|
95
|
-
className,
|
|
96
|
-
...props
|
|
97
|
-
}: SheetHeaderProps): React.JSX.Element {
|
|
98
|
-
return (
|
|
99
|
-
<div
|
|
100
|
-
className={cn(
|
|
101
|
-
'flex flex-col space-y-2 text-center sm:text-left',
|
|
102
|
-
className,
|
|
103
|
-
)}
|
|
104
|
-
{...props}
|
|
105
|
-
/>
|
|
106
|
-
);
|
|
83
|
+
function SheetHeader({ className, ...props }: SheetHeaderProps): React.JSX.Element {
|
|
84
|
+
return <div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />;
|
|
107
85
|
}
|
|
108
86
|
|
|
109
87
|
/* -----------------------------------------------------------------------------
|
|
@@ -112,19 +90,8 @@ function SheetHeader({
|
|
|
112
90
|
|
|
113
91
|
type SheetFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
114
92
|
|
|
115
|
-
function SheetFooter({
|
|
116
|
-
className,
|
|
117
|
-
...props
|
|
118
|
-
}: SheetFooterProps): React.JSX.Element {
|
|
119
|
-
return (
|
|
120
|
-
<div
|
|
121
|
-
className={cn(
|
|
122
|
-
'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
|
|
123
|
-
className,
|
|
124
|
-
)}
|
|
125
|
-
{...props}
|
|
126
|
-
/>
|
|
127
|
-
);
|
|
93
|
+
function SheetFooter({ className, ...props }: SheetFooterProps): React.JSX.Element {
|
|
94
|
+
return <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />;
|
|
128
95
|
}
|
|
129
96
|
|
|
130
97
|
SheetFooter.displayName = 'SheetFooter';
|
|
@@ -134,19 +101,11 @@ SheetFooter.displayName = 'SheetFooter';
|
|
|
134
101
|
* -------------------------------------------------------------------------- */
|
|
135
102
|
|
|
136
103
|
type SheetTitleElement = React.ElementRef<typeof SheetPrimitive.Title>;
|
|
137
|
-
type SheetTitleProps = React.ComponentPropsWithoutRef<
|
|
138
|
-
typeof SheetPrimitive.Title
|
|
139
|
-
>;
|
|
104
|
+
type SheetTitleProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>;
|
|
140
105
|
|
|
141
|
-
const SheetTitle = React.forwardRef<SheetTitleElement, SheetTitleProps>(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
ref={ref}
|
|
145
|
-
className={cn('text-foreground text-lg font-semibold', className)}
|
|
146
|
-
{...props}
|
|
147
|
-
/>
|
|
148
|
-
),
|
|
149
|
-
);
|
|
106
|
+
const SheetTitle = React.forwardRef<SheetTitleElement, SheetTitleProps>(({ className, ...props }, ref) => (
|
|
107
|
+
<SheetPrimitive.Title ref={ref} className={cn('text-foreground text-lg font-semibold', className)} {...props} />
|
|
108
|
+
));
|
|
150
109
|
|
|
151
110
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
152
111
|
|
|
@@ -154,23 +113,14 @@ SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
|
154
113
|
* Component: SheetDescription
|
|
155
114
|
* -------------------------------------------------------------------------- */
|
|
156
115
|
|
|
157
|
-
type SheetDescriptionElement = React.ElementRef<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
SheetDescriptionElement,
|
|
166
|
-
SheetDescriptionProps
|
|
167
|
-
>(({ className, ...props }, ref) => (
|
|
168
|
-
<SheetPrimitive.Description
|
|
169
|
-
ref={ref}
|
|
170
|
-
className={cn('text-muted-foreground text-sm', className)}
|
|
171
|
-
{...props}
|
|
172
|
-
/>
|
|
173
|
-
));
|
|
116
|
+
type SheetDescriptionElement = React.ElementRef<typeof SheetPrimitive.Description>;
|
|
117
|
+
type SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>;
|
|
118
|
+
|
|
119
|
+
const SheetDescription = React.forwardRef<SheetDescriptionElement, SheetDescriptionProps>(
|
|
120
|
+
({ className, ...props }, ref) => (
|
|
121
|
+
<SheetPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
|
|
122
|
+
),
|
|
123
|
+
);
|
|
174
124
|
|
|
175
125
|
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
176
126
|
|
package/src/react/skeleton.tsx
CHANGED
|
@@ -8,12 +8,7 @@ import { cn } from '../lib/utils';
|
|
|
8
8
|
type SkeletonProps = React.HTMLAttributes<HTMLDivElement>;
|
|
9
9
|
|
|
10
10
|
function Skeleton({ className, ...props }: SkeletonProps): React.JSX.Element {
|
|
11
|
-
return (
|
|
12
|
-
<div
|
|
13
|
-
className={cn('bg-primary/10 animate-pulse rounded', className)}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
11
|
+
return <div className={cn('bg-primary/10 animate-pulse rounded', className)} {...props} />;
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
/* -----------------------------------------------------------------------------
|
package/src/react/slider.tsx
CHANGED
|
@@ -11,33 +11,26 @@ import { cn } from '../lib/utils';
|
|
|
11
11
|
type SliderElement = React.ElementRef<typeof SliderPrimitive.Root>;
|
|
12
12
|
type SliderProps = React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>;
|
|
13
13
|
|
|
14
|
-
const Slider = React.forwardRef<SliderElement, SliderProps>(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
? { tabIndex: props.tabIndex }
|
|
35
|
-
: undefined)}
|
|
36
|
-
/>
|
|
37
|
-
))}
|
|
38
|
-
</SliderPrimitive.Root>
|
|
39
|
-
),
|
|
40
|
-
);
|
|
14
|
+
const Slider = React.forwardRef<SliderElement, SliderProps>(({ className, ...props }, ref) => (
|
|
15
|
+
<SliderPrimitive.Root
|
|
16
|
+
ref={ref}
|
|
17
|
+
className={cn('relative flex w-full touch-none select-none items-center', className)}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<SliderPrimitive.Track className="bg-primary/20 relative h-1.5 w-full grow overflow-hidden rounded-full">
|
|
21
|
+
<SliderPrimitive.Range className="bg-primary absolute h-full" />
|
|
22
|
+
</SliderPrimitive.Track>
|
|
23
|
+
|
|
24
|
+
{(props.value ?? props.defaultValue ?? []).map((value, index) => (
|
|
25
|
+
<SliderPrimitive.Thumb
|
|
26
|
+
// eslint-disable-next-line react/no-array-index-key -- index is stable
|
|
27
|
+
key={index}
|
|
28
|
+
className="border-primary/50 bg-background block size-4 rounded-full border shadow transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
|
29
|
+
{...(props.tabIndex !== undefined ? { tabIndex: props.tabIndex } : undefined)}
|
|
30
|
+
/>
|
|
31
|
+
))}
|
|
32
|
+
</SliderPrimitive.Root>
|
|
33
|
+
));
|
|
41
34
|
|
|
42
35
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
43
36
|
|
package/src/react/sonner.tsx
CHANGED
|
@@ -23,10 +23,8 @@ function Toaster({ ...props }: ToasterProps): React.JSX.Element {
|
|
|
23
23
|
toast:
|
|
24
24
|
'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',
|
|
25
25
|
description: 'group-[.toast]:text-muted-foreground',
|
|
26
|
-
actionButton:
|
|
27
|
-
|
|
28
|
-
cancelButton:
|
|
29
|
-
'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',
|
|
26
|
+
actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',
|
|
27
|
+
cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',
|
|
30
28
|
},
|
|
31
29
|
}}
|
|
32
30
|
{...props}
|
package/src/react/spinner.tsx
CHANGED
|
@@ -23,10 +23,7 @@ const Spinner = React.forwardRef<SpinnerElement, SpinnerProps>(
|
|
|
23
23
|
const spinner = (
|
|
24
24
|
<span
|
|
25
25
|
ref={ref}
|
|
26
|
-
className={cn(
|
|
27
|
-
'relative flex size-4 items-center justify-center opacity-60',
|
|
28
|
-
className,
|
|
29
|
-
)}
|
|
26
|
+
className={cn('relative flex size-4 items-center justify-center opacity-60', className)}
|
|
30
27
|
{...props}
|
|
31
28
|
>
|
|
32
29
|
{Array.from({ length: spinnerCount }, (_, i) => (
|
|
@@ -56,9 +53,7 @@ const Spinner = React.forwardRef<SpinnerElement, SpinnerProps>(
|
|
|
56
53
|
{children}
|
|
57
54
|
</span>
|
|
58
55
|
<VisuallyHidden>{children}</VisuallyHidden>
|
|
59
|
-
<span className="absolute inset-0 flex items-center justify-center">
|
|
60
|
-
{spinner}
|
|
61
|
-
</span>
|
|
56
|
+
<span className="absolute inset-0 flex items-center justify-center">{spinner}</span>
|
|
62
57
|
</span>
|
|
63
58
|
);
|
|
64
59
|
},
|
package/src/react/strong.tsx
CHANGED
|
@@ -11,13 +11,11 @@ interface StrongProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const Strong = React.forwardRef<StrongElement, StrongProps>(
|
|
15
|
-
|
|
16
|
-
const Component = asChild ? Slot : 'strong';
|
|
14
|
+
const Strong = React.forwardRef<StrongElement, StrongProps>(({ asChild, ...props }, ref) => {
|
|
15
|
+
const Component = asChild ? Slot : 'strong';
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
);
|
|
17
|
+
return <Component ref={ref} {...props} />;
|
|
18
|
+
});
|
|
21
19
|
|
|
22
20
|
Strong.displayName = 'Strong';
|
|
23
21
|
|
package/src/react/switch.tsx
CHANGED
|
@@ -11,20 +11,18 @@ import { cn } from '../lib/utils';
|
|
|
11
11
|
type SwitchElement = React.ElementRef<typeof SwitchPrimitives.Root>;
|
|
12
12
|
type SwitchProps = React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>;
|
|
13
13
|
|
|
14
|
-
const Switch = React.forwardRef<SwitchElement, SwitchProps>(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
),
|
|
27
|
-
);
|
|
14
|
+
const Switch = React.forwardRef<SwitchElement, SwitchProps>(({ className, ...props }, ref) => (
|
|
15
|
+
<SwitchPrimitives.Root
|
|
16
|
+
className={cn(
|
|
17
|
+
'data-[state=checked]:bg-primary data-[state=unchecked]:bg-input peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent shadow-sm transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
ref={ref}
|
|
22
|
+
>
|
|
23
|
+
<SwitchPrimitives.Thumb className="bg-background pointer-events-none block size-4 rounded-full shadow-lg transition data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0" />
|
|
24
|
+
</SwitchPrimitives.Root>
|
|
25
|
+
));
|
|
28
26
|
|
|
29
27
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
30
28
|
|
package/src/react/table.tsx
CHANGED
|
@@ -8,17 +8,11 @@ import { cn } from '../lib/utils';
|
|
|
8
8
|
type TableElement = HTMLTableElement;
|
|
9
9
|
type TableProps = React.HTMLAttributes<HTMLTableElement>;
|
|
10
10
|
|
|
11
|
-
const Table = React.forwardRef<TableElement, TableProps>(
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
className={cn('w-full caption-bottom text-sm', className)}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
</div>
|
|
20
|
-
),
|
|
21
|
-
);
|
|
11
|
+
const Table = React.forwardRef<TableElement, TableProps>(({ className, ...props }, ref) => (
|
|
12
|
+
<div className="relative w-full overflow-auto">
|
|
13
|
+
<table ref={ref} className={cn('w-full caption-bottom text-sm', className)} {...props} />
|
|
14
|
+
</div>
|
|
15
|
+
));
|
|
22
16
|
|
|
23
17
|
Table.displayName = 'Table';
|
|
24
18
|
|
|
@@ -29,11 +23,9 @@ Table.displayName = 'Table';
|
|
|
29
23
|
type TableHeaderElement = HTMLTableSectionElement;
|
|
30
24
|
type TableHeaderProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
31
25
|
|
|
32
|
-
const TableHeader = React.forwardRef<TableHeaderElement, TableHeaderProps>(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
),
|
|
36
|
-
);
|
|
26
|
+
const TableHeader = React.forwardRef<TableHeaderElement, TableHeaderProps>(({ className, ...props }, ref) => (
|
|
27
|
+
<thead ref={ref} className={cn('[&_tr]:border-b', className)} {...props} />
|
|
28
|
+
));
|
|
37
29
|
|
|
38
30
|
TableHeader.displayName = 'TableHeader';
|
|
39
31
|
|
|
@@ -44,15 +36,9 @@ TableHeader.displayName = 'TableHeader';
|
|
|
44
36
|
type TableBodyElement = HTMLTableSectionElement;
|
|
45
37
|
type TableBodyProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
46
38
|
|
|
47
|
-
const TableBody = React.forwardRef<TableBodyElement, TableBodyProps>(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
ref={ref}
|
|
51
|
-
className={cn('[&_tr:last-child]:border-0', className)}
|
|
52
|
-
{...props}
|
|
53
|
-
/>
|
|
54
|
-
),
|
|
55
|
-
);
|
|
39
|
+
const TableBody = React.forwardRef<TableBodyElement, TableBodyProps>(({ className, ...props }, ref) => (
|
|
40
|
+
<tbody ref={ref} className={cn('[&_tr:last-child]:border-0', className)} {...props} />
|
|
41
|
+
));
|
|
56
42
|
|
|
57
43
|
TableBody.displayName = 'TableBody';
|
|
58
44
|
|
|
@@ -63,18 +49,9 @@ TableBody.displayName = 'TableBody';
|
|
|
63
49
|
type TableFooterElement = HTMLTableSectionElement;
|
|
64
50
|
type TableFooterProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
65
51
|
|
|
66
|
-
const TableFooter = React.forwardRef<TableFooterElement, TableFooterProps>(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
ref={ref}
|
|
70
|
-
className={cn(
|
|
71
|
-
'bg-muted/50 border-t font-medium [&>tr]:last:border-b-0',
|
|
72
|
-
className,
|
|
73
|
-
)}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
),
|
|
77
|
-
);
|
|
52
|
+
const TableFooter = React.forwardRef<TableFooterElement, TableFooterProps>(({ className, ...props }, ref) => (
|
|
53
|
+
<tfoot ref={ref} className={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)} {...props} />
|
|
54
|
+
));
|
|
78
55
|
|
|
79
56
|
TableFooter.displayName = 'TableFooter';
|
|
80
57
|
|
|
@@ -85,18 +62,13 @@ TableFooter.displayName = 'TableFooter';
|
|
|
85
62
|
type TableRowElement = HTMLTableRowElement;
|
|
86
63
|
type TableRowProps = React.HTMLAttributes<HTMLTableRowElement>;
|
|
87
64
|
|
|
88
|
-
const TableRow = React.forwardRef<TableRowElement, TableRowProps>(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
)}
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
),
|
|
99
|
-
);
|
|
65
|
+
const TableRow = React.forwardRef<TableRowElement, TableRowProps>(({ className, ...props }, ref) => (
|
|
66
|
+
<tr
|
|
67
|
+
ref={ref}
|
|
68
|
+
className={cn('hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition', className)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
));
|
|
100
72
|
|
|
101
73
|
TableRow.displayName = 'TableRow';
|
|
102
74
|
|
|
@@ -107,18 +79,16 @@ TableRow.displayName = 'TableRow';
|
|
|
107
79
|
type TableHeadElement = HTMLTableCellElement;
|
|
108
80
|
type TableHeadProps = React.ThHTMLAttributes<HTMLTableCellElement>;
|
|
109
81
|
|
|
110
|
-
const TableHead = React.forwardRef<TableHeadElement, TableHeadProps>(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
),
|
|
121
|
-
);
|
|
82
|
+
const TableHead = React.forwardRef<TableHeadElement, TableHeadProps>(({ className, ...props }, ref) => (
|
|
83
|
+
<th
|
|
84
|
+
ref={ref}
|
|
85
|
+
className={cn(
|
|
86
|
+
'text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0',
|
|
87
|
+
className,
|
|
88
|
+
)}
|
|
89
|
+
{...props}
|
|
90
|
+
/>
|
|
91
|
+
));
|
|
122
92
|
|
|
123
93
|
TableHead.displayName = 'TableHead';
|
|
124
94
|
|
|
@@ -129,18 +99,9 @@ TableHead.displayName = 'TableHead';
|
|
|
129
99
|
type TableCellElement = HTMLTableCellElement;
|
|
130
100
|
type TableCellProps = React.TdHTMLAttributes<HTMLTableCellElement>;
|
|
131
101
|
|
|
132
|
-
const TableCell = React.forwardRef<TableCellElement, TableCellProps>(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
ref={ref}
|
|
136
|
-
className={cn(
|
|
137
|
-
'p-4 align-middle [&:has([role=checkbox])]:pr-0',
|
|
138
|
-
className,
|
|
139
|
-
)}
|
|
140
|
-
{...props}
|
|
141
|
-
/>
|
|
142
|
-
),
|
|
143
|
-
);
|
|
102
|
+
const TableCell = React.forwardRef<TableCellElement, TableCellProps>(({ className, ...props }, ref) => (
|
|
103
|
+
<td ref={ref} className={cn('p-4 align-middle [&:has([role=checkbox])]:pr-0', className)} {...props} />
|
|
104
|
+
));
|
|
144
105
|
|
|
145
106
|
TableCell.displayName = 'TableCell';
|
|
146
107
|
|
|
@@ -151,15 +112,9 @@ TableCell.displayName = 'TableCell';
|
|
|
151
112
|
type TableCaptionElement = HTMLTableCaptionElement;
|
|
152
113
|
type TableCaptionProps = React.HTMLAttributes<HTMLTableCaptionElement>;
|
|
153
114
|
|
|
154
|
-
const TableCaption = React.forwardRef<TableCaptionElement, TableCaptionProps>(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
ref={ref}
|
|
158
|
-
className={cn('text-muted-foreground mt-4 text-sm', className)}
|
|
159
|
-
{...props}
|
|
160
|
-
/>
|
|
161
|
-
),
|
|
162
|
-
);
|
|
115
|
+
const TableCaption = React.forwardRef<TableCaptionElement, TableCaptionProps>(({ className, ...props }, ref) => (
|
|
116
|
+
<caption ref={ref} className={cn('text-muted-foreground mt-4 text-sm', className)} {...props} />
|
|
117
|
+
));
|
|
163
118
|
|
|
164
119
|
TableCaption.displayName = 'TableCaption';
|
|
165
120
|
|
package/src/react/tabs.tsx
CHANGED
|
@@ -18,18 +18,16 @@ const Tabs = TabsPrimitive.Root;
|
|
|
18
18
|
type TabsListElement = React.ElementRef<typeof TabsPrimitive.List>;
|
|
19
19
|
type TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>;
|
|
20
20
|
|
|
21
|
-
const TabsList = React.forwardRef<TabsListElement, TabsListProps>(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
),
|
|
32
|
-
);
|
|
21
|
+
const TabsList = React.forwardRef<TabsListElement, TabsListProps>(({ className, ...props }, ref) => (
|
|
22
|
+
<TabsPrimitive.List
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={cn(
|
|
25
|
+
'bg-muted text-muted-foreground inline-flex h-10 items-center justify-center gap-1 rounded-md p-1',
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
));
|
|
33
31
|
|
|
34
32
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
35
33
|
|
|
@@ -38,22 +36,18 @@ TabsList.displayName = TabsPrimitive.List.displayName;
|
|
|
38
36
|
* -------------------------------------------------------------------------- */
|
|
39
37
|
|
|
40
38
|
type TabsTriggerElement = React.ElementRef<typeof TabsPrimitive.Trigger>;
|
|
41
|
-
type TabsTriggerProps = React.ComponentPropsWithoutRef<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{...props}
|
|
54
|
-
/>
|
|
55
|
-
),
|
|
56
|
-
);
|
|
39
|
+
type TabsTriggerProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>;
|
|
40
|
+
|
|
41
|
+
const TabsTrigger = React.forwardRef<TabsTriggerElement, TabsTriggerProps>(({ className, ...props }, ref) => (
|
|
42
|
+
<TabsPrimitive.Trigger
|
|
43
|
+
ref={ref}
|
|
44
|
+
className={cn(
|
|
45
|
+
'data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium outline-transparent transition-all focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm',
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
));
|
|
57
51
|
|
|
58
52
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
59
53
|
|
|
@@ -62,22 +56,18 @@ TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
|
62
56
|
* -------------------------------------------------------------------------- */
|
|
63
57
|
|
|
64
58
|
type TabsContentElement = React.ElementRef<typeof TabsPrimitive.Content>;
|
|
65
|
-
type TabsContentProps = React.ComponentPropsWithoutRef<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{...props}
|
|
78
|
-
/>
|
|
79
|
-
),
|
|
80
|
-
);
|
|
59
|
+
type TabsContentProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>;
|
|
60
|
+
|
|
61
|
+
const TabsContent = React.forwardRef<TabsContentElement, TabsContentProps>(({ className, ...props }, ref) => (
|
|
62
|
+
<TabsPrimitive.Content
|
|
63
|
+
ref={ref}
|
|
64
|
+
className={cn(
|
|
65
|
+
'mt-2 rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2',
|
|
66
|
+
className,
|
|
67
|
+
)}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
));
|
|
81
71
|
|
|
82
72
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
83
73
|
|
package/src/react/text.tsx
CHANGED
|
@@ -7,8 +7,7 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
7
7
|
|
|
8
8
|
type TextElement = HTMLParagraphElement;
|
|
9
9
|
|
|
10
|
-
interface TextParagraphProps
|
|
11
|
-
extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
10
|
+
interface TextParagraphProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
12
11
|
as?: 'p';
|
|
13
12
|
}
|
|
14
13
|
|
|
@@ -20,13 +19,11 @@ type TextProps = (TextParagraphProps | TextSpanProps) & {
|
|
|
20
19
|
asChild?: boolean;
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
const Text = React.forwardRef<TextElement, TextProps>(
|
|
24
|
-
|
|
25
|
-
const Component = asChild ? Slot : Tag;
|
|
22
|
+
const Text = React.forwardRef<TextElement, TextProps>(({ as: Tag = 'p', asChild, ...props }, ref) => {
|
|
23
|
+
const Component = asChild ? Slot : Tag;
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
);
|
|
25
|
+
return <Component ref={ref} {...props} />;
|
|
26
|
+
});
|
|
30
27
|
|
|
31
28
|
Text.displayName = 'Text';
|
|
32
29
|
|
package/src/react/textarea.tsx
CHANGED
|
@@ -8,20 +8,18 @@ import { cn } from '../lib/utils';
|
|
|
8
8
|
type TextareaElement = HTMLTextAreaElement;
|
|
9
9
|
type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
10
10
|
|
|
11
|
-
const Textarea = React.forwardRef<TextareaElement, TextareaProps>(
|
|
12
|
-
(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
);
|
|
11
|
+
const Textarea = React.forwardRef<TextareaElement, TextareaProps>(({ className, ...props }, ref) => {
|
|
12
|
+
return (
|
|
13
|
+
<textarea
|
|
14
|
+
className={cn(
|
|
15
|
+
'border-input placeholder:text-muted-foreground flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
16
|
+
className,
|
|
17
|
+
)}
|
|
18
|
+
ref={ref}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
});
|
|
25
23
|
|
|
26
24
|
Textarea.displayName = 'Textarea';
|
|
27
25
|
|