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