{"version":3,"file":"shared-lib.D52iyOaV.mjs","names":[],"sources":["https:/framerusercontent.com/modules/y1rhp1nSCpumeujWt9Re/CDE8STgQ9X0B1p9ZBbiV/FocusRings.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls}from\"framer\";/**\n * Focus rings: the design system's focus indicator on every page (Tokens - Colour.md, \"A focus indicator\": an outline or ring at 3:1\n * against what surrounds it, on every focusable element, never a change of colour or lift alone; #26AAFF on the dark night band, the\n * link blue #1E6FA8 on light surfaces). Daniel's yes of 15 Sept 2026: \"fix it so it matches our visual identity\".\n * - Every link, button, field and focusable layer gets a 3px ring 3px outside it when focused from the keyboard (:focus-visible), as the\n *   404 page and the Learn hub already draw theirs.\n * - The colour follows the surface the ring sits on: when an element takes focus, the nearest ancestor with a solid background (or a\n *   gradient's first colour) decides; light surfaces get the link blue, dark ones the sky blue. Without JavaScript the ring is sky blue.\n * - A link that wraps a rounded card or button of its own size (the Next up cards, the waitlist button) takes that shape's corners\n *   while focused, so the ring follows the card instead of a square box around it.\n * - The homepage's coach coins: the approved prototype's 4px sky ring on the coin itself (`.bubble-coach:focus-visible .ring` in\n *   010 Inbox/GFG Website Rebuild/index.html), no outline around the coin and its name tag. Layers found by name; keep the names.\n * - The general rule has zero specificity (:where), so every ring a page already designs (the hub's tiles and cards, the calculator, the\n *   form fields, the coach page's coins, the contact button, the 404 page) keeps its own look.\n * Renders only a stylesheet; one instance per page.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight fixed\n */const CSS=`\n:where(a[href],button,input,select,textarea,summary,[tabindex]:not([tabindex=\"-1\"])):focus-visible{outline:3px solid #26AAFF;outline-offset:3px}\n:where([data-gfg-surface=\"light\"]):focus-visible{outline-color:#1E6FA8}\n[data-gfg-radius]:focus-visible{border-radius:var(--gfg-radius) !important}\n:is([data-framer-name=\"Daniel Coin\"],[data-framer-name=\"Mike Coin\"],[data-framer-name=\"Sondre Coin\"]):focus-visible,:is([data-framer-name=\"Daniel Coin\"],[data-framer-name=\"Mike Coin\"],[data-framer-name=\"Sondre Coin\"]) button:focus-visible{outline:none !important}\n:is([data-framer-name=\"Daniel Coin\"],[data-framer-name=\"Mike Coin\"],[data-framer-name=\"Sondre Coin\"]):is(:focus-visible,:has(button:focus-visible)) [data-framer-name=\"Ring / Black Edge\"]{box-shadow:0 0 0 4px #26AAFF,0 18px 34px rgba(0,0,0,.45) !important}\n`;const parse=s=>{const m=s.match(/rgba?\\(([^)]+)\\)/);if(!m)return null;const p=m[1].split(/[\\s,/]+/).filter(Boolean).map(Number);return[p[0],p[1],p[2],p.length>3?p[3]:1];};const luminance=([r,g,b])=>{const c=v=>{v/=255;return v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4);};return .2126*c(r)+.7152*c(g)+.0722*c(b);};const surfaceIsLight=el=>{for(let e=el.parentElement;e;e=e.parentElement){const cs=getComputedStyle(e);const bg=parse(cs.backgroundColor);if(bg&&bg[3]>=.5)return luminance(bg)>.4;if(/gradient/.test(cs.backgroundImage)){const first=parse(cs.backgroundImage);if(first&&first[3]>=.5)return luminance(first)>.4;}}return true;};// the corners of a same-size rounded layer inside an element that has none of its own\nconst innerRadius=el=>{if(parseFloat(getComputedStyle(el).borderTopLeftRadius)>0)return null;const r=el.getBoundingClientRect();let level=Array.from(el.children);for(let depth=0;level.length&&depth<4;depth++){const next=[];for(const k of level){const kr=k.getBoundingClientRect();const same=Math.abs(kr.left-r.left)<=4&&Math.abs(kr.right-r.right)<=4&&Math.abs(kr.top-r.top)<=4&&Math.abs(kr.bottom-r.bottom)<=4;if(same&&parseFloat(getComputedStyle(k).borderTopLeftRadius)>0)return getComputedStyle(k).borderRadius;next.push(...Array.from(k.children));}level=next;}return null;};export default function FocusRings(){React.useEffect(()=>{const w=window;if(w.__gfgFocusRings)return;w.__gfgFocusRings=true;const onFocus=ev=>{const el=ev.target;if(!el||!el.setAttribute)return;el.setAttribute(\"data-gfg-surface\",surfaceIsLight(el)?\"light\":\"dark\");const radius=innerRadius(el);if(radius){el.style.setProperty(\"--gfg-radius\",radius);el.setAttribute(\"data-gfg-radius\",\"\");}};document.addEventListener(\"focusin\",onFocus,true);},[]);return /*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}});}addPropertyControls(FocusRings,{});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FocusRings\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FocusRings.map"],"mappings":"iLAyBikB,SAAwB,GAAY,CAAyZ,OAAxZ,MAAoB,CAAC,IAAM,EAAE,EAAU,EAAE,kBAAuB,EAAE,gBAAgB,GAA8Q,SAAS,iBAAiB,UAArR,GAAI,CAAC,IAAM,EAAG,EAAG,OAAO,GAAG,CAAC,GAAI,CAAC,EAAG,aAAa,OAAO,EAAG,aAAa,mBAAmB,EAAe,CAAE,EAAE,QAAQ,MAAM,EAAE,IAAM,EAAO,EAAY,CAAE,EAAK,IAAQ,EAAG,MAAM,YAAY,eAAe,CAAM,EAAE,EAAG,aAAa,kBAAkB,EAAE,EAAG,EAA8C,EAAI,EAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,QAAQ,CAAC,wBAAwB,CAAC,OAAO,CAAG,CAAC,CAAC,CAAE,+BAzB7hC,IAA4B,IAAwC,EAkBrG,EAAI;;;;;;EAML,EAAM,GAAG,CAAC,IAAM,EAAE,EAAE,MAAM,kBAAkB,EAAE,GAAG,CAAC,EAAE,OAAO,KAAK,IAAM,EAAE,EAAE,EAAE,CAAC,MAAM,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,CAAE,EAAQ,GAAW,CAAC,EAAE,EAAE,KAAK,CAAC,IAA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