@lax-wp/design-system 0.13.76 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/components/data-display/modal/Modal.cjs.js +1 -1
  2. package/dist/components/data-display/modal/Modal.cjs.js.map +1 -1
  3. package/dist/components/data-display/modal/Modal.es.js +50 -47
  4. package/dist/components/data-display/modal/Modal.es.js.map +1 -1
  5. package/dist/components/data-display/resizable-sidebar/ResizableSidebar.cjs.js +1 -1
  6. package/dist/components/data-display/resizable-sidebar/ResizableSidebar.cjs.js.map +1 -1
  7. package/dist/components/data-display/resizable-sidebar/ResizableSidebar.d.ts +2 -0
  8. package/dist/components/data-display/resizable-sidebar/ResizableSidebar.es.js +124 -120
  9. package/dist/components/data-display/resizable-sidebar/ResizableSidebar.es.js.map +1 -1
  10. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js +1 -1
  11. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js.map +1 -1
  12. package/dist/components/forms/currency-input/CurrencyInputField.es.js +35 -35
  13. package/dist/components/forms/currency-input/CurrencyInputField.es.js.map +1 -1
  14. package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js +1 -1
  15. package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js.map +1 -1
  16. package/dist/components/forms/master-data-input/MasterDataInputField.es.js +44 -44
  17. package/dist/components/forms/master-data-input/MasterDataInputField.es.js.map +1 -1
  18. package/dist/components/modal/drawer/Drawer.cjs.js +1 -1
  19. package/dist/components/modal/drawer/Drawer.cjs.js.map +1 -1
  20. package/dist/components/modal/drawer/Drawer.es.js +40 -39
  21. package/dist/components/modal/drawer/Drawer.es.js.map +1 -1
  22. package/dist/components/navigation/accordion/Accordion.cjs.js +1 -1
  23. package/dist/components/navigation/accordion/Accordion.cjs.js.map +1 -1
  24. package/dist/components/navigation/accordion/Accordion.es.js +0 -1
  25. package/dist/components/navigation/accordion/Accordion.es.js.map +1 -1
  26. package/dist/hooks/useResponsiveWidth.cjs.js +2 -0
  27. package/dist/hooks/useResponsiveWidth.cjs.js.map +1 -0
  28. package/dist/hooks/useResponsiveWidth.d.ts +5 -0
  29. package/dist/hooks/useResponsiveWidth.es.js +24 -0
  30. package/dist/hooks/useResponsiveWidth.es.js.map +1 -0
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/index.d.ts +2 -0
  33. package/dist/index.es.js +296 -293
  34. package/dist/index.es.js.map +1 -1
  35. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),I=require("@mui/icons-material"),N=require("antd"),M=require("../typography/Typography.cjs.js"),S=require("../../../hooks/useModalContainer.cjs.js"),f=g=>{const{open:d,children:b,title:s,mask:c=!0,onlyBody:h=!1,bodySpacing:v=!0,headerRightContent:u,parentContainer:i,zIndex:p,asForm:y=!0,onSubmit:x,showCloseButton:m=!0,noPadding:n=!1,...r}=g,C=S.useModalContainer({primaryContainerId:"layout-app-main-content-container",fallbackContainerId:"full-screen-container"}),w=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center",children:[m?e.jsx(M.Typography,{size:"large",variant:"semibold",className:"tour__title",children:s}):e.jsx("div",{className:"flex flex-col w-full",children:s}),u||m&&e.jsx("button",{id:"btn-modal-close",onClick:r.onCancel,className:"",type:"button",children:e.jsx(I.CloseRounded,{sx:{fontSize:"20px"},className:"cursor-pointer text-neutral-400 hover:text-neutral-600"})})]}),r.addLineAfterHeader&&e.jsx("hr",{className:"mt-2"})]}),j=y?"form":"div",T=()=>{if(i){if(typeof document<"u"){const t=document.getElementById(i);if(t)return t}if(typeof globalThis<"u"&&globalThis.window&&globalThis.window.parent&&globalThis.window.parent!==globalThis.window)try{const t=globalThis.window.parent.document?.getElementById(i);if(t)return t}catch{}}return C};if(!d)return null;const a=T();if(!a)return null;const o=a!==document.body;return e.jsx(N.Modal,{open:d,centered:!0,closable:!1,title:h?null:w,modalRender:t=>e.jsx(j,{onSubmit:l=>{l.preventDefault(),x&&x()},children:e.jsx("div",{role:"none",onClick:l=>l.stopPropagation(),children:t})}),styles:{content:{padding:n?"0px":"20px 0px"},header:{padding:n?"0px":"0px 20px"},body:{padding:n?"0px":v?"0px 20px":"0px"},footer:{padding:n?"0px":"0px 20px"},mask:{zIndex:p||1e3,position:o?"absolute":void 0,top:o?0:void 0,right:o?0:void 0,bottom:o?0:void 0,left:o?0:void 0},wrapper:{zIndex:p||1e3,position:o?"absolute":void 0,top:o?0:void 0,right:o?0:void 0,bottom:o?0:void 0,left:o?0:void 0,backgroundColor:c?"rgb(16 24 40 / 80%)":void 0}},mask:c,...r,getContainer:()=>a,children:b})};exports.Modal=f;exports.default=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),k=require("@mui/icons-material"),q=require("antd"),R=require("../typography/Typography.cjs.js"),W=require("../../../hooks/useModalContainer.cjs.js"),z=require("../../../hooks/useResponsiveWidth.cjs.js"),g=b=>{const{open:l,children:v,title:c,mask:u=!0,onlyBody:y=!1,bodySpacing:C=!0,headerRightContent:p,parentContainer:r,zIndex:x,asForm:w=!0,onSubmit:f,showCloseButton:h=!0,noPadding:i=!1,width:n,...d}=b,j=W.useModalContainer({primaryContainerId:"layout-app-main-content-container",fallbackContainerId:"full-screen-container"}),m=typeof n=="number"||typeof n=="string"?n:void 0,T=z.useResponsiveWidth(m),I=m===void 0&&n!==void 0?n:T,N=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center",children:[h?e.jsx(R.Typography,{size:"large",variant:"semibold",className:"tour__title",children:c}):e.jsx("div",{className:"flex flex-col w-full",children:c}),p||h&&e.jsx("button",{id:"btn-modal-close",onClick:d.onCancel,className:"",type:"button",children:e.jsx(k.CloseRounded,{sx:{fontSize:"20px"},className:"cursor-pointer text-neutral-400 hover:text-neutral-600"})})]}),d.addLineAfterHeader&&e.jsx("hr",{className:"mt-2"})]}),M=w?"form":"div",S=()=>{if(r){if(typeof document<"u"){const o=document.getElementById(r);if(o)return o}if(typeof globalThis<"u"&&globalThis.window&&globalThis.window.parent&&globalThis.window.parent!==globalThis.window)try{const o=globalThis.window.parent.document?.getElementById(r);if(o)return o}catch{}}return j};if(!l)return null;const a=S();if(!a)return null;const t=a!==document.body;return e.jsx(q.Modal,{open:l,centered:!0,closable:!1,title:y?null:N,modalRender:o=>e.jsx(M,{onSubmit:s=>{s.preventDefault(),f&&f()},children:e.jsx("div",{role:"none",onClick:s=>s.stopPropagation(),children:o})}),styles:{content:{padding:i?"0px":"20px 0px"},header:{padding:i?"0px":"0px 20px"},body:{padding:i?"0px":C?"0px 20px":"0px"},footer:{padding:i?"0px":"0px 20px"},mask:{zIndex:x||1e3,position:t?"absolute":void 0,top:t?0:void 0,right:t?0:void 0,bottom:t?0:void 0,left:t?0:void 0},wrapper:{zIndex:x||1e3,position:t?"absolute":void 0,top:t?0:void 0,right:t?0:void 0,bottom:t?0:void 0,left:t?0:void 0,backgroundColor:u?"rgb(16 24 40 / 80%)":void 0}},mask:u,...d,width:I,getContainer:()=>a,children:v})};exports.Modal=g;exports.default=g;
2
2
  //# sourceMappingURL=Modal.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.cjs.js","sources":["../../../../src/components/data-display/modal/Modal.tsx"],"sourcesContent":["import { CloseRounded } from \"@mui/icons-material\";\nimport { Modal as AntDModal, type ModalProps as AntDModalProps } from \"antd\";\nimport type { ReactNode } from \"react\";\n// no-op\nimport { Typography } from \"../typography/Typography\";\nimport { useModalContainer } from \"../../../hooks/useModalContainer\";\n\n/**\n * Custom props extending Ant Design Modal props\n */\nexport interface ModalProps extends AntDModalProps {\n /** Whether to show only the body content without header */\n onlyBody?: boolean;\n /** Whether to add spacing to the body */\n bodySpacing?: boolean;\n /** Container element ID for portal rendering */\n parentContainer?: string;\n /** Custom header content on the right side */\n headerRightContent?: ReactNode;\n /** Whether to add a line after the header */\n addLineAfterHeader?: boolean;\n /** Custom z-index for the modal */\n zIndex?: number;\n /** Whether to render as a form */\n asForm?: boolean;\n /** Form submit handler */\n onSubmit?: () => void;\n /** Whether to show the close button */\n showCloseButton?: boolean;\n /** Whether to remove padding */\n noPadding?: boolean;\n /** Close handler */\n onClose?: () => void;\n}\n\n/**\n * Modal component for displaying overlay content\n *\n * @example\n * ```tsx\n * <Modal open={isOpen} onCancel={() => setIsOpen(false)} title=\"Example Modal\">\n * <p>Modal content goes here</p>\n * </Modal>\n * ```\n */\nexport const Modal = (props: ModalProps) => {\n const {\n open,\n children,\n title,\n mask = true,\n onlyBody = false,\n bodySpacing = true,\n headerRightContent,\n parentContainer,\n zIndex,\n asForm = true,\n onSubmit,\n showCloseButton = true,\n noPadding = false,\n ...rest\n } = props;\n\n // Use the hook to find the container with retry mechanism\n const autoContainer = useModalContainer({\n primaryContainerId: \"layout-app-main-content-container\",\n fallbackContainerId: \"full-screen-container\",\n });\n\n const header = (\n <>\n <div className=\"flex justify-between items-center\">\n {showCloseButton ? (\n <Typography size=\"large\" variant=\"semibold\" className=\"tour__title\">\n {title}\n </Typography>\n ) : (\n <div className=\"flex flex-col w-full\">{title}</div>\n )}\n\n {headerRightContent\n ? headerRightContent\n : showCloseButton && (\n <button id=\"btn-modal-close\" onClick={rest.onCancel} className=\"\" type=\"button\">\n <CloseRounded sx={{ fontSize: \"20px\" }} className=\"cursor-pointer text-neutral-400 hover:text-neutral-600\" />\n </button>\n )}\n </div>\n {rest.addLineAfterHeader && <hr className=\"mt-2\" />}\n </>\n );\n\n const Wrapper = asForm ? \"form\" : \"div\";\n\n // Determine target container: use custom prop if provided, otherwise use auto-detected container\n const getTargetContainer = (): HTMLElement | null => {\n if (parentContainer) {\n // If a specific container is provided, search for it\n if (typeof document !== \"undefined\") {\n const local = document.getElementById(parentContainer);\n if (local) return local;\n }\n if (typeof globalThis !== \"undefined\" && globalThis.window && globalThis.window.parent && globalThis.window.parent !== globalThis.window) {\n try {\n const inParent = globalThis.window.parent.document?.getElementById(parentContainer);\n if (inParent) return inParent;\n } catch {\n // Ignore cross-origin access errors\n }\n }\n }\n // Use auto-detected container\n return autoContainer;\n };\n\n if (!open) return null;\n const targetContainer = getTargetContainer();\n \n // Don't render until we have a container\n if (!targetContainer) return null;\n \n const isScopedToContainer = targetContainer !== document.body;\n\n const modalNode = (\n <AntDModal\n open={open}\n centered\n closable={false}\n title={onlyBody ? null : header}\n modalRender={(modal) => (\n <Wrapper\n onSubmit={(e) => {\n e.preventDefault();\n if (onSubmit) {\n onSubmit();\n }\n }}\n >\n {/* Prevent outside click bubbling from custom wrappers */}\n <div role=\"none\" onClick={(e) => e.stopPropagation()}>{modal}</div>\n </Wrapper>\n )}\n styles={{\n content: {\n padding: noPadding ? \"0px\" : \"20px 0px\",\n },\n header: {\n padding: noPadding ? \"0px\" : \"0px 20px\",\n },\n body: {\n padding: noPadding ? \"0px\" : bodySpacing ? \"0px 20px\" : \"0px\",\n },\n footer: {\n padding: noPadding ? \"0px\" : \"0px 20px\",\n },\n mask: {\n zIndex: zIndex || 1000,\n position: isScopedToContainer ? \"absolute\" : undefined,\n top: isScopedToContainer ? 0 : undefined,\n right: isScopedToContainer ? 0 : undefined,\n bottom: isScopedToContainer ? 0 : undefined,\n left: isScopedToContainer ? 0 : undefined,\n },\n wrapper: {\n zIndex: zIndex || 1000,\n position: isScopedToContainer ? \"absolute\" : undefined,\n top: isScopedToContainer ? 0 : undefined,\n right: isScopedToContainer ? 0 : undefined,\n bottom: isScopedToContainer ? 0 : undefined,\n left: isScopedToContainer ? 0 : undefined,\n backgroundColor: mask ? \"rgb(16 24 40 / 80%)\" : undefined,\n },\n }}\n mask={mask}\n {...rest}\n getContainer={() => targetContainer}\n >\n {children}\n </AntDModal>\n );\n\n // No outer portal or mask; rely on AntD's getContainer to scope to the target container\n return modalNode;\n};\n\nexport default Modal;\n"],"names":["Modal","props","open","children","title","mask","onlyBody","bodySpacing","headerRightContent","parentContainer","zIndex","asForm","onSubmit","showCloseButton","noPadding","rest","autoContainer","useModalContainer","header","jsxs","Fragment","jsx","Typography","CloseRounded","Wrapper","getTargetContainer","local","inParent","targetContainer","isScopedToContainer","AntDModal","modal","e"],"mappings":"sSA6CaA,EAASC,GAAsB,CAC1C,KAAM,CACJ,KAAAC,EACA,SAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,GACP,SAAAC,EAAW,GACX,YAAAC,EAAc,GACd,mBAAAC,EACA,gBAAAC,EACA,OAAAC,EACA,OAAAC,EAAS,GACT,SAAAC,EACA,gBAAAC,EAAkB,GAClB,UAAAC,EAAY,GACZ,GAAGC,CAAA,EACDd,EAGEe,EAAgBC,EAAAA,kBAAkB,CACtC,mBAAoB,oCACpB,oBAAqB,uBAAA,CACtB,EAEKC,EACJC,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAD,EAAAA,KAAC,MAAA,CAAI,UAAU,oCACZ,SAAA,CAAAN,EACCQ,EAAAA,IAACC,EAAAA,WAAA,CAAW,KAAK,QAAQ,QAAQ,WAAW,UAAU,cACnD,SAAAlB,CAAA,CACH,EAEAiB,EAAAA,IAAC,MAAA,CAAI,UAAU,uBAAwB,SAAAjB,EAAM,EAG9CI,GAEGK,GACEQ,EAAAA,IAAC,UAAO,GAAG,kBAAkB,QAASN,EAAK,SAAU,UAAU,GAAG,KAAK,SACrE,SAAAM,EAAAA,IAACE,EAAAA,aAAA,CAAa,GAAI,CAAE,SAAU,MAAA,EAAU,UAAU,wDAAA,CAAyD,CAAA,CAC7G,CAAA,EAER,EACCR,EAAK,oBAAsBM,EAAAA,IAAC,KAAA,CAAG,UAAU,MAAA,CAAO,CAAA,EACnD,EAGIG,EAAUb,EAAS,OAAS,MAG5Bc,EAAqB,IAA0B,CACnD,GAAIhB,EAAiB,CAEnB,GAAI,OAAO,SAAa,IAAa,CACnC,MAAMiB,EAAQ,SAAS,eAAejB,CAAe,EACrD,GA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AI,OAChC,gBAAiBxB,EAAO,sBAAwB,MAAA,CAClD,EAEF,KAAAA,EACC,GAAGU,EACJ,aAAc,IAAMa,EAEnB,SAAAzB,CAAA,CAAA,CAMP"}
1
+ {"version":3,"file":"Modal.cjs.js","sources":["../../../../src/components/data-display/modal/Modal.tsx"],"sourcesContent":["import { CloseRounded } from \"@mui/icons-material\";\nimport { Modal as AntDModal, type ModalProps as AntDModalProps } from \"antd\";\nimport type { ReactNode } from \"react\";\n// no-op\nimport { Typography } from \"../typography/Typography\";\nimport { useModalContainer } from \"../../../hooks/useModalContainer\";\nimport { useResponsiveWidth } from \"../../../hooks/useResponsiveWidth\";\n\n/**\n * Custom props extending Ant Design Modal props\n */\nexport interface ModalProps extends AntDModalProps {\n /** Whether to show only the body content without header */\n onlyBody?: boolean;\n /** Whether to add spacing to the body */\n bodySpacing?: boolean;\n /** Container element ID for portal rendering */\n parentContainer?: string;\n /** Custom header content on the right side */\n headerRightContent?: ReactNode;\n /** Whether to add a line after the header */\n addLineAfterHeader?: boolean;\n /** Custom z-index for the modal */\n zIndex?: number;\n /** Whether to render as a form */\n asForm?: boolean;\n /** Form submit handler */\n onSubmit?: () => void;\n /** Whether to show the close button */\n showCloseButton?: boolean;\n /** Whether to remove padding */\n noPadding?: boolean;\n /** Close handler */\n onClose?: () => void;\n}\n\n/**\n * Modal component for displaying overlay content\n *\n * @example\n * ```tsx\n * <Modal open={isOpen} onCancel={() => setIsOpen(false)} title=\"Example Modal\">\n * <p>Modal content goes here</p>\n * </Modal>\n * ```\n */\nexport const Modal = (props: ModalProps) => {\n const {\n open,\n children,\n title,\n mask = true,\n onlyBody = false,\n bodySpacing = true,\n headerRightContent,\n parentContainer,\n zIndex,\n asForm = true,\n onSubmit,\n showCloseButton = true,\n noPadding = false,\n width,\n ...rest\n } = props;\n\n // Use the hook to find the container with retry mechanism\n const autoContainer = useModalContainer({\n primaryContainerId: \"layout-app-main-content-container\",\n fallbackContainerId: \"full-screen-container\",\n });\n\n // Numeric/px widths shrink by viewport breakpoint; AntD's responsive-object\n // width form is passed through untouched.\n const plainWidth =\n typeof width === \"number\" || typeof width === \"string\" ? width : undefined;\n const responsiveWidth = useResponsiveWidth(plainWidth);\n const resolvedWidth =\n plainWidth === undefined && width !== undefined ? width : responsiveWidth;\n\n const header = (\n <>\n <div className=\"flex justify-between items-center\">\n {showCloseButton ? (\n <Typography size=\"large\" variant=\"semibold\" className=\"tour__title\">\n {title}\n </Typography>\n ) : (\n <div className=\"flex flex-col w-full\">{title}</div>\n )}\n\n {headerRightContent\n ? headerRightContent\n : showCloseButton && (\n <button id=\"btn-modal-close\" onClick={rest.onCancel} className=\"\" type=\"button\">\n <CloseRounded sx={{ fontSize: \"20px\" }} className=\"cursor-pointer text-neutral-400 hover:text-neutral-600\" />\n </button>\n )}\n </div>\n {rest.addLineAfterHeader && <hr className=\"mt-2\" />}\n </>\n );\n\n const Wrapper = asForm ? \"form\" : \"div\";\n\n // Determine target container: use custom prop if provided, otherwise use auto-detected container\n const getTargetContainer = (): HTMLElement | null => {\n if (parentContainer) {\n // If a specific container is provided, search for it\n if (typeof document !== \"undefined\") {\n const local = document.getElementById(parentContainer);\n if (local) return local;\n }\n if (typeof globalThis !== \"undefined\" && globalThis.window && globalThis.window.parent && globalThis.window.parent !== globalThis.window) {\n try {\n const inParent = globalThis.window.parent.document?.getElementById(parentContainer);\n if (inParent) return inParent;\n } catch {\n // Ignore cross-origin access errors\n }\n }\n }\n // Use auto-detected container\n return autoContainer;\n };\n\n if (!open) return null;\n const targetContainer = getTargetContainer();\n \n // Don't render until we have a container\n if (!targetContainer) return null;\n \n const isScopedToContainer = targetContainer !== document.body;\n\n const modalNode = (\n <AntDModal\n open={open}\n centered\n closable={false}\n title={onlyBody ? null : header}\n modalRender={(modal) => (\n <Wrapper\n onSubmit={(e) => {\n e.preventDefault();\n if (onSubmit) {\n onSubmit();\n }\n }}\n >\n {/* Prevent outside click bubbling from custom wrappers */}\n <div role=\"none\" onClick={(e) => e.stopPropagation()}>{modal}</div>\n </Wrapper>\n )}\n styles={{\n content: {\n padding: noPadding ? \"0px\" : \"20px 0px\",\n },\n header: {\n padding: noPadding ? \"0px\" : \"0px 20px\",\n },\n body: {\n padding: noPadding ? \"0px\" : bodySpacing ? \"0px 20px\" : \"0px\",\n },\n footer: {\n padding: noPadding ? \"0px\" : \"0px 20px\",\n },\n mask: {\n zIndex: zIndex || 1000,\n position: isScopedToContainer ? \"absolute\" : undefined,\n top: isScopedToContainer ? 0 : undefined,\n right: isScopedToContainer ? 0 : undefined,\n bottom: isScopedToContainer ? 0 : undefined,\n left: isScopedToContainer ? 0 : undefined,\n },\n wrapper: {\n zIndex: zIndex || 1000,\n position: isScopedToContainer ? \"absolute\" : undefined,\n top: isScopedToContainer ? 0 : undefined,\n right: isScopedToContainer ? 0 : undefined,\n bottom: isScopedToContainer ? 0 : undefined,\n left: isScopedToContainer ? 0 : undefined,\n backgroundColor: mask ? \"rgb(16 24 40 / 80%)\" : undefined,\n },\n }}\n mask={mask}\n {...rest}\n width={resolvedWidth}\n getContainer={() => targetContainer}\n >\n {children}\n </AntDModal>\n );\n\n // No outer portal or mask; rely on AntD's getContainer to scope to the target container\n return modalNode;\n};\n\nexport default Modal;\n"],"names":["Modal","props","open","children","title","mask","onlyBody","bodySpacing","headerRightContent","parentContainer","zIndex","asForm","onSubmit","showCloseButton","noPadding","width","rest","autoContainer","useModalContainer","plainWidth","responsiveWidth","useResponsiveWidth","resolvedWidth","header","jsxs","Fragment","jsx","Typography","CloseRounded","Wrapper","getTargetContainer","local","inParent","targetContainer","isScopedToContainer","AntDModal","modal","e"],"mappings":"4VA8CaA,EAASC,GAAsB,CAC1C,KAAM,CACJ,KAAAC,EACA,SAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,GACP,SAAAC,EAAW,GACX,YAAAC,EAAc,GACd,mBAAAC,EACA,gBAAAC,EACA,OAAAC,EACA,OAAAC,EAAS,GACT,SAAAC,EACA,gBAAAC,EAAkB,GAClB,UAA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T,EAEA,GAAI,CAACf,EAAM,OAAO,KAClB,MAAM+B,EAAkBH,EAAA,EAGxB,GAAI,CAACG,EAAiB,OAAO,KAE7B,MAAMC,EAAsBD,IAAoB,SAAS,KA8DzD,OA3DEP,EAAAA,IAACS,EAAAA,MAAA,CACC,KAAAjC,EACA,SAAQ,GACR,SAAU,GACV,MAAOI,EAAW,KAAOiB,EACzB,YAAca,GACZV,EAAAA,IAACG,EAAA,CACC,SAAWQ,GAAM,CACfA,EAAE,eAAA,EACEzB,GACFA,EAAA,CAEJ,EAGA,SAAAc,EAAAA,IAAC,MAAA,CAAI,KAAK,OAAO,QAAUW,GAAMA,EAAE,kBAAoB,SAAAD,CAAA,CAAM,CAAA,CAAA,EAGjE,OAAQ,CACN,QAAS,CACP,QAAStB,EAAY,MAAQ,UAAA,EAE/B,OAAQ,CACN,QAASA,EAAY,MAAQ,UAAA,EAE/B,KAAM,CACJ,QAASA,EAAY,MAAQP,EAAc,WAAa,KAAA,EAE1D,OAAQ,CACN,QAASO,EAAY,MAAQ,UAAA,EAE/B,KAAM,CACJ,OAAQJ,GAAU,IAClB,SAAUwB,EAAsB,WAAa,OAC7C,IAAKA,EAAsB,EAAI,OAC/B,MAAOA,EAAsB,EAAI,OACjC,OAAQA,EAAsB,EAAI,OAClC,KAAMA,EAAsB,EAAI,MAAA,EAElC,QAAS,CACP,OAAQxB,GAAU,IAClB,SAAUwB,EAAsB,WAAa,OAC7C,IAAKA,EAAsB,EAAI,OAC/B,MAAOA,EAAsB,EAAI,OACjC,OAAQA,EAAsB,EAAI,OAClC,KAAMA,EAAsB,EAAI,OAChC,gBAAiB7B,EAAO,sBAAwB,MAAA,CAClD,EAEF,KAAAA,EACC,GAAGW,EACJ,MAAOM,EACP,aAAc,IAAMW,EAEnB,SAAA9B,CAAA,CAAA,CAMP"}
@@ -1,80 +1,82 @@
1
- import { jsxs as g, Fragment as I, jsx as o } from "react/jsx-runtime";
2
- import { CloseRounded as k } from "@mui/icons-material";
3
- import { Modal as z } from "antd";
4
- import { Typography as S } from "../typography/Typography.es.js";
5
- import { useModalContainer as B } from "../../../hooks/useModalContainer.es.js";
6
- const _ = (x) => {
1
+ import { jsxs as x, Fragment as W, jsx as o } from "react/jsx-runtime";
2
+ import { CloseRounded as B } from "@mui/icons-material";
3
+ import { Modal as M } from "antd";
4
+ import { Typography as R } from "../typography/Typography.es.js";
5
+ import { useModalContainer as j } from "../../../hooks/useModalContainer.es.js";
6
+ import { useResponsiveWidth as P } from "../../../hooks/useResponsiveWidth.es.js";
7
+ const $ = (b) => {
7
8
  const {
8
- open: d,
9
- children: h,
10
- title: s,
11
- mask: p = !0,
12
- onlyBody: b = !1,
13
- bodySpacing: v = !0,
14
- headerRightContent: c,
15
- parentContainer: i,
9
+ open: s,
10
+ children: v,
11
+ title: p,
12
+ mask: c = !0,
13
+ onlyBody: y = !1,
14
+ bodySpacing: w = !0,
15
+ headerRightContent: m,
16
+ parentContainer: r,
16
17
  zIndex: u,
17
- asForm: y = !0,
18
- onSubmit: m,
19
- showCloseButton: f = !0,
20
- noPadding: n = !1,
21
- ...r
22
- } = x, C = B({
18
+ asForm: C = !0,
19
+ onSubmit: f,
20
+ showCloseButton: h = !0,
21
+ noPadding: i = !1,
22
+ width: n,
23
+ ...d
24
+ } = b, T = j({
23
25
  primaryContainerId: "layout-app-main-content-container",
24
26
  fallbackContainerId: "full-screen-container"
25
- }), w = /* @__PURE__ */ g(I, { children: [
26
- /* @__PURE__ */ g("div", { className: "flex justify-between items-center", children: [
27
- f ? /* @__PURE__ */ o(S, { size: "large", variant: "semibold", className: "tour__title", children: s }) : /* @__PURE__ */ o("div", { className: "flex flex-col w-full", children: s }),
28
- c || f && /* @__PURE__ */ o("button", { id: "btn-modal-close", onClick: r.onCancel, className: "", type: "button", children: /* @__PURE__ */ o(k, { sx: { fontSize: "20px" }, className: "cursor-pointer text-neutral-400 hover:text-neutral-600" }) })
27
+ }), g = typeof n == "number" || typeof n == "string" ? n : void 0, N = P(g), I = g === void 0 && n !== void 0 ? n : N, k = /* @__PURE__ */ x(W, { children: [
28
+ /* @__PURE__ */ x("div", { className: "flex justify-between items-center", children: [
29
+ h ? /* @__PURE__ */ o(R, { size: "large", variant: "semibold", className: "tour__title", children: p }) : /* @__PURE__ */ o("div", { className: "flex flex-col w-full", children: p }),
30
+ m || h && /* @__PURE__ */ o("button", { id: "btn-modal-close", onClick: d.onCancel, className: "", type: "button", children: /* @__PURE__ */ o(B, { sx: { fontSize: "20px" }, className: "cursor-pointer text-neutral-400 hover:text-neutral-600" }) })
29
31
  ] }),
30
- r.addLineAfterHeader && /* @__PURE__ */ o("hr", { className: "mt-2" })
31
- ] }), T = y ? "form" : "div", N = () => {
32
- if (i) {
32
+ d.addLineAfterHeader && /* @__PURE__ */ o("hr", { className: "mt-2" })
33
+ ] }), z = C ? "form" : "div", S = () => {
34
+ if (r) {
33
35
  if (typeof document < "u") {
34
- const t = document.getElementById(i);
36
+ const t = document.getElementById(r);
35
37
  if (t) return t;
36
38
  }
37
39
  if (typeof globalThis < "u" && globalThis.window && globalThis.window.parent && globalThis.window.parent !== globalThis.window)
38
40
  try {
39
- const t = globalThis.window.parent.document?.getElementById(i);
41
+ const t = globalThis.window.parent.document?.getElementById(r);
40
42
  if (t) return t;
41
43
  } catch {
42
44
  }
43
45
  }
44
- return C;
46
+ return T;
45
47
  };
46
- if (!d) return null;
47
- const a = N();
48
+ if (!s) return null;
49
+ const a = S();
48
50
  if (!a) return null;
49
51
  const e = a !== document.body;
50
52
  return /* @__PURE__ */ o(
51
- z,
53
+ M,
52
54
  {
53
- open: d,
55
+ open: s,
54
56
  centered: !0,
55
57
  closable: !1,
56
- title: b ? null : w,
58
+ title: y ? null : k,
57
59
  modalRender: (t) => /* @__PURE__ */ o(
58
- T,
60
+ z,
59
61
  {
60
62
  onSubmit: (l) => {
61
- l.preventDefault(), m && m();
63
+ l.preventDefault(), f && f();
62
64
  },
63
65
  children: /* @__PURE__ */ o("div", { role: "none", onClick: (l) => l.stopPropagation(), children: t })
64
66
  }
65
67
  ),
66
68
  styles: {
67
69
  content: {
68
- padding: n ? "0px" : "20px 0px"
70
+ padding: i ? "0px" : "20px 0px"
69
71
  },
70
72
  header: {
71
- padding: n ? "0px" : "0px 20px"
73
+ padding: i ? "0px" : "0px 20px"
72
74
  },
73
75
  body: {
74
- padding: n ? "0px" : v ? "0px 20px" : "0px"
76
+ padding: i ? "0px" : w ? "0px 20px" : "0px"
75
77
  },
76
78
  footer: {
77
- padding: n ? "0px" : "0px 20px"
79
+ padding: i ? "0px" : "0px 20px"
78
80
  },
79
81
  mask: {
80
82
  zIndex: u || 1e3,
@@ -91,18 +93,19 @@ const _ = (x) => {
91
93
  right: e ? 0 : void 0,
92
94
  bottom: e ? 0 : void 0,
93
95
  left: e ? 0 : void 0,
94
- backgroundColor: p ? "rgb(16 24 40 / 80%)" : void 0
96
+ backgroundColor: c ? "rgb(16 24 40 / 80%)" : void 0
95
97
  }
96
98
  },
97
- mask: p,
98
- ...r,
99
+ mask: c,
100
+ ...d,
101
+ width: I,
99
102
  getContainer: () => a,
100
- children: h
103
+ children: v
101
104
  }
102
105
  );
103
106
  };
104
107
  export {
105
- _ as Modal,
106
- _ as default
108
+ $ as Modal,
109
+ $ as default
107
110
  };
108
111
  //# sourceMappingURL=Modal.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.es.js","sources":["../../../../src/components/data-display/modal/Modal.tsx"],"sourcesContent":["import { CloseRounded } from \"@mui/icons-material\";\nimport { Modal as AntDModal, type ModalProps as AntDModalProps } from \"antd\";\nimport type { ReactNode } from \"react\";\n// no-op\nimport { Typography } from \"../typography/Typography\";\nimport { useModalContainer } from \"../../../hooks/useModalContainer\";\n\n/**\n * Custom props extending Ant Design Modal props\n */\nexport interface ModalProps extends AntDModalProps {\n /** Whether to show only the body content without header */\n onlyBody?: boolean;\n /** Whether to add spacing to the body */\n bodySpacing?: boolean;\n /** Container element ID for portal rendering */\n parentContainer?: string;\n /** Custom header content on the right side */\n headerRightContent?: ReactNode;\n /** Whether to add a line after the header */\n addLineAfterHeader?: boolean;\n /** Custom z-index for the modal */\n zIndex?: number;\n /** Whether to render as a form */\n asForm?: boolean;\n /** Form submit handler */\n onSubmit?: () => void;\n /** Whether to show the close button */\n showCloseButton?: boolean;\n /** Whether to remove padding */\n noPadding?: boolean;\n /** Close handler */\n onClose?: () => void;\n}\n\n/**\n * Modal component for displaying overlay content\n *\n * @example\n * ```tsx\n * <Modal open={isOpen} onCancel={() => setIsOpen(false)} title=\"Example Modal\">\n * <p>Modal content goes here</p>\n * </Modal>\n * ```\n */\nexport const Modal = (props: ModalProps) => {\n const {\n open,\n children,\n title,\n mask = true,\n onlyBody = false,\n bodySpacing = true,\n headerRightContent,\n parentContainer,\n zIndex,\n asForm = true,\n onSubmit,\n showCloseButton = true,\n noPadding = false,\n ...rest\n } = props;\n\n // Use the hook to find the container with retry mechanism\n const autoContainer = useModalContainer({\n primaryContainerId: \"layout-app-main-content-container\",\n fallbackContainerId: \"full-screen-container\",\n });\n\n const header = (\n <>\n <div className=\"flex justify-between items-center\">\n {showCloseButton ? (\n <Typography size=\"large\" variant=\"semibold\" className=\"tour__title\">\n {title}\n </Typography>\n ) : (\n <div className=\"flex flex-col w-full\">{title}</div>\n )}\n\n {headerRightContent\n ? headerRightContent\n : showCloseButton && (\n <button id=\"btn-modal-close\" onClick={rest.onCancel} className=\"\" type=\"button\">\n <CloseRounded sx={{ fontSize: \"20px\" }} className=\"cursor-pointer text-neutral-400 hover:text-neutral-600\" />\n </button>\n )}\n </div>\n {rest.addLineAfterHeader && <hr className=\"mt-2\" />}\n </>\n );\n\n const Wrapper = asForm ? \"form\" : \"div\";\n\n // Determine target container: use custom prop if provided, otherwise use auto-detected container\n const getTargetContainer = (): HTMLElement | null => {\n if (parentContainer) {\n // If a specific container is provided, search for it\n if (typeof document !== \"undefined\") {\n const local = document.getElementById(parentContainer);\n if (local) return local;\n }\n if (typeof globalThis !== \"undefined\" && globalThis.window && globalThis.window.parent && globalThis.window.parent !== globalThis.window) {\n try {\n const inParent = globalThis.window.parent.document?.getElementById(parentContainer);\n if (inParent) return inParent;\n } catch {\n // Ignore cross-origin access errors\n }\n }\n }\n // Use auto-detected container\n return autoContainer;\n };\n\n if (!open) return null;\n const targetContainer = getTargetContainer();\n \n // Don't render until we have a container\n if (!targetContainer) return null;\n \n const isScopedToContainer = targetContainer !== document.body;\n\n const modalNode = (\n <AntDModal\n open={open}\n centered\n closable={false}\n title={onlyBody ? null : header}\n modalRender={(modal) => (\n <Wrapper\n onSubmit={(e) => {\n e.preventDefault();\n if (onSubmit) {\n onSubmit();\n }\n }}\n >\n {/* Prevent outside click bubbling from custom wrappers */}\n <div role=\"none\" onClick={(e) => e.stopPropagation()}>{modal}</div>\n </Wrapper>\n )}\n styles={{\n content: {\n padding: noPadding ? \"0px\" : \"20px 0px\",\n },\n header: {\n padding: noPadding ? \"0px\" : \"0px 20px\",\n },\n body: {\n padding: noPadding ? \"0px\" : bodySpacing ? \"0px 20px\" : \"0px\",\n },\n footer: {\n padding: noPadding ? \"0px\" : \"0px 20px\",\n },\n mask: {\n zIndex: zIndex || 1000,\n position: isScopedToContainer ? \"absolute\" : undefined,\n top: isScopedToContainer ? 0 : undefined,\n right: isScopedToContainer ? 0 : undefined,\n bottom: isScopedToContainer ? 0 : undefined,\n left: isScopedToContainer ? 0 : undefined,\n },\n wrapper: {\n zIndex: zIndex || 1000,\n position: isScopedToContainer ? \"absolute\" : undefined,\n top: isScopedToContainer ? 0 : undefined,\n right: isScopedToContainer ? 0 : undefined,\n bottom: isScopedToContainer ? 0 : undefined,\n left: isScopedToContainer ? 0 : undefined,\n backgroundColor: mask ? \"rgb(16 24 40 / 80%)\" : undefined,\n },\n }}\n mask={mask}\n {...rest}\n getContainer={() => targetContainer}\n >\n {children}\n </AntDModal>\n );\n\n // No outer portal or mask; rely on AntD's getContainer to scope to the target container\n return modalNode;\n};\n\nexport default Modal;\n"],"names":["Modal","props","open","children","title","mask","onlyBody","bodySpacing","headerRightContent","parentContainer","zIndex","asForm","onSubmit","showCloseButton","noPadding","rest","autoContainer","useModalContainer","header","jsxs","Fragment","jsx","Typography","CloseRounded","Wrapper","getTargetContainer","local","inParent","targetContainer","isScopedToContainer","AntDModal","modal","e"],"mappings":";;;;;AA6CO,MAAMA,IAAQ,CAACC,MAAsB;AAC1C,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,aAAAC,IAAc;AAAA,IACd,oBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,WAAAC,IAAY;AAAA,IACZ,GAAGC;AAAA,EAAA,IACDd,GAGEe,IAAgBC,EAAkB;AAAA,IACtC,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,EAAA,CACtB,GAEKC,IACJ,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EAAI,WAAU,qCACZ,UAAA;AAAA,MAAAN,IACC,gBAAAQ,EAACC,GAAA,EAAW,MAAK,SAAQ,SAAQ,YAAW,WAAU,eACnD,UAAAlB,EAAA,CACH,IAEA,gBAAAiB,EAAC,OAAA,EAAI,WAAU,wBAAwB,UAAAjB,GAAM;AAAA,MAG9CI,KAEGK,KACE,gBAAAQ,EAAC,YAAO,IAAG,mBAAkB,SAASN,EAAK,UAAU,WAAU,IAAG,MAAK,UACrE,UAAA,gBAAAM,EAACE,GAAA,EAAa,IAAI,EAAE,UAAU,OAAA,GAAU,WAAU,yDAAA,CAAyD,EAAA,CAC7G;AAAA,IAAA,GAER;AAAA,IACCR,EAAK,sBAAsB,gBAAAM,EAAC,MAAA,EAAG,WAAU,OAAA,CAAO;AAAA,EAAA,GACnD,GAGIG,IAAUb,IAAS,SAAS,OAG5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E/B,MAAM;AAAA,UACJ,QAAQJ,KAAU;AAAA,UAClB,UAAUmB,IAAsB,aAAa;AAAA,UAC7C,KAAKA,IAAsB,IAAI;AAAA,UAC/B,OAAOA,IAAsB,IAAI;AAAA,UACjC,QAAQA,IAAsB,IAAI;AAAA,UAClC,MAAMA,IAAsB,IAAI;AAAA,QAAA;AAAA,QAElC,SAAS;AAAA,UACP,QAAQnB,KAAU;AAAA,UAClB,UAAUmB,IAAsB,aAAa;AAAA,UAC7C,KAAKA,IAAsB,IAAI;AAAA,UAC/B,OAAOA,IAAsB,IAAI;AAAA,UACjC,QAAQA,IAAsB,IAAI;AAAA,UAClC,MAAMA,IAAsB,IAAI;AAAA,UAChC,iBAAiBxB,IAAO,wBAAwB;AAAA,QAAA;AAAA,MAClD;AAAA,MAEF,MAAAA;AAAA,MACC,GAAGU;AAAA,MACJ,cAAc,MAAMa;AAAA,MAEnB,UAAAzB;AAAA,IAAA;AAAA,EAAA;AAMP;"}
1
+ {"version":3,"file":"Modal.es.js","sources":["../../../../src/components/data-display/modal/Modal.tsx"],"sourcesContent":["import { CloseRounded } from \"@mui/icons-material\";\nimport { Modal as AntDModal, type ModalProps as AntDModalProps } from \"antd\";\nimport type { ReactNode } from \"react\";\n// no-op\nimport { Typography } from \"../typography/Typography\";\nimport { useModalContainer } from \"../../../hooks/useModalContainer\";\nimport { useResponsiveWidth } from \"../../../hooks/useResponsiveWidth\";\n\n/**\n * Custom props extending Ant Design Modal props\n */\nexport interface ModalProps extends AntDModalProps {\n /** Whether to show only the body content without header */\n onlyBody?: boolean;\n /** Whether to add spacing to the body */\n bodySpacing?: boolean;\n /** Container element ID for portal rendering */\n parentContainer?: string;\n /** Custom header content on the right side */\n headerRightContent?: ReactNode;\n /** Whether to add a line after the header */\n addLineAfterHeader?: boolean;\n /** Custom z-index for the modal */\n zIndex?: number;\n /** Whether to render as a form */\n asForm?: boolean;\n /** Form submit handler */\n onSubmit?: () => void;\n /** Whether to show the close button */\n showCloseButton?: boolean;\n /** Whether to remove padding */\n noPadding?: boolean;\n /** Close handler */\n onClose?: () => void;\n}\n\n/**\n * Modal component for displaying overlay content\n *\n * @example\n * ```tsx\n * <Modal open={isOpen} onCancel={() => setIsOpen(false)} title=\"Example Modal\">\n * <p>Modal content goes here</p>\n * </Modal>\n * ```\n */\nexport const Modal = (props: ModalProps) => {\n const {\n open,\n children,\n title,\n mask = true,\n onlyBody = false,\n bodySpacing = true,\n headerRightContent,\n parentContainer,\n zIndex,\n asForm = true,\n onSubmit,\n showCloseButton = true,\n noPadding = false,\n width,\n ...rest\n } = props;\n\n // Use the hook to find the container with retry mechanism\n const autoContainer = useModalContainer({\n primaryContainerId: \"layout-app-main-content-container\",\n fallbackContainerId: \"full-screen-container\",\n });\n\n // Numeric/px widths shrink by viewport breakpoint; AntD's responsive-object\n // width form is passed through untouched.\n const plainWidth =\n typeof width === \"number\" || typeof width === \"string\" ? width : undefined;\n const responsiveWidth = useResponsiveWidth(plainWidth);\n const resolvedWidth =\n plainWidth === undefined && width !== undefined ? width : responsiveWidth;\n\n const header = (\n <>\n <div className=\"flex justify-between items-center\">\n {showCloseButton ? (\n <Typography size=\"large\" variant=\"semibold\" className=\"tour__title\">\n {title}\n </Typography>\n ) : (\n <div className=\"flex flex-col w-full\">{title}</div>\n )}\n\n {headerRightContent\n ? headerRightContent\n : showCloseButton && (\n <button id=\"btn-modal-close\" onClick={rest.onCancel} className=\"\" type=\"button\">\n <CloseRounded sx={{ fontSize: \"20px\" }} className=\"cursor-pointer text-neutral-400 hover:text-neutral-600\" />\n </button>\n )}\n </div>\n {rest.addLineAfterHeader && <hr className=\"mt-2\" />}\n </>\n );\n\n const Wrapper = asForm ? \"form\" : \"div\";\n\n // Determine target container: use custom prop if provided, otherwise use auto-detected container\n const getTargetContainer = (): HTMLElement | null => {\n if (parentContainer) {\n // If a specific container is provided, search for it\n if (typeof document !== \"undefined\") {\n const local = document.getElementById(parentContainer);\n if (local) return local;\n }\n if (typeof globalThis !== \"undefined\" && globalThis.window && globalThis.window.parent && globalThis.window.parent !== globalThis.window) {\n try {\n const inParent = globalThis.window.parent.document?.getElementById(parentContainer);\n if (inParent) return inParent;\n } catch {\n // Ignore cross-origin access errors\n }\n }\n }\n // Use auto-detected container\n return autoContainer;\n };\n\n if (!open) return null;\n const targetContainer = getTargetContainer();\n \n // Don't render until we have a container\n if (!targetContainer) return null;\n \n const isScopedToContainer = targetContainer !== document.body;\n\n const modalNode = (\n <AntDModal\n open={open}\n centered\n closable={false}\n title={onlyBody ? null : header}\n modalRender={(modal) => (\n <Wrapper\n onSubmit={(e) => {\n e.preventDefault();\n if (onSubmit) {\n onSubmit();\n }\n }}\n >\n {/* Prevent outside click bubbling from custom wrappers */}\n <div role=\"none\" onClick={(e) => e.stopPropagation()}>{modal}</div>\n </Wrapper>\n )}\n styles={{\n content: {\n padding: noPadding ? \"0px\" : \"20px 0px\",\n },\n header: {\n padding: noPadding ? \"0px\" : \"0px 20px\",\n },\n body: {\n padding: noPadding ? \"0px\" : bodySpacing ? \"0px 20px\" : \"0px\",\n },\n footer: {\n padding: noPadding ? \"0px\" : \"0px 20px\",\n },\n mask: {\n zIndex: zIndex || 1000,\n position: isScopedToContainer ? \"absolute\" : undefined,\n top: isScopedToContainer ? 0 : undefined,\n right: isScopedToContainer ? 0 : undefined,\n bottom: isScopedToContainer ? 0 : undefined,\n left: isScopedToContainer ? 0 : undefined,\n },\n wrapper: {\n zIndex: zIndex || 1000,\n position: isScopedToContainer ? \"absolute\" : undefined,\n top: isScopedToContainer ? 0 : undefined,\n right: isScopedToContainer ? 0 : undefined,\n bottom: isScopedToContainer ? 0 : undefined,\n left: isScopedToContainer ? 0 : undefined,\n backgroundColor: mask ? \"rgb(16 24 40 / 80%)\" : undefined,\n },\n }}\n mask={mask}\n {...rest}\n width={resolvedWidth}\n getContainer={() => targetContainer}\n >\n {children}\n </AntDModal>\n );\n\n // No outer portal or mask; rely on AntD's getContainer to scope to the target container\n return modalNode;\n};\n\nexport default Modal;\n"],"names":["Modal","props","open","children","title","mask","onlyBody","bodySpacing","headerRightContent","parentContainer","zIndex","asForm","onSubmit","showCloseButton","noPadding","width","rest","autoContainer","useModalContainer","plainWidth","responsiveWidth","useResponsiveWidth","resolvedWidth","header","jsxs","Fragment","jsx","Typography","CloseRounded","Wrapper","getTargetContainer","local","inParent","targetContainer","isScopedToContainer","AntDModal","modal","e"],"mappings":";;;;;;AA8CO,MAAMA,IAAQ,CAACC,MAAsB;AAC1C,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,aAAAC,IAAc;AAAA,IACd,oBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDf,GAGEgB,IAAgBC,EAAkB;AAAA,IACtC,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,EAAA,CACtB,GAIKC,IACJ,OAAOJ,KAAU,YAAY,OAAOA,KAAU,WAAWA,IAAQ,QAC7DK,IAAkBC,EAAmBF,CAAU,GAC/CG,IACJH,MAAe,UAAaJ,MAAU,SAAYA,IAAQK,GAEtDG,IACJ,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EAAI,WAAU,qCACZ,UAAA;AAAA,MAAAX,IACC,gBAAAa,EAACC,GAAA,EAAW,MAAK,SAAQ,SAAQ,YAAW,WAAU,eACnD,UAAAvB,EAAA,CACH,IAEA,gBAAAsB,EAAC,OAAA,EAAI,WAAU,wBAAwB,UAAAtB,GAAM;AAAA,MAG9CI,KAEGK,KACE,gBAAAa,EAAC,YAAO,IAAG,mBAAkB,SAASV,EAAK,UAAU,WAAU,IAAG,MAAK,UACrE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AAStB,IAAY,QAAQ;AAAA,QAAA;AAAA,QAE/B,QAAQ;AAAA,UACN,SAASA,IAAY,QAAQ;AAAA,QAAA;AAAA,QAE/B,MAAM;AAAA,UACJ,SAASA,IAAY,QAAQP,IAAc,aAAa;AAAA,QAAA;AAAA,QAE1D,QAAQ;AAAA,UACN,SAASO,IAAY,QAAQ;AAAA,QAAA;AAAA,QAE/B,MAAM;AAAA,UACJ,QAAQJ,KAAU;AAAA,UAClB,UAAUwB,IAAsB,aAAa;AAAA,UAC7C,KAAKA,IAAsB,IAAI;AAAA,UAC/B,OAAOA,IAAsB,IAAI;AAAA,UACjC,QAAQA,IAAsB,IAAI;AAAA,UAClC,MAAMA,IAAsB,IAAI;AAAA,QAAA;AAAA,QAElC,SAAS;AAAA,UACP,QAAQxB,KAAU;AAAA,UAClB,UAAUwB,IAAsB,aAAa;AAAA,UAC7C,KAAKA,IAAsB,IAAI;AAAA,UAC/B,OAAOA,IAAsB,IAAI;AAAA,UACjC,QAAQA,IAAsB,IAAI;AAAA,UAClC,MAAMA,IAAsB,IAAI;AAAA,UAChC,iBAAiB7B,IAAO,wBAAwB;AAAA,QAAA;AAAA,MAClD;AAAA,MAEF,MAAAA;AAAA,MACC,GAAGW;AAAA,MACJ,OAAOM;AAAA,MACP,cAAc,MAAMW;AAAA,MAEnB,UAAA9B;AAAA,IAAA;AAAA,EAAA;AAMP;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),x=require("../../../_virtual/index.cjs.js"),F=require("framer-motion"),o=require("react"),_=require("react-dom"),A=require("re-resizable"),I=()=>t.jsx("div",{className:"cursor-ew-resize flex items-center justify-center rounded-full bg-[#1018288F] bg-opacity-55 w-8 h-8 shadow-200 border-[1.5px] border-[#FFFFFF3D]",children:t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("mask",{id:"mask0_36675_12",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:t.jsx("rect",{y:"20",width:"20",height:"20",transform:"rotate(-90 0 20)",fill:"#D9D9D9"})}),t.jsx("g",{mask:"url(#mask0_36675_12)",children:t.jsx("path",{d:"M15.9583 10L12.7292 6.77084C12.5625 6.60418 12.4792 6.40973 12.4792 6.18751C12.4792 5.96529 12.5625 5.77084 12.7292 5.60418C12.8958 5.43751 13.0938 5.35418 13.3229 5.35418C13.5521 5.35418 13.75 5.43751 13.9167 5.60418L17.1458 8.81251C17.4653 9.13195 17.625 9.52779 17.625 10C17.625 10.4722 17.4653 10.8681 17.1458 11.1875L13.9167 14.4167C13.75 14.5833 13.5521 14.6632 13.3229 14.6563C13.0938 14.6493 12.8958 14.5625 12.7292 14.3958C12.5625 14.2292 12.4792 14.0313 12.4792 13.8021C12.4792 13.5729 12.5625 13.375 12.7292 13.2083L15.9583 10ZM4.04167 10L7.25 13.2083C7.41667 13.375 7.49653 13.5695 7.48958 13.7917C7.48264 14.0139 7.40278 14.2083 7.25 14.375C7.08333 14.5417 6.88542 14.6285 6.65625 14.6354C6.42708 14.6424 6.22917 14.5625 6.0625 14.3958L2.85417 11.1875C2.53472 10.8681 2.375 10.4722 2.375 10C2.375 9.52779 2.53472 9.13195 2.85417 8.81251L6.0625 5.60418C6.22917 5.43751 6.42708 5.35765 6.65625 5.36459C6.88542 5.37154 7.08333 5.45834 7.25 5.62501C7.40278 5.79168 7.48264 5.98612 7.48958 6.20834C7.49653 6.43057 7.41667 6.62501 7.25 6.79168L4.04167 10Z",fill:"white"})})]})}),T=(e,r)=>{const i=document.getElementById(e);i?r(i):requestAnimationFrame(()=>{const s=document.getElementById(e);s&&r(s)})},B=(e,r)=>{if(e.current){if(r)localStorage.setItem("resizable-sidebar-width-before-fullscreen",String(e.current.size?.width));else{const i=localStorage.getItem("resizable-sidebar-width-before-fullscreen");if(i){e.current.updateSize({width:i,height:"100%"});return}}e.current.updateSize({width:r?"100vw":"",height:"100%"})}},H=(e,r,i,s,l,w)=>{const[u,n]=o.useState(!1),[d,a]=o.useState(null);return o.useEffect(()=>{if(!e||typeof window>"u"){a(null);return}T(e,a)},[e]),o.useEffect(()=>{B(l,i)},[i]),o.useEffect(()=>{if(e&&r){const c=requestAnimationFrame(()=>{n(!0)});return()=>{cancelAnimationFrame(c),n(!1)}}e||n(!0),r||n(!1)},[r,e]),o.useEffect(()=>{l.current?.size?.width&&s&&s(l.current.size.width)},[l.current?.size?.width,s]),{shouldRenderSidebar:u,portalTarget:d}},W=({isOpen:e,header:r,id:i,ref:s,className:l,containerClassName:w,widthStyle:u,heightStyle:n,motionVariants:d,resizableRef:a,fullScreen:c,maxResizableWidth:m,minWidth:b,handleKey:h,onDragEnd:v,onResize:g,children:y})=>t.jsx(F.AnimatePresence,{children:e&&t.jsx(F.motion.div,{ref:s,id:i,initial:d.initial,animate:d.animate,exit:d.exit,transition:{type:"tween",duration:.3},className:x("flex-shrink-0 z-50 relative bg-white border-neutral-200 dark:bg-black-800 dark:border-black-700",c?"fixed w-full transition translate-x-4 duration-300":"sticky",l),style:{width:u,height:n},children:t.jsx(A.Resizable,{onResize:f=>{f.stopPropagation();const p=a.current?.size?.width;g&&g(p||b)},onResizeStart:f=>{f.stopPropagation()},ref:a,maxWidth:c?m:m*.75,minWidth:b,minHeight:n,maxHeight:n,enable:c?{}:{[h]:!0},handleClasses:{[h]:x("relative w-6 -left-1 flex items-center justify-center bg-transparent transition-colors cursor-ew-resize group z-[9999] hover:bg-neutral-200 dark:hover:bg-neutral-700")},handleComponent:{[h]:t.jsx("div",{className:x("absolute -left-2.5 top-1/2 -translate-y-1/2 flex items-center justify-center w-8 h-12 cursor-ew-resize opacity-0 group-hover:opacity-100 hover:opacity-100 active:opacity-100 transition-opacity z-[9999]",h==="left"&&"-right-2.5 -left-auto"),children:t.jsx(I,{})})},className:"!h-full",onResizeStop:v||void 0,children:t.jsxs("div",{className:x("h-full w-full flex flex-col overflow-hidden @container/sidebar border-b border-neutral-200 dark:border-black-700 bg-white dark:bg-black-800 dark:border",w),children:[r?t.jsx("div",{className:"py-4 px-6",children:r||null}):null,t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:y})]})})})}),q=o.forwardRef(({isOpen:e,children:r,fullScreen:i=!1,defaultSize:s=void 0,minWidth:l=400,onDragEnd:w=null,onResize:u,className:n,placement:d="right",parentContainer:a,header:c,id:m,containerClassName:b,ignoreParentContainerHeight:h=!1,height:v,isMainSidebarExpanded:g=!1,mainSidebarExpandedWidth:y=280,mainSidebarCollapsedWidth:f=80,navbarHeight:p=64},E)=>{const L=g?y:f,S=o.useRef(null),{shouldRenderSidebar:k,portalTarget:C}=H(a,e,i,u,S),N=typeof window<"u"?window.innerWidth-L:0,R=s,j=d==="right",D=v||(a&&!h?"100%":`calc(100vh - ${p}px)`),P={initial:{x:j?"100%":"-100%"},animate:{x:0},exit:{x:j?"100%":"-100%"}},M=j?"left":"right",z=t.jsx(W,{isOpen:e,header:c,id:m,ref:E,className:n,containerClassName:b,widthStyle:R,heightStyle:D,motionVariants:P,resizableRef:S,fullScreen:i,maxResizableWidth:N,minWidth:l,handleKey:M,onDragEnd:w,onResize:u,children:r});return a?!k||!C?null:_.createPortal(z,C):k?z:null});q.displayName="ResizableSidebar";exports.ResizableSidebar=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),w=require("../../../_virtual/index.cjs.js"),R=require("framer-motion"),l=require("react"),I=require("react-dom"),T=require("re-resizable"),q=require("../../../hooks/useResponsiveWidth.cjs.js"),B=()=>t.jsx("div",{className:"cursor-ew-resize flex items-center justify-center rounded-full bg-[#1018288F] bg-opacity-55 w-8 h-8 shadow-200 border-[1.5px] border-[#FFFFFF3D]",children:t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("mask",{id:"mask0_36675_12",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:t.jsx("rect",{y:"20",width:"20",height:"20",transform:"rotate(-90 0 20)",fill:"#D9D9D9"})}),t.jsx("g",{mask:"url(#mask0_36675_12)",children:t.jsx("path",{d:"M15.9583 10L12.7292 6.77084C12.5625 6.60418 12.4792 6.40973 12.4792 6.18751C12.4792 5.96529 12.5625 5.77084 12.7292 5.60418C12.8958 5.43751 13.0938 5.35418 13.3229 5.35418C13.5521 5.35418 13.75 5.43751 13.9167 5.60418L17.1458 8.81251C17.4653 9.13195 17.625 9.52779 17.625 10C17.625 10.4722 17.4653 10.8681 17.1458 11.1875L13.9167 14.4167C13.75 14.5833 13.5521 14.6632 13.3229 14.6563C13.0938 14.6493 12.8958 14.5625 12.7292 14.3958C12.5625 14.2292 12.4792 14.0313 12.4792 13.8021C12.4792 13.5729 12.5625 13.375 12.7292 13.2083L15.9583 10ZM4.04167 10L7.25 13.2083C7.41667 13.375 7.49653 13.5695 7.48958 13.7917C7.48264 14.0139 7.40278 14.2083 7.25 14.375C7.08333 14.5417 6.88542 14.6285 6.65625 14.6354C6.42708 14.6424 6.22917 14.5625 6.0625 14.3958L2.85417 11.1875C2.53472 10.8681 2.375 10.4722 2.375 10C2.375 9.52779 2.53472 9.13195 2.85417 8.81251L6.0625 5.60418C6.22917 5.43751 6.42708 5.35765 6.65625 5.36459C6.88542 5.37154 7.08333 5.45834 7.25 5.62501C7.40278 5.79168 7.48264 5.98612 7.48958 6.20834C7.49653 6.43057 7.41667 6.62501 7.25 6.79168L4.04167 10Z",fill:"white"})})]})}),H=(e,i)=>{const r=document.getElementById(e);r?i(r):requestAnimationFrame(()=>{const s=document.getElementById(e);s&&i(s)})},U=(e,i)=>{if(e.current){if(i)localStorage.setItem("resizable-sidebar-width-before-fullscreen",String(e.current.size?.width));else{const r=localStorage.getItem("resizable-sidebar-width-before-fullscreen");if(r){e.current.updateSize({width:r,height:"100%"});return}}e.current.updateSize({width:i?"100vw":"",height:"100%"})}},Z=(e,i,r,s,o,b)=>{const[c,a]=l.useState(!1),[d,n]=l.useState(null);return l.useEffect(()=>{if(!e||typeof window>"u"){n(null);return}H(e,n)},[e]),l.useEffect(()=>{U(o,r)},[r]),l.useEffect(()=>{if(e&&i){const u=requestAnimationFrame(()=>{a(!0)});return()=>{cancelAnimationFrame(u),a(!1)}}e||a(!0),i||a(!1)},[i,e]),l.useEffect(()=>{o.current?.size?.width&&s&&s(o.current.size.width)},[o.current?.size?.width,s]),{shouldRenderSidebar:c,portalTarget:d}},$=({isOpen:e,header:i,id:r,ref:s,className:o,containerClassName:b,headerClassName:c,widthStyle:a,heightStyle:d,motionVariants:n,resizableRef:u,fullScreen:f,maxResizableWidth:g,minWidth:x,handleKey:h,onDragEnd:p,onResize:v,children:y})=>t.jsx(R.AnimatePresence,{children:e&&t.jsx(R.motion.div,{ref:s,id:r,initial:n.initial,animate:n.animate,exit:n.exit,transition:{type:"tween",duration:.3},className:w("flex-shrink-0 z-50 relative bg-white border-neutral-200 dark:bg-black-800 dark:border-black-700",f?"fixed w-full transition translate-x-4 duration-300":"sticky",o),style:{width:a,height:d},children:t.jsx(T.Resizable,{onResize:m=>{m.stopPropagation();const j=u.current?.size?.width;v&&v(j||x)},onResizeStart:m=>{m.stopPropagation()},ref:u,maxWidth:f?g:g*.75,minWidth:x,minHeight:d,maxHeight:d,enable:f?{}:{[h]:!0},handleClasses:{[h]:w("relative w-6 -left-1 flex items-center justify-center bg-transparent transition-colors cursor-ew-resize group z-[9999] hover:bg-neutral-200 dark:hover:bg-neutral-700")},handleComponent:{[h]:t.jsx("div",{className:w("absolute -left-2.5 top-1/2 -translate-y-1/2 flex items-center justify-center w-8 h-12 cursor-ew-resize opacity-0 group-hover:opacity-100 hover:opacity-100 active:opacity-100 transition-opacity z-[9999]",h==="left"&&"-right-2.5 -left-auto"),children:t.jsx(B,{})})},className:"!h-full",onResizeStop:p||void 0,children:t.jsxs("div",{className:w("h-full w-full flex flex-col overflow-hidden @container/sidebar border-b border-neutral-200 dark:border-black-700 bg-white dark:bg-black-800 dark:border",b),children:[i?t.jsx("div",{className:w("py-4 px-6",c),children:i||null}):null,t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:y})]})})})}),D=l.forwardRef(({isOpen:e,children:i,fullScreen:r=!1,defaultSize:s=void 0,minWidth:o=400,onDragEnd:b=null,onResize:c,className:a,placement:d="right",parentContainer:n,header:u,id:f,containerClassName:g,headerClassName:x,ignoreParentContainerHeight:h=!1,height:p,isMainSidebarExpanded:v=!1,mainSidebarExpandedWidth:y=280,mainSidebarCollapsedWidth:m=80,navbarHeight:j=64},E)=>{const L=v?y:m,k=l.useRef(null),{shouldRenderSidebar:C,portalTarget:z}=Z(n,e,r,c,k),N=typeof window<"u"?window.innerWidth-L:0,W=q.useResponsiveWidth(o),M=q.useResponsiveWidth(s),S=d==="right",P=p||(n&&!h?"100%":`calc(100vh - ${j}px)`),_={initial:{x:S?"100%":"-100%"},animate:{x:0},exit:{x:S?"100%":"-100%"}},A=S?"left":"right",F=t.jsx($,{isOpen:e,header:u,id:f,ref:E,className:a,containerClassName:g,headerClassName:x,widthStyle:M,heightStyle:P,motionVariants:_,resizableRef:k,fullScreen:r,maxResizableWidth:N,minWidth:W,handleKey:A,onDragEnd:b,onResize:c,children:i});return n?!C||!z?null:I.createPortal(F,z):C?F:null});D.displayName="ResizableSidebar";exports.ResizableSidebar=D;
2
2
  //# sourceMappingURL=ResizableSidebar.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResizableSidebar.cjs.js","sources":["../../../../src/components/data-display/resizable-sidebar/ResizableSidebar.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Resizable } from \"re-resizable\";\n\n/**\n * Sidebar placement options\n */\nexport type ResizableSidebarPlacement = \"left\" | \"right\";\n\n/**\n * Props for the ResizableSidebar component\n */\nexport interface ResizableSidebarProps {\n /** Whether the sidebar is open */\n isOpen: boolean;\n /** Content to display in the sidebar */\n children: React.ReactNode;\n /** Whether to display in full screen mode */\n fullScreen?: boolean;\n /** Callback when drag/resize ends */\n onDragEnd?: (() => void) | null;\n /** Callback when resize occurs */\n onResize?: (width: number) => void;\n /** Additional CSS classes for the wrapper */\n className?: string;\n /** Default size of the sidebar */\n defaultSize?: string;\n /** Minimum width of the sidebar */\n minWidth?: number;\n /** Placement of the sidebar */\n placement?: ResizableSidebarPlacement;\n /** Parent container ID for portal rendering */\n parentContainer?: string;\n /** Header content */\n header?: React.ReactNode;\n /** Unique ID for the sidebar */\n id?: string;\n /** Additional CSS classes for the container */\n containerClassName?: string;\n /** Whether to ignore parent container height */\n ignoreParentContainerHeight?: boolean;\n /** Custom height */\n height?: string;\n /** Whether the main sidebar is expanded (affects max width calculation) */\n isMainSidebarExpanded?: boolean;\n /** Width of the main sidebar when expanded */\n mainSidebarExpandedWidth?: number;\n /** Width of the main sidebar when collapsed */\n mainSidebarCollapsedWidth?: number;\n /** Height offset for navbar */\n navbarHeight?: number;\n}\n\n/**\n * Drag handle component for the resizable sidebar\n */\nconst DragHandle = () => {\n return (\n <div className=\"cursor-ew-resize flex items-center justify-center rounded-full bg-[#1018288F] bg-opacity-55 w-8 h-8 shadow-200 border-[1.5px] border-[#FFFFFF3D]\">\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <mask id=\"mask0_36675_12\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"20\" height=\"20\">\n <rect y=\"20\" width=\"20\" height=\"20\" transform=\"rotate(-90 0 20)\" fill=\"#D9D9D9\" />\n </mask>\n <g mask=\"url(#mask0_36675_12)\">\n <path\n d=\"M15.9583 10L12.7292 6.77084C12.5625 6.60418 12.4792 6.40973 12.4792 6.18751C12.4792 5.96529 12.5625 5.77084 12.7292 5.60418C12.8958 5.43751 13.0938 5.35418 13.3229 5.35418C13.5521 5.35418 13.75 5.43751 13.9167 5.60418L17.1458 8.81251C17.4653 9.13195 17.625 9.52779 17.625 10C17.625 10.4722 17.4653 10.8681 17.1458 11.1875L13.9167 14.4167C13.75 14.5833 13.5521 14.6632 13.3229 14.6563C13.0938 14.6493 12.8958 14.5625 12.7292 14.3958C12.5625 14.2292 12.4792 14.0313 12.4792 13.8021C12.4792 13.5729 12.5625 13.375 12.7292 13.2083L15.9583 10ZM4.04167 10L7.25 13.2083C7.41667 13.375 7.49653 13.5695 7.48958 13.7917C7.48264 14.0139 7.40278 14.2083 7.25 14.375C7.08333 14.5417 6.88542 14.6285 6.65625 14.6354C6.42708 14.6424 6.22917 14.5625 6.0625 14.3958L2.85417 11.1875C2.53472 10.8681 2.375 10.4722 2.375 10C2.375 9.52779 2.53472 9.13195 2.85417 8.81251L6.0625 5.60418C6.22917 5.43751 6.42708 5.35765 6.65625 5.36459C6.88542 5.37154 7.08333 5.45834 7.25 5.62501C7.40278 5.79168 7.48264 5.98612 7.48958 6.20834C7.49653 6.43057 7.41667 6.62501 7.25 6.79168L4.04167 10Z\"\n fill=\"white\"\n />\n </g>\n </svg>\n </div>\n );\n};\n\n/**\n * ResizableSidebar component displays a resizable sidebar panel\n *\n * @example\n * ```tsx\n * <ResizableSidebar\n * isOpen={isOpen}\n * onClose={() => setIsOpen(false)}\n * placement=\"right\"\n * minWidth={300}\n * >\n * <div>Sidebar content</div>\n * </ResizableSidebar>\n * ```\n */\n// Helper functions to reduce cognitive complexity\nconst findParentContainer = (parentContainer: string, setPortalTarget: (target: HTMLElement | null) => void) => {\n const el = document.getElementById(parentContainer);\n if (el) {\n setPortalTarget(el);\n } else {\n requestAnimationFrame(() => {\n const retryEl = document.getElementById(parentContainer);\n if (retryEl) setPortalTarget(retryEl);\n });\n }\n};\n\nconst handleFullScreenToggle = (resizableRef: React.RefObject<React.ElementRef<typeof Resizable>>, fullScreen: boolean) => {\n if (!resizableRef.current) return;\n\n if (fullScreen) {\n localStorage.setItem(\"resizable-sidebar-width-before-fullscreen\", String(resizableRef.current.size?.width));\n } else {\n const width = localStorage.getItem(\"resizable-sidebar-width-before-fullscreen\");\n if (width) {\n resizableRef.current.updateSize({ width: width, height: \"100%\" });\n return;\n }\n }\n resizableRef.current.updateSize({\n width: fullScreen ? \"100vw\" : \"\",\n height: \"100%\",\n });\n};\n\nconst useSidebarEffects = (\n parentContainer: string | undefined,\n isOpen: boolean,\n fullScreen: boolean,\n onResize: ((width: number) => void) | undefined,\n resizableRef: React.RefObject<React.ElementRef<typeof Resizable>>,\n _minWidth: number\n) => {\n const [shouldRenderSidebar, setShouldRenderSidebar] = useState(false);\n const [portalTarget, setPortalTarget] = useState<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!parentContainer || typeof window === \"undefined\") {\n setPortalTarget(null);\n return;\n }\n findParentContainer(parentContainer, setPortalTarget);\n }, [parentContainer]);\n\n useEffect(() => {\n handleFullScreenToggle(resizableRef, fullScreen);\n }, [fullScreen]);\n\n useEffect(() => {\n if (parentContainer && isOpen) {\n const frame = requestAnimationFrame(() => {\n setShouldRenderSidebar(true);\n });\n return () => {\n cancelAnimationFrame(frame);\n setShouldRenderSidebar(false);\n };\n }\n\n if (!parentContainer) {\n setShouldRenderSidebar(true);\n }\n\n if (!isOpen) {\n setShouldRenderSidebar(false);\n }\n }, [isOpen, parentContainer]);\n\n useEffect(() => {\n if (resizableRef.current?.size?.width && onResize) {\n onResize(resizableRef.current.size.width);\n }\n }, [resizableRef.current?.size?.width, onResize]);\n\n return { shouldRenderSidebar, portalTarget };\n};\n\nconst SidebarContent = ({\n isOpen,\n header,\n id,\n ref,\n className,\n containerClassName,\n widthStyle,\n heightStyle,\n motionVariants,\n resizableRef,\n fullScreen,\n maxResizableWidth,\n minWidth,\n handleKey,\n onDragEnd,\n onResize,\n children,\n}: {\n isOpen: boolean;\n header?: React.ReactNode;\n id?: string;\n ref: React.Ref<HTMLDivElement>;\n className?: string;\n containerClassName?: string;\n widthStyle?: string;\n heightStyle: string;\n motionVariants: any;\n resizableRef: React.RefObject<React.ElementRef<typeof Resizable>>;\n fullScreen: boolean;\n maxResizableWidth: number;\n minWidth: number;\n handleKey: string;\n onDragEnd?: (() => void) | null;\n onResize?: (width: number) => void;\n children: React.ReactNode;\n}) => (\n <AnimatePresence>\n {isOpen && (\n <motion.div\n ref={ref}\n id={id}\n initial={motionVariants.initial}\n animate={motionVariants.animate}\n exit={motionVariants.exit}\n transition={{ type: \"tween\", duration: 0.3 }}\n className={cn(\n \"flex-shrink-0 z-50 relative bg-white border-neutral-200 dark:bg-black-800 dark:border-black-700\",\n fullScreen ? \"fixed w-full transition translate-x-4 duration-300\" : \"sticky\",\n className,\n )}\n style={{\n width: widthStyle,\n height: heightStyle,\n }}\n >\n <Resizable\n onResize={(e) => {\n e.stopPropagation();\n const width = resizableRef.current?.size?.width;\n if (onResize) {\n onResize(width || minWidth);\n }\n }}\n onResizeStart={(e) => {\n e.stopPropagation();\n }}\n ref={resizableRef}\n maxWidth={fullScreen ? maxResizableWidth : maxResizableWidth * 0.75}\n minWidth={minWidth}\n minHeight={heightStyle}\n maxHeight={heightStyle}\n enable={fullScreen ? {} : { [handleKey]: true }}\n handleClasses={{\n [handleKey]: cn(\n \"relative w-6 -left-1 flex items-center justify-center bg-transparent transition-colors cursor-ew-resize group z-[9999] hover:bg-neutral-200 dark:hover:bg-neutral-700\",\n ),\n }}\n handleComponent={{\n [handleKey]: (\n <div\n className={cn(\n \"absolute -left-2.5 top-1/2 -translate-y-1/2 flex items-center justify-center w-8 h-12 cursor-ew-resize opacity-0 group-hover:opacity-100 hover:opacity-100 active:opacity-100 transition-opacity z-[9999]\",\n handleKey === \"left\" && \"-right-2.5 -left-auto\",\n )}\n >\n <DragHandle />\n </div>\n ),\n }}\n className=\"!h-full\"\n onResizeStop={onDragEnd || undefined}\n >\n <div\n className={cn(\n \"h-full w-full flex flex-col overflow-hidden @container/sidebar border-b border-neutral-200 dark:border-black-700 bg-white dark:bg-black-800 dark:border\",\n containerClassName,\n )}\n >\n {header ? <div className=\"py-4 px-6\">{header || null}</div> : null}\n <div className=\"flex-1 overflow-y-auto overflow-x-hidden\">{children}</div>\n </div>\n </Resizable>\n </motion.div>\n )} \n </AnimatePresence>\n);\n\nexport const ResizableSidebar = forwardRef<HTMLDivElement, ResizableSidebarProps>(\n (\n {\n isOpen,\n children,\n fullScreen = false,\n defaultSize = undefined,\n minWidth = 400,\n onDragEnd = null,\n onResize,\n className,\n placement = \"right\",\n parentContainer,\n header,\n id,\n containerClassName,\n ignoreParentContainerHeight = false,\n height,\n isMainSidebarExpanded = false,\n mainSidebarExpandedWidth = 280,\n mainSidebarCollapsedWidth = 80,\n navbarHeight = 64,\n },\n ref\n ) => {\n const mainSidebarWidth = isMainSidebarExpanded ? mainSidebarExpandedWidth : mainSidebarCollapsedWidth;\n const resizableRef = useRef<React.ElementRef<typeof Resizable>>(null);\n const { shouldRenderSidebar, portalTarget } = useSidebarEffects(\n parentContainer,\n isOpen,\n fullScreen,\n onResize,\n resizableRef,\n minWidth\n );\n\n const maxResizableWidth = typeof window !== \"undefined\" ? window.innerWidth - mainSidebarWidth : 0;\n\n const widthStyle = defaultSize;\n const isRight = placement === \"right\";\n const heightStyle = height || (parentContainer && !ignoreParentContainerHeight ? \"100%\" : `calc(100vh - ${navbarHeight}px)`);\n\n const motionVariants = {\n initial: { x: isRight ? \"100%\" : \"-100%\" },\n animate: { x: 0 },\n exit: { x: isRight ? \"100%\" : \"-100%\" },\n };\n\n const handleKey = isRight ? \"left\" : \"right\";\n\n const sidebarContent = (\n <SidebarContent\n isOpen={isOpen}\n header={header}\n id={id}\n ref={ref}\n className={className}\n containerClassName={containerClassName}\n widthStyle={widthStyle}\n heightStyle={heightStyle}\n motionVariants={motionVariants}\n resizableRef={resizableRef}\n fullScreen={fullScreen}\n maxResizableWidth={maxResizableWidth}\n minWidth={minWidth}\n handleKey={handleKey}\n onDragEnd={onDragEnd}\n onResize={onResize}\n >\n {children}\n </SidebarContent>\n );\n\n if (parentContainer) {\n if (!shouldRenderSidebar || !portalTarget) return null;\n return ReactDOM.createPortal(sidebarContent, portalTarget);\n }\n\n if (!shouldRenderSidebar) return null;\n\n return sidebarContent;\n }\n);\n\nResizableSidebar.displayName = \"ResizableSidebar\";\n"],"names":["DragHandle","jsx","jsxs","findParentContainer","parentContainer","setPortalTarget","el","retryEl","handleFullScreenToggle","resizableRef","fullScreen","width","useSidebarEffects","isOpen","onResize","_minWidth","shouldRenderSidebar","setShouldRenderSidebar","useState","portalTarget","useEffect","frame","SidebarContent","header","id","ref","className","containerClassName","widthStyle","heightStyle","motionVariants","maxResizableWidth","minWidth","handleKey","onDragEnd","children","AnimatePresence","motion","cn","Resizable","e","ResizableSidebar","forwardRef","defaultSize","placement","ignoreParentContainerHeight","height","isMainSidebarExpanded","mainSidebarExpandedWidth","mainSidebarCollapsedWidth","navbarHeight","mainSidebarWidth","useRef","isRight","sidebarContent","ReactDOM"],"mappings":"gQA0DMA,EAAa,IAEfC,EAAAA,IAAC,MAAA,CAAI,UAAU,mJACb,SAAAC,EAAAA,KAAC,MAAA,CACC,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,MAAM,6BAEN,SAAA,CAAAD,EAAAA,IAAC,OAAA,CAAK,GAAG,iBAAiB,UAAU,iBAAiB,EAAE,IAAI,EAAE,IAAI,MAAM,KAAK,OAAO,KACjF,SAAAA,EAAAA,IAAC,OAAA,CAAK,EAAE,KAAK,MAAM,KAAK,OAAO,KAAK,UAAU,mBAAmB,KAAK,SAAA,CAAU,CAAA,CAClF,EACAA,EAAAA,IAAC,IAAA,CAAE,KAAK,uBACN,SAAAA,EAAAA,IAAC,OAAA,CACC,EAAE,yiCACF,KAAK,OAAA,CAAA,CACP,CACF,CAAA,CAAA,CAAA,EAEJ,EAoBEE,EAAsB,CAACC,EAAyBC,IAA0D,CAC9G,MAAMC,EAAK,SAAS,eAAeF,CAAe,EAC9CE,EACFD,EAA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T,EACA,OAAAU,EACA,GAAAC,EACA,IAAAC,EACA,UAAAC,EACA,mBAAAC,EACA,WAAAC,EACA,YAAAC,EACA,eAAAC,EACA,aAAArB,EACA,WAAAC,EACA,kBAAAqB,EACA,SAAAC,EACA,UAAAC,EACA,UAAAC,EACA,SAAApB,EAEC,SAAAqB,CAAA,CAAA,EAIL,OAAI/B,EACE,CAACY,GAAuB,CAACG,EAAqB,KAC3CoC,EAAS,aAAaD,EAAgBnC,CAAY,EAGtDH,EAEEsC,EAF0B,IAGnC,CACF,EAEAb,EAAiB,YAAc"}
1
+ {"version":3,"file":"ResizableSidebar.cjs.js","sources":["../../../../src/components/data-display/resizable-sidebar/ResizableSidebar.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Resizable } from \"re-resizable\";\n\nimport { useResponsiveWidth } from \"../../../hooks/useResponsiveWidth\";\n\n/**\n * Sidebar placement options\n */\nexport type ResizableSidebarPlacement = \"left\" | \"right\";\n\n/**\n * Props for the ResizableSidebar component\n */\nexport interface ResizableSidebarProps {\n /** Whether the sidebar is open */\n isOpen: boolean;\n /** Content to display in the sidebar */\n children: React.ReactNode;\n /** Whether to display in full screen mode */\n fullScreen?: boolean;\n /** Callback when drag/resize ends */\n onDragEnd?: (() => void) | null;\n /** Callback when resize occurs */\n onResize?: (width: number) => void;\n /** Additional CSS classes for the wrapper */\n className?: string;\n /** Default size of the sidebar */\n defaultSize?: string;\n /** Minimum width of the sidebar */\n minWidth?: number;\n /** Placement of the sidebar */\n placement?: ResizableSidebarPlacement;\n /** Parent container ID for portal rendering */\n parentContainer?: string;\n /** Header content */\n header?: React.ReactNode;\n /** Unique ID for the sidebar */\n id?: string;\n /** Additional CSS classes for the container */\n containerClassName?: string;\n /** Additional CSS classes for the header wrapper */\n headerClassName?: string;\n /** Whether to ignore parent container height */\n ignoreParentContainerHeight?: boolean;\n /** Custom height */\n height?: string;\n /** Whether the main sidebar is expanded (affects max width calculation) */\n isMainSidebarExpanded?: boolean;\n /** Width of the main sidebar when expanded */\n mainSidebarExpandedWidth?: number;\n /** Width of the main sidebar when collapsed */\n mainSidebarCollapsedWidth?: number;\n /** Height offset for navbar */\n navbarHeight?: number;\n}\n\n/**\n * Drag handle component for the resizable sidebar\n */\nconst DragHandle = () => {\n return (\n <div className=\"cursor-ew-resize flex items-center justify-center rounded-full bg-[#1018288F] bg-opacity-55 w-8 h-8 shadow-200 border-[1.5px] border-[#FFFFFF3D]\">\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <mask id=\"mask0_36675_12\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"20\" height=\"20\">\n <rect y=\"20\" width=\"20\" height=\"20\" transform=\"rotate(-90 0 20)\" fill=\"#D9D9D9\" />\n </mask>\n <g mask=\"url(#mask0_36675_12)\">\n <path\n d=\"M15.9583 10L12.7292 6.77084C12.5625 6.60418 12.4792 6.40973 12.4792 6.18751C12.4792 5.96529 12.5625 5.77084 12.7292 5.60418C12.8958 5.43751 13.0938 5.35418 13.3229 5.35418C13.5521 5.35418 13.75 5.43751 13.9167 5.60418L17.1458 8.81251C17.4653 9.13195 17.625 9.52779 17.625 10C17.625 10.4722 17.4653 10.8681 17.1458 11.1875L13.9167 14.4167C13.75 14.5833 13.5521 14.6632 13.3229 14.6563C13.0938 14.6493 12.8958 14.5625 12.7292 14.3958C12.5625 14.2292 12.4792 14.0313 12.4792 13.8021C12.4792 13.5729 12.5625 13.375 12.7292 13.2083L15.9583 10ZM4.04167 10L7.25 13.2083C7.41667 13.375 7.49653 13.5695 7.48958 13.7917C7.48264 14.0139 7.40278 14.2083 7.25 14.375C7.08333 14.5417 6.88542 14.6285 6.65625 14.6354C6.42708 14.6424 6.22917 14.5625 6.0625 14.3958L2.85417 11.1875C2.53472 10.8681 2.375 10.4722 2.375 10C2.375 9.52779 2.53472 9.13195 2.85417 8.81251L6.0625 5.60418C6.22917 5.43751 6.42708 5.35765 6.65625 5.36459C6.88542 5.37154 7.08333 5.45834 7.25 5.62501C7.40278 5.79168 7.48264 5.98612 7.48958 6.20834C7.49653 6.43057 7.41667 6.62501 7.25 6.79168L4.04167 10Z\"\n fill=\"white\"\n />\n </g>\n </svg>\n </div>\n );\n};\n\n/**\n * ResizableSidebar component displays a resizable sidebar panel\n *\n * @example\n * ```tsx\n * <ResizableSidebar\n * isOpen={isOpen}\n * onClose={() => setIsOpen(false)}\n * placement=\"right\"\n * minWidth={300}\n * >\n * <div>Sidebar content</div>\n * </ResizableSidebar>\n * ```\n */\n// Helper functions to reduce cognitive complexity\nconst findParentContainer = (parentContainer: string, setPortalTarget: (target: HTMLElement | null) => void) => {\n const el = document.getElementById(parentContainer);\n if (el) {\n setPortalTarget(el);\n } else {\n requestAnimationFrame(() => {\n const retryEl = document.getElementById(parentContainer);\n if (retryEl) setPortalTarget(retryEl);\n });\n }\n};\n\nconst handleFullScreenToggle = (resizableRef: React.RefObject<React.ElementRef<typeof Resizable>>, fullScreen: boolean) => {\n if (!resizableRef.current) return;\n\n if (fullScreen) {\n localStorage.setItem(\"resizable-sidebar-width-before-fullscreen\", String(resizableRef.current.size?.width));\n } else {\n const width = localStorage.getItem(\"resizable-sidebar-width-before-fullscreen\");\n if (width) {\n resizableRef.current.updateSize({ width: width, height: \"100%\" });\n return;\n }\n }\n resizableRef.current.updateSize({\n width: fullScreen ? \"100vw\" : \"\",\n height: \"100%\",\n });\n};\n\nconst useSidebarEffects = (\n parentContainer: string | undefined,\n isOpen: boolean,\n fullScreen: boolean,\n onResize: ((width: number) => void) | undefined,\n resizableRef: React.RefObject<React.ElementRef<typeof Resizable>>,\n _minWidth: number\n) => {\n const [shouldRenderSidebar, setShouldRenderSidebar] = useState(false);\n const [portalTarget, setPortalTarget] = useState<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!parentContainer || typeof window === \"undefined\") {\n setPortalTarget(null);\n return;\n }\n findParentContainer(parentContainer, setPortalTarget);\n }, [parentContainer]);\n\n useEffect(() => {\n handleFullScreenToggle(resizableRef, fullScreen);\n }, [fullScreen]);\n\n useEffect(() => {\n if (parentContainer && isOpen) {\n const frame = requestAnimationFrame(() => {\n setShouldRenderSidebar(true);\n });\n return () => {\n cancelAnimationFrame(frame);\n setShouldRenderSidebar(false);\n };\n }\n\n if (!parentContainer) {\n setShouldRenderSidebar(true);\n }\n\n if (!isOpen) {\n setShouldRenderSidebar(false);\n }\n }, [isOpen, parentContainer]);\n\n useEffect(() => {\n if (resizableRef.current?.size?.width && onResize) {\n onResize(resizableRef.current.size.width);\n }\n }, [resizableRef.current?.size?.width, onResize]);\n\n return { shouldRenderSidebar, portalTarget };\n};\n\nconst SidebarContent = ({\n isOpen,\n header,\n id,\n ref,\n className,\n containerClassName,\n headerClassName,\n widthStyle,\n heightStyle,\n motionVariants,\n resizableRef,\n fullScreen,\n maxResizableWidth,\n minWidth,\n handleKey,\n onDragEnd,\n onResize,\n children,\n}: {\n isOpen: boolean;\n header?: React.ReactNode;\n id?: string;\n ref: React.Ref<HTMLDivElement>;\n className?: string;\n containerClassName?: string;\n headerClassName?: string;\n widthStyle?: string | number;\n heightStyle: string;\n motionVariants: any;\n resizableRef: React.RefObject<React.ElementRef<typeof Resizable>>;\n fullScreen: boolean;\n maxResizableWidth: number;\n minWidth: number;\n handleKey: string;\n onDragEnd?: (() => void) | null;\n onResize?: (width: number) => void;\n children: React.ReactNode;\n}) => (\n <AnimatePresence>\n {isOpen && (\n <motion.div\n ref={ref}\n id={id}\n initial={motionVariants.initial}\n animate={motionVariants.animate}\n exit={motionVariants.exit}\n transition={{ type: \"tween\", duration: 0.3 }}\n className={cn(\n \"flex-shrink-0 z-50 relative bg-white border-neutral-200 dark:bg-black-800 dark:border-black-700\",\n fullScreen ? \"fixed w-full transition translate-x-4 duration-300\" : \"sticky\",\n className,\n )}\n style={{\n width: widthStyle,\n height: heightStyle,\n }}\n >\n <Resizable\n onResize={(e) => {\n e.stopPropagation();\n const width = resizableRef.current?.size?.width;\n if (onResize) {\n onResize(width || minWidth);\n }\n }}\n onResizeStart={(e) => {\n e.stopPropagation();\n }}\n ref={resizableRef}\n maxWidth={fullScreen ? maxResizableWidth : maxResizableWidth * 0.75}\n minWidth={minWidth}\n minHeight={heightStyle}\n maxHeight={heightStyle}\n enable={fullScreen ? {} : { [handleKey]: true }}\n handleClasses={{\n [handleKey]: cn(\n \"relative w-6 -left-1 flex items-center justify-center bg-transparent transition-colors cursor-ew-resize group z-[9999] hover:bg-neutral-200 dark:hover:bg-neutral-700\",\n ),\n }}\n handleComponent={{\n [handleKey]: (\n <div\n className={cn(\n \"absolute -left-2.5 top-1/2 -translate-y-1/2 flex items-center justify-center w-8 h-12 cursor-ew-resize opacity-0 group-hover:opacity-100 hover:opacity-100 active:opacity-100 transition-opacity z-[9999]\",\n handleKey === \"left\" && \"-right-2.5 -left-auto\",\n )}\n >\n <DragHandle />\n </div>\n ),\n }}\n className=\"!h-full\"\n onResizeStop={onDragEnd || undefined}\n >\n <div\n className={cn(\n \"h-full w-full flex flex-col overflow-hidden @container/sidebar border-b border-neutral-200 dark:border-black-700 bg-white dark:bg-black-800 dark:border\",\n containerClassName,\n )}\n >\n {header ? <div className={cn(\"py-4 px-6\", headerClassName)}>{header || null}</div> : null}\n <div className=\"flex-1 overflow-y-auto overflow-x-hidden\">{children}</div>\n </div>\n </Resizable>\n </motion.div>\n )} \n </AnimatePresence>\n);\n\nexport const ResizableSidebar = forwardRef<HTMLDivElement, ResizableSidebarProps>(\n (\n {\n isOpen,\n children,\n fullScreen = false,\n defaultSize = undefined,\n minWidth = 400,\n onDragEnd = null,\n onResize,\n className,\n placement = \"right\",\n parentContainer,\n header,\n id,\n containerClassName,\n headerClassName,\n ignoreParentContainerHeight = false,\n height,\n isMainSidebarExpanded = false,\n mainSidebarExpandedWidth = 280,\n mainSidebarCollapsedWidth = 80,\n navbarHeight = 64,\n },\n ref\n ) => {\n const mainSidebarWidth = isMainSidebarExpanded ? mainSidebarExpandedWidth : mainSidebarCollapsedWidth;\n const resizableRef = useRef<React.ElementRef<typeof Resizable>>(null);\n const { shouldRenderSidebar, portalTarget } = useSidebarEffects(\n parentContainer,\n isOpen,\n fullScreen,\n onResize,\n resizableRef,\n minWidth\n );\n\n const maxResizableWidth = typeof window !== \"undefined\" ? window.innerWidth - mainSidebarWidth : 0;\n\n // Passed sizes are the desktop maximum; both the drag floor and the open\n // width shrink by viewport breakpoint.\n const responsiveMinWidth = useResponsiveWidth(minWidth);\n const responsiveDefaultSize = useResponsiveWidth(defaultSize);\n\n const widthStyle = responsiveDefaultSize;\n const isRight = placement === \"right\";\n const heightStyle = height || (parentContainer && !ignoreParentContainerHeight ? \"100%\" : `calc(100vh - ${navbarHeight}px)`);\n\n const motionVariants = {\n initial: { x: isRight ? \"100%\" : \"-100%\" },\n animate: { x: 0 },\n exit: { x: isRight ? \"100%\" : \"-100%\" },\n };\n\n const handleKey = isRight ? \"left\" : \"right\";\n\n const sidebarContent = (\n <SidebarContent\n isOpen={isOpen}\n header={header}\n id={id}\n ref={ref}\n className={className}\n containerClassName={containerClassName}\n headerClassName={headerClassName}\n widthStyle={widthStyle}\n heightStyle={heightStyle}\n motionVariants={motionVariants}\n resizableRef={resizableRef}\n fullScreen={fullScreen}\n maxResizableWidth={maxResizableWidth}\n minWidth={responsiveMinWidth}\n handleKey={handleKey}\n onDragEnd={onDragEnd}\n onResize={onResize}\n >\n {children}\n </SidebarContent>\n );\n\n if (parentContainer) {\n if (!shouldRenderSidebar || !portalTarget) return null;\n return ReactDOM.createPortal(sidebarContent, portalTarget);\n }\n\n if (!shouldRenderSidebar) return null;\n\n return sidebarContent;\n }\n);\n\nResizableSidebar.displayName = \"ResizableSidebar\";\n"],"names":["DragHandle","jsx","jsxs","findParentContainer","parentContainer","setPortalTarget","el","retryEl","handleFullScreenToggle","resizableRef","fullScreen","width","useSidebarEffects","isOpen","onResize","_minWidth","shouldRenderSidebar","setShouldRenderSidebar","useState","portalTarget","useEffect","frame","SidebarContent","header","id","ref","className","containerClassName","headerClassName","widthStyle","heightStyle","motionVariants","maxResizableWidth","minWidth","handleKey","onDragEnd","children","AnimatePresence","motion","cn","Resizable","e","ResizableSidebar","forwardRef","defaultSize","placement","ignoreParentContainerHeight","height","isMainSidebarExpanded","mainSidebarExpandedWidth","mainSidebarCollapsedWidth","navbarHeight","mainSidebarWidth","useRef","responsiveMinWidth","useResponsiveWidth","isRight","sidebarContent","ReactDOM"],"mappings":"sTA8DMA,EAAa,IAEfC,EAAAA,IAAC,MAAA,CAAI,UAAU,mJACb,SAAAC,EAAAA,KAAC,MAAA,CACC,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,MAAM,6BAEN,SAAA,CAAAD,EAAAA,IAAC,OAAA,CAAK,GAAG,iBAAiB,UAAU,iBAAiB,EAAE,IAAI,EAAE,IAAI,MAAM,KAAK,OAAO,KACjF,SAAAA,EAAAA,IAAC,OAAA,CAAK,EAAE,KAAK,MAAM,KAAK,OAAO,KAAK,UAAU,mBAAmB,KAAK,SAAA,CAAU,CAAA,CAClF,EACAA,EAAAA,IAAC,IAAA,CAAE,KAAK,uBACN,SAAAA,EAAAA,IAAC,OAAA,CACC,EAAE,yiCACF,KAAK,OAAA,CAAA,CACP,CACF,CAAA,CAAA,CAAA,EAEJ,EAoBEE,EAAsB,CAACC,EAAyBC,IAA0D,CAC9G,MAAMC,EAAK,SAAS,eAAeF,CAAe,EAC9CE,EACFD,EAAgBC,CAAE,EAElB,sBAAsB,IAAM,CAC1B,MAAMC,EAAU,SAAS,eAAeH,CAAe,EACnDG,KAAyBA,CAAO,CACtC,CAAC,CAEL,EAEMC,EAAyB,CAACC,EAAmEC,IAAwB,CACzH,GAAKD,EAAa,QAElB,IAAIC,EACF,aAAa,QAAQ,4CAA6C,OAAOD,EAAa,QAAQ,MAAM,KAAK,CA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A,eAAAC,EACA,aAAAtB,EACA,WAAAC,EACA,kBAAAsB,EACA,SAAUsB,EACV,UAAApB,EACA,UAAAC,EACA,SAAArB,EAEC,SAAAsB,CAAA,CAAA,EAIL,OAAIhC,EACE,CAACY,GAAuB,CAACG,EAAqB,KAC3CuC,EAAS,aAAaD,EAAgBtC,CAAY,EAGtDH,EAEEyC,EAF0B,IAGnC,CACF,EAEAf,EAAiB,YAAc"}
@@ -32,6 +32,8 @@ export interface ResizableSidebarProps {
32
32
  id?: string;
33
33
  /** Additional CSS classes for the container */
34
34
  containerClassName?: string;
35
+ /** Additional CSS classes for the header wrapper */
36
+ headerClassName?: string;
35
37
  /** Whether to ignore parent container height */
36
38
  ignoreParentContainerHeight?: boolean;
37
39
  /** Custom height */