@womp/kookie-ui 0.30.0 → 0.32.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 (296) hide show
  1. package/components.css +56 -51
  2. package/dist/cjs/components/_internal/page-scope.d.ts +48 -0
  3. package/dist/cjs/components/_internal/page-scope.d.ts.map +1 -0
  4. package/dist/cjs/components/_internal/page-scope.js +3 -0
  5. package/dist/cjs/components/_internal/page-scope.js.map +7 -0
  6. package/dist/cjs/components/_internal/portal-theme.d.ts +2 -1
  7. package/dist/cjs/components/_internal/portal-theme.d.ts.map +1 -1
  8. package/dist/cjs/components/_internal/portal-theme.js +1 -1
  9. package/dist/cjs/components/_internal/portal-theme.js.map +4 -4
  10. package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
  11. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  12. package/dist/cjs/components/_internal/shell-bottom.js.map +4 -4
  13. package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
  14. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  15. package/dist/cjs/components/_internal/shell-inspector.js.map +4 -4
  16. package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
  17. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  18. package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
  19. package/dist/cjs/components/alert-dialog.js +1 -1
  20. package/dist/cjs/components/alert-dialog.js.map +4 -4
  21. package/dist/cjs/components/button.js +1 -1
  22. package/dist/cjs/components/button.js.map +4 -4
  23. package/dist/cjs/components/chatbar.js +1 -1
  24. package/dist/cjs/components/chatbar.js.map +4 -4
  25. package/dist/cjs/components/chip.js +1 -1
  26. package/dist/cjs/components/chip.js.map +4 -4
  27. package/dist/cjs/components/combobox.js +1 -1
  28. package/dist/cjs/components/combobox.js.map +4 -4
  29. package/dist/cjs/components/context-menu.js +1 -1
  30. package/dist/cjs/components/context-menu.js.map +4 -4
  31. package/dist/cjs/components/dialog.js +1 -1
  32. package/dist/cjs/components/dialog.js.map +4 -4
  33. package/dist/cjs/components/dropdown-menu.js +1 -1
  34. package/dist/cjs/components/dropdown-menu.js.map +4 -4
  35. package/dist/cjs/components/index.d.ts +1 -0
  36. package/dist/cjs/components/index.d.ts.map +1 -1
  37. package/dist/cjs/components/index.js +2 -2
  38. package/dist/cjs/components/index.js.map +4 -4
  39. package/dist/cjs/components/link.js +1 -1
  40. package/dist/cjs/components/link.js.map +3 -3
  41. package/dist/cjs/components/link.props.d.ts +0 -6
  42. package/dist/cjs/components/link.props.d.ts.map +1 -1
  43. package/dist/cjs/components/link.props.js +1 -1
  44. package/dist/cjs/components/link.props.js.map +3 -3
  45. package/dist/cjs/components/message-scroller.js +1 -1
  46. package/dist/cjs/components/message-scroller.js.map +4 -4
  47. package/dist/cjs/components/navigator.d.ts +11 -7
  48. package/dist/cjs/components/navigator.d.ts.map +1 -1
  49. package/dist/cjs/components/navigator.js +1 -1
  50. package/dist/cjs/components/navigator.js.map +4 -4
  51. package/dist/cjs/components/notice.js +1 -1
  52. package/dist/cjs/components/notice.js.map +4 -4
  53. package/dist/cjs/components/page.d.ts +31 -0
  54. package/dist/cjs/components/page.d.ts.map +1 -0
  55. package/dist/cjs/components/page.js +3 -0
  56. package/dist/cjs/components/page.js.map +7 -0
  57. package/dist/cjs/components/popover.js +1 -1
  58. package/dist/cjs/components/popover.js.map +4 -4
  59. package/dist/cjs/components/select.js +1 -1
  60. package/dist/cjs/components/select.js.map +4 -4
  61. package/dist/cjs/components/sheet.js +1 -1
  62. package/dist/cjs/components/sheet.js.map +4 -4
  63. package/dist/cjs/components/shell.d.ts.map +1 -1
  64. package/dist/cjs/components/shell.js +1 -1
  65. package/dist/cjs/components/shell.js.map +4 -4
  66. package/dist/cjs/components/sidebar.js +1 -1
  67. package/dist/cjs/components/sidebar.js.map +4 -4
  68. package/dist/cjs/components/toggle.js +1 -1
  69. package/dist/cjs/components/toggle.js.map +4 -4
  70. package/dist/cjs/components/toolbar.d.ts +5 -1
  71. package/dist/cjs/components/toolbar.d.ts.map +1 -1
  72. package/dist/cjs/components/toolbar.js +1 -1
  73. package/dist/cjs/components/toolbar.js.map +4 -4
  74. package/dist/cjs/components/tooltip.js +1 -1
  75. package/dist/cjs/components/tooltip.js.map +4 -4
  76. package/dist/cjs/index.js +5 -5
  77. package/dist/cjs/index.js.map +4 -4
  78. package/dist/cjs/props/index.js +1 -1
  79. package/dist/cjs/props/index.js.map +3 -3
  80. package/dist/esm/{chunk-HBO7W7SS.js → chunk-26O4RBOJ.js} +2 -2
  81. package/dist/esm/chunk-3H33S3UA.js +3 -0
  82. package/dist/esm/{chunk-C67MM24U.js.map → chunk-3H33S3UA.js.map} +3 -3
  83. package/dist/esm/{chunk-FYTLUDL3.js → chunk-3M5ZM67R.js} +2 -2
  84. package/dist/esm/chunk-4B3S2DM7.js +3 -0
  85. package/dist/esm/chunk-4B3S2DM7.js.map +7 -0
  86. package/dist/esm/{chunk-NEKIU24N.js → chunk-4ZHBNYXM.js} +2 -2
  87. package/dist/esm/{chunk-TSS4K2U5.js → chunk-5VYQDA5S.js} +2 -2
  88. package/dist/esm/chunk-65URNXF2.js +3 -0
  89. package/dist/esm/chunk-65URNXF2.js.map +7 -0
  90. package/dist/esm/chunk-6SGJWML7.js +3 -0
  91. package/dist/esm/chunk-6SGJWML7.js.map +7 -0
  92. package/dist/esm/{chunk-R4UKO4UK.js → chunk-6WHKGVWY.js} +2 -2
  93. package/dist/esm/{chunk-7V6M3MIR.js → chunk-7YXHLU4C.js} +2 -2
  94. package/dist/esm/chunk-AKMRPGNP.js +3 -0
  95. package/dist/esm/chunk-AKMRPGNP.js.map +7 -0
  96. package/dist/esm/{chunk-ENQV6SEA.js → chunk-AKSAKP35.js} +2 -2
  97. package/dist/esm/{chunk-FRFVGYGX.js → chunk-BQOFHLDP.js} +2 -2
  98. package/dist/esm/{chunk-ZYQEFENG.js → chunk-COLJWVN7.js} +2 -2
  99. package/dist/esm/{chunk-K3GDM26A.js → chunk-D42VCLKH.js} +2 -2
  100. package/dist/esm/{chunk-MGWGD6KI.js → chunk-DFQIIYLD.js} +2 -2
  101. package/dist/esm/{chunk-NWXODCTD.js → chunk-EERKYRYI.js} +2 -2
  102. package/dist/esm/{chunk-4MNRLB57.js → chunk-FICBVI4M.js} +2 -2
  103. package/dist/esm/chunk-HGF4CKRY.js +3 -0
  104. package/dist/esm/chunk-HGF4CKRY.js.map +7 -0
  105. package/dist/esm/{chunk-JD4KR6VZ.js → chunk-HVMRB3AH.js} +2 -2
  106. package/dist/esm/{chunk-HLIOHDEX.js → chunk-IFHBMTFX.js} +2 -2
  107. package/dist/esm/{chunk-J54GYD7A.js → chunk-JFJV4HL3.js} +2 -2
  108. package/dist/esm/{chunk-KJZSXLIX.js → chunk-JQMWNI62.js} +2 -2
  109. package/dist/esm/{chunk-CMHKCUHP.js → chunk-K35JUIUT.js} +2 -2
  110. package/dist/esm/{chunk-67UEMB4K.js → chunk-KBSH6CBD.js} +2 -2
  111. package/dist/esm/{chunk-SUQJ7DD4.js → chunk-L7PRLW6A.js} +2 -2
  112. package/dist/esm/{chunk-D2C2A2ZK.js → chunk-LFAUMDU5.js} +2 -2
  113. package/dist/esm/{chunk-LABMK6Q7.js → chunk-LG5DPQ46.js} +2 -2
  114. package/dist/esm/{chunk-YMRN5ESN.js → chunk-NFSW36RG.js} +2 -2
  115. package/dist/esm/{chunk-6YWHNLSC.js → chunk-NJ7RQYLX.js} +2 -2
  116. package/dist/esm/{chunk-WD66RYF6.js → chunk-NYIYRILR.js} +2 -2
  117. package/dist/esm/{chunk-JP36JSNP.js → chunk-OBSZOD5M.js} +2 -2
  118. package/dist/esm/{chunk-DP7MPGR7.js → chunk-OMPLFDS6.js} +2 -2
  119. package/dist/esm/{chunk-H2J25HXP.js → chunk-OPYTQ34H.js} +2 -2
  120. package/dist/esm/{chunk-REORAMUH.js → chunk-QBONJMSE.js} +2 -2
  121. package/dist/esm/chunk-QDAM2I6O.js +3 -0
  122. package/dist/esm/chunk-QDAM2I6O.js.map +7 -0
  123. package/dist/esm/chunk-RSG4XWHU.js +2 -0
  124. package/dist/esm/{chunk-2ZKEQS76.js → chunk-SGKLJDA3.js} +2 -2
  125. package/dist/esm/{chunk-676Y7ZUT.js → chunk-TMINGBSQ.js} +2 -2
  126. package/dist/esm/{chunk-2S7HPQVX.js → chunk-TRJAVWCK.js} +2 -2
  127. package/dist/esm/{chunk-EQE6QQXM.js → chunk-TUZ665BA.js} +2 -2
  128. package/dist/esm/{chunk-JKQN6QCP.js → chunk-VBF3XALY.js} +2 -2
  129. package/dist/esm/chunk-VKUAP54W.js +2 -0
  130. package/dist/esm/chunk-VKUAP54W.js.map +7 -0
  131. package/dist/esm/chunk-VWRPVM5K.js +3 -0
  132. package/dist/esm/chunk-VWRPVM5K.js.map +7 -0
  133. package/dist/esm/{chunk-B6OFKABP.js → chunk-VYF6KKYM.js} +2 -2
  134. package/dist/esm/{chunk-6UFIS6B2.js → chunk-W35ZKQMQ.js} +2 -2
  135. package/dist/esm/{chunk-EPGIYTFK.js → chunk-X7DGYRAY.js} +2 -2
  136. package/dist/esm/{chunk-X7JHZ3HA.js → chunk-XF6Z5NKE.js} +2 -2
  137. package/dist/esm/{chunk-K5V53KTJ.js → chunk-Y44DYJA5.js} +2 -2
  138. package/dist/esm/{chunk-MMDZBPSX.js → chunk-YOTTLPJ3.js} +2 -2
  139. package/dist/esm/chunk-ZBSGH74F.js +3 -0
  140. package/dist/esm/chunk-ZBSGH74F.js.map +7 -0
  141. package/dist/esm/chunk-ZHXEEOGI.js +3 -0
  142. package/dist/esm/chunk-ZHXEEOGI.js.map +7 -0
  143. package/dist/esm/{chunk-FMVOB367.js → chunk-ZLGOZKB3.js} +2 -2
  144. package/dist/esm/components/_internal/base-button.js +1 -1
  145. package/dist/esm/components/_internal/page-scope.d.ts +48 -0
  146. package/dist/esm/components/_internal/page-scope.d.ts.map +1 -0
  147. package/dist/esm/components/_internal/page-scope.js +3 -0
  148. package/dist/esm/components/_internal/page-scope.js.map +7 -0
  149. package/dist/esm/components/_internal/pane-chrome.js +1 -1
  150. package/dist/esm/components/_internal/portal-theme.d.ts +2 -1
  151. package/dist/esm/components/_internal/portal-theme.d.ts.map +1 -1
  152. package/dist/esm/components/_internal/portal-theme.js +1 -1
  153. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  154. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  155. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  156. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  157. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  158. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  159. package/dist/esm/components/accordion.js +1 -1
  160. package/dist/esm/components/alert-dialog.js +1 -1
  161. package/dist/esm/components/avatar.js +1 -1
  162. package/dist/esm/components/blockquote.js +1 -1
  163. package/dist/esm/components/button.js +1 -1
  164. package/dist/esm/components/card.js +1 -1
  165. package/dist/esm/components/chatbar.js +1 -1
  166. package/dist/esm/components/checkbox-group.js +1 -1
  167. package/dist/esm/components/checkbox.js +1 -1
  168. package/dist/esm/components/chip.js +1 -1
  169. package/dist/esm/components/code.js +1 -1
  170. package/dist/esm/components/combobox.js +1 -1
  171. package/dist/esm/components/context-menu.js +1 -1
  172. package/dist/esm/components/dialog.js +1 -1
  173. package/dist/esm/components/dropdown-menu.js +1 -1
  174. package/dist/esm/components/heading.js +1 -1
  175. package/dist/esm/components/image.js +1 -1
  176. package/dist/esm/components/index.d.ts +1 -0
  177. package/dist/esm/components/index.d.ts.map +1 -1
  178. package/dist/esm/components/index.js +1 -1
  179. package/dist/esm/components/link.js +1 -1
  180. package/dist/esm/components/link.props.d.ts +0 -6
  181. package/dist/esm/components/link.props.d.ts.map +1 -1
  182. package/dist/esm/components/link.props.js +1 -1
  183. package/dist/esm/components/message-scroller.js +1 -1
  184. package/dist/esm/components/navbar.js +1 -1
  185. package/dist/esm/components/navigator.d.ts +11 -7
  186. package/dist/esm/components/navigator.d.ts.map +1 -1
  187. package/dist/esm/components/navigator.js +1 -1
  188. package/dist/esm/components/notice.js +1 -1
  189. package/dist/esm/components/page.d.ts +31 -0
  190. package/dist/esm/components/page.d.ts.map +1 -0
  191. package/dist/esm/components/page.js +3 -0
  192. package/dist/esm/components/page.js.map +7 -0
  193. package/dist/esm/components/popover.js +1 -1
  194. package/dist/esm/components/progress.js +1 -1
  195. package/dist/esm/components/radio-group.js +1 -1
  196. package/dist/esm/components/radio.js +1 -1
  197. package/dist/esm/components/scroll-area.js +1 -1
  198. package/dist/esm/components/segmented-control.js +1 -1
  199. package/dist/esm/components/select.js +1 -1
  200. package/dist/esm/components/separator.js +1 -1
  201. package/dist/esm/components/sheet.js +1 -1
  202. package/dist/esm/components/shell.d.ts.map +1 -1
  203. package/dist/esm/components/shell.js +1 -1
  204. package/dist/esm/components/sidebar.js +1 -1
  205. package/dist/esm/components/slider.js +1 -1
  206. package/dist/esm/components/switch.js +1 -1
  207. package/dist/esm/components/table.js +1 -1
  208. package/dist/esm/components/tabs.js +1 -1
  209. package/dist/esm/components/text-area.js +1 -1
  210. package/dist/esm/components/text-field.js +1 -1
  211. package/dist/esm/components/text.js +1 -1
  212. package/dist/esm/components/toggle.js +1 -1
  213. package/dist/esm/components/toolbar.d.ts +5 -1
  214. package/dist/esm/components/toolbar.d.ts.map +1 -1
  215. package/dist/esm/components/toolbar.js +1 -1
  216. package/dist/esm/components/tooltip.js +1 -1
  217. package/dist/esm/hooks/index.js +1 -1
  218. package/dist/esm/index.js +1 -1
  219. package/dist/esm/props/index.js +1 -1
  220. package/package.json +1 -1
  221. package/src/components/_internal/page-scope.tsx +119 -0
  222. package/src/components/_internal/portal-theme.tsx +6 -2
  223. package/src/components/_internal/shell-bottom.tsx +4 -1
  224. package/src/components/_internal/shell-inspector.tsx +4 -1
  225. package/src/components/_internal/shell-sidebar.tsx +4 -1
  226. package/src/components/index.css +1 -0
  227. package/src/components/index.tsx +1 -0
  228. package/src/components/link.css +16 -46
  229. package/src/components/link.props.tsx +0 -3
  230. package/src/components/navigator.tsx +46 -16
  231. package/src/components/page.css +38 -0
  232. package/src/components/page.tsx +93 -0
  233. package/src/components/shell.tsx +8 -2
  234. package/src/components/toolbar.css +11 -0
  235. package/src/components/toolbar.tsx +17 -5
  236. package/styles.css +56 -51
  237. package/dist/esm/chunk-5KX3RA3P.js +0 -3
  238. package/dist/esm/chunk-5KX3RA3P.js.map +0 -7
  239. package/dist/esm/chunk-AQKSO3SW.js +0 -3
  240. package/dist/esm/chunk-AQKSO3SW.js.map +0 -7
  241. package/dist/esm/chunk-C67MM24U.js +0 -3
  242. package/dist/esm/chunk-D74WY6UO.js +0 -3
  243. package/dist/esm/chunk-D74WY6UO.js.map +0 -7
  244. package/dist/esm/chunk-E4KT72IB.js +0 -2
  245. package/dist/esm/chunk-EFXHBH3A.js +0 -2
  246. package/dist/esm/chunk-EFXHBH3A.js.map +0 -7
  247. package/dist/esm/chunk-QRV32INS.js +0 -3
  248. package/dist/esm/chunk-QRV32INS.js.map +0 -7
  249. package/dist/esm/chunk-VGJALIJ5.js +0 -3
  250. package/dist/esm/chunk-VGJALIJ5.js.map +0 -7
  251. package/dist/esm/chunk-WAE4MLBN.js +0 -3
  252. package/dist/esm/chunk-WAE4MLBN.js.map +0 -7
  253. package/dist/esm/chunk-YMUERC2J.js +0 -3
  254. package/dist/esm/chunk-YMUERC2J.js.map +0 -7
  255. /package/dist/esm/{chunk-HBO7W7SS.js.map → chunk-26O4RBOJ.js.map} +0 -0
  256. /package/dist/esm/{chunk-FYTLUDL3.js.map → chunk-3M5ZM67R.js.map} +0 -0
  257. /package/dist/esm/{chunk-NEKIU24N.js.map → chunk-4ZHBNYXM.js.map} +0 -0
  258. /package/dist/esm/{chunk-TSS4K2U5.js.map → chunk-5VYQDA5S.js.map} +0 -0
  259. /package/dist/esm/{chunk-R4UKO4UK.js.map → chunk-6WHKGVWY.js.map} +0 -0
  260. /package/dist/esm/{chunk-7V6M3MIR.js.map → chunk-7YXHLU4C.js.map} +0 -0
  261. /package/dist/esm/{chunk-ENQV6SEA.js.map → chunk-AKSAKP35.js.map} +0 -0
  262. /package/dist/esm/{chunk-FRFVGYGX.js.map → chunk-BQOFHLDP.js.map} +0 -0
  263. /package/dist/esm/{chunk-ZYQEFENG.js.map → chunk-COLJWVN7.js.map} +0 -0
  264. /package/dist/esm/{chunk-K3GDM26A.js.map → chunk-D42VCLKH.js.map} +0 -0
  265. /package/dist/esm/{chunk-MGWGD6KI.js.map → chunk-DFQIIYLD.js.map} +0 -0
  266. /package/dist/esm/{chunk-NWXODCTD.js.map → chunk-EERKYRYI.js.map} +0 -0
  267. /package/dist/esm/{chunk-4MNRLB57.js.map → chunk-FICBVI4M.js.map} +0 -0
  268. /package/dist/esm/{chunk-JD4KR6VZ.js.map → chunk-HVMRB3AH.js.map} +0 -0
  269. /package/dist/esm/{chunk-HLIOHDEX.js.map → chunk-IFHBMTFX.js.map} +0 -0
  270. /package/dist/esm/{chunk-J54GYD7A.js.map → chunk-JFJV4HL3.js.map} +0 -0
  271. /package/dist/esm/{chunk-KJZSXLIX.js.map → chunk-JQMWNI62.js.map} +0 -0
  272. /package/dist/esm/{chunk-CMHKCUHP.js.map → chunk-K35JUIUT.js.map} +0 -0
  273. /package/dist/esm/{chunk-67UEMB4K.js.map → chunk-KBSH6CBD.js.map} +0 -0
  274. /package/dist/esm/{chunk-SUQJ7DD4.js.map → chunk-L7PRLW6A.js.map} +0 -0
  275. /package/dist/esm/{chunk-D2C2A2ZK.js.map → chunk-LFAUMDU5.js.map} +0 -0
  276. /package/dist/esm/{chunk-LABMK6Q7.js.map → chunk-LG5DPQ46.js.map} +0 -0
  277. /package/dist/esm/{chunk-YMRN5ESN.js.map → chunk-NFSW36RG.js.map} +0 -0
  278. /package/dist/esm/{chunk-6YWHNLSC.js.map → chunk-NJ7RQYLX.js.map} +0 -0
  279. /package/dist/esm/{chunk-WD66RYF6.js.map → chunk-NYIYRILR.js.map} +0 -0
  280. /package/dist/esm/{chunk-JP36JSNP.js.map → chunk-OBSZOD5M.js.map} +0 -0
  281. /package/dist/esm/{chunk-DP7MPGR7.js.map → chunk-OMPLFDS6.js.map} +0 -0
  282. /package/dist/esm/{chunk-H2J25HXP.js.map → chunk-OPYTQ34H.js.map} +0 -0
  283. /package/dist/esm/{chunk-REORAMUH.js.map → chunk-QBONJMSE.js.map} +0 -0
  284. /package/dist/esm/{chunk-E4KT72IB.js.map → chunk-RSG4XWHU.js.map} +0 -0
  285. /package/dist/esm/{chunk-2ZKEQS76.js.map → chunk-SGKLJDA3.js.map} +0 -0
  286. /package/dist/esm/{chunk-676Y7ZUT.js.map → chunk-TMINGBSQ.js.map} +0 -0
  287. /package/dist/esm/{chunk-2S7HPQVX.js.map → chunk-TRJAVWCK.js.map} +0 -0
  288. /package/dist/esm/{chunk-EQE6QQXM.js.map → chunk-TUZ665BA.js.map} +0 -0
  289. /package/dist/esm/{chunk-JKQN6QCP.js.map → chunk-VBF3XALY.js.map} +0 -0
  290. /package/dist/esm/{chunk-B6OFKABP.js.map → chunk-VYF6KKYM.js.map} +0 -0
  291. /package/dist/esm/{chunk-6UFIS6B2.js.map → chunk-W35ZKQMQ.js.map} +0 -0
  292. /package/dist/esm/{chunk-EPGIYTFK.js.map → chunk-X7DGYRAY.js.map} +0 -0
  293. /package/dist/esm/{chunk-X7JHZ3HA.js.map → chunk-XF6Z5NKE.js.map} +0 -0
  294. /package/dist/esm/{chunk-K5V53KTJ.js.map → chunk-Y44DYJA5.js.map} +0 -0
  295. /package/dist/esm/{chunk-MMDZBPSX.js.map → chunk-YOTTLPJ3.js.map} +0 -0
  296. /package/dist/esm/{chunk-FMVOB367.js.map → chunk-ZLGOZKB3.js.map} +0 -0
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{d as m,i as b,j as C}from"./chunk-WAE4MLBN.js";import{a as O}from"./chunk-JP36JSNP.js";import{a as S}from"./chunk-KVVRFWGQ.js";import{a as R}from"./chunk-4KBKS3ZE.js";import{d as B,i as w,k as H}from"./chunk-YMRN5ESN.js";import{j as L}from"./chunk-GHWEXMF6.js";import*as e from"react";import k from"classnames";var E=e.createContext(null),A=e.createContext(0),G=e.createContext(null);function J(){let t=e.useContext(L),a=e.useContext(B),i=e.useContext(R);return t!==null&&!a&&i===null}var M=e.Activity;function Q({visible:t,children:a}){return M?e.createElement(M,{mode:t?"visible":"hidden"},a):e.createElement("div",{hidden:!t,style:{display:t?"contents":"none"}},a)}function se({path:t,defaultPath:a,onPathChange:i,screen:s,root:c,children:u,className:v,style:p}){let l=J(),[F,$]=e.useState(a??[]),o=t??F,[g,D]=e.useState({path:o,direction:null}),f=g.direction;if(g.path.length!==o.length||g.path.some((n,r)=>!Object.is(n,o[r]))){let n=g.path;f=o.length<n.length?"pop":o.length>n.length||!Object.is(o[o.length-1],n[n.length-1])?"push":g.direction,D({path:o,direction:f})}let T=e.useRef([]),h=e.useRef([]),[I,q]=e.useState(0),N=e.useCallback(n=>{t===void 0&&$(n),i?.(n)},[t,i]),z=e.useMemo(()=>({path:o,canGoBack:o.length>0,push:n=>{h.current[o.length+1]=typeof document>"u"?null:document.activeElement,N([...o,n])},pop:()=>{o.length>0&&N(o.slice(0,-1))},popTo:n=>{n<o.length&&N(o.slice(0,Math.max(0,n)))},titles:T,openers:h,setTitle:(n,r)=>{T.current[n]!==r&&(T.current[n]=r,q(V=>V+1))},direction:f,inPane:l}),[o,N,I,f,l]),x=e.useRef(o.length);e.useEffect(()=>{let n=x.current;if(x.current=o.length,o.length<n){let r=h.current[n];h.current.length=o.length+1,r&&r.isConnected&&r.focus()}},[o.length]);let y=[c,...o.map(n=>s(n))],K=y.length-1,P=e.createElement("div",{className:k("kui-Navigator",v),style:p},y.map((n,r)=>e.createElement(Q,{key:r===0?"root":`${r}:${String(o[r-1])}`,visible:r===K},e.createElement(A.Provider,{value:r},e.createElement("div",{className:"kui-NavigatorLevel"},n)))));return e.createElement(E.Provider,{value:z},e.createElement(G.Provider,{value:P},u??(l?e.createElement(U,null):P)))}function U(){return e.createElement(e.Fragment,null,e.createElement(w,null,e.createElement(C,null,e.createElement(S,{align:"center"},e.createElement(Z,null),e.createElement(_,null)))),e.createElement(H,null,e.createElement(X,null)))}function X(){return e.createElement(e.Fragment,null,e.useContext(G))}function d(){let t=e.useContext(E);if(!t)throw new Error("Kookie: this part must be inside a <Navigator>.");return t}function ce(){return d()}function j(){return e.createElement("svg",{className:"kui-NavigatorBackGlyph",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},e.createElement("path",{d:"m15 18-6-6 6-6",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round"}))}function Y(){return e.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},e.createElement("path",{d:"M18 6 6 18M6 6l12 12",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round"}))}function W(t,a){let i=a>0?t.titles.current[a-1]:void 0;return i?`Back to ${i}`:"Back"}function Z(t){let a=d();return a.canGoBack?e.createElement(m,{iconOnly:!0,"aria-label":t["aria-label"]??W(a,a.path.length),onClick:a.pop},e.createElement(j,null)):null}function _(){let t=d();return e.createElement(b,null,t.titles.current[t.path.length])}function le({title:t,children:a,className:i}){let s=d(),c=e.useContext(A),u=e.useContext(R),v=e.useRef(null);if(e.useEffect(()=>{s.setTitle(c,t)},[s,c,t]),e.useEffect(()=>{if(c===0||s.direction!=="push")return;let l=v.current?.querySelector(".kui-NavigatorBar .kui-ToolbarTitle")??v.current;l&&(l.tabIndex=-1,l.focus({preventScroll:!0}))},[]),s.inPane)return e.createElement("div",{ref:v,className:k("kui-NavigatorScreen",i)},a);let p=e.createElement(O,{as:"h2",size:"4",weight:"medium",truncate:!0},t);return e.createElement("div",{ref:v,className:k("kui-NavigatorScreen",i)},e.createElement("div",{className:"kui-NavigatorBar"},e.createElement(C,{"aria-label":"Navigation"},s.canGoBack&&c>0?e.createElement(m,{iconOnly:!0,"aria-label":W(s,c),onClick:s.pop},e.createElement(j,null)):null,e.createElement(b,{className:"kui-NavigatorBarTitle"},u?e.createElement(u.Title,null,p):p),u?e.createElement(u.Close,null,e.createElement(m,{iconOnly:!0,"aria-label":"Close"},e.createElement(Y,null))):null)),e.createElement("div",{className:"kui-NavigatorBody"},a))}function ue({value:t,className:a,children:i,...s}){let c=d();return e.createElement("button",{type:"button",...s,className:k("kui-reset","kui-NavigatorLink",a),onClick:()=>c.push(t)},e.createElement("span",{className:"kui-NavigatorLinkLabel"},i),e.createElement("svg",{className:"kui-NavigatorLinkGlyph",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},e.createElement("path",{d:"m9 18 6-6-6-6",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round"})))}export{se as a,X as b,ce as c,Z as d,_ as e,le as f,ue as g};
3
- //# sourceMappingURL=chunk-5KX3RA3P.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/navigator.tsx"],
4
- "sourcesContent": ["'use client';\n\n/**\n * Navigator, from v2 (2026-11-03): a stack of screens, any depth. Any screen can open another on\n * top of it, and Back removes the top one. The first screen is the root and never goes.\n *\n * THE PATH IS DATA. The screens above the root are a list of values the app owns, and `screen`\n * turns a value into a screen, so an app can keep the path in its URL, restore it, or open three\n * levels deep from a link.\n *\n * IT HAS NO REGION OF ITS OWN. The host decides how a screen carries its title. In a Shell pane\n * (Sidebar, Panel, Inspector, Bottom), the pane's band holds Back and the title, and the screens\n * go in the pane's scroller. Anywhere else (a card, a Dialog, a Sheet, a Popover, `Shell.Content`)\n * each screen draws its own band: Back, the title, and the overlay's close when it has one.\n *\n * SCREENS UNDER THE TOP STAY MOUNTED, hidden, so a list keeps its scroll and a field its draft.\n *\n * Focus: a pushed screen takes focus at its top; on pop, focus returns to the control that opened\n * the screen. Escape never goes back; it belongs to whatever overlay holds this.\n *\n * Differs from v2 in look only: no motion, since v1 has none. v1 has no Page or Row yet, so a pane\n * screen's title lives in the band from the start, and `NavigatorLink` is its own row.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { NavigatorHostContext } from './_internal/navigator-host.js';\nimport { PaneHeader, Scroll, ShellContentContext } from './_internal/pane-chrome.js';\nimport { ShellStoreContext } from './_internal/shell-store.js';\nimport { Flex } from './flex.js';\nimport { Heading } from './heading.js';\nimport { Toolbar, ToolbarButton, ToolbarTitle } from './toolbar.js';\n\ntype NavigatorApi<T> = {\n /** The values above the root, bottom first. Empty at the root. */\n path: readonly T[];\n /** Open a screen on top. */\n push: (value: T) => void;\n /** Close the top screen. Does nothing at the root. */\n pop: () => void;\n /** Close every screen above `depth`, where 0 is the root. */\n popTo: (depth: number) => void;\n /** Whether there is a screen to go back to. */\n canGoBack: boolean;\n};\n\ntype NavigatorState = NavigatorApi<unknown> & {\n /** Each level's title, so Back can name the screen it returns to and a pane's band can show it. */\n titles: React.MutableRefObject<(string | undefined)[]>;\n setTitle: (depth: number, title: string) => void;\n /** The control that opened each level, so focus can go back to it. */\n openers: React.MutableRefObject<(HTMLElement | null)[]>;\n direction: 'push' | 'pop' | null;\n inPane: boolean;\n};\n\nconst NavigatorContext = React.createContext<NavigatorState | null>(null);\nconst LevelContext = React.createContext<number>(0);\nconst OutletContext = React.createContext<React.ReactNode>(null);\n\n/**\n * True in a Shell pane, not in `Shell.Content` and not in an overlay opened from the pane: there\n * the pane's band carries the title. Overlays set the host context, which is how they opt out.\n */\nfunction useInPane() {\n const store = React.useContext(ShellStoreContext);\n const inContent = React.useContext(ShellContentContext);\n const host = React.useContext(NavigatorHostContext);\n return store !== null && !inContent && host === null;\n}\n\n// Activity keeps a hidden screen's state and cleans up its effects (React 19.2). On an older\n// React, the screen is kept in a hidden element instead, with its effects still running.\nconst Activity = (React as { Activity?: React.ComponentType<{ mode: 'visible' | 'hidden'; children: React.ReactNode }> }).Activity;\n\nfunction Level({ visible, children }: { visible: boolean; children: React.ReactNode }) {\n if (Activity) return <Activity mode={visible ? 'visible' : 'hidden'}>{children}</Activity>;\n return (\n <div hidden={!visible} style={{ display: visible ? 'contents' : 'none' }}>\n {children}\n </div>\n );\n}\n\ninterface NavigatorProps<T> {\n /** The screens above the root, as values. Use it with `onPathChange` to control the path. */\n path?: readonly T[];\n /** The path to start with when the navigator controls its own path. */\n defaultPath?: readonly T[];\n /** Called with the new path whenever a screen opens or closes. */\n onPathChange?: (path: T[]) => void;\n /** Turns a value from the path into its screen, usually a `NavigatorScreen`. */\n screen: (value: T) => React.ReactNode;\n /** The root screen, usually a `NavigatorScreen`. It is always at the bottom and never closes. */\n root: React.ReactNode;\n /**\n * The frame around the screens, when you need your own: a `Shell.PaneHeader` with actions, and\n * a `Shell.Scroll` holding `NavigatorOutlet`. Leave it out and the navigator draws the frame: in\n * a Shell pane, the pane's band with Back and the title, and its scroller; anywhere else, the\n * screens on their own.\n */\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/**\n * A stack of screens: any screen can open another on top, and Back returns to the one below.\n * `root` is the first screen, `screen` turns each value in the path into its screen, and\n * `children`, when given, is the frame the screens go into through `NavigatorOutlet`.\n */\nfunction Navigator<T>({ path: pathProp, defaultPath, onPathChange, screen, root, children, className, style }: NavigatorProps<T>) {\n const inPane = useInPane();\n const [own, setOwn] = React.useState<readonly T[]>(defaultPath ?? []);\n const path = pathProp ?? own;\n // The direction comes from the path itself, so a path the app sets moves focus the same way as\n // one changed by push and pop. Equal length with a new top value is a new screen arriving.\n const [seen, setSeen] = React.useState<{ path: readonly T[]; direction: 'push' | 'pop' | null }>({ path, direction: null });\n let direction = seen.direction;\n // Compared by content, not identity: a controlled `path` may be a new array every render.\n if (seen.path.length !== path.length || seen.path.some((value, i) => !Object.is(value, path[i]))) {\n const before = seen.path;\n direction = path.length < before.length ? 'pop' : path.length > before.length || !Object.is(path[path.length - 1], before[before.length - 1]) ? 'push' : seen.direction;\n setSeen({ path, direction });\n }\n const titles = React.useRef<(string | undefined)[]>([]);\n const openers = React.useRef<(HTMLElement | null)[]>([]);\n const [version, setVersion] = React.useState(0);\n\n const change = React.useCallback(\n (next: T[]) => {\n if (pathProp === undefined) setOwn(next);\n onPathChange?.(next);\n },\n [pathProp, onPathChange],\n );\n\n const api = React.useMemo<NavigatorState>(\n () => ({\n path,\n canGoBack: path.length > 0,\n push: (value) => {\n openers.current[path.length + 1] = typeof document === 'undefined' ? null : (document.activeElement as HTMLElement | null);\n change([...path, value as T]);\n },\n pop: () => {\n if (path.length > 0) change(path.slice(0, -1));\n },\n popTo: (depth) => {\n if (depth < path.length) change(path.slice(0, Math.max(0, depth)));\n },\n titles,\n openers,\n setTitle: (depth, title) => {\n if (titles.current[depth] === title) return;\n titles.current[depth] = title;\n setVersion((v) => v + 1);\n },\n direction,\n inPane,\n }),\n // `version` is read through `titles`; it is here so a new title reaches the band and Back.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [path, change, version, direction, inPane],\n );\n\n // On pop, focus goes back to the control that opened the screen that just closed.\n const previousDepth = React.useRef(path.length);\n React.useEffect(() => {\n const before = previousDepth.current;\n previousDepth.current = path.length;\n if (path.length < before) {\n const opener = openers.current[before];\n openers.current.length = path.length + 1;\n if (opener && opener.isConnected) opener.focus();\n }\n }, [path.length]);\n\n const levels = [root, ...path.map((value) => screen(value))];\n const top = levels.length - 1;\n const outlet = (\n <div className={classNames('kui-Navigator', className)} style={style}>\n {levels.map((level, depth) => (\n // Keyed by depth AND value, so a path that replaces the screen at a depth mounts a new\n // screen instead of handing it the old one's state.\n <Level key={depth === 0 ? 'root' : `${depth}:${String(path[depth - 1])}`} visible={depth === top}>\n <LevelContext.Provider value={depth}>\n <div className=\"kui-NavigatorLevel\">{level}</div>\n </LevelContext.Provider>\n </Level>\n ))}\n </div>\n );\n\n return (\n <NavigatorContext.Provider value={api}>\n <OutletContext.Provider value={outlet}>{children ?? (inPane ? <PaneFrame /> : outlet)}</OutletContext.Provider>\n </NavigatorContext.Provider>\n );\n}\n\n/**\n * The pane's frame: Back and the top screen's title as one cluster at the start of the pane's\n * band, and the screens in the pane's scroller. Pass children to the Navigator instead when the\n * band needs actions of its own, and put `NavigatorBack` and `NavigatorTitle` in it, together in\n * a `Flex`.\n */\nfunction PaneFrame() {\n return (\n <>\n <PaneHeader>\n <Toolbar>\n {/* One cluster: as two loose toolbar children, the band splits them to its two ends. */}\n <Flex align=\"center\">\n <NavigatorBack />\n <NavigatorTitle />\n </Flex>\n </Toolbar>\n </PaneHeader>\n <Scroll>\n <NavigatorOutlet />\n </Scroll>\n </>\n );\n}\n\n/** Where the screens go, inside a frame passed as the navigator's children. */\nfunction NavigatorOutlet() {\n return <>{React.useContext(OutletContext)}</>;\n}\n\nfunction useNavigatorState(): NavigatorState {\n const state = React.useContext(NavigatorContext);\n if (!state) throw new Error('Kookie: this part must be inside a <Navigator>.');\n return state;\n}\n\n/** The navigator around this component: its path, and `push`, `pop` and `popTo`. */\nfunction useNavigator<T = unknown>(): NavigatorApi<T> {\n return useNavigatorState() as NavigatorApi<T>;\n}\n\nfunction BackGlyph() {\n return (\n <svg className=\"kui-NavigatorBackGlyph\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden>\n <path d=\"m15 18-6-6 6-6\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\n\nfunction CloseGlyph() {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden>\n <path d=\"M18 6 6 18M6 6l12 12\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" />\n </svg>\n );\n}\n\nfunction backLabel(state: NavigatorState, depth: number) {\n const previous = depth > 0 ? state.titles.current[depth - 1] : undefined;\n return previous ? `Back to ${previous}` : 'Back';\n}\n\ninterface NavigatorBackProps {\n /** The accessible name. The default is \"Back to\" and the previous screen's title. */\n 'aria-label'?: string;\n}\n\n/**\n * Back, for a toolbar: a chevron that closes the top screen. It is absent at the root rather than\n * disabled, because there is nowhere to go back to. It names the screen it returns to, so a screen\n * reader hears \"Back to Settings\".\n */\nfunction NavigatorBack(props: NavigatorBackProps) {\n const state = useNavigatorState();\n if (!state.canGoBack) return null;\n return (\n <ToolbarButton iconOnly aria-label={props['aria-label'] ?? backLabel(state, state.path.length)} onClick={state.pop}>\n <BackGlyph />\n </ToolbarButton>\n );\n}\n\n/** The top screen's title, for a toolbar in a frame of your own. */\nfunction NavigatorTitle() {\n const state = useNavigatorState();\n return <ToolbarTitle>{state.titles.current[state.path.length]}</ToolbarTitle>;\n}\n\ninterface NavigatorScreenProps {\n /** The screen's title. In a pane it shows in the pane's band; elsewhere in the screen's own. */\n title: string;\n /** The screen's content, under its title. */\n children?: React.ReactNode;\n className?: string;\n}\n\n/**\n * One screen in a navigator. In a Shell pane the pane's band carries Back and its title, so the\n * screen is only its content. Anywhere else it draws its own band: Back, the title, and the\n * overlay's close when it sits in one. In a Dialog, Sheet or Popover the title names the panel.\n */\nfunction NavigatorScreen({ title, children, className }: NavigatorScreenProps) {\n const state = useNavigatorState();\n const depth = React.useContext(LevelContext);\n const Host = React.useContext(NavigatorHostContext);\n const node = React.useRef<HTMLDivElement>(null);\n\n React.useEffect(() => {\n state.setTitle(depth, title);\n }, [state, depth, title]);\n\n // A pushed screen takes focus at its top, so a keyboard and a screen reader start there. In a\n // pane the title is in the band, outside the screen, so the screen itself takes it.\n React.useEffect(() => {\n if (depth === 0 || state.direction !== 'push') return;\n const target = node.current?.querySelector<HTMLElement>('.kui-NavigatorBar .kui-ToolbarTitle') ?? node.current;\n if (target) {\n target.tabIndex = -1;\n target.focus({ preventScroll: true });\n }\n // Only on arrival: a later re-render must not pull focus back to the title.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (state.inPane) {\n return (\n <div ref={node} className={classNames('kui-NavigatorScreen', className)}>\n {children}\n </div>\n );\n }\n\n const heading = (\n <Heading as=\"h2\" size=\"4\" weight=\"medium\" truncate>\n {title}\n </Heading>\n );\n return (\n <div ref={node} className={classNames('kui-NavigatorScreen', className)}>\n {/* One row: Back, the title, and the overlay's close. The band sits one step closer to the\n panel's edge than the content does. */}\n <div className=\"kui-NavigatorBar\">\n <Toolbar aria-label=\"Navigation\">\n {state.canGoBack && depth > 0 ? (\n <ToolbarButton iconOnly aria-label={backLabel(state, depth)} onClick={state.pop}>\n <BackGlyph />\n </ToolbarButton>\n ) : null}\n <ToolbarTitle className=\"kui-NavigatorBarTitle\">{Host ? <Host.Title>{heading}</Host.Title> : heading}</ToolbarTitle>\n {Host ? (\n <Host.Close>\n <ToolbarButton iconOnly aria-label=\"Close\">\n <CloseGlyph />\n </ToolbarButton>\n </Host.Close>\n ) : null}\n </Toolbar>\n </div>\n <div className=\"kui-NavigatorBody\">{children}</div>\n </div>\n );\n}\n\ninterface NavigatorLinkProps<T> extends Omit<React.ComponentPropsWithoutRef<'button'>, 'value' | 'onClick'> {\n /** The value pushed onto the path when the row is pressed. */\n value: T;\n}\n\n/** A row that opens the next screen, with the chevron that says so. */\nfunction NavigatorLink<T>({ value, className, children, ...props }: NavigatorLinkProps<T>) {\n const state = useNavigatorState();\n return (\n <button type=\"button\" {...props} className={classNames('kui-reset', 'kui-NavigatorLink', className)} onClick={() => state.push(value)}>\n <span className=\"kui-NavigatorLinkLabel\">{children}</span>\n <svg className=\"kui-NavigatorLinkGlyph\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden>\n <path d=\"m9 18 6-6-6-6\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </button>\n );\n}\n\nexport { Navigator, NavigatorOutlet, NavigatorBack, NavigatorTitle, NavigatorScreen, NavigatorLink, useNavigator };\nexport type { NavigatorProps, NavigatorBackProps, NavigatorScreenProps, NavigatorLinkProps, NavigatorApi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,gBAAgB,OAAO,eAAe,YAAa,KAAM,cAAc,QAAQ,eAAe,QAAQ,CAChH,CACF,CAEJ",
6
- "names": ["React", "classNames", "NavigatorContext", "LevelContext", "OutletContext", "useInPane", "store", "ShellStoreContext", "inContent", "ShellContentContext", "host", "NavigatorHostContext", "Activity", "Level", "visible", "children", "Navigator", "pathProp", "defaultPath", "onPathChange", "screen", "root", "className", "style", "inPane", "own", "setOwn", "path", "seen", "setSeen", "direction", "value", "i", "before", "titles", "openers", "version", "setVersion", "change", "next", "api", "depth", "title", "v", "previousDepth", "opener", "levels", "top", "outlet", "classNames", "level", "PaneFrame", "PaneHeader", "Toolbar", "Flex", "NavigatorBack", "NavigatorTitle", "Scroll", "NavigatorOutlet", "useNavigatorState", "state", "useNavigator", "BackGlyph", "CloseGlyph", "backLabel", "previous", "props", "ToolbarButton", "ToolbarTitle", "NavigatorScreen", "Host", "node", "target", "heading", "Heading", "NavigatorLink"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{c as t}from"./chunk-FVRVBB6O.js";import{a as o}from"./chunk-ANQLWGFN.js";import*as e from"react";var m=e.forwardRef((r,a)=>e.createElement(o.Provider,{value:null},e.createElement(t,{...r,ref:a})));m.displayName="PortalTheme";export{m as a};
3
- //# sourceMappingURL=chunk-AQKSO3SW.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/_internal/portal-theme.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\n\nimport { Theme } from '../theme.js';\nimport { PaneBandSizeContext } from './pane-band-context.js';\n\n/**\n * The Theme at the root of a portalled surface (Popover, Dialog, Sheet, menus, Tooltip). The\n * surface renders outside any Shell pane even though context flows into it, so a Toolbar in it\n * does not take the pane's band size. A `Theme asChild` an app nests in a pane keeps the band.\n */\nconst PortalTheme = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<typeof Theme>>((props, forwardedRef) => (\n <PaneBandSizeContext.Provider value={null}>\n <Theme {...props} ref={forwardedRef} />\n </PaneBandSizeContext.Provider>\n));\nPortalTheme.displayName = 'PortalTheme';\n\nexport { PortalTheme };\n"],
5
- "mappings": ";gFAAA,UAAYA,MAAW,QAUvB,IAAMC,EAAoB,aAAyE,CAACC,EAAOC,IACzG,gBAACC,EAAoB,SAApB,CAA6B,MAAO,MACnC,gBAACC,EAAA,CAAO,GAAGH,EAAO,IAAKC,EAAc,CACvC,CACD,EACDF,EAAY,YAAc",
6
- "names": ["React", "PortalTheme", "props", "forwardedRef", "PaneBandSizeContext", "Theme"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a}from"./chunk-4MNRLB57.js";import{a as s}from"./chunk-BQC2P3SN.js";import{b as n,c as i,d as m}from"./chunk-UJ7JERJ5.js";import{c as t}from"./chunk-OKQAVYW4.js";import{d as p}from"./chunk-HBWBPBSA.js";import{a as r}from"./chunk-CLJ6SEGP.js";import*as e from"react";import L from"classnames";var y=["1","2","3","4","5","6","7","8","9"],D=["auto","always","hover","none"],f={...r,size:{type:"enum",className:"kui-r-size",values:y,responsive:!0},...m,...s,...i,...n,underline:{type:"enum",className:"kui-underline",values:D,default:"auto"},...p};var h=e.forwardRef((l,c)=>{let{children:o,className:P,color:u,asChild:d,...k}=t(l,f);return e.createElement(a,{...k,"data-accent-color":u,ref:c,asChild:!0,className:L("kui-reset","kui-Link",P)},d?o:e.createElement("a",null,o))});h.displayName="Link";export{h as a};
3
- //# sourceMappingURL=chunk-C67MM24U.js.map
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as Ge,b as Ye}from"./chunk-4G3FJUER.js";import{a as Xe}from"./chunk-ZG2XQUOH.js";import{a as je}from"./chunk-VGJALIJ5.js";import{a as $e}from"./chunk-QRV32INS.js";import{a as Ke}from"./chunk-YMUERC2J.js";import{a as Fe,b as me}from"./chunk-3QWGSRYC.js";import{a as Pe,b as he,c as ve}from"./chunk-LTUW36HM.js";import{a as De,b as Be,c as Ve}from"./chunk-QKCNGEX4.js";import{a as Oe}from"./chunk-WEBNIUEX.js";import{a as J,b as We,c as _e,d as Ue,g as qe}from"./chunk-XUCR7L4G.js";import{a as ye}from"./chunk-G66WDIIV.js";import{c as ue,d as pe,e as we,f as fe,i as Ae,j as Ie,k as Ne}from"./chunk-YMRN5ESN.js";import{c as xe,d as ke}from"./chunk-QEDKL23P.js";import{e as ie,f as Te,h as Me,i as ne,j as ze,k as ce,l as de,n as He,o as oe}from"./chunk-GHWEXMF6.js";import{b as Ee}from"./chunk-5ON3XLRD.js";import{a as Le}from"./chunk-ANQLWGFN.js";import{a as st}from"./chunk-VQPANPMI.js";var Pt={};st(Pt,{Bottom:()=>$e,Content:()=>at,Header:()=>nt,Inspector:()=>Ke,Left:()=>ot,PaneFooter:()=>Ie,PaneHeader:()=>Ae,Panel:()=>Ce,Rail:()=>lt,Root:()=>tt,Scroll:()=>Ne,Sidebar:()=>je,Trigger:()=>rt,useResponsivePresentation:()=>Xe,useShell:()=>Ye,useSidebarMode:()=>Ge});import*as e from"react";import $ from"classnames";import{Slot as it}from"radix-ui";import{useComposedRefs as be,useLayoutEffect as ct}from"radix-ui/internal";var Re=0;function Je(a){Re=Math.max(0,Re+a);let r=document.documentElement;Re>0?r.setAttribute("data-kui-shell-lock",""):r.removeAttribute("data-kui-shell-lock")}var Se="data-kui-shell-inert",dt=30;function Q(a,r){return r===null||r===a||r===a.body||r===a.documentElement}function Qe(a,r,s){for(let u of a.querySelectorAll("[data-shell-trigger][aria-controls]"))if(!(u.getAttribute("aria-controls")!==r||u.closest("[inert]"))&&!(s&&!s.some(R=>R.contains(u))))return u;return null}var ut={values:["1","2","3"]},et=e.createContext(null),Ze=64;function ge(a){return a.querySelector(":scope > .kui-ShellContent > .kui-ShellScroll > .kui-ScrollAreaViewport")??a.querySelector(":scope > .kui-ShellContent")}var tt=e.forwardRef(({className:a,children:r,height:s="full",contained:u,size:R,style:g,onKeyDown:F,onFocus:x,...k},T)=>{let P=Ee(R,ut),[i]=e.useState(Te),C=e.useCallback(t=>Me(i,t),[i]);e.useSyncExternalStore(C,()=>i.version,()=>0);let S=e.useRef(null),D=be(T,S),[E,w]=e.useState(()=>new Set),A=e.useCallback(t=>{w(n=>n.has(t)?n:new Set(n).add(t))},[]),f=e.useCallback(t=>{w(n=>{if(!n.has(t))return n;let o=new Set(n);return o.delete(t),o})},[]),m=e.useMemo(()=>({registerInset:A,unregisterInset:f}),[A,f]),I=e.useCallback(()=>{for(let t of i.entries.values())t.overlayLive&&t.setValue("closed","dismiss")},[i]),M=e.useCallback(()=>[...i.entries.values()].filter(t=>t.overlayLive&&t.el).map(t=>({name:t.name,id:t.id,el:t.el})),[i]),y=[...i.entries.values()].filter(t=>t.overlayLive&&t.el).length,N=u===!0||s!=="full"&&s!=="auto",V=!N&&s==="full",[Z,le]=e.useState(void 0);e.useEffect(()=>{if(!V)return;let t=S.current,n=t?.ownerDocument.defaultView;if(!t||!n||typeof n.matchMedia!="function")return;let o=xe(),c=o?n.scrollY:ge(t)?.scrollTop??0,h=0,v=0,L=()=>{v&&cancelAnimationFrame(v),v=requestAnimationFrame(()=>{v=0})},U=()=>{o&&!v&&(c=n.scrollY)},q=l=>{!o&&!v&&l.target instanceof HTMLElement&&l.target===ge(t)&&(c=l.target.scrollTop)};n.addEventListener("resize",L),n.addEventListener("scroll",U,{passive:!0}),t.addEventListener("scroll",q,{passive:!0,capture:!0});let se=ke(l=>{o=l;let d=c;h&&cancelAnimationFrame(h),h=requestAnimationFrame(()=>{if(h=0,l)n.scrollTo(0,d);else{let p=ge(t);p&&(p.scrollTop=d)}})});return()=>{h&&cancelAnimationFrame(h),v&&cancelAnimationFrame(v),n.removeEventListener("resize",L),n.removeEventListener("scroll",U),t.removeEventListener("scroll",q,{capture:!0}),se()}},[V]);let K=e.useCallback(()=>{let t=S.current;if(!t)return;let n=M().map(o=>o.el);for(let o of t.children){if(!(o instanceof HTMLElement)||o.classList.contains("kui-ShellScrim"))continue;let c=n.some(h=>o===h||o.contains(h));n.length===0||c?o.hasAttribute(Se)&&(o.removeAttribute(Se),o.inert=!1):o.inert||(o.setAttribute(Se,""),o.inert=!0)}},[M]),j=e.useRef(null),G=e.useRef([]),ee=e.useRef(null),O=e.useRef(!1),z=e.useRef(0),W=e.useCallback(()=>{z.current&&cancelAnimationFrame(z.current),z.current=0},[]),_=e.useCallback((t,n)=>{W();let o=0,c=()=>{if(z.current=0,!!t.isConnected){if(n(t.ownerDocument.activeElement)){t.focus({preventScroll:!0});return}o+=1,o<dt&&(z.current=requestAnimationFrame(c))}};z.current=requestAnimationFrame(c)},[W]);e.useEffect(()=>()=>{W(),O.current&&(O.current=!1,Je(-1))},[W]),e.useEffect(()=>{let t=S.current;if(!t)return;let n=t.ownerDocument,o=M(),c=o.map(l=>l.el),h=!N&&o.length>0;h!==O.current&&(O.current=h,Je(h?1:-1));let v=G.current;G.current=o;let L=v.filter(l=>{if(c.includes(l.el))return!1;let d=i.entries.get(l.name);return!l.el.isConnected||!d||d.el!==l.el||d.value==="closed"}),U=l=>l!==null&&L.some(d=>d.el.contains(l));if(v.length===0&&o.length>0){let l=n.activeElement,d=l instanceof HTMLElement&&!Q(n,l)&&!c.some(p=>p.contains(l))?l:null;if(d&&!t.contains(d)){let p=ee.current;p&&p.isConnected&&!c.some(te=>te.contains(p))&&(d=p)}j.current=d}if(K(),o.length===0){let l=j.current;if(j.current=null,L.length===0)return;let p=(H=>H!==null&&H.isConnected&&!H.closest("[inert]")&&!U(H))(l)?l:null;for(let H of L)p??(p=Qe(n,H.id));if(!p)return;let te=H=>Q(n,H)||U(H);te(n.activeElement)?p.focus({preventScroll:!0}):_(p,te);return}if(L.length>0){let l=n.activeElement;if(Q(n,l)||U(l)){let d=null;for(let p of L)d??(d=Qe(n,p.id,c));(d??c[c.length-1]).focus({preventScroll:!0})}}let q=c.filter(l=>!v.some(d=>d.el===l)),se=n.activeElement;q.length>0&&!c.some(l=>l.contains(se))&&(q[0].focus({preventScroll:!0}),_(q[0],l=>Q(n,l)||l instanceof Element&&l.closest("[inert]")!==null))}),e.useEffect(()=>{let t=S.current;if(!t||y===0||typeof MutationObserver>"u")return;let n=new MutationObserver(K);return n.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]}),()=>n.disconnect()},[y,K]);let Y=t=>{F?.(t),!(t.key!=="Escape"||t.defaultPrevented||y===0)&&(I(),t.stopPropagation())};e.useEffect(()=>{let t=S.current;if(!t||y===0)return;let n=t.ownerDocument,o=c=>{c.key!=="Escape"||c.defaultPrevented||!Q(n,c.target)||I()};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)},[y,I]);let ae=t=>{x?.(t),t.target instanceof HTMLElement&&S.current?.contains(t.target)&&(ee.current=t.target)},B=i.entries.get("rail"),X=B!==void 0&&B.value!==void 0&&B.value!=="closed"?E.has("rail")?`calc(${B.size}px + 2 * var(--shell-inset-gap))`:`${B.size}px`:void 0,re=s==="full"?{}:s==="auto"?{height:"auto"}:typeof s=="number"?{height:`${s}px`}:{height:s};return e.createElement(ze.Provider,{value:i},e.createElement(ue.Provider,{value:P},e.createElement(pe.Provider,{value:!1},e.createElement(we.Provider,{value:V},e.createElement(et.Provider,{value:le},e.createElement(He.Provider,{value:m},e.createElement(Le.Provider,{value:void 0},e.createElement("div",{...k,ref:D,className:$("kui-ShellRoot",a),"data-height":s==="auto"&&!N?"auto":void 0,"data-contained":N||void 0,"data-window":V||void 0,"data-has-inset":E.size>0||void 0,"data-overlay-live":y>0||void 0,onKeyDown:Y,onFocus:ae,style:{...re,...X?{"--shell-rail-offset":X}:{},...Z!==void 0?{"--kui-shell-header-h":`${Z}px`}:{},...g}},r,e.createElement("div",{className:"kui-ShellScrim","aria-hidden":!0,onClick:I})))))))))});tt.displayName="Shell.Root";var nt=e.forwardRef(({className:a,height:r=Ze,style:s,...u},R)=>{let g=e.useContext(et);return ct(()=>{if(g)return g(r===Ze?void 0:r),()=>g(void 0)},[g,r]),e.createElement("header",{...u,ref:R,className:$("kui-ShellHeader",a),style:{...s,"--shell-header-height":`${r}px`}})});nt.displayName="Shell.Header";var ot=e.forwardRef(({children:a},r)=>(e.useEffect(()=>{},[]),e.createElement(e.Fragment,null,a)));ot.displayName="Shell.Left";var pt={controlled:"open",default:"defaultOpen"},lt=e.forwardRef((a,r)=>{let{className:s,presentation:u,expandedSize:R=64,collapsible:g,onExpand:F,onCollapse:x,children:k,style:T,open:P,defaultOpen:i,onOpenChange:C,inset:S,id:D,...E}=a,{table:w,attributes:A}=ve(u,"fixed"),f=Pe({name:"rail",label:"Rail",propNames:pt,id:D,controlled:J(P),defaultValue:J(i),presentationTable:w,builtIn:We,onChange:(I,M)=>C?.(I!=="closed",{reason:M}),onExpand:F,onCollapse:x,size:R});oe("rail",S);let m=be(r,f.setElement);return e.createElement("div",{...E,role:E.role??"navigation",id:f.id,ref:m,className:$("kui-ShellPane","kui-ShellRail",s),...he(f,A),"data-inset":S||void 0,tabIndex:f.overlaying?-1:E.tabIndex,style:{...T,"--rail-size":`${R}px`}},e.createElement(ft,null,k))});lt.displayName="Shell.Rail";function ft({children:a}){let r=e.useContext(ue);return e.createElement("div",{className:$("kui-ShellRailContent",`kui-r-size-${r}`)},e.createElement(fe,{presentation:"thin"},a))}var mt={controlled:"open",default:"defaultOpen"},Ce=e.forwardRef((a,r)=>{let{className:s,presentation:u,defaultOpen:R,open:g,onOpenChange:F,size:x,defaultSize:k,expandedSize:T=288,minSize:P=100,maxSize:i=800,resizable:C=!1,collapsible:S=!0,onExpand:D,onCollapse:E,onResize:w,onResizeStart:A,onResizeEnd:f,snapPoints:m,snapTolerance:I,collapseThreshold:M,paneId:y,persistence:N,children:V,style:Z,onSizeChange:le,sizeUpdate:K,sizeUpdateMs:j=50,inset:G,id:ee,...O}=a,z=ce("Shell.Panel"),W=de(z,"rail"),_=ve(u,"fixed"),Y=u===void 0,ae=Y?W?.presentationTable??ie:_.table,B=Y?{"data-presentation-follows":""}:_.attributes,b=Pe({name:"panel",label:"Panel",propNames:mt,id:ee,controlled:J(g),defaultValue:J(R),presentationTable:ae,builtIn:_e,onChange:(v,L)=>F?.(v!=="closed",{reason:L}),onExpand:D,onCollapse:E,size:T});oe("panel",G),e.useEffect(()=>{(m!==void 0||M!==void 0||y!==void 0||N!==void 0)&&void 0},[m,M,y,N]);let X=e.useRef(null),re=be(r,b.setElement,X),t=Be({name:"panel",elementId:b.id,elementRef:X,cssVarName:"--panel-size",orientation:"vertical",edge:"end",growth:Ue,expandedSize:T,minSize:P,maxSize:i,resizable:C,collapsible:S,size:x,defaultSize:k,onSizeChange:le,sizeUpdate:K,sizeUpdateMs:j,onResize:w,onResizeStart:A,onResizeEnd:f,snapPoints:m,snapTolerance:I,collapseThreshold:M,paneId:y,persistence:N,overlaying:b.overlaying,overlayingNow:()=>(Y?z.entries.get("rail")?.presentationTable??ie:_.table)[ye()]==="overlay",requestCollapse:()=>b.setValue("closed","toggle"),requestToggle:()=>b.toggle("toggle")}),n=De(x,k,P,i),{handles:o,content:c}=Ve(V,me),h=C&&b.shown!==!1&&!b.overlaying?e.createElement(Oe.Provider,{value:t},o.length>0?o:e.createElement(Fe,null)):null;return e.createElement("div",{...qe(O),role:O.role??"navigation",id:b.id,ref:re,className:$("kui-ShellPane","kui-ShellPanel",s),...he(b,B),"data-inset":G||void 0,tabIndex:b.overlaying?-1:O.tabIndex,style:{...Z,"--panel-expanded-size":`${T}px`,...n?{"--panel-size":n}:{}}},e.createElement("div",{className:"kui-ShellPanelContent"},e.createElement(fe,null,c)),h)});Ce.displayName="Shell.Panel";Ce.Handle=me;var at=e.forwardRef(({className:a,inset:r,children:s,...u},R)=>(oe("content",r),e.createElement("main",{...u,ref:R,className:$("kui-ShellContent",a),"data-inset":r||void 0},e.createElement(pe.Provider,{value:!0},s))));at.displayName="Shell.Content";var rt=e.forwardRef(({target:a,action:r="toggle",peekOnHover:s,asChild:u=!1,onClick:R,onMouseEnter:g,onMouseLeave:F,children:x,...k},T)=>{let P=ce("Shell.Trigger");e.useEffect(()=>{a==="left"&&void 0,s&&void 0},[a,s]);let i=a==="left"?"rail":a,C=de(P,i),S=C?.value===void 0?void 0:C.value!=="closed",D=f=>{if(R?.(f),f.defaultPrevented)return;let m=P.entries.get(i);m&&(P.peek===i&&ne(P,null),r==="toggle"?m.toggle("toggle"):r==="expand"?m.setValue("open","toggle"):m.setValue("closed","toggle"))},E=f=>{if(g?.(f),!s)return;let m=P.entries.get(i);m&&m.value==="closed"&&m.presentation!=="overlay"&&ne(P,i)},w=f=>{F?.(f),s&&P.peek===i&&ne(P,null)},A=u?it.Root:"button";return e.createElement(A,{...!u&&{type:"button"},"aria-controls":C?.id,"aria-expanded":S,...k,ref:T,onClick:D,onMouseEnter:E,onMouseLeave:w,"data-shell-trigger":a,"data-shell-action":r},x)});rt.displayName="Shell.Trigger";export{tt as a,nt as b,ot as c,lt as d,Ce as e,at as f,rt as g,Pt as h};
3
- //# sourceMappingURL=chunk-D74WY6UO.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/shell.tsx"],
4
- "sourcesContent": ["/**\n * Shell: the app frame.\n *\n * Since 0.8.0 the Shell is built on kookie-ui-v2's model, behind v1's API:\n *\n * - The Root is a CSS grid and renders its children as given, in JSX order.\n * Each pane claims its own grid area, so the Root never scans or reorders\n * children, any child renders, and a pane mounted after the Root works.\n * - State lives on each pane: `auto` (untouched), `open` or `closed`. An\n * untouched pane follows the window, resolved by the\n * stylesheet, so first paint needs no script and no open-state callback\n * fires on mount or on a resize.\n * - A pane is one element at every width. `overlay` is a posture of that\n * element, not a Sheet swapped in: crossing a breakpoint keeps its scroll\n * position, its focus and its children's state.\n * - The Root owns what an overlay needs: one scrim, `inert` on everything\n * else, focus moved in and returned, Escape, and a scroll lock.\n * - Nothing links panes to each other. A Rail closing no longer closes the\n * Panel; an app that wants that writes it in `onOpenChange`.\n */\n'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\nimport { PaneResizeContext } from './_internal/shell-resize.js';\nimport { PaneHandle, PanelHandle } from './_internal/shell-handles.js';\nimport { Sidebar } from './_internal/shell-sidebar.js';\nimport type { SidebarPublicProps } from './_internal/shell-sidebar.js';\nimport { Bottom } from './_internal/shell-bottom.js';\nimport type { BottomPublicProps } from './_internal/shell-bottom.js';\nimport { Inspector } from './_internal/shell-inspector.js';\nimport type { InspectorPublicProps } from './_internal/shell-inspector.js';\nimport { usePane, paneAttributes, usePresentationTable } from './_internal/shell-pane.js';\nimport { splitHandles, useInitialPaneSize, useResizablePane } from './_internal/shell-resizable.js';\nimport {\n FIXED_TABLE,\n ShellInsetContext,\n ShellStoreContext,\n createShellStore,\n setShellPeek,\n subscribeShellStore,\n useInsetRegistration,\n usePaneEntry,\n useShellStore,\n warnOnce,\n type InsetPaneId,\n} from './_internal/shell-store.js';\nimport { navigationRest, detailRest, toPaneValue, startAnchoredGrowth, withoutRemovedPaneProps } from './_internal/shell-rest.js';\nimport { useShell, useSidebarMode } from './shell.context.js';\nimport { useResponsivePresentation } from './shell.hooks.js';\nimport { readBreakpoint } from '../hooks/use-breakpoint.js';\nimport { useThemeSize } from '../hooks/theme-size.js';\nimport { PaneChromeScope, PaneFooter, PaneHeader, Scroll, ShellContentContext, ShellSizeContext, ShellWindowContext } from './_internal/pane-chrome.js';\nimport { onPageScrollMediaChange, pageScrollMatches } from './_internal/shell-page-scroll.js';\nimport type { PaneSize, PaneHeaderProps, PaneFooterProps, ScrollProps } from './_internal/pane-chrome.js';\nimport { PaneBandSizeContext } from './_internal/pane-band-context.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, PaneMode, PaneName, PaneTarget, ResponsivePresentation, SidebarMode } from './shell.types.js';\n\n/* \u2500\u2500 Root \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface ShellRootProps extends React.ComponentPropsWithoutRef<'div'> {\n children: React.ReactNode;\n /**\n * The Shell's height. `full` (the default) is the window's height; on a narrow touch screen the\n * page scrolls instead of the content, so the browser can hide its toolbars. `auto` grows with\n * the content. Any other value is the Shell's own height, and makes it contained.\n */\n height?: 'full' | 'auto' | string | number;\n /**\n * Makes the Shell fill its parent instead of the window, and always scroll inside itself. Its\n * overlays cover only its own box and leave the page free to scroll. Use it for a Shell in a\n * card, a demo or a canvas. An explicit `height` implies it.\n */\n contained?: boolean;\n /** The index the panes' chrome takes: `Shell.PaneHeader`, `Shell.Scroll`, `Shell.PaneFooter` and the Sidebar rows in them. Defaults to the nearest Theme's size (3 when the Theme is 4), else `2`. */\n size?: PaneSize;\n}\n\n/**\n * Every Shell with a live overlay holds the page still, counted across Shells,\n * through an attribute the stylesheet reads. Saving and restoring the\n * document's inline `overflow` would fight any other scroll lock on the page.\n */\nlet pageLockHolders = 0;\nfunction updatePageLock(delta: 1 | -1) {\n pageLockHolders = Math.max(0, pageLockHolders + delta);\n const doc = document.documentElement;\n if (pageLockHolders > 0) doc.setAttribute('data-kui-shell-lock', '');\n else doc.removeAttribute('data-kui-shell-lock');\n}\n\n/** Marks a child the Root made inert, so closing removes only what the Root added. */\nconst INERT_MARK = 'data-kui-shell-inert';\n\n/** How many frames a focus rescue watches after an overlay opens or closes. */\nconst RESCUE_FRAMES = 30;\n\n/** Focus that is nowhere useful: the document, or nothing at all. */\nfunction isNowhere(doc: Document, el: Element | EventTarget | null): boolean {\n return el === null || el === doc || el === doc.body || el === doc.documentElement;\n}\n\n/** A Trigger that drives the pane with this id and can take focus, optionally only inside `within`. */\nfunction triggerFor(doc: Document, id: string, within?: HTMLElement[]): HTMLElement | null {\n for (const el of doc.querySelectorAll<HTMLElement>('[data-shell-trigger][aria-controls]')) {\n if (el.getAttribute('aria-controls') !== id || el.closest('[inert]')) continue;\n if (within && !within.some((pane) => pane.contains(el))) continue;\n return el;\n }\n return null;\n}\n\ntype LivePane = { name: PaneName; id: string; el: HTMLElement };\n\n/** Shell.Root's own range; a Theme size above it maps to 3. */\nconst shellSizePropDef = { values: ['1', '2', '3'] as const };\n\n/** Lets a Shell.Header tell the Root its height, for the rows that stick beneath it while the page scrolls. */\nconst ShellHeaderHeightContext = React.createContext<((height: number | undefined) => void) | null>(null);\n\n/** The Shell.Header's default height, which the stylesheet assumes until a Header says otherwise. */\nconst DEFAULT_HEADER_HEIGHT = 64;\n\n/** The content's scroller while the frame scrolls: the Shell.Scroll's viewport, or the content itself. */\nfunction frameScroller(rootEl: HTMLElement): HTMLElement | null {\n return rootEl.querySelector<HTMLElement>(':scope > .kui-ShellContent > .kui-ShellScroll > .kui-ScrollAreaViewport') ?? rootEl.querySelector<HTMLElement>(':scope > .kui-ShellContent');\n}\n\nconst Root = React.forwardRef<HTMLDivElement, ShellRootProps>(({ className, children, height = 'full', contained: containedProp, size: sizeProp, style, onKeyDown, onFocus, ...props }, ref) => {\n // No size of its own: the nearest Theme's, mapped into 1-3.\n const size = useThemeSize(sizeProp, shellSizePropDef);\n const [store] = React.useState(createShellStore);\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n // Subscribed for the re-render, not for a value: a pane opening or closing\n // must bring the Root back so containment and the scrim follow it.\n React.useSyncExternalStore(\n subscribe,\n () => store.version,\n () => 0,\n );\n\n const rootRef = React.useRef<HTMLDivElement | null>(null);\n const composedRef = useComposedRefs(ref, rootRef);\n\n // Inset: the Root paints the backdrop while any pane is inset.\n const [insetPanes, setInsetPanes] = React.useState<ReadonlySet<InsetPaneId>>(() => new Set());\n const registerInset = React.useCallback((id: InsetPaneId) => {\n setInsetPanes((prev) => (prev.has(id) ? prev : new Set(prev).add(id)));\n }, []);\n const unregisterInset = React.useCallback((id: InsetPaneId) => {\n setInsetPanes((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }, []);\n const insetContext = React.useMemo(() => ({ registerInset, unregisterInset }), [registerInset, unregisterInset]);\n\n const closeOverlays = React.useCallback(() => {\n for (const entry of store.entries.values()) {\n if (entry.overlayLive) entry.setValue('closed', 'dismiss');\n }\n }, [store]);\n\n const livePanes = React.useCallback(\n (): LivePane[] => [...store.entries.values()].filter((entry) => entry.overlayLive && entry.el).map((entry) => ({ name: entry.name, id: entry.id, el: entry.el as HTMLElement })),\n [store],\n );\n const liveCount = [...store.entries.values()].filter((entry) => entry.overlayLive && entry.el).length;\n\n // A contained Shell sits inside a page, and its overlays cover only its box:\n // it holds no page lock. A height of its own implies it. `full` is the\n // window, and `auto` grows with its content, so its overlays are placed on\n // the window. Only a `full` Shell lets the page scroll on a phone.\n const contained = containedProp === true || (height !== 'full' && height !== 'auto');\n const windowShell = !contained && height === 'full';\n\n const [headerHeight, setHeaderHeight] = React.useState<number | undefined>(undefined);\n\n /*\n * The reading position crosses with the scroller. When a touch window\n * crosses the narrow boundary (a phone rotating, an iPad entering Split\n * View), the scroller changes between the content and the page, and the new\n * one starts at the top. The offset is remembered on `scroll` from whichever\n * scroller is live, because by the time the change is reported the old one\n * has already been laid out again and clamped. Only the live scroller is\n * heard. The clamp itself is reported as a scroll in the same frame as the\n * resize and before the media change, so scrolls are not heard from a resize\n * until that frame's animation callbacks.\n */\n React.useEffect(() => {\n if (!windowShell) return;\n const rootEl = rootRef.current;\n const win = rootEl?.ownerDocument.defaultView;\n if (!rootEl || !win || typeof win.matchMedia !== 'function') return;\n let pageScrolls = pageScrollMatches();\n let offset = pageScrolls ? win.scrollY : (frameScroller(rootEl)?.scrollTop ?? 0);\n let frame = 0;\n let resizing = 0;\n const onResize = () => {\n if (resizing) cancelAnimationFrame(resizing);\n resizing = requestAnimationFrame(() => {\n resizing = 0;\n });\n };\n const fromPage = () => {\n if (pageScrolls && !resizing) offset = win.scrollY;\n };\n const fromFrame = (event: Event) => {\n if (!pageScrolls && !resizing && event.target instanceof HTMLElement && event.target === frameScroller(rootEl)) offset = event.target.scrollTop;\n };\n win.addEventListener('resize', onResize);\n win.addEventListener('scroll', fromPage, { passive: true });\n rootEl.addEventListener('scroll', fromFrame, { passive: true, capture: true });\n const stop = onPageScrollMediaChange((matches) => {\n pageScrolls = matches;\n const carried = offset;\n if (frame) cancelAnimationFrame(frame);\n frame = requestAnimationFrame(() => {\n frame = 0;\n if (matches) win.scrollTo(0, carried);\n else {\n const el = frameScroller(rootEl);\n if (el) el.scrollTop = carried;\n }\n });\n });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n if (resizing) cancelAnimationFrame(resizing);\n win.removeEventListener('resize', onResize);\n win.removeEventListener('scroll', fromPage);\n rootEl.removeEventListener('scroll', fromFrame, { capture: true });\n stop();\n };\n }, [windowShell]);\n\n /*\n * Containment is the Root's, not the pane's. Only the Root can see every live\n * overlay and every child at once. A per-pane effect, given two overlays,\n * inerts the other live overlay and restores values the other effect wrote,\n * which can leave the whole frame inert for good.\n *\n * Exempt are the scrim and each root child that CONTAINS a live overlay, so\n * a pane wrapped in a plain element is not inerted with its wrapper. A child\n * the Root inerts is marked, and closing clears only marked children, so\n * `inert` the app sets on a child is the app's before, during and after.\n */\n const contain = React.useCallback(() => {\n const rootEl = rootRef.current;\n if (!rootEl) return;\n const liveEls = livePanes().map((pane) => pane.el);\n for (const child of rootEl.children) {\n if (!(child instanceof HTMLElement) || child.classList.contains('kui-ShellScrim')) continue;\n const holdsLive = liveEls.some((el) => child === el || child.contains(el));\n if (liveEls.length === 0 || holdsLive) {\n if (child.hasAttribute(INERT_MARK)) {\n child.removeAttribute(INERT_MARK);\n child.inert = false;\n }\n } else if (!child.inert) {\n child.setAttribute(INERT_MARK, '');\n child.inert = true;\n }\n }\n }, [livePanes]);\n\n const returnFocusTo = React.useRef<HTMLElement | null>(null);\n const lastLive = React.useRef<LivePane[]>([]);\n const lastFocusInRoot = React.useRef<HTMLElement | null>(null);\n const holdsLock = React.useRef(false);\n\n /*\n * Focus can be taken away after the commit that moved it: a menu that\n * opened or closed a pane restores focus to its own trigger when it\n * finishes closing, which may be inert or hidden by then. For a few frames\n * after an overlay opens or closes, focus that ends up nowhere useful is\n * put back where it belongs.\n */\n const rescueFrame = React.useRef(0);\n const cancelRescue = React.useCallback(() => {\n if (rescueFrame.current) cancelAnimationFrame(rescueFrame.current);\n rescueFrame.current = 0;\n }, []);\n const rescueFocus = React.useCallback(\n (target: HTMLElement, lost: (active: Element | null) => boolean) => {\n cancelRescue();\n let frames = 0;\n const tick = () => {\n rescueFrame.current = 0;\n if (!target.isConnected) return;\n if (lost(target.ownerDocument.activeElement)) {\n target.focus({ preventScroll: true });\n return;\n }\n frames += 1;\n if (frames < RESCUE_FRAMES) rescueFrame.current = requestAnimationFrame(tick);\n };\n rescueFrame.current = requestAnimationFrame(tick);\n },\n [cancelRescue],\n );\n\n React.useEffect(\n () => () => {\n cancelRescue();\n if (holdsLock.current) {\n holdsLock.current = false;\n updatePageLock(-1);\n }\n },\n [cancelRescue],\n );\n\n // No dependency array, on purpose: a pane opening or closing is a render\n // of this component, and so is a child appearing through the Root.\n React.useEffect(() => {\n const rootEl = rootRef.current;\n if (!rootEl) return;\n const doc = rootEl.ownerDocument;\n const live = livePanes();\n const liveEls = live.map((pane) => pane.el);\n\n const wantsLock = !contained && live.length > 0;\n if (wantsLock !== holdsLock.current) {\n holdsLock.current = wantsLock;\n updatePageLock(wantsLock ? 1 : -1);\n }\n\n const previous = lastLive.current;\n lastLive.current = live;\n // A pane that left the live set because it closed, as opposed to one\n // that is still open but stopped being an overlay at a breakpoint.\n const closed = previous.filter((pane) => {\n if (liveEls.includes(pane.el)) return false;\n const entry = store.entries.get(pane.name);\n return !pane.el.isConnected || !entry || entry.el !== pane.el || entry.value === 'closed';\n });\n const inClosed = (active: Element | null) => active !== null && closed.some((pane) => pane.el.contains(active));\n\n // The return target is taken on the opening edge, before inerting: inerting\n // the subtree that holds the trigger blurs it. Focus already inside the\n // overlay (a pane that became one at a breakpoint) is no place to return\n // to, and an opener in a portal (a menu item) goes away with its menu, so\n // the last place focus held inside the frame stands in for it.\n if (previous.length === 0 && live.length > 0) {\n const active = doc.activeElement;\n let target = active instanceof HTMLElement && !isNowhere(doc, active) && !liveEls.some((el) => el.contains(active)) ? active : null;\n if (target && !rootEl.contains(target)) {\n const inRoot = lastFocusInRoot.current;\n if (inRoot && inRoot.isConnected && !liveEls.some((el) => el.contains(inRoot))) target = inRoot;\n }\n returnFocusTo.current = target;\n }\n\n contain();\n\n if (live.length === 0) {\n const before = returnFocusTo.current;\n returnFocusTo.current = null;\n // Every overlay that left only stopped being one: focus stays where it is.\n if (closed.length === 0) return;\n const usable = (el: HTMLElement | null) => el !== null && el.isConnected && !el.closest('[inert]') && !inClosed(el);\n let target = usable(before) ? before : null;\n for (const pane of closed) target ??= triggerFor(doc, pane.id);\n if (!target) return;\n const lost = (active: Element | null) => isNowhere(doc, active) || inClosed(active);\n if (lost(doc.activeElement)) target.focus({ preventScroll: true });\n else rescueFocus(target, lost);\n return;\n }\n\n // Some overlays closed while others stay: focus left in a closed one goes\n // to the Trigger that opened it, if a live pane holds it, or to the pane\n // on top.\n if (closed.length > 0) {\n const active = doc.activeElement;\n if (isNowhere(doc, active) || inClosed(active)) {\n let target: HTMLElement | null = null;\n for (const pane of closed) target ??= triggerFor(doc, pane.id, liveEls);\n (target ?? liveEls[liveEls.length - 1]).focus({ preventScroll: true });\n }\n }\n\n // Focus moves in on the opening edge and nowhere else, and only when it\n // is not already somewhere the user put it inside the live set.\n const opened = liveEls.filter((el) => !previous.some((pane) => pane.el === el));\n const active = doc.activeElement;\n if (opened.length > 0 && !liveEls.some((el) => el.contains(active))) {\n opened[0].focus({ preventScroll: true });\n rescueFocus(opened[0], (now) => isNowhere(doc, now) || (now instanceof Element && now.closest('[inert]') !== null));\n }\n });\n\n // A child that appears through its own state while an overlay is live does\n // not render the Root, so the Root watches its children while one is.\n React.useEffect(() => {\n const rootEl = rootRef.current;\n if (!rootEl || liveCount === 0 || typeof MutationObserver === 'undefined') return;\n const observer = new MutationObserver(contain);\n observer.observe(rootEl, { childList: true, subtree: true, attributes: true, attributeFilter: ['inert'] });\n return () => observer.disconnect();\n }, [liveCount, contain]);\n\n /*\n * Escape closes the overlays. It is handled as a React event on the Root, so\n * a component inside a pane that answers Escape in its own onKeyDown runs\n * first, and its preventDefault() or stopPropagation() keeps the pane open.\n * When the Root closes something it stops the event there, so a React\n * Escape handler above the Shell does not act on it too. A layer that\n * listens on the document in the capture phase (Radix dialogs, menus and\n * popovers) answers first and calls preventDefault() when it closes, so an\n * enclosing Kookie Dialog closes before a Shell inside it is asked.\n */\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.key !== 'Escape' || event.defaultPrevented || liveCount === 0) return;\n closeOverlays();\n event.stopPropagation();\n };\n\n // With focus on the document itself (a pane closed under it, or a menu that\n // closed and took focus with it), the Root never sees the key. While an\n // overlay is live the document answers that one case.\n React.useEffect(() => {\n const rootEl = rootRef.current;\n if (!rootEl || liveCount === 0) return;\n const doc = rootEl.ownerDocument;\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || event.defaultPrevented || !isNowhere(doc, event.target)) return;\n closeOverlays();\n };\n doc.addEventListener('keydown', onDocumentKeyDown);\n return () => doc.removeEventListener('keydown', onDocumentKeyDown);\n }, [liveCount, closeOverlays]);\n\n const handleFocus = (event: React.FocusEvent<HTMLDivElement>) => {\n onFocus?.(event);\n if (event.target instanceof HTMLElement && rootRef.current?.contains(event.target)) lastFocusInRoot.current = event.target;\n };\n\n // A floating Panel sits beside the Rail when the Rail is showing, and\n // beside its card when the Rail is inset.\n const rail = store.entries.get('rail');\n const railShown = rail !== undefined && rail.value !== undefined && rail.value !== 'closed';\n const railOffset = railShown ? (insetPanes.has('rail') ? `calc(${rail.size}px + 2 * var(--shell-inset-gap))` : `${rail.size}px`) : undefined;\n\n // `full` writes no inline height: the stylesheet states it as 100vh with a\n // 100dvh override where supported, and an inline value would beat both.\n const heightStyle: React.CSSProperties = height === 'full' ? {} : height === 'auto' ? { height: 'auto' } : typeof height === 'number' ? { height: `${height}px` } : { height };\n\n return (\n <ShellStoreContext.Provider value={store}>\n <ShellSizeContext.Provider value={size}>\n <ShellContentContext.Provider value={false}>\n <ShellWindowContext.Provider value={windowShell}>\n <ShellHeaderHeightContext.Provider value={setHeaderHeight}>\n <ShellInsetContext.Provider value={insetContext}>\n {/* A Shell inside a portalled surface's Theme starts with no band, like any other. */}\n <PaneBandSizeContext.Provider value={undefined}>\n {/* The Root is not a widget: it hears Escape bubbling up from the panes,\n after their own handlers, to close the overlays. */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div\n {...props}\n ref={composedRef}\n className={classNames('kui-ShellRoot', className)}\n data-height={height === 'auto' && !contained ? 'auto' : undefined}\n data-contained={contained || undefined}\n data-window={windowShell || undefined}\n data-has-inset={insetPanes.size > 0 || undefined}\n data-overlay-live={liveCount > 0 || undefined}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n style={{\n ...heightStyle,\n ...(railOffset ? ({ '--shell-rail-offset': railOffset } as CSSPropertiesWithVars) : {}),\n ...(headerHeight !== undefined ? ({ '--kui-shell-header-h': `${headerHeight}px` } as CSSPropertiesWithVars) : {}),\n ...style,\n }}\n >\n {children}\n {/* Root-owned and always mounted. The stylesheet shows it while an\n overlay is live; containment takes the rest of the frame out of\n the accessibility tree, so the scrim itself is hidden from it. */}\n <div className=\"kui-ShellScrim\" aria-hidden onClick={closeOverlays} />\n </div>\n </PaneBandSizeContext.Provider>\n </ShellInsetContext.Provider>\n </ShellHeaderHeightContext.Provider>\n </ShellWindowContext.Provider>\n </ShellContentContext.Provider>\n </ShellSizeContext.Provider>\n </ShellStoreContext.Provider>\n );\n});\nRoot.displayName = 'Shell.Root';\n\n/* \u2500\u2500 Header \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\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ninterface ShellHeaderProps extends React.ComponentPropsWithoutRef<'header'> {\n height?: number;\n}\n\nconst Header = React.forwardRef<HTMLElement, ShellHeaderProps>(({ className, height = DEFAULT_HEADER_HEIGHT, style, ...props }, ref) => {\n // Rows that stick beneath the header while the page scrolls need its height. The stylesheet\n // assumes the default, so only another height is told to the Root.\n const setHeaderHeight = React.useContext(ShellHeaderHeightContext);\n useLayoutEffect(() => {\n if (!setHeaderHeight) return;\n setHeaderHeight(height === DEFAULT_HEADER_HEIGHT ? undefined : height);\n return () => setHeaderHeight(undefined);\n }, [setHeaderHeight, height]);\n return (\n <header\n {...props}\n ref={ref}\n className={classNames('kui-ShellHeader', className)}\n style={\n {\n ...style,\n '--shell-header-height': `${height}px`,\n } as CSSPropertiesWithVars\n }\n />\n );\n});\nHeader.displayName = 'Shell.Header';\n\n/* \u2500\u2500 Left (deprecated) \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\ninterface LeftProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, meta: { reason: 'init' | 'toggle' | 'panel' | 'responsive' | 'dismiss' }) => void;\n collapsible?: boolean;\n onExpand?: () => void;\n onCollapse?: () => void;\n inset?: boolean;\n}\n\n/**\n * @deprecated The Root no longer wraps the Rail and Panel in a Left\n * container: each is its own pane. `Shell.Left` renders its children and\n * ignores its own props. Removed in 1.0.\n */\nconst Left = React.forwardRef<HTMLDivElement, LeftProps>(({ children }, _ref) => {\n React.useEffect(() => {\n warnOnce('Shell.Left is deprecated and is removed in 1.0. Render Shell.Rail and Shell.Panel directly in Shell.Root.');\n }, []);\n return <>{children}</>;\n});\nLeft.displayName = 'Shell.Left';\n\n/* \u2500\u2500 Rail \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype RailOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'panel' | 'dismiss' };\n\ntype RailControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: RailOpenChangeMeta) => void; defaultOpen?: never };\ntype RailUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: RailOpenChangeMeta) => void; open?: never };\n\ntype RailProps = React.ComponentPropsWithoutRef<'div'> & {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. */\n onCollapse?: () => void;\n /** When true, adds margin and triggers the gray backdrop on the Shell. */\n inset?: boolean;\n} & (RailControlledProps | RailUncontrolledProps);\n\nconst RAIL_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\nconst Rail = React.forwardRef<HTMLDivElement, RailProps>((props, ref) => {\n const { className, presentation, expandedSize = 64, collapsible: _collapsible, onExpand, onCollapse, children, style, open, defaultOpen, onOpenChange, inset, id, ...domProps } = props;\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'rail',\n label: 'Rail',\n propNames: RAIL_PROP_NAMES,\n id,\n controlled: toPaneValue(open),\n defaultValue: toPaneValue(defaultOpen),\n presentationTable: table,\n builtIn: navigationRest,\n onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useInsetRegistration('rail', inset);\n const composedRef = useComposedRefs(ref, pane.setElement);\n\n return (\n <div\n {...domProps}\n role={domProps.role ?? 'navigation'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellRail', className)}\n {...paneAttributes(pane, attributes)}\n data-inset={inset || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={{ ...style, '--rail-size': `${expandedSize}px` } as CSSPropertiesWithVars}\n >\n <RailContent>{children}</RailContent>\n </div>\n );\n});\nRail.displayName = 'Shell.Rail';\n\n/** The Rail's content carries the index, so the thin row styles can size themselves by it. */\nfunction RailContent({ children }: { children: React.ReactNode }) {\n const size = React.useContext(ShellSizeContext);\n return (\n <div className={classNames('kui-ShellRailContent', `kui-r-size-${size}`)}>\n <PaneChromeScope presentation=\"thin\">{children}</PaneChromeScope>\n </div>\n );\n}\n\n/* \u2500\u2500 Panel \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype HandleComponent = React.ForwardRefExoticComponent<React.ComponentPropsWithoutRef<'div'> & React.RefAttributes<HTMLDivElement>>;\n\ntype PanelOpenChangeMeta = { reason: 'toggle' | 'left' | 'init' | 'responsive' | 'dismiss' };\ntype PanelControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: PanelOpenChangeMeta) => void; defaultOpen?: never };\ntype PanelUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: PanelOpenChangeMeta) => void; open?: never };\n\ntype PanelSizeControlledProps = { size: number | string; defaultSize?: never };\ntype PanelSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\n\ntype PanelSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\ntype PanelPublicProps = PaneBaseProps &\n (PanelControlledProps | PanelUncontrolledProps) &\n (PanelSizeControlledProps | PanelSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: PanelSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers the gray backdrop on the Shell. */\n inset?: boolean;\n };\ntype PanelComponent = React.ForwardRefExoticComponent<PanelPublicProps & React.RefAttributes<HTMLDivElement>> & {\n Handle: HandleComponent;\n};\n\nconst PANEL_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\n/**\n * A Panel with a `presentation` of its own uses it. One without follows the\n * Rail rendered before it, which is how 0.7 placed a Panel; the stylesheet\n * reads the Rail's attributes for the first paint and the registry carries\n * the Rail's table for the JS mirror.\n */\nconst Panel = React.forwardRef<HTMLDivElement, PanelPublicProps>((props, ref) => {\n const {\n className,\n presentation,\n defaultOpen,\n open,\n onOpenChange,\n size,\n defaultSize,\n expandedSize = 288,\n minSize = 100,\n maxSize = 800,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\n id,\n ...domProps\n } = props;\n const store = useShellStore('Shell.Panel');\n const rail = usePaneEntry(store, 'rail');\n const own = usePresentationTable(presentation, 'fixed');\n const followsRail = presentation === undefined;\n const presentationTable = followsRail ? (rail?.presentationTable ?? FIXED_TABLE) : own.table;\n const presentationAttributes = followsRail ? { 'data-presentation-follows': '' } : own.attributes;\n\n const pane = usePane({\n name: 'panel',\n label: 'Panel',\n propNames: PANEL_PROP_NAMES,\n id,\n controlled: toPaneValue(open),\n defaultValue: toPaneValue(defaultOpen),\n presentationTable,\n builtIn: detailRest,\n onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useInsetRegistration('panel', inset);\n\n React.useEffect(() => {\n if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {\n warnOnce('Shell.Panel: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');\n }\n }, [snapPoints, collapseThreshold, paneId, persistence]);\n\n const elementRef = React.useRef<HTMLElement | null>(null);\n const composedRef = useComposedRefs(ref, pane.setElement, elementRef);\n\n const resize = useResizablePane({\n name: 'panel',\n elementId: pane.id,\n elementRef,\n cssVarName: '--panel-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 snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n overlaying: pane.overlaying,\n // Asked when the effect runs: the Rail registers its table after this\n // Panel first renders, so the render's answer can be out of date.\n overlayingNow: () => {\n const table = followsRail ? (store.entries.get('rail')?.presentationTable ?? FIXED_TABLE) : own.table;\n return table[readBreakpoint()] === 'overlay';\n },\n requestCollapse: () => pane.setValue('closed', 'toggle'),\n requestToggle: () => pane.toggle('toggle'),\n });\n\n // The starting size is in the server HTML, so the pane does not jump on hydration.\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n const { handles, content } = splitHandles(children, PanelHandle);\n const handle = resizable && pane.shown !== false && !pane.overlaying ? <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider> : null;\n\n return (\n <div\n {...withoutRemovedPaneProps(domProps)}\n role={domProps.role ?? 'navigation'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellPanel', className)}\n {...paneAttributes(pane, presentationAttributes)}\n data-inset={inset || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--panel-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--panel-size': initialSize } : {}),\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellPanelContent\">\n <PaneChromeScope>{content}</PaneChromeScope>\n </div>\n {handle}\n </div>\n );\n}) as PanelComponent;\nPanel.displayName = 'Shell.Panel';\nPanel.Handle = PanelHandle;\n\n/* \u2500\u2500 Content \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\u2500\u2500\u2500\u2500\u2500 */\n\ninterface ShellContentProps extends React.ComponentPropsWithoutRef<'main'> {\n /** When true, adds margin and triggers the gray backdrop on the Shell. */\n inset?: boolean;\n}\n\n/**\n * The work area. It scrolls as it is; with a `Shell.Scroll` child it becomes a column and the\n * Scroll scrolls instead, so a `Shell.PaneHeader float` beside it stays pinned over the page.\n */\nconst Content = React.forwardRef<HTMLElement, ShellContentProps>(({ className, inset, children, ...props }, ref) => {\n useInsetRegistration('content', inset);\n return (\n <main {...props} ref={ref} className={classNames('kui-ShellContent', className)} data-inset={inset || undefined}>\n <ShellContentContext.Provider value={true}>{children}</ShellContentContext.Provider>\n </main>\n );\n});\nContent.displayName = 'Shell.Content';\n\n/* \u2500\u2500 Trigger \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\u2500\u2500\u2500\u2500\u2500 */\n\ntype TriggerAction = 'toggle' | 'expand' | 'collapse';\n\ninterface TriggerProps extends React.ComponentPropsWithoutRef<'button'> {\n target: PaneTarget;\n action?: TriggerAction;\n /**\n * Renders the single child in place of the trigger's own button, with the trigger's click,\n * `aria-controls`, `aria-expanded` and data attributes merged onto it. Use it to make a\n * `Button` the trigger: `<Shell.Trigger asChild><Button iconOnly aria-label=\"Toggle sidebar\">\u2026</Button></Shell.Trigger>`.\n */\n asChild?: boolean;\n /**\n * Whether to show a preview of the target pane on hover while it is closed\n * and not an overlay. Defaults to false.\n *\n * @deprecated Removed in 1.0. A preview reachable only by mouse hover has no\n * keyboard or touch equivalent; open the pane instead.\n */\n peekOnHover?: boolean;\n}\n\n/**\n * A button that drives a pane by name, through the registry. It sets\n * `aria-controls` and `aria-expanded` (left off while an untouched pane\n * cannot know its state yet), renders `type=\"button\"`, and runs the\n * consumer's `onClick` first: calling `preventDefault()` there cancels it. With `asChild` the\n * child is the button, and its own `type` stands.\n */\nconst Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(({ target, action = 'toggle', peekOnHover, asChild = false, onClick, onMouseEnter, onMouseLeave, children, ...props }, ref) => {\n const store = useShellStore('Shell.Trigger');\n React.useEffect(() => {\n if (target === 'left') warnOnce('Shell.Trigger target=\"left\" is deprecated and is removed in 1.0. Use target=\"rail\".');\n if (peekOnHover) warnOnce('Shell.Trigger: `peekOnHover` is deprecated and is removed in 1.0.');\n }, [target, peekOnHover]);\n const name: PaneName = target === 'left' ? 'rail' : target;\n // Subscribes to its own pane only.\n const entry = usePaneEntry(store, name);\n const shown = entry?.value === undefined ? undefined : entry.value !== 'closed';\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n const current = store.entries.get(name);\n if (!current) return;\n if (store.peek === name) setShellPeek(store, null);\n if (action === 'toggle') current.toggle('toggle');\n else if (action === 'expand') current.setValue('open', 'toggle');\n else current.setValue('closed', 'toggle');\n };\n\n const handleMouseEnter = (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseEnter?.(event);\n if (!peekOnHover) return;\n const current = store.entries.get(name);\n if (current && current.value === 'closed' && current.presentation !== 'overlay') setShellPeek(store, name);\n };\n\n const handleMouseLeave = (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseLeave?.(event);\n if (peekOnHover && store.peek === name) setShellPeek(store, null);\n };\n\n const Comp = asChild ? Slot.Root : 'button';\n return (\n <Comp\n // A button's default type is `submit`. Stated before the spread, so a consumer's own wins.\n // An asChild child states its own (Button already says `button`; a link has none), so the\n // key is left off rather than passed as undefined.\n {...(!asChild && { type: 'button' as const })}\n aria-controls={entry?.id}\n aria-expanded={shown}\n {...props}\n ref={ref}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n data-shell-trigger={target}\n data-shell-action={action}\n >\n {children}\n </Comp>\n );\n});\nTrigger.displayName = 'Shell.Trigger';\n\n// Exports\nexport {\n Root,\n Header,\n Left,\n Rail,\n Panel,\n Sidebar,\n Content,\n Inspector,\n Bottom,\n Trigger,\n PaneHeader,\n PaneFooter,\n Scroll,\n useShell,\n useSidebarMode,\n useResponsivePresentation,\n type PaneMode,\n type SidebarMode,\n type ResponsivePresentation,\n type PaneTarget,\n type TriggerAction,\n type ShellRootProps as RootProps,\n type ShellHeaderProps as HeaderProps,\n type RailProps,\n type PanelPublicProps as PanelProps,\n type SidebarPublicProps as SidebarProps,\n type ShellContentProps as ContentProps,\n type InspectorPublicProps as InspectorProps,\n type BottomPublicProps as BottomProps,\n type TriggerProps,\n type PaneHeaderProps,\n type PaneFooterProps,\n type ScrollProps,\n};\n"],
5
- "mappings": ";g4BAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,GAAA,YAAAC,GAAA,WAAAC,GAAA,cAAAC,GAAA,SAAAC,GAAA,eAAAC,GAAA,eAAAC,GAAA,UAAAC,GAAA,SAAAC,GAAA,SAAAC,GAAA,WAAAC,GAAA,YAAAC,GAAA,YAAAC,GAAA,8BAAAC,GAAA,aAAAC,GAAA,mBAAAC,KAsBA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,QAAAC,OAAY,WACrB,OAAS,mBAAAC,GAAiB,mBAAAC,OAAuB,oBA4DjD,IAAIC,GAAkB,EACtB,SAASC,GAAeC,EAAe,CACrCF,GAAkB,KAAK,IAAI,EAAGA,GAAkBE,CAAK,EACrD,IAAMC,EAAM,SAAS,gBACjBH,GAAkB,EAAGG,EAAI,aAAa,sBAAuB,EAAE,EAC9DA,EAAI,gBAAgB,qBAAqB,CAChD,CAGA,IAAMC,GAAa,uBAGbC,GAAgB,GAGtB,SAASC,EA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AM,iBAAkB,OAC5B,IAAM2H,EAAU3J,EAAM,QAAQ,IAAIwJ,CAAI,EACjCG,IACD3J,EAAM,OAASwJ,GAAMI,GAAa5J,EAAO,IAAI,EAC7CkJ,IAAW,SAAUS,EAAQ,OAAO,QAAQ,EACvCT,IAAW,SAAUS,EAAQ,SAAS,OAAQ,QAAQ,EAC1DA,EAAQ,SAAS,SAAU,QAAQ,EAC1C,EAEME,EAAoB7H,GAA+C,CAEvE,GADAsH,IAAetH,CAAK,EAChB,CAACmH,EAAa,OAClB,IAAMQ,EAAU3J,EAAM,QAAQ,IAAIwJ,CAAI,EAClCG,GAAWA,EAAQ,QAAU,UAAYA,EAAQ,eAAiB,WAAWC,GAAa5J,EAAOwJ,CAAI,CAC3G,EAEMM,EAAoB9H,GAA+C,CACvEuH,IAAevH,CAAK,EAChBmH,GAAenJ,EAAM,OAASwJ,GAAMI,GAAa5J,EAAO,IAAI,CAClE,EAEM+J,EAAOX,EAAUY,GAAK,KAAO,SACnC,OACE,gBAACD,EAAA,CAIE,GAAI,CAACX,GAAW,CAAE,KAAM,QAAkB,EAC3C,gBAAepI,GAAO,GACtB,gBAAeyI,EACd,GAAG7J,EACJ,IAAKC,EACL,QAAS6J,EACT,aAAcG,EACd,aAAcC,EACd,qBAAoB9G,EACpB,oBAAmBkG,GAElB7J,CACH,CAEJ,CAAC,EACD4J,GAAQ,YAAc",
6
- "names": ["shell_exports", "__export", "Bottom", "Content", "Header", "Inspector", "Left", "PaneFooter", "PaneHeader", "Panel", "Rail", "Root", "Scroll", "Sidebar", "Trigger", "useResponsivePresentation", "useShell", "useSidebarMode", "React", "classNames", "Slot", "useComposedRefs", "useLayoutEffect", "pageLockHolders", "updatePageLock", "delta", "doc", "INERT_MARK", "RESCUE_FRAMES", "isNowhere", "el", "triggerFor", "id", "within", "pane", "shellSizePropDef", "ShellHeaderHeightContext", "DEFAULT_HEADER_HEIGHT", "frameScroller", "rootEl", "Root", "className", "children", "height", "containedProp", "sizeProp", "style", "onKeyDown", "onFocus", "props", "ref", "size", "useThemeSize", "store", "createShellStore", "subscribe", "listener", "subscribeShellStore", "rootRef", "composedRef", "useComposedRefs", "insetPanes", "setInsetPanes", "registerInset", "prev", "unregisterInset", "next", "insetContext", "closeOverlays", "entry", "livePanes", "liveCount", "contained", "windowShell", "headerHeight", "setHeaderHeight", "win", "pageScrolls", "pageScrollMatches", "offset", "frame", "resizing", "onResize", "fromPage", "fromFrame", "event", "stop", "onPageScrollMediaChange", "matches", "carried", "contain", "liveEls", "child", "holdsLive", "returnFocusTo", "lastLive", "lastFocusInRoot", "holdsLock", "rescueFrame", "cancelRescue", "rescueFocus", "target", "lost", "frames", "tick", "live", "wantsLock", "previous", "closed", "inClosed", "active", "inRoot", "before", "opened", "now", "observer", "handleKeyDown", "onDocumentKeyDown", "handleFocus", "rail", "railOffset", "heightStyle", "ShellStoreContext", "ShellSizeContext", "ShellContentContext", "ShellWindowContext", "ShellInsetContext", "PaneBandSizeContext", "classNames", "Header", "useLayoutEffect", "Left", "_ref", "RAIL_PROP_NAMES", "Rail", "presentation", "expandedSize", "_collapsible", "onExpand", "onCollapse", "open", "defaultOpen", "onOpenChange", "inset", "domProps", "table", "attributes", "usePresentationTable", "usePane", "toPaneValue", "navigationRest", "value", "reason", "useInsetRegistration", "paneAttributes", "RailContent", "PaneChromeScope", "PANEL_PROP_NAMES", "Panel", "defaultSize", "minSize", "maxSize", "resizable", "collapsible", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "useShellStore", "usePaneEntry", "own", "followsRail", "presentationTable", "FIXED_TABLE", "presentationAttributes", "detailRest", "elementRef", "resize", "useResizablePane", "startAnchoredGrowth", "readBreakpoint", "initialSize", "useInitialPaneSize", "handles", "content", "splitHandles", "PanelHandle", "handle", "PaneResizeContext", "PaneHandle", "withoutRemovedPaneProps", "Content", "Trigger", "action", "peekOnHover", "asChild", "onClick", "onMouseEnter", "onMouseLeave", "name", "shown", "handleClick", "current", "setShellPeek", "handleMouseEnter", "handleMouseLeave", "Comp", "Slot"]
7
- }
@@ -1,2 +0,0 @@
1
- "use client";
2
- //# sourceMappingURL=chunk-E4KT72IB.js.map
@@ -1,2 +0,0 @@
1
- import{a as t}from"./chunk-KEWNXANF.js";import{a as o}from"./chunk-SBRPXQWH.js";import{a as s}from"./chunk-SJXV4BWZ.js";import{a as p}from"./chunk-N6KH2EOU.js";import{d as r}from"./chunk-CUNKWFKA.js";import{a as e}from"./chunk-NZJGC6ZW.js";var i=["1","2","3","4","5","6","7","8","9"],n=["auto","always","hover","none"],D={...e,size:{type:"enum",className:"kui-r-size",values:i,responsive:!0},...p,...t,...s,...o,underline:{type:"enum",className:"kui-underline",values:n,default:"auto"},...r};export{D as a};
2
- //# sourceMappingURL=chunk-EFXHBH3A.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/link.props.tsx"],
4
- "sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\nimport { accentColorPropDef } from '../props/color.prop.js';\nimport { leadingTrimPropDef } from '../props/leading-trim.prop.js';\nimport { textWrapPropDef } from '../props/text-wrap.prop.js';\nimport { truncatePropDef } from '../props/truncate.prop.js';\nimport { weightPropDef } from '../props/weight.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\nconst underline = ['auto', 'always', 'hover', 'none'] as const;\n\nconst linkPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n ...weightPropDef,\n ...leadingTrimPropDef,\n ...truncatePropDef,\n ...textWrapPropDef,\n underline: { type: 'enum', className: 'kui-underline', values: underline, default: 'auto' },\n ...accentColorPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n underline: PropDef<(typeof underline)[number]>;\n};\n\nexport { linkPropDefs };\n"],
5
- "mappings": "gPASA,IAAMA,EAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,GAAG,EACpDC,EAAY,CAAC,OAAQ,SAAU,QAAS,MAAM,EAE9CC,EAAe,CACnB,GAAGC,EACH,KAAM,CACJ,KAAM,OACN,UAAW,aACX,OAAQH,EACR,WAAY,EACd,EACA,GAAGI,EACH,GAAGC,EACH,GAAGC,EACH,GAAGC,EACH,UAAW,CAAE,KAAM,OAAQ,UAAW,gBAAiB,OAAQN,EAAW,QAAS,MAAO,EAC1F,GAAGO,CACL",
6
- "names": ["sizes", "underline", "linkPropDefs", "asChildPropDef", "weightPropDef", "leadingTrimPropDef", "truncatePropDef", "textWrapPropDef", "accentColorPropDef"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as v,e as p}from"./chunk-3QWGSRYC.js";import{a as R,b as y,c as x}from"./chunk-LTUW36HM.js";import{a as O,b as M,c as T}from"./chunk-QKCNGEX4.js";import{a as C}from"./chunk-WEBNIUEX.js";import{a as d,c as w,f as E,g as H}from"./chunk-XUCR7L4G.js";import{a as B}from"./chunk-G66WDIIV.js";import{o as S}from"./chunk-GHWEXMF6.js";import*as e from"react";import le from"classnames";import{useComposedRefs as re}from"radix-ui/internal";var pe={controlled:"open",default:"defaultOpen"},N=e.forwardRef((I,U)=>{let{className:k,presentation:V="fixed",defaultOpen:A,open:L,onOpenChange:$,expandedSize:t=200,minSize:n=100,maxSize:a=400,resizable:m=!1,collapsible:q=!0,onExpand:D,onCollapse:W,onResize:_,onResizeStart:j,onResizeEnd:F,snapPoints:s,snapTolerance:G,collapseThreshold:i,paneId:l,persistence:r,children:K,style:J,size:c,defaultSize:u,onSizeChange:Q,sizeUpdate:X,sizeUpdateMs:Y=50,inset:f,id:Z,...z}=I,{table:P,attributes:ee}=x(V,"fixed"),o=R({name:"bottom",label:"Bottom",propNames:pe,id:Z,controlled:d(L),defaultValue:d(A),presentationTable:P,builtIn:w,onChange:(se,ie)=>$?.(se!=="closed",{reason:ie}),onExpand:D,onCollapse:W,size:t});S("bottom",f),e.useEffect(()=>{(s!==void 0||i!==void 0||l!==void 0||r!==void 0)&&void 0},[s,i,l,r]);let b=e.useRef(null),oe=re(U,o.setElement,b),te=M({name:"bottom",elementId:o.id,elementRef:b,cssVarName:"--bottom-size",orientation:"horizontal",edge:"start",growth:E,expandedSize:t,minSize:n,maxSize:a,resizable:m,collapsible:q,size:c,defaultSize:u,onSizeChange:Q,sizeUpdate:X,sizeUpdateMs:Y,onResize:_,onResizeStart:j,onResizeEnd:F,snapPoints:s,snapTolerance:G,collapseThreshold:i,paneId:l,persistence:r,overlaying:o.overlaying,overlayingNow:()=>P[B()]==="overlay",requestCollapse:()=>o.setValue("closed","toggle"),requestToggle:()=>o.toggle("toggle")}),h=O(c,u,n,a),{handles:g,content:ne}=T(K,p),ae=m&&o.shown!==!1&&!o.overlaying?e.createElement(C.Provider,{value:te},g.length>0?g:e.createElement(v,null)):null;return e.createElement("div",{...H(z),id:o.id,ref:oe,className:le("kui-ShellPane","kui-ShellBottom",k),...y(o,ee),"data-inset":f||void 0,tabIndex:o.overlaying?-1:z.tabIndex,style:{...J,"--bottom-expanded-size":`${t}px`,...h?{"--bottom-size":h}:{},"--bottom-min-size":`${n}px`,"--bottom-max-size":`${a}px`}},e.createElement("div",{className:"kui-ShellBottomContent"},ne),ae)});N.displayName="Shell.Bottom";N.Handle=p;export{N as a};
3
- //# sourceMappingURL=chunk-QRV32INS.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/_internal/shell-bottom.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 { BottomHandle, PaneHandle } from './shell-handles.js';\nimport { usePane, paneAttributes, usePresentationTable } from './shell-pane.js';\nimport { splitHandles, useInitialPaneSize, useResizablePane, type SizeChangeMeta } from './shell-resizable.js';\nimport { useInsetRegistration, warnOnce } from './shell-store.js';\nimport { bottomAnchoredGrowth, detailRest, toPaneValue, withoutRemovedPaneProps } from './shell-rest.js';\nimport { readBreakpoint } from '../../hooks/use-breakpoint.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps } from '../shell.types.js';\n\ntype BottomOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'dismiss' };\ntype BottomControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; defaultOpen?: never };\n/** Since 0.8.0 `defaultOpen` takes a responsive object here too, as the docs already said it did. */\ntype BottomUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; open?: never };\ntype BottomSizeControlledProps = { size: number | string; defaultSize?: never };\ntype BottomSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype BottomPublicProps = PaneBaseProps &\n (BottomControlledProps | BottomUncontrolledProps) &\n (BottomSizeControlledProps | BottomSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: SizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers the gray backdrop on the Shell. */\n inset?: boolean;\n };\n\ntype BottomComponent = React.ForwardRefExoticComponent<BottomPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof BottomHandle };\n\nconst BOTTOM_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\nexport const Bottom = React.forwardRef<HTMLDivElement, BottomPublicProps>((props, ref) => {\n const {\n className,\n presentation = 'fixed',\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 200,\n minSize = 100,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\n id,\n ...domProps\n } = props;\n\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'bottom',\n label: 'Bottom',\n propNames: BOTTOM_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 onExpand,\n onCollapse,\n size: expandedSize,\n });\n useInsetRegistration('bottom', inset);\n\n React.useEffect(() => {\n if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {\n warnOnce('Shell.Bottom: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');\n }\n }, [snapPoints, collapseThreshold, paneId, persistence]);\n\n const elementRef = React.useRef<HTMLElement | null>(null);\n const composedRef = useComposedRefs(ref, pane.setElement, elementRef);\n\n const resize = useResizablePane({\n name: 'bottom',\n elementId: pane.id,\n elementRef,\n cssVarName: '--bottom-size',\n orientation: 'horizontal',\n edge: 'start',\n growth: bottomAnchoredGrowth,\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 snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n overlaying: pane.overlaying,\n overlayingNow: () => table[readBreakpoint()] === 'overlay',\n requestCollapse: () => pane.setValue('closed', 'toggle'),\n requestToggle: () => pane.toggle('toggle'),\n });\n\n // The starting size is in the server HTML, so the pane does not jump on hydration.\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n const { handles, content } = splitHandles(children, BottomHandle);\n const handle = resizable && pane.shown !== false && !pane.overlaying ? <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider> : null;\n\n return (\n <div\n {...withoutRemovedPaneProps(domProps)}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellBottom', className)}\n {...paneAttributes(pane, attributes)}\n data-inset={inset || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--bottom-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--bottom-size': initialSize } : {}),\n '--bottom-min-size': `${minSize}px`,\n '--bottom-max-size': `${maxSize}px`,\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellBottomContent\">{content}</div>\n {handle}\n </div>\n );\n}) as BottomComponent;\n\nBottom.displayName = 'Shell.Bottom';\nBottom.Handle = BottomHandle;\n\nexport type { BottomPublicProps };\n"],
5
- "mappings": ";gVAEA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,OAAS,mBAAAC,OAAuB,oBA4BhC,IAAMC,GAAoB,CAAE,WAAY,OAAQ,QAAS,aAAc,EAE1DC,EAAe,aAA8C,CAACC,EAAOC,IAAQ,CACxF,GAAM,CACJ,UAAAC,EACA,aAAAC,EAAe,QACf,YAAAC,EACA,KAAAC,EACA,aAAAC,EACA,aAAAC,EAAe,IACf,QAAAC,EAAU,IACV,QAAAC,EAAU,IACV,UAAAC,EAAY,GACZ,YAAAC,EAAc,GACd,SAAAC,EACA,WAAAC,EACA,SAAAC,EACA,cAAAC,EACA,YAAAC,EACA,WAAAC,EACA,cAAAC,EACA,kBAAAC,EACA,OAAAC,EACA,YAAAC,EACA,SAAAC,EACA,MAAAC,EACA,KAAAC,EACA,YAAAC,EACA,aAAAC,EACA,WAAAC,EACA,aAAAC,EAAe,GACf,MAAAC,EACA,GAAAC,EACA,GAAGC,CACL,EAAI/B,EAEE,CAAE,MAAAgC,EAAO,WAAAC,EAAW,EAAIC,EAAqB/B,EAAc,OAAO,EAClEgC,EAAOC,EAAQ,CACnB,KAAM,SACN,MA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AAIA,EAAU,gBAACM,EAAA,IAAW,CAAG,EAAgC,KAEjM,OACE,gBAAC,OACE,GAAGC,EAAwB3B,CAAQ,EACpC,GAAII,EAAK,GACT,IAAKQ,GACL,UAAWgB,GAAW,gBAAiB,kBAAmBzD,CAAS,EAClE,GAAG0D,EAAezB,EAAMF,EAAU,EACnC,aAAYJ,GAAS,OACrB,SAAUM,EAAK,WAAa,GAAKJ,EAAS,SAC1C,MACE,CACE,GAAGR,EACH,yBAA0B,GAAGhB,CAAY,KACzC,GAAI0C,EAAc,CAAE,gBAAiBA,CAAY,EAAI,CAAC,EACtD,oBAAqB,GAAGzC,CAAO,KAC/B,oBAAqB,GAAGC,CAAO,IACjC,GAGF,gBAAC,OAAI,UAAU,0BAA0B2C,EAAQ,EAChDG,EACH,CAEJ,CAAC,EAEDxD,EAAO,YAAc,eACrBA,EAAO,OAASuD",
6
- "names": ["React", "classNames", "useComposedRefs", "BOTTOM_PROP_NAMES", "Bottom", "props", "ref", "className", "presentation", "defaultOpen", "open", "onOpenChange", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "inset", "id", "domProps", "table", "attributes", "usePresentationTable", "pane", "usePane", "toPaneValue", "detailRest", "value", "reason", "useInsetRegistration", "elementRef", "composedRef", "useComposedRefs", "resize", "useResizablePane", "bottomAnchoredGrowth", "readBreakpoint", "initialSize", "useInitialPaneSize", "handles", "content", "splitHandles", "BottomHandle", "handle", "PaneResizeContext", "PaneHandle", "withoutRemovedPaneProps", "classNames", "paneAttributes"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as T,c as b}from"./chunk-3QWGSRYC.js";import{a as V,b as k,c as I}from"./chunk-LTUW36HM.js";import{a as N,b as w,c as B}from"./chunk-QKCNGEX4.js";import{a as E}from"./chunk-WEBNIUEX.js";import{b as A,d as H,g as U}from"./chunk-XUCR7L4G.js";import{a as y}from"./chunk-G66WDIIV.js";import{f as x}from"./chunk-YMRN5ESN.js";import{o as M}from"./chunk-GHWEXMF6.js";import*as e from"react";import pe from"classnames";import{useComposedRefs as ue}from"radix-ui/internal";var D=t=>t==="collapsed"?"closed":"open",Se=t=>t==="closed"?"collapsed":"expanded";function L(t){if(t===void 0)return;if(typeof t=="string")return D(t);let n={};for(let[r,i]of Object.entries(t))i!==void 0&&(n[r]=D(i));return n}var ce={controlled:"state",default:"defaultState"},be={initial:"overlay",sm:"fixed"},O=e.forwardRef((t,n)=>{let{className:r,presentation:i=be,expandedSize:o=288,minSize:s=200,maxSize:d=400,resizable:m=!1,collapsible:_=!0,onExpand:$,onCollapse:W,onResize:j,onResizeStart:q,onResizeEnd:F,snapPoints:l,snapTolerance:G,collapseThreshold:p,paneId:u,persistence:S,children:K,style:J,state:Q,defaultState:X,onStateChange:Y,size:f,defaultSize:P,onSizeChange:Z,sizeUpdate:ee,sizeUpdateMs:ae=50,inset:h,id:te,...c}=t,{table:g,attributes:ne}=I(i,"fixed"),a=V({name:"sidebar",label:"Sidebar",propNames:ce,id:te,controlled:L(Q),defaultValue:L(X),presentationTable:g,builtIn:A,onChange:(de,le)=>Y?.(Se(de),{reason:le}),onExpand:$,onCollapse:W,size:o});M("sidebar",h),e.useEffect(()=>{(l!==void 0||p!==void 0||u!==void 0||S!==void 0)&&void 0},[l,p,u,S]);let z=e.useRef(null),ie=ue(n,a.setElement,z),oe=w({name:"sidebar",elementId:a.id,elementRef:z,cssVarName:"--sidebar-size",orientation:"vertical",edge:"end",growth:H,expandedSize:o,minSize:s,maxSize:d,resizable:m,collapsible:_,size:f,defaultSize:P,onSizeChange:Z,sizeUpdate:ee,sizeUpdateMs:ae,onResize:j,onResizeStart:q,onResizeEnd:F,snapPoints:l,snapTolerance:G,collapseThreshold:p,paneId:u,persistence:S,overlaying:a.overlaying,overlayingNow:()=>g[y()]==="overlay",requestCollapse:()=>a.setValue("closed","toggle"),requestToggle:()=>a.toggle("toggle")}),{handles:v,content:re}=B(K,b),se=m&&a.value!=="closed"&&!a.overlaying?e.createElement(E.Provider,{value:oe},v.length>0?v:e.createElement(T,null)):null,R=a.peeking?`var(--sidebar-size, ${o}px)`:void 0,C=N(f,P,s,d);return e.createElement("div",{...U(c),role:c.role??"navigation",id:a.id,ref:ie,className:pe("kui-ShellPane","kui-ShellSidebar",r),...k(a,ne),"data-inset":h||void 0,tabIndex:a.overlaying?-1:c.tabIndex,style:{...J,"--sidebar-expanded-size":`${o}px`,...C?{"--sidebar-size":C}:{},"--sidebar-min-size":`${s}px`,"--sidebar-max-size":`${d}px`,...R?{"--peek-sidebar-width":R}:{}}},e.createElement("div",{className:"kui-ShellSidebarContent"},e.createElement(x,null,re)),se)});O.displayName="Shell.Sidebar";O.Handle=b;export{O as a};
3
- //# sourceMappingURL=chunk-VGJALIJ5.js.map
@@ -1,7 +0,0 @@
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 { useInsetRegistration, warnOnce, type PaneValue } from './shell-store.js';\nimport { navigationRest, startAnchoredGrowth, withoutRemovedPaneProps } from './shell-rest.js';\nimport { readBreakpoint } from '../../hooks/use-breakpoint.js';\nimport { PaneChromeScope } from './pane-chrome.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, Responsive, SidebarMode } from '../shell.types.js';\n\ntype SidebarStateChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'dismiss' };\ntype SidebarControlledProps = { state: Responsive<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 /** When true, adds margin and triggers the gray backdrop on the Shell. */\n inset?: 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: 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 onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n state,\n defaultState,\n onStateChange,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\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 onExpand,\n onCollapse,\n size: expandedSize,\n });\n useInsetRegistration('sidebar', inset);\n\n React.useEffect(() => {\n if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {\n warnOnce('Shell.Sidebar: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');\n }\n }, [snapPoints, collapseThreshold, paneId, persistence]);\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 snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n overlaying: pane.overlaying,\n overlayingNow: () => table[readBreakpoint()] === 'overlay',\n requestCollapse: () => pane.setValue('closed', 'toggle'),\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 // A peek previews the width the next toggle opens to.\n const peekWidth = pane.peeking ? `var(--sidebar-size, ${expandedSize}px)` : undefined;\n\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n return (\n <div\n {...withoutRemovedPaneProps(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-inset={inset || 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 ...(peekWidth ? { '--peek-sidebar-width': peekWidth } : {}),\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellSidebarContent\">\n <PaneChromeScope>{content}</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": ";iXAEA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,OAAS,mBAAAC,OAAuB,oBA0BhC,IAAMC,EAAWC,GAAkCA,IAAS,YAAc,SAAW,OAC/EC,GAAUC,GAAmCA,IAAU,SAAW,YAAc,WAEtF,SAASC,EAAYC,EAA4G,CAC/H,GAAIA,IAAU,OAAW,OACzB,GAAI,OAAOA,GAAU,SAAU,OAAOL,EAAQK,CAAK,EACnD,IAAMC,EAA8C,CAAC,EACrD,OAAW,CAACC,EAAIN,CAAI,IAAK,OAAO,QAAQI,CAAK,EACvCJ,IAAS,SAAWK,EAAIC,CAAE,EAAIP,EAAQC,CAAI,GAEhD,OAAOK,CACT,CAEA,IAAME,GAAqB,CAA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,CAC3D,GAGF,gBAAC,OAAI,UAAU,2BACb,gBAACM,EAAA,KAAiBZ,EAAQ,CAC5B,EACCG,EACH,CAEJ,CAAC,EAEDnD,EAAQ,YAAc,gBACtBA,EAAQ,OAASkD",
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", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "defaultState", "onStateChange", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "inset", "id", "domProps", "table", "attributes", "usePresentationTable", "pane", "usePane", "navigationRest", "reason", "useInsetRegistration", "elementRef", "composedRef", "useComposedRefs", "resize", "useResizablePane", "startAnchoredGrowth", "readBreakpoint", "handles", "content", "splitHandles", "SidebarHandle", "handle", "PaneResizeContext", "PaneHandle", "peekWidth", "initialSize", "useInitialPaneSize", "withoutRemovedPaneProps", "classNames", "paneAttributes", "PaneChromeScope"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as X,b as oo,c as eo,e as W,f as to,i as ro,l as no}from"./chunk-67UEMB4K.js";import{a as B}from"./chunk-KJZSXLIX.js";import{a as Q}from"./chunk-4MNRLB57.js";import{a as q}from"./chunk-7N2Q5WOM.js";import{h as J}from"./chunk-YMRN5ESN.js";import{c as U}from"./chunk-OKQAVYW4.js";import{b as L}from"./chunk-5ON3XLRD.js";import*as o from"react";import{useLayoutEffect as D}from"radix-ui/internal";import x from"classnames";import{Toolbar as N}from"radix-ui";var bo=["1","2","3","4"],To=["horizontal","vertical"],g={size:{type:"enum",className:"kui-r-size",values:bo,default:"2"},orientation:{type:"enum",values:To,default:"horizontal"}};var E=o.createContext(null),F=o.createContext(null),M=o.createContext(!1);function Io(){return o.useContext(M)}var H=o.forwardRef((e,t)=>{let r=J(),a=L(e.size??r??void 0,g.size),s=e.orientation??g.orientation.default,{className:i,orientation:n,backdrop:l=!1,children:u,...d}=U({...e,size:a},g,q),p=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:x("kui-Toolbar",i)},o.createElement(E.Provider,{value:p},u))});H.displayName="Toolbar";var so=o.forwardRef(({className:e,disabled:t=!1,children:r,...a},s)=>{let i=o.useContext(E),n=o.useContext(M),l=o.useMemo(()=>({disabled:t}),[t]);return n?o.createElement(to,{...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:x("kui-ToolbarGroup",e)},o.createElement(F.Provider,{value:l},r))});so.displayName="Toolbar.Group";var mo=new Set(["id","className","style","title"]);function ao(e){return e===!0||e==="true"}function Po(e){return o.isValidElement(e)&&e.type==="button"}var A=o.forwardRef((e,t)=>{let r=o.useContext(E),a=o.useContext(F),s=o.useContext(M),{iconOnly:i,size:n,variant:l,emphasis:u,color:d,disabled:p,asChild:v,onKeyDown:y,...w}=e,h=p||a?.disabled||void 0;if(s){let T={};for(let m of Object.keys(w))(/^on[A-Z]/.test(m)||m.startsWith("aria-")||m.startsWith("data-")||mo.has(m))&&(T[m]=w[m]);return y&&(T.onKeyDown=y),o.createElement(io,{...T,ref:t,asChild:v,iconOnly:i,disabled:h,color:d,pressed:e["aria-pressed"]===void 0?void 0:ao(e["aria-pressed"])},w.children)}let O=r?.orientation==="vertical"&&y?T=>{T.key==="ArrowDown"||T.key==="ArrowUp"||y(T)}:y,I=ao(e["aria-pressed"]),c="data-state"in e||e["aria-pressed"]===void 0?{}:{"data-state":I?"on":"off"},f={size:n??r?.size,...u!==void 0?{emphasis:u}:{variant:l??(a?"ghost":r?.backdrop?"raised":"soft")},color:d??(l||u?void 0:"gray"),...c},b={...w,...i?{iconOnly:!0}:{},...v?{asChild:!0}:{},...O?{onKeyDown:O}:{},...f};return r?v&&!Po(w.children)?o.createElement(N.Link,{asChild:!0,ref:t},o.createElement(B,{...b,disabled:h})):o.createElement(N.Button,{asChild:!0,ref:t,disabled:h},o.createElement(B,{...b})):o.createElement(B,{...b,ref:t,disabled:h})});A.displayName="Toolbar.Button";var io=o.forwardRef(({asChild:e,iconOnly:t,disabled:r,color:a,pressed:s,children:i,"aria-label":n,...l},u)=>{let d=t?n:void 0,p={...l,...t?{}:n?{"aria-label":n}:{},disabled:r,...a?{color:a}:{}};if(e&&o.isValidElement(i)){let v=d?o.cloneElement(i,void 0,i.props.children,o.createElement("span",null,d)):i;return o.createElement(W,{...p,ref:u,asChild:!0},v)}return s!==void 0?o.createElement(ro,{...p,ref:u,checked:s},i,d):o.createElement(W,{...p,ref:u},i,d)});io.displayName="Toolbar.OverflowItem";function Ro(){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 lo=o.forwardRef(({label:e="More",className:t,children:r,...a},s)=>{let i=o.Children.toArray(r),n=i.length,l=o.useRef(null),u=o.useRef([]),d=o.useRef(0),[p,v]=o.useState(n),[y,w]=o.useState(0),[h,O]=o.useState(n);h!==n&&(O(n),v(n)),D(()=>{u.current=[]},[n]),D(()=>{let c=l.current;if(!c)return;let f=Array.from(c.children),b=Math.min(p,n);for(let P=0;P<b;P++){let R=f[P];R&&(u.current[P]=R.offsetWidth)}let T=f[b];T&&(d.current=T.offsetWidth);let m=Number.parseFloat(getComputedStyle(c).columnGap)||0,K=c.clientWidth,V=0,_=0;for(let P=0;P<n;P++){let R=u.current[P];if(R===void 0)return;R!==0&&(V+=R+(_>0?m:0),_+=1)}let k=n;if(V>K){let P=K-(d.current||c.clientHeight)-m,R=0,Y=0;k=0;for(let G=0;G<n;G++){let Z=u.current[G];if(Z>0){let $=Z+(Y>0?m:0);if(R+$>P)break;R+=$,Y+=1}k+=1}}k!==p&&v(k)},[p,n,y]),o.useEffect(()=>{let c=l.current;if(!c||typeof ResizeObserver>"u")return;let f=new ResizeObserver(()=>w(b=>b+1));f.observe(c);for(let b of Array.from(c.children))f.observe(b);return()=>f.disconnect()},[p,n]);let I=o.useCallback(c=>{l.current=c,typeof s=="function"?s(c):s&&(s.current=c)},[s]);return o.createElement("div",{...a,ref:I,className:x("kui-ToolbarOverflow",t)},i.slice(0,p).map((c,f)=>o.createElement("div",{key:f,className:"kui-ToolbarOverflowSeat"},c)),p<n?o.createElement(X,null,o.createElement(oo,null,o.createElement(A,{iconOnly:!0,"aria-label":e},o.createElement(Ro,null))),o.createElement(eo,{align:"end"},o.createElement(M.Provider,{value:!0},i.slice(p)))):null)});lo.displayName="Toolbar.Overflow";var j=[],S=new Map,z=new Set,C=new Map;function vo(e){return z.add(e),()=>{z.delete(e)}}function yo(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 wo(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 co({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(vo,()=>S.get(e)??j,()=>j);return o.createElement(o.Fragment,null,t.map(r=>o.createElement(o.Fragment,{key:r.id},r.node)))}co.displayName="Toolbar.Slot";function po({name:e="default",children:t}){let r=o.useId();return D(()=>{yo(e,r,t)},[e,r,t]),D(()=>()=>wo(e,r),[e,r]),null}po.displayName="Toolbar.Fill";var uo=o.forwardRef(({className:e,...t},r)=>{let a=o.useContext(E);return o.useContext(M)?o.createElement(no,{...t,ref:r,className:e}):a?o.createElement(N.Separator,{...t,ref:r,className:x("kui-ToolbarSeparator",e)}):o.createElement("div",{role:"separator","aria-orientation":"vertical","data-orientation":"vertical",...t,ref:r,className:x("kui-ToolbarSeparator",e)})});uo.displayName="Toolbar.Separator";var ho={1:"2",2:"3",3:"4",4:"5"},fo=o.forwardRef(({className:e,children:t,style:r,id:a},s)=>{let i=o.useContext(E),n=L(void 0,g.size),l=i?.size??n;return t==null||t===!1?null:o.createElement(Q,{ref:s,as:"span",size:ho[l],weight:"medium",truncate:!0,id:a,style:r,className:x("kui-ToolbarTitle",e)},t)});fo.displayName="Toolbar.Title";var Go=Object.assign(H,{Root:H,Group:so,Button:A,Separator:uo,Title:fo,Overflow:lo,Slot:co,Fill:po});export{Io as a,H as b,so as c,A as d,lo as e,co as f,po as g,uo as h,fo as i,Go as j};
3
- //# sourceMappingURL=chunk-WAE4MLBN.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/toolbar.tsx", "../../src/components/toolbar.props.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport classNames from 'classnames';\nimport { Toolbar as ToolbarPrimitive } from 'radix-ui';\n\nimport { toolbarRootPropDefs } from './toolbar.props.js';\nimport { Button } from './button.js';\nimport * as DropdownMenu from './dropdown-menu.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSize } from '../hooks/theme-size.js';\nimport { layoutPropDefs } from '../props/layout.props.js';\nimport { usePaneBandSize } from './_internal/pane-chrome.js';\n\nimport type { ButtonProps } from './button.js';\nimport type { LayoutProps } from '../props/layout.props.js';\nimport type { TextProps } from './text.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ButtonRankProps } from './button.js';\n\n/*\n * Toolbar takes Kookie UI v2's contract (v2: components/toolbar), built on Radix instead of\n * Base UI. A toolbar is a row of controls with ONE tab stop: `role=\"toolbar\"`, and the arrow\n * keys move focus between its controls. That keyboard is the reason it is a component.\n *\n * Its `size` reaches every control inside it that does not state its own. The row itself paints\n * nothing; a `ToolbarGroup` draws a quiet well around controls that belong together, and a\n * `ToolbarSeparator` draws a gray hairline between clusters. Use a `Flex` to cluster controls\n * without a well: the row spaces the clusters with `space-between`.\n */\n\ntype ToolbarSize = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['size']>;\ntype ToolbarOrientation = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['orientation']>;\n\ninterface ToolbarContextValue {\n size: ToolbarSize;\n orientation: ToolbarOrientation;\n backdrop: boolean;\n}\n\nconst ToolbarContext = React.createContext<ToolbarContextValue | null>(null);\n\n/** Set by a `ToolbarGroup`: its children rest quiet, and `disabled` turns them all off. */\nconst ToolbarGroupContext = React.createContext<{ disabled: boolean } | null>(null);\n\n/**\n * True while a subtree is drawn into a `ToolbarOverflow`'s menu instead of into the row (v2\n * `InOverflow`). The parts answer it themselves: a `ToolbarButton` renders a menu item, a\n * `ToolbarGroup` a menu group, a `ToolbarSeparator` a menu separator.\n */\nconst InOverflowContext = React.createContext(false);\n\n/**\n * True while this subtree is drawn into a `ToolbarOverflow`'s \"More\" menu instead of the row.\n *\n * The toolbar's own parts handle this already. Use it in your own component inside a\n * `ToolbarOverflow` to render a different form in the menu.\n */\nfunction useToolbarOverflow(): boolean {\n return React.useContext(InOverflowContext);\n}\n\n// ============================================================================\n// Toolbar (root)\n// ============================================================================\n\ntype ToolbarOwnProps = GetPropDefTypes<typeof toolbarRootPropDefs>;\n\ninterface ToolbarProps\n extends ComponentPropsWithout<typeof ToolbarPrimitive.Root, RemovedProps | 'orientation'>,\n ToolbarOwnProps,\n LayoutProps {\n /**\n * Gives every control a surface of its own, for a row that content passes behind, such as\n * `Shell.PaneHeader float`. Buttons rest `raised` instead of `soft`, and a group's well is\n * solid and raised.\n */\n backdrop?: boolean;\n}\n\n/**\n * A row of controls with one keyboard tab stop. The arrow keys move focus between the controls.\n *\n * Give it an `aria-label` (or `aria-labelledby`) that says what the controls act on.\n *\n * @example\n * ```tsx\n * <Toolbar aria-label=\"Formatting\">\n * <ToolbarGroup>\n * <ToolbarButton iconOnly aria-label=\"Bold\" aria-pressed={bold} onClick={toggleBold}>\n * <HugeiconsIcon icon={TextBoldIcon} strokeWidth={1.75} />\n * </ToolbarButton>\n * </ToolbarGroup>\n * <ToolbarSeparator />\n * <ToolbarButton>Share</ToolbarButton>\n * </Toolbar>\n * ```\n */\nconst ToolbarRoot = React.forwardRef<HTMLDivElement, ToolbarProps>((props, forwardedRef) => {\n // Inside a Shell (a pane's header or footer, or the content area), a toolbar with no size\n // rests one step above the Shell's. A pane's scrolling list has no band.\n const band = usePaneBandSize();\n // Elsewhere it takes the nearest Theme's size.\n const size: ToolbarSize = useThemeSize(props.size ?? band ?? undefined, toolbarRootPropDefs.size);\n const orientation: ToolbarOrientation = props.orientation ?? toolbarRootPropDefs.orientation.default;\n const { className, orientation: _orientation, backdrop = false, children, ...rootProps } = extractProps(\n { ...props, size },\n toolbarRootPropDefs,\n layoutPropDefs,\n );\n\n const context = React.useMemo(() => ({ size, orientation, backdrop }), [size, orientation, backdrop]);\n\n return (\n <ToolbarPrimitive.Root\n {...rootProps}\n ref={forwardedRef}\n orientation={orientation}\n data-backdrop={backdrop || undefined}\n className={classNames('kui-Toolbar', className)}\n >\n <ToolbarContext.Provider value={context}>{children}</ToolbarContext.Provider>\n </ToolbarPrimitive.Root>\n );\n});\nToolbarRoot.displayName = 'Toolbar';\n\n// ============================================================================\n// ToolbarGroup\n// ============================================================================\n\ninterface ToolbarGroupProps extends ComponentPropsWithout<'div', RemovedProps> {\n /** Turns every control in the group off at once. */\n disabled?: boolean;\n}\n\n/**\n * Controls that belong together, drawn as one quiet well that stands level with a button\n * beside it. Buttons inside it rest as `ghost` unless they state a `variant`.\n * To cluster controls without a well, use a `Flex`.\n *\n * In a `ToolbarOverflow`'s menu it is a menu group. Outside a `Toolbar` (rendered through a\n * portal, for example) it still draws its well, as a horizontal group.\n */\nconst ToolbarGroup = React.forwardRef<HTMLDivElement, ToolbarGroupProps>(\n ({ className, disabled = false, children, ...props }, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const overflow = React.useContext(InOverflowContext);\n const group = React.useMemo(() => ({ disabled }), [disabled]);\n\n if (overflow) {\n return (\n <DropdownMenu.Group {...props} ref={forwardedRef} className={className}>\n <ToolbarGroupContext.Provider value={group}>{children}</ToolbarGroupContext.Provider>\n </DropdownMenu.Group>\n );\n }\n\n return (\n <div\n role=\"group\"\n data-orientation={toolbar?.orientation ?? 'horizontal'}\n data-disabled={disabled || undefined}\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarGroup', className)}\n >\n <ToolbarGroupContext.Provider value={group}>{children}</ToolbarGroupContext.Provider>\n </div>\n );\n },\n);\nToolbarGroup.displayName = 'Toolbar.Group';\n\n// ============================================================================\n// ToolbarButton\n// ============================================================================\n\ntype ToolbarButtonBaseProps = Omit<ButtonProps, 'as' | 'variant' | 'emphasis'>;\n\n/** A labelled button: takes every `Button` prop. */\ntype ToolbarTextButtonProps = ToolbarButtonBaseProps &\n ButtonRankProps & {\n iconOnly?: false;\n};\n\n/** An icon-only button: renders `Button iconOnly`, and the type requires an `aria-label`. */\ntype ToolbarIconButtonProps = Omit<ToolbarButtonBaseProps, 'aria-label' | 'aria-labelledby' | 'fullWidth'> &\n ButtonRankProps & {\n iconOnly: true;\n /** The control's accessible name. An icon has no words of its own, so this is required. */\n 'aria-label': string;\n};\n\ntype ToolbarButtonProps = ToolbarTextButtonProps | ToolbarIconButtonProps;\n\n/** The plain DOM props, besides handlers, ARIA and data attributes, a menu row takes from a ToolbarButton. */\nconst OVERFLOW_ITEM_KEYS = new Set(['id', 'className', 'style', 'title']);\n\nfunction isPressed(value: React.AriaAttributes['aria-pressed']) {\n return value === true || value === 'true';\n}\n\n/** Does an `asChild` child render a native `<button>`? Only then is it a Radix Toolbar.Button. */\nfunction isButtonElement(children: React.ReactNode) {\n return React.isValidElement(children) && children.type === 'button';\n}\n\n/**\n * A `Button` that joins the toolbar's keyboard navigation, so a row of them is one tab stop.\n *\n * Set `iconOnly` (with an `aria-label`) for a symbol-only control. Set `aria-pressed` for a\n * control that toggles; a pressed button wears Button's pressed look. Set `asChild` to render\n * your own element, such as a link: `<ToolbarButton asChild><a href=\"/docs\">Docs</a></ToolbarButton>`.\n * A link stays in the arrow-key row and gets no `type` attribute.\n *\n * It takes the toolbar's `size`, and rests as a gray `soft` button (`raised` in a toolbar with\n * `backdrop`, gray `ghost` inside a `ToolbarGroup`). A stated `size`, `variant` or `color` wins; a\n * stated `variant` without a `color` takes Button's own default colour.\n *\n * In a `ToolbarOverflow`'s menu it renders a menu item; an icon-only button uses its\n * `aria-label` as the item's text. Outside a `Toolbar` (rendered through a React portal, for\n * example) it renders a plain Button with the same rest look, as its own tab stop. Use\n * `ToolbarSlot` and `ToolbarFill` for a control that should join the row's arrow keys.\n */\nconst ToolbarButton = React.forwardRef<HTMLButtonElement, ToolbarButtonProps>((props, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const group = React.useContext(ToolbarGroupContext);\n const overflow = React.useContext(InOverflowContext);\n const { iconOnly, size, variant, emphasis, color, disabled, asChild, onKeyDown, ...rest } = props;\n const off = disabled || group?.disabled || undefined;\n\n if (overflow) {\n // Only what a menu row means comes across: handlers, ARIA, data attributes, id, class and\n // style. Button's box props (size, loading, tooltip, fullWidth and the rest) would land on the\n // DOM as unknown attributes. A wrapping menu trigger hands its open handlers (onPointerDown,\n // onKeyDown), aria-expanded/haspopup/controls and data-state in through these, so it still\n // opens from the row.\n const passed: Record<string, unknown> = {};\n for (const key of Object.keys(rest)) {\n if (/^on[A-Z]/.test(key) || key.startsWith('aria-') || key.startsWith('data-') || OVERFLOW_ITEM_KEYS.has(key)) {\n passed[key] = (rest as Record<string, unknown>)[key];\n }\n }\n if (onKeyDown) passed.onKeyDown = onKeyDown;\n return (\n <ToolbarOverflowItem\n {...(passed as React.ComponentPropsWithoutRef<'div'>)}\n ref={forwardedRef as unknown as React.Ref<HTMLDivElement>}\n asChild={asChild}\n iconOnly={iconOnly}\n disabled={off}\n color={color}\n pressed={props['aria-pressed'] === undefined ? undefined : isPressed(props['aria-pressed'])}\n >\n {rest.children}\n </ToolbarOverflowItem>\n );\n }\n\n // In a vertical toolbar, Up and Down belong to the toolbar. A menu trigger rendering this\n // hands its open-on-arrow handler in through `onKeyDown`; those two keys skip it (v2).\n const handleKeyDown =\n toolbar?.orientation === 'vertical' && onKeyDown\n ? (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') return;\n onKeyDown(event);\n }\n : onKeyDown;\n\n const pressed = isPressed(props['aria-pressed']);\n const stateProps =\n 'data-state' in props || props['aria-pressed'] === undefined ? {} : { 'data-state': pressed ? 'on' : 'off' };\n\n const shared = {\n size: size ?? toolbar?.size,\n // A caller states the look by `variant` or the rank by `emphasis`, never both.\n ...(emphasis !== undefined\n ? { emphasis }\n : { variant: variant ?? (group ? 'ghost' : toolbar?.backdrop ? 'raised' : 'soft') }),\n // The gray rest is a pair with the default variant: a caller who states a variant or an\n // emphasis gets Button's own colour for it unless they state a colour too.\n color: color ?? (variant || emphasis ? undefined : 'gray'),\n ...stateProps,\n } as const;\n\n // The text and icon-only branches share every prop but the name; one Button renders both.\n const buttonProps = {\n ...rest,\n ...(iconOnly ? { iconOnly: true } : {}),\n ...(asChild ? { asChild: true } : {}),\n ...(handleKeyDown ? { onKeyDown: handleKeyDown } : {}),\n ...shared,\n } as ButtonProps;\n\n // Outside a toolbar there is no row to join: a plain Button, not a throw.\n if (!toolbar) {\n return <Button {...buttonProps} ref={forwardedRef} disabled={off} />;\n }\n\n // A link (or any non-button child) joins the row as a Radix Toolbar.Link, which sets no\n // `type`. Toolbar.Button would stamp `type=\"button\"` on it.\n if (asChild && !isButtonElement(rest.children)) {\n return (\n <ToolbarPrimitive.Link asChild ref={forwardedRef as unknown as React.Ref<HTMLAnchorElement>}>\n <Button {...buttonProps} disabled={off} />\n </ToolbarPrimitive.Link>\n );\n }\n\n return (\n <ToolbarPrimitive.Button asChild ref={forwardedRef} disabled={off}>\n <Button {...buttonProps} />\n </ToolbarPrimitive.Button>\n );\n});\nToolbarButton.displayName = 'Toolbar.Button';\n\ninterface ToolbarOverflowItemProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onSelect' | 'color'> {\n asChild?: boolean;\n iconOnly?: boolean;\n disabled?: boolean;\n color?: ButtonProps['color'];\n /** A toggle's pressed state. A toggle becomes a checkbox item, so the menu still says whether it is on. */\n pressed?: boolean;\n}\n\n/**\n * A ToolbarButton drawn into the overflow menu: the same element, as a menu item. An icon-only\n * button's `aria-label` becomes the item's text beside its icon, since a menu row has room for\n * words. What prices a box (size, variant, emphasis, iconOnly) does not come across.\n */\nconst ToolbarOverflowItem = React.forwardRef<HTMLDivElement, ToolbarOverflowItemProps>(\n ({ asChild, iconOnly, disabled, color, pressed, children, 'aria-label': label, ...props }, forwardedRef) => {\n const words = iconOnly ? label : undefined;\n const itemProps = {\n ...props,\n ...(iconOnly ? {} : label ? { 'aria-label': label } : {}),\n disabled,\n ...(color ? { color: color as DropdownMenu.ItemProps['color'] } : {}),\n };\n if (asChild && React.isValidElement<{ children?: React.ReactNode }>(children)) {\n const child = words\n ? React.cloneElement(children, undefined, children.props.children, <span>{words}</span>)\n : children;\n return (\n <DropdownMenu.Item {...itemProps} ref={forwardedRef} asChild>\n {child}\n </DropdownMenu.Item>\n );\n }\n if (pressed !== undefined) {\n return (\n <DropdownMenu.CheckboxItem {...itemProps} ref={forwardedRef} checked={pressed}>\n {children}\n {words}\n </DropdownMenu.CheckboxItem>\n );\n }\n return (\n <DropdownMenu.Item {...itemProps} ref={forwardedRef}>\n {children}\n {words}\n </DropdownMenu.Item>\n );\n },\n);\nToolbarOverflowItem.displayName = 'Toolbar.OverflowItem';\n\n// ============================================================================\n// ToolbarOverflow\n// ============================================================================\n\ninterface ToolbarOverflowProps extends ComponentPropsWithout<'div', RemovedProps> {\n /** The accessible name of the \"More\" button. Defaults to `More`. */\n label?: string;\n /** The controls in the cluster, in order. The ones that don't fit move into the \"More\" menu. */\n children?: React.ReactNode;\n}\n\n/** Three filled dots for the \"More\" button. Internal, so the library carries no icon set. */\nfunction MoreIcon() {\n return (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentcolor\" aria-hidden xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"3.25\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"8\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"12.75\" cy=\"8\" r=\"1.25\" />\n </svg>\n );\n}\n\n/**\n * A cluster of controls that collapses into a \"More\" menu when the row runs out of room.\n *\n * It takes the room the row leaves, and when its controls don't fit, they move into the menu\n * from the end of the cluster. A `ToolbarButton` shows as a menu item there, and a\n * `ToolbarGroup` as a menu group. Use `useToolbarOverflow()` in your own components to render a\n * different form in the menu.\n *\n * It measures on mount and on resize (v2 ToolbarOverflow): each control's width is cached while\n * it is in the row, since a hidden control has no width to measure.\n */\nconst ToolbarOverflow = React.forwardRef<HTMLDivElement, ToolbarOverflowProps>(\n ({ label = 'More', className, children, ...props }, forwardedRef) => {\n const items = React.Children.toArray(children);\n const count = items.length;\n\n const rootRef = React.useRef<HTMLDivElement | null>(null);\n const widths = React.useRef<number[]>([]);\n const triggerWidth = React.useRef(0);\n const [shown, setShown] = React.useState(count);\n const [tick, setTick] = React.useState(0);\n\n // A different set of children is a different set of widths: show them all and measure again.\n const [measuredCount, setMeasuredCount] = React.useState(count);\n if (measuredCount !== count) {\n setMeasuredCount(count);\n setShown(count);\n }\n useLayoutEffect(() => {\n widths.current = [];\n }, [count]);\n\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n // The root's children are one seat per visible child, then the trigger.\n const kids = Array.from(root.children) as HTMLElement[];\n const visible = Math.min(shown, count);\n for (let i = 0; i < visible; i++) {\n const el = kids[i];\n if (el) widths.current[i] = el.offsetWidth;\n }\n const trigger = kids[visible];\n if (trigger) triggerWidth.current = trigger.offsetWidth;\n\n const gap = Number.parseFloat(getComputedStyle(root).columnGap) || 0;\n const available = root.clientWidth;\n\n let total = 0;\n let counted = 0;\n for (let i = 0; i < count; i++) {\n const width = widths.current[i];\n // Never seen in the row, so there is nothing to decide with yet.\n if (width === undefined) return;\n // An empty seat leaves the layout, so it spends no gap.\n if (width === 0) continue;\n total += width + (counted > 0 ? gap : 0);\n counted += 1;\n }\n\n let next = count;\n if (total > available) {\n // Before the trigger exists, the row's height stands in for its width: an icon-only\n // button is square. The next pass, before paint, corrects it.\n const budget = available - (triggerWidth.current || root.clientHeight) - gap;\n let used = 0;\n let drawn = 0;\n next = 0;\n for (let i = 0; i < count; i++) {\n const own = widths.current[i]!;\n if (own > 0) {\n const width = own + (drawn > 0 ? gap : 0);\n if (used + width > budget) break;\n used += width;\n drawn += 1;\n }\n next += 1;\n }\n }\n if (next !== shown) setShown(next);\n }, [shown, count, tick]);\n\n // Watch the row and every seat in it: a control whose content changes (a page's actions\n // arriving after navigation) changes its width without the row's width changing.\n React.useEffect(() => {\n const root = rootRef.current;\n if (!root || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(() => setTick((n) => n + 1));\n observer.observe(root);\n for (const seat of Array.from(root.children)) observer.observe(seat);\n return () => observer.disconnect();\n }, [shown, count]);\n\n const attach = React.useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n return (\n <div {...props} ref={attach} className={classNames('kui-ToolbarOverflow', className)}>\n {items.slice(0, shown).map((item, i) => (\n // The seat is a position in the row, so its key is the index.\n <div key={i} className=\"kui-ToolbarOverflowSeat\">\n {item}\n </div>\n ))}\n {shown < count ? (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger>\n <ToolbarButton iconOnly aria-label={label}>\n <MoreIcon />\n </ToolbarButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n <InOverflowContext.Provider value>{items.slice(shown)}</InOverflowContext.Provider>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n ) : null}\n </div>\n );\n },\n);\nToolbarOverflow.displayName = 'Toolbar.Overflow';\n\n// ============================================================================\n// ToolbarSlot and ToolbarFill\n// ============================================================================\n\ntype SlotEntry = { id: string; node: React.ReactNode };\n\nconst EMPTY_ENTRIES: readonly SlotEntry[] = [];\nconst slotEntries = new Map<string, readonly SlotEntry[]>();\nconst slotListeners = new Set<() => void>();\n/** How many ToolbarSlots of each name are mounted, to warn when one Fill would render twice. */\nconst mountedSlots = new Map<string, number>();\n\nfunction subscribeSlots(listener: () => void) {\n slotListeners.add(listener);\n return () => {\n slotListeners.delete(listener);\n };\n}\n\nfunction setSlotEntry(name: string, id: string, node: React.ReactNode) {\n const list = slotEntries.get(name) ?? EMPTY_ENTRIES;\n const index = list.findIndex((entry) => entry.id === id);\n const next = index === -1 ? [...list, { id, node }] : list.map((entry) => (entry.id === id ? { id, node } : entry));\n slotEntries.set(name, next);\n slotListeners.forEach((listener) => listener());\n}\n\nfunction removeSlotEntry(name: string, id: string) {\n const list = slotEntries.get(name);\n if (!list) return;\n const next = list.filter((entry) => entry.id !== id);\n if (next.length === 0) slotEntries.delete(name);\n else slotEntries.set(name, next);\n slotListeners.forEach((listener) => listener());\n}\n\ninterface ToolbarSlotProps {\n /**\n * Which `ToolbarFill` renders here. Defaults to `default`. Names are global to the page: mount one\n * slot per name, or the fill renders in each of them (development builds warn).\n */\n name?: string;\n}\n\n/**\n * A place in a toolbar that content elsewhere in the app fills, such as a page adding its own\n * actions to a header toolbar the layout owns.\n *\n * It renders whatever the `ToolbarFill` with the same `name` holds, as if it were written here:\n * the controls take the toolbar's size and join its arrow-key row. It adds no element.\n */\nfunction ToolbarSlot({ name = 'default' }: ToolbarSlotProps) {\n useLayoutEffect(() => {\n const count = (mountedSlots.get(name) ?? 0) + 1;\n mountedSlots.set(name, count);\n if (count > 1 && process.env.NODE_ENV !== 'production') {\n console.warn(`[kookie-ui] ToolbarSlot: ${count} slots named \"${name}\" are mounted. Each renders the ToolbarFill's controls, so they appear more than once. Give each slot its own name.`);\n }\n return () => {\n const left = (mountedSlots.get(name) ?? 1) - 1;\n if (left > 0) mountedSlots.set(name, left);\n else mountedSlots.delete(name);\n };\n }, [name]);\n const entries = React.useSyncExternalStore(\n subscribeSlots,\n () => slotEntries.get(name) ?? EMPTY_ENTRIES,\n () => EMPTY_ENTRIES,\n );\n return (\n <>\n {entries.map((entry) => (\n <React.Fragment key={entry.id}>{entry.node}</React.Fragment>\n ))}\n </>\n );\n}\nToolbarSlot.displayName = 'Toolbar.Slot';\n\ninterface ToolbarFillProps {\n /** The `ToolbarSlot` to render into. Defaults to `default`. */\n name?: string;\n /** The controls to show in the slot, such as `ToolbarButton`s. */\n children?: React.ReactNode;\n}\n\n/**\n * Sends its children to the `ToolbarSlot` with the same `name`, and renders nothing where it\n * is written. Use it instead of a React portal: a portal keeps the page's React tree, so a\n * ToolbarButton in it can't join the toolbar's arrow keys.\n *\n * The children render inside the toolbar, so they read the toolbar's context, not the page's.\n * They appear after the page mounts on the client, not in server-rendered HTML.\n */\nfunction ToolbarFill({ name = 'default', children }: ToolbarFillProps) {\n const id = React.useId();\n useLayoutEffect(() => {\n setSlotEntry(name, id, children);\n }, [name, id, children]);\n useLayoutEffect(() => () => removeSlotEntry(name, id), [name, id]);\n return null;\n}\nToolbarFill.displayName = 'Toolbar.Fill';\n\n// ============================================================================\n// ToolbarSeparator\n// ============================================================================\n\ntype ToolbarSeparatorProps = ComponentPropsWithout<typeof ToolbarPrimitive.Separator, RemovedProps | 'orientation'>;\n\n/**\n * A gray hairline between two clusters, announced as a separator. Its direction is always\n * opposite to the toolbar's. In a `ToolbarOverflow`'s menu it is a menu separator.\n */\nconst ToolbarSeparator = React.forwardRef<HTMLDivElement, ToolbarSeparatorProps>(\n ({ className, ...props }, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const overflow = React.useContext(InOverflowContext);\n if (overflow) return <DropdownMenu.Separator {...props} ref={forwardedRef} className={className} />;\n if (!toolbar) {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n data-orientation=\"vertical\"\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarSeparator', className)}\n />\n );\n }\n return (\n <ToolbarPrimitive.Separator\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarSeparator', className)}\n />\n );\n },\n);\nToolbarSeparator.displayName = 'Toolbar.Separator';\n\n// ============================================================================\n// ToolbarTitle\n// ============================================================================\n\n/** The title's text step: one step above the label of a button at the same size. */\nconst TITLE_SIZE = { '1': '2', '2': '3', '3': '4', '4': '5' } as const satisfies Record<ToolbarSize, TextProps['size']>;\n\ninterface ToolbarTitleProps {\n /** The title text. With none, the title renders nothing. */\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n /** The id of the title, so that the toolbar's `aria-labelledby` can point at it. */\n id?: string;\n}\n\n/**\n * What the row is about, at its leading edge. One line: it truncates rather than wrapping.\n * Its text step follows the toolbar's `size`, and it takes more air from the controls beside it\n * than they take from each other.\n */\nconst ToolbarTitle = React.forwardRef<HTMLSpanElement, ToolbarTitleProps>(\n ({ className, children, style, id }, forwardedRef) => {\n const toolbar = React.useContext(ToolbarContext);\n const themeSize = useThemeSize<ToolbarSize>(undefined, toolbarRootPropDefs.size);\n const size = toolbar?.size ?? themeSize;\n if (children === undefined || children === null || children === false) return null;\n return (\n <Text\n ref={forwardedRef}\n as=\"span\"\n size={TITLE_SIZE[size]}\n weight=\"medium\"\n truncate\n id={id}\n style={style}\n className={classNames('kui-ToolbarTitle', className)}\n >\n {children}\n </Text>\n );\n },\n);\nToolbarTitle.displayName = 'Toolbar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst Toolbar = Object.assign(ToolbarRoot, {\n Root: ToolbarRoot,\n Group: ToolbarGroup,\n Button: ToolbarButton,\n Separator: ToolbarSeparator,\n Title: ToolbarTitle,\n Overflow: ToolbarOverflow,\n Slot: ToolbarSlot,\n Fill: ToolbarFill,\n});\n\nexport {\n Toolbar,\n ToolbarGroup,\n ToolbarButton,\n ToolbarSeparator,\n ToolbarTitle,\n ToolbarOverflow,\n ToolbarSlot,\n ToolbarFill,\n useToolbarOverflow,\n ToolbarRoot as Root,\n ToolbarGroup as Group,\n ToolbarButton as Button,\n ToolbarSeparator as Separator,\n ToolbarTitle as Title,\n ToolbarOverflow as Overflow,\n ToolbarSlot as Slot,\n ToolbarFill as Fill,\n};\nexport type {\n ToolbarProps,\n ToolbarGroupProps,\n ToolbarButtonProps,\n ToolbarSeparatorProps,\n ToolbarTitleProps,\n ToolbarOverflowProps,\n ToolbarSlotProps,\n ToolbarFillProps,\n ToolbarProps as RootProps,\n ToolbarGroupProps as GroupProps,\n ToolbarButtonProps as ButtonProps,\n ToolbarSeparatorProps as SeparatorProps,\n ToolbarTitleProps as TitleProps,\n ToolbarOverflowProps as OverflowProps,\n ToolbarSlotProps as SlotProps,\n ToolbarFillProps as FillProps,\n};\n", "import type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\nconst orientations = ['horizontal', 'vertical'] as const;\n\n/**\n * Toolbar prop definitions.\n *\n * `size` is one value for the whole row (not responsive): the row hands it to every control\n * inside it that does not state its own, through context, so it has to be a single index.\n */\nconst toolbarRootPropDefs = {\n /**\n * Size step of the row and of every control in it that doesn't set its own `size`.\n * Matches Button's sizes: 1 (28px) to 4 (48px). Unset inside a Shell, it rests one step above\n * the Shell's `size`, except in a pane's `Shell.Scroll` list and in a Popover, Dialog, Sheet or\n * menu. Elsewhere it takes Theme size, else 2.\n */\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2' },\n /**\n * Direction of the row and of the arrow keys. Use `vertical` for a strip of tools along an edge.\n */\n orientation: { type: 'enum', values: orientations, default: 'horizontal' },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n orientation: PropDef<(typeof orientations)[number]>;\n};\n\nexport { toolbarRootPropDefs };\n"],
5
- "mappings": ";uUAEA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,MAAuB,oBAChC,OAAOC,MAAgB,aACvB,OAAS,WAAWC,MAAwB,WCH5C,IAAMC,GAAQ,CAAC,IAAK,IAAK,IAAK,GAAG,EAC3BC,GAAe,CAAC,aAAc,UAAU,EAQxCC,EAAsB,CAO1B,KAAM,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQF,GAAO,QAAS,GAAI,EAI3E,YAAa,CAAE,KAAM,OAAQ,OAAQC,GAAc,QAAS,YAAa,CAC3E,EDoBA,IAAME,EAAuB,gBAA0C,IAAI,EAGrEC,EAA4B,gBAA4C,IAAI,EAO5EC,EAA0B,gBAAc,EAAK,EAQnD,SAASC,IAA8B,CACrC,OAAa,aAAWD,CAAiB,CAC3C,CAsCA,IAAME,EAAoB,aAAyC,CAACC,EAAOC,IAAiB,CAG1F,IAAMC,EAAOC,EAAgB,EAEvBC,EAAoBC,EAAaL,EAAM,MAAQE,GAAQ,OAAWI,EAAoB,IAAI,EAC1FC,EAAkCP,EAAM,aAAeM,EAAoB,YAAY,QACvF,CAAE,UAAAE,EAAW,YAAaC,EAAc,SAAAC,EAAW,GAAO,SAAAC,EAAU,GAAGC,CAAU,EAAIC,EACzF,CAAE,GAAGb,EAAO,KAAAI,CAAK,EACjBE,EACAQ,CACF,EAEMC,EAAgB,UAAQ,KAAO,CAAE,KAAAX,EAAM,YAAAG,EAAa,SAAAG,CAAS,GAAI,CAACN,EAAMG,EAAaG,CAAQ,CAAC,EAEpG,OACE,gBAACM,EAAiB,KAAjB,CACE,GAAGJ,EACJ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,IAAKC,EAAc,UAAWO,EAAW,EAC5FY,EAaH,gBAACJ,EAAiB,UAAjB,CACE,GAAGhB,EACJ,IAAKC,EACL,UAAWgB,EAAW,uBAAwBT,CAAS,EACzD,EAfE,gBAAC,OACC,KAAK,YACL,mBAAiB,WACjB,mBAAiB,WAChB,GAAGR,EACJ,IAAKC,EACL,UAAWgB,EAAW,uBAAwBT,CAAS,EACzD,CAUN,CACF,EACAoG,GAAiB,YAAc,oBAO/B,IAAME,GAAa,CAAE,EAAK,IAAK,EAAK,IAAK,EAAK,IAAK,EAAK,GAAI,EAgBtDC,GAAqB,aACzB,CAAC,CAAE,UAAAvG,EAAW,SAAAG,EAAU,MAAAqG,EAAO,GAAAZ,CAAG,EAAGnG,IAAiB,CACpD,IAAMmB,EAAgB,aAAWzB,CAAc,EACzCsH,EAAY5G,EAA0B,OAAWC,EAAoB,IAAI,EACzEF,EAAOgB,GAAS,MAAQ6F,EAC9B,OAA8BtG,GAAa,MAAQA,IAAa,GAAc,KAE5E,gBAACuG,EAAA,CACC,IAAKjH,EACL,GAAG,OACH,KAAM6G,GAAW1G,CAAI,EACrB,OAAO,SACP,SAAQ,GACR,GAAIgG,EACJ,MAAOY,EACP,UAAW/F,EAAW,mBAAoBT,CAAS,GAElDG,CACH,CAEJ,CACF,EACAoG,GAAa,YAAc,gBAM3B,IAAMI,GAAU,OAAO,OAAOpH,EAAa,CACzC,KAAMA,EACN,MAAOmB,GACP,OAAQU,EACR,UAAWgF,GACX,MAAOG,GACP,SAAUzD,GACV,KAAMkD,GACN,KAAMG,EACR,CAAC",
6
- "names": ["React", "useLayoutEffect", "classNames", "ToolbarPrimitive", "sizes", "orientations", "toolbarRootPropDefs", "ToolbarContext", "ToolbarGroupContext", "InOverflowContext", "useToolbarOverflow", "ToolbarRoot", "props", "forwardedRef", "band", "usePaneBandSize", "size", "useThemeSize", "toolbarRootPropDefs", "orientation", "className", "_orientation", "backdrop", "children", "rootProps", "extractProps", "layoutPropDefs", "context", "ToolbarPrimitive", "classNames", "ToolbarGroup", "disabled", "toolbar", "overflow", "group", "DropdownMenuGroup", "OVERFLOW_ITEM_KEYS", "isPressed", "value", "isButtonElement", "ToolbarButton", "iconOnly", "variant", "emphasis", "color", "asChild", "onKeyDown", "rest", "off", "passed", "key", "ToolbarOverflowItem", "handleKeyDown", "event", "pressed", "stateProps", "shared", "buttonProps", "Button", "label", "words", "itemProps", "child", "DropdownMenuItem", "DropdownMenuCheckboxItem", "MoreIcon", "ToolbarOverflow", "items", "count", "rootRef", "widths", "triggerWidth", "shown", "setShown", "tick", "setTick", "measuredCount", "setMeasuredCount", "useLayoutEffect", "root", "kids", "visible", "i", "el", "trigger", "gap", "available", "total", "counted", "width", "next", "budget", "used", "drawn", "own", "observer", "n", "seat", "attach", "node", "item", "DropdownMenuRoot", "DropdownMenuTrigger", "DropdownMenuContent", "EMPTY_ENTRIES", "slotEntries", "slotListeners", "mountedSlots", "subscribeSlots", "listener", "setSlotEntry", "name", "id", "list", "entry", "removeSlotEntry", "ToolbarSlot", "left", "entries", "ToolbarFill", "ToolbarSeparator", "DropdownMenuSeparator", "TITLE_SIZE", "ToolbarTitle", "style", "themeSize", "Text", "Toolbar"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as R,d}from"./chunk-3QWGSRYC.js";import{a as v,b as y,c as x}from"./chunk-LTUW36HM.js";import{a as O,b as E,c as T}from"./chunk-QKCNGEX4.js";import{a as C}from"./chunk-WEBNIUEX.js";import{a as c,c as N,e as M,g as w}from"./chunk-XUCR7L4G.js";import{a as S}from"./chunk-G66WDIIV.js";import{o as b}from"./chunk-GHWEXMF6.js";import*as e from"react";import ie from"classnames";import{useComposedRefs as le}from"radix-ui/internal";var pe={controlled:"open",default:"defaultOpen"},de={initial:"overlay",sm:"fixed"},H=e.forwardRef((U,k)=>{let{className:A,presentation:B=de,defaultOpen:V,open:L,onOpenChange:_,expandedSize:o=320,minSize:t=200,maxSize:s=500,resizable:m=!1,collapsible:D=!0,onExpand:$,onCollapse:q,onResize:F,onResizeStart:W,onResizeEnd:j,snapPoints:r,snapTolerance:G,collapseThreshold:a,paneId:i,persistence:l,children:K,style:J,onSizeChange:Q,sizeUpdate:X,sizeUpdateMs:Y=50,size:u,defaultSize:P,inset:f,id:Z,...p}=U,{table:z,attributes:ee}=x(B,"fixed"),n=v({name:"inspector",label:"Inspector",propNames:pe,id:Z,controlled:c(L),defaultValue:c(V),presentationTable:z,builtIn:N,onChange:(re,ae)=>_?.(re!=="closed",{reason:ae}),onExpand:$,onCollapse:q,size:o});b("inspector",f),e.useEffect(()=>{(r!==void 0||a!==void 0||i!==void 0||l!==void 0)&&void 0},[r,a,i,l]);let h=e.useRef(null),ne=le(k,n.setElement,h),oe=E({name:"inspector",elementId:n.id,elementRef:h,cssVarName:"--inspector-size",orientation:"vertical",edge:"start",growth:M,expandedSize:o,minSize:t,maxSize:s,resizable:m,collapsible:D,size:u,defaultSize:P,onSizeChange:Q,sizeUpdate:X,sizeUpdateMs:Y,onResize:F,onResizeStart:W,onResizeEnd:j,snapPoints:r,snapTolerance:G,collapseThreshold:a,paneId:i,persistence:l,overlaying:n.overlaying,overlayingNow:()=>z[S()]==="overlay",requestCollapse:()=>n.setValue("closed","toggle"),requestToggle:()=>n.toggle("toggle")}),{handles:I,content:te}=T(K,d),se=m&&n.shown!==!1&&!n.overlaying?e.createElement(C.Provider,{value:oe},I.length>0?I:e.createElement(R,null)):null,g=O(u,P,t,s);return e.createElement("div",{...w(p),role:p.role??"complementary",id:n.id,ref:ne,className:ie("kui-ShellPane","kui-ShellInspector",A),...y(n,ee),"data-inset":f||void 0,tabIndex:n.overlaying?-1:p.tabIndex,style:{...J,"--inspector-expanded-size":`${o}px`,...g?{"--inspector-size":g}:{},"--inspector-min-size":`${t}px`,"--inspector-max-size":`${s}px`}},e.createElement("div",{className:"kui-ShellInspectorContent"},te),se)});H.displayName="Shell.Inspector";H.Handle=d;export{H as a};
3
- //# sourceMappingURL=chunk-YMUERC2J.js.map