{"version":3,"file":"FileDownloadButton.C-I6O2xR.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/41EDzENfbUadqwhsqQO3/GGnNtDd0DSvSGt2UCDea/FileDownloadButton.js"],"sourcesContent":["// File download button with customizable states, icon positioning, and accessibility features\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function FileDownloadButton(props){const{label,fileUrl=\"https://framerusercontent.com/assets/8w3IUatLX9a5JVJ6XPCVuHi94.mp3\",fileName,iconPosition,showIcon,iconSize,defaultBackground,defaultTextColor,defaultIconColor,defaultBorderWidth,defaultBorderColor,hoverBackground,hoverTextColor,hoverIconColor,hoverBorderWidth,hoverBorderColor,pressedBackground,pressedTextColor,pressedIconColor,pressedBorderWidth,pressedBorderColor,borderRadius,paddingX,paddingY,gap,font,ariaLabel,ariaDescribedBy,style}=props;const[isHovered,setIsHovered]=useState(false);const[isPressed,setIsPressed]=useState(false);const currentBackground=isPressed?pressedBackground:isHovered?hoverBackground:defaultBackground;const currentTextColor=isPressed?pressedTextColor:isHovered?hoverTextColor:defaultTextColor;const currentIconColor=isPressed?pressedIconColor:isHovered?hoverIconColor:defaultIconColor;const currentBorderWidth=isPressed?pressedBorderWidth:isHovered?hoverBorderWidth:defaultBorderWidth;const currentBorderColor=isPressed?pressedBorderColor:isHovered?hoverBorderColor:defaultBorderColor;const handleDownload=()=>{if(typeof window!==\"undefined\"){window.open(fileUrl,\"_blank\",\"noopener,noreferrer\");}};const downloadIcon=/*#__PURE__*/_jsxs(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:currentIconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"}),/*#__PURE__*/_jsx(\"polyline\",{points:\"7 10 12 15 17 10\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"12\",y1:\"15\",x2:\"12\",y2:\"3\"})]});return /*#__PURE__*/_jsxs(\"button\",{onClick:handleDownload,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>{setIsHovered(false);setIsPressed(false);},onMouseDown:()=>setIsPressed(true),onMouseUp:()=>setIsPressed(false),\"aria-label\":ariaLabel||`Download ${fileName||label}`,\"aria-describedby\":ariaDescribedBy||undefined,role:\"button\",style:{...style,position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"flex-start\",flexDirection:iconPosition===\"after\"?\"row\":\"row\",gap:showIcon?`${gap}px`:0,backgroundColor:currentBackground,color:currentTextColor,border:`${currentBorderWidth}px solid ${currentBorderColor}`,borderRadius:`${borderRadius}px`,paddingLeft:`${paddingX}px`,paddingRight:`${paddingX}px`,paddingTop:`${paddingY}px`,paddingBottom:`${paddingY}px`,cursor:\"pointer\",transition:\"all 0.2s ease\",outline:\"none\",userSelect:\"none\",width:\"100%\",height:\"auto\",minHeight:\"fit-content\",...font},onFocus:e=>{e.currentTarget.style.outline=`2px solid ${currentTextColor}`;e.currentTarget.style.outlineOffset=\"2px\";},onBlur:e=>{e.currentTarget.style.outline=\"none\";},children:[showIcon&&iconPosition===\"before\"&&/*#__PURE__*/_jsx(\"span\",{style:{flexShrink:0,display:\"flex\",alignItems:\"center\"},children:downloadIcon}),/*#__PURE__*/_jsx(\"span\",{style:{wordWrap:\"break-word\",overflowWrap:\"break-word\",flex:1,textAlign:\"left\"},children:label}),showIcon&&iconPosition===\"after\"&&/*#__PURE__*/_jsx(\"span\",{style:{flexShrink:0,display:\"flex\",alignItems:\"center\"},children:downloadIcon})]});}addPropertyControls(FileDownloadButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Download File\"},fileUrl:{type:ControlType.File,title:\"File URL\",allowedFileTypes:[\"pdf\",\"doc\",\"docx\",\"txt\",\"jpg\",\"png\",\"mp3\",\"mp4\",\"zip\"]},fileName:{type:ControlType.String,title:\"File Name\",defaultValue:\"download.pdf\"},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},iconPosition:{type:ControlType.Enum,title:\"Icon Position\",options:[\"before\",\"after\"],optionTitles:[\"Before\",\"After\"],defaultValue:\"before\",displaySegmentedControl:true,hidden:({showIcon})=>!showIcon},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:20,min:12,max:48,step:1,unit:\"px\",hidden:({showIcon})=>!showIcon},defaultBackground:{type:ControlType.Color,title:\"Default BG\",defaultValue:\"#000000\"},defaultTextColor:{type:ControlType.Color,title:\"Default Text\",defaultValue:\"#FFFFFF\"},defaultIconColor:{type:ControlType.Color,title:\"Default Icon\",defaultValue:\"#FFFFFF\",hidden:({showIcon})=>!showIcon},defaultBorderWidth:{type:ControlType.Number,title:\"Default Border Width\",defaultValue:0,min:0,max:10,step:1,unit:\"px\"},defaultBorderColor:{type:ControlType.Color,title:\"Default Border\",defaultValue:\"#000000\"},hoverBackground:{type:ControlType.Color,title:\"Hover BG\",defaultValue:\"#333333\"},hoverTextColor:{type:ControlType.Color,title:\"Hover Text\",defaultValue:\"#FFFFFF\"},hoverIconColor:{type:ControlType.Color,title:\"Hover Icon\",defaultValue:\"#FFFFFF\",hidden:({showIcon})=>!showIcon},hoverBorderWidth:{type:ControlType.Number,title:\"Hover Border Width\",defaultValue:0,min:0,max:10,step:1,unit:\"px\"},hoverBorderColor:{type:ControlType.Color,title:\"Hover Border\",defaultValue:\"#333333\"},pressedBackground:{type:ControlType.Color,title:\"Pressed BG\",defaultValue:\"#555555\"},pressedTextColor:{type:ControlType.Color,title:\"Pressed Text\",defaultValue:\"#FFFFFF\"},pressedIconColor:{type:ControlType.Color,title:\"Pressed Icon\",defaultValue:\"#FFFFFF\",hidden:({showIcon})=>!showIcon},pressedBorderWidth:{type:ControlType.Number,title:\"Pressed Border Width\",defaultValue:0,min:0,max:10,step:1,unit:\"px\"},pressedBorderColor:{type:ControlType.Color,title:\"Pressed Border\",defaultValue:\"#555555\"},borderRadius:{type:ControlType.Number,title:\"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\"},gap:{type:ControlType.Number,title:\"Icon Gap\",defaultValue:8,min:0,max:32,step:1,unit:\"px\",hidden:({showIcon})=>!showIcon},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Semibold\",fontSize:\"14px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},ariaLabel:{type:ControlType.String,title:\"ARIA Label\",defaultValue:\"\",placeholder:\"Custom accessibility label\"},ariaDescribedBy:{type:ControlType.String,title:\"ARIA Described By\",defaultValue:\"\",placeholder:\"ID of describing element\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FileDownloadButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileDownloadButton.map"],"mappings":"+LAIG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,QAAM,UAAQ,qEAAqE,WAAS,eAAa,WAAS,WAAS,oBAAkB,mBAAiB,mBAAiB,qBAAmB,qBAAmB,kBAAgB,iBAAe,iBAAe,mBAAiB,mBAAiB,oBAAkB,mBAAiB,mBAAiB,qBAAmB,qBAAmB,eAAa,WAAS,WAAS,MAAI,OAAK,YAAU,kBAAgB,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAO,CAAC,EAAU,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