{"version":3,"file":"Text_Line_Not_Visible.DtvrHwHQ.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/3PGFN8BXk996aOoR1Zks/I6EjCltP22FSt08vPcEW/Text_Line_Not_Visible.js"],"sourcesContent":["// Animated-underline link that wraps a SLOT instead of generating text.\n// Drop any native Text layer into the \"Content\" slot — including one that\n// is connected to a Framer Text Style — and the underline animates beneath it.\n//\n// Line modes\n//  • Visible: current behaviour — visible at rest, retracts right on hover,\n//    then grows back from the left on hover out.\n//  • Hidden: hidden at rest, grows from the left on hover, stays while hovered,\n//    then retracts to the right on hover out.\n//\n// The appear and hover animations have separate transition controls.\n/**\n * Underline link (text-style slot)\n *\n * @framerIntrinsicWidth 140\n * @framerIntrinsicHeight 28\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect,startTransition}from\"react\";/* ------------------------------------------------------------------ *//*  Helpers                                                           *//* ------------------------------------------------------------------ */const DEFAULT_EASE=[.4,0,.2,1];/** Turn a Framer Transition into duration / delay / cubic-bezier. */function resolveTiming(transition){const duration=transition?.duration!=null?transition.duration:.3;const delay=transition?.delay!=null?transition.delay:0;const ease=Array.isArray(transition?.ease)?transition.ease:DEFAULT_EASE;return{motion:`transform ${duration}s cubic-bezier(${ease.join(\",\")}) ${delay}s`,duration,delay};}/* ------------------------------------------------------------------ *//*  Component                                                         *//* ------------------------------------------------------------------ */export default function UnderlineLinkSlot(props){const{content,lineColor,underlineWeight,lineGap,transition,lineVisible,animateIn,appearTransition,style}=props;const[hovered,setHovered]=useState(false);// Treat an unset value as Visible so existing component instances keep\n// their original behaviour after this new control is introduced.\nconst showBaseLine=lineVisible!==false;// `appeared` drives the mount draw-in for the Visible mode only.\n// `appearDone` switches from the appear curve to the hover curve.\nconst shouldAnimateIn=showBaseLine&&animateIn;const[appeared,setAppeared]=useState(!shouldAnimateIn);const[appearDone,setAppearDone]=useState(!shouldAnimateIn);const hover=resolveTiming(transition);const appear=resolveTiming(appearTransition);useEffect(()=>{if(!shouldAnimateIn){setAppeared(true);setAppearDone(true);return;}setAppeared(false);setAppearDone(false);const raf=requestAnimationFrame(()=>setAppeared(true));const done=setTimeout(()=>setAppearDone(true),(appear.duration+appear.delay)*1e3+60);return()=>{cancelAnimationFrame(raf);clearTimeout(done);};},[shouldAnimateIn,appear.duration,appear.delay]);const onEnter=()=>startTransition(()=>setHovered(true));const onLeave=()=>startTransition(()=>setHovered(false));// Visible mode: full at rest, exits right on hover, enters left on leave.\n// Hidden mode: empty at rest, enters left on hover, exits right on leave.\nconst scaleX=showBaseLine?!appeared?0:hovered?0:1:hovered?1:0;const origin=showBaseLine?appearDone&&hovered?\"right\":\"left\":hovered?\"left\":\"right\";const lineMotion=showBaseLine&&!appearDone?appear.motion:hover.motion;return /*#__PURE__*/_jsxs(\"div\",{className:\"underline-slot-root\",onMouseEnter:onEnter,onMouseLeave:onLeave,style:{position:\"relative\",display:\"inline-flex\",flexDirection:\"column\",alignItems:\"flex-start\",paddingBottom:`${lineGap}px`,whiteSpace:\"nowrap\",...style},children:[content,/*#__PURE__*/_jsx(\"div\",{className:\"underline-slot-line\",style:{position:\"absolute\",left:0,right:0,bottom:0,height:`${underlineWeight}px`,backgroundColor:lineColor,transform:`scaleX(${scaleX})`,transformOrigin:origin,transition:lineMotion}}),/*#__PURE__*/_jsx(\"style\",{children:`\n                .underline-slot-root { overflow: hidden; }\n            `})]});}/* ------------------------------------------------------------------ *//*  Property controls                                                 *//* ------------------------------------------------------------------ */addPropertyControls(UnderlineLinkSlot,{content:{type:ControlType.ComponentInstance,title:\"Content\",description:\"Drop a Text layer (Text Style ok)\"},lineColor:{type:ControlType.Color,title:\"Line Color\",defaultValue:\"#000000\",description:\"Colour of the underline\"},underlineWeight:{type:ControlType.Number,title:\"Underline Weight\",defaultValue:1,min:1,max:10,unit:\"px\",description:\"Thickness of the underline\"},lineGap:{type:ControlType.Number,title:\"Line Gap\",defaultValue:2,min:0,max:20,unit:\"px\",description:\"Space between text & line\"},transition:{type:ControlType.Transition,title:\"Hover\",defaultValue:{duration:.5,ease:[.25,.8,.5,1]},description:\"Hover animation speed & easing\"},lineVisible:{type:ControlType.Boolean,title:\"Base Line\",enabledTitle:\"Visible\",disabledTitle:\"Hidden\",defaultValue:true,description:\"Show the line at rest or only while hovering\"},animateIn:{type:ControlType.Boolean,title:\"Appear\",enabledTitle:\"On\",disabledTitle:\"Off\",defaultValue:true,description:\"Draw the visible line in on load\",hidden:p=>p.lineVisible===false},appearTransition:{type:ControlType.Transition,title:\"\\xb7 Appear\",defaultValue:{duration:.8,ease:[.16,1,.3,1]},description:\"Appear speed, easing & delay\",hidden:p=>p.lineVisible===false||!p.animateIn}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"UnderlineLinkSlot\",\"slots\":[\"content\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_Line_Not_Visible.map"],"mappings":"+LAmBke,SAAS,EAAc,EAAW,CAAC,IAAM,EAAS,GAAY,UAAU,KAAyB,GAApB,EAAW,SAAkB,EAAM,GAAY,OAAO,KAAsB,EAAjB,EAAW,MAAgF,MAAM,CAAC,OAAO,aAAa,EAAS,kBAAjG,MAAM,QAAQ,GAAY,IAAI,EAAE,EAAW,KAAK,EAAA,CAAuE,KAAK,GAAG,EAAE,IAAI,EAAM,GAAG,WAAS,OAAK,CAAE,CAAyN,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,UAAQ,YAAU,kBAAgB,UAAQ,aAAW,cAAY,YAAU,mBAAiB,SAAO,EAAW,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAEjsC,EAAa,IAAc,GAE3B,EAAgB,GAAc,EAAe,CAAC,EAAS,GAAaA,EAAS,CAAC,CAAe,EAAO,CAAC,EAAW,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