@wix/form-elements 1.224.0 → 1.226.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-UcRjJTHp.js → appointment-rac-C2ClvRys.js} +5 -5
- package/dist/component/{bookings-address-rac-DDjZGEhk.js → bookings-address-rac-CPQjosbZ.js} +1 -1
- package/dist/component/{bookings-email-rac-Dy2vh3dy.js → bookings-email-rac-DWvVUcBN.js} +1 -1
- package/dist/component/{bookings-first-name-rac-fDHMNznn.js → bookings-first-name-rac-_iG2xJiA.js} +1 -1
- package/dist/component/{bookings-header-rac-DLOeNNQf.js → bookings-header-rac-BbGm_Z8W.js} +1 -1
- package/dist/component/{bookings-last-name-rac-Bx19ROVT.js → bookings-last-name-rac-77Z29aHO.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-8FbvPiv1.js → bookings-login-bar-rac-DfqRpARE.js} +1 -1
- package/dist/component/{bookings-phone-rac-CvPQgtvq.js → bookings-phone-rac-BKoU7X0X.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CO8bHRpD.js → bookings-rich-text-rac-DgSN4_f0.js} +1 -1
- package/dist/component/calendar-icon-DOeHn3jt.js +19 -0
- package/dist/component/{checkbox-field-rac-tzsGw10P.js → checkbox-field-rac-BLJ3Xb7C.js} +6 -6
- package/dist/component/{checkbox-group-field-headless-CL18dpkq.js → checkbox-group-field-headless-BeU8DG0A.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-BmbxaprJ.js → checkbox-group-field-rac-ClRi6Ljp.js} +6 -6
- package/dist/component/{checkbox-group-rac-shsbUvRc.js → checkbox-group-rac--cM57qqw.js} +1 -1
- package/dist/component/{checkbox-indicator-module-classes-DOxE4UQg.js → checkbox-indicator-module-classes-Cozvs_kk.js} +1 -1
- package/dist/component/{checkbox-rac-CobYYayd.js → checkbox-rac-DnslW6as.js} +1 -1
- package/dist/component/{contacts-address-rac-BoDqJCi1.js → contacts-address-rac-Bpq_0vvi.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-GAujbm-z.js → contacts-birthdate-rac-CB1h6kRm.js} +1 -1
- package/dist/component/{contacts-company-rac-CLcEz04V.js → contacts-company-rac-DvYX4SLX.js} +1 -1
- package/dist/component/{contacts-email-rac-D9q7TJwy.js → contacts-email-rac-sxbgKBUR.js} +1 -1
- package/dist/component/{contacts-first-name-rac-BAecbeNQ.js → contacts-first-name-rac-C4_o2nwv.js} +1 -1
- package/dist/component/{contacts-last-name-rac-Ccrw8BDa.js → contacts-last-name-rac-B3s96wWt.js} +1 -1
- package/dist/component/{contacts-phone-rac-DA2N033V.js → contacts-phone-rac-B5NZeYaI.js} +1 -1
- package/dist/component/{contacts-position-rac-0lAd-nCW.js → contacts-position-rac-CO4Bo4jG.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DB2ssF-E.js → contacts-subscribe-rac-CWmo3C6c.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-B-Sn92Ho.js → contacts-tax-id-rac-pi_bJeA7.js} +1 -1
- package/dist/component/{date-availability-CtfWLvii.js → date-availability-DL8Xboob.js} +1 -1
- package/dist/component/date-input-field-rac-Di2pwVW7.js +365 -0
- package/dist/component/{date-input-rac-BnWwBe2i.js → date-input-rac-C5xC7fbz.js} +1 -1
- package/dist/component/date-picker-field-rac-DyPkuVVe.js +386 -0
- package/dist/component/{date-picker-rac-BhI6jOQE.js → date-picker-rac-CKNlOGZG.js} +1 -1
- package/dist/component/date-time-input-field-rac-Dk15pWyb.js +507 -0
- package/dist/component/{date-time-input-rac-DAbopLQt.js → date-time-input-rac-oOUelldq.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-D_HLv0tP.js → dext-checkbox-group-rac--jmNDOV2.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BnBTlqEI.js → dext-checkbox-rac-BOjbBRrg.js} +1 -1
- package/dist/component/{dext-date-picker-rac-Co_yfhuz.js → dext-date-picker-rac-CHi5TisB.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BSpUehb2.js → dext-date-time-input-rac-CcF4ocHx.js} +1 -1
- package/dist/component/{dext-dropdown-rac-DPApx74L.js → dext-dropdown-rac-LLYhuGt_.js} +1 -1
- package/dist/component/{dext-email-rac-Dns6jFl4.js → dext-email-rac-CbC1crzT.js} +1 -1
- package/dist/component/{dext-number-input-rac-DfN-xRID.js → dext-number-input-rac-3-U9Hxre.js} +1 -1
- package/dist/component/{dext-phone-rac-b5Ix3aTQ.js → dext-phone-rac-CdMFXUNf.js} +1 -1
- package/dist/component/{dext-radio-group-rac-BAwIkDsJ.js → dext-radio-group-rac-Bg33r95T.js} +2 -2
- package/dist/component/{dext-rating-input-rac-mwQpCQUI.js → dext-rating-input-rac-DV8jA90b.js} +1 -1
- package/dist/component/{dext-tags-rac-BGmElgw8.js → dext-tags-rac-B-hpvZgE.js} +2 -2
- package/dist/component/{dext-text-area-rac-DN5HPqdg.js → dext-text-area-rac-kBBc0Xjo.js} +1 -1
- package/dist/component/{dext-text-input-rac-DEyDRhQ2.js → dext-text-input-rac-CImXblhX.js} +1 -1
- package/dist/component/{dext-url-input-rac-B1o3BAZE.js → dext-url-input-rac-J-7QABnD.js} +1 -1
- package/dist/component/dismiss-icon-Bw_zbdk_.js +69 -0
- package/dist/component/{donation-rac-Dp6PmATz.js → donation-rac-CvWwng6S.js} +6 -6
- package/dist/component/dropdown-field-rac-Dm9Qs8bh.js +40 -0
- package/dist/component/{dropdown-rac-eqQW-Z9k.js → dropdown-rac-BHqeUIje.js} +1 -1
- package/dist/component/{ecom-address-rac-Q02N1v6i.js → ecom-address-rac-NtuG7Q_T.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-CmqVje9n.js → ecom-subscription-checkbox-rac-DAJnX_RJ.js} +2 -2
- package/dist/component/{email-input-field-rac-HmrdF3g7.js → email-input-field-rac-ompvaCLM.js} +4 -4
- package/dist/component/{events-repeater-rac-BSML2My0.js → events-repeater-rac-kHEFBH7l.js} +6 -6
- package/dist/component/{events-rsvp-rac-0pI3cb2e.js → events-rsvp-rac-R4F9aw6y.js} +4 -4
- package/dist/component/{field-error-headless-B3U_Gymg.js → field-error-headless-o2u5ldAp.js} +1 -1
- package/dist/component/{field-label-headless-Cyy9_5qJ.js → field-label-headless-DvNWYzXc.js} +1 -1
- package/dist/component/field-rac.module-D0QzJXUv.js +32 -0
- package/dist/component/{file-upload-rac-hR9TZqk2.js → file-upload-rac-DlE4dp0D.js} +5 -5
- package/dist/component/{fixed-payment-rac-CghZp6bR.js → fixed-payment-rac-BxsFHhXP.js} +4 -4
- package/dist/component/{form-BmSV4tOz.js → form-Co7SkMqj.js} +1701 -1688
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-C7LDm89o.js → header-field-rac-D56CKAtM.js} +2 -2
- package/dist/component/{header-rac-BNNzF5wQ.js → header-rac-DdYSBcq1.js} +1 -1
- package/dist/component/{image-choice-rac-DLgxkKIZ.js → image-choice-rac-g23R5qLL.js} +5 -5
- package/dist/component/{index-Dg8Fefid.js → index-BmOwghzn.js} +2 -2
- package/dist/component/{index-B8ObIJtL.js → index-C0yPsVXz.js} +4 -4
- package/dist/component/{isObjectLike-oBQcCfqW.js → isObjectLike-mlNAmhLJ.js} +1 -1
- package/dist/component/multiline-address-field-rac-ApBLSWB_.js +1818 -0
- package/dist/component/{multiline-address-rac-8MZkKfqY.js → multiline-address-rac-tdENoXBT.js} +1 -1
- package/dist/component/native-select-BbxBpe3S.js +32 -0
- package/dist/component/{number-input-field-rac-Dmp8pNIq.js → number-input-field-rac-CCIuPPeP.js} +5 -5
- package/dist/component/{number-input-rac-2cN_bN_s.js → number-input-rac-DxodjaRb.js} +1 -1
- package/dist/component/{password-rac-CFdC1hoi.js → password-rac-h9U6siGg.js} +5 -5
- package/dist/component/{payment-input-rac-BWElGzuv.js → payment-input-rac-YFXgnLS6.js} +5 -5
- package/dist/component/phone-input-field-rac-B9PUQJUP.js +558 -0
- package/dist/component/{phone-rac-CE9-90C3.js → phone-rac-B1Q9HXAB.js} +1 -1
- package/dist/component/{product-list-rac-QU7Ocwvy.js → product-list-rac-D63k_IAW.js} +6 -6
- package/dist/component/{quiz-radio-group-rac-Hm7B7RlU.js → quiz-radio-group-rac-Bl6DYjmg.js} +1 -1
- package/dist/component/{radio-button-module-classes-CcGF7N_Y.js → radio-button-module-classes-BRHKk6XZ.js} +3 -3
- package/dist/component/{radio-group-field-rac-Bk1JBBts.js → radio-group-field-rac-B8yEmx79.js} +5 -5
- package/dist/component/{radio-group-rac-D_YZnpID.js → radio-group-rac-xX_sfxL0.js} +1 -1
- package/dist/component/{rating-input-field-rac-zvA6QBGo.js → rating-input-field-rac-_p1u5oCL.js} +5 -5
- package/dist/component/{rating-input-rac-CXVQUoi-.js → rating-input-rac-C_i6Nwdz.js} +1 -1
- package/dist/component/{rich-content-rac.module-CnZ4lMBG.js → rich-content-rac.module-BlHWoitq.js} +1 -1
- package/dist/component/{rich-text-field-rac-DYQgVXdV.js → rich-text-field-rac-EiH-NdJm.js} +2 -2
- package/dist/component/{rich-text-rac-Dk8396e-.js → rich-text-rac-eZvghmFV.js} +1 -1
- package/dist/component/service-dropdown-rac-bujnhWyl.js +150 -0
- package/dist/component/{services-multi-choice-rac-D1RiVaLW.js → services-multi-choice-rac-FXrJOBdY.js} +7 -7
- package/dist/component/{signature-rac-DcGKMX84.js → signature-rac-CoVHMOpK.js} +5 -5
- package/dist/component/{submit-button-rac-DbMxQlNH.js → submit-button-rac-B8w753Be.js} +36 -36
- package/dist/component/{tags-field-rac-Bi4lKutL.js → tags-field-rac-iitBlZ8l.js} +6 -6
- package/dist/component/{tags-rac-DDCPnT8M.js → tags-rac-DJSUQlkc.js} +1 -1
- package/dist/component/{text-area-field-rac-cre_K0MD.js → text-area-field-rac-CePWfCbx.js} +5 -5
- package/dist/component/{text-area-rac-61wsMj-j.js → text-area-rac-m18L6Zwk.js} +1 -1
- package/dist/component/{text-input-field-rac-CV5_ba0x.js → text-input-field-rac-BSo_dbkm.js} +4 -4
- package/dist/component/{text-input-headless-kRv3KpSL.js → text-input-headless-D-o9wyGb.js} +3 -3
- package/dist/component/{text-input-rac-CwqZ6NXO.js → text-input-rac-CcGgoWaF.js} +1 -1
- package/dist/component/time-input-rac-DRIFM107.js +212 -0
- package/dist/component/to-native-time-Co_gOLkc.js +9 -0
- package/dist/component/{url-input-field-rac-C1JL_m6D.js → url-input-field-rac-Dpn9-sDD.js} +5 -5
- package/dist/component/{url-input-rac-C1CiGrCn.js → url-input-rac-CDSl1LX1.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-COGEk5d6.js → use-dropdown-option-class-name-CHg44uaJ.js} +3 -3
- package/dist/component/use-dropdown-trigger-class-name-Dpwl6OCY.js +137 -0
- package/dist/component/{use-element-state-class-name-pSOX0Y0p.js → use-element-state-class-name-BUu6zq-d.js} +1 -1
- package/dist/component/{use-hoverable-input-class-name-DGEpOAdi.js → use-hoverable-input-class-name-B1V7zCNe.js} +3 -3
- package/dist/component/{use-is-forced-open-dropdown-DPG1e5E9.js → use-is-forced-open-dropdown-BbHOZTaj.js} +1 -1
- package/dist/component/use-native-mobile-input-Ct8ysLL3.js +31 -0
- package/dist/component/use-native-state-class-name-B0m2ghbS.js +18 -0
- package/dist/component/{use-service-options-base-BgIZ94V9.js → use-service-options-base-u-WCeJHQ.js} +1 -1
- package/dist/component/use-text-input-class-name-DfNU2oQf.js +6 -0
- package/package.json +3 -2
- package/dist/component/date-input-field-rac-CiAaOiYY.js +0 -309
- package/dist/component/date-picker-field-rac-Dg-chlTL.js +0 -320
- package/dist/component/date-time-input-field-rac-CbDvEPIp.js +0 -441
- package/dist/component/dropdown-field-rac-DY3GGJgP.js +0 -36
- package/dist/component/field-rac.module-DcyJyi2B.js +0 -25
- package/dist/component/multiline-address-field-rac-CgH7lDce.js +0 -1738
- package/dist/component/phone-input-field-rac-CsJGw_OE.js +0 -520
- package/dist/component/service-dropdown-rac-BSXYuBPJ.js +0 -145
- package/dist/component/time-input-rac-DuQar6zW.js +0 -161
- package/dist/component/use-dropdown-trigger-class-name-D6c-3Lyw.js +0 -98
- package/dist/component/use-text-input-class-name-BcbHdFV-.js +0 -6
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import a, { forwardRef as d } from "react";
|
|
2
|
+
const m = /* @__PURE__ */ d(({ value: l, options: r, placeholder: n, readOnly: i, onChange: v, ...t }, u) => {
|
|
3
|
+
if (i) {
|
|
4
|
+
const e = r.find((c) => c.value === l);
|
|
5
|
+
return /* @__PURE__ */ a.createElement("input", {
|
|
6
|
+
...t,
|
|
7
|
+
ref: u,
|
|
8
|
+
type: "text",
|
|
9
|
+
readOnly: !0,
|
|
10
|
+
"data-native-input": "",
|
|
11
|
+
value: (e == null ? void 0 : e.label) ?? "",
|
|
12
|
+
placeholder: n
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return /* @__PURE__ */ a.createElement("select", {
|
|
16
|
+
...t,
|
|
17
|
+
ref: u,
|
|
18
|
+
"data-native-input": "",
|
|
19
|
+
value: l ?? "",
|
|
20
|
+
onChange: (e) => v(e.target.value)
|
|
21
|
+
}, /* @__PURE__ */ a.createElement("option", {
|
|
22
|
+
value: "",
|
|
23
|
+
disabled: t.required
|
|
24
|
+
}, n ?? ""), r.map((e) => /* @__PURE__ */ a.createElement("option", {
|
|
25
|
+
key: e.value,
|
|
26
|
+
value: e.value
|
|
27
|
+
}, e.label)));
|
|
28
|
+
});
|
|
29
|
+
m.displayName = "NativeSelect";
|
|
30
|
+
export {
|
|
31
|
+
m as N
|
|
32
|
+
};
|
package/dist/component/{number-input-field-rac-Dmp8pNIq.js → number-input-field-rac-CCIuPPeP.js}
RENAMED
|
@@ -2,15 +2,15 @@ import { RicosViewer as U } from "@wix/ricos/viewer";
|
|
|
2
2
|
import d from "classnames";
|
|
3
3
|
import t, { useState as W, useCallback as X, useEffect as Y, useRef as $ } from "react";
|
|
4
4
|
import { NumberField as j, Input as v } from "react-aria-components";
|
|
5
|
-
import { bN as _, bK as S, bY as z, bP as G, bW as H, X as J, am as Z, M as w, I as ee } from "./form-
|
|
5
|
+
import { bN as _, bK as S, bY as z, bP as G, bW as H, X as J, am as Z, M as w, I as ee } from "./form-Co7SkMqj.js";
|
|
6
6
|
import { c as y, g as x } from "./numeric-input-utils-CuBMi4-a.js";
|
|
7
7
|
import { f as p } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as re, E as te } from "./field-error-headless-
|
|
9
|
-
import { L as ne } from "./field-label-headless-
|
|
8
|
+
import { D as re, E as te } from "./field-error-headless-o2u5ldAp.js";
|
|
9
|
+
import { L as ne } from "./field-label-headless-DvNWYzXc.js";
|
|
10
10
|
import { u as se } from "./use-invoke-callback-UH73A_J3.js";
|
|
11
11
|
import { E as ae } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
-
import { s as b } from "./field-rac.module-
|
|
13
|
-
import { u as me } from "./use-text-input-class-name-
|
|
12
|
+
import { s as b } from "./field-rac.module-D0QzJXUv.js";
|
|
13
|
+
import { u as me } from "./use-text-input-class-name-DfNU2oQf.js";
|
|
14
14
|
const le = (r, { validation: s }) => {
|
|
15
15
|
const a = y(r.value.trim());
|
|
16
16
|
if (a === void 0)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import e, { useState as S, useRef as x } from "react";
|
|
2
2
|
import { RicosViewer as O } from "@wix/ricos/viewer";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import { bN as E, bK as I, bP as A, bW as B, bY as P, X as V, am as v, M, I as k } from "./form-
|
|
4
|
+
import { bN as E, bK as I, bP as A, bW as B, bY as P, X as V, am as v, M, I as k } from "./form-Co7SkMqj.js";
|
|
5
5
|
import { TextField as q, Group as U, Input as W, Button as j } from "react-aria-components";
|
|
6
6
|
import { f as u, a as b } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as H, E as K } from "./field-error-headless-
|
|
8
|
-
import { L as Z } from "./field-label-headless-
|
|
7
|
+
import { D as H, E as K } from "./field-error-headless-o2u5ldAp.js";
|
|
8
|
+
import { L as Z } from "./field-label-headless-DvNWYzXc.js";
|
|
9
9
|
import { E as G } from "./error-icon-hZxQ6DEy.js";
|
|
10
10
|
import { H as Q } from "./custom-focus-class-_483Pkwp.js";
|
|
11
|
-
import { s as p } from "./field-rac.module-
|
|
12
|
-
import { u as X } from "./use-text-input-class-name-
|
|
11
|
+
import { s as p } from "./field-rac.module-D0QzJXUv.js";
|
|
12
|
+
import { u as X } from "./use-text-input-class-name-DfNU2oQf.js";
|
|
13
13
|
const t = ({ children: o, className: r }) => {
|
|
14
14
|
const { id: l, value: s, onChange: c, disabled: n, readOnly: m, required: a, hasError: i, onBlur: f, onFocus: C, autoComplete: y, FieldLayout: _ } = E(), { labelId: R } = I(), [D, F] = S(!1), L = u(o, t.Label), T = u(o, t.Control), h = u(o, t.Description), w = u(o, t.Error);
|
|
15
15
|
return /* @__PURE__ */ e.createElement(_, {
|
|
@@ -2,16 +2,16 @@ import r, { useCallback as V, useRef as Q } from "react";
|
|
|
2
2
|
import { RicosViewer as X } from "@wix/ricos/viewer";
|
|
3
3
|
import p from "classnames";
|
|
4
4
|
import { TextField as Y, Group as j, Input as w } from "react-aria-components";
|
|
5
|
-
import { bN as R, bK as D, bF as M, bY as z, bP as J, X as W, am as Z, M as ee, I as re } from "./form-
|
|
5
|
+
import { bN as R, bK as D, bF as M, bY as z, bP as J, X as W, am as Z, M as ee, I as re } from "./form-Co7SkMqj.js";
|
|
6
6
|
import { f as i } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as te, E as ne } from "./field-error-headless-
|
|
8
|
-
import { L as ae } from "./field-label-headless-
|
|
7
|
+
import { D as te, E as ne } from "./field-error-headless-o2u5ldAp.js";
|
|
8
|
+
import { L as ae } from "./field-label-headless-DvNWYzXc.js";
|
|
9
9
|
import { f as L, g as se } from "./payment-field-utils-DobiK5Xh.js";
|
|
10
10
|
import { u as oe } from "./use-synced-display-value-DcAxdn3M.js";
|
|
11
11
|
import { E as le } from "./error-icon-hZxQ6DEy.js";
|
|
12
12
|
import { H as ce } from "./custom-focus-class-_483Pkwp.js";
|
|
13
|
-
import { s as d } from "./field-rac.module-
|
|
14
|
-
import { u as ie } from "./use-text-input-class-name-
|
|
13
|
+
import { s as d } from "./field-rac.module-D0QzJXUv.js";
|
|
14
|
+
import { u as ie } from "./use-text-input-class-name-DfNU2oQf.js";
|
|
15
15
|
function ue(e, t) {
|
|
16
16
|
return {
|
|
17
17
|
productId: e.id,
|
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
import { RicosViewer as Ee } from "@wix/ricos/viewer";
|
|
2
|
+
import g from "classnames";
|
|
3
|
+
import t, { useMemo as x, useState as V, useRef as R, useEffect as U, useCallback as te, createContext as ae, useContext as W, useId as se } from "react";
|
|
4
|
+
import { bv as ge, bY as F, bF as ce, bX as be, bN as D, bK as X, bP as Oe, bW as Ne, X as _e, am as ve, a3 as ne, M as Se, I as Le, a5 as Ie, a4 as Pe, a2 as Fe } from "./form-Co7SkMqj.js";
|
|
5
|
+
import { UNSAFE_PortalProvider as De } from "react-aria";
|
|
6
|
+
import { Dialog as le, OverlayTriggerStateContext as Be, ModalOverlay as Re, Modal as xe, SearchField as Me, Group as A, ListBoxItem as we, VisuallyHidden as $e, DialogTrigger as Ae, Select as Te, Input as ue, Autocomplete as Ve } from "react-aria-components";
|
|
7
|
+
import ie, { AsYouType as ke, isValidPhoneNumber as He, isSupportedCountry as qe } from "libphonenumber-js";
|
|
8
|
+
import "libphonenumber-js/metadata.min.json";
|
|
9
|
+
import { f as E, a as P } from "./find-child-C60k4CxG.js";
|
|
10
|
+
import { D as Ue, E as Ke } from "./field-error-headless-o2u5ldAp.js";
|
|
11
|
+
import { L as Ye } from "./field-label-headless-DvNWYzXc.js";
|
|
12
|
+
import { N as Ge, u as ze } from "./use-native-mobile-input-Ct8ysLL3.js";
|
|
13
|
+
import { N as We } from "./native-select-BbxBpe3S.js";
|
|
14
|
+
import { N as Xe, S as Ze } from "./non-modal-popover-D-u13tmp.js";
|
|
15
|
+
import { u as je } from "./use-invoke-callback-UH73A_J3.js";
|
|
16
|
+
import { d as Qe } from "./use-is-forced-open-dropdown-BbHOZTaj.js";
|
|
17
|
+
import { V as Je, a as et } from "./use-dropdown-option-class-name-CHg44uaJ.js";
|
|
18
|
+
import { C as oe } from "./calling-country-codes-PyWuOTmF.js";
|
|
19
|
+
import { C as tt } from "./chevron-down-icon-CcpVm6B-.js";
|
|
20
|
+
import { E as nt } from "./error-icon-hZxQ6DEy.js";
|
|
21
|
+
import { H as K } from "./custom-focus-class-_483Pkwp.js";
|
|
22
|
+
import { s as N } from "./field-rac.module-D0QzJXUv.js";
|
|
23
|
+
import { u as re } from "./use-hoverable-input-class-name-B1V7zCNe.js";
|
|
24
|
+
function G(e) {
|
|
25
|
+
const n = e ? ie(e) : void 0, r = n == null ? void 0 : n.country;
|
|
26
|
+
if (r)
|
|
27
|
+
return r;
|
|
28
|
+
const o = new ke();
|
|
29
|
+
return e && o.input(e), o.getCountry();
|
|
30
|
+
}
|
|
31
|
+
function k(e) {
|
|
32
|
+
var n;
|
|
33
|
+
return e && ((n = ge.getCountryByKey(e)) == null ? void 0 : n.dialCode);
|
|
34
|
+
}
|
|
35
|
+
function T(e) {
|
|
36
|
+
return e === null ? null : e.replace(/[^0-9+]/g, "") || e;
|
|
37
|
+
}
|
|
38
|
+
function z(e, n) {
|
|
39
|
+
if (e && n)
|
|
40
|
+
try {
|
|
41
|
+
const r = ie(e, n), o = r == null ? void 0 : r.formatInternational();
|
|
42
|
+
if (o && He(o))
|
|
43
|
+
return o.replace(/\s+/g, "");
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
return e;
|
|
47
|
+
}
|
|
48
|
+
const ot = (e, n) => {
|
|
49
|
+
var u, i;
|
|
50
|
+
const r = e.value;
|
|
51
|
+
if (!r)
|
|
52
|
+
return;
|
|
53
|
+
const { defaultCountry: o, validation: a } = n, c = (i = (u = a == null ? void 0 : a.string) == null ? void 0 : u.phoneOptions) == null ? void 0 : i.allowedCountryCodes, l = G(r) || o || ((c == null ? void 0 : c.length) === 1 ? c[0] : void 0);
|
|
54
|
+
return T(z(r, l)) ?? void 0;
|
|
55
|
+
};
|
|
56
|
+
function rt() {
|
|
57
|
+
const { t: e } = F(), { language: n } = ce();
|
|
58
|
+
return x(() => Object.keys(oe).reduce((o, a) => {
|
|
59
|
+
const c = oe[a], l = k(c), u = e(`locale-dataset.countries.${c.toUpperCase()}`);
|
|
60
|
+
return l && qe(a) && o.push({
|
|
61
|
+
countryName: u,
|
|
62
|
+
longCountryCode: c,
|
|
63
|
+
shortCountryCode: a,
|
|
64
|
+
callingCode: l
|
|
65
|
+
}), o;
|
|
66
|
+
}, []).sort((o, a) => o.countryName.localeCompare(a.countryName, n)), [
|
|
67
|
+
e,
|
|
68
|
+
n
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
function at(e, n) {
|
|
72
|
+
return e.filter((r) => n && n.length > 0 ? n.includes(r.shortCountryCode) : !0);
|
|
73
|
+
}
|
|
74
|
+
function st(e, n) {
|
|
75
|
+
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
76
|
+
return !!(Y(r, n) || Y(o, n) || Y(a, n));
|
|
77
|
+
}
|
|
78
|
+
function Y(e, n) {
|
|
79
|
+
return e.toLowerCase().includes(n.toLowerCase());
|
|
80
|
+
}
|
|
81
|
+
function ct({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
82
|
+
const [a, c] = V(e || ""), l = R(T(e ?? null) ?? ""), [u, i] = V(n);
|
|
83
|
+
be(() => {
|
|
84
|
+
c(""), l.current = "", i(n), o("");
|
|
85
|
+
});
|
|
86
|
+
const m = x(() => G(a), [
|
|
87
|
+
a
|
|
88
|
+
]);
|
|
89
|
+
U(() => {
|
|
90
|
+
const d = e ?? "";
|
|
91
|
+
d !== l.current && (c(d), l.current = d);
|
|
92
|
+
}, [
|
|
93
|
+
e
|
|
94
|
+
]), U(() => {
|
|
95
|
+
n && !u && i(n);
|
|
96
|
+
}, [
|
|
97
|
+
n,
|
|
98
|
+
u
|
|
99
|
+
]), U(() => {
|
|
100
|
+
i(n ?? m);
|
|
101
|
+
}, [
|
|
102
|
+
m,
|
|
103
|
+
n
|
|
104
|
+
]);
|
|
105
|
+
const C = te((d) => {
|
|
106
|
+
if (c(d), !d) {
|
|
107
|
+
l.current = "", o(null);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const f = G(d);
|
|
111
|
+
i((p) => {
|
|
112
|
+
const _ = f || p || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), v = T(z(d, _));
|
|
113
|
+
return l.current = v ?? "", o(v), f || p;
|
|
114
|
+
});
|
|
115
|
+
}, [
|
|
116
|
+
r,
|
|
117
|
+
o
|
|
118
|
+
]), y = te((d) => {
|
|
119
|
+
i(d), c((f) => {
|
|
120
|
+
const p = T(z(f, d));
|
|
121
|
+
return l.current = p ?? "", o(p), f;
|
|
122
|
+
});
|
|
123
|
+
}, [
|
|
124
|
+
o
|
|
125
|
+
]);
|
|
126
|
+
return {
|
|
127
|
+
currentValue: a,
|
|
128
|
+
selectedCountryCode: u,
|
|
129
|
+
handlePhoneChange: C,
|
|
130
|
+
handleCountryCodeChange: y
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const de = /* @__PURE__ */ ae(null), O = () => {
|
|
134
|
+
const e = W(de);
|
|
135
|
+
if (!e)
|
|
136
|
+
throw new Error("Phone input components must be used within PhoneInput component");
|
|
137
|
+
return e;
|
|
138
|
+
}, me = /* @__PURE__ */ ae(null), Z = () => {
|
|
139
|
+
const e = W(me);
|
|
140
|
+
if (!e)
|
|
141
|
+
throw new Error("Option sub-components must be used within Option component");
|
|
142
|
+
return e;
|
|
143
|
+
}, j = ({ longCountryCode: e, className: n }) => {
|
|
144
|
+
function r(c, l) {
|
|
145
|
+
const u = "https://static.parastorage.com/services/linguist-flags/1.1005.0/assets/flags/square/", m = `${c}${l === "2x" ? "_2x" : ""}.png`;
|
|
146
|
+
return `${u}${m}`;
|
|
147
|
+
}
|
|
148
|
+
const o = r(e, "1x"), a = r(e, "2x");
|
|
149
|
+
return /* @__PURE__ */ t.createElement("img", {
|
|
150
|
+
src: o,
|
|
151
|
+
srcSet: `${o} 1x, ${a} 2x`,
|
|
152
|
+
alt: "",
|
|
153
|
+
"aria-hidden": "true",
|
|
154
|
+
loading: "lazy",
|
|
155
|
+
className: n
|
|
156
|
+
});
|
|
157
|
+
}, s = ({ children: e }) => {
|
|
158
|
+
var S, L;
|
|
159
|
+
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } = D(), [u, i] = V(null), m = (L = (S = l == null ? void 0 : l.string) == null ? void 0 : S.phoneOptions) == null ? void 0 : L.allowedCountryCodes, C = rt(), y = x(() => at(C, m), [
|
|
160
|
+
C,
|
|
161
|
+
m
|
|
162
|
+
]), d = x(() => y.map((I) => I.shortCountryCode), [
|
|
163
|
+
y
|
|
164
|
+
]), { currentValue: f, selectedCountryCode: p, handlePhoneChange: _, handleCountryCodeChange: v } = ct({
|
|
165
|
+
value: r,
|
|
166
|
+
defaultCountryCode: c,
|
|
167
|
+
allowedCountryCodes: d,
|
|
168
|
+
onChange: o
|
|
169
|
+
}), q = E(e, s.Label), M = E(e, s.Control), w = E(e, s.Description), B = E(e, s.Error), $ = {
|
|
170
|
+
currentValue: f,
|
|
171
|
+
selectedCountryCode: p,
|
|
172
|
+
handlePhoneChange: _,
|
|
173
|
+
handleCountryCodeChange: v,
|
|
174
|
+
countryCodes: d,
|
|
175
|
+
countries: y,
|
|
176
|
+
popoverContainer: u
|
|
177
|
+
};
|
|
178
|
+
return /* @__PURE__ */ t.createElement(de.Provider, {
|
|
179
|
+
value: $
|
|
180
|
+
}, /* @__PURE__ */ t.createElement(a, {
|
|
181
|
+
fieldId: n,
|
|
182
|
+
renderLabel: () => q,
|
|
183
|
+
renderInput: () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", {
|
|
184
|
+
ref: i,
|
|
185
|
+
style: {
|
|
186
|
+
display: "contents"
|
|
187
|
+
}
|
|
188
|
+
}), M),
|
|
189
|
+
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, B, w)
|
|
190
|
+
}));
|
|
191
|
+
}, Q = ({ children: e, className: n }) => {
|
|
192
|
+
const { labelId: r } = X(), { hasError: o, disabled: a, readOnly: c } = D(), { t: l } = F(), { selectedCountryCode: u, countries: i } = O(), m = se(), C = u ? i.find((p) => p.shortCountryCode === u) : void 0, y = C && k(C.longCountryCode) || "", d = l("field.phone.country-code.aria-label"), f = C ? `${d}, ${C.countryName}, ${y}` : d;
|
|
193
|
+
return /* @__PURE__ */ t.createElement(Ze, {
|
|
194
|
+
isDisabled: a || c,
|
|
195
|
+
id: m,
|
|
196
|
+
"aria-label": f,
|
|
197
|
+
"aria-labelledby": r ? `${r} ${m}` : void 0,
|
|
198
|
+
className: n,
|
|
199
|
+
"data-invalid": o || void 0
|
|
200
|
+
}, e);
|
|
201
|
+
}, lt = ({ className: e }) => {
|
|
202
|
+
const { selectedCountryCode: n, countries: r } = O(), o = r.find((a) => a.shortCountryCode === n);
|
|
203
|
+
return o ? /* @__PURE__ */ t.createElement(j, {
|
|
204
|
+
className: e,
|
|
205
|
+
longCountryCode: o.longCountryCode
|
|
206
|
+
}) : null;
|
|
207
|
+
}, ut = ({ children: e, className: n }) => {
|
|
208
|
+
const { selectedCountryCode: r, countries: o } = O();
|
|
209
|
+
return o.some((c) => c.shortCountryCode === r) ? null : /* @__PURE__ */ t.createElement("span", {
|
|
210
|
+
className: n
|
|
211
|
+
}, e);
|
|
212
|
+
};
|
|
213
|
+
Q.Flag = lt;
|
|
214
|
+
Q.EmptyState = ut;
|
|
215
|
+
const b = ({ children: e, className: n, "aria-label": r, placement: o, offset: a, ...c }) => {
|
|
216
|
+
const { triggerRef: l, optionsRef: u, isForcedOpen: i, isOpen: m } = c, { popoverContainer: C } = O(), y = E(e, b.Search);
|
|
217
|
+
if (!m)
|
|
218
|
+
return null;
|
|
219
|
+
const d = /* @__PURE__ */ t.createElement(Ce, {
|
|
220
|
+
isForcedOpen: i
|
|
221
|
+
}, e);
|
|
222
|
+
return /* @__PURE__ */ t.createElement(De, {
|
|
223
|
+
getContainer: () => C
|
|
224
|
+
}, /* @__PURE__ */ t.createElement(Xe, {
|
|
225
|
+
ref: u,
|
|
226
|
+
triggerRef: l,
|
|
227
|
+
className: n,
|
|
228
|
+
placement: o,
|
|
229
|
+
offset: a,
|
|
230
|
+
containerPadding: 0
|
|
231
|
+
}, y && !i ? /* @__PURE__ */ t.createElement(le, {
|
|
232
|
+
"aria-label": r
|
|
233
|
+
}, d) : d));
|
|
234
|
+
}, it = ({ children: e, className: n, overlayClassName: r, "aria-label": o, portalContainer: a = t.Fragment, ...c }) => {
|
|
235
|
+
const { optionsRef: l } = c, { selectedCountryCode: u, handleCountryCodeChange: i } = O(), m = W(Be);
|
|
236
|
+
return /* @__PURE__ */ t.createElement(Re, {
|
|
237
|
+
className: r,
|
|
238
|
+
isDismissable: !0
|
|
239
|
+
}, /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(xe, {
|
|
240
|
+
ref: l,
|
|
241
|
+
className: n
|
|
242
|
+
}, /* @__PURE__ */ t.createElement(le, {
|
|
243
|
+
"aria-label": o
|
|
244
|
+
}, /* @__PURE__ */ t.createElement(Ce, {
|
|
245
|
+
listBoxProps: {
|
|
246
|
+
"aria-label": o,
|
|
247
|
+
selectionMode: "single",
|
|
248
|
+
selectedKeys: u ? [
|
|
249
|
+
u
|
|
250
|
+
] : [],
|
|
251
|
+
onSelectionChange: (C) => {
|
|
252
|
+
const [y] = C === "all" ? [] : C;
|
|
253
|
+
y && i(y), m == null || m.close();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}, e)))));
|
|
257
|
+
}, Ce = ({ children: e, listBoxProps: n, isForcedOpen: r }) => {
|
|
258
|
+
const { countries: o } = O(), a = E(e, b.Option), c = E(e, b.Search), l = E(e, b.EmptyState), u = /* @__PURE__ */ t.createElement(Je, {
|
|
259
|
+
isForcedOpen: r === !0,
|
|
260
|
+
...n,
|
|
261
|
+
renderEmptyState: l ? () => l : void 0
|
|
262
|
+
}, o.map((i) => {
|
|
263
|
+
const m = k(i.longCountryCode) || "";
|
|
264
|
+
return P(a, {
|
|
265
|
+
key: i.shortCountryCode,
|
|
266
|
+
countryCode: i.shortCountryCode,
|
|
267
|
+
dialingCode: m,
|
|
268
|
+
countryName: i.countryName,
|
|
269
|
+
longCountryCode: i.longCountryCode
|
|
270
|
+
});
|
|
271
|
+
}));
|
|
272
|
+
return c ? /* @__PURE__ */ t.createElement(Ve, {
|
|
273
|
+
filter: (i, m, C) => {
|
|
274
|
+
const y = o.find((d) => d.shortCountryCode === C.key);
|
|
275
|
+
return !!y && st(y, m);
|
|
276
|
+
}
|
|
277
|
+
}, r ? P(c, {
|
|
278
|
+
autoFocus: !1
|
|
279
|
+
}) : c, u) : u;
|
|
280
|
+
};
|
|
281
|
+
b.Popover = b;
|
|
282
|
+
b.Modal = it;
|
|
283
|
+
const pe = ({ className: e, children: n, "aria-label": r, ...o }) => {
|
|
284
|
+
const { autoFocus: a = !0 } = o;
|
|
285
|
+
return /* @__PURE__ */ t.createElement(Me, {
|
|
286
|
+
"aria-label": r,
|
|
287
|
+
autoFocus: a
|
|
288
|
+
}, /* @__PURE__ */ t.createElement(A, {
|
|
289
|
+
className: e
|
|
290
|
+
}, n));
|
|
291
|
+
}, dt = ({ className: e, placeholder: n }) => /* @__PURE__ */ t.createElement(ue, {
|
|
292
|
+
className: e,
|
|
293
|
+
placeholder: n
|
|
294
|
+
});
|
|
295
|
+
pe.Input = dt;
|
|
296
|
+
b.Search = pe;
|
|
297
|
+
const mt = ({ children: e, className: n }) => /* @__PURE__ */ t.createElement("div", {
|
|
298
|
+
className: n
|
|
299
|
+
}, e);
|
|
300
|
+
b.EmptyState = mt;
|
|
301
|
+
const H = ({ children: e, className: n, ...r }) => {
|
|
302
|
+
const { countryCode: o, dialingCode: a, countryName: c, longCountryCode: l } = r, u = {
|
|
303
|
+
countryCode: o,
|
|
304
|
+
dialingCode: a,
|
|
305
|
+
countryName: c,
|
|
306
|
+
longCountryCode: l
|
|
307
|
+
}, i = e || /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(ye, null), /* @__PURE__ */ t.createElement(fe, null), /* @__PURE__ */ t.createElement(he, null));
|
|
308
|
+
return /* @__PURE__ */ t.createElement(we, {
|
|
309
|
+
className: n,
|
|
310
|
+
id: o,
|
|
311
|
+
textValue: `${c} ${a}`
|
|
312
|
+
}, /* @__PURE__ */ t.createElement(me.Provider, {
|
|
313
|
+
value: u
|
|
314
|
+
}, i));
|
|
315
|
+
}, ye = ({ className: e }) => {
|
|
316
|
+
const { longCountryCode: n } = Z();
|
|
317
|
+
return /* @__PURE__ */ t.createElement(j, {
|
|
318
|
+
className: e,
|
|
319
|
+
longCountryCode: n
|
|
320
|
+
});
|
|
321
|
+
}, fe = ({ className: e }) => {
|
|
322
|
+
const { countryName: n } = Z();
|
|
323
|
+
return /* @__PURE__ */ t.createElement("span", {
|
|
324
|
+
className: e
|
|
325
|
+
}, n);
|
|
326
|
+
}, he = ({ className: e }) => {
|
|
327
|
+
const { dialingCode: n } = Z();
|
|
328
|
+
return /* @__PURE__ */ t.createElement("span", {
|
|
329
|
+
className: e
|
|
330
|
+
}, n);
|
|
331
|
+
};
|
|
332
|
+
H.Flag = ye;
|
|
333
|
+
H.Name = fe;
|
|
334
|
+
H.Code = he;
|
|
335
|
+
b.Option = H;
|
|
336
|
+
const Ct = ({ className: e }) => {
|
|
337
|
+
const { t: n } = F(), { inputId: r, ariaDescribedBy: o } = X(), { id: a, placeholder: c, disabled: l, readOnly: u, required: i, label: m, hasError: C } = D(), { currentValue: y, handlePhoneChange: d } = O(), f = R(null);
|
|
338
|
+
return Oe(() => {
|
|
339
|
+
var p;
|
|
340
|
+
(p = f.current) == null || p.focus({
|
|
341
|
+
preventScroll: !0
|
|
342
|
+
});
|
|
343
|
+
}, a), Ne(f, ot), /* @__PURE__ */ t.createElement(ue, {
|
|
344
|
+
ref: f,
|
|
345
|
+
id: r,
|
|
346
|
+
type: "tel",
|
|
347
|
+
autoComplete: "tel",
|
|
348
|
+
value: y,
|
|
349
|
+
onChange: (p) => d(p.target.value),
|
|
350
|
+
disabled: l,
|
|
351
|
+
readOnly: u,
|
|
352
|
+
required: i,
|
|
353
|
+
"aria-label": `${m}. ${n("field.phone.aria-label")}`,
|
|
354
|
+
"aria-describedby": o,
|
|
355
|
+
"aria-invalid": C,
|
|
356
|
+
placeholder: c,
|
|
357
|
+
className: e
|
|
358
|
+
});
|
|
359
|
+
}, pt = ({ children: e, ...n }) => {
|
|
360
|
+
const r = n, { isForcedOpen: o } = r, { disabled: a, readOnly: c, required: l, hasError: u } = D(), [i, m] = V(!1), { t: C } = F(), { selectedCountryCode: y, handleCountryCodeChange: d } = O(), f = o || i && !a && !c;
|
|
361
|
+
return /* @__PURE__ */ t.createElement(Te, {
|
|
362
|
+
"aria-label": C("field.phone.country-code.aria-label"),
|
|
363
|
+
value: y ?? null,
|
|
364
|
+
onChange: (p) => d(p),
|
|
365
|
+
isDisabled: a || c,
|
|
366
|
+
isInvalid: u,
|
|
367
|
+
isRequired: l,
|
|
368
|
+
placeholder: "",
|
|
369
|
+
isOpen: f,
|
|
370
|
+
allowsEmptyCollection: !0,
|
|
371
|
+
onOpenChange: o ? void 0 : m
|
|
372
|
+
}, E(e, s.CountryButton), P(E(e, s.CountryOptions.Popover), {
|
|
373
|
+
...r,
|
|
374
|
+
isOpen: f
|
|
375
|
+
}));
|
|
376
|
+
}, yt = ({ children: e, ...n }) => {
|
|
377
|
+
const r = n;
|
|
378
|
+
return /* @__PURE__ */ t.createElement(Ae, null, E(e, s.CountryButton), P(E(e, s.CountryOptions.Modal), r));
|
|
379
|
+
}, ft = ({ children: e, className: n }) => {
|
|
380
|
+
const r = R(null), o = R(null), a = R(!1), { id: c, disabled: l, hasError: u, showFlag: i, onFocus: m, onBlur: C } = D(), y = je(C), { countries: d } = O(), f = E(e, s.CountryDrawer), p = E(e, s.CountryPopover), _ = E(e, s.PhoneNumber), v = E(e, s.NativeCountrySelect), q = ze(), M = d.length > 1, w = Qe(c) && !!p && M, B = typeof n == "function" ? ({ isHovered: L, isFocusWithin: I }) => n({
|
|
381
|
+
hasCountryOptions: M,
|
|
382
|
+
isHovered: L,
|
|
383
|
+
isFocusWithin: I
|
|
384
|
+
}) : n, $ = {
|
|
385
|
+
triggerRef: r,
|
|
386
|
+
optionsRef: o,
|
|
387
|
+
isForcedOpen: w
|
|
388
|
+
}, S = {
|
|
389
|
+
onFocus: () => {
|
|
390
|
+
a.current || (a.current = !0, m == null || m());
|
|
391
|
+
},
|
|
392
|
+
onBlur: (L) => {
|
|
393
|
+
var J, ee;
|
|
394
|
+
const I = L.relatedTarget;
|
|
395
|
+
!((J = r.current) != null && J.contains(I)) && !((ee = o.current) != null && ee.contains(I)) && (a.current = !1, y());
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
return d.length === 1 ? /* @__PURE__ */ t.createElement(A, {
|
|
399
|
+
ref: r,
|
|
400
|
+
className: B,
|
|
401
|
+
isDisabled: l,
|
|
402
|
+
isInvalid: u,
|
|
403
|
+
...S
|
|
404
|
+
}, i && /* @__PURE__ */ t.createElement(j, {
|
|
405
|
+
longCountryCode: d[0].longCountryCode
|
|
406
|
+
}), _) : q ? /* @__PURE__ */ t.createElement(A, {
|
|
407
|
+
ref: r,
|
|
408
|
+
className: B,
|
|
409
|
+
isDisabled: l,
|
|
410
|
+
isInvalid: u,
|
|
411
|
+
...S
|
|
412
|
+
}, v, _) : /* @__PURE__ */ t.createElement(A, {
|
|
413
|
+
ref: r,
|
|
414
|
+
className: B,
|
|
415
|
+
isDisabled: l,
|
|
416
|
+
isInvalid: u,
|
|
417
|
+
...S
|
|
418
|
+
}, !w && P(f, $), P(p, $), _);
|
|
419
|
+
}, ht = ({ className: e, children: n }) => {
|
|
420
|
+
const { disabled: r, readOnly: o, required: a, hasError: c } = D(), { labelId: l } = X(), { t: u } = F(), { countries: i, selectedCountryCode: m, handleCountryCodeChange: C } = O(), y = se(), d = u("field.phone.country-code.aria-label"), f = x(() => i.map((p) => ({
|
|
421
|
+
value: p.shortCountryCode,
|
|
422
|
+
label: `${p.countryName} ${k(p.longCountryCode) || ""}`.trim()
|
|
423
|
+
})), [
|
|
424
|
+
i
|
|
425
|
+
]);
|
|
426
|
+
return /* @__PURE__ */ t.createElement(Ge, null, /* @__PURE__ */ t.createElement($e, {
|
|
427
|
+
id: y,
|
|
428
|
+
"aria-hidden": "true"
|
|
429
|
+
}, d), /* @__PURE__ */ t.createElement(We, {
|
|
430
|
+
className: e,
|
|
431
|
+
"aria-labelledby": l ? `${l} ${y}` : y,
|
|
432
|
+
value: m,
|
|
433
|
+
options: f,
|
|
434
|
+
placeholder: d,
|
|
435
|
+
onChange: (p) => p && C(p),
|
|
436
|
+
"aria-required": a || void 0,
|
|
437
|
+
"aria-invalid": c || void 0,
|
|
438
|
+
disabled: r,
|
|
439
|
+
readOnly: o
|
|
440
|
+
}), n);
|
|
441
|
+
};
|
|
442
|
+
s.Label = Ye;
|
|
443
|
+
s.NativeCountrySelect = ht;
|
|
444
|
+
s.Control = ft;
|
|
445
|
+
s.CountryButton = Q;
|
|
446
|
+
s.CountryDrawer = yt;
|
|
447
|
+
s.CountryPopover = pt;
|
|
448
|
+
s.CountryOptions = b;
|
|
449
|
+
s.PhoneNumber = Ct;
|
|
450
|
+
s.Description = Ue;
|
|
451
|
+
s.Error = Ke;
|
|
452
|
+
const Et = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
453
|
+
width: 24,
|
|
454
|
+
height: 24,
|
|
455
|
+
viewBox: "0 0 24 24",
|
|
456
|
+
fill: "currentColor",
|
|
457
|
+
"aria-hidden": "true",
|
|
458
|
+
...e
|
|
459
|
+
}, /* @__PURE__ */ t.createElement("path", {
|
|
460
|
+
fillRule: "evenodd",
|
|
461
|
+
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"
|
|
462
|
+
})), gt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
463
|
+
width: 24,
|
|
464
|
+
height: 24,
|
|
465
|
+
viewBox: "0 0 24 24",
|
|
466
|
+
fill: "currentColor",
|
|
467
|
+
"aria-hidden": "true",
|
|
468
|
+
...e
|
|
469
|
+
}, /* @__PURE__ */ t.createElement("path", {
|
|
470
|
+
fillRule: "evenodd",
|
|
471
|
+
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"
|
|
472
|
+
})), bt = "_control_1hd0f_1", Ot = "_countryButton_1hd0f_9", Nt = "_drawerButton_1hd0f_25", _t = "_popoverButton_1hd0f_34", vt = "_chevron_1hd0f_39", St = "_globeIcon_1hd0f_48", Lt = "_searchIcon_1hd0f_56", It = "_flag_1hd0f_61", Pt = "_option_1hd0f_67", Ft = "_nativeCountrySelect_1hd0f_80", Dt = "_nativeCountryDisplay_1hd0f_100", Bt = "_phoneNumber_1hd0f_108", Rt = "_countryOptions_1hd0f_135", xt = "_countrySearch_1hd0f_152", Mt = "_mobileDrawer_1hd0f_160", wt = "_name_1hd0f_169", $t = "_code_1hd0f_173", At = "_mobileOverlay_1hd0f_190", h = {
|
|
473
|
+
control: bt,
|
|
474
|
+
countryButton: Ot,
|
|
475
|
+
drawerButton: Nt,
|
|
476
|
+
popoverButton: _t,
|
|
477
|
+
chevron: vt,
|
|
478
|
+
globeIcon: St,
|
|
479
|
+
searchIcon: Lt,
|
|
480
|
+
flag: It,
|
|
481
|
+
option: Pt,
|
|
482
|
+
nativeCountrySelect: Ft,
|
|
483
|
+
nativeCountryDisplay: Dt,
|
|
484
|
+
phoneNumber: Bt,
|
|
485
|
+
countryOptions: Rt,
|
|
486
|
+
countrySearch: xt,
|
|
487
|
+
mobileDrawer: Mt,
|
|
488
|
+
name: wt,
|
|
489
|
+
code: $t,
|
|
490
|
+
mobileOverlay: At
|
|
491
|
+
}, Tt = ({ content: e, locale: n }) => /* @__PURE__ */ t.createElement(Ee, {
|
|
492
|
+
content: e,
|
|
493
|
+
locale: n
|
|
494
|
+
}), Vt = () => /* @__PURE__ */ t.createElement("span", {
|
|
495
|
+
className: h.chevron,
|
|
496
|
+
"aria-hidden": "true"
|
|
497
|
+
}, /* @__PURE__ */ t.createElement(tt, null)), un = () => {
|
|
498
|
+
const e = et(Pe, N.selectOptionWithoutFocusRing, h.option, K), n = re(Fe, [
|
|
499
|
+
h.control
|
|
500
|
+
]), r = re(Ie, [
|
|
501
|
+
h.countrySearch
|
|
502
|
+
]), { t: o } = F(), { PortalContainer: a } = ce(), c = /* @__PURE__ */ t.createElement(s.CountryOptions.Search, {
|
|
503
|
+
className: r,
|
|
504
|
+
"aria-label": o("field.phone.country-search-input.aria-label")
|
|
505
|
+
}, /* @__PURE__ */ t.createElement(gt, {
|
|
506
|
+
className: h.searchIcon
|
|
507
|
+
}), /* @__PURE__ */ t.createElement(s.CountryOptions.Search.Input, {
|
|
508
|
+
className: g(N.innerInput, K),
|
|
509
|
+
placeholder: o("field.phone.country-search-input.placeholder")
|
|
510
|
+
})), l = /* @__PURE__ */ t.createElement(s.CountryOptions.EmptyState, null, o("field.phone.country-selector-dropdown.no-result")), u = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(s.CountryButton.Flag, {
|
|
511
|
+
className: h.flag
|
|
512
|
+
}), /* @__PURE__ */ t.createElement(s.CountryButton.EmptyState, null, /* @__PURE__ */ t.createElement(Et, {
|
|
513
|
+
className: h.globeIcon
|
|
514
|
+
})), /* @__PURE__ */ t.createElement(Vt, null)), i = /* @__PURE__ */ t.createElement(s.CountryOptions.Option, {
|
|
515
|
+
className: e
|
|
516
|
+
}, /* @__PURE__ */ t.createElement(s.CountryOptions.Option.Flag, {
|
|
517
|
+
className: h.flag
|
|
518
|
+
}), /* @__PURE__ */ t.createElement(s.CountryOptions.Option.Name, {
|
|
519
|
+
className: h.name
|
|
520
|
+
}), /* @__PURE__ */ t.createElement(s.CountryOptions.Option.Code, {
|
|
521
|
+
className: h.code
|
|
522
|
+
}));
|
|
523
|
+
return /* @__PURE__ */ t.createElement(s, null, /* @__PURE__ */ t.createElement(s.Label, {
|
|
524
|
+
className: g(_e, N.label)
|
|
525
|
+
}, /* @__PURE__ */ t.createElement(s.Label.Required, {
|
|
526
|
+
className: g(ve, N.requiredMark)
|
|
527
|
+
})), /* @__PURE__ */ t.createElement(s.Control, {
|
|
528
|
+
className: ({ hasCountryOptions: m, ...C }) => n(C)
|
|
529
|
+
}, /* @__PURE__ */ t.createElement(s.CountryDrawer, null, /* @__PURE__ */ t.createElement(s.CountryButton, {
|
|
530
|
+
className: g(h.countryButton, h.drawerButton)
|
|
531
|
+
}, u), /* @__PURE__ */ t.createElement(s.CountryOptions.Modal, {
|
|
532
|
+
className: g(ne, N.selectPopover, h.mobileDrawer),
|
|
533
|
+
overlayClassName: h.mobileOverlay,
|
|
534
|
+
portalContainer: a,
|
|
535
|
+
"aria-label": o("field.phone.country-code.aria-label")
|
|
536
|
+
}, c, l, i)), /* @__PURE__ */ t.createElement(s.CountryPopover, null, /* @__PURE__ */ t.createElement(s.CountryButton, {
|
|
537
|
+
className: g(h.countryButton, h.popoverButton)
|
|
538
|
+
}, u), /* @__PURE__ */ t.createElement(s.CountryOptions.Popover, {
|
|
539
|
+
className: g(ne, N.selectPopover, h.countryOptions),
|
|
540
|
+
placement: "bottom start",
|
|
541
|
+
offset: 0,
|
|
542
|
+
"aria-label": o("field.phone.country-code.aria-label")
|
|
543
|
+
}, c, l, i)), /* @__PURE__ */ t.createElement(s.NativeCountrySelect, {
|
|
544
|
+
className: g(h.nativeCountrySelect, K)
|
|
545
|
+
}, /* @__PURE__ */ t.createElement("span", {
|
|
546
|
+
className: h.nativeCountryDisplay,
|
|
547
|
+
"aria-hidden": "true"
|
|
548
|
+
}, u)), /* @__PURE__ */ t.createElement(s.PhoneNumber, {
|
|
549
|
+
className: g(N.innerInput, h.phoneNumber)
|
|
550
|
+
})), /* @__PURE__ */ t.createElement(s.Error, {
|
|
551
|
+
className: g(Se, N.error)
|
|
552
|
+
}, /* @__PURE__ */ t.createElement(nt, null), /* @__PURE__ */ t.createElement(s.Error.Text, null)), /* @__PURE__ */ t.createElement(s.Description, {
|
|
553
|
+
className: g(Le, N.description)
|
|
554
|
+
}, Tt));
|
|
555
|
+
};
|
|
556
|
+
export {
|
|
557
|
+
un as P
|
|
558
|
+
};
|