@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/select.tsx
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons';
|
|
5
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
6
|
-
import { cn } from '../lib/utils';
|
|
7
|
-
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Component: Select
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
|
|
12
|
-
type SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>;
|
|
13
|
-
const Select = SelectPrimitive.Root;
|
|
14
|
-
|
|
15
|
-
/* -----------------------------------------------------------------------------
|
|
16
|
-
* Component: SelectGroup
|
|
17
|
-
* -------------------------------------------------------------------------- */
|
|
18
|
-
|
|
19
|
-
type SelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;
|
|
20
|
-
const SelectGroup = SelectPrimitive.Group;
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Component: SelectValue
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
type SelectValueProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;
|
|
27
|
-
const SelectValue = SelectPrimitive.Value;
|
|
28
|
-
|
|
29
|
-
/* -----------------------------------------------------------------------------
|
|
30
|
-
* Component: SelectTrigger
|
|
31
|
-
* -------------------------------------------------------------------------- */
|
|
32
|
-
|
|
33
|
-
type SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;
|
|
34
|
-
type SelectTriggerProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>;
|
|
35
|
-
|
|
36
|
-
const SelectTrigger = React.forwardRef<SelectTriggerElement, SelectTriggerProps>(
|
|
37
|
-
({ children, className, ...props }, ref) => (
|
|
38
|
-
<SelectPrimitive.Trigger
|
|
39
|
-
ref={ref}
|
|
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-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate',
|
|
42
|
-
className,
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
<SelectPrimitive.Icon asChild>
|
|
48
|
-
<CaretSortIcon className="size-4 opacity-50" />
|
|
49
|
-
</SelectPrimitive.Icon>
|
|
50
|
-
</SelectPrimitive.Trigger>
|
|
51
|
-
),
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
55
|
-
|
|
56
|
-
/* -----------------------------------------------------------------------------
|
|
57
|
-
* Component: SelectScrollUpButton
|
|
58
|
-
* -------------------------------------------------------------------------- */
|
|
59
|
-
|
|
60
|
-
type SelectScrollUpButtonElement = React.ElementRef<typeof SelectPrimitive.ScrollUpButton>;
|
|
61
|
-
type SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>;
|
|
62
|
-
|
|
63
|
-
const SelectScrollUpButton = React.forwardRef<SelectScrollUpButtonElement, SelectScrollUpButtonProps>(
|
|
64
|
-
({ className, ...props }, ref) => (
|
|
65
|
-
<SelectPrimitive.ScrollUpButton
|
|
66
|
-
ref={ref}
|
|
67
|
-
className={cn('flex cursor-pointer items-center justify-center py-1', className)}
|
|
68
|
-
{...props}
|
|
69
|
-
>
|
|
70
|
-
<ChevronUpIcon />
|
|
71
|
-
</SelectPrimitive.ScrollUpButton>
|
|
72
|
-
),
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
76
|
-
|
|
77
|
-
/* -----------------------------------------------------------------------------
|
|
78
|
-
* Component: SelectScrollDownButton
|
|
79
|
-
* -------------------------------------------------------------------------- */
|
|
80
|
-
|
|
81
|
-
type SelectScrollDownButtonElement = React.ElementRef<typeof SelectPrimitive.ScrollDownButton>;
|
|
82
|
-
type SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>;
|
|
83
|
-
|
|
84
|
-
const SelectScrollDownButton = React.forwardRef<SelectScrollDownButtonElement, SelectScrollDownButtonProps>(
|
|
85
|
-
({ className, ...props }, ref) => (
|
|
86
|
-
<SelectPrimitive.ScrollDownButton
|
|
87
|
-
ref={ref}
|
|
88
|
-
className={cn('flex cursor-pointer items-center justify-center py-1', className)}
|
|
89
|
-
{...props}
|
|
90
|
-
>
|
|
91
|
-
<ChevronDownIcon />
|
|
92
|
-
</SelectPrimitive.ScrollDownButton>
|
|
93
|
-
),
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
97
|
-
|
|
98
|
-
/* -----------------------------------------------------------------------------
|
|
99
|
-
* Component: SelectContent
|
|
100
|
-
* -------------------------------------------------------------------------- */
|
|
101
|
-
|
|
102
|
-
type SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;
|
|
103
|
-
type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;
|
|
104
|
-
|
|
105
|
-
const SelectContent = React.forwardRef<SelectContentElement, SelectContentProps>(
|
|
106
|
-
({ children, className, position = 'popper', ...props }, ref) => (
|
|
107
|
-
<SelectPrimitive.Portal>
|
|
108
|
-
<SelectPrimitive.Content
|
|
109
|
-
ref={ref}
|
|
110
|
-
className={cn(
|
|
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
|
-
position === 'popper' &&
|
|
113
|
-
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
114
|
-
className,
|
|
115
|
-
)}
|
|
116
|
-
position={position}
|
|
117
|
-
{...props}
|
|
118
|
-
>
|
|
119
|
-
<SelectScrollUpButton />
|
|
120
|
-
<SelectPrimitive.Viewport
|
|
121
|
-
className={cn(
|
|
122
|
-
'p-1',
|
|
123
|
-
position === 'popper' &&
|
|
124
|
-
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',
|
|
125
|
-
)}
|
|
126
|
-
>
|
|
127
|
-
{children}
|
|
128
|
-
</SelectPrimitive.Viewport>
|
|
129
|
-
<SelectScrollDownButton />
|
|
130
|
-
</SelectPrimitive.Content>
|
|
131
|
-
</SelectPrimitive.Portal>
|
|
132
|
-
),
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
136
|
-
|
|
137
|
-
/* -----------------------------------------------------------------------------
|
|
138
|
-
* Component: SelectLabel
|
|
139
|
-
* -------------------------------------------------------------------------- */
|
|
140
|
-
|
|
141
|
-
type SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;
|
|
142
|
-
type SelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;
|
|
143
|
-
|
|
144
|
-
const SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(({ className, ...props }, ref) => (
|
|
145
|
-
<SelectPrimitive.Label ref={ref} className={cn('px-2 py-1.5 text-sm font-semibold', className)} {...props} />
|
|
146
|
-
));
|
|
147
|
-
|
|
148
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
149
|
-
|
|
150
|
-
/* -----------------------------------------------------------------------------
|
|
151
|
-
* Component: SelectItem
|
|
152
|
-
* -------------------------------------------------------------------------- */
|
|
153
|
-
|
|
154
|
-
type SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;
|
|
155
|
-
type SelectItemProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>;
|
|
156
|
-
|
|
157
|
-
const SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(({ children, className, ...props }, ref) => (
|
|
158
|
-
<SelectPrimitive.Item
|
|
159
|
-
ref={ref}
|
|
160
|
-
className={cn(
|
|
161
|
-
'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',
|
|
162
|
-
className,
|
|
163
|
-
)}
|
|
164
|
-
{...props}
|
|
165
|
-
>
|
|
166
|
-
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
167
|
-
<SelectPrimitive.ItemIndicator>
|
|
168
|
-
<CheckIcon className="size-4" />
|
|
169
|
-
</SelectPrimitive.ItemIndicator>
|
|
170
|
-
</span>
|
|
171
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
172
|
-
</SelectPrimitive.Item>
|
|
173
|
-
));
|
|
174
|
-
|
|
175
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
176
|
-
|
|
177
|
-
/* -----------------------------------------------------------------------------
|
|
178
|
-
* Component: SelectSeparator
|
|
179
|
-
* -------------------------------------------------------------------------- */
|
|
180
|
-
|
|
181
|
-
type SelectSeparatorElement = React.ElementRef<typeof SelectPrimitive.Separator>;
|
|
182
|
-
type SelectSeparatorProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>;
|
|
183
|
-
|
|
184
|
-
const SelectSeparator = React.forwardRef<SelectSeparatorElement, SelectSeparatorProps>(
|
|
185
|
-
({ className, ...props }, ref) => (
|
|
186
|
-
<SelectPrimitive.Separator ref={ref} className={cn('bg-muted -mx-1 my-1 h-px', className)} {...props} />
|
|
187
|
-
),
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
191
|
-
|
|
192
|
-
/* -----------------------------------------------------------------------------
|
|
193
|
-
* Exports
|
|
194
|
-
* -------------------------------------------------------------------------- */
|
|
195
|
-
|
|
196
|
-
export {
|
|
197
|
-
Select,
|
|
198
|
-
SelectGroup,
|
|
199
|
-
SelectValue,
|
|
200
|
-
SelectTrigger,
|
|
201
|
-
SelectContent,
|
|
202
|
-
SelectLabel,
|
|
203
|
-
SelectItem,
|
|
204
|
-
SelectSeparator,
|
|
205
|
-
SelectScrollUpButton,
|
|
206
|
-
SelectScrollDownButton,
|
|
207
|
-
type SelectProps,
|
|
208
|
-
type SelectGroupProps,
|
|
209
|
-
type SelectValueProps,
|
|
210
|
-
type SelectTriggerProps,
|
|
211
|
-
type SelectContentProps,
|
|
212
|
-
type SelectLabelProps,
|
|
213
|
-
type SelectItemProps,
|
|
214
|
-
type SelectSeparatorProps,
|
|
215
|
-
type SelectScrollUpButtonProps,
|
|
216
|
-
type SelectScrollDownButtonProps,
|
|
217
|
-
};
|
package/src/react/separator.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Separator
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type SeparatorElement = React.ElementRef<typeof SeparatorPrimitive.Root>;
|
|
12
|
-
type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>;
|
|
13
|
-
|
|
14
|
-
const Separator = React.forwardRef<SeparatorElement, SeparatorProps>(
|
|
15
|
-
({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
|
|
16
|
-
<SeparatorPrimitive.Root
|
|
17
|
-
ref={ref}
|
|
18
|
-
className={cn('bg-border shrink-0', orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px', className)}
|
|
19
|
-
decorative={decorative}
|
|
20
|
-
orientation={orientation}
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
23
|
-
),
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
27
|
-
|
|
28
|
-
/* -----------------------------------------------------------------------------
|
|
29
|
-
* Exports
|
|
30
|
-
* -------------------------------------------------------------------------- */
|
|
31
|
-
|
|
32
|
-
export { Separator, type SeparatorProps };
|
package/src/react/sheet.tsx
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
5
|
-
import { Cross2Icon } from '@radix-ui/react-icons';
|
|
6
|
-
import { tv, type VariantProps } from 'tailwind-variants';
|
|
7
|
-
import { cn } from '../lib/utils';
|
|
8
|
-
|
|
9
|
-
/* -----------------------------------------------------------------------------
|
|
10
|
-
* Component: Sheet
|
|
11
|
-
* -------------------------------------------------------------------------- */
|
|
12
|
-
|
|
13
|
-
type SheetProps = React.ComponentProps<typeof SheetPrimitive.Root>;
|
|
14
|
-
const Sheet = SheetPrimitive.Root;
|
|
15
|
-
|
|
16
|
-
/* -----------------------------------------------------------------------------
|
|
17
|
-
* Component: SheetTrigger
|
|
18
|
-
* -------------------------------------------------------------------------- */
|
|
19
|
-
|
|
20
|
-
type SheetTriggerProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Trigger>;
|
|
21
|
-
const SheetTrigger = SheetPrimitive.Trigger;
|
|
22
|
-
|
|
23
|
-
/* -----------------------------------------------------------------------------
|
|
24
|
-
* Component: SheetClose
|
|
25
|
-
* -------------------------------------------------------------------------- */
|
|
26
|
-
|
|
27
|
-
type SheetCloseProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Close>;
|
|
28
|
-
const SheetClose = SheetPrimitive.Close;
|
|
29
|
-
|
|
30
|
-
/* -----------------------------------------------------------------------------
|
|
31
|
-
* Variant: SheetContent
|
|
32
|
-
* -------------------------------------------------------------------------- */
|
|
33
|
-
|
|
34
|
-
const sheetContentVariants = tv({
|
|
35
|
-
base: 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:animate-duration-300 data-[state=open]:animate-duration-500 animate-ease-in-out fixed z-50 flex flex-col overflow-auto shadow-lg',
|
|
36
|
-
variants: {
|
|
37
|
-
side: {
|
|
38
|
-
top: 'data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top inset-x-0 top-0 max-h-screen border-b',
|
|
39
|
-
bottom:
|
|
40
|
-
'data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom inset-x-0 bottom-0 max-h-screen border-t',
|
|
41
|
-
left: 'data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
|
|
42
|
-
right:
|
|
43
|
-
'data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
defaultVariants: {
|
|
47
|
-
side: 'right',
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
type SheetContentVariantsProps = VariantProps<typeof sheetContentVariants>;
|
|
52
|
-
|
|
53
|
-
/* -----------------------------------------------------------------------------
|
|
54
|
-
* Component: SheetContent
|
|
55
|
-
* -------------------------------------------------------------------------- */
|
|
56
|
-
|
|
57
|
-
type SheetContentElement = React.ElementRef<typeof SheetPrimitive.Content>;
|
|
58
|
-
type SheetContentProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> & SheetContentVariantsProps;
|
|
59
|
-
|
|
60
|
-
const SheetContent = React.forwardRef<SheetContentElement, SheetContentProps>(
|
|
61
|
-
({ children, side = 'right', className, ...props }, ref) => (
|
|
62
|
-
<SheetPrimitive.Portal>
|
|
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={ref} className={sheetContentVariants({ side, className })} {...props}>
|
|
65
|
-
{children}
|
|
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
|
-
<Cross2Icon className="size-4" />
|
|
68
|
-
<span className="sr-only">Close</span>
|
|
69
|
-
</SheetPrimitive.Close>
|
|
70
|
-
</SheetPrimitive.Content>
|
|
71
|
-
</SheetPrimitive.Portal>
|
|
72
|
-
),
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
76
|
-
|
|
77
|
-
/* -----------------------------------------------------------------------------
|
|
78
|
-
* Component: SheetHeader
|
|
79
|
-
* -------------------------------------------------------------------------- */
|
|
80
|
-
|
|
81
|
-
type SheetHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
82
|
-
|
|
83
|
-
function SheetHeader({ className, ...props }: SheetHeaderProps): React.JSX.Element {
|
|
84
|
-
return (
|
|
85
|
-
<header
|
|
86
|
-
className={cn('flex shrink-0 flex-col gap-1.5 px-6 pb-4 pt-6 text-center sm:text-left', className)}
|
|
87
|
-
{...props}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* -----------------------------------------------------------------------------
|
|
93
|
-
* Component: SheetBody
|
|
94
|
-
* -------------------------------------------------------------------------- */
|
|
95
|
-
|
|
96
|
-
type SheetBodyProps = React.HTMLAttributes<HTMLDivElement>;
|
|
97
|
-
|
|
98
|
-
function SheetBody({ className, ...props }: SheetHeaderProps): React.JSX.Element {
|
|
99
|
-
return <main className={cn('px-6 py-2', className)} {...props} />;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* -----------------------------------------------------------------------------
|
|
103
|
-
* Component: SheetFooter
|
|
104
|
-
* -------------------------------------------------------------------------- */
|
|
105
|
-
|
|
106
|
-
type SheetFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
107
|
-
|
|
108
|
-
function SheetFooter({ className, ...props }: SheetFooterProps): React.JSX.Element {
|
|
109
|
-
return (
|
|
110
|
-
<footer
|
|
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
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
SheetFooter.displayName = 'SheetFooter';
|
|
118
|
-
|
|
119
|
-
/* -----------------------------------------------------------------------------
|
|
120
|
-
* Component: SheetTitle
|
|
121
|
-
* -------------------------------------------------------------------------- */
|
|
122
|
-
|
|
123
|
-
type SheetTitleElement = React.ElementRef<typeof SheetPrimitive.Title>;
|
|
124
|
-
type SheetTitleProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>;
|
|
125
|
-
|
|
126
|
-
const SheetTitle = React.forwardRef<SheetTitleElement, SheetTitleProps>(({ className, ...props }, ref) => (
|
|
127
|
-
<SheetPrimitive.Title ref={ref} className={cn('text-foreground text-lg font-semibold', className)} {...props} />
|
|
128
|
-
));
|
|
129
|
-
|
|
130
|
-
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
131
|
-
|
|
132
|
-
/* -----------------------------------------------------------------------------
|
|
133
|
-
* Component: SheetDescription
|
|
134
|
-
* -------------------------------------------------------------------------- */
|
|
135
|
-
|
|
136
|
-
type SheetDescriptionElement = React.ElementRef<typeof SheetPrimitive.Description>;
|
|
137
|
-
type SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>;
|
|
138
|
-
|
|
139
|
-
const SheetDescription = React.forwardRef<SheetDescriptionElement, SheetDescriptionProps>(
|
|
140
|
-
({ className, ...props }, ref) => (
|
|
141
|
-
<SheetPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
|
|
142
|
-
),
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
146
|
-
|
|
147
|
-
/* -----------------------------------------------------------------------------
|
|
148
|
-
* Exports
|
|
149
|
-
* -------------------------------------------------------------------------- */
|
|
150
|
-
|
|
151
|
-
export {
|
|
152
|
-
Sheet,
|
|
153
|
-
SheetTrigger,
|
|
154
|
-
SheetClose,
|
|
155
|
-
SheetContent,
|
|
156
|
-
SheetHeader,
|
|
157
|
-
SheetBody,
|
|
158
|
-
SheetFooter,
|
|
159
|
-
SheetTitle,
|
|
160
|
-
SheetDescription,
|
|
161
|
-
type SheetProps,
|
|
162
|
-
type SheetTriggerProps,
|
|
163
|
-
type SheetCloseProps,
|
|
164
|
-
type SheetContentProps,
|
|
165
|
-
type SheetHeaderProps,
|
|
166
|
-
type SheetBodyProps,
|
|
167
|
-
type SheetFooterProps,
|
|
168
|
-
type SheetTitleProps,
|
|
169
|
-
type SheetDescriptionProps,
|
|
170
|
-
};
|
package/src/react/skeleton.tsx
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cn } from '../lib/utils';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Skeleton
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type SkeletonProps = React.HTMLAttributes<HTMLDivElement>;
|
|
9
|
-
|
|
10
|
-
function Skeleton({ className, ...props }: SkeletonProps): React.JSX.Element {
|
|
11
|
-
return <div className={cn('bg-primary/10 animate-pulse rounded', className)} {...props} />;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/* -----------------------------------------------------------------------------
|
|
15
|
-
* Exports
|
|
16
|
-
* -------------------------------------------------------------------------- */
|
|
17
|
-
|
|
18
|
-
export { Skeleton, type SkeletonProps };
|
package/src/react/slider.tsx
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Slider
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type SliderElement = React.ElementRef<typeof SliderPrimitive.Root>;
|
|
12
|
-
type SliderProps = React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>;
|
|
13
|
-
|
|
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
|
-
));
|
|
34
|
-
|
|
35
|
-
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
36
|
-
|
|
37
|
-
/* -----------------------------------------------------------------------------
|
|
38
|
-
* Exports
|
|
39
|
-
* -------------------------------------------------------------------------- */
|
|
40
|
-
|
|
41
|
-
export { Slider, type SliderProps };
|
package/src/react/sonner.tsx
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { useTheme } from 'next-themes';
|
|
5
|
-
import { toast, Toaster as Sonner } from 'sonner';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Sonner
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type ToasterProps = React.ComponentProps<typeof Sonner>;
|
|
12
|
-
type Theme = 'light' | 'dark' | 'system' | undefined;
|
|
13
|
-
|
|
14
|
-
function Toaster({ ...props }: ToasterProps): React.JSX.Element {
|
|
15
|
-
const { theme = 'system' } = useTheme() as { theme: Theme };
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<Sonner
|
|
19
|
-
className="toaster group"
|
|
20
|
-
theme={theme}
|
|
21
|
-
toastOptions={{
|
|
22
|
-
classNames: {
|
|
23
|
-
actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',
|
|
24
|
-
cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',
|
|
25
|
-
content: 'w-full flex flex-col gap-1',
|
|
26
|
-
description: 'group-[.toast]:text-muted-foreground',
|
|
27
|
-
toast:
|
|
28
|
-
'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',
|
|
29
|
-
},
|
|
30
|
-
}}
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* -----------------------------------------------------------------------------
|
|
37
|
-
* Exports
|
|
38
|
-
* -------------------------------------------------------------------------- */
|
|
39
|
-
|
|
40
|
-
export { Toaster, toast, type ToasterProps };
|
package/src/react/spinner.tsx
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
|
|
3
|
-
import { cn } from '../lib/utils';
|
|
4
|
-
|
|
5
|
-
/* -----------------------------------------------------------------------------
|
|
6
|
-
* Component: Spinner
|
|
7
|
-
* -------------------------------------------------------------------------- */
|
|
8
|
-
|
|
9
|
-
const spinnerCount = 8;
|
|
10
|
-
|
|
11
|
-
type SpinnerElement = HTMLSpanElement;
|
|
12
|
-
|
|
13
|
-
interface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
14
|
-
loading?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const Spinner = React.forwardRef<SpinnerElement, SpinnerProps>(
|
|
18
|
-
({ children, className, loading = true, ...props }, ref) => {
|
|
19
|
-
if (!loading) {
|
|
20
|
-
return children;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const spinner = (
|
|
24
|
-
<span
|
|
25
|
-
ref={ref}
|
|
26
|
-
className={cn('relative flex size-4 items-center justify-center opacity-60', className)}
|
|
27
|
-
{...props}
|
|
28
|
-
>
|
|
29
|
-
{Array.from({ length: spinnerCount }, (_, i) => (
|
|
30
|
-
<span
|
|
31
|
-
key={i}
|
|
32
|
-
className="before:fade-out-25 before:animate-out before:animate-repeat-infinite before:animate-delay-[var(--spinner-delay)] before:animate-duration-[var(--spinner-duration)] absolute h-full rotate-[var(--spinner-rotate)] before:block before:h-1/3 before:w-full before:rounded-full before:bg-current"
|
|
33
|
-
style={
|
|
34
|
-
{
|
|
35
|
-
width: `${(100 / spinnerCount).toString()}%`,
|
|
36
|
-
'--spinner-delay': `-${((spinnerCount - i) * 100).toString()}ms`,
|
|
37
|
-
'--spinner-rotate': `${((360 / spinnerCount) * i).toString()}deg`,
|
|
38
|
-
'--spinner-duration': `${(spinnerCount * 100).toString()}ms`,
|
|
39
|
-
} as React.CSSProperties
|
|
40
|
-
}
|
|
41
|
-
/>
|
|
42
|
-
))}
|
|
43
|
-
</span>
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
if (children === undefined) {
|
|
47
|
-
return spinner;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<span className="relative">
|
|
52
|
-
<span aria-hidden className="invisible contents">
|
|
53
|
-
{children}
|
|
54
|
-
</span>
|
|
55
|
-
<VisuallyHidden>{children}</VisuallyHidden>
|
|
56
|
-
<span className="absolute inset-0 flex items-center justify-center">{spinner}</span>
|
|
57
|
-
</span>
|
|
58
|
-
);
|
|
59
|
-
},
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
Spinner.displayName = 'Spinner';
|
|
63
|
-
|
|
64
|
-
/* -----------------------------------------------------------------------------
|
|
65
|
-
* Exports
|
|
66
|
-
* -------------------------------------------------------------------------- */
|
|
67
|
-
|
|
68
|
-
export { Spinner, type SpinnerProps };
|
package/src/react/strong.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Strong
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type StrongElement = HTMLElement;
|
|
9
|
-
|
|
10
|
-
interface StrongProps extends React.HTMLAttributes<HTMLElement> {
|
|
11
|
-
asChild?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Strong = React.forwardRef<StrongElement, StrongProps>(({ asChild, ...props }, ref) => {
|
|
15
|
-
const Component = asChild ? Slot : 'strong';
|
|
16
|
-
|
|
17
|
-
return <Component ref={ref} {...props} />;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Strong.displayName = 'Strong';
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Exports
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
export { Strong, type StrongProps };
|
package/src/react/switch.tsx
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Switch
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type SwitchElement = React.ElementRef<typeof SwitchPrimitives.Root>;
|
|
12
|
-
type SwitchProps = React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>;
|
|
13
|
-
|
|
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
|
-
));
|
|
26
|
-
|
|
27
|
-
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
28
|
-
|
|
29
|
-
/* -----------------------------------------------------------------------------
|
|
30
|
-
* Exports
|
|
31
|
-
* -------------------------------------------------------------------------- */
|
|
32
|
-
|
|
33
|
-
export { Switch, type SwitchProps };
|