@wix/form-elements 1.91.0 → 1.92.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-CDZ0Gdin.js → appointment-rac-bw0pvoxP.js} +4 -4
- package/dist/component/{bookings-address-rac-pmQyMw-1.js → bookings-address-rac-DECq7eWR.js} +1 -1
- package/dist/component/{bookings-email-rac-CzDEYpBV.js → bookings-email-rac-DTLjh6Zw.js} +1 -1
- package/dist/component/{bookings-first-name-rac-qg7T37FZ.js → bookings-first-name-rac-DObRe-Gq.js} +1 -1
- package/dist/component/{bookings-header-rac-Dmwmt_Cp.js → bookings-header-rac-DjpmYRJG.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CXTtlnYI.js → bookings-last-name-rac-Ds3o0ABM.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DTs9s6hU.js → bookings-login-bar-rac-DPUL2jWj.js} +1 -1
- package/dist/component/{bookings-phone-rac-C7AEVZA-.js → bookings-phone-rac-DIIHPxEP.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CBGVMqOn.js → bookings-rich-text-rac-BrcQO9xx.js} +1 -1
- package/dist/component/{checkbox-field-rac-BggtF6cZ.js → checkbox-field-rac-CD1MP1LT.js} +4 -4
- package/dist/component/{checkbox-group-field-headless-O2ZsF7An.js → checkbox-group-field-headless-C0V6zq0u.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-OC3W4Taz.js → checkbox-group-field-rac-B-MYpz53.js} +3 -3
- package/dist/component/{checkbox-group-rac-CZuEXWgx.js → checkbox-group-rac-BejQjiO2.js} +1 -1
- package/dist/component/{checkbox-rac-W-a8Z0ht.js → checkbox-rac-B0YgCj29.js} +1 -1
- package/dist/component/{contacts-address-rac-DtG9NDgw.js → contacts-address-rac-B1QNl3Lb.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DS7uNjKO.js → contacts-birthdate-rac-Cp-gh3P-.js} +1 -1
- package/dist/component/{contacts-company-rac-CQX5azvs.js → contacts-company-rac-CSCU7JGm.js} +1 -1
- package/dist/component/{contacts-email-rac-QgYLfH6e.js → contacts-email-rac-B1Oov6-3.js} +1 -1
- package/dist/component/{contacts-first-name-rac-BrlHl2Uj.js → contacts-first-name-rac-rsHIOcjr.js} +1 -1
- package/dist/component/{contacts-last-name-rac-ieDtRIbl.js → contacts-last-name-rac-Csgq53Wm.js} +1 -1
- package/dist/component/{contacts-phone-rac-LTjC8k7e.js → contacts-phone-rac-r9SwjDZ4.js} +1 -1
- package/dist/component/{contacts-position-rac-CxbAUzIc.js → contacts-position-rac-D7VcCM7v.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-H0dNjYV8.js → contacts-subscribe-rac-8Nu9ncZW.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-uhTEMEwl.js → contacts-tax-id-rac-CL_JSl_W.js} +1 -1
- package/dist/component/{date-availability-eRjWauCz.js → date-availability-DLOKY9C4.js} +1 -1
- package/dist/component/date-input-field-rac-D23Al-Mr.js +292 -0
- package/dist/component/{date-input-rac-BBllT9pM.js → date-input-rac-B6zgkw-L.js} +1 -1
- package/dist/component/{date-picker-field-rac-CSXVWmGL.js → date-picker-field-rac-BqdzPPzK.js} +4 -4
- package/dist/component/{date-picker-rac-CwEFOSSe.js → date-picker-rac-C7g6aceb.js} +1 -1
- package/dist/component/date-time-input-field-rac-BENzf6gc.js +428 -0
- package/dist/component/{date-time-input-rac-DsGlyO8x.js → date-time-input-rac-CVpK3mgw.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-Bs9tVVXo.js → dext-checkbox-group-rac-CbEFDD3H.js} +2 -2
- package/dist/component/{dext-checkbox-rac-FEjZejl7.js → dext-checkbox-rac-BdtZvn6I.js} +1 -1
- package/dist/component/{dext-date-picker-rac-Mdbuq1mu.js → dext-date-picker-rac-BAhFvUEx.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-B4dRBObU.js → dext-date-time-input-rac-iXMKMwQY.js} +1 -1
- package/dist/component/{dext-dropdown-rac-QVngfb7K.js → dext-dropdown-rac-D-NPziZS.js} +1 -1
- package/dist/component/{dext-email-rac-cURI3VuR.js → dext-email-rac-DYSwyB80.js} +1 -1
- package/dist/component/{dext-number-input-rac-CovkZ8Ey.js → dext-number-input-rac-DXx8hgFg.js} +1 -1
- package/dist/component/{dext-phone-rac-C8GjKZnH.js → dext-phone-rac-BtuLROzm.js} +1 -1
- package/dist/component/{dext-radio-group-rac-BlrJmIH3.js → dext-radio-group-rac-MdKNiJ2i.js} +2 -2
- package/dist/component/{dext-rating-input-rac-jIJisfdp.js → dext-rating-input-rac-d998xond.js} +1 -1
- package/dist/component/{dext-tags-rac-BXjCLX6y.js → dext-tags-rac-DnSpOM9T.js} +2 -2
- package/dist/component/{dext-text-area-rac-CD_x4meg.js → dext-text-area-rac-KqjeDDWe.js} +1 -1
- package/dist/component/{dext-text-input-rac-Du51Nj6q.js → dext-text-input-rac-CtCnClfX.js} +1 -1
- package/dist/component/{dext-url-input-rac-_W6CW5hp.js → dext-url-input-rac-DSJQcLLr.js} +1 -1
- package/dist/component/{donation-rac-9njvq8HE.js → donation-rac-B_KGkBgo.js} +5 -5
- package/dist/component/dropdown-field-headless-BUilB8wZ.js +89 -0
- package/dist/component/{dropdown-field-rac-BYRb3VEI.js → dropdown-field-rac-COupYC1a.js} +2 -2
- package/dist/component/{dropdown-rac-BBrPWiSg.js → dropdown-rac-Dj0UZrE0.js} +1 -1
- package/dist/component/{ecom-address-rac-CDJ46mdt.js → ecom-address-rac-C0xnn86e.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-DItvmxzX.js → ecom-subscription-checkbox-rac-D-ekxwUE.js} +2 -2
- package/dist/component/{email-input-field-rac-aeRdkPOh.js → email-input-field-rac-DVj1qz_R.js} +3 -3
- package/dist/component/{events-repeater-rac-CzVycetd.js → events-repeater-rac-U0aq9Z4Q.js} +3 -3
- package/dist/component/{events-rsvp-rac-BhLYlH1V.js → events-rsvp-rac-C7J58_5q.js} +2 -2
- package/dist/component/{field-error-headless-T9JfqiMS.js → field-error-headless-2nYJ2792.js} +1 -1
- package/dist/component/{field-label-headless-bDWQszAb.js → field-label-headless-D97ACnmc.js} +1 -1
- package/dist/component/{file-upload-rac-Dk-delp2.js → file-upload-rac-BR7QpuPW.js} +3 -3
- package/dist/component/{fixed-payment-rac-Bj8RMj1w.js → fixed-payment-rac-COl18wW1.js} +3 -3
- package/dist/component/{form-C7cB75mm.js → form-DKKTSAj1.js} +69 -69
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-RzI5owwx.js → header-field-rac-B6DyMG3U.js} +2 -2
- package/dist/component/{header-rac-DQgyaMDA.js → header-rac-x4H2qMky.js} +1 -1
- package/dist/component/{image-choice-rac-DOs1eI0_.js → image-choice-rac-BVgmKTKk.js} +4 -4
- package/dist/component/{index-DlPclNOa.js → index-C47UMGhd.js} +4 -4
- package/dist/component/{index-C90Q2rfK.js → index-DnpqBcg5.js} +2 -2
- package/dist/component/{isObjectLike-DLz0WtlZ.js → isObjectLike-BrrFBP4f.js} +1 -1
- package/dist/component/multiline-address-field-rac-B6ka-2Wy.js +1630 -0
- package/dist/component/{multiline-address-rac-7sUhPDFM.js → multiline-address-rac-Bh58qUEe.js} +1 -1
- package/dist/component/{number-input-field-rac-DMHSUbYN.js → number-input-field-rac-pAmxvk3A.js} +4 -4
- package/dist/component/{number-input-rac-CF5271QD.js → number-input-rac-mKA2njIU.js} +1 -1
- package/dist/component/{password-rac-CxQRcSEb.js → password-rac-BbD7PQXO.js} +4 -4
- package/dist/component/{payment-input-rac-C20HS9QN.js → payment-input-rac-UdkwC1ek.js} +4 -4
- package/dist/component/phone-input-field-rac-BVLVVDTq.js +487 -0
- package/dist/component/{phone-rac-pGbG3Cu0.js → phone-rac-LixcB9WV.js} +1 -1
- package/dist/component/{product-list-rac-CxyJaRQ6.js → product-list-rac-B_dL1Ov-.js} +4 -4
- package/dist/component/{quiz-radio-group-rac-CCddKnuf.js → quiz-radio-group-rac-Bj5XfqNf.js} +1 -1
- package/dist/component/{radio-button-module-classes-uyJAJMZn.js → radio-button-module-classes-y_PtsZPP.js} +3 -3
- package/dist/component/{radio-group-field-rac-VwR2FlNg.js → radio-group-field-rac-C8OElNAQ.js} +3 -3
- package/dist/component/{radio-group-rac-D8pzwSCS.js → radio-group-rac-BqJFboHE.js} +1 -1
- package/dist/component/{rating-input-field-rac-C4ohOgX0.js → rating-input-field-rac-C9_ITvEh.js} +4 -4
- package/dist/component/{rating-input-rac-NpCggSGK.js → rating-input-rac-CvTpEUoU.js} +1 -1
- package/dist/component/{rich-content-rac.module-B9HHqJL4.js → rich-content-rac.module-D4pEN-TY.js} +1 -1
- package/dist/component/{rich-text-field-rac-C3qKHitl.js → rich-text-field-rac-B8cqCmaf.js} +2 -2
- package/dist/component/{rich-text-rac-BJkS9CGE.js → rich-text-rac-C1o-tfXG.js} +1 -1
- package/dist/component/{service-dropdown-rac-BTdBTfeg.js → service-dropdown-rac-BOXqB2aq.js} +4 -4
- package/dist/component/{services-multi-choice-rac-Nl74A8jo.js → services-multi-choice-rac-Dk4rz-fw.js} +5 -5
- package/dist/component/{signature-rac-BAVXA-5Q.js → signature-rac-h9GWVdez.js} +3 -3
- package/dist/component/{submit-button-rac-DlmeZjy_.js → submit-button-rac-qNaTyCxd.js} +1 -1
- package/dist/component/{tags-field-rac-BFBSf5mt.js → tags-field-rac-NMRn0YnW.js} +5 -5
- package/dist/component/{tags-rac-S_GJQpwJ.js → tags-rac-DGx4KxEn.js} +1 -1
- package/dist/component/{text-area-field-rac-D1qLXh4K.js → text-area-field-rac-C7u0D4l3.js} +4 -4
- package/dist/component/{text-area-rac-DejqDYR0.js → text-area-rac-Yo-RIyLm.js} +1 -1
- package/dist/component/{text-input-field-rac-DwPTWyiR.js → text-input-field-rac-CvU-1clq.js} +2 -2
- package/dist/component/{text-input-headless-BUljrxVJ.js → text-input-headless-DLRwVmwf.js} +3 -3
- package/dist/component/{text-input-rac-CCWkAOVG.js → text-input-rac-CWh5xjZA.js} +1 -1
- package/dist/component/{time-input-rac-b09-o8Uw.js → time-input-rac-BZlso9qK.js} +4 -4
- package/dist/component/{url-input-field-rac-DYGAFldc.js → url-input-field-rac-Bax0TB4Q.js} +4 -4
- package/dist/component/{url-input-rac-CsAWnWt5.js → url-input-rac-Bw2nfybR.js} +1 -1
- package/dist/component/use-dropdown-option-class-name-vKSagp3b.js +57 -0
- package/dist/component/{use-element-state-class-name-DZhlOoWK.js → use-element-state-class-name-C0zLrsDR.js} +1 -1
- package/dist/component/{use-service-options-base-JNSCsxxz.js → use-service-options-base-Bkj6BSQL.js} +1 -1
- package/dist/component/{use-text-input-class-name-CgCYHOMw.js → use-text-input-class-name-Biu89Ma7.js} +2 -2
- package/package.json +2 -2
- package/dist/component/date-input-field-rac-BKb019gB.js +0 -288
- package/dist/component/date-time-input-field-rac-C4yIIebr.js +0 -424
- package/dist/component/dropdown-field-headless-BBc5oicg.js +0 -101
- package/dist/component/multiline-address-field-rac-DHYRZxtJ.js +0 -1618
- package/dist/component/phone-input-field-rac-BDF_4RJE.js +0 -474
- package/dist/component/use-dropdown-option-class-name-CruN_y12.js +0 -28
|
@@ -1,474 +0,0 @@
|
|
|
1
|
-
import { RicosViewer as ye } from "@wix/ricos/viewer";
|
|
2
|
-
import b from "classnames";
|
|
3
|
-
import t, { useMemo as B, useState as k, useRef as v, useEffect as T, useCallback as j, createContext as te, useContext as q } from "react";
|
|
4
|
-
import { a3 as fe, au as P, ac as ne, at as Ee, ak as M, ah as oe, am as he } from "./form-C7cB75mm.js";
|
|
5
|
-
import { UNSAFE_PortalProvider as ge } from "react-aria";
|
|
6
|
-
import { Dialog as re, OverlayTriggerStateContext as be, ModalOverlay as _e, Modal as Ne, SearchField as Oe, ListBoxItem as Se, Group as Q, DialogTrigger as Le, Select as Ie, Input as ae, ListBox as ve, Autocomplete as Pe } from "react-aria-components";
|
|
7
|
-
import { f as h, a as se } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as Fe, E as De } from "./field-error-headless-T9JfqiMS.js";
|
|
9
|
-
import { L as Re } from "./field-label-headless-bDWQszAb.js";
|
|
10
|
-
import { N as xe, S as Be } from "./non-modal-popover-DtIMXHbe.js";
|
|
11
|
-
import { u as Me } from "./use-invoke-callback-UH73A_J3.js";
|
|
12
|
-
import ce, { AsYouType as ze, isValidPhoneNumber as $e, isSupportedCountry as Ae } from "libphonenumber-js";
|
|
13
|
-
import "libphonenumber-js/metadata.min.json";
|
|
14
|
-
import { C as W } from "./calling-country-codes-PyWuOTmF.js";
|
|
15
|
-
import { C as Te } from "./chevron-down-icon-CcpVm6B-.js";
|
|
16
|
-
import { E as we } from "./error-icon-hZxQ6DEy.js";
|
|
17
|
-
import { H as J } from "./custom-focus-class-_483Pkwp.js";
|
|
18
|
-
import { s as _ } from "./field-rac.module-BUvPquav.js";
|
|
19
|
-
import { B as Ue, R as ke, z as qe, D as Ve, q as Ge, i as He } from "./form-element-classes-CLZXu-91.js";
|
|
20
|
-
import { g as Ye } from "./use-dropdown-option-class-name-CruN_y12.js";
|
|
21
|
-
function X(e) {
|
|
22
|
-
const n = e ? ce(e) : void 0, r = n == null ? void 0 : n.country;
|
|
23
|
-
if (r)
|
|
24
|
-
return r;
|
|
25
|
-
const o = new ze();
|
|
26
|
-
return e && o.input(e), o.getCountry();
|
|
27
|
-
}
|
|
28
|
-
function V(e) {
|
|
29
|
-
var n;
|
|
30
|
-
return e && ((n = fe.getCountryByKey(e)) == null ? void 0 : n.dialCode);
|
|
31
|
-
}
|
|
32
|
-
function w(e) {
|
|
33
|
-
return e === null ? null : e.replace(/[^0-9+]/g, "") || e;
|
|
34
|
-
}
|
|
35
|
-
function ee(e, n) {
|
|
36
|
-
if (e && n)
|
|
37
|
-
try {
|
|
38
|
-
const r = ce(e, n), o = r == null ? void 0 : r.formatInternational();
|
|
39
|
-
if (o && $e(o))
|
|
40
|
-
return o.replace(/\s+/g, "");
|
|
41
|
-
} catch {
|
|
42
|
-
}
|
|
43
|
-
return e;
|
|
44
|
-
}
|
|
45
|
-
function Ke() {
|
|
46
|
-
const { t: e } = P(), { language: n } = ne();
|
|
47
|
-
return B(() => Object.keys(W).reduce((o, a) => {
|
|
48
|
-
const s = W[a], l = V(s), u = e(`locale-dataset.countries.${s.toUpperCase()}`);
|
|
49
|
-
return l && Ae(a) && o.push({
|
|
50
|
-
countryName: u,
|
|
51
|
-
longCountryCode: s,
|
|
52
|
-
shortCountryCode: a,
|
|
53
|
-
callingCode: l
|
|
54
|
-
}), o;
|
|
55
|
-
}, []).sort((o, a) => o.countryName.localeCompare(a.countryName, n)), [
|
|
56
|
-
e,
|
|
57
|
-
n
|
|
58
|
-
]);
|
|
59
|
-
}
|
|
60
|
-
function Ze(e, n) {
|
|
61
|
-
return e.filter((r) => n && n.length > 0 ? n.includes(r.shortCountryCode) : !0);
|
|
62
|
-
}
|
|
63
|
-
function je(e, n) {
|
|
64
|
-
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
65
|
-
return !!(U(r, n) || U(o, n) || U(a, n));
|
|
66
|
-
}
|
|
67
|
-
function U(e, n) {
|
|
68
|
-
return e.toLowerCase().includes(n.toLowerCase());
|
|
69
|
-
}
|
|
70
|
-
function Qe({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
71
|
-
const [a, s] = k(e || ""), l = v(w(e ?? null) ?? ""), [u, i] = k(n);
|
|
72
|
-
Ee(() => {
|
|
73
|
-
s(""), l.current = "", i(n), o("");
|
|
74
|
-
});
|
|
75
|
-
const m = B(() => X(a), [
|
|
76
|
-
a
|
|
77
|
-
]);
|
|
78
|
-
T(() => {
|
|
79
|
-
const d = e ?? "";
|
|
80
|
-
d !== l.current && (s(d), l.current = d);
|
|
81
|
-
}, [
|
|
82
|
-
e
|
|
83
|
-
]), T(() => {
|
|
84
|
-
n && !u && i(n);
|
|
85
|
-
}, [
|
|
86
|
-
n,
|
|
87
|
-
u
|
|
88
|
-
]), T(() => {
|
|
89
|
-
i(n ?? m);
|
|
90
|
-
}, [
|
|
91
|
-
m,
|
|
92
|
-
n
|
|
93
|
-
]);
|
|
94
|
-
const C = j((d) => {
|
|
95
|
-
if (s(d), !d) {
|
|
96
|
-
l.current = "", o(null);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const E = X(d);
|
|
100
|
-
i((y) => {
|
|
101
|
-
const O = E || y || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), S = w(ee(d, O));
|
|
102
|
-
return l.current = S ?? "", o(S), E || y;
|
|
103
|
-
});
|
|
104
|
-
}, [
|
|
105
|
-
r,
|
|
106
|
-
o
|
|
107
|
-
]), p = j((d) => {
|
|
108
|
-
i(d), s((E) => {
|
|
109
|
-
const y = w(ee(E, d));
|
|
110
|
-
return l.current = y ?? "", o(y), E;
|
|
111
|
-
});
|
|
112
|
-
}, [
|
|
113
|
-
o
|
|
114
|
-
]);
|
|
115
|
-
return {
|
|
116
|
-
currentValue: a,
|
|
117
|
-
selectedCountryCode: u,
|
|
118
|
-
handlePhoneChange: C,
|
|
119
|
-
handleCountryCodeChange: p
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
const le = /* @__PURE__ */ te(null), N = () => {
|
|
123
|
-
const e = q(le);
|
|
124
|
-
if (!e)
|
|
125
|
-
throw new Error("Phone input components must be used within PhoneInput component");
|
|
126
|
-
return e;
|
|
127
|
-
}, ue = /* @__PURE__ */ te(null), G = () => {
|
|
128
|
-
const e = q(ue);
|
|
129
|
-
if (!e)
|
|
130
|
-
throw new Error("Option sub-components must be used within Option component");
|
|
131
|
-
return e;
|
|
132
|
-
}, H = ({ longCountryCode: e, className: n }) => {
|
|
133
|
-
function r(s, l) {
|
|
134
|
-
const u = "https://static.parastorage.com/services/linguist-flags/1.1005.0/assets/flags/square/", m = `${s}${l === "2x" ? "_2x" : ""}.png`;
|
|
135
|
-
return `${u}${m}`;
|
|
136
|
-
}
|
|
137
|
-
const o = r(e, "1x"), a = r(e, "2x");
|
|
138
|
-
return /* @__PURE__ */ t.createElement("img", {
|
|
139
|
-
src: o,
|
|
140
|
-
srcSet: `${o} 1x, ${a} 2x`,
|
|
141
|
-
alt: "",
|
|
142
|
-
"aria-hidden": "true",
|
|
143
|
-
loading: "lazy",
|
|
144
|
-
className: n
|
|
145
|
-
});
|
|
146
|
-
}, c = ({ children: e }) => {
|
|
147
|
-
var I, L;
|
|
148
|
-
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: s, validation: l } = M(), [u, i] = k(null), m = (L = (I = l == null ? void 0 : l.string) == null ? void 0 : I.phoneOptions) == null ? void 0 : L.allowedCountryCodes, C = Ke(), p = B(() => Ze(C, m), [
|
|
149
|
-
C,
|
|
150
|
-
m
|
|
151
|
-
]), d = B(() => p.map((x) => x.shortCountryCode), [
|
|
152
|
-
p
|
|
153
|
-
]), { currentValue: E, selectedCountryCode: y, handlePhoneChange: O, handleCountryCodeChange: S } = Qe({
|
|
154
|
-
value: r,
|
|
155
|
-
defaultCountryCode: s,
|
|
156
|
-
allowedCountryCodes: d,
|
|
157
|
-
onChange: o
|
|
158
|
-
}), $ = h(e, c.Label), F = h(e, c.Control), A = h(e, c.Description), D = h(e, c.Error), R = {
|
|
159
|
-
currentValue: E,
|
|
160
|
-
selectedCountryCode: y,
|
|
161
|
-
handlePhoneChange: O,
|
|
162
|
-
handleCountryCodeChange: S,
|
|
163
|
-
countryCodes: d,
|
|
164
|
-
countries: p,
|
|
165
|
-
popoverContainer: u
|
|
166
|
-
};
|
|
167
|
-
return /* @__PURE__ */ t.createElement(le.Provider, {
|
|
168
|
-
value: R
|
|
169
|
-
}, /* @__PURE__ */ t.createElement(a, {
|
|
170
|
-
fieldId: n,
|
|
171
|
-
renderLabel: () => $,
|
|
172
|
-
renderInput: () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", {
|
|
173
|
-
ref: i,
|
|
174
|
-
style: {
|
|
175
|
-
display: "contents"
|
|
176
|
-
}
|
|
177
|
-
}), F),
|
|
178
|
-
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, D, A)
|
|
179
|
-
}));
|
|
180
|
-
}, Y = ({ children: e, className: n }) => {
|
|
181
|
-
const { inputId: r, labelId: o } = oe(), { hasError: a, disabled: s, readOnly: l } = M(), { t: u } = P(), { selectedCountryCode: i, countries: m } = N(), C = `${r}-country`, p = i ? m.find((O) => O.shortCountryCode === i) : void 0, d = p && V(p.longCountryCode) || "", E = u("field.phone.country-code.aria-label"), y = p ? `${E}, ${p.countryName}, ${d}` : E;
|
|
182
|
-
return /* @__PURE__ */ t.createElement(Be, {
|
|
183
|
-
isDisabled: s || l,
|
|
184
|
-
id: C,
|
|
185
|
-
"aria-label": y,
|
|
186
|
-
"aria-labelledby": o ? `${o} ${C}` : void 0,
|
|
187
|
-
className: n,
|
|
188
|
-
"data-invalid": a || void 0
|
|
189
|
-
}, e);
|
|
190
|
-
}, We = ({ className: e }) => {
|
|
191
|
-
const { selectedCountryCode: n, countries: r } = N(), o = r.find((a) => a.shortCountryCode === n);
|
|
192
|
-
return o ? /* @__PURE__ */ t.createElement(H, {
|
|
193
|
-
className: e,
|
|
194
|
-
longCountryCode: o.longCountryCode
|
|
195
|
-
}) : null;
|
|
196
|
-
}, Je = ({ children: e, className: n }) => {
|
|
197
|
-
const { selectedCountryCode: r, countries: o } = N();
|
|
198
|
-
return o.some((s) => s.shortCountryCode === r) ? null : /* @__PURE__ */ t.createElement("span", {
|
|
199
|
-
className: n
|
|
200
|
-
}, e);
|
|
201
|
-
};
|
|
202
|
-
Y.Flag = We;
|
|
203
|
-
Y.EmptyState = Je;
|
|
204
|
-
const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a, ...s }) => {
|
|
205
|
-
const { triggerRef: l, optionsRef: u } = s, { popoverContainer: i } = N(), m = h(e, g.Search), C = /* @__PURE__ */ t.createElement(ie, null, e);
|
|
206
|
-
return /* @__PURE__ */ t.createElement(ge, {
|
|
207
|
-
getContainer: () => i
|
|
208
|
-
}, /* @__PURE__ */ t.createElement(xe, {
|
|
209
|
-
ref: u,
|
|
210
|
-
triggerRef: l,
|
|
211
|
-
className: n,
|
|
212
|
-
placement: o,
|
|
213
|
-
offset: a,
|
|
214
|
-
containerPadding: 0
|
|
215
|
-
}, m ? /* @__PURE__ */ t.createElement(re, {
|
|
216
|
-
"aria-label": r
|
|
217
|
-
}, C) : C));
|
|
218
|
-
}, Xe = ({ children: e, className: n, overlayClassName: r, "aria-label": o, portalContainer: a = t.Fragment, ...s }) => {
|
|
219
|
-
const { optionsRef: l } = s, { selectedCountryCode: u, handleCountryCodeChange: i } = N(), m = q(be);
|
|
220
|
-
return /* @__PURE__ */ t.createElement(_e, {
|
|
221
|
-
className: r,
|
|
222
|
-
isDismissable: !0
|
|
223
|
-
}, /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(Ne, {
|
|
224
|
-
ref: l,
|
|
225
|
-
className: n
|
|
226
|
-
}, /* @__PURE__ */ t.createElement(re, {
|
|
227
|
-
"aria-label": o
|
|
228
|
-
}, /* @__PURE__ */ t.createElement(ie, {
|
|
229
|
-
listBoxProps: {
|
|
230
|
-
"aria-label": o,
|
|
231
|
-
selectionMode: "single",
|
|
232
|
-
selectedKeys: u ? [
|
|
233
|
-
u
|
|
234
|
-
] : [],
|
|
235
|
-
onAction: (C) => {
|
|
236
|
-
i(C), m == null || m.close();
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}, e)))));
|
|
240
|
-
}, ie = ({ children: e, listBoxProps: n }) => {
|
|
241
|
-
const { countries: r } = N(), o = h(e, g.Option), a = h(e, g.Search), s = h(e, g.EmptyState), l = /* @__PURE__ */ t.createElement(ve, {
|
|
242
|
-
...n,
|
|
243
|
-
renderEmptyState: s ? () => s : void 0
|
|
244
|
-
}, r.map((u) => {
|
|
245
|
-
const i = V(u.longCountryCode) || "";
|
|
246
|
-
return se(o, {
|
|
247
|
-
key: u.shortCountryCode,
|
|
248
|
-
countryCode: u.shortCountryCode,
|
|
249
|
-
dialingCode: i,
|
|
250
|
-
countryName: u.countryName,
|
|
251
|
-
longCountryCode: u.longCountryCode
|
|
252
|
-
});
|
|
253
|
-
}));
|
|
254
|
-
return a ? /* @__PURE__ */ t.createElement(Pe, {
|
|
255
|
-
filter: (u, i, m) => {
|
|
256
|
-
const C = r.find((p) => p.shortCountryCode === m.key);
|
|
257
|
-
return !!C && je(C, i);
|
|
258
|
-
}
|
|
259
|
-
}, a, l) : l;
|
|
260
|
-
};
|
|
261
|
-
g.Popover = g;
|
|
262
|
-
g.Modal = Xe;
|
|
263
|
-
const me = ({ className: e, children: n, "aria-label": r }) => /* @__PURE__ */ t.createElement(Oe, {
|
|
264
|
-
className: e,
|
|
265
|
-
"aria-label": r,
|
|
266
|
-
autoFocus: !0
|
|
267
|
-
}, n), et = ({ className: e, placeholder: n }) => /* @__PURE__ */ t.createElement(ae, {
|
|
268
|
-
className: e,
|
|
269
|
-
placeholder: n
|
|
270
|
-
});
|
|
271
|
-
me.Input = et;
|
|
272
|
-
g.Search = me;
|
|
273
|
-
const tt = ({ children: e, className: n }) => /* @__PURE__ */ t.createElement("div", {
|
|
274
|
-
className: n
|
|
275
|
-
}, e);
|
|
276
|
-
g.EmptyState = tt;
|
|
277
|
-
const z = ({ children: e, className: n, ...r }) => {
|
|
278
|
-
const { countryCode: o, dialingCode: a, countryName: s, longCountryCode: l } = r, u = {
|
|
279
|
-
countryCode: o,
|
|
280
|
-
dialingCode: a,
|
|
281
|
-
countryName: s,
|
|
282
|
-
longCountryCode: l
|
|
283
|
-
}, i = e || /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(Ce, null), /* @__PURE__ */ t.createElement(de, null), /* @__PURE__ */ t.createElement(pe, null));
|
|
284
|
-
return /* @__PURE__ */ t.createElement(Se, {
|
|
285
|
-
className: n,
|
|
286
|
-
id: o,
|
|
287
|
-
textValue: `${s} ${a}`
|
|
288
|
-
}, /* @__PURE__ */ t.createElement(ue.Provider, {
|
|
289
|
-
value: u
|
|
290
|
-
}, i));
|
|
291
|
-
}, Ce = ({ className: e }) => {
|
|
292
|
-
const { longCountryCode: n } = G();
|
|
293
|
-
return /* @__PURE__ */ t.createElement(H, {
|
|
294
|
-
className: e,
|
|
295
|
-
longCountryCode: n
|
|
296
|
-
});
|
|
297
|
-
}, de = ({ className: e }) => {
|
|
298
|
-
const { countryName: n } = G();
|
|
299
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
300
|
-
className: e
|
|
301
|
-
}, n);
|
|
302
|
-
}, pe = ({ className: e }) => {
|
|
303
|
-
const { dialingCode: n } = G();
|
|
304
|
-
return /* @__PURE__ */ t.createElement("span", {
|
|
305
|
-
className: e
|
|
306
|
-
}, n);
|
|
307
|
-
};
|
|
308
|
-
z.Flag = Ce;
|
|
309
|
-
z.Name = de;
|
|
310
|
-
z.Code = pe;
|
|
311
|
-
g.Option = z;
|
|
312
|
-
const nt = ({ className: e }) => {
|
|
313
|
-
const { t: n } = P(), { inputId: r, ariaDescribedBy: o } = oe(), { id: a, placeholder: s, disabled: l, readOnly: u, required: i, label: m, hasError: C } = M(), { currentValue: p, handlePhoneChange: d } = N(), E = v(null);
|
|
314
|
-
return he(() => {
|
|
315
|
-
var y;
|
|
316
|
-
(y = E.current) == null || y.focus({
|
|
317
|
-
preventScroll: !0
|
|
318
|
-
});
|
|
319
|
-
}, a), /* @__PURE__ */ t.createElement(ae, {
|
|
320
|
-
ref: E,
|
|
321
|
-
id: r,
|
|
322
|
-
type: "tel",
|
|
323
|
-
value: p,
|
|
324
|
-
onChange: (y) => d(y.target.value),
|
|
325
|
-
disabled: l,
|
|
326
|
-
readOnly: u,
|
|
327
|
-
required: i,
|
|
328
|
-
"aria-label": `${m}. ${n("field.phone.aria-label")}`,
|
|
329
|
-
"aria-describedby": o,
|
|
330
|
-
"aria-invalid": C,
|
|
331
|
-
placeholder: s,
|
|
332
|
-
className: e
|
|
333
|
-
});
|
|
334
|
-
}, ot = ({ children: e, className: n }) => {
|
|
335
|
-
const r = v(null), o = v(null), a = v(!1), { disabled: s, readOnly: l, required: u, hasError: i, showFlag: m, onFocus: C, onBlur: p } = M(), d = Me(p), { t: E } = P(), { selectedCountryCode: y, handleCountryCodeChange: O, countries: S } = N(), $ = h(e, c.CountryButton), F = h(e, c.CountryOptions.Modal), A = F ?? h(e, c.CountryOptions.Popover), D = h(e, c.PhoneNumber), R = {
|
|
336
|
-
onFocus: () => {
|
|
337
|
-
a.current || (a.current = !0, C == null || C());
|
|
338
|
-
},
|
|
339
|
-
onBlur: (L) => {
|
|
340
|
-
var K, Z;
|
|
341
|
-
const x = L.relatedTarget;
|
|
342
|
-
!((K = r.current) != null && K.contains(x)) && !((Z = o.current) != null && Z.contains(x)) && (a.current = !1, d());
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
if (S.length === 1)
|
|
346
|
-
return /* @__PURE__ */ t.createElement(Q, {
|
|
347
|
-
ref: r,
|
|
348
|
-
className: n,
|
|
349
|
-
isDisabled: s,
|
|
350
|
-
isInvalid: i,
|
|
351
|
-
...R
|
|
352
|
-
}, m && /* @__PURE__ */ t.createElement(H, {
|
|
353
|
-
longCountryCode: S[0].longCountryCode
|
|
354
|
-
}), D);
|
|
355
|
-
const I = /* @__PURE__ */ t.createElement(t.Fragment, null, $, se(A, {
|
|
356
|
-
triggerRef: r,
|
|
357
|
-
optionsRef: o
|
|
358
|
-
}));
|
|
359
|
-
return /* @__PURE__ */ t.createElement(Q, {
|
|
360
|
-
ref: r,
|
|
361
|
-
className: n,
|
|
362
|
-
isDisabled: s,
|
|
363
|
-
isInvalid: i,
|
|
364
|
-
...R
|
|
365
|
-
}, F ? /* @__PURE__ */ t.createElement(Le, null, I) : /* @__PURE__ */ t.createElement(Ie, {
|
|
366
|
-
"aria-label": E("field.phone.country-code.aria-label"),
|
|
367
|
-
value: y ?? null,
|
|
368
|
-
onChange: (L) => O(L),
|
|
369
|
-
isDisabled: s || l,
|
|
370
|
-
isInvalid: i,
|
|
371
|
-
isRequired: u,
|
|
372
|
-
placeholder: ""
|
|
373
|
-
}, I), D);
|
|
374
|
-
};
|
|
375
|
-
c.Label = Re;
|
|
376
|
-
c.Control = ot;
|
|
377
|
-
c.CountryButton = Y;
|
|
378
|
-
c.CountryOptions = g;
|
|
379
|
-
c.PhoneNumber = nt;
|
|
380
|
-
c.Description = Fe;
|
|
381
|
-
c.Error = De;
|
|
382
|
-
const rt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
383
|
-
width: 24,
|
|
384
|
-
height: 24,
|
|
385
|
-
viewBox: "0 0 24 24",
|
|
386
|
-
fill: "currentColor",
|
|
387
|
-
"aria-hidden": "true",
|
|
388
|
-
...e
|
|
389
|
-
}, /* @__PURE__ */ t.createElement("path", {
|
|
390
|
-
fillRule: "evenodd",
|
|
391
|
-
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"
|
|
392
|
-
})), at = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
393
|
-
width: 24,
|
|
394
|
-
height: 24,
|
|
395
|
-
viewBox: "0 0 24 24",
|
|
396
|
-
fill: "currentColor",
|
|
397
|
-
"aria-hidden": "true",
|
|
398
|
-
...e
|
|
399
|
-
}, /* @__PURE__ */ t.createElement("path", {
|
|
400
|
-
fillRule: "evenodd",
|
|
401
|
-
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"
|
|
402
|
-
})), st = "_control_rzerf_1", ct = "_countryButton_rzerf_9", lt = "_chevron_rzerf_25", ut = "_globeIcon_rzerf_34", it = "_searchIcon_rzerf_35", mt = "_flag_rzerf_44", Ct = "_phoneNumber_rzerf_59", dt = "_countryOptions_rzerf_85", pt = "_option_rzerf_93", yt = "_countrySearchContainer_rzerf_102", ft = "_countrySearch_rzerf_102", Et = "_name_rzerf_144", ht = "_code_rzerf_148", gt = "_mobileOverlay_rzerf_165", bt = "_mobileDrawer_rzerf_175", f = {
|
|
403
|
-
control: st,
|
|
404
|
-
countryButton: ct,
|
|
405
|
-
chevron: lt,
|
|
406
|
-
globeIcon: ut,
|
|
407
|
-
searchIcon: it,
|
|
408
|
-
flag: mt,
|
|
409
|
-
phoneNumber: Ct,
|
|
410
|
-
countryOptions: dt,
|
|
411
|
-
option: pt,
|
|
412
|
-
countrySearchContainer: yt,
|
|
413
|
-
countrySearch: ft,
|
|
414
|
-
name: Et,
|
|
415
|
-
code: ht,
|
|
416
|
-
mobileOverlay: gt,
|
|
417
|
-
mobileDrawer: bt
|
|
418
|
-
}, _t = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(ye, {
|
|
419
|
-
content: e,
|
|
420
|
-
locale: n
|
|
421
|
-
}), Nt = () => /* @__PURE__ */ t.createElement("span", {
|
|
422
|
-
className: f.chevron,
|
|
423
|
-
"aria-hidden": "true"
|
|
424
|
-
}, /* @__PURE__ */ t.createElement(Te, null)), Vt = () => {
|
|
425
|
-
const e = Ye(_.selectOptionWithoutFocusRing, f.option, J), { t: n } = P(), { isMobile: r, PortalContainer: o } = ne(), a = /* @__PURE__ */ t.createElement(c.CountryOptions.Search, {
|
|
426
|
-
className: f.countrySearchContainer,
|
|
427
|
-
"aria-label": n("field.phone.country-search-input.aria-label")
|
|
428
|
-
}, /* @__PURE__ */ t.createElement(at, {
|
|
429
|
-
className: f.searchIcon
|
|
430
|
-
}), /* @__PURE__ */ t.createElement(c.CountryOptions.Search.Input, {
|
|
431
|
-
className: b(f.countrySearch, J),
|
|
432
|
-
placeholder: n("field.phone.country-search-input.placeholder")
|
|
433
|
-
})), s = /* @__PURE__ */ t.createElement(c.CountryOptions.EmptyState, null, n("field.phone.country-selector-dropdown.no-result")), l = /* @__PURE__ */ t.createElement(c.CountryOptions.Option, {
|
|
434
|
-
className: e
|
|
435
|
-
}, /* @__PURE__ */ t.createElement(c.CountryOptions.Option.Flag, {
|
|
436
|
-
className: f.flag
|
|
437
|
-
}), /* @__PURE__ */ t.createElement(c.CountryOptions.Option.Name, {
|
|
438
|
-
className: f.name
|
|
439
|
-
}), /* @__PURE__ */ t.createElement(c.CountryOptions.Option.Code, {
|
|
440
|
-
className: f.code
|
|
441
|
-
}));
|
|
442
|
-
return /* @__PURE__ */ t.createElement(c, null, /* @__PURE__ */ t.createElement(c.Label, {
|
|
443
|
-
className: b(Ue, _.label)
|
|
444
|
-
}, /* @__PURE__ */ t.createElement(c.Label.Required, {
|
|
445
|
-
className: b(ke, _.requiredMark)
|
|
446
|
-
})), /* @__PURE__ */ t.createElement(c.Control, {
|
|
447
|
-
className: b(qe, _.input, f.control)
|
|
448
|
-
}, /* @__PURE__ */ t.createElement(c.CountryButton, {
|
|
449
|
-
className: f.countryButton
|
|
450
|
-
}, /* @__PURE__ */ t.createElement(c.CountryButton.Flag, {
|
|
451
|
-
className: f.flag
|
|
452
|
-
}), /* @__PURE__ */ t.createElement(c.CountryButton.EmptyState, null, /* @__PURE__ */ t.createElement(rt, {
|
|
453
|
-
className: f.globeIcon
|
|
454
|
-
})), /* @__PURE__ */ t.createElement(Nt, null)), /* @__PURE__ */ t.createElement(c.PhoneNumber, {
|
|
455
|
-
className: b(_.innerInput, f.phoneNumber)
|
|
456
|
-
}), r ? /* @__PURE__ */ t.createElement(c.CountryOptions.Modal, {
|
|
457
|
-
className: b(_.selectPopover, f.mobileDrawer),
|
|
458
|
-
overlayClassName: f.mobileOverlay,
|
|
459
|
-
portalContainer: o,
|
|
460
|
-
"aria-label": n("field.phone.country-code.aria-label")
|
|
461
|
-
}, a, s, l) : /* @__PURE__ */ t.createElement(c.CountryOptions.Popover, {
|
|
462
|
-
className: b(Ve, _.selectPopover, f.countryOptions),
|
|
463
|
-
placement: "bottom start",
|
|
464
|
-
offset: 0,
|
|
465
|
-
"aria-label": n("field.phone.country-code.aria-label")
|
|
466
|
-
}, a, s, l)), /* @__PURE__ */ t.createElement(c.Error, {
|
|
467
|
-
className: b(Ge, _.error)
|
|
468
|
-
}, /* @__PURE__ */ t.createElement(we, null), /* @__PURE__ */ t.createElement(c.Error.Text, null)), /* @__PURE__ */ t.createElement(c.Description, {
|
|
469
|
-
className: b(He, _.description)
|
|
470
|
-
}, _t));
|
|
471
|
-
};
|
|
472
|
-
export {
|
|
473
|
-
Vt as P
|
|
474
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import r from "classnames";
|
|
2
|
-
import { s as a } from "./field-rac.module-BUvPquav.js";
|
|
3
|
-
import { l as O } from "./form-element-classes-CLZXu-91.js";
|
|
4
|
-
import { u as m } from "./use-element-state-class-name-DZhlOoWK.js";
|
|
5
|
-
const o = {
|
|
6
|
-
base: a.selectOption,
|
|
7
|
-
selected: a.selectOptionSelected,
|
|
8
|
-
hover: a.selectOptionHover
|
|
9
|
-
}, l = ({ isSelected: e, isHovered: s, isFocused: t }) => ({
|
|
10
|
-
isSelected: e,
|
|
11
|
-
isHovered: (s || t) && !e
|
|
12
|
-
}), d = (...e) => (s) => {
|
|
13
|
-
const { isSelected: t, isHovered: n } = l(s);
|
|
14
|
-
return r(o.base, {
|
|
15
|
-
[o.selected]: t,
|
|
16
|
-
[o.hover]: n
|
|
17
|
-
}, e);
|
|
18
|
-
}, S = (...e) => {
|
|
19
|
-
const s = m({
|
|
20
|
-
globalClasses: O,
|
|
21
|
-
moduleClasses: o
|
|
22
|
-
});
|
|
23
|
-
return (t) => r(s(l(t)), e);
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
d as g,
|
|
27
|
-
S as u
|
|
28
|
-
};
|