{"version":3,"file":"NewsletterForm.BZP9IBtn.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/QjLoFRtiIoxCgdphGiGA/1LWxLogfnQLaY3UJ2gfQ/NewsletterForm.js"],"sourcesContent":["// Newsletter form for subscribing to Buttondown\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,startTransition}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function NewsletterForm(props){const{formAction=\"https://buttondown.com/api/emails/embed-subscribe/beginnersapprenticeship\",labelText,placeholderText,submitButtonText,showPoweredBy,poweredByText,poweredByLink,backgroundColor,textColor,inputBackgroundColor,inputTextColor,inputBorderColor,buttonBackgroundColor,buttonTextColor,borderRadius,labelFont,inputFont,buttonFont,poweredByFont,hiddenTagValue,style}=props;const[email,setEmail]=useState(\"\");const[isHovered,setIsHovered]=useState(false);return /*#__PURE__*/_jsxs(\"form\",{action:formAction,method:\"post\",className:\"embeddable-buttondown-form\",style:{...style,position:\"relative\",display:\"flex\",flexDirection:\"column\",gap:12,padding:24,backgroundColor,borderRadius},children:[/*#__PURE__*/_jsx(\"label\",{htmlFor:\"bd-email\",style:{color:textColor,...labelFont},children:labelText}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"email\",id:\"bd-email\",placeholder:placeholderText,value:email,onChange:e=>startTransition(()=>setEmail(e.target.value)),required:true,style:{padding:\"12px 16px\",backgroundColor:inputBackgroundColor,color:inputTextColor,border:`1px solid ${inputBorderColor}`,borderRadius,outline:\"none\",...inputFont}}),/*#__PURE__*/_jsx(\"input\",{type:\"submit\",value:submitButtonText,onMouseEnter:()=>startTransition(()=>setIsHovered(true)),onMouseLeave:()=>startTransition(()=>setIsHovered(false)),style:{padding:\"12px 24px\",backgroundColor:buttonBackgroundColor,color:buttonTextColor,border:\"none\",borderRadius,cursor:\"pointer\",opacity:isHovered?.9:1,transition:\"opacity 0.2s ease\",...buttonFont}}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"tag\",value:hiddenTagValue}),showPoweredBy&&/*#__PURE__*/_jsx(\"p\",{style:{margin:0,textAlign:\"center\",...poweredByFont},children:/*#__PURE__*/_jsx(\"a\",{href:poweredByLink,target:\"_blank\",rel:\"noopener noreferrer\",style:{color:textColor,textDecoration:\"none\",opacity:.7},children:poweredByText})})]});}addPropertyControls(NewsletterForm,{formAction:{type:ControlType.String,title:\"Form Action URL\",defaultValue:\"https://buttondown.com/api/emails/embed-subscribe/beginnersapprenticeship\"},labelText:{type:ControlType.String,title:\"Label Text\",defaultValue:\"Enter your email\"},placeholderText:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"your@email.com\"},submitButtonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Subscribe\"},hiddenTagValue:{type:ControlType.String,title:\"Hidden Tag Value\",defaultValue:\"sub_tag_0n6gc74apz8aw8bh8mkw5gk6e7\"},showPoweredBy:{type:ControlType.Boolean,title:\"Show Powered By\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},poweredByText:{type:ControlType.String,title:\"Powered By Text\",defaultValue:\"Powered by Buttondown.\",hidden:({showPoweredBy})=>!showPoweredBy},poweredByLink:{type:ControlType.String,title:\"Powered By Link\",defaultValue:\"https://buttondown.com/refer/beginnersapprenticeship\",hidden:({showPoweredBy})=>!showPoweredBy},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},inputBackgroundColor:{type:ControlType.Color,title:\"Input Background\",defaultValue:\"#F5F5F5\"},inputTextColor:{type:ControlType.Color,title:\"Input Text\",defaultValue:\"#000000\"},inputBorderColor:{type:ControlType.Color,title:\"Input Border\",defaultValue:\"#EEEEEE\"},buttonBackgroundColor:{type:ControlType.Color,title:\"Button Background\",defaultValue:\"#000000\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},inputFont:{type:ControlType.Font,title:\"Input Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},poweredByFont:{type:ControlType.Font,title:\"Powered By Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"12px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},hidden:({showPoweredBy})=>!showPoweredBy}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NewsletterForm\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NewsletterForm.map"],"mappings":"wLAIG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,aAAW,4EAA4E,YAAU,kBAAgB,mBAAiB,gBAAc,gBAAc,gBAAc,kBAAgB,YAAU,uBAAqB,iBAAe,mBAAiB,wBAAsB,kBAAgB,eAAa,YAAU,YAAU,aAAW,gBAAc,iBAAe,SAAO,EAAW,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAC,OAAoB,EAAM,OAAO,CAAC,OAAO,EAAW,OAAO,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