@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,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var d=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var x=(n,o)=>{for(var s in o)d(n,s,{get:o[s],enumerable:!0})},P=(n,o,s,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of g(o))!z.call(n,i)&&i!==s&&d(n,i,{get:()=>o[i],enumerable:!(u=f(o,i))||u.enumerable});return n};var y=n=>P(d({},"__esModule",{value:!0}),n);var J={};x(J,{ShellBottomSchema:()=>H,ShellContentSchema:()=>D,ShellHandleSchema:()=>_,ShellHeaderSchema:()=>A,ShellInspectorSchema:()=>O,ShellPanelSchema:()=>E,ShellRailSchema:()=>M,ShellRootSchema:()=>N,ShellSidebarSchema:()=>j,ShellTriggerSchema:()=>W,parseShellBottomProps:()=>Z,parseShellContentProps:()=>K,parseShellHandleProps:()=>G,parseShellHeaderProps:()=>V,parseShellInspectorProps:()=>L,parseShellPanelProps:()=>U,parseShellRailProps:()=>B,parseShellRootProps:()=>I,parseShellSidebarProps:()=>F,parseShellTriggerProps:()=>q});module.exports=y(J);var e=require("zod"),v=e.z.enum(["expanded","collapsed"]).describe("Pane state mode"),h=e.z.enum(["collapsed","expanded"]).describe("Sidebar state"),w=e.z.enum(["fixed","overlay","stacked"]).describe("Presentation mode"),X=e.z.enum(["initial","xs","sm","md","lg","xl"]).describe("Responsive breakpoint"),R=e.z.enum(["left","rail","panel","sidebar","inspector","bottom"]).describe("Pane target. `left` is deprecated: use `rail`."),T=e.z.enum(["toggle","expand","collapse"]).describe("Trigger action"),S=e.z.enum(["toggle","dismiss"]).describe("Why the state changed: `toggle` for a trigger or the resize handle, `dismiss` for Escape or the scrim"),k=e.z.enum(["init","resize","controlled"]).describe("Why the size changed");function l(n){return e.z.union([n,e.z.object({initial:n.optional(),xs:n.optional(),sm:n.optional(),md:n.optional(),lg:n.optional(),xl:n.optional()})])}var Y=l(v).describe("Responsive pane mode configuration"),b=l(h).describe("Responsive sidebar state"),t=l(w).describe("Responsive presentation configuration"),m=l(e.z.boolean()).describe("Responsive open state"),C=e.z.object({load:e.z.function({output:e.z.union([e.z.number(),e.z.promise(e.z.number()),e.z.undefined()])}).optional(),save:e.z.function({input:[e.z.number()],output:e.z.union([e.z.void(),e.z.promise(e.z.void())])}).optional()}).describe("Deprecated, removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`."),r=e.z.record(e.z.string(),e.z.union([e.z.string(),e.z.number()])).optional().describe("Inline styles"),p={open:e.z.union([e.z.boolean(),m]).optional().describe("The open state, when controlled. A responsive object is deprecated."),defaultOpen:e.z.union([e.z.boolean(),m]).optional().describe("The starting state. A responsive object leaves the pane untouched, with that object as the answer at each breakpoint."),onOpenChange:e.z.function({input:[e.z.boolean(),e.z.object({reason:S})],output:e.z.void()}).optional().describe("Called when a user opens or closes the pane. Never called on mount or on a resize.")},a={id:e.z.string().optional().describe("The pane id. A Trigger points `aria-controls` at it."),presentation:t.optional(),expandedSize:e.z.number().optional(),flush:e.z.boolean().optional().describe("Whether the pane joins the app frame. Defaults to true. `false` pulls it off the frame as a card."),onExpand:e.z.function({output:e.z.void()}).optional().describe("Deprecated: use `onOpenChange`"),onCollapse:e.z.function({output:e.z.void()}).optional().describe("Deprecated: use `onOpenChange`"),className:e.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional()},c={minSize:e.z.number().optional(),maxSize:e.z.number().optional().describe("The largest size. A drag also stops before the handle leaves the frame."),resizable:e.z.boolean().optional(),collapsible:e.z.boolean().optional().describe("A double-click on the handle closes the pane"),size:e.z.union([e.z.number(),e.z.string()]).optional().describe("The size, when controlled"),defaultSize:e.z.union([e.z.number(),e.z.string()]).optional().describe("The starting size"),onSizeChange:e.z.function({input:[e.z.number(),e.z.object({reason:k})],output:e.z.void()}).optional(),sizeUpdate:e.z.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.z.number().optional(),onResize:e.z.function({input:[e.z.number()],output:e.z.void()}).optional().describe("Called during a drag, at most once per animation frame"),onResizeStart:e.z.function({input:[e.z.number()],output:e.z.void()}).optional(),onResizeEnd:e.z.function({input:[e.z.number()],output:e.z.void()}).optional(),snapPoints:e.z.array(e.z.number()).optional().describe("Deprecated, removed in 1.0"),snapTolerance:e.z.number().optional().describe("Deprecated, removed in 1.0"),collapseThreshold:e.z.number().optional().describe("Deprecated, removed in 1.0"),paneId:e.z.string().optional().describe("Deprecated, removed in 1.0"),persistence:C.optional()},N=e.z.object({height:e.z.union([e.z.literal("full"),e.z.literal("auto"),e.z.string(),e.z.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.z.boolean().default(!1).describe("Fills the parent instead of the window and always scrolls inside itself. An explicit `height` implies it."),size:e.z.enum(["1","2","3"]).default("2").describe("Index of the pane chrome and the Sidebar rows in it"),className:e.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional().describe("The Shell parts, and anything else, rendered in order")}).strict(),A=e.z.object({height:e.z.number().default(64).describe("Height of the header, in pixels"),flush:e.z.boolean().optional().describe("Whether the header joins the app frame. Defaults to true. `false` makes it a card off the frame."),className:e.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional().describe("Header content")}).strict(),M=e.z.object({...a,...p,presentation:t.default("fixed").describe("Presentation mode"),expandedSize:e.z.number().default(64).describe("Width in pixels"),collapsible:e.z.boolean().optional()}).strict(),E=e.z.object({...a,...p,...c,presentation:t.optional().describe("Presentation mode. With no value the panel follows the Rail's."),expandedSize:e.z.number().default(288).describe("Open width in pixels"),minSize:e.z.number().default(100).describe("Minimum width when resizing"),maxSize:e.z.number().default(800).describe("Maximum width when resizing"),resizable:e.z.boolean().default(!1).describe("Whether the panel can be resized"),collapsible:e.z.boolean().default(!0).describe("Whether a double-click on the handle closes the panel")}).strict(),j=e.z.object({...a,...c,state:e.z.union([h,b]).optional().describe("The state, when controlled. A responsive object is deprecated."),defaultState:b.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.z.function({input:[h,e.z.object({reason:S})],output:e.z.void()}).optional().describe("Called when a user changes the state. Never called on mount or on a resize."),presentation:t.default({initial:"overlay",sm:"fixed"}).describe("Presentation mode"),expandedSize:e.z.number().default(288).describe("Open width in pixels"),minSize:e.z.number().default(200).describe("Minimum width when resizing"),maxSize:e.z.number().default(400).describe("Maximum width when resizing"),resizable:e.z.boolean().default(!1).describe("Whether the sidebar can be resized"),collapsible:e.z.boolean().default(!0).describe("Whether a double-click on the handle closes the sidebar")}).strict(),D=e.z.object({flush:e.z.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.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional().describe("Main content")}).strict(),O=e.z.object({...a,...p,...c,presentation:t.default({initial:"overlay",sm:"fixed"}).describe("Presentation mode"),expandedSize:e.z.number().default(320).describe("Open width in pixels"),minSize:e.z.number().default(200).describe("Minimum width when resizing"),maxSize:e.z.number().default(500).describe("Maximum width when resizing"),resizable:e.z.boolean().default(!1).describe("Whether the inspector can be resized"),collapsible:e.z.boolean().default(!0).describe("Whether a double-click on the handle closes the inspector")}).strict(),H=e.z.object({...a,...p,...c,presentation:t.default("fixed").describe("Presentation mode"),expandedSize:e.z.number().default(200).describe("Open height in pixels"),minSize:e.z.number().default(100).describe("Minimum height when resizing"),maxSize:e.z.number().default(400).describe("Maximum height when resizing"),resizable:e.z.boolean().default(!1).describe("Whether the bottom panel can be resized"),collapsible:e.z.boolean().default(!0).describe("Whether a double-click on the handle closes the panel")}).strict(),W=e.z.object({target:R.describe("Which pane to drive"),action:T.default("toggle").describe("Action to perform"),peekOnHover:e.z.boolean().default(!1).describe("Deprecated, removed in 1.0. Shows a preview of a closed pane on hover."),type:e.z.enum(["button","submit","reset"]).default("button").describe("The button type"),className:e.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional().describe("Trigger content"),onClick:e.z.function().optional().describe("Runs before the trigger acts. Call `event.preventDefault()` to cancel it."),onMouseEnter:e.z.function().optional().describe("Mouse enter handler"),onMouseLeave:e.z.function().optional().describe("Mouse leave handler"),"aria-label":e.z.string().optional().describe("ARIA label for accessibility"),"aria-labelledby":e.z.string().optional().describe("ARIA labelled by reference"),"aria-describedby":e.z.string().optional().describe("ARIA described by reference")}).strict(),_=e.z.object({className:e.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional().describe("Handle content")}).strict();function I(n){return n}function V(n){return n}function B(n){return n}function U(n){return n}function F(n){return n}function K(n){return n}function L(n){return n}function Z(n){return n}function q(n){return n}function G(n){return n}
|
|
2
|
+
"use strict";var d=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(t,n)=>{for(var s in n)d(t,s,{get:n[s],enumerable:!0})},z=(t,n,s,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of S(n))!f.call(t,i)&&i!==s&&d(t,i,{get:()=>n[i],enumerable:!(u=m(n,i))||u.enumerable});return t};var x=t=>z(d({},"__esModule",{value:!0}),t);var J={};g(J,{ShellBottomSchema:()=>H,ShellContentSchema:()=>j,ShellHandleSchema:()=>D,ShellHeaderSchema:()=>M,ShellInspectorSchema:()=>O,ShellPanelSchema:()=>C,ShellRailSchema:()=>A,ShellRootSchema:()=>N,ShellSidebarSchema:()=>E,ShellTriggerSchema:()=>W,parseShellBottomProps:()=>Z,parseShellContentProps:()=>F,parseShellHandleProps:()=>G,parseShellHeaderProps:()=>V,parseShellInspectorProps:()=>L,parseShellPanelProps:()=>B,parseShellRailProps:()=>I,parseShellRootProps:()=>_,parseShellSidebarProps:()=>U,parseShellTriggerProps:()=>q});module.exports=x(J);var e=require("zod"),y=e.z.enum(["expanded","collapsed"]).describe("Pane state mode"),h=e.z.enum(["collapsed","expanded"]).describe("Sidebar state"),P=e.z.enum(["fixed","overlay","stacked"]).describe("Presentation mode"),Q=e.z.enum(["initial","xs","sm","md","lg","xl"]).describe("Responsive breakpoint"),v=e.z.enum(["rail","panel","sidebar","inspector","bottom"]).describe("Pane target"),w=e.z.enum(["toggle","expand","collapse"]).describe("Trigger action"),b=e.z.enum(["toggle","dismiss"]).describe("Why the state changed: `toggle` for a trigger or the resize handle, `dismiss` for Escape or the scrim"),R=e.z.enum(["init","resize","controlled"]).describe("Why the size changed");function l(t){return e.z.union([t,e.z.object({initial:t.optional(),xs:t.optional(),sm:t.optional(),md:t.optional(),lg:t.optional(),xl:t.optional()})])}var X=l(y).describe("Responsive pane mode configuration"),T=l(h).describe("Responsive sidebar state"),o=l(P).describe("Responsive presentation configuration"),k=l(e.z.boolean()).describe("Responsive open state"),r=e.z.record(e.z.string(),e.z.union([e.z.string(),e.z.number()])).optional().describe("Inline styles"),p={open:e.z.boolean().optional().describe("The open state, when controlled"),defaultOpen:e.z.union([e.z.boolean(),k]).optional().describe("The starting state. A responsive object leaves the pane untouched, with that object as the answer at each breakpoint."),onOpenChange:e.z.function({input:[e.z.boolean(),e.z.object({reason:b})],output:e.z.void()}).optional().describe("Called when a user opens or closes the pane. Never called on mount or on a resize.")},a={id:e.z.string().optional().describe("The pane id. A Trigger points `aria-controls` at it."),presentation:o.optional(),expandedSize:e.z.number().optional(),flush:e.z.boolean().optional().describe("Whether the pane joins the app frame. Defaults to true. `false` pulls it off the frame as a card."),className:e.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional()},c={minSize:e.z.number().optional(),maxSize:e.z.number().optional().describe("The largest size. A drag also stops before the handle leaves the frame."),resizable:e.z.boolean().optional(),collapsible:e.z.boolean().optional().describe("A double-click on the handle closes the pane"),size:e.z.union([e.z.number(),e.z.string()]).optional().describe("The size, when controlled"),defaultSize:e.z.union([e.z.number(),e.z.string()]).optional().describe("The starting size"),onSizeChange:e.z.function({input:[e.z.number(),e.z.object({reason:R})],output:e.z.void()}).optional(),sizeUpdate:e.z.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.z.number().optional(),onResize:e.z.function({input:[e.z.number()],output:e.z.void()}).optional().describe("Called during a drag, at most once per animation frame"),onResizeStart:e.z.function({input:[e.z.number()],output:e.z.void()}).optional(),onResizeEnd:e.z.function({input:[e.z.number()],output:e.z.void()}).optional()},N=e.z.object({height:e.z.union([e.z.literal("full"),e.z.literal("auto"),e.z.string(),e.z.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.z.boolean().default(!1).describe("Fills the parent instead of the window and always scrolls inside itself. An explicit `height` implies it."),size:e.z.enum(["1","2","3"]).default("2").describe("Index of the pane chrome and the Sidebar rows in it"),className:e.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional().describe("The Shell parts, and anything else, rendered in order")}).strict(),M=e.z.object({height:e.z.number().default(64).describe("Height of the header, in pixels"),flush:e.z.boolean().optional().describe("Whether the header joins the app frame. Defaults to true. `false` makes it a card off the frame."),className:e.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional().describe("Header content")}).strict(),A=e.z.object({...a,...p,presentation:o.default("fixed").describe("Presentation mode"),expandedSize:e.z.number().default(64).describe("Width in pixels"),collapsible:e.z.boolean().optional()}).strict(),C=e.z.object({...a,...p,...c,presentation:o.optional().describe("Presentation mode. With no value the panel follows the Rail's."),expandedSize:e.z.number().default(288).describe("Open width in pixels"),minSize:e.z.number().default(100).describe("Minimum width when resizing"),maxSize:e.z.number().default(800).describe("Maximum width when resizing"),resizable:e.z.boolean().default(!1).describe("Whether the panel can be resized"),collapsible:e.z.boolean().default(!0).describe("Whether a double-click on the handle closes the panel")}).strict(),E=e.z.object({...a,...c,state:h.optional().describe("The state, when controlled"),defaultState:T.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.z.function({input:[h,e.z.object({reason:b})],output:e.z.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.z.number().default(288).describe("Open width in pixels"),minSize:e.z.number().default(200).describe("Minimum width when resizing"),maxSize:e.z.number().default(400).describe("Maximum width when resizing"),resizable:e.z.boolean().default(!1).describe("Whether the sidebar can be resized"),collapsible:e.z.boolean().default(!0).describe("Whether a double-click on the handle closes the sidebar")}).strict(),j=e.z.object({flush:e.z.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.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional().describe("Main content")}).strict(),O=e.z.object({...a,...p,...c,presentation:o.default({initial:"overlay",sm:"fixed"}).describe("Presentation mode"),expandedSize:e.z.number().default(320).describe("Open width in pixels"),minSize:e.z.number().default(200).describe("Minimum width when resizing"),maxSize:e.z.number().default(500).describe("Maximum width when resizing"),resizable:e.z.boolean().default(!1).describe("Whether the inspector can be resized"),collapsible:e.z.boolean().default(!0).describe("Whether a double-click on the handle closes the inspector")}).strict(),H=e.z.object({...a,...p,...c,presentation:o.default("fixed").describe("Presentation mode"),expandedSize:e.z.number().default(200).describe("Open height in pixels"),minSize:e.z.number().default(100).describe("Minimum height when resizing"),maxSize:e.z.number().default(400).describe("Maximum height when resizing"),resizable:e.z.boolean().default(!1).describe("Whether the bottom panel can be resized"),collapsible:e.z.boolean().default(!0).describe("Whether a double-click on the handle closes the panel")}).strict(),W=e.z.object({target:v.describe("Which pane to drive"),action:w.default("toggle").describe("Action to perform"),type:e.z.enum(["button","submit","reset"]).default("button").describe("The button type"),className:e.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional().describe("Trigger content"),onClick:e.z.function().optional().describe("Runs before the trigger acts. Call `event.preventDefault()` to cancel it."),onMouseEnter:e.z.function().optional().describe("Mouse enter handler"),onMouseLeave:e.z.function().optional().describe("Mouse leave handler"),"aria-label":e.z.string().optional().describe("ARIA label for accessibility"),"aria-labelledby":e.z.string().optional().describe("ARIA labelled by reference"),"aria-describedby":e.z.string().optional().describe("ARIA described by reference")}).strict(),D=e.z.object({className:e.z.string().optional().describe("Additional CSS class name"),style:r,children:e.z.any().optional().describe("Handle content")}).strict();function _(t){return t}function V(t){return t}function I(t){return t}function B(t){return t}function U(t){return t}function F(t){return t}function L(t){return t}function Z(t){return t}function q(t){return t}function G(t){return t}
|
|
3
3
|
//# sourceMappingURL=shell.schema.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,uBAAAC,EAAA,sBAAAC,EAAA,sBAAAC,EAAA,yBAAAC,EAAA,qBAAAC,EAAA,oBAAAC,EAAA,oBAAAC,EAAA,uBAAAC,EAAA,uBAAAC,EAAA,0BAAAC,EAAA,2BAAAC,EAAA,0BAAAC,EAAA,0BAAAC,EAAA,6BAAAC,EAAA,yBAAAC,EAAA,wBAAAC,EAAA,wBAAAC,EAAA,2BAAAC,EAAA,2BAAAC,IAAA,eAAAC,EAAAtB,GAAA,IAAAuB,EAAkB,eAsBZC,EAAiB,IAAE,KAAK,CAAC,WAAY,WAAW,CAAC,EAAE,SAAS,iBAAiB,EAC7EC,EAAoB,IAAE,KAAK,CAAC,YAAa,UAAU,CAAC,EAAE,SAAS,eAAe,EAC9EC,EAA0B,IAAE,KAAK,CAAC,QAAS,UAAW,SAAS,CAAC,EAAE,SAAS,mBAAmB,EAC9FC,EAAoB,IAAE,KAAK,CAAC,UAAW,KAAM,KAAM,KAAM,KAAM,IAAI,CAAC,EAAE,SAAS,uBAAuB,EACtGC,EAAmB,IAAE,KAAK,CAAC,OAAQ,
|
|
6
|
-
"names": ["shell_schema_exports", "__export", "ShellBottomSchema", "ShellContentSchema", "ShellHandleSchema", "ShellHeaderSchema", "ShellInspectorSchema", "ShellPanelSchema", "ShellRailSchema", "ShellRootSchema", "ShellSidebarSchema", "ShellTriggerSchema", "parseShellBottomProps", "parseShellContentProps", "parseShellHandleProps", "parseShellHeaderProps", "parseShellInspectorProps", "parseShellPanelProps", "parseShellRailProps", "parseShellRootProps", "parseShellSidebarProps", "parseShellTriggerProps", "__toCommonJS", "import_zod", "PaneModeSchema", "SidebarModeSchema", "PresentationValueSchema", "_BreakpointSchema", "PaneTargetSchema", "TriggerActionSchema", "OpenChangeReasonSchema", "SizeChangeReasonSchema", "responsive", "value", "_ResponsiveModeSchema", "ResponsiveSidebarModeSchema", "ResponsivePresentationSchema", "ResponsiveOpenSchema", "
|
|
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(['rail', 'panel', 'sidebar', 'inspector', 'bottom']).describe('Pane target');\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\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.boolean().optional().describe('The open state, when controlled'),\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 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};\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: SidebarModeSchema.optional().describe('The state, when controlled'),\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 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>;\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": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,uBAAAC,EAAA,sBAAAC,EAAA,sBAAAC,EAAA,yBAAAC,EAAA,qBAAAC,EAAA,oBAAAC,EAAA,oBAAAC,EAAA,uBAAAC,EAAA,uBAAAC,EAAA,0BAAAC,EAAA,2BAAAC,EAAA,0BAAAC,EAAA,0BAAAC,EAAA,6BAAAC,EAAA,yBAAAC,EAAA,wBAAAC,EAAA,wBAAAC,EAAA,2BAAAC,EAAA,2BAAAC,IAAA,eAAAC,EAAAtB,GAAA,IAAAuB,EAAkB,eAsBZC,EAAiB,IAAE,KAAK,CAAC,WAAY,WAAW,CAAC,EAAE,SAAS,iBAAiB,EAC7EC,EAAoB,IAAE,KAAK,CAAC,YAAa,UAAU,CAAC,EAAE,SAAS,eAAe,EAC9EC,EAA0B,IAAE,KAAK,CAAC,QAAS,UAAW,SAAS,CAAC,EAAE,SAAS,mBAAmB,EAC9FC,EAAoB,IAAE,KAAK,CAAC,UAAW,KAAM,KAAM,KAAM,KAAM,IAAI,CAAC,EAAE,SAAS,uBAAuB,EACtGC,EAAmB,IAAE,KAAK,CAAC,OAAQ,QAAS,UAAW,YAAa,QAAQ,CAAC,EAAE,SAAS,aAAa,EACrGC,EAAsB,IAAE,KAAK,CAAC,SAAU,SAAU,UAAU,CAAC,EAAE,SAAS,gBAAgB,EACxFC,EAAyB,IAAE,KAAK,CAAC,SAAU,SAAS,CAAC,EAAE,SAAS,uGAAuG,EACvKC,EAAyB,IAAE,KAAK,CAAC,OAAQ,SAAU,YAAY,CAAC,EAAE,SAAS,sBAAsB,EAEvG,SAASC,EAAmCC,EAAU,CACpD,OAAO,IAAE,MAAM,CACbA,EACA,IAAE,OAAO,CACP,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AAE,OAAO,EAAE,SAAS,EAAE,SAAS,8BAA8B,EAC3E,kBAAmB,IAAE,OAAO,EAAE,SAAS,EAAE,SAAS,4BAA4B,EAC9E,mBAAoB,IAAE,OAAO,EAAE,SAAS,EAAE,SAAS,6BAA6B,CAClF,CAAC,EACA,OAAO,EAKGlC,EAAoB,IAC9B,OAAO,CACN,UAAW,IAAE,OAAO,EAAE,SAAS,EAAE,SAAS,2BAA2B,EACrE,MAAOkC,EACP,SAAU,IAAE,IAAI,EAAE,SAAS,EAAE,SAAS,gBAAgB,CACxD,CAAC,EACA,OAAO,EAuCH,SAASnB,EAAoBuB,EAAgC,CAIlE,OAAOA,CACT,CAEO,SAAS3B,EAAsB2B,EAAkC,CAItE,OAAOA,CACT,CAEO,SAASxB,EAAoBwB,EAAgC,CAIlE,OAAOA,CACT,CAEO,SAASzB,EAAqByB,EAAiC,CAIpE,OAAOA,CACT,CAEO,SAAStB,EAAuBsB,EAAmC,CAIxE,OAAOA,CACT,CAEO,SAAS7B,EAAuB6B,EAAmC,CAIxE,OAAOA,CACT,CAEO,SAAS1B,EAAyB0B,EAAqC,CAI5E,OAAOA,CACT,CAEO,SAAS9B,EAAsB8B,EAAkC,CAItE,OAAOA,CACT,CAEO,SAASrB,EAAuBqB,EAAmC,CAIxE,OAAOA,CACT,CAEO,SAAS5B,EAAsB4B,EAAkC,CAItE,OAAOA,CACT",
|
|
6
|
+
"names": ["shell_schema_exports", "__export", "ShellBottomSchema", "ShellContentSchema", "ShellHandleSchema", "ShellHeaderSchema", "ShellInspectorSchema", "ShellPanelSchema", "ShellRailSchema", "ShellRootSchema", "ShellSidebarSchema", "ShellTriggerSchema", "parseShellBottomProps", "parseShellContentProps", "parseShellHandleProps", "parseShellHeaderProps", "parseShellInspectorProps", "parseShellPanelProps", "parseShellRailProps", "parseShellRootProps", "parseShellSidebarProps", "parseShellTriggerProps", "__toCommonJS", "import_zod", "PaneModeSchema", "SidebarModeSchema", "PresentationValueSchema", "_BreakpointSchema", "PaneTargetSchema", "TriggerActionSchema", "OpenChangeReasonSchema", "SizeChangeReasonSchema", "responsive", "value", "_ResponsiveModeSchema", "ResponsiveSidebarModeSchema", "ResponsivePresentationSchema", "ResponsiveOpenSchema", "StyleSchema", "OpenPropsSchema", "PaneBaseShape", "ResizeShape", "props"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";"use client";var U=Object.create;var g=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var Y=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},V=(t,e,n,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _(e))!H.call(t,i)&&i!==n&&g(t,i,{get:()=>e[i],enumerable:!(p=q(e,i))||p.enumerable});return t};var P=(t,e,n)=>(n=t!=null?U(Q(t)):{},V(e||!t||!t.__esModule?g(n,"default",{value:t,enumerable:!0}):n,t)),F=t=>V(g({},"__esModule",{value:!0}),t);var ce={};Y(ce,{Separator:()=>W});module.exports=F(ce);var v=P(require("react")),I=P(require("classnames"));var J=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"];var w={color:{type:"enum",values:J,default:void 0}};var X=["horizontal","vertical"],
|
|
2
|
+
"use strict";"use client";var U=Object.create;var g=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var Y=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},V=(t,e,n,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _(e))!H.call(t,i)&&i!==n&&g(t,i,{get:()=>e[i],enumerable:!(p=q(e,i))||p.enumerable});return t};var P=(t,e,n)=>(n=t!=null?U(Q(t)):{},V(e||!t||!t.__esModule?g(n,"default",{value:t,enumerable:!0}):n,t)),F=t=>V(g({},"__esModule",{value:!0}),t);var ce={};Y(ce,{Separator:()=>W});module.exports=F(ce);var v=P(require("react")),I=P(require("classnames"));var J=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"];var w={color:{type:"enum",values:J,default:void 0}};var X=["horizontal","vertical"],O={orientation:{type:"enum",className:"kui-r-orientation",values:X,default:"horizontal",responsive:!0},color:{...w.color,default:"gray"},decorative:{type:"boolean",default:!1},light:{type:"boolean",className:"kui-light",default:!1}};var M=P(require("classnames"));var Z=[],ee=new Set;function te(t){let e=Object.assign({},...t),n=[],p=[],i=new Set;for(let a in e){let r=e[a],l=r.values??Z,s={key:a,type:r.type,default:r.default,hasDefault:r.default!==void 0,responsive:"responsive"in r,className:r.className,customProperties:r.customProperties,parseValue:r.parseValue,values:l,valueSet:l.length>0?new Set(l):ee,enumValueSet:r.type==="enum"?new Set([r.default,...l]):void 0};r.className?(n.push(s),i.add(a)):(s.hasDefault||r.type==="enum")&&p.push(s)}return{styling:n,passthrough:p,stylingKeys:i}}var ne={children:new WeakMap};function B(t){let e=ne;for(let n=0;n<t.length;n++){let p=t[n],i=e.children.get(p);i===void 0&&(i={children:new WeakMap},e.children.set(p,i)),e=i}return e.compiled??(e.compiled=te(t))}var oe=["initial","xs","sm","md","lg","xl"],D=new Set(oe);function b(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var re=new Set(["initial","xs","sm","md","lg","xl"]);function d(t){if(typeof t!="object"||t===null)return!1;for(let e in t)if(re.has(e))return!0;return!1}function R(t,e,n){return e!==void 0?e.has(n):t.includes(n)}function j({className:t,customProperties:e,...n}){let p=x({allowArbitraryValues:!0,className:t,...n}),i=se({customProperties:e,...n});return[p,i]}function x({allowArbitraryValues:t,value:e,className:n,propValues:p,propValueSet:i,parseValue:a=r=>r}){if(e){if(typeof e=="string")return R(p,i,e)?E(n,e,a):t?n:void 0;if(d(e)){let r=e,l=[];for(let s in r){if(!b(r,s)||!D.has(s))continue;let o=r[s];if(o!==void 0){if(R(p,i,o)){let f=E(n,o,a),u=s==="initial"?f:`${s}:${f}`;l.push(u)}else if(t){let f=s==="initial"?n:`${s}:${n}`;l.push(f)}}}return l.length>0?l.join(" "):""}if(t)return n}}function E(t,e,n){let p=t?"-":"",i=n(e),a=i?.startsWith("-"),r=a?"-":"",l=a?i?.substring(1):i;return`${r}${t}${p}${l}`}function se({customProperties:t,value:e,propValues:n,propValueSet:p,parseValue:i=a=>a}){if(!e||typeof e=="string"&&R(n,p,e))return;let a;if(typeof e=="string"){let r=i(e);a={};for(let l of t)a[l]=r;return a}if(d(e)){let r=e;for(let l in r){if(!b(r,l)||!D.has(l))continue;let s=r[l];if(s===void 0||R(n,p,s))continue;let o=i(s);a??(a={});for(let f of t){let u=l==="initial"?f:`${f}-${l}`;a[u]=o}}}return a??{}}function h(...t){let e;for(let n of t)n&&(e===void 0&&(e={}),Object.assign(e,n));return e}function ie(t,e){let n=t.initial,p=!1;return e.hasDefault&&n===void 0&&(n=e.default,p=!0),e.enumValueSet!==void 0&&!e.enumValueSet.has(n)&&(n=e.default,p=!0),p?{...t,initial:n}:t}function z(t,...e){let{styling:n,passthrough:p,stylingKeys:i}=B(e),a={};for(let s in t)i.has(s)||(a[s]=t[s]);for(let s=0;s<p.length;s++){let o=p[s],f=a[o.key];if(f===void 0){o.hasDefault&&(a[o.key]=o.default);continue}o.enumValueSet!==void 0&&!o.enumValueSet.has(f)&&!d(f)&&(a[o.key]=o.default)}let r,l=[];for(let s=0;s<n.length;s++){let o=n[s],f=t[o.key];if(f===void 0&&o.hasDefault&&(f=o.default),o.enumValueSet!==void 0&&!o.enumValueSet.has(f)&&!d(f)&&(f=o.default),!!f){if(d(f)){if(!o.responsive)continue;f=ie(f,o)}if(o.type==="enum"){let u=x({allowArbitraryValues:!1,value:f,className:o.className,propValues:o.values,propValueSet:o.valueSet,parseValue:o.parseValue});u&&l.push(u);continue}if(o.type==="string"||o.type==="enum | string"){let[u,N]=j({className:o.className,customProperties:o.customProperties,propValues:o.type==="string"?[]:o.values,propValueSet:o.type==="string"?void 0:o.valueSet,parseValue:o.parseValue,value:f});N&&(r=h(r,N)),u&&l.push(u);continue}if(o.type==="boolean"){l.push(o.className);continue}}}return a.className=(0,M.default)(l.length>0?l.join(" "):void 0,t.className),a.style=h(r,t.style),a}var y=P(require("react"));var L={xs:"(min-width: 520px)",sm:"(min-width: 768px)",md:"(min-width: 1024px)",lg:"(min-width: 1280px)",xl:"(min-width: 1640px)"},K=["initial","xs","sm","md","lg","xl"];var ae=Object.entries(L),k=null,m=new Set,c=null;function C(){return k??(k=ae.map(([t,e])=>[t,window.matchMedia(e)])),k}function T(){let t="initial";for(let[e,n]of C())n.matches&&(t=e);return t}function S(){let t=T();t!==c&&(c=t,m.forEach(e=>e()))}function $(t){if(typeof window>"u")return()=>{};if(m.size===0){c=T();for(let[,e]of C())typeof e.addEventListener=="function"?e.addEventListener("change",S):e.addListener?.(S)}return m.add(t),()=>{if(m.delete(t),!(m.size>0)){for(let[,e]of C())try{typeof e.removeEventListener=="function"?e.removeEventListener("change",S):e.removeListener?.(S)}catch{}c=null}}}function pe(){return typeof window>"u"?"initial":(c??(c=T()),c)}function le(){return"initial"}var fe=()=>!0,ue=()=>!1,A=()=>()=>{},de=()=>"initial";function G(t=!0){let e=y.useSyncExternalStore(t?$:A,t?pe:de,le),n=y.useSyncExternalStore(t?$:A,fe,ue);return y.useMemo(()=>({breakpoint:e,ready:n}),[e,n])}var W=v.forwardRef((t,e)=>{let{className:n,color:p,decorative:i,...a}=z(t,O),r=typeof t.orientation=="object"&&t.orientation!==null,{breakpoint:l}=G(r),s="horizontal";if(r){let o=t.orientation;for(let f of K)if(o[f]!==void 0&&(s=o[f]),f===l)break}else t.orientation==="vertical"&&(s="vertical");return v.createElement("span",{"data-accent-color":p,role:i?void 0:"separator","aria-orientation":i?void 0:s,...a,ref:e,className:(0,I.default)("kui-Separator",n)})});W.displayName="Separator";
|
|
3
3
|
//# sourceMappingURL=separator.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/separator.tsx", "../../../src/props/color.prop.ts", "../../../src/components/separator.props.tsx", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/hooks/use-breakpoint.ts", "../../../src/components/shell.types.ts"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { separatorPropDefs } from './separator.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useBreakpoint } from '../hooks/use-breakpoint.js';\nimport { SHELL_BREAKPOINTS } from './shell.types.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SeparatorElement = React.ElementRef<'span'>;\ntype SeparatorOwnProps = GetPropDefTypes<typeof separatorPropDefs>;\ninterface SeparatorProps extends ComponentPropsWithout<'span', RemovedProps>, SeparatorOwnProps {}\ntype Orientation = 'horizontal' | 'vertical';\n\nconst Separator = React.forwardRef<SeparatorElement, SeparatorProps>((props, forwardedRef) => {\n const { className, color, decorative, ...separatorProps } = extractProps(props, separatorPropDefs);\n const responsive = typeof props.orientation === 'object' && props.orientation !== null;\n const { breakpoint } = useBreakpoint(responsive);\n\n // A responsive orientation announces the one drawn at the current breakpoint.\n let orientation: Orientation = 'horizontal';\n if (responsive) {\n const values = props.orientation as Partial<Record<string, Orientation>>;\n for (const bp of SHELL_BREAKPOINTS) {\n if (values[bp] !== undefined) orientation = values[bp]!;\n if (bp === breakpoint) break;\n }\n } else if (props.orientation === 'vertical') {\n orientation = 'vertical';\n }\n\n return (\n <span\n data-accent-color={color}\n role={decorative ? undefined : 'separator'}\n aria-orientation={decorative ? undefined : orientation}\n {...separatorProps}\n ref={forwardedRef}\n className={classNames('kui-Separator', className)}\n />\n );\n});\nSeparator.displayName = 'Separator';\n\nexport { Separator };\nexport type { SeparatorProps };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import { colorPropDef } from '../props/color.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst orientationValues = ['horizontal', 'vertical'] as const;\n\nconst separatorPropDefs = {\n orientation: {\n type: 'enum',\n className: 'kui-r-orientation',\n values: orientationValues,\n default: 'horizontal',\n responsive: true,\n },\n color: { ...colorPropDef.color, default: 'gray' },\n decorative: { type: 'boolean', default: false },\n light: { type: 'boolean', className: 'kui-light', default: false },\n} satisfies {\n orientation: PropDef<(typeof orientationValues)[number]>;\n color: typeof colorPropDef.color;\n decorative: PropDef<boolean>;\n light: PropDef<boolean>;\n};\n\nexport { separatorPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "'use client';\n\nimport * as React from 'react';\nimport { _BREAKPOINTS, type Breakpoint } from '../components/shell.types.js';\n\nconst QUERIES = Object.entries(_BREAKPOINTS) as Array<[Breakpoint, string]>;\n\ntype Listener = () => void;\n\n/**\n * One set of `MediaQueryList`s and one set of listeners for the whole\n * application. Every component that asks for the breakpoint used to create and\n * subscribe to its own copy of all five queries.\n */\nlet mediaQueryLists: Array<[Breakpoint, MediaQueryList]> | null = null;\nconst listeners = new Set<Listener>();\nlet cachedBreakpoint: Breakpoint | null = null;\n\nfunction getMediaQueryLists() {\n mediaQueryLists ??= QUERIES.map(([name, query]) => [name, window.matchMedia(query)] as [Breakpoint, MediaQueryList]);\n return mediaQueryLists;\n}\n\nfunction computeBreakpoint(): Breakpoint {\n // The largest matching query wins; `_BREAKPOINTS` is ordered smallest first.\n let matched: Breakpoint = 'initial';\n for (const [name, mql] of getMediaQueryLists()) {\n if (mql.matches) matched = name;\n }\n return matched;\n}\n\nfunction handleChange() {\n const next = computeBreakpoint();\n if (next === cachedBreakpoint) return;\n cachedBreakpoint = next;\n listeners.forEach((listener) => listener());\n}\n\nfunction subscribe(listener: Listener) {\n if (typeof window === 'undefined') return () => {};\n\n if (listeners.size === 0) {\n cachedBreakpoint = computeBreakpoint();\n for (const [, mql] of getMediaQueryLists()) {\n // Safari below 14 only has the deprecated listener API.\n if (typeof mql.addEventListener === 'function') mql.addEventListener('change', handleChange);\n else mql.addListener?.(handleChange);\n }\n }\n\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n\n for (const [, mql] of getMediaQueryLists()) {\n try {\n if (typeof mql.removeEventListener === 'function') mql.removeEventListener('change', handleChange);\n else mql.removeListener?.(handleChange);\n } catch (error) {\n // Removal can throw in edge cases, e.g. the list was already torn down.\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[useBreakpoint] MediaQueryList cleanup warning:', error);\n }\n }\n }\n cachedBreakpoint = null;\n };\n}\n\n/**\n * `getSnapshot` must return a referentially stable value between changes, so it\n * reads the cache that `handleChange` maintains rather than recomputing.\n */\nfunction getSnapshot(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n cachedBreakpoint ??= computeBreakpoint();\n return cachedBreakpoint;\n}\n\nfunction getServerSnapshot(): Breakpoint {\n return 'initial';\n}\n\n/**\n * The breakpoint right now, outside React's render. For an effect that needs\n * the answer at the moment it runs rather than the one its render saw.\n */\nexport function readBreakpoint(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n return computeBreakpoint();\n}\n\nconst getReadySnapshot = () => true;\nconst getReadyServerSnapshot = () => false;\n\nconst noopSubscribe = () => () => {};\nconst getInitialSnapshot = (): Breakpoint => 'initial';\n\n/**\n * The current breakpoint, and whether it has been resolved against a real\n * viewport yet (`false` on the server and during hydration).\n *\n * Reads through `useSyncExternalStore` rather than settling into state from an\n * effect. On a client render the very first pass already has the real\n * breakpoint, instead of rendering the whole shell at `initial` and correcting\n * it after the browser has painted.\n *\n * Pass `enabled = false` to skip the subscription (the breakpoint then reads as\n * `initial`).\n */\nexport function useBreakpoint(enabled = true): { breakpoint: Breakpoint; ready: boolean } {\n // Callers with a non-responsive value pass `enabled = false` so they neither\n // subscribe to the media queries nor re-render when the viewport crosses one.\n const breakpoint = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n enabled ? getSnapshot : getInitialSnapshot,\n getServerSnapshot,\n );\n const ready = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n getReadySnapshot,\n getReadyServerSnapshot,\n );\n\n return React.useMemo(() => ({ breakpoint, ready }), [breakpoint, ready]);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\n/**\n * Why a pane's open state changed. Since 0.8.0 only a user action is reported:\n * `toggle` for a Trigger, a handle double-click or a drag past\n * `collapseThreshold`, and `dismiss` for Escape or a press on the scrim.\n * `init`, `responsive`, `panel` and `left` are kept in the types for\n * compatibility and are never sent.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss' | 'init' | 'responsive';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n /** @deprecated Removed in 1.0. Snap in your own `onSizeChange` and pass `size`. */\n snapPoints?: number[];\n /** @deprecated Removed in 1.0, with `snapPoints`. */\n snapTolerance?: number;\n /** @deprecated Removed in 1.0. Close the pane from your own `onResizeEnd`. */\n collapseThreshold?: number;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n paneId?: string;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/** The panes a Trigger can drive. `left` is the deprecated name for `rail`. */\nexport type PaneName = Exclude<PaneTarget, 'left'>;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n"],
|
|
5
|
-
"mappings": ";ukBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,eAAAE,IAAA,eAAAC,EAAAH,IAEA,IAAAI,EAAuB,oBACvBC,EAAuB,yBCAvB,IAAMC,EAAe,CAAC,OAAQ,OAAQ,SAAU,QAAS,SAAU,QAAS,SAAU,SAAU,MAAO,OAAQ,UAAW,OAAQ,OAAQ,SAAU,SAAU,OAAQ,SAAU,OAAQ,OAAQ,OAAQ,OAAQ,QAAS,QAAS,OAAQ,OAAQ,KAAK,EAIvP,IAAMC,EAAe,CACnB,MAAO,CACL,KAAM,OACN,OAAQC,EACR,QAAS,MACX,CACF,ECTA,IAAMC,EAAoB,CAAC,aAAc,UAAU,EAE7CC,EAAoB,CACxB,YAAa,CACX,KAAM,OACN,UAAW,oBACX,OAAQD,EACR,QAAS,aACT,WAAY,EACd,EACA,MAAO,CAAE,GAAGE,EAAa,MAAO,QAAS,MAAO,EAChD,WAAY,CAAE,KAAM,UAA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ACpB,MAAAD,CACF,CAAC,EAEGoB,IAAsBL,EAAQO,EAAYP,EAAOK,CAAoB,GACrED,GAAgBH,EAAQ,KAAKG,CAAc,EAC/C,QACF,CAEA,GAAIlB,EAAQ,OAAS,UAAW,CAE9Be,EAAQ,KAAKf,EAAQ,SAAU,EAC/B,QACF,EACF,CAEA,OAAAU,EAAe,aAAY,EAAAY,SAAWP,EAAQ,OAAS,EAAIA,EAAQ,KAAK,GAAG,EAAI,OAAWX,EAAM,SAAS,EACzGM,EAAe,MAAQW,EAAYP,EAAOV,EAAM,KAAK,EAC9CM,CACT,CO5IA,IAAAa,EAAuB,
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { separatorPropDefs } from './separator.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useBreakpoint } from '../hooks/use-breakpoint.js';\nimport { SHELL_BREAKPOINTS } from './shell.types.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SeparatorElement = React.ElementRef<'span'>;\ntype SeparatorOwnProps = GetPropDefTypes<typeof separatorPropDefs>;\ninterface SeparatorProps extends ComponentPropsWithout<'span', RemovedProps>, SeparatorOwnProps {}\ntype Orientation = 'horizontal' | 'vertical';\n\nconst Separator = React.forwardRef<SeparatorElement, SeparatorProps>((props, forwardedRef) => {\n const { className, color, decorative, ...separatorProps } = extractProps(props, separatorPropDefs);\n const responsive = typeof props.orientation === 'object' && props.orientation !== null;\n const { breakpoint } = useBreakpoint(responsive);\n\n // A responsive orientation announces the one drawn at the current breakpoint.\n let orientation: Orientation = 'horizontal';\n if (responsive) {\n const values = props.orientation as Partial<Record<string, Orientation>>;\n for (const bp of SHELL_BREAKPOINTS) {\n if (values[bp] !== undefined) orientation = values[bp]!;\n if (bp === breakpoint) break;\n }\n } else if (props.orientation === 'vertical') {\n orientation = 'vertical';\n }\n\n return (\n <span\n data-accent-color={color}\n role={decorative ? undefined : 'separator'}\n aria-orientation={decorative ? undefined : orientation}\n {...separatorProps}\n ref={forwardedRef}\n className={classNames('kui-Separator', className)}\n />\n );\n});\nSeparator.displayName = 'Separator';\n\nexport { Separator };\nexport type { SeparatorProps };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import { colorPropDef } from '../props/color.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst orientationValues = ['horizontal', 'vertical'] as const;\n\nconst separatorPropDefs = {\n orientation: {\n type: 'enum',\n className: 'kui-r-orientation',\n values: orientationValues,\n default: 'horizontal',\n responsive: true,\n },\n color: { ...colorPropDef.color, default: 'gray' },\n decorative: { type: 'boolean', default: false },\n light: { type: 'boolean', className: 'kui-light', default: false },\n} satisfies {\n orientation: PropDef<(typeof orientationValues)[number]>;\n color: typeof colorPropDef.color;\n decorative: PropDef<boolean>;\n light: PropDef<boolean>;\n};\n\nexport { separatorPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "'use client';\n\nimport * as React from 'react';\nimport { _BREAKPOINTS, type Breakpoint } from '../components/shell.types.js';\n\nconst QUERIES = Object.entries(_BREAKPOINTS) as Array<[Breakpoint, string]>;\n\ntype Listener = () => void;\n\n/**\n * One set of `MediaQueryList`s and one set of listeners for the whole\n * application. Every component that asks for the breakpoint used to create and\n * subscribe to its own copy of all five queries.\n */\nlet mediaQueryLists: Array<[Breakpoint, MediaQueryList]> | null = null;\nconst listeners = new Set<Listener>();\nlet cachedBreakpoint: Breakpoint | null = null;\n\nfunction getMediaQueryLists() {\n mediaQueryLists ??= QUERIES.map(([name, query]) => [name, window.matchMedia(query)] as [Breakpoint, MediaQueryList]);\n return mediaQueryLists;\n}\n\nfunction computeBreakpoint(): Breakpoint {\n // The largest matching query wins; `_BREAKPOINTS` is ordered smallest first.\n let matched: Breakpoint = 'initial';\n for (const [name, mql] of getMediaQueryLists()) {\n if (mql.matches) matched = name;\n }\n return matched;\n}\n\nfunction handleChange() {\n const next = computeBreakpoint();\n if (next === cachedBreakpoint) return;\n cachedBreakpoint = next;\n listeners.forEach((listener) => listener());\n}\n\nfunction subscribe(listener: Listener) {\n if (typeof window === 'undefined') return () => {};\n\n if (listeners.size === 0) {\n cachedBreakpoint = computeBreakpoint();\n for (const [, mql] of getMediaQueryLists()) {\n // Safari below 14 only has the deprecated listener API.\n if (typeof mql.addEventListener === 'function') mql.addEventListener('change', handleChange);\n else mql.addListener?.(handleChange);\n }\n }\n\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n\n for (const [, mql] of getMediaQueryLists()) {\n try {\n if (typeof mql.removeEventListener === 'function') mql.removeEventListener('change', handleChange);\n else mql.removeListener?.(handleChange);\n } catch (error) {\n // Removal can throw in edge cases, e.g. the list was already torn down.\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[useBreakpoint] MediaQueryList cleanup warning:', error);\n }\n }\n }\n cachedBreakpoint = null;\n };\n}\n\n/**\n * `getSnapshot` must return a referentially stable value between changes, so it\n * reads the cache that `handleChange` maintains rather than recomputing.\n */\nfunction getSnapshot(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n cachedBreakpoint ??= computeBreakpoint();\n return cachedBreakpoint;\n}\n\nfunction getServerSnapshot(): Breakpoint {\n return 'initial';\n}\n\n/**\n * The breakpoint right now, outside React's render. For an effect that needs\n * the answer at the moment it runs rather than the one its render saw.\n */\nexport function readBreakpoint(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n return computeBreakpoint();\n}\n\nconst getReadySnapshot = () => true;\nconst getReadyServerSnapshot = () => false;\n\nconst noopSubscribe = () => () => {};\nconst getInitialSnapshot = (): Breakpoint => 'initial';\n\n/**\n * The current breakpoint, and whether it has been resolved against a real\n * viewport yet (`false` on the server and during hydration).\n *\n * Reads through `useSyncExternalStore` rather than settling into state from an\n * effect. On a client render the very first pass already has the real\n * breakpoint, instead of rendering the whole shell at `initial` and correcting\n * it after the browser has painted.\n *\n * Pass `enabled = false` to skip the subscription (the breakpoint then reads as\n * `initial`).\n */\nexport function useBreakpoint(enabled = true): { breakpoint: Breakpoint; ready: boolean } {\n // Callers with a non-responsive value pass `enabled = false` so they neither\n // subscribe to the media queries nor re-render when the viewport crosses one.\n const breakpoint = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n enabled ? getSnapshot : getInitialSnapshot,\n getServerSnapshot,\n );\n const ready = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n getReadySnapshot,\n getReadyServerSnapshot,\n );\n\n return React.useMemo(() => ({ breakpoint, ready }), [breakpoint, ready]);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\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": ";ukBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,eAAAE,IAAA,eAAAC,EAAAH,IAEA,IAAAI,EAAuB,oBACvBC,EAAuB,yB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ACF,EAEA,OAAa,UAAQ,KAAO,CAAE,WAAAK,EAAY,MAAAI,CAAM,GAAI,CAACJ,EAAYI,CAAK,CAAC,CACzE,CV9GA,IAAMC,EAAkB,aAA6C,CAACC,EAAOC,IAAiB,CAC5F,GAAM,CAAE,UAAAC,EAAW,MAAAC,EAAO,WAAAC,EAAY,GAAGC,CAAe,EAAIC,EAAaN,EAAOO,CAAiB,EAC3FC,EAAa,OAAOR,EAAM,aAAgB,UAAYA,EAAM,cAAgB,KAC5E,CAAE,WAAAS,CAAW,EAAIC,EAAcF,CAAU,EAG3CG,EAA2B,aAC/B,GAAIH,EAAY,CACd,IAAMI,EAASZ,EAAM,YACrB,QAAWa,KAAMC,EAEf,GADIF,EAAOC,CAAE,IAAM,SAAWF,EAAcC,EAAOC,CAAE,GACjDA,IAAOJ,EAAY,KAE3B,MAAWT,EAAM,cAAgB,aAC/BW,EAAc,YAGhB,OACE,gBAAC,QACC,oBAAmBR,EACnB,KAAMC,EAAa,OAAY,YAC/B,mBAAkBA,EAAa,OAAYO,EAC1C,GAAGN,EACJ,IAAKJ,EACL,aAAW,EAAAc,SAAW,gBAAiBb,CAAS,EAClD,CAEJ,CAAC,EACDH,EAAU,YAAc",
|
|
6
6
|
"names": ["separator_exports", "__export", "Separator", "__toCommonJS", "React", "import_classnames", "accentColors", "colorPropDef", "accentColors", "orientationValues", "separatorPropDefs", "colorPropDef", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "React", "_BREAKPOINTS", "SHELL_BREAKPOINTS", "QUERIES", "_BREAKPOINTS", "mediaQueryLists", "listeners", "cachedBreakpoint", "getMediaQueryLists", "name", "query", "computeBreakpoint", "matched", "mql", "handleChange", "next", "listener", "subscribe", "getSnapshot", "getServerSnapshot", "getReadySnapshot", "getReadyServerSnapshot", "noopSubscribe", "getInitialSnapshot", "useBreakpoint", "enabled", "breakpoint", "subscribe", "getSnapshot", "getServerSnapshot", "ready", "Separator", "props", "forwardedRef", "className", "color", "decorative", "separatorProps", "extractProps", "separatorPropDefs", "responsive", "breakpoint", "useBreakpoint", "orientation", "values", "bp", "SHELL_BREAKPOINTS", "classNames"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SidebarMode } from './shell.types.js';
|
|
2
2
|
/**
|
|
3
3
|
* The Sidebar's mode, and a setter. The setter is a user action: it reports
|
|
4
4
|
* through the Sidebar's `onStateChange` the way a Trigger does.
|
|
@@ -7,48 +7,4 @@ export declare function useSidebarMode(): {
|
|
|
7
7
|
sidebarMode: SidebarMode;
|
|
8
8
|
setSidebarMode: (mode: SidebarMode) => void;
|
|
9
9
|
};
|
|
10
|
-
export interface ShellContextValue {
|
|
11
|
-
leftMode: PaneMode;
|
|
12
|
-
setLeftMode: (mode: PaneMode) => void;
|
|
13
|
-
/** The Rail's open state, resolved, when it is controlled. */
|
|
14
|
-
leftControlledOpen?: boolean;
|
|
15
|
-
panelMode: PaneMode;
|
|
16
|
-
setPanelMode: (mode: PaneMode) => void;
|
|
17
|
-
sidebarMode: SidebarMode;
|
|
18
|
-
setSidebarMode: (mode: SidebarMode) => void;
|
|
19
|
-
inspectorMode: PaneMode;
|
|
20
|
-
setInspectorMode: (mode: PaneMode) => void;
|
|
21
|
-
bottomMode: PaneMode;
|
|
22
|
-
setBottomMode: (mode: PaneMode) => void;
|
|
23
|
-
peekTarget: PaneTarget | null;
|
|
24
|
-
setPeekTarget: (target: PaneTarget | null) => void;
|
|
25
|
-
peekPane: (target: PaneTarget) => void;
|
|
26
|
-
clearPeek: () => void;
|
|
27
|
-
/** Whether a Rail is mounted. */
|
|
28
|
-
hasLeft: boolean;
|
|
29
|
-
/** No effect since 0.8.0: the registry knows which panes are mounted. */
|
|
30
|
-
setHasLeft: (has: boolean) => void;
|
|
31
|
-
/** Whether a Sidebar is mounted. */
|
|
32
|
-
hasSidebar: boolean;
|
|
33
|
-
/** No effect since 0.8.0: the registry knows which panes are mounted. */
|
|
34
|
-
setHasSidebar: (has: boolean) => void;
|
|
35
|
-
currentBreakpoint: Breakpoint;
|
|
36
|
-
currentBreakpointReady: boolean;
|
|
37
|
-
/** The Rail's presentation at the current breakpoint, when known. */
|
|
38
|
-
leftResolvedPresentation?: PresentationValue;
|
|
39
|
-
togglePane: (target: PaneTarget) => void;
|
|
40
|
-
expandPane: (target: PaneTarget) => void;
|
|
41
|
-
collapsePane: (target: PaneTarget) => void;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* @deprecated The whole-shell reader re-renders its consumer on every change
|
|
45
|
-
* to any pane. Use `Shell.Trigger` to drive a pane, `Shell.useSidebarMode`
|
|
46
|
-
* for the Sidebar, and each pane's `open`/`onOpenChange` for its state.
|
|
47
|
-
* Removed in 1.0.
|
|
48
|
-
*
|
|
49
|
-
* Keeps 0.7's shape. The setters act as a user would: they report through
|
|
50
|
-
* the pane's own callback with `reason: 'toggle'`, and a controlled pane
|
|
51
|
-
* changes only when the app passes the new value.
|
|
52
|
-
*/
|
|
53
|
-
export declare function useShell(): ShellContextValue;
|
|
54
10
|
//# sourceMappingURL=shell.context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.context.d.ts","sourceRoot":"","sources":["../../../src/components/shell.context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shell.context.d.ts","sourceRoot":"","sources":["../../../src/components/shell.context.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOpD;;;GAGG;AACH,wBAAgB,cAAc,IAAI;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,cAAc,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAA;CAAE,CAe1G"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";"use client";var
|
|
2
|
+
"use strict";"use client";var x=Object.create;var s=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of m(t))!y.call(e,o)&&o!==n&&s(e,o,{get:()=>t[o],enumerable:!(r=b(t,o))||r.enumerable});return e};var p=(e,t,n)=>(n=e!=null?x(P(e)):{},d(t||!e||!e.__esModule?s(n,"default",{value:e,enumerable:!0}):n,e)),g=e=>d(s({},"__esModule",{value:!0}),e);var V={};R(V,{useSidebarMode:()=>E});module.exports=g(V);var a=p(require("react"));var i=p(require("react")),T=require("radix-ui/internal");var u=["initial","xs","sm","md","lg","xl"];function c(e){return typeof e=="object"&&e!==null}function h(e,t){let n={},r=null;for(let o of u){if(e!==void 0&&!c(e)){n[o]=e;continue}let l=c(e)?e[o]:void 0;l!==void 0&&(r={value:l}),n[o]=r?r.value:t(o)}return n}var B=h("fixed",()=>"fixed");function S(e,t){return e.listeners.add(t),()=>{e.listeners.delete(t)}}var v=i.createContext(null);function f(e){let t=i.useContext(v);if(!t)throw new Error(`${e} must be used within <Shell.Root>`);return t}var I=i.createContext(null);var M=e=>e===void 0?void 0:e==="closed"?"collapsed":"expanded",C=e=>e==="collapsed"?"closed":"open";function E(){let e=f("useSidebarMode"),t=a.useCallback(o=>S(e,o),[e]),n=a.useSyncExternalStore(t,()=>e.entries.get("sidebar")?.value,()=>{}),r=a.useCallback(o=>{e.entries.get("sidebar")?.setValue(C(o),"toggle")},[e]);return{sidebarMode:M(n)??"expanded",setSidebarMode:r}}
|
|
3
3
|
//# sourceMappingURL=shell.context.js.map
|