{"version":3,"file":"StaggeredButton.DdBYA-At.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/zgcM67gZ8wL4y92HhAjB/c2efZTNbl57QprDSBrlZ/StaggeredButton.js"],"sourcesContent":["// Button component with staggered letter animation on hover\n// Each letter slides up and is replaced by a duplicate sliding in from below\n// Staggered timing creates a wave effect across the text\n//@ts-ignore\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";//@ts-ignore\nimport{addPropertyControls,ControlType,useRouter}from\"framer\";import{useState}from\"react\";function parseRoute(routes,targetPath){for(const[routeId,routeInfo]of Object.entries(routes)){const pattern=routeInfo.path;if(!pattern)continue;const paramNames=[];const regexPattern=pattern.replace(/:(\\w+)/g,(_,paramName)=>{paramNames.push(paramName);return\"([^/]+)\";});const regex=new RegExp(`^${regexPattern}$`);const match=targetPath.match(regex);if(match){const params=paramNames.reduce((acc,name,index)=>({...acc,[name]:match[index+1]}),{});return{routeId,params};}}return null;}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function StaggeredButton(props){const{text,font,backgroundColor,textColor,paddingX,paddingY,borderRadius,borderWidth,borderColor,animationDuration,staggerDelay,easing,direction,variant,link,style}=props;const[isHovered,setIsHovered]=useState(false);const letters=text.split(\"\");let router=null;try{router=useRouter();}catch(e){router=null;}const isFillWidth=style&&style.width===\"100%\";const isFillHeight=style&&style.height===\"100%\";const containerStyle={...style,position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"visible\",...isFillWidth?{}:{width:\"max-content\"},...isFillHeight?{}:{height:\"max-content\"}};const handleClick=()=>{if(!link||!router)return;// External URLs, mailto, tel: navigate normally via the browser\nif(link.startsWith(\"http\")||link.startsWith(\"mailto:\")||link.startsWith(\"tel:\")){window.open(link,link.startsWith(\"http\")?\"_blank\":\"_self\");return;}const result=parseRoute(router.routes,link);if(result){router.navigate(result.routeId,\"\",result.params);}else{console.warn(`Navigation failed: No matching route for ${link}`);}};// Static button for tablet/mobile (no animation)\nif(variant===\"tablet\"||variant===\"mobile\"){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(\"div\",{role:\"button\",tabIndex:0,onClick:handleClick,style:{position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",paddingLeft:paddingX,paddingRight:paddingX,paddingTop:paddingY,paddingBottom:paddingY,borderRadius,border:`${borderWidth}px solid ${borderColor}`,cursor:\"pointer\",backgroundColor,width:isFillWidth?\"100%\":undefined,height:isFillHeight?\"100%\":undefined,...font,color:textColor},children:text})});}// Animated button for desktop\nreturn /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(motion.div,{role:\"button\",tabIndex:0,onClick:handleClick,style:{position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",paddingLeft:paddingX,paddingRight:paddingX,paddingTop:paddingY,paddingBottom:paddingY,borderRadius,border:`${borderWidth}px solid ${borderColor}`,cursor:\"pointer\",overflow:\"visible\",backgroundColor,width:isFillWidth?\"100%\":undefined,height:isFillHeight?\"100%\":undefined},onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",...font},children:letters.map((letter,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"inline-block\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{visibility:\"hidden\",display:\"inline-block\",whiteSpace:letter===\" \"?\"pre\":\"normal\",color:textColor},\"aria-hidden\":\"true\",children:letter===\" \"?\"\\xa0\":letter}),/*#__PURE__*/_jsx(motion.span,{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:textColor,position:\"absolute\",top:0,left:0,right:0,bottom:0},initial:{y:\"0%\"},animate:{y:isHovered?direction===\"up\"?\"-120%\":\"120%\":\"0%\"},transition:{duration:animationDuration,ease:easing===\"easeInOut\"?[.25,.1,.25,1]:easing,delay:index*staggerDelay},children:letter===\" \"?\"\\xa0\":letter}),/*#__PURE__*/_jsx(motion.span,{style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:textColor},initial:{y:direction===\"up\"?\"120%\":\"-120%\"},animate:{y:isHovered?\"0%\":direction===\"up\"?\"120%\":\"-120%\"},transition:{duration:animationDuration,ease:easing===\"easeInOut\"?[.25,.1,.25,1]:easing,delay:index*staggerDelay},children:letter===\" \"?\"\\xa0\":letter})]},index))})})});}addPropertyControls(StaggeredButton,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Contact\"},variant:{type:ControlType.Enum,title:\"Variant\",defaultValue:\"desktop\",options:[\"desktop\",\"tablet\",\"mobile\"],optionTitles:[\"Desktop\",\"Tablet\",\"Mobile\"],displaySegmentedControl:true},link:{type:ControlType.Link,title:\"Link\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"0em\",lineHeight:\"1em\"}},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:0,min:0,max:10,step:1,unit:\"px\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#000000\"},paddingX:{type:ControlType.Number,title:\"Padding X\",defaultValue:24,min:0,max:100,step:1,unit:\"px\"},paddingY:{type:ControlType.Number,title:\"Padding Y\",defaultValue:12,min:0,max:100,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},animationDuration:{type:ControlType.Number,title:\"Duration\",defaultValue:.3,min:.1,max:2,step:.1,unit:\"s\",hidden:({variant})=>variant===\"tablet\"||variant===\"mobile\"},staggerDelay:{type:ControlType.Number,title:\"Stagger Delay\",defaultValue:.03,min:0,max:.2,step:.01,unit:\"s\",hidden:({variant})=>variant===\"tablet\"||variant===\"mobile\"},easing:{type:ControlType.Enum,title:\"Easing\",defaultValue:\"easeInOut\",options:[\"linear\",\"easeIn\",\"easeOut\",\"easeInOut\",\"circIn\",\"circOut\",\"circInOut\",\"backIn\",\"backOut\",\"backInOut\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\",\"Circ In\",\"Circ Out\",\"Circ In Out\",\"Back In\",\"Back Out\",\"Back In Out\"],hidden:({variant})=>variant===\"tablet\"||variant===\"mobile\"},direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"up\",options:[\"up\",\"down\"],optionTitles:[\"Up\",\"Down\"],displaySegmentedControl:true,hidden:({variant})=>variant===\"tablet\"||variant===\"mobile\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StaggeredButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StaggeredButton.map"],"mappings":"yPAK0F,SAAS,EAAW,EAAO,EAAW,CAAC,IAAI,GAAK,CAAC,EAAQ,KAAa,OAAO,QAAQ,CAAM,EAAE,CAAC,IAAM,EAAQ,EAAU,KAAK,GAAG,CAAC,EAAQ,SAAS,IAAM,EAAW,CAAC,EAAQ,EAAa,EAAQ,QAAQ,WAAW,EAAE,KAAa,EAAW,KAAK,CAAS,EAAQ,UAAW,EAAQ,EAAU,OAAO,IAAI,EAAa,EAAE,EAAQ,EAAM,EAAW,MAAM,CAAK,EAAE,GAAG,EAA6F,MAAM,CAAC,UAAQ,OAAxF,EAAW,QAAQ,EAAI,EAAK,KAAS,CAAC,GAAG,GAAK,GAAM,EAAM,EAAM,EAAE,GAAG,CAAC,CAAuB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