{"version":3,"file":"CopyButton.DI4VX8WA.mjs","names":["useState","useCallback"],"sources":["https:/framerusercontent.com/modules/kvHu5K0PWSIBJaDTA1Cv/cC6VzoCozXa8w1RHwpWx/CopyButton.js"],"sourcesContent":["// Copy button with icon only, customizable properties\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useCallback,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Copy Icon Button\n *\n * @framerIntrinsicWidth 40\n * @framerIntrinsicHeight 40\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function CopyButton(props){const{copyText,iconColor,backgroundColor,hoverBackgroundColor,borderRadius,size,copiedIconColor,icon,style,sizePreset=\"medium\"}=props;const[copied,setCopied]=useState(false);const isStatic=useIsStaticRenderer();// Determine size from preset\nconst presetSizes={small:16,medium:20,large:24};const buttonSize=sizePreset?presetSizes[sizePreset]:size;const handleCopy=useCallback(()=>{if(typeof window!==\"undefined\"&&!isStatic){navigator.clipboard.writeText(copyText);startTransition(()=>setCopied(true));setTimeout(()=>{startTransition(()=>setCopied(false));},1200);}},[copyText,isStatic]);return /*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":copied?\"Copied\":\"Copy\",style:{...style,width:buttonSize,height:buttonSize,background:backgroundColor,border:\"none\",borderRadius,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",transition:\"background 0.15s\",padding:0,outline:\"none\",boxSizing:\"border-box\",overflow:\"hidden\"},onClick:handleCopy,children:copied?// Checkmark icon\n/*#__PURE__*/_jsx(\"svg\",{width:buttonSize,height:buttonSize,viewBox:\"0 0 20 20\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M5 10.5L9 14.5L15 7.5\",stroke:copiedIconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})}):icon?/*#__PURE__*/_jsx(\"img\",{src:icon.src,alt:icon.alt||\"icon\",style:{width:buttonSize,height:buttonSize,objectFit:\"contain\",filter:iconColor?`drop-shadow(0 0 0 ${iconColor})`:undefined,display:\"block\"}}):// Copy icon\n/*#__PURE__*/_jsxs(\"svg\",{width:buttonSize,height:buttonSize,viewBox:\"0 0 20 20\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[/*#__PURE__*/_jsx(\"rect\",{x:\"7\",y:\"7\",width:\"8\",height:\"8\",rx:\"2\",stroke:iconColor,strokeWidth:\"2\"}),/*#__PURE__*/_jsx(\"rect\",{x:\"5\",y:\"5\",width:\"8\",height:\"8\",rx:\"2\",stroke:iconColor,strokeWidth:\"2\",opacity:\"0.4\"})]})});}addPropertyControls(CopyButton,{copyText:{type:ControlType.String,title:\"Copy Text\",defaultValue:\"Copy me!\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#222222\"},copiedIconColor:{type:ControlType.Color,title:\"Copied Icon\",defaultValue:\"#22CC66\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover BG\",defaultValue:\"#F5F5F5\",hidden:true},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32},size:{type:ControlType.Number,title:\"Size (px)\",defaultValue:40,min:24,max:80,unit:\"px\",hidden:({sizePreset})=>sizePreset!==undefined&&sizePreset!==\"custom\"},sizePreset:{type:ControlType.Enum,title:\"Size Preset\",options:[\"small\",\"medium\",\"large\"],optionTitles:[\"Small\",\"Medium\",\"Large\"],defaultValue:\"medium\"},icon:{type:ControlType.ResponsiveImage,title:\"Icon\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"40\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\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