@wix/form-elements 1.106.0 → 1.108.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-D2F4vgf1.js → appointment-rac-ZAp8oWbK.js} +289 -290
- package/dist/component/{bookings-address-rac-_5S8J8_i.js → bookings-address-rac-x-Az7vHf.js} +1 -1
- package/dist/component/{bookings-email-rac-6vmDR9nS.js → bookings-email-rac-MoF_CaqB.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DtTJ4T2K.js → bookings-first-name-rac-CWh3Rb0M.js} +1 -1
- package/dist/component/{bookings-header-rac-B3dsEwzR.js → bookings-header-rac-BVTiXUWk.js} +1 -1
- package/dist/component/{bookings-last-name-rac-B3idkbi8.js → bookings-last-name-rac-kXRRlyHl.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CrRBcQwT.js → bookings-login-bar-rac-C4Zr6kXE.js} +23 -24
- package/dist/component/{bookings-phone-rac-BE0yWNnj.js → bookings-phone-rac-2rz1m_xi.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CYo1l0-6.js → bookings-rich-text-rac-BEjGypQw.js} +1 -1
- package/dist/component/{checkbox-field-rac-boTtXVEt.js → checkbox-field-rac-DwEQLIaz.js} +66 -67
- package/dist/component/{checkbox-group-field-headless-DnkUvDm8.js → checkbox-group-field-headless-BsOww_QB.js} +37 -37
- package/dist/component/{checkbox-group-field-rac-DrDTgHMg.js → checkbox-group-field-rac-DTcZcVS6.js} +6 -6
- package/dist/component/{checkbox-group-rac-v3ozUBpo.js → checkbox-group-rac-DQsML-pW.js} +1 -1
- package/dist/component/{checkbox-rac-YSLE-RnG.js → checkbox-rac-irEBBOxP.js} +1 -1
- package/dist/component/{contacts-address-rac-C653yaHZ.js → contacts-address-rac-B5bSAYrm.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-BeAQ6shx.js → contacts-birthdate-rac-DyScj8f4.js} +1 -1
- package/dist/component/{contacts-company-rac-BglKOoTG.js → contacts-company-rac-C5X9-jXa.js} +1 -1
- package/dist/component/{contacts-email-rac-D6m7ynfc.js → contacts-email-rac-B0vkfmrS.js} +1 -1
- package/dist/component/{contacts-first-name-rac-Dgxn0tUJ.js → contacts-first-name-rac-Cfil3U_e.js} +1 -1
- package/dist/component/{contacts-last-name-rac-1UyIuRKH.js → contacts-last-name-rac-CtPLE-7-.js} +1 -1
- package/dist/component/{contacts-phone-rac-BQ77BlW4.js → contacts-phone-rac-YkzsAoBZ.js} +1 -1
- package/dist/component/{contacts-position-rac-BUDUv7lv.js → contacts-position-rac-BS4j8QC-.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DdtA0qKW.js → contacts-subscribe-rac-z_9VsEZL.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-WUaKcNl0.js → contacts-tax-id-rac-WFkmKyZv.js} +1 -1
- package/dist/component/{date-availability-XjBFq8jt.js → date-availability-NN3rxosk.js} +1 -1
- package/dist/component/{date-input-field-rac-aY2zuuKs.js → date-input-field-rac-mdhEC3oq.js} +88 -89
- package/dist/component/{date-input-rac-DRiP2_97.js → date-input-rac-CGciuoTx.js} +1 -1
- package/dist/component/{date-picker-field-rac-Bzl-d3Uj.js → date-picker-field-rac-CRZVODfF.js} +90 -91
- package/dist/component/{date-picker-rac-DHHUh8vn.js → date-picker-rac-Bfbvjy8W.js} +1 -1
- package/dist/component/{date-time-input-field-rac-DP_StuLr.js → date-time-input-field-rac-TDWBXZ44.js} +76 -77
- package/dist/component/{date-time-input-rac-B11KIxsf.js → date-time-input-rac-DY0qdSix.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BHZBqyWv.js → dext-checkbox-group-rac-BFGM7SOt.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BIlAqEvV.js → dext-checkbox-rac-DPZvTeUZ.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CHBXNrZi.js → dext-date-picker-rac-Xd5kojsQ.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BYtliKry.js → dext-date-time-input-rac-C0RIdxJW.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C2VPSFV5.js → dext-dropdown-rac-D1m8vJvm.js} +1 -1
- package/dist/component/{dext-email-rac-Fnb0Ggcs.js → dext-email-rac-BC81RFYY.js} +1 -1
- package/dist/component/{dext-number-input-rac-DopfSyFi.js → dext-number-input-rac-Z_ih9FfX.js} +1 -1
- package/dist/component/{dext-phone-rac-Rn4i_2rc.js → dext-phone-rac-s3BOnXuI.js} +1 -1
- package/dist/component/{dext-radio-group-rac-bNaskJpK.js → dext-radio-group-rac-CL3jcezs.js} +2 -2
- package/dist/component/{dext-rating-input-rac-DL6ZZd7d.js → dext-rating-input-rac-wz1EyP5b.js} +1 -1
- package/dist/component/{dext-tags-rac-TsUPoImO.js → dext-tags-rac-BY4Rf2BP.js} +2 -2
- package/dist/component/{dext-text-area-rac-BIuY7LTd.js → dext-text-area-rac-DRJzlsq8.js} +1 -1
- package/dist/component/{dext-text-input-rac-CSYPW0Qi.js → dext-text-input-rac-BGcRNNAi.js} +1 -1
- package/dist/component/{dext-url-input-rac-_g0lqGfW.js → dext-url-input-rac-CRAIm8yp.js} +1 -1
- package/dist/component/{donation-rac-BYKFtsyR.js → donation-rac-BlTfOIlE.js} +83 -84
- package/dist/component/{dropdown-field-headless-CBaqlNZi.js → dropdown-field-headless-DhzRAMcM.js} +12 -12
- package/dist/component/{dropdown-field-rac-CCAGSMm3.js → dropdown-field-rac-DXyY5we-.js} +5 -5
- package/dist/component/{dropdown-rac-C_EqUsZ1.js → dropdown-rac-C6YM6qxm.js} +1 -1
- package/dist/component/{ecom-address-rac-Bw9eH0iF.js → ecom-address-rac-CAdr7wya.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-B5PVOO2a.js → ecom-subscription-checkbox-rac-Z2VMuCbt.js} +6 -6
- package/dist/component/{email-input-field-rac-B2kqQ6yo.js → email-input-field-rac-DpkfunVK.js} +53 -54
- package/dist/component/{events-repeater-rac--4OnUxWE.js → events-repeater-rac-CuJkdrPo.js} +61 -62
- package/dist/component/{events-rsvp-rac-CczCoo3T.js → events-rsvp-rac-BKWlSeQ9.js} +8 -8
- package/dist/component/{field-error-headless-D3-1L5sf.js → field-error-headless-tsg9FQ-_.js} +12 -12
- package/dist/component/{field-label-headless-Du4ckIVy.js → field-label-headless-CB8dEat8.js} +11 -11
- package/dist/component/{file-upload-rac-DbdkUbWM.js → file-upload-rac-ZdgYt646.js} +67 -68
- package/dist/component/{fixed-payment-rac-f9-01iDN.js → fixed-payment-rac-CuIQEeHh.js} +20 -21
- package/dist/component/{form-DQauhsho.js → form-0jt4L5xo.js} +3045 -2896
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/header-field-rac-CWVGzxKb.js +24 -0
- package/dist/component/{header-rac-CR9T3Pnu.js → header-rac-D6KsV-ko.js} +1 -1
- package/dist/component/{image-choice-rac-DJ_8v467.js → image-choice-rac-CUCyVS8c.js} +29 -30
- package/dist/component/{index-BB7d_9Dv.js → index-TJSnVtCO.js} +72 -72
- package/dist/component/{index-CcUTIUWM.js → index-iOqQidgV.js} +12 -12
- package/dist/component/{isObjectLike-xvPa_08X.js → isObjectLike-DQbx8r1c.js} +1 -1
- package/dist/component/{multiline-address-field-rac-CyaFOloE.js → multiline-address-field-rac-DtZ1NTfD.js} +186 -187
- package/dist/component/{multiline-address-rac-CaHGUN_f.js → multiline-address-rac-ub-_XzHU.js} +1 -1
- package/dist/component/number-input-field-rac-DLItn4DK.js +92 -0
- package/dist/component/{number-input-rac-DMKX6nhk.js → number-input-rac-UuxJzqEx.js} +1 -1
- package/dist/component/{password-rac-0RUXPAn6.js → password-rac-Di6q96Rn.js} +37 -38
- package/dist/component/{payment-input-rac-CHSZ3-Lt.js → payment-input-rac-CG6c4-Ge.js} +52 -53
- package/dist/component/{phone-input-field-rac-JmIFcP1e.js → phone-input-field-rac-D4JphCuT.js} +75 -76
- package/dist/component/{phone-rac-BLRnAPXP.js → phone-rac-_vDw2usa.js} +1 -1
- package/dist/component/{product-list-rac-BkF5tDwt.js → product-list-rac-CgxRlj1f.js} +73 -74
- package/dist/component/{quiz-radio-group-rac-32cCMTUS.js → quiz-radio-group-rac-bi26aGxN.js} +1 -1
- package/dist/component/{radio-button-module-classes-IOulhuSH.js → radio-button-module-classes-DDJq2ESf.js} +33 -33
- package/dist/component/{radio-group-field-rac-CJwku6e0.js → radio-group-field-rac-D1aMVO6l.js} +4 -4
- package/dist/component/{radio-group-rac-BiW-9Abj.js → radio-group-rac-HKC85M6t.js} +1 -1
- package/dist/component/{rating-input-field-rac-B9cwaROK.js → rating-input-field-rac-CpRehxFB.js} +42 -43
- package/dist/component/{rating-input-rac-BpwlNvzQ.js → rating-input-rac-BMuCZ3oj.js} +1 -1
- package/dist/component/{rich-content-rac.module-B1uyPmtK.js → rich-content-rac.module-mZ6xoAOd.js} +4 -4
- package/dist/component/rich-text-field-rac-CUK8V8Kf.js +21 -0
- package/dist/component/{rich-text-rac-VfeZxS27.js → rich-text-rac-B-7sR2FJ.js} +1 -1
- package/dist/component/{service-dropdown-rac-BCfs8IhW.js → service-dropdown-rac-1DDNT5bn.js} +43 -44
- package/dist/component/{services-multi-choice-rac-CCqdF_7P.js → services-multi-choice-rac-CB-6dwxz.js} +21 -22
- package/dist/component/{signature-rac-DOyMo3u0.js → signature-rac-7XBci6P2.js} +35 -36
- package/dist/component/{submit-button-rac-C2uA5DeE.js → submit-button-rac-B1-Mk8Gg.js} +21 -22
- package/dist/component/{tags-field-rac-C_uIw2by.js → tags-field-rac-CQ9Y7mq-.js} +49 -50
- package/dist/component/{tags-rac-1pQ-fpe_.js → tags-rac-Visic-Ml.js} +1 -1
- package/dist/component/{text-area-field-rac-DqlOkm7e.js → text-area-field-rac-C8fP1g-w.js} +31 -32
- package/dist/component/{text-area-rac-DPdkrFcH.js → text-area-rac-B6yZxzxm.js} +1 -1
- package/dist/component/{text-input-field-rac-CmXm6r1w.js → text-input-field-rac-CNjbOxD1.js} +5 -5
- package/dist/component/{text-input-headless-DD__2DFf.js → text-input-headless-Bm8PJGep.js} +12 -12
- package/dist/component/{text-input-rac-DRHyQEH7.js → text-input-rac-BEPC1Z-4.js} +1 -1
- package/dist/component/{time-input-rac-BJPIymQY.js → time-input-rac-3m6C_Jp5.js} +41 -42
- package/dist/component/url-input-field-rac-CIk_6Lf6.js +74 -0
- package/dist/component/{url-input-rac-C0ChQUzq.js → url-input-rac-DyVoygXH.js} +1 -1
- package/dist/component/use-dropdown-option-class-name-McG3ayOT.js +21 -0
- package/dist/component/{use-element-state-class-name-BatTc2bw.js → use-element-state-class-name-B9MBWX44.js} +1 -1
- package/dist/component/{use-is-forced-open-dropdown-B0jiPTmS.js → use-is-forced-open-dropdown-r5G_sZsO.js} +7 -7
- package/dist/component/{use-service-options-base-oeE7xszw.js → use-service-options-base-hcbkvhpw.js} +7 -7
- package/dist/component/use-text-input-class-name-SnurFqAr.js +23 -0
- package/dist/form.d.ts +3 -1
- package/package.json +2 -2
- package/dist/component/form-element-classes-bLFmhsKw.js +0 -137
- package/dist/component/header-field-rac-DamDk5BR.js +0 -25
- package/dist/component/number-input-field-rac-BuYUzDWV.js +0 -93
- package/dist/component/rich-text-field-rac-C_qE7Ykg.js +0 -22
- package/dist/component/url-input-field-rac-CFDYkZ6I.js +0 -75
- package/dist/component/use-dropdown-option-class-name-3L5ZmNLK.js +0 -21
- package/dist/component/use-text-input-class-name-LQ5S-NLh.js +0 -24
package/dist/component/{phone-input-field-rac-JmIFcP1e.js → phone-input-field-rac-D4JphCuT.js}
RENAMED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import { RicosViewer as Oe } from "@wix/ricos/viewer";
|
|
2
2
|
import O from "classnames";
|
|
3
|
-
import t, { useMemo as x, useState as B, useRef as
|
|
4
|
-
import {
|
|
5
|
-
import { UNSAFE_PortalProvider as
|
|
6
|
-
import { Dialog as me, OverlayTriggerStateContext as
|
|
3
|
+
import t, { useMemo as x, useState as B, useRef as P, useEffect as U, useCallback as oe, createContext as le, useContext as Y } from "react";
|
|
4
|
+
import { aQ as _e, bf as v, aZ as ue, be as Ne, b5 as M, b2 as ie, b7 as Se, H as Le, T as Ie, t as Fe, G as Pe, J as ve, u as De, p as Re } from "./form-0jt4L5xo.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 Te, Group as G, ListBoxItem as Ae, DialogTrigger as $e, Select as je, Input as Ce, ListBox as we, Autocomplete as Ue } from "react-aria-components";
|
|
7
7
|
import { f as h, a as H } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as
|
|
9
|
-
import { L as
|
|
10
|
-
import { N as
|
|
11
|
-
import { u as
|
|
12
|
-
import { u as
|
|
13
|
-
import de, { AsYouType as
|
|
8
|
+
import { D as ke, E as Ve } from "./field-error-headless-tsg9FQ-_.js";
|
|
9
|
+
import { L as Ge } from "./field-label-headless-CB8dEat8.js";
|
|
10
|
+
import { N as He, S as Ye } from "./non-modal-popover-DtIMXHbe.js";
|
|
11
|
+
import { u as Ze } from "./use-invoke-callback-UH73A_J3.js";
|
|
12
|
+
import { u as ze } from "./use-is-forced-open-dropdown-r5G_sZsO.js";
|
|
13
|
+
import de, { AsYouType as Ke, isValidPhoneNumber as Qe, isSupportedCountry as We } from "libphonenumber-js";
|
|
14
14
|
import "libphonenumber-js/metadata.min.json";
|
|
15
15
|
import { C as re } from "./calling-country-codes-PyWuOTmF.js";
|
|
16
|
-
import { C as
|
|
17
|
-
import { E as
|
|
16
|
+
import { C as Je } from "./chevron-down-icon-CcpVm6B-.js";
|
|
17
|
+
import { E as Xe } from "./error-icon-hZxQ6DEy.js";
|
|
18
18
|
import { H as ae } from "./custom-focus-class-_483Pkwp.js";
|
|
19
19
|
import { s as b } from "./field-rac.module-B4l_0KRU.js";
|
|
20
|
-
import {
|
|
21
|
-
import { u as
|
|
22
|
-
import { u as tt } from "./use-text-input-class-name-LQ5S-NLh.js";
|
|
20
|
+
import { u as et } from "./use-dropdown-option-class-name-McG3ayOT.js";
|
|
21
|
+
import { u as tt } from "./use-text-input-class-name-SnurFqAr.js";
|
|
23
22
|
function se(e) {
|
|
24
23
|
const n = e ? de(e) : void 0, r = n == null ? void 0 : n.country;
|
|
25
24
|
if (r)
|
|
26
25
|
return r;
|
|
27
|
-
const o = new
|
|
26
|
+
const o = new Ke();
|
|
28
27
|
return e && o.input(e), o.getCountry();
|
|
29
28
|
}
|
|
30
|
-
function
|
|
29
|
+
function Z(e) {
|
|
31
30
|
var n;
|
|
32
31
|
return e && ((n = _e.getCountryByKey(e)) == null ? void 0 : n.dialCode);
|
|
33
32
|
}
|
|
@@ -38,17 +37,17 @@ function ce(e, n) {
|
|
|
38
37
|
if (e && n)
|
|
39
38
|
try {
|
|
40
39
|
const r = de(e, n), o = r == null ? void 0 : r.formatInternational();
|
|
41
|
-
if (o &&
|
|
40
|
+
if (o && Qe(o))
|
|
42
41
|
return o.replace(/\s+/g, "");
|
|
43
42
|
} catch {
|
|
44
43
|
}
|
|
45
44
|
return e;
|
|
46
45
|
}
|
|
47
46
|
function nt() {
|
|
48
|
-
const { t: e } =
|
|
47
|
+
const { t: e } = v(), { language: n } = ue();
|
|
49
48
|
return x(() => Object.keys(re).reduce((o, a) => {
|
|
50
|
-
const l = re[a], s =
|
|
51
|
-
return s &&
|
|
49
|
+
const l = re[a], s = Z(l), i = e(`locale-dataset.countries.${l.toUpperCase()}`);
|
|
50
|
+
return s && We(a) && o.push({
|
|
52
51
|
countryName: i,
|
|
53
52
|
longCountryCode: l,
|
|
54
53
|
shortCountryCode: a,
|
|
@@ -70,7 +69,7 @@ function V(e, n) {
|
|
|
70
69
|
return e.toLowerCase().includes(n.toLowerCase());
|
|
71
70
|
}
|
|
72
71
|
function at({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
73
|
-
const [a, l] = B(e || ""), s =
|
|
72
|
+
const [a, l] = B(e || ""), s = P(k(e ?? null) ?? ""), [i, u] = B(n);
|
|
74
73
|
Ne(() => {
|
|
75
74
|
l(""), s.current = "", u(n), o("");
|
|
76
75
|
});
|
|
@@ -126,12 +125,12 @@ const pe = /* @__PURE__ */ le(null), _ = () => {
|
|
|
126
125
|
if (!e)
|
|
127
126
|
throw new Error("Phone input components must be used within PhoneInput component");
|
|
128
127
|
return e;
|
|
129
|
-
}, ye = /* @__PURE__ */ le(null),
|
|
128
|
+
}, ye = /* @__PURE__ */ le(null), z = () => {
|
|
130
129
|
const e = Y(ye);
|
|
131
130
|
if (!e)
|
|
132
131
|
throw new Error("Option sub-components must be used within Option component");
|
|
133
132
|
return e;
|
|
134
|
-
},
|
|
133
|
+
}, K = ({ longCountryCode: e, className: n }) => {
|
|
135
134
|
function r(l, s) {
|
|
136
135
|
const i = "https://static.parastorage.com/services/linguist-flags/1.1005.0/assets/flags/square/", m = `${l}${s === "2x" ? "_2x" : ""}.png`;
|
|
137
136
|
return `${i}${m}`;
|
|
@@ -157,7 +156,7 @@ const pe = /* @__PURE__ */ le(null), _ = () => {
|
|
|
157
156
|
defaultCountryCode: l,
|
|
158
157
|
allowedCountryCodes: d,
|
|
159
158
|
onChange: o
|
|
160
|
-
}),
|
|
159
|
+
}), T = h(e, c.Label), A = h(e, c.Control), L = h(e, c.Description), $ = h(e, c.Error), I = {
|
|
161
160
|
currentValue: E,
|
|
162
161
|
selectedCountryCode: y,
|
|
163
162
|
handlePhoneChange: N,
|
|
@@ -170,18 +169,18 @@ const pe = /* @__PURE__ */ le(null), _ = () => {
|
|
|
170
169
|
value: I
|
|
171
170
|
}, /* @__PURE__ */ t.createElement(a, {
|
|
172
171
|
fieldId: n,
|
|
173
|
-
renderLabel: () =>
|
|
172
|
+
renderLabel: () => T,
|
|
174
173
|
renderInput: () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", {
|
|
175
174
|
ref: u,
|
|
176
175
|
style: {
|
|
177
176
|
display: "contents"
|
|
178
177
|
}
|
|
179
|
-
}),
|
|
178
|
+
}), A),
|
|
180
179
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, $, L)
|
|
181
180
|
}));
|
|
182
|
-
},
|
|
183
|
-
const { inputId: r, labelId: o } = ie(), { hasError: a, disabled: l, readOnly: s } = M(), { t: i } =
|
|
184
|
-
return /* @__PURE__ */ t.createElement(
|
|
181
|
+
}, Q = ({ children: e, className: n }) => {
|
|
182
|
+
const { inputId: r, labelId: o } = ie(), { hasError: a, disabled: l, readOnly: s } = M(), { t: i } = v(), { selectedCountryCode: u, countries: m } = _(), p = `${r}-country`, C = u ? m.find((N) => N.shortCountryCode === u) : void 0, d = C && Z(C.longCountryCode) || "", E = i("field.phone.country-code.aria-label"), y = C ? `${E}, ${C.countryName}, ${d}` : E;
|
|
183
|
+
return /* @__PURE__ */ t.createElement(Ye, {
|
|
185
184
|
isDisabled: l || s,
|
|
186
185
|
id: p,
|
|
187
186
|
"aria-label": y,
|
|
@@ -191,7 +190,7 @@ const pe = /* @__PURE__ */ le(null), _ = () => {
|
|
|
191
190
|
}, e);
|
|
192
191
|
}, st = ({ className: e }) => {
|
|
193
192
|
const { selectedCountryCode: n, countries: r } = _(), o = r.find((a) => a.shortCountryCode === n);
|
|
194
|
-
return o ? /* @__PURE__ */ t.createElement(
|
|
193
|
+
return o ? /* @__PURE__ */ t.createElement(K, {
|
|
195
194
|
className: e,
|
|
196
195
|
longCountryCode: o.longCountryCode
|
|
197
196
|
}) : null;
|
|
@@ -201,15 +200,15 @@ const pe = /* @__PURE__ */ le(null), _ = () => {
|
|
|
201
200
|
className: n
|
|
202
201
|
}, e);
|
|
203
202
|
};
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
Q.Flag = st;
|
|
204
|
+
Q.EmptyState = ct;
|
|
206
205
|
const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a, ...l }) => {
|
|
207
206
|
const { triggerRef: s, optionsRef: i, isForcedOpen: u } = l, { popoverContainer: m } = _(), p = h(e, g.Search), C = /* @__PURE__ */ t.createElement(Ee, {
|
|
208
207
|
isForcedOpen: u
|
|
209
208
|
}, e);
|
|
210
|
-
return /* @__PURE__ */ t.createElement(
|
|
209
|
+
return /* @__PURE__ */ t.createElement(xe, {
|
|
211
210
|
getContainer: () => m
|
|
212
|
-
}, /* @__PURE__ */ t.createElement(
|
|
211
|
+
}, /* @__PURE__ */ t.createElement(He, {
|
|
213
212
|
ref: i,
|
|
214
213
|
triggerRef: s,
|
|
215
214
|
className: n,
|
|
@@ -220,11 +219,11 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
220
219
|
"aria-label": r
|
|
221
220
|
}, C) : C));
|
|
222
221
|
}, lt = ({ children: e, className: n, overlayClassName: r, "aria-label": o, portalContainer: a = t.Fragment, ...l }) => {
|
|
223
|
-
const { optionsRef: s } = l, { selectedCountryCode: i, handleCountryCodeChange: u } = _(), m = Y(
|
|
224
|
-
return /* @__PURE__ */ t.createElement(
|
|
222
|
+
const { optionsRef: s } = l, { selectedCountryCode: i, handleCountryCodeChange: u } = _(), m = Y(Be);
|
|
223
|
+
return /* @__PURE__ */ t.createElement(Me, {
|
|
225
224
|
className: r,
|
|
226
225
|
isDismissable: !0
|
|
227
|
-
}, /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(
|
|
226
|
+
}, /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(qe, {
|
|
228
227
|
ref: s,
|
|
229
228
|
className: n
|
|
230
229
|
}, /* @__PURE__ */ t.createElement(me, {
|
|
@@ -242,11 +241,11 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
242
241
|
}
|
|
243
242
|
}, e)))));
|
|
244
243
|
}, Ee = ({ children: e, listBoxProps: n, isForcedOpen: r }) => {
|
|
245
|
-
const { countries: o } = _(), a = h(e, g.Option), l = h(e, g.Search), s = h(e, g.EmptyState), i = /* @__PURE__ */ t.createElement(
|
|
244
|
+
const { countries: o } = _(), a = h(e, g.Option), l = h(e, g.Search), s = h(e, g.EmptyState), i = /* @__PURE__ */ t.createElement(we, {
|
|
246
245
|
...n,
|
|
247
246
|
renderEmptyState: s ? () => s : void 0
|
|
248
247
|
}, o.map((u) => {
|
|
249
|
-
const m =
|
|
248
|
+
const m = Z(u.longCountryCode) || "";
|
|
250
249
|
return H(a, {
|
|
251
250
|
key: u.shortCountryCode,
|
|
252
251
|
countryCode: u.shortCountryCode,
|
|
@@ -255,7 +254,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
255
254
|
longCountryCode: u.longCountryCode
|
|
256
255
|
});
|
|
257
256
|
}));
|
|
258
|
-
return l ? /* @__PURE__ */ t.createElement(
|
|
257
|
+
return l ? /* @__PURE__ */ t.createElement(Ue, {
|
|
259
258
|
filter: (u, m, p) => {
|
|
260
259
|
const C = o.find((d) => d.shortCountryCode === p.key);
|
|
261
260
|
return !!C && rt(C, m);
|
|
@@ -268,7 +267,7 @@ g.Popover = g;
|
|
|
268
267
|
g.Modal = lt;
|
|
269
268
|
const fe = ({ className: e, children: n, "aria-label": r, ...o }) => {
|
|
270
269
|
const { autoFocus: a = !0 } = o;
|
|
271
|
-
return /* @__PURE__ */ t.createElement(
|
|
270
|
+
return /* @__PURE__ */ t.createElement(Te, {
|
|
272
271
|
"aria-label": r,
|
|
273
272
|
autoFocus: a
|
|
274
273
|
}, /* @__PURE__ */ t.createElement(G, {
|
|
@@ -291,7 +290,7 @@ const q = ({ children: e, className: n, ...r }) => {
|
|
|
291
290
|
countryName: l,
|
|
292
291
|
longCountryCode: s
|
|
293
292
|
}, u = e || /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(he, null), /* @__PURE__ */ t.createElement(ge, null), /* @__PURE__ */ t.createElement(be, null));
|
|
294
|
-
return /* @__PURE__ */ t.createElement(
|
|
293
|
+
return /* @__PURE__ */ t.createElement(Ae, {
|
|
295
294
|
className: n,
|
|
296
295
|
id: o,
|
|
297
296
|
textValue: `${l} ${a}`
|
|
@@ -299,18 +298,18 @@ const q = ({ children: e, className: n, ...r }) => {
|
|
|
299
298
|
value: i
|
|
300
299
|
}, u));
|
|
301
300
|
}, he = ({ className: e }) => {
|
|
302
|
-
const { longCountryCode: n } =
|
|
303
|
-
return /* @__PURE__ */ t.createElement(
|
|
301
|
+
const { longCountryCode: n } = z();
|
|
302
|
+
return /* @__PURE__ */ t.createElement(K, {
|
|
304
303
|
className: e,
|
|
305
304
|
longCountryCode: n
|
|
306
305
|
});
|
|
307
306
|
}, ge = ({ className: e }) => {
|
|
308
|
-
const { countryName: n } =
|
|
307
|
+
const { countryName: n } = z();
|
|
309
308
|
return /* @__PURE__ */ t.createElement("span", {
|
|
310
309
|
className: e
|
|
311
310
|
}, n);
|
|
312
311
|
}, be = ({ className: e }) => {
|
|
313
|
-
const { dialingCode: n } =
|
|
312
|
+
const { dialingCode: n } = z();
|
|
314
313
|
return /* @__PURE__ */ t.createElement("span", {
|
|
315
314
|
className: e
|
|
316
315
|
}, n);
|
|
@@ -320,7 +319,7 @@ q.Name = ge;
|
|
|
320
319
|
q.Code = be;
|
|
321
320
|
g.Option = q;
|
|
322
321
|
const mt = ({ className: e }) => {
|
|
323
|
-
const { t: n } =
|
|
322
|
+
const { t: n } = v(), { 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 = P(null);
|
|
324
323
|
return Se(() => {
|
|
325
324
|
var y;
|
|
326
325
|
(y = E.current) == null || y.focus({
|
|
@@ -342,9 +341,9 @@ const mt = ({ className: e }) => {
|
|
|
342
341
|
className: e
|
|
343
342
|
});
|
|
344
343
|
}, Ct = ({ children: e, className: n }) => {
|
|
345
|
-
const r =
|
|
344
|
+
const r = P(null), o = P(null), a = P(!1), { id: l, disabled: s, readOnly: i, required: u, hasError: m, showFlag: p, onFocus: C, onBlur: d } = M(), [E, y] = B(!1), N = Ze(d), { t: S } = v(), { selectedCountryCode: T, handleCountryCodeChange: A, 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, W = typeof n == "function" ? n({
|
|
346
345
|
hasCountryOptions: R
|
|
347
|
-
}) : n,
|
|
346
|
+
}) : n, J = {
|
|
348
347
|
onFocus: () => {
|
|
349
348
|
a.current || (a.current = !0, C == null || C());
|
|
350
349
|
},
|
|
@@ -357,11 +356,11 @@ const mt = ({ className: e }) => {
|
|
|
357
356
|
if (L.length === 1)
|
|
358
357
|
return /* @__PURE__ */ t.createElement(G, {
|
|
359
358
|
ref: r,
|
|
360
|
-
className:
|
|
359
|
+
className: W,
|
|
361
360
|
isDisabled: s,
|
|
362
361
|
isInvalid: m,
|
|
363
|
-
...
|
|
364
|
-
}, p && /* @__PURE__ */ t.createElement(
|
|
362
|
+
...J
|
|
363
|
+
}, p && /* @__PURE__ */ t.createElement(K, {
|
|
365
364
|
longCountryCode: L[0].longCountryCode
|
|
366
365
|
}), F);
|
|
367
366
|
const X = /* @__PURE__ */ t.createElement(t.Fragment, null, $, H(D, {
|
|
@@ -371,14 +370,14 @@ const mt = ({ className: e }) => {
|
|
|
371
370
|
}));
|
|
372
371
|
return /* @__PURE__ */ t.createElement(G, {
|
|
373
372
|
ref: r,
|
|
374
|
-
className:
|
|
373
|
+
className: W,
|
|
375
374
|
isDisabled: s,
|
|
376
375
|
isInvalid: m,
|
|
377
|
-
...
|
|
378
|
-
}, I ? /* @__PURE__ */ t.createElement(
|
|
376
|
+
...J
|
|
377
|
+
}, I ? /* @__PURE__ */ t.createElement($e, null, X) : /* @__PURE__ */ t.createElement(je, {
|
|
379
378
|
"aria-label": S("field.phone.country-code.aria-label"),
|
|
380
|
-
value:
|
|
381
|
-
onChange: (w) =>
|
|
379
|
+
value: T ?? null,
|
|
380
|
+
onChange: (w) => A(w),
|
|
382
381
|
isDisabled: s || i,
|
|
383
382
|
isInvalid: m,
|
|
384
383
|
isRequired: u,
|
|
@@ -387,13 +386,13 @@ const mt = ({ className: e }) => {
|
|
|
387
386
|
onOpenChange: j ? void 0 : y
|
|
388
387
|
}, X), F);
|
|
389
388
|
};
|
|
390
|
-
c.Label =
|
|
389
|
+
c.Label = Ge;
|
|
391
390
|
c.Control = Ct;
|
|
392
|
-
c.CountryButton =
|
|
391
|
+
c.CountryButton = Q;
|
|
393
392
|
c.CountryOptions = g;
|
|
394
393
|
c.PhoneNumber = mt;
|
|
395
|
-
c.Description =
|
|
396
|
-
c.Error =
|
|
394
|
+
c.Description = ke;
|
|
395
|
+
c.Error = Ve;
|
|
397
396
|
const dt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
398
397
|
width: 24,
|
|
399
398
|
height: 24,
|
|
@@ -414,7 +413,7 @@ const dt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
414
413
|
}, /* @__PURE__ */ t.createElement("path", {
|
|
415
414
|
fillRule: "evenodd",
|
|
416
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"
|
|
417
|
-
})), 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",
|
|
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", Pt = "_mobileOverlay_124jq_140", f = {
|
|
418
417
|
control: yt,
|
|
419
418
|
countryButton: Et,
|
|
420
419
|
chevron: ft,
|
|
@@ -428,15 +427,15 @@ const dt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
428
427
|
mobileDrawer: Lt,
|
|
429
428
|
name: It,
|
|
430
429
|
code: Ft,
|
|
431
|
-
mobileOverlay:
|
|
432
|
-
},
|
|
430
|
+
mobileOverlay: Pt
|
|
431
|
+
}, vt = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(Oe, {
|
|
433
432
|
content: e,
|
|
434
433
|
locale: n
|
|
435
434
|
}), Dt = () => /* @__PURE__ */ t.createElement("span", {
|
|
436
435
|
className: f.chevron,
|
|
437
436
|
"aria-hidden": "true"
|
|
438
|
-
}, /* @__PURE__ */ t.createElement(
|
|
439
|
-
const e = et(b.selectOptionWithoutFocusRing, f.option, ae), n = tt(f.countrySearch), { t: r } =
|
|
437
|
+
}, /* @__PURE__ */ t.createElement(Je, null)), Jt = () => {
|
|
438
|
+
const e = et(b.selectOptionWithoutFocusRing, f.option, ae), n = tt(f.countrySearch), { t: r } = v(), { isMobile: o, PortalContainer: a } = ue(), l = /* @__PURE__ */ t.createElement(c.CountryOptions.Search, {
|
|
440
439
|
className: n,
|
|
441
440
|
"aria-label": r("field.phone.country-search-input.aria-label")
|
|
442
441
|
}, /* @__PURE__ */ t.createElement(pt, {
|
|
@@ -454,11 +453,11 @@ const dt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
454
453
|
className: f.code
|
|
455
454
|
}));
|
|
456
455
|
return /* @__PURE__ */ t.createElement(c, null, /* @__PURE__ */ t.createElement(c.Label, {
|
|
457
|
-
className: O(
|
|
456
|
+
className: O(Le, b.label)
|
|
458
457
|
}, /* @__PURE__ */ t.createElement(c.Label.Required, {
|
|
459
|
-
className: O(
|
|
458
|
+
className: O(Ie, b.requiredMark)
|
|
460
459
|
})), /* @__PURE__ */ t.createElement(c.Control, {
|
|
461
|
-
className: ({ hasCountryOptions: u }) => O(u ?
|
|
460
|
+
className: ({ hasCountryOptions: u }) => O(u ? Fe : Pe, b.input, f.control)
|
|
462
461
|
}, /* @__PURE__ */ t.createElement(c.CountryButton, {
|
|
463
462
|
className: f.countryButton
|
|
464
463
|
}, /* @__PURE__ */ t.createElement(c.CountryButton.Flag, {
|
|
@@ -473,16 +472,16 @@ const dt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
473
472
|
portalContainer: a,
|
|
474
473
|
"aria-label": r("field.phone.country-code.aria-label")
|
|
475
474
|
}, l, s, i) : /* @__PURE__ */ t.createElement(c.CountryOptions.Popover, {
|
|
476
|
-
className: O(
|
|
475
|
+
className: O(ve, b.selectPopover, f.countryOptions),
|
|
477
476
|
placement: "bottom start",
|
|
478
477
|
offset: 0,
|
|
479
478
|
"aria-label": r("field.phone.country-code.aria-label")
|
|
480
479
|
}, l, s, i)), /* @__PURE__ */ t.createElement(c.Error, {
|
|
481
|
-
className: O(
|
|
482
|
-
}, /* @__PURE__ */ t.createElement(
|
|
483
|
-
className: O(
|
|
484
|
-
},
|
|
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
|
+
}, vt));
|
|
485
484
|
};
|
|
486
485
|
export {
|
|
487
|
-
|
|
486
|
+
Jt as P
|
|
488
487
|
};
|