@mesob/ui 0.2.2 → 0.2.4

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