{"version":3,"file":"CopyButton.BRLoT7nR.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/8bHYWsgmZMgquth6Xdgx/TlEI9cXxf77uk4KDYvql/CopyButton.js"],"sourcesContent":["// Button component with editable size, hover/pressed states, and copy-to-clipboard functionality\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CopyButton(props){const{text,copyText,width,height,paddingTop,paddingRight,paddingBottom,paddingLeft,backgroundType,backgroundColor,gradientStartColor,gradientEndColor,gradientAngle,textColor,hoverBackgroundColor,hoverGradientStartColor,hoverGradientEndColor,hoverGradientAngle,hoverTextColor,pressedBackgroundColor,pressedGradientStartColor,pressedGradientEndColor,pressedGradientAngle,pressedTextColor,borderRadius,borderColor,borderWidth,font}=props;const[isHovered,setIsHovered]=useState(false);const[isPressed,setIsPressed]=useState(false);const[copied,setCopied]=useState(false);const handleClick=async()=>{if(typeof window!==\"undefined\"&&navigator.clipboard){try{await navigator.clipboard.writeText(copyText);startTransition(()=>{setCopied(true);setTimeout(()=>setCopied(false),2e3);});}catch(err){console.error(\"Failed to copy text: \",err);}}};const handleMouseEnter=()=>{startTransition(()=>setIsHovered(true));};const handleMouseLeave=()=>{startTransition(()=>{setIsHovered(false);setIsPressed(false);});};const handleMouseDown=()=>{startTransition(()=>setIsPressed(true));};const handleMouseUp=()=>{startTransition(()=>setIsPressed(false));};const currentBackgroundColor=isPressed?pressedBackgroundColor:isHovered?hoverBackgroundColor:backgroundColor;const currentGradient=isPressed?`linear-gradient(${pressedGradientAngle}deg, ${pressedGradientStartColor} 0%, ${pressedGradientEndColor} 100%)`:isHovered?`linear-gradient(${hoverGradientAngle}deg, ${hoverGradientStartColor} 0%, ${hoverGradientEndColor} 100%)`:`linear-gradient(${gradientAngle}deg, ${gradientStartColor} 0%, ${gradientEndColor} 100%)`;const currentTextColor=isPressed?pressedTextColor:isHovered?hoverTextColor:textColor;const isFixedWidth=props?.style&&props.style.width===\"100%\";const isFixedHeight=props?.style&&props.style.height===\"100%\";return /*#__PURE__*/_jsx(\"button\",{style:{...props.style,minWidth:isFixedWidth?\"100%\":`${width}px`,minHeight:isFixedHeight?\"100%\":`${height}px`,width:isFixedWidth?\"100%\":\"auto\",height:isFixedHeight?\"100%\":\"auto\",padding:`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,background:backgroundType===\"gradient\"?currentGradient:currentBackgroundColor,color:currentTextColor,borderRadius:`${borderRadius}px`,border:`${borderWidth}px solid ${borderColor}`,cursor:\"pointer\",transition:\"all 0.2s ease\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:\"8px\",outline:\"none\",userSelect:\"none\",boxSizing:\"border-box\",...font},onClick:handleClick,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,onMouseDown:handleMouseDown,onMouseUp:handleMouseUp,\"aria-label\":`Copy \"${copyText}\" to clipboard`,children:copied?\"Copied!\":text});}addPropertyControls(CopyButton,{text:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Copy Me\"},copyText:{type:ControlType.String,title:\"Text to Copy\",defaultValue:\"This text will be copied to clipboard\"},width:{type:ControlType.Number,title:\"Width\",defaultValue:120,min:50,max:500,unit:\"px\"},height:{type:ControlType.Number,title:\"Height\",defaultValue:40,min:20,max:100,unit:\"px\"},paddingTop:{type:ControlType.Number,title:\"Padding Top\",defaultValue:12,min:0,max:50,unit:\"px\"},paddingRight:{type:ControlType.Number,title:\"Padding Right\",defaultValue:12,min:0,max:50,unit:\"px\"},paddingBottom:{type:ControlType.Number,title:\"Padding Bottom\",defaultValue:12,min:0,max:50,unit:\"px\"},paddingLeft:{type:ControlType.Number,title:\"Padding Left\",defaultValue:12,min:0,max:50,unit:\"px\"},backgroundType:{type:ControlType.Enum,title:\"Background Type\",options:[\"solid\",\"gradient\"],optionTitles:[\"Solid\",\"Gradient\"],defaultValue:\"solid\",displaySegmentedControl:true},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\",hidden:({backgroundType})=>backgroundType===\"gradient\"},gradientStartColor:{type:ControlType.Color,title:\"Gradient Start\",defaultValue:\"#667eea\",hidden:({backgroundType})=>backgroundType===\"solid\"},gradientEndColor:{type:ControlType.Color,title:\"Gradient End\",defaultValue:\"#764ba2\",hidden:({backgroundType})=>backgroundType===\"solid\"},gradientAngle:{type:ControlType.Number,title:\"Gradient Angle\",defaultValue:135,min:0,max:360,unit:\"deg\",hidden:({backgroundType})=>backgroundType===\"solid\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover Background\",defaultValue:\"#333333\",hidden:({backgroundType})=>backgroundType===\"gradient\"},hoverGradientStartColor:{type:ControlType.Color,title:\"Hover Gradient Start\",defaultValue:\"#7b8ff0\",hidden:({backgroundType})=>backgroundType===\"solid\"},hoverGradientEndColor:{type:ControlType.Color,title:\"Hover Gradient End\",defaultValue:\"#8a5bb8\",hidden:({backgroundType})=>backgroundType===\"solid\"},hoverGradientAngle:{type:ControlType.Number,title:\"Hover Gradient Angle\",defaultValue:135,min:0,max:360,unit:\"deg\",hidden:({backgroundType})=>backgroundType===\"solid\"},hoverTextColor:{type:ControlType.Color,title:\"Hover Text\",defaultValue:\"#FFFFFF\"},pressedBackgroundColor:{type:ControlType.Color,title:\"Pressed Background\",defaultValue:\"#666666\",hidden:({backgroundType})=>backgroundType===\"gradient\"},pressedGradientStartColor:{type:ControlType.Color,title:\"Pressed Gradient Start\",defaultValue:\"#5568d3\",hidden:({backgroundType})=>backgroundType===\"solid\"},pressedGradientEndColor:{type:ControlType.Color,title:\"Pressed Gradient End\",defaultValue:\"#6039a0\",hidden:({backgroundType})=>backgroundType===\"solid\"},pressedGradientAngle:{type:ControlType.Number,title:\"Pressed Gradient Angle\",defaultValue:135,min:0,max:360,unit:\"deg\",hidden:({backgroundType})=>backgroundType===\"solid\"},pressedTextColor:{type:ControlType.Color,title:\"Pressed Text\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:50,unit:\"px\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#000000\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:0,min:0,max:10,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CopyButton.map"],"mappings":"gUAIG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,OAAK,WAAS,QAAM,SAAO,aAAW,eAAa,gBAAc,cAAY,iBAAe,kBAAgB,qBAAmB,mBAAiB,gBAAc,YAAU,uBAAqB,0BAAwB,wBAAsB,qBAAmB,iBAAe,yBAAuB,4BAA0B,0BAAwB,uBAAqB,mBAAiB,eAAa,cAAY,cAAY,QAAM,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAO,GAAWA,EAAS,GAAM,CAAO,EAAY,SAAS,CAAC,GAAU,IAAS,QAAa,EAAU,UAAW,GAAG,CAAC,MAAM,EAAU,UAAU,UAAU,EAAS,CAAC,MAAoB,CAAC,EAAU,GAAK,CAAC,eAAe,EAAU,GAAM,CAAC,IAAI,EAAG,OAAQ,EAAI,CAAC,QAAQ,MAAM,wBAAwB,EAAI,GAAW,M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