@wix/form-elements 1.171.0 → 1.173.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-DZ0SFXmL.js → appointment-rac-DIV9zgmZ.js} +80 -80
- package/dist/component/{bookings-address-rac-BW9grc77.js → bookings-address-rac-C5cT4gkX.js} +1 -1
- package/dist/component/{bookings-email-rac-D8gMaAfB.js → bookings-email-rac-CQEhRS7N.js} +1 -1
- package/dist/component/{bookings-first-name-rac-CAjcs7b6.js → bookings-first-name-rac-BwdasJXd.js} +1 -1
- package/dist/component/{bookings-header-rac-BhKZ1kku.js → bookings-header-rac-CWzKq3yr.js} +1 -1
- package/dist/component/{bookings-last-name-rac-DpsMDuU0.js → bookings-last-name-rac-CoVWqEy5.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-BVdWmKS8.js → bookings-login-bar-rac-DwoI-iRQ.js} +4 -4
- package/dist/component/{bookings-phone-rac-DsqNi2mI.js → bookings-phone-rac-WAZU-1kD.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-elM4Ne3f.js → bookings-rich-text-rac-I5Uo-q87.js} +1 -1
- package/dist/component/{checkbox-field-rac-BU4E73fD.js → checkbox-field-rac-CKbKBNcQ.js} +43 -43
- package/dist/component/{checkbox-group-field-headless-6yJdIbP2.js → checkbox-group-field-headless-7PMj-zW6.js} +47 -47
- package/dist/component/{checkbox-group-field-rac-CojbCWSF.js → checkbox-group-field-rac-BZ-YgEYR.js} +4 -4
- package/dist/component/{checkbox-group-rac-3qUVUc-C.js → checkbox-group-rac-CED8h4qI.js} +1 -1
- package/dist/component/{checkbox-rac-DwbTapd_.js → checkbox-rac-CbpEXMBz.js} +1 -1
- package/dist/component/{contacts-address-rac-BL7XDZuP.js → contacts-address-rac-F3Ui7iJu.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DeJYIHAg.js → contacts-birthdate-rac-CcxRV3RQ.js} +1 -1
- package/dist/component/{contacts-company-rac-BeImf5uc.js → contacts-company-rac-mDY20HzW.js} +1 -1
- package/dist/component/{contacts-email-rac-CtacwrZ0.js → contacts-email-rac-CoBPNuCj.js} +1 -1
- package/dist/component/{contacts-first-name-rac-CAdOqOOA.js → contacts-first-name-rac-DzbpBmNm.js} +1 -1
- package/dist/component/{contacts-last-name-rac-Db9mHzCW.js → contacts-last-name-rac-DEmV-MNE.js} +1 -1
- package/dist/component/{contacts-phone-rac-W0OLEbzL.js → contacts-phone-rac-BlEpatWP.js} +1 -1
- package/dist/component/{contacts-position-rac-CV4Ibt4Z.js → contacts-position-rac-DlZahRQc.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-CQ3Q1pjZ.js → contacts-subscribe-rac-LXCEPvXl.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-Dux-pk6r.js → contacts-tax-id-rac-DS0SDAtC.js} +1 -1
- package/dist/component/{date-availability-RkX-Qw7G.js → date-availability-DTFyrU8J.js} +1 -1
- package/dist/component/{date-input-field-rac-CYCT6qoa.js → date-input-field-rac-D7Pv-hqW.js} +62 -62
- package/dist/component/{date-input-rac-BkYZ7q_o.js → date-input-rac-BEsh54Gz.js} +1 -1
- package/dist/component/{date-picker-field-rac-eMidYtsl.js → date-picker-field-rac-DJirD93a.js} +15 -15
- package/dist/component/{date-picker-rac-D23rxZcF.js → date-picker-rac-B1fUqj_w.js} +1 -1
- package/dist/component/{date-time-input-field-rac-BjIj4dXQ.js → date-time-input-field-rac-CPFaQUXF.js} +38 -38
- package/dist/component/{date-time-input-rac-BSGAdk9L.js → date-time-input-rac-CAozBO0e.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-Xmb5IKrb.js → dext-checkbox-group-rac-B0yqJoj8.js} +2 -2
- package/dist/component/{dext-checkbox-rac-2eA7y0ld.js → dext-checkbox-rac-yZaUdHz1.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CmLxVGGT.js → dext-date-picker-rac-AJ7XIW-h.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-Cd9nwSjb.js → dext-date-time-input-rac-CPs79sUY.js} +1 -1
- package/dist/component/{dext-dropdown-rac-BKdQ0nGS.js → dext-dropdown-rac-W2QzqPG4.js} +1 -1
- package/dist/component/{dext-email-rac-07zDPxyf.js → dext-email-rac-CCW1Dk1m.js} +1 -1
- package/dist/component/{dext-number-input-rac-DRvGuppY.js → dext-number-input-rac-BAInaxoF.js} +1 -1
- package/dist/component/{dext-phone-rac-CKtTVjFg.js → dext-phone-rac-CYYgZiFW.js} +1 -1
- package/dist/component/{dext-radio-group-rac-BsBmMufq.js → dext-radio-group-rac-Dqvmxoai.js} +2 -2
- package/dist/component/{dext-rating-input-rac-CcFSTAIh.js → dext-rating-input-rac-CWl7X0zW.js} +1 -1
- package/dist/component/{dext-tags-rac-CCTDlCvX.js → dext-tags-rac-BpAfPh55.js} +2 -2
- package/dist/component/{dext-text-area-rac-Cif8po9h.js → dext-text-area-rac-CLTg8XXH.js} +1 -1
- package/dist/component/{dext-text-input-rac-2118X4iF.js → dext-text-input-rac-BV-F-ZsP.js} +1 -1
- package/dist/component/{dext-url-input-rac-DDImGkQe.js → dext-url-input-rac-B9wHRaZr.js} +1 -1
- package/dist/component/{donation-rac-Dnylss1d.js → donation-rac-Be4swKWD.js} +50 -50
- package/dist/component/{dropdown-field-rac-DDI4ZgZH.js → dropdown-field-rac-BFEB_WuX.js} +3 -3
- package/dist/component/{dropdown-rac-DX0Z3R_8.js → dropdown-rac-Dz7QtFVB.js} +1 -1
- package/dist/component/{ecom-address-rac-D9MeEQsk.js → ecom-address-rac-Bu6msDgo.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-DKJ9j5dj.js → ecom-subscription-checkbox-rac-BRovQqrM.js} +2 -2
- package/dist/component/{email-input-field-rac-DaKrmlwe.js → email-input-field-rac-EERVxm6G.js} +42 -42
- package/dist/component/{events-repeater-rac-DWrOLT0Y.js → events-repeater-rac-xs0pooBs.js} +49 -49
- package/dist/component/{events-rsvp-rac-YBTR1tR0.js → events-rsvp-rac-CMi-8EqK.js} +3 -3
- package/dist/component/{field-error-headless-jksFrezt.js → field-error-headless-DbFXeaud.js} +8 -8
- package/dist/component/{field-label-headless-BBvJAVxI.js → field-label-headless-CWOYHPsb.js} +11 -11
- package/dist/component/{file-upload-rac-CgdmfUZG.js → file-upload-rac-vbMTIdDc.js} +61 -61
- package/dist/component/{fixed-payment-rac-v6rKwzFs.js → fixed-payment-rac-BRk7ams_.js} +7 -7
- package/dist/component/{form-BsiK682r.js → form-BjeODFzx.js} +238 -237
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-BuXybl7K.js → header-field-rac-CQexwZn7.js} +2 -2
- package/dist/component/{header-rac-CDyaLosW.js → header-rac-CYbPDl4_.js} +1 -1
- package/dist/component/{image-choice-rac-BRlMroBw.js → image-choice-rac-DDvlaK6K.js} +15 -15
- package/dist/component/{index-BanOeCAF.js → index-B6wFpWpe.js} +4 -4
- package/dist/component/{index-y9URYGEE.js → index-Bs9ypEe2.js} +6 -6
- package/dist/component/{isObjectLike-BG9nJ-rx.js → isObjectLike-Xcw2hQQ6.js} +1 -1
- package/dist/component/{multiline-address-field-rac-DRAkxI1l.js → multiline-address-field-rac-CYJR-MUz.js} +209 -209
- package/dist/component/{multiline-address-rac-JjTzWsEb.js → multiline-address-rac-DO1j_w6S.js} +1 -1
- package/dist/component/{number-input-field-rac-QrouG7Hv.js → number-input-field-rac-C-qvd8v9.js} +18 -18
- package/dist/component/{number-input-rac-DGmE7cLv.js → number-input-rac-CQSaifZE.js} +1 -1
- package/dist/component/{password-rac-DeyY228m.js → password-rac-CqnbZtR_.js} +28 -28
- package/dist/component/{payment-input-rac-DmIennLi.js → payment-input-rac-CbOcztkp.js} +28 -28
- package/dist/component/{phone-input-field-rac-F7e74TGA.js → phone-input-field-rac-BQ187I2C.js} +55 -55
- package/dist/component/{phone-rac-CQfB2CQD.js → phone-rac-CbA2xqF3.js} +1 -1
- package/dist/component/{product-list-rac--GGG8vvO.js → product-list-rac-MxB9tRiE.js} +103 -103
- package/dist/component/{quiz-radio-group-rac-DF2C2vNq.js → quiz-radio-group-rac-IViaDVRW.js} +1 -1
- package/dist/component/{radio-button-module-classes-DmpNo6F2.js → radio-button-module-classes-jtnooKMO.js} +33 -33
- package/dist/component/{radio-group-field-rac-BGcPYfKO.js → radio-group-field-rac-g3SQGJPp.js} +4 -4
- package/dist/component/{radio-group-rac-CqysUMCE.js → radio-group-rac-D8wmzlbu.js} +1 -1
- package/dist/component/{rating-input-field-rac-D-ei917Y.js → rating-input-field-rac-BqPXKKdi.js} +15 -15
- package/dist/component/{rating-input-rac-a9zJ74fw.js → rating-input-rac-CeZIpOmm.js} +1 -1
- package/dist/component/{rich-content-rac.module-CvyLVlXL.js → rich-content-rac.module-BLgdpRh_.js} +5 -5
- package/dist/component/{rich-text-field-rac-vf19nvyw.js → rich-text-field-rac-BpSVobCQ.js} +6 -6
- package/dist/component/{rich-text-rac-Cx_wpoxC.js → rich-text-rac-DqpaqbFH.js} +1 -1
- package/dist/component/{service-dropdown-rac-DITzKQxd.js → service-dropdown-rac-DKgtga1t.js} +30 -30
- package/dist/component/{services-multi-choice-rac-BtisN0Aq.js → services-multi-choice-rac-CAyB0b4q.js} +9 -9
- package/dist/component/{signature-rac-DUeIoS5O.js → signature-rac-DC20YN4f.js} +97 -97
- package/dist/component/{submit-button-rac-C8h6zeTw.js → submit-button-rac-ClWtqIkR.js} +30 -30
- package/dist/component/{tags-field-rac-CjFuiB0n.js → tags-field-rac-DHM9k8uf.js} +18 -18
- package/dist/component/{tags-rac-BO7rwyLl.js → tags-rac-Clg50jwY.js} +1 -1
- package/dist/component/{text-area-field-rac-CgUx3nQ0.js → text-area-field-rac-B2qJZ6wR.js} +16 -16
- package/dist/component/{text-area-rac-WgXYXIaf.js → text-area-rac-BwsVk7u7.js} +1 -1
- package/dist/component/{text-input-field-rac-DaxWFha-.js → text-input-field-rac-BQbo-3Ly.js} +6 -6
- package/dist/component/{text-input-headless-hjuRJTZN.js → text-input-headless-WICGIHcN.js} +3 -3
- package/dist/component/{text-input-rac-BzumrJBj.js → text-input-rac-D7BRYDZr.js} +1 -1
- package/dist/component/{time-input-rac-2FEkpQ7M.js → time-input-rac-Dnp-0_Js.js} +22 -22
- package/dist/component/{url-input-field-rac-BZ9f8D8I.js → url-input-field-rac-MC13zKST.js} +19 -19
- package/dist/component/{url-input-rac-D-AVlxkD.js → url-input-rac-DfAtTmKv.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-DwAAtzgX.js → use-dropdown-option-class-name-CVUEosg4.js} +2 -2
- package/dist/component/{use-dropdown-trigger-class-name-D-6n9YVG.js → use-dropdown-trigger-class-name-BHLG7EB-.js} +25 -25
- package/dist/component/{use-element-state-class-name-C5auxwhj.js → use-element-state-class-name-BVJylHPn.js} +3 -3
- package/dist/component/{use-hoverable-input-class-name-Nd2jqfz4.js → use-hoverable-input-class-name-DO9ctJ81.js} +2 -2
- package/dist/component/{use-is-forced-open-dropdown-CKaHhCqp.js → use-is-forced-open-dropdown-Czuo32Nq.js} +8 -8
- package/dist/component/{use-service-options-base-CvluFheT.js → use-service-options-base-DUuGIm38.js} +1 -1
- package/dist/component/use-text-input-class-name-LEnNGX0a.js +6 -0
- package/package.json +2 -2
- package/dist/component/use-text-input-class-name-DGTlYJxC.js +0 -6
package/dist/component/{phone-input-field-rac-F7e74TGA.js → phone-input-field-rac-BQ187I2C.js}
RENAMED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { RicosViewer as ye } from "@wix/ricos/viewer";
|
|
2
2
|
import O from "classnames";
|
|
3
|
-
import t, { useMemo as
|
|
4
|
-
import {
|
|
3
|
+
import t, { useMemo as $, useState as A, useRef as F, useEffect as V, useCallback as Z, createContext as ne, useContext as q, useId as Ee } from "react";
|
|
4
|
+
import { bu as fe, bV as D, bD as oe, bU as he, bL as w, bI as re, bN as ge, X as Oe, am as be, a3 as Q, M as _e, I as Ne, a5 as Le, a4 as Se, a2 as Ie } from "./form-BjeODFzx.js";
|
|
5
5
|
import { UNSAFE_PortalProvider as Pe } from "react-aria";
|
|
6
|
-
import { Dialog as ae, OverlayTriggerStateContext as ve, ModalOverlay as Fe, Modal as De, SearchField as we, Group as
|
|
6
|
+
import { Dialog as ae, OverlayTriggerStateContext as ve, ModalOverlay as Fe, Modal as De, SearchField as we, Group as H, ListBoxItem as Be, DialogTrigger as Re, Select as xe, Input as se, Autocomplete as Me } from "react-aria-components";
|
|
7
7
|
import { f as h, a as I } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as je, E as
|
|
9
|
-
import { L as
|
|
10
|
-
import { N as
|
|
11
|
-
import { u as
|
|
12
|
-
import { d as
|
|
13
|
-
import { V as
|
|
14
|
-
import ce, { AsYouType as Ge, isValidPhoneNumber as
|
|
8
|
+
import { D as je, E as $e } from "./field-error-headless-DbFXeaud.js";
|
|
9
|
+
import { L as Ae } from "./field-label-headless-CWOYHPsb.js";
|
|
10
|
+
import { N as Te, S as Ve } from "./non-modal-popover-D-u13tmp.js";
|
|
11
|
+
import { u as ke } from "./use-invoke-callback-UH73A_J3.js";
|
|
12
|
+
import { d as Ue } from "./use-is-forced-open-dropdown-Czuo32Nq.js";
|
|
13
|
+
import { V as He, a as qe } from "./use-dropdown-option-class-name-CVUEosg4.js";
|
|
14
|
+
import ce, { AsYouType as Ge, isValidPhoneNumber as Ye, isSupportedCountry as ze } from "libphonenumber-js";
|
|
15
15
|
import "libphonenumber-js/metadata.min.json";
|
|
16
16
|
import { C as W } from "./calling-country-codes-PyWuOTmF.js";
|
|
17
|
-
import { C as
|
|
17
|
+
import { C as Ke } from "./chevron-down-icon-CcpVm6B-.js";
|
|
18
18
|
import { E as Ze } from "./error-icon-hZxQ6DEy.js";
|
|
19
19
|
import { H as X } from "./custom-focus-class-_483Pkwp.js";
|
|
20
20
|
import { s as b } from "./field-rac.module-ts2t4WUO.js";
|
|
21
|
-
import { u as J } from "./use-hoverable-input-class-name-
|
|
21
|
+
import { u as J } from "./use-hoverable-input-class-name-DO9ctJ81.js";
|
|
22
22
|
function ee(e) {
|
|
23
23
|
const n = e ? ce(e) : void 0, r = n == null ? void 0 : n.country;
|
|
24
24
|
if (r)
|
|
@@ -30,14 +30,14 @@ function G(e) {
|
|
|
30
30
|
var n;
|
|
31
31
|
return e && ((n = fe.getCountryByKey(e)) == null ? void 0 : n.dialCode);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function k(e) {
|
|
34
34
|
return e === null ? null : e.replace(/[^0-9+]/g, "") || e;
|
|
35
35
|
}
|
|
36
36
|
function te(e, n) {
|
|
37
37
|
if (e && n)
|
|
38
38
|
try {
|
|
39
39
|
const r = ce(e, n), o = r == null ? void 0 : r.formatInternational();
|
|
40
|
-
if (o &&
|
|
40
|
+
if (o && Ye(o))
|
|
41
41
|
return o.replace(/\s+/g, "");
|
|
42
42
|
} catch {
|
|
43
43
|
}
|
|
@@ -45,9 +45,9 @@ function te(e, n) {
|
|
|
45
45
|
}
|
|
46
46
|
function Qe() {
|
|
47
47
|
const { t: e } = D(), { language: n } = oe();
|
|
48
|
-
return
|
|
48
|
+
return $(() => Object.keys(W).reduce((o, a) => {
|
|
49
49
|
const c = W[a], l = G(c), i = e(`locale-dataset.countries.${c.toUpperCase()}`);
|
|
50
|
-
return l &&
|
|
50
|
+
return l && ze(a) && o.push({
|
|
51
51
|
countryName: i,
|
|
52
52
|
longCountryCode: c,
|
|
53
53
|
shortCountryCode: a,
|
|
@@ -63,30 +63,30 @@ function We(e, n) {
|
|
|
63
63
|
}
|
|
64
64
|
function Xe(e, n) {
|
|
65
65
|
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
66
|
-
return !!(
|
|
66
|
+
return !!(U(r, n) || U(o, n) || U(a, n));
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function U(e, n) {
|
|
69
69
|
return e.toLowerCase().includes(n.toLowerCase());
|
|
70
70
|
}
|
|
71
71
|
function Je({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
72
|
-
const [a, c] =
|
|
72
|
+
const [a, c] = A(e || ""), l = F(k(e ?? null) ?? ""), [i, u] = A(n);
|
|
73
73
|
he(() => {
|
|
74
74
|
c(""), l.current = "", u(n), o("");
|
|
75
75
|
});
|
|
76
|
-
const p =
|
|
76
|
+
const p = $(() => ee(a), [
|
|
77
77
|
a
|
|
78
78
|
]);
|
|
79
|
-
|
|
79
|
+
V(() => {
|
|
80
80
|
const m = e ?? "";
|
|
81
81
|
m !== l.current && (c(m), l.current = m);
|
|
82
82
|
}, [
|
|
83
83
|
e
|
|
84
|
-
]),
|
|
84
|
+
]), V(() => {
|
|
85
85
|
n && !i && u(n);
|
|
86
86
|
}, [
|
|
87
87
|
n,
|
|
88
88
|
i
|
|
89
|
-
]),
|
|
89
|
+
]), V(() => {
|
|
90
90
|
u(n ?? p);
|
|
91
91
|
}, [
|
|
92
92
|
p,
|
|
@@ -99,7 +99,7 @@ function Je({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange:
|
|
|
99
99
|
}
|
|
100
100
|
const f = ee(m);
|
|
101
101
|
u((y) => {
|
|
102
|
-
const S = f || y || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), N =
|
|
102
|
+
const S = f || y || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), N = k(te(m, S));
|
|
103
103
|
return l.current = N ?? "", o(N), f || y;
|
|
104
104
|
});
|
|
105
105
|
}, [
|
|
@@ -107,7 +107,7 @@ function Je({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange:
|
|
|
107
107
|
o
|
|
108
108
|
]), d = Z((m) => {
|
|
109
109
|
u(m), c((f) => {
|
|
110
|
-
const y =
|
|
110
|
+
const y = k(te(f, m));
|
|
111
111
|
return l.current = y ?? "", o(y), f;
|
|
112
112
|
});
|
|
113
113
|
}, [
|
|
@@ -125,12 +125,12 @@ const le = /* @__PURE__ */ ne(null), _ = () => {
|
|
|
125
125
|
if (!e)
|
|
126
126
|
throw new Error("Phone input components must be used within PhoneInput component");
|
|
127
127
|
return e;
|
|
128
|
-
}, ue = /* @__PURE__ */ ne(null),
|
|
128
|
+
}, ue = /* @__PURE__ */ ne(null), Y = () => {
|
|
129
129
|
const e = q(ue);
|
|
130
130
|
if (!e)
|
|
131
131
|
throw new Error("Option sub-components must be used within Option component");
|
|
132
132
|
return e;
|
|
133
|
-
},
|
|
133
|
+
}, z = ({ longCountryCode: e, className: n }) => {
|
|
134
134
|
function r(c, l) {
|
|
135
135
|
const i = "https://static.parastorage.com/services/linguist-flags/1.1005.0/assets/flags/square/", p = `${c}${l === "2x" ? "_2x" : ""}.png`;
|
|
136
136
|
return `${i}${p}`;
|
|
@@ -146,10 +146,10 @@ const le = /* @__PURE__ */ ne(null), _ = () => {
|
|
|
146
146
|
});
|
|
147
147
|
}, s = ({ children: e }) => {
|
|
148
148
|
var L, v;
|
|
149
|
-
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } = w(), [i, u] =
|
|
149
|
+
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } = w(), [i, u] = A(null), p = (v = (L = l == null ? void 0 : l.string) == null ? void 0 : L.phoneOptions) == null ? void 0 : v.allowedCountryCodes, C = Qe(), d = $(() => We(C, p), [
|
|
150
150
|
C,
|
|
151
151
|
p
|
|
152
|
-
]), m =
|
|
152
|
+
]), m = $(() => d.map((j) => j.shortCountryCode), [
|
|
153
153
|
d
|
|
154
154
|
]), { currentValue: f, selectedCountryCode: y, handlePhoneChange: S, handleCountryCodeChange: N } = Je({
|
|
155
155
|
value: r,
|
|
@@ -178,9 +178,9 @@ const le = /* @__PURE__ */ ne(null), _ = () => {
|
|
|
178
178
|
}), R),
|
|
179
179
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, M, x)
|
|
180
180
|
}));
|
|
181
|
-
},
|
|
181
|
+
}, K = ({ children: e, className: n }) => {
|
|
182
182
|
const { labelId: r } = re(), { hasError: o, disabled: a, readOnly: c } = w(), { t: l } = D(), { selectedCountryCode: i, countries: u } = _(), p = Ee(), C = i ? u.find((y) => y.shortCountryCode === i) : void 0, d = C && G(C.longCountryCode) || "", m = l("field.phone.country-code.aria-label"), f = C ? `${m}, ${C.countryName}, ${d}` : m;
|
|
183
|
-
return /* @__PURE__ */ t.createElement(
|
|
183
|
+
return /* @__PURE__ */ t.createElement(Ve, {
|
|
184
184
|
isDisabled: a || c,
|
|
185
185
|
id: p,
|
|
186
186
|
"aria-label": f,
|
|
@@ -190,7 +190,7 @@ const le = /* @__PURE__ */ ne(null), _ = () => {
|
|
|
190
190
|
}, e);
|
|
191
191
|
}, et = ({ className: e }) => {
|
|
192
192
|
const { selectedCountryCode: n, countries: r } = _(), o = r.find((a) => a.shortCountryCode === n);
|
|
193
|
-
return o ? /* @__PURE__ */ t.createElement(
|
|
193
|
+
return o ? /* @__PURE__ */ t.createElement(z, {
|
|
194
194
|
className: e,
|
|
195
195
|
longCountryCode: o.longCountryCode
|
|
196
196
|
}) : null;
|
|
@@ -200,8 +200,8 @@ const le = /* @__PURE__ */ ne(null), _ = () => {
|
|
|
200
200
|
className: n
|
|
201
201
|
}, e);
|
|
202
202
|
};
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
K.Flag = et;
|
|
204
|
+
K.EmptyState = tt;
|
|
205
205
|
const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a, ...c }) => {
|
|
206
206
|
const { triggerRef: l, optionsRef: i, isForcedOpen: u, isOpen: p } = c, { popoverContainer: C } = _(), d = h(e, g.Search);
|
|
207
207
|
if (!p)
|
|
@@ -211,7 +211,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
211
211
|
}, e);
|
|
212
212
|
return /* @__PURE__ */ t.createElement(Pe, {
|
|
213
213
|
getContainer: () => C
|
|
214
|
-
}, /* @__PURE__ */ t.createElement(
|
|
214
|
+
}, /* @__PURE__ */ t.createElement(Te, {
|
|
215
215
|
ref: i,
|
|
216
216
|
triggerRef: l,
|
|
217
217
|
className: n,
|
|
@@ -245,7 +245,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
245
245
|
}
|
|
246
246
|
}, e)))));
|
|
247
247
|
}, ie = ({ children: e, listBoxProps: n, isForcedOpen: r }) => {
|
|
248
|
-
const { countries: o } = _(), a = h(e, g.Option), c = h(e, g.Search), l = h(e, g.EmptyState), i = /* @__PURE__ */ t.createElement(
|
|
248
|
+
const { countries: o } = _(), a = h(e, g.Option), c = h(e, g.Search), l = h(e, g.EmptyState), i = /* @__PURE__ */ t.createElement(He, {
|
|
249
249
|
isForcedOpen: r === !0,
|
|
250
250
|
...n,
|
|
251
251
|
renderEmptyState: l ? () => l : void 0
|
|
@@ -275,7 +275,7 @@ const me = ({ className: e, children: n, "aria-label": r, ...o }) => {
|
|
|
275
275
|
return /* @__PURE__ */ t.createElement(we, {
|
|
276
276
|
"aria-label": r,
|
|
277
277
|
autoFocus: a
|
|
278
|
-
}, /* @__PURE__ */ t.createElement(
|
|
278
|
+
}, /* @__PURE__ */ t.createElement(H, {
|
|
279
279
|
className: e
|
|
280
280
|
}, n));
|
|
281
281
|
}, ot = ({ className: e, placeholder: n }) => /* @__PURE__ */ t.createElement(se, {
|
|
@@ -288,7 +288,7 @@ const rt = ({ children: e, className: n }) => /* @__PURE__ */ t.createElement("d
|
|
|
288
288
|
className: n
|
|
289
289
|
}, e);
|
|
290
290
|
g.EmptyState = rt;
|
|
291
|
-
const
|
|
291
|
+
const T = ({ children: e, className: n, ...r }) => {
|
|
292
292
|
const { countryCode: o, dialingCode: a, countryName: c, longCountryCode: l } = r, i = {
|
|
293
293
|
countryCode: o,
|
|
294
294
|
dialingCode: a,
|
|
@@ -303,26 +303,26 @@ const A = ({ children: e, className: n, ...r }) => {
|
|
|
303
303
|
value: i
|
|
304
304
|
}, u));
|
|
305
305
|
}, pe = ({ className: e }) => {
|
|
306
|
-
const { longCountryCode: n } =
|
|
307
|
-
return /* @__PURE__ */ t.createElement(
|
|
306
|
+
const { longCountryCode: n } = Y();
|
|
307
|
+
return /* @__PURE__ */ t.createElement(z, {
|
|
308
308
|
className: e,
|
|
309
309
|
longCountryCode: n
|
|
310
310
|
});
|
|
311
311
|
}, Ce = ({ className: e }) => {
|
|
312
|
-
const { countryName: n } =
|
|
312
|
+
const { countryName: n } = Y();
|
|
313
313
|
return /* @__PURE__ */ t.createElement("span", {
|
|
314
314
|
className: e
|
|
315
315
|
}, n);
|
|
316
316
|
}, de = ({ className: e }) => {
|
|
317
|
-
const { dialingCode: n } =
|
|
317
|
+
const { dialingCode: n } = Y();
|
|
318
318
|
return /* @__PURE__ */ t.createElement("span", {
|
|
319
319
|
className: e
|
|
320
320
|
}, n);
|
|
321
321
|
};
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
g.Option =
|
|
322
|
+
T.Flag = pe;
|
|
323
|
+
T.Name = Ce;
|
|
324
|
+
T.Code = de;
|
|
325
|
+
g.Option = T;
|
|
326
326
|
const at = ({ className: e }) => {
|
|
327
327
|
const { t: n } = D(), { inputId: r, ariaDescribedBy: o } = re(), { id: a, placeholder: c, disabled: l, readOnly: i, required: u, label: p, hasError: C } = w(), { currentValue: d, handlePhoneChange: m } = _(), f = F(null);
|
|
328
328
|
return ge(() => {
|
|
@@ -347,7 +347,7 @@ const at = ({ className: e }) => {
|
|
|
347
347
|
className: e
|
|
348
348
|
});
|
|
349
349
|
}, st = ({ children: e, ...n }) => {
|
|
350
|
-
const r = n, { isForcedOpen: o } = r, { disabled: a, readOnly: c, required: l, hasError: i } = w(), [u, p] =
|
|
350
|
+
const r = n, { isForcedOpen: o } = r, { disabled: a, readOnly: c, required: l, hasError: i } = w(), [u, p] = A(!1), { t: C } = D(), { selectedCountryCode: d, handleCountryCodeChange: m } = _(), f = o || u && !a && !c;
|
|
351
351
|
return /* @__PURE__ */ t.createElement(xe, {
|
|
352
352
|
"aria-label": C("field.phone.country-code.aria-label"),
|
|
353
353
|
value: d ?? null,
|
|
@@ -367,7 +367,7 @@ const at = ({ className: e }) => {
|
|
|
367
367
|
const r = n;
|
|
368
368
|
return /* @__PURE__ */ t.createElement(Re, null, h(e, s.CountryButton), I(h(e, s.CountryOptions.Modal), r));
|
|
369
369
|
}, lt = ({ children: e, className: n }) => {
|
|
370
|
-
const r = F(null), o = F(null), a = F(!1), { id: c, disabled: l, hasError: i, showFlag: u, onFocus: p, onBlur: C } = w(), d =
|
|
370
|
+
const r = F(null), o = F(null), a = F(!1), { id: c, disabled: l, hasError: i, showFlag: u, onFocus: p, onBlur: C } = w(), d = ke(C), { countries: m } = _(), f = h(e, s.CountryDrawer), y = h(e, s.CountryPopover), S = h(e, s.PhoneNumber), N = m.length > 1, B = Ue(c) && !!y && N, R = typeof n == "function" ? ({ isHovered: P, isFocusWithin: L }) => n({
|
|
371
371
|
hasCountryOptions: N,
|
|
372
372
|
isHovered: P,
|
|
373
373
|
isFocusWithin: L
|
|
@@ -385,15 +385,15 @@ const at = ({ className: e }) => {
|
|
|
385
385
|
!((v = r.current) != null && v.contains(L)) && !((j = o.current) != null && j.contains(L)) && (a.current = !1, d());
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
|
-
return m.length === 1 ? /* @__PURE__ */ t.createElement(
|
|
388
|
+
return m.length === 1 ? /* @__PURE__ */ t.createElement(H, {
|
|
389
389
|
ref: r,
|
|
390
390
|
className: R,
|
|
391
391
|
isDisabled: l,
|
|
392
392
|
isInvalid: i,
|
|
393
393
|
...M
|
|
394
|
-
}, u && /* @__PURE__ */ t.createElement(
|
|
394
|
+
}, u && /* @__PURE__ */ t.createElement(z, {
|
|
395
395
|
longCountryCode: m[0].longCountryCode
|
|
396
|
-
}), S) : /* @__PURE__ */ t.createElement(
|
|
396
|
+
}), S) : /* @__PURE__ */ t.createElement(H, {
|
|
397
397
|
ref: r,
|
|
398
398
|
className: R,
|
|
399
399
|
isDisabled: l,
|
|
@@ -401,15 +401,15 @@ const at = ({ className: e }) => {
|
|
|
401
401
|
...M
|
|
402
402
|
}, !B && I(f, x), I(y, x), S);
|
|
403
403
|
};
|
|
404
|
-
s.Label =
|
|
404
|
+
s.Label = Ae;
|
|
405
405
|
s.Control = lt;
|
|
406
|
-
s.CountryButton =
|
|
406
|
+
s.CountryButton = K;
|
|
407
407
|
s.CountryDrawer = ct;
|
|
408
408
|
s.CountryPopover = st;
|
|
409
409
|
s.CountryOptions = g;
|
|
410
410
|
s.PhoneNumber = at;
|
|
411
411
|
s.Description = je;
|
|
412
|
-
s.Error =
|
|
412
|
+
s.Error = $e;
|
|
413
413
|
const ut = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
414
414
|
width: 24,
|
|
415
415
|
height: 24,
|
|
@@ -453,7 +453,7 @@ const ut = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
453
453
|
}), vt = () => /* @__PURE__ */ t.createElement("span", {
|
|
454
454
|
className: E.chevron,
|
|
455
455
|
"aria-hidden": "true"
|
|
456
|
-
}, /* @__PURE__ */ t.createElement(
|
|
456
|
+
}, /* @__PURE__ */ t.createElement(Ke, null)), Qt = () => {
|
|
457
457
|
const e = qe(Se, b.selectOptionWithoutFocusRing, E.option, X), n = J(Ie, [
|
|
458
458
|
E.control
|
|
459
459
|
]), r = J(Le, [
|