{"version":3,"file":"UnderlineDraw.CeUw-uDY.mjs","names":["forwardRef","useCallback","__esmMin","ne","c","J","init_jsx_runtime","init_npm_react_18_3_1","withCSS","init_framer_DcxuU94H","ensureStyle","id","tag","rules","makeLinkLine","setRef","node","name","attribute","forwardedRef","Component","props","withUnderlineDraw","DRAW","DRAW_CSS","withUnderlineRedraw","REDRAW","REDRAW_CSS","EASE","REDRAW_Y","init_UnderlineDraw"],"sources":["https:/framerusercontent.com/modules/cd0fWqw6GmC5jnATwnRN/Zaanmx9OzsQY7jiVHShe/UnderlineDraw.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback}from\"react\";import{withCSS}from\"framer\";// UnderlineDraw: hover lines for the links inside a text. A link in a sentence can't hold a component,\n// so these overrides give every link in the text a 1 px line in the link's own colour.\n//\n// Use: select a text, open Code Overrides in the right panel, pick this file and one override:\n//   withUnderlineDraw     no line at rest; on hover the line draws in from the left and shrinks back on leave.\n//                         Give the links a link style without an underline (Link/Ink, Link/Light).\n//   withUnderlineRedraw   a line at rest; on hover it retracts to the right and draws back in from the left.\n//                         For links inside long text. Any link style works: the override draws its own line\n//                         in place of the style's underline, in the same spot (1 px, 0.2em under the text).\n// Keyboard focus plays the same motion as hover. With reduced motion on, the line just appears.\nconst DRAW=\"data-underline-draw\";const REDRAW=\"data-underline-redraw\";const EASE=\"cubic-bezier(.22,1,.36,1)\";// The redraw line sits where a 1 px underline with a 0.2em offset sits: 0.2em under the baseline.\nconst REDRAW_Y=\"calc(100% - .1em + 1px)\";const DRAW_CSS=[`[${DRAW}] a{text-decoration:none!important;background-image:linear-gradient(currentColor,currentColor);`+`background-repeat:no-repeat;background-position:0 100%;background-size:0% 1px;`+`transition:background-size .5s ${EASE}}`,`[${DRAW}] a:hover,[${DRAW}] a:focus-visible{background-size:100% 1px}`,`@media (prefers-reduced-motion: reduce){[${DRAW}] a{transition:none}}`];const REDRAW_CSS=[`[${REDRAW}] a{text-decoration:none!important;background-image:linear-gradient(currentColor,currentColor);`+`background-repeat:no-repeat;background-position:0 ${REDRAW_Y};background-size:100% 1px}`,`[${REDRAW}] a:hover,[${REDRAW}] a:focus-visible{animation:underline-redraw .5s ${EASE}}`,`@keyframes underline-redraw{`+`0%{background-position:100% ${REDRAW_Y};background-size:100% 1px}`+`40%{background-position:100% ${REDRAW_Y};background-size:0% 1px}`+`50%{background-position:0 ${REDRAW_Y};background-size:0% 1px}`+`100%{background-position:0 ${REDRAW_Y};background-size:100% 1px}}`,`@media (prefers-reduced-motion: reduce){[${REDRAW}] a{animation:none!important}}`];// withCSS puts the rules in the server-rendered page, so they are there before the page hydrates.\n// ensureStyle is the fallback for anything that renders the override outside that path.\nfunction ensureStyle(id,rules){if(typeof document===\"undefined\"||document.getElementById(id))return;const tag=document.createElement(\"style\");tag.id=id;tag.textContent=rules.join(\"\\n\");document.head.appendChild(tag);}function makeLinkLine(attribute,rules,name,Component){const Override=/*#__PURE__*/forwardRef(function UnderlineDraw(props,forwardedRef){// The ref callback runs for every node the text renders, so a node swapped in by a breakpoint or\n// variant change gets the attribute too.\nconst setRef=useCallback(node=>{if(node){ensureStyle(name,rules);node.setAttribute(attribute,\"\");}if(typeof forwardedRef===\"function\")forwardedRef(node);else if(forwardedRef)forwardedRef.current=node;},[forwardedRef]);return /*#__PURE__*/_jsx(Component,{...props,[attribute]:\"\",ref:setRef});});return withCSS(Override,rules,name);}export function withUnderlineDraw(Component){return makeLinkLine(DRAW,DRAW_CSS,\"underline-draw-css\",Component);}export function withUnderlineRedraw(Component){return makeLinkLine(REDRAW,REDRAW_CSS,\"underline-redraw-css\",Component);}\nexport const __FramerMetadata__ = {\"exports\":{\"withUnderlineDraw\":{\"type\":\"reactHoc\",\"name\":\"withUnderlineDraw\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUnderlineRedraw\":{\"type\":\"reactHoc\",\"name\":\"withUnderlineRedraw\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":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