@hobenakicoffee/libraries 1.27.0 → 1.29.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/package.json +5 -39
- package/src/nuqs/common.ts +12 -0
- package/src/nuqs/index.ts +2 -0
- package/src/nuqs/transactions.ts +31 -0
- package/src/types/supabase.ts +30 -0
- package/src/components/ui/alert-dialog.tsx +0 -196
- package/src/components/ui/alert.tsx +0 -76
- package/src/components/ui/avatar.tsx +0 -110
- package/src/components/ui/badge.tsx +0 -49
- package/src/components/ui/breadcrumb.tsx +0 -122
- package/src/components/ui/button-group.tsx +0 -82
- package/src/components/ui/card.tsx +0 -100
- package/src/components/ui/chart.tsx +0 -364
- package/src/components/ui/checkbox.tsx +0 -30
- package/src/components/ui/dialog.tsx +0 -162
- package/src/components/ui/drawer.tsx +0 -126
- package/src/components/ui/dropdown-menu.tsx +0 -267
- package/src/components/ui/empty-minimal.tsx +0 -20
- package/src/components/ui/empty.tsx +0 -101
- package/src/components/ui/field.tsx +0 -235
- package/src/components/ui/input-group.tsx +0 -170
- package/src/components/ui/input-otp.tsx +0 -84
- package/src/components/ui/input.tsx +0 -37
- package/src/components/ui/item.tsx +0 -196
- package/src/components/ui/label.tsx +0 -19
- package/src/components/ui/popover.tsx +0 -87
- package/src/components/ui/radio-group.tsx +0 -47
- package/src/components/ui/select.tsx +0 -205
- package/src/components/ui/separator.tsx +0 -26
- package/src/components/ui/sheet.tsx +0 -141
- package/src/components/ui/sidebar.tsx +0 -699
- package/src/components/ui/skeleton.tsx +0 -13
- package/src/components/ui/sonner.tsx +0 -74
- package/src/components/ui/table.tsx +0 -114
- package/src/components/ui/tabs.tsx +0 -88
- package/src/components/ui/textarea.tsx +0 -35
- package/src/components/ui/toggle-group.tsx +0 -91
- package/src/components/ui/toggle.tsx +0 -44
- package/src/components/ui/tooltip.tsx +0 -59
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Alert02Icon,
|
|
3
|
-
CheckmarkCircle02Icon,
|
|
4
|
-
InformationCircleIcon,
|
|
5
|
-
Loading03Icon,
|
|
6
|
-
MultiplicationSignCircleIcon,
|
|
7
|
-
} from "@hugeicons/core-free-icons";
|
|
8
|
-
import { HugeiconsIcon } from "@hugeicons/react";
|
|
9
|
-
import { useTheme } from "next-themes";
|
|
10
|
-
import { Toaster as Sonner, type ToasterProps } from "sonner";
|
|
11
|
-
|
|
12
|
-
const Toaster = ({ ...props }: ToasterProps) => {
|
|
13
|
-
const { theme = "system" } = useTheme();
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Sonner
|
|
17
|
-
className="toaster group"
|
|
18
|
-
icons={{
|
|
19
|
-
success: (
|
|
20
|
-
<HugeiconsIcon
|
|
21
|
-
className="size-4"
|
|
22
|
-
icon={CheckmarkCircle02Icon}
|
|
23
|
-
strokeWidth={2}
|
|
24
|
-
/>
|
|
25
|
-
),
|
|
26
|
-
info: (
|
|
27
|
-
<HugeiconsIcon
|
|
28
|
-
className="size-4"
|
|
29
|
-
icon={InformationCircleIcon}
|
|
30
|
-
strokeWidth={2}
|
|
31
|
-
/>
|
|
32
|
-
),
|
|
33
|
-
warning: (
|
|
34
|
-
<HugeiconsIcon
|
|
35
|
-
className="size-4"
|
|
36
|
-
icon={Alert02Icon}
|
|
37
|
-
strokeWidth={2}
|
|
38
|
-
/>
|
|
39
|
-
),
|
|
40
|
-
error: (
|
|
41
|
-
<HugeiconsIcon
|
|
42
|
-
className="size-4"
|
|
43
|
-
icon={MultiplicationSignCircleIcon}
|
|
44
|
-
strokeWidth={2}
|
|
45
|
-
/>
|
|
46
|
-
),
|
|
47
|
-
loading: (
|
|
48
|
-
<HugeiconsIcon
|
|
49
|
-
className="size-4 animate-spin"
|
|
50
|
-
icon={Loading03Icon}
|
|
51
|
-
strokeWidth={2}
|
|
52
|
-
/>
|
|
53
|
-
),
|
|
54
|
-
}}
|
|
55
|
-
style={
|
|
56
|
-
{
|
|
57
|
-
"--normal-bg": "var(--popover)",
|
|
58
|
-
"--normal-text": "var(--popover-foreground)",
|
|
59
|
-
"--normal-border": "var(--border)",
|
|
60
|
-
"--border-radius": "var(--radius)",
|
|
61
|
-
} as React.CSSProperties
|
|
62
|
-
}
|
|
63
|
-
theme={theme as ToasterProps["theme"]}
|
|
64
|
-
toastOptions={{
|
|
65
|
-
classNames: {
|
|
66
|
-
toast: "cn-toast",
|
|
67
|
-
},
|
|
68
|
-
}}
|
|
69
|
-
{...props}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export { Toaster };
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import type * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils";
|
|
4
|
-
|
|
5
|
-
function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
6
|
-
return (
|
|
7
|
-
<div
|
|
8
|
-
className="relative w-full overflow-x-auto"
|
|
9
|
-
data-slot="table-container"
|
|
10
|
-
>
|
|
11
|
-
<table
|
|
12
|
-
className={cn("w-full caption-bottom text-sm", className)}
|
|
13
|
-
data-slot="table"
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
</div>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
21
|
-
return (
|
|
22
|
-
<thead
|
|
23
|
-
className={cn("[&_tr]:border-b", className)}
|
|
24
|
-
data-slot="table-header"
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
31
|
-
return (
|
|
32
|
-
<tbody
|
|
33
|
-
className={cn("[&_tr:last-child]:border-0", className)}
|
|
34
|
-
data-slot="table-body"
|
|
35
|
-
{...props}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
41
|
-
return (
|
|
42
|
-
<tfoot
|
|
43
|
-
className={cn(
|
|
44
|
-
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
45
|
-
className
|
|
46
|
-
)}
|
|
47
|
-
data-slot="table-footer"
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
54
|
-
return (
|
|
55
|
-
<tr
|
|
56
|
-
className={cn(
|
|
57
|
-
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
58
|
-
className
|
|
59
|
-
)}
|
|
60
|
-
data-slot="table-row"
|
|
61
|
-
{...props}
|
|
62
|
-
/>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
67
|
-
return (
|
|
68
|
-
<th
|
|
69
|
-
className={cn(
|
|
70
|
-
"h-10 whitespace-nowrap px-2 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0",
|
|
71
|
-
className
|
|
72
|
-
)}
|
|
73
|
-
data-slot="table-head"
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
80
|
-
return (
|
|
81
|
-
<td
|
|
82
|
-
className={cn(
|
|
83
|
-
"whitespace-nowrap p-2 align-top [&:has([role=checkbox])]:pr-0",
|
|
84
|
-
className
|
|
85
|
-
)}
|
|
86
|
-
data-slot="table-cell"
|
|
87
|
-
{...props}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function TableCaption({
|
|
93
|
-
className,
|
|
94
|
-
...props
|
|
95
|
-
}: React.ComponentProps<"caption">) {
|
|
96
|
-
return (
|
|
97
|
-
<caption
|
|
98
|
-
className={cn("mt-4 text-muted-foreground text-sm", className)}
|
|
99
|
-
data-slot="table-caption"
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export {
|
|
106
|
-
Table,
|
|
107
|
-
TableHeader,
|
|
108
|
-
TableBody,
|
|
109
|
-
TableFooter,
|
|
110
|
-
TableHead,
|
|
111
|
-
TableRow,
|
|
112
|
-
TableCell,
|
|
113
|
-
TableCaption,
|
|
114
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
-
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
3
|
-
import type * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
|
|
7
|
-
function Tabs({
|
|
8
|
-
className,
|
|
9
|
-
orientation = "horizontal",
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
12
|
-
return (
|
|
13
|
-
<TabsPrimitive.Root
|
|
14
|
-
className={cn(
|
|
15
|
-
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
16
|
-
className
|
|
17
|
-
)}
|
|
18
|
-
data-orientation={orientation}
|
|
19
|
-
data-slot="tabs"
|
|
20
|
-
{...props}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const tabsListVariants = cva(
|
|
26
|
-
"group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground data-[variant=line]:rounded-none group-data-[orientation=vertical]/tabs:h-fit group-data-horizontal/tabs:h-9 group-data-[orientation=vertical]/tabs:flex-col",
|
|
27
|
-
{
|
|
28
|
-
variants: {
|
|
29
|
-
variant: {
|
|
30
|
-
default: "bg-muted",
|
|
31
|
-
line: "gap-1 bg-transparent",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
defaultVariants: {
|
|
35
|
-
variant: "default",
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
function TabsList({
|
|
41
|
-
className,
|
|
42
|
-
variant = "default",
|
|
43
|
-
...props
|
|
44
|
-
}: React.ComponentProps<typeof TabsPrimitive.List> &
|
|
45
|
-
VariantProps<typeof tabsListVariants>) {
|
|
46
|
-
return (
|
|
47
|
-
<TabsPrimitive.List
|
|
48
|
-
className={cn(tabsListVariants({ variant }), className)}
|
|
49
|
-
data-slot="tabs-list"
|
|
50
|
-
data-variant={variant}
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function TabsTrigger({
|
|
57
|
-
className,
|
|
58
|
-
...props
|
|
59
|
-
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
60
|
-
return (
|
|
61
|
-
<TabsPrimitive.Trigger
|
|
62
|
-
className={cn(
|
|
63
|
-
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md border border-transparent px-2 py-1 font-medium text-foreground/60 text-sm transition-all hover:text-foreground focus-visible:border-ring focus-visible:outline-1 focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
64
|
-
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
65
|
-
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
66
|
-
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=horizontal]/tabs:after:-bottom-1.25 group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
67
|
-
className
|
|
68
|
-
)}
|
|
69
|
-
data-slot="tabs-trigger"
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function TabsContent({
|
|
76
|
-
className,
|
|
77
|
-
...props
|
|
78
|
-
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
79
|
-
return (
|
|
80
|
-
<TabsPrimitive.Content
|
|
81
|
-
className={cn("flex-1 text-sm outline-none", className)}
|
|
82
|
-
data-slot="tabs-content"
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
-
import type * as React from "react";
|
|
3
|
-
import { cn } from "@/lib/utils";
|
|
4
|
-
|
|
5
|
-
const textareaVariants = cva(
|
|
6
|
-
"field-sizing-content flex min-h-16 w-full resize-none rounded-xl border border-input px-3 py-3 text-base outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring aria-invalid:ring-destructive md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive",
|
|
7
|
-
{
|
|
8
|
-
variants: {
|
|
9
|
-
variant: {
|
|
10
|
-
default: "bg-input/30",
|
|
11
|
-
inverted: "bg-background",
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
defaultVariants: {
|
|
15
|
-
variant: "default",
|
|
16
|
-
},
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
function Textarea({
|
|
21
|
-
className,
|
|
22
|
-
variant = "default",
|
|
23
|
-
...props
|
|
24
|
-
}: React.ComponentProps<"textarea"> & VariantProps<typeof textareaVariants>) {
|
|
25
|
-
return (
|
|
26
|
-
<textarea
|
|
27
|
-
className={cn(textareaVariants({ variant, className }))}
|
|
28
|
-
data-slot="textarea"
|
|
29
|
-
data-variant={variant}
|
|
30
|
-
{...props}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { Textarea, textareaVariants };
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { VariantProps } from "class-variance-authority";
|
|
2
|
-
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
3
|
-
import {
|
|
4
|
-
type ComponentProps,
|
|
5
|
-
type CSSProperties,
|
|
6
|
-
createContext,
|
|
7
|
-
useContext,
|
|
8
|
-
} from "react";
|
|
9
|
-
import { toggleVariants } from "@/components/ui/toggle";
|
|
10
|
-
import { cn } from "@/lib/utils";
|
|
11
|
-
|
|
12
|
-
const ToggleGroupContext = createContext<
|
|
13
|
-
VariantProps<typeof toggleVariants> & {
|
|
14
|
-
spacing?: number;
|
|
15
|
-
orientation?: "horizontal" | "vertical";
|
|
16
|
-
}
|
|
17
|
-
>({
|
|
18
|
-
size: "default",
|
|
19
|
-
variant: "default",
|
|
20
|
-
spacing: 0,
|
|
21
|
-
orientation: "horizontal",
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
function ToggleGroup({
|
|
25
|
-
className,
|
|
26
|
-
variant,
|
|
27
|
-
size,
|
|
28
|
-
spacing = 0,
|
|
29
|
-
orientation = "horizontal",
|
|
30
|
-
children,
|
|
31
|
-
...props
|
|
32
|
-
}: ComponentProps<typeof ToggleGroupPrimitive.Root> &
|
|
33
|
-
VariantProps<typeof toggleVariants> & {
|
|
34
|
-
spacing?: number;
|
|
35
|
-
orientation?: "horizontal" | "vertical";
|
|
36
|
-
}) {
|
|
37
|
-
return (
|
|
38
|
-
<ToggleGroupPrimitive.Root
|
|
39
|
-
className={cn(
|
|
40
|
-
"group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=0]:data-[variant=outline]:shadow-xs data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",
|
|
41
|
-
className
|
|
42
|
-
)}
|
|
43
|
-
data-orientation={orientation}
|
|
44
|
-
data-size={size}
|
|
45
|
-
data-slot="toggle-group"
|
|
46
|
-
data-spacing={spacing}
|
|
47
|
-
data-variant={variant}
|
|
48
|
-
style={{ "--gap": spacing } as CSSProperties}
|
|
49
|
-
{...props}
|
|
50
|
-
>
|
|
51
|
-
<ToggleGroupContext.Provider
|
|
52
|
-
value={{ variant, size, spacing, orientation }}
|
|
53
|
-
>
|
|
54
|
-
{children}
|
|
55
|
-
</ToggleGroupContext.Provider>
|
|
56
|
-
</ToggleGroupPrimitive.Root>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function ToggleGroupItem({
|
|
61
|
-
className,
|
|
62
|
-
children,
|
|
63
|
-
variant = "default",
|
|
64
|
-
size = "default",
|
|
65
|
-
...props
|
|
66
|
-
}: ComponentProps<typeof ToggleGroupPrimitive.Item> &
|
|
67
|
-
VariantProps<typeof toggleVariants>) {
|
|
68
|
-
const context = useContext(ToggleGroupContext);
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<ToggleGroupPrimitive.Item
|
|
72
|
-
className={cn(
|
|
73
|
-
"shrink-0 focus:z-10 focus-visible:z-10 data-[state=on]:bg-muted group-data-[spacing=0]/toggle-group:rounded-none group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:shadow-none group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md",
|
|
74
|
-
toggleVariants({
|
|
75
|
-
variant: context.variant || variant,
|
|
76
|
-
size: context.size || size,
|
|
77
|
-
}),
|
|
78
|
-
className
|
|
79
|
-
)}
|
|
80
|
-
data-size={context.size || size}
|
|
81
|
-
data-slot="toggle-group-item"
|
|
82
|
-
data-spacing={context.spacing}
|
|
83
|
-
data-variant={context.variant || variant}
|
|
84
|
-
{...props}
|
|
85
|
-
>
|
|
86
|
-
{children}
|
|
87
|
-
</ToggleGroupPrimitive.Item>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
-
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
3
|
-
import type * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
|
|
7
|
-
const toggleVariants = cva(
|
|
8
|
-
"group/toggle inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-pressed:bg-muted aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: "bg-transparent",
|
|
13
|
-
outline: "border border-input bg-transparent shadow-xs hover:bg-muted",
|
|
14
|
-
},
|
|
15
|
-
size: {
|
|
16
|
-
default: "h-9 min-w-9 px-2",
|
|
17
|
-
sm: "h-8 min-w-8 px-1.5",
|
|
18
|
-
lg: "h-10 min-w-10 px-2.5",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
defaultVariants: {
|
|
22
|
-
variant: "default",
|
|
23
|
-
size: "default",
|
|
24
|
-
},
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
function Toggle({
|
|
29
|
-
className,
|
|
30
|
-
variant = "default",
|
|
31
|
-
size = "default",
|
|
32
|
-
...props
|
|
33
|
-
}: React.ComponentProps<typeof TogglePrimitive.Root> &
|
|
34
|
-
VariantProps<typeof toggleVariants>) {
|
|
35
|
-
return (
|
|
36
|
-
<TogglePrimitive.Root
|
|
37
|
-
className={cn(toggleVariants({ variant, size, className }))}
|
|
38
|
-
data-slot="toggle"
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { Toggle, toggleVariants };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
2
|
-
import type * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils";
|
|
5
|
-
|
|
6
|
-
function TooltipProvider({
|
|
7
|
-
delayDuration = 0,
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
10
|
-
return (
|
|
11
|
-
<TooltipPrimitive.Provider
|
|
12
|
-
data-slot="tooltip-provider"
|
|
13
|
-
delayDuration={delayDuration}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function Tooltip({
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
22
|
-
return (
|
|
23
|
-
<TooltipProvider>
|
|
24
|
-
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
25
|
-
</TooltipProvider>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function TooltipTrigger({
|
|
30
|
-
...props
|
|
31
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
32
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function TooltipContent({
|
|
36
|
-
className,
|
|
37
|
-
sideOffset = 0,
|
|
38
|
-
children,
|
|
39
|
-
...props
|
|
40
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
41
|
-
return (
|
|
42
|
-
<TooltipPrimitive.Portal>
|
|
43
|
-
<TooltipPrimitive.Content
|
|
44
|
-
className={cn(
|
|
45
|
-
"data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) rounded-md bg-foreground px-3 py-1.5 text-background text-xs data-[state=delayed-open]:animate-in data-closed:animate-out data-open:animate-in",
|
|
46
|
-
className
|
|
47
|
-
)}
|
|
48
|
-
data-slot="tooltip-content"
|
|
49
|
-
sideOffset={sideOffset}
|
|
50
|
-
{...props}
|
|
51
|
-
>
|
|
52
|
-
{children}
|
|
53
|
-
<TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" />
|
|
54
|
-
</TooltipPrimitive.Content>
|
|
55
|
-
</TooltipPrimitive.Portal>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|