{"version":3,"file":"CustomButton.D7NXw5Yi.mjs","names":["useState","_Fragment","startTransition"],"sources":["https:/framerusercontent.com/modules/EaAkOD26lmVmqRu5TC5X/NhC4Gj3lH8GJ6hvmfvVU/CustomButton.js"],"sourcesContent":["// Botão customizável com funcionalidades de copiar texto, redirecionar e exibir mensagem\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,startTransition}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CustomButton(props){const{label,backgroundColor,textColor,font,border,padding,borderRadius,boxShadow,copyText,redirectUrl,showMessage,messageText,messageDuration,hoverBackgroundColor,style}=props;const[isHovered,setIsHovered]=useState(false);const[showNotification,setShowNotification]=useState(false);const handleClick=async()=>{if(typeof window===\"undefined\")return;// Copiar texto\nif(copyText){try{await navigator.clipboard.writeText(copyText);}catch(err){console.error(\"Erro ao copiar texto:\",err);}}// Exibir mensagem\nif(showMessage&&messageText){startTransition(()=>setShowNotification(true));setTimeout(()=>{startTransition(()=>setShowNotification(false));},messageDuration);}// Redirecionar\nif(redirectUrl){window.open(redirectUrl,\"_blank\");}};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"button\",{onClick:handleClick,onMouseEnter:()=>startTransition(()=>setIsHovered(true)),onMouseLeave:()=>startTransition(()=>setIsHovered(false)),style:{...style,position:\"relative\",backgroundColor:isHovered?hoverBackgroundColor:backgroundColor,color:textColor,padding:padding,borderRadius:borderRadius,boxShadow:boxShadow,cursor:\"pointer\",transition:\"all 0.2s ease\",width:style?.width===\"100%\"?\"100%\":\"max-content\",minWidth:style?.width===\"100%\"?undefined:\"max-content\",...border,...font},children:label}),showNotification&&typeof window!==\"undefined\"&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",top:\"20px\",left:\"50%\",transform:\"translateX(-50%)\",backgroundColor:\"#000000\",color:\"#FFFFFF\",padding:\"12px 24px\",borderRadius:\"8px\",boxShadow:\"0 4px 12px rgba(0, 0, 0, 0.15)\",zIndex:9999,fontSize:\"14px\",fontWeight:500,animation:\"slideDown 0.3s ease\"},children:messageText}),/*#__PURE__*/_jsx(\"style\",{children:`\n                    @keyframes slideDown {\n                        from {\n                            opacity: 0;\n                            transform: translateX(-50%) translateY(-10px);\n                        }\n                        to {\n                            opacity: 1;\n                            transform: translateX(-50%) translateY(0);\n                        }\n                    }\n                `})]});}addPropertyControls(CustomButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Clique Aqui\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover Background\",defaultValue:\"#333333\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:0,borderStyle:\"solid\",borderColor:\"#000000\"}},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"12px 24px\"},borderRadius:{type:ControlType.BorderRadius,title:\"Border Radius\",defaultValue:\"8px\"},boxShadow:{type:ControlType.BoxShadow,title:\"Shadow\"},copyText:{type:ControlType.String,title:\"Texto para Copiar\",defaultValue:\"Texto copiado!\",displayTextArea:true},redirectUrl:{type:ControlType.Link,title:\"URL de Redirecionamento\"},showMessage:{type:ControlType.Boolean,title:\"Exibir Mensagem\",defaultValue:true,enabledTitle:\"Sim\",disabledTitle:\"N\\xe3o\"},messageText:{type:ControlType.String,title:\"Texto da Mensagem\",defaultValue:\"Texto copiado com sucesso!\",hidden:({showMessage})=>!showMessage},messageDuration:{type:ControlType.Number,title:\"Dura\\xe7\\xe3o da Mensagem\",defaultValue:3e3,min:1e3,max:1e4,step:500,unit:\"ms\",hidden:({showMessage})=>!showMessage}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomButton.map"],"mappings":"oNAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,kBAAgB,YAAU,OAAK,SAAO,UAAQ,eAAa,YAAU,WAAS,cAAY,cAAY,cAAY,kBAAgB,uBAAqB,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAO,CAAC,EAAiB,GAAqBA,EAAS,EAAK,EAGlR,OAAoB,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAK,SAAS,CAAC,QAAQ,SAH4N,CAAI,GAAO,IAAS,OACxX,IAAG,EAAU,GAAG,CAAC,MAAM,EAAU,UAAU,UAAU,CAAQ,CAAE,OAAO,EAAI,CAAC,QAAQ,MAAM,wBAAwB,CAAG,CAAE,CACnH,GAAa,IAAa,MAAoB,EAAoB,EAAI,CAAC,EAAE,eAAe,CAAC,MAAoB,EAAoB,EAAK,CAAC,CAAE,EAAE,CAAe,GAC1J,GAAa,EAAO,KAAK,EAAY,QAAQ,CAFsE,CAEnE,EAAiG,iBAAiBC,MAAoB,EAAa,EAAI,CAAC,EAAE,iBAAiBA,MAAoB,EAAa,EAAK,CAAC,EAAE,MAAM,CAAC,GAAG,EAAM,SAAS,WAAW,gBAAgB,EAAU,EAAqB,EAAgB,MAAM,EAAkB,UAAqB,eAAuB,YAAU,OAAO,UAAU,WAAW,gBAAgB,MAAM,GAAO,QAAQ,OAAO,OAAO,cAAc,SAAS,GAAO,QAAQ,OAAO,IAAA,GAAU,cAAc,GAAG,EAAO,GAAG,CAAI,EAAE,SAAS,CAAK,CAAC,EAAE,GAAyB,IAAS,QAA0B,EAAK,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