{"version":3,"file":"Variable_hover.BnuS1dvk.mjs","names":["useRef","__esmMin","init_npm_react_18_3_1","c","init_jsx_runtime","ce","de","addPropertyControls","init_framer_DDfsYcI0","ControlType","withVariableFontHover","rest","props","ref","getHeadings","weightDefault","weightHover","Component","init_Variable_hover"],"sources":["https:/framerusercontent.com/modules/rrO7w72rYo63r5k13dZf/Bc008SZte6FuFKhFDq7Z/Variable_hover.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function withVariableFontHover(Component){return props=>{const{weightDefault=400,weightHover=800,...rest}=props;const ref=useRef(null);const getHeadings=()=>{if(!ref.current)return[];return Array.from(ref.current.querySelectorAll(\"h1, h2, h3, h4\"));};useEffect(()=>{getHeadings().forEach(el=>{el.style.fontVariationSettings=`'wght' ${weightDefault}`;});},[weightDefault]);const handleMouseEnter=()=>{getHeadings().forEach(el=>{el.style.transition=\"font-variation-settings 0.2s cubic-bezier(.07,.82,.53,.91)\";el.style.fontVariationSettings=`'wght' ${weightHover}`;});};const handleMouseLeave=()=>{getHeadings().forEach(el=>{el.style.transition=\"font-variation-settings 0.2s cubic-bezier(.9,.06,.58,.98)\";el.style.fontVariationSettings=`'wght' ${weightDefault}`;});};return /*#__PURE__*/_jsx(\"div\",{ref:ref,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,children:/*#__PURE__*/_jsx(Component,{...rest})});};}addPropertyControls(withVariableFontHover,{weightDefault:{type:ControlType.Number,title:\"Weight Default\",defaultValue:400,min:100,max:900,step:1,displayStepper:true},weightHover:{type:ControlType.Number,title:\"Weight Hover\",defaultValue:800,min:100,max:900,step:1,displayStepper:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"withVariableFontHover\":{\"type\":\"reactHoc\",\"name\":\"withVariableFontHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Variable_hover.map"],"mappings":"A,iLAAmI,SAAgBU,EAAsB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,gBAAc,IAAI,cAAY,IAAI,GAAGC,GAAMC,EAAYC,EAAIb,EAAO,IAAI,EAAQc,MAAqBD,EAAI,QAAwB,MAAM,KAAKA,EAAI,QAAQ,iBAAiB,gBAAgB,CAAC,EAAnE,CAAC,EAAwkB,OAAlgBR,MAAc,CAACS,EAAY,CAAC,CAAC,QAAQ,GAAI,CAAC,EAAG,MAAM,sBAAsB,UAAUC,GAAgB,CAAC,CAAE,EAAE,CAACA,CAAa,CAAC,EAA+Z,gBAAK,MAAM,CAAK,MAAI,iBAAtZ,CAACD,EAAY,CAAC,CAAC,QAAQ,GAAI,CAAC,EAAG,MAAM,WAAW,6DAA6D,EAAG,MAAM,sBAAsB,UAAUE,GAAc,CAAC,CAAE,EAA6Q,iBAAhP,CAACF,EAAY,CAAC,CAAC,QAAQ,GAAI,CAAC,EAAG,MAAM,WAAW,4DAA4D,EAAG,MAAM,sBAAsB,UAAUC,GAAgB,CAAC,CAAE,EAAsG,SAAsB,gBAAKE,EAAU,CAAC,GAAGN,CAAI,CAAC,CAAC,CAAC,CAAE,CAAE,C,0CAACJ,EAAoBG,EAAsB,CAAC,cAAc,CAAC,KAAKD,EAAY,OAAO,MAAM,iBAAiB,aAAa,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE,eAAe,EAAI,EAAE,YAAY,CAAC,KAAKA,EAAY,OAAO,MAAM,eAAe,aAAa,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE,eAAe,EAAI,CAAC,CAAC,C"}