{"version":3,"file":"Button.CTJFJWNv.mjs","names":["useState","useRef","colors.gray800","colors.white","colors.red500","colors.gray100"],"sources":["https:/framerusercontent.com/modules/IbnR7OmyIrJARuir5R6M/mJSsInAz7mu9GIBWvZUp/Button.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";import{addPropertyControls,ControlType,Link}from\"framer\";import styled from\"styled-components\";import*as colors from\"https://framerusercontent.com/modules/xZeGYMcYRIPgzMi948rf/X6AEdKQEPsnZ12qm8wuz/styles.js\";import{isMobile}from\"https://framerusercontent.com/modules/FfJ3mEyKLVOIlc3HDCcx/zxzUhkOXpgeu9JtfnFLA/utils.js\";export default function Button({id=\"\",utm=\"\",type=\"button\",variant=\"primary\",size=\"regular\",width=\"auto\",label=\"My Button\",link=\"\",isSignup=false,openInNewTab=false,announceNewTab=false}){//\n// TODO : 12/18\n// Figure out how to add pressed and focus states to this component\n//\nconst[hoverClasses,setHoverClasses]=useState({});const signupLinkRef=useRef(null);const variants={primary:{background:colors.gray800,color:colors.white,hover:{background:colors.red500}},secondary:{background:colors.white,color:colors.gray800,border:`1.5px solid ${colors.gray800}`,hover:{background:colors.gray100}},tertiary:{background:\"none\",color:colors.gray800,hover:{background:colors.gray100}},primaryOnDark:{background:colors.white,color:colors.gray800,hover:{background:colors.gray100}}};const sizes={regular:{height:\"48px\",padding:\"16px 20px\",fontSize:\"16px\"},small:{height:\"40px\",padding:\"12px 16px\",fontSize:\"14px\"},large:{height:\"56px\",padding:\"16px 20px\",fontSize:\"18px\"}};function handleOnMouseOver(){setHoverClasses(variants[variant].hover);}function handleOnMouseLeave(){setHoverClasses({});}function getSignupUrl(){if(typeof window!==\"undefined\"&&(window.location.hostname===\"www.root-drop-399256.framer.app\"||window.location.hostname===\"root-drop-399256.framer.app\"||window.location.hostname===\"www.rocketmoney.dev\"||window.location.hostname===\"rocketmoney.dev\")){return\"https://app.rocketmoney.dev/signup\";}return\"https://app.rocketmoney.com/signup\";}useEffect(()=>{if(isSignup){if(window.location.hostname===\"www.root-drop-399256.framer.app\"||window.location.hostname===\"root-drop-399256.framer.app\"||window.location.hostname===\"www.rocketmoney.dev\"||window.location.hostname===\"rocketmoney.dev\"){const anchor=signupLinkRef.current;anchor.href=\"https://app.rocketmoney.dev/signup\";}assignSingularLink();}},[]);async function assignSingularLink(){if(isMobile()&&typeof truebill!==\"undefined\"){const singular=await truebill.singular.getSingularSDKInstance();signupLinkRef.current.href=singular.buildWebToAppLink(\"https://truebill.sng.link/A772e/vr6r\");}}const button=/*#__PURE__*/_jsx(ButtonContainer,{type:type,tabIndex:-1,onMouseOver:handleOnMouseOver,onMouseLeave:handleOnMouseLeave,style:{...width===\"full\"?{width:\"1fr\"}:{},...variants[variant],...sizes[size],...hoverClasses},children:label});const linkContent=/*#__PURE__*/_jsx(LinkVisual,{style:{...width===\"full\"?{width:\"1fr\"}:{},...variants[variant],...sizes[size],...hoverClasses},children:label});const baseSignupUrl=\"https://app.rocketmoney.com/signup\";const linkWithUtm=utm?`${baseSignupUrl}?${utm}`:baseSignupUrl;if(isSignup){return /*#__PURE__*/_jsx(Href,{id:id,ref:signupLinkRef,href:linkWithUtm,onMouseOver:handleOnMouseOver,onMouseLeave:handleOnMouseLeave,children:linkContent});}if(type===\"submit\"){return button;}if(openInNewTab){return /*#__PURE__*/_jsxs(Href,{id:id,href:link,target:\"_blank\",rel:\"noopener noreferrer\",onMouseOver:handleOnMouseOver,onMouseLeave:handleOnMouseLeave,children:[linkContent,announceNewTab&&/*#__PURE__*/_jsx(VisuallyHidden,{children:\" (opens in new tab)\"})]});}return /*#__PURE__*/_jsx(Link,{href:link,style:{cursor:\"pointer\"},children:/*#__PURE__*/_jsx(InternalLinkWrapper,{id:id,onMouseOver:handleOnMouseOver,onMouseLeave:handleOnMouseLeave,children:linkContent})});}const Href=styled.a`\n    cursor: pointer;\n    text-decoration: none;\n    border-radius: 100px;\n    overflow: visible;\n`;const InternalLinkWrapper=styled.span`\n    text-decoration: none;\n    border-radius: 100px;\n    overflow: visible;\n`;const ButtonContainer=styled.button`\n    cursor: pointer;\n    font-weight: 500;\n    border-radius: 100px;\n    border: none;\n    font-family: 'Wintle Text Medium', sans-serif;\n    display: flex;\n    align-items: center;\n    transition: background 200ms;\n    justify-content: center;\n`;const LinkVisual=styled.span`\n    cursor: pointer;\n    font-weight: 500;\n    border-radius: 100px;\n    border: none;\n    font-family: 'Wintle Text Medium', sans-serif;\n    display: flex;\n    align-items: center;\n    transition: background 200ms;\n    justify-content: center;\n`;const VisuallyHidden=styled.span`\n    position: absolute;\n    width: 1px;\n    height: 1px;\n    padding: 0;\n    margin: -1px;\n    overflow: hidden;\n    clip: rect(0, 0, 0, 0);\n    white-space: nowrap;\n    border: 0;\n`;addPropertyControls(Button,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"My Button\"},type:{type:ControlType.Enum,options:[\"button\",\"submit\"],optionTitles:[\"Button\",\"Submit\"],defaultValue:\"button\"},variant:{type:ControlType.Enum,options:[\"primary\",\"primaryOnDark\",\"secondary\",\"tertiary\"],optionTitles:[\"Primary\",\"Primary On Dark\",\"Secondary\",\"Tertiary\"],defaultValue:\"primary\"},size:{type:ControlType.Enum,options:[\"regular\",\"small\",\"large\"],optionTitles:[\"Regular\",\"Small\",\"Large\"],defaultValue:\"regular\"},width:{type:ControlType.Enum,options:[\"auto\",\"full\"],optionTitles:[\"Auto\",\"Full\"],defaultValue:\"auto\"},id:{type:ControlType.String,title:\"Id\",defaultValue:\"\"},isSignup:{type:ControlType.Boolean,title:\"Signup\",defaultValue:false},utm:{type:ControlType.String,title:\"UTM\",defaultValue:\"\",hidden(props){return props.isSignup===false;}},link:{type:ControlType.Link,title:\"Link\",hidden(props){return props.isSignup;}},openInNewTab:{type:ControlType.Boolean,title:\"New Tab\",description:\"Intended for external destinations.\",defaultValue:false,hidden(props){return props.isSignup||props.type===\"submit\";}},announceNewTab:{type:ControlType.Boolean,title:\"Announce\",defaultValue:false,hidden(props){return props.isSignup||props.type===\"submit\"||props.openInNewTab===false;}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Button\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Button.map"],"mappings":"gTAAqa,SAAwB,EAAO,CAAC,KAAG,GAAG,MAAI,GAAG,OAAK,SAAS,UAAQ,UAAU,OAAK,UAAU,QAAM,OAAO,QAAM,YAAY,OAAK,GAAG,WAAS,GAAM,eAAa,GAAM,iBAAe,IAAO,CAIhmB,GAAK,CAAC,EAAa,GAAiBA,EAAS,CAAC,CAAC,EAAQ,EAAcC,EAAO,IAAI,EAAQ,EAAS,CAAC,QAAQ,CAAC,WAAWC,EAAe,MAAMC,EAAa,MAAM,CAAC,WAAWC,CAAa,CAAC,EAAE,UAAU,CAAC,WAAWD,EAAa,MAAMD,EAAe,OAAO,eAAeA,IAAiB,MAAM,CAAC,WAAWG,CAAc,CAAC,EAAE,SAAS,CAAC,WAAW,OAAO,MAAMH,EAAe,MAAM,CAAC,WAAWG,CAAc,CAAC,EAAE,cAAc,CAAC,WAAWF,EAAa,MAAMD,EAAe,MAAM,CAAC,WAAWG,CAAc,CAAC,CAAC,EAAQ,EAAM,CAAC,QAAQ,CAAC,OAAO,OAAO,QAAQ,YAAY,SAAS,MAAM,EAAE,MAAM,CAAC,OAAO,OAAO,QAAQ,YAAY,SAAS,MAAM,EAAE,MAAM,CAAC,OAAO,OAAO,QAAQ,YAAY,SAAS,MAAM,CAAC,EAAE,SAAS,GAAmB,CAAC,EAAgB,EAAS,EAAQ,CAAC,KAAK,CAAE,CAAC,SAAS,GAAoB,CAAC,EAAgB,CAAC,CAAC,CAAE,CAA2W,MAAc,CAAC,GAAG,EAAS,CAAC,GAAG,EAAO,SAAS,WAAW,mCAAmC,EAAO,SAAS,WAAW,+BAA+B,EAAO,SAAS,WAAW,uBAAuB,EA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