@codefast/ui 0.0.65 → 0.0.67
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-QEWITXOV.cjs → chunk-4MTN7WZ2.cjs} +1 -1
- 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-RSNKUKY7.js → chunk-HDHZESSG.js} +1 -1
- 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.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.map +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.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.map +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 +76 -102
- package/dist/chunk-2OBTJ7SD.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-DH3YP4ZC.cjs +0 -2
- package/dist/chunk-DH3YP4ZC.cjs.map +0 -1
- package/dist/chunk-DTSAQICV.js +0 -2
- package/dist/chunk-DTSAQICV.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-NH6X3FON.js +0 -2
- package/dist/chunk-NH6X3FON.js.map +0 -1
- package/dist/chunk-P563ILDJ.cjs +0 -2
- package/dist/chunk-P563ILDJ.cjs.map +0 -1
- package/dist/chunk-QEWITXOV.cjs.map +0 -1
- package/dist/chunk-RSNKUKY7.js.map +0 -1
- package/dist/chunk-VVA2EE5V.js +0 -2
- package/dist/chunk-VVA2EE5V.js.map +0 -1
- package/dist/chunk-VZ6P3BCB.cjs +0 -2
- package/dist/chunk-VZ6P3BCB.cjs.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/dist/hooks/use-media-query.cjs +0 -2
- package/dist/hooks/use-media-query.cjs.map +0 -1
- package/dist/hooks/use-media-query.d.cts +0 -3
- package/dist/hooks/use-media-query.d.ts +0 -3
- package/dist/hooks/use-media-query.js +0 -2
- package/dist/hooks/use-media-query.js.map +0 -1
- package/dist/hooks/use-mutation-observer.cjs +0 -2
- package/dist/hooks/use-mutation-observer.cjs.map +0 -1
- package/dist/hooks/use-mutation-observer.d.cts +0 -5
- package/dist/hooks/use-mutation-observer.d.ts +0 -5
- package/dist/hooks/use-mutation-observer.js +0 -2
- package/dist/hooks/use-mutation-observer.js.map +0 -1
- package/dist/lib/colors.cjs +0 -2
- package/dist/lib/colors.cjs.map +0 -1
- package/dist/lib/colors.d.cts +0 -1759
- package/dist/lib/colors.d.ts +0 -1759
- package/dist/lib/colors.js +0 -2
- package/dist/lib/colors.js.map +0 -1
- package/dist/plugin/animate.plugin.cjs +0 -2
- package/dist/plugin/animate.plugin.cjs.map +0 -1
- package/dist/plugin/animate.plugin.js +0 -2
- package/dist/plugin/animate.plugin.js.map +0 -1
- package/dist/plugin/base.plugin.cjs +0 -2
- package/dist/plugin/base.plugin.cjs.map +0 -1
- package/dist/plugin/base.plugin.js +0 -2
- package/dist/plugin/base.plugin.js.map +0 -1
- package/dist/plugin/perspective.plugin.cjs +0 -2
- package/dist/plugin/perspective.plugin.cjs.map +0 -1
- package/dist/plugin/perspective.plugin.js +0 -2
- package/dist/plugin/perspective.plugin.js.map +0 -1
- package/dist/tailwind.config.cjs +0 -2
- package/dist/tailwind.config.cjs.map +0 -1
- package/dist/tailwind.config.js +0 -2
- package/dist/tailwind.config.js.map +0 -1
- package/plugin/animate.plugin.ts +0 -319
- package/plugin/base.plugin.ts +0 -21
- package/plugin/perspective.plugin.ts +0 -11
- package/src/hooks/use-media-query.ts +0 -22
- package/src/hooks/use-mutation-observer.ts +0 -26
- package/src/lib/colors.ts +0 -1757
- package/src/lib/utils.ts +0 -6
- package/src/react/accordion.tsx +0 -86
- package/src/react/alert-dialog.tsx +0 -177
- package/src/react/alert.tsx +0 -71
- package/src/react/aspect-ratio.tsx +0 -17
- package/src/react/avatar.tsx +0 -58
- package/src/react/badge.tsx +0 -39
- package/src/react/blockquote.tsx +0 -26
- package/src/react/box.tsx +0 -34
- package/src/react/breadcrumb.tsx +0 -148
- package/src/react/button.tsx +0 -95
- package/src/react/calendar.tsx +0 -79
- package/src/react/card.tsx +0 -103
- package/src/react/carousel.tsx +0 -299
- package/src/react/checkbox-cards.tsx +0 -59
- package/src/react/checkbox-group.primitive.tsx +0 -200
- package/src/react/checkbox-group.tsx +0 -53
- package/src/react/checkbox.tsx +0 -36
- package/src/react/code.tsx +0 -26
- package/src/react/collapsible.tsx +0 -54
- package/src/react/command.tsx +0 -199
- package/src/react/container.tsx +0 -27
- package/src/react/context-menu.tsx +0 -302
- package/src/react/data-table.tsx +0 -249
- package/src/react/dialog.tsx +0 -156
- package/src/react/drawer.tsx +0 -132
- package/src/react/dropdown-menu.tsx +0 -286
- package/src/react/em.tsx +0 -26
- package/src/react/form.tsx +0 -218
- package/src/react/heading.tsx +0 -27
- package/src/react/hover-card.tsx +0 -73
- package/src/react/input-otp.tsx +0 -114
- package/src/react/input.tsx +0 -42
- package/src/react/kbd.tsx +0 -36
- package/src/react/label.tsx +0 -31
- package/src/react/menubar.tsx +0 -316
- package/src/react/navigation-menu.tsx +0 -192
- package/src/react/pagination.tsx +0 -150
- package/src/react/popover.tsx +0 -82
- package/src/react/pre.tsx +0 -26
- package/src/react/progress.tsx +0 -35
- package/src/react/quote.tsx +0 -26
- package/src/react/radio-cards.tsx +0 -46
- package/src/react/radio-group.tsx +0 -48
- package/src/react/radio.tsx +0 -38
- package/src/react/resizable.tsx +0 -62
- package/src/react/scroll-area.tsx +0 -106
- package/src/react/section.tsx +0 -26
- package/src/react/select.tsx +0 -217
- package/src/react/separator.tsx +0 -32
- package/src/react/sheet.tsx +0 -170
- package/src/react/skeleton.tsx +0 -18
- package/src/react/slider.tsx +0 -41
- package/src/react/sonner.tsx +0 -40
- package/src/react/spinner.tsx +0 -68
- package/src/react/strong.tsx +0 -26
- package/src/react/switch.tsx +0 -33
- package/src/react/table.tsx +0 -142
- package/src/react/tabs.tsx +0 -87
- package/src/react/text.tsx +0 -34
- package/src/react/textarea.tsx +0 -30
- package/src/react/toggle-group.tsx +0 -81
- package/src/react/toggle.tsx +0 -49
- package/src/react/tooltip.tsx +0 -81
- package/src/styles/styles.css +0 -3
- package/tailwind.config.ts +0 -126
package/src/react/button.tsx
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Fragment } from 'react';
|
|
3
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
-
import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
|
|
5
|
-
import { tv, type VariantProps } from 'tailwind-variants';
|
|
6
|
-
import { Spinner } from './spinner';
|
|
7
|
-
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Variant: Button
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
|
|
12
|
-
const buttonVariants = tv({
|
|
13
|
-
base: 'inline-flex select-none items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
14
|
-
variants: {
|
|
15
|
-
variant: {
|
|
16
|
-
default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow',
|
|
17
|
-
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',
|
|
18
|
-
ghost: 'text-foreground hover:bg-accent hover:text-accent-foreground',
|
|
19
|
-
link: 'text-primary underline-offset-4 hover:underline',
|
|
20
|
-
outline:
|
|
21
|
-
'border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground border shadow-sm',
|
|
22
|
-
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',
|
|
23
|
-
},
|
|
24
|
-
size: {
|
|
25
|
-
default: 'h-10 gap-2 px-4',
|
|
26
|
-
xs: 'h-8 gap-1 px-2',
|
|
27
|
-
sm: 'h-9 gap-2 px-3',
|
|
28
|
-
lg: 'h-11 gap-2 px-8',
|
|
29
|
-
icon: 'size-10',
|
|
30
|
-
'icon-xs': 'size-8',
|
|
31
|
-
'icon-sm': 'size-9',
|
|
32
|
-
'icon-lg': 'size-11',
|
|
33
|
-
},
|
|
34
|
-
loading: {
|
|
35
|
-
true: 'relative',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
defaultVariants: {
|
|
39
|
-
size: 'default',
|
|
40
|
-
variant: 'default',
|
|
41
|
-
loading: false,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
type ButtonVariantsProps = VariantProps<typeof buttonVariants>;
|
|
46
|
-
|
|
47
|
-
/* -----------------------------------------------------------------------------
|
|
48
|
-
* Component: Button
|
|
49
|
-
* -------------------------------------------------------------------------- */
|
|
50
|
-
|
|
51
|
-
type ButtonElement = HTMLButtonElement;
|
|
52
|
-
|
|
53
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ButtonVariantsProps {
|
|
54
|
-
asChild?: boolean;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const Button = React.forwardRef<ButtonElement, ButtonProps>(
|
|
58
|
-
({ children, className, variant, size, loading = false, asChild = false, ...props }, ref) => {
|
|
59
|
-
const Component = asChild ? Slot : 'button';
|
|
60
|
-
const ComponentLoading = asChild ? 'span' : Fragment;
|
|
61
|
-
const disabled = loading || props.disabled;
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<Component
|
|
65
|
-
ref={ref}
|
|
66
|
-
className={buttonVariants({ variant, size, loading, className })}
|
|
67
|
-
type={asChild ? undefined : 'button'}
|
|
68
|
-
{...props}
|
|
69
|
-
disabled={disabled}
|
|
70
|
-
>
|
|
71
|
-
{loading ? (
|
|
72
|
-
<ComponentLoading>
|
|
73
|
-
<span aria-hidden className="invisible contents">
|
|
74
|
-
{children}
|
|
75
|
-
</span>
|
|
76
|
-
<VisuallyHidden>{children}</VisuallyHidden>
|
|
77
|
-
<span className="absolute inset-0 flex items-center justify-center">
|
|
78
|
-
<Spinner />
|
|
79
|
-
</span>
|
|
80
|
-
</ComponentLoading>
|
|
81
|
-
) : (
|
|
82
|
-
children
|
|
83
|
-
)}
|
|
84
|
-
</Component>
|
|
85
|
-
);
|
|
86
|
-
},
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
Button.displayName = 'Button';
|
|
90
|
-
|
|
91
|
-
/* -----------------------------------------------------------------------------
|
|
92
|
-
* Exports
|
|
93
|
-
* -------------------------------------------------------------------------- */
|
|
94
|
-
|
|
95
|
-
export { Button, buttonVariants, type ButtonProps, type ButtonVariantsProps };
|
package/src/react/calendar.tsx
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { DayPicker, type DateRange, type DayPickerProps, type StyledComponent } from 'react-day-picker';
|
|
5
|
-
import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';
|
|
6
|
-
import { cn } from '../lib/utils';
|
|
7
|
-
import { buttonVariants } from './button';
|
|
8
|
-
|
|
9
|
-
/* -----------------------------------------------------------------------------
|
|
10
|
-
* Component: Calendar
|
|
11
|
-
* -------------------------------------------------------------------------- */
|
|
12
|
-
|
|
13
|
-
function ChevronLeft({ children: _, ...props }: StyledComponent): React.JSX.Element {
|
|
14
|
-
return <ChevronLeftIcon className="size-4" {...props} />;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function ChevronRight({ children: _, ...props }: StyledComponent): React.JSX.Element {
|
|
18
|
-
return <ChevronRightIcon className="size-4" {...props} />;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
type CalendarProps = DayPickerProps;
|
|
22
|
-
|
|
23
|
-
function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps): React.JSX.Element {
|
|
24
|
-
return (
|
|
25
|
-
<DayPicker
|
|
26
|
-
className={cn('p-3', className)}
|
|
27
|
-
classNames={{
|
|
28
|
-
months: 'flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0',
|
|
29
|
-
month: 'space-y-4',
|
|
30
|
-
caption: 'flex justify-center pt-1 relative items-center',
|
|
31
|
-
caption_label: 'text-sm font-medium',
|
|
32
|
-
nav: 'space-x-1 flex items-center',
|
|
33
|
-
nav_button: buttonVariants({
|
|
34
|
-
variant: 'outline',
|
|
35
|
-
className: 'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',
|
|
36
|
-
}),
|
|
37
|
-
nav_button_previous: 'absolute left-1',
|
|
38
|
-
nav_button_next: 'absolute right-1',
|
|
39
|
-
table: 'w-full border-collapse space-y-1',
|
|
40
|
-
head_row: 'flex',
|
|
41
|
-
head_cell: 'text-muted-foreground rounded-md w-8 font-normal text-xs',
|
|
42
|
-
row: 'flex w-full mt-2',
|
|
43
|
-
cell: cn(
|
|
44
|
-
'relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md',
|
|
45
|
-
props.mode === 'range'
|
|
46
|
-
? '[&:has(>.day-range-start)]:rounded-l-md [&:has(>.day-range-end)]:rounded-r-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md'
|
|
47
|
-
: '[&:has([aria-selected])]:rounded-md',
|
|
48
|
-
),
|
|
49
|
-
day: buttonVariants({
|
|
50
|
-
variant: 'ghost',
|
|
51
|
-
className: 'size-9 p-0 font-normal aria-selected:opacity-100',
|
|
52
|
-
}),
|
|
53
|
-
day_range_start: 'day-range-start',
|
|
54
|
-
day_range_end: 'day-range-end',
|
|
55
|
-
day_selected:
|
|
56
|
-
'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',
|
|
57
|
-
day_today: 'bg-accent text-accent-foreground',
|
|
58
|
-
day_outside:
|
|
59
|
-
'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',
|
|
60
|
-
day_disabled: 'text-muted-foreground opacity-50',
|
|
61
|
-
day_range_middle: 'aria-selected:bg-accent aria-selected:text-accent-foreground',
|
|
62
|
-
day_hidden: 'invisible',
|
|
63
|
-
...classNames,
|
|
64
|
-
}}
|
|
65
|
-
components={{
|
|
66
|
-
IconLeft: ChevronLeft,
|
|
67
|
-
IconRight: ChevronRight,
|
|
68
|
-
}}
|
|
69
|
-
showOutsideDays={showOutsideDays}
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/* -----------------------------------------------------------------------------
|
|
76
|
-
* Exports
|
|
77
|
-
* -------------------------------------------------------------------------- */
|
|
78
|
-
|
|
79
|
-
export { Calendar, type CalendarProps, type DateRange };
|
package/src/react/card.tsx
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cn } from '../lib/utils';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Card
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type CardElement = HTMLDivElement;
|
|
9
|
-
type CardProps = React.HTMLAttributes<HTMLDivElement>;
|
|
10
|
-
|
|
11
|
-
const Card = React.forwardRef<CardElement, CardProps>(({ className, ...props }, ref) => (
|
|
12
|
-
<div ref={ref} className={cn('bg-card text-card-foreground rounded-lg border shadow-sm', className)} {...props} />
|
|
13
|
-
));
|
|
14
|
-
|
|
15
|
-
Card.displayName = 'Card';
|
|
16
|
-
|
|
17
|
-
/* -----------------------------------------------------------------------------
|
|
18
|
-
* Component: CardHeader
|
|
19
|
-
* -------------------------------------------------------------------------- */
|
|
20
|
-
|
|
21
|
-
type CardHeaderElement = HTMLDivElement;
|
|
22
|
-
type CardHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
23
|
-
|
|
24
|
-
const CardHeader = React.forwardRef<CardHeaderElement, CardHeaderProps>(({ className, ...props }, ref) => (
|
|
25
|
-
<div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
|
|
26
|
-
));
|
|
27
|
-
|
|
28
|
-
CardHeader.displayName = 'CardHeader';
|
|
29
|
-
|
|
30
|
-
/* -----------------------------------------------------------------------------
|
|
31
|
-
* Component: CardTitle
|
|
32
|
-
* -------------------------------------------------------------------------- */
|
|
33
|
-
|
|
34
|
-
type CardTitleElement = HTMLParagraphElement;
|
|
35
|
-
type CardTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
36
|
-
|
|
37
|
-
const CardTitle = React.forwardRef<CardTitleElement, CardTitleProps>(({ children, className, ...props }, ref) => (
|
|
38
|
-
<h3 ref={ref} className={cn('font-semibold leading-none tracking-tight', className)} {...props}>
|
|
39
|
-
{children}
|
|
40
|
-
</h3>
|
|
41
|
-
));
|
|
42
|
-
|
|
43
|
-
CardTitle.displayName = 'CardTitle';
|
|
44
|
-
|
|
45
|
-
/* -----------------------------------------------------------------------------
|
|
46
|
-
* Component: CardDescription
|
|
47
|
-
* -------------------------------------------------------------------------- */
|
|
48
|
-
|
|
49
|
-
type CardDescriptionElement = HTMLParagraphElement;
|
|
50
|
-
type CardDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
51
|
-
|
|
52
|
-
const CardDescription = React.forwardRef<CardDescriptionElement, CardDescriptionProps>(
|
|
53
|
-
({ className, ...props }, ref) => (
|
|
54
|
-
<p ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
|
|
55
|
-
),
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
CardDescription.displayName = 'CardDescription';
|
|
59
|
-
|
|
60
|
-
/* -----------------------------------------------------------------------------
|
|
61
|
-
* Component: CardContent
|
|
62
|
-
* -------------------------------------------------------------------------- */
|
|
63
|
-
|
|
64
|
-
type CardContentElement = HTMLDivElement;
|
|
65
|
-
type CardContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
66
|
-
|
|
67
|
-
const CardContent = React.forwardRef<CardContentElement, CardContentProps>(({ className, ...props }, ref) => (
|
|
68
|
-
<div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
|
|
69
|
-
));
|
|
70
|
-
|
|
71
|
-
CardContent.displayName = 'CardContent';
|
|
72
|
-
|
|
73
|
-
/* -----------------------------------------------------------------------------
|
|
74
|
-
* Component: CardFooter
|
|
75
|
-
* -------------------------------------------------------------------------- */
|
|
76
|
-
|
|
77
|
-
type CardFooterElement = HTMLDivElement;
|
|
78
|
-
type CardFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
79
|
-
|
|
80
|
-
const CardFooter = React.forwardRef<CardFooterElement, CardFooterProps>(({ className, ...props }, ref) => (
|
|
81
|
-
<div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
|
|
82
|
-
));
|
|
83
|
-
|
|
84
|
-
CardFooter.displayName = 'CardFooter';
|
|
85
|
-
|
|
86
|
-
/* -----------------------------------------------------------------------------
|
|
87
|
-
* Exports
|
|
88
|
-
* -------------------------------------------------------------------------- */
|
|
89
|
-
|
|
90
|
-
export {
|
|
91
|
-
Card,
|
|
92
|
-
CardHeader,
|
|
93
|
-
CardFooter,
|
|
94
|
-
CardTitle,
|
|
95
|
-
CardDescription,
|
|
96
|
-
CardContent,
|
|
97
|
-
type CardProps,
|
|
98
|
-
type CardHeaderProps,
|
|
99
|
-
type CardFooterProps,
|
|
100
|
-
type CardTitleProps,
|
|
101
|
-
type CardDescriptionProps,
|
|
102
|
-
type CardContentProps,
|
|
103
|
-
};
|
package/src/react/carousel.tsx
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';
|
|
5
|
-
import { ArrowLeftIcon, ArrowRightIcon } from '@radix-ui/react-icons';
|
|
6
|
-
import { createContextScope, type Scope } from '@radix-ui/react-context';
|
|
7
|
-
import { cn } from '../lib/utils';
|
|
8
|
-
import { Button, type ButtonProps } from './button';
|
|
9
|
-
|
|
10
|
-
/* -----------------------------------------------------------------------------
|
|
11
|
-
* Context: Carousel
|
|
12
|
-
* -------------------------------------------------------------------------- */
|
|
13
|
-
|
|
14
|
-
const CAROUSEL_NAME = 'Carousel';
|
|
15
|
-
|
|
16
|
-
type ScopedProps<P> = P & { __scopeCarousel?: Scope };
|
|
17
|
-
|
|
18
|
-
const [createCarouselContext] = createContextScope(CAROUSEL_NAME);
|
|
19
|
-
|
|
20
|
-
type CarouselApi = UseEmblaCarouselType[1];
|
|
21
|
-
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
22
|
-
type CarouselOptions = UseCarouselParameters[0];
|
|
23
|
-
type CarouselPlugin = UseCarouselParameters[1];
|
|
24
|
-
|
|
25
|
-
interface BaseCarouselProps {
|
|
26
|
-
opts?: CarouselOptions;
|
|
27
|
-
orientation?: 'horizontal' | 'vertical';
|
|
28
|
-
plugins?: CarouselPlugin;
|
|
29
|
-
setApi?: (api: CarouselApi) => void;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
type CarouselContextValue = {
|
|
33
|
-
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
34
|
-
canScrollNext: boolean;
|
|
35
|
-
canScrollPrev: boolean;
|
|
36
|
-
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
37
|
-
scrollNext: () => void;
|
|
38
|
-
scrollPrev: () => void;
|
|
39
|
-
} & BaseCarouselProps;
|
|
40
|
-
|
|
41
|
-
const [CarouselProvider, useCarouselContext] = createCarouselContext<CarouselContextValue>(CAROUSEL_NAME);
|
|
42
|
-
|
|
43
|
-
/* -----------------------------------------------------------------------------
|
|
44
|
-
* Component: Carousel
|
|
45
|
-
* -------------------------------------------------------------------------- */
|
|
46
|
-
|
|
47
|
-
type CarouselElement = HTMLDivElement;
|
|
48
|
-
type CarouselProps = React.HTMLAttributes<HTMLDivElement> & BaseCarouselProps;
|
|
49
|
-
|
|
50
|
-
const Carousel = React.forwardRef<CarouselElement, CarouselProps>(
|
|
51
|
-
(
|
|
52
|
-
{ __scopeCarousel, children, orientation, opts, setApi, plugins, className, ...props }: ScopedProps<CarouselProps>,
|
|
53
|
-
ref,
|
|
54
|
-
) => {
|
|
55
|
-
const [carouselRef, api] = useEmblaCarousel(
|
|
56
|
-
{
|
|
57
|
-
...opts,
|
|
58
|
-
axis: orientation === 'vertical' ? 'y' : 'x',
|
|
59
|
-
},
|
|
60
|
-
plugins,
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
64
|
-
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
65
|
-
|
|
66
|
-
const onSelect = React.useCallback((carouselApi: CarouselApi) => {
|
|
67
|
-
if (!carouselApi) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
setCanScrollPrev(carouselApi.canScrollPrev());
|
|
72
|
-
setCanScrollNext(carouselApi.canScrollNext());
|
|
73
|
-
}, []);
|
|
74
|
-
|
|
75
|
-
const scrollPrev = React.useCallback(() => {
|
|
76
|
-
api?.scrollPrev();
|
|
77
|
-
}, [api]);
|
|
78
|
-
|
|
79
|
-
const scrollNext = React.useCallback(() => {
|
|
80
|
-
api?.scrollNext();
|
|
81
|
-
}, [api]);
|
|
82
|
-
|
|
83
|
-
const handleKeyDown = React.useCallback(
|
|
84
|
-
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
85
|
-
if (event.key === 'ArrowLeft') {
|
|
86
|
-
event.preventDefault();
|
|
87
|
-
scrollPrev();
|
|
88
|
-
} else if (event.key === 'ArrowRight') {
|
|
89
|
-
event.preventDefault();
|
|
90
|
-
scrollNext();
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
[scrollPrev, scrollNext],
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
React.useEffect(() => {
|
|
97
|
-
if (!api || !setApi) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
setApi(api);
|
|
102
|
-
}, [api, setApi]);
|
|
103
|
-
|
|
104
|
-
React.useEffect(() => {
|
|
105
|
-
if (!api) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
onSelect(api);
|
|
110
|
-
api.on('reInit', onSelect);
|
|
111
|
-
api.on('select', onSelect);
|
|
112
|
-
|
|
113
|
-
return () => {
|
|
114
|
-
api.off('select', onSelect);
|
|
115
|
-
};
|
|
116
|
-
}, [api, onSelect]);
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<CarouselProvider
|
|
120
|
-
api={api}
|
|
121
|
-
canScrollNext={canScrollNext}
|
|
122
|
-
canScrollPrev={canScrollPrev}
|
|
123
|
-
carouselRef={carouselRef}
|
|
124
|
-
opts={opts}
|
|
125
|
-
orientation={orientation ?? (opts?.axis === 'y' ? 'vertical' : 'horizontal')}
|
|
126
|
-
scope={__scopeCarousel}
|
|
127
|
-
scrollNext={scrollNext}
|
|
128
|
-
scrollPrev={scrollPrev}
|
|
129
|
-
>
|
|
130
|
-
<div
|
|
131
|
-
ref={ref}
|
|
132
|
-
aria-roledescription="carousel"
|
|
133
|
-
className={cn('relative', className)}
|
|
134
|
-
role="region"
|
|
135
|
-
onKeyDownCapture={handleKeyDown}
|
|
136
|
-
{...props}
|
|
137
|
-
>
|
|
138
|
-
{children}
|
|
139
|
-
</div>
|
|
140
|
-
</CarouselProvider>
|
|
141
|
-
);
|
|
142
|
-
},
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
Carousel.displayName = CAROUSEL_NAME;
|
|
146
|
-
|
|
147
|
-
/* -----------------------------------------------------------------------------
|
|
148
|
-
* Component: CarouselContent
|
|
149
|
-
* -------------------------------------------------------------------------- */
|
|
150
|
-
|
|
151
|
-
const CAROUSEL_CONTENT_NAME = 'CarouselContent';
|
|
152
|
-
|
|
153
|
-
type CarouselContentElement = HTMLDivElement;
|
|
154
|
-
type CarouselContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
155
|
-
|
|
156
|
-
const CarouselContent = React.forwardRef<CarouselContentElement, CarouselContentProps>(
|
|
157
|
-
({ __scopeCarousel, className, ...props }: ScopedProps<CarouselContentProps>, ref) => {
|
|
158
|
-
const { carouselRef, orientation } = useCarouselContext(CAROUSEL_CONTENT_NAME, __scopeCarousel);
|
|
159
|
-
|
|
160
|
-
return (
|
|
161
|
-
<div ref={carouselRef} className="overflow-hidden">
|
|
162
|
-
<div
|
|
163
|
-
ref={ref}
|
|
164
|
-
className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)}
|
|
165
|
-
{...props}
|
|
166
|
-
/>
|
|
167
|
-
</div>
|
|
168
|
-
);
|
|
169
|
-
},
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
CarouselContent.displayName = CAROUSEL_CONTENT_NAME;
|
|
173
|
-
|
|
174
|
-
/* -----------------------------------------------------------------------------
|
|
175
|
-
* Component: CarouselItem
|
|
176
|
-
* -------------------------------------------------------------------------- */
|
|
177
|
-
|
|
178
|
-
const CAROUSEL_ITEM_NAME = 'CarouselItem';
|
|
179
|
-
|
|
180
|
-
type CarouselItemElement = HTMLDivElement;
|
|
181
|
-
type CarouselItemProps = React.HTMLAttributes<HTMLDivElement>;
|
|
182
|
-
|
|
183
|
-
const CarouselItem = React.forwardRef<CarouselItemElement, CarouselItemProps>(
|
|
184
|
-
({ __scopeCarousel, className, ...props }: ScopedProps<CarouselItemProps>, ref) => {
|
|
185
|
-
const { orientation } = useCarouselContext(CAROUSEL_ITEM_NAME, __scopeCarousel);
|
|
186
|
-
|
|
187
|
-
return (
|
|
188
|
-
<div
|
|
189
|
-
ref={ref}
|
|
190
|
-
aria-roledescription="slide"
|
|
191
|
-
className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}
|
|
192
|
-
role="group"
|
|
193
|
-
{...props}
|
|
194
|
-
/>
|
|
195
|
-
);
|
|
196
|
-
},
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
CarouselItem.displayName = CAROUSEL_ITEM_NAME;
|
|
200
|
-
|
|
201
|
-
/* -----------------------------------------------------------------------------
|
|
202
|
-
* Component: CarouselPrevious
|
|
203
|
-
* -------------------------------------------------------------------------- */
|
|
204
|
-
|
|
205
|
-
const CAROUSEL_PREVIOUS_NAME = 'CarouselPrevious';
|
|
206
|
-
|
|
207
|
-
type CarouselPreviousElement = HTMLButtonElement;
|
|
208
|
-
type CarouselPreviousProps = ButtonProps;
|
|
209
|
-
|
|
210
|
-
const CarouselPrevious = React.forwardRef<CarouselPreviousElement, CarouselPreviousProps>(
|
|
211
|
-
(
|
|
212
|
-
{ __scopeCarousel, className, variant = 'outline', size = 'icon', ...props }: ScopedProps<CarouselPreviousProps>,
|
|
213
|
-
ref,
|
|
214
|
-
) => {
|
|
215
|
-
const { orientation, scrollPrev, canScrollPrev } = useCarouselContext(CAROUSEL_PREVIOUS_NAME, __scopeCarousel);
|
|
216
|
-
|
|
217
|
-
return (
|
|
218
|
-
<Button
|
|
219
|
-
ref={ref}
|
|
220
|
-
className={cn(
|
|
221
|
-
'absolute size-8 rounded-full',
|
|
222
|
-
orientation === 'horizontal'
|
|
223
|
-
? '-left-12 top-1/2 -translate-y-1/2'
|
|
224
|
-
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
225
|
-
className,
|
|
226
|
-
)}
|
|
227
|
-
disabled={!canScrollPrev}
|
|
228
|
-
size={size}
|
|
229
|
-
variant={variant}
|
|
230
|
-
onClick={scrollPrev}
|
|
231
|
-
{...props}
|
|
232
|
-
>
|
|
233
|
-
<ArrowLeftIcon className="size-4" />
|
|
234
|
-
<span className="sr-only">Previous slide</span>
|
|
235
|
-
</Button>
|
|
236
|
-
);
|
|
237
|
-
},
|
|
238
|
-
);
|
|
239
|
-
|
|
240
|
-
CarouselPrevious.displayName = CAROUSEL_PREVIOUS_NAME;
|
|
241
|
-
|
|
242
|
-
/* -----------------------------------------------------------------------------
|
|
243
|
-
* Component: CarouselNext
|
|
244
|
-
* -------------------------------------------------------------------------- */
|
|
245
|
-
|
|
246
|
-
const CAROUSEL_NEXT_NAME = 'CarouselNext';
|
|
247
|
-
|
|
248
|
-
type CarouselNextElement = HTMLButtonElement;
|
|
249
|
-
type CarouselNextProps = ButtonProps;
|
|
250
|
-
|
|
251
|
-
const CarouselNext = React.forwardRef<CarouselNextElement, CarouselNextProps>(
|
|
252
|
-
(
|
|
253
|
-
{ __scopeCarousel, className, variant = 'outline', size = 'icon', ...props }: ScopedProps<CarouselNextProps>,
|
|
254
|
-
ref,
|
|
255
|
-
) => {
|
|
256
|
-
const { orientation, scrollNext, canScrollNext } = useCarouselContext(CAROUSEL_NEXT_NAME, __scopeCarousel);
|
|
257
|
-
|
|
258
|
-
return (
|
|
259
|
-
<Button
|
|
260
|
-
ref={ref}
|
|
261
|
-
className={cn(
|
|
262
|
-
'absolute size-8 rounded-full',
|
|
263
|
-
orientation === 'horizontal'
|
|
264
|
-
? '-right-12 top-1/2 -translate-y-1/2'
|
|
265
|
-
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
266
|
-
className,
|
|
267
|
-
)}
|
|
268
|
-
disabled={!canScrollNext}
|
|
269
|
-
size={size}
|
|
270
|
-
variant={variant}
|
|
271
|
-
onClick={scrollNext}
|
|
272
|
-
{...props}
|
|
273
|
-
>
|
|
274
|
-
<ArrowRightIcon className="size-4" />
|
|
275
|
-
<span className="sr-only">Next slide</span>
|
|
276
|
-
</Button>
|
|
277
|
-
);
|
|
278
|
-
},
|
|
279
|
-
);
|
|
280
|
-
|
|
281
|
-
CarouselNext.displayName = CAROUSEL_NEXT_NAME;
|
|
282
|
-
|
|
283
|
-
/* -----------------------------------------------------------------------------
|
|
284
|
-
* Exports
|
|
285
|
-
* -------------------------------------------------------------------------- */
|
|
286
|
-
|
|
287
|
-
export {
|
|
288
|
-
type CarouselApi,
|
|
289
|
-
Carousel,
|
|
290
|
-
CarouselContent,
|
|
291
|
-
CarouselItem,
|
|
292
|
-
CarouselPrevious,
|
|
293
|
-
CarouselNext,
|
|
294
|
-
type CarouselProps,
|
|
295
|
-
type CarouselContentProps,
|
|
296
|
-
type CarouselItemProps,
|
|
297
|
-
type CarouselPreviousProps,
|
|
298
|
-
type CarouselNextProps,
|
|
299
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { CheckIcon } from '@radix-ui/react-icons';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
import * as CheckboxGroupPrimitive from './checkbox-group.primitive';
|
|
7
|
-
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Component: CheckboxCards
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
|
|
12
|
-
type CheckboxCardsElement = React.ElementRef<typeof CheckboxGroupPrimitive.Root>;
|
|
13
|
-
type CheckboxCardsProps = React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Root>;
|
|
14
|
-
|
|
15
|
-
const CheckboxCards = React.forwardRef<CheckboxCardsElement, CheckboxCardsProps>(({ className, ...props }, ref) => {
|
|
16
|
-
return <CheckboxGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={ref} />;
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
CheckboxCards.displayName = CheckboxGroupPrimitive.Root.displayName;
|
|
20
|
-
|
|
21
|
-
/* -----------------------------------------------------------------------------
|
|
22
|
-
* Component: CheckboxCardsItem
|
|
23
|
-
* -------------------------------------------------------------------------- */
|
|
24
|
-
|
|
25
|
-
type CheckboxCardsItemElement = React.ElementRef<typeof CheckboxGroupPrimitive.Item>;
|
|
26
|
-
|
|
27
|
-
interface CheckboxCardsItemProps extends React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Item> {
|
|
28
|
-
checkboxClassName?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const CheckboxCardsItem = React.forwardRef<CheckboxCardsItemElement, CheckboxCardsItemProps>(
|
|
32
|
-
({ children, className, checkboxClassName, ...props }, ref) => {
|
|
33
|
-
return (
|
|
34
|
-
<label className={cn('flex items-center justify-center gap-4 rounded-md border p-4', className)}>
|
|
35
|
-
{children}
|
|
36
|
-
<CheckboxGroupPrimitive.Item
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
'border-input aria-checked:border-primary aria-checked:bg-primary aria-checked:text-primary-foreground peer flex size-4 shrink-0 cursor-pointer rounded-sm border shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
40
|
-
checkboxClassName,
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
<CheckboxGroupPrimitive.CheckboxGroupIndicator className="flex size-full items-center justify-center text-current">
|
|
45
|
-
<CheckIcon className="size-3.5" />
|
|
46
|
-
</CheckboxGroupPrimitive.CheckboxGroupIndicator>
|
|
47
|
-
</CheckboxGroupPrimitive.Item>
|
|
48
|
-
</label>
|
|
49
|
-
);
|
|
50
|
-
},
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
CheckboxCardsItem.displayName = CheckboxGroupPrimitive.Item.displayName;
|
|
54
|
-
|
|
55
|
-
/* -----------------------------------------------------------------------------
|
|
56
|
-
* Exports
|
|
57
|
-
* -------------------------------------------------------------------------- */
|
|
58
|
-
|
|
59
|
-
export { CheckboxCards, CheckboxCardsItem, type CheckboxCardsProps, type CheckboxCardsItemProps };
|