{"version":3,"file":"DynamicRadius.Cbc4PUTv.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/gRvxJ6ixQugu9UEWhw1f/TZH9jcZo6bAJojrwuXPS/DynamicRadius.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";export function DynamicRadius(Component){return props=>{const[borderRadius,setBorderRadius]=useState(0);const ref=useRef(null);useEffect(()=>{const updateBorderRadius=()=>{if(!ref.current)return;const{width,height}=ref.current.getBoundingClientRect();const shorterSide=Math.min(width,height);const percentage=window.innerWidth<=809?.2:.3;setBorderRadius(shorterSide*percentage);};updateBorderRadius();window.addEventListener(\"resize\",updateBorderRadius);return()=>window.removeEventListener(\"resize\",updateBorderRadius);},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,borderRadius:`${borderRadius}px`}});};}export function RadiusOnly(Component){return DynamicRadius(Component);}export function RadiusWithHover(Component){return props=>{const[borderRadius,setBorderRadius]=useState(0);const[isHovered,setIsHovered]=useState(false);const ref=useRef(null);useEffect(()=>{const updateBorderRadius=()=>{if(!ref.current)return;const{width,height}=ref.current.getBoundingClientRect();const shorterSide=Math.min(width,height);const basePercentage=window.innerWidth<=809?.2:.3;const percentage=isHovered?basePercentage+.05:basePercentage;setBorderRadius(shorterSide*percentage);};updateBorderRadius();window.addEventListener(\"resize\",updateBorderRadius);return()=>window.removeEventListener(\"resize\",updateBorderRadius);},[isHovered]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),style:{...props.style,borderRadius:`${borderRadius}px`,transition:\"border-radius 0.3s ease\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"RadiusOnly\":{\"type\":\"reactHoc\",\"name\":\"RadiusOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DynamicRadius\":{\"type\":\"reactHoc\",\"name\":\"DynamicRadius\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RadiusWithHover\":{\"type\":\"reactHoc\",\"name\":\"RadiusWithHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DynamicRadius.map"],"mappings":"8IAAwF,SAAgB,EAAc,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAO,EAAIC,EAAO,KAAK,CAAgZ,OAA/Y,MAAc,CAAC,IAAM,MAAuB,CAAC,GAAG,CAAC,EAAI,QAAQ,OAAO,GAAK,CAAC,QAAM,UAAQ,EAAI,QAAQ,uBAAuB,CAAwF,EAArE,KAAK,IAAI,EAAM,EAAO,EAAkB,EAAO,YAAY,IAAI,GAAG,IAA0C,EAA6E,OAA1E,GAAoB,CAAC,EAAO,iBAAiB,SAAS,EAAmB,KAAW,EAAO,oBAAoB,SAAS,EAAmB,EAAG,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAU,MAAI,MAAM,CAAC,GAAG,EAAM,MAAM,aAAa,GAAG,EAAa,IAAI,CAAC,CAAC,EAAI,SAAgB,EAAW,EAAU,CAAC,OAAO,EAAc,EAAU,sBAAlvB,IAA6C"}