@kushagradhawan/kookie-ui 0.1.123 → 0.1.124

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 (59) hide show
  1. package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
  2. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  3. package/dist/cjs/components/_internal/shell-bottom.js.map +2 -2
  4. package/dist/cjs/components/_internal/shell-handles.js +1 -1
  5. package/dist/cjs/components/_internal/shell-handles.js.map +2 -2
  6. package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
  7. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  8. package/dist/cjs/components/_internal/shell-inspector.js.map +2 -2
  9. package/dist/cjs/components/_internal/shell-prop-helpers.js.map +2 -2
  10. package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
  11. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  12. package/dist/cjs/components/_internal/shell-sidebar.js.map +2 -2
  13. package/dist/cjs/components/shell.context.d.ts +2 -0
  14. package/dist/cjs/components/shell.context.d.ts.map +1 -1
  15. package/dist/cjs/components/shell.context.js +1 -1
  16. package/dist/cjs/components/shell.context.js.map +2 -2
  17. package/dist/cjs/components/shell.d.ts.map +1 -1
  18. package/dist/cjs/components/shell.js +1 -1
  19. package/dist/cjs/components/shell.js.map +3 -3
  20. package/dist/cjs/components/shell.types.d.ts +11 -0
  21. package/dist/cjs/components/shell.types.d.ts.map +1 -1
  22. package/dist/cjs/components/shell.types.js +1 -1
  23. package/dist/cjs/components/shell.types.js.map +1 -1
  24. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  25. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  26. package/dist/esm/components/_internal/shell-bottom.js.map +2 -2
  27. package/dist/esm/components/_internal/shell-handles.js +1 -1
  28. package/dist/esm/components/_internal/shell-handles.js.map +2 -2
  29. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  30. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  31. package/dist/esm/components/_internal/shell-inspector.js.map +2 -2
  32. package/dist/esm/components/_internal/shell-prop-helpers.js.map +2 -2
  33. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  34. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  35. package/dist/esm/components/_internal/shell-sidebar.js.map +2 -2
  36. package/dist/esm/components/shell.context.d.ts +2 -0
  37. package/dist/esm/components/shell.context.d.ts.map +1 -1
  38. package/dist/esm/components/shell.context.js.map +2 -2
  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/dist/esm/components/shell.types.d.ts +11 -0
  43. package/dist/esm/components/shell.types.d.ts.map +1 -1
  44. package/dist/esm/components/shell.types.js.map +1 -1
  45. package/package.json +1 -1
  46. package/schemas/base-button.json +1 -1
  47. package/schemas/button.json +1 -1
  48. package/schemas/icon-button.json +1 -1
  49. package/schemas/index.json +6 -6
  50. package/schemas/toggle-button.json +1 -1
  51. package/schemas/toggle-icon-button.json +1 -1
  52. package/src/components/_internal/shell-bottom.tsx +5 -5
  53. package/src/components/_internal/shell-handles.tsx +26 -26
  54. package/src/components/_internal/shell-inspector.tsx +5 -5
  55. package/src/components/_internal/shell-prop-helpers.ts +1 -1
  56. package/src/components/_internal/shell-sidebar.tsx +10 -10
  57. package/src/components/shell.context.tsx +12 -10
  58. package/src/components/shell.tsx +21 -20
  59. package/src/components/shell.types.ts +13 -0
@@ -1,2 +1,2 @@
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;
1
+ "use strict";var Ne=Object.create;var k=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var Ie=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty;var Oe=(i,s)=>{for(var l in s)k(i,l,{get:s[l],enumerable:!0})},le=(i,s,l,g)=>{if(s&&typeof s=="object"||typeof s=="function")for(let d of Ve(s))!He.call(i,d)&&d!==l&&k(i,d,{get:()=>s[d],enumerable:!(g=De(s,d))||g.enumerable});return i};var F=(i,s,l)=>(l=i!=null?Ne(Ie(i)):{},le(s||!i||!i.__esModule?k(l,"default",{value:i,enumerable:!0}):l,i)),Be=i=>le(k({},"__esModule",{value:!0}),i);var Ue={};Oe(Ue,{Sidebar:()=>q});module.exports=Be(Ue);var t=F(require("react")),ue=F(require("classnames")),j=F(require("../sheet.js")),ce=require("../visually-hidden.js"),y=require("../shell.context.js"),w=require("../shell.hooks.js"),pe=require("./shell-resize.js"),fe=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"],q=t.forwardRef((i,s)=>{const{className:l,presentation:g={initial:"overlay",md:"fixed"},expandedSize:d=288,minSize:p=200,maxSize:f=400,resizable:N=!1,collapsible:Se=!0,onExpand:K,onCollapse:Y,onResize:D,onResizeStart:me,onResizeEnd:he,snapPoints:Me,snapTolerance:ye,collapseThreshold:ge,paneId:V,persistence:I,children:Pe,style:ze,thinSize:h=64,toggleModes:H,state:b,defaultState:P,onStateChange:z,size:G,defaultSize:J,onSizeChange:O,sizeUpdate:B,sizeUpdateMs:$=50,inset:U}=i,Re=(0,fe.extractPaneDomProps)(i,$e),n=(0,y.useShell)(),{registerInset:Q,unregisterInset:X}=(0,y.useInset)();t.useEffect(()=>{if(U)return Q("sidebar"),()=>X("sidebar")},[U,Q,X]);const _=(0,w.useResponsivePresentation)(g),M=_==="overlay",ve=_==="stacked",u=t.useRef(null),xe=t.useCallback(e=>{u.current=e,typeof s=="function"?s(e):s&&(s.current=e)},[s]),Z=t.Children.toArray(Pe),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:P,currentValue:n.sidebarMode,setValue:n.setSidebarMode,breakpointReady:n.currentBreakpointReady,controlledIsResponsive:Ee,onResponsiveChange:e=>z?.(e,{reason:"responsive"}),onInit:e=>z?.(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,z?.(n.sidebarMode,{reason:"toggle"})))},[n.sidebarMode,b,z]);const re=t.useRef(K),oe=t.useRef(Y);t.useLayoutEffect(()=>{re.current=K,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 ie=n.sidebarMode!=="collapsed",E=t.useMemo(()=>{if(!V||I)return I;const e=`kookie-ui:shell:sidebar:${V}`;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{}}}},[V,I]);t.useEffect(()=>{let e=!0;return(async()=>{if(!N||!E?.load||M)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,M]);const T=(0,y.useShell)(),A=t.useCallback(()=>{const e=ne??(typeof P=="string"?P:void 0)??"expanded";return e==="thin"||e==="expanded"?e:"expanded"},[ne,P]);t.useEffect(()=>{if(!T.setSidebarToggleComputer)return;const e=H??"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,H,A]);const se=t.useRef(d),Te=t.useRef("expanded");t.useEffect(()=>{n.sidebarMode!=="collapsed"&&(Te.current=n.sidebarMode,se.current=n.sidebarMode==="thin"?h:d)},[n.sidebarMode,h,d]);const ke=N&&!M&&n.sidebarMode==="expanded"?t.createElement(pe.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:D,onResizeStart:me,onResizeEnd:e=>{he?.(e),R(e,{reason:"resize"}),E?.save?.(e)},target:"sidebar",collapsible:Se,snapPoints:Me,snapTolerance:ye??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 f=="number"?f:void 0)??e,Math.max((typeof p=="number"?p:void 0)??e,e));u.current.style.setProperty("--sidebar-size",`${a}px`),R(a,{reason:"init"})}}},[]);const W=G;if(t.useEffect(()=>{if(!u.current||typeof W>"u")return;const e=L(W);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`),R(a,{reason:"controlled"})}},[W,p,f,L,R]),M){const e=n.sidebarMode!=="collapsed";return t.createElement(j.Root,{open:e,onOpenChange:r=>n.setSidebarMode(r?"expanded":"collapsed")},t.createElement(j.Content,{side:"start",style:{padding:0},width:{initial:`${e?n.sidebarMode==="thin"?h:d:se.current}px`}},t.createElement(ce.VisuallyHidden,null,t.createElement(j.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&&ie||void 0,"data-inset":U||void 0,style:{...ze,"--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"&&!M?(()=>{const e=H??"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":ie||void 0},te),ke)});q.displayName="Shell.Sidebar",q.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, 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,GAAAD,GAAA,aAAAE,IAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAuB,oBACvBC,GAAuB,yBACvBC,EAAuB,0BACvBC,GAA+B,iCAC/BC,EAAmC,+BACnCC,EAAqE,6BACrEC,GAAkC,6BAClCC,GAAoC,mCACpCC,EAA0C,8BAE1CC,GAA6B,6BAC7BC,GAA8B,4CA2B9B,MAAMC,GAAwB,CAC5B,YACA,WACA,QACA,eACA,gBACA,WACA,cACA,OACA,cACA,eACA,aACA,eACA,QACA,OACF,EAEab,EAAUE,EAAM,WAA+C,CAACY,EAAcC,IAAQ,CACjG,KAAM,CACJ,UAAAC,EACA,aAAAC,EAAe,CAAE,QAAS,UAAW,GAAI,OAAQ,EACjD,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,SAAAC,EAAW,GACX,YAAAC,EACA,MAAAC,EACA,aAAAC,EACA,cAAAC,EACA,KAAAC,EACA,YAAAC,EACA,aAAAC,EACA,WAAAC,EACA,aAAAC,EAAe,GACf,MAAAC,CACF,EAAI/B,EACEgC,MAAkB,wBAAoBhC,EAAcD,EAAqB,EACzEkC,KAAQ,YAAS,EACjB,CAAE,cAAAC,EAAe,gBAAAC,CAAgB,KAAI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AKQ,GACL,aAAW,GAAA0D,SAAW,kBAAmBhG,CAAS,EAClD,YAAW+B,EAAM,YACjB,YAAWA,EAAM,aAAe,WAAa,OAC7C,oBAAmBA,EAAM,uBAAyBG,EAAuB,OACzE,YAAYH,EAAM,wBAA0BK,IAAa+B,IAAqB,OAC9E,aAAYtC,GAAS,OACrB,MAAO,CACL,GAAGX,GACF,iBAA0B,GAAGhB,CAAY,KACzC,sBAA+B,GAAGiB,CAAQ,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",
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, CSSPropertiesWithVars } 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': `${expandedSize}px`,\n '--sidebar-thin-size': `${thinSize}px`,\n '--sidebar-min-size': `${minSize}px`,\n '--sidebar-max-size': `${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': `${thinSize}px`,\n } as CSSPropertiesWithVars;\n }\n return {\n '--peek-sidebar-width': `var(--sidebar-size, ${expandedSize}px)`,\n } as CSSPropertiesWithVars;\n })()\n : {}),\n } as CSSPropertiesWithVars}\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,0BACvBC,GAA+B,iCAC/BC,EAAmC,+BACnCC,EAAqE,6BACrEC,GAAkC,6BAClCC,GAAoC,mCACpCC,EAA0C,8BAE1CC,GAA6B,6BAC7BC,GAA8B,4CA2B9B,MAAMC,GAAwB,CAC5B,YACA,WACA,QACA,eACA,gBACA,WACA,cACA,OACA,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AA0B,EACzChB,EAAOmB,IAAY,YAAcC,EAAS,WAC5C,CACA,OAAIpB,IAAS,OACJ,CACL,uBAAwB,GAAGvC,CAAQ,IACrC,EAEK,CACL,uBAAwB,uBAAuBjB,CAAY,KAC7D,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
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
  }
@@ -28,6 +28,8 @@ export interface ShellContextValue {
28
28
  setSidebarToggleComputer?: (fn: (current: SidebarMode) => SidebarMode) => void;
29
29
  onLeftPres?: (p: PresentationValue) => void;
30
30
  onLeftDefaults?: (size: number) => void;
31
+ onRailDefaults?: (size: number) => void;
32
+ onPanelDefaults?: (size: number) => void;
31
33
  }
32
34
  /** @internal Shell root context. Prefer slice hooks (useSidebarMode, useShellActions, etc.). */
33
35
  export declare function useShell(): ShellContextValue;
@@ -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,IAAI,CAAC;IACvC,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC5C,aAAa,EAAE,QAAQ,CAAC;IACxB,gBAAgB,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC3C,UAAU,EAAE,QAAQ,CAAC;IACrB,aAAa,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAGxC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC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MAAM,kBAAkB;aAAkC,OAAO;gBAAc,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI;gBAAc,OAAO;mBAAiB,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI;SAAgB,CAAC;AACrL,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;SACP,CAAC;AAChB,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 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}
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:()=>R,SidebarModeContext:()=>c,useBottomMode:()=>V,useComposition:()=>D,useInset:()=>j,useInspectorMode:()=>y,useLeftMode:()=>B,usePanelMode:()=>E,usePeek:()=>H,usePresentation:()=>A,useShell:()=>k,useShellActions:()=>z,useSidebarMode:()=>L});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 R({value:e,children:o}){return t.createElement(l.Provider,{value:e},o)}const i=t.createContext(null);function B(){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 E(){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 y(){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 z(){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 D(){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 j(){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\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,EA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MAAMc,EAAMF,EAAM,WAAWtB,CAAiB,EAC9C,GAAI,CAACwB,EAAK,MAAM,IAAI,MAAM,8CAA8C,EACxE,OAAOA,CACT,CAGO,MAAMjB,EAAsBe,EAAM,cAAuI,IAAW,EACpL,SAASL,GAAkB,CAChC,MAAMO,EAAMF,EAAM,WAAWf,CAAmB,EAChD,GAAI,CAACiB,EAAK,MAAM,IAAI,MAAM,gDAAgD,EAC1E,OAAOA,CACT,CAGO,MAAMlB,EAAcgB,EAAM,cAC/B,IACF,EACO,SAASN,GAAU,CACxB,MAAMQ,EAAMF,EAAM,WAAWhB,CAAW,EACxC,GAAI,CAACkB,EAAK,MAAM,IAAI,MAAM,wCAAwC,EAClE,OAAOA,CACT,CAGO,MAAMzB,EAAiBuB,EAAM,cAK1B,IAAW,EACd,SAASH,GAAkB,CAChC,MAAMK,EAAMF,EAAM,WAAWvB,CAAc,EAC3C,GAAI,CAACyB,EAAK,MAAM,IAAI,MAAM,gDAAgD,EAC1E,OAAOA,CACT,CAGO,MAAMvB,EAAqBqB,EAAM,cAAuI,IAAW,EACnL,SAASX,GAAiB,CAC/B,MAAMa,EAAMF,EAAM,WAAWrB,CAAkB,EAC/C,GAAI,CAACuB,EAAK,MAAM,IAAI,MAAM,+CAA+C,EACzE,OAAOA,CACT,CAIO,MAAMtB,EAAeoB,EAAM,cAKxB,IAAW,EACd,SAASV,GAAW,CACzB,MAAMY,EAAMF,EAAM,WAAWpB,CAAY,EACzC,GAAI,CAACsB,EAAK,MAAM,IAAI,MAAM,yCAAyC,EACnE,OAAOA,CACT",
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 onRailDefaults?: (size: number) => void;\n onPanelDefaults?: (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);\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);\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);\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);\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);\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);\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,\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);\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);\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);\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,oBA+CvB,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,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A,CACT,CAGO,MAAMzB,EAAiBuB,EAAM,cAK1B,IAAI,EACP,SAASH,GAAkB,CAChC,MAAMK,EAAMF,EAAM,WAAWvB,CAAc,EAC3C,GAAI,CAACyB,EAAK,MAAM,IAAI,MAAM,gDAAgD,EAC1E,OAAOA,CACT,CAGO,MAAMvB,EAAqBqB,EAAM,cAAuI,IAAI,EAC5K,SAASX,GAAiB,CAC/B,MAAMa,EAAMF,EAAM,WAAWrB,CAAkB,EAC/C,GAAI,CAACuB,EAAK,MAAM,IAAI,MAAM,+CAA+C,EACzE,OAAOA,CACT,CAIO,MAAMtB,EAAeoB,EAAM,cAKxB,IAAI,EACP,SAASV,GAAW,CACzB,MAAMY,EAAMF,EAAM,WAAWpB,CAAY,EACzC,GAAI,CAACsB,EAAK,MAAM,IAAI,MAAM,yCAAyC,EACnE,OAAOA,CACT",
6
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
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/components/shell.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,yBAAyB,EAA6B,MAAM,kBAAkB,CAAC;AAIxF,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,KAAK,EAAqB,sBAAsB,EAAE,QAAQ,EAAE,WAAW,EAAuB,UAAU,EAAE,UAAU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,CAAC,MAAM,CAAC;IACxE,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,OAAO,uFAYX,CAAC;AAYH,KAAK,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtD,UAAU,YAAa,SAAQ,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IACrE,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,OAAO,wFA8EX,CAAC;AAIH,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,EACP,QAAQ,EACR,yBAAyB,EACzB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,aAAa,GACnB,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var Ke=Object.create;var Se=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var Ye=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ze=Object.prototype.hasOwnProperty;var en=(t,a)=>{for(var i in a)Se(t,i,{get:a[i],enumerable:!0})},_e=(t,a,i,P)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of Ye(a))!Ze.call(t,c)&&c!==i&&Se(t,c,{get:()=>a[c],enumerable:!(P=Xe(a,c))||P.enumerable});return t};var ge=(t,a,i)=>(i=t!=null?Ke(Je(t)):{},_e(a||!t||!t.__esModule?Se(i,"default",{value:t,enumerable:!0}):i,t)),nn=t=>_e(Se({},"__esModule",{value:!0}),t);var sn={};en(sn,{Bottom:()=>ye.Bottom,Content:()=>Me,Header:()=>ve,Inspector:()=>Pe.Inspector,Left:()=>me,Panel:()=>Q,Rail:()=>G,Root:()=>Oe,Sidebar:()=>pe.Sidebar,Trigger:()=>Le,useResponsivePresentation:()=>te.useResponsivePresentation,useShell:()=>p.useShell});module.exports=nn(sn);var e=ge(require("react")),q=ge(require("classnames")),Te=ge(require("./sheet.js")),De=require("./visually-hidden.js"),te=require("./shell.hooks.js"),Be=require("./_internal/shell-resize.js"),ce=require("./_internal/shell-handles.js"),K=require("./_internal/shell-prop-helpers.js"),pe=require("./_internal/shell-sidebar.js"),ye=require("./_internal/shell-bottom.js"),Pe=require("./_internal/shell-inspector.js"),Ae=require("./shell.types.js"),we=require("../helpers/normalize-to-px.js"),p=require("./shell.context.js");function tn(){const[t,a]=e.useState("initial"),[i,P]=e.useState(!1);return e.useEffect(()=>{if(typeof window>"u")return;const h=Object.entries(Ae._BREAKPOINTS).map(([M,l])=>[M,window.matchMedia(l)]),v=()=>{const M=h.filter(([,f])=>f.matches).map(([f])=>f),l=M[M.length-1]??"initial";a(l),P(!0)};v();const S=[];return h.forEach(([,M])=>{const l=M;typeof l.addEventListener=="function"&&typeof l.removeEventListener=="function"?(l.addEventListener("change",v),S.push(()=>l.removeEventListener?.("change",v))):typeof l.addListener=="function"&&typeof l.removeListener=="function"&&(l.addListener(v),S.push(()=>l.removeListener?.(v)))}),()=>{S.forEach(M=>{try{M()}catch{}})}},[]),{bp:t,ready:i}}const Ee=Symbol("rtShellSlot");function ne(t,a){return t[Ee]=a,t}function dn(t,a){if(!e.isValidElement(t))return!1;const i=t.type;if(i===a)return!0;const P=a?.[Ee];return!!(i?.[Ee]&&P&&i[Ee]===P)}ne(pe.Sidebar,"Shell.Sidebar"),ne(Pe.Inspector,"Shell.Inspector"),ne(ye.Bottom,"Shell.Bottom");function on(t,a){switch(a.type){case"SET_LEFT_MODE":return a.mode==="collapsed"?{...t,leftMode:"collapsed",panelMode:"collapsed"}:{...t,leftMode:a.mode};case"SET_PANEL_MODE":return a.mode==="expanded"&&t.leftMode!=="expanded"?{...t,leftMode:"expanded",panelMode:"expanded"}:{...t,panelMode:a.mode};case"SET_SIDEBAR_MODE":return{...t,sidebarMode:a.mode};case"SET_INSPECTOR_MODE":return{...t,inspectorMode:a.mode};case"SET_BOTTOM_MODE":return{...t,bottomMode:a.mode};case"TOGGLE_PANE":{switch(a.target){case"left":case"rail":return{...t,leftMode:t.leftMode==="expanded"?"collapsed":"expanded",panelMode:t.leftMode==="expanded"?"collapsed":t.panelMode};case"panel":return t.leftMode==="collapsed"?{...t,leftMode:"expanded",panelMode:"expanded"}:{...t,panelMode:t.panelMode==="expanded"?"collapsed":"expanded"};case"sidebar":{const i=t.sidebarMode==="collapsed"?"expanded":t.sidebarMode==="expanded"?"collapsed":"expanded";return{...t,sidebarMode:i}}case"inspector":return{...t,inspectorMode:t.inspectorMode==="expanded"?"collapsed":"expanded"};case"bottom":return{...t,bottomMode:t.bottomMode==="expanded"?"collapsed":"expanded"};default:return t}return t}case"EXPAND_PANE":{switch(a.target){case"left":case"rail":return{...t,leftMode:"expanded"};case"panel":return{...t,leftMode:"expanded",panelMode:"expanded"};case"sidebar":return{...t,sidebarMode:"expanded"};case"inspector":return{...t,inspectorMode:"expanded"};case"bottom":return{...t,bottomMode:"expanded"};default:return t}return t}case"COLLAPSE_PANE":{switch(a.target){case"left":case"rail":return{...t,leftMode:"collapsed",panelMode:"collapsed"};case"panel":return{...t,panelMode:"collapsed"};case"sidebar":return{...t,sidebarMode:"collapsed"};case"inspector":return{...t,inspectorMode:"collapsed"};case"bottom":return{...t,bottomMode:"collapsed"};default:return t}return t}}return t}const Oe=e.forwardRef(({className:t,children:a,height:i="full",...P},c)=>{const{bp:h,ready:v}=tn(),S=e.Children.toArray(a),M=S.some(n=>e.isValidElement(n)&&n.type?.displayName==="Shell.Panel"&&!!n.props?.defaultOpen),l=S.find(n=>e.isValidElement(n)&&n.type?.displayName==="Shell.Rail"),f=l?l.props?.defaultOpen:void 0,N=l?f===void 0?!0:typeof f=="boolean"?f:typeof f=="object"?f.initial??Object.values(f)[0]??!0:!0:!1,U=S.some(n=>e.isValidElement(n)&&n.type?.displayName==="Shell.Inspector"&&!!n.props?.defaultOpen),D=S.some(n=>e.isValidElement(n)&&n.type?.displayName==="Shell.Inspector"&&typeof n.props?.open<"u"&&!!n.props?.open),E=()=>{const n=S.find(m=>e.isValidElement(m)&&m.type?.displayName==="Shell.Sidebar");if(!n)return"expanded";const d=n.props;if(typeof d?.state<"u"){if(typeof d.state=="string")return d.state;if(typeof d.state=="object")return d.state.initial??Object.values(d.state)[0]??"expanded"}if(typeof d?.defaultState<"u"){if(typeof d.defaultState=="string")return d.defaultState;if(typeof d.defaultState=="object")return d.defaultState.initial??Object.values(d.defaultState)[0]??"expanded"}return"expanded"},k=()=>{const n=S.find(m=>e.isValidElement(m)&&m.type?.displayName==="Shell.Bottom");if(!n)return"collapsed";const d=n.props;if(typeof d?.open<"u"){if(typeof d.open=="boolean")return d.open?"expanded":"collapsed";if(typeof d.open=="object")return d.open.initial??Object.values(d.open)[0]?"expanded":"collapsed"}return typeof d?.defaultOpen<"u"&&d.defaultOpen?"expanded":"collapsed"},[u,r]=e.useReducer(on,{leftMode:M||N?"expanded":"collapsed",panelMode:M?"expanded":"collapsed",sidebarMode:E(),inspectorMode:U||D?"expanded":"collapsed",bottomMode:k()}),T=e.useCallback(n=>r({type:"SET_LEFT_MODE",mode:n}),[]),$=e.useCallback(n=>r({type:"SET_PANEL_MODE",mode:n}),[]),z=e.useCallback(n=>r({type:"SET_SIDEBAR_MODE",mode:n}),[]),I=e.useCallback(n=>r({type:"SET_INSPECTOR_MODE",mode:n}),[]),w=e.useCallback(n=>r({type:"SET_BOTTOM_MODE",mode:n}),[]),[B,oe]=e.useState(!1),[O,H]=e.useState(!1),W=e.useRef(n=>n==="collapsed"?"thin":n==="thin"?"expanded":"collapsed"),g=e.useCallback(n=>{W.current=n},[]);e.useEffect(()=>{O&&B&&console.warn("Shell: Sidebar cannot coexist with Rail or Panel. Use either Rail+Panel OR Sidebar.")},[O,B]);const[R,A]=e.useState(void 0),s=e.useCallback(n=>A(n),[]),_=e.useRef(64),X=e.useRef(288),ae=e.useCallback(n=>{_.current=n},[]),Y=e.useCallback(n=>{X.current=n},[]),le=e.useMemo(()=>{const n=e.Children.toArray(a),d=(m,ee)=>e.isValidElement(m)&&(m.type===ee||m.type?.displayName===ee.displayName);return n.some(m=>d(m,G)||d(m,Q))},[a]),se=e.useMemo(()=>{const n=e.Children.toArray(a),d=(m,ee)=>e.isValidElement(m)&&(m.type===ee||m.type?.displayName===ee.displayName);return n.some(m=>d(m,pe.Sidebar))},[a]),y=e.useCallback(n=>{if(n==="sidebar"){const d=W.current(u.sidebarMode);z(d);return}r({type:"TOGGLE_PANE",target:n})},[u.sidebarMode,z]),b=e.useCallback(n=>{if(n==="sidebar")return z("expanded");r({type:"EXPAND_PANE",target:n})},[z]),re=e.useCallback(n=>{if(n==="sidebar")return z("collapsed");r({type:"COLLAPSE_PANE",target:n})},[z]),ue=e.useMemo(()=>({leftMode:u.leftMode,setLeftMode:T,panelMode:u.panelMode,setPanelMode:$,sidebarMode:u.sidebarMode,setSidebarMode:z,inspectorMode:u.inspectorMode,setInspectorMode:I,bottomMode:u.bottomMode,setBottomMode:w,hasLeft:B,setHasLeft:oe,hasSidebar:O,setHasSidebar:H,currentBreakpoint:h,currentBreakpointReady:v,leftResolvedPresentation:R,togglePane:y,expandPane:b,collapsePane:re,setSidebarToggleComputer:g,onLeftPres:s,onRailDefaults:ae,onPanelDefaults:Y}),[u.leftMode,T,u.panelMode,$,u.sidebarMode,z,u.inspectorMode,I,u.bottomMode,w,B,O,h,v,R,y,b,re,g,s,ae,Y]),V=e.Children.toArray(a),F=(n,d)=>e.isValidElement(n)&&(n.type===d||n.type?.displayName===d.displayName),de=V.filter(n=>F(n,ve)),J=V.filter(n=>F(n,G)),Z=V.filter(n=>F(n,Q)),fe=V.filter(n=>F(n,pe.Sidebar)),Ce=V.filter(n=>F(n,Me)),o=V.filter(n=>F(n,Pe.Inspector)),C=V.filter(n=>F(n,ye.Bottom)),x=J[0]?.props?.open;e.useEffect(()=>{if(typeof x>"u")return;T(!!x?"expanded":"collapsed")},[x,T]);const L=e.useMemo(()=>i==="full"?{height:"100vh"}:i==="auto"?{height:"auto"}:typeof i=="string"?{height:i}:typeof i=="number"?{height:`${i}px`}:{},[i]),[j,ie]=e.useState(null),be=e.useCallback(n=>ie(n),[]),he=e.useCallback(()=>ie(null),[]),Ie=e.useMemo(()=>({currentBreakpoint:h,currentBreakpointReady:v,leftResolvedPresentation:R}),[h,v,R]),He=e.useMemo(()=>({leftMode:u.leftMode,setLeftMode:T}),[u.leftMode,T]),Ve=e.useMemo(()=>({panelMode:u.panelMode,setPanelMode:$}),[u.panelMode,$]),je=e.useMemo(()=>({sidebarMode:u.sidebarMode,setSidebarMode:z}),[u.sidebarMode,z]),Ue=e.useMemo(()=>({inspectorMode:u.inspectorMode,setInspectorMode:I}),[u.inspectorMode,I]),Fe=e.useMemo(()=>({bottomMode:u.bottomMode,setBottomMode:w}),[u.bottomMode,w]),$e=e.useMemo(()=>({hasLeft:B,setHasLeft:oe,hasSidebar:O,setHasSidebar:H}),[B,oe,O,H]),[xe,ke]=e.useState(new Set),ze=e.useCallback(n=>{ke(d=>{if(d.has(n))return d;const m=new Set(d);return m.add(n),m})},[]),Ne=e.useCallback(n=>{ke(d=>{if(!d.has(n))return d;const m=new Set(d);return m.delete(n),m})},[]),Re=xe.size>0,We=e.useMemo(()=>({insetPanes:xe,registerInset:ze,unregisterInset:Ne,hasAnyInset:Re}),[xe,ze,Ne,Re]),qe=e.useMemo(()=>({peekTarget:j,setPeekTarget:ie,peekPane:be,clearPeek:he}),[j,ie,be,he]),Ge=e.useMemo(()=>({togglePane:y,expandPane:b,collapsePane:re,setSidebarToggleComputer:g}),[y,b,re,g]),Qe=e.useMemo(()=>({...ue,peekTarget:j,setPeekTarget:ie,peekPane:be,clearPeek:he}),[ue,j,ie,be,he]);return e.createElement("div",{...P,ref:c,className:(0,q.default)("rt-ShellRoot",t),style:{...L,...P.style}},e.createElement(p.ShellProvider,{value:Qe},e.createElement(p.PresentationContext.Provider,{value:Ie},e.createElement(p.LeftModeContext.Provider,{value:He},e.createElement(p.PanelModeContext.Provider,{value:Ve},e.createElement(p.SidebarModeContext.Provider,{value:je},e.createElement(p.InspectorModeContext.Provider,{value:Ue},e.createElement(p.BottomModeContext.Provider,{value:Fe},e.createElement(p.CompositionContext.Provider,{value:$e},e.createElement(p.PeekContext.Provider,{value:qe},e.createElement(p.ActionsContext.Provider,{value:Ge},e.createElement(p.InsetContext.Provider,{value:We},de,e.createElement("div",{className:"rt-ShellBody","data-peek-target":j??void 0,"data-has-inset":Re||void 0,style:j==="rail"||j==="panel"?{"--peek-rail-width":`${_.current}px`}:void 0},le&&!se?(()=>{const n=J[0],d=Z[0],m=!!n?.props?.inset||!!d?.props?.inset,ee=n?{onOpenChange:n.props?.onOpenChange,open:n.props?.open,defaultOpen:n.props?.defaultOpen,presentation:n.props?.presentation,collapsible:n.props?.collapsible,onExpand:n.props?.onExpand,onCollapse:n.props?.onCollapse,inset:m}:{defaultOpen:M?!0:void 0,inset:m};return e.createElement(me,{...ee},J,Z)})():fe,Ce,o),C))))))))))))});Oe.displayName="Shell.Root";const ve=e.forwardRef(({className:t,height:a=64,style:i,...P},c)=>e.createElement("header",{...P,ref:c,className:(0,q.default)("rt-ShellHeader",t),style:{...i,"--shell-header-height":`${a}px`}}));ve.displayName="Shell.Header";const an=["open","defaultOpen","onOpenChange","mode","defaultMode","onModeChange"],me=e.forwardRef((t,a)=>{const{className:i,presentation:P={initial:"fixed",sm:"fixed"},collapsible:c=!0,onExpand:h,onCollapse:v,children:S,style:M,inset:l,...f}=t,{registerInset:N,unregisterInset:U}=(0,p.useInset)();e.useEffect(()=>{if(l)return N("left"),()=>U("left")},[l,N,U]);const D=f.open,E=f.defaultOpen,k=f.onOpenChange,u=(0,K.omitPaneProps)(f,an),r=(0,p.useShell)(),T=(0,te.useResponsivePresentation)(P),$=T==="overlay",z=T==="stacked",I=e.useRef(null);e.useEffect(()=>{r.onLeftPres?.(T)},[r,T]);const w=e.useCallback(g=>{I.current=g,typeof a=="function"?a(g):a&&(a.current=g)},[a]);e.useEffect(()=>(r.setHasLeft(!0),()=>r.setHasLeft(!1)),[r]);const B=e.useRef(null),oe=e.useRef(!1),O=e.useMemo(()=>{if(!(typeof D>"u"))return D?"expanded":"collapsed"},[D]),H=e.useMemo(()=>(0,K.mapResponsiveBooleanToPaneMode)(E),[E]);(0,te.useResponsiveInitialState)({controlledValue:O,defaultValue:H,currentValue:r.leftMode,setValue:r.setLeftMode,breakpointReady:r.currentBreakpointReady,onInit:g=>k?.(g==="expanded",{reason:"init"})}),e.useEffect(()=>{typeof D<"u"||(B.current!==null&&B.current!==r.leftMode&&k?.(r.leftMode==="expanded",{reason:"toggle"}),B.current=r.leftMode)},[r,k,D]),e.useEffect(()=>{r.leftMode==="expanded"?h?.():v?.()},[r.leftMode,h,v]);const W=r.leftMode==="expanded";if($){const g=r.leftMode==="expanded",R=e.Children.toArray(S),A=(y,b)=>e.isValidElement(y)&&y.type===b,s=R.find(y=>A(y,G)),_=R.find(y=>A(y,Q)),X=typeof s?.props?.expandedSize=="number"?s.props.expandedSize:64,ae=typeof _?.props?.expandedSize=="number"?_.props.expandedSize:288,Y=!!s,le=!!_,se=(Y?X:0)+(r.panelMode==="expanded"&&le?ae:0);return e.createElement(Te.Root,{open:g,onOpenChange:y=>r.setLeftMode(y?"expanded":"collapsed")},e.createElement(Te.Content,{side:"start",style:{padding:0},width:{initial:`${se}px`}},e.createElement(De.VisuallyHidden,null,e.createElement(Te.Title,null,"Navigation")),e.createElement("div",{className:"rt-ShellLeft"},S)))}if(z){const g=r.leftMode==="expanded",R=e.Children.toArray(S),A=(y,b)=>e.isValidElement(y)&&y.type===b,s=R.find(y=>A(y,G)),_=R.find(y=>A(y,Q)),X=typeof s?.props?.expandedSize=="number"?s.props.expandedSize:64,ae=typeof _?.props?.expandedSize=="number"?_.props.expandedSize:288,Y=!!s,se=!!_&&(r.panelMode==="expanded"||r.peekTarget==="panel");return e.createElement("div",{...u,ref:w,className:(0,q.default)("rt-ShellLeft",i),"data-mode":r.leftMode,"data-peek":r.peekTarget==="left"||r.peekTarget==="rail"||r.peekTarget==="panel"||void 0,"data-presentation":T,"data-inset":l||void 0,style:{...M},"data-open":g||void 0},S)}return e.createElement("div",{...u,ref:w,className:(0,q.default)("rt-ShellLeft",i),"data-mode":r.leftMode,"data-peek":r.peekTarget==="left"||r.peekTarget==="rail"||r.peekTarget==="panel"||void 0,"data-presentation":T,"data-inset":l||void 0,style:{...M}},S)});me.displayName="Shell.Left",ne(me,"Shell.Left");const G=e.forwardRef((t,a)=>{const{className:i,presentation:P,expandedSize:c=64,collapsible:h,onExpand:v,onCollapse:S,children:M,style:l,open:f,defaultOpen:N,onOpenChange:U,...D}=t,E=(0,p.useShell)(),k=e.useRef(null);e.useEffect(()=>{const r=typeof f<"u";if(k.current===null){k.current=r;return}k.current!==r&&(console.warn("Shell.Rail: Switching between controlled and uncontrolled `open` is not supported."),k.current=r)},[f]),e.useEffect(()=>{E.onRailDefaults?.(c)},[E,c]);const u=E.leftMode==="expanded";return e.createElement("div",{...D,ref:a,className:(0,q.default)("rt-ShellRail",i),"data-mode":E.leftMode,"data-peek":E.currentBreakpointReady&&E.leftResolvedPresentation!=="overlay"&&E.peekTarget==="rail"||void 0,style:{...l,"--rail-size":`${c}px`}},e.createElement("div",{className:"rt-ShellRailContent","data-visible":E.currentBreakpointReady&&(u||E.leftResolvedPresentation!=="overlay"&&E.peekTarget==="rail")||void 0},M))});G.displayName="Shell.Rail",ne(G,"Shell.Rail");const ln=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style"],Q=ne(e.forwardRef((t,a)=>{const{className:i,defaultOpen:P,open:c,onOpenChange:h,size:v,defaultSize:S,expandedSize:M=288,minSize:l,maxSize:f,resizable:N,collapsible:U=!0,onExpand:D,onCollapse:E,onResize:k,onResizeStart:u,onResizeEnd:r,snapPoints:T,snapTolerance:$,collapseThreshold:z,paneId:I,persistence:w,children:B,style:oe,onSizeChange:O,sizeUpdate:H,sizeUpdateMs:W=50}=t,g=(0,K.extractPaneDomProps)(t,ln),R=e.useRef(null);e.useEffect(()=>()=>{R.current&&(clearTimeout(R.current),R.current=null)},[O,H,W]);const A=e.useMemo(()=>{if(!O)return()=>{};if(H==="debounce")return(C,x)=>{R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{O?.(C,x),R.current=null},W)};if(H==="throttle"){let o=0;return(C,x)=>{const L=Date.now();L-o>=W&&(o=L,O?.(C,x))}}return(o,C)=>O?.(o,C)},[O,H,W]),s=(0,p.useShell)(),_=e.useRef(null),X=e.useRef(null),ae=e.useRef(!1),Y=e.useMemo(()=>(0,K.mapResponsiveBooleanToPaneMode)(c),[c]),le=e.useMemo(()=>(0,K.mapResponsiveBooleanToPaneMode)(P),[P]),se=typeof c=="object"&&c!==null;(0,te.useResponsiveInitialState)({controlledValue:Y,defaultValue:le,currentValue:s.panelMode,setValue:o=>{o==="expanded"&&s.leftMode!=="expanded"&&s.setLeftMode("expanded"),s.setPanelMode(o)},breakpointReady:s.currentBreakpointReady,controlledIsResponsive:se,onResponsiveChange:o=>h?.(o==="expanded",{reason:"responsive"}),onInit:o=>{typeof c>"u"&&h?.(o==="expanded",{reason:"init"})}});const y=e.useRef(null);e.useEffect(()=>{const o=typeof c<"u";if(y.current===null){y.current=o;return}y.current!==o&&(console.warn("Shell.Panel: Switching between controlled and uncontrolled `open` is not supported."),y.current=o)},[c]),e.useEffect(()=>{s.onPanelDefaults?.(M)},[s,M]);const b=e.useRef(null),re=e.useCallback(o=>{b.current=o,typeof a=="function"?a(o):a&&(a.current=o)},[a]),ue=e.Children.toArray(B),V=ue.filter(o=>e.isValidElement(o)&&o.type===ce.PanelHandle),F=ue.filter(o=>!(e.isValidElement(o)&&o.type===ce.PanelHandle)),de=s.leftResolvedPresentation==="overlay",J=e.useCallback(o=>(0,we.normalizeToPx)(o,"horizontal"),[]),Z=e.useMemo(()=>{if(!I||w)return w;const o=`kookie-ui:shell:panel:${I}`;return{load:()=>{if(typeof window>"u")return;const x=window.localStorage.getItem(o);return x?Number(x):void 0},save:x=>{typeof window>"u"||window.localStorage.setItem(o,String(x))}}},[I,w]);e.useEffect(()=>{let o=!0;return(async()=>{if(!N||!Z?.load||de)return;const C=await Z.load();o&&typeof C=="number"&&b.current&&(b.current.style.setProperty("--panel-size",`${C}px`),k?.(C))})(),()=>{o=!1}},[N,Z,k,de]),e.useEffect(()=>{b.current&&de&&b.current.style.setProperty("--panel-size",`${M}px`)},[de,M]),e.useEffect(()=>{if(b.current&&typeof v>"u"&&typeof S<"u"){const o=J(S);if(typeof o=="number"&&Number.isFinite(o)){const L=Math.min((typeof f=="number"?f:void 0)??o,Math.max((typeof l=="number"?l:void 0)??o,o));b.current.style.setProperty("--panel-size",`${L}px`),A(L,{reason:"init"})}}},[]),e.useEffect(()=>{if(!b.current||typeof v>"u")return;const o=J(v);if(typeof o=="number"&&Number.isFinite(o)){const L=Math.min((typeof f=="number"?f:void 0)??o,Math.max((typeof l=="number"?l:void 0)??o,o));b.current.style.setProperty("--panel-size",`${L}px`),A(L,{reason:"controlled"})}},[v,l,f,J,A]),e.useEffect(()=>{if(b.current&&s.leftResolvedPresentation!=="overlay"&&s.leftMode==="expanded"&&s.panelMode==="expanded"){const o=b.current.parentElement||null;try{o?.style.removeProperty("width")}catch{}}},[s.leftResolvedPresentation,s.leftMode,s.panelMode]);const fe=s.leftMode==="expanded"&&s.panelMode==="expanded";e.useEffect(()=>{const o=_.current,C=X.current;if(o!==null&&o!==s.panelMode){const x=s.panelMode==="expanded";let L="toggle";C!==s.leftMode&&s.leftMode==="collapsed"&&!x&&(L="left"),h?.(x,{reason:L})}_.current=s.panelMode,X.current=s.leftMode},[s.panelMode,s.leftMode,h]);const Ce=N&&s.leftResolvedPresentation!=="overlay"&&fe?e.createElement(Be.PaneResizeContext.Provider,{value:{containerRef:b,cssVarName:"--panel-size",minSize:typeof l=="number"?l:100,maxSize:typeof f=="number"?f:800,defaultSize:M,orientation:"vertical",edge:"end",computeNext:(o,C,x)=>{const L=getComputedStyle(b.current).direction==="rtl",j=o-C;return x+(L?-j:j)},onResize:k,onResizeStart:o=>{const x=b.current?.parentElement;try{x?.style.removeProperty("width")}catch{}u?.(o)},onResizeEnd:o=>{r?.(o),A(o,{reason:"resize"}),Z?.save?.(o)},target:"panel",collapsible:!!U,snapPoints:T,snapTolerance:$??8,collapseThreshold:z,requestCollapse:()=>s.setPanelMode("collapsed"),requestToggle:()=>s.togglePane("panel")}},V.length>0?V.map((o,C)=>e.cloneElement(o,{key:o.key??C})):e.createElement(ce.PaneHandle,null)):null;return e.createElement("div",{...g,ref:re,className:(0,q.default)("rt-ShellPanel",i),"data-mode":s.panelMode,"data-visible":s.currentBreakpointReady&&(fe||s.leftResolvedPresentation!=="overlay"&&s.peekTarget==="panel")||void 0,"data-peek":s.currentBreakpointReady&&s.leftResolvedPresentation!=="overlay"&&s.peekTarget==="panel"||void 0,style:{...oe,"--panel-size":`${M}px`}},e.createElement("div",{className:"rt-ShellPanelContent","data-visible":fe||void 0},F),Ce)}),"Shell.Panel");Q.displayName="Shell.Panel",Q.Handle=ce.PanelHandle;const Me=e.forwardRef(({className:t,inset:a,...i},P)=>{const{registerInset:c,unregisterInset:h}=(0,p.useInset)();return e.useEffect(()=>{if(a)return c("content"),()=>h("content")},[a,c,h]),e.createElement("main",{...i,ref:P,className:(0,q.default)("rt-ShellContent",t),"data-inset":a||void 0})});Me.displayName="Shell.Content",ne(Me,"Shell.Content");const Le=e.forwardRef(({target:t,action:a="toggle",peekOnHover:i,onClick:P,onMouseEnter:c,onMouseLeave:h,children:v,...S},M)=>{const l=(0,p.useShell)(),f=e.useCallback(E=>{switch(P?.(E),l.peekTarget===t&&l.clearPeek(),a){case"toggle":l.togglePane(t);break;case"expand":l.expandPane(t);break;case"collapse":l.collapsePane(t);break}},[l,t,a,P]),N=(()=>{switch(t){case"left":case"rail":return l.leftMode==="collapsed";case"panel":return l.leftMode==="collapsed"||l.panelMode==="collapsed";case"sidebar":return l.sidebarMode==="collapsed";case"inspector":return l.inspectorMode==="collapsed";case"bottom":return l.bottomMode==="collapsed"}})(),U=e.useCallback(E=>{c?.(E),!(!i||!N)&&l.peekPane(t)},[c,i,N,l,t]),D=e.useCallback(E=>{h?.(E),i&&l.peekTarget===t&&l.clearPeek()},[h,i,l,t]);return e.createElement("button",{...S,ref:M,onClick:f,onMouseEnter:U,onMouseLeave:D,"data-shell-trigger":t,"data-shell-action":a,"aria-expanded":!N},v)});Le.displayName="Shell.Trigger";
1
+ "use strict";"use client";var Ke=Object.create;var Se=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var Ye=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Ze=Object.prototype.hasOwnProperty;var en=(t,a)=>{for(var i in a)Se(t,i,{get:a[i],enumerable:!0})},_e=(t,a,i,y)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of Ye(a))!Ze.call(t,c)&&c!==i&&Se(t,c,{get:()=>a[c],enumerable:!(y=Xe(a,c))||y.enumerable});return t};var ge=(t,a,i)=>(i=t!=null?Ke(Je(t)):{},_e(a||!t||!t.__esModule?Se(i,"default",{value:t,enumerable:!0}):i,t)),nn=t=>_e(Se({},"__esModule",{value:!0}),t);var rn={};en(rn,{Bottom:()=>Pe.Bottom,Content:()=>Me,Header:()=>Ce,Inspector:()=>ye.Inspector,Left:()=>me,Panel:()=>q,Rail:()=>Q,Root:()=>Oe,Sidebar:()=>pe.Sidebar,Trigger:()=>Le,useResponsivePresentation:()=>te.useResponsivePresentation,useShell:()=>p.useShell});module.exports=nn(rn);var e=ge(require("react")),G=ge(require("classnames")),Te=ge(require("./sheet.js")),De=require("./visually-hidden.js"),te=require("./shell.hooks.js"),Be=require("./_internal/shell-resize.js"),ce=require("./_internal/shell-handles.js"),K=require("./_internal/shell-prop-helpers.js"),pe=require("./_internal/shell-sidebar.js"),Pe=require("./_internal/shell-bottom.js"),ye=require("./_internal/shell-inspector.js"),Ae=require("./shell.types.js"),we=require("../helpers/normalize-to-px.js"),p=require("./shell.context.js");function tn(){const[t,a]=e.useState("initial"),[i,y]=e.useState(!1);return e.useEffect(()=>{if(typeof window>"u")return;const h=Object.entries(Ae._BREAKPOINTS).map(([P,l])=>[P,window.matchMedia(l)]),C=P=>{const l=h.filter(([,g])=>g.matches).map(([g])=>g),m=l[l.length-1]??"initial";a(m),y(!0)};C();const S=[];return h.forEach(([,P])=>{const l=P;typeof l.addEventListener=="function"&&typeof l.removeEventListener=="function"?(l.addEventListener("change",C),S.push(()=>l.removeEventListener?.("change",C))):typeof l.addListener=="function"&&typeof l.removeListener=="function"&&(l.addListener(C),S.push(()=>l.removeListener?.(C)))}),()=>{S.forEach(P=>{try{P()}catch{}})}},[]),{bp:t,ready:i}}const Ee=Symbol("rtShellSlot");function ne(t,a){return t[Ee]=a,t}function dn(t,a){if(!e.isValidElement(t))return!1;const i=t.type;if(i===a)return!0;const y=a?.[Ee];return!!(i?.[Ee]&&y&&i[Ee]===y)}ne(pe.Sidebar,"Shell.Sidebar"),ne(ye.Inspector,"Shell.Inspector"),ne(Pe.Bottom,"Shell.Bottom");function on(t,a){switch(a.type){case"SET_LEFT_MODE":return a.mode==="collapsed"?{...t,leftMode:"collapsed",panelMode:"collapsed"}:{...t,leftMode:a.mode};case"SET_PANEL_MODE":return a.mode==="expanded"&&t.leftMode!=="expanded"?{...t,leftMode:"expanded",panelMode:"expanded"}:{...t,panelMode:a.mode};case"SET_SIDEBAR_MODE":return{...t,sidebarMode:a.mode};case"SET_INSPECTOR_MODE":return{...t,inspectorMode:a.mode};case"SET_BOTTOM_MODE":return{...t,bottomMode:a.mode};case"TOGGLE_PANE":{switch(a.target){case"left":case"rail":return{...t,leftMode:t.leftMode==="expanded"?"collapsed":"expanded",panelMode:t.leftMode==="expanded"?"collapsed":t.panelMode};case"panel":return t.leftMode==="collapsed"?{...t,leftMode:"expanded",panelMode:"expanded"}:{...t,panelMode:t.panelMode==="expanded"?"collapsed":"expanded"};case"sidebar":{const i=t.sidebarMode==="collapsed"?"expanded":t.sidebarMode==="expanded"?"collapsed":"expanded";return{...t,sidebarMode:i}}case"inspector":return{...t,inspectorMode:t.inspectorMode==="expanded"?"collapsed":"expanded"};case"bottom":return{...t,bottomMode:t.bottomMode==="expanded"?"collapsed":"expanded"};default:return t}return t}case"EXPAND_PANE":{switch(a.target){case"left":case"rail":return{...t,leftMode:"expanded"};case"panel":return{...t,leftMode:"expanded",panelMode:"expanded"};case"sidebar":return{...t,sidebarMode:"expanded"};case"inspector":return{...t,inspectorMode:"expanded"};case"bottom":return{...t,bottomMode:"expanded"};default:return t}return t}case"COLLAPSE_PANE":{switch(a.target){case"left":case"rail":return{...t,leftMode:"collapsed",panelMode:"collapsed"};case"panel":return{...t,panelMode:"collapsed"};case"sidebar":return{...t,sidebarMode:"collapsed"};case"inspector":return{...t,inspectorMode:"collapsed"};case"bottom":return{...t,bottomMode:"collapsed"};default:return t}return t}}return t}const Oe=e.forwardRef(({className:t,children:a,height:i="full",...y},c)=>{const{bp:h,ready:C}=tn(),S=e.Children.toArray(a),P=S.some(n=>e.isValidElement(n)&&n.type?.displayName==="Shell.Panel"&&!!n.props?.defaultOpen),l=S.find(n=>e.isValidElement(n)&&n.type?.displayName==="Shell.Rail"),m=l?l.props?.defaultOpen:void 0,g=l?m===void 0?!0:typeof m=="boolean"?m:typeof m=="object"?m.initial??Object.values(m)[0]??!0:!0:!1,U=S.some(n=>e.isValidElement(n)&&n.type?.displayName==="Shell.Inspector"&&!!n.props?.defaultOpen),D=S.some(n=>e.isValidElement(n)&&n.type?.displayName==="Shell.Inspector"&&typeof n.props?.open<"u"&&!!n.props?.open),E=()=>{const n=S.find(f=>e.isValidElement(f)&&f.type?.displayName==="Shell.Sidebar");if(!n)return"expanded";const d=n.props;if(typeof d?.state<"u"){if(typeof d.state=="string")return d.state;if(typeof d.state=="object")return d.state.initial??Object.values(d.state)[0]??"expanded"}if(typeof d?.defaultState<"u"){if(typeof d.defaultState=="string")return d.defaultState;if(typeof d.defaultState=="object")return d.defaultState.initial??Object.values(d.defaultState)[0]??"expanded"}return"expanded"},z=()=>{const n=S.find(f=>e.isValidElement(f)&&f.type?.displayName==="Shell.Bottom");if(!n)return"collapsed";const d=n.props;if(typeof d?.open<"u"){if(typeof d.open=="boolean")return d.open?"expanded":"collapsed";if(typeof d.open=="object")return d.open.initial??Object.values(d.open)[0]?"expanded":"collapsed"}return typeof d?.defaultOpen<"u"&&d.defaultOpen?"expanded":"collapsed"},[u,s]=e.useReducer(on,{leftMode:P||g?"expanded":"collapsed",panelMode:P?"expanded":"collapsed",sidebarMode:E(),inspectorMode:U||D?"expanded":"collapsed",bottomMode:z()}),O=e.useCallback(n=>s({type:"SET_LEFT_MODE",mode:n}),[]),F=e.useCallback(n=>s({type:"SET_PANEL_MODE",mode:n}),[]),N=e.useCallback(n=>s({type:"SET_SIDEBAR_MODE",mode:n}),[]),I=e.useCallback(n=>s({type:"SET_INSPECTOR_MODE",mode:n}),[]),w=e.useCallback(n=>s({type:"SET_BOTTOM_MODE",mode:n}),[]),[B,oe]=e.useState(!1),[L,V]=e.useState(!1),$=e.useRef(n=>n==="collapsed"?"thin":n==="thin"?"expanded":"collapsed"),T=e.useCallback(n=>{$.current=n},[]);e.useEffect(()=>{L&&B&&console.warn("Shell: Sidebar cannot coexist with Rail or Panel. Use either Rail+Panel OR Sidebar.")},[L,B]);const[R,A]=e.useState(void 0),r=e.useCallback(n=>A(n),[]),_=e.useRef(64),X=e.useRef(288),ae=e.useCallback(n=>{_.current=n},[]),Y=e.useCallback(n=>{X.current=n},[]),le=e.useMemo(()=>{const n=e.Children.toArray(a),d=(f,ee)=>e.isValidElement(f)&&(f.type===ee||f.type?.displayName===ee.displayName);return n.some(f=>d(f,Q)||d(f,q))},[a]),re=e.useMemo(()=>{const n=e.Children.toArray(a),d=(f,ee)=>e.isValidElement(f)&&(f.type===ee||f.type?.displayName===ee.displayName);return n.some(f=>d(f,pe.Sidebar))},[a]),M=e.useCallback(n=>{if(n==="sidebar"){const d=$.current(u.sidebarMode);N(d);return}s({type:"TOGGLE_PANE",target:n})},[u.sidebarMode,N]),b=e.useCallback(n=>{if(n==="sidebar")return N("expanded");s({type:"EXPAND_PANE",target:n})},[N]),se=e.useCallback(n=>{if(n==="sidebar")return N("collapsed");s({type:"COLLAPSE_PANE",target:n})},[N]),ue=e.useMemo(()=>({leftMode:u.leftMode,setLeftMode:O,panelMode:u.panelMode,setPanelMode:F,sidebarMode:u.sidebarMode,setSidebarMode:N,inspectorMode:u.inspectorMode,setInspectorMode:I,bottomMode:u.bottomMode,setBottomMode:w,hasLeft:B,setHasLeft:oe,hasSidebar:L,setHasSidebar:V,currentBreakpoint:h,currentBreakpointReady:C,leftResolvedPresentation:R,togglePane:M,expandPane:b,collapsePane:se,setSidebarToggleComputer:T,onLeftPres:r,onRailDefaults:ae,onPanelDefaults:Y}),[u.leftMode,O,u.panelMode,F,u.sidebarMode,N,u.inspectorMode,I,u.bottomMode,w,B,L,h,C,R,M,b,se,T,r,ae,Y]),H=e.Children.toArray(a),W=(n,d)=>e.isValidElement(n)&&(n.type===d||n.type?.displayName===d.displayName),de=H.filter(n=>W(n,Ce)),J=H.filter(n=>W(n,Q)),Z=H.filter(n=>W(n,q)),fe=H.filter(n=>W(n,pe.Sidebar)),ve=H.filter(n=>W(n,Me)),o=H.filter(n=>W(n,ye.Inspector)),v=H.filter(n=>W(n,Pe.Bottom)),x=J[0]?.props?.open;e.useEffect(()=>{if(typeof x>"u")return;O(!!x?"expanded":"collapsed")},[x,O]);const k=e.useMemo(()=>i==="full"?{height:"100vh"}:i==="auto"?{height:"auto"}:typeof i=="string"?{height:i}:typeof i=="number"?{height:`${i}px`}:{},[i]),[j,ie]=e.useState(null),be=e.useCallback(n=>ie(n),[]),he=e.useCallback(()=>ie(null),[]),Ie=e.useMemo(()=>({currentBreakpoint:h,currentBreakpointReady:C,leftResolvedPresentation:R}),[h,C,R]),Ve=e.useMemo(()=>({leftMode:u.leftMode,setLeftMode:O}),[u.leftMode,O]),He=e.useMemo(()=>({panelMode:u.panelMode,setPanelMode:F}),[u.panelMode,F]),je=e.useMemo(()=>({sidebarMode:u.sidebarMode,setSidebarMode:N}),[u.sidebarMode,N]),Ue=e.useMemo(()=>({inspectorMode:u.inspectorMode,setInspectorMode:I}),[u.inspectorMode,I]),We=e.useMemo(()=>({bottomMode:u.bottomMode,setBottomMode:w}),[u.bottomMode,w]),Fe=e.useMemo(()=>({hasLeft:B,setHasLeft:oe,hasSidebar:L,setHasSidebar:V}),[B,oe,L,V]),[xe,ke]=e.useState(new Set),ze=e.useCallback(n=>{ke(d=>{if(d.has(n))return d;const f=new Set(d);return f.add(n),f})},[]),Ne=e.useCallback(n=>{ke(d=>{if(!d.has(n))return d;const f=new Set(d);return f.delete(n),f})},[]),Re=xe.size>0,$e=e.useMemo(()=>({insetPanes:xe,registerInset:ze,unregisterInset:Ne,hasAnyInset:Re}),[xe,ze,Ne,Re]),Ge=e.useMemo(()=>({peekTarget:j,setPeekTarget:ie,peekPane:be,clearPeek:he}),[j,ie,be,he]),Qe=e.useMemo(()=>({togglePane:M,expandPane:b,collapsePane:se,setSidebarToggleComputer:T}),[M,b,se,T]),qe=e.useMemo(()=>({...ue,peekTarget:j,setPeekTarget:ie,peekPane:be,clearPeek:he}),[ue,j,ie,be,he]);return e.createElement("div",{...y,ref:c,className:(0,G.default)("rt-ShellRoot",t),style:{...k,...y.style}},e.createElement(p.ShellProvider,{value:qe},e.createElement(p.PresentationContext.Provider,{value:Ie},e.createElement(p.LeftModeContext.Provider,{value:Ve},e.createElement(p.PanelModeContext.Provider,{value:He},e.createElement(p.SidebarModeContext.Provider,{value:je},e.createElement(p.InspectorModeContext.Provider,{value:Ue},e.createElement(p.BottomModeContext.Provider,{value:We},e.createElement(p.CompositionContext.Provider,{value:Fe},e.createElement(p.PeekContext.Provider,{value:Ge},e.createElement(p.ActionsContext.Provider,{value:Qe},e.createElement(p.InsetContext.Provider,{value:$e},de,e.createElement("div",{className:"rt-ShellBody","data-peek-target":j??void 0,"data-has-inset":Re||void 0,style:j==="rail"||j==="panel"?{"--peek-rail-width":`${_.current}px`}:void 0},le&&!re?(()=>{const n=J[0],d=Z[0],f=!!n?.props?.inset||!!d?.props?.inset,ee=n?{onOpenChange:n.props?.onOpenChange,open:n.props?.open,defaultOpen:n.props?.defaultOpen,presentation:n.props?.presentation,collapsible:n.props?.collapsible,onExpand:n.props?.onExpand,onCollapse:n.props?.onCollapse,inset:f}:{defaultOpen:P?!0:void 0,inset:f};return e.createElement(me,{...ee},J,Z)})():fe,ve,o),v))))))))))))});Oe.displayName="Shell.Root";const Ce=e.forwardRef(({className:t,height:a=64,style:i,...y},c)=>e.createElement("header",{...y,ref:c,className:(0,G.default)("rt-ShellHeader",t),style:{...i,"--shell-header-height":`${a}px`}}));Ce.displayName="Shell.Header";const an=["open","defaultOpen","onOpenChange","mode","defaultMode","onModeChange"],me=e.forwardRef((t,a)=>{const{className:i,presentation:y={initial:"fixed",sm:"fixed"},collapsible:c=!0,onExpand:h,onCollapse:C,children:S,style:P,inset:l,...m}=t,{registerInset:g,unregisterInset:U}=(0,p.useInset)();e.useEffect(()=>{if(l)return g("left"),()=>U("left")},[l,g,U]);const D=m.open,E=m.defaultOpen,z=m.onOpenChange,u=(0,K.omitPaneProps)(m,an),s=(0,p.useShell)(),O=(0,te.useResponsivePresentation)(y),F=O==="overlay",N=O==="stacked",I=e.useRef(null);e.useEffect(()=>{s.onLeftPres?.(O)},[s,O]);const w=e.useCallback(T=>{I.current=T,typeof a=="function"?a(T):a&&(a.current=T)},[a]);e.useEffect(()=>(s.setHasLeft(!0),()=>s.setHasLeft(!1)),[s]);const B=e.useRef(null),oe=e.useRef(!1),L=e.useMemo(()=>{if(!(typeof D>"u"))return D?"expanded":"collapsed"},[D]),V=e.useMemo(()=>(0,K.mapResponsiveBooleanToPaneMode)(E),[E]);(0,te.useResponsiveInitialState)({controlledValue:L,defaultValue:V,currentValue:s.leftMode,setValue:s.setLeftMode,breakpointReady:s.currentBreakpointReady,onInit:T=>z?.(T==="expanded",{reason:"init"})}),e.useEffect(()=>{typeof D<"u"||(B.current!==null&&B.current!==s.leftMode&&z?.(s.leftMode==="expanded",{reason:"toggle"}),B.current=s.leftMode)},[s,z,D]),e.useEffect(()=>{s.leftMode==="expanded"?h?.():C?.()},[s.leftMode,h,C]);const $=s.leftMode==="expanded";if(F){const T=s.leftMode==="expanded",R=e.Children.toArray(S),A=(M,b)=>e.isValidElement(M)&&M.type===b,r=R.find(M=>A(M,Q)),_=R.find(M=>A(M,q)),X=typeof r?.props?.expandedSize=="number"?r.props.expandedSize:64,ae=typeof _?.props?.expandedSize=="number"?_.props.expandedSize:288,Y=!!r,le=!!_,re=(Y?X:0)+(s.panelMode==="expanded"&&le?ae:0);return e.createElement(Te.Root,{open:T,onOpenChange:M=>s.setLeftMode(M?"expanded":"collapsed")},e.createElement(Te.Content,{side:"start",style:{padding:0},width:{initial:`${re}px`}},e.createElement(De.VisuallyHidden,null,e.createElement(Te.Title,null,"Navigation")),e.createElement("div",{className:"rt-ShellLeft"},S)))}if(N){const T=s.leftMode==="expanded",R=e.Children.toArray(S),A=(M,b)=>e.isValidElement(M)&&M.type===b,r=R.find(M=>A(M,Q)),_=R.find(M=>A(M,q)),X=typeof r?.props?.expandedSize=="number"?r.props.expandedSize:64,ae=typeof _?.props?.expandedSize=="number"?_.props.expandedSize:288,Y=!!r,re=!!_&&(s.panelMode==="expanded"||s.peekTarget==="panel");return e.createElement("div",{...u,ref:w,className:(0,G.default)("rt-ShellLeft",i),"data-mode":s.leftMode,"data-peek":s.peekTarget==="left"||s.peekTarget==="rail"||s.peekTarget==="panel"||void 0,"data-presentation":O,"data-inset":l||void 0,style:{...P},"data-open":T||void 0},S)}return e.createElement("div",{...u,ref:w,className:(0,G.default)("rt-ShellLeft",i),"data-mode":s.leftMode,"data-peek":s.peekTarget==="left"||s.peekTarget==="rail"||s.peekTarget==="panel"||void 0,"data-presentation":O,"data-inset":l||void 0,style:{...P}},S)});me.displayName="Shell.Left",ne(me,"Shell.Left");const Q=e.forwardRef((t,a)=>{const{className:i,presentation:y,expandedSize:c=64,collapsible:h,onExpand:C,onCollapse:S,children:P,style:l,open:m,defaultOpen:g,onOpenChange:U,...D}=t,E=(0,p.useShell)(),z=e.useRef(null);e.useEffect(()=>{const s=typeof m<"u";if(z.current===null){z.current=s;return}z.current!==s&&(console.warn("Shell.Rail: Switching between controlled and uncontrolled `open` is not supported."),z.current=s)},[m]),e.useEffect(()=>{E.onRailDefaults?.(c)},[E,c]);const u=E.leftMode==="expanded";return e.createElement("div",{...D,ref:a,className:(0,G.default)("rt-ShellRail",i),"data-mode":E.leftMode,"data-peek":E.currentBreakpointReady&&E.leftResolvedPresentation!=="overlay"&&E.peekTarget==="rail"||void 0,style:{...l,"--rail-size":`${c}px`}},e.createElement("div",{className:"rt-ShellRailContent","data-visible":E.currentBreakpointReady&&(u||E.leftResolvedPresentation!=="overlay"&&E.peekTarget==="rail")||void 0},P))});Q.displayName="Shell.Rail",ne(Q,"Shell.Rail");const ln=["className","children","defaultOpen","open","onOpenChange","size","defaultSize","onSizeChange","sizeUpdate","sizeUpdateMs","style"],q=ne(e.forwardRef((t,a)=>{const{className:i,defaultOpen:y,open:c,onOpenChange:h,size:C,defaultSize:S,expandedSize:P=288,minSize:l,maxSize:m,resizable:g,collapsible:U=!0,onExpand:D,onCollapse:E,onResize:z,onResizeStart:u,onResizeEnd:s,snapPoints:O,snapTolerance:F,collapseThreshold:N,paneId:I,persistence:w,children:B,style:oe,onSizeChange:L,sizeUpdate:V,sizeUpdateMs:$=50}=t,T=(0,K.extractPaneDomProps)(t,ln),R=e.useRef(null);e.useEffect(()=>()=>{R.current&&(clearTimeout(R.current),R.current=null)},[L,V,$]);const A=e.useMemo(()=>{if(!L)return()=>{};if(V==="debounce")return(v,x)=>{R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{L?.(v,x),R.current=null},$)};if(V==="throttle"){let o=0;return(v,x)=>{const k=Date.now();k-o>=$&&(o=k,L?.(v,x))}}return(o,v)=>L?.(o,v)},[L,V,$]),r=(0,p.useShell)(),_=e.useRef(null),X=e.useRef(null),ae=e.useRef(!1),Y=e.useMemo(()=>(0,K.mapResponsiveBooleanToPaneMode)(c),[c]),le=e.useMemo(()=>(0,K.mapResponsiveBooleanToPaneMode)(y),[y]),re=typeof c=="object"&&c!==null;(0,te.useResponsiveInitialState)({controlledValue:Y,defaultValue:le,currentValue:r.panelMode,setValue:o=>{o==="expanded"&&r.leftMode!=="expanded"&&r.setLeftMode("expanded"),r.setPanelMode(o)},breakpointReady:r.currentBreakpointReady,controlledIsResponsive:re,onResponsiveChange:o=>h?.(o==="expanded",{reason:"responsive"}),onInit:o=>{typeof c>"u"&&h?.(o==="expanded",{reason:"init"})}});const M=e.useRef(null);e.useEffect(()=>{const o=typeof c<"u";if(M.current===null){M.current=o;return}M.current!==o&&(console.warn("Shell.Panel: Switching between controlled and uncontrolled `open` is not supported."),M.current=o)},[c]),e.useEffect(()=>{r.onPanelDefaults?.(P)},[r,P]);const b=e.useRef(null),se=e.useCallback(o=>{b.current=o,typeof a=="function"?a(o):a&&(a.current=o)},[a]),ue=e.Children.toArray(B),H=ue.filter(o=>e.isValidElement(o)&&o.type===ce.PanelHandle),W=ue.filter(o=>!(e.isValidElement(o)&&o.type===ce.PanelHandle)),de=r.leftResolvedPresentation==="overlay",J=e.useCallback(o=>(0,we.normalizeToPx)(o,"horizontal"),[]),Z=e.useMemo(()=>{if(!I||w)return w;const o=`kookie-ui:shell:panel:${I}`;return{load:()=>{if(typeof window>"u")return;const x=window.localStorage.getItem(o);return x?Number(x):void 0},save:x=>{typeof window>"u"||window.localStorage.setItem(o,String(x))}}},[I,w]);e.useEffect(()=>{let o=!0;return(async()=>{if(!g||!Z?.load||de)return;const v=await Z.load();o&&typeof v=="number"&&b.current&&(b.current.style.setProperty("--panel-size",`${v}px`),z?.(v))})(),()=>{o=!1}},[g,Z,z,de]),e.useEffect(()=>{b.current&&de&&b.current.style.setProperty("--panel-size",`${P}px`)},[de,P]),e.useEffect(()=>{if(b.current&&typeof C>"u"&&typeof S<"u"){const o=J(S);if(typeof o=="number"&&Number.isFinite(o)){const k=Math.min((typeof m=="number"?m:void 0)??o,Math.max((typeof l=="number"?l:void 0)??o,o));b.current.style.setProperty("--panel-size",`${k}px`),A(k,{reason:"init"})}}},[]),e.useEffect(()=>{if(!b.current||typeof C>"u")return;const o=J(C);if(typeof o=="number"&&Number.isFinite(o)){const k=Math.min((typeof m=="number"?m:void 0)??o,Math.max((typeof l=="number"?l:void 0)??o,o));b.current.style.setProperty("--panel-size",`${k}px`),A(k,{reason:"controlled"})}},[C,l,m,J,A]),e.useEffect(()=>{if(b.current&&r.leftResolvedPresentation!=="overlay"&&r.leftMode==="expanded"&&r.panelMode==="expanded"){const o=b.current.parentElement||null;try{o?.style.removeProperty("width")}catch{}}},[r.leftResolvedPresentation,r.leftMode,r.panelMode]);const fe=r.leftMode==="expanded"&&r.panelMode==="expanded";e.useEffect(()=>{const o=_.current,v=X.current;if(o!==null&&o!==r.panelMode){const x=r.panelMode==="expanded";let k="toggle";v!==r.leftMode&&r.leftMode==="collapsed"&&!x&&(k="left"),h?.(x,{reason:k})}_.current=r.panelMode,X.current=r.leftMode},[r.panelMode,r.leftMode,h]);const ve=g&&r.leftResolvedPresentation!=="overlay"&&fe?e.createElement(Be.PaneResizeContext.Provider,{value:{containerRef:b,cssVarName:"--panel-size",minSize:typeof l=="number"?l:100,maxSize:typeof m=="number"?m:800,defaultSize:P,orientation:"vertical",edge:"end",computeNext:(o,v,x)=>{const k=getComputedStyle(b.current).direction==="rtl",j=o-v;return x+(k?-j:j)},onResize:z,onResizeStart:o=>{const x=b.current?.parentElement;try{x?.style.removeProperty("width")}catch{}u?.(o)},onResizeEnd:o=>{s?.(o),A(o,{reason:"resize"}),Z?.save?.(o)},target:"panel",collapsible:!!U,snapPoints:O,snapTolerance:F??8,collapseThreshold:N,requestCollapse:()=>r.setPanelMode("collapsed"),requestToggle:()=>r.togglePane("panel")}},H.length>0?H.map((o,v)=>e.cloneElement(o,{key:o.key??v})):e.createElement(ce.PaneHandle,null)):null;return e.createElement("div",{...T,ref:se,className:(0,G.default)("rt-ShellPanel",i),"data-mode":r.panelMode,"data-visible":r.currentBreakpointReady&&(fe||r.leftResolvedPresentation!=="overlay"&&r.peekTarget==="panel")||void 0,"data-peek":r.currentBreakpointReady&&r.leftResolvedPresentation!=="overlay"&&r.peekTarget==="panel"||void 0,style:{...oe,"--panel-size":`${P}px`}},e.createElement("div",{className:"rt-ShellPanelContent","data-visible":fe||void 0},W),ve)}),"Shell.Panel");q.displayName="Shell.Panel",q.Handle=ce.PanelHandle;const Me=e.forwardRef(({className:t,inset:a,...i},y)=>{const{registerInset:c,unregisterInset:h}=(0,p.useInset)();return e.useEffect(()=>{if(a)return c("content"),()=>h("content")},[a,c,h]),e.createElement("main",{...i,ref:y,className:(0,G.default)("rt-ShellContent",t),"data-inset":a||void 0})});Me.displayName="Shell.Content",ne(Me,"Shell.Content");const Le=e.forwardRef(({target:t,action:a="toggle",peekOnHover:i,onClick:y,onMouseEnter:c,onMouseLeave:h,children:C,...S},P)=>{const l=(0,p.useShell)(),m=e.useCallback(E=>{switch(y?.(E),l.peekTarget===t&&l.clearPeek(),a){case"toggle":l.togglePane(t);break;case"expand":l.expandPane(t);break;case"collapse":l.collapsePane(t);break}},[l,t,a,y]),g=(()=>{switch(t){case"left":case"rail":return l.leftMode==="collapsed";case"panel":return l.leftMode==="collapsed"||l.panelMode==="collapsed";case"sidebar":return l.sidebarMode==="collapsed";case"inspector":return l.inspectorMode==="collapsed";case"bottom":return l.bottomMode==="collapsed"}})(),U=e.useCallback(E=>{c?.(E),!(!i||!g)&&l.peekPane(t)},[c,i,g,l,t]),D=e.useCallback(E=>{h?.(E),i&&l.peekTarget===t&&l.clearPeek()},[h,i,l,t]);return e.createElement("button",{...S,ref:P,onClick:m,onMouseEnter:U,onMouseLeave:D,"data-shell-trigger":t,"data-shell-action":a,"aria-expanded":!g},C)});Le.displayName="Shell.Trigger";
2
2
  //# sourceMappingURL=shell.js.map