{"version":3,"file":"CopyEmail.Ce6X9kr5.mjs","names":["useState","startTransition","_Fragment"],"sources":["https:/framerusercontent.com/modules/x6QZL1qKuj96RyRqooi1/XDbdh23z06je4Lhap1uk/CopyEmail.js"],"sourcesContent":["// Copy email address button with visual feedback\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Copy Email Address\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 50\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CopyEmail(props){const{email,buttonText,copiedText,showIcon,iconSize,textColor,hoverColor,buttonFont,style}=props;const[isCopied,setIsCopied]=useState(false);const[isHovered,setIsHovered]=useState(false);const handleCopy=async()=>{if(typeof window===\"undefined\")return;try{await navigator.clipboard.writeText(email);startTransition(()=>setIsCopied(true));}catch(err){console.error(\"Failed to copy email:\",err);}};useEffect(()=>{if(isCopied){const timer=setTimeout(()=>{startTransition(()=>setIsCopied(false));},2e3);return()=>clearTimeout(timer);}},[isCopied]);const isFixedWidth=style&&style.width===\"100%\";const displayColor=isHovered?hoverColor:textColor;return /*#__PURE__*/_jsxs(\"div\",{onClick:handleCopy,onMouseEnter:()=>startTransition(()=>setIsHovered(true)),onMouseLeave:()=>startTransition(()=>setIsHovered(false)),style:{...style,position:\"relative\",...isFixedWidth?{}:{minWidth:\"max-content\"},display:\"flex\",alignItems:\"center\",gap:8,color:displayColor,cursor:\"pointer\",...buttonFont},\"aria-label\":isCopied?copiedText:`${buttonText} ${email}`,children:[/*#__PURE__*/_jsx(\"span\",{children:isCopied?copiedText:buttonText}),showIcon&&/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 16 16\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",style:{flexShrink:0},children:isCopied?/*#__PURE__*/_jsx(\"path\",{d:\"M13.5 4L6 11.5L2.5 8\",stroke:displayColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}):/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"rect\",{x:\"5\",y:\"5\",width:\"9\",height:\"9\",rx:\"1.5\",stroke:displayColor,strokeWidth:\"1.5\",fill:\"none\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M3 10.5H2.5C1.67157 10.5 1 9.82843 1 9V2.5C1 1.67157 1.67157 1 2.5 1H9C9.82843 1 10.5 1.67157 10.5 2.5V3\",stroke:displayColor,strokeWidth:\"1.5\",fill:\"none\"})]})})]});}addPropertyControls(CopyEmail,{email:{type:ControlType.String,title:\"Email\",defaultValue:\"hello@example.com\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Copy Email\"},copiedText:{type:ControlType.String,title:\"Copied Text\",defaultValue:\"Copied!\"},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:20,min:12,max:48,step:1,unit:\"px\",hidden:({showIcon})=>!showIcon},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},hoverColor:{type:ControlType.Color,title:\"Hover Color\",defaultValue:\"#FFFFFF\"},buttonFont:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Semibold\",fontSize:\"14px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyEmail\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"50\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"200\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"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