{"version":3,"file":"UnderlineLink_2.09ISCqKz.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/PEgSSaU6AKxM2hdZtFwg/BuHRCJh2q8N8FyE671lj/UnderlineLink_2.js"],"sourcesContent":["// Animated underline link component with slide-out/slide-in animation on hover\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function UnderlineLink(props){const{text,url,openInNewPage,textColor,underlineColor,hoverTextColor,underlineThickness,font}=props;const[isHovered,setIsHovered]=useState(false);const[animationKey,setAnimationKey]=useState(0);const handleMouseEnter=()=>{setIsHovered(true);setTimeout(()=>{setAnimationKey(prev=>prev+1);},100);};const handleMouseLeave=()=>{setIsHovered(false);setTimeout(()=>{setAnimationKey(prev=>prev+1);},100);};return /*#__PURE__*/_jsxs(\"a\",{href:url,target:openInNewPage?\"_blank\":\"_self\",rel:openInNewPage?\"noopener noreferrer\":undefined,style:{position:\"relative\",display:\"inline-block\",textDecoration:\"none\",color:isHovered?hoverTextColor:textColor,transition:\"color 0.2s ease\",width:\"max-content\",...font},onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,children:[text,/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:-4,left:0,width:\"100%\",height:underlineThickness,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",bottom:0,left:0,width:\"100%\",height:underlineThickness,backgroundColor:underlineColor},initial:{x:\"-100%\"},animate:{x:\"0%\"},exit:{x:\"100%\"},transition:{type:\"spring\",stiffness:200,damping:40,mass:1}},animationKey)})})]});}addPropertyControls(UnderlineLink,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Animated Link\"},url:{type:ControlType.String,title:\"URL\",defaultValue:\"https://framer.com\"},openInNewPage:{type:ControlType.Boolean,title:\"Open in New Page\",defaultValue:false,enabledTitle:\"New Page\",disabledTitle:\"Same Page\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},underlineColor:{type:ControlType.Color,title:\"Underline Color\",defaultValue:\"#000000\"},hoverTextColor:{type:ControlType.Color,title:\"Hover Text Color\",defaultValue:\"#000000\"},underlineThickness:{type:ControlType.Number,title:\"Underline Thickness\",defaultValue:2,min:1,max:10,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"UnderlineLink\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UnderlineLink_2.map"],"mappings":"yOAIG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,MAAI,gBAAc,YAAU,iBAAe,iBAAe,qBAAmB,QAAM,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAO,MAAqB,CAAC,EAAa,GAAK,CAAC,eAAe,CAAC,EAAgB,GAAM,EAAK,EAAE,EAAG,IAAI,EAAS,MAAqB,CAAC,EAAa,GAAM,CAAC,eAAe,CAAC,EAAgB,GAAM,EAAK,EAAE,EAAG,IAAI,EAAG,OAAoB,EAAM,IAAI,CAAC,KAAK,EAAI,OAAO,EAAc,SAAS,QAAQ,IAAI,EAAc,sBAAsB,IAAA,GAAU,MAAM,CAAC,SAAS,WAAW,QAAQ,eAAe,eAAe,OAAO,MAAM,EAAU,EAAe,EAAU,WAAW,kBAAkB,MAAM,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