{"version":3,"file":"EmailSignup.nTrRzGWL.mjs","names":["useState","email"],"sources":["https:/framerusercontent.com/modules/BcduSKZwXooiO23kYrry/sAHyjnstqmslxIw0m2fi/EmailSignup.js"],"sourcesContent":["// Email signup component with input field and submit button that redirects to URL with email parameter\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function EmailSignup(props){const{placeholder,buttonText,baseUrl,backgroundColor,borderColor,inputTextColor,inputBackgroundColor,buttonBackgroundColor,buttonTextColor,borderRadius,inputFont,buttonFont}=props;const[email,setEmail]=useState(\"\");const[isMobile,setIsMobile]=useState(false);const[isHovered,setIsHovered]=useState(false);const[isFocused,setIsFocused]=useState(false);const[error,setError]=useState(\"\");useEffect(()=>{if(typeof window!==\"undefined\"){const checkMobile=()=>{setIsMobile(window.innerWidth<=768);};checkMobile();window.addEventListener(\"resize\",checkMobile);return()=>window.removeEventListener(\"resize\",checkMobile);}},[]);const validateEmail=email=>{const emailRegex=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;return emailRegex.test(email);};const handleSubmit=e=>{e.preventDefault();// Clear previous errors\nsetError(\"\");// Validate email is not empty\nif(!email||email.trim()===\"\"){setError(\"Please enter an email address\");return;}// Validate email format\nif(!validateEmail(email)){setError(\"Please enter a valid email address\");return;}// If validation passes, open URL\nif(typeof window!==\"undefined\"){const url=`${baseUrl}?email=${encodeURIComponent(email)}&auto_submit=true`;window.open(url,\"_blank\");}};return /*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",gap:isMobile?12:8,padding:isMobile?0:\"4px 4px 4px 14px\",backgroundColor:isMobile?\"transparent\":backgroundColor,border:isMobile?\"none\":`1px solid ${isFocused?\"#3B6CFF\":borderColor}`,borderRadius:isMobile?0:borderRadius,boxSizing:\"border-box\",flexDirection:isMobile?\"column\":\"row\",position:\"relative\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",value:email,onChange:e=>{setEmail(e.target.value);if(error)setError(\"\");},placeholder:placeholder,onFocus:()=>setIsFocused(true),onBlur:()=>setIsFocused(false),style:{flex:1,border:isMobile?`1px solid ${error?\"#FF5588\":borderColor}`:\"none\",outline:\"none\",backgroundColor:inputBackgroundColor,color:inputTextColor,...inputFont,minWidth:0,width:isMobile?\"100%\":\"auto\",padding:isMobile?\"12px 16px\":0,borderRadius:isMobile?8:0,boxSizing:\"border-box\"}}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),style:{padding:\"12px 36px\",backgroundColor:isHovered?\"#3B6CFF\":buttonBackgroundColor,color:buttonTextColor,border:\"none\",borderRadius:8,cursor:\"pointer\",whiteSpace:\"nowrap\",...buttonFont,width:isMobile?\"100%\":\"auto\",transition:\"background-color 0.2s ease\"},children:buttonText}),error&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:isMobile?\"auto\":\"-24px\",top:isMobile?\"100%\":\"auto\",left:0,marginTop:isMobile?\"4px\":0,color:\"#FF5588\",fontSize:\"12px\",fontWeight:500},children:error})]});}addPropertyControls(EmailSignup,{placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Enter your work email\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Start for free\"},baseUrl:{type:ControlType.String,title:\"Base URL\",defaultValue:\"https://app.uxify.com/getstarted\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#EEEEEE\"},inputBackgroundColor:{type:ControlType.Color,title:\"Input Background\",defaultValue:\"#FFFFFF\"},inputTextColor:{type:ControlType.Color,title:\"Input Text\",defaultValue:\"#000000\"},buttonBackgroundColor:{type:ControlType.Color,title:\"Button Background\",defaultValue:\"#0A1628\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:12,min:0,max:32,step:1,unit:\"px\"},inputFont:{type:ControlType.Font,title:\"Input Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EmailSignup\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EmailSignup.map"],"mappings":"iMAIG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,cAAY,aAAW,UAAQ,kBAAgB,cAAY,iBAAe,uBAAqB,wBAAsB,kBAAgB,eAAa,YAAU,cAAY,EAAW,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,CAAC,IAAM,MAAgB,CAAC,EAAY,EAAO,YAAY,IAAI,EAA+D,OAA5D,GAAa,CAAC,EAAO,iBAAiB,SAAS,EAAY,KAAW,EAAO,oBAAoB,SAAS,EAAY,GAAI,EAAE,CAAC,CAAC,IAAM,EAAc,GAAyB,6BAA+C,KAAKC,EAAM,CAIznB,O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