@wix/form-elements 1.109.0 → 1.111.0
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/component/{appointment-rac-C9-XwsPI.js → appointment-rac-BZ9sCf_L.js} +4 -4
- package/dist/component/{bookings-address-rac-jrrCPWjw.js → bookings-address-rac-DDisJZwl.js} +1 -1
- package/dist/component/{bookings-email-rac-J9-RMEbf.js → bookings-email-rac-ovewChXn.js} +1 -1
- package/dist/component/{bookings-first-name-rac-CH7-6JmA.js → bookings-first-name-rac-CyudJnHy.js} +1 -1
- package/dist/component/{bookings-header-rac-C2JV-ciN.js → bookings-header-rac-BSN_BoC0.js} +1 -1
- package/dist/component/{bookings-last-name-rac-0a9CwiaV.js → bookings-last-name-rac-SdX5IANy.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-4Mb7MQYe.js → bookings-login-bar-rac-COQ2BOsY.js} +1 -1
- package/dist/component/{bookings-phone-rac-vYx5r5jn.js → bookings-phone-rac-DlUfTzEz.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CWg1FgUp.js → bookings-rich-text-rac-Dx0uxbQc.js} +1 -1
- package/dist/component/{checkbox-field-rac-Dwx1leKA.js → checkbox-field-rac-DueJINhA.js} +4 -4
- package/dist/component/{checkbox-group-field-headless-AFWgXzx_.js → checkbox-group-field-headless-wj9ITlbE.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-CO8kmWJp.js → checkbox-group-field-rac-CrD849TZ.js} +4 -4
- package/dist/component/{checkbox-group-rac-_79HsFF4.js → checkbox-group-rac-Wdz1ShJh.js} +1 -1
- package/dist/component/{checkbox-rac-B_tbMfjo.js → checkbox-rac-BC7A8y2w.js} +1 -1
- package/dist/component/{contacts-address-rac-SJ5Tvzd0.js → contacts-address-rac-DoWo8zyH.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-BU1L3sbW.js → contacts-birthdate-rac-CEXkyOuk.js} +1 -1
- package/dist/component/{contacts-company-rac-Y4B8KhDa.js → contacts-company-rac-CYaVpLCk.js} +1 -1
- package/dist/component/{contacts-email-rac-CQW84o7C.js → contacts-email-rac-teBI-Rpu.js} +1 -1
- package/dist/component/{contacts-first-name-rac-Dtai-wtH.js → contacts-first-name-rac-BOPuOgk1.js} +1 -1
- package/dist/component/{contacts-last-name-rac--ixuu3ri.js → contacts-last-name-rac-DdRhuv9q.js} +1 -1
- package/dist/component/{contacts-phone-rac-HOHfSvT-.js → contacts-phone-rac-BMiop0kR.js} +1 -1
- package/dist/component/{contacts-position-rac-BPMkh6yf.js → contacts-position-rac-C8iM62rN.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-D0_RMwJb.js → contacts-subscribe-rac-CkToH-f2.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-CZJmMiVf.js → contacts-tax-id-rac-JM0KJre8.js} +1 -1
- package/dist/component/{date-availability-C4dDHvuc.js → date-availability-DJyvNJ6w.js} +1 -1
- package/dist/component/{date-input-field-rac-8oERZcqh.js → date-input-field-rac-CStB2jP7.js} +6 -6
- package/dist/component/{date-input-rac-CYRojmW6.js → date-input-rac-DUSJH8am.js} +1 -1
- package/dist/component/{date-picker-field-rac-CIspU7No.js → date-picker-field-rac-6xffgnXB.js} +5 -5
- package/dist/component/{date-picker-rac-D0Y0zf2J.js → date-picker-rac-Dpe0w0G6.js} +1 -1
- package/dist/component/{date-time-input-field-rac-0daWK65I.js → date-time-input-field-rac-CX39V3G1.js} +6 -6
- package/dist/component/{date-time-input-rac-BemKPk1j.js → date-time-input-rac-DBVMIbom.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BpFNn56W.js → dext-checkbox-group-rac-CAxyCWQY.js} +2 -2
- package/dist/component/{dext-checkbox-rac-DOISgubJ.js → dext-checkbox-rac-CRBzElbv.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CNGhFg_g.js → dext-date-picker-rac-DNzXwBkg.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BuUIvJRr.js → dext-date-time-input-rac-D2W3buJP.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DtND-Dbo.js → dext-dropdown-rac-CTTreT77.js} +1 -1
- package/dist/component/{dext-email-rac-CmjLFOi8.js → dext-email-rac-BwI4-hML.js} +1 -1
- package/dist/component/{dext-number-input-rac-DHTNg1dh.js → dext-number-input-rac-DT5pQiC3.js} +1 -1
- package/dist/component/{dext-phone-rac-BrrU5qH_.js → dext-phone-rac-MA6wyUxM.js} +1 -1
- package/dist/component/{dext-radio-group-rac-CD3MGfAM.js → dext-radio-group-rac-3PYEgYHn.js} +2 -2
- package/dist/component/{dext-rating-input-rac-BETGJZmt.js → dext-rating-input-rac-I3e9k3Tp.js} +1 -1
- package/dist/component/{dext-tags-rac-Coo9jN-T.js → dext-tags-rac-Bf4tEUAW.js} +2 -2
- package/dist/component/{dext-text-area-rac-CNWjqhUT.js → dext-text-area-rac-5oOAM6zJ.js} +1 -1
- package/dist/component/{dext-text-input-rac-CCWyDexv.js → dext-text-input-rac-8nHhvQfO.js} +1 -1
- package/dist/component/{dext-url-input-rac-Dtakkgmk.js → dext-url-input-rac-DSAfDqx1.js} +1 -1
- package/dist/component/{donation-rac-BboGm_k_.js → donation-rac-DJiD7Fel.js} +5 -5
- package/dist/component/{dropdown-field-headless-BTMJGUwY.js → dropdown-field-headless-B_W8kD-t.js} +4 -4
- package/dist/component/{dropdown-field-rac-CDRV8ckB.js → dropdown-field-rac-IDVaMgoc.js} +3 -3
- package/dist/component/{dropdown-rac-kEuU2pXW.js → dropdown-rac-I2ZO66jF.js} +1 -1
- package/dist/component/{ecom-address-rac-BgKL9ElH.js → ecom-address-rac-B1knDuog.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CDhJsNPD.js → ecom-subscription-checkbox-rac-BQPJb2kl.js} +2 -2
- package/dist/component/{email-input-field-rac-DdOd86NX.js → email-input-field-rac-DsjMnxGw.js} +3 -3
- package/dist/component/{events-repeater-rac-_VJ30dpB.js → events-repeater-rac-CT7scvgS.js} +4 -4
- package/dist/component/{events-rsvp-rac-DA-261bq.js → events-rsvp-rac-Dcrc1yxR.js} +3 -3
- package/dist/component/{field-error-headless-CovyN0GI.js → field-error-headless-DRkkbv__.js} +1 -1
- package/dist/component/{field-label-headless-DVvX2QaH.js → field-label-headless-m633nF93.js} +1 -1
- package/dist/component/{file-upload-rac-bhEPUJPs.js → file-upload-rac-DaExm5ny.js} +4 -4
- package/dist/component/{fixed-payment-rac-DmI6MeKc.js → fixed-payment-rac-BglZ8zc0.js} +3 -3
- package/dist/component/{form-BTDgyr54.js → form-CY-iFZdC.js} +5929 -5517
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-C0rUjmo0.js → header-field-rac-B6Mzqr3b.js} +2 -2
- package/dist/component/{header-rac-DRMO22PV.js → header-rac-CB2NDeCJ.js} +1 -1
- package/dist/component/{image-choice-rac-CQDQ7AlD.js → image-choice-rac-gtYrnTGg.js} +4 -4
- package/dist/component/{index-B9QlosT1.js → index-Ozpoh9do.js} +2 -2
- package/dist/component/{index-CNWT9t6j.js → index-wR-OU2AH.js} +4 -4
- package/dist/component/{isObjectLike-c0td2WCR.js → isObjectLike-DsBVSQ_O.js} +1 -1
- package/dist/component/{multiline-address-field-rac-D8bVxRsD.js → multiline-address-field-rac-Z4hKy_B_.js} +7 -7
- package/dist/component/{multiline-address-rac-g-6RB7o8.js → multiline-address-rac-DWV0BZHX.js} +1 -1
- package/dist/component/{number-input-field-rac-BaOwQ5Ya.js → number-input-field-rac-DKpSb1S_.js} +4 -4
- package/dist/component/{number-input-rac-BXv8-Pnj.js → number-input-rac-Di7Q8CH9.js} +1 -1
- package/dist/component/{password-rac-BB9XeSSZ.js → password-rac-B9RT0izw.js} +4 -4
- package/dist/component/{payment-input-rac-DwnSV9rM.js → payment-input-rac-DdGNnPcd.js} +4 -4
- package/dist/component/phone-input-field-rac-B-5gHBXY.js +503 -0
- package/dist/component/{phone-rac-DpNhSaE0.js → phone-rac-CmZwJyH7.js} +1 -1
- package/dist/component/{product-list-rac-BAESk3B6.js → product-list-rac-BInJ4cw_.js} +4 -4
- package/dist/component/{quiz-radio-group-rac-PS6AZr63.js → quiz-radio-group-rac-B1EIBOt5.js} +1 -1
- package/dist/component/{radio-button-module-classes-CXcn5unY.js → radio-button-module-classes-CjDU2x_m.js} +3 -3
- package/dist/component/{radio-group-field-rac-pt8xbDfS.js → radio-group-field-rac-DAwCG8w2.js} +4 -4
- package/dist/component/{radio-group-rac-DkzkM6N_.js → radio-group-rac-CExbY0aw.js} +1 -1
- package/dist/component/{rating-input-field-rac-DDHBkR4x.js → rating-input-field-rac-DTeubyLu.js} +4 -4
- package/dist/component/{rating-input-rac-CcsDmLus.js → rating-input-rac-P7Fdwrm3.js} +1 -1
- package/dist/component/{rich-content-rac.module-B2vsO6fj.js → rich-content-rac.module-DgQubdPj.js} +1 -1
- package/dist/component/{rich-text-field-rac-CvKht2eC.js → rich-text-field-rac-8dkTMWKw.js} +2 -2
- package/dist/component/{rich-text-rac-CRpSffQB.js → rich-text-rac-C6u_hF5R.js} +1 -1
- package/dist/component/{service-dropdown-rac-BOpdXNjG.js → service-dropdown-rac-CTSCew5q.js} +4 -4
- package/dist/component/{services-multi-choice-rac-t0wdSt_T.js → services-multi-choice-rac-BUFJHq-l.js} +5 -5
- package/dist/component/{signature-rac-2LsIYYIX.js → signature-rac-yO924Qfv.js} +3 -3
- package/dist/component/{submit-button-rac-BbE8dS35.js → submit-button-rac-BurhcqZP.js} +1 -1
- package/dist/component/{tags-field-rac-BnsBxReU.js → tags-field-rac-qbNQcwnE.js} +5 -5
- package/dist/component/{tags-rac-BFH4RINA.js → tags-rac-DVHcpxNG.js} +1 -1
- package/dist/component/{text-area-field-rac-Ag7_gniM.js → text-area-field-rac-BKhGX0CL.js} +4 -4
- package/dist/component/{text-area-rac-ByUX0p2O.js → text-area-rac-CHHEDeUX.js} +1 -1
- package/dist/component/{text-input-field-rac-D3MZ8teu.js → text-input-field-rac-BGitxCuC.js} +3 -3
- package/dist/component/{text-input-headless-CwONErsY.js → text-input-headless-BBn1G2s9.js} +3 -3
- package/dist/component/{text-input-rac-DLXdAhkK.js → text-input-rac-CHX-U7Kp.js} +1 -1
- package/dist/component/{time-input-rac-Bs55lTON.js → time-input-rac-Bp6B2gO3.js} +4 -4
- package/dist/component/{url-input-field-rac-FG-bCh-E.js → url-input-field-rac-CPibLAWz.js} +4 -4
- package/dist/component/{url-input-rac-BOKuCMTe.js → url-input-rac-Bj4PV2YJ.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-DjV7FW5y.js → use-dropdown-option-class-name-CE1u4RLT.js} +2 -2
- package/dist/component/{use-element-state-class-name-DB1AzkvF.js → use-element-state-class-name-Dn_LpP1k.js} +1 -1
- package/dist/component/{use-is-forced-open-dropdown-ifUIpuwL.js → use-is-forced-open-dropdown-B2mdY7ku.js} +1 -1
- package/dist/component/{use-service-options-base-B11cq0HH.js → use-service-options-base-DBvqU30V.js} +1 -1
- package/dist/component/{use-text-input-class-name-va1PzWFg.js → use-text-input-class-name-BUW0svzK.js} +2 -2
- package/package.json +3 -3
- package/dist/component/phone-input-field-rac-CC3C4ToW.js +0 -487
|
@@ -1,487 +0,0 @@
|
|
|
1
|
-
import { RicosViewer as Oe } from "@wix/ricos/viewer";
|
|
2
|
-
import O from "classnames";
|
|
3
|
-
import t, { useMemo as x, useState as B, useRef as v, useEffect as U, useCallback as oe, createContext as le, useContext as K } from "react";
|
|
4
|
-
import { aU as _e, bj as P, b1 as ue, bi as Ne, b9 as M, b6 as ie, bb as Se, I as Le, U as Ie, t as Fe, H as ve, K as Pe, v as De, p as Re } from "./form-BTDgyr54.js";
|
|
5
|
-
import { UNSAFE_PortalProvider as xe } from "react-aria";
|
|
6
|
-
import { Dialog as me, OverlayTriggerStateContext as Be, ModalOverlay as Me, Modal as qe, SearchField as Ae, Group as G, ListBoxItem as Te, DialogTrigger as $e, Select as je, Input as Ce, ListBox as we, Autocomplete as Ue } from "react-aria-components";
|
|
7
|
-
import { f as h, a as H } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as ke, E as Ve } from "./field-error-headless-CovyN0GI.js";
|
|
9
|
-
import { L as Ge } from "./field-label-headless-DVvX2QaH.js";
|
|
10
|
-
import { N as He, S as Ke } from "./non-modal-popover-DtIMXHbe.js";
|
|
11
|
-
import { u as Ye } from "./use-invoke-callback-UH73A_J3.js";
|
|
12
|
-
import { u as ze } from "./use-is-forced-open-dropdown-ifUIpuwL.js";
|
|
13
|
-
import de, { AsYouType as We, isValidPhoneNumber as Ze, isSupportedCountry as Qe } from "libphonenumber-js";
|
|
14
|
-
import "libphonenumber-js/metadata.min.json";
|
|
15
|
-
import { C as re } from "./calling-country-codes-PyWuOTmF.js";
|
|
16
|
-
import { C as Je } from "./chevron-down-icon-CcpVm6B-.js";
|
|
17
|
-
import { E as Xe } from "./error-icon-hZxQ6DEy.js";
|
|
18
|
-
import { H as ae } from "./custom-focus-class-_483Pkwp.js";
|
|
19
|
-
import { s as b } from "./field-rac.module-B4l_0KRU.js";
|
|
20
|
-
import { u as et } from "./use-dropdown-option-class-name-DjV7FW5y.js";
|
|
21
|
-
import { u as tt } from "./use-text-input-class-name-va1PzWFg.js";
|
|
22
|
-
function se(e) {
|
|
23
|
-
const n = e ? de(e) : void 0, r = n == null ? void 0 : n.country;
|
|
24
|
-
if (r)
|
|
25
|
-
return r;
|
|
26
|
-
const o = new We();
|
|
27
|
-
return e && o.input(e), o.getCountry();
|
|
28
|
-
}
|
|
29
|
-
function Y(e) {
|
|
30
|
-
var n;
|
|
31
|
-
return e && ((n = _e.getCountryByKey(e)) == null ? void 0 : n.dialCode);
|
|
32
|
-
}
|
|
33
|
-
function k(e) {
|
|
34
|
-
return e === null ? null : e.replace(/[^0-9+]/g, "") || e;
|
|
35
|
-
}
|
|
36
|
-
function ce(e, n) {
|
|
37
|
-
if (e && n)
|
|
38
|
-
try {
|
|
39
|
-
const r = de(e, n), o = r == null ? void 0 : r.formatInternational();
|
|
40
|
-
if (o && Ze(o))
|
|
41
|
-
return o.replace(/\s+/g, "");
|
|
42
|
-
} catch {
|
|
43
|
-
}
|
|
44
|
-
return e;
|
|
45
|
-
}
|
|
46
|
-
function nt() {
|
|
47
|
-
const { t: e } = P(), { language: n } = ue();
|
|
48
|
-
return x(() => Object.keys(re).reduce((o, a) => {
|
|
49
|
-
const l = re[a], s = Y(l), i = e(`locale-dataset.countries.${l.toUpperCase()}`);
|
|
50
|
-
return s && Qe(a) && o.push({
|
|
51
|
-
countryName: i,
|
|
52
|
-
longCountryCode: l,
|
|
53
|
-
shortCountryCode: a,
|
|
54
|
-
callingCode: s
|
|
55
|
-
}), o;
|
|
56
|
-
}, []).sort((o, a) => o.countryName.localeCompare(a.countryName, n)), [
|
|
57
|
-
e,
|
|
58
|
-
n
|
|
59
|
-
]);
|
|
60
|
-
}
|
|
61
|
-
function ot(e, n) {
|
|
62
|
-
return e.filter((r) => n && n.length > 0 ? n.includes(r.shortCountryCode) : !0);
|
|
63
|
-
}
|
|
64
|
-
function rt(e, n) {
|
|
65
|
-
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
66
|
-
return !!(V(r, n) || V(o, n) || V(a, n));
|
|
67
|
-
}
|
|
68
|
-
function V(e, n) {
|
|
69
|
-
return e.toLowerCase().includes(n.toLowerCase());
|
|
70
|
-
}
|
|
71
|
-
function at({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
72
|
-
const [a, l] = B(e || ""), s = v(k(e ?? null) ?? ""), [i, u] = B(n);
|
|
73
|
-
Ne(() => {
|
|
74
|
-
l(""), s.current = "", u(n), o("");
|
|
75
|
-
});
|
|
76
|
-
const m = x(() => se(a), [
|
|
77
|
-
a
|
|
78
|
-
]);
|
|
79
|
-
U(() => {
|
|
80
|
-
const d = e ?? "";
|
|
81
|
-
d !== s.current && (l(d), s.current = d);
|
|
82
|
-
}, [
|
|
83
|
-
e
|
|
84
|
-
]), U(() => {
|
|
85
|
-
n && !i && u(n);
|
|
86
|
-
}, [
|
|
87
|
-
n,
|
|
88
|
-
i
|
|
89
|
-
]), U(() => {
|
|
90
|
-
u(n ?? m);
|
|
91
|
-
}, [
|
|
92
|
-
m,
|
|
93
|
-
n
|
|
94
|
-
]);
|
|
95
|
-
const p = oe((d) => {
|
|
96
|
-
if (l(d), !d) {
|
|
97
|
-
s.current = "", o(null);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const E = se(d);
|
|
101
|
-
u((y) => {
|
|
102
|
-
const N = E || y || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), S = k(ce(d, N));
|
|
103
|
-
return s.current = S ?? "", o(S), E || y;
|
|
104
|
-
});
|
|
105
|
-
}, [
|
|
106
|
-
r,
|
|
107
|
-
o
|
|
108
|
-
]), C = oe((d) => {
|
|
109
|
-
u(d), l((E) => {
|
|
110
|
-
const y = k(ce(E, d));
|
|
111
|
-
return s.current = y ?? "", o(y), E;
|
|
112
|
-
});
|
|
113
|
-
}, [
|
|
114
|
-
o
|
|
115
|
-
]);
|
|
116
|
-
return {
|
|
117
|
-
currentValue: a,
|
|
118
|
-
selectedCountryCode: i,
|
|
119
|
-
handlePhoneChange: p,
|
|
120
|
-
handleCountryCodeChange: C
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
const pe = /* @__PURE__ */ le(null), _ = () => {
|
|
124
|
-
const e = K(pe);
|
|
125
|
-
if (!e)
|
|
126
|
-
throw new Error("Phone input components must be used within PhoneInput component");
|
|
127
|
-
return e;
|
|
128
|
-
}, ye = /* @__PURE__ */ le(null), z = () => {
|
|
129
|
-
const e = K(ye);
|
|
130
|
-
if (!e)
|
|
131
|
-
throw new Error("Option sub-components must be used within Option component");
|
|
132
|
-
return e;
|
|
133
|
-
}, W = ({ longCountryCode: e, className: n }) => {
|
|
134
|
-
function r(l, s) {
|
|
135
|
-
const i = "https://static.parastorage.com/services/linguist-flags/1.1005.0/assets/flags/square/", m = `${l}${s === "2x" ? "_2x" : ""}.png`;
|
|
136
|
-
return `${i}${m}`;
|
|
137
|
-
}
|
|
138
|
-
const o = r(e, "1x"), a = r(e, "2x");
|
|
139
|
-
return /* @__PURE__ */ t.createElement("img", {
|
|
140
|
-
src: o,
|
|
141
|
-
srcSet: `${o} 1x, ${a} 2x`,
|
|
142
|
-
alt: "",
|
|
143
|
-
"aria-hidden": "true",
|
|
144
|
-
loading: "lazy",
|
|
145
|
-
className: n
|
|
146
|
-
});
|
|
147
|
-
}, c = ({ children: e }) => {
|
|
148
|
-
var D, F;
|
|
149
|
-
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: l, validation: s } = M(), [i, u] = B(null), m = (F = (D = s == null ? void 0 : s.string) == null ? void 0 : D.phoneOptions) == null ? void 0 : F.allowedCountryCodes, p = nt(), C = x(() => ot(p, m), [
|
|
150
|
-
p,
|
|
151
|
-
m
|
|
152
|
-
]), d = x(() => C.map((R) => R.shortCountryCode), [
|
|
153
|
-
C
|
|
154
|
-
]), { currentValue: E, selectedCountryCode: y, handlePhoneChange: N, handleCountryCodeChange: S } = at({
|
|
155
|
-
value: r,
|
|
156
|
-
defaultCountryCode: l,
|
|
157
|
-
allowedCountryCodes: d,
|
|
158
|
-
onChange: o
|
|
159
|
-
}), A = h(e, c.Label), T = h(e, c.Control), L = h(e, c.Description), $ = h(e, c.Error), I = {
|
|
160
|
-
currentValue: E,
|
|
161
|
-
selectedCountryCode: y,
|
|
162
|
-
handlePhoneChange: N,
|
|
163
|
-
handleCountryCodeChange: S,
|
|
164
|
-
countryCodes: d,
|
|
165
|
-
countries: C,
|
|
166
|
-
popoverContainer: i
|
|
167
|
-
};
|
|
168
|
-
return /* @__PURE__ */ t.createElement(pe.Provider, {
|
|
169
|
-
value: I
|
|
170
|
-
}, /* @__PURE__ */ t.createElement(a, {
|
|
171
|
-
fieldId: n,
|
|
172
|
-
renderLabel: () => A,
|
|
173
|
-
renderInput: () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", {
|
|
174
|
-
ref: u,
|
|
175
|
-
style: {
|
|
176
|
-
display: "contents"
|
|
177
|
-
}
|
|
178
|
-
}), T),
|
|
179
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, $, L)
|
|
180
|
-
}));
|
|
181
|
-
}, Z = ({ children: e, className: n }) => {
|
|
182
|
-
const { inputId: r, labelId: o } = ie(), { hasError: a, disabled: l, readOnly: s } = M(), { t: i } = P(), { selectedCountryCode: u, countries: m } = _(), p = `${r}-country`, C = u ? m.find((N) => N.shortCountryCode === u) : void 0, d = C && Y(C.longCountryCode) || "", E = i("field.phone.country-code.aria-label"), y = C ? `${E}, ${C.countryName}, ${d}` : E;
|
|
183
|
-
return /* @__PURE__ */ t.createElement(Ke, {
|
|
184
|
-
isDisabled: l || s,
|
|
185
|
-
id: p,
|
|
186
|
-
"aria-label": y,
|
|
187
|
-
"aria-labelledby": o ? `${o} ${p}` : void 0,
|
|
188
|
-
className: n,
|
|
189
|
-
"data-invalid": a || void 0
|
|
190
|
-
}, e);
|
|
191
|
-
}, st = ({ className: e }) => {
|
|
192
|
-
const { selectedCountryCode: n, countries: r } = _(), o = r.find((a) => a.shortCountryCode === n);
|
|
193
|
-
return o ? /* @__PURE__ */ t.createElement(W, {
|
|
194
|
-
className: e,
|
|
195
|
-
longCountryCode: o.longCountryCode
|
|
196
|
-
}) : null;
|
|
197
|
-
}, ct = ({ children: e, className: n }) => {
|
|
198
|
-
const { selectedCountryCode: r, countries: o } = _();
|
|
199
|
-
return o.some((l) => l.shortCountryCode === r) ? null : /* @__PURE__ */ t.createElement("span", {
|
|
200
|
-
className: n
|
|
201
|
-
}, e);
|
|
202
|
-
};
|
|
203
|
-
Z.Flag = st;
|
|
204
|
-
Z.EmptyState = ct;
|
|
205
|
-
const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a, ...l }) => {
|
|
206
|
-
const { triggerRef: s, optionsRef: i, isForcedOpen: u } = l, { popoverContainer: m } = _(), p = h(e, g.Search), C = /* @__PURE__ */ t.createElement(Ee, {
|
|
207
|
-
isForcedOpen: u
|
|
208
|
-
}, e);
|
|
209
|
-
return /* @__PURE__ */ t.createElement(xe, {
|
|
210
|
-
getContainer: () => m
|
|
211
|
-
}, /* @__PURE__ */ t.createElement(He, {
|
|
212
|
-
ref: i,
|
|
213
|
-
triggerRef: s,
|
|
214
|
-
className: n,
|
|
215
|
-
placement: o,
|
|
216
|
-
offset: a,
|
|
217
|
-
containerPadding: 0
|
|
218
|
-
}, p && !u ? /* @__PURE__ */ t.createElement(me, {
|
|
219
|
-
"aria-label": r
|
|
220
|
-
}, C) : C));
|
|
221
|
-
}, lt = ({ children: e, className: n, overlayClassName: r, "aria-label": o, portalContainer: a = t.Fragment, ...l }) => {
|
|
222
|
-
const { optionsRef: s } = l, { selectedCountryCode: i, handleCountryCodeChange: u } = _(), m = K(Be);
|
|
223
|
-
return /* @__PURE__ */ t.createElement(Me, {
|
|
224
|
-
className: r,
|
|
225
|
-
isDismissable: !0
|
|
226
|
-
}, /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(qe, {
|
|
227
|
-
ref: s,
|
|
228
|
-
className: n
|
|
229
|
-
}, /* @__PURE__ */ t.createElement(me, {
|
|
230
|
-
"aria-label": o
|
|
231
|
-
}, /* @__PURE__ */ t.createElement(Ee, {
|
|
232
|
-
listBoxProps: {
|
|
233
|
-
"aria-label": o,
|
|
234
|
-
selectionMode: "single",
|
|
235
|
-
selectedKeys: i ? [
|
|
236
|
-
i
|
|
237
|
-
] : [],
|
|
238
|
-
onAction: (p) => {
|
|
239
|
-
u(p), m == null || m.close();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}, e)))));
|
|
243
|
-
}, Ee = ({ children: e, listBoxProps: n, isForcedOpen: r }) => {
|
|
244
|
-
const { countries: o } = _(), a = h(e, g.Option), l = h(e, g.Search), s = h(e, g.EmptyState), i = /* @__PURE__ */ t.createElement(we, {
|
|
245
|
-
...n,
|
|
246
|
-
renderEmptyState: s ? () => s : void 0
|
|
247
|
-
}, o.map((u) => {
|
|
248
|
-
const m = Y(u.longCountryCode) || "";
|
|
249
|
-
return H(a, {
|
|
250
|
-
key: u.shortCountryCode,
|
|
251
|
-
countryCode: u.shortCountryCode,
|
|
252
|
-
dialingCode: m,
|
|
253
|
-
countryName: u.countryName,
|
|
254
|
-
longCountryCode: u.longCountryCode
|
|
255
|
-
});
|
|
256
|
-
}));
|
|
257
|
-
return l ? /* @__PURE__ */ t.createElement(Ue, {
|
|
258
|
-
filter: (u, m, p) => {
|
|
259
|
-
const C = o.find((d) => d.shortCountryCode === p.key);
|
|
260
|
-
return !!C && rt(C, m);
|
|
261
|
-
}
|
|
262
|
-
}, r ? H(l, {
|
|
263
|
-
autoFocus: !1
|
|
264
|
-
}) : l, i) : i;
|
|
265
|
-
};
|
|
266
|
-
g.Popover = g;
|
|
267
|
-
g.Modal = lt;
|
|
268
|
-
const fe = ({ className: e, children: n, "aria-label": r, ...o }) => {
|
|
269
|
-
const { autoFocus: a = !0 } = o;
|
|
270
|
-
return /* @__PURE__ */ t.createElement(Ae, {
|
|
271
|
-
"aria-label": r,
|
|
272
|
-
autoFocus: a
|
|
273
|
-
}, /* @__PURE__ */ t.createElement(G, {
|
|
274
|
-
className: e
|
|
275
|
-
}, n));
|
|
276
|
-
}, ut = ({ className: e, placeholder: n }) => /* @__PURE__ */ t.createElement(Ce, {
|
|
277
|
-
className: e,
|
|
278
|
-
placeholder: n
|
|
279
|
-
});
|
|
280
|
-
fe.Input = ut;
|
|
281
|
-
g.Search = fe;
|
|
282
|
-
const it = ({ children: e, className: n }) => /* @__PURE__ */ t.createElement("div", {
|
|
283
|
-
className: n
|
|
284
|
-
}, e);
|
|
285
|
-
g.EmptyState = it;
|
|
286
|
-
const q = ({ children: e, className: n, ...r }) => {
|
|
287
|
-
const { countryCode: o, dialingCode: a, countryName: l, longCountryCode: s } = r, i = {
|
|
288
|
-
countryCode: o,
|
|
289
|
-
dialingCode: a,
|
|
290
|
-
countryName: l,
|
|
291
|
-
longCountryCode: s
|
|
292
|
-
}, u = e || /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(he, null), /* @__PURE__ */ t.createElement(ge, null), /* @__PURE__ */ t.createElement(be, null));
|
|
293
|
-
return /* @__PURE__ */ t.createElement(Te, {
|
|
294
|
-
className: n,
|
|
295
|
-
id: o,
|
|
296
|
-
textValue: `${l} ${a}`
|
|
297
|
-
}, /* @__PURE__ */ t.createElement(ye.Provider, {
|
|
298
|
-
value: i
|
|
299
|
-
}, u));
|
|
300
|
-
}, he = ({ className: e }) => {
|
|
301
|
-
const { longCountryCode: n } = z();
|
|
302
|
-
return /* @__PURE__ */ t.createElement(W, {
|
|
303
|
-
className: e,
|
|
304
|
-
longCountryCode: n
|
|
305
|
-
});
|
|
306
|
-
}, ge = ({ className: e }) => {
|
|
307
|
-
const { countryName: n } = z();
|
|
308
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
309
|
-
className: e
|
|
310
|
-
}, n);
|
|
311
|
-
}, be = ({ className: e }) => {
|
|
312
|
-
const { dialingCode: n } = z();
|
|
313
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
314
|
-
className: e
|
|
315
|
-
}, n);
|
|
316
|
-
};
|
|
317
|
-
q.Flag = he;
|
|
318
|
-
q.Name = ge;
|
|
319
|
-
q.Code = be;
|
|
320
|
-
g.Option = q;
|
|
321
|
-
const mt = ({ className: e }) => {
|
|
322
|
-
const { t: n } = P(), { inputId: r, ariaDescribedBy: o } = ie(), { id: a, placeholder: l, disabled: s, readOnly: i, required: u, label: m, hasError: p } = M(), { currentValue: C, handlePhoneChange: d } = _(), E = v(null);
|
|
323
|
-
return Se(() => {
|
|
324
|
-
var y;
|
|
325
|
-
(y = E.current) == null || y.focus({
|
|
326
|
-
preventScroll: !0
|
|
327
|
-
});
|
|
328
|
-
}, a), /* @__PURE__ */ t.createElement(Ce, {
|
|
329
|
-
ref: E,
|
|
330
|
-
id: r,
|
|
331
|
-
type: "tel",
|
|
332
|
-
value: C,
|
|
333
|
-
onChange: (y) => d(y.target.value),
|
|
334
|
-
disabled: s,
|
|
335
|
-
readOnly: i,
|
|
336
|
-
required: u,
|
|
337
|
-
"aria-label": `${m}. ${n("field.phone.aria-label")}`,
|
|
338
|
-
"aria-describedby": o,
|
|
339
|
-
"aria-invalid": p,
|
|
340
|
-
placeholder: l,
|
|
341
|
-
className: e
|
|
342
|
-
});
|
|
343
|
-
}, Ct = ({ children: e, className: n }) => {
|
|
344
|
-
const r = v(null), o = v(null), a = v(!1), { id: l, disabled: s, readOnly: i, required: u, hasError: m, showFlag: p, onFocus: C, onBlur: d } = M(), [E, y] = B(!1), N = Ye(d), { t: S } = P(), { selectedCountryCode: A, handleCountryCodeChange: T, countries: L } = _(), $ = h(e, c.CountryButton), I = h(e, c.CountryOptions.Modal), D = I ?? h(e, c.CountryOptions.Popover), F = h(e, c.PhoneNumber), R = L.length > 1, j = ze(l) && !I && R, Q = typeof n == "function" ? n({
|
|
345
|
-
hasCountryOptions: R
|
|
346
|
-
}) : n, J = {
|
|
347
|
-
onFocus: () => {
|
|
348
|
-
a.current || (a.current = !0, C == null || C());
|
|
349
|
-
},
|
|
350
|
-
onBlur: (w) => {
|
|
351
|
-
var te, ne;
|
|
352
|
-
const ee = w.relatedTarget;
|
|
353
|
-
!((te = r.current) != null && te.contains(ee)) && !((ne = o.current) != null && ne.contains(ee)) && (a.current = !1, N());
|
|
354
|
-
}
|
|
355
|
-
};
|
|
356
|
-
if (L.length === 1)
|
|
357
|
-
return /* @__PURE__ */ t.createElement(G, {
|
|
358
|
-
ref: r,
|
|
359
|
-
className: Q,
|
|
360
|
-
isDisabled: s,
|
|
361
|
-
isInvalid: m,
|
|
362
|
-
...J
|
|
363
|
-
}, p && /* @__PURE__ */ t.createElement(W, {
|
|
364
|
-
longCountryCode: L[0].longCountryCode
|
|
365
|
-
}), F);
|
|
366
|
-
const X = /* @__PURE__ */ t.createElement(t.Fragment, null, $, H(D, {
|
|
367
|
-
triggerRef: r,
|
|
368
|
-
optionsRef: o,
|
|
369
|
-
isForcedOpen: j
|
|
370
|
-
}));
|
|
371
|
-
return /* @__PURE__ */ t.createElement(G, {
|
|
372
|
-
ref: r,
|
|
373
|
-
className: Q,
|
|
374
|
-
isDisabled: s,
|
|
375
|
-
isInvalid: m,
|
|
376
|
-
...J
|
|
377
|
-
}, I ? /* @__PURE__ */ t.createElement($e, null, X) : /* @__PURE__ */ t.createElement(je, {
|
|
378
|
-
"aria-label": S("field.phone.country-code.aria-label"),
|
|
379
|
-
value: A ?? null,
|
|
380
|
-
onChange: (w) => T(w),
|
|
381
|
-
isDisabled: s || i,
|
|
382
|
-
isInvalid: m,
|
|
383
|
-
isRequired: u,
|
|
384
|
-
placeholder: "",
|
|
385
|
-
isOpen: j || E && !s && !i,
|
|
386
|
-
onOpenChange: j ? void 0 : y
|
|
387
|
-
}, X), F);
|
|
388
|
-
};
|
|
389
|
-
c.Label = Ge;
|
|
390
|
-
c.Control = Ct;
|
|
391
|
-
c.CountryButton = Z;
|
|
392
|
-
c.CountryOptions = g;
|
|
393
|
-
c.PhoneNumber = mt;
|
|
394
|
-
c.Description = ke;
|
|
395
|
-
c.Error = Ve;
|
|
396
|
-
const dt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
397
|
-
width: 24,
|
|
398
|
-
height: 24,
|
|
399
|
-
viewBox: "0 0 24 24",
|
|
400
|
-
fill: "currentColor",
|
|
401
|
-
"aria-hidden": "true",
|
|
402
|
-
...e
|
|
403
|
-
}, /* @__PURE__ */ t.createElement("path", {
|
|
404
|
-
fillRule: "evenodd",
|
|
405
|
-
d: "M11.5,19 C11.331,19 11.166,18.985 11,18.975 L11,16.5 C11,16.224 10.776,16 10.5,16 L9.5,16 C9.224,16 9,15.775 9,15.5 L9,12.5 C9,12.366 8.947,12.238 8.852,12.145 L4.804,8.14 C6.04,5.688 8.573,4 11.5,4 C12.76,4 13.946,4.315 14.989,4.866 L15,6.497 C15.001,6.631 14.949,6.757 14.855,6.853 C14.76,6.947 14.634,7 14.5,7 L12.339,7 C12.207,7 12.08,7.053 11.986,7.146 L10.146,8.983 C10.053,9.077 10,9.204 10,9.337 L10,10.5 C10,11.325 10.672,11.999 11.499,12 L15.293,12 L17,13.707 L17,16.582 C15.629,18.064 13.674,19 11.5,19 M4,11.5 C4,10.673 4.14,9.879 4.388,9.135 L8,12.709 L8,15.5 C8,16.327 8.673,17 9.5,17 L10,17 L10,18.849 C6.581,18.152 4,15.122 4,11.5 M19,11.5 C19,12.856 18.632,14.127 18,15.226 L18,13.5 C18,13.367 17.947,13.24 17.854,13.146 L15.854,11.146 C15.76,11.053 15.633,11 15.5,11 L11.5,11 C11.224,11 11,10.775 11,10.5 L11,9.544 L12.546,8 L14.5,8 C14.902,8 15.281,7.843 15.564,7.557 C15.848,7.271 16.003,6.892 16,6.49 L15.993,5.51 C17.814,6.879 19,9.051 19,11.5 M11.5,3 C6.813,3 3,6.813 3,11.5 C3,16.187 6.813,20 11.5,20 C16.187,20 20,16.187 20,11.5 C20,6.813 16.187,3 11.5,3"
|
|
406
|
-
})), pt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
407
|
-
width: 24,
|
|
408
|
-
height: 24,
|
|
409
|
-
viewBox: "0 0 24 24",
|
|
410
|
-
fill: "currentColor",
|
|
411
|
-
"aria-hidden": "true",
|
|
412
|
-
...e
|
|
413
|
-
}, /* @__PURE__ */ t.createElement("path", {
|
|
414
|
-
fillRule: "evenodd",
|
|
415
|
-
d: "M6.6108,14.3887 C5.5718,13.3497 4.9998,11.9687 4.9998,10.4997 C4.9998,9.0317 5.5718,7.6507 6.6108,6.6117 C7.6498,5.5727 9.0308,4.9997 10.4998,4.9997 C11.9688,4.9997 13.3498,5.5727 14.3888,6.6117 C15.4278,7.6507 15.9998,9.0317 15.9998,10.4997 C15.9998,11.9687 15.4278,13.3497 14.3888,14.3887 C13.3498,15.4277 11.9688,15.9997 10.4998,15.9997 C9.0308,15.9997 7.6498,15.4277 6.6108,14.3887 L6.6108,14.3887 Z M20.0028,19.2957 L15.4328,14.7247 C16.4438,13.5477 16.9998,12.0687 16.9998,10.4997 C16.9998,8.7637 16.3238,7.1317 15.0958,5.9047 C13.8688,4.6767 12.2358,3.9997 10.4998,3.9997 C8.7638,3.9997 7.1318,4.6767 5.9038,5.9047 C4.6758,7.1317 3.9998,8.7637 3.9998,10.4997 C3.9998,12.2367 4.6758,13.8677 5.9038,15.0957 C7.1318,16.3237 8.7638,16.9997 10.4998,16.9997 C12.0688,16.9997 13.5478,16.4437 14.7258,15.4317 L19.2958,20.0027 L20.0028,19.2957 Z"
|
|
416
|
-
})), yt = "_control_124jq_1", Et = "_countryButton_124jq_9", ft = "_chevron_124jq_25", ht = "_globeIcon_124jq_34", gt = "_searchIcon_124jq_35", bt = "_flag_124jq_44", Ot = "_phoneNumber_124jq_59", _t = "_countryOptions_124jq_85", Nt = "_option_124jq_93", St = "_countrySearch_124jq_102", Lt = "_mobileDrawer_124jq_110", It = "_name_124jq_119", Ft = "_code_124jq_123", vt = "_mobileOverlay_124jq_140", f = {
|
|
417
|
-
control: yt,
|
|
418
|
-
countryButton: Et,
|
|
419
|
-
chevron: ft,
|
|
420
|
-
globeIcon: ht,
|
|
421
|
-
searchIcon: gt,
|
|
422
|
-
flag: bt,
|
|
423
|
-
phoneNumber: Ot,
|
|
424
|
-
countryOptions: _t,
|
|
425
|
-
option: Nt,
|
|
426
|
-
countrySearch: St,
|
|
427
|
-
mobileDrawer: Lt,
|
|
428
|
-
name: It,
|
|
429
|
-
code: Ft,
|
|
430
|
-
mobileOverlay: vt
|
|
431
|
-
}, Pt = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(Oe, {
|
|
432
|
-
content: e,
|
|
433
|
-
locale: n
|
|
434
|
-
}), Dt = () => /* @__PURE__ */ t.createElement("span", {
|
|
435
|
-
className: f.chevron,
|
|
436
|
-
"aria-hidden": "true"
|
|
437
|
-
}, /* @__PURE__ */ t.createElement(Je, null)), Jt = () => {
|
|
438
|
-
const e = et(b.selectOptionWithoutFocusRing, f.option, ae), n = tt(f.countrySearch), { t: r } = P(), { isMobile: o, PortalContainer: a } = ue(), l = /* @__PURE__ */ t.createElement(c.CountryOptions.Search, {
|
|
439
|
-
className: n,
|
|
440
|
-
"aria-label": r("field.phone.country-search-input.aria-label")
|
|
441
|
-
}, /* @__PURE__ */ t.createElement(pt, {
|
|
442
|
-
className: f.searchIcon
|
|
443
|
-
}), /* @__PURE__ */ t.createElement(c.CountryOptions.Search.Input, {
|
|
444
|
-
className: O(b.innerInput, ae),
|
|
445
|
-
placeholder: r("field.phone.country-search-input.placeholder")
|
|
446
|
-
})), s = /* @__PURE__ */ t.createElement(c.CountryOptions.EmptyState, null, r("field.phone.country-selector-dropdown.no-result")), i = /* @__PURE__ */ t.createElement(c.CountryOptions.Option, {
|
|
447
|
-
className: e
|
|
448
|
-
}, /* @__PURE__ */ t.createElement(c.CountryOptions.Option.Flag, {
|
|
449
|
-
className: f.flag
|
|
450
|
-
}), /* @__PURE__ */ t.createElement(c.CountryOptions.Option.Name, {
|
|
451
|
-
className: f.name
|
|
452
|
-
}), /* @__PURE__ */ t.createElement(c.CountryOptions.Option.Code, {
|
|
453
|
-
className: f.code
|
|
454
|
-
}));
|
|
455
|
-
return /* @__PURE__ */ t.createElement(c, null, /* @__PURE__ */ t.createElement(c.Label, {
|
|
456
|
-
className: O(Le, b.label)
|
|
457
|
-
}, /* @__PURE__ */ t.createElement(c.Label.Required, {
|
|
458
|
-
className: O(Ie, b.requiredMark)
|
|
459
|
-
})), /* @__PURE__ */ t.createElement(c.Control, {
|
|
460
|
-
className: ({ hasCountryOptions: u }) => O(u ? Fe : ve, b.input, f.control)
|
|
461
|
-
}, /* @__PURE__ */ t.createElement(c.CountryButton, {
|
|
462
|
-
className: f.countryButton
|
|
463
|
-
}, /* @__PURE__ */ t.createElement(c.CountryButton.Flag, {
|
|
464
|
-
className: f.flag
|
|
465
|
-
}), /* @__PURE__ */ t.createElement(c.CountryButton.EmptyState, null, /* @__PURE__ */ t.createElement(dt, {
|
|
466
|
-
className: f.globeIcon
|
|
467
|
-
})), /* @__PURE__ */ t.createElement(Dt, null)), /* @__PURE__ */ t.createElement(c.PhoneNumber, {
|
|
468
|
-
className: O(b.innerInput, f.phoneNumber)
|
|
469
|
-
}), o ? /* @__PURE__ */ t.createElement(c.CountryOptions.Modal, {
|
|
470
|
-
className: O(b.selectPopover, f.mobileDrawer),
|
|
471
|
-
overlayClassName: f.mobileOverlay,
|
|
472
|
-
portalContainer: a,
|
|
473
|
-
"aria-label": r("field.phone.country-code.aria-label")
|
|
474
|
-
}, l, s, i) : /* @__PURE__ */ t.createElement(c.CountryOptions.Popover, {
|
|
475
|
-
className: O(Pe, b.selectPopover, f.countryOptions),
|
|
476
|
-
placement: "bottom start",
|
|
477
|
-
offset: 0,
|
|
478
|
-
"aria-label": r("field.phone.country-code.aria-label")
|
|
479
|
-
}, l, s, i)), /* @__PURE__ */ t.createElement(c.Error, {
|
|
480
|
-
className: O(De, b.error)
|
|
481
|
-
}, /* @__PURE__ */ t.createElement(Xe, null), /* @__PURE__ */ t.createElement(c.Error.Text, null)), /* @__PURE__ */ t.createElement(c.Description, {
|
|
482
|
-
className: O(Re, b.description)
|
|
483
|
-
}, Pt));
|
|
484
|
-
};
|
|
485
|
-
export {
|
|
486
|
-
Jt as P
|
|
487
|
-
};
|