{"version":3,"file":"MagneticButton.CeiTow3z.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/yQl4dnVHHq7QBPJKqq4d/MEnF1qccVKdzPVrgnmuH/MagneticButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef}from\"react\";/**\n * MAGNETIC BUTTON\n * Ports shared.js initMagneticButtons(), BUT note the shipped build\n * DISABLED magnetic displacement (the function early-returns) per the\n * Round-3 design-feedback-log decision: \"CTAs use a consistent hover\n * state (bg fill + slight lift), not magnetic.\"\n *\n * So this component ships with `magnetic=false` by default → it renders\n * the LOCKED hover: background fills malachite, text stays bone,\n * translateY(-2px), 0.3s ease. That is the correct on-brand CTA.\n *\n * The magnetic path is preserved (set `magnetic=true`) ONLY because the\n * original code is documented here. If enabled it obeys the locked clamp\n * rules: container strength 0.2, label displacement clamped to\n * ±(paddingX - 4px) so the label never escapes the box.\n *\n * Motion: zero external dependencies (no CDN). The magnetic path uses\n * the CSS `translate` property with transitions (0.4s ease-out in,\n * 0.6s overshoot back), so it composes with the hover lift transform.\n *\n * Reduced motion: under prefers-reduced-motion the magnetic path is\n * disabled and the hover lift is dropped (color change only). The\n * magnetic path is gated to pointer:fine and is off by default.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function MagneticButton(props){const{label,href,variant,bg,fg,hoverBg,fontSize,paddingX,paddingY,magnetic,strength}=props;const btnRef=useRef(null);const labelRef=useRef(null);const isOutline=variant===\"outline\";const reduced=()=>typeof window!==\"undefined\"&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;const moveTo=(el,x,y,back)=>{if(!el)return;el.style.transition=back?\"translate 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, color 0.3s ease, transform 0.3s ease\":\"translate 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.3s ease, color 0.3s ease, transform 0.3s ease\";el.style.translate=`${x}px ${y}px`;};const onMove=e=>{if(!magnetic||reduced())return;if(!window.matchMedia(\"(pointer: fine)\").matches)return;const btn=btnRef.current;const lbl=labelRef.current;if(!btn)return;const r=btn.getBoundingClientRect();const cx=r.left+r.width/2;const cy=r.top+r.height/2;const dx=e.clientX-cx;const dy=e.clientY-cy;const dist=Math.sqrt(dx*dx+dy*dy);const radius=120;if(dist<radius){moveTo(btn,dx*strength,dy*strength,false);if(lbl){const maxOffset=paddingX-4// clamp inside box (locked rule)\n;const cxOff=Math.max(-maxOffset,Math.min(maxOffset,dx*strength));const cyOff=Math.max(-maxOffset,Math.min(maxOffset,dy*strength));moveTo(lbl,cxOff,cyOff,false);}}};const onLeave=()=>{if(!magnetic)return;const btn=btnRef.current;const lbl=labelRef.current;moveTo(btn,0,0,true);moveTo(lbl,0,0,true);};return /*#__PURE__*/_jsx(\"a\",{ref:btnRef,href:href||\"#\",onMouseMove:onMove,onMouseLeave:onLeave,className:\"mag-btn\",style:{display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",padding:`${paddingY}px ${paddingX}px`,background:isOutline?\"transparent\":bg,color:isOutline?bg:fg,border:isOutline?`1.5px solid ${bg}`:\"none\",fontFamily:\"'Instrument Sans', 'Instrument Sans Variable', system-ui, sans-serif\",fontSize,fontWeight:500,letterSpacing:\"0.02em\",textDecoration:\"none\",borderRadius:0,cursor:\"pointer\",transition:\"background 0.3s ease, color 0.3s ease, transform 0.3s ease\"},onMouseEnter:e=>{const t=e.currentTarget;t.style.background=isOutline?bg:hoverBg;t.style.color=isOutline?fg:fg;if(!reduced())t.style.transform=\"translateY(-2px)\";},onMouseOut:e=>{const t=e.currentTarget;t.style.background=isOutline?\"transparent\":bg;t.style.color=isOutline?bg:fg;t.style.transform=\"translateY(0)\";},children:/*#__PURE__*/_jsx(\"span\",{ref:labelRef,className:\"btn-label\",style:{display:\"inline-block\"},children:label})});}MagneticButton.defaultProps={label:\"Get in touch\",href:\"\",variant:\"solid\",bg:\"var(--token-25542e87-3725-48c1-aa62-7834c0a54d9b, #1F2A37)\",fg:\"var(--token-51be705e-b1f5-4e95-ab55-2beba1912fa5, #FAFAFA)\",hoverBg:\"var(--token-4cb6800d-1da9-45b7-9475-96d12bf06551, #E2581E)\",fontSize:15,paddingX:36,paddingY:16,magnetic:false,strength:.2};addPropertyControls(MagneticButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Get in touch\"},href:{type:ControlType.Link,title:\"Link\"},variant:{type:ControlType.Enum,title:\"Variant\",options:[\"solid\",\"outline\"],defaultValue:\"solid\"},bg:{type:ControlType.Color,title:\"Background\",defaultValue:\"var(--token-25542e87-3725-48c1-aa62-7834c0a54d9b, #1F2A37)\"},fg:{type:ControlType.Color,title:\"Text\",defaultValue:\"var(--token-51be705e-b1f5-4e95-ab55-2beba1912fa5, #FAFAFA)\"},hoverBg:{type:ControlType.Color,title:\"Hover bg\",defaultValue:\"var(--token-4cb6800d-1da9-45b7-9475-96d12bf06551, #E2581E)\"},fontSize:{type:ControlType.Number,title:\"Font size\",min:11,max:24,step:1,defaultValue:15},paddingX:{type:ControlType.Number,title:\"Padding X\",min:12,max:80,step:2,defaultValue:36},paddingY:{type:ControlType.Number,title:\"Padding Y\",min:6,max:40,step:2,defaultValue:16},magnetic:{type:ControlType.Boolean,title:\"Magnetic (off=locked)\",defaultValue:false},strength:{type:ControlType.Number,title:\"Strength\",min:0,max:.2,step:.01,defaultValue:.2,hidden:p=>!p.magnetic}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MagneticButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MagneticButton.map"],"mappings":"wLA0BG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,UAAQ,KAAG,KAAG,UAAQ,WAAS,WAAS,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