{"version":3,"file":"CopyIconButton.DREPCuoQ.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/aSc4TRKBysID7Kc0OPF0/4DrUbtVvFPJCXBuBR6DQ/CopyIconButton.js"],"sourcesContent":["// Copy icon button with 4-side padding and icon position control\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * CopyIconButton\n *\n * @framerIntrinsicWidth 44\n * @framerIntrinsicHeight 44\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function CopyIconButton(props){const{copyContent=\"Copy me!\",backgroundColor=\"#fff\",borderColor=\"#EEEEEE\",iconColor=\"#000\",successColor=\"#22CC66\",borderRadius=8,padding=\"12px\",strokeWidth=1.5,iconSize=20,successDuration=1200,iconPosition=\"center\",style}=props;const[copied,setCopied]=useState(false);function handleCopy(){if(typeof navigator!==\"undefined\"&&navigator.clipboard){navigator.clipboard.writeText(copyContent);startTransition(()=>setCopied(true));setTimeout(()=>{startTransition(()=>setCopied(false));},successDuration);}}const getFlexAlignment=()=>{switch(iconPosition){case\"left\":return{alignItems:\"center\",justifyContent:\"flex-start\"};case\"right\":return{alignItems:\"center\",justifyContent:\"flex-end\"};case\"top\":return{alignItems:\"flex-start\",justifyContent:\"center\"};case\"bottom\":return{alignItems:\"flex-end\",justifyContent:\"center\"};case\"center\":default:return{alignItems:\"center\",justifyContent:\"center\"};}};const alignment=getFlexAlignment();return /*#__PURE__*/_jsx(\"button\",{\"aria-label\":copied?\"Copied\":\"Copy\",onClick:handleCopy,style:{...style,display:\"flex\",...alignment,background:copied?successColor:backgroundColor,border:`${strokeWidth}px solid ${borderColor}`,borderRadius,padding,cursor:\"pointer\",transition:\"background 0.2s ease\",outline:\"none\",width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:copied?\"#fff\":iconColor,strokeWidth:2,strokeLinecap:\"round\",strokeLinejoin:\"round\",style:{display:\"block\",flexShrink:0},\"aria-hidden\":\"true\",children:copied?/*#__PURE__*/_jsx(\"path\",{d:\"M5 13l4 4L19 7\"}):/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"rect\",{x:\"9\",y:\"9\",width:\"13\",height:\"13\",rx:\"2\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M5 15V5a2 2 0 0 1 2-2h10\"})]})})});}addPropertyControls(CopyIconButton,{copyContent:{type:ControlType.String,title:\"Copy Content\",defaultValue:\"Copy me!\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#fff\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#EEEEEE\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#000\"},successColor:{type:ControlType.Color,title:\"Success\",defaultValue:\"#22CC66\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32,unit:\"px\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"12px\"},strokeWidth:{type:ControlType.Number,title:\"Stroke Width\",defaultValue:1.5,min:.5,max:4,step:.5,unit:\"px\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:20,min:12,max:48,unit:\"px\"},successDuration:{type:ControlType.Number,title:\"Success Duration\",defaultValue:1200,min:500,max:5e3,step:100,unit:\"ms\"},iconPosition:{type:ControlType.Enum,title:\"Icon Position\",defaultValue:\"center\",options:[\"center\",\"left\",\"right\",\"top\",\"bottom\"],optionTitles:[\"Center\",\"Left\",\"Right\",\"Top\",\"Bottom\"],displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyIconButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"44\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",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