@womp/kookie-ui 0.35.7 → 0.37.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 (370) hide show
  1. package/components.css +12 -20
  2. package/dist/cjs/components/_internal/base-menu.utils.js +1 -1
  3. package/dist/cjs/components/_internal/base-menu.utils.js.map +2 -2
  4. package/dist/cjs/components/_internal/menu-context.js +1 -1
  5. package/dist/cjs/components/_internal/menu-context.js.map +2 -2
  6. package/dist/cjs/components/_internal/pane-chrome.js +1 -1
  7. package/dist/cjs/components/_internal/pane-chrome.js.map +2 -2
  8. package/dist/cjs/components/_internal/shell-bottom.d.ts +3 -3
  9. package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
  10. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  11. package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
  12. package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
  13. package/dist/cjs/components/_internal/shell-handles.js +1 -1
  14. package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
  15. package/dist/cjs/components/_internal/shell-inspector.d.ts +3 -3
  16. package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
  17. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  18. package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
  19. package/dist/cjs/components/_internal/shell-pane.d.ts +2 -7
  20. package/dist/cjs/components/_internal/shell-pane.d.ts.map +1 -1
  21. package/dist/cjs/components/_internal/shell-pane.js +1 -1
  22. package/dist/cjs/components/_internal/shell-pane.js.map +3 -3
  23. package/dist/cjs/components/_internal/shell-resizable.d.ts +3 -9
  24. package/dist/cjs/components/_internal/shell-resizable.d.ts.map +1 -1
  25. package/dist/cjs/components/_internal/shell-resizable.js +1 -1
  26. package/dist/cjs/components/_internal/shell-resizable.js.map +3 -3
  27. package/dist/cjs/components/_internal/shell-resize.d.ts +0 -4
  28. package/dist/cjs/components/_internal/shell-resize.d.ts.map +1 -1
  29. package/dist/cjs/components/_internal/shell-resize.js +1 -1
  30. package/dist/cjs/components/_internal/shell-resize.js.map +2 -2
  31. package/dist/cjs/components/_internal/shell-rest.d.ts +1 -6
  32. package/dist/cjs/components/_internal/shell-rest.d.ts.map +1 -1
  33. package/dist/cjs/components/_internal/shell-rest.js +1 -1
  34. package/dist/cjs/components/_internal/shell-rest.js.map +3 -3
  35. package/dist/cjs/components/_internal/shell-sidebar.d.ts +3 -3
  36. package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
  37. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  38. package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
  39. package/dist/cjs/components/_internal/shell-store.d.ts +0 -10
  40. package/dist/cjs/components/_internal/shell-store.d.ts.map +1 -1
  41. package/dist/cjs/components/_internal/shell-store.js +1 -1
  42. package/dist/cjs/components/_internal/shell-store.js.map +3 -3
  43. package/dist/cjs/components/_internal/use-close-warning.d.ts +12 -0
  44. package/dist/cjs/components/_internal/use-close-warning.d.ts.map +1 -0
  45. package/dist/cjs/components/_internal/use-close-warning.js +3 -0
  46. package/dist/cjs/components/_internal/use-close-warning.js.map +7 -0
  47. package/dist/cjs/components/checkbox-group.js +1 -1
  48. package/dist/cjs/components/checkbox-group.js.map +3 -3
  49. package/dist/cjs/components/checkbox-group.primitive.d.ts +0 -10
  50. package/dist/cjs/components/checkbox-group.primitive.d.ts.map +1 -1
  51. package/dist/cjs/components/checkbox-group.primitive.js +1 -1
  52. package/dist/cjs/components/checkbox-group.primitive.js.map +3 -3
  53. package/dist/cjs/components/context-menu.d.ts +1 -5
  54. package/dist/cjs/components/context-menu.d.ts.map +1 -1
  55. package/dist/cjs/components/context-menu.js +1 -1
  56. package/dist/cjs/components/context-menu.js.map +3 -3
  57. package/dist/cjs/components/dialog.d.ts.map +1 -1
  58. package/dist/cjs/components/dialog.js +1 -1
  59. package/dist/cjs/components/dialog.js.map +4 -4
  60. package/dist/cjs/components/dropdown-menu.js +1 -1
  61. package/dist/cjs/components/dropdown-menu.js.map +2 -2
  62. package/dist/cjs/components/index.js +2 -2
  63. package/dist/cjs/components/index.js.map +4 -4
  64. package/dist/cjs/components/navigator.js.map +2 -2
  65. package/dist/cjs/components/schemas/index.d.ts +1 -1
  66. package/dist/cjs/components/schemas/index.d.ts.map +1 -1
  67. package/dist/cjs/components/schemas/index.js +1 -1
  68. package/dist/cjs/components/schemas/index.js.map +3 -3
  69. package/dist/cjs/components/schemas/shell.schema.d.ts +6 -112
  70. package/dist/cjs/components/schemas/shell.schema.d.ts.map +1 -1
  71. package/dist/cjs/components/schemas/shell.schema.js +1 -1
  72. package/dist/cjs/components/schemas/shell.schema.js.map +3 -3
  73. package/dist/cjs/components/separator.js +1 -1
  74. package/dist/cjs/components/separator.js.map +2 -2
  75. package/dist/cjs/components/sheet.d.ts +7 -4
  76. package/dist/cjs/components/sheet.d.ts.map +1 -1
  77. package/dist/cjs/components/sheet.js +1 -1
  78. package/dist/cjs/components/sheet.js.map +4 -4
  79. package/dist/cjs/components/shell.context.d.ts +1 -45
  80. package/dist/cjs/components/shell.context.d.ts.map +1 -1
  81. package/dist/cjs/components/shell.context.js +1 -1
  82. package/dist/cjs/components/shell.context.js.map +4 -4
  83. package/dist/cjs/components/shell.d.ts +7 -37
  84. package/dist/cjs/components/shell.d.ts.map +1 -1
  85. package/dist/cjs/components/shell.js +1 -1
  86. package/dist/cjs/components/shell.js.map +4 -4
  87. package/dist/cjs/components/shell.types.d.ts +6 -27
  88. package/dist/cjs/components/shell.types.d.ts.map +1 -1
  89. package/dist/cjs/components/shell.types.js +1 -1
  90. package/dist/cjs/components/shell.types.js.map +2 -2
  91. package/dist/cjs/components/sidebar.js +1 -1
  92. package/dist/cjs/components/sidebar.js.map +2 -2
  93. package/dist/cjs/components/toolbar.js +1 -1
  94. package/dist/cjs/components/toolbar.js.map +2 -2
  95. package/dist/cjs/hooks/use-breakpoint.js +1 -1
  96. package/dist/cjs/hooks/use-breakpoint.js.map +2 -2
  97. package/dist/cjs/index.js +4 -4
  98. package/dist/cjs/index.js.map +4 -4
  99. package/dist/esm/{chunk-LR4X7SVV.js → chunk-2K46JPUL.js} +2 -2
  100. package/dist/esm/chunk-3K7E4XL3.js +3 -0
  101. package/dist/esm/chunk-3K7E4XL3.js.map +7 -0
  102. package/dist/esm/chunk-3LR7KMBE.js +3 -0
  103. package/dist/esm/chunk-3LR7KMBE.js.map +7 -0
  104. package/dist/esm/{chunk-HGF4CKRY.js → chunk-3ZBEWLSO.js} +2 -2
  105. package/dist/esm/{chunk-26O4RBOJ.js → chunk-5BABJBV3.js} +2 -2
  106. package/dist/esm/{chunk-5APRBJRR.js → chunk-5GTQXMS2.js} +2 -2
  107. package/dist/esm/chunk-5U2LEJLU.js +3 -0
  108. package/dist/esm/chunk-5U2LEJLU.js.map +7 -0
  109. package/dist/esm/{chunk-KBSH6CBD.js → chunk-5XO3PLDH.js} +2 -2
  110. package/dist/esm/{chunk-SGKLJDA3.js → chunk-74JANLVU.js} +2 -2
  111. package/dist/esm/{chunk-TUZ665BA.js → chunk-7E3ZOVRL.js} +2 -2
  112. package/dist/esm/{chunk-COLJWVN7.js → chunk-AQR42GKA.js} +2 -2
  113. package/dist/esm/{chunk-FTNZWAPB.js → chunk-ARPUPT4M.js} +2 -2
  114. package/dist/esm/{chunk-OMPLFDS6.js → chunk-ASBTPKH3.js} +2 -2
  115. package/dist/esm/{chunk-JFJV4HL3.js → chunk-CFXFWIRM.js} +2 -2
  116. package/dist/esm/{chunk-YLGIP3A5.js → chunk-CJZGEHVB.js} +2 -2
  117. package/dist/esm/{chunk-ISCZ57VL.js → chunk-DJGZ4K3V.js} +2 -2
  118. package/dist/esm/{chunk-PMXIQ5B4.js → chunk-FKCKELUB.js} +2 -2
  119. package/dist/esm/{chunk-Y5ITMKC6.js → chunk-G7S2BMS3.js} +2 -2
  120. package/dist/esm/{chunk-SR42NATX.js → chunk-GHIHF55B.js} +2 -2
  121. package/dist/esm/chunk-H7GH3DTF.js +3 -0
  122. package/dist/esm/chunk-H7GH3DTF.js.map +7 -0
  123. package/dist/esm/{chunk-C6VGCYFQ.js → chunk-HNOT2HS4.js} +2 -2
  124. package/dist/esm/chunk-HWT2K2XR.js +3 -0
  125. package/dist/esm/chunk-HWT2K2XR.js.map +7 -0
  126. package/dist/esm/{chunk-D42VCLKH.js → chunk-ICO5ULJL.js} +2 -2
  127. package/dist/esm/{chunk-FYZXC7AL.js → chunk-JJVAVLCN.js} +2 -2
  128. package/dist/esm/chunk-LBAC2X4U.js +3 -0
  129. package/dist/esm/{chunk-5BXCPANF.js.map → chunk-LBAC2X4U.js.map} +3 -3
  130. package/dist/esm/{chunk-R4DMVTM3.js → chunk-M6THDAMU.js} +2 -2
  131. package/dist/esm/{chunk-MAA6LEE2.js → chunk-MDQ7ZHOS.js} +1 -1
  132. package/dist/esm/chunk-MDQ7ZHOS.js.map +7 -0
  133. package/dist/esm/chunk-MQA3BKF4.js +3 -0
  134. package/dist/esm/chunk-MQA3BKF4.js.map +7 -0
  135. package/dist/esm/{chunk-VBF3XALY.js → chunk-MS2ONKJJ.js} +2 -2
  136. package/dist/esm/chunk-MXNPCJPV.js +3 -0
  137. package/dist/esm/chunk-MXNPCJPV.js.map +7 -0
  138. package/dist/esm/{chunk-XFMAA4MD.js → chunk-NJG42JDM.js} +2 -2
  139. package/dist/esm/{chunk-NJ7RQYLX.js → chunk-OIJQSUUM.js} +2 -2
  140. package/dist/esm/{chunk-VYF6KKYM.js → chunk-ONJYRJ66.js} +2 -2
  141. package/dist/esm/chunk-PIVHOUEA.js +3 -0
  142. package/dist/esm/chunk-PIVHOUEA.js.map +7 -0
  143. package/dist/esm/{chunk-UH6CJXHY.js → chunk-QPGW6RJG.js} +2 -2
  144. package/dist/esm/{chunk-EB4AG3OL.js → chunk-REELD6CT.js} +2 -2
  145. package/dist/esm/chunk-RYXIRZQW.js +3 -0
  146. package/dist/esm/chunk-RYXIRZQW.js.map +7 -0
  147. package/dist/esm/chunk-S66WR5R7.js +3 -0
  148. package/dist/esm/{chunk-MXEOE4LA.js.map → chunk-S66WR5R7.js.map} +2 -2
  149. package/dist/esm/chunk-SECVO3CW.js +3 -0
  150. package/dist/esm/chunk-SECVO3CW.js.map +7 -0
  151. package/dist/esm/chunk-SHDZYFUN.js +3 -0
  152. package/dist/esm/chunk-SHDZYFUN.js.map +7 -0
  153. package/dist/esm/{chunk-3M5ZM67R.js → chunk-TCFBNE6A.js} +2 -2
  154. package/dist/esm/chunk-U7P64MXD.js +3 -0
  155. package/dist/esm/chunk-U7P64MXD.js.map +7 -0
  156. package/dist/esm/chunk-UFYQC5XY.js +3 -0
  157. package/dist/esm/chunk-UFYQC5XY.js.map +7 -0
  158. package/dist/esm/{chunk-QBONJMSE.js → chunk-VRQK7U7J.js} +2 -2
  159. package/dist/esm/{chunk-TANYRHGP.js → chunk-W3X4N4JE.js} +2 -2
  160. package/dist/esm/{chunk-OPYTQ34H.js → chunk-W4CPV4PO.js} +2 -2
  161. package/dist/esm/{chunk-G66WDIIV.js → chunk-WJKCXGVN.js} +2 -2
  162. package/dist/esm/{chunk-YLPCYCYA.js → chunk-WT4IDG2W.js} +2 -2
  163. package/dist/esm/chunk-XBDAE77C.js +3 -0
  164. package/dist/esm/chunk-XBDAE77C.js.map +7 -0
  165. package/dist/esm/{chunk-X4PWBFOT.js → chunk-YM47BXKK.js} +2 -2
  166. package/dist/esm/chunk-YOESAYMJ.js +3 -0
  167. package/dist/esm/chunk-YOESAYMJ.js.map +7 -0
  168. package/dist/esm/{chunk-FVRVBB6O.js → chunk-YOZXIUZY.js} +2 -2
  169. package/dist/esm/{chunk-OGVKMDO7.js → chunk-YRCXTCIT.js} +2 -2
  170. package/dist/esm/components/_internal/base-button.js +1 -1
  171. package/dist/esm/components/_internal/base-menu.utils.js +1 -1
  172. package/dist/esm/components/_internal/menu-context.js +1 -1
  173. package/dist/esm/components/_internal/pane-chrome.js +1 -1
  174. package/dist/esm/components/_internal/portal-theme.js +1 -1
  175. package/dist/esm/components/_internal/shell-bottom.d.ts +3 -3
  176. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  177. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  178. package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -1
  179. package/dist/esm/components/_internal/shell-handles.js +1 -1
  180. package/dist/esm/components/_internal/shell-inspector.d.ts +3 -3
  181. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  182. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  183. package/dist/esm/components/_internal/shell-pane.d.ts +2 -7
  184. package/dist/esm/components/_internal/shell-pane.d.ts.map +1 -1
  185. package/dist/esm/components/_internal/shell-pane.js +1 -1
  186. package/dist/esm/components/_internal/shell-resizable.d.ts +3 -9
  187. package/dist/esm/components/_internal/shell-resizable.d.ts.map +1 -1
  188. package/dist/esm/components/_internal/shell-resizable.js +1 -1
  189. package/dist/esm/components/_internal/shell-resize.d.ts +0 -4
  190. package/dist/esm/components/_internal/shell-resize.d.ts.map +1 -1
  191. package/dist/esm/components/_internal/shell-resize.js +1 -1
  192. package/dist/esm/components/_internal/shell-rest.d.ts +1 -6
  193. package/dist/esm/components/_internal/shell-rest.d.ts.map +1 -1
  194. package/dist/esm/components/_internal/shell-rest.js +1 -1
  195. package/dist/esm/components/_internal/shell-sidebar.d.ts +3 -3
  196. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  197. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  198. package/dist/esm/components/_internal/shell-store.d.ts +0 -10
  199. package/dist/esm/components/_internal/shell-store.d.ts.map +1 -1
  200. package/dist/esm/components/_internal/shell-store.js +1 -1
  201. package/dist/esm/components/_internal/use-close-warning.d.ts +12 -0
  202. package/dist/esm/components/_internal/use-close-warning.d.ts.map +1 -0
  203. package/dist/esm/components/_internal/use-close-warning.js +3 -0
  204. package/dist/esm/components/accordion.js +1 -1
  205. package/dist/esm/components/alert-dialog.js +1 -1
  206. package/dist/esm/components/avatar.js +1 -1
  207. package/dist/esm/components/button.js +1 -1
  208. package/dist/esm/components/chatbar.js +1 -1
  209. package/dist/esm/components/checkbox-group.js +1 -1
  210. package/dist/esm/components/checkbox-group.primitive.d.ts +0 -10
  211. package/dist/esm/components/checkbox-group.primitive.d.ts.map +1 -1
  212. package/dist/esm/components/checkbox-group.primitive.js +1 -1
  213. package/dist/esm/components/checkbox.js +1 -1
  214. package/dist/esm/components/chip.js +1 -1
  215. package/dist/esm/components/combobox.js +1 -1
  216. package/dist/esm/components/command.js +1 -1
  217. package/dist/esm/components/context-menu.d.ts +1 -5
  218. package/dist/esm/components/context-menu.d.ts.map +1 -1
  219. package/dist/esm/components/context-menu.js +1 -1
  220. package/dist/esm/components/dialog.d.ts.map +1 -1
  221. package/dist/esm/components/dialog.js +1 -1
  222. package/dist/esm/components/dropdown-menu.js +1 -1
  223. package/dist/esm/components/index.js +1 -1
  224. package/dist/esm/components/message-scroller.js +1 -1
  225. package/dist/esm/components/navigator.js +1 -1
  226. package/dist/esm/components/notice.js +1 -1
  227. package/dist/esm/components/popover.js +1 -1
  228. package/dist/esm/components/radio-group.js +1 -1
  229. package/dist/esm/components/radio.js +1 -1
  230. package/dist/esm/components/schemas/index.d.ts +1 -1
  231. package/dist/esm/components/schemas/index.d.ts.map +1 -1
  232. package/dist/esm/components/schemas/index.js +1 -1
  233. package/dist/esm/components/schemas/index.js.map +2 -2
  234. package/dist/esm/components/schemas/shell.schema.d.ts +6 -112
  235. package/dist/esm/components/schemas/shell.schema.d.ts.map +1 -1
  236. package/dist/esm/components/schemas/shell.schema.js +1 -1
  237. package/dist/esm/components/select.js +1 -1
  238. package/dist/esm/components/separator.js +1 -1
  239. package/dist/esm/components/sheet.d.ts +7 -4
  240. package/dist/esm/components/sheet.d.ts.map +1 -1
  241. package/dist/esm/components/sheet.js +1 -1
  242. package/dist/esm/components/shell.context.d.ts +1 -45
  243. package/dist/esm/components/shell.context.d.ts.map +1 -1
  244. package/dist/esm/components/shell.context.js +1 -1
  245. package/dist/esm/components/shell.d.ts +7 -37
  246. package/dist/esm/components/shell.d.ts.map +1 -1
  247. package/dist/esm/components/shell.js +1 -1
  248. package/dist/esm/components/shell.types.d.ts +6 -27
  249. package/dist/esm/components/shell.types.d.ts.map +1 -1
  250. package/dist/esm/components/shell.types.js +1 -1
  251. package/dist/esm/components/sidebar.js +1 -1
  252. package/dist/esm/components/slider.js +1 -1
  253. package/dist/esm/components/switch.js +1 -1
  254. package/dist/esm/components/tabs.js +1 -1
  255. package/dist/esm/components/text-area.js +1 -1
  256. package/dist/esm/components/text-field.js +1 -1
  257. package/dist/esm/components/theme.js +1 -1
  258. package/dist/esm/components/toggle.js +1 -1
  259. package/dist/esm/components/toolbar.js +1 -1
  260. package/dist/esm/components/tooltip.js +1 -1
  261. package/dist/esm/components/virtual-menu.js +1 -1
  262. package/dist/esm/hooks/use-breakpoint.js +1 -1
  263. package/dist/esm/index.js +1 -1
  264. package/package.json +1 -5
  265. package/schemas/index.json +13 -335
  266. package/schemas/shell-bottom.json +2 -63
  267. package/schemas/shell-inspector.json +2 -63
  268. package/schemas/shell-panel.json +2 -63
  269. package/schemas/shell-rail.json +2 -38
  270. package/schemas/shell-sidebar.json +5 -102
  271. package/schemas/shell-trigger.json +0 -6
  272. package/src/components/_internal/base-dialog.css +15 -0
  273. package/src/components/_internal/shell-bottom.tsx +6 -26
  274. package/src/components/_internal/shell-handles.tsx +2 -32
  275. package/src/components/_internal/shell-inspector.tsx +6 -26
  276. package/src/components/_internal/shell-pane.tsx +7 -56
  277. package/src/components/_internal/shell-resizable.tsx +6 -81
  278. package/src/components/_internal/shell-resize.tsx +0 -4
  279. package/src/components/_internal/shell-rest.ts +2 -11
  280. package/src/components/_internal/shell-sidebar.tsx +8 -30
  281. package/src/components/_internal/shell-store.tsx +1 -34
  282. package/src/components/_internal/use-close-warning.ts +38 -0
  283. package/src/components/checkbox-group.primitive.tsx +0 -12
  284. package/src/components/context-menu.tsx +1 -6
  285. package/src/components/dialog.tsx +6 -1
  286. package/src/components/schemas/index.ts +0 -1
  287. package/src/components/schemas/shell.schema.ts +3 -20
  288. package/src/components/sheet.tsx +11 -5
  289. package/src/components/shell.context.tsx +5 -112
  290. package/src/components/shell.css +1 -29
  291. package/src/components/shell.tsx +12 -97
  292. package/src/components/shell.types.ts +6 -28
  293. package/styles.css +12 -20
  294. package/dist/cjs/components/shell.hooks.d.ts +0 -10
  295. package/dist/cjs/components/shell.hooks.d.ts.map +0 -1
  296. package/dist/cjs/components/shell.hooks.js +0 -3
  297. package/dist/cjs/components/shell.hooks.js.map +0 -7
  298. package/dist/esm/chunk-2VSRZ4IT.js +0 -3
  299. package/dist/esm/chunk-2VSRZ4IT.js.map +0 -7
  300. package/dist/esm/chunk-2WFN4D52.js +0 -3
  301. package/dist/esm/chunk-2WFN4D52.js.map +0 -7
  302. package/dist/esm/chunk-4OJRLS5N.js +0 -3
  303. package/dist/esm/chunk-4OJRLS5N.js.map +0 -7
  304. package/dist/esm/chunk-4TTRPCGG.js +0 -3
  305. package/dist/esm/chunk-4TTRPCGG.js.map +0 -7
  306. package/dist/esm/chunk-5BXCPANF.js +0 -3
  307. package/dist/esm/chunk-B447PNRD.js +0 -3
  308. package/dist/esm/chunk-B447PNRD.js.map +0 -7
  309. package/dist/esm/chunk-BJVXB3PN.js +0 -3
  310. package/dist/esm/chunk-BJVXB3PN.js.map +0 -7
  311. package/dist/esm/chunk-HQT32HQ6.js +0 -3
  312. package/dist/esm/chunk-HQT32HQ6.js.map +0 -7
  313. package/dist/esm/chunk-KGCGT4MJ.js +0 -3
  314. package/dist/esm/chunk-KGCGT4MJ.js.map +0 -7
  315. package/dist/esm/chunk-M26LLCQC.js +0 -3
  316. package/dist/esm/chunk-M26LLCQC.js.map +0 -7
  317. package/dist/esm/chunk-MAA6LEE2.js.map +0 -7
  318. package/dist/esm/chunk-MXEOE4LA.js +0 -3
  319. package/dist/esm/chunk-QV66TN2A.js +0 -3
  320. package/dist/esm/chunk-QV66TN2A.js.map +0 -7
  321. package/dist/esm/chunk-TRJAVWCK.js +0 -3
  322. package/dist/esm/chunk-TRJAVWCK.js.map +0 -7
  323. package/dist/esm/chunk-TS4QCDSI.js +0 -3
  324. package/dist/esm/chunk-TS4QCDSI.js.map +0 -7
  325. package/dist/esm/chunk-XOAOSRTH.js +0 -3
  326. package/dist/esm/chunk-XOAOSRTH.js.map +0 -7
  327. package/dist/esm/chunk-XUCR7L4G.js +0 -3
  328. package/dist/esm/chunk-XUCR7L4G.js.map +0 -7
  329. package/dist/esm/chunk-XVN43IZL.js +0 -3
  330. package/dist/esm/chunk-XVN43IZL.js.map +0 -7
  331. package/dist/esm/components/shell.hooks.d.ts +0 -10
  332. package/dist/esm/components/shell.hooks.d.ts.map +0 -1
  333. package/dist/esm/components/shell.hooks.js +0 -3
  334. package/src/components/shell.hooks.ts +0 -20
  335. /package/dist/esm/{chunk-LR4X7SVV.js.map → chunk-2K46JPUL.js.map} +0 -0
  336. /package/dist/esm/{chunk-HGF4CKRY.js.map → chunk-3ZBEWLSO.js.map} +0 -0
  337. /package/dist/esm/{chunk-26O4RBOJ.js.map → chunk-5BABJBV3.js.map} +0 -0
  338. /package/dist/esm/{chunk-5APRBJRR.js.map → chunk-5GTQXMS2.js.map} +0 -0
  339. /package/dist/esm/{chunk-KBSH6CBD.js.map → chunk-5XO3PLDH.js.map} +0 -0
  340. /package/dist/esm/{chunk-SGKLJDA3.js.map → chunk-74JANLVU.js.map} +0 -0
  341. /package/dist/esm/{chunk-TUZ665BA.js.map → chunk-7E3ZOVRL.js.map} +0 -0
  342. /package/dist/esm/{chunk-COLJWVN7.js.map → chunk-AQR42GKA.js.map} +0 -0
  343. /package/dist/esm/{chunk-FTNZWAPB.js.map → chunk-ARPUPT4M.js.map} +0 -0
  344. /package/dist/esm/{chunk-OMPLFDS6.js.map → chunk-ASBTPKH3.js.map} +0 -0
  345. /package/dist/esm/{chunk-JFJV4HL3.js.map → chunk-CFXFWIRM.js.map} +0 -0
  346. /package/dist/esm/{chunk-YLGIP3A5.js.map → chunk-CJZGEHVB.js.map} +0 -0
  347. /package/dist/esm/{chunk-ISCZ57VL.js.map → chunk-DJGZ4K3V.js.map} +0 -0
  348. /package/dist/esm/{chunk-PMXIQ5B4.js.map → chunk-FKCKELUB.js.map} +0 -0
  349. /package/dist/esm/{chunk-Y5ITMKC6.js.map → chunk-G7S2BMS3.js.map} +0 -0
  350. /package/dist/esm/{chunk-SR42NATX.js.map → chunk-GHIHF55B.js.map} +0 -0
  351. /package/dist/esm/{chunk-C6VGCYFQ.js.map → chunk-HNOT2HS4.js.map} +0 -0
  352. /package/dist/esm/{chunk-D42VCLKH.js.map → chunk-ICO5ULJL.js.map} +0 -0
  353. /package/dist/esm/{chunk-FYZXC7AL.js.map → chunk-JJVAVLCN.js.map} +0 -0
  354. /package/dist/esm/{chunk-R4DMVTM3.js.map → chunk-M6THDAMU.js.map} +0 -0
  355. /package/dist/esm/{chunk-VBF3XALY.js.map → chunk-MS2ONKJJ.js.map} +0 -0
  356. /package/dist/esm/{chunk-XFMAA4MD.js.map → chunk-NJG42JDM.js.map} +0 -0
  357. /package/dist/esm/{chunk-NJ7RQYLX.js.map → chunk-OIJQSUUM.js.map} +0 -0
  358. /package/dist/esm/{chunk-VYF6KKYM.js.map → chunk-ONJYRJ66.js.map} +0 -0
  359. /package/dist/esm/{chunk-UH6CJXHY.js.map → chunk-QPGW6RJG.js.map} +0 -0
  360. /package/dist/esm/{chunk-EB4AG3OL.js.map → chunk-REELD6CT.js.map} +0 -0
  361. /package/dist/esm/{chunk-3M5ZM67R.js.map → chunk-TCFBNE6A.js.map} +0 -0
  362. /package/dist/esm/{chunk-QBONJMSE.js.map → chunk-VRQK7U7J.js.map} +0 -0
  363. /package/dist/esm/{chunk-TANYRHGP.js.map → chunk-W3X4N4JE.js.map} +0 -0
  364. /package/dist/esm/{chunk-OPYTQ34H.js.map → chunk-W4CPV4PO.js.map} +0 -0
  365. /package/dist/esm/{chunk-G66WDIIV.js.map → chunk-WJKCXGVN.js.map} +0 -0
  366. /package/dist/esm/{chunk-YLPCYCYA.js.map → chunk-WT4IDG2W.js.map} +0 -0
  367. /package/dist/esm/{chunk-X4PWBFOT.js.map → chunk-YM47BXKK.js.map} +0 -0
  368. /package/dist/esm/{chunk-FVRVBB6O.js.map → chunk-YOZXIUZY.js.map} +0 -0
  369. /package/dist/esm/{chunk-OGVKMDO7.js.map → chunk-YRCXTCIT.js.map} +0 -0
  370. /package/dist/esm/components/{shell.hooks.js.map → _internal/use-close-warning.js.map} +0 -0
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as d}from"./chunk-YLPCYCYA.js";import{b as m}from"./chunk-5KJIPH2N.js";import{a as E}from"./chunk-VQPANPMI.js";var L={};E(L,{Button:()=>R,Content:()=>M,Item:()=>P,Root:()=>S,Viewport:()=>g,useMessageScroller:()=>f,useMessageScrollerScrollable:()=>V,useMessageScrollerVisibility:()=>N});import*as e from"react";import c from"classnames";import{MessageScroller as a,useMessageScroller as f,useMessageScrollerScrollable as V,useMessageScrollerVisibility as N}from"@shadcn/react/message-scroller";import{useComposedRefs as T}from"radix-ui/internal";var S=e.forwardRef(({autoScroll:o=!0,defaultScrollPosition:t="end",scrollEdgeThreshold:r,scrollMargin:s,className:n,children:i,...l},u)=>e.createElement(a.Provider,{autoScroll:o,defaultScrollPosition:t,...r!=null?{scrollEdgeThreshold:r}:{},...s!=null?{scrollMargin:s}:{}},e.createElement(a.Root,{...l,ref:u,className:c("kui-MessageScrollerRoot",n)},i)));S.displayName="MessageScroller.Root";var g=e.forwardRef(({className:o,"aria-label":t,fade:r=!0,...s},n)=>{let i=m(r),l=T(n,i);return e.createElement(a.Viewport,{"aria-label":t??"",...s,ref:l,"data-fade":r?"":void 0,className:c("kui-MessageScrollerViewport",o)})});g.displayName="MessageScroller.Viewport";var M=e.forwardRef(({className:o,...t},r)=>e.createElement(a.Content,{...t,ref:r,className:c("kui-MessageScrollerContent",o)}));M.displayName="MessageScroller.Content";var P=e.forwardRef(({className:o,...t},r)=>e.createElement(a.Item,{...t,ref:r,className:c("kui-MessageScrollerItem",o)}));P.displayName="MessageScroller.Item";var R=e.forwardRef(({direction:o="end",behavior:t="auto",className:r,children:s,size:n,variant:i="surface",emphasis:l,color:u="gray",radius:v="full","aria-label":b,onClick:y,...B},w)=>{let{scrollToEnd:h,scrollToStart:C}=f(),k=p=>{if(y?.(p),p.defaultPrevented)return;p.preventDefault(),p.currentTarget.closest(".kui-MessageScrollerRoot")?.querySelector(".kui-MessageScrollerViewport")?.focus({preventScroll:!0}),o==="start"?C({behavior:t}):h({behavior:t})};return e.createElement(a.Button,{direction:o,behavior:t,onClick:k,render:e.createElement(d,{iconOnly:!0,...B,ref:w,size:n,...l?{emphasis:l}:{variant:i},color:u,radius:v,"aria-label":b??(o==="end"?"Jump to the latest":"Jump to the first"),className:c("kui-MessageScrollerButton",r),"data-direction":o},s??e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0,style:o==="start"?{transform:"rotate(180deg)"}:void 0},e.createElement("path",{d:"M7.5 2.5v10M3.5 8.5l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})))})});R.displayName="MessageScroller.Button";export{f as a,V as b,N as c,S as d,g as e,M as f,P as g,R as h,L as i};
3
- //# sourceMappingURL=chunk-Y5ITMKC6.js.map
2
+ import{a as d}from"./chunk-WT4IDG2W.js";import{b as m}from"./chunk-5KJIPH2N.js";import{a as E}from"./chunk-VQPANPMI.js";var L={};E(L,{Button:()=>R,Content:()=>M,Item:()=>P,Root:()=>S,Viewport:()=>g,useMessageScroller:()=>f,useMessageScrollerScrollable:()=>V,useMessageScrollerVisibility:()=>N});import*as e from"react";import c from"classnames";import{MessageScroller as a,useMessageScroller as f,useMessageScrollerScrollable as V,useMessageScrollerVisibility as N}from"@shadcn/react/message-scroller";import{useComposedRefs as T}from"radix-ui/internal";var S=e.forwardRef(({autoScroll:o=!0,defaultScrollPosition:t="end",scrollEdgeThreshold:r,scrollMargin:s,className:n,children:i,...l},u)=>e.createElement(a.Provider,{autoScroll:o,defaultScrollPosition:t,...r!=null?{scrollEdgeThreshold:r}:{},...s!=null?{scrollMargin:s}:{}},e.createElement(a.Root,{...l,ref:u,className:c("kui-MessageScrollerRoot",n)},i)));S.displayName="MessageScroller.Root";var g=e.forwardRef(({className:o,"aria-label":t,fade:r=!0,...s},n)=>{let i=m(r),l=T(n,i);return e.createElement(a.Viewport,{"aria-label":t??"",...s,ref:l,"data-fade":r?"":void 0,className:c("kui-MessageScrollerViewport",o)})});g.displayName="MessageScroller.Viewport";var M=e.forwardRef(({className:o,...t},r)=>e.createElement(a.Content,{...t,ref:r,className:c("kui-MessageScrollerContent",o)}));M.displayName="MessageScroller.Content";var P=e.forwardRef(({className:o,...t},r)=>e.createElement(a.Item,{...t,ref:r,className:c("kui-MessageScrollerItem",o)}));P.displayName="MessageScroller.Item";var R=e.forwardRef(({direction:o="end",behavior:t="auto",className:r,children:s,size:n,variant:i="surface",emphasis:l,color:u="gray",radius:v="full","aria-label":b,onClick:y,...B},w)=>{let{scrollToEnd:h,scrollToStart:C}=f(),k=p=>{if(y?.(p),p.defaultPrevented)return;p.preventDefault(),p.currentTarget.closest(".kui-MessageScrollerRoot")?.querySelector(".kui-MessageScrollerViewport")?.focus({preventScroll:!0}),o==="start"?C({behavior:t}):h({behavior:t})};return e.createElement(a.Button,{direction:o,behavior:t,onClick:k,render:e.createElement(d,{iconOnly:!0,...B,ref:w,size:n,...l?{emphasis:l}:{variant:i},color:u,radius:v,"aria-label":b??(o==="end"?"Jump to the latest":"Jump to the first"),className:c("kui-MessageScrollerButton",r),"data-direction":o},s??e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0,style:o==="start"?{transform:"rotate(180deg)"}:void 0},e.createElement("path",{d:"M7.5 2.5v10M3.5 8.5l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})))})});R.displayName="MessageScroller.Button";export{f as a,V as b,N as c,S as d,g as e,M as f,P as g,R as h,L as i};
3
+ //# sourceMappingURL=chunk-G7S2BMS3.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as T,b as I}from"./chunk-3RJVW6RK.js";import{a as N}from"./chunk-HGF4CKRY.js";import{b as x}from"./chunk-5ON3XLRD.js";import*as e from"react";import{createPortal as z}from"react-dom";import d from"classnames";import{Command as v}from"cmdk";import{Dialog as g}from"radix-ui";var M={1:"2",2:"3",3:"4",4:"4"},G={values:["1","2","3","4"],default:"2"},h=e.createContext("2"),L=e.createContext(()=>{}),E=e.createContext([]),w=e.createContext(null),O=e.createContext({query:"",filter:null,itemToString:String}),b=e.createContext(null);function B(t){if(typeof t=="string"||typeof t=="number")return String(t);if(t&&typeof t=="object"){let o=t;for(let n of["label","title","value","name"])if(typeof o[n]=="string")return o[n]}return""}var F=(t,o,n)=>n(t).toLowerCase().includes(o.trim().toLowerCase());function A(t){return!!(t&&typeof t=="object"&&Array.isArray(t.items))}function H(t,o,n,i){if(n===null||o.trim()==="")return[...t];let a=[];for(let r of t)if(A(r)){let s=r.items.filter(m=>n(m,o,i));s.length>0&&a.push({...r,items:s})}else n(r,o,i)&&a.push(r);return a}function Z({size:t,items:o,open:n,defaultOpen:i,onOpenChange:a,children:r}){let s=x(t,G),[m,C]=e.useState(i??!1),l=n!==void 0,p=l?n:m,c=e.useCallback((u,R)=>{a?.(u,{reason:R}),l||C(u)},[a,l]),f=e.useCallback(()=>c(!1,"item-press"),[c]);return e.createElement(h.Provider,{value:s},e.createElement(E.Provider,{value:o},e.createElement(w.Provider,{value:f},e.createElement(g.Root,{open:p,onOpenChange:u=>c(u,"dismiss"),modal:!0},r))))}function J({children:t,...o}){return e.createElement(g.Trigger,{asChild:!0,...o},t)}function K({"aria-label":t,filter:o=F,itemToString:n=B,onQueryChange:i,container:a,children:r,className:s,style:m}){let C=e.useContext(h),[l,p]=e.useState(""),[c,f]=e.useState(null),u=e.useRef(i);e.useEffect(()=>{u.current=i}),e.useEffect(()=>()=>u.current?.(""),[]),I();let R=e.useCallback(y=>{p(y),u.current?.(y)},[]),S=e.useMemo(()=>({query:l,filter:o,itemToString:n}),[l,o,n]),P=e.useMemo(()=>({seat:c,setSeat:f}),[c]);return e.createElement(g.Portal,{container:a},e.createElement(N,{asChild:!0},e.createElement(g.Overlay,{className:"kui-BaseDialogOverlay kui-CommandOverlay"},e.createElement(g.Content,{"aria-label":t,"aria-describedby":void 0,className:d("kui-CommandContent",`kui-r-size-${C}`,s),style:m,onCloseAutoFocus:()=>{T()}},e.createElement(g.Title,{className:"kui-sr-only"},t),e.createElement(v,{label:t,shouldFilter:!1,loop:!0,className:"kui-CommandRoot"},e.createElement(O.Provider,{value:S},e.createElement(L.Provider,{value:R},e.createElement(b.Provider,{value:P},r))))))))}function U({leading:t,className:o,...n}){let i=e.useContext(h),a=e.useContext(L),r=e.useRef(null);return e.createElement("div",{className:d("kui-CommandSearch",`kui-r-size-${i}`),onMouseDown:s=>{s.target!==r.current&&(s.preventDefault(),r.current?.focus())}},t?e.createElement("span",{className:"kui-CommandSearchSlot","aria-hidden":!0},t):null,e.createElement(v.Input,{ref:r,autoFocus:!0,...n,onValueChange:a,className:d("kui-reset","kui-CommandInput",o)}))}function X({children:t,className:o}){let n=e.useContext(h),i=e.useContext(E),{query:a,filter:r,itemToString:s}=e.useContext(O),m=e.useContext(b),C=e.useMemo(()=>H(i,a,r,s),[i,a,r,s]);return e.createElement("div",{className:d("kui-BaseMenuContent","kui-variant-soft",`kui-r-size-${M[n]}`,"kui-CommandPanel",o)},e.createElement(v.List,{className:d("kui-BaseMenuViewport","kui-CommandList")},C.map(l=>t(l)),e.createElement("div",{className:"kui-CommandSeat",ref:m?m.setSeat:void 0})))}var D=e.createContext([]);function Y({items:t,children:o,className:n}){return e.createElement(D.Provider,{value:t},e.createElement(v.Group,{className:d("kui-BaseMenuGroup","kui-CommandGroup",n)},o))}function ee({children:t,className:o}){let n=e.useId(),i=e.useRef(null);return e.useLayoutEffect(()=>{let a=i.current?.closest("[cmdk-group-items]");if(!(!a||a.hasAttribute("aria-labelledby")))return a.setAttribute("aria-labelledby",n),()=>{a.getAttribute("aria-labelledby")===n&&a.removeAttribute("aria-labelledby")}},[n]),e.createElement("div",{ref:i,id:n,className:d("kui-BaseMenuLabel","kui-CommandGroupLabel",o),"aria-hidden":!0},t)}function te({children:t}){let o=e.useContext(D);return e.createElement(e.Fragment,null,o.map(n=>t(n)))}function ne({value:t,onSelect:o,leading:n,trailing:i,tone:a,asChild:r,children:s,className:m,...C}){let l=e.useContext(w),p=e.useId(),c=e.useRef(null),f=e.useRef(!1),u=typeof t=="string"?t:p,R=()=>{o?.(),l?.()},S=()=>{if(f.current){f.current=!1,R();return}let k=c.current??document.querySelector(`[data-kui-command-item="${CSS.escape(p)}"]`);if(r&&k instanceof HTMLAnchorElement){k.click();return}R()},P=r&&e.isValidElement(s)?s:null,y=k=>e.createElement(e.Fragment,null,n?e.createElement("span",{className:"kui-CommandItemSlot","data-slot":"leading","aria-hidden":!0},n):null,e.createElement("span",{className:"kui-CommandItemLabel"},k),i?e.createElement("span",{className:"kui-CommandItemSlot","data-slot":"trailing"},i):null);return e.createElement(v.Item,{...C,ref:c,"data-kui-command-item":p,value:u,asChild:!!P,onSelect:S,onClickCapture:()=>{f.current=!0},"data-tone":a,className:d("kui-reset","kui-BaseMenuItem","kui-CommandItem",m)},P?e.cloneElement(P,void 0,y(P.props.children)):y(s))}function oe({children:t,className:o}){let n=e.useContext(b);return n?.seat?z(e.createElement(v.Empty,{className:d("kui-CommandEmpty",o)},t),n.seat):null}export{M as a,Z as b,J as c,K as d,U as e,X as f,Y as g,ee as h,te as i,ne as j,oe as k};
3
- //# sourceMappingURL=chunk-SR42NATX.js.map
2
+ import{a as T,b as I}from"./chunk-3RJVW6RK.js";import{a as N}from"./chunk-3ZBEWLSO.js";import{b as x}from"./chunk-5ON3XLRD.js";import*as e from"react";import{createPortal as z}from"react-dom";import d from"classnames";import{Command as v}from"cmdk";import{Dialog as g}from"radix-ui";var M={1:"2",2:"3",3:"4",4:"4"},G={values:["1","2","3","4"],default:"2"},h=e.createContext("2"),L=e.createContext(()=>{}),E=e.createContext([]),w=e.createContext(null),O=e.createContext({query:"",filter:null,itemToString:String}),b=e.createContext(null);function B(t){if(typeof t=="string"||typeof t=="number")return String(t);if(t&&typeof t=="object"){let o=t;for(let n of["label","title","value","name"])if(typeof o[n]=="string")return o[n]}return""}var F=(t,o,n)=>n(t).toLowerCase().includes(o.trim().toLowerCase());function A(t){return!!(t&&typeof t=="object"&&Array.isArray(t.items))}function H(t,o,n,i){if(n===null||o.trim()==="")return[...t];let a=[];for(let r of t)if(A(r)){let s=r.items.filter(m=>n(m,o,i));s.length>0&&a.push({...r,items:s})}else n(r,o,i)&&a.push(r);return a}function Z({size:t,items:o,open:n,defaultOpen:i,onOpenChange:a,children:r}){let s=x(t,G),[m,C]=e.useState(i??!1),l=n!==void 0,p=l?n:m,c=e.useCallback((u,R)=>{a?.(u,{reason:R}),l||C(u)},[a,l]),f=e.useCallback(()=>c(!1,"item-press"),[c]);return e.createElement(h.Provider,{value:s},e.createElement(E.Provider,{value:o},e.createElement(w.Provider,{value:f},e.createElement(g.Root,{open:p,onOpenChange:u=>c(u,"dismiss"),modal:!0},r))))}function J({children:t,...o}){return e.createElement(g.Trigger,{asChild:!0,...o},t)}function K({"aria-label":t,filter:o=F,itemToString:n=B,onQueryChange:i,container:a,children:r,className:s,style:m}){let C=e.useContext(h),[l,p]=e.useState(""),[c,f]=e.useState(null),u=e.useRef(i);e.useEffect(()=>{u.current=i}),e.useEffect(()=>()=>u.current?.(""),[]),I();let R=e.useCallback(y=>{p(y),u.current?.(y)},[]),S=e.useMemo(()=>({query:l,filter:o,itemToString:n}),[l,o,n]),P=e.useMemo(()=>({seat:c,setSeat:f}),[c]);return e.createElement(g.Portal,{container:a},e.createElement(N,{asChild:!0},e.createElement(g.Overlay,{className:"kui-BaseDialogOverlay kui-CommandOverlay"},e.createElement(g.Content,{"aria-label":t,"aria-describedby":void 0,className:d("kui-CommandContent",`kui-r-size-${C}`,s),style:m,onCloseAutoFocus:()=>{T()}},e.createElement(g.Title,{className:"kui-sr-only"},t),e.createElement(v,{label:t,shouldFilter:!1,loop:!0,className:"kui-CommandRoot"},e.createElement(O.Provider,{value:S},e.createElement(L.Provider,{value:R},e.createElement(b.Provider,{value:P},r))))))))}function U({leading:t,className:o,...n}){let i=e.useContext(h),a=e.useContext(L),r=e.useRef(null);return e.createElement("div",{className:d("kui-CommandSearch",`kui-r-size-${i}`),onMouseDown:s=>{s.target!==r.current&&(s.preventDefault(),r.current?.focus())}},t?e.createElement("span",{className:"kui-CommandSearchSlot","aria-hidden":!0},t):null,e.createElement(v.Input,{ref:r,autoFocus:!0,...n,onValueChange:a,className:d("kui-reset","kui-CommandInput",o)}))}function X({children:t,className:o}){let n=e.useContext(h),i=e.useContext(E),{query:a,filter:r,itemToString:s}=e.useContext(O),m=e.useContext(b),C=e.useMemo(()=>H(i,a,r,s),[i,a,r,s]);return e.createElement("div",{className:d("kui-BaseMenuContent","kui-variant-soft",`kui-r-size-${M[n]}`,"kui-CommandPanel",o)},e.createElement(v.List,{className:d("kui-BaseMenuViewport","kui-CommandList")},C.map(l=>t(l)),e.createElement("div",{className:"kui-CommandSeat",ref:m?m.setSeat:void 0})))}var D=e.createContext([]);function Y({items:t,children:o,className:n}){return e.createElement(D.Provider,{value:t},e.createElement(v.Group,{className:d("kui-BaseMenuGroup","kui-CommandGroup",n)},o))}function ee({children:t,className:o}){let n=e.useId(),i=e.useRef(null);return e.useLayoutEffect(()=>{let a=i.current?.closest("[cmdk-group-items]");if(!(!a||a.hasAttribute("aria-labelledby")))return a.setAttribute("aria-labelledby",n),()=>{a.getAttribute("aria-labelledby")===n&&a.removeAttribute("aria-labelledby")}},[n]),e.createElement("div",{ref:i,id:n,className:d("kui-BaseMenuLabel","kui-CommandGroupLabel",o),"aria-hidden":!0},t)}function te({children:t}){let o=e.useContext(D);return e.createElement(e.Fragment,null,o.map(n=>t(n)))}function ne({value:t,onSelect:o,leading:n,trailing:i,tone:a,asChild:r,children:s,className:m,...C}){let l=e.useContext(w),p=e.useId(),c=e.useRef(null),f=e.useRef(!1),u=typeof t=="string"?t:p,R=()=>{o?.(),l?.()},S=()=>{if(f.current){f.current=!1,R();return}let k=c.current??document.querySelector(`[data-kui-command-item="${CSS.escape(p)}"]`);if(r&&k instanceof HTMLAnchorElement){k.click();return}R()},P=r&&e.isValidElement(s)?s:null,y=k=>e.createElement(e.Fragment,null,n?e.createElement("span",{className:"kui-CommandItemSlot","data-slot":"leading","aria-hidden":!0},n):null,e.createElement("span",{className:"kui-CommandItemLabel"},k),i?e.createElement("span",{className:"kui-CommandItemSlot","data-slot":"trailing"},i):null);return e.createElement(v.Item,{...C,ref:c,"data-kui-command-item":p,value:u,asChild:!!P,onSelect:S,onClickCapture:()=>{f.current=!0},"data-tone":a,className:d("kui-reset","kui-BaseMenuItem","kui-CommandItem",m)},P?e.cloneElement(P,void 0,y(P.props.children)):y(s))}function oe({children:t,className:o}){let n=e.useContext(b);return n?.seat?z(e.createElement(v.Empty,{className:d("kui-CommandEmpty",o)},t),n.seat):null}export{M as a,Z as b,J as c,K as d,U as e,X as f,Y as g,ee as h,te as i,ne as j,oe as k};
3
+ //# sourceMappingURL=chunk-GHIHF55B.js.map
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{a as i,c as O,e as N}from"./chunk-SHDZYFUN.js";import{a as S,d as a}from"./chunk-RYXIRZQW.js";import{a as b,b as C,c as R}from"./chunk-UFYQC5XY.js";import{a as v,b as y,c as x}from"./chunk-MXNPCJPV.js";import{a as I}from"./chunk-S66WR5R7.js";import{a as z}from"./chunk-WJKCXGVN.js";import{b as g}from"./chunk-VWRPVM5K.js";import{m as h}from"./chunk-LBAC2X4U.js";import*as e from"react";import ee from"classnames";import{useComposedRefs as ne}from"radix-ui/internal";var oe={controlled:"open",default:"defaultOpen"},te={initial:"overlay",sm:"fixed"},E=e.forwardRef((M,T)=>{let{className:H,presentation:U=te,defaultOpen:k,open:w,onOpenChange:A,expandedSize:o=320,minSize:t=200,maxSize:r=500,resizable:p=!1,collapsible:B=!0,onResize:V,onResizeStart:L,onResizeEnd:_,children:D,style:F,onSizeChange:$,sizeUpdate:W,sizeUpdateMs:j=50,size:l,defaultSize:c,flush:d=!0,id:q,...s}=M,{table:m,attributes:G}=R(U,"fixed"),n=b({name:"inspector",label:"Inspector",propNames:oe,id:q,controlled:i(w),defaultValue:i(k),presentationTable:m,builtIn:O,onChange:(Y,Z)=>A?.(Y!=="closed",{reason:Z}),size:o});h("inspector",d);let u=e.useRef(null),J=ne(T,n.setElement,u),K=y({name:"inspector",elementId:n.id,elementRef:u,cssVarName:"--inspector-size",orientation:"vertical",edge:"start",growth:N,expandedSize:o,minSize:t,maxSize:r,resizable:p,collapsible:B,size:l,defaultSize:c,onSizeChange:$,sizeUpdate:W,sizeUpdateMs:j,onResize:V,onResizeStart:L,onResizeEnd:_,overlaying:n.overlaying,overlayingNow:()=>m[z()]==="overlay",requestToggle:()=>n.toggle("toggle")}),{handles:P,content:Q}=x(D,a),X=p&&n.shown!==!1&&!n.overlaying?e.createElement(I.Provider,{value:K},P.length>0?P:e.createElement(S,null)):null,f=v(l,c,t,r);return e.createElement("div",{...s,role:s.role??"complementary",id:n.id,ref:J,className:ee("kui-ShellPane","kui-ShellInspector",H),...C(n,G),"data-flush":d||void 0,tabIndex:n.overlaying?-1:s.tabIndex,style:{...F,"--inspector-expanded-size":`${o}px`,...f?{"--inspector-size":f}:{},"--inspector-min-size":`${t}px`,"--inspector-max-size":`${r}px`}},e.createElement("div",{className:"kui-ShellInspectorContent"},e.createElement(g,null,Q)),X)});E.displayName="Shell.Inspector";E.Handle=a;export{E as a};
3
+ //# sourceMappingURL=chunk-H7GH3DTF.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/_internal/shell-inspector.tsx"],
4
+ "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposedRefs } from 'radix-ui/internal';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { InspectorHandle, PaneHandle } from './shell-handles.js';\nimport { usePane, paneAttributes, usePresentationTable } from './shell-pane.js';\nimport { splitHandles, useInitialPaneSize, useResizablePane, type SizeChangeMeta } from './shell-resizable.js';\nimport { useFrameRegistration } from './shell-store.js';\nimport { detailRest, endAnchoredGrowth, toPaneValue } from './shell-rest.js';\nimport { PageScope } from './page-scope.js';\nimport { readBreakpoint } from '../../hooks/use-breakpoint.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, PaneOpenChangeReason } from '../shell.types.js';\n\ntype InspectorOpenChangeMeta = { reason: PaneOpenChangeReason };\ntype InspectorControlledProps = { open: boolean; onOpenChange?: (open: boolean, meta: InspectorOpenChangeMeta) => void; defaultOpen?: never };\ntype InspectorUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: InspectorOpenChangeMeta) => void; open?: never };\ntype InspectorSizeControlledProps = { size: number | string; defaultSize?: never };\ntype InspectorSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype InspectorPublicProps = PaneBaseProps &\n (InspectorControlledProps | InspectorUncontrolledProps) &\n (InspectorSizeControlledProps | InspectorSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: SizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n };\n\ntype InspectorComponent = React.ForwardRefExoticComponent<InspectorPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof InspectorHandle };\n\nconst INSPECTOR_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\n/** Since 0.8.0 the Inspector is in the frame from 768px up, the boundary kookie-ui-v2 uses everywhere. It was 1280px. */\nconst INSPECTOR_DEFAULT_PRESENTATION = { initial: 'overlay', sm: 'fixed' } as const;\n\nexport const Inspector = React.forwardRef<HTMLDivElement, InspectorPublicProps>((props, ref) => {\n const {\n className,\n presentation = INSPECTOR_DEFAULT_PRESENTATION,\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 320,\n minSize = 200,\n maxSize = 500,\n resizable = false,\n collapsible = true,\n onResize,\n onResizeStart,\n onResizeEnd,\n children,\n style,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n size,\n defaultSize,\n flush = true,\n id,\n ...domProps\n } = props;\n\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'inspector',\n label: 'Inspector',\n propNames: INSPECTOR_PROP_NAMES,\n id,\n controlled: toPaneValue(open),\n defaultValue: toPaneValue(defaultOpen),\n presentationTable: table,\n builtIn: detailRest,\n onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),\n size: expandedSize,\n });\n useFrameRegistration('inspector', flush);\n\n\n const elementRef = React.useRef<HTMLElement | null>(null);\n const composedRef = useComposedRefs(ref, pane.setElement, elementRef);\n\n const resize = useResizablePane({\n name: 'inspector',\n elementId: pane.id,\n elementRef,\n cssVarName: '--inspector-size',\n orientation: 'vertical',\n edge: 'start',\n growth: endAnchoredGrowth,\n expandedSize,\n minSize,\n maxSize,\n resizable,\n collapsible,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs,\n onResize,\n onResizeStart,\n onResizeEnd,\n overlaying: pane.overlaying,\n overlayingNow: () => table[readBreakpoint()] === 'overlay',\n requestToggle: () => pane.toggle('toggle'),\n });\n\n const { handles, content } = splitHandles(children, InspectorHandle);\n const handle = resizable && pane.shown !== false && !pane.overlaying ? <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider> : null;\n\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n return (\n <div\n {...domProps}\n role={domProps.role ?? 'complementary'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellInspector', className)}\n {...paneAttributes(pane, attributes)}\n data-flush={flush || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--inspector-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--inspector-size': initialSize } : {}),\n '--inspector-min-size': `${minSize}px`,\n '--inspector-max-size': `${maxSize}px`,\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellInspectorContent\">\n <PageScope>{content}</PageScope>\n </div>\n {handle}\n </div>\n );\n}) as InspectorComponent;\n\nInspector.displayName = 'Shell.Inspector';\nInspector.Handle = InspectorHandle;\n\nexport type { InspectorPublicProps };\n"],
5
+ "mappings": ";iXAEA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,OAAS,mBAAAC,OAAuB,oBAiChC,IAAMC,GAAuB,CAAE,WAAY,OAAQ,QAAS,aAAc,EAGpEC,GAAiC,CAAE,QAAS,UAAW,GAAI,OAAQ,EAE5DC,EAAkB,aAAiD,CAACC,EAAOC,IAAQ,CAC9F,GAAM,CACJ,UAAAC,EACA,aAAAC,EAAeL,GACf,YAAAM,EACA,KAAAC,EACA,aAAAC,EACA,aAAAC,EAAe,IACf,QAAAC,EAAU,IACV,QAAAC,EAAU,IACV,UAAAC,EAAY,GACZ,YAAAC,EAAc,GACd,SAAAC,EACA,cAAAC,EACA,YAAAC,EACA,SAAAC,EACA,MAAAC,EACA,aAAAC,EACA,WAAAC,EACA,aAAAC,EAAe,GACf,KAAAC,EACA,YAAAC,EACA,MAAAC,EAAQ,GACR,GAAAC,EACA,GAAGC,CACL,EAAIxB,EAEE,CAAE,MAAAyB,EAAO,WAAAC,CAAW,EAAIC,EAAqBxB,EAAc,OAAO,EAClEyB,EAAOC,EAAQ,CACnB,KAAM,YACN,MAAO,YACP,UAAWhC,GACX,GAAA0B,EACA,WAAYO,EAAYzB,CAAI,EAC5B,aAAcyB,EAAY1B,CAAW,EACrC,kBAAmBqB,EACnB,QAASM,EACT,SAAU,CAACC,EAAOC,IAAW3B,IAAe0B,IAAU,SAAU,CAAE,OAAAC,CAAO,CAAC,EAC1E,KAAM1B,CACR,CAAC,EACD2B,EAAqB,YAAaZ,CAAK,EAGvC,IAAMa,EAAmB,SAA2B,IAAI,EAClDC,EAAcC,GAAgBpC,EAAK2B,EAAK,WAAYO,CAAU,EAE9DG,EAASC,EAAiB,CAC9B,KAAM,YACN,UAAWX,EAAK,GAChB,WAAAO,EACA,WAAY,mBACZ,YAAa,WACb,KAAM,QACN,OAAQK,EACR,aAAAjC,EACA,QAAAC,EACA,QAAAC,EACA,UAAAC,EACA,YAAAC,EACA,KAAAS,EACA,YAAAC,EACA,aAAAJ,EACA,WAAAC,EACA,aAAAC,EACA,SAAAP,EACA,cAAAC,EACA,YAAAC,EACA,WAAYc,EAAK,WACjB,cAAe,IAAMH,EAAMgB,EAAe,CAAC,IAAM,UACjD,cAAe,IAAMb,EAAK,OAAO,QAAQ,CAC3C,CAAC,EAEK,CAAE,QAAAc,EAAS,QAAAC,CAAQ,EAAIC,EAAa7B,EAAU8B,CAAe,EAC7DC,EAASpC,GAAakB,EAAK,QAAU,IAAS,CAACA,EAAK,WAAa,gBAACmB,EAAkB,SAAlB,CAA2B,MAAOT,GAASI,EAAQ,OAAS,EAAIA,EAAU,gBAACM,EAAA,IAAW,CAAG,EAAgC,KAE3LC,EAAcC,EAAmB9B,EAAMC,EAAab,EAASC,CAAO,EAC1E,OACE,gBAAC,OACE,GAAGe,EACJ,KAAMA,EAAS,MAAQ,gBACvB,GAAII,EAAK,GACT,IAAKQ,EACL,UAAWe,GAAW,gBAAiB,qBAAsBjD,CAAS,EACrE,GAAGkD,EAAexB,EAAMF,CAAU,EACnC,aAAYJ,GAAS,OACrB,SAAUM,EAAK,WAAa,GAAKJ,EAAS,SAC1C,MACE,CACE,GAAGR,EACH,4BAA6B,GAAGT,CAAY,KAC5C,GAAI0C,EAAc,CAAE,mBAAoBA,CAAY,EAAI,CAAC,EACzD,uBAAwB,GAAGzC,CAAO,KAClC,uBAAwB,GAAGC,CAAO,IACpC,GAGF,gBAAC,OAAI,UAAU,6BACb,gBAAC4C,EAAA,KAAWV,CAAQ,CACtB,EACCG,CACH,CAEJ,CAAC,EAED/C,EAAU,YAAc,kBACxBA,EAAU,OAAS8C",
6
+ "names": ["React", "classNames", "useComposedRefs", "INSPECTOR_PROP_NAMES", "INSPECTOR_DEFAULT_PRESENTATION", "Inspector", "props", "ref", "className", "presentation", "defaultOpen", "open", "onOpenChange", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onResize", "onResizeStart", "onResizeEnd", "children", "style", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "size", "defaultSize", "flush", "id", "domProps", "table", "attributes", "usePresentationTable", "pane", "usePane", "toPaneValue", "detailRest", "value", "reason", "useFrameRegistration", "elementRef", "composedRef", "useComposedRefs", "resize", "useResizablePane", "endAnchoredGrowth", "readBreakpoint", "handles", "content", "splitHandles", "InspectorHandle", "handle", "PaneResizeContext", "PaneHandle", "initialSize", "useInitialPaneSize", "classNames", "paneAttributes", "PageScope"]
7
+ }
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as to,b as ro,c as no,e as W,f as ao,i as so,l as io}from"./chunk-KBSH6CBD.js";import{a as B}from"./chunk-YLPCYCYA.js";import{a as eo}from"./chunk-FICBVI4M.js";import{a as q}from"./chunk-7N2Q5WOM.js";import{b as L}from"./chunk-5ON3XLRD.js";import{d as J,f as Q,g as X}from"./chunk-VWRPVM5K.js";import{h as oo}from"./chunk-PMXIQ5B4.js";import{c as U}from"./chunk-OKQAVYW4.js";import*as o from"react";import{useComposedRefs as vo,useLayoutEffect as D}from"radix-ui/internal";import g from"classnames";import{Toolbar as N}from"radix-ui";var Po=["1","2","3","4"],Ro=["horizontal","vertical"],x={size:{type:"enum",className:"kui-r-size",values:Po,default:"2"},orientation:{type:"enum",values:Ro,default:"horizontal"}};var M=o.createContext(null),F=o.createContext(null),E=o.createContext(!1);function Ho(){return o.useContext(E)}var H=o.forwardRef((e,t)=>{let r=oo(),a=L(e.size??r??void 0,x.size),s=e.orientation??x.orientation.default,{className:i,orientation:n,backdrop:l=!1,children:c,...d}=U({...e,size:a},x,q),u=o.useMemo(()=>({size:a,orientation:s,backdrop:l}),[a,s,l]);return o.createElement(N.Root,{...d,ref:t,orientation:s,"data-backdrop":l||void 0,className:g("kui-Toolbar",i)},o.createElement(M.Provider,{value:u},c))});H.displayName="Toolbar";var co=o.forwardRef(({className:e,disabled:t=!1,children:r,...a},s)=>{let i=o.useContext(M),n=o.useContext(E),l=o.useMemo(()=>({disabled:t}),[t]);return n?o.createElement(ao,{...a,ref:s,className:e},o.createElement(F.Provider,{value:l},r)):o.createElement("div",{role:"group","data-orientation":i?.orientation??"horizontal","data-disabled":t||void 0,...a,ref:s,className:g("kui-ToolbarGroup",e)},o.createElement(F.Provider,{value:l},r))});co.displayName="Toolbar.Group";var yo=new Set(["id","className","style","title"]);function lo(e){return e===!0||e==="true"}function wo(e){return o.isValidElement(e)&&e.type==="button"}var A=o.forwardRef((e,t)=>{let r=o.useContext(M),a=o.useContext(F),s=o.useContext(E),{iconOnly:i,size:n,variant:l,emphasis:c,color:d,disabled:u,asChild:f,onKeyDown:b,...y}=e,h=u||a?.disabled||void 0;if(s){let P={};for(let R of Object.keys(y))(/^on[A-Z]/.test(R)||R.startsWith("aria-")||R.startsWith("data-")||yo.has(R))&&(P[R]=y[R]);return b&&(P.onKeyDown=b),o.createElement(uo,{...P,ref:t,asChild:f,iconOnly:i,disabled:h,color:d,pressed:e["aria-pressed"]===void 0?void 0:lo(e["aria-pressed"])},y.children)}let O=r?.orientation==="vertical"&&b?P=>{P.key==="ArrowDown"||P.key==="ArrowUp"||b(P)}:b,I=lo(e["aria-pressed"]),p="data-state"in e||e["aria-pressed"]===void 0?{}:{"data-state":I?"on":"off"},m={size:n??r?.size,...c!==void 0?{emphasis:c}:{variant:l??(a?"ghost":r?.backdrop?"raised":"soft")},color:d??(l||c?void 0:"gray"),...p},T={...y,...i?{iconOnly:!0}:{},...f?{asChild:!0}:{},...O?{onKeyDown:O}:{},...m};return r?f&&!wo(y.children)?o.createElement(N.Link,{asChild:!0,ref:t},o.createElement(B,{...T,disabled:h})):o.createElement(N.Button,{asChild:!0,ref:t,disabled:h},o.createElement(B,{...T})):o.createElement(B,{...T,ref:t,disabled:h})});A.displayName="Toolbar.Button";var uo=o.forwardRef(({asChild:e,iconOnly:t,disabled:r,color:a,pressed:s,children:i,"aria-label":n,...l},c)=>{let d=t?n:void 0,u={...l,...t?{}:n?{"aria-label":n}:{},disabled:r,...a?{color:a}:{}};if(e&&o.isValidElement(i)){let f=d?o.cloneElement(i,void 0,i.props.children,o.createElement("span",null,d)):i;return o.createElement(W,{...u,ref:c,asChild:!0},f)}return s!==void 0?o.createElement(so,{...u,ref:c,checked:s},i,d):o.createElement(W,{...u,ref:c},i,d)});uo.displayName="Toolbar.OverflowItem";function ho(){return o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentcolor","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg"},o.createElement("circle",{cx:"3.25",cy:"8",r:"1.25"}),o.createElement("circle",{cx:"8",cy:"8",r:"1.25"}),o.createElement("circle",{cx:"12.75",cy:"8",r:"1.25"}))}var po=o.forwardRef(({label:e="More",className:t,children:r,...a},s)=>{let i=o.Children.toArray(r),n=i.length,l=o.useRef(null),c=o.useRef([]),d=o.useRef(0),[u,f]=o.useState(n),[b,y]=o.useState(0),[h,O]=o.useState(n);h!==n&&(O(n),f(n)),D(()=>{c.current=[]},[n]),D(()=>{let p=l.current;if(!p)return;let m=Array.from(p.children),T=Math.min(u,n);for(let v=0;v<T;v++){let w=m[v];w&&(c.current[v]=w.offsetWidth)}let P=m[T];P&&(d.current=P.offsetWidth);let R=Number.parseFloat(getComputedStyle(p).columnGap)||0,K=p.clientWidth,V=0,_=0;for(let v=0;v<n;v++){let w=c.current[v];if(w===void 0)return;w!==0&&(V+=w+(_>0?R:0),_+=1)}let k=n;if(V>K){let v=K-(d.current||p.clientHeight)-R,w=0,Y=0;k=0;for(let G=0;G<n;G++){let Z=c.current[G];if(Z>0){let $=Z+(Y>0?R:0);if(w+$>v)break;w+=$,Y+=1}k+=1}}k!==u&&f(k)},[u,n,b]),o.useEffect(()=>{let p=l.current;if(!p||typeof ResizeObserver>"u")return;let m=new ResizeObserver(()=>y(T=>T+1));m.observe(p);for(let T of Array.from(p.children))m.observe(T);return()=>m.disconnect()},[u,n]);let I=o.useCallback(p=>{l.current=p,typeof s=="function"?s(p):s&&(s.current=p)},[s]);return o.createElement("div",{...a,ref:I,className:g("kui-ToolbarOverflow",t)},i.slice(0,u).map((p,m)=>o.createElement("div",{key:m,className:"kui-ToolbarOverflowSeat"},p)),u<n?o.createElement(to,null,o.createElement(ro,null,o.createElement(A,{iconOnly:!0,"aria-label":e},o.createElement(ho,null))),o.createElement(no,{align:"end"},o.createElement(E.Provider,{value:!0},i.slice(u)))):null)});po.displayName="Toolbar.Overflow";var j=[],S=new Map,z=new Set,C=new Map;function So(e){return z.add(e),()=>{z.delete(e)}}function go(e,t,r){let a=S.get(e)??j,i=a.findIndex(n=>n.id===t)===-1?[...a,{id:t,node:r}]:a.map(n=>n.id===t?{id:t,node:r}:n);S.set(e,i),z.forEach(n=>n())}function xo(e,t){let r=S.get(e);if(!r)return;let a=r.filter(s=>s.id!==t);a.length===0?S.delete(e):S.set(e,a),z.forEach(s=>s())}function fo({name:e="default"}){D(()=>{let r=(C.get(e)??0)+1;return C.set(e,r),r>1,()=>{let a=(C.get(e)??1)-1;a>0?C.set(e,a):C.delete(e)}},[e]);let t=o.useSyncExternalStore(So,()=>S.get(e)??j,()=>j);return o.createElement(o.Fragment,null,t.map(r=>o.createElement(o.Fragment,{key:r.id},r.node)))}fo.displayName="Toolbar.Slot";function bo({name:e="default",children:t}){let r=o.useId();return D(()=>{go(e,r,t)},[e,r,t]),D(()=>()=>xo(e,r),[e,r]),null}bo.displayName="Toolbar.Fill";var mo=o.forwardRef(({className:e,...t},r)=>{let a=o.useContext(M);return o.useContext(E)?o.createElement(io,{...t,ref:r,className:e}):a?o.createElement(N.Separator,{...t,ref:r,className:g("kui-ToolbarSeparator",e)}):o.createElement("div",{role:"separator","aria-orientation":"vertical","data-orientation":"vertical",...t,ref:r,className:g("kui-ToolbarSeparator",e)})});mo.displayName="Toolbar.Separator";var Co={1:"2",2:"3",3:"4",4:"5"},To=o.forwardRef(({className:e,children:t,style:r,id:a},s)=>{let i=o.useContext(M),n=L(void 0,x.size),l=i?.size??n,c=J(),d=Q(c),u=X(c),f=t==null||t===!1,b=f?d:t,y=vo(s,f?u:void 0);return b==null?null:o.createElement(eo,{ref:y,as:"span",size:Co[l],weight:"medium",truncate:!0,id:a,style:r,className:g("kui-ToolbarTitle",e),"data-mirror":f||void 0},b)});To.displayName="Toolbar.Title";var jo=Object.assign(H,{Root:H,Group:co,Button:A,Separator:mo,Title:To,Overflow:po,Slot:fo,Fill:bo});export{Ho as a,H as b,co as c,A as d,po as e,fo as f,bo as g,mo as h,To as i,jo as j};
3
- //# sourceMappingURL=chunk-C6VGCYFQ.js.map
2
+ import{a as to,b as ro,c as no,e as W,f as ao,i as so,l as io}from"./chunk-5XO3PLDH.js";import{a as B}from"./chunk-WT4IDG2W.js";import{a as eo}from"./chunk-FICBVI4M.js";import{a as q}from"./chunk-7N2Q5WOM.js";import{b as L}from"./chunk-5ON3XLRD.js";import{d as J,f as Q,g as X}from"./chunk-VWRPVM5K.js";import{h as oo}from"./chunk-FKCKELUB.js";import{c as U}from"./chunk-OKQAVYW4.js";import*as o from"react";import{useComposedRefs as vo,useLayoutEffect as D}from"radix-ui/internal";import g from"classnames";import{Toolbar as N}from"radix-ui";var Po=["1","2","3","4"],Ro=["horizontal","vertical"],x={size:{type:"enum",className:"kui-r-size",values:Po,default:"2"},orientation:{type:"enum",values:Ro,default:"horizontal"}};var M=o.createContext(null),F=o.createContext(null),E=o.createContext(!1);function Ho(){return o.useContext(E)}var H=o.forwardRef((e,t)=>{let r=oo(),a=L(e.size??r??void 0,x.size),s=e.orientation??x.orientation.default,{className:i,orientation:n,backdrop:l=!1,children:c,...d}=U({...e,size:a},x,q),u=o.useMemo(()=>({size:a,orientation:s,backdrop:l}),[a,s,l]);return o.createElement(N.Root,{...d,ref:t,orientation:s,"data-backdrop":l||void 0,className:g("kui-Toolbar",i)},o.createElement(M.Provider,{value:u},c))});H.displayName="Toolbar";var co=o.forwardRef(({className:e,disabled:t=!1,children:r,...a},s)=>{let i=o.useContext(M),n=o.useContext(E),l=o.useMemo(()=>({disabled:t}),[t]);return n?o.createElement(ao,{...a,ref:s,className:e},o.createElement(F.Provider,{value:l},r)):o.createElement("div",{role:"group","data-orientation":i?.orientation??"horizontal","data-disabled":t||void 0,...a,ref:s,className:g("kui-ToolbarGroup",e)},o.createElement(F.Provider,{value:l},r))});co.displayName="Toolbar.Group";var yo=new Set(["id","className","style","title"]);function lo(e){return e===!0||e==="true"}function wo(e){return o.isValidElement(e)&&e.type==="button"}var A=o.forwardRef((e,t)=>{let r=o.useContext(M),a=o.useContext(F),s=o.useContext(E),{iconOnly:i,size:n,variant:l,emphasis:c,color:d,disabled:u,asChild:f,onKeyDown:b,...y}=e,h=u||a?.disabled||void 0;if(s){let P={};for(let R of Object.keys(y))(/^on[A-Z]/.test(R)||R.startsWith("aria-")||R.startsWith("data-")||yo.has(R))&&(P[R]=y[R]);return b&&(P.onKeyDown=b),o.createElement(uo,{...P,ref:t,asChild:f,iconOnly:i,disabled:h,color:d,pressed:e["aria-pressed"]===void 0?void 0:lo(e["aria-pressed"])},y.children)}let O=r?.orientation==="vertical"&&b?P=>{P.key==="ArrowDown"||P.key==="ArrowUp"||b(P)}:b,I=lo(e["aria-pressed"]),p="data-state"in e||e["aria-pressed"]===void 0?{}:{"data-state":I?"on":"off"},m={size:n??r?.size,...c!==void 0?{emphasis:c}:{variant:l??(a?"ghost":r?.backdrop?"raised":"soft")},color:d??(l||c?void 0:"gray"),...p},T={...y,...i?{iconOnly:!0}:{},...f?{asChild:!0}:{},...O?{onKeyDown:O}:{},...m};return r?f&&!wo(y.children)?o.createElement(N.Link,{asChild:!0,ref:t},o.createElement(B,{...T,disabled:h})):o.createElement(N.Button,{asChild:!0,ref:t,disabled:h},o.createElement(B,{...T})):o.createElement(B,{...T,ref:t,disabled:h})});A.displayName="Toolbar.Button";var uo=o.forwardRef(({asChild:e,iconOnly:t,disabled:r,color:a,pressed:s,children:i,"aria-label":n,...l},c)=>{let d=t?n:void 0,u={...l,...t?{}:n?{"aria-label":n}:{},disabled:r,...a?{color:a}:{}};if(e&&o.isValidElement(i)){let f=d?o.cloneElement(i,void 0,i.props.children,o.createElement("span",null,d)):i;return o.createElement(W,{...u,ref:c,asChild:!0},f)}return s!==void 0?o.createElement(so,{...u,ref:c,checked:s},i,d):o.createElement(W,{...u,ref:c},i,d)});uo.displayName="Toolbar.OverflowItem";function ho(){return o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentcolor","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg"},o.createElement("circle",{cx:"3.25",cy:"8",r:"1.25"}),o.createElement("circle",{cx:"8",cy:"8",r:"1.25"}),o.createElement("circle",{cx:"12.75",cy:"8",r:"1.25"}))}var po=o.forwardRef(({label:e="More",className:t,children:r,...a},s)=>{let i=o.Children.toArray(r),n=i.length,l=o.useRef(null),c=o.useRef([]),d=o.useRef(0),[u,f]=o.useState(n),[b,y]=o.useState(0),[h,O]=o.useState(n);h!==n&&(O(n),f(n)),D(()=>{c.current=[]},[n]),D(()=>{let p=l.current;if(!p)return;let m=Array.from(p.children),T=Math.min(u,n);for(let v=0;v<T;v++){let w=m[v];w&&(c.current[v]=w.offsetWidth)}let P=m[T];P&&(d.current=P.offsetWidth);let R=Number.parseFloat(getComputedStyle(p).columnGap)||0,K=p.clientWidth,V=0,_=0;for(let v=0;v<n;v++){let w=c.current[v];if(w===void 0)return;w!==0&&(V+=w+(_>0?R:0),_+=1)}let k=n;if(V>K){let v=K-(d.current||p.clientHeight)-R,w=0,Y=0;k=0;for(let G=0;G<n;G++){let Z=c.current[G];if(Z>0){let $=Z+(Y>0?R:0);if(w+$>v)break;w+=$,Y+=1}k+=1}}k!==u&&f(k)},[u,n,b]),o.useEffect(()=>{let p=l.current;if(!p||typeof ResizeObserver>"u")return;let m=new ResizeObserver(()=>y(T=>T+1));m.observe(p);for(let T of Array.from(p.children))m.observe(T);return()=>m.disconnect()},[u,n]);let I=o.useCallback(p=>{l.current=p,typeof s=="function"?s(p):s&&(s.current=p)},[s]);return o.createElement("div",{...a,ref:I,className:g("kui-ToolbarOverflow",t)},i.slice(0,u).map((p,m)=>o.createElement("div",{key:m,className:"kui-ToolbarOverflowSeat"},p)),u<n?o.createElement(to,null,o.createElement(ro,null,o.createElement(A,{iconOnly:!0,"aria-label":e},o.createElement(ho,null))),o.createElement(no,{align:"end"},o.createElement(E.Provider,{value:!0},i.slice(u)))):null)});po.displayName="Toolbar.Overflow";var j=[],S=new Map,z=new Set,C=new Map;function So(e){return z.add(e),()=>{z.delete(e)}}function go(e,t,r){let a=S.get(e)??j,i=a.findIndex(n=>n.id===t)===-1?[...a,{id:t,node:r}]:a.map(n=>n.id===t?{id:t,node:r}:n);S.set(e,i),z.forEach(n=>n())}function xo(e,t){let r=S.get(e);if(!r)return;let a=r.filter(s=>s.id!==t);a.length===0?S.delete(e):S.set(e,a),z.forEach(s=>s())}function fo({name:e="default"}){D(()=>{let r=(C.get(e)??0)+1;return C.set(e,r),r>1,()=>{let a=(C.get(e)??1)-1;a>0?C.set(e,a):C.delete(e)}},[e]);let t=o.useSyncExternalStore(So,()=>S.get(e)??j,()=>j);return o.createElement(o.Fragment,null,t.map(r=>o.createElement(o.Fragment,{key:r.id},r.node)))}fo.displayName="Toolbar.Slot";function bo({name:e="default",children:t}){let r=o.useId();return D(()=>{go(e,r,t)},[e,r,t]),D(()=>()=>xo(e,r),[e,r]),null}bo.displayName="Toolbar.Fill";var mo=o.forwardRef(({className:e,...t},r)=>{let a=o.useContext(M);return o.useContext(E)?o.createElement(io,{...t,ref:r,className:e}):a?o.createElement(N.Separator,{...t,ref:r,className:g("kui-ToolbarSeparator",e)}):o.createElement("div",{role:"separator","aria-orientation":"vertical","data-orientation":"vertical",...t,ref:r,className:g("kui-ToolbarSeparator",e)})});mo.displayName="Toolbar.Separator";var Co={1:"2",2:"3",3:"4",4:"5"},To=o.forwardRef(({className:e,children:t,style:r,id:a},s)=>{let i=o.useContext(M),n=L(void 0,x.size),l=i?.size??n,c=J(),d=Q(c),u=X(c),f=t==null||t===!1,b=f?d:t,y=vo(s,f?u:void 0);return b==null?null:o.createElement(eo,{ref:y,as:"span",size:Co[l],weight:"medium",truncate:!0,id:a,style:r,className:g("kui-ToolbarTitle",e),"data-mirror":f||void 0},b)});To.displayName="Toolbar.Title";var jo=Object.assign(H,{Root:H,Group:co,Button:A,Separator:mo,Title:To,Overflow:po,Slot:fo,Fill:bo});export{Ho as a,H as b,co as c,A as d,po as e,fo as f,bo as g,mo as h,To as i,jo as j};
3
+ //# sourceMappingURL=chunk-HNOT2HS4.js.map
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{a as f}from"./chunk-YOESAYMJ.js";import{a as d}from"./chunk-FATCGZZE.js";import{a as C}from"./chunk-OBSZOD5M.js";import{b as S}from"./chunk-3RJVW6RK.js";import{a as l}from"./chunk-TGRHRMQI.js";import{a as u}from"./chunk-FICBVI4M.js";import{a as g}from"./chunk-3ZBEWLSO.js";import{c as P}from"./chunk-5ON3XLRD.js";import{a as h}from"./chunk-4KBKS3ZE.js";import{c}from"./chunk-OKQAVYW4.js";import{a as w}from"./chunk-VQPANPMI.js";var F={};w(F,{Close:()=>x,Content:()=>T,Description:()=>N,Root:()=>v,Title:()=>E,Trigger:()=>y});import*as e from"react";import B from"classnames";import{Dialog as i}from"radix-ui";var v=t=>e.createElement(i.Root,{...t,modal:!0});v.displayName="Sheet.Root";var y=e.forwardRef(({children:t,...o},r)=>e.createElement(i.Trigger,{...o,ref:r,asChild:!0},l(t)));y.displayName="Sheet.Trigger";var{align:ee,...j}=d,R=j,A={Title:({children:t})=>e.createElement(i.Title,{asChild:!0},t),Close:({children:t})=>e.createElement(i.Close,{asChild:!0},t)},D=e.createContext(null),T=e.forwardRef((t,o)=>{let{side:r="start",forceMount:s,container:n,className:b,...H}=t,O=P(H,R.size),W={left:"start",right:"end",start:"start",end:"end",top:"top",bottom:"bottom"}[r],{className:z,...p}=c(O,R),M=e.useRef(0),m=f("Sheet"),k=e.useCallback(a=>{typeof o=="function"?o(a):o&&(o.current=a),m(a)},[o,m]);return S(),e.createElement(i.Portal,{container:n,forceMount:s},e.createElement(D.Provider,{value:M},e.createElement(g,{asChild:!0},e.createElement(i.Overlay,{className:"kui-BaseDialogOverlay kui-DialogOverlay kui-SheetOverlay"},e.createElement(i.Content,{...p,ref:k,className:B("kui-BaseDialogContent","kui-SheetContent",b,z),"data-side":W,"aria-modal":"true",children:e.createElement(h.Provider,{value:A},p.children)})))))});T.displayName="Sheet.Content";var E=e.forwardRef(({size:t="4",weight:o="medium",...r},s)=>{let n=e.useContext(D);return e.useLayoutEffect(()=>{if(n)return n.current+=1,()=>{n.current-=1}},[n]),e.createElement(i.Title,{asChild:!0},e.createElement(C,{ref:s,size:t,weight:o,...r}))});E.displayName="Sheet.Title";var N=e.forwardRef(({size:t="2",emphasis:o="medium",...r},s)=>e.createElement(i.Description,{asChild:!0},e.createElement(u,{ref:s,size:t,emphasis:o,...r})));N.displayName="Sheet.Description";var x=e.forwardRef(({children:t,...o},r)=>e.createElement(i.Close,{...o,ref:r,asChild:!0},l(t)));x.displayName="Sheet.Close";export{v as a,y as b,T as c,E as d,N as e,x as f,F as g};
3
+ //# sourceMappingURL=chunk-HWT2K2XR.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/sheet.tsx"],
4
+ "sourcesContent": ["'use client';\n\n/**\n * Sheet\n *\n * A side-placed overlay built on top of Radix Dialog. It inherits accessibility,\n * focus management, overlay behavior, and sizing scales from the base dialog, and\n * adds side placement, suited for navigation panels and drawers.\n *\n * Structure mirrors Dialog:\n * - Root, Trigger, Content, Title, Description, Close\n *\n * Notes\n * - Side: set with `side` on `Sheet.Content`. Aliases: `left` \u2192 `start`, `right` \u2192 `end`.\n * - Sizing: reuses Dialog content prop defs (width/min/max/height/size). Size follows the\n * Theme size; start/end sheets cap at the size's overlay width unless maxWidth is set.\n * - A11y: provide an accessible name via `Sheet.Title` or `aria-label` on `Sheet.Content`.\n * A titled sheet has a Close X at the end of a Toolbar in its top row; dev warns without one.\n * Radix owns the focus trap, initial focus and the return of focus to the trigger.\n *\n * Example\n * <Sheet.Root>\n * <Sheet.Trigger>\n * <Button>Open</Button>\n * </Sheet.Trigger>\n * <Sheet.Content side=\"end\" width={{ initial: '280px', md: '360px' }}>\n * <Toolbar>\n * <Toolbar.Title><Sheet.Title>Details</Sheet.Title></Toolbar.Title>\n * <Sheet.Close>\n * <Toolbar.Button iconOnly aria-label=\"Close\">\u2026</Toolbar.Button>\n * </Sheet.Close>\n * </Toolbar>\n * ...\n * </Sheet.Content>\n * </Sheet.Root>\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { NavigatorHostContext, type NavigatorHost } from './_internal/navigator-host.js';\nimport { useCloseWarning } from './_internal/use-close-warning.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { HeadingProps } from './heading.js';\n\n/**\n * Supported sides for the Sheet.\n * Aliases are normalized RTL-aware: `left` \u2192 `start`, `right` \u2192 `end`.\n */\ntype SheetSide = 'start' | 'end' | 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * Sheet is a side-placed overlay built on the Dialog primitive.\n * It reuses Dialog's accessibility, focus, overlay, and size scales, while adding side placement.\n */\n\n// Root\n/**\n * Props for `Sheet.Root` (Radix Dialog root with `modal` forced on).\n */\ninterface SheetRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst Root: React.FC<SheetRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nRoot.displayName = 'Sheet.Root';\n\n// Trigger\n/** Element type for `Sheet.Trigger`. */\ntype SheetTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\n/** Props for `Sheet.Trigger` (expects a single element child). */\ninterface SheetTriggerProps extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst Trigger = React.forwardRef<SheetTriggerElement, SheetTriggerProps>(({ children, ...props }, ref) => (\n <DialogPrimitive.Trigger {...props} ref={ref} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n));\nTrigger.displayName = 'Sheet.Trigger';\n\n// Content\n/** Element type for `Sheet.Content`. */\n// Reuse dialog content prop defs for size/width/height tokens.\n// Built once at module scope: `extractProps` memoises on the identity of the\n// prop def objects it is handed, so rebuilding these per render would recompile\n// them every time a sheet renders.\nconst { align: _alignPropDef, ...dialogPropDefsForSheet } = dialogContentPropDefs;\nconst sheetPropDefs = dialogPropDefsForSheet;\n\n/** What a Navigator screen in this panel uses: its title names the sheet, its close closes it. */\nconst sheetNavigatorHost: NavigatorHost = {\n Title: ({ children }) => <DialogPrimitive.Title asChild>{children}</DialogPrimitive.Title>,\n Close: ({ children }) => <DialogPrimitive.Close asChild>{children}</DialogPrimitive.Close>,\n};\n\n/** Counts the Sheet.Title elements mounted inside a Sheet.Content, for the dev-only name check. */\nconst SheetTitleCountContext = React.createContext<React.MutableRefObject<number> | null>(null);\n\ntype SheetContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface SheetContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n Omit<DialogContentOwnProps, 'align'> {\n /** Side where the Sheet should appear. `left`/`right` alias to `start`/`end`. */\n side?: SheetSide;\n /** Optional DOM container to portal into. Defaults to `document.body`. */\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\n\n/**\n * Renders the Sheet panel. Normalizes left/right to logical start/end and\n * forwards dialog sizing props. Provide an accessible name via `Sheet.Title`\n * or `aria-label`.\n */\nconst Content = React.forwardRef<SheetContentElement, SheetContentProps>((allProps, forwardedRef) => {\n const { side = 'start', forceMount, container, className, ...ownProps } = allProps;\n const restProps = useThemeSizeProps(ownProps, sheetPropDefs.size);\n const normalizedSideMap: Record<SheetSide, 'start' | 'end' | 'top' | 'bottom'> = {\n left: 'start',\n right: 'end',\n start: 'start',\n end: 'end',\n top: 'top',\n bottom: 'bottom',\n };\n const normalizedSide = normalizedSideMap[side];\n // Size/width/height class names come from the dialog defs \u2014 see `sheetPropDefs`.\n const { className: extractedClassName, ...contentProps } = extractProps(restProps, sheetPropDefs);\n\n // Dev-only a11y guard: the panel needs a name. A Sheet.Title anywhere inside counts it\n // in a layout effect, which runs before this ref is attached, so nesting doesn't matter.\n const titleCountRef = React.useRef(0);\n const closeWarningRef = useCloseWarning('Sheet');\n const combinedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n if (process.env.NODE_ENV !== 'production' && node) {\n const hasName = titleCountRef.current > 0 || Boolean(node.getAttribute('aria-label')) || Boolean(node.getAttribute('aria-labelledby'));\n if (!hasName) {\n console.warn('Sheet.Content: Missing accessible name. Include Sheet.Title inside it or provide aria-label.');\n }\n }\n closeWarningRef(node);\n },\n [forwardedRef, closeWarningRef],\n );\n\n useBodyPointerEventsCleanup();\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <SheetTitleCountContext.Provider value={titleCountRef}>\n <PortalTheme asChild>\n <DialogPrimitive.Overlay className=\"kui-BaseDialogOverlay kui-DialogOverlay kui-SheetOverlay\">\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('kui-BaseDialogContent', 'kui-SheetContent', className, extractedClassName)}\n data-side={normalizedSide}\n aria-modal=\"true\"\n children={<NavigatorHostContext.Provider value={sheetNavigatorHost}>{contentProps.children}</NavigatorHostContext.Provider>}\n />\n </DialogPrimitive.Overlay>\n </PortalTheme>\n </SheetTitleCountContext.Provider>\n </DialogPrimitive.Portal>\n );\n});\nContent.displayName = 'Sheet.Content';\n\n// Title - renders as Heading with sensible defaults\ntype SheetTitleElement = React.ElementRef<typeof Heading>;\ntype SheetTitleProps = HeadingProps;\n/** Accessible title for the Sheet. Renders as Heading with sensible defaults. */\nconst Title = React.forwardRef<SheetTitleElement, SheetTitleProps>(({ size = '4', weight = 'medium', ...props }, ref) => {\n const titleCountRef = React.useContext(SheetTitleCountContext);\n React.useLayoutEffect(() => {\n if (!titleCountRef) return;\n titleCountRef.current += 1;\n return () => {\n titleCountRef.current -= 1;\n };\n }, [titleCountRef]);\n return (\n <DialogPrimitive.Title asChild>\n <Heading ref={ref} size={size} weight={weight} {...props} />\n </DialogPrimitive.Title>\n );\n});\nTitle.displayName = 'Sheet.Title';\n\n// Description - renders as Text with sensible defaults\ntype SheetDescriptionElement = React.ElementRef<typeof Text>;\ntype SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof Text>;\n/** Supplementary description text for Sheet content. Renders as Text with sensible defaults. */\nconst Description = React.forwardRef<SheetDescriptionElement, SheetDescriptionProps>(({ size = '2', emphasis = 'medium', ...rest }, ref) => (\n <DialogPrimitive.Description asChild>\n <Text ref={ref} size={size} emphasis={emphasis} {...rest} />\n </DialogPrimitive.Description>\n));\nDescription.displayName = 'Sheet.Description';\n\ntype SheetCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface SheetCloseProps extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\n/** Close button for the Sheet. Expects a single element child rendered via `asChild`. */\nconst Close = React.forwardRef<SheetCloseElement, SheetCloseProps>(({ children, ...props }, ref) => (\n <DialogPrimitive.Close {...props} ref={ref} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n));\nClose.displayName = 'Sheet.Close';\n\nexport { Root, Trigger, Content, Title, Description, Close };\nexport type {\n SheetRootProps as RootProps,\n SheetTriggerProps as TriggerProps,\n SheetContentProps as ContentProps,\n SheetTitleProps as TitleProps,\n SheetDescriptionProps as DescriptionProps,\n SheetCloseProps as CloseProps,\n};\n"],
5
+ "mappings": ";mbAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAqCA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,UAAUC,MAAuB,WAiC1C,IAAMC,EAAkCC,GAAU,gBAACC,EAAgB,KAAhB,CAAsB,GAAGD,EAAO,MAAK,GAAC,EACzFD,EAAK,YAAc,aAOnB,IAAMG,EAAgB,aAAmD,CAAC,CAAE,SAAAC,EAAU,GAAGH,CAAM,EAAGI,IAChG,gBAACH,EAAgB,QAAhB,CAAyB,GAAGD,EAAO,IAAKI,EAAK,QAAO,IAClDC,EAAoBF,CAAQ,CAC/B,CACD,EACDD,EAAQ,YAAc,gBAQtB,GAAM,CAAE,MAAOI,GAAe,GAAGC,CAAuB,EAAIC,EACtDC,EAAgBF,EAGhBG,EAAoC,CACxC,MAAO,CAAC,CAAE,SAAAP,CAAS,IAAM,gBAACF,EAAgB,MAAhB,CAAsB,QAAO,IAAEE,CAAS,EAClE,MAAO,CAAC,CAAE,SAAAA,CAAS,IAAM,gBAACF,EAAgB,MAAhB,CAAsB,QAAO,IAAEE,CAAS,CACpE,EAGMQ,EAA+B,gBAAqD,IAAI,EAiBxFC,EAAgB,aAAmD,CAACC,EAAUC,IAAiB,CACnG,GAAM,CAAE,KAAAC,EAAO,QAAS,WAAAC,EAAY,UAAAC,EAAW,UAAAC,EAAW,GAAGC,CAAS,EAAIN,EACpEO,EAAYC,EAAkBF,EAAUV,EAAc,IAAI,EAS1Da,EAR2E,CAC/E,KAAM,QACN,MAAO,MACP,MAAO,QACP,IAAK,MACL,IAAK,MACL,OAAQ,QACV,EACyCP,CAAI,EAEvC,CAAE,UAAWQ,EAAoB,GAAGC,CAAa,EAAIC,EAAaL,EAAWX,CAAa,EAI1FiB,EAAsB,SAAO,CAAC,EAC9BC,EAAkBC,EAAgB,OAAO,EACzCC,EAAoB,cACvBC,GAAgC,CAC3B,OAAOhB,GAAiB,WAC1BA,EAAagB,CAAI,EACRhB,IACTA,EAAa,QAAUgB,GAQzBH,EAAgBG,CAAI,CACtB,EACA,CAAChB,EAAca,CAAe,CAChC,EAEA,OAAAI,EAA4B,EAG1B,gBAAC9B,EAAgB,OAAhB,CAAuB,UAAWgB,EAAW,WAAYD,GACxD,gBAACL,EAAuB,SAAvB,CAAgC,MAAOe,GACtC,gBAACM,EAAA,CAAY,QAAO,IAClB,gBAAC/B,EAAgB,QAAhB,CAAwB,UAAU,4DACjC,gBAACA,EAAgB,QAAhB,CACE,GAAGuB,EACJ,IAAKK,EACL,UAAWI,EAAW,wBAAyB,mBAAoBf,EAAWK,CAAkB,EAChG,YAAWD,EACX,aAAW,OACX,SAAU,gBAACY,EAAqB,SAArB,CAA8B,MAAOxB,GAAqBc,EAAa,QAAS,EAC7F,CACF,CACF,CACF,CACF,CAEJ,CAAC,EACDZ,EAAQ,YAAc,gBAMtB,IAAMuB,EAAc,aAA+C,CAAC,CAAE,KAAAC,EAAO,IAAK,OAAAC,EAAS,SAAU,GAAGrC,CAAM,EAAGI,IAAQ,CACvH,IAAMsB,EAAsB,aAAWf,CAAsB,EAC7D,OAAM,kBAAgB,IAAM,CAC1B,GAAKe,EACL,OAAAA,EAAc,SAAW,EAClB,IAAM,CACXA,EAAc,SAAW,CAC3B,CACF,EAAG,CAACA,CAAa,CAAC,EAEhB,gBAACzB,EAAgB,MAAhB,CAAsB,QAAO,IAC5B,gBAACqC,EAAA,CAAQ,IAAKlC,EAAK,KAAMgC,EAAM,OAAQC,EAAS,GAAGrC,EAAO,CAC5D,CAEJ,CAAC,EACDmC,EAAM,YAAc,cAMpB,IAAMI,EAAoB,aAA2D,CAAC,CAAE,KAAAH,EAAO,IAAK,SAAAI,EAAW,SAAU,GAAGC,CAAK,EAAGrC,IAClI,gBAACH,EAAgB,YAAhB,CAA4B,QAAO,IAClC,gBAACyC,EAAA,CAAK,IAAKtC,EAAK,KAAMgC,EAAM,SAAUI,EAAW,GAAGC,EAAM,CAC5D,CACD,EACDF,EAAY,YAAc,oBAK1B,IAAMI,EAAc,aAA+C,CAAC,CAAE,SAAAxC,EAAU,GAAGH,CAAM,EAAGI,IAC1F,gBAACH,EAAgB,MAAhB,CAAuB,GAAGD,EAAO,IAAKI,EAAK,QAAO,IAChDC,EAAoBF,CAAQ,CAC/B,CACD,EACDwC,EAAM,YAAc",
6
+ "names": ["sheet_exports", "__export", "Close", "Content", "Description", "Root", "Title", "Trigger", "React", "classNames", "DialogPrimitive", "Root", "props", "DialogPrimitive", "Trigger", "children", "ref", "requireReactElement", "_alignPropDef", "dialogPropDefsForSheet", "dialogContentPropDefs", "sheetPropDefs", "sheetNavigatorHost", "SheetTitleCountContext", "Content", "allProps", "forwardedRef", "side", "forceMount", "container", "className", "ownProps", "restProps", "useThemeSizeProps", "normalizedSide", "extractedClassName", "contentProps", "extractProps", "titleCountRef", "closeWarningRef", "useCloseWarning", "combinedRef", "node", "useBodyPointerEventsCleanup", "PortalTheme", "classNames", "NavigatorHostContext", "Title", "size", "weight", "Heading", "Description", "emphasis", "rest", "Text", "Close"]
7
+ }
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{c as v}from"./chunk-5ON3XLRD.js";import{c}from"./chunk-HBWBPBSA.js";import{b as y}from"./chunk-XU74PNM2.js";import{b,c as P}from"./chunk-OKQAVYW4.js";import*as e from"react";import x from"classnames";var w=["1","2","3","4"],I=["raised","surface","soft","outline","ghost"],j=["none","vertical","horizontal","both"],p={size:{type:"enum",className:"kui-r-size",values:w,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:I,default:"raised"},resize:{type:"enum",className:"kui-r-resize",values:j,responsive:!0},error:{type:"boolean",default:!1},errorMessage:{type:"string",default:void 0},required:{type:"boolean",default:!1},"aria-describedby":{type:"string",default:void 0},"aria-labelledby":{type:"string",default:void 0},...c,...y};var q=e.forwardRef((g,A)=>{let{className:d,style:l,...D}=v(g,p.size),{className:T,color:z,radius:N,style:u,...r}=P(D,p),a=!!r.errorMessage,o=e.useId(),{"aria-describedby":i,"aria-labelledby":f,"aria-invalid":s}=r,n=!!r.error||s===!0||s==="true",m=e.useMemo(()=>{let t=[];return r.errorMessage&&t.push(o),i&&t.push(i),t.length>0?t.join(" "):void 0},[r.errorMessage,i,o]),h=e.useMemo(()=>({"aria-invalid":n?!0:s,"aria-describedby":m,"aria-labelledby":f}),[n,s,m,f]),{error:E,errorMessage:B,required:R,"aria-describedby":C,"aria-labelledby":S,...M}=r,k=e.createElement("div",{"data-accent-color":z,"data-radius":N,className:x("kui-TextAreaRoot",T,!a&&d,{"kui-error":n}),style:a?u:b(u,l)},e.createElement("textarea",{className:"kui-reset kui-TextAreaInput",ref:A,...M,required:R||void 0,...h}));return e.createElement("div",{className:x("kui-TextAreaWrapper",a&&d),style:a?l:void 0,"data-message":a||void 0},k,a?e.createElement("div",{id:o,className:"kui-TextAreaErrorMessage",role:"alert"},r.errorMessage):null)});q.displayName="TextArea";export{q as a};
3
- //# sourceMappingURL=chunk-D42VCLKH.js.map
2
+ import{c}from"./chunk-HBWBPBSA.js";import{c as v}from"./chunk-5ON3XLRD.js";import{b as y}from"./chunk-XU74PNM2.js";import{b,c as P}from"./chunk-OKQAVYW4.js";import*as e from"react";import x from"classnames";var w=["1","2","3","4"],I=["raised","surface","soft","outline","ghost"],j=["none","vertical","horizontal","both"],p={size:{type:"enum",className:"kui-r-size",values:w,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:I,default:"raised"},resize:{type:"enum",className:"kui-r-resize",values:j,responsive:!0},error:{type:"boolean",default:!1},errorMessage:{type:"string",default:void 0},required:{type:"boolean",default:!1},"aria-describedby":{type:"string",default:void 0},"aria-labelledby":{type:"string",default:void 0},...c,...y};var q=e.forwardRef((g,A)=>{let{className:d,style:l,...D}=v(g,p.size),{className:T,color:z,radius:N,style:u,...r}=P(D,p),a=!!r.errorMessage,o=e.useId(),{"aria-describedby":i,"aria-labelledby":f,"aria-invalid":s}=r,n=!!r.error||s===!0||s==="true",m=e.useMemo(()=>{let t=[];return r.errorMessage&&t.push(o),i&&t.push(i),t.length>0?t.join(" "):void 0},[r.errorMessage,i,o]),h=e.useMemo(()=>({"aria-invalid":n?!0:s,"aria-describedby":m,"aria-labelledby":f}),[n,s,m,f]),{error:E,errorMessage:B,required:R,"aria-describedby":C,"aria-labelledby":S,...M}=r,k=e.createElement("div",{"data-accent-color":z,"data-radius":N,className:x("kui-TextAreaRoot",T,!a&&d,{"kui-error":n}),style:a?u:b(u,l)},e.createElement("textarea",{className:"kui-reset kui-TextAreaInput",ref:A,...M,required:R||void 0,...h}));return e.createElement("div",{className:x("kui-TextAreaWrapper",a&&d),style:a?l:void 0,"data-message":a||void 0},k,a?e.createElement("div",{id:o,className:"kui-TextAreaErrorMessage",role:"alert"},r.errorMessage):null)});q.displayName="TextArea";export{q as a};
3
+ //# sourceMappingURL=chunk-ICO5ULJL.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as r}from"./chunk-YLPCYCYA.js";import*as e from"react";import d from"classnames";import{Toggle as g}from"radix-ui";var i=e.forwardRef(({pressed:o,onPressedChange:t,defaultPressed:s,children:a,className:l,...n},p)=>{delete n.done;let u=e.useRef(!1);return e.useEffect(()=>{},[o,t]),e.createElement(g.Root,{pressed:o,onPressedChange:t,defaultPressed:s,asChild:!0},e.createElement(r,{...n,ref:p,className:d("kui-Toggle",l)},a))});i.displayName="Toggle";export{i as a};
3
- //# sourceMappingURL=chunk-FYZXC7AL.js.map
2
+ import{a as r}from"./chunk-WT4IDG2W.js";import*as e from"react";import d from"classnames";import{Toggle as g}from"radix-ui";var i=e.forwardRef(({pressed:o,onPressedChange:t,defaultPressed:s,children:a,className:l,...n},p)=>{delete n.done;let u=e.useRef(!1);return e.useEffect(()=>{},[o,t]),e.createElement(g.Root,{pressed:o,onPressedChange:t,defaultPressed:s,asChild:!0},e.createElement(r,{...n,ref:p,className:d("kui-Toggle",l)},a))});i.displayName="Toggle";export{i as a};
3
+ //# sourceMappingURL=chunk-JJVAVLCN.js.map
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{b as a}from"./chunk-MDQ7ZHOS.js";import*as i from"react";import{useLayoutEffect as u}from"radix-ui/internal";function l(e){return typeof e=="object"&&e!==null}function p(e,t){let n={},o=null;for(let r of a){if(e!==void 0&&!l(e)){n[r]=e;continue}let s=l(e)?e[r]:void 0;s!==void 0&&(o={value:s}),n[r]=o?o.value:t(r)}return n}function c(e){let t=e.initial;return a.every(n=>e[n]===t)?t:void 0}function m(e,t){let n=c(t);if(n!==void 0)return{[`data-${e}`]:n};let o={};for(let r of a)o[`data-${e}-${r}`]=t[r];return o}function T(e){return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}var g=p("fixed",()=>"fixed");function h(){return{entries:new Map,listeners:new Set,version:0}}function y(e){e.version+=1;for(let t of e.listeners)t()}function f(e,t){return e.listeners.add(t),()=>{e.listeners.delete(t)}}var d=i.createContext(null);function P(e){let t=i.useContext(d);if(!t)throw new Error(`${e} must be used within <Shell.Root>`);return t}function R(e,t){let n=i.useCallback(r=>f(e,r),[e]),o=i.useCallback(()=>e.entries.get(t),[e,t]);return i.useSyncExternalStore(n,o,()=>{})}var S=i.createContext(null);function v(e,t){let n=i.useContext(S);if(!n)throw new Error("Shell panes must be used within <Shell.Root>");let{registerOffFrame:o,unregisterOffFrame:r}=n;u(()=>{if(!t)return o(e),()=>r(e)},[e,t,o,r])}export{p as a,c as b,m as c,T as d,g as e,h as f,y as g,f as h,d as i,P as j,R as k,S as l,v as m};
3
+ //# sourceMappingURL=chunk-LBAC2X4U.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/_internal/shell-store.tsx"],
4
- "sourcesContent": ["'use client';\n\n/**\n * The Shell's state model (0.8.0), ported from kookie-ui-v2's Shell.\n *\n * - State lives on the pane. Each pane holds `auto | open | closed`.\n * `auto` means untouched: the stylesheet decides what\n * it shows at each breakpoint, so first paint is right with no script, the\n * server and the client render the same markup, and no open-state callback\n * can fire on mount or on a resize.\n * - The one thing that crosses the Shell is a registry keyed by pane name.\n * Each pane registers what it is and how to drive it; a Trigger looks its\n * pane up, and the Root reads the set of live overlays. Nothing scans\n * children and nothing checks `displayName`.\n * - The responsive props are resolved into a table with one value per\n * breakpoint, from the props alone, with no window. The table is written to\n * the DOM as data attributes for the stylesheet, and read again in JS by the\n * mirror that sets `aria-expanded`. One table, two readers, so they agree by\n * construction.\n */\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport { SHELL_BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneName, PresentationValue } from '../shell.types.js';\n\n/* \u2500\u2500 Breakpoint tables \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type Table<T> = Record<Breakpoint, T>;\n\n/** What a pane shows: open or closed. */\nexport type PaneValue = 'open' | 'closed';\n\ntype ResponsiveInput<T> = T | Partial<Record<Breakpoint, T>> | undefined;\n\nfunction isMap<T>(value: ResponsiveInput<T>): value is Partial<Record<Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * A responsive value at every breakpoint. A breakpoint takes the largest key\n * at or below it, the same fallback `useResponsiveValue` used; a breakpoint\n * below every key takes `fallback`.\n */\nexport function tableOf<T>(value: ResponsiveInput<T>, fallback: (bp: Breakpoint) => T): Table<T> {\n const table = {} as Table<T>;\n let carried: { value: T } | null = null;\n for (const bp of SHELL_BREAKPOINTS) {\n if (value !== undefined && !isMap(value)) {\n table[bp] = value;\n continue;\n }\n const entry = isMap(value) ? value[bp] : undefined;\n if (entry !== undefined) carried = { value: entry };\n table[bp] = carried ? carried.value : fallback(bp);\n }\n return table;\n}\n\n/** The table's one value, when it has only one. */\nexport function constantOf<T>(table: Table<T>): T | undefined {\n const first = table.initial;\n return SHELL_BREAKPOINTS.every((bp) => table[bp] === first) ? first : undefined;\n}\n\n/**\n * The table as data attributes: `data-<name>` when it holds one value, one\n * `data-<name>-<bp>` per breakpoint when it holds several. The stylesheet has\n * a rule for each spelling.\n */\nexport function tableAttributes(name: string, table: Table<string>): Record<string, string> {\n const constant = constantOf(table);\n if (constant !== undefined) return { [`data-${name}`]: constant };\n const attributes: Record<string, string> = {};\n for (const bp of SHELL_BREAKPOINTS) attributes[`data-${name}-${bp}`] = table[bp];\n return attributes;\n}\n\n/**\n * A responsive prop object is usually an inline literal, a new identity every\n * render. Keying memoisation on its contents keeps the tables, and so the\n * registry entries, stable across renders that change nothing.\n */\nexport function useStableKey(value: unknown): string {\n return typeof value === 'object' && value !== null ? JSON.stringify(value) : String(value);\n}\n\nexport const FIXED_TABLE: Table<PresentationValue> = tableOf<PresentationValue>('fixed', () => 'fixed');\n\n/* \u2500\u2500 The registry \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type OpenChangeReason = 'toggle' | 'dismiss';\n\nexport type PaneEntry = {\n name: PaneName;\n id: string;\n el: HTMLElement | null;\n /** What the pane shows now; `undefined` while an untouched pane cannot know (before the breakpoint is known). */\n value: PaneValue | undefined;\n /** How the pane is presented now, when known. */\n presentation: PresentationValue | undefined;\n /** The pane's own presentation at every breakpoint. A Panel with none of its own follows the Rail's. */\n presentationTable: Table<PresentationValue>;\n /** Open and presented as an overlay: what the scrim and Escape close, and what containment exempts. */\n overlayLive: boolean;\n /** The pane's designed open width, for panes that sit beside it when floating. */\n size: number;\n setValue: (value: PaneValue, reason: OpenChangeReason) => void;\n toggle: (reason: OpenChangeReason) => void;\n};\n\nexport type ShellStore = {\n entries: Map<PaneName, PaneEntry>;\n listeners: Set<() => void>;\n /**\n * What a subscriber reads. useSyncExternalStore needs a value that is stable\n * between notifications, and a number is; the Map, or anything derived from\n * it, would be a new identity on every read.\n */\n version: number;\n /** The pane a hovered Trigger is previewing, if any. Layout only. */\n peek: PaneName | null;\n};\n\nexport function createShellStore(): ShellStore {\n return { entries: new Map(), listeners: new Set(), version: 0, peek: null };\n}\n\nexport function notifyShellStore(store: ShellStore) {\n store.version += 1;\n for (const listener of store.listeners) listener();\n}\n\nexport function subscribeShellStore(store: ShellStore, listener: () => void) {\n store.listeners.add(listener);\n return () => {\n store.listeners.delete(listener);\n };\n}\n\nexport function setShellPeek(store: ShellStore, peek: PaneName | null) {\n if (store.peek === peek) return;\n store.peek = peek;\n notifyShellStore(store);\n}\n\nexport const ShellStoreContext = React.createContext<ShellStore | null>(null);\n\nexport function useShellStore(part: string): ShellStore {\n const store = React.useContext(ShellStoreContext);\n if (!store) throw new Error(`${part} must be used within <Shell.Root>`);\n return store;\n}\n\n/** One pane's registry entry. Re-renders only when that entry is replaced. */\nexport function usePaneEntry(store: ShellStore, name: PaneName): PaneEntry | undefined {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n const getSnapshot = React.useCallback(() => store.entries.get(name), [store, name]);\n return React.useSyncExternalStore(subscribe, getSnapshot, () => undefined);\n}\n\n/**\n * Whether this pane is the one being previewed. A boolean per pane rather than\n * the peek target itself, so hovering one Trigger re-renders one pane, not all.\n */\nexport function usePeeking(store: ShellStore, name: PaneName): boolean {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n return React.useSyncExternalStore(\n subscribe,\n () => store.peek === name,\n () => false,\n );\n}\n\n/* \u2500\u2500 Off the frame \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type FramePaneId = 'rail' | 'panel' | 'sidebar' | 'content' | 'inspector' | 'bottom';\n\nexport const ShellFrameContext = React.createContext<{\n registerOffFrame: (id: FramePaneId) => void;\n unregisterOffFrame: (id: FramePaneId) => void;\n} | null>(null);\n\n/** Tells the Root a pane is off the frame (`flush={false}`); the Rail's card moves a floating Panel over. */\nexport function useFrameRegistration(id: FramePaneId, flush: boolean) {\n const ctx = React.useContext(ShellFrameContext);\n if (!ctx) throw new Error('Shell panes must be used within <Shell.Root>');\n const { registerOffFrame, unregisterOffFrame } = ctx;\n useLayoutEffect(() => {\n if (flush) return;\n registerOffFrame(id);\n return () => unregisterOffFrame(id);\n }, [id, flush, registerOffFrame, unregisterOffFrame]);\n}\n\n/* \u2500\u2500 Development warnings \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst warned = new Set<string>();\n\n/** A deprecation warning, once per message per page load. Development only. */\nexport function warnOnce(message: string) {\n if (process.env.NODE_ENV === 'production') return;\n if (warned.has(message)) return;\n warned.add(message);\n console.warn(`[kookie-ui] ${message}`);\n}\n"],
5
- "mappings": "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",
6
- "names": ["React", "useLayoutEffect", "isMap", "value", "tableOf", "fallback", "table", "carried", "bp", "SHELL_BREAKPOINTS", "entry", "constantOf", "first", "tableAttributes", "name", "constant", "attributes", "useStableKey", "FIXED_TABLE", "createShellStore", "notifyShellStore", "store", "listener", "subscribeShellStore", "setShellPeek", "peek", "ShellStoreContext", "useShellStore", "part", "usePaneEntry", "subscribe", "getSnapshot", "usePeeking", "ShellFrameContext", "useFrameRegistration", "id", "flush", "ctx", "registerOffFrame", "unregisterOffFrame", "useLayoutEffect", "warned", "warnOnce", "message"]
4
+ "sourcesContent": ["'use client';\n\n/**\n * The Shell's state model (0.8.0), ported from kookie-ui-v2's Shell.\n *\n * - State lives on the pane. Each pane holds `auto | open | closed`.\n * `auto` means untouched: the stylesheet decides what\n * it shows at each breakpoint, so first paint is right with no script, the\n * server and the client render the same markup, and no open-state callback\n * can fire on mount or on a resize.\n * - The one thing that crosses the Shell is a registry keyed by pane name.\n * Each pane registers what it is and how to drive it; a Trigger looks its\n * pane up, and the Root reads the set of live overlays. Nothing scans\n * children and nothing checks `displayName`.\n * - The responsive props are resolved into a table with one value per\n * breakpoint, from the props alone, with no window. The table is written to\n * the DOM as data attributes for the stylesheet, and read again in JS by the\n * mirror that sets `aria-expanded`. One table, two readers, so they agree by\n * construction.\n */\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport { SHELL_BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneName, PresentationValue } from '../shell.types.js';\n\n/* \u2500\u2500 Breakpoint tables \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type Table<T> = Record<Breakpoint, T>;\n\n/** What a pane shows: open or closed. */\nexport type PaneValue = 'open' | 'closed';\n\ntype ResponsiveInput<T> = T | Partial<Record<Breakpoint, T>> | undefined;\n\nfunction isMap<T>(value: ResponsiveInput<T>): value is Partial<Record<Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * A responsive value at every breakpoint. A breakpoint takes the largest key\n * at or below it, the same fallback `useResponsiveValue` used; a breakpoint\n * below every key takes `fallback`.\n */\nexport function tableOf<T>(value: ResponsiveInput<T>, fallback: (bp: Breakpoint) => T): Table<T> {\n const table = {} as Table<T>;\n let carried: { value: T } | null = null;\n for (const bp of SHELL_BREAKPOINTS) {\n if (value !== undefined && !isMap(value)) {\n table[bp] = value;\n continue;\n }\n const entry = isMap(value) ? value[bp] : undefined;\n if (entry !== undefined) carried = { value: entry };\n table[bp] = carried ? carried.value : fallback(bp);\n }\n return table;\n}\n\n/** The table's one value, when it has only one. */\nexport function constantOf<T>(table: Table<T>): T | undefined {\n const first = table.initial;\n return SHELL_BREAKPOINTS.every((bp) => table[bp] === first) ? first : undefined;\n}\n\n/**\n * The table as data attributes: `data-<name>` when it holds one value, one\n * `data-<name>-<bp>` per breakpoint when it holds several. The stylesheet has\n * a rule for each spelling.\n */\nexport function tableAttributes(name: string, table: Table<string>): Record<string, string> {\n const constant = constantOf(table);\n if (constant !== undefined) return { [`data-${name}`]: constant };\n const attributes: Record<string, string> = {};\n for (const bp of SHELL_BREAKPOINTS) attributes[`data-${name}-${bp}`] = table[bp];\n return attributes;\n}\n\n/**\n * A responsive prop object is usually an inline literal, a new identity every\n * render. Keying memoisation on its contents keeps the tables, and so the\n * registry entries, stable across renders that change nothing.\n */\nexport function useStableKey(value: unknown): string {\n return typeof value === 'object' && value !== null ? JSON.stringify(value) : String(value);\n}\n\nexport const FIXED_TABLE: Table<PresentationValue> = tableOf<PresentationValue>('fixed', () => 'fixed');\n\n/* \u2500\u2500 The registry \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type OpenChangeReason = 'toggle' | 'dismiss';\n\nexport type PaneEntry = {\n name: PaneName;\n id: string;\n el: HTMLElement | null;\n /** What the pane shows now; `undefined` while an untouched pane cannot know (before the breakpoint is known). */\n value: PaneValue | undefined;\n /** How the pane is presented now, when known. */\n presentation: PresentationValue | undefined;\n /** The pane's own presentation at every breakpoint. A Panel with none of its own follows the Rail's. */\n presentationTable: Table<PresentationValue>;\n /** Open and presented as an overlay: what the scrim and Escape close, and what containment exempts. */\n overlayLive: boolean;\n /** The pane's designed open width, for panes that sit beside it when floating. */\n size: number;\n setValue: (value: PaneValue, reason: OpenChangeReason) => void;\n toggle: (reason: OpenChangeReason) => void;\n};\n\nexport type ShellStore = {\n entries: Map<PaneName, PaneEntry>;\n listeners: Set<() => void>;\n /**\n * What a subscriber reads. useSyncExternalStore needs a value that is stable\n * between notifications, and a number is; the Map, or anything derived from\n * it, would be a new identity on every read.\n */\n version: number;\n};\n\nexport function createShellStore(): ShellStore {\n return { entries: new Map(), listeners: new Set(), version: 0 };\n}\n\nexport function notifyShellStore(store: ShellStore) {\n store.version += 1;\n for (const listener of store.listeners) listener();\n}\n\nexport function subscribeShellStore(store: ShellStore, listener: () => void) {\n store.listeners.add(listener);\n return () => {\n store.listeners.delete(listener);\n };\n}\n\nexport const ShellStoreContext = React.createContext<ShellStore | null>(null);\n\nexport function useShellStore(part: string): ShellStore {\n const store = React.useContext(ShellStoreContext);\n if (!store) throw new Error(`${part} must be used within <Shell.Root>`);\n return store;\n}\n\n/** One pane's registry entry. Re-renders only when that entry is replaced. */\nexport function usePaneEntry(store: ShellStore, name: PaneName): PaneEntry | undefined {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n const getSnapshot = React.useCallback(() => store.entries.get(name), [store, name]);\n return React.useSyncExternalStore(subscribe, getSnapshot, () => undefined);\n}\n\n/* \u2500\u2500 Off the frame \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type FramePaneId = 'rail' | 'panel' | 'sidebar' | 'content' | 'inspector' | 'bottom';\n\nexport const ShellFrameContext = React.createContext<{\n registerOffFrame: (id: FramePaneId) => void;\n unregisterOffFrame: (id: FramePaneId) => void;\n} | null>(null);\n\n/** Tells the Root a pane is off the frame (`flush={false}`); the Rail's card moves a floating Panel over. */\nexport function useFrameRegistration(id: FramePaneId, flush: boolean) {\n const ctx = React.useContext(ShellFrameContext);\n if (!ctx) throw new Error('Shell panes must be used within <Shell.Root>');\n const { registerOffFrame, unregisterOffFrame } = ctx;\n useLayoutEffect(() => {\n if (flush) return;\n registerOffFrame(id);\n return () => unregisterOffFrame(id);\n }, [id, flush, registerOffFrame, unregisterOffFrame]);\n}\n"],
5
+ "mappings": ";wCAoBA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,MAAuB,oBAahC,SAASC,EAASC,EAAoE,CACpF,OAAO,OAAOA,GAAU,UAAYA,IAAU,IAChD,CAOO,SAASC,EAAWD,EAA2BE,EAA2C,CAC/F,IAAMC,EAAQ,CAAC,EACXC,EAA+B,KACnC,QAAWC,KAAMC,EAAmB,CAClC,GAAIN,IAAU,QAAa,CAACD,EAAMC,CAAK,EAAG,CACxCG,EAAME,CAAE,EAAIL,EACZ,QACF,CACA,IAAMO,EAAQR,EAAMC,CAAK,EAAIA,EAAMK,CAAE,EAAI,OACrCE,IAAU,SAAWH,EAAU,CAAE,MAAOG,CAAM,GAClDJ,EAAME,CAAE,EAAID,EAAUA,EAAQ,MAAQF,EAASG,CAAE,CACnD,CACA,OAAOF,CACT,CAGO,SAASK,EAAcL,EAAgC,CAC5D,IAAMM,EAAQN,EAAM,QACpB,OAAOG,EAAkB,MAAOD,GAAOF,EAAME,CAAE,IAAMI,CAAK,EAAIA,EAAQ,MACxE,CAOO,SAASC,EAAgBC,EAAcR,EAA8C,CAC1F,IAAMS,EAAWJ,EAAWL,CAAK,EACjC,GAAIS,IAAa,OAAW,MAAO,CAAE,CAAC,QAAQD,CAAI,EAAE,EAAGC,CAAS,EAChE,IAAMC,EAAqC,CAAC,EAC5C,QAAWR,KAAMC,EAAmBO,EAAW,QAAQF,CAAI,IAAIN,CAAE,EAAE,EAAIF,EAAME,CAAE,EAC/E,OAAOQ,CACT,CAOO,SAASC,EAAad,EAAwB,CACnD,OAAO,OAAOA,GAAU,UAAYA,IAAU,KAAO,KAAK,UAAUA,CAAK,EAAI,OAAOA,CAAK,CAC3F,CAEO,IAAMe,EAAwCd,EAA2B,QAAS,IAAM,OAAO,EAmC/F,SAASe,GAA+B,CAC7C,MAAO,CAAE,QAAS,IAAI,IAAO,UAAW,IAAI,IAAO,QAAS,CAAE,CAChE,CAEO,SAASC,EAAiBC,EAAmB,CAClDA,EAAM,SAAW,EACjB,QAAWC,KAAYD,EAAM,UAAWC,EAAS,CACnD,CAEO,SAASC,EAAoBF,EAAmBC,EAAsB,CAC3E,OAAAD,EAAM,UAAU,IAAIC,CAAQ,EACrB,IAAM,CACXD,EAAM,UAAU,OAAOC,CAAQ,CACjC,CACF,CAEO,IAAME,EAA0B,gBAAiC,IAAI,EAErE,SAASC,EAAcC,EAA0B,CACtD,IAAML,EAAc,aAAWG,CAAiB,EAChD,GAAI,CAACH,EAAO,MAAM,IAAI,MAAM,GAAGK,CAAI,mCAAmC,EACtE,OAAOL,CACT,CAGO,SAASM,EAAaN,EAAmBP,EAAuC,CACrF,IAAMc,EAAkB,cAAaN,GAAyBC,EAAoBF,EAAOC,CAAQ,EAAG,CAACD,CAAK,CAAC,EACrGQ,EAAoB,cAAY,IAAMR,EAAM,QAAQ,IAAIP,CAAI,EAAG,CAACO,EAAOP,CAAI,CAAC,EAClF,OAAa,uBAAqBc,EAAWC,EAAa,IAAG,EAAY,CAC3E,CAMO,IAAMC,EAA0B,gBAG7B,IAAI,EAGP,SAASC,EAAqBC,EAAiBC,EAAgB,CACpE,IAAMC,EAAY,aAAWJ,CAAiB,EAC9C,GAAI,CAACI,EAAK,MAAM,IAAI,MAAM,8CAA8C,EACxE,GAAM,CAAE,iBAAAC,EAAkB,mBAAAC,CAAmB,EAAIF,EACjDG,EAAgB,IAAM,CACpB,GAAI,CAAAJ,EACJ,OAAAE,EAAiBH,CAAE,EACZ,IAAMI,EAAmBJ,CAAE,CACpC,EAAG,CAACA,EAAIC,EAAOE,EAAkBC,CAAkB,CAAC,CACtD",
6
+ "names": ["React", "useLayoutEffect", "isMap", "value", "tableOf", "fallback", "table", "carried", "bp", "SHELL_BREAKPOINTS", "entry", "constantOf", "first", "tableAttributes", "name", "constant", "attributes", "useStableKey", "FIXED_TABLE", "createShellStore", "notifyShellStore", "store", "listener", "subscribeShellStore", "ShellStoreContext", "useShellStore", "part", "usePaneEntry", "subscribe", "getSnapshot", "ShellFrameContext", "useFrameRegistration", "id", "flush", "ctx", "registerOffFrame", "unregisterOffFrame", "useLayoutEffect"]
7
7
  }
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as nt}from"./chunk-TANYRHGP.js";import{a as Be}from"./chunk-WUCBFB25.js";import{a as we}from"./chunk-YLPCYCYA.js";import{a as Ae}from"./chunk-FICBVI4M.js";import{a as De}from"./chunk-BUXK5VGR.js";import{a as ze}from"./chunk-KVVRFWGQ.js";import{b as U}from"./chunk-5KMEUZWN.js";import{g as Qe,h as Ze,j as et}from"./chunk-GKDGNPBD.js";import{b as tt}from"./chunk-5ON3XLRD.js";import{a as at}from"./chunk-DFQIIYLD.js";import{a as Ht}from"./chunk-VQPANPMI.js";var Wt={};Ht(Wt,{AttachTrigger:()=>Rt,Attachment:()=>$e,AttachmentsRow:()=>pt,InlineEnd:()=>mt,InlineStart:()=>dt,Item:()=>bt,Root:()=>lt,Row:()=>Ct,RowEnd:()=>vt,RowStart:()=>gt,Send:()=>yt,Textarea:()=>ut});import*as e from"react";import E from"classnames";import{useComposedRefs as st,useLayoutEffect as je}from"radix-ui/internal";import{useDropzone as Ft}from"react-dropzone";function ot(t,r){let{placeholder:a}=t;if(!a){r();return}t.placeholder="";try{r()}finally{t.placeholder=a}}var It={values:["1","2","3"]},it=e.createContext(null),We=e.createContext(""),I=()=>{let t=e.useContext(it);if(!t)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return t},me=t=>Array.isArray(t)?t:typeof t=="string"?t.split(",").map(r=>r.trim()).filter(Boolean):[],zt=(t,r)=>{if(r.length===0)return!0;let a=t.type.toLowerCase(),i=t.name.toLowerCase();for(let c of r){let l=c.toLowerCase();if(l.includes("/")){let[u,d]=l.split("/"),[g,y]=a.split("/");if(u==="*"||u===g&&(d==="*"||d===y))return!0}else if(l.startsWith(".")&&i.endsWith(l))return!0}return!1},Dt=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,ct=(t,r)=>(r||"").toLowerCase().startsWith("image/")||Dt.test(t),Ve=t=>t.trim().length>0,rt=(t,r)=>`${t} ${r}${t===1?"":"s"}`,Bt=0,jt=()=>`chatbar-attachment-${Date.now()}-${++Bt}`,lt=e.forwardRef((t,r)=>{let{className:a,style:i,children:c,value:l,defaultValue:u="",onValueChange:d,open:g,defaultOpen:y=!1,onOpenChange:b,expandOn:p="both",minLines:v=3,maxLines:x=6,sendMode:w="whenDirty",disabled:R,readOnly:k,onSubmit:D,size:O,variant:z,color:H,radius:F,width:Q,maxWidth:f,attachments:_,defaultAttachments:B,onAttachmentsChange:se,accept:A,multiple:L=!0,maxAttachments:Z,maxFileSize:G,paste:j=!0,pasteAccept:q,clearOnSubmit:V=!0,onAttachmentReject:M,dropzone:N=!0,apiRef:ke,onBlurCapture:pe,notices:he,context:fe,...Se}=t,W=tt(O,It),Ee=l!=null,[n,C]=e.useState(u),S=Ee?l:n,ee=g!=null,[X,te]=e.useState(y),ie=ee?g:X,Y="attachments"in t,[ce,be]=e.useState(()=>B??[]),le=e.useMemo(()=>Y?_??[]:ce,[Y,_,ce]),[Ke,xt]=e.useState({text:"",id:0}),ue=e.useCallback(o=>xt(s=>({text:o,id:s.id+1})),[]),Ue=e.useRef(null),Pt=st(r,Ue),Te=e.useRef(null),Le=e.useRef(null),de=e.useRef(!1),Re=e.useRef(!1),Ce=e.useRef(void 0),Me=e.useRef(null),_e=me(A).join(","),Ne=me(q).join(","),Oe=e.useMemo(()=>me(_e),[_e]),At=e.useMemo(()=>Ne?me(Ne):Oe,[Ne,Oe]),Ge={value:S,attachments:le,accepts:Oe,pasteAccepts:At,multiple:L,maxAttachments:Z,maxFileSize:G,disabled:R,readOnly:k,expandOn:p,isValueControlled:Ee,isOpenControlled:ee,isAttachmentsControlled:Y,onValueChange:d,onOpenChange:b,onAttachmentsChange:se,onAttachmentReject:M,onSubmit:D},P=e.useRef(Ge);P.current=Ge;let He=e.useRef(null),$=e.useCallback(()=>He.current??P.current.attachments,[]),ae=e.useCallback(o=>{P.current.isOpenControlled||te(o),P.current.onOpenChange?.(o)},[]),ge=e.useCallback(o=>{P.current.isValueControlled||C(o),P.current.onValueChange?.(o)},[]),ne=e.useCallback(o=>{He.current=o,queueMicrotask(()=>{He.current=null}),P.current.isAttachmentsControlled||be(o),P.current.onAttachmentsChange?.(o)},[]),ve=e.useRef(new Set),oe=e.useCallback((o,s,m=P.current.multiple)=>{let h=P.current;if(h.disabled||h.readOnly||o.length===0)return 0;let K=$(),J=[],re=[],Nt=typeof h.maxAttachments=="number"?Math.max(h.maxAttachments-K.length,0):1/0,Ot=m?1/0:1;for(let T of o){if(J.length>=Nt||J.length>=Ot){re.push({file:T,reason:"count"});continue}if(typeof h.maxFileSize=="number"&&T.size>h.maxFileSize){re.push({file:T,reason:"size"});continue}if(!zt(T,s)){re.push({file:T,reason:"type"});continue}let Ie=ct(T.name,T.type)?URL.createObjectURL(T):void 0;Ie&&ve.current.add(Ie),J.push({id:jt(),name:T.name,size:T.size,type:T.type,file:T,url:Ie,status:"idle"})}let Pe=[];return J.length>0&&(ne(K.concat(J)),h.expandOn!=="none"&&ae(!0),Pe.push(`${rt(J.length,"file")} attached.`)),re.length>0&&(h.onAttachmentReject?.(re),Pe.push(`${rt(re.length,"file")} could not be attached.`)),Pe.length>0&&ue(Pe.join(" ")),J.length},[$,ne,ae,ue]),ye=e.useCallback(o=>oe(o,P.current.accepts),[oe]),qe=e.useCallback(o=>oe(o,P.current.pasteAccepts),[oe]),Xe=e.useCallback(o=>{let s=$(),m=s.find(h=>h.id===o);m&&(ne(s.filter(h=>h.id!==o)),ue(`Removed ${m.name}.`))},[$,ne,ue]),Ye=e.useCallback(o=>{let s=P.current;if(s.disabled||s.readOnly)return!1;let m=$();if(!Ve(s.value)&&m.length===0)return!1;let h={value:s.value,attachments:m};if(o&&s.onSubmit)for(let K of m)K.url&&ve.current.delete(K.url);return s.onSubmit?.(h),o&&(ge(""),ne([])),!0},[$,ge,ne]);e.useEffect(()=>{let o=ve.current;if(o.size===0)return;let s=new Set(le.map(m=>m.url));for(let m of Array.from(o))s.has(m)||(URL.revokeObjectURL(m),o.delete(m))},[le]),e.useEffect(()=>{let o=ve.current;return()=>{if(!P.current.isAttachmentsControlled){for(let s of Array.from(o))URL.revokeObjectURL(s);o.clear()}}},[]);let xe=e.useCallback(o=>{let s=P.current,m=Le.current;if(clearTimeout(Ce.current),Re.current=!1,!m||s.disabled||s.readOnly)return;let h=o?.accept!=null?me(o.accept):s.accepts,K=o?.multiple??s.multiple;Me.current={patterns:h,multiple:K},m.accept=h.join(","),m.multiple=K,de.current=!0,m.click(),setTimeout(()=>{document.hasFocus()&&(de.current=!1)},1e3)},[]),Je=e.useCallback(()=>{Re.current=!0,clearTimeout(Ce.current),Ce.current=setTimeout(()=>{Re.current=!1},800)},[]);e.useEffect(()=>()=>clearTimeout(Ce.current),[]),e.useEffect(()=>{let o=Le.current,s=()=>{de.current=!1};return window.addEventListener("focus",s),o?.addEventListener("cancel",s),()=>{window.removeEventListener("focus",s),o?.removeEventListener("cancel",s)}},[]);let wt=e.useCallback(o=>{let s=o.currentTarget,m=Array.from(s.files??[]),h=Me.current;oe(m,h?.patterns??P.current.accepts,h?.multiple),de.current=!1,Me.current=null,s.value=""},[oe]),kt=e.useCallback(o=>{pe?.(o);let s=P.current,m=Ue.current;if(!m||s.expandOn==="none")return;let h=o.relatedTarget;h&&m.contains(h)||de.current||Re.current||!Ve(s.value)&&$().length===0&&ae(!1)},[pe,ae,$]),St=e.useCallback(o=>{ye(o)},[ye]),{getRootProps:Et,isDragActive:Tt}=Ft({onDrop:St,onDragEnter:()=>ue(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!N||R||k}),Fe=N&&Tt;e.useImperativeHandle(ke,()=>({focusTextarea:()=>Te.current?.focus({preventScroll:!0}),openFilePicker:()=>xe()}),[xe]);let Lt=e.useCallback(o=>{if(R||o.pointerType==="mouse"&&o.button!==0)return;let s=o.target;s instanceof Element&&s.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(o.preventDefault(),Te.current?.focus({preventScroll:!0}))},[R]),Mt=e.useMemo(()=>({open:ie,setOpen:ae,setValue:ge,size:W,expandOn:p,minLines:v,maxLines:x,sendMode:w,disabled:R,readOnly:k,paste:j,clearOnSubmit:V,multiple:L,textareaRef:Te,attachments:le,removeAttachment:Xe,submit:Ye,appendFiles:ye,appendFilesFromPaste:qe,openFilePicker:xe,beginFilePickerPress:Je}),[ie,ae,ge,W,p,v,x,w,R,k,j,V,L,le,Xe,Ye,ye,qe,xe,Je]);return e.createElement(it.Provider,{value:Mt},e.createElement(We.Provider,{value:S},e.createElement(e.Fragment,null,e.createElement("div",{...Se,ref:Pt,className:E("kui-ChatbarRoot",`kui-r-size-${W}`,a),style:{position:"relative",width:Q,maxWidth:f,...i},"data-state":ie?"open":"closed","data-disabled":R?"":void 0,"data-readonly":k?"":void 0,"data-drop-active":Fe?"":void 0,"data-accent-color":H,"data-radius":F,onBlurCapture:kt},e.createElement("input",{ref:Le,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:wt}),he?e.createElement("div",{className:"kui-ChatbarNotices"},e.createElement(nt.Provider,{value:W},he)):null,e.createElement("div",{...N?Et():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:Lt},e.createElement("div",{className:E("kui-ChatbarBox",`kui-variant-${z??"raised"}`),style:{position:"relative"},"data-accent-color":H,"data-radius":F},e.createElement("div",{className:"kui-ChatbarGrid"},c),Fe&&e.createElement("div",{className:"kui-ChatbarDropOverlay","aria-hidden":!0},e.createElement("div",{className:"kui-ChatbarDropContent"},e.createElement(Ae,{emphasis:"medium",size:W,weight:"medium"},"Drop files here to attach"))))),fe?e.createElement(Ae,{as:"div",size:W==="3"?"2":"1",emphasis:"medium",className:"kui-ChatbarContext"},fe):null,e.createElement(Be,{role:"status","aria-live":"polite"},Fe?"Drop files here to attach.":e.createElement("span",{key:Ke.id},Ke.text))))))});lt.displayName="Chatbar.Root";var ut=e.forwardRef((t,r)=>{let{className:a,style:i,asChild:c,onFocus:l,onChange:u,onPaste:d,onKeyDown:g,onCompositionStart:y,onCompositionEnd:b,submitOnEnter:p=!1,...v}=t,x=I(),w=e.useContext(We),{open:R,minLines:k,maxLines:D,expandOn:O,disabled:z,readOnly:H,setOpen:F,setValue:Q,textareaRef:f,paste:_,appendFilesFromPaste:B,size:se,submit:A,clearOnSubmit:L}=x,Z=st(r,f),G=e.useRef(0),j=e.useRef(0),q=e.useRef(!1),V=e.useRef({open:R,minLines:k,maxLines:D});je(()=>{V.current={open:R,minLines:k,maxLines:D}},[R,k,D]);let M=e.useCallback(()=>{let n=f.current;if(!n)return;let C=window.getComputedStyle(n);G.current=parseFloat(C.lineHeight)||20,j.current=(parseFloat(C.paddingTop)||0)+(parseFloat(C.paddingBottom)||0)},[f]),N=e.useCallback((n,C)=>{let{minLines:S,maxLines:ee}=V.current,X=G.current,te=j.current,ie=Math.ceil((C?S:1)*X)+te,Y=Math.ceil((C?ee:1)*X)+te,ce=Math.max(n.scrollHeight,ie);n.style.height=`${Math.min(ce,Y)}px`;let be=ce>Y;n.style.overflowY=be?"auto":"hidden",n.style.maxHeight=be?`${Y}px`:"none"},[]);je(()=>{M()},[M,se]),je(()=>{let n=f.current;n&&(G.current===0&&M(),ot(n,()=>{n.style.height="auto";let C=R;if(!R&&(O==="overflow"||O==="both")){let S=Math.ceil(G.current)+j.current;n.scrollHeight>S+1&&(C=!0,F(!0))}N(n,C)}))},[w,R,O,k,D,se,F,f,M,N]),e.useEffect(()=>{let n=f.current;if(!n||typeof ResizeObserver>"u")return;let C=-1,S=new ResizeObserver(ee=>{let X=ee[0]?.contentRect.width??0;if(X===C)return;let te=C===-1;C=X,!te&&(M(),ot(n,()=>{n.style.height="auto",N(n,V.current.open)}))});return S.observe(n),()=>S.disconnect()},[f,M,N]),e.useEffect(()=>{},[]);let ke=e.useCallback(n=>{l?.(n),!(z||H)&&(O==="focus"||O==="both")&&!R&&F(!0)},[z,H,O,R,F,l]),pe=e.useCallback(n=>{Q(n.currentTarget.value),u?.(n)},[Q,u]),he=e.useCallback(n=>{if(d?.(n),n.defaultPrevented||!_||z||H)return;let C=Array.from(n.clipboardData?.items??[]).filter(S=>S.kind==="file").map(S=>S.getAsFile()).filter(S=>!!S);C.length!==0&&B(C)>0&&n.preventDefault()},[_,z,H,d,B]),fe=e.useCallback(n=>{q.current=!0,y?.(n)},[y]),Se=e.useCallback(n=>{q.current=!1,b?.(n)},[b]),W=e.useCallback(n=>{g?.(n),!(n.defaultPrevented||!p)&&(n.key!=="Enter"||n.shiftKey||n.altKey||n.ctrlKey||n.metaKey||q.current||n.nativeEvent.isComposing||n.nativeEvent.keyCode===229||(n.preventDefault(),A(L)))},[p,g,A,L]);return e.createElement("div",{className:"kui-ChatbarField kui-ChatbarTextarea"},e.createElement(c?U:"textarea",{...v,ref:Z,className:E("kui-ChatbarInput",a),value:w,onChange:pe,onFocus:ke,onPaste:he,onKeyDown:W,onCompositionStart:fe,onCompositionEnd:Se,disabled:z,readOnly:H,rows:R?k:1,spellCheck:v.spellCheck??!0,autoCorrect:v.autoCorrect??"on",style:i}))});ut.displayName="Chatbar.Textarea";var dt=e.forwardRef((t,r)=>{let{children:a,asChild:i,className:c,...l}=t;return I().open?null:e.createElement(i?U:"div",{...l,ref:r,className:E("kui-ChatbarInlineStart",c)},a)});dt.displayName="Chatbar.InlineStart";var mt=e.forwardRef((t,r)=>{let{children:a,asChild:i,className:c,...l}=t;return I().open?null:e.createElement(i?U:"div",{...l,ref:r,className:E("kui-ChatbarInlineEnd",c)},a)});mt.displayName="Chatbar.InlineEnd";var pt=e.forwardRef((t,r)=>{let{asChild:a,forceMount:i,renderAttachment:c,className:l,children:u,...d}=t,g=I(),y=e.Children.toArray(u).length>0;return g.attachments.length===0&&!y&&!i?null:e.createElement("div",null,e.createElement(a?U:"div",{...d,ref:r,className:E("kui-ChatbarAttachmentsRow",l),role:"list","aria-label":d["aria-label"]??"Attachments"},e.createElement(at,{className:"kui-ChatbarScrollArea",scrollbars:"horizontal"},e.createElement(ze,{align:"center",gap:"3",minWidth:"fit-content"},g.attachments.map(p=>e.createElement($e,{key:p.id,attachment:p,asChild:!!c},c?.(p))),u))))});pt.displayName="Chatbar.AttachmentsRow";function ht(t,r){let a=t.closest('[role="listitem"]'),i=a?.parentElement?Array.from(a.parentElement.children):[],c=a?i.indexOf(a):-1,u=(i[c+1]??i[c-1])?.querySelector(".kui-ChatbarItemRemove");u?u.focus():r.current?.focus({preventScroll:!0})}var ft=({lead:t,leadKind:r,label:a,detail:i,removeLabel:c,onRemove:l})=>{let u=I();return e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-ChatbarItemLead","data-kind":r,"aria-hidden":!0},t),e.createElement(Ae,{className:"kui-ChatbarItemLabel",size:u.size,truncate:!0},a,i?e.createElement(Be,null,", ",i):null),l&&e.createElement(we,{iconOnly:!0,className:"kui-ChatbarItemRemove","aria-label":c,size:"1",variant:"ghost",color:"gray",onClick:l},e.createElement(Qe,null)))},Vt={uploading:"uploading",error:"failed to upload"},$e=e.forwardRef((t,r)=>{let{attachment:a,asChild:i,className:c,children:l,...u}=t,d=I(),g=i?U:"div",y=!!a.url&&ct(a.name,a.type),b=Math.ceil(a.size/1024),p=b>=1024?`${Math.round(b/1024*10)/10} MB`:`${b} KB`,v=a.status?Vt[a.status]:void 0,x=d.disabled||d.readOnly,w=k=>{ht(k.currentTarget,d.textareaRef),d.removeAttachment(a.id)},R=a.status==="uploading"?e.createElement(De,null):y?e.createElement("img",{className:"kui-ChatbarAttachmentImage",src:a.url,alt:""}):e.createElement(et,null);return e.createElement(g,{...u,ref:r,className:E(l?"kui-ChatbarAttachment":"kui-ChatbarAttachment kui-ChatbarItem",c),role:"listitem","data-kind":y?"image":"file","data-status":a.status,title:a.name},l??e.createElement(ft,{lead:R,leadKind:y&&a.status!=="uploading"?"image":"icon",label:a.name,detail:v?`${p}, ${v}`:p,removeLabel:`Remove ${a.name}`,onRemove:x?void 0:w}))});$e.displayName="Chatbar.Attachment";var bt=e.forwardRef((t,r)=>{let{children:a,icon:i,image:c,color:l,onRemove:u,removeLabel:d,className:g,...y}=t,b=I(),p=b.disabled||b.readOnly,v=u?x=>{ht(x.currentTarget,b.textareaRef),u()}:void 0;return e.createElement("div",{...y,ref:r,className:E("kui-ChatbarItem",g),role:"listitem","data-accent-color":c?void 0:l??"gray",title:a},e.createElement(ft,{lead:c?e.createElement("img",{className:"kui-ChatbarAttachmentImage",src:c,alt:""}):i,leadKind:c?"image":"icon",label:a,removeLabel:d??`Remove ${a}`,onRemove:p?void 0:v}))});bt.displayName="Chatbar.Item";var Rt=e.forwardRef((t,r)=>{let{asChild:a,accept:i,multiple:c,disabled:l,onPointerDown:u,onClick:d,children:g,color:y,...b}=t,p=I(),v=l||p.disabled||p.readOnly,x={...b,ref:r,className:E("kui-ChatbarAttachTrigger",b.className),type:b.type??"button","aria-label":b["aria-label"]??"Add attachments",disabled:v,onPointerDown:w=>{u?.(w),!v&&!w.defaultPrevented&&p.beginFilePickerPress()},onClick:w=>{d?.(w),!(v||w.defaultPrevented)&&p.openFilePicker({accept:i,multiple:c})}};return a?e.createElement(U,{...x},g):e.createElement(we,{iconOnly:!0,emphasis:"quiet",color:"gray",size:p.size,...x},g??e.createElement(Ze,{"aria-hidden":!0}))});Rt.displayName="Chatbar.AttachTrigger";var Ct=e.forwardRef((t,r)=>{let{asChild:a,children:i,className:c,...l}=t;return I().open?e.createElement("div",null,e.createElement(a?U:"div",{...l,ref:r,className:E("kui-ChatbarRow",c)},e.createElement(ze,{align:"center",justify:"between",width:"100%"},i))):null});Ct.displayName="Chatbar.Row";var gt=e.forwardRef((t,r)=>{let{className:a,...i}=t;return e.createElement("div",{...i,ref:r,className:E("kui-ChatbarRowStart",a)})});gt.displayName="Chatbar.RowStart";var vt=e.forwardRef((t,r)=>{let{className:a,...i}=t;return e.createElement("div",{...i,ref:r,className:E("kui-ChatbarRowEnd",a)})});vt.displayName="Chatbar.RowEnd";var yt=e.forwardRef((t,r)=>{let{asChild:a,clearOnSend:i,disabled:c,children:l,style:u,className:d,size:g,variant:y,emphasis:b,tabIndex:p,onClick:v,status:x="ready",onStop:w,onRetry:R,stopLabel:k="Stop",retryLabel:D="Retry",stopIcon:O,retryIcon:z,"aria-label":H,"aria-labelledby":F,...Q}=t,f=I(),_=e.useContext(We),B=Ve(_)||f.attachments.length>0,A=B?"send":x==="submitted"||x==="streaming"?"stop":x==="error"?"retry":"send";if(f.sendMode==="never"&&A==="send")return null;let L=A!=="send"||f.sendMode==="always"||B,Z=A==="send"?c||f.disabled||f.readOnly||!B:c||f.disabled,j=A==="stop"?{"aria-label":k}:A==="retry"?{"aria-label":D}:F?{"aria-labelledby":F}:{"aria-label":H??"Send"},q=M=>{if(v?.(M),M.defaultPrevented||Z)return;if(A==="stop"){w?.();return}if(A==="retry"){R?.();return}let N=i??f.clearOnSubmit;f.submit(N)&&N&&f.textareaRef.current?.focus({preventScroll:!0})},V=A==="stop"?O??(x==="submitted"?e.createElement(De,null):e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},e.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):A==="retry"?z??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.createElement("path",{d:"M3 3v5h5"})):l??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M5 12h14"}),e.createElement("path",{d:"m12 5 7 7-7 7"}));return e.createElement(we,{iconOnly:!0,...Q,ref:r,size:g??f.size,...b?{emphasis:b}:{variant:y??(f.open||A!=="send"?"solid":"ghost")},disabled:Z,className:E("kui-ChatbarSend",d),style:{opacity:L?1:0,pointerEvents:L?void 0:"none",...u},"aria-hidden":L?void 0:!0,tabIndex:L?p:-1,asChild:a,onClick:q,"data-status":x,"data-mode":A,...j},V)});yt.displayName="Chatbar.Send";export{lt as a,ut as b,dt as c,mt as d,pt as e,$e as f,bt as g,Rt as h,Ct as i,gt as j,vt as k,yt as l,Wt as m};
3
- //# sourceMappingURL=chunk-R4DMVTM3.js.map
2
+ import{a as nt}from"./chunk-W3X4N4JE.js";import{a as Be}from"./chunk-WUCBFB25.js";import{a as we}from"./chunk-WT4IDG2W.js";import{a as Ae}from"./chunk-FICBVI4M.js";import{a as De}from"./chunk-BUXK5VGR.js";import{a as ze}from"./chunk-KVVRFWGQ.js";import{b as U}from"./chunk-5KMEUZWN.js";import{g as Qe,h as Ze,j as et}from"./chunk-GKDGNPBD.js";import{b as tt}from"./chunk-5ON3XLRD.js";import{a as at}from"./chunk-DFQIIYLD.js";import{a as Ht}from"./chunk-VQPANPMI.js";var Wt={};Ht(Wt,{AttachTrigger:()=>Rt,Attachment:()=>$e,AttachmentsRow:()=>pt,InlineEnd:()=>mt,InlineStart:()=>dt,Item:()=>bt,Root:()=>lt,Row:()=>Ct,RowEnd:()=>vt,RowStart:()=>gt,Send:()=>yt,Textarea:()=>ut});import*as e from"react";import E from"classnames";import{useComposedRefs as st,useLayoutEffect as je}from"radix-ui/internal";import{useDropzone as Ft}from"react-dropzone";function ot(t,r){let{placeholder:a}=t;if(!a){r();return}t.placeholder="";try{r()}finally{t.placeholder=a}}var It={values:["1","2","3"]},it=e.createContext(null),We=e.createContext(""),I=()=>{let t=e.useContext(it);if(!t)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return t},me=t=>Array.isArray(t)?t:typeof t=="string"?t.split(",").map(r=>r.trim()).filter(Boolean):[],zt=(t,r)=>{if(r.length===0)return!0;let a=t.type.toLowerCase(),i=t.name.toLowerCase();for(let c of r){let l=c.toLowerCase();if(l.includes("/")){let[u,d]=l.split("/"),[g,y]=a.split("/");if(u==="*"||u===g&&(d==="*"||d===y))return!0}else if(l.startsWith(".")&&i.endsWith(l))return!0}return!1},Dt=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,ct=(t,r)=>(r||"").toLowerCase().startsWith("image/")||Dt.test(t),Ve=t=>t.trim().length>0,rt=(t,r)=>`${t} ${r}${t===1?"":"s"}`,Bt=0,jt=()=>`chatbar-attachment-${Date.now()}-${++Bt}`,lt=e.forwardRef((t,r)=>{let{className:a,style:i,children:c,value:l,defaultValue:u="",onValueChange:d,open:g,defaultOpen:y=!1,onOpenChange:b,expandOn:p="both",minLines:v=3,maxLines:x=6,sendMode:w="whenDirty",disabled:R,readOnly:k,onSubmit:D,size:O,variant:z,color:H,radius:F,width:Q,maxWidth:f,attachments:_,defaultAttachments:B,onAttachmentsChange:se,accept:A,multiple:L=!0,maxAttachments:Z,maxFileSize:G,paste:j=!0,pasteAccept:q,clearOnSubmit:V=!0,onAttachmentReject:M,dropzone:N=!0,apiRef:ke,onBlurCapture:pe,notices:he,context:fe,...Se}=t,W=tt(O,It),Ee=l!=null,[n,C]=e.useState(u),S=Ee?l:n,ee=g!=null,[X,te]=e.useState(y),ie=ee?g:X,Y="attachments"in t,[ce,be]=e.useState(()=>B??[]),le=e.useMemo(()=>Y?_??[]:ce,[Y,_,ce]),[Ke,xt]=e.useState({text:"",id:0}),ue=e.useCallback(o=>xt(s=>({text:o,id:s.id+1})),[]),Ue=e.useRef(null),Pt=st(r,Ue),Te=e.useRef(null),Le=e.useRef(null),de=e.useRef(!1),Re=e.useRef(!1),Ce=e.useRef(void 0),Me=e.useRef(null),_e=me(A).join(","),Ne=me(q).join(","),Oe=e.useMemo(()=>me(_e),[_e]),At=e.useMemo(()=>Ne?me(Ne):Oe,[Ne,Oe]),Ge={value:S,attachments:le,accepts:Oe,pasteAccepts:At,multiple:L,maxAttachments:Z,maxFileSize:G,disabled:R,readOnly:k,expandOn:p,isValueControlled:Ee,isOpenControlled:ee,isAttachmentsControlled:Y,onValueChange:d,onOpenChange:b,onAttachmentsChange:se,onAttachmentReject:M,onSubmit:D},P=e.useRef(Ge);P.current=Ge;let He=e.useRef(null),$=e.useCallback(()=>He.current??P.current.attachments,[]),ae=e.useCallback(o=>{P.current.isOpenControlled||te(o),P.current.onOpenChange?.(o)},[]),ge=e.useCallback(o=>{P.current.isValueControlled||C(o),P.current.onValueChange?.(o)},[]),ne=e.useCallback(o=>{He.current=o,queueMicrotask(()=>{He.current=null}),P.current.isAttachmentsControlled||be(o),P.current.onAttachmentsChange?.(o)},[]),ve=e.useRef(new Set),oe=e.useCallback((o,s,m=P.current.multiple)=>{let h=P.current;if(h.disabled||h.readOnly||o.length===0)return 0;let K=$(),J=[],re=[],Nt=typeof h.maxAttachments=="number"?Math.max(h.maxAttachments-K.length,0):1/0,Ot=m?1/0:1;for(let T of o){if(J.length>=Nt||J.length>=Ot){re.push({file:T,reason:"count"});continue}if(typeof h.maxFileSize=="number"&&T.size>h.maxFileSize){re.push({file:T,reason:"size"});continue}if(!zt(T,s)){re.push({file:T,reason:"type"});continue}let Ie=ct(T.name,T.type)?URL.createObjectURL(T):void 0;Ie&&ve.current.add(Ie),J.push({id:jt(),name:T.name,size:T.size,type:T.type,file:T,url:Ie,status:"idle"})}let Pe=[];return J.length>0&&(ne(K.concat(J)),h.expandOn!=="none"&&ae(!0),Pe.push(`${rt(J.length,"file")} attached.`)),re.length>0&&(h.onAttachmentReject?.(re),Pe.push(`${rt(re.length,"file")} could not be attached.`)),Pe.length>0&&ue(Pe.join(" ")),J.length},[$,ne,ae,ue]),ye=e.useCallback(o=>oe(o,P.current.accepts),[oe]),qe=e.useCallback(o=>oe(o,P.current.pasteAccepts),[oe]),Xe=e.useCallback(o=>{let s=$(),m=s.find(h=>h.id===o);m&&(ne(s.filter(h=>h.id!==o)),ue(`Removed ${m.name}.`))},[$,ne,ue]),Ye=e.useCallback(o=>{let s=P.current;if(s.disabled||s.readOnly)return!1;let m=$();if(!Ve(s.value)&&m.length===0)return!1;let h={value:s.value,attachments:m};if(o&&s.onSubmit)for(let K of m)K.url&&ve.current.delete(K.url);return s.onSubmit?.(h),o&&(ge(""),ne([])),!0},[$,ge,ne]);e.useEffect(()=>{let o=ve.current;if(o.size===0)return;let s=new Set(le.map(m=>m.url));for(let m of Array.from(o))s.has(m)||(URL.revokeObjectURL(m),o.delete(m))},[le]),e.useEffect(()=>{let o=ve.current;return()=>{if(!P.current.isAttachmentsControlled){for(let s of Array.from(o))URL.revokeObjectURL(s);o.clear()}}},[]);let xe=e.useCallback(o=>{let s=P.current,m=Le.current;if(clearTimeout(Ce.current),Re.current=!1,!m||s.disabled||s.readOnly)return;let h=o?.accept!=null?me(o.accept):s.accepts,K=o?.multiple??s.multiple;Me.current={patterns:h,multiple:K},m.accept=h.join(","),m.multiple=K,de.current=!0,m.click(),setTimeout(()=>{document.hasFocus()&&(de.current=!1)},1e3)},[]),Je=e.useCallback(()=>{Re.current=!0,clearTimeout(Ce.current),Ce.current=setTimeout(()=>{Re.current=!1},800)},[]);e.useEffect(()=>()=>clearTimeout(Ce.current),[]),e.useEffect(()=>{let o=Le.current,s=()=>{de.current=!1};return window.addEventListener("focus",s),o?.addEventListener("cancel",s),()=>{window.removeEventListener("focus",s),o?.removeEventListener("cancel",s)}},[]);let wt=e.useCallback(o=>{let s=o.currentTarget,m=Array.from(s.files??[]),h=Me.current;oe(m,h?.patterns??P.current.accepts,h?.multiple),de.current=!1,Me.current=null,s.value=""},[oe]),kt=e.useCallback(o=>{pe?.(o);let s=P.current,m=Ue.current;if(!m||s.expandOn==="none")return;let h=o.relatedTarget;h&&m.contains(h)||de.current||Re.current||!Ve(s.value)&&$().length===0&&ae(!1)},[pe,ae,$]),St=e.useCallback(o=>{ye(o)},[ye]),{getRootProps:Et,isDragActive:Tt}=Ft({onDrop:St,onDragEnter:()=>ue(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!N||R||k}),Fe=N&&Tt;e.useImperativeHandle(ke,()=>({focusTextarea:()=>Te.current?.focus({preventScroll:!0}),openFilePicker:()=>xe()}),[xe]);let Lt=e.useCallback(o=>{if(R||o.pointerType==="mouse"&&o.button!==0)return;let s=o.target;s instanceof Element&&s.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(o.preventDefault(),Te.current?.focus({preventScroll:!0}))},[R]),Mt=e.useMemo(()=>({open:ie,setOpen:ae,setValue:ge,size:W,expandOn:p,minLines:v,maxLines:x,sendMode:w,disabled:R,readOnly:k,paste:j,clearOnSubmit:V,multiple:L,textareaRef:Te,attachments:le,removeAttachment:Xe,submit:Ye,appendFiles:ye,appendFilesFromPaste:qe,openFilePicker:xe,beginFilePickerPress:Je}),[ie,ae,ge,W,p,v,x,w,R,k,j,V,L,le,Xe,Ye,ye,qe,xe,Je]);return e.createElement(it.Provider,{value:Mt},e.createElement(We.Provider,{value:S},e.createElement(e.Fragment,null,e.createElement("div",{...Se,ref:Pt,className:E("kui-ChatbarRoot",`kui-r-size-${W}`,a),style:{position:"relative",width:Q,maxWidth:f,...i},"data-state":ie?"open":"closed","data-disabled":R?"":void 0,"data-readonly":k?"":void 0,"data-drop-active":Fe?"":void 0,"data-accent-color":H,"data-radius":F,onBlurCapture:kt},e.createElement("input",{ref:Le,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:wt}),he?e.createElement("div",{className:"kui-ChatbarNotices"},e.createElement(nt.Provider,{value:W},he)):null,e.createElement("div",{...N?Et():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:Lt},e.createElement("div",{className:E("kui-ChatbarBox",`kui-variant-${z??"raised"}`),style:{position:"relative"},"data-accent-color":H,"data-radius":F},e.createElement("div",{className:"kui-ChatbarGrid"},c),Fe&&e.createElement("div",{className:"kui-ChatbarDropOverlay","aria-hidden":!0},e.createElement("div",{className:"kui-ChatbarDropContent"},e.createElement(Ae,{emphasis:"medium",size:W,weight:"medium"},"Drop files here to attach"))))),fe?e.createElement(Ae,{as:"div",size:W==="3"?"2":"1",emphasis:"medium",className:"kui-ChatbarContext"},fe):null,e.createElement(Be,{role:"status","aria-live":"polite"},Fe?"Drop files here to attach.":e.createElement("span",{key:Ke.id},Ke.text))))))});lt.displayName="Chatbar.Root";var ut=e.forwardRef((t,r)=>{let{className:a,style:i,asChild:c,onFocus:l,onChange:u,onPaste:d,onKeyDown:g,onCompositionStart:y,onCompositionEnd:b,submitOnEnter:p=!1,...v}=t,x=I(),w=e.useContext(We),{open:R,minLines:k,maxLines:D,expandOn:O,disabled:z,readOnly:H,setOpen:F,setValue:Q,textareaRef:f,paste:_,appendFilesFromPaste:B,size:se,submit:A,clearOnSubmit:L}=x,Z=st(r,f),G=e.useRef(0),j=e.useRef(0),q=e.useRef(!1),V=e.useRef({open:R,minLines:k,maxLines:D});je(()=>{V.current={open:R,minLines:k,maxLines:D}},[R,k,D]);let M=e.useCallback(()=>{let n=f.current;if(!n)return;let C=window.getComputedStyle(n);G.current=parseFloat(C.lineHeight)||20,j.current=(parseFloat(C.paddingTop)||0)+(parseFloat(C.paddingBottom)||0)},[f]),N=e.useCallback((n,C)=>{let{minLines:S,maxLines:ee}=V.current,X=G.current,te=j.current,ie=Math.ceil((C?S:1)*X)+te,Y=Math.ceil((C?ee:1)*X)+te,ce=Math.max(n.scrollHeight,ie);n.style.height=`${Math.min(ce,Y)}px`;let be=ce>Y;n.style.overflowY=be?"auto":"hidden",n.style.maxHeight=be?`${Y}px`:"none"},[]);je(()=>{M()},[M,se]),je(()=>{let n=f.current;n&&(G.current===0&&M(),ot(n,()=>{n.style.height="auto";let C=R;if(!R&&(O==="overflow"||O==="both")){let S=Math.ceil(G.current)+j.current;n.scrollHeight>S+1&&(C=!0,F(!0))}N(n,C)}))},[w,R,O,k,D,se,F,f,M,N]),e.useEffect(()=>{let n=f.current;if(!n||typeof ResizeObserver>"u")return;let C=-1,S=new ResizeObserver(ee=>{let X=ee[0]?.contentRect.width??0;if(X===C)return;let te=C===-1;C=X,!te&&(M(),ot(n,()=>{n.style.height="auto",N(n,V.current.open)}))});return S.observe(n),()=>S.disconnect()},[f,M,N]),e.useEffect(()=>{},[]);let ke=e.useCallback(n=>{l?.(n),!(z||H)&&(O==="focus"||O==="both")&&!R&&F(!0)},[z,H,O,R,F,l]),pe=e.useCallback(n=>{Q(n.currentTarget.value),u?.(n)},[Q,u]),he=e.useCallback(n=>{if(d?.(n),n.defaultPrevented||!_||z||H)return;let C=Array.from(n.clipboardData?.items??[]).filter(S=>S.kind==="file").map(S=>S.getAsFile()).filter(S=>!!S);C.length!==0&&B(C)>0&&n.preventDefault()},[_,z,H,d,B]),fe=e.useCallback(n=>{q.current=!0,y?.(n)},[y]),Se=e.useCallback(n=>{q.current=!1,b?.(n)},[b]),W=e.useCallback(n=>{g?.(n),!(n.defaultPrevented||!p)&&(n.key!=="Enter"||n.shiftKey||n.altKey||n.ctrlKey||n.metaKey||q.current||n.nativeEvent.isComposing||n.nativeEvent.keyCode===229||(n.preventDefault(),A(L)))},[p,g,A,L]);return e.createElement("div",{className:"kui-ChatbarField kui-ChatbarTextarea"},e.createElement(c?U:"textarea",{...v,ref:Z,className:E("kui-ChatbarInput",a),value:w,onChange:pe,onFocus:ke,onPaste:he,onKeyDown:W,onCompositionStart:fe,onCompositionEnd:Se,disabled:z,readOnly:H,rows:R?k:1,spellCheck:v.spellCheck??!0,autoCorrect:v.autoCorrect??"on",style:i}))});ut.displayName="Chatbar.Textarea";var dt=e.forwardRef((t,r)=>{let{children:a,asChild:i,className:c,...l}=t;return I().open?null:e.createElement(i?U:"div",{...l,ref:r,className:E("kui-ChatbarInlineStart",c)},a)});dt.displayName="Chatbar.InlineStart";var mt=e.forwardRef((t,r)=>{let{children:a,asChild:i,className:c,...l}=t;return I().open?null:e.createElement(i?U:"div",{...l,ref:r,className:E("kui-ChatbarInlineEnd",c)},a)});mt.displayName="Chatbar.InlineEnd";var pt=e.forwardRef((t,r)=>{let{asChild:a,forceMount:i,renderAttachment:c,className:l,children:u,...d}=t,g=I(),y=e.Children.toArray(u).length>0;return g.attachments.length===0&&!y&&!i?null:e.createElement("div",null,e.createElement(a?U:"div",{...d,ref:r,className:E("kui-ChatbarAttachmentsRow",l),role:"list","aria-label":d["aria-label"]??"Attachments"},e.createElement(at,{className:"kui-ChatbarScrollArea",scrollbars:"horizontal"},e.createElement(ze,{align:"center",gap:"3",minWidth:"fit-content"},g.attachments.map(p=>e.createElement($e,{key:p.id,attachment:p,asChild:!!c},c?.(p))),u))))});pt.displayName="Chatbar.AttachmentsRow";function ht(t,r){let a=t.closest('[role="listitem"]'),i=a?.parentElement?Array.from(a.parentElement.children):[],c=a?i.indexOf(a):-1,u=(i[c+1]??i[c-1])?.querySelector(".kui-ChatbarItemRemove");u?u.focus():r.current?.focus({preventScroll:!0})}var ft=({lead:t,leadKind:r,label:a,detail:i,removeLabel:c,onRemove:l})=>{let u=I();return e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-ChatbarItemLead","data-kind":r,"aria-hidden":!0},t),e.createElement(Ae,{className:"kui-ChatbarItemLabel",size:u.size,truncate:!0},a,i?e.createElement(Be,null,", ",i):null),l&&e.createElement(we,{iconOnly:!0,className:"kui-ChatbarItemRemove","aria-label":c,size:"1",variant:"ghost",color:"gray",onClick:l},e.createElement(Qe,null)))},Vt={uploading:"uploading",error:"failed to upload"},$e=e.forwardRef((t,r)=>{let{attachment:a,asChild:i,className:c,children:l,...u}=t,d=I(),g=i?U:"div",y=!!a.url&&ct(a.name,a.type),b=Math.ceil(a.size/1024),p=b>=1024?`${Math.round(b/1024*10)/10} MB`:`${b} KB`,v=a.status?Vt[a.status]:void 0,x=d.disabled||d.readOnly,w=k=>{ht(k.currentTarget,d.textareaRef),d.removeAttachment(a.id)},R=a.status==="uploading"?e.createElement(De,null):y?e.createElement("img",{className:"kui-ChatbarAttachmentImage",src:a.url,alt:""}):e.createElement(et,null);return e.createElement(g,{...u,ref:r,className:E(l?"kui-ChatbarAttachment":"kui-ChatbarAttachment kui-ChatbarItem",c),role:"listitem","data-kind":y?"image":"file","data-status":a.status,title:a.name},l??e.createElement(ft,{lead:R,leadKind:y&&a.status!=="uploading"?"image":"icon",label:a.name,detail:v?`${p}, ${v}`:p,removeLabel:`Remove ${a.name}`,onRemove:x?void 0:w}))});$e.displayName="Chatbar.Attachment";var bt=e.forwardRef((t,r)=>{let{children:a,icon:i,image:c,color:l,onRemove:u,removeLabel:d,className:g,...y}=t,b=I(),p=b.disabled||b.readOnly,v=u?x=>{ht(x.currentTarget,b.textareaRef),u()}:void 0;return e.createElement("div",{...y,ref:r,className:E("kui-ChatbarItem",g),role:"listitem","data-accent-color":c?void 0:l??"gray",title:a},e.createElement(ft,{lead:c?e.createElement("img",{className:"kui-ChatbarAttachmentImage",src:c,alt:""}):i,leadKind:c?"image":"icon",label:a,removeLabel:d??`Remove ${a}`,onRemove:p?void 0:v}))});bt.displayName="Chatbar.Item";var Rt=e.forwardRef((t,r)=>{let{asChild:a,accept:i,multiple:c,disabled:l,onPointerDown:u,onClick:d,children:g,color:y,...b}=t,p=I(),v=l||p.disabled||p.readOnly,x={...b,ref:r,className:E("kui-ChatbarAttachTrigger",b.className),type:b.type??"button","aria-label":b["aria-label"]??"Add attachments",disabled:v,onPointerDown:w=>{u?.(w),!v&&!w.defaultPrevented&&p.beginFilePickerPress()},onClick:w=>{d?.(w),!(v||w.defaultPrevented)&&p.openFilePicker({accept:i,multiple:c})}};return a?e.createElement(U,{...x},g):e.createElement(we,{iconOnly:!0,emphasis:"quiet",color:"gray",size:p.size,...x},g??e.createElement(Ze,{"aria-hidden":!0}))});Rt.displayName="Chatbar.AttachTrigger";var Ct=e.forwardRef((t,r)=>{let{asChild:a,children:i,className:c,...l}=t;return I().open?e.createElement("div",null,e.createElement(a?U:"div",{...l,ref:r,className:E("kui-ChatbarRow",c)},e.createElement(ze,{align:"center",justify:"between",width:"100%"},i))):null});Ct.displayName="Chatbar.Row";var gt=e.forwardRef((t,r)=>{let{className:a,...i}=t;return e.createElement("div",{...i,ref:r,className:E("kui-ChatbarRowStart",a)})});gt.displayName="Chatbar.RowStart";var vt=e.forwardRef((t,r)=>{let{className:a,...i}=t;return e.createElement("div",{...i,ref:r,className:E("kui-ChatbarRowEnd",a)})});vt.displayName="Chatbar.RowEnd";var yt=e.forwardRef((t,r)=>{let{asChild:a,clearOnSend:i,disabled:c,children:l,style:u,className:d,size:g,variant:y,emphasis:b,tabIndex:p,onClick:v,status:x="ready",onStop:w,onRetry:R,stopLabel:k="Stop",retryLabel:D="Retry",stopIcon:O,retryIcon:z,"aria-label":H,"aria-labelledby":F,...Q}=t,f=I(),_=e.useContext(We),B=Ve(_)||f.attachments.length>0,A=B?"send":x==="submitted"||x==="streaming"?"stop":x==="error"?"retry":"send";if(f.sendMode==="never"&&A==="send")return null;let L=A!=="send"||f.sendMode==="always"||B,Z=A==="send"?c||f.disabled||f.readOnly||!B:c||f.disabled,j=A==="stop"?{"aria-label":k}:A==="retry"?{"aria-label":D}:F?{"aria-labelledby":F}:{"aria-label":H??"Send"},q=M=>{if(v?.(M),M.defaultPrevented||Z)return;if(A==="stop"){w?.();return}if(A==="retry"){R?.();return}let N=i??f.clearOnSubmit;f.submit(N)&&N&&f.textareaRef.current?.focus({preventScroll:!0})},V=A==="stop"?O??(x==="submitted"?e.createElement(De,null):e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},e.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):A==="retry"?z??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.createElement("path",{d:"M3 3v5h5"})):l??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M5 12h14"}),e.createElement("path",{d:"m12 5 7 7-7 7"}));return e.createElement(we,{iconOnly:!0,...Q,ref:r,size:g??f.size,...b?{emphasis:b}:{variant:y??(f.open||A!=="send"?"solid":"ghost")},disabled:Z,className:E("kui-ChatbarSend",d),style:{opacity:L?1:0,pointerEvents:L?void 0:"none",...u},"aria-hidden":L?void 0:!0,tabIndex:L?p:-1,asChild:a,onClick:q,"data-status":x,"data-mode":A,...j},V)});yt.displayName="Chatbar.Send";export{lt as a,ut as b,dt as c,mt as d,pt as e,$e as f,bt as g,Rt as h,Ct as i,gt as j,vt as k,yt as l,Wt as m};
3
+ //# sourceMappingURL=chunk-M6THDAMU.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
2
  var e={xs:"(min-width: 520px)",sm:"(min-width: 768px)",md:"(min-width: 1024px)",lg:"(min-width: 1280px)",xl:"(min-width: 1640px)"},t=["initial","xs","sm","md","lg","xl"];export{e as a,t as b};
3
- //# sourceMappingURL=chunk-MAA6LEE2.js.map
3
+ //# sourceMappingURL=chunk-MDQ7ZHOS.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/shell.types.ts"],
4
+ "sourcesContent": ["import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\n/**\n * Why a pane's open state changed. Only a user action is reported: `toggle` for a Trigger or a\n * handle double-click, and `dismiss` for Escape or a press on the scrim.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\n/** The panes a Trigger can drive. */\nexport type PaneTarget = 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\nexport type PaneName = PaneTarget;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n"],
5
+ "mappings": ";AAiCO,IAAMA,EAAe,CAC1B,GAAI,qBACJ,GAAI,qBACJ,GAAI,sBACJ,GAAI,sBACJ,GAAI,qBACN,EAKaC,EAA2C,CAAC,UAAW,KAAM,KAAM,KAAM,KAAM,IAAI",
6
+ "names": ["_BREAKPOINTS", "SHELL_BREAKPOINTS"]
7
+ }
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{b as N,d as k}from"./chunk-SHDZYFUN.js";import{a as M,c as p}from"./chunk-RYXIRZQW.js";import{a as y,b as x,c as V}from"./chunk-UFYQC5XY.js";import{a as E,b as T,c as B}from"./chunk-MXNPCJPV.js";import{a as C}from"./chunk-S66WR5R7.js";import{a as h}from"./chunk-WJKCXGVN.js";import{b as R}from"./chunk-VWRPVM5K.js";import{f as v}from"./chunk-FKCKELUB.js";import{m as z}from"./chunk-LBAC2X4U.js";import*as e from"react";import te from"classnames";import{useComposedRefs as ne}from"radix-ui/internal";var A=a=>a==="collapsed"?"closed":"open",oe=a=>a==="closed"?"collapsed":"expanded";function H(a){if(a===void 0)return;if(typeof a=="string")return A(a);let n={};for(let[i,o]of Object.entries(a))o!==void 0&&(n[i]=A(o));return n}var ie={controlled:"state",default:"defaultState"},re={initial:"overlay",sm:"fixed"},I=e.forwardRef((a,n)=>{let{className:i,presentation:o=re,expandedSize:r=288,minSize:d=200,maxSize:s=400,resizable:u=!1,collapsible:U=!0,onResize:w,onResizeStart:D,onResizeEnd:O,children:L,style:_,state:F,defaultState:$,onStateChange:j,size:S,defaultSize:m,onSizeChange:W,sizeUpdate:q,sizeUpdateMs:G=50,flush:b=!0,id:J,...l}=a,{table:c,attributes:K}=V(o,"fixed"),t=y({name:"sidebar",label:"Sidebar",propNames:ie,id:J,controlled:H(F),defaultValue:H($),presentationTable:c,builtIn:N,onChange:(ee,ae)=>j?.(oe(ee),{reason:ae}),size:r});z("sidebar",b);let f=e.useRef(null),Q=ne(n,t.setElement,f),X=T({name:"sidebar",elementId:t.id,elementRef:f,cssVarName:"--sidebar-size",orientation:"vertical",edge:"end",growth:k,expandedSize:r,minSize:d,maxSize:s,resizable:u,collapsible:U,size:S,defaultSize:m,onSizeChange:W,sizeUpdate:q,sizeUpdateMs:G,onResize:w,onResizeStart:D,onResizeEnd:O,overlaying:t.overlaying,overlayingNow:()=>c[h()]==="overlay",requestToggle:()=>t.toggle("toggle")}),{handles:P,content:Y}=B(L,p),Z=u&&t.value!=="closed"&&!t.overlaying?e.createElement(C.Provider,{value:X},P.length>0?P:e.createElement(M,null)):null,g=E(S,m,d,s);return e.createElement("div",{...l,role:l.role??"navigation",id:t.id,ref:Q,className:te("kui-ShellPane","kui-ShellSidebar",i),...x(t,K),"data-flush":b||void 0,tabIndex:t.overlaying?-1:l.tabIndex,style:{..._,"--sidebar-expanded-size":`${r}px`,...g?{"--sidebar-size":g}:{},"--sidebar-min-size":`${d}px`,"--sidebar-max-size":`${s}px`}},e.createElement("div",{className:"kui-ShellSidebarContent"},e.createElement(v,null,e.createElement(R,null,Y))),Z)});I.displayName="Shell.Sidebar";I.Handle=p;export{I as a};
3
+ //# sourceMappingURL=chunk-MQA3BKF4.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/_internal/shell-sidebar.tsx"],
4
+ "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposedRefs } from 'radix-ui/internal';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { PaneHandle, SidebarHandle } from './shell-handles.js';\nimport { usePane, paneAttributes, usePresentationTable } from './shell-pane.js';\nimport { splitHandles, useInitialPaneSize, useResizablePane, type SizeChangeMeta } from './shell-resizable.js';\nimport { useFrameRegistration, type PaneValue } from './shell-store.js';\nimport { navigationRest, startAnchoredGrowth } from './shell-rest.js';\nimport { readBreakpoint } from '../../hooks/use-breakpoint.js';\nimport { PaneChromeScope } from './pane-chrome.js';\nimport { PageScope } from './page-scope.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, PaneOpenChangeReason, Responsive, SidebarMode } from '../shell.types.js';\n\ntype SidebarStateChangeMeta = { reason: PaneOpenChangeReason };\ntype SidebarControlledProps = { state: SidebarMode; onStateChange?: (state: SidebarMode, meta: SidebarStateChangeMeta) => void; defaultState?: never };\ntype SidebarUncontrolledProps = { defaultState?: SidebarMode | Partial<Record<Breakpoint, SidebarMode>>; onStateChange?: (state: SidebarMode, meta: SidebarStateChangeMeta) => void; state?: never };\ntype SidebarPublicProps = PaneBaseProps & {\n size?: number | string;\n defaultSize?: number | string;\n onSizeChange?: (size: number, meta: SizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n} & (SidebarControlledProps | SidebarUncontrolledProps);\n\ntype SidebarComponent = React.ForwardRefExoticComponent<SidebarPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof SidebarHandle };\n\nconst toValue = (mode: SidebarMode): PaneValue => (mode === 'collapsed' ? 'closed' : 'open');\nconst toMode = (value: PaneValue): SidebarMode => (value === 'closed' ? 'collapsed' : 'expanded');\n\nfunction modeToValue(state: SidebarMode | undefined): PaneValue | undefined;\nfunction modeToValue(state: Responsive<SidebarMode> | undefined): PaneValue | Partial<Record<Breakpoint, PaneValue>> | undefined;\nfunction modeToValue(state: Responsive<SidebarMode> | undefined): PaneValue | Partial<Record<Breakpoint, PaneValue>> | undefined {\n if (state === undefined) return undefined;\n if (typeof state === 'string') return toValue(state);\n const map: Partial<Record<Breakpoint, PaneValue>> = {};\n for (const [bp, mode] of Object.entries(state) as Array<[Breakpoint, SidebarMode | undefined]>) {\n if (mode !== undefined) map[bp] = toValue(mode);\n }\n return map;\n}\n\nconst SIDEBAR_PROP_NAMES = { controlled: 'state', default: 'defaultState' };\n\n/** Since 0.8.0 the Sidebar is in the frame from 768px up, the boundary kookie-ui-v2 uses everywhere. It was 1024px. */\nconst SIDEBAR_DEFAULT_PRESENTATION = { initial: 'overlay', sm: 'fixed' } as const;\n\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, SidebarPublicProps>((props, ref) => {\n const {\n className,\n presentation = SIDEBAR_DEFAULT_PRESENTATION,\n expandedSize = 288,\n minSize = 200,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onResize,\n onResizeStart,\n onResizeEnd,\n children,\n style,\n state,\n defaultState,\n onStateChange,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n flush = true,\n id,\n ...domProps\n } = props;\n\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'sidebar',\n label: 'Sidebar',\n propNames: SIDEBAR_PROP_NAMES,\n id,\n controlled: modeToValue(state),\n defaultValue: modeToValue(defaultState),\n presentationTable: table,\n builtIn: navigationRest,\n onChange: (value, reason) => onStateChange?.(toMode(value), { reason }),\n size: expandedSize,\n });\n useFrameRegistration('sidebar', flush);\n\n\n const elementRef = React.useRef<HTMLElement | null>(null);\n const composedRef = useComposedRefs(ref, pane.setElement, elementRef);\n\n const resize = useResizablePane({\n name: 'sidebar',\n elementId: pane.id,\n elementRef,\n cssVarName: '--sidebar-size',\n orientation: 'vertical',\n edge: 'end',\n growth: startAnchoredGrowth,\n expandedSize,\n minSize,\n maxSize,\n resizable,\n collapsible,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs,\n onResize,\n onResizeStart,\n onResizeEnd,\n overlaying: pane.overlaying,\n overlayingNow: () => table[readBreakpoint()] === 'overlay',\n requestToggle: () => pane.toggle('toggle'),\n });\n\n const { handles, content } = splitHandles(children, SidebarHandle);\n const handle =\n resizable && pane.value !== 'closed' && !pane.overlaying ? (\n <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider>\n ) : null;\n\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n return (\n <div\n {...domProps}\n role={domProps.role ?? 'navigation'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellSidebar', className)}\n {...paneAttributes(pane, attributes)}\n data-flush={flush || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--sidebar-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--sidebar-size': initialSize } : {}),\n '--sidebar-min-size': `${minSize}px`,\n '--sidebar-max-size': `${maxSize}px`,\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellSidebarContent\">\n <PaneChromeScope>\n <PageScope>{content}</PageScope>\n </PaneChromeScope>\n </div>\n {handle}\n </div>\n );\n}) as SidebarComponent;\n\nSidebar.displayName = 'Shell.Sidebar';\nSidebar.Handle = SidebarHandle;\n\nexport type { SidebarPublicProps };\n"],
5
+ "mappings": "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",
6
+ "names": ["React", "classNames", "useComposedRefs", "toValue", "mode", "toMode", "value", "modeToValue", "state", "map", "bp", "SIDEBAR_PROP_NAMES", "SIDEBAR_DEFAULT_PRESENTATION", "Sidebar", "props", "ref", "className", "presentation", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onResize", "onResizeStart", "onResizeEnd", "children", "style", "defaultState", "onStateChange", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "flush", "id", "domProps", "table", "attributes", "usePresentationTable", "pane", "usePane", "navigationRest", "reason", "useFrameRegistration", "elementRef", "composedRef", "useComposedRefs", "resize", "useResizablePane", "startAnchoredGrowth", "readBreakpoint", "handles", "content", "splitHandles", "SidebarHandle", "handle", "PaneResizeContext", "PaneHandle", "initialSize", "useInitialPaneSize", "classNames", "paneAttributes", "PaneChromeScope", "PageScope"]
7
+ }
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{c as s}from"./chunk-5ON3XLRD.js";import{c as o}from"./chunk-HBWBPBSA.js";import{c as r}from"./chunk-OKQAVYW4.js";import*as e from"react";import w from"classnames";import{Switch as i}from"radix-ui";var n=["1","2","3","4"],t={size:{type:"enum",className:"kui-r-size",values:n,default:"2",responsive:!0},...o};var l=e.forwardRef((p,c)=>{let m=s(p,t.size),{className:f,color:a,...h}=r(m,t);return e.createElement(i.Root,{"data-accent-color":a,...h,asChild:!1,ref:c,className:w("kui-reset","kui-SwitchRoot",f)},e.createElement(i.Thumb,{className:"kui-SwitchThumb"}))});l.displayName="Switch";export{l as a};
3
- //# sourceMappingURL=chunk-VBF3XALY.js.map
2
+ import{c as o}from"./chunk-HBWBPBSA.js";import{c as s}from"./chunk-5ON3XLRD.js";import{c as r}from"./chunk-OKQAVYW4.js";import*as e from"react";import w from"classnames";import{Switch as i}from"radix-ui";var n=["1","2","3","4"],t={size:{type:"enum",className:"kui-r-size",values:n,default:"2",responsive:!0},...o};var l=e.forwardRef((p,c)=>{let m=s(p,t.size),{className:f,color:a,...h}=r(m,t);return e.createElement(i.Root,{"data-accent-color":a,...h,asChild:!1,ref:c,className:w("kui-reset","kui-SwitchRoot",f)},e.createElement(i.Thumb,{className:"kui-SwitchThumb"}))});l.displayName="Switch";export{l as a};
3
+ //# sourceMappingURL=chunk-MS2ONKJJ.js.map
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import*as t from"react";import{useLayoutEffect as p}from"radix-ui/internal";function P(e,a="horizontal"){if(e==null)return;if(typeof e=="number"&&Number.isFinite(e))return e;let r=String(e).trim();if(!r)return;if(r.endsWith("px"))return Number.parseFloat(r);if(r.endsWith("rem")){let u=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||"16")||16;return Number.parseFloat(r)*u}if(r.endsWith("%")){let u=Number.parseFloat(r),i=a==="horizontal"?document.documentElement.clientWidth||window.innerWidth||0:document.documentElement.clientHeight||window.innerHeight||0;return u/100*i}let o=Number.parseFloat(r);return Number.isFinite(o)?o:void 0}var g=(e,a,r)=>Math.max(a??e,Math.min(r??e,e));function W(e,a,r,o){let[u]=t.useState(()=>{let i=e??a;return typeof i=="number"&&Number.isFinite(i)?`${g(i,r,o)}px`:void 0});return u}function q(e){let{name:a,elementRef:r,cssVarName:o,orientation:u,minSize:i,maxSize:l,size:f,defaultSize:h}=e,c=t.useRef(e);p(()=>{c.current=e});let d=t.useRef(null),y=t.useRef(0);t.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);let b=t.useCallback((n,s)=>{let{onSizeChange:m,sizeUpdate:R,sizeUpdateMs:F}=c.current;if(m){if(R==="debounce"){d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{d.current=null,c.current.onSizeChange?.(n,s)},F);return}if(R==="throttle"){let M=Date.now();if(M-y.current<F)return;y.current=M}m(n,s)}},[]),S=t.useCallback(n=>P(n,u==="vertical"?"horizontal":"vertical"),[u]),x=t.useRef(!1),z=t.useCallback((n,s)=>{let m=r.current;if(m){m.style.setProperty(o,`${n}px`);for(let R of m.querySelectorAll(":scope > .kui-ShellResizer"))R.setAttribute("aria-valuenow",String(Math.round(n)));s&&(x.current=!0)}},[r,o]);p(()=>{x.current||z(e.expandedSize,!1)},[e.expandedSize,z]),p(()=>{if(f!==void 0||h===void 0)return;let n=S(h);if(typeof n!="number"||!Number.isFinite(n))return;let s=g(n,i,l);z(s,!0),b(s,{reason:"init"})},[]),p(()=>{if(f===void 0||c.current.overlayingNow())return;let n=S(f);if(typeof n!="number"||!Number.isFinite(n))return;let s=g(n,i,l);z(s,!0),b(s,{reason:"controlled"})},[f,i,l,e.overlaying,S,z,b]);let[C]=t.useState(()=>{let n=f??h;return typeof n=="number"&&Number.isFinite(n)?g(n,i,l):e.expandedSize}),N=t.useCallback(n=>c.current.onResize?.(n),[]),w=t.useCallback(n=>{x.current=!0,c.current.onResizeStart?.(n)},[]),E=t.useCallback(n=>{c.current.onResizeEnd?.(n),b(n,{reason:"resize"})},[b]),T=t.useCallback(()=>c.current.requestToggle(),[]);return t.useMemo(()=>({containerRef:r,controls:e.elementId,cssVarName:o,minSize:i,maxSize:l,defaultSize:e.expandedSize,startSize:C,orientation:u,edge:e.edge,growth:e.growth,onResize:N,onResizeStart:w,onResizeEnd:E,target:a,collapsible:e.collapsible,requestToggle:T}),[r,e.elementId,o,i,l,e.expandedSize,C,u,e.edge,e.growth,N,w,E,a,e.collapsible,T])}function H(e,a){let r=t.Children.toArray(e),o=r.filter(i=>t.isValidElement(i)&&i.type===a),u=r.filter(i=>!(t.isValidElement(i)&&i.type===a));return{handles:o,content:u}}export{W as a,q as b,H as c};
3
+ //# sourceMappingURL=chunk-MXNPCJPV.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/_internal/shell-resizable.tsx", "../../src/helpers/normalize-to-px.ts"],
4
+ "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\nimport type { PaneName } from '../shell.types.js';\nimport type { PaneResizeContextValue } from './shell-resize.js';\n\nexport type SizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\n\nexport type ResizableOptions = {\n name: PaneName;\n /** The pane's element id, which the handle names in `aria-controls`. */\n elementId: string;\n elementRef: React.RefObject<HTMLElement | null>;\n cssVarName: string;\n orientation: 'vertical' | 'horizontal';\n edge: 'start' | 'end';\n growth: (isRtl: boolean) => 1 | -1;\n expandedSize: number;\n minSize: number;\n maxSize: number;\n resizable: boolean;\n collapsible: boolean;\n size: number | string | undefined;\n defaultSize: number | string | undefined;\n onSizeChange: ((size: number, meta: SizeChangeMeta) => void) | undefined;\n sizeUpdate: 'throttle' | 'debounce' | undefined;\n sizeUpdateMs: number;\n onResize: ((size: number) => void) | undefined;\n onResizeStart: ((size: number) => void) | undefined;\n onResizeEnd: ((size: number) => void) | undefined;\n /** Whether the pane is presented as an overlay right now. An overlay keeps its designed size. */\n overlaying: boolean;\n /** The same question asked at effect time, for a pane whose presentation is learnt after its first render. */\n overlayingNow: () => boolean;\n requestToggle: () => void;\n};\n\n/**\n * Clamps to [min, max]. When the two cross (an app passing a maximum computed\n * from a narrow window below its fixed minimum), the minimum wins, as it did\n * in 0.7.\n */\nconst clampTo = (value: number, min: number | undefined, max: number | undefined) => Math.max(min ?? value, Math.min(max ?? value, value));\n\n/**\n * The pane's starting size for the first render, so the server HTML already has it and the first\n * paint is right. Only a number can be known before the pane exists (a percentage needs the\n * Shell's width); the effects below still own the size after mount.\n */\nexport function useInitialPaneSize(size: number | string | undefined, defaultSize: number | string | undefined, minSize: number, maxSize: number) {\n const [initial] = React.useState(() => {\n const value = size ?? defaultSize;\n return typeof value === 'number' && Number.isFinite(value) ? `${clampTo(value, minSize, maxSize)}px` : undefined;\n });\n return initial;\n}\n\n/** Everything a resizable pane shares: size props and the handle's context. */\nexport function useResizablePane(options: ResizableOptions): PaneResizeContextValue {\n const { name, elementRef, cssVarName, orientation, minSize, maxSize, size, defaultSize } = options;\n\n // The latest callbacks, so the size emitter does not change identity when a\n // consumer passes an inline function. A controlled `size` is reported again\n // only when the size, the minimum or the maximum changes.\n const latest = React.useRef(options);\n useLayoutEffect(() => {\n latest.current = options;\n });\n\n const debounceRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const throttleRef = React.useRef(0);\n React.useEffect(\n () => () => {\n if (debounceRef.current) clearTimeout(debounceRef.current);\n },\n [],\n );\n const emitSizeChange = React.useCallback((value: number, meta: SizeChangeMeta) => {\n const { onSizeChange, sizeUpdate, sizeUpdateMs } = latest.current;\n if (!onSizeChange) return;\n if (sizeUpdate === 'debounce') {\n if (debounceRef.current) clearTimeout(debounceRef.current);\n debounceRef.current = setTimeout(() => {\n debounceRef.current = null;\n latest.current.onSizeChange?.(value, meta);\n }, sizeUpdateMs);\n return;\n }\n if (sizeUpdate === 'throttle') {\n const now = Date.now();\n if (now - throttleRef.current < sizeUpdateMs) return;\n throttleRef.current = now;\n }\n onSizeChange(value, meta);\n }, []);\n\n const toPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, orientation === 'vertical' ? 'horizontal' : 'vertical'), [orientation]);\n\n /**\n * The one way a size reaches the pane: the size variable, and the value\n * every handle of this pane announces. Once anything but `expandedSize` has\n * written a size (a default, a controlled value or a\n * resize), the pane owns that size and a new `expandedSize` leaves it alone.\n */\n const ownedRef = React.useRef(false);\n const writeSize = React.useCallback(\n (value: number, own: boolean) => {\n const el = elementRef.current;\n if (!el) return;\n el.style.setProperty(cssVarName, `${value}px`);\n for (const handle of el.querySelectorAll(':scope > .kui-ShellResizer')) handle.setAttribute('aria-valuenow', String(Math.round(value)));\n if (own) ownedRef.current = true;\n },\n [elementRef, cssVarName],\n );\n\n // expandedSize: the size until something else sets one. Declared first, so\n // the effects below win on mount.\n useLayoutEffect(() => {\n if (!ownedRef.current) writeSize(options.expandedSize, false);\n }, [options.expandedSize, writeSize]);\n\n // defaultSize: applied once, on mount.\n useLayoutEffect(() => {\n if (size !== undefined || defaultSize === undefined) return;\n const px = toPx(defaultSize);\n if (typeof px !== 'number' || !Number.isFinite(px)) return;\n const clamped = clampTo(px, minSize, maxSize);\n writeSize(clamped, true);\n emitSizeChange(clamped, { reason: 'init' });\n // An uncontrolled initial value: applied on mount and never re-applied.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size. A drag stands until the app passes a different value.\n // Not while the pane is an overlay: an overlay keeps its designed size, and\n // an app's frame-sized limits (a maximum taken from the window) would\n // otherwise squeeze the drawer and report the squeezed size back. The size\n // is applied again when the pane returns to the frame.\n useLayoutEffect(() => {\n if (size === undefined || latest.current.overlayingNow()) return;\n const px = toPx(size);\n if (typeof px !== 'number' || !Number.isFinite(px)) return;\n const clamped = clampTo(px, minSize, maxSize);\n writeSize(clamped, true);\n emitSizeChange(clamped, { reason: 'controlled' });\n }, [size, minSize, maxSize, options.overlaying, toPx, writeSize, emitSizeChange]);\n\n // What the handle announces before any effect has run: the same starting size the pane's\n // first render uses, so the server HTML already states a value.\n const [startSize] = React.useState(() => {\n const value = size ?? defaultSize;\n return typeof value === 'number' && Number.isFinite(value) ? clampTo(value, minSize, maxSize) : options.expandedSize;\n });\n\n const onResize = React.useCallback((value: number) => latest.current.onResize?.(value), []);\n const onResizeStart = React.useCallback((value: number) => {\n // A resize makes the size the user's: a new expandedSize no longer moves it.\n ownedRef.current = true;\n latest.current.onResizeStart?.(value);\n }, []);\n const onResizeEnd = React.useCallback(\n (value: number) => {\n latest.current.onResizeEnd?.(value);\n emitSizeChange(value, { reason: 'resize' });\n },\n [emitSizeChange],\n );\n const requestToggle = React.useCallback(() => latest.current.requestToggle(), []);\n\n return React.useMemo(\n () => ({\n containerRef: elementRef,\n controls: options.elementId,\n cssVarName,\n minSize,\n maxSize,\n defaultSize: options.expandedSize,\n startSize,\n orientation,\n edge: options.edge,\n growth: options.growth,\n onResize,\n onResizeStart,\n onResizeEnd,\n target: name,\n collapsible: options.collapsible,\n requestToggle,\n }),\n [\n elementRef,\n options.elementId,\n cssVarName,\n minSize,\n maxSize,\n options.expandedSize,\n startSize,\n orientation,\n options.edge,\n options.growth,\n onResize,\n onResizeStart,\n onResizeEnd,\n name,\n options.collapsible,\n requestToggle,\n ],\n );\n}\n\n/** Splits a pane's children into its handles and the rest. */\nexport function splitHandles(children: React.ReactNode, handleType: React.ElementType) {\n const all = React.Children.toArray(children);\n const handles = all.filter((el) => React.isValidElement(el) && el.type === handleType) as React.ReactElement[];\n const content = all.filter((el) => !(React.isValidElement(el) && el.type === handleType));\n return { handles, content };\n}\n", "/**\n * Normalize CSS length values to pixels.\n * Supports: px, rem, %, and bare numbers.\n *\n * @param value - The value to normalize (number, string, or undefined)\n * @param orientation - 'horizontal' for width-based % or 'vertical' for height-based %\n * @returns The value in pixels, or undefined if invalid\n */\nexport function normalizeToPx(\n value: number | string | undefined,\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n): number | undefined {\n if (value == null) return undefined;\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n\n const str = String(value).trim();\n if (!str) return undefined;\n\n // px: direct parse\n if (str.endsWith('px')) return Number.parseFloat(str);\n\n // rem: multiply by root font size\n if (str.endsWith('rem')) {\n const rem = Number.parseFloat(getComputedStyle(document.documentElement).fontSize || '16') || 16;\n return Number.parseFloat(str) * rem;\n }\n\n // %: calculate based on viewport dimension\n if (str.endsWith('%')) {\n const pct = Number.parseFloat(str);\n const base =\n orientation === 'horizontal'\n ? document.documentElement.clientWidth || window.innerWidth || 0\n : document.documentElement.clientHeight || window.innerHeight || 0;\n return (pct / 100) * base;\n }\n\n // Bare number-like string\n const n = Number.parseFloat(str);\n return Number.isFinite(n) ? n : undefined;\n}\n\n"],
5
+ "mappings": "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",
6
+ "names": ["React", "useLayoutEffect", "normalizeToPx", "value", "orientation", "str", "rem", "pct", "base", "n", "clampTo", "value", "min", "max", "useInitialPaneSize", "size", "defaultSize", "minSize", "maxSize", "initial", "useResizablePane", "options", "name", "elementRef", "cssVarName", "orientation", "latest", "useLayoutEffect", "debounceRef", "throttleRef", "emitSizeChange", "meta", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "now", "toPx", "normalizeToPx", "ownedRef", "writeSize", "own", "el", "handle", "px", "clamped", "startSize", "onResize", "onResizeStart", "onResizeEnd", "requestToggle", "splitHandles", "children", "handleType", "all", "handles", "content"]
7
+ }