{"version":3,"file":"Origin_Fill_Button.CmHFDK3g.mjs","names":["React.useRef","React.useState","React.useCallback"],"sources":["https:/framerusercontent.com/modules/oaedMn1Pyc93ak0uYsea/uwM5BAWkF8T9kaCu41WE/Origin_Fill_Button.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget,Link}from\"framer\";import{motion}from\"framer-motion\";function coverDiameter(width,height,x,y){return Math.ceil(2*Math.max(Math.hypot(x,y),Math.hypot(width-x,y),Math.hypot(x,height-y),Math.hypot(width-x,height-y)));}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function OriginFillButton(props){const{link,newTab=false,icon,iconPosition=\"right\",iconSize=20,iconGap=8,text=\"Get started\",textColor=\"var(--token-c5afc5a7-a1fb-44a7-b017-d00b4841a317)\",backgroundColor=\"var(--token-a0b8f09b-a5b7-4fe3-93b9-908f33840b53)\",overlayColor=\"var(--token-c5afc5a7-a1fb-44a7-b017-d00b4841a317)\",borderColor=\"var(--token-c5afc5a7-a1fb-44a7-b017-d00b4841a317)\",borderWidth=1,paddingTop=16,paddingRight=16,paddingBottom=16,paddingLeft=16,cornerRadius=999,font}=props;const buttonRef=React.useRef(null);const[hovered,setHovered]=React.useState(false);const[pressed,setPressed]=React.useState(false);const[origin,setOrigin]=React.useState({x:0,y:0});const[size,setSize]=React.useState(0);const isCanvas=RenderTarget.current()===RenderTarget.canvas;const isFilled=!isCanvas&&(hovered||pressed);const setPointerOrigin=React.useCallback(event=>{const rect=event.currentTarget.getBoundingClientRect();const node=event.currentTarget;const x=(event.clientX-rect.left)*(node.offsetWidth/(rect.width||1))-node.clientLeft;const y=(event.clientY-rect.top)*(node.offsetHeight/(rect.height||1))-node.clientTop;setOrigin({x,y});setSize(coverDiameter(node.clientWidth,node.clientHeight,x,y));},[]);React.useEffect(()=>{const element=buttonRef.current;if(!element||!isFilled||typeof ResizeObserver===\"undefined\")return;const measure=()=>{const rect=element.getBoundingClientRect();setSize(coverDiameter(element.clientWidth,element.clientHeight,origin.x,origin.y));};const observer=new ResizeObserver(measure);observer.observe(element);measure();return()=>observer.disconnect();},[isFilled,origin.x,origin.y]);const Tag=link?\"a\":\"button\";// Use image transparency as a mask so the icon inherits the animated label color.\nconst iconMask=icon?.src?\"url(\"+JSON.stringify(icon.src)+\")\":undefined;const iconContent=icon?.src?/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{width:iconSize,height:iconSize,display:\"block\",flexShrink:0,backgroundColor:\"currentColor\",maskImage:iconMask,WebkitMaskImage:iconMask,maskSize:\"contain\",WebkitMaskSize:\"contain\",maskRepeat:\"no-repeat\",WebkitMaskRepeat:\"no-repeat\",maskPosition:\"center\",WebkitMaskPosition:\"center\",maskMode:\"alpha\"}}):null;const content=/*#__PURE__*/_jsxs(Tag,{ref:node=>{buttonRef.current=node;},type:link?undefined:\"button\",href:link||undefined,target:link&&newTab?\"_blank\":undefined,rel:link&&newTab?\"noopener noreferrer\":undefined,\"aria-label\":text,onPointerEnter:event=>{setPointerOrigin(event);setHovered(true);},onPointerLeave:event=>{setPointerOrigin(event);setHovered(false);setPressed(false);},onPointerCancel:()=>{setHovered(false);setPressed(false);},onPointerDown:event=>{if(event.button===0){setPointerOrigin(event);setPressed(true);}},onPointerUp:()=>setPressed(false),onFocus:()=>{const element=buttonRef.current;if(!element||!element.matches(\":focus-visible\"))return;const rect=element.getBoundingClientRect();const x=element.clientWidth/2;const y=element.clientHeight/2;setOrigin({x,y});setSize(coverDiameter(element.clientWidth,element.clientHeight,x,y));setHovered(true);},onBlur:()=>{setHovered(false);setPressed(false);},style:{position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",width:\"max-content\",minWidth:\"max-content\",whiteSpace:\"nowrap\",flexShrink:0,boxSizing:\"border-box\",overflow:\"hidden\",cursor:\"pointer\",paddingTop:Math.max(0,paddingTop),paddingRight:Math.max(0,paddingRight),paddingBottom:Math.max(0,paddingBottom),paddingLeft:Math.max(0,paddingLeft),borderRadius:Math.max(0,cornerRadius),border:Math.max(0,borderWidth)+\"px solid \"+borderColor,background:backgroundColor,color:isFilled?backgroundColor:textColor,fontFamily:'\"PP Neue Montreal\", sans-serif',fontWeight:500,fontSize:16,lineHeight:1.1,letterSpacing:\"-0.02em\",...font,transition:\"color 300ms cubic-bezier(0.16, 1, 0.3, 1)\",WebkitTapHighlightColor:\"transparent\",textDecoration:\"none\"},children:[/*#__PURE__*/_jsx(motion.span,{\"aria-hidden\":\"true\",initial:false,animate:{scale:isFilled&&size>0?1:0},transition:{duration:.5,ease:[.16,1,.3,1]},style:{position:\"absolute\",width:size,height:size,left:origin.x-size/2,top:origin.y-size/2,borderRadius:\"50%\",background:overlayColor,pointerEvents:\"none\",transformOrigin:\"50% 50%\"}}),/*#__PURE__*/_jsxs(\"span\",{style:{position:\"relative\",zIndex:1,whiteSpace:\"nowrap\",flexShrink:0,display:\"inline-flex\",alignItems:\"center\",gap:icon?.src?iconGap:0,pointerEvents:\"none\"},children:[iconPosition===\"left\"?iconContent:null,/*#__PURE__*/_jsx(\"span\",{children:text}),iconPosition===\"right\"?iconContent:null]})]});return link?/*#__PURE__*/_jsx(Link,{href:link,openInNewTab:newTab,children:content}):content;}addPropertyControls(OriginFillButton,{link:{type:ControlType.Link,title:\"Link\"},newTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false},icon:{type:ControlType.ResponsiveImage,title:\"Icon Image\",description:\"Upload a transparent PNG or SVG. The icon follows the normal and hover text colors.\"},iconPosition:{type:ControlType.Enum,title:\"Icon Position\",options:[\"left\",\"right\"],defaultValue:\"right\",displaySegmentedControl:true},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:20,min:12,max:64,step:4,unit:\"px\"},iconGap:{type:ControlType.Number,title:\"Icon Gap\",defaultValue:8,min:0,max:48,step:4,unit:\"px\"},text:{type:ControlType.String,title:\"Text\",defaultValue:\"Get started\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"var(--token-c5afc5a7-a1fb-44a7-b017-d00b4841a317)\"},backgroundColor:{type:ControlType.Color,title:\"BG Color\",defaultValue:\"var(--token-a0b8f09b-a5b7-4fe3-93b9-908f33840b53)\"},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",defaultValue:\"var(--token-c5afc5a7-a1fb-44a7-b017-d00b4841a317)\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"var(--token-c5afc5a7-a1fb-44a7-b017-d00b4841a317)\"},borderWidth:{type:ControlType.Number,title:\"Border Stroke\",defaultValue:1,min:0,max:8,step:1,unit:\"px\"},paddingTop:{type:ControlType.Number,title:\"Padding Top\",defaultValue:16,min:0,max:128,step:4,unit:\"px\"},paddingRight:{type:ControlType.Number,title:\"Padding Right\",defaultValue:16,min:0,max:128,step:4,unit:\"px\"},paddingBottom:{type:ControlType.Number,title:\"Padding Bottom\",defaultValue:16,min:0,max:128,step:4,unit:\"px\"},paddingLeft:{type:ControlType.Number,title:\"Padding Left\",defaultValue:16,min:0,max:128,step:4,unit:\"px\"},cornerRadius:{type:ControlType.Number,title:\"Corner Radius\",defaultValue:999,min:0,max:128,step:4,unit:\"px\"},font:{type:ControlType.Font,title:\"Text Style\",controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"OriginFillButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Origin_Fill_Button.map"],"mappings":"qQAA6L,SAAS,EAAc,EAAM,EAAO,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,EAAE,KAAK,IAAI,KAAK,MAAM,EAAE,CAAC,EAAE,KAAK,MAAM,EAAM,EAAE,CAAC,EAAE,KAAK,MAAM,EAA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