@kushagradhawan/kookie-ui 0.1.46 → 0.1.48

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 CHANGED
@@ -15139,6 +15139,9 @@
15139
15139
  }
15140
15140
  .rt-ShellBottom[data-mode='collapsed'] {
15141
15141
  height: 0px;
15142
+ position: absolute;
15143
+ inset-inline: 0;
15144
+ inset-block-end: 0;
15142
15145
  }
15143
15146
  .rt-ShellBottomContent {
15144
15147
  display: flex;
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAG/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,UAAU,oBACR,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC;CAAG;AAC7E,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAEnD,CAAC;AAIF,UAAU,uBACR,SAAQ,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,OAAO,EAAE,YAAY,CAAC;CAAG;AACrF,QAAA,MAAM,kBAAkB,mGAMvB,CAAC;AAIF,UAAU,uBACR,SAAQ,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,OAAO,EAAE,YAAY,CAAC,EAC9E,0BAA0B;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB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pF,QAAA,MAAM,iBAAiB,kGAMtB,CAAC;AAGF,OAAO,EACL,eAAe,IAAI,IAAI,EACvB,kBAAkB,IAAI,OAAO,EAC7B,kBAAkB,IAAI,OAAO,EAC7B,gBAAgB,IAAI,KAAK,EACzB,sBAAsB,IAAI,WAAW,EACrC,iBAAiB,IAAI,MAAM,EAC3B,iBAAiB,IAAI,MAAM,GAC5B,CAAC;AAEF,YAAY,EACV,oBAAoB,IAAI,SAAS,EACjC,uBAAuB,IAAI,YAAY,EACvC,uBAAuB,IAAI,YAAY,EACvC,qBAAqB,IAAI,UAAU,EACnC,2BAA2B,IAAI,gBAAgB,EAC/C,sBAAsB,IAAI,WAAW,EACrC,sBAAsB,IAAI,WAAW,GACtC,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var z=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var r in t)m(e,r,{get:t[r],enumerable:!0})},N=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of I(t))!V.call(e,a)&&a!==r&&m(e,a,{get:()=>t[a],enumerable:!(s=F(t,a))||s.enumerable});return e};var b=(e,t,r)=>(r=e!=null?z(U(e)):{},N(t||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e)),G=e=>N(m({},"__esModule",{value:!0}),e);var J={};$(J,{Action:()=>y,Cancel:()=>v,Content:()=>P,Description:()=>C,Root:()=>f,Title:()=>u,Trigger:()=>d});module.exports=G(J);var o=b(require("react")),k=b(require("classnames")),i=require("radix-ui"),B=require("./alert-dialog.props.js"),w=require("./heading.js"),M=require("./text.js"),W=require("./theme.js"),n=require("../helpers/extract-props.js"),c=require("../helpers/require-react-element.js");const f=e=>o.createElement(i.AlertDialog.Root,{...e});f.displayName="AlertDialog.Root";const d=o.forwardRef(({children:e,...t},r)=>o.createElement(i.AlertDialog.Trigger,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));d.displayName="AlertDialog.Trigger";const P=o.forwardRef(({align:e,...t},r)=>{const{align:s,panelBackground:a,material:H,...L}=B.alertDialogContentPropDefs,{className:O}=(0,n.extractProps)({align:e},{align:s}),{panelBackground:T}=(0,n.extractProps)({panelBackground:t.panelBackground},{panelBackground:a}),{material:D}=(0,n.extractProps)({material:t.material},{material:H}),E=o.useMemo(()=>(D!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),D??T),[D,T]),{className:S,forceMount:K,container:_,panelBackground:Q,material:X,...j}=(0,n.extractProps)(t,L),h=o.useRef(null),q=o.useMemo(()=>l=>{h.current=l,typeof r=="function"?r(l):r&&(r.current=l)},[r]);return o.useEffect(()=>{if(typeof window>"u")return;const l=h.current;if(!l)return;const p=l.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(p.length===0)return;const A=p[0],R=p[p.length-1],x=g=>{g.key==="Tab"&&(g.shiftKey?document.activeElement===A&&(g.preventDefault(),R.focus()):document.activeElement===R&&(g.preventDefault(),A.focus()))};return l.addEventListener("keydown",x),A.focus(),()=>{l.removeEventListener("keydown",x)}},[]),o.createElement(i.AlertDialog.Portal,{container:_,forceMount:K},o.createElement(W.Theme,{asChild:!0},o.createElement(i.AlertDialog.Overlay,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},o.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},o.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${O}`},o.createElement(i.AlertDialog.Content,{...j,ref:q,className:(0,k.default)("rt-BaseDialogContent","rt-AlertDialogContent",S),"data-material":E,"data-panel-background":E,tabIndex:-1,role:"alertdialog","aria-modal":"true","aria-describedby":"alert-dialog-description"}),o.createElement("div",{"aria-live":"assertive","aria-atomic":"true",className:"rt-sr-only",id:"alert-dialog-announcement"}))))))});P.displayName="AlertDialog.Content";const u=o.forwardRef((e,t)=>o.createElement(i.AlertDialog.Title,{asChild:!0},o.createElement(w.Heading,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));u.displayName="AlertDialog.Title";const C=o.forwardRef((e,t)=>o.createElement(i.AlertDialog.Description,{asChild:!0},o.createElement(M.Text,{as:"p",size:"3",...e,asChild:!1,ref:t})));C.displayName="AlertDialog.Description";const y=o.forwardRef(({children:e,...t},r)=>o.createElement(i.AlertDialog.Action,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));y.displayName="AlertDialog.Action";const v=o.forwardRef(({children:e,...t},r)=>o.createElement(i.AlertDialog.Cancel,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));v.displayName="AlertDialog.Cancel";
1
+ "use strict";var z=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var r in t)m(e,r,{get:t[r],enumerable:!0})},N=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of I(t))!V.call(e,a)&&a!==r&&m(e,a,{get:()=>t[a],enumerable:!(s=F(t,a))||s.enumerable});return e};var b=(e,t,r)=>(r=e!=null?z(U(e)):{},N(t||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e)),G=e=>N(m({},"__esModule",{value:!0}),e);var J={};$(J,{Action:()=>y,Cancel:()=>v,Content:()=>P,Description:()=>C,Root:()=>f,Title:()=>u,Trigger:()=>d});module.exports=G(J);var o=b(require("react")),k=b(require("classnames")),l=require("radix-ui"),B=require("./alert-dialog.props.js"),w=require("./heading.js"),M=require("./text.js"),W=require("./theme.js"),n=require("../helpers/extract-props.js"),c=require("../helpers/require-react-element.js");const f=e=>o.createElement(l.AlertDialog.Root,{...e});f.displayName="AlertDialog.Root";const d=o.forwardRef(({children:e,...t},r)=>o.createElement(l.AlertDialog.Trigger,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));d.displayName="AlertDialog.Trigger";const P=o.forwardRef(({align:e,...t},r)=>{const{align:s,panelBackground:a,material:H,...L}=B.alertDialogContentPropDefs,{className:O}=(0,n.extractProps)({align:e},{align:s}),{panelBackground:T}=(0,n.extractProps)({panelBackground:t.panelBackground},{panelBackground:a}),{material:D}=(0,n.extractProps)({material:t.material},{material:H}),E=o.useMemo(()=>(D!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),D??T),[D,T]),{className:S,forceMount:K,container:_,panelBackground:Q,material:X,...j}=(0,n.extractProps)(t,L),h=o.useRef(null),q=o.useMemo(()=>i=>{h.current=i,typeof r=="function"?r(i):r&&(r.current=i)},[r]);return o.useEffect(()=>{if(typeof window>"u")return;const i=h.current;if(!i)return;const p=i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(p.length===0)return;const A=p[0],R=p[p.length-1],x=g=>{g.key==="Tab"&&(g.shiftKey?document.activeElement===A&&(g.preventDefault(),R.focus()):document.activeElement===R&&(g.preventDefault(),A.focus()))};return i.addEventListener("keydown",x),A.focus(),()=>{i.removeEventListener("keydown",x)}},[]),o.createElement(l.AlertDialog.Portal,{container:_,forceMount:K},o.createElement(W.Theme,{asChild:!0},o.createElement(l.AlertDialog.Overlay,{className:"rt-BaseDialogOverlay rt-AlertDialogOverlay"},o.createElement("div",{className:"rt-BaseDialogScroll rt-AlertDialogScroll"},o.createElement("div",{className:`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${O}`},o.createElement(l.AlertDialog.Content,{...j,ref:q,className:(0,k.default)("rt-BaseDialogContent","rt-AlertDialogContent",S),"data-material":E,"data-panel-background":E,tabIndex:-1,role:"alertdialog","aria-modal":"true","aria-describedby":"alert-dialog-description",onCloseAutoFocus:i=>{i.preventDefault(),document.body.style.pointerEvents=""}}),o.createElement("div",{"aria-live":"assertive","aria-atomic":"true",className:"rt-sr-only",id:"alert-dialog-announcement"}))))))});P.displayName="AlertDialog.Content";const u=o.forwardRef((e,t)=>o.createElement(l.AlertDialog.Title,{asChild:!0},o.createElement(w.Heading,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:t})));u.displayName="AlertDialog.Title";const C=o.forwardRef((e,t)=>o.createElement(l.AlertDialog.Description,{asChild:!0},o.createElement(M.Text,{as:"p",size:"3",...e,asChild:!1,ref:t})));C.displayName="AlertDialog.Description";const y=o.forwardRef(({children:e,...t},r)=>o.createElement(l.AlertDialog.Action,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));y.displayName="AlertDialog.Action";const v=o.forwardRef(({children:e,...t},r)=>o.createElement(l.AlertDialog.Cancel,{...t,ref:r,asChild:!0},(0,c.requireReactElement)(e)));v.displayName="AlertDialog.Cancel";
2
2
  //# sourceMappingURL=alert-dialog.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/alert-dialog.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\n\nimport { alertDialogContentPropDefs } from './alert-dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { AlertDialogContentOwnProps } from './alert-dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface AlertDialogRootProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root> {}\nconst AlertDialogRoot: React.FC<AlertDialogRootProps> = (props) => (\n <AlertDialogPrimitive.Root {...props} />\n);\nAlertDialogRoot.displayName = 'AlertDialog.Root';\n\ntype AlertDialogTriggerElement = React.ElementRef<typeof AlertDialogPrimitive.Trigger>;\ninterface AlertDialogTriggerProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Trigger, RemovedProps> {}\nconst AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Trigger>\n ),\n);\nAlertDialogTrigger.displayName = 'AlertDialog.Trigger';\n\ntype AlertDialogContentElement = React.ElementRef<typeof AlertDialogPrimitive.Content>;\ninterface AlertDialogContentProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Content, RemovedProps>,\n AlertDialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Portal>['container'];\n}\nconst AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = alertDialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <AlertDialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <AlertDialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-AlertDialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-AlertDialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${alignClassName}`}\n >\n <AlertDialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-AlertDialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-describedby=\"alert-dialog-description\"\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"alert-dialog-announcement\"\n />\n </div>\n </div>\n </AlertDialogPrimitive.Overlay>\n </Theme>\n </AlertDialogPrimitive.Portal>\n );\n },\n);\nAlertDialogContent.displayName = 'AlertDialog.Content';\n\ntype AlertDialogTitleElement = React.ElementRef<typeof Heading>;\ntype AlertDialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(\n (props, forwardedRef) => (\n <AlertDialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Title>\n ),\n);\nAlertDialogTitle.displayName = 'AlertDialog.Title';\n\ntype AlertDialogDescriptionElement = HTMLParagraphElement;\ntype AlertDialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props, forwardedRef) => (\n <AlertDialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Description>\n));\nAlertDialogDescription.displayName = 'AlertDialog.Description';\n\ntype AlertDialogActionElement = React.ElementRef<typeof AlertDialogPrimitive.Action>;\ninterface AlertDialogActionProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Action, RemovedProps> {}\nconst AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Action {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Action>\n ),\n);\nAlertDialogAction.displayName = 'AlertDialog.Action';\n\ntype AlertDialogCancelElement = React.ElementRef<typeof AlertDialogPrimitive.Cancel>;\ninterface AlertDialogCancelProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Cancel, RemovedProps> {}\nconst AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Cancel {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Cancel>\n ),\n);\nAlertDialogCancel.displayName = 'AlertDialog.Cancel';\n\nexport {\n AlertDialogRoot as Root,\n AlertDialogTrigger as Trigger,\n AlertDialogContent as Content,\n AlertDialogTitle as Title,\n AlertDialogDescription as Description,\n AlertDialogAction as Action,\n AlertDialogCancel as Cancel,\n};\n\nexport type {\n AlertDialogRootProps as RootProps,\n AlertDialogTriggerProps as TriggerProps,\n AlertDialogContentProps as ContentProps,\n AlertDialogTitleProps as TitleProps,\n AlertDialogDescriptionProps as DescriptionProps,\n AlertDialogActionProps as ActionProps,\n AlertDialogCancelProps as CancelProps,\n};\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,WAAAC,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAT,GAAA,IAAAU,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAoD,oBAEpDC,EAA2C,mCAC3CC,EAAwB,wBACxBC,EAAqB,qBACrBC,EAAsB,sBACtBC,EAA6B,uCAC7BC,EAAoC,+CAWpC,MAAMZ,EAAmDa,GACvDT,EAAA,cAAC,EAAAU,YAAqB,KAArB,CAA2B,GAAGD,EAAO,EAExCb,EAAgB,YAAc,mBAK9B,MAAME,EAAqBE,EAAM,WAC/B,CAAC,CAAE,SAAAW,EAAU,GAAGF,CAAM,EAAGG,IACvBZ,EAAA,cAAC,EAAAU,YAAqB,QAArB,CAA8B,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAChE,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAb,EAAmB,YAAc,sBAQjC,MAAMJ,EAAqBM,EAAM,WAC/B,CAAC,CAAE,MAAAa,EAAO,GAAGJ,CAAM,EAAGG,IAAiB,CACrC,KAAM,CACJ,MAAOE,EACP,gBAAiBC,EACjB,SAAUC,EACV,GAAGC,CACL,EAAI,6BAEE,CAAE,UAAWC,CAAe,KAAI,gBAAa,CAAE,MAAAL,CAAM,EAAG,CAAE,MAAOC,CAAa,CAAC,EAG/E,CAA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AnB,EAAkB,YAAc,qBAKhC,MAAMC,EAAoBO,EAAM,WAC9B,CAAC,CAAE,SAAAW,EAAU,GAAGF,CAAM,EAAGG,IACvBZ,EAAA,cAAC,EAAAU,YAAqB,OAArB,CAA6B,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAC/D,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAlB,EAAkB,YAAc",
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\n\nimport { alertDialogContentPropDefs } from './alert-dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { AlertDialogContentOwnProps } from './alert-dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface AlertDialogRootProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root> {}\nconst AlertDialogRoot: React.FC<AlertDialogRootProps> = (props) => (\n <AlertDialogPrimitive.Root {...props} />\n);\nAlertDialogRoot.displayName = 'AlertDialog.Root';\n\ntype AlertDialogTriggerElement = React.ElementRef<typeof AlertDialogPrimitive.Trigger>;\ninterface AlertDialogTriggerProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Trigger, RemovedProps> {}\nconst AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Trigger>\n ),\n);\nAlertDialogTrigger.displayName = 'AlertDialog.Trigger';\n\ntype AlertDialogContentElement = React.ElementRef<typeof AlertDialogPrimitive.Content>;\ninterface AlertDialogContentProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Content, RemovedProps>,\n AlertDialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Portal>['container'];\n}\nconst AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = alertDialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <AlertDialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <AlertDialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-AlertDialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-AlertDialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-AlertDialogScrollPadding ${alignClassName}`}\n >\n <AlertDialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-AlertDialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-describedby=\"alert-dialog-description\"\n onCloseAutoFocus={(event) => {\n // Prevent default focus behavior\n event.preventDefault();\n // Restore pointer-events to body (Radix UI fix for issue #1241)\n document.body.style.pointerEvents = '';\n }}\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"alert-dialog-announcement\"\n />\n </div>\n </div>\n </AlertDialogPrimitive.Overlay>\n </Theme>\n </AlertDialogPrimitive.Portal>\n );\n },\n);\nAlertDialogContent.displayName = 'AlertDialog.Content';\n\ntype AlertDialogTitleElement = React.ElementRef<typeof Heading>;\ntype AlertDialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(\n (props, forwardedRef) => (\n <AlertDialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Title>\n ),\n);\nAlertDialogTitle.displayName = 'AlertDialog.Title';\n\ntype AlertDialogDescriptionElement = HTMLParagraphElement;\ntype AlertDialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props, forwardedRef) => (\n <AlertDialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Description>\n));\nAlertDialogDescription.displayName = 'AlertDialog.Description';\n\ntype AlertDialogActionElement = React.ElementRef<typeof AlertDialogPrimitive.Action>;\ninterface AlertDialogActionProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Action, RemovedProps> {}\nconst AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Action {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Action>\n ),\n);\nAlertDialogAction.displayName = 'AlertDialog.Action';\n\ntype AlertDialogCancelElement = React.ElementRef<typeof AlertDialogPrimitive.Cancel>;\ninterface AlertDialogCancelProps\n extends ComponentPropsWithout<typeof AlertDialogPrimitive.Cancel, RemovedProps> {}\nconst AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(\n ({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Cancel {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Cancel>\n ),\n);\nAlertDialogCancel.displayName = 'AlertDialog.Cancel';\n\nexport {\n AlertDialogRoot as Root,\n AlertDialogTrigger as Trigger,\n AlertDialogContent as Content,\n AlertDialogTitle as Title,\n AlertDialogDescription as Description,\n AlertDialogAction as Action,\n AlertDialogCancel as Cancel,\n};\n\nexport type {\n AlertDialogRootProps as RootProps,\n AlertDialogTriggerProps as TriggerProps,\n AlertDialogContentProps as ContentProps,\n AlertDialogTitleProps as TitleProps,\n AlertDialogDescriptionProps as DescriptionProps,\n AlertDialogActionProps as ActionProps,\n AlertDialogCancelProps as CancelProps,\n};\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,WAAAC,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAT,GAAA,IAAAU,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAoD,oBAEpDC,EAA2C,mCAC3CC,EAAwB,wBACxBC,EAAqB,qBACrBC,EAAsB,sBACtBC,EAA6B,uCAC7BC,EAAoC,+CAWpC,MAAMZ,EAAmDa,GACvDT,EAAA,cAAC,EAAAU,YAAqB,KAArB,CAA2B,GAAGD,EAAO,EAExCb,EAAgB,YAAc,mBAK9B,MAAME,EAAqBE,EAAM,WAC/B,CAAC,CAAE,SAAAW,EAAU,GAAGF,CAAM,EAAGG,IACvBZ,EAAA,cAAC,EAAAU,YAAqB,QAArB,CAA8B,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAChE,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAb,EAAmB,YAAc,sBAQjC,MAAMJ,EAAqBM,EAAM,WAC/B,CAAC,CAAE,MAAAa,EAAO,GAAGJ,CAAM,EAAGG,IAAiB,CACrC,KAAM,CACJ,MAAOE,EACP,gBAAiBC,EACjB,SAAUC,EACV,GAAGC,CACL,EAAI,6BAEE,CAAE,UAAWC,CAAe,KAAI,gBAAa,CAAE,MAAAL,CAAM,EAAG,CAAE,MAAOC,CAAa,CAAC,EAG/E,CAAE,gBAAiBK,CAAyB,KAAI,gBACpD,CAAE,gBAAiBV,EAAM,eAAgB,EACzC,CAAE,gBAAiBM,CAAuB,CAC5C,EAEM,CAAE,SAAUK,CAAkB,KAAI,gBACtC,CAAE,SAAUX,EAAM,QAAS,EAC3B,CAAE,SAAUO,CAAgB,CAC9B,EAGMK,EAAgBrB,EAAM,QAAQ,KA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AGD,EAAO,IAAKG,EAAc,QAAO,OAC/D,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAlB,EAAkB,YAAc",
6
6
  "names": ["alert_dialog_exports", "__export", "AlertDialogAction", "AlertDialogCancel", "AlertDialogContent", "AlertDialogDescription", "AlertDialogRoot", "AlertDialogTitle", "AlertDialogTrigger", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_alert_dialog_props", "import_heading", "import_text", "import_theme", "import_extract_props", "import_require_react_element", "props", "AlertDialogPrimitive", "children", "forwardedRef", "align", "alignPropDef", "panelBackgroundPropDef", "materialPropDef", "propDefs", "alignClassName", "extractedPanelBackground", "extractedMaterial", "materialValue", "className", "forceMount", "container", "_", "__", "contentProps", "contentRef", "combinedRef", "node", "content", "focusableElements", "firstElement", "lastElement", "handleKeyDown", "event", "classNames"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAMjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,UAAU,eAAgB,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC;CAAG;AAChG,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAAwD,CAAC;AAInG,UAAU,kBACR,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,OAAO,EAAE,YAAY,CAAC;CAAG;AAChF,QAAA,MAAM,aAA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CAAC;AAEF,YAAY,EACV,eAAe,IAAI,SAAS,EAC5B,kBAAkB,IAAI,YAAY,EAClC,kBAAkB,IAAI,YAAY,EAClC,gBAAgB,IAAI,UAAU,EAC9B,sBAAsB,IAAI,gBAAgB,EAC1C,gBAAgB,IAAI,UAAU,GAC/B,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var z=Object.create;var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var $=(e,o)=>{for(var i in o)m(e,i,{get:o[i],enumerable:!0})},N=(e,o,i,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of I(o))!V.call(e,n)&&n!==i&&m(e,n,{get:()=>o[n],enumerable:!(s=F(o,n))||s.enumerable});return e};var B=(e,o,i)=>(i=e!=null?z(U(e)):{},N(o||!e||!e.__esModule?m(i,"default",{value:e,enumerable:!0}):i,e)),G=e=>N(m({},"__esModule",{value:!0}),e);var J={};$(J,{Close:()=>v,Content:()=>u,Description:()=>y,Root:()=>d,Title:()=>C,Trigger:()=>P});module.exports=G(J);var t=B(require("react")),k=B(require("classnames")),a=require("radix-ui"),b=require("./dialog.props.js"),w=require("./heading.js"),M=require("./text.js"),H=require("./theme.js"),l=require("../helpers/extract-props.js"),f=require("../helpers/require-react-element.js"),W=require("../hooks/use-body-pointer-events-cleanup.js");const d=e=>t.createElement(a.Dialog.Root,{...e,modal:!0});d.displayName="Dialog.Root";const P=t.forwardRef(({children:e,...o},i)=>t.createElement(a.Dialog.Trigger,{...o,ref:i,asChild:!0},(0,f.requireReactElement)(e)));P.displayName="Dialog.Trigger";const u=t.forwardRef(({align:e,...o},i)=>{const{align:s,panelBackground:n,material:L,...O}=b.dialogContentPropDefs,{className:S}=(0,l.extractProps)({align:e},{align:s}),{panelBackground:T}=(0,l.extractProps)({panelBackground:o.panelBackground},{panelBackground:n}),{material:D}=(0,l.extractProps)({material:o.material},{material:L}),E=t.useMemo(()=>(D!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),D??T),[D,T]),{className:A,forceMount:K,container:_,panelBackground:Q,material:X,...j}=(0,l.extractProps)(o,O),h=t.useRef(null),q=t.useMemo(()=>r=>{h.current=r,typeof i=="function"?i(r):i&&(i.current=r)},[i]);return(0,W.useBodyPointerEventsCleanup)(),t.useEffect(()=>{if(typeof window>"u")return;const r=h.current;if(!r)return;const p=r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(p.length===0)return;const c=p[0],R=p[p.length-1],x=g=>{g.key==="Tab"&&(g.shiftKey?document.activeElement===c&&(g.preventDefault(),R.focus()):document.activeElement===R&&(g.preventDefault(),c.focus()))};return r.addEventListener("keydown",x),c.focus(),()=>{r.removeEventListener("keydown",x)}},[]),t.createElement(a.Dialog.Portal,{container:_,forceMount:K},t.createElement(H.Theme,{asChild:!0},t.createElement(a.Dialog.Overlay,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},t.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},t.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${S}`},t.createElement(a.Dialog.Content,{...j,ref:q,className:(0,k.default)("rt-BaseDialogContent","rt-DialogContent",A),"data-material":E,"data-panel-background":E,tabIndex:-1,role:"dialog","aria-modal":"true"}),t.createElement("div",{"aria-live":"polite","aria-atomic":"true",className:"rt-sr-only",id:"dialog-announcement"}))))))});u.displayName="Dialog.Content";const C=t.forwardRef((e,o)=>t.createElement(a.Dialog.Title,{asChild:!0},t.createElement(w.Heading,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:o})));C.displayName="Dialog.Title";const y=t.forwardRef((e,o)=>t.createElement(a.Dialog.Description,{asChild:!0},t.createElement(M.Text,{as:"p",size:"3",...e,asChild:!1,ref:o})));y.displayName="Dialog.Description";const v=t.forwardRef(({children:e,...o},i)=>t.createElement(a.Dialog.Close,{...o,ref:i,asChild:!0},(0,f.requireReactElement)(e)));v.displayName="Dialog.Close";
1
+ "use strict";var z=Object.create;var g=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var U=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var $=(e,o)=>{for(var i in o)g(e,i,{get:o[i],enumerable:!0})},N=(e,o,i,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of I(o))!V.call(e,n)&&n!==i&&g(e,n,{get:()=>o[n],enumerable:!(s=F(o,n))||s.enumerable});return e};var B=(e,o,i)=>(i=e!=null?z(U(e)):{},N(o||!e||!e.__esModule?g(i,"default",{value:e,enumerable:!0}):i,e)),G=e=>N(g({},"__esModule",{value:!0}),e);var J={};$(J,{Close:()=>v,Content:()=>u,Description:()=>y,Root:()=>d,Title:()=>C,Trigger:()=>P});module.exports=G(J);var t=B(require("react")),k=B(require("classnames")),a=require("radix-ui"),b=require("./dialog.props.js"),w=require("./heading.js"),M=require("./text.js"),H=require("./theme.js"),l=require("../helpers/extract-props.js"),f=require("../helpers/require-react-element.js"),W=require("../hooks/use-body-pointer-events-cleanup.js");const d=e=>t.createElement(a.Dialog.Root,{...e,modal:!0});d.displayName="Dialog.Root";const P=t.forwardRef(({children:e,...o},i)=>t.createElement(a.Dialog.Trigger,{...o,ref:i,asChild:!0},(0,f.requireReactElement)(e)));P.displayName="Dialog.Trigger";const u=t.forwardRef(({align:e,...o},i)=>{const{align:s,panelBackground:n,material:L,...O}=b.dialogContentPropDefs,{className:S}=(0,l.extractProps)({align:e},{align:s}),{panelBackground:T}=(0,l.extractProps)({panelBackground:o.panelBackground},{panelBackground:n}),{material:D}=(0,l.extractProps)({material:o.material},{material:L}),E=t.useMemo(()=>(D!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead."),D??T),[D,T]),{className:A,forceMount:K,container:_,panelBackground:Q,material:X,...j}=(0,l.extractProps)(o,O),h=t.useRef(null),q=t.useMemo(()=>r=>{h.current=r,typeof i=="function"?i(r):i&&(i.current=r)},[i]);return(0,W.useBodyPointerEventsCleanup)(),t.useEffect(()=>{if(typeof window>"u")return;const r=h.current;if(!r)return;const p=r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(p.length===0)return;const c=p[0],R=p[p.length-1],x=m=>{m.key==="Tab"&&(m.shiftKey?document.activeElement===c&&(m.preventDefault(),R.focus()):document.activeElement===R&&(m.preventDefault(),c.focus()))};return r.addEventListener("keydown",x),c.focus(),()=>{r.removeEventListener("keydown",x)}},[]),t.createElement(a.Dialog.Portal,{container:_,forceMount:K},t.createElement(H.Theme,{asChild:!0},t.createElement(a.Dialog.Overlay,{className:"rt-BaseDialogOverlay rt-DialogOverlay"},t.createElement("div",{className:"rt-BaseDialogScroll rt-DialogScroll"},t.createElement("div",{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${S}`},t.createElement(a.Dialog.Content,{...j,ref:q,className:(0,k.default)("rt-BaseDialogContent","rt-DialogContent",A),"data-material":E,"data-panel-background":E,tabIndex:-1,role:"dialog","aria-modal":"true",onCloseAutoFocus:r=>{r.preventDefault(),document.body.style.pointerEvents=""}}),t.createElement("div",{"aria-live":"polite","aria-atomic":"true",className:"rt-sr-only",id:"dialog-announcement"}))))))});u.displayName="Dialog.Content";const C=t.forwardRef((e,o)=>t.createElement(a.Dialog.Title,{asChild:!0},t.createElement(w.Heading,{size:"5",mb:"3",trim:"start",...e,asChild:!1,ref:o})));C.displayName="Dialog.Title";const y=t.forwardRef((e,o)=>t.createElement(a.Dialog.Description,{asChild:!0},t.createElement(M.Text,{as:"p",size:"3",...e,asChild:!1,ref:o})));y.displayName="Dialog.Description";const v=t.forwardRef(({children:e,...o},i)=>t.createElement(a.Dialog.Close,{...o,ref:i,asChild:!0},(0,f.requireReactElement)(e)));v.displayName="Dialog.Close";
2
2
  //# sourceMappingURL=dialog.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/dialog.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface DialogRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst DialogRoot: React.FC<DialogRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nDialogRoot.displayName = 'Dialog.Root';\n\ntype DialogTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\ninterface DialogTriggerProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'Dialog.Trigger';\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface DialogContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n DialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = dialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Cleanup stuck pointer-events on body\n useBodyPointerEventsCleanup();\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-DialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-DialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${alignClassName}`}\n >\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-DialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"dialog-announcement\"\n />\n </div>\n </div>\n </DialogPrimitive.Overlay>\n </Theme>\n </DialogPrimitive.Portal>\n );\n },\n);\nDialogContent.displayName = 'Dialog.Content';\n\ntype DialogTitleElement = React.ElementRef<typeof Heading>;\ntype DialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Title>\n ),\n);\nDialogTitle.displayName = 'Dialog.Title';\n\ntype DialogDescriptionElement = HTMLParagraphElement;\ntype DialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Description>\n ),\n);\nDialogDescription.displayName = 'Dialog.Description';\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface DialogCloseProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n ),\n);\nDialogClose.displayName = 'Dialog.Close';\n\nexport {\n DialogRoot as Root,\n DialogTrigger as Trigger,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\n\nexport type {\n DialogRootProps as RootProps,\n DialogTriggerProps as TriggerProps,\n DialogContentProps as ContentProps,\n DialogTitleProps as TitleProps,\n DialogDescriptionProps as DescriptionProps,\n DialogCloseProps as CloseProps,\n};\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA0C,oBAE1CC,EAAsC,6BACtCC,EAAwB,wBACxBC,EAAqB,qBACrBC,EAAsB,sBACtBC,EAA6B,uCAC7BC,EAAoC,+CACpCC,EAA4C,uDAU5C,MAAMb,EAAyCc,GAAUV,EAAA,cAAC,EAAAW,OAAgB,KAAhB,CAAsB,GAAGD,EAAO,MAAK,GAAC,EAChGd,EAAW,YAAc,cAKzB,MAAME,EAAgBE,EAAM,WAC1B,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAAC,EAAAW,OAAgB,QAAhB,CAAyB,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAC3D,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAd,EAAc,YAAc,iBAQ5B,MAAMJ,EAAgBM,EAAM,WAC1B,CAAC,CAAE,MAAAc,EAAO,GAAGJ,CAAM,EAAGG,IAAiB,CACrC,KAAM,CACJ,MAAOE,EACP,gBAAiBC,EACjB,SAAUC,EACV,GAAGC,CACL,EAAI,wBAEE,CAAE,UAAWC,CAAe,K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,EAAO,IAAKG,EAAc,QAAO,OACzD,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAnB,EAAY,YAAc",
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface DialogRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst DialogRoot: React.FC<DialogRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nDialogRoot.displayName = 'Dialog.Root';\n\ntype DialogTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\ninterface DialogTriggerProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'Dialog.Trigger';\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface DialogContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n DialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = dialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Cleanup stuck pointer-events on body\n useBodyPointerEventsCleanup();\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-DialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-DialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${alignClassName}`}\n >\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-DialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n onCloseAutoFocus={(event) => {\n // Prevent default focus behavior\n event.preventDefault();\n // Restore pointer-events to body (Radix UI fix for issue #1241)\n document.body.style.pointerEvents = '';\n }}\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"dialog-announcement\"\n />\n </div>\n </div>\n </DialogPrimitive.Overlay>\n </Theme>\n </DialogPrimitive.Portal>\n );\n },\n);\nDialogContent.displayName = 'Dialog.Content';\n\ntype DialogTitleElement = React.ElementRef<typeof Heading>;\ntype DialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Title>\n ),\n);\nDialogTitle.displayName = 'Dialog.Title';\n\ntype DialogDescriptionElement = HTMLParagraphElement;\ntype DialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Description>\n ),\n);\nDialogDescription.displayName = 'Dialog.Description';\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface DialogCloseProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n ),\n);\nDialogClose.displayName = 'Dialog.Close';\n\nexport {\n DialogRoot as Root,\n DialogTrigger as Trigger,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\n\nexport type {\n DialogRootProps as RootProps,\n DialogTriggerProps as TriggerProps,\n DialogContentProps as ContentProps,\n DialogTitleProps as TitleProps,\n DialogDescriptionProps as DescriptionProps,\n DialogCloseProps as CloseProps,\n};\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA0C,oBAE1CC,EAAsC,6BACtCC,EAAwB,wBACxBC,EAAqB,qBACrBC,EAAsB,sBACtBC,EAA6B,uCAC7BC,EAAoC,+CACpCC,EAA4C,uDAU5C,MAAMb,EAAyCc,GAAUV,EAAA,cAAC,EAAAW,OAAgB,KAAhB,CAAsB,GAAGD,EAAO,MAAK,GAAC,EAChGd,EAAW,YAAc,cAKzB,MAAME,EAAgBE,EAAM,WAC1B,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAAC,EAAAW,OAAgB,QAAhB,CAAyB,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAC3D,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAd,EAAc,YAAc,iBAQ5B,MAAMJ,EAAgBM,EAA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,cAAC,QAAK,GAAG,IAAI,KAAK,IAAK,GAAGU,EAAO,QAAS,GAAO,IAAKG,EAAc,CACtE,CAEJ,EACAlB,EAAkB,YAAc,qBAKhC,MAAMF,EAAcO,EAAM,WACxB,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAAC,EAAAW,OAAgB,MAAhB,CAAuB,GAAGD,EAAO,IAAKG,EAAc,QAAO,OACzD,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAnB,EAAY,YAAc",
6
6
  "names": ["dialog_exports", "__export", "DialogClose", "DialogContent", "DialogDescription", "DialogRoot", "DialogTitle", "DialogTrigger", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_dialog_props", "import_heading", "import_text", "import_theme", "import_extract_props", "import_require_react_element", "import_use_body_pointer_events_cleanup", "props", "DialogPrimitive", "children", "forwardedRef", "align", "alignPropDef", "panelBackgroundPropDef", "materialPropDef", "propDefs", "alignClassName", "extractedPanelBackground", "extractedMaterial", "materialValue", "className", "forceMount", "container", "_", "__", "contentProps", "contentRef", "combinedRef", "node", "content", "focusableElements", "firstElement", "lastElement", "handleKeyDown", "event", "classNames"]
7
7
  }
@@ -110,7 +110,7 @@ type SidebarComponent = React.ForwardRefExoticComponent<(Omit<PaneProps, 'mode'
110
110
  defaultMode?: ResponsiveSidebarMode;
111
111
  onModeChange?: (mode: SidebarMode) => void;
112
112
  thinSize?: number;
113
- toggleModes?: Array<'thin' | 'expanded'>;
113
+ toggleModes?: 'both' | 'single';
114
114
  }) & React.RefAttributes<HTMLDivElement>> & {
115
115
  Handle: HandleComponent;
116
116
  };
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/components/shell.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,KAAK,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AACzD,KAAK,sBAAsB,GACvB,iB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1,2 @@
1
- "use strict";"use client";var Ce=Object.create;var fe=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Be=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty;var Le=(a,i)=>{for(var r in i)fe(a,r,{get:i[r],enumerable:!0})},ge=(a,i,r,u)=>{if(i&&typeof i=="object"||typeof i=="function")for(let R of we(i))!He.call(a,R)&&R!==r&&fe(a,R,{get:()=>i[R],enumerable:!(u=Te(i,R))||u.enumerable});return a};var Se=(a,i,r)=>(r=a!=null?Ce(Be(a)):{},ge(i||!a||!a.__esModule?fe(r,"default",{value:a,enumerable:!0}):r,a)),Ne=a=>ge(fe({},"__esModule",{value:!0}),a);var De={};Le(De,{Bottom:()=>ue,Content:()=>Pe,Header:()=>Me,Inspector:()=>pe,Left:()=>he,Panel:()=>te,Rail:()=>ae,Root:()=>ke,Sidebar:()=>se,Trigger:()=>Ee,useResponsivePresentation:()=>re,useShell:()=>Q});module.exports=Ne(De);var e=Se(require("react")),J=Se(require("classnames")),G=Se(require("./sheet.js")),$e=require("./inset.js"),ce=require("./visually-hidden.js");const le={xs:"(min-width: 520px)",sm:"(min-width: 768px)",md:"(min-width: 1024px)",lg:"(min-width: 1280px)",xl:"(min-width: 1640px)"},xe=e.createContext(null);function Q(){const a=e.useContext(xe);if(!a)throw new Error("Shell components must be used within <Shell.Root>");return a}const de=e.createContext(null);function Ae(){const a=e.useContext(de);if(!a)throw new Error("Shell.Handle must be used within a resizable pane");return a}const _=e.forwardRef(({className:a,children:i,...r},u)=>{const{containerRef:R,cssVarName:p,minSize:g,maxSize:h,defaultSize:P,orientation:b,edge:T,computeNext:L,onResize:o,onResizeStart:x,onResizeEnd:w,snapPoints:F,snapTolerance:q,collapseThreshold:K,collapsible:I,target:V,requestCollapse:U,requestToggle:k}=Ae(),f=e.useRef(null);e.useEffect(()=>()=>{try{f.current?.()}catch{}f.current=null},[]);const m=b;return e.createElement("div",{...r,ref:u,className:(0,J.default)("rt-ShellResizer",a),"data-orientation":b,"data-edge":T,role:"slider","aria-orientation":m,"aria-valuemin":g,"aria-valuemax":h,"aria-valuenow":P,tabIndex:0,onPointerDown:t=>{if(!R.current)return;t.preventDefault();const y=R.current,n=t.currentTarget,$=t.pointerId;try{f.current?.()}catch{}y.setAttribute("data-resizing","");try{n.setPointerCapture($)}catch{}const S=b==="vertical"?t.clientX:t.clientY,C=parseFloat(getComputedStyle(y).getPropertyValue(p)||`${P}`),M=s=>Math.min(Math.max(s,g),h),B=document.body,c=B.style.cursor,N=B.style.userSelect;B.style.cursor=b==="vertical"?"col-resize":"row-resize",B.style.userSelect="none",x?.(C);const z=s=>{const E=b==="vertical"?s.clientX:s.clientY,D=M(L(E,S,C));y.style.setProperty(p,`${D}px`),n.setAttribute("aria-valuenow",String(D)),o?.(D)},j=()=>{try{n.releasePointerCapture($)}catch{}window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",H),window.removeEventListener("keydown",v),n.removeEventListener("lostpointercapture",H),y.removeAttribute("data-resizing"),B.style.cursor=c,B.style.userSelect=N,f.current=null},H=()=>{const s=parseFloat(getComputedStyle(y).getPropertyValue(p)||`${P}`);let E=s;if(F&&F.length){const D=F.reduce((Z,X)=>Math.abs(X-s)<Math.abs(Z-s)?X:Z,F[0]);Math.abs(D-s)<=(q??8)&&(E=D,y.style.setProperty(p,`${E}px`),n.setAttribute("aria-valuenow",String(E)),o?.(E))}I&&typeof K=="number"&&s<=K&&U?.(),w?.(E),j()},v=s=>{s.key==="Escape"&&(y.style.setProperty(p,`${C}px`),n.setAttribute("aria-valuenow",String(C)),w?.(C),j())};window.addEventListener("pointermove",z),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",H),window.addEventListener("keydown",v),n.addEventListener("lostpointercapture",H),f.current=j},onDoubleClick:()=>{I&&k?.()},onKeyDown:t=>{if(!R.current)return;const y=R.current,n=parseFloat(getComputedStyle(y).getPropertyValue(p)||`${P}`),$=M=>Math.min(Math.max(M,g),h),S=t.shiftKey?32:8;let C=0;if(b==="vertical"?t.key==="ArrowRight"?C=S:t.key==="ArrowLeft"&&(C=-S):t.key==="ArrowDown"?C=S:t.key==="ArrowUp"&&(C=-S),t.key==="Home"){t.preventDefault(),x?.(n);const M=$(g);y.style.setProperty(p,`${M}px`),t.currentTarget.setAttribute("aria-valuenow",String(M)),o?.(M),w?.(M);return}if(t.key==="End"){t.preventDefault(),x?.(n);const M=$(h);y.style.setProperty(p,`${M}px`),t.currentTarget.setAttribute("aria-valuenow",String(M)),o?.(M),w?.(M);return}if(C!==0){t.preventDefault(),x?.(n);const M=$(n+(T==="start"&&b==="vertical"?-C:C));y.style.setProperty(p,`${M}px`),t.currentTarget.setAttribute("aria-valuenow",String(M)),o?.(M),w?.(M)}}},i)});_.displayName="Shell.Handle";const me=e.forwardRef((a,i)=>e.createElement(_,{...a,ref:i}));me.displayName="Shell.Panel.Handle";const ye=e.forwardRef((a,i)=>e.createElement(_,{...a,ref:i}));ye.displayName="Shell.Sidebar.Handle";const be=e.forwardRef((a,i)=>e.createElement(_,{...a,ref:i}));be.displayName="Shell.Inspector.Handle";const ve=e.forwardRef((a,i)=>e.createElement(_,{...a,ref:i}));ve.displayName="Shell.Bottom.Handle";function re(a){const{currentBreakpoint:i}=Q();return e.useMemo(()=>{if(typeof a=="string")return a;if(a[i])return a[i];const u=[...Object.keys(le)].reverse().concat("initial"),R=u.indexOf(i);for(let p=R+1;p<u.length;p++){const g=u[p];if(a[g])return a[g]}return"fixed"},[a,i])}function ze(){const[a,i]=e.useState("initial"),[r,u]=e.useState(!1);return e.useEffect(()=>{if(typeof window>"u")return;const p=Object.entries(le).map(([h,P])=>[h,window.matchMedia(P)]),g=()=>{const h=p.filter(([,b])=>b.matches).map(([b])=>b),P=h[h.length-1]??"initial";i(P),u(!0)};return g(),p.forEach(([,h])=>h.addEventListener("change",g)),()=>{p.forEach(([,h])=>h.removeEventListener("change",g))}},[]),{bp:a,ready:r}}const ke=e.forwardRef(({className:a,children:i,height:r="full",...u},R)=>{const{bp:p,ready:g}=ze(),[h,P]=e.useState("collapsed"),[b,T]=e.useState("collapsed"),[L,o]=e.useState("expanded"),[x,w]=e.useState("collapsed"),[F,q]=e.useState("collapsed"),[K,I]=e.useState(!1),[V,U]=e.useState(!1),k=e.useRef(l=>l==="collapsed"?"thin":l==="thin"?"expanded":"collapsed"),f=e.useCallback(l=>{k.current=l},[]);e.useEffect(()=>{h==="collapsed"&&T("collapsed")},[h]),e.useEffect(()=>{V&&K&&console.warn("Shell: Sidebar cannot coexist with Rail or Panel. Use either Rail+Panel OR Sidebar.")},[V,K]);const[m,t]=e.useState(void 0),y=e.useCallback(l=>t(l),[]),n=e.useRef(64),$=e.useRef(288),S=e.useCallback(l=>{n.current=l},[]),C=e.useCallback(l=>{$.current=l},[]),M=e.useMemo(()=>{const l=e.Children.toArray(i),W=(Y,ie)=>e.isValidElement(Y)&&(Y.type===ie||Y.type?.displayName===ie.displayName);return l.some(Y=>W(Y,ae)||W(Y,te))},[i]),B=e.useMemo(()=>{const l=e.Children.toArray(i),W=(Y,ie)=>e.isValidElement(Y)&&(Y.type===ie||Y.type?.displayName===ie.displayName);return l.some(Y=>W(Y,se))},[i]),c=e.useCallback(l=>{switch(l){case"left":case"rail":P(W=>W==="expanded"?"collapsed":"expanded");break;case"panel":h==="collapsed"?(P("expanded"),T("expanded")):T(W=>W==="expanded"?"collapsed":"expanded");break;case"sidebar":o(W=>k.current(W));break;case"inspector":w(W=>W==="expanded"?"collapsed":"expanded");break;case"bottom":q(W=>W==="expanded"?"collapsed":"expanded");break}},[h]),N=e.useCallback(l=>{switch(l){case"left":case"rail":P("expanded");break;case"panel":P("expanded"),T("expanded");break;case"sidebar":o("expanded");break;case"inspector":w("expanded");break;case"bottom":q("expanded");break}},[]),z=e.useCallback(l=>{switch(l){case"left":case"rail":P("collapsed");break;case"panel":T("collapsed");break;case"sidebar":o("collapsed");break;case"inspector":w("collapsed");break;case"bottom":q("collapsed");break}},[]),j=e.useMemo(()=>({leftMode:h,setLeftMode:P,panelMode:b,setPanelMode:T,sidebarMode:L,setSidebarMode:o,inspectorMode:x,setInspectorMode:w,bottomMode:F,setBottomMode:q,hasLeft:K,setHasLeft:I,hasSidebar:V,setHasSidebar:U,currentBreakpoint:p,currentBreakpointReady:g,leftResolvedPresentation:m,togglePane:c,expandPane:N,collapsePane:z,setSidebarToggleComputer:f,onLeftPres:y,onRailDefaults:S,onPanelDefaults:C}),[h,b,L,x,F,K,V,p,g,m,c,N,z,f,y,S,C]),H=e.Children.toArray(i),v=(l,W)=>e.isValidElement(l)&&(l.type===W||l.type?.displayName===W.displayName),s=H.filter(l=>v(l,Me)),E=H.filter(l=>v(l,ae)),D=H.filter(l=>v(l,te)),Z=H.filter(l=>v(l,se)),X=H.filter(l=>v(l,Pe)),ne=H.filter(l=>v(l,pe)),Re=H.filter(l=>v(l,ue)),d=e.useMemo(()=>r==="full"?{height:"100vh"}:r==="auto"?{height:"auto"}:typeof r=="string"?{height:r}:typeof r=="number"?{height:`${r}px`}:{},[r]),[O,A]=e.useState(null),oe=e.useCallback(l=>A(l),[]),ee=e.useCallback(()=>A(null),[]);return e.createElement("div",{...u,ref:R,className:(0,J.default)("rt-ShellRoot",a),style:{...d,...u.style}},e.createElement(xe.Provider,{value:{...j,peekTarget:O,setPeekTarget:A,peekPane:oe,clearPeek:ee}},s,e.createElement("div",{className:"rt-ShellBody","data-peek-target":O??void 0,style:O==="rail"||O==="panel"?{"--peek-rail-width":`${n.current}px`}:void 0},M&&!B?(()=>{const l=E[0],W=l?{mode:l.props?.mode,defaultMode:l.props?.defaultMode,onModeChange:l.props?.onModeChange,presentation:l.props?.presentation,collapsible:l.props?.collapsible,onExpand:l.props?.onExpand,onCollapse:l.props?.onCollapse}:{};return e.createElement(he,{...W},E,D)})():Z,X,ne),Re))});ke.displayName="Shell.Root";const Me=e.forwardRef(({className:a,height:i=64,style:r,...u},R)=>e.createElement("header",{...u,ref:R,className:(0,J.default)("rt-ShellHeader",a),style:{...r,"--shell-header-height":`${i}px`}}));Me.displayName="Shell.Header";const he=e.forwardRef(({className:a,presentation:i={initial:"overlay",sm:"fixed"},mode:r,defaultMode:u="collapsed",onModeChange:R,collapsible:p=!0,onExpand:g,onCollapse:h,children:P,style:b,...T},L)=>{const o=Q(),x=re(i),w=x==="overlay",F=x==="stacked",q=e.useRef(null);e.useEffect(()=>{o.onLeftPres?.(x)},[o,x]);const K=e.useCallback(k=>{q.current=k,typeof L=="function"?L(k):L&&(L.current=k)},[L]);e.useEffect(()=>(o.setHasLeft(!0),()=>o.setHasLeft(!1)),[o]);const I=e.useCallback(()=>{if(typeof u=="string")return u;const k=u;if(k&&k[o.currentBreakpoint])return k[o.currentBreakpoint];const m=[...Object.keys(le)].reverse().concat("initial"),t=m.indexOf(o.currentBreakpoint);for(let y=t+1;y<m.length;y++){const n=m[y];if(k&&k[n])return k[n]}return"collapsed"},[u,o.currentBreakpoint]),V=e.useRef(null);e.useEffect(()=>{if(r!==void 0||!o.currentBreakpointReady||V.current===o.currentBreakpoint)return;V.current=o.currentBreakpoint;const k=I();k!==o.leftMode&&o.setLeftMode(k)},[r,o.currentBreakpoint,o.currentBreakpointReady,I,o.leftMode,o.setLeftMode]),e.useEffect(()=>{r!==void 0&&o.leftMode!==r&&o.setLeftMode(r)},[r,o]),e.useEffect(()=>{r===void 0&&R?.(o.leftMode)},[o.leftMode,r,R]),e.useEffect(()=>{o.leftMode==="expanded"?g?.():h?.()},[o.leftMode,g,h]);const U=o.leftMode==="expanded";if(w){const k=o.leftMode==="expanded",f=e.Children.toArray(P),m=(B,c)=>e.isValidElement(B)&&B.type===c,t=f.find(B=>m(B,ae)),y=f.find(B=>m(B,te)),n=typeof t?.props?.expandedSize=="number"?t.props.expandedSize:64,$=typeof y?.props?.expandedSize=="number"?y.props.expandedSize:288,S=!!t,C=!!y,M=(S?n:0)+(o.panelMode==="expanded"&&C?$:0);return e.createElement(G.Root,{open:k,onOpenChange:B=>o.setLeftMode(B?"expanded":"collapsed")},e.createElement(G.Content,{side:"start",style:{padding:0},width:{initial:`${M}px`}},e.createElement(ce.VisuallyHidden,null,e.createElement(G.Title,null,"Navigation")),e.createElement("div",{className:"rt-ShellLeft"},P)))}if(F){const k=o.leftMode==="expanded",f=e.Children.toArray(P),m=(c,N)=>e.isValidElement(c)&&c.type===N,t=f.find(c=>m(c,ae)),y=f.find(c=>m(c,te)),n=typeof t?.props?.expandedSize=="number"?t.props.expandedSize:64,$=typeof y?.props?.expandedSize=="number"?y.props.expandedSize:288,S=!!t,M=!!y&&(o.panelMode==="expanded"||o.peekTarget==="panel"),B=(S?n:0)+(M?$:0);return e.createElement("div",{...T,ref:K,className:(0,J.default)("rt-ShellLeft",a),"data-mode":o.leftMode,"data-peek":o.peekTarget==="left"||o.peekTarget==="rail"||o.peekTarget==="panel"||void 0,"data-presentation":x,style:{...b},"data-open":k||void 0},P)}return e.createElement("div",{...T,ref:K,className:(0,J.default)("rt-ShellLeft",a),"data-mode":o.leftMode,"data-peek":o.peekTarget==="left"||o.peekTarget==="rail"||o.peekTarget==="panel"||void 0,"data-presentation":x,style:{...b}},P)});he.displayName="Shell.Left";const ae=e.forwardRef(({className:a,presentation:i,mode:r,defaultMode:u,onModeChange:R,expandedSize:p=64,collapsible:g,onExpand:h,onCollapse:P,children:b,style:T,...L},o)=>{const x=Q();e.useEffect(()=>{x.onRailDefaults?.(p)},[x,p]);const w=x.leftMode==="expanded";return e.createElement("div",{...L,ref:o,className:(0,J.default)("rt-ShellRail",a),"data-mode":x.leftMode,"data-peek":x.leftResolvedPresentation!=="overlay"&&x.peekTarget==="rail"||void 0,style:{...T,"--rail-size":`${p}px`}},e.createElement("div",{className:"rt-ShellRailContent","data-visible":w||x.leftResolvedPresentation!=="overlay"&&x.peekTarget==="rail"||void 0},b))});ae.displayName="Shell.Rail";const te=e.forwardRef(({className:a,mode:i,onModeChange:r,expandedSize:u=288,minSize:R,maxSize:p,resizable:g,collapsible:h=!0,onExpand:P,onCollapse:b,onResize:T,onResizeStart:L,onResizeEnd:o,snapPoints:x,snapTolerance:w,collapseThreshold:F,paneId:q,persistence:K,children:I,style:V,...U},k)=>{const f=Q();e.useEffect(()=>{f.onPanelDefaults?.(u)},[f,u]);const m=e.useRef(null),t=e.useCallback(c=>{m.current=c,typeof k=="function"?k(c):k&&(k.current=c)},[k]),y=e.Children.toArray(I),n=y.filter(c=>e.isValidElement(c)&&c.type===me),$=y.filter(c=>!(e.isValidElement(c)&&c.type===me)),S=f.leftResolvedPresentation==="overlay",C=e.useMemo(()=>{if(!q||K)return K;const c=`kookie-ui:shell:panel:${q}`;return{load:()=>{if(typeof window>"u")return;const z=window.localStorage.getItem(c);return z?Number(z):void 0},save:z=>{typeof window>"u"||window.localStorage.setItem(c,String(z))}}},[q,K]);e.useEffect(()=>{let c=!0;return(async()=>{if(!g||!C?.load||S)return;const N=await C.load();c&&typeof N=="number"&&m.current&&(m.current.style.setProperty("--panel-size",`${N}px`),T?.(N))})(),()=>{c=!1}},[g,C,T,S]),e.useEffect(()=>{m.current&&S&&m.current.style.setProperty("--panel-size",`${u}px`)},[S,u]),e.useEffect(()=>{if(m.current&&f.leftResolvedPresentation!=="overlay"&&f.leftMode==="expanded"&&f.panelMode==="expanded"){const c=m.current.parentElement||null;try{c?.style.removeProperty("width")}catch{}}},[f.leftResolvedPresentation,f.leftMode,f.panelMode]);const M=f.leftMode==="expanded"&&f.panelMode==="expanded",B=g&&f.leftResolvedPresentation!=="overlay"&&M?e.createElement(de.Provider,{value:{containerRef:m,cssVarName:"--panel-size",minSize:typeof R=="number"?R:100,maxSize:typeof p=="number"?p:800,defaultSize:u,orientation:"vertical",edge:"end",computeNext:(c,N,z)=>{const j=getComputedStyle(m.current).direction==="rtl",H=c-N;return z+(j?-H:H)},onResize:T,onResizeStart:c=>{const z=m.current?.parentElement;try{z?.style.removeProperty("width")}catch{}L?.(c)},onResizeEnd:c=>{o?.(c),C?.save?.(c)},target:"panel",collapsible:!!h,snapPoints:x,snapTolerance:w??8,collapseThreshold:F,requestCollapse:()=>f.setPanelMode("collapsed"),requestToggle:()=>f.togglePane("panel")}},n.length>0?n.map((c,N)=>e.cloneElement(c,{key:c.key??N})):e.createElement(_,null)):null;return e.createElement("div",{...U,ref:t,className:(0,J.default)("rt-ShellPanel",a),"data-mode":f.panelMode,"data-visible":M||f.leftResolvedPresentation!=="overlay"&&f.peekTarget==="panel"||void 0,"data-peek":f.leftResolvedPresentation!=="overlay"&&f.peekTarget==="panel"||void 0,style:{...V,"--panel-size":`${u}px`}},e.createElement("div",{className:"rt-ShellPanelContent","data-visible":M||void 0},$),B)});te.displayName="Shell.Panel",te.Handle=me;const se=e.forwardRef(({className:a,presentation:i={initial:"overlay",md:"fixed"},mode:r,defaultMode:u="expanded",onModeChange:R,expandedSize:p=288,minSize:g=200,maxSize:h=400,resizable:P=!1,collapsible:b=!0,onExpand:T,onCollapse:L,onResize:o,onResizeStart:x,onResizeEnd:w,snapPoints:F,snapTolerance:q,collapseThreshold:K,paneId:I,persistence:V,children:U,style:k,thinSize:f=64,toggleModes:m,...t},y)=>{const n=Q(),$=re(i),S=$==="overlay",C=$==="stacked",M=e.useRef(null),B=e.useCallback(d=>{M.current=d,typeof y=="function"?y(d):y&&(y.current=d)},[y]),c=e.Children.toArray(U),N=c.filter(d=>e.isValidElement(d)&&d.type===ye),z=c.filter(d=>!(e.isValidElement(d)&&d.type===ye)),j=e.useId();e.useEffect(()=>(n.setHasSidebar(!0),()=>{n.setHasSidebar(!1)}),[n,j]);const H=e.useRef(!1);e.useEffect(()=>{H.current||(H.current=!0,r===void 0&&n.sidebarMode!==u&&n.setSidebarMode(u))},[]),e.useEffect(()=>{r!==void 0&&n.sidebarMode!==r&&n.setSidebarMode(r)},[r,n]),e.useEffect(()=>{r===void 0&&R?.(n.sidebarMode)},[n.sidebarMode,r,R]),e.useEffect(()=>{n.sidebarMode==="expanded"?T?.():L?.()},[n.sidebarMode,T,L]);const v=n.sidebarMode!=="collapsed",s=e.useMemo(()=>{if(!I||V)return V;const d=`kookie-ui:shell:sidebar:${I}`;return{load:()=>{if(typeof window>"u")return;const A=window.localStorage.getItem(d);return A?Number(A):void 0},save:A=>{typeof window>"u"||window.localStorage.setItem(d,String(A))}}},[I,V]);e.useEffect(()=>{let d=!0;return(async()=>{if(!P||!s?.load||S)return;const O=await s.load();d&&typeof O=="number"&&M.current&&(M.current.style.setProperty("--sidebar-size",`${O}px`),o?.(O))})(),()=>{d=!1}},[P,s,o,S]);const E=Q();e.useEffect(()=>{if(!E.setSidebarToggleComputer)return;const d=m&&m.length>0?m:["thin","expanded"],O=A=>A==="collapsed"?d[0]??"expanded":A==="thin"?d.includes("thin")&&d.includes("expanded")?"expanded":"collapsed":d.length===2&&d.includes("thin")&&d.includes("expanded")?"collapsed":d.includes("thin")&&!d.includes("expanded")?"thin":"collapsed";return E.setSidebarToggleComputer(O),()=>{E.setSidebarToggleComputer?.(A=>A==="collapsed"?"thin":A==="thin"?"expanded":"collapsed")}},[E,m]);const D=e.useRef(p),Z=e.useRef("expanded");e.useEffect(()=>{n.sidebarMode!=="collapsed"&&(Z.current=n.sidebarMode,D.current=n.sidebarMode==="thin"?f:p)},[n.sidebarMode,f,p]);const X=e.useCallback(()=>{if(typeof u=="string")return u;const d=u;if(d&&d[n.currentBreakpoint])return d[n.currentBreakpoint];const A=[...Object.keys(le)].reverse().concat("initial"),oe=A.indexOf(n.currentBreakpoint);for(let ee=oe+1;ee<A.length;ee++){const l=A[ee];if(d&&d[l])return d[l]}return"collapsed"},[u,n.currentBreakpoint]),ne=e.useRef(null);e.useEffect(()=>{if(r!==void 0||!n.currentBreakpointReady||ne.current===n.currentBreakpoint)return;ne.current=n.currentBreakpoint;const d=X();d!==n.sidebarMode&&n.setSidebarMode(d)},[r,n.currentBreakpoint,n.currentBreakpointReady,X,n.sidebarMode,n.setSidebarMode]);const Re=P&&!S&&n.sidebarMode==="expanded"?e.createElement(de.Provider,{value:{containerRef:M,cssVarName:"--sidebar-size",minSize:g,maxSize:h,defaultSize:p,orientation:"vertical",edge:"end",computeNext:(d,O,A)=>{const oe=getComputedStyle(M.current).direction==="rtl",ee=d-O;return A+(oe?-ee:ee)},onResize:o,onResizeStart:x,onResizeEnd:d=>{w?.(d),s?.save?.(d)},target:"sidebar",collapsible:b,snapPoints:F,snapTolerance:q??8,collapseThreshold:K,requestCollapse:()=>n.setSidebarMode("collapsed"),requestToggle:()=>n.togglePane("sidebar")}},N.length>0?N.map((d,O)=>e.cloneElement(d,{key:d.key??O})):e.createElement(_,null)):null;if(S){const d=n.sidebarMode!=="collapsed";return e.createElement(G.Root,{open:d,onOpenChange:O=>n.setSidebarMode(O?"expanded":"collapsed")},e.createElement(G.Content,{side:"start",style:{padding:0},width:{initial:`${d?n.sidebarMode==="thin"?f:p:D.current}px`}},e.createElement(ce.VisuallyHidden,null,e.createElement(G.Title,null,"Sidebar")),z))}return e.createElement("div",{...t,ref:B,className:(0,J.default)("rt-ShellSidebar",a),"data-mode":n.sidebarMode,"data-peek":n.peekTarget==="sidebar"||void 0,"data-presentation":$,"data-open":C&&v||void 0,style:{...k,"--sidebar-size":`${p}px`,"--sidebar-thin-size":`${f}px`,"--sidebar-min-size":`${g}px`,"--sidebar-max-size":`${h}px`,...n.peekTarget==="sidebar"&&!S?(()=>{const d=m&&m.length>0?m:["thin","expanded"],O=n.sidebarMode;let A="collapsed";return O==="collapsed"?A=d[0]??"expanded":O==="thin"?A=d.includes("expanded")?"expanded":"collapsed":A=d.includes("thin")?"thin":"collapsed",{"--peek-sidebar-width":`${A==="thin"?f:p}px`}})():{}}},e.createElement("div",{className:"rt-ShellSidebarContent","data-visible":v||void 0},z),Re)});se.displayName="Shell.Sidebar",se.Handle=ye;const Pe=e.forwardRef(({className:a,...i},r)=>e.createElement("main",{...i,ref:r,className:(0,J.default)("rt-ShellContent",a)}));Pe.displayName="Shell.Content";const pe=e.forwardRef(({className:a,presentation:i={initial:"overlay",lg:"fixed"},mode:r,defaultMode:u="collapsed",onModeChange:R,expandedSize:p=320,minSize:g=200,maxSize:h=500,resizable:P=!1,collapsible:b=!0,onExpand:T,onCollapse:L,onResize:o,onResizeStart:x,onResizeEnd:w,snapPoints:F,snapTolerance:q,collapseThreshold:K,paneId:I,persistence:V,children:U,style:k,...f},m)=>{const t=Q(),y=re(i),n=y==="overlay",$=y==="stacked",S=e.useRef(null),C=e.useCallback(s=>{S.current=s,typeof m=="function"?m(s):m&&(m.current=s)},[m]),M=e.Children.toArray(U),B=M.filter(s=>e.isValidElement(s)&&s.type===be),c=M.filter(s=>!(e.isValidElement(s)&&s.type===be)),N=e.useCallback(()=>{if(typeof u=="string")return u;const s=u;if(s&&s[t.currentBreakpoint])return s[t.currentBreakpoint];const D=[...Object.keys(le)].reverse().concat("initial"),Z=D.indexOf(t.currentBreakpoint);for(let X=Z+1;X<D.length;X++){const ne=D[X];if(s&&s[ne])return s[ne]}return"collapsed"},[u,t.currentBreakpoint]),z=e.useRef(null);e.useEffect(()=>{if(r!==void 0||!t.currentBreakpointReady||z.current===t.currentBreakpoint)return;z.current=t.currentBreakpoint;const s=N();s!==t.inspectorMode&&t.setInspectorMode(s)},[r,t.currentBreakpoint,t.currentBreakpointReady,N,t.inspectorMode,t.setInspectorMode]),e.useEffect(()=>{r!==void 0&&t.inspectorMode!==r&&t.setInspectorMode(r)},[r,t]),e.useEffect(()=>{r===void 0&&R?.(t.inspectorMode)},[t.inspectorMode,r,R]),e.useEffect(()=>{t.inspectorMode==="expanded"?T?.():L?.()},[t.inspectorMode,T,L]);const j=t.inspectorMode==="expanded",H=e.useMemo(()=>{if(!I||V)return V;const s=`kookie-ui:shell:inspector:${I}`;return{load:()=>{if(typeof window>"u")return;const D=window.localStorage.getItem(s);return D?Number(D):void 0},save:D=>{typeof window>"u"||window.localStorage.setItem(s,String(D))}}},[I,V]);e.useEffect(()=>{let s=!0;return(async()=>{if(!P||!H?.load||n)return;const E=await H.load();s&&typeof E=="number"&&S.current&&(S.current.style.setProperty("--inspector-size",`${E}px`),o?.(E))})(),()=>{s=!1}},[P,H,o,n]);const v=P&&!n&&j?e.createElement(de.Provider,{value:{containerRef:S,cssVarName:"--inspector-size",minSize:g,maxSize:h,defaultSize:p,orientation:"vertical",edge:"start",computeNext:(s,E,D)=>{const Z=getComputedStyle(S.current).direction==="rtl",X=s-E;return D+(Z?X:-X)},onResize:o,onResizeStart:x,onResizeEnd:s=>{w?.(s),H?.save?.(s)},target:"inspector",collapsible:b,snapPoints:F,snapTolerance:q??8,collapseThreshold:K,requestCollapse:()=>t.setInspectorMode("collapsed"),requestToggle:()=>t.togglePane("inspector")}},B.length>0?B.map((s,E)=>e.cloneElement(s,{key:s.key??E})):e.createElement(_,null)):null;if(n){const s=t.inspectorMode==="expanded";return e.createElement(G.Root,{open:s,onOpenChange:E=>t.setInspectorMode(E?"expanded":"collapsed")},e.createElement(G.Content,{side:"end",style:{padding:0},width:{initial:`${p}px`}},e.createElement(ce.VisuallyHidden,null,e.createElement(G.Title,null,"Inspector")),U))}return e.createElement("div",{...f,ref:C,className:(0,J.default)("rt-ShellInspector",a),"data-mode":t.inspectorMode,"data-peek":t.peekTarget==="inspector"||void 0,"data-presentation":y,"data-open":$&&j||void 0,style:{...k,"--inspector-size":`${p}px`,"--inspector-min-size":`${g}px`,"--inspector-max-size":`${h}px`}},e.createElement("div",{className:"rt-ShellInspectorContent","data-visible":j||void 0},c),v)});pe.displayName="Shell.Inspector",pe.Handle=be;const ue=e.forwardRef(({className:a,presentation:i="fixed",mode:r,defaultMode:u="collapsed",onModeChange:R,expandedSize:p=200,minSize:g=100,maxSize:h=400,resizable:P=!1,collapsible:b=!0,onExpand:T,onCollapse:L,onResize:o,onResizeStart:x,onResizeEnd:w,snapPoints:F,snapTolerance:q,collapseThreshold:K,paneId:I,persistence:V,children:U,style:k,...f},m)=>{const t=Q(),y=re(i),n=y==="overlay",$=y==="stacked",S=e.useRef(null),C=e.useCallback(v=>{S.current=v,typeof m=="function"?m(v):m&&(m.current=v)},[m]),M=e.Children.toArray(U),B=M.filter(v=>e.isValidElement(v)&&v.type===ve),c=M.filter(v=>!(e.isValidElement(v)&&v.type===ve)),N=e.useRef(!1);e.useEffect(()=>{N.current||(N.current=!0,r===void 0&&t.bottomMode!==u&&t.setBottomMode(u))},[]),e.useEffect(()=>{r!==void 0&&t.bottomMode!==r&&t.setBottomMode(r)},[r,t]),e.useEffect(()=>{r===void 0&&R?.(t.bottomMode)},[t.bottomMode,r,R]),e.useEffect(()=>{t.bottomMode==="expanded"?T?.():L?.()},[t.bottomMode,T,L]);const z=t.bottomMode==="expanded",j=e.useMemo(()=>{if(!I||V)return V;const v=`kookie-ui:shell:bottom:${I}`;return{load:()=>{if(typeof window>"u")return;const E=window.localStorage.getItem(v);return E?Number(E):void 0},save:E=>{typeof window>"u"||window.localStorage.setItem(v,String(E))}}},[I,V]);e.useEffect(()=>{let v=!0;return(async()=>{if(!P||!j?.load||n)return;const s=await j.load();v&&typeof s=="number"&&S.current&&(S.current.style.setProperty("--bottom-size",`${s}px`),o?.(s))})(),()=>{v=!1}},[P,j,o,n]);const H=P&&!n&&z?e.createElement(de.Provider,{value:{containerRef:S,cssVarName:"--bottom-size",minSize:g,maxSize:h,defaultSize:p,orientation:"horizontal",edge:"start",computeNext:(v,s,E)=>{const D=v-s;return E-D},onResize:o,onResizeStart:x,onResizeEnd:v=>{w?.(v),j?.save?.(v)},target:"bottom",collapsible:b,snapPoints:F,snapTolerance:q??8,collapseThreshold:K,requestCollapse:()=>t.setBottomMode("collapsed"),requestToggle:()=>t.togglePane("bottom")}},B.length>0?B.map((v,s)=>e.cloneElement(v,{key:v.key??s})):e.createElement(_,null)):null;if(n){const v=t.bottomMode==="expanded";return e.createElement(G.Root,{open:v,onOpenChange:s=>t.setBottomMode(s?"expanded":"collapsed")},e.createElement(G.Content,{side:"bottom",style:{padding:0},height:{initial:`${p}px`}},e.createElement(ce.VisuallyHidden,null,e.createElement(G.Title,null,"Bottom panel")),U))}return e.createElement("div",{...f,ref:C,className:(0,J.default)("rt-ShellBottom",a),"data-mode":t.bottomMode,"data-peek":t.peekTarget==="bottom"||void 0,"data-presentation":y,"data-open":$&&z||void 0,style:{...k,"--bottom-size":`${p}px`,"--bottom-min-size":`${g}px`,"--bottom-max-size":`${h}px`}},e.createElement("div",{className:"rt-ShellBottomContent","data-visible":z||void 0},c),H)});ue.displayName="Shell.Bottom",ue.Handle=ve;const Ee=e.forwardRef(({target:a,action:i="toggle",peekOnHover:r,onClick:u,onMouseEnter:R,onMouseLeave:p,children:g,...h},P)=>{const b=Q(),T=e.useCallback(w=>{switch(u?.(w),i){case"toggle":b.togglePane(a);break;case"expand":b.expandPane(a);break;case"collapse":b.collapsePane(a);break}},[b,a,i,u]),L=(()=>{switch(a){case"left":case"rail":return b.leftMode==="collapsed";case"panel":return b.leftMode==="collapsed"||b.panelMode==="collapsed";case"sidebar":return b.sidebarMode==="collapsed";case"inspector":return b.inspectorMode==="collapsed";case"bottom":return b.bottomMode==="collapsed"}})(),o=e.useCallback(w=>{R?.(w),!(!r||!L)&&b.peekPane(a)},[R,r,L,b,a]),x=e.useCallback(w=>{p?.(w),r&&b.peekTarget===a&&b.clearPeek()},[p,r,b,a]);return e.createElement("button",{...h,ref:P,onClick:T,onMouseEnter:o,onMouseLeave:x,"data-shell-trigger":a,"data-shell-action":i},g)});Ee.displayName="Shell.Trigger";
1
+ "use strict";"use client";var Ce=Object.create;var me=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty;var Le=(a,d)=>{for(var o in d)me(a,o,{get:d[o],enumerable:!0})},Ee=(a,d,o,u)=>{if(d&&typeof d=="object"||typeof d=="function")for(let R of Be(d))!He.call(a,R)&&R!==o&&me(a,R,{get:()=>d[R],enumerable:!(u=Te(d,R))||u.enumerable});return a};var ke=(a,d,o)=>(o=a!=null?Ce(we(a)):{},Ee(d||!a||!a.__esModule?me(o,"default",{value:a,enumerable:!0}):o,a)),Ne=a=>Ee(me({},"__esModule",{value:!0}),a);var De={};Le(De,{Bottom:()=>fe,Content:()=>Re,Header:()=>Pe,Inspector:()=>ue,Left:()=>he,Panel:()=>ae,Rail:()=>oe,Root:()=>Se,Sidebar:()=>le,Trigger:()=>ge,useResponsivePresentation:()=>ie,useShell:()=>_});module.exports=Ne(De);var e=ke(require("react")),Q=ke(require("classnames")),J=ke(require("./sheet.js")),Oe=require("./inset.js"),pe=require("./visually-hidden.js");const se={xs:"(min-width: 520px)",sm:"(min-width: 768px)",md:"(min-width: 1024px)",lg:"(min-width: 1280px)",xl:"(min-width: 1640px)"},xe=e.createContext(null);function _(){const a=e.useContext(xe);if(!a)throw new Error("Shell components must be used within <Shell.Root>");return a}const ce=e.createContext(null);function Ae(){const a=e.useContext(ce);if(!a)throw new Error("Shell.Handle must be used within a resizable pane");return a}const te=e.forwardRef(({className:a,children:d,...o},u)=>{const{containerRef:R,cssVarName:f,minSize:g,maxSize:P,defaultSize:h,orientation:y,edge:C,computeNext:L,onResize:r,onResizeStart:E,onResizeEnd:B,snapPoints:U,snapTolerance:F,collapseThreshold:W,collapsible:K,target:O,requestCollapse:Y,requestToggle:S}=Ae(),m=e.useRef(null);e.useEffect(()=>()=>{try{m.current?.()}catch{}m.current=null},[]);const M=y;return e.createElement("div",{...o,ref:u,className:(0,Q.default)("rt-ShellResizer",a),"data-orientation":y,"data-edge":C,role:"slider","aria-orientation":M,"aria-valuemin":g,"aria-valuemax":P,"aria-valuenow":h,tabIndex:0,onPointerDown:t=>{if(!R.current)return;t.preventDefault();const b=R.current,n=t.currentTarget,I=t.pointerId;try{m.current?.()}catch{}b.setAttribute("data-resizing","");try{n.setPointerCapture(I)}catch{}const k=y==="vertical"?t.clientX:t.clientY,x=parseFloat(getComputedStyle(b).getPropertyValue(f)||`${h}`),v=i=>Math.min(Math.max(i,g),P),w=document.body,c=w.style.cursor,N=w.style.userSelect;w.style.cursor=y==="vertical"?"col-resize":"row-resize",w.style.userSelect="none",E?.(x);const V=i=>{const T=y==="vertical"?i.clientX:i.clientY,s=v(L(T,k,x));b.style.setProperty(f,`${s}px`),n.setAttribute("aria-valuenow",String(s)),r?.(s)},X=()=>{try{n.releasePointerCapture(I)}catch{}window.removeEventListener("pointermove",V),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",H),window.removeEventListener("keydown",j),n.removeEventListener("lostpointercapture",H),b.removeAttribute("data-resizing"),w.style.cursor=c,w.style.userSelect=N,m.current=null},H=()=>{const i=parseFloat(getComputedStyle(b).getPropertyValue(f)||`${h}`);let T=i;if(U&&U.length){const s=U.reduce((z,A)=>Math.abs(A-i)<Math.abs(z-i)?A:z,U[0]);Math.abs(s-i)<=(F??8)&&(T=s,b.style.setProperty(f,`${T}px`),n.setAttribute("aria-valuenow",String(T)),r?.(T))}K&&typeof W=="number"&&i<=W&&Y?.(),B?.(T),X()},j=i=>{i.key==="Escape"&&(b.style.setProperty(f,`${x}px`),n.setAttribute("aria-valuenow",String(x)),B?.(x),X())};window.addEventListener("pointermove",V),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",H),window.addEventListener("keydown",j),n.addEventListener("lostpointercapture",H),m.current=X},onDoubleClick:()=>{K&&S?.()},onKeyDown:t=>{if(!R.current)return;const b=R.current,n=parseFloat(getComputedStyle(b).getPropertyValue(f)||`${h}`),I=v=>Math.min(Math.max(v,g),P),k=t.shiftKey?32:8;let x=0;if(y==="vertical"?t.key==="ArrowRight"?x=k:t.key==="ArrowLeft"&&(x=-k):t.key==="ArrowDown"?x=k:t.key==="ArrowUp"&&(x=-k),t.key==="Home"){t.preventDefault(),E?.(n);const v=I(g);b.style.setProperty(f,`${v}px`),t.currentTarget.setAttribute("aria-valuenow",String(v)),r?.(v),B?.(v);return}if(t.key==="End"){t.preventDefault(),E?.(n);const v=I(P);b.style.setProperty(f,`${v}px`),t.currentTarget.setAttribute("aria-valuenow",String(v)),r?.(v),B?.(v);return}if(x!==0){t.preventDefault(),E?.(n);const v=I(n+(C==="start"&&y==="vertical"?-x:x));b.style.setProperty(f,`${v}px`),t.currentTarget.setAttribute("aria-valuenow",String(v)),r?.(v),B?.(v)}}},d)});te.displayName="Shell.Handle";const ye=e.forwardRef((a,d)=>e.createElement(te,{...a,ref:d}));ye.displayName="Shell.Panel.Handle";const be=e.forwardRef((a,d)=>e.createElement(te,{...a,ref:d}));be.displayName="Shell.Sidebar.Handle";const Me=e.forwardRef((a,d)=>e.createElement(te,{...a,ref:d}));Me.displayName="Shell.Inspector.Handle";const ve=e.forwardRef((a,d)=>e.createElement(te,{...a,ref:d}));ve.displayName="Shell.Bottom.Handle";function ie(a){const{currentBreakpoint:d}=_();return e.useMemo(()=>{if(typeof a=="string")return a;if(a[d])return a[d];const u=[...Object.keys(se)].reverse().concat("initial"),R=u.indexOf(d);for(let f=R+1;f<u.length;f++){const g=u[f];if(a[g])return a[g]}return"fixed"},[a,d])}function ze(){const[a,d]=e.useState("initial"),[o,u]=e.useState(!1);return e.useEffect(()=>{if(typeof window>"u")return;const f=Object.entries(se).map(([P,h])=>[P,window.matchMedia(h)]),g=()=>{const P=f.filter(([,y])=>y.matches).map(([y])=>y),h=P[P.length-1]??"initial";d(h),u(!0)};return g(),f.forEach(([,P])=>P.addEventListener("change",g)),()=>{f.forEach(([,P])=>P.removeEventListener("change",g))}},[]),{bp:a,ready:o}}const Se=e.forwardRef(({className:a,children:d,height:o="full",...u},R)=>{const{bp:f,ready:g}=ze(),[P,h]=e.useState("collapsed"),[y,C]=e.useState("collapsed"),[L,r]=e.useState("expanded"),[E,B]=e.useState("collapsed"),[U,F]=e.useState("collapsed"),[W,K]=e.useState(!1),[O,Y]=e.useState(!1),S=e.useRef(l=>l==="collapsed"?"thin":l==="thin"?"expanded":"collapsed"),m=e.useCallback(l=>{S.current=l},[]);e.useEffect(()=>{P==="collapsed"&&C("collapsed")},[P]),e.useEffect(()=>{O&&W&&console.warn("Shell: Sidebar cannot coexist with Rail or Panel. Use either Rail+Panel OR Sidebar.")},[O,W]);const[M,t]=e.useState(void 0),b=e.useCallback(l=>t(l),[]),n=e.useRef(64),I=e.useRef(288),k=e.useCallback(l=>{n.current=l},[]),x=e.useCallback(l=>{I.current=l},[]),v=e.useMemo(()=>{const l=e.Children.toArray(d),$=(G,de)=>e.isValidElement(G)&&(G.type===de||G.type?.displayName===de.displayName);return l.some(G=>$(G,oe)||$(G,ae))},[d]),w=e.useMemo(()=>{const l=e.Children.toArray(d),$=(G,de)=>e.isValidElement(G)&&(G.type===de||G.type?.displayName===de.displayName);return l.some(G=>$(G,le))},[d]),c=e.useCallback(l=>{switch(l){case"left":case"rail":h($=>$==="expanded"?"collapsed":"expanded");break;case"panel":P==="collapsed"?(h("expanded"),C("expanded")):C($=>$==="expanded"?"collapsed":"expanded");break;case"sidebar":r($=>S.current($));break;case"inspector":B($=>$==="expanded"?"collapsed":"expanded");break;case"bottom":F($=>$==="expanded"?"collapsed":"expanded");break}},[P]),N=e.useCallback(l=>{switch(l){case"left":case"rail":h("expanded");break;case"panel":h("expanded"),C("expanded");break;case"sidebar":r("expanded");break;case"inspector":B("expanded");break;case"bottom":F("expanded");break}},[]),V=e.useCallback(l=>{switch(l){case"left":case"rail":h("collapsed");break;case"panel":C("collapsed");break;case"sidebar":r("collapsed");break;case"inspector":B("collapsed");break;case"bottom":F("collapsed");break}},[]),X=e.useMemo(()=>({leftMode:P,setLeftMode:h,panelMode:y,setPanelMode:C,sidebarMode:L,setSidebarMode:r,inspectorMode:E,setInspectorMode:B,bottomMode:U,setBottomMode:F,hasLeft:W,setHasLeft:K,hasSidebar:O,setHasSidebar:Y,currentBreakpoint:f,currentBreakpointReady:g,leftResolvedPresentation:M,togglePane:c,expandPane:N,collapsePane:V,setSidebarToggleComputer:m,onLeftPres:b,onRailDefaults:k,onPanelDefaults:x}),[P,y,L,E,U,W,O,f,g,M,c,N,V,m,b,k,x]),H=e.Children.toArray(d),j=(l,$)=>e.isValidElement(l)&&(l.type===$||l.type?.displayName===$.displayName),i=H.filter(l=>j(l,Pe)),T=H.filter(l=>j(l,oe)),s=H.filter(l=>j(l,ae)),z=H.filter(l=>j(l,le)),A=H.filter(l=>j(l,Re)),ee=H.filter(l=>j(l,ue)),ne=H.filter(l=>j(l,fe)),re=e.useMemo(()=>o==="full"?{height:"100vh"}:o==="auto"?{height:"auto"}:typeof o=="string"?{height:o}:typeof o=="number"?{height:`${o}px`}:{},[o]),[p,q]=e.useState(null),D=e.useCallback(l=>q(l),[]),Z=e.useCallback(()=>q(null),[]);return e.createElement("div",{...u,ref:R,className:(0,Q.default)("rt-ShellRoot",a),style:{...re,...u.style}},e.createElement(xe.Provider,{value:{...X,peekTarget:p,setPeekTarget:q,peekPane:D,clearPeek:Z}},i,e.createElement("div",{className:"rt-ShellBody","data-peek-target":p??void 0,style:p==="rail"||p==="panel"?{"--peek-rail-width":`${n.current}px`}:void 0},v&&!w?(()=>{const l=T[0],$=l?{mode:l.props?.mode,defaultMode:l.props?.defaultMode,onModeChange:l.props?.onModeChange,presentation:l.props?.presentation,collapsible:l.props?.collapsible,onExpand:l.props?.onExpand,onCollapse:l.props?.onCollapse}:{};return e.createElement(he,{...$},T,s)})():z,A,ee),ne))});Se.displayName="Shell.Root";const Pe=e.forwardRef(({className:a,height:d=64,style:o,...u},R)=>e.createElement("header",{...u,ref:R,className:(0,Q.default)("rt-ShellHeader",a),style:{...o,"--shell-header-height":`${d}px`}}));Pe.displayName="Shell.Header";const he=e.forwardRef(({className:a,presentation:d={initial:"overlay",sm:"fixed"},mode:o,defaultMode:u="collapsed",onModeChange:R,collapsible:f=!0,onExpand:g,onCollapse:P,children:h,style:y,...C},L)=>{const r=_(),E=ie(d),B=E==="overlay",U=E==="stacked",F=e.useRef(null);e.useEffect(()=>{r.onLeftPres?.(E)},[r,E]);const W=e.useCallback(S=>{F.current=S,typeof L=="function"?L(S):L&&(L.current=S)},[L]);e.useEffect(()=>(r.setHasLeft(!0),()=>r.setHasLeft(!1)),[r]);const K=e.useCallback(()=>{if(typeof u=="string")return u;const S=u;if(S&&S[r.currentBreakpoint])return S[r.currentBreakpoint];const M=[...Object.keys(se)].reverse().concat("initial"),t=M.indexOf(r.currentBreakpoint);for(let b=t+1;b<M.length;b++){const n=M[b];if(S&&S[n])return S[n]}return"collapsed"},[u,r.currentBreakpoint]),O=e.useRef(null);e.useEffect(()=>{if(o!==void 0||!r.currentBreakpointReady||O.current===r.currentBreakpoint)return;O.current=r.currentBreakpoint;const S=K();S!==r.leftMode&&r.setLeftMode(S)},[o,r.currentBreakpoint,r.currentBreakpointReady,K,r.leftMode,r.setLeftMode]),e.useEffect(()=>{o!==void 0&&r.leftMode!==o&&r.setLeftMode(o)},[o,r]),e.useEffect(()=>{o===void 0&&R?.(r.leftMode)},[r.leftMode,o,R]),e.useEffect(()=>{r.leftMode==="expanded"?g?.():P?.()},[r.leftMode,g,P]);const Y=r.leftMode==="expanded";if(B){const S=r.leftMode==="expanded",m=e.Children.toArray(h),M=(w,c)=>e.isValidElement(w)&&w.type===c,t=m.find(w=>M(w,oe)),b=m.find(w=>M(w,ae)),n=typeof t?.props?.expandedSize=="number"?t.props.expandedSize:64,I=typeof b?.props?.expandedSize=="number"?b.props.expandedSize:288,k=!!t,x=!!b,v=(k?n:0)+(r.panelMode==="expanded"&&x?I:0);return e.createElement(J.Root,{open:S,onOpenChange:w=>r.setLeftMode(w?"expanded":"collapsed")},e.createElement(J.Content,{side:"start",style:{padding:0},width:{initial:`${v}px`}},e.createElement(pe.VisuallyHidden,null,e.createElement(J.Title,null,"Navigation")),e.createElement("div",{className:"rt-ShellLeft"},h)))}if(U){const S=r.leftMode==="expanded",m=e.Children.toArray(h),M=(c,N)=>e.isValidElement(c)&&c.type===N,t=m.find(c=>M(c,oe)),b=m.find(c=>M(c,ae)),n=typeof t?.props?.expandedSize=="number"?t.props.expandedSize:64,I=typeof b?.props?.expandedSize=="number"?b.props.expandedSize:288,k=!!t,v=!!b&&(r.panelMode==="expanded"||r.peekTarget==="panel"),w=(k?n:0)+(v?I:0);return e.createElement("div",{...C,ref:W,className:(0,Q.default)("rt-ShellLeft",a),"data-mode":r.leftMode,"data-peek":r.peekTarget==="left"||r.peekTarget==="rail"||r.peekTarget==="panel"||void 0,"data-presentation":E,style:{...y},"data-open":S||void 0},h)}return e.createElement("div",{...C,ref:W,className:(0,Q.default)("rt-ShellLeft",a),"data-mode":r.leftMode,"data-peek":r.peekTarget==="left"||r.peekTarget==="rail"||r.peekTarget==="panel"||void 0,"data-presentation":E,style:{...y}},h)});he.displayName="Shell.Left";const oe=e.forwardRef(({className:a,presentation:d,mode:o,defaultMode:u,onModeChange:R,expandedSize:f=64,collapsible:g,onExpand:P,onCollapse:h,children:y,style:C,...L},r)=>{const E=_();e.useEffect(()=>{E.onRailDefaults?.(f)},[E,f]);const B=E.leftMode==="expanded";return e.createElement("div",{...L,ref:r,className:(0,Q.default)("rt-ShellRail",a),"data-mode":E.leftMode,"data-peek":E.leftResolvedPresentation!=="overlay"&&E.peekTarget==="rail"||void 0,style:{...C,"--rail-size":`${f}px`}},e.createElement("div",{className:"rt-ShellRailContent","data-visible":B||E.leftResolvedPresentation!=="overlay"&&E.peekTarget==="rail"||void 0},y))});oe.displayName="Shell.Rail";const ae=e.forwardRef(({className:a,mode:d,onModeChange:o,expandedSize:u=288,minSize:R,maxSize:f,resizable:g,collapsible:P=!0,onExpand:h,onCollapse:y,onResize:C,onResizeStart:L,onResizeEnd:r,snapPoints:E,snapTolerance:B,collapseThreshold:U,paneId:F,persistence:W,children:K,style:O,...Y},S)=>{const m=_();e.useEffect(()=>{m.onPanelDefaults?.(u)},[m,u]);const M=e.useRef(null),t=e.useCallback(c=>{M.current=c,typeof S=="function"?S(c):S&&(S.current=c)},[S]),b=e.Children.toArray(K),n=b.filter(c=>e.isValidElement(c)&&c.type===ye),I=b.filter(c=>!(e.isValidElement(c)&&c.type===ye)),k=m.leftResolvedPresentation==="overlay",x=e.useMemo(()=>{if(!F||W)return W;const c=`kookie-ui:shell:panel:${F}`;return{load:()=>{if(typeof window>"u")return;const V=window.localStorage.getItem(c);return V?Number(V):void 0},save:V=>{typeof window>"u"||window.localStorage.setItem(c,String(V))}}},[F,W]);e.useEffect(()=>{let c=!0;return(async()=>{if(!g||!x?.load||k)return;const N=await x.load();c&&typeof N=="number"&&M.current&&(M.current.style.setProperty("--panel-size",`${N}px`),C?.(N))})(),()=>{c=!1}},[g,x,C,k]),e.useEffect(()=>{M.current&&k&&M.current.style.setProperty("--panel-size",`${u}px`)},[k,u]),e.useEffect(()=>{if(M.current&&m.leftResolvedPresentation!=="overlay"&&m.leftMode==="expanded"&&m.panelMode==="expanded"){const c=M.current.parentElement||null;try{c?.style.removeProperty("width")}catch{}}},[m.leftResolvedPresentation,m.leftMode,m.panelMode]);const v=m.leftMode==="expanded"&&m.panelMode==="expanded",w=g&&m.leftResolvedPresentation!=="overlay"&&v?e.createElement(ce.Provider,{value:{containerRef:M,cssVarName:"--panel-size",minSize:typeof R=="number"?R:100,maxSize:typeof f=="number"?f:800,defaultSize:u,orientation:"vertical",edge:"end",computeNext:(c,N,V)=>{const X=getComputedStyle(M.current).direction==="rtl",H=c-N;return V+(X?-H:H)},onResize:C,onResizeStart:c=>{const V=M.current?.parentElement;try{V?.style.removeProperty("width")}catch{}L?.(c)},onResizeEnd:c=>{r?.(c),x?.save?.(c)},target:"panel",collapsible:!!P,snapPoints:E,snapTolerance:B??8,collapseThreshold:U,requestCollapse:()=>m.setPanelMode("collapsed"),requestToggle:()=>m.togglePane("panel")}},n.length>0?n.map((c,N)=>e.cloneElement(c,{key:c.key??N})):e.createElement(te,null)):null;return e.createElement("div",{...Y,ref:t,className:(0,Q.default)("rt-ShellPanel",a),"data-mode":m.panelMode,"data-visible":v||m.leftResolvedPresentation!=="overlay"&&m.peekTarget==="panel"||void 0,"data-peek":m.leftResolvedPresentation!=="overlay"&&m.peekTarget==="panel"||void 0,style:{...O,"--panel-size":`${u}px`}},e.createElement("div",{className:"rt-ShellPanelContent","data-visible":v||void 0},I),w)});ae.displayName="Shell.Panel",ae.Handle=ye;const le=e.forwardRef(({className:a,presentation:d={initial:"overlay",md:"fixed"},mode:o,defaultMode:u="expanded",onModeChange:R,expandedSize:f=288,minSize:g=200,maxSize:P=400,resizable:h=!1,collapsible:y=!0,onExpand:C,onCollapse:L,onResize:r,onResizeStart:E,onResizeEnd:B,snapPoints:U,snapTolerance:F,collapseThreshold:W,paneId:K,persistence:O,children:Y,style:S,thinSize:m=64,toggleModes:M,...t},b)=>{const n=_(),I=ie(d),k=I==="overlay",x=I==="stacked",v=e.useRef(null),w=e.useCallback(p=>{v.current=p,typeof b=="function"?b(p):b&&(b.current=p)},[b]),c=e.Children.toArray(Y),N=c.filter(p=>e.isValidElement(p)&&p.type===be),V=c.filter(p=>!(e.isValidElement(p)&&p.type===be)),X=e.useId();e.useEffect(()=>(n.setHasSidebar(!0),()=>{n.setHasSidebar(!1)}),[n,X]);const H=e.useRef(!1);e.useEffect(()=>{H.current||(H.current=!0,o===void 0&&n.sidebarMode!==u&&n.setSidebarMode(u))},[]),e.useEffect(()=>{o!==void 0&&n.sidebarMode!==o&&n.setSidebarMode(o)},[o,n]),e.useEffect(()=>{o===void 0&&R?.(n.sidebarMode)},[n.sidebarMode,o,R]),e.useEffect(()=>{n.sidebarMode==="expanded"?C?.():L?.()},[n.sidebarMode,C,L]);const j=n.sidebarMode!=="collapsed",i=e.useMemo(()=>{if(!K||O)return O;const p=`kookie-ui:shell:sidebar:${K}`;return{load:()=>{if(typeof window>"u")return;const D=window.localStorage.getItem(p);return D?Number(D):void 0},save:D=>{typeof window>"u"||window.localStorage.setItem(p,String(D))}}},[K,O]);e.useEffect(()=>{let p=!0;return(async()=>{if(!h||!i?.load||k)return;const q=await i.load();p&&typeof q=="number"&&v.current&&(v.current.style.setProperty("--sidebar-size",`${q}px`),r?.(q))})(),()=>{p=!1}},[h,i,r,k]);const T=e.useCallback(()=>{if(typeof u=="string")return u;const p=u;if(p&&p[n.currentBreakpoint])return p[n.currentBreakpoint];const D=[...Object.keys(se)].reverse().concat("initial"),Z=D.indexOf(n.currentBreakpoint);for(let l=Z+1;l<D.length;l++){const $=D[l];if(p&&p[$])return p[$]}return"collapsed"},[u,n.currentBreakpoint]),s=_(),z=e.useCallback(()=>{const p=T();return p==="thin"||p==="expanded"?p:"expanded"},[T]);e.useEffect(()=>{if(!s.setSidebarToggleComputer)return;const p=M??"both",q=D=>{if(p==="both")return D==="collapsed"?"thin":D==="thin"?"expanded":"collapsed";const Z=z();return D==="collapsed"?Z:D===Z?"collapsed":Z};return s.setSidebarToggleComputer(q),()=>{s.setSidebarToggleComputer?.(D=>D==="collapsed"?"thin":D==="thin"?"expanded":"collapsed")}},[s,M,z]);const A=e.useRef(f),ee=e.useRef("expanded");e.useEffect(()=>{n.sidebarMode!=="collapsed"&&(ee.current=n.sidebarMode,A.current=n.sidebarMode==="thin"?m:f)},[n.sidebarMode,m,f]);const ne=e.useRef(null);e.useEffect(()=>{if(o!==void 0||!n.currentBreakpointReady||ne.current===n.currentBreakpoint)return;ne.current=n.currentBreakpoint;const p=T();p!==n.sidebarMode&&n.setSidebarMode(p)},[o,n.currentBreakpoint,n.currentBreakpointReady,T,n.sidebarMode,n.setSidebarMode]);const re=h&&!k&&n.sidebarMode==="expanded"?e.createElement(ce.Provider,{value:{containerRef:v,cssVarName:"--sidebar-size",minSize:g,maxSize:P,defaultSize:f,orientation:"vertical",edge:"end",computeNext:(p,q,D)=>{const Z=getComputedStyle(v.current).direction==="rtl",l=p-q;return D+(Z?-l:l)},onResize:r,onResizeStart:E,onResizeEnd:p=>{B?.(p),i?.save?.(p)},target:"sidebar",collapsible:y,snapPoints:U,snapTolerance:F??8,collapseThreshold:W,requestCollapse:()=>n.setSidebarMode("collapsed"),requestToggle:()=>n.togglePane("sidebar")}},N.length>0?N.map((p,q)=>e.cloneElement(p,{key:p.key??q})):e.createElement(te,null)):null;if(k){const p=n.sidebarMode!=="collapsed";return e.createElement(J.Root,{open:p,onOpenChange:q=>n.setSidebarMode(q?"expanded":"collapsed")},e.createElement(J.Content,{side:"start",style:{padding:0},width:{initial:`${p?n.sidebarMode==="thin"?m:f:A.current}px`}},e.createElement(pe.VisuallyHidden,null,e.createElement(J.Title,null,"Sidebar")),V))}return e.createElement("div",{...t,ref:w,className:(0,Q.default)("rt-ShellSidebar",a),"data-mode":n.sidebarMode,"data-peek":n.peekTarget==="sidebar"||void 0,"data-presentation":I,"data-open":x&&j||void 0,style:{...S,"--sidebar-size":`${f}px`,"--sidebar-thin-size":`${m}px`,"--sidebar-min-size":`${g}px`,"--sidebar-max-size":`${P}px`,...n.peekTarget==="sidebar"&&n.sidebarMode==="collapsed"&&!k?(()=>{const p=M??"both",q=n.sidebarMode;let D;if(p==="both")D=q==="collapsed"?"thin":q==="thin"?"expanded":"collapsed";else{const Z=z();D=q==="collapsed"?Z:"collapsed"}return D==="thin"?{"--peek-sidebar-width":`${m}px`}:{"--peek-sidebar-width":`var(--sidebar-size, ${f}px)`}})():{}}},e.createElement("div",{className:"rt-ShellSidebarContent","data-visible":j||void 0},V),re)});le.displayName="Shell.Sidebar",le.Handle=be;const Re=e.forwardRef(({className:a,...d},o)=>e.createElement("main",{...d,ref:o,className:(0,Q.default)("rt-ShellContent",a)}));Re.displayName="Shell.Content";const ue=e.forwardRef(({className:a,presentation:d={initial:"overlay",lg:"fixed"},mode:o,defaultMode:u="collapsed",onModeChange:R,expandedSize:f=320,minSize:g=200,maxSize:P=500,resizable:h=!1,collapsible:y=!0,onExpand:C,onCollapse:L,onResize:r,onResizeStart:E,onResizeEnd:B,snapPoints:U,snapTolerance:F,collapseThreshold:W,paneId:K,persistence:O,children:Y,style:S,...m},M)=>{const t=_(),b=ie(d),n=b==="overlay",I=b==="stacked",k=e.useRef(null),x=e.useCallback(i=>{k.current=i,typeof M=="function"?M(i):M&&(M.current=i)},[M]),v=e.Children.toArray(Y),w=v.filter(i=>e.isValidElement(i)&&i.type===Me),c=v.filter(i=>!(e.isValidElement(i)&&i.type===Me)),N=e.useCallback(()=>{if(typeof u=="string")return u;const i=u;if(i&&i[t.currentBreakpoint])return i[t.currentBreakpoint];const s=[...Object.keys(se)].reverse().concat("initial"),z=s.indexOf(t.currentBreakpoint);for(let A=z+1;A<s.length;A++){const ee=s[A];if(i&&i[ee])return i[ee]}return"collapsed"},[u,t.currentBreakpoint]),V=e.useRef(null);e.useEffect(()=>{if(o!==void 0||!t.currentBreakpointReady||V.current===t.currentBreakpoint)return;V.current=t.currentBreakpoint;const i=N();i!==t.inspectorMode&&t.setInspectorMode(i)},[o,t.currentBreakpoint,t.currentBreakpointReady,N,t.inspectorMode,t.setInspectorMode]),e.useEffect(()=>{o!==void 0&&t.inspectorMode!==o&&t.setInspectorMode(o)},[o,t]),e.useEffect(()=>{o===void 0&&R?.(t.inspectorMode)},[t.inspectorMode,o,R]),e.useEffect(()=>{t.inspectorMode==="expanded"?C?.():L?.()},[t.inspectorMode,C,L]);const X=t.inspectorMode==="expanded",H=e.useMemo(()=>{if(!K||O)return O;const i=`kookie-ui:shell:inspector:${K}`;return{load:()=>{if(typeof window>"u")return;const s=window.localStorage.getItem(i);return s?Number(s):void 0},save:s=>{typeof window>"u"||window.localStorage.setItem(i,String(s))}}},[K,O]);e.useEffect(()=>{let i=!0;return(async()=>{if(!h||!H?.load||n)return;const T=await H.load();i&&typeof T=="number"&&k.current&&(k.current.style.setProperty("--inspector-size",`${T}px`),r?.(T))})(),()=>{i=!1}},[h,H,r,n]);const j=h&&!n&&X?e.createElement(ce.Provider,{value:{containerRef:k,cssVarName:"--inspector-size",minSize:g,maxSize:P,defaultSize:f,orientation:"vertical",edge:"start",computeNext:(i,T,s)=>{const z=getComputedStyle(k.current).direction==="rtl",A=i-T;return s+(z?A:-A)},onResize:r,onResizeStart:E,onResizeEnd:i=>{B?.(i),H?.save?.(i)},target:"inspector",collapsible:y,snapPoints:U,snapTolerance:F??8,collapseThreshold:W,requestCollapse:()=>t.setInspectorMode("collapsed"),requestToggle:()=>t.togglePane("inspector")}},w.length>0?w.map((i,T)=>e.cloneElement(i,{key:i.key??T})):e.createElement(te,null)):null;if(n){const i=t.inspectorMode==="expanded";return e.createElement(J.Root,{open:i,onOpenChange:T=>t.setInspectorMode(T?"expanded":"collapsed")},e.createElement(J.Content,{side:"end",style:{padding:0},width:{initial:`${f}px`}},e.createElement(pe.VisuallyHidden,null,e.createElement(J.Title,null,"Inspector")),c))}return e.createElement("div",{...m,ref:x,className:(0,Q.default)("rt-ShellInspector",a),"data-mode":t.inspectorMode,"data-peek":t.peekTarget==="inspector"||void 0,"data-presentation":b,"data-open":I&&X||void 0,style:{...S,"--inspector-size":`${f}px`,"--inspector-min-size":`${g}px`,"--inspector-max-size":`${P}px`}},e.createElement("div",{className:"rt-ShellInspectorContent","data-visible":X||void 0},c),j)});ue.displayName="Shell.Inspector",ue.Handle=Me;const fe=e.forwardRef(({className:a,presentation:d="fixed",mode:o,defaultMode:u="collapsed",onModeChange:R,expandedSize:f=200,minSize:g=100,maxSize:P=400,resizable:h=!1,collapsible:y=!0,onExpand:C,onCollapse:L,onResize:r,onResizeStart:E,onResizeEnd:B,snapPoints:U,snapTolerance:F,collapseThreshold:W,paneId:K,persistence:O,children:Y,style:S,...m},M)=>{const t=_(),b=ie(d),n=b==="overlay",I=b==="stacked",k=e.useRef(null),x=e.useCallback(s=>{k.current=s,typeof M=="function"?M(s):M&&(M.current=s)},[M]),v=e.Children.toArray(Y),w=v.filter(s=>e.isValidElement(s)&&s.type===ve),c=v.filter(s=>!(e.isValidElement(s)&&s.type===ve)),N=e.useCallback(()=>{if(typeof u=="string")return u;const s=u;if(s&&s[t.currentBreakpoint])return s[t.currentBreakpoint];const A=[...Object.keys(se)].reverse().concat("initial"),ee=A.indexOf(t.currentBreakpoint);for(let ne=ee+1;ne<A.length;ne++){const re=A[ne];if(s&&s[re])return s[re]}return"collapsed"},[u,t.currentBreakpoint]),V=e.useRef(!1);e.useEffect(()=>{if(!V.current&&(V.current=!0,o===void 0)){const s=N();t.bottomMode!==s&&t.setBottomMode(s)}},[]);const X=e.useRef(null),H=e.useRef(null);e.useEffect(()=>{if(o!==void 0||!t.currentBreakpointReady||X.current===t.currentBreakpoint)return;X.current=t.currentBreakpoint;const s=N();H.current!==s&&(H.current=s,s!==t.bottomMode&&t.setBottomMode(s))},[o,t.currentBreakpoint,t.currentBreakpointReady,N,t.bottomMode,t.setBottomMode]),e.useEffect(()=>{o!==void 0&&t.bottomMode!==o&&t.setBottomMode(o)},[o,t]),e.useEffect(()=>{o===void 0&&R?.(t.bottomMode)},[t.bottomMode,o,R]),e.useEffect(()=>{t.bottomMode==="expanded"?C?.():L?.()},[t.bottomMode,C,L]);const j=t.bottomMode==="expanded",i=e.useMemo(()=>{if(!K||O)return O;const s=`kookie-ui:shell:bottom:${K}`;return{load:()=>{if(typeof window>"u")return;const A=window.localStorage.getItem(s);return A?Number(A):void 0},save:A=>{typeof window>"u"||window.localStorage.setItem(s,String(A))}}},[K,O]);e.useEffect(()=>{let s=!0;return(async()=>{if(!h||!i?.load||n)return;const z=await i.load();s&&typeof z=="number"&&k.current&&(k.current.style.setProperty("--bottom-size",`${z}px`),r?.(z))})(),()=>{s=!1}},[h,i,r,n]);const T=h&&!n&&j?e.createElement(ce.Provider,{value:{containerRef:k,cssVarName:"--bottom-size",minSize:g,maxSize:P,defaultSize:f,orientation:"horizontal",edge:"start",computeNext:(s,z,A)=>{const ee=s-z;return A-ee},onResize:r,onResizeStart:E,onResizeEnd:s=>{B?.(s),i?.save?.(s)},target:"bottom",collapsible:y,snapPoints:U,snapTolerance:F??8,collapseThreshold:W,requestCollapse:()=>t.setBottomMode("collapsed"),requestToggle:()=>t.togglePane("bottom")}},w.length>0?w.map((s,z)=>e.cloneElement(s,{key:s.key??z})):e.createElement(te,null)):null;if(n){const s=t.bottomMode==="expanded";return e.createElement(J.Root,{open:s,onOpenChange:z=>t.setBottomMode(z?"expanded":"collapsed")},e.createElement(J.Content,{side:"bottom",style:{padding:0},height:{initial:`${f}px`}},e.createElement(pe.VisuallyHidden,null,e.createElement(J.Title,null,"Bottom panel")),c))}return e.createElement("div",{...m,ref:x,className:(0,Q.default)("rt-ShellBottom",a),"data-mode":t.bottomMode,"data-peek":t.peekTarget==="bottom"||void 0,"data-presentation":b,"data-open":I&&j||void 0,style:{...S,"--bottom-size":`${f}px`,"--bottom-min-size":`${g}px`,"--bottom-max-size":`${P}px`}},e.createElement("div",{className:"rt-ShellBottomContent","data-visible":j||void 0},c),T)});fe.displayName="Shell.Bottom",fe.Handle=ve;const ge=e.forwardRef(({target:a,action:d="toggle",peekOnHover:o,onClick:u,onMouseEnter:R,onMouseLeave:f,children:g,...P},h)=>{const y=_(),C=e.useCallback(B=>{switch(u?.(B),y.peekTarget===a&&y.clearPeek(),d){case"toggle":y.togglePane(a);break;case"expand":y.expandPane(a);break;case"collapse":y.collapsePane(a);break}},[y,a,d,u]),L=(()=>{switch(a){case"left":case"rail":return y.leftMode==="collapsed";case"panel":return y.leftMode==="collapsed"||y.panelMode==="collapsed";case"sidebar":return y.sidebarMode==="collapsed";case"inspector":return y.inspectorMode==="collapsed";case"bottom":return y.bottomMode==="collapsed"}})(),r=e.useCallback(B=>{R?.(B),!(!o||!L)&&y.peekPane(a)},[R,o,L,y,a]),E=e.useCallback(B=>{f?.(B),o&&y.peekTarget===a&&y.clearPeek()},[f,o,y,a]);return e.createElement("button",{...P,ref:h,onClick:C,onMouseEnter:r,onMouseLeave:E,"data-shell-trigger":a,"data-shell-action":d},g)});ge.displayName="Shell.Trigger";
2
2
  //# sourceMappingURL=shell.js.map