{"version":3,"file":"HoverColorTextButton.ShxbNtLu.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/eoZL71mIT3qpTo7JhZbs/tyg0ExCJhYesoXzAe7HM/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,GAAM,CAAO,EAAa,GAAO,QAAQ,OAAa,EAAW,GAAW,IAAW,QAA6B,EAAK,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,EAAS,IAAI,WAAW,EAAE,CAAC,SAAS,EAAK,CAAC,CAA2B,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,EAAS,IAAI,OAAO,GAAG,EAAS,IAAI,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,CAAC,wBAAwB,CAAC,OAAO,EAAQ,QAAQ,g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