{"version":3,"file":"EditableButton.NKM0YttX.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/EkWF0gJFSVNxt47f63IU/kXMj9v9KGpykPF59WWRQ/EditableButton.js"],"sourcesContent":["// Editable button with customizable typography, color, and left-side image\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function EditableButton(props){const{text,font,textColor,backgroundColor,borderColor,borderRadius,padding,image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Button icon\"},imageSize,gap,onClick,link,style}=props;const isFixedWidth=style?.width===\"100%\";const isFixedHeight=style?.height===\"100%\";// Responsive calculations\nconst responsiveStyles=useMemo(()=>{const baseImageSize=imageSize;const basePadding=padding;const baseGap=gap;return{// Scale down on smaller screens\nimageSize:`clamp(${Math.max(12,baseImageSize*.7)}px, ${baseImageSize}px, ${baseImageSize}px)`,padding:`clamp(${Math.max(4,basePadding*.7)}px, ${basePadding}px, ${basePadding}px)`,gap:`clamp(${Math.max(4,baseGap*.7)}px, ${baseGap}px, ${baseGap}px)`};},[imageSize,padding,gap]);const handleClick=()=>{if(link){if(typeof window!==\"undefined\"){window.open(link,\"_blank\",\"noopener,noreferrer\");}}if(onClick){onClick();}};return /*#__PURE__*/_jsxs(\"button\",{style:{...style,...isFixedWidth?{width:\"100%\"}:{width:\"max-content\",minWidth:\"max-content\"},...isFixedHeight?{height:\"100%\"}:{height:\"auto\"},maxWidth:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:isFixedWidth?\"center\":\"flex-start\",gap:responsiveStyles.gap,padding:responsiveStyles.padding,backgroundColor,color:textColor,border:`1px solid ${borderColor}`,borderRadius:`${borderRadius}px`,cursor:\"pointer\",outline:\"none\",transition:\"all 0.2s ease\",boxSizing:\"border-box\",overflow:\"hidden\",...font,// Responsive font sizing\nfontSize:`clamp(${parseInt(font?.fontSize||\"16\")*.8}px, ${font?.fontSize||\"16px\"}, ${font?.fontSize||\"16px\"})`},onClick:handleClick,onMouseEnter:e=>{e.currentTarget.style.opacity=\"0.8\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"1\";},onMouseDown:e=>{e.currentTarget.style.transform=\"scale(0.98)\";},onMouseUp:e=>{e.currentTarget.style.transform=\"scale(1)\";},children:[/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt,style:{width:responsiveStyles.imageSize,height:responsiveStyles.imageSize,objectFit:\"cover\",borderRadius:\"4px\",flexShrink:0}}),/*#__PURE__*/_jsx(\"span\",{style:{whiteSpace:isFixedWidth?\"normal\":\"nowrap\",wordBreak:isFixedWidth?\"break-word\":\"normal\",textAlign:isFixedWidth?\"center\":\"left\",flex:isFixedWidth?1:\"none\",overflow:\"hidden\",textOverflow:isFixedWidth?\"unset\":\"ellipsis\"},children:text})]});}addPropertyControls(EditableButton,{text:{type:ControlType.String,title:\"Texto\",defaultValue:\"Mi Bot\\xf3n\"},font:{type:ControlType.Font,title:\"Tipograf\\xeda\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},textColor:{type:ControlType.Color,title:\"Color del Texto\",defaultValue:\"#FFFFFF\"},backgroundColor:{type:ControlType.Color,title:\"Color de Fondo\",defaultValue:\"#000000\"},borderColor:{type:ControlType.Color,title:\"Color del Borde\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Radio del Borde\",defaultValue:8,min:0,max:50,unit:\"px\"},padding:{type:ControlType.Number,title:\"Espaciado Interno\",defaultValue:12,min:4,max:32,unit:\"px\"},image:{type:ControlType.ResponsiveImage,title:\"Imagen\"},imageSize:{type:ControlType.Number,title:\"Tama\\xf1o de Imagen\",defaultValue:20,min:12,max:48,unit:\"px\"},gap:{type:ControlType.Number,title:\"Espacio entre Imagen y Texto\",defaultValue:8,min:0,max:24,unit:\"px\"},link:{type:ControlType.Link,title:\"Enlace\"},onClick:{type:ControlType.EventHandler,title:\"Al Hacer Clic\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EditableButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EditableButton.map"],"mappings":"2LAIG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,YAAU,kBAAgB,cAAY,eAAa,UAAQ,QAAM,CAAC,IAAI,sEAAsE,IAAI,cAAc,CAAC,YAAU,MAAI,UAAQ,OAAK,SAAO,EAAY,EAAa,GAAO,QAAQ,OAAa,EAAc,GAAO,SAAS,OAC/U,EAAiBA,MAAY,CAAC,IAAM,EAAc,EAAgB,EAAY,EAAc,EAAQ,EAAI,MAAM,CACpH,UAAU,SAAS,KAAK,IAAI,GAAG,EAAc,GAAG,CAAC,MAAM,EAAc,MAAM,EAAc,KAAK,QAAQ,SAAS,KAAK,IAAI,EAAE,EAAY,GAAG,CAAC,MAAM,EAAY,MAAM,EAAY,KAAK,IAAI,SAAS,KAAK,IAAI,EAAE,EAAQ,GAAG,CAAC,MAAM,EAAQ,MAAM,EAAQ,KAAK,EAAG,CAAC,EAAU,EAAQ,EAAI,CAAC,CAAO,MAAgB,CAAI,GAAgB,IAAS,QAAa,EAAO,KAAK,EAAK,SAAS,sBAAsB,CAAM,GAAS,GAAS,EAAI,OAAoB,EAAM,SAAS,CAAC,MAAM,CAAC,GAAG,EAAM,GAAG,EAAa,CAAC,MAAM,OAAO,CAAC,CAAC,MAAM,cAAc,SAAS,cAAc,CAAC,GAAG,EAAc,CAAC,OAAO,OAAO,CAAC,CAAC,OAAO,OAAO,CAAC,SAAS,OAAO,QAAQ,OAAO,WAAW,SAAS,eAA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