@kushagradhawan/kookie-ui 0.1.107 → 0.1.109

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 (57) hide show
  1. package/components.css +80 -51
  2. package/dist/cjs/components/_internal/shell-bottom.d.ts +2 -0
  3. package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
  4. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  5. package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
  6. package/dist/cjs/components/_internal/shell-inspector.d.ts +2 -0
  7. package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
  8. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  9. package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
  10. package/dist/cjs/components/_internal/shell-sidebar.d.ts +2 -0
  11. package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
  12. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  13. package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
  14. package/dist/cjs/components/shell.context.d.ts +13 -0
  15. package/dist/cjs/components/shell.context.d.ts.map +1 -1
  16. package/dist/cjs/components/shell.context.js +1 -1
  17. package/dist/cjs/components/shell.context.js.map +3 -3
  18. package/dist/cjs/components/shell.d.ts +14 -6
  19. package/dist/cjs/components/shell.d.ts.map +1 -1
  20. package/dist/cjs/components/shell.js +1 -1
  21. package/dist/cjs/components/shell.js.map +3 -3
  22. package/dist/esm/components/_internal/shell-bottom.d.ts +2 -0
  23. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  24. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  25. package/dist/esm/components/_internal/shell-bottom.js.map +3 -3
  26. package/dist/esm/components/_internal/shell-inspector.d.ts +2 -0
  27. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  28. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  29. package/dist/esm/components/_internal/shell-inspector.js.map +3 -3
  30. package/dist/esm/components/_internal/shell-sidebar.d.ts +2 -0
  31. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  32. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  33. package/dist/esm/components/_internal/shell-sidebar.js.map +3 -3
  34. package/dist/esm/components/shell.context.d.ts +13 -0
  35. package/dist/esm/components/shell.context.d.ts.map +1 -1
  36. package/dist/esm/components/shell.context.js +1 -1
  37. package/dist/esm/components/shell.context.js.map +3 -3
  38. package/dist/esm/components/shell.d.ts +14 -6
  39. package/dist/esm/components/shell.d.ts.map +1 -1
  40. package/dist/esm/components/shell.js +1 -1
  41. package/dist/esm/components/shell.js.map +3 -3
  42. package/package.json +1 -1
  43. package/schemas/base-button.json +1 -1
  44. package/schemas/button.json +1 -1
  45. package/schemas/icon-button.json +1 -1
  46. package/schemas/index.json +6 -6
  47. package/schemas/toggle-button.json +1 -1
  48. package/schemas/toggle-icon-button.json +1 -1
  49. package/src/components/_internal/shell-bottom.tsx +15 -1
  50. package/src/components/_internal/shell-inspector.tsx +15 -1
  51. package/src/components/_internal/shell-sidebar.tsx +15 -1
  52. package/src/components/segmented-control.css +37 -37
  53. package/src/components/sheet.css +12 -0
  54. package/src/components/shell.context.tsx +14 -0
  55. package/src/components/shell.css +51 -28
  56. package/src/components/shell.tsx +150 -81
  57. package/styles.css +80 -51
@@ -1,2 +1,2 @@
1
- "use strict";var be=Object.create;var C=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty;var Ee=(s,i)=>{for(var l in i)C(s,l,{get:i[l],enumerable:!0})},ne=(s,i,l,R)=>{if(i&&typeof i=="object"||typeof i=="function")for(let c of Ce(i))!ve.call(s,c)&&c!==l&&C(s,c,{get:()=>i[c],enumerable:!(R=xe(i,c))||R.enumerable});return s};var $=(s,i,l)=>(l=s!=null?be(ge(s)):{},ne(i||!s||!s.__esModule?C(l,"default",{value:s,enumerable:!0}):l,s)),Oe=s=>ne(C({},"__esModule",{value:!0}),s);var Ne={};Ee(Ne,{Inspector:()=>A});module.exports=Oe(Ne);var n=$(require("react")),te=$(require("classnames")),L=$(require("../sheet.js")),oe=require("../visually-hidden.js"),re=require("../shell.context.js"),g=require("../shell.hooks.js"),se=require("./shell-resize.js"),h=require("./shell-handles.js"),we=require("../shell.types.js"),z=require("./shell-prop-helpers.js"),ie=require("../../helpers/normalize-to-px.js");const Te=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style"],A=n.forwardRef((s,i)=>{const{className:l,presentation:R={initial:"overlay",lg:"fixed"},defaultOpen:c,open:p,onOpenChange:P,expandedSize:v=320,minSize:f=200,maxSize:m=500,resizable:E=!1,collapsible:ae=!0,onExpand:j,onCollapse:F,onResize:O,onResizeStart:le,onResizeEnd:ce,snapPoints:pe,snapTolerance:de,collapseThreshold:ue,paneId:T,persistence:N,children:fe,style:me,onSizeChange:k,sizeUpdate:w,sizeUpdateMs:D=50,size:q,defaultSize:K}=s,ye=(0,z.extractPaneDomProps)(s,Te),t=(0,re.useShell)(),V=(0,g.useResponsivePresentation)(R),I=V==="overlay",he=V==="stacked",d=n.useRef(null),Pe=n.useCallback(e=>{d.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),Y=n.Children.toArray(fe),G=Y.filter(e=>n.isValidElement(e)&&e.type===h.InspectorHandle),J=Y.filter(e=>!(n.isValidElement(e)&&e.type===h.InspectorHandle)),ze=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(p),[p]),Re=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(c),[c]),Ie=typeof p=="object"&&p!==null;(0,g.useResponsiveInitialState)({controlledValue:ze,defaultValue:Re,currentValue:t.inspectorMode,setValue:t.setInspectorMode,breakpointReady:t.currentBreakpointReady,controlledIsResponsive:Ie,onResponsiveChange:e=>P?.(e==="expanded",{reason:"responsive"}),onInit:e=>{typeof p>"u"&&P?.(e==="expanded",{reason:"init"})}});const y=n.useRef(null);n.useEffect(()=>()=>{y.current&&(clearTimeout(y.current),y.current=null)},[k,w,D]);const M=n.useMemo(()=>{const e=k,r=w,a=D??50;if(!e)return()=>{};if(r==="debounce")return(o,u)=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{e(o,u),y.current=null},a)};if(r==="throttle"){let o=0;return(u,Se)=>{const ee=Date.now();ee-o>=a&&(o=ee,e(u,Se))}}return(o,u)=>e(o,u)},[k,w,D]),S=n.useRef(null);n.useEffect(()=>{const e=typeof p<"u";if(S.current===null){S.current=e;return}S.current!==e&&(console.warn("Shell.Inspector: Switching between controlled and uncontrolled `open` is not supported."),S.current=e)},[p]);const Q=n.useRef(!1),B=n.useRef(null);n.useEffect(()=>{!Q.current&&typeof p>"u"&&c&&t.inspectorMode==="expanded"&&(P?.(!0,{reason:"init"}),Q.current=!0),typeof p>"u"&&(B.current!==null&&B.current!==t.inspectorMode&&P?.(t.inspectorMode==="expanded",{reason:"toggle"}),B.current=t.inspectorMode)},[t.inspectorMode,p,c,P]);const W=n.useRef(j),X=n.useRef(F);n.useLayoutEffect(()=>{W.current=j,X.current=F});const b=n.useRef(null),Z=n.useRef(!1);n.useEffect(()=>{const e=t.inspectorMode;if(!t.currentBreakpointReady){b.current=e;return}if(!Z.current){Z.current=!0,b.current=e;return}const r=b.current;r!==null&&r!==e&&(e==="expanded"?W.current?.():e==="collapsed"&&X.current?.(),b.current=e)},[t.inspectorMode,t.currentBreakpointReady]);const H=t.inspectorMode==="expanded",x=n.useMemo(()=>{if(!T||N)return N;const e=`kookie-ui:shell:inspector:${T}`;return{load:()=>{if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e);return a?Number(a):void 0}catch{return}},save:a=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(a))}catch{}}}},[T,N]);n.useEffect(()=>{let e=!0;if(!E||!x?.load||I)return;const r=x.load(),a=o=>{!e||typeof o!="number"||!d.current||(d.current.style.setProperty("--inspector-size",`${o}px`),O?.(o))};return r instanceof Promise?r.then(a).catch(o=>{}):a(r),()=>{e=!1}},[E,x,O,I]);const Me=E&&!I&&H?n.createElement(se.PaneResizeContext.Provider,{value:{containerRef:d,cssVarName:"--inspector-size",minSize:f,maxSize:m,defaultSize:v,orientation:"vertical",edge:"start",computeNext:(e,r,a)=>{const o=getComputedStyle(d.current).direction==="rtl",u=e-r;return a+(o?u:-u)},onResize:O,onResizeStart:le,onResizeEnd:e=>{ce?.(e),M(e,{reason:"resize"}),x?.save?.(e)},target:"inspector",collapsible:ae,snapPoints:pe,snapTolerance:de??8,collapseThreshold:ue,requestCollapse:()=>t.setInspectorMode("collapsed"),requestToggle:()=>t.togglePane("inspector")}},G.length>0?G.map((e,r)=>n.cloneElement(e,{key:e.key??r})):n.createElement(h.PaneHandle,null)):null,U=n.useCallback(e=>(0,ie.normalizeToPx)(e,"horizontal"),[]);n.useEffect(()=>{if(d.current&&typeof q>"u"&&typeof K<"u"){const e=U(K);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),M(o,{reason:"init"})}}},[]);const _=q;if(n.useEffect(()=>{if(!d.current||typeof _>"u")return;const e=U(_);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),M(o,{reason:"controlled"})}},[_,f,m,U,M]),I){const e=t.inspectorMode==="expanded";return n.createElement(L.Root,{open:e,onOpenChange:r=>t.setInspectorMode(r?"expanded":"collapsed")},n.createElement(L.Content,{side:"end",style:{padding:0},width:{initial:`${v}px`}},n.createElement(oe.VisuallyHidden,null,n.createElement(L.Title,null,"Inspector")),J))}return n.createElement("div",{...ye,ref:Pe,className:(0,te.default)("rt-ShellInspector",l),"data-mode":t.inspectorMode,"data-peek":t.peekTarget==="inspector"||void 0,"data-presentation":t.currentBreakpointReady?V:void 0,"data-open":t.currentBreakpointReady&&he&&H||void 0,style:{...me,"--inspector-size":`${v}px`,"--inspector-min-size":`${f}px`,"--inspector-max-size":`${m}px`}},n.createElement("div",{className:"rt-ShellInspectorContent","data-visible":H||void 0},J),Me)});A.displayName="Shell.Inspector",A.Handle=h.InspectorHandle;
1
+ "use strict";var Ce=Object.create;var g=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Ne=(s,i)=>{for(var l in i)g(s,l,{get:i[l],enumerable:!0})},se=(s,i,l,R)=>{if(i&&typeof i=="object"||typeof i=="function")for(let c of Ee(i))!Te.call(s,c)&&c!==l&&g(s,c,{get:()=>i[c],enumerable:!(R=ve(i,c))||R.enumerable});return s};var A=(s,i,l)=>(l=s!=null?Ce(Oe(s)):{},se(i||!s||!s.__esModule?g(l,"default",{value:s,enumerable:!0}):l,s)),ke=s=>se(g({},"__esModule",{value:!0}),s);var De={};Ne(De,{Inspector:()=>F});module.exports=ke(De);var n=A(require("react")),ie=A(require("classnames")),j=A(require("../sheet.js")),ae=require("../visually-hidden.js"),C=require("../shell.context.js"),v=require("../shell.hooks.js"),le=require("./shell-resize.js"),h=require("./shell-handles.js"),Be=require("../shell.types.js"),z=require("./shell-prop-helpers.js"),ce=require("../../helpers/normalize-to-px.js");const we=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style","inset"],F=n.forwardRef((s,i)=>{const{className:l,presentation:R={initial:"overlay",lg:"fixed"},defaultOpen:c,open:p,onOpenChange:P,expandedSize:E=320,minSize:f=200,maxSize:m=500,resizable:O=!1,collapsible:pe=!0,onExpand:q,onCollapse:K,onResize:T,onResizeStart:de,onResizeEnd:ue,snapPoints:fe,snapTolerance:me,collapseThreshold:ye,paneId:N,persistence:k,children:he,style:Pe,onSizeChange:w,sizeUpdate:D,sizeUpdateMs:V=50,size:Y,defaultSize:G,inset:B}=s,ze=(0,z.extractPaneDomProps)(s,we),t=(0,C.useShell)(),{registerInset:J,unregisterInset:Q}=(0,C.useInset)();n.useEffect(()=>{if(B)return J("inspector"),()=>Q("inspector")},[B,J,Q]);const H=(0,v.useResponsivePresentation)(R),I=H==="overlay",Re=H==="stacked",d=n.useRef(null),Ie=n.useCallback(e=>{d.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),W=n.Children.toArray(he),X=W.filter(e=>n.isValidElement(e)&&e.type===h.InspectorHandle),Z=W.filter(e=>!(n.isValidElement(e)&&e.type===h.InspectorHandle)),be=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(p),[p]),Me=n.useMemo(()=>(0,z.mapResponsiveBooleanToPaneMode)(c),[c]),Se=typeof p=="object"&&p!==null;(0,v.useResponsiveInitialState)({controlledValue:be,defaultValue:Me,currentValue:t.inspectorMode,setValue:t.setInspectorMode,breakpointReady:t.currentBreakpointReady,controlledIsResponsive:Se,onResponsiveChange:e=>P?.(e==="expanded",{reason:"responsive"}),onInit:e=>{typeof p>"u"&&P?.(e==="expanded",{reason:"init"})}});const y=n.useRef(null);n.useEffect(()=>()=>{y.current&&(clearTimeout(y.current),y.current=null)},[w,D,V]);const b=n.useMemo(()=>{const e=w,r=D,a=V??50;if(!e)return()=>{};if(r==="debounce")return(o,u)=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{e(o,u),y.current=null},a)};if(r==="throttle"){let o=0;return(u,ge)=>{const re=Date.now();re-o>=a&&(o=re,e(u,ge))}}return(o,u)=>e(o,u)},[w,D,V]),M=n.useRef(null);n.useEffect(()=>{const e=typeof p<"u";if(M.current===null){M.current=e;return}M.current!==e&&(console.warn("Shell.Inspector: Switching between controlled and uncontrolled `open` is not supported."),M.current=e)},[p]);const ee=n.useRef(!1),U=n.useRef(null);n.useEffect(()=>{!ee.current&&typeof p>"u"&&c&&t.inspectorMode==="expanded"&&(P?.(!0,{reason:"init"}),ee.current=!0),typeof p>"u"&&(U.current!==null&&U.current!==t.inspectorMode&&P?.(t.inspectorMode==="expanded",{reason:"toggle"}),U.current=t.inspectorMode)},[t.inspectorMode,p,c,P]);const ne=n.useRef(q),te=n.useRef(K);n.useLayoutEffect(()=>{ne.current=q,te.current=K});const S=n.useRef(null),oe=n.useRef(!1);n.useEffect(()=>{const e=t.inspectorMode;if(!t.currentBreakpointReady){S.current=e;return}if(!oe.current){oe.current=!0,S.current=e;return}const r=S.current;r!==null&&r!==e&&(e==="expanded"?ne.current?.():e==="collapsed"&&te.current?.(),S.current=e)},[t.inspectorMode,t.currentBreakpointReady]);const _=t.inspectorMode==="expanded",x=n.useMemo(()=>{if(!N||k)return k;const e=`kookie-ui:shell:inspector:${N}`;return{load:()=>{if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e);return a?Number(a):void 0}catch{return}},save:a=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(a))}catch{}}}},[N,k]);n.useEffect(()=>{let e=!0;if(!O||!x?.load||I)return;const r=x.load(),a=o=>{!e||typeof o!="number"||!d.current||(d.current.style.setProperty("--inspector-size",`${o}px`),T?.(o))};return r instanceof Promise?r.then(a).catch(o=>{}):a(r),()=>{e=!1}},[O,x,T,I]);const xe=O&&!I&&_?n.createElement(le.PaneResizeContext.Provider,{value:{containerRef:d,cssVarName:"--inspector-size",minSize:f,maxSize:m,defaultSize:E,orientation:"vertical",edge:"start",computeNext:(e,r,a)=>{const o=getComputedStyle(d.current).direction==="rtl",u=e-r;return a+(o?u:-u)},onResize:T,onResizeStart:de,onResizeEnd:e=>{ue?.(e),b(e,{reason:"resize"}),x?.save?.(e)},target:"inspector",collapsible:pe,snapPoints:fe,snapTolerance:me??8,collapseThreshold:ye,requestCollapse:()=>t.setInspectorMode("collapsed"),requestToggle:()=>t.togglePane("inspector")}},X.length>0?X.map((e,r)=>n.cloneElement(e,{key:e.key??r})):n.createElement(h.PaneHandle,null)):null,$=n.useCallback(e=>(0,ce.normalizeToPx)(e,"horizontal"),[]);n.useEffect(()=>{if(d.current&&typeof Y>"u"&&typeof G<"u"){const e=$(G);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),b(o,{reason:"init"})}}},[]);const L=Y;if(n.useEffect(()=>{if(!d.current||typeof L>"u")return;const e=$(L);if(typeof e=="number"&&Number.isFinite(e)){const o=Math.min((typeof m=="number"?m:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));d.current.style.setProperty("--inspector-size",`${o}px`),b(o,{reason:"controlled"})}},[L,f,m,$,b]),I){const e=t.inspectorMode==="expanded";return n.createElement(j.Root,{open:e,onOpenChange:r=>t.setInspectorMode(r?"expanded":"collapsed")},n.createElement(j.Content,{side:"end",style:{padding:0},width:{initial:`${E}px`}},n.createElement(ae.VisuallyHidden,null,n.createElement(j.Title,null,"Inspector")),Z))}return n.createElement("div",{...ze,ref:Ie,className:(0,ie.default)("rt-ShellInspector",l),"data-mode":t.inspectorMode,"data-peek":t.peekTarget==="inspector"||void 0,"data-presentation":t.currentBreakpointReady?H:void 0,"data-open":t.currentBreakpointReady&&Re&&_||void 0,"data-inset":B||void 0,style:{...Pe,"--inspector-size":`${E}px`,"--inspector-min-size":`${f}px`,"--inspector-max-size":`${m}px`}},n.createElement("div",{className:"rt-ShellInspectorContent","data-visible":_||void 0},Z),xe)});F.displayName="Shell.Inspector",F.Handle=h.InspectorHandle;
2
2
  //# sourceMappingURL=shell-inspector.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/_internal/shell-inspector.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { InspectorHandle, PaneHandle } from './shell-handles.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, PaneBaseProps } from '../shell.types.js';\nimport { extractPaneDomProps, mapResponsiveBooleanToPaneMode } from './shell-prop-helpers.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype InspectorOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\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 InspectorSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\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: InspectorSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n };\n\ntype InspectorComponent = React.ForwardRefExoticComponent<InspectorPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof InspectorHandle };\n\nconst INSPECTOR_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'defaultOpen',\n 'open',\n 'onOpenChange',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n] as const satisfies readonly (keyof InspectorPublicProps)[];\n\nexport const Inspector = React.forwardRef<HTMLDivElement, InspectorPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = { initial: 'overlay', lg: 'fixed' },\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 } = initialProps;\n const inspectorDomProps = extractPaneDomProps(initialProps, INSPECTOR_DOM_PROP_KEYS);\n const shell = useShell();\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.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 const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === InspectorHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === InspectorHandle));\n\n // Throttled/debounced emitter for onSizeChange\n const normalizedControlledOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(open), [open]);\n const normalizedDefaultOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(defaultOpen), [defaultOpen]);\n const openIsResponsive = typeof open === 'object' && open !== null;\n useResponsiveInitialState<PaneMode>({\n controlledValue: normalizedControlledOpen,\n defaultValue: normalizedDefaultOpen,\n currentValue: shell.inspectorMode,\n setValue: shell.setInspectorMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: openIsResponsive,\n onResponsiveChange: (next) => onOpenChange?.(next === 'expanded', { reason: 'responsive' }),\n onInit: (initial) => {\n if (typeof open === 'undefined') {\n onOpenChange?.(initial === 'expanded', { reason: 'init' });\n }\n },\n });\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: InspectorSizeChangeMeta) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: InspectorSizeChangeMeta) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: InspectorSizeChangeMeta) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: InspectorSizeChangeMeta) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof open !== 'undefined' && typeof defaultOpen !== 'undefined') {\n console.error('Shell.Inspector: Do not pass both `open` and `defaultOpen`. Choose one.');\n }\n }\n\n // Warn on controlled/uncontrolled mode switch\n React.useEffect(() => {\n const isControlled = typeof open !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Inspector: Switching between controlled and uncontrolled `open` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [open]);\n\n const initNotifiedRef = React.useRef(false);\n const lastInspectorModeRef = React.useRef<PaneMode | null>(null);\n React.useEffect(() => {\n // Notify init open\n if (!initNotifiedRef.current && typeof open === 'undefined' && defaultOpen && shell.inspectorMode === 'expanded') {\n onOpenChange?.(true, { reason: 'init' });\n initNotifiedRef.current = true;\n }\n\n // Notify toggles when uncontrolled (avoid double-notify after responsive change)\n if (typeof open === 'undefined') {\n if (lastInspectorModeRef.current !== null && lastInspectorModeRef.current !== shell.inspectorMode) {\n onOpenChange?.(shell.inspectorMode === 'expanded', { reason: 'toggle' });\n }\n lastInspectorModeRef.current = shell.inspectorMode;\n }\n }, [shell.inspectorMode, open, defaultOpen, onOpenChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevInspectorModeRef = React.useRef<PaneMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.inspectorMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevInspectorModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevInspectorModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevInspectorModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n if (currentMode === 'expanded') {\n onExpandRef.current?.();\n } else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevInspectorModeRef.current = currentMode;\n }\n }, [shell.inspectorMode, shell.currentBreakpointReady]);\n\n const isExpanded = shell.inspectorMode === 'expanded';\n\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:inspector:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n if (!resizable || !persistenceAdapter?.load || isOverlay) return undefined;\n const loaded = persistenceAdapter.load();\n const applyLoaded = (value?: number) => {\n if (!mounted || typeof value !== 'number' || !localRef.current) return;\n localRef.current.style.setProperty('--inspector-size', `${value}px`);\n onResize?.(value);\n };\n if (loaded instanceof Promise) {\n loaded.then(applyLoaded).catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to load persisted size', err);\n }\n });\n } else {\n applyLoaded(loaded);\n }\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n const handleEl =\n resizable && !isOverlay && isExpanded ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--inspector-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'vertical',\n edge: 'start',\n computeNext: (client, startClient, startSize) => {\n const isRtl = getComputedStyle(localRef.current!).direction === 'rtl';\n const delta = client - startClient;\n return startSize + (isRtl ? delta : -delta);\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'inspector',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setInspectorMode('collapsed'),\n requestToggle: () => shell.togglePane('inspector'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'horizontal'), []);\n\n // Apply defaultSize on mount when uncontrolled\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--inspector-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--inspector-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.inspectorMode === 'expanded';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setInspectorMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content side=\"end\" style={{ padding: 0 }} width={{ initial: `${expandedSize}px` }}>\n <VisuallyHidden>\n <Sheet.Title>Inspector</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n\n // Strip control/size props from DOM spread\n return (\n <div\n {...inspectorDomProps}\n ref={setRef}\n className={classNames('rt-ShellInspector', className)}\n data-mode={shell.inspectorMode}\n data-peek={shell.peekTarget === 'inspector' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isExpanded) || undefined}\n style={{\n ...style,\n ['--inspector-size' as any]: `${expandedSize}px`,\n ['--inspector-min-size' as any]: `${minSize}px`,\n ['--inspector-max-size' as any]: `${maxSize}px`,\n }}\n >\n <div className=\"rt-ShellInspectorContent\" data-visible={isExpanded || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as InspectorComponent;\n\nInspector.displayName = 'Shell.Inspector';\nInspector.Handle = InspectorHandle;\n"],
5
- "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,eAAAE,IAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAuB,oBACvBC,GAAuB,yBACvBC,EAAuB,0BACvBC,GAA+B,iCAC/BC,GAAyB,+BACzBC,EAAqE,6BACrEC,GAAkC,6BAClCC,EAA4C,8BAC5CC,GAA6B,6BAE7BC,EAAoE,mCACpEC,GAA8B,4CAkB9B,MAAMC,GAA0B,CAC9B,YACA,WACA,cACA,OACA,eACA,OACA,cACA,eACA,aACA,eACA,OACF,EAEab,EAAYE,EAAM,WAAiD,CAACY,EAAcC,IAAQ,CACrG,KAAM,CACJ,UAAAC,EACA,aAAAC,EAAe,CAAE,QAAS,UAAW,GAAI,OAAQ,EACjD,YAAAC,EACA,KAAAC,EACA,aAAAC,EACA,aAAAC,EAAe,IACf,QAAAC,EAAU,IACV,QAAAC,EAAU,IACV,UAAAC,EAAY,GACZ,YAAAC,GAAc,GACd,SAAAC,EACA,WAAAC,EACA,SAAAC,EACA,cAAAC,GACA,YAAAC,GACA,WAAAC,GACA,cAAAC,GACA,kBAAAC,GACA,OAAAC,E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AeoC,EAAS,CAAE,OAAQ,YAAa,CAAC,CAClD,CACF,EAAG,CAACC,EAAgB5E,EAASC,EAASwE,EAAmBlC,CAAc,CAAC,EAEpEf,EAAW,CACb,MAAM3B,EAAOyB,EAAM,gBAAkB,WACrC,OACE1C,EAAA,cAACE,EAAM,KAAN,CAAW,KAAMe,EAAM,aAAegF,GAAMvD,EAAM,iBAAiBuD,EAAI,WAAa,WAAW,GAC9FjG,EAAA,cAACE,EAAM,QAAN,CAAc,KAAK,MAAM,MAAO,CAAE,QAAS,CAAE,EAAG,MAAO,CAAE,QAAS,GAAGiB,CAAY,IAAK,GACrFnB,EAAA,cAAC,uBACCA,EAAA,cAACE,EAAM,MAAN,KAAY,WAAS,CACxB,EACCkD,CACH,CACF,CAEJ,CAGA,OACEpD,EAAA,cAAC,OACE,GAAGyC,GACJ,IAAKM,GACL,aAAW,GAAAmD,SAAW,oBAAqBpF,CAAS,EACpD,YAAW4B,EAAM,cACjB,YAAWA,EAAM,aAAe,aAAe,OAC/C,oBAAmBA,EAAM,uBAAyBC,EAAuB,OACzE,YAAYD,EAAM,wBAA0BG,IAAagC,GAAe,OACxE,MAAO,CACL,GAAG1C,GACF,mBAA4B,GAAGhB,CAAY,KAC3C,uBAAgC,GAAGC,CAAO,KAC1C,uBAAgC,GAAGC,CAAO,IAC7C,GAEArB,EAAA,cAAC,OAAI,UAAU,2BAA2B,eAAc6E,GAAc,QACnEzB,CACH,EACCkC,EACH,CAEJ,CAAC,EAEDxF,EAAU,YAAc,kBACxBA,EAAU,OAAS",
6
- "names": ["shell_inspector_exports", "__export", "Inspector", "__toCommonJS", "React", "import_classnames", "Sheet", "import_visually_hidden", "import_shell_context", "import_shell_hooks", "import_shell_resize", "import_shell_handles", "import_shell_types", "import_shell_prop_helpers", "import_normalize_to_px", "INSPECTOR_DOM_PROP_KEYS", "initialProps", "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", "inspectorDomProps", "shell", "resolvedPresentation", "isOverlay", "isStacked", "localRef", "setRef", "node", "childArray", "handleChildren", "el", "contentChildren", "normalizedControlledOpen", "normalizedDefaultOpen", "openIsResponsive", "next", "initial", "debounceTimeoutRef", "emitSizeChange", "cb", "strategy", "ms", "s", "meta", "last", "now", "wasControlledRef", "isControlled", "initNotifiedRef", "lastInspectorModeRef", "onExpandRef", "onCollapseRef", "prevInspectorModeRef", "hasInitializedRef", "currentMode", "prevMode", "isExpanded", "persistenceAdapter", "key", "v", "mounted", "loaded", "applyLoaded", "value", "err", "handleEl", "client", "startClient", "startSize", "isRtl", "delta", "i", "normalizeSizeToPx", "px", "clamped", "controlledSize", "o", "classNames"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell, useInset } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { InspectorHandle, PaneHandle } from './shell-handles.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, PaneBaseProps } from '../shell.types.js';\nimport { extractPaneDomProps, mapResponsiveBooleanToPaneMode } from './shell-prop-helpers.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype InspectorOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\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 InspectorSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\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: InspectorSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers gray backdrop on Shell. */\n inset?: boolean;\n };\n\ntype InspectorComponent = React.ForwardRefExoticComponent<InspectorPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof InspectorHandle };\n\nconst INSPECTOR_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'defaultOpen',\n 'open',\n 'onOpenChange',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n 'inset',\n] as const satisfies readonly (keyof InspectorPublicProps)[];\n\nexport const Inspector = React.forwardRef<HTMLDivElement, InspectorPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = { initial: 'overlay', lg: 'fixed' },\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 inset,\n } = initialProps;\n const inspectorDomProps = extractPaneDomProps(initialProps, INSPECTOR_DOM_PROP_KEYS);\n const shell = useShell();\n const { registerInset, unregisterInset } = useInset();\n\n // Register/unregister inset\n React.useEffect(() => {\n if (inset) {\n registerInset('inspector');\n return () => unregisterInset('inspector');\n }\n }, [inset, registerInset, unregisterInset]);\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.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 const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === InspectorHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === InspectorHandle));\n\n // Throttled/debounced emitter for onSizeChange\n const normalizedControlledOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(open), [open]);\n const normalizedDefaultOpen = React.useMemo(() => mapResponsiveBooleanToPaneMode(defaultOpen), [defaultOpen]);\n const openIsResponsive = typeof open === 'object' && open !== null;\n useResponsiveInitialState<PaneMode>({\n controlledValue: normalizedControlledOpen,\n defaultValue: normalizedDefaultOpen,\n currentValue: shell.inspectorMode,\n setValue: shell.setInspectorMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: openIsResponsive,\n onResponsiveChange: (next) => onOpenChange?.(next === 'expanded', { reason: 'responsive' }),\n onInit: (initial) => {\n if (typeof open === 'undefined') {\n onOpenChange?.(initial === 'expanded', { reason: 'init' });\n }\n },\n });\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: InspectorSizeChangeMeta) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: InspectorSizeChangeMeta) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: InspectorSizeChangeMeta) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: InspectorSizeChangeMeta) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof open !== 'undefined' && typeof defaultOpen !== 'undefined') {\n console.error('Shell.Inspector: Do not pass both `open` and `defaultOpen`. Choose one.');\n }\n }\n\n // Warn on controlled/uncontrolled mode switch\n React.useEffect(() => {\n const isControlled = typeof open !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Inspector: Switching between controlled and uncontrolled `open` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [open]);\n\n const initNotifiedRef = React.useRef(false);\n const lastInspectorModeRef = React.useRef<PaneMode | null>(null);\n React.useEffect(() => {\n // Notify init open\n if (!initNotifiedRef.current && typeof open === 'undefined' && defaultOpen && shell.inspectorMode === 'expanded') {\n onOpenChange?.(true, { reason: 'init' });\n initNotifiedRef.current = true;\n }\n\n // Notify toggles when uncontrolled (avoid double-notify after responsive change)\n if (typeof open === 'undefined') {\n if (lastInspectorModeRef.current !== null && lastInspectorModeRef.current !== shell.inspectorMode) {\n onOpenChange?.(shell.inspectorMode === 'expanded', { reason: 'toggle' });\n }\n lastInspectorModeRef.current = shell.inspectorMode;\n }\n }, [shell.inspectorMode, open, defaultOpen, onOpenChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevInspectorModeRef = React.useRef<PaneMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.inspectorMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevInspectorModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevInspectorModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevInspectorModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n if (currentMode === 'expanded') {\n onExpandRef.current?.();\n } else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevInspectorModeRef.current = currentMode;\n }\n }, [shell.inspectorMode, shell.currentBreakpointReady]);\n\n const isExpanded = shell.inspectorMode === 'expanded';\n\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:inspector:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n if (!resizable || !persistenceAdapter?.load || isOverlay) return undefined;\n const loaded = persistenceAdapter.load();\n const applyLoaded = (value?: number) => {\n if (!mounted || typeof value !== 'number' || !localRef.current) return;\n localRef.current.style.setProperty('--inspector-size', `${value}px`);\n onResize?.(value);\n };\n if (loaded instanceof Promise) {\n loaded.then(applyLoaded).catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Inspector: failed to load persisted size', err);\n }\n });\n } else {\n applyLoaded(loaded);\n }\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n const handleEl =\n resizable && !isOverlay && isExpanded ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--inspector-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'vertical',\n edge: 'start',\n computeNext: (client, startClient, startSize) => {\n const isRtl = getComputedStyle(localRef.current!).direction === 'rtl';\n const delta = client - startClient;\n return startSize + (isRtl ? delta : -delta);\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'inspector',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setInspectorMode('collapsed'),\n requestToggle: () => shell.togglePane('inspector'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'horizontal'), []);\n\n // Apply defaultSize on mount when uncontrolled\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--inspector-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--inspector-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.inspectorMode === 'expanded';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setInspectorMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content side=\"end\" style={{ padding: 0 }} width={{ initial: `${expandedSize}px` }}>\n <VisuallyHidden>\n <Sheet.Title>Inspector</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n\n // Strip control/size props from DOM spread\n return (\n <div\n {...inspectorDomProps}\n ref={setRef}\n className={classNames('rt-ShellInspector', className)}\n data-mode={shell.inspectorMode}\n data-peek={shell.peekTarget === 'inspector' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isExpanded) || undefined}\n data-inset={inset || undefined}\n style={{\n ...style,\n ['--inspector-size' as any]: `${expandedSize}px`,\n ['--inspector-min-size' as any]: `${minSize}px`,\n ['--inspector-max-size' as any]: `${maxSize}px`,\n }}\n >\n <div className=\"rt-ShellInspectorContent\" data-visible={isExpanded || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as InspectorComponent;\n\nInspector.displayName = 'Shell.Inspector';\nInspector.Handle = InspectorHandle;\n"],
5
+ "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,eAAAE,IAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAuB,oBACvBC,GAAuB,yBACvBC,EAAuB,0BACvBC,GAA+B,iCAC/BC,EAAmC,+BACnCC,EAAqE,6BACrEC,GAAkC,6BAClCC,EAA4C,8BAC5CC,GAA6B,6BAE7BC,EAAoE,mCACpEC,GAA8B,4CAoB9B,MAAMC,GAA0B,CAC9B,YACA,WACA,cACA,OACA,eACA,OACA,cACA,eACA,aACA,eACA,QACA,OACF,EAEab,EAAYE,EAAM,WAAiD,CAACY,EAAcC,IAAQ,CACrG,KAAM,CACJ,UAAAC,EACA,aAAAC,EAAe,CAAE,QAAS,UAAW,GAAI,OAAQ,EACjD,YAAAC,EACA,KAAAC,EACA,aAAAC,EACA,aAAAC,EAAe,IACf,QAAAC,EAAU,IACV,QAAAC,EAAU,IACV,UAAAC,EAAY,GACZ,YAAAC,GAAc,GACd,SAAAC,EACA,WAAAC,EACA,SAAAC,EACA,cAAAC,GACA,YAAAC,GACA,WAAAC,GACA,cAAAC,GACA,kBAAAC,GACA,OAAAC,EACA,YAAAC,EACA,SAAAC,GACA,MAAAC,GACA,aAAAC,EACA,WAAAC,EACA,aAAAC,EAAe,GACf,KAAAC,EACA,YAAAC,EACA,MAAAC,CACF,EAAI7B,EACE8B,MAAoB,uBAAoB9B,EAAcD,EAAuB,EAC7EgC,KAAQ,YAAS,EACjB,CAAE,cAAAC,EAAe,gBAAAC,CAAgB,KAAI,YAAS,EAGpD7C,EAAM,UAAU,IAAM,CACpB,GAAIyC,EACF,OAAAG,EAAc,WAAW,EAClB,IAA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,EAEpEf,EAAW,CACb,MAAM9B,EAAO0B,EAAM,gBAAkB,WACrC,OACE3C,EAAA,cAACE,EAAM,KAAN,CAAW,KAAMe,EAAM,aAAemF,GAAMzD,EAAM,iBAAiByD,EAAI,WAAa,WAAW,GAC9FpG,EAAA,cAACE,EAAM,QAAN,CAAc,KAAK,MAAM,MAAO,CAAE,QAAS,CAAE,EAAG,MAAO,CAAE,QAAS,GAAGiB,CAAY,IAAK,GACrFnB,EAAA,cAAC,uBACCA,EAAA,cAACE,EAAM,MAAN,KAAY,WAAS,CACxB,EACCqD,CACH,CACF,CAEJ,CAGA,OACEvD,EAAA,cAAC,OACE,GAAG0C,GACJ,IAAKQ,GACL,aAAW,GAAAmD,SAAW,oBAAqBvF,CAAS,EACpD,YAAW6B,EAAM,cACjB,YAAWA,EAAM,aAAe,aAAe,OAC/C,oBAAmBA,EAAM,uBAAyBG,EAAuB,OACzE,YAAYH,EAAM,wBAA0BK,IAAagC,GAAe,OACxE,aAAYvC,GAAS,OACrB,MAAO,CACL,GAAGN,GACF,mBAA4B,GAAGhB,CAAY,KAC3C,uBAAgC,GAAGC,CAAO,KAC1C,uBAAgC,GAAGC,CAAO,IAC7C,GAEArB,EAAA,cAAC,OAAI,UAAU,2BAA2B,eAAcgF,GAAc,QACnEzB,CACH,EACCkC,EACH,CAEJ,CAAC,EAED3F,EAAU,YAAc,kBACxBA,EAAU,OAAS",
6
+ "names": ["shell_inspector_exports", "__export", "Inspector", "__toCommonJS", "React", "import_classnames", "Sheet", "import_visually_hidden", "import_shell_context", "import_shell_hooks", "import_shell_resize", "import_shell_handles", "import_shell_types", "import_shell_prop_helpers", "import_normalize_to_px", "INSPECTOR_DOM_PROP_KEYS", "initialProps", "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", "inset", "inspectorDomProps", "shell", "registerInset", "unregisterInset", "resolvedPresentation", "isOverlay", "isStacked", "localRef", "setRef", "node", "childArray", "handleChildren", "el", "contentChildren", "normalizedControlledOpen", "normalizedDefaultOpen", "openIsResponsive", "next", "initial", "debounceTimeoutRef", "emitSizeChange", "cb", "strategy", "ms", "s", "meta", "last", "now", "wasControlledRef", "isControlled", "initNotifiedRef", "lastInspectorModeRef", "onExpandRef", "onCollapseRef", "prevInspectorModeRef", "hasInitializedRef", "currentMode", "prevMode", "isExpanded", "persistenceAdapter", "key", "v", "mounted", "loaded", "applyLoaded", "value", "err", "handleEl", "client", "startClient", "startSize", "isRtl", "delta", "i", "normalizeSizeToPx", "px", "clamped", "controlledSize", "o", "classNames"]
7
7
  }
@@ -29,6 +29,8 @@ type SidebarPublicProps = Omit<SidebarPaneProps, 'mode' | 'defaultMode' | 'onMod
29
29
  }) => void;
30
30
  sizeUpdate?: 'throttle' | 'debounce';
31
31
  sizeUpdateMs?: number;
32
+ /** When true, adds margin and triggers gray backdrop on Shell. */
33
+ inset?: boolean;
32
34
  } & (SidebarControlledProps | SidebarUncontrolledProps);
33
35
  type SidebarComponent = React.ForwardRefExoticComponent<SidebarPublicProps & React.RefAttributes<HTMLDivElement>> & {
34
36
  Handle: typeof SidebarHandle;
@@ -1 +1 @@
1
- {"version":3,"file":"shell-sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/shell-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAE,aAAa,EAAc,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAA+C,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAInJ,KAAK,gBAAgB,GAAG,aAAa,GAAG;IACtC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,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IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AACrM,KAAK,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,aAAa,GAAG,cAAc,CAAC,GAAG;IAE1F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAEhC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1F,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,CAAC,sBAAsB,GAAG,wBAAwB,CAAC,CAAC;AAExD,KAAK,gBAAgB,GAAG,KAAK,CAAC,yBAAyB,CAAC,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,OAAO,aAAa,CAAA;CAAE,CAAC;AAmBrJ,eAAO,MAAM,OAAO,EA0ad,gBAAgB,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var Te=Object.create;var T=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty;var He=(i,s)=>{for(var l in s)T(i,l,{get:s[l],enumerable:!0})},ie=(i,s,l,M)=>{if(s&&typeof s=="object"||typeof s=="function")for(let d of we(s))!De.call(i,d)&&d!==l&&T(i,d,{get:()=>s[d],enumerable:!(M=ke(s,d))||M.enumerable});return i};var L=(i,s,l)=>(l=i!=null?Te(Ne(i)):{},ie(s||!i||!i.__esModule?T(l,"default",{value:i,enumerable:!0}):l,i)),Ve=i=>ie(T({},"__esModule",{value:!0}),i);var Oe={};He(Oe,{Sidebar:()=>q});module.exports=Ve(Oe);var t=L(require("react")),se=L(require("classnames")),F=L(require("../sheet.js")),de=require("../visually-hidden.js"),j=require("../shell.context.js"),k=require("../shell.hooks.js"),le=require("./shell-resize.js"),ue=require("./shell-prop-helpers.js"),m=require("./shell-handles.js"),$e=require("../shell.types.js"),ce=require("../../helpers/normalize-to-px.js");const Ie=["className","children","state","defaultState","onStateChange","thinSize","toggleModes","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style"],q=t.forwardRef((i,s)=>{const{className:l,presentation:M={initial:"overlay",md:"fixed"},expandedSize:d=288,minSize:p=200,maxSize:f=400,resizable:w=!1,collapsible:pe=!0,onExpand:K,onCollapse:W,onResize:N,onResizeStart:fe,onResizeEnd:be,snapPoints:Se,snapTolerance:me,collapseThreshold:he,paneId:D,persistence:H,children:ye,style:Me,thinSize:h=64,toggleModes:V,state:b,defaultState:g,onStateChange:z,size:Y,defaultSize:G,onSizeChange:I,sizeUpdate:O,sizeUpdateMs:B=50}=i,ge=(0,ue.extractPaneDomProps)(i,Ie),n=(0,j.useShell)(),$=(0,k.useResponsivePresentation)(M),y=$==="overlay",ze=$==="stacked",u=t.useRef(null),Pe=t.useCallback(e=>{u.current=e,typeof s=="function"?s(e):s&&(s.current=e)},[s]),J=t.Children.toArray(ye),Q=J.filter(e=>t.isValidElement(e)&&e.type===m.SidebarHandle),X=J.filter(e=>!(t.isValidElement(e)&&e.type===m.SidebarHandle)),S=t.useRef(null);t.useEffect(()=>()=>{S.current&&(clearTimeout(S.current),S.current=null)},[I,O,B]);const P=t.useMemo(()=>{const e=I,r=O,o=B??50;if(!e)return()=>{};if(r==="debounce")return(a,c)=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{e(a,c),S.current=null},o)};if(r==="throttle"){let a=0;return(c,Ee)=>{const ae=Date.now();ae-a>=o&&(a=ae,e(c,Ee))}}return(a,c)=>e(a,c)},[I,O,B]),Re=t.useId();t.useEffect(()=>(n.setHasSidebar(!0),()=>{n.setHasSidebar(!1)}),[n,Re]);const R=t.useRef(null);t.useEffect(()=>{const e=typeof b<"u";if(R.current===null){R.current=e;return}R.current!==e&&(console.warn("Shell.Sidebar: Switching between controlled and uncontrolled `state` is not supported."),R.current=e)},[b]);const ve=typeof b=="object"&&b!==null,{resolvedDefault:Z}=(0,k.useResponsiveInitialState)({controlledValue:b,defaultValue:g,currentValue:n.sidebarMode,setValue:n.setSidebarMode,breakpointReady:n.currentBreakpointReady,controlledIsResponsive:ve,onResponsiveChange:e=>z?.(e,{reason:"responsive"}),onInit:e=>z?.(e,{reason:"init"})}),v=t.useRef(null);t.useEffect(()=>{typeof b>"u"&&(v.current===null?v.current=n.sidebarMode:v.current!==n.sidebarMode&&(v.current=n.sidebarMode,z?.(n.sidebarMode,{reason:"toggle"})))},[n.sidebarMode,b,z]);const ee=t.useRef(K),te=t.useRef(W);t.useLayoutEffect(()=>{ee.current=K,te.current=W});const x=t.useRef(null),ne=t.useRef(!1);t.useEffect(()=>{const e=n.sidebarMode;if(!n.currentBreakpointReady){x.current=e;return}if(!ne.current){ne.current=!0,x.current=e;return}const r=x.current;r!==null&&r!==e&&(r==="collapsed"&&e!=="collapsed"?ee.current?.():e==="collapsed"&&te.current?.(),x.current=e)},[n.sidebarMode,n.currentBreakpointReady]);const re=n.sidebarMode!=="collapsed",C=t.useMemo(()=>{if(!D||H)return H;const e=`kookie-ui:shell:sidebar:${D}`;return{load:()=>{if(!(typeof window>"u"))try{const o=window.localStorage.getItem(e);return o?Number(o):void 0}catch{return}},save:o=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(o))}catch{}}}},[D,H]);t.useEffect(()=>{let e=!0;return(async()=>{if(!w||!C?.load||y)return;const r=await C.load();e&&typeof r=="number"&&u.current&&(u.current.style.setProperty("--sidebar-size",`${r}px`),N?.(r))})(),()=>{e=!1}},[w,C,N,y]);const E=(0,j.useShell)(),U=t.useCallback(()=>{const e=Z??(typeof g=="string"?g:void 0)??"expanded";return e==="thin"||e==="expanded"?e:"expanded"},[Z,g]);t.useEffect(()=>{if(!E.setSidebarToggleComputer)return;const e=V??"both",r=o=>{if(e==="both")return o==="collapsed"?"thin":o==="thin"?"expanded":"collapsed";const a=U();return o==="collapsed"?a:o===a?"collapsed":a};return E.setSidebarToggleComputer(r),()=>{E.setSidebarToggleComputer?.(o=>o==="collapsed"?"thin":o==="thin"?"expanded":"collapsed")}},[E,V,U]);const oe=t.useRef(d),xe=t.useRef("expanded");t.useEffect(()=>{n.sidebarMode!=="collapsed"&&(xe.current=n.sidebarMode,oe.current=n.sidebarMode==="thin"?h:d)},[n.sidebarMode,h,d]);const Ce=w&&!y&&n.sidebarMode==="expanded"?t.createElement(le.PaneResizeContext.Provider,{value:{containerRef:u,cssVarName:"--sidebar-size",minSize:p,maxSize:f,defaultSize:d,orientation:"vertical",edge:"end",computeNext:(e,r,o)=>{const a=getComputedStyle(u.current).direction==="rtl",c=e-r;return o+(a?-c:c)},onResize:N,onResizeStart:fe,onResizeEnd:e=>{be?.(e),P(e,{reason:"resize"}),C?.save?.(e)},target:"sidebar",collapsible:pe,snapPoints:Se,snapTolerance:me??8,collapseThreshold:he,requestCollapse:()=>n.setSidebarMode("collapsed"),requestToggle:()=>n.togglePane("sidebar")}},Q.length>0?Q.map((e,r)=>t.cloneElement(e,{key:e.key??r})):t.createElement(m.PaneHandle,null)):null,_=t.useCallback(e=>(0,ce.normalizeToPx)(e,"horizontal"),[]);t.useEffect(()=>{if(u.current&&typeof Y>"u"&&typeof G<"u"){const e=_(G);if(typeof e=="number"&&Number.isFinite(e)){const a=Math.min((typeof f=="number"?f:void 0)??e,Math.max((typeof p=="number"?p:void 0)??e,e));u.current.style.setProperty("--sidebar-size",`${a}px`),P(a,{reason:"init"})}}},[]);const A=Y;if(t.useEffect(()=>{if(!u.current||typeof A>"u")return;const e=_(A);if(typeof e=="number"&&Number.isFinite(e)){const a=Math.min((typeof f=="number"?f:void 0)??e,Math.max((typeof p=="number"?p:void 0)??e,e));u.current.style.setProperty("--sidebar-size",`${a}px`),P(a,{reason:"controlled"})}},[A,p,f,_,P]),y){const e=n.sidebarMode!=="collapsed";return t.createElement(F.Root,{open:e,onOpenChange:r=>n.setSidebarMode(r?"expanded":"collapsed")},t.createElement(F.Content,{side:"start",style:{padding:0},width:{initial:`${e?n.sidebarMode==="thin"?h:d:oe.current}px`}},t.createElement(de.VisuallyHidden,null,t.createElement(F.Title,null,"Navigation")),X))}return t.createElement("div",{...ge,ref:Pe,className:(0,se.default)("rt-ShellSidebar",l),"data-mode":n.sidebarMode,"data-peek":n.peekTarget==="sidebar"||void 0,"data-presentation":n.currentBreakpointReady?$:void 0,"data-open":n.currentBreakpointReady&&ze&&re||void 0,style:{...Me,"--sidebar-size":`${d}px`,"--sidebar-thin-size":`${h}px`,"--sidebar-min-size":`${p}px`,"--sidebar-max-size":`${f}px`,...n.peekTarget==="sidebar"&&n.sidebarMode==="collapsed"&&!y?(()=>{const e=V??"both",r=n.sidebarMode;let o;if(e==="both")o=r==="collapsed"?"thin":r==="thin"?"expanded":"collapsed";else{const a=U();o=r==="collapsed"?a:"collapsed"}return o==="thin"?{"--peek-sidebar-width":`${h}px`}:{"--peek-sidebar-width":`var(--sidebar-size, ${d}px)`}})():{}}},t.createElement("div",{className:"rt-ShellSidebarContent","data-visible":re||void 0},X),Ce)});q.displayName="Shell.Sidebar",q.Handle=m.SidebarHandle;
1
+ "use strict";var Ne=Object.create;var k=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var He=Object.getPrototypeOf,Ve=Object.prototype.hasOwnProperty;var Oe=(s,i)=>{for(var l in i)k(s,l,{get:i[l],enumerable:!0})},le=(s,i,l,g)=>{if(i&&typeof i=="object"||typeof i=="function")for(let d of Ie(i))!Ve.call(s,d)&&d!==l&&k(s,d,{get:()=>i[d],enumerable:!(g=De(i,d))||g.enumerable});return s};var j=(s,i,l)=>(l=s!=null?Ne(He(s)):{},le(i||!s||!s.__esModule?k(l,"default",{value:s,enumerable:!0}):l,s)),Be=s=>le(k({},"__esModule",{value:!0}),s);var Ue={};Oe(Ue,{Sidebar:()=>K});module.exports=Be(Ue);var t=j(require("react")),ue=j(require("classnames")),q=j(require("../sheet.js")),ce=require("../visually-hidden.js"),M=require("../shell.context.js"),w=require("../shell.hooks.js"),fe=require("./shell-resize.js"),pe=require("./shell-prop-helpers.js"),m=require("./shell-handles.js"),Ae=require("../shell.types.js"),be=require("../../helpers/normalize-to-px.js");const $e=["className","children","state","defaultState","onStateChange","thinSize","toggleModes","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style","inset"],K=t.forwardRef((s,i)=>{const{className:l,presentation:g={initial:"overlay",md:"fixed"},expandedSize:d=288,minSize:f=200,maxSize:p=400,resizable:N=!1,collapsible:Se=!0,onExpand:W,onCollapse:Y,onResize:D,onResizeStart:me,onResizeEnd:he,snapPoints:ye,snapTolerance:Me,collapseThreshold:ge,paneId:I,persistence:H,children:ze,style:Pe,thinSize:h=64,toggleModes:V,state:b,defaultState:z,onStateChange:P,size:G,defaultSize:J,onSizeChange:O,sizeUpdate:B,sizeUpdateMs:$=50,inset:U}=s,Re=(0,pe.extractPaneDomProps)(s,$e),n=(0,M.useShell)(),{registerInset:Q,unregisterInset:X}=(0,M.useInset)();t.useEffect(()=>{if(U)return Q("sidebar"),()=>X("sidebar")},[U,Q,X]);const _=(0,w.useResponsivePresentation)(g),y=_==="overlay",ve=_==="stacked",u=t.useRef(null),xe=t.useCallback(e=>{u.current=e,typeof i=="function"?i(e):i&&(i.current=e)},[i]),Z=t.Children.toArray(ze),ee=Z.filter(e=>t.isValidElement(e)&&e.type===m.SidebarHandle),te=Z.filter(e=>!(t.isValidElement(e)&&e.type===m.SidebarHandle)),S=t.useRef(null);t.useEffect(()=>()=>{S.current&&(clearTimeout(S.current),S.current=null)},[O,B,$]);const R=t.useMemo(()=>{const e=O,r=B,o=$??50;if(!e)return()=>{};if(r==="debounce")return(a,c)=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{e(a,c),S.current=null},o)};if(r==="throttle"){let a=0;return(c,we)=>{const de=Date.now();de-a>=o&&(a=de,e(c,we))}}return(a,c)=>e(a,c)},[O,B,$]),Ce=t.useId();t.useEffect(()=>(n.setHasSidebar(!0),()=>{n.setHasSidebar(!1)}),[n,Ce]);const v=t.useRef(null);t.useEffect(()=>{const e=typeof b<"u";if(v.current===null){v.current=e;return}v.current!==e&&(console.warn("Shell.Sidebar: Switching between controlled and uncontrolled `state` is not supported."),v.current=e)},[b]);const Ee=typeof b=="object"&&b!==null,{resolvedDefault:ne}=(0,w.useResponsiveInitialState)({controlledValue:b,defaultValue:z,currentValue:n.sidebarMode,setValue:n.setSidebarMode,breakpointReady:n.currentBreakpointReady,controlledIsResponsive:Ee,onResponsiveChange:e=>P?.(e,{reason:"responsive"}),onInit:e=>P?.(e,{reason:"init"})}),x=t.useRef(null);t.useEffect(()=>{typeof b>"u"&&(x.current===null?x.current=n.sidebarMode:x.current!==n.sidebarMode&&(x.current=n.sidebarMode,P?.(n.sidebarMode,{reason:"toggle"})))},[n.sidebarMode,b,P]);const re=t.useRef(W),oe=t.useRef(Y);t.useLayoutEffect(()=>{re.current=W,oe.current=Y});const C=t.useRef(null),ae=t.useRef(!1);t.useEffect(()=>{const e=n.sidebarMode;if(!n.currentBreakpointReady){C.current=e;return}if(!ae.current){ae.current=!0,C.current=e;return}const r=C.current;r!==null&&r!==e&&(r==="collapsed"&&e!=="collapsed"?re.current?.():e==="collapsed"&&oe.current?.(),C.current=e)},[n.sidebarMode,n.currentBreakpointReady]);const se=n.sidebarMode!=="collapsed",E=t.useMemo(()=>{if(!I||H)return H;const e=`kookie-ui:shell:sidebar:${I}`;return{load:()=>{if(!(typeof window>"u"))try{const o=window.localStorage.getItem(e);return o?Number(o):void 0}catch{return}},save:o=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(o))}catch{}}}},[I,H]);t.useEffect(()=>{let e=!0;return(async()=>{if(!N||!E?.load||y)return;const r=await E.load();e&&typeof r=="number"&&u.current&&(u.current.style.setProperty("--sidebar-size",`${r}px`),D?.(r))})(),()=>{e=!1}},[N,E,D,y]);const T=(0,M.useShell)(),A=t.useCallback(()=>{const e=ne??(typeof z=="string"?z:void 0)??"expanded";return e==="thin"||e==="expanded"?e:"expanded"},[ne,z]);t.useEffect(()=>{if(!T.setSidebarToggleComputer)return;const e=V??"both",r=o=>{if(e==="both")return o==="collapsed"?"thin":o==="thin"?"expanded":"collapsed";const a=A();return o==="collapsed"?a:o===a?"collapsed":a};return T.setSidebarToggleComputer(r),()=>{T.setSidebarToggleComputer?.(o=>o==="collapsed"?"thin":o==="thin"?"expanded":"collapsed")}},[T,V,A]);const ie=t.useRef(d),Te=t.useRef("expanded");t.useEffect(()=>{n.sidebarMode!=="collapsed"&&(Te.current=n.sidebarMode,ie.current=n.sidebarMode==="thin"?h:d)},[n.sidebarMode,h,d]);const ke=N&&!y&&n.sidebarMode==="expanded"?t.createElement(fe.PaneResizeContext.Provider,{value:{containerRef:u,cssVarName:"--sidebar-size",minSize:f,maxSize:p,defaultSize:d,orientation:"vertical",edge:"end",computeNext:(e,r,o)=>{const a=getComputedStyle(u.current).direction==="rtl",c=e-r;return o+(a?-c:c)},onResize:D,onResizeStart:me,onResizeEnd:e=>{he?.(e),R(e,{reason:"resize"}),E?.save?.(e)},target:"sidebar",collapsible:Se,snapPoints:ye,snapTolerance:Me??8,collapseThreshold:ge,requestCollapse:()=>n.setSidebarMode("collapsed"),requestToggle:()=>n.togglePane("sidebar")}},ee.length>0?ee.map((e,r)=>t.cloneElement(e,{key:e.key??r})):t.createElement(m.PaneHandle,null)):null,L=t.useCallback(e=>(0,be.normalizeToPx)(e,"horizontal"),[]);t.useEffect(()=>{if(u.current&&typeof G>"u"&&typeof J<"u"){const e=L(J);if(typeof e=="number"&&Number.isFinite(e)){const a=Math.min((typeof p=="number"?p:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));u.current.style.setProperty("--sidebar-size",`${a}px`),R(a,{reason:"init"})}}},[]);const F=G;if(t.useEffect(()=>{if(!u.current||typeof F>"u")return;const e=L(F);if(typeof e=="number"&&Number.isFinite(e)){const a=Math.min((typeof p=="number"?p:void 0)??e,Math.max((typeof f=="number"?f:void 0)??e,e));u.current.style.setProperty("--sidebar-size",`${a}px`),R(a,{reason:"controlled"})}},[F,f,p,L,R]),y){const e=n.sidebarMode!=="collapsed";return t.createElement(q.Root,{open:e,onOpenChange:r=>n.setSidebarMode(r?"expanded":"collapsed")},t.createElement(q.Content,{side:"start",style:{padding:0},width:{initial:`${e?n.sidebarMode==="thin"?h:d:ie.current}px`}},t.createElement(ce.VisuallyHidden,null,t.createElement(q.Title,null,"Navigation")),te))}return t.createElement("div",{...Re,ref:xe,className:(0,ue.default)("rt-ShellSidebar",l),"data-mode":n.sidebarMode,"data-peek":n.peekTarget==="sidebar"||void 0,"data-presentation":n.currentBreakpointReady?_:void 0,"data-open":n.currentBreakpointReady&&ve&&se||void 0,"data-inset":U||void 0,style:{...Pe,"--sidebar-size":`${d}px`,"--sidebar-thin-size":`${h}px`,"--sidebar-min-size":`${f}px`,"--sidebar-max-size":`${p}px`,...n.peekTarget==="sidebar"&&n.sidebarMode==="collapsed"&&!y?(()=>{const e=V??"both",r=n.sidebarMode;let o;if(e==="both")o=r==="collapsed"?"thin":r==="thin"?"expanded":"collapsed";else{const a=A();o=r==="collapsed"?a:"collapsed"}return o==="thin"?{"--peek-sidebar-width":`${h}px`}:{"--peek-sidebar-width":`var(--sidebar-size, ${d}px)`}})():{}}},t.createElement("div",{className:"rt-ShellSidebarContent","data-visible":se||void 0},te),ke)});K.displayName="Shell.Sidebar",K.Handle=m.SidebarHandle;
2
2
  //# sourceMappingURL=shell-sidebar.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/_internal/shell-sidebar.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { extractPaneDomProps } from './shell-prop-helpers.js';\nimport { SidebarHandle, PaneHandle } from './shell-handles.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, SidebarMode, Responsive, PaneBaseProps } from '../shell.types.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype SidebarPaneProps = PaneBaseProps & {\n mode?: PaneMode;\n defaultMode?: any;\n onModeChange?: (mode: PaneMode | SidebarMode) => void;\n};\n\ntype SidebarStateChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\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 = Omit<SidebarPaneProps, 'mode' | 'defaultMode' | 'onModeChange'> & {\n // removed legacy mode props\n thinSize?: number;\n toggleModes?: 'both' | 'single';\n // size API (width when expanded)\n size?: number | string;\n defaultSize?: number | string;\n onSizeChange?: (size: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n} & (SidebarControlledProps | SidebarUncontrolledProps);\n\ntype SidebarComponent = React.ForwardRefExoticComponent<SidebarPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof SidebarHandle };\n\nconst SIDEBAR_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'state',\n 'defaultState',\n 'onStateChange',\n 'thinSize',\n 'toggleModes',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n] as const satisfies readonly (keyof SidebarPublicProps)[];\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, SidebarPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = { initial: 'overlay', md: 'fixed' },\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 thinSize = 64,\n toggleModes,\n state,\n defaultState,\n onStateChange,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n } = initialProps;\n const sidebarDomProps = extractPaneDomProps(initialProps, SIDEBAR_DOM_PROP_KEYS);\n const shell = useShell();\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n // Phase sequencing is now CSS-driven; no JS-managed phase\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.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 const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === SidebarHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === SidebarHandle));\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Register with shell\n const sidebarId = React.useId();\n React.useEffect(() => {\n shell.setHasSidebar(true);\n return () => {\n shell.setHasSidebar(false);\n };\n }, [shell, sidebarId]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof state !== 'undefined' && typeof defaultState !== 'undefined') {\n console.error('Shell.Sidebar: Do not pass both `state` and `defaultState`. Choose one.');\n }\n if (typeof size !== 'undefined' && typeof defaultSize !== 'undefined') {\n console.error('Shell.Sidebar: Do not pass both `size` and `defaultSize`. Choose one.');\n }\n }\n\n // Warn on mode switch between controlled/uncontrolled\n React.useEffect(() => {\n const isControlled = typeof state !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Sidebar: Switching between controlled and uncontrolled `state` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [state]);\n\n // Resolve responsive controlled state at top level\n const stateIsResponsive = typeof state === 'object' && state !== null;\n const { resolvedDefault: resolvedSidebarDefault } = useResponsiveInitialState<SidebarMode>({\n controlledValue: state,\n defaultValue: defaultState,\n currentValue: shell.sidebarMode as SidebarMode,\n setValue: shell.setSidebarMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: stateIsResponsive,\n onResponsiveChange: (next) => onStateChange?.(next, { reason: 'responsive' }),\n onInit: (initial) => onStateChange?.(initial, { reason: 'init' }),\n });\n\n // Emit mode changes\n const lastNotifyModeRef = React.useRef<SidebarMode | null>(null);\n React.useEffect(() => {\n // notify new API when uncontrolled; skip first run to avoid masking init\n if (typeof state === 'undefined') {\n if (lastNotifyModeRef.current === null) {\n lastNotifyModeRef.current = shell.sidebarMode as SidebarMode;\n } else if (lastNotifyModeRef.current !== shell.sidebarMode) {\n lastNotifyModeRef.current = shell.sidebarMode as SidebarMode;\n onStateChange?.(shell.sidebarMode as SidebarMode, { reason: 'toggle' });\n }\n }\n }, [shell.sidebarMode, state, onStateChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevSidebarModeRef = React.useRef<SidebarMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.sidebarMode as SidebarMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevSidebarModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevSidebarModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevSidebarModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n // onExpand: when becoming visible (collapsed \u2192 thin/expanded)\n if (prevMode === 'collapsed' && currentMode !== 'collapsed') {\n onExpandRef.current?.();\n }\n // onCollapse: when becoming hidden (any \u2192 collapsed)\n else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevSidebarModeRef.current = currentMode;\n }\n }, [shell.sidebarMode, shell.currentBreakpointReady]);\n\n // Option A: thin is width-only; content remains visible whenever not collapsed\n const isContentVisible = shell.sidebarMode !== 'collapsed';\n\n // Default persistence if paneId provided and none supplied (fixed only)\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:sidebar:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Sidebar: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Sidebar: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n (async () => {\n if (!resizable || !persistenceAdapter?.load || isOverlay) return;\n const loaded = await persistenceAdapter.load();\n if (mounted && typeof loaded === 'number' && localRef.current) {\n localRef.current.style.setProperty('--sidebar-size', `${loaded}px`);\n onResize?.(loaded);\n }\n })();\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n // Register custom toggle behavior based on toggleModes (both|single)\n const shellForToggle = useShell();\n const resolveDefaultSidebarMode = React.useCallback((): SidebarMode => {\n const resolved = resolvedSidebarDefault ?? (typeof defaultState === 'string' ? defaultState : undefined) ?? 'expanded';\n return resolved === 'thin' || resolved === 'expanded' ? resolved : 'expanded';\n }, [resolvedSidebarDefault, defaultState]);\n\n React.useEffect(() => {\n if (!shellForToggle.setSidebarToggleComputer) return;\n const strategy: 'both' | 'single' = toggleModes ?? 'both';\n const compute = (current: SidebarMode): SidebarMode => {\n if (strategy === 'both') {\n if (current === 'collapsed') return 'thin';\n if (current === 'thin') return 'expanded';\n return 'collapsed';\n }\n const target = resolveDefaultSidebarMode();\n if (current === 'collapsed') return target;\n if (current === target) return 'collapsed';\n return target;\n };\n shellForToggle.setSidebarToggleComputer(compute);\n return () => {\n shellForToggle.setSidebarToggleComputer?.((cur) => (cur === 'collapsed' ? 'thin' : cur === 'thin' ? 'expanded' : 'collapsed'));\n };\n }, [shellForToggle, toggleModes, resolveDefaultSidebarMode]);\n\n const lastOverlayWidthRef = React.useRef<number>(expandedSize);\n const lastOverlayModeRef = React.useRef<SidebarMode>('expanded');\n React.useEffect(() => {\n if (shell.sidebarMode !== 'collapsed') {\n lastOverlayModeRef.current = shell.sidebarMode as SidebarMode;\n lastOverlayWidthRef.current = shell.sidebarMode === 'thin' ? thinSize : expandedSize;\n }\n }, [shell.sidebarMode, thinSize, expandedSize]);\n\n // Remove responsive default mode behavior entirely\n\n const handleEl =\n resizable && !isOverlay && shell.sidebarMode === 'expanded' ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--sidebar-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'vertical',\n edge: 'end',\n computeNext: (client, startClient, startSize) => {\n const isRtl = getComputedStyle(localRef.current!).direction === 'rtl';\n const delta = client - startClient;\n return startSize + (isRtl ? -delta : delta);\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'sidebar',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setSidebarMode('collapsed'),\n requestToggle: () => shell.togglePane('sidebar'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'horizontal'), []);\n\n // Apply defaultSize on mount when uncontrolled\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--sidebar-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--sidebar-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.sidebarMode !== 'collapsed';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setSidebarMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content\n side=\"start\"\n style={{ padding: 0 }}\n width={{\n initial: `${open ? (shell.sidebarMode === 'thin' ? thinSize : expandedSize) : lastOverlayWidthRef.current}px`,\n }}\n >\n <VisuallyHidden>\n <Sheet.Title>Navigation</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n return (\n <div\n {...sidebarDomProps}\n ref={setRef}\n className={classNames('rt-ShellSidebar', className)}\n data-mode={shell.sidebarMode}\n data-peek={shell.peekTarget === 'sidebar' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isContentVisible) || undefined}\n style={{\n ...style,\n ['--sidebar-size' as any]: `${expandedSize}px`,\n ['--sidebar-thin-size' as any]: `${thinSize}px`,\n ['--sidebar-min-size' as any]: `${minSize}px`,\n ['--sidebar-max-size' as any]: `${maxSize}px`,\n ...(shell.peekTarget === 'sidebar' && shell.sidebarMode === 'collapsed' && !isOverlay\n ? (() => {\n const strategy: 'both' | 'single' = toggleModes ?? 'both';\n const current = shell.sidebarMode as SidebarMode;\n let next: SidebarMode;\n if (strategy === 'both') {\n next = current === 'collapsed' ? 'thin' : current === 'thin' ? 'expanded' : 'collapsed';\n } else {\n const target = resolveDefaultSidebarMode();\n next = current === 'collapsed' ? target : 'collapsed';\n }\n if (next === 'thin') {\n return {\n ['--peek-sidebar-width' as any]: `${thinSize}px`,\n } as React.CSSProperties;\n }\n return {\n ['--peek-sidebar-width' as any]: `var(--sidebar-size, ${expandedSize}px)`,\n } as React.CSSProperties;\n })()\n : {}),\n }}\n >\n <div className=\"rt-ShellSidebarContent\" data-visible={isContentVisible || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as SidebarComponent;\n\nSidebar.displayName = 'Shell.Sidebar';\nSidebar.Handle = SidebarHandle;\n"],
5
- "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,IAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAuB,oBACvBC,GAAuB,yBACvBC,EAAuB,0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cC,EAAS,WAC5C,CACA,OAAIpB,IAAS,OACJ,CACJ,uBAAgC,GAAGpC,CAAQ,IAC9C,EAEK,CACJ,uBAAgC,uBAAuBjB,CAAY,KACtE,CACF,GAAG,EACH,CAAC,CACP,GAEAhB,EAAA,cAAC,OAAI,UAAU,yBAAyB,eAAc8E,IAAoB,QACvExB,CACH,EACCuC,EACH,CAEJ,CAAC,EAED/F,EAAQ,YAAc,gBACtBA,EAAQ,OAAS",
6
- "names": ["shell_sidebar_exports", "__export", "Sidebar", "__toCommonJS", "React", "import_classnames", "Sheet", "import_visually_hidden", "import_shell_context", "import_shell_hooks", "import_shell_resize", "import_shell_prop_helpers", "import_shell_handles", "import_shell_types", "import_normalize_to_px", "SIDEBAR_DOM_PROP_KEYS", "initialProps", "ref", "className", "presentation", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "thinSize", "toggleModes", "state", "defaultState", "onStateChange", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "sidebarDomProps", "shell", "resolvedPresentation", "isOverlay", "isStacked", "localRef", "setRef", "node", "childArray", "handleChildren", "el", "contentChildren", "debounceTimeoutRef", "emitSizeChange", "cb", "strategy", "ms", "s", "meta", "last", "now", "sidebarId", "wasControlledRef", "isControlled", "stateIsResponsive", "resolvedSidebarDefault", "next", "initial", "lastNotifyModeRef", "onExpandRef", "onCollapseRef", "prevSidebarModeRef", "hasInitializedRef", "currentMode", "prevMode", "isContentVisible", "persistenceAdapter", "key", "v", "mounted", "loaded", "shellForToggle", "resolveDefaultSidebarMode", "resolved", "compute", "current", "target", "cur", "lastOverlayWidthRef", "lastOverlayModeRef", "handleEl", "client", "startClient", "startSize", "isRtl", "delta", "i", "normalizeSizeToPx", "value", "px", "clamped", "controlledSize", "open", "o", "classNames"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport * as Sheet from '../sheet.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { useShell, useInset } from '../shell.context.js';\nimport { useResponsivePresentation, useResponsiveInitialState } from '../shell.hooks.js';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { extractPaneDomProps } from './shell-prop-helpers.js';\nimport { SidebarHandle, PaneHandle } from './shell-handles.js';\nimport type { Breakpoint, PaneMode, PaneSizePersistence, ResponsivePresentation, SidebarMode, Responsive, PaneBaseProps } from '../shell.types.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\n\ntype SidebarPaneProps = PaneBaseProps & {\n mode?: PaneMode;\n defaultMode?: any;\n onModeChange?: (mode: PaneMode | SidebarMode) => void;\n};\n\ntype SidebarStateChangeMeta = { reason: 'init' | 'toggle' | 'responsive' };\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 = Omit<SidebarPaneProps, 'mode' | 'defaultMode' | 'onModeChange'> & {\n // removed legacy mode props\n thinSize?: number;\n toggleModes?: 'both' | 'single';\n // size API (width when expanded)\n size?: number | string;\n defaultSize?: number | string;\n onSizeChange?: (size: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers gray backdrop on Shell. */\n inset?: boolean;\n} & (SidebarControlledProps | SidebarUncontrolledProps);\n\ntype SidebarComponent = React.ForwardRefExoticComponent<SidebarPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof SidebarHandle };\n\nconst SIDEBAR_DOM_PROP_KEYS = [\n 'className',\n 'children',\n 'state',\n 'defaultState',\n 'onStateChange',\n 'thinSize',\n 'toggleModes',\n 'size',\n 'defaultSize',\n 'onSizeChange',\n 'sizeUpdate',\n 'sizeUpdateMs',\n 'style',\n 'inset',\n] as const satisfies readonly (keyof SidebarPublicProps)[];\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, SidebarPublicProps>((initialProps, ref) => {\n const {\n className,\n presentation = { initial: 'overlay', md: 'fixed' },\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 thinSize = 64,\n toggleModes,\n state,\n defaultState,\n onStateChange,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\n } = initialProps;\n const sidebarDomProps = extractPaneDomProps(initialProps, SIDEBAR_DOM_PROP_KEYS);\n const shell = useShell();\n const { registerInset, unregisterInset } = useInset();\n\n // Register/unregister inset\n React.useEffect(() => {\n if (inset) {\n registerInset('sidebar');\n return () => unregisterInset('sidebar');\n }\n }, [inset, registerInset, unregisterInset]);\n const resolvedPresentation = useResponsivePresentation(presentation);\n const isOverlay = resolvedPresentation === 'overlay';\n const isStacked = resolvedPresentation === 'stacked';\n // Phase sequencing is now CSS-driven; no JS-managed phase\n const localRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n localRef.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 const childArray = React.Children.toArray(children) as React.ReactElement[];\n const handleChildren = childArray.filter((el: React.ReactElement) => React.isValidElement(el) && el.type === SidebarHandle);\n const contentChildren = childArray.filter((el: React.ReactElement) => !(React.isValidElement(el) && el.type === SidebarHandle));\n\n // Ref for debounce cleanup\n const debounceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n // Cleanup debounce timeout on unmount or when dependencies change\n React.useEffect(() => {\n return () => {\n if (debounceTimeoutRef.current) {\n clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = null;\n }\n };\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n // Throttled/debounced emitter for onSizeChange\n const emitSizeChange = React.useMemo(() => {\n const cb = onSizeChange as undefined | ((s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => void);\n const strategy = sizeUpdate as undefined | 'throttle' | 'debounce';\n const ms = sizeUpdateMs ?? 50;\n if (!cb) return () => {};\n if (strategy === 'debounce') {\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => {\n if (debounceTimeoutRef.current) clearTimeout(debounceTimeoutRef.current);\n debounceTimeoutRef.current = setTimeout(() => {\n cb(s, meta);\n debounceTimeoutRef.current = null;\n }, ms);\n };\n }\n if (strategy === 'throttle') {\n let last = 0;\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => {\n const now = Date.now();\n if (now - last >= ms) {\n last = now;\n cb(s, meta);\n }\n };\n }\n return (s: number, meta: { reason: 'init' | 'resize' | 'controlled' }) => cb(s, meta);\n }, [onSizeChange, sizeUpdate, sizeUpdateMs]);\n\n // Register with shell\n const sidebarId = React.useId();\n React.useEffect(() => {\n shell.setHasSidebar(true);\n return () => {\n shell.setHasSidebar(false);\n };\n }, [shell, sidebarId]);\n\n // Dev guards\n const wasControlledRef = React.useRef<boolean | null>(null);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof state !== 'undefined' && typeof defaultState !== 'undefined') {\n console.error('Shell.Sidebar: Do not pass both `state` and `defaultState`. Choose one.');\n }\n if (typeof size !== 'undefined' && typeof defaultSize !== 'undefined') {\n console.error('Shell.Sidebar: Do not pass both `size` and `defaultSize`. Choose one.');\n }\n }\n\n // Warn on mode switch between controlled/uncontrolled\n React.useEffect(() => {\n const isControlled = typeof state !== 'undefined';\n if (wasControlledRef.current === null) {\n wasControlledRef.current = isControlled;\n return;\n }\n if (wasControlledRef.current !== isControlled) {\n console.warn('Shell.Sidebar: Switching between controlled and uncontrolled `state` is not supported.');\n wasControlledRef.current = isControlled;\n }\n }, [state]);\n\n // Resolve responsive controlled state at top level\n const stateIsResponsive = typeof state === 'object' && state !== null;\n const { resolvedDefault: resolvedSidebarDefault } = useResponsiveInitialState<SidebarMode>({\n controlledValue: state,\n defaultValue: defaultState,\n currentValue: shell.sidebarMode as SidebarMode,\n setValue: shell.setSidebarMode,\n breakpointReady: shell.currentBreakpointReady,\n controlledIsResponsive: stateIsResponsive,\n onResponsiveChange: (next) => onStateChange?.(next, { reason: 'responsive' }),\n onInit: (initial) => onStateChange?.(initial, { reason: 'init' }),\n });\n\n // Emit mode changes\n const lastNotifyModeRef = React.useRef<SidebarMode | null>(null);\n React.useEffect(() => {\n // notify new API when uncontrolled; skip first run to avoid masking init\n if (typeof state === 'undefined') {\n if (lastNotifyModeRef.current === null) {\n lastNotifyModeRef.current = shell.sidebarMode as SidebarMode;\n } else if (lastNotifyModeRef.current !== shell.sidebarMode) {\n lastNotifyModeRef.current = shell.sidebarMode as SidebarMode;\n onStateChange?.(shell.sidebarMode as SidebarMode, { reason: 'toggle' });\n }\n }\n }, [shell.sidebarMode, state, onStateChange]);\n\n // Track previous mode to only fire callbacks on actual user-initiated state transitions.\n // We wait for breakpointReady to ensure the initial state sync from useResponsiveInitialState\n // is complete before enabling callbacks. This avoids spurious callbacks during initialization.\n // Use callback refs to avoid re-running effect when inline callbacks change.\n const onExpandRef = React.useRef(onExpand);\n const onCollapseRef = React.useRef(onCollapse);\n React.useLayoutEffect(() => {\n onExpandRef.current = onExpand;\n onCollapseRef.current = onCollapse;\n });\n\n const prevSidebarModeRef = React.useRef<SidebarMode | null>(null);\n const hasInitializedRef = React.useRef(false);\n React.useEffect(() => {\n const currentMode = shell.sidebarMode as SidebarMode;\n\n // Wait for breakpoint to be ready before enabling callbacks\n if (!shell.currentBreakpointReady) {\n prevSidebarModeRef.current = currentMode;\n return;\n }\n\n // Skip the first run after breakpoint is ready - this captures the post-sync state\n if (!hasInitializedRef.current) {\n hasInitializedRef.current = true;\n prevSidebarModeRef.current = currentMode;\n return;\n }\n\n const prevMode = prevSidebarModeRef.current;\n\n // Only fire on actual state transitions\n if (prevMode !== null && prevMode !== currentMode) {\n // onExpand: when becoming visible (collapsed \u2192 thin/expanded)\n if (prevMode === 'collapsed' && currentMode !== 'collapsed') {\n onExpandRef.current?.();\n }\n // onCollapse: when becoming hidden (any \u2192 collapsed)\n else if (currentMode === 'collapsed') {\n onCollapseRef.current?.();\n }\n prevSidebarModeRef.current = currentMode;\n }\n }, [shell.sidebarMode, shell.currentBreakpointReady]);\n\n // Option A: thin is width-only; content remains visible whenever not collapsed\n const isContentVisible = shell.sidebarMode !== 'collapsed';\n\n // Default persistence if paneId provided and none supplied (fixed only)\n const persistenceAdapter = React.useMemo(() => {\n if (!paneId || persistence) return persistence;\n const key = `kookie-ui:shell:sidebar:${paneId}`;\n const adapter: PaneSizePersistence = {\n load: () => {\n if (typeof window === 'undefined') return undefined;\n try {\n const v = window.localStorage.getItem(key);\n return v ? Number(v) : undefined;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Sidebar: failed to load persisted size', err);\n }\n return undefined;\n }\n },\n save: (size: number) => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, String(size));\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Shell.Sidebar: failed to save persisted size', err);\n }\n }\n },\n };\n return adapter;\n }, [paneId, persistence]);\n\n React.useEffect(() => {\n let mounted = true;\n (async () => {\n if (!resizable || !persistenceAdapter?.load || isOverlay) return;\n const loaded = await persistenceAdapter.load();\n if (mounted && typeof loaded === 'number' && localRef.current) {\n localRef.current.style.setProperty('--sidebar-size', `${loaded}px`);\n onResize?.(loaded);\n }\n })();\n return () => {\n mounted = false;\n };\n }, [resizable, persistenceAdapter, onResize, isOverlay]);\n\n // Register custom toggle behavior based on toggleModes (both|single)\n const shellForToggle = useShell();\n const resolveDefaultSidebarMode = React.useCallback((): SidebarMode => {\n const resolved = resolvedSidebarDefault ?? (typeof defaultState === 'string' ? defaultState : undefined) ?? 'expanded';\n return resolved === 'thin' || resolved === 'expanded' ? resolved : 'expanded';\n }, [resolvedSidebarDefault, defaultState]);\n\n React.useEffect(() => {\n if (!shellForToggle.setSidebarToggleComputer) return;\n const strategy: 'both' | 'single' = toggleModes ?? 'both';\n const compute = (current: SidebarMode): SidebarMode => {\n if (strategy === 'both') {\n if (current === 'collapsed') return 'thin';\n if (current === 'thin') return 'expanded';\n return 'collapsed';\n }\n const target = resolveDefaultSidebarMode();\n if (current === 'collapsed') return target;\n if (current === target) return 'collapsed';\n return target;\n };\n shellForToggle.setSidebarToggleComputer(compute);\n return () => {\n shellForToggle.setSidebarToggleComputer?.((cur) => (cur === 'collapsed' ? 'thin' : cur === 'thin' ? 'expanded' : 'collapsed'));\n };\n }, [shellForToggle, toggleModes, resolveDefaultSidebarMode]);\n\n const lastOverlayWidthRef = React.useRef<number>(expandedSize);\n const lastOverlayModeRef = React.useRef<SidebarMode>('expanded');\n React.useEffect(() => {\n if (shell.sidebarMode !== 'collapsed') {\n lastOverlayModeRef.current = shell.sidebarMode as SidebarMode;\n lastOverlayWidthRef.current = shell.sidebarMode === 'thin' ? thinSize : expandedSize;\n }\n }, [shell.sidebarMode, thinSize, expandedSize]);\n\n // Remove responsive default mode behavior entirely\n\n const handleEl =\n resizable && !isOverlay && shell.sidebarMode === 'expanded' ? (\n <PaneResizeContext.Provider\n value={{\n containerRef: localRef,\n cssVarName: '--sidebar-size',\n minSize,\n maxSize,\n defaultSize: expandedSize,\n orientation: 'vertical',\n edge: 'end',\n computeNext: (client, startClient, startSize) => {\n const isRtl = getComputedStyle(localRef.current!).direction === 'rtl';\n const delta = client - startClient;\n return startSize + (isRtl ? -delta : delta);\n },\n onResize,\n onResizeStart,\n onResizeEnd: (size) => {\n onResizeEnd?.(size);\n emitSizeChange(size, { reason: 'resize' });\n persistenceAdapter?.save?.(size);\n },\n target: 'sidebar',\n collapsible,\n snapPoints,\n snapTolerance: snapTolerance ?? 8,\n collapseThreshold,\n requestCollapse: () => shell.setSidebarMode('collapsed'),\n requestToggle: () => shell.togglePane('sidebar'),\n }}\n >\n {handleChildren.length > 0 ? handleChildren.map((el, i) => React.cloneElement(el, { key: el.key ?? i })) : <PaneHandle />}\n </PaneResizeContext.Provider>\n ) : null;\n\n // Normalize CSS lengths to px helper\n const normalizeSizeToPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, 'horizontal'), []);\n\n // Apply defaultSize on mount when uncontrolled\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof size === 'undefined' && typeof defaultSize !== 'undefined') {\n const px = normalizeSizeToPx(defaultSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--sidebar-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'init' });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size sync\n const controlledSize = size;\n React.useEffect(() => {\n if (!localRef.current) return;\n if (typeof controlledSize === 'undefined') return;\n const px = normalizeSizeToPx(controlledSize);\n if (typeof px === 'number' && Number.isFinite(px)) {\n const minPx = typeof minSize === 'number' ? minSize : undefined;\n const maxPx = typeof maxSize === 'number' ? maxSize : undefined;\n const clamped = Math.min(maxPx ?? px, Math.max(minPx ?? px, px));\n localRef.current.style.setProperty('--sidebar-size', `${clamped}px`);\n emitSizeChange(clamped, { reason: 'controlled' });\n }\n }, [controlledSize, minSize, maxSize, normalizeSizeToPx, emitSizeChange]);\n\n if (isOverlay) {\n const open = shell.sidebarMode !== 'collapsed';\n return (\n <Sheet.Root open={open} onOpenChange={(o) => shell.setSidebarMode(o ? 'expanded' : 'collapsed')}>\n <Sheet.Content\n side=\"start\"\n style={{ padding: 0 }}\n width={{\n initial: `${open ? (shell.sidebarMode === 'thin' ? thinSize : expandedSize) : lastOverlayWidthRef.current}px`,\n }}\n >\n <VisuallyHidden>\n <Sheet.Title>Navigation</Sheet.Title>\n </VisuallyHidden>\n {contentChildren}\n </Sheet.Content>\n </Sheet.Root>\n );\n }\n return (\n <div\n {...sidebarDomProps}\n ref={setRef}\n className={classNames('rt-ShellSidebar', className)}\n data-mode={shell.sidebarMode}\n data-peek={shell.peekTarget === 'sidebar' || undefined}\n data-presentation={shell.currentBreakpointReady ? resolvedPresentation : undefined}\n data-open={(shell.currentBreakpointReady && isStacked && isContentVisible) || undefined}\n data-inset={inset || undefined}\n style={{\n ...style,\n ['--sidebar-size' as any]: `${expandedSize}px`,\n ['--sidebar-thin-size' as any]: `${thinSize}px`,\n ['--sidebar-min-size' as any]: `${minSize}px`,\n ['--sidebar-max-size' as any]: `${maxSize}px`,\n ...(shell.peekTarget === 'sidebar' && shell.sidebarMode === 'collapsed' && !isOverlay\n ? (() => {\n const strategy: 'both' | 'single' = toggleModes ?? 'both';\n const current = shell.sidebarMode as SidebarMode;\n let next: SidebarMode;\n if (strategy === 'both') {\n next = current === 'collapsed' ? 'thin' : current === 'thin' ? 'expanded' : 'collapsed';\n } else {\n const target = resolveDefaultSidebarMode();\n next = current === 'collapsed' ? target : 'collapsed';\n }\n if (next === 'thin') {\n return {\n ['--peek-sidebar-width' as any]: `${thinSize}px`,\n } as React.CSSProperties;\n }\n return {\n ['--peek-sidebar-width' as any]: `var(--sidebar-size, ${expandedSize}px)`,\n } as React.CSSProperties;\n })()\n : {}),\n }}\n >\n <div className=\"rt-ShellSidebarContent\" data-visible={isContentVisible || undefined}>\n {contentChildren}\n </div>\n {handleEl}\n </div>\n );\n}) as SidebarComponent;\n\nSidebar.displayName = 'Shell.Sidebar';\nSidebar.Handle = SidebarHandle;\n"],
5
+ "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,G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KAC1C,qBAA8B,GAAGhB,CAAO,KACxC,qBAA8B,GAAGC,CAAO,KACzC,GAAI2B,EAAM,aAAe,WAAaA,EAAM,cAAgB,aAAe,CAACI,GACvE,IAAM,CACL,MAAMY,EAA8B3B,GAAe,OAC7CyD,EAAU9C,EAAM,YACtB,IAAI2B,EACJ,GAAIX,IAAa,OACfW,EAAOmB,IAAY,YAAc,OAASA,IAAY,OAAS,WAAa,gBACvE,CACL,MAAMC,EAASJ,EAA0B,EACzChB,EAAOmB,IAAY,YAAcC,EAAS,WAC5C,CACA,OAAIpB,IAAS,OACJ,CACJ,uBAAgC,GAAGvC,CAAQ,IAC9C,EAEK,CACJ,uBAAgC,uBAAuBjB,CAAY,KACtE,CACF,GAAG,EACH,CAAC,CACP,GAEAhB,EAAA,cAAC,OAAI,UAAU,yBAAyB,eAAciF,IAAoB,QACvExB,EACH,EACCuC,EACH,CAEJ,CAAC,EAEDlG,EAAQ,YAAc,gBACtBA,EAAQ,OAAS",
6
+ "names": ["shell_sidebar_exports", "__export", "Sidebar", "__toCommonJS", "React", "import_classnames", "Sheet", "import_visually_hidden", "import_shell_context", "import_shell_hooks", "import_shell_resize", "import_shell_prop_helpers", "import_shell_handles", "import_shell_types", "import_normalize_to_px", "SIDEBAR_DOM_PROP_KEYS", "initialProps", "ref", "className", "presentation", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "thinSize", "toggleModes", "state", "defaultState", "onStateChange", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "inset", "sidebarDomProps", "shell", "registerInset", "unregisterInset", "resolvedPresentation", "isOverlay", "isStacked", "localRef", "setRef", "node", "childArray", "handleChildren", "el", "contentChildren", "debounceTimeoutRef", "emitSizeChange", "cb", "strategy", "ms", "s", "meta", "last", "now", "sidebarId", "wasControlledRef", "isControlled", "stateIsResponsive", "resolvedSidebarDefault", "next", "initial", "lastNotifyModeRef", "onExpandRef", "onCollapseRef", "prevSidebarModeRef", "hasInitializedRef", "currentMode", "prevMode", "isContentVisible", "persistenceAdapter", "key", "v", "mounted", "loaded", "shellForToggle", "resolveDefaultSidebarMode", "resolved", "compute", "current", "target", "cur", "lastOverlayWidthRef", "lastOverlayModeRef", "handleEl", "client", "startClient", "startSize", "isRtl", "delta", "i", "normalizeSizeToPx", "value", "px", "clamped", "controlledSize", "open", "o", "classNames"]
7
7
  }
@@ -122,5 +122,18 @@ export declare function useComposition(): {
122
122
  hasSidebar: boolean;
123
123
  setHasSidebar: (v: boolean) => void;
124
124
  };
125
+ export type InsetPaneId = 'left' | 'sidebar' | 'content' | 'inspector' | 'bottom';
126
+ export declare const InsetContext: React.Context<{
127
+ insetPanes: Set<InsetPaneId>;
128
+ registerInset: (id: InsetPaneId) => void;
129
+ unregisterInset: (id: InsetPaneId) => void;
130
+ hasAnyInset: boolean;
131
+ } | null>;
132
+ export declare function useInset(): {
133
+ insetPanes: Set<InsetPaneId>;
134
+ registerInset: (id: InsetPaneId) => void;
135
+ unregisterInset: (id: InsetPaneId) => void;
136
+ hasAnyInset: boolean;
137
+ };
125
138
  export {};
126
139
  //# sourceMappingURL=shell.context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shell.context.d.ts","sourceRoot":"","sources":["../../../src/components/shell.context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzG,MAAM,WAAW,iBAAiB;IAEhC,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,QAAQ,CAAC;IACpB,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK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OAAO;mBAAiB,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI;SAAuB,CAAC;AAC5L,wBAAgB,cAAc;aADmC,OAAO;gBAAc,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI;gBAAc,OAAO;mBAAiB,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI;EAKnK;AAGD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAClF,eAAO,MAAM,YAAY;gBACX,GAAG,CAAC,WAAW,CAAC;mBACb,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI;qBACvB,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI;iBAC7B,OAAO;SACA,CAAC;AACvB,wBAAgB,QAAQ;gBALV,GAAG,CAAC,WAAW,CAAC;mBACb,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI;qBACvB,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI;iBAC7B,OAAO;EAMrB"}
@@ -1,2 +1,2 @@
1
- "use strict";var b=Object.create;var a=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var g=(e,o)=>{for(var n in o)a(e,n,{get:o[n],enumerable:!0})},s=(e,o,n,d)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of C(o))!m.call(e,r)&&r!==n&&a(e,r,{get:()=>o[r],enumerable:!(d=f(o,r))||d.enumerable});return e};var w=(e,o,n)=>(n=e!=null?b(v(e)):{},s(o||!e||!e.__esModule?a(n,"default",{value:e,enumerable:!0}):n,e)),T=e=>s(a({},"__esModule",{value:!0}),e);var z={};g(z,{ActionsContext:()=>h,BottomModeContext:()=>M,CompositionContext:()=>S,InspectorModeContext:()=>x,LeftModeContext:()=>i,PanelModeContext:()=>u,PeekContext:()=>p,PresentationContext:()=>P,ShellProvider:()=>R,SidebarModeContext:()=>c,useBottomMode:()=>V,useComposition:()=>j,useInspectorMode:()=>E,useLeftMode:()=>y,usePanelMode:()=>B,usePeek:()=>H,usePresentation:()=>I,useShell:()=>k,useShellActions:()=>A,useSidebarMode:()=>L});module.exports=T(z);var t=w(require("react"));const l=t.createContext(null);function k(){const e=t.useContext(l);if(!e)throw new Error("Shell components must be used within <Shell.Root>");return e}function R({value:e,children:o}){return t.createElement(l.Provider,{value:e},o)}const i=t.createContext(null);function y(){const e=t.useContext(i);if(!e)throw new Error("useLeftMode must be used within Shell.Root");return e}const u=t.createContext(null);function B(){const e=t.useContext(u);if(!e)throw new Error("usePanelMode must be used within Shell.Root");return e}const c=t.createContext(null);function L(){const e=t.useContext(c);if(!e)throw new Error("useSidebarMode must be used within Shell.Root");return e}const x=t.createContext(null);function E(){const e=t.useContext(x);if(!e)throw new Error("useInspectorMode must be used within Shell.Root");return e}const M=t.createContext(null);function V(){const e=t.useContext(M);if(!e)throw new Error("useBottomMode must be used within Shell.Root");return e}const P=t.createContext(null);function I(){const e=t.useContext(P);if(!e)throw new Error("usePresentation must be used within Shell.Root");return e}const p=t.createContext(null);function H(){const e=t.useContext(p);if(!e)throw new Error("usePeek must be used within Shell.Root");return e}const h=t.createContext(null);function A(){const e=t.useContext(h);if(!e)throw new Error("useShellActions must be used within Shell.Root");return e}const S=t.createContext(null);function j(){const e=t.useContext(S);if(!e)throw new Error("useComposition must be used within Shell.Root");return e}
1
+ "use strict";var f=Object.create;var a=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var g=(e,o)=>{for(var n in o)a(e,n,{get:o[n],enumerable:!0})},d=(e,o,n,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of v(o))!w.call(e,r)&&r!==n&&a(e,r,{get:()=>o[r],enumerable:!(s=C(o,r))||s.enumerable});return e};var T=(e,o,n)=>(n=e!=null?f(m(e)):{},d(o||!e||!e.__esModule?a(n,"default",{value:e,enumerable:!0}):n,e)),I=e=>d(a({},"__esModule",{value:!0}),e);var N={};g(N,{ActionsContext:()=>h,BottomModeContext:()=>P,CompositionContext:()=>b,InsetContext:()=>S,InspectorModeContext:()=>x,LeftModeContext:()=>i,PanelModeContext:()=>u,PeekContext:()=>p,PresentationContext:()=>M,ShellProvider:()=>y,SidebarModeContext:()=>c,useBottomMode:()=>V,useComposition:()=>z,useInset:()=>D,useInspectorMode:()=>L,useLeftMode:()=>R,usePanelMode:()=>B,usePeek:()=>H,usePresentation:()=>A,useShell:()=>k,useShellActions:()=>j,useSidebarMode:()=>E});module.exports=I(N);var t=T(require("react"));const l=t.createContext(null);function k(){const e=t.useContext(l);if(!e)throw new Error("Shell components must be used within <Shell.Root>");return e}function y({value:e,children:o}){return t.createElement(l.Provider,{value:e},o)}const i=t.createContext(null);function R(){const e=t.useContext(i);if(!e)throw new Error("useLeftMode must be used within Shell.Root");return e}const u=t.createContext(null);function B(){const e=t.useContext(u);if(!e)throw new Error("usePanelMode must be used within Shell.Root");return e}const c=t.createContext(null);function E(){const e=t.useContext(c);if(!e)throw new Error("useSidebarMode must be used within Shell.Root");return e}const x=t.createContext(null);function L(){const e=t.useContext(x);if(!e)throw new Error("useInspectorMode must be used within Shell.Root");return e}const P=t.createContext(null);function V(){const e=t.useContext(P);if(!e)throw new Error("useBottomMode must be used within Shell.Root");return e}const M=t.createContext(null);function A(){const e=t.useContext(M);if(!e)throw new Error("usePresentation must be used within Shell.Root");return e}const p=t.createContext(null);function H(){const e=t.useContext(p);if(!e)throw new Error("usePeek must be used within Shell.Root");return e}const h=t.createContext(null);function j(){const e=t.useContext(h);if(!e)throw new Error("useShellActions must be used within Shell.Root");return e}const b=t.createContext(null);function z(){const e=t.useContext(b);if(!e)throw new Error("useComposition must be used within Shell.Root");return e}const S=t.createContext(null);function D(){const e=t.useContext(S);if(!e)throw new Error("useInset must be used within Shell.Root");return e}
2
2
  //# sourceMappingURL=shell.context.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/shell.context.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport type { Breakpoint, PresentationValue, SidebarMode, PaneMode, PaneTarget } from './shell.types.js';\n\nexport interface ShellContextValue {\n // Pane states\n leftMode: PaneMode;\n setLeftMode: (mode: PaneMode) => void;\n panelMode: PaneMode; // Panel state within left container\n setPanelMode: (mode: PaneMode) => void;\n sidebarMode: SidebarMode;\n setSidebarMode: (mode: SidebarMode) => void;\n inspectorMode: PaneMode;\n setInspectorMode: (mode: PaneMode) => void;\n bottomMode: PaneMode;\n setBottomMode: (mode: PaneMode) => void;\n\n // Peek state (layout-only, ephemeral)\n peekTarget: PaneTarget | null;\n setPeekTarget: (target: PaneTarget | null) => void;\n peekPane: (target: PaneTarget) => void;\n clearPeek: () => void;\n\n // Composition detection\n hasLeft: boolean;\n setHasLeft: (has: boolean) => void;\n hasSidebar: boolean;\n setHasSidebar: (has: boolean) => void;\n\n // Presentation resolution\n currentBreakpoint: Breakpoint;\n currentBreakpointReady: boolean;\n leftResolvedPresentation?: PresentationValue;\n\n // Actions\n togglePane: (target: PaneTarget) => void;\n expandPane: (target: PaneTarget) => void;\n collapsePane: (target: PaneTarget) => void;\n // Toggle customization\n setSidebarToggleComputer?: (fn: (current: SidebarMode) => SidebarMode) => void;\n // Dev-only hooks for presentation warnings\n onLeftPres?: (p: PresentationValue) => void;\n // Sizing info for overlay grouping\n onLeftDefaults?: (size: number) => void;\n}\n\nconst ShellContext = React.createContext<ShellContextValue | null>(null);\n\n/** @internal Shell root context. Prefer slice hooks (useSidebarMode, useShellActions, etc.). */\nexport function useShell() {\n const ctx = React.useContext(ShellContext);\n if (!ctx) throw new Error('Shell components must be used within <Shell.Root>');\n return ctx;\n}\n\nexport function ShellProvider({ value, children }: { value: ShellContextValue; children: React.ReactNode }) {\n return <ShellContext.Provider value={value}>{children}</ShellContext.Provider>;\n}\n\n// Phase 7: Split contexts for render isolation\n\n// Pane mode slice contexts\ntype ModeSetter<T> = (mode: T) => void;\n\nexport const LeftModeContext = React.createContext<{ leftMode: PaneMode; setLeftMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useLeftMode() {\n const ctx = React.useContext(LeftModeContext);\n if (!ctx) throw new Error('useLeftMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const PanelModeContext = React.createContext<{ panelMode: PaneMode; setPanelMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function usePanelMode() {\n const ctx = React.useContext(PanelModeContext);\n if (!ctx) throw new Error('usePanelMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const SidebarModeContext = React.createContext<{ sidebarMode: SidebarMode; setSidebarMode: ModeSetter<SidebarMode> } | null>(null as any);\nexport function useSidebarMode() {\n const ctx = React.useContext(SidebarModeContext);\n if (!ctx) throw new Error('useSidebarMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const InspectorModeContext = React.createContext<{ inspectorMode: PaneMode; setInspectorMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useInspectorMode() {\n const ctx = React.useContext(InspectorModeContext);\n if (!ctx) throw new Error('useInspectorMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const BottomModeContext = React.createContext<{ bottomMode: PaneMode; setBottomMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useBottomMode() {\n const ctx = React.useContext(BottomModeContext);\n if (!ctx) throw new Error('useBottomMode must be used within Shell.Root');\n return ctx;\n}\n\n// Presentation slice\nexport const PresentationContext = React.createContext<{ currentBreakpoint: Breakpoint; currentBreakpointReady: boolean; leftResolvedPresentation?: PresentationValue } | null>(null as any);\nexport function usePresentation() {\n const ctx = React.useContext(PresentationContext);\n if (!ctx) throw new Error('usePresentation must be used within Shell.Root');\n return ctx;\n}\n\n// Peek slice\nexport const PeekContext = React.createContext<{ peekTarget: PaneTarget | null; setPeekTarget: (t: PaneTarget | null) => void; peekPane: (t: PaneTarget) => void; clearPeek: () => void } | null>(\n null as any,\n);\nexport function usePeek() {\n const ctx = React.useContext(PeekContext);\n if (!ctx) throw new Error('usePeek must be used within Shell.Root');\n return ctx;\n}\n\n// Actions slice (stable callbacks)\nexport const ActionsContext = React.createContext<{\n togglePane: (t: PaneTarget) => void;\n expandPane: (t: PaneTarget) => void;\n collapsePane: (t: PaneTarget) => void;\n setSidebarToggleComputer?: (fn: (current: SidebarMode) => SidebarMode) => void;\n} | null>(null as any);\nexport function useShellActions() {\n const ctx = React.useContext(ActionsContext);\n if (!ctx) throw new Error('useShellActions must be used within Shell.Root');\n return ctx;\n}\n\n// Composition slice\nexport const CompositionContext = React.createContext<{ hasLeft: boolean; setHasLeft: (v: boolean) => void; hasSidebar: boolean; setHasSidebar: (v: boolean) => void } | null>(null as any);\nexport function useComposition() {\n const ctx = React.useContext(CompositionContext);\n if (!ctx) throw new Error('useComposition must be used within Shell.Root');\n return ctx;\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,sBAAAC,EAAA,uBAAAC,EAAA,yBAAAC,EAAA,oBAAAC,EAAA,qBAAAC,EAAA,gBAAAC,EAAA,wBAAAC,EAAA,kBAAAC,EAAA,uBAAAC,EAAA,kBAAAC,EAAA,mBAAAC,EAAA,qBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,EAAA,YAAAC,EAAA,oBAAAC,EAAA,aAAAC,EAAA,oBAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAtB,GAAA,IAAAuB,EAAuB,oBA6CvB,MAAMC,EAAeD,EAAM,cAAwC,IAAI,EAGhE,SAASJ,GAAW,CACzB,MAAMM,EAAMF,EAAM,WAAWC,CAAY,EACzC,GAAI,CAACC,EAAK,MAAM,IAAI,MAAM,mDAAmD,EAC7E,OAAOA,CACT,CAEO,SAASf,EAAc,CAAE,MAAAgB,EAAO,SAAAC,CAAS,EAA4D,CAC1G,OAAOJ,EAAA,cAACC,EAAa,SAAb,CAAsB,MAAOE,GAAQC,CAAS,CACxD,CAOO,MAAMrB,EAAkBiB,EAAM,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ACd,SAASH,GAAkB,CAChC,MAAMK,EAAMF,EAAM,WAAWrB,CAAc,EAC3C,GAAI,CAACuB,EAAK,MAAM,IAAI,MAAM,gDAAgD,EAC1E,OAAOA,CACT,CAGO,MAAMrB,EAAqBmB,EAAM,cAAuI,IAAW,EACnL,SAASV,GAAiB,CAC/B,MAAMY,EAAMF,EAAM,WAAWnB,CAAkB,EAC/C,GAAI,CAACqB,EAAK,MAAM,IAAI,MAAM,+CAA+C,EACzE,OAAOA,CACT",
6
- "names": ["shell_context_exports", "__export", "ActionsContext", "BottomModeContext", "CompositionContext", "InspectorModeContext", "LeftModeContext", "PanelModeContext", "PeekContext", "PresentationContext", "ShellProvider", "SidebarModeContext", "useBottomMode", "useComposition", "useInspectorMode", "useLeftMode", "usePanelMode", "usePeek", "usePresentation", "useShell", "useShellActions", "useSidebarMode", "__toCommonJS", "React", "ShellContext", "ctx", "value", "children"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport type { Breakpoint, PresentationValue, SidebarMode, PaneMode, PaneTarget } from './shell.types.js';\n\nexport interface ShellContextValue {\n // Pane states\n leftMode: PaneMode;\n setLeftMode: (mode: PaneMode) => void;\n panelMode: PaneMode; // Panel state within left container\n setPanelMode: (mode: PaneMode) => void;\n sidebarMode: SidebarMode;\n setSidebarMode: (mode: SidebarMode) => void;\n inspectorMode: PaneMode;\n setInspectorMode: (mode: PaneMode) => void;\n bottomMode: PaneMode;\n setBottomMode: (mode: PaneMode) => void;\n\n // Peek state (layout-only, ephemeral)\n peekTarget: PaneTarget | null;\n setPeekTarget: (target: PaneTarget | null) => void;\n peekPane: (target: PaneTarget) => void;\n clearPeek: () => void;\n\n // Composition detection\n hasLeft: boolean;\n setHasLeft: (has: boolean) => void;\n hasSidebar: boolean;\n setHasSidebar: (has: boolean) => void;\n\n // Presentation resolution\n currentBreakpoint: Breakpoint;\n currentBreakpointReady: boolean;\n leftResolvedPresentation?: PresentationValue;\n\n // Actions\n togglePane: (target: PaneTarget) => void;\n expandPane: (target: PaneTarget) => void;\n collapsePane: (target: PaneTarget) => void;\n // Toggle customization\n setSidebarToggleComputer?: (fn: (current: SidebarMode) => SidebarMode) => void;\n // Dev-only hooks for presentation warnings\n onLeftPres?: (p: PresentationValue) => void;\n // Sizing info for overlay grouping\n onLeftDefaults?: (size: number) => void;\n}\n\nconst ShellContext = React.createContext<ShellContextValue | null>(null);\n\n/** @internal Shell root context. Prefer slice hooks (useSidebarMode, useShellActions, etc.). */\nexport function useShell() {\n const ctx = React.useContext(ShellContext);\n if (!ctx) throw new Error('Shell components must be used within <Shell.Root>');\n return ctx;\n}\n\nexport function ShellProvider({ value, children }: { value: ShellContextValue; children: React.ReactNode }) {\n return <ShellContext.Provider value={value}>{children}</ShellContext.Provider>;\n}\n\n// Phase 7: Split contexts for render isolation\n\n// Pane mode slice contexts\ntype ModeSetter<T> = (mode: T) => void;\n\nexport const LeftModeContext = React.createContext<{ leftMode: PaneMode; setLeftMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useLeftMode() {\n const ctx = React.useContext(LeftModeContext);\n if (!ctx) throw new Error('useLeftMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const PanelModeContext = React.createContext<{ panelMode: PaneMode; setPanelMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function usePanelMode() {\n const ctx = React.useContext(PanelModeContext);\n if (!ctx) throw new Error('usePanelMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const SidebarModeContext = React.createContext<{ sidebarMode: SidebarMode; setSidebarMode: ModeSetter<SidebarMode> } | null>(null as any);\nexport function useSidebarMode() {\n const ctx = React.useContext(SidebarModeContext);\n if (!ctx) throw new Error('useSidebarMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const InspectorModeContext = React.createContext<{ inspectorMode: PaneMode; setInspectorMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useInspectorMode() {\n const ctx = React.useContext(InspectorModeContext);\n if (!ctx) throw new Error('useInspectorMode must be used within Shell.Root');\n return ctx;\n}\n\nexport const BottomModeContext = React.createContext<{ bottomMode: PaneMode; setBottomMode: ModeSetter<PaneMode> } | null>(null as any);\nexport function useBottomMode() {\n const ctx = React.useContext(BottomModeContext);\n if (!ctx) throw new Error('useBottomMode must be used within Shell.Root');\n return ctx;\n}\n\n// Presentation slice\nexport const PresentationContext = React.createContext<{ currentBreakpoint: Breakpoint; currentBreakpointReady: boolean; leftResolvedPresentation?: PresentationValue } | null>(null as any);\nexport function usePresentation() {\n const ctx = React.useContext(PresentationContext);\n if (!ctx) throw new Error('usePresentation must be used within Shell.Root');\n return ctx;\n}\n\n// Peek slice\nexport const PeekContext = React.createContext<{ peekTarget: PaneTarget | null; setPeekTarget: (t: PaneTarget | null) => void; peekPane: (t: PaneTarget) => void; clearPeek: () => void } | null>(\n null as any,\n);\nexport function usePeek() {\n const ctx = React.useContext(PeekContext);\n if (!ctx) throw new Error('usePeek must be used within Shell.Root');\n return ctx;\n}\n\n// Actions slice (stable callbacks)\nexport const ActionsContext = React.createContext<{\n togglePane: (t: PaneTarget) => void;\n expandPane: (t: PaneTarget) => void;\n collapsePane: (t: PaneTarget) => void;\n setSidebarToggleComputer?: (fn: (current: SidebarMode) => SidebarMode) => void;\n} | null>(null as any);\nexport function useShellActions() {\n const ctx = React.useContext(ActionsContext);\n if (!ctx) throw new Error('useShellActions must be used within Shell.Root');\n return ctx;\n}\n\n// Composition slice\nexport const CompositionContext = React.createContext<{ hasLeft: boolean; setHasLeft: (v: boolean) => void; hasSidebar: boolean; setHasSidebar: (v: boolean) => void } | null>(null as any);\nexport function useComposition() {\n const ctx = React.useContext(CompositionContext);\n if (!ctx) throw new Error('useComposition must be used within Shell.Root');\n return ctx;\n}\n\n// Inset slice - tracks which panes have inset for gray backdrop\nexport type InsetPaneId = 'left' | 'sidebar' | 'content' | 'inspector' | 'bottom';\nexport const InsetContext = React.createContext<{\n insetPanes: Set<InsetPaneId>;\n registerInset: (id: InsetPaneId) => void;\n unregisterInset: (id: InsetPaneId) => void;\n hasAnyInset: boolean;\n} | null>(null as any);\nexport function useInset() {\n const ctx = React.useContext(InsetContext);\n if (!ctx) throw new Error('useInset must be used within Shell.Root');\n return ctx;\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,sBAAAC,EAAA,uBAAAC,EAAA,iBAAAC,EAAA,yBAAAC,EAAA,oBAAAC,EAAA,qBAAAC,EAAA,gBAAAC,EAAA,wBAAAC,EAAA,kBAAAC,EAAA,uBAAAC,EAAA,kBAAAC,EAAA,mBAAAC,EAAA,aAAAC,EAAA,qBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,EAAA,YAAAC,EAAA,oBAAAC,EAAA,aAAAC,EAAA,oBAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAxB,GAAA,IAAAyB,EAAuB,oBA6CvB,MAAMC,EAAeD,EAAM,cAAwC,IAAI,EAGhE,SAASJ,GAAW,CACzB,MAAMM,EAAMF,EAAM,WAAWC,CAAY,EACzC,GAAI,CAACC,EAAK,MAAM,IAAI,MAAM,mDAAmD,EAC7E,OAAOA,CACT,CAEO,SAAShB,EAAc,CAAE,MAAAiB,EAAO,SAAAC,CAAS,EAA4D,CAC1G,OAAOJ,EAAA,cAACC,EAAa,SAAb,CAAsB,MAAOE,GAAQC,CAAS,CACxD,CAOO,MAAMtB,EAAkBkB,EAAM,cAAgF,IAAW,EACzH,SAASR,GAAc,CAC5B,MAAMU,EAAMF,EAAM,WAAWlB,CAAe,EAC5C,GAAI,CAACoB,EAAK,MAAM,IAAI,MAAM,4CAA4C,EACtE,OAAOA,CACT,CAEO,MAAMnB,EAAmBiB,EAAM,cAAkF,IAAW,EAC5H,SAASP,GAAe,CAC7B,MAAMS,EAAMF,EAAM,WAAWjB,CAAgB,EAC7C,GAAI,CAACmB,EAAK,MAAM,IAAI,MAAM,6CAA6C,EACvE,OAAOA,CACT,CAEO,MAAMf,EAAqBa,EAAM,cAA4F,IAAW,EACxI,SAASF,GAAiB,CA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AAMF,EAAM,WAAWpB,CAAY,EACzC,GAAI,CAACsB,EAAK,MAAM,IAAI,MAAM,yCAAyC,EACnE,OAAOA,CACT",
6
+ "names": ["shell_context_exports", "__export", "ActionsContext", "BottomModeContext", "CompositionContext", "InsetContext", "InspectorModeContext", "LeftModeContext", "PanelModeContext", "PeekContext", "PresentationContext", "ShellProvider", "SidebarModeContext", "useBottomMode", "useComposition", "useInset", "useInspectorMode", "useLeftMode", "usePanelMode", "usePeek", "usePresentation", "useShell", "useShellActions", "useSidebarMode", "__toCommonJS", "React", "ShellContext", "ctx", "value", "children"]
7
7
  }