@wix/form-elements 1.160.0 → 1.161.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-BmHu56e5.js → appointment-rac-BubC8I9X.js} +395 -388
- package/dist/component/{bookings-address-rac-DY9l2g0h.js → bookings-address-rac-BbwvVs86.js} +1 -1
- package/dist/component/{bookings-email-rac-B5vNSOsS.js → bookings-email-rac-C2HCkcfa.js} +1 -1
- package/dist/component/{bookings-first-name-rac-CJiefCNz.js → bookings-first-name-rac-Uy7c5EBs.js} +1 -1
- package/dist/component/{bookings-header-rac-BFu7Ko5w.js → bookings-header-rac-nmwsWRjS.js} +1 -1
- package/dist/component/{bookings-last-name-rac-DegMM13h.js → bookings-last-name-rac-BAioQLCg.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DrA-5tBH.js → bookings-login-bar-rac-CO6vOBjG.js} +7 -7
- package/dist/component/{bookings-phone-rac-DsaeqxCI.js → bookings-phone-rac-Cr16h-_R.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-jRHiwqi8.js → bookings-rich-text-rac-CHLH3jd7.js} +1 -1
- package/dist/component/{checkbox-field-rac-CyoBb6Yf.js → checkbox-field-rac-CMwmwFMD.js} +43 -43
- package/dist/component/{checkbox-group-field-headless-Bv1gU3oL.js → checkbox-group-field-headless-BNs_S-nT.js} +24 -24
- package/dist/component/{checkbox-group-field-rac-DasArcdV.js → checkbox-group-field-rac-BA60EPAN.js} +12 -12
- package/dist/component/{checkbox-group-rac-CzmufV1U.js → checkbox-group-rac-BJZ4Oer9.js} +1 -1
- package/dist/component/{checkbox-rac-6C7XoUoZ.js → checkbox-rac-KsVlI6_V.js} +1 -1
- package/dist/component/{contacts-address-rac-BZobbFtz.js → contacts-address-rac-CRYkz87z.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-DIzf41DS.js → contacts-birthdate-rac-BIz-1-ZX.js} +1 -1
- package/dist/component/{contacts-company-rac-BiBDO28r.js → contacts-company-rac-B8G__j6I.js} +1 -1
- package/dist/component/{contacts-email-rac-5mqokCSD.js → contacts-email-rac-Dztkvp5i.js} +1 -1
- package/dist/component/{contacts-first-name-rac-BXe3_Nz5.js → contacts-first-name-rac-CVSEWpLU.js} +1 -1
- package/dist/component/{contacts-last-name-rac-Cfqgh7u1.js → contacts-last-name-rac-Blz4M5bk.js} +1 -1
- package/dist/component/{contacts-phone-rac-cmLUWnAc.js → contacts-phone-rac-CPCE5soY.js} +1 -1
- package/dist/component/{contacts-position-rac-DTyvklfN.js → contacts-position-rac-Dd_kBjqG.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-D-ZEX1A3.js → contacts-subscribe-rac-C6AlsP10.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-B4NYJwWt.js → contacts-tax-id-rac-CQ1n29zI.js} +1 -1
- package/dist/component/{date-availability-Dach9aRC.js → date-availability-DDj1j0z5.js} +1 -1
- package/dist/component/{date-input-field-rac-B72mHcya.js → date-input-field-rac-D5r1n_ah.js} +59 -59
- package/dist/component/{date-input-rac-CYix11gT.js → date-input-rac-Cyi5mU_P.js} +1 -1
- package/dist/component/{date-picker-field-rac-B8pvtPir.js → date-picker-field-rac-CeG391Zo.js} +34 -34
- package/dist/component/{date-picker-rac-D6cR0zH9.js → date-picker-rac-Ci9aHgav.js} +1 -1
- package/dist/component/{date-time-input-field-rac-B7Y3Yf5l.js → date-time-input-field-rac-CrbYEbJJ.js} +89 -89
- package/dist/component/{date-time-input-rac-DMN-noQX.js → date-time-input-rac-DDJLkqs0.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-Kq0GnteP.js → dext-checkbox-group-rac-C3ftVHBA.js} +4 -4
- package/dist/component/{dext-checkbox-rac-BY9GZ4n1.js → dext-checkbox-rac-BGLYWn68.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CXArIddp.js → dext-date-picker-rac-Cy9RlDlt.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-B39TtxGq.js → dext-date-time-input-rac-88ZoTd5e.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C3y0G8cS.js → dext-dropdown-rac-CPxDUuk9.js} +1 -1
- package/dist/component/{dext-email-rac-BIg3cq7Q.js → dext-email-rac-BAvQwDPA.js} +1 -1
- package/dist/component/{dext-number-input-rac-27sHJ7yN.js → dext-number-input-rac-D7HYQVKq.js} +1 -1
- package/dist/component/{dext-phone-rac-CcohoFQp.js → dext-phone-rac--FhcplSI.js} +1 -1
- package/dist/component/{dext-radio-group-rac-eead3Gve.js → dext-radio-group-rac-DBz8iCKW.js} +2 -2
- package/dist/component/{dext-rating-input-rac-B_E6OcBr.js → dext-rating-input-rac-Cv7nThfe.js} +1 -1
- package/dist/component/{dext-tags-rac-Yd9aAtnF.js → dext-tags-rac-CRUUc5dr.js} +2 -2
- package/dist/component/{dext-text-area-rac-CMACri2C.js → dext-text-area-rac-DQBQXV1L.js} +1 -1
- package/dist/component/{dext-text-input-rac-sNjSCfQ-.js → dext-text-input-rac-4CpM581y.js} +1 -1
- package/dist/component/{dext-url-input-rac-DwhbzJty.js → dext-url-input-rac-0C1jTEr9.js} +1 -1
- package/dist/component/{donation-rac-BVAN3kMk.js → donation-rac-Cgt0ZE50.js} +68 -68
- package/dist/component/{dropdown-field-rac-DdoGigWx.js → dropdown-field-rac-DlGKR7pZ.js} +3 -3
- package/dist/component/{dropdown-rac-CRkt5w47.js → dropdown-rac-CYFW_3x_.js} +1 -1
- package/dist/component/{ecom-address-rac-C36hFHW0.js → ecom-address-rac-CQfQHpXC.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-BKfQ348w.js → ecom-subscription-checkbox-rac-D2v2Upvz.js} +2 -2
- package/dist/component/{email-input-field-rac-MOaISYxa.js → email-input-field-rac-CVw25yRo.js} +45 -45
- package/dist/component/{events-repeater-rac-D6p-NgE8.js → events-repeater-rac-BCVUcmFj.js} +22 -22
- package/dist/component/{events-rsvp-rac-DVpgN8gm.js → events-rsvp-rac-DwbqEr8z.js} +3 -3
- package/dist/component/{field-error-headless-XNWmDH3E.js → field-error-headless-XnVcMmsL.js} +3 -3
- package/dist/component/{field-label-headless-CORRAJGt.js → field-label-headless-BRTLT2Yt.js} +14 -14
- package/dist/component/{file-upload-rac-DRMr7E4b.js → file-upload-rac-Dkwg9Jk4.js} +115 -115
- package/dist/component/{fixed-payment-rac-BUXzNex9.js → fixed-payment-rac-ST98xAa2.js} +20 -20
- package/dist/component/{form-DSpx-AO8.js → form-BUqSKOvc.js} +235 -234
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-CiDXlNsa.js → header-field-rac-CzNTGYWq.js} +5 -5
- package/dist/component/{header-rac-B5Rg-h8u.js → header-rac-DUt6AIAE.js} +1 -1
- package/dist/component/{image-choice-rac-CtoA_KDp.js → image-choice-rac-DuBgrSt2.js} +21 -21
- package/dist/component/{index-Bz7ZhQsF.js → index-CDO22hht.js} +106 -106
- package/dist/component/{index-CwruESwc.js → index-cZZeAuuu.js} +5 -5
- package/dist/component/{isObjectLike-C5dHxHP0.js → isObjectLike-cs4bARpC.js} +3 -3
- package/dist/component/{multiline-address-field-rac-Z-qF366L.js → multiline-address-field-rac-vcEWhUCV.js} +73 -73
- package/dist/component/{multiline-address-rac-CJIHTMw5.js → multiline-address-rac-WQaI2eUX.js} +1 -1
- package/dist/component/{number-input-field-rac-D4vf6I6N.js → number-input-field-rac-CBUMqATk.js} +26 -26
- package/dist/component/{number-input-rac-B2jW6JUQ.js → number-input-rac-B4j5hyzS.js} +1 -1
- package/dist/component/{password-rac-DGRZ17Jl.js → password-rac-DwLyf45N.js} +28 -28
- package/dist/component/{payment-input-rac-BtD-tAKv.js → payment-input-rac-D0Od---y.js} +28 -28
- package/dist/component/{phone-input-field-rac-KD4-APhr.js → phone-input-field-rac-COlu9IeC.js} +64 -64
- package/dist/component/{phone-rac-Cw2yccgg.js → phone-rac-Dh4RacOF.js} +1 -1
- package/dist/component/{product-list-rac-XbzTDdbp.js → product-list-rac-D7zHDE2D.js} +47 -47
- package/dist/component/{quiz-radio-group-rac-BDw_mAw5.js → quiz-radio-group-rac-1AaKphJt.js} +1 -1
- package/dist/component/{radio-button-module-classes-CFGf0Hzh.js → radio-button-module-classes-VqaP6vpA.js} +29 -29
- package/dist/component/{radio-group-field-rac-CXN7tyVu.js → radio-group-field-rac-Cp3LRN3C.js} +6 -6
- package/dist/component/{radio-group-rac-COHzqjBh.js → radio-group-rac-KhmhzYGf.js} +1 -1
- package/dist/component/{rating-input-field-rac-DCXNZgf1.js → rating-input-field-rac-10n6ciCr.js} +22 -22
- package/dist/component/{rating-input-rac-DwQt9ML7.js → rating-input-rac-XZjjY2Gp.js} +1 -1
- package/dist/component/{rich-content-rac.module-B7rPwNns.js → rich-content-rac.module-kMwDoLBa.js} +1 -1
- package/dist/component/{rich-text-field-rac-DlER7NRD.js → rich-text-field-rac-H5bd8fAt.js} +6 -6
- package/dist/component/{rich-text-rac-CjicsHA7.js → rich-text-rac-88GSQR62.js} +1 -1
- package/dist/component/{service-dropdown-rac-B81LC_6_.js → service-dropdown-rac-B1_Xr_X3.js} +31 -31
- package/dist/component/{services-multi-choice-rac-BR6gZeHk.js → services-multi-choice-rac-DWp_Llbi.js} +17 -17
- package/dist/component/{signature-rac-XFj7Ddtp.js → signature-rac-zN_6KRDp.js} +44 -44
- package/dist/component/{submit-button-rac-Bz7zs_3W.js → submit-button-rac-Dv6UarYX.js} +2 -2
- package/dist/component/{tags-field-rac-DWWkNKqc.js → tags-field-rac-sVN6MHfJ.js} +38 -38
- package/dist/component/{tags-rac-BXyiQ9i1.js → tags-rac-DhTHs_XN.js} +1 -1
- package/dist/component/{text-area-field-rac-DsIRYi0d.js → text-area-field-rac-DrWkww7W.js} +21 -21
- package/dist/component/{text-area-rac-CF9pDP9d.js → text-area-rac-CXXh-ZdY.js} +1 -1
- package/dist/component/{text-input-field-rac-BwIDZACz.js → text-input-field-rac-C2YiMr-g.js} +3 -3
- package/dist/component/{text-input-headless-5kQs2_Xu.js → text-input-headless-BJMNbsMY.js} +12 -12
- package/dist/component/{text-input-rac-CRmSuw1k.js → text-input-rac-CpsPh7FH.js} +1 -1
- package/dist/component/{time-input-rac-BRMNpe51.js → time-input-rac-DG_1KxS4.js} +23 -23
- package/dist/component/{url-input-field-rac-CKLS3QDk.js → url-input-field-rac-twxRREnl.js} +26 -26
- package/dist/component/{url-input-rac-Dv-kp50D.js → url-input-rac-BTStO0NP.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-BQi_qE_-.js → use-dropdown-option-class-name-DbMMg1ws.js} +2 -2
- package/dist/component/{use-dropdown-trigger-class-name-bAK8aHiG.js → use-dropdown-trigger-class-name-Yes4kC_0.js} +17 -17
- package/dist/component/{use-element-state-class-name-rXM_lHug.js → use-element-state-class-name-DlncY4hk.js} +1 -1
- package/dist/component/{use-hoverable-input-class-name-BnV_uerV.js → use-hoverable-input-class-name-C__zqP5j.js} +2 -2
- package/dist/component/use-is-forced-open-dropdown-DnK_MQRO.js +53 -0
- package/dist/component/{use-service-options-base-CLeE9-Tx.js → use-service-options-base-DKJe52Vk.js} +6 -6
- package/dist/component/use-text-input-class-name-D9tJTR-b.js +6 -0
- package/dist/form.d.ts +3 -0
- package/package.json +2 -2
- package/dist/component/use-is-forced-open-dropdown-Bp-5Xpmw.js +0 -53
- package/dist/component/use-text-input-class-name-DIKWvfkm.js +0 -6
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import e, { useState as N, useRef as x } from "react";
|
|
2
2
|
import { RicosViewer as O } from "@wix/ricos/viewer";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import {
|
|
5
|
-
import { TextField as k, Group as q, Input as U, Button as
|
|
4
|
+
import { bA as E, bx as I, bC as A, bK as B, W as v, ac as V, M, G as P } from "./form-BUqSKOvc.js";
|
|
5
|
+
import { TextField as k, Group as q, Input as U, Button as W } from "react-aria-components";
|
|
6
6
|
import { f as u, a as b } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as
|
|
8
|
-
import { L as
|
|
7
|
+
import { D as j, E as G } from "./field-error-headless-XnVcMmsL.js";
|
|
8
|
+
import { L as H } from "./field-label-headless-BRTLT2Yt.js";
|
|
9
9
|
import { E as Z } from "./error-icon-hZxQ6DEy.js";
|
|
10
|
-
import { H as
|
|
10
|
+
import { H as K } from "./custom-focus-class-_483Pkwp.js";
|
|
11
11
|
import { s as p } from "./field-rac.module-DP0lkkEv.js";
|
|
12
|
-
import { u as
|
|
12
|
+
import { u as Q } from "./use-text-input-class-name-D9tJTR-b.js";
|
|
13
13
|
const t = ({ children: o, className: r }) => {
|
|
14
|
-
const { id: l, value: s, onChange: c, disabled: n, readOnly: m, required: a, hasError: i, onBlur: f, onFocus: C, autoComplete: _, FieldLayout: y } = E(), { labelId:
|
|
14
|
+
const { id: l, value: s, onChange: c, disabled: n, readOnly: m, required: a, hasError: i, onBlur: f, onFocus: C, autoComplete: _, FieldLayout: y } = E(), { labelId: R } = I(), [D, F] = N(!1), L = u(o, t.Label), T = u(o, t.Control), w = u(o, t.Description), S = u(o, t.Error);
|
|
15
15
|
return /* @__PURE__ */ e.createElement(y, {
|
|
16
16
|
fieldId: l,
|
|
17
|
-
renderLabel: () =>
|
|
17
|
+
renderLabel: () => L,
|
|
18
18
|
renderInput: () => /* @__PURE__ */ e.createElement(k, {
|
|
19
19
|
autoComplete: _,
|
|
20
|
-
"aria-labelledby":
|
|
20
|
+
"aria-labelledby": R,
|
|
21
21
|
value: s ?? "",
|
|
22
22
|
onChange: c,
|
|
23
23
|
isDisabled: n,
|
|
@@ -28,12 +28,12 @@ const t = ({ children: o, className: r }) => {
|
|
|
28
28
|
onFocus: C,
|
|
29
29
|
className: r
|
|
30
30
|
}, b(T, {
|
|
31
|
-
isVisible:
|
|
32
|
-
onToggleVisibility: () =>
|
|
31
|
+
isVisible: D,
|
|
32
|
+
onToggleVisibility: () => F((h) => !h)
|
|
33
33
|
})),
|
|
34
34
|
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, w, S)
|
|
35
35
|
});
|
|
36
|
-
},
|
|
36
|
+
}, $ = ({ children: o, className: r, ...l }) => {
|
|
37
37
|
const { isVisible: s, onToggleVisibility: c } = l, { disabled: n, hasError: m } = E(), a = u(o, t.Input), i = u(o, t.Toggle);
|
|
38
38
|
return /* @__PURE__ */ e.createElement(q, {
|
|
39
39
|
className: r,
|
|
@@ -45,9 +45,9 @@ const t = ({ children: o, className: r }) => {
|
|
|
45
45
|
isVisible: s,
|
|
46
46
|
onToggleVisibility: c
|
|
47
47
|
}));
|
|
48
|
-
},
|
|
48
|
+
}, z = ({ className: o, ...r }) => {
|
|
49
49
|
const { isVisible: l } = r, { id: s, placeholder: c } = E(), { inputId: n, ariaDescribedBy: m } = I(), a = x(null);
|
|
50
|
-
return
|
|
50
|
+
return A(() => {
|
|
51
51
|
var i;
|
|
52
52
|
(i = a.current) == null || i.focus({
|
|
53
53
|
preventScroll: !0
|
|
@@ -60,9 +60,9 @@ const t = ({ children: o, className: r }) => {
|
|
|
60
60
|
className: o,
|
|
61
61
|
placeholder: c
|
|
62
62
|
});
|
|
63
|
-
},
|
|
63
|
+
}, J = ({ className: o, showPasswordTooltipText: r, hidePasswordTooltipText: l, children: s, ...c }) => {
|
|
64
64
|
const { isVisible: n, onToggleVisibility: m } = c, { disabled: a } = E(), i = n ? l : r;
|
|
65
|
-
return /* @__PURE__ */ e.createElement(
|
|
65
|
+
return /* @__PURE__ */ e.createElement(W, {
|
|
66
66
|
type: "button",
|
|
67
67
|
isDisabled: a,
|
|
68
68
|
onPress: m,
|
|
@@ -73,12 +73,12 @@ const t = ({ children: o, className: r }) => {
|
|
|
73
73
|
isVisible: n
|
|
74
74
|
}));
|
|
75
75
|
};
|
|
76
|
-
t.Label =
|
|
77
|
-
t.Control =
|
|
78
|
-
t.Input =
|
|
79
|
-
t.Toggle =
|
|
80
|
-
t.Description =
|
|
81
|
-
t.Error =
|
|
76
|
+
t.Label = H;
|
|
77
|
+
t.Control = $;
|
|
78
|
+
t.Input = z;
|
|
79
|
+
t.Toggle = J;
|
|
80
|
+
t.Description = j;
|
|
81
|
+
t.Error = G;
|
|
82
82
|
const X = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
83
83
|
viewBox: "0 0 24 24",
|
|
84
84
|
width: "20",
|
|
@@ -121,23 +121,23 @@ const X = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
121
121
|
content: o,
|
|
122
122
|
locale: r
|
|
123
123
|
}), re = () => {
|
|
124
|
-
const { t: o } =
|
|
124
|
+
const { t: o } = B(), r = Q(g.control);
|
|
125
125
|
return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
|
|
126
|
-
className: d(
|
|
126
|
+
className: d(v, p.label)
|
|
127
127
|
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
128
|
-
className: d(
|
|
128
|
+
className: d(V, p.requiredMark)
|
|
129
129
|
})), /* @__PURE__ */ e.createElement(t.Control, {
|
|
130
130
|
className: r
|
|
131
131
|
}, /* @__PURE__ */ e.createElement(t.Input, {
|
|
132
|
-
className: d(p.innerInput,
|
|
132
|
+
className: d(p.innerInput, K)
|
|
133
133
|
}), /* @__PURE__ */ e.createElement(t.Toggle, {
|
|
134
134
|
className: g.toggleButton,
|
|
135
135
|
showPasswordTooltipText: o("forms.widget.modals.show-password-tooltip"),
|
|
136
136
|
hidePasswordTooltipText: o("forms.widget.modals.hide-password-tooltip")
|
|
137
137
|
}, ({ isVisible: l }) => l ? /* @__PURE__ */ e.createElement(Y, null) : /* @__PURE__ */ e.createElement(X, null))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
138
|
-
className: d(
|
|
138
|
+
className: d(M, p.error)
|
|
139
139
|
}, /* @__PURE__ */ e.createElement(Z, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
140
|
-
className: d(
|
|
140
|
+
className: d(P, p.description)
|
|
141
141
|
}, oe));
|
|
142
142
|
}, ge = () => /* @__PURE__ */ e.createElement(re, null);
|
|
143
143
|
export {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import r, { useCallback as P, useRef as
|
|
2
|
-
import { RicosViewer as
|
|
1
|
+
import r, { useCallback as P, useRef as Q } from "react";
|
|
2
|
+
import { RicosViewer as W } from "@wix/ricos/viewer";
|
|
3
3
|
import p from "classnames";
|
|
4
|
-
import { TextField as
|
|
5
|
-
import {
|
|
4
|
+
import { TextField as j, Group as w, Input as z } from "react-aria-components";
|
|
5
|
+
import { bA as R, bx as D, bs as M, bK as J, bC as X, W as Y, ac as Z, M as ee, G as re } from "./form-BUqSKOvc.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-XnVcMmsL.js";
|
|
8
|
+
import { L as ae } from "./field-label-headless-BRTLT2Yt.js";
|
|
9
9
|
import { f as N, 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
13
|
import { s as d } from "./field-rac.module-DP0lkkEv.js";
|
|
14
|
-
import { u as ie } from "./use-text-input-class-name-
|
|
14
|
+
import { u as ie } from "./use-text-input-class-name-D9tJTR-b.js";
|
|
15
15
|
function ue(e, t) {
|
|
16
16
|
return {
|
|
17
17
|
productId: e.id,
|
|
@@ -19,15 +19,15 @@ function ue(e, t) {
|
|
|
19
19
|
quantity: 1
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function x(e) {
|
|
23
23
|
if (e == null || e === "")
|
|
24
24
|
return;
|
|
25
25
|
const t = Number(String(e).replace(/,/g, "."));
|
|
26
26
|
return Number.isNaN(t) ? void 0 : t;
|
|
27
27
|
}
|
|
28
28
|
const n = ({ children: e }) => {
|
|
29
|
-
var O, g,
|
|
30
|
-
const { id: t, value: a, onChange: s, disabled: u, readOnly: m, required: I, hasError: y, onBlur: o, onFocus: E, FieldLayout:
|
|
29
|
+
var O, g, A, V;
|
|
30
|
+
const { id: t, value: a, onChange: s, disabled: u, readOnly: m, required: I, hasError: y, onBlur: o, onFocus: E, FieldLayout: T, validation: C } = R(), { labelId: G, prefixId: q } = D(), { regionalFormat: c } = M(), S = (A = (g = (O = C == null ? void 0 : C.predefined) == null ? void 0 : O.paymentOptions) == null ? void 0 : g.products) == null ? void 0 : A[0], _ = (V = a == null ? void 0 : a.at(0)) == null ? void 0 : V.price, [F, b] = oe({
|
|
31
31
|
sourceValue: _,
|
|
32
32
|
format: (l) => N(String(l ?? ""), c),
|
|
33
33
|
regionalFormat: c
|
|
@@ -39,10 +39,10 @@ const n = ({ children: e }) => {
|
|
|
39
39
|
c,
|
|
40
40
|
o,
|
|
41
41
|
b
|
|
42
|
-
]),
|
|
42
|
+
]), v = P((l) => {
|
|
43
43
|
b(l);
|
|
44
|
-
const L =
|
|
45
|
-
if (L !==
|
|
44
|
+
const L = x(N(l, c)), K = x(_);
|
|
45
|
+
if (L !== K) {
|
|
46
46
|
if (L === void 0) {
|
|
47
47
|
s(null);
|
|
48
48
|
return;
|
|
@@ -57,14 +57,14 @@ const n = ({ children: e }) => {
|
|
|
57
57
|
c,
|
|
58
58
|
_,
|
|
59
59
|
b
|
|
60
|
-
]),
|
|
61
|
-
return /* @__PURE__ */ r.createElement(
|
|
60
|
+
]), B = i(e, n.Label), U = i(e, n.Input), k = i(e, n.Description), H = i(e, n.Error);
|
|
61
|
+
return /* @__PURE__ */ r.createElement(T, {
|
|
62
62
|
fieldId: t,
|
|
63
|
-
renderLabel: () =>
|
|
64
|
-
renderInput: () => /* @__PURE__ */ r.createElement(
|
|
65
|
-
"aria-labelledby": `${
|
|
63
|
+
renderLabel: () => B,
|
|
64
|
+
renderInput: () => /* @__PURE__ */ r.createElement(j, {
|
|
65
|
+
"aria-labelledby": `${G} ${q}`,
|
|
66
66
|
value: a ? F : "",
|
|
67
|
-
onChange:
|
|
67
|
+
onChange: v,
|
|
68
68
|
isDisabled: u,
|
|
69
69
|
isReadOnly: m,
|
|
70
70
|
isRequired: I,
|
|
@@ -72,17 +72,17 @@ const n = ({ children: e }) => {
|
|
|
72
72
|
onBlur: $,
|
|
73
73
|
onFocus: E
|
|
74
74
|
}, U),
|
|
75
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null,
|
|
75
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, H, k)
|
|
76
76
|
});
|
|
77
77
|
}, f = ({ children: e, className: t }) => {
|
|
78
78
|
const { disabled: a, hasError: s } = R(), u = i(e, f.Currency), m = i(e, f.Value);
|
|
79
|
-
return /* @__PURE__ */ r.createElement(
|
|
79
|
+
return /* @__PURE__ */ r.createElement(w, {
|
|
80
80
|
className: t,
|
|
81
81
|
isDisabled: a,
|
|
82
82
|
isInvalid: s
|
|
83
83
|
}, u, m);
|
|
84
84
|
}, me = ({ className: e }) => {
|
|
85
|
-
const { currency: t } =
|
|
85
|
+
const { currency: t } = M(), { t: a } = J(), { prefixId: s } = D();
|
|
86
86
|
return t ? /* @__PURE__ */ r.createElement("span", {
|
|
87
87
|
id: s,
|
|
88
88
|
"aria-hidden": !1,
|
|
@@ -90,13 +90,13 @@ const n = ({ children: e }) => {
|
|
|
90
90
|
className: e
|
|
91
91
|
}, t.sign || t.code) : null;
|
|
92
92
|
}, pe = ({ className: e }) => {
|
|
93
|
-
const { id: t, placeholder: a, label: s } = R(), { inputId: u, labelId: m, prefixId: I, ariaDescribedBy: y } = D(), o =
|
|
93
|
+
const { id: t, placeholder: a, label: s } = R(), { inputId: u, labelId: m, prefixId: I, ariaDescribedBy: y } = D(), o = Q(null);
|
|
94
94
|
return X(() => {
|
|
95
95
|
var E;
|
|
96
96
|
(E = o.current) == null || E.focus({
|
|
97
97
|
preventScroll: !0
|
|
98
98
|
});
|
|
99
|
-
}, t), /* @__PURE__ */ r.createElement(
|
|
99
|
+
}, t), /* @__PURE__ */ r.createElement(z, {
|
|
100
100
|
ref: o,
|
|
101
101
|
id: u,
|
|
102
102
|
className: e,
|
|
@@ -114,14 +114,14 @@ n.Label = ae;
|
|
|
114
114
|
n.Input = f;
|
|
115
115
|
n.Description = te;
|
|
116
116
|
n.Error = ne;
|
|
117
|
-
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14",
|
|
117
|
+
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", h = {
|
|
118
118
|
inputGroup: de,
|
|
119
119
|
currency: fe
|
|
120
|
-
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(
|
|
120
|
+
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(W, {
|
|
121
121
|
content: e,
|
|
122
122
|
locale: t
|
|
123
123
|
}), be = () => {
|
|
124
|
-
const e = ie(
|
|
124
|
+
const e = ie(h.inputGroup);
|
|
125
125
|
return /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(n.Label, {
|
|
126
126
|
className: p(Y, d.label)
|
|
127
127
|
}, /* @__PURE__ */ r.createElement(n.Label.Required, {
|
|
@@ -129,7 +129,7 @@ const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", x = {
|
|
|
129
129
|
})), /* @__PURE__ */ r.createElement(n.Input, {
|
|
130
130
|
className: e
|
|
131
131
|
}, /* @__PURE__ */ r.createElement(n.Input.Currency, {
|
|
132
|
-
className:
|
|
132
|
+
className: h.currency
|
|
133
133
|
}), /* @__PURE__ */ r.createElement(n.Input.Value, {
|
|
134
134
|
className: p(d.innerInput, ce)
|
|
135
135
|
})), /* @__PURE__ */ r.createElement(n.Error, {
|
package/dist/component/{phone-input-field-rac-KD4-APhr.js → phone-input-field-rac-COlu9IeC.js}
RENAMED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import { RicosViewer as de } from "@wix/ricos/viewer";
|
|
2
2
|
import b from "classnames";
|
|
3
|
-
import t, { useMemo as
|
|
4
|
-
import {
|
|
3
|
+
import t, { useMemo as $, useState as A, useRef as F, useEffect as k, useCallback as W, createContext as te, useContext as q, useId as ye } from "react";
|
|
4
|
+
import { bj as Ee, bK as D, bs as ne, bJ as fe, bA as w, bx as oe, bC as he, W as ge, ac as be, $ as Oe, M as _e, G as Ne, a1 as Le, a0 as Se, _ as Ie } from "./form-BUqSKOvc.js";
|
|
5
5
|
import { UNSAFE_PortalProvider as Pe } from "react-aria";
|
|
6
|
-
import { Dialog as re, OverlayTriggerStateContext as ve, ModalOverlay as Fe, Modal as
|
|
6
|
+
import { Dialog as re, OverlayTriggerStateContext as ve, ModalOverlay as Fe, Modal as De, SearchField as we, Group as U, ListBoxItem as Be, DialogTrigger as Re, Select as xe, Input as ae, Autocomplete as Me } from "react-aria-components";
|
|
7
7
|
import { f as h, a as I } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as
|
|
9
|
-
import { L as Ae } from "./field-label-headless-
|
|
10
|
-
import { N as Te, S as
|
|
11
|
-
import { u as
|
|
12
|
-
import { b as He } from "./use-is-forced-open-dropdown-
|
|
13
|
-
import { V as Ue, a as qe } from "./use-dropdown-option-class-name-
|
|
14
|
-
import se, { AsYouType as
|
|
8
|
+
import { D as je, E as $e } from "./field-error-headless-XnVcMmsL.js";
|
|
9
|
+
import { L as Ae } from "./field-label-headless-BRTLT2Yt.js";
|
|
10
|
+
import { N as Te, S as ke } from "./non-modal-popover-D-u13tmp.js";
|
|
11
|
+
import { u as Ve } from "./use-invoke-callback-UH73A_J3.js";
|
|
12
|
+
import { b as He } from "./use-is-forced-open-dropdown-DnK_MQRO.js";
|
|
13
|
+
import { V as Ue, a as qe } from "./use-dropdown-option-class-name-DbMMg1ws.js";
|
|
14
|
+
import se, { AsYouType as Ge, isValidPhoneNumber as Ke, isSupportedCountry as Ye } from "libphonenumber-js";
|
|
15
15
|
import "libphonenumber-js/metadata.min.json";
|
|
16
|
-
import { C as
|
|
17
|
-
import { C as
|
|
18
|
-
import { E as
|
|
19
|
-
import { H as
|
|
16
|
+
import { C as Z } from "./calling-country-codes-PyWuOTmF.js";
|
|
17
|
+
import { C as ze } from "./chevron-down-icon-CcpVm6B-.js";
|
|
18
|
+
import { E as We } from "./error-icon-hZxQ6DEy.js";
|
|
19
|
+
import { H as J } from "./custom-focus-class-_483Pkwp.js";
|
|
20
20
|
import { s as O } from "./field-rac.module-DP0lkkEv.js";
|
|
21
|
-
import { u as
|
|
21
|
+
import { u as Q } from "./use-hoverable-input-class-name-C__zqP5j.js";
|
|
22
22
|
function X(e) {
|
|
23
23
|
const n = e ? se(e) : void 0, r = n == null ? void 0 : n.country;
|
|
24
24
|
if (r)
|
|
25
25
|
return r;
|
|
26
|
-
const o = new
|
|
26
|
+
const o = new Ge();
|
|
27
27
|
return e && o.input(e), o.getCountry();
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function G(e) {
|
|
30
30
|
var n;
|
|
31
31
|
return e && ((n = Ee.getCountryByKey(e)) == null ? void 0 : n.dialCode);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function V(e) {
|
|
34
34
|
return e === null ? null : e.replace(/[^0-9+]/g, "") || e;
|
|
35
35
|
}
|
|
36
36
|
function ee(e, n) {
|
|
37
37
|
if (e && n)
|
|
38
38
|
try {
|
|
39
39
|
const r = se(e, n), o = r == null ? void 0 : r.formatInternational();
|
|
40
|
-
if (o &&
|
|
40
|
+
if (o && Ke(o))
|
|
41
41
|
return o.replace(/\s+/g, "");
|
|
42
42
|
} catch {
|
|
43
43
|
}
|
|
44
44
|
return e;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
const { t: e } =
|
|
48
|
-
return
|
|
49
|
-
const c =
|
|
46
|
+
function Ze() {
|
|
47
|
+
const { t: e } = D(), { language: n } = ne();
|
|
48
|
+
return $(() => Object.keys(Z).reduce((o, a) => {
|
|
49
|
+
const c = Z[a], l = G(c), i = e(`locale-dataset.countries.${c.toUpperCase()}`);
|
|
50
50
|
return l && Ye(a) && o.push({
|
|
51
51
|
countryName: i,
|
|
52
52
|
longCountryCode: c,
|
|
@@ -58,10 +58,10 @@ function Je() {
|
|
|
58
58
|
n
|
|
59
59
|
]);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Je(e, n) {
|
|
62
62
|
return e.filter((r) => n && n.length > 0 ? n.includes(r.shortCountryCode) : !0);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Qe(e, n) {
|
|
65
65
|
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
66
66
|
return !!(H(r, n) || H(o, n) || H(a, n));
|
|
67
67
|
}
|
|
@@ -69,45 +69,45 @@ function H(e, n) {
|
|
|
69
69
|
return e.toLowerCase().includes(n.toLowerCase());
|
|
70
70
|
}
|
|
71
71
|
function Xe({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
72
|
-
const [a, c] = A(e || ""), l = F(
|
|
72
|
+
const [a, c] = A(e || ""), l = F(V(e ?? null) ?? ""), [i, u] = A(n);
|
|
73
73
|
fe(() => {
|
|
74
74
|
c(""), l.current = "", u(n), o("");
|
|
75
75
|
});
|
|
76
|
-
const p =
|
|
76
|
+
const p = $(() => X(a), [
|
|
77
77
|
a
|
|
78
78
|
]);
|
|
79
|
-
|
|
79
|
+
k(() => {
|
|
80
80
|
const m = e ?? "";
|
|
81
81
|
m !== l.current && (c(m), l.current = m);
|
|
82
82
|
}, [
|
|
83
83
|
e
|
|
84
|
-
]),
|
|
84
|
+
]), k(() => {
|
|
85
85
|
n && !i && u(n);
|
|
86
86
|
}, [
|
|
87
87
|
n,
|
|
88
88
|
i
|
|
89
|
-
]),
|
|
89
|
+
]), k(() => {
|
|
90
90
|
u(n ?? p);
|
|
91
91
|
}, [
|
|
92
92
|
p,
|
|
93
93
|
n
|
|
94
94
|
]);
|
|
95
|
-
const C =
|
|
95
|
+
const C = W((m) => {
|
|
96
96
|
if (c(m), !m) {
|
|
97
97
|
l.current = "", o(null);
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
100
|
const f = X(m);
|
|
101
101
|
u((y) => {
|
|
102
|
-
const S = f || y || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), N =
|
|
102
|
+
const S = f || y || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), N = V(ee(m, S));
|
|
103
103
|
return l.current = N ?? "", o(N), f || y;
|
|
104
104
|
});
|
|
105
105
|
}, [
|
|
106
106
|
r,
|
|
107
107
|
o
|
|
108
|
-
]), d =
|
|
108
|
+
]), d = W((m) => {
|
|
109
109
|
u(m), c((f) => {
|
|
110
|
-
const y =
|
|
110
|
+
const y = V(ee(f, m));
|
|
111
111
|
return l.current = y ?? "", o(y), f;
|
|
112
112
|
});
|
|
113
113
|
}, [
|
|
@@ -125,7 +125,7 @@ const ce = /* @__PURE__ */ te(null), _ = () => {
|
|
|
125
125
|
if (!e)
|
|
126
126
|
throw new Error("Phone input components must be used within PhoneInput component");
|
|
127
127
|
return e;
|
|
128
|
-
}, le = /* @__PURE__ */ te(null),
|
|
128
|
+
}, le = /* @__PURE__ */ te(null), K = () => {
|
|
129
129
|
const e = q(le);
|
|
130
130
|
if (!e)
|
|
131
131
|
throw new Error("Option sub-components must be used within Option component");
|
|
@@ -146,10 +146,10 @@ const ce = /* @__PURE__ */ te(null), _ = () => {
|
|
|
146
146
|
});
|
|
147
147
|
}, s = ({ children: e }) => {
|
|
148
148
|
var L, v;
|
|
149
|
-
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } =
|
|
149
|
+
const { id: n, value: r, onChange: o, FieldLayout: a, defaultCountry: c, validation: l } = w(), [i, u] = A(null), p = (v = (L = l == null ? void 0 : l.string) == null ? void 0 : L.phoneOptions) == null ? void 0 : v.allowedCountryCodes, C = Ze(), d = $(() => Je(C, p), [
|
|
150
150
|
C,
|
|
151
151
|
p
|
|
152
|
-
]), m =
|
|
152
|
+
]), m = $(() => d.map((j) => j.shortCountryCode), [
|
|
153
153
|
d
|
|
154
154
|
]), { currentValue: f, selectedCountryCode: y, handlePhoneChange: S, handleCountryCodeChange: N } = Xe({
|
|
155
155
|
value: r,
|
|
@@ -178,9 +178,9 @@ const ce = /* @__PURE__ */ te(null), _ = () => {
|
|
|
178
178
|
}), R),
|
|
179
179
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, M, x)
|
|
180
180
|
}));
|
|
181
|
-
},
|
|
182
|
-
const { labelId: r } = oe(), { hasError: o, disabled: a, readOnly: c } =
|
|
183
|
-
return /* @__PURE__ */ t.createElement(
|
|
181
|
+
}, z = ({ children: e, className: n }) => {
|
|
182
|
+
const { labelId: r } = oe(), { hasError: o, disabled: a, readOnly: c } = w(), { t: l } = D(), { selectedCountryCode: i, countries: u } = _(), p = ye(), C = i ? u.find((y) => y.shortCountryCode === i) : void 0, d = C && G(C.longCountryCode) || "", m = l("field.phone.country-code.aria-label"), f = C ? `${m}, ${C.countryName}, ${d}` : m;
|
|
183
|
+
return /* @__PURE__ */ t.createElement(ke, {
|
|
184
184
|
isDisabled: a || c,
|
|
185
185
|
id: p,
|
|
186
186
|
"aria-label": f,
|
|
@@ -200,8 +200,8 @@ const ce = /* @__PURE__ */ te(null), _ = () => {
|
|
|
200
200
|
className: n
|
|
201
201
|
}, e);
|
|
202
202
|
};
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
z.Flag = et;
|
|
204
|
+
z.EmptyState = tt;
|
|
205
205
|
const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a, ...c }) => {
|
|
206
206
|
const { triggerRef: l, optionsRef: i, isForcedOpen: u, isOpen: p } = c, { popoverContainer: C } = _(), d = h(e, g.Search);
|
|
207
207
|
if (!p)
|
|
@@ -226,7 +226,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
226
226
|
return /* @__PURE__ */ t.createElement(Fe, {
|
|
227
227
|
className: r,
|
|
228
228
|
isDismissable: !0
|
|
229
|
-
}, /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(
|
|
229
|
+
}, /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(De, {
|
|
230
230
|
ref: l,
|
|
231
231
|
className: n
|
|
232
232
|
}, /* @__PURE__ */ t.createElement(re, {
|
|
@@ -250,7 +250,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
250
250
|
...n,
|
|
251
251
|
renderEmptyState: l ? () => l : void 0
|
|
252
252
|
}, o.map((u) => {
|
|
253
|
-
const p =
|
|
253
|
+
const p = G(u.longCountryCode) || "";
|
|
254
254
|
return I(a, {
|
|
255
255
|
key: u.shortCountryCode,
|
|
256
256
|
countryCode: u.shortCountryCode,
|
|
@@ -262,7 +262,7 @@ const g = ({ children: e, className: n, "aria-label": r, placement: o, offset: a
|
|
|
262
262
|
return c ? /* @__PURE__ */ t.createElement(Me, {
|
|
263
263
|
filter: (u, p, C) => {
|
|
264
264
|
const d = o.find((m) => m.shortCountryCode === C.key);
|
|
265
|
-
return !!d &&
|
|
265
|
+
return !!d && Qe(d, p);
|
|
266
266
|
}
|
|
267
267
|
}, r ? I(c, {
|
|
268
268
|
autoFocus: !1
|
|
@@ -272,7 +272,7 @@ g.Popover = g;
|
|
|
272
272
|
g.Modal = nt;
|
|
273
273
|
const ie = ({ className: e, children: n, "aria-label": r, ...o }) => {
|
|
274
274
|
const { autoFocus: a = !0 } = o;
|
|
275
|
-
return /* @__PURE__ */ t.createElement(
|
|
275
|
+
return /* @__PURE__ */ t.createElement(we, {
|
|
276
276
|
"aria-label": r,
|
|
277
277
|
autoFocus: a
|
|
278
278
|
}, /* @__PURE__ */ t.createElement(U, {
|
|
@@ -303,18 +303,18 @@ const T = ({ children: e, className: n, ...r }) => {
|
|
|
303
303
|
value: i
|
|
304
304
|
}, u));
|
|
305
305
|
}, me = ({ className: e }) => {
|
|
306
|
-
const { longCountryCode: n } =
|
|
306
|
+
const { longCountryCode: n } = K();
|
|
307
307
|
return /* @__PURE__ */ t.createElement(Y, {
|
|
308
308
|
className: e,
|
|
309
309
|
longCountryCode: n
|
|
310
310
|
});
|
|
311
311
|
}, pe = ({ className: e }) => {
|
|
312
|
-
const { countryName: n } =
|
|
312
|
+
const { countryName: n } = K();
|
|
313
313
|
return /* @__PURE__ */ t.createElement("span", {
|
|
314
314
|
className: e
|
|
315
315
|
}, n);
|
|
316
316
|
}, Ce = ({ className: e }) => {
|
|
317
|
-
const { dialingCode: n } =
|
|
317
|
+
const { dialingCode: n } = K();
|
|
318
318
|
return /* @__PURE__ */ t.createElement("span", {
|
|
319
319
|
className: e
|
|
320
320
|
}, n);
|
|
@@ -324,7 +324,7 @@ T.Name = pe;
|
|
|
324
324
|
T.Code = Ce;
|
|
325
325
|
g.Option = T;
|
|
326
326
|
const at = ({ className: e }) => {
|
|
327
|
-
const { t: n } =
|
|
327
|
+
const { t: n } = D(), { inputId: r, ariaDescribedBy: o } = oe(), { id: a, placeholder: c, disabled: l, readOnly: i, required: u, label: p, hasError: C } = w(), { currentValue: d, handlePhoneChange: m } = _(), f = F(null);
|
|
328
328
|
return he(() => {
|
|
329
329
|
var y;
|
|
330
330
|
(y = f.current) == null || y.focus({
|
|
@@ -347,7 +347,7 @@ const at = ({ className: e }) => {
|
|
|
347
347
|
className: e
|
|
348
348
|
});
|
|
349
349
|
}, st = ({ children: e, ...n }) => {
|
|
350
|
-
const r = n, { isForcedOpen: o } = r, { disabled: a, readOnly: c, required: l, hasError: i } =
|
|
350
|
+
const r = n, { isForcedOpen: o } = r, { disabled: a, readOnly: c, required: l, hasError: i } = w(), [u, p] = A(!1), { t: C } = D(), { selectedCountryCode: d, handleCountryCodeChange: m } = _(), f = o || u && !a && !c;
|
|
351
351
|
return /* @__PURE__ */ t.createElement(xe, {
|
|
352
352
|
"aria-label": C("field.phone.country-code.aria-label"),
|
|
353
353
|
value: d ?? null,
|
|
@@ -367,7 +367,7 @@ const at = ({ className: e }) => {
|
|
|
367
367
|
const r = n;
|
|
368
368
|
return /* @__PURE__ */ t.createElement(Re, null, h(e, s.CountryButton), I(h(e, s.CountryOptions.Modal), r));
|
|
369
369
|
}, lt = ({ children: e, className: n }) => {
|
|
370
|
-
const r = F(null), o = F(null), a = F(!1), { id: c, disabled: l, hasError: i, showFlag: u, onFocus: p, onBlur: C } =
|
|
370
|
+
const r = F(null), o = F(null), a = F(!1), { id: c, disabled: l, hasError: i, showFlag: u, onFocus: p, onBlur: C } = w(), d = Ve(C), { countries: m } = _(), f = h(e, s.CountryDrawer), y = h(e, s.CountryPopover), S = h(e, s.PhoneNumber), N = m.length > 1, B = He(c) && !!y && N, R = typeof n == "function" ? ({ isHovered: P, isFocusWithin: L }) => n({
|
|
371
371
|
hasCountryOptions: N,
|
|
372
372
|
isHovered: P,
|
|
373
373
|
isFocusWithin: L
|
|
@@ -380,9 +380,9 @@ const at = ({ className: e }) => {
|
|
|
380
380
|
a.current || (a.current = !0, p == null || p());
|
|
381
381
|
},
|
|
382
382
|
onBlur: (P) => {
|
|
383
|
-
var v,
|
|
383
|
+
var v, j;
|
|
384
384
|
const L = P.relatedTarget;
|
|
385
|
-
!((v = r.current) != null && v.contains(L)) && !((
|
|
385
|
+
!((v = r.current) != null && v.contains(L)) && !((j = o.current) != null && j.contains(L)) && (a.current = !1, d());
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
return m.length === 1 ? /* @__PURE__ */ t.createElement(U, {
|
|
@@ -403,13 +403,13 @@ const at = ({ className: e }) => {
|
|
|
403
403
|
};
|
|
404
404
|
s.Label = Ae;
|
|
405
405
|
s.Control = lt;
|
|
406
|
-
s.CountryButton =
|
|
406
|
+
s.CountryButton = z;
|
|
407
407
|
s.CountryDrawer = ct;
|
|
408
408
|
s.CountryPopover = st;
|
|
409
409
|
s.CountryOptions = g;
|
|
410
410
|
s.PhoneNumber = at;
|
|
411
|
-
s.Description =
|
|
412
|
-
s.Error =
|
|
411
|
+
s.Description = je;
|
|
412
|
+
s.Error = $e;
|
|
413
413
|
const ut = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
414
414
|
width: 24,
|
|
415
415
|
height: 24,
|
|
@@ -453,18 +453,18 @@ const ut = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
453
453
|
}), vt = () => /* @__PURE__ */ t.createElement("span", {
|
|
454
454
|
className: E.chevron,
|
|
455
455
|
"aria-hidden": "true"
|
|
456
|
-
}, /* @__PURE__ */ t.createElement(
|
|
457
|
-
const e = qe(Se, O.selectOptionWithoutFocusRing, E.option,
|
|
456
|
+
}, /* @__PURE__ */ t.createElement(ze, null)), Zt = () => {
|
|
457
|
+
const e = qe(Se, O.selectOptionWithoutFocusRing, E.option, J), n = Q(Ie, [
|
|
458
458
|
E.control
|
|
459
|
-
]), r =
|
|
459
|
+
]), r = Q(Le, [
|
|
460
460
|
E.countrySearch
|
|
461
|
-
]), { t: o } =
|
|
461
|
+
]), { t: o } = D(), { PortalContainer: a } = ne(), c = /* @__PURE__ */ t.createElement(s.CountryOptions.Search, {
|
|
462
462
|
className: r,
|
|
463
463
|
"aria-label": o("field.phone.country-search-input.aria-label")
|
|
464
464
|
}, /* @__PURE__ */ t.createElement(it, {
|
|
465
465
|
className: E.searchIcon
|
|
466
466
|
}), /* @__PURE__ */ t.createElement(s.CountryOptions.Search.Input, {
|
|
467
|
-
className: b(O.innerInput,
|
|
467
|
+
className: b(O.innerInput, J),
|
|
468
468
|
placeholder: o("field.phone.country-search-input.placeholder")
|
|
469
469
|
})), l = /* @__PURE__ */ t.createElement(s.CountryOptions.EmptyState, null, o("field.phone.country-selector-dropdown.no-result")), i = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(s.CountryButton.Flag, {
|
|
470
470
|
className: E.flag
|
|
@@ -503,10 +503,10 @@ const ut = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
503
503
|
className: b(O.innerInput, E.phoneNumber)
|
|
504
504
|
})), /* @__PURE__ */ t.createElement(s.Error, {
|
|
505
505
|
className: b(_e, O.error)
|
|
506
|
-
}, /* @__PURE__ */ t.createElement(
|
|
506
|
+
}, /* @__PURE__ */ t.createElement(We, null), /* @__PURE__ */ t.createElement(s.Error.Text, null)), /* @__PURE__ */ t.createElement(s.Description, {
|
|
507
507
|
className: b(Ne, O.description)
|
|
508
508
|
}, Pt));
|
|
509
509
|
};
|
|
510
510
|
export {
|
|
511
|
-
|
|
511
|
+
Zt as P
|
|
512
512
|
};
|