{"version":3,"file":"drawerOptimizer.BDuepvEP.mjs","names":["__esmMin","c","init_jsx_runtime","withAdjustedDrawers","refCallback","node","elements","drawerSelector","headerHeight","firstDrawerOffset","topAdjustment","index","drawerSpacing","heightAdjustment","element","Component","props","withAdjustedHeightMinusOneDrawer","drawerHeight","init_drawerOptimizer"],"sources":["https:/framerusercontent.com/modules/M8Cb42XnPEDnPLpKzNJK/ztUAMLGx3W09Xh3BrmQD/drawerOptimizer.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";/**\n * Drawer Height and Position Adjuster\n * © Swiss Themes\n * swissthemes.design\n *\n * This override automatically adjusts the heights and positions of drawer elements\n * to create a cascading stack effect. It finds all elements with IDs containing \"drawer\"\n * and adjusts their heights and positions accordingly.\n *\n * How to apply:\n * 1. Apply this override to the parent container that contains your drawer elements\n * 2. Make sure your drawer elements have Scroll Sections (IDs) that include the word \"drawer\"\n * 3. Adjust the configuration variables below if needed\n */// Configuration variables - Adjust these to fit your design\nconst headerHeight=74// Height of your header in pixels\n;const drawerSpacing=32// Height of one Drawer Header element (without borders)\n;const firstDrawerOffset=34// Space to subtract from first drawer height (height of one drawer header with borders)\n;const drawerSelector='[id*=\"drawer\"]'// CSS selector to find drawer elements\n;export function withAdjustedDrawers(Component){// This follows the standard Framer override pattern\nreturn props=>{// Use a ref callback to access the DOM element\nconst refCallback=node=>{if(!node)return;// Get all drawer elements\nconst elements=node.querySelectorAll(drawerSelector);// First drawer (if it exists) only needs height adjustment\nif(elements.length>0&&elements[0]instanceof HTMLElement){elements[0].style.height=`calc(100vh - ${headerHeight}px - ${firstDrawerOffset}px)`;}// For subsequent drawers, adjust both position and height\nArray.from(elements).slice(1).forEach((element,index)=>{const topAdjustment=(index+1)*drawerSpacing;const heightAdjustment=(index+2)*drawerSpacing;if(element instanceof HTMLElement){element.style.top=`calc(${headerHeight}px + ${topAdjustment}px)`;element.style.height=`calc(100vh - ${headerHeight}px - ${heightAdjustment}px)`;}});};// Pass the ref callback to the Component\nreturn /*#__PURE__*/_jsx(Component,{...props,ref:refCallback});};}/**\n * Height Adjustment Minus One Drawer\n * © Swiss Themes\n * swissthemes.design\n *\n * This override adjusts the height of an element to be the full viewport height\n * minus a specified amount (typically the height of one drawer handle/header).\n *\n * How to apply:\n * 1. Select the element you want to resize in your Framer project\n * 2. In the Properties panel, find \"Code Override\" and select \"withAdjustedHeightMinusOneDrawer\"\n * 3. Adjust the drawerHeight variable below if needed\n */// Configuration variable - Adjust this to match your drawer handle height\nconst drawerHeight=35// Height of drawer handle in pixels, including border\n;export function withAdjustedHeightMinusOneDrawer(Component){return props=>{// Merge our height adjustment with existing styles\nreturn /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,height:`calc(100vh - ${drawerHeight}px)`}});};}/**\n * Height Adjustment Minus Header\n * © Swiss Themes\n * swissthemes.design\n *\n * This override adjusts the height of an element to be the full viewport height\n * minus a specified amount (typically the height of a header/navigation bar).\n * Uses dynamic viewport height (dvh) for better mobile compatibility.\n *\n * How to apply:\n * 1. Select the element you want to resize in your Framer project\n * 2. In the Properties panel, find \"Code Override\" and select \"withAdjustedHeightMinusHead\"\n * 3. Adjust the headerHeight variable below if needed\n */// Configuration variable - Adjust this to match your header height\nconst headerHeight0=74// Height of header/navigation bar in pixels\n;const useModernViewport=true// Set to false to use vh instead of dvh\n;export function withAdjustedHeightMinusHead(Component){return props=>{// Choose between modern dynamic viewport height (dvh) or standard viewport height (vh)\nconst viewportUnit=useModernViewport?\"dvh\":\"vh\";// Merge our height adjustment with existing styles\nreturn /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,height:`calc(100${viewportUnit} - ${headerHeight0}px)`}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withAdjustedHeightMinusHead\":{\"type\":\"reactHoc\",\"name\":\"withAdjustedHeightMinusHead\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAdjustedHeightMinusOneDrawer\":{\"type\":\"reactHoc\",\"name\":\"withAdjustedHeightMinusOneDrawer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAdjustedDrawers\":{\"type\":\"reactHoc\",\"name\":\"withAdjustedDrawers\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./drawerOptimizer.map"],"mappings":"A,oGAkBC,SAAgBG,EAAoB,EAAU,CAC/C,MAAO,IAAO,CACd,IAAMC,EAAY,GAAM,CAAC,GAAG,CAACC,EAAK,OAClC,IAAMC,EAASD,EAAK,iBAAiBE,CAAc,EAChDD,EAAS,OAAO,GAAGA,EAAS,aAAa,cAAa,EAAS,EAAE,CAAC,MAAM,OAAO,gBAAgBE,EAAa,OAAOC,EAAkB,MACxI,MAAM,KAAKH,CAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAQ,IAAQ,CAAC,IAAMI,GAAeC,EAAM,GAAGC,EAAoBC,GAAkBF,EAAM,GAAGC,EAAiBE,aAAmB,cAAa,EAAQ,MAAM,IAAI,QAAQN,EAAa,OAAOE,EAAc,KAAK,EAAQ,MAAM,OAAO,gBAAgBF,EAAa,OAAOK,EAAiB,KAAM,CAAC,CAAE,EAC1U,MAAoB,gBAAKE,EAAU,CAAC,GAAGC,EAAM,IAAIZ,CAAW,CAAC,CAAE,CAAE,CAchE,SAAgBa,EAAiC,EAAU,CAAC,MAAO,IAChD,gBAAKF,EAAU,CAAC,GAAGC,EAAM,MAAM,CAAC,GAAGA,EAAM,MAAM,OAAO,gBAAgBE,EAAa,IAAI,CAAC,CAAC,CAAI,C,gDAzB3G,EAAa,GACZ,EAAc,GACd,EAAkB,GAClB,EAAe,iBAoBhB,EAAa,E"}