{"version":3,"file":"HoverColorTextButton.BcZ9QnDe.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/jkPefJWvkul40ghtbRCx/PQljTcAolOYKBEl2vrd4/HoverColorTextButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useState}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function HoverColorTextButton(props){const{text,textCase,startColor,font,showUnderline,underlineColor,underlineThickness,animationDuration,showIcon,iconType,icon,svgIcon,iconPosition,iconSize,iconSpacing,style}=props;const[isHovered,setIsHovered]=useState(false);const isFixedWidth=style?.width===\"100%\";const renderIcon=color=>{if(iconType===\"emoji\"){return /*#__PURE__*/_jsx(\"span\",{style:{fontSize:`${iconSize}px`,lineHeight:1},children:icon});}else{return /*#__PURE__*/_jsx(\"div\",{style:{width:`${iconSize}px`,height:`${iconSize}px`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},dangerouslySetInnerHTML:{__html:svgIcon.replace(/fill=\"[^\"]*\"/g,`fill=\"${color}\"`).replace(/stroke=\"[^\"]*\"/g,`stroke=\"${color}\"`)}});}};const renderContent=color=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",flexDirection:iconPosition===\"right\"?\"row\":\"row\",gap:showIcon?`${iconSpacing}px`:0},children:[showIcon&&iconPosition===\"left\"&&renderIcon(color),/*#__PURE__*/_jsx(\"span\",{style:{textTransform:textCase},children:text}),showIcon&&iconPosition===\"right\"&&renderIcon(color)]});return /*#__PURE__*/_jsxs(motion.div,{style:{position:\"relative\",display:\"inline-block\",cursor:\"pointer\",...isFixedWidth?style:{minWidth:\"max-content\"}},onHoverStart:()=>setIsHovered(true),onHoverEnd:()=>setIsHovered(false),children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",color:startColor,...font},children:renderContent(startColor)}),showUnderline&&/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",bottom:0,left:0,right:0,height:`${underlineThickness}px`,backgroundColor:underlineColor,transformOrigin:\"left\"},initial:false,animate:{scaleX:isHovered?1:0,transformOrigin:isHovered?\"left\":\"right\"},transition:{duration:animationDuration,ease:\"easeInOut\"}})]});}addPropertyControls(HoverColorTextButton,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Hover Button\"},textCase:{type:ControlType.Enum,title:\"Text Case\",options:[\"none\",\"uppercase\",\"lowercase\",\"capitalize\"],optionTitles:[\"None\",\"UPPERCASE\",\"lowercase\",\"Capitalize\"],defaultValue:\"none\"},startColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:16,lineHeight:1.5,letterSpacing:0,textAlign:\"left\",variant:\"Regular\"}},showUnderline:{type:ControlType.Boolean,title:\"Show Underline\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},underlineColor:{type:ControlType.Color,title:\"Underline Color\",defaultValue:\"#FF0000\",hidden:({showUnderline})=>!showUnderline},underlineThickness:{type:ControlType.Number,title:\"Underline Thickness\",defaultValue:1,min:.1,max:10,step:.1,unit:\"px\",hidden:({showUnderline})=>!showUnderline},animationDuration:{type:ControlType.Number,title:\"Animation Duration\",defaultValue:.3,min:.1,max:2,step:.1,unit:\"s\"},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},iconType:{type:ControlType.Enum,title:\"Icon Type\",options:[\"emoji\",\"svg\"],optionTitles:[\"Emoji\",\"SVG\"],defaultValue:\"emoji\",displaySegmentedControl:true,hidden:({showIcon})=>!showIcon},icon:{type:ControlType.String,title:\"Emoji Icon\",defaultValue:\"→\",placeholder:\"Enter emoji or symbol\",hidden:({showIcon,iconType})=>!showIcon||iconType!==\"emoji\"},svgIcon:{type:ControlType.String,title:\"SVG Code\",defaultValue:'<svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z\"/></svg>',placeholder:\"Paste SVG code here\",displayTextArea:true,hidden:({showIcon,iconType})=>!showIcon||iconType!==\"svg\"},iconPosition:{type:ControlType.Enum,title:\"Icon Position\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"right\",displaySegmentedControl:true,hidden:({showIcon})=>!showIcon},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:16,min:8,max:48,step:1,unit:\"px\",hidden:({showIcon})=>!showIcon},iconSpacing:{type:ControlType.Number,title:\"Icon Spacing\",defaultValue:8,min:0,max:20,step:1,unit:\"px\",hidden:({showIcon})=>!showIcon}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HoverColorTextButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HoverColorTextButton.map"],"mappings":"kOAGG,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,OAAK,WAAS,aAAW,OAAK,gBAAc,iBAAe,qBAAmB,oBAAkB,WAAS,WAAS,OAAK,UAAQ,eAAa,WAAS,cAAY,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAQ,EAAa,GAAO,QAAQ,OAAa,EAAW,GAAW,IAAW,QAA6B,EAAK,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,EAAS,IAAI,WAAW,CAAC,EAAE,SAAS,CAAI,CAAC,EAA4B,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,EAAS,IAAI,OAAO,GAAG,EAAS,IAAI,QAAQ,OAAO,WAAW,SAAS,eAAe,QAAQ,EAAE,wBAAwB,CAAC,OAAO,EAAQ,QAAQ,g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