@arolariu/components 0.2.0 → 0.3.0
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/changelog.md +11 -0
- package/dist/components/ui/accordion.d.ts +4 -4
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +19 -27
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +17 -11
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +38 -61
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +4 -5
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +17 -20
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +1 -2
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui/aspect-ratio.js +1 -8
- package/dist/components/ui/aspect-ratio.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +3 -3
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +16 -19
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +7 -10
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +16 -8
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +28 -35
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button-group.d.ts +13 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +47 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +3 -2
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +15 -14
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +20 -20
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.d.ts +7 -8
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +31 -44
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts +5 -6
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +30 -21
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts +35 -27
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +28 -26
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +10 -12
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible.d.ts +3 -4
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +3 -20
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/command.d.ts +78 -16
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +47 -72
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +21 -19
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +57 -101
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +16 -12
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +36 -64
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +19 -10
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +32 -57
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +21 -19
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +64 -108
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdrawer.d.ts +1 -1
- package/dist/components/ui/dropdrawer.d.ts.map +1 -1
- package/dist/components/ui/dropdrawer.js +2 -5
- package/dist/components/ui/dropdrawer.js.map +1 -1
- package/dist/components/ui/empty.d.ts +13 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +65 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +135 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/form.d.ts +5 -6
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +28 -27
- package/dist/components/ui/form.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts +3 -3
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +11 -25
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +91 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +30 -7
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +23 -26
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +6 -7
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +122 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +21 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +2 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +8 -7
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +18 -16
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +73 -93
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +8 -10
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +37 -55
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.d.ts +24 -9
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +33 -45
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts +4 -4
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +9 -25
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +1 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +5 -7
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +16 -19
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts +20 -5
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +9 -21
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +2 -2
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +12 -16
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.d.ts +10 -12
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +54 -77
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.d.ts +1 -1
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +6 -7
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +23 -11
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +54 -66
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +34 -38
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +113 -122
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +1 -2
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.d.ts +1 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +11 -30
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.d.ts +4 -2
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +7 -4
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +16 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +7 -9
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts +8 -8
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +36 -45
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +4 -4
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +17 -26
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +6 -7
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +8 -3
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +11 -15
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +4 -1
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +7 -8
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +4 -4
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +13 -38
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/ui/typewriter.d.ts.map +1 -1
- package/dist/components/ui/typewriter.js +2 -6
- package/dist/components/ui/typewriter.js.map +1 -1
- package/dist/index.css +839 -1126
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/package.json +37 -2
- package/src/components/ui/accordion.tsx +43 -44
- package/src/components/ui/alert-dialog.tsx +88 -99
- package/src/components/ui/alert.tsx +23 -25
- package/src/components/ui/aspect-ratio.tsx +1 -9
- package/src/components/ui/avatar.tsx +29 -24
- package/src/components/ui/badge.tsx +8 -16
- package/src/components/ui/breadcrumb.tsx +70 -73
- package/src/components/ui/button-group.tsx +69 -0
- package/src/components/ui/button.tsx +18 -24
- package/src/components/ui/calendar.tsx +20 -22
- package/src/components/ui/card.tsx +52 -71
- package/src/components/ui/carousel.tsx +145 -133
- package/src/components/ui/chart.tsx +173 -183
- package/src/components/ui/checkbox.tsx +18 -18
- package/src/components/ui/collapsible.tsx +3 -25
- package/src/components/ui/command.tsx +100 -99
- package/src/components/ui/context-menu.tsx +150 -193
- package/src/components/ui/dialog.tsx +75 -110
- package/src/components/ui/drawer.tsx +74 -102
- package/src/components/ui/dropdown-menu.tsx +153 -200
- package/src/components/ui/dropdrawer.tsx +0 -5
- package/src/components/ui/empty.tsx +86 -0
- package/src/components/ui/field.tsx +198 -0
- package/src/components/ui/form.tsx +47 -48
- package/src/components/ui/hover-card.tsx +18 -37
- package/src/components/ui/input-group.tsx +145 -0
- package/src/components/ui/input-otp.tsx +49 -59
- package/src/components/ui/input.tsx +5 -6
- package/src/components/ui/item.tsx +163 -0
- package/src/components/ui/kbd.tsx +31 -0
- package/src/components/ui/label.tsx +14 -12
- package/src/components/ui/menubar.tsx +178 -201
- package/src/components/ui/navigation-menu.tsx +85 -100
- package/src/components/ui/pagination.tsx +74 -85
- package/src/components/ui/popover.tsx +19 -38
- package/src/components/ui/progress.tsx +15 -14
- package/src/components/ui/radio-group.tsx +19 -13
- package/src/components/ui/resizable.tsx +23 -37
- package/src/components/ui/scroll-area.tsx +32 -35
- package/src/components/ui/select.tsx +112 -127
- package/src/components/ui/separator.tsx +17 -19
- package/src/components/ui/sheet.tsx +87 -108
- package/src/components/ui/sidebar.tsx +262 -271
- package/src/components/ui/skeleton.tsx +2 -3
- package/src/components/ui/slider.tsx +10 -36
- package/src/components/ui/sonner.tsx +15 -9
- package/src/components/ui/spinner.tsx +18 -0
- package/src/components/ui/switch.tsx +18 -17
- package/src/components/ui/table.tsx +66 -71
- package/src/components/ui/tabs.tsx +36 -36
- package/src/components/ui/textarea.tsx +5 -4
- package/src/components/ui/toggle-group.tsx +21 -34
- package/src/components/ui/toggle.tsx +14 -16
- package/src/components/ui/tooltip.tsx +19 -43
- package/src/components/ui/typewriter.tsx +3 -4
- package/src/index.css +6 -6
- package/src/index.ts +43 -4
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
import {cn} from "@/lib/utilities";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
|
|
6
|
-
function Skeleton({className, ...props}: React.
|
|
6
|
+
function Skeleton({className, ...props}: Readonly<React.HTMLAttributes<HTMLDivElement>>) {
|
|
7
7
|
return (
|
|
8
8
|
<div
|
|
9
|
-
|
|
10
|
-
className={cn("animate-pulse rounded-md bg-neutral-100 dark:bg-neutral-800", className)}
|
|
9
|
+
className={cn("animate-pulse rounded-md bg-neutral-900/10 dark:bg-neutral-50/10", className)}
|
|
11
10
|
{...props}
|
|
12
11
|
/>
|
|
13
12
|
);
|
|
@@ -5,45 +5,19 @@ import * as React from "react";
|
|
|
5
5
|
|
|
6
6
|
import {cn} from "@/lib/utilities";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
() => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]),
|
|
11
|
-
[value, defaultValue, min, max],
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
return (
|
|
8
|
+
const Slider = React.forwardRef<React.ElementRef<typeof SliderPrimitive.Root>, React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>>(
|
|
9
|
+
({className, ...props}, ref) => (
|
|
15
10
|
<SliderPrimitive.Root
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
value={value}
|
|
19
|
-
min={min}
|
|
20
|
-
max={max}
|
|
21
|
-
className={cn(
|
|
22
|
-
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
23
|
-
className,
|
|
24
|
-
)}
|
|
11
|
+
ref={ref}
|
|
12
|
+
className={cn("relative flex w-full touch-none items-center select-none", className)}
|
|
25
13
|
{...props}>
|
|
26
|
-
<SliderPrimitive.Track
|
|
27
|
-
|
|
28
|
-
className={cn(
|
|
29
|
-
"relative grow overflow-hidden rounded-full bg-neutral-100 data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5 dark:bg-neutral-800",
|
|
30
|
-
)}>
|
|
31
|
-
<SliderPrimitive.Range
|
|
32
|
-
data-slot='slider-range'
|
|
33
|
-
className={cn(
|
|
34
|
-
"absolute bg-neutral-900 data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full dark:bg-neutral-50",
|
|
35
|
-
)}
|
|
36
|
-
/>
|
|
14
|
+
<SliderPrimitive.Track className='relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral-900/20 dark:bg-neutral-50/20'>
|
|
15
|
+
<SliderPrimitive.Range className='absolute h-full bg-neutral-900 dark:bg-neutral-50' />
|
|
37
16
|
</SliderPrimitive.Track>
|
|
38
|
-
|
|
39
|
-
<SliderPrimitive.Thumb
|
|
40
|
-
data-slot='slider-thumb'
|
|
41
|
-
key={index}
|
|
42
|
-
className='block size-4 shrink-0 rounded-full border border-neutral-200 border-neutral-900 bg-white shadow-sm ring-neutral-950/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 dark:border-neutral-50 dark:border-neutral-800 dark:bg-neutral-950 dark:ring-neutral-300/50'
|
|
43
|
-
/>
|
|
44
|
-
))}
|
|
17
|
+
<SliderPrimitive.Thumb className='block h-4 w-4 rounded-full border border-neutral-200 border-neutral-900/50 bg-white shadow transition-colors focus-visible:ring-1 focus-visible:ring-neutral-950 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 dark:border-neutral-50/50 dark:border-neutral-800 dark:bg-neutral-950 dark:focus-visible:ring-neutral-300' />
|
|
45
18
|
</SliderPrimitive.Root>
|
|
46
|
-
)
|
|
47
|
-
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
48
22
|
|
|
49
23
|
export {Slider};
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import {useTheme} from "next-themes";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import {Toaster as Sonner,
|
|
5
|
+
import {Toaster as Sonner, toast} from "sonner";
|
|
6
|
+
|
|
7
|
+
type ToasterProps = React.ComponentProps<typeof Sonner>;
|
|
6
8
|
|
|
7
9
|
const Toaster = ({...props}: ToasterProps) => {
|
|
8
10
|
const {theme = "system"} = useTheme();
|
|
@@ -11,20 +13,24 @@ const Toaster = ({...props}: ToasterProps) => {
|
|
|
11
13
|
<Sonner
|
|
12
14
|
theme={theme as ToasterProps["theme"]}
|
|
13
15
|
className='toaster group'
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
toastOptions={{
|
|
17
|
+
classNames: {
|
|
18
|
+
toast:
|
|
19
|
+
"group toast group-[.toaster]:bg-white group-[.toaster]:text-neutral-950 group-[.toaster]:border-neutral-200 group-[.toaster]:shadow-lg dark:group-[.toaster]:bg-neutral-950 dark:group-[.toaster]:text-neutral-50 dark:group-[.toaster]:border-neutral-800",
|
|
20
|
+
description: "group-[.toast]:text-neutral-500 dark:group-[.toast]:text-neutral-400",
|
|
21
|
+
actionButton:
|
|
22
|
+
"group-[.toast]:bg-neutral-900 group-[.toast]:text-neutral-50 dark:group-[.toast]:bg-neutral-50 dark:group-[.toast]:text-neutral-900",
|
|
23
|
+
cancelButton:
|
|
24
|
+
"group-[.toast]:bg-neutral-100 group-[.toast]:text-neutral-500 dark:group-[.toast]:bg-neutral-800 dark:group-[.toast]:text-neutral-400",
|
|
25
|
+
},
|
|
26
|
+
}}
|
|
21
27
|
{...props}
|
|
22
28
|
/>
|
|
23
29
|
);
|
|
24
30
|
};
|
|
25
31
|
|
|
26
32
|
export {
|
|
27
|
-
Toaster,
|
|
28
33
|
// eslint-disable-next-line unicorn/prefer-export-from -- same export style.
|
|
29
34
|
toast,
|
|
35
|
+
Toaster,
|
|
30
36
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {cn} from "@/lib/utilities";
|
|
4
|
+
import {Loader2Icon} from "lucide-react";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
|
|
7
|
+
function Spinner({className, ...props}: React.ComponentProps<"svg">) {
|
|
8
|
+
return (
|
|
9
|
+
<Loader2Icon
|
|
10
|
+
role='status'
|
|
11
|
+
aria-label='Loading'
|
|
12
|
+
className={cn("size-4 animate-spin", className)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {Spinner};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
|
|
6
6
|
import {cn} from "@/lib/utilities";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const Switch = React.forwardRef<
|
|
9
|
+
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
|
|
11
|
+
>(({className, ...props}, ref) => (
|
|
12
|
+
<SwitchPrimitives.Root
|
|
13
|
+
className={cn(
|
|
14
|
+
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-neutral-900 data-[state=unchecked]:bg-neutral-200 dark:focus-visible:ring-neutral-300 dark:focus-visible:ring-offset-neutral-950 dark:data-[state=checked]:bg-neutral-50 dark:data-[state=unchecked]:bg-neutral-800",
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
ref={ref}>
|
|
19
|
+
<SwitchPrimitives.Thumb
|
|
12
20
|
className={cn(
|
|
13
|
-
"
|
|
14
|
-
className,
|
|
21
|
+
"pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0 dark:bg-neutral-950",
|
|
15
22
|
)}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"pointer-events-none block size-4 rounded-full bg-white ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:bg-neutral-950 dark:dark:data-[state=checked]:bg-neutral-900 dark:data-[state=checked]:bg-neutral-50 dark:dark:data-[state=unchecked]:bg-neutral-50 dark:data-[state=unchecked]:bg-neutral-950",
|
|
21
|
-
)}
|
|
22
|
-
/>
|
|
23
|
-
</SwitchPrimitive.Root>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
23
|
+
/>
|
|
24
|
+
</SwitchPrimitives.Root>
|
|
25
|
+
));
|
|
26
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
26
27
|
|
|
27
28
|
export {Switch};
|
|
@@ -4,95 +4,90 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import {cn} from "@/lib/utilities";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
className=
|
|
12
|
-
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
7
|
+
const Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(({className, ...props}, ref) => (
|
|
8
|
+
<div className='relative w-full overflow-auto'>
|
|
9
|
+
<table
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={cn("w-full caption-bottom text-sm", className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
));
|
|
16
|
+
Table.displayName = "Table";
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(
|
|
19
|
+
({className, ...props}, ref) => (
|
|
24
20
|
<thead
|
|
25
|
-
|
|
21
|
+
ref={ref}
|
|
26
22
|
className={cn("[&_tr]:border-b", className)}
|
|
27
23
|
{...props}
|
|
28
24
|
/>
|
|
29
|
-
)
|
|
30
|
-
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
TableHeader.displayName = "TableHeader";
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
29
|
+
const TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(({className, ...props}, ref) => (
|
|
30
|
+
<tbody
|
|
31
|
+
ref={ref}
|
|
32
|
+
className={cn("[&_tr:last-child]:border-0", className)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
));
|
|
36
|
+
TableBody.displayName = "TableBody";
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
const TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(
|
|
39
|
+
({className, ...props}, ref) => (
|
|
44
40
|
<tfoot
|
|
45
|
-
|
|
41
|
+
ref={ref}
|
|
46
42
|
className={cn("border-t bg-neutral-100/50 font-medium dark:bg-neutral-800/50 [&>tr]:last:border-b-0", className)}
|
|
47
43
|
{...props}
|
|
48
44
|
/>
|
|
49
|
-
)
|
|
50
|
-
|
|
45
|
+
),
|
|
46
|
+
);
|
|
47
|
+
TableFooter.displayName = "TableFooter";
|
|
51
48
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
49
|
+
const TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(({className, ...props}, ref) => (
|
|
50
|
+
<tr
|
|
51
|
+
ref={ref}
|
|
52
|
+
className={cn(
|
|
53
|
+
"border-b transition-colors hover:bg-neutral-100/50 data-[state=selected]:bg-neutral-100 dark:hover:bg-neutral-800/50 dark:data-[state=selected]:bg-neutral-800",
|
|
54
|
+
className,
|
|
55
|
+
)}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
));
|
|
59
|
+
TableRow.displayName = "TableRow";
|
|
64
60
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
61
|
+
const TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement>>(({className, ...props}, ref) => (
|
|
62
|
+
<th
|
|
63
|
+
ref={ref}
|
|
64
|
+
className={cn(
|
|
65
|
+
"h-10 px-2 text-left align-middle font-medium text-neutral-500 dark:text-neutral-400 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
66
|
+
className,
|
|
67
|
+
)}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
));
|
|
71
|
+
TableHead.displayName = "TableHead";
|
|
77
72
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
73
|
+
const TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(({className, ...props}, ref) => (
|
|
74
|
+
<td
|
|
75
|
+
ref={ref}
|
|
76
|
+
className={cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className)}
|
|
77
|
+
{...props}
|
|
78
|
+
/>
|
|
79
|
+
));
|
|
80
|
+
TableCell.displayName = "TableCell";
|
|
87
81
|
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
const TableCaption = React.forwardRef<HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement>>(
|
|
83
|
+
({className, ...props}, ref) => (
|
|
90
84
|
<caption
|
|
91
|
-
|
|
85
|
+
ref={ref}
|
|
92
86
|
className={cn("mt-4 text-sm text-neutral-500 dark:text-neutral-400", className)}
|
|
93
87
|
{...props}
|
|
94
88
|
/>
|
|
95
|
-
)
|
|
96
|
-
|
|
89
|
+
),
|
|
90
|
+
);
|
|
91
|
+
TableCaption.displayName = "TableCaption";
|
|
97
92
|
|
|
98
93
|
export {Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow};
|
|
@@ -5,50 +5,50 @@ import * as React from "react";
|
|
|
5
5
|
|
|
6
6
|
import {cn} from "@/lib/utilities";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<TabsPrimitive.Root
|
|
11
|
-
data-slot='tabs'
|
|
12
|
-
className={cn("flex flex-col gap-2", className)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
8
|
+
const Tabs = TabsPrimitive.Root;
|
|
17
9
|
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
const TabsList = React.forwardRef<React.ElementRef<typeof TabsPrimitive.List>, React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>>(
|
|
11
|
+
({className, ...props}, ref) => (
|
|
20
12
|
<TabsPrimitive.List
|
|
21
|
-
|
|
13
|
+
ref={ref}
|
|
22
14
|
className={cn(
|
|
23
|
-
"inline-flex h-9
|
|
15
|
+
"inline-flex h-9 items-center justify-center rounded-lg bg-neutral-100 p-1 text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400",
|
|
24
16
|
className,
|
|
25
17
|
)}
|
|
26
18
|
{...props}
|
|
27
19
|
/>
|
|
28
|
-
)
|
|
29
|
-
|
|
20
|
+
),
|
|
21
|
+
);
|
|
22
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
const TabsTrigger = React.forwardRef<
|
|
25
|
+
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
26
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
27
|
+
>(({className, ...props}, ref) => (
|
|
28
|
+
<TabsPrimitive.Trigger
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={cn(
|
|
31
|
+
"inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap ring-offset-white transition-all focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-neutral-950 data-[state=active]:shadow dark:ring-offset-neutral-950 dark:focus-visible:ring-neutral-300 dark:data-[state=active]:bg-neutral-950 dark:data-[state=active]:text-neutral-50",
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
));
|
|
37
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
43
38
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
const TabsContent = React.forwardRef<
|
|
40
|
+
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
41
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
42
|
+
>(({className, ...props}, ref) => (
|
|
43
|
+
<TabsPrimitive.Content
|
|
44
|
+
ref={ref}
|
|
45
|
+
className={cn(
|
|
46
|
+
"mt-2 ring-offset-white focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 focus-visible:outline-none dark:ring-offset-neutral-950 dark:focus-visible:ring-neutral-300",
|
|
47
|
+
className,
|
|
48
|
+
)}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
));
|
|
52
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
53
53
|
|
|
54
54
|
export {Tabs, TabsContent, TabsList, TabsTrigger};
|
|
@@ -4,17 +4,18 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import {cn} from "@/lib/utilities";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<"textarea">>(({className, ...props}, ref) => {
|
|
8
8
|
return (
|
|
9
9
|
<textarea
|
|
10
|
-
data-slot='textarea'
|
|
11
10
|
className={cn(
|
|
12
|
-
"flex
|
|
11
|
+
"flex min-h-[60px] w-full rounded-md border border-neutral-200 bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-neutral-500 focus-visible:ring-1 focus-visible:ring-neutral-950 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-neutral-800 dark:placeholder:text-neutral-400 dark:focus-visible:ring-neutral-300",
|
|
13
12
|
className,
|
|
14
13
|
)}
|
|
14
|
+
ref={ref}
|
|
15
15
|
{...props}
|
|
16
16
|
/>
|
|
17
17
|
);
|
|
18
|
-
}
|
|
18
|
+
});
|
|
19
|
+
Textarea.displayName = "Textarea";
|
|
19
20
|
|
|
20
21
|
export {Textarea};
|
|
@@ -12,55 +12,42 @@ const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariant
|
|
|
12
12
|
variant: "default",
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
data-size={size}
|
|
27
|
-
className={cn("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs", className)}
|
|
28
|
-
{...props}>
|
|
29
|
-
<ToggleGroupContext.Provider
|
|
30
|
-
// eslint-disable-next-line react/jsx-no-constructed-context-values -- not applicable.
|
|
31
|
-
value={{variant, size}}>
|
|
32
|
-
{children}
|
|
33
|
-
</ToggleGroupContext.Provider>
|
|
34
|
-
</ToggleGroupPrimitive.Root>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
15
|
+
const ToggleGroup = React.forwardRef<
|
|
16
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
|
17
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>
|
|
18
|
+
>(({className, variant, size, children, ...props}, ref) => (
|
|
19
|
+
<ToggleGroupPrimitive.Root
|
|
20
|
+
ref={ref}
|
|
21
|
+
className={cn("flex items-center justify-center gap-1", className)}
|
|
22
|
+
{...props}>
|
|
23
|
+
<ToggleGroupContext.Provider value={{variant, size}}>{children}</ToggleGroupContext.Provider>
|
|
24
|
+
</ToggleGroupPrimitive.Root>
|
|
25
|
+
));
|
|
37
26
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}: Readonly<React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>>) {
|
|
27
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
28
|
+
|
|
29
|
+
const ToggleGroupItem = React.forwardRef<
|
|
30
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
|
31
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>
|
|
32
|
+
>(({className, children, variant, size, ...props}, ref) => {
|
|
45
33
|
const context = React.useContext(ToggleGroupContext);
|
|
46
34
|
|
|
47
35
|
return (
|
|
48
36
|
<ToggleGroupPrimitive.Item
|
|
49
|
-
|
|
50
|
-
data-variant={context.variant || variant}
|
|
51
|
-
data-size={context.size || size}
|
|
37
|
+
ref={ref}
|
|
52
38
|
className={cn(
|
|
53
39
|
toggleVariants({
|
|
54
40
|
variant: context.variant || variant,
|
|
55
41
|
size: context.size || size,
|
|
56
42
|
}),
|
|
57
|
-
"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",
|
|
58
43
|
className,
|
|
59
44
|
)}
|
|
60
45
|
{...props}>
|
|
61
46
|
{children}
|
|
62
47
|
</ToggleGroupPrimitive.Item>
|
|
63
48
|
);
|
|
64
|
-
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
65
52
|
|
|
66
53
|
export {ToggleGroup, ToggleGroupItem};
|
|
@@ -7,13 +7,13 @@ import * as React from "react";
|
|
|
7
7
|
import {cn} from "@/lib/utilities";
|
|
8
8
|
|
|
9
9
|
const toggleVariants = cva(
|
|
10
|
-
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-neutral-100 hover:text-neutral-500 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-neutral-100 data-[state=on]:text-neutral-900 [&_svg]:pointer-events-none [&_svg
|
|
10
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-neutral-100 hover:text-neutral-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-neutral-100 data-[state=on]:text-neutral-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 dark:hover:bg-neutral-800 dark:hover:text-neutral-400 dark:focus-visible:ring-neutral-300 dark:data-[state=on]:bg-neutral-800 dark:data-[state=on]:text-neutral-50",
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
13
13
|
variant: {
|
|
14
14
|
default: "bg-transparent",
|
|
15
15
|
outline:
|
|
16
|
-
"border border-neutral-200 bg-transparent shadow-
|
|
16
|
+
"border border-neutral-200 bg-transparent shadow-sm hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
|
|
17
17
|
},
|
|
18
18
|
size: {
|
|
19
19
|
default: "h-9 px-2 min-w-9",
|
|
@@ -28,19 +28,17 @@ const toggleVariants = cva(
|
|
|
28
28
|
},
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
44
|
-
}
|
|
31
|
+
const Toggle = React.forwardRef<
|
|
32
|
+
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
33
|
+
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>
|
|
34
|
+
>(({className, variant, size, ...props}, ref) => (
|
|
35
|
+
<TogglePrimitive.Root
|
|
36
|
+
ref={ref}
|
|
37
|
+
className={cn(toggleVariants({variant, size, className}))}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
));
|
|
41
|
+
|
|
42
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
45
43
|
|
|
46
44
|
export {Toggle, toggleVariants};
|