{"version":3,"file":"Email_subscribe_button_3.Clhd8d3k.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/lVOiz9efPqRr3eyPN7F5/sVotru5WM3lClNROwbaa/Email_subscribe_button_3.js"],"sourcesContent":["// Newsletter Input Button Demo - Interactive component that transforms from action button to email input form\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition,useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Email Subscription Button\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function InputButton(props){const{actionLabel,submitLabel,placeholder,background,inputBackground,inputTextColor,buttonBackground,buttonTextColor,borderRadius,font,buttonFont,arrowColor,arrowBackground,border,successColor,link,style}=props;const[value,setValue]=useState(\"\");const[submitted,setSubmitted]=useState(false);const[showInput,setShowInput]=useState(false);const containerRef=useRef(null);const iframeRef=useRef(null);useEffect(()=>{function handleClickOutside(event){if(containerRef.current&&!containerRef.current.contains(event.target)){startTransition(()=>setShowInput(false));}}if(showInput&&typeof document!==\"undefined\"){document.addEventListener(\"mousedown\",handleClickOutside);}return()=>{if(typeof document!==\"undefined\"){document.removeEventListener(\"mousedown\",handleClickOutside);}};},[showInput]);function handleInput(e){setValue(e.target.value);}function handleSubmit(e){e.preventDefault();if(!value.trim())return;console.log(\"Submitting email:\",value.trim());// Create a hidden iframe if it doesn't exist\nif(!iframeRef.current){const iframe=document.createElement(\"iframe\");iframe.name=\"hidden-form-target\";iframe.style.display=\"none\";document.body.appendChild(iframe);iframeRef.current=iframe;}// Create and submit a form targeting the hidden iframe\nconst form=document.createElement(\"form\");form.method=\"POST\";form.action=\"https://hooks.attio.com/w/3753f793-54f0-4244-82dc-31cec1b669a9/aa38caa6-bbf3-4da3-afb6-e97d10485bec\";form.target=\"hidden-form-target\";const emailInput=document.createElement(\"input\");emailInput.type=\"hidden\";emailInput.name=\"email\";emailInput.value=value.trim();form.appendChild(emailInput);document.body.appendChild(form);form.submit();document.body.removeChild(form);// Show success state\nstartTransition(()=>setSubmitted(true));// Reset after showing success\nsetTimeout(()=>{startTransition(()=>{setSubmitted(false);setValue(\"\");setShowInput(false);});},2e3);}function handleKeyDown(e){if(e.key===\"Escape\"&&showInput){setShowInput(false);}}return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...style,width:\"100%\",height:\"100%\",background,borderRadius,display:\"flex\",alignItems:\"center\",justifyContent:!showInput?\"center\":\"space-between\",padding:showInput?4:0,boxSizing:\"border-box\",position:\"relative\",overflow:\"hidden\",boxShadow:showInput?\"0 4px 20px rgba(0,0,0,0.12)\":\"0 2px 12px rgba(0,0,0,0.07)\",transition:\"box-shadow 0.15s ease, background 0.1s ease\",cursor:!showInput?\"pointer\":\"default\",...border},\"aria-label\":\"Newsletter signup\",onClick:()=>{if(!showInput){setShowInput(true);}},children:/*#__PURE__*/_jsx(AnimatePresence,{initial:false,mode:\"wait\",children:!showInput?/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,ease:\"easeOut\"},style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",height:\"100%\",padding:\"0 20px\",...font,color:\"#FFFFFF\",fontSize:font?.fontSize||16,fontWeight:font?.fontWeight||500,whiteSpace:\"nowrap\",overflow:\"hidden\",textOverflow:\"ellipsis\"},\"aria-label\":actionLabel,children:[actionLabel,/*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-flex\",alignItems:\"center\",marginLeft:12,background:arrowBackground,borderRadius:Math.min(borderRadius,6),padding:\"6px 10px\",transition:\"all 0.2s ease\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 18 18\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M6 4.5L11.25 9L6 13.5\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]},\"action\"):/*#__PURE__*/_jsxs(motion.form,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,ease:\"easeOut\"},onSubmit:handleSubmit,style:{display:\"flex\",alignItems:\"center\",width:\"100%\",gap:8},children:[/*#__PURE__*/_jsx(motion.input,{type:\"email\",value:value,onChange:handleInput,placeholder:placeholder,required:true,autoFocus:true,style:{flex:1,minWidth:0,border:\"none\",outline:\"none\",background:inputBackground,color:inputTextColor,padding:\"14px 16px\",borderRadius:Math.min(borderRadius,8),fontSize:font?.fontSize||16,fontFamily:font?.fontFamily||\"inherit\",fontWeight:font?.fontWeight||400,boxShadow:\"inset 0 1px 3px rgba(0,0,0,0.06)\",transition:\"box-shadow 0.2s ease\"},\"aria-label\":\"Email address\",initial:{opacity:1,x:0},animate:{opacity:1,x:0},transition:{duration:.05,ease:\"easeOut\"},onFocus:e=>{e.target.style.boxShadow=\"inset 0 1px 3px rgba(0,0,0,0.1), 0 0 0 2px rgba(59, 130, 246, 0.15)\";},onBlur:e=>{e.target.style.boxShadow=\"inset 0 1px 3px rgba(0,0,0,0.06)\";}}),/*#__PURE__*/_jsx(motion.button,{type:\"submit\",disabled:submitted||!value.trim(),style:{background:submitted?successColor:!value.trim()?\"#9CA3AF\":buttonBackground,color:buttonTextColor,border:\"none\",borderRadius:Math.min(borderRadius,8),padding:props.buttonPadding||\"14px 20px\",cursor:submitted||!value.trim()?\"not-allowed\":\"pointer\",fontFamily:buttonFont?.fontFamily||font?.fontFamily||\"inherit\",fontSize:buttonFont?.fontSize||16,fontWeight:buttonFont?.fontWeight||600,transition:\"all 0.2s ease\",boxShadow:\"0 2px 8px rgba(0,0,0,0.1)\",minWidth:80,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},\"aria-label\":submitted?\"Subscribed successfully\":submitLabel,initial:{opacity:1,x:0},animate:{opacity:1,x:0},transition:{duration:.05,ease:\"easeOut\"},whileHover:!submitted&&value.trim()?{scale:1.02,boxShadow:\"0 4px 12px rgba(0,0,0,0.15)\"}:{},whileTap:!submitted&&value.trim()?{scale:.98}:{},children:submitted?/*#__PURE__*/_jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:{type:\"tween\",duration:.1,ease:\"easeOut\"},children:\"✓\"}):submitLabel})]},\"input\")})});}addPropertyControls(InputButton,{actionLabel:{type:ControlType.String,title:\"Action Label\",defaultValue:\"Join our newsletter\"},submitLabel:{type:ControlType.String,title:\"Submit Label\",defaultValue:\"Subscribe\"},placeholder:{type:ControlType.String,title:\"Email Placeholder\",defaultValue:\"Enter your email\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},inputBackground:{type:ControlType.Color,title:\"Input Background\",defaultValue:\"#F8F9FA\"},inputTextColor:{type:ControlType.Color,title:\"Input Text Color\",defaultValue:\"#1F2937\"},buttonBackground:{type:ControlType.Color,title:\"Button Background\",defaultValue:\"#3B82F6\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text Color\",defaultValue:\"#FFFFFF\"},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:1,borderStyle:\"solid\",borderColor:\"rgba(0, 0, 0, 0.1)\"}},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:12,min:0,max:32,step:1,displayStepper:true},font:{type:ControlType.Font,title:\"Main Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},buttonPadding:{type:ControlType.String,title:\"Button Padding\",defaultValue:\"14px 20px\",placeholder:\"e.g. 14px 20px\"},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#FFFFFF\"},arrowBackground:{type:ControlType.Color,title:\"Arrow Background\",defaultValue:\"#1F2937\"},successColor:{type:ControlType.Color,title:\"Success Color\",defaultValue:\"#10B981\"},link:{type:ControlType.Link,title:\"Submit Link\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"InputButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"60\",\"framerIntrinsicWidth\":\"400\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Email_subscribe_button_3.map"],"mappings":"8PASG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,cAAY,cAAY,cAAY,aAAW,kBAAgB,iBAAe,mBAAiB,kBAAgB,eAAa,OAAK,aAAW,aAAW,kBAAgB,SAAO,eAAa,OAAK,SAAO,EAAW,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAaC,EAAO,KAAK,CAAO,EAAUA,EAAO,KAAK,CAAC,MAAc,CAAC,SAAS,EAAmB,EAAM,CAAI,EAAa,SAAS,CAAC,EAAa,QAAQ,SAAS,EAAM,OAAO,EAAE,MAAoB,EAAa,GAAM,CAAC,CAA2G,OAArG,GAAW,OAAO,SAAW,KAAa,SAAS,iBAAiB,YAAY,EAAmB,KAAY,CAAI,OAAO,SAAW,KAAa,SAAS,oBAAoB,YAAY,EAAmB,GAAM,CAAC,EAAU,CAAC,CAAC,SAAS,EAAY,EAAE,CAAC,EAAS,EAAE,OAAO,MAAM,CAAE,SAAS,EAAa,EAAE,CAAoB,GAAnB,EAAE,gBAAgB,CAAI,CAAC,EAAM,MAAM,CAAC,OACp7B,GAD27B,QAAQ,IA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