@womp/kookie-ui 0.36.0 → 0.37.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 +0 -20
- package/dist/cjs/components/_internal/base-menu.utils.js +1 -1
- package/dist/cjs/components/_internal/base-menu.utils.js.map +2 -2
- package/dist/cjs/components/_internal/menu-context.js +1 -1
- package/dist/cjs/components/_internal/menu-context.js.map +2 -2
- 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 +3 -3
- 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-handles.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-handles.js +1 -1
- package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
- package/dist/cjs/components/_internal/shell-inspector.d.ts +3 -3
- 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.d.ts +2 -7
- package/dist/cjs/components/_internal/shell-pane.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-pane.js +1 -1
- package/dist/cjs/components/_internal/shell-pane.js.map +3 -3
- package/dist/cjs/components/_internal/shell-resizable.d.ts +3 -9
- package/dist/cjs/components/_internal/shell-resizable.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-resizable.js +1 -1
- package/dist/cjs/components/_internal/shell-resizable.js.map +3 -3
- package/dist/cjs/components/_internal/shell-resize.d.ts +0 -4
- package/dist/cjs/components/_internal/shell-resize.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-resize.js +1 -1
- package/dist/cjs/components/_internal/shell-resize.js.map +2 -2
- package/dist/cjs/components/_internal/shell-rest.d.ts +1 -6
- package/dist/cjs/components/_internal/shell-rest.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-rest.js +1 -1
- package/dist/cjs/components/_internal/shell-rest.js.map +3 -3
- package/dist/cjs/components/_internal/shell-sidebar.d.ts +3 -3
- 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 +0 -10
- 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/checkbox-group.js +1 -1
- package/dist/cjs/components/checkbox-group.js.map +3 -3
- package/dist/cjs/components/checkbox-group.primitive.d.ts +0 -10
- package/dist/cjs/components/checkbox-group.primitive.d.ts.map +1 -1
- package/dist/cjs/components/checkbox-group.primitive.js +1 -1
- package/dist/cjs/components/checkbox-group.primitive.js.map +3 -3
- package/dist/cjs/components/context-menu.d.ts +1 -5
- package/dist/cjs/components/context-menu.d.ts.map +1 -1
- package/dist/cjs/components/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +3 -3
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +2 -2
- package/dist/cjs/components/index.js +2 -2
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/components/navigator.js.map +2 -2
- package/dist/cjs/components/schemas/index.d.ts +1 -1
- package/dist/cjs/components/schemas/index.d.ts.map +1 -1
- package/dist/cjs/components/schemas/index.js +1 -1
- package/dist/cjs/components/schemas/index.js.map +3 -3
- package/dist/cjs/components/schemas/shell.schema.d.ts +6 -112
- package/dist/cjs/components/schemas/shell.schema.d.ts.map +1 -1
- package/dist/cjs/components/schemas/shell.schema.js +1 -1
- package/dist/cjs/components/schemas/shell.schema.js.map +3 -3
- package/dist/cjs/components/separator.js +1 -1
- package/dist/cjs/components/separator.js.map +2 -2
- package/dist/cjs/components/shell.context.d.ts +1 -45
- package/dist/cjs/components/shell.context.d.ts.map +1 -1
- package/dist/cjs/components/shell.context.js +1 -1
- package/dist/cjs/components/shell.context.js.map +4 -4
- package/dist/cjs/components/shell.d.ts +7 -37
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +4 -4
- package/dist/cjs/components/shell.types.d.ts +6 -27
- package/dist/cjs/components/shell.types.d.ts.map +1 -1
- package/dist/cjs/components/shell.types.js +1 -1
- package/dist/cjs/components/shell.types.js.map +2 -2
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.js.map +2 -2
- package/dist/cjs/components/toolbar.js +1 -1
- package/dist/cjs/components/toolbar.js.map +2 -2
- package/dist/cjs/hooks/use-breakpoint.js +1 -1
- package/dist/cjs/hooks/use-breakpoint.js.map +2 -2
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +4 -4
- package/dist/esm/{chunk-5RLGDXOM.js → chunk-2K46JPUL.js} +2 -2
- package/dist/esm/chunk-3K7E4XL3.js +3 -0
- package/dist/esm/chunk-3K7E4XL3.js.map +7 -0
- package/dist/esm/chunk-3LR7KMBE.js +3 -0
- package/dist/esm/chunk-3LR7KMBE.js.map +7 -0
- package/dist/esm/chunk-5U2LEJLU.js +3 -0
- package/dist/esm/chunk-5U2LEJLU.js.map +7 -0
- package/dist/esm/{chunk-IN6D33TU.js → chunk-5XO3PLDH.js} +2 -2
- package/dist/esm/{chunk-COLJWVN7.js → chunk-AQR42GKA.js} +2 -2
- package/dist/esm/{chunk-FTNZWAPB.js → chunk-ARPUPT4M.js} +2 -2
- package/dist/esm/{chunk-ISCZ57VL.js → chunk-DJGZ4K3V.js} +2 -2
- package/dist/esm/{chunk-PMXIQ5B4.js → chunk-FKCKELUB.js} +2 -2
- package/dist/esm/chunk-H7GH3DTF.js +3 -0
- package/dist/esm/chunk-H7GH3DTF.js.map +7 -0
- package/dist/esm/{chunk-E6MOZSYV.js → chunk-HNOT2HS4.js} +2 -2
- package/dist/esm/chunk-LBAC2X4U.js +3 -0
- package/dist/esm/{chunk-5BXCPANF.js.map → chunk-LBAC2X4U.js.map} +3 -3
- package/dist/esm/{chunk-MAA6LEE2.js → chunk-MDQ7ZHOS.js} +1 -1
- package/dist/esm/chunk-MDQ7ZHOS.js.map +7 -0
- package/dist/esm/chunk-MQA3BKF4.js +3 -0
- package/dist/esm/chunk-MQA3BKF4.js.map +7 -0
- package/dist/esm/chunk-MXNPCJPV.js +3 -0
- package/dist/esm/chunk-MXNPCJPV.js.map +7 -0
- package/dist/esm/{chunk-EB4AG3OL.js → chunk-REELD6CT.js} +2 -2
- package/dist/esm/chunk-RYXIRZQW.js +3 -0
- package/dist/esm/chunk-RYXIRZQW.js.map +7 -0
- package/dist/esm/chunk-S66WR5R7.js +3 -0
- package/dist/esm/{chunk-MXEOE4LA.js.map → chunk-S66WR5R7.js.map} +2 -2
- package/dist/esm/chunk-SECVO3CW.js +3 -0
- package/dist/esm/chunk-SECVO3CW.js.map +7 -0
- package/dist/esm/chunk-SHDZYFUN.js +3 -0
- package/dist/esm/chunk-SHDZYFUN.js.map +7 -0
- package/dist/esm/{chunk-3M5ZM67R.js → chunk-TCFBNE6A.js} +2 -2
- package/dist/esm/chunk-U7P64MXD.js +3 -0
- package/dist/esm/chunk-U7P64MXD.js.map +7 -0
- package/dist/esm/chunk-UFYQC5XY.js +3 -0
- package/dist/esm/chunk-UFYQC5XY.js.map +7 -0
- package/dist/esm/{chunk-G66WDIIV.js → chunk-WJKCXGVN.js} +2 -2
- package/dist/esm/chunk-XBDAE77C.js +3 -0
- package/dist/esm/chunk-XBDAE77C.js.map +7 -0
- package/dist/esm/{chunk-SIYOLE6P.js → chunk-YM47BXKK.js} +2 -2
- package/dist/esm/components/_internal/base-menu.utils.js +1 -1
- package/dist/esm/components/_internal/menu-context.js +1 -1
- package/dist/esm/components/_internal/pane-chrome.js +1 -1
- package/dist/esm/components/_internal/shell-bottom.d.ts +3 -3
- 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-handles.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-handles.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.d.ts +3 -3
- 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.d.ts +2 -7
- package/dist/esm/components/_internal/shell-pane.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-pane.js +1 -1
- package/dist/esm/components/_internal/shell-resizable.d.ts +3 -9
- package/dist/esm/components/_internal/shell-resizable.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-resizable.js +1 -1
- package/dist/esm/components/_internal/shell-resize.d.ts +0 -4
- package/dist/esm/components/_internal/shell-resize.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-resize.js +1 -1
- package/dist/esm/components/_internal/shell-rest.d.ts +1 -6
- package/dist/esm/components/_internal/shell-rest.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-rest.js +1 -1
- package/dist/esm/components/_internal/shell-sidebar.d.ts +3 -3
- 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 +0 -10
- 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/checkbox-group.js +1 -1
- package/dist/esm/components/checkbox-group.primitive.d.ts +0 -10
- package/dist/esm/components/checkbox-group.primitive.d.ts.map +1 -1
- package/dist/esm/components/checkbox-group.primitive.js +1 -1
- package/dist/esm/components/context-menu.d.ts +1 -5
- package/dist/esm/components/context-menu.d.ts.map +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/navigator.js +1 -1
- package/dist/esm/components/schemas/index.d.ts +1 -1
- package/dist/esm/components/schemas/index.d.ts.map +1 -1
- package/dist/esm/components/schemas/index.js +1 -1
- package/dist/esm/components/schemas/index.js.map +2 -2
- package/dist/esm/components/schemas/shell.schema.d.ts +6 -112
- package/dist/esm/components/schemas/shell.schema.d.ts.map +1 -1
- package/dist/esm/components/schemas/shell.schema.js +1 -1
- package/dist/esm/components/separator.js +1 -1
- package/dist/esm/components/shell.context.d.ts +1 -45
- package/dist/esm/components/shell.context.d.ts.map +1 -1
- package/dist/esm/components/shell.context.js +1 -1
- package/dist/esm/components/shell.d.ts +7 -37
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/shell.types.d.ts +6 -27
- package/dist/esm/components/shell.types.d.ts.map +1 -1
- package/dist/esm/components/shell.types.js +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/virtual-menu.js +1 -1
- package/dist/esm/hooks/use-breakpoint.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/schemas/index.json +13 -335
- package/schemas/shell-bottom.json +2 -63
- package/schemas/shell-inspector.json +2 -63
- package/schemas/shell-panel.json +2 -63
- package/schemas/shell-rail.json +2 -38
- package/schemas/shell-sidebar.json +5 -102
- package/schemas/shell-trigger.json +0 -6
- package/src/components/_internal/shell-bottom.tsx +6 -26
- package/src/components/_internal/shell-handles.tsx +2 -32
- package/src/components/_internal/shell-inspector.tsx +6 -26
- package/src/components/_internal/shell-pane.tsx +7 -56
- package/src/components/_internal/shell-resizable.tsx +6 -81
- package/src/components/_internal/shell-resize.tsx +0 -4
- package/src/components/_internal/shell-rest.ts +2 -11
- package/src/components/_internal/shell-sidebar.tsx +8 -30
- package/src/components/_internal/shell-store.tsx +1 -34
- package/src/components/checkbox-group.primitive.tsx +0 -12
- package/src/components/context-menu.tsx +1 -6
- package/src/components/schemas/index.ts +0 -1
- package/src/components/schemas/shell.schema.ts +3 -20
- package/src/components/shell.context.tsx +5 -112
- package/src/components/shell.css +1 -29
- package/src/components/shell.tsx +12 -97
- package/src/components/shell.types.ts +6 -28
- package/styles.css +0 -20
- package/dist/cjs/components/shell.hooks.d.ts +0 -10
- package/dist/cjs/components/shell.hooks.d.ts.map +0 -1
- package/dist/cjs/components/shell.hooks.js +0 -3
- package/dist/cjs/components/shell.hooks.js.map +0 -7
- package/dist/esm/chunk-2VSRZ4IT.js +0 -3
- package/dist/esm/chunk-2VSRZ4IT.js.map +0 -7
- package/dist/esm/chunk-2WFN4D52.js +0 -3
- package/dist/esm/chunk-2WFN4D52.js.map +0 -7
- package/dist/esm/chunk-4OJRLS5N.js +0 -3
- package/dist/esm/chunk-4OJRLS5N.js.map +0 -7
- package/dist/esm/chunk-4TTRPCGG.js +0 -3
- package/dist/esm/chunk-4TTRPCGG.js.map +0 -7
- package/dist/esm/chunk-5BXCPANF.js +0 -3
- package/dist/esm/chunk-B447PNRD.js +0 -3
- package/dist/esm/chunk-B447PNRD.js.map +0 -7
- package/dist/esm/chunk-BJVXB3PN.js +0 -3
- package/dist/esm/chunk-BJVXB3PN.js.map +0 -7
- package/dist/esm/chunk-DNY4WWZF.js +0 -3
- package/dist/esm/chunk-DNY4WWZF.js.map +0 -7
- package/dist/esm/chunk-HQT32HQ6.js +0 -3
- package/dist/esm/chunk-HQT32HQ6.js.map +0 -7
- package/dist/esm/chunk-KGCGT4MJ.js +0 -3
- package/dist/esm/chunk-KGCGT4MJ.js.map +0 -7
- package/dist/esm/chunk-M26LLCQC.js +0 -3
- package/dist/esm/chunk-M26LLCQC.js.map +0 -7
- package/dist/esm/chunk-MAA6LEE2.js.map +0 -7
- package/dist/esm/chunk-MXEOE4LA.js +0 -3
- package/dist/esm/chunk-TS4QCDSI.js +0 -3
- package/dist/esm/chunk-TS4QCDSI.js.map +0 -7
- package/dist/esm/chunk-XOAOSRTH.js +0 -3
- package/dist/esm/chunk-XOAOSRTH.js.map +0 -7
- package/dist/esm/chunk-XUCR7L4G.js +0 -3
- package/dist/esm/chunk-XUCR7L4G.js.map +0 -7
- package/dist/esm/components/shell.hooks.d.ts +0 -10
- package/dist/esm/components/shell.hooks.d.ts.map +0 -1
- package/dist/esm/components/shell.hooks.js +0 -3
- package/dist/esm/components/shell.hooks.js.map +0 -7
- package/src/components/shell.hooks.ts +0 -20
- /package/dist/esm/{chunk-5RLGDXOM.js.map → chunk-2K46JPUL.js.map} +0 -0
- /package/dist/esm/{chunk-IN6D33TU.js.map → chunk-5XO3PLDH.js.map} +0 -0
- /package/dist/esm/{chunk-COLJWVN7.js.map → chunk-AQR42GKA.js.map} +0 -0
- /package/dist/esm/{chunk-FTNZWAPB.js.map → chunk-ARPUPT4M.js.map} +0 -0
- /package/dist/esm/{chunk-ISCZ57VL.js.map → chunk-DJGZ4K3V.js.map} +0 -0
- /package/dist/esm/{chunk-PMXIQ5B4.js.map → chunk-FKCKELUB.js.map} +0 -0
- /package/dist/esm/{chunk-E6MOZSYV.js.map → chunk-HNOT2HS4.js.map} +0 -0
- /package/dist/esm/{chunk-EB4AG3OL.js.map → chunk-REELD6CT.js.map} +0 -0
- /package/dist/esm/{chunk-3M5ZM67R.js.map → chunk-TCFBNE6A.js.map} +0 -0
- /package/dist/esm/{chunk-G66WDIIV.js.map → chunk-WJKCXGVN.js.map} +0 -0
- /package/dist/esm/{chunk-SIYOLE6P.js.map → chunk-YM47BXKK.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/shell.types.ts"],
|
|
4
|
+
"sourcesContent": ["import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\n/**\n * Why a pane's open state changed. Only a user action is reported: `toggle` for a Trigger or a\n * handle double-click, and `dismiss` for Escape or a press on the scrim.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\n/** The panes a Trigger can drive. */\nexport type PaneTarget = 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\nexport type PaneName = PaneTarget;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n"],
|
|
5
|
+
"mappings": ";AAiCO,IAAMA,EAAe,CAC1B,GAAI,qBACJ,GAAI,qBACJ,GAAI,sBACJ,GAAI,sBACJ,GAAI,qBACN,EAKaC,EAA2C,CAAC,UAAW,KAAM,KAAM,KAAM,KAAM,IAAI",
|
|
6
|
+
"names": ["_BREAKPOINTS", "SHELL_BREAKPOINTS"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{b as N,d as k}from"./chunk-SHDZYFUN.js";import{a as M,c as p}from"./chunk-RYXIRZQW.js";import{a as y,b as x,c as V}from"./chunk-UFYQC5XY.js";import{a as E,b as T,c as B}from"./chunk-MXNPCJPV.js";import{a as C}from"./chunk-S66WR5R7.js";import{a as h}from"./chunk-WJKCXGVN.js";import{b as R}from"./chunk-VWRPVM5K.js";import{f as v}from"./chunk-FKCKELUB.js";import{m as z}from"./chunk-LBAC2X4U.js";import*as e from"react";import te from"classnames";import{useComposedRefs as ne}from"radix-ui/internal";var A=a=>a==="collapsed"?"closed":"open",oe=a=>a==="closed"?"collapsed":"expanded";function H(a){if(a===void 0)return;if(typeof a=="string")return A(a);let n={};for(let[i,o]of Object.entries(a))o!==void 0&&(n[i]=A(o));return n}var ie={controlled:"state",default:"defaultState"},re={initial:"overlay",sm:"fixed"},I=e.forwardRef((a,n)=>{let{className:i,presentation:o=re,expandedSize:r=288,minSize:d=200,maxSize:s=400,resizable:u=!1,collapsible:U=!0,onResize:w,onResizeStart:D,onResizeEnd:O,children:L,style:_,state:F,defaultState:$,onStateChange:j,size:S,defaultSize:m,onSizeChange:W,sizeUpdate:q,sizeUpdateMs:G=50,flush:b=!0,id:J,...l}=a,{table:c,attributes:K}=V(o,"fixed"),t=y({name:"sidebar",label:"Sidebar",propNames:ie,id:J,controlled:H(F),defaultValue:H($),presentationTable:c,builtIn:N,onChange:(ee,ae)=>j?.(oe(ee),{reason:ae}),size:r});z("sidebar",b);let f=e.useRef(null),Q=ne(n,t.setElement,f),X=T({name:"sidebar",elementId:t.id,elementRef:f,cssVarName:"--sidebar-size",orientation:"vertical",edge:"end",growth:k,expandedSize:r,minSize:d,maxSize:s,resizable:u,collapsible:U,size:S,defaultSize:m,onSizeChange:W,sizeUpdate:q,sizeUpdateMs:G,onResize:w,onResizeStart:D,onResizeEnd:O,overlaying:t.overlaying,overlayingNow:()=>c[h()]==="overlay",requestToggle:()=>t.toggle("toggle")}),{handles:P,content:Y}=B(L,p),Z=u&&t.value!=="closed"&&!t.overlaying?e.createElement(C.Provider,{value:X},P.length>0?P:e.createElement(M,null)):null,g=E(S,m,d,s);return e.createElement("div",{...l,role:l.role??"navigation",id:t.id,ref:Q,className:te("kui-ShellPane","kui-ShellSidebar",i),...x(t,K),"data-flush":b||void 0,tabIndex:t.overlaying?-1:l.tabIndex,style:{..._,"--sidebar-expanded-size":`${r}px`,...g?{"--sidebar-size":g}:{},"--sidebar-min-size":`${d}px`,"--sidebar-max-size":`${s}px`}},e.createElement("div",{className:"kui-ShellSidebarContent"},e.createElement(v,null,e.createElement(R,null,Y))),Z)});I.displayName="Shell.Sidebar";I.Handle=p;export{I as a};
|
|
3
|
+
//# sourceMappingURL=chunk-MQA3BKF4.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, type PaneValue } from './shell-store.js';\nimport { navigationRest, startAnchoredGrowth } 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, PaneOpenChangeReason, Responsive, SidebarMode } from '../shell.types.js';\n\ntype SidebarStateChangeMeta = { reason: PaneOpenChangeReason };\ntype SidebarControlledProps = { state: 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: SidebarMode | undefined): PaneValue | undefined;\nfunction modeToValue(state: Responsive<SidebarMode> | undefined): PaneValue | Partial<Record<Breakpoint, PaneValue>> | undefined;\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 onResize,\n onResizeStart,\n onResizeEnd,\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 size: expandedSize,\n });\n useFrameRegistration('sidebar', flush);\n\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 overlaying: pane.overlaying,\n overlayingNow: () => table[readBreakpoint()] === 'overlay',\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 const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n return (\n <div\n {...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 } 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": ";kZAEA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,OAAS,mBAAAC,OAAuB,oBAgChC,IAAMC,EAAWC,GAAkCA,IAAS,YAAc,SAAW,OAC/EC,GAAUC,GAAmCA,IAAU,SAAW,YAAc,WAItF,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,EAGpE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ACjD,cAAe,IAAMX,EAAK,OAAO,QAAQ,CAC3C,CAAC,EAEK,CAAE,QAAAY,EAAS,QAAAC,CAAQ,EAAIC,EAAa7B,EAAU8B,CAAa,EAC3DC,EACJpC,GAAaoB,EAAK,QAAU,UAAY,CAACA,EAAK,WAC5C,gBAACiB,EAAkB,SAAlB,CAA2B,MAAOT,GAASI,EAAQ,OAAS,EAAIA,EAAU,gBAACM,EAAA,IAAW,CAAG,EACxF,KAEAC,EAAcC,EAAmB/B,EAAMC,EAAaZ,EAASC,CAAO,EAC1E,OACE,gBAAC,OACE,GAAGiB,EACJ,KAAMA,EAAS,MAAQ,aACvB,GAAII,EAAK,GACT,IAAKM,EACL,UAAWe,GAAW,gBAAiB,mBAAoB9C,CAAS,EACnE,GAAG+C,EAAetB,EAAMF,CAAU,EACnC,aAAYJ,GAAS,OACrB,SAAUM,EAAK,WAAa,GAAKJ,EAAS,SAC1C,MACE,CACE,GAAGV,EACH,0BAA2B,GAAGT,CAAY,KAC1C,GAAI0C,EAAc,CAAE,iBAAkBA,CAAY,EAAI,CAAC,EACvD,qBAAsB,GAAGzC,CAAO,KAChC,qBAAsB,GAAGC,CAAO,IAClC,GAGF,gBAAC,OAAI,UAAU,2BACb,gBAAC4C,EAAA,KACC,gBAACC,EAAA,KAAWX,CAAQ,CACtB,CACF,EACCG,CACH,CAEJ,CAAC,EAED5C,EAAQ,YAAc,gBACtBA,EAAQ,OAAS2C",
|
|
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", "onResize", "onResizeStart", "onResizeEnd", "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", "initialSize", "useInitialPaneSize", "classNames", "paneAttributes", "PaneChromeScope", "PageScope"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import*as t from"react";import{useLayoutEffect as p}from"radix-ui/internal";function P(e,a="horizontal"){if(e==null)return;if(typeof e=="number"&&Number.isFinite(e))return e;let r=String(e).trim();if(!r)return;if(r.endsWith("px"))return Number.parseFloat(r);if(r.endsWith("rem")){let u=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||"16")||16;return Number.parseFloat(r)*u}if(r.endsWith("%")){let u=Number.parseFloat(r),i=a==="horizontal"?document.documentElement.clientWidth||window.innerWidth||0:document.documentElement.clientHeight||window.innerHeight||0;return u/100*i}let o=Number.parseFloat(r);return Number.isFinite(o)?o:void 0}var g=(e,a,r)=>Math.max(a??e,Math.min(r??e,e));function W(e,a,r,o){let[u]=t.useState(()=>{let i=e??a;return typeof i=="number"&&Number.isFinite(i)?`${g(i,r,o)}px`:void 0});return u}function q(e){let{name:a,elementRef:r,cssVarName:o,orientation:u,minSize:i,maxSize:l,size:f,defaultSize:h}=e,c=t.useRef(e);p(()=>{c.current=e});let d=t.useRef(null),y=t.useRef(0);t.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);let b=t.useCallback((n,s)=>{let{onSizeChange:m,sizeUpdate:R,sizeUpdateMs:F}=c.current;if(m){if(R==="debounce"){d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{d.current=null,c.current.onSizeChange?.(n,s)},F);return}if(R==="throttle"){let M=Date.now();if(M-y.current<F)return;y.current=M}m(n,s)}},[]),S=t.useCallback(n=>P(n,u==="vertical"?"horizontal":"vertical"),[u]),x=t.useRef(!1),z=t.useCallback((n,s)=>{let m=r.current;if(m){m.style.setProperty(o,`${n}px`);for(let R of m.querySelectorAll(":scope > .kui-ShellResizer"))R.setAttribute("aria-valuenow",String(Math.round(n)));s&&(x.current=!0)}},[r,o]);p(()=>{x.current||z(e.expandedSize,!1)},[e.expandedSize,z]),p(()=>{if(f!==void 0||h===void 0)return;let n=S(h);if(typeof n!="number"||!Number.isFinite(n))return;let s=g(n,i,l);z(s,!0),b(s,{reason:"init"})},[]),p(()=>{if(f===void 0||c.current.overlayingNow())return;let n=S(f);if(typeof n!="number"||!Number.isFinite(n))return;let s=g(n,i,l);z(s,!0),b(s,{reason:"controlled"})},[f,i,l,e.overlaying,S,z,b]);let[C]=t.useState(()=>{let n=f??h;return typeof n=="number"&&Number.isFinite(n)?g(n,i,l):e.expandedSize}),N=t.useCallback(n=>c.current.onResize?.(n),[]),w=t.useCallback(n=>{x.current=!0,c.current.onResizeStart?.(n)},[]),E=t.useCallback(n=>{c.current.onResizeEnd?.(n),b(n,{reason:"resize"})},[b]),T=t.useCallback(()=>c.current.requestToggle(),[]);return t.useMemo(()=>({containerRef:r,controls:e.elementId,cssVarName:o,minSize:i,maxSize:l,defaultSize:e.expandedSize,startSize:C,orientation:u,edge:e.edge,growth:e.growth,onResize:N,onResizeStart:w,onResizeEnd:E,target:a,collapsible:e.collapsible,requestToggle:T}),[r,e.elementId,o,i,l,e.expandedSize,C,u,e.edge,e.growth,N,w,E,a,e.collapsible,T])}function H(e,a){let r=t.Children.toArray(e),o=r.filter(i=>t.isValidElement(i)&&i.type===a),u=r.filter(i=>!(t.isValidElement(i)&&i.type===a));return{handles:o,content:u}}export{W as a,q as b,H as c};
|
|
3
|
+
//# sourceMappingURL=chunk-MXNPCJPV.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/_internal/shell-resizable.tsx", "../../src/helpers/normalize-to-px.ts"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport { normalizeToPx } from '../../helpers/normalize-to-px.js';\nimport type { PaneName } from '../shell.types.js';\nimport type { PaneResizeContextValue } from './shell-resize.js';\n\nexport type SizeChangeMeta = { reason: 'init' | 'resize' | 'controlled' };\n\nexport type ResizableOptions = {\n name: PaneName;\n /** The pane's element id, which the handle names in `aria-controls`. */\n elementId: string;\n elementRef: React.RefObject<HTMLElement | null>;\n cssVarName: string;\n orientation: 'vertical' | 'horizontal';\n edge: 'start' | 'end';\n growth: (isRtl: boolean) => 1 | -1;\n expandedSize: number;\n minSize: number;\n maxSize: number;\n resizable: boolean;\n collapsible: boolean;\n size: number | string | undefined;\n defaultSize: number | string | undefined;\n onSizeChange: ((size: number, meta: SizeChangeMeta) => void) | undefined;\n sizeUpdate: 'throttle' | 'debounce' | undefined;\n sizeUpdateMs: number;\n onResize: ((size: number) => void) | undefined;\n onResizeStart: ((size: number) => void) | undefined;\n onResizeEnd: ((size: number) => void) | undefined;\n /** Whether the pane is presented as an overlay right now. An overlay keeps its designed size. */\n overlaying: boolean;\n /** The same question asked at effect time, for a pane whose presentation is learnt after its first render. */\n overlayingNow: () => boolean;\n requestToggle: () => void;\n};\n\n/**\n * Clamps to [min, max]. When the two cross (an app passing a maximum computed\n * from a narrow window below its fixed minimum), the minimum wins, as it did\n * in 0.7.\n */\nconst clampTo = (value: number, min: number | undefined, max: number | undefined) => Math.max(min ?? value, Math.min(max ?? value, value));\n\n/**\n * The pane's starting size for the first render, so the server HTML already has it and the first\n * paint is right. Only a number can be known before the pane exists (a percentage needs the\n * Shell's width); the effects below still own the size after mount.\n */\nexport function useInitialPaneSize(size: number | string | undefined, defaultSize: number | string | undefined, minSize: number, maxSize: number) {\n const [initial] = React.useState(() => {\n const value = size ?? defaultSize;\n return typeof value === 'number' && Number.isFinite(value) ? `${clampTo(value, minSize, maxSize)}px` : undefined;\n });\n return initial;\n}\n\n/** Everything a resizable pane shares: size props and the handle's context. */\nexport function useResizablePane(options: ResizableOptions): PaneResizeContextValue {\n const { name, elementRef, cssVarName, orientation, minSize, maxSize, size, defaultSize } = options;\n\n // The latest callbacks, so the size emitter does not change identity when a\n // consumer passes an inline function. A controlled `size` is reported again\n // only when the size, the minimum or the maximum changes.\n const latest = React.useRef(options);\n useLayoutEffect(() => {\n latest.current = options;\n });\n\n const debounceRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const throttleRef = React.useRef(0);\n React.useEffect(\n () => () => {\n if (debounceRef.current) clearTimeout(debounceRef.current);\n },\n [],\n );\n const emitSizeChange = React.useCallback((value: number, meta: SizeChangeMeta) => {\n const { onSizeChange, sizeUpdate, sizeUpdateMs } = latest.current;\n if (!onSizeChange) return;\n if (sizeUpdate === 'debounce') {\n if (debounceRef.current) clearTimeout(debounceRef.current);\n debounceRef.current = setTimeout(() => {\n debounceRef.current = null;\n latest.current.onSizeChange?.(value, meta);\n }, sizeUpdateMs);\n return;\n }\n if (sizeUpdate === 'throttle') {\n const now = Date.now();\n if (now - throttleRef.current < sizeUpdateMs) return;\n throttleRef.current = now;\n }\n onSizeChange(value, meta);\n }, []);\n\n const toPx = React.useCallback((value: number | string | undefined) => normalizeToPx(value, orientation === 'vertical' ? 'horizontal' : 'vertical'), [orientation]);\n\n /**\n * The one way a size reaches the pane: the size variable, and the value\n * every handle of this pane announces. Once anything but `expandedSize` has\n * written a size (a default, a controlled value or a\n * resize), the pane owns that size and a new `expandedSize` leaves it alone.\n */\n const ownedRef = React.useRef(false);\n const writeSize = React.useCallback(\n (value: number, own: boolean) => {\n const el = elementRef.current;\n if (!el) return;\n el.style.setProperty(cssVarName, `${value}px`);\n for (const handle of el.querySelectorAll(':scope > .kui-ShellResizer')) handle.setAttribute('aria-valuenow', String(Math.round(value)));\n if (own) ownedRef.current = true;\n },\n [elementRef, cssVarName],\n );\n\n // expandedSize: the size until something else sets one. Declared first, so\n // the effects below win on mount.\n useLayoutEffect(() => {\n if (!ownedRef.current) writeSize(options.expandedSize, false);\n }, [options.expandedSize, writeSize]);\n\n // defaultSize: applied once, on mount.\n useLayoutEffect(() => {\n if (size !== undefined || defaultSize === undefined) return;\n const px = toPx(defaultSize);\n if (typeof px !== 'number' || !Number.isFinite(px)) return;\n const clamped = clampTo(px, minSize, maxSize);\n writeSize(clamped, true);\n emitSizeChange(clamped, { reason: 'init' });\n // An uncontrolled initial value: applied on mount and never re-applied.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Controlled size. A drag stands until the app passes a different value.\n // Not while the pane is an overlay: an overlay keeps its designed size, and\n // an app's frame-sized limits (a maximum taken from the window) would\n // otherwise squeeze the drawer and report the squeezed size back. The size\n // is applied again when the pane returns to the frame.\n useLayoutEffect(() => {\n if (size === undefined || latest.current.overlayingNow()) return;\n const px = toPx(size);\n if (typeof px !== 'number' || !Number.isFinite(px)) return;\n const clamped = clampTo(px, minSize, maxSize);\n writeSize(clamped, true);\n emitSizeChange(clamped, { reason: 'controlled' });\n }, [size, minSize, maxSize, options.overlaying, toPx, writeSize, emitSizeChange]);\n\n // What the handle announces before any effect has run: the same starting size the pane's\n // first render uses, so the server HTML already states a value.\n const [startSize] = React.useState(() => {\n const value = size ?? defaultSize;\n return typeof value === 'number' && Number.isFinite(value) ? clampTo(value, minSize, maxSize) : options.expandedSize;\n });\n\n const onResize = React.useCallback((value: number) => latest.current.onResize?.(value), []);\n const onResizeStart = React.useCallback((value: number) => {\n // A resize makes the size the user's: a new expandedSize no longer moves it.\n ownedRef.current = true;\n latest.current.onResizeStart?.(value);\n }, []);\n const onResizeEnd = React.useCallback(\n (value: number) => {\n latest.current.onResizeEnd?.(value);\n emitSizeChange(value, { reason: 'resize' });\n },\n [emitSizeChange],\n );\n const requestToggle = React.useCallback(() => latest.current.requestToggle(), []);\n\n return React.useMemo(\n () => ({\n containerRef: elementRef,\n controls: options.elementId,\n cssVarName,\n minSize,\n maxSize,\n defaultSize: options.expandedSize,\n startSize,\n orientation,\n edge: options.edge,\n growth: options.growth,\n onResize,\n onResizeStart,\n onResizeEnd,\n target: name,\n collapsible: options.collapsible,\n requestToggle,\n }),\n [\n elementRef,\n options.elementId,\n cssVarName,\n minSize,\n maxSize,\n options.expandedSize,\n startSize,\n orientation,\n options.edge,\n options.growth,\n onResize,\n onResizeStart,\n onResizeEnd,\n name,\n options.collapsible,\n requestToggle,\n ],\n );\n}\n\n/** Splits a pane's children into its handles and the rest. */\nexport function splitHandles(children: React.ReactNode, handleType: React.ElementType) {\n const all = React.Children.toArray(children);\n const handles = all.filter((el) => React.isValidElement(el) && el.type === handleType) as React.ReactElement[];\n const content = all.filter((el) => !(React.isValidElement(el) && el.type === handleType));\n return { handles, content };\n}\n", "/**\n * Normalize CSS length values to pixels.\n * Supports: px, rem, %, and bare numbers.\n *\n * @param value - The value to normalize (number, string, or undefined)\n * @param orientation - 'horizontal' for width-based % or 'vertical' for height-based %\n * @returns The value in pixels, or undefined if invalid\n */\nexport function normalizeToPx(\n value: number | string | undefined,\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n): number | undefined {\n if (value == null) return undefined;\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n\n const str = String(value).trim();\n if (!str) return undefined;\n\n // px: direct parse\n if (str.endsWith('px')) return Number.parseFloat(str);\n\n // rem: multiply by root font size\n if (str.endsWith('rem')) {\n const rem = Number.parseFloat(getComputedStyle(document.documentElement).fontSize || '16') || 16;\n return Number.parseFloat(str) * rem;\n }\n\n // %: calculate based on viewport dimension\n if (str.endsWith('%')) {\n const pct = Number.parseFloat(str);\n const base =\n orientation === 'horizontal'\n ? document.documentElement.clientWidth || window.innerWidth || 0\n : document.documentElement.clientHeight || window.innerHeight || 0;\n return (pct / 100) * base;\n }\n\n // Bare number-like string\n const n = Number.parseFloat(str);\n return Number.isFinite(n) ? n : undefined;\n}\n\n"],
|
|
5
|
+
"mappings": ";AAEA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,MAAuB,oBCKzB,SAASC,EACdC,EACAC,EAAyC,aACrB,CACpB,GAAID,GAAS,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O,QAAQ,cAAc,EAAG,CAAC,CAAC,EAEhF,OAAa,UACX,KAAO,CACL,aAAcH,EACd,SAAUF,EAAQ,UAClB,WAAAG,EACA,QAAAP,EACA,QAAAC,EACA,YAAaG,EAAQ,aACrB,UAAAwB,EACA,YAAApB,EACA,KAAMJ,EAAQ,KACd,OAAQA,EAAQ,OAChB,SAAAyB,EACA,cAAAC,EACA,YAAAC,EACA,OAAQ1B,EACR,YAAaD,EAAQ,YACrB,cAAA4B,CACF,GACA,CACE1B,EACAF,EAAQ,UACRG,EACAP,EACAC,EACAG,EAAQ,aACRwB,EACApB,EACAJ,EAAQ,KACRA,EAAQ,OACRyB,EACAC,EACAC,EACA1B,EACAD,EAAQ,YACR4B,CACF,CACF,CACF,CAGO,SAASC,EAAaC,EAA2BC,EAA+B,CACrF,IAAMC,EAAY,WAAS,QAAQF,CAAQ,EACrCG,EAAUD,EAAI,OAAQZ,GAAa,iBAAeA,CAAE,GAAKA,EAAG,OAASW,CAAU,EAC/EG,EAAUF,EAAI,OAAQZ,GAAO,EAAQ,iBAAeA,CAAE,GAAKA,EAAG,OAASW,EAAW,EACxF,MAAO,CAAE,QAAAE,EAAS,QAAAC,CAAQ,CAC5B",
|
|
6
|
+
"names": ["React", "useLayoutEffect", "normalizeToPx", "value", "orientation", "str", "rem", "pct", "base", "n", "clampTo", "value", "min", "max", "useInitialPaneSize", "size", "defaultSize", "minSize", "maxSize", "initial", "useResizablePane", "options", "name", "elementRef", "cssVarName", "orientation", "latest", "useLayoutEffect", "debounceRef", "throttleRef", "emitSizeChange", "meta", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "now", "toPx", "normalizeToPx", "ownedRef", "writeSize", "own", "el", "handle", "px", "clamped", "startSize", "onResize", "onResizeStart", "onResizeEnd", "requestToggle", "splitHandles", "children", "handleType", "all", "handles", "content"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as c}from"./chunk-QPRUTOLI.js";import{b as p}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as c}from"./chunk-QPRUTOLI.js";import{b as p}from"./chunk-WJKCXGVN.js";import*as a from"react";import l from"classnames";var i=["xl","lg","md","sm","xs","initial"];function m(e,t,o){if(e==null)return o;if(typeof e!="object")return e;let s=e;for(let r=i.indexOf(t);r<i.length;r++){let n=s[i[r]];if(n!==void 0)return n}return o}function A(e,t){let o=typeof e=="object"&&e!==null,{breakpoint:s}=p(o);return m(e,s,t)}var d={1:8,2:12,3:16,4:24};function B(e){return-(d[e]??d[2])}var u={"\u2318":"Meta",cmd:"Meta",command:"Meta",meta:"Meta","\u2325":"Alt",option:"Alt",opt:"Alt",alt:"Alt","\u21E7":"Shift",shift:"Shift","\u2303":"Control",ctrl:"Control",control:"Control","\u232B":"Backspace","\u2326":"Delete","\u23CE":"Enter","\u21B5":"Enter","\u238B":"Escape",esc:"Escape","\u21E5":"Tab","\u2191":"ArrowUp","\u2193":"ArrowDown","\u2190":"ArrowLeft","\u2192":"ArrowRight"},f=new Map;function k(e){let t=f.get(e);if(t!==void 0)return t||void 0;let r=(e.match(/[⌘⌥⇧⌃]|[^\s+⌘⌥⇧⌃]+/gu)??[]).map(n=>u[n]??u[n.toLowerCase()]??(n.length===1?n.toUpperCase():n)).join("+");return f.set(e,r),r||void 0}function S({shortcut:e,className:t}){return a.createElement("div",{"aria-hidden":!0,className:l("kui-BaseMenuShortcut",t)},a.createElement(c,{size:"1"},e))}export{m as a,A as b,B as c,k as d,S as e};
|
|
3
|
+
//# sourceMappingURL=chunk-REELD6CT.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{b as $}from"./chunk-S66WR5R7.js";import*as t from"react";import{useLayoutEffect as oe}from"radix-ui/internal";import ae from"classnames";var C=t.forwardRef(({className:d,children:m,...h},w)=>{let{containerRef:f,controls:O,cssVarName:H,minSize:E,maxSize:R,defaultSize:M,startSize:G,orientation:v,edge:J,growth:P,onResize:k,onResizeStart:K,onResizeEnd:A,collapsible:W,target:U,requestToggle:D}=$(),g=t.useRef(null),Q=t.useCallback(e=>{g.current=e,typeof w=="function"?w(e):w&&(w.current=e)},[w]),y=t.useRef(null);t.useEffect(()=>()=>{y.current?.(),y.current=null},[]);let z=t.useCallback(()=>{let e=f.current;if(!e)return M;let r=Number.parseFloat(getComputedStyle(e).getPropertyValue(H));return Number.isFinite(r)?r:M},[f,H,M]),N=t.useCallback(()=>{let e=f.current,r=g.current,n=e?.closest(".kui-ShellRoot")?.getBoundingClientRect();if(!e||!n||!r)return R;let c=e.getBoundingClientRect(),p=r.getBoundingClientRect(),s=P(getComputedStyle(e).direction==="rtl"),i;v==="vertical"?i=s>0?n.right-c.left:c.right-n.left:i=s>0?n.bottom-c.top:c.bottom-n.top;let b=v==="vertical"?p.width:p.height;return!(n.width>0&&n.height>0)||!Number.isFinite(i)?R:Math.max(E,Math.min(R,Math.round(i-b)))},[f,P,R,E,v]),Z=()=>{g.current?.setAttribute("aria-valuemax",String(N()))};oe(()=>{g.current?.setAttribute("aria-valuenow",String(Math.round(z())))},[z]);let T=(e,r)=>{e.style.setProperty(H,`${r}px`),g.current?.setAttribute("aria-valuenow",String(Math.round(r)))},_=U.charAt(0).toUpperCase()+U.slice(1);return t.createElement("div",{ref:Q,className:ae("kui-ShellResizer",d),"data-orientation":v,"data-edge":J,role:"separator",tabIndex:0,"aria-label":`Resize ${_} pane`,"aria-controls":O,"aria-orientation":v,"aria-valuenow":Math.round(G),"aria-valuemin":E,"aria-valuemax":R,...h,onPointerDown:e=>{h.onPointerDown?.(e);let r=f.current;if(!r||e.defaultPrevented||e.button!==0)return;e.preventDefault();let n=e.currentTarget,c=e.pointerId;y.current?.();try{n.setPointerCapture(c)}catch{}let p=getComputedStyle(r),s=Number.parseFloat(p.getPropertyValue(H)),i=Number.isFinite(s)?s:M,b=v==="vertical"?e.clientX:e.clientY,ee=P(p.direction==="rtl"),V=N();n.setAttribute("aria-valuemax",String(V));let te=a=>Math.min(Math.max(a,E),V);r.setAttribute("data-resizing",""),n.setAttribute("data-dragging","");let L=document.body,ne=L.style.cursor,re=L.style.userSelect;L.style.cursor=v==="vertical"?"col-resize":"row-resize",L.style.userSelect="none",K?.(i);let x=i,l=0,S=null,j=()=>{if(l=0,S===null)return;let a=S;S=null,k?.(a)},q=null,X=!1,ie=(a,I)=>{if(a.type===I)X=!0;else if(X)return!1;return!0},u=a=>{if(!ie(a,"pointermove")||a===q)return;q=a;let I=v==="vertical"?a.clientX:a.clientY;x=te(i+(I-b)*ee),T(r,x),S=x,l||(l=requestAnimationFrame(j))},F=()=>{l&&cancelAnimationFrame(l),l=0;try{n.releasePointerCapture(c)}catch{}window.removeEventListener("pointermove",u),document.removeEventListener("pointermove",u),window.removeEventListener("mousemove",u),document.removeEventListener("mousemove",u),n.removeEventListener("pointermove",u),window.removeEventListener("pointerup",o),document.removeEventListener("pointerup",o),window.removeEventListener("mouseup",o),document.removeEventListener("mouseup",o),window.removeEventListener("pointercancel",o),document.removeEventListener("pointercancel",o),window.removeEventListener("keydown",Y),n.removeEventListener("lostpointercapture",o),r.removeAttribute("data-resizing"),n.removeAttribute("data-dragging"),L.style.cursor=ne,L.style.userSelect=re,y.current=null},B=!1,o=()=>{B||(B=!0,l&&cancelAnimationFrame(l),j(),A?.(x),F())},Y=a=>{a.key==="Escape"&&(l&&cancelAnimationFrame(l),l=0,S=null,T(r,i),k?.(i),B=!0,A?.(i),F())};window.addEventListener("pointermove",u),document.addEventListener("pointermove",u),window.addEventListener("mousemove",u),document.addEventListener("mousemove",u),n.addEventListener("pointermove",u),window.addEventListener("pointerup",o),document.addEventListener("pointerup",o),window.addEventListener("mouseup",o),document.addEventListener("mouseup",o),window.addEventListener("pointercancel",o),document.addEventListener("pointercancel",o),window.addEventListener("keydown",Y),n.addEventListener("lostpointercapture",o),y.current=F},onDoubleClick:e=>{h.onDoubleClick?.(e),!e.defaultPrevented&&W&&D?.()},onFocus:e=>{h.onFocus?.(e),Z()},onKeyDown:e=>{h.onKeyDown?.(e);let r=f.current;if(!r||e.defaultPrevented)return;if(e.key==="Enter"){W&&D&&(e.preventDefault(),D());return}let n=z(),c=N(),p=i=>Math.min(Math.max(i,E),c),s;if(e.key==="Home")s=p(E);else if(e.key==="End")s=p(c);else{let i=v==="vertical"?e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0:e.key==="ArrowDown"?1:e.key==="ArrowUp"?-1:0;if(i===0)return;let b=e.shiftKey?32:8;s=p(n+i*b*P(getComputedStyle(r).direction==="rtl"))}e.preventDefault(),K?.(n),T(r,s),k?.(s),A?.(s)}},m)});C.displayName="Shell.Handle";var se=t.forwardRef((d,m)=>t.createElement(C,{...d,ref:m}));se.displayName="Shell.Panel.Handle";var le=t.forwardRef((d,m)=>t.createElement(C,{...d,ref:m}));le.displayName="Shell.Sidebar.Handle";var ce=t.forwardRef((d,m)=>t.createElement(C,{...d,ref:m}));ce.displayName="Shell.Inspector.Handle";var ue=t.forwardRef((d,m)=>t.createElement(C,{...d,ref:m}));ue.displayName="Shell.Bottom.Handle";export{C as a,se as b,le as c,ce as d,ue as e};
|
|
3
|
+
//# sourceMappingURL=chunk-RYXIRZQW.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/_internal/shell-handles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport classNames from 'classnames';\nimport { usePaneResize } from './shell-resize.js';\n\n/**\n * The resize handle: the WAI-ARIA window splitter. `role=\"separator\"` with a\n * value, focusable because it is operable, `aria-controls` naming its pane.\n *\n * A drag writes the size variable directly on the pane and sets no React\n * state, so nothing re-renders per move. `onResize` is called at most once per\n * animation frame, and once more with the final size when the drag ends. The\n * direction and the ceiling are read once, when the drag starts.\n */\nexport const PaneHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(({ className, children, ...props }, ref) => {\n const {\n containerRef,\n controls,\n cssVarName,\n minSize,\n maxSize,\n defaultSize,\n startSize,\n orientation,\n edge,\n growth,\n onResize,\n onResizeStart,\n onResizeEnd,\n collapsible,\n target,\n requestToggle,\n } = usePaneResize();\n\n const handleRef = React.useRef<HTMLDivElement | null>(null);\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n handleRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n\n const activeCleanupRef = React.useRef<(() => void) | null>(null);\n React.useEffect(\n () => () => {\n activeCleanupRef.current?.();\n activeCleanupRef.current = null;\n },\n [],\n );\n\n /** The pane's size as the stylesheet sees it. Read at the edges of a gesture, never during one. */\n const readSize = React.useCallback(() => {\n const container = containerRef.current;\n if (!container) return defaultSize;\n const parsed = Number.parseFloat(getComputedStyle(container).getPropertyValue(cssVarName));\n return Number.isFinite(parsed) ? parsed : defaultSize;\n }, [containerRef, cssVarName, defaultSize]);\n\n /**\n * The largest size a resize may reach: the stated maximum, and never so\n * large that the handle leaves the frame. The room is measured from the\n * pane's anchored edge, which does not move, to the far edge of the frame,\n * so a pane that starts after a Rail has less room than the frame's width.\n * Without the cap a pane with a generous `maxSize` could be resized until\n * its own handle was off screen.\n */\n const ceiling = React.useCallback(() => {\n const container = containerRef.current;\n const handle = handleRef.current;\n const frame = container?.closest('.kui-ShellRoot')?.getBoundingClientRect();\n if (!container || !frame || !handle) return maxSize;\n const pane = container.getBoundingClientRect();\n const hitBox = handle.getBoundingClientRect();\n const sign = growth(getComputedStyle(container).direction === 'rtl');\n let room: number;\n if (orientation === 'vertical') room = sign > 0 ? frame.right - pane.left : pane.right - frame.left;\n else room = sign > 0 ? frame.bottom - pane.top : pane.bottom - frame.top;\n const hit = orientation === 'vertical' ? hitBox.width : hitBox.height;\n if (!(frame.width > 0 && frame.height > 0) || !Number.isFinite(room)) return maxSize;\n return Math.max(minSize, Math.min(maxSize, Math.round(room - hit)));\n }, [containerRef, growth, maxSize, minSize, orientation]);\n\n // The announced maximum is what a resize can reach now, not only the prop.\n const announceCeiling = () => {\n handleRef.current?.setAttribute('aria-valuemax', String(ceiling()));\n };\n\n // The announced value is seeded from the real size once the pane has a box.\n useLayoutEffect(() => {\n handleRef.current?.setAttribute('aria-valuenow', String(Math.round(readSize())));\n }, [readSize]);\n\n const write = (container: HTMLElement, size: number) => {\n container.style.setProperty(cssVarName, `${size}px`);\n handleRef.current?.setAttribute('aria-valuenow', String(Math.round(size)));\n };\n\n const targetLabel = target.charAt(0).toUpperCase() + target.slice(1);\n\n return (\n // A focusable separator with a value is the WAI-ARIA window splitter, an\n // interactive widget; jsx-a11y classes every separator as static.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <div\n ref={setRef}\n className={classNames('kui-ShellResizer', className)}\n data-orientation={orientation}\n data-edge={edge}\n role=\"separator\"\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n aria-label={`Resize ${targetLabel} pane`}\n aria-controls={controls}\n aria-orientation={orientation}\n // A focusable separator must state its value. The effects keep it current after mount.\n aria-valuenow={Math.round(startSize)}\n aria-valuemin={minSize}\n aria-valuemax={maxSize}\n {...props}\n onPointerDown={(e) => {\n props.onPointerDown?.(e);\n const container = containerRef.current;\n if (!container || e.defaultPrevented || e.button !== 0) return;\n e.preventDefault();\n const handleEl = e.currentTarget as HTMLElement;\n const pointerId = e.pointerId;\n activeCleanupRef.current?.();\n try {\n handleEl.setPointerCapture(pointerId);\n } catch {\n // Capture can fail for a pointer that is already gone; the window listeners below still carry the drag.\n }\n\n // Everything a move needs is read here, once.\n const startStyle = getComputedStyle(container);\n const parsedStart = Number.parseFloat(startStyle.getPropertyValue(cssVarName));\n const startSize = Number.isFinite(parsedStart) ? parsedStart : defaultSize;\n const startClient = orientation === 'vertical' ? e.clientX : e.clientY;\n const sign = growth(startStyle.direction === 'rtl');\n const cap = ceiling();\n handleEl.setAttribute('aria-valuemax', String(cap));\n const clamp = (v: number) => Math.min(Math.max(v, minSize), cap);\n\n container.setAttribute('data-resizing', '');\n handleEl.setAttribute('data-dragging', '');\n const body = document.body;\n const prevCursor = body.style.cursor;\n const prevUserSelect = body.style.userSelect;\n body.style.cursor = orientation === 'vertical' ? 'col-resize' : 'row-resize';\n body.style.userSelect = 'none';\n onResizeStart?.(startSize);\n\n let current = startSize;\n let frame = 0;\n let pending: number | null = null;\n const flush = () => {\n frame = 0;\n if (pending === null) return;\n const size = pending;\n pending = null;\n onResize?.(size);\n };\n\n // The move handler listens on the handle, the document and the window,\n // so a drag survives environments where pointer events do not reach\n // all three. One movement can therefore arrive several times: once per\n // node it propagates through, and again as the compatibility mouse\n // event. Only the first copy does any work.\n let lastHandledMove: Event | null = null;\n let seenPointerEvent = false;\n const shouldHandle = (ev: Event, pointerType: string) => {\n if (ev.type === pointerType) seenPointerEvent = true;\n else if (seenPointerEvent) return false;\n return true;\n };\n\n const handleMove = (ev: PointerEvent) => {\n if (!shouldHandle(ev, 'pointermove')) return;\n if (ev === lastHandledMove) return;\n lastHandledMove = ev;\n const client = orientation === 'vertical' ? ev.clientX : ev.clientY;\n current = clamp(startSize + (client - startClient) * sign);\n write(container, current);\n pending = current;\n if (!frame) frame = requestAnimationFrame(flush);\n };\n\n const cleanup = () => {\n if (frame) cancelAnimationFrame(frame);\n frame = 0;\n try {\n handleEl.releasePointerCapture(pointerId);\n } catch {\n // Already released.\n }\n window.removeEventListener('pointermove', handleMove as EventListener);\n document.removeEventListener('pointermove', handleMove as EventListener);\n window.removeEventListener('mousemove', handleMove as EventListener);\n document.removeEventListener('mousemove', handleMove as EventListener);\n handleEl.removeEventListener('pointermove', handleMove as EventListener);\n window.removeEventListener('pointerup', handleUp as EventListener);\n document.removeEventListener('pointerup', handleUp as EventListener);\n window.removeEventListener('mouseup', handleUp as EventListener);\n document.removeEventListener('mouseup', handleUp as EventListener);\n window.removeEventListener('pointercancel', handleUp as EventListener);\n document.removeEventListener('pointercancel', handleUp as EventListener);\n window.removeEventListener('keydown', handleKey as EventListener);\n handleEl.removeEventListener('lostpointercapture', handleUp as EventListener);\n container.removeAttribute('data-resizing');\n handleEl.removeAttribute('data-dragging');\n body.style.cursor = prevCursor;\n body.style.userSelect = prevUserSelect;\n activeCleanupRef.current = null;\n };\n\n let finished = false;\n const handleUp = () => {\n if (finished) return;\n finished = true;\n // The last move's size is delivered now rather than on the next frame.\n if (frame) cancelAnimationFrame(frame);\n flush();\n\n onResizeEnd?.(current);\n cleanup();\n };\n\n const handleKey = (kev: KeyboardEvent) => {\n if (kev.key !== 'Escape') return;\n if (frame) cancelAnimationFrame(frame);\n frame = 0;\n pending = null;\n write(container, startSize);\n onResize?.(startSize);\n finished = true;\n onResizeEnd?.(startSize);\n cleanup();\n };\n\n window.addEventListener('pointermove', handleMove as EventListener);\n document.addEventListener('pointermove', handleMove as EventListener);\n window.addEventListener('mousemove', handleMove as EventListener);\n document.addEventListener('mousemove', handleMove as EventListener);\n handleEl.addEventListener('pointermove', handleMove as EventListener);\n window.addEventListener('pointerup', handleUp as EventListener);\n document.addEventListener('pointerup', handleUp as EventListener);\n window.addEventListener('mouseup', handleUp as EventListener);\n document.addEventListener('mouseup', handleUp as EventListener);\n window.addEventListener('pointercancel', handleUp as EventListener);\n document.addEventListener('pointercancel', handleUp as EventListener);\n window.addEventListener('keydown', handleKey as EventListener);\n handleEl.addEventListener('lostpointercapture', handleUp as EventListener);\n activeCleanupRef.current = cleanup;\n }}\n onDoubleClick={(e) => {\n props.onDoubleClick?.(e);\n if (!e.defaultPrevented && collapsible) requestToggle?.();\n }}\n onFocus={(e) => {\n props.onFocus?.(e);\n announceCeiling();\n }}\n onKeyDown={(e) => {\n props.onKeyDown?.(e);\n const container = containerRef.current;\n if (!container || e.defaultPrevented) return;\n // Enter collapses and restores the pane, as a double-click does (WAI-ARIA window splitter).\n if (e.key === 'Enter') {\n if (collapsible && requestToggle) {\n e.preventDefault();\n requestToggle();\n }\n return;\n }\n const current = readSize();\n // The keys reach as far as a drag does: the frame caps both.\n const cap = ceiling();\n const clamp = (v: number) => Math.min(Math.max(v, minSize), cap);\n let next: number | undefined;\n if (e.key === 'Home') next = clamp(minSize);\n else if (e.key === 'End') next = clamp(cap);\n else {\n // The key moves the boundary along its axis; the pane grows or\n // shrinks the way a drag in that direction would, so Bottom's\n // ArrowUp grows it and an end-anchored pane mirrors in RTL.\n const along = orientation === 'vertical' ? (e.key === 'ArrowRight' ? 1 : e.key === 'ArrowLeft' ? -1 : 0) : e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : 0;\n if (along === 0) return;\n const step = e.shiftKey ? 32 : 8;\n next = clamp(current + along * step * growth(getComputedStyle(container).direction === 'rtl'));\n }\n e.preventDefault();\n onResizeStart?.(current);\n write(container, next);\n onResize?.(next);\n onResizeEnd?.(next);\n }}\n >\n {children}\n </div>\n );\n});\nPaneHandle.displayName = 'Shell.Handle';\n\nexport const PanelHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nPanelHandle.displayName = 'Shell.Panel.Handle';\n\nexport const SidebarHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nSidebarHandle.displayName = 'Shell.Sidebar.Handle';\n\nexport const InspectorHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nInspectorHandle.displayName = 'Shell.Inspector.Handle';\n\nexport const BottomHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>((props, ref) => <PaneHandle {...props} ref={ref} />);\nBottomHandle.displayName = 'Shell.Bottom.Handle';\n"],
|
|
5
|
+
"mappings": ";wCAAA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,OAAuB,oBAChC,OAAOC,OAAgB,aAYhB,IA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,YAAc,EAAI,EAAE,MAAQ,UAAY,GAAK,EAClK,GAAI0D,IAAU,EAAG,OACjB,IAAMC,EAAO,EAAE,SAAW,GAAK,EAC/BF,EAAOpB,EAAMK,EAAUgB,EAAQC,EAAOzD,EAAO,iBAAiBa,CAAS,EAAE,YAAc,KAAK,CAAC,CAC/F,CACA,EAAE,eAAe,EACjBX,IAAgBsC,CAAO,EACvBf,EAAMZ,EAAW0C,CAAI,EACrBtD,IAAWsD,CAAI,EACfpD,IAAcoD,CAAI,CACpB,GAECnE,CACH,CAEJ,CAAC,EACDF,EAAW,YAAc,eAElB,IAAMwE,GAAoB,aAAkE,CAACrE,EAAOC,IAAQ,gBAACJ,EAAA,CAAY,GAAGG,EAAO,IAAKC,EAAK,CAAE,EACtJoE,GAAY,YAAc,qBAEnB,IAAMC,GAAsB,aAAkE,CAACtE,EAAOC,IAAQ,gBAACJ,EAAA,CAAY,GAAGG,EAAO,IAAKC,EAAK,CAAE,EACxJqE,GAAc,YAAc,uBAErB,IAAMC,GAAwB,aAAkE,CAACvE,EAAOC,IAAQ,gBAACJ,EAAA,CAAY,GAAGG,EAAO,IAAKC,EAAK,CAAE,EAC1JsE,GAAgB,YAAc,yBAEvB,IAAMC,GAAqB,aAAkE,CAACxE,EAAOC,IAAQ,gBAACJ,EAAA,CAAY,GAAGG,EAAO,IAAKC,EAAK,CAAE,EACvJuE,GAAa,YAAc",
|
|
6
|
+
"names": ["React", "useLayoutEffect", "classNames", "PaneHandle", "className", "children", "props", "ref", "containerRef", "controls", "cssVarName", "minSize", "maxSize", "defaultSize", "startSize", "orientation", "edge", "growth", "onResize", "onResizeStart", "onResizeEnd", "collapsible", "target", "requestToggle", "usePaneResize", "handleRef", "setRef", "node", "activeCleanupRef", "readSize", "container", "parsed", "ceiling", "handle", "frame", "pane", "hitBox", "sign", "room", "hit", "announceCeiling", "useLayoutEffect", "write", "size", "targetLabel", "classNames", "handleEl", "pointerId", "startStyle", "parsedStart", "startClient", "cap", "clamp", "v", "body", "prevCursor", "prevUserSelect", "current", "pending", "flush", "lastHandledMove", "seenPointerEvent", "shouldHandle", "ev", "pointerType", "handleMove", "client", "cleanup", "handleUp", "handleKey", "finished", "kev", "next", "along", "step", "PanelHandle", "SidebarHandle", "InspectorHandle", "BottomHandle"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/_internal/shell-resize.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport type { PaneName } from '../shell.types.js';\n\nexport interface PaneResizeContextValue {\n containerRef: React.RefObject<HTMLElement | null>;\n /** The pane the handle resizes, for `aria-controls`. */\n controls: string;\n cssVarName: string;\n minSize: number;\n maxSize: number;\n defaultSize: number;\n /** The size the pane starts at, for the handle's first `aria-valuenow`. */\n startSize: number;\n orientation: 'vertical' | 'horizontal';\n edge: 'start' | 'end';\n /**\n * +1 when moving the pointer toward the end of its axis grows the pane, -1\n * when it shrinks it. Read once when a drag starts, with the pane's\n * resolved direction, so no move pays for a style read.\n */\n growth: (isRtl: boolean) => 1 | -1;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n target: PaneName;\n collapsible: boolean;\n
|
|
5
|
-
"mappings": ";AAAA,UAAYA,MAAW,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport type { PaneName } from '../shell.types.js';\n\nexport interface PaneResizeContextValue {\n containerRef: React.RefObject<HTMLElement | null>;\n /** The pane the handle resizes, for `aria-controls`. */\n controls: string;\n cssVarName: string;\n minSize: number;\n maxSize: number;\n defaultSize: number;\n /** The size the pane starts at, for the handle's first `aria-valuenow`. */\n startSize: number;\n orientation: 'vertical' | 'horizontal';\n edge: 'start' | 'end';\n /**\n * +1 when moving the pointer toward the end of its axis grows the pane, -1\n * when it shrinks it. Read once when a drag starts, with the pane's\n * resolved direction, so no move pays for a style read.\n */\n growth: (isRtl: boolean) => 1 | -1;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n target: PaneName;\n collapsible: boolean;\n requestToggle?: () => void;\n}\n\nexport const PaneResizeContext = React.createContext<PaneResizeContextValue | null>(null);\n\nexport function usePaneResize() {\n const ctx = React.useContext(PaneResizeContext);\n if (!ctx) throw new Error('Shell.Handle must be used within a resizable pane');\n return ctx;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,UAAYA,MAAW,QA6BhB,IAAMC,EAA0B,gBAA6C,IAAI,EAEjF,SAASC,GAAgB,CAC9B,IAAMC,EAAY,aAAWF,CAAiB,EAC9C,GAAI,CAACE,EAAK,MAAM,IAAI,MAAM,mDAAmD,EAC7E,OAAOA,CACT",
|
|
6
6
|
"names": ["React", "PaneResizeContext", "usePaneResize", "ctx"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{h as a,j as r}from"./chunk-LBAC2X4U.js";import*as d from"react";var n=e=>e===void 0?void 0:e==="closed"?"collapsed":"expanded",l=e=>e==="collapsed"?"closed":"open";function c(){let e=r("useSidebarMode"),s=d.useCallback(o=>a(e,o),[e]),t=d.useSyncExternalStore(s,()=>e.entries.get("sidebar")?.value,()=>{}),i=d.useCallback(o=>{e.entries.get("sidebar")?.setValue(l(o),"toggle")},[e]);return{sidebarMode:n(t)??"expanded",setSidebarMode:i}}export{c as a};
|
|
3
|
+
//# sourceMappingURL=chunk-SECVO3CW.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/shell.context.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\n/**\n * The Shell has two contexts: the pane registry (the store) and the set of panes off the frame.\n * They live in `_internal/shell-store.tsx`. This module keeps the hook consumers can reach:\n * `useSidebarMode`.\n */\nimport * as React from 'react';\nimport type { SidebarMode } from './shell.types.js';\nimport { subscribeShellStore, useShellStore, type PaneValue } from './_internal/shell-store.js';\n\nconst toSidebarMode = (value: PaneValue | undefined): SidebarMode | undefined => (value === undefined ? undefined : value === 'closed' ? 'collapsed' : 'expanded');\n\nconst fromSidebarMode = (mode: SidebarMode): PaneValue => (mode === 'collapsed' ? 'closed' : 'open');\n\n/**\n * The Sidebar's mode, and a setter. The setter is a user action: it reports\n * through the Sidebar's `onStateChange` the way a Trigger does.\n */\nexport function useSidebarMode(): { sidebarMode: SidebarMode; setSidebarMode: (mode: SidebarMode) => void } {\n const store = useShellStore('useSidebarMode');\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n const value = React.useSyncExternalStore(\n subscribe,\n () => store.entries.get('sidebar')?.value,\n () => undefined,\n );\n const setSidebarMode = React.useCallback(\n (mode: SidebarMode) => {\n store.entries.get('sidebar')?.setValue(fromSidebarMode(mode), 'toggle');\n },\n [store],\n );\n return { sidebarMode: toSidebarMode(value) ?? 'expanded', setSidebarMode };\n}\n"],
|
|
5
|
+
"mappings": ";+CAOA,UAAYA,MAAW,QAIvB,IAAMC,EAAiBC,GAA2DA,IAAU,OAAY,OAAYA,IAAU,SAAW,YAAc,WAEjJC,EAAmBC,GAAkCA,IAAS,YAAc,SAAW,OAMtF,SAASC,GAA4F,CAC1G,IAAMC,EAAQC,EAAc,gBAAgB,EACtCC,EAAkB,cAAaC,GAAyBC,EAAoBJ,EAAOG,CAAQ,EAAG,CAACH,CAAK,CAAC,EACrGJ,EAAc,uBAClBM,EACA,IAAMF,EAAM,QAAQ,IAAI,SAAS,GAAG,MACpC,IAAG,EACL,EACMK,EAAuB,cAC1BP,GAAsB,CACrBE,EAAM,QAAQ,IAAI,SAAS,GAAG,SAASH,EAAgBC,CAAI,EAAG,QAAQ,CACxE,EACA,CAACE,CAAK,CACR,EACA,MAAO,CAAE,YAAaL,EAAcC,CAAK,GAAK,WAAY,eAAAS,CAAe,CAC3E",
|
|
6
|
+
"names": ["React", "toSidebarMode", "value", "fromSidebarMode", "mode", "useSidebarMode", "store", "useShellStore", "subscribe", "listener", "subscribeShellStore", "setSidebarMode"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function t(e){if(e===void 0)return;if(typeof e=="boolean")return e?"open":"closed";let o={};for(let[a,n]of Object.entries(e))typeof n=="boolean"&&(o[a]=n?"open":"closed");return o}var r=e=>e==="overlay"?"closed":"open",l=()=>"closed",i=e=>e?-1:1,d=e=>e?1:-1,p=()=>-1;export{t as a,r as b,l as c,i as d,d as e,p as f};
|
|
3
|
+
//# sourceMappingURL=chunk-SHDZYFUN.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/_internal/shell-rest.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Breakpoint, PresentationValue } from '../shell.types.js';\nimport type { PaneValue } from './shell-store.js';\n\ntype ResponsiveBoolean = boolean | Partial<Record<Breakpoint, boolean>>;\n\n/** `open`/`defaultOpen` as the pane's own value type. */\nexport function toPaneValue(value: boolean | undefined): PaneValue | undefined;\nexport function toPaneValue(value: ResponsiveBoolean | undefined): PaneValue | Partial<Record<Breakpoint, PaneValue>> | undefined;\nexport function toPaneValue(value: ResponsiveBoolean | undefined): PaneValue | Partial<Record<Breakpoint, PaneValue>> | undefined {\n if (value === undefined) return undefined;\n if (typeof value === 'boolean') return value ? 'open' : 'closed';\n const map: Partial<Record<Breakpoint, PaneValue>> = {};\n for (const [bp, open] of Object.entries(value) as Array<[Breakpoint, boolean | undefined]>) {\n if (typeof open === 'boolean') map[bp] = open ? 'open' : 'closed';\n }\n return map;\n}\n\n/**\n * Where an untouched navigation column rests: open in the frame or stacked\n * over it, closed where it would be an overlay. An overlay is summoned,\n * never ambient.\n */\nexport const navigationRest = (presentation: PresentationValue): PaneValue => (presentation === 'overlay' ? 'closed' : 'open');\n\n/** Where an untouched detail pane rests: closed. Detail is asked for. */\nexport const detailRest = (): PaneValue => 'closed';\n\n/** A pane anchored at the inline start grows as its end edge moves toward the inline end. */\nexport const startAnchoredGrowth = (isRtl: boolean): 1 | -1 => (isRtl ? -1 : 1);\n\n/** A pane anchored at the inline end grows as its start edge moves toward the inline start. */\nexport const endAnchoredGrowth = (isRtl: boolean): 1 | -1 => (isRtl ? 1 : -1);\n\n/** A pane anchored at the block end grows as its top edge moves up. */\nexport const bottomAnchoredGrowth = (): 1 | -1 => -1;\n"],
|
|
5
|
+
"mappings": ";AAQO,SAASA,EAAYC,EAAsG,CAChI,GAAIA,IAAU,OAAW,OACzB,GAAI,OAAOA,GAAU,UAAW,OAAOA,EAAQ,OAAS,SACxD,IAAMC,EAA8C,CAAC,EACrD,OAAW,CAACC,EAAIC,CAAI,IAAK,OAAO,QAAQH,CAAK,EACvC,OAAOG,GAAS,YAAWF,EAAIC,CAAE,EAAIC,EAAO,OAAS,UAE3D,OAAOF,CACT,CAOO,IAAMG,EAAkBC,GAAgDA,IAAiB,UAAY,SAAW,OAG1GC,EAAa,IAAiB,SAG9BC,EAAuBC,GAA4BA,EAAQ,GAAK,EAGhEC,EAAqBD,GAA4BA,EAAQ,EAAI,GAG7DE,EAAuB,IAAc",
|
|
6
|
+
"names": ["toPaneValue", "value", "map", "bp", "open", "navigationRest", "presentation", "detailRest", "startAnchoredGrowth", "isRtl", "endAnchoredGrowth", "bottomAnchoredGrowth"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as h,e as P,f,g as l}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as h,e as P,f,g as l}from"./chunk-U7P64MXD.js";import{a as R}from"./chunk-4KIZRO52.js";import{a as G}from"./chunk-FICBVI4M.js";import{b as a}from"./chunk-GKDGNPBD.js";import{b as n}from"./chunk-5ON3XLRD.js";import{c as b}from"./chunk-OKQAVYW4.js";import{a as k}from"./chunk-CLJ6SEGP.js";import{a as S}from"./chunk-VQPANPMI.js";var T={};S(T,{Item:()=>N,Root:()=>v});import*as o from"react";import u from"classnames";import{Context as _}from"radix-ui/internal";var x={...k,...R};var I="CheckboxGroup",[z]=_.createContextScope(I,[h]),d=h(),[D,y]=z(I),v=o.forwardRef(({color:s=x.color.default,size:e,...t},r)=>{let p=n(e,x.size),{__scopeCheckboxGroup:c,className:m,...i}=t,E=d(c);return o.createElement(D,{scope:c,color:s,size:p},o.createElement(P,{...E,...i,ref:r,className:u("kui-CheckboxGroupRoot",m)}))});v.displayName="CheckboxGroup.Root";var N=o.forwardRef((s,e)=>{let{__scopeCheckboxGroup:t,children:r,className:p,style:c,...m}=s,{size:i}=y("CheckboxGroupItem",t);return r?o.createElement(G,{as:"label",size:i,className:u("kui-CheckboxGroupItem",p),style:c},o.createElement(C,{__scopeCheckboxGroup:t,...m,ref:e}),r&&o.createElement("span",{className:"kui-CheckboxGroupItemInner"},r)):o.createElement(C,{__scopeCheckboxGroup:t,...m,ref:e,className:p,style:c})});N.displayName="CheckboxGroup.Item";var C=o.forwardRef(({__scopeCheckboxGroup:s,...e},t)=>{let r=y("CheckboxGroupItemCheckbox",s),p=d(s),{color:c,className:m}=b({...e,...r},x);return o.createElement(f,{...p,"data-accent-color":c,...e,ref:t,className:u("kui-reset","kui-BaseCheckboxRoot","kui-CheckboxGroupItemCheckbox",m)},o.createElement(l,{...p,asChild:!0,className:"kui-BaseCheckboxIndicator"},o.createElement(a,null)))});C.displayName="CheckboxGroup.ItemCheckbox";export{v as a,N as b,T as c};
|
|
3
|
+
//# sourceMappingURL=chunk-TCFBNE6A.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import*as e from"react";import{Checkbox as s,Direction as E}from"radix-ui";import{Context as S,Primitive as _,useControllableState as V}from"radix-ui/internal";var{useDirection:q}=E,b="CheckboxGroup",[N,O]=S.createContextScope(b,[s.createCheckboxScope]),x=s.createCheckboxScope(),[D,U]=N(b),m=e.forwardRef((t,n)=>{let{__scopeCheckboxGroup:r,name:i,defaultValue:c,value:o,required:u=!1,disabled:p=!1,dir:C,onValueChange:d,...h}=t,G=q(C),[I=[],a]=V({prop:o,defaultProp:c??[],onChange:d}),R=e.useCallback(l=>a((k=[])=>[...k,l]),[a]),y=e.useCallback(l=>a((k=[])=>k.filter(g=>g!==l)),[a]);return e.createElement(D,{scope:r,name:i,required:u,disabled:p,value:I,onItemCheck:R,onItemUncheck:y},e.createElement(_.div,{role:"group","data-disabled":p?"":void 0,dir:G,...h,ref:n}))});m.displayName=b;var P="CheckboxGroupItem",f=e.forwardRef((t,n)=>{let{__scopeCheckboxGroup:r,disabled:i,...c}=t,o=U(P,r),u=o.disabled||i,p=x(r),C=o.value?.includes(c.value),d=o.required&&(o.value?.length??0)===0;return e.createElement(s.Root,{name:o.name,disabled:u,required:d,checked:C,...p,...c,ref:n,onCheckedChange:h=>{h?o.onItemCheck(t.value):o.onItemUncheck(t.value)}})});f.displayName=P;var W="CheckboxGroupIndicator",v=e.forwardRef((t,n)=>{let{__scopeCheckboxGroup:r,...i}=t,c=x(r);return e.createElement(s.Indicator,{...c,...i,ref:n})});v.displayName=W;var w=m,T=f,B=v;export{O as a,m as b,f as c,v as d,w as e,T as f,B as g};
|
|
3
|
+
//# sourceMappingURL=chunk-U7P64MXD.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/checkbox-group.primitive.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport { Checkbox as CheckboxPrimitive, Direction } from 'radix-ui';\nimport { Context, Primitive, useControllableState } from 'radix-ui/internal';\n\nconst { useDirection } = Direction;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxGroup\n * -----------------------------------------------------------------------------------------------*/\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Context.Scope };\nconst [createCheckboxGroupContext, createCheckboxGroupScope] = Context.createContextScope(\n CHECKBOX_GROUP_NAME,\n [CheckboxPrimitive.createCheckboxScope],\n);\nconst useCheckboxScope = CheckboxPrimitive.createCheckboxScope();\n\ntype CheckboxGroupContextValue = {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string[];\n onItemCheck(value: string): void;\n onItemUncheck(value: string): void;\n};\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface CheckboxGroupProps extends PrimitiveDivProps {\n name?: CheckboxGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['required'];\n disabled?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['disabled'];\n dir?: 'ltr' | 'rtl';\n defaultValue?: string[];\n value?: CheckboxGroupContextValue['value'];\n onValueChange?: (value: string[]) => void;\n}\n\nconst CheckboxGroup = React.forwardRef<CheckboxGroupElement, CheckboxGroupProps>(\n (props: ScopedProps<CheckboxGroupProps>, forwardedRef) => {\n const {\n __scopeCheckboxGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n dir,\n onValueChange,\n ...groupProps\n } = props;\n const direction = useDirection(dir);\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? [],\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => setValue((prevValue = []) => [...prevValue, itemValue]),\n [setValue],\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) =>\n setValue((prevValue = []) => prevValue.filter((value) => value !== itemValue)),\n [setValue],\n );\n\n return (\n <CheckboxGroupProvider\n scope={__scopeCheckboxGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onItemCheck={handleItemCheck}\n onItemUncheck={handleItemUncheck}\n >\n <Primitive.div\n role=\"group\"\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...groupProps}\n ref={forwardedRef}\n />\n </CheckboxGroupProvider>\n );\n },\n);\n\nCheckboxGroup.displayName = CHECKBOX_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'CheckboxGroupItem';\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;\ntype CheckboxProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>;\ninterface CheckboxGroupItemProps\n extends Omit<CheckboxProps, 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'> {\n value: string;\n}\n\nconst CheckboxGroupItem = React.forwardRef<CheckboxGroupItemElement, CheckboxGroupItemProps>(\n (props: ScopedProps<CheckboxGroupItemProps>, forwardedRef) => {\n const { __scopeCheckboxGroup, disabled, ...itemProps } = props;\n const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);\n const isDisabled = context.disabled || disabled;\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n const checked = context.value?.includes(itemProps.value);\n // A required group needs at least one box checked, not every box: the items are\n // required only while none is checked.\n const isRequired = context.required && (context.value?.length ?? 0) === 0;\n\n return (\n <CheckboxPrimitive.Root\n name={context.name}\n disabled={isDisabled}\n required={isRequired}\n checked={checked}\n {...checkboxScope}\n {...itemProps}\n ref={forwardedRef}\n onCheckedChange={(checked) => {\n if (checked) {\n context.onItemCheck(props.value);\n } else {\n context.onItemUncheck(props.value);\n }\n }}\n />\n );\n },\n);\n\nCheckboxGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'CheckboxGroupIndicator';\n\ntype CheckboxGroupIndicatorElement = React.ElementRef<typeof CheckboxPrimitive.Indicator>;\ntype CheckboxIndicatorProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Indicator>;\ninterface CheckboxGroupIndicatorProps extends CheckboxIndicatorProps {}\n\nconst CheckboxGroupIndicator = React.forwardRef<\n CheckboxGroupIndicatorElement,\n CheckboxGroupIndicatorProps\n>((props: ScopedProps<CheckboxGroupIndicatorProps>, forwardedRef) => {\n const { __scopeCheckboxGroup, ...indicatorProps } = props;\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n return <CheckboxPrimitive.Indicator {...checkboxScope} {...indicatorProps} ref={forwardedRef} />;\n});\n\nCheckboxGroupIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = CheckboxGroup;\nconst Item = CheckboxGroupItem;\nconst Indicator = CheckboxGroupIndicator;\n\nexport {\n createCheckboxGroupScope,\n //\n CheckboxGroup,\n CheckboxGroupItem,\n CheckboxGroupIndicator,\n //\n Root,\n Item,\n Indicator,\n};\nexport type { CheckboxGroupProps, CheckboxGroupItemProps, CheckboxGroupIndicatorProps };\n"],
|
|
5
|
+
"mappings": ";AAEA,UAAYA,MAAW,QACvB,OAAS,YAAYC,EAAmB,aAAAC,MAAiB,WACzD,OAAS,WAAAC,EAAS,aAAAC,EAAW,wBAAAC,MAA4B,oBAEzD,GAAM,CAAE,aAAAC,CAAa,EAAIJ,EAKnBK,EAAsB,gBAGtB,CAACC,EAA4BC,CAAwB,EAAIN,EAAQ,mBACrEI,EACA,CAACN,EAAkB,mBAAmB,CACxC,EACMS,EAAmBT,EAAkB,oBAAoB,EAWzD,CAACU,EAAuBC,CAAuB,EACnDJ,EAAsDD,CAAmB,EAcrEM,EAAsB,aAC1B,CAACC,EAAwCC,IAAiB,CACxD,GAAM,CACJ,qBAAAC,EACA,KAAAC,EACA,aAAAC,EACA,MAAOC,EACP,SAAAC,EAAW,GACX,SAAAC,EAAW,GACX,IAAAC,EACA,cAAAC,EACA,GAAGC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AAK,CAErC,EACF,CAEJ,CACF,EAEAmB,EAAkB,YAAcD,EAMhC,IAAMQ,EAAiB,yBAMjBC,EAA+B,aAGnC,CAAC3B,EAAiDC,IAAiB,CACnE,GAAM,CAAE,qBAAAC,EAAsB,GAAG0B,CAAe,EAAI5B,EAC9CuB,EAAgB3B,EAAiBM,CAAoB,EAC3D,OAAO,gBAACf,EAAkB,UAAlB,CAA6B,GAAGoC,EAAgB,GAAGK,EAAgB,IAAK3B,EAAc,CAChG,CAAC,EAED0B,EAAuB,YAAcD,EAIrC,IAAMG,EAAO9B,EACP+B,EAAOX,EACPY,EAAYJ",
|
|
6
|
+
"names": ["React", "CheckboxPrimitive", "Direction", "Context", "Primitive", "useControllableState", "useDirection", "CHECKBOX_GROUP_NAME", "createCheckboxGroupContext", "createCheckboxGroupScope", "useCheckboxScope", "CheckboxGroupProvider", "useCheckboxGroupContext", "CheckboxGroup", "props", "forwardedRef", "__scopeCheckboxGroup", "name", "defaultValue", "valueProp", "required", "disabled", "dir", "onValueChange", "groupProps", "direction", "value", "setValue", "handleItemCheck", "itemValue", "prevValue", "handleItemUncheck", "ITEM_NAME", "CheckboxGroupItem", "itemProps", "context", "isDisabled", "checkboxScope", "checked", "isRequired", "INDICATOR_NAME", "CheckboxGroupIndicator", "indicatorProps", "Root", "Item", "Indicator"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as N,b as D}from"./chunk-WJKCXGVN.js";import{a as v,b as P,c as T,d as k,g as x,j}from"./chunk-LBAC2X4U.js";import*as t from"react";import{useLayoutEffect as E}from"radix-ui/internal";var A=e=>typeof e=="object"&&e!==null;function Y(e){let{name:o,label:u,propNames:a,presentationTable:l,builtIn:O}=e,r=j(`Shell.${u}`),K=t.useId(),m=e.id??`shell-${o}${K}`,i=e.controlled!==void 0,S=A(e.defaultValue)?e.defaultValue:void 0,U=k(S),[_,q]=t.useState(()=>typeof e.defaultValue=="string"?e.defaultValue:"auto"),f=t.useMemo(()=>v(S,n=>O(l[n])),[U,l,O]),s=_;e.controlled!==void 0&&(s=e.controlled);let F=P(l)===void 0||s==="auto"&&P(f)===void 0,{breakpoint:w,ready:$}=D(F),B=n=>{let c=P(n);return c!==void 0?c:$?n[w]:void 0},d=s==="auto"?B(f):s,R=B(l),M=R==="overlay",I=d===void 0?void 0:d!=="closed",y=I===!0&&M,z=e.defaultValue,p=t.useRef({state:s,value:d,autoTable:f,defaultValue:z,controlled:i,onChange:e.onChange,toggleNext:e.toggleNext});E(()=>{p.current={state:s,value:d,autoTable:f,defaultValue:z,controlled:i,onChange:e.onChange,toggleNext:e.toggleNext}});let b=t.useCallback(()=>{let n=p.current;return n.value!==void 0?n.value:n.state==="auto"?n.autoTable[N()]:void 0},[]),h=t.useCallback(()=>{let n=p.current;return typeof n.defaultValue=="string"?n.defaultValue:A(n.defaultValue)?n.autoTable[N()]:void 0},[]),g=t.useCallback((n,c)=>{let V=p.current;b()!==n&&(V.onChange?.(n,c),V.controlled||q(n))},[b]),C=t.useCallback(n=>{let c=p.current,V=b()??"closed",J=c.toggleNext?c.toggleNext(V,h()):V==="closed"?"open":"closed";g(J,n)},[g,b,h]),H=t.useRef(null),G=t.useCallback(n=>{H.current=n},[]);E(()=>{let n={name:o,id:m,el:H.current,value:d,presentation:R,presentationTable:l,overlayLive:y,size:e.size,setValue:g,toggle:C};return r.entries.set(o,n),x(r),()=>{r.entries.get(o)===n&&(r.entries.delete(o),x(r))}},[r,o,m,d,R,l,y,e.size,g,C]),E(()=>{},[]);let L=t.useRef(i);return t.useEffect(()=>{},[i,u,a.controlled]),{store:r,id:m,state:s,value:d,shown:I,presentation:R,overlaying:M,overlayLive:y,ready:$,breakpoint:w,autoTable:f,setValue:g,toggle:C,defaultHereNow:h,setElement:G}}function Z(e,o){let{state:u,value:a,presentation:l}=e;return{...o,"data-state":u,...u==="auto"?T("auto",e.autoTable):{},"data-presentation":l,"data-mode":a===void 0?void 0:a==="closed"?"collapsed":"expanded"}}function ee(e,o){let u=k(e),a=t.useMemo(()=>v(e,()=>o),[u,o]),l=t.useMemo(()=>P(a)===void 0?T("presentation",a):{},[a]);return{table:a,attributes:l}}export{Y as a,Z as b,ee as c};
|
|
3
|
+
//# sourceMappingURL=chunk-UFYQC5XY.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/_internal/shell-pane.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport { readBreakpoint, useBreakpoint } from '../../hooks/use-breakpoint.js';\nimport type { Breakpoint, PaneName, PresentationValue } from '../shell.types.js';\nimport {\n constantOf,\n notifyShellStore,\n tableAttributes,\n tableOf,\n useShellStore,\n useStableKey,\n type OpenChangeReason,\n type PaneEntry,\n type PaneValue,\n type Table,\n} from './shell-store.js';\n\ntype ResponsiveValue = PaneValue | Partial<Record<Breakpoint, PaneValue>>;\n\nexport type UsePaneOptions = {\n name: PaneName;\n /** The component's display name, for warnings: `Inspector`, `Sidebar`, \u2026 */\n label: string;\n /** The prop names a warning should use: `open`/`defaultOpen`, or `state`/`defaultState`. */\n propNames: { controlled: string; default: string };\n id: string | undefined;\n /** The controlled value. */\n controlled: PaneValue | undefined;\n /**\n * The uncontrolled default. A single value fixes where the pane starts. A\n * responsive object leaves the pane untouched (`auto`), with that object as\n * what it shows at each breakpoint.\n */\n defaultValue: ResponsiveValue | undefined;\n /** The pane's presentation at every breakpoint. Pass a memoised table. */\n presentationTable: Table<PresentationValue>;\n /** What an untouched pane shows where no default says otherwise. Pass a module-level function. */\n builtIn: (presentation: PresentationValue) => PaneValue;\n /** Reports a change a user made. Never called on mount or on a resize. */\n onChange: ((value: PaneValue, reason: OpenChangeReason) => void) | undefined;\n /** The value a toggle moves to. Defaults to open and closed in turn. */\n toggleNext?: (current: PaneValue, defaultHere: PaneValue | undefined) => PaneValue;\n /** The pane's designed open width, published for the panes beside it. */\n size: number;\n};\n\nexport type PaneController = ReturnType<typeof usePane>;\n\nconst isMap = (value: ResponsiveValue | undefined): value is Partial<Record<Breakpoint, PaneValue>> => typeof value === 'object' && value !== null;\n\n/** Everything the togglable panes share: their state, their registry entry and their callbacks. */\nexport function usePane(options: UsePaneOptions) {\n const { name, label, propNames, presentationTable, builtIn } = options;\n const store = useShellStore(`Shell.${label}`);\n const generatedId = React.useId();\n const id = options.id ?? `shell-${name}${generatedId}`;\n\n const controlled = options.controlled !== undefined;\n const autoSource = isMap(options.defaultValue) ? options.defaultValue : undefined;\n const autoKey = useStableKey(autoSource);\n const [inner, setInner] = React.useState<'auto' | PaneValue>(() => (typeof options.defaultValue === 'string' ? options.defaultValue : 'auto'));\n\n // What an untouched pane shows at each breakpoint: a responsive default\n // where it states one, the pane's own default where it does not.\n const autoTable = React.useMemo(\n () => tableOf<PaneValue>(autoSource, (bp) => builtIn(presentationTable[bp])),\n // `autoKey` stands for the responsive object, which is usually a new literal each render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [autoKey, presentationTable, builtIn],\n );\n\n let state: 'auto' | PaneValue = inner;\n if (options.controlled !== undefined) state = options.controlled;\n\n // Only a pane whose answer depends on the window subscribes to it, so a\n // pane with one presentation and one default never re-renders on a resize.\n const needsBreakpoint = constantOf(presentationTable) === undefined || (state === 'auto' && constantOf(autoTable) === undefined);\n const { breakpoint, ready } = useBreakpoint(needsBreakpoint);\n\n /** A table's value now: known without the window when it holds one value, else once the breakpoint is known. */\n const now = <T,>(table: Table<T>): T | undefined => {\n const constant = constantOf(table);\n if (constant !== undefined) return constant;\n return ready ? table[breakpoint] : undefined;\n };\n\n const value: PaneValue | undefined = state === 'auto' ? now(autoTable) : state;\n const presentation = now(presentationTable);\n const overlaying = presentation === 'overlay';\n const shown = value === undefined ? undefined : value !== 'closed';\n const overlayLive = shown === true && overlaying;\n\n // Stable actions over the latest values, so the registry entry changes only\n // when a fact it carries changes.\n const defaultValue = options.defaultValue;\n const latest = React.useRef({ state, value, autoTable, defaultValue, controlled, onChange: options.onChange, toggleNext: options.toggleNext });\n useLayoutEffect(() => {\n latest.current = { state, value, autoTable, defaultValue, controlled, onChange: options.onChange, toggleNext: options.toggleNext };\n });\n\n /**\n * What the pane shows, and its default, at the window's breakpoint right\n * now. Asked at the moment of an action rather than taken from the last\n * render: a touched pane no longer follows the window, and a click can land\n * before the mirror has resolved after hydration.\n */\n const valueNow = React.useCallback((): PaneValue | undefined => {\n const current = latest.current;\n if (current.value !== undefined) return current.value;\n return current.state === 'auto' ? current.autoTable[readBreakpoint()] : undefined;\n }, []);\n const defaultHereNow = React.useCallback((): PaneValue | undefined => {\n const current = latest.current;\n if (typeof current.defaultValue === 'string') return current.defaultValue;\n return isMap(current.defaultValue) ? current.autoTable[readBreakpoint()] : undefined;\n }, []);\n\n const setValue = React.useCallback(\n (next: PaneValue, reason: OpenChangeReason) => {\n const current = latest.current;\n if (valueNow() === next) return;\n current.onChange?.(next, reason);\n if (!current.controlled) setInner(next);\n },\n [valueNow],\n );\n\n const toggle = React.useCallback(\n (reason: OpenChangeReason) => {\n const current = latest.current;\n const from = valueNow() ?? 'closed';\n const next = current.toggleNext ? current.toggleNext(from, defaultHereNow()) : from === 'closed' ? 'open' : 'closed';\n setValue(next, reason);\n },\n [setValue, valueNow, defaultHereNow],\n );\n\n // The pane's element, for the Root's containment and focus.\n const elementRef = React.useRef<HTMLElement | null>(null);\n const setElement = React.useCallback((node: HTMLElement | null) => {\n elementRef.current = node;\n }, []);\n\n // Registration. A layout effect so a Trigger's aria attributes and the\n // Root's containment are right before the browser paints.\n useLayoutEffect(() => {\n const entry: PaneEntry = {\n name,\n id,\n el: elementRef.current,\n value,\n presentation,\n presentationTable,\n overlayLive,\n size: options.size,\n setValue,\n toggle,\n };\n store.entries.set(name, entry);\n notifyShellStore(store);\n return () => {\n if (store.entries.get(name) === entry) {\n store.entries.delete(name);\n notifyShellStore(store);\n }\n };\n }, [store, name, id, value, presentation, presentationTable, overlayLive, options.size, setValue, toggle]);\n\n // Development guards. Once per mount, not once per render.\n useLayoutEffect(() => {\n if (process.env.NODE_ENV === 'production') return;\n if (options.controlled !== undefined && options.defaultValue !== undefined) {\n console.error(`Shell.${label}: Do not pass both \\`${propNames.controlled}\\` and \\`${propNames.default}\\`. Choose one.`);\n }\n // Mount only: this is the once-per-mount guard.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n const wasControlled = React.useRef(controlled);\n React.useEffect(() => {\n if (process.env.NODE_ENV === 'production') return;\n if (wasControlled.current !== controlled) {\n console.warn(`Shell.${label}: Switching between controlled and uncontrolled \\`${propNames.controlled}\\` is not supported.`);\n wasControlled.current = controlled;\n }\n }, [controlled, label, propNames.controlled]);\n\n return {\n store,\n id,\n state,\n value,\n shown,\n presentation,\n overlaying,\n overlayLive,\n ready,\n breakpoint,\n autoTable,\n setValue,\n toggle,\n defaultHereNow,\n setElement,\n };\n}\n\n/** The data attributes every togglable pane renders. */\nexport function paneAttributes(pane: PaneController, presentationAttributes: Record<string, string>) {\n const { state, value, presentation } = pane;\n return {\n ...presentationAttributes,\n 'data-state': state,\n ...(state === 'auto' ? tableAttributes('auto', pane.autoTable) : {}),\n 'data-presentation': presentation,\n 'data-mode': value === undefined ? undefined : value === 'closed' ? 'collapsed' : 'expanded',\n } as const;\n}\n\n/** A pane's own presentation, as a table and as the attributes the stylesheet reads. */\nexport function usePresentationTable(presentation: Parameters<typeof tableOf<PresentationValue>>[0], fallback: PresentationValue) {\n const key = useStableKey(presentation);\n const table = React.useMemo(\n () => tableOf<PresentationValue>(presentation, () => fallback),\n // `key` stands for `presentation`, which is usually a new literal each render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [key, fallback],\n );\n // One value is the plain `data-presentation` the pane renders anyway; several\n // are written per breakpoint, so the stylesheet can place the pane before\n // any script runs.\n const attributes = React.useMemo(() => (constantOf(table) === undefined ? tableAttributes('presentation', table) : ({} as Record<string, string>)), [table]);\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UAClB,IAAMT,EAA2BW,EAAc,IAAM2B,CAAQ,EAG7D,CAACC,EAAKD,CAAQ,CAChB,EAIME,EAAmB,UAAQ,IAAOpC,EAAWK,CAAK,IAAM,OAAY2B,EAAgB,eAAgB3B,CAAK,EAAK,CAAC,EAA+B,CAACA,CAAK,CAAC,EAC3J,MAAO,CAAE,MAAAA,EAAO,WAAA+B,CAAW,CAC7B",
|
|
6
|
+
"names": ["React", "useLayoutEffect", "isMap", "value", "usePane", "options", "name", "label", "propNames", "presentationTable", "builtIn", "store", "useShellStore", "generatedId", "id", "controlled", "autoSource", "autoKey", "useStableKey", "inner", "setInner", "autoTable", "tableOf", "bp", "state", "needsBreakpoint", "constantOf", "breakpoint", "ready", "useBreakpoint", "now", "table", "constant", "presentation", "overlaying", "shown", "overlayLive", "defaultValue", "latest", "useLayoutEffect", "valueNow", "current", "readBreakpoint", "defaultHereNow", "setValue", "next", "reason", "toggle", "from", "elementRef", "setElement", "node", "entry", "notifyShellStore", "wasControlled", "paneAttributes", "pane", "presentationAttributes", "tableAttributes", "usePresentationTable", "fallback", "key", "attributes"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as p}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as p}from"./chunk-MDQ7ZHOS.js";import*as o from"react";var l=Object.entries(p),u=null,i=new Set,n=null;function c(){return u??(u=l.map(([t,e])=>[t,window.matchMedia(e)])),u}function s(){let t="initial";for(let[e,r]of c())r.matches&&(t=e);return t}function a(){let t=s();t!==n&&(n=t,i.forEach(e=>e()))}function f(t){if(typeof window>"u")return()=>{};if(i.size===0){n=s();for(let[,e]of c())typeof e.addEventListener=="function"?e.addEventListener("change",a):e.addListener?.(a)}return i.add(t),()=>{if(i.delete(t),!(i.size>0)){for(let[,e]of c())try{typeof e.removeEventListener=="function"?e.removeEventListener("change",a):e.removeListener?.(a)}catch{}n=null}}}function y(){return typeof window>"u"?"initial":(n??(n=s()),n)}function k(){return"initial"}function L(){return typeof window>"u"?"initial":s()}var m=()=>!0,B=()=>!1,d=()=>()=>{},S=()=>"initial";function E(t=!0){let e=o.useSyncExternalStore(t?f:d,t?y:S,k),r=o.useSyncExternalStore(t?f:d,m,B);return o.useMemo(()=>({breakpoint:e,ready:r}),[e,r])}export{L as a,E as b};
|
|
3
|
+
//# sourceMappingURL=chunk-WJKCXGVN.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as je}from"./chunk-SECVO3CW.js";import{a as Ke}from"./chunk-MQA3BKF4.js";import{a as qe}from"./chunk-5U2LEJLU.js";import{a as $e}from"./chunk-H7GH3DTF.js";import{a as G,b as We,c as _e,d as Ue}from"./chunk-SHDZYFUN.js";import{a as De,b as fe}from"./chunk-RYXIRZQW.js";import{a as me,b as Pe,c as he}from"./chunk-UFYQC5XY.js";import{a as Ie,b as Be,c as Ve}from"./chunk-MXNPCJPV.js";import{a as Ne}from"./chunk-S66WR5R7.js";import{b as Ee}from"./chunk-5ON3XLRD.js";import{a as ye}from"./chunk-WJKCXGVN.js";import{b as ae}from"./chunk-VWRPVM5K.js";import{c as ue,d as de,e as we,f as pe,i as Fe,j as Ae,k as Oe}from"./chunk-FKCKELUB.js";import{c as xe,d as ke}from"./chunk-QEDKL23P.js";import{e as se,f as ze,h as Te,i as Le,j as ie,k as ce,l as Me,m as ne}from"./chunk-LBAC2X4U.js";import{a as He}from"./chunk-ANQLWGFN.js";import{a as ot}from"./chunk-VQPANPMI.js";var dt={};ot(dt,{Bottom:()=>qe,Content:()=>tt,Header:()=>Ze,Inspector:()=>$e,PaneFooter:()=>Ae,PaneHeader:()=>Fe,Panel:()=>be,Rail:()=>et,Root:()=>Qe,Scroll:()=>Oe,Sidebar:()=>Ke,Trigger:()=>nt,useSidebarMode:()=>je});import*as e from"react";import W from"classnames";import{Slot as rt}from"radix-ui";import{useComposedRefs as ge,useLayoutEffect as lt}from"radix-ui/internal";var Se=0;function Ge(a){Se=Math.max(0,Se+a);let l=document.documentElement;Se>0?l.setAttribute("data-kui-shell-lock",""):l.removeAttribute("data-kui-shell-lock")}var Re="data-kui-shell-inert",at=30;function Y(a,l){return l===null||l===a||l===a.body||l===a.documentElement}function Ye(a,l,s){for(let p of a.querySelectorAll("[data-shell-trigger][aria-controls]"))if(!(p.getAttribute("aria-controls")!==l||p.closest("[inert]"))&&!(s&&!s.some(m=>m.contains(p))))return p;return null}var st={values:["1","2","3"]},Je=e.createContext(null),Xe=64;function ve(a){return a.querySelector(":scope > .kui-ShellContent > .kui-ShellScroll > .kui-ScrollAreaViewport")??a.querySelector(":scope > .kui-ShellContent")}var Qe=e.forwardRef(({className:a,children:l,height:s="full",contained:p,size:m,style:T,onKeyDown:S,onFocus:g,...v},b)=>{let L=Ee(m,st),[u]=e.useState(ze),C=e.useCallback(t=>Te(u,t),[u]);e.useSyncExternalStore(C,()=>u.version,()=>0);let d=e.useRef(null),_=ge(b,d),[U,E]=e.useState(()=>new Set),A=e.useCallback(t=>{E(n=>n.has(t)?n:new Set(n).add(t))},[]),O=e.useCallback(t=>{E(n=>{if(!n.has(t))return n;let r=new Set(n);return r.delete(t),r})},[]),q=e.useMemo(()=>({registerOffFrame:A,unregisterOffFrame:O}),[A,O]),N=e.useCallback(()=>{for(let t of u.entries.values())t.overlayLive&&t.setValue("closed","dismiss")},[u]),$=e.useCallback(()=>[...u.entries.values()].filter(t=>t.overlayLive&&t.el).map(t=>({name:t.name,id:t.id,el:t.el})),[u]),y=[...u.entries.values()].filter(t=>t.overlayLive&&t.el).length,D=p===!0||s!=="full"&&s!=="auto",M=!D&&s==="full",[K,oe]=e.useState(void 0);e.useEffect(()=>{if(!M)return;let t=d.current,n=t?.ownerDocument.defaultView;if(!t||!n||typeof n.matchMedia!="function")return;let r=xe(),i=r?n.scrollY:ve(t)?.scrollTop??0,h=0,R=0,x=()=>{R&&cancelAnimationFrame(R),R=requestAnimationFrame(()=>{R=0})},B=()=>{r&&!R&&(i=n.scrollY)},V=o=>{!r&&!R&&o.target instanceof HTMLElement&&o.target===ve(t)&&(i=o.target.scrollTop)};n.addEventListener("resize",x),n.addEventListener("scroll",B,{passive:!0}),t.addEventListener("scroll",V,{passive:!0,capture:!0});let le=ke(o=>{r=o;let c=i;h&&cancelAnimationFrame(h),h=requestAnimationFrame(()=>{if(h=0,o)n.scrollTo(0,c);else{let f=ve(t);f&&(f.scrollTop=c)}})});return()=>{h&&cancelAnimationFrame(h),R&&cancelAnimationFrame(R),n.removeEventListener("resize",x),n.removeEventListener("scroll",B),t.removeEventListener("scroll",V,{capture:!0}),le()}},[M]);let k=e.useCallback(()=>{let t=d.current;if(!t)return;let n=$().map(r=>r.el);for(let r of t.children){if(!(r instanceof HTMLElement)||r.classList.contains("kui-ShellScrim"))continue;let i=n.some(h=>r===h||r.contains(h));n.length===0||i?r.hasAttribute(Re)&&(r.removeAttribute(Re),r.inert=!1):r.inert||(r.setAttribute(Re,""),r.inert=!0)}},[$]),w=e.useRef(null),X=e.useRef([]),J=e.useRef(null),P=e.useRef(!1),H=e.useRef(0),I=e.useCallback(()=>{H.current&&cancelAnimationFrame(H.current),H.current=0},[]),Q=e.useCallback((t,n)=>{I();let r=0,i=()=>{if(H.current=0,!!t.isConnected){if(n(t.ownerDocument.activeElement)){t.focus({preventScroll:!0});return}r+=1,r<at&&(H.current=requestAnimationFrame(i))}};H.current=requestAnimationFrame(i)},[I]);e.useEffect(()=>()=>{I(),P.current&&(P.current=!1,Ge(-1))},[I]),e.useEffect(()=>{let t=d.current;if(!t)return;let n=t.ownerDocument,r=$(),i=r.map(o=>o.el),h=!D&&r.length>0;h!==P.current&&(P.current=h,Ge(h?1:-1));let R=X.current;X.current=r;let x=R.filter(o=>{if(i.includes(o.el))return!1;let c=u.entries.get(o.name);return!o.el.isConnected||!c||c.el!==o.el||c.value==="closed"}),B=o=>o!==null&&x.some(c=>c.el.contains(o));if(R.length===0&&r.length>0){let o=n.activeElement,c=o instanceof HTMLElement&&!Y(n,o)&&!i.some(f=>f.contains(o))?o:null;if(c&&!t.contains(c)){let f=J.current;f&&f.isConnected&&!i.some(te=>te.contains(f))&&(c=f)}w.current=c}if(k(),r.length===0){let o=w.current;if(w.current=null,x.length===0)return;let f=(z=>z!==null&&z.isConnected&&!z.closest("[inert]")&&!B(z))(o)?o:null;for(let z of x)f??(f=Ye(n,z.id));if(!f)return;let te=z=>Y(n,z)||B(z);te(n.activeElement)?f.focus({preventScroll:!0}):Q(f,te);return}if(x.length>0){let o=n.activeElement;if(Y(n,o)||B(o)){let c=null;for(let f of x)c??(c=Ye(n,f.id,i));(c??i[i.length-1]).focus({preventScroll:!0})}}let V=i.filter(o=>!R.some(c=>c.el===o)),le=n.activeElement;V.length>0&&!i.some(o=>o.contains(le))&&(V[0].focus({preventScroll:!0}),Q(V[0],o=>Y(n,o)||o instanceof Element&&o.closest("[inert]")!==null))}),e.useEffect(()=>{let t=d.current;if(!t||y===0||typeof MutationObserver>"u")return;let n=new MutationObserver(k);return n.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]}),()=>n.disconnect()},[y,k]);let Z=t=>{S?.(t),!(t.key!=="Escape"||t.defaultPrevented||y===0)&&(N(),t.stopPropagation())};e.useEffect(()=>{let t=d.current;if(!t||y===0)return;let n=t.ownerDocument,r=i=>{i.key!=="Escape"||i.defaultPrevented||!Y(n,i.target)||N()};return n.addEventListener("keydown",r),()=>n.removeEventListener("keydown",r)},[y,N]);let ee=t=>{g?.(t),t.target instanceof HTMLElement&&d.current?.contains(t.target)&&(J.current=t.target)},F=u.entries.get("rail"),j=F!==void 0&&F.value!==void 0&&F.value!=="closed"?U.has("rail")?`calc(${F.size}px + 2 * var(--shell-gap))`:`${F.size}px`:void 0,re=s==="full"?{}:s==="auto"?{height:"auto"}:typeof s=="number"?{height:`${s}px`}:{height:s};return e.createElement(Le.Provider,{value:u},e.createElement(ue.Provider,{value:L},e.createElement(de.Provider,{value:!1},e.createElement(we.Provider,{value:M},e.createElement(Je.Provider,{value:oe},e.createElement(Me.Provider,{value:q},e.createElement(He.Provider,{value:void 0},e.createElement("div",{...v,ref:_,className:W("kui-ShellRoot",a),"data-height":s==="auto"&&!D?"auto":void 0,"data-contained":D||void 0,"data-window":M||void 0,"data-overlay-live":y>0||void 0,onKeyDown:Z,onFocus:ee,style:{...re,...j?{"--shell-rail-offset":j}:{},...K!==void 0?{"--kui-shell-header-h":`${K}px`}:{},...T}},l,e.createElement("div",{className:"kui-ShellScrim","aria-hidden":!0,onClick:N})))))))))});Qe.displayName="Shell.Root";var Ze=e.forwardRef(({className:a,height:l=Xe,flush:s=!0,style:p,...m},T)=>{let S=e.useContext(Je);return lt(()=>{if(S)return S(l===Xe?void 0:l),()=>S(void 0)},[S,l]),e.createElement("header",{...m,ref:T,className:W("kui-ShellHeader",a),"data-flush":s||void 0,style:{...p,"--shell-header-height":`${l}px`}})});Ze.displayName="Shell.Header";var it={controlled:"open",default:"defaultOpen"},et=e.forwardRef((a,l)=>{let{className:s,presentation:p,expandedSize:m=64,collapsible:T,children:S,style:g,open:v,defaultOpen:b,onOpenChange:L,flush:u=!0,id:C,...d}=a,{table:_,attributes:U}=he(p,"fixed"),E=me({name:"rail",label:"Rail",propNames:it,id:C,controlled:G(v),defaultValue:G(b),presentationTable:_,builtIn:We,onChange:(O,q)=>L?.(O!=="closed",{reason:q}),size:m});ne("rail",u);let A=ge(l,E.setElement);return e.createElement("div",{...d,role:d.role??"navigation",id:E.id,ref:A,className:W("kui-ShellPane","kui-ShellRail",s),...Pe(E,U),"data-flush":u||void 0,tabIndex:E.overlaying?-1:d.tabIndex,style:{...g,"--rail-size":`${m}px`}},e.createElement(ct,null,S))});et.displayName="Shell.Rail";function ct({children:a}){let l=e.useContext(ue);return e.createElement("div",{className:W("kui-ShellRailContent",`kui-r-size-${l}`)},e.createElement(pe,{presentation:"thin"},a))}var ut={controlled:"open",default:"defaultOpen"},be=e.forwardRef((a,l)=>{let{className:s,presentation:p,defaultOpen:m,open:T,onOpenChange:S,size:g,defaultSize:v,expandedSize:b=288,minSize:L=100,maxSize:u=800,resizable:C=!1,collapsible:d=!0,onResize:_,onResizeStart:U,onResizeEnd:E,children:A,style:O,onSizeChange:q,sizeUpdate:N,sizeUpdateMs:$=50,flush:y=!0,id:D,...M}=a,K=ie("Shell.Panel"),oe=ce(K,"rail"),k=he(p,"fixed"),w=p===void 0,X=w?oe?.presentationTable??se:k.table,J=w?{"data-presentation-follows":""}:k.attributes,P=me({name:"panel",label:"Panel",propNames:ut,id:D,controlled:G(T),defaultValue:G(m),presentationTable:X,builtIn:_e,onChange:(j,re)=>S?.(j!=="closed",{reason:re}),size:b});ne("panel",y);let H=e.useRef(null),I=ge(l,P.setElement,H),Q=Be({name:"panel",elementId:P.id,elementRef:H,cssVarName:"--panel-size",orientation:"vertical",edge:"end",growth:Ue,expandedSize:b,minSize:L,maxSize:u,resizable:C,collapsible:d,size:g,defaultSize:v,onSizeChange:q,sizeUpdate:N,sizeUpdateMs:$,onResize:_,onResizeStart:U,onResizeEnd:E,overlaying:P.overlaying,overlayingNow:()=>(w?K.entries.get("rail")?.presentationTable??se:k.table)[ye()]==="overlay",requestToggle:()=>P.toggle("toggle")}),Z=Ie(g,v,L,u),{handles:ee,content:F}=Ve(A,fe),Ce=C&&P.shown!==!1&&!P.overlaying?e.createElement(Ne.Provider,{value:Q},ee.length>0?ee:e.createElement(De,null)):null;return e.createElement("div",{...M,role:M.role??"navigation",id:P.id,ref:I,className:W("kui-ShellPane","kui-ShellPanel",s),...Pe(P,J),"data-flush":y||void 0,tabIndex:P.overlaying?-1:M.tabIndex,style:{...O,"--panel-expanded-size":`${b}px`,...Z?{"--panel-size":Z}:{}}},e.createElement("div",{className:"kui-ShellPanelContent"},e.createElement(pe,null,e.createElement(ae,null,F))),Ce)});be.displayName="Shell.Panel";be.Handle=fe;var tt=e.forwardRef(({className:a,flush:l=!0,children:s,...p},m)=>(ne("content",l),e.createElement("main",{...p,ref:m,className:W("kui-ShellContent",a),"data-flush":l||void 0},e.createElement(de.Provider,{value:!0},e.createElement(ae,null,s)))));tt.displayName="Shell.Content";var nt=e.forwardRef(({target:a,action:l="toggle",asChild:s=!1,onClick:p,children:m,...T},S)=>{let g=ie("Shell.Trigger"),v=ce(g,a),b=v?.value===void 0?void 0:v.value!=="closed",L=C=>{if(p?.(C),C.defaultPrevented)return;let d=g.entries.get(a);d&&(l==="toggle"?d.toggle("toggle"):l==="expand"?d.setValue("open","toggle"):d.setValue("closed","toggle"))},u=s?rt.Root:"button";return e.createElement(u,{...!s&&{type:"button"},"aria-controls":v?.id,"aria-expanded":b,...T,ref:S,onClick:L,"data-shell-trigger":a,"data-shell-action":l},m)});nt.displayName="Shell.Trigger";export{Qe as a,Ze as b,et as c,be as d,tt as e,nt as f,dt as g};
|
|
3
|
+
//# sourceMappingURL=chunk-XBDAE77C.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 subscribeShellStore,\n useFrameRegistration,\n usePaneEntry,\n useShellStore,\n type FramePaneId,\n} from './_internal/shell-store.js';\nimport { navigationRest, detailRest, toPaneValue, startAnchoredGrowth } from './_internal/shell-rest.js';\nimport { useSidebarMode } from './shell.context.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, PaneOpenChangeReason, 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 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: PaneOpenChangeReason };\n\ntype RailControlledProps = { open: 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 /**\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, 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 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: PaneOpenChangeReason };\ntype PanelControlledProps = { open: 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 onResize,\n onResizeStart,\n onResizeEnd,\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 size: expandedSize,\n });\n useFrameRegistration('panel', flush);\n\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 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 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 {...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\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', asChild = false, onClick, children, ...props }, ref) => {\n const store = useShellStore('Shell.Trigger');\n // Subscribes to its own pane only.\n const entry = usePaneEntry(store, target);\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(target);\n if (!current) return;\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 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 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 Rail,\n Panel,\n Sidebar,\n Content,\n Inspector,\n Bottom,\n Trigger,\n PaneHeader,\n PaneFooter,\n Scroll,\n useSidebarMode,\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": ";w2BAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,GAAA,YAAAC,GAAA,WAAAC,GAAA,cAAAC,GAAA,eAAAC,GAAA,eAAAC,GAAA,UAAAC,GAAA,SAAAC,GAAA,SAAAC,GAAA,WAAAC,GAAA,YAAAC,GAAA,YAAAC,GAAA,mBAAAC,KAsBA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,QAAAC,OAAY,WACrB,OAAS,mBAAAC,GAAiB,mBAAAC,OAAuB,oBA0DjD,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,EAAI,gBAAgB,qBAAqB,CAChD,CAGA,IAAMC,GAAa,uBAGbC,GAAgB,GAGtB,SAASC,EAAUH,EAAeI,EAA2C,CAC3E,OAAOA,IAAO,MAAQA,IAAOJ,GAAOI,IAAOJ,EAAI,MAAQI,IAAOJ,EAAI,eACpE,CAGA,SAASK,GAAWL,EAAeM,EAAYC,EAA4C,CACzF,QAAWH,KAAMJ,EAAI,iBAA8B,qCAAqC,EACtF,GAAI,EAAAI,EAAG,aAAa,eAAe,IAAME,GAAMF,EAAG,QAAQ,SAAS,IAC/D,EAAAG,GAAU,CAACA,EAAO,KAAMC,GAASA,EAAK,SAASJ,CAAE,CAAC,GACtD,OAAOA,EAET,OAAO,IACT,CAKA,IAAMK,GAAmB,CAAE,OAAQ,CAAC,IAAK,IAAK,GAAG,CAAW,EAGtDC,GAAiC,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OgD,CAAM,EAClC4F,EAAQ5H,GAAO,QAAU,OAAY,OAAYA,EAAM,QAAU,SAEjE6H,EAAe7G,GAA+C,CAElE,GADA2G,IAAU3G,CAAK,EACXA,EAAM,iBAAkB,OAC5B,IAAM8G,EAAU9I,EAAM,QAAQ,IAAIgD,CAAM,EACnC8F,IACDL,IAAW,SAAUK,EAAQ,OAAO,QAAQ,EACvCL,IAAW,SAAUK,EAAQ,SAAS,OAAQ,QAAQ,EAC1DA,EAAQ,SAAS,SAAU,QAAQ,EAC1C,EAEMC,EAAOL,EAAUM,GAAK,KAAO,SACnC,OACE,gBAACD,EAAA,CAIE,GAAI,CAACL,GAAW,CAAE,KAAM,QAAkB,EAC3C,gBAAe1H,GAAO,GACtB,gBAAe4H,EACd,GAAGhJ,EACJ,IAAKC,EACL,QAASgJ,EACT,qBAAoB7F,EACpB,oBAAmByF,GAElBpJ,CACH,CAEJ,CAAC,EACDmJ,GAAQ,YAAc",
|
|
6
|
+
"names": ["shell_exports", "__export", "Bottom", "Content", "Header", "Inspector", "PaneFooter", "PaneHeader", "Panel", "Rail", "Root", "Scroll", "Sidebar", "Trigger", "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", "RAIL_PROP_NAMES", "Rail", "presentation", "expandedSize", "_collapsible", "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", "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", "PageScope", "Content", "Trigger", "action", "asChild", "onClick", "shown", "handleClick", "current", "Comp", "Slot"]
|
|
7
|
+
}
|