{"version":3,"file":"StaggerTextButton.DoiFfR0k.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/KlH9DgST4J3sE4hjRtu0/BijBWF0PuvWpyjcHSqph/StaggerTextButton.js"],"sourcesContent":["// Button with staggered text animation on hover - text appears from bottom while original text disappears to top\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{motion,AnimatePresence}from\"framer-motion\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function StaggerTextButton(props){const{text,hoverText,backgroundColor,textColor,hoverBackgroundColor,borderRadius,paddingX,paddingY,font,animationSpeed,staggerDelay,showIcon,iconName,iconSize,iconPosition,iconGap,outlined,borderWidth,style}=props;const[isHovered,setIsHovered]=useState(false);const containerVariants={initial:{},hover:{}};const textVariants={initial:{y:0,opacity:1},exit:{y:-20,opacity:0,transition:{duration:.3/animationSpeed,ease:\"easeInOut\"}}};const hoverTextVariants={initial:{y:20,opacity:0},animate:{y:0,opacity:1,transition:{duration:.3/animationSpeed,ease:\"easeInOut\"}}};const letterVariants={initial:{y:0,opacity:1},animate:i=>({y:0,opacity:1,transition:{delay:i*(staggerDelay/animationSpeed),duration:.3/animationSpeed,ease:\"easeOut\"}}),exit:i=>({y:-20,opacity:0,transition:{delay:i*(staggerDelay/animationSpeed),duration:.3/animationSpeed,ease:\"easeIn\"}})};const hoverLetterVariants={initial:{y:20,opacity:0},animate:i=>({y:0,opacity:1,transition:{delay:i*(staggerDelay/animationSpeed),duration:.3/animationSpeed,ease:\"easeOut\"}})};return /*#__PURE__*/_jsx(motion.button,{style:{...style,position:\"relative\",overflow:\"hidden\",border:outlined?`${borderWidth}px solid ${backgroundColor}`:\"none\",cursor:\"pointer\",paddingLeft:paddingX,paddingRight:paddingX,paddingTop:paddingY,paddingBottom:paddingY,borderRadius,backgroundColor:outlined?\"transparent\":backgroundColor,...font,width:\"max-content\"},variants:containerVariants,initial:\"initial\",animate:isHovered?\"hover\":\"initial\",onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),whileHover:{borderColor:outlined?hoverBackgroundColor:undefined,scale:1.05},transition:{backgroundColor:{duration:.3/animationSpeed}},children:/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",flexDirection:iconPosition===\"left\"?\"row\":\"row-reverse\",gap:showIcon?iconGap:0},children:[showIcon&&/*#__PURE__*/_jsx(motion.div,{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsxs(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:outlined?backgroundColor:textColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[iconName===\"arrow-right\"&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"line\",{x1:\"5\",y1:\"12\",x2:\"19\",y2:\"12\"}),/*#__PURE__*/_jsx(\"polyline\",{points:\"12 5 19 12 12 19\"})]}),iconName===\"chevron-right\"&&/*#__PURE__*/_jsx(\"polyline\",{points:\"9 18 15 12 9 6\"}),iconName===\"heart\"&&/*#__PURE__*/_jsx(\"path\",{d:\"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z\"}),iconName===\"star\"&&/*#__PURE__*/_jsx(\"polygon\",{points:\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\"}),iconName===\"check\"&&/*#__PURE__*/_jsx(\"polyline\",{points:\"20 6 9 17 4 12\"}),iconName===\"plus\"&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"line\",{x1:\"12\",y1:\"5\",x2:\"12\",y2:\"19\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"5\",y1:\"12\",x2:\"19\",y2:\"12\"})]}),iconName===\"download\"&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"path\",{d:\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"}),/*#__PURE__*/_jsx(\"polyline\",{points:\"7 10 12 15 17 10\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"12\",y1:\"15\",x2:\"12\",y2:\"3\"})]}),iconName===\"external-link\"&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"path\",{d:\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"}),/*#__PURE__*/_jsx(\"polyline\",{points:\"15 3 21 3 21 9\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"10\",y1:\"14\",x2:\"21\",y2:\"3\"})]})]})}),/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:!isHovered?/*#__PURE__*/_jsx(motion.div,{style:{display:\"flex\",color:outlined?backgroundColor:textColor},children:text.split(\"\").map((char,i)=>/*#__PURE__*/_jsx(motion.span,{custom:i,variants:letterVariants,initial:\"initial\",animate:\"initial\",exit:\"exit\",style:{display:\"inline-block\"},children:char===\" \"?\"\\xa0\":char},`original-${i}`))},\"original\"):/*#__PURE__*/_jsx(motion.div,{style:{display:\"flex\",color:outlined?backgroundColor:textColor},children:hoverText.split(\"\").map((char,i)=>/*#__PURE__*/_jsx(motion.span,{custom:i,variants:hoverLetterVariants,initial:\"initial\",animate:\"animate\",style:{display:\"inline-block\"},children:char===\" \"?\"\\xa0\":char},`hover-${i}`))},\"hover\")})]})});}addPropertyControls(StaggerTextButton,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Hover Me\"},hoverText:{type:ControlType.String,title:\"Hover Text\",defaultValue:\"Hover Me\"},outlined:{type:ControlType.Boolean,title:\"Outlined\",defaultValue:false,enabledTitle:\"Outlined\",disabledTitle:\"Filled\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:2,min:1,max:5,step:1,unit:\"px\",hidden:({outlined})=>!outlined},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover Background\",defaultValue:\"#0099FF\"},animationSpeed:{type:ControlType.Number,title:\"Animation Speed\",defaultValue:1,min:.1,max:3,step:.1,displayStepper:true},staggerDelay:{type:ControlType.Number,title:\"Stagger Delay\",defaultValue:.03,min:0,max:.2,step:.01,displayStepper:true},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},iconName:{type:ControlType.Enum,title:\"Icon\",options:[\"arrow-right\",\"chevron-right\",\"heart\",\"star\",\"check\",\"plus\",\"download\",\"external-link\"],optionTitles:[\"Arrow Right\",\"Chevron Right\",\"Heart\",\"Star\",\"Check\",\"Plus\",\"Download\",\"External Link\"],defaultValue:\"arrow-right\",hidden:({showIcon})=>!showIcon},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:18,min:12,max:32,step:1,unit:\"px\",hidden:({showIcon})=>!showIcon},iconPosition:{type:ControlType.Enum,title:\"Icon Position\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"right\",displaySegmentedControl:true,hidden:({showIcon})=>!showIcon},iconGap:{type:ControlType.Number,title:\"Icon Gap\",defaultValue:8,min:0,max:24,step:1,unit:\"px\",hidden:({showIcon})=>!showIcon},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},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\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StaggerTextButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StaggerTextButton.map"],"mappings":"gPAIG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,OAAK,YAAU,kBAAgB,YAAU,uBAAqB,eAAa,WAAS,WAAS,OAAK,iBAAe,eAAa,WAAS,WAAS,WAAS,eAAa,UAAQ,WAAS,cAAY,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAkB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,CAAwF,GAAG,EAAiI,GAAG,EAAmC,IAAM,EAAe,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,GAAG,EAAa,GAAgB,SAAS,GAAG,EAAe,KAAK,UAAU,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,IAAI,QAAQ,EAAE,WAAW,CAAC,MAAM,GAAG,EAAa,GAAgB,SAAS,GAAG,EAAe,KAAK,SAAS,CAAC,EAAE,CAAO,EAAoB,CAAC,QAAQ,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,QAAQ,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,GAAG,EAAa,GAAgB,SAAS,GAAG,EAAe,KAAK,UAAU,CAAC,EAAE,CAAC,OAAoB,EAAK,EAAO,OAAO,CAAC,MAAM,CAAC,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