@codefast/ui 0.0.64 → 0.0.66
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-ZMF2SRE5.js → chunk-26W5NJTU.js} +1 -1
- package/dist/chunk-26W5NJTU.js.map +1 -0
- package/dist/chunk-3COHZ24E.cjs +2 -0
- package/dist/chunk-3COHZ24E.cjs.map +1 -0
- package/dist/chunk-4MTN7WZ2.cjs +2 -0
- package/dist/chunk-4MTN7WZ2.cjs.map +1 -0
- package/dist/chunk-5QETIFO4.js +2 -0
- package/dist/chunk-5QETIFO4.js.map +1 -0
- package/dist/{chunk-WECV77JD.cjs → chunk-5RJANBDJ.cjs} +1 -1
- package/dist/chunk-5RJANBDJ.cjs.map +1 -0
- package/dist/chunk-6UQKMUZG.cjs +2 -0
- package/dist/chunk-6UQKMUZG.cjs.map +1 -0
- package/dist/chunk-AVEDWLNQ.js +2 -0
- package/dist/chunk-AVEDWLNQ.js.map +1 -0
- package/dist/{chunk-YLE5XFEO.cjs → chunk-EW7DAPDC.cjs} +1 -1
- package/dist/chunk-EW7DAPDC.cjs.map +1 -0
- package/dist/chunk-HDHZESSG.js +2 -0
- package/dist/chunk-HDHZESSG.js.map +1 -0
- package/dist/{chunk-GCHNSK5O.cjs → chunk-JMM2MTPI.cjs} +1 -1
- package/dist/chunk-JMM2MTPI.cjs.map +1 -0
- package/dist/{chunk-WRO3QIWH.js → chunk-JNOLIDCD.js} +1 -1
- package/dist/chunk-JNOLIDCD.js.map +1 -0
- package/dist/{chunk-F5TIIJJJ.cjs → chunk-LOJBMYTH.cjs} +1 -1
- package/dist/chunk-LOJBMYTH.cjs.map +1 -0
- package/dist/{chunk-A5ILA637.js → chunk-RBP4PBCK.js} +1 -1
- package/dist/chunk-RBP4PBCK.js.map +1 -0
- package/dist/{chunk-L7IASKCH.js → chunk-RVGKUNXC.js} +1 -1
- package/dist/{chunk-L7IASKCH.js.map → chunk-RVGKUNXC.js.map} +1 -1
- package/dist/{chunk-72NPDP3X.cjs → chunk-T3G5USVY.cjs} +1 -1
- package/dist/chunk-T3G5USVY.cjs.map +1 -0
- package/dist/chunk-VDVLCSO4.js +2 -0
- package/dist/chunk-VDVLCSO4.js.map +1 -0
- package/dist/{chunk-2OBTJ7SD.cjs → chunk-WKKCZQNO.cjs} +2 -2
- package/dist/chunk-WKKCZQNO.cjs.map +1 -0
- package/dist/{chunk-FNQFZJUG.js → chunk-WQFHFTYS.js} +1 -1
- package/dist/chunk-WQFHFTYS.js.map +1 -0
- package/dist/react/accordion.cjs.map +1 -1
- package/dist/react/accordion.js.map +1 -1
- package/dist/react/alert-dialog.cjs +1 -1
- package/dist/react/alert-dialog.cjs.map +1 -1
- package/dist/react/alert-dialog.d.cts +3 -1
- package/dist/react/alert-dialog.d.ts +3 -1
- package/dist/react/alert-dialog.js +1 -1
- package/dist/react/alert-dialog.js.map +1 -1
- package/dist/react/alert.cjs.map +1 -1
- package/dist/react/alert.js.map +1 -1
- package/dist/react/avatar.cjs.map +1 -1
- package/dist/react/avatar.js.map +1 -1
- package/dist/react/blockquote.cjs.map +1 -1
- package/dist/react/blockquote.js.map +1 -1
- package/dist/react/box.cjs.map +1 -1
- package/dist/react/box.js.map +1 -1
- package/dist/react/breadcrumb.cjs +1 -1
- package/dist/react/breadcrumb.cjs.map +1 -1
- package/dist/react/breadcrumb.js +1 -1
- package/dist/react/breadcrumb.js.map +1 -1
- package/dist/react/button.cjs +1 -1
- package/dist/react/button.js +1 -1
- package/dist/react/calendar.cjs +1 -1
- package/dist/react/calendar.js +1 -1
- package/dist/react/card.cjs.map +1 -1
- package/dist/react/card.js.map +1 -1
- package/dist/react/carousel.cjs +1 -1
- package/dist/react/carousel.cjs.map +1 -1
- package/dist/react/carousel.js +1 -1
- package/dist/react/carousel.js.map +1 -1
- package/dist/react/checkbox-cards.cjs +1 -1
- package/dist/react/checkbox-cards.cjs.map +1 -1
- package/dist/react/checkbox-cards.js +1 -1
- package/dist/react/checkbox-cards.js.map +1 -1
- package/dist/react/checkbox-group.cjs +1 -1
- package/dist/react/checkbox-group.cjs.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.primitive.cjs +1 -1
- package/dist/react/checkbox-group.primitive.js +1 -1
- package/dist/react/checkbox.cjs +1 -1
- package/dist/react/checkbox.cjs.map +1 -1
- package/dist/react/checkbox.js +1 -1
- package/dist/react/checkbox.js.map +1 -1
- package/dist/react/code.cjs.map +1 -1
- package/dist/react/code.js.map +1 -1
- package/dist/react/collapsible.cjs.map +1 -1
- package/dist/react/collapsible.js.map +1 -1
- package/dist/react/command.cjs +1 -1
- package/dist/react/command.cjs.map +1 -1
- package/dist/react/command.js +1 -1
- package/dist/react/command.js.map +1 -1
- package/dist/react/container.cjs.map +1 -1
- package/dist/react/container.js.map +1 -1
- package/dist/react/context-menu.cjs.map +1 -1
- package/dist/react/context-menu.js.map +1 -1
- package/dist/react/data-table.cjs +1 -1
- package/dist/react/data-table.js +1 -1
- package/dist/react/dialog.cjs +1 -1
- package/dist/react/dialog.d.cts +1 -1
- package/dist/react/dialog.d.ts +1 -1
- package/dist/react/dialog.js +1 -1
- package/dist/react/drawer.cjs.map +1 -1
- package/dist/react/drawer.js.map +1 -1
- package/dist/react/dropdown-menu.cjs +1 -1
- package/dist/react/dropdown-menu.js +1 -1
- package/dist/react/em.cjs.map +1 -1
- package/dist/react/em.js.map +1 -1
- package/dist/react/form.cjs +1 -1
- package/dist/react/form.cjs.map +1 -1
- package/dist/react/form.js +1 -1
- package/dist/react/form.js.map +1 -1
- package/dist/react/heading.cjs.map +1 -1
- package/dist/react/heading.js.map +1 -1
- package/dist/react/hover-card.cjs.map +1 -1
- package/dist/react/hover-card.js.map +1 -1
- package/dist/react/input-otp.cjs +1 -1
- package/dist/react/input-otp.cjs.map +1 -1
- package/dist/react/input-otp.js +1 -1
- package/dist/react/input-otp.js.map +1 -1
- package/dist/react/input.cjs +1 -1
- package/dist/react/input.cjs.map +1 -1
- package/dist/react/input.d.cts +113 -34
- package/dist/react/input.d.ts +113 -34
- package/dist/react/input.js +1 -1
- package/dist/react/input.js.map +1 -1
- package/dist/react/kbd.cjs.map +1 -1
- package/dist/react/kbd.js.map +1 -1
- package/dist/react/label.cjs +1 -1
- package/dist/react/label.js +1 -1
- package/dist/react/menubar.cjs.map +1 -1
- package/dist/react/menubar.js.map +1 -1
- package/dist/react/navigation-menu.cjs.map +1 -1
- package/dist/react/navigation-menu.js.map +1 -1
- package/dist/react/pagination.cjs +1 -1
- package/dist/react/pagination.cjs.map +1 -1
- package/dist/react/pagination.js +1 -1
- package/dist/react/pagination.js.map +1 -1
- package/dist/react/popover.cjs.map +1 -1
- package/dist/react/popover.js.map +1 -1
- package/dist/react/pre.cjs.map +1 -1
- package/dist/react/pre.js.map +1 -1
- package/dist/react/progress.cjs.map +1 -1
- package/dist/react/progress.js.map +1 -1
- package/dist/react/quote.cjs.map +1 -1
- package/dist/react/quote.js.map +1 -1
- package/dist/react/radio-cards.cjs +1 -1
- package/dist/react/radio-cards.cjs.map +1 -1
- package/dist/react/radio-cards.js +1 -1
- package/dist/react/radio-cards.js.map +1 -1
- package/dist/react/radio-group.cjs.map +1 -1
- package/dist/react/radio-group.js.map +1 -1
- package/dist/react/radio.cjs.map +1 -1
- package/dist/react/radio.js.map +1 -1
- package/dist/react/scroll-area.cjs.map +1 -1
- package/dist/react/scroll-area.js.map +1 -1
- package/dist/react/section.cjs.map +1 -1
- package/dist/react/section.js.map +1 -1
- package/dist/react/select.cjs +1 -1
- package/dist/react/select.js +1 -1
- package/dist/react/separator.cjs.map +1 -1
- package/dist/react/separator.js.map +1 -1
- package/dist/react/sheet.cjs +1 -1
- package/dist/react/sheet.cjs.map +1 -1
- package/dist/react/sheet.js +1 -1
- package/dist/react/sheet.js.map +1 -1
- package/dist/react/slider.cjs.map +1 -1
- package/dist/react/slider.js.map +1 -1
- package/dist/react/spinner.cjs +1 -1
- package/dist/react/spinner.js +1 -1
- package/dist/react/strong.cjs.map +1 -1
- package/dist/react/strong.js.map +1 -1
- package/dist/react/switch.cjs +1 -1
- package/dist/react/switch.cjs.map +1 -1
- package/dist/react/switch.js +1 -1
- package/dist/react/switch.js.map +1 -1
- package/dist/react/table.cjs.map +1 -1
- package/dist/react/table.js.map +1 -1
- package/dist/react/tabs.cjs.map +1 -1
- package/dist/react/tabs.js.map +1 -1
- package/dist/react/text-input.cjs +2 -0
- package/dist/react/text-input.cjs.map +1 -0
- package/dist/react/text-input.d.cts +11 -0
- package/dist/react/text-input.d.ts +11 -0
- package/dist/react/text-input.js +2 -0
- package/dist/react/text-input.js.map +1 -0
- package/dist/react/text.cjs.map +1 -1
- package/dist/react/text.js.map +1 -1
- package/dist/react/textarea.cjs +1 -1
- package/dist/react/textarea.cjs.map +1 -1
- package/dist/react/textarea.js +1 -1
- package/dist/react/textarea.js.map +1 -1
- package/dist/react/toggle-group.cjs +1 -1
- package/dist/react/toggle-group.cjs.map +1 -1
- package/dist/react/toggle-group.js +1 -1
- package/dist/react/toggle-group.js.map +1 -1
- package/dist/react/toggle.cjs +1 -1
- package/dist/react/toggle.js +1 -1
- package/dist/react/tooltip.cjs.map +1 -1
- package/dist/react/tooltip.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +8 -2
- package/src/react/accordion.tsx +9 -7
- package/src/react/alert-dialog.tsx +55 -20
- package/src/react/alert.tsx +11 -9
- package/src/react/avatar.tsx +13 -11
- package/src/react/blockquote.tsx +2 -2
- package/src/react/box.tsx +2 -2
- package/src/react/breadcrumb.tsx +33 -27
- package/src/react/button.tsx +3 -4
- package/src/react/card.tsx +21 -15
- package/src/react/carousel.tsx +10 -10
- package/src/react/checkbox-cards.tsx +8 -6
- package/src/react/checkbox-group.primitive.tsx +12 -6
- package/src/react/checkbox-group.tsx +7 -5
- package/src/react/checkbox.tsx +3 -3
- package/src/react/code.tsx +2 -2
- package/src/react/collapsible.tsx +2 -2
- package/src/react/command.tsx +46 -36
- package/src/react/container.tsx +6 -4
- package/src/react/context-menu.tsx +22 -18
- package/src/react/dialog.tsx +13 -9
- package/src/react/drawer.tsx +10 -6
- package/src/react/dropdown-menu.tsx +20 -16
- package/src/react/em.tsx +2 -2
- package/src/react/form.tsx +38 -22
- package/src/react/heading.tsx +6 -4
- package/src/react/hover-card.tsx +7 -5
- package/src/react/input-otp.tsx +40 -34
- package/src/react/input.tsx +115 -12
- package/src/react/kbd.tsx +2 -2
- package/src/react/label.tsx +2 -2
- package/src/react/menubar.tsx +48 -42
- package/src/react/navigation-menu.tsx +12 -12
- package/src/react/pagination.tsx +5 -5
- package/src/react/popover.tsx +7 -5
- package/src/react/pre.tsx +2 -2
- package/src/react/progress.tsx +2 -2
- package/src/react/quote.tsx +2 -2
- package/src/react/radio-cards.tsx +16 -14
- package/src/react/radio-group.tsx +18 -16
- package/src/react/radio.tsx +16 -14
- package/src/react/scroll-area.tsx +4 -4
- package/src/react/section.tsx +2 -2
- package/src/react/select.tsx +32 -30
- package/src/react/separator.tsx +2 -2
- package/src/react/sheet.tsx +15 -7
- package/src/react/slider.tsx +2 -2
- package/src/react/spinner.tsx +2 -2
- package/src/react/strong.tsx +2 -2
- package/src/react/switch.tsx +3 -3
- package/src/react/table.tsx +23 -17
- package/src/react/tabs.tsx +6 -6
- package/src/react/text-input.tsx +36 -0
- package/src/react/text.tsx +2 -2
- package/src/react/textarea.tsx +3 -3
- package/src/react/toggle-group.tsx +7 -4
- package/src/react/toggle.tsx +2 -2
- package/src/react/tooltip.tsx +7 -5
- package/dist/chunk-2OBTJ7SD.cjs.map +0 -1
- package/dist/chunk-37XZ3LKY.cjs +0 -2
- package/dist/chunk-37XZ3LKY.cjs.map +0 -1
- package/dist/chunk-3OEPCFBF.cjs +0 -2
- package/dist/chunk-3OEPCFBF.cjs.map +0 -1
- package/dist/chunk-6AFJCDFU.js +0 -2
- package/dist/chunk-6AFJCDFU.js.map +0 -1
- package/dist/chunk-72NPDP3X.cjs.map +0 -1
- package/dist/chunk-7CHCTEST.js +0 -2
- package/dist/chunk-7CHCTEST.js.map +0 -1
- package/dist/chunk-A5ILA637.js.map +0 -1
- package/dist/chunk-F5TIIJJJ.cjs.map +0 -1
- package/dist/chunk-FNQFZJUG.js.map +0 -1
- package/dist/chunk-GCHNSK5O.cjs.map +0 -1
- package/dist/chunk-SHMTOJHM.js +0 -2
- package/dist/chunk-SHMTOJHM.js.map +0 -1
- package/dist/chunk-WECV77JD.cjs.map +0 -1
- package/dist/chunk-WRO3QIWH.js.map +0 -1
- package/dist/chunk-YLE5XFEO.cjs.map +0 -1
- package/dist/chunk-ZMF2SRE5.js.map +0 -1
package/src/react/progress.tsx
CHANGED
|
@@ -11,9 +11,9 @@ import { cn } from '../lib/utils';
|
|
|
11
11
|
type ProgressElement = React.ElementRef<typeof ProgressPrimitive.Root>;
|
|
12
12
|
type ProgressProps = React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>;
|
|
13
13
|
|
|
14
|
-
const Progress = React.forwardRef<ProgressElement, ProgressProps>(({ className, value, ...props },
|
|
14
|
+
const Progress = React.forwardRef<ProgressElement, ProgressProps>(({ className, value, ...props }, forwardedRef) => (
|
|
15
15
|
<ProgressPrimitive.Root
|
|
16
|
-
ref={
|
|
16
|
+
ref={forwardedRef}
|
|
17
17
|
className={cn('bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', className)}
|
|
18
18
|
{...props}
|
|
19
19
|
>
|
package/src/react/quote.tsx
CHANGED
|
@@ -11,10 +11,10 @@ interface QuoteProps extends React.QuoteHTMLAttributes<HTMLQuoteElement> {
|
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const Quote = React.forwardRef<QuoteElement, QuoteProps>(({ asChild, ...props },
|
|
14
|
+
const Quote = React.forwardRef<QuoteElement, QuoteProps>(({ asChild, ...props }, forwardedRef) => {
|
|
15
15
|
const Component = asChild ? Slot : 'q';
|
|
16
16
|
|
|
17
|
-
return <Component ref={
|
|
17
|
+
return <Component ref={forwardedRef} {...props} />;
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
Quote.displayName = 'Quote';
|
|
@@ -11,8 +11,8 @@ import { cn } from '../lib/utils';
|
|
|
11
11
|
type RadioCardsElement = React.ElementRef<typeof RadioGroupPrimitive.Root>;
|
|
12
12
|
type RadioCardsProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;
|
|
13
13
|
|
|
14
|
-
const RadioCards = React.forwardRef<RadioCardsElement, RadioCardsProps>(({ className, ...props },
|
|
15
|
-
return <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={
|
|
14
|
+
const RadioCards = React.forwardRef<RadioCardsElement, RadioCardsProps>(({ className, ...props }, forwardedRef) => {
|
|
15
|
+
return <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={forwardedRef} />;
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
RadioCards.displayName = RadioGroupPrimitive.Root.displayName;
|
|
@@ -24,18 +24,20 @@ RadioCards.displayName = RadioGroupPrimitive.Root.displayName;
|
|
|
24
24
|
type RadioCardsItemElement = React.ElementRef<typeof RadioGroupPrimitive.Item>;
|
|
25
25
|
type RadioCardsItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;
|
|
26
26
|
|
|
27
|
-
const RadioCardsItem = React.forwardRef<RadioCardsItemElement, RadioCardsItemProps>(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
const RadioCardsItem = React.forwardRef<RadioCardsItemElement, RadioCardsItemProps>(
|
|
28
|
+
({ className, ...props }, forwardedRef) => {
|
|
29
|
+
return (
|
|
30
|
+
<RadioGroupPrimitive.Item
|
|
31
|
+
ref={forwardedRef}
|
|
32
|
+
className={cn(
|
|
33
|
+
'text-foreground focus-visible:bg-primary/10 group peer flex cursor-pointer items-center justify-center rounded-md border p-4 focus-visible:outline focus-visible:outline-2 disabled:cursor-default disabled:opacity-50 aria-checked:outline aria-checked:outline-2',
|
|
34
|
+
className,
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
);
|
|
39
41
|
|
|
40
42
|
RadioCardsItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
41
43
|
|
|
@@ -11,8 +11,8 @@ import { cn } from '../lib/utils';
|
|
|
11
11
|
type RadioGroupElement = React.ElementRef<typeof RadioGroupPrimitive.Root>;
|
|
12
12
|
type RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;
|
|
13
13
|
|
|
14
|
-
const RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(({ className, ...props },
|
|
15
|
-
return <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={
|
|
14
|
+
const RadioGroup = React.forwardRef<RadioGroupElement, RadioGroupProps>(({ className, ...props }, forwardedRef) => {
|
|
15
|
+
return <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={forwardedRef} />;
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
@@ -24,20 +24,22 @@ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
|
24
24
|
type RadioGroupItemElement = React.ElementRef<typeof RadioGroupPrimitive.Item>;
|
|
25
25
|
type RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;
|
|
26
26
|
|
|
27
|
-
const RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
const RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(
|
|
28
|
+
({ className, ...props }, forwardedRef) => {
|
|
29
|
+
return (
|
|
30
|
+
<RadioGroupPrimitive.Item
|
|
31
|
+
ref={forwardedRef}
|
|
32
|
+
className={cn(
|
|
33
|
+
'border-input hover:border-primary text-foreground aria-checked:border-primary group peer aspect-square size-4 rounded-full border focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
34
|
+
className,
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
>
|
|
38
|
+
<RadioGroupPrimitive.Indicator className="after:bg-primary relative flex size-full items-center justify-center after:block after:size-2.5 after:rounded-full" />
|
|
39
|
+
</RadioGroupPrimitive.Item>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
);
|
|
41
43
|
|
|
42
44
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
43
45
|
|
package/src/react/radio.tsx
CHANGED
|
@@ -14,20 +14,22 @@ interface RadioProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
14
14
|
onValueChange?: (value: string) => void;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const Radio = React.forwardRef<RadioElement, RadioProps>(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
const Radio = React.forwardRef<RadioElement, RadioProps>(
|
|
18
|
+
({ className, onValueChange, onChange, ...props }, forwardedRef) => {
|
|
19
|
+
return (
|
|
20
|
+
<input
|
|
21
|
+
ref={forwardedRef}
|
|
22
|
+
className={cn(
|
|
23
|
+
'before:border-input hover:before:border-primary checked:before:border-primary checked:after:bg-primary peer relative flex appearance-none items-center justify-center rounded-full before:size-4 before:rounded-full before:border checked:after:absolute checked:after:size-2.5 checked:after:rounded-full focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
type="radio"
|
|
27
|
+
onChange={composeEventHandlers(onChange, (event) => onValueChange?.(event.currentTarget.value))}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
);
|
|
31
33
|
|
|
32
34
|
Radio.displayName = 'Radio';
|
|
33
35
|
|
|
@@ -24,9 +24,9 @@ type ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Root>;
|
|
|
24
24
|
type ScrollAreaProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & ScrollAreaContextValue;
|
|
25
25
|
|
|
26
26
|
const ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>(
|
|
27
|
-
({ __scopeScrollArea, children, className, size = '2', ...props }: ScopedProps<ScrollAreaProps>,
|
|
27
|
+
({ __scopeScrollArea, children, className, size = '2', ...props }: ScopedProps<ScrollAreaProps>, forwardedRef) => (
|
|
28
28
|
<CarouselProvider scope={__scopeScrollArea} size={size}>
|
|
29
|
-
<ScrollAreaPrimitive.Root ref={
|
|
29
|
+
<ScrollAreaPrimitive.Root ref={forwardedRef} className={cn('relative overflow-hidden', className)} {...props}>
|
|
30
30
|
<ScrollAreaPrimitive.Viewport className="size-full rounded-[inherit] [&>*]:h-full">
|
|
31
31
|
{children}
|
|
32
32
|
</ScrollAreaPrimitive.Viewport>
|
|
@@ -80,13 +80,13 @@ type ScrollAreaScrollbarProps = React.ComponentPropsWithoutRef<typeof ScrollArea
|
|
|
80
80
|
const ScrollAreaScrollbar = React.forwardRef<ScrollAreaScrollbarElement, ScrollAreaScrollbarProps>(
|
|
81
81
|
(
|
|
82
82
|
{ __scopeScrollArea, className, orientation = 'vertical', ...props }: ScopedProps<ScrollAreaScrollbarProps>,
|
|
83
|
-
|
|
83
|
+
forwardedRef,
|
|
84
84
|
) => {
|
|
85
85
|
const { size } = useCarouselContext(SCROLL_AREA_NAME, __scopeScrollArea);
|
|
86
86
|
|
|
87
87
|
return (
|
|
88
88
|
<ScrollAreaPrimitive.Scrollbar
|
|
89
|
-
ref={
|
|
89
|
+
ref={forwardedRef}
|
|
90
90
|
className={scrollAreaScrollbarVariants({ orientation, size, className })}
|
|
91
91
|
orientation={orientation}
|
|
92
92
|
{...props}
|
package/src/react/section.tsx
CHANGED
|
@@ -11,10 +11,10 @@ interface SectionProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const Section = React.forwardRef<SectionElement, SectionProps>(({ asChild, ...props },
|
|
14
|
+
const Section = React.forwardRef<SectionElement, SectionProps>(({ asChild, ...props }, forwardedRef) => {
|
|
15
15
|
const Component = asChild ? Slot : 'section';
|
|
16
16
|
|
|
17
|
-
return <Component ref={
|
|
17
|
+
return <Component ref={forwardedRef} {...props} />;
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
Section.displayName = 'Section';
|
package/src/react/select.tsx
CHANGED
|
@@ -34,11 +34,11 @@ type SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;
|
|
|
34
34
|
type SelectTriggerProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>;
|
|
35
35
|
|
|
36
36
|
const SelectTrigger = React.forwardRef<SelectTriggerElement, SelectTriggerProps>(
|
|
37
|
-
({ children, className, ...props },
|
|
37
|
+
({ children, className, ...props }, forwardedRef) => (
|
|
38
38
|
<SelectPrimitive.Trigger
|
|
39
|
-
ref={
|
|
39
|
+
ref={forwardedRef}
|
|
40
40
|
className={cn(
|
|
41
|
-
'border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-
|
|
41
|
+
'border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate',
|
|
42
42
|
className,
|
|
43
43
|
)}
|
|
44
44
|
{...props}
|
|
@@ -61,9 +61,9 @@ type SelectScrollUpButtonElement = React.ElementRef<typeof SelectPrimitive.Scrol
|
|
|
61
61
|
type SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>;
|
|
62
62
|
|
|
63
63
|
const SelectScrollUpButton = React.forwardRef<SelectScrollUpButtonElement, SelectScrollUpButtonProps>(
|
|
64
|
-
({ className, ...props },
|
|
64
|
+
({ className, ...props }, forwardedRef) => (
|
|
65
65
|
<SelectPrimitive.ScrollUpButton
|
|
66
|
-
ref={
|
|
66
|
+
ref={forwardedRef}
|
|
67
67
|
className={cn('flex cursor-pointer items-center justify-center py-1', className)}
|
|
68
68
|
{...props}
|
|
69
69
|
>
|
|
@@ -82,9 +82,9 @@ type SelectScrollDownButtonElement = React.ElementRef<typeof SelectPrimitive.Scr
|
|
|
82
82
|
type SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>;
|
|
83
83
|
|
|
84
84
|
const SelectScrollDownButton = React.forwardRef<SelectScrollDownButtonElement, SelectScrollDownButtonProps>(
|
|
85
|
-
({ className, ...props },
|
|
85
|
+
({ className, ...props }, forwardedRef) => (
|
|
86
86
|
<SelectPrimitive.ScrollDownButton
|
|
87
|
-
ref={
|
|
87
|
+
ref={forwardedRef}
|
|
88
88
|
className={cn('flex cursor-pointer items-center justify-center py-1', className)}
|
|
89
89
|
{...props}
|
|
90
90
|
>
|
|
@@ -103,10 +103,10 @@ type SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;
|
|
|
103
103
|
type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;
|
|
104
104
|
|
|
105
105
|
const SelectContent = React.forwardRef<SelectContentElement, SelectContentProps>(
|
|
106
|
-
({ children, className, position = 'popper', ...props },
|
|
106
|
+
({ children, className, position = 'popper', ...props }, forwardedRef) => (
|
|
107
107
|
<SelectPrimitive.Portal>
|
|
108
108
|
<SelectPrimitive.Content
|
|
109
|
-
ref={
|
|
109
|
+
ref={forwardedRef}
|
|
110
110
|
className={cn(
|
|
111
111
|
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',
|
|
112
112
|
position === 'popper' &&
|
|
@@ -141,8 +141,8 @@ SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
|
141
141
|
type SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;
|
|
142
142
|
type SelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;
|
|
143
143
|
|
|
144
|
-
const SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(({ className, ...props },
|
|
145
|
-
<SelectPrimitive.Label ref={
|
|
144
|
+
const SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(({ className, ...props }, forwardedRef) => (
|
|
145
|
+
<SelectPrimitive.Label ref={forwardedRef} className={cn('px-2 py-1.5 text-sm font-semibold', className)} {...props} />
|
|
146
146
|
));
|
|
147
147
|
|
|
148
148
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
@@ -154,23 +154,25 @@ SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
|
154
154
|
type SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;
|
|
155
155
|
type SelectItemProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>;
|
|
156
156
|
|
|
157
|
-
const SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
<
|
|
168
|
-
<
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
157
|
+
const SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(
|
|
158
|
+
({ children, className, ...props }, forwardedRef) => (
|
|
159
|
+
<SelectPrimitive.Item
|
|
160
|
+
ref={forwardedRef}
|
|
161
|
+
className={cn(
|
|
162
|
+
'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',
|
|
163
|
+
className,
|
|
164
|
+
)}
|
|
165
|
+
{...props}
|
|
166
|
+
>
|
|
167
|
+
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
168
|
+
<SelectPrimitive.ItemIndicator>
|
|
169
|
+
<CheckIcon className="size-4" />
|
|
170
|
+
</SelectPrimitive.ItemIndicator>
|
|
171
|
+
</span>
|
|
172
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
173
|
+
</SelectPrimitive.Item>
|
|
174
|
+
),
|
|
175
|
+
);
|
|
174
176
|
|
|
175
177
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
176
178
|
|
|
@@ -182,8 +184,8 @@ type SelectSeparatorElement = React.ElementRef<typeof SelectPrimitive.Separator>
|
|
|
182
184
|
type SelectSeparatorProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>;
|
|
183
185
|
|
|
184
186
|
const SelectSeparator = React.forwardRef<SelectSeparatorElement, SelectSeparatorProps>(
|
|
185
|
-
({ className, ...props },
|
|
186
|
-
<SelectPrimitive.Separator ref={
|
|
187
|
+
({ className, ...props }, forwardedRef) => (
|
|
188
|
+
<SelectPrimitive.Separator ref={forwardedRef} className={cn('bg-muted -mx-1 my-1 h-px', className)} {...props} />
|
|
187
189
|
),
|
|
188
190
|
);
|
|
189
191
|
|
package/src/react/separator.tsx
CHANGED
|
@@ -12,9 +12,9 @@ type SeparatorElement = React.ElementRef<typeof SeparatorPrimitive.Root>;
|
|
|
12
12
|
type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>;
|
|
13
13
|
|
|
14
14
|
const Separator = React.forwardRef<SeparatorElement, SeparatorProps>(
|
|
15
|
-
({ className, orientation = 'horizontal', decorative = true, ...props },
|
|
15
|
+
({ className, orientation = 'horizontal', decorative = true, ...props }, forwardedRef) => (
|
|
16
16
|
<SeparatorPrimitive.Root
|
|
17
|
-
ref={
|
|
17
|
+
ref={forwardedRef}
|
|
18
18
|
className={cn('bg-border shrink-0', orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px', className)}
|
|
19
19
|
decorative={decorative}
|
|
20
20
|
orientation={orientation}
|
package/src/react/sheet.tsx
CHANGED
|
@@ -58,10 +58,10 @@ type SheetContentElement = React.ElementRef<typeof SheetPrimitive.Content>;
|
|
|
58
58
|
type SheetContentProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> & SheetContentVariantsProps;
|
|
59
59
|
|
|
60
60
|
const SheetContent = React.forwardRef<SheetContentElement, SheetContentProps>(
|
|
61
|
-
({ children, side = 'right', className, ...props },
|
|
61
|
+
({ children, side = 'right', className, ...props }, forwardedRef) => (
|
|
62
62
|
<SheetPrimitive.Portal>
|
|
63
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" />
|
|
64
|
-
<SheetPrimitive.Content ref={
|
|
64
|
+
<SheetPrimitive.Content ref={forwardedRef} className={sheetContentVariants({ side, className })} {...props}>
|
|
65
65
|
{children}
|
|
66
66
|
<SheetPrimitive.Close className="data-[state=open]:bg-secondary absolute right-4 top-4 rounded-sm p-1 opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none">
|
|
67
67
|
<Cross2Icon className="size-4" />
|
|
@@ -108,7 +108,7 @@ type SheetFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
|
108
108
|
function SheetFooter({ className, ...props }: SheetFooterProps): React.JSX.Element {
|
|
109
109
|
return (
|
|
110
110
|
<footer
|
|
111
|
-
className={cn('flex shrink-0 flex-col-reverse px-6 pb-6 pt-4 sm:flex-row sm:justify-end
|
|
111
|
+
className={cn('flex shrink-0 flex-col-reverse gap-2 px-6 pb-6 pt-4 sm:flex-row sm:justify-end', className)}
|
|
112
112
|
{...props}
|
|
113
113
|
/>
|
|
114
114
|
);
|
|
@@ -123,8 +123,12 @@ SheetFooter.displayName = 'SheetFooter';
|
|
|
123
123
|
type SheetTitleElement = React.ElementRef<typeof SheetPrimitive.Title>;
|
|
124
124
|
type SheetTitleProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>;
|
|
125
125
|
|
|
126
|
-
const SheetTitle = React.forwardRef<SheetTitleElement, SheetTitleProps>(({ className, ...props },
|
|
127
|
-
<SheetPrimitive.Title
|
|
126
|
+
const SheetTitle = React.forwardRef<SheetTitleElement, SheetTitleProps>(({ className, ...props }, forwardedRef) => (
|
|
127
|
+
<SheetPrimitive.Title
|
|
128
|
+
ref={forwardedRef}
|
|
129
|
+
className={cn('text-foreground text-lg font-semibold', className)}
|
|
130
|
+
{...props}
|
|
131
|
+
/>
|
|
128
132
|
));
|
|
129
133
|
|
|
130
134
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
@@ -137,8 +141,12 @@ type SheetDescriptionElement = React.ElementRef<typeof SheetPrimitive.Descriptio
|
|
|
137
141
|
type SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>;
|
|
138
142
|
|
|
139
143
|
const SheetDescription = React.forwardRef<SheetDescriptionElement, SheetDescriptionProps>(
|
|
140
|
-
({ className, ...props },
|
|
141
|
-
<SheetPrimitive.Description
|
|
144
|
+
({ className, ...props }, forwardedRef) => (
|
|
145
|
+
<SheetPrimitive.Description
|
|
146
|
+
ref={forwardedRef}
|
|
147
|
+
className={cn('text-muted-foreground text-sm', className)}
|
|
148
|
+
{...props}
|
|
149
|
+
/>
|
|
142
150
|
),
|
|
143
151
|
);
|
|
144
152
|
|
package/src/react/slider.tsx
CHANGED
|
@@ -11,9 +11,9 @@ 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>(({ className, ...props },
|
|
14
|
+
const Slider = React.forwardRef<SliderElement, SliderProps>(({ className, ...props }, forwardedRef) => (
|
|
15
15
|
<SliderPrimitive.Root
|
|
16
|
-
ref={
|
|
16
|
+
ref={forwardedRef}
|
|
17
17
|
className={cn('relative flex w-full touch-none select-none items-center', className)}
|
|
18
18
|
{...props}
|
|
19
19
|
>
|
package/src/react/spinner.tsx
CHANGED
|
@@ -15,14 +15,14 @@ interface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const Spinner = React.forwardRef<SpinnerElement, SpinnerProps>(
|
|
18
|
-
({ children, className, loading = true, ...props },
|
|
18
|
+
({ children, className, loading = true, ...props }, forwardedRef) => {
|
|
19
19
|
if (!loading) {
|
|
20
20
|
return children;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const spinner = (
|
|
24
24
|
<span
|
|
25
|
-
ref={
|
|
25
|
+
ref={forwardedRef}
|
|
26
26
|
className={cn('relative flex size-4 items-center justify-center opacity-60', className)}
|
|
27
27
|
{...props}
|
|
28
28
|
>
|
package/src/react/strong.tsx
CHANGED
|
@@ -11,10 +11,10 @@ interface StrongProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const Strong = React.forwardRef<StrongElement, StrongProps>(({ asChild, ...props },
|
|
14
|
+
const Strong = React.forwardRef<StrongElement, StrongProps>(({ asChild, ...props }, forwardedRef) => {
|
|
15
15
|
const Component = asChild ? Slot : 'strong';
|
|
16
16
|
|
|
17
|
-
return <Component ref={
|
|
17
|
+
return <Component ref={forwardedRef} {...props} />;
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
Strong.displayName = 'Strong';
|
package/src/react/switch.tsx
CHANGED
|
@@ -11,14 +11,14 @@ 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>(({ className, ...props },
|
|
14
|
+
const Switch = React.forwardRef<SwitchElement, SwitchProps>(({ className, ...props }, forwardedRef) => (
|
|
15
15
|
<SwitchPrimitives.Root
|
|
16
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-
|
|
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-default disabled:opacity-50',
|
|
18
18
|
className,
|
|
19
19
|
)}
|
|
20
20
|
{...props}
|
|
21
|
-
ref={
|
|
21
|
+
ref={forwardedRef}
|
|
22
22
|
>
|
|
23
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
24
|
</SwitchPrimitives.Root>
|
package/src/react/table.tsx
CHANGED
|
@@ -8,9 +8,9 @@ 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>(({ className, ...props },
|
|
11
|
+
const Table = React.forwardRef<TableElement, TableProps>(({ className, ...props }, forwardedRef) => (
|
|
12
12
|
<div className="relative w-full overflow-auto">
|
|
13
|
-
<table ref={
|
|
13
|
+
<table ref={forwardedRef} className={cn('w-full caption-bottom text-sm', className)} {...props} />
|
|
14
14
|
</div>
|
|
15
15
|
));
|
|
16
16
|
|
|
@@ -23,8 +23,8 @@ Table.displayName = 'Table';
|
|
|
23
23
|
type TableHeaderElement = HTMLTableSectionElement;
|
|
24
24
|
type TableHeaderProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
25
25
|
|
|
26
|
-
const TableHeader = React.forwardRef<TableHeaderElement, TableHeaderProps>(({ className, ...props },
|
|
27
|
-
<thead ref={
|
|
26
|
+
const TableHeader = React.forwardRef<TableHeaderElement, TableHeaderProps>(({ className, ...props }, forwardedRef) => (
|
|
27
|
+
<thead ref={forwardedRef} className={cn('[&_tr]:border-b', className)} {...props} />
|
|
28
28
|
));
|
|
29
29
|
|
|
30
30
|
TableHeader.displayName = 'TableHeader';
|
|
@@ -36,8 +36,8 @@ TableHeader.displayName = 'TableHeader';
|
|
|
36
36
|
type TableBodyElement = HTMLTableSectionElement;
|
|
37
37
|
type TableBodyProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
38
38
|
|
|
39
|
-
const TableBody = React.forwardRef<TableBodyElement, TableBodyProps>(({ className, ...props },
|
|
40
|
-
<tbody ref={
|
|
39
|
+
const TableBody = React.forwardRef<TableBodyElement, TableBodyProps>(({ className, ...props }, forwardedRef) => (
|
|
40
|
+
<tbody ref={forwardedRef} className={cn('[&_tr:last-child]:border-0', className)} {...props} />
|
|
41
41
|
));
|
|
42
42
|
|
|
43
43
|
TableBody.displayName = 'TableBody';
|
|
@@ -49,8 +49,12 @@ TableBody.displayName = 'TableBody';
|
|
|
49
49
|
type TableFooterElement = HTMLTableSectionElement;
|
|
50
50
|
type TableFooterProps = React.HTMLAttributes<HTMLTableSectionElement>;
|
|
51
51
|
|
|
52
|
-
const TableFooter = React.forwardRef<TableFooterElement, TableFooterProps>(({ className, ...props },
|
|
53
|
-
<tfoot
|
|
52
|
+
const TableFooter = React.forwardRef<TableFooterElement, TableFooterProps>(({ className, ...props }, forwardedRef) => (
|
|
53
|
+
<tfoot
|
|
54
|
+
ref={forwardedRef}
|
|
55
|
+
className={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
54
58
|
));
|
|
55
59
|
|
|
56
60
|
TableFooter.displayName = 'TableFooter';
|
|
@@ -62,9 +66,9 @@ TableFooter.displayName = 'TableFooter';
|
|
|
62
66
|
type TableRowElement = HTMLTableRowElement;
|
|
63
67
|
type TableRowProps = React.HTMLAttributes<HTMLTableRowElement>;
|
|
64
68
|
|
|
65
|
-
const TableRow = React.forwardRef<TableRowElement, TableRowProps>(({ className, ...props },
|
|
69
|
+
const TableRow = React.forwardRef<TableRowElement, TableRowProps>(({ className, ...props }, forwardedRef) => (
|
|
66
70
|
<tr
|
|
67
|
-
ref={
|
|
71
|
+
ref={forwardedRef}
|
|
68
72
|
className={cn('hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition', className)}
|
|
69
73
|
{...props}
|
|
70
74
|
/>
|
|
@@ -79,9 +83,9 @@ TableRow.displayName = 'TableRow';
|
|
|
79
83
|
type TableHeadElement = HTMLTableCellElement;
|
|
80
84
|
type TableHeadProps = React.ThHTMLAttributes<HTMLTableCellElement>;
|
|
81
85
|
|
|
82
|
-
const TableHead = React.forwardRef<TableHeadElement, TableHeadProps>(({ className, ...props },
|
|
86
|
+
const TableHead = React.forwardRef<TableHeadElement, TableHeadProps>(({ className, ...props }, forwardedRef) => (
|
|
83
87
|
<th
|
|
84
|
-
ref={
|
|
88
|
+
ref={forwardedRef}
|
|
85
89
|
className={cn(
|
|
86
90
|
'text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0',
|
|
87
91
|
className,
|
|
@@ -99,8 +103,8 @@ TableHead.displayName = 'TableHead';
|
|
|
99
103
|
type TableCellElement = HTMLTableCellElement;
|
|
100
104
|
type TableCellProps = React.TdHTMLAttributes<HTMLTableCellElement>;
|
|
101
105
|
|
|
102
|
-
const TableCell = React.forwardRef<TableCellElement, TableCellProps>(({ className, ...props },
|
|
103
|
-
<td ref={
|
|
106
|
+
const TableCell = React.forwardRef<TableCellElement, TableCellProps>(({ className, ...props }, forwardedRef) => (
|
|
107
|
+
<td ref={forwardedRef} className={cn('p-4 align-middle [&:has([role=checkbox])]:pr-0', className)} {...props} />
|
|
104
108
|
));
|
|
105
109
|
|
|
106
110
|
TableCell.displayName = 'TableCell';
|
|
@@ -112,9 +116,11 @@ TableCell.displayName = 'TableCell';
|
|
|
112
116
|
type TableCaptionElement = HTMLTableCaptionElement;
|
|
113
117
|
type TableCaptionProps = React.HTMLAttributes<HTMLTableCaptionElement>;
|
|
114
118
|
|
|
115
|
-
const TableCaption = React.forwardRef<TableCaptionElement, TableCaptionProps>(
|
|
116
|
-
|
|
117
|
-
)
|
|
119
|
+
const TableCaption = React.forwardRef<TableCaptionElement, TableCaptionProps>(
|
|
120
|
+
({ className, ...props }, forwardedRef) => (
|
|
121
|
+
<caption ref={forwardedRef} className={cn('text-muted-foreground mt-4 text-sm', className)} {...props} />
|
|
122
|
+
),
|
|
123
|
+
);
|
|
118
124
|
|
|
119
125
|
TableCaption.displayName = 'TableCaption';
|
|
120
126
|
|
package/src/react/tabs.tsx
CHANGED
|
@@ -18,9 +18,9 @@ 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>(({ className, ...props },
|
|
21
|
+
const TabsList = React.forwardRef<TabsListElement, TabsListProps>(({ className, ...props }, forwardedRef) => (
|
|
22
22
|
<TabsPrimitive.List
|
|
23
|
-
ref={
|
|
23
|
+
ref={forwardedRef}
|
|
24
24
|
className={cn(
|
|
25
25
|
'bg-muted text-muted-foreground inline-flex h-10 items-center justify-center gap-1 rounded-md p-1',
|
|
26
26
|
className,
|
|
@@ -38,9 +38,9 @@ TabsList.displayName = TabsPrimitive.List.displayName;
|
|
|
38
38
|
type TabsTriggerElement = React.ElementRef<typeof TabsPrimitive.Trigger>;
|
|
39
39
|
type TabsTriggerProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>;
|
|
40
40
|
|
|
41
|
-
const TabsTrigger = React.forwardRef<TabsTriggerElement, TabsTriggerProps>(({ className, ...props },
|
|
41
|
+
const TabsTrigger = React.forwardRef<TabsTriggerElement, TabsTriggerProps>(({ className, ...props }, forwardedRef) => (
|
|
42
42
|
<TabsPrimitive.Trigger
|
|
43
|
-
ref={
|
|
43
|
+
ref={forwardedRef}
|
|
44
44
|
className={cn(
|
|
45
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
46
|
className,
|
|
@@ -58,9 +58,9 @@ TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
|
58
58
|
type TabsContentElement = React.ElementRef<typeof TabsPrimitive.Content>;
|
|
59
59
|
type TabsContentProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>;
|
|
60
60
|
|
|
61
|
-
const TabsContent = React.forwardRef<TabsContentElement, TabsContentProps>(({ className, ...props },
|
|
61
|
+
const TabsContent = React.forwardRef<TabsContentElement, TabsContentProps>(({ className, ...props }, forwardedRef) => (
|
|
62
62
|
<TabsPrimitive.Content
|
|
63
|
-
ref={
|
|
63
|
+
ref={forwardedRef}
|
|
64
64
|
className={cn(
|
|
65
65
|
'mt-2 rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2',
|
|
66
66
|
className,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Input, type InputProps, InputSlot, type InputSlotProps } from './input';
|
|
5
|
+
|
|
6
|
+
/* -----------------------------------------------------------------------------
|
|
7
|
+
* Component: TextInput
|
|
8
|
+
* -------------------------------------------------------------------------- */
|
|
9
|
+
|
|
10
|
+
type TextInputElement = HTMLInputElement;
|
|
11
|
+
interface TextInputProps extends InputProps, Omit<InputSlotProps, 'prefix'> {}
|
|
12
|
+
|
|
13
|
+
const TextInput = React.forwardRef<TextInputElement, TextInputProps>(
|
|
14
|
+
({ className, loading, loaderPosition, prefix, suffix, inputSize, ...props }, ref) => {
|
|
15
|
+
return (
|
|
16
|
+
<Input
|
|
17
|
+
className={className}
|
|
18
|
+
inputSize={inputSize}
|
|
19
|
+
loaderPosition={loaderPosition}
|
|
20
|
+
loading={loading}
|
|
21
|
+
prefix={prefix}
|
|
22
|
+
suffix={suffix}
|
|
23
|
+
>
|
|
24
|
+
<InputSlot ref={ref} {...props} />
|
|
25
|
+
</Input>
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
TextInput.displayName = 'TextInput';
|
|
31
|
+
|
|
32
|
+
/* -----------------------------------------------------------------------------
|
|
33
|
+
* Exports
|
|
34
|
+
* -------------------------------------------------------------------------- */
|
|
35
|
+
|
|
36
|
+
export { TextInput, type TextInputProps };
|
package/src/react/text.tsx
CHANGED
|
@@ -19,10 +19,10 @@ type TextProps = (TextParagraphProps | TextSpanProps) & {
|
|
|
19
19
|
asChild?: boolean;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const Text = React.forwardRef<TextElement, TextProps>(({ as: Tag = 'p', asChild, ...props },
|
|
22
|
+
const Text = React.forwardRef<TextElement, TextProps>(({ as: Tag = 'p', asChild, ...props }, forwardedRef) => {
|
|
23
23
|
const Component = asChild ? Slot : Tag;
|
|
24
24
|
|
|
25
|
-
return <Component ref={
|
|
25
|
+
return <Component ref={forwardedRef} {...props} />;
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
Text.displayName = 'Text';
|