@kushagradhawan/kookie-ui 0.1.123 → 0.1.125

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 (66) 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/combobox.d.ts.map +1 -1
  14. package/dist/cjs/components/combobox.js +1 -1
  15. package/dist/cjs/components/combobox.js.map +3 -3
  16. package/dist/cjs/components/shell.context.d.ts +2 -0
  17. package/dist/cjs/components/shell.context.d.ts.map +1 -1
  18. package/dist/cjs/components/shell.context.js +1 -1
  19. package/dist/cjs/components/shell.context.js.map +2 -2
  20. package/dist/cjs/components/shell.d.ts.map +1 -1
  21. package/dist/cjs/components/shell.js +1 -1
  22. package/dist/cjs/components/shell.js.map +3 -3
  23. package/dist/cjs/components/shell.types.d.ts +11 -0
  24. package/dist/cjs/components/shell.types.d.ts.map +1 -1
  25. package/dist/cjs/components/shell.types.js +1 -1
  26. package/dist/cjs/components/shell.types.js.map +1 -1
  27. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  28. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  29. package/dist/esm/components/_internal/shell-bottom.js.map +2 -2
  30. package/dist/esm/components/_internal/shell-handles.js +1 -1
  31. package/dist/esm/components/_internal/shell-handles.js.map +2 -2
  32. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  33. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  34. package/dist/esm/components/_internal/shell-inspector.js.map +2 -2
  35. package/dist/esm/components/_internal/shell-prop-helpers.js.map +2 -2
  36. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  37. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  38. package/dist/esm/components/_internal/shell-sidebar.js.map +2 -2
  39. package/dist/esm/components/combobox.d.ts.map +1 -1
  40. package/dist/esm/components/combobox.js +1 -1
  41. package/dist/esm/components/combobox.js.map +3 -3
  42. package/dist/esm/components/shell.context.d.ts +2 -0
  43. package/dist/esm/components/shell.context.d.ts.map +1 -1
  44. package/dist/esm/components/shell.context.js.map +2 -2
  45. package/dist/esm/components/shell.d.ts.map +1 -1
  46. package/dist/esm/components/shell.js +1 -1
  47. package/dist/esm/components/shell.js.map +3 -3
  48. package/dist/esm/components/shell.types.d.ts +11 -0
  49. package/dist/esm/components/shell.types.d.ts.map +1 -1
  50. package/dist/esm/components/shell.types.js.map +1 -1
  51. package/package.json +1 -1
  52. package/schemas/base-button.json +1 -1
  53. package/schemas/button.json +1 -1
  54. package/schemas/icon-button.json +1 -1
  55. package/schemas/index.json +6 -6
  56. package/schemas/toggle-button.json +1 -1
  57. package/schemas/toggle-icon-button.json +1 -1
  58. package/src/components/_internal/shell-bottom.tsx +5 -5
  59. package/src/components/_internal/shell-handles.tsx +26 -26
  60. package/src/components/_internal/shell-inspector.tsx +5 -5
  61. package/src/components/_internal/shell-prop-helpers.ts +1 -1
  62. package/src/components/_internal/shell-sidebar.tsx +10 -10
  63. package/src/components/combobox.tsx +176 -80
  64. package/src/components/shell.context.tsx +12 -10
  65. package/src/components/shell.tsx +21 -20
  66. package/src/components/shell.types.ts +13 -0
@@ -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,EAAA,qBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,EAAA,YAAAC,EAAA,oBAAAC,EAAA,aAAAC,EAAA,oBAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAxB,GAAA,IAAAyB,EAAuB,oBA6CvB,MAAMC,EAAeD,EAAM,cAAwC,IAAI,EAGhE,SAASJ,GAAW,CACzB,MAAMM,EAAMF,EAAM,WAAWC,CAAY,EACzC,GAAI,CAACC,EAAK,MAAM,IAAI,MAAM,mDAAmD,EAC7E,OAAOA,CACT,CAEO,SAAShB,EAAc,CAAE,MAAAiB,EAAO,SAAAC,CAAS,EAA4D,CAC1G,OAAOJ,EAAA,cAACC,EAAa,SAAb,CAAsB,MAAOE,GAAQC,CAAS,CACxD,CAOO,MAAMtB,EAAkBkB,EAAM,cAAgF,IAAW,EACzH,SAASR,GAAc,CAC5B,MAAMU,EAAMF,EAAM,WAAWlB,CAAe,EAC5C,GAAI,CAACoB,EAAK,MAAM,IAAI,MAAM,4CAA4C,EACtE,OAAOA,CACT,CAEO,MAAMnB,EAAmBiB,EAAM,cAAkF,IAAW,EAC5H,SAASP,GAAe,CAC7B,MAAMS,EAAMF,EAAM,WAAWjB,CAAgB,EAC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AACuB,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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M,cAAoF,IAAI,EACxH,SAASZ,GAAgB,CAC9B,MAAMc,EAAMF,EAAM,WAAWtB,CAAiB,EAC9C,GAAI,CAACwB,EAAK,MAAM,IAAI,MAAM,8CAA8C,EACxE,OAAOA,CACT,CAGO,MAAMjB,EAAsBe,EAAM,cAAuI,IAAI,EAC7K,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,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,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjL,OAAO,EAEL,QAAQ,EAaT,MAAM,oBAAoB,CAAC;AA2M5B,QAAA,MAAM,IAAI,EAuWJ,cAAc,CAAC;AAIrB,UAAU,gBAAiB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,MAAM,sFAUV,CAAC;AAIH,KAAK,SAAS,GAAG,aAAa,CAAC;AAG/B,UAAU,SAAU,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAC/D,YAAY,CAAC,EAAE,sBAAsB,CAAC;IAEtC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAA;KAAE,KAAK,IAAI,CAAC;IACrG,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UA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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