{"version":3,"file":"FileDownloadButton.DbU39pdc.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/o0zn7ZAt8liqXcbUvc4Y/D3CD7h1WqDACMrSon7FV/FileDownloadButton.js"],"sourcesContent":["// Text button with file upload and download functionality\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,startTransition}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function FileDownloadButton(props){const{label,file=\"\",backgroundColor,textColor,hoverBackgroundColor,hoverTextColor,borderRadius,paddingX,paddingY,font,openInNewTab}=props;const[isHovered,setIsHovered]=useState(false);const handleClick=()=>{if(!file)return;if(openInNewTab){window.open(file,\"_blank\");}else{const link=document.createElement(\"a\");link.href=file;link.download=file.split(\"/\").pop()||\"download\";document.body.appendChild(link);link.click();document.body.removeChild(link);}};const handleMouseEnter=()=>{startTransition(()=>setIsHovered(true));};const handleMouseLeave=()=>{startTransition(()=>setIsHovered(false));};return /*#__PURE__*/_jsx(\"button\",{onClick:handleClick,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,style:{position:\"relative\",width:\"max-content\",backgroundColor:isHovered?hoverBackgroundColor:backgroundColor,color:isHovered?hoverTextColor:textColor,borderRadius:`${borderRadius}px`,paddingLeft:`${paddingX}px`,paddingRight:`${paddingX}px`,paddingTop:`${paddingY}px`,paddingBottom:`${paddingY}px`,border:\"none\",cursor:file?\"pointer\":\"not-allowed\",transition:\"all 0.2s ease\",...font},disabled:!file,\"aria-label\":label,children:label});}addPropertyControls(FileDownloadButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Download File\"},file:{type:ControlType.File,title:\"File\",allowedFileTypes:[\"pdf\",\"doc\",\"docx\",\"txt\",\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\",\"mp4\",\"webm\",\"mov\",\"mp3\",\"wav\",\"ogg\",\"zip\"]},openInNewTab:{type:ControlType.Boolean,title:\"Open in New Tab\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover Background\",defaultValue:\"#CCCCCC\"},hoverTextColor:{type:ControlType.Color,title:\"Hover Text\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},paddingX:{type:ControlType.Number,title:\"Padding X\",defaultValue:24,min:0,max:100,step:1,unit:\"px\"},paddingY:{type:ControlType.Number,title:\"Padding Y\",defaultValue:12,min:0,max:100,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Semibold\",fontSize:\"14px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FileDownloadButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileDownloadButton.map"],"mappings":"+LAIG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,GAAG,kBAAgB,YAAU,uBAAqB,iBAAe,eAAa,WAAS,WAAS,OAAK,gBAAc,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAA6Z,OAAoB,EAAK,SAAS,CAAC,YAAza,CAAK,KAAY,GAAG,EAAc,EAAO,KAAK,EAAK,SAAS,KAAM,CAAC,IAAM,EAAK,SAAS,cAAc,IAAI,CAAC,EAAK,KAAK,EAAK,EAAK,SAAS,EAAK,MAAM,IAAI,CAAC,KAAK,EAAE,WAAW,SAAS,KAAK,YAAY,EAAK,CA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