{"version":3,"file":"Sweep.CVkrTPF_.mjs","names":["useRef","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","ce","init_jsx_runtime","c","de","window","init_framer_BEr93sCn","addPropertyControls","useIsStaticRenderer","ControlType","Sweep","props","ref","isStatic","el","host","fine","set","on","enter","leave","down","pressed","up","focus","bleed","color","radius","preview","duration","init_Sweep"],"sources":["https:/framerusercontent.com/modules/VYFfZjfs5hpeBkOfuujB/AGf0ztGSNgvGzBPyWzoC/Sweep.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * Sweep: a fill that wipes in from the left on hover and leaves to the right (buttons, link underlines).\n * Place it inside the button or link as an absolute layer; it listens to the nearest link or button around it.\n *\n * @framerIntrinsicWidth 120\n * @framerIntrinsicHeight 40\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function Sweep(props){const{color=\"#EDEBE6\",duration=.45,radius=0,bleed=0,pressed=true,preview=false}=props;const ref=useRef(null);const isStatic=useIsStaticRenderer();useEffect(()=>{const el=ref.current;if(!el||isStatic)return;// the host: nearest link or button, else the nearest named Framer layer above us\nlet host=el.parentElement;while(host&&!(host.tagName===\"A\"||host.tagName===\"BUTTON\"||host.getAttribute(\"role\")===\"button\"))host=host.parentElement;if(!host){host=el.parentElement;while(host&&(getComputedStyle(host).display===\"contents\"||!host.hasAttribute(\"data-framer-name\")))host=host.parentElement;}if(!host)return;const fine=window.matchMedia(\"(hover: hover) and (pointer: fine)\").matches;const set=on=>{el.style.transformOrigin=on?\"0% 50%\":\"100% 50%\";el.style.transform=on?\"scaleX(1)\":\"scaleX(0)\";};const enter=()=>fine&&set(true);const leave=()=>set(false);const down=()=>pressed&&set(true);const up=()=>{if(!fine||!host.matches(\":hover\"))set(false);};const focus=()=>{if(host.matches(\":focus-visible\"))set(true);};host.addEventListener(\"pointerenter\",enter);host.addEventListener(\"pointerleave\",leave);host.addEventListener(\"pointerdown\",down);host.addEventListener(\"pointerup\",up);host.addEventListener(\"pointercancel\",leave);host.addEventListener(\"focus\",focus,true);host.addEventListener(\"blur\",leave,true);return()=>{host.removeEventListener(\"pointerenter\",enter);host.removeEventListener(\"pointerleave\",leave);host.removeEventListener(\"pointerdown\",down);host.removeEventListener(\"pointerup\",up);host.removeEventListener(\"pointercancel\",leave);host.removeEventListener(\"focus\",focus,true);host.removeEventListener(\"blur\",leave,true);};},[isStatic,pressed]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,\"aria-hidden\":\"true\",style:{...props.style,position:\"relative\",// bleed: the fill reaches past the layer on both sides (a full-width row whose hover fill runs into the page gutter)\nleft:bleed?-bleed:undefined,width:bleed?`calc(100% + ${bleed*2}px)`:\"100%\",height:\"100%\",background:color,borderRadius:radius,pointerEvents:\"none\",transform:isStatic&&preview?\"scaleX(1)\":\"scaleX(0)\",transformOrigin:\"100% 50%\",transition:`transform ${duration}s cubic-bezier(0.23, 1, 0.32, 1)`}});}addPropertyControls(Sweep,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#EDEBE6\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:.45,min:.1,max:1.5,step:.05,unit:\"s\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:999},bleed:{type:ControlType.Number,title:\"Bleed\",defaultValue:0,min:0,max:120,unit:\"px\"},pressed:{type:ControlType.Boolean,title:\"On press\",defaultValue:true},preview:{type:ControlType.Boolean,title:\"Show on canvas\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Sweep\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"40\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"120\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"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