{"version":3,"file":"Copy_Email_Button.TmeM1Bu8.mjs","names":["React.useState","React.useRef","__esmMin","init_ssg_sandbox_shims","navigator","init_npm_react_18_3_1","_e","de","init_jsx_runtime","p","ce","window","addPropertyControls","init_framer_BL70qLPA","ControlType","CopyEmailButton","props","copied","setCopied","isHovered","setIsHovered","isPressed","setIsPressed","timer","handleCopy","event","email","copiedDuration","error","currentBackground","pressedBackgroundColor","hoverBackgroundColor","backgroundColor","borderWidth","borderColor","paddingTop","paddingRight","paddingBottom","paddingLeft","copiedTextColor","textColor","transitionDuration","defaultText","copiedText","iconMode","init_Copy_Email_Button"],"sources":["https:/framerusercontent.com/modules/JcGsFAL4klOOfZ6EeESJ/l5ak5pWdWPSSBvOFpbBB/Copy_Email_Button.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function CopyEmailButton(props){const{email,iconMode,defaultText,copiedText,copiedDuration,fontFamily,fontSize,fontWeight,fontStyle,textColor,copiedTextColor,backgroundColor,hoverBackgroundColor,pressedBackgroundColor,borderColor,borderWidth,borderRadius,paddingTop,paddingRight,paddingBottom,paddingLeft,transitionDuration}=props;const[copied,setCopied]=React.useState(false);const[isHovered,setIsHovered]=React.useState(false);const[isPressed,setIsPressed]=React.useState(false);const timer=React.useRef(null);React.useEffect(()=>()=>window.clearTimeout(timer.current),[]);const handleCopy=async event=>{event.preventDefault();event.stopPropagation();try{await navigator.clipboard.writeText(email);setCopied(true);window.clearTimeout(timer.current);timer.current=window.setTimeout(()=>{setCopied(false);},copiedDuration*1e3);}catch(error){console.error(\"Copy failed:\",error);}};const currentBackground=isPressed?pressedBackgroundColor:isHovered?hoverBackgroundColor:backgroundColor;return /*#__PURE__*/_jsxs(\"button\",{type:\"button\",\"aria-label\":copied?\"Email copied\":\"Copy email address\",title:copied?\"Copied!\":\"Copy email address\",onClick:handleCopy,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>{setIsHovered(false);setIsPressed(false);},onMouseDown:()=>setIsPressed(true),onMouseUp:()=>setIsPressed(false),style:{position:\"relative\",width:\"100%\",height:\"100%\",cursor:\"pointer\",border:`${borderWidth}px solid ${borderColor}`,borderRadius,background:currentBackground,padding:`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,color:copied?copiedTextColor:textColor,fontFamily,fontSize,fontWeight,fontStyle,lineHeight:1.2,display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",whiteSpace:\"nowrap\",transition:`all ${transitionDuration}s ease`,outline:\"none\",appearance:\"none\",boxSizing:\"border-box\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{visibility:\"hidden\"},children:defaultText}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",inset:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`},children:copied?copiedText:iconMode?/*#__PURE__*/_jsxs(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"rect\",{x:\"9\",y:\"9\",width:\"13\",height:\"13\",rx:\"2\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"})]}):defaultText})]});}CopyEmailButton.defaultProps={email:\"hello@aryaehr.com\",defaultText:\"Copy Email Address\",copiedText:\"Copied!\",copiedDuration:2,fontFamily:\"Inter\",fontSize:16,fontWeight:600,fontStyle:\"normal\",textColor:\"#229386\",copiedTextColor:\"#229386\",backgroundColor:\"rgba(255,255,255,0)\",hoverBackgroundColor:\"rgba(34,147,134,0.08)\",pressedBackgroundColor:\"rgba(34,147,134,0.14)\",borderColor:\"#229386\",borderWidth:1,borderRadius:8,paddingTop:12,paddingRight:20,paddingBottom:12,paddingLeft:20,transitionDuration:.2};addPropertyControls(CopyEmailButton,{iconMode:{type:ControlType.Boolean,title:\"Icon Only\",defaultValue:false},email:{type:ControlType.String,title:\"Email\"},defaultText:{type:ControlType.String,title:\"Default Text\"},copiedText:{type:ControlType.String,title:\"Copied Text\"},copiedDuration:{type:ControlType.Number,title:\"Copied Time\",min:.5,max:10,step:.5,unit:\"s\"},fontFamily:{type:ControlType.String,title:\"Font\"},fontSize:{type:ControlType.Number,title:\"Font Size\",min:8,max:80,unit:\"px\"},fontWeight:{type:ControlType.Enum,title:\"Weight\",options:[300,400,500,600,700,800],optionTitles:[\"Light\",\"Regular\",\"Medium\",\"Semi Bold\",\"Bold\",\"Extra Bold\"]},fontStyle:{type:ControlType.Enum,title:\"Style\",options:[\"normal\",\"italic\"],optionTitles:[\"Normal\",\"Italic\"]},textColor:{type:ControlType.Color,title:\"Text\"},copiedTextColor:{type:ControlType.Color,title:\"Copied Text\"},backgroundColor:{type:ControlType.Color,title:\"Background\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover BG\"},pressedBackgroundColor:{type:ControlType.Color,title:\"Pressed BG\"},borderColor:{type:ControlType.Color,title:\"Border\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",min:0,max:10,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Radius\",min:0,max:100,unit:\"px\"},paddingTop:{type:ControlType.Number,title:\"Padding Top\",min:0,max:80,unit:\"px\"},paddingRight:{type:ControlType.Number,title:\"Padding Right\",min:0,max:120,unit:\"px\"},paddingBottom:{type:ControlType.Number,title:\"Padding Bottom\",min:0,max:80,unit:\"px\"},paddingLeft:{type:ControlType.Number,title:\"Padding Left\",min:0,max:120,unit:\"px\"},transitionDuration:{type:ControlType.Number,title:\"Transition\",min:0,max:2,step:.05,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyEmailButton\",\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