@mesob/ui 0.2.3 → 0.2.5

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 (236) hide show
  1. package/dist/components.d.ts +1112 -0
  2. package/dist/components.js +9460 -0
  3. package/dist/components.js.map +1 -0
  4. package/dist/hooks.d.ts +6 -0
  5. package/dist/hooks.js +85 -0
  6. package/dist/hooks.js.map +1 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.js +53 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/lib/locale.d.ts +37 -0
  11. package/dist/lib/locale.js +55 -0
  12. package/dist/lib/locale.js.map +1 -0
  13. package/dist/providers.d.ts +20 -0
  14. package/dist/providers.js +61 -0
  15. package/dist/providers.js.map +1 -0
  16. package/dist/use-entity-params-nqD69tdX.d.ts +82 -0
  17. package/package.json +34 -27
  18. package/dist/components/accordion.d.ts +0 -10
  19. package/dist/components/accordion.js +0 -74
  20. package/dist/components/accordion.js.map +0 -1
  21. package/dist/components/alert-dialog.d.ts +0 -17
  22. package/dist/components/alert-dialog.js +0 -187
  23. package/dist/components/alert-dialog.js.map +0 -1
  24. package/dist/components/alert.d.ts +0 -13
  25. package/dist/components/alert.js +0 -74
  26. package/dist/components/alert.js.map +0 -1
  27. package/dist/components/animated-tabs.d.ts +0 -26
  28. package/dist/components/animated-tabs.js +0 -290
  29. package/dist/components/animated-tabs.js.map +0 -1
  30. package/dist/components/app-breadcrumbs-context.d.ts +0 -19
  31. package/dist/components/app-breadcrumbs-context.js +0 -19
  32. package/dist/components/app-breadcrumbs-context.js.map +0 -1
  33. package/dist/components/app-breadcrumbs.d.ts +0 -25
  34. package/dist/components/app-breadcrumbs.js +0 -175
  35. package/dist/components/app-breadcrumbs.js.map +0 -1
  36. package/dist/components/app-header-actions.d.ts +0 -39
  37. package/dist/components/app-header-actions.js +0 -644
  38. package/dist/components/app-header-actions.js.map +0 -1
  39. package/dist/components/app-sidebar.d.ts +0 -24
  40. package/dist/components/app-sidebar.js +0 -667
  41. package/dist/components/app-sidebar.js.map +0 -1
  42. package/dist/components/aspect-ratio.d.ts +0 -6
  43. package/dist/components/aspect-ratio.js +0 -14
  44. package/dist/components/aspect-ratio.js.map +0 -1
  45. package/dist/components/avatar.d.ts +0 -9
  46. package/dist/components/avatar.js +0 -63
  47. package/dist/components/avatar.js.map +0 -1
  48. package/dist/components/badge.d.ts +0 -13
  49. package/dist/components/badge.js +0 -48
  50. package/dist/components/badge.js.map +0 -1
  51. package/dist/components/breadcrumb.d.ts +0 -14
  52. package/dist/components/breadcrumb.js +0 -110
  53. package/dist/components/breadcrumb.js.map +0 -1
  54. package/dist/components/button-group.d.ts +0 -17
  55. package/dist/components/button-group.js +0 -106
  56. package/dist/components/button-group.js.map +0 -1
  57. package/dist/components/button.d.ts +0 -17
  58. package/dist/components/button.js +0 -68
  59. package/dist/components/button.js.map +0 -1
  60. package/dist/components/calendar.d.ts +0 -13
  61. package/dist/components/calendar.js +0 -262
  62. package/dist/components/calendar.js.map +0 -1
  63. package/dist/components/card.d.ts +0 -12
  64. package/dist/components/card.js +0 -98
  65. package/dist/components/card.js.map +0 -1
  66. package/dist/components/carousel.d.ts +0 -24
  67. package/dist/components/carousel.js +0 -268
  68. package/dist/components/carousel.js.map +0 -1
  69. package/dist/components/chart.d.ts +0 -43
  70. package/dist/components/chart.js +0 -271
  71. package/dist/components/chart.js.map +0 -1
  72. package/dist/components/checkbox.d.ts +0 -7
  73. package/dist/components/checkbox.js +0 -41
  74. package/dist/components/checkbox.js.map +0 -1
  75. package/dist/components/collapsible.d.ts +0 -8
  76. package/dist/components/collapsible.js +0 -38
  77. package/dist/components/collapsible.js.map +0 -1
  78. package/dist/components/command.d.ts +0 -22
  79. package/dist/components/command.js +0 -281
  80. package/dist/components/command.js.map +0 -1
  81. package/dist/components/context-menu.d.ts +0 -28
  82. package/dist/components/context-menu.js +0 -233
  83. package/dist/components/context-menu.js.map +0 -1
  84. package/dist/components/data-table/index.d.ts +0 -53
  85. package/dist/components/data-table/index.js +0 -823
  86. package/dist/components/data-table/index.js.map +0 -1
  87. package/dist/components/dialog.d.ts +0 -18
  88. package/dist/components/dialog.js +0 -146
  89. package/dist/components/dialog.js.map +0 -1
  90. package/dist/components/drawer.d.ts +0 -16
  91. package/dist/components/drawer.js +0 -138
  92. package/dist/components/drawer.js.map +0 -1
  93. package/dist/components/dropdown-menu.d.ts +0 -28
  94. package/dist/components/dropdown-menu.js +0 -241
  95. package/dist/components/dropdown-menu.js.map +0 -1
  96. package/dist/components/empty.d.ts +0 -15
  97. package/dist/components/empty.js +0 -110
  98. package/dist/components/empty.js.map +0 -1
  99. package/dist/components/entity/index.d.ts +0 -236
  100. package/dist/components/entity/index.js +0 -1796
  101. package/dist/components/entity/index.js.map +0 -1
  102. package/dist/components/field.d.ts +0 -30
  103. package/dist/components/field.js +0 -279
  104. package/dist/components/field.js.map +0 -1
  105. package/dist/components/form.d.ts +0 -28
  106. package/dist/components/form.js +0 -150
  107. package/dist/components/form.js.map +0 -1
  108. package/dist/components/hover-card.d.ts +0 -9
  109. package/dist/components/hover-card.js +0 -48
  110. package/dist/components/hover-card.js.map +0 -1
  111. package/dist/components/input-group.d.ts +0 -20
  112. package/dist/components/input-group.js +0 -265
  113. package/dist/components/input-group.js.map +0 -1
  114. package/dist/components/input-otp.d.ts +0 -14
  115. package/dist/components/input-otp.js +0 -76
  116. package/dist/components/input-otp.js.map +0 -1
  117. package/dist/components/input.d.ts +0 -6
  118. package/dist/components/input.js +0 -29
  119. package/dist/components/input.js.map +0 -1
  120. package/dist/components/item.d.ts +0 -28
  121. package/dist/components/item.js +0 -220
  122. package/dist/components/item.js.map +0 -1
  123. package/dist/components/kbd.d.ts +0 -6
  124. package/dist/components/kbd.js +0 -39
  125. package/dist/components/kbd.js.map +0 -1
  126. package/dist/components/label.d.ts +0 -7
  127. package/dist/components/label.js +0 -32
  128. package/dist/components/label.js.map +0 -1
  129. package/dist/components/link.d.ts +0 -12
  130. package/dist/components/link.js +0 -51
  131. package/dist/components/link.js.map +0 -1
  132. package/dist/components/menubar.d.ts +0 -29
  133. package/dist/components/menubar.js +0 -261
  134. package/dist/components/menubar.js.map +0 -1
  135. package/dist/components/mesob-context.d.ts +0 -34
  136. package/dist/components/mesob-context.js +0 -53
  137. package/dist/components/mesob-context.js.map +0 -1
  138. package/dist/components/mesob-logo.d.ts +0 -13
  139. package/dist/components/mesob-logo.js +0 -80
  140. package/dist/components/mesob-logo.js.map +0 -1
  141. package/dist/components/navigation-menu.d.ts +0 -18
  142. package/dist/components/navigation-menu.js +0 -178
  143. package/dist/components/navigation-menu.js.map +0 -1
  144. package/dist/components/page/index.d.ts +0 -46
  145. package/dist/components/page/index.js +0 -205
  146. package/dist/components/page/index.js.map +0 -1
  147. package/dist/components/pagination.d.ts +0 -18
  148. package/dist/components/pagination.js +0 -160
  149. package/dist/components/pagination.js.map +0 -1
  150. package/dist/components/popover.d.ts +0 -10
  151. package/dist/components/popover.js +0 -54
  152. package/dist/components/popover.js.map +0 -1
  153. package/dist/components/powered-by.d.ts +0 -8
  154. package/dist/components/powered-by.js +0 -114
  155. package/dist/components/powered-by.js.map +0 -1
  156. package/dist/components/progress.d.ts +0 -7
  157. package/dist/components/progress.js +0 -41
  158. package/dist/components/progress.js.map +0 -1
  159. package/dist/components/radio-group.d.ts +0 -8
  160. package/dist/components/radio-group.js +0 -55
  161. package/dist/components/radio-group.js.map +0 -1
  162. package/dist/components/resizable.d.ts +0 -11
  163. package/dist/components/resizable.js +0 -58
  164. package/dist/components/resizable.js.map +0 -1
  165. package/dist/components/scroll-area.d.ts +0 -8
  166. package/dist/components/scroll-area.js +0 -70
  167. package/dist/components/scroll-area.js.map +0 -1
  168. package/dist/components/section/index.d.ts +0 -14
  169. package/dist/components/section/index.js +0 -147
  170. package/dist/components/section/index.js.map +0 -1
  171. package/dist/components/select.d.ts +0 -18
  172. package/dist/components/select.js +0 -181
  173. package/dist/components/select.js.map +0 -1
  174. package/dist/components/separator.d.ts +0 -7
  175. package/dist/components/separator.js +0 -36
  176. package/dist/components/separator.js.map +0 -1
  177. package/dist/components/sheet.d.ts +0 -16
  178. package/dist/components/sheet.js +0 -136
  179. package/dist/components/sheet.js.map +0 -1
  180. package/dist/components/shell.d.ts +0 -13
  181. package/dist/components/shell.js +0 -548
  182. package/dist/components/shell.js.map +0 -1
  183. package/dist/components/sidebar-context.d.ts +0 -19
  184. package/dist/components/sidebar-context.js +0 -17
  185. package/dist/components/sidebar-context.js.map +0 -1
  186. package/dist/components/sidebar.d.ts +0 -66
  187. package/dist/components/sidebar.js +0 -943
  188. package/dist/components/sidebar.js.map +0 -1
  189. package/dist/components/skeleton.d.ts +0 -5
  190. package/dist/components/skeleton.js +0 -23
  191. package/dist/components/skeleton.js.map +0 -1
  192. package/dist/components/slider.d.ts +0 -7
  193. package/dist/components/slider.js +0 -76
  194. package/dist/components/slider.js.map +0 -1
  195. package/dist/components/sonner.d.ts +0 -7
  196. package/dist/components/sonner.js +0 -43
  197. package/dist/components/sonner.js.map +0 -1
  198. package/dist/components/spinner.d.ts +0 -6
  199. package/dist/components/spinner.js +0 -28
  200. package/dist/components/spinner.js.map +0 -1
  201. package/dist/components/spotlight-search.d.ts +0 -25
  202. package/dist/components/spotlight-search.js +0 -395
  203. package/dist/components/spotlight-search.js.map +0 -1
  204. package/dist/components/switch.d.ts +0 -7
  205. package/dist/components/switch.js +0 -41
  206. package/dist/components/switch.js.map +0 -1
  207. package/dist/components/table.d.ts +0 -13
  208. package/dist/components/table.js +0 -124
  209. package/dist/components/table.js.map +0 -1
  210. package/dist/components/tabs.d.ts +0 -10
  211. package/dist/components/tabs.js +0 -77
  212. package/dist/components/tabs.js.map +0 -1
  213. package/dist/components/textarea.d.ts +0 -6
  214. package/dist/components/textarea.js +0 -26
  215. package/dist/components/textarea.js.map +0 -1
  216. package/dist/components/theme-toggle.d.ts +0 -8
  217. package/dist/components/theme-toggle.js +0 -94
  218. package/dist/components/theme-toggle.js.map +0 -1
  219. package/dist/components/toggle-group.d.ts +0 -14
  220. package/dist/components/toggle-group.js +0 -102
  221. package/dist/components/toggle-group.js.map +0 -1
  222. package/dist/components/toggle.d.ts +0 -13
  223. package/dist/components/toggle.js +0 -53
  224. package/dist/components/toggle.js.map +0 -1
  225. package/dist/components/tooltip.d.ts +0 -10
  226. package/dist/components/tooltip.js +0 -66
  227. package/dist/components/tooltip.js.map +0 -1
  228. package/dist/hooks/use-mobile.d.ts +0 -3
  229. package/dist/hooks/use-mobile.js +0 -22
  230. package/dist/hooks/use-mobile.js.map +0 -1
  231. package/dist/hooks/use-router.d.ts +0 -7
  232. package/dist/hooks/use-router.js +0 -36
  233. package/dist/hooks/use-router.js.map +0 -1
  234. package/dist/hooks/use-translation.d.ts +0 -5
  235. package/dist/hooks/use-translation.js +0 -42
  236. package/dist/hooks/use-translation.js.map +0 -1
@@ -1,943 +0,0 @@
1
- "use client";
2
-
3
- // src/lib/utils.ts
4
- import { clsx } from "clsx";
5
- import { twMerge } from "tailwind-merge";
6
- function cn(...inputs) {
7
- return twMerge(clsx(inputs));
8
- }
9
-
10
- // src/components/button.tsx
11
- import { Slot } from "@radix-ui/react-slot";
12
- import { cva } from "class-variance-authority";
13
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
- var buttonVariants = cva(
15
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none 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",
16
- {
17
- variants: {
18
- variant: {
19
- default: "bg-primary text-primary-foreground hover:bg-primary-600 dark:hover:bg-primary-400",
20
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
21
- outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
22
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-600 dark:hover:bg-secondary-400",
23
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
24
- link: "text-primary underline-offset-4 hover:text-primary-600 dark:hover:text-primary-400 hover:underline"
25
- },
26
- size: {
27
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
28
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
29
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
30
- icon: "size-9",
31
- "icon-sm": "size-8",
32
- "icon-lg": "size-10"
33
- }
34
- },
35
- defaultVariants: {
36
- variant: "default",
37
- size: "default"
38
- }
39
- }
40
- );
41
- function Button({
42
- className,
43
- variant,
44
- size,
45
- asChild = false,
46
- leftIcon,
47
- rightIcon,
48
- children,
49
- ...props
50
- }) {
51
- const Comp = asChild ? Slot : "button";
52
- return /* @__PURE__ */ jsx(
53
- Comp,
54
- {
55
- "data-slot": "button",
56
- className: cn(buttonVariants({ variant, size, className })),
57
- ...props,
58
- children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
59
- leftIcon,
60
- children,
61
- rightIcon
62
- ] })
63
- }
64
- );
65
- }
66
-
67
- // src/components/input.tsx
68
- import { jsx as jsx2 } from "react/jsx-runtime";
69
- function Input({ className, type, ...props }) {
70
- return /* @__PURE__ */ jsx2(
71
- "input",
72
- {
73
- type,
74
- "data-slot": "input",
75
- className: cn(
76
- "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",
77
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
78
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
79
- className
80
- ),
81
- ...props
82
- }
83
- );
84
- }
85
-
86
- // src/components/separator.tsx
87
- import * as SeparatorPrimitive from "@radix-ui/react-separator";
88
- import { jsx as jsx3 } from "react/jsx-runtime";
89
- function Separator({
90
- className,
91
- orientation = "horizontal",
92
- decorative = true,
93
- ...props
94
- }) {
95
- return /* @__PURE__ */ jsx3(
96
- SeparatorPrimitive.Root,
97
- {
98
- "data-slot": "separator",
99
- decorative,
100
- orientation,
101
- className: cn(
102
- "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
103
- className
104
- ),
105
- ...props
106
- }
107
- );
108
- }
109
-
110
- // src/components/sheet.tsx
111
- import * as SheetPrimitive from "@radix-ui/react-dialog";
112
- import { IconX } from "@tabler/icons-react";
113
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
114
- function Sheet({ ...props }) {
115
- return /* @__PURE__ */ jsx4(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
116
- }
117
- function SheetPortal({
118
- ...props
119
- }) {
120
- return /* @__PURE__ */ jsx4(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
121
- }
122
- function SheetOverlay({
123
- className,
124
- ...props
125
- }) {
126
- return /* @__PURE__ */ jsx4(
127
- SheetPrimitive.Overlay,
128
- {
129
- "data-slot": "sheet-overlay",
130
- className: cn(
131
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:opacity-100 fixed inset-0 z-50 bg-[var(--overlay,oklch(0_0_0/0.5))]",
132
- className
133
- ),
134
- ...props
135
- }
136
- );
137
- }
138
- function SheetContent({
139
- className,
140
- children,
141
- side = "right",
142
- ...props
143
- }) {
144
- return /* @__PURE__ */ jsxs2(SheetPortal, { children: [
145
- /* @__PURE__ */ jsx4(SheetOverlay, {}),
146
- /* @__PURE__ */ jsxs2(
147
- SheetPrimitive.Content,
148
- {
149
- "data-slot": "sheet-content",
150
- className: cn(
151
- "bg-background text-foreground border-border data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:opacity-100 fixed z-[51] flex min-w-0 flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
152
- side === "right" && "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",
153
- side === "left" && "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",
154
- side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
155
- side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
156
- className
157
- ),
158
- ...props,
159
- children: [
160
- children,
161
- /* @__PURE__ */ jsxs2(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: [
162
- /* @__PURE__ */ jsx4(IconX, { className: "size-4" }),
163
- /* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Close" })
164
- ] })
165
- ]
166
- }
167
- )
168
- ] });
169
- }
170
- function SheetHeader({ className, ...props }) {
171
- return /* @__PURE__ */ jsx4(
172
- "div",
173
- {
174
- "data-slot": "sheet-header",
175
- className: cn("flex flex-col gap-1.5 p-4", className),
176
- ...props
177
- }
178
- );
179
- }
180
- function SheetTitle({
181
- className,
182
- ...props
183
- }) {
184
- return /* @__PURE__ */ jsx4(
185
- SheetPrimitive.Title,
186
- {
187
- "data-slot": "sheet-title",
188
- className: cn("text-foreground font-semibold", className),
189
- ...props
190
- }
191
- );
192
- }
193
- function SheetDescription({
194
- className,
195
- ...props
196
- }) {
197
- return /* @__PURE__ */ jsx4(
198
- SheetPrimitive.Description,
199
- {
200
- "data-slot": "sheet-description",
201
- className: cn("text-muted-foreground text-sm", className),
202
- ...props
203
- }
204
- );
205
- }
206
-
207
- // src/components/skeleton.tsx
208
- import { jsx as jsx5 } from "react/jsx-runtime";
209
- function Skeleton({ className, ...props }) {
210
- return /* @__PURE__ */ jsx5(
211
- "div",
212
- {
213
- "data-slot": "skeleton",
214
- className: cn("bg-accent animate-pulse rounded-md", className),
215
- ...props
216
- }
217
- );
218
- }
219
-
220
- // src/components/tooltip.tsx
221
- import * as TooltipPrimitive from "@radix-ui/react-tooltip";
222
- import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
223
- function TooltipProvider({
224
- delayDuration = 0,
225
- ...props
226
- }) {
227
- return /* @__PURE__ */ jsx6(
228
- TooltipPrimitive.Provider,
229
- {
230
- "data-slot": "tooltip-provider",
231
- delayDuration,
232
- ...props
233
- }
234
- );
235
- }
236
- function Tooltip({
237
- children,
238
- ...props
239
- }) {
240
- return /* @__PURE__ */ jsx6(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props, children });
241
- }
242
- function TooltipTrigger({
243
- ...props
244
- }) {
245
- return /* @__PURE__ */ jsx6(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
246
- }
247
- function TooltipContent({
248
- className,
249
- sideOffset = 0,
250
- children,
251
- ...props
252
- }) {
253
- return /* @__PURE__ */ jsx6(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs3(
254
- TooltipPrimitive.Content,
255
- {
256
- "data-slot": "tooltip-content",
257
- sideOffset,
258
- className: cn(
259
- "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
260
- className
261
- ),
262
- ...props,
263
- children: [
264
- children,
265
- /* @__PURE__ */ jsx6(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
266
- ]
267
- }
268
- ) });
269
- }
270
-
271
- // src/hooks/use-mobile.ts
272
- import * as React from "react";
273
- var MOBILE_BREAKPOINT = 768;
274
- function useIsMobile() {
275
- const [isMobile, setIsMobile] = React.useState(
276
- void 0
277
- );
278
- React.useEffect(() => {
279
- const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
280
- const onChange = () => {
281
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
282
- };
283
- mql.addEventListener("change", onChange);
284
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
285
- return () => mql.removeEventListener("change", onChange);
286
- }, []);
287
- return !!isMobile;
288
- }
289
-
290
- // src/components/sidebar.tsx
291
- import { Slot as Slot2 } from "@radix-ui/react-slot";
292
- import { IconMenu2 } from "@tabler/icons-react";
293
- import { cva as cva2 } from "class-variance-authority";
294
- import * as React2 from "react";
295
- import {
296
- SidebarContext,
297
- useSidebar
298
- } from "./sidebar-context";
299
- import { useSidebar as useSidebar2 } from "./sidebar-context";
300
- import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
301
- var SIDEBAR_COOKIE_NAME = "sidebar_state";
302
- var SIDEBAR_WIDTH_COOKIE = "sidebar_width";
303
- var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
304
- var SIDEBAR_WIDTH_DEFAULT = 256;
305
- var SIDEBAR_WIDTH_MIN = 200;
306
- var SIDEBAR_WIDTH_MAX = 480;
307
- var SIDEBAR_WIDTH = "16rem";
308
- var SIDEBAR_WIDTH_MOBILE = "18rem";
309
- var SIDEBAR_WIDTH_ICON = "3rem";
310
- var SIDEBAR_KEYBOARD_SHORTCUT = "b";
311
- function getWidthFromCookie() {
312
- if (typeof document === "undefined") {
313
- return SIDEBAR_WIDTH_DEFAULT;
314
- }
315
- const m = document.cookie.match(
316
- new RegExp(`(?:^|; )${SIDEBAR_WIDTH_COOKIE}=([^;]*)`)
317
- );
318
- const n = m ? Number(m[1]) : Number.NaN;
319
- return Number.isFinite(n) && n >= SIDEBAR_WIDTH_MIN && n <= SIDEBAR_WIDTH_MAX ? n : SIDEBAR_WIDTH_DEFAULT;
320
- }
321
- function setWidthCookie(width) {
322
- document.cookie = `${SIDEBAR_WIDTH_COOKIE}=${width}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
323
- }
324
- function SidebarProvider({
325
- defaultOpen = true,
326
- open: openProp,
327
- onOpenChange: setOpenProp,
328
- className,
329
- style,
330
- children,
331
- ...props
332
- }) {
333
- const isMobile = useIsMobile();
334
- const [openMobile, setOpenMobile] = React2.useState(false);
335
- const [width, setWidthState] = React2.useState(getWidthFromCookie);
336
- const setWidth = React2.useCallback((w) => {
337
- const clamped = Math.max(SIDEBAR_WIDTH_MIN, Math.min(SIDEBAR_WIDTH_MAX, w));
338
- setWidthState(clamped);
339
- setWidthCookie(clamped);
340
- }, []);
341
- const [_open, _setOpen] = React2.useState(defaultOpen);
342
- const open = openProp ?? _open;
343
- const setOpen = React2.useCallback(
344
- (value) => {
345
- const openState = typeof value === "function" ? value(open) : value;
346
- if (setOpenProp) {
347
- setOpenProp(openState);
348
- } else {
349
- _setOpen(openState);
350
- }
351
- document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
352
- },
353
- [open, setOpenProp]
354
- );
355
- const toggleSidebar = React2.useCallback(() => {
356
- return isMobile ? setOpenMobile((value) => !value) : setOpen((value) => !value);
357
- }, [isMobile, setOpen]);
358
- React2.useEffect(() => {
359
- const handleKeyDown = (event) => {
360
- if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
361
- event.preventDefault();
362
- toggleSidebar();
363
- }
364
- };
365
- window.addEventListener("keydown", handleKeyDown);
366
- return () => window.removeEventListener("keydown", handleKeyDown);
367
- }, [toggleSidebar]);
368
- const state = open ? "expanded" : "collapsed";
369
- const contextValue = {
370
- state,
371
- open,
372
- setOpen,
373
- isMobile,
374
- openMobile,
375
- setOpenMobile,
376
- toggleSidebar,
377
- width,
378
- setWidth,
379
- minWidth: SIDEBAR_WIDTH_MIN,
380
- maxWidth: SIDEBAR_WIDTH_MAX
381
- };
382
- const sidebarWidthValue = open ? `${width}px` : SIDEBAR_WIDTH;
383
- return /* @__PURE__ */ jsx7(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx7(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx7(
384
- "div",
385
- {
386
- "data-slot": "sidebar-wrapper",
387
- style: {
388
- "--sidebar-width": sidebarWidthValue,
389
- "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
390
- ...style
391
- },
392
- className: cn(
393
- "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
394
- className
395
- ),
396
- ...props,
397
- children
398
- }
399
- ) }) });
400
- }
401
- function Sidebar({
402
- side = "left",
403
- variant = "sidebar",
404
- collapsible = "offcanvas",
405
- className,
406
- children,
407
- ...props
408
- }) {
409
- const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
410
- if (collapsible === "none") {
411
- return /* @__PURE__ */ jsx7(
412
- "div",
413
- {
414
- "data-slot": "sidebar",
415
- className: cn(
416
- "bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
417
- className
418
- ),
419
- ...props,
420
- children
421
- }
422
- );
423
- }
424
- if (isMobile) {
425
- return /* @__PURE__ */ jsx7(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs4(
426
- SheetContent,
427
- {
428
- "data-sidebar": "sidebar",
429
- "data-slot": "sidebar",
430
- "data-mobile": "true",
431
- className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
432
- style: {
433
- "--sidebar-width": SIDEBAR_WIDTH_MOBILE
434
- },
435
- side,
436
- children: [
437
- /* @__PURE__ */ jsxs4(SheetHeader, { className: "sr-only", children: [
438
- /* @__PURE__ */ jsx7(SheetTitle, { children: "Sidebar" }),
439
- /* @__PURE__ */ jsx7(SheetDescription, { children: "Displays the mobile sidebar." })
440
- ] }),
441
- /* @__PURE__ */ jsx7("div", { className: "flex h-full w-full flex-col", children })
442
- ]
443
- }
444
- ) });
445
- }
446
- return /* @__PURE__ */ jsxs4(
447
- "div",
448
- {
449
- className: "group peer text-sidebar-foreground hidden md:block",
450
- "data-state": state,
451
- "data-collapsible": state === "collapsed" ? collapsible : "",
452
- "data-variant": variant,
453
- "data-side": side,
454
- "data-slot": "sidebar",
455
- children: [
456
- /* @__PURE__ */ jsx7(
457
- "div",
458
- {
459
- "data-slot": "sidebar-gap",
460
- className: cn(
461
- "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
462
- "group-data-[collapsible=offcanvas]:w-0",
463
- "group-data-[side=right]:rotate-180",
464
- variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
465
- )
466
- }
467
- ),
468
- /* @__PURE__ */ jsx7(
469
- "div",
470
- {
471
- "data-slot": "sidebar-container",
472
- className: cn(
473
- "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
474
- side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
475
- // Adjust the padding for floating and inset variants.
476
- variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
477
- className
478
- ),
479
- ...props,
480
- children: /* @__PURE__ */ jsx7(
481
- "div",
482
- {
483
- "data-sidebar": "sidebar",
484
- "data-slot": "sidebar-inner",
485
- className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
486
- children
487
- }
488
- )
489
- }
490
- )
491
- ]
492
- }
493
- );
494
- }
495
- function SidebarTrigger({
496
- className,
497
- onClick,
498
- ...props
499
- }) {
500
- const { toggleSidebar } = useSidebar();
501
- return /* @__PURE__ */ jsxs4(
502
- Button,
503
- {
504
- "data-sidebar": "trigger",
505
- "data-slot": "sidebar-trigger",
506
- variant: "ghost",
507
- size: "icon",
508
- className: cn("size-7", className),
509
- onClick: (event) => {
510
- onClick?.(event);
511
- toggleSidebar();
512
- },
513
- ...props,
514
- children: [
515
- /* @__PURE__ */ jsx7(IconMenu2, {}),
516
- /* @__PURE__ */ jsx7("span", { className: "sr-only", children: "Toggle Sidebar" })
517
- ]
518
- }
519
- );
520
- }
521
- function SidebarRail({ className, ...props }) {
522
- const { toggleSidebar } = useSidebar();
523
- return /* @__PURE__ */ jsx7(
524
- "button",
525
- {
526
- "data-sidebar": "rail",
527
- "data-slot": "sidebar-rail",
528
- "aria-label": "Toggle Sidebar",
529
- tabIndex: -1,
530
- onClick: toggleSidebar,
531
- title: "Toggle Sidebar",
532
- className: cn(
533
- "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
534
- "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
535
- "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
536
- "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
537
- "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
538
- "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
539
- className
540
- ),
541
- ...props
542
- }
543
- );
544
- }
545
- function SidebarInset({ className, ...props }) {
546
- return /* @__PURE__ */ jsx7(
547
- "main",
548
- {
549
- "data-slot": "sidebar-inset",
550
- className: cn(
551
- "bg-background relative flex w-full flex-1 flex-col",
552
- "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
553
- className
554
- ),
555
- ...props
556
- }
557
- );
558
- }
559
- function SidebarInput({
560
- className,
561
- ...props
562
- }) {
563
- return /* @__PURE__ */ jsx7(
564
- Input,
565
- {
566
- "data-slot": "sidebar-input",
567
- "data-sidebar": "input",
568
- className: cn("bg-background h-8 w-full shadow-none", className),
569
- ...props
570
- }
571
- );
572
- }
573
- function SidebarHeader({ className, ...props }) {
574
- return /* @__PURE__ */ jsx7(
575
- "div",
576
- {
577
- "data-slot": "sidebar-header",
578
- "data-sidebar": "header",
579
- className: cn("flex flex-col gap-2 p-2", className),
580
- ...props
581
- }
582
- );
583
- }
584
- function SidebarFooter({ className, ...props }) {
585
- return /* @__PURE__ */ jsx7(
586
- "div",
587
- {
588
- "data-slot": "sidebar-footer",
589
- "data-sidebar": "footer",
590
- className: cn("flex flex-col gap-2 p-2", className),
591
- ...props
592
- }
593
- );
594
- }
595
- function SidebarSeparator({
596
- className,
597
- ...props
598
- }) {
599
- return /* @__PURE__ */ jsx7(
600
- Separator,
601
- {
602
- "data-slot": "sidebar-separator",
603
- "data-sidebar": "separator",
604
- className: cn("bg-sidebar-border mx-2 w-auto", className),
605
- ...props
606
- }
607
- );
608
- }
609
- function SidebarContent({ className, ...props }) {
610
- return /* @__PURE__ */ jsx7(
611
- "div",
612
- {
613
- "data-slot": "sidebar-content",
614
- "data-sidebar": "content",
615
- className: cn(
616
- "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
617
- className
618
- ),
619
- ...props
620
- }
621
- );
622
- }
623
- function SidebarGroup({ className, ...props }) {
624
- return /* @__PURE__ */ jsx7(
625
- "div",
626
- {
627
- "data-slot": "sidebar-group",
628
- "data-sidebar": "group",
629
- className: cn("relative flex w-full min-w-0 flex-col p-2", className),
630
- ...props
631
- }
632
- );
633
- }
634
- function SidebarGroupLabel({
635
- className,
636
- asChild = false,
637
- ...props
638
- }) {
639
- const Comp = asChild ? Slot2 : "div";
640
- return /* @__PURE__ */ jsx7(
641
- Comp,
642
- {
643
- "data-slot": "sidebar-group-label",
644
- "data-sidebar": "group-label",
645
- className: cn(
646
- "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
647
- "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
648
- className
649
- ),
650
- ...props
651
- }
652
- );
653
- }
654
- function SidebarGroupAction({
655
- className,
656
- asChild = false,
657
- ...props
658
- }) {
659
- const Comp = asChild ? Slot2 : "button";
660
- return /* @__PURE__ */ jsx7(
661
- Comp,
662
- {
663
- "data-slot": "sidebar-group-action",
664
- "data-sidebar": "group-action",
665
- className: cn(
666
- "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
667
- // Increases the hit area of the button on mobile.
668
- "after:absolute after:-inset-2 md:after:hidden",
669
- "group-data-[collapsible=icon]:hidden",
670
- className
671
- ),
672
- ...props
673
- }
674
- );
675
- }
676
- function SidebarGroupContent({
677
- className,
678
- ...props
679
- }) {
680
- return /* @__PURE__ */ jsx7(
681
- "div",
682
- {
683
- "data-slot": "sidebar-group-content",
684
- "data-sidebar": "group-content",
685
- className: cn("w-full text-sm", className),
686
- ...props
687
- }
688
- );
689
- }
690
- function SidebarMenu({ className, ...props }) {
691
- return /* @__PURE__ */ jsx7(
692
- "ul",
693
- {
694
- "data-slot": "sidebar-menu",
695
- "data-sidebar": "menu",
696
- className: cn("flex w-full min-w-0 flex-col gap-1", className),
697
- ...props
698
- }
699
- );
700
- }
701
- function SidebarMenuItem({ className, ...props }) {
702
- return /* @__PURE__ */ jsx7(
703
- "li",
704
- {
705
- "data-slot": "sidebar-menu-item",
706
- "data-sidebar": "menu-item",
707
- className: cn("group/menu-item relative", className),
708
- ...props
709
- }
710
- );
711
- }
712
- var sidebarMenuButtonVariants = cva2(
713
- 'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-active focus-visible:ring-2 active:bg-sidebar-active disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:relative data-[active=true]:bg-sidebar-active data-[active=true]:pl-3 data-[active=true]:font-medium data-[active=true]:text-sidebar-primary data-[active=true]:before:absolute data-[active=true]:before:left-1 data-[active=true]:before:top-[6px] data-[active=true]:before:bottom-[6px] data-[active=true]:before:w-[3px] data-[active=true]:before:rounded-full data-[active=true]:before:bg-primary data-[active=true]:before:content-[""] data-[state=open]:hover:bg-sidebar-active group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 min-w-0',
714
- {
715
- variants: {
716
- variant: {
717
- default: "hover:bg-sidebar-active",
718
- outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
719
- },
720
- size: {
721
- default: "h-8 text-sm",
722
- sm: "h-7 text-xs",
723
- lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
724
- }
725
- },
726
- defaultVariants: {
727
- variant: "default",
728
- size: "default"
729
- }
730
- }
731
- );
732
- function SidebarMenuButton({
733
- asChild = false,
734
- isActive = false,
735
- variant = "default",
736
- size = "default",
737
- tooltip,
738
- className,
739
- ...props
740
- }) {
741
- const Comp = asChild ? Slot2 : "button";
742
- const { isMobile, state } = useSidebar();
743
- const button = /* @__PURE__ */ jsx7(
744
- Comp,
745
- {
746
- "data-slot": "sidebar-menu-button",
747
- "data-sidebar": "menu-button",
748
- "data-size": size,
749
- "data-active": isActive,
750
- className: cn(sidebarMenuButtonVariants({ variant, size }), className),
751
- ...props
752
- }
753
- );
754
- if (!tooltip) {
755
- return button;
756
- }
757
- if (typeof tooltip === "string") {
758
- tooltip = {
759
- children: tooltip
760
- };
761
- }
762
- return /* @__PURE__ */ jsxs4(Tooltip, { children: [
763
- /* @__PURE__ */ jsx7(TooltipTrigger, { asChild: true, children: button }),
764
- /* @__PURE__ */ jsx7(
765
- TooltipContent,
766
- {
767
- side: "right",
768
- align: "center",
769
- hidden: state !== "collapsed" || isMobile,
770
- ...tooltip
771
- }
772
- )
773
- ] });
774
- }
775
- function SidebarMenuAction({
776
- className,
777
- asChild = false,
778
- showOnHover = false,
779
- ...props
780
- }) {
781
- const Comp = asChild ? Slot2 : "button";
782
- return /* @__PURE__ */ jsx7(
783
- Comp,
784
- {
785
- "data-slot": "sidebar-menu-action",
786
- "data-sidebar": "menu-action",
787
- className: cn(
788
- "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
789
- // Increases the hit area of the button on mobile.
790
- "after:absolute after:-inset-2 md:after:hidden",
791
- "peer-data-[size=sm]/menu-button:top-1",
792
- "peer-data-[size=default]/menu-button:top-1.5",
793
- "peer-data-[size=lg]/menu-button:top-2.5",
794
- "group-data-[collapsible=icon]:hidden",
795
- showOnHover && "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
796
- className
797
- ),
798
- ...props
799
- }
800
- );
801
- }
802
- function SidebarMenuBadge({
803
- className,
804
- ...props
805
- }) {
806
- return /* @__PURE__ */ jsx7(
807
- "div",
808
- {
809
- "data-slot": "sidebar-menu-badge",
810
- "data-sidebar": "menu-badge",
811
- className: cn(
812
- "text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
813
- "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
814
- "peer-data-[size=sm]/menu-button:top-1",
815
- "peer-data-[size=default]/menu-button:top-1.5",
816
- "peer-data-[size=lg]/menu-button:top-2.5",
817
- "group-data-[collapsible=icon]:hidden",
818
- className
819
- ),
820
- ...props
821
- }
822
- );
823
- }
824
- function SidebarMenuSkeleton({
825
- className,
826
- showIcon = false,
827
- ...props
828
- }) {
829
- const [width] = React2.useState(
830
- () => `${Math.floor(Math.random() * 40) + 50}%`
831
- );
832
- return /* @__PURE__ */ jsxs4(
833
- "div",
834
- {
835
- "data-slot": "sidebar-menu-skeleton",
836
- "data-sidebar": "menu-skeleton",
837
- className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
838
- ...props,
839
- children: [
840
- showIcon && /* @__PURE__ */ jsx7(
841
- Skeleton,
842
- {
843
- className: "size-4 rounded-md",
844
- "data-sidebar": "menu-skeleton-icon"
845
- }
846
- ),
847
- /* @__PURE__ */ jsx7(
848
- Skeleton,
849
- {
850
- className: "h-4 max-w-(--skeleton-width) flex-1",
851
- "data-sidebar": "menu-skeleton-text",
852
- style: {
853
- "--skeleton-width": width
854
- }
855
- }
856
- )
857
- ]
858
- }
859
- );
860
- }
861
- function SidebarMenuSub({ className, ...props }) {
862
- return /* @__PURE__ */ jsx7(
863
- "ul",
864
- {
865
- "data-slot": "sidebar-menu-sub",
866
- "data-sidebar": "menu-sub",
867
- className: cn(
868
- "border-sidebar-border relative mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
869
- "group-data-[collapsible=icon]:hidden",
870
- className
871
- ),
872
- ...props
873
- }
874
- );
875
- }
876
- function SidebarMenuSubItem({
877
- className,
878
- ...props
879
- }) {
880
- return /* @__PURE__ */ jsx7(
881
- "li",
882
- {
883
- "data-slot": "sidebar-menu-sub-item",
884
- "data-sidebar": "menu-sub-item",
885
- className: cn("group/menu-sub-item relative", className),
886
- ...props
887
- }
888
- );
889
- }
890
- function SidebarMenuSubButton({
891
- asChild = false,
892
- size = "md",
893
- isActive = false,
894
- className,
895
- ...props
896
- }) {
897
- const Comp = asChild ? Slot2 : "a";
898
- return /* @__PURE__ */ jsx7(
899
- Comp,
900
- {
901
- "data-slot": "sidebar-menu-sub-button",
902
- "data-sidebar": "menu-sub-button",
903
- "data-size": size,
904
- "data-active": isActive,
905
- className: cn(
906
- "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-active active:bg-sidebar-active [&>svg]:text-sidebar-primary flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
907
- 'data-[active=true]:relative data-[active=true]:bg-sidebar-active data-[active=true]:pl-3 data-[active=true]:text-sidebar-primary data-[active=true]:before:absolute data-[active=true]:before:left-1 data-[active=true]:before:top-[6px] data-[active=true]:before:bottom-[6px] data-[active=true]:before:w-[3px] data-[active=true]:before:rounded-full data-[active=true]:before:bg-primary data-[active=true]:before:content-[""]',
908
- size === "sm" && "text-xs",
909
- size === "md" && "text-sm",
910
- "group-data-[collapsible=icon]:hidden",
911
- className
912
- ),
913
- ...props
914
- }
915
- );
916
- }
917
- export {
918
- Sidebar,
919
- SidebarContent,
920
- SidebarFooter,
921
- SidebarGroup,
922
- SidebarGroupAction,
923
- SidebarGroupContent,
924
- SidebarGroupLabel,
925
- SidebarHeader,
926
- SidebarInput,
927
- SidebarInset,
928
- SidebarMenu,
929
- SidebarMenuAction,
930
- SidebarMenuBadge,
931
- SidebarMenuButton,
932
- SidebarMenuItem,
933
- SidebarMenuSkeleton,
934
- SidebarMenuSub,
935
- SidebarMenuSubButton,
936
- SidebarMenuSubItem,
937
- SidebarProvider,
938
- SidebarRail,
939
- SidebarSeparator,
940
- SidebarTrigger,
941
- useSidebar2 as useSidebar
942
- };
943
- //# sourceMappingURL=sidebar.js.map