@arch-cadre/ui 0.0.44 → 0.0.45
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/build.config.js +22 -0
- package/dist/components/accordion.js +18 -0
- package/dist/components/alert-dialog.js +39 -0
- package/dist/components/alert.js +24 -0
- package/dist/components/aspect-ratio.js +7 -0
- package/dist/components/avatar.js +14 -0
- package/dist/components/badge.js +22 -0
- package/dist/components/breadcrumb.js +30 -0
- package/dist/components/button-group.js +28 -0
- package/dist/components/button.js +33 -0
- package/dist/components/calendar.js +76 -0
- package/dist/components/card.js +24 -0
- package/dist/components/checkbox.js +9 -0
- package/dist/components/collapsible.js +13 -0
- package/dist/components/command.js +34 -0
- package/dist/components/context-menu.js +51 -0
- package/dist/components/dialog.js +36 -0
- package/dist/components/drawer.js +35 -0
- package/dist/components/dropdown-menu.js +51 -0
- package/dist/components/empty.js +33 -0
- package/dist/components/field.js +78 -0
- package/dist/components/form.js +59 -0
- package/dist/components/hover-card.js +14 -0
- package/dist/components/input-group.js +63 -0
- package/dist/components/input-otp.js +21 -0
- package/dist/components/input.js +6 -0
- package/dist/components/item.js +66 -0
- package/dist/components/kbd.js +9 -0
- package/dist/components/label.js +8 -0
- package/dist/components/language-switcher.js +20 -0
- package/dist/components/menubar.js +54 -0
- package/dist/components/navigation-menu.js +31 -0
- package/dist/components/pagination.js +31 -0
- package/dist/components/popover.js +17 -0
- package/dist/components/progress.js +8 -0
- package/dist/components/radio-group.js +12 -0
- package/dist/components/scroll-area.js +13 -0
- package/dist/components/select.js +38 -0
- package/dist/components/separator.js +8 -0
- package/dist/components/sheet.js +40 -0
- package/dist/components/sidebar.js +213 -0
- package/dist/components/skeleton.js +6 -0
- package/dist/components/slider.js +14 -0
- package/dist/components/sonner.js +21 -0
- package/dist/components/spinner.js +7 -0
- package/dist/components/switch.js +8 -0
- package/dist/components/table.js +28 -0
- package/dist/components/tabs.js +17 -0
- package/dist/components/textarea.js +6 -0
- package/dist/components/toggle-group.js +22 -0
- package/dist/components/toggle.js +26 -0
- package/dist/components/tooltip.js +17 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/hooks/use-user.js +25 -0
- package/dist/lib/{utils.mjs → utils.js} +1 -1
- package/dist/logo.js +28 -0
- package/dist/postcss.config.mjs +1 -2
- package/dist/providers/auth-provider.js +27 -0
- package/dist/providers/index.js +23 -0
- package/dist/shared/access-denied.js +6 -0
- package/dist/shared/loader.js +41 -0
- package/dist/shared/page-loader.js +6 -0
- package/dist/shared/scroll-fade-effect.js +5 -0
- package/package.json +14 -20
- package/src/providers/index.tsx +1 -1
- package/tsconfig.json +3 -2
- package/dist/components/.gitkeep +0 -0
- package/dist/components/accordion.d.ts +0 -7
- package/dist/components/accordion.mjs +0 -58
- package/dist/components/alert-dialog.d.ts +0 -14
- package/dist/components/alert-dialog.mjs +0 -144
- package/dist/components/alert.d.ts +0 -9
- package/dist/components/alert.mjs +0 -62
- package/dist/components/aspect-ratio.d.ts +0 -4
- package/dist/components/aspect-ratio.mjs +0 -9
- package/dist/components/avatar.d.ts +0 -6
- package/dist/components/avatar.mjs +0 -50
- package/dist/components/badge.d.ts +0 -9
- package/dist/components/badge.mjs +0 -37
- package/dist/components/breadcrumb.d.ts +0 -11
- package/dist/components/breadcrumb.mjs +0 -105
- package/dist/components/button-group.d.ts +0 -13
- package/dist/components/button-group.mjs +0 -76
- package/dist/components/button.d.ts +0 -10
- package/dist/components/button.mjs +0 -51
- package/dist/components/calendar.d.ts +0 -8
- package/dist/components/calendar.mjs +0 -191
- package/dist/components/card.d.ts +0 -9
- package/dist/components/card.mjs +0 -90
- package/dist/components/checkbox.d.ts +0 -4
- package/dist/components/checkbox.mjs +0 -30
- package/dist/components/collapsible.d.ts +0 -6
- package/dist/components/collapsible.mjs +0 -31
- package/dist/components/command.d.ts +0 -18
- package/dist/components/command.mjs +0 -169
- package/dist/components/context-menu.d.ts +0 -25
- package/dist/components/context-menu.mjs +0 -218
- package/dist/components/dialog.d.ts +0 -15
- package/dist/components/dialog.mjs +0 -130
- package/dist/components/drawer.d.ts +0 -13
- package/dist/components/drawer.mjs +0 -124
- package/dist/components/dropdown-menu.d.ts +0 -25
- package/dist/components/dropdown-menu.mjs +0 -226
- package/dist/components/empty.d.ts +0 -12
- package/dist/components/empty.mjs +0 -102
- package/dist/components/field.d.ts +0 -25
- package/dist/components/field.mjs +0 -228
- package/dist/components/form.d.ts +0 -23
- package/dist/components/form.mjs +0 -123
- package/dist/components/hover-card.d.ts +0 -6
- package/dist/components/hover-card.mjs +0 -35
- package/dist/components/input-group.d.ts +0 -16
- package/dist/components/input-group.mjs +0 -155
- package/dist/components/input-otp.d.ts +0 -11
- package/dist/components/input-otp.mjs +0 -59
- package/dist/components/input.d.ts +0 -3
- package/dist/components/input.mjs +0 -19
- package/dist/components/item.d.ts +0 -23
- package/dist/components/item.mjs +0 -187
- package/dist/components/kbd.d.ts +0 -4
- package/dist/components/kbd.mjs +0 -28
- package/dist/components/label.d.ts +0 -4
- package/dist/components/label.mjs +0 -21
- package/dist/components/language-switcher.d.ts +0 -2
- package/dist/components/language-switcher.mjs +0 -30
- package/dist/components/menubar.d.ts +0 -26
- package/dist/components/menubar.mjs +0 -246
- package/dist/components/navigation-menu.d.ts +0 -14
- package/dist/components/navigation-menu.mjs +0 -166
- package/dist/components/pagination.d.ts +0 -15
- package/dist/components/pagination.mjs +0 -116
- package/dist/components/popover.d.ts +0 -7
- package/dist/components/popover.mjs +0 -40
- package/dist/components/progress.d.ts +0 -4
- package/dist/components/progress.mjs +0 -30
- package/dist/components/radio-group.d.ts +0 -5
- package/dist/components/radio-group.mjs +0 -43
- package/dist/components/scroll-area.d.ts +0 -7
- package/dist/components/scroll-area.mjs +0 -59
- package/dist/components/select.d.ts +0 -15
- package/dist/components/select.mjs +0 -173
- package/dist/components/separator.d.ts +0 -4
- package/dist/components/separator.mjs +0 -25
- package/dist/components/sheet.d.ts +0 -13
- package/dist/components/sheet.mjs +0 -119
- package/dist/components/sidebar.d.ts +0 -69
- package/dist/components/sidebar.mjs +0 -635
- package/dist/components/skeleton.d.ts +0 -3
- package/dist/components/skeleton.mjs +0 -13
- package/dist/components/slider.d.ts +0 -4
- package/dist/components/slider.mjs +0 -59
- package/dist/components/sonner.d.ts +0 -4
- package/dist/components/sonner.mjs +0 -36
- package/dist/components/spinner.d.ts +0 -3
- package/dist/components/spinner.mjs +0 -15
- package/dist/components/switch.d.ts +0 -4
- package/dist/components/switch.mjs +0 -30
- package/dist/components/table.d.ts +0 -10
- package/dist/components/table.mjs +0 -115
- package/dist/components/tabs.d.ts +0 -7
- package/dist/components/tabs.mjs +0 -63
- package/dist/components/textarea.d.ts +0 -3
- package/dist/components/textarea.mjs +0 -16
- package/dist/components/toggle-group.d.ts +0 -9
- package/dist/components/toggle-group.mjs +0 -65
- package/dist/components/toggle.d.ts +0 -9
- package/dist/components/toggle.mjs +0 -41
- package/dist/components/tooltip.d.ts +0 -7
- package/dist/components/tooltip.mjs +0 -49
- package/dist/hooks/.gitkeep +0 -0
- package/dist/hooks/use-mobile.d.ts +0 -1
- package/dist/hooks/use-mobile.mjs +0 -17
- package/dist/hooks/use-user.d.ts +0 -12
- package/dist/hooks/use-user.mjs +0 -12
- package/dist/index.mjs +0 -15
- package/dist/lib/utils.d.ts +0 -2
- package/dist/logo.d.ts +0 -15
- package/dist/logo.mjs +0 -32
- package/dist/postcss.config.d.mts +0 -3
- package/dist/providers/auth-provider.d.ts +0 -15
- package/dist/providers/auth-provider.mjs +0 -37
- package/dist/providers/index.d.ts +0 -7
- package/dist/providers/index.mjs +0 -33
- package/dist/shared/access-denied.d.ts +0 -2
- package/dist/shared/access-denied.mjs +0 -12
- package/dist/shared/loader.d.ts +0 -11
- package/dist/shared/loader.mjs +0 -98
- package/dist/shared/page-loader.d.ts +0 -7
- package/dist/shared/page-loader.mjs +0 -6
- package/dist/shared/scroll-fade-effect.d.ts +0 -4
- package/dist/shared/scroll-fade-effect.mjs +0 -20
- package/dist/styles/globals.css +0 -1
- /package/dist/{index.d.ts → index.js} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
function DropdownMenu({ ...props }) {
|
|
7
|
+
return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
8
|
+
}
|
|
9
|
+
function DropdownMenuPortal({ ...props }) {
|
|
10
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props }));
|
|
11
|
+
}
|
|
12
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
13
|
+
return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props }));
|
|
14
|
+
}
|
|
15
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
16
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className), ...props }) }));
|
|
17
|
+
}
|
|
18
|
+
function DropdownMenuGroup({ ...props }) {
|
|
19
|
+
return (_jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
|
|
20
|
+
}
|
|
21
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
22
|
+
return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
25
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
|
|
26
|
+
}
|
|
27
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
28
|
+
return (_jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
|
|
29
|
+
}
|
|
30
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
31
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
|
|
32
|
+
}
|
|
33
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
34
|
+
return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className), ...props }));
|
|
35
|
+
}
|
|
36
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
37
|
+
return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("bg-border -mx-1 my-1 h-px", className), ...props }));
|
|
38
|
+
}
|
|
39
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
40
|
+
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className), ...props }));
|
|
41
|
+
}
|
|
42
|
+
function DropdownMenuSub({ ...props }) {
|
|
43
|
+
return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
44
|
+
}
|
|
45
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
46
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto size-4" })] }));
|
|
47
|
+
}
|
|
48
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
49
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className), ...props }));
|
|
50
|
+
}
|
|
51
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
function Empty({ className, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "empty", className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12", className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
function EmptyHeader({ className, ...props }) {
|
|
8
|
+
return (_jsx("div", { "data-slot": "empty-header", className: cn("flex max-w-sm flex-col items-center gap-2 text-center", className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
const emptyMediaVariants = cva("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: "bg-transparent",
|
|
14
|
+
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
variant: "default",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
22
|
+
return (_jsx("div", { "data-slot": "empty-icon", "data-variant": variant, className: cn(emptyMediaVariants({ variant, className })), ...props }));
|
|
23
|
+
}
|
|
24
|
+
function EmptyTitle({ className, ...props }) {
|
|
25
|
+
return (_jsx("div", { "data-slot": "empty-title", className: cn("text-lg font-medium tracking-tight", className), ...props }));
|
|
26
|
+
}
|
|
27
|
+
function EmptyDescription({ className, ...props }) {
|
|
28
|
+
return (_jsx("div", { "data-slot": "empty-description", className: cn("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4", className), ...props }));
|
|
29
|
+
}
|
|
30
|
+
function EmptyContent({ className, ...props }) {
|
|
31
|
+
return (_jsx("div", { "data-slot": "empty-content", className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className), ...props }));
|
|
32
|
+
}
|
|
33
|
+
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** biome-ignore-all lint/a11y/useSemanticElements: <explanation> */
|
|
2
|
+
/** biome-ignore-all lint/suspicious/noArrayIndexKey: <explanation> */
|
|
3
|
+
"use client";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { useMemo } from "react";
|
|
7
|
+
import { cn } from "../lib/utils";
|
|
8
|
+
import { Label } from "./label";
|
|
9
|
+
import { Separator } from "./separator";
|
|
10
|
+
function FieldSet({ className, ...props }) {
|
|
11
|
+
return (_jsx("fieldset", { "data-slot": "field-set", className: cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
14
|
+
return (_jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
function FieldGroup({ className, ...props }) {
|
|
17
|
+
return (_jsx("div", { "data-slot": "field-group", className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4", className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
const fieldVariants = cva("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
|
|
20
|
+
variants: {
|
|
21
|
+
orientation: {
|
|
22
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
23
|
+
horizontal: [
|
|
24
|
+
"flex-row items-center",
|
|
25
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
26
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
27
|
+
],
|
|
28
|
+
responsive: [
|
|
29
|
+
"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
|
|
30
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
31
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
orientation: "vertical",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
40
|
+
return (_jsx("div", { role: "group", "data-slot": "field", "data-orientation": orientation, className: cn(fieldVariants({ orientation }), className), ...props }));
|
|
41
|
+
}
|
|
42
|
+
function FieldContent({ className, ...props }) {
|
|
43
|
+
return (_jsx("div", { "data-slot": "field-content", className: cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className), ...props }));
|
|
44
|
+
}
|
|
45
|
+
function FieldLabel({ className, ...props }) {
|
|
46
|
+
return (_jsx(Label, { "data-slot": "field-label", className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10", className), ...props }));
|
|
47
|
+
}
|
|
48
|
+
function FieldTitle({ className, ...props }) {
|
|
49
|
+
return (_jsx("div", { "data-slot": "field-label", className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className), ...props }));
|
|
50
|
+
}
|
|
51
|
+
function FieldDescription({ className, ...props }) {
|
|
52
|
+
return (_jsx("p", { "data-slot": "field-description", className: cn("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className), ...props }));
|
|
53
|
+
}
|
|
54
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
55
|
+
return (_jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className), ...props, children: [_jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && (_jsx("span", { className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2", "data-slot": "field-separator-content", children: children }))] }));
|
|
56
|
+
}
|
|
57
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
58
|
+
const content = useMemo(() => {
|
|
59
|
+
if (children) {
|
|
60
|
+
return children;
|
|
61
|
+
}
|
|
62
|
+
if (!errors?.length) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const uniqueErrors = [
|
|
66
|
+
...new Map(errors.map((error) => [error?.message, error])).values(),
|
|
67
|
+
];
|
|
68
|
+
if (uniqueErrors?.length === 1) {
|
|
69
|
+
return uniqueErrors[0]?.message;
|
|
70
|
+
}
|
|
71
|
+
return (_jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map((error, index) => error?.message && _jsx("li", { children: error.message }, index)) }));
|
|
72
|
+
}, [children, errors]);
|
|
73
|
+
if (!content) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn("text-destructive text-sm font-normal", className), ...props, children: content }));
|
|
77
|
+
}
|
|
78
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { Controller, FormProvider, useFormContext, useFormState, } from "react-hook-form";
|
|
6
|
+
import { cn } from "../lib/utils";
|
|
7
|
+
import { Label } from "./label";
|
|
8
|
+
const Form = FormProvider;
|
|
9
|
+
const FormFieldContext = React.createContext({});
|
|
10
|
+
const FormField = ({ ...props }) => {
|
|
11
|
+
return (_jsx(FormFieldContext.Provider, { value: { name: props.name }, children: _jsx(Controller, { ...props }) }));
|
|
12
|
+
};
|
|
13
|
+
const useFormField = () => {
|
|
14
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
15
|
+
const itemContext = React.useContext(FormItemContext);
|
|
16
|
+
const { getFieldState } = useFormContext();
|
|
17
|
+
const formState = useFormState({ name: fieldContext.name });
|
|
18
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
19
|
+
if (!fieldContext) {
|
|
20
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
21
|
+
}
|
|
22
|
+
const { id } = itemContext;
|
|
23
|
+
return {
|
|
24
|
+
id,
|
|
25
|
+
name: fieldContext.name,
|
|
26
|
+
formItemId: `${id}-form-item`,
|
|
27
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
28
|
+
formMessageId: `${id}-form-item-message`,
|
|
29
|
+
...fieldState,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const FormItemContext = React.createContext({});
|
|
33
|
+
function FormItem({ className, ...props }) {
|
|
34
|
+
const id = React.useId();
|
|
35
|
+
return (_jsx(FormItemContext.Provider, { value: { id }, children: _jsx("div", { "data-slot": "form-item", className: cn("grid gap-2", className), ...props }) }));
|
|
36
|
+
}
|
|
37
|
+
function FormLabel({ className, ...props }) {
|
|
38
|
+
const { error, formItemId } = useFormField();
|
|
39
|
+
return (_jsx(Label, { "data-slot": "form-label", "data-error": !!error, className: cn("data-[error=true]:text-destructive", className), htmlFor: formItemId, ...props }));
|
|
40
|
+
}
|
|
41
|
+
function FormControl({ ...props }) {
|
|
42
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
43
|
+
return (_jsx(SlotPrimitive.Slot, { "data-slot": "form-control", id: formItemId, "aria-describedby": !error
|
|
44
|
+
? `${formDescriptionId}`
|
|
45
|
+
: `${formDescriptionId} ${formMessageId}`, "aria-invalid": !!error, ...props }));
|
|
46
|
+
}
|
|
47
|
+
function FormDescription({ className, ...props }) {
|
|
48
|
+
const { formDescriptionId } = useFormField();
|
|
49
|
+
return (_jsx("p", { "data-slot": "form-description", id: formDescriptionId, className: cn("text-muted-foreground text-sm", className), ...props }));
|
|
50
|
+
}
|
|
51
|
+
function FormMessage({ className, ...props }) {
|
|
52
|
+
const { error, formMessageId } = useFormField();
|
|
53
|
+
const body = error ? String(error?.message ?? "") : props.children;
|
|
54
|
+
if (!body) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return (_jsx("p", { "data-slot": "form-message", id: formMessageId, className: cn("text-destructive text-sm", className), ...props, children: body }));
|
|
58
|
+
}
|
|
59
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { HoverCard as HoverCardPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
function HoverCard({ ...props }) {
|
|
6
|
+
return _jsx(HoverCardPrimitive.Root, { "data-slot": "hover-card", ...props });
|
|
7
|
+
}
|
|
8
|
+
function HoverCardTrigger({ ...props }) {
|
|
9
|
+
return (_jsx(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props }));
|
|
10
|
+
}
|
|
11
|
+
function HoverCardContent({ className, align = "center", sideOffset = 4, ...props }) {
|
|
12
|
+
return (_jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: _jsx(HoverCardPrimitive.Content, { "data-slot": "hover-card-content", align: align, sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className), ...props }) }));
|
|
13
|
+
}
|
|
14
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import { Button } from "./button";
|
|
6
|
+
import { Input } from "./input";
|
|
7
|
+
import { Textarea } from "./textarea";
|
|
8
|
+
function InputGroup({ className, ...props }) {
|
|
9
|
+
return (_jsx("div", { "data-slot": "input-group", role: "group", className: cn("group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none", "h-9 min-w-0 has-[>textarea]:h-auto",
|
|
10
|
+
// Variants based on alignment.
|
|
11
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
12
|
+
// Focus state.
|
|
13
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
|
|
14
|
+
// Error state.
|
|
15
|
+
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
const inputGroupAddonVariants = cva("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50", {
|
|
18
|
+
variants: {
|
|
19
|
+
align: {
|
|
20
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
21
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
22
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
23
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
align: "inline-start",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
31
|
+
return (_jsx("div", { role: "group", "data-slot": "input-group-addon", "data-align": align, className: cn(inputGroupAddonVariants({ align }), className), onClick: (e) => {
|
|
32
|
+
if (e.target.closest("button")) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
36
|
+
}, ...props }));
|
|
37
|
+
}
|
|
38
|
+
const inputGroupButtonVariants = cva("text-sm shadow-none flex gap-2 items-center", {
|
|
39
|
+
variants: {
|
|
40
|
+
size: {
|
|
41
|
+
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
42
|
+
sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
43
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
44
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
size: "xs",
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
|
52
|
+
return (_jsx(Button, { type: type, "data-size": size, variant: variant, className: cn(inputGroupButtonVariants({ size }), className), ...props }));
|
|
53
|
+
}
|
|
54
|
+
function InputGroupText({ className, ...props }) {
|
|
55
|
+
return (_jsx("span", { className: cn("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
56
|
+
}
|
|
57
|
+
function InputGroupInput({ className, ...props }) {
|
|
58
|
+
return (_jsx(Input, { "data-slot": "input-group-control", className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent", className), ...props }));
|
|
59
|
+
}
|
|
60
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
61
|
+
return (_jsx(Textarea, { "data-slot": "input-group-control", className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", className), ...props }));
|
|
62
|
+
}
|
|
63
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
|
4
|
+
import { MinusIcon } from "lucide-react";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { cn } from "../lib/utils";
|
|
7
|
+
function InputOTP({ className, containerClassName, ...props }) {
|
|
8
|
+
return (_jsx(OTPInput, { "data-slot": "input-otp", containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName), className: cn("disabled:cursor-not-allowed", className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function InputOTPGroup({ className, ...props }) {
|
|
11
|
+
return (_jsx("div", { "data-slot": "input-otp-group", className: cn("flex items-center", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function InputOTPSlot({ index, className, ...props }) {
|
|
14
|
+
const inputOTPContext = React.useContext(OTPInputContext);
|
|
15
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
16
|
+
return (_jsxs("div", { "data-slot": "input-otp-slot", "data-active": isActive, className: cn("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", className), ...props, children: [char, hasFakeCaret && (_jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: _jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) }))] }));
|
|
17
|
+
}
|
|
18
|
+
function InputOTPSeparator({ ...props }) {
|
|
19
|
+
return (_jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: _jsx(MinusIcon, {}) }));
|
|
20
|
+
}
|
|
21
|
+
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
function Input({ className, type, ...props }) {
|
|
4
|
+
return (_jsx("input", { type: type, "data-slot": "input", className: cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
export { Input };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import { Separator } from "./separator";
|
|
6
|
+
function ItemGroup({ className, ...props }) {
|
|
7
|
+
return (_jsx("div", { role: "list", "data-slot": "item-group", className: cn("group/item-group flex flex-col", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function ItemSeparator({ className, ...props }) {
|
|
10
|
+
return (_jsx(Separator, { "data-slot": "item-separator", orientation: "horizontal", className: cn("my-0", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
const itemVariants = cva("group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", {
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
default: "bg-transparent",
|
|
16
|
+
outline: "border-border",
|
|
17
|
+
muted: "bg-muted/50",
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "p-4 gap-4 ",
|
|
21
|
+
sm: "py-3 px-4 gap-2.5",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
size: "default",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
function Item({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
30
|
+
const Comp = asChild ? SlotPrimitive.Slot : "div";
|
|
31
|
+
return (_jsx(Comp, { "data-slot": "item", "data-variant": variant, "data-size": size, className: cn(itemVariants({ variant, size, className })), ...props }));
|
|
32
|
+
}
|
|
33
|
+
const itemMediaVariants = cva("flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5", {
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
default: "bg-transparent",
|
|
37
|
+
icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
38
|
+
image: "size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
variant: "default",
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
function ItemMedia({ className, variant = "default", ...props }) {
|
|
46
|
+
return (_jsx("div", { "data-slot": "item-media", "data-variant": variant, className: cn(itemMediaVariants({ variant, className })), ...props }));
|
|
47
|
+
}
|
|
48
|
+
function ItemContent({ className, ...props }) {
|
|
49
|
+
return (_jsx("div", { "data-slot": "item-content", className: cn("flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none", className), ...props }));
|
|
50
|
+
}
|
|
51
|
+
function ItemTitle({ className, ...props }) {
|
|
52
|
+
return (_jsx("div", { "data-slot": "item-title", className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium", className), ...props }));
|
|
53
|
+
}
|
|
54
|
+
function ItemDescription({ className, ...props }) {
|
|
55
|
+
return (_jsx("p", { "data-slot": "item-description", className: cn("text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className), ...props }));
|
|
56
|
+
}
|
|
57
|
+
function ItemActions({ className, ...props }) {
|
|
58
|
+
return (_jsx("div", { "data-slot": "item-actions", className: cn("flex items-center gap-2", className), ...props }));
|
|
59
|
+
}
|
|
60
|
+
function ItemHeader({ className, ...props }) {
|
|
61
|
+
return (_jsx("div", { "data-slot": "item-header", className: cn("flex basis-full items-center justify-between gap-2", className), ...props }));
|
|
62
|
+
}
|
|
63
|
+
function ItemFooter({ className, ...props }) {
|
|
64
|
+
return (_jsx("div", { "data-slot": "item-footer", className: cn("flex basis-full items-center justify-between gap-2", className), ...props }));
|
|
65
|
+
}
|
|
66
|
+
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
function Kbd({ className, ...props }) {
|
|
4
|
+
return (_jsx("kbd", { "data-slot": "kbd", className: cn("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none", "[&_svg:not([class*='size-'])]:size-3", "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10", className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
function KbdGroup({ className, ...props }) {
|
|
7
|
+
return (_jsx("kbd", { "data-slot": "kbd-group", className: cn("inline-flex items-center gap-1", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
export { Kbd, KbdGroup };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Label as LabelPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
function Label({ className, ...props }) {
|
|
6
|
+
return (_jsx(LabelPrimitive.Root, { "data-slot": "label", className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
export { Label };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { LOCALES, useLocale, useTranslation } from "@arch-cadre/intl";
|
|
4
|
+
import { Languages } from "lucide-react";
|
|
5
|
+
import { useRouter } from "next/navigation";
|
|
6
|
+
import { Button } from "./button";
|
|
7
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "./dropdown-menu";
|
|
8
|
+
export function LanguageSwitcher() {
|
|
9
|
+
const locale = useLocale();
|
|
10
|
+
const router = useRouter();
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const handleLanguageChange = (newLocale) => {
|
|
13
|
+
// Set cookie
|
|
14
|
+
// biome-ignore lint/suspicious/noDocumentCookie: <we want to set a cookie here>
|
|
15
|
+
document.cookie = `NEXT_LOCALE=${newLocale}; path=/; max-age=31536000; SameSite=Lax`;
|
|
16
|
+
// Refresh page to apply changes
|
|
17
|
+
router.refresh();
|
|
18
|
+
};
|
|
19
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "icon", className: "size-9", children: [_jsx(Languages, { className: "size-4" }), _jsx("span", { className: "sr-only", children: t("Switch language") })] }) }), _jsx(DropdownMenuContent, { align: "end", children: LOCALES.map((loc) => (_jsx(DropdownMenuItem, { onClick: () => handleLanguageChange(loc), className: locale === loc ? "font-bold" : "", children: loc }, loc))) })] }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
4
|
+
import { Menubar as MenubarPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
function Menubar({ className, ...props }) {
|
|
7
|
+
return (_jsx(MenubarPrimitive.Root, { "data-slot": "menubar", className: cn("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function MenubarMenu({ ...props }) {
|
|
10
|
+
return _jsx(MenubarPrimitive.Menu, { "data-slot": "menubar-menu", ...props });
|
|
11
|
+
}
|
|
12
|
+
function MenubarGroup({ ...props }) {
|
|
13
|
+
return _jsx(MenubarPrimitive.Group, { "data-slot": "menubar-group", ...props });
|
|
14
|
+
}
|
|
15
|
+
function MenubarPortal({ ...props }) {
|
|
16
|
+
return _jsx(MenubarPrimitive.Portal, { "data-slot": "menubar-portal", ...props });
|
|
17
|
+
}
|
|
18
|
+
function MenubarRadioGroup({ ...props }) {
|
|
19
|
+
return (_jsx(MenubarPrimitive.RadioGroup, { "data-slot": "menubar-radio-group", ...props }));
|
|
20
|
+
}
|
|
21
|
+
function MenubarTrigger({ className, ...props }) {
|
|
22
|
+
return (_jsx(MenubarPrimitive.Trigger, { "data-slot": "menubar-trigger", className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
function MenubarContent({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }) {
|
|
25
|
+
return (_jsx(MenubarPortal, { children: _jsx(MenubarPrimitive.Content, { "data-slot": "menubar-content", align: align, alignOffset: alignOffset, sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md", className), ...props }) }));
|
|
26
|
+
}
|
|
27
|
+
function MenubarItem({ className, inset, variant = "default", ...props }) {
|
|
28
|
+
return (_jsx(MenubarPrimitive.Item, { "data-slot": "menubar-item", "data-inset": inset, "data-variant": variant, className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
29
|
+
}
|
|
30
|
+
function MenubarCheckboxItem({ className, children, checked, ...props }) {
|
|
31
|
+
return (_jsxs(MenubarPrimitive.CheckboxItem, { "data-slot": "menubar-checkbox-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(MenubarPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
|
|
32
|
+
}
|
|
33
|
+
function MenubarRadioItem({ className, children, ...props }) {
|
|
34
|
+
return (_jsxs(MenubarPrimitive.RadioItem, { "data-slot": "menubar-radio-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(MenubarPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
|
|
35
|
+
}
|
|
36
|
+
function MenubarLabel({ className, inset, ...props }) {
|
|
37
|
+
return (_jsx(MenubarPrimitive.Label, { "data-slot": "menubar-label", "data-inset": inset, className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className), ...props }));
|
|
38
|
+
}
|
|
39
|
+
function MenubarSeparator({ className, ...props }) {
|
|
40
|
+
return (_jsx(MenubarPrimitive.Separator, { "data-slot": "menubar-separator", className: cn("bg-border -mx-1 my-1 h-px", className), ...props }));
|
|
41
|
+
}
|
|
42
|
+
function MenubarShortcut({ className, ...props }) {
|
|
43
|
+
return (_jsx("span", { "data-slot": "menubar-shortcut", className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className), ...props }));
|
|
44
|
+
}
|
|
45
|
+
function MenubarSub({ ...props }) {
|
|
46
|
+
return _jsx(MenubarPrimitive.Sub, { "data-slot": "menubar-sub", ...props });
|
|
47
|
+
}
|
|
48
|
+
function MenubarSubTrigger({ className, inset, children, ...props }) {
|
|
49
|
+
return (_jsxs(MenubarPrimitive.SubTrigger, { "data-slot": "menubar-sub-trigger", "data-inset": inset, className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto h-4 w-4" })] }));
|
|
50
|
+
}
|
|
51
|
+
function MenubarSubContent({ className, ...props }) {
|
|
52
|
+
return (_jsx(MenubarPrimitive.SubContent, { "data-slot": "menubar-sub-content", className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className), ...props }));
|
|
53
|
+
}
|
|
54
|
+
export { Menubar, MenubarPortal, MenubarMenu, MenubarTrigger, MenubarContent, MenubarGroup, MenubarSeparator, MenubarLabel, MenubarItem, MenubarShortcut, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubTrigger, MenubarSubContent, };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
4
|
+
import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
function NavigationMenu({ className, children, viewport = true, ...props }) {
|
|
7
|
+
return (_jsxs(NavigationMenuPrimitive.Root, { "data-slot": "navigation-menu", "data-viewport": viewport, className: cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className), ...props, children: [children, viewport && _jsx(NavigationMenuViewport, {})] }));
|
|
8
|
+
}
|
|
9
|
+
function NavigationMenuList({ className, ...props }) {
|
|
10
|
+
return (_jsx(NavigationMenuPrimitive.List, { "data-slot": "navigation-menu-list", className: cn("group flex flex-1 list-none items-center justify-center gap-1", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function NavigationMenuItem({ className, ...props }) {
|
|
13
|
+
return (_jsx(NavigationMenuPrimitive.Item, { "data-slot": "navigation-menu-item", className: cn("relative", className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
const navigationMenuTriggerStyle = cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");
|
|
16
|
+
function NavigationMenuTrigger({ className, children, ...props }) {
|
|
17
|
+
return (_jsxs(NavigationMenuPrimitive.Trigger, { "data-slot": "navigation-menu-trigger", className: cn(navigationMenuTriggerStyle(), "group", className), ...props, children: [children, " ", _jsx(ChevronDownIcon, { className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180", "aria-hidden": "true" })] }));
|
|
18
|
+
}
|
|
19
|
+
function NavigationMenuContent({ className, ...props }) {
|
|
20
|
+
return (_jsx(NavigationMenuPrimitive.Content, { "data-slot": "navigation-menu-content", className: cn("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto", "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none", className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function NavigationMenuViewport({ className, ...props }) {
|
|
23
|
+
return (_jsx("div", { className: cn("absolute top-full left-0 isolate z-50 flex justify-center"), children: _jsx(NavigationMenuPrimitive.Viewport, { "data-slot": "navigation-menu-viewport", className: cn("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]", className), ...props }) }));
|
|
24
|
+
}
|
|
25
|
+
function NavigationMenuLink({ className, ...props }) {
|
|
26
|
+
return (_jsx(NavigationMenuPrimitive.Link, { "data-slot": "navigation-menu-link", className: cn("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
function NavigationMenuIndicator({ className, ...props }) {
|
|
29
|
+
return (_jsx(NavigationMenuPrimitive.Indicator, { "data-slot": "navigation-menu-indicator", className: cn("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden", className), ...props, children: _jsx("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" }) }));
|
|
30
|
+
}
|
|
31
|
+
export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, navigationMenuTriggerStyle, };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** biome-ignore-all lint/a11y/noRedundantRoles: <explanation> */
|
|
3
|
+
/** biome-ignore-all lint/a11y/useSemanticElements: <explanation> */
|
|
4
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon, } from "lucide-react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
import { buttonVariants } from "./button";
|
|
7
|
+
function Pagination({ className, ...props }) {
|
|
8
|
+
return (_jsx("nav", { role: "navigation", "aria-label": "pagination", "data-slot": "pagination", className: cn("mx-auto flex w-full justify-center", className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function PaginationContent({ className, ...props }) {
|
|
11
|
+
return (_jsx("ul", { "data-slot": "pagination-content", className: cn("flex flex-row items-center gap-1", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function PaginationItem({ ...props }) {
|
|
14
|
+
return _jsx("li", { "data-slot": "pagination-item", ...props });
|
|
15
|
+
}
|
|
16
|
+
function PaginationLink({ className, isActive, size = "icon", ...props }) {
|
|
17
|
+
return (_jsx("a", { "aria-current": isActive ? "page" : undefined, "data-slot": "pagination-link", "data-active": isActive, className: cn(buttonVariants({
|
|
18
|
+
variant: isActive ? "outline" : "ghost",
|
|
19
|
+
size,
|
|
20
|
+
}), className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function PaginationPrevious({ className, ...props }) {
|
|
23
|
+
return (_jsxs(PaginationLink, { "aria-label": "Go to previous page", size: "default", className: cn("gap-1 px-2.5 sm:pl-2.5", className), ...props, children: [_jsx(ChevronLeftIcon, {}), _jsx("span", { className: "hidden sm:block", children: "Previous" })] }));
|
|
24
|
+
}
|
|
25
|
+
function PaginationNext({ className, ...props }) {
|
|
26
|
+
return (_jsxs(PaginationLink, { "aria-label": "Go to next page", size: "default", className: cn("gap-1 px-2.5 sm:pr-2.5", className), ...props, children: [_jsx("span", { className: "hidden sm:block", children: "Next" }), _jsx(ChevronRightIcon, {})] }));
|
|
27
|
+
}
|
|
28
|
+
function PaginationEllipsis({ className, ...props }) {
|
|
29
|
+
return (_jsxs("span", { "aria-hidden": true, "data-slot": "pagination-ellipsis", className: cn("flex size-9 items-center justify-center", className), ...props, children: [_jsx(MoreHorizontalIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More pages" })] }));
|
|
30
|
+
}
|
|
31
|
+
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
function Popover({ ...props }) {
|
|
6
|
+
return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
7
|
+
}
|
|
8
|
+
function PopoverTrigger({ ...props }) {
|
|
9
|
+
return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
10
|
+
}
|
|
11
|
+
function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
|
|
12
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className), ...props }) }));
|
|
13
|
+
}
|
|
14
|
+
function PopoverAnchor({ ...props }) {
|
|
15
|
+
return _jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
16
|
+
}
|
|
17
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
function Progress({ className, value, ...props }) {
|
|
6
|
+
return (_jsx(ProgressPrimitive.Root, { "data-slot": "progress", className: cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className), ...props, children: _jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: "bg-primary h-full w-full flex-1 transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) }));
|
|
7
|
+
}
|
|
8
|
+
export { Progress };
|