@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 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/utils.ts","../../../src/components/portal.tsx","../../../src/lib/slot.tsx","../../../src/components/tooltip.tsx","../../../src/components/button.tsx","../../../src/components/flow-zoom-panel.tsx","../../../src/components/org-chart/layout.ts","../../../src/components/org-chart/org-chart-context.tsx","../../../src/components/org-chart/org-chart-edge.tsx","../../../src/components/org-chart/org-chart-empty.tsx","../../../src/components/avatar.tsx","../../../src/components/badge.tsx","../../../src/components/dropdown-menu.tsx","../../../src/components/org-chart/org-chart-utils.ts","../../../src/components/org-chart/org-chart-node.tsx","../../../src/components/org-chart/org-chart.tsx"],"names":["React","jsx","TooltipPrimitive","React4","jsxs","createContext","useState","useCallback","useMemo","useContext","AvatarPrimitive","cva","React5","MenuPrimitive","React6","useReactFlow"],"mappings":";;;;;;;;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACuCO,IAAM,cAAA,GAAiB,aAAA;AAM9B,IAAM,gBAAsBA,MAAA,CAAA,aAAA,CAAkC;AAAA,EAC7D,KAAA,EAAO,MAAA;AAAA,EACP,KAAA,EAAO,CAAA;AAAA,EACP,sBAAA,EAAwB,MAAA;AAAA,EACxB,cAAA,EAAgB;AACjB,CAAC,CAAA;AAwEM,SAAS,sBAAA,GAA6C;AAC5D,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAUA,gBAA6B,IAAI,CAAA;AAEzE,EAAMA,uBAAgB,MAAM;AAC3B,IAAA,MAAM,EAAA,GAAK,QAAA,CAAS,cAAA,CAAe,cAAc,CAAA;AACjD,IAAA,YAAA,CAAa,EAAE,CAAA;AAAA,EAChB,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,SAAA;AACR;AASO,SAAS,6BAAA,GAGd;AACD,EAAA,MAAM,gBAAgB,sBAAA,EAAuB;AAC7C,EAAA,MAAM,EAAE,sBAAA,EAAwB,cAAA,E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,uBACCA,IAAC,iBAAA,EAAA,EACA,QAAA,kBAAAA,IAAC,gBAAA,EAAA,EAAiB,QAAA,EAAU,MAAM,QAAA,IAAY,IAAA,EAC7C,0BAAAA,GAAAA,CAAC,eAAA,EAAA,EACA,0BAAAA,GAAAA,CAAC,aAAA,EAAA,EAAe,GAAG,KAAA,EAAO,CAAA,EAC3B,GACD,CAAA,EACD,CAAA;AAEF","file":"index.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Overlay layer type:\n * - 'base': Root level (page content, base floating elements)\n * - 'modal': Inside a modal overlay (dialog, sheet, drawer)\n */\nexport type OverlayLayer = 'base' | 'modal';\n\n/**\n * Where floating overlays should portal:\n * - 'root': always portal into #portal-root\n * - 'nested': let Base UI nest portals into the nearest Base UI portal node\n */\nexport type FloatingPortalStrategy = 'root' | 'nested';\n\n/**\n * Z-index mode for floating overlays.\n * - 'default': --z-layer-floating\n * - 'elevated': --z-layer-floating-elevated\n */\nexport type FloatingZIndex = 'default' | 'elevated';\n\ninterface PortalContextValue {\n\t/** Current overlay layer */\n\tlayer: OverlayLayer;\n\t/** Modal nesting depth (0 for first modal, 1 for nested, etc.) */\n\tdepth: number;\n\t/** Strategy for where floating overlays should portal */\n\tfloatingPortalStrategy: FloatingPortalStrategy;\n\t/** Z-index mode for floating overlays */\n\tfloatingZIndex: FloatingZIndex;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nexport const PORTAL_ROOT_ID = 'portal-root';\n\n// ============================================================================\n// Context\n// ============================================================================\n\nconst PortalContext = React.createContext<PortalContextValue>({\n\tlayer: 'base',\n\tdepth: 0,\n\tfloatingPortalStrategy: 'root',\n\tfloatingZIndex: 'default',\n});\n\n// ============================================================================\n// Providers\n// ============================================================================\n\n/**\n * Provider for modal overlays (Dialog, Sheet, Drawer, etc.)\n *\n * Wraps modal content to:\n * 1. Create a scoped portal container for nested floating elements\n * 2. Track the overlay layer (so floating elements know to use elevated z-index)\n * 3. Track nesting depth for stacked modals\n *\n * Usage:\n * ```tsx\n * <DialogPopup>\n * <ModalPortalScope>\n * {children} // Popovers inside here will render in the scoped container\n * </ModalPortalScope>\n * </DialogPopup>\n * ```\n */\nexport function ModalPortalScope({\n\tchildren,\n\tfloatingPortalStrategy = 'nested',\n\tfloatingZIndex = 'default',\n}: {\n\tchildren: React.ReactNode;\n\tfloatingPortalStrategy?: FloatingPortalStrategy;\n\tfloatingZIndex?: FloatingZIndex;\n}) {\n\tconst parentContext = React.useContext(PortalContext);\n\n\t// Increment depth from parent if already in modal layer\n\tconst depth = parentContext.layer === 'modal' ? parentContext.depth + 1 : 0;\n\n\tconst value = React.useMemo<PortalContextValue>(\n\t\t() => ({\n\t\t\tlayer: 'modal',\n\t\t\tdepth,\n\t\t\tfloatingPortalStrategy,\n\t\t\tfloatingZIndex,\n\t\t}),\n\t\t[depth, floatingPortalStrategy, floatingZIndex],\n\t);\n\n\treturn <PortalContext.Provider value={value}>{children}</PortalContext.Provider>;\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\n/**\n * Get the current portal context value.\n * Used internally by other hooks.\n */\nexport function usePortalContext(): PortalContextValue {\n\treturn React.useContext(PortalContext);\n}\n\nexport function useInModalOverlay(): boolean {\n\treturn React.useContext(PortalContext).layer === 'modal';\n}\n\n/**\n * Get the root portal container element.\n * Used by modal components (Dialog, Sheet, etc.) to render their portals.\n *\n * @returns The root portal container, or null during SSR/before mount\n */\nexport function useRootPortalContainer(): HTMLElement | null {\n\tconst [container, setContainer] = React.useState<HTMLElement | null>(null);\n\n\tReact.useLayoutEffect(() => {\n\t\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\t\tsetContainer(el);\n\t}, []);\n\n\treturn container;\n}\n\n/**\n * Centralized portal + z-index policy for floating overlays.\n *\n * - When `floatingPortalStrategy` is 'nested', Base UI will automatically portal\n * into the nearest Base UI portal node (so dialog \"inert\" behavior includes it).\n * - When it's 'root', we portal into #portal-root.\n */\nexport function useFloatingOverlayPortalProps(): {\n\tcontainer?: HTMLElement | null;\n\tzIndexClass: string;\n} {\n\tconst rootContainer = useRootPortalContainer();\n\tconst { floatingPortalStrategy, floatingZIndex } = React.useContext(PortalContext);\n\n\tconst container = floatingPortalStrategy === 'nested' ? undefined : (rootContainer ?? null);\n\tconst zIndexClass =\n\t\tfloatingZIndex === 'elevated'\n\t\t\t? 'z-[var(--z-layer-floating-elevated)]'\n\t\t\t: 'z-[var(--z-layer-floating)]';\n\n\treturn { container, zIndexClass };\n}\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Portal root component to render in app layout.\n * All overlay components will render their portals inside this container.\n *\n * Usage in layout.tsx:\n * ```tsx\n * import { PortalRoot } from '@constructive-io/ui/portal';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * {children}\n * <PortalRoot />\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport function PortalRoot() {\n\treturn (\n\t\t<div\n\t\t\tid={PORTAL_ROOT_ID}\n\t\t\tdata-slot=\"portal-root\"\n\t\t\tstyle={{\n\t\t\t\tposition: 'fixed',\n\t\t\t\tinset: 0,\n\t\t\t\tzIndex: 'var(--z-layer-portal-root)',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\t// Children (portal contents) will have pointer-events: auto\n\t\t\t}}\n\t\t/>\n\t);\n}\n\n/**\n * Hook to get the portal container element for rendering floating UI elements.\n * Returns the element with id=\"portal-root\" if it exists in the DOM.\n *\n * @deprecated Use useRootPortalContainer or useFloatingOverlayPortalProps instead\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n\tif (typeof document === 'undefined') return undefined;\n\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\treturn el instanceof HTMLElement ? el : undefined;\n}\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single callback ref.\n * React 19 compatible - handles refs as regular props.\n */\nfunction composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(node);\n\t\t\t} else if (ref != null) {\n\t\t\t\t(ref as React.MutableRefObject<T | null>).current = node;\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Merges props, handling special cases for className, style, and event handlers.\n * Excludes 'ref' from merging as it's handled separately.\n */\nfunction mergeProps(\n\tslotProps: Record<string, unknown>,\n\tchildProps: Record<string, unknown>,\n): Record<string, unknown> {\n\tconst overrideProps: Record<string, unknown> = { ...childProps };\n\n\tfor (const propName in childProps) {\n\t\t// Skip ref - handled separately for composition\n\t\tif (propName === 'ref') continue;\n\n\t\tconst slotPropValue = slotProps[propName];\n\t\tconst childPropValue = childProps[propName];\n\n\t\t// Compose event handlers\n\t\tif (/^on[A-Z]/.test(propName) && typeof slotPropValue === 'function' && typeof childPropValue === 'function') {\n\t\t\toverrideProps[propName] = (...args: unknown[]) => {\n\t\t\t\tchildPropValue(...args);\n\t\t\t\tslotPropValue(...args);\n\t\t\t};\n\t\t}\n\t\t// Merge className\n\t\telse if (propName === 'className' && typeof slotPropValue === 'string' && typeof childPropValue === 'string') {\n\t\t\toverrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();\n\t\t}\n\t\t// Merge style\n\t\telse if (propName === 'style' && typeof slotPropValue === 'object' && typeof childPropValue === 'object') {\n\t\t\toverrideProps[propName] = { ...slotPropValue, ...childPropValue };\n\t\t}\n\t}\n\n\treturn { ...slotProps, ...overrideProps };\n}\n\n/**\n * Merges props from a parent component with a child element's props,\n * including proper ref composition. Use this in render prop patterns\n * where the parent needs to merge its props with the child's.\n *\n * @param parentProps - Props from the parent component (e.g., triggerProps from Base UI)\n * @param childElement - The child React element whose props will be merged\n * @returns Merged props object ready to pass to React.cloneElement\n */\nfunction mergePropsWithRef<T = HTMLElement>(\n\tparentProps: Record<string, unknown>,\n\tchildElement: React.ReactElement,\n): Record<string, unknown> {\n\tconst childProps = childElement.props as Record<string, unknown>;\n\tconst parentRef = parentProps.ref as React.Ref<T> | undefined;\n\tconst childRef = childProps.ref as React.Ref<T> | undefined;\n\n\tconst mergedProps = mergeProps(parentProps, childProps);\n\n\t// Compose refs if either exists\n\tif (parentRef || childRef) {\n\t\tmergedProps.ref = composeRefs(parentRef, childRef);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Check if a value is a valid slottable child (single React element).\n */\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n\treturn React.isValidElement(child);\n}\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Slot component - renders its child element with merged props.\n * Used for the `asChild` pattern where parent props are passed to child.\n * React 19 compatible - accesses ref from props instead of element.ref.\n */\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n\tconst { children, ...slotProps } = props;\n\n\t// Handle single child\n\tif (isSlottable(children)) {\n\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t// React 19: ref is now a regular prop, not element.ref\n\t\tconst childRef = childProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\treturn React.cloneElement(children, {\n\t\t\t...mergeProps(slotProps, childProps),\n\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t} as React.Attributes);\n\t}\n\n\t// Handle multiple children - wrap Slottable content\n\tif (React.Children.count(children) > 1) {\n\t\tconst childrenArray = React.Children.toArray(children);\n\t\tconst slottableChild = childrenArray.find(\n\t\t\t(child) => React.isValidElement(child) && child.type === Slottable,\n\t\t) as React.ReactElement<{ children: React.ReactNode }> | undefined;\n\n\t\tif (slottableChild) {\n\t\t\tconst newElement = slottableChild.props.children;\n\t\t\tif (isSlottable(newElement)) {\n\t\t\t\tconst newElementProps = newElement.props as Record<string, unknown> & { children?: React.ReactNode };\n\t\t\t\tconst newChildren = childrenArray.map((child) => {\n\t\t\t\t\tif (child === slottableChild) {\n\t\t\t\t\t\treturn React.Children.count(newElementProps.children) > 1\n\t\t\t\t\t\t\t? React.Children.only(null)\n\t\t\t\t\t\t\t: newElementProps.children;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\n\t\t\t\t// React 19: ref is now a regular prop\n\t\t\t\tconst childRef = newElementProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\t\t\treturn React.cloneElement(newElement, {\n\t\t\t\t\t...mergeProps(slotProps, newElementProps),\n\t\t\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t\t\t\tchildren: newChildren,\n\t\t\t\t} as React.Attributes);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fallback: render children as-is (shouldn't normally happen with proper usage)\n\treturn <>{children}</>;\n});\n\nSlot.displayName = 'Slot';\n\n/**\n * Slottable component - marks content that should receive slot props.\n * Used when Slot has multiple children and you want to specify which one receives props.\n */\nfunction Slottable({ children }: { children: React.ReactNode }) {\n\treturn <>{children}</>;\n}\n\nexport { Slot, Slottable, composeRefs, mergeProps, mergePropsWithRef };\n","'use client';\n\nimport * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\n\nimport { useFloatingOverlayPortalProps } from './portal';\nimport { mergePropsWithRef } from '../lib/slot';\nimport { cn } from '../lib/utils';\n\ntype TooltipProviderProps = React.ComponentProps<typeof TooltipPrimitive.Provider> & {\n\t/** @deprecated Use delay instead */\n\tdelayDuration?: number;\n};\n\nfunction TooltipProvider({ delay = 0, delayDuration, ...props }: TooltipProviderProps) {\n\treturn <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delay={delayDuration ?? delay} {...props} />;\n}\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> & {\n\t/** @deprecated Use delay on Trigger instead */\n\tdelayDuration?: number;\n};\n\nfunction Tooltip({ delayDuration: _delayDuration, ...props }: TooltipProps) {\n\treturn <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\n\ntype TooltipTriggerProps = Omit<React.ComponentProps<typeof TooltipPrimitive.Trigger>, 'render'> & {\n\tdelay?: number;\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction TooltipTrigger({ delay = 0, asChild, children, ...props }: TooltipTriggerProps) {\n\tif (asChild && React.isValidElement(children)) {\n\t\treturn (\n\t\t\t<TooltipPrimitive.Trigger\n\t\t\t\tdata-slot=\"tooltip-trigger\"\n\t\t\t\tdelay={delay}\n\t\t\t\t{...props}\n\t\t\trender={(triggerProps) => {\n\t\t\t\treturn React.cloneElement(\n\t\t\t\t\tchildren as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\tmergePropsWithRef(triggerProps as Record<string, unknown>, children as React.ReactElement),\n\t\t\t\t);\n\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" delay={delay} {...props}>\n\t\t\t{children}\n\t\t</TooltipPrimitive.Trigger>\n\t);\n}\n\ntype TooltipContentProps = React.ComponentProps<typeof TooltipPrimitive.Popup> & {\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\talign?: 'start' | 'center' | 'end';\n};\n\nfunction TooltipContent({\n\tclassName,\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'top',\n\talign = 'center',\n\tchildren,\n\t...props\n}: TooltipContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<TooltipPrimitive.Portal container={container}>\n\t\t\t<TooltipPrimitive.Positioner side={side} align={align} sideOffset={sideOffset} className={zIndexClass}>\n\t\t\t\t<TooltipPrimitive.Popup\n\t\t\t\t\tdata-slot=\"tooltip-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95\n\t\t\t\t\t\tdata-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95\n\t\t\t\t\t\tdata-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\n\t\t\t\t\t\tdata-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\n\t\t\t\t\t\trelative max-w-70 rounded-md border px-2 py-1 text-xs`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<TooltipPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]' />\n\t\t\t\t\t)}\n\t\t\t\t</TooltipPrimitive.Popup>\n\t\t\t</TooltipPrimitive.Positioner>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/utils';\n\nconst buttonVariants = cva(\n\t\"[&_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\",\n\t{\n\t\tdefaultVariants: {\n\t\t\tsize: 'default',\n\t\t\tvariant: 'default',\n\t\t},\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tdefault: 'h-9 px-[calc(--spacing(3)-1px)] sm:h-8',\n\t\t\t\ticon: 'size-9 sm:size-8',\n\t\t\t\t'icon-lg': 'size-10 sm:size-9',\n\t\t\t\t'icon-sm': 'size-8 sm:size-7',\n\t\t\t\t'icon-xl': 'size-11 sm:size-10 [&_svg:not([class*=\"size-\"])]:size-5 sm:[&_svg:not([class*=\"size-\"])]:size-4.5',\n\t\t\t\t'icon-xs':\n\t\t\t\t\t'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',\n\t\t\t\tlg: 'h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9',\n\t\t\t\tsm: 'h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7',\n\t\t\t\txl: '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',\n\t\t\t\txs: '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',\n\t\t\t},\n\t\t\tvariant: {\n\t\t\t\tdefault:\n\t\t\t\t\t'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',\n\t\t\t\tdestructive:\n\t\t\t\t\t'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',\n\t\t\t\t'destructive-outline':\n\t\t\t\t\t'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',\n\t\t\t\tghost: 'border-transparent hover:bg-accent data-pressed:bg-accent',\n\t\t\t\tlink: 'border-transparent underline-offset-4 hover:underline',\n\t\t\t\toutline:\n\t\t\t\t\t'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',\n\t\t\t\tsecondary:\n\t\t\t\t\t'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80',\n\t\t\t},\n\t\t},\n\t},\n);\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tvariant?: VariantProps<typeof buttonVariants>['variant'];\n\tsize?: VariantProps<typeof buttonVariants>['size'];\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n\t({ className, variant, size, asChild, children, type = 'button', ...props }, ref) => {\n\t\tconst buttonClasses = cn(buttonVariants({ className, size, variant }));\n\n\t\t// If asChild, render children with merged props (for wrapping Links, etc.)\n\t\tif (asChild && React.isValidElement(children)) {\n\t\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t\treturn React.cloneElement(children as React.ReactElement<Record<string, unknown>>, {\n\t\t\t\t...props,\n\t\t\t\tclassName: cn(buttonClasses, childProps.className as string | undefined),\n\t\t\t\t'data-slot': 'button',\n\t\t\t});\n\t\t}\n\n\t\treturn (\n\t\t\t<button ref={ref} type={type} className={buttonClasses} data-slot=\"button\" {...props}>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t},\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\nexport type { ButtonProps };\n","'use client';\n\nimport { useCallback } from 'react';\nimport { Panel, useReactFlow, type PanelPosition, type FitViewOptions } from '@xyflow/react';\nimport { RiAddLine, RiFocus3Line, RiSubtractLine } from '@remixicon/react';\n\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\ninterface FlowZoomPanelProps {\n className?: string;\n position?: PanelPosition;\n fitViewIcon?: React.ReactNode;\n fitViewOptions?: FitViewOptions;\n}\n\nconst BUTTON_CLASS =\n 'text-muted-foreground/80 hover:text-muted-foreground bg-card size-10 rounded-none shadow-none first:rounded-s-lg last:rounded-e-lg focus-visible:z-10';\n\nexport function FlowZoomPanel({\n className,\n position = 'bottom-right',\n fitViewIcon = <RiFocus3Line className='size-5' aria-hidden='true' />,\n fitViewOptions,\n}: FlowZoomPanelProps) {\n const { zoomIn, zoomOut, fitView } = useReactFlow();\n\n const onFitView = useCallback(() => {\n fitView(fitViewOptions);\n }, [fitView, fitViewOptions]);\n\n return (\n <Panel\n data-slot='flow-zoom-panel'\n position={position}\n className={cn('inline-flex -space-x-px rounded-md shadow-xs rtl:space-x-reverse', className)}\n >\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={() => zoomIn()} aria-label='Zoom in'>\n <RiAddLine className='size-5' aria-hidden='true' />\n </Button>\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={() => zoomOut()} aria-label='Zoom out'>\n <RiSubtractLine className='size-5' aria-hidden='true' />\n </Button>\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={onFitView} aria-label='Fit view'>\n {fitViewIcon}\n </Button>\n </Panel>\n );\n}\n","import type { Edge } from '@xyflow/react';\nimport type { OrgChartEdge, OrgChartNode } from './org-chart.types';\n\nexport const NODE_WIDTH = 260;\nexport const NODE_HEIGHT = 100;\nconst RANK_SEP = 80;\nconst NODE_SEP = 40;\nconst ROOT_KEY = '__root__';\n\nexport interface LayoutResult {\n\tnodes: OrgChartNode[];\n\tedges: Edge[];\n}\n\nexport function computeLayout(edges: OrgChartEdge[]): LayoutResult {\n\t// Single pass builds edgeById, childCountMap, and childrenMap.\n\tconst edgeById = new Map<string, OrgChartEdge>();\n\tconst childCountMap = new Map<string, number>();\n\tconst childrenMap = new Map<string, string[]>();\n\tfor (const e of edges) {\n\t\tedgeById.set(e.id, e);\n\t\tif (e.parentId) {\n\t\t\tchildCountMap.set(e.parentId, (childCountMap.get(e.parentId) ?? 0) + 1);\n\t\t}\n\t\tconst parent = e.parentId ?? ROOT_KEY;\n\t\tconst bucket = childrenMap.get(parent);\n\t\tif (bucket) bucket.push(e.id);\n\t\telse childrenMap.set(parent, [e.id]);\n\t}\n\tfor (const children of childrenMap.values()) {\n\t\tchildren.sort((a, b) => {\n\t\t\tconst nameA = edgeById.get(a)?.displayName?.toLowerCase() ?? '';\n\t\t\tconst nameB = edgeById.get(b)?.displayName?.toLowerCase() ?? '';\n\t\t\treturn nameA.localeCompare(nameB);\n\t\t});\n\t}\n\n\tconst widthCache = new Map<string, number>();\n\tconst subtreeWidth = (nodeId: string): number => {\n\t\tif (widthCache.has(nodeId)) return widthCache.get(nodeId)!;\n\t\tconst children = childrenMap.get(nodeId);\n\t\tif (!children || children.length === 0) {\n\t\t\twidthCache.set(nodeId, NODE_WIDTH);\n\t\t\treturn NODE_WIDTH;\n\t\t}\n\t\tconst totalChildWidth = children.reduce((sum, c) => sum + subtreeWidth(c), 0);\n\t\tconst gaps = (children.length - 1) * NODE_SEP;\n\t\tconst w = Math.max(NODE_WIDTH, totalChildWidth + gaps);\n\t\twidthCache.set(nodeId, w);\n\t\treturn w;\n\t};\n\n\tconst positions = new Map<string, { x: number; y: number }>();\n\n\tconst positionSubtree = (nodeId: string, centerX: number, y: number) => {\n\t\tpositions.set(nodeId, { x: centerX, y });\n\t\tconst children = childrenMap.get(nodeId);\n\t\tif (!children || children.length === 0) return;\n\n\t\tconst totalWidth = children.reduce((sum, c) => sum + subtreeWidth(c), 0) + (children.length - 1) * NODE_SEP;\n\t\tlet currentX = centerX - totalWidth / 2;\n\n\t\tfor (const childId of children) {\n\t\t\tconst childW = subtreeWidth(childId);\n\t\t\tpositionSubtree(childId, currentX + childW / 2, y + NODE_HEIGHT + RANK_SEP);\n\t\t\tcurrentX += childW + NODE_SEP;\n\t\t}\n\t};\n\n\tconst roots = childrenMap.get(ROOT_KEY) ?? [];\n\tif (roots.length === 1) {\n\t\tpositionSubtree(roots[0], 0, 0);\n\t} else {\n\t\tconst totalWidth = roots.reduce((sum, r) => sum + subtreeWidth(r), 0) + (roots.length - 1) * NODE_SEP;\n\t\tlet currentX = -totalWidth / 2;\n\t\tfor (const rootId of roots) {\n\t\t\tconst w = subtreeWidth(rootId);\n\t\t\tpositionSubtree(rootId, currentX + w / 2, 0);\n\t\t\tcurrentX += w + NODE_SEP;\n\t\t}\n\t}\n\n\tconst nodes: OrgChartNode[] = edges.map((e) => {\n\t\tconst pos = positions.get(e.id)!;\n\t\treturn {\n\t\t\tid: e.id,\n\t\t\ttype: 'orgChartNode' as const,\n\t\t\twidth: NODE_WIDTH,\n\t\t\theight: NODE_HEIGHT,\n\t\t\tposition: {\n\t\t\t\tx: pos.x - NODE_WIDTH / 2,\n\t\t\t\ty: pos.y,\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tid: e.id,\n\t\t\t\tdisplayName: e.displayName,\n\t\t\t\tavatarUrl: e.avatarUrl,\n\t\t\t\tpositionTitle: e.positionTitle,\n\t\t\t\tparentId: e.parentId,\n\t\t\t\tchildCount: childCountMap.get(e.id) ?? 0,\n\t\t\t\tisRoot: !e.parentId,\n\t\t\t},\n\t\t};\n\t});\n\n\tconst flowEdges: Edge[] = edges\n\t\t.filter((e) => e.parentId)\n\t\t.map((e) => ({\n\t\t\tid: `edge-${e.parentId}-${e.id}`,\n\t\t\tsource: e.parentId!,\n\t\t\ttarget: e.id,\n\t\t\ttype: 'orgChartEdge',\n\t\t}));\n\n\treturn { nodes, edges: flowEdges };\n}\n","'use client';\n\nimport { createContext, useCallback, useContext, useMemo, useState, type ReactNode } from 'react';\n\nimport type { OrgChartNodeData } from './org-chart.types';\n\nexport interface OrgChartContextValue {\n\tselectedNodeId: string | null;\n\tselectNode: (nodeId: string | null) => void;\n\tclearSelection: () => void;\n\teditable: boolean;\n\tdraggedNodeId: string | null;\n\tsetDraggedNodeId: (id: string | null) => void;\n\tdropTargetNodeId: string | null;\n\tsetDropTargetNodeId: (id: string | null) => void;\n}\n\n// Separate context for node action callbacks (provided by the inner component which has access to mutations)\nexport interface NodeActionsValue {\n\tonEditNode: (data: OrgChartNodeData) => void;\n\tonRemoveNode: (data: OrgChartNodeData) => void;\n}\n\nconst NodeActionsContext = createContext<NodeActionsValue | null>(null);\n\nconst OrgChartContext = createContext<OrgChartContextValue | null>(null);\n\ninterface OrgChartProviderProps {\n\tchildren: ReactNode;\n\teditable: boolean;\n}\n\nexport function OrgChartProvider({ children, editable }: OrgChartProviderProps) {\n\tconst [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);\n\tconst [draggedNodeId, setDraggedNodeId] = useState<string | null>(null);\n\tconst [dropTargetNodeId, setDropTargetNodeId] = useState<string | null>(null);\n\n\tconst selectNode = useCallback((nodeId: string | null) => setSelectedNodeId(nodeId), []);\n\tconst clearSelection = useCallback(() => setSelectedNodeId(null), []);\n\n\tconst value = useMemo<OrgChartContextValue>(\n\t\t() => ({\n\t\t\tselectedNodeId,\n\t\t\tselectNode,\n\t\t\tclearSelection,\n\t\t\teditable,\n\t\t\tdraggedNodeId,\n\t\t\tsetDraggedNodeId,\n\t\t\tdropTargetNodeId,\n\t\t\tsetDropTargetNodeId,\n\t\t}),\n\t\t[selectedNodeId, selectNode, clearSelection, editable, draggedNodeId, dropTargetNodeId],\n\t);\n\n\treturn <OrgChartContext.Provider value={value}>{children}</OrgChartContext.Provider>;\n}\n\nexport function useOrgChartContext() {\n\tconst ctx = useContext(OrgChartContext);\n\tif (!ctx) throw new Error('useOrgChartContext must be used within OrgChartProvider');\n\treturn ctx;\n}\n\nexport function NodeActionsProvider({\n\tchildren,\n\tonEditNode,\n\tonRemoveNode,\n}: NodeActionsValue & { children: ReactNode }) {\n\tconst value = useMemo(() => ({ onEditNode, onRemoveNode }), [onEditNode, onRemoveNode]);\n\treturn <NodeActionsContext.Provider value={value}>{children}</NodeActionsContext.Provider>;\n}\n\nexport function useNodeActions() {\n\tconst ctx = useContext(NodeActionsContext);\n\tif (!ctx) throw new Error('useNodeActions must be used within NodeActionsProvider');\n\treturn ctx;\n}\n","import { BaseEdge, getSmoothStepPath, type EdgeProps } from '@xyflow/react';\n\nexport function OrgChartEdge({\n\tsourceX,\n\tsourceY,\n\ttargetX,\n\ttargetY,\n\tsourcePosition,\n\ttargetPosition,\n\tstyle = {},\n}: EdgeProps) {\n\tconst [edgePath] = getSmoothStepPath({\n\t\tsourceX,\n\t\tsourceY,\n\t\tsourcePosition,\n\t\ttargetX,\n\t\ttargetY,\n\t\ttargetPosition,\n\t\tborderRadius: 12,\n\t});\n\n\treturn <BaseEdge path={edgePath} style={style} />;\n}\n","import { Network, UserPlus } from 'lucide-react';\nimport { Button } from '../button';\n\ninterface OrgChartEmptyProps {\n\teditable: boolean;\n\tonAddRoot: () => void;\n}\n\nexport function OrgChartEmpty({ editable, onAddRoot }: OrgChartEmptyProps) {\n\treturn (\n\t\t<div className='bg-card border-border/60 flex flex-col items-center justify-center rounded-xl border py-16'>\n\t\t\t<div className='bg-muted mb-4 flex size-14 items-center justify-center rounded-2xl'>\n\t\t\t\t<Network className='text-muted-foreground size-7' />\n\t\t\t</div>\n\t\t\t<h3 className='text-foreground text-base font-semibold'>No Org Chart Yet</h3>\n\t\t\t<p className='text-muted-foreground mt-1.5 max-w-sm text-center text-sm'>\n\t\t\t\tBuild your organization hierarchy by adding the first person.\n\t\t\t</p>\n\t\t\t{editable && (\n\t\t\t\t<Button className='mt-5 gap-1.5' onClick={onAddRoot}>\n\t\t\t\t\t<UserPlus className='size-3.5' />\n\t\t\t\t\tAdd First Member\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';\n\nimport { cn } from '../lib/utils';\n\nfunction Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n\treturn (\n\t\t<AvatarPrimitive.Root\n\t\t\tdata-slot=\"avatar\"\n\t\t\tclassName={cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n\treturn (\n\t\t<AvatarPrimitive.Image data-slot=\"avatar-image\" className={cn('aspect-square size-full', className)} {...props} />\n\t);\n}\n\ntype AvatarFallbackProps = React.ComponentProps<typeof AvatarPrimitive.Fallback> & {\n\t/** @deprecated Use delay prop instead */\n\tdelayMs?: number;\n};\n\nfunction AvatarFallback({ className, delayMs, delay, ...props }: AvatarFallbackProps) {\n\treturn (\n\t\t<AvatarPrimitive.Fallback\n\t\t\tdata-slot=\"avatar-fallback\"\n\t\t\tdelay={delay ?? delayMs}\n\t\t\tclassName={cn('bg-secondary flex size-full items-center justify-center rounded-[inherit] text-xs', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Avatar, AvatarFallback, AvatarImage };\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/utils';\n\nconst badgeVariants = cva(\n\t\"relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow 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 [&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button,a&]:cursor-pointer [button,a&]:pointer-coarse:after:absolute [button,a&]:pointer-coarse:after:size-full [button,a&]:pointer-coarse:after:min-h-11 [button,a&]:pointer-coarse:after:min-w-11\",\n\t{\n\t\tdefaultVariants: {\n\t\t\tsize: 'default',\n\t\t\tvariant: 'default',\n\t\t},\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tdefault: 'px-[calc(--spacing(1)-1px)] text-xs',\n\t\t\t\tlg: 'px-[calc(--spacing(1.5)-1px)] text-sm',\n\t\t\t\tsm: 'rounded-[calc(var(--radius-sm)-2px)] px-[calc(--spacing(1)-1px)] text-[.625rem]',\n\t\t\t},\n\t\t\tvariant: {\n\t\t\t\tdefault: 'bg-primary text-primary-foreground [button,a&]:hover:bg-primary/90',\n\t\t\t\tdestructive: 'bg-destructive text-white [button,a&]:hover:bg-destructive/90',\n\t\t\t\terror: 'bg-destructive/8 text-destructive dark:bg-destructive/16',\n\t\t\t\tinfo: 'bg-info/8 text-info-foreground dark:bg-info/16',\n\t\t\t\toutline:\n\t\t\t\t\t'border-border/60 bg-transparent dark:bg-input/32 [button,a&]:hover:bg-accent/50 dark:[button,a&]:hover:bg-input/48',\n\t\t\t\tsecondary: 'bg-secondary text-secondary-foreground [button,a&]:hover:bg-secondary/90',\n\t\t\t\tsuccess: 'bg-success/8 text-success-foreground dark:bg-success/16',\n\t\t\t\twarning: 'bg-warning/8 text-warning-foreground dark:bg-warning/16',\n\t\t\t},\n\t\t},\n\t},\n);\n\ntype BadgeProps = React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof badgeVariants>;\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(({ className, variant, size, ...props }, ref) => (\n\t<span ref={ref} data-slot=\"badge\" className={cn(badgeVariants({ variant, size }), className)} {...props} />\n));\n\nBadge.displayName = 'Badge';\n\nexport { Badge, badgeVariants };\nexport type { BadgeProps };\n","'use client';\n\nimport * as React from 'react';\nimport { Menu as MenuPrimitive } from '@base-ui/react/menu';\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { useFloatingOverlayPortalProps } from './portal';\nimport { mergePropsWithRef } from '../lib/slot';\nimport { cn } from '../lib/utils';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof MenuPrimitive.Root>) {\n\treturn <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof MenuPrimitive.Portal>) {\n\tconst { container } = useFloatingOverlayPortalProps();\n\treturn <MenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" container={container} {...props} />;\n}\n\ntype DropdownMenuTriggerProps = Omit<React.ComponentProps<typeof MenuPrimitive.Trigger>, 'render' | 'nativeButton'> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n\t/** Whether the child renders a native button. Defaults to true when asChild is used. */\n\tnativeButton?: boolean;\n};\n\nfunction DropdownMenuTrigger({ asChild, nativeButton, children, ...props }: DropdownMenuTriggerProps) {\n\tif (asChild && React.isValidElement(children)) {\n\t\treturn (\n\t\t\t<MenuPrimitive.Trigger\n\t\t\t\tdata-slot=\"dropdown-menu-trigger\"\n\t\t\t\tnativeButton={nativeButton ?? true}\n\t\t\t\t{...props}\n\t\t\trender={(triggerProps) => {\n\t\t\t\tconst { nativeButton: _, ...rest } = triggerProps as Record<string, unknown>;\n\t\t\t\treturn React.cloneElement(\n\t\t\t\t\tchildren as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\tmergePropsWithRef(rest, children as React.ReactElement),\n\t\t\t\t);\n\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<MenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" nativeButton={nativeButton} {...props}>\n\t\t\t{children}\n\t\t</MenuPrimitive.Trigger>\n\t);\n}\n\ntype DropdownMenuContentProps = React.ComponentProps<typeof MenuPrimitive.Popup> & {\n\tsideOffset?: number;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\talign?: 'start' | 'center' | 'end';\n\t/** @deprecated Not supported in Base UI */\n\tonPointerDown?: (e: React.PointerEvent) => void;\n\t/** @deprecated Not supported in Base UI */\n\tonPointerDownOutside?: (e: Event) => void;\n\t/** @deprecated Not supported in Base UI */\n\tonCloseAutoFocus?: (e: Event) => void;\n\t/** @deprecated Base UI menus mount on open automatically */\n\tforceMount?: boolean;\n};\n\nfunction DropdownMenuContent({\n\tclassName,\n\tsideOffset = 4,\n\tside = 'bottom',\n\talign = 'start',\n\tonPointerDown: _onPointerDown,\n\tonPointerDownOutside: _onPointerDownOutside,\n\tonCloseAutoFocus: _onCloseAutoFocus,\n\tforceMount: _forceMount,\n\t...props\n}: DropdownMenuContentProps) {\n\tconst { zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<DropdownMenuPortal>\n\t\t\t<MenuPrimitive.Positioner side={side} align={align} sideOffset={sideOffset} className={zIndexClass}>\n\t\t\t\t<MenuPrimitive.Popup\n\t\t\t\t\tdata-slot=\"dropdown-menu-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out\n\t\t\t\t\t\tdata-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95\n\t\t\t\t\t\tdata-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\n\t\t\t\t\t\tdata-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 min-w-40 overflow-hidden\n\t\t\t\t\t\trounded-md border p-1 shadow-lg`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</MenuPrimitive.Positioner>\n\t\t</DropdownMenuPortal>\n\t);\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof MenuPrimitive.Group>) {\n\treturn <MenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\ntype DropdownMenuItemProps = Omit<React.ComponentProps<typeof MenuPrimitive.Item>, 'render'> & {\n\tinset?: boolean;\n\tvariant?: 'default' | 'destructive';\n\t/** When true, merges props onto the child element instead of rendering a div */\n\tasChild?: boolean;\n};\n\nfunction DropdownMenuItem({\n\tclassName,\n\tinset,\n\tvariant = 'default',\n\tasChild,\n\tchildren,\n\tonClick,\n\t...props\n}: DropdownMenuItemProps) {\n\tconst itemClassName = cn(\n\t\t`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive\n\t\tdata-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/40\n\t\tdata-[variant=destructive]:data-[highlighted]:text-destructive\n\t\tdata-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default items-center gap-2\n\t\trounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none\n\t\tdata-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,\n\t\tclassName,\n\t);\n\n\t// Use render prop for both cases to ensure onClick is properly handled\n\t// Base UI Menu.Item may not forward onClick to the element directly\n\tif (asChild && React.isValidElement(children)) {\n\t\treturn (\n\t\t\t<MenuPrimitive.Item\n\t\t\t\tdata-slot=\"dropdown-menu-item\"\n\t\t\t\tdata-inset={inset}\n\t\t\t\tdata-variant={variant}\n\t\t\t\t{...props}\n\t\t\t\trender={(itemProps) => {\n\t\t\t\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t\t\t\tconst itemOnClick = itemProps.onClick as React.MouseEventHandler<HTMLElement> | undefined;\n\t\t\t\t\treturn React.cloneElement(children as React.ReactElement<Record<string, unknown>>, {\n\t\t\t\t\t\t...itemProps,\n\t\t\t\t\t\tclassName: cn(itemClassName, childProps.className as string | undefined),\n\t\t\t\t\t\tonClick: (e: React.MouseEvent<HTMLElement>) => {\n\t\t\t\t\t\t\tonClick?.(e);\n\t\t\t\t\t\t\titemOnClick?.(e);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<MenuPrimitive.Item\n\t\t\tdata-slot=\"dropdown-menu-item\"\n\t\t\tdata-inset={inset}\n\t\t\tdata-variant={variant}\n\t\t\t{...props}\n\t\t\trender={(itemProps) => {\n\t\t\t\tconst itemOnClick = itemProps.onClick as React.MouseEventHandler<HTMLDivElement> | undefined;\n\t\t\t\treturn (\n\t\t\t\t\t<div\n\t\t\t\t\t\t{...itemProps}\n\t\t\t\t\t\tclassName={cn(itemClassName, itemProps.className)}\n\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\tonClick?.(e);\n\t\t\t\t\t\t\titemOnClick?.(e);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuCheckboxItem({\n\tclassName,\n\tchildren,\n\tchecked,\n\t...props\n}: React.ComponentProps<typeof MenuPrimitive.CheckboxItem>) {\n\treturn (\n\t\t<MenuPrimitive.CheckboxItem\n\t\t\tdata-slot=\"dropdown-menu-checkbox-item\"\n\t\t\tclassName={cn(\n\t\t\t\t`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5\n\t\t\t\tpr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50\n\t\t\t\t[&_svg]:pointer-events-none [&_svg]:shrink-0`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tchecked={checked}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className='pointer-events-none absolute left-2 flex size-3.5 items-center justify-center'>\n\t\t\t\t<MenuPrimitive.CheckboxItemIndicator>\n\t\t\t\t\t<CheckIcon size={16} />\n\t\t\t\t</MenuPrimitive.CheckboxItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</MenuPrimitive.CheckboxItem>\n\t);\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof MenuPrimitive.RadioGroup>) {\n\treturn <MenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n\tclassName,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof MenuPrimitive.RadioItem>) {\n\treturn (\n\t\t<MenuPrimitive.RadioItem\n\t\t\tdata-slot=\"dropdown-menu-radio-item\"\n\t\t\tclassName={cn(\n\t\t\t\t`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5\n\t\t\t\tpr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50\n\t\t\t\t[&_svg]:pointer-events-none [&_svg]:shrink-0`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className='pointer-events-none absolute left-2 flex size-3.5 items-center justify-center'>\n\t\t\t\t<MenuPrimitive.RadioItemIndicator>\n\t\t\t\t\t<CircleIcon className='size-2 fill-current' />\n\t\t\t\t</MenuPrimitive.RadioItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</MenuPrimitive.RadioItem>\n\t);\n}\n\nfunction DropdownMenuLabel({\n\tclassName,\n\tinset,\n\t...props\n}: React.ComponentProps<typeof MenuPrimitive.GroupLabel> & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<MenuPrimitive.GroupLabel\n\t\t\tdata-slot=\"dropdown-menu-label\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn('text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof MenuPrimitive.Separator>) {\n\treturn (\n\t\t<MenuPrimitive.Separator\n\t\t\tdata-slot=\"dropdown-menu-separator\"\n\t\t\tclassName={cn('bg-border -mx-1 my-1 h-px', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n\treturn (\n\t\t<kbd\n\t\t\tdata-slot=\"dropdown-menu-shortcut\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-background text-muted-foreground/70 ms-auto -me-1 inline-flex h-5 max-h-full items-center rounded border\n\t\t\t\tpx-1 font-[inherit] text-[0.625rem] font-medium`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof MenuPrimitive.SubmenuRoot>) {\n\treturn <MenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n\tclassName,\n\tinset,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof MenuPrimitive.SubmenuTrigger> & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<MenuPrimitive.SubmenuTrigger\n\t\t\tdata-slot=\"dropdown-menu-sub-trigger\"\n\t\t\tdata-inset={inset}\n\t\t\tclassName={cn(\n\t\t\t\t`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[popup-open]:bg-accent\n\t\t\t\tdata-[popup-open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm\n\t\t\t\toutline-hidden select-none data-[inset]:pl-8`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ChevronRightIcon size={16} className='text-muted-foreground/80 ml-auto' />\n\t\t</MenuPrimitive.SubmenuTrigger>\n\t);\n}\n\nfunction DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof MenuPrimitive.Popup>) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<MenuPrimitive.Portal container={container}>\n\t\t\t<MenuPrimitive.Positioner side='right' sideOffset={-4} className={zIndexClass}>\n\t\t\t\t<MenuPrimitive.Popup\n\t\t\t\t\tdata-slot=\"dropdown-menu-sub-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out\n\t\t\t\t\t\tdata-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95\n\t\t\t\t\t\tdata-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\n\t\t\t\t\t\tdata-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 min-w-40 overflow-hidden\n\t\t\t\t\t\trounded-md border p-1 shadow-lg`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</MenuPrimitive.Positioner>\n\t\t</MenuPrimitive.Portal>\n\t);\n}\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuContent,\n\tDropdownMenuGroup,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuPortal,\n\tDropdownMenuRadioGroup,\n\tDropdownMenuRadioItem,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\tDropdownMenuSub,\n\tDropdownMenuSubContent,\n\tDropdownMenuSubTrigger,\n\tDropdownMenuTrigger,\n};\n","/** Get up to 2-char uppercase initials from a display name */\nexport function getInitials(name: string | null): string {\n\tif (!name) return '--';\n\tconst parts = name.trim().split(/\\s+/).filter(Boolean);\n\tif (parts.length === 0) return '--';\n\tif (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();\n\treturn (parts[0][0] + parts[1][0]).toUpperCase();\n}\n","'use client';\n\nimport { memo, useState } from 'react';\nimport { Handle, Position, type NodeProps } from '@xyflow/react';\nimport { Ellipsis, Pencil, Trash2 } from 'lucide-react';\n\nimport { cn } from '../../lib/utils';\nimport { Avatar, AvatarFallback, AvatarImage } from '../avatar';\nimport { Badge } from '../badge';\nimport { Button } from '../button';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '../dropdown-menu';\n\nimport { NODE_WIDTH } from './layout';\nimport { useNodeActions, useOrgChartContext } from './org-chart-context';\nimport { getInitials } from './org-chart-utils';\nimport type { OrgChartNode } from './org-chart.types';\n\nfunction OrgChartNodeComponent({ id, data }: NodeProps<OrgChartNode>) {\n\tconst { selectedNodeId, dropTargetNodeId, editable } = useOrgChartContext();\n\tconst { onEditNode, onRemoveNode } = useNodeActions();\n\tconst isSelected = selectedNodeId === id;\n\tconst isDropTarget = dropTargetNodeId === id;\n\tconst [isHovered, setIsHovered] = useState(false);\n\tconst [isMenuOpen, setIsMenuOpen] = useState(false);\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{ width: NODE_WIDTH }}\n\t\t\tclassName={cn(\n\t\t\t\t'bg-card dark:bg-muted relative rounded-xl border shadow-sm transition-all',\n\t\t\t\t'border-border/60',\n\t\t\t\tisSelected && 'ring-primary ring-2 ring-offset-2 dark:ring-offset-zinc-900',\n\t\t\t\tisDropTarget && 'ring-primary/50 border-primary scale-105 ring-2',\n\t\t\t)}\n\t\t\tonMouseEnter={() => setIsHovered(true)}\n\t\t\tonMouseLeave={() => setIsHovered(false)}\n\t\t>\n\t\t\t{!data.isRoot && (\n\t\t\t\t<Handle type='target' position={Position.Top} className='!bg-border !size-2 !rounded-full !border-0' />\n\t\t\t)}\n\n\t\t\t<div className='flex items-center gap-3 px-4 py-3'>\n\t\t\t\t<Avatar className='size-10 shrink-0'>\n\t\t\t\t\t{data.avatarUrl && (\n\t\t\t\t\t\t<AvatarImage src={data.avatarUrl} alt={data.displayName ?? ''} />\n\t\t\t\t\t)}\n\t\t\t\t\t<AvatarFallback className='bg-primary/10 text-primary text-xs font-medium'>\n\t\t\t\t\t\t{getInitials(data.displayName)}\n\t\t\t\t\t</AvatarFallback>\n\t\t\t\t</Avatar>\n\t\t\t\t<div className='min-w-0 flex-1'>\n\t\t\t\t\t<p className='text-foreground truncate text-sm font-semibold'>{data.displayName ?? 'Unknown'}</p>\n\t\t\t\t\t{data.positionTitle && <p className='text-muted-foreground truncate text-xs'>{data.positionTitle}</p>}\n\t\t\t\t</div>\n\t\t\t\t{editable && (isHovered || isMenuOpen) ? (\n\t\t\t\t\t<div className='nodrag nopan shrink-0'>\n\t\t\t\t\t\t<DropdownMenu open={isMenuOpen} onOpenChange={setIsMenuOpen}>\n\t\t\t\t\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant='ghost'\n\t\t\t\t\t\t\t\t\tsize='icon'\n\t\t\t\t\t\t\t\t\tclassName='size-7 rounded-full'\n\t\t\t\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Ellipsis className='size-4' />\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t\t\t\t<DropdownMenuContent align='start' side='right' className='translate-x-1 -translate-y-3.5'>\n\t\t\t\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t\t\tsetIsMenuOpen(false);\n\t\t\t\t\t\t\t\t\t\tonEditNode(data);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Pencil className='mr-2 size-3.5' />\n\t\t\t\t\t\t\t\t\tEdit Position\n\t\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t\t\t<DropdownMenuSeparator />\n\t\t\t\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\t\t\t\tclassName='text-destructive hover:bg-destructive/10 focus:bg-destructive/10 hover:text-destructive\n\t\t\t\t\t\t\t\t\t\tfocus:text-destructive data-[highlighted]:bg-destructive/10 data-[highlighted]:text-destructive'\n\t\t\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t\t\tsetIsMenuOpen(false);\n\t\t\t\t\t\t\t\t\t\tonRemoveNode(data);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Trash2 className='mr-2 size-3.5' />\n\t\t\t\t\t\t\t\t\tRemove from Chart\n\t\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t\t</DropdownMenuContent>\n\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\tdata.childCount > 0 && (\n\t\t\t\t\t\t<Badge variant='secondary' className='shrink-0 text-[10px]'>\n\t\t\t\t\t\t\t{data.childCount}\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t<Handle type='source' position={Position.Bottom} className='!bg-border !size-2 !rounded-full !border-0' />\n\t\t</div>\n\t);\n}\n\nexport const OrgChartNodeMemo = memo(OrgChartNodeComponent);\n","'use client';\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n\tBackground,\n\tBackgroundVariant,\n\tReactFlow,\n\tReactFlowProvider,\n\tuseEdgesState,\n\tuseNodesState,\n\tuseReactFlow,\n\ttype Edge,\n\ttype EdgeTypes,\n\ttype Node,\n\ttype NodeTypes,\n} from '@xyflow/react';\n\nimport '@xyflow/react/dist/style.css';\n\nimport { Loader2 } from 'lucide-react';\n\nimport { cn } from '../../lib/utils';\nimport { TooltipProvider } from '../tooltip';\nimport { FlowZoomPanel } from '../flow-zoom-panel';\n\nimport { computeLayout } from './layout';\nimport { NodeActionsProvider, OrgChartProvider, useOrgChartContext } from './org-chart-context';\nimport { OrgChartEdge as OrgChartEdgeComponent } from './org-chart-edge';\nimport { OrgChartEmpty } from './org-chart-empty';\nimport { OrgChartNodeMemo } from './org-chart-node';\nimport type { OrgChartEdge, OrgChartNodeData, OrgChartNode as OrgChartNodeType } from './org-chart.types';\n\nconst FIT_VIEW_OPTIONS = { padding: 0.12 } as const;\n\n/** Walk parent→child graph to collect all descendant IDs (cycle-check on drag drop). */\nfunction getDescendantIds(nodeId: string, nodes: { id: string; data: { parentId: string | null } }[]): Set<string> {\n\tconst descendants = new Set<string>();\n\tconst queue = [nodeId];\n\twhile (queue.length > 0) {\n\t\tconst current = queue.pop()!;\n\t\tfor (const n of nodes) {\n\t\t\tif (n.data.parentId === current && !descendants.has(n.id)) {\n\t\t\t\tdescendants.add(n.id);\n\t\t\t\tqueue.push(n.id);\n\t\t\t}\n\t\t}\n\t}\n\treturn descendants;\n}\n\n/** Merge layout nodes into RF state, preserving measured dimensions from previous nodes. */\nfunction mergeWithMeasured(prev: OrgChartNodeType[], layoutNodes: OrgChartNodeType[]): OrgChartNodeType[] {\n\tconst prevMap = new Map(prev.map((n) => [n.id, n]));\n\treturn layoutNodes.map((n) => {\n\t\tconst existing = prevMap.get(n.id);\n\t\tif (!existing) return n;\n\t\treturn existing.data.isRoot !== n.data.isRoot ? n : { ...n, measured: existing.measured };\n\t});\n}\n\ninterface OrgChartPropsBase {\n\t/** Additional classes for the chart container (e.g. `\"h-full\"` to fill parent). Default height: 600px. */\n\tclassName?: string;\n\t/** Whether data is still loading */\n\tisLoading?: boolean;\n\t/** Whether the current user can manage the chart (drag, edit, remove) */\n\teditable?: boolean;\n\t/** Called when a node is dragged onto a new parent. In uncontrolled mode, the component updates visually first — if this throws, it reverts. */\n\tonReparent?: (childId: string, newParentId: string, preserve: { positionTitle?: string | null }) => void | Promise<void>;\n\t/** Called when the \"Add to Chart\" button is clicked (empty state) */\n\tonAddToChart?: () => void;\n\t/** Called when \"Edit Position\" is selected from the node menu */\n\tonEditNode?: (nodeData: OrgChartNodeData) => void;\n\t/** Called when \"Remove from Chart\" is selected from the node menu */\n\tonRemoveNode?: (nodeData: OrgChartNodeData) => void;\n\t/** Toast handler for reparent success/error messages. If not provided, no toasts are shown. */\n\tonReparentSuccess?: (childName: string, parentName: string) => void;\n\tonReparentError?: (message: string) => void;\n}\n\n/** Controlled mode — consumer owns edge state */\ninterface OrgChartControlledProps extends OrgChartPropsBase {\n\tedges: OrgChartEdge[];\n\tdefaultEdges?: never;\n}\n\n/** Uncontrolled mode — component manages edge state internally with optimistic reparent */\ninterface OrgChartUncontrolledProps extends OrgChartPropsBase {\n\tedges?: never;\n\tdefaultEdges: OrgChartEdge[];\n}\n\nexport type OrgChartProps = OrgChartControlledProps | OrgChartUncontrolledProps;\n\nfunction OrgChartInner({\n\tclassName,\n\tedges: controlledEdges,\n\tdefaultEdges,\n\tisLoading = false,\n\teditable = true,\n\tonReparent,\n\tonAddToChart,\n\tonEditNode,\n\tonRemoveNode,\n\tonReparentSuccess,\n\tonReparentError,\n}: OrgChartProps) {\n\tconst isControlled = controlledEdges !== undefined;\n\tconst {\n\t\tselectNode,\n\t\tclearSelection,\n\t\tsetDraggedNodeId,\n\t\tsetDropTargetNodeId,\n\t} = useOrgChartContext();\n\n\tconst [internalEdges, setInternalEdges] = useState<OrgChartEdge[]>(defaultEdges ?? []);\n\n\tconst defaultEdgesHash = useMemo(\n\t\t() => defaultEdges?.map((e) => `${e.id}:${e.parentId}:${e.positionTitle ?? ''}:${e.displayName ?? ''}`).join(',') ?? '',\n\t\t[defaultEdges],\n\t);\n\tuseEffect(() => {\n\t\tif (!isControlled && defaultEdges) {\n\t\t\tsetInternalEdges(defaultEdges);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [defaultEdgesHash]);\n\n\tconst apiEdges = controlledEdges ?? internalEdges;\n\n\tconst layout = useMemo(() => (apiEdges.length > 0 ? computeLayout(apiEdges) : null), [apiEdges]);\n\tconst layoutNodes = layout?.nodes ?? [];\n\tconst layoutEdges = layout?.edges ?? [];\n\tconst isEmpty = apiEdges.length === 0 && !isLoading;\n\n\tconst { fitView, getIntersectingNodes } = useReactFlow();\n\n\tconst [nodes, setNodes, onNodesChange] = useNodesState<OrgChartNodeType>([]);\n\tconst [rfEdges, setRfEdges, onEdgesChange] = useEdgesState<Edge>([]);\n\n\tconst nodesHash = useMemo(\n\t\t() => layoutNodes.map((n) => `${n.id}:${n.data.parentId ?? ''}:${n.data.positionTitle ?? ''}:${n.data.displayName ?? ''}`).join(','),\n\t\t[layoutNodes],\n\t);\n\tconst edgesHash = useMemo(() => layoutEdges.map((e) => `${e.id}:${e.source}:${e.target}`).join(','), [layoutEdges]);\n\tconst fitViewRef = useRef(fitView);\n\tfitViewRef.current = fitView;\n\n\tuseEffect(() => {\n\t\tsetNodes((prev) => mergeWithMeasured(prev, layoutNodes));\n\t\tsetRfEdges(layoutEdges);\n\t\tconst raf = requestAnimationFrame(() => fitViewRef.current(FIT_VIEW_OPTIONS));\n\t\treturn () => cancelAnimationFrame(raf);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [nodesHash, edgesHash]);\n\n\tconst draggedNodeRef = useRef<string | null>(null);\n\tconst dropTargetIdRef = useRef<string | null>(null);\n\n\tconst nodeTypes: NodeTypes = useMemo(() => ({ orgChartNode: OrgChartNodeMemo }), []);\n\tconst edgeTypes: EdgeTypes = useMemo(() => ({ orgChartEdge: OrgChartEdgeComponent }), []);\n\n\tconst onNodeDragStart = useCallback(\n\t\t(_: React.MouseEvent, node: Node) => {\n\t\t\tif (!editable) return;\n\t\t\tdraggedNodeRef.current = node.id;\n\t\t\tsetDraggedNodeId(node.id);\n\t\t},\n\t\t[editable, setDraggedNodeId],\n\t);\n\n\tconst onNodeDrag = useCallback(\n\t\t(_: React.MouseEvent, node: Node) => {\n\t\t\tif (!editable || !draggedNodeRef.current) return;\n\t\t\tconst intersecting = getIntersectingNodes(node);\n\t\t\tconst target = intersecting.find((n) => n.id !== node.id);\n\t\t\tconst targetId = target?.id ?? null;\n\t\t\tif (targetId === dropTargetIdRef.current) return; // avoid no-op re-render cascade\n\t\t\tdropTargetIdRef.current = targetId;\n\t\t\tsetDropTargetNodeId(targetId);\n\t\t},\n\t\t[editable, getIntersectingNodes, setDropTargetNodeId],\n\t);\n\n\tconst applyOptimisticReparent = useCallback((childId: string, newParentId: string) => {\n\t\tsetInternalEdges((prev) =>\n\t\t\tprev.map((e) => (e.id === childId ? { ...e, parentId: newParentId } : e)),\n\t\t);\n\t}, []);\n\n\tconst snapBack = useCallback(() => {\n\t\tsetNodes((prev) => mergeWithMeasured(prev, layoutNodes));\n\t}, [layoutNodes, setNodes]);\n\n\tconst onNodeDragStop = useCallback(\n\t\tasync (_: React.MouseEvent, _node: Node) => {\n\t\t\tif (!editable || !draggedNodeRef.current) return;\n\t\t\tconst childId = draggedNodeRef.current;\n\t\t\tconst newParentId = dropTargetIdRef.current;\n\n\t\t\tdraggedNodeRef.current = null;\n\t\t\tdropTargetIdRef.current = null;\n\t\t\tsetDraggedNodeId(null);\n\t\t\tsetDropTargetNodeId(null);\n\n\t\t\tif (!newParentId || newParentId === childId) {\n\t\t\t\tsnapBack();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Derive descendants at drop time instead of carrying a ref through the drag\n\t\t\tif (getDescendantIds(childId, layoutNodes).has(newParentId)) {\n\t\t\t\tonReparentError?.('Cannot create circular reporting chain');\n\t\t\t\tsnapBack();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst draggedData = layoutNodes.find((n) => n.id === childId)?.data;\n\t\t\tif (!draggedData || newParentId === draggedData.parentId) {\n\t\t\t\tsnapBack();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst targetName = layoutNodes.find((n) => n.id === newParentId)?.data.displayName;\n\t\t\tconst preserve = { positionTitle: draggedData.positionTitle };\n\n\t\t\tif (!isControlled) {\n\t\t\t\t// Uncontrolled: optimistic update, then notify consumer\n\t\t\t\tconst snapshotEdges = internalEdges;\n\t\t\t\tapplyOptimisticReparent(childId, newParentId);\n\t\t\t\ttry {\n\t\t\t\t\tawait onReparent?.(childId, newParentId, preserve);\n\t\t\t\t\tonReparentSuccess?.(draggedData.displayName ?? 'Member', targetName ?? 'new manager');\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.error('[OrgChart] reparent failed', err);\n\t\t\t\t\tsetInternalEdges(snapshotEdges);\n\t\t\t\t\tonReparentError?.('Failed to update reporting line');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Controlled: snap back, let consumer update edges\n\t\t\t\tsnapBack();\n\t\t\t\ttry {\n\t\t\t\t\tawait onReparent?.(childId, newParentId, preserve);\n\t\t\t\t\tonReparentSuccess?.(draggedData.displayName ?? 'Member', targetName ?? 'new manager');\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.error('[OrgChart] reparent failed', err);\n\t\t\t\t\tonReparentError?.('Failed to update reporting line');\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[editable, isControlled, internalEdges, layoutNodes, onReparent, onReparentSuccess, onReparentError, applyOptimisticReparent, snapBack, setDraggedNodeId, setDropTargetNodeId],\n\t);\n\n\tconst onNodeClick = useCallback((_: React.MouseEvent, node: Node) => selectNode(node.id), [selectNode]);\n\tconst onPaneClick = useCallback(() => clearSelection(), [clearSelection]);\n\n\tconst handleEditNode = useCallback(\n\t\t(nodeData: OrgChartNodeData) => onEditNode?.(nodeData),\n\t\t[onEditNode],\n\t);\n\tconst handleRemoveNode = useCallback(\n\t\t(nodeData: OrgChartNodeData) => onRemoveNode?.(nodeData),\n\t\t[onRemoveNode],\n\t);\n\n\tif (isLoading) {\n\t\treturn (\n\t\t\t<div className='bg-card border-border/60 flex items-center justify-center rounded-xl border p-16'>\n\t\t\t\t<Loader2 className='text-muted-foreground size-6 animate-spin' />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (isEmpty) {\n\t\treturn <OrgChartEmpty editable={editable} onAddRoot={onAddToChart ?? (() => {})} />;\n\t}\n\n\treturn (\n\t\t<NodeActionsProvider onEditNode={handleEditNode} onRemoveNode={handleRemoveNode}>\n\t\t\t<div className={cn('border-border/60 h-[600px] overflow-hidden rounded-xl border', className)}>\n\t\t\t\t<ReactFlow\n\t\t\t\t\tnodes={nodes}\n\t\t\t\t\tedges={rfEdges}\n\t\t\t\t\tonNodesChange={onNodesChange}\n\t\t\t\t\tonEdgesChange={onEdgesChange}\n\t\t\t\t\tonNodeClick={onNodeClick}\n\t\t\t\t\tproOptions={{ hideAttribution: true }}\n\t\t\t\t\tonPaneClick={onPaneClick}\n\t\t\t\t\tonNodeDragStart={onNodeDragStart}\n\t\t\t\t\tonNodeDrag={onNodeDrag}\n\t\t\t\t\tonNodeDragStop={onNodeDragStop}\n\t\t\t\t\tnodeTypes={nodeTypes}\n\t\t\t\t\tedgeTypes={edgeTypes}\n\t\t\t\t\tfitView\n\t\t\t\t\tfitViewOptions={FIT_VIEW_OPTIONS}\n\t\t\t\t\tminZoom={0.3}\n\t\t\t\t\tmaxZoom={1.5}\n\t\t\t\t\tnodesDraggable={editable}\n\t\t\t\t\tnodesConnectable={false}\n\t\t\t\t\telementsSelectable\n\t\t\t\t\tselectNodesOnDrag={false}\n\t\t\t\t\tpanOnDrag\n\t\t\t\t\tzoomOnScroll\n\t\t\t\t\tpreventScrolling\n\t\t\t\t\tstyle={\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'--xy-background-pattern-dots-color-default': 'var(--color-border)',\n\t\t\t\t\t\t\t'--xy-edge-stroke-width-default': 2,\n\t\t\t\t\t\t\t'--xy-edge-stroke-default': 'var(--color-border)',\n\t\t\t\t\t\t\t'--xy-edge-stroke-selected-default': 'var(--color-foreground)',\n\t\t\t\t\t\t\t'--xy-attribution-background-color-default': 'transparent',\n\t\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t\t}\n\t\t\t\t\tattributionPosition='bottom-left'\n\t\t\t\t>\n\t\t\t\t\t<Background variant={BackgroundVariant.Dots} gap={20} size={2} />\n\n\t\t\t\t\t<FlowZoomPanel fitViewOptions={FIT_VIEW_OPTIONS} />\n\t\t\t\t</ReactFlow>\n\t\t\t</div>\n\t\t</NodeActionsProvider>\n\t);\n}\n\nexport function OrgChart(props: OrgChartProps) {\n\treturn (\n\t\t<ReactFlowProvider>\n\t\t\t<OrgChartProvider editable={props.editable ?? true}>\n\t\t\t\t<TooltipProvider>\n\t\t\t\t\t<OrgChartInner {...props} />\n\t\t\t\t</TooltipProvider>\n\t\t\t</OrgChartProvider>\n\t\t</ReactFlowProvider>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/use-debounce.ts","../../src/lib/utils.ts","../../src/components/checkbox.tsx","../../src/components/input.tsx","../../src/components/input-group.tsx","../../src/components/scroll-area.tsx","../../src/components/record-picker.tsx"],"names":["CheckboxPrimitive","props","jsx","InputPrimitive","React2","ScrollAreaPrimitive","useState","jsxs"],"mappings":";;;;;;;;;;;;AAQO,SAAS,WAAA,CAAe,OAAU,KAAA,EAAkB;AAC1D,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAY,KAAK,CAAA;AAE7D,EAAA,SAAA,CAAU,MAAM;AACf,IAAA,MAAM,OAAA,GAAU,WAAW,MAAM;AAChC,MAAA,iBAAA,CAAkB,KAAK,CAAA;AAA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d,0BAAAA,GAAAA,CAAC,WAAA,EAAA,EAAY,SAAA,EAAU,wBAAA,EAAyB,CAAA,EACjD,CAAA;AAAA,4BACAA,GAAAA,CAAC,MAAA,EAAA,EAAK,WAAU,+CAAA,EAAgD,KAAA,EAAO,OACrE,QAAA,EAAA,KAAA,EACF;AAAA,WAAA,EAAA,EANS,QAOV,CAAA;AAAA,QAEF,CAAC;AAAA,OAAA,EACF,CAAA;AAAA,MAIA,gBAAgB,MAAA,KAAW,CAAA,oBAC3BK,IAAAA,CAAC,KAAA,EAAA,EAAI,WAAU,wCAAA,EACd,QAAA,EAAA;AAAA,wBAAAL,GAAAA,CAAC,YAAA,EAAA,EAAa,SAAA,EAAU,iCAAA,EAAkC,CAAA;AAAA,wBAC1DA,GAAAA,CAAC,GAAA,EAAA,EAAE,WAAU,SAAA,EAAW,QAAA,EAAA,WAAA,GAAc,iCAAiC,sBAAA,EAAuB;AAAA,OAAA,EAC/F,CAAA;AAAA,MAIA,eAAA,CAAgB,MAAA,GAAS,CAAA,IAAK,iBAAA,CAAkB,MAAA,KAAW,qBAC3DK,IAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,wCAAA,EACd,QAAA,EAAA;AAAA,wBAAAL,GAAAA,CAAC,WAAA,EAAA,EAAY,SAAA,EAAU,iCAAA,EAAkC,CAAA;AAAA,wBACzDA,GAAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,WAAU,QAAA,EAAA,yCAAA,EAAuC;AAAA,OAAA,EAC/D;AAAA,KAAA,EAEF,CAAA,EACD;AAAA,GAAA,EACD,CAAA;AAEF","file":"record-picker.js","sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * Custom hook that debounces a value\n * @param value - The value to debounce\n * @param delay - The delay in milliseconds\n * @returns The debounced value\n */\nexport function useDebounce<T>(value: T, delay: number): T {\n\tconst [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n\tuseEffect(() => {\n\t\tconst handler = setTimeout(() => {\n\t\t\tsetDebouncedValue(value);\n\t\t}, delay);\n\n\t\treturn () => {\n\t\t\tclearTimeout(handler);\n\t\t};\n\t}, [value, delay]);\n\n\treturn debouncedValue;\n}\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox';\n\nimport { cn } from '../lib/utils';\n\ntype CheckboxProps = CheckboxPrimitive.Root.Props;\n\nconst Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(({ className, ...props }, ref) => {\n\treturn (\n\t\t<CheckboxPrimitive.Root\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t'relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[4px] border border-input bg-background bg-clip-padding outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:bg-clip-border dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tdata-slot=\"checkbox\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<CheckboxPrimitive.Indicator\n\t\t\t\tclassName=\"-inset-px absolute flex items-center justify-center rounded-[4px] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground\"\n\t\t\t\tdata-slot=\"checkbox-indicator\"\n\t\t\t\trender={(props, state) => (\n\t\t\t\t\t<span {...props}>\n\t\t\t\t\t\t{state.indeterminate ? (\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\tclassName=\"size-3.5 sm:size-3\"\n\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\theight=\"24\"\n\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t\t\t\t\tstrokeWidth=\"3\"\n\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\twidth=\"24\"\n\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<path d=\"M5.252 12h13.496\" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\tclassName=\"size-3.5 sm:size-3\"\n\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\theight=\"24\"\n\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t\t\t\t\tstrokeWidth=\"3\"\n\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\twidth=\"24\"\n\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<path d=\"M5.252 12.7 10.2 18.63 18.748 5.37\" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t/>\n\t\t</CheckboxPrimitive.Root>\n\t);\n});\nCheckbox.displayName = 'Checkbox';\n\nexport { Checkbox };\nexport type { CheckboxProps };\n","'use client';\n\nimport { Input as InputPrimitive } from '@base-ui/react/input';\nimport type * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype InputProps = Omit<InputPrimitive.Props & React.RefAttributes<HTMLInputElement>, 'size'> & {\n\tsize?: 'sm' | 'default' | 'lg' | number;\n\tunstyled?: boolean;\n};\n\nfunction Input({ className, size = 'default', unstyled = false, ...props }: InputProps) {\n\tconst isFloating = props.placeholder === ' ';\n\n\treturn (\n\t\t<span\n\t\t\tclassName={\n\t\t\t\tcn(\n\t\t\t\t\t!unstyled && [\n\t\t\t\t\t\t// Base layout\n\t\t\t\t\t\t'relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow',\n\t\t\t\t\t\t// Inner shadow highlight\n\t\t\t\t\t\t'before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)]',\n\t\t\t\t\t\t'not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]',\n\t\t\t\t\t\t// Focus state - use primary brand color\n\t\t\t\t\t\t'has-focus-visible:border-primary/60 has-focus-visible:ring-[3px] has-focus-visible:ring-primary/35',\n\t\t\t\t\t\t// Invalid state\n\t\t\t\t\t\t'has-aria-invalid:border-destructive/36',\n\t\t\t\t\t\t'has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16',\n\t\t\t\t\t\t// Disabled state\n\t\t\t\t\t\t'has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none',\n\t\t\t\t\t\t// Dark mode\n\t\t\t\t\t\t'sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border',\n\t\t\t\t\t\t'dark:has-aria-invalid:ring-destructive/24',\n\t\t\t\t\t\t'dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]',\n\t\t\t\t\t],\n\t\t\t\t\tclassName,\n\t\t\t\t) || undefined\n\t\t\t}\n\t\t\tdata-size={size}\n\t\t\tdata-slot=\"input-control\"\n\t\t>\n\t\t\t<InputPrimitive\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none',\n\t\t\t\t\tisFloating\n\t\t\t\t\t\t? 'h-11 pt-4.5 pb-1 leading-none placeholder:text-transparent sm:h-10'\n\t\t\t\t\t\t: 'h-8.5 leading-8.5 placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5',\n\t\t\t\t\tsize === 'sm' &&\n\t\t\t\t\t\t(isFloating\n\t\t\t\t\t\t\t? 'h-10 px-[calc(--spacing(2.5)-1px)] pt-4 pb-1 sm:h-9'\n\t\t\t\t\t\t\t: 'h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5'),\n\t\t\t\t\tsize === 'lg' &&\n\t\t\t\t\t\t(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'),\n\t\t\t\t\tprops.type === 'search' &&\n\t\t\t\t\t\t'[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none',\n\t\t\t\t\tprops.type === 'file' &&\n\t\t\t\t\t\t'text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm',\n\t\t\t\t)}\n\t\t\t\tdata-slot=\"input\"\n\t\t\t\tsize={typeof size === 'number' ? size : undefined}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</span>\n\t);\n}\n\nexport { Input };\nexport type { InputProps };\n","\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../lib/utils\";\nimport { Input, type InputProps } from \"./input\";\nimport { Textarea, type TextareaProps } from \"./textarea\";\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-primary/60 has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] has-[input:focus-visible,textarea:focus-visible]:ring-primary/35 sm:text-sm dark:bg-input/32 dark:bg-clip-border dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/8%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]\",\n className,\n )}\n data-slot=\"input-group\"\n role=\"group\"\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n \"[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80\",\n {\n defaultVariants: {\n align: \"inline-start\",\n },\n variants: {\n align: {\n \"block-end\":\n \"order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]\",\n \"block-start\":\n \"order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]\",\n \"inline-end\":\n \"has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]\",\n \"inline-start\":\n \"has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]\",\n },\n },\n },\n);\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n className={cn(inputGroupAddonVariants({ align }), className)}\n data-align={align}\n data-slot=\"input-group-addon\"\n onMouseDown={(e) => {\n const target = e.target as HTMLElement;\n const isInteractive = target.closest(\"button, a\");\n if (isInteractive) return;\n e.preventDefault();\n const parent = e.currentTarget.parentElement;\n const input = parent?.querySelector<\n HTMLInputElement | HTMLTextAreaElement\n >(\"input, textarea\");\n if (input && !parent?.querySelector(\"input:focus, textarea:focus\")) {\n input.focus();\n }\n }}\n {...props}\n />\n );\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"[&_svg]:-mx-0.5 line-clamp-1 flex items-center gap-2 text-muted-foreground in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction InputGroupInput({ className, ...props }: InputProps) {\n return <Input className={className} unstyled {...props} />;\n}\n\nfunction InputGroupTextarea({ className, ...props }: TextareaProps) {\n return <Textarea className={className} unstyled {...props} />;\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ScrollArea as ScrollAreaPrimitive } from \"@base-ui/react/scroll-area\";\n\nimport { cn } from \"../lib/utils\";\n\ntype ScrollAreaProps = ScrollAreaPrimitive.Root.Props & {\n scrollFade?: boolean;\n scrollbarGutter?: boolean;\n};\n\nconst ScrollArea = React.forwardRef<HTMLDivElement, ScrollAreaProps>(\n (\n { className, children, scrollFade = false, scrollbarGutter = false, ...props },\n ref\n ) => {\n return (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"size-full min-h-0\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n className={cn(\n \"h-full overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\",\n scrollFade &&\n \"mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]\",\n scrollbarGutter &&\n \"data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5\",\n )}\n data-slot=\"scroll-area-viewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar orientation=\"vertical\" />\n <ScrollBar orientation=\"horizontal\" />\n <ScrollAreaPrimitive.Corner data-slot=\"scroll-area-corner\" />\n </ScrollAreaPrimitive.Root>\n );\n }\n);\nScrollArea.displayName = \"ScrollArea\";\n\nfunction ScrollBar({\n className,\n orientation = \"vertical\",\n ...props\n}: ScrollAreaPrimitive.Scrollbar.Props) {\n return (\n <ScrollAreaPrimitive.Scrollbar\n className={cn(\n \"m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100\",\n className,\n )}\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n {...props}\n >\n <ScrollAreaPrimitive.Thumb\n className=\"relative flex-1 rounded-full bg-foreground/20\"\n data-slot=\"scroll-area-thumb\"\n />\n </ScrollAreaPrimitive.Scrollbar>\n );\n}\n\nexport { ScrollArea, ScrollBar };\n","'use client';\n\nimport { useCallback, useMemo, useState } from 'react';\nimport { RiCheckLine, RiLoader4Line, RiSearchLine } from '@remixicon/react';\nimport { matchSorter } from 'match-sorter';\n\nimport { useDebounce } from '../lib/use-debounce';\nimport { Checkbox } from './checkbox';\nimport { InputGroup, InputGroupAddon, InputGroupInput } from './input-group';\nimport { ScrollArea } from './scroll-area';\n\ninterface RecordPickerProps {\n\trecords: any[];\n\tlinkedRecordIds: Set<string>;\n\tonLink: (record: any) => void;\n\tisLinking: boolean;\n\tgetRecordLabel: (record: any) => string;\n\tgetRecordId: (record: any) => string;\n\tsearchFields?: string[];\n\tplaceholder?: string;\n\tmaxHeight?: string;\n}\n\nexport function RecordPicker({\n\trecords,\n\tlinkedRecordIds,\n\tonLink,\n\tisLinking,\n\tgetRecordLabel,\n\tgetRecordId,\n\tsearchFields = ['name', 'title', 'label'],\n\tplaceholder = 'Search records...',\n\tmaxHeight = '300px',\n}: RecordPickerProps) {\n\tconst [searchQuery, setSearchQuery] = useState('');\n\tconst debouncedSearchQuery = useDebounce(searchQuery, 300);\n\n\t// Filter records based on search query\n\tconst filteredRecords = useMemo(() => {\n\t\tif (!debouncedSearchQuery.trim()) {\n\t\t\treturn records;\n\t\t}\n\n\t\treturn matchSorter(records, debouncedSearchQuery, {\n\t\t\tkeys: searchFields,\n\t\t\tthreshold: matchSorter.rankings.CONTAINS,\n\t\t});\n\t}, [records, debouncedSearchQuery, searchFields]);\n\n\t// Separate linked and unlinked records\n\tconst { linkedRecords, unlinkableRecords } = useMemo(() => {\n\t\tconst linked: any[] = [];\n\t\tconst unlinkable: any[] = [];\n\n\t\tfilteredRecords.forEach((record) => {\n\t\t\tconst recordId = getRecordId(record);\n\t\t\tif (linkedRecordIds.has(recordId)) {\n\t\t\t\tlinked.push(record);\n\t\t\t} else {\n\t\t\t\tunlinkable.push(record);\n\t\t\t}\n\t\t});\n\n\t\treturn { linkedRecords: linked, unlinkableRecords: unlinkable };\n\t}, [filteredRecords, linkedRecordIds, getRecordId]);\n\n\tconst handleLinkRecord = useCallback(\n\t\t(record: any) => {\n\t\t\tonLink(record);\n\t\t},\n\t\t[onLink],\n\t);\n\n\treturn (\n\t\t<div className='space-y-3'>\n\t\t\t{/* Search Input */}\n\t\t\t<InputGroup>\n\t\t\t\t<InputGroupAddon>\n\t\t\t\t\t<RiSearchLine />\n\t\t\t\t</InputGroupAddon>\n\t\t\t\t<InputGroupInput\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tvalue={searchQuery}\n\t\t\t\t\tonChange={(e) => setSearchQuery(e.target.value)}\n\t\t\t\t/>\n\t\t\t</InputGroup>\n\n\t\t\t{/* Records List */}\n\t\t\t<ScrollArea style={{ maxHeight }} className='scrollbar-neutral-thin'>\n\t\t\t\t<div className='space-y-2 pr-2'>\n\t\t\t\t\t{/* Unlinkable Records */}\n\t\t\t\t\t{unlinkableRecords.length > 0 && (\n\t\t\t\t\t\t<div className='space-y-1'>\n\t\t\t\t\t\t\t<h4 className='text-muted-foreground text-xs font-medium tracking-wide uppercase'>\n\t\t\t\t\t\t\t\tAvailable Records ({unlinkableRecords.length})\n\t\t\t\t\t\t\t</h4>\n\t\t\t\t\t\t\t{unlinkableRecords.map((record) => {\n\t\t\t\t\t\t\t\tconst recordId = getRecordId(record);\n\t\t\t\t\t\t\t\tconst label = getRecordLabel(record);\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tkey={recordId}\n\t\t\t\t\t\t\t\t\t\tclassName='hover:bg-muted/50 flex items-center space-x-3 rounded-md p-2 transition-colors'\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\t\t\t\t\tid={`record-${recordId}`}\n\t\t\t\t\t\t\t\t\t\t\tchecked={false}\n\t\t\t\t\t\t\t\t\t\t\tonCheckedChange={() => handleLinkRecord(record)}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={isLinking}\n\t\t\t\t\t\t\t\t\t\t\tclassName='flex-shrink-0'\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\t\t\thtmlFor={`record-${recordId}`}\n\t\t\t\t\t\t\t\t\t\t\tclassName='flex-1 cursor-pointer truncate text-sm'\n\t\t\t\t\t\t\t\t\t\t\ttitle={label}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t\t{isLinking && (\n\t\t\t\t\t\t\t\t\t\t\t<RiLoader4Line className='text-muted-foreground h-4 w-4 flex-shrink-0 animate-spin' />\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Already Linked Records */}\n\t\t\t\t\t{linkedRecords.length > 0 && (\n\t\t\t\t\t\t<div className='space-y-1'>\n\t\t\t\t\t\t\t<h4 className='text-muted-foreground text-xs font-medium tracking-wide uppercase'>\n\t\t\t\t\t\t\t\tAlready Linked ({linkedRecords.length})\n\t\t\t\t\t\t\t</h4>\n\t\t\t\t\t\t\t{linkedRecords.map((record) => {\n\t\t\t\t\t\t\t\tconst recordId = getRecordId(record);\n\t\t\t\t\t\t\t\tconst label = getRecordLabel(record);\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<div key={recordId} className='bg-muted/30 flex items-center space-x-3 rounded-md p-2'>\n\t\t\t\t\t\t\t\t\t\t<div className='flex h-4 w-4 flex-shrink-0 items-center justify-center'>\n\t\t\t\t\t\t\t\t\t\t\t<RiCheckLine className='h-3 w-3 text-green-600' />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<span className='text-muted-foreground flex-1 truncate text-sm' title={label}>\n\t\t\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Empty State */}\n\t\t\t\t\t{filteredRecords.length === 0 && (\n\t\t\t\t\t\t<div className='text-muted-foreground py-8 text-center'>\n\t\t\t\t\t\t\t<RiSearchLine className='mx-auto mb-2 h-8 w-8 opacity-50' />\n\t\t\t\t\t\t\t<p className='text-sm'>{searchQuery ? 'No records match your search' : 'No records available'}</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* No Unlinkable Records */}\n\t\t\t\t\t{filteredRecords.length > 0 && unlinkableRecords.length === 0 && (\n\t\t\t\t\t\t<div className='text-muted-foreground py-4 text-center'>\n\t\t\t\t\t\t\t<RiCheckLine className='mx-auto mb-2 h-6 w-6 opacity-50' />\n\t\t\t\t\t\t\t<p className='text-sm'>All matching records are already linked</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</ScrollArea>\n\t\t</div>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/motion/motion-config.ts","../../src/components/portal.tsx","../../src/lib/slot.tsx","../../src/lib/utils.ts","../../src/components/sheet.tsx"],"names":["React","React2","jsx","SheetPrimitive","offset"],"mappings":";;;;;;;;;;AAsBO,IAAM,OAAA,GAAU;AAAA,EAiBK;AAAA,EAG3B,YAAA,EAAc,CAAC,GAAA,EAAK,CAAA,EAAG,KAAK,CAAC;AAC9B,CAAA;AAUO,IAAM,SAAA,GAAY;AAAA,EAEf;AAAA,EAGT,IAAA,EAAM,IAAA;AAAA;AAAA,EAGN,MAAA,EAAQ,GAOT,CAAA;ACxBO,IAAM,cAAA,GAAiB,aAAA;AAM9B,IAAM,gBAAsBA,MAAA,CAAA,aAAA,CAAkC;AAAA,EAC7D,KAAA,EAAO,MAAA;AAAA,E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,MACV,SAAA,EAAW,EAAA,CAAG,uCAAA,EAAyC,SAAS,CAAA;AAAA,MAC/D,GAAG;AAAA;AAAA,GACL;AAEF;AAIA,SAAS,gBAAA,CAAiB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA0B;AACzE,EAAA,uBACCD,GAAAA;AAAA,IAACC,MAAA,CAAe,WAAA;AAAA,IAAf;AAAA,MACA,WAAA,EAAU,mBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACL;AAEF","file":"sheet.js","sourcesContent":["import type { Transition } from 'motion/react';\n\n/**\n * Shared motion configuration for consistent animations across the app.\n * Based on practical animation tips from https://emilkowal.ski/ui/7-practical-animation-tips\n *\n * Key principles:\n * 1. Keep UI animations under 300ms\n * 2. Never animate from scale(0) - use 0.9+ for natural feel\n * 3. Use custom easing curves for more impactful animations\n * 4. Make animations origin-aware when possible\n * 5. Use blur to smooth transitions when needed\n */\n\n// =============================================================================\n// Easing Curves\n// =============================================================================\n\n/**\n * Standard easing curves for UI animations.\n * Reference: https://easings.co/\n */\nexport const easings = {\n\t/** Smooth deceleration - good for elements entering the screen */\n\teaseOut: [0.25, 0.1, 0.25, 1] as const,\n\n\t/** Smooth acceleration - good for elements leaving the screen */\n\teaseIn: [0.42, 0, 1, 1] as const,\n\n\t/** Smooth both ways - good for hover states and toggles */\n\teaseInOut: [0.42, 0, 0.58, 1] as const,\n\n\t/** Snappy entrance with soft landing - great for modals/dialogs */\n\tsnappy: [0.2, 0, 0, 1] as const,\n\n\t/** Bouncy feel - use sparingly for playful interactions */\n\tbounce: [0.34, 1.56, 0.64, 1] as const,\n\n\t/** Quick start, gradual stop - good for quick feedback */\n\temphasized: [0.4, 0, 0.2, 1] as const,\n\n\t/** Physical feel for exit animations */\n\tphysicalExit: [0.4, 0, 0.6, 1] as const,\n} as const;\n\n// =============================================================================\n// Duration Presets\n// =============================================================================\n\n/**\n * Duration presets in seconds.\n * Rule: UI animations should be under 300ms (0.3s)\n */\nexport const durations = {\n\t/** Instant feedback (button press, toggle) */\n\tinstant: 0.1,\n\n\t/** Quick transitions (tooltips, small elements) */\n\tfast: 0.15,\n\n\t/** Standard UI transitions (modals, panels) */\n\tnormal: 0.2,\n\n\t/** Deliberate animations (page transitions, complex reveals) */\n\tslow: 0.3,\n\n\t/** Maximum for UI - use rarely */\n\tdeliberate: 0.4,\n} as const;\n\n// =============================================================================\n// Spring Presets\n// =============================================================================\n\n/**\n * Spring configurations for physics-based animations.\n * These create more natural, organic motion.\n */\nexport const springs = {\n\t/** Snappy spring - good for quick interactions */\n\tsnappy: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 400,\n\t\tdamping: 30,\n\t\tmass: 0.8,\n\t},\n\n\t/** Bouncy spring - good for playful elements */\n\tbouncy: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 300,\n\t\tdamping: 20,\n\t\tmass: 0.6,\n\t},\n\n\t/** Gentle spring - good for large elements */\n\tgentle: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 150,\n\t\tdamping: 25,\n\t\tmass: 1,\n\t},\n\n\t/** Stiff spring - good for precise movements */\n\tstiff: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 500,\n\t\tdamping: 35,\n\t\tmass: 0.5,\n\t},\n\n\t/** Panel/sheet animations */\n\tpanel: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 150,\n\t\tdamping: 25,\n\t},\n} as const;\n\n// =============================================================================\n// Transition Presets\n// =============================================================================\n\n/**\n * Pre-configured transitions for common animation patterns.\n */\nexport const transitions = {\n\t/** Fast fade for overlays and simple elements */\n\tfade: {\n\t\tduration: durations.fast,\n\t\tease: easings.easeOut,\n\t} satisfies Transition,\n\n\t/** Standard enter/exit for UI elements */\n\tenterExit: {\n\t\tduration: durations.normal,\n\t\tease: easings.easeOut,\n\t} satisfies Transition,\n\n\t/** Snappy transition for interactive elements */\n\tsnappy: {\n\t\tduration: durations.fast,\n\t\tease: easings.snappy,\n\t} satisfies Transition,\n\n\t/** Panel slide transition */\n\tpanel: {\n\t\ttype: 'spring',\n\t\tstiffness: 150,\n\t\tdamping: 25,\n\t} satisfies Transition,\n\n\t/** Exit transition with physical feel */\n\texit: {\n\t\ttype: 'tween',\n\t\tduration: durations.normal,\n\t\tease: easings.physicalExit,\n\t} satisfies Transition,\n\n\t/** Layout animations */\n\tlayout: {\n\t\ttype: 'spring',\n\t\tstiffness: 300,\n\t\tdamping: 30,\n\t} satisfies Transition,\n} as const;\n\n// =============================================================================\n// Animation Variants\n// =============================================================================\n\n/**\n * Common animation variants for AnimatePresence patterns.\n * Follows the rule: never animate from scale(0), use 0.9+ instead.\n */\nexport const variants = {\n\t/** Fade with subtle scale - good for modals, cards */\n\tfadeScale: {\n\t\tinitial: { opacity: 0, scale: 0.95 },\n\t\tanimate: { opacity: 1, scale: 1 },\n\t\texit: { opacity: 0, scale: 0.95 },\n\t},\n\n\t/** Fade with subtle slide up - good for content reveals */\n\tfadeSlideUp: {\n\t\tinitial: { opacity: 0, y: 8 },\n\t\tanimate: { opacity: 1, y: 0 },\n\t\texit: { opacity: 0, y: -8 },\n\t},\n\n\t/** Fade with subtle slide down - good for dropdowns */\n\tfadeSlideDown: {\n\t\tinitial: { opacity: 0, y: -8 },\n\t\tanimate: { opacity: 1, y: 0 },\n\t\texit: { opacity: 0, y: 8 },\n\t},\n\n\t/** Simple fade - for overlays */\n\tfade: {\n\t\tinitial: { opacity: 0 },\n\t\tanimate: { opacity: 1 },\n\t\texit: { opacity: 0 },\n\t},\n\n\t/** Dock/floating element - scales from bottom */\n\tfloatUp: {\n\t\tinitial: { opacity: 0, y: 8, scale: 0.98 },\n\t\tanimate: { opacity: 1, y: 0, scale: 1 },\n\t\texit: { opacity: 0, y: 8, scale: 0.98 },\n\t},\n} as const;\n","'use client';\n\nimport * as React from 'react';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Overlay layer type:\n * - 'base': Root level (page content, base floating elements)\n * - 'modal': Inside a modal overlay (dialog, sheet, drawer)\n */\nexport type OverlayLayer = 'base' | 'modal';\n\n/**\n * Where floating overlays should portal:\n * - 'root': always portal into #portal-root\n * - 'nested': let Base UI nest portals into the nearest Base UI portal node\n */\nexport type FloatingPortalStrategy = 'root' | 'nested';\n\n/**\n * Z-index mode for floating overlays.\n * - 'default': --z-layer-floating\n * - 'elevated': --z-layer-floating-elevated\n */\nexport type FloatingZIndex = 'default' | 'elevated';\n\ninterface PortalContextValue {\n\t/** Current overlay layer */\n\tlayer: OverlayLayer;\n\t/** Modal nesting depth (0 for first modal, 1 for nested, etc.) */\n\tdepth: number;\n\t/** Strategy for where floating overlays should portal */\n\tfloatingPortalStrategy: FloatingPortalStrategy;\n\t/** Z-index mode for floating overlays */\n\tfloatingZIndex: FloatingZIndex;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nexport const PORTAL_ROOT_ID = 'portal-root';\n\n// ============================================================================\n// Context\n// ============================================================================\n\nconst PortalContext = React.createContext<PortalContextValue>({\n\tlayer: 'base',\n\tdepth: 0,\n\tfloatingPortalStrategy: 'root',\n\tfloatingZIndex: 'default',\n});\n\n// ============================================================================\n// Providers\n// ============================================================================\n\n/**\n * Provider for modal overlays (Dialog, Sheet, Drawer, etc.)\n *\n * Wraps modal content to:\n * 1. Create a scoped portal container for nested floating elements\n * 2. Track the overlay layer (so floating elements know to use elevated z-index)\n * 3. Track nesting depth for stacked modals\n *\n * Usage:\n * ```tsx\n * <DialogPopup>\n * <ModalPortalScope>\n * {children} // Popovers inside here will render in the scoped container\n * </ModalPortalScope>\n * </DialogPopup>\n * ```\n */\nexport function ModalPortalScope({\n\tchildren,\n\tfloatingPortalStrategy = 'nested',\n\tfloatingZIndex = 'default',\n}: {\n\tchildren: React.ReactNode;\n\tfloatingPortalStrategy?: FloatingPortalStrategy;\n\tfloatingZIndex?: FloatingZIndex;\n}) {\n\tconst parentContext = React.useContext(PortalContext);\n\n\t// Increment depth from parent if already in modal layer\n\tconst depth = parentContext.layer === 'modal' ? parentContext.depth + 1 : 0;\n\n\tconst value = React.useMemo<PortalContextValue>(\n\t\t() => ({\n\t\t\tlayer: 'modal',\n\t\t\tdepth,\n\t\t\tfloatingPortalStrategy,\n\t\t\tfloatingZIndex,\n\t\t}),\n\t\t[depth, floatingPortalStrategy, floatingZIndex],\n\t);\n\n\treturn <PortalContext.Provider value={value}>{children}</PortalContext.Provider>;\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\n/**\n * Get the current portal context value.\n * Used internally by other hooks.\n */\nexport function usePortalContext(): PortalContextValue {\n\treturn React.useContext(PortalContext);\n}\n\nexport function useInModalOverlay(): boolean {\n\treturn React.useContext(PortalContext).layer === 'modal';\n}\n\n/**\n * Get the root portal container element.\n * Used by modal components (Dialog, Sheet, etc.) to render their portals.\n *\n * @returns The root portal container, or null during SSR/before mount\n */\nexport function useRootPortalContainer(): HTMLElement | null {\n\tconst [container, setContainer] = React.useState<HTMLElement | null>(null);\n\n\tReact.useLayoutEffect(() => {\n\t\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\t\tsetContainer(el);\n\t}, []);\n\n\treturn container;\n}\n\n/**\n * Centralized portal + z-index policy for floating overlays.\n *\n * - When `floatingPortalStrategy` is 'nested', Base UI will automatically portal\n * into the nearest Base UI portal node (so dialog \"inert\" behavior includes it).\n * - When it's 'root', we portal into #portal-root.\n */\nexport function useFloatingOverlayPortalProps(): {\n\tcontainer?: HTMLElement | null;\n\tzIndexClass: string;\n} {\n\tconst rootContainer = useRootPortalContainer();\n\tconst { floatingPortalStrategy, floatingZIndex } = React.useContext(PortalContext);\n\n\tconst container = floatingPortalStrategy === 'nested' ? undefined : (rootContainer ?? null);\n\tconst zIndexClass =\n\t\tfloatingZIndex === 'elevated'\n\t\t\t? 'z-[var(--z-layer-floating-elevated)]'\n\t\t\t: 'z-[var(--z-layer-floating)]';\n\n\treturn { container, zIndexClass };\n}\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Portal root component to render in app layout.\n * All overlay components will render their portals inside this container.\n *\n * Usage in layout.tsx:\n * ```tsx\n * import { PortalRoot } from '@constructive-io/ui/portal';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * {children}\n * <PortalRoot />\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport function PortalRoot() {\n\treturn (\n\t\t<div\n\t\t\tid={PORTAL_ROOT_ID}\n\t\t\tdata-slot=\"portal-root\"\n\t\t\tstyle={{\n\t\t\t\tposition: 'fixed',\n\t\t\t\tinset: 0,\n\t\t\t\tzIndex: 'var(--z-layer-portal-root)',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\t// Children (portal contents) will have pointer-events: auto\n\t\t\t}}\n\t\t/>\n\t);\n}\n\n/**\n * Hook to get the portal container element for rendering floating UI elements.\n * Returns the element with id=\"portal-root\" if it exists in the DOM.\n *\n * @deprecated Use useRootPortalContainer or useFloatingOverlayPortalProps instead\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n\tif (typeof document === 'undefined') return undefined;\n\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\treturn el instanceof HTMLElement ? el : undefined;\n}\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single callback ref.\n * React 19 compatible - handles refs as regular props.\n */\nfunction composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(node);\n\t\t\t} else if (ref != null) {\n\t\t\t\t(ref as React.MutableRefObject<T | null>).current = node;\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Merges props, handling special cases for className, style, and event handlers.\n * Excludes 'ref' from merging as it's handled separately.\n */\nfunction mergeProps(\n\tslotProps: Record<string, unknown>,\n\tchildProps: Record<string, unknown>,\n): Record<string, unknown> {\n\tconst overrideProps: Record<string, unknown> = { ...childProps };\n\n\tfor (const propName in childProps) {\n\t\t// Skip ref - handled separately for composition\n\t\tif (propName === 'ref') continue;\n\n\t\tconst slotPropValue = slotProps[propName];\n\t\tconst childPropValue = childProps[propName];\n\n\t\t// Compose event handlers\n\t\tif (/^on[A-Z]/.test(propName) && typeof slotPropValue === 'function' && typeof childPropValue === 'function') {\n\t\t\toverrideProps[propName] = (...args: unknown[]) => {\n\t\t\t\tchildPropValue(...args);\n\t\t\t\tslotPropValue(...args);\n\t\t\t};\n\t\t}\n\t\t// Merge className\n\t\telse if (propName === 'className' && typeof slotPropValue === 'string' && typeof childPropValue === 'string') {\n\t\t\toverrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();\n\t\t}\n\t\t// Merge style\n\t\telse if (propName === 'style' && typeof slotPropValue === 'object' && typeof childPropValue === 'object') {\n\t\t\toverrideProps[propName] = { ...slotPropValue, ...childPropValue };\n\t\t}\n\t}\n\n\treturn { ...slotProps, ...overrideProps };\n}\n\n/**\n * Merges props from a parent component with a child element's props,\n * including proper ref composition. Use this in render prop patterns\n * where the parent needs to merge its props with the child's.\n *\n * @param parentProps - Props from the parent component (e.g., triggerProps from Base UI)\n * @param childElement - The child React element whose props will be merged\n * @returns Merged props object ready to pass to React.cloneElement\n */\nfunction mergePropsWithRef<T = HTMLElement>(\n\tparentProps: Record<string, unknown>,\n\tchildElement: React.ReactElement,\n): Record<string, unknown> {\n\tconst childProps = childElement.props as Record<string, unknown>;\n\tconst parentRef = parentProps.ref as React.Ref<T> | undefined;\n\tconst childRef = childProps.ref as React.Ref<T> | undefined;\n\n\tconst mergedProps = mergeProps(parentProps, childProps);\n\n\t// Compose refs if either exists\n\tif (parentRef || childRef) {\n\t\tmergedProps.ref = composeRefs(parentRef, childRef);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Check if a value is a valid slottable child (single React element).\n */\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n\treturn React.isValidElement(child);\n}\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Slot component - renders its child element with merged props.\n * Used for the `asChild` pattern where parent props are passed to child.\n * React 19 compatible - accesses ref from props instead of element.ref.\n */\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n\tconst { children, ...slotProps } = props;\n\n\t// Handle single child\n\tif (isSlottable(children)) {\n\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t// React 19: ref is now a regular prop, not element.ref\n\t\tconst childRef = childProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\treturn React.cloneElement(children, {\n\t\t\t...mergeProps(slotProps, childProps),\n\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t} as React.Attributes);\n\t}\n\n\t// Handle multiple children - wrap Slottable content\n\tif (React.Children.count(children) > 1) {\n\t\tconst childrenArray = React.Children.toArray(children);\n\t\tconst slottableChild = childrenArray.find(\n\t\t\t(child) => React.isValidElement(child) && child.type === Slottable,\n\t\t) as React.ReactElement<{ children: React.ReactNode }> | undefined;\n\n\t\tif (slottableChild) {\n\t\t\tconst newElement = slottableChild.props.children;\n\t\t\tif (isSlottable(newElement)) {\n\t\t\t\tconst newElementProps = newElement.props as Record<string, unknown> & { children?: React.ReactNode };\n\t\t\t\tconst newChildren = childrenArray.map((child) => {\n\t\t\t\t\tif (child === slottableChild) {\n\t\t\t\t\t\treturn React.Children.count(newElementProps.children) > 1\n\t\t\t\t\t\t\t? React.Children.only(null)\n\t\t\t\t\t\t\t: newElementProps.children;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\n\t\t\t\t// React 19: ref is now a regular prop\n\t\t\t\tconst childRef = newElementProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\t\t\treturn React.cloneElement(newElement, {\n\t\t\t\t\t...mergeProps(slotProps, newElementProps),\n\t\t\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t\t\t\tchildren: newChildren,\n\t\t\t\t} as React.Attributes);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fallback: render children as-is (shouldn't normally happen with proper usage)\n\treturn <>{children}</>;\n});\n\nSlot.displayName = 'Slot';\n\n/**\n * Slottable component - marks content that should receive slot props.\n * Used when Slot has multiple children and you want to specify which one receives props.\n */\nfunction Slottable({ children }: { children: React.ReactNode }) {\n\treturn <>{children}</>;\n}\n\nexport { Slot, Slottable, composeRefs, mergeProps, mergePropsWithRef };\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as SheetPrimitive } from '@base-ui/react/dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport { AnimatePresence, motion, type HTMLMotionProps, type Transition } from 'motion/react';\n\nimport { durations, easings } from '../lib/motion/motion-config';\nimport { ModalPortalScope, useRootPortalContainer } from './portal';\nimport { mergePropsWithRef } from '../lib/slot';\nimport { cn } from '../lib/utils';\n\n// ============================================================================\n// Sheet Stack Context - Manages nested/stacked sheets\n// ============================================================================\n\ntype SheetInfo = {\n\tid: string;\n\tdepth: number;\n\tclose: () => void;\n};\n\ntype SheetSize = {\n\twidth: number;\n\theight: number;\n};\n\ntype StackMode = 'cascade' | 'collapse';\n\ntype SheetStackContextType = {\n\tsheets: SheetInfo[];\n\tsheetSizes: Record<string, SheetSize | undefined>;\n\tstackMode: StackMode;\n\tregisterSheet: (info: SheetInfo) => void;\n\tunregisterSheet: (id: string) => void;\n\tsetSheetSize: (id: string, size: SheetSize) => void;\n\tgetSheetSize: (id: string) => SheetSize | undefined;\n\tisTopSheet: (id: string) => boolean;\n\tgetSheetsAbove: (id: string) => number;\n};\n\nconst SheetStackContext = React.createContext<SheetStackContextType | undefined>(undefined);\n\nconst SHEET_INDENT = 24; // pixels to push outer sheets when inner opens\n\ntype SheetStackProviderProps = {\n\tchildren: React.ReactNode;\n\t/** Controls how sheets are pushed when stacking.\n\t * - 'cascade' (default): Each sheet is incrementally indented by SHEET_INDENT\n\t * - 'collapse': Only the sheet directly below the top gets full-width push, others cascade relative to it\n\t */\n\tstackMode?: StackMode;\n};\n\nfunction SheetStackProvider({ children, stackMode = 'cascade' }: SheetStackProviderProps) {\n\tconst [sheets, setSheets] = React.useState<SheetInfo[]>([]);\n\tconst [sheetSizes, setSheetSizes] = React.useState<Record<string, SheetSize | undefined>>({});\n\n\t// Use ref to access current sheets in callbacks without causing re-renders\n\tconst sheetsRef = React.useRef<SheetInfo[]>([]);\n\tsheetsRef.current = sheets;\n\n\t// Register sheet - insert sorted by depth (lower depth = earlier in array)\n\t// This ensures sheets are ordered correctly regardless of registration timing\n\tconst registerSheet = React.useCallback((info: SheetInfo) => {\n\t\tsetSheets((prev) => {\n\t\t\tif (prev.some((s) => s.id === info.id)) return prev;\n\t\t\t// Insert in sorted order by depth\n\t\t\tconst newSheets = [...prev, info];\n\t\t\tnewSheets.sort((a, b) => a.depth - b.depth);\n\t\t\treturn newSheets;\n\t\t});\n\t}, []);\n\n\tconst unregisterSheet = React.useCallback((id: string) => {\n\t\tsetSheets((prev) => prev.filter((s) => s.id !== id));\n\t\tsetSheetSizes((prev) => {\n\t\t\tif (!prev[id]) return prev;\n\t\t\tconst next = { ...prev };\n\t\t\tdelete next[id];\n\t\t\treturn next;\n\t\t});\n\t}, []);\n\n\tconst setSheetSize = React.useCallback((id: string, size: SheetSize) => {\n\t\tsetSheetSizes((prev) => {\n\t\t\tconst current = prev[id];\n\t\t\tif (current && current.width === size.width && current.height === size.height) return prev;\n\t\t\treturn { ...prev, [id]: size };\n\t\t});\n\t}, []);\n\n\tconst getSheetSize = React.useCallback((id: string) => sheetSizes[id], [sheetSizes]);\n\n\t// Topmost sheet = highest depth = last in sorted array\n\t// Use ref to avoid callback changing when sheets changes\n\tconst isTopSheet = React.useCallback((id: string) => {\n\t\tconst currentSheets = sheetsRef.current;\n\t\tif (currentSheets.length === 0) return false;\n\t\treturn currentSheets[currentSheets.length - 1]?.id === id;\n\t}, []);\n\n\t// Sheets above = sheets with higher depth than this one\n\t// Use ref to avoid callback changing when sheets changes\n\tconst getSheetsAbove = React.useCallback((id: string) => {\n\t\tconst currentSheets = sheetsRef.current;\n\t\tconst index = currentSheets.findIndex((s) => s.id === id);\n\t\tif (index === -1) return 0;\n\t\t// Sheets after this index have higher depth (are on top)\n\t\treturn currentSheets.length - index - 1;\n\t}, []);\n\n\t// Global escape key handler - only close the topmost sheet (highest depth)\n\tReact.useEffect(() => {\n\t\tconst handleGlobalEscape = (event: KeyboardEvent) => {\n\t\t\tconst currentSheets = sheetsRef.current;\n\t\t\tif (event.key === 'Escape' && currentSheets.length > 0) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\t// Close the topmost sheet (last in sorted array = highest depth)\n\t\t\t\tconst topSheet = currentSheets[currentSheets.length - 1];\n\t\t\t\ttopSheet?.close();\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener('keydown', handleGlobalEscape, true);\n\t\treturn () => document.removeEventListener('keydown', handleGlobalEscape, true);\n\t}, []);\n\n\t// Memoize value - callbacks are stable, only sheets changes\n\tconst value = React.useMemo(\n\t\t() => ({\n\t\t\tsheets,\n\t\t\tsheetSizes,\n\t\t\tstackMode,\n\t\t\tregisterSheet,\n\t\t\tunregisterSheet,\n\t\t\tsetSheetSize,\n\t\t\tgetSheetSize,\n\t\t\tisTopSheet,\n\t\t\tgetSheetsAbove,\n\t\t}),\n\t\t[sheets, sheetSizes, stackMode, registerSheet, unregisterSheet, setSheetSize, getSheetSize, isTopSheet, getSheetsAbove],\n\t);\n\n\treturn <SheetStackContext.Provider value={value}>{children}</SheetStackContext.Provider>;\n}\n\nconst useSheetStack = (): SheetStackContextType | undefined => {\n\treturn React.useContext(SheetStackContext);\n};\n\n// ============================================================================\n// Sheet Nesting Context - Tracks nesting level via React tree\n// ============================================================================\n\ntype SheetNestingContextType = {\n\tlevel: number;\n\tparentSheetId: string | null;\n};\n\nconst SheetNestingContext = React.createContext<SheetNestingContextType>({\n\tlevel: 0,\n\tparentSheetId: null,\n});\n\nconst useSheetNesting = () => React.useContext(SheetNestingContext);\n\n// ============================================================================\n// Individual Sheet Context\n// ============================================================================\n\ntype SheetContextType = {\n\tisOpen: boolean;\n\tsheetId: string;\n\tdepth: number;\n\tsheetsAbove: number;\n\tisTopSheet: boolean;\n\tclose: () => void;\n};\n\nconst SheetContext = React.createContext<SheetContextType | undefined>(undefined);\n\nconst useSheet = (): SheetContextType => {\n\tconst context = React.useContext(SheetContext);\n\tif (!context) {\n\t\tthrow new Error('useSheet must be used within a Sheet');\n\t}\n\treturn context;\n};\n\ntype DialogChangeEventDetails = Parameters<NonNullable<React.ComponentProps<typeof SheetPrimitive.Root>['onOpenChange']>>[1];\n\ntype SheetProps = Omit<React.ComponentProps<typeof SheetPrimitive.Root>, 'onOpenChange'> & {\n\t/** Unique identifier for this sheet in a stack. Auto-generated if not provided. */\n\tsheetId?: string;\n\t/** Callback when open state changes - simplified to just boolean for backwards compatibility */\n\tonOpenChange?: (open: boolean) => void;\n};\n\nlet sheetIdCounter = 0;\n\nfunction Sheet({ children, sheetId: providedId, ...props }: SheetProps) {\n\tconst [isOpen, setIsOpen] = React.useState(props?.open ?? props?.defaultOpen ?? false);\n\tconst sheetStack = useSheetStack();\n\tconst nesting = useSheetNesting();\n\tconst sheetIdRef = React.useRef(providedId ?? `sheet-${++sheetIdCounter}`);\n\tconst sheetId = sheetIdRef.current;\n\n\t// Depth is determined by nesting level in React tree\n\tconst depth = nesting.level;\n\n\t// Use ref for onOpenChange to keep close callback stable\n\tconst onOpenChangeRef = React.useRef(props.onOpenChange);\n\tonOpenChangeRef.current = props.onOpenChange;\n\n\t// Stable close callback using ref\n\tconst close = React.useCallback(() => {\n\t\tsetIsOpen(false);\n\t\tonOpenChangeRef.current?.(false);\n\t}, []);\n\n\t// Store stable references to stack functions\n\tconst registerSheetRef = React.useRef(sheetStack?.registerSheet);\n\tconst unregisterSheetRef = React.useRef(sheetStack?.unregisterSheet);\n\tregisterSheetRef.current = sheetStack?.registerSheet;\n\tunregisterSheetRef.current = sheetStack?.unregisterSheet;\n\n\t// Register/unregister with stack when open state changes\n\t// Only depend on isOpen, sheetId, depth - not on sheetStack object\n\tReact.useEffect(() => {\n\t\tif (registerSheetRef.current && isOpen) {\n\t\t\t// Close any open dropdowns/popovers by blurring active element\n\t\t\t// This ensures selects close before the sheet stacks on top\n\t\t\tif (document.activeElement instanceof HTMLElement) {\n\t\t\t\tdocument.activeElement.blur();\n\t\t\t}\n\t\t\tregisterSheetRef.current({ id: sheetId, depth, close });\n\t\t\treturn () => unregisterSheetRef.current?.(sheetId);\n\t\t}\n\t}, [isOpen, sheetId, depth, close]);\n\n\t// Sync controlled state\n\tReact.useEffect(() => {\n\t\tif (props?.open !== undefined) setIsOpen(props.open);\n\t}, [props?.open]);\n\n\t// Stable handleOpenChange using ref - Base UI passes (open, eventDetails)\n\tconst handleOpenChange = React.useCallback((open: boolean, _eventDetails: DialogChangeEventDetails) => {\n\t\tsetIsOpen(open);\n\t\tonOpenChangeRef.current?.(open);\n\t}, []);\n\n\t// Calculate sheets above and whether this is the top sheet\n\tconst sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;\n\tconst isTopSheet = sheetStack?.isTopSheet(sheetId) ?? true;\n\n\t// Nested sheets must be non-modal to prevent Base UI from closing parent on interaction\n\tconst isNested = depth > 0;\n\n\treturn (\n\t\t<SheetNestingContext.Provider value={{ level: depth + 1, parentSheetId: sheetId }}>\n\t\t\t<SheetContext.Provider value={{ isOpen, sheetId, depth, sheetsAbove, isTopSheet, close }}>\n\t\t\t\t<SheetPrimitive.Root\n\t\t\t\t\tdata-slot=\"sheet\"\n\t\t\t\t\t{...props}\n\t\t\t\t\topen={isOpen}\n\t\t\t\t\tmodal={isNested ? false : props.modal}\n\t\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SheetPrimitive.Root>\n\t\t\t</SheetContext.Provider>\n\t\t</SheetNestingContext.Provider>\n\t);\n}\n\ntype SheetTriggerProps = Omit<React.ComponentProps<typeof SheetPrimitive.Trigger>, 'render' | 'nativeButton'> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n\t/** Whether the child renders a native button. Defaults to true when asChild is used. */\n\tnativeButton?: boolean;\n};\n\nfunction SheetTrigger({ asChild, nativeButton, children, ...props }: SheetTriggerProps) {\n\tif (asChild && React.isValidElement(children)) {\n\t\treturn (\n\t\t\t<SheetPrimitive.Trigger\n\t\t\t\tdata-slot=\"sheet-trigger\"\n\t\t\t\tnativeButton={nativeButton ?? true}\n\t\t\t\t{...props}\n\t\t\t\trender={(triggerProps) => {\n\t\t\t\t\tconst { nativeButton: _, ...rest } = triggerProps as Record<string, unknown>;\n\t\t\t\t\treturn React.cloneElement(\n\t\t\t\t\t\tchildren as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\tmergePropsWithRef(rest, children as React.ReactElement),\n\t\t\t\t\t);\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SheetPrimitive.Trigger data-slot=\"sheet-trigger\" nativeButton={nativeButton} {...props}>\n\t\t\t{children}\n\t\t</SheetPrimitive.Trigger>\n\t);\n}\n\ntype SheetCloseProps = Omit<React.ComponentProps<typeof SheetPrimitive.Close>, 'render' | 'nativeButton'> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n\t/** Whether the child renders a native button. Defaults to true when asChild is used. */\n\tnativeButton?: boolean;\n};\n\nfunction SheetClose({ asChild, nativeButton, children, ...props }: SheetCloseProps) {\n\tif (asChild && React.isValidElement(children)) {\n\t\treturn (\n\t\t\t<SheetPrimitive.Close\n\t\t\t\tdata-slot=\"sheet-close\"\n\t\t\t\tnativeButton={nativeButton ?? true}\n\t\t\t\t{...props}\n\t\t\t\trender={(closeProps) => {\n\t\t\t\t\tconst { nativeButton: _, ...rest } = closeProps as Record<string, unknown>;\n\t\t\t\t\treturn React.cloneElement(\n\t\t\t\t\t\tchildren as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\tmergePropsWithRef(rest, children as React.ReactElement),\n\t\t\t\t\t);\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SheetPrimitive.Close data-slot=\"sheet-close\" nativeButton={nativeButton} {...props}>\n\t\t\t{children}\n\t\t</SheetPrimitive.Close>\n\t);\n}\n\ntype SheetPortalProps = React.ComponentProps<typeof SheetPrimitive.Portal> & {\n\t/** @deprecated Base UI manages mounting automatically */\n\tforceMount?: boolean;\n};\n\nfunction SheetPortal({ forceMount: _forceMount, ...props }: SheetPortalProps) {\n\tconst container = useRootPortalContainer();\n\n\tconst style = {\n\t\t...(props.style ?? {}),\n\t\t['--z-layer-floating' as any]: 'var(--z-layer-floating-elevated)',\n\t} satisfies React.CSSProperties;\n\n\treturn <SheetPrimitive.Portal data-slot=\"sheet-portal\" container={container} {...props} style={style} />;\n}\n\ntype SheetOverlayProps = React.HTMLAttributes<HTMLDivElement> & {\n\t/** @deprecated Base UI Backdrop handles child elements natively */\n\tasChild?: boolean;\n\t/** @deprecated Base UI manages mounting automatically */\n\tforceMount?: boolean;\n};\n\nfunction SheetOverlay({ className, asChild: _asChild, forceMount: _forceMount, ...props }: SheetOverlayProps) {\n\treturn (\n\t\t<SheetPrimitive.Backdrop\n\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\tclassName={cn('fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/80', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst sheetVariants = cva('fixed flex flex-col gap-3 bg-background p-4 shadow-lg', {\n\tvariants: {\n\t\tside: {\n\t\t\ttop: 'inset-x-0 top-0 border-b',\n\t\t\tbottom: 'inset-x-0 bottom-0 border-t',\n\t\t\tleft: 'inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',\n\t\t\tright: 'inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tside: 'right',\n\t},\n});\n\ntype SheetContentProps = Omit<React.ComponentProps<typeof SheetPrimitive.Popup>, 'children'> &\n\tVariantProps<typeof sheetVariants> &\n\tHTMLMotionProps<'div'> & {\n\t\ttransition?: Transition;\n\t\toverlay?: boolean;\n\t\t/** Whether to show the close button. Defaults to true. */\n\t\tshowClose?: boolean;\n\t\tchildren?: React.ReactNode;\n\t\t/** @deprecated Base UI manages mounting automatically */\n\t\tforceMount?: boolean;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonInteractOutside?: (e: Event) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonPointerDownOutside?: (e: Event) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonEscapeKeyDown?: (e: KeyboardEvent) => void;\n\t\t/** @deprecated Use onOpenChange on Root instead */\n\t\tonFocusOutside?: (e: Event) => void;\n\t};\n\n// Default width for nested sheets (used for collapse mode calculations)\n// Using max-w-md (28rem = 448px) as the typical nested sheet width\nconst NESTED_SHEET_WIDTH = 448;\n\n// Gap between the top two visible sheets in collapse mode\nconst SHEET_STACK_GAP = 0;\n\n/**\n * Calculate the push offset based on side, number of sheets above, and stack mode.\n * - 'cascade': Each sheet is incrementally indented by SHEET_INDENT per layer above\n * - 'collapse': Bottom sheets are pushed to opposite side to make room for top sheet\n */\nfunction getPushOffset(\n\tside: 'top' | 'bottom' | 'left' | 'right',\n\tsheetsAbove: number,\n\tstackMode: StackMode = 'cascade',\n\tcollapseBaseSize: number = NESTED_SHEET_WIDTH,\n): { x?: number | string; y?: number | string } {\n\tif (sheetsAbove === 0) {\n\t\treturn { x: 0, y: 0 };\n\t}\n\n\tif (stackMode === 'collapse') {\n\t\t// Keep the top 2 sheets visible:\n\t\t// - The sheet directly under the top is pushed by (top sheet width + small gap)\n\t\t// - Deeper sheets cascade under that with a small indent per extra layer\n\t\tconst baseOffset = collapseBaseSize + SHEET_STACK_GAP;\n\t\tconst offset = baseOffset + (sheetsAbove - 1) * SHEET_INDENT;\n\n\t\tswitch (side) {\n\t\t\tcase 'right':\n\t\t\t\treturn { x: -offset };\n\t\t\tcase 'left':\n\t\t\t\treturn { x: offset };\n\t\t\tcase 'top':\n\t\t\t\treturn { y: offset };\n\t\t\tcase 'bottom':\n\t\t\t\treturn { y: -offset };\n\t\t}\n\t}\n\n\t// Cascade mode: incremental indent\n\tconst offset = sheetsAbove * SHEET_INDENT;\n\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: -offset };\n\t\tcase 'left':\n\t\t\treturn { x: offset };\n\t\tcase 'top':\n\t\t\treturn { y: offset };\n\t\tcase 'bottom':\n\t\t\treturn { y: -offset };\n\t}\n}\n\n/**\n * Get the initial position for sheet animation based on side.\n * Pure transform animation for GPU acceleration - no opacity/scale changes.\n */\nfunction getInitialPosition(side: 'top' | 'bottom' | 'left' | 'right') {\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: '100%' };\n\t\tcase 'left':\n\t\t\treturn { x: '-100%' };\n\t\tcase 'top':\n\t\t\treturn { y: '-100%' };\n\t\tcase 'bottom':\n\t\t\treturn { y: '100%' };\n\t}\n}\n\n/**\n * Get the exit position for sheet animation based on side.\n * Pure transform for smooth GPU-accelerated exit.\n */\nfunction getExitPosition(side: 'top' | 'bottom' | 'left' | 'right') {\n\tswitch (side) {\n\t\tcase 'right':\n\t\t\treturn { x: '100%' };\n\t\tcase 'left':\n\t\t\treturn { x: '-100%' };\n\t\tcase 'top':\n\t\t\treturn { y: '-100%' };\n\t\tcase 'bottom':\n\t\t\treturn { y: '100%' };\n\t}\n}\n\n// Default sheet transition - fast tween for snappy, jank-free animation\nconst defaultSheetTransition: Transition = {\n\ttype: 'tween',\n\tduration: durations.normal,\n\tease: [0.32, 0.72, 0, 1], // Custom ease-out for snappy feel\n};\n\nfunction SheetContent({\n\tside = 'right',\n\tclassName,\n\ttransition = defaultSheetTransition,\n\toverlay = true,\n\tshowClose = true,\n\tchildren,\n\tforceMount: _forceMount,\n\tonInteractOutside: _onInteractOutside,\n\tonPointerDownOutside: _onPointerDownOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\tonFocusOutside: _onFocusOutside,\n\t...props\n}: SheetContentProps) {\n\tconst { isOpen, depth, sheetId, close } = useSheet();\n\tconst sheetStack = useSheetStack();\n\n\t// Calculate sheetsAbove directly from stack to ensure it's always current\n\t// sheetsAbove = number of sheets with higher depth (on top of this one)\n\tconst sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;\n\tconst stackMode = sheetStack?.stackMode ?? 'cascade';\n\n\t// Ensure side is never null (default already handles undefined, but TS needs explicit assertion)\n\tconst resolvedSide = side ?? 'right';\n\n\t// Calculate z-index based on depth (base modal content z-index + depth * 10)\n\t// We use a calc() string to reference the CSS variable\n\tconst zIndex = `calc(var(--z-layer-modal-content) + ${depth * 10})`;\n\n\t// Push offset for when sheets are stacked above this one\n\t// sheetsAbove > 0 means there are sheets on top, so this sheet should be pushed back\n\tconst topSheetId = sheetStack?.sheets[sheetStack.sheets.length - 1]?.id;\n\tconst topSheetSize = topSheetId ? sheetStack?.getSheetSize(topSheetId) : undefined;\n\tconst collapseBaseSize = topSheetSize\n\t\t? resolvedSide === 'left' || resolvedSide === 'right'\n\t\t\t? topSheetSize.width\n\t\t\t: topSheetSize.height\n\t\t: undefined;\n\n\tconst pushOffset = getPushOffset(resolvedSide, sheetsAbove, stackMode, collapseBaseSize ?? NESTED_SHEET_WIDTH);\n\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n\tReact.useLayoutEffect(() => {\n\t\tif (!isOpen) return;\n\t\tif (!sheetStack) return;\n\t\tconst el = contentRef.current;\n\t\tif (!el) return;\n\t\tlet rafId = 0;\n\t\tconst update = () => {\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tsheetStack.setSheetSize(sheetId, { width: rect.width, height: rect.height });\n\t\t};\n\t\tupdate();\n\t\tif (typeof ResizeObserver === 'undefined') return;\n\t\tconst ro = new ResizeObserver(() => {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t\trafId = requestAnimationFrame(update);\n\t\t});\n\t\tro.observe(el);\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t\tro.disconnect();\n\t\t};\n\t}, [isOpen, sheetId, sheetStack]);\n\n\t// Animate position includes base position (0) plus any push offset\n\t// Only transform properties for GPU acceleration\n\tconst animatePosition = {\n\t\tx: pushOffset.x ?? 0,\n\t\ty: pushOffset.y ?? 0,\n\t};\n\n\t// Exit transition - slightly faster and snappier for physical feel\n\tconst exitTransition: Transition = {\n\t\ttype: 'tween',\n\t\tduration: durations.normal,\n\t\tease: easings.physicalExit,\n\t};\n\n\t// Helper to check if an event target is inside any sheet content\n\tconst isTargetInsideSheet = React.useCallback((target: EventTarget | null) => {\n\t\tif (!target || !(target instanceof HTMLElement)) return false;\n\t\treturn !!target.closest('[data-slot=\"sheet-content\"]');\n\t}, []);\n\n\t// Helper to allow interactions with portaled popups (select/dropdown/popover/tooltip)\n\t// These render outside the sheet DOM, but are still conceptually part of the sheet UI.\n\tconst isTargetInsidePopup = React.useCallback((target: EventTarget | null) => {\n\t\tif (!target || !(target instanceof HTMLElement)) return false;\n\t\treturn !!target.closest(\n\t\t\t[\n\t\t\t\t'[data-slot=\"select-popup\"]',\n\t\t\t\t'[data-slot=\"autocomplete-popup\"]',\n\t\t\t\t'[data-slot=\"dropdown-menu-content\"]',\n\t\t\t\t'[data-slot=\"dropdown-menu-sub-content\"]',\n\t\t\t\t'[data-slot=\"popover-content\"]',\n\t\t\t\t'[data-slot=\"tooltip-content\"]',\n\t\t\t].join(', '),\n\t\t);\n\t}, []);\n\n\t// Custom click-outside handler since Base UI doesn't have fine-grained event callbacks\n\tReact.useEffect(() => {\n\t\tif (!isOpen) return;\n\n\t\tconst handlePointerDown = (event: PointerEvent) => {\n\t\t\t// Ignore if there are sheets above this one\n\t\t\tif (sheetsAbove > 0) return;\n\n\t\t\tconst target = event.target;\n\t\t\tif (isTargetInsideSheet(target) || isTargetInsidePopup(target)) return;\n\n\t\t\t// Close this sheet when clicking outside\n\t\t\tclose();\n\t\t};\n\n\t\t// Use capture phase to handle before other handlers\n\t\tdocument.addEventListener('pointerdown', handlePointerDown);\n\t\treturn () => document.removeEventListener('pointerdown', handlePointerDown);\n\t}, [isOpen, sheetsAbove, isTargetInsideSheet, isTargetInsidePopup, close]);\n\n\treturn (\n\t\t<AnimatePresence>\n\t\t\t{isOpen && (\n\t\t\t\t<SheetPortal data-slot='sheet-portal'>\n\t\t\t\t\t{/* Only show overlay for the first (bottom-most) sheet in stack */}\n\t\t\t\t\t{overlay && depth === 0 && (\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tkey='sheet-overlay'\n\t\t\t\t\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\t\t\t\t\tclassName='fixed inset-0 bg-black/80'\n\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\texit={{ opacity: 0 }}\n\t\t\t\t\t\t\ttransition={{ duration: durations.fast, ease: 'easeOut' }}\n\t\t\t\t\t\t\tstyle={{ willChange: 'opacity', zIndex: 'var(--z-layer-modal-backdrop)' }}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<SheetPrimitive.Popup\n\t\t\t\t\t\tdata-slot=\"sheet-content\"\n\t\t\t\t\t\tdata-sheet-depth={depth}\n\t\t\t\t\t\tdata-sheet-id={sheetId}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\tkey={`sheet-content-${sheetId}`}\n\t\t\t\t\t\t\t\tref={contentRef}\n\t\t\t\t\t\t\t\tvariants={{\n\t\t\t\t\t\t\t\t\tinitial: getInitialPosition(resolvedSide),\n\t\t\t\t\t\t\t\t\tanimate: animatePosition,\n\t\t\t\t\t\t\t\t\texit: {\n\t\t\t\t\t\t\t\t\t\t...getExitPosition(resolvedSide),\n\t\t\t\t\t\t\t\t\t\ttransition: exitTransition,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tinitial='initial'\n\t\t\t\t\t\t\t\tanimate='animate'\n\t\t\t\t\t\t\t\texit='exit'\n\t\t\t\t\t\t\t\ttransition={transition}\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tzIndex,\n\t\t\t\t\t\t\t\t\twillChange: 'transform',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tclassName={cn(sheetVariants({ side: resolvedSide }), className)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* ModalPortalScope creates a scoped portal container for floating elements inside */}\n\t\t\t\t\t\t<ModalPortalScope>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</ModalPortalScope>\n\t\t\t\t\t\t{showClose && (\n\t\t\t\t\t\t\t<SheetPrimitive.Close\n\t\t\t\t\t\t\t\tdata-slot=\"sheet-close\"\n\t\t\t\t\t\t\t\tclassName='ring-offset-background focus:ring-ring data-[open]:bg-secondary absolute top-4 right-4\n\t\t\t\t\t\t\t\t\trounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2\n\t\t\t\t\t\t\t\t\tfocus:outline-none disabled:pointer-events-none'\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<X className='h-4 w-4' />\n\t\t\t\t\t\t\t\t<span className='sr-only'>Close</span>\n\t\t\t\t\t\t\t</SheetPrimitive.Close>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</SheetPrimitive.Popup>\n\t\t\t\t</SheetPortal>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n\ntype SheetHeaderProps = React.ComponentProps<'div'>;\n\nfunction SheetHeader({ className, ...props }: SheetHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-header\"\n\t\t\tclassName={cn('flex flex-col space-y-2 pb-4 text-center sm:text-left', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetFooterProps = React.ComponentProps<'div'>;\n\nfunction SheetFooter({ className, ...props }: SheetFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-footer\"\n\t\t\tclassName={cn('flex flex-col-reverse pt-4 sm:flex-row sm:justify-end sm:space-x-2', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetTitleProps = React.ComponentProps<typeof SheetPrimitive.Title>;\n\nfunction SheetTitle({ className, ...props }: SheetTitleProps) {\n\treturn (\n\t\t<SheetPrimitive.Title\n\t\t\tdata-slot=\"sheet-title\"\n\t\t\tclassName={cn('text-foreground text-lg font-semibold', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetDescriptionProps = React.ComponentProps<typeof SheetPrimitive.Description>;\n\nfunction SheetDescription({ className, ...props }: SheetDescriptionProps) {\n\treturn (\n\t\t<SheetPrimitive.Description\n\t\t\tdata-slot=\"sheet-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\t// Stack provider for nested sheets\n\tSheetStackProvider,\n\tuseSheetStack,\n\t// Individual sheet hooks\n\tuseSheet,\n\t// Components\n\tSheet,\n\tSheetPortal,\n\tSheetOverlay,\n\tSheetTrigger,\n\tSheetClose,\n\tSheetContent,\n\tSheetHeader,\n\tSheetFooter,\n\tSheetTitle,\n\tSheetDescription,\n\t// Constants\n\tSHEET_INDENT,\n\t// Types\n\ttype StackMode,\n\ttype SheetStackProviderProps,\n\ttype SheetProps,\n\ttype SheetPortalProps,\n\ttype SheetOverlayProps,\n\ttype SheetTriggerProps,\n\ttype SheetCloseProps,\n\ttype SheetContentProps,\n\ttype SheetHeaderProps,\n\ttype SheetFooterProps,\n\ttype SheetTitleProps,\n\ttype SheetDescriptionProps,\n};\n"]}