@womp/kookie-ui 0.36.0 → 0.37.1
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/accordion.js +1 -1
- package/dist/cjs/components/accordion.js.map +1 -1
- package/dist/cjs/components/accordion.props.d.ts +4 -3
- package/dist/cjs/components/accordion.props.d.ts.map +1 -1
- package/dist/cjs/components/accordion.props.js +1 -1
- package/dist/cjs/components/accordion.props.js.map +1 -1
- 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/cjs/props/index.js +1 -1
- package/dist/cjs/props/index.js.map +1 -1
- package/dist/esm/{chunk-5RLGDXOM.js → chunk-2K46JPUL.js} +2 -2
- package/dist/esm/chunk-3DBHPBG6.js +3 -0
- package/dist/esm/{chunk-ASBTPKH3.js.map → chunk-3DBHPBG6.js.map} +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-QBVTI32A.js +2 -0
- package/dist/esm/chunk-QBVTI32A.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/accordion.js +1 -1
- package/dist/esm/components/accordion.props.d.ts +4 -3
- package/dist/esm/components/accordion.props.d.ts.map +1 -1
- package/dist/esm/components/accordion.props.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/dist/esm/props/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/accordion.props.tsx +2 -4
- 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-ASBTPKH3.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-I77CYEBT.js +0 -2
- package/dist/esm/chunk-I77CYEBT.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
|
@@ -1,7 +0,0 @@
|
|
|
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 usePeeking,\n useShellStore,\n useStableKey,\n warnOnce,\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. A responsive object is deprecated: it is resolved against the current breakpoint. */\n controlled: ResponsiveValue | 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 onExpand: (() => void) | undefined;\n onCollapse: (() => void) | undefined;\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/** The first value a responsive object states, smallest breakpoint first. */\nfunction firstStated(map: Partial<Record<Breakpoint, PaneValue>>): PaneValue {\n for (const bp of ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const) {\n const value = map[bp];\n if (value !== undefined) return value;\n }\n return 'closed';\n}\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 controlledIsMap = isMap(options.controlled);\n if (controlledIsMap) {\n warnOnce(\n `Shell.${label}: a responsive \\`${propNames.controlled}\\` is deprecated and is removed in 1.0. ` +\n `Pass a boolean and decide it from your own state, or use \\`${propNames.default}\\` with a responsive object.`,\n );\n }\n\n // A responsive controlled value is resolved the way a responsive default\n // is: it becomes the table an untouched pane follows, so the stylesheet\n // answers it at each breakpoint (right in the server HTML, with no\n // callback on a crossing) and the app's prop is still the only writer.\n const controlledMap = controlledIsMap ? (options.controlled as Partial<Record<Breakpoint, PaneValue>>) : undefined;\n const autoSource = controlledMap ?? (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 () => (controlledMap ? tableOf<PaneValue>(controlledMap, () => firstStated(controlledMap)) : 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, controlledIsMap, presentationTable, builtIn],\n );\n\n let state: 'auto' | PaneValue = inner;\n if (controlled) state = controlledMap ? 'auto' : (options.controlled as PaneValue);\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 // onExpand/onCollapse fire when the pane's state changes and that changes\n // whether it is shown: a user's toggle, or a controlled prop. Never on\n // mount, and never because the window crossed a breakpoint.\n const callbacks = React.useRef({ onExpand: options.onExpand, onCollapse: options.onCollapse });\n useLayoutEffect(() => {\n callbacks.current = { onExpand: options.onExpand, onCollapse: options.onCollapse };\n });\n const previous = React.useRef({ state, shown });\n React.useEffect(() => {\n const before = previous.current;\n if (before.state !== state && before.shown !== undefined && shown !== undefined && before.shown !== shown) {\n if (shown) callbacks.current.onExpand?.();\n else callbacks.current.onCollapse?.();\n }\n previous.current = { state, shown };\n }, [state, shown]);\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 const peeking = usePeeking(store, name) && shown === false && !overlaying;\n\n return {\n store,\n id,\n state,\n value,\n shown,\n presentation,\n overlaying,\n overlayLive,\n peeking,\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, shown } = 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 // Kept for stylesheets written against 0.7: set while a stacked pane is open.\n 'data-open': presentation === 'stacked' && shown ? '' : undefined,\n 'data-peek': pane.peeking ? '' : undefined,\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]);\n return { table, attributes };\n}\n"],
|
|
5
|
-
"mappings": ";4HAEA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,MAAuB,oBAmDhC,IAAMC,EAASC,GAAwF,OAAOA,GAAU,UAAYA,IAAU,KAG9I,SAASC,GAAYC,EAAwD,CAC3E,QAAWC,IAAM,CAAC,UAAW,KAAM,KAAM,KAAM,KAAM,IAAI,EAAY,CACnE,IAAMH,EAAQE,EAAIC,CAAE,EACpB,GAAIH,IAAU,OAAW,OAAOA,CAClC,CACA,MAAO,QACT,CAGO,SAASI,GAAQC,EAAyB,CAC/C,GAAM,CAAE,KAAAC,EAAM,MAAAC,EAAO,UAAAC,EAAW,kBAAAC,EAAmB,QAAAC,CAAQ,EAAIL,EACzDM,EAAQC,EAAc,SAASL,CAAK,EAAE,EACtCM,EAAoB,QAAM,EAC1BC,EAAKT,EAAQ,IAAM,SAASC,CAAI,GAAGO,CAAW,GAE9CE,EAAaV,EAAQ,aAAe,OACpCW,EAAkBjB,EAAMM,EAAQ,UAAU,EAC5CW,IAES,GAAAT,CA5Ef,GA4EwCC,EAAU,UA5ElD,GA6EsEA,EAAU,OA7EhF,GA2EI,QAUF,IAAMS,EAAgBD,EAAmBX,EAAQ,WAAwD,OACnGa,EAAaD,IAAkBlB,EAAMM,EAAQ,YAAY,EAAIA,EAAQ,aAAe,QACpFc,EAAUC,EAAaF,CAAU,EACjC,CAACG,EAAOC,CAAQ,EAAU,WAA6B,IAAO,OAAOjB,EAAQ,cAAiB,SAAWA,EAA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OAAYA,IAAU,SAAW,YAAc,WAElF,YAAakC,IAAiB,WAAaE,EAAQ,GAAK,OACxD,YAAa0B,EAAK,QAAU,GAAK,MACnC,CACF,CAGO,SAASG,GAAqB/B,EAAgEgC,EAA6B,CAChI,IAAMC,EAAM/C,EAAac,CAAY,EAC/BF,EAAc,UAClB,IAAMR,EAA2BU,EAAc,IAAMgC,CAAQ,EAG7D,CAACC,EAAKD,CAAQ,CAChB,EAIME,EAAmB,UAAQ,IAAOzC,EAAWK,CAAK,IAAM,OAAYgC,EAAgB,eAAgBhC,CAAK,EAAK,CAAC,EAA+B,CAACA,CAAK,CAAC,EAC3J,MAAO,CAAE,MAAAA,EAAO,WAAAoC,CAAW,CAC7B",
|
|
6
|
-
"names": ["React", "useLayoutEffect", "isMap", "value", "firstStated", "map", "bp", "usePane", "options", "name", "label", "propNames", "presentationTable", "builtIn", "store", "useShellStore", "generatedId", "id", "controlled", "controlledIsMap", "controlledMap", "autoSource", "autoKey", "useStableKey", "inner", "setInner", "autoTable", "tableOf", "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", "callbacks", "previous", "before", "wasControlled", "peeking", "usePeeking", "paneAttributes", "pane", "presentationAttributes", "tableAttributes", "usePresentationTable", "fallback", "key", "attributes"]
|
|
7
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{a as m,c as E,f as H,g as N}from"./chunk-XUCR7L4G.js";import{a as R,e as p}from"./chunk-4OJRLS5N.js";import{a as y,b as x,c as O}from"./chunk-KGCGT4MJ.js";import{a as M,b as T,c as w}from"./chunk-4TTRPCGG.js";import{a as v}from"./chunk-MXEOE4LA.js";import{a as B}from"./chunk-G66WDIIV.js";import{b as S}from"./chunk-VWRPVM5K.js";import{o as C}from"./chunk-5BXCPANF.js";import*as e from"react";import re from"classnames";import{useComposedRefs as pe}from"radix-ui/internal";var me={controlled:"open",default:"defaultOpen"},U=e.forwardRef((k,I)=>{let{className:V,presentation:A="fixed",defaultOpen:L,open:$,onOpenChange:q,expandedSize:t=200,minSize:n=100,maxSize:a=400,resizable:d=!1,collapsible:D=!0,onExpand:F,onCollapse:W,onResize:_,onResizeStart:j,onResizeEnd:G,snapPoints:s,snapTolerance:K,collapseThreshold:i,paneId:l,persistence:r,children:J,style:Q,size:u,defaultSize:c,onSizeChange:X,sizeUpdate:Y,sizeUpdateMs:Z=50,flush:f=!0,id:ee,...P}=k,{table:z,attributes:oe}=O(A,"fixed"),o=y({name:"bottom",label:"Bottom",propNames:me,id:ee,controlled:m($),defaultValue:m(L),presentationTable:z,builtIn:E,onChange:(ie,le)=>q?.(ie!=="closed",{reason:le}),onExpand:F,onCollapse:W,size:t});C("bottom",f),e.useEffect(()=>{(s!==void 0||i!==void 0||l!==void 0||r!==void 0)&&void 0},[s,i,l,r]);let h=e.useRef(null),te=pe(I,o.setElement,h),ne=T({name:"bottom",elementId:o.id,elementRef:h,cssVarName:"--bottom-size",orientation:"horizontal",edge:"start",growth:H,expandedSize:t,minSize:n,maxSize:a,resizable:d,collapsible:D,size:u,defaultSize:c,onSizeChange:X,sizeUpdate:Y,sizeUpdateMs:Z,onResize:_,onResizeStart:j,onResizeEnd:G,snapPoints:s,snapTolerance:K,collapseThreshold:i,paneId:l,persistence:r,overlaying:o.overlaying,overlayingNow:()=>z[B()]==="overlay",requestCollapse:()=>o.setValue("closed","toggle"),requestToggle:()=>o.toggle("toggle")}),b=M(u,c,n,a),{handles:g,content:ae}=w(J,p),se=d&&o.shown!==!1&&!o.overlaying?e.createElement(v.Provider,{value:ne},g.length>0?g:e.createElement(R,null)):null;return e.createElement("div",{...N(P),id:o.id,ref:te,className:re("kui-ShellPane","kui-ShellBottom",V),...x(o,oe),"data-flush":f||void 0,tabIndex:o.overlaying?-1:P.tabIndex,style:{...Q,"--bottom-expanded-size":`${t}px`,...b?{"--bottom-size":b}:{},"--bottom-min-size":`${n}px`,"--bottom-max-size":`${a}px`}},e.createElement("div",{className:"kui-ShellBottomContent"},e.createElement(S,null,ae)),se)});U.displayName="Shell.Bottom";U.Handle=p;export{U as a};
|
|
3
|
-
//# sourceMappingURL=chunk-M26LLCQC.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/_internal/shell-bottom.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposedRefs } from 'radix-ui/internal';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { BottomHandle, PaneHandle } from './shell-handles.js';\nimport { usePane, paneAttributes, usePresentationTable } from './shell-pane.js';\nimport { splitHandles, useInitialPaneSize, useResizablePane, type SizeChangeMeta } from './shell-resizable.js';\nimport { useFrameRegistration, warnOnce } from './shell-store.js';\nimport { bottomAnchoredGrowth, detailRest, toPaneValue, withoutRemovedPaneProps } from './shell-rest.js';\nimport { PageScope } from './page-scope.js';\nimport { readBreakpoint } from '../../hooks/use-breakpoint.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps } from '../shell.types.js';\n\ntype BottomOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'dismiss' };\ntype BottomControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; defaultOpen?: never };\n/** Since 0.8.0 `defaultOpen` takes a responsive object here too, as the docs already said it did. */\ntype BottomUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: BottomOpenChangeMeta) => void; open?: never };\ntype BottomSizeControlledProps = { size: number | string; defaultSize?: never };\ntype BottomSizeUncontrolledProps = { defaultSize?: number | string; size?: never };\ntype BottomPublicProps = PaneBaseProps &\n (BottomControlledProps | BottomUncontrolledProps) &\n (BottomSizeControlledProps | BottomSizeUncontrolledProps) & {\n onSizeChange?: (size: number, meta: SizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /**\n * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its\n * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a\n * card. It then floats over the content if the content is flush, and otherwise sits on the\n * Shell's background beside a card content.\n */\n flush?: boolean;\n };\n\ntype BottomComponent = React.ForwardRefExoticComponent<BottomPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof BottomHandle };\n\nconst BOTTOM_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };\n\nexport const Bottom = React.forwardRef<HTMLDivElement, BottomPublicProps>((props, ref) => {\n const {\n className,\n presentation = 'fixed',\n defaultOpen,\n open,\n onOpenChange,\n expandedSize = 200,\n minSize = 100,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n flush = true,\n id,\n ...domProps\n } = props;\n\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'bottom',\n label: 'Bottom',\n propNames: BOTTOM_PROP_NAMES,\n id,\n controlled: toPaneValue(open),\n defaultValue: toPaneValue(defaultOpen),\n presentationTable: table,\n builtIn: detailRest,\n onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useFrameRegistration('bottom', flush);\n\n React.useEffect(() => {\n if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {\n warnOnce('Shell.Bottom: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');\n }\n }, [snapPoints, collapseThreshold, paneId, persistence]);\n\n const elementRef = React.useRef<HTMLElement | null>(null);\n const composedRef = useComposedRefs(ref, pane.setElement, elementRef);\n\n const resize = useResizablePane({\n name: 'bottom',\n elementId: pane.id,\n elementRef,\n cssVarName: '--bottom-size',\n orientation: 'horizontal',\n edge: 'start',\n growth: bottomAnchoredGrowth,\n expandedSize,\n minSize,\n maxSize,\n resizable,\n collapsible,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n overlaying: pane.overlaying,\n overlayingNow: () => table[readBreakpoint()] === 'overlay',\n requestCollapse: () => pane.setValue('closed', 'toggle'),\n requestToggle: () => pane.toggle('toggle'),\n });\n\n // The starting size is in the server HTML, so the pane does not jump on hydration.\n const initialSize = useInitialPaneSize(size, defaultSize, minSize, maxSize);\n const { handles, content } = splitHandles(children, BottomHandle);\n const handle = resizable && pane.shown !== false && !pane.overlaying ? <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider> : null;\n\n return (\n <div\n {...withoutRemovedPaneProps(domProps)}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellBottom', className)}\n {...paneAttributes(pane, attributes)}\n data-flush={flush || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--bottom-expanded-size': `${expandedSize}px`,\n ...(initialSize ? { '--bottom-size': initialSize } : {}),\n '--bottom-min-size': `${minSize}px`,\n '--bottom-max-size': `${maxSize}px`,\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellBottomContent\">\n <PageScope>{content}</PageScope>\n </div>\n {handle}\n </div>\n );\n}) as BottomComponent;\n\nBottom.displayName = 'Shell.Bottom';\nBottom.Handle = Bottom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BAACoD,EAAA,KAAWT,EAAQ,CACtB,EACCG,EACH,CAEJ,CAAC,EAEDxD,EAAO,YAAc,eACrBA,EAAO,OAASuD",
|
|
6
|
-
"names": ["React", "classNames", "useComposedRefs", "BOTTOM_PROP_NAMES", "Bottom", "props", "ref", "className", "presentation", "defaultOpen", "open", "onOpenChange", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "flush", "id", "domProps", "table", "attributes", "usePresentationTable", "pane", "usePane", "toPaneValue", "detailRest", "value", "reason", "useFrameRegistration", "elementRef", "composedRef", "useComposedRefs", "resize", "useResizablePane", "bottomAnchoredGrowth", "readBreakpoint", "initialSize", "useInitialPaneSize", "handles", "content", "splitHandles", "BottomHandle", "handle", "PaneResizeContext", "PaneHandle", "withoutRemovedPaneProps", "classNames", "paneAttributes", "PageScope"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\n/**\n * Why a pane's open state changed. Since 0.8.0 only a user action is reported:\n * `toggle` for a Trigger, a handle double-click or a drag past\n * `collapseThreshold`, and `dismiss` for Escape or a press on the scrim.\n * `init`, `responsive`, `panel` and `left` are kept in the types for\n * compatibility and are never sent.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss' | 'init' | 'responsive';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n /** @deprecated Removed in 1.0. Snap in your own `onSizeChange` and pass `size`. */\n snapPoints?: number[];\n /** @deprecated Removed in 1.0, with `snapPoints`. */\n snapTolerance?: number;\n /** @deprecated Removed in 1.0. Close the pane from your own `onResizeEnd`. */\n collapseThreshold?: number;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n paneId?: string;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/** The panes a Trigger can drive. `left` is the deprecated name for `rail`. */\nexport type PaneName = Exclude<PaneTarget, 'left'>;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n"],
|
|
5
|
-
"mappings": ";AAuDO,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
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{b as P}from"./chunk-G66WDIIV.js";import{h as p,i as b,k as M}from"./chunk-5BXCPANF.js";import*as o from"react";var S=e=>e===void 0?void 0:e==="closed"?"collapsed":"expanded",f=e=>e==="collapsed"?"closed":"open",s=e=>e===void 0||e==="closed"?"collapsed":"expanded",l=e=>e==="left"?"rail":e;function v(e){let d=o.useCallback(r=>p(e,r),[e]);return o.useSyncExternalStore(d,()=>e.version,()=>0)}function V(){let e=M("useSidebarMode"),d=o.useCallback(t=>p(e,t),[e]),r=o.useSyncExternalStore(d,()=>e.entries.get("sidebar")?.value,()=>{}),i=o.useCallback(t=>{e.entries.get("sidebar")?.setValue(f(t),"toggle")},[e]);return{sidebarMode:S(r)??"expanded",setSidebarMode:i}}var g=()=>{};function x(){let e=M("useShell");o.useEffect(()=>{},[]),v(e);let{breakpoint:d,ready:r}=P(),i=o.useMemo(()=>{let n=a=>m=>e.entries.get(a)?.setValue(m==="collapsed"?"closed":"open","toggle"),u=a=>b(e,a===null?null:l(a));return{setLeftMode:n("rail"),setPanelMode:n("panel"),setInspectorMode:n("inspector"),setBottomMode:n("bottom"),setSidebarMode:a=>e.entries.get("sidebar")?.setValue(f(a),"toggle"),setPeekTarget:u,peekPane:a=>u(a),clearPeek:()=>u(null),setHasLeft:g,setHasSidebar:g,togglePane:a=>e.entries.get(l(a))?.toggle("toggle"),expandPane:a=>e.entries.get(l(a))?.setValue("open","toggle"),collapsePane:a=>e.entries.get(l(a))?.setValue("closed","toggle")}},[e]),t=n=>e.entries.get(n)?.value,c=e.entries.get("rail");return{leftMode:s(t("rail")),leftControlledOpen:c?.value===void 0?void 0:c.value!=="closed",panelMode:s(t("panel")),sidebarMode:S(t("sidebar"))??"expanded",inspectorMode:s(t("inspector")),bottomMode:s(t("bottom")),peekTarget:e.peek,hasLeft:e.entries.has("rail"),hasSidebar:e.entries.has("sidebar"),currentBreakpoint:d,currentBreakpointReady:r,leftResolvedPresentation:c?.presentation,...i}}export{V as a,x as b};
|
|
3
|
-
//# sourceMappingURL=chunk-TS4QCDSI.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/shell.context.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\n/**\n * Since 0.8.0 the Shell has two contexts: the pane registry (the store) and\n * the set of panes off the frame. They live in `_internal/shell-store.tsx`. This module keeps\n * the two hooks consumers can reach: `useSidebarMode`, and the deprecated\n * `useShell`.\n */\nimport * as React from 'react';\nimport { useBreakpoint } from '../hooks/use-breakpoint.js';\nimport type { Breakpoint, PaneMode, PaneName, PaneTarget, PresentationValue, SidebarMode } from './shell.types.js';\nimport { setShellPeek, subscribeShellStore, useShellStore, warnOnce, type PaneValue, type ShellStore } 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\nconst toPaneMode = (value: PaneValue | undefined): PaneMode => (value === undefined || value === 'closed' ? 'collapsed' : 'expanded');\n\nconst paneName = (target: PaneTarget): PaneName => (target === 'left' ? 'rail' : target);\n\n/** Re-renders on every change to the registry. For the deprecated whole-shell reader only. */\nfunction useStoreVersion(store: ShellStore) {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n return React.useSyncExternalStore(\n subscribe,\n () => store.version,\n () => 0,\n );\n}\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\nexport interface ShellContextValue {\n leftMode: PaneMode;\n setLeftMode: (mode: PaneMode) => void;\n /** The Rail's open state, resolved, when it is controlled. */\n leftControlledOpen?: boolean;\n panelMode: PaneMode;\n setPanelMode: (mode: PaneMode) => void;\n sidebarMode: SidebarMode;\n setSidebarMode: (mode: SidebarMode) => void;\n inspectorMode: PaneMode;\n setInspectorMode: (mode: PaneMode) => void;\n bottomMode: PaneMode;\n setBottomMode: (mode: PaneMode) => void;\n peekTarget: PaneTarget | null;\n setPeekTarget: (target: PaneTarget | null) => void;\n peekPane: (target: PaneTarget) => void;\n clearPeek: () => void;\n /** Whether a Rail is mounted. */\n hasLeft: boolean;\n /** No effect since 0.8.0: the registry knows which panes are mounted. */\n setHasLeft: (has: boolean) => void;\n /** Whether a Sidebar is mounted. */\n hasSidebar: boolean;\n /** No effect since 0.8.0: the registry knows which panes are mounted. */\n setHasSidebar: (has: boolean) => void;\n currentBreakpoint: Breakpoint;\n currentBreakpointReady: boolean;\n /** The Rail's presentation at the current breakpoint, when known. */\n leftResolvedPresentation?: PresentationValue;\n togglePane: (target: PaneTarget) => void;\n expandPane: (target: PaneTarget) => void;\n collapsePane: (target: PaneTarget) => void;\n}\n\nconst noop = () => {};\n\n/**\n * @deprecated The whole-shell reader re-renders its consumer on every change\n * to any pane. Use `Shell.Trigger` to drive a pane, `Shell.useSidebarMode`\n * for the Sidebar, and each pane's `open`/`onOpenChange` for its state.\n * Removed in 1.0.\n *\n * Keeps 0.7's shape. The setters act as a user would: they report through\n * the pane's own callback with `reason: 'toggle'`, and a controlled pane\n * changes only when the app passes the new value.\n */\nexport function useShell(): ShellContextValue {\n const store = useShellStore('useShell');\n React.useEffect(() => {\n warnOnce(\"Shell.useShell is deprecated and is removed in 1.0. Use Shell.Trigger, Shell.useSidebarMode, or a pane's own open/onOpenChange.\");\n }, []);\n useStoreVersion(store);\n const { breakpoint, ready } = useBreakpoint();\n const actions = React.useMemo(() => {\n const setMode = (name: PaneName) => (mode: PaneMode) => store.entries.get(name)?.setValue(mode === 'collapsed' ? 'closed' : 'open', 'toggle');\n const setPeekTarget = (target: PaneTarget | null) => setShellPeek(store, target === null ? null : paneName(target));\n return {\n setLeftMode: setMode('rail'),\n setPanelMode: setMode('panel'),\n setInspectorMode: setMode('inspector'),\n setBottomMode: setMode('bottom'),\n setSidebarMode: (mode: SidebarMode) => store.entries.get('sidebar')?.setValue(fromSidebarMode(mode), 'toggle'),\n setPeekTarget,\n peekPane: (target: PaneTarget) => setPeekTarget(target),\n clearPeek: () => setPeekTarget(null),\n setHasLeft: noop,\n setHasSidebar: noop,\n togglePane: (target: PaneTarget) => store.entries.get(paneName(target))?.toggle('toggle'),\n expandPane: (target: PaneTarget) => store.entries.get(paneName(target))?.setValue('open', 'toggle'),\n collapsePane: (target: PaneTarget) => store.entries.get(paneName(target))?.setValue('closed', 'toggle'),\n };\n }, [store]);\n const value = (name: PaneName) => store.entries.get(name)?.value;\n const rail = store.entries.get('rail');\n return {\n leftMode: toPaneMode(value('rail')),\n leftControlledOpen: rail?.value === undefined ? undefined : rail.value !== 'closed',\n panelMode: toPaneMode(value('panel')),\n sidebarMode: toSidebarMode(value('sidebar')) ?? 'expanded',\n inspectorMode: toPaneMode(value('inspector')),\n bottomMode: toPaneMode(value('bottom')),\n peekTarget: store.peek,\n hasLeft: store.entries.has('rail'),\n hasSidebar: store.entries.has('sidebar'),\n currentBreakpoint: breakpoint,\n currentBreakpointReady: ready,\n leftResolvedPresentation: rail?.presentation,\n ...actions,\n };\n}\n"],
|
|
5
|
-
"mappings": ";8FAQA,UAAYA,MAAW,QAKvB,IAAMC,EAAiBC,GAA2DA,IAAU,OAAY,OAAYA,IAAU,SAAW,YAAc,WAEjJC,EAAmBC,GAAkCA,IAAS,YAAc,SAAW,OAEvFC,EAAcH,GAA4CA,IAAU,QAAaA,IAAU,SAAW,YAAc,WAEpHI,EAAYC,GAAkCA,IAAW,OAAS,OAASA,EAGjF,SAASC,EAAgBC,EAAmB,CAC1C,IAAMC,EAAkB,cAAaC,GAAyBC,EAAoBH,EAAOE,CAAQ,EAAG,CAACF,CAAK,CAAC,EAC3G,OAAa,uBACXC,EACA,IAAMD,EAAM,QACZ,IAAM,CACR,CACF,CAMO,SAASI,GAA4F,CAC1G,IAAMJ,EAAQK,EAAc,gBAAgB,EACtCJ,EAAkB,cAAaC,GAAyBC,EAAoBH,EAAOE,CAAQ,EAAG,CAACF,CAAK,CAAC,EACrGP,EAAc,uBAClBQ,EACA,IAAMD,EAAM,QAAQ,IAAI,SAAS,GAAG,MACpC,IAAG,EACL,EACMM,EAAuB,cAC1BX,GAAsB,CACrBK,EAAM,QAAQ,IAAI,SAAS,GAAG,SAASN,EAAgBC,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,IAAI,MAAM,EACrC,MAAO,CACL,SAAUJ,EAAWH,EAAM,MAAM,CAAC,EAClC,mBAAoBwB,GAAM,QAAU,OAAY,OAAYA,EAAK,QAAU,SAC3E,UAAWrB,EAAWH,EAAM,OAAO,CAAC,EACpC,YAAaD,EAAcC,EAAM,SAAS,CAAC,GAAK,WAChD,cAAeG,EAAWH,EAAM,WAAW,CAAC,EAC5C,WAAYG,EAAWH,EAAM,QAAQ,CAAC,EACtC,WAAYO,EAAM,KAClB,QAASA,EAAM,QAAQ,IAAI,MAAM,EACjC,WAAYA,EAAM,QAAQ,IAAI,SAAS,EACvC,kBAAmBS,EACnB,uBAAwBC,EACxB,yBAA0BO,GAAM,aAChC,GAAGL,CACL,CACF",
|
|
6
|
-
"names": ["React", "toSidebarMode", "value", "fromSidebarMode", "mode", "toPaneMode", "paneName", "target", "useStoreVersion", "store", "subscribe", "listener", "subscribeShellStore", "useSidebarMode", "useShellStore", "setSidebarMode", "noop", "useShell", "breakpoint", "ready", "useBreakpoint", "actions", "setMode", "name", "setPeekTarget", "setShellPeek", "rail"]
|
|
7
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{z as e}from"zod";var h=e.enum(["expanded","collapsed"]).describe("Pane state mode"),l=e.enum(["collapsed","expanded"]).describe("Sidebar state"),u=e.enum(["fixed","overlay","stacked"]).describe("Presentation mode"),z=e.enum(["initial","xs","sm","md","lg","xl"]).describe("Responsive breakpoint"),b=e.enum(["left","rail","panel","sidebar","inspector","bottom"]).describe("Pane target. `left` is deprecated: use `rail`."),m=e.enum(["toggle","expand","collapse"]).describe("Trigger action"),d=e.enum(["toggle","dismiss"]).describe("Why the state changed: `toggle` for a trigger or the resize handle, `dismiss` for Escape or the scrim"),S=e.enum(["init","resize","controlled"]).describe("Why the size changed");function i(n){return e.union([n,e.object({initial:n.optional(),xs:n.optional(),sm:n.optional(),md:n.optional(),lg:n.optional(),xl:n.optional()})])}var x=i(h).describe("Responsive pane mode configuration"),p=i(l).describe("Responsive sidebar state"),o=i(u).describe("Responsive presentation configuration"),c=i(e.boolean()).describe("Responsive open state"),f=e.object({load:e.function({output:e.union([e.number(),e.promise(e.number()),e.undefined()])}).optional(),save:e.function({input:[e.number()],output:e.union([e.void(),e.promise(e.void())])}).optional()}).describe("Deprecated, removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`."),t=e.record(e.string(),e.union([e.string(),e.number()])).optional().describe("Inline styles"),a={open:e.union([e.boolean(),c]).optional().describe("The open state, when controlled. A responsive object is deprecated."),defaultOpen:e.union([e.boolean(),c]).optional().describe("The starting state. A responsive object leaves the pane untouched, with that object as the answer at each breakpoint."),onOpenChange:e.function({input:[e.boolean(),e.object({reason:d})],output:e.void()}).optional().describe("Called when a user opens or closes the pane. Never called on mount or on a resize.")},r={id:e.string().optional().describe("The pane id. A Trigger points `aria-controls` at it."),presentation:o.optional(),expandedSize:e.number().optional(),flush:e.boolean().optional().describe("Whether the pane joins the app frame. Defaults to true. `false` pulls it off the frame as a card."),onExpand:e.function({output:e.void()}).optional().describe("Deprecated: use `onOpenChange`"),onCollapse:e.function({output:e.void()}).optional().describe("Deprecated: use `onOpenChange`"),className:e.string().optional().describe("Additional CSS class name"),style:t,children:e.any().optional()},s={minSize:e.number().optional(),maxSize:e.number().optional().describe("The largest size. A drag also stops before the handle leaves the frame."),resizable:e.boolean().optional(),collapsible:e.boolean().optional().describe("A double-click on the handle closes the pane"),size:e.union([e.number(),e.string()]).optional().describe("The size, when controlled"),defaultSize:e.union([e.number(),e.string()]).optional().describe("The starting size"),onSizeChange:e.function({input:[e.number(),e.object({reason:S})],output:e.void()}).optional(),sizeUpdate:e.enum(["throttle","debounce"]).optional().describe("Rate-limits onSizeChange across repeated resize ends, such as key presses on the handle. A drag calls it once, when the drag ends; use onResize for live sizes."),sizeUpdateMs:e.number().optional(),onResize:e.function({input:[e.number()],output:e.void()}).optional().describe("Called during a drag, at most once per animation frame"),onResizeStart:e.function({input:[e.number()],output:e.void()}).optional(),onResizeEnd:e.function({input:[e.number()],output:e.void()}).optional(),snapPoints:e.array(e.number()).optional().describe("Deprecated, removed in 1.0"),snapTolerance:e.number().optional().describe("Deprecated, removed in 1.0"),collapseThreshold:e.number().optional().describe("Deprecated, removed in 1.0"),paneId:e.string().optional().describe("Deprecated, removed in 1.0"),persistence:f.optional()},P=e.object({height:e.union([e.literal("full"),e.literal("auto"),e.string(),e.number()]).default("full").describe("Height of the frame. `full` is the window: 100dvh, with 100vh where dvh is not supported, and on a narrow touch screen the page scrolls. Any value other than `full` or `auto` makes the Shell contained."),contained:e.boolean().default(!1).describe("Fills the parent instead of the window and always scrolls inside itself. An explicit `height` implies it."),size:e.enum(["1","2","3"]).default("2").describe("Index of the pane chrome and the Sidebar rows in it"),className:e.string().optional().describe("Additional CSS class name"),style:t,children:e.any().optional().describe("The Shell parts, and anything else, rendered in order")}).strict(),y=e.object({height:e.number().default(64).describe("Height of the header, in pixels"),flush:e.boolean().optional().describe("Whether the header joins the app frame. Defaults to true. `false` makes it a card off the frame."),className:e.string().optional().describe("Additional CSS class name"),style:t,children:e.any().optional().describe("Header content")}).strict(),v=e.object({...r,...a,presentation:o.default("fixed").describe("Presentation mode"),expandedSize:e.number().default(64).describe("Width in pixels"),collapsible:e.boolean().optional()}).strict(),w=e.object({...r,...a,...s,presentation:o.optional().describe("Presentation mode. With no value the panel follows the Rail's."),expandedSize:e.number().default(288).describe("Open width in pixels"),minSize:e.number().default(100).describe("Minimum width when resizing"),maxSize:e.number().default(800).describe("Maximum width when resizing"),resizable:e.boolean().default(!1).describe("Whether the panel can be resized"),collapsible:e.boolean().default(!0).describe("Whether a double-click on the handle closes the panel")}).strict(),R=e.object({...r,...s,state:e.union([l,p]).optional().describe("The state, when controlled. A responsive object is deprecated."),defaultState:p.optional().describe("The starting state. With no value the sidebar is open where it is in the frame and closed where it is an overlay."),onStateChange:e.function({input:[l,e.object({reason:d})],output:e.void()}).optional().describe("Called when a user changes the state. Never called on mount or on a resize."),presentation:o.default({initial:"overlay",sm:"fixed"}).describe("Presentation mode"),expandedSize:e.number().default(288).describe("Open width in pixels"),minSize:e.number().default(200).describe("Minimum width when resizing"),maxSize:e.number().default(400).describe("Maximum width when resizing"),resizable:e.boolean().default(!1).describe("Whether the sidebar can be resized"),collapsible:e.boolean().default(!0).describe("Whether a double-click on the handle closes the sidebar")}).strict(),T=e.object({flush:e.boolean().optional().describe("Whether the work area joins the app frame. Defaults to true. `false` makes it a card on the Shell background."),className:e.string().optional().describe("Additional CSS class name"),style:t,children:e.any().optional().describe("Main content")}).strict(),k=e.object({...r,...a,...s,presentation:o.default({initial:"overlay",sm:"fixed"}).describe("Presentation mode"),expandedSize:e.number().default(320).describe("Open width in pixels"),minSize:e.number().default(200).describe("Minimum width when resizing"),maxSize:e.number().default(500).describe("Maximum width when resizing"),resizable:e.boolean().default(!1).describe("Whether the inspector can be resized"),collapsible:e.boolean().default(!0).describe("Whether a double-click on the handle closes the inspector")}).strict(),C=e.object({...r,...a,...s,presentation:o.default("fixed").describe("Presentation mode"),expandedSize:e.number().default(200).describe("Open height in pixels"),minSize:e.number().default(100).describe("Minimum height when resizing"),maxSize:e.number().default(400).describe("Maximum height when resizing"),resizable:e.boolean().default(!1).describe("Whether the bottom panel can be resized"),collapsible:e.boolean().default(!0).describe("Whether a double-click on the handle closes the panel")}).strict(),N=e.object({target:b.describe("Which pane to drive"),action:m.default("toggle").describe("Action to perform"),peekOnHover:e.boolean().default(!1).describe("Deprecated, removed in 1.0. Shows a preview of a closed pane on hover."),type:e.enum(["button","submit","reset"]).default("button").describe("The button type"),className:e.string().optional().describe("Additional CSS class name"),style:t,children:e.any().optional().describe("Trigger content"),onClick:e.function().optional().describe("Runs before the trigger acts. Call `event.preventDefault()` to cancel it."),onMouseEnter:e.function().optional().describe("Mouse enter handler"),onMouseLeave:e.function().optional().describe("Mouse leave handler"),"aria-label":e.string().optional().describe("ARIA label for accessibility"),"aria-labelledby":e.string().optional().describe("ARIA labelled by reference"),"aria-describedby":e.string().optional().describe("ARIA described by reference")}).strict(),A=e.object({className:e.string().optional().describe("Additional CSS class name"),style:t,children:e.any().optional().describe("Handle content")}).strict();function M(n){return n}function E(n){return n}function j(n){return n}function D(n){return n}function O(n){return n}function H(n){return n}function W(n){return n}function _(n){return n}function I(n){return n}function V(n){return n}export{P as a,y as b,v as c,w as d,R as e,T as f,k as g,C as h,N as i,A as j,M as k,E as l,j as m,D as n,O as o,H as p,W as q,_ as r,I as s,V as t};
|
|
3
|
-
//# sourceMappingURL=chunk-XOAOSRTH.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/schemas/shell.schema.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod';\n\n/**\n * Shell Zod schema: the Shell's props, for tools that read a schema\n * (editors, assistants, documentation).\n *\n * Shell is the frame of an application. Each pane holds its own open state;\n * a pane nobody has touched follows the window, and the stylesheet resolves\n * it at each breakpoint. Callbacks report user actions only.\n *\n * @example\n * ```tsx\n * const props = ShellRootSchema.parse({ height: 'full' });\n *\n * const sidebarProps = ShellSidebarSchema.parse({\n * defaultState: { initial: 'collapsed', md: 'expanded' },\n * presentation: { initial: 'overlay', sm: 'fixed' },\n * });\n * ```\n */\n\n// Common types\nconst PaneModeSchema = z.enum(['expanded', 'collapsed']).describe('Pane state mode');\nconst SidebarModeSchema = z.enum(['collapsed', 'expanded']).describe('Sidebar state');\nconst PresentationValueSchema = z.enum(['fixed', 'overlay', 'stacked']).describe('Presentation mode');\nconst _BreakpointSchema = z.enum(['initial', 'xs', 'sm', 'md', 'lg', 'xl']).describe('Responsive breakpoint');\nconst PaneTargetSchema = z.enum(['left', 'rail', 'panel', 'sidebar', 'inspector', 'bottom']).describe('Pane target. `left` is deprecated: use `rail`.');\nconst TriggerActionSchema = z.enum(['toggle', 'expand', 'collapse']).describe('Trigger action');\nconst OpenChangeReasonSchema = z.enum(['toggle', 'dismiss']).describe('Why the state changed: `toggle` for a trigger or the resize handle, `dismiss` for Escape or the scrim');\nconst SizeChangeReasonSchema = z.enum(['init', 'resize', 'controlled']).describe('Why the size changed');\n\nfunction responsive<T extends z.ZodTypeAny>(value: T) {\n return z.union([\n value,\n z.object({\n initial: value.optional(),\n xs: value.optional(),\n sm: value.optional(),\n md: value.optional(),\n lg: value.optional(),\n xl: value.optional(),\n }),\n ]);\n}\n\n// Responsive schemas\nconst _ResponsiveModeSchema = responsive(PaneModeSchema).describe('Responsive pane mode configuration');\nconst ResponsiveSidebarModeSchema = responsive(SidebarModeSchema).describe('Responsive sidebar state');\nconst ResponsivePresentationSchema = responsive(PresentationValueSchema).describe('Responsive presentation configuration');\nconst ResponsiveOpenSchema = responsive(z.boolean()).describe('Responsive open state');\n\n// Size persistence adapter (deprecated)\nconst PaneSizePersistenceSchema = z\n .object({\n load: z.function({ output: z.union([z.number(), z.promise(z.number()), z.undefined()]) }).optional(),\n save: z.function({ input: [z.number()], output: z.union([z.void(), z.promise(z.void())]) }).optional(),\n })\n .describe('Deprecated, removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');\n\nconst StyleSchema = z\n .record(z.string(), z.union([z.string(), z.number()]))\n .optional()\n .describe('Inline styles');\n\nconst OpenPropsSchema = {\n open: z.union([z.boolean(), ResponsiveOpenSchema]).optional().describe('The open state, when controlled. A responsive object is deprecated.'),\n defaultOpen: z\n .union([z.boolean(), ResponsiveOpenSchema])\n .optional()\n .describe('The starting state. A responsive object leaves the pane untouched, with that object as the answer at each breakpoint.'),\n onOpenChange: z\n .function({ input: [z.boolean(), z.object({ reason: OpenChangeReasonSchema })], output: z.void() })\n .optional()\n .describe('Called when a user opens or closes the pane. Never called on mount or on a resize.'),\n};\n\n// Props shared by every pane\nconst PaneBaseShape = {\n id: z.string().optional().describe('The pane id. A Trigger points `aria-controls` at it.'),\n presentation: ResponsivePresentationSchema.optional(),\n expandedSize: z.number().optional(),\n flush: z.boolean().optional().describe('Whether the pane joins the app frame. Defaults to true. `false` pulls it off the frame as a card.'),\n onExpand: z.function({ output: z.void() }).optional().describe('Deprecated: use `onOpenChange`'),\n onCollapse: z.function({ output: z.void() }).optional().describe('Deprecated: use `onOpenChange`'),\n className: z.string().optional().describe('Additional CSS class name'),\n style: StyleSchema,\n children: z.any().optional(),\n};\n\n// Props of a pane that resizes\nconst ResizeShape = {\n minSize: z.number().optional(),\n maxSize: z.number().optional().describe('The largest size. A drag also stops before the handle leaves the frame.'),\n resizable: z.boolean().optional(),\n collapsible: z.boolean().optional().describe('A double-click on the handle closes the pane'),\n size: z.union([z.number(), z.string()]).optional().describe('The size, when controlled'),\n defaultSize: z.union([z.number(), z.string()]).optional().describe('The starting size'),\n onSizeChange: z.function({ input: [z.number(), z.object({ reason: SizeChangeReasonSchema })], output: z.void() }).optional(),\n sizeUpdate: z\n .enum(['throttle', 'debounce'])\n .optional()\n .describe('Rate-limits onSizeChange across repeated resize ends, such as key presses on the handle. A drag calls it once, when the drag ends; use onResize for live sizes.'),\n sizeUpdateMs: z.number().optional(),\n onResize: z\n .function({ input: [z.number()], output: z.void() })\n .optional()\n .describe('Called during a drag, at most once per animation frame'),\n onResizeStart: z.function({ input: [z.number()], output: z.void() }).optional(),\n onResizeEnd: z.function({ input: [z.number()], output: z.void() }).optional(),\n snapPoints: z.array(z.number()).optional().describe('Deprecated, removed in 1.0'),\n snapTolerance: z.number().optional().describe('Deprecated, removed in 1.0'),\n collapseThreshold: z.number().optional().describe('Deprecated, removed in 1.0'),\n paneId: z.string().optional().describe('Deprecated, removed in 1.0'),\n persistence: PaneSizePersistenceSchema.optional(),\n};\n\n/**\n * Shell.Root component schema\n */\nexport const ShellRootSchema = z\n .object({\n height: z\n .union([z.literal('full'), z.literal('auto'), z.string(), z.number()])\n .default('full')\n .describe(\n 'Height of the frame. `full` is the window: 100dvh, with 100vh where dvh is not supported, and on a narrow touch screen the page scrolls. Any value other than `full` or `auto` makes the Shell contained.',\n ),\n contained: z.boolean().default(false).describe('Fills the parent instead of the window and always scrolls inside itself. An explicit `height` implies it.'),\n size: z.enum(['1', '2', '3']).default('2').describe('Index of the pane chrome and the Sidebar rows in it'),\n className: z.string().optional().describe('Additional CSS class name'),\n style: StyleSchema,\n children: z.any().optional().describe('The Shell parts, and anything else, rendered in order'),\n })\n .strict();\n\n/**\n * Shell.Header component schema\n */\nexport const ShellHeaderSchema = z\n .object({\n height: z.number().default(64).describe('Height of the header, in pixels'),\n flush: z.boolean().optional().describe('Whether the header joins the app frame. Defaults to true. `false` makes it a card off the frame.'),\n className: z.string().optional().describe('Additional CSS class name'),\n style: StyleSchema,\n children: z.any().optional().describe('Header content'),\n })\n .strict();\n\n/**\n * Shell.Rail component schema\n */\nexport const ShellRailSchema = z\n .object({\n ...PaneBaseShape,\n ...OpenPropsSchema,\n presentation: ResponsivePresentationSchema.default('fixed').describe('Presentation mode'),\n expandedSize: z.number().default(64).describe('Width in pixels'),\n collapsible: z.boolean().optional(),\n })\n .strict();\n\n/**\n * Shell.Panel component schema\n */\nexport const ShellPanelSchema = z\n .object({\n ...PaneBaseShape,\n ...OpenPropsSchema,\n ...ResizeShape,\n presentation: ResponsivePresentationSchema.optional().describe(\"Presentation mode. With no value the panel follows the Rail's.\"),\n expandedSize: z.number().default(288).describe('Open width in pixels'),\n minSize: z.number().default(100).describe('Minimum width when resizing'),\n maxSize: z.number().default(800).describe('Maximum width when resizing'),\n resizable: z.boolean().default(false).describe('Whether the panel can be resized'),\n collapsible: z.boolean().default(true).describe('Whether a double-click on the handle closes the panel'),\n })\n .strict();\n\n/**\n * Shell.Sidebar component schema\n */\nexport const ShellSidebarSchema = z\n .object({\n ...PaneBaseShape,\n ...ResizeShape,\n state: z.union([SidebarModeSchema, ResponsiveSidebarModeSchema]).optional().describe('The state, when controlled. A responsive object is deprecated.'),\n defaultState: ResponsiveSidebarModeSchema.optional().describe('The starting state. With no value the sidebar is open where it is in the frame and closed where it is an overlay.'),\n onStateChange: z\n .function({ input: [SidebarModeSchema, z.object({ reason: OpenChangeReasonSchema })], output: z.void() })\n .optional()\n .describe('Called when a user changes the state. Never called on mount or on a resize.'),\n presentation: ResponsivePresentationSchema.default({ initial: 'overlay', sm: 'fixed' }).describe('Presentation mode'),\n expandedSize: z.number().default(288).describe('Open width in pixels'),\n minSize: z.number().default(200).describe('Minimum width when resizing'),\n maxSize: z.number().default(400).describe('Maximum width when resizing'),\n resizable: z.boolean().default(false).describe('Whether the sidebar can be resized'),\n collapsible: z.boolean().default(true).describe('Whether a double-click on the handle closes the sidebar'),\n })\n .strict();\n\n/**\n * Shell.Content component schema\n */\nexport const ShellContentSchema = z\n .object({\n flush: z.boolean().optional().describe('Whether the work area joins the app frame. Defaults to true. `false` makes it a card on the Shell background.'),\n className: z.string().optional().describe('Additional CSS class name'),\n style: StyleSchema,\n children: z.any().optional().describe('Main content'),\n })\n .strict();\n\n/**\n * Shell.Inspector component schema\n */\nexport const ShellInspectorSchema = z\n .object({\n ...PaneBaseShape,\n ...OpenPropsSchema,\n ...ResizeShape,\n presentation: ResponsivePresentationSchema.default({ initial: 'overlay', sm: 'fixed' }).describe('Presentation mode'),\n expandedSize: z.number().default(320).describe('Open width in pixels'),\n minSize: z.number().default(200).describe('Minimum width when resizing'),\n maxSize: z.number().default(500).describe('Maximum width when resizing'),\n resizable: z.boolean().default(false).describe('Whether the inspector can be resized'),\n collapsible: z.boolean().default(true).describe('Whether a double-click on the handle closes the inspector'),\n })\n .strict();\n\n/**\n * Shell.Bottom component schema\n */\nexport const ShellBottomSchema = z\n .object({\n ...PaneBaseShape,\n ...OpenPropsSchema,\n ...ResizeShape,\n presentation: ResponsivePresentationSchema.default('fixed').describe('Presentation mode'),\n expandedSize: z.number().default(200).describe('Open height in pixels'),\n minSize: z.number().default(100).describe('Minimum height when resizing'),\n maxSize: z.number().default(400).describe('Maximum height when resizing'),\n resizable: z.boolean().default(false).describe('Whether the bottom panel can be resized'),\n collapsible: z.boolean().default(true).describe('Whether a double-click on the handle closes the panel'),\n })\n .strict();\n\n/**\n * Shell.Trigger component schema\n */\nexport const ShellTriggerSchema = z\n .object({\n target: PaneTargetSchema.describe('Which pane to drive'),\n action: TriggerActionSchema.default('toggle').describe('Action to perform'),\n peekOnHover: z.boolean().default(false).describe('Deprecated, removed in 1.0. Shows a preview of a closed pane on hover.'),\n type: z.enum(['button', 'submit', 'reset']).default('button').describe('The button type'),\n className: z.string().optional().describe('Additional CSS class name'),\n style: StyleSchema,\n children: z.any().optional().describe('Trigger content'),\n onClick: z.function().optional().describe('Runs before the trigger acts. Call `event.preventDefault()` to cancel it.'),\n onMouseEnter: z.function().optional().describe('Mouse enter handler'),\n onMouseLeave: z.function().optional().describe('Mouse leave handler'),\n 'aria-label': z.string().optional().describe('ARIA label for accessibility'),\n 'aria-labelledby': z.string().optional().describe('ARIA labelled by reference'),\n 'aria-describedby': z.string().optional().describe('ARIA described by reference'),\n })\n .strict();\n\n/**\n * Shell.Handle component schema (for resize handles)\n */\nexport const ShellHandleSchema = z\n .object({\n className: z.string().optional().describe('Additional CSS class name'),\n style: StyleSchema,\n children: z.any().optional().describe('Handle content'),\n })\n .strict();\n\n// Type exports\nexport type ShellRootProps = z.infer<typeof ShellRootSchema>;\nexport type ShellHeaderProps = z.infer<typeof ShellHeaderSchema>;\nexport type ShellRailProps = z.infer<typeof ShellRailSchema>;\nexport type ShellPanelProps = z.infer<typeof ShellPanelSchema>;\nexport type ShellSidebarProps = z.infer<typeof ShellSidebarSchema>;\nexport type ShellContentProps = z.infer<typeof ShellContentSchema>;\nexport type ShellInspectorProps = z.infer<typeof ShellInspectorSchema>;\nexport type ShellBottomProps = z.infer<typeof ShellBottomSchema>;\nexport type ShellTriggerProps = z.infer<typeof ShellTriggerSchema>;\nexport type ShellHandleProps = z.infer<typeof ShellHandleSchema>;\n\n// Common type exports\nexport type PaneMode = z.infer<typeof PaneModeSchema>;\nexport type SidebarMode = z.infer<typeof SidebarModeSchema>;\nexport type PresentationValue = z.infer<typeof PresentationValueSchema>;\nexport type Breakpoint = z.infer<typeof _BreakpointSchema>;\nexport type PaneTarget = z.infer<typeof PaneTargetSchema>;\nexport type TriggerAction = z.infer<typeof TriggerActionSchema>;\nexport type ResponsiveMode = z.infer<typeof _ResponsiveModeSchema>;\nexport type ResponsiveSidebarMode = z.infer<typeof ResponsiveSidebarModeSchema>;\nexport type ResponsivePresentation = z.infer<typeof ResponsivePresentationSchema>;\nexport type PaneSizePersistence = z.infer<typeof PaneSizePersistenceSchema>;\n\n/**\n * Development-only helper to validate and normalize Shell props\n * This function should only be used in development mode\n *\n * @param props - Props to validate and normalize\n * @returns Validated and normalized props\n *\n * @example\n * ```tsx\n * // In development, this will validate props and show helpful errors\n * const validatedProps = parseShellRootProps({ height: 'invalid' });\n * // Throws validation errors for invalid values\n * ```\n */\nexport function parseShellRootProps(props: unknown): ShellRootProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellRootSchema.parse(props);\n }\n return props as ShellRootProps;\n}\n\nexport function parseShellHeaderProps(props: unknown): ShellHeaderProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellHeaderSchema.parse(props);\n }\n return props as ShellHeaderProps;\n}\n\nexport function parseShellRailProps(props: unknown): ShellRailProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellRailSchema.parse(props);\n }\n return props as ShellRailProps;\n}\n\nexport function parseShellPanelProps(props: unknown): ShellPanelProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellPanelSchema.parse(props);\n }\n return props as ShellPanelProps;\n}\n\nexport function parseShellSidebarProps(props: unknown): ShellSidebarProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellSidebarSchema.parse(props);\n }\n return props as ShellSidebarProps;\n}\n\nexport function parseShellContentProps(props: unknown): ShellContentProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellContentSchema.parse(props);\n }\n return props as ShellContentProps;\n}\n\nexport function parseShellInspectorProps(props: unknown): ShellInspectorProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellInspectorSchema.parse(props);\n }\n return props as ShellInspectorProps;\n}\n\nexport function parseShellBottomProps(props: unknown): ShellBottomProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellBottomSchema.parse(props);\n }\n return props as ShellBottomProps;\n}\n\nexport function parseShellTriggerProps(props: unknown): ShellTriggerProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellTriggerSchema.parse(props);\n }\n return props as ShellTriggerProps;\n}\n\nexport function parseShellHandleProps(props: unknown): ShellHandleProps {\n if (process.env.NODE_ENV === 'development') {\n return ShellHandleSchema.parse(props);\n }\n return props as ShellHandleProps;\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,OAAS,KAAAA,MAAS,MAsBlB,IAAMC,EAAiBD,EAAE,KAAK,CAAC,WAAY,WAAW,CAAC,EAAE,SAAS,iBAAiB,EAC7EE,EAAoBF,EAAE,KAAK,CAAC,YAAa,UAAU,CAAC,EAAE,SAAS,eAAe,EAC9EG,EAA0BH,EAAE,KAAK,CAAC,QAAS,UAAW,SAAS,CAAC,EAAE,SAAS,mBAAmB,EAC9FI,EAAoBJ,EAAE,KAAK,CAAC,UAAW,KAAM,KAAM,KAAM,KAAM,IAAI,CAAC,EAAE,SAAS,uBAAuB,EACtGK,EAAmBL,EAAE,KAAK,CAAC,OAAQ,OAAQ,QAAS,UAAW,YAAa,QAAQ,CAAC,EAAE,SAAS,gDAAgD,EAChJM,EAAsBN,EAAE,KAAK,CAAC,SAAU,SAAU,UAAU,CAAC,EAAE,SAAS,gBAAgB,EACxFO,EAAyBP,EAAE,KAAK,CAAC,SAAU,SAAS,CAAC,EAAE,SAAS,uGAAuG,EACvKQ,EAAyBR,EAAE,KAAK,CAAC,OAAQ,SAAU,YAAY,CAAC,EAAE,SAAS,sBAAsB,EAEvG,SAASS,EAAmCC,EAAU,CACpD,OAAOV,EAAE,MAAM,CACbU,EACAV,EAAE,OAAO,CACP,QAASU,EAAM,SAAS,EACxB,GAAIA,EAAM,SAAS,EACnB,GAAIA,EAAM,SAAS,EACnB,GAAIA,EAAM,SA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AKG6B,EAAoB7B,EAC9B,OAAO,CACN,UAAWA,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,2BAA2B,EACrE,MAAOgB,EACP,SAAUhB,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,gBAAgB,CACxD,CAAC,EACA,OAAO,EAwCH,SAAS8B,EAAoBC,EAAgC,CAIlE,OAAOA,CACT,CAEO,SAASC,EAAsBD,EAAkC,CAItE,OAAOA,CACT,CAEO,SAASE,EAAoBF,EAAgC,CAIlE,OAAOA,CACT,CAEO,SAASG,EAAqBH,EAAiC,CAIpE,OAAOA,CACT,CAEO,SAASI,EAAuBJ,EAAmC,CAIxE,OAAOA,CACT,CAEO,SAASK,EAAuBL,EAAmC,CAIxE,OAAOA,CACT,CAEO,SAASM,EAAyBN,EAAqC,CAI5E,OAAOA,CACT,CAEO,SAASO,EAAsBP,EAAkC,CAItE,OAAOA,CACT,CAEO,SAASQ,EAAuBR,EAAmC,CAIxE,OAAOA,CACT,CAEO,SAASS,EAAsBT,EAAkC,CAItE,OAAOA,CACT",
|
|
6
|
-
"names": ["z", "PaneModeSchema", "SidebarModeSchema", "PresentationValueSchema", "_BreakpointSchema", "PaneTargetSchema", "TriggerActionSchema", "OpenChangeReasonSchema", "SizeChangeReasonSchema", "responsive", "value", "_ResponsiveModeSchema", "ResponsiveSidebarModeSchema", "ResponsivePresentationSchema", "ResponsiveOpenSchema", "PaneSizePersistenceSchema", "StyleSchema", "OpenPropsSchema", "PaneBaseShape", "ResizeShape", "ShellRootSchema", "ShellHeaderSchema", "ShellRailSchema", "ShellPanelSchema", "ShellSidebarSchema", "ShellContentSchema", "ShellInspectorSchema", "ShellBottomSchema", "ShellTriggerSchema", "ShellHandleSchema", "parseShellRootProps", "props", "parseShellHeaderProps", "parseShellRailProps", "parseShellPanelProps", "parseShellSidebarProps", "parseShellContentProps", "parseShellInspectorProps", "parseShellBottomProps", "parseShellTriggerProps", "parseShellHandleProps"]
|
|
7
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
function r(e){if(e===void 0)return;if(typeof e=="boolean")return e?"open":"closed";let n={};for(let[t,o]of Object.entries(e))typeof o=="boolean"&&(n[t]=o?"open":"closed");return n}var a=e=>e==="overlay"?"closed":"open",i=()=>"closed",s=e=>e?-1:1,l=e=>e?1:-1,d=()=>-1;function p(e){if(!("height"in e)&&!("resizer"in e))return e;let{height:n,resizer:t,...o}=e;return o}export{r as a,a as b,i as c,s as d,l as e,d as f,p as g};
|
|
3
|
-
//# sourceMappingURL=chunk-XUCR7L4G.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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: 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\n/**\n * `height` and `resizer` left PaneBaseProps in 0.8.0: no pane ever read them.\n * A call site written against 0.7 can still pass them, so they are dropped\n * here rather than reaching the DOM as invalid attributes.\n */\nexport function withoutRemovedPaneProps<T extends object>(props: T): T {\n if (!('height' in props) && !('resizer' in props)) return props;\n const { height: _height, resizer: _resizer, ...rest } = props as T & { height?: unknown; resizer?: unknown };\n return rest as T;\n}\n"],
|
|
5
|
-
"mappings": ";AAMO,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,GAO3C,SAASC,EAA0CC,EAAa,CACrE,GAAI,EAAE,WAAYA,IAAU,EAAE,YAAaA,GAAQ,OAAOA,EAC1D,GAAM,CAAE,OAAQC,EAAS,QAASC,EAAU,GAAGC,CAAK,EAAIH,EACxD,OAAOG,CACT",
|
|
6
|
-
"names": ["toPaneValue", "value", "map", "bp", "open", "navigationRest", "presentation", "detailRest", "startAnchoredGrowth", "isRtl", "endAnchoredGrowth", "bottomAnchoredGrowth", "withoutRemovedPaneProps", "props", "_height", "_resizer", "rest"]
|
|
7
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PresentationValue, ResponsivePresentation } from './shell.types.js';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Since 0.8.0 the Shell resolves a responsive `presentation` in
|
|
4
|
-
* its stylesheet, so the pane is placed before any script runs. This hook
|
|
5
|
-
* resolves it in JS after mount, which is the behaviour the Shell left
|
|
6
|
-
* behind. It keeps working until 1.0.
|
|
7
|
-
*/
|
|
8
|
-
declare function useResponsivePresentation(presentation: ResponsivePresentation): PresentationValue;
|
|
9
|
-
export { useResponsivePresentation };
|
|
10
|
-
//# sourceMappingURL=shell.hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shell.hooks.d.ts","sourceRoot":"","sources":["../../../src/components/shell.hooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAGlF;;;;;GAKG;AACH,iBAAS,yBAAyB,CAAC,YAAY,EAAE,sBAAsB,GAAG,iBAAiB,CAM1F;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useBreakpoint } from '../hooks/use-breakpoint.js';
|
|
3
|
-
import type { PresentationValue, ResponsivePresentation } from './shell.types.js';
|
|
4
|
-
import { tableOf, warnOnce } from './_internal/shell-store.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Since 0.8.0 the Shell resolves a responsive `presentation` in
|
|
8
|
-
* its stylesheet, so the pane is placed before any script runs. This hook
|
|
9
|
-
* resolves it in JS after mount, which is the behaviour the Shell left
|
|
10
|
-
* behind. It keeps working until 1.0.
|
|
11
|
-
*/
|
|
12
|
-
function useResponsivePresentation(presentation: ResponsivePresentation): PresentationValue {
|
|
13
|
-
React.useEffect(() => {
|
|
14
|
-
warnOnce('Shell.useResponsivePresentation is deprecated and is removed in 1.0. The Shell resolves presentation in CSS.');
|
|
15
|
-
}, []);
|
|
16
|
-
const { breakpoint } = useBreakpoint(typeof presentation !== 'string');
|
|
17
|
-
return tableOf<PresentationValue>(presentation, () => 'fixed')[breakpoint];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { useResponsivePresentation };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|