@arch-cadre/ui 0.0.45 → 0.0.48
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 +6 -3
- package/build.config.js +0 -22
- package/build.config.ts +0 -23
- package/components.json +0 -20
- package/postcss.config.mjs +0 -6
- package/scripts/switchToDist.js +0 -55
- package/scripts/switchToSrc.js +0 -52
- package/src/components/.gitkeep +0 -0
- package/src/components/accordion.tsx +0 -66
- package/src/components/alert-dialog.tsx +0 -157
- package/src/components/alert.tsx +0 -66
- package/src/components/aspect-ratio.tsx +0 -12
- package/src/components/avatar.tsx +0 -53
- package/src/components/badge.tsx +0 -46
- package/src/components/breadcrumb.tsx +0 -111
- package/src/components/button-group.tsx +0 -86
- package/src/components/button.tsx +0 -62
- package/src/components/calendar.tsx +0 -220
- package/src/components/card.tsx +0 -92
- package/src/components/checkbox.tsx +0 -32
- package/src/components/collapsible.tsx +0 -34
- package/src/components/command.tsx +0 -184
- package/src/components/context-menu.tsx +0 -252
- package/src/components/dialog.tsx +0 -143
- package/src/components/drawer.tsx +0 -135
- package/src/components/dropdown-menu.tsx +0 -257
- package/src/components/empty.tsx +0 -105
- package/src/components/field.tsx +0 -251
- package/src/components/form.tsx +0 -170
- package/src/components/hover-card.tsx +0 -44
- package/src/components/input-group.tsx +0 -170
- package/src/components/input-otp.tsx +0 -77
- package/src/components/input.tsx +0 -21
- package/src/components/item.tsx +0 -193
- package/src/components/kbd.tsx +0 -29
- package/src/components/label.tsx +0 -24
- package/src/components/language-switcher.tsx +0 -49
- package/src/components/menubar.tsx +0 -276
- package/src/components/navigation-menu.tsx +0 -168
- package/src/components/pagination.tsx +0 -130
- package/src/components/popover.tsx +0 -48
- package/src/components/progress.tsx +0 -31
- package/src/components/radio-group.tsx +0 -45
- package/src/components/scroll-area.tsx +0 -67
- package/src/components/select.tsx +0 -190
- package/src/components/separator.tsx +0 -28
- package/src/components/sheet.tsx +0 -139
- package/src/components/sidebar.tsx +0 -726
- package/src/components/skeleton.tsx +0 -14
- package/src/components/slider.tsx +0 -63
- package/src/components/sonner.tsx +0 -41
- package/src/components/spinner.tsx +0 -17
- package/src/components/switch.tsx +0 -31
- package/src/components/table.tsx +0 -116
- package/src/components/tabs.tsx +0 -66
- package/src/components/textarea.tsx +0 -18
- package/src/components/toggle-group.tsx +0 -83
- package/src/components/toggle.tsx +0 -47
- package/src/components/tooltip.tsx +0 -61
- package/src/hooks/.gitkeep +0 -0
- package/src/hooks/use-mobile.ts +0 -21
- package/src/hooks/use-user.ts +0 -27
- package/src/index.ts +0 -15
- package/src/lib/utils.ts +0 -6
- package/src/logo.tsx +0 -49
- package/src/postcss.config.mjs +0 -6
- package/src/providers/auth-provider.tsx +0 -66
- package/src/providers/index.tsx +0 -50
- package/src/shared/access-denied.tsx +0 -31
- package/src/shared/loader.tsx +0 -109
- package/src/shared/page-loader.tsx +0 -24
- package/src/shared/scroll-fade-effect.tsx +0 -23
- package/src/styles/globals.css +0 -314
- package/tsconfig.json +0 -25
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cn } from "../lib/utils";
|
|
3
|
-
|
|
4
|
-
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
|
|
5
|
-
return (
|
|
6
|
-
<div
|
|
7
|
-
data-slot="skeleton"
|
|
8
|
-
className={cn("bg-accent animate-pulse rounded-md", className)}
|
|
9
|
-
{...props}
|
|
10
|
-
/>
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { Skeleton };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Slider as SliderPrimitive } from "radix-ui";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../lib/utils";
|
|
7
|
-
|
|
8
|
-
function Slider({
|
|
9
|
-
className,
|
|
10
|
-
defaultValue,
|
|
11
|
-
value,
|
|
12
|
-
min = 0,
|
|
13
|
-
max = 100,
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
|
|
16
|
-
const _values = React.useMemo(
|
|
17
|
-
() =>
|
|
18
|
-
Array.isArray(value)
|
|
19
|
-
? value
|
|
20
|
-
: Array.isArray(defaultValue)
|
|
21
|
-
? defaultValue
|
|
22
|
-
: [min, max],
|
|
23
|
-
[value, defaultValue, min, max],
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<SliderPrimitive.Root
|
|
28
|
-
data-slot="slider"
|
|
29
|
-
defaultValue={defaultValue}
|
|
30
|
-
value={value}
|
|
31
|
-
min={min}
|
|
32
|
-
max={max}
|
|
33
|
-
className={cn(
|
|
34
|
-
"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",
|
|
35
|
-
className,
|
|
36
|
-
)}
|
|
37
|
-
{...props}
|
|
38
|
-
>
|
|
39
|
-
<SliderPrimitive.Track
|
|
40
|
-
data-slot="slider-track"
|
|
41
|
-
className={cn(
|
|
42
|
-
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
|
|
43
|
-
)}
|
|
44
|
-
>
|
|
45
|
-
<SliderPrimitive.Range
|
|
46
|
-
data-slot="slider-range"
|
|
47
|
-
className={cn(
|
|
48
|
-
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full",
|
|
49
|
-
)}
|
|
50
|
-
/>
|
|
51
|
-
</SliderPrimitive.Track>
|
|
52
|
-
{Array.from({ length: _values.length }, (_, index) => (
|
|
53
|
-
<SliderPrimitive.Thumb
|
|
54
|
-
data-slot="slider-thumb"
|
|
55
|
-
key={index}
|
|
56
|
-
className="border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
57
|
-
/>
|
|
58
|
-
))}
|
|
59
|
-
</SliderPrimitive.Root>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { Slider };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
CircleCheckIcon,
|
|
5
|
-
InfoIcon,
|
|
6
|
-
Loader2Icon,
|
|
7
|
-
OctagonXIcon,
|
|
8
|
-
TriangleAlertIcon,
|
|
9
|
-
} from "lucide-react";
|
|
10
|
-
import { useTheme } from "next-themes";
|
|
11
|
-
import * as React from "react";
|
|
12
|
-
import { Toaster as Sonner, type ToasterProps } from "sonner";
|
|
13
|
-
|
|
14
|
-
const Toaster = ({ ...props }: ToasterProps) => {
|
|
15
|
-
const { theme = "system" } = useTheme();
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<Sonner
|
|
19
|
-
theme={theme as ToasterProps["theme"]}
|
|
20
|
-
className="toaster group"
|
|
21
|
-
icons={{
|
|
22
|
-
success: <CircleCheckIcon className="size-4" />,
|
|
23
|
-
info: <InfoIcon className="size-4" />,
|
|
24
|
-
warning: <TriangleAlertIcon className="size-4" />,
|
|
25
|
-
error: <OctagonXIcon className="size-4" />,
|
|
26
|
-
loading: <Loader2Icon className="size-4 animate-spin" />,
|
|
27
|
-
}}
|
|
28
|
-
style={
|
|
29
|
-
{
|
|
30
|
-
"--normal-bg": "var(--popover)",
|
|
31
|
-
"--normal-text": "var(--popover-foreground)",
|
|
32
|
-
"--normal-border": "var(--border)",
|
|
33
|
-
"--border-radius": "var(--radius)",
|
|
34
|
-
} as React.CSSProperties
|
|
35
|
-
}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export { Toaster };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Loader2Icon } from "lucide-react";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
|
|
6
|
-
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
|
|
7
|
-
return (
|
|
8
|
-
<Loader2Icon
|
|
9
|
-
role="status"
|
|
10
|
-
aria-label="Loading"
|
|
11
|
-
className={cn("size-4 animate-spin", className)}
|
|
12
|
-
{...props}
|
|
13
|
-
/>
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { Spinner };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../lib/utils";
|
|
7
|
-
|
|
8
|
-
function Switch({
|
|
9
|
-
className,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof SwitchPrimitive.Root>) {
|
|
12
|
-
return (
|
|
13
|
-
<SwitchPrimitive.Root
|
|
14
|
-
data-slot="switch"
|
|
15
|
-
className={cn(
|
|
16
|
-
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
17
|
-
className,
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
>
|
|
21
|
-
<SwitchPrimitive.Thumb
|
|
22
|
-
data-slot="switch-thumb"
|
|
23
|
-
className={cn(
|
|
24
|
-
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0",
|
|
25
|
-
)}
|
|
26
|
-
/>
|
|
27
|
-
</SwitchPrimitive.Root>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { Switch };
|
package/src/components/table.tsx
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../lib/utils";
|
|
6
|
-
|
|
7
|
-
function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
8
|
-
return (
|
|
9
|
-
<div
|
|
10
|
-
data-slot="table-container"
|
|
11
|
-
className="relative w-full overflow-x-auto"
|
|
12
|
-
>
|
|
13
|
-
<table
|
|
14
|
-
data-slot="table"
|
|
15
|
-
className={cn("w-full caption-bottom text-sm", className)}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
23
|
-
return (
|
|
24
|
-
<thead
|
|
25
|
-
data-slot="table-header"
|
|
26
|
-
className={cn("[&_tr]:border-b", className)}
|
|
27
|
-
{...props}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
33
|
-
return (
|
|
34
|
-
<tbody
|
|
35
|
-
data-slot="table-body"
|
|
36
|
-
className={cn("[&_tr:last-child]:border-0", className)}
|
|
37
|
-
{...props}
|
|
38
|
-
/>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
43
|
-
return (
|
|
44
|
-
<tfoot
|
|
45
|
-
data-slot="table-footer"
|
|
46
|
-
className={cn(
|
|
47
|
-
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
|
|
48
|
-
className,
|
|
49
|
-
)}
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
56
|
-
return (
|
|
57
|
-
<tr
|
|
58
|
-
data-slot="table-row"
|
|
59
|
-
className={cn(
|
|
60
|
-
"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
|
|
61
|
-
className,
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
69
|
-
return (
|
|
70
|
-
<th
|
|
71
|
-
data-slot="table-head"
|
|
72
|
-
className={cn(
|
|
73
|
-
"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
74
|
-
className,
|
|
75
|
-
)}
|
|
76
|
-
{...props}
|
|
77
|
-
/>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
82
|
-
return (
|
|
83
|
-
<td
|
|
84
|
-
data-slot="table-cell"
|
|
85
|
-
className={cn(
|
|
86
|
-
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
87
|
-
className,
|
|
88
|
-
)}
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function TableCaption({
|
|
95
|
-
className,
|
|
96
|
-
...props
|
|
97
|
-
}: React.ComponentProps<"caption">) {
|
|
98
|
-
return (
|
|
99
|
-
<caption
|
|
100
|
-
data-slot="table-caption"
|
|
101
|
-
className={cn("text-muted-foreground mt-4 text-sm", className)}
|
|
102
|
-
{...props}
|
|
103
|
-
/>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export {
|
|
108
|
-
Table,
|
|
109
|
-
TableHeader,
|
|
110
|
-
TableBody,
|
|
111
|
-
TableFooter,
|
|
112
|
-
TableHead,
|
|
113
|
-
TableRow,
|
|
114
|
-
TableCell,
|
|
115
|
-
TableCaption,
|
|
116
|
-
};
|
package/src/components/tabs.tsx
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../lib/utils";
|
|
7
|
-
|
|
8
|
-
function Tabs({
|
|
9
|
-
className,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
12
|
-
return (
|
|
13
|
-
<TabsPrimitive.Root
|
|
14
|
-
data-slot="tabs"
|
|
15
|
-
className={cn("flex flex-col gap-2", className)}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function TabsList({
|
|
22
|
-
className,
|
|
23
|
-
...props
|
|
24
|
-
}: React.ComponentProps<typeof TabsPrimitive.List>) {
|
|
25
|
-
return (
|
|
26
|
-
<TabsPrimitive.List
|
|
27
|
-
data-slot="tabs-list"
|
|
28
|
-
className={cn(
|
|
29
|
-
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
|
|
30
|
-
className,
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function TabsTrigger({
|
|
38
|
-
className,
|
|
39
|
-
...props
|
|
40
|
-
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
41
|
-
return (
|
|
42
|
-
<TabsPrimitive.Trigger
|
|
43
|
-
data-slot="tabs-trigger"
|
|
44
|
-
className={cn(
|
|
45
|
-
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
46
|
-
className,
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function TabsContent({
|
|
54
|
-
className,
|
|
55
|
-
...props
|
|
56
|
-
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
57
|
-
return (
|
|
58
|
-
<TabsPrimitive.Content
|
|
59
|
-
data-slot="tabs-content"
|
|
60
|
-
className={cn("flex-1 outline-none", className)}
|
|
61
|
-
{...props}
|
|
62
|
-
/>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../lib/utils";
|
|
4
|
-
|
|
5
|
-
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
|
6
|
-
return (
|
|
7
|
-
<textarea
|
|
8
|
-
data-slot="textarea"
|
|
9
|
-
className={cn(
|
|
10
|
-
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
11
|
-
className,
|
|
12
|
-
)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { Textarea };
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import type { VariantProps } from "class-variance-authority";
|
|
4
|
-
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
|
|
7
|
-
import { cn } from "../lib/utils";
|
|
8
|
-
import { toggleVariants } from "./toggle";
|
|
9
|
-
|
|
10
|
-
const ToggleGroupContext = React.createContext<
|
|
11
|
-
VariantProps<typeof toggleVariants> & {
|
|
12
|
-
spacing?: number;
|
|
13
|
-
}
|
|
14
|
-
>({
|
|
15
|
-
size: "default",
|
|
16
|
-
variant: "default",
|
|
17
|
-
spacing: 0,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
function ToggleGroup({
|
|
21
|
-
className,
|
|
22
|
-
variant,
|
|
23
|
-
size,
|
|
24
|
-
spacing = 0,
|
|
25
|
-
children,
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
|
|
28
|
-
VariantProps<typeof toggleVariants> & {
|
|
29
|
-
spacing?: number;
|
|
30
|
-
}) {
|
|
31
|
-
return (
|
|
32
|
-
<ToggleGroupPrimitive.Root
|
|
33
|
-
data-slot="toggle-group"
|
|
34
|
-
data-variant={variant}
|
|
35
|
-
data-size={size}
|
|
36
|
-
data-spacing={spacing}
|
|
37
|
-
style={{ "--gap": spacing } as React.CSSProperties}
|
|
38
|
-
className={cn(
|
|
39
|
-
"group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",
|
|
40
|
-
className,
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
<ToggleGroupContext.Provider value={{ variant, size, spacing }}>
|
|
45
|
-
{children}
|
|
46
|
-
</ToggleGroupContext.Provider>
|
|
47
|
-
</ToggleGroupPrimitive.Root>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function ToggleGroupItem({
|
|
52
|
-
className,
|
|
53
|
-
children,
|
|
54
|
-
variant,
|
|
55
|
-
size,
|
|
56
|
-
...props
|
|
57
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
|
|
58
|
-
VariantProps<typeof toggleVariants>) {
|
|
59
|
-
const context = React.useContext(ToggleGroupContext);
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<ToggleGroupPrimitive.Item
|
|
63
|
-
data-slot="toggle-group-item"
|
|
64
|
-
data-variant={context.variant || variant}
|
|
65
|
-
data-size={context.size || size}
|
|
66
|
-
data-spacing={context.spacing}
|
|
67
|
-
className={cn(
|
|
68
|
-
toggleVariants({
|
|
69
|
-
variant: context.variant || variant,
|
|
70
|
-
size: context.size || size,
|
|
71
|
-
}),
|
|
72
|
-
"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10",
|
|
73
|
-
"data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
|
|
74
|
-
className,
|
|
75
|
-
)}
|
|
76
|
-
{...props}
|
|
77
|
-
>
|
|
78
|
-
{children}
|
|
79
|
-
</ToggleGroupPrimitive.Item>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
-
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
|
|
7
|
-
import { cn } from "../lib/utils";
|
|
8
|
-
|
|
9
|
-
const toggleVariants = cva(
|
|
10
|
-
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
11
|
-
{
|
|
12
|
-
variants: {
|
|
13
|
-
variant: {
|
|
14
|
-
default: "bg-transparent",
|
|
15
|
-
outline:
|
|
16
|
-
"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
default: "h-9 px-2 min-w-9",
|
|
20
|
-
sm: "h-8 px-1.5 min-w-8",
|
|
21
|
-
lg: "h-10 px-2.5 min-w-10",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
defaultVariants: {
|
|
25
|
-
variant: "default",
|
|
26
|
-
size: "default",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
function Toggle({
|
|
32
|
-
className,
|
|
33
|
-
variant,
|
|
34
|
-
size,
|
|
35
|
-
...props
|
|
36
|
-
}: React.ComponentProps<typeof TogglePrimitive.Root> &
|
|
37
|
-
VariantProps<typeof toggleVariants>) {
|
|
38
|
-
return (
|
|
39
|
-
<TogglePrimitive.Root
|
|
40
|
-
data-slot="toggle"
|
|
41
|
-
className={cn(toggleVariants({ variant, size, className }))}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export { Toggle, toggleVariants };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../lib/utils";
|
|
7
|
-
|
|
8
|
-
function TooltipProvider({
|
|
9
|
-
delayDuration = 0,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
12
|
-
return (
|
|
13
|
-
<TooltipPrimitive.Provider
|
|
14
|
-
data-slot="tooltip-provider"
|
|
15
|
-
delayDuration={delayDuration}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function Tooltip({
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
24
|
-
return (
|
|
25
|
-
<TooltipProvider>
|
|
26
|
-
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
27
|
-
</TooltipProvider>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function TooltipTrigger({
|
|
32
|
-
...props
|
|
33
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
34
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function TooltipContent({
|
|
38
|
-
className,
|
|
39
|
-
sideOffset = 0,
|
|
40
|
-
children,
|
|
41
|
-
...props
|
|
42
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
43
|
-
return (
|
|
44
|
-
<TooltipPrimitive.Portal>
|
|
45
|
-
<TooltipPrimitive.Content
|
|
46
|
-
data-slot="tooltip-content"
|
|
47
|
-
sideOffset={sideOffset}
|
|
48
|
-
className={cn(
|
|
49
|
-
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=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 origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
50
|
-
className,
|
|
51
|
-
)}
|
|
52
|
-
{...props}
|
|
53
|
-
>
|
|
54
|
-
{children}
|
|
55
|
-
<TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
|
|
56
|
-
</TooltipPrimitive.Content>
|
|
57
|
-
</TooltipPrimitive.Portal>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
package/src/hooks/.gitkeep
DELETED
|
File without changes
|
package/src/hooks/use-mobile.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
const MOBILE_BREAKPOINT = 768;
|
|
4
|
-
|
|
5
|
-
export function useIsMobile() {
|
|
6
|
-
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(
|
|
7
|
-
undefined,
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
12
|
-
const onChange = () => {
|
|
13
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
14
|
-
};
|
|
15
|
-
mql.addEventListener("change", onChange);
|
|
16
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
17
|
-
return () => mql.removeEventListener("change", onChange);
|
|
18
|
-
}, []);
|
|
19
|
-
|
|
20
|
-
return !!isMobile;
|
|
21
|
-
}
|
package/src/hooks/use-user.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { useContext } from "react";
|
|
4
|
-
import { AuthContext } from "../providers/auth-provider";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Hook for user management.
|
|
8
|
-
* @returns Returns an object with user data and functions for managing it.
|
|
9
|
-
*/
|
|
10
|
-
export const useUser = () => {
|
|
11
|
-
const context = useContext(AuthContext);
|
|
12
|
-
if (!context) {
|
|
13
|
-
throw new Error("useUser must be used within AuthProvider");
|
|
14
|
-
}
|
|
15
|
-
const signOut = async () => {
|
|
16
|
-
// toast.promise(async () => await logoutAction(), {
|
|
17
|
-
// loading: t("Logging out..."),
|
|
18
|
-
// success: () => {
|
|
19
|
-
// return t("Logout successfull");
|
|
20
|
-
// },
|
|
21
|
-
// finally: () => {
|
|
22
|
-
// context.refetchUser();
|
|
23
|
-
// },
|
|
24
|
-
// });
|
|
25
|
-
};
|
|
26
|
-
return { ...context, signOut };
|
|
27
|
-
};
|
package/src/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { Icon } from "@iconify/react";
|
|
2
|
-
export { toast } from "sonner";
|
|
3
|
-
export * from "./components/avatar";
|
|
4
|
-
export * from "./components/badge";
|
|
5
|
-
export * from "./components/button";
|
|
6
|
-
export * from "./components/card";
|
|
7
|
-
export * from "./components/checkbox";
|
|
8
|
-
export * from "./components/dropdown-menu";
|
|
9
|
-
export * from "./components/input";
|
|
10
|
-
export * from "./components/label";
|
|
11
|
-
export * from "./components/language-switcher";
|
|
12
|
-
export * from "./components/skeleton";
|
|
13
|
-
export * from "./components/table";
|
|
14
|
-
export * from "./components/textarea";
|
|
15
|
-
export * from "./lib/utils";
|
package/src/lib/utils.ts
DELETED
package/src/logo.tsx
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
-
import type { VariantProps } from "class-variance-authority";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
import Image from "next/image";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { cn } from "./lib/utils";
|
|
7
|
-
|
|
8
|
-
const variants = cva("", {
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: "stroke-primary fill-primary",
|
|
12
|
-
primary: "stroke-primary fill-primary",
|
|
13
|
-
},
|
|
14
|
-
size: {
|
|
15
|
-
default: "",
|
|
16
|
-
sm: "h-auto w-10",
|
|
17
|
-
md: "h-auto w-16",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
defaultVariants: {
|
|
21
|
-
variant: "default",
|
|
22
|
-
size: "sm",
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export interface LogoProps
|
|
27
|
-
extends React.HTMLAttributes<HTMLDivElement>,
|
|
28
|
-
VariantProps<typeof variants> {
|
|
29
|
-
asChild?: boolean;
|
|
30
|
-
mode?: "full" | "short";
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function Logo({
|
|
34
|
-
className,
|
|
35
|
-
asChild = false,
|
|
36
|
-
...props
|
|
37
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof variants> & LogoProps) {
|
|
38
|
-
const Comp = asChild ? Slot : "div";
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<Comp {...props} className={cn("flex items-center space-x-2", className)}>
|
|
42
|
-
<Image src="/logo.svg" alt="alt" height={24.69} width={164} />
|
|
43
|
-
</Comp>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
Logo.displayName = "Logo";
|
|
48
|
-
|
|
49
|
-
export { Logo, variants };
|