{"version":3,"file":"StaggeredButton.B6iGLZ1P.mjs","names":["useState","useMemo","startTransition"],"sources":["https:/framerusercontent.com/modules/SsaHxDKhCpIfKA4YnDc9/U20H6BKwwJRYMX7ybmvF/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\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{startTransition,useMemo,useState}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function StaggeredButton(props){const{text,font,backgroundColor,textColor,revealedTextColor,padding,borderRadius,borderWidth,borderColor,animationDuration,staggerDelay,easing,direction,effectEnabled,link,style}=props;const[isHovered,setIsHovered]=useState(false);const letters=useMemo(()=>text.split(\"\"),[text]);// Compute stagger indices so spaces don't introduce a timing \"gap\" between words\nconst staggerIndices=useMemo(()=>{let count=0;return letters.map(ch=>{const index=count;if(ch!==\" \")count+=1;return index;});},[letters]);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\"}};// Static button for tablet/mobile (no animation)\nif(!effectEnabled){const staticButtonContent=/*#__PURE__*/_jsx(\"button\",{style:{position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",padding,borderRadius,border:`${borderWidth}px solid ${borderColor}`,cursor:\"pointer\",backgroundColor,...font,color:textColor},children:text});const wrappedStatic=link?/*#__PURE__*/_jsx(\"a\",{href:link,style:{textDecoration:\"none\",display:\"inline-block\"},target:\"_blank\",rel:\"noopener noreferrer\",children:staticButtonContent}):staticButtonContent;return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:wrappedStatic});}// Animated button for desktop\nconst buttonContent=/*#__PURE__*/_jsx(motion.button,{style:{position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",padding,borderRadius,border:`${borderWidth}px solid ${borderColor}`,cursor:\"pointer\",overflow:\"hidden\",backgroundColor},onMouseEnter:()=>startTransition(()=>setIsHovered(true)),onMouseLeave:()=>startTransition(()=>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\",paddingBottom:2},children:[/*#__PURE__*/_jsx(\"span\",{style:{visibility:\"hidden\",display:\"inline-block\",whiteSpace:letter===\" \"?\"pre\":\"normal\",color:textColor,...font},\"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,...font},initial:{y:\"0%\"},animate:{y:isHovered?direction===\"up\"?\"-120%\":\"120%\":\"0%\"},transition:{duration:animationDuration,ease:easing===\"easeInOut\"?[.25,.1,.25,1]:easing,delay:staggerIndices[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:revealedTextColor,...font},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:staggerIndices[index]*staggerDelay},children:letter===\" \"?\"\\xa0\":letter})]},index))})});const wrappedAnimated=link?/*#__PURE__*/_jsx(\"a\",{href:link,style:{textDecoration:\"none\",display:\"inline-block\"},target:\"_blank\",rel:\"noopener noreferrer\",children:buttonContent}):buttonContent;return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:wrappedAnimated});}addPropertyControls(StaggeredButton,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Contact\"},effectEnabled:{type:ControlType.Boolean,title:\"Stagger Effect\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},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\"},revealedTextColor:{type:ControlType.Color,title:\"Revealed Text\",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\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"12px 24px\"},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:({effectEnabled})=>!effectEnabled},staggerDelay:{type:ControlType.Number,title:\"Stagger Delay\",defaultValue:.03,min:0,max:.2,step:.01,unit:\"s\",hidden:({effectEnabled})=>!effectEnabled},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:({effectEnabled})=>!effectEnabled},direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"up\",options:[\"up\",\"down\"],optionTitles:[\"Up\",\"Down\"],displaySegmentedControl:true,hidden:({effectEnabled})=>!effectEnabled}});\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":"gPAMG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,kBAAgB,YAAU,oBAAkB,UAAQ,eAAa,cAAY,cAAY,oBAAkB,eAAa,SAAO,YAAU,gBAAc,OAAK,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAQ,EAAQC,MAAY,EAAK,MAAM,EAAE,EAAE,CAAC,CAAI,CAAC,EAClU,EAAeA,MAAY,CAAC,IAAI,EAAM,EAAE,OAAO,EAAQ,IAAI,GAAI,CAAC,IAAM,EAAM,EAA2B,OAAlB,IAAK,MAAI,GAAO,GAAS,CAAM,CAAC,CAAE,EAAE,CAAC,CAAO,CAAC,EAAQ,EAAY,GAAO,EAAM,QAAQ,OAAa,EAAa,GAAO,EAAM,SAAS,OAAa,EAAe,CAAC,GAAG,EAAM,SAAS,WAAW,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,SAAS,UAAU,GAAG,EAAY,CAAC,EAAE,CAAC,MAAM,aAAa,EAAE,GAAG,EAAa,CAAC,EAAE,CAAC,OAAO,aAAa,CAAC,EAC1b,GAAG,CAAC,EAAc,CAAC,IAAM,EAAiC,EAAK,SAAS,CAAC,MAAM,CAAC,SAAS,WAAW,QAAQ,cAAc,WAAW,SAAS,eAAe,SAAS,UAAQ,eAAa,OAAO,GAAG,EAAY,WAAW,IAAc,OAAO,UAAU,kBAAgB,GAAG,EAAK,MAAM,CAAS,EAAE,SAA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