@constructive-io/ui 0.4.1 → 0.6.1

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 (415) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -22
  3. package/dist/button-D4vqTxhp.d.cts +20 -0
  4. package/dist/button-D4vqTxhp.d.ts +20 -0
  5. package/dist/components/alert-dialog.cjs +129 -0
  6. package/dist/components/alert-dialog.cjs.map +1 -0
  7. package/dist/components/alert-dialog.d.cts +33 -0
  8. package/dist/components/alert-dialog.d.ts +23 -21
  9. package/dist/components/alert-dialog.js +98 -296
  10. package/dist/components/alert-dialog.js.map +1 -1
  11. package/dist/components/alert.cjs +62 -0
  12. package/dist/components/alert.cjs.map +1 -0
  13. package/dist/components/alert.d.cts +19 -0
  14. package/dist/components/alert.d.ts +18 -13
  15. package/dist/components/alert.js +49 -31
  16. package/dist/components/alert.js.map +1 -1
  17. package/dist/components/app-bar.cjs +81 -0
  18. package/dist/components/app-bar.cjs.map +1 -0
  19. package/dist/components/app-bar.d.cts +27 -0
  20. package/dist/components/app-bar.d.ts +27 -0
  21. package/dist/components/app-bar.js +77 -0
  22. package/dist/components/app-bar.js.map +1 -0
  23. package/dist/components/app-shell.cjs +267 -0
  24. package/dist/components/app-shell.cjs.map +1 -0
  25. package/dist/components/app-shell.d.cts +98 -0
  26. package/dist/components/app-shell.d.ts +98 -0
  27. package/dist/components/app-shell.js +264 -0
  28. package/dist/components/app-shell.js.map +1 -0
  29. package/dist/components/autocomplete.cjs +167 -0
  30. package/dist/components/autocomplete.cjs.map +1 -0
  31. package/dist/components/autocomplete.d.cts +28 -0
  32. package/dist/components/autocomplete.d.ts +24 -24
  33. package/dist/components/autocomplete.js +146 -397
  34. package/dist/components/autocomplete.js.map +1 -1
  35. package/dist/components/avatar.cjs +39 -0
  36. package/dist/components/avatar.cjs.map +1 -0
  37. package/dist/components/avatar.d.cts +13 -0
  38. package/dist/components/avatar.d.ts +11 -11
  39. package/dist/components/avatar.js +24 -27
  40. package/dist/components/avatar.js.map +1 -1
  41. package/dist/components/badge.cjs +48 -0
  42. package/dist/components/badge.cjs.map +1 -0
  43. package/dist/components/badge.d.cts +15 -0
  44. package/dist/components/badge.d.ts +13 -13
  45. package/dist/components/badge.js +39 -38
  46. package/dist/components/badge.js.map +1 -1
  47. package/dist/components/breadcrumb.cjs +89 -0
  48. package/dist/components/breadcrumb.cjs.map +1 -0
  49. package/dist/components/breadcrumb.d.cts +15 -0
  50. package/dist/components/breadcrumb.d.ts +14 -13
  51. package/dist/components/breadcrumb.js +63 -137
  52. package/dist/components/breadcrumb.js.map +1 -1
  53. package/dist/components/button.cjs +75 -0
  54. package/dist/components/button.cjs.map +1 -0
  55. package/dist/components/button.d.cts +2 -0
  56. package/dist/components/button.d.ts +2 -17
  57. package/dist/components/button.js +66 -57
  58. package/dist/components/button.js.map +1 -1
  59. package/dist/components/calendar-rac.cjs +72 -0
  60. package/dist/components/calendar-rac.cjs.map +1 -0
  61. package/dist/components/calendar-rac.d.cts +13 -0
  62. package/dist/components/calendar-rac.d.ts +8 -8
  63. package/dist/components/calendar-rac.js +49 -61
  64. package/dist/components/calendar-rac.js.map +1 -1
  65. package/dist/components/card.cjs +86 -0
  66. package/dist/components/card.cjs.map +1 -0
  67. package/dist/components/card.d.cts +17 -0
  68. package/dist/components/card.d.ts +15 -17
  69. package/dist/components/card.js +58 -57
  70. package/dist/components/card.js.map +1 -1
  71. package/dist/components/checkbox-group.cjs +19 -0
  72. package/dist/components/checkbox-group.cjs.map +1 -0
  73. package/dist/components/checkbox-group.d.cts +7 -0
  74. package/dist/components/checkbox-group.d.ts +5 -5
  75. package/dist/components/checkbox-group.js +12 -10
  76. package/dist/components/checkbox-group.js.map +1 -1
  77. package/dist/components/checkbox.cjs +67 -0
  78. package/dist/components/checkbox.cjs.map +1 -0
  79. package/dist/components/checkbox.d.cts +8 -0
  80. package/dist/components/checkbox.d.ts +6 -6
  81. package/dist/components/checkbox.js +58 -61
  82. package/dist/components/checkbox.js.map +1 -1
  83. package/dist/components/collapsible.cjs +90 -0
  84. package/dist/components/collapsible.cjs.map +1 -0
  85. package/dist/components/collapsible.d.cts +45 -0
  86. package/dist/components/collapsible.d.ts +19 -28
  87. package/dist/components/collapsible.js +74 -112
  88. package/dist/components/collapsible.js.map +1 -1
  89. package/dist/components/combobox.cjs +257 -0
  90. package/dist/components/combobox.cjs.map +1 -0
  91. package/dist/components/combobox.d.cts +44 -0
  92. package/dist/components/combobox.d.ts +36 -36
  93. package/dist/components/combobox.js +229 -515
  94. package/dist/components/combobox.js.map +1 -1
  95. package/dist/components/command.cjs +139 -0
  96. package/dist/components/command.cjs.map +1 -0
  97. package/dist/components/command.d.cts +24 -0
  98. package/dist/components/command.d.ts +22 -22
  99. package/dist/components/command.js +109 -240
  100. package/dist/components/command.js.map +1 -1
  101. package/dist/components/dialog.cjs +139 -0
  102. package/dist/components/dialog.cjs.map +1 -0
  103. package/dist/components/dialog.d.cts +31 -0
  104. package/dist/components/dialog.d.ts +27 -31
  105. package/dist/components/dialog.js +112 -429
  106. package/dist/components/dialog.js.map +1 -1
  107. package/dist/components/dock.cjs +90 -0
  108. package/dist/components/dock.cjs.map +1 -0
  109. package/dist/components/dock.d.cts +30 -0
  110. package/dist/components/dock.d.ts +25 -26
  111. package/dist/components/dock.js +78 -104
  112. package/dist/components/dock.js.map +1 -1
  113. package/dist/components/drawer.cjs +115 -0
  114. package/dist/components/drawer.cjs.map +1 -0
  115. package/dist/components/drawer.d.cts +16 -0
  116. package/dist/components/drawer.d.ts +15 -15
  117. package/dist/components/drawer.js +77 -121
  118. package/dist/components/drawer.js.map +1 -1
  119. package/dist/components/dropdown-menu.cjs +217 -0
  120. package/dist/components/dropdown-menu.cjs.map +1 -0
  121. package/dist/components/dropdown-menu.d.cts +53 -0
  122. package/dist/components/dropdown-menu.d.ts +49 -46
  123. package/dist/components/dropdown-menu.js +177 -357
  124. package/dist/components/dropdown-menu.js.map +1 -1
  125. package/dist/components/empty.cjs +72 -0
  126. package/dist/components/empty.cjs.map +1 -0
  127. package/dist/components/empty.d.cts +15 -0
  128. package/dist/components/empty.d.ts +15 -0
  129. package/dist/components/empty.js +64 -0
  130. package/dist/components/empty.js.map +1 -0
  131. package/dist/components/field.cjs +186 -0
  132. package/dist/components/field.cjs.map +1 -0
  133. package/dist/components/field.d.cts +46 -0
  134. package/dist/components/field.d.ts +44 -49
  135. package/dist/components/field.js +166 -108
  136. package/dist/components/field.js.map +1 -1
  137. package/dist/components/flickering-grid.cjs +153 -0
  138. package/dist/components/flickering-grid.cjs.map +1 -0
  139. package/dist/components/flickering-grid.d.cts +16 -0
  140. package/dist/components/flickering-grid.d.ts +14 -13
  141. package/dist/components/flickering-grid.js +144 -141
  142. package/dist/components/flickering-grid.js.map +1 -1
  143. package/dist/components/flow-zoom-panel.cjs +62 -0
  144. package/dist/components/flow-zoom-panel.cjs.map +1 -0
  145. package/dist/components/flow-zoom-panel.d.cts +12 -0
  146. package/dist/components/flow-zoom-panel.d.ts +12 -0
  147. package/dist/components/flow-zoom-panel.js +61 -0
  148. package/dist/components/flow-zoom-panel.js.map +1 -0
  149. package/dist/components/form-control.cjs +65 -0
  150. package/dist/components/form-control.cjs.map +1 -0
  151. package/dist/components/form-control.d.cts +15 -0
  152. package/dist/components/form-control.d.ts +11 -11
  153. package/dist/components/form-control.js +56 -167
  154. package/dist/components/form-control.js.map +1 -1
  155. package/dist/components/form.cjs +102 -0
  156. package/dist/components/form.cjs.map +1 -0
  157. package/dist/components/form.d.cts +2 -0
  158. package/dist/components/form.d.ts +2 -37
  159. package/dist/components/form.js +76 -163
  160. package/dist/components/form.js.map +1 -1
  161. package/dist/components/input-group.cjs +70 -0
  162. package/dist/components/input-group.cjs.map +1 -0
  163. package/dist/components/input-group.d.cts +16 -0
  164. package/dist/components/input-group.d.ts +14 -16
  165. package/dist/components/input-group.js +51 -163
  166. package/dist/components/input-group.js.map +1 -1
  167. package/dist/components/input.cjs +37 -0
  168. package/dist/components/input.cjs.map +1 -0
  169. package/dist/components/input.d.cts +2 -0
  170. package/dist/components/input.d.ts +2 -11
  171. package/dist/components/input.js +30 -54
  172. package/dist/components/input.js.map +1 -1
  173. package/dist/components/json-input.cjs +147 -0
  174. package/dist/components/json-input.cjs.map +1 -0
  175. package/dist/components/json-input.d.cts +26 -0
  176. package/dist/components/json-input.d.ts +20 -19
  177. package/dist/components/json-input.js +132 -340
  178. package/dist/components/json-input.js.map +1 -1
  179. package/dist/components/label.cjs +27 -0
  180. package/dist/components/label.cjs.map +1 -0
  181. package/dist/components/label.d.cts +11 -0
  182. package/dist/components/label.d.ts +6 -6
  183. package/dist/components/label.js +17 -20
  184. package/dist/components/label.js.map +1 -1
  185. package/dist/components/motion-grid.cjs +68 -0
  186. package/dist/components/motion-grid.cjs.map +1 -0
  187. package/dist/components/motion-grid.d.cts +20 -0
  188. package/dist/components/motion-grid.d.ts +15 -15
  189. package/dist/components/motion-grid.js +59 -75
  190. package/dist/components/motion-grid.js.map +1 -1
  191. package/dist/components/multi-select.cjs +573 -0
  192. package/dist/components/multi-select.cjs.map +1 -0
  193. package/dist/components/multi-select.d.cts +198 -0
  194. package/dist/components/multi-select.d.ts +173 -173
  195. package/dist/components/multi-select.js +562 -874
  196. package/dist/components/multi-select.js.map +1 -1
  197. package/dist/components/page-header.cjs +30 -0
  198. package/dist/components/page-header.cjs.map +1 -0
  199. package/dist/components/page-header.d.cts +17 -0
  200. package/dist/components/page-header.d.ts +11 -11
  201. package/dist/components/page-header.js +23 -11
  202. package/dist/components/page-header.js.map +1 -1
  203. package/dist/components/pagination.cjs +95 -0
  204. package/dist/components/pagination.cjs.map +1 -0
  205. package/dist/components/pagination.d.cts +17 -0
  206. package/dist/components/pagination.d.ts +15 -17
  207. package/dist/components/pagination.js +70 -128
  208. package/dist/components/pagination.js.map +1 -1
  209. package/dist/components/popover.cjs +97 -0
  210. package/dist/components/popover.cjs.map +1 -0
  211. package/dist/components/popover.d.cts +40 -0
  212. package/dist/components/popover.d.ts +33 -28
  213. package/dist/components/popover.js +78 -178
  214. package/dist/components/popover.js.map +1 -1
  215. package/dist/components/portal.cjs +156 -0
  216. package/dist/components/portal.cjs.map +1 -0
  217. package/dist/components/portal.d.cts +118 -0
  218. package/dist/components/portal.d.ts +33 -23
  219. package/dist/components/portal.js +128 -57
  220. package/dist/components/portal.js.map +1 -1
  221. package/dist/components/progress.cjs +30 -0
  222. package/dist/components/progress.cjs.map +1 -0
  223. package/dist/components/progress.d.cts +10 -0
  224. package/dist/components/progress.d.ts +8 -8
  225. package/dist/components/progress.js +21 -24
  226. package/dist/components/progress.js.map +1 -1
  227. package/dist/components/progressive-blur-scroll-container.cjs +76 -0
  228. package/dist/components/progressive-blur-scroll-container.cjs.map +1 -0
  229. package/dist/components/progressive-blur-scroll-container.d.cts +25 -0
  230. package/dist/components/progressive-blur-scroll-container.d.ts +19 -19
  231. package/dist/components/progressive-blur-scroll-container.js +70 -137
  232. package/dist/components/progressive-blur-scroll-container.js.map +1 -1
  233. package/dist/components/progressive-blur.cjs +46 -0
  234. package/dist/components/progressive-blur.cjs.map +1 -0
  235. package/dist/components/progressive-blur.d.cts +17 -0
  236. package/dist/components/progressive-blur.d.ts +15 -14
  237. package/dist/components/progressive-blur.js +38 -63
  238. package/dist/components/progressive-blur.js.map +1 -1
  239. package/dist/components/radio-group.cjs +38 -0
  240. package/dist/components/radio-group.cjs.map +1 -0
  241. package/dist/components/radio-group.d.cts +10 -0
  242. package/dist/components/radio-group.d.ts +8 -8
  243. package/dist/components/radio-group.js +28 -30
  244. package/dist/components/radio-group.js.map +1 -1
  245. package/dist/components/record-picker.cjs +8 -0
  246. package/dist/components/record-picker.d.cts +16 -0
  247. package/dist/components/record-picker.d.ts +13 -13
  248. package/dist/components/record-picker.js +5 -364
  249. package/dist/components/resizable.cjs +50 -0
  250. package/dist/components/resizable.cjs.map +1 -0
  251. package/dist/components/resizable.d.cts +11 -0
  252. package/dist/components/resizable.d.ts +10 -10
  253. package/dist/components/resizable.js +29 -37
  254. package/dist/components/resizable.js.map +1 -1
  255. package/dist/components/responsive-diagram.cjs +56 -0
  256. package/dist/components/responsive-diagram.cjs.map +1 -0
  257. package/dist/components/responsive-diagram.d.cts +10 -0
  258. package/dist/components/responsive-diagram.d.ts +7 -7
  259. package/dist/components/responsive-diagram.js +50 -60
  260. package/dist/components/responsive-diagram.js.map +1 -1
  261. package/dist/components/scroll-area.cjs +46 -0
  262. package/dist/components/scroll-area.cjs.map +1 -0
  263. package/dist/components/scroll-area.d.cts +12 -0
  264. package/dist/components/scroll-area.d.ts +11 -11
  265. package/dist/components/scroll-area.js +35 -62
  266. package/dist/components/scroll-area.js.map +1 -1
  267. package/dist/components/select.cjs +204 -0
  268. package/dist/components/select.cjs.map +1 -0
  269. package/dist/components/select.d.cts +47 -0
  270. package/dist/components/select.d.ts +38 -38
  271. package/dist/components/select.js +172 -269
  272. package/dist/components/select.js.map +1 -1
  273. package/dist/components/separator.cjs +23 -0
  274. package/dist/components/separator.cjs.map +1 -0
  275. package/dist/components/separator.d.cts +2 -0
  276. package/dist/components/separator.d.ts +2 -11
  277. package/dist/components/separator.js +14 -18
  278. package/dist/components/separator.js.map +1 -1
  279. package/dist/components/sheet.cjs +19 -0
  280. package/dist/components/sheet.d.cts +107 -0
  281. package/dist/components/sheet.d.ts +85 -90
  282. package/dist/components/sheet.js +3 -598
  283. package/dist/components/sidebar.cjs +29 -0
  284. package/dist/components/sidebar.d.cts +67 -0
  285. package/dist/components/sidebar.d.ts +63 -73
  286. package/dist/components/sidebar.js +3 -1215
  287. package/dist/components/skeleton.cjs +24 -0
  288. package/dist/components/skeleton.cjs.map +1 -0
  289. package/dist/components/skeleton.d.cts +11 -0
  290. package/dist/components/skeleton.d.ts +10 -6
  291. package/dist/components/skeleton.js +15 -10
  292. package/dist/components/skeleton.js.map +1 -1
  293. package/dist/components/sonner.cjs +23 -0
  294. package/dist/components/sonner.cjs.map +1 -0
  295. package/dist/components/sonner.d.cts +10 -0
  296. package/dist/components/sonner.d.ts +7 -7
  297. package/dist/components/sonner.js +17 -18
  298. package/dist/components/sonner.js.map +1 -1
  299. package/dist/components/stack/index.cjs +44 -0
  300. package/dist/components/stack/index.d.cts +2 -0
  301. package/dist/components/stack/index.d.ts +2 -674
  302. package/dist/components/stack/index.js +3 -1444
  303. package/dist/components/stepper.cjs +160 -0
  304. package/dist/components/stepper.cjs.map +1 -0
  305. package/dist/components/stepper.d.cts +32 -0
  306. package/dist/components/stepper.d.ts +27 -25
  307. package/dist/components/stepper.js +133 -261
  308. package/dist/components/stepper.js.map +1 -1
  309. package/dist/components/switch.cjs +35 -0
  310. package/dist/components/switch.cjs.map +1 -0
  311. package/dist/components/switch.d.cts +8 -0
  312. package/dist/components/switch.d.ts +7 -7
  313. package/dist/components/switch.js +26 -34
  314. package/dist/components/switch.js.map +1 -1
  315. package/dist/components/table.cjs +85 -0
  316. package/dist/components/table.cjs.map +1 -0
  317. package/dist/components/table.d.cts +23 -0
  318. package/dist/components/table.d.ts +23 -15
  319. package/dist/components/table.js +56 -46
  320. package/dist/components/table.js.map +1 -1
  321. package/dist/components/tabs.cjs +49 -0
  322. package/dist/components/tabs.cjs.map +1 -0
  323. package/dist/components/tabs.d.cts +10 -0
  324. package/dist/components/tabs.d.ts +9 -9
  325. package/dist/components/tabs.js +31 -36
  326. package/dist/components/tabs.js.map +1 -1
  327. package/dist/components/tags.cjs +132 -0
  328. package/dist/components/tags.cjs.map +1 -0
  329. package/dist/components/tags.d.cts +36 -0
  330. package/dist/components/tags.d.ts +24 -28
  331. package/dist/components/tags.js +114 -438
  332. package/dist/components/tags.js.map +1 -1
  333. package/dist/components/textarea.cjs +34 -0
  334. package/dist/components/textarea.cjs.map +1 -0
  335. package/dist/components/textarea.d.cts +10 -0
  336. package/dist/components/textarea.d.ts +8 -8
  337. package/dist/components/textarea.js +27 -48
  338. package/dist/components/textarea.js.map +1 -1
  339. package/dist/components/toast/index.cjs +9 -0
  340. package/dist/components/toast/index.d.cts +2 -0
  341. package/dist/components/toast/index.d.ts +2 -52
  342. package/dist/components/toast/index.js +3 -623
  343. package/dist/components/tooltip.cjs +67 -0
  344. package/dist/components/tooltip.cjs.map +1 -0
  345. package/dist/components/tooltip.d.cts +2 -0
  346. package/dist/components/tooltip.d.ts +2 -29
  347. package/dist/components/tooltip.js +53 -166
  348. package/dist/components/tooltip.js.map +1 -1
  349. package/dist/components/unlink-button.cjs +24 -0
  350. package/dist/components/unlink-button.cjs.map +1 -0
  351. package/dist/components/unlink-button.d.cts +14 -0
  352. package/dist/components/unlink-button.d.ts +11 -11
  353. package/dist/components/unlink-button.js +18 -86
  354. package/dist/components/unlink-button.js.map +1 -1
  355. package/dist/form-DgRTv7O7.d.ts +54 -0
  356. package/dist/form-DoZEWSzb.d.cts +54 -0
  357. package/dist/index-CjA4CENl.d.cts +684 -0
  358. package/dist/index-CjA4CENl.d.ts +684 -0
  359. package/dist/index-UnM04j0t.d.cts +58 -0
  360. package/dist/index-UnM04j0t.d.ts +58 -0
  361. package/dist/index.cjs +408 -9346
  362. package/dist/index.d.cts +224 -2548
  363. package/dist/index.d.ts +224 -2548
  364. package/dist/index.js +65 -9022
  365. package/dist/input-CBrCuMH8.d.cts +11 -0
  366. package/dist/input-CBrCuMH8.d.ts +11 -0
  367. package/dist/motion-config-COCFHq1L.cjs +271 -0
  368. package/dist/motion-config-COCFHq1L.cjs.map +1 -0
  369. package/dist/motion-config-COsZ6azM.js +241 -0
  370. package/dist/motion-config-COsZ6azM.js.map +1 -0
  371. package/dist/record-picker-BbxngCeV.js +162 -0
  372. package/dist/record-picker-BbxngCeV.js.map +1 -0
  373. package/dist/record-picker-Bz4FApxD.cjs +167 -0
  374. package/dist/record-picker-Bz4FApxD.cjs.map +1 -0
  375. package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
  376. package/dist/separator-BQEsr0Rc.d.cts +11 -0
  377. package/dist/separator-BQEsr0Rc.d.ts +11 -0
  378. package/dist/sheet-BLHnhLRH.js +425 -0
  379. package/dist/sheet-BLHnhLRH.js.map +1 -0
  380. package/dist/sheet-BdA0rfIz.cjs +515 -0
  381. package/dist/sheet-BdA0rfIz.cjs.map +1 -0
  382. package/dist/sidebar-CPy_fibW.cjs +608 -0
  383. package/dist/sidebar-CPy_fibW.cjs.map +1 -0
  384. package/dist/sidebar-Cfax0g0_.js +463 -0
  385. package/dist/sidebar-Cfax0g0_.js.map +1 -0
  386. package/dist/slot-C-jEfihz.cjs +122 -0
  387. package/dist/slot-C-jEfihz.cjs.map +1 -0
  388. package/dist/slot-EL8zfLG0.js +97 -0
  389. package/dist/slot-EL8zfLG0.js.map +1 -0
  390. package/dist/stack-DKdvlOM6.cjs +1771 -0
  391. package/dist/stack-DKdvlOM6.cjs.map +1 -0
  392. package/dist/stack-jMdxDrex.js +1531 -0
  393. package/dist/stack-jMdxDrex.js.map +1 -0
  394. package/dist/toast-D6MqijT2.cjs +316 -0
  395. package/dist/toast-D6MqijT2.cjs.map +1 -0
  396. package/dist/toast-D_BOLzm3.js +287 -0
  397. package/dist/toast-D_BOLzm3.js.map +1 -0
  398. package/dist/tooltip-CTRQoN1A.d.cts +29 -0
  399. package/dist/tooltip-CTRQoN1A.d.ts +29 -0
  400. package/dist/utils-BkMLyah9.js +12 -0
  401. package/dist/utils-BkMLyah9.js.map +1 -0
  402. package/dist/utils-CzTQ3-VI.cjs +17 -0
  403. package/dist/utils-CzTQ3-VI.cjs.map +1 -0
  404. package/package.json +288 -47
  405. package/src/styles/globals.css +155 -203
  406. package/dist/components/org-chart/index.d.ts +0 -54
  407. package/dist/components/org-chart/index.js +0 -861
  408. package/dist/components/org-chart/index.js.map +0 -1
  409. package/dist/components/record-picker.js.map +0 -1
  410. package/dist/components/sheet.js.map +0 -1
  411. package/dist/components/sidebar.js.map +0 -1
  412. package/dist/components/stack/index.js.map +0 -1
  413. package/dist/components/toast/index.js.map +0 -1
  414. package/dist/index.cjs.map +0 -1
  415. package/dist/index.js.map +0 -1
@@ -1,1217 +1,5 @@
1
- "use client";
2
- import * as React5 from 'react';
3
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
4
- import { cva } from 'class-variance-authority';
5
- import { PanelLeftIcon, X } from 'lucide-react';
6
- import { clsx } from 'clsx';
7
- import { twMerge } from 'tailwind-merge';
8
- import { Input as Input$1 } from '@base-ui/react/input';
9
- import { Separator as Separator$1 } from '@base-ui/react/separator';
10
- import { Dialog } from '@base-ui/react/dialog';
11
- import { AnimatePresence, motion } from 'motion/react';
12
- import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
1
+ 'use client';
13
2
 
14
- function composeRefs(...refs) {
15
- return (node) => {
16
- refs.forEach((ref) => {
17
- if (typeof ref === "function") {
18
- ref(node);
19
- } else if (ref != null) {
20
- ref.current = node;
21
- }
22
- });
23
- };
24
- }
25
- function mergeProps(slotProps, childProps) {
26
- const overrideProps = { ...childProps };
27
- for (const propName in childProps) {
28
- if (propName === "ref") continue;
29
- const slotPropValue = slotProps[propName];
30
- const childPropValue = childProps[propName];
31
- if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
32
- overrideProps[propName] = (...args) => {
33
- childPropValue(...args);
34
- slotPropValue(...args);
35
- };
36
- } else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
37
- overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
38
- } else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
39
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
40
- }
41
- }
42
- return { ...slotProps, ...overrideProps };
43
- }
44
- function mergePropsWithRef(parentProps, childElement) {
45
- const childProps = childElement.props;
46
- const parentRef = parentProps.ref;
47
- const childRef = childProps.ref;
48
- const mergedProps = mergeProps(parentProps, childProps);
49
- if (parentRef || childRef) {
50
- mergedProps.ref = composeRefs(parentRef, childRef);
51
- }
52
- return mergedProps;
53
- }
54
- function isSlottable(child) {
55
- return React5.isValidElement(child);
56
- }
57
- var Slot = React5.forwardRef((props, forwardedRef) => {
58
- const { children, ...slotProps } = props;
59
- if (isSlottable(children)) {
60
- const childProps = children.props;
61
- const childRef = childProps.ref;
62
- return React5.cloneElement(children, {
63
- ...mergeProps(slotProps, childProps),
64
- ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
65
- });
66
- }
67
- if (React5.Children.count(children) > 1) {
68
- const childrenArray = React5.Children.toArray(children);
69
- const slottableChild = childrenArray.find(
70
- (child) => React5.isValidElement(child) && child.type === Slottable
71
- );
72
- if (slottableChild) {
73
- const newElement = slottableChild.props.children;
74
- if (isSlottable(newElement)) {
75
- const newElementProps = newElement.props;
76
- const newChildren = childrenArray.map((child) => {
77
- if (child === slottableChild) {
78
- return React5.Children.count(newElementProps.children) > 1 ? React5.Children.only(null) : newElementProps.children;
79
- }
80
- return child;
81
- });
82
- const childRef = newElementProps.ref;
83
- return React5.cloneElement(newElement, {
84
- ...mergeProps(slotProps, newElementProps),
85
- ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
86
- children: newChildren
87
- });
88
- }
89
- }
90
- }
91
- return /* @__PURE__ */ jsx(Fragment, { children });
92
- });
93
- Slot.displayName = "Slot";
94
- function Slottable({ children }) {
95
- return /* @__PURE__ */ jsx(Fragment, { children });
96
- }
97
- var MOBILE_BREAKPOINT = 768;
98
- function useIsMobile() {
99
- const [isMobile, setIsMobile] = React5.useState(false);
100
- React5.useEffect(() => {
101
- const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
102
- const onChange = () => {
103
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
104
- };
105
- mql.addEventListener("change", onChange);
106
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
107
- return () => mql.removeEventListener("change", onChange);
108
- }, []);
109
- return isMobile;
110
- }
111
- function cn(...inputs) {
112
- return twMerge(clsx(inputs));
113
- }
114
- var buttonVariants = cva(
115
- "[&_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-base outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 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 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
116
- {
117
- defaultVariants: {
118
- size: "default",
119
- variant: "default"
120
- },
121
- variants: {
122
- size: {
123
- default: "h-9 px-[calc(--spacing(3)-1px)] sm:h-8",
124
- icon: "size-9 sm:size-8",
125
- "icon-lg": "size-10 sm:size-9",
126
- "icon-sm": "size-8 sm:size-7",
127
- "icon-xl": 'size-11 sm:size-10 [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
128
- "icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-3.5',
129
- lg: "h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9",
130
- sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7",
131
- xl: 'h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
132
- xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*="size-"])]:size-4 sm:[&_svg:not([class*="size-"])]:size-3.5'
133
- },
134
- variant: {
135
- 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",
136
- 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",
137
- "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",
138
- ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
139
- link: "border-transparent underline-offset-4 hover:underline",
140
- 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",
141
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
142
- }
143
- }
144
- }
145
- );
146
- var Button = React5.forwardRef(
147
- ({ className, variant, size, asChild, children, type = "button", ...props }, ref) => {
148
- const buttonClasses = cn(buttonVariants({ className, size, variant }));
149
- if (asChild && React5.isValidElement(children)) {
150
- const childProps = children.props;
151
- return React5.cloneElement(children, {
152
- ...props,
153
- className: cn(buttonClasses, childProps.className),
154
- "data-slot": "button"
155
- });
156
- }
157
- return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
158
- }
159
- );
160
- Button.displayName = "Button";
161
- function Input({ className, size = "default", unstyled = false, ...props }) {
162
- const isFloating = props.placeholder === " ";
163
- return /* @__PURE__ */ jsx(
164
- "span",
165
- {
166
- className: cn(
167
- !unstyled && [
168
- // Base layout
169
- "relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow",
170
- // Inner shadow highlight
171
- "before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)]",
172
- "not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]",
173
- // Focus state - use primary brand color
174
- "has-focus-visible:border-primary/60 has-focus-visible:ring-[3px] has-focus-visible:ring-primary/35",
175
- // Invalid state
176
- "has-aria-invalid:border-destructive/36",
177
- "has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16",
178
- // Disabled state
179
- "has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none",
180
- // Dark mode
181
- "sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border",
182
- "dark:has-aria-invalid:ring-destructive/24",
183
- "dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]"
184
- ],
185
- className
186
- ) || void 0,
187
- "data-size": size,
188
- "data-slot": "input-control",
189
- children: /* @__PURE__ */ jsx(
190
- Input$1,
191
- {
192
- className: cn(
193
- "w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none",
194
- isFloating ? "h-11 pt-4.5 pb-1 leading-none placeholder:text-transparent sm:h-10" : "h-8.5 leading-8.5 placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5",
195
- size === "sm" && (isFloating ? "h-10 px-[calc(--spacing(2.5)-1px)] pt-4 pb-1 sm:h-9" : "h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5"),
196
- size === "lg" && (isFloating ? "h-12 pt-5 pb-1.5 sm:h-11" : "h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5"),
197
- props.type === "search" && "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none",
198
- props.type === "file" && "text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm"
199
- ),
200
- "data-slot": "input",
201
- size: typeof size === "number" ? size : void 0,
202
- ...props
203
- }
204
- )
205
- }
206
- );
207
- }
208
- function Separator({ className, orientation = "horizontal", decorative: _decorative, ...props }) {
209
- return /* @__PURE__ */ jsx(
210
- Separator$1,
211
- {
212
- "data-slot": "separator-root",
213
- orientation,
214
- className: cn("bg-border shrink-0", orientation === "horizontal" ? "h-px w-full" : "h-full w-px", className),
215
- ...props
216
- }
217
- );
218
- }
3
+ import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, a as SidebarGroupAction, b as SidebarProvider, c as SidebarHeader, d as SidebarMenu, f as SidebarMenuAction, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, l as SidebarInput, 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-Cfax0g0_.js";
219
4
 
220
- // src/lib/motion/motion-config.ts
221
- var easings = {
222
- /** Physical feel for exit animations */
223
- physicalExit: [0.4, 0, 0.6, 1]
224
- };
225
- var durations = {
226
- /** Quick transitions (tooltips, small elements) */
227
- fast: 0.15,
228
- /** Standard UI transitions (modals, panels) */
229
- normal: 0.2};
230
- var PORTAL_ROOT_ID = "portal-root";
231
- var PortalContext = React5.createContext({
232
- layer: "base",
233
- depth: 0,
234
- floatingPortalStrategy: "root",
235
- floatingZIndex: "default"
236
- });
237
- function ModalPortalScope({
238
- children,
239
- floatingPortalStrategy = "nested",
240
- floatingZIndex = "default"
241
- }) {
242
- const parentContext = React5.useContext(PortalContext);
243
- const depth = parentContext.layer === "modal" ? parentContext.depth + 1 : 0;
244
- const value = React5.useMemo(
245
- () => ({
246
- layer: "modal",
247
- depth,
248
- floatingPortalStrategy,
249
- floatingZIndex
250
- }),
251
- [depth, floatingPortalStrategy, floatingZIndex]
252
- );
253
- return /* @__PURE__ */ jsx(PortalContext.Provider, { value, children });
254
- }
255
- function useRootPortalContainer() {
256
- const [container, setContainer] = React5.useState(null);
257
- React5.useLayoutEffect(() => {
258
- const el = document.getElementById(PORTAL_ROOT_ID);
259
- setContainer(el);
260
- }, []);
261
- return container;
262
- }
263
- function useFloatingOverlayPortalProps() {
264
- const rootContainer = useRootPortalContainer();
265
- const { floatingPortalStrategy, floatingZIndex } = React5.useContext(PortalContext);
266
- const container = floatingPortalStrategy === "nested" ? void 0 : rootContainer ?? null;
267
- const zIndexClass = floatingZIndex === "elevated" ? "z-[var(--z-layer-floating-elevated)]" : "z-[var(--z-layer-floating)]";
268
- return { container, zIndexClass };
269
- }
270
- var SheetStackContext = React5.createContext(void 0);
271
- var SHEET_INDENT = 24;
272
- var useSheetStack = () => {
273
- return React5.useContext(SheetStackContext);
274
- };
275
- var SheetNestingContext = React5.createContext({
276
- level: 0,
277
- parentSheetId: null
278
- });
279
- var useSheetNesting = () => React5.useContext(SheetNestingContext);
280
- var SheetContext = React5.createContext(void 0);
281
- var useSheet = () => {
282
- const context = React5.useContext(SheetContext);
283
- if (!context) {
284
- throw new Error("useSheet must be used within a Sheet");
285
- }
286
- return context;
287
- };
288
- var sheetIdCounter = 0;
289
- function Sheet({ children, sheetId: providedId, ...props }) {
290
- const [isOpen, setIsOpen] = React5.useState(props?.open ?? props?.defaultOpen ?? false);
291
- const sheetStack = useSheetStack();
292
- const nesting = useSheetNesting();
293
- const sheetIdRef = React5.useRef(providedId ?? `sheet-${++sheetIdCounter}`);
294
- const sheetId = sheetIdRef.current;
295
- const depth = nesting.level;
296
- const onOpenChangeRef = React5.useRef(props.onOpenChange);
297
- onOpenChangeRef.current = props.onOpenChange;
298
- const close = React5.useCallback(() => {
299
- setIsOpen(false);
300
- onOpenChangeRef.current?.(false);
301
- }, []);
302
- const registerSheetRef = React5.useRef(sheetStack?.registerSheet);
303
- const unregisterSheetRef = React5.useRef(sheetStack?.unregisterSheet);
304
- registerSheetRef.current = sheetStack?.registerSheet;
305
- unregisterSheetRef.current = sheetStack?.unregisterSheet;
306
- React5.useEffect(() => {
307
- if (registerSheetRef.current && isOpen) {
308
- if (document.activeElement instanceof HTMLElement) {
309
- document.activeElement.blur();
310
- }
311
- registerSheetRef.current({ id: sheetId, depth, close });
312
- return () => unregisterSheetRef.current?.(sheetId);
313
- }
314
- }, [isOpen, sheetId, depth, close]);
315
- React5.useEffect(() => {
316
- if (props?.open !== void 0) setIsOpen(props.open);
317
- }, [props?.open]);
318
- const handleOpenChange = React5.useCallback((open, _eventDetails) => {
319
- setIsOpen(open);
320
- onOpenChangeRef.current?.(open);
321
- }, []);
322
- const sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;
323
- const isTopSheet = sheetStack?.isTopSheet(sheetId) ?? true;
324
- const isNested = depth > 0;
325
- 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(
326
- Dialog.Root,
327
- {
328
- "data-slot": "sheet",
329
- ...props,
330
- open: isOpen,
331
- modal: isNested ? false : props.modal,
332
- onOpenChange: handleOpenChange,
333
- children
334
- }
335
- ) }) });
336
- }
337
- function SheetPortal({ forceMount: _forceMount, ...props }) {
338
- const container = useRootPortalContainer();
339
- const style = {
340
- ...props.style ?? {},
341
- ["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
342
- };
343
- return /* @__PURE__ */ jsx(Dialog.Portal, { "data-slot": "sheet-portal", container, ...props, style });
344
- }
345
- var sheetVariants = cva("fixed flex flex-col gap-3 bg-background p-4 shadow-lg", {
346
- variants: {
347
- side: {
348
- top: "inset-x-0 top-0 border-b",
349
- bottom: "inset-x-0 bottom-0 border-t",
350
- left: "inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
351
- right: "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"
352
- }
353
- },
354
- defaultVariants: {
355
- side: "right"
356
- }
357
- });
358
- var NESTED_SHEET_WIDTH = 448;
359
- var SHEET_STACK_GAP = 0;
360
- function getPushOffset(side, sheetsAbove, stackMode = "cascade", collapseBaseSize = NESTED_SHEET_WIDTH) {
361
- if (sheetsAbove === 0) {
362
- return { x: 0, y: 0 };
363
- }
364
- if (stackMode === "collapse") {
365
- const baseOffset = collapseBaseSize + SHEET_STACK_GAP;
366
- const offset2 = baseOffset + (sheetsAbove - 1) * SHEET_INDENT;
367
- switch (side) {
368
- case "right":
369
- return { x: -offset2 };
370
- case "left":
371
- return { x: offset2 };
372
- case "top":
373
- return { y: offset2 };
374
- case "bottom":
375
- return { y: -offset2 };
376
- }
377
- }
378
- const offset = sheetsAbove * SHEET_INDENT;
379
- switch (side) {
380
- case "right":
381
- return { x: -offset };
382
- case "left":
383
- return { x: offset };
384
- case "top":
385
- return { y: offset };
386
- case "bottom":
387
- return { y: -offset };
388
- }
389
- }
390
- function getInitialPosition(side) {
391
- switch (side) {
392
- case "right":
393
- return { x: "100%" };
394
- case "left":
395
- return { x: "-100%" };
396
- case "top":
397
- return { y: "-100%" };
398
- case "bottom":
399
- return { y: "100%" };
400
- }
401
- }
402
- function getExitPosition(side) {
403
- switch (side) {
404
- case "right":
405
- return { x: "100%" };
406
- case "left":
407
- return { x: "-100%" };
408
- case "top":
409
- return { y: "-100%" };
410
- case "bottom":
411
- return { y: "100%" };
412
- }
413
- }
414
- var defaultSheetTransition = {
415
- type: "tween",
416
- duration: durations.normal,
417
- ease: [0.32, 0.72, 0, 1]
418
- // Custom ease-out for snappy feel
419
- };
420
- function SheetContent({
421
- side = "right",
422
- className,
423
- transition = defaultSheetTransition,
424
- overlay = true,
425
- showClose = true,
426
- children,
427
- forceMount: _forceMount,
428
- onInteractOutside: _onInteractOutside,
429
- onPointerDownOutside: _onPointerDownOutside,
430
- onEscapeKeyDown: _onEscapeKeyDown,
431
- onFocusOutside: _onFocusOutside,
432
- ...props
433
- }) {
434
- const { isOpen, depth, sheetId, close } = useSheet();
435
- const sheetStack = useSheetStack();
436
- const sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;
437
- const stackMode = sheetStack?.stackMode ?? "cascade";
438
- const resolvedSide = side ?? "right";
439
- const zIndex = `calc(var(--z-layer-modal-content) + ${depth * 10})`;
440
- const topSheetId = sheetStack?.sheets[sheetStack.sheets.length - 1]?.id;
441
- const topSheetSize = topSheetId ? sheetStack?.getSheetSize(topSheetId) : void 0;
442
- const collapseBaseSize = topSheetSize ? resolvedSide === "left" || resolvedSide === "right" ? topSheetSize.width : topSheetSize.height : void 0;
443
- const pushOffset = getPushOffset(resolvedSide, sheetsAbove, stackMode, collapseBaseSize ?? NESTED_SHEET_WIDTH);
444
- const contentRef = React5.useRef(null);
445
- React5.useLayoutEffect(() => {
446
- if (!isOpen) return;
447
- if (!sheetStack) return;
448
- const el = contentRef.current;
449
- if (!el) return;
450
- let rafId = 0;
451
- const update = () => {
452
- const rect = el.getBoundingClientRect();
453
- sheetStack.setSheetSize(sheetId, { width: rect.width, height: rect.height });
454
- };
455
- update();
456
- if (typeof ResizeObserver === "undefined") return;
457
- const ro = new ResizeObserver(() => {
458
- cancelAnimationFrame(rafId);
459
- rafId = requestAnimationFrame(update);
460
- });
461
- ro.observe(el);
462
- return () => {
463
- cancelAnimationFrame(rafId);
464
- ro.disconnect();
465
- };
466
- }, [isOpen, sheetId, sheetStack]);
467
- const animatePosition = {
468
- x: pushOffset.x ?? 0,
469
- y: pushOffset.y ?? 0
470
- };
471
- const exitTransition = {
472
- type: "tween",
473
- duration: durations.normal,
474
- ease: easings.physicalExit
475
- };
476
- const isTargetInsideSheet = React5.useCallback((target) => {
477
- if (!target || !(target instanceof HTMLElement)) return false;
478
- return !!target.closest('[data-slot="sheet-content"]');
479
- }, []);
480
- const isTargetInsidePopup = React5.useCallback((target) => {
481
- if (!target || !(target instanceof HTMLElement)) return false;
482
- return !!target.closest(
483
- [
484
- '[data-slot="select-popup"]',
485
- '[data-slot="autocomplete-popup"]',
486
- '[data-slot="dropdown-menu-content"]',
487
- '[data-slot="dropdown-menu-sub-content"]',
488
- '[data-slot="popover-content"]',
489
- '[data-slot="tooltip-content"]'
490
- ].join(", ")
491
- );
492
- }, []);
493
- React5.useEffect(() => {
494
- if (!isOpen) return;
495
- const handlePointerDown = (event) => {
496
- if (sheetsAbove > 0) return;
497
- const target = event.target;
498
- if (isTargetInsideSheet(target) || isTargetInsidePopup(target)) return;
499
- close();
500
- };
501
- document.addEventListener("pointerdown", handlePointerDown);
502
- return () => document.removeEventListener("pointerdown", handlePointerDown);
503
- }, [isOpen, sheetsAbove, isTargetInsideSheet, isTargetInsidePopup, close]);
504
- return /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(SheetPortal, { "data-slot": "sheet-portal", children: [
505
- overlay && depth === 0 && /* @__PURE__ */ jsx(
506
- motion.div,
507
- {
508
- "data-slot": "sheet-overlay",
509
- className: "fixed inset-0 bg-black/80",
510
- initial: { opacity: 0 },
511
- animate: { opacity: 1 },
512
- exit: { opacity: 0 },
513
- transition: { duration: durations.fast, ease: "easeOut" },
514
- style: { willChange: "opacity", zIndex: "var(--z-layer-modal-backdrop)" }
515
- },
516
- "sheet-overlay"
517
- ),
518
- /* @__PURE__ */ jsxs(
519
- Dialog.Popup,
520
- {
521
- "data-slot": "sheet-content",
522
- "data-sheet-depth": depth,
523
- "data-sheet-id": sheetId,
524
- ...props,
525
- render: /* @__PURE__ */ jsx(
526
- motion.div,
527
- {
528
- ref: contentRef,
529
- variants: {
530
- initial: getInitialPosition(resolvedSide),
531
- animate: animatePosition,
532
- exit: {
533
- ...getExitPosition(resolvedSide),
534
- transition: exitTransition
535
- }
536
- },
537
- initial: "initial",
538
- animate: "animate",
539
- exit: "exit",
540
- transition,
541
- style: {
542
- zIndex,
543
- willChange: "transform"
544
- },
545
- className: cn(sheetVariants({ side: resolvedSide }), className)
546
- },
547
- `sheet-content-${sheetId}`
548
- ),
549
- children: [
550
- /* @__PURE__ */ jsx(ModalPortalScope, { children }),
551
- showClose && /* @__PURE__ */ jsxs(
552
- Dialog.Close,
553
- {
554
- "data-slot": "sheet-close",
555
- 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",
556
- children: [
557
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
558
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
559
- ]
560
- }
561
- )
562
- ]
563
- }
564
- )
565
- ] }) });
566
- }
567
- function SheetHeader({ className, ...props }) {
568
- return /* @__PURE__ */ jsx(
569
- "div",
570
- {
571
- "data-slot": "sheet-header",
572
- className: cn("flex flex-col space-y-2 pb-4 text-center sm:text-left", className),
573
- ...props
574
- }
575
- );
576
- }
577
- function SheetTitle({ className, ...props }) {
578
- return /* @__PURE__ */ jsx(
579
- Dialog.Title,
580
- {
581
- "data-slot": "sheet-title",
582
- className: cn("text-foreground text-lg font-semibold", className),
583
- ...props
584
- }
585
- );
586
- }
587
- function SheetDescription({ className, ...props }) {
588
- return /* @__PURE__ */ jsx(
589
- Dialog.Description,
590
- {
591
- "data-slot": "sheet-description",
592
- className: cn("text-muted-foreground text-sm", className),
593
- ...props
594
- }
595
- );
596
- }
597
- function Skeleton({ className, ...props }) {
598
- return /* @__PURE__ */ jsx("div", { "data-slot": "skeleton", className: cn("bg-primary/10 animate-pulse rounded-md", className), ...props });
599
- }
600
- function TooltipProvider({ delay = 0, delayDuration, ...props }) {
601
- return /* @__PURE__ */ jsx(Tooltip$1.Provider, { "data-slot": "tooltip-provider", delay: delayDuration ?? delay, ...props });
602
- }
603
- function Tooltip({ delayDuration: _delayDuration, ...props }) {
604
- return /* @__PURE__ */ jsx(Tooltip$1.Root, { "data-slot": "tooltip", ...props });
605
- }
606
- function TooltipTrigger({ delay = 0, asChild, children, ...props }) {
607
- if (asChild && React5.isValidElement(children)) {
608
- return /* @__PURE__ */ jsx(
609
- Tooltip$1.Trigger,
610
- {
611
- "data-slot": "tooltip-trigger",
612
- delay,
613
- ...props,
614
- render: (triggerProps) => {
615
- return React5.cloneElement(
616
- children,
617
- mergePropsWithRef(triggerProps, children)
618
- );
619
- }
620
- }
621
- );
622
- }
623
- return /* @__PURE__ */ jsx(Tooltip$1.Trigger, { "data-slot": "tooltip-trigger", delay, ...props, children });
624
- }
625
- function TooltipContent({
626
- className,
627
- sideOffset = 4,
628
- showArrow = false,
629
- side = "top",
630
- align = "center",
631
- children,
632
- ...props
633
- }) {
634
- const { container, zIndexClass } = useFloatingOverlayPortalProps();
635
- return /* @__PURE__ */ jsx(Tooltip$1.Portal, { container, children: /* @__PURE__ */ jsx(Tooltip$1.Positioner, { side, align, sideOffset, className: zIndexClass, children: /* @__PURE__ */ jsxs(
636
- Tooltip$1.Popup,
637
- {
638
- "data-slot": "tooltip-content",
639
- className: cn(
640
- `bg-popover text-popover-foreground data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95
641
- data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95
642
- data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2
643
- data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2
644
- relative max-w-70 rounded-md border px-2 py-1 text-xs`,
645
- className
646
- ),
647
- ...props,
648
- children: [
649
- children,
650
- showArrow && /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]" })
651
- ]
652
- }
653
- ) }) });
654
- }
655
- var SIDEBAR_COOKIE_NAME = "sidebar_state";
656
- var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
657
- var SIDEBAR_WIDTH = "14rem";
658
- var SIDEBAR_WIDTH_MOBILE = "16rem";
659
- var SIDEBAR_WIDTH_ICON = "4rem";
660
- var SIDEBAR_KEYBOARD_SHORTCUT = "b";
661
- var SidebarContext = React5.createContext(null);
662
- function useSidebar() {
663
- const context = React5.useContext(SidebarContext);
664
- if (!context) {
665
- throw new Error("useSidebar must be used within a SidebarProvider.");
666
- }
667
- return context;
668
- }
669
- function SidebarProvider({
670
- defaultOpen = false,
671
- open: openProp,
672
- onOpenChange: setOpenProp,
673
- className,
674
- style,
675
- children,
676
- ...props
677
- }) {
678
- const isMobile = useIsMobile();
679
- const [openMobile, setOpenMobile] = React5.useState(false);
680
- const [isHovered, setIsHovered] = React5.useState(false);
681
- const [_open, _setOpen] = React5.useState(defaultOpen);
682
- const open = openProp ?? _open;
683
- const setOpen = React5.useCallback(
684
- (value) => {
685
- const openState = typeof value === "function" ? value(open) : value;
686
- if (setOpenProp) {
687
- setOpenProp(openState);
688
- } else {
689
- _setOpen(openState);
690
- }
691
- document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
692
- },
693
- [setOpenProp, open]
694
- );
695
- const toggleSidebar = React5.useCallback(() => {
696
- return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
697
- }, [isMobile, setOpen, setOpenMobile]);
698
- React5.useEffect(() => {
699
- const handleKeyDown = (event) => {
700
- if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
701
- event.preventDefault();
702
- toggleSidebar();
703
- }
704
- };
705
- window.addEventListener("keydown", handleKeyDown);
706
- return () => window.removeEventListener("keydown", handleKeyDown);
707
- }, [toggleSidebar]);
708
- const effectiveOpen = isMobile ? open : isHovered || open;
709
- const state = effectiveOpen ? "expanded" : "collapsed";
710
- const contextValue = React5.useMemo(
711
- () => ({
712
- state,
713
- open,
714
- setOpen,
715
- isMobile,
716
- openMobile,
717
- setOpenMobile,
718
- toggleSidebar,
719
- isHovered,
720
- setIsHovered
721
- }),
722
- [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, isHovered, setIsHovered]
723
- );
724
- return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
725
- "div",
726
- {
727
- "data-slot": "sidebar-wrapper",
728
- style: {
729
- "--sidebar-width": SIDEBAR_WIDTH,
730
- "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
731
- ...style
732
- },
733
- className: cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", className),
734
- ...props,
735
- children
736
- }
737
- ) }) });
738
- }
739
- function Sidebar({
740
- side = "left",
741
- variant = "sidebar",
742
- collapsible = "icon",
743
- className,
744
- children,
745
- ...props
746
- }) {
747
- const { isMobile, state, openMobile, setOpenMobile, setIsHovered } = useSidebar();
748
- if (collapsible === "none") {
749
- return /* @__PURE__ */ jsx(
750
- "div",
751
- {
752
- "data-slot": "sidebar",
753
- className: cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className),
754
- ...props,
755
- children
756
- }
757
- );
758
- }
759
- if (isMobile) {
760
- return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
761
- SheetContent,
762
- {
763
- "data-sidebar": "sidebar",
764
- "data-slot": "sidebar",
765
- "data-mobile": "true",
766
- className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
767
- style: {
768
- "--sidebar-width": SIDEBAR_WIDTH_MOBILE
769
- },
770
- side,
771
- children: [
772
- /* @__PURE__ */ jsxs(SheetHeader, { className: "sr-only", children: [
773
- /* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }),
774
- /* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })
775
- ] }),
776
- /* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
777
- ]
778
- }
779
- ) });
780
- }
781
- return /* @__PURE__ */ jsxs(
782
- "div",
783
- {
784
- className: "group peer text-sidebar-foreground hidden data-[side=right]:order-last md:block",
785
- "data-state": state,
786
- "data-collapsible": state === "collapsed" ? collapsible : "",
787
- "data-variant": variant,
788
- "data-side": side,
789
- "data-slot": "sidebar",
790
- onMouseEnter: () => setIsHovered(true),
791
- onMouseLeave: () => setIsHovered(false),
792
- children: [
793
- /* @__PURE__ */ jsx(
794
- "div",
795
- {
796
- "data-slot": "sidebar-gap",
797
- className: cn(
798
- "relative w-(--sidebar-width) bg-transparent transition-[width] duration-300 ease-in-out",
799
- "group-data-[collapsible=offcanvas]:w-0",
800
- "group-data-[side=right]:rotate-180",
801
- variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
802
- )
803
- }
804
- ),
805
- /* @__PURE__ */ jsx(
806
- "div",
807
- {
808
- "data-slot": "sidebar-container",
809
- className: cn(
810
- `fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width,margin]
811
- duration-[.3s,.3s,.3s,.15s] ease-in-out md:flex`,
812
- side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
813
- // Adjust the padding for floating and inset variants.
814
- 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
815
- group-data-[side=right]:border-l`,
816
- className
817
- ),
818
- ...props,
819
- children: /* @__PURE__ */ jsx(
820
- "div",
821
- {
822
- "data-sidebar": "sidebar",
823
- "data-slot": "sidebar-inner",
824
- className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border/60 flex h-full w-full flex-col\n group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border\n group-data-[variant=floating]:shadow-sm",
825
- children
826
- }
827
- )
828
- }
829
- )
830
- ]
831
- }
832
- );
833
- }
834
- function SidebarTrigger({ className, onClick, ...props }) {
835
- const { toggleSidebar } = useSidebar();
836
- return /* @__PURE__ */ jsxs(
837
- Button,
838
- {
839
- "data-sidebar": "trigger",
840
- "data-slot": "sidebar-trigger",
841
- variant: "ghost",
842
- size: "icon",
843
- className: cn("size-7", className),
844
- onClick: (event) => {
845
- onClick?.(event);
846
- toggleSidebar();
847
- },
848
- ...props,
849
- children: [
850
- /* @__PURE__ */ jsx(PanelLeftIcon, {}),
851
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
852
- ]
853
- }
854
- );
855
- }
856
- function SidebarInset({ className, ...props }) {
857
- return /* @__PURE__ */ jsx(
858
- "main",
859
- {
860
- "data-slot": "sidebar-inset",
861
- className: cn(
862
- "bg-background relative flex w-full flex-1 flex-col transition-[margin] duration-300 ease-in-out",
863
- `md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl
864
- md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,
865
- className
866
- ),
867
- ...props
868
- }
869
- );
870
- }
871
- function SidebarInput({ className, ...props }) {
872
- return /* @__PURE__ */ jsx(
873
- Input,
874
- {
875
- "data-slot": "sidebar-input",
876
- "data-sidebar": "input",
877
- className: cn("bg-background h-8 w-full shadow-none", className),
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("bg-sidebar-border/60 mx-2 w-auto", 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
- "flex min-h-0 flex-1 flex-col gap-2 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
- asChild = false,
943
- ...props
944
- }) {
945
- const Comp = asChild ? Slot : "div";
946
- return /* @__PURE__ */ jsx(
947
- Comp,
948
- {
949
- "data-slot": "sidebar-group-label",
950
- "data-sidebar": "group-label",
951
- className: cn(
952
- `text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium
953
- outline-hidden transition-[margin,opacity] duration-300 ease-in-out focus-visible:ring-2 [&>svg]:size-4
954
- [&>svg]:shrink-0`,
955
- "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
956
- className
957
- ),
958
- ...props
959
- }
960
- );
961
- }
962
- function SidebarGroupAction({
963
- className,
964
- asChild = false,
965
- ...props
966
- }) {
967
- const Comp = asChild ? Slot : "button";
968
- return /* @__PURE__ */ jsx(
969
- Comp,
970
- {
971
- "data-slot": "sidebar-group-action",
972
- "data-sidebar": "group-action",
973
- className: cn(
974
- `text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute
975
- top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden
976
- transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,
977
- // Increases the hit area of the button on mobile.
978
- "after:absolute after:-inset-2 md:after:hidden",
979
- "group-data-[collapsible=icon]:hidden",
980
- className
981
- ),
982
- ...props
983
- }
984
- );
985
- }
986
- function SidebarGroupContent({ className, ...props }) {
987
- return /* @__PURE__ */ jsx(
988
- "div",
989
- {
990
- "data-slot": "sidebar-group-content",
991
- "data-sidebar": "group-content",
992
- className: cn("w-full text-sm", className),
993
- ...props
994
- }
995
- );
996
- }
997
- function SidebarMenu({ className, ...props }) {
998
- return /* @__PURE__ */ jsx(
999
- "ul",
1000
- {
1001
- "data-slot": "sidebar-menu",
1002
- "data-sidebar": "menu",
1003
- className: cn("flex w-full min-w-0 flex-col gap-1", className),
1004
- ...props
1005
- }
1006
- );
1007
- }
1008
- function SidebarMenuItem({ className, ...props }) {
1009
- return /* @__PURE__ */ jsx(
1010
- "li",
1011
- {
1012
- "data-slot": "sidebar-menu-item",
1013
- "data-sidebar": "menu-item",
1014
- className: cn("group/menu-item relative", className),
1015
- ...props
1016
- }
1017
- );
1018
- }
1019
- var sidebarMenuButtonVariants = cva(
1020
- "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,margin,gap] duration-200 ease-[cubic-bezier(0.25,1,0.5,1)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:h-8! group-data-[collapsible=icon]:w-9! group-data-[collapsible=icon]:mx-auto group-data-[collapsible=icon]:gap-0 group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
1021
- {
1022
- variants: {
1023
- variant: {
1024
- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
1025
- outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
1026
- },
1027
- size: {
1028
- default: "h-8 text-sm",
1029
- sm: "h-7 text-xs",
1030
- lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
1031
- }
1032
- },
1033
- defaultVariants: {
1034
- variant: "default",
1035
- size: "default"
1036
- }
1037
- }
1038
- );
1039
- function SidebarMenuButton({
1040
- asChild = false,
1041
- isActive = false,
1042
- variant = "default",
1043
- size = "default",
1044
- tooltip,
1045
- className,
1046
- ...props
1047
- }) {
1048
- const Comp = asChild ? Slot : "button";
1049
- const { isMobile, state } = useSidebar();
1050
- const button = /* @__PURE__ */ jsx(
1051
- Comp,
1052
- {
1053
- "data-slot": "sidebar-menu-button",
1054
- "data-sidebar": "menu-button",
1055
- "data-size": size,
1056
- "data-active": isActive,
1057
- className: cn(sidebarMenuButtonVariants({ variant, size }), className),
1058
- ...props
1059
- }
1060
- );
1061
- if (!tooltip) {
1062
- return button;
1063
- }
1064
- if (typeof tooltip === "string") {
1065
- tooltip = {
1066
- children: tooltip
1067
- };
1068
- }
1069
- return /* @__PURE__ */ jsxs(Tooltip, { children: [
1070
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
1071
- /* @__PURE__ */ jsx(TooltipContent, { side: "right", align: "center", hidden: state !== "collapsed" || isMobile, ...tooltip })
1072
- ] });
1073
- }
1074
- function SidebarMenuAction({
1075
- className,
1076
- asChild = false,
1077
- showOnHover = false,
1078
- ...props
1079
- }) {
1080
- const Comp = asChild ? Slot : "button";
1081
- return /* @__PURE__ */ jsx(
1082
- Comp,
1083
- {
1084
- "data-slot": "sidebar-menu-action",
1085
- "data-sidebar": "menu-action",
1086
- className: cn(
1087
- `text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground
1088
- peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5
1089
- items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2
1090
- [&>svg]:size-4 [&>svg]:shrink-0`,
1091
- // Increases the hit area of the button on mobile.
1092
- "after:absolute after:-inset-2 md:after:hidden",
1093
- "peer-data-[size=sm]/menu-button:top-1",
1094
- "peer-data-[size=default]/menu-button:top-1.5",
1095
- "peer-data-[size=lg]/menu-button:top-2.5",
1096
- "group-data-[collapsible=icon]:hidden",
1097
- showOnHover && `peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100
1098
- group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0`,
1099
- className
1100
- ),
1101
- ...props
1102
- }
1103
- );
1104
- }
1105
- function SidebarMenuBadge({ className, ...props }) {
1106
- return /* @__PURE__ */ jsx(
1107
- "div",
1108
- {
1109
- "data-slot": "sidebar-menu-badge",
1110
- "data-sidebar": "menu-badge",
1111
- className: cn(
1112
- `text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center
1113
- rounded-md px-1 text-xs font-medium tabular-nums select-none`,
1114
- `peer-hover/menu-button:text-sidebar-accent-foreground
1115
- peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,
1116
- "peer-data-[size=sm]/menu-button:top-1",
1117
- "peer-data-[size=default]/menu-button:top-1.5",
1118
- "peer-data-[size=lg]/menu-button:top-2.5",
1119
- "group-data-[collapsible=icon]:hidden",
1120
- className
1121
- ),
1122
- ...props
1123
- }
1124
- );
1125
- }
1126
- function SidebarMenuSkeleton({
1127
- className,
1128
- showIcon = false,
1129
- ...props
1130
- }) {
1131
- const width = React5.useMemo(() => {
1132
- return `${Math.floor(Math.random() * 40) + 50}%`;
1133
- }, []);
1134
- return /* @__PURE__ */ jsxs(
1135
- "div",
1136
- {
1137
- "data-slot": "sidebar-menu-skeleton",
1138
- "data-sidebar": "menu-skeleton",
1139
- className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
1140
- ...props,
1141
- children: [
1142
- showIcon && /* @__PURE__ */ jsx(Skeleton, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" }),
1143
- /* @__PURE__ */ jsx(
1144
- Skeleton,
1145
- {
1146
- className: "h-4 max-w-(--skeleton-width) flex-1",
1147
- "data-sidebar": "menu-skeleton-text",
1148
- style: {
1149
- "--skeleton-width": width
1150
- }
1151
- }
1152
- )
1153
- ]
1154
- }
1155
- );
1156
- }
1157
- function SidebarMenuSub({ className, ...props }) {
1158
- return /* @__PURE__ */ jsx(
1159
- "ul",
1160
- {
1161
- "data-slot": "sidebar-menu-sub",
1162
- "data-sidebar": "menu-sub",
1163
- className: cn(
1164
- "border-sidebar-border/60 mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
1165
- "group-data-[collapsible=icon]:hidden",
1166
- className
1167
- ),
1168
- ...props
1169
- }
1170
- );
1171
- }
1172
- function SidebarMenuSubItem({ className, ...props }) {
1173
- return /* @__PURE__ */ jsx(
1174
- "li",
1175
- {
1176
- "data-slot": "sidebar-menu-sub-item",
1177
- "data-sidebar": "menu-sub-item",
1178
- className: cn("group/menu-sub-item relative", className),
1179
- ...props
1180
- }
1181
- );
1182
- }
1183
- function SidebarMenuSubButton({
1184
- asChild = false,
1185
- size = "md",
1186
- isActive = false,
1187
- className,
1188
- ...props
1189
- }) {
1190
- const Comp = asChild ? Slot : "a";
1191
- return /* @__PURE__ */ jsx(
1192
- Comp,
1193
- {
1194
- "data-slot": "sidebar-menu-sub-button",
1195
- "data-sidebar": "menu-sub-button",
1196
- "data-size": size,
1197
- "data-active": isActive,
1198
- className: cn(
1199
- `text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground
1200
- active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7
1201
- min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2
1202
- disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50
1203
- [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,
1204
- "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
1205
- size === "sm" && "text-xs",
1206
- size === "md" && "text-sm",
1207
- "group-data-[collapsible=icon]:hidden",
1208
- className
1209
- ),
1210
- ...props
1211
- }
1212
- );
1213
- }
1214
-
1215
- export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarSeparator, SidebarTrigger, useSidebar };
1216
- //# sourceMappingURL=sidebar.js.map
1217
- //# sourceMappingURL=sidebar.js.map
5
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };