{"version":3,"file":"CopyToClipboard.DFRsHbnt.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/FZUSlWajiTBcEvj3xeKO/1MuuDtCysX5RTIPafrst/CodeBlock.js","https:/framerusercontent.com/modules/o0Yz8n9f8EnCWJGsZnyE/Hva5iqXKYC02755H9mU3/CopyToClipboard.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";// Learn more: https://www.framer.com/developers/overrides/\nexport function withNoScrollbars(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const mergedStyle={...props.style,overflowX:\"hidden\"};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:mergedStyle});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withNoScrollbars\":{\"type\":\"reactHoc\",\"name\":\"withNoScrollbars\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CodeBlock.map","// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers/\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useState}from\"react\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/components/auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CopyToClipboard(props){const[success,setSuccess]=useState(false);const{hoverColor,copyColor,codeInput}=props;const handleClick=()=>{if(codeInput.length===0)throw new Error(\"codeInput not provided\");navigator.clipboard.writeText(codeInput);setSuccess(true);setTimeout(()=>{setSuccess(false);},1500);};return /*#__PURE__*/_jsx(motion.button,{style:{...buttonStyle,justifyContent:success?\"flex-end\":\"flex-start\"},onClick:handleClick,whileHover:{background:success?props.copyColor:props.hoverColor},animate:{background:success?props.copyColor:\"transparent\"},children:/*#__PURE__*/_jsx(motion.div,{layout:true,transition:{type:\"spring\",visualDuration:.2,bounce:.2},style:{height:72},children:/*#__PURE__*/_jsxs(\"svg\",{width:\"36\",height:\"72\",viewBox:\"0 0 36 72\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M22.0625 13H11.125C10.8764 13 10.6379 13.0988 10.4621 13.2746C10.2863 13.4504 10.1875 13.6889 10.1875 13.9375V24.875C10.1875 25.1236 10.2863 25.3621 10.4621 25.5379C10.6379 25.7137 10.8764 25.8125 11.125 25.8125H22.0625C22.3111 25.8125 22.5496 25.7137 22.7254 25.5379C22.9012 25.3621 23 25.1236 23 24.875V13.9375C23 13.6889 22.9012 13.4504 22.7254 13.2746C22.5496 13.0988 22.3111 13 22.0625 13ZM21.125 23.9375H12.0625V14.875H21.125V23.9375ZM25.8125 11.125V22.0625C25.8125 22.3111 25.7137 22.5496 25.5379 22.7254C25.3621 22.9012 25.1236 23 24.875 23C24.6264 23 24.3879 22.9012 24.2121 22.7254C24.0363 22.5496 23.9375 22.3111 23.9375 22.0625V12.0625H13.9375C13.6889 12.0625 13.4504 11.9637 13.2746 11.7879C13.0988 11.6121 13 11.3736 13 11.125C13 10.8764 13.0988 10.6379 13.2746 10.4621C13.4504 10.2863 13.6889 10.1875 13.9375 10.1875H24.875C25.1236 10.1875 25.3621 10.2863 25.5379 10.4621C25.7137 10.6379 25.8125 10.8764 25.8125 11.125Z\",fill:\"#343330\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M26.1633 50.2883L16.1633 60.2883C16.0762 60.3757 15.9727 60.445 15.8588 60.4923C15.7448 60.5397 15.6226 60.564 15.4992 60.564C15.3759 60.564 15.2537 60.5397 15.1397 60.4923C15.0258 60.445 14.9223 60.3757 14.8352 60.2883L10.4602 55.9133C10.373 55.8261 10.3038 55.7225 10.2566 55.6086C10.2094 55.4947 10.1851 55.3725 10.1851 55.2492C10.1851 55.1259 10.2094 55.0038 10.2566 54.8898C10.3038 54.7759 10.373 54.6724 10.4602 54.5851C10.5474 54.4979 10.6509 54.4288 10.7649 54.3816C10.8788 54.3344 11.0009 54.3101 11.1242 54.3101C11.2476 54.3101 11.3697 54.3344 11.4836 54.3816C11.5976 54.4288 11.7011 54.4979 11.7883 54.5851L15.5 58.2969L24.8367 48.9617C25.0129 48.7856 25.2517 48.6866 25.5008 48.6866C25.7499 48.6866 25.9887 48.7856 26.1649 48.9617C26.341 49.1378 26.4399 49.3767 26.4399 49.6258C26.4399 49.6913 26.4516 50 26.1633 50.2883Z\",fill:\"white\"})]})})});}addPropertyControls(CopyToClipboard,{codeInput:{type:ControlType.String,title:\"Code\",displayTextArea:true},hoverColor:{type:ControlType.Color,title:\"Hover\"},copyColor:{type:ControlType.Color,title:\"Copy Color\"}});// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst iconContainer={height:36,width:36,display:\"grid\",placeItems:\"center\",aspectRatio:1};const buttonStyle={height:36,width:36,borderRadius:32,display:\"flex\",flexFlow:\"column\",overflow:\"hidden\",justifyContent:\"flex-start\",alignItems:\"center\",border:0};const containerStyle={height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyToClipboard\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CopyToClipboard.map"],"mappings":"mPACA,SAAgB,EAAiB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAY,CAAC,GAAG,EAAM,MAAM,UAAU,SAAS,CAAC,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,MAAM,EAAY,CAAC,EAAG,kBAD/K,IAA8B,ICQtE,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,GAAM,CAAM,CAAC,aAAW,YAAU,aA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