@womp/kookie-ui 0.36.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/components.css +0 -20
  2. package/dist/cjs/components/_internal/base-menu.utils.js +1 -1
  3. package/dist/cjs/components/_internal/base-menu.utils.js.map +2 -2
  4. package/dist/cjs/components/_internal/menu-context.js +1 -1
  5. package/dist/cjs/components/_internal/menu-context.js.map +2 -2
  6. package/dist/cjs/components/_internal/pane-chrome.js +1 -1
  7. package/dist/cjs/components/_internal/pane-chrome.js.map +2 -2
  8. package/dist/cjs/components/_internal/shell-bottom.d.ts +3 -3
  9. package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
  10. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  11. package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
  12. package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
  13. package/dist/cjs/components/_internal/shell-handles.js +1 -1
  14. package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
  15. package/dist/cjs/components/_internal/shell-inspector.d.ts +3 -3
  16. package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
  17. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  18. package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
  19. package/dist/cjs/components/_internal/shell-pane.d.ts +2 -7
  20. package/dist/cjs/components/_internal/shell-pane.d.ts.map +1 -1
  21. package/dist/cjs/components/_internal/shell-pane.js +1 -1
  22. package/dist/cjs/components/_internal/shell-pane.js.map +3 -3
  23. package/dist/cjs/components/_internal/shell-resizable.d.ts +3 -9
  24. package/dist/cjs/components/_internal/shell-resizable.d.ts.map +1 -1
  25. package/dist/cjs/components/_internal/shell-resizable.js +1 -1
  26. package/dist/cjs/components/_internal/shell-resizable.js.map +3 -3
  27. package/dist/cjs/components/_internal/shell-resize.d.ts +0 -4
  28. package/dist/cjs/components/_internal/shell-resize.d.ts.map +1 -1
  29. package/dist/cjs/components/_internal/shell-resize.js +1 -1
  30. package/dist/cjs/components/_internal/shell-resize.js.map +2 -2
  31. package/dist/cjs/components/_internal/shell-rest.d.ts +1 -6
  32. package/dist/cjs/components/_internal/shell-rest.d.ts.map +1 -1
  33. package/dist/cjs/components/_internal/shell-rest.js +1 -1
  34. package/dist/cjs/components/_internal/shell-rest.js.map +3 -3
  35. package/dist/cjs/components/_internal/shell-sidebar.d.ts +3 -3
  36. package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
  37. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  38. package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
  39. package/dist/cjs/components/_internal/shell-store.d.ts +0 -10
  40. package/dist/cjs/components/_internal/shell-store.d.ts.map +1 -1
  41. package/dist/cjs/components/_internal/shell-store.js +1 -1
  42. package/dist/cjs/components/_internal/shell-store.js.map +3 -3
  43. package/dist/cjs/components/checkbox-group.js +1 -1
  44. package/dist/cjs/components/checkbox-group.js.map +3 -3
  45. package/dist/cjs/components/checkbox-group.primitive.d.ts +0 -10
  46. package/dist/cjs/components/checkbox-group.primitive.d.ts.map +1 -1
  47. package/dist/cjs/components/checkbox-group.primitive.js +1 -1
  48. package/dist/cjs/components/checkbox-group.primitive.js.map +3 -3
  49. package/dist/cjs/components/context-menu.d.ts +1 -5
  50. package/dist/cjs/components/context-menu.d.ts.map +1 -1
  51. package/dist/cjs/components/context-menu.js +1 -1
  52. package/dist/cjs/components/context-menu.js.map +3 -3
  53. package/dist/cjs/components/dropdown-menu.js +1 -1
  54. package/dist/cjs/components/dropdown-menu.js.map +2 -2
  55. package/dist/cjs/components/index.js +2 -2
  56. package/dist/cjs/components/index.js.map +4 -4
  57. package/dist/cjs/components/navigator.js.map +2 -2
  58. package/dist/cjs/components/schemas/index.d.ts +1 -1
  59. package/dist/cjs/components/schemas/index.d.ts.map +1 -1
  60. package/dist/cjs/components/schemas/index.js +1 -1
  61. package/dist/cjs/components/schemas/index.js.map +3 -3
  62. package/dist/cjs/components/schemas/shell.schema.d.ts +6 -112
  63. package/dist/cjs/components/schemas/shell.schema.d.ts.map +1 -1
  64. package/dist/cjs/components/schemas/shell.schema.js +1 -1
  65. package/dist/cjs/components/schemas/shell.schema.js.map +3 -3
  66. package/dist/cjs/components/separator.js +1 -1
  67. package/dist/cjs/components/separator.js.map +2 -2
  68. package/dist/cjs/components/shell.context.d.ts +1 -45
  69. package/dist/cjs/components/shell.context.d.ts.map +1 -1
  70. package/dist/cjs/components/shell.context.js +1 -1
  71. package/dist/cjs/components/shell.context.js.map +4 -4
  72. package/dist/cjs/components/shell.d.ts +7 -37
  73. package/dist/cjs/components/shell.d.ts.map +1 -1
  74. package/dist/cjs/components/shell.js +1 -1
  75. package/dist/cjs/components/shell.js.map +4 -4
  76. package/dist/cjs/components/shell.types.d.ts +6 -27
  77. package/dist/cjs/components/shell.types.d.ts.map +1 -1
  78. package/dist/cjs/components/shell.types.js +1 -1
  79. package/dist/cjs/components/shell.types.js.map +2 -2
  80. package/dist/cjs/components/sidebar.js +1 -1
  81. package/dist/cjs/components/sidebar.js.map +2 -2
  82. package/dist/cjs/components/toolbar.js +1 -1
  83. package/dist/cjs/components/toolbar.js.map +2 -2
  84. package/dist/cjs/hooks/use-breakpoint.js +1 -1
  85. package/dist/cjs/hooks/use-breakpoint.js.map +2 -2
  86. package/dist/cjs/index.js +4 -4
  87. package/dist/cjs/index.js.map +4 -4
  88. package/dist/esm/{chunk-5RLGDXOM.js → chunk-2K46JPUL.js} +2 -2
  89. package/dist/esm/chunk-3K7E4XL3.js +3 -0
  90. package/dist/esm/chunk-3K7E4XL3.js.map +7 -0
  91. package/dist/esm/chunk-3LR7KMBE.js +3 -0
  92. package/dist/esm/chunk-3LR7KMBE.js.map +7 -0
  93. package/dist/esm/chunk-5U2LEJLU.js +3 -0
  94. package/dist/esm/chunk-5U2LEJLU.js.map +7 -0
  95. package/dist/esm/{chunk-IN6D33TU.js → chunk-5XO3PLDH.js} +2 -2
  96. package/dist/esm/{chunk-COLJWVN7.js → chunk-AQR42GKA.js} +2 -2
  97. package/dist/esm/{chunk-FTNZWAPB.js → chunk-ARPUPT4M.js} +2 -2
  98. package/dist/esm/{chunk-ISCZ57VL.js → chunk-DJGZ4K3V.js} +2 -2
  99. package/dist/esm/{chunk-PMXIQ5B4.js → chunk-FKCKELUB.js} +2 -2
  100. package/dist/esm/chunk-H7GH3DTF.js +3 -0
  101. package/dist/esm/chunk-H7GH3DTF.js.map +7 -0
  102. package/dist/esm/{chunk-E6MOZSYV.js → chunk-HNOT2HS4.js} +2 -2
  103. package/dist/esm/chunk-LBAC2X4U.js +3 -0
  104. package/dist/esm/{chunk-5BXCPANF.js.map → chunk-LBAC2X4U.js.map} +3 -3
  105. package/dist/esm/{chunk-MAA6LEE2.js → chunk-MDQ7ZHOS.js} +1 -1
  106. package/dist/esm/chunk-MDQ7ZHOS.js.map +7 -0
  107. package/dist/esm/chunk-MQA3BKF4.js +3 -0
  108. package/dist/esm/chunk-MQA3BKF4.js.map +7 -0
  109. package/dist/esm/chunk-MXNPCJPV.js +3 -0
  110. package/dist/esm/chunk-MXNPCJPV.js.map +7 -0
  111. package/dist/esm/{chunk-EB4AG3OL.js → chunk-REELD6CT.js} +2 -2
  112. package/dist/esm/chunk-RYXIRZQW.js +3 -0
  113. package/dist/esm/chunk-RYXIRZQW.js.map +7 -0
  114. package/dist/esm/chunk-S66WR5R7.js +3 -0
  115. package/dist/esm/{chunk-MXEOE4LA.js.map → chunk-S66WR5R7.js.map} +2 -2
  116. package/dist/esm/chunk-SECVO3CW.js +3 -0
  117. package/dist/esm/chunk-SECVO3CW.js.map +7 -0
  118. package/dist/esm/chunk-SHDZYFUN.js +3 -0
  119. package/dist/esm/chunk-SHDZYFUN.js.map +7 -0
  120. package/dist/esm/{chunk-3M5ZM67R.js → chunk-TCFBNE6A.js} +2 -2
  121. package/dist/esm/chunk-U7P64MXD.js +3 -0
  122. package/dist/esm/chunk-U7P64MXD.js.map +7 -0
  123. package/dist/esm/chunk-UFYQC5XY.js +3 -0
  124. package/dist/esm/chunk-UFYQC5XY.js.map +7 -0
  125. package/dist/esm/{chunk-G66WDIIV.js → chunk-WJKCXGVN.js} +2 -2
  126. package/dist/esm/chunk-XBDAE77C.js +3 -0
  127. package/dist/esm/chunk-XBDAE77C.js.map +7 -0
  128. package/dist/esm/{chunk-SIYOLE6P.js → chunk-YM47BXKK.js} +2 -2
  129. package/dist/esm/components/_internal/base-menu.utils.js +1 -1
  130. package/dist/esm/components/_internal/menu-context.js +1 -1
  131. package/dist/esm/components/_internal/pane-chrome.js +1 -1
  132. package/dist/esm/components/_internal/shell-bottom.d.ts +3 -3
  133. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  134. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  135. package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -1
  136. package/dist/esm/components/_internal/shell-handles.js +1 -1
  137. package/dist/esm/components/_internal/shell-inspector.d.ts +3 -3
  138. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  139. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  140. package/dist/esm/components/_internal/shell-pane.d.ts +2 -7
  141. package/dist/esm/components/_internal/shell-pane.d.ts.map +1 -1
  142. package/dist/esm/components/_internal/shell-pane.js +1 -1
  143. package/dist/esm/components/_internal/shell-resizable.d.ts +3 -9
  144. package/dist/esm/components/_internal/shell-resizable.d.ts.map +1 -1
  145. package/dist/esm/components/_internal/shell-resizable.js +1 -1
  146. package/dist/esm/components/_internal/shell-resize.d.ts +0 -4
  147. package/dist/esm/components/_internal/shell-resize.d.ts.map +1 -1
  148. package/dist/esm/components/_internal/shell-resize.js +1 -1
  149. package/dist/esm/components/_internal/shell-rest.d.ts +1 -6
  150. package/dist/esm/components/_internal/shell-rest.d.ts.map +1 -1
  151. package/dist/esm/components/_internal/shell-rest.js +1 -1
  152. package/dist/esm/components/_internal/shell-sidebar.d.ts +3 -3
  153. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  154. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  155. package/dist/esm/components/_internal/shell-store.d.ts +0 -10
  156. package/dist/esm/components/_internal/shell-store.d.ts.map +1 -1
  157. package/dist/esm/components/_internal/shell-store.js +1 -1
  158. package/dist/esm/components/checkbox-group.js +1 -1
  159. package/dist/esm/components/checkbox-group.primitive.d.ts +0 -10
  160. package/dist/esm/components/checkbox-group.primitive.d.ts.map +1 -1
  161. package/dist/esm/components/checkbox-group.primitive.js +1 -1
  162. package/dist/esm/components/context-menu.d.ts +1 -5
  163. package/dist/esm/components/context-menu.d.ts.map +1 -1
  164. package/dist/esm/components/context-menu.js +1 -1
  165. package/dist/esm/components/dropdown-menu.js +1 -1
  166. package/dist/esm/components/index.js +1 -1
  167. package/dist/esm/components/navigator.js +1 -1
  168. package/dist/esm/components/schemas/index.d.ts +1 -1
  169. package/dist/esm/components/schemas/index.d.ts.map +1 -1
  170. package/dist/esm/components/schemas/index.js +1 -1
  171. package/dist/esm/components/schemas/index.js.map +2 -2
  172. package/dist/esm/components/schemas/shell.schema.d.ts +6 -112
  173. package/dist/esm/components/schemas/shell.schema.d.ts.map +1 -1
  174. package/dist/esm/components/schemas/shell.schema.js +1 -1
  175. package/dist/esm/components/separator.js +1 -1
  176. package/dist/esm/components/shell.context.d.ts +1 -45
  177. package/dist/esm/components/shell.context.d.ts.map +1 -1
  178. package/dist/esm/components/shell.context.js +1 -1
  179. package/dist/esm/components/shell.d.ts +7 -37
  180. package/dist/esm/components/shell.d.ts.map +1 -1
  181. package/dist/esm/components/shell.js +1 -1
  182. package/dist/esm/components/shell.types.d.ts +6 -27
  183. package/dist/esm/components/shell.types.d.ts.map +1 -1
  184. package/dist/esm/components/shell.types.js +1 -1
  185. package/dist/esm/components/sidebar.js +1 -1
  186. package/dist/esm/components/toolbar.js +1 -1
  187. package/dist/esm/components/virtual-menu.js +1 -1
  188. package/dist/esm/hooks/use-breakpoint.js +1 -1
  189. package/dist/esm/index.js +1 -1
  190. package/package.json +1 -1
  191. package/schemas/index.json +13 -335
  192. package/schemas/shell-bottom.json +2 -63
  193. package/schemas/shell-inspector.json +2 -63
  194. package/schemas/shell-panel.json +2 -63
  195. package/schemas/shell-rail.json +2 -38
  196. package/schemas/shell-sidebar.json +5 -102
  197. package/schemas/shell-trigger.json +0 -6
  198. package/src/components/_internal/shell-bottom.tsx +6 -26
  199. package/src/components/_internal/shell-handles.tsx +2 -32
  200. package/src/components/_internal/shell-inspector.tsx +6 -26
  201. package/src/components/_internal/shell-pane.tsx +7 -56
  202. package/src/components/_internal/shell-resizable.tsx +6 -81
  203. package/src/components/_internal/shell-resize.tsx +0 -4
  204. package/src/components/_internal/shell-rest.ts +2 -11
  205. package/src/components/_internal/shell-sidebar.tsx +8 -30
  206. package/src/components/_internal/shell-store.tsx +1 -34
  207. package/src/components/checkbox-group.primitive.tsx +0 -12
  208. package/src/components/context-menu.tsx +1 -6
  209. package/src/components/schemas/index.ts +0 -1
  210. package/src/components/schemas/shell.schema.ts +3 -20
  211. package/src/components/shell.context.tsx +5 -112
  212. package/src/components/shell.css +1 -29
  213. package/src/components/shell.tsx +12 -97
  214. package/src/components/shell.types.ts +6 -28
  215. package/styles.css +0 -20
  216. package/dist/cjs/components/shell.hooks.d.ts +0 -10
  217. package/dist/cjs/components/shell.hooks.d.ts.map +0 -1
  218. package/dist/cjs/components/shell.hooks.js +0 -3
  219. package/dist/cjs/components/shell.hooks.js.map +0 -7
  220. package/dist/esm/chunk-2VSRZ4IT.js +0 -3
  221. package/dist/esm/chunk-2VSRZ4IT.js.map +0 -7
  222. package/dist/esm/chunk-2WFN4D52.js +0 -3
  223. package/dist/esm/chunk-2WFN4D52.js.map +0 -7
  224. package/dist/esm/chunk-4OJRLS5N.js +0 -3
  225. package/dist/esm/chunk-4OJRLS5N.js.map +0 -7
  226. package/dist/esm/chunk-4TTRPCGG.js +0 -3
  227. package/dist/esm/chunk-4TTRPCGG.js.map +0 -7
  228. package/dist/esm/chunk-5BXCPANF.js +0 -3
  229. package/dist/esm/chunk-B447PNRD.js +0 -3
  230. package/dist/esm/chunk-B447PNRD.js.map +0 -7
  231. package/dist/esm/chunk-BJVXB3PN.js +0 -3
  232. package/dist/esm/chunk-BJVXB3PN.js.map +0 -7
  233. package/dist/esm/chunk-DNY4WWZF.js +0 -3
  234. package/dist/esm/chunk-DNY4WWZF.js.map +0 -7
  235. package/dist/esm/chunk-HQT32HQ6.js +0 -3
  236. package/dist/esm/chunk-HQT32HQ6.js.map +0 -7
  237. package/dist/esm/chunk-KGCGT4MJ.js +0 -3
  238. package/dist/esm/chunk-KGCGT4MJ.js.map +0 -7
  239. package/dist/esm/chunk-M26LLCQC.js +0 -3
  240. package/dist/esm/chunk-M26LLCQC.js.map +0 -7
  241. package/dist/esm/chunk-MAA6LEE2.js.map +0 -7
  242. package/dist/esm/chunk-MXEOE4LA.js +0 -3
  243. package/dist/esm/chunk-TS4QCDSI.js +0 -3
  244. package/dist/esm/chunk-TS4QCDSI.js.map +0 -7
  245. package/dist/esm/chunk-XOAOSRTH.js +0 -3
  246. package/dist/esm/chunk-XOAOSRTH.js.map +0 -7
  247. package/dist/esm/chunk-XUCR7L4G.js +0 -3
  248. package/dist/esm/chunk-XUCR7L4G.js.map +0 -7
  249. package/dist/esm/components/shell.hooks.d.ts +0 -10
  250. package/dist/esm/components/shell.hooks.d.ts.map +0 -1
  251. package/dist/esm/components/shell.hooks.js +0 -3
  252. package/dist/esm/components/shell.hooks.js.map +0 -7
  253. package/src/components/shell.hooks.ts +0 -20
  254. /package/dist/esm/{chunk-5RLGDXOM.js.map → chunk-2K46JPUL.js.map} +0 -0
  255. /package/dist/esm/{chunk-IN6D33TU.js.map → chunk-5XO3PLDH.js.map} +0 -0
  256. /package/dist/esm/{chunk-COLJWVN7.js.map → chunk-AQR42GKA.js.map} +0 -0
  257. /package/dist/esm/{chunk-FTNZWAPB.js.map → chunk-ARPUPT4M.js.map} +0 -0
  258. /package/dist/esm/{chunk-ISCZ57VL.js.map → chunk-DJGZ4K3V.js.map} +0 -0
  259. /package/dist/esm/{chunk-PMXIQ5B4.js.map → chunk-FKCKELUB.js.map} +0 -0
  260. /package/dist/esm/{chunk-E6MOZSYV.js.map → chunk-HNOT2HS4.js.map} +0 -0
  261. /package/dist/esm/{chunk-EB4AG3OL.js.map → chunk-REELD6CT.js.map} +0 -0
  262. /package/dist/esm/{chunk-3M5ZM67R.js.map → chunk-TCFBNE6A.js.map} +0 -0
  263. /package/dist/esm/{chunk-G66WDIIV.js.map → chunk-WJKCXGVN.js.map} +0 -0
  264. /package/dist/esm/{chunk-SIYOLE6P.js.map → chunk-YM47BXKK.js.map} +0 -0
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{b as H,d as U,g as D}from"./chunk-XUCR7L4G.js";import{a as V,c as m}from"./chunk-4OJRLS5N.js";import{a as k,b as N,c as w}from"./chunk-KGCGT4MJ.js";import{a as B,b as I,c as A}from"./chunk-4TTRPCGG.js";import{a as T}from"./chunk-MXEOE4LA.js";import{a as y}from"./chunk-G66WDIIV.js";import{b as M}from"./chunk-VWRPVM5K.js";import{f as E}from"./chunk-PMXIQ5B4.js";import{o as x}from"./chunk-5BXCPANF.js";import*as e from"react";import ue from"classnames";import{useComposedRefs as Se}from"radix-ui/internal";var L=t=>t==="collapsed"?"closed":"open",ce=t=>t==="closed"?"collapsed":"expanded";function O(t){if(t===void 0)return;if(typeof t=="string")return L(t);let n={};for(let[r,i]of Object.entries(t))i!==void 0&&(n[r]=L(i));return n}var me={controlled:"state",default:"defaultState"},be={initial:"overlay",sm:"fixed"},_=e.forwardRef((t,n)=>{let{className:r,presentation:i=be,expandedSize:o=288,minSize:s=200,maxSize:d=400,resizable:b=!1,collapsible:$=!0,onExpand:F,onCollapse:W,onResize:j,onResizeStart:q,onResizeEnd:G,snapPoints:l,snapTolerance:K,collapseThreshold:p,paneId:u,persistence:S,children:J,style:Q,state:X,defaultState:Y,onStateChange:Z,size:f,defaultSize:P,onSizeChange:ee,sizeUpdate:ae,sizeUpdateMs:te=50,flush:h=!0,id:ne,...c}=t,{table:g,attributes:ie}=w(i,"fixed"),a=k({name:"sidebar",label:"Sidebar",propNames:me,id:ne,controlled:O(X),defaultValue:O(Y),presentationTable:g,builtIn:H,onChange:(le,pe)=>Z?.(ce(le),{reason:pe}),onExpand:F,onCollapse:W,size:o});x("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),oe=Se(n,a.setElement,z),re=I({name:"sidebar",elementId:a.id,elementRef:z,cssVarName:"--sidebar-size",orientation:"vertical",edge:"end",growth:U,expandedSize:o,minSize:s,maxSize:d,resizable:b,collapsible:$,size:f,defaultSize:P,onSizeChange:ee,sizeUpdate:ae,sizeUpdateMs:te,onResize:j,onResizeStart:q,onResizeEnd:G,snapPoints:l,snapTolerance:K,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:se}=A(J,m),de=b&&a.value!=="closed"&&!a.overlaying?e.createElement(T.Provider,{value:re},v.length>0?v:e.createElement(V,null)):null,R=a.peeking?`var(--sidebar-size, ${o}px)`:void 0,C=B(f,P,s,d);return e.createElement("div",{...D(c),role:c.role??"navigation",id:a.id,ref:oe,className:ue("kui-ShellPane","kui-ShellSidebar",r),...N(a,ie),"data-flush":h||void 0,tabIndex:a.overlaying?-1:c.tabIndex,style:{...Q,"--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(E,null,e.createElement(M,null,se))),de)});_.displayName="Shell.Sidebar";_.Handle=m;export{_ as a};
3
- //# sourceMappingURL=chunk-2WFN4D52.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 { useFrameRegistration, 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 { PageScope } from './page-scope.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 /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n} & (SidebarControlledProps | SidebarUncontrolledProps);\n\ntype SidebarComponent = React.ForwardRefExoticComponent<SidebarPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof SidebarHandle };\n\nconst toValue = (mode: SidebarMode): PaneValue => (mode === 'collapsed' ? 'closed' : 'open');\nconst toMode = (value: PaneValue): SidebarMode => (value === 'closed' ? 'collapsed' : 'expanded');\n\nfunction modeToValue(state: 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 flush = true,\n id,\n ...domProps\n } = props;\n\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'sidebar',\n label: 'Sidebar',\n propNames: SIDEBAR_PROP_NAMES,\n id,\n controlled: modeToValue(state),\n defaultValue: modeToValue(defaultState),\n presentationTable: table,\n builtIn: navigationRest,\n onChange: (value, reason) => onStateChange?.(toMode(value), { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useFrameRegistration('sidebar', flush);\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-flush={flush || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--sidebar-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--sidebar-size': initialSize } : {}),\n '--sidebar-min-size': `${minSize}px`,\n '--sidebar-max-size': `${maxSize}px`,\n ...(peekWidth ? { '--peek-sidebar-width': peekWidth } : {}),\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellSidebarContent\">\n <PaneChromeScope>\n <PageScope>{content}</PageScope>\n </PaneChromeScope>\n </div>\n {handle}\n </div>\n );\n}) as SidebarComponent;\n\nSidebar.displayName = 'Shell.Sidebar';\nSidebar.Handle = SidebarHandle;\n\nexport type { SidebarPublicProps };\n"],
5
- "mappings": ";yZAEA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,OAAS,mBAAAC,OAAuB,oBAgChC,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,CAAE,WAAY,QAAS,QAAS,cAAe,EAGpEC,GAA+B,CAAE,QAAS,UAAW,GAAI,OAAQ,EAG1DC,EAAgB,aAA+C,CAACC,EAAOC,IAAQ,CAC1F,GAAM,CACJ,UAAAC,EACA,aAAAC,EAAeL,GACf,aAAAM,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,MAAA1B,EACA,aAAA2B,EACA,cAAAC,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,EAEK,CAAE,QAAAY,EAAS,QAAAC,EAAQ,EAAIC,EAAa7B,EAAU8B,CAAa,EAC3DC,GACJ3C,GAAa2B,EAAK,QAAU,UAAY,CAACA,EAAK,WAC5C,gBAACiB,EAAkB,SAAlB,CAA2B,MAAOT,IAASI,EAAQ,OAAS,EAAIA,EAAU,gBAACM,EAAA,IAAW,CAAG,EACxF,KAGAC,EAAYnB,EAAK,QAAU,uBAAuB9B,CAAY,MAAQ,OAEtEkD,EAAcC,EAAmBhC,EAAMC,EAAanB,EAASC,CAAO,EAC1E,OACE,gBAAC,OACE,GAAGkD,EAAwB1B,CAAQ,EACpC,KAAMA,EAAS,MAAQ,aACvB,GAAII,EAAK,GACT,IAAKM,GACL,UAAWiB,GAAW,gBAAiB,mBAAoBvD,CAAS,EACnE,GAAGwD,EAAexB,EAAMF,EAAU,EACnC,aAAYJ,GAAS,OACrB,SAAUM,EAAK,WAAa,GAAKJ,EAAS,SAC1C,MACE,CACE,GAAGV,EACH,0BAA2B,GAAGhB,CAAY,KAC1C,GAAIkD,EAAc,CAAE,iBAAkBA,CAAY,EAAI,CAAC,EACvD,qBAAsB,GAAGjD,CAAO,KAChC,qBAAsB,GAAGC,CAAO,KAChC,GAAI+C,EAAY,CAAE,uBAAwBA,CAAU,EAAI,CAAC,CAC3D,GAGF,gBAAC,OAAI,UAAU,2BACb,gBAACM,EAAA,KACC,gBAACC,EAAA,KAAWb,EAAQ,CACtB,CACF,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", "flush", "id", "domProps", "table", "attributes", "usePresentationTable", "pane", "usePane", "navigationRest", "reason", "useFrameRegistration", "elementRef", "composedRef", "useComposedRefs", "resize", "useResizablePane", "startAnchoredGrowth", "readBreakpoint", "handles", "content", "splitHandles", "SidebarHandle", "handle", "PaneResizeContext", "PaneHandle", "peekWidth", "initialSize", "useInitialPaneSize", "withoutRemovedPaneProps", "classNames", "paneAttributes", "PaneChromeScope", "PageScope"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{b as _}from"./chunk-MXEOE4LA.js";import*as n from"react";import{useLayoutEffect as me}from"radix-ui/internal";import ve from"classnames";var x=n.forwardRef(({className:d,children:m,...R},b)=>{let{containerRef:E,controls:ee,cssVarName:k,minSize:L,maxSize:g,defaultSize:A,startSize:te,orientation:v,edge:ne,growth:D,onResize:y,onResizeStart:q,onResizeEnd:z,snapPoints:T,snapTolerance:re,collapseThreshold:V,collapsible:F,target:j,requestCollapse:oe,requestToggle:B}=_(),S=n.useRef(null),ie=n.useCallback(e=>{S.current=e,typeof b=="function"?b(e):b&&(b.current=e)},[b]),M=n.useRef(null);n.useEffect(()=>()=>{M.current?.(),M.current=null},[]);let I=n.useCallback(()=>{let e=E.current;if(!e)return A;let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(k));return Number.isFinite(t)?t:A},[E,k,A]),K=n.useCallback(()=>{let e=E.current,t=S.current,r=e?.closest(".kui-ShellRoot")?.getBoundingClientRect();if(!e||!r||!t)return g;let c=e.getBoundingClientRect(),p=t.getBoundingClientRect(),s=D(getComputedStyle(e).direction==="rtl"),o;v==="vertical"?o=s>0?r.right-c.left:c.right-r.left:o=s>0?r.bottom-c.top:c.bottom-r.top;let H=v==="vertical"?p.width:p.height;return!(r.width>0&&r.height>0)||!Number.isFinite(o)?g:Math.max(L,Math.min(g,Math.round(o-H)))},[E,D,g,L,v]),ae=()=>{S.current?.setAttribute("aria-valuemax",String(K()))};me(()=>{S.current?.setAttribute("aria-valuenow",String(Math.round(I())))},[I]);let C=(e,t)=>{e.style.setProperty(k,`${t}px`),S.current?.setAttribute("aria-valuenow",String(Math.round(t)))},se=j.charAt(0).toUpperCase()+j.slice(1);return n.createElement("div",{ref:ie,className:ve("kui-ShellResizer",d),"data-orientation":v,"data-edge":ne,role:"separator",tabIndex:0,"aria-label":`Resize ${se} pane`,"aria-controls":ee,"aria-orientation":v,"aria-valuenow":Math.round(te),"aria-valuemin":L,"aria-valuemax":g,...R,onPointerDown:e=>{R.onPointerDown?.(e);let t=E.current;if(!t||e.defaultPrevented||e.button!==0)return;e.preventDefault();let r=e.currentTarget,c=e.pointerId;M.current?.();try{r.setPointerCapture(c)}catch{}let p=getComputedStyle(t),s=Number.parseFloat(p.getPropertyValue(k)),o=Number.isFinite(s)?s:A,H=v==="vertical"?e.clientX:e.clientY,le=D(p.direction==="rtl"),X=K();r.setAttribute("aria-valuemax",String(X));let Y=i=>Math.min(Math.max(i,L),X);t.setAttribute("data-resizing",""),r.setAttribute("data-dragging","");let h=document.body,ce=h.style.cursor,ue=h.style.userSelect;h.style.cursor=v==="vertical"?"col-resize":"row-resize",h.style.userSelect="none",q?.(o);let f=o,W=o,l=0,P=null,$=()=>{if(l=0,P===null)return;let i=P;P=null,y?.(i)},O=null,G=!1,de=(i,w)=>{if(i.type===w)G=!0;else if(G)return!1;return!0},u=i=>{if(!de(i,"pointermove")||i===O)return;O=i;let w=v==="vertical"?i.clientX:i.clientY;W=o+(w-H)*le,f=Y(W),C(t,f),P=f,l||(l=requestAnimationFrame($))},N=()=>{l&&cancelAnimationFrame(l),l=0;try{r.releasePointerCapture(c)}catch{}window.removeEventListener("pointermove",u),document.removeEventListener("pointermove",u),window.removeEventListener("mousemove",u),document.removeEventListener("mousemove",u),r.removeEventListener("pointermove",u),window.removeEventListener("pointerup",a),document.removeEventListener("pointerup",a),window.removeEventListener("mouseup",a),document.removeEventListener("mouseup",a),window.removeEventListener("pointercancel",a),document.removeEventListener("pointercancel",a),window.removeEventListener("keydown",J),r.removeEventListener("lostpointercapture",a),t.removeAttribute("data-resizing"),r.removeAttribute("data-dragging"),h.style.cursor=ce,h.style.userSelect=ue,M.current=null},U=!1,a=()=>{if(U)return;if(U=!0,l&&cancelAnimationFrame(l),$(),F&&typeof V=="number"&&W<=V){C(t,o),y?.(o),N(),oe?.(),z?.(o);return}let i=f;if(T&&T.length){let w=T.reduce((Q,Z)=>Math.abs(Z-f)<Math.abs(Q-f)?Z:Q,T[0]);Math.abs(w-f)<=re&&(i=Y(w),C(t,i),y?.(i))}z?.(i),N()},J=i=>{i.key==="Escape"&&(l&&cancelAnimationFrame(l),l=0,P=null,C(t,o),y?.(o),U=!0,z?.(o),N())};window.addEventListener("pointermove",u),document.addEventListener("pointermove",u),window.addEventListener("mousemove",u),document.addEventListener("mousemove",u),r.addEventListener("pointermove",u),window.addEventListener("pointerup",a),document.addEventListener("pointerup",a),window.addEventListener("mouseup",a),document.addEventListener("mouseup",a),window.addEventListener("pointercancel",a),document.addEventListener("pointercancel",a),window.addEventListener("keydown",J),r.addEventListener("lostpointercapture",a),M.current=N},onDoubleClick:e=>{R.onDoubleClick?.(e),!e.defaultPrevented&&F&&B?.()},onFocus:e=>{R.onFocus?.(e),ae()},onKeyDown:e=>{R.onKeyDown?.(e);let t=E.current;if(!t||e.defaultPrevented)return;if(e.key==="Enter"){F&&B&&(e.preventDefault(),B());return}let r=I(),c=K(),p=o=>Math.min(Math.max(o,L),c),s;if(e.key==="Home")s=p(L);else if(e.key==="End")s=p(c);else{let o=v==="vertical"?e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0:e.key==="ArrowDown"?1:e.key==="ArrowUp"?-1:0;if(o===0)return;let H=e.shiftKey?32:8;s=p(r+o*H*D(getComputedStyle(t).direction==="rtl"))}e.preventDefault(),q?.(r),C(t,s),y?.(s),z?.(s)}},m)});x.displayName="Shell.Handle";var pe=n.forwardRef((d,m)=>n.createElement(x,{...d,ref:m}));pe.displayName="Shell.Panel.Handle";var fe=n.forwardRef((d,m)=>n.createElement(x,{...d,ref:m}));fe.displayName="Shell.Sidebar.Handle";var Ee=n.forwardRef((d,m)=>n.createElement(x,{...d,ref:m}));Ee.displayName="Shell.Inspector.Handle";var Le=n.forwardRef((d,m)=>n.createElement(x,{...d,ref:m}));Le.displayName="Shell.Bottom.Handle";export{x as a,pe as b,fe as c,Ee as d,Le as e};
3
- //# sourceMappingURL=chunk-4OJRLS5N.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/_internal/shell-handles.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport classNames from 'classnames';\nimport { usePaneResize } from './shell-resize.js';\n\n/**\n * The resize handle: the WAI-ARIA window splitter. `role=\"separator\"` with a\n * value, focusable because it is operable, `aria-controls` naming its pane.\n *\n * A drag writes the size variable directly on the pane and sets no React\n * state, so nothing re-renders per move. `onResize` is called at most once per\n * animation frame, and once more with the final size when the drag ends. The\n * direction and the ceiling are read once, when the drag starts.\n */\nexport const PaneHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(({ className, children, ...props }, ref) => {\n const {\n containerRef,\n controls,\n cssVarName,\n minSize,\n maxSize,\n defaultSize,\n startSize,\n orientation,\n edge,\n growth,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n collapsible,\n target,\n requestCollapse,\n requestToggle,\n } = usePaneResize();\n\n const handleRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n handleRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n\n const activeCleanupRef = React.useRef<(() => void) | null>(null);\n React.useEffect(\n () => () => {\n activeCleanupRef.current?.();\n activeCleanupRef.current = null;\n },\n [],\n );\n\n /** The pane's size as the stylesheet sees it. Read at the edges of a gesture, never during one. */\n const readSize = React.useCallback(() => {\n const container = containerRef.current;\n if (!container) return defaultSize;\n const parsed = Number.parseFloat(getComputedStyle(container).getPropertyValue(cssVarName));\n return Number.isFinite(parsed) ? parsed : defaultSize;\n }, [containerRef, cssVarName, defaultSize]);\n\n /**\n * The largest size a resize may reach: the stated maximum, and never so\n * large that the handle leaves the frame. The room is measured from the\n * pane's anchored edge, which does not move, to the far edge of the frame,\n * so a pane that starts after a Rail has less room than the frame's width.\n * Without the cap a pane with a generous `maxSize` could be resized until\n * its own handle was off screen.\n */\n const ceiling = React.useCallback(() => {\n const container = containerRef.current;\n const handle = handleRef.current;\n const frame = container?.closest('.kui-ShellRoot')?.getBoundingClientRect();\n if (!container || !frame || !handle) return maxSize;\n const pane = container.getBoundingClientRect();\n const hitBox = handle.getBoundingClientRect();\n const sign = growth(getComputedStyle(container).direction === 'rtl');\n let room: number;\n if (orientation === 'vertical') room = sign > 0 ? frame.right - pane.left : pane.right - frame.left;\n else room = sign > 0 ? frame.bottom - pane.top : pane.bottom - frame.top;\n const hit = orientation === 'vertical' ? hitBox.width : hitBox.height;\n if (!(frame.width > 0 && frame.height > 0) || !Number.isFinite(room)) return maxSize;\n return Math.max(minSize, Math.min(maxSize, Math.round(room - hit)));\n }, [containerRef, growth, maxSize, minSize, orientation]);\n\n // The announced maximum is what a resize can reach now, not only the prop.\n const announceCeiling = () => {\n handleRef.current?.setAttribute('aria-valuemax', String(ceiling()));\n };\n\n // The announced value is seeded from the real size once the pane has a box.\n useLayoutEffect(() => {\n handleRef.current?.setAttribute('aria-valuenow', String(Math.round(readSize())));\n }, [readSize]);\n\n const write = (container: HTMLElement, size: number) => {\n container.style.setProperty(cssVarName, `${size}px`);\n handleRef.current?.setAttribute('aria-valuenow', String(Math.round(size)));\n };\n\n const targetLabel = target.charAt(0).toUpperCase() + target.slice(1);\n\n return (\n // A focusable separator with a value is the WAI-ARIA window splitter, an\n // interactive widget; jsx-a11y classes every separator as static.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <div\n ref={setRef}\n className={classNames('kui-ShellResizer', className)}\n data-orientation={orientation}\n data-edge={edge}\n role=\"separator\"\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n aria-label={`Resize ${targetLabel} pane`}\n aria-controls={controls}\n aria-orientation={orientation}\n // A focusable separator must state its value. The effects keep it current after mount.\n aria-valuenow={Math.round(startSize)}\n aria-valuemin={minSize}\n aria-valuemax={maxSize}\n {...props}\n onPointerDown={(e) => {\n props.onPointerDown?.(e);\n const container = containerRef.current;\n if (!container || e.defaultPrevented || e.button !== 0) return;\n e.preventDefault();\n const handleEl = e.currentTarget as HTMLElement;\n const pointerId = e.pointerId;\n activeCleanupRef.current?.();\n try {\n handleEl.setPointerCapture(pointerId);\n } catch {\n // Capture can fail for a pointer that is already gone; the window listeners below still carry the drag.\n }\n\n // Everything a move needs is read here, once.\n const startStyle = getComputedStyle(container);\n const parsedStart = Number.parseFloat(startStyle.getPropertyValue(cssVarName));\n const startSize = Number.isFinite(parsedStart) ? parsedStart : defaultSize;\n const startClient = orientation === 'vertical' ? e.clientX : e.clientY;\n const sign = growth(startStyle.direction === 'rtl');\n const cap = ceiling();\n handleEl.setAttribute('aria-valuemax', String(cap));\n const clamp = (v: number) => Math.min(Math.max(v, minSize), cap);\n\n container.setAttribute('data-resizing', '');\n handleEl.setAttribute('data-dragging', '');\n const body = document.body;\n const prevCursor = body.style.cursor;\n const prevUserSelect = body.style.userSelect;\n body.style.cursor = orientation === 'vertical' ? 'col-resize' : 'row-resize';\n body.style.userSelect = 'none';\n onResizeStart?.(startSize);\n\n let current = startSize;\n // The unclamped size, so `collapseThreshold` is compared before the\n // clamp: a threshold below `minSize` can then still collapse the pane.\n let raw = startSize;\n let frame = 0;\n let pending: number | null = null;\n const flush = () => {\n frame = 0;\n if (pending === null) return;\n const size = pending;\n pending = null;\n onResize?.(size);\n };\n\n // The move handler listens on the handle, the document and the window,\n // so a drag survives environments where pointer events do not reach\n // all three. One movement can therefore arrive several times: once per\n // node it propagates through, and again as the compatibility mouse\n // event. Only the first copy does any work.\n let lastHandledMove: Event | null = null;\n let seenPointerEvent = false;\n const shouldHandle = (ev: Event, pointerType: string) => {\n if (ev.type === pointerType) seenPointerEvent = true;\n else if (seenPointerEvent) return false;\n return true;\n };\n\n const handleMove = (ev: PointerEvent) => {\n if (!shouldHandle(ev, 'pointermove')) return;\n if (ev === lastHandledMove) return;\n lastHandledMove = ev;\n const client = orientation === 'vertical' ? ev.clientX : ev.clientY;\n raw = startSize + (client - startClient) * sign;\n current = clamp(raw);\n write(container, current);\n pending = current;\n if (!frame) frame = requestAnimationFrame(flush);\n };\n\n const cleanup = () => {\n if (frame) cancelAnimationFrame(frame);\n frame = 0;\n try {\n handleEl.releasePointerCapture(pointerId);\n } catch {\n // Already released.\n }\n window.removeEventListener('pointermove', handleMove as EventListener);\n document.removeEventListener('pointermove', handleMove as EventListener);\n window.removeEventListener('mousemove', handleMove as EventListener);\n document.removeEventListener('mousemove', handleMove as EventListener);\n handleEl.removeEventListener('pointermove', handleMove as EventListener);\n window.removeEventListener('pointerup', handleUp as EventListener);\n document.removeEventListener('pointerup', handleUp as EventListener);\n window.removeEventListener('mouseup', handleUp as EventListener);\n document.removeEventListener('mouseup', handleUp as EventListener);\n window.removeEventListener('pointercancel', handleUp as EventListener);\n document.removeEventListener('pointercancel', handleUp as EventListener);\n window.removeEventListener('keydown', handleKey as EventListener);\n handleEl.removeEventListener('lostpointercapture', handleUp as EventListener);\n container.removeAttribute('data-resizing');\n handleEl.removeAttribute('data-dragging');\n body.style.cursor = prevCursor;\n body.style.userSelect = prevUserSelect;\n activeCleanupRef.current = null;\n };\n\n let finished = false;\n const handleUp = () => {\n if (finished) return;\n finished = true;\n // The last move's size is delivered now rather than on the next frame.\n if (frame) cancelAnimationFrame(frame);\n flush();\n\n if (collapsible && typeof collapseThreshold === 'number' && raw <= collapseThreshold) {\n // A drag past the threshold closes the pane and keeps no size: the\n // pane opens again at the size it had before the drag. The drag\n // still ends, at that size, so a consumer that started something\n // in onResizeStart can stop it.\n write(container, startSize);\n onResize?.(startSize);\n cleanup();\n requestCollapse?.();\n onResizeEnd?.(startSize);\n return;\n }\n\n let settled = current;\n if (snapPoints && snapPoints.length) {\n const nearest = snapPoints.reduce((acc, p) => (Math.abs(p - current) < Math.abs(acc - current) ? p : acc), snapPoints[0]);\n if (Math.abs(nearest - current) <= snapTolerance) {\n settled = clamp(nearest);\n write(container, settled);\n onResize?.(settled);\n }\n }\n onResizeEnd?.(settled);\n cleanup();\n };\n\n const handleKey = (kev: KeyboardEvent) => {\n if (kev.key !== 'Escape') return;\n if (frame) cancelAnimationFrame(frame);\n frame = 0;\n pending = null;\n write(container, startSize);\n onResize?.(startSize);\n finished = true;\n onResizeEnd?.(startSize);\n cleanup();\n };\n\n window.addEventListener('pointermove', handleMove as EventListener);\n document.addEventListener('pointermove', handleMove as EventListener);\n window.addEventListener('mousemove', handleMove as EventListener);\n document.addEventListener('mousemove', handleMove as EventListener);\n handleEl.addEventListener('pointermove', handleMove as EventListener);\n window.addEventListener('pointerup', handleUp as EventListener);\n document.addEventListener('pointerup', handleUp as EventListener);\n window.addEventListener('mouseup', handleUp as EventListener);\n document.addEventListener('mouseup', handleUp as EventListener);\n window.addEventListener('pointercancel', handleUp as EventListener);\n document.addEventListener('pointercancel', handleUp as EventListener);\n window.addEventListener('keydown', handleKey as EventListener);\n handleEl.addEventListener('lostpointercapture', handleUp as EventListener);\n activeCleanupRef.current = cleanup;\n }}\n onDoubleClick={(e) => {\n props.onDoubleClick?.(e);\n if (!e.defaultPrevented && collapsible) requestToggle?.();\n }}\n onFocus={(e) => {\n props.onFocus?.(e);\n announceCeiling();\n }}\n onKeyDown={(e) => {\n props.onKeyDown?.(e);\n const container = containerRef.current;\n if (!container || e.defaultPrevented) return;\n // Enter collapses and restores the pane, as a double-click does (WAI-ARIA window splitter).\n if (e.key === 'Enter') {\n if (collapsible && requestToggle) {\n e.preventDefault();\n requestToggle();\n }\n return;\n }\n const current = readSize();\n // The keys reach as far as a drag does: the frame caps both.\n const cap = ceiling();\n const clamp = (v: number) => Math.min(Math.max(v, minSize), cap);\n let next: number | undefined;\n if (e.key === 'Home') next = clamp(minSize);\n else if (e.key === 'End') next = clamp(cap);\n else {\n // The key moves the boundary along its axis; the pane grows or\n // shrinks the way a drag in that direction would, so Bottom's\n // ArrowUp grows it and an end-anchored pane mirrors in RTL.\n const along = orientation === 'vertical' ? (e.key === 'ArrowRight' ? 1 : e.key === 'ArrowLeft' ? -1 : 0) : e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : 0;\n if (along === 0) return;\n const step = e.shiftKey ? 32 : 8;\n next = clamp(current + along * step * growth(getComputedStyle(container).direction === 'rtl'));\n }\n e.preventDefault();\n onResizeStart?.(current);\n write(container, next);\n onResize?.(next);\n onResizeEnd?.(next);\n }}\n >\n {children}\n </div>\n );\n});\nPaneHandle.displayName = 'Shell.Handle';\n\nexport const PanelHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nPanelHandle.displayName = 'Shell.Panel.Handle';\n\nexport const SidebarHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nSidebarHandle.displayName = 'Shell.Sidebar.Handle';\n\nexport const InspectorHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nInspectorHandle.displayName = 'Shell.Inspector.Handle';\n\nexport const BottomHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nBottomHandle.displayName = 'Shell.Bottom.Handle';\n"],
5
- "mappings": ";wCAAA,UAAYA,MAAW,QACvB,OAAS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Q,gBAACJ,EAAA,CAAY,GAAGG,EAAO,IAAKC,EAAK,CAAE,EACxJ8E,GAAc,YAAc,uBAErB,IAAMC,GAAwB,aAAkE,CAAChF,EAAOC,IAAQ,gBAACJ,EAAA,CAAY,GAAGG,EAAO,IAAKC,EAAK,CAAE,EAC1J+E,GAAgB,YAAc,yBAEvB,IAAMC,GAAqB,aAAkE,CAACjF,EAAOC,IAAQ,gBAACJ,EAAA,CAAY,GAAGG,EAAO,IAAKC,EAAK,CAAE,EACvJgF,GAAa,YAAc",
6
- "names": ["React", "useLayoutEffect", "classNames", "PaneHandle", "className", "children", "props", "ref", "containerRef", "controls", "cssVarName", "minSize", "maxSize", "defaultSize", "startSize", "orientation", "edge", "growth", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "collapsible", "target", "requestCollapse", "requestToggle", "usePaneResize", "handleRef", "setRef", "node", "activeCleanupRef", "readSize", "container", "parsed", "ceiling", "handle", "frame", "pane", "hitBox", "sign", "room", "hit", "announceCeiling", "useLayoutEffect", "write", "size", "targetLabel", "classNames", "handleEl", "pointerId", "startStyle", "parsedStart", "startClient", "cap", "clamp", "v", "body", "prevCursor", "prevUserSelect", "current", "raw", "pending", "flush", "lastHandledMove", "seenPointerEvent", "shouldHandle", "ev", "pointerType", "handleMove", "client", "cleanup", "handleUp", "handleKey", "finished", "settled", "nearest", "acc", "p", "kev", "next", "along", "step", "PanelHandle", "SidebarHandle", "InspectorHandle", "BottomHandle"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import*as t from"react";import{useLayoutEffect as g}from"radix-ui/internal";function q(e,s="horizontal"){if(e==null)return;if(typeof e=="number"&&Number.isFinite(e))return e;let i=String(e).trim();if(!i)return;if(i.endsWith("px"))return Number.parseFloat(i);if(i.endsWith("rem")){let u=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||"16")||16;return Number.parseFloat(i)*u}if(i.endsWith("%")){let u=Number.parseFloat(i),a=s==="horizontal"?document.documentElement.clientWidth||window.innerWidth||0:document.documentElement.clientHeight||window.innerHeight||0;return u/100*a}let c=Number.parseFloat(i);return Number.isFinite(c)?c:void 0}var S=(e,s,i)=>Math.max(s??e,Math.min(i??e,e));function H(e,s,i,c){let[u]=t.useState(()=>{let a=e??s;return typeof a=="number"&&Number.isFinite(a)?`${S(a,i,c)}px`:void 0});return u}function U(e){let{name:s,elementRef:i,cssVarName:c,orientation:u,minSize:a,maxSize:m,resizable:C,size:p,defaultSize:y,paneId:w,persistence:$}=e,o=t.useRef(e);g(()=>{o.current=e});let b=t.useRef(null),P=t.useRef(0);t.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]);let z=t.useCallback((n,r)=>{let{onSizeChange:l,sizeUpdate:d,sizeUpdateMs:h}=o.current;if(l){if(d==="debounce"){b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{b.current=null,o.current.onSizeChange?.(n,r)},h);return}if(d==="throttle"){let I=Date.now();if(I-P.current<h)return;P.current=I}l(n,r)}},[]),N=t.useCallback(n=>q(n,u==="vertical"?"horizontal":"vertical"),[u]),x=t.useRef(!1),f=t.useCallback((n,r)=>{let l=i.current;if(l){l.style.setProperty(c,`${n}px`);for(let d of l.querySelectorAll(":scope > .kui-ShellResizer"))d.setAttribute("aria-valuenow",String(Math.round(n)));r&&(x.current=!0)}},[i,c]);g(()=>{x.current||f(e.expandedSize,!1)},[e.expandedSize,f]),g(()=>{if(p!==void 0||y===void 0)return;let n=N(y);if(typeof n!="number"||!Number.isFinite(n))return;let r=S(n,a,m);f(r,!0),z(r,{reason:"init"})},[]),g(()=>{if(p===void 0||o.current.overlayingNow())return;let n=N(p);if(typeof n!="number"||!Number.isFinite(n))return;let r=S(n,a,m);f(r,!0),z(r,{reason:"controlled"})},[p,a,m,e.overlaying,N,f,z]);let T=$!==void 0,R=t.useMemo(()=>{if(T)return{load:()=>o.current.persistence?.load?.(),save:r=>o.current.persistence?.save?.(r)};if(!w)return;let n=`kookie-ui:shell:${s}:${w}`;return{load:()=>{if(!(typeof window>"u"))try{let r=window.localStorage.getItem(n);return r?Number(r):void 0}catch{return}},save:r=>{if(!(typeof window>"u"))try{window.localStorage.setItem(n,String(r))}catch{}}}},[s,w,T]);g(()=>{if(!C||!R?.load||o.current.overlayingNow())return;let n=!0,r=d=>{if(!n||typeof d!="number"||!Number.isFinite(d))return;let h=S(d,a,m);f(h,!0),o.current.onResize?.(h)},l=R.load();return l instanceof Promise?l.then(r).catch(d=>{}):r(l),()=>{n=!1}},[C,R,e.overlaying,f,a,m,s]);let[E]=t.useState(()=>{let n=p??y;return typeof n=="number"&&Number.isFinite(n)?S(n,a,m):e.expandedSize}),v=t.useCallback(n=>o.current.onResize?.(n),[]),k=t.useCallback(n=>{x.current=!0,o.current.onResizeStart?.(n)},[]),F=t.useCallback(n=>{o.current.onResizeEnd?.(n),z(n,{reason:"resize"}),R?.save?.(n)},[z,R]),M=t.useCallback(()=>o.current.requestCollapse(),[]),V=t.useCallback(()=>o.current.requestToggle(),[]);return t.useMemo(()=>({containerRef:i,controls:e.elementId,cssVarName:c,minSize:a,maxSize:m,defaultSize:e.expandedSize,startSize:E,orientation:u,edge:e.edge,growth:e.growth,onResize:v,onResizeStart:k,onResizeEnd:F,target:s,collapsible:e.collapsible,snapPoints:e.snapPoints,snapTolerance:e.snapTolerance??8,collapseThreshold:e.collapseThreshold,requestCollapse:M,requestToggle:V}),[i,e.elementId,c,a,m,e.expandedSize,E,u,e.edge,e.growth,v,k,F,s,e.collapsible,e.snapPoints,e.snapTolerance,e.collapseThreshold,M,V])}function j(e,s){let i=t.Children.toArray(e),c=i.filter(a=>t.isValidElement(a)&&a.type===s),u=i.filter(a=>!(t.isValidElement(a)&&a.type===s));return{handles:c,content:u}}export{H as a,U as b,j as c};
3
- //# sourceMappingURL=chunk-4TTRPCGG.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/_internal/shell-resizable.tsx", "../../src/helpers/normalize-to-px.ts"],
4
- "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\nimport type { PaneName, PaneSizePersistence } from '../shell.types.js';\nimport type { PaneResizeContextValue } from './shell-resize.js';\n\nexport type SizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\n\nexport type ResizableOptions = {\n name: PaneName;\n /** The pane's element id, which the handle names in `aria-controls`. */\n elementId: string;\n elementRef: React.RefObject<HTMLElement | null>;\n cssVarName: string;\n orientation: 'vertical' | 'horizontal';\n edge: 'start' | 'end';\n growth: (isRtl: boolean) => 1 | -1;\n expandedSize: number;\n minSize: number;\n maxSize: number;\n resizable: boolean;\n collapsible: boolean;\n size: number | string | undefined;\n defaultSize: number | string | undefined;\n onSizeChange: ((size: number, meta: SizeChangeMeta) => void) | undefined;\n sizeUpdate: 'throttle' | 'debounce' | undefined;\n sizeUpdateMs: number;\n onResize: ((size: number) => void) | undefined;\n onResizeStart: ((size: number) => void) | undefined;\n onResizeEnd: ((size: number) => void) | undefined;\n snapPoints: number[] | undefined;\n snapTolerance: number | undefined;\n collapseThreshold: number | undefined;\n paneId: string | undefined;\n persistence: PaneSizePersistence | undefined;\n /** Whether the pane is presented as an overlay right now. An overlay keeps its designed size and persists nothing. */\n overlaying: boolean;\n /** The same question asked at effect time, for a pane whose presentation is learnt after its first render. */\n overlayingNow: () => boolean;\n requestCollapse: () => void;\n requestToggle: () => void;\n};\n\n/**\n * Clamps to [min, max]. When the two cross (an app passing a maximum computed\n * from a narrow window below its fixed minimum), the minimum wins, as it did\n * in 0.7.\n */\nconst clampTo = (value: number, min: number | undefined, max: number | undefined) => Math.max(min ?? value, Math.min(max ?? value, value));\n\n/**\n * The pane's starting size for the first render, so the server HTML already has it and the first\n * paint is right. Only a number can be known before the pane exists (a percentage needs the\n * Shell's width); the effects below still own the size after mount.\n */\nexport function useInitialPaneSize(size: number | string | undefined, defaultSize: number | string | undefined, minSize: number, maxSize: number) {\n const [initial] = React.useState(() => {\n const value = size ?? defaultSize;\n return typeof value === 'number' && Number.isFinite(value) ? `${clampTo(value, minSize, maxSize)}px` : undefined;\n });\n return initial;\n}\n\n/** Everything a resizable pane shares: size props, persistence, and the handle's context. */\nexport function useResizablePane(options: ResizableOptions): PaneResizeContextValue {\n const { name, elementRef, cssVarName, orientation, minSize, maxSize, resizable, size, defaultSize, paneId, persistence } = options;\n\n // The latest callbacks, so the size emitter does not change identity when a\n // consumer passes an inline function. A controlled `size` is reported again\n // only when the size, the minimum or the maximum changes.\n const latest = React.useRef(options);\n useLayoutEffect(() => {\n latest.current = options;\n });\n\n const debounceRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const throttleRef = React.useRef(0);\n React.useEffect(\n () => () => {\n if (debounceRef.current) clearTimeout(debounceRef.current);\n },\n [],\n );\n const emitSizeChange = React.useCallback((value: number, meta: SizeChangeMeta) => {\n const { onSizeChange, sizeUpdate, sizeUpdateMs } = latest.current;\n if (!onSizeChange) return;\n if (sizeUpdate === 'debounce') {\n if (debounceRef.current) clearTimeout(debounceRef.current);\n debounceRef.current = setTimeout(() => {\n debounceRef.current = null;\n latest.current.onSizeChange?.(value, meta);\n }, sizeUpdateMs);\n return;\n }\n if (sizeUpdate === 'throttle') {\n const now = Date.now();\n if (now - throttleRef.current < sizeUpdateMs) return;\n throttleRef.current = now;\n }\n onSizeChange(value, meta);\n }, []);\n\n const toPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, orientation === 'vertical' ? 'horizontal' : 'vertical'), [orientation]);\n\n /**\n * The one way a size reaches the pane: the size variable, and the value\n * every handle of this pane announces. Once anything but `expandedSize` has\n * written a size (a default, a controlled value, a persisted value or a\n * resize), the pane owns that size and a new `expandedSize` leaves it alone.\n */\n const ownedRef = React.useRef(false);\n const writeSize = React.useCallback(\n (value: number, own: boolean) => {\n const el = elementRef.current;\n if (!el) return;\n el.style.setProperty(cssVarName, `${value}px`);\n for (const handle of el.querySelectorAll(':scope > .kui-ShellResizer')) handle.setAttribute('aria-valuenow', String(Math.round(value)));\n if (own) ownedRef.current = true;\n },\n [elementRef, cssVarName],\n );\n\n // expandedSize: the size until something else sets one. Declared first, so\n // the effects below win on mount.\n useLayoutEffect(() => {\n if (!ownedRef.current) writeSize(options.expandedSize, false);\n }, [options.expandedSize, writeSize]);\n\n // defaultSize: applied once, on mount.\n useLayoutEffect(() => {\n if (size !== undefined || defaultSize === undefined) return;\n const px = toPx(defaultSize);\n if (typeof px !== 'number' || !Number.isFinite(px)) return;\n const clamped = clampTo(px, minSize, maxSize);\n writeSize(clamped, true);\n emitSizeChange(clamped, { reason: 'init' });\n // An uncontrolled initial value: applied on mount and never re-applied.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size. A drag stands until the app passes a different value.\n // Not while the pane is an overlay: an overlay keeps its designed size, and\n // an app's frame-sized limits (a maximum taken from the window) would\n // otherwise squeeze the drawer and report the squeezed size back. The size\n // is applied again when the pane returns to the frame.\n useLayoutEffect(() => {\n if (size === undefined || latest.current.overlayingNow()) return;\n const px = toPx(size);\n if (typeof px !== 'number' || !Number.isFinite(px)) return;\n const clamped = clampTo(px, minSize, maxSize);\n writeSize(clamped, true);\n emitSizeChange(clamped, { reason: 'controlled' });\n }, [size, minSize, maxSize, options.overlaying, toPx, writeSize, emitSizeChange]);\n\n // A persistence adapter from `paneId` when none is given. A given one is read through\n // `latest`, so an inline object (the documented shape) does not reload the size every render.\n const hasPersistence = persistence !== undefined;\n const adapter = React.useMemo<PaneSizePersistence | undefined>(() => {\n if (hasPersistence) {\n return {\n load: () => latest.current.persistence?.load?.(),\n save: (value: number) => latest.current.persistence?.save?.(value),\n };\n }\n if (!paneId) return undefined;\n const key = `kookie-ui:shell:${name}:${paneId}`;\n return {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const stored = window.localStorage.getItem(key);\n return stored ? Number(stored) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') console.warn(`Shell.${name}: failed to load persisted size`, err);\n return undefined;\n }\n },\n save: (value: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(value));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') console.warn(`Shell.${name}: failed to save persisted size`, err);\n }\n },\n };\n }, [name, paneId, hasPersistence]);\n\n // Persisted size, loaded in a layout effect and clamped, so a reload does\n // not paint the default and then jump. Only where the pane is in the frame:\n // an overlay keeps its designed size.\n useLayoutEffect(() => {\n if (!resizable || !adapter?.load || latest.current.overlayingNow()) return undefined;\n let mounted = true;\n const apply = (value: number | undefined) => {\n if (!mounted || typeof value !== 'number' || !Number.isFinite(value)) return;\n const clamped = clampTo(value, minSize, maxSize);\n writeSize(clamped, true);\n latest.current.onResize?.(clamped);\n };\n const loaded = adapter.load();\n if (loaded instanceof Promise) {\n loaded.then(apply).catch((err) => {\n if (process.env.NODE_ENV !== 'production') console.warn(`Shell.${name}: failed to load persisted size`, err);\n });\n } else {\n apply(loaded);\n }\n return () => {\n mounted = false;\n };\n }, [resizable, adapter, options.overlaying, writeSize, minSize, maxSize, name]);\n\n // What the handle announces before any effect has run: the same starting size the pane's\n // first render uses, so the server HTML already states a value.\n const [startSize] = React.useState(() => {\n const value = size ?? defaultSize;\n return typeof value === 'number' && Number.isFinite(value) ? clampTo(value, minSize, maxSize) : options.expandedSize;\n });\n\n const onResize = React.useCallback((value: number) => latest.current.onResize?.(value), []);\n const onResizeStart = React.useCallback((value: number) => {\n // A resize makes the size the user's: a new expandedSize no longer moves it.\n ownedRef.current = true;\n latest.current.onResizeStart?.(value);\n }, []);\n const onResizeEnd = React.useCallback(\n (value: number) => {\n latest.current.onResizeEnd?.(value);\n emitSizeChange(value, { reason: 'resize' });\n adapter?.save?.(value);\n },\n [emitSizeChange, adapter],\n );\n const requestCollapse = React.useCallback(() => latest.current.requestCollapse(), []);\n const requestToggle = React.useCallback(() => latest.current.requestToggle(), []);\n\n return React.useMemo(\n () => ({\n containerRef: elementRef,\n controls: options.elementId,\n cssVarName,\n minSize,\n maxSize,\n defaultSize: options.expandedSize,\n startSize,\n orientation,\n edge: options.edge,\n growth: options.growth,\n onResize,\n onResizeStart,\n onResizeEnd,\n target: name,\n collapsible: options.collapsible,\n snapPoints: options.snapPoints,\n snapTolerance: options.snapTolerance ?? 8,\n collapseThreshold: options.collapseThreshold,\n requestCollapse,\n requestToggle,\n }),\n [\n elementRef,\n options.elementId,\n cssVarName,\n minSize,\n maxSize,\n options.expandedSize,\n startSize,\n orientation,\n options.edge,\n options.growth,\n onResize,\n onResizeStart,\n onResizeEnd,\n name,\n options.collapsible,\n options.snapPoints,\n options.snapTolerance,\n options.collapseThreshold,\n requestCollapse,\n requestToggle,\n ],\n );\n}\n\n/** Splits a pane's children into its handles and the rest. */\nexport function splitHandles(children: React.ReactNode, handleType: React.ElementType) {\n const all = React.Children.toArray(children);\n const handles = all.filter((el) => React.isValidElement(el) && el.type === handleType) as React.ReactElement[];\n const content = all.filter((el) => !(React.isValidElement(el) && el.type === handleType));\n return { handles, content };\n}\n", "/**\n * Normalize CSS length values to pixels.\n * Supports: px, rem, %, and bare numbers.\n *\n * @param value - The value to normalize (number, string, or undefined)\n * @param orientation - 'horizontal' for width-based % or 'vertical' for height-based %\n * @returns The value in pixels, or undefined if invalid\n */\nexport function normalizeToPx(\n value: number | string | undefined,\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n): number | undefined {\n if (value == null) return undefined;\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n\n const str = String(value).trim();\n if (!str) return undefined;\n\n // px: direct parse\n if (str.endsWith('px')) return Number.parseFloat(str);\n\n // rem: multiply by root font size\n if (str.endsWith('rem')) {\n const rem = Number.parseFloat(getComputedStyle(document.documentElement).fontSize || '16') || 16;\n return Number.parseFloat(str) * rem;\n }\n\n // %: calculate based on viewport dimension\n if (str.endsWith('%')) {\n const pct = Number.parseFloat(str);\n const base =\n orientation === 'horizontal'\n ? document.documentElement.clientWidth || window.innerWidth || 0\n : document.documentElement.clientHeight || window.innerHeight || 0;\n return (pct / 100) * base;\n }\n\n // Bare number-like string\n const n = Number.parseFloat(str);\n return Number.isFinite(n) ? n : undefined;\n}\n\n"],
5
- "mappings": ";AAEA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,MAAuB,oBCKzB,SAASC,EACdC,EACAC,EAAyC,aACrB,CACpB,GAAID,GAAS,KAAM,OACnB,GAAI,OAAOA,GAAU,UAAY,OAAO,SAASA,CAAK,EAAG,OAAOA,EAEhE,IAAME,EAAM,OAAOF,CAAK,EAAE,KAAK,EAC/B,GAAI,CAACE,EAAK,OAGV,GAAIA,EAAI,SAAS,IAAI,EAAG,OAAO,OAAO,WAAWA,CAAG,EAGpD,GAAIA,EAAI,SAAS,KAAK,EAAG,CACvB,IAAMC,EAAM,OAAO,WAAW,iBAAiB,SAAS,eAAe,EAAE,UAAY,IAAI,GAAK,GAC9F,OAAO,OAAO,WAAWD,CAAG,EAAIC,CAClC,CAGA,GAAID,EAAI,SAAS,GAAG,EAAG,CACrB,IAAME,EAAM,OAAO,WAAWF,CAAG,EAC3BG,EACJJ,IAAgB,aACZ,SAAS,gBAAgB,aAAe,OAAO,YAAc,EAC7D,SAAS,gBAAgB,cAAgB,OAAO,aAAe,EACrE,OAAQG,EAAM,IAAOC,CACvB,CAGA,IAAMC,EAAI,OAAO,WAAWJ,CAAG,EAC/B,OAAO,OAAO,SAASI,CAAC,EAAIA,EAAI,MAClC,CDUA,IAAMC,EAAU,CAACC,EAAeC,EAAyBC,IAA4B,KAAK,IAAID,GAAOD,EAAO,KAAK,IAAIE,GAAOF,EAAOA,CAAK,CAAC,EAOlI,SAASG,EAAmBC,EAAmCC,EAA0CC,EAAiBC,EAAiB,CAChJ,GAAM,CAACC,CAAO,EAAU,WAAS,IAAM,CACrC,IAAMR,EAAQI,GAAQC,EACtB,OAAO,OAAOL,GAAU,UAAY,OAAO,SAASA,CAAK,EAAI,GAAGD,EAAQC,EAAOM,EAASC,CAAO,CAAC,K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AAAC,CAAQ,CAC5B",
6
- "names": ["React", "useLayoutEffect", "normalizeToPx", "value", "orientation", "str", "rem", "pct", "base", "n", "clampTo", "value", "min", "max", "useInitialPaneSize", "size", "defaultSize", "minSize", "maxSize", "initial", "useResizablePane", "options", "name", "elementRef", "cssVarName", "orientation", "resizable", "paneId", "persistence", "latest", "useLayoutEffect", "debounceRef", "throttleRef", "emitSizeChange", "meta", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "now", "toPx", "normalizeToPx", "ownedRef", "writeSize", "own", "el", "handle", "px", "clamped", "hasPersistence", "adapter", "key", "stored", "mounted", "apply", "loaded", "err", "startSize", "onResize", "onResizeStart", "onResizeEnd", "requestCollapse", "requestToggle", "splitHandles", "children", "handleType", "all", "handles", "content"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{b as a}from"./chunk-MAA6LEE2.js";import*as o from"react";import{useLayoutEffect as p}from"radix-ui/internal";function s(e){return typeof e=="object"&&e!==null}function f(e,n){let t={},r=null;for(let i of a){if(e!==void 0&&!s(e)){t[i]=e;continue}let l=s(e)?e[i]:void 0;l!==void 0&&(r={value:l}),t[i]=r?r.value:n(i)}return t}function d(e){let n=e.initial;return a.every(t=>e[t]===n)?n:void 0}function P(e,n){let t=d(n);if(t!==void 0)return{[`data-${e}`]:t};let r={};for(let i of a)r[`data-${e}-${i}`]=n[i];return r}function T(e){return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}var g=f("fixed",()=>"fixed");function R(){return{entries:new Map,listeners:new Set,version:0,peek:null}}function S(e){e.version+=1;for(let n of e.listeners)n()}function c(e,n){return e.listeners.add(n),()=>{e.listeners.delete(n)}}function y(e,n){e.peek!==n&&(e.peek=n,S(e))}var b=o.createContext(null);function k(e){let n=o.useContext(b);if(!n)throw new Error(`${e} must be used within <Shell.Root>`);return n}function v(e,n){let t=o.useCallback(i=>c(e,i),[e]),r=o.useCallback(()=>e.entries.get(n),[e,n]);return o.useSyncExternalStore(t,r,()=>{})}function E(e,n){let t=o.useCallback(r=>c(e,r),[e]);return o.useSyncExternalStore(t,()=>e.peek===n,()=>!1)}var x=o.createContext(null);function w(e,n){let t=o.useContext(x);if(!t)throw new Error("Shell panes must be used within <Shell.Root>");let{registerOffFrame:r,unregisterOffFrame:i}=t;p(()=>{if(!n)return r(e),()=>i(e)},[e,n,r,i])}var u=new Set;function O(e){}export{f as a,d as b,P as c,T as d,g as e,R as f,S as g,c as h,y as i,b as j,k,v as l,E as m,x as n,w as o,O as p};
3
- //# sourceMappingURL=chunk-5BXCPANF.js.map
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{b as t}from"./chunk-G66WDIIV.js";import{a as n}from"./chunk-5BXCPANF.js";import*as s from"react";function p(e){s.useEffect(()=>{},[]);let{breakpoint:o}=t(typeof e!="string");return n(e,()=>"fixed")[o]}export{p as a};
3
- //# sourceMappingURL=chunk-B447PNRD.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/shell.hooks.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { useBreakpoint } from '../hooks/use-breakpoint.js';\nimport type { PresentationValue, ResponsivePresentation } from './shell.types.js';\nimport { tableOf, warnOnce } from './_internal/shell-store.js';\n\n/**\n * @deprecated Since 0.8.0 the Shell resolves a responsive `presentation` in\n * its stylesheet, so the pane is placed before any script runs. This hook\n * resolves it in JS after mount, which is the behaviour the Shell left\n * behind. It keeps working until 1.0.\n */\nfunction useResponsivePresentation(presentation: ResponsivePresentation): PresentationValue {\n React.useEffect(() => {\n warnOnce('Shell.useResponsivePresentation is deprecated and is removed in 1.0. The Shell resolves presentation in CSS.');\n }, []);\n const { breakpoint } = useBreakpoint(typeof presentation !== 'string');\n return tableOf<PresentationValue>(presentation, () => 'fixed')[breakpoint];\n}\n\nexport { useResponsivePresentation };\n"],
5
- "mappings": ";gFAAA,UAAYA,MAAW,QAWvB,SAASC,EAA0BC,EAAyD,CACpF,YAAU,IAAM,CAEtB,EAAG,CAAC,CAAC,EACL,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAc,OAAOF,GAAiB,QAAQ,EACrE,OAAOG,EAA2BH,EAAc,IAAM,OAAO,EAAEC,CAAU,CAC3E",
6
- "names": ["React", "useResponsivePresentation", "presentation", "breakpoint", "useBreakpoint", "tableOf"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as Ye,b as Xe}from"./chunk-TS4QCDSI.js";import{a as Je}from"./chunk-B447PNRD.js";import{a as Ge}from"./chunk-2WFN4D52.js";import{a as Ke}from"./chunk-M26LLCQC.js";import{a as je}from"./chunk-HQT32HQ6.js";import{a as J,b as _e,c as Ue,d as qe,g as $e}from"./chunk-XUCR7L4G.js";import{a as Ie,b as Pe}from"./chunk-4OJRLS5N.js";import{a as he,b as ve,c as Se}from"./chunk-KGCGT4MJ.js";import{a as Be,b as Ve,c as We}from"./chunk-4TTRPCGG.js";import{a as De}from"./chunk-MXEOE4LA.js";import{b as ye}from"./chunk-5ON3XLRD.js";import{a as Le}from"./chunk-G66WDIIV.js";import{b as ie}from"./chunk-VWRPVM5K.js";import{c as pe,d as fe,e as Fe,f as me,i as Ae,j as Ne,k as Oe}from"./chunk-PMXIQ5B4.js";import{c as ke,d as we}from"./chunk-QEDKL23P.js";import{e as ce,f as Me,h as ze,i as ne,j as He,k as ue,l as de,n as xe,o as oe}from"./chunk-5BXCPANF.js";import{a as Te}from"./chunk-ANQLWGFN.js";import{a as it}from"./chunk-VQPANPMI.js";var ht={};it(ht,{Bottom:()=>Ke,Content:()=>rt,Header:()=>ot,Inspector:()=>je,Left:()=>lt,PaneFooter:()=>Ne,PaneHeader:()=>Ae,Panel:()=>Ee,Rail:()=>at,Root:()=>nt,Scroll:()=>Oe,Sidebar:()=>Ge,Trigger:()=>st,useResponsivePresentation:()=>Je,useShell:()=>Xe,useSidebarMode:()=>Ye});import*as e from"react";import $ from"classnames";import{Slot as ct}from"radix-ui";import{useComposedRefs as Ce,useLayoutEffect as ut}from"radix-ui/internal";var Re=0;function Qe(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 ge="data-kui-shell-inert",dt=30;function Q(a,r){return r===null||r===a||r===a.body||r===a.documentElement}function Ze(a,r,s){for(let d of a.querySelectorAll("[data-shell-trigger][aria-controls]"))if(!(d.getAttribute("aria-controls")!==r||d.closest("[inert]"))&&!(s&&!s.some(S=>S.contains(d))))return d;return null}var pt={values:["1","2","3"]},tt=e.createContext(null),et=64;function be(a){return a.querySelector(":scope > .kui-ShellContent > .kui-ShellScroll > .kui-ScrollAreaViewport")??a.querySelector(":scope > .kui-ShellContent")}var nt=e.forwardRef(({className:a,children:r,height:s="full",contained:d,size:S,style:x,onKeyDown:g,onFocus:k,...w},L)=>{let P=ye(S,pt),[i]=e.useState(Me),C=e.useCallback(t=>ze(i,t),[i]);e.useSyncExternalStore(C,()=>i.version,()=>0);let R=e.useRef(null),I=Ce(L,R),[T,F]=e.useState(()=>new Set),A=e.useCallback(t=>{F(n=>n.has(t)?n:new Set(n).add(t))},[]),f=e.useCallback(t=>{F(n=>{if(!n.has(t))return n;let o=new Set(n);return o.delete(t),o})},[]),m=e.useMemo(()=>({registerOffFrame:A,unregisterOffFrame:f}),[A,f]),N=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]),E=[...i.entries.values()].filter(t=>t.overlayLive&&t.el).length,O=d===!0||s!=="full"&&s!=="auto",V=!O&&s==="full",[Z,le]=e.useState(void 0);e.useEffect(()=>{if(!V)return;let t=R.current,n=t?.ownerDocument.defaultView;if(!t||!n||typeof n.matchMedia!="function")return;let o=ke(),c=o?n.scrollY:be(t)?.scrollTop??0,h=0,v=0,y=()=>{v&&cancelAnimationFrame(v),v=requestAnimationFrame(()=>{v=0})},U=()=>{o&&!v&&(c=n.scrollY)},q=l=>{!o&&!v&&l.target instanceof HTMLElement&&l.target===be(t)&&(c=l.target.scrollTop)};n.addEventListener("resize",y),n.addEventListener("scroll",U,{passive:!0}),t.addEventListener("scroll",q,{passive:!0,capture:!0});let se=we(l=>{o=l;let u=c;h&&cancelAnimationFrame(h),h=requestAnimationFrame(()=>{if(h=0,l)n.scrollTo(0,u);else{let p=be(t);p&&(p.scrollTop=u)}})});return()=>{h&&cancelAnimationFrame(h),v&&cancelAnimationFrame(v),n.removeEventListener("resize",y),n.removeEventListener("scroll",U),t.removeEventListener("scroll",q,{capture:!0}),se()}},[V]);let K=e.useCallback(()=>{let t=R.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(ge)&&(o.removeAttribute(ge),o.inert=!1):o.inert||(o.setAttribute(ge,""),o.inert=!0)}},[M]),j=e.useRef(null),G=e.useRef([]),ee=e.useRef(null),D=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(),D.current&&(D.current=!1,Qe(-1))},[W]),e.useEffect(()=>{let t=R.current;if(!t)return;let n=t.ownerDocument,o=M(),c=o.map(l=>l.el),h=!O&&o.length>0;h!==D.current&&(D.current=h,Qe(h?1:-1));let v=G.current;G.current=o;let y=v.filter(l=>{if(c.includes(l.el))return!1;let u=i.entries.get(l.name);return!l.el.isConnected||!u||u.el!==l.el||u.value==="closed"}),U=l=>l!==null&&y.some(u=>u.el.contains(l));if(v.length===0&&o.length>0){let l=n.activeElement,u=l instanceof HTMLElement&&!Q(n,l)&&!c.some(p=>p.contains(l))?l:null;if(u&&!t.contains(u)){let p=ee.current;p&&p.isConnected&&!c.some(te=>te.contains(p))&&(u=p)}j.current=u}if(K(),o.length===0){let l=j.current;if(j.current=null,y.length===0)return;let p=(H=>H!==null&&H.isConnected&&!H.closest("[inert]")&&!U(H))(l)?l:null;for(let H of y)p??(p=Ze(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(y.length>0){let l=n.activeElement;if(Q(n,l)||U(l)){let u=null;for(let p of y)u??(u=Ze(n,p.id,c));(u??c[c.length-1]).focus({preventScroll:!0})}}let q=c.filter(l=>!v.some(u=>u.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=R.current;if(!t||E===0||typeof MutationObserver>"u")return;let n=new MutationObserver(K);return n.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]}),()=>n.disconnect()},[E,K]);let Y=t=>{g?.(t),!(t.key!=="Escape"||t.defaultPrevented||E===0)&&(N(),t.stopPropagation())};e.useEffect(()=>{let t=R.current;if(!t||E===0)return;let n=t.ownerDocument,o=c=>{c.key!=="Escape"||c.defaultPrevented||!Q(n,c.target)||N()};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)},[E,N]);let ae=t=>{k?.(t),t.target instanceof HTMLElement&&R.current?.contains(t.target)&&(ee.current=t.target)},B=i.entries.get("rail"),X=B!==void 0&&B.value!==void 0&&B.value!=="closed"?T.has("rail")?`calc(${B.size}px + 2 * var(--shell-gap))`:`${B.size}px`:void 0,re=s==="full"?{}:s==="auto"?{height:"auto"}:typeof s=="number"?{height:`${s}px`}:{height:s};return e.createElement(He.Provider,{value:i},e.createElement(pe.Provider,{value:P},e.createElement(fe.Provider,{value:!1},e.createElement(Fe.Provider,{value:V},e.createElement(tt.Provider,{value:le},e.createElement(xe.Provider,{value:m},e.createElement(Te.Provider,{value:void 0},e.createElement("div",{...w,ref:I,className:$("kui-ShellRoot",a),"data-height":s==="auto"&&!O?"auto":void 0,"data-contained":O||void 0,"data-window":V||void 0,"data-overlay-live":E>0||void 0,onKeyDown:Y,onFocus:ae,style:{...re,...X?{"--shell-rail-offset":X}:{},...Z!==void 0?{"--kui-shell-header-h":`${Z}px`}:{},...x}},r,e.createElement("div",{className:"kui-ShellScrim","aria-hidden":!0,onClick:N})))))))))});nt.displayName="Shell.Root";var ot=e.forwardRef(({className:a,height:r=et,flush:s=!0,style:d,...S},x)=>{let g=e.useContext(tt);return ut(()=>{if(g)return g(r===et?void 0:r),()=>g(void 0)},[g,r]),e.createElement("header",{...S,ref:x,className:$("kui-ShellHeader",a),"data-flush":s||void 0,style:{...d,"--shell-header-height":`${r}px`}})});ot.displayName="Shell.Header";var lt=e.forwardRef(({children:a},r)=>(e.useEffect(()=>{},[]),e.createElement(e.Fragment,null,a)));lt.displayName="Shell.Left";var ft={controlled:"open",default:"defaultOpen"},at=e.forwardRef((a,r)=>{let{className:s,presentation:d,expandedSize:S=64,collapsible:x,onExpand:g,onCollapse:k,children:w,style:L,open:P,defaultOpen:i,onOpenChange:C,flush:R=!0,id:I,...T}=a,{table:F,attributes:A}=Se(d,"fixed"),f=he({name:"rail",label:"Rail",propNames:ft,id:I,controlled:J(P),defaultValue:J(i),presentationTable:F,builtIn:_e,onChange:(N,M)=>C?.(N!=="closed",{reason:M}),onExpand:g,onCollapse:k,size:S});oe("rail",R);let m=Ce(r,f.setElement);return e.createElement("div",{...T,role:T.role??"navigation",id:f.id,ref:m,className:$("kui-ShellPane","kui-ShellRail",s),...ve(f,A),"data-flush":R||void 0,tabIndex:f.overlaying?-1:T.tabIndex,style:{...L,"--rail-size":`${S}px`}},e.createElement(mt,null,w))});at.displayName="Shell.Rail";function mt({children:a}){let r=e.useContext(pe);return e.createElement("div",{className:$("kui-ShellRailContent",`kui-r-size-${r}`)},e.createElement(me,{presentation:"thin"},a))}var Pt={controlled:"open",default:"defaultOpen"},Ee=e.forwardRef((a,r)=>{let{className:s,presentation:d,defaultOpen:S,open:x,onOpenChange:g,size:k,defaultSize:w,expandedSize:L=288,minSize:P=100,maxSize:i=800,resizable:C=!1,collapsible:R=!0,onExpand:I,onCollapse:T,onResize:F,onResizeStart:A,onResizeEnd:f,snapPoints:m,snapTolerance:N,collapseThreshold:M,paneId:E,persistence:O,children:V,style:Z,onSizeChange:le,sizeUpdate:K,sizeUpdateMs:j=50,flush:G=!0,id:ee,...D}=a,z=ue("Shell.Panel"),W=de(z,"rail"),_=Se(d,"fixed"),Y=d===void 0,ae=Y?W?.presentationTable??ce:_.table,B=Y?{"data-presentation-follows":""}:_.attributes,b=he({name:"panel",label:"Panel",propNames:Pt,id:ee,controlled:J(x),defaultValue:J(S),presentationTable:ae,builtIn:Ue,onChange:(v,y)=>g?.(v!=="closed",{reason:y}),onExpand:I,onCollapse:T,size:L});oe("panel",G),e.useEffect(()=>{(m!==void 0||M!==void 0||E!==void 0||O!==void 0)&&void 0},[m,M,E,O]);let X=e.useRef(null),re=Ce(r,b.setElement,X),t=Ve({name:"panel",elementId:b.id,elementRef:X,cssVarName:"--panel-size",orientation:"vertical",edge:"end",growth:qe,expandedSize:L,minSize:P,maxSize:i,resizable:C,collapsible:R,size:k,defaultSize:w,onSizeChange:le,sizeUpdate:K,sizeUpdateMs:j,onResize:F,onResizeStart:A,onResizeEnd:f,snapPoints:m,snapTolerance:N,collapseThreshold:M,paneId:E,persistence:O,overlaying:b.overlaying,overlayingNow:()=>(Y?z.entries.get("rail")?.presentationTable??ce:_.table)[Le()]==="overlay",requestCollapse:()=>b.setValue("closed","toggle"),requestToggle:()=>b.toggle("toggle")}),n=Be(k,w,P,i),{handles:o,content:c}=We(V,Pe),h=C&&b.shown!==!1&&!b.overlaying?e.createElement(De.Provider,{value:t},o.length>0?o:e.createElement(Ie,null)):null;return e.createElement("div",{...$e(D),role:D.role??"navigation",id:b.id,ref:re,className:$("kui-ShellPane","kui-ShellPanel",s),...ve(b,B),"data-flush":G||void 0,tabIndex:b.overlaying?-1:D.tabIndex,style:{...Z,"--panel-expanded-size":`${L}px`,...n?{"--panel-size":n}:{}}},e.createElement("div",{className:"kui-ShellPanelContent"},e.createElement(me,null,e.createElement(ie,null,c))),h)});Ee.displayName="Shell.Panel";Ee.Handle=Pe;var rt=e.forwardRef(({className:a,flush:r=!0,children:s,...d},S)=>(oe("content",r),e.createElement("main",{...d,ref:S,className:$("kui-ShellContent",a),"data-flush":r||void 0},e.createElement(fe.Provider,{value:!0},e.createElement(ie,null,s)))));rt.displayName="Shell.Content";var st=e.forwardRef(({target:a,action:r="toggle",peekOnHover:s,asChild:d=!1,onClick:S,onMouseEnter:x,onMouseLeave:g,children:k,...w},L)=>{let P=ue("Shell.Trigger");e.useEffect(()=>{a==="left"&&void 0,s&&void 0},[a,s]);let i=a==="left"?"rail":a,C=de(P,i),R=C?.value===void 0?void 0:C.value!=="closed",I=f=>{if(S?.(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"))},T=f=>{if(x?.(f),!s)return;let m=P.entries.get(i);m&&m.value==="closed"&&m.presentation!=="overlay"&&ne(P,i)},F=f=>{g?.(f),s&&P.peek===i&&ne(P,null)},A=d?ct.Root:"button";return e.createElement(A,{...!d&&{type:"button"},"aria-controls":C?.id,"aria-expanded":R,...w,ref:L,onClick:I,onMouseEnter:T,onMouseLeave:F,"data-shell-trigger":a,"data-shell-action":r},k)});st.displayName="Shell.Trigger";export{nt as a,ot as b,lt as c,at as d,Ee as e,rt as f,st as g,ht as h};
3
- //# sourceMappingURL=chunk-BJVXB3PN.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 ShellFrameContext,\n ShellStoreContext,\n createShellStore,\n setShellPeek,\n subscribeShellStore,\n useFrameRegistration,\n usePaneEntry,\n useShellStore,\n warnOnce,\n type FramePaneId,\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 { PageScope } from './_internal/page-scope.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 // The panes pulled off the frame (`flush={false}`). Only the Rail's is read, for the offset below.\n const [offFrame, setOffFrame] = React.useState<ReadonlySet<FramePaneId>>(() => new Set());\n const registerOffFrame = React.useCallback((id: FramePaneId) => {\n setOffFrame((prev) => (prev.has(id) ? prev : new Set(prev).add(id)));\n }, []);\n const unregisterOffFrame = React.useCallback((id: FramePaneId) => {\n setOffFrame((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 frameContext = React.useMemo(() => ({ registerOffFrame, unregisterOffFrame }), [registerOffFrame, unregisterOffFrame]);\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 off the frame.\n const rail = store.entries.get('rail');\n const railShown = rail !== undefined && rail.value !== undefined && rail.value !== 'closed';\n const railOffset = railShown ? (offFrame.has('rail') ? `calc(${rail.size}px + 2 * var(--shell-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 <ShellFrameContext.Provider value={frameContext}>\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-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 </ShellFrameContext.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 * Sets whether the header joins the app frame. The default is `true`: a hairline under it. Set\n * `flush={false}` to make it a card off the frame.\n */\n flush?: boolean;\n}\n\nconst Header = React.forwardRef<HTMLElement, ShellHeaderProps>(({ className, height = DEFAULT_HEADER_HEIGHT, flush = true, 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 data-flush={flush || undefined}\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}\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 /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n} & (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, flush = true, 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 useFrameRegistration('rail', flush);\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-flush={flush || 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 /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n };\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 flush = true,\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 useFrameRegistration('panel', flush);\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-flush={flush || 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>\n <PageScope>{content}</PageScope>\n </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 /**\n * Sets whether the work area joins the app frame. The default is `true`. Set `flush={false}`\n * to make it a card on the Shell's background; the panes beside it then sit on that background\n * too, and draw no hairline toward it.\n */\n flush?: 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, flush = true, children, ...props }, ref) => {\n useFrameRegistration('content', flush);\n return (\n <main {...props} ref={ref} className={classNames('kui-ShellContent', className)} data-flush={flush || undefined}>\n {/* Each pane holds its own page store, so a band's title can mirror the page beside it. */}\n <ShellContentContext.Provider value={true}>\n <PageScope>{children}</PageScope>\n </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": ";y6BAAA,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,oBA6DjD,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,EAAUH,EAAeI,EAA2C,CAC3E,OAAOA,IAAO,MAAQA,IAAOJ,GAAOI,IAAOJ,EAAI,MAAQI,IAAOJ,EAAI,eACpE,CAGA,SAASK,GAAWL,EAAeM,EAAYC,EAA4C,CACzF,QAAWH,KAAMJ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5J,EAAM,OAASyJ,GAAMI,GAAa7J,EAAO,IAAI,EAC7CmJ,IAAW,SAAUS,EAAQ,OAAO,QAAQ,EACvCT,IAAW,SAAUS,EAAQ,SAAS,OAAQ,QAAQ,EAC1DA,EAAQ,SAAS,SAAU,QAAQ,EAC1C,EAEME,EAAoB9H,GAA+C,CAEvE,GADAuH,IAAevH,CAAK,EAChB,CAACoH,EAAa,OAClB,IAAMQ,EAAU5J,EAAM,QAAQ,IAAIyJ,CAAI,EAClCG,GAAWA,EAAQ,QAAU,UAAYA,EAAQ,eAAiB,WAAWC,GAAa7J,EAAOyJ,CAAI,CAC3G,EAEMM,EAAoB/H,GAA+C,CACvEwH,IAAexH,CAAK,EAChBoH,GAAepJ,EAAM,OAASyJ,GAAMI,GAAa7J,EAAO,IAAI,CAClE,EAEMgK,EAAOX,EAAUY,GAAK,KAAO,SACnC,OACE,gBAACD,EAAA,CAIE,GAAI,CAACX,GAAW,CAAE,KAAM,QAAkB,EAC3C,gBAAerI,GAAO,GACtB,gBAAe0I,EACd,GAAG9J,EACJ,IAAKC,EACL,QAAS8J,EACT,aAAcG,EACd,aAAcC,EACd,qBAAoB/G,EACpB,oBAAmBmG,GAElB9J,CACH,CAEJ,CAAC,EACD6J,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", "offFrame", "setOffFrame", "registerOffFrame", "prev", "unregisterOffFrame", "next", "frameContext", "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", "ShellFrameContext", "PaneBandSizeContext", "classNames", "Header", "flush", "useLayoutEffect", "Left", "_ref", "RAIL_PROP_NAMES", "Rail", "presentation", "expandedSize", "_collapsible", "onExpand", "onCollapse", "open", "defaultOpen", "onOpenChange", "domProps", "table", "attributes", "usePresentationTable", "usePane", "toPaneValue", "navigationRest", "value", "reason", "useFrameRegistration", "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", "PageScope", "Content", "Trigger", "action", "peekOnHover", "asChild", "onClick", "onMouseEnter", "onMouseLeave", "name", "shown", "handleClick", "current", "setShellPeek", "handleMouseEnter", "handleMouseLeave", "Comp", "Slot"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{b as C,c as T,d as N,e as G}from"./chunk-2ACVWLFA.js";import{a as F}from"./chunk-TGRHRMQI.js";import{a as g}from"./chunk-3ZBEWLSO.js";import{b as j}from"./chunk-YOZXIUZY.js";import{b as z,d as L,f as O}from"./chunk-GKDGNPBD.js";import{c as W}from"./chunk-5ON3XLRD.js";import{c as h,e as V,g as S,h as k,i as A}from"./chunk-ISCZ57VL.js";import{b,c as R,d as I,e as v}from"./chunk-EB4AG3OL.js";import{a as y}from"./chunk-DFQIIYLD.js";import{c as f}from"./chunk-OKQAVYW4.js";import{a as ne}from"./chunk-VQPANPMI.js";var ae={};ne(ae,{CheckboxItem:()=>Y,Content:()=>K,Group:()=>J,Item:()=>H,Label:()=>U,RadioGroup:()=>Q,RadioItem:()=>X,Root:()=>_,Separator:()=>te,Sub:()=>Z,SubContent:()=>ee,SubTrigger:()=>$,Trigger:()=>q});import*as e from"react";import s from"classnames";import{ContextMenu as i,Slot as B}from"radix-ui";import{useCallbackRef as re}from"radix-ui/internal";var _=t=>{let{open:r,onOpenChange:n}=t,[a,o]=e.useState(!1),u=r??a,p=re(n),c=e.useCallback(l=>{o(l),p(l)},[p]),m=e.useCallback(()=>c(!1),[c]);return e.createElement(V,{value:m},e.createElement(i.Root,{...t,open:u,onOpenChange:c}))};_.displayName="ContextMenu.Root";var q=e.forwardRef(({children:t,...r},n)=>e.createElement(i.Trigger,{...r,ref:n,asChild:!0},F(t)));q.displayName="ContextMenu.Trigger";var E=e.createContext({}),K=e.forwardRef((t,r)=>{let n=W(t,C.size),a=j(),{size:o=C.size.default}=n,{className:u,children:p,color:c,container:m,forceMount:l,submenuBehavior:w,virtualized:d=!1,...P}=f(n,C),x=c||a.accentColor,M=b(o,C.size.default),oe=e.useMemo(()=>({size:o,color:x}),[o,x]),D=e.createElement(h,{size:o},e.createElement(E.Provider,{value:oe},p));return e.createElement(i.Portal,{container:m,forceMount:l},e.createElement(g,{asChild:!0},e.createElement(i.Content,{"data-accent-color":x,alignOffset:R(M),collisionPadding:10,...P,asChild:!1,ref:r,className:s("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-ContextMenuContent",u)},d?e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport","kui-virtualized")},D):e.createElement(y,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport")},D)))))});K.displayName="ContextMenu.Content";var U=e.forwardRef(({className:t,id:r,...n},a)=>{let o=A(r);return e.createElement(i.Label,{...n,id:o,asChild:!1,ref:a,className:s("kui-BaseMenuLabel","kui-ContextMenuLabel",t)})});U.displayName="ContextMenu.Label";var H=e.forwardRef((t,r)=>{let{className:n,children:a,color:o=T.color.default,shortcut:u,...p}=t;return e.createElement(i.Item,{"data-accent-color":o,"aria-keyshortcuts":u?I(u):void 0,...p,ref:r,className:s("kui-reset","kui-BaseMenuItem","kui-ContextMenuItem",n)},e.createElement(B.Slottable,null,a),u&&e.createElement(v,{shortcut:u,className:"kui-ContextMenuShortcut"}))});H.displayName="ContextMenu.Item";var J=e.forwardRef(({className:t,"aria-labelledby":r,...n},a)=>{let[o,u]=k(r);return e.createElement(S,{value:u},e.createElement(i.Group,{"aria-labelledby":o,...n,asChild:!1,ref:a,className:s("kui-BaseMenuGroup","kui-ContextMenuGroup",t)}))});J.displayName="ContextMenu.Group";var Q=e.forwardRef(({className:t,"aria-labelledby":r,...n},a)=>{let[o,u]=k(r);return e.createElement(S,{value:u},e.createElement(i.RadioGroup,{"aria-labelledby":o,...n,asChild:!1,ref:a,className:s("kui-BaseMenuRadioGroup","kui-ContextMenuRadioGroup",t)}))});Q.displayName="ContextMenu.RadioGroup";var X=e.forwardRef((t,r)=>{let{children:n,className:a,color:o=G.color.default,...u}=t;return e.createElement(i.RadioItem,{...u,asChild:!1,ref:r,"data-accent-color":o,className:s("kui-BaseMenuItem","kui-BaseMenuRadioItem","kui-ContextMenuItem","kui-ContextMenuRadioItem",a)},e.createElement(B.Slottable,null,n),e.createElement(i.ItemIndicator,{className:"kui-BaseMenuItemIndicator kui-ContextMenuItemIndicator"},e.createElement(O,{className:"kui-BaseMenuItemIndicatorIcon kui-ContextMenuItemIndicatorIcon"})))});X.displayName="ContextMenu.RadioItem";var Y=e.forwardRef((t,r)=>{let{children:n,className:a,shortcut:o,color:u=N.color.default,...p}=t;return e.createElement(i.CheckboxItem,{"aria-keyshortcuts":o?I(o):void 0,...p,asChild:!1,ref:r,"data-accent-color":u,className:s("kui-BaseMenuItem","kui-BaseMenuCheckboxItem","kui-ContextMenuItem","kui-ContextMenuCheckboxItem",a)},e.createElement(B.Slottable,null,n),e.createElement(i.ItemIndicator,{className:"kui-BaseMenuItemIndicator kui-ContextMenuItemIndicator"},e.createElement(z,{className:"kui-BaseMenuItemIndicatorIcon kui-ContextMenuItemIndicatorIcon"})),o&&e.createElement(v,{shortcut:o,className:"kui-ContextMenuShortcut"}))});Y.displayName="ContextMenu.CheckboxItem";var Z=t=>e.createElement(i.Sub,{...t});Z.displayName="ContextMenu.Sub";var $=e.forwardRef((t,r)=>{let{className:n,children:a,...o}=t;return e.createElement(i.SubTrigger,{...o,asChild:!1,ref:r,className:s("kui-BaseMenuItem","kui-BaseMenuSubTrigger","kui-ContextMenuItem","kui-ContextMenuSubTrigger",n)},a,e.createElement("div",{className:"kui-BaseMenuShortcut kui-ContextMenuShortcut"},e.createElement(L,{className:"kui-BaseMenuSubTriggerIcon kui-ContextMenuSubTriggerIcon"})))});$.displayName="ContextMenu.SubTrigger";var ee=e.forwardRef((t,r)=>{let n=e.useContext(E),a=t.size??n.size,o=t.color??n.color,{className:u,children:p,container:c,forceMount:m,color:l,virtualized:w=!1,...d}=f({...t,size:a},C),P=b(a,C.size.default),x=e.useMemo(()=>({size:a,color:o}),[a,o]),M=e.createElement(h,{size:a},e.createElement(E.Provider,{value:x},p));return e.createElement(i.Portal,{container:c,forceMount:m},e.createElement(g,{asChild:!0},e.createElement(i.SubContent,{"data-accent-color":o,alignOffset:R(P),sideOffset:1,collisionPadding:10,...d,asChild:!1,ref:r,className:s("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-BaseMenuSubContent","kui-ContextMenuContent","kui-ContextMenuSubContent",u)},w?e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport","kui-virtualized")},M):e.createElement(y,{type:"auto",scrollbars:"vertical"},e.createElement("div",{className:s("kui-BaseMenuViewport","kui-ContextMenuViewport")},M)))))});ee.displayName="ContextMenu.SubContent";var te=e.forwardRef(({className:t,...r},n)=>e.createElement(i.Separator,{...r,asChild:!1,ref:n,className:s("kui-BaseMenuSeparator","kui-ContextMenuSeparator",t)}));te.displayName="ContextMenu.Separator";export{_ as a,q as b,K as c,U as d,H as e,J as f,Q as g,X as h,Y as i,Z as j,$ as k,ee as l,te as m,ae as n};
3
- //# sourceMappingURL=chunk-DNY4WWZF.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/context-menu.tsx"],
4
- "sourcesContent": ["/**\n * Context Menu component that provides right-click menu functionality.\n * Requires client-side rendering due to event handling and portal usage.\n */\n'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { ContextMenu as ContextMenuPrimitive, Slot } from 'radix-ui';\nimport { useCallbackRef } from 'radix-ui/internal';\n\nimport { ScrollArea } from './scroll-area.js';\nimport {\n contextMenuContentPropDefs,\n contextMenuSubContentPropDefs,\n contextMenuItemPropDefs,\n contextMenuCheckboxItemPropDefs,\n contextMenuRadioItemPropDefs,\n} from './context-menu.props.js';\nimport { useThemeContext } from './theme.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { ThickCheckIcon, ThickChevronRightIcon, ThickDotIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport {\n MenuCloseProvider,\n MenuGroupLabelProvider,\n MenuProvider,\n useMenuGroupLabelId,\n useMenuGroupLabelledBy,\n} from './_internal/menu-context.js';\nimport {\n MenuShortcut,\n getMenuAlignOffset,\n toAriaKeyShortcuts,\n useResolvedResponsiveValue,\n} from './_internal/base-menu.utils.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes, Responsive } from '../props/prop-def.js';\n\ninterface ContextMenuRootProps\n extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Root> {}\nconst ContextMenuRoot: React.FC<ContextMenuRootProps> = (props) => {\n const { open: openProp, onOpenChange } = props;\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false);\n const open = openProp ?? uncontrolledOpen;\n\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n setUncontrolledOpen(next);\n handleOpenChangeProp(next);\n },\n [handleOpenChangeProp],\n );\n const close = React.useCallback(() => handleOpenChange(false), [handleOpenChange]);\n\n return (\n <MenuCloseProvider value={close}>\n <ContextMenuPrimitive.Root {...props} open={open} onOpenChange={handleOpenChange} />\n </MenuCloseProvider>\n );\n};\nContextMenuRoot.displayName = 'ContextMenu.Root';\n\ntype ContextMenuTriggerElement = React.ElementRef<typeof ContextMenuPrimitive.Trigger>;\ninterface ContextMenuTriggerProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.Trigger, RemovedProps> {}\nconst ContextMenuTrigger = React.forwardRef<ContextMenuTriggerElement, ContextMenuTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <ContextMenuPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </ContextMenuPrimitive.Trigger>\n ),\n);\nContextMenuTrigger.displayName = 'ContextMenu.Trigger';\n\n/** Visual props shared by Content and SubContent. */\ntype ContextMenuSurfaceProps = GetPropDefTypes<typeof contextMenuContentPropDefs>;\n\ntype ContextMenuContentContextValue = {\n size?: ContextMenuSurfaceProps['size'];\n color?: ContextMenuSurfaceProps['color'];\n};\nconst ContextMenuContentContext = React.createContext<ContextMenuContentContextValue>({});\ntype ContextMenuContentElement = React.ElementRef<typeof ContextMenuPrimitive.Content>;\ninterface ContextMenuContentProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.Content, RemovedProps>,\n ContextMenuSurfaceProps {\n container?: React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Portal>['container'];\n /**\n * When true, skips the ScrollArea wrapper to allow VirtualMenu to handle its own scrolling.\n * Use this when rendering virtualized lists inside the context menu.\n */\n virtualized?: boolean;\n /**\n * @deprecated Has no effect. ContextMenu submenus always cascade.\n */\n submenuBehavior?: Responsive<'cascade' | 'drill-down'>;\n}\nconst ContextMenuContent = React.forwardRef<ContextMenuContentElement, ContextMenuContentProps>(\n (ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, contextMenuContentPropDefs.size);\n const themeContext = useThemeContext();\n const {\n size = contextMenuContentPropDefs.size.default,\n } = props;\n const {\n className,\n children,\n color,\n container,\n forceMount,\n submenuBehavior: _submenuBehavior,\n virtualized = false,\n ...contentProps\n } = extractProps(props, contextMenuContentPropDefs);\n\n const resolvedColor = color || themeContext.accentColor;\n const scalarSize = useResolvedResponsiveValue(size, contextMenuContentPropDefs.size.default);\n\n const contextValue = React.useMemo(\n () => ({ size, color: resolvedColor }),\n [size, resolvedColor],\n );\n\n const body = (\n <MenuProvider size={size}>\n <ContextMenuContentContext.Provider value={contextValue}>{children}</ContextMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <ContextMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <ContextMenuPrimitive.Content\n data-accent-color={resolvedColor}\n alignOffset={getMenuAlignOffset(scalarSize)}\n collisionPadding={10}\n {...contentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-ContextMenuContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('kui-BaseMenuViewport', 'kui-ContextMenuViewport', 'kui-virtualized')}>\n {body}\n </div>\n ) : (\n <ScrollArea type=\"auto\" scrollbars=\"vertical\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-ContextMenuViewport')}>{body}</div>\n </ScrollArea>\n )}\n </ContextMenuPrimitive.Content>\n </PortalTheme>\n </ContextMenuPrimitive.Portal>\n );\n },\n);\nContextMenuContent.displayName = 'ContextMenu.Content';\n\ntype ContextMenuLabelElement = React.ElementRef<typeof ContextMenuPrimitive.Label>;\ninterface ContextMenuLabelProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.Label, RemovedProps> {}\nconst ContextMenuLabel = React.forwardRef<ContextMenuLabelElement, ContextMenuLabelProps>(\n ({ className, id: idProp, ...props }, forwardedRef) => {\n const id = useMenuGroupLabelId(idProp);\n return (\n <ContextMenuPrimitive.Label\n {...props}\n id={id}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuLabel', 'kui-ContextMenuLabel', className)}\n />\n );\n },\n);\nContextMenuLabel.displayName = 'ContextMenu.Label';\n\ntype ContextMenuItemElement = React.ElementRef<typeof ContextMenuPrimitive.Item>;\ntype ContextMenuItemOwnProps = GetPropDefTypes<typeof contextMenuItemPropDefs>;\ninterface ContextMenuItemProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.Item, RemovedProps>,\n ContextMenuItemOwnProps {}\nconst ContextMenuItem = React.forwardRef<ContextMenuItemElement, ContextMenuItemProps>(\n (props, forwardedRef) => {\n const {\n className,\n children,\n color = contextMenuItemPropDefs.color.default,\n shortcut,\n ...itemProps\n } = props;\n return (\n <ContextMenuPrimitive.Item\n data-accent-color={color}\n aria-keyshortcuts={shortcut ? toAriaKeyShortcuts(shortcut) : undefined}\n {...itemProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-ContextMenuItem', className)}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n {shortcut && <MenuShortcut shortcut={shortcut} className=\"kui-ContextMenuShortcut\" />}\n </ContextMenuPrimitive.Item>\n );\n },\n);\nContextMenuItem.displayName = 'ContextMenu.Item';\n\ntype ContextMenuGroupElement = React.ElementRef<typeof ContextMenuPrimitive.Group>;\ninterface ContextMenuGroupProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.Group, RemovedProps> {}\nconst ContextMenuGroup = React.forwardRef<ContextMenuGroupElement, ContextMenuGroupProps>(\n ({ className, 'aria-labelledby': ariaLabelledBy, ...props }, forwardedRef) => {\n const [labelledBy, setLabelId] = useMenuGroupLabelledBy(ariaLabelledBy);\n return (\n <MenuGroupLabelProvider value={setLabelId}>\n <ContextMenuPrimitive.Group\n aria-labelledby={labelledBy}\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuGroup', 'kui-ContextMenuGroup', className)}\n />\n </MenuGroupLabelProvider>\n );\n },\n);\nContextMenuGroup.displayName = 'ContextMenu.Group';\n\ntype ContextMenuRadioGroupElement = React.ElementRef<typeof ContextMenuPrimitive.RadioGroup>;\ninterface ContextMenuRadioGroupProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.RadioGroup, RemovedProps> {}\nconst ContextMenuRadioGroup = React.forwardRef<\n ContextMenuRadioGroupElement,\n ContextMenuRadioGroupProps\n>(({ className, 'aria-labelledby': ariaLabelledBy, ...props }, forwardedRef) => {\n const [labelledBy, setLabelId] = useMenuGroupLabelledBy(ariaLabelledBy);\n return (\n <MenuGroupLabelProvider value={setLabelId}>\n <ContextMenuPrimitive.RadioGroup\n aria-labelledby={labelledBy}\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuRadioGroup', 'kui-ContextMenuRadioGroup', className)}\n />\n </MenuGroupLabelProvider>\n );\n});\nContextMenuRadioGroup.displayName = 'ContextMenu.RadioGroup';\n\ntype ContextMenuRadioItemElement = React.ElementRef<typeof ContextMenuPrimitive.RadioItem>;\ntype ContextMenuRadioItemOwnProps = GetPropDefTypes<typeof contextMenuRadioItemPropDefs>;\ninterface ContextMenuRadioItemProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.RadioItem, RemovedProps>,\n ContextMenuRadioItemOwnProps {}\nconst ContextMenuRadioItem = React.forwardRef<\n ContextMenuRadioItemElement,\n ContextMenuRadioItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n color = contextMenuRadioItemPropDefs.color.default,\n ...itemProps\n } = props;\n return (\n <ContextMenuPrimitive.RadioItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuRadioItem',\n 'kui-ContextMenuItem',\n 'kui-ContextMenuRadioItem',\n className,\n )}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <ContextMenuPrimitive.ItemIndicator className=\"kui-BaseMenuItemIndicator kui-ContextMenuItemIndicator\">\n <ThickDotIcon className=\"kui-BaseMenuItemIndicatorIcon kui-ContextMenuItemIndicatorIcon\" />\n </ContextMenuPrimitive.ItemIndicator>\n </ContextMenuPrimitive.RadioItem>\n );\n});\nContextMenuRadioItem.displayName = 'ContextMenu.RadioItem';\n\ntype ContextMenuCheckboxItemElement = React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>;\ntype ContextMenuCheckboxItemOwnProps = GetPropDefTypes<typeof contextMenuCheckboxItemPropDefs>;\ninterface ContextMenuCheckboxItemProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.CheckboxItem, RemovedProps>,\n ContextMenuCheckboxItemOwnProps {}\nconst ContextMenuCheckboxItem = React.forwardRef<\n ContextMenuCheckboxItemElement,\n ContextMenuCheckboxItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n shortcut,\n color = contextMenuCheckboxItemPropDefs.color.default,\n ...itemProps\n } = props;\n return (\n <ContextMenuPrimitive.CheckboxItem\n aria-keyshortcuts={shortcut ? toAriaKeyShortcuts(shortcut) : undefined}\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuCheckboxItem',\n 'kui-ContextMenuItem',\n 'kui-ContextMenuCheckboxItem',\n className,\n )}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <ContextMenuPrimitive.ItemIndicator className=\"kui-BaseMenuItemIndicator kui-ContextMenuItemIndicator\">\n <ThickCheckIcon className=\"kui-BaseMenuItemIndicatorIcon kui-ContextMenuItemIndicatorIcon\" />\n </ContextMenuPrimitive.ItemIndicator>\n {shortcut && <MenuShortcut shortcut={shortcut} className=\"kui-ContextMenuShortcut\" />}\n </ContextMenuPrimitive.CheckboxItem>\n );\n});\nContextMenuCheckboxItem.displayName = 'ContextMenu.CheckboxItem';\n\ninterface ContextMenuSubProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.Sub, RemovedProps> {}\nconst ContextMenuSub: React.FC<ContextMenuSubProps> = (props) => (\n <ContextMenuPrimitive.Sub {...props} />\n);\nContextMenuSub.displayName = 'ContextMenu.Sub';\n\ntype ContextMenuSubTriggerElement = React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>;\ninterface ContextMenuSubTriggerProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.SubTrigger, RemovedProps> {}\nconst ContextMenuSubTrigger = React.forwardRef<\n ContextMenuSubTriggerElement,\n ContextMenuSubTriggerProps\n>((props, forwardedRef) => {\n const { className, children, ...subTriggerProps } = props;\n return (\n <ContextMenuPrimitive.SubTrigger\n {...subTriggerProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuSubTrigger',\n 'kui-ContextMenuItem',\n 'kui-ContextMenuSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"kui-BaseMenuShortcut kui-ContextMenuShortcut\">\n <ThickChevronRightIcon className=\"kui-BaseMenuSubTriggerIcon kui-ContextMenuSubTriggerIcon\" />\n </div>\n </ContextMenuPrimitive.SubTrigger>\n );\n});\nContextMenuSubTrigger.displayName = 'ContextMenu.SubTrigger';\n\ntype ContextMenuSubContentElement = React.ElementRef<typeof ContextMenuPrimitive.SubContent>;\ninterface ContextMenuSubContentProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.SubContent, RemovedProps>,\n ContextMenuSurfaceProps {\n container?: React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Portal>['container'];\n /**\n * When true, skips the ScrollArea wrapper to allow VirtualMenu to handle its own scrolling.\n */\n virtualized?: boolean;\n}\nconst ContextMenuSubContent = React.forwardRef<\n ContextMenuSubContentElement,\n ContextMenuSubContentProps\n>((props, forwardedRef) => {\n const parent = React.useContext(ContextMenuContentContext);\n\n // A submenu inherits the parent surface, and its own props win.\n const size = props.size ?? parent.size;\n const color = props.color ?? parent.color;\n\n const {\n className,\n children,\n container,\n forceMount,\n color: _color,\n virtualized = false,\n ...subContentProps\n } = extractProps({ ...props, size }, contextMenuSubContentPropDefs);\n\n const scalarSize = useResolvedResponsiveValue(size, contextMenuSubContentPropDefs.size.default);\n\n const contextValue = React.useMemo(\n () => ({ size, color }),\n [size, color],\n );\n\n const body = (\n <MenuProvider size={size}>\n <ContextMenuContentContext.Provider value={contextValue}>{children}</ContextMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <ContextMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <ContextMenuPrimitive.SubContent\n data-accent-color={color}\n alignOffset={getMenuAlignOffset(scalarSize)}\n // Side offset accounts for the outer solid box-shadow\n sideOffset={1}\n collisionPadding={10}\n {...subContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-BaseMenuSubContent',\n 'kui-ContextMenuContent',\n 'kui-ContextMenuSubContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('kui-BaseMenuViewport', 'kui-ContextMenuViewport', 'kui-virtualized')}>\n {body}\n </div>\n ) : (\n <ScrollArea type=\"auto\" scrollbars=\"vertical\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-ContextMenuViewport')}>{body}</div>\n </ScrollArea>\n )}\n </ContextMenuPrimitive.SubContent>\n </PortalTheme>\n </ContextMenuPrimitive.Portal>\n );\n});\nContextMenuSubContent.displayName = 'ContextMenu.SubContent';\n\ntype ContextMenuSeparatorElement = React.ElementRef<typeof ContextMenuPrimitive.Separator>;\ninterface ContextMenuSeparatorProps\n extends ComponentPropsWithout<typeof ContextMenuPrimitive.Separator, RemovedProps> {}\nconst ContextMenuSeparator = React.forwardRef<\n ContextMenuSeparatorElement,\n ContextMenuSeparatorProps\n>(({ className, ...props }, forwardedRef) => (\n <ContextMenuPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuSeparator', 'kui-ContextMenuSeparator', className)}\n />\n));\nContextMenuSeparator.displayName = 'ContextMenu.Separator';\n\nexport {\n ContextMenuRoot as Root,\n ContextMenuTrigger as Trigger,\n ContextMenuContent as Content,\n ContextMenuLabel as Label,\n ContextMenuItem as Item,\n ContextMenuGroup as Group,\n ContextMenuRadioGroup as RadioGroup,\n ContextMenuRadioItem as RadioItem,\n ContextMenuCheckboxItem as CheckboxItem,\n ContextMenuSub as Sub,\n ContextMenuSubTrigger as SubTrigger,\n ContextMenuSubContent as SubContent,\n ContextMenuSeparator as Separator,\n};\n\nexport type {\n ContextMenuRootProps as RootProps,\n ContextMenuTriggerProps as TriggerProps,\n ContextMenuContentProps as ContentProps,\n ContextMenuLabelProps as LabelProps,\n ContextMenuItemProps as ItemProps,\n ContextMenuGroupProps as GroupProps,\n ContextMenuRadioGroupProps as RadioGroupProps,\n ContextMenuRadioItemProps as RadioItemProps,\n ContextMenuCheckboxItemProps as CheckboxItemProps,\n ContextMenuSubProps as SubProps,\n ContextMenuSubTriggerProps as SubTriggerProps,\n ContextMenuSubContentProps as SubContentProps,\n ContextMenuSeparatorProps as Separ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EAAA,CAAW,KAAK,OAAO,WAAW,YACjC,gBAAC,OAAI,UAAWD,EAAW,uBAAwB,yBAAyB,GAAIJ,CAAK,CACvF,CAEJ,CACF,CACF,CAEJ,CAAC,EACDkC,GAAsB,YAAc,yBAKpC,IAAMI,GAA6B,aAGjC,CAAC,CAAE,UAAAlD,EAAW,GAAGzB,CAAM,EAAGe,IAC1B,gBAACH,EAAqB,UAArB,CACE,GAAGZ,EACJ,QAAS,GACT,IAAKe,EACL,UAAW0B,EAAW,wBAAyB,2BAA4BhB,CAAS,EACtF,CACD,EACDkD,GAAqB,YAAc",
6
- "names": ["context_menu_exports", "__export", "ContextMenuCheckboxItem", "ContextMenuContent", "ContextMenuGroup", "ContextMenuItem", "ContextMenuLabel", "ContextMenuRadioGroup", "ContextMenuRadioItem", "ContextMenuRoot", "ContextMenuSeparator", "ContextMenuSub", "ContextMenuSubContent", "ContextMenuSubTrigger", "ContextMenuTrigger", "React", "classNames", "ContextMenuPrimitive", "Slot", "useCallbackRef", "ContextMenuRoot", "props", "openProp", "onOpenChange", "uncontrolledOpen", "setUncontrolledOpen", "open", "handleOpenChangeProp", "useCallbackRef", "handleOpenChange", "next", "close", "MenuCloseProvider", "ContextMenuPrimitive", "ContextMenuTrigger", "children", "forwardedRef", "requireReactElement", "ContextMenuContentContext", "ContextMenuContent", "ownProps", "useThemeSizeProps", "baseMenuSubContentPropDefs", "themeContext", "useThemeContext", "size", "className", "color", "container", "forceMount", "_submenuBehavior", "virtualized", "contentProps", "extractProps", "resolvedColor", "scalarSize", "useResolvedResponsiveValue", "contextValue", "body", "MenuProvider", "PortalTheme", "getMenuAlignOffset", "classNames", "ScrollArea", "ContextMenuLabel", "idProp", "id", "useMenuGroupLabelId", "ContextMenuItem", "baseMenuItemPropDefs", "shortcut", "itemProps", "toAriaKeyShortcuts", "Slot", "MenuShortcut", "ContextMenuGroup", "ariaLabelledBy", "labelledBy", "setLabelId", "useMenuGroupLabelledBy", "MenuGroupLabelProvider", "ContextMenuRadioGroup", "ContextMenuRadioItem", "baseMenuRadioItemPropDefs", "ThickDotIcon", "ContextMenuCheckboxItem", "baseMenuCheckboxItemPropDefs", "ThickCheckIcon", "ContextMenuSub", "ContextMenuSubTrigger", "subTriggerProps", "ThickChevronRightIcon", "ContextMenuSubContent", "parent", "_color", "subContentProps", "ContextMenuSeparator"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as c,c as M,e as w,g as H}from"./chunk-XUCR7L4G.js";import{a as v,d}from"./chunk-4OJRLS5N.js";import{a as y,b as x,c as O}from"./chunk-KGCGT4MJ.js";import{a as E,b as T,c as N}from"./chunk-4TTRPCGG.js";import{a as R}from"./chunk-MXEOE4LA.js";import{a as S}from"./chunk-G66WDIIV.js";import{b}from"./chunk-VWRPVM5K.js";import{o as C}from"./chunk-5BXCPANF.js";import*as e from"react";import le from"classnames";import{useComposedRefs as pe}from"radix-ui/internal";var de={controlled:"open",default:"defaultOpen"},ce={initial:"overlay",sm:"fixed"},U=e.forwardRef((k,A)=>{let{className:B,presentation:V=ce,defaultOpen:L,open:_,onOpenChange:D,expandedSize:o=320,minSize:t=200,maxSize:s=500,resizable:m=!1,collapsible:F=!0,onExpand:$,onCollapse:q,onResize:W,onResizeStart:j,onResizeEnd:G,snapPoints:r,snapTolerance:K,collapseThreshold:a,paneId:i,persistence:l,children:J,style:Q,onSizeChange:X,sizeUpdate:Y,sizeUpdateMs:Z=50,size:u,defaultSize:P,flush:f=!0,id:ee,...p}=k,{table:z,attributes:ne}=O(V,"fixed"),n=y({name:"inspector",label:"Inspector",propNames:de,id:ee,controlled:c(_),defaultValue:c(L),presentationTable:z,builtIn:M,onChange:(ae,ie)=>D?.(ae!=="closed",{reason:ie}),onExpand:$,onCollapse:q,size:o});C("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),oe=pe(A,n.setElement,h),te=T({name:"inspector",elementId:n.id,elementRef:h,cssVarName:"--inspector-size",orientation:"vertical",edge:"start",growth:w,expandedSize:o,minSize:t,maxSize:s,resizable:m,collapsible:F,size:u,defaultSize:P,onSizeChange:X,sizeUpdate:Y,sizeUpdateMs:Z,onResize:W,onResizeStart:j,onResizeEnd:G,snapPoints:r,snapTolerance:K,collapseThreshold:a,paneId:i,persistence:l,overlaying:n.overlaying,overlayingNow:()=>z[S()]==="overlay",requestCollapse:()=>n.setValue("closed","toggle"),requestToggle:()=>n.toggle("toggle")}),{handles:g,content:se}=N(J,d),re=m&&n.shown!==!1&&!n.overlaying?e.createElement(R.Provider,{value:te},g.length>0?g:e.createElement(v,null)):null,I=E(u,P,t,s);return e.createElement("div",{...H(p),role:p.role??"complementary",id:n.id,ref:oe,className:le("kui-ShellPane","kui-ShellInspector",B),...x(n,ne),"data-flush":f||void 0,tabIndex:n.overlaying?-1:p.tabIndex,style:{...Q,"--inspector-expanded-size":`${o}px`,...I?{"--inspector-size":I}:{},"--inspector-min-size":`${t}px`,"--inspector-max-size":`${s}px`}},e.createElement("div",{className:"kui-ShellInspectorContent"},e.createElement(b,null,se)),re)});U.displayName="Shell.Inspector";U.Handle=d;export{U as a};
3
- //# sourceMappingURL=chunk-HQT32HQ6.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/_internal/shell-inspector.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposedRefs } from 'radix-ui/internal';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { InspectorHandle, PaneHandle } from './shell-handles.js';\nimport { usePane, paneAttributes, usePresentationTable } from './shell-pane.js';\nimport { splitHandles, useInitialPaneSize, useResizablePane, type SizeChangeMeta } from './shell-resizable.js';\nimport { useFrameRegistration, warnOnce } from './shell-store.js';\nimport { detailRest, endAnchoredGrowth, toPaneValue, withoutRemovedPaneProps } from './shell-rest.js';\nimport { PageScope } from './page-scope.js';\nimport { readBreakpoint } from '../../hooks/use-breakpoint.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps } from '../shell.types.js';\n\ntype InspectorOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'dismiss' };\ntype InspectorControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: InspectorOpenChangeMeta) => void; defaultOpen?: never };\ntype InspectorUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: InspectorOpenChangeMeta) => void; open?: never };\ntype InspectorSizeControlledProps = { size: number | string; defaultSize?: never };\ntype InspectorSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype InspectorPublicProps = PaneBaseProps &\n (InspectorControlledProps | InspectorUncontrolledProps) &\n (InspectorSizeControlledProps | InspectorSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: SizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n };\n\ntype InspectorComponent = React.ForwardRefExoticComponent<InspectorPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof InspectorHandle };\n\nconst INSPECTOR_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\n/** Since 0.8.0 the Inspector is in the frame from 768px up, the boundary kookie-ui-v2 uses everywhere. It was 1280px. */\nconst INSPECTOR_DEFAULT_PRESENTATION = { initial: 'overlay', sm: 'fixed' } as const;\n\nexport const Inspector = React.forwardRef<HTMLDivElement, InspectorPublicProps>((props, ref) => {\n const {\n className,\n presentation = INSPECTOR_DEFAULT_PRESENTATION,\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 320,\n minSize = 200,\n maxSize = 500,\n resizable = false,\n collapsible = true,\n 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 size,\n defaultSize,\n flush = true,\n id,\n ...domProps\n } = props;\n\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'inspector',\n label: 'Inspector',\n propNames: INSPECTOR_PROP_NAMES,\n id,\n controlled: toPaneValue(open),\n defaultValue: toPaneValue(defaultOpen),\n presentationTable: table,\n builtIn: detailRest,\n onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useFrameRegistration('inspector', flush);\n\n React.useEffect(() => {\n if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {\n warnOnce('Shell.Inspector: `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: 'inspector',\n elementId: pane.id,\n elementRef,\n cssVarName: '--inspector-size',\n orientation: 'vertical',\n edge: 'start',\n growth: endAnchoredGrowth,\n expandedSize,\n minSize,\n maxSize,\n resizable,\n collapsible,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs,\n onResize,\n onResizeStart,\n onResizeEnd,\n 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, InspectorHandle);\n const handle = resizable && pane.shown !== false && !pane.overlaying ? <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider> : null;\n\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n return (\n <div\n {...withoutRemovedPaneProps(domProps)}\n role={domProps.role ?? 'complementary'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellInspector', className)}\n {...paneAttributes(pane, attributes)}\n data-flush={flush || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--inspector-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--inspector-size': initialSize } : {}),\n '--inspector-min-size': `${minSize}px`,\n '--inspector-max-size': `${maxSize}px`,\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellInspectorContent\">\n <PageScope>{content}</PageScope>\n </div>\n {handle}\n </div>\n );\n}) as InspectorComponent;\n\nInspector.displayName = 'Shell.Inspector';\nInspector.Handle = InspectorHandle;\n\nexport type { InspectorPublicProps };\n"],
5
- "mappings": ";8WAEA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,OAAS,mBAAAC,OAAuB,oBAiChC,IAAMC,GAAuB,CAAE,WAAY,OAAQ,QAAS,aAAc,EAGpEC,GAAiC,CAAE,QAAS,UAAW,GAAI,OAAQ,EAE5DC,EAAkB,aAAiD,CAACC,EAAOC,IAAQ,CAC9F,GAAM,CACJ,UAAAC,EACA,aAAAC,EAAeL,GACf,YAAAM,EACA,KAAAC,EACA,aAAAC,EACA,aAAAC,EAAe,IACf,QAAAC,EAAU,IACV,QAAAC,EAAU,IACV,UAAAC,EAAY,GACZ,YAAAC,EAAc,GACd,SAAAC,EACA,WAAAC,EACA,SAAAC,EACA,cAAAC,EACA,YAAAC,EACA,WAAAC,EACA,cAAAC,EACA,kBAAAC,EACA,OAAAC,EACA,YAAAC,EACA,SAAAC,EACA,MAAAC,EACA,aAAAC,EACA,WAAAC,EACA,aAAAC,EAAe,GACf,KAAAC,EACA,YAAAC,EACA,MAAAC,EAA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C,GAAayB,EAAK,QAAU,IAAS,CAACA,EAAK,WAAa,gBAACmB,EAAkB,SAAlB,CAA2B,MAAOT,IAASI,EAAQ,OAAS,EAAIA,EAAU,gBAACM,EAAA,IAAW,CAAG,EAAgC,KAE3LC,EAAcC,EAAmB9B,EAAMC,EAAapB,EAASC,CAAO,EAC1E,OACE,gBAAC,OACE,GAAGiD,EAAwB3B,CAAQ,EACpC,KAAMA,EAAS,MAAQ,gBACvB,GAAII,EAAK,GACT,IAAKQ,GACL,UAAWgB,GAAW,gBAAiB,qBAAsBzD,CAAS,EACrE,GAAG0D,EAAezB,EAAMF,EAAU,EACnC,aAAYJ,GAAS,OACrB,SAAUM,EAAK,WAAa,GAAKJ,EAAS,SAC1C,MACE,CACE,GAAGR,EACH,4BAA6B,GAAGhB,CAAY,KAC5C,GAAIiD,EAAc,CAAE,mBAAoBA,CAAY,EAAI,CAAC,EACzD,uBAAwB,GAAGhD,CAAO,KAClC,uBAAwB,GAAGC,CAAO,IACpC,GAGF,gBAAC,OAAI,UAAU,6BACb,gBAACoD,EAAA,KAAWX,EAAQ,CACtB,EACCG,EACH,CAEJ,CAAC,EAEDtD,EAAU,YAAc,kBACxBA,EAAU,OAASqD",
6
- "names": ["React", "classNames", "useComposedRefs", "INSPECTOR_PROP_NAMES", "INSPECTOR_DEFAULT_PRESENTATION", "Inspector", "props", "ref", "className", "presentation", "defaultOpen", "open", "onOpenChange", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "size", "defaultSize", "flush", "id", "domProps", "table", "attributes", "usePresentationTable", "pane", "usePane", "toPaneValue", "detailRest", "value", "reason", "useFrameRegistration", "elementRef", "composedRef", "useComposedRefs", "resize", "useResizablePane", "endAnchoredGrowth", "readBreakpoint", "handles", "content", "splitHandles", "InspectorHandle", "handle", "PaneResizeContext", "PaneHandle", "initialSize", "useInitialPaneSize", "withoutRemovedPaneProps", "classNames", "paneAttributes", "PageScope"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as O,b as _}from"./chunk-G66WDIIV.js";import{a as C,b,c as $,d as B,g as M,k as q,m as F}from"./chunk-5BXCPANF.js";import*as t from"react";import{useLayoutEffect as v}from"radix-ui/internal";var I=e=>typeof e=="object"&&e!==null;function ne(e){for(let a of["initial","xs","sm","md","lg","xl"]){let l=e[a];if(l!==void 0)return l}return"closed"}function re(e){let{name:a,label:l,propNames:o,presentationTable:r,builtIn:m}=e,d=q(`Shell.${l}`),G=t.useId(),k=e.id??`shell-${a}${G}`,c=e.controlled!==void 0,x=I(e.controlled);x&&(`${l}${o.controlled}${o.default}`,void 0);let p=x?e.controlled:void 0,z=p??(I(e.defaultValue)?e.defaultValue:void 0),J=B(z),[Q,W]=t.useState(()=>typeof e.defaultValue=="string"?e.defaultValue:"auto"),P=t.useMemo(()=>p?C(p,()=>ne(p)):C(z,n=>m(r[n])),[J,x,r,m]),u=Q;c&&(u=p?"auto":e.controlled);let X=b(r)===void 0||u==="auto"&&b(P)===void 0,{breakpoint:H,ready:L}=_(X),j=n=>{let f=b(n);return f!==void 0?f:L?n[H]:void 0},i=u==="auto"?j(P):u,y=j(r),E=y==="overlay",s=i===void 0?void 0:i!=="closed",N=s===!0&&E,D=e.defaultValue,V=t.useRef({state:u,value:i,autoTable:P,defaultValue:D,controlled:c,onChange:e.onChange,toggleNext:e.toggleNext});v(()=>{V.current={state:u,value:i,autoTable:P,defaultValue:D,controlled:c,onChange:e.onChange,toggleNext:e.toggleNext}});let h=t.useCallback(()=>{let n=V.current;return n.value!==void 0?n.value:n.state==="auto"?n.autoTable[O()]:void 0},[]),T=t.useCallback(()=>{let n=V.current;return typeof n.defaultValue=="string"?n.defaultValue:I(n.defaultValue)?n.autoTable[O()]:void 0},[]),g=t.useCallback((n,f)=>{let R=V.current;h()!==n&&(R.onChange?.(n,f),R.controlled||W(n))},[h]),w=t.useCallback(n=>{let f=V.current,R=h()??"closed",ee=f.toggleNext?f.toggleNext(R,T()):R==="closed"?"open":"closed";g(ee,n)},[g,h,T]),A=t.useRef(null),Y=t.useCallback(n=>{A.current=n},[]);v(()=>{let n={name:a,id:k,el:A.current,value:i,presentation:y,presentationTable:r,overlayLive:N,size:e.size,setValue:g,toggle:w};return d.entries.set(a,n),M(d),()=>{d.entries.get(a)===n&&(d.entries.delete(a),M(d))}},[d,a,k,i,y,r,N,e.size,g,w]);let S=t.useRef({onExpand:e.onExpand,onCollapse:e.onCollapse});v(()=>{S.current={onExpand:e.onExpand,onCollapse:e.onCollapse}});let K=t.useRef({state:u,shown:s});t.useEffect(()=>{let n=K.current;n.state!==u&&n.shown!==void 0&&s!==void 0&&n.shown!==s&&(s?S.current.onExpand?.():S.current.onCollapse?.()),K.current={state:u,shown:s}},[u,s]),v(()=>{},[]);let U=t.useRef(c);t.useEffect(()=>{},[c,l,o.controlled]);let Z=F(d,a)&&s===!1&&!E;return{store:d,id:k,state:u,value:i,shown:s,presentation:y,overlaying:E,overlayLive:N,peeking:Z,ready:L,breakpoint:H,autoTable:P,setValue:g,toggle:w,defaultHereNow:T,setElement:Y}}function ue(e,a){let{state:l,value:o,presentation:r,shown:m}=e;return{...a,"data-state":l,...l==="auto"?$("auto",e.autoTable):{},"data-presentation":r,"data-mode":o===void 0?void 0:o==="closed"?"collapsed":"expanded","data-open":r==="stacked"&&m?"":void 0,"data-peek":e.peeking?"":void 0}}function se(e,a){let l=B(e),o=t.useMemo(()=>C(e,()=>a),[l,a]),r=t.useMemo(()=>b(o)===void 0?$("presentation",o):{},[o]);return{table:o,attributes:r}}export{re as a,ue as b,se as c};
3
- //# sourceMappingURL=chunk-KGCGT4MJ.js.map