{"version":3,"file":"CopyButton.B1L9PMFw.mjs","names":["useState","useRef","__esmMin","init_ssg_sandbox_shims","_e","p","c","init_jsx_runtime","init_npm_react_18_3_1","de","navigator","addPropertyControls","init_framer_DKWANagr","ControlType","CopyButton","props","done","setDone","hover","setHover","timer","onClick","text","content","ta","icon","showIcon","iconSize","iconColor","color","iconGap","style","radius","fill","fontWeight","hoverScale","doneLabel","label","init_CopyButton"],"sources":["https:/framerusercontent.com/modules/cErJqL8p1SVirGNONn3U/axESa2u5CvzmKPVHWUab/CopyButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useState}from\"react\";/**\n * Copy-to-clipboard pill in the site's own button style.\n * Plus Jakarta Sans, weight and size as controls, gradient or flat fill, hover scale like the Primary CTA.\n * Optional copy icon INSIDE the button (so the whole pill, icon included, copies); shows a tick while \"done\".\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CopyButton(props){const{content,label,doneLabel,fill,color,fontSize,fontWeight,padding,radius,hoverScale,showIcon,iconColor,iconSize,iconGap,style}=props;const[done,setDone]=useState(false);const[hover,setHover]=useState(false);const timer=useRef(null);const onClick=async e=>{e.preventDefault();const text=content||\"\";try{await navigator.clipboard.writeText(text);}catch(err){try{const ta=document.createElement(\"textarea\");ta.value=text;ta.setAttribute(\"readonly\",\"\");ta.style.position=\"fixed\";ta.style.opacity=\"0\";document.body.appendChild(ta);ta.select();document.execCommand(\"copy\");document.body.removeChild(ta);}catch(e2){}}setDone(true);if(timer.current)clearTimeout(timer.current);timer.current=setTimeout(()=>setDone(false),1800);};const iconFill=iconColor||color;const icon=showIcon?/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:iconFill,\"aria-hidden\":\"true\",style:{display:\"block\",flexShrink:0,marginLeft:iconGap},children:done?/*#__PURE__*/_jsx(\"path\",{d:\"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"}):/*#__PURE__*/_jsx(\"path\",{d:\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\"})}):null;return /*#__PURE__*/_jsxs(\"button\",{type:\"button\",onClick:onClick,onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),\"aria-live\":\"polite\",style:{...style,appearance:\"none\",border:\"none\",outline:\"none\",margin:0,cursor:\"pointer\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",whiteSpace:\"nowrap\",padding,borderRadius:radius,background:fill,color,fontFamily:\"'Plus Jakarta Sans', 'Plus Jakarta Sans Placeholder', sans-serif\",fontWeight:Number(fontWeight)||600,fontSize,lineHeight:\"1.2em\",letterSpacing:0,transform:hover?`scale(${hoverScale})`:\"scale(1)\",transition:\"transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1)\",willChange:\"transform\",width:\"100%\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"span\",{children:done?doneLabel:label}),icon]});}CopyButton.defaultProps={content:\"\",label:\"Copy the prompt\",doneLabel:\"Copied\",fill:\"linear-gradient(180deg, rgb(251, 206, 1) 18%, rgb(251, 181, 1) 92%)\",color:\"rgb(9, 12, 16)\",fontSize:15,fontWeight:\"600\",padding:\"17px 30px\",radius:100,hoverScale:1.04,showIcon:false,iconColor:\"\",iconSize:16,iconGap:10};addPropertyControls(CopyButton,{content:{type:ControlType.String,title:\"Content\",displayTextArea:true,defaultValue:\"\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Copy the prompt\"},doneLabel:{type:ControlType.String,title:\"Copied label\",defaultValue:\"Copied\"},fill:{type:ControlType.String,title:\"Fill (CSS)\",defaultValue:\"linear-gradient(180deg, rgb(251, 206, 1) 18%, rgb(251, 181, 1) 92%)\"},color:{type:ControlType.Color,title:\"Text\",defaultValue:\"rgb(9, 12, 16)\"},fontSize:{type:ControlType.Number,title:\"Size\",defaultValue:15,min:10,max:24},fontWeight:{type:ControlType.Enum,title:\"Weight\",options:[\"500\",\"600\",\"700\"],optionTitles:[\"Medium\",\"Semibold\",\"Bold\"],defaultValue:\"600\"},padding:{type:ControlType.String,title:\"Padding\",defaultValue:\"17px 30px\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:100},hoverScale:{type:ControlType.Number,title:\"Hover scale\",defaultValue:1.04,min:1,max:1.2,step:.01},showIcon:{type:ControlType.Boolean,title:\"Icon\",defaultValue:false,enabledTitle:\"Copy\",disabledTitle:\"None\"},iconColor:{type:ControlType.Color,title:\"Icon colour\",defaultValue:\"rgba(255,255,255,0.75)\",hidden:p=>!p.showIcon},iconSize:{type:ControlType.Number,title:\"Icon size\",defaultValue:16,min:10,max:24,hidden:p=>!p.showIcon},iconGap:{type:ControlType.Number,title:\"Icon gap\",defaultValue:10,min:0,max:24,hidden:p=>!p.showIcon}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CopyButton.map"],"mappings":"A,uMAOG,SAAwBc,EAAW,EAAM,CAAC,GAAK,CAAC,UAAQ,QAAM,YAAU,OAAK,QAAM,WAAS,aAAW,UAAQ,SAAO,aAAW,WAAS,YAAU,WAAS,UAAQ,SAAOC,EAAW,CAACC,EAAKC,GAASjB,EAAS,EAAK,EAAO,CAACkB,EAAMC,GAAUnB,EAAS,EAAK,EAAQoB,EAAMnB,EAAO,IAAI,EAAQoB,EAAQ,KAAM,IAAG,CAAC,EAAE,eAAe,EAAE,IAAMC,EAAKC,GAAS,GAAG,GAAG,CAAC,MAAMb,EAAU,U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