{"version":3,"file":"PhoneNumberInput.DF0EL4Dh.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/sRu6lxMLJUcbHhfgmJ5c/IT1mpNEXJ8LlYRShLJyT/PhoneNumberInput.js"],"sourcesContent":["// Phone number input with country code picker for forms\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useMemo,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const countryOptions=[{code:\"+33\",label:\"🇫🇷\"}];/**\n * Phone Number Input with Country Code Picker\n *\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 56\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function PhoneNumberInput(props){const{placeholder,country,value,background,textColor,borderColor,font,onChange,style}=props;const[selectedCountry,setSelectedCountry]=useState(country);const[inputValue,setInputValue]=useState(value);const handleCountryChange=e=>{startTransition(()=>setSelectedCountry(e.target.value));};const handleInputChange=e=>{const val=e.target.value.replace(/[^0-9\\s\\-]/g,\"\");startTransition(()=>setInputValue(val));if(onChange)onChange(val);};const countryLabel=useMemo(()=>{const found=countryOptions.find(c=>c.code===selectedCountry);return found?found.label:countryOptions[0].label;},[selectedCountry]);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",minHeight:40,background,border:`1px solid ${borderColor}`,display:\"flex\",alignItems:\"center\",padding:8,gap:8,boxSizing:\"border-box\",position:\"relative\"},children:[/*#__PURE__*/_jsx(\"select\",{value:selectedCountry,onChange:handleCountryChange,style:{border:\"none\",background:\"transparent\",color:\"#999\",fontSize:16,outline:\"none\",minWidth:70,...font},\"aria-label\":\"Country code\",children:countryOptions.map(c=>/*#__PURE__*/_jsxs(\"option\",{value:c.code,children:[c.label,\" \",c.code]},c.code))}),/*#__PURE__*/_jsx(\"div\",{style:{width:1,height:32,background:\"#EEE\",margin:\"0 8px\"}}),/*#__PURE__*/_jsx(\"input\",{id:\"phone-input\",name:\"phone\",type:\"tel\",value:inputValue,onChange:handleInputChange,placeholder:placeholder,style:{flex:1,border:\"none\",outline:\"none\",background:\"transparent\",color:textColor,fontSize:16,...font,\"::placeholder\":{color:\"#999999\"}},\"aria-label\":\"Phone number\",autoComplete:\"tel\",required:true}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"form_url\",value:\"\"})]});}addPropertyControls(PhoneNumberInput,{placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Num\\xe9ro de t\\xe9l\\xe9phone\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#EEEEEE\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\",fontFamily:\"Roboto\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PhoneNumberInput\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"56\",\"framerIntrinsicWidth\":\"320\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PhoneNumberInput.map"],"mappings":"wRASG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,cAAY,UAAQ,QAAM,aAAW,YAAU,cAAY,OAAK,WAAS,SAAO,EAAW,CAAC,EAAgB,GAAoBA,EAAS,EAAQ,CAAM,CAAC,EAAW,GAAeA,EAAS,EAAM,CAAO,EAAoB,GAAG,CAAC,MAAoB,EAAmB,EAAE,OAAO,MAAM,CAAC,EAAS,EAAkB,GAAG,CAAC,IAAM,EAAI,EAAE,OAAO,MAAM,QAAQ,cAAc,GAAG,CAAC,MAAoB,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