{"version":3,"file":"PromptBox.CcbsNWMY.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/SLv3FtxLHgqGocM5N4M0/VBd5VR73zclTSMSBD7qc/PromptBox.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";/**\n * A prompt to copy, for articles: the text wraps inside the box (no sideways scroll),\n * in a monospace face, with a Copy button.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function PromptBox(props){const{text,label,fill,color,accent,radius,style}=props;const[done,setDone]=useState(false);const content=String(text||\"\").replace(/\\\\n/g,\"\\n\");const copy=async()=>{try{await navigator.clipboard.writeText(content);}catch(e){const ta=document.createElement(\"textarea\");ta.value=content;ta.setAttribute(\"readonly\",\"\");ta.style.position=\"fixed\";ta.style.opacity=\"0\";document.body.appendChild(ta);ta.select();try{document.execCommand(\"copy\");}catch(e2){}document.body.removeChild(ta);}setDone(true);setTimeout(()=>setDone(false),1800);};return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",position:\"relative\",background:fill,borderRadius:radius,padding:\"clamp(18px, 3.2vw, 30px)\",paddingTop:label?\"clamp(18px, 3.2vw, 26px)\":\"clamp(18px, 3.2vw, 30px)\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:12,marginBottom:14},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:\"'Plus Jakarta Sans', 'Plus Jakarta Sans Placeholder', sans-serif\",fontSize:12,fontWeight:600,letterSpacing:\"0.12em\",textTransform:\"uppercase\",color:accent},children:label}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:copy,\"aria-live\":\"polite\",style:{appearance:\"none\",border:0,cursor:\"pointer\",borderRadius:999,padding:\"7px 14px\",background:done?\"#46cf86\":accent,color:\"#111\",fontFamily:\"'Plus Jakarta Sans', 'Plus Jakarta Sans Placeholder', sans-serif\",fontSize:13,fontWeight:700,transition:\"background .2s\"},children:done?\"Copied\":\"Copy\"})]}),/*#__PURE__*/_jsx(\"pre\",{style:{margin:0,whiteSpace:\"pre-wrap\",overflowWrap:\"anywhere\",wordBreak:\"normal\",fontFamily:\"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace\",fontSize:\"clamp(13px, 1.5vw, 15px)\",lineHeight:1.7,color},children:content})]});}PromptBox.defaultProps={text:\"\",label:\"Prompt\",fill:\"#1D1C22\",color:\"#EEF0F3\",accent:\"#FBCE01\",radius:15};addPropertyControls(PromptBox,{label:{type:ControlType.String,title:\"Label\"},text:{type:ControlType.String,title:\"Text\",displayTextArea:true},fill:{type:ControlType.Color,title:\"Fill\"},color:{type:ControlType.Color,title:\"Text colour\"},accent:{type:ControlType.Color,title:\"Accent\"},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:32}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PromptBox\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PromptBox.map"],"mappings":"gMAMG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,OAAK,QAAM,OAAK,QAAM,SAAO,SAAO,SAAO,EAAW,CAAC,EAAK,GAASA,EAAS,EAAK,EAAQ,EAAQ,OAAO,GAAM,EAAE,CAAC,CAAC,QAAQ,OAAO;CAAI,EAAQ,EAAK,SAAS,CAAC,GAAG,CAAC,MAAM,EAAU,UAAU,UAAU,CAAO,CAAE,MAAS,CAAC,IAAM,EAAG,SAAS,cAAc,UAAU,EAAE,EAAG,MAAM,EAAQ,EAAG,aAAa,WAAW,EAAE,EAAE,EAAG,MAAM,SAAS,QAAQ,EAAG,MAAM,QAAQ,IAAI,SAAS,KAAK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