@mirantes-micro/foundation-design-system 1.2.404 → 1.2.406
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/121.bundle.js +2 -0
- package/dist/121.bundle.js.map +1 -0
- package/dist/310.bundle.js +3 -0
- package/dist/310.bundle.js.LICENSE.txt +6 -0
- package/dist/310.bundle.js.map +1 -0
- package/dist/874.bundle.js +3 -0
- package/dist/874.bundle.js.LICENSE.txt +1 -0
- package/dist/874.bundle.js.map +1 -0
- package/dist/bundle.js +3769 -0
- package/dist/bundle.js.LICENSE.txt +403 -0
- package/dist/bundle.js.map +1 -0
- package/dist/images/layers-2x.8f2c4d11474275fbc1614b9098334eae.png +0 -0
- package/dist/images/layers.416d91365b44e4b4f4777663e6f009f3.png +0 -0
- package/dist/images/marker-icon.2b3e1faf89f94a4835397e7a43b4f77d.png +0 -0
- package/dist/index.html +1 -0
- package/package.json +211 -212
- package/dist/chunk-QFPEDIYS.js +0 -2
- package/dist/dynamic-input-3JLVU7IZ.js +0 -2
- package/dist/index.d.ts +0 -2725
- package/dist/index.js +0 -4395
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkQFPEDIYS_js=require('./chunk-QFPEDIYS.js'),lucideReact=require('lucide-react'),e=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var e__default=/*#__PURE__*/_interopDefault(e);var w=[{code:"+93",countryCode:"AF",flag:"https://flagcdn.com/w20/af.png",name:"Afghanistan"},{code:"+355",countryCode:"AL",flag:"https://flagcdn.com/w20/al.png",name:"Albania"},{code:"+213",countryCode:"DZ",flag:"https://flagcdn.com/w20/dz.png",name:"Algeria"},{code:"+376",countryCode:"AD",flag:"https://flagcdn.com/w20/ad.png",name:"Andorra"},{code:"+244",countryCode:"AO",flag:"https://flagcdn.com/w20/ao.png",name:"Angola"},{code:"+54",countryCode:"AR",flag:"https://flagcdn.com/w20/ar.png",name:"Argentina"},{code:"+374",countryCode:"AM",flag:"https://flagcdn.com/w20/am.png",name:"Armenia"},{code:"+61",countryCode:"AU",flag:"https://flagcdn.com/w20/au.png",name:"Australia"},{code:"+43",countryCode:"AT",flag:"https://flagcdn.com/w20/at.png",name:"Austria"},{code:"+994",countryCode:"AZ",flag:"https://flagcdn.com/w20/az.png",name:"Azerbaijan"},{code:"+973",countryCode:"BH",flag:"https://flagcdn.com/w20/bh.png",name:"Bahrain"},{code:"+880",countryCode:"BD",flag:"https://flagcdn.com/w20/bd.png",name:"Bangladesh"},{code:"+375",countryCode:"BY",flag:"https://flagcdn.com/w20/by.png",name:"Belarus"},{code:"+32",countryCode:"BE",flag:"https://flagcdn.com/w20/be.png",name:"Belgium"},{code:"+501",countryCode:"BZ",flag:"https://flagcdn.com/w20/bz.png",name:"Belize"},{code:"+229",countryCode:"BJ",flag:"https://flagcdn.com/w20/bj.png",name:"Benin"},{code:"+975",countryCode:"BT",flag:"https://flagcdn.com/w20/bt.png",name:"Bhutan"},{code:"+591",countryCode:"BO",flag:"https://flagcdn.com/w20/bo.png",name:"Bolivia"},{code:"+387",countryCode:"BA",flag:"https://flagcdn.com/w20/ba.png",name:"Bosnia and Herzegovina"},{code:"+267",countryCode:"BW",flag:"https://flagcdn.com/w20/bw.png",name:"Botswana"},{code:"+55",countryCode:"BR",flag:"https://flagcdn.com/w20/br.png",name:"Brazil"},{code:"+673",countryCode:"BN",flag:"https://flagcdn.com/w20/bn.png",name:"Brunei"},{code:"+359",countryCode:"BG",flag:"https://flagcdn.com/w20/bg.png",name:"Bulgaria"},{code:"+226",countryCode:"BF",flag:"https://flagcdn.com/w20/bf.png",name:"Burkina Faso"},{code:"+257",countryCode:"BI",flag:"https://flagcdn.com/w20/bi.png",name:"Burundi"},{code:"+855",countryCode:"KH",flag:"https://flagcdn.com/w20/kh.png",name:"Cambodia"},{code:"+237",countryCode:"CM",flag:"https://flagcdn.com/w20/cm.png",name:"Cameroon"},{code:"+1",countryCode:"CA",flag:"https://flagcdn.com/w20/ca.png",name:"Canada"},{code:"+238",countryCode:"CV",flag:"https://flagcdn.com/w20/cv.png",name:"Cape Verde"},{code:"+236",countryCode:"CF",flag:"https://flagcdn.com/w20/cf.png",name:"Central African Republic"},{code:"+235",countryCode:"TD",flag:"https://flagcdn.com/w20/td.png",name:"Chad"},{code:"+56",countryCode:"CL",flag:"https://flagcdn.com/w20/cl.png",name:"Chile"},{code:"+86",countryCode:"CN",flag:"https://flagcdn.com/w20/cn.png",name:"China"},{code:"+57",countryCode:"CO",flag:"https://flagcdn.com/w20/co.png",name:"Colombia"},{code:"+269",countryCode:"KM",flag:"https://flagcdn.com/w20/km.png",name:"Comoros"},{code:"+243",countryCode:"CD",flag:"https://flagcdn.com/w20/cd.png",name:"Congo (DRC)"},{code:"+242",countryCode:"CG",flag:"https://flagcdn.com/w20/cg.png",name:"Congo (Republic)"},{code:"+506",countryCode:"CR",flag:"https://flagcdn.com/w20/cr.png",name:"Costa Rica"},{code:"+385",countryCode:"HR",flag:"https://flagcdn.com/w20/hr.png",name:"Croatia"},{code:"+53",countryCode:"CU",flag:"https://flagcdn.com/w20/cu.png",name:"Cuba"},{code:"+357",countryCode:"CY",flag:"https://flagcdn.com/w20/cy.png",name:"Cyprus"},{code:"+420",countryCode:"CZ",flag:"https://flagcdn.com/w20/cz.png",name:"Czech Republic"},{code:"+45",countryCode:"DK",flag:"https://flagcdn.com/w20/dk.png",name:"Denmark"},{code:"+253",countryCode:"DJ",flag:"https://flagcdn.com/w20/dj.png",name:"Djibouti"},{code:"+670",countryCode:"TL",flag:"https://flagcdn.com/w20/tl.png",name:"East Timor"},{code:"+593",countryCode:"EC",flag:"https://flagcdn.com/w20/ec.png",name:"Ecuador"},{code:"+20",countryCode:"EG",flag:"https://flagcdn.com/w20/eg.png",name:"Egypt"},{code:"+503",countryCode:"SV",flag:"https://flagcdn.com/w20/sv.png",name:"El Salvador"},{code:"+240",countryCode:"GQ",flag:"https://flagcdn.com/w20/gq.png",name:"Equ\u90E8\u5206: Equitorial Guinea"},{code:"+291",countryCode:"ER",flag:"https://flagcdn.com/w20/er.png",name:"Eritrea"},{code:"+372",countryCode:"EE",flag:"https://flagcdn.com/w20/ee.png",name:"Estonia"},{code:"+251",countryCode:"ET",flag:"https://flagcdn.com/w20/et.png",name:"Ethiopia"},{code:"+679",countryCode:"FJ",flag:"https://flagcdn.com/w20/fj.png",name:"Fiji"},{code:"+358",countryCode:"FI",flag:"https://flagcdn.com/w20/fi.png",name:"Finland"},{code:"+33",countryCode:"FR",flag:"https://flagcdn.com/w20/fr.png",name:"France"},{code:"+241",countryCode:"GA",flag:"https://flagcdn.com/w20/ga.png",name:"Gabon"},{code:"+220",countryCode:"GM",flag:"https://flagcdn.com/w20/gm.png",name:"Gambia"},{code:"+995",countryCode:"GE",flag:"https://flagcdn.com/w20/ge.png",name:"Georgia"},{code:"+49",countryCode:"DE",flag:"https://flagcdn.com/w20/de.png",name:"Germany"},{code:"+233",countryCode:"GH",flag:"https://flagcdn.com/w20/gh.png",name:"Ghana"},{code:"+30",countryCode:"GR",flag:"https://flagcdn.com/w20/gr.png",name:"Greece"},{code:"+502",countryCode:"GT",flag:"https://flagcdn.com/w20/gt.png",name:"Guatemala"},{code:"+224",countryCode:"GN",flag:"https://flagcdn.com/w20/gn.png",name:"Guinea"},{code:"+245",countryCode:"GW",flag:"https://flagcdn.com/w20/gw.png",name:"Guinea-Bissau"},{code:"+592",countryCode:"GY",flag:"https://flagcdn.com/w20/gy.png",name:"Guyana"},{code:"+509",countryCode:"HT",flag:"https://flagcdn.com/w20/ht.png",name:"Haiti"},{code:"+504",countryCode:"HN",flag:"https://flagcdn.com/w20/hn.png",name:"Honduras"},{code:"+852",countryCode:"HK",flag:"https://flagcdn.com/w20/hk.png",name:"Hong Kong"},{code:"+36",countryCode:"HU",flag:"https://flagcdn.com/w20/hu.png",name:"Hungary"},{code:"+354",countryCode:"IS",flag:"https://flagcdn.com/w20/is.png",name:"Iceland"},{code:"+91",countryCode:"IN",flag:"https://flagcdn.com/w20/in.png",name:"India"},{code:"+62",countryCode:"ID",flag:"https://flagcdn.com/w20/id.png",name:"Indonesia"},{code:"+98",countryCode:"IR",flag:"https://flagcdn.com/w20/ir.png",name:"Iran"},{code:"+964",countryCode:"IQ",flag:"https://flagcdn.com/w20/iq.png",name:"Iraq"},{code:"+353",countryCode:"IE",flag:"https://flagcdn.com/w20/ie.png",name:"Ireland"},{code:"+972",countryCode:"IL",flag:"https://flagcdn.com/w20/il.png",name:"Israel"},{code:"+39",countryCode:"IT",flag:"https://flagcdn.com/w20/it.png",name:"Italy"},{code:"+225",countryCode:"CI",flag:"https://flagcdn.com/w20/ci.png",name:"Ivory Coast"},{code:"+876",countryCode:"JM",flag:"https://flagcdn.com/w20/jm.png",name:"Jamaica"},{code:"+81",countryCode:"JP",flag:"https://flagcdn.com/w20/jp.png",name:"Japan"},{code:"+962",countryCode:"JO",flag:"https://flagcdn.com/w20/jo.png",name:"Jordan"},{code:"+7",countryCode:"KZ",flag:"https://flagcdn.com/w20/kz.png",name:"Kazakhstan"},{code:"+254",countryCode:"KE",flag:"https://flagcdn.com/w20/ke.png",name:"Kenya"},{code:"+686",countryCode:"KI",flag:"https://flagcdn.com/w20/ki.png",name:"Kiribati"},{code:"+965",countryCode:"KW",flag:"https://flagcdn.com/w20/kw.png",name:"Kuwait"},{code:"+996",countryCode:"KG",flag:"https://flagcdn.com/w20/kg.png",name:"Kyrgyzstan"},{code:"+856",countryCode:"LA",flag:"https://flagcdn.com/w20/la.png",name:"Laos"},{code:"+371",countryCode:"LV",flag:"https://flagcdn.com/w20/lv.png",name:"Latvia"},{code:"+961",countryCode:"LB",flag:"https://flagcdn.com/w20/lb.png",name:"Lebanon"},{code:"+266",countryCode:"LS",flag:"https://flagcdn.com/w20/ls.png",name:"Lesotho"},{code:"+231",countryCode:"LR",flag:"https://flagcdn.com/w20/lr.png",name:"Liberia"},{code:"+218",countryCode:"LY",flag:"https://flagcdn.com/w20/ly.png",name:"Libya"},{code:"+423",countryCode:"LI",flag:"https://flagcdn.com/w20/li.png",name:"Liechtenstein"},{code:"+370",countryCode:"LT",flag:"https://flagcdn.com/w20/lt.png",name:"Lithuania"},{code:"+352",countryCode:"LU",flag:"https://flagcdn.com/w20/lu.png",name:"Luxembourg"},{code:"+853",countryCode:"MO",flag:"https://flagcdn.com/w20/mo.png",name:"Macau"},{code:"+389",countryCode:"MK",flag:"https://flagcdn.com/w20/mk.png",name:"Macedonia"},{code:"+261",countryCode:"MG",flag:"https://flagcdn.com/w20/mg.png",name:"Madagascar"},{code:"+265",countryCode:"MW",flag:"https://flagcdn.com/w20/mw.png",name:"Malawi"},{code:"+60",countryCode:"MY",flag:"https://flagcdn.com/w20/my.png",name:"Malaysia"},{code:"+960",countryCode:"MV",flag:"https://flagcdn.com/w20/mv.png",name:"Maldives"},{code:"+223",countryCode:"ML",flag:"https://flagcdn.com/w20/ml.png",name:"Mali"},{code:"+356",countryCode:"MT",flag:"https://flagcdn.com/w20/mt.png",name:"Malta"},{code:"+692",countryCode:"MH",flag:"https://flagcdn.com/w20/mh.png",name:"Marshall Islands"},{code:"+222",countryCode:"MR",flag:"https://flagcdn.com/w20/mr.png",name:"Mauritania"},{code:"+230",countryCode:"MU",flag:"https://flagcdn.com/w20/mu.png",name:"Mauritius"},{code:"+52",countryCode:"MX",flag:"https://flagcdn.com/w20/mx.png",name:"Mexico"},{code:"+691",countryCode:"FM",flag:"https://flagcdn.com/w20/fm.png",name:"Micronesia"},{code:"+373",countryCode:"MD",flag:"https://flagcdn.com/w20/md.png",name:"Moldova"},{code:"+377",countryCode:"MC",flag:"https://flagcdn.com/w20/mc.png",name:"Monaco"},{code:"+976",countryCode:"MN",flag:"https://flagcdn.com/w20/mn.png",name:"Mongolia"},{code:"+382",countryCode:"ME",flag:"https://flagcdn.com/w20/me.png",name:"Montenegro"},{code:"+212",countryCode:"MA",flag:"https://flagcdn.com/w20/ma.png",name:"Morocco"},{code:"+258",countryCode:"MZ",flag:"https://flagcdn.com/w20/mz.png",name:"Mozambique"},{code:"+95",countryCode:"MM",flag:"https://flagcdn.com/w20/mm.png",name:"Myanmar"},{code:"+264",countryCode:"NA",flag:"https://flagcdn.com/w20/na.png",name:"Namibia"},{code:"+674",countryCode:"NR",flag:"https://flagcdn.com/w20/nr.png",name:"Nauru"},{code:"+977",countryCode:"NP",flag:"https://flagcdn.com/w20/np.png",name:"Nepal"},{code:"+31",countryCode:"NL",flag:"https://flagcdn.com/w20/nl.png",name:"Netherlands"},{code:"+64",countryCode:"NZ",flag:"https://flagcdn.com/w20/nz.png",name:"New Zealand"},{code:"+505",countryCode:"NI",flag:"https://flagcdn.com/w20/ni.png",name:"Nicaragua"},{code:"+227",countryCode:"NE",flag:"https://flagcdn.com/w20/ne.png",name:"Niger"},{code:"+234",countryCode:"NG",flag:"https://flagcdn.com/w20/ng.png",name:"Nigeria"},{code:"+47",countryCode:"NO",flag:"https://flagcdn.com/w20/no.png",name:"Norway"},{code:"+968",countryCode:"OM",flag:"https://flagcdn.com/w20/om.png",name:"Oman"},{code:"+92",countryCode:"PK",flag:"https://flagcdn.com/w20/pk.png",name:"Pakistan"},{code:"+680",countryCode:"PW",flag:"https://flagcdn.com/w20/pw.png",name:"Palau"},{code:"+507",countryCode:"PA",flag:"https://flagcdn.com/w20/pa.png",name:"Panama"},{code:"+675",countryCode:"PG",flag:"https://flagcdn.com/w20/pg.png",name:"Papua New Guinea"},{code:"+595",countryCode:"PY",flag:"https://flagcdn.com/w20/py.png",name:"Paraguay"},{code:"+51",countryCode:"PE",flag:"https://flagcdn.com/w20/pe.png",name:"Peru"},{code:"+63",countryCode:"PH",flag:"https://flagcdn.com/w20/ph.png",name:"Philippines"},{code:"+48",countryCode:"PL",flag:"https://flagcdn.com/w20/pl.png",name:"Poland"},{code:"+351",countryCode:"PT",flag:"https://flagcdn.com/w20/pt.png",name:"Portugal"},{code:"+974",countryCode:"QA",flag:"https://flagcdn.com/w20/qa.png",name:"Qatar"},{code:"+40",countryCode:"RO",flag:"https://flagcdn.com/w20/ro.png",name:"Romania"},{code:"+7",countryCode:"RU",flag:"https://flagcdn.com/w20/ru.png",name:"Russia"},{code:"+250",countryCode:"RW",flag:"https://flagcdn.com/w20/rw.png",name:"Rwanda"},{code:"+966",countryCode:"SA",flag:"https://flagcdn.com/w20/sa.png",name:"Saudi Arabia"},{code:"+221",countryCode:"SN",flag:"https://flagcdn.com/w20/sn.png",name:"Senegal"},{code:"+381",countryCode:"RS",flag:"https://flagcdn.com/w20/rs.png",name:"Serbia"},{code:"+248",countryCode:"SC",flag:"https://flagcdn.com/w20/sc.png",name:"Seychelles"},{code:"+232",countryCode:"SL",flag:"https://flagcdn.com/w20/sl.png",name:"Sierra Leone"},{code:"+65",countryCode:"SG",flag:"https://flagcdn.com/w20/sg.png",name:"Singapore"},{code:"+421",countryCode:"SK",flag:"https://flagcdn.com/w20/sk.png",name:"Slovakia"},{code:"+386",countryCode:"SI",flag:"https://flagcdn.com/w20/si.png",name:"Slovenia"},{code:"+677",countryCode:"SB",flag:"https://flagcdn.com/w20/sb.png",name:"Solomon Islands"},{code:"+252",countryCode:"SO",flag:"https://flagcdn.com/w20/so.png",name:"Somalia"},{code:"+27",countryCode:"ZA",flag:"https://flagcdn.com/w20/za.png",name:"South Africa"},{code:"+82",countryCode:"KR",flag:"https://flagcdn.com/w20/kr.png",name:"South Korea"},{code:"+211",countryCode:"SS",flag:"https://flagcdn.com/w20/ss.png",name:"South Sudan"},{code:"+34",countryCode:"ES",flag:"https://flagcdn.com/w20/es.png",name:"Spain"},{code:"+94",countryCode:"LK",flag:"https://flagcdn.com/w20/lk.png",name:"Sri Lanka"},{code:"+249",countryCode:"SD",flag:"https://flagcdn.com/w20/sd.png",name:"Sudan"},{code:"+597",countryCode:"SR",flag:"https://flagcdn.com/w20/sr.png",name:"Suriname"},{code:"+268",countryCode:"SZ",flag:"https://flagcdn.com/w20/sz.png",name:"Eswatini"},{code:"+46",countryCode:"SE",flag:"https://flagcdn.com/w20/se.png",name:"Sweden"},{code:"+41",countryCode:"CH",flag:"https://flagcdn.com/w20/ch.png",name:"Switzerland"},{code:"+963",countryCode:"SY",flag:"https://flagcdn.com/w20/sy.png",name:"Syria"},{code:"+886",countryCode:"TW",flag:"https://flagcdn.com/w20/tw.png",name:"Taiwan"},{code:"+992",countryCode:"TJ",flag:"https://flagcdn.com/w20/tj.png",name:"Tajikistan"},{code:"+255",countryCode:"TZ",flag:"https://flagcdn.com/w20/tz.png",name:"Tanzania"},{code:"+66",countryCode:"TH",flag:"https://flagcdn.com/w20/th.png",name:"Thailand"},{code:"+228",countryCode:"TG",flag:"https://flagcdn.com/w20/tg.png",name:"Togo"},{code:"+676",countryCode:"TO",flag:"https://flagcdn.com/w20/to.png",name:"Tonga"},{code:"+216",countryCode:"TN",flag:"https://flagcdn.com/w20/tn.png",name:"Tunisia"},{code:"+90",countryCode:"TR",flag:"https://flagcdn.com/w20/tr.png",name:"Turkey"},{code:"+993",countryCode:"TM",flag:"https://flagcdn.com/w20/tm.png",name:"Turkmenistan"},{code:"+688",countryCode:"TV",flag:"https://flagcdn.com/w20/tv.png",name:"Tuvalu"},{code:"+256",countryCode:"UG",flag:"https://flagcdn.com/w20/ug.png",name:"Uganda"},{code:"+380",countryCode:"UA",flag:"https://flagcdn.com/w20/ua.png",name:"Ukraine"},{code:"+971",countryCode:"AE",flag:"https://flagcdn.com/w20/ae.png",name:"United Arab Emirates"},{code:"+44",countryCode:"GB",flag:"https://flagcdn.com/w20/gb.png",name:"United Kingdom"},{code:"+1",countryCode:"US",flag:"https://flagcdn.com/w20/us.png",name:"United States"},{code:"+598",countryCode:"UY",flag:"https://flagcdn.com/w20/uy.png",name:"Uruguay"},{code:"+998",countryCode:"UZ",flag:"https://flagcdn.com/w20/uz.png",name:"Uzbekistan"},{code:"+678",countryCode:"VU",flag:"https://flagcdn.com/w20/vu.png",name:"Vanuatu"},{code:"+58",countryCode:"VE",flag:"https://flagcdn.com/w20/ve.png",name:"Venezuela"},{code:"+84",countryCode:"VN",flag:"https://flagcdn.com/w20/vn.png",name:"Vietnam"},{code:"+967",countryCode:"YE",flag:"https://flagcdn.com/w20/ye.png",name:"Yemen"},{code:"+260",countryCode:"ZM",flag:"https://flagcdn.com/w20/zm.png",name:"Zambia"},{code:"+263",countryCode:"ZW",flag:"https://flagcdn.com/w20/zw.png",name:"Zimbabwe"}],b=w.find(t=>t.name==="Angola")??{code:"+244",countryCode:"AO",flag:"https://flagcdn.com/w20/ao.png",name:"Angola"};function H({countries:t=w,defaultCountry:v="+244",defaultInputType:D="phone",onChange:m,onCountryChange:i,countryCode:p}={}){let S=e.useRef(null),T=v?t.find(o=>o.code===v)||b:b,[a,y]=e.useState(T),[d,h]=e.useState(""),[C,f]=e.useState(""),[r,s]=e.useState(false),N=C?t.filter(o=>o.name.toLowerCase().includes(C.toLowerCase())||o.code.includes(C)):t,u=o=>{let c=o.replace(/[^0-9]/g,""),g=a.code+c;h(g),m&&m(g,"phone");},E=o=>{y(o),s(false),f("");let c=d.replace(a.code,""),g=o.code+c;h(g),m&&m(g,"phone"),i&&i(o);},I=o=>{f(o.target.value);};return e.useEffect(()=>{r||f("");},[r]),e.useEffect(()=>{let o=S.current;if(o&&d){let c=d.replace(a.code,"");setTimeout(()=>{o.setSelectionRange(c.length,c.length);},0);}},[d,a]),e.useEffect(()=>{if(p){let o=t.find(c=>c.code===p);if(o&&o.code!==a.code){let c=d.replace(a.code,""),g=o.code+c;y(o),h(g),m&&m(g,"phone"),i&&i(o);}}},[p,t,i,m,a.code,d]),{selectedCountry:a,inputValue:d,searchQuery:C,dropdownOpen:r,filteredCountries:N,setDropdownOpen:s,handleInputChange:u,handleCountryChange:E,handleSearchChange:I,inputRef:S,setSelectedCountry:y}}function rn({countries:t=w,defaultCountry:v="+244",phonePlaceholder:D="9487486537 *",searchPlaceholder:m="Angola",showIcons:i=true,onChange:p,onCountryChange:S,handleChangeCountry:T,value:a,countryCode:y,className:d="",defaultPlaceholder:h,noCountriesMessage:C="No countries found",phoneError:f,error:r,disabled:s=false,onKeyDown:N}){let{selectedCountry:u,searchQuery:E,dropdownOpen:I,filteredCountries:o,setDropdownOpen:c,handleCountryChange:g,handleSearchChange:F,inputRef:Z,setSelectedCountry:j}=H({countries:t,defaultCountry:v,defaultInputType:"phone",onChange:p,onCountryChange:S,countryCode:y}),[A,G]=e.useState(void 0),[U,L]=e.useState(""),Y=e.useRef(null);e.useEffect(()=>{if(a){let n=a;t.forEach(l=>{n.startsWith(l.code)&&(n=n.slice(l.code.length));}),L(n);}else L("");},[a,t]);let J=n=>{let l=n.replace(/[^0-9\s()-]/g,"");G(n!==l?"Only numbers are allowed":void 0),L(l);let q=u.code+l;p?.(q);},W=n=>{g(n),T?.(n.code);let l=n.code+U;p?.(l),c(false);};return e.useEffect(()=>{if(!u?.code){let n=t.find(l=>l.code==="+244")||b;j(n),T?.(n.code),p&&!a&&p(n.code);}},[]),e__default.default.createElement("div",{className:"max-w-md w-full",ref:Y},e__default.default.createElement("div",{className:chunkQFPEDIYS_js.g("flex items-center w-full gap-2 relative","border border-input rounded-lg",r||f||A?"border-red-500 focus-within:!border-red-500 focus-within:!ring-red-500 focus-within:!ring-[1px]":"focus-within:border-[#0B89CE] focus-within:ring-[1px] focus-within:ring-[#0B89CE]",s&&"opacity-50 cursor-not-allowed pointer-events-none",d)},e__default.default.createElement(chunkQFPEDIYS_js.k,{open:I,onOpenChange:c,modal:true},e__default.default.createElement(chunkQFPEDIYS_js.l,{asChild:true},e__default.default.createElement(chunkQFPEDIYS_js.j,{variant:"ghost",className:"cursor-pointer hover:bg-transparent px-3",disabled:s},e__default.default.createElement("img",{src:u.flag,alt:u.code,className:"w-5 h-5"}),e__default.default.createElement("span",{className:"mx-1"},u.code),e__default.default.createElement(lucideReact.ChevronDown,{className:"w-4 h-4 text-gray-500"}))),e__default.default.createElement(chunkQFPEDIYS_js.m,{side:"bottom",align:"start",sideOffset:5,className:"!bg-white min-w-[220px] max-h-[320px] overflow-hidden overscroll-contain p-0 z-[10000]",style:{zIndex:1e4,position:"fixed"},onOpenAutoFocus:n=>n.preventDefault()},e__default.default.createElement("div",{className:"p-2 sticky top-0 bg-white z-10 border-b"},e__default.default.createElement("div",{className:"relative"},e__default.default.createElement(lucideReact.Search,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e__default.default.createElement(chunkQFPEDIYS_js.h,{placeholder:m,value:E,onChange:F,className:"pl-8 h-9",disabled:s}))),e__default.default.createElement("div",{className:"max-h-[250px] overflow-y-auto py-1"},o.length>0?o.map(n=>e__default.default.createElement("div",{key:`${n.code}-${n.name}`,onClick:()=>W(n),className:"flex items-center gap-2 cursor-pointer px-2 py-1.5 text-sm hover:bg-gray-100"},e__default.default.createElement("img",{src:n.flag,alt:n.name,className:"w-5 h-5"}),e__default.default.createElement("span",null,n.name),e__default.default.createElement("span",{className:"ml-auto text-gray-500"},n.code))):e__default.default.createElement("div",{className:"px-2 py-4 text-center text-sm text-gray-500"},C)))),e__default.default.createElement("div",{className:"relative flex-1"},e__default.default.createElement(chunkQFPEDIYS_js.h,{type:"tel",value:U,ref:Z,onChange:n=>J(n.target.value),onKeyDown:N,placeholder:h?.length?h:D,className:chunkQFPEDIYS_js.g("w-full px-3 text-sm placeholder:text-sm text-dark-1 placeholder:text-gray-shade7 bg-white","border-none shadow-none outline-none",d),disabled:s}))),(r||f||A)&&e__default.default.createElement("div",{className:"text-red-500 text-sm mt-1"},A||f||r))}
|
|
2
|
-
exports.DynamicContactInput=rn;
|