{"version":3,"file":"SwipeLettersButton.CdOGg3MC.mjs","names":["React.useState","React.useMemo"],"sources":["https:/framerusercontent.com/modules/zYLjVukx1zX7xT7b5uuf/5Yg94U8Vicx6gCRO1l2w/SwipeLettersButton.js"],"sourcesContent":["// Swipe Letters Button - A button with animated letter transitions on hover\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerIntrinsicWidth 240\n * @framerIntrinsicHeight 64\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function SwipeLettersButton(props){const{label=\"GET IN TOUCH\",textColor=\"#FFFFFF\",font={fontSize:\"18px\",variant:\"Semibold\",letterSpacing:\"0.4px\",textAlign:\"center\"},direction=\"alternate\",duration=380,easing=\"cubic-bezier(.25,.75,.25,1)\",stagger=18,textTransform=\"none\",paddingTop=12,paddingRight=28,paddingBottom=12,paddingLeft=28}=props;const[hovered,setHovered]=React.useState(false);const chars=React.useMemo(()=>Array.from(label||\"\").map(c=>c===\" \"?\"\\xa0\":c),[label]);return /*#__PURE__*/_jsx(\"div\",{onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\",position:\"relative\",userSelect:\"none\",cursor:\"pointer\"},children:/*#__PURE__*/_jsx(\"div\",{style:{padding:`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:`${parseFloat(font.letterSpacing)||.4}px`,textTransform},children:chars.map((ch,i)=>{const dir=direction===\"alternate\"?i%2===0?\"top\":\"bottom\":direction;const initY=dir===\"top\"?\"-50%\":\"0%\";const hoverY=dir===\"top\"?\"0%\":\"-50%\";const delay=`${i*stagger}ms`;return /*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",display:\"inline-block\",height:\"1em\",overflow:\"hidden\",fontFamily:font.fontFamily||\"inherit\",fontSize:font.fontSize,fontWeight:font.fontWeight,fontStyle:font.fontStyle,lineHeight:1},children:/*#__PURE__*/_jsxs(\"span\",{style:{display:\"grid\",gridAutoRows:\"1em\",transform:`translateY(${hovered?hoverY:initY})`,transitionProperty:\"transform\",transitionDuration:`${duration}ms`,transitionTimingFunction:easing,transitionDelay:delay,willChange:\"transform\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:textColor},children:ch}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor},children:ch})]})},`${ch}-${i}`);})})});}addPropertyControls(SwipeLettersButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"GET IN TOUCH\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Typography\",defaultValue:{fontSize:\"18px\",variant:\"Semibold\",letterSpacing:\"0.4px\",textAlign:\"center\"},controls:\"extended\",defaultFontType:\"sans-serif\",displayTextAlignment:true,displayFontSize:true},direction:{type:ControlType.Enum,title:\"Swipe From\",options:[\"top\",\"bottom\",\"alternate\"],optionTitles:[\"Top\",\"Bottom\",\"Alternate\"],defaultValue:\"alternate\"},duration:{type:ControlType.Number,title:\"Duration (ms)\",min:80,max:2e3,step:10,defaultValue:380},easing:{type:ControlType.Enum,title:\"Easing\",options:[\"ease\",\"ease-in\",\"ease-out\",\"ease-in-out\",\"cubic-bezier(.25,.75,.25,1)\"],optionTitles:[\"ease\",\"ease-in\",\"ease-out\",\"ease-in-out\",\"Snap\"],defaultValue:\"cubic-bezier(.25,.75,.25,1)\"},stagger:{type:ControlType.Number,title:\"Stagger (ms)\",min:0,max:300,step:2,defaultValue:18},textTransform:{type:ControlType.Enum,title:\"Transform\",options:[\"none\",\"capitalize\",\"uppercase\",\"lowercase\"],optionTitles:[\"None\",\"Capitalize\",\"Uppercase\",\"Lowercase\"],defaultValue:\"none\"},paddingTop:{type:ControlType.Number,title:\"Padding Top\",defaultValue:12,min:0,max:120,step:1},paddingRight:{type:ControlType.Number,title:\"Padding Right\",defaultValue:28,min:0,max:120,step:1},paddingBottom:{type:ControlType.Number,title:\"Padding Bottom\",defaultValue:12,min:0,max:120,step:1},paddingLeft:{type:ControlType.Number,title:\"Padding Left\",defaultValue:28,min:0,max:120,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SwipeLettersButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"240\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"64\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SwipeLettersButton.map"],"mappings":"mLAOG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,QAAM,eAAe,YAAU,UAAU,OAAK,CAAC,SAAS,OAAO,QAAQ,WAAW,cAAc,QAAQ,UAAU,QAAQ,EAAE,YAAU,YAAY,WAAS,IAAI,SAAO,8BAA8B,UAAQ,GAAG,gBAAc,OAAO,aAAW,GAAG,eAAa,GAAG,gBAAc,GAAG,cAAY,IAAI,EAAW,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAQ,EAAMC,MAAkB,MAAM,KAAK,GAAO,EAAE,CAAC,CAAC,IAAI,GAAG,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,CAAK,CAAC,EAAE,OAAoB,EAAK,MAAM,CAAC,iBAAiB,EAAW,EAAI,EAAE,iBAAiB,EAAW,EAAK,EAAE,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,SAAS,SAAS,SAAS,WAAW,WAAW,OAAO,OAAO,SAAS,EAAE,SAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,EAAW,KAAK,EAAa,KAA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