@arch-cadre/ui 0.0.61 → 0.0.63

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.
Files changed (186) hide show
  1. package/dist/components/.gitkeep +0 -0
  2. package/dist/components/accordion.d.ts +4 -4
  3. package/dist/components/accordion.mjs +58 -0
  4. package/dist/components/alert-dialog.d.ts +11 -11
  5. package/dist/components/alert-dialog.mjs +144 -0
  6. package/dist/components/alert.d.ts +4 -4
  7. package/dist/components/alert.mjs +62 -0
  8. package/dist/components/aspect-ratio.d.ts +1 -1
  9. package/dist/components/aspect-ratio.mjs +9 -0
  10. package/dist/components/avatar.d.ts +3 -3
  11. package/dist/components/avatar.mjs +50 -0
  12. package/dist/components/badge.d.ts +3 -3
  13. package/dist/components/badge.mjs +37 -0
  14. package/dist/components/breadcrumb.d.ts +7 -7
  15. package/dist/components/breadcrumb.mjs +105 -0
  16. package/dist/components/button-group.d.ts +4 -4
  17. package/dist/components/button-group.mjs +76 -0
  18. package/dist/components/button.d.ts +3 -3
  19. package/dist/components/button.mjs +51 -0
  20. package/dist/components/calendar.d.ts +2 -2
  21. package/dist/components/calendar.mjs +191 -0
  22. package/dist/components/card.d.ts +7 -7
  23. package/dist/components/card.mjs +90 -0
  24. package/dist/components/checkbox.d.ts +1 -1
  25. package/dist/components/checkbox.mjs +30 -0
  26. package/dist/components/collapsible.d.ts +3 -3
  27. package/dist/components/collapsible.mjs +31 -0
  28. package/dist/components/command.d.ts +9 -9
  29. package/dist/components/command.mjs +169 -0
  30. package/dist/components/context-menu.d.ts +15 -15
  31. package/dist/components/context-menu.mjs +218 -0
  32. package/dist/components/dialog.d.ts +10 -10
  33. package/dist/components/dialog.mjs +130 -0
  34. package/dist/components/drawer.d.ts +10 -10
  35. package/dist/components/drawer.mjs +124 -0
  36. package/dist/components/dropdown-menu.d.ts +15 -15
  37. package/dist/components/dropdown-menu.mjs +226 -0
  38. package/dist/components/empty.d.ts +7 -7
  39. package/dist/components/empty.mjs +102 -0
  40. package/dist/components/field.d.ts +11 -11
  41. package/dist/components/field.mjs +228 -0
  42. package/dist/components/form.d.ts +6 -6
  43. package/dist/components/form.mjs +123 -0
  44. package/dist/components/hover-card.d.ts +3 -3
  45. package/dist/components/hover-card.mjs +35 -0
  46. package/dist/components/input-group.d.ts +8 -8
  47. package/dist/components/input-group.mjs +155 -0
  48. package/dist/components/input-otp.d.ts +4 -4
  49. package/dist/components/input-otp.mjs +59 -0
  50. package/dist/components/input.d.ts +1 -1
  51. package/dist/components/input.mjs +19 -0
  52. package/dist/components/item.d.ts +13 -13
  53. package/dist/components/item.mjs +187 -0
  54. package/dist/components/kbd.d.ts +2 -2
  55. package/dist/components/kbd.mjs +28 -0
  56. package/dist/components/label.d.ts +1 -1
  57. package/dist/components/label.mjs +21 -0
  58. package/dist/components/language-switcher.d.ts +2 -1
  59. package/dist/components/language-switcher.mjs +30 -0
  60. package/dist/components/menubar.d.ts +16 -16
  61. package/dist/components/menubar.mjs +246 -0
  62. package/dist/components/navigation-menu.d.ts +9 -9
  63. package/dist/components/navigation-menu.mjs +166 -0
  64. package/dist/components/pagination.d.ts +7 -7
  65. package/dist/components/pagination.mjs +116 -0
  66. package/dist/components/popover.d.ts +4 -4
  67. package/dist/components/popover.mjs +40 -0
  68. package/dist/components/progress.d.ts +1 -1
  69. package/dist/components/progress.mjs +30 -0
  70. package/dist/components/radio-group.d.ts +2 -2
  71. package/dist/components/radio-group.mjs +43 -0
  72. package/dist/components/scroll-area.d.ts +2 -2
  73. package/dist/components/scroll-area.mjs +59 -0
  74. package/dist/components/select.d.ts +10 -10
  75. package/dist/components/select.mjs +173 -0
  76. package/dist/components/separator.d.ts +1 -1
  77. package/dist/components/separator.mjs +25 -0
  78. package/dist/components/sheet.d.ts +8 -8
  79. package/dist/components/sheet.mjs +119 -0
  80. package/dist/components/sidebar.d.ts +24 -24
  81. package/dist/components/sidebar.mjs +635 -0
  82. package/dist/components/skeleton.d.ts +1 -1
  83. package/dist/components/skeleton.mjs +13 -0
  84. package/dist/components/slider.d.ts +1 -1
  85. package/dist/components/slider.mjs +59 -0
  86. package/dist/components/sonner.d.ts +2 -1
  87. package/dist/components/sonner.mjs +36 -0
  88. package/dist/components/spinner.d.ts +1 -1
  89. package/dist/components/spinner.mjs +15 -0
  90. package/dist/components/switch.d.ts +1 -1
  91. package/dist/components/switch.mjs +30 -0
  92. package/dist/components/table.d.ts +8 -8
  93. package/dist/components/table.mjs +115 -0
  94. package/dist/components/tabs.d.ts +4 -4
  95. package/dist/components/tabs.mjs +63 -0
  96. package/dist/components/textarea.d.ts +1 -1
  97. package/dist/components/textarea.mjs +16 -0
  98. package/dist/components/toggle-group.d.ts +2 -2
  99. package/dist/components/toggle-group.mjs +65 -0
  100. package/dist/components/toggle.d.ts +2 -2
  101. package/dist/components/toggle.mjs +41 -0
  102. package/dist/components/tooltip.d.ts +4 -4
  103. package/dist/components/tooltip.mjs +49 -0
  104. package/dist/hooks/.gitkeep +0 -0
  105. package/dist/hooks/use-mobile.mjs +17 -0
  106. package/dist/hooks/use-user.mjs +12 -0
  107. package/dist/index.mjs +15 -0
  108. package/dist/lib/{utils.js → utils.mjs} +1 -1
  109. package/dist/logo.d.ts +2 -2
  110. package/dist/logo.mjs +32 -0
  111. package/dist/postcss.config.mjs +2 -1
  112. package/dist/providers/auth-provider.d.ts +1 -1
  113. package/dist/providers/auth-provider.mjs +37 -0
  114. package/dist/providers/index.d.ts +1 -1
  115. package/dist/providers/index.mjs +33 -0
  116. package/dist/shared/access-denied.d.ts +2 -1
  117. package/dist/shared/access-denied.mjs +12 -0
  118. package/dist/shared/loader.d.ts +4 -4
  119. package/dist/shared/loader.mjs +98 -0
  120. package/dist/shared/page-loader.d.ts +2 -1
  121. package/dist/shared/page-loader.mjs +6 -0
  122. package/dist/shared/scroll-fade-effect.d.ts +1 -1
  123. package/dist/shared/scroll-fade-effect.mjs +20 -0
  124. package/dist/styles/globals.css +1 -0
  125. package/package.json +13 -13
  126. package/dist/components/accordion.js +0 -18
  127. package/dist/components/alert-dialog.js +0 -39
  128. package/dist/components/alert.js +0 -24
  129. package/dist/components/aspect-ratio.js +0 -7
  130. package/dist/components/avatar.js +0 -14
  131. package/dist/components/badge.js +0 -22
  132. package/dist/components/breadcrumb.js +0 -30
  133. package/dist/components/button-group.js +0 -28
  134. package/dist/components/button.js +0 -33
  135. package/dist/components/calendar.js +0 -76
  136. package/dist/components/card.js +0 -24
  137. package/dist/components/checkbox.js +0 -9
  138. package/dist/components/collapsible.js +0 -13
  139. package/dist/components/command.js +0 -34
  140. package/dist/components/context-menu.js +0 -51
  141. package/dist/components/dialog.js +0 -36
  142. package/dist/components/drawer.js +0 -35
  143. package/dist/components/dropdown-menu.js +0 -51
  144. package/dist/components/empty.js +0 -33
  145. package/dist/components/field.js +0 -78
  146. package/dist/components/form.js +0 -59
  147. package/dist/components/hover-card.js +0 -14
  148. package/dist/components/input-group.js +0 -63
  149. package/dist/components/input-otp.js +0 -21
  150. package/dist/components/input.js +0 -6
  151. package/dist/components/item.js +0 -66
  152. package/dist/components/kbd.js +0 -9
  153. package/dist/components/label.js +0 -8
  154. package/dist/components/language-switcher.js +0 -20
  155. package/dist/components/menubar.js +0 -54
  156. package/dist/components/navigation-menu.js +0 -31
  157. package/dist/components/pagination.js +0 -31
  158. package/dist/components/popover.js +0 -17
  159. package/dist/components/progress.js +0 -8
  160. package/dist/components/radio-group.js +0 -12
  161. package/dist/components/scroll-area.js +0 -13
  162. package/dist/components/select.js +0 -38
  163. package/dist/components/separator.js +0 -8
  164. package/dist/components/sheet.js +0 -40
  165. package/dist/components/sidebar.js +0 -213
  166. package/dist/components/skeleton.js +0 -6
  167. package/dist/components/slider.js +0 -14
  168. package/dist/components/sonner.js +0 -21
  169. package/dist/components/spinner.js +0 -7
  170. package/dist/components/switch.js +0 -8
  171. package/dist/components/table.js +0 -28
  172. package/dist/components/tabs.js +0 -17
  173. package/dist/components/textarea.js +0 -6
  174. package/dist/components/toggle-group.js +0 -22
  175. package/dist/components/toggle.js +0 -26
  176. package/dist/components/tooltip.js +0 -17
  177. package/dist/hooks/use-mobile.js +0 -15
  178. package/dist/hooks/use-user.js +0 -25
  179. package/dist/index.js +0 -15
  180. package/dist/logo.js +0 -28
  181. package/dist/providers/auth-provider.js +0 -27
  182. package/dist/providers/index.js +0 -23
  183. package/dist/shared/access-denied.js +0 -6
  184. package/dist/shared/loader.js +0 -41
  185. package/dist/shared/page-loader.js +0 -6
  186. package/dist/shared/scroll-fade-effect.js +0 -5
@@ -1,63 +0,0 @@
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, };
@@ -1,21 +0,0 @@
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 };
@@ -1,6 +0,0 @@
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 };
@@ -1,66 +0,0 @@
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, };
@@ -1,9 +0,0 @@
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 };
@@ -1,8 +0,0 @@
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 };
@@ -1,20 +0,0 @@
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
- }
@@ -1,54 +0,0 @@
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, };
@@ -1,31 +0,0 @@
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, };
@@ -1,31 +0,0 @@
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, };
@@ -1,17 +0,0 @@
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 };
@@ -1,8 +0,0 @@
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 };
@@ -1,12 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { CircleIcon } from "lucide-react";
4
- import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
5
- import { cn } from "../lib/utils";
6
- function RadioGroup({ className, ...props }) {
7
- return (_jsx(RadioGroupPrimitive.Root, { "data-slot": "radio-group", className: cn("grid gap-3", className), ...props }));
8
- }
9
- function RadioGroupItem({ className, ...props }) {
10
- return (_jsx(RadioGroupPrimitive.Item, { "data-slot": "radio-group-item", className: cn("border-input text-primary 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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className), ...props, children: _jsx(RadioGroupPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "relative flex items-center justify-center", children: _jsx(CircleIcon, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" }) }) }));
11
- }
12
- export { RadioGroup, RadioGroupItem };
@@ -1,13 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
4
- import { cn } from "../lib/utils";
5
- function ScrollArea({ className, children, orientation = "vertical", ...props }) {
6
- return (_jsxs(ScrollAreaPrimitive.Root, { "data-slot": "scroll-area", className: cn("relative", className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { "data-slot": "scroll-area-viewport", "data-orientation": orientation, onScroll: props.onScroll, className: "\n focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1\n data-[orientation=horizontal]:overflow-x-auto data-[orientation=vertical]:overflow-y-auto\n data-[orientation=horizontal]:scroll-fade-effect-x data-[orientation=vertical]:scroll-fade-effect-y\n ", children: children }), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] }));
7
- }
8
- function ScrollBar({ className, orientation = "vertical", ...props }) {
9
- return (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, { "data-slot": "scroll-area-scrollbar", orientation: orientation, className: cn("flex touch-none p-px transition-colors select-none", orientation === "vertical" &&
10
- "h-full w-2.5 border-l border-l-transparent", orientation === "horizontal" &&
11
- "h-2.5 flex-col border-t border-t-transparent", className), ...props, children: _jsx(ScrollAreaPrimitive.ScrollAreaThumb, { "data-slot": "scroll-area-thumb", className: "bg-border relative flex-1 rounded-full" }) }));
12
- }
13
- export { ScrollArea, ScrollBar };
@@ -1,38 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
4
- import { Select as SelectPrimitive } from "radix-ui";
5
- import { cn } from "../lib/utils";
6
- function Select({ ...props }) {
7
- return _jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
8
- }
9
- function SelectGroup({ ...props }) {
10
- return _jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
11
- }
12
- function SelectValue({ ...props }) {
13
- return _jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
14
- }
15
- function SelectTrigger({ className, size = "default", children, ...props }) {
16
- return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]: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 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })] }));
17
- }
18
- function SelectContent({ className, children, position = "item-aligned", align = "center", ...props }) {
19
- return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { "data-slot": "select-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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" &&
20
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, align: align, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn("p-1", position === "popper" &&
21
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
22
- }
23
- function SelectLabel({ className, ...props }) {
24
- return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("text-muted-foreground px-2 py-1.5 text-xs", className), ...props }));
25
- }
26
- function SelectItem({ className, children, ...props }) {
27
- return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className), ...props, children: [_jsx("span", { "data-slot": "select-item-indicator", className: "absolute right-2 flex size-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] }));
28
- }
29
- function SelectSeparator({ className, ...props }) {
30
- return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className), ...props }));
31
- }
32
- function SelectScrollUpButton({ className, ...props }) {
33
- return (_jsx(SelectPrimitive.ScrollUpButton, { "data-slot": "select-scroll-up-button", className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(ChevronUpIcon, { className: "size-4" }) }));
34
- }
35
- function SelectScrollDownButton({ className, ...props }) {
36
- return (_jsx(SelectPrimitive.ScrollDownButton, { "data-slot": "select-scroll-down-button", className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(ChevronDownIcon, { className: "size-4" }) }));
37
- }
38
- export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
@@ -1,8 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Separator as SeparatorPrimitive } from "radix-ui";
4
- import { cn } from "../lib/utils";
5
- function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
6
- return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className), ...props }));
7
- }
8
- export { Separator };
@@ -1,40 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { XIcon } from "lucide-react";
4
- import { Dialog as SheetPrimitive } from "radix-ui";
5
- import { cn } from "../lib/utils";
6
- function Sheet({ ...props }) {
7
- return _jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
8
- }
9
- function SheetTrigger({ ...props }) {
10
- return _jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
11
- }
12
- function SheetClose({ ...props }) {
13
- return _jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
14
- }
15
- function SheetPortal({ ...props }) {
16
- return _jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
17
- }
18
- function SheetOverlay({ className, ...props }) {
19
- return (_jsx(SheetPrimitive.Overlay, { "data-slot": "sheet-overlay", className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className), ...props }));
20
- }
21
- function SheetContent({ className, children, side = "right", ...props }) {
22
- return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Content, { "data-slot": "sheet-content", className: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", side === "right" &&
23
- "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", side === "left" &&
24
- "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", side === "top" &&
25
- "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", side === "bottom" &&
26
- "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", className), ...props, children: [children, _jsxs(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [_jsx(XIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] }));
27
- }
28
- function SheetHeader({ className, ...props }) {
29
- return (_jsx("div", { "data-slot": "sheet-header", className: cn("flex flex-col gap-1.5 p-4", className), ...props }));
30
- }
31
- function SheetFooter({ className, ...props }) {
32
- return (_jsx("div", { "data-slot": "sheet-footer", className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props }));
33
- }
34
- function SheetTitle({ className, ...props }) {
35
- return (_jsx(SheetPrimitive.Title, { "data-slot": "sheet-title", className: cn("text-foreground font-semibold", className), ...props }));
36
- }
37
- function SheetDescription({ className, ...props }) {
38
- return (_jsx(SheetPrimitive.Description, { "data-slot": "sheet-description", className: cn("text-muted-foreground text-sm", className), ...props }));
39
- }
40
- export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };