{"version":3,"file":"UnderlineSlideCTA.BCLxLyL9.mjs","names":["useState","startTransition","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/Lbs4O9svp8oAx2tksUs8/q6HjDRVfHzzrVxhiteLe/UnderlineSlideCTA.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{startTransition,useCallback,useEffect,useMemo,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion}from\"framer-motion\";/**\n * @framerIntrinsicWidth 160\n * @framerIntrinsicHeight 28\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function UnderlineSlideCTA(props){const{label,link,openInNewTab,textColor,underlineColor,font,underlineThickness,underlineOffset,underlineExtraWidth,underlineRadius,hoverDuration,hoverEasing,disabled,ariaLabel,style}=props;const isStatic=useIsStaticRenderer();const[canHover,setCanHover]=useState(false);const[hovered,setHovered]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;try{const mql=window.matchMedia(\"(hover: hover) and (pointer: fine)\");const update=()=>startTransition(()=>setCanHover(!!mql.matches));update();// Safari fallback: addListener/removeListener\nif(\"addEventListener\"in mql){mql.addEventListener(\"change\",update);return()=>mql.removeEventListener(\"change\",update);}else{// @ts-ignore\nmql.addListener(update);// @ts-ignore\nreturn()=>mql.removeListener(update);}}catch{startTransition(()=>setCanHover(false));}},[]);const isInteractive=!isStatic&&!disabled&&canHover;const onMouseEnter=useCallback(()=>{if(!isInteractive)return;startTransition(()=>setHovered(true));},[isInteractive]);const onMouseLeave=useCallback(()=>{if(!isInteractive)return;startTransition(()=>setHovered(false));},[isInteractive]);const onFocus=useCallback(()=>{// Keep underline visible on focus (no slide), like typical luxury nav CTAs\nif(!isInteractive)return;startTransition(()=>setHovered(false));},[isInteractive]);const onBlur=useCallback(()=>{if(!isInteractive)return;startTransition(()=>setHovered(false));},[isInteractive]);const isFullWidth=!!(style&&style.width===\"100%\");const isFullHeight=!!(style&&style.height===\"100%\");const containerStyle=useMemo(()=>{return{...style,position:\"relative\",display:\"inline-flex\",alignItems:\"flex-start\",justifyContent:\"flex-start\",gap:0,color:textColor,cursor:disabled?\"default\":\"pointer\",textDecoration:\"none\",userSelect:\"none\",WebkitUserSelect:\"none\",outline:\"none\",overflow:\"hidden\",...isFullWidth?{}:{width:\"max-content\"},...isFullHeight?{}:{height:\"max-content\"}};},[style,textColor,disabled,isFullWidth,isFullHeight]);const textStyle=useMemo(()=>{return{...font,display:\"inline-block\",whiteSpace:\"nowrap\",paddingBottom:Math.max(0,underlineOffset+underlineThickness),lineHeight:font?.lineHeight??\"1em\"};},[font,underlineOffset,underlineThickness]);const underlineOuterStyle=useMemo(()=>{return{position:\"absolute\",left:0,right:0,bottom:0,height:underlineThickness,pointerEvents:\"none\",overflow:\"hidden\"};},[underlineOffset,underlineThickness]);const underlineInnerStyle=useMemo(()=>{return{position:\"absolute\",left:0,top:0,height:underlineThickness,width:`calc(100% + ${Math.max(0,underlineExtraWidth)}px)`,background:underlineColor,borderRadius:underlineRadius,willChange:\"transform\"};},[underlineThickness,underlineExtraWidth,underlineColor,underlineRadius]);const transition=useMemo(()=>{return{duration:Math.max(.05,hoverDuration),ease:hoverEasing};},[hoverDuration,hoverEasing]);const underlineAnimate=useMemo(()=>{if(!isInteractive)return{x:0};return{x:hovered?\"115%\":\"0%\"};},[hovered,isInteractive]);const commonAria={\"aria-label\":(ariaLabel||label||\"Call to action\").trim(),\"aria-disabled\":disabled||undefined};if(!link||disabled){return /*#__PURE__*/_jsxs(\"span\",{style:containerStyle,role:\"text\",...commonAria,onMouseEnter:onMouseEnter,onMouseLeave:onMouseLeave,children:[/*#__PURE__*/_jsx(\"span\",{style:textStyle,children:label}),/*#__PURE__*/_jsx(\"span\",{style:underlineOuterStyle,\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(motion.span,{style:underlineInnerStyle,animate:{x:0},transition:transition})})]});}return /*#__PURE__*/_jsxs(\"a\",{href:link,target:openInNewTab?\"_blank\":\"_self\",rel:openInNewTab?\"noreferrer noopener\":undefined,style:containerStyle,role:\"link\",...commonAria,onMouseEnter:onMouseEnter,onMouseLeave:onMouseLeave,onFocus:onFocus,onBlur:onBlur,children:[/*#__PURE__*/_jsx(\"span\",{style:textStyle,children:label}),/*#__PURE__*/_jsx(\"span\",{style:underlineOuterStyle,\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(motion.span,{style:underlineInnerStyle,animate:underlineAnimate,transition:transition})})]});}addPropertyControls(UnderlineSlideCTA,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Discover more\"},link:{type:ControlType.Link,title:\"Link\",defaultValue:\"\"},openInNewTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},disabled:{type:ControlType.Boolean,title:\"Disabled\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},ariaLabel:{type:ControlType.String,title:\"ARIA Label\",defaultValue:\"\",placeholder:\"Optional\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"},underlineColor:{type:ControlType.Color,title:\"Underline\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"20px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.05em\"}},underlineThickness:{type:ControlType.Number,title:\"Line Thick\",defaultValue:2,min:1,max:10,step:1,unit:\"px\"},underlineOffset:{type:ControlType.Number,title:\"Line Offset\",defaultValue:8,min:0,max:40,step:1,unit:\"px\"},underlineExtraWidth:{type:ControlType.Number,title:\"Line Extra\",defaultValue:0,min:0,max:80,step:1,unit:\"px\"},underlineRadius:{type:ControlType.Number,title:\"Line Radius\",defaultValue:0,min:0,max:20,step:1,unit:\"px\"},hoverDuration:{type:ControlType.Number,title:\"Hover Dur\",defaultValue:.45,min:.05,max:2,step:.01,unit:\"s\"},hoverEasing:{type:ControlType.Enum,title:\"Easing\",options:[\"easeOut\",\"easeInOut\",\"linear\"],optionTitles:[\"Ease Out\",\"Ease In-Out\",\"Linear\"],defaultValue:\"easeOut\",displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"UnderlineSlideCTA\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"160\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"28\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UnderlineSlideCTA.map"],"mappings":"0QAMG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,eAAa,YAAU,iBAAe,OAAK,qBAAmB,kBAAgB,sBAAoB,kBAAgB,gBAAc,cAAY,WAAS,YAAU,SAAO,EAAY,EAAS,EAAoB,EAAO,CAAC,EAAS,GAAaA,EAAS,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAAE,MAAc,CAAI,GAAO,IAAS,OAAmB,GAAG,CAAC,IAAM,EAAI,EAAO,WAAW,oCAAoC,EAAQ,MAAWC,MAAoB,EAAY,CAAC,CAAC,EAAI,OAAO,CAAC,EAGtiB,OAHwiB,EAAO,EAC5iB,qBAAqB,GAAK,EAAI,iBAAiB,SAAS,CAAM,MAAY,EAAI,oBAAoB,SAAS,CAAM,IACpH,EAAI,YAAY,CAAM,MACZ,EAAI,eAAe,CAAM,EAAG,MAAM,CAAC,MAAoB,EAAY,EAAK,CAAC,CAAE,CAAC,EAAE,CAAC,CAAC,EAAE,IAAM,EAAc,CAAC,GAAU,CAAC,GAAU,EAAe,EAAaC,MAAgB,CAAK,GAAqB,MAAoB,EAAW,EAAI,CAAC,CAAE,EAAE,CAAC,CAAa,CAAC,EAAQ,EAAaA,MAAgB,CAAK,GAAqB,MAAoB,EAAW,EAAK,CAAC,CAAE,EAAE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