{"version":3,"file":"CustomButton.C4LkMEj3.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/u9apBPSHq6TTq9ErrW3p/28LH076t6w1BdQnLQgC6/CustomButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{motion,useAnimation}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CustomButton(props){const{text,font,textColor,hoverTextColor,bgColor,fillColor,roundness,paddingX,paddingY,link,strokeColor,strokeWidth,strokePosition,style}=props;const[isHovered,setIsHovered]=useState(false);// Explicitly controls the animation states to prevent reverse tracking\nconst fillControls=useAnimation();const dynamicStroke=strokeWidth>0?`${strokePosition===\"inside\"?\"inset \":\"\"}0 0 0 ${strokeWidth}px ${strokeColor}`:\"none\";const buttonStyle={...style,...font,backgroundColor:bgColor,borderRadius:`${roundness}px`,padding:`${paddingY}px ${paddingX}px`,boxShadow:dynamicStroke,display:\"flex\",justifyContent:\"center\",alignItems:\"center\",textDecoration:\"none\",border:\"none\",cursor:\"pointer\",overflow:\"hidden\",position:\"relative\",width:\"fit-content\",height:\"fit-content\",whiteSpace:\"nowrap\"};const fillVariants={idle:{y:\"50%\",transition:{duration:0}},hover:{y:\"-50%\",transition:{type:\"tween\",ease:[.4,0,.2,1],duration:1.3}},leave:{y:\"-150%\",transition:{type:\"tween\",ease:[.4,0,.2,1],duration:1.3}}};const handlePointerEnter=()=>{setIsHovered(true);// Instantly snaps the circle completely below the button,\n// overriding any currently running 'leave' transitions.\nfillControls.set(\"idle\");fillControls.start(\"hover\");};const handlePointerLeave=()=>{setIsHovered(false);fillControls.start(\"leave\");};const ButtonNode=/*#__PURE__*/_jsxs(motion.div,{onPointerEnter:handlePointerEnter,onPointerLeave:handlePointerLeave,whileHover:{scale:.96},whileTap:{scale:.92},transition:{type:\"spring\",stiffness:400,damping:25},style:buttonStyle,children:[/*#__PURE__*/_jsx(motion.div,{variants:fillVariants,initial:\"idle\",animate:fillControls,style:{position:\"absolute\",top:\"50%\",left:\"50%\",width:\"150%\",aspectRatio:\"1 / 1\",borderRadius:\"50%\",backgroundColor:fillColor,pointerEvents:\"none\",zIndex:0,x:\"-50%\"}}),/*#__PURE__*/_jsx(motion.div,{animate:{color:isHovered?hoverTextColor:textColor},transition:{duration:.8,ease:[.4,0,.2,1]},style:{position:\"relative\",zIndex:1,pointerEvents:\"none\"},children:text})]});if(link){return /*#__PURE__*/_jsx(\"a\",{href:link,style:{textDecoration:\"none\",display:\"inline-block\",width:\"fit-content\",height:\"fit-content\"},children:ButtonNode});}return ButtonNode;}CustomButton.defaultProps={text:\"More work\",textColor:\"#111111\",hoverTextColor:\"#FFFFFF\",bgColor:\"#FFFFFF\",fillColor:\"#4F46E5\",strokeColor:\"#E5E5E5\",strokeWidth:1,strokePosition:\"inside\",roundness:30,paddingX:32,paddingY:16,font:{fontFamily:\"Inter\",fontSize:16,fontWeight:500,letterSpacing:-.02,lineHeight:1.2}};addPropertyControls(CustomButton,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"More work\"},link:{type:ControlType.Link,title:\"Link\"},font:{type:ControlType.Font,controls:\"extended\",title:\"Typography\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#111111\"},hoverTextColor:{type:ControlType.Color,title:\"Hover Text\",defaultValue:\"#FFFFFF\"},bgColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},fillColor:{type:ControlType.Color,title:\"Fill Color\",defaultValue:\"#4F46E5\"},strokeWidth:{type:ControlType.Number,title:\"Stroke Width\",min:0,max:20,defaultValue:1,displayStepper:true},strokeColor:{type:ControlType.Color,title:\"Stroke Color\",defaultValue:\"#E5E5E5\",hidden(props){return props.strokeWidth===0;}},strokePosition:{type:ControlType.Enum,title:\"Position\",options:[\"inside\",\"outside\"],optionTitles:[\"Inside\",\"Outside\"],defaultValue:\"inside\",displaySegmentedControl:true,hidden(props){return props.strokeWidth===0;}},roundness:{type:ControlType.Number,title:\"Roundness\",min:0,max:200,defaultValue:30,displayStepper:true},paddingX:{type:ControlType.Number,title:\"Padding X\",min:0,max:150,defaultValue:32,displayStepper:true},paddingY:{type:ControlType.Number,title:\"Padding Y\",min:0,max:150,defaultValue:16,displayStepper:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomButton.map"],"mappings":"yOAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,YAAU,iBAAe,UAAQ,YAAU,YAAU,WAAS,WAAS,OAAK,cAAY,cAAY,iBAAe,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EACrO,EAAa,EAAa,EAAQ,EAAc,EAAY,EAAE,GAAG,IAAiB,SAAS,SAAS,GAAG,QAAQ,EAAY,KAAK,IAAc,OAAa,EAAY,CAAC,GAAG,EAAM,GAAG,EAAK,gBAAgB,EAAQ,aAAa,GAAG,EAAU,IAAI,QAAQ,GAAG,EAAS,KAAK,EAAS,IAAI,UAAU,EAAc,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,eAAe,OAAO,OAAO,OAAO,OAAO,UAAU,SAAS,SAAS,SAAS,WAAW,MAAM,cAAc,OAAO,cAAc,WAAW,QAAQ,EAExX,EAAwB,EAAM,EAAO,IAAI,CAAC,mBAF4jB,CAAC,EAAa,EAAI,EAErwB,EAAa,IAAI,MAAM,EAAE,EAAa,MAAM,OAAO,CAAE,EAAoK,mBAArI,CAAC,EAAa,EAAK,EAAE,EAAa,MAAM,OAAO,CAAE,EAAsH,WAAW,CAAC,MAAM,GAAG,EAAE,SAAS,CA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