@arch-cadre/ui 0.0.44 → 0.0.47

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 (262) hide show
  1. package/dist/components/accordion.js +18 -0
  2. package/dist/components/alert-dialog.js +39 -0
  3. package/dist/components/alert.js +24 -0
  4. package/dist/components/aspect-ratio.js +7 -0
  5. package/dist/components/avatar.js +14 -0
  6. package/dist/components/badge.js +22 -0
  7. package/dist/components/breadcrumb.js +30 -0
  8. package/dist/components/button-group.js +28 -0
  9. package/dist/components/button.js +33 -0
  10. package/dist/components/calendar.js +76 -0
  11. package/dist/components/card.js +24 -0
  12. package/dist/components/checkbox.js +9 -0
  13. package/dist/components/collapsible.js +13 -0
  14. package/dist/components/command.js +34 -0
  15. package/dist/components/context-menu.js +51 -0
  16. package/dist/components/dialog.js +36 -0
  17. package/dist/components/drawer.js +35 -0
  18. package/dist/components/dropdown-menu.js +51 -0
  19. package/dist/components/empty.js +33 -0
  20. package/dist/components/field.js +78 -0
  21. package/dist/components/form.js +59 -0
  22. package/dist/components/hover-card.js +14 -0
  23. package/dist/components/input-group.js +63 -0
  24. package/dist/components/input-otp.js +21 -0
  25. package/dist/components/input.js +6 -0
  26. package/dist/components/item.js +66 -0
  27. package/dist/components/kbd.js +9 -0
  28. package/dist/components/label.js +8 -0
  29. package/dist/components/language-switcher.js +20 -0
  30. package/dist/components/menubar.js +54 -0
  31. package/dist/components/navigation-menu.js +31 -0
  32. package/dist/components/pagination.js +31 -0
  33. package/dist/components/popover.js +17 -0
  34. package/dist/components/progress.js +8 -0
  35. package/dist/components/radio-group.js +12 -0
  36. package/dist/components/scroll-area.js +13 -0
  37. package/dist/components/select.js +38 -0
  38. package/dist/components/separator.js +8 -0
  39. package/dist/components/sheet.js +40 -0
  40. package/dist/components/sidebar.js +213 -0
  41. package/dist/components/skeleton.js +6 -0
  42. package/dist/components/slider.js +14 -0
  43. package/dist/components/sonner.js +21 -0
  44. package/dist/components/spinner.js +7 -0
  45. package/dist/components/switch.js +8 -0
  46. package/dist/components/table.js +28 -0
  47. package/dist/components/tabs.js +17 -0
  48. package/dist/components/textarea.js +6 -0
  49. package/dist/components/toggle-group.js +22 -0
  50. package/dist/components/toggle.js +26 -0
  51. package/dist/components/tooltip.js +17 -0
  52. package/dist/hooks/use-mobile.js +15 -0
  53. package/dist/hooks/use-user.js +25 -0
  54. package/dist/lib/{utils.mjs → utils.js} +1 -1
  55. package/dist/logo.js +28 -0
  56. package/dist/postcss.config.mjs +1 -2
  57. package/dist/providers/auth-provider.js +27 -0
  58. package/dist/providers/index.js +23 -0
  59. package/dist/shared/access-denied.js +6 -0
  60. package/dist/shared/loader.js +41 -0
  61. package/dist/shared/page-loader.js +6 -0
  62. package/dist/shared/scroll-fade-effect.js +5 -0
  63. package/package.json +17 -20
  64. package/build.config.ts +0 -23
  65. package/components.json +0 -20
  66. package/dist/components/.gitkeep +0 -0
  67. package/dist/components/accordion.d.ts +0 -7
  68. package/dist/components/accordion.mjs +0 -58
  69. package/dist/components/alert-dialog.d.ts +0 -14
  70. package/dist/components/alert-dialog.mjs +0 -144
  71. package/dist/components/alert.d.ts +0 -9
  72. package/dist/components/alert.mjs +0 -62
  73. package/dist/components/aspect-ratio.d.ts +0 -4
  74. package/dist/components/aspect-ratio.mjs +0 -9
  75. package/dist/components/avatar.d.ts +0 -6
  76. package/dist/components/avatar.mjs +0 -50
  77. package/dist/components/badge.d.ts +0 -9
  78. package/dist/components/badge.mjs +0 -37
  79. package/dist/components/breadcrumb.d.ts +0 -11
  80. package/dist/components/breadcrumb.mjs +0 -105
  81. package/dist/components/button-group.d.ts +0 -13
  82. package/dist/components/button-group.mjs +0 -76
  83. package/dist/components/button.d.ts +0 -10
  84. package/dist/components/button.mjs +0 -51
  85. package/dist/components/calendar.d.ts +0 -8
  86. package/dist/components/calendar.mjs +0 -191
  87. package/dist/components/card.d.ts +0 -9
  88. package/dist/components/card.mjs +0 -90
  89. package/dist/components/checkbox.d.ts +0 -4
  90. package/dist/components/checkbox.mjs +0 -30
  91. package/dist/components/collapsible.d.ts +0 -6
  92. package/dist/components/collapsible.mjs +0 -31
  93. package/dist/components/command.d.ts +0 -18
  94. package/dist/components/command.mjs +0 -169
  95. package/dist/components/context-menu.d.ts +0 -25
  96. package/dist/components/context-menu.mjs +0 -218
  97. package/dist/components/dialog.d.ts +0 -15
  98. package/dist/components/dialog.mjs +0 -130
  99. package/dist/components/drawer.d.ts +0 -13
  100. package/dist/components/drawer.mjs +0 -124
  101. package/dist/components/dropdown-menu.d.ts +0 -25
  102. package/dist/components/dropdown-menu.mjs +0 -226
  103. package/dist/components/empty.d.ts +0 -12
  104. package/dist/components/empty.mjs +0 -102
  105. package/dist/components/field.d.ts +0 -25
  106. package/dist/components/field.mjs +0 -228
  107. package/dist/components/form.d.ts +0 -23
  108. package/dist/components/form.mjs +0 -123
  109. package/dist/components/hover-card.d.ts +0 -6
  110. package/dist/components/hover-card.mjs +0 -35
  111. package/dist/components/input-group.d.ts +0 -16
  112. package/dist/components/input-group.mjs +0 -155
  113. package/dist/components/input-otp.d.ts +0 -11
  114. package/dist/components/input-otp.mjs +0 -59
  115. package/dist/components/input.d.ts +0 -3
  116. package/dist/components/input.mjs +0 -19
  117. package/dist/components/item.d.ts +0 -23
  118. package/dist/components/item.mjs +0 -187
  119. package/dist/components/kbd.d.ts +0 -4
  120. package/dist/components/kbd.mjs +0 -28
  121. package/dist/components/label.d.ts +0 -4
  122. package/dist/components/label.mjs +0 -21
  123. package/dist/components/language-switcher.d.ts +0 -2
  124. package/dist/components/language-switcher.mjs +0 -30
  125. package/dist/components/menubar.d.ts +0 -26
  126. package/dist/components/menubar.mjs +0 -246
  127. package/dist/components/navigation-menu.d.ts +0 -14
  128. package/dist/components/navigation-menu.mjs +0 -166
  129. package/dist/components/pagination.d.ts +0 -15
  130. package/dist/components/pagination.mjs +0 -116
  131. package/dist/components/popover.d.ts +0 -7
  132. package/dist/components/popover.mjs +0 -40
  133. package/dist/components/progress.d.ts +0 -4
  134. package/dist/components/progress.mjs +0 -30
  135. package/dist/components/radio-group.d.ts +0 -5
  136. package/dist/components/radio-group.mjs +0 -43
  137. package/dist/components/scroll-area.d.ts +0 -7
  138. package/dist/components/scroll-area.mjs +0 -59
  139. package/dist/components/select.d.ts +0 -15
  140. package/dist/components/select.mjs +0 -173
  141. package/dist/components/separator.d.ts +0 -4
  142. package/dist/components/separator.mjs +0 -25
  143. package/dist/components/sheet.d.ts +0 -13
  144. package/dist/components/sheet.mjs +0 -119
  145. package/dist/components/sidebar.d.ts +0 -69
  146. package/dist/components/sidebar.mjs +0 -635
  147. package/dist/components/skeleton.d.ts +0 -3
  148. package/dist/components/skeleton.mjs +0 -13
  149. package/dist/components/slider.d.ts +0 -4
  150. package/dist/components/slider.mjs +0 -59
  151. package/dist/components/sonner.d.ts +0 -4
  152. package/dist/components/sonner.mjs +0 -36
  153. package/dist/components/spinner.d.ts +0 -3
  154. package/dist/components/spinner.mjs +0 -15
  155. package/dist/components/switch.d.ts +0 -4
  156. package/dist/components/switch.mjs +0 -30
  157. package/dist/components/table.d.ts +0 -10
  158. package/dist/components/table.mjs +0 -115
  159. package/dist/components/tabs.d.ts +0 -7
  160. package/dist/components/tabs.mjs +0 -63
  161. package/dist/components/textarea.d.ts +0 -3
  162. package/dist/components/textarea.mjs +0 -16
  163. package/dist/components/toggle-group.d.ts +0 -9
  164. package/dist/components/toggle-group.mjs +0 -65
  165. package/dist/components/toggle.d.ts +0 -9
  166. package/dist/components/toggle.mjs +0 -41
  167. package/dist/components/tooltip.d.ts +0 -7
  168. package/dist/components/tooltip.mjs +0 -49
  169. package/dist/hooks/.gitkeep +0 -0
  170. package/dist/hooks/use-mobile.d.ts +0 -1
  171. package/dist/hooks/use-mobile.mjs +0 -17
  172. package/dist/hooks/use-user.d.ts +0 -12
  173. package/dist/hooks/use-user.mjs +0 -12
  174. package/dist/index.mjs +0 -15
  175. package/dist/lib/utils.d.ts +0 -2
  176. package/dist/logo.d.ts +0 -15
  177. package/dist/logo.mjs +0 -32
  178. package/dist/postcss.config.d.mts +0 -3
  179. package/dist/providers/auth-provider.d.ts +0 -15
  180. package/dist/providers/auth-provider.mjs +0 -37
  181. package/dist/providers/index.d.ts +0 -7
  182. package/dist/providers/index.mjs +0 -33
  183. package/dist/shared/access-denied.d.ts +0 -2
  184. package/dist/shared/access-denied.mjs +0 -12
  185. package/dist/shared/loader.d.ts +0 -11
  186. package/dist/shared/loader.mjs +0 -98
  187. package/dist/shared/page-loader.d.ts +0 -7
  188. package/dist/shared/page-loader.mjs +0 -6
  189. package/dist/shared/scroll-fade-effect.d.ts +0 -4
  190. package/dist/shared/scroll-fade-effect.mjs +0 -20
  191. package/dist/styles/globals.css +0 -1
  192. package/postcss.config.mjs +0 -6
  193. package/scripts/switchToDist.js +0 -55
  194. package/scripts/switchToSrc.js +0 -52
  195. package/src/components/.gitkeep +0 -0
  196. package/src/components/accordion.tsx +0 -66
  197. package/src/components/alert-dialog.tsx +0 -157
  198. package/src/components/alert.tsx +0 -66
  199. package/src/components/aspect-ratio.tsx +0 -12
  200. package/src/components/avatar.tsx +0 -53
  201. package/src/components/badge.tsx +0 -46
  202. package/src/components/breadcrumb.tsx +0 -111
  203. package/src/components/button-group.tsx +0 -86
  204. package/src/components/button.tsx +0 -62
  205. package/src/components/calendar.tsx +0 -220
  206. package/src/components/card.tsx +0 -92
  207. package/src/components/checkbox.tsx +0 -32
  208. package/src/components/collapsible.tsx +0 -34
  209. package/src/components/command.tsx +0 -184
  210. package/src/components/context-menu.tsx +0 -252
  211. package/src/components/dialog.tsx +0 -143
  212. package/src/components/drawer.tsx +0 -135
  213. package/src/components/dropdown-menu.tsx +0 -257
  214. package/src/components/empty.tsx +0 -105
  215. package/src/components/field.tsx +0 -251
  216. package/src/components/form.tsx +0 -170
  217. package/src/components/hover-card.tsx +0 -44
  218. package/src/components/input-group.tsx +0 -170
  219. package/src/components/input-otp.tsx +0 -77
  220. package/src/components/input.tsx +0 -21
  221. package/src/components/item.tsx +0 -193
  222. package/src/components/kbd.tsx +0 -29
  223. package/src/components/label.tsx +0 -24
  224. package/src/components/language-switcher.tsx +0 -49
  225. package/src/components/menubar.tsx +0 -276
  226. package/src/components/navigation-menu.tsx +0 -168
  227. package/src/components/pagination.tsx +0 -130
  228. package/src/components/popover.tsx +0 -48
  229. package/src/components/progress.tsx +0 -31
  230. package/src/components/radio-group.tsx +0 -45
  231. package/src/components/scroll-area.tsx +0 -67
  232. package/src/components/select.tsx +0 -190
  233. package/src/components/separator.tsx +0 -28
  234. package/src/components/sheet.tsx +0 -139
  235. package/src/components/sidebar.tsx +0 -726
  236. package/src/components/skeleton.tsx +0 -14
  237. package/src/components/slider.tsx +0 -63
  238. package/src/components/sonner.tsx +0 -41
  239. package/src/components/spinner.tsx +0 -17
  240. package/src/components/switch.tsx +0 -31
  241. package/src/components/table.tsx +0 -116
  242. package/src/components/tabs.tsx +0 -66
  243. package/src/components/textarea.tsx +0 -18
  244. package/src/components/toggle-group.tsx +0 -83
  245. package/src/components/toggle.tsx +0 -47
  246. package/src/components/tooltip.tsx +0 -61
  247. package/src/hooks/.gitkeep +0 -0
  248. package/src/hooks/use-mobile.ts +0 -21
  249. package/src/hooks/use-user.ts +0 -27
  250. package/src/index.ts +0 -15
  251. package/src/lib/utils.ts +0 -6
  252. package/src/logo.tsx +0 -49
  253. package/src/postcss.config.mjs +0 -6
  254. package/src/providers/auth-provider.tsx +0 -66
  255. package/src/providers/index.tsx +0 -50
  256. package/src/shared/access-denied.tsx +0 -31
  257. package/src/shared/loader.tsx +0 -109
  258. package/src/shared/page-loader.tsx +0 -24
  259. package/src/shared/scroll-fade-effect.tsx +0 -23
  260. package/src/styles/globals.css +0 -314
  261. package/tsconfig.json +0 -24
  262. /package/dist/{index.d.ts → index.js} +0 -0
@@ -1,21 +0,0 @@
1
- import * as React from "react";
2
-
3
- import { cn } from "../lib/utils";
4
-
5
- function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
- return (
7
- <input
8
- type={type}
9
- data-slot="input"
10
- className={cn(
11
- "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",
12
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
13
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
14
- className,
15
- )}
16
- {...props}
17
- />
18
- );
19
- }
20
-
21
- export { Input };
@@ -1,193 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import { Slot as SlotPrimitive } from "radix-ui";
3
- import * as React from "react";
4
-
5
- import { cn } from "../lib/utils";
6
- import { Separator } from "./separator";
7
-
8
- function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
9
- return (
10
- <div
11
- role="list"
12
- data-slot="item-group"
13
- className={cn("group/item-group flex flex-col", className)}
14
- {...props}
15
- />
16
- );
17
- }
18
-
19
- function ItemSeparator({
20
- className,
21
- ...props
22
- }: React.ComponentProps<typeof Separator>) {
23
- return (
24
- <Separator
25
- data-slot="item-separator"
26
- orientation="horizontal"
27
- className={cn("my-0", className)}
28
- {...props}
29
- />
30
- );
31
- }
32
-
33
- const itemVariants = cva(
34
- "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]",
35
- {
36
- variants: {
37
- variant: {
38
- default: "bg-transparent",
39
- outline: "border-border",
40
- muted: "bg-muted/50",
41
- },
42
- size: {
43
- default: "p-4 gap-4 ",
44
- sm: "py-3 px-4 gap-2.5",
45
- },
46
- },
47
- defaultVariants: {
48
- variant: "default",
49
- size: "default",
50
- },
51
- },
52
- );
53
-
54
- function Item({
55
- className,
56
- variant = "default",
57
- size = "default",
58
- asChild = false,
59
- ...props
60
- }: React.ComponentProps<"div"> &
61
- VariantProps<typeof itemVariants> & { asChild?: boolean }) {
62
- const Comp = asChild ? SlotPrimitive.Slot : "div";
63
- return (
64
- <Comp
65
- data-slot="item"
66
- data-variant={variant}
67
- data-size={size}
68
- className={cn(itemVariants({ variant, size, className }))}
69
- {...props}
70
- />
71
- );
72
- }
73
-
74
- const itemMediaVariants = cva(
75
- "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",
76
- {
77
- variants: {
78
- variant: {
79
- default: "bg-transparent",
80
- icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
81
- image:
82
- "size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover",
83
- },
84
- },
85
- defaultVariants: {
86
- variant: "default",
87
- },
88
- },
89
- );
90
-
91
- function ItemMedia({
92
- className,
93
- variant = "default",
94
- ...props
95
- }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
96
- return (
97
- <div
98
- data-slot="item-media"
99
- data-variant={variant}
100
- className={cn(itemMediaVariants({ variant, className }))}
101
- {...props}
102
- />
103
- );
104
- }
105
-
106
- function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
107
- return (
108
- <div
109
- data-slot="item-content"
110
- className={cn(
111
- "flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
112
- className,
113
- )}
114
- {...props}
115
- />
116
- );
117
- }
118
-
119
- function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
120
- return (
121
- <div
122
- data-slot="item-title"
123
- className={cn(
124
- "flex w-fit items-center gap-2 text-sm leading-snug font-medium",
125
- className,
126
- )}
127
- {...props}
128
- />
129
- );
130
- }
131
-
132
- function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
133
- return (
134
- <p
135
- data-slot="item-description"
136
- className={cn(
137
- "text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance",
138
- "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
139
- className,
140
- )}
141
- {...props}
142
- />
143
- );
144
- }
145
-
146
- function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
147
- return (
148
- <div
149
- data-slot="item-actions"
150
- className={cn("flex items-center gap-2", className)}
151
- {...props}
152
- />
153
- );
154
- }
155
-
156
- function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
157
- return (
158
- <div
159
- data-slot="item-header"
160
- className={cn(
161
- "flex basis-full items-center justify-between gap-2",
162
- className,
163
- )}
164
- {...props}
165
- />
166
- );
167
- }
168
-
169
- function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
170
- return (
171
- <div
172
- data-slot="item-footer"
173
- className={cn(
174
- "flex basis-full items-center justify-between gap-2",
175
- className,
176
- )}
177
- {...props}
178
- />
179
- );
180
- }
181
-
182
- export {
183
- Item,
184
- ItemMedia,
185
- ItemContent,
186
- ItemActions,
187
- ItemGroup,
188
- ItemSeparator,
189
- ItemTitle,
190
- ItemDescription,
191
- ItemHeader,
192
- ItemFooter,
193
- };
@@ -1,29 +0,0 @@
1
- import * as React from "react";
2
- import { cn } from "../lib/utils";
3
-
4
- function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
5
- return (
6
- <kbd
7
- data-slot="kbd"
8
- className={cn(
9
- "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",
10
- "[&_svg:not([class*='size-'])]:size-3",
11
- "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
12
- className,
13
- )}
14
- {...props}
15
- />
16
- );
17
- }
18
-
19
- function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
20
- return (
21
- <kbd
22
- data-slot="kbd-group"
23
- className={cn("inline-flex items-center gap-1", className)}
24
- {...props}
25
- />
26
- );
27
- }
28
-
29
- export { Kbd, KbdGroup };
@@ -1,24 +0,0 @@
1
- "use client";
2
-
3
- import { Label as LabelPrimitive } from "radix-ui";
4
- import * as React from "react";
5
-
6
- import { cn } from "../lib/utils";
7
-
8
- function Label({
9
- className,
10
- ...props
11
- }: React.ComponentProps<typeof LabelPrimitive.Root>) {
12
- return (
13
- <LabelPrimitive.Root
14
- data-slot="label"
15
- className={cn(
16
- "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",
17
- className,
18
- )}
19
- {...props}
20
- />
21
- );
22
- }
23
-
24
- export { Label };
@@ -1,49 +0,0 @@
1
- "use client";
2
-
3
- import { LOCALES, useLocale, useTranslation } from "@arch-cadre/intl";
4
- import { Languages } from "lucide-react";
5
- import { useRouter } from "next/navigation";
6
- import * as React from "react";
7
- import { Button } from "./button";
8
- import {
9
- DropdownMenu,
10
- DropdownMenuContent,
11
- DropdownMenuItem,
12
- DropdownMenuTrigger,
13
- } from "./dropdown-menu";
14
-
15
- export function LanguageSwitcher() {
16
- const locale = useLocale();
17
- const router = useRouter();
18
- const { t } = useTranslation();
19
-
20
- const handleLanguageChange = (newLocale: string) => {
21
- // Set cookie
22
- // biome-ignore lint/suspicious/noDocumentCookie: <we want to set a cookie here>
23
- document.cookie = `NEXT_LOCALE=${newLocale}; path=/; max-age=31536000; SameSite=Lax`;
24
- // Refresh page to apply changes
25
- router.refresh();
26
- };
27
-
28
- return (
29
- <DropdownMenu>
30
- <DropdownMenuTrigger asChild>
31
- <Button variant="ghost" size="icon" className="size-9">
32
- <Languages className="size-4" />
33
- <span className="sr-only">{t("Switch language")}</span>
34
- </Button>
35
- </DropdownMenuTrigger>
36
- <DropdownMenuContent align="end">
37
- {LOCALES.map((loc) => (
38
- <DropdownMenuItem
39
- key={loc}
40
- onClick={() => handleLanguageChange(loc)}
41
- className={locale === loc ? "font-bold" : ""}
42
- >
43
- {loc}
44
- </DropdownMenuItem>
45
- ))}
46
- </DropdownMenuContent>
47
- </DropdownMenu>
48
- );
49
- }
@@ -1,276 +0,0 @@
1
- "use client";
2
-
3
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
4
- import { Menubar as MenubarPrimitive } from "radix-ui";
5
- import * as React from "react";
6
-
7
- import { cn } from "../lib/utils";
8
-
9
- function Menubar({
10
- className,
11
- ...props
12
- }: React.ComponentProps<typeof MenubarPrimitive.Root>) {
13
- return (
14
- <MenubarPrimitive.Root
15
- data-slot="menubar"
16
- className={cn(
17
- "bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",
18
- className,
19
- )}
20
- {...props}
21
- />
22
- );
23
- }
24
-
25
- function MenubarMenu({
26
- ...props
27
- }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
28
- return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />;
29
- }
30
-
31
- function MenubarGroup({
32
- ...props
33
- }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
34
- return <MenubarPrimitive.Group data-slot="menubar-group" {...props} />;
35
- }
36
-
37
- function MenubarPortal({
38
- ...props
39
- }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
40
- return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props} />;
41
- }
42
-
43
- function MenubarRadioGroup({
44
- ...props
45
- }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
46
- return (
47
- <MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />
48
- );
49
- }
50
-
51
- function MenubarTrigger({
52
- className,
53
- ...props
54
- }: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {
55
- return (
56
- <MenubarPrimitive.Trigger
57
- data-slot="menubar-trigger"
58
- className={cn(
59
- "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",
60
- className,
61
- )}
62
- {...props}
63
- />
64
- );
65
- }
66
-
67
- function MenubarContent({
68
- className,
69
- align = "start",
70
- alignOffset = -4,
71
- sideOffset = 8,
72
- ...props
73
- }: React.ComponentProps<typeof MenubarPrimitive.Content>) {
74
- return (
75
- <MenubarPortal>
76
- <MenubarPrimitive.Content
77
- data-slot="menubar-content"
78
- align={align}
79
- alignOffset={alignOffset}
80
- sideOffset={sideOffset}
81
- className={cn(
82
- "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",
83
- className,
84
- )}
85
- {...props}
86
- />
87
- </MenubarPortal>
88
- );
89
- }
90
-
91
- function MenubarItem({
92
- className,
93
- inset,
94
- variant = "default",
95
- ...props
96
- }: React.ComponentProps<typeof MenubarPrimitive.Item> & {
97
- inset?: boolean;
98
- variant?: "default" | "destructive";
99
- }) {
100
- return (
101
- <MenubarPrimitive.Item
102
- data-slot="menubar-item"
103
- data-inset={inset}
104
- data-variant={variant}
105
- className={cn(
106
- "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",
107
- className,
108
- )}
109
- {...props}
110
- />
111
- );
112
- }
113
-
114
- function MenubarCheckboxItem({
115
- className,
116
- children,
117
- checked,
118
- ...props
119
- }: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>) {
120
- return (
121
- <MenubarPrimitive.CheckboxItem
122
- data-slot="menubar-checkbox-item"
123
- className={cn(
124
- "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",
125
- className,
126
- )}
127
- checked={checked}
128
- {...props}
129
- >
130
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
131
- <MenubarPrimitive.ItemIndicator>
132
- <CheckIcon className="size-4" />
133
- </MenubarPrimitive.ItemIndicator>
134
- </span>
135
- {children}
136
- </MenubarPrimitive.CheckboxItem>
137
- );
138
- }
139
-
140
- function MenubarRadioItem({
141
- className,
142
- children,
143
- ...props
144
- }: React.ComponentProps<typeof MenubarPrimitive.RadioItem>) {
145
- return (
146
- <MenubarPrimitive.RadioItem
147
- data-slot="menubar-radio-item"
148
- className={cn(
149
- "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",
150
- className,
151
- )}
152
- {...props}
153
- >
154
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
155
- <MenubarPrimitive.ItemIndicator>
156
- <CircleIcon className="size-2 fill-current" />
157
- </MenubarPrimitive.ItemIndicator>
158
- </span>
159
- {children}
160
- </MenubarPrimitive.RadioItem>
161
- );
162
- }
163
-
164
- function MenubarLabel({
165
- className,
166
- inset,
167
- ...props
168
- }: React.ComponentProps<typeof MenubarPrimitive.Label> & {
169
- inset?: boolean;
170
- }) {
171
- return (
172
- <MenubarPrimitive.Label
173
- data-slot="menubar-label"
174
- data-inset={inset}
175
- className={cn(
176
- "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
177
- className,
178
- )}
179
- {...props}
180
- />
181
- );
182
- }
183
-
184
- function MenubarSeparator({
185
- className,
186
- ...props
187
- }: React.ComponentProps<typeof MenubarPrimitive.Separator>) {
188
- return (
189
- <MenubarPrimitive.Separator
190
- data-slot="menubar-separator"
191
- className={cn("bg-border -mx-1 my-1 h-px", className)}
192
- {...props}
193
- />
194
- );
195
- }
196
-
197
- function MenubarShortcut({
198
- className,
199
- ...props
200
- }: React.ComponentProps<"span">) {
201
- return (
202
- <span
203
- data-slot="menubar-shortcut"
204
- className={cn(
205
- "text-muted-foreground ml-auto text-xs tracking-widest",
206
- className,
207
- )}
208
- {...props}
209
- />
210
- );
211
- }
212
-
213
- function MenubarSub({
214
- ...props
215
- }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
216
- return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />;
217
- }
218
-
219
- function MenubarSubTrigger({
220
- className,
221
- inset,
222
- children,
223
- ...props
224
- }: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
225
- inset?: boolean;
226
- }) {
227
- return (
228
- <MenubarPrimitive.SubTrigger
229
- data-slot="menubar-sub-trigger"
230
- data-inset={inset}
231
- className={cn(
232
- "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",
233
- className,
234
- )}
235
- {...props}
236
- >
237
- {children}
238
- <ChevronRightIcon className="ml-auto h-4 w-4" />
239
- </MenubarPrimitive.SubTrigger>
240
- );
241
- }
242
-
243
- function MenubarSubContent({
244
- className,
245
- ...props
246
- }: React.ComponentProps<typeof MenubarPrimitive.SubContent>) {
247
- return (
248
- <MenubarPrimitive.SubContent
249
- data-slot="menubar-sub-content"
250
- className={cn(
251
- "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",
252
- className,
253
- )}
254
- {...props}
255
- />
256
- );
257
- }
258
-
259
- export {
260
- Menubar,
261
- MenubarPortal,
262
- MenubarMenu,
263
- MenubarTrigger,
264
- MenubarContent,
265
- MenubarGroup,
266
- MenubarSeparator,
267
- MenubarLabel,
268
- MenubarItem,
269
- MenubarShortcut,
270
- MenubarCheckboxItem,
271
- MenubarRadioGroup,
272
- MenubarRadioItem,
273
- MenubarSub,
274
- MenubarSubTrigger,
275
- MenubarSubContent,
276
- };