{"version":3,"file":"SweepLink.DlBAO2ak.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","_e","p","ce","de","init_framer_BisrWwwE","addPropertyControls","useIsStaticRenderer","ControlType","init_Routing","init_MachFonts","machFont","init_Twist","TwistText","TwistCube","useSiteNavigate","SweepLink","props","navigate","isStatic","labelRef","timers","hovered","setHovered","phase","setPhase","labelWidth","setLabelWidth","t","onClick","link","event","later","fn","ms","FILL","ease","block","accent","COLLAPSE","chevronShift","on","font","FADE","CHEVRON","hover","label","twistFace","init_SweepLink","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/SVcZ8s8WqSuaDckVy4sW/14JGiDabWAEaDh6Qb0DB/SweepLink.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{machFont}from\"https://framerusercontent.com/modules/a0TsvHledqpAPWOtDuE5/jPBOsaZJQ1xDQExa46Bu/MachFonts.js\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useSiteNavigate}from\"https://framerusercontent.com/modules/wN9UGsGiGcpKTPbzKYWV/p8l41evwe6nMLKvB4MyD/Routing.js\";import{TwistCube,TwistText}from\"https://framerusercontent.com/modules/9I9Zz9b6wLXRESJfnzEv/BSNLZPTW4kEOVEFdX5bC/Twist.js\";const CHEVRON=\"M8.66671 4.37498V9.62502L4.43485 13.8975C4.36984 13.9631 4.28166 14 4.18972 14H0.346666C0.155208 14 0 13.8433 0 13.65V9.76998C0 9.67716 0.0365206 9.58814 0.101528 9.5225L2.35478 7.24744C2.49015 7.11076 2.49015 6.88916 2.35477 6.75248L0.101532 4.4775C0.0365222 4.41186 0 4.32284 0 4.23001V0.35C0 0.1567 0.155208 0 0.346667 0H4.18972C4.28166 0 4.36984 0.036874 4.43485 0.10251L8.66671 4.37498Z\";// Seconds for each step of the click sequence.\nconst FILL=.28;const COLLAPSE=.28;const FADE=.16;/**\n * Text link with a chevron, e.g. \"See all work\". On hover the label turns over strip by strip like the buttons\n * (or, with Hover set to Nudge, nudges a little to the right) while the chevron stays still. On click a block of\n * the accent colour sweeps over the label, shrinks into the chevron at the end,\n * the chevron fades, and then the page changes.\n *\n * @framerIntrinsicWidth 160\n * @framerIntrinsicHeight 23\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function SweepLink(props){const{label,link,color,accent,font,hover=\"twist\"}=props;const navigate=useSiteNavigate();const isStatic=useIsStaticRenderer();const labelRef=useRef(null);const timers=useRef([]);const[hovered,setHovered]=useState(false);const[phase,setPhase]=useState(\"idle\");const[labelWidth,setLabelWidth]=useState(0);useEffect(()=>()=>timers.current.forEach(t=>window.clearTimeout(t)),[]);function onClick(event){if(!link||isStatic||phase!==\"idle\")return;if(event.metaKey||event.ctrlKey||event.shiftKey||event.button!==0)return;if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;event.preventDefault();setLabelWidth(labelRef.current?.offsetWidth??0);const later=(ms,fn)=>timers.current.push(window.setTimeout(fn,ms));setPhase(\"fill\");later(FILL*1e3,()=>setPhase(\"collapse\"));later((FILL+COLLAPSE)*1e3,()=>setPhase(\"gone\"));later((FILL+COLLAPSE+FADE)*1e3,()=>{// Through Framer's router (works in the preview too); the browser only for other links.\nif(!navigate(link))window.location.assign(link);// If the page doesn't change (same page, new tab blocked…), bring the label back.\nlater(600,()=>{setPhase(\"return\");later(400,()=>setPhase(\"idle\"));});});}const ease=\"cubic-bezier(0.65, 0, 0.35, 1)\";// The colour block covering the label: grows from the left, then shrinks into the right end.\nconst block={position:\"absolute\",inset:0,background:accent,clipPath:phase===\"fill\"?\"inset(0 0 0 0)\":phase===\"collapse\"||phase===\"gone\"?\"inset(0 0 0 100%)\":\"inset(0 100% 0 0)\",transition:phase===\"fill\"?`clip-path ${FILL}s ${ease}`:phase===\"collapse\"?`clip-path ${COLLAPSE}s ${ease}`:\"none\"};const chevronShift=phase===\"collapse\"||phase===\"gone\"?labelWidth+4:0;// The hover sweep, only while nothing else is playing.\nconst on=hovered&&phase===\"idle\";return /*#__PURE__*/_jsxs(\"a\",{href:link||undefined,onClick:onClick,onPointerEnter:event=>{if(event.pointerType!==\"touch\")setHovered(true);},onPointerLeave:()=>setHovered(false),style:{display:\"inline-flex\",alignItems:\"center\",gap:4,color,textDecoration:\"none\",fontFamily:'\"Departure Mono Regular\", \"Departure Mono\", monospace',textTransform:\"uppercase\",whiteSpace:\"nowrap\",cursor:link?\"pointer\":\"default\",...machFont(font),// The font setting may carry its own line height; this one keeps the chevron and text centred together.\nlineHeight:\"23px\",// Caption M.\nfontSize:14},children:[/*#__PURE__*/_jsx(\"svg\",{width:\"9\",height:\"14\",viewBox:\"0 0 8.66671 14\",\"aria-hidden\":\"true\",style:{display:\"block\",flex:\"none\",position:\"relative\",zIndex:1,transform:`translateX(${chevronShift}px) scaleX(${phase===\"gone\"?.3:1})`,opacity:phase===\"gone\"?0:1,transition:phase===\"collapse\"?`transform ${COLLAPSE}s ${ease}`:phase===\"gone\"?`transform ${FADE}s ease, opacity ${FADE}s ease`:\"none\"},children:/*#__PURE__*/_jsx(\"path\",{d:CHEVRON,fill:accent})}),/*#__PURE__*/_jsxs(\"span\",{ref:labelRef,style:{position:\"relative\",display:\"block\",height:23,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",display:\"block\",paddingRight:6,transition:\"transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease\",opacity:phase===\"gone\"?0:1,// With the twist the strips draw the label; this real copy stays for screen readers, unseen.\ncolor:hover===\"twist\"?\"transparent\":undefined,// After a click that didn't change page, the label slides back in from the left.\ntransform:`translateX(${phase===\"return\"?\"-100%\":on&&hover!==\"twist\"?\"6px\":\"0\"})`},children:label}),hover===\"twist\"&&/*#__PURE__*/_jsx(TwistCube,{turned:on,height:23,strips:7,style:{opacity:phase===\"gone\"?0:1,transform:phase===\"return\"?\"translateX(-100%)\":\"none\",transition:\"transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease\"},front:()=>/*#__PURE__*/_jsx(\"span\",{style:{...twistFace,color,transform:\"translateZ(11.5px)\"},children:/*#__PURE__*/_jsx(TwistText,{text:label})}),back:()=>/*#__PURE__*/_jsx(\"span\",{style:{...twistFace,color:accent,transform:\"rotateX(-90deg) translateZ(11.5px)\"},children:/*#__PURE__*/_jsx(TwistText,{text:label})})}),/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:block})]})]});}const twistFace={position:\"absolute\",inset:0,display:\"flex\",alignItems:\"center\",paddingRight:6,whiteSpace:\"nowrap\",backfaceVisibility:\"hidden\",WebkitBackfaceVisibility:\"hidden\"};addPropertyControls(SweepLink,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"See all work\"},link:{type:ControlType.Link,title:\"Link\"},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#0F051F\"},accent:{type:ControlType.Color,title:\"Accent\",description:\"Chevron and click sweep colour.\",defaultValue:\"#FF0000\"},hover:{type:ControlType.Enum,title:\"Hover\",options:[\"twist\",\"nudge\"],optionTitles:[\"Twist\",\"Nudge\"],defaultValue:\"twist\",displaySegmentedControl:true},font:{type:ControlType.Font,title:\"Font\",description:\"Set to Departure Mono so the typeface loads.\",controls:\"extended\",defaultFontType:\"monospace\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SweepLink\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"23\",\"framerSupportedLayoutWidth\":\"auto\",\"framerIntrinsicWidth\":\"160\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,mSAYG,SAAwBqB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,QAAM,SAAO,OAAK,QAAM,SAASC,EAAYC,EAASH,EAAgB,EAAQI,EAASZ,EAAoB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