{"version":3,"file":"HoverTextLink.B9uPPblC.mjs","names":["useState","useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/P3kXqYnwMiTXhmP4uvOn/SAUTQQqf61q6cHuRZHKU/HoverTextLink.js"],"sourcesContent":["// User request: Create minimal Framer code component HoverTextLink.tsx that renders its OWN <a href> DOM element, not override. Property controls text default Find out more ↗, href Link default /about, font ControlType.Font default BDO Grotesk16px weight500 lineheight1.2, color white, hoverScale1.15. React onMouseEnter state sets CSS transform scale1.15 transformOrigin left center transition transform300ms ease; onMouseLeave scale1. NO refs target discovery overrides. display inline-block textDecoration none colorwhite. honor style Framer sizing, @supportedLayoutWidth any height auto. Native real anchor preserves links. This is a last resort because overrides/native hoverEffect silently fail on RichText. Return code component id. Minimal scoped CSS or direct inline state, reliable. Keep text editable.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{startTransition,useCallback,useMemo,useState}from\"react\";function resolveLinkValue(value){if(typeof value===\"string\")return value;if(!value||typeof value!==\"object\")return\"\";const candidate=value;if(typeof candidate.href===\"string\")return candidate.href;if(typeof candidate.url===\"string\")return candidate.url;if(typeof candidate.path===\"string\")return candidate.path;return\"\";}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function HoverTextLink(props){const{text=\"Find out more ↗\",href=\"/about\",externalUrl=\"\",nativeLink=false,textStyle={fontSize:\"16px\",lineHeight:\"1.2em\",fontWeight:500},color=\"#FFFFFF\",hoverScale=1.15,style}=props;const[isHovered,setIsHovered]=useState(false);const resolvedHref=useMemo(()=>{const external=(externalUrl??\"\").trim();if(external)return external;const internal=resolveLinkValue(href).trim();if(internal)return internal;return\"/about\";},[externalUrl,href]);const isExternal=/^https?:\\/\\//i.test((externalUrl??\"\").trim());const handleMouseEnter=useCallback(_=>{startTransition(()=>setIsHovered(true));},[]);const handleMouseLeave=useCallback(_=>{startTransition(()=>setIsHovered(false));},[]);const mergedStyle=useMemo(()=>({...style,position:style?.position??\"relative\",display:\"inline-block\",minWidth:\"max-content\",textDecoration:\"none\",color,transformOrigin:\"left center\",transform:isHovered?`scale(${hoverScale})`:\"scale(1)\",transition:\"transform 300ms ease\",fontSize:textStyle?.fontSize,fontWeight:textStyle?.fontWeight,fontStyle:textStyle?.fontStyle,lineHeight:textStyle?.lineHeight,letterSpacing:textStyle?.letterSpacing,textAlign:textStyle?.textAlign,fontFamily:textStyle?.fontFamily??'\"BDO Grotesk\", sans-serif',width:style?.width,height:style?.height,boxSizing:\"border-box\"}),[color,hoverScale,isHovered,style,textStyle]);if(nativeLink){return /*#__PURE__*/_jsx(\"span\",{onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,style:mergedStyle,children:text});}return /*#__PURE__*/_jsx(\"a\",{href:resolvedHref,target:isExternal?\"_blank\":undefined,rel:isExternal?\"noopener noreferrer\":undefined,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,style:mergedStyle,children:text});}addPropertyControls(HoverTextLink,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Find out more ↗\"},href:{type:ControlType.Link,title:\"Link\",defaultValue:\"/about\"},externalUrl:{type:ControlType.String,title:\"External URL\",defaultValue:\"\",placeholder:\"https://example.com\"},nativeLink:{type:ControlType.Boolean,title:\"Native Link\",defaultValue:false},textStyle:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",lineHeight:\"1.2em\",letterSpacing:\"0em\"}},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FFFFFF\"},hoverScale:{type:ControlType.Number,title:\"Hover Scale\",min:1,max:2,step:.01,defaultValue:1.15}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HoverTextLink\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{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