{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/u3dwKaaj1MpcY9x5oA1Z/39MViC8Dv19BuSoJOXzL/CustomButton.js"],
  "sourcesContent": ["// This component renders a customizable button for Framer, allowing users to download a file or open a link with various style and hover effects.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsOnFramerCanvas}from\"framer\";import{isBrowser,motion}from\"framer-motion\";var IconType;// Enumeration for icon types: Default or Custom.\n(function(IconType){IconType[\"Default\"]=\"Default\";IconType[\"Custom\"]=\"Custom\";})(IconType||(IconType={}));var SrcType;// Enumeration for source types: Upload or URL.\n(function(SrcType){SrcType[\"Upload\"]=\"Upload\";SrcType[\"URL\"]=\"URL\";})(SrcType||(SrcType={}));// Selector for the meta tag used to determine if the site is published or statically generated.\nconst metaTagSelector='meta[name=\"framer-search-index\"]';// Function to check if the current environment is a published site or SSG.\nfunction isPublishedSiteOrSSG(){if(typeof document===\"undefined\"){return true;}const metaTag=document.querySelector(metaTagSelector);return metaTag!==null;}export default function CustomButton(props){// Destructure properties from props for easier access.\nconst{text,srcType,srcURL,srcFile,autoOpen,openInNewTab,showIcon,iconOptions,styleOptions,hoverOptions,style}=props;// Destructure style options.\nconst{backgroundColor,color,borderRadius,padding,paddingPerSide,paddingTop,paddingRight,paddingBottom,paddingLeft,gap,fontControl,underline}=styleOptions;// Determine if the component is being rendered on the Framer Canvas.\nconst isOnFramerCanvas=useIsOnFramerCanvas();// Check if the site is published or statically generated.\nconst isInPublishedSiteOrSSG=isPublishedSiteOrSSG();// Determine the action URL based on the source type and publication status.\nlet actionURL=undefined;if(isInPublishedSiteOrSSG){if(srcType===\"URL\"){actionURL=srcURL;}else if(srcType===\"Upload\"){actionURL=srcFile;}}// Automatically open the URL if the autoOpen flag is true and conditions are met.\nif(autoOpen&&isBrowser&&!isOnFramerCanvas&&actionURL){window.location.href=actionURL;}// Calculate the padding value based on whether padding per side is enabled.\nconst paddingValue=paddingPerSide?`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`:`${padding}px`;// Function to get the icon element based on the icon options.\nconst getIcon=()=>{if(!iconOptions||!showIcon){return null;}const iconStyle={order:iconOptions.alignment===\"start\"?0:2,flexShrink:0};if(iconOptions.type===\"Custom\"&&iconOptions.image.src){return /*#__PURE__*/_jsx(\"img\",{style:iconStyle,alt:iconOptions.image.alt&&iconOptions.image.alt.length>0?iconOptions.image.alt:\"Download icon\",src:iconOptions.image.src,width:iconOptions.size,height:iconOptions.size});}else{return /*#__PURE__*/_jsx(\"svg\",{style:iconStyle,xmlns:\"http://www.w3.org/2000/svg\",width:iconOptions.size,height:iconOptions.size,fill:iconOptions.color,viewBox:\"0 0 256 256\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M228 152v56a20 20 0 0 1-20 20H48a20 20 0 0 1-20-20v-56a12 12 0 0 1 24 0v52h152v-52a12 12 0 0 1 24 0Zm-108.49 8.49a12 12 0 0 0 17 0l40-40a12 12 0 0 0-17-17L140 123V40a12 12 0 0 0-24 0v83l-19.51-19.49a12 12 0 0 0-17 17Z\"})});}};// Function to determine the cursor style based on the availability of the action URL.\nconst getCursor=()=>{return actionURL?\"pointer\":\"auto\";};// Set the button title based on the publication status.\nconst buttonTitle=isInPublishedSiteOrSSG?\"Download File\":\"Publish to Download\";// Consolidated styles for the button.\nconst buttonStyle={gap:gap,fontSize:18,lineHeight:1.5,fontFamily:\"Montserrat\",fontWeight:700,width:\"max-content\",...style,...buttonStyles,...fontControl,padding:paddingValue,color:color,backgroundColor:backgroundColor,borderRadius:borderRadius,userSelect:\"none\",placeContent:flexAlignSwitch(fontControl),whiteSpace:\"nowrap\",cursor:getCursor(),textDecoration:underline?\"underline\":\"none\"};// Consolidated hover effects.\nconst hoverEffect={scale:hoverOptions.scale,backgroundColor:hoverOptions.backgroundColor,color:hoverOptions.color,cursor:\"pointer\"};// Render the download button with styles and hover effects.\nreturn /*#__PURE__*/_jsxs(motion.a,{target:openInNewTab?\"_blank\":\"_self\",href:actionURL,download:srcType===\"Upload\"?true:undefined,title:buttonTitle,style:buttonStyle,whileHover:hoverEffect,transition:hoverOptions.transition,children:[getIcon(),text]});}CustomButton.displayName=\"Button (Custom) CC\";CustomButton.defaultProps={text:\"Download\",srcType:\"Upload\",srcURL:\"\",srcFile:\"\",autoOpen:false,openInNewTab:true,showIcon:true,iconOptions:{type:\"Default\",color:\"#FFF\",image:{src:\"\",alt:\"\"},size:16,alignment:\"start\"},styleOptions:{backgroundColor:\"#000000\",color:\"#FFF\",borderRadius:32,padding:10,paddingPerSide:false,paddingTop:10,paddingRight:10,paddingBottom:10,paddingLeft:10,gap:8,fontControl:{fontFamily:\"Arial\",fontSize:18,fontWeight:700,textAlign:\"center\",color:\"#FFF\"},underline:false},hoverOptions:{scale:1.1,backgroundColor:\"#333\",color:\"#FFF\",transition:{type:\"spring\",stiffness:400,damping:30}}};addPropertyControls(CustomButton,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"Download\",description:\"Button label text.\"},srcType:{type:ControlType.Enum,displaySegmentedControl:true,title:\"Source\",options:[\"URL\",\"Upload\"],description:\"Choose the source of the file or link.\"},srcURL:{type:ControlType.String,title:\"URL\",placeholder:\"https://example.com\",hidden(props){return props.srcType===\"Upload\";},description:\"URL to open or download.\"},srcFile:{type:ControlType.File,title:\"File\",allowedFileTypes:[],hidden(props){return props.srcType===\"URL\";},description:\"Upload the file to be downloaded.\"},autoOpen:{type:ControlType.Boolean,title:\"Auto Open\",defaultValue:false,description:\"Automatically open the link or start the download on page load.\"},openInNewTab:{type:ControlType.Boolean,title:\"Open in New Tab\",defaultValue:true,description:\"Open the link in a new tab.\"},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true,description:\"Display an icon next to the button text.\"},iconOptions:{type:ControlType.Object,optional:true,title:\"Icon\",buttonTitle:\"Customize Icon\",controls:{type:{title:\"Type\",type:ControlType.Enum,options:Object.values(IconType),optionTitles:Object.values(IconType),displaySegmentedControl:true,description:\"Choose between default or custom icon.\"},color:{title:\"Color\",type:ControlType.Color,defaultValue:\"#FFF\",hidden(props){return props.type===\"Custom\";},description:\"Color of the default icon.\"},image:{title:\"File\",type:ControlType.ResponsiveImage,allowedFileTypes:[\"jpg\",\"png\",\"svg\"],hidden(props){return props.type===\"Default\";},description:\"Upload a custom icon image.\"},size:{type:ControlType.Number,displayStepper:true,min:5,defaultValue:16,max:250,title:\"Size\",description:\"Size of the icon.\"},alignment:{title:\"Align\",type:ControlType.Enum,displaySegmentedControl:true,options:[\"start\",\"end\"],optionTitles:[\"Start\",\"End\"],description:\"Alignment of the icon relative to the text.\"}},hidden(props){return!props.showIcon;}},styleOptions:{type:ControlType.Object,title:\"Styles\",buttonTitle:\"Customize Styles\",controls:{fontControl:{type:ControlType.Font,title:\"Font\",controls:\"extended\",description:\"Customize the font style.\"},backgroundColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#000000\",description:\"Background color of the button.\"},color:{type:ControlType.Color,defaultValue:\"#FFF\",title:\"Text Color\",description:\"Color of the button text.\"},borderRadius:{type:ControlType.Number,title:\"Radius\",displayStepper:true,defaultValue:32,description:\"Border radius of the button.\"},padding:{title:\"Padding\",type:ControlType.FusedNumber,toggleKey:\"paddingPerSide\",toggleTitles:[\"Padding\",\"Padding per side\"],defaultValue:10,valueKeys:[\"paddingTop\",\"paddingRight\",\"paddingBottom\",\"paddingLeft\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0,description:\"Padding inside the button.\"},gap:{title:\"Gap\",type:ControlType.Number,displayStepper:true,defaultValue:8,description:\"Gap between the icon and text.\"},underline:{type:ControlType.Boolean,title:\"Underline\",defaultValue:false,description:\"Toggle underline on/off\"}}},hoverOptions:{type:ControlType.Object,title:\"Hover Effect\",buttonTitle:\"Customize Hover\",optional:true,controls:{scale:{type:ControlType.Number,title:\"Scale\",min:0,max:10,displayStepper:true,step:.01,defaultValue:1.1,description:\"Scale of the button on hover.\"},backgroundColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#333\",optional:true,description:\"Background color on hover.\"},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFF\",optional:true,description:\"Text color on hover.\"},transition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{type:\"spring\",stiffness:400,damping:30},description:\"Transition effect for the hover state.\"}}}});const buttonStyles={display:\"flex\",placeItems:\"center\",placeContent:\"center\",textDecoration:\"none\"};// Function to match flex content alignment with text alignment.\nfunction flexAlignSwitch(fontControlStyles){if(fontControlStyles?.textAlign===\"left\"){return\"flex-start\";}if(fontControlStyles?.textAlign===\"right\"){return\"flex-end\";}return\"center\";}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomButton.map"],
  "mappings": "2KAAAA,IAC6K,IAAIC,GAChL,SAASA,EAAS,CAACA,EAAS,QAAW,UAAUA,EAAS,OAAU,QAAS,GAAGA,IAAWA,EAAS,CAAC,EAAE,EAAE,IAAIC,GAC7G,SAASA,EAAQ,CAACA,EAAQ,OAAU,SAASA,EAAQ,IAAO,KAAM,GAAGA,IAAUA,EAAQ,CAAC,EAAE,EAC3F,IAAMC,EAAgB,mCACtB,SAASC,GAAsB,CAAC,OAAG,OAAO,SAAW,IAAoB,GAAoB,SAAS,cAAcD,CAAe,IAAmB,IAAK,CAAgB,SAARE,EAA8BC,EAAM,CACvM,GAAK,CAAC,KAAAC,EAAK,QAAAC,EAAQ,OAAAC,EAAO,QAAAC,EAAQ,SAAAC,EAAS,aAAAC,EAAa,SAAAC,EAAS,YAAAC,EAAY,aAAAC,EAAa,aAAAC,EAAa,MAAAC,CAAK,EAAEX,EACzG,CAAC,gBAAAY,EAAgB,MAAAC,EAAM,aAAAC,EAAa,QAAAC,EAAQ,eAAAC,EAAe,WAAAC,EAAW,aAAAC,EAAa,cAAAC,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WAAW,CAAC,KAAKA,EAAY,WAAW,MAAM,aAAa,aAAa,CAAC,KAAK,SAAS,UAAU,IAAI,QAAQ,EAAE,EAAE,YAAY,wCAAwC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAMN,EAAa,CAAC,QAAQ,OAAO,WAAW,SAAS,aAAa,SAAS,eAAe,MAAM,EAC1qJ,SAASC,EAAgBM,EAAkB,CAAC,OAAGA,GAAmB,YAAY,OAAc,aAAiBA,GAAmB,YAAY,QAAe,WAAkB,QAAS",
  "names": ["init_ssg_sandbox_shims", "IconType", "SrcType", "metaTagSelector", "isPublishedSiteOrSSG", "CustomButton", "props", "text", "srcType", "srcURL", "srcFile", "autoOpen", "openInNewTab", "showIcon", "iconOptions", "styleOptions", "hoverOptions", "style", "backgroundColor", "color", "borderRadius", "padding", "paddingPerSide", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "gap", "fontControl", "underline", "isOnFramerCanvas", "useIsOnFramerCanvas", "isInPublishedSiteOrSSG", "actionURL", "isBrowser", "paddingValue", "getIcon", "iconStyle", "p", "getCursor", "buttonTitle", "buttonStyle", "buttonStyles", "flexAlignSwitch", "hoverEffect", "u", "motion", "addPropertyControls", "ControlType", "fontControlStyles"]
}
