{"version":3,"file":"SwipeLettersButton.CDi6DQaG.mjs","names":["React.useState","React.useMemo"],"sources":["https:/framerusercontent.com/modules/IAWkuOzoDXyUAaJyil17/sl0YTK3ib8M6HP16TYAa/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\",defaultState={bgColor:\"#1D1D1D\",borderColor:\"#414141\",textColor:\"#FFFFFF\"},hoverState={bgColor:\"#2D2D2D\",borderColor:\"#515151\",textColor:\"#FFFFFF\"},radius=9999,paddingX=24,paddingY=16,font={fontSize:\"18px\",variant:\"Semibold\",letterSpacing:\"0.4px\",textAlign:\"center\"},align=\"center\",showBorder=true,direction=\"alternate\",duration=380,easing=\"cubic-bezier(.25,.75,.25,1)\",stagger=18,link=\"\"}=props;const[hovered,setHovered]=React.useState(false);const chars=React.useMemo(()=>Array.from(label||\"\").map(c=>c===\" \"?\"\\xa0\":c),[label]);const handleClick=()=>{if(link&&typeof window!==\"undefined\"){if(link.startsWith(\"http\")||link.startsWith(\"//\")){window.open(link,\"_blank\",\"noopener,noreferrer\");}else{window.location.href=link;}}};const currentBgColor=hovered?hoverState.bgColor:defaultState.bgColor;const currentBorderColor=hovered?hoverState.borderColor:defaultState.borderColor;const currentTextColor=hovered?hoverState.textColor:defaultState.textColor;return /*#__PURE__*/_jsx(\"div\",{onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),onClick:handleClick,style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:align===\"center\"?\"center\":align===\"start\"?\"flex-start\":\"flex-end\",backgroundColor:currentBgColor,borderRadius:radius,border:showBorder?`1px solid ${currentBorderColor}`:\"none\",overflow:\"hidden\",position:\"relative\",userSelect:\"none\",cursor:\"pointer\",transition:\"background-color 0.2s ease, border-color 0.2s ease\"},children:/*#__PURE__*/_jsx(\"div\",{style:{padding:`${paddingY}px ${paddingX}px`,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:align===\"center\"?\"center\":align===\"start\"?\"flex-start\":\"flex-end\",gap:`${parseFloat(font.letterSpacing)||.4}px`},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:\"1.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:\"1.1em\",transform:`translateY(${hovered?hoverY:initY})`,transitionProperty:\"transform\",transitionDuration:`${duration}ms`,transitionTimingFunction:easing,transitionDelay:delay,willChange:\"transform\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:currentTextColor,transition:\"color 0.2s ease\"},children:ch}),/*#__PURE__*/_jsx(\"span\",{style:{color:currentTextColor,transition:\"color 0.2s ease\"},children:ch})]})},`${ch}-${i}`);})})});}addPropertyControls(SwipeLettersButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"GET IN TOUCH\"},link:{type:ControlType.Link,title:\"Link\",defaultValue:\"\"},defaultState:{type:ControlType.Object,title:\"Default\",controls:{bgColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#1D1D1D\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#414141\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"}},defaultValue:{bgColor:\"#1D1D1D\",borderColor:\"#414141\",textColor:\"#FFFFFF\"}},hoverState:{type:ControlType.Object,title:\"Hover\",controls:{bgColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#2D2D2D\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#515151\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"}},defaultValue:{bgColor:\"#2D2D2D\",borderColor:\"#515151\",textColor:\"#FFFFFF\"}},showBorder:{type:ControlType.Boolean,title:\"Show Border\",defaultValue:true},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:2e3,step:1,defaultValue:9999},paddingX:{type:ControlType.Number,title:\"Pad X\",min:0,max:96,step:1,defaultValue:24},paddingY:{type:ControlType.Number,title:\"Pad Y\",min:0,max:96,step:1,defaultValue:16},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},align:{type:ControlType.Enum,title:\"Align\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Start\",\"Center\",\"End\"],displaySegmentedControl:true,defaultValue:\"center\"},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}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SwipeLettersButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"240\",\"framerIntrinsicHeight\":\"64\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SwipeLettersButton.map"],"mappings":"sMAOG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,QAAM,eAAe,eAAa,CAAC,QAAQ,UAAU,YAAY,UAAU,UAAU,SAAS,EAAE,aAAW,CAAC,QAAQ,UAAU,YAAY,UAAU,UAAU,SAAS,EAAE,SAAO,KAAK,WAAS,GAAG,WAAS,GAAG,OAAK,CAAC,SAAS,OAAO,QAAQ,WAAW,cAAc,QAAQ,UAAU,QAAQ,EAAE,QAAM,SAAS,aAAW,GAAK,YAAU,YAAY,WAAS,IAAI,SAAO,8BAA8B,UAAQ,GAAG,OAAK,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,EAAQ,MAAgB,CAAI,GAAa,IAAS,SAAgB,EAAK,WAAW,MAAM,GAAG,EAAK,WAAW,IAAI,EAAG,EAAO,KAAK,EAAK,SAAS,qBAAqB,EAAQ,EAAO,SAAS,KAAK,EAAO,EAAQ,EAAe,EAAQ,EAAW,QAAQ,EAAa,QAAc,EAAmB,EAAQ,EAAW,YAAY,EAAa,YAAkB,EAAiB,EAAQ,EAAW,UAAU,EAAa,UAAU,OAAoB,EAAK,MAAM,CAAC,iBAAiB,EAAW,EAAI,EAAE,iBAAiB,EAAW,EAAK,EAAE,QAAQ,EAAY,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,WAAW,SAAS,eAAe,IAAQ,SAAS,SAAS,IAA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