@womp/kookie-ui 0.32.0 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/components.css +86 -35
  2. package/dist/cjs/components/_internal/pane-chrome.js +1 -1
  3. package/dist/cjs/components/_internal/pane-chrome.js.map +2 -2
  4. package/dist/cjs/components/_internal/shell-bottom.d.ts +7 -2
  5. package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
  6. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  7. package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
  8. package/dist/cjs/components/_internal/shell-inspector.d.ts +7 -2
  9. package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
  10. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  11. package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
  12. package/dist/cjs/components/_internal/shell-pane.js +1 -1
  13. package/dist/cjs/components/_internal/shell-pane.js.map +2 -2
  14. package/dist/cjs/components/_internal/shell-sidebar.d.ts +7 -2
  15. package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
  16. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  17. package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
  18. package/dist/cjs/components/_internal/shell-store.d.ts +6 -6
  19. package/dist/cjs/components/_internal/shell-store.d.ts.map +1 -1
  20. package/dist/cjs/components/_internal/shell-store.js +1 -1
  21. package/dist/cjs/components/_internal/shell-store.js.map +3 -3
  22. package/dist/cjs/components/index.js +1 -1
  23. package/dist/cjs/components/index.js.map +3 -3
  24. package/dist/cjs/components/navigator.js +1 -1
  25. package/dist/cjs/components/navigator.js.map +2 -2
  26. package/dist/cjs/components/shell.context.js +1 -1
  27. package/dist/cjs/components/shell.context.js.map +2 -2
  28. package/dist/cjs/components/shell.d.ts +25 -7
  29. package/dist/cjs/components/shell.d.ts.map +1 -1
  30. package/dist/cjs/components/shell.hooks.js +1 -1
  31. package/dist/cjs/components/shell.hooks.js.map +2 -2
  32. package/dist/cjs/components/shell.js +1 -1
  33. package/dist/cjs/components/shell.js.map +3 -3
  34. package/dist/cjs/components/toolbar.js +1 -1
  35. package/dist/cjs/components/toolbar.js.map +2 -2
  36. package/dist/cjs/index.js +1 -1
  37. package/dist/cjs/index.js.map +3 -3
  38. package/dist/esm/chunk-5BXCPANF.js +3 -0
  39. package/dist/esm/{chunk-GHWEXMF6.js.map → chunk-5BXCPANF.js.map} +3 -3
  40. package/dist/esm/{chunk-ZG2XQUOH.js → chunk-B447PNRD.js} +2 -2
  41. package/dist/esm/{chunk-QDAM2I6O.js → chunk-BR6Z2CAE.js} +2 -2
  42. package/dist/esm/{chunk-4G3FJUER.js → chunk-INGT6DB6.js} +2 -2
  43. package/dist/esm/{chunk-4ZHBNYXM.js → chunk-J6B7UCZN.js} +2 -2
  44. package/dist/esm/chunk-KDJM4NQQ.js +3 -0
  45. package/dist/esm/chunk-KDJM4NQQ.js.map +7 -0
  46. package/dist/esm/{chunk-LTUW36HM.js → chunk-KGCGT4MJ.js} +2 -2
  47. package/dist/esm/chunk-NO2JCJWI.js +3 -0
  48. package/dist/esm/chunk-NO2JCJWI.js.map +7 -0
  49. package/dist/esm/{chunk-NFSW36RG.js → chunk-ODHCDJ3Y.js} +2 -2
  50. package/dist/esm/chunk-UMQOTGJC.js +3 -0
  51. package/dist/esm/chunk-UMQOTGJC.js.map +7 -0
  52. package/dist/esm/chunk-XD676L6S.js +3 -0
  53. package/dist/esm/chunk-XD676L6S.js.map +7 -0
  54. package/dist/esm/{chunk-6SGJWML7.js → chunk-XKYPJTRN.js} +2 -2
  55. package/dist/esm/components/_internal/pane-chrome.js +1 -1
  56. package/dist/esm/components/_internal/shell-bottom.d.ts +7 -2
  57. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  58. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  59. package/dist/esm/components/_internal/shell-inspector.d.ts +7 -2
  60. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  61. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  62. package/dist/esm/components/_internal/shell-pane.js +1 -1
  63. package/dist/esm/components/_internal/shell-sidebar.d.ts +7 -2
  64. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  65. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  66. package/dist/esm/components/_internal/shell-store.d.ts +6 -6
  67. package/dist/esm/components/_internal/shell-store.d.ts.map +1 -1
  68. package/dist/esm/components/_internal/shell-store.js +1 -1
  69. package/dist/esm/components/index.js +1 -1
  70. package/dist/esm/components/navigator.js +1 -1
  71. package/dist/esm/components/shell.context.js +1 -1
  72. package/dist/esm/components/shell.d.ts +25 -7
  73. package/dist/esm/components/shell.d.ts.map +1 -1
  74. package/dist/esm/components/shell.hooks.js +1 -1
  75. package/dist/esm/components/shell.js +1 -1
  76. package/dist/esm/components/sidebar.js +1 -1
  77. package/dist/esm/components/toolbar.js +1 -1
  78. package/dist/esm/index.js +1 -1
  79. package/package.json +1 -1
  80. package/src/components/_internal/shell-bottom.tsx +11 -6
  81. package/src/components/_internal/shell-inspector.tsx +11 -6
  82. package/src/components/_internal/shell-sidebar.tsx +11 -6
  83. package/src/components/_internal/shell-store.tsx +13 -13
  84. package/src/components/shell.css +133 -47
  85. package/src/components/shell.tsx +50 -32
  86. package/src/styles/tokens/color.css +2 -0
  87. package/styles.css +87 -35
  88. package/tokens/base.css +1 -0
  89. package/tokens.css +1 -0
  90. package/dist/esm/chunk-4B3S2DM7.js +0 -3
  91. package/dist/esm/chunk-4B3S2DM7.js.map +0 -7
  92. package/dist/esm/chunk-AKMRPGNP.js +0 -3
  93. package/dist/esm/chunk-AKMRPGNP.js.map +0 -7
  94. package/dist/esm/chunk-GHWEXMF6.js +0 -3
  95. package/dist/esm/chunk-ZBSGH74F.js +0 -3
  96. package/dist/esm/chunk-ZBSGH74F.js.map +0 -7
  97. package/dist/esm/chunk-ZHXEEOGI.js +0 -3
  98. package/dist/esm/chunk-ZHXEEOGI.js.map +0 -7
  99. /package/dist/esm/{chunk-ZG2XQUOH.js.map → chunk-B447PNRD.js.map} +0 -0
  100. /package/dist/esm/{chunk-QDAM2I6O.js.map → chunk-BR6Z2CAE.js.map} +0 -0
  101. /package/dist/esm/{chunk-4G3FJUER.js.map → chunk-INGT6DB6.js.map} +0 -0
  102. /package/dist/esm/{chunk-4ZHBNYXM.js.map → chunk-J6B7UCZN.js.map} +0 -0
  103. /package/dist/esm/{chunk-LTUW36HM.js.map → chunk-KGCGT4MJ.js.map} +0 -0
  104. /package/dist/esm/{chunk-NFSW36RG.js.map → chunk-ODHCDJ3Y.js.map} +0 -0
  105. /package/dist/esm/{chunk-6SGJWML7.js.map → chunk-XKYPJTRN.js.map} +0 -0
@@ -86,13 +86,13 @@ export declare function usePaneEntry(store: ShellStore, name: PaneName): PaneEnt
86
86
  * the peek target itself, so hovering one Trigger re-renders one pane, not all.
87
87
  */
88
88
  export declare function usePeeking(store: ShellStore, name: PaneName): boolean;
89
- export type InsetPaneId = 'rail' | 'panel' | 'sidebar' | 'content' | 'inspector' | 'bottom';
90
- export declare const ShellInsetContext: React.Context<{
91
- registerInset: (id: InsetPaneId) => void;
92
- unregisterInset: (id: InsetPaneId) => void;
89
+ export type FramePaneId = 'rail' | 'panel' | 'sidebar' | 'content' | 'inspector' | 'bottom';
90
+ export declare const ShellFrameContext: React.Context<{
91
+ registerOffFrame: (id: FramePaneId) => void;
92
+ unregisterOffFrame: (id: FramePaneId) => void;
93
93
  } | null>;
94
- /** Registers a pane's `inset` with the Root, which paints the backdrop while any pane is inset. */
95
- export declare function useInsetRegistration(id: InsetPaneId, inset: boolean | undefined): void;
94
+ /** Tells the Root a pane is off the frame (`flush={false}`); the Rail's card moves a floating Panel over. */
95
+ export declare function useFrameRegistration(id: FramePaneId, flush: boolean): void;
96
96
  /** A deprecation warning, once per message per page load. Development only. */
97
97
  export declare function warnOnce(message: string): void;
98
98
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O,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,UAAU,CAE7C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,QAGjD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,IAAI,cAK1E;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,QAIpE;AAED,eAAO,MAAM,iBAAiB,kCAA+C,CAAC;AAE9E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAItD;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAIrF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAOrE;AAID,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE5F,eAAO,MAAM,iBAAiB;sBACV,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI;wBACvB,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI;SAChC,CAAC;AAEhB,6GAA6G;AAC7G,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,QASnE;AAMD,+EAA+E;AAC/E,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,QAKvC"}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- "use strict";"use client";var y=Object.create;var s=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var v=(e,n)=>{for(var t in n)s(e,t,{get:n[t],enumerable:!0})},d=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of g(n))!T.call(e,o)&&o!==t&&s(e,o,{get:()=>n[o],enumerable:!(r=R(n,o))||r.enumerable});return e};var E=(e,n,t)=>(t=e!=null?y(h(e)):{},d(n||!e||!e.__esModule?s(t,"default",{value:e,enumerable:!0}):t,e)),I=e=>d(s({},"__esModule",{value:!0}),e);var A={};v(A,{FIXED_TABLE:()=>w,ShellInsetContext:()=>b,ShellStoreContext:()=>P,constantOf:()=>S,createShellStore:()=>N,notifyShellStore:()=>m,setShellPeek:()=>z,subscribeShellStore:()=>l,tableAttributes:()=>k,tableOf:()=>f,useInsetRegistration:()=>M,usePaneEntry:()=>B,usePeeking:()=>O,useShellStore:()=>V,useStableKey:()=>C,warnOnce:()=>L});module.exports=I(A);var i=E(require("react")),x=require("radix-ui/internal");var a=["initial","xs","sm","md","lg","xl"];function u(e){return typeof e=="object"&&e!==null}function f(e,n){let t={},r=null;for(let o of a){if(e!==void 0&&!u(e)){t[o]=e;continue}let p=u(e)?e[o]:void 0;p!==void 0&&(r={value:p}),t[o]=r?r.value:n(o)}return t}function S(e){let n=e.initial;return a.every(t=>e[t]===n)?n:void 0}function k(e,n){let t=S(n);if(t!==void 0)return{[`data-${e}`]:t};let r={};for(let o of a)r[`data-${e}-${o}`]=n[o];return r}function C(e){return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}var w=f("fixed",()=>"fixed");function N(){return{entries:new Map,listeners:new Set,version:0,peek:null}}function m(e){e.version+=1;for(let n of e.listeners)n()}function l(e,n){return e.listeners.add(n),()=>{e.listeners.delete(n)}}function z(e,n){e.peek!==n&&(e.peek=n,m(e))}var P=i.createContext(null);function V(e){let n=i.useContext(P);if(!n)throw new Error(`${e} must be used within <Shell.Root>`);return n}function B(e,n){let t=i.useCallback(o=>l(e,o),[e]),r=i.useCallback(()=>e.entries.get(n),[e,n]);return i.useSyncExternalStore(t,r,()=>{})}function O(e,n){let t=i.useCallback(r=>l(e,r),[e]);return i.useSyncExternalStore(t,()=>e.peek===n,()=>!1)}var b=i.createContext(null);function M(e,n){let t=i.useContext(b);if(!t)throw new Error("Shell panes must be used within <Shell.Root>");let{registerInset:r,unregisterInset:o}=t;(0,x.useLayoutEffect)(()=>{if(n)return r(e),()=>o(e)},[e,n,r,o])}var c=new Set;function L(e){}
2
+ "use strict";"use client";var y=Object.create;var a=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var v=(e,n)=>{for(var t in n)a(e,t,{get:n[t],enumerable:!0})},d=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of g(n))!T.call(e,r)&&r!==t&&a(e,r,{get:()=>n[r],enumerable:!(o=R(n,r))||o.enumerable});return e};var E=(e,n,t)=>(t=e!=null?y(h(e)):{},d(n||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e)),k=e=>d(a({},"__esModule",{value:!0}),e);var L={};v(L,{FIXED_TABLE:()=>O,ShellFrameContext:()=>b,ShellStoreContext:()=>P,constantOf:()=>m,createShellStore:()=>N,notifyShellStore:()=>S,setShellPeek:()=>z,subscribeShellStore:()=>l,tableAttributes:()=>C,tableOf:()=>f,useFrameRegistration:()=>M,usePaneEntry:()=>B,usePeeking:()=>I,useShellStore:()=>V,useStableKey:()=>w,warnOnce:()=>F});module.exports=k(L);var i=E(require("react")),x=require("radix-ui/internal");var s=["initial","xs","sm","md","lg","xl"];function u(e){return typeof e=="object"&&e!==null}function f(e,n){let t={},o=null;for(let r of s){if(e!==void 0&&!u(e)){t[r]=e;continue}let p=u(e)?e[r]:void 0;p!==void 0&&(o={value:p}),t[r]=o?o.value:n(r)}return t}function m(e){let n=e.initial;return s.every(t=>e[t]===n)?n:void 0}function C(e,n){let t=m(n);if(t!==void 0)return{[`data-${e}`]:t};let o={};for(let r of s)o[`data-${e}-${r}`]=n[r];return o}function w(e){return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}var O=f("fixed",()=>"fixed");function N(){return{entries:new Map,listeners:new Set,version:0,peek:null}}function S(e){e.version+=1;for(let n of e.listeners)n()}function l(e,n){return e.listeners.add(n),()=>{e.listeners.delete(n)}}function z(e,n){e.peek!==n&&(e.peek=n,S(e))}var P=i.createContext(null);function V(e){let n=i.useContext(P);if(!n)throw new Error(`${e} must be used within <Shell.Root>`);return n}function B(e,n){let t=i.useCallback(r=>l(e,r),[e]),o=i.useCallback(()=>e.entries.get(n),[e,n]);return i.useSyncExternalStore(t,o,()=>{})}function I(e,n){let t=i.useCallback(o=>l(e,o),[e]);return i.useSyncExternalStore(t,()=>e.peek===n,()=>!1)}var b=i.createContext(null);function M(e,n){let t=i.useContext(b);if(!t)throw new Error("Shell panes must be used within <Shell.Root>");let{registerOffFrame:o,unregisterOffFrame:r}=t;(0,x.useLayoutEffect)(()=>{if(!n)return o(e),()=>r(e)},[e,n,o,r])}var c=new Set;function F(e){}
3
3
  //# sourceMappingURL=shell-store.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/_internal/shell-store.tsx", "../../../../src/components/shell.types.ts"],
4
- "sourcesContent": ["'use client';\n\n/**\n * The Shell's state model (0.8.0), ported from kookie-ui-v2's Shell.\n *\n * - State lives on the pane. Each pane holds `auto | open | closed`.\n * `auto` means untouched: the stylesheet decides what\n * it shows at each breakpoint, so first paint is right with no script, the\n * server and the client render the same markup, and no open-state callback\n * can fire on mount or on a resize.\n * - The one thing that crosses the Shell is a registry keyed by pane name.\n * Each pane registers what it is and how to drive it; a Trigger looks its\n * pane up, and the Root reads the set of live overlays. Nothing scans\n * children and nothing checks `displayName`.\n * - The responsive props are resolved into a table with one value per\n * breakpoint, from the props alone, with no window. The table is written to\n * the DOM as data attributes for the stylesheet, and read again in JS by the\n * mirror that sets `aria-expanded`. One table, two readers, so they agree by\n * construction.\n */\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport { SHELL_BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneName, PresentationValue } from '../shell.types.js';\n\n/* \u2500\u2500 Breakpoint tables \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type Table<T> = Record<Breakpoint, T>;\n\n/** What a pane shows: open or closed. */\nexport type PaneValue = 'open' | 'closed';\n\ntype ResponsiveInput<T> = T | Partial<Record<Breakpoint, T>> | undefined;\n\nfunction isMap<T>(value: ResponsiveInput<T>): value is Partial<Record<Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * A responsive value at every breakpoint. A breakpoint takes the largest key\n * at or below it, the same fallback `useResponsiveValue` used; a breakpoint\n * below every key takes `fallback`.\n */\nexport function tableOf<T>(value: ResponsiveInput<T>, fallback: (bp: Breakpoint) => T): Table<T> {\n const table = {} as Table<T>;\n let carried: { value: T } | null = null;\n for (const bp of SHELL_BREAKPOINTS) {\n if (value !== undefined && !isMap(value)) {\n table[bp] = value;\n continue;\n }\n const entry = isMap(value) ? value[bp] : undefined;\n if (entry !== undefined) carried = { value: entry };\n table[bp] = carried ? carried.value : fallback(bp);\n }\n return table;\n}\n\n/** The table's one value, when it has only one. */\nexport function constantOf<T>(table: Table<T>): T | undefined {\n const first = table.initial;\n return SHELL_BREAKPOINTS.every((bp) => table[bp] === first) ? first : undefined;\n}\n\n/**\n * The table as data attributes: `data-<name>` when it holds one value, one\n * `data-<name>-<bp>` per breakpoint when it holds several. The stylesheet has\n * a rule for each spelling.\n */\nexport function tableAttributes(name: string, table: Table<string>): Record<string, string> {\n const constant = constantOf(table);\n if (constant !== undefined) return { [`data-${name}`]: constant };\n const attributes: Record<string, string> = {};\n for (const bp of SHELL_BREAKPOINTS) attributes[`data-${name}-${bp}`] = table[bp];\n return attributes;\n}\n\n/**\n * A responsive prop object is usually an inline literal, a new identity every\n * render. Keying memoisation on its contents keeps the tables, and so the\n * registry entries, stable across renders that change nothing.\n */\nexport function useStableKey(value: unknown): string {\n return typeof value === 'object' && value !== null ? JSON.stringify(value) : String(value);\n}\n\nexport const FIXED_TABLE: Table<PresentationValue> = tableOf<PresentationValue>('fixed', () => 'fixed');\n\n/* \u2500\u2500 The registry \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type OpenChangeReason = 'toggle' | 'dismiss';\n\nexport type PaneEntry = {\n name: PaneName;\n id: string;\n el: HTMLElement | null;\n /** What the pane shows now; `undefined` while an untouched pane cannot know (before the breakpoint is known). */\n value: PaneValue | undefined;\n /** How the pane is presented now, when known. */\n presentation: PresentationValue | undefined;\n /** The pane's own presentation at every breakpoint. A Panel with none of its own follows the Rail's. */\n presentationTable: Table<PresentationValue>;\n /** Open and presented as an overlay: what the scrim and Escape close, and what containment exempts. */\n overlayLive: boolean;\n /** The pane's designed open width, for panes that sit beside it when floating. */\n size: number;\n setValue: (value: PaneValue, reason: OpenChangeReason) => void;\n toggle: (reason: OpenChangeReason) => void;\n};\n\nexport type ShellStore = {\n entries: Map<PaneName, PaneEntry>;\n listeners: Set<() => void>;\n /**\n * What a subscriber reads. useSyncExternalStore needs a value that is stable\n * between notifications, and a number is; the Map, or anything derived from\n * it, would be a new identity on every read.\n */\n version: number;\n /** The pane a hovered Trigger is previewing, if any. Layout only. */\n peek: PaneName | null;\n};\n\nexport function createShellStore(): ShellStore {\n return { entries: new Map(), listeners: new Set(), version: 0, peek: null };\n}\n\nexport function notifyShellStore(store: ShellStore) {\n store.version += 1;\n for (const listener of store.listeners) listener();\n}\n\nexport function subscribeShellStore(store: ShellStore, listener: () => void) {\n store.listeners.add(listener);\n return () => {\n store.listeners.delete(listener);\n };\n}\n\nexport function setShellPeek(store: ShellStore, peek: PaneName | null) {\n if (store.peek === peek) return;\n store.peek = peek;\n notifyShellStore(store);\n}\n\nexport const ShellStoreContext = React.createContext<ShellStore | null>(null);\n\nexport function useShellStore(part: string): ShellStore {\n const store = React.useContext(ShellStoreContext);\n if (!store) throw new Error(`${part} must be used within <Shell.Root>`);\n return store;\n}\n\n/** One pane's registry entry. Re-renders only when that entry is replaced. */\nexport function usePaneEntry(store: ShellStore, name: PaneName): PaneEntry | undefined {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n const getSnapshot = React.useCallback(() => store.entries.get(name), [store, name]);\n return React.useSyncExternalStore(subscribe, getSnapshot, () => undefined);\n}\n\n/**\n * Whether this pane is the one being previewed. A boolean per pane rather than\n * the peek target itself, so hovering one Trigger re-renders one pane, not all.\n */\nexport function usePeeking(store: ShellStore, name: PaneName): boolean {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n return React.useSyncExternalStore(\n subscribe,\n () => store.peek === name,\n () => false,\n );\n}\n\n/* \u2500\u2500 Inset \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type InsetPaneId = 'rail' | 'panel' | 'sidebar' | 'content' | 'inspector' | 'bottom';\n\nexport const ShellInsetContext = React.createContext<{\n registerInset: (id: InsetPaneId) => void;\n unregisterInset: (id: InsetPaneId) => void;\n} | null>(null);\n\n/** Registers a pane's `inset` with the Root, which paints the backdrop while any pane is inset. */\nexport function useInsetRegistration(id: InsetPaneId, inset: boolean | undefined) {\n const ctx = React.useContext(ShellInsetContext);\n if (!ctx) throw new Error('Shell panes must be used within <Shell.Root>');\n const { registerInset, unregisterInset } = ctx;\n useLayoutEffect(() => {\n if (!inset) return;\n registerInset(id);\n return () => unregisterInset(id);\n }, [id, inset, registerInset, unregisterInset]);\n}\n\n/* \u2500\u2500 Development warnings \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst warned = new Set<string>();\n\n/** A deprecation warning, once per message per page load. Development only. */\nexport function warnOnce(message: string) {\n if (process.env.NODE_ENV === 'production') return;\n if (warned.has(message)) return;\n warned.add(message);\n console.warn(`[kookie-ui] ${message}`);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\n/**\n * Why a pane's open state changed. Since 0.8.0 only a user action is reported:\n * `toggle` for a Trigger, a handle double-click or a drag past\n * `collapseThreshold`, and `dismiss` for Escape or a press on the scrim.\n * `init`, `responsive`, `panel` and `left` are kept in the types for\n * compatibility and are never sent.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss' | 'init' | 'responsive';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n /** @deprecated Removed in 1.0. Snap in your own `onSizeChange` and pass `size`. */\n snapPoints?: number[];\n /** @deprecated Removed in 1.0, with `snapPoints`. */\n snapTolerance?: number;\n /** @deprecated Removed in 1.0. Close the pane from your own `onResizeEnd`. */\n collapseThreshold?: number;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n paneId?: string;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/** The panes a Trigger can drive. `left` is the deprecated name for `rail`. */\nexport type PaneName = Exclude<PaneTarget, 'left'>;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n"],
5
- "mappings": ";ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,sBAAAC,EAAA,sBAAAC,EAAA,eAAAC,EAAA,qBAAAC,EAAA,qBAAAC,EAAA,iBAAAC,EAAA,wBAAAC,EAAA,oBAAAC,EAAA,YAAAC,EAAA,yBAAAC,EAAA,iBAAAC,EAAA,eAAAC,EAAA,kBAAAC,EAAA,iBAAAC,EAAA,aAAAC,IAAA,eAAAC,EAAAlB,GAoBA,IAAAmB,EAAuB,oBACvBC,EAAgC,6BC6CzB,IAAMC,EAA2C,CAAC,UAAW,KAAM,KAAM,KAAM,KAAM,IAAI,EDhChG,SAASC,EAASC,EAAoE,CACpF,OAAO,OAAOA,GAAU,UAAYA,IAAU,IAChD,CAOO,SAASC,EAAWD,EAA2BE,EAA2C,CAC/F,IAAMC,EAAQ,CAAC,EACXC,EAA+B,KACnC,QAAWC,KAAMC,EAAmB,CAClC,GAAIN,IAAU,QAAa,CAACD,EAAMC,CAAK,EAAG,CACxCG,EAAME,CAAE,EAAIL,EACZ,QACF,CACA,IAAMO,EAAQR,EAAMC,CAAK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,CACtD,IAAMP,EAAc,aAAWK,CAAiB,EAChD,GAAI,CAACL,EAAO,MAAM,IAAI,MAAM,GAAGO,CAAI,mCAAmC,EACtE,OAAOP,CACT,CAGO,SAASQ,EAAaR,EAAmBP,EAAuC,CACrF,IAAMgB,EAAkB,cAAaR,GAAyBC,EAAoBF,EAAOC,CAAQ,EAAG,CAACD,CAAK,CAAC,EACrGU,EAAoB,cAAY,IAAMV,EAAM,QAAQ,IAAIP,CAAI,EAAG,CAACO,EAAOP,CAAI,CAAC,EAClF,OAAa,uBAAqBgB,EAAWC,EAAa,IAAG,EAAY,CAC3E,CAMO,SAASC,EAAWX,EAAmBP,EAAyB,CACrE,IAAMgB,EAAkB,cAAaR,GAAyBC,EAAoBF,EAAOC,CAAQ,EAAG,CAACD,CAAK,CAAC,EAC3G,OAAa,uBACXS,EACA,IAAMT,EAAM,OAASP,EACrB,IAAM,EACR,CACF,CAMO,IAAMmB,EAA0B,gBAG7B,IAAI,EAGP,SAASC,EAAqBC,EAAiBC,EAA4B,CAChF,IAAMC,EAAY,aAAWJ,CAAiB,EAC9C,GAAI,CAACI,EAAK,MAAM,IAAI,MAAM,8CAA8C,EACxE,GAAM,CAAE,cAAAC,EAAe,gBAAAC,CAAgB,EAAIF,KAC3C,mBAAgB,IAAM,CACpB,GAAKD,EACL,OAAAE,EAAcH,CAAE,EACT,IAAMI,EAAgBJ,CAAE,CACjC,EAAG,CAACA,EAAIC,EAAOE,EAAeC,CAAe,CAAC,CAChD,CAIA,IAAMC,EAAS,IAAI,IAGZ,SAASC,EAASC,EAAiB,CAK1C",
6
- "names": ["shell_store_exports", "__export", "FIXED_TABLE", "ShellInsetContext", "ShellStoreContext", "constantOf", "createShellStore", "notifyShellStore", "setShellPeek", "subscribeShellStore", "tableAttributes", "tableOf", "useInsetRegistration", "usePaneEntry", "usePeeking", "useShellStore", "useStableKey", "warnOnce", "__toCommonJS", "React", "import_internal", "SHELL_BREAKPOINTS", "isMap", "value", "tableOf", "fallback", "table", "carried", "bp", "SHELL_BREAKPOINTS", "entry", "constantOf", "first", "tableAttributes", "name", "constant", "attributes", "useStableKey", "FIXED_TABLE", "createShellStore", "notifyShellStore", "store", "listener", "subscribeShellStore", "setShellPeek", "peek", "ShellStoreContext", "useShellStore", "part", "usePaneEntry", "subscribe", "getSnapshot", "usePeeking", "ShellInsetContext", "useInsetRegistration", "id", "inset", "ctx", "registerInset", "unregisterInset", "warned", "warnOnce", "message"]
4
+ "sourcesContent": ["'use client';\n\n/**\n * The Shell's state model (0.8.0), ported from kookie-ui-v2's Shell.\n *\n * - State lives on the pane. Each pane holds `auto | open | closed`.\n * `auto` means untouched: the stylesheet decides what\n * it shows at each breakpoint, so first paint is right with no script, the\n * server and the client render the same markup, and no open-state callback\n * can fire on mount or on a resize.\n * - The one thing that crosses the Shell is a registry keyed by pane name.\n * Each pane registers what it is and how to drive it; a Trigger looks its\n * pane up, and the Root reads the set of live overlays. Nothing scans\n * children and nothing checks `displayName`.\n * - The responsive props are resolved into a table with one value per\n * breakpoint, from the props alone, with no window. The table is written to\n * the DOM as data attributes for the stylesheet, and read again in JS by the\n * mirror that sets `aria-expanded`. One table, two readers, so they agree by\n * construction.\n */\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport { SHELL_BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneName, PresentationValue } from '../shell.types.js';\n\n/* \u2500\u2500 Breakpoint tables \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type Table<T> = Record<Breakpoint, T>;\n\n/** What a pane shows: open or closed. */\nexport type PaneValue = 'open' | 'closed';\n\ntype ResponsiveInput<T> = T | Partial<Record<Breakpoint, T>> | undefined;\n\nfunction isMap<T>(value: ResponsiveInput<T>): value is Partial<Record<Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * A responsive value at every breakpoint. A breakpoint takes the largest key\n * at or below it, the same fallback `useResponsiveValue` used; a breakpoint\n * below every key takes `fallback`.\n */\nexport function tableOf<T>(value: ResponsiveInput<T>, fallback: (bp: Breakpoint) => T): Table<T> {\n const table = {} as Table<T>;\n let carried: { value: T } | null = null;\n for (const bp of SHELL_BREAKPOINTS) {\n if (value !== undefined && !isMap(value)) {\n table[bp] = value;\n continue;\n }\n const entry = isMap(value) ? value[bp] : undefined;\n if (entry !== undefined) carried = { value: entry };\n table[bp] = carried ? carried.value : fallback(bp);\n }\n return table;\n}\n\n/** The table's one value, when it has only one. */\nexport function constantOf<T>(table: Table<T>): T | undefined {\n const first = table.initial;\n return SHELL_BREAKPOINTS.every((bp) => table[bp] === first) ? first : undefined;\n}\n\n/**\n * The table as data attributes: `data-<name>` when it holds one value, one\n * `data-<name>-<bp>` per breakpoint when it holds several. The stylesheet has\n * a rule for each spelling.\n */\nexport function tableAttributes(name: string, table: Table<string>): Record<string, string> {\n const constant = constantOf(table);\n if (constant !== undefined) return { [`data-${name}`]: constant };\n const attributes: Record<string, string> = {};\n for (const bp of SHELL_BREAKPOINTS) attributes[`data-${name}-${bp}`] = table[bp];\n return attributes;\n}\n\n/**\n * A responsive prop object is usually an inline literal, a new identity every\n * render. Keying memoisation on its contents keeps the tables, and so the\n * registry entries, stable across renders that change nothing.\n */\nexport function useStableKey(value: unknown): string {\n return typeof value === 'object' && value !== null ? JSON.stringify(value) : String(value);\n}\n\nexport const FIXED_TABLE: Table<PresentationValue> = tableOf<PresentationValue>('fixed', () => 'fixed');\n\n/* \u2500\u2500 The registry \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type OpenChangeReason = 'toggle' | 'dismiss';\n\nexport type PaneEntry = {\n name: PaneName;\n id: string;\n el: HTMLElement | null;\n /** What the pane shows now; `undefined` while an untouched pane cannot know (before the breakpoint is known). */\n value: PaneValue | undefined;\n /** How the pane is presented now, when known. */\n presentation: PresentationValue | undefined;\n /** The pane's own presentation at every breakpoint. A Panel with none of its own follows the Rail's. */\n presentationTable: Table<PresentationValue>;\n /** Open and presented as an overlay: what the scrim and Escape close, and what containment exempts. */\n overlayLive: boolean;\n /** The pane's designed open width, for panes that sit beside it when floating. */\n size: number;\n setValue: (value: PaneValue, reason: OpenChangeReason) => void;\n toggle: (reason: OpenChangeReason) => void;\n};\n\nexport type ShellStore = {\n entries: Map<PaneName, PaneEntry>;\n listeners: Set<() => void>;\n /**\n * What a subscriber reads. useSyncExternalStore needs a value that is stable\n * between notifications, and a number is; the Map, or anything derived from\n * it, would be a new identity on every read.\n */\n version: number;\n /** The pane a hovered Trigger is previewing, if any. Layout only. */\n peek: PaneName | null;\n};\n\nexport function createShellStore(): ShellStore {\n return { entries: new Map(), listeners: new Set(), version: 0, peek: null };\n}\n\nexport function notifyShellStore(store: ShellStore) {\n store.version += 1;\n for (const listener of store.listeners) listener();\n}\n\nexport function subscribeShellStore(store: ShellStore, listener: () => void) {\n store.listeners.add(listener);\n return () => {\n store.listeners.delete(listener);\n };\n}\n\nexport function setShellPeek(store: ShellStore, peek: PaneName | null) {\n if (store.peek === peek) return;\n store.peek = peek;\n notifyShellStore(store);\n}\n\nexport const ShellStoreContext = React.createContext<ShellStore | null>(null);\n\nexport function useShellStore(part: string): ShellStore {\n const store = React.useContext(ShellStoreContext);\n if (!store) throw new Error(`${part} must be used within <Shell.Root>`);\n return store;\n}\n\n/** One pane's registry entry. Re-renders only when that entry is replaced. */\nexport function usePaneEntry(store: ShellStore, name: PaneName): PaneEntry | undefined {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n const getSnapshot = React.useCallback(() => store.entries.get(name), [store, name]);\n return React.useSyncExternalStore(subscribe, getSnapshot, () => undefined);\n}\n\n/**\n * Whether this pane is the one being previewed. A boolean per pane rather than\n * the peek target itself, so hovering one Trigger re-renders one pane, not all.\n */\nexport function usePeeking(store: ShellStore, name: PaneName): boolean {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n return React.useSyncExternalStore(\n subscribe,\n () => store.peek === name,\n () => false,\n );\n}\n\n/* \u2500\u2500 Off the frame \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type FramePaneId = 'rail' | 'panel' | 'sidebar' | 'content' | 'inspector' | 'bottom';\n\nexport const ShellFrameContext = React.createContext<{\n registerOffFrame: (id: FramePaneId) => void;\n unregisterOffFrame: (id: FramePaneId) => void;\n} | null>(null);\n\n/** Tells the Root a pane is off the frame (`flush={false}`); the Rail's card moves a floating Panel over. */\nexport function useFrameRegistration(id: FramePaneId, flush: boolean) {\n const ctx = React.useContext(ShellFrameContext);\n if (!ctx) throw new Error('Shell panes must be used within <Shell.Root>');\n const { registerOffFrame, unregisterOffFrame } = ctx;\n useLayoutEffect(() => {\n if (flush) return;\n registerOffFrame(id);\n return () => unregisterOffFrame(id);\n }, [id, flush, registerOffFrame, unregisterOffFrame]);\n}\n\n/* \u2500\u2500 Development warnings \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst warned = new Set<string>();\n\n/** A deprecation warning, once per message per page load. Development only. */\nexport function warnOnce(message: string) {\n if (process.env.NODE_ENV === 'production') return;\n if (warned.has(message)) return;\n warned.add(message);\n console.warn(`[kookie-ui] ${message}`);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\n/**\n * Why a pane's open state changed. Since 0.8.0 only a user action is reported:\n * `toggle` for a Trigger, a handle double-click or a drag past\n * `collapseThreshold`, and `dismiss` for Escape or a press on the scrim.\n * `init`, `responsive`, `panel` and `left` are kept in the types for\n * compatibility and are never sent.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss' | 'init' | 'responsive';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n /** @deprecated Removed in 1.0. Snap in your own `onSizeChange` and pass `size`. */\n snapPoints?: number[];\n /** @deprecated Removed in 1.0, with `snapPoints`. */\n snapTolerance?: number;\n /** @deprecated Removed in 1.0. Close the pane from your own `onResizeEnd`. */\n collapseThreshold?: number;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n paneId?: string;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/** The panes a Trigger can drive. `left` is the deprecated name for `rail`. */\nexport type PaneName = Exclude<PaneTarget, 'left'>;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n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3G,OAAa,uBACXS,EACA,IAAMT,EAAM,OAASP,EACrB,IAAM,EACR,CACF,CAMO,IAAMmB,EAA0B,gBAG7B,IAAI,EAGP,SAASC,EAAqBC,EAAiBC,EAAgB,CACpE,IAAMC,EAAY,aAAWJ,CAAiB,EAC9C,GAAI,CAACI,EAAK,MAAM,IAAI,MAAM,8CAA8C,EACxE,GAAM,CAAE,iBAAAC,EAAkB,mBAAAC,CAAmB,EAAIF,KACjD,mBAAgB,IAAM,CACpB,GAAI,CAAAD,EACJ,OAAAE,EAAiBH,CAAE,EACZ,IAAMI,EAAmBJ,CAAE,CACpC,EAAG,CAACA,EAAIC,EAAOE,EAAkBC,CAAkB,CAAC,CACtD,CAIA,IAAMC,EAAS,IAAI,IAGZ,SAASC,EAASC,EAAiB,CAK1C",
6
+ "names": ["shell_store_exports", "__export", "FIXED_TABLE", "ShellFrameContext", "ShellStoreContext", "constantOf", "createShellStore", "notifyShellStore", "setShellPeek", "subscribeShellStore", "tableAttributes", "tableOf", "useFrameRegistration", "usePaneEntry", "usePeeking", "useShellStore", "useStableKey", "warnOnce", "__toCommonJS", "React", "import_internal", "SHELL_BREAKPOINTS", "isMap", "value", "tableOf", "fallback", "table", "carried", "bp", "SHELL_BREAKPOINTS", "entry", "constantOf", "first", "tableAttributes", "name", "constant", "attributes", "useStableKey", "FIXED_TABLE", "createShellStore", "notifyShellStore", "store", "listener", "subscribeShellStore", "setShellPeek", "peek", "ShellStoreContext", "useShellStore", "part", "usePaneEntry", "subscribe", "getSnapshot", "usePeeking", "ShellFrameContext", "useFrameRegistration", "id", "flush", "ctx", "registerOffFrame", "unregisterOffFrame", "warned", "warnOnce", "message"]
7
7
  }