@constructive-io/ui 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/README.md +1 -1
  2. package/dist/{ai-CiaH2sfF.js → ai-B7XNnqYL.js} +1674 -228
  3. package/dist/ai-B7XNnqYL.js.map +1 -0
  4. package/dist/{ai-lAkichk8.cjs → ai-DJ-YPj8c.cjs} +1768 -226
  5. package/dist/ai-DJ-YPj8c.cjs.map +1 -0
  6. package/dist/{alert-BXuP0ayz.d.ts → alert-CJ4Qyk6W.d.cts} +4 -2
  7. package/dist/{alert-BXuP0ayz.d.cts → alert-CJ4Qyk6W.d.ts} +4 -2
  8. package/dist/components/accordion.cjs +60 -0
  9. package/dist/components/accordion.cjs.map +1 -0
  10. package/dist/components/accordion.d.cts +14 -0
  11. package/dist/components/accordion.d.ts +14 -0
  12. package/dist/components/accordion.js +54 -0
  13. package/dist/components/accordion.js.map +1 -0
  14. package/dist/components/ai/index.cjs +17 -1
  15. package/dist/components/ai/index.d.cts +2 -2
  16. package/dist/components/ai/index.d.ts +2 -2
  17. package/dist/components/ai/index.js +2 -2
  18. package/dist/components/alert-dialog.cjs +17 -8
  19. package/dist/components/alert-dialog.cjs.map +1 -1
  20. package/dist/components/alert-dialog.d.cts +1 -1
  21. package/dist/components/alert-dialog.d.ts +1 -1
  22. package/dist/components/alert-dialog.js +17 -8
  23. package/dist/components/alert-dialog.js.map +1 -1
  24. package/dist/components/alert.cjs +18 -8
  25. package/dist/components/alert.cjs.map +1 -1
  26. package/dist/components/alert.d.cts +2 -2
  27. package/dist/components/alert.d.ts +2 -2
  28. package/dist/components/alert.js +18 -9
  29. package/dist/components/alert.js.map +1 -1
  30. package/dist/components/autocomplete.cjs +9 -5
  31. package/dist/components/autocomplete.cjs.map +1 -1
  32. package/dist/components/autocomplete.js +9 -5
  33. package/dist/components/autocomplete.js.map +1 -1
  34. package/dist/components/avatar.cjs +9 -3
  35. package/dist/components/avatar.cjs.map +1 -1
  36. package/dist/components/avatar.d.cts +6 -0
  37. package/dist/components/avatar.d.ts +6 -0
  38. package/dist/components/avatar.js +9 -3
  39. package/dist/components/avatar.js.map +1 -1
  40. package/dist/components/badge.cjs +25 -18
  41. package/dist/components/badge.cjs.map +1 -1
  42. package/dist/components/badge.d.cts +2 -2
  43. package/dist/components/badge.d.ts +2 -2
  44. package/dist/components/badge.js +25 -18
  45. package/dist/components/badge.js.map +1 -1
  46. package/dist/components/breadcrumb.cjs +9 -6
  47. package/dist/components/breadcrumb.cjs.map +1 -1
  48. package/dist/components/breadcrumb.js +9 -6
  49. package/dist/components/breadcrumb.js.map +1 -1
  50. package/dist/components/button-group.cjs +57 -0
  51. package/dist/components/button-group.cjs.map +1 -0
  52. package/dist/components/button-group.d.cts +16 -0
  53. package/dist/components/button-group.d.ts +16 -0
  54. package/dist/components/button-group.js +51 -0
  55. package/dist/components/button-group.js.map +1 -0
  56. package/dist/components/button.cjs +59 -15
  57. package/dist/components/button.cjs.map +1 -1
  58. package/dist/components/button.d.cts +32 -2
  59. package/dist/components/button.d.ts +32 -2
  60. package/dist/components/button.js +59 -15
  61. package/dist/components/button.js.map +1 -1
  62. package/dist/components/calendar-rac.cjs +14 -8
  63. package/dist/components/calendar-rac.cjs.map +1 -1
  64. package/dist/components/calendar-rac.js +14 -8
  65. package/dist/components/calendar-rac.js.map +1 -1
  66. package/dist/components/card.cjs +35 -23
  67. package/dist/components/card.cjs.map +1 -1
  68. package/dist/components/card.d.cts +2 -1
  69. package/dist/components/card.d.ts +2 -1
  70. package/dist/components/card.js +35 -23
  71. package/dist/components/card.js.map +1 -1
  72. package/dist/components/checkbox.cjs +5 -5
  73. package/dist/components/checkbox.cjs.map +1 -1
  74. package/dist/components/checkbox.js +5 -5
  75. package/dist/components/checkbox.js.map +1 -1
  76. package/dist/components/collapsible.cjs +3 -3
  77. package/dist/components/collapsible.cjs.map +1 -1
  78. package/dist/components/collapsible.js +3 -3
  79. package/dist/components/collapsible.js.map +1 -1
  80. package/dist/components/combobox.cjs +24 -12
  81. package/dist/components/combobox.cjs.map +1 -1
  82. package/dist/components/combobox.d.cts +2 -1
  83. package/dist/components/combobox.d.ts +2 -1
  84. package/dist/components/combobox.js +24 -12
  85. package/dist/components/combobox.js.map +1 -1
  86. package/dist/components/command.cjs +25 -14
  87. package/dist/components/command.cjs.map +1 -1
  88. package/dist/components/command.d.cts +6 -2
  89. package/dist/components/command.d.ts +6 -2
  90. package/dist/components/command.js +25 -14
  91. package/dist/components/command.js.map +1 -1
  92. package/dist/components/dialog.cjs +22 -12
  93. package/dist/components/dialog.cjs.map +1 -1
  94. package/dist/components/dialog.d.cts +5 -2
  95. package/dist/components/dialog.d.ts +5 -2
  96. package/dist/components/dialog.js +22 -12
  97. package/dist/components/dialog.js.map +1 -1
  98. package/dist/components/dock.cjs +50 -27
  99. package/dist/components/dock.cjs.map +1 -1
  100. package/dist/components/dock.d.cts +1 -1
  101. package/dist/components/dock.d.ts +1 -1
  102. package/dist/components/dock.js +51 -28
  103. package/dist/components/dock.js.map +1 -1
  104. package/dist/components/drawer.cjs +22 -14
  105. package/dist/components/drawer.cjs.map +1 -1
  106. package/dist/components/drawer.js +22 -14
  107. package/dist/components/drawer.js.map +1 -1
  108. package/dist/components/dropdown-menu.cjs +34 -28
  109. package/dist/components/dropdown-menu.cjs.map +1 -1
  110. package/dist/components/dropdown-menu.d.cts +2 -2
  111. package/dist/components/dropdown-menu.d.ts +2 -2
  112. package/dist/components/dropdown-menu.js +52 -46
  113. package/dist/components/dropdown-menu.js.map +1 -1
  114. package/dist/components/empty.cjs +4 -4
  115. package/dist/components/empty.cjs.map +1 -1
  116. package/dist/components/empty.js +4 -4
  117. package/dist/components/empty.js.map +1 -1
  118. package/dist/components/field.cjs +33 -33
  119. package/dist/components/field.cjs.map +1 -1
  120. package/dist/components/field.d.cts +1 -1
  121. package/dist/components/field.d.ts +1 -1
  122. package/dist/components/field.js +34 -34
  123. package/dist/components/field.js.map +1 -1
  124. package/dist/components/flickering-grid.cjs +1 -1
  125. package/dist/components/flickering-grid.cjs.map +1 -1
  126. package/dist/components/flickering-grid.js +1 -1
  127. package/dist/components/flickering-grid.js.map +1 -1
  128. package/dist/components/flow-zoom-panel.cjs +10 -5
  129. package/dist/components/flow-zoom-panel.cjs.map +1 -1
  130. package/dist/components/flow-zoom-panel.d.cts +8 -1
  131. package/dist/components/flow-zoom-panel.d.ts +8 -1
  132. package/dist/components/flow-zoom-panel.js +10 -5
  133. package/dist/components/flow-zoom-panel.js.map +1 -1
  134. package/dist/components/form-control.cjs +12 -8
  135. package/dist/components/form-control.cjs.map +1 -1
  136. package/dist/components/form-control.js +12 -8
  137. package/dist/components/form-control.js.map +1 -1
  138. package/dist/components/form.cjs +5 -5
  139. package/dist/components/form.cjs.map +1 -1
  140. package/dist/components/form.js +5 -5
  141. package/dist/components/form.js.map +1 -1
  142. package/dist/components/input-group.cjs +13 -7
  143. package/dist/components/input-group.cjs.map +1 -1
  144. package/dist/components/input-group.d.cts +2 -2
  145. package/dist/components/input-group.d.ts +2 -2
  146. package/dist/components/input-group.js +11 -7
  147. package/dist/components/input-group.js.map +1 -1
  148. package/dist/components/input-otp.cjs +252 -0
  149. package/dist/components/input-otp.cjs.map +1 -0
  150. package/dist/components/input-otp.d.cts +44 -0
  151. package/dist/components/input-otp.d.ts +44 -0
  152. package/dist/components/input-otp.js +251 -0
  153. package/dist/components/input-otp.js.map +1 -0
  154. package/dist/components/input.cjs +10 -4
  155. package/dist/components/input.cjs.map +1 -1
  156. package/dist/components/input.d.cts +11 -2
  157. package/dist/components/input.d.ts +11 -2
  158. package/dist/components/input.js +10 -4
  159. package/dist/components/input.js.map +1 -1
  160. package/dist/components/item.cjs +151 -0
  161. package/dist/components/item.cjs.map +1 -0
  162. package/dist/components/item.d.cts +37 -0
  163. package/dist/components/item.d.ts +37 -0
  164. package/dist/components/item.js +137 -0
  165. package/dist/components/item.js.map +1 -0
  166. package/dist/components/json-input.cjs +4 -143
  167. package/dist/components/json-input.d.cts +6 -4
  168. package/dist/components/json-input.d.ts +6 -4
  169. package/dist/components/json-input.js +2 -140
  170. package/dist/components/kbd.cjs +35 -0
  171. package/dist/components/kbd.cjs.map +1 -0
  172. package/dist/components/kbd.d.cts +16 -0
  173. package/dist/components/kbd.d.ts +16 -0
  174. package/dist/components/kbd.js +31 -0
  175. package/dist/components/kbd.js.map +1 -0
  176. package/dist/components/label.cjs +3 -3
  177. package/dist/components/label.cjs.map +1 -1
  178. package/dist/components/label.js +3 -3
  179. package/dist/components/label.js.map +1 -1
  180. package/dist/components/motion-grid.cjs +20 -8
  181. package/dist/components/motion-grid.cjs.map +1 -1
  182. package/dist/components/motion-grid.js +20 -8
  183. package/dist/components/motion-grid.js.map +1 -1
  184. package/dist/components/multi-select.cjs +77 -67
  185. package/dist/components/multi-select.cjs.map +1 -1
  186. package/dist/components/multi-select.js +77 -67
  187. package/dist/components/multi-select.js.map +1 -1
  188. package/dist/components/page-header.cjs +12 -9
  189. package/dist/components/page-header.cjs.map +1 -1
  190. package/dist/components/page-header.js +12 -9
  191. package/dist/components/page-header.js.map +1 -1
  192. package/dist/components/pagination.cjs +10 -4
  193. package/dist/components/pagination.cjs.map +1 -1
  194. package/dist/components/pagination.d.cts +1 -1
  195. package/dist/components/pagination.d.ts +1 -1
  196. package/dist/components/pagination.js +10 -4
  197. package/dist/components/pagination.js.map +1 -1
  198. package/dist/components/phone-input.cjs +228 -0
  199. package/dist/components/phone-input.cjs.map +1 -0
  200. package/dist/components/phone-input.d.cts +42 -0
  201. package/dist/components/phone-input.d.ts +42 -0
  202. package/dist/components/phone-input.js +220 -0
  203. package/dist/components/phone-input.js.map +1 -0
  204. package/dist/components/popover.cjs +5 -4
  205. package/dist/components/popover.cjs.map +1 -1
  206. package/dist/components/popover.js +5 -4
  207. package/dist/components/popover.js.map +1 -1
  208. package/dist/components/progress.cjs +20 -3
  209. package/dist/components/progress.cjs.map +1 -1
  210. package/dist/components/progress.d.cts +1 -1
  211. package/dist/components/progress.d.ts +1 -1
  212. package/dist/components/progress.js +20 -3
  213. package/dist/components/progress.js.map +1 -1
  214. package/dist/components/progressive-blur-scroll-container.cjs +2 -2
  215. package/dist/components/progressive-blur-scroll-container.cjs.map +1 -1
  216. package/dist/components/progressive-blur-scroll-container.d.cts +1 -1
  217. package/dist/components/progressive-blur-scroll-container.d.ts +1 -1
  218. package/dist/components/progressive-blur-scroll-container.js +2 -2
  219. package/dist/components/progressive-blur-scroll-container.js.map +1 -1
  220. package/dist/components/progressive-blur.cjs +3 -2
  221. package/dist/components/progressive-blur.cjs.map +1 -1
  222. package/dist/components/progressive-blur.js +3 -2
  223. package/dist/components/progressive-blur.js.map +1 -1
  224. package/dist/components/radio-group.cjs +2 -2
  225. package/dist/components/radio-group.cjs.map +1 -1
  226. package/dist/components/radio-group.js +2 -2
  227. package/dist/components/radio-group.js.map +1 -1
  228. package/dist/components/record-picker.cjs +1 -1
  229. package/dist/components/record-picker.js +1 -1
  230. package/dist/components/resizable.cjs +2 -2
  231. package/dist/components/resizable.cjs.map +1 -1
  232. package/dist/components/resizable.js +2 -2
  233. package/dist/components/resizable.js.map +1 -1
  234. package/dist/components/responsive-diagram.cjs +43 -21
  235. package/dist/components/responsive-diagram.cjs.map +1 -1
  236. package/dist/components/responsive-diagram.d.cts +7 -1
  237. package/dist/components/responsive-diagram.d.ts +7 -1
  238. package/dist/components/responsive-diagram.js +43 -21
  239. package/dist/components/responsive-diagram.js.map +1 -1
  240. package/dist/components/scroll-area.cjs +2 -2
  241. package/dist/components/scroll-area.cjs.map +1 -1
  242. package/dist/components/scroll-area.js +2 -2
  243. package/dist/components/scroll-area.js.map +1 -1
  244. package/dist/components/select.cjs +84 -20
  245. package/dist/components/select.cjs.map +1 -1
  246. package/dist/components/select.d.cts +12 -7
  247. package/dist/components/select.d.ts +12 -7
  248. package/dist/components/select.js +84 -20
  249. package/dist/components/select.js.map +1 -1
  250. package/dist/components/separator.cjs +1 -1
  251. package/dist/components/separator.cjs.map +1 -1
  252. package/dist/components/separator.d.cts +11 -2
  253. package/dist/components/separator.d.ts +11 -2
  254. package/dist/components/separator.js +1 -1
  255. package/dist/components/separator.js.map +1 -1
  256. package/dist/components/sheet.cjs +1 -1
  257. package/dist/components/sheet.d.cts +11 -5
  258. package/dist/components/sheet.d.ts +12 -6
  259. package/dist/components/sheet.js +1 -1
  260. package/dist/components/sidebar.cjs +2 -1
  261. package/dist/components/sidebar.d.cts +7 -6
  262. package/dist/components/sidebar.d.ts +7 -6
  263. package/dist/components/sidebar.js +2 -1
  264. package/dist/components/slider.cjs +47 -0
  265. package/dist/components/slider.cjs.map +1 -0
  266. package/dist/components/slider.d.cts +8 -0
  267. package/dist/components/slider.d.ts +8 -0
  268. package/dist/components/slider.js +44 -0
  269. package/dist/components/slider.js.map +1 -0
  270. package/dist/components/sonner.cjs +15 -4
  271. package/dist/components/sonner.cjs.map +1 -1
  272. package/dist/components/sonner.d.cts +10 -1
  273. package/dist/components/sonner.d.ts +10 -1
  274. package/dist/components/sonner.js +16 -5
  275. package/dist/components/sonner.js.map +1 -1
  276. package/dist/components/spinner.cjs +25 -0
  277. package/dist/components/spinner.cjs.map +1 -0
  278. package/dist/components/spinner.d.cts +16 -0
  279. package/dist/components/spinner.d.ts +16 -0
  280. package/dist/components/spinner.js +22 -0
  281. package/dist/components/spinner.js.map +1 -0
  282. package/dist/components/stack/index.cjs +1 -1
  283. package/dist/components/stack/index.d.cts +1 -1
  284. package/dist/components/stack/index.d.ts +1 -1
  285. package/dist/components/stack/index.js +1 -1
  286. package/dist/components/stepper.cjs +23 -17
  287. package/dist/components/stepper.cjs.map +1 -1
  288. package/dist/components/stepper.d.cts +2 -2
  289. package/dist/components/stepper.d.ts +2 -2
  290. package/dist/components/stepper.js +23 -17
  291. package/dist/components/stepper.js.map +1 -1
  292. package/dist/components/switch.cjs +5 -5
  293. package/dist/components/switch.cjs.map +1 -1
  294. package/dist/components/switch.js +5 -5
  295. package/dist/components/switch.js.map +1 -1
  296. package/dist/components/table.cjs +26 -7
  297. package/dist/components/table.cjs.map +1 -1
  298. package/dist/components/table.d.cts +20 -2
  299. package/dist/components/table.d.ts +20 -2
  300. package/dist/components/table.js +26 -8
  301. package/dist/components/table.js.map +1 -1
  302. package/dist/components/tabs.cjs +61 -8
  303. package/dist/components/tabs.cjs.map +1 -1
  304. package/dist/components/tabs.d.cts +13 -2
  305. package/dist/components/tabs.d.ts +13 -2
  306. package/dist/components/tabs.js +63 -11
  307. package/dist/components/tabs.js.map +1 -1
  308. package/dist/components/tags.cjs +10 -5
  309. package/dist/components/tags.cjs.map +1 -1
  310. package/dist/components/tags.d.cts +1 -1
  311. package/dist/components/tags.d.ts +1 -1
  312. package/dist/components/tags.js +10 -5
  313. package/dist/components/tags.js.map +1 -1
  314. package/dist/components/textarea.cjs +5 -4
  315. package/dist/components/textarea.cjs.map +1 -1
  316. package/dist/components/textarea.js +5 -4
  317. package/dist/components/textarea.js.map +1 -1
  318. package/dist/components/toast/index.cjs +1 -1
  319. package/dist/components/toast/index.d.cts +2 -2
  320. package/dist/components/toast/index.d.ts +2 -2
  321. package/dist/components/toast/index.js +1 -1
  322. package/dist/components/toggle-group.cjs +69 -0
  323. package/dist/components/toggle-group.cjs.map +1 -0
  324. package/dist/components/toggle-group.d.cts +27 -0
  325. package/dist/components/toggle-group.d.ts +27 -0
  326. package/dist/components/toggle-group.js +65 -0
  327. package/dist/components/toggle-group.js.map +1 -0
  328. package/dist/components/toggle.cjs +54 -0
  329. package/dist/components/toggle.cjs.map +1 -0
  330. package/dist/components/toggle.d.cts +13 -0
  331. package/dist/components/toggle.d.ts +13 -0
  332. package/dist/components/toggle.js +50 -0
  333. package/dist/components/toggle.js.map +1 -0
  334. package/dist/components/tooltip.cjs +18 -6
  335. package/dist/components/tooltip.cjs.map +1 -1
  336. package/dist/components/tooltip.d.cts +1 -1
  337. package/dist/components/tooltip.d.ts +1 -1
  338. package/dist/components/tooltip.js +18 -6
  339. package/dist/components/tooltip.js.map +1 -1
  340. package/dist/components/unlink-button.cjs +2 -2
  341. package/dist/components/unlink-button.cjs.map +1 -1
  342. package/dist/components/unlink-button.d.cts +1 -0
  343. package/dist/components/unlink-button.d.ts +1 -0
  344. package/dist/components/unlink-button.js +2 -2
  345. package/dist/components/unlink-button.js.map +1 -1
  346. package/dist/components/workspace-kit/index.cjs +1477 -0
  347. package/dist/components/workspace-kit/index.cjs.map +1 -0
  348. package/dist/components/workspace-kit/index.d.cts +716 -0
  349. package/dist/components/workspace-kit/index.d.ts +716 -0
  350. package/dist/components/workspace-kit/index.js +1410 -0
  351. package/dist/components/workspace-kit/index.js.map +1 -0
  352. package/dist/compose-refs-Mbma1O3M.js +47 -0
  353. package/dist/compose-refs-Mbma1O3M.js.map +1 -0
  354. package/dist/compose-refs-uPrvNoiU.cjs +52 -0
  355. package/dist/compose-refs-uPrvNoiU.cjs.map +1 -0
  356. package/dist/fluid-highlight-AW-OITqJ.cjs +124 -0
  357. package/dist/fluid-highlight-AW-OITqJ.cjs.map +1 -0
  358. package/dist/fluid-highlight-DxWeZ7iu.js +119 -0
  359. package/dist/fluid-highlight-DxWeZ7iu.js.map +1 -0
  360. package/dist/{index-BzLmDsId.d.cts → index-B7cT7gZU.d.cts} +3 -3
  361. package/dist/{index-BzLmDsId.d.ts → index-B7cT7gZU.d.ts} +3 -3
  362. package/dist/{index-UnM04j0t.d.ts → index-BQZxmMpw.d.cts} +11 -31
  363. package/dist/{index-UnM04j0t.d.cts → index-BQZxmMpw.d.ts} +11 -31
  364. package/dist/{index-B0wXxIAb.d.ts → index-CiO-3M_X.d.cts} +334 -18
  365. package/dist/{index-CyaFaZe2.d.cts → index-z3LqQ5L5.d.ts} +334 -18
  366. package/dist/index.cjs +107 -17
  367. package/dist/index.d.cts +64 -14
  368. package/dist/index.d.ts +64 -14
  369. package/dist/index.js +27 -14
  370. package/dist/initial-focus-B8RLtyOZ.cjs +67 -0
  371. package/dist/initial-focus-B8RLtyOZ.cjs.map +1 -0
  372. package/dist/initial-focus-j2E0EnIx.js +61 -0
  373. package/dist/initial-focus-j2E0EnIx.js.map +1 -0
  374. package/dist/initials-DSkWTOb0.cjs +127 -0
  375. package/dist/initials-DSkWTOb0.cjs.map +1 -0
  376. package/dist/initials-kCcHgrSy.js +97 -0
  377. package/dist/initials-kCcHgrSy.js.map +1 -0
  378. package/dist/json-input-CH5aEmoA.js +293 -0
  379. package/dist/json-input-CH5aEmoA.js.map +1 -0
  380. package/dist/json-input-D8yM578l.cjs +311 -0
  381. package/dist/json-input-D8yM578l.cjs.map +1 -0
  382. package/dist/{motion-config-COCFHq1L.cjs → motion-config-DZ7w5Uhq.cjs} +32 -2
  383. package/dist/motion-config-DZ7w5Uhq.cjs.map +1 -0
  384. package/dist/{motion-config-COsZ6azM.js → motion-config-DoFp4I8f.js} +21 -3
  385. package/dist/motion-config-DoFp4I8f.js.map +1 -0
  386. package/dist/{record-picker-Bz4FApxD.cjs → record-picker-BQ1-Vx0g.cjs} +23 -8
  387. package/dist/record-picker-BQ1-Vx0g.cjs.map +1 -0
  388. package/dist/{record-picker-BbxngCeV.js → record-picker-DSRo4RXV.js} +23 -8
  389. package/dist/record-picker-DSRo4RXV.js.map +1 -0
  390. package/dist/{sheet-BdA0rfIz.cjs → sheet-OxWlnT_G.cjs} +25 -32
  391. package/dist/sheet-OxWlnT_G.cjs.map +1 -0
  392. package/dist/{sheet-BLHnhLRH.js → sheet-wPF_l9Cn.js} +25 -32
  393. package/dist/sheet-wPF_l9Cn.js.map +1 -0
  394. package/dist/{sidebar-BavjjJp0.cjs → sidebar-BEEWmJwC.cjs} +74 -57
  395. package/dist/sidebar-BEEWmJwC.cjs.map +1 -0
  396. package/dist/{sidebar-DeoL2ttp.js → sidebar-DWl1Azyv.js} +74 -57
  397. package/dist/sidebar-DWl1Azyv.js.map +1 -0
  398. package/dist/{stack-ci2lkfkr.cjs → stack-CEvmUSwF.cjs} +12 -10
  399. package/dist/stack-CEvmUSwF.cjs.map +1 -0
  400. package/dist/{stack-C9GROTGA.js → stack-Kqu7YaR0.js} +12 -10
  401. package/dist/stack-Kqu7YaR0.js.map +1 -0
  402. package/dist/text-runs-CdmlS5C7.cjs +52 -0
  403. package/dist/text-runs-CdmlS5C7.cjs.map +1 -0
  404. package/dist/text-runs-DqcEO8L_.js +45 -0
  405. package/dist/text-runs-DqcEO8L_.js.map +1 -0
  406. package/dist/theme-DTTTlylA.d.cts +520 -0
  407. package/dist/theme-DTTTlylA.d.ts +520 -0
  408. package/dist/theme-dials-config.cjs +273 -0
  409. package/dist/theme-dials-config.cjs.map +1 -0
  410. package/dist/theme-dials-config.d.cts +95 -0
  411. package/dist/theme-dials-config.d.ts +95 -0
  412. package/dist/theme-dials-config.js +269 -0
  413. package/dist/theme-dials-config.js.map +1 -0
  414. package/dist/theme-presets.cjs +922 -0
  415. package/dist/theme-presets.cjs.map +1 -0
  416. package/dist/theme-presets.d.cts +89 -0
  417. package/dist/theme-presets.d.ts +89 -0
  418. package/dist/theme-presets.js +912 -0
  419. package/dist/theme-presets.js.map +1 -0
  420. package/dist/theme-tuning-DjgDvV8V.d.ts +158 -0
  421. package/dist/theme-tuning-TJ76tnxZ.d.cts +158 -0
  422. package/dist/theme-tuning.cjs +349 -0
  423. package/dist/theme-tuning.cjs.map +1 -0
  424. package/dist/theme-tuning.d.cts +2 -0
  425. package/dist/theme-tuning.d.ts +2 -0
  426. package/dist/theme-tuning.js +333 -0
  427. package/dist/theme-tuning.js.map +1 -0
  428. package/dist/theme.cjs +432 -0
  429. package/dist/theme.cjs.map +1 -0
  430. package/dist/theme.d.cts +2 -0
  431. package/dist/theme.d.ts +2 -0
  432. package/dist/theme.js +430 -0
  433. package/dist/theme.js.map +1 -0
  434. package/dist/toast-08jF1DBQ.cjs +193 -0
  435. package/dist/toast-08jF1DBQ.cjs.map +1 -0
  436. package/dist/toast-CVW5XY4u.js +164 -0
  437. package/dist/toast-CVW5XY4u.js.map +1 -0
  438. package/dist/toast-details-BdxxSLlN.cjs +209 -0
  439. package/dist/toast-details-BdxxSLlN.cjs.map +1 -0
  440. package/dist/toast-details-CfsB1Vxb.js +198 -0
  441. package/dist/toast-details-CfsB1Vxb.js.map +1 -0
  442. package/dist/{tooltip-CTRQoN1A.d.ts → tooltip-Fqb4JK-g.d.cts} +2 -2
  443. package/dist/{tooltip-CTRQoN1A.d.cts → tooltip-Fqb4JK-g.d.ts} +2 -2
  444. package/dist/tuning-BKVFsxLr.js +48 -0
  445. package/dist/tuning-BKVFsxLr.js.map +1 -0
  446. package/dist/tuning-BRPG7U1U.cjs +71 -0
  447. package/dist/tuning-BRPG7U1U.cjs.map +1 -0
  448. package/dist/use-document-theme-BSEuNsEE.cjs +43 -0
  449. package/dist/use-document-theme-BSEuNsEE.cjs.map +1 -0
  450. package/dist/use-document-theme-Ch_PqxZz.js +38 -0
  451. package/dist/use-document-theme-Ch_PqxZz.js.map +1 -0
  452. package/dist/use-scroll-fade-CaHp52u4.cjs +79 -0
  453. package/dist/use-scroll-fade-CaHp52u4.cjs.map +1 -0
  454. package/dist/use-scroll-fade-ilq-o00-.js +72 -0
  455. package/dist/use-scroll-fade-ilq-o00-.js.map +1 -0
  456. package/package.json +163 -27
  457. package/src/styles/globals.css +176 -97
  458. package/dist/ai-CiaH2sfF.js.map +0 -1
  459. package/dist/ai-lAkichk8.cjs.map +0 -1
  460. package/dist/button-Bvh83YGs.d.cts +0 -20
  461. package/dist/button-Bvh83YGs.d.ts +0 -20
  462. package/dist/components/app-bar.cjs +0 -81
  463. package/dist/components/app-bar.cjs.map +0 -1
  464. package/dist/components/app-bar.d.cts +0 -27
  465. package/dist/components/app-bar.d.ts +0 -27
  466. package/dist/components/app-bar.js +0 -77
  467. package/dist/components/app-bar.js.map +0 -1
  468. package/dist/components/app-shell.cjs +0 -267
  469. package/dist/components/app-shell.cjs.map +0 -1
  470. package/dist/components/app-shell.d.cts +0 -98
  471. package/dist/components/app-shell.d.ts +0 -98
  472. package/dist/components/app-shell.js +0 -264
  473. package/dist/components/app-shell.js.map +0 -1
  474. package/dist/components/json-input.cjs.map +0 -1
  475. package/dist/components/json-input.js.map +0 -1
  476. package/dist/input-CBrCuMH8.d.cts +0 -11
  477. package/dist/input-CBrCuMH8.d.ts +0 -11
  478. package/dist/motion-config-COCFHq1L.cjs.map +0 -1
  479. package/dist/motion-config-COsZ6azM.js.map +0 -1
  480. package/dist/record-picker-BbxngCeV.js.map +0 -1
  481. package/dist/record-picker-Bz4FApxD.cjs.map +0 -1
  482. package/dist/separator-BQEsr0Rc.d.cts +0 -11
  483. package/dist/separator-BQEsr0Rc.d.ts +0 -11
  484. package/dist/sheet-BLHnhLRH.js.map +0 -1
  485. package/dist/sheet-BdA0rfIz.cjs.map +0 -1
  486. package/dist/sidebar-BavjjJp0.cjs.map +0 -1
  487. package/dist/sidebar-DeoL2ttp.js.map +0 -1
  488. package/dist/stack-C9GROTGA.js.map +0 -1
  489. package/dist/stack-ci2lkfkr.cjs.map +0 -1
  490. package/dist/toast-D6MqijT2.cjs +0 -316
  491. package/dist/toast-D6MqijT2.cjs.map +0 -1
  492. package/dist/toast-D_BOLzm3.js +0 -287
  493. package/dist/toast-D_BOLzm3.js.map +0 -1
@@ -29,23 +29,38 @@ function useDebounce(value, delay) {
29
29
 
30
30
  //#endregion
31
31
  //#region src/components/record-picker.tsx
32
- function RecordPicker({ records, linkedRecordIds, onLink, isLinking, getRecordLabel, getRecordId, searchFields = [
32
+ const DEFAULT_SEARCH_FIELDS = [
33
33
  "name",
34
34
  "title",
35
35
  "label"
36
- ], placeholder = "Search records...", maxHeight = "300px" }) {
36
+ ];
37
+ const NO_LABELS = [];
38
+ /** Keeps the same array while its items are unchanged, so a memo keyed on it does not run again for an equal one. */
39
+ function useStableArray(next) {
40
+ const [stable, setStable] = useState(next);
41
+ if (stable === next || stable.length === next.length && stable.every((item, index) => item === next[index])) return stable;
42
+ setStable(next);
43
+ return next;
44
+ }
45
+ function RecordPicker({ records, linkedRecordIds, onLink, isLinking, getRecordLabel, getRecordId, searchFields = DEFAULT_SEARCH_FIELDS, placeholder = "Search records...", maxHeight = "300px" }) {
37
46
  const [searchQuery, setSearchQuery] = useState("");
38
47
  const debouncedSearchQuery = useDebounce(searchQuery, 300);
48
+ const searching = debouncedSearchQuery.trim() !== "";
49
+ const labels = useStableArray(searching ? records.map((record) => String(getRecordLabel(record) ?? "")) : NO_LABELS);
50
+ const fields = useStableArray(searchFields);
39
51
  const filteredRecords = useMemo(() => {
40
- if (!debouncedSearchQuery.trim()) return records;
52
+ if (!searching) return records;
53
+ const labelOf = new Map(records.map((record, index) => [record, labels[index]]));
41
54
  return matchSorter(records, debouncedSearchQuery, {
42
- keys: searchFields,
55
+ keys: [...fields, (record) => labelOf.get(record) ?? ""],
43
56
  threshold: matchSorter.rankings.CONTAINS
44
57
  });
45
58
  }, [
46
59
  records,
47
60
  debouncedSearchQuery,
48
- searchFields
61
+ searching,
62
+ fields,
63
+ labels
49
64
  ]);
50
65
  const { linkedRecords, unlinkableRecords } = useMemo(() => {
51
66
  const linked = [];
@@ -77,7 +92,7 @@ function RecordPicker({ records, linkedRecordIds, onLink, isLinking, getRecordLa
77
92
  style: { maxHeight },
78
93
  className: "scrollbar-neutral-thin",
79
94
  children: /* @__PURE__ */ jsxs("div", {
80
- className: "space-y-2 pr-2",
95
+ className: "space-y-2 pe-2",
81
96
  children: [
82
97
  unlinkableRecords.length > 0 && /* @__PURE__ */ jsxs("div", {
83
98
  className: "space-y-1",
@@ -92,7 +107,7 @@ function RecordPicker({ records, linkedRecordIds, onLink, isLinking, getRecordLa
92
107
  const recordId = getRecordId(record);
93
108
  const label = getRecordLabel(record);
94
109
  return /* @__PURE__ */ jsxs("div", {
95
- className: "hover:bg-muted/50 flex items-center space-x-3 rounded-md p-2 transition-colors",
110
+ className: "hover:bg-muted/50 flex items-center space-x-3 rounded-md p-2",
96
111
  children: [
97
112
  /* @__PURE__ */ jsx(Checkbox, {
98
113
  id: `record-${recordId}`,
@@ -159,4 +174,4 @@ function RecordPicker({ records, linkedRecordIds, onLink, isLinking, getRecordLa
159
174
 
160
175
  //#endregion
161
176
  export { RecordPicker as t };
162
- //# sourceMappingURL=record-picker-BbxngCeV.js.map
177
+ //# sourceMappingURL=record-picker-DSRo4RXV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-picker-DSRo4RXV.js","names":[],"sources":["../src/lib/use-debounce.ts","../src/components/record-picker.tsx"],"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","'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\n// Module-level so the default keeps one identity and the filter memo below is not recomputed on every render.\nconst DEFAULT_SEARCH_FIELDS = ['name', 'title', 'label'];\nconst NO_LABELS: readonly string[] = [];\n\n/** Keeps the same array while its items are unchanged, so a memo keyed on it does not run again for an equal one. */\nfunction useStableArray<T>(next: readonly T[]): readonly T[] {\n\tconst [stable, setStable] = useState(next);\n\tif (stable === next || (stable.length === next.length && stable.every((item, index) => item === next[index]))) return stable;\n\t// Adjusting state while rendering: React re-renders at once, before anything is committed, and no ref is involved.\n\tsetStable(next);\n\treturn next;\n}\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 = DEFAULT_SEARCH_FIELDS,\n\tplaceholder = 'Search records...',\n\tmaxHeight = '300px',\n}: RecordPickerProps) {\n\tconst [searchQuery, setSearchQuery] = useState('');\n\tconst debouncedSearchQuery = useDebounce(searchQuery, 300);\n\n\tconst searching = debouncedSearchQuery.trim() !== '';\n\t// The text each row shows, read only while a search runs. Hosts usually pass `getRecordLabel` inline, so it is a new\n\t// function on every render; comparing the labels it returns keeps the much heavier search from running again for nothing.\n\tconst labels = useStableArray(searching ? records.map((record) => String(getRecordLabel(record) ?? '')) : NO_LABELS);\n\tconst fields = useStableArray(searchFields);\n\n\t// Filter records based on search query\n\tconst filteredRecords = useMemo(() => {\n\t\tif (!searching) {\n\t\t\treturn records;\n\t\t}\n\n\t\t// The row's own label is always searchable, so a query can never miss text the user can see.\n\t\tconst labelOf = new Map(records.map((record, index) => [record, labels[index]]));\n\t\treturn matchSorter(records, debouncedSearchQuery, {\n\t\t\tkeys: [...fields, (record: any) => labelOf.get(record) ?? ''],\n\t\t\tthreshold: matchSorter.rankings.CONTAINS,\n\t\t});\n\t}, [records, debouncedSearchQuery, searching, fields, labels]);\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 pe-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'\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"],"mappings":";;;;;;;;;;;;;;;;AAQA,SAAgB,YAAe,OAAU,OAAkB;CAC1D,MAAM,CAAC,gBAAgB,qBAAqB,SAAY,KAAK;CAE7D,gBAAgB;EACf,MAAM,UAAU,iBAAiB;GAChC,kBAAkB,KAAK;EACxB,GAAG,KAAK;EAER,aAAa;GACZ,aAAa,OAAO;EACrB;CACD,GAAG,CAAC,OAAO,KAAK,CAAC;CAEjB,OAAO;AACR;;;;ACVA,MAAM,wBAAwB;CAAC;CAAQ;CAAS;AAAO;AACvD,MAAM,YAA+B,CAAC;;AAGtC,SAAS,eAAkB,MAAkC;CAC5D,MAAM,CAAC,QAAQ,aAAa,SAAS,IAAI;CACzC,IAAI,WAAW,Q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gBAAgB,WAAW,KAC3B,qBAAC,OAAD;MAAK,WAAU;gBAAf,CACC,oBAAC,cAAD,EAAc,WAAU,kCAAmC,IAC3D,oBAAC,KAAD;OAAG,WAAU;iBAAW,cAAc,iCAAiC;MAA0B,EAC7F;;KAIL,gBAAgB,SAAS,KAAK,kBAAkB,WAAW,KAC3D,qBAAC,OAAD;MAAK,WAAU;gBAAf,CACC,oBAAC,aAAD,EAAa,WAAU,kCAAmC,IAC1D,oBAAC,KAAD;OAAG,WAAU;iBAAU;MAA0C,EAC7D;;IAEF;;EACM,EACR;;AAEP"}
@@ -1,15 +1,17 @@
1
1
  'use client';
2
2
  const require_rolldown_runtime = require('./rolldown-runtime-D_qnwXdH.cjs');
3
3
  const require_utils = require('./utils-CzTQ3-VI.cjs');
4
- const require_motion_config = require('./motion-config-COCFHq1L.cjs');
4
+ const require_motion_config = require('./motion-config-DZ7w5Uhq.cjs');
5
+ const require_tuning = require('./tuning-BRPG7U1U.cjs');
6
+ const require_initial_focus = require('./initial-focus-B8RLtyOZ.cjs');
5
7
  let react = require("react");
6
8
  react = require_rolldown_runtime.__toESM(react, 1);
7
9
  let react_jsx_runtime = require("react/jsx-runtime");
8
10
  let class_variance_authority = require("class-variance-authority");
9
11
  let lucide_react = require("lucide-react");
12
+ let motion_react = require("motion/react");
10
13
  let _constructive_io_ui_portal = require("@constructive-io/ui/portal");
11
14
  let _base_ui_react_dialog = require("@base-ui/react/dialog");
12
- let motion_react = require("motion/react");
13
15
 
14
16
  //#region src/lib/use-controllable-state.ts
15
17
  /**
@@ -216,14 +218,14 @@ function SheetPortal({ forceMount: _forceMount, container: containerProp, ...pro
216
218
  function SheetOverlay({ className, asChild: _asChild, forceMount: _forceMount, ...props }) {
217
219
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Backdrop, {
218
220
  "data-slot": "sheet-overlay",
219
- className: require_utils.cn("fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/80", className),
221
+ className: require_utils.cn("fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/32 backdrop-blur-sm", className),
220
222
  ...props
221
223
  });
222
224
  }
223
- const sheetVariants = (0, class_variance_authority.cva)("fixed flex flex-col gap-3 bg-background p-4 shadow-lg", {
225
+ const sheetVariants = (0, class_variance_authority.cva)("fixed flex flex-col gap-3 overflow-y-auto overscroll-contain bg-background p-4 shadow-lg outline-hidden [overflow-wrap:break-word]", {
224
226
  variants: { side: {
225
- top: "inset-x-0 top-0 border-b",
226
- bottom: "inset-x-0 bottom-0 border-t",
227
+ top: "inset-x-0 top-0 max-h-dvh border-b",
228
+ bottom: "inset-x-0 bottom-0 max-h-dvh border-t",
227
229
  left: "inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
228
230
  right: "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"
229
231
  } },
@@ -282,18 +284,9 @@ function getExitPosition(side) {
282
284
  case "bottom": return { y: "100%" };
283
285
  }
284
286
  }
285
- const defaultSheetTransition = {
286
- type: "tween",
287
- duration: require_motion_config.durations.normal,
288
- ease: [
289
- .32,
290
- .72,
291
- 0,
292
- 1
293
- ]
294
- };
295
- function SheetContent({ side = "right", className, transition = defaultSheetTransition, overlay = true, showClose = true, children, forceMount: _forceMount, onInteractOutside: _onInteractOutside, onPointerDownOutside: _onPointerDownOutside, onEscapeKeyDown: _onEscapeKeyDown, onFocusOutside: _onFocusOutside, ...props }) {
287
+ function SheetContent({ side = "right", className, transition, overlay = true, showClose = true, children, forceMount: _forceMount, onInteractOutside: _onInteractOutside, onPointerDownOutside: _onPointerDownOutside, onEscapeKeyDown: _onEscapeKeyDown, onFocusOutside: _onFocusOutside, initialFocus, ...props }) {
296
288
  const { isOpen, depth, sheetId } = useSheet();
289
+ const springTiers = require_tuning.useSpringTiers();
297
290
  const sheetStack = useSheetStack();
298
291
  const sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;
299
292
  const stackMode = sheetStack?.stackMode ?? "cascade";
@@ -336,11 +329,8 @@ function SheetContent({ side = "right", className, transition = defaultSheetTran
336
329
  x: pushOffset.x ?? 0,
337
330
  y: pushOffset.y ?? 0
338
331
  };
339
- const exitTransition = {
340
- type: "tween",
341
- duration: require_motion_config.durations.normal,
342
- ease: require_motion_config.easings.physicalExit
343
- };
332
+ const enterTransition = transition ?? require_motion_config.tierSpring(springTiers.slow);
333
+ const exitTransition = require_motion_config.tierExit(springTiers.slow);
344
334
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.AnimatePresence, {
345
335
  initial: false,
346
336
  children: isOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SheetPortal, {
@@ -348,13 +338,13 @@ function SheetContent({ side = "right", className, transition = defaultSheetTran
348
338
  children: [overlay && depth === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Backdrop, {
349
339
  "data-slot": "sheet-overlay",
350
340
  render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.motion.div, {
351
- className: "fixed inset-0 bg-black/80",
341
+ className: "fixed inset-0 bg-black/32 backdrop-blur-sm",
352
342
  initial: { opacity: 0 },
353
343
  animate: { opacity: 1 },
354
344
  exit: { opacity: 0 },
355
345
  transition: {
356
- duration: require_motion_config.durations.fast,
357
- ease: "easeOut"
346
+ duration: springTiers.moderate.duration,
347
+ ease: require_motion_config.easings.easeOut
358
348
  },
359
349
  style: { zIndex: "var(--z-layer-modal-backdrop)" }
360
350
  }, "sheet-overlay")
@@ -362,6 +352,7 @@ function SheetContent({ side = "right", className, transition = defaultSheetTran
362
352
  "data-slot": "sheet-content",
363
353
  "data-sheet-depth": depth,
364
354
  "data-sheet-id": sheetId,
355
+ initialFocus: initialFocus ?? require_initial_focus.scrollSafeInitialFocus(() => contentRef.current),
365
356
  ...props,
366
357
  render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.motion.div, {
367
358
  ref: contentRef,
@@ -376,13 +367,13 @@ function SheetContent({ side = "right", className, transition = defaultSheetTran
376
367
  initial: "initial",
377
368
  animate: "animate",
378
369
  exit: "exit",
379
- transition,
370
+ transition: enterTransition,
380
371
  style: { zIndex },
381
372
  className: require_utils.cn(sheetVariants({ side: resolvedSide }), className)
382
373
  }, `sheet-content-${sheetId}`),
383
374
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_constructive_io_ui_portal.ModalPortalScope, { children }), showClose && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_dialog.Dialog.Close, {
384
375
  "data-slot": "sheet-close",
385
- className: "ring-offset-background focus:ring-ring data-[open]:bg-secondary absolute top-4 right-4\n rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2\n focus:outline-none disabled:pointer-events-none",
376
+ className: "data-[open]:bg-secondary absolute top-4 end-4\n rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50\n disabled:pointer-events-none",
386
377
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "h-4 w-4" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
387
378
  className: "sr-only",
388
379
  children: "Close"
@@ -392,17 +383,19 @@ function SheetContent({ side = "right", className, transition = defaultSheetTran
392
383
  })
393
384
  });
394
385
  }
395
- function SheetHeader({ className, ...props }) {
386
+ function SheetHeader({ className, variant = "default", ...props }) {
396
387
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
397
388
  "data-slot": "sheet-header",
398
- className: require_utils.cn("flex flex-col space-y-2 pb-4 text-center sm:text-left", className),
389
+ "data-variant": variant,
390
+ className: require_utils.cn("flex flex-col space-y-2", variant === "default" && "pb-4 pe-6 text-center sm:text-start", variant === "band" && "-mx-4 -mt-4 border-b bg-muted/50 p-4 pe-12 text-start", className),
399
391
  ...props
400
392
  });
401
393
  }
402
- function SheetFooter({ className, ...props }) {
394
+ function SheetFooter({ className, variant = "default", ...props }) {
403
395
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
404
396
  "data-slot": "sheet-footer",
405
- className: require_utils.cn("flex flex-col-reverse pt-4 sm:flex-row sm:justify-end sm:space-x-2", className),
397
+ "data-variant": variant,
398
+ className: require_utils.cn("flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end", variant === "default" && "pt-4", variant === "band" && "-mx-4 mt-auto -mb-4 border-t bg-muted/50 px-4 py-3", className),
406
399
  ...props
407
400
  });
408
401
  }
@@ -512,4 +505,4 @@ Object.defineProperty(exports, 'useSheetStack', {
512
505
  return useSheetStack;
513
506
  }
514
507
  });
515
- //# sourceMappingURL=sheet-BdA0rfIz.cjs.map
508
+ //# sourceMappingURL=sheet-OxWlnT_G.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet-OxWlnT_G.cjs","names":["React","SheetPrimitive","cn","useSpringTiers","tierSpring","tierExit","AnimatePresence","motion","easings","scrollSafeInitialFocus","ModalPortalScope","X"],"sources":["../src/lib/use-controllable-state.ts","../src/components/sheet.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\ntype UseControllableStateParams<T> = {\n\tprop?: T;\n\tdefaultProp?: T;\n\tonChange?: (value: T) => void;\n};\n\n/**\n * Hook for managing controlled/uncontrolled state.\n * Supports both controlled (prop-driven) and uncontrolled (internal state) patterns.\n */\nexport function useControllableState<T>({\n\tprop,\n\tdefaultProp,\n\tonChange,\n}: UseControllableStateParams<T>): [T, (value: T) => void] {\n\tconst [uncontrolledValue, setUncontrolledValue] = useState<T>(defaultProp as T);\n\tconst isControlled = prop !== undefined;\n\tconst value = isControlled ? prop : uncontrolledValue;\n\n\t// Store onChange in ref to keep callback stable\n\tconst onChangeRef = useRef(onChange);\n\tuseEffect(() => {\n\t\tonChangeRef.current = onChange;\n\t}, [onChange]);\n\n\tconst setValue = useCallback(\n\t\t(newValue: T) => {\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledValue(newValue);\n\t\t\t}\n\t\t\tonChangeRef.current?.(newValue);\n\t\t},\n\t\t[isControlled],\n\t);\n\n\treturn [value, setValue];\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 { scrollSafeInitialFocus } from '../lib/initial-focus';\nimport { easings, tierExit, tierSpring } from '../lib/motion/motion-config';\nimport { useSpringTiers } from '../lib/motion/tuning';\nimport { useControllableState } from '../lib/use-controllable-state';\nimport { ModalPortalScope, useRootPortalContainer } from '@constructive-io/ui/portal';\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// 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\tconst isTopSheet = React.useCallback((id: string) => {\n\t\tif (sheets.length === 0) return false;\n\t\treturn sheets[sheets.length - 1]?.id === id;\n\t}, [sheets]);\n\n\t// Sheets above = sheets with higher depth than this one\n\tconst getSheetsAbove = React.useCallback((id: string) => {\n\t\tconst index = sheets.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 sheets.length - index - 1;\n\t}, [sheets]);\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\nfunction Sheet({\n\tchildren,\n\tsheetId: providedId,\n\topen: openProp,\n\tdefaultOpen = false,\n\tonOpenChange,\n\tmodal,\n\t...props\n}: SheetProps) {\n\tconst [isOpen, setIsOpen] = useControllableState({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen,\n\t\tonChange: onOpenChange,\n\t});\n\tconst sheetStack = useSheetStack();\n\tconst nesting = useSheetNesting();\n\tconst generatedId = React.useId();\n\tconst sheetId = providedId ?? `sheet-${generatedId.replace(/:/g, '')}`;\n\n\t// Depth is determined by nesting level in React tree\n\tconst depth = nesting.level;\n\n\tconst close = React.useCallback(() => {\n\t\tsetIsOpen(false);\n\t}, [setIsOpen]);\n\n\tconst registerSheet = sheetStack?.registerSheet;\n\tconst unregisterSheet = sheetStack?.unregisterSheet;\n\n\t// Register/unregister with stack when open state changes\n\tReact.useEffect(() => {\n\t\tif (registerSheet && 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\tregisterSheet({ id: sheetId, depth, close });\n\t\t\treturn () => unregisterSheet?.(sheetId);\n\t\t}\n\t}, [isOpen, sheetId, depth, close, registerSheet, unregisterSheet]);\n\n\t// Base UI owns dismissal details; this adapter preserves the package's boolean callback.\n\tconst handleOpenChange = React.useCallback((open: boolean, _eventDetails: DialogChangeEventDetails) => {\n\t\tsetIsOpen(open);\n\t}, [setIsOpen]);\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 : 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 = React.ComponentProps<typeof SheetPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetTrigger({ asChild, children, render, nativeButton, ...props }: SheetTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Trigger\n\t\t\tdata-slot=\"sheet-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</SheetPrimitive.Trigger>\n\t);\n}\n\ntype SheetCloseProps = React.ComponentProps<typeof SheetPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetClose({ asChild, children, render, nativeButton, ...props }: SheetCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Close\n\t\t\tdata-slot=\"sheet-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : 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, container: containerProp, ...props }: SheetPortalProps) {\n\tconst rootContainer = useRootPortalContainer();\n\tconst container = containerProp === undefined ? (rootContainer ?? undefined) : containerProp;\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/32 backdrop-blur-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// The panel scrolls itself: content taller than the viewport used to be clipped with no way to reach it. Callers that manage their own\n// scroll region (a `flex-1 min-h-0 overflow-y-auto` body) are unaffected because the sheet then never overflows.\nconst sheetVariants = cva('fixed flex flex-col gap-3 overflow-y-auto overscroll-contain bg-background p-4 shadow-lg outline-hidden [overflow-wrap:break-word]', {\n\tvariants: {\n\t\tside: {\n\t\t\ttop: 'inset-x-0 top-0 max-h-dvh border-b',\n\t\t\tbottom: 'inset-x-0 bottom-0 max-h-dvh 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\nfunction SheetContent({\n\tside = 'right',\n\tclassName,\n\ttransition,\n\toverlay = true,\n\tshowClose = true,\n\tchildren,\n\tforceMount: _forceMount,\n\tonInteractOutside: _onInteractOutside,\n\tonPointerDownOutside: _onPointerDownOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\tonFocusOutside: _onFocusOutside,\n\tinitialFocus,\n\t...props\n}: SheetContentProps) {\n\tconst { isOpen, depth, sheetId } = useSheet();\n\tconst springTiers = useSpringTiers();\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// Enter rides the slow spring tier; exits use the quicker exit tween.\n\tconst enterTransition = transition ?? tierSpring(springTiers.slow);\n\tconst exitTransition = tierExit(springTiers.slow);\n\n\treturn (\n\t\t<AnimatePresence initial={false}>\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<SheetPrimitive.Backdrop\n\t\t\t\t\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\tkey='sheet-overlay'\n\t\t\t\t\t\t\t\t\tclassName='fixed inset-0 bg-black/32 backdrop-blur-sm'\n\t\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\t\texit={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\ttransition={{ duration: springTiers.moderate.duration, ease: easings.easeOut }}\n\t\t\t\t\t\t\t\t\tstyle={{ zIndex: 'var(--z-layer-modal-backdrop)' }}\n\t\t\t\t\t\t\t\t/>\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<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// A sheet that scrolls opens at its top, not scrolled to a footer button that is first in tab order.\n\t\t\t\t\t\t// Leaving `initialFocus` out and passing `undefined` are the same thing: both get this default.\n\t\t\t\t\t\tinitialFocus={initialFocus ?? scrollSafeInitialFocus(() => contentRef.current)}\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={enterTransition}\n\t\t\t\t\t\t\t\tstyle={{ zIndex }}\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='data-[open]:bg-secondary absolute top-4 end-4\n\t\t\t\t\t\t\t\t\trounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50\n\t\t\t\t\t\t\t\t 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\t/** `band` tints the header and closes it with a hairline, edge to edge. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetHeader({ className, variant = 'default', ...props }: SheetHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-header\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col space-y-2',\n\t\t\t\t// `pe-6` keeps the title clear of the close button.\n\t\t\t\tvariant === 'default' && 'pb-4 pe-6 text-center sm:text-start',\n\t\t\t\t// Bleeds through SheetContent's p-4 to the panel edges.\n\t\t\t\tvariant === 'band' && '-mx-4 -mt-4 border-b bg-muted/50 p-4 pe-12 text-start',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetFooterProps = React.ComponentProps<'div'> & {\n\t/** `band` pins a tinted footer to the bottom edge, closed off by a hairline. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetFooter({ className, variant = 'default', ...props }: SheetFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-footer\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end',\n\t\t\t\tvariant === 'default' && 'pt-4',\n\t\t\t\tvariant === 'band' && '-mx-4 mt-auto -mb-4 border-t bg-muted/50 px-4 py-3',\n\t\t\t\tclassName,\n\t\t\t)}\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,SAAgB,qBAAwB,EACvC,MACA,aACA,YAC0D;CAC1D,MAAM,CAAC,mBAAmB,4CAAoC,WAAgB;CAC9E,MAAM,eAAe,SAAS;CAC9B,MAAM,QAAQ,eAAe,OAAO;CAGpC,MAAM,gCAAqB,QAAQ;CACnC,2BAAgB;EACf,YAAY,UAAU;CACvB,GAAG,CAAC,QAAQ,CAAC;CAYb,OAAO,CAAC,+BATN,aAAgB;EAChB,IAAI,CAAC,cACJ,qBAAqB,QAAQ;EAE9B,YAAY,UAAU,QAAQ;CAC/B,GACA,CAAC,YAAY,CAGQ,CAAC;AACxB;;;;ACMA,MAAM,oBAAoBA,MAAM,cAAiD,MAAS;AAE1F,MAAM,eAAe;AAWrB,SAAS,mBAAmB,EAAE,UAAU,YAAY,aAAsC;CACzF,MAAM,CAAC,QAAQ,aAAaA,MAAM,SAAsB,CAAC,CAAC;CAC1D,MAAM,CA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MAAM,aAAa,CAAC,GAAG,SAAS;IAC9D,GAhBK,iBAAiB,SAgBtB;cA1BH,CA8BC,2CAACQ,6CAAD,EACE,SACgB,IACjB,aACA,4CAACT,6BAAe,OAAhB;KACC,aAAU;KACV,WAAU;eAFX,CAMC,2CAACU,gBAAD,EAAG,WAAU,UAAW,IACxB,2CAAC,QAAD;MAAM,WAAU;gBAAU;KAAW,EAChB;MAEF;KACV;;CAEE;AAEnB;AAOA,SAAS,YAAY,EAAE,WAAW,UAAU,WAAW,GAAG,SAA2B;CACpF,OACC,2CAAC,OAAD;EACC,aAAU;EACV,gBAAc;EACd,WAAWT,iBACV,2BAEA,YAAY,aAAa,uCAEzB,YAAY,UAAU,yDACtB,SACD;EACA,GAAI;CACJ;AAEH;AAOA,SAAS,YAAY,EAAE,WAAW,UAAU,WAAW,GAAG,SAA2B;CACpF,OACC,2CAAC,OAAD;EACC,aAAU;EACV,gBAAc;EACd,WAAWA,iBACV,uEACA,YAAY,aAAa,QACzB,YAAY,UAAU,sDACtB,SACD;EACA,GAAI;CACJ;AAEH;AAIA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA0B;CAC7D,OACC,2CAACD,6BAAe,OAAhB;EACC,aAAU;EACV,WAAWC,iBAAG,yCAAyC,SAAS;EAChE,GAAI;CACJ;AAEH;AAIA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAgC;CACzE,OACC,2CAACD,6BAAe,aAAhB;EACC,aAAU;EACV,WAAWC,iBAAG,iCAAiC,SAAS;EACxD,GAAI;CACJ;AAEH"}
@@ -1,14 +1,16 @@
1
1
  'use client';
2
2
  import { t as cn } from "./utils-BkMLyah9.js";
3
- import { n as easings, t as durations } from "./motion-config-COsZ6azM.js";
3
+ import { a as tierSpring, i as tierExit, n as easings } from "./motion-config-DoFp4I8f.js";
4
+ import { i as useSpringTiers } from "./tuning-BKVFsxLr.js";
5
+ import { t as scrollSafeInitialFocus } from "./initial-focus-j2E0EnIx.js";
4
6
  import * as React$1 from "react";
5
7
  import { useCallback, useEffect, useRef, useState } from "react";
6
8
  import { jsx, jsxs } from "react/jsx-runtime";
7
9
  import { cva } from "class-variance-authority";
8
10
  import { X } from "lucide-react";
11
+ import { AnimatePresence, motion } from "motion/react";
9
12
  import { ModalPortalScope, useRootPortalContainer } from "@constructive-io/ui/portal";
10
13
  import { Dialog } from "@base-ui/react/dialog";
11
- import { AnimatePresence, motion } from "motion/react";
12
14
 
13
15
  //#region src/lib/use-controllable-state.ts
14
16
  /**
@@ -215,14 +217,14 @@ function SheetPortal({ forceMount: _forceMount, container: containerProp, ...pro
215
217
  function SheetOverlay({ className, asChild: _asChild, forceMount: _forceMount, ...props }) {
216
218
  return /* @__PURE__ */ jsx(Dialog.Backdrop, {
217
219
  "data-slot": "sheet-overlay",
218
- className: cn("fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/80", className),
220
+ className: cn("fixed inset-0 z-[var(--z-layer-modal-backdrop)] bg-black/32 backdrop-blur-sm", className),
219
221
  ...props
220
222
  });
221
223
  }
222
- const sheetVariants = cva("fixed flex flex-col gap-3 bg-background p-4 shadow-lg", {
224
+ const sheetVariants = cva("fixed flex flex-col gap-3 overflow-y-auto overscroll-contain bg-background p-4 shadow-lg outline-hidden [overflow-wrap:break-word]", {
223
225
  variants: { side: {
224
- top: "inset-x-0 top-0 border-b",
225
- bottom: "inset-x-0 bottom-0 border-t",
226
+ top: "inset-x-0 top-0 max-h-dvh border-b",
227
+ bottom: "inset-x-0 bottom-0 max-h-dvh border-t",
226
228
  left: "inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
227
229
  right: "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"
228
230
  } },
@@ -281,18 +283,9 @@ function getExitPosition(side) {
281
283
  case "bottom": return { y: "100%" };
282
284
  }
283
285
  }
284
- const defaultSheetTransition = {
285
- type: "tween",
286
- duration: durations.normal,
287
- ease: [
288
- .32,
289
- .72,
290
- 0,
291
- 1
292
- ]
293
- };
294
- function SheetContent({ side = "right", className, transition = defaultSheetTransition, overlay = true, showClose = true, children, forceMount: _forceMount, onInteractOutside: _onInteractOutside, onPointerDownOutside: _onPointerDownOutside, onEscapeKeyDown: _onEscapeKeyDown, onFocusOutside: _onFocusOutside, ...props }) {
286
+ function SheetContent({ side = "right", className, transition, overlay = true, showClose = true, children, forceMount: _forceMount, onInteractOutside: _onInteractOutside, onPointerDownOutside: _onPointerDownOutside, onEscapeKeyDown: _onEscapeKeyDown, onFocusOutside: _onFocusOutside, initialFocus, ...props }) {
295
287
  const { isOpen, depth, sheetId } = useSheet();
288
+ const springTiers = useSpringTiers();
296
289
  const sheetStack = useSheetStack();
297
290
  const sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;
298
291
  const stackMode = sheetStack?.stackMode ?? "cascade";
@@ -335,11 +328,8 @@ function SheetContent({ side = "right", className, transition = defaultSheetTran
335
328
  x: pushOffset.x ?? 0,
336
329
  y: pushOffset.y ?? 0
337
330
  };
338
- const exitTransition = {
339
- type: "tween",
340
- duration: durations.normal,
341
- ease: easings.physicalExit
342
- };
331
+ const enterTransition = transition ?? tierSpring(springTiers.slow);
332
+ const exitTransition = tierExit(springTiers.slow);
343
333
  return /* @__PURE__ */ jsx(AnimatePresence, {
344
334
  initial: false,
345
335
  children: isOpen && /* @__PURE__ */ jsxs(SheetPortal, {
@@ -347,13 +337,13 @@ function SheetContent({ side = "right", className, transition = defaultSheetTran
347
337
  children: [overlay && depth === 0 && /* @__PURE__ */ jsx(Dialog.Backdrop, {
348
338
  "data-slot": "sheet-overlay",
349
339
  render: /* @__PURE__ */ jsx(motion.div, {
350
- className: "fixed inset-0 bg-black/80",
340
+ className: "fixed inset-0 bg-black/32 backdrop-blur-sm",
351
341
  initial: { opacity: 0 },
352
342
  animate: { opacity: 1 },
353
343
  exit: { opacity: 0 },
354
344
  transition: {
355
- duration: durations.fast,
356
- ease: "easeOut"
345
+ duration: springTiers.moderate.duration,
346
+ ease: easings.easeOut
357
347
  },
358
348
  style: { zIndex: "var(--z-layer-modal-backdrop)" }
359
349
  }, "sheet-overlay")
@@ -361,6 +351,7 @@ function SheetContent({ side = "right", className, transition = defaultSheetTran
361
351
  "data-slot": "sheet-content",
362
352
  "data-sheet-depth": depth,
363
353
  "data-sheet-id": sheetId,
354
+ initialFocus: initialFocus ?? scrollSafeInitialFocus(() => contentRef.current),
364
355
  ...props,
365
356
  render: /* @__PURE__ */ jsx(motion.div, {
366
357
  ref: contentRef,
@@ -375,13 +366,13 @@ function SheetContent({ side = "right", className, transition = defaultSheetTran
375
366
  initial: "initial",
376
367
  animate: "animate",
377
368
  exit: "exit",
378
- transition,
369
+ transition: enterTransition,
379
370
  style: { zIndex },
380
371
  className: cn(sheetVariants({ side: resolvedSide }), className)
381
372
  }, `sheet-content-${sheetId}`),
382
373
  children: [/* @__PURE__ */ jsx(ModalPortalScope, { children }), showClose && /* @__PURE__ */ jsxs(Dialog.Close, {
383
374
  "data-slot": "sheet-close",
384
- className: "ring-offset-background focus:ring-ring data-[open]:bg-secondary absolute top-4 right-4\n rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2\n focus:outline-none disabled:pointer-events-none",
375
+ className: "data-[open]:bg-secondary absolute top-4 end-4\n rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50\n disabled:pointer-events-none",
385
376
  children: [/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", {
386
377
  className: "sr-only",
387
378
  children: "Close"
@@ -391,17 +382,19 @@ function SheetContent({ side = "right", className, transition = defaultSheetTran
391
382
  })
392
383
  });
393
384
  }
394
- function SheetHeader({ className, ...props }) {
385
+ function SheetHeader({ className, variant = "default", ...props }) {
395
386
  return /* @__PURE__ */ jsx("div", {
396
387
  "data-slot": "sheet-header",
397
- className: cn("flex flex-col space-y-2 pb-4 text-center sm:text-left", className),
388
+ "data-variant": variant,
389
+ className: cn("flex flex-col space-y-2", variant === "default" && "pb-4 pe-6 text-center sm:text-start", variant === "band" && "-mx-4 -mt-4 border-b bg-muted/50 p-4 pe-12 text-start", className),
398
390
  ...props
399
391
  });
400
392
  }
401
- function SheetFooter({ className, ...props }) {
393
+ function SheetFooter({ className, variant = "default", ...props }) {
402
394
  return /* @__PURE__ */ jsx("div", {
403
395
  "data-slot": "sheet-footer",
404
- className: cn("flex flex-col-reverse pt-4 sm:flex-row sm:justify-end sm:space-x-2", className),
396
+ "data-variant": variant,
397
+ className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end", variant === "default" && "pt-4", variant === "band" && "-mx-4 mt-auto -mb-4 border-t bg-muted/50 px-4 py-3", className),
405
398
  ...props
406
399
  });
407
400
  }
@@ -422,4 +415,4 @@ function SheetDescription({ className, ...props }) {
422
415
 
423
416
  //#endregion
424
417
  export { SheetDescription as a, SheetOverlay as c, SheetTitle as d, SheetTrigger as f, useControllableState as h, SheetContent as i, SheetPortal as l, useSheetStack as m, Sheet as n, SheetFooter as o, useSheet as p, SheetClose as r, SheetHeader as s, SHEET_INDENT as t, SheetStackProvider as u };
425
- //# sourceMappingURL=sheet-BLHnhLRH.js.map
418
+ //# sourceMappingURL=sheet-wPF_l9Cn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet-wPF_l9Cn.js","names":["React","SheetPrimitive"],"sources":["../src/lib/use-controllable-state.ts","../src/components/sheet.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\ntype UseControllableStateParams<T> = {\n\tprop?: T;\n\tdefaultProp?: T;\n\tonChange?: (value: T) => void;\n};\n\n/**\n * Hook for managing controlled/uncontrolled state.\n * Supports both controlled (prop-driven) and uncontrolled (internal state) patterns.\n */\nexport function useControllableState<T>({\n\tprop,\n\tdefaultProp,\n\tonChange,\n}: UseControllableStateParams<T>): [T, (value: T) => void] {\n\tconst [uncontrolledValue, setUncontrolledValue] = useState<T>(defaultProp as T);\n\tconst isControlled = prop !== undefined;\n\tconst value = isControlled ? prop : uncontrolledValue;\n\n\t// Store onChange in ref to keep callback stable\n\tconst onChangeRef = useRef(onChange);\n\tuseEffect(() => {\n\t\tonChangeRef.current = onChange;\n\t}, [onChange]);\n\n\tconst setValue = useCallback(\n\t\t(newValue: T) => {\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledValue(newValue);\n\t\t\t}\n\t\t\tonChangeRef.current?.(newValue);\n\t\t},\n\t\t[isControlled],\n\t);\n\n\treturn [value, setValue];\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 { scrollSafeInitialFocus } from '../lib/initial-focus';\nimport { easings, tierExit, tierSpring } from '../lib/motion/motion-config';\nimport { useSpringTiers } from '../lib/motion/tuning';\nimport { useControllableState } from '../lib/use-controllable-state';\nimport { ModalPortalScope, useRootPortalContainer } from '@constructive-io/ui/portal';\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// 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\tconst isTopSheet = React.useCallback((id: string) => {\n\t\tif (sheets.length === 0) return false;\n\t\treturn sheets[sheets.length - 1]?.id === id;\n\t}, [sheets]);\n\n\t// Sheets above = sheets with higher depth than this one\n\tconst getSheetsAbove = React.useCallback((id: string) => {\n\t\tconst index = sheets.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 sheets.length - index - 1;\n\t}, [sheets]);\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\nfunction Sheet({\n\tchildren,\n\tsheetId: providedId,\n\topen: openProp,\n\tdefaultOpen = false,\n\tonOpenChange,\n\tmodal,\n\t...props\n}: SheetProps) {\n\tconst [isOpen, setIsOpen] = useControllableState({\n\t\tprop: openProp,\n\t\tdefaultProp: defaultOpen,\n\t\tonChange: onOpenChange,\n\t});\n\tconst sheetStack = useSheetStack();\n\tconst nesting = useSheetNesting();\n\tconst generatedId = React.useId();\n\tconst sheetId = providedId ?? `sheet-${generatedId.replace(/:/g, '')}`;\n\n\t// Depth is determined by nesting level in React tree\n\tconst depth = nesting.level;\n\n\tconst close = React.useCallback(() => {\n\t\tsetIsOpen(false);\n\t}, [setIsOpen]);\n\n\tconst registerSheet = sheetStack?.registerSheet;\n\tconst unregisterSheet = sheetStack?.unregisterSheet;\n\n\t// Register/unregister with stack when open state changes\n\tReact.useEffect(() => {\n\t\tif (registerSheet && 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\tregisterSheet({ id: sheetId, depth, close });\n\t\t\treturn () => unregisterSheet?.(sheetId);\n\t\t}\n\t}, [isOpen, sheetId, depth, close, registerSheet, unregisterSheet]);\n\n\t// Base UI owns dismissal details; this adapter preserves the package's boolean callback.\n\tconst handleOpenChange = React.useCallback((open: boolean, _eventDetails: DialogChangeEventDetails) => {\n\t\tsetIsOpen(open);\n\t}, [setIsOpen]);\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 : 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 = React.ComponentProps<typeof SheetPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetTrigger({ asChild, children, render, nativeButton, ...props }: SheetTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Trigger\n\t\t\tdata-slot=\"sheet-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</SheetPrimitive.Trigger>\n\t);\n}\n\ntype SheetCloseProps = React.ComponentProps<typeof SheetPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction SheetClose({ asChild, children, render, nativeButton, ...props }: SheetCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<SheetPrimitive.Close\n\t\t\tdata-slot=\"sheet-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : 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, container: containerProp, ...props }: SheetPortalProps) {\n\tconst rootContainer = useRootPortalContainer();\n\tconst container = containerProp === undefined ? (rootContainer ?? undefined) : containerProp;\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/32 backdrop-blur-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// The panel scrolls itself: content taller than the viewport used to be clipped with no way to reach it. Callers that manage their own\n// scroll region (a `flex-1 min-h-0 overflow-y-auto` body) are unaffected because the sheet then never overflows.\nconst sheetVariants = cva('fixed flex flex-col gap-3 overflow-y-auto overscroll-contain bg-background p-4 shadow-lg outline-hidden [overflow-wrap:break-word]', {\n\tvariants: {\n\t\tside: {\n\t\t\ttop: 'inset-x-0 top-0 max-h-dvh border-b',\n\t\t\tbottom: 'inset-x-0 bottom-0 max-h-dvh 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\nfunction SheetContent({\n\tside = 'right',\n\tclassName,\n\ttransition,\n\toverlay = true,\n\tshowClose = true,\n\tchildren,\n\tforceMount: _forceMount,\n\tonInteractOutside: _onInteractOutside,\n\tonPointerDownOutside: _onPointerDownOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\tonFocusOutside: _onFocusOutside,\n\tinitialFocus,\n\t...props\n}: SheetContentProps) {\n\tconst { isOpen, depth, sheetId } = useSheet();\n\tconst springTiers = useSpringTiers();\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// Enter rides the slow spring tier; exits use the quicker exit tween.\n\tconst enterTransition = transition ?? tierSpring(springTiers.slow);\n\tconst exitTransition = tierExit(springTiers.slow);\n\n\treturn (\n\t\t<AnimatePresence initial={false}>\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<SheetPrimitive.Backdrop\n\t\t\t\t\t\t\tdata-slot=\"sheet-overlay\"\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\tkey='sheet-overlay'\n\t\t\t\t\t\t\t\t\tclassName='fixed inset-0 bg-black/32 backdrop-blur-sm'\n\t\t\t\t\t\t\t\t\tinitial={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\tanimate={{ opacity: 1 }}\n\t\t\t\t\t\t\t\t\texit={{ opacity: 0 }}\n\t\t\t\t\t\t\t\t\ttransition={{ duration: springTiers.moderate.duration, ease: easings.easeOut }}\n\t\t\t\t\t\t\t\t\tstyle={{ zIndex: 'var(--z-layer-modal-backdrop)' }}\n\t\t\t\t\t\t\t\t/>\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<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// A sheet that scrolls opens at its top, not scrolled to a footer button that is first in tab order.\n\t\t\t\t\t\t// Leaving `initialFocus` out and passing `undefined` are the same thing: both get this default.\n\t\t\t\t\t\tinitialFocus={initialFocus ?? scrollSafeInitialFocus(() => contentRef.current)}\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={enterTransition}\n\t\t\t\t\t\t\t\tstyle={{ zIndex }}\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='data-[open]:bg-secondary absolute top-4 end-4\n\t\t\t\t\t\t\t\t\trounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50\n\t\t\t\t\t\t\t\t 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\t/** `band` tints the header and closes it with a hairline, edge to edge. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetHeader({ className, variant = 'default', ...props }: SheetHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-header\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col space-y-2',\n\t\t\t\t// `pe-6` keeps the title clear of the close button.\n\t\t\t\tvariant === 'default' && 'pb-4 pe-6 text-center sm:text-start',\n\t\t\t\t// Bleeds through SheetContent's p-4 to the panel edges.\n\t\t\t\tvariant === 'band' && '-mx-4 -mt-4 border-b bg-muted/50 p-4 pe-12 text-start',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype SheetFooterProps = React.ComponentProps<'div'> & {\n\t/** `band` pins a tinted footer to the bottom edge, closed off by a hairline. */\n\tvariant?: 'default' | 'band';\n};\n\nfunction SheetFooter({ className, variant = 'default', ...props }: SheetFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"sheet-footer\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end',\n\t\t\t\tvariant === 'default' && 'pt-4',\n\t\t\t\tvariant === 'band' && '-mx-4 mt-auto -mb-4 border-t bg-muted/50 px-4 py-3',\n\t\t\t\tclassName,\n\t\t\t)}\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"],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,SAAgB,qBAAwB,EACvC,MACA,aACA,YAC0D;CAC1D,MAAM,CAAC,mBAAmB,wBAAwB,SAAY,WAAgB;CAC9E,MAAM,eAAe,SAAS;CAC9B,MAAM,QAAQ,eAAe,OAAO;CAGpC,MAAM,cAAc,OAAO,QAAQ;CACnC,gBAAgB;EACf,YAAY,UAAU;CACvB,GAAG,CAAC,QAAQ,CAAC;CAYb,OAAO,CAAC,OAVS,aACf,aAAgB;EAChB,IAAI,CAAC,cACJ,qBAAqB,QAAQ;EAE9B,YAAY,UAAU,Q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