@constructive-io/ui 0.3.1 → 0.6.0

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 (343) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -22
  3. package/dist/components/alert-dialog.cjs +333 -0
  4. package/dist/components/alert-dialog.cjs.map +1 -0
  5. package/dist/components/alert-dialog.d.cts +32 -0
  6. package/dist/components/alert-dialog.d.ts +16 -15
  7. package/dist/components/alert-dialog.js +89 -102
  8. package/dist/components/alert-dialog.js.map +1 -1
  9. package/dist/components/alert.cjs +119 -0
  10. package/dist/components/alert.cjs.map +1 -0
  11. package/dist/components/alert.d.cts +19 -0
  12. package/dist/components/alert.d.ts +10 -5
  13. package/dist/components/alert.js +62 -6
  14. package/dist/components/alert.js.map +1 -1
  15. package/dist/components/app-bar.cjs +367 -0
  16. package/dist/components/app-bar.cjs.map +1 -0
  17. package/dist/components/app-bar.d.cts +26 -0
  18. package/dist/components/app-bar.d.ts +26 -0
  19. package/dist/components/app-bar.js +344 -0
  20. package/dist/components/app-bar.js.map +1 -0
  21. package/dist/components/app-shell.cjs +1792 -0
  22. package/dist/components/app-shell.cjs.map +1 -0
  23. package/dist/components/app-shell.d.cts +106 -0
  24. package/dist/components/app-shell.d.ts +106 -0
  25. package/dist/components/app-shell.js +1771 -0
  26. package/dist/components/app-shell.js.map +1 -0
  27. package/dist/components/autocomplete.cjs +418 -0
  28. package/dist/components/autocomplete.cjs.map +1 -0
  29. package/dist/components/autocomplete.d.cts +28 -0
  30. package/dist/components/autocomplete.d.ts +15 -15
  31. package/dist/components/autocomplete.js +9 -30
  32. package/dist/components/autocomplete.js.map +1 -1
  33. package/dist/components/avatar.cjs +51 -0
  34. package/dist/components/avatar.cjs.map +1 -0
  35. package/dist/components/avatar.d.cts +12 -0
  36. package/dist/components/avatar.d.ts +3 -4
  37. package/dist/components/avatar.js +11 -1
  38. package/dist/components/avatar.js.map +1 -1
  39. package/dist/components/badge.cjs +66 -0
  40. package/dist/components/badge.cjs.map +1 -0
  41. package/dist/components/badge.d.cts +15 -0
  42. package/dist/components/badge.js +1 -1
  43. package/dist/components/badge.js.map +1 -1
  44. package/dist/components/breadcrumb.cjs +118 -0
  45. package/dist/components/breadcrumb.cjs.map +1 -0
  46. package/dist/components/breadcrumb.d.cts +14 -0
  47. package/dist/components/breadcrumb.d.ts +9 -9
  48. package/dist/components/breadcrumb.js +19 -83
  49. package/dist/components/breadcrumb.js.map +1 -1
  50. package/dist/components/button.cjs +169 -0
  51. package/dist/components/button.cjs.map +1 -0
  52. package/dist/components/button.d.cts +20 -0
  53. package/dist/components/button.d.ts +3 -0
  54. package/dist/components/button.js +105 -21
  55. package/dist/components/button.js.map +1 -1
  56. package/dist/components/calendar-rac.cjs +85 -0
  57. package/dist/components/calendar-rac.cjs.map +1 -0
  58. package/dist/components/calendar-rac.d.cts +13 -0
  59. package/dist/components/calendar-rac.d.ts +3 -3
  60. package/dist/components/card.cjs +99 -0
  61. package/dist/components/card.cjs.map +1 -0
  62. package/dist/components/card.d.cts +18 -0
  63. package/dist/components/card.d.ts +7 -8
  64. package/dist/components/card.js +23 -8
  65. package/dist/components/card.js.map +1 -1
  66. package/dist/components/checkbox-group.cjs +18 -0
  67. package/dist/components/checkbox-group.cjs.map +1 -0
  68. package/dist/components/checkbox-group.d.cts +7 -0
  69. package/dist/components/checkbox-group.d.ts +2 -2
  70. package/dist/components/checkbox.cjs +121 -0
  71. package/dist/components/checkbox.cjs.map +1 -0
  72. package/dist/components/checkbox.d.cts +8 -0
  73. package/dist/components/checkbox.d.ts +3 -3
  74. package/dist/components/checkbox.js +73 -41
  75. package/dist/components/checkbox.js.map +1 -1
  76. package/dist/components/collapsible.cjs +127 -0
  77. package/dist/components/collapsible.cjs.map +1 -0
  78. package/dist/components/collapsible.d.cts +44 -0
  79. package/dist/components/collapsible.d.ts +8 -18
  80. package/dist/components/collapsible.js +7 -27
  81. package/dist/components/collapsible.js.map +1 -1
  82. package/dist/components/combobox.cjs +551 -0
  83. package/dist/components/combobox.cjs.map +1 -0
  84. package/dist/components/combobox.d.cts +43 -0
  85. package/dist/components/combobox.d.ts +17 -18
  86. package/dist/components/combobox.js +37 -48
  87. package/dist/components/combobox.js.map +1 -1
  88. package/dist/components/command.cjs +236 -0
  89. package/dist/components/command.cjs.map +1 -0
  90. package/dist/components/command.d.cts +23 -0
  91. package/dist/components/command.d.ts +14 -15
  92. package/dist/components/command.js +5 -38
  93. package/dist/components/command.js.map +1 -1
  94. package/dist/components/dialog.cjs +431 -0
  95. package/dist/components/dialog.cjs.map +1 -0
  96. package/dist/components/dialog.d.cts +30 -0
  97. package/dist/components/dialog.d.ts +13 -18
  98. package/dist/components/dialog.js +75 -119
  99. package/dist/components/dialog.js.map +1 -1
  100. package/dist/components/dock.cjs +121 -0
  101. package/dist/components/dock.cjs.map +1 -0
  102. package/dist/components/dock.d.cts +30 -0
  103. package/dist/components/dock.d.ts +1 -2
  104. package/dist/components/dock.js +7 -5
  105. package/dist/components/dock.js.map +1 -1
  106. package/dist/components/drawer.cjs +149 -0
  107. package/dist/components/drawer.cjs.map +1 -0
  108. package/dist/components/drawer.d.cts +15 -0
  109. package/dist/components/drawer.d.ts +10 -11
  110. package/dist/components/drawer.js +11 -40
  111. package/dist/components/drawer.js.map +1 -1
  112. package/dist/components/dropdown-menu.cjs +292 -0
  113. package/dist/components/dropdown-menu.cjs.map +1 -0
  114. package/dist/components/dropdown-menu.d.cts +52 -0
  115. package/dist/components/dropdown-menu.d.ts +23 -21
  116. package/dist/components/dropdown-menu.js +67 -191
  117. package/dist/components/dropdown-menu.js.map +1 -1
  118. package/dist/components/empty.cjs +106 -0
  119. package/dist/components/empty.cjs.map +1 -0
  120. package/dist/components/empty.d.cts +15 -0
  121. package/dist/components/empty.d.ts +15 -0
  122. package/dist/components/empty.js +99 -0
  123. package/dist/components/empty.js.map +1 -0
  124. package/dist/components/field.cjs +295 -0
  125. package/dist/components/field.cjs.map +1 -0
  126. package/dist/components/field.d.cts +46 -0
  127. package/dist/components/field.d.ts +34 -39
  128. package/dist/components/field.js +220 -72
  129. package/dist/components/field.js.map +1 -1
  130. package/dist/components/flickering-grid.cjs +176 -0
  131. package/dist/components/flickering-grid.cjs.map +1 -0
  132. package/dist/components/flickering-grid.d.cts +15 -0
  133. package/dist/components/flickering-grid.js +25 -2
  134. package/dist/components/flickering-grid.js.map +1 -1
  135. package/dist/components/flow-zoom-panel.cjs +194 -0
  136. package/dist/components/flow-zoom-panel.cjs.map +1 -0
  137. package/dist/components/flow-zoom-panel.d.cts +12 -0
  138. package/dist/components/flow-zoom-panel.d.ts +12 -0
  139. package/dist/components/flow-zoom-panel.js +173 -0
  140. package/dist/components/flow-zoom-panel.js.map +1 -0
  141. package/dist/components/form-control.cjs +193 -0
  142. package/dist/components/form-control.cjs.map +1 -0
  143. package/dist/components/form-control.d.cts +14 -0
  144. package/dist/components/form-control.d.ts +1 -2
  145. package/dist/components/form-control.js +2 -4
  146. package/dist/components/form-control.js.map +1 -1
  147. package/dist/components/form.cjs +208 -0
  148. package/dist/components/form.cjs.map +1 -0
  149. package/dist/components/form.d.cts +36 -0
  150. package/dist/components/form.d.ts +7 -8
  151. package/dist/components/input-group.cjs +184 -0
  152. package/dist/components/input-group.cjs.map +1 -0
  153. package/dist/components/input-group.d.cts +17 -0
  154. package/dist/components/input-group.d.ts +6 -7
  155. package/dist/components/input-group.js +3 -2
  156. package/dist/components/input-group.js.map +1 -1
  157. package/dist/components/input.cjs +62 -0
  158. package/dist/components/input.cjs.map +1 -0
  159. package/dist/components/input.d.cts +10 -0
  160. package/dist/components/input.d.ts +1 -2
  161. package/dist/components/input.js +1 -1
  162. package/dist/components/input.js.map +1 -1
  163. package/dist/components/json-input.cjs +351 -0
  164. package/dist/components/json-input.cjs.map +1 -0
  165. package/dist/components/json-input.d.cts +25 -0
  166. package/dist/components/json-input.d.ts +3 -3
  167. package/dist/components/json-input.js +89 -112
  168. package/dist/components/json-input.js.map +1 -1
  169. package/dist/components/label.cjs +29 -0
  170. package/dist/components/label.cjs.map +1 -0
  171. package/dist/components/label.d.cts +10 -0
  172. package/dist/components/label.d.ts +1 -2
  173. package/dist/components/motion-grid.cjs +108 -0
  174. package/dist/components/motion-grid.cjs.map +1 -0
  175. package/dist/components/motion-grid.d.cts +19 -0
  176. package/dist/components/motion-grid.d.ts +1 -2
  177. package/dist/components/motion-grid.js +9 -4
  178. package/dist/components/motion-grid.js.map +1 -1
  179. package/dist/components/multi-select.cjs +796 -0
  180. package/dist/components/multi-select.cjs.map +1 -0
  181. package/dist/components/multi-select.d.cts +198 -0
  182. package/dist/components/multi-select.js +54 -162
  183. package/dist/components/multi-select.js.map +1 -1
  184. package/dist/components/page-header.cjs +19 -0
  185. package/dist/components/page-header.cjs.map +1 -0
  186. package/dist/components/page-header.d.cts +17 -0
  187. package/dist/components/page-header.d.ts +2 -2
  188. package/dist/components/pagination.cjs +295 -0
  189. package/dist/components/pagination.cjs.map +1 -0
  190. package/dist/components/pagination.d.cts +18 -0
  191. package/dist/components/pagination.d.ts +7 -8
  192. package/dist/components/pagination.js +152 -29
  193. package/dist/components/pagination.js.map +1 -1
  194. package/dist/components/popover.cjs +140 -0
  195. package/dist/components/popover.cjs.map +1 -0
  196. package/dist/components/popover.d.cts +39 -0
  197. package/dist/components/popover.d.ts +13 -9
  198. package/dist/components/popover.js +56 -132
  199. package/dist/components/popover.js.map +1 -1
  200. package/dist/components/portal.cjs +109 -0
  201. package/dist/components/portal.cjs.map +1 -0
  202. package/dist/components/portal.d.cts +117 -0
  203. package/dist/components/portal.d.ts +16 -7
  204. package/dist/components/portal.js +13 -8
  205. package/dist/components/portal.js.map +1 -1
  206. package/dist/components/progress.cjs +31 -0
  207. package/dist/components/progress.cjs.map +1 -0
  208. package/dist/components/progress.d.cts +9 -0
  209. package/dist/components/progress.d.ts +1 -2
  210. package/dist/components/progress.js +1 -2
  211. package/dist/components/progress.js.map +1 -1
  212. package/dist/components/progressive-blur-scroll-container.cjs +144 -0
  213. package/dist/components/progressive-blur-scroll-container.cjs.map +1 -0
  214. package/dist/components/progressive-blur-scroll-container.d.cts +25 -0
  215. package/dist/components/progressive-blur-scroll-container.d.ts +2 -2
  216. package/dist/components/progressive-blur.cjs +70 -0
  217. package/dist/components/progressive-blur.cjs.map +1 -0
  218. package/dist/components/progressive-blur.d.cts +16 -0
  219. package/dist/components/progressive-blur.d.ts +2 -2
  220. package/dist/components/radio-group.cjs +52 -0
  221. package/dist/components/radio-group.cjs.map +1 -0
  222. package/dist/components/radio-group.d.cts +10 -0
  223. package/dist/components/radio-group.d.ts +3 -3
  224. package/dist/components/radio-group.js +21 -10
  225. package/dist/components/radio-group.js.map +1 -1
  226. package/dist/components/record-picker.cjs +420 -0
  227. package/dist/components/record-picker.cjs.map +1 -0
  228. package/dist/components/record-picker.d.cts +16 -0
  229. package/dist/components/record-picker.d.ts +2 -2
  230. package/dist/components/record-picker.js +76 -43
  231. package/dist/components/record-picker.js.map +1 -1
  232. package/dist/components/resizable.cjs +76 -0
  233. package/dist/components/resizable.cjs.map +1 -0
  234. package/dist/components/resizable.d.cts +10 -0
  235. package/dist/components/resizable.d.ts +3 -4
  236. package/dist/components/responsive-diagram.cjs +67 -0
  237. package/dist/components/responsive-diagram.cjs.map +1 -0
  238. package/dist/components/responsive-diagram.d.cts +10 -0
  239. package/dist/components/responsive-diagram.d.ts +2 -2
  240. package/dist/components/scroll-area.cjs +92 -0
  241. package/dist/components/scroll-area.cjs.map +1 -0
  242. package/dist/components/scroll-area.d.cts +11 -0
  243. package/dist/components/scroll-area.d.ts +5 -6
  244. package/dist/components/select.cjs +329 -0
  245. package/dist/components/select.cjs.map +1 -0
  246. package/dist/components/select.d.cts +46 -0
  247. package/dist/components/select.d.ts +13 -14
  248. package/dist/components/select.js +76 -67
  249. package/dist/components/select.js.map +1 -1
  250. package/dist/components/separator.cjs +26 -0
  251. package/dist/components/separator.cjs.map +1 -0
  252. package/dist/components/separator.d.cts +10 -0
  253. package/dist/components/separator.d.ts +1 -2
  254. package/dist/components/sheet.cjs +489 -0
  255. package/dist/components/sheet.cjs.map +1 -0
  256. package/dist/components/sheet.d.cts +107 -0
  257. package/dist/components/sheet.d.ts +14 -19
  258. package/dist/components/sheet.js +119 -264
  259. package/dist/components/sheet.js.map +1 -1
  260. package/dist/components/sidebar.cjs +1300 -0
  261. package/dist/components/sidebar.cjs.map +1 -0
  262. package/dist/components/sidebar.d.cts +70 -0
  263. package/dist/components/sidebar.d.ts +32 -39
  264. package/dist/components/sidebar.js +401 -362
  265. package/dist/components/sidebar.js.map +1 -1
  266. package/dist/components/skeleton.cjs +36 -0
  267. package/dist/components/skeleton.cjs.map +1 -0
  268. package/dist/components/skeleton.d.cts +10 -0
  269. package/dist/components/skeleton.d.ts +5 -2
  270. package/dist/components/skeleton.js +19 -1
  271. package/dist/components/skeleton.js.map +1 -1
  272. package/dist/components/sonner.cjs +25 -0
  273. package/dist/components/sonner.cjs.map +1 -0
  274. package/dist/components/sonner.d.cts +10 -0
  275. package/dist/components/sonner.d.ts +2 -2
  276. package/dist/components/stack/index.cjs +1516 -0
  277. package/dist/components/stack/index.cjs.map +1 -0
  278. package/dist/components/stack/index.d.cts +672 -0
  279. package/dist/components/stack/index.d.ts +36 -38
  280. package/dist/components/stack/index.js +42 -31
  281. package/dist/components/stack/index.js.map +1 -1
  282. package/dist/components/stepper.cjs +314 -0
  283. package/dist/components/stepper.cjs.map +1 -0
  284. package/dist/components/stepper.d.cts +31 -0
  285. package/dist/components/stepper.d.ts +9 -8
  286. package/dist/components/stepper.js +22 -15
  287. package/dist/components/stepper.js.map +1 -1
  288. package/dist/components/switch.cjs +46 -0
  289. package/dist/components/switch.cjs.map +1 -0
  290. package/dist/components/switch.d.cts +7 -0
  291. package/dist/components/switch.d.ts +1 -2
  292. package/dist/components/switch.js +9 -5
  293. package/dist/components/switch.js.map +1 -1
  294. package/dist/components/table.cjs +133 -0
  295. package/dist/components/table.cjs.map +1 -0
  296. package/dist/components/table.d.cts +22 -0
  297. package/dist/components/table.d.ts +19 -12
  298. package/dist/components/table.js +72 -13
  299. package/dist/components/table.js.map +1 -1
  300. package/dist/components/tabs.cjs +53 -0
  301. package/dist/components/tabs.cjs.map +1 -0
  302. package/dist/components/tabs.d.cts +9 -0
  303. package/dist/components/tabs.d.ts +4 -5
  304. package/dist/components/tabs.js +2 -2
  305. package/dist/components/tabs.js.map +1 -1
  306. package/dist/components/tags.cjs +451 -0
  307. package/dist/components/tags.cjs.map +1 -0
  308. package/dist/components/tags.d.cts +40 -0
  309. package/dist/components/tags.d.ts +10 -10
  310. package/dist/components/tags.js +129 -154
  311. package/dist/components/tags.js.map +1 -1
  312. package/dist/components/textarea.cjs +56 -0
  313. package/dist/components/textarea.cjs.map +1 -0
  314. package/dist/components/textarea.d.cts +9 -0
  315. package/dist/components/textarea.d.ts +1 -2
  316. package/dist/components/toast/index.cjs +612 -0
  317. package/dist/components/toast/index.cjs.map +1 -0
  318. package/dist/components/toast/index.d.cts +52 -0
  319. package/dist/components/toast/index.js +90 -127
  320. package/dist/components/toast/index.js.map +1 -1
  321. package/dist/components/tooltip.cjs +92 -0
  322. package/dist/components/tooltip.cjs.map +1 -0
  323. package/dist/components/tooltip.d.cts +28 -0
  324. package/dist/components/tooltip.d.ts +5 -6
  325. package/dist/components/tooltip.js +23 -130
  326. package/dist/components/tooltip.js.map +1 -1
  327. package/dist/components/unlink-button.cjs +197 -0
  328. package/dist/components/unlink-button.cjs.map +1 -0
  329. package/dist/components/unlink-button.d.cts +14 -0
  330. package/dist/components/unlink-button.d.ts +2 -2
  331. package/dist/components/unlink-button.js +105 -21
  332. package/dist/components/unlink-button.js.map +1 -1
  333. package/dist/index.cjs +2040 -1577
  334. package/dist/index.cjs.map +1 -1
  335. package/dist/index.d.cts +492 -509
  336. package/dist/index.d.ts +492 -509
  337. package/dist/index.js +1862 -1443
  338. package/dist/index.js.map +1 -1
  339. package/package.json +286 -45
  340. package/src/styles/globals.css +155 -203
  341. package/dist/components/org-chart/index.d.ts +0 -54
  342. package/dist/components/org-chart/index.js +0 -861
  343. package/dist/components/org-chart/index.js.map +0 -1
@@ -0,0 +1,1792 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var React5 = require('react');
5
+ var mergeProps = require('@base-ui/react/merge-props');
6
+ var useRender = require('@base-ui/react/use-render');
7
+ var lucideReact = require('lucide-react');
8
+ var clsx = require('clsx');
9
+ var tailwindMerge = require('tailwind-merge');
10
+ var jsxRuntime = require('react/jsx-runtime');
11
+ var separator = require('@base-ui/react/separator');
12
+ var classVarianceAuthority = require('class-variance-authority');
13
+ var dialog = require('@base-ui/react/dialog');
14
+ var react = require('motion/react');
15
+ var portal = require('@constructive-io/ui/portal');
16
+ var tooltip = require('@base-ui/react/tooltip');
17
+ var avatar = require('@base-ui/react/avatar');
18
+ var collapsible = require('@base-ui/react/collapsible');
19
+ var menu = require('@base-ui/react/menu');
20
+
21
+ function _interopNamespace(e) {
22
+ if (e && e.__esModule) return e;
23
+ var n = Object.create(null);
24
+ if (e) {
25
+ Object.keys(e).forEach(function (k) {
26
+ if (k !== 'default') {
27
+ var d = Object.getOwnPropertyDescriptor(e, k);
28
+ Object.defineProperty(n, k, d.get ? d : {
29
+ enumerable: true,
30
+ get: function () { return e[k]; }
31
+ });
32
+ }
33
+ });
34
+ }
35
+ n.default = e;
36
+ return Object.freeze(n);
37
+ }
38
+
39
+ var React5__namespace = /*#__PURE__*/_interopNamespace(React5);
40
+
41
+ function cn(...inputs) {
42
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
43
+ }
44
+ function Breadcrumb({ ...props }) {
45
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
46
+ }
47
+ function BreadcrumbList({ className, ...props }) {
48
+ return /* @__PURE__ */ jsxRuntime.jsx(
49
+ "ol",
50
+ {
51
+ "data-slot": "breadcrumb-list",
52
+ className: cn(
53
+ "text-muted-foreground/50 flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
54
+ className
55
+ ),
56
+ ...props
57
+ }
58
+ );
59
+ }
60
+ function BreadcrumbItem({ className, ...props }) {
61
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { "data-slot": "breadcrumb-item", className: cn("inline-flex items-center gap-1.5", className), ...props });
62
+ }
63
+ function BreadcrumbLink({
64
+ asChild,
65
+ render,
66
+ className,
67
+ children,
68
+ ...props
69
+ }) {
70
+ const childRender = render === void 0 && asChild && React5__namespace.isValidElement(children) ? children : void 0;
71
+ return useRender.useRender({
72
+ defaultTagName: "a",
73
+ props: mergeProps.mergeProps(
74
+ {
75
+ className: cn("text-muted-foreground/60 transition-colors hover:text-foreground", className),
76
+ children: childRender ? void 0 : children
77
+ },
78
+ props
79
+ ),
80
+ render: render ?? childRender,
81
+ state: {
82
+ slot: "breadcrumb-link"
83
+ }
84
+ });
85
+ }
86
+ function BreadcrumbPage({ className, ...props }) {
87
+ return /* @__PURE__ */ jsxRuntime.jsx(
88
+ "span",
89
+ {
90
+ "data-slot": "breadcrumb-page",
91
+ role: "link",
92
+ "aria-disabled": "true",
93
+ "aria-current": "page",
94
+ className: cn("text-foreground font-normal", className),
95
+ ...props
96
+ }
97
+ );
98
+ }
99
+ function BreadcrumbSeparator({ children, className, ...props }) {
100
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className, ...props, children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { size: 16 }) });
101
+ }
102
+ function Separator({ className, orientation = "horizontal", decorative: _decorative, ...props }) {
103
+ return /* @__PURE__ */ jsxRuntime.jsx(
104
+ separator.Separator,
105
+ {
106
+ "data-slot": "separator-root",
107
+ orientation,
108
+ className: cn("bg-border shrink-0", orientation === "horizontal" ? "h-px w-full" : "h-full w-px", className),
109
+ ...props
110
+ }
111
+ );
112
+ }
113
+ var MOBILE_BREAKPOINT = 768;
114
+ function useIsMobile() {
115
+ const [isMobile, setIsMobile] = React5__namespace.useState(false);
116
+ React5__namespace.useEffect(() => {
117
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
118
+ const onChange = () => {
119
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
120
+ };
121
+ mql.addEventListener("change", onChange);
122
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
123
+ return () => mql.removeEventListener("change", onChange);
124
+ }, []);
125
+ return isMobile;
126
+ }
127
+ function composeRefs(...refs) {
128
+ return (node) => {
129
+ refs.forEach((ref) => {
130
+ if (typeof ref === "function") {
131
+ ref(node);
132
+ } else if (ref != null) {
133
+ ref.current = node;
134
+ }
135
+ });
136
+ };
137
+ }
138
+ function mergeProps2(slotProps, childProps) {
139
+ const overrideProps = { ...childProps };
140
+ for (const propName in childProps) {
141
+ if (propName === "ref") continue;
142
+ const slotPropValue = slotProps[propName];
143
+ const childPropValue = childProps[propName];
144
+ if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
145
+ overrideProps[propName] = (...args) => {
146
+ childPropValue(...args);
147
+ slotPropValue(...args);
148
+ };
149
+ } else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
150
+ overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
151
+ } else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
152
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
153
+ }
154
+ }
155
+ return { ...slotProps, ...overrideProps };
156
+ }
157
+ function isSlottable(child) {
158
+ return React5__namespace.isValidElement(child);
159
+ }
160
+ var Slot = React5__namespace.forwardRef((props, forwardedRef) => {
161
+ const { children, ...slotProps } = props;
162
+ if (isSlottable(children)) {
163
+ const childProps = children.props;
164
+ const childRef = childProps.ref;
165
+ return React5__namespace.cloneElement(children, {
166
+ ...mergeProps2(slotProps, childProps),
167
+ ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
168
+ });
169
+ }
170
+ if (React5__namespace.Children.count(children) > 1) {
171
+ const childrenArray = React5__namespace.Children.toArray(children);
172
+ const slottableChild = childrenArray.find(
173
+ (child) => React5__namespace.isValidElement(child) && child.type === Slottable
174
+ );
175
+ if (slottableChild) {
176
+ const newElement = slottableChild.props.children;
177
+ if (isSlottable(newElement)) {
178
+ const newElementProps = newElement.props;
179
+ const newChildren = childrenArray.map((child) => {
180
+ if (child === slottableChild) {
181
+ return React5__namespace.Children.count(newElementProps.children) > 1 ? React5__namespace.Children.only(null) : newElementProps.children;
182
+ }
183
+ return child;
184
+ });
185
+ const childRef = newElementProps.ref;
186
+ return React5__namespace.cloneElement(newElement, {
187
+ ...mergeProps2(slotProps, newElementProps),
188
+ ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
189
+ children: newChildren
190
+ });
191
+ }
192
+ }
193
+ }
194
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
195
+ });
196
+ Slot.displayName = "Slot";
197
+ function Slottable({ children }) {
198
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
199
+ }
200
+ var buttonVariants = classVarianceAuthority.cva(
201
+ "[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-sm outline-none transition-[box-shadow,scale] duration-150 ease-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 motion-reduce:transition-shadow [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
202
+ {
203
+ defaultVariants: {
204
+ size: "default",
205
+ static: false,
206
+ variant: "default"
207
+ },
208
+ variants: {
209
+ static: {
210
+ false: "motion-safe:active:not-disabled:scale-[0.96]",
211
+ true: null
212
+ },
213
+ size: {
214
+ default: "h-10 min-w-10 px-[calc(--spacing(3)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
215
+ icon: "size-10 pointer-coarse:size-11",
216
+ "icon-lg": "size-11",
217
+ "icon-sm": "size-8 pointer-coarse:size-11",
218
+ "icon-xl": 'size-11 [&_svg:not([class*="size-"])]:size-5',
219
+ "icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:size-11 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4',
220
+ lg: "h-11 min-w-11 px-[calc(--spacing(3.5)-1px)]",
221
+ sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
222
+ xl: 'h-12 min-w-12 px-[calc(--spacing(4)-1px)] text-lg [&_svg:not([class*="size-"])]:size-5',
223
+ xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11 [&_svg:not([class*="size-"])]:size-3.5'
224
+ },
225
+ variant: {
226
+ default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
227
+ destructive: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
228
+ "destructive-outline": "border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8",
229
+ ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
230
+ link: "border-transparent underline-offset-4 hover:underline",
231
+ outline: "border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64",
232
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
233
+ }
234
+ }
235
+ }
236
+ );
237
+ var Button = React5__namespace.forwardRef(
238
+ ({ className, variant, size, static: isStatic, asChild, children, type = "button", ...props }, ref) => {
239
+ const buttonClasses = cn(buttonVariants({ className, size, static: isStatic, variant }));
240
+ const Comp = asChild ? Slot : "button";
241
+ if (asChild) {
242
+ const SlottedComp = Comp;
243
+ return /* @__PURE__ */ jsxRuntime.jsx(
244
+ SlottedComp,
245
+ {
246
+ ref,
247
+ className: buttonClasses,
248
+ "data-slot": "button",
249
+ ...props,
250
+ children
251
+ }
252
+ );
253
+ }
254
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
255
+ }
256
+ );
257
+ Button.displayName = "Button";
258
+
259
+ // src/lib/motion/motion-config.ts
260
+ var easings = {
261
+ /** Physical feel for exit animations */
262
+ physicalExit: [0.4, 0, 0.6, 1]
263
+ };
264
+ var durations = {
265
+ /** Quick transitions (tooltips, small elements) */
266
+ fast: 0.15,
267
+ /** Standard UI transitions (modals, panels) */
268
+ normal: 0.2};
269
+ function useControllableState({
270
+ prop,
271
+ defaultProp,
272
+ onChange
273
+ }) {
274
+ const [uncontrolledValue, setUncontrolledValue] = React5.useState(defaultProp);
275
+ const isControlled = prop !== void 0;
276
+ const value = isControlled ? prop : uncontrolledValue;
277
+ const onChangeRef = React5.useRef(onChange);
278
+ React5.useEffect(() => {
279
+ onChangeRef.current = onChange;
280
+ }, [onChange]);
281
+ const setValue = React5.useCallback(
282
+ (newValue) => {
283
+ if (!isControlled) {
284
+ setUncontrolledValue(newValue);
285
+ }
286
+ onChangeRef.current?.(newValue);
287
+ },
288
+ [isControlled]
289
+ );
290
+ return [value, setValue];
291
+ }
292
+ var SheetStackContext = React5__namespace.createContext(void 0);
293
+ var SHEET_INDENT = 24;
294
+ var useSheetStack = () => {
295
+ return React5__namespace.useContext(SheetStackContext);
296
+ };
297
+ var SheetNestingContext = React5__namespace.createContext({
298
+ level: 0,
299
+ parentSheetId: null
300
+ });
301
+ var useSheetNesting = () => React5__namespace.useContext(SheetNestingContext);
302
+ var SheetContext = React5__namespace.createContext(void 0);
303
+ var useSheet = () => {
304
+ const context = React5__namespace.useContext(SheetContext);
305
+ if (!context) {
306
+ throw new Error("useSheet must be used within a Sheet");
307
+ }
308
+ return context;
309
+ };
310
+ function Sheet({
311
+ children,
312
+ sheetId: providedId,
313
+ open: openProp,
314
+ defaultOpen = false,
315
+ onOpenChange,
316
+ modal,
317
+ ...props
318
+ }) {
319
+ const [isOpen, setIsOpen] = useControllableState({
320
+ prop: openProp,
321
+ defaultProp: defaultOpen,
322
+ onChange: onOpenChange
323
+ });
324
+ const sheetStack = useSheetStack();
325
+ const nesting = useSheetNesting();
326
+ const generatedId = React5__namespace.useId();
327
+ const sheetId = providedId ?? `sheet-${generatedId.replace(/:/g, "")}`;
328
+ const depth = nesting.level;
329
+ const close = React5__namespace.useCallback(() => {
330
+ setIsOpen(false);
331
+ }, [setIsOpen]);
332
+ const registerSheet = sheetStack?.registerSheet;
333
+ const unregisterSheet = sheetStack?.unregisterSheet;
334
+ React5__namespace.useEffect(() => {
335
+ if (registerSheet && isOpen) {
336
+ if (document.activeElement instanceof HTMLElement) {
337
+ document.activeElement.blur();
338
+ }
339
+ registerSheet({ id: sheetId, depth, close });
340
+ return () => unregisterSheet?.(sheetId);
341
+ }
342
+ }, [isOpen, sheetId, depth, close, registerSheet, unregisterSheet]);
343
+ const handleOpenChange = React5__namespace.useCallback((open, _eventDetails) => {
344
+ setIsOpen(open);
345
+ }, [setIsOpen]);
346
+ const sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;
347
+ const isTopSheet = sheetStack?.isTopSheet(sheetId) ?? true;
348
+ const isNested = depth > 0;
349
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetNestingContext.Provider, { value: { level: depth + 1, parentSheetId: sheetId }, children: /* @__PURE__ */ jsxRuntime.jsx(SheetContext.Provider, { value: { isOpen, sheetId, depth, sheetsAbove, isTopSheet, close }, children: /* @__PURE__ */ jsxRuntime.jsx(
350
+ dialog.Dialog.Root,
351
+ {
352
+ "data-slot": "sheet",
353
+ ...props,
354
+ open: isOpen,
355
+ modal: isNested ? false : modal,
356
+ onOpenChange: handleOpenChange,
357
+ children
358
+ }
359
+ ) }) });
360
+ }
361
+ function SheetPortal({ forceMount: _forceMount, container: containerProp, ...props }) {
362
+ const rootContainer = portal.useRootPortalContainer();
363
+ const container = containerProp === void 0 ? rootContainer ?? void 0 : containerProp;
364
+ const style = {
365
+ ...props.style ?? {},
366
+ ["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
367
+ };
368
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Portal, { "data-slot": "sheet-portal", container, ...props, style });
369
+ }
370
+ var sheetVariants = classVarianceAuthority.cva("fixed flex flex-col gap-3 bg-background p-4 shadow-lg", {
371
+ variants: {
372
+ side: {
373
+ top: "inset-x-0 top-0 border-b",
374
+ bottom: "inset-x-0 bottom-0 border-t",
375
+ left: "inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
376
+ right: "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"
377
+ }
378
+ },
379
+ defaultVariants: {
380
+ side: "right"
381
+ }
382
+ });
383
+ var NESTED_SHEET_WIDTH = 448;
384
+ var SHEET_STACK_GAP = 0;
385
+ function getPushOffset(side, sheetsAbove, stackMode = "cascade", collapseBaseSize = NESTED_SHEET_WIDTH) {
386
+ if (sheetsAbove === 0) {
387
+ return { x: 0, y: 0 };
388
+ }
389
+ if (stackMode === "collapse") {
390
+ const baseOffset = collapseBaseSize + SHEET_STACK_GAP;
391
+ const offset2 = baseOffset + (sheetsAbove - 1) * SHEET_INDENT;
392
+ switch (side) {
393
+ case "right":
394
+ return { x: -offset2 };
395
+ case "left":
396
+ return { x: offset2 };
397
+ case "top":
398
+ return { y: offset2 };
399
+ case "bottom":
400
+ return { y: -offset2 };
401
+ }
402
+ }
403
+ const offset = sheetsAbove * SHEET_INDENT;
404
+ switch (side) {
405
+ case "right":
406
+ return { x: -offset };
407
+ case "left":
408
+ return { x: offset };
409
+ case "top":
410
+ return { y: offset };
411
+ case "bottom":
412
+ return { y: -offset };
413
+ }
414
+ }
415
+ function getInitialPosition(side) {
416
+ switch (side) {
417
+ case "right":
418
+ return { x: "100%" };
419
+ case "left":
420
+ return { x: "-100%" };
421
+ case "top":
422
+ return { y: "-100%" };
423
+ case "bottom":
424
+ return { y: "100%" };
425
+ }
426
+ }
427
+ function getExitPosition(side) {
428
+ switch (side) {
429
+ case "right":
430
+ return { x: "100%" };
431
+ case "left":
432
+ return { x: "-100%" };
433
+ case "top":
434
+ return { y: "-100%" };
435
+ case "bottom":
436
+ return { y: "100%" };
437
+ }
438
+ }
439
+ var defaultSheetTransition = {
440
+ type: "tween",
441
+ duration: durations.normal,
442
+ ease: [0.32, 0.72, 0, 1]
443
+ // Custom ease-out for snappy feel
444
+ };
445
+ function SheetContent({
446
+ side = "right",
447
+ className,
448
+ transition = defaultSheetTransition,
449
+ overlay = true,
450
+ showClose = true,
451
+ children,
452
+ forceMount: _forceMount,
453
+ onInteractOutside: _onInteractOutside,
454
+ onPointerDownOutside: _onPointerDownOutside,
455
+ onEscapeKeyDown: _onEscapeKeyDown,
456
+ onFocusOutside: _onFocusOutside,
457
+ ...props
458
+ }) {
459
+ const { isOpen, depth, sheetId } = useSheet();
460
+ const sheetStack = useSheetStack();
461
+ const sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;
462
+ const stackMode = sheetStack?.stackMode ?? "cascade";
463
+ const resolvedSide = side ?? "right";
464
+ const zIndex = `calc(var(--z-layer-modal-content) + ${depth * 10})`;
465
+ const topSheetId = sheetStack?.sheets[sheetStack.sheets.length - 1]?.id;
466
+ const topSheetSize = topSheetId ? sheetStack?.getSheetSize(topSheetId) : void 0;
467
+ const collapseBaseSize = topSheetSize ? resolvedSide === "left" || resolvedSide === "right" ? topSheetSize.width : topSheetSize.height : void 0;
468
+ const pushOffset = getPushOffset(resolvedSide, sheetsAbove, stackMode, collapseBaseSize ?? NESTED_SHEET_WIDTH);
469
+ const contentRef = React5__namespace.useRef(null);
470
+ React5__namespace.useLayoutEffect(() => {
471
+ if (!isOpen) return;
472
+ if (!sheetStack) return;
473
+ const el = contentRef.current;
474
+ if (!el) return;
475
+ let rafId = 0;
476
+ const update = () => {
477
+ const rect = el.getBoundingClientRect();
478
+ sheetStack.setSheetSize(sheetId, { width: rect.width, height: rect.height });
479
+ };
480
+ update();
481
+ if (typeof ResizeObserver === "undefined") return;
482
+ const ro = new ResizeObserver(() => {
483
+ cancelAnimationFrame(rafId);
484
+ rafId = requestAnimationFrame(update);
485
+ });
486
+ ro.observe(el);
487
+ return () => {
488
+ cancelAnimationFrame(rafId);
489
+ ro.disconnect();
490
+ };
491
+ }, [isOpen, sheetId, sheetStack]);
492
+ const animatePosition = {
493
+ x: pushOffset.x ?? 0,
494
+ y: pushOffset.y ?? 0
495
+ };
496
+ const exitTransition = {
497
+ type: "tween",
498
+ duration: durations.normal,
499
+ ease: easings.physicalExit
500
+ };
501
+ return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: isOpen && /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { "data-slot": "sheet-portal", children: [
502
+ overlay && depth === 0 && /* @__PURE__ */ jsxRuntime.jsx(
503
+ dialog.Dialog.Backdrop,
504
+ {
505
+ "data-slot": "sheet-overlay",
506
+ render: /* @__PURE__ */ jsxRuntime.jsx(
507
+ react.motion.div,
508
+ {
509
+ className: "fixed inset-0 bg-black/80",
510
+ initial: { opacity: 0 },
511
+ animate: { opacity: 1 },
512
+ exit: { opacity: 0 },
513
+ transition: { duration: durations.fast, ease: "easeOut" },
514
+ style: { zIndex: "var(--z-layer-modal-backdrop)" }
515
+ },
516
+ "sheet-overlay"
517
+ )
518
+ }
519
+ ),
520
+ /* @__PURE__ */ jsxRuntime.jsxs(
521
+ dialog.Dialog.Popup,
522
+ {
523
+ "data-slot": "sheet-content",
524
+ "data-sheet-depth": depth,
525
+ "data-sheet-id": sheetId,
526
+ ...props,
527
+ render: /* @__PURE__ */ jsxRuntime.jsx(
528
+ react.motion.div,
529
+ {
530
+ ref: contentRef,
531
+ variants: {
532
+ initial: getInitialPosition(resolvedSide),
533
+ animate: animatePosition,
534
+ exit: {
535
+ ...getExitPosition(resolvedSide),
536
+ transition: exitTransition
537
+ }
538
+ },
539
+ initial: "initial",
540
+ animate: "animate",
541
+ exit: "exit",
542
+ transition,
543
+ style: { zIndex },
544
+ className: cn(sheetVariants({ side: resolvedSide }), className)
545
+ },
546
+ `sheet-content-${sheetId}`
547
+ ),
548
+ children: [
549
+ /* @__PURE__ */ jsxRuntime.jsx(portal.ModalPortalScope, { children }),
550
+ showClose && /* @__PURE__ */ jsxRuntime.jsxs(
551
+ dialog.Dialog.Close,
552
+ {
553
+ "data-slot": "sheet-close",
554
+ className: "ring-offset-background focus:ring-ring data-[open]:bg-secondary absolute top-4 right-4\n rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2\n focus:outline-none disabled:pointer-events-none",
555
+ children: [
556
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
557
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
558
+ ]
559
+ }
560
+ )
561
+ ]
562
+ }
563
+ )
564
+ ] }) });
565
+ }
566
+ function SheetHeader({ className, ...props }) {
567
+ return /* @__PURE__ */ jsxRuntime.jsx(
568
+ "div",
569
+ {
570
+ "data-slot": "sheet-header",
571
+ className: cn("flex flex-col space-y-2 pb-4 text-center sm:text-left", className),
572
+ ...props
573
+ }
574
+ );
575
+ }
576
+ function SheetTitle({ className, ...props }) {
577
+ return /* @__PURE__ */ jsxRuntime.jsx(
578
+ dialog.Dialog.Title,
579
+ {
580
+ "data-slot": "sheet-title",
581
+ className: cn("text-foreground text-lg font-semibold", className),
582
+ ...props
583
+ }
584
+ );
585
+ }
586
+ function SheetDescription({ className, ...props }) {
587
+ return /* @__PURE__ */ jsxRuntime.jsx(
588
+ dialog.Dialog.Description,
589
+ {
590
+ "data-slot": "sheet-description",
591
+ className: cn("text-muted-foreground text-sm", className),
592
+ ...props
593
+ }
594
+ );
595
+ }
596
+ function TooltipProvider({ delay = 0, delayDuration, ...props }) {
597
+ return /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Provider, { "data-slot": "tooltip-provider", delay: delayDuration ?? delay, ...props });
598
+ }
599
+ function Tooltip({ delayDuration: _delayDuration, ...props }) {
600
+ return /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Root, { "data-slot": "tooltip", ...props });
601
+ }
602
+ function TooltipTrigger({ delay = 0, asChild, children, render, ...props }) {
603
+ const childRender = render === void 0 && asChild && React5__namespace.isValidElement(children) ? children : void 0;
604
+ return /* @__PURE__ */ jsxRuntime.jsx(
605
+ tooltip.Tooltip.Trigger,
606
+ {
607
+ "data-slot": "tooltip-trigger",
608
+ delay,
609
+ render: render ?? childRender,
610
+ ...props,
611
+ children: childRender ? void 0 : children
612
+ }
613
+ );
614
+ }
615
+ function TooltipContent({
616
+ className,
617
+ sideOffset = 4,
618
+ showArrow = false,
619
+ side = "top",
620
+ align = "center",
621
+ children,
622
+ ...props
623
+ }) {
624
+ const { container, zIndexClass } = portal.useFloatingOverlayPortalProps();
625
+ return /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Positioner, { side, align, sideOffset, className: zIndexClass, children: /* @__PURE__ */ jsxRuntime.jsxs(
626
+ tooltip.Tooltip.Popup,
627
+ {
628
+ "data-slot": "tooltip-content",
629
+ className: cn(
630
+ `bg-popover text-popover-foreground origin-(--transform-origin) relative max-w-70 rounded-md border px-2 py-1
631
+ text-xs transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
632
+ data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
633
+ data-[side=bottom]:data-starting-style:-translate-y-2
634
+ data-[side=left]:data-starting-style:translate-x-2
635
+ data-[side=right]:data-starting-style:-translate-x-2
636
+ data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
637
+ className
638
+ ),
639
+ ...props,
640
+ role: "tooltip",
641
+ children: [
642
+ children,
643
+ showArrow && /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]" })
644
+ ]
645
+ }
646
+ ) }) });
647
+ }
648
+ var SIDEBAR_COOKIE_NAME = "sidebar_state";
649
+ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
650
+ var SIDEBAR_WIDTH = "16rem";
651
+ var SIDEBAR_WIDTH_MOBILE = "18rem";
652
+ var SIDEBAR_WIDTH_ICON = "3rem";
653
+ var SIDEBAR_KEYBOARD_SHORTCUT = "b";
654
+ var SidebarContext = React5__namespace.createContext(null);
655
+ function useSidebar() {
656
+ const context = React5__namespace.useContext(SidebarContext);
657
+ if (!context) {
658
+ throw new Error("useSidebar must be used within a SidebarProvider.");
659
+ }
660
+ return context;
661
+ }
662
+ function SidebarProvider({
663
+ defaultOpen = true,
664
+ open: openProp,
665
+ onOpenChange: setOpenProp,
666
+ className,
667
+ style,
668
+ children,
669
+ ...props
670
+ }) {
671
+ const isMobile = useIsMobile();
672
+ const sidebarId = React5__namespace.useId();
673
+ const [openMobile, setOpenMobile] = React5__namespace.useState(false);
674
+ const [_open, _setOpen] = React5__namespace.useState(defaultOpen);
675
+ const open = openProp ?? _open;
676
+ const setOpen = React5__namespace.useCallback(
677
+ (value) => {
678
+ const openState = typeof value === "function" ? value(open) : value;
679
+ if (setOpenProp) {
680
+ setOpenProp(openState);
681
+ } else {
682
+ _setOpen(openState);
683
+ }
684
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
685
+ },
686
+ [open, setOpenProp]
687
+ );
688
+ const toggleSidebar = React5__namespace.useCallback(() => {
689
+ return isMobile ? setOpenMobile((currentOpen) => !currentOpen) : setOpen((currentOpen) => !currentOpen);
690
+ }, [isMobile, setOpen]);
691
+ React5__namespace.useEffect(() => {
692
+ const handleKeyDown = (event) => {
693
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
694
+ event.preventDefault();
695
+ toggleSidebar();
696
+ }
697
+ };
698
+ window.addEventListener("keydown", handleKeyDown);
699
+ return () => window.removeEventListener("keydown", handleKeyDown);
700
+ }, [toggleSidebar]);
701
+ const state = open ? "expanded" : "collapsed";
702
+ const contextValue = React5__namespace.useMemo(
703
+ () => ({
704
+ sidebarId,
705
+ state,
706
+ open,
707
+ setOpen,
708
+ isMobile,
709
+ openMobile,
710
+ setOpenMobile,
711
+ toggleSidebar
712
+ }),
713
+ [sidebarId, state, open, setOpen, isMobile, openMobile, toggleSidebar]
714
+ );
715
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { delay: 0, children: /* @__PURE__ */ jsxRuntime.jsx(
716
+ "div",
717
+ {
718
+ "data-slot": "sidebar-wrapper",
719
+ style: {
720
+ "--sidebar-width": SIDEBAR_WIDTH,
721
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
722
+ ...style
723
+ },
724
+ className: cn("group/sidebar-wrapper flex min-h-dvh w-full has-data-[variant=inset]:bg-sidebar", className),
725
+ ...props,
726
+ children
727
+ }
728
+ ) }) });
729
+ }
730
+ function Sidebar({
731
+ side = "left",
732
+ variant = "sidebar",
733
+ collapsible = "offcanvas",
734
+ className,
735
+ children,
736
+ dir,
737
+ ...props
738
+ }) {
739
+ const { isMobile, sidebarId, state, openMobile, setOpenMobile } = useSidebar();
740
+ if (collapsible === "none") {
741
+ return /* @__PURE__ */ jsxRuntime.jsx(
742
+ "div",
743
+ {
744
+ id: sidebarId,
745
+ "data-slot": "sidebar",
746
+ className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className),
747
+ ...props,
748
+ children
749
+ }
750
+ );
751
+ }
752
+ if (isMobile) {
753
+ return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
754
+ SheetContent,
755
+ {
756
+ id: sidebarId,
757
+ dir,
758
+ "data-sidebar": "sidebar",
759
+ "data-slot": "sidebar",
760
+ "data-mobile": "true",
761
+ className: `w-(--sidebar-width) bg-sidebar pt-[env(safe-area-inset-top)]
762
+ pb-[env(safe-area-inset-bottom)] text-sidebar-foreground [&_[data-sidebar=header]]:pr-12
763
+ [&>[data-slot=sheet-close]]:top-[calc(env(safe-area-inset-top)+0.5rem)]
764
+ [&>[data-slot=sheet-close]]:right-2 [&>[data-slot=sheet-close]]:flex
765
+ [&>[data-slot=sheet-close]]:size-10 [&>[data-slot=sheet-close]]:items-center
766
+ [&>[data-slot=sheet-close]]:justify-center [&>[data-slot=sheet-close]]:rounded-lg
767
+ [&>[data-slot=sheet-close]]:opacity-100 pointer-coarse:[&>[data-slot=sheet-close]]:size-11`,
768
+ style: {
769
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
770
+ },
771
+ side,
772
+ children: [
773
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { className: "sr-only", children: [
774
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Sidebar" }),
775
+ /* @__PURE__ */ jsxRuntime.jsx(SheetDescription, { children: "Displays the mobile sidebar." })
776
+ ] }),
777
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full flex-col", children })
778
+ ]
779
+ }
780
+ ) });
781
+ }
782
+ return /* @__PURE__ */ jsxRuntime.jsxs(
783
+ "div",
784
+ {
785
+ id: sidebarId,
786
+ className: "group peer hidden text-sidebar-foreground md:block",
787
+ "data-state": state,
788
+ "data-collapsible": state === "collapsed" ? collapsible : "",
789
+ "data-variant": variant,
790
+ "data-side": side,
791
+ "data-slot": "sidebar",
792
+ children: [
793
+ /* @__PURE__ */ jsxRuntime.jsx(
794
+ "div",
795
+ {
796
+ "data-slot": "sidebar-gap",
797
+ className: cn(
798
+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear motion-reduce:transition-none",
799
+ "group-data-[collapsible=offcanvas]:w-0",
800
+ "group-data-[side=right]:rotate-180",
801
+ variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
802
+ )
803
+ }
804
+ ),
805
+ /* @__PURE__ */ jsxRuntime.jsx(
806
+ "div",
807
+ {
808
+ "data-slot": "sidebar-container",
809
+ "data-side": side,
810
+ className: cn(
811
+ `fixed inset-y-0 z-10 hidden h-dvh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear
812
+ data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]
813
+ data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]
814
+ motion-reduce:transition-none md:flex`,
815
+ 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
816
+ group-data-[side=right]:border-l`,
817
+ className
818
+ ),
819
+ ...props,
820
+ children: /* @__PURE__ */ jsxRuntime.jsx(
821
+ "div",
822
+ {
823
+ "data-sidebar": "sidebar",
824
+ "data-slot": "sidebar-inner",
825
+ className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg\n group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1\n group-data-[variant=floating]:ring-sidebar-border",
826
+ children
827
+ }
828
+ )
829
+ }
830
+ )
831
+ ]
832
+ }
833
+ );
834
+ }
835
+ function SidebarTrigger({ className, onClick, ...props }) {
836
+ const { isMobile, open, openMobile, sidebarId, toggleSidebar } = useSidebar();
837
+ return /* @__PURE__ */ jsxRuntime.jsxs(
838
+ Button,
839
+ {
840
+ "aria-controls": sidebarId,
841
+ "aria-expanded": isMobile ? openMobile : open,
842
+ "data-sidebar": "trigger",
843
+ "data-slot": "sidebar-trigger",
844
+ variant: "ghost",
845
+ size: "icon-sm",
846
+ className: cn(className),
847
+ onClick: (event) => {
848
+ onClick?.(event);
849
+ toggleSidebar();
850
+ },
851
+ ...props,
852
+ children: [
853
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeftIcon, {}),
854
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
855
+ ]
856
+ }
857
+ );
858
+ }
859
+ function SidebarRail({ className, ...props }) {
860
+ const { toggleSidebar } = useSidebar();
861
+ return /* @__PURE__ */ jsxRuntime.jsx(
862
+ "button",
863
+ {
864
+ type: "button",
865
+ "data-sidebar": "rail",
866
+ "data-slot": "sidebar-rail",
867
+ "aria-label": "Toggle Sidebar",
868
+ tabIndex: -1,
869
+ onClick: toggleSidebar,
870
+ title: "Toggle Sidebar",
871
+ className: cn(
872
+ `absolute inset-y-0 z-20 hidden w-4 transition-[transform,background-color] duration-200 ease-linear group-data-[side=left]:-right-4
873
+ group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-px
874
+ hover:after:bg-sidebar-border motion-reduce:transition-none sm:flex ltr:-translate-x-1/2 rtl:translate-x-1/2`,
875
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
876
+ `[[data-side=left][data-state=collapsed]_&]:cursor-e-resize
877
+ [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,
878
+ `group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:start-full
879
+ hover:group-data-[collapsible=offcanvas]:bg-sidebar`,
880
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
881
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
882
+ className
883
+ ),
884
+ ...props
885
+ }
886
+ );
887
+ }
888
+ function SidebarInset({ className, ...props }) {
889
+ return /* @__PURE__ */ jsxRuntime.jsx(
890
+ "main",
891
+ {
892
+ "data-slot": "sidebar-inset",
893
+ className: cn(
894
+ `relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2
895
+ md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl
896
+ md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,
897
+ className
898
+ ),
899
+ ...props
900
+ }
901
+ );
902
+ }
903
+ function SidebarHeader({ className, ...props }) {
904
+ return /* @__PURE__ */ jsxRuntime.jsx(
905
+ "div",
906
+ {
907
+ "data-slot": "sidebar-header",
908
+ "data-sidebar": "header",
909
+ className: cn("flex flex-col gap-2 p-2", className),
910
+ ...props
911
+ }
912
+ );
913
+ }
914
+ function SidebarFooter({ className, ...props }) {
915
+ return /* @__PURE__ */ jsxRuntime.jsx(
916
+ "div",
917
+ {
918
+ "data-slot": "sidebar-footer",
919
+ "data-sidebar": "footer",
920
+ className: cn("flex flex-col gap-2 p-2", className),
921
+ ...props
922
+ }
923
+ );
924
+ }
925
+ function SidebarSeparator({ className, ...props }) {
926
+ return /* @__PURE__ */ jsxRuntime.jsx(
927
+ Separator,
928
+ {
929
+ "data-slot": "sidebar-separator",
930
+ "data-sidebar": "separator",
931
+ className: cn("mx-2 w-auto bg-sidebar-border", className),
932
+ ...props
933
+ }
934
+ );
935
+ }
936
+ function SidebarContent({ className, ...props }) {
937
+ return /* @__PURE__ */ jsxRuntime.jsx(
938
+ "div",
939
+ {
940
+ "data-slot": "sidebar-content",
941
+ "data-sidebar": "content",
942
+ className: cn(
943
+ "scrollbar-hide flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
944
+ className
945
+ ),
946
+ ...props
947
+ }
948
+ );
949
+ }
950
+ function SidebarGroup({ className, ...props }) {
951
+ return /* @__PURE__ */ jsxRuntime.jsx(
952
+ "div",
953
+ {
954
+ "data-slot": "sidebar-group",
955
+ "data-sidebar": "group",
956
+ className: cn("relative flex w-full min-w-0 flex-col p-2", className),
957
+ ...props
958
+ }
959
+ );
960
+ }
961
+ function SidebarGroupLabel({
962
+ className,
963
+ render,
964
+ ...props
965
+ }) {
966
+ return useRender.useRender({
967
+ defaultTagName: "div",
968
+ props: mergeProps.mergeProps(
969
+ {
970
+ className: cn(
971
+ `flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70
972
+ ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear
973
+ group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2
974
+ motion-reduce:transition-none [&>svg]:size-4 [&>svg]:shrink-0`,
975
+ className
976
+ )
977
+ },
978
+ props
979
+ ),
980
+ render,
981
+ state: {
982
+ slot: "sidebar-group-label",
983
+ sidebar: "group-label"
984
+ }
985
+ });
986
+ }
987
+ function SidebarGroupContent({ className, ...props }) {
988
+ return /* @__PURE__ */ jsxRuntime.jsx(
989
+ "div",
990
+ {
991
+ "data-slot": "sidebar-group-content",
992
+ "data-sidebar": "group-content",
993
+ className: cn("w-full text-sm", className),
994
+ ...props
995
+ }
996
+ );
997
+ }
998
+ function SidebarMenu({ className, ...props }) {
999
+ return /* @__PURE__ */ jsxRuntime.jsx(
1000
+ "ul",
1001
+ {
1002
+ "data-slot": "sidebar-menu",
1003
+ "data-sidebar": "menu",
1004
+ className: cn("flex w-full min-w-0 flex-col gap-0", className),
1005
+ ...props
1006
+ }
1007
+ );
1008
+ }
1009
+ function SidebarMenuItem({ className, ...props }) {
1010
+ return /* @__PURE__ */ jsxRuntime.jsx(
1011
+ "li",
1012
+ {
1013
+ "data-slot": "sidebar-menu-item",
1014
+ "data-sidebar": "menu-item",
1015
+ className: cn("group/menu-item relative", className),
1016
+ ...props
1017
+ }
1018
+ );
1019
+ }
1020
+ var sidebarMenuButtonVariants = classVarianceAuthority.cva(
1021
+ `peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm
1022
+ ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8
1023
+ group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent
1024
+ hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent
1025
+ active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50
1026
+ aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent
1027
+ data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium
1028
+ data-active:text-sidebar-accent-foreground pointer-coarse:min-h-11 motion-reduce:transition-none [&_svg]:size-4 [&_svg]:shrink-0
1029
+ [&>span:last-child]:truncate`,
1030
+ {
1031
+ variants: {
1032
+ variant: {
1033
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
1034
+ outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
1035
+ },
1036
+ size: {
1037
+ default: "h-8 text-sm",
1038
+ sm: "h-7 text-xs",
1039
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
1040
+ }
1041
+ },
1042
+ defaultVariants: {
1043
+ variant: "default",
1044
+ size: "default"
1045
+ }
1046
+ }
1047
+ );
1048
+ function SidebarMenuButton({
1049
+ render,
1050
+ isActive = false,
1051
+ variant = "default",
1052
+ size = "default",
1053
+ tooltip,
1054
+ className,
1055
+ ...props
1056
+ }) {
1057
+ const { isMobile, state } = useSidebar();
1058
+ const component = useRender.useRender({
1059
+ defaultTagName: "button",
1060
+ props: mergeProps.mergeProps(
1061
+ {
1062
+ className: cn(sidebarMenuButtonVariants({ variant, size }), className)
1063
+ },
1064
+ props
1065
+ ),
1066
+ render: !tooltip ? render : /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { render }),
1067
+ state: {
1068
+ slot: "sidebar-menu-button",
1069
+ sidebar: "menu-button",
1070
+ size,
1071
+ active: isActive
1072
+ }
1073
+ });
1074
+ if (!tooltip) {
1075
+ return component;
1076
+ }
1077
+ const tooltipProps = typeof tooltip === "string" ? { children: tooltip } : tooltip;
1078
+ return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
1079
+ component,
1080
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "right", align: "center", hidden: state !== "collapsed" || isMobile, ...tooltipProps })
1081
+ ] });
1082
+ }
1083
+ function SidebarMenuAction({
1084
+ className,
1085
+ render,
1086
+ showOnHover = false,
1087
+ ...props
1088
+ }) {
1089
+ return useRender.useRender({
1090
+ defaultTagName: "button",
1091
+ props: mergeProps.mergeProps(
1092
+ {
1093
+ className: cn(
1094
+ `absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0
1095
+ text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform
1096
+ group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground
1097
+ peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5
1098
+ peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent
1099
+ hover:text-sidebar-accent-foreground focus-visible:ring-2 motion-reduce:transition-none md:after:hidden
1100
+ [&>svg]:size-4 [&>svg]:shrink-0`,
1101
+ showOnHover && `group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100
1102
+ peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,
1103
+ className
1104
+ )
1105
+ },
1106
+ props
1107
+ ),
1108
+ render,
1109
+ state: {
1110
+ slot: "sidebar-menu-action",
1111
+ sidebar: "menu-action"
1112
+ }
1113
+ });
1114
+ }
1115
+ function SidebarMenuBadge({ className, ...props }) {
1116
+ return /* @__PURE__ */ jsxRuntime.jsx(
1117
+ "div",
1118
+ {
1119
+ "data-slot": "sidebar-menu-badge",
1120
+ "data-sidebar": "menu-badge",
1121
+ className: cn(
1122
+ `pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1
1123
+ text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden
1124
+ peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5
1125
+ peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1
1126
+ peer-data-active/menu-button:text-sidebar-accent-foreground`,
1127
+ className
1128
+ ),
1129
+ ...props
1130
+ }
1131
+ );
1132
+ }
1133
+ function SidebarMenuSub({ className, ...props }) {
1134
+ return /* @__PURE__ */ jsxRuntime.jsx(
1135
+ "ul",
1136
+ {
1137
+ "data-slot": "sidebar-menu-sub",
1138
+ "data-sidebar": "menu-sub",
1139
+ className: cn(
1140
+ `mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5
1141
+ group-data-[collapsible=icon]:hidden`,
1142
+ className
1143
+ ),
1144
+ ...props
1145
+ }
1146
+ );
1147
+ }
1148
+ function SidebarMenuSubItem({ className, ...props }) {
1149
+ return /* @__PURE__ */ jsxRuntime.jsx(
1150
+ "li",
1151
+ {
1152
+ "data-slot": "sidebar-menu-sub-item",
1153
+ "data-sidebar": "menu-sub-item",
1154
+ className: cn("group/menu-sub-item relative", className),
1155
+ ...props
1156
+ }
1157
+ );
1158
+ }
1159
+ function SidebarMenuSubButton({
1160
+ render,
1161
+ size = "md",
1162
+ isActive = false,
1163
+ className,
1164
+ ...props
1165
+ }) {
1166
+ return useRender.useRender({
1167
+ defaultTagName: "a",
1168
+ props: mergeProps.mergeProps(
1169
+ {
1170
+ className: cn(
1171
+ `flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2
1172
+ text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden
1173
+ hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent
1174
+ active:text-sidebar-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50
1175
+ data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent
1176
+ data-active:text-sidebar-accent-foreground pointer-coarse:min-h-11 [&>span:last-child]:truncate [&>svg]:size-4
1177
+ [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,
1178
+ className
1179
+ )
1180
+ },
1181
+ props
1182
+ ),
1183
+ render,
1184
+ state: {
1185
+ slot: "sidebar-menu-sub-button",
1186
+ sidebar: "menu-sub-button",
1187
+ size,
1188
+ active: isActive
1189
+ }
1190
+ });
1191
+ }
1192
+ function createAppLink(renderLink, props) {
1193
+ return renderLink ? renderLink(props) : /* @__PURE__ */ jsxRuntime.jsx("a", { ...props });
1194
+ }
1195
+ function AppBar({
1196
+ breadcrumbs = [],
1197
+ renderLink,
1198
+ leading,
1199
+ search,
1200
+ actions,
1201
+ toggleLabel = "Toggle navigation",
1202
+ className,
1203
+ render,
1204
+ ...props
1205
+ }) {
1206
+ const content = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-[var(--app-bar-height,3.5rem)] w-full min-w-0 items-center gap-2 px-3 sm:px-4", children: [
1207
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarTrigger, { "aria-label": toggleLabel, className: "-ms-1 shrink-0" }),
1208
+ (leading || breadcrumbs.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "vertical", className: "mr-1 hidden h-4 self-center sm:block" }),
1209
+ leading,
1210
+ breadcrumbs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { className: "min-w-0 flex-1 sm:flex-none", children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbList, { className: "flex-nowrap text-sm text-muted-foreground", children: breadcrumbs.map((item, index) => {
1211
+ const current = item.current ?? index === breadcrumbs.length - 1;
1212
+ const breadcrumbContent = current || !item.href ? /* @__PURE__ */ jsxRuntime.jsx(
1213
+ BreadcrumbPage,
1214
+ {
1215
+ className: "block max-w-48 truncate font-semibold text-foreground sm:max-w-56",
1216
+ title: typeof item.label === "string" ? item.label : void 0,
1217
+ children: item.label
1218
+ }
1219
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1220
+ BreadcrumbLink,
1221
+ {
1222
+ className: "hover:text-foreground",
1223
+ title: typeof item.label === "string" ? item.label : void 0,
1224
+ render: createAppLink(renderLink, {
1225
+ href: item.href,
1226
+ children: item.label
1227
+ })
1228
+ }
1229
+ );
1230
+ return /* @__PURE__ */ jsxRuntime.jsxs(React5__namespace.Fragment, { children: [
1231
+ index > 0 && /* @__PURE__ */ jsxRuntime.jsx(
1232
+ BreadcrumbSeparator,
1233
+ {
1234
+ className: "text-muted-foreground/70 hidden sm:block"
1235
+ }
1236
+ ),
1237
+ /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { className: cn("min-w-0", !current && "hidden sm:flex"), children: breadcrumbContent })
1238
+ ] }, item.id);
1239
+ }) }) }),
1240
+ search && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto min-w-0", children: search }),
1241
+ actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex shrink-0 items-center gap-2", !search && "ml-auto"), children: actions })
1242
+ ] });
1243
+ return useRender.useRender({
1244
+ defaultTagName: "header",
1245
+ props: mergeProps.mergeProps(
1246
+ {
1247
+ className: cn("sticky top-0 z-30 flex w-full shrink-0 items-center border-b bg-background", className),
1248
+ children: content
1249
+ },
1250
+ props
1251
+ ),
1252
+ render,
1253
+ state: {
1254
+ slot: "app-bar"
1255
+ }
1256
+ });
1257
+ }
1258
+ function Avatar({ className, ...props }) {
1259
+ return /* @__PURE__ */ jsxRuntime.jsx(
1260
+ avatar.Avatar.Root,
1261
+ {
1262
+ "data-slot": "avatar",
1263
+ className: cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className),
1264
+ ...props
1265
+ }
1266
+ );
1267
+ }
1268
+ function AvatarImage({ className, ...props }) {
1269
+ return /* @__PURE__ */ jsxRuntime.jsx(
1270
+ avatar.Avatar.Image,
1271
+ {
1272
+ "data-slot": "avatar-image",
1273
+ className: cn(
1274
+ "aspect-square size-full outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10",
1275
+ className
1276
+ ),
1277
+ ...props
1278
+ }
1279
+ );
1280
+ }
1281
+ function AvatarFallback({ className, delayMs, delay, ...props }) {
1282
+ return /* @__PURE__ */ jsxRuntime.jsx(
1283
+ avatar.Avatar.Fallback,
1284
+ {
1285
+ "data-slot": "avatar-fallback",
1286
+ delay: delay ?? delayMs,
1287
+ className: cn("bg-secondary flex size-full items-center justify-center rounded-[inherit] text-xs", className),
1288
+ ...props
1289
+ }
1290
+ );
1291
+ }
1292
+ function Collapsible({
1293
+ className,
1294
+ ...props
1295
+ }) {
1296
+ return /* @__PURE__ */ jsxRuntime.jsx(
1297
+ collapsible.Collapsible.Root,
1298
+ {
1299
+ "data-slot": "collapsible",
1300
+ className: cn("group/collapsible", className),
1301
+ ...props
1302
+ }
1303
+ );
1304
+ }
1305
+ var CollapsibleTrigger = React5__namespace.forwardRef(({ className, asChild, nativeButton, children, render, ...props }, ref) => {
1306
+ const triggerClassName = cn(
1307
+ "group/trigger flex w-full cursor-pointer items-center justify-between text-sm font-medium outline-none transition-colors",
1308
+ "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
1309
+ "disabled:pointer-events-none disabled:opacity-50",
1310
+ "[&_[data-slot=collapsible-icon]]:transition-transform [&_[data-slot=collapsible-icon]]:duration-200",
1311
+ "[&[data-panel-open]_[data-slot=collapsible-icon]]:rotate-180",
1312
+ className
1313
+ );
1314
+ const childRender = render === void 0 && asChild && React5__namespace.isValidElement(children) ? children : void 0;
1315
+ return /* @__PURE__ */ jsxRuntime.jsx(
1316
+ collapsible.Collapsible.Trigger,
1317
+ {
1318
+ ref,
1319
+ "data-slot": "collapsible-trigger",
1320
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
1321
+ className: triggerClassName,
1322
+ render: render ?? childRender,
1323
+ ...props,
1324
+ children: childRender ? void 0 : children
1325
+ }
1326
+ );
1327
+ });
1328
+ CollapsibleTrigger.displayName = "CollapsibleTrigger";
1329
+ var CollapsiblePanel = React5__namespace.forwardRef(
1330
+ ({ className, innerClassName, children, ...props }, ref) => {
1331
+ return /* @__PURE__ */ jsxRuntime.jsx(
1332
+ collapsible.Collapsible.Panel,
1333
+ {
1334
+ ref,
1335
+ "data-slot": "collapsible-panel",
1336
+ className: cn(
1337
+ "h-[var(--collapsible-panel-height)] overflow-hidden text-sm",
1338
+ "origin-top transition-[opacity,transform] duration-200 ease-out motion-reduce:transition-none",
1339
+ "data-[ending-style]:translate-y-1 data-[ending-style]:opacity-0 data-[starting-style]:translate-y-1 data-[starting-style]:opacity-0",
1340
+ className
1341
+ ),
1342
+ ...props,
1343
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1344
+ "div",
1345
+ {
1346
+ "data-slot": "collapsible-panel-content",
1347
+ className: cn("py-4", innerClassName),
1348
+ children
1349
+ }
1350
+ )
1351
+ }
1352
+ );
1353
+ }
1354
+ );
1355
+ CollapsiblePanel.displayName = "CollapsiblePanel";
1356
+ var DropdownMenuGroupContext = React5__namespace.createContext(false);
1357
+ function DropdownMenu({ ...props }) {
1358
+ return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Root, { "data-slot": "dropdown-menu", ...props });
1359
+ }
1360
+ function DropdownMenuPortal({ ...props }) {
1361
+ const { container } = portal.useFloatingOverlayPortalProps();
1362
+ return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { "data-slot": "dropdown-menu-portal", container, ...props });
1363
+ }
1364
+ function DropdownMenuTrigger({ asChild, children, render, nativeButton, ...props }) {
1365
+ const childRender = render === void 0 && asChild && React5__namespace.isValidElement(children) ? children : void 0;
1366
+ return /* @__PURE__ */ jsxRuntime.jsx(
1367
+ menu.Menu.Trigger,
1368
+ {
1369
+ "data-slot": "dropdown-menu-trigger",
1370
+ nativeButton: nativeButton ?? (childRender ? true : void 0),
1371
+ render: render ?? childRender,
1372
+ ...props,
1373
+ children: childRender ? void 0 : children
1374
+ }
1375
+ );
1376
+ }
1377
+ function DropdownMenuContent({
1378
+ className,
1379
+ sideOffset = 4,
1380
+ side = "bottom",
1381
+ align = "start",
1382
+ onPointerDown: _onPointerDown,
1383
+ onPointerDownOutside: _onPointerDownOutside,
1384
+ onCloseAutoFocus: _onCloseAutoFocus,
1385
+ forceMount: _forceMount,
1386
+ ...props
1387
+ }) {
1388
+ const { zIndexClass } = portal.useFloatingOverlayPortalProps();
1389
+ return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Positioner, { side, align, sideOffset, className: zIndexClass, children: /* @__PURE__ */ jsxRuntime.jsx(
1390
+ menu.Menu.Popup,
1391
+ {
1392
+ "data-slot": "dropdown-menu-content",
1393
+ className: cn(
1394
+ `bg-popover text-popover-foreground origin-(--transform-origin) min-w-40 overflow-hidden rounded-md border p-1
1395
+ shadow-lg transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
1396
+ data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
1397
+ data-[side=bottom]:data-starting-style:-translate-y-2
1398
+ data-[side=left]:data-starting-style:translate-x-2
1399
+ data-[side=right]:data-starting-style:-translate-x-2
1400
+ data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
1401
+ className
1402
+ ),
1403
+ ...props
1404
+ }
1405
+ ) }) });
1406
+ }
1407
+ function DropdownMenuGroup({ ...props }) {
1408
+ return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuGroupContext.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Group, { "data-slot": "dropdown-menu-group", ...props }) });
1409
+ }
1410
+ function DropdownMenuItem({
1411
+ className,
1412
+ inset,
1413
+ variant = "default",
1414
+ asChild,
1415
+ children,
1416
+ render,
1417
+ ...props
1418
+ }) {
1419
+ const childRender = render === void 0 && asChild && React5__namespace.isValidElement(children) ? children : void 0;
1420
+ const itemClassName = cn(
1421
+ `data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive
1422
+ data-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/40
1423
+ data-[variant=destructive]:data-[highlighted]:text-destructive
1424
+ data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default items-center gap-2 pointer-coarse:min-h-11
1425
+ rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none
1426
+ data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,
1427
+ className
1428
+ );
1429
+ return /* @__PURE__ */ jsxRuntime.jsx(
1430
+ menu.Menu.Item,
1431
+ {
1432
+ "data-slot": "dropdown-menu-item",
1433
+ "data-inset": inset,
1434
+ "data-variant": variant,
1435
+ className: itemClassName,
1436
+ render: render ?? childRender,
1437
+ ...props,
1438
+ children: childRender ? void 0 : children
1439
+ }
1440
+ );
1441
+ }
1442
+ function DropdownMenuLabel({
1443
+ className,
1444
+ inset,
1445
+ ...props
1446
+ }) {
1447
+ const isGrouped = React5__namespace.useContext(DropdownMenuGroupContext);
1448
+ const labelProps = {
1449
+ "data-slot": "dropdown-menu-label",
1450
+ "data-inset": inset,
1451
+ className: cn("text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8", className),
1452
+ ...props
1453
+ };
1454
+ if (isGrouped) {
1455
+ return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.GroupLabel, { ...labelProps });
1456
+ }
1457
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...labelProps });
1458
+ }
1459
+ function DropdownMenuSeparator({ className, ...props }) {
1460
+ return /* @__PURE__ */ jsxRuntime.jsx(
1461
+ menu.Menu.Separator,
1462
+ {
1463
+ "data-slot": "dropdown-menu-separator",
1464
+ className: cn("bg-border -mx-1 my-1 h-px", className),
1465
+ ...props
1466
+ }
1467
+ );
1468
+ }
1469
+ function initials(name) {
1470
+ const parts = name.trim().split(/\s+/).filter(Boolean).slice(0, 2);
1471
+ return parts.map((part) => part[0]?.toUpperCase()).join("") || "U";
1472
+ }
1473
+ function navigationLink(renderLink, item, children, onAcceptedNavigation) {
1474
+ return createAppLink(renderLink, {
1475
+ href: item.href,
1476
+ children,
1477
+ "aria-current": item.isActive ? "page" : void 0,
1478
+ "aria-disabled": item.disabled || void 0,
1479
+ tabIndex: item.disabled ? -1 : void 0,
1480
+ onClick: (event) => {
1481
+ if (item.disabled) {
1482
+ event.preventDefault();
1483
+ return;
1484
+ }
1485
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.currentTarget.target && event.currentTarget.target !== "_self") return;
1486
+ onAcceptedNavigation?.();
1487
+ }
1488
+ });
1489
+ }
1490
+ function NavigationGroup({ group, renderLink }) {
1491
+ const { isMobile, setOpenMobile } = useSidebar();
1492
+ const closeMobileNavigation = React5__namespace.useCallback(() => {
1493
+ if (isMobile) setOpenMobile(false);
1494
+ }, [isMobile, setOpenMobile]);
1495
+ return /* @__PURE__ */ jsxRuntime.jsxs(SidebarGroup, { children: [
1496
+ group.label && /* @__PURE__ */ jsxRuntime.jsx(SidebarGroupLabel, { children: group.label }),
1497
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenu, { children: group.items.map((item) => {
1498
+ const Icon = item.icon;
1499
+ const itemContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1500
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": "true" }),
1501
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
1502
+ ] });
1503
+ if (!item.children?.length) {
1504
+ return /* @__PURE__ */ jsxRuntime.jsxs(SidebarMenuItem, { children: [
1505
+ /* @__PURE__ */ jsxRuntime.jsx(
1506
+ SidebarMenuButton,
1507
+ {
1508
+ isActive: item.isActive,
1509
+ tooltip: typeof item.label === "string" ? item.label : void 0,
1510
+ render: navigationLink(renderLink, item, itemContent, closeMobileNavigation)
1511
+ }
1512
+ ),
1513
+ item.badge && /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuBadge, { children: item.badge })
1514
+ ] }, item.id);
1515
+ }
1516
+ const hasActiveChild = item.children.some((child) => child.isActive);
1517
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1518
+ Collapsible,
1519
+ {
1520
+ defaultOpen: item.defaultOpen ?? item.isActive ?? hasActiveChild,
1521
+ render: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuItem, {}),
1522
+ children: [
1523
+ /* @__PURE__ */ jsxRuntime.jsx(
1524
+ SidebarMenuButton,
1525
+ {
1526
+ isActive: item.isActive,
1527
+ tooltip: typeof item.label === "string" ? item.label : void 0,
1528
+ render: navigationLink(renderLink, item, itemContent, closeMobileNavigation)
1529
+ }
1530
+ ),
1531
+ /* @__PURE__ */ jsxRuntime.jsx(
1532
+ SidebarMenuAction,
1533
+ {
1534
+ render: /* @__PURE__ */ jsxRuntime.jsx(
1535
+ CollapsibleTrigger,
1536
+ {
1537
+ "aria-label": item.toggleLabel ?? (typeof item.label === "string" ? `Toggle ${item.label}` : "Toggle navigation group")
1538
+ }
1539
+ ),
1540
+ className: "aria-expanded:rotate-90",
1541
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, {})
1542
+ }
1543
+ ),
1544
+ /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePanel, { innerClassName: "py-0", children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSub, { children: item.children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsxRuntime.jsx(
1545
+ SidebarMenuSubButton,
1546
+ {
1547
+ isActive: child.isActive,
1548
+ render: navigationLink(
1549
+ renderLink,
1550
+ child,
1551
+ child.label,
1552
+ closeMobileNavigation
1553
+ )
1554
+ }
1555
+ ) }, child.id)) }) })
1556
+ ]
1557
+ },
1558
+ item.id
1559
+ );
1560
+ }) }) })
1561
+ ] });
1562
+ }
1563
+ function AccountMenu({ account, renderLink }) {
1564
+ const { isMobile } = useSidebar();
1565
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenu, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
1566
+ /* @__PURE__ */ jsxRuntime.jsxs(
1567
+ DropdownMenuTrigger,
1568
+ {
1569
+ render: /* @__PURE__ */ jsxRuntime.jsx(
1570
+ SidebarMenuButton,
1571
+ {
1572
+ size: "lg",
1573
+ className: "aria-expanded:bg-sidebar-accent aria-expanded:text-sidebar-accent-foreground"
1574
+ }
1575
+ ),
1576
+ children: [
1577
+ /* @__PURE__ */ jsxRuntime.jsxs(Avatar, { children: [
1578
+ account.avatarUrl && /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src: account.avatarUrl, alt: account.avatarAlt ?? account.name }),
1579
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { children: account.fallback ?? initials(account.name) })
1580
+ ] }),
1581
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight", children: [
1582
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium", title: account.name, children: account.name }),
1583
+ account.secondaryLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs", title: account.secondaryLabel, children: account.secondaryLabel })
1584
+ ] }),
1585
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDownIcon, { className: "ml-auto" })
1586
+ ]
1587
+ }
1588
+ ),
1589
+ /* @__PURE__ */ jsxRuntime.jsxs(
1590
+ DropdownMenuContent,
1591
+ {
1592
+ className: "min-w-56 rounded-lg",
1593
+ side: isMobile ? "bottom" : "right",
1594
+ align: "end",
1595
+ sideOffset: 4,
1596
+ children: [
1597
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
1598
+ /* @__PURE__ */ jsxRuntime.jsxs(Avatar, { children: [
1599
+ account.avatarUrl && /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src: account.avatarUrl, alt: account.avatarAlt ?? account.name }),
1600
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { children: account.fallback ?? initials(account.name) })
1601
+ ] }),
1602
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight", children: [
1603
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium", title: account.name, children: account.name }),
1604
+ account.secondaryLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs", title: account.secondaryLabel, children: account.secondaryLabel })
1605
+ ] })
1606
+ ] }) }) }),
1607
+ account.actionGroups?.map((group) => /* @__PURE__ */ jsxRuntime.jsxs(React5__namespace.Fragment, { children: [
1608
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
1609
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuGroup, { children: [
1610
+ group.label && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuLabel, { children: group.label }),
1611
+ group.actions.map((action) => {
1612
+ const Icon = action.icon;
1613
+ const actionContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1614
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": "true" }),
1615
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: action.label })
1616
+ ] });
1617
+ if (action.href) {
1618
+ return /* @__PURE__ */ jsxRuntime.jsx(
1619
+ DropdownMenuItem,
1620
+ {
1621
+ disabled: action.disabled,
1622
+ variant: action.variant,
1623
+ render: createAppLink(renderLink, {
1624
+ href: action.href,
1625
+ children: actionContent
1626
+ })
1627
+ },
1628
+ action.id
1629
+ );
1630
+ }
1631
+ return /* @__PURE__ */ jsxRuntime.jsx(
1632
+ DropdownMenuItem,
1633
+ {
1634
+ disabled: action.disabled,
1635
+ variant: action.variant,
1636
+ onClick: action.onSelect,
1637
+ children: actionContent
1638
+ },
1639
+ action.id
1640
+ );
1641
+ })
1642
+ ] })
1643
+ ] }, group.id))
1644
+ ]
1645
+ }
1646
+ )
1647
+ ] }) }) });
1648
+ }
1649
+ function Brand({ brand, renderLink }) {
1650
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1651
+ brand.logo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-primary text-primary-foreground flex size-8 shrink-0 items-center justify-center rounded-lg shadow-xs", children: brand.logo }),
1652
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight", children: [
1653
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium", title: typeof brand.name === "string" ? brand.name : void 0, children: brand.name }),
1654
+ brand.description && /* @__PURE__ */ jsxRuntime.jsx(
1655
+ "span",
1656
+ {
1657
+ className: "text-muted-foreground truncate text-xs",
1658
+ title: typeof brand.description === "string" ? brand.description : void 0,
1659
+ children: brand.description
1660
+ }
1661
+ )
1662
+ ] })
1663
+ ] });
1664
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenu, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsx(
1665
+ SidebarMenuButton,
1666
+ {
1667
+ size: "lg",
1668
+ render: brand.href ? createAppLink(renderLink, { href: brand.href, children: content }) : /* @__PURE__ */ jsxRuntime.jsx("div", { children: content })
1669
+ }
1670
+ ) }) });
1671
+ }
1672
+ function AppShell({
1673
+ children,
1674
+ navigation,
1675
+ brand,
1676
+ account,
1677
+ breadcrumbs,
1678
+ renderLink,
1679
+ barLeading,
1680
+ barSearch,
1681
+ barActions,
1682
+ barProps,
1683
+ barPlacement = "top",
1684
+ headerHeight = "3.5rem",
1685
+ sidebarWidth,
1686
+ sidebarProps,
1687
+ sidebarFooter,
1688
+ contentFooter,
1689
+ defaultSidebarOpen = true,
1690
+ sidebarOpen,
1691
+ onSidebarOpenChange,
1692
+ contentClassName,
1693
+ contentProps,
1694
+ className,
1695
+ style,
1696
+ render,
1697
+ ...props
1698
+ }) {
1699
+ const mainGroups = navigation.filter((group) => group.placement !== "footer");
1700
+ const footerGroups = navigation.filter((group) => group.placement === "footer");
1701
+ const hasFooter = footerGroups.length > 0 || Boolean(account) || Boolean(sidebarFooter);
1702
+ const { className: sidebarClassName, collapsible, ...resolvedSidebarProps } = sidebarProps ?? {};
1703
+ const contentBar = barPlacement === "content";
1704
+ const appBar = /* @__PURE__ */ jsxRuntime.jsx(
1705
+ AppBar,
1706
+ {
1707
+ breadcrumbs,
1708
+ renderLink,
1709
+ leading: barLeading,
1710
+ search: barSearch,
1711
+ actions: barActions,
1712
+ ...barProps
1713
+ }
1714
+ );
1715
+ const sidebar = /* @__PURE__ */ jsxRuntime.jsxs(
1716
+ Sidebar,
1717
+ {
1718
+ collapsible: collapsible ?? "icon",
1719
+ ...resolvedSidebarProps,
1720
+ className: cn(
1721
+ contentBar ? "h-dvh!" : "top-(--app-bar-height) h-[calc(100dvh-var(--app-bar-height))]!",
1722
+ sidebarClassName
1723
+ ),
1724
+ children: [
1725
+ brand && /* @__PURE__ */ jsxRuntime.jsx(SidebarHeader, { className: contentBar ? "pt-5 pb-2" : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(Brand, { brand, renderLink }) }),
1726
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarContent, { className: contentBar ? "px-1" : void 0, children: mainGroups.map((group) => /* @__PURE__ */ jsxRuntime.jsx(NavigationGroup, { group, renderLink }, group.id)) }),
1727
+ hasFooter && /* @__PURE__ */ jsxRuntime.jsxs(SidebarFooter, { className: contentBar ? "p-0" : void 0, children: [
1728
+ !contentBar ? /* @__PURE__ */ jsxRuntime.jsx(SidebarSeparator, {}) : null,
1729
+ footerGroups.map((group) => /* @__PURE__ */ jsxRuntime.jsx(NavigationGroup, { group, renderLink }, group.id)),
1730
+ sidebarFooter,
1731
+ account && /* @__PURE__ */ jsxRuntime.jsx("div", { className: contentBar ? "border-t p-2" : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(AccountMenu, { account, renderLink }) })
1732
+ ] }),
1733
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarRail, {})
1734
+ ]
1735
+ }
1736
+ );
1737
+ const mainColumn = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
1738
+ contentBar ? appBar : null,
1739
+ /* @__PURE__ */ jsxRuntime.jsx(
1740
+ SidebarInset,
1741
+ {
1742
+ ...contentProps,
1743
+ className: cn(
1744
+ "min-w-0 flex-1 overflow-auto",
1745
+ contentFooter && "pb-[calc(4.5rem+env(safe-area-inset-bottom))] md:pb-0",
1746
+ contentClassName
1747
+ ),
1748
+ children
1749
+ }
1750
+ ),
1751
+ contentFooter
1752
+ ] });
1753
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(
1754
+ SidebarProvider,
1755
+ {
1756
+ className: "min-h-0 flex-1 flex-col",
1757
+ defaultOpen: defaultSidebarOpen,
1758
+ open: sidebarOpen,
1759
+ onOpenChange: onSidebarOpenChange,
1760
+ style: sidebarWidth ? { "--sidebar-width": sidebarWidth } : void 0,
1761
+ children: [
1762
+ !contentBar ? appBar : null,
1763
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-1", children: [
1764
+ sidebar,
1765
+ mainColumn
1766
+ ] })
1767
+ ]
1768
+ }
1769
+ );
1770
+ return useRender.useRender({
1771
+ defaultTagName: "div",
1772
+ props: mergeProps.mergeProps(
1773
+ {
1774
+ className: cn("flex min-h-dvh w-full flex-col bg-background", className),
1775
+ style: {
1776
+ "--app-bar-height": headerHeight,
1777
+ ...style
1778
+ },
1779
+ children: content
1780
+ },
1781
+ props
1782
+ ),
1783
+ render,
1784
+ state: {
1785
+ slot: "app-shell"
1786
+ }
1787
+ });
1788
+ }
1789
+
1790
+ exports.AppShell = AppShell;
1791
+ //# sourceMappingURL=app-shell.cjs.map
1792
+ //# sourceMappingURL=app-shell.cjs.map