@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.
- package/components.css +86 -35
- package/dist/cjs/components/_internal/pane-chrome.js +1 -1
- package/dist/cjs/components/_internal/pane-chrome.js.map +2 -2
- package/dist/cjs/components/_internal/shell-bottom.d.ts +7 -2
- package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
- package/dist/cjs/components/_internal/shell-inspector.d.ts +7 -2
- package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
- package/dist/cjs/components/_internal/shell-pane.js +1 -1
- package/dist/cjs/components/_internal/shell-pane.js.map +2 -2
- package/dist/cjs/components/_internal/shell-sidebar.d.ts +7 -2
- package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
- package/dist/cjs/components/_internal/shell-store.d.ts +6 -6
- package/dist/cjs/components/_internal/shell-store.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-store.js +1 -1
- package/dist/cjs/components/_internal/shell-store.js.map +3 -3
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/navigator.js +1 -1
- package/dist/cjs/components/navigator.js.map +2 -2
- package/dist/cjs/components/shell.context.js +1 -1
- package/dist/cjs/components/shell.context.js.map +2 -2
- package/dist/cjs/components/shell.d.ts +25 -7
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.hooks.js +1 -1
- package/dist/cjs/components/shell.hooks.js.map +2 -2
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +3 -3
- package/dist/cjs/components/toolbar.js +1 -1
- package/dist/cjs/components/toolbar.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/chunk-5BXCPANF.js +3 -0
- package/dist/esm/{chunk-GHWEXMF6.js.map → chunk-5BXCPANF.js.map} +3 -3
- package/dist/esm/{chunk-ZG2XQUOH.js → chunk-B447PNRD.js} +2 -2
- package/dist/esm/{chunk-QDAM2I6O.js → chunk-BR6Z2CAE.js} +2 -2
- package/dist/esm/{chunk-4G3FJUER.js → chunk-INGT6DB6.js} +2 -2
- package/dist/esm/{chunk-4ZHBNYXM.js → chunk-J6B7UCZN.js} +2 -2
- package/dist/esm/chunk-KDJM4NQQ.js +3 -0
- package/dist/esm/chunk-KDJM4NQQ.js.map +7 -0
- package/dist/esm/{chunk-LTUW36HM.js → chunk-KGCGT4MJ.js} +2 -2
- package/dist/esm/chunk-NO2JCJWI.js +3 -0
- package/dist/esm/chunk-NO2JCJWI.js.map +7 -0
- package/dist/esm/{chunk-NFSW36RG.js → chunk-ODHCDJ3Y.js} +2 -2
- package/dist/esm/chunk-UMQOTGJC.js +3 -0
- package/dist/esm/chunk-UMQOTGJC.js.map +7 -0
- package/dist/esm/chunk-XD676L6S.js +3 -0
- package/dist/esm/chunk-XD676L6S.js.map +7 -0
- package/dist/esm/{chunk-6SGJWML7.js → chunk-XKYPJTRN.js} +2 -2
- package/dist/esm/components/_internal/pane-chrome.js +1 -1
- package/dist/esm/components/_internal/shell-bottom.d.ts +7 -2
- package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-bottom.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.d.ts +7 -2
- package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-pane.js +1 -1
- package/dist/esm/components/_internal/shell-sidebar.d.ts +7 -2
- package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js +1 -1
- package/dist/esm/components/_internal/shell-store.d.ts +6 -6
- package/dist/esm/components/_internal/shell-store.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-store.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/navigator.js +1 -1
- package/dist/esm/components/shell.context.js +1 -1
- package/dist/esm/components/shell.d.ts +25 -7
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.hooks.js +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/src/components/_internal/shell-bottom.tsx +11 -6
- package/src/components/_internal/shell-inspector.tsx +11 -6
- package/src/components/_internal/shell-sidebar.tsx +11 -6
- package/src/components/_internal/shell-store.tsx +13 -13
- package/src/components/shell.css +133 -47
- package/src/components/shell.tsx +50 -32
- package/src/styles/tokens/color.css +2 -0
- package/styles.css +87 -35
- package/tokens/base.css +1 -0
- package/tokens.css +1 -0
- package/dist/esm/chunk-4B3S2DM7.js +0 -3
- package/dist/esm/chunk-4B3S2DM7.js.map +0 -7
- package/dist/esm/chunk-AKMRPGNP.js +0 -3
- package/dist/esm/chunk-AKMRPGNP.js.map +0 -7
- package/dist/esm/chunk-GHWEXMF6.js +0 -3
- package/dist/esm/chunk-ZBSGH74F.js +0 -3
- package/dist/esm/chunk-ZBSGH74F.js.map +0 -7
- package/dist/esm/chunk-ZHXEEOGI.js +0 -3
- package/dist/esm/chunk-ZHXEEOGI.js.map +0 -7
- /package/dist/esm/{chunk-ZG2XQUOH.js.map → chunk-B447PNRD.js.map} +0 -0
- /package/dist/esm/{chunk-QDAM2I6O.js.map → chunk-BR6Z2CAE.js.map} +0 -0
- /package/dist/esm/{chunk-4G3FJUER.js.map → chunk-INGT6DB6.js.map} +0 -0
- /package/dist/esm/{chunk-4ZHBNYXM.js.map → chunk-J6B7UCZN.js.map} +0 -0
- /package/dist/esm/{chunk-LTUW36HM.js.map → chunk-KGCGT4MJ.js.map} +0 -0
- /package/dist/esm/{chunk-NFSW36RG.js.map → chunk-ODHCDJ3Y.js.map} +0 -0
- /package/dist/esm/{chunk-6SGJWML7.js.map → chunk-XKYPJTRN.js.map} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{b as a}from"./chunk-MAA6LEE2.js";import*as o from"react";import{useLayoutEffect as p}from"radix-ui/internal";function s(e){return typeof e=="object"&&e!==null}function f(e,n){let t={},r=null;for(let i of a){if(e!==void 0&&!s(e)){t[i]=e;continue}let l=s(e)?e[i]:void 0;l!==void 0&&(r={value:l}),t[i]=r?r.value:n(i)}return t}function d(e){let n=e.initial;return a.every(t=>e[t]===n)?n:void 0}function P(e,n){let t=d(n);if(t!==void 0)return{[`data-${e}`]:t};let r={};for(let i of a)r[`data-${e}-${i}`]=n[i];return r}function T(e){return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}var g=f("fixed",()=>"fixed");function R(){return{entries:new Map,listeners:new Set,version:0,peek:null}}function S(e){e.version+=1;for(let n of e.listeners)n()}function c(e,n){return e.listeners.add(n),()=>{e.listeners.delete(n)}}function y(e,n){e.peek!==n&&(e.peek=n,S(e))}var b=o.createContext(null);function k(e){let n=o.useContext(b);if(!n)throw new Error(`${e} must be used within <Shell.Root>`);return n}function v(e,n){let t=o.useCallback(i=>c(e,i),[e]),r=o.useCallback(()=>e.entries.get(n),[e,n]);return o.useSyncExternalStore(t,r,()=>{})}function E(e,n){let t=o.useCallback(r=>c(e,r),[e]);return o.useSyncExternalStore(t,()=>e.peek===n,()=>!1)}var x=o.createContext(null);function w(e,n){let t=o.useContext(x);if(!t)throw new Error("Shell panes must be used within <Shell.Root>");let{registerOffFrame:r,unregisterOffFrame:i}=t;p(()=>{if(!n)return r(e),()=>i(e)},[e,n,r,i])}var u=new Set;function O(e){}export{f as a,d as b,P as c,T as d,g as e,R as f,S as g,c as h,y as i,b as j,k,v as l,E as m,x as n,w as o,O as p};
|
|
3
|
+
//# sourceMappingURL=chunk-5BXCPANF.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/_internal/shell-store.tsx"],
|
|
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
|
|
5
|
-
"mappings": ";wCAoBA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,MAAuB,oBAahC,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,EAAIA,EAAMK,CAAE,EAAI,OACrCE,IAAU,SAAWH,EAAU,CAAE,MAAOG,CAAM,GAClDJ,EAAME,CAAE,EAAID,EAAUA,EAAQ,MAAQF,EAASG,CAAE,CACnD,CACA,OAAOF,CACT,CAGO,SAASK,EAAcL,EAAgC,CAC5D,IAAMM,EAAQN,EAAM,QACpB,OAAOG,EAAkB,MAAOD,GAAOF,EAAME,CAAE,IAAMI,CAAK,EAAIA,EAAQ,MACxE,CAOO,SAASC,EAAgBC,EAAcR,EAA8C,CAC1F,IAAMS,EAAWJ,EAAWL,CAAK,EACjC,GAAIS,IAAa,OAAW,MAAO,CAAE,CAAC,QAAQ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B,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,
|
|
6
|
-
"names": ["React", "useLayoutEffect", "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", "
|
|
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"],
|
|
5
|
+
"mappings": ";wCAoBA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,MAAuB,oBAahC,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,EAAIA,EAAMK,CAAE,EAAI,OACrCE,IAAU,SAAWH,EAAU,CAAE,MAAOG,CAAM,GAClDJ,EAAME,CAAE,EAAID,EAAUA,EAAQ,MAAQF,EAASG,CAAE,CACnD,CACA,OAAOF,CACT,CAGO,SAASK,EAAcL,EAAgC,CAC5D,IAAMM,EAAQN,EAAM,QACp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AAG,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,EAAgB,CACpE,IAAMC,EAAY,aAAWJ,CAAiB,EAC9C,GAAI,CAACI,EAAK,MAAM,IAAI,MAAM,8CAA8C,EACxE,GAAM,CAAE,iBAAAC,EAAkB,mBAAAC,CAAmB,EAAIF,EACjDG,EAAgB,IAAM,CACpB,GAAI,CAAAJ,EACJ,OAAAE,EAAiBH,CAAE,EACZ,IAAMI,EAAmBJ,CAAE,CACpC,EAAG,CAACA,EAAIC,EAAOE,EAAkBC,CAAkB,CAAC,CACtD,CAIA,IAAME,EAAS,IAAI,IAGZ,SAASC,EAASC,EAAiB,CAK1C",
|
|
6
|
+
"names": ["React", "useLayoutEffect", "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", "useLayoutEffect", "warned", "warnOnce", "message"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{b as t}from"./chunk-G66WDIIV.js";import{a as n}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{b as t}from"./chunk-G66WDIIV.js";import{a as n}from"./chunk-5BXCPANF.js";import*as s from"react";function p(e){s.useEffect(()=>{},[]);let{breakpoint:o}=t(typeof e!="string");return n(e,()=>"fixed")[o]}export{p as a};
|
|
3
|
+
//# sourceMappingURL=chunk-B447PNRD.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as to,b as ro,c as no,e as W,f as ao,i as so,l as io}from"./chunk-KBSH6CBD.js";import{a as B}from"./chunk-JQMWNI62.js";import{a as eo}from"./chunk-FICBVI4M.js";import{a as q}from"./chunk-7N2Q5WOM.js";import{b as L}from"./chunk-5ON3XLRD.js";import{d as J,f as Q,g as X}from"./chunk-VWRPVM5K.js";import{h as oo}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as to,b as ro,c as no,e as W,f as ao,i as so,l as io}from"./chunk-KBSH6CBD.js";import{a as B}from"./chunk-JQMWNI62.js";import{a as eo}from"./chunk-FICBVI4M.js";import{a as q}from"./chunk-7N2Q5WOM.js";import{b as L}from"./chunk-5ON3XLRD.js";import{d as J,f as Q,g as X}from"./chunk-VWRPVM5K.js";import{h as oo}from"./chunk-ODHCDJ3Y.js";import{c as U}from"./chunk-OKQAVYW4.js";import*as o from"react";import{useComposedRefs as vo,useLayoutEffect as D}from"radix-ui/internal";import g from"classnames";import{Toolbar as N}from"radix-ui";var Po=["1","2","3","4"],Ro=["horizontal","vertical"],x={size:{type:"enum",className:"kui-r-size",values:Po,default:"2"},orientation:{type:"enum",values:Ro,default:"horizontal"}};var M=o.createContext(null),F=o.createContext(null),E=o.createContext(!1);function Ho(){return o.useContext(E)}var H=o.forwardRef((e,t)=>{let r=oo(),a=L(e.size??r??void 0,x.size),s=e.orientation??x.orientation.default,{className:i,orientation:n,backdrop:l=!1,children:c,...d}=U({...e,size:a},x,q),u=o.useMemo(()=>({size:a,orientation:s,backdrop:l}),[a,s,l]);return o.createElement(N.Root,{...d,ref:t,orientation:s,"data-backdrop":l||void 0,className:g("kui-Toolbar",i)},o.createElement(M.Provider,{value:u},c))});H.displayName="Toolbar";var co=o.forwardRef(({className:e,disabled:t=!1,children:r,...a},s)=>{let i=o.useContext(M),n=o.useContext(E),l=o.useMemo(()=>({disabled:t}),[t]);return n?o.createElement(ao,{...a,ref:s,className:e},o.createElement(F.Provider,{value:l},r)):o.createElement("div",{role:"group","data-orientation":i?.orientation??"horizontal","data-disabled":t||void 0,...a,ref:s,className:g("kui-ToolbarGroup",e)},o.createElement(F.Provider,{value:l},r))});co.displayName="Toolbar.Group";var yo=new Set(["id","className","style","title"]);function lo(e){return e===!0||e==="true"}function wo(e){return o.isValidElement(e)&&e.type==="button"}var A=o.forwardRef((e,t)=>{let r=o.useContext(M),a=o.useContext(F),s=o.useContext(E),{iconOnly:i,size:n,variant:l,emphasis:c,color:d,disabled:u,asChild:f,onKeyDown:b,...y}=e,h=u||a?.disabled||void 0;if(s){let P={};for(let R of Object.keys(y))(/^on[A-Z]/.test(R)||R.startsWith("aria-")||R.startsWith("data-")||yo.has(R))&&(P[R]=y[R]);return b&&(P.onKeyDown=b),o.createElement(uo,{...P,ref:t,asChild:f,iconOnly:i,disabled:h,color:d,pressed:e["aria-pressed"]===void 0?void 0:lo(e["aria-pressed"])},y.children)}let O=r?.orientation==="vertical"&&b?P=>{P.key==="ArrowDown"||P.key==="ArrowUp"||b(P)}:b,I=lo(e["aria-pressed"]),p="data-state"in e||e["aria-pressed"]===void 0?{}:{"data-state":I?"on":"off"},m={size:n??r?.size,...c!==void 0?{emphasis:c}:{variant:l??(a?"ghost":r?.backdrop?"raised":"soft")},color:d??(l||c?void 0:"gray"),...p},T={...y,...i?{iconOnly:!0}:{},...f?{asChild:!0}:{},...O?{onKeyDown:O}:{},...m};return r?f&&!wo(y.children)?o.createElement(N.Link,{asChild:!0,ref:t},o.createElement(B,{...T,disabled:h})):o.createElement(N.Button,{asChild:!0,ref:t,disabled:h},o.createElement(B,{...T})):o.createElement(B,{...T,ref:t,disabled:h})});A.displayName="Toolbar.Button";var uo=o.forwardRef(({asChild:e,iconOnly:t,disabled:r,color:a,pressed:s,children:i,"aria-label":n,...l},c)=>{let d=t?n:void 0,u={...l,...t?{}:n?{"aria-label":n}:{},disabled:r,...a?{color:a}:{}};if(e&&o.isValidElement(i)){let f=d?o.cloneElement(i,void 0,i.props.children,o.createElement("span",null,d)):i;return o.createElement(W,{...u,ref:c,asChild:!0},f)}return s!==void 0?o.createElement(so,{...u,ref:c,checked:s},i,d):o.createElement(W,{...u,ref:c},i,d)});uo.displayName="Toolbar.OverflowItem";function ho(){return o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentcolor","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg"},o.createElement("circle",{cx:"3.25",cy:"8",r:"1.25"}),o.createElement("circle",{cx:"8",cy:"8",r:"1.25"}),o.createElement("circle",{cx:"12.75",cy:"8",r:"1.25"}))}var po=o.forwardRef(({label:e="More",className:t,children:r,...a},s)=>{let i=o.Children.toArray(r),n=i.length,l=o.useRef(null),c=o.useRef([]),d=o.useRef(0),[u,f]=o.useState(n),[b,y]=o.useState(0),[h,O]=o.useState(n);h!==n&&(O(n),f(n)),D(()=>{c.current=[]},[n]),D(()=>{let p=l.current;if(!p)return;let m=Array.from(p.children),T=Math.min(u,n);for(let v=0;v<T;v++){let w=m[v];w&&(c.current[v]=w.offsetWidth)}let P=m[T];P&&(d.current=P.offsetWidth);let R=Number.parseFloat(getComputedStyle(p).columnGap)||0,K=p.clientWidth,V=0,_=0;for(let v=0;v<n;v++){let w=c.current[v];if(w===void 0)return;w!==0&&(V+=w+(_>0?R:0),_+=1)}let k=n;if(V>K){let v=K-(d.current||p.clientHeight)-R,w=0,Y=0;k=0;for(let G=0;G<n;G++){let Z=c.current[G];if(Z>0){let $=Z+(Y>0?R:0);if(w+$>v)break;w+=$,Y+=1}k+=1}}k!==u&&f(k)},[u,n,b]),o.useEffect(()=>{let p=l.current;if(!p||typeof ResizeObserver>"u")return;let m=new ResizeObserver(()=>y(T=>T+1));m.observe(p);for(let T of Array.from(p.children))m.observe(T);return()=>m.disconnect()},[u,n]);let I=o.useCallback(p=>{l.current=p,typeof s=="function"?s(p):s&&(s.current=p)},[s]);return o.createElement("div",{...a,ref:I,className:g("kui-ToolbarOverflow",t)},i.slice(0,u).map((p,m)=>o.createElement("div",{key:m,className:"kui-ToolbarOverflowSeat"},p)),u<n?o.createElement(to,null,o.createElement(ro,null,o.createElement(A,{iconOnly:!0,"aria-label":e},o.createElement(ho,null))),o.createElement(no,{align:"end"},o.createElement(E.Provider,{value:!0},i.slice(u)))):null)});po.displayName="Toolbar.Overflow";var j=[],S=new Map,z=new Set,C=new Map;function So(e){return z.add(e),()=>{z.delete(e)}}function go(e,t,r){let a=S.get(e)??j,i=a.findIndex(n=>n.id===t)===-1?[...a,{id:t,node:r}]:a.map(n=>n.id===t?{id:t,node:r}:n);S.set(e,i),z.forEach(n=>n())}function xo(e,t){let r=S.get(e);if(!r)return;let a=r.filter(s=>s.id!==t);a.length===0?S.delete(e):S.set(e,a),z.forEach(s=>s())}function fo({name:e="default"}){D(()=>{let r=(C.get(e)??0)+1;return C.set(e,r),r>1,()=>{let a=(C.get(e)??1)-1;a>0?C.set(e,a):C.delete(e)}},[e]);let t=o.useSyncExternalStore(So,()=>S.get(e)??j,()=>j);return o.createElement(o.Fragment,null,t.map(r=>o.createElement(o.Fragment,{key:r.id},r.node)))}fo.displayName="Toolbar.Slot";function bo({name:e="default",children:t}){let r=o.useId();return D(()=>{go(e,r,t)},[e,r,t]),D(()=>()=>xo(e,r),[e,r]),null}bo.displayName="Toolbar.Fill";var mo=o.forwardRef(({className:e,...t},r)=>{let a=o.useContext(M);return o.useContext(E)?o.createElement(io,{...t,ref:r,className:e}):a?o.createElement(N.Separator,{...t,ref:r,className:g("kui-ToolbarSeparator",e)}):o.createElement("div",{role:"separator","aria-orientation":"vertical","data-orientation":"vertical",...t,ref:r,className:g("kui-ToolbarSeparator",e)})});mo.displayName="Toolbar.Separator";var Co={1:"2",2:"3",3:"4",4:"5"},To=o.forwardRef(({className:e,children:t,style:r,id:a},s)=>{let i=o.useContext(M),n=L(void 0,x.size),l=i?.size??n,c=J(),d=Q(c),u=X(c),f=t==null||t===!1,b=f?d:t,y=vo(s,f?u:void 0);return b==null?null:o.createElement(eo,{ref:y,as:"span",size:Co[l],weight:"medium",truncate:!0,id:a,style:r,className:g("kui-ToolbarTitle",e),"data-mirror":f||void 0},b)});To.displayName="Toolbar.Title";var jo=Object.assign(H,{Root:H,Group:co,Button:A,Separator:mo,Title:To,Overflow:po,Slot:fo,Fill:bo});export{Ho as a,H as b,co as c,A as d,po as e,fo as f,bo as g,mo as h,To as i,jo as j};
|
|
3
|
+
//# sourceMappingURL=chunk-BR6Z2CAE.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{b as P}from"./chunk-G66WDIIV.js";import{h as p,i as b,k as M}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{b as P}from"./chunk-G66WDIIV.js";import{h as p,i as b,k as M}from"./chunk-5BXCPANF.js";import*as o from"react";var S=e=>e===void 0?void 0:e==="closed"?"collapsed":"expanded",f=e=>e==="collapsed"?"closed":"open",s=e=>e===void 0||e==="closed"?"collapsed":"expanded",l=e=>e==="left"?"rail":e;function v(e){let d=o.useCallback(r=>p(e,r),[e]);return o.useSyncExternalStore(d,()=>e.version,()=>0)}function V(){let e=M("useSidebarMode"),d=o.useCallback(t=>p(e,t),[e]),r=o.useSyncExternalStore(d,()=>e.entries.get("sidebar")?.value,()=>{}),i=o.useCallback(t=>{e.entries.get("sidebar")?.setValue(f(t),"toggle")},[e]);return{sidebarMode:S(r)??"expanded",setSidebarMode:i}}var g=()=>{};function x(){let e=M("useShell");o.useEffect(()=>{},[]),v(e);let{breakpoint:d,ready:r}=P(),i=o.useMemo(()=>{let n=a=>m=>e.entries.get(a)?.setValue(m==="collapsed"?"closed":"open","toggle"),u=a=>b(e,a===null?null:l(a));return{setLeftMode:n("rail"),setPanelMode:n("panel"),setInspectorMode:n("inspector"),setBottomMode:n("bottom"),setSidebarMode:a=>e.entries.get("sidebar")?.setValue(f(a),"toggle"),setPeekTarget:u,peekPane:a=>u(a),clearPeek:()=>u(null),setHasLeft:g,setHasSidebar:g,togglePane:a=>e.entries.get(l(a))?.toggle("toggle"),expandPane:a=>e.entries.get(l(a))?.setValue("open","toggle"),collapsePane:a=>e.entries.get(l(a))?.setValue("closed","toggle")}},[e]),t=n=>e.entries.get(n)?.value,c=e.entries.get("rail");return{leftMode:s(t("rail")),leftControlledOpen:c?.value===void 0?void 0:c.value!=="closed",panelMode:s(t("panel")),sidebarMode:S(t("sidebar"))??"expanded",inspectorMode:s(t("inspector")),bottomMode:s(t("bottom")),peekTarget:e.peek,hasLeft:e.entries.has("rail"),hasSidebar:e.entries.has("sidebar"),currentBreakpoint:d,currentBreakpointReady:r,leftResolvedPresentation:c?.presentation,...i}}export{V as a,x as b};
|
|
3
|
+
//# sourceMappingURL=chunk-INGT6DB6.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as F}from"./chunk-COLJWVN7.js";import{a as z,b as V,c as j}from"./chunk-TUZ665BA.js";import{a as O,b as U,c as q,e as C,f as $}from"./chunk-KBSH6CBD.js";import{a as E}from"./chunk-JFJV4HL3.js";import{b as L}from"./chunk-5KMEUZWN.js";import{d as H}from"./chunk-GKDGNPBD.js";import{a as W}from"./chunk-QPRUTOLI.js";import{b as y,c as K}from"./chunk-NFSW36RG.js";import{a as ue}from"./chunk-VQPANPMI.js";var fe={};ue(fe,{Group:()=>oe,GroupContent:()=>ie,GroupLabel:()=>ae,Menu:()=>Y,MenuButton:()=>T,MenuItem:()=>D,MenuSub:()=>ee,MenuSubContent:()=>re,MenuSubTrigger:()=>te,Search:()=>se,Separator:()=>Q});import*as e from"react";import d from"classnames";import*as f from"@radix-ui/react-accordion";var Q=e.forwardRef(({className:t,...r},n)=>e.createElement(F,{...r,ref:n,className:d("kui-SidebarSeparator",t)}));Q.displayName="Sidebar.Separator";var Y=e.forwardRef(({className:t,...r},n)=>e.createElement("ul",{...r,ref:n,className:d("kui-SidebarMenu",t)}));Y.displayName="Sidebar.Menu";var D=e.forwardRef(({className:t,...r},n)=>e.createElement("li",{...r,ref:n,className:d("kui-SidebarMenuItem",t)}));D.displayName="Sidebar.MenuItem";function A(t){if(typeof t=="function"){let r=t;return r.displayName||r.name}if(t&&typeof t=="object"){let r=t;return r.displayName||A(r.render)||A(r.type)}}function ce(t){return t.type==="svg"||t.props?.icon?!0:A(t.type)?.includes("Icon")??!1}function Z(t){return typeof t=="string"||typeof t=="number"}function de(t){let r=e.Children.toArray(t),n=[],o=[];for(let a of r)e.isValidElement(a)&&ce(a)?n.push(a):o.push(Z(a)?e.createElement("span",{key:o.length,className:"kui-SidebarMenuLabel"},a):a);return n.length===0&&r.length>1&&e.isValidElement(r[0])&&(n.push(r[0]),o.shift()),{icons:n,labels:o}}function pe(t){return e.Children.map(t,r=>Z(r)?e.createElement("span",{className:"kui-SidebarMenuLabel"},r):r)}function _(t){if(t.key!=="ArrowDown"&&t.key!=="ArrowUp")return;let r=t.currentTarget.closest(".kui-SidebarContent, .kui-SidebarSearchPopover"),n=r?Array.from(r.querySelectorAll(".kui-SidebarMenuButton")).filter(u=>u.offsetParent!==null):[],o=n.indexOf(t.currentTarget),a=n[o+(t.key==="ArrowDown"?1:-1)];o!==-1&&a&&(t.preventDefault(),a.focus())}var T=e.forwardRef(({asChild:t=!1,isActive:r=!1,shortcut:n,badge:o,className:a,children:u,onKeyDown:p,...s},l)=>{let c=y(),k=e.useContext(K),g=c?.size??k,M=c?.presentation==="thin",N=t?L:"button",P=i=>{p?.(i),i.defaultPrevented||_(i)},m=M?null:e.createElement(e.Fragment,null,o&&e.createElement("div",{className:"kui-SidebarMenuBadge"},typeof o=="string"?e.createElement(E,{size:g,variant:"soft"},o):e.createElement(E,{size:o.size||g,variant:o.variant||"soft",color:o.color,radius:o.radius},o.content)),n&&e.createElement("div",{className:"kui-BaseMenuShortcut kui-SidebarMenuShortcut"},e.createElement(W,{size:g},n))),h=i=>{if(M){let{icons:v,labels:w}=de(i);if(v.length>0)return e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-SidebarMenuIconWrapper"},v),w)}return e.createElement(e.Fragment,null,pe(i),m)},S;return t&&e.isValidElement(u)&&e.Children.count(u)===1?S=e.cloneElement(u,void 0,h(u.props.children)):t?S=u:S=h(u),e.createElement(N,{type:t?void 0:"button",...s,ref:l,"aria-current":r?"page":void 0,className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton",a),"data-active":r||void 0,onKeyDown:P},S)});T.displayName="Sidebar.MenuButton";var x=e.createContext("accordion"),ee=e.forwardRef(({defaultOpen:t=!1,children:r,...n},o)=>(y()?.presentation==="thin"?"dropdown":"accordion")==="dropdown"?e.createElement("div",{...n,ref:o},e.createElement(O,null,e.createElement(x.Provider,{value:"dropdown"},r))):e.createElement("div",{...n,ref:o},e.createElement(x.Provider,{value:"accordion"},e.createElement(f.Root,{type:"single",collapsible:!0,defaultValue:t?"item":void 0},e.createElement(f.Item,{value:"item"},r)))));ee.displayName="Sidebar.MenuSub";var te=e.forwardRef(({asChild:t=!1,className:r,children:n,onKeyDown:o,...a},u)=>e.useContext(x)==="dropdown"?e.createElement(U,null,e.createElement("button",{...a,onKeyDown:o,ref:u,type:"button","aria-haspopup":"menu",className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarMenuSubTrigger",r)},n)):e.createElement(f.Header,{asChild:!0},e.createElement("div",null,e.createElement(f.Trigger,{...a,onKeyDown:s=>{_(s),o?.(s)},ref:u,asChild:t,className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarMenuSubTrigger",r)},t?n:e.createElement(e.Fragment,null,n,e.createElement(H,{className:d("kui-BaseMenuSubTriggerIcon","kui-SidebarMenuSubTriggerIcon")}))))));te.displayName="Sidebar.MenuSubTrigger";function X(t,r){if(e.isValidElement(t)&&t.type===T){let{asChild:n,isActive:o,shortcut:a,badge:u,type:p,children:s,...l}=t.props,c={...l,"data-active":o||void 0,"aria-current":o?"page":void 0};return n&&e.isValidElement(s)&&e.Children.count(s)===1?e.createElement(C,{key:r,...c,asChild:!0},s):e.createElement(C,{key:r,...c},s)}return e.isValidElement(t)?e.createElement(C,{key:r,asChild:!0},t):e.createElement(C,{key:r},t)}function le(t){return e.Children.map(t,(r,n)=>e.isValidElement(r)&&r.type===T?e.createElement(D,{key:r.key??n},r):r)}var re=e.forwardRef(({className:t,children:r,...n},o)=>{let a=y();if(e.useContext(x)==="dropdown"){let p=e.Children.map(r,(s,l)=>{if(e.isValidElement(s)&&s.type===D){let c=e.Children.toArray(s.props.children);return X(c.length===1?c[0]:c,l)}return X(s,l)});return e.createElement(q,{...n,ref:o,size:a?.size,className:d(t)},e.createElement($,null,p))}return e.createElement(f.Content,{...n,ref:o,className:d("kui-SidebarMenuSubContent",t)},e.createElement("ul",{className:"kui-SidebarMenuSubList"},le(r)))});re.displayName="Sidebar.MenuSubContent";var ne=e.createContext(null),oe=e.forwardRef(({className:t,...r},n)=>{let o=e.useId(),[a,u]=e.useState(null),p=e.useMemo(()=>({labelId:o,setLabelId:u}),[o]);return e.createElement(ne.Provider,{value:p},e.createElement("div",{role:a?"group":void 0,"aria-labelledby":a??void 0,...r,ref:n,className:d("kui-BaseMenuGroup","kui-SidebarGroup",t)}))});oe.displayName="Sidebar.Group";var ae=e.forwardRef(({asChild:t=!1,className:r,id:n,...o},a)=>{let u=t?L:"div",p=e.useContext(ne),s=n??p?.labelId,l=p?.setLabelId;return e.useEffect(()=>{if(!(!l||!s))return l(s),()=>l(null)},[l,s]),e.createElement(u,{...o,id:s,ref:a,className:d("kui-BaseMenuLabel","kui-SidebarGroupLabel",r)})});ae.displayName="Sidebar.GroupLabel";var ie=e.forwardRef(({className:t,...r},n)=>e.createElement("div",{...r,ref:n,className:d("kui-SidebarGroupContent",t)}));ie.displayName="Sidebar.GroupContent";var B=({className:t})=>e.createElement("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e.createElement("circle",{cx:"11",cy:"11",r:"8"}),e.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),J=({className:t})=>e.createElement("svg",{className:t,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),se=e.forwardRef(({value:t,onValueChange:r,placeholder:n="Search...",children:o,className:a,...u},p)=>{let s=y(),l=s?.presentation==="thin",c=e.useRef(null),k=e.useRef(null),M=`${e.useId()}-results`,N=e.useRef(t);N.current=t;let P=e.useRef(r);P.current=r;let m=n.replace(/\.+$/,""),h=e.useCallback(i=>{i.key==="Escape"&&N.current&&(i.preventDefault(),i.stopPropagation(),P.current(""),c.current?.focus())},[]),S=e.useCallback(i=>{if(i.defaultPrevented)return;let v=k.current;if(!v)return;let w=v.querySelector('[role="group"]');if(!w)return;let b=Array.from(w.querySelectorAll("a, button"));if(b.length===0)return;let G=document.activeElement,I=G===c.current,R=b.indexOf(G);if(i.key.length===1&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&!I&&R!==-1){c.current?.focus();return}switch(i.key){case"ArrowDown":{i.preventDefault(),I||R===-1?b[0]?.focus():R<b.length-1&&b[R+1]?.focus();break}case"ArrowUp":{i.preventDefault(),R<=0?c.current?.focus():b[R-1]?.focus();break}case"Home":{I||(i.preventDefault(),b[0]?.focus());break}case"End":{I||(i.preventDefault(),b[b.length-1]?.focus());break}}},[]);return l?e.createElement("div",{...u,ref:p,className:d("kui-SidebarSearch","kui-SidebarSearch--thin",a)},e.createElement(z,null,e.createElement(V,null,e.createElement("button",{type:"button",className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarSearchTrigger"),"aria-label":m},e.createElement("span",{className:"kui-SidebarMenuIconWrapper"},e.createElement(B,null)),e.createElement("span",{className:"kui-SidebarMenuLabel"},"Search"))),e.createElement(j,{side:"right",align:"start",size:"2",width:"280px","aria-label":m},e.createElement("div",{ref:k,className:"kui-SidebarSearchPopover",role:"search",onKeyDown:S},e.createElement("div",{className:"kui-SidebarSearchInputWrapper"},e.createElement(B,{className:"kui-SidebarSearchIcon"}),e.createElement("input",{ref:c,type:"search",className:"kui-SidebarSearchInput",value:t,onChange:i=>r(i.target.value),onKeyDown:h,placeholder:n,"aria-label":m,"aria-controls":o?M:void 0,autoFocus:!0}),t&&e.createElement("button",{type:"button",className:"kui-reset kui-SidebarSearchClear",onClick:()=>{r(""),c.current?.focus()},"aria-label":"Clear search"},e.createElement(J,null))),o&&e.createElement("div",{id:M,role:"group","aria-label":"Search results"},o))))):e.createElement("div",{...u,ref:p,className:d("kui-SidebarSearch","kui-SidebarSearch--expanded","kui-ShellPaneChrome",`kui-r-size-${s?.size??"2"}`,a),role:"search"},e.createElement("div",{className:"kui-SidebarSearchInputWrapper"},e.createElement(B,{className:"kui-SidebarSearchIcon"}),e.createElement("input",{ref:c,type:"search",className:"kui-SidebarSearchInput",value:t,onChange:i=>r(i.target.value),onKeyDown:h,placeholder:n,"aria-label":m}),t&&e.createElement("button",{type:"button",className:"kui-reset kui-SidebarSearchClear",onClick:()=>{r(""),c.current?.focus()},"aria-label":"Clear search"},e.createElement(J,null))))});se.displayName="Sidebar.Search";export{Q as a,Y as b,D as c,T as d,ee as e,te as f,re as g,oe as h,ae as i,ie as j,se as k,fe as l};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as F}from"./chunk-COLJWVN7.js";import{a as z,b as V,c as j}from"./chunk-TUZ665BA.js";import{a as O,b as U,c as q,e as C,f as $}from"./chunk-KBSH6CBD.js";import{a as E}from"./chunk-JFJV4HL3.js";import{b as L}from"./chunk-5KMEUZWN.js";import{d as H}from"./chunk-GKDGNPBD.js";import{a as W}from"./chunk-QPRUTOLI.js";import{b as y,c as K}from"./chunk-ODHCDJ3Y.js";import{a as ue}from"./chunk-VQPANPMI.js";var fe={};ue(fe,{Group:()=>oe,GroupContent:()=>ie,GroupLabel:()=>ae,Menu:()=>Y,MenuButton:()=>T,MenuItem:()=>D,MenuSub:()=>ee,MenuSubContent:()=>re,MenuSubTrigger:()=>te,Search:()=>se,Separator:()=>Q});import*as e from"react";import d from"classnames";import*as f from"@radix-ui/react-accordion";var Q=e.forwardRef(({className:t,...r},n)=>e.createElement(F,{...r,ref:n,className:d("kui-SidebarSeparator",t)}));Q.displayName="Sidebar.Separator";var Y=e.forwardRef(({className:t,...r},n)=>e.createElement("ul",{...r,ref:n,className:d("kui-SidebarMenu",t)}));Y.displayName="Sidebar.Menu";var D=e.forwardRef(({className:t,...r},n)=>e.createElement("li",{...r,ref:n,className:d("kui-SidebarMenuItem",t)}));D.displayName="Sidebar.MenuItem";function A(t){if(typeof t=="function"){let r=t;return r.displayName||r.name}if(t&&typeof t=="object"){let r=t;return r.displayName||A(r.render)||A(r.type)}}function ce(t){return t.type==="svg"||t.props?.icon?!0:A(t.type)?.includes("Icon")??!1}function Z(t){return typeof t=="string"||typeof t=="number"}function de(t){let r=e.Children.toArray(t),n=[],o=[];for(let a of r)e.isValidElement(a)&&ce(a)?n.push(a):o.push(Z(a)?e.createElement("span",{key:o.length,className:"kui-SidebarMenuLabel"},a):a);return n.length===0&&r.length>1&&e.isValidElement(r[0])&&(n.push(r[0]),o.shift()),{icons:n,labels:o}}function pe(t){return e.Children.map(t,r=>Z(r)?e.createElement("span",{className:"kui-SidebarMenuLabel"},r):r)}function _(t){if(t.key!=="ArrowDown"&&t.key!=="ArrowUp")return;let r=t.currentTarget.closest(".kui-SidebarContent, .kui-SidebarSearchPopover"),n=r?Array.from(r.querySelectorAll(".kui-SidebarMenuButton")).filter(u=>u.offsetParent!==null):[],o=n.indexOf(t.currentTarget),a=n[o+(t.key==="ArrowDown"?1:-1)];o!==-1&&a&&(t.preventDefault(),a.focus())}var T=e.forwardRef(({asChild:t=!1,isActive:r=!1,shortcut:n,badge:o,className:a,children:u,onKeyDown:p,...s},l)=>{let c=y(),k=e.useContext(K),g=c?.size??k,M=c?.presentation==="thin",N=t?L:"button",P=i=>{p?.(i),i.defaultPrevented||_(i)},m=M?null:e.createElement(e.Fragment,null,o&&e.createElement("div",{className:"kui-SidebarMenuBadge"},typeof o=="string"?e.createElement(E,{size:g,variant:"soft"},o):e.createElement(E,{size:o.size||g,variant:o.variant||"soft",color:o.color,radius:o.radius},o.content)),n&&e.createElement("div",{className:"kui-BaseMenuShortcut kui-SidebarMenuShortcut"},e.createElement(W,{size:g},n))),h=i=>{if(M){let{icons:v,labels:w}=de(i);if(v.length>0)return e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-SidebarMenuIconWrapper"},v),w)}return e.createElement(e.Fragment,null,pe(i),m)},S;return t&&e.isValidElement(u)&&e.Children.count(u)===1?S=e.cloneElement(u,void 0,h(u.props.children)):t?S=u:S=h(u),e.createElement(N,{type:t?void 0:"button",...s,ref:l,"aria-current":r?"page":void 0,className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton",a),"data-active":r||void 0,onKeyDown:P},S)});T.displayName="Sidebar.MenuButton";var x=e.createContext("accordion"),ee=e.forwardRef(({defaultOpen:t=!1,children:r,...n},o)=>(y()?.presentation==="thin"?"dropdown":"accordion")==="dropdown"?e.createElement("div",{...n,ref:o},e.createElement(O,null,e.createElement(x.Provider,{value:"dropdown"},r))):e.createElement("div",{...n,ref:o},e.createElement(x.Provider,{value:"accordion"},e.createElement(f.Root,{type:"single",collapsible:!0,defaultValue:t?"item":void 0},e.createElement(f.Item,{value:"item"},r)))));ee.displayName="Sidebar.MenuSub";var te=e.forwardRef(({asChild:t=!1,className:r,children:n,onKeyDown:o,...a},u)=>e.useContext(x)==="dropdown"?e.createElement(U,null,e.createElement("button",{...a,onKeyDown:o,ref:u,type:"button","aria-haspopup":"menu",className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarMenuSubTrigger",r)},n)):e.createElement(f.Header,{asChild:!0},e.createElement("div",null,e.createElement(f.Trigger,{...a,onKeyDown:s=>{_(s),o?.(s)},ref:u,asChild:t,className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarMenuSubTrigger",r)},t?n:e.createElement(e.Fragment,null,n,e.createElement(H,{className:d("kui-BaseMenuSubTriggerIcon","kui-SidebarMenuSubTriggerIcon")}))))));te.displayName="Sidebar.MenuSubTrigger";function X(t,r){if(e.isValidElement(t)&&t.type===T){let{asChild:n,isActive:o,shortcut:a,badge:u,type:p,children:s,...l}=t.props,c={...l,"data-active":o||void 0,"aria-current":o?"page":void 0};return n&&e.isValidElement(s)&&e.Children.count(s)===1?e.createElement(C,{key:r,...c,asChild:!0},s):e.createElement(C,{key:r,...c},s)}return e.isValidElement(t)?e.createElement(C,{key:r,asChild:!0},t):e.createElement(C,{key:r},t)}function le(t){return e.Children.map(t,(r,n)=>e.isValidElement(r)&&r.type===T?e.createElement(D,{key:r.key??n},r):r)}var re=e.forwardRef(({className:t,children:r,...n},o)=>{let a=y();if(e.useContext(x)==="dropdown"){let p=e.Children.map(r,(s,l)=>{if(e.isValidElement(s)&&s.type===D){let c=e.Children.toArray(s.props.children);return X(c.length===1?c[0]:c,l)}return X(s,l)});return e.createElement(q,{...n,ref:o,size:a?.size,className:d(t)},e.createElement($,null,p))}return e.createElement(f.Content,{...n,ref:o,className:d("kui-SidebarMenuSubContent",t)},e.createElement("ul",{className:"kui-SidebarMenuSubList"},le(r)))});re.displayName="Sidebar.MenuSubContent";var ne=e.createContext(null),oe=e.forwardRef(({className:t,...r},n)=>{let o=e.useId(),[a,u]=e.useState(null),p=e.useMemo(()=>({labelId:o,setLabelId:u}),[o]);return e.createElement(ne.Provider,{value:p},e.createElement("div",{role:a?"group":void 0,"aria-labelledby":a??void 0,...r,ref:n,className:d("kui-BaseMenuGroup","kui-SidebarGroup",t)}))});oe.displayName="Sidebar.Group";var ae=e.forwardRef(({asChild:t=!1,className:r,id:n,...o},a)=>{let u=t?L:"div",p=e.useContext(ne),s=n??p?.labelId,l=p?.setLabelId;return e.useEffect(()=>{if(!(!l||!s))return l(s),()=>l(null)},[l,s]),e.createElement(u,{...o,id:s,ref:a,className:d("kui-BaseMenuLabel","kui-SidebarGroupLabel",r)})});ae.displayName="Sidebar.GroupLabel";var ie=e.forwardRef(({className:t,...r},n)=>e.createElement("div",{...r,ref:n,className:d("kui-SidebarGroupContent",t)}));ie.displayName="Sidebar.GroupContent";var B=({className:t})=>e.createElement("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e.createElement("circle",{cx:"11",cy:"11",r:"8"}),e.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),J=({className:t})=>e.createElement("svg",{className:t,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),se=e.forwardRef(({value:t,onValueChange:r,placeholder:n="Search...",children:o,className:a,...u},p)=>{let s=y(),l=s?.presentation==="thin",c=e.useRef(null),k=e.useRef(null),M=`${e.useId()}-results`,N=e.useRef(t);N.current=t;let P=e.useRef(r);P.current=r;let m=n.replace(/\.+$/,""),h=e.useCallback(i=>{i.key==="Escape"&&N.current&&(i.preventDefault(),i.stopPropagation(),P.current(""),c.current?.focus())},[]),S=e.useCallback(i=>{if(i.defaultPrevented)return;let v=k.current;if(!v)return;let w=v.querySelector('[role="group"]');if(!w)return;let b=Array.from(w.querySelectorAll("a, button"));if(b.length===0)return;let G=document.activeElement,I=G===c.current,R=b.indexOf(G);if(i.key.length===1&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&!I&&R!==-1){c.current?.focus();return}switch(i.key){case"ArrowDown":{i.preventDefault(),I||R===-1?b[0]?.focus():R<b.length-1&&b[R+1]?.focus();break}case"ArrowUp":{i.preventDefault(),R<=0?c.current?.focus():b[R-1]?.focus();break}case"Home":{I||(i.preventDefault(),b[0]?.focus());break}case"End":{I||(i.preventDefault(),b[b.length-1]?.focus());break}}},[]);return l?e.createElement("div",{...u,ref:p,className:d("kui-SidebarSearch","kui-SidebarSearch--thin",a)},e.createElement(z,null,e.createElement(V,null,e.createElement("button",{type:"button",className:d("kui-reset","kui-BaseMenuItem","kui-SidebarMenuButton","kui-SidebarSearchTrigger"),"aria-label":m},e.createElement("span",{className:"kui-SidebarMenuIconWrapper"},e.createElement(B,null)),e.createElement("span",{className:"kui-SidebarMenuLabel"},"Search"))),e.createElement(j,{side:"right",align:"start",size:"2",width:"280px","aria-label":m},e.createElement("div",{ref:k,className:"kui-SidebarSearchPopover",role:"search",onKeyDown:S},e.createElement("div",{className:"kui-SidebarSearchInputWrapper"},e.createElement(B,{className:"kui-SidebarSearchIcon"}),e.createElement("input",{ref:c,type:"search",className:"kui-SidebarSearchInput",value:t,onChange:i=>r(i.target.value),onKeyDown:h,placeholder:n,"aria-label":m,"aria-controls":o?M:void 0,autoFocus:!0}),t&&e.createElement("button",{type:"button",className:"kui-reset kui-SidebarSearchClear",onClick:()=>{r(""),c.current?.focus()},"aria-label":"Clear search"},e.createElement(J,null))),o&&e.createElement("div",{id:M,role:"group","aria-label":"Search results"},o))))):e.createElement("div",{...u,ref:p,className:d("kui-SidebarSearch","kui-SidebarSearch--expanded","kui-ShellPaneChrome",`kui-r-size-${s?.size??"2"}`,a),role:"search"},e.createElement("div",{className:"kui-SidebarSearchInputWrapper"},e.createElement(B,{className:"kui-SidebarSearchIcon"}),e.createElement("input",{ref:c,type:"search",className:"kui-SidebarSearchInput",value:t,onChange:i=>r(i.target.value),onKeyDown:h,placeholder:n,"aria-label":m}),t&&e.createElement("button",{type:"button",className:"kui-reset kui-SidebarSearchClear",onClick:()=>{r(""),c.current?.focus()},"aria-label":"Clear search"},e.createElement(J,null))))});se.displayName="Sidebar.Search";export{Q as a,Y as b,D as c,T as d,ee as e,te as f,re as g,oe as h,ae as i,ie as j,se as k,fe as l};
|
|
3
|
+
//# sourceMappingURL=chunk-J6B7UCZN.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{b as H,d as U,g as D}from"./chunk-XUCR7L4G.js";import{a as V,c as m}from"./chunk-3QWGSRYC.js";import{a as k,b as N,c as w}from"./chunk-KGCGT4MJ.js";import{a as B,b as I,c as A}from"./chunk-QKCNGEX4.js";import{a as T}from"./chunk-WEBNIUEX.js";import{a as y}from"./chunk-G66WDIIV.js";import{b as M}from"./chunk-VWRPVM5K.js";import{f as E}from"./chunk-ODHCDJ3Y.js";import{o as x}from"./chunk-5BXCPANF.js";import*as e from"react";import ue from"classnames";import{useComposedRefs as Se}from"radix-ui/internal";var L=t=>t==="collapsed"?"closed":"open",ce=t=>t==="closed"?"collapsed":"expanded";function O(t){if(t===void 0)return;if(typeof t=="string")return L(t);let n={};for(let[r,i]of Object.entries(t))i!==void 0&&(n[r]=L(i));return n}var me={controlled:"state",default:"defaultState"},be={initial:"overlay",sm:"fixed"},_=e.forwardRef((t,n)=>{let{className:r,presentation:i=be,expandedSize:o=288,minSize:s=200,maxSize:d=400,resizable:b=!1,collapsible:$=!0,onExpand:F,onCollapse:W,onResize:j,onResizeStart:q,onResizeEnd:G,snapPoints:l,snapTolerance:K,collapseThreshold:p,paneId:u,persistence:S,children:J,style:Q,state:X,defaultState:Y,onStateChange:Z,size:f,defaultSize:P,onSizeChange:ee,sizeUpdate:ae,sizeUpdateMs:te=50,flush:h=!0,id:ne,...c}=t,{table:g,attributes:ie}=w(i,"fixed"),a=k({name:"sidebar",label:"Sidebar",propNames:me,id:ne,controlled:O(X),defaultValue:O(Y),presentationTable:g,builtIn:H,onChange:(le,pe)=>Z?.(ce(le),{reason:pe}),onExpand:F,onCollapse:W,size:o});x("sidebar",h),e.useEffect(()=>{(l!==void 0||p!==void 0||u!==void 0||S!==void 0)&&void 0},[l,p,u,S]);let z=e.useRef(null),oe=Se(n,a.setElement,z),re=I({name:"sidebar",elementId:a.id,elementRef:z,cssVarName:"--sidebar-size",orientation:"vertical",edge:"end",growth:U,expandedSize:o,minSize:s,maxSize:d,resizable:b,collapsible:$,size:f,defaultSize:P,onSizeChange:ee,sizeUpdate:ae,sizeUpdateMs:te,onResize:j,onResizeStart:q,onResizeEnd:G,snapPoints:l,snapTolerance:K,collapseThreshold:p,paneId:u,persistence:S,overlaying:a.overlaying,overlayingNow:()=>g[y()]==="overlay",requestCollapse:()=>a.setValue("closed","toggle"),requestToggle:()=>a.toggle("toggle")}),{handles:v,content:se}=A(J,m),de=b&&a.value!=="closed"&&!a.overlaying?e.createElement(T.Provider,{value:re},v.length>0?v:e.createElement(V,null)):null,R=a.peeking?`var(--sidebar-size, ${o}px)`:void 0,C=B(f,P,s,d);return e.createElement("div",{...D(c),role:c.role??"navigation",id:a.id,ref:oe,className:ue("kui-ShellPane","kui-ShellSidebar",r),...N(a,ie),"data-flush":h||void 0,tabIndex:a.overlaying?-1:c.tabIndex,style:{...Q,"--sidebar-expanded-size":`${o}px`,...C?{"--sidebar-size":C}:{},"--sidebar-min-size":`${s}px`,"--sidebar-max-size":`${d}px`,...R?{"--peek-sidebar-width":R}:{}}},e.createElement("div",{className:"kui-ShellSidebarContent"},e.createElement(E,null,e.createElement(M,null,se))),de)});_.displayName="Shell.Sidebar";_.Handle=m;export{_ as a};
|
|
3
|
+
//# sourceMappingURL=chunk-KDJM4NQQ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/_internal/shell-sidebar.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposedRefs } from 'radix-ui/internal';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { PaneHandle, SidebarHandle } from './shell-handles.js';\nimport { usePane, paneAttributes, usePresentationTable } from './shell-pane.js';\nimport { splitHandles, useInitialPaneSize, useResizablePane, type SizeChangeMeta } from './shell-resizable.js';\nimport { useFrameRegistration, warnOnce, type PaneValue } from './shell-store.js';\nimport { navigationRest, startAnchoredGrowth, withoutRemovedPaneProps } from './shell-rest.js';\nimport { readBreakpoint } from '../../hooks/use-breakpoint.js';\nimport { PaneChromeScope } from './pane-chrome.js';\nimport { PageScope } from './page-scope.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, Responsive, SidebarMode } from '../shell.types.js';\n\ntype SidebarStateChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'dismiss' };\ntype SidebarControlledProps = { state: Responsive<SidebarMode>; onStateChange?: (state: SidebarMode, meta: SidebarStateChangeMeta) => void; defaultState?: never };\ntype SidebarUncontrolledProps = { defaultState?: SidebarMode | Partial<Record<Breakpoint, SidebarMode>>; onStateChange?: (state: SidebarMode, meta: SidebarStateChangeMeta) => void; state?: never };\ntype SidebarPublicProps = PaneBaseProps & {\n size?: number | string;\n defaultSize?: number | string;\n onSizeChange?: (size: number, meta: SizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n} & (SidebarControlledProps | SidebarUncontrolledProps);\n\ntype SidebarComponent = React.ForwardRefExoticComponent<SidebarPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof SidebarHandle };\n\nconst toValue = (mode: SidebarMode): PaneValue => (mode === 'collapsed' ? 'closed' : 'open');\nconst toMode = (value: PaneValue): SidebarMode => (value === 'closed' ? 'collapsed' : 'expanded');\n\nfunction modeToValue(state: Responsive<SidebarMode> | undefined): PaneValue | Partial<Record<Breakpoint, PaneValue>> | undefined {\n if (state === undefined) return undefined;\n if (typeof state === 'string') return toValue(state);\n const map: Partial<Record<Breakpoint, PaneValue>> = {};\n for (const [bp, mode] of Object.entries(state) as Array<[Breakpoint, SidebarMode | undefined]>) {\n if (mode !== undefined) map[bp] = toValue(mode);\n }\n return map;\n}\n\nconst SIDEBAR_PROP_NAMES = { controlled: 'state', default: 'defaultState' };\n\n/** Since 0.8.0 the Sidebar is in the frame from 768px up, the boundary kookie-ui-v2 uses everywhere. It was 1024px. */\nconst SIDEBAR_DEFAULT_PRESENTATION = { initial: 'overlay', sm: 'fixed' } as const;\n\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, SidebarPublicProps>((props, ref) => {\n const {\n className,\n presentation = SIDEBAR_DEFAULT_PRESENTATION,\n expandedSize = 288,\n minSize = 200,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n state,\n defaultState,\n onStateChange,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n flush = true,\n id,\n ...domProps\n } = props;\n\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'sidebar',\n label: 'Sidebar',\n propNames: SIDEBAR_PROP_NAMES,\n id,\n controlled: modeToValue(state),\n defaultValue: modeToValue(defaultState),\n presentationTable: table,\n builtIn: navigationRest,\n onChange: (value, reason) => onStateChange?.(toMode(value), { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useFrameRegistration('sidebar', flush);\n\n React.useEffect(() => {\n if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {\n warnOnce('Shell.Sidebar: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');\n }\n }, [snapPoints, collapseThreshold, paneId, persistence]);\n\n const elementRef = React.useRef<HTMLElement | null>(null);\n const composedRef = useComposedRefs(ref, pane.setElement, elementRef);\n\n const resize = useResizablePane({\n name: 'sidebar',\n elementId: pane.id,\n elementRef,\n cssVarName: '--sidebar-size',\n orientation: 'vertical',\n edge: 'end',\n growth: startAnchoredGrowth,\n expandedSize,\n minSize,\n maxSize,\n resizable,\n collapsible,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n overlaying: pane.overlaying,\n overlayingNow: () => table[readBreakpoint()] === 'overlay',\n requestCollapse: () => pane.setValue('closed', 'toggle'),\n requestToggle: () => pane.toggle('toggle'),\n });\n\n const { handles, content } = splitHandles(children, SidebarHandle);\n const handle =\n resizable && pane.value !== 'closed' && !pane.overlaying ? (\n <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider>\n ) : null;\n\n // A peek previews the width the next toggle opens to.\n const peekWidth = pane.peeking ? `var(--sidebar-size, ${expandedSize}px)` : undefined;\n\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n return (\n <div\n {...withoutRemovedPaneProps(domProps)}\n role={domProps.role ?? 'navigation'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellSidebar', className)}\n {...paneAttributes(pane, attributes)}\n data-flush={flush || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--sidebar-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--sidebar-size': initialSize } : {}),\n '--sidebar-min-size': `${minSize}px`,\n '--sidebar-max-size': `${maxSize}px`,\n ...(peekWidth ? { '--peek-sidebar-width': peekWidth } : {}),\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellSidebarContent\">\n <PaneChromeScope>\n <PageScope>{content}</PageScope>\n </PaneChromeScope>\n </div>\n {handle}\n </div>\n );\n}) as SidebarComponent;\n\nSidebar.displayName = 'Shell.Sidebar';\nSidebar.Handle = SidebarHandle;\n\nexport type { SidebarPublicProps };\n"],
|
|
5
|
+
"mappings": ";yZAEA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,OAAS,mBAAAC,OAAuB,oBAgChC,IAAMC,EAAWC,GAAkCA,IAAS,YAAc,SAAW,OAC/EC,GAAUC,GAAmCA,IAAU,SAAW,YAAc,WAEtF,SAASC,EAAYC,EAA4G,CAC/H,GAAIA,IAAU,OAAW,OACzB,GAAI,OAAOA,GAAU,SAAU,OAAOL,EAAQK,CAAK,EACnD,IAAMC,EAA8C,CAAC,EACrD,OAAW,CAACC,EAAIN,CAAI,IAAK,OAAO,QAAQI,CAAK,EACvCJ,IAAS,SAAWK,EAAIC,CAAE,EAAIP,EAAQC,CAAI,GAEhD,OAAOK,CACT,CAEA,IAAME,GAAqB,CAAE,WAAY,QAAS,QAAS,cAAe,EAGpEC,GAA+B,CAAE,QAAS,UAAW,GAAI,OAAQ,EAG1DC,EAAgB,aAA+C,CAACC,EAAOC,IAAQ,CAC1F,GAAM,CACJ,UAAAC,EACA,aAAAC,EAAeL,GACf,aAAAM,EAAe,IACf,QAAAC,EAAU,IACV,QAAAC,EAAU,IACV,UAAAC,EAAY,GACZ,YAAAC,EAAc,GACd,SAAAC,EACA,WAAAC,EACA,SAAAC,EACA,cAAAC,EACA,YAAAC,EACA,WAAAC,EACA,cAAAC,EACA,kBAAAC,EACA,OAAAC,EACA,YAAAC,EACA,SAAAC,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EACvD,cAAe,IAAMA,EAAK,OAAO,QAAQ,CAC3C,CAAC,EAEK,CAAE,QAAAY,EAAS,QAAAC,EAAQ,EAAIC,EAAa7B,EAAU8B,CAAa,EAC3DC,GACJ3C,GAAa2B,EAAK,QAAU,UAAY,CAACA,EAAK,WAC5C,gBAACiB,EAAkB,SAAlB,CAA2B,MAAOT,IAASI,EAAQ,OAAS,EAAIA,EAAU,gBAACM,EAAA,IAAW,CAAG,EACxF,KAGAC,EAAYnB,EAAK,QAAU,uBAAuB9B,CAAY,MAAQ,OAEtEkD,EAAcC,EAAmBhC,EAAMC,EAAanB,EAASC,CAAO,EAC1E,OACE,gBAAC,OACE,GAAGkD,EAAwB1B,CAAQ,EACpC,KAAMA,EAAS,MAAQ,aACvB,GAAII,EAAK,GACT,IAAKM,GACL,UAAWiB,GAAW,gBAAiB,mBAAoBvD,CAAS,EACnE,GAAGwD,EAAexB,EAAMF,EAAU,EACnC,aAAYJ,GAAS,OACrB,SAAUM,EAAK,WAAa,GAAKJ,EAAS,SAC1C,MACE,CACE,GAAGV,EACH,0BAA2B,GAAGhB,CAAY,KAC1C,GAAIkD,EAAc,CAAE,iBAAkBA,CAAY,EAAI,CAAC,EACvD,qBAAsB,GAAGjD,CAAO,KAChC,qBAAsB,GAAGC,CAAO,KAChC,GAAI+C,EAAY,CAAE,uBAAwBA,CAAU,EAAI,CAAC,CAC3D,GAGF,gBAAC,OAAI,UAAU,2BACb,gBAACM,EAAA,KACC,gBAACC,EAAA,KAAWb,EAAQ,CACtB,CACF,EACCG,EACH,CAEJ,CAAC,EAEDnD,EAAQ,YAAc,gBACtBA,EAAQ,OAASkD",
|
|
6
|
+
"names": ["React", "classNames", "useComposedRefs", "toValue", "mode", "toMode", "value", "modeToValue", "state", "map", "bp", "SIDEBAR_PROP_NAMES", "SIDEBAR_DEFAULT_PRESENTATION", "Sidebar", "props", "ref", "className", "presentation", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "defaultState", "onStateChange", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "flush", "id", "domProps", "table", "attributes", "usePresentationTable", "pane", "usePane", "navigationRest", "reason", "useFrameRegistration", "elementRef", "composedRef", "useComposedRefs", "resize", "useResizablePane", "startAnchoredGrowth", "readBreakpoint", "handles", "content", "splitHandles", "SidebarHandle", "handle", "PaneResizeContext", "PaneHandle", "peekWidth", "initialSize", "useInitialPaneSize", "withoutRemovedPaneProps", "classNames", "paneAttributes", "PaneChromeScope", "PageScope"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as O,b as _}from"./chunk-G66WDIIV.js";import{a as C,b,c as $,d as B,g as M,k as q,m as F}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as O,b as _}from"./chunk-G66WDIIV.js";import{a as C,b,c as $,d as B,g as M,k as q,m as F}from"./chunk-5BXCPANF.js";import*as t from"react";import{useLayoutEffect as v}from"radix-ui/internal";var I=e=>typeof e=="object"&&e!==null;function ne(e){for(let a of["initial","xs","sm","md","lg","xl"]){let l=e[a];if(l!==void 0)return l}return"closed"}function re(e){let{name:a,label:l,propNames:o,presentationTable:r,builtIn:m}=e,d=q(`Shell.${l}`),G=t.useId(),k=e.id??`shell-${a}${G}`,c=e.controlled!==void 0,x=I(e.controlled);x&&(`${l}${o.controlled}${o.default}`,void 0);let p=x?e.controlled:void 0,z=p??(I(e.defaultValue)?e.defaultValue:void 0),J=B(z),[Q,W]=t.useState(()=>typeof e.defaultValue=="string"?e.defaultValue:"auto"),P=t.useMemo(()=>p?C(p,()=>ne(p)):C(z,n=>m(r[n])),[J,x,r,m]),u=Q;c&&(u=p?"auto":e.controlled);let X=b(r)===void 0||u==="auto"&&b(P)===void 0,{breakpoint:H,ready:L}=_(X),j=n=>{let f=b(n);return f!==void 0?f:L?n[H]:void 0},i=u==="auto"?j(P):u,y=j(r),E=y==="overlay",s=i===void 0?void 0:i!=="closed",N=s===!0&&E,D=e.defaultValue,V=t.useRef({state:u,value:i,autoTable:P,defaultValue:D,controlled:c,onChange:e.onChange,toggleNext:e.toggleNext});v(()=>{V.current={state:u,value:i,autoTable:P,defaultValue:D,controlled:c,onChange:e.onChange,toggleNext:e.toggleNext}});let h=t.useCallback(()=>{let n=V.current;return n.value!==void 0?n.value:n.state==="auto"?n.autoTable[O()]:void 0},[]),T=t.useCallback(()=>{let n=V.current;return typeof n.defaultValue=="string"?n.defaultValue:I(n.defaultValue)?n.autoTable[O()]:void 0},[]),g=t.useCallback((n,f)=>{let R=V.current;h()!==n&&(R.onChange?.(n,f),R.controlled||W(n))},[h]),w=t.useCallback(n=>{let f=V.current,R=h()??"closed",ee=f.toggleNext?f.toggleNext(R,T()):R==="closed"?"open":"closed";g(ee,n)},[g,h,T]),A=t.useRef(null),Y=t.useCallback(n=>{A.current=n},[]);v(()=>{let n={name:a,id:k,el:A.current,value:i,presentation:y,presentationTable:r,overlayLive:N,size:e.size,setValue:g,toggle:w};return d.entries.set(a,n),M(d),()=>{d.entries.get(a)===n&&(d.entries.delete(a),M(d))}},[d,a,k,i,y,r,N,e.size,g,w]);let S=t.useRef({onExpand:e.onExpand,onCollapse:e.onCollapse});v(()=>{S.current={onExpand:e.onExpand,onCollapse:e.onCollapse}});let K=t.useRef({state:u,shown:s});t.useEffect(()=>{let n=K.current;n.state!==u&&n.shown!==void 0&&s!==void 0&&n.shown!==s&&(s?S.current.onExpand?.():S.current.onCollapse?.()),K.current={state:u,shown:s}},[u,s]),v(()=>{},[]);let U=t.useRef(c);t.useEffect(()=>{},[c,l,o.controlled]);let Z=F(d,a)&&s===!1&&!E;return{store:d,id:k,state:u,value:i,shown:s,presentation:y,overlaying:E,overlayLive:N,peeking:Z,ready:L,breakpoint:H,autoTable:P,setValue:g,toggle:w,defaultHereNow:T,setElement:Y}}function ue(e,a){let{state:l,value:o,presentation:r,shown:m}=e;return{...a,"data-state":l,...l==="auto"?$("auto",e.autoTable):{},"data-presentation":r,"data-mode":o===void 0?void 0:o==="closed"?"collapsed":"expanded","data-open":r==="stacked"&&m?"":void 0,"data-peek":e.peeking?"":void 0}}function se(e,a){let l=B(e),o=t.useMemo(()=>C(e,()=>a),[l,a]),r=t.useMemo(()=>b(o)===void 0?$("presentation",o):{},[o]);return{table:o,attributes:r}}export{re as a,ue as b,se as c};
|
|
3
|
+
//# sourceMappingURL=chunk-KGCGT4MJ.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as Ye,b as Xe}from"./chunk-INGT6DB6.js";import{a as Je}from"./chunk-B447PNRD.js";import{a as Ge}from"./chunk-KDJM4NQQ.js";import{a as Ke}from"./chunk-UMQOTGJC.js";import{a as je}from"./chunk-XD676L6S.js";import{a as J,b as _e,c as Ue,d as qe,g as $e}from"./chunk-XUCR7L4G.js";import{a as Ie,b as Pe}from"./chunk-3QWGSRYC.js";import{a as he,b as ve,c as Se}from"./chunk-KGCGT4MJ.js";import{a as Be,b as Ve,c as We}from"./chunk-QKCNGEX4.js";import{a as De}from"./chunk-WEBNIUEX.js";import{b as ye}from"./chunk-5ON3XLRD.js";import{a as Le}from"./chunk-G66WDIIV.js";import{b as ie}from"./chunk-VWRPVM5K.js";import{c as pe,d as fe,e as Fe,f as me,i as Ae,j as Ne,k as Oe}from"./chunk-ODHCDJ3Y.js";import{c as ke,d as we}from"./chunk-QEDKL23P.js";import{e as ce,f as Me,h as ze,i as ne,j as He,k as ue,l as de,n as xe,o as oe}from"./chunk-5BXCPANF.js";import{a as Te}from"./chunk-ANQLWGFN.js";import{a as it}from"./chunk-VQPANPMI.js";var ht={};it(ht,{Bottom:()=>Ke,Content:()=>rt,Header:()=>ot,Inspector:()=>je,Left:()=>lt,PaneFooter:()=>Ne,PaneHeader:()=>Ae,Panel:()=>Ee,Rail:()=>at,Root:()=>nt,Scroll:()=>Oe,Sidebar:()=>Ge,Trigger:()=>st,useResponsivePresentation:()=>Je,useShell:()=>Xe,useSidebarMode:()=>Ye});import*as e from"react";import $ from"classnames";import{Slot as ct}from"radix-ui";import{useComposedRefs as Ce,useLayoutEffect as ut}from"radix-ui/internal";var Re=0;function Qe(a){Re=Math.max(0,Re+a);let r=document.documentElement;Re>0?r.setAttribute("data-kui-shell-lock",""):r.removeAttribute("data-kui-shell-lock")}var ge="data-kui-shell-inert",dt=30;function Q(a,r){return r===null||r===a||r===a.body||r===a.documentElement}function Ze(a,r,s){for(let d of a.querySelectorAll("[data-shell-trigger][aria-controls]"))if(!(d.getAttribute("aria-controls")!==r||d.closest("[inert]"))&&!(s&&!s.some(S=>S.contains(d))))return d;return null}var pt={values:["1","2","3"]},tt=e.createContext(null),et=64;function be(a){return a.querySelector(":scope > .kui-ShellContent > .kui-ShellScroll > .kui-ScrollAreaViewport")??a.querySelector(":scope > .kui-ShellContent")}var nt=e.forwardRef(({className:a,children:r,height:s="full",contained:d,size:S,style:x,onKeyDown:g,onFocus:k,...w},L)=>{let P=ye(S,pt),[i]=e.useState(Me),C=e.useCallback(t=>ze(i,t),[i]);e.useSyncExternalStore(C,()=>i.version,()=>0);let R=e.useRef(null),I=Ce(L,R),[T,F]=e.useState(()=>new Set),A=e.useCallback(t=>{F(n=>n.has(t)?n:new Set(n).add(t))},[]),f=e.useCallback(t=>{F(n=>{if(!n.has(t))return n;let o=new Set(n);return o.delete(t),o})},[]),m=e.useMemo(()=>({registerOffFrame:A,unregisterOffFrame:f}),[A,f]),N=e.useCallback(()=>{for(let t of i.entries.values())t.overlayLive&&t.setValue("closed","dismiss")},[i]),M=e.useCallback(()=>[...i.entries.values()].filter(t=>t.overlayLive&&t.el).map(t=>({name:t.name,id:t.id,el:t.el})),[i]),E=[...i.entries.values()].filter(t=>t.overlayLive&&t.el).length,O=d===!0||s!=="full"&&s!=="auto",V=!O&&s==="full",[Z,le]=e.useState(void 0);e.useEffect(()=>{if(!V)return;let t=R.current,n=t?.ownerDocument.defaultView;if(!t||!n||typeof n.matchMedia!="function")return;let o=ke(),c=o?n.scrollY:be(t)?.scrollTop??0,h=0,v=0,y=()=>{v&&cancelAnimationFrame(v),v=requestAnimationFrame(()=>{v=0})},U=()=>{o&&!v&&(c=n.scrollY)},q=l=>{!o&&!v&&l.target instanceof HTMLElement&&l.target===be(t)&&(c=l.target.scrollTop)};n.addEventListener("resize",y),n.addEventListener("scroll",U,{passive:!0}),t.addEventListener("scroll",q,{passive:!0,capture:!0});let se=we(l=>{o=l;let u=c;h&&cancelAnimationFrame(h),h=requestAnimationFrame(()=>{if(h=0,l)n.scrollTo(0,u);else{let p=be(t);p&&(p.scrollTop=u)}})});return()=>{h&&cancelAnimationFrame(h),v&&cancelAnimationFrame(v),n.removeEventListener("resize",y),n.removeEventListener("scroll",U),t.removeEventListener("scroll",q,{capture:!0}),se()}},[V]);let K=e.useCallback(()=>{let t=R.current;if(!t)return;let n=M().map(o=>o.el);for(let o of t.children){if(!(o instanceof HTMLElement)||o.classList.contains("kui-ShellScrim"))continue;let c=n.some(h=>o===h||o.contains(h));n.length===0||c?o.hasAttribute(ge)&&(o.removeAttribute(ge),o.inert=!1):o.inert||(o.setAttribute(ge,""),o.inert=!0)}},[M]),j=e.useRef(null),G=e.useRef([]),ee=e.useRef(null),D=e.useRef(!1),z=e.useRef(0),W=e.useCallback(()=>{z.current&&cancelAnimationFrame(z.current),z.current=0},[]),_=e.useCallback((t,n)=>{W();let o=0,c=()=>{if(z.current=0,!!t.isConnected){if(n(t.ownerDocument.activeElement)){t.focus({preventScroll:!0});return}o+=1,o<dt&&(z.current=requestAnimationFrame(c))}};z.current=requestAnimationFrame(c)},[W]);e.useEffect(()=>()=>{W(),D.current&&(D.current=!1,Qe(-1))},[W]),e.useEffect(()=>{let t=R.current;if(!t)return;let n=t.ownerDocument,o=M(),c=o.map(l=>l.el),h=!O&&o.length>0;h!==D.current&&(D.current=h,Qe(h?1:-1));let v=G.current;G.current=o;let y=v.filter(l=>{if(c.includes(l.el))return!1;let u=i.entries.get(l.name);return!l.el.isConnected||!u||u.el!==l.el||u.value==="closed"}),U=l=>l!==null&&y.some(u=>u.el.contains(l));if(v.length===0&&o.length>0){let l=n.activeElement,u=l instanceof HTMLElement&&!Q(n,l)&&!c.some(p=>p.contains(l))?l:null;if(u&&!t.contains(u)){let p=ee.current;p&&p.isConnected&&!c.some(te=>te.contains(p))&&(u=p)}j.current=u}if(K(),o.length===0){let l=j.current;if(j.current=null,y.length===0)return;let p=(H=>H!==null&&H.isConnected&&!H.closest("[inert]")&&!U(H))(l)?l:null;for(let H of y)p??(p=Ze(n,H.id));if(!p)return;let te=H=>Q(n,H)||U(H);te(n.activeElement)?p.focus({preventScroll:!0}):_(p,te);return}if(y.length>0){let l=n.activeElement;if(Q(n,l)||U(l)){let u=null;for(let p of y)u??(u=Ze(n,p.id,c));(u??c[c.length-1]).focus({preventScroll:!0})}}let q=c.filter(l=>!v.some(u=>u.el===l)),se=n.activeElement;q.length>0&&!c.some(l=>l.contains(se))&&(q[0].focus({preventScroll:!0}),_(q[0],l=>Q(n,l)||l instanceof Element&&l.closest("[inert]")!==null))}),e.useEffect(()=>{let t=R.current;if(!t||E===0||typeof MutationObserver>"u")return;let n=new MutationObserver(K);return n.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]}),()=>n.disconnect()},[E,K]);let Y=t=>{g?.(t),!(t.key!=="Escape"||t.defaultPrevented||E===0)&&(N(),t.stopPropagation())};e.useEffect(()=>{let t=R.current;if(!t||E===0)return;let n=t.ownerDocument,o=c=>{c.key!=="Escape"||c.defaultPrevented||!Q(n,c.target)||N()};return n.addEventListener("keydown",o),()=>n.removeEventListener("keydown",o)},[E,N]);let ae=t=>{k?.(t),t.target instanceof HTMLElement&&R.current?.contains(t.target)&&(ee.current=t.target)},B=i.entries.get("rail"),X=B!==void 0&&B.value!==void 0&&B.value!=="closed"?T.has("rail")?`calc(${B.size}px + 2 * var(--shell-gap))`:`${B.size}px`:void 0,re=s==="full"?{}:s==="auto"?{height:"auto"}:typeof s=="number"?{height:`${s}px`}:{height:s};return e.createElement(He.Provider,{value:i},e.createElement(pe.Provider,{value:P},e.createElement(fe.Provider,{value:!1},e.createElement(Fe.Provider,{value:V},e.createElement(tt.Provider,{value:le},e.createElement(xe.Provider,{value:m},e.createElement(Te.Provider,{value:void 0},e.createElement("div",{...w,ref:I,className:$("kui-ShellRoot",a),"data-height":s==="auto"&&!O?"auto":void 0,"data-contained":O||void 0,"data-window":V||void 0,"data-overlay-live":E>0||void 0,onKeyDown:Y,onFocus:ae,style:{...re,...X?{"--shell-rail-offset":X}:{},...Z!==void 0?{"--kui-shell-header-h":`${Z}px`}:{},...x}},r,e.createElement("div",{className:"kui-ShellScrim","aria-hidden":!0,onClick:N})))))))))});nt.displayName="Shell.Root";var ot=e.forwardRef(({className:a,height:r=et,flush:s=!0,style:d,...S},x)=>{let g=e.useContext(tt);return ut(()=>{if(g)return g(r===et?void 0:r),()=>g(void 0)},[g,r]),e.createElement("header",{...S,ref:x,className:$("kui-ShellHeader",a),"data-flush":s||void 0,style:{...d,"--shell-header-height":`${r}px`}})});ot.displayName="Shell.Header";var lt=e.forwardRef(({children:a},r)=>(e.useEffect(()=>{},[]),e.createElement(e.Fragment,null,a)));lt.displayName="Shell.Left";var ft={controlled:"open",default:"defaultOpen"},at=e.forwardRef((a,r)=>{let{className:s,presentation:d,expandedSize:S=64,collapsible:x,onExpand:g,onCollapse:k,children:w,style:L,open:P,defaultOpen:i,onOpenChange:C,flush:R=!0,id:I,...T}=a,{table:F,attributes:A}=Se(d,"fixed"),f=he({name:"rail",label:"Rail",propNames:ft,id:I,controlled:J(P),defaultValue:J(i),presentationTable:F,builtIn:_e,onChange:(N,M)=>C?.(N!=="closed",{reason:M}),onExpand:g,onCollapse:k,size:S});oe("rail",R);let m=Ce(r,f.setElement);return e.createElement("div",{...T,role:T.role??"navigation",id:f.id,ref:m,className:$("kui-ShellPane","kui-ShellRail",s),...ve(f,A),"data-flush":R||void 0,tabIndex:f.overlaying?-1:T.tabIndex,style:{...L,"--rail-size":`${S}px`}},e.createElement(mt,null,w))});at.displayName="Shell.Rail";function mt({children:a}){let r=e.useContext(pe);return e.createElement("div",{className:$("kui-ShellRailContent",`kui-r-size-${r}`)},e.createElement(me,{presentation:"thin"},a))}var Pt={controlled:"open",default:"defaultOpen"},Ee=e.forwardRef((a,r)=>{let{className:s,presentation:d,defaultOpen:S,open:x,onOpenChange:g,size:k,defaultSize:w,expandedSize:L=288,minSize:P=100,maxSize:i=800,resizable:C=!1,collapsible:R=!0,onExpand:I,onCollapse:T,onResize:F,onResizeStart:A,onResizeEnd:f,snapPoints:m,snapTolerance:N,collapseThreshold:M,paneId:E,persistence:O,children:V,style:Z,onSizeChange:le,sizeUpdate:K,sizeUpdateMs:j=50,flush:G=!0,id:ee,...D}=a,z=ue("Shell.Panel"),W=de(z,"rail"),_=Se(d,"fixed"),Y=d===void 0,ae=Y?W?.presentationTable??ce:_.table,B=Y?{"data-presentation-follows":""}:_.attributes,b=he({name:"panel",label:"Panel",propNames:Pt,id:ee,controlled:J(x),defaultValue:J(S),presentationTable:ae,builtIn:Ue,onChange:(v,y)=>g?.(v!=="closed",{reason:y}),onExpand:I,onCollapse:T,size:L});oe("panel",G),e.useEffect(()=>{(m!==void 0||M!==void 0||E!==void 0||O!==void 0)&&void 0},[m,M,E,O]);let X=e.useRef(null),re=Ce(r,b.setElement,X),t=Ve({name:"panel",elementId:b.id,elementRef:X,cssVarName:"--panel-size",orientation:"vertical",edge:"end",growth:qe,expandedSize:L,minSize:P,maxSize:i,resizable:C,collapsible:R,size:k,defaultSize:w,onSizeChange:le,sizeUpdate:K,sizeUpdateMs:j,onResize:F,onResizeStart:A,onResizeEnd:f,snapPoints:m,snapTolerance:N,collapseThreshold:M,paneId:E,persistence:O,overlaying:b.overlaying,overlayingNow:()=>(Y?z.entries.get("rail")?.presentationTable??ce:_.table)[Le()]==="overlay",requestCollapse:()=>b.setValue("closed","toggle"),requestToggle:()=>b.toggle("toggle")}),n=Be(k,w,P,i),{handles:o,content:c}=We(V,Pe),h=C&&b.shown!==!1&&!b.overlaying?e.createElement(De.Provider,{value:t},o.length>0?o:e.createElement(Ie,null)):null;return e.createElement("div",{...$e(D),role:D.role??"navigation",id:b.id,ref:re,className:$("kui-ShellPane","kui-ShellPanel",s),...ve(b,B),"data-flush":G||void 0,tabIndex:b.overlaying?-1:D.tabIndex,style:{...Z,"--panel-expanded-size":`${L}px`,...n?{"--panel-size":n}:{}}},e.createElement("div",{className:"kui-ShellPanelContent"},e.createElement(me,null,e.createElement(ie,null,c))),h)});Ee.displayName="Shell.Panel";Ee.Handle=Pe;var rt=e.forwardRef(({className:a,flush:r=!0,children:s,...d},S)=>(oe("content",r),e.createElement("main",{...d,ref:S,className:$("kui-ShellContent",a),"data-flush":r||void 0},e.createElement(fe.Provider,{value:!0},e.createElement(ie,null,s)))));rt.displayName="Shell.Content";var st=e.forwardRef(({target:a,action:r="toggle",peekOnHover:s,asChild:d=!1,onClick:S,onMouseEnter:x,onMouseLeave:g,children:k,...w},L)=>{let P=ue("Shell.Trigger");e.useEffect(()=>{a==="left"&&void 0,s&&void 0},[a,s]);let i=a==="left"?"rail":a,C=de(P,i),R=C?.value===void 0?void 0:C.value!=="closed",I=f=>{if(S?.(f),f.defaultPrevented)return;let m=P.entries.get(i);m&&(P.peek===i&&ne(P,null),r==="toggle"?m.toggle("toggle"):r==="expand"?m.setValue("open","toggle"):m.setValue("closed","toggle"))},T=f=>{if(x?.(f),!s)return;let m=P.entries.get(i);m&&m.value==="closed"&&m.presentation!=="overlay"&&ne(P,i)},F=f=>{g?.(f),s&&P.peek===i&&ne(P,null)},A=d?ct.Root:"button";return e.createElement(A,{...!d&&{type:"button"},"aria-controls":C?.id,"aria-expanded":R,...w,ref:L,onClick:I,onMouseEnter:T,onMouseLeave:F,"data-shell-trigger":a,"data-shell-action":r},k)});st.displayName="Shell.Trigger";export{nt as a,ot as b,lt as c,at as d,Ee as e,rt as f,st as g,ht as h};
|
|
3
|
+
//# sourceMappingURL=chunk-NO2JCJWI.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/shell.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * Shell: the app frame.\n *\n * Since 0.8.0 the Shell is built on kookie-ui-v2's model, behind v1's API:\n *\n * - The Root is a CSS grid and renders its children as given, in JSX order.\n * Each pane claims its own grid area, so the Root never scans or reorders\n * children, any child renders, and a pane mounted after the Root works.\n * - State lives on each pane: `auto` (untouched), `open` or `closed`. An\n * untouched pane follows the window, resolved by the\n * stylesheet, so first paint needs no script and no open-state callback\n * fires on mount or on a resize.\n * - A pane is one element at every width. `overlay` is a posture of that\n * element, not a Sheet swapped in: crossing a breakpoint keeps its scroll\n * position, its focus and its children's state.\n * - The Root owns what an overlay needs: one scrim, `inert` on everything\n * else, focus moved in and returned, Escape, and a scroll lock.\n * - Nothing links panes to each other. A Rail closing no longer closes the\n * Panel; an app that wants that writes it in `onOpenChange`.\n */\n'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\nimport { PaneResizeContext } from './_internal/shell-resize.js';\nimport { PaneHandle, PanelHandle } from './_internal/shell-handles.js';\nimport { Sidebar } from './_internal/shell-sidebar.js';\nimport type { SidebarPublicProps } from './_internal/shell-sidebar.js';\nimport { Bottom } from './_internal/shell-bottom.js';\nimport type { BottomPublicProps } from './_internal/shell-bottom.js';\nimport { Inspector } from './_internal/shell-inspector.js';\nimport type { InspectorPublicProps } from './_internal/shell-inspector.js';\nimport { usePane, paneAttributes, usePresentationTable } from './_internal/shell-pane.js';\nimport { splitHandles, useInitialPaneSize, useResizablePane } from './_internal/shell-resizable.js';\nimport {\n FIXED_TABLE,\n ShellFrameContext,\n ShellStoreContext,\n createShellStore,\n setShellPeek,\n subscribeShellStore,\n useFrameRegistration,\n usePaneEntry,\n useShellStore,\n warnOnce,\n type FramePaneId,\n} from './_internal/shell-store.js';\nimport { navigationRest, detailRest, toPaneValue, startAnchoredGrowth, withoutRemovedPaneProps } from './_internal/shell-rest.js';\nimport { useShell, useSidebarMode } from './shell.context.js';\nimport { useResponsivePresentation } from './shell.hooks.js';\nimport { readBreakpoint } from '../hooks/use-breakpoint.js';\nimport { useThemeSize } from '../hooks/theme-size.js';\nimport { PageScope } from './_internal/page-scope.js';\nimport { PaneChromeScope, PaneFooter, PaneHeader, Scroll, ShellContentContext, ShellSizeContext, ShellWindowContext } from './_internal/pane-chrome.js';\nimport { onPageScrollMediaChange, pageScrollMatches } from './_internal/shell-page-scroll.js';\nimport type { PaneSize, PaneHeaderProps, PaneFooterProps, ScrollProps } from './_internal/pane-chrome.js';\nimport { PaneBandSizeContext } from './_internal/pane-band-context.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, PaneMode, PaneName, PaneTarget, ResponsivePresentation, SidebarMode } from './shell.types.js';\n\n/* \u2500\u2500 Root \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface ShellRootProps extends React.ComponentPropsWithoutRef<'div'> {\n children: React.ReactNode;\n /**\n * The Shell's height. `full` (the default) is the window's height; on a narrow touch screen the\n * page scrolls instead of the content, so the browser can hide its toolbars. `auto` grows with\n * the content. Any other value is the Shell's own height, and makes it contained.\n */\n height?: 'full' | 'auto' | string | number;\n /**\n * Makes the Shell fill its parent instead of the window, and always scroll inside itself. Its\n * overlays cover only its own box and leave the page free to scroll. Use it for a Shell in a\n * card, a demo or a canvas. An explicit `height` implies it.\n */\n contained?: boolean;\n /** The index the panes' chrome takes: `Shell.PaneHeader`, `Shell.Scroll`, `Shell.PaneFooter` and the Sidebar rows in them. Defaults to the nearest Theme's size (3 when the Theme is 4), else `2`. */\n size?: PaneSize;\n}\n\n/**\n * Every Shell with a live overlay holds the page still, counted across Shells,\n * through an attribute the stylesheet reads. Saving and restoring the\n * document's inline `overflow` would fight any other scroll lock on the page.\n */\nlet pageLockHolders = 0;\nfunction updatePageLock(delta: 1 | -1) {\n pageLockHolders = Math.max(0, pageLockHolders + delta);\n const doc = document.documentElement;\n if (pageLockHolders > 0) doc.setAttribute('data-kui-shell-lock', '');\n else doc.removeAttribute('data-kui-shell-lock');\n}\n\n/** Marks a child the Root made inert, so closing removes only what the Root added. */\nconst INERT_MARK = 'data-kui-shell-inert';\n\n/** How many frames a focus rescue watches after an overlay opens or closes. */\nconst RESCUE_FRAMES = 30;\n\n/** Focus that is nowhere useful: the document, or nothing at all. */\nfunction isNowhere(doc: Document, el: Element | EventTarget | null): boolean {\n return el === null || el === doc || el === doc.body || el === doc.documentElement;\n}\n\n/** A Trigger that drives the pane with this id and can take focus, optionally only inside `within`. */\nfunction triggerFor(doc: Document, id: string, within?: HTMLElement[]): HTMLElement | null {\n for (const el of doc.querySelectorAll<HTMLElement>('[data-shell-trigger][aria-controls]')) {\n if (el.getAttribute('aria-controls') !== id || el.closest('[inert]')) continue;\n if (within && !within.some((pane) => pane.contains(el))) continue;\n return el;\n }\n return null;\n}\n\ntype LivePane = { name: PaneName; id: string; el: HTMLElement };\n\n/** Shell.Root's own range; a Theme size above it maps to 3. */\nconst shellSizePropDef = { values: ['1', '2', '3'] as const };\n\n/** Lets a Shell.Header tell the Root its height, for the rows that stick beneath it while the page scrolls. */\nconst ShellHeaderHeightContext = React.createContext<((height: number | undefined) => void) | null>(null);\n\n/** The Shell.Header's default height, which the stylesheet assumes until a Header says otherwise. */\nconst DEFAULT_HEADER_HEIGHT = 64;\n\n/** The content's scroller while the frame scrolls: the Shell.Scroll's viewport, or the content itself. */\nfunction frameScroller(rootEl: HTMLElement): HTMLElement | null {\n return rootEl.querySelector<HTMLElement>(':scope > .kui-ShellContent > .kui-ShellScroll > .kui-ScrollAreaViewport') ?? rootEl.querySelector<HTMLElement>(':scope > .kui-ShellContent');\n}\n\nconst Root = React.forwardRef<HTMLDivElement, ShellRootProps>(({ className, children, height = 'full', contained: containedProp, size: sizeProp, style, onKeyDown, onFocus, ...props }, ref) => {\n // No size of its own: the nearest Theme's, mapped into 1-3.\n const size = useThemeSize(sizeProp, shellSizePropDef);\n const [store] = React.useState(createShellStore);\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n // Subscribed for the re-render, not for a value: a pane opening or closing\n // must bring the Root back so containment and the scrim follow it.\n React.useSyncExternalStore(\n subscribe,\n () => store.version,\n () => 0,\n );\n\n const rootRef = React.useRef<HTMLDivElement | null>(null);\n const composedRef = useComposedRefs(ref, rootRef);\n\n // The panes pulled off the frame (`flush={false}`). Only the Rail's is read, for the offset below.\n const [offFrame, setOffFrame] = React.useState<ReadonlySet<FramePaneId>>(() => new Set());\n const registerOffFrame = React.useCallback((id: FramePaneId) => {\n setOffFrame((prev) => (prev.has(id) ? prev : new Set(prev).add(id)));\n }, []);\n const unregisterOffFrame = React.useCallback((id: FramePaneId) => {\n setOffFrame((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }, []);\n const frameContext = React.useMemo(() => ({ registerOffFrame, unregisterOffFrame }), [registerOffFrame, unregisterOffFrame]);\n\n const closeOverlays = React.useCallback(() => {\n for (const entry of store.entries.values()) {\n if (entry.overlayLive) entry.setValue('closed', 'dismiss');\n }\n }, [store]);\n\n const livePanes = React.useCallback(\n (): LivePane[] => [...store.entries.values()].filter((entry) => entry.overlayLive && entry.el).map((entry) => ({ name: entry.name, id: entry.id, el: entry.el as HTMLElement })),\n [store],\n );\n const liveCount = [...store.entries.values()].filter((entry) => entry.overlayLive && entry.el).length;\n\n // A contained Shell sits inside a page, and its overlays cover only its box:\n // it holds no page lock. A height of its own implies it. `full` is the\n // window, and `auto` grows with its content, so its overlays are placed on\n // the window. Only a `full` Shell lets the page scroll on a phone.\n const contained = containedProp === true || (height !== 'full' && height !== 'auto');\n const windowShell = !contained && height === 'full';\n\n const [headerHeight, setHeaderHeight] = React.useState<number | undefined>(undefined);\n\n /*\n * The reading position crosses with the scroller. When a touch window\n * crosses the narrow boundary (a phone rotating, an iPad entering Split\n * View), the scroller changes between the content and the page, and the new\n * one starts at the top. The offset is remembered on `scroll` from whichever\n * scroller is live, because by the time the change is reported the old one\n * has already been laid out again and clamped. Only the live scroller is\n * heard. The clamp itself is reported as a scroll in the same frame as the\n * resize and before the media change, so scrolls are not heard from a resize\n * until that frame's animation callbacks.\n */\n React.useEffect(() => {\n if (!windowShell) return;\n const rootEl = rootRef.current;\n const win = rootEl?.ownerDocument.defaultView;\n if (!rootEl || !win || typeof win.matchMedia !== 'function') return;\n let pageScrolls = pageScrollMatches();\n let offset = pageScrolls ? win.scrollY : (frameScroller(rootEl)?.scrollTop ?? 0);\n let frame = 0;\n let resizing = 0;\n const onResize = () => {\n if (resizing) cancelAnimationFrame(resizing);\n resizing = requestAnimationFrame(() => {\n resizing = 0;\n });\n };\n const fromPage = () => {\n if (pageScrolls && !resizing) offset = win.scrollY;\n };\n const fromFrame = (event: Event) => {\n if (!pageScrolls && !resizing && event.target instanceof HTMLElement && event.target === frameScroller(rootEl)) offset = event.target.scrollTop;\n };\n win.addEventListener('resize', onResize);\n win.addEventListener('scroll', fromPage, { passive: true });\n rootEl.addEventListener('scroll', fromFrame, { passive: true, capture: true });\n const stop = onPageScrollMediaChange((matches) => {\n pageScrolls = matches;\n const carried = offset;\n if (frame) cancelAnimationFrame(frame);\n frame = requestAnimationFrame(() => {\n frame = 0;\n if (matches) win.scrollTo(0, carried);\n else {\n const el = frameScroller(rootEl);\n if (el) el.scrollTop = carried;\n }\n });\n });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n if (resizing) cancelAnimationFrame(resizing);\n win.removeEventListener('resize', onResize);\n win.removeEventListener('scroll', fromPage);\n rootEl.removeEventListener('scroll', fromFrame, { capture: true });\n stop();\n };\n }, [windowShell]);\n\n /*\n * Containment is the Root's, not the pane's. Only the Root can see every live\n * overlay and every child at once. A per-pane effect, given two overlays,\n * inerts the other live overlay and restores values the other effect wrote,\n * which can leave the whole frame inert for good.\n *\n * Exempt are the scrim and each root child that CONTAINS a live overlay, so\n * a pane wrapped in a plain element is not inerted with its wrapper. A child\n * the Root inerts is marked, and closing clears only marked children, so\n * `inert` the app sets on a child is the app's before, during and after.\n */\n const contain = React.useCallback(() => {\n const rootEl = rootRef.current;\n if (!rootEl) return;\n const liveEls = livePanes().map((pane) => pane.el);\n for (const child of rootEl.children) {\n if (!(child instanceof HTMLElement) || child.classList.contains('kui-ShellScrim')) continue;\n const holdsLive = liveEls.some((el) => child === el || child.contains(el));\n if (liveEls.length === 0 || holdsLive) {\n if (child.hasAttribute(INERT_MARK)) {\n child.removeAttribute(INERT_MARK);\n child.inert = false;\n }\n } else if (!child.inert) {\n child.setAttribute(INERT_MARK, '');\n child.inert = true;\n }\n }\n }, [livePanes]);\n\n const returnFocusTo = React.useRef<HTMLElement | null>(null);\n const lastLive = React.useRef<LivePane[]>([]);\n const lastFocusInRoot = React.useRef<HTMLElement | null>(null);\n const holdsLock = React.useRef(false);\n\n /*\n * Focus can be taken away after the commit that moved it: a menu that\n * opened or closed a pane restores focus to its own trigger when it\n * finishes closing, which may be inert or hidden by then. For a few frames\n * after an overlay opens or closes, focus that ends up nowhere useful is\n * put back where it belongs.\n */\n const rescueFrame = React.useRef(0);\n const cancelRescue = React.useCallback(() => {\n if (rescueFrame.current) cancelAnimationFrame(rescueFrame.current);\n rescueFrame.current = 0;\n }, []);\n const rescueFocus = React.useCallback(\n (target: HTMLElement, lost: (active: Element | null) => boolean) => {\n cancelRescue();\n let frames = 0;\n const tick = () => {\n rescueFrame.current = 0;\n if (!target.isConnected) return;\n if (lost(target.ownerDocument.activeElement)) {\n target.focus({ preventScroll: true });\n return;\n }\n frames += 1;\n if (frames < RESCUE_FRAMES) rescueFrame.current = requestAnimationFrame(tick);\n };\n rescueFrame.current = requestAnimationFrame(tick);\n },\n [cancelRescue],\n );\n\n React.useEffect(\n () => () => {\n cancelRescue();\n if (holdsLock.current) {\n holdsLock.current = false;\n updatePageLock(-1);\n }\n },\n [cancelRescue],\n );\n\n // No dependency array, on purpose: a pane opening or closing is a render\n // of this component, and so is a child appearing through the Root.\n React.useEffect(() => {\n const rootEl = rootRef.current;\n if (!rootEl) return;\n const doc = rootEl.ownerDocument;\n const live = livePanes();\n const liveEls = live.map((pane) => pane.el);\n\n const wantsLock = !contained && live.length > 0;\n if (wantsLock !== holdsLock.current) {\n holdsLock.current = wantsLock;\n updatePageLock(wantsLock ? 1 : -1);\n }\n\n const previous = lastLive.current;\n lastLive.current = live;\n // A pane that left the live set because it closed, as opposed to one\n // that is still open but stopped being an overlay at a breakpoint.\n const closed = previous.filter((pane) => {\n if (liveEls.includes(pane.el)) return false;\n const entry = store.entries.get(pane.name);\n return !pane.el.isConnected || !entry || entry.el !== pane.el || entry.value === 'closed';\n });\n const inClosed = (active: Element | null) => active !== null && closed.some((pane) => pane.el.contains(active));\n\n // The return target is taken on the opening edge, before inerting: inerting\n // the subtree that holds the trigger blurs it. Focus already inside the\n // overlay (a pane that became one at a breakpoint) is no place to return\n // to, and an opener in a portal (a menu item) goes away with its menu, so\n // the last place focus held inside the frame stands in for it.\n if (previous.length === 0 && live.length > 0) {\n const active = doc.activeElement;\n let target = active instanceof HTMLElement && !isNowhere(doc, active) && !liveEls.some((el) => el.contains(active)) ? active : null;\n if (target && !rootEl.contains(target)) {\n const inRoot = lastFocusInRoot.current;\n if (inRoot && inRoot.isConnected && !liveEls.some((el) => el.contains(inRoot))) target = inRoot;\n }\n returnFocusTo.current = target;\n }\n\n contain();\n\n if (live.length === 0) {\n const before = returnFocusTo.current;\n returnFocusTo.current = null;\n // Every overlay that left only stopped being one: focus stays where it is.\n if (closed.length === 0) return;\n const usable = (el: HTMLElement | null) => el !== null && el.isConnected && !el.closest('[inert]') && !inClosed(el);\n let target = usable(before) ? before : null;\n for (const pane of closed) target ??= triggerFor(doc, pane.id);\n if (!target) return;\n const lost = (active: Element | null) => isNowhere(doc, active) || inClosed(active);\n if (lost(doc.activeElement)) target.focus({ preventScroll: true });\n else rescueFocus(target, lost);\n return;\n }\n\n // Some overlays closed while others stay: focus left in a closed one goes\n // to the Trigger that opened it, if a live pane holds it, or to the pane\n // on top.\n if (closed.length > 0) {\n const active = doc.activeElement;\n if (isNowhere(doc, active) || inClosed(active)) {\n let target: HTMLElement | null = null;\n for (const pane of closed) target ??= triggerFor(doc, pane.id, liveEls);\n (target ?? liveEls[liveEls.length - 1]).focus({ preventScroll: true });\n }\n }\n\n // Focus moves in on the opening edge and nowhere else, and only when it\n // is not already somewhere the user put it inside the live set.\n const opened = liveEls.filter((el) => !previous.some((pane) => pane.el === el));\n const active = doc.activeElement;\n if (opened.length > 0 && !liveEls.some((el) => el.contains(active))) {\n opened[0].focus({ preventScroll: true });\n rescueFocus(opened[0], (now) => isNowhere(doc, now) || (now instanceof Element && now.closest('[inert]') !== null));\n }\n });\n\n // A child that appears through its own state while an overlay is live does\n // not render the Root, so the Root watches its children while one is.\n React.useEffect(() => {\n const rootEl = rootRef.current;\n if (!rootEl || liveCount === 0 || typeof MutationObserver === 'undefined') return;\n const observer = new MutationObserver(contain);\n observer.observe(rootEl, { childList: true, subtree: true, attributes: true, attributeFilter: ['inert'] });\n return () => observer.disconnect();\n }, [liveCount, contain]);\n\n /*\n * Escape closes the overlays. It is handled as a React event on the Root, so\n * a component inside a pane that answers Escape in its own onKeyDown runs\n * first, and its preventDefault() or stopPropagation() keeps the pane open.\n * When the Root closes something it stops the event there, so a React\n * Escape handler above the Shell does not act on it too. A layer that\n * listens on the document in the capture phase (Radix dialogs, menus and\n * popovers) answers first and calls preventDefault() when it closes, so an\n * enclosing Kookie Dialog closes before a Shell inside it is asked.\n */\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.key !== 'Escape' || event.defaultPrevented || liveCount === 0) return;\n closeOverlays();\n event.stopPropagation();\n };\n\n // With focus on the document itself (a pane closed under it, or a menu that\n // closed and took focus with it), the Root never sees the key. While an\n // overlay is live the document answers that one case.\n React.useEffect(() => {\n const rootEl = rootRef.current;\n if (!rootEl || liveCount === 0) return;\n const doc = rootEl.ownerDocument;\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || event.defaultPrevented || !isNowhere(doc, event.target)) return;\n closeOverlays();\n };\n doc.addEventListener('keydown', onDocumentKeyDown);\n return () => doc.removeEventListener('keydown', onDocumentKeyDown);\n }, [liveCount, closeOverlays]);\n\n const handleFocus = (event: React.FocusEvent<HTMLDivElement>) => {\n onFocus?.(event);\n if (event.target instanceof HTMLElement && rootRef.current?.contains(event.target)) lastFocusInRoot.current = event.target;\n };\n\n // A floating Panel sits beside the Rail when the Rail is showing, and\n // beside its card when the Rail is off the frame.\n const rail = store.entries.get('rail');\n const railShown = rail !== undefined && rail.value !== undefined && rail.value !== 'closed';\n const railOffset = railShown ? (offFrame.has('rail') ? `calc(${rail.size}px + 2 * var(--shell-gap))` : `${rail.size}px`) : undefined;\n\n // `full` writes no inline height: the stylesheet states it as 100vh with a\n // 100dvh override where supported, and an inline value would beat both.\n const heightStyle: React.CSSProperties = height === 'full' ? {} : height === 'auto' ? { height: 'auto' } : typeof height === 'number' ? { height: `${height}px` } : { height };\n\n return (\n <ShellStoreContext.Provider value={store}>\n <ShellSizeContext.Provider value={size}>\n <ShellContentContext.Provider value={false}>\n <ShellWindowContext.Provider value={windowShell}>\n <ShellHeaderHeightContext.Provider value={setHeaderHeight}>\n <ShellFrameContext.Provider value={frameContext}>\n {/* A Shell inside a portalled surface's Theme starts with no band, like any other. */}\n <PaneBandSizeContext.Provider value={undefined}>\n {/* The Root is not a widget: it hears Escape bubbling up from the panes,\n after their own handlers, to close the overlays. */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div\n {...props}\n ref={composedRef}\n className={classNames('kui-ShellRoot', className)}\n data-height={height === 'auto' && !contained ? 'auto' : undefined}\n data-contained={contained || undefined}\n data-window={windowShell || undefined}\n data-overlay-live={liveCount > 0 || undefined}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n style={{\n ...heightStyle,\n ...(railOffset ? ({ '--shell-rail-offset': railOffset } as CSSPropertiesWithVars) : {}),\n ...(headerHeight !== undefined ? ({ '--kui-shell-header-h': `${headerHeight}px` } as CSSPropertiesWithVars) : {}),\n ...style,\n }}\n >\n {children}\n {/* Root-owned and always mounted. The stylesheet shows it while an\n overlay is live; containment takes the rest of the frame out of\n the accessibility tree, so the scrim itself is hidden from it. */}\n <div className=\"kui-ShellScrim\" aria-hidden onClick={closeOverlays} />\n </div>\n </PaneBandSizeContext.Provider>\n </ShellFrameContext.Provider>\n </ShellHeaderHeightContext.Provider>\n </ShellWindowContext.Provider>\n </ShellContentContext.Provider>\n </ShellSizeContext.Provider>\n </ShellStoreContext.Provider>\n );\n});\nRoot.displayName = 'Shell.Root';\n\n/* \u2500\u2500 Header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ninterface ShellHeaderProps extends React.ComponentPropsWithoutRef<'header'> {\n height?: number;\n /**\n * Sets whether the header joins the app frame. The default is `true`: a hairline under it. Set\n * `flush={false}` to make it a card off the frame.\n */\n flush?: boolean;\n}\n\nconst Header = React.forwardRef<HTMLElement, ShellHeaderProps>(({ className, height = DEFAULT_HEADER_HEIGHT, flush = true, style, ...props }, ref) => {\n // Rows that stick beneath the header while the page scrolls need its height. The stylesheet\n // assumes the default, so only another height is told to the Root.\n const setHeaderHeight = React.useContext(ShellHeaderHeightContext);\n useLayoutEffect(() => {\n if (!setHeaderHeight) return;\n setHeaderHeight(height === DEFAULT_HEADER_HEIGHT ? undefined : height);\n return () => setHeaderHeight(undefined);\n }, [setHeaderHeight, height]);\n return (\n <header\n {...props}\n ref={ref}\n className={classNames('kui-ShellHeader', className)}\n data-flush={flush || undefined}\n style={\n {\n ...style,\n '--shell-header-height': `${height}px`,\n } as CSSPropertiesWithVars\n }\n />\n );\n});\nHeader.displayName = 'Shell.Header';\n\n/* \u2500\u2500 Left (deprecated) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ninterface LeftProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, meta: { reason: 'init' | 'toggle' | 'panel' | 'responsive' | 'dismiss' }) => void;\n collapsible?: boolean;\n onExpand?: () => void;\n onCollapse?: () => void;\n}\n\n/**\n * @deprecated The Root no longer wraps the Rail and Panel in a Left\n * container: each is its own pane. `Shell.Left` renders its children and\n * ignores its own props. Removed in 1.0.\n */\nconst Left = React.forwardRef<HTMLDivElement, LeftProps>(({ children }, _ref) => {\n React.useEffect(() => {\n warnOnce('Shell.Left is deprecated and is removed in 1.0. Render Shell.Rail and Shell.Panel directly in Shell.Root.');\n }, []);\n return <>{children}</>;\n});\nLeft.displayName = 'Shell.Left';\n\n/* \u2500\u2500 Rail \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype RailOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'panel' | 'dismiss' };\n\ntype RailControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: RailOpenChangeMeta) => void; defaultOpen?: never };\ntype RailUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: RailOpenChangeMeta) => void; open?: never };\n\ntype RailProps = React.ComponentPropsWithoutRef<'div'> & {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. */\n onCollapse?: () => void;\n /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n} & (RailControlledProps | RailUncontrolledProps);\n\nconst RAIL_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\nconst Rail = React.forwardRef<HTMLDivElement, RailProps>((props, ref) => {\n const { className, presentation, expandedSize = 64, collapsible: _collapsible, onExpand, onCollapse, children, style, open, defaultOpen, onOpenChange, flush = true, id, ...domProps } = props;\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'rail',\n label: 'Rail',\n propNames: RAIL_PROP_NAMES,\n id,\n controlled: toPaneValue(open),\n defaultValue: toPaneValue(defaultOpen),\n presentationTable: table,\n builtIn: navigationRest,\n onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useFrameRegistration('rail', flush);\n const composedRef = useComposedRefs(ref, pane.setElement);\n\n return (\n <div\n {...domProps}\n role={domProps.role ?? 'navigation'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellRail', className)}\n {...paneAttributes(pane, attributes)}\n data-flush={flush || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={{ ...style, '--rail-size': `${expandedSize}px` } as CSSPropertiesWithVars}\n >\n <RailContent>{children}</RailContent>\n </div>\n );\n});\nRail.displayName = 'Shell.Rail';\n\n/** The Rail's content carries the index, so the thin row styles can size themselves by it. */\nfunction RailContent({ children }: { children: React.ReactNode }) {\n const size = React.useContext(ShellSizeContext);\n return (\n <div className={classNames('kui-ShellRailContent', `kui-r-size-${size}`)}>\n <PaneChromeScope presentation=\"thin\">{children}</PaneChromeScope>\n </div>\n );\n}\n\n/* \u2500\u2500 Panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype HandleComponent = React.ForwardRefExoticComponent<React.ComponentPropsWithoutRef<'div'> & React.RefAttributes<HTMLDivElement>>;\n\ntype PanelOpenChangeMeta = { reason: 'toggle' | 'left' | 'init' | 'responsive' | 'dismiss' };\ntype PanelControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: PanelOpenChangeMeta) => void; defaultOpen?: never };\ntype PanelUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: PanelOpenChangeMeta) => void; open?: never };\n\ntype PanelSizeControlledProps = { size: number | string; defaultSize?: never };\ntype PanelSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\n\ntype PanelSizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\ntype PanelPublicProps = PaneBaseProps &\n (PanelControlledProps | PanelUncontrolledProps) &\n (PanelSizeControlledProps | PanelSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: PanelSizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n };\ntype PanelComponent = React.ForwardRefExoticComponent<PanelPublicProps & React.RefAttributes<HTMLDivElement>> & {\n Handle: HandleComponent;\n};\n\nconst PANEL_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\n/**\n * A Panel with a `presentation` of its own uses it. One without follows the\n * Rail rendered before it, which is how 0.7 placed a Panel; the stylesheet\n * reads the Rail's attributes for the first paint and the registry carries\n * the Rail's table for the JS mirror.\n */\nconst Panel = React.forwardRef<HTMLDivElement, PanelPublicProps>((props, ref) => {\n const {\n className,\n presentation,\n defaultOpen,\n open,\n onOpenChange,\n size,\n defaultSize,\n expandedSize = 288,\n minSize = 100,\n maxSize = 800,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n flush = true,\n id,\n ...domProps\n } = props;\n const store = useShellStore('Shell.Panel');\n const rail = usePaneEntry(store, 'rail');\n const own = usePresentationTable(presentation, 'fixed');\n const followsRail = presentation === undefined;\n const presentationTable = followsRail ? (rail?.presentationTable ?? FIXED_TABLE) : own.table;\n const presentationAttributes = followsRail ? { 'data-presentation-follows': '' } : own.attributes;\n\n const pane = usePane({\n name: 'panel',\n label: 'Panel',\n propNames: PANEL_PROP_NAMES,\n id,\n controlled: toPaneValue(open),\n defaultValue: toPaneValue(defaultOpen),\n presentationTable,\n builtIn: detailRest,\n onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useFrameRegistration('panel', flush);\n\n React.useEffect(() => {\n if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {\n warnOnce('Shell.Panel: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');\n }\n }, [snapPoints, collapseThreshold, paneId, persistence]);\n\n const elementRef = React.useRef<HTMLElement | null>(null);\n const composedRef = useComposedRefs(ref, pane.setElement, elementRef);\n\n const resize = useResizablePane({\n name: 'panel',\n elementId: pane.id,\n elementRef,\n cssVarName: '--panel-size',\n orientation: 'vertical',\n edge: 'end',\n growth: startAnchoredGrowth,\n expandedSize,\n minSize,\n maxSize,\n resizable,\n collapsible,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n overlaying: pane.overlaying,\n // Asked when the effect runs: the Rail registers its table after this\n // Panel first renders, so the render's answer can be out of date.\n overlayingNow: () => {\n const table = followsRail ? (store.entries.get('rail')?.presentationTable ?? FIXED_TABLE) : own.table;\n return table[readBreakpoint()] === 'overlay';\n },\n requestCollapse: () => pane.setValue('closed', 'toggle'),\n requestToggle: () => pane.toggle('toggle'),\n });\n\n // The starting size is in the server HTML, so the pane does not jump on hydration.\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n const { handles, content } = splitHandles(children, PanelHandle);\n const handle = resizable && pane.shown !== false && !pane.overlaying ? <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider> : null;\n\n return (\n <div\n {...withoutRemovedPaneProps(domProps)}\n role={domProps.role ?? 'navigation'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellPanel', className)}\n {...paneAttributes(pane, presentationAttributes)}\n data-flush={flush || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--panel-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--panel-size': initialSize } : {}),\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellPanelContent\">\n <PaneChromeScope>\n <PageScope>{content}</PageScope>\n </PaneChromeScope>\n </div>\n {handle}\n </div>\n );\n}) as PanelComponent;\nPanel.displayName = 'Shell.Panel';\nPanel.Handle = PanelHandle;\n\n/* \u2500\u2500 Content \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ninterface ShellContentProps extends React.ComponentPropsWithoutRef<'main'> {\n /**\n * Sets whether the work area joins the app frame. The default is `true`. Set `flush={false}`\n * to make it a card on the Shell's background; the panes beside it then sit on that background\n * too, and draw no hairline toward it.\n */\n flush?: boolean;\n}\n\n/**\n * The work area. It scrolls as it is; with a `Shell.Scroll` child it becomes a column and the\n * Scroll scrolls instead, so a `Shell.PaneHeader float` beside it stays pinned over the page.\n */\nconst Content = React.forwardRef<HTMLElement, ShellContentProps>(({ className, flush = true, children, ...props }, ref) => {\n useFrameRegistration('content', flush);\n return (\n <main {...props} ref={ref} className={classNames('kui-ShellContent', className)} data-flush={flush || undefined}>\n {/* Each pane holds its own page store, so a band's title can mirror the page beside it. */}\n <ShellContentContext.Provider value={true}>\n <PageScope>{children}</PageScope>\n </ShellContentContext.Provider>\n </main>\n );\n});\nContent.displayName = 'Shell.Content';\n\n/* \u2500\u2500 Trigger \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype TriggerAction = 'toggle' | 'expand' | 'collapse';\n\ninterface TriggerProps extends React.ComponentPropsWithoutRef<'button'> {\n target: PaneTarget;\n action?: TriggerAction;\n /**\n * Renders the single child in place of the trigger's own button, with the trigger's click,\n * `aria-controls`, `aria-expanded` and data attributes merged onto it. Use it to make a\n * `Button` the trigger: `<Shell.Trigger asChild><Button iconOnly aria-label=\"Toggle sidebar\">\u2026</Button></Shell.Trigger>`.\n */\n asChild?: boolean;\n /**\n * Whether to show a preview of the target pane on hover while it is closed\n * and not an overlay. Defaults to false.\n *\n * @deprecated Removed in 1.0. A preview reachable only by mouse hover has no\n * keyboard or touch equivalent; open the pane instead.\n */\n peekOnHover?: boolean;\n}\n\n/**\n * A button that drives a pane by name, through the registry. It sets\n * `aria-controls` and `aria-expanded` (left off while an untouched pane\n * cannot know its state yet), renders `type=\"button\"`, and runs the\n * consumer's `onClick` first: calling `preventDefault()` there cancels it. With `asChild` the\n * child is the button, and its own `type` stands.\n */\nconst Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(({ target, action = 'toggle', peekOnHover, asChild = false, onClick, onMouseEnter, onMouseLeave, children, ...props }, ref) => {\n const store = useShellStore('Shell.Trigger');\n React.useEffect(() => {\n if (target === 'left') warnOnce('Shell.Trigger target=\"left\" is deprecated and is removed in 1.0. Use target=\"rail\".');\n if (peekOnHover) warnOnce('Shell.Trigger: `peekOnHover` is deprecated and is removed in 1.0.');\n }, [target, peekOnHover]);\n const name: PaneName = target === 'left' ? 'rail' : target;\n // Subscribes to its own pane only.\n const entry = usePaneEntry(store, name);\n const shown = entry?.value === undefined ? undefined : entry.value !== 'closed';\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n const current = store.entries.get(name);\n if (!current) return;\n if (store.peek === name) setShellPeek(store, null);\n if (action === 'toggle') current.toggle('toggle');\n else if (action === 'expand') current.setValue('open', 'toggle');\n else current.setValue('closed', 'toggle');\n };\n\n const handleMouseEnter = (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseEnter?.(event);\n if (!peekOnHover) return;\n const current = store.entries.get(name);\n if (current && current.value === 'closed' && current.presentation !== 'overlay') setShellPeek(store, name);\n };\n\n const handleMouseLeave = (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseLeave?.(event);\n if (peekOnHover && store.peek === name) setShellPeek(store, null);\n };\n\n const Comp = asChild ? Slot.Root : 'button';\n return (\n <Comp\n // A button's default type is `submit`. Stated before the spread, so a consumer's own wins.\n // An asChild child states its own (Button already says `button`; a link has none), so the\n // key is left off rather than passed as undefined.\n {...(!asChild && { type: 'button' as const })}\n aria-controls={entry?.id}\n aria-expanded={shown}\n {...props}\n ref={ref}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n data-shell-trigger={target}\n data-shell-action={action}\n >\n {children}\n </Comp>\n );\n});\nTrigger.displayName = 'Shell.Trigger';\n\n// Exports\nexport {\n Root,\n Header,\n Left,\n Rail,\n Panel,\n Sidebar,\n Content,\n Inspector,\n Bottom,\n Trigger,\n PaneHeader,\n PaneFooter,\n Scroll,\n useShell,\n useSidebarMode,\n useResponsivePresentation,\n type PaneMode,\n type SidebarMode,\n type ResponsivePresentation,\n type PaneTarget,\n type TriggerAction,\n type ShellRootProps as RootProps,\n type ShellHeaderProps as HeaderProps,\n type RailProps,\n type PanelPublicProps as PanelProps,\n type SidebarPublicProps as SidebarProps,\n type ShellContentProps as ContentProps,\n type InspectorPublicProps as InspectorProps,\n type BottomPublicProps as BottomProps,\n type TriggerProps,\n type PaneHeaderProps,\n type PaneFooterProps,\n type ScrollProps,\n};\n"],
|
|
5
|
+
"mappings": ";y6BAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,GAAA,YAAAC,GAAA,WAAAC,GAAA,cAAAC,GAAA,SAAAC,GAAA,eAAAC,GAAA,eAAAC,GAAA,UAAAC,GAAA,SAAAC,GAAA,SAAAC,GAAA,WAAAC,GAAA,YAAAC,GAAA,YAAAC,GAAA,8BAAAC,GAAA,aAAAC,GAAA,mBAAAC,KAsBA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,QAAAC,OAAY,WACrB,OAAS,mBAAAC,GAAiB,mBAAAC,OAAuB,oBA6DjD,IAAIC,GAAkB,EACtB,SAASC,GAAeC,EAAe,CACrCF,GAAkB,KAAK,IAAI,EAAGA,GAAkBE,CAAK,EACrD,IAAMC,EAAM,SAAS,gBACjBH,GAAkB,EAAGG,EAAI,aAAa,sBAAuB,EAAE,EAC9DA,EAA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,OAASA,EAE9ChC,EAAQ0G,GAAa1H,EAAOyJ,CAAI,EAChCC,EAAQ1I,GAAO,QAAU,OAAY,OAAYA,EAAM,QAAU,SAEjE2I,EAAe3H,GAA+C,CAElE,GADAsH,IAAUtH,CAAK,EACXA,EAAM,iBAAkB,OAC5B,IAAM4H,EAAU5J,EAAM,QAAQ,IAAIyJ,CAAI,EACjCG,IACD5J,EAAM,OAASyJ,GAAMI,GAAa7J,EAAO,IAAI,EAC7CmJ,IAAW,SAAUS,EAAQ,OAAO,QAAQ,EACvCT,IAAW,SAAUS,EAAQ,SAAS,OAAQ,QAAQ,EAC1DA,EAAQ,SAAS,SAAU,QAAQ,EAC1C,EAEME,EAAoB9H,GAA+C,CAEvE,GADAuH,IAAevH,CAAK,EAChB,CAACoH,EAAa,OAClB,IAAMQ,EAAU5J,EAAM,QAAQ,IAAIyJ,CAAI,EAClCG,GAAWA,EAAQ,QAAU,UAAYA,EAAQ,eAAiB,WAAWC,GAAa7J,EAAOyJ,CAAI,CAC3G,EAEMM,EAAoB/H,GAA+C,CACvEwH,IAAexH,CAAK,EAChBoH,GAAepJ,EAAM,OAASyJ,GAAMI,GAAa7J,EAAO,IAAI,CAClE,EAEMgK,EAAOX,EAAUY,GAAK,KAAO,SACnC,OACE,gBAACD,EAAA,CAIE,GAAI,CAACX,GAAW,CAAE,KAAM,QAAkB,EAC3C,gBAAerI,GAAO,GACtB,gBAAe0I,EACd,GAAG9J,EACJ,IAAKC,EACL,QAAS8J,EACT,aAAcG,EACd,aAAcC,EACd,qBAAoB/G,EACpB,oBAAmBmG,GAElB9J,CACH,CAEJ,CAAC,EACD6J,GAAQ,YAAc",
|
|
6
|
+
"names": ["shell_exports", "__export", "Bottom", "Content", "Header", "Inspector", "Left", "PaneFooter", "PaneHeader", "Panel", "Rail", "Root", "Scroll", "Sidebar", "Trigger", "useResponsivePresentation", "useShell", "useSidebarMode", "React", "classNames", "Slot", "useComposedRefs", "useLayoutEffect", "pageLockHolders", "updatePageLock", "delta", "doc", "INERT_MARK", "RESCUE_FRAMES", "isNowhere", "el", "triggerFor", "id", "within", "pane", "shellSizePropDef", "ShellHeaderHeightContext", "DEFAULT_HEADER_HEIGHT", "frameScroller", "rootEl", "Root", "className", "children", "height", "containedProp", "sizeProp", "style", "onKeyDown", "onFocus", "props", "ref", "size", "useThemeSize", "store", "createShellStore", "subscribe", "listener", "subscribeShellStore", "rootRef", "composedRef", "useComposedRefs", "offFrame", "setOffFrame", "registerOffFrame", "prev", "unregisterOffFrame", "next", "frameContext", "closeOverlays", "entry", "livePanes", "liveCount", "contained", "windowShell", "headerHeight", "setHeaderHeight", "win", "pageScrolls", "pageScrollMatches", "offset", "frame", "resizing", "onResize", "fromPage", "fromFrame", "event", "stop", "onPageScrollMediaChange", "matches", "carried", "contain", "liveEls", "child", "holdsLive", "returnFocusTo", "lastLive", "lastFocusInRoot", "holdsLock", "rescueFrame", "cancelRescue", "rescueFocus", "target", "lost", "frames", "tick", "live", "wantsLock", "previous", "closed", "inClosed", "active", "inRoot", "before", "opened", "now", "observer", "handleKeyDown", "onDocumentKeyDown", "handleFocus", "rail", "railOffset", "heightStyle", "ShellStoreContext", "ShellSizeContext", "ShellContentContext", "ShellWindowContext", "ShellFrameContext", "PaneBandSizeContext", "classNames", "Header", "flush", "useLayoutEffect", "Left", "_ref", "RAIL_PROP_NAMES", "Rail", "presentation", "expandedSize", "_collapsible", "onExpand", "onCollapse", "open", "defaultOpen", "onOpenChange", "domProps", "table", "attributes", "usePresentationTable", "usePane", "toPaneValue", "navigationRest", "value", "reason", "useFrameRegistration", "paneAttributes", "RailContent", "PaneChromeScope", "PANEL_PROP_NAMES", "Panel", "defaultSize", "minSize", "maxSize", "resizable", "collapsible", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "useShellStore", "usePaneEntry", "own", "followsRail", "presentationTable", "FIXED_TABLE", "presentationAttributes", "detailRest", "elementRef", "resize", "useResizablePane", "startAnchoredGrowth", "readBreakpoint", "initialSize", "useInitialPaneSize", "handles", "content", "splitHandles", "PanelHandle", "handle", "PaneResizeContext", "PaneHandle", "withoutRemovedPaneProps", "PageScope", "Content", "Trigger", "action", "peekOnHover", "asChild", "onClick", "onMouseEnter", "onMouseLeave", "name", "shown", "handleClick", "current", "setShellPeek", "handleMouseEnter", "handleMouseLeave", "Comp", "Slot"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as d}from"./chunk-DFQIIYLD.js";import{b as p}from"./chunk-QEDKL23P.js";import{j as C}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as d}from"./chunk-DFQIIYLD.js";import{b as p}from"./chunk-QEDKL23P.js";import{j as C}from"./chunk-5BXCPANF.js";import{a as s}from"./chunk-ANQLWGFN.js";import*as e from"react";import c from"classnames";var v=e.createContext(null);function u(){return e.useContext(v)}var S=e.createContext("2"),B=e.createContext(!1),N=e.createContext(!1);function W({children:t,presentation:n}){let a=e.useContext(S),o=e.useMemo(()=>({size:a,menuVariant:"soft",presentation:n}),[a,n]);return e.createElement(v.Provider,{value:o},t)}function P(){let t=u(),n=e.useContext(S),a=t?.size??n,o=t?.menuVariant??"soft";return["kui-ShellPaneChrome",`kui-r-size-${a}`,`kui-menu-variant-${o}`]}var H={1:"2",2:"3",3:"4",4:"4"};function f(){let t=u(),n=e.useContext(S);return H[t?.size??n]}function g(){let t=e.useContext(s),n=e.useContext(C)!==null,a=f();return t!==void 0?t:n?a:null}var y=e.forwardRef(({className:t,float:n,children:a,...o},i)=>{let l=P(),r=f();return e.createElement("div",{...o,ref:i,"data-float":n||void 0,className:c("kui-ShellPaneHeader","kui-SidebarHeader","kui-SidebarHeader--container",...l,t)},e.createElement(s.Provider,{value:r},a))});y.displayName="Shell.PaneHeader";var F=e.forwardRef(({className:t,float:n,children:a,...o},i)=>{let l=P(),r=f();return e.createElement("div",{...o,ref:i,"data-float":n||void 0,className:c("kui-ShellPaneFooter","kui-SidebarFooter","kui-SidebarFooter--container",...l,t)},e.createElement(s.Provider,{value:r},a))});F.displayName="Shell.PaneFooter";var M=e.forwardRef(({className:t,style:n,dir:a,children:o,fade:i=!1,pane:l=!1,...r},m)=>{let x=P(),h=e.useContext(B),R=u(),z=h&&R===null&&!l,b=e.useContext(N),V=p();if(z){let k=r.tabIndex??(b&&V?-1:void 0);return e.createElement(d,{...r,tabIndex:k,ref:m,type:"hover",fade:i,className:"kui-ShellScroll"},e.createElement("div",{style:n,dir:a,className:c("kui-ShellScrollContent",t)},o))}return e.createElement(d,{...r,ref:m,type:"hover",fade:i,className:"kui-ShellScroll"},e.createElement("div",{style:n,dir:a,className:c("kui-BaseMenuContent","kui-SidebarContent",...x,t)},e.createElement(s.Provider,{value:null},e.createElement("div",{className:"kui-BaseMenuViewport"},o))))});M.displayName="Shell.Scroll";export{v as a,u as b,S as c,B as d,N as e,W as f,H as g,g as h,y as i,F as j,M as k};
|
|
3
|
+
//# sourceMappingURL=chunk-ODHCDJ3Y.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as m,c as E,f as H,g as N}from"./chunk-XUCR7L4G.js";import{a as R,e as p}from"./chunk-3QWGSRYC.js";import{a as y,b as x,c as O}from"./chunk-KGCGT4MJ.js";import{a as M,b as T,c as w}from"./chunk-QKCNGEX4.js";import{a as v}from"./chunk-WEBNIUEX.js";import{a as B}from"./chunk-G66WDIIV.js";import{b as S}from"./chunk-VWRPVM5K.js";import{o as C}from"./chunk-5BXCPANF.js";import*as e from"react";import re from"classnames";import{useComposedRefs as pe}from"radix-ui/internal";var me={controlled:"open",default:"defaultOpen"},U=e.forwardRef((k,I)=>{let{className:V,presentation:A="fixed",defaultOpen:L,open:$,onOpenChange:q,expandedSize:t=200,minSize:n=100,maxSize:a=400,resizable:d=!1,collapsible:D=!0,onExpand:F,onCollapse:W,onResize:_,onResizeStart:j,onResizeEnd:G,snapPoints:s,snapTolerance:K,collapseThreshold:i,paneId:l,persistence:r,children:J,style:Q,size:u,defaultSize:c,onSizeChange:X,sizeUpdate:Y,sizeUpdateMs:Z=50,flush:f=!0,id:ee,...P}=k,{table:z,attributes:oe}=O(A,"fixed"),o=y({name:"bottom",label:"Bottom",propNames:me,id:ee,controlled:m($),defaultValue:m(L),presentationTable:z,builtIn:E,onChange:(ie,le)=>q?.(ie!=="closed",{reason:le}),onExpand:F,onCollapse:W,size:t});C("bottom",f),e.useEffect(()=>{(s!==void 0||i!==void 0||l!==void 0||r!==void 0)&&void 0},[s,i,l,r]);let h=e.useRef(null),te=pe(I,o.setElement,h),ne=T({name:"bottom",elementId:o.id,elementRef:h,cssVarName:"--bottom-size",orientation:"horizontal",edge:"start",growth:H,expandedSize:t,minSize:n,maxSize:a,resizable:d,collapsible:D,size:u,defaultSize:c,onSizeChange:X,sizeUpdate:Y,sizeUpdateMs:Z,onResize:_,onResizeStart:j,onResizeEnd:G,snapPoints:s,snapTolerance:K,collapseThreshold:i,paneId:l,persistence:r,overlaying:o.overlaying,overlayingNow:()=>z[B()]==="overlay",requestCollapse:()=>o.setValue("closed","toggle"),requestToggle:()=>o.toggle("toggle")}),b=M(u,c,n,a),{handles:g,content:ae}=w(J,p),se=d&&o.shown!==!1&&!o.overlaying?e.createElement(v.Provider,{value:ne},g.length>0?g:e.createElement(R,null)):null;return e.createElement("div",{...N(P),id:o.id,ref:te,className:re("kui-ShellPane","kui-ShellBottom",V),...x(o,oe),"data-flush":f||void 0,tabIndex:o.overlaying?-1:P.tabIndex,style:{...Q,"--bottom-expanded-size":`${t}px`,...b?{"--bottom-size":b}:{},"--bottom-min-size":`${n}px`,"--bottom-max-size":`${a}px`}},e.createElement("div",{className:"kui-ShellBottomContent"},e.createElement(S,null,ae)),se)});U.displayName="Shell.Bottom";U.Handle=p;export{U as a};
|
|
3
|
+
//# sourceMappingURL=chunk-UMQOTGJC.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/_internal/shell-bottom.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposedRefs } from 'radix-ui/internal';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { BottomHandle, PaneHandle } from './shell-handles.js';\nimport { usePane, paneAttributes, usePresentationTable } from './shell-pane.js';\nimport { splitHandles, useInitialPaneSize, useResizablePane, type SizeChangeMeta } from './shell-resizable.js';\nimport { useFrameRegistration, warnOnce } from './shell-store.js';\nimport { bottomAnchoredGrowth, detailRest, toPaneValue, withoutRemovedPaneProps } from './shell-rest.js';\nimport { PageScope } from './page-scope.js';\nimport { readBreakpoint } from '../../hooks/use-breakpoint.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps } from '../shell.types.js';\n\ntype BottomOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'dismiss' };\ntype BottomControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; defaultOpen?: never };\n/** Since 0.8.0 `defaultOpen` takes a responsive object here too, as the docs already said it did. */\ntype BottomUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; open?: never };\ntype BottomSizeControlledProps = { size: number | string; defaultSize?: never };\ntype BottomSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype BottomPublicProps = PaneBaseProps &\n (BottomControlledProps | BottomUncontrolledProps) &\n (BottomSizeControlledProps | BottomSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: SizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n };\n\ntype BottomComponent = React.ForwardRefExoticComponent<BottomPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof BottomHandle };\n\nconst BOTTOM_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\nexport const Bottom = React.forwardRef<HTMLDivElement, BottomPublicProps>((props, ref) => {\n const {\n className,\n presentation = 'fixed',\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 200,\n minSize = 100,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n flush = true,\n id,\n ...domProps\n } = props;\n\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'bottom',\n label: 'Bottom',\n propNames: BOTTOM_PROP_NAMES,\n id,\n controlled: toPaneValue(open),\n defaultValue: toPaneValue(defaultOpen),\n presentationTable: table,\n builtIn: detailRest,\n onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useFrameRegistration('bottom', flush);\n\n React.useEffect(() => {\n if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {\n warnOnce('Shell.Bottom: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');\n }\n }, [snapPoints, collapseThreshold, paneId, persistence]);\n\n const elementRef = React.useRef<HTMLElement | null>(null);\n const composedRef = useComposedRefs(ref, pane.setElement, elementRef);\n\n const resize = useResizablePane({\n name: 'bottom',\n elementId: pane.id,\n elementRef,\n cssVarName: '--bottom-size',\n orientation: 'horizontal',\n edge: 'start',\n growth: bottomAnchoredGrowth,\n expandedSize,\n minSize,\n maxSize,\n resizable,\n collapsible,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n overlaying: pane.overlaying,\n overlayingNow: () => table[readBreakpoint()] === 'overlay',\n requestCollapse: () => pane.setValue('closed', 'toggle'),\n requestToggle: () => pane.toggle('toggle'),\n });\n\n // The starting size is in the server HTML, so the pane does not jump on hydration.\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n const { handles, content } = splitHandles(children, BottomHandle);\n const handle = resizable && pane.shown !== false && !pane.overlaying ? <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider> : null;\n\n return (\n <div\n {...withoutRemovedPaneProps(domProps)}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellBottom', className)}\n {...paneAttributes(pane, attributes)}\n data-flush={flush || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--bottom-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--bottom-size': initialSize } : {}),\n '--bottom-min-size': `${minSize}px`,\n '--bottom-max-size': `${maxSize}px`,\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellBottomContent\">\n <PageScope>{content}</PageScope>\n </div>\n {handle}\n </div>\n );\n}) as BottomComponent;\n\nBottom.displayName = 'Shell.Bottom';\nBottom.Handle = BottomHandle;\n\nexport type { BottomPublicProps };\n"],
|
|
5
|
+
"mappings": ";wXAEA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,OAAS,mBAAAC,OAAuB,oBAkChC,IAAMC,GAAoB,CAAE,WAAY,OAAQ,QAAS,aAAc,EAE1DC,EAAe,aAA8C,CAACC,EAAOC,IAAQ,CACxF,GAAM,CACJ,UAAAC,EACA,aAAAC,EAAe,QAC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AAC,EACA,SAAAd,EACA,cAAAC,EACA,YAAAC,EACA,WAAAC,EACA,cAAAC,EACA,kBAAAC,EACA,OAAAC,EACA,YAAAC,EACA,WAAYc,EAAK,WACjB,cAAe,IAAMH,EAAMgB,EAAe,CAAC,IAAM,UACjD,gBAAiB,IAAMb,EAAK,SAAS,SAAU,QAAQ,EACvD,cAAe,IAAMA,EAAK,OAAO,QAAQ,CAC3C,CAAC,EAGKc,EAAcC,EAAmB1B,EAAMC,EAAajB,EAASC,CAAO,EACpE,CAAE,QAAA0C,EAAS,QAAAC,EAAQ,EAAIC,EAAa/B,EAAUgC,CAAY,EAC1DC,GAAS7C,GAAayB,EAAK,QAAU,IAAS,CAACA,EAAK,WAAa,gBAACqB,EAAkB,SAAlB,CAA2B,MAAOX,IAASM,EAAQ,OAAS,EAAIA,EAAU,gBAACM,EAAA,IAAW,CAAG,EAAgC,KAEjM,OACE,gBAAC,OACE,GAAGC,EAAwB3B,CAAQ,EACpC,GAAII,EAAK,GACT,IAAKQ,GACL,UAAWgB,GAAW,gBAAiB,kBAAmBzD,CAAS,EAClE,GAAG0D,EAAezB,EAAMF,EAAU,EACnC,aAAYJ,GAAS,OACrB,SAAUM,EAAK,WAAa,GAAKJ,EAAS,SAC1C,MACE,CACE,GAAGR,EACH,yBAA0B,GAAGhB,CAAY,KACzC,GAAI0C,EAAc,CAAE,gBAAiBA,CAAY,EAAI,CAAC,EACtD,oBAAqB,GAAGzC,CAAO,KAC/B,oBAAqB,GAAGC,CAAO,IACjC,GAGF,gBAAC,OAAI,UAAU,0BACb,gBAACoD,EAAA,KAAWT,EAAQ,CACtB,EACCG,EACH,CAEJ,CAAC,EAEDxD,EAAO,YAAc,eACrBA,EAAO,OAASuD",
|
|
6
|
+
"names": ["React", "classNames", "useComposedRefs", "BOTTOM_PROP_NAMES", "Bottom", "props", "ref", "className", "presentation", "defaultOpen", "open", "onOpenChange", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "flush", "id", "domProps", "table", "attributes", "usePresentationTable", "pane", "usePane", "toPaneValue", "detailRest", "value", "reason", "useFrameRegistration", "elementRef", "composedRef", "useComposedRefs", "resize", "useResizablePane", "bottomAnchoredGrowth", "readBreakpoint", "initialSize", "useInitialPaneSize", "handles", "content", "splitHandles", "BottomHandle", "handle", "PaneResizeContext", "PaneHandle", "withoutRemovedPaneProps", "classNames", "paneAttributes", "PageScope"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as c,c as M,e as w,g as H}from"./chunk-XUCR7L4G.js";import{a as v,d}from"./chunk-3QWGSRYC.js";import{a as y,b as x,c as O}from"./chunk-KGCGT4MJ.js";import{a as E,b as T,c as N}from"./chunk-QKCNGEX4.js";import{a as R}from"./chunk-WEBNIUEX.js";import{a as S}from"./chunk-G66WDIIV.js";import{b}from"./chunk-VWRPVM5K.js";import{o as C}from"./chunk-5BXCPANF.js";import*as e from"react";import le from"classnames";import{useComposedRefs as pe}from"radix-ui/internal";var de={controlled:"open",default:"defaultOpen"},ce={initial:"overlay",sm:"fixed"},U=e.forwardRef((k,A)=>{let{className:B,presentation:V=ce,defaultOpen:L,open:_,onOpenChange:D,expandedSize:o=320,minSize:t=200,maxSize:s=500,resizable:m=!1,collapsible:F=!0,onExpand:$,onCollapse:q,onResize:W,onResizeStart:j,onResizeEnd:G,snapPoints:r,snapTolerance:K,collapseThreshold:a,paneId:i,persistence:l,children:J,style:Q,onSizeChange:X,sizeUpdate:Y,sizeUpdateMs:Z=50,size:u,defaultSize:P,flush:f=!0,id:ee,...p}=k,{table:z,attributes:ne}=O(V,"fixed"),n=y({name:"inspector",label:"Inspector",propNames:de,id:ee,controlled:c(_),defaultValue:c(L),presentationTable:z,builtIn:M,onChange:(ae,ie)=>D?.(ae!=="closed",{reason:ie}),onExpand:$,onCollapse:q,size:o});C("inspector",f),e.useEffect(()=>{(r!==void 0||a!==void 0||i!==void 0||l!==void 0)&&void 0},[r,a,i,l]);let h=e.useRef(null),oe=pe(A,n.setElement,h),te=T({name:"inspector",elementId:n.id,elementRef:h,cssVarName:"--inspector-size",orientation:"vertical",edge:"start",growth:w,expandedSize:o,minSize:t,maxSize:s,resizable:m,collapsible:F,size:u,defaultSize:P,onSizeChange:X,sizeUpdate:Y,sizeUpdateMs:Z,onResize:W,onResizeStart:j,onResizeEnd:G,snapPoints:r,snapTolerance:K,collapseThreshold:a,paneId:i,persistence:l,overlaying:n.overlaying,overlayingNow:()=>z[S()]==="overlay",requestCollapse:()=>n.setValue("closed","toggle"),requestToggle:()=>n.toggle("toggle")}),{handles:g,content:se}=N(J,d),re=m&&n.shown!==!1&&!n.overlaying?e.createElement(R.Provider,{value:te},g.length>0?g:e.createElement(v,null)):null,I=E(u,P,t,s);return e.createElement("div",{...H(p),role:p.role??"complementary",id:n.id,ref:oe,className:le("kui-ShellPane","kui-ShellInspector",B),...x(n,ne),"data-flush":f||void 0,tabIndex:n.overlaying?-1:p.tabIndex,style:{...Q,"--inspector-expanded-size":`${o}px`,...I?{"--inspector-size":I}:{},"--inspector-min-size":`${t}px`,"--inspector-max-size":`${s}px`}},e.createElement("div",{className:"kui-ShellInspectorContent"},e.createElement(b,null,se)),re)});U.displayName="Shell.Inspector";U.Handle=d;export{U as a};
|
|
3
|
+
//# sourceMappingURL=chunk-XD676L6S.js.map
|