{"version":3,"file":"CopyEmail.B-5OHOiA.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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