@wix/form-elements 1.143.0 → 1.145.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-BAwonF75.js → appointment-rac-De-uH9rz.js} +93 -93
- package/dist/component/{bookings-address-rac-xhj2n7jK.js → bookings-address-rac-DB6QCMQJ.js} +1 -1
- package/dist/component/{bookings-email-rac-BGjeAwgm.js → bookings-email-rac-g6ZdB_BO.js} +1 -1
- package/dist/component/{bookings-first-name-rac-l392yYAU.js → bookings-first-name-rac-DQgL_VHl.js} +1 -1
- package/dist/component/{bookings-header-rac-JwIo7hsJ.js → bookings-header-rac-DAnIm-Oq.js} +1 -1
- package/dist/component/{bookings-last-name-rac-CJp81BPl.js → bookings-last-name-rac-D62jNdDb.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-BiPklGE_.js → bookings-login-bar-rac-5z8HfBhU.js} +1 -1
- package/dist/component/{bookings-phone-rac-mQfDJGkK.js → bookings-phone-rac-D0gu-_wy.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-BOfHn2EU.js → bookings-rich-text-rac-b4J1HcdI.js} +1 -1
- package/dist/component/{checkbox-field-rac-CA6SeM0c.js → checkbox-field-rac-CmRRc9Dz.js} +83 -83
- package/dist/component/{checkbox-group-field-headless-ChLT0zKA.js → checkbox-group-field-headless-CB8yAfMe.js} +61 -61
- package/dist/component/{checkbox-group-field-rac-_Fkre79S.js → checkbox-group-field-rac-C5gRZRTd.js} +4 -4
- package/dist/component/{checkbox-group-rac-esBLJZ6Y.js → checkbox-group-rac-DNDF1Irh.js} +1 -1
- package/dist/component/{checkbox-rac-C3vXtbJh.js → checkbox-rac-B9vztGBU.js} +1 -1
- package/dist/component/{contacts-address-rac-BuBBBt19.js → contacts-address-rac-CKZeSncj.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-BMBJeVOK.js → contacts-birthdate-rac-BbpNNQgF.js} +1 -1
- package/dist/component/{contacts-company-rac-CZl168-E.js → contacts-company-rac-BX2KT201.js} +1 -1
- package/dist/component/{contacts-email-rac-CJgVzCns.js → contacts-email-rac-5Irzx1mA.js} +1 -1
- package/dist/component/{contacts-first-name-rac-9ZNYKQeb.js → contacts-first-name-rac-CxKp8_2u.js} +1 -1
- package/dist/component/{contacts-last-name-rac-KgylQwHW.js → contacts-last-name-rac-BDCbSv5I.js} +1 -1
- package/dist/component/{contacts-phone-rac-DYr30FLP.js → contacts-phone-rac-BM_PV_uH.js} +1 -1
- package/dist/component/{contacts-position-rac-B9BZZ3K9.js → contacts-position-rac-1aqthQSi.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DOQb2GLm.js → contacts-subscribe-rac-CdqXs4kp.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-cYE1ehXN.js → contacts-tax-id-rac-BKHpcDb6.js} +1 -1
- package/dist/component/{date-availability-BOKvA8w-.js → date-availability-DmFFTX8p.js} +1 -1
- package/dist/component/{date-input-field-rac-BwY53gNr.js → date-input-field-rac-BnlAOn12.js} +45 -45
- package/dist/component/{date-input-rac-Cgg4QJbB.js → date-input-rac-BB6qZ16w.js} +1 -1
- package/dist/component/{date-picker-field-rac-0Ue6uiCM.js → date-picker-field-rac-Ckwu2vD6.js} +11 -11
- package/dist/component/{date-picker-rac-CgICj33f.js → date-picker-rac-DSqzUAaH.js} +1 -1
- package/dist/component/{date-time-input-field-rac-ChRCMk7_.js → date-time-input-field-rac-DO-iRdkW.js} +21 -21
- package/dist/component/{date-time-input-rac-B8tRZrri.js → date-time-input-rac-smVCCxdY.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-B_qjx1QD.js → dext-checkbox-group-rac-B8bx3rT2.js} +4 -4
- package/dist/component/{dext-checkbox-rac-Bw9SyhHA.js → dext-checkbox-rac-x8VLGRbc.js} +1 -1
- package/dist/component/{dext-date-picker-rac-Bzn28zNq.js → dext-date-picker-rac-D2a9NXap.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-7Cuk3PoA.js → dext-date-time-input-rac-Cp5XjpGv.js} +1 -1
- package/dist/component/{dext-dropdown-rac-Md1VI5pc.js → dext-dropdown-rac-nWgEvyxt.js} +1 -1
- package/dist/component/{dext-email-rac-DbHwHGKz.js → dext-email-rac-CkX6ya8p.js} +1 -1
- package/dist/component/{dext-number-input-rac-DIVk3zXL.js → dext-number-input-rac-CKT0MS1x.js} +1 -1
- package/dist/component/{dext-phone-rac-ZIya63UJ.js → dext-phone-rac-DM2E7zW_.js} +1 -1
- package/dist/component/{dext-radio-group-rac-DV1xHkOD.js → dext-radio-group-rac-Czr5yY3K.js} +4 -4
- package/dist/component/{dext-rating-input-rac-YRIYgeT4.js → dext-rating-input-rac-CKWNpFuu.js} +1 -1
- package/dist/component/{dext-tags-rac-DTJ6Pz_x.js → dext-tags-rac-6AskGGTp.js} +4 -4
- package/dist/component/{dext-text-area-rac-V-d9i95A.js → dext-text-area-rac-ClGLD7sD.js} +1 -1
- package/dist/component/{dext-text-input-rac-ccrundX-.js → dext-text-input-rac-Blbk53d4.js} +1 -1
- package/dist/component/{dext-url-input-rac-Bd5SZ2U4.js → dext-url-input-rac-BuitmJU0.js} +1 -1
- package/dist/component/{donation-rac-BFmpW-3b.js → donation-rac-DOifFCD7.js} +52 -52
- package/dist/component/{dropdown-field-headless-C2qgeReH.js → dropdown-field-headless-m2P6s7X5.js} +22 -22
- package/dist/component/{dropdown-field-rac-Bj1YSgpT.js → dropdown-field-rac-5e6wWJBl.js} +4 -4
- package/dist/component/{dropdown-rac-DfdvX5I5.js → dropdown-rac-BGxE9pJB.js} +1 -1
- package/dist/component/{ecom-address-rac-DOWNQhhX.js → ecom-address-rac-kbD9qW5Y.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-2ELdC1ql.js → ecom-subscription-checkbox-rac-CE-Yixnj.js} +5 -5
- package/dist/component/{email-input-field-rac-CY0U6vEM.js → email-input-field-rac-CbwcB33o.js} +46 -46
- package/dist/component/{events-repeater-rac-C2oo_RZt.js → events-repeater-rac-CGhUscBr.js} +4 -4
- package/dist/component/{events-rsvp-rac-BrimIo0r.js → events-rsvp-rac-AQ33zPTe.js} +3 -3
- package/dist/component/{field-error-headless-r0fX50xw.js → field-error-headless-ClPQ03Jc.js} +9 -9
- package/dist/component/field-label-headless-DhN8Lkuq.js +52 -0
- package/dist/component/{file-upload-rac-Beb2BcFK.js → file-upload-rac-yTx1ZRhZ.js} +53 -53
- package/dist/component/{fixed-payment-rac-DGFWYMZG.js → fixed-payment-rac-nlyxa9nB.js} +12 -12
- package/dist/component/{form-DtzwuBIo.js → form-D3iU18lh.js} +2386 -2352
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +2 -2
- package/dist/component/{header-field-rac-CVmGSa0E.js → header-field-rac-DAEzcleV.js} +4 -4
- package/dist/component/{header-rac-C3AEJmYN.js → header-rac-CJZ4qMFg.js} +1 -1
- package/dist/component/{image-choice-rac-Ch-mxLgP.js → image-choice-rac-BFAMHwPh.js} +10 -10
- package/dist/component/{index-CTn6AQ3A.js → index-DQW26cnX.js} +2 -2
- package/dist/component/{index-CmqLlW8X.js → index-W7GOFnq8.js} +43 -43
- package/dist/component/{isObjectLike-iyypwAQL.js → isObjectLike-CE8eaxSI.js} +7 -7
- package/dist/component/{multiline-address-field-rac-DJXcb6NG.js → multiline-address-field-rac-FbJO0HFf.js} +94 -94
- package/dist/component/{multiline-address-rac-DcZgTx1c.js → multiline-address-rac-CI-vt6Pm.js} +1 -1
- package/dist/component/{number-input-field-rac-W3TqQGhC.js → number-input-field-rac-BRVAr7LL.js} +21 -21
- package/dist/component/{number-input-rac-CdXigsba.js → number-input-rac-C8hCiJiu.js} +1 -1
- package/dist/component/{password-rac-Dph6984u.js → password-rac-Baslr6Ga.js} +7 -7
- package/dist/component/{payment-input-rac-D5ARk1lF.js → payment-input-rac-CfJSKxYz.js} +17 -17
- package/dist/component/{phone-input-field-rac-BUfe-B2i.js → phone-input-field-rac-Dqh4CXdC.js} +24 -24
- package/dist/component/{phone-rac-DTiWT1uy.js → phone-rac-DaLuGuxd.js} +1 -1
- package/dist/component/{product-list-rac-1_Q2JYwH.js → product-list-rac-PNMwRBtL.js} +31 -31
- package/dist/component/{quiz-radio-group-rac-iyBhi0wJ.js → quiz-radio-group-rac-DN8vY-oM.js} +1 -1
- package/dist/component/{radio-button-module-classes-DwfobXBe.js → radio-button-module-classes-DlJi9a2f.js} +11 -11
- package/dist/component/{radio-group-field-rac-BkKNVwMi.js → radio-group-field-rac-C0tLXhl5.js} +4 -4
- package/dist/component/{radio-group-rac-CH0nkJ8V.js → radio-group-rac-FAk7PYgP.js} +1 -1
- package/dist/component/{rating-input-field-rac-CUUUlgZi.js → rating-input-field-rac-Cl1kH_uu.js} +12 -12
- package/dist/component/{rating-input-rac-8yEiqBR5.js → rating-input-rac-D9p-0pkI.js} +1 -1
- package/dist/component/{rich-content-rac.module-DeKU0pwh.js → rich-content-rac.module-Dkr46kPC.js} +3 -3
- package/dist/component/{rich-text-field-rac-Cwd-RWTi.js → rich-text-field-rac-DthhTvTp.js} +4 -4
- package/dist/component/{rich-text-rac-C5-jPNYP.js → rich-text-rac-DqZX4NeB.js} +1 -1
- package/dist/component/{service-dropdown-rac-DBGAnsut.js → service-dropdown-rac-BMOGLU2Z.js} +30 -30
- package/dist/component/{services-multi-choice-rac-CqEoGsuw.js → services-multi-choice-rac-DcdUewzJ.js} +5 -5
- package/dist/component/{signature-rac-Cq3y66Cr.js → signature-rac-BRvN6kUW.js} +37 -37
- package/dist/component/submit-button-rac-B70UC8eS.js +228 -0
- package/dist/component/{tags-field-rac-CpJ0O9f_.js → tags-field-rac-NpYyV8X4.js} +16 -16
- package/dist/component/{tags-rac-BPjw67Po.js → tags-rac-BMEbpJ-z.js} +1 -1
- package/dist/component/{text-area-field-rac-BG6MJuIW.js → text-area-field-rac-BLSrNwJ6.js} +9 -9
- package/dist/component/{text-area-rac-BAS4F4VC.js → text-area-rac-Cm7aAfIz.js} +1 -1
- package/dist/component/{text-input-field-rac-BhMktcEd.js → text-input-field-rac-BDqV7s0M.js} +3 -3
- package/dist/component/{text-input-headless-Bpjd70nh.js → text-input-headless-B0jcwDev.js} +7 -7
- package/dist/component/{text-input-rac-Bj21XKGA.js → text-input-rac-Cc_SkCCS.js} +1 -1
- package/dist/component/{time-input-rac-DBpRHdnX.js → time-input-rac-DDCiAFe2.js} +33 -33
- package/dist/component/{url-input-field-rac-B_EMXVWh.js → url-input-field-rac-jen6pbz7.js} +24 -24
- package/dist/component/{url-input-rac-D0Ck-9KV.js → url-input-rac-BWh6udtS.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-CkpHwC6t.js → use-dropdown-option-class-name-OD8brKoy.js} +2 -2
- package/dist/component/{use-dropdown-trigger-class-name-DmDwpAVn.js → use-dropdown-trigger-class-name-BrkmG0ad.js} +4 -4
- package/dist/component/{use-element-state-class-name-BrgdwHYP.js → use-element-state-class-name-B1r_nXW1.js} +3 -3
- package/dist/component/{use-hoverable-input-class-name-qVo45l-t.js → use-hoverable-input-class-name-B-FhrcyQ.js} +6 -6
- package/dist/component/{use-service-options-base-Dlqs4p0Z.js → use-service-options-base-CTA_43F3.js} +1 -1
- package/dist/component/use-text-input-class-name-BXuk3TK7.js +6 -0
- package/dist/form.d.ts +36 -0
- package/package.json +2 -2
- package/dist/component/field-label-headless-D-kCfg8j.js +0 -52
- package/dist/component/submit-button-rac-CKM7yUL4.js +0 -172
- package/dist/component/use-text-input-class-name-CP2VJOso.js +0 -6
package/dist/component/{number-input-field-rac-W3TqQGhC.js → number-input-field-rac-BRVAr7LL.js}
RENAMED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { RicosViewer as P } from "@wix/ricos/viewer";
|
|
2
2
|
import i from "classnames";
|
|
3
|
-
import r, { useState as $, useCallback as
|
|
4
|
-
import { NumberField as
|
|
5
|
-
import {
|
|
3
|
+
import r, { useState as $, useCallback as G, useEffect as Q, useRef as U } from "react";
|
|
4
|
+
import { NumberField as j, Input as z } from "react-aria-components";
|
|
5
|
+
import { bn as _, bk as S, bx as H, bp as J, R as K, $ as W, G as X, u as Y } from "./form-D3iU18lh.js";
|
|
6
6
|
import { f as c } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as Z, E as w } from "./field-error-headless-
|
|
8
|
-
import { L as ee } from "./field-label-headless-
|
|
7
|
+
import { D as Z, E as w } from "./field-error-headless-ClPQ03Jc.js";
|
|
8
|
+
import { L as ee } from "./field-label-headless-DhN8Lkuq.js";
|
|
9
9
|
import { g as re, c as te } from "./numeric-input-utils-CuBMi4-a.js";
|
|
10
10
|
import { u as ne } from "./use-invoke-callback-UH73A_J3.js";
|
|
11
11
|
import { E as ae } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
-
import { s as
|
|
13
|
-
import { u as se } from "./use-text-input-class-name-
|
|
12
|
+
import { s as p } from "./field-rac.module-DfEb7pBp.js";
|
|
13
|
+
import { u as se } from "./use-text-input-class-name-BXuk3TK7.js";
|
|
14
14
|
const e = ({ children: t }) => {
|
|
15
15
|
var F, R, L;
|
|
16
|
-
const { id: a, value: s, onChange: l, disabled:
|
|
16
|
+
const { id: a, value: s, onChange: l, disabled: d, required: b, readOnly: o, onBlur: E, onFocus: f, FieldLayout: m, hasError: u, validation: n } = _(), { labelId: x } = S(), D = ((F = n == null ? void 0 : n.number) == null ? void 0 : F.multipleOf) || 1, y = (R = n == null ? void 0 : n.number) == null ? void 0 : R.maximum, A = (L = n == null ? void 0 : n.number) == null ? void 0 : L.minimum, g = O(s), [T, I] = $(g), V = ne(E), h = c(t, e.Label), k = c(t, e.Input), q = c(t, e.Description), M = c(t, e.Error), B = G((N) => {
|
|
17
17
|
if (N === void 0 || Number.isNaN(N)) {
|
|
18
18
|
l(""), I(NaN);
|
|
19
19
|
return;
|
|
@@ -24,18 +24,18 @@ const e = ({ children: t }) => {
|
|
|
24
24
|
D,
|
|
25
25
|
l
|
|
26
26
|
]);
|
|
27
|
-
return
|
|
27
|
+
return Q(() => {
|
|
28
28
|
I(O(s));
|
|
29
29
|
}, [
|
|
30
30
|
s
|
|
31
31
|
]), /* @__PURE__ */ r.createElement(m, {
|
|
32
32
|
fieldId: a,
|
|
33
33
|
renderLabel: () => h,
|
|
34
|
-
renderInput: () => /* @__PURE__ */ r.createElement(
|
|
35
|
-
"aria-labelledby":
|
|
34
|
+
renderInput: () => /* @__PURE__ */ r.createElement(j, {
|
|
35
|
+
"aria-labelledby": x,
|
|
36
36
|
value: T,
|
|
37
37
|
onChange: B,
|
|
38
|
-
isDisabled:
|
|
38
|
+
isDisabled: d,
|
|
39
39
|
isRequired: b,
|
|
40
40
|
isReadOnly: o,
|
|
41
41
|
isInvalid: u,
|
|
@@ -43,18 +43,18 @@ const e = ({ children: t }) => {
|
|
|
43
43
|
onFocus: f,
|
|
44
44
|
minValue: A ?? void 0,
|
|
45
45
|
maxValue: y ?? void 0
|
|
46
|
-
},
|
|
47
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null,
|
|
46
|
+
}, k),
|
|
47
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, M, q)
|
|
48
48
|
});
|
|
49
49
|
}, le = ({ className: t }) => {
|
|
50
50
|
var u;
|
|
51
|
-
const { t: a } = H(), { inputId: s, ariaDescribedBy: l } = S(), { id:
|
|
51
|
+
const { t: a } = H(), { inputId: s, ariaDescribedBy: l } = S(), { id: d, placeholder: b, validation: o, label: E, required: f } = _();
|
|
52
52
|
(u = o == null ? void 0 : o.number) != null && u.multipleOf;
|
|
53
|
-
const m =
|
|
53
|
+
const m = U(null);
|
|
54
54
|
return J(() => {
|
|
55
55
|
var n;
|
|
56
56
|
(n = m.current) == null || n.focus();
|
|
57
|
-
},
|
|
57
|
+
}, d), /* @__PURE__ */ r.createElement(z, {
|
|
58
58
|
ref: m,
|
|
59
59
|
id: s,
|
|
60
60
|
"aria-describedby": l,
|
|
@@ -76,15 +76,15 @@ const O = (t) => te(t) ?? NaN, oe = ({ content: t, locale: a }) => /* @__PURE__
|
|
|
76
76
|
}), Re = () => {
|
|
77
77
|
const t = se();
|
|
78
78
|
return /* @__PURE__ */ r.createElement(e, null, /* @__PURE__ */ r.createElement(e.Label, {
|
|
79
|
-
className: i(K,
|
|
79
|
+
className: i(K, p.label)
|
|
80
80
|
}, /* @__PURE__ */ r.createElement(e.Label.Required, {
|
|
81
|
-
className: i(W,
|
|
81
|
+
className: i(W, p.requiredMark)
|
|
82
82
|
})), /* @__PURE__ */ r.createElement(e.Input, {
|
|
83
83
|
className: t
|
|
84
84
|
}), /* @__PURE__ */ r.createElement(e.Error, {
|
|
85
|
-
className: i(X,
|
|
85
|
+
className: i(X, p.error)
|
|
86
86
|
}, /* @__PURE__ */ r.createElement(ae, null), /* @__PURE__ */ r.createElement(e.Error.Text, null)), /* @__PURE__ */ r.createElement(e.Description, {
|
|
87
|
-
className: i(Y,
|
|
87
|
+
className: i(Y, p.description)
|
|
88
88
|
}, oe));
|
|
89
89
|
};
|
|
90
90
|
export {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import e, { useState as N, useRef as S } from "react";
|
|
2
2
|
import { RicosViewer as x } from "@wix/ricos/viewer";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import {
|
|
5
|
-
import { TextField as M, Group as k, Input as q, Button as
|
|
4
|
+
import { bn as E, bk as I, bp as O, bx as A, R as B, $ as V, G as v, u as P } from "./form-D3iU18lh.js";
|
|
5
|
+
import { TextField as M, Group as k, Input as q, Button as U } 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 H } from "./field-label-headless-
|
|
7
|
+
import { D as j, E as G } from "./field-error-headless-ClPQ03Jc.js";
|
|
8
|
+
import { L as H } from "./field-label-headless-DhN8Lkuq.js";
|
|
9
9
|
import { E as W } from "./error-icon-hZxQ6DEy.js";
|
|
10
10
|
import { H as Z } from "./custom-focus-class-_483Pkwp.js";
|
|
11
11
|
import { s as p } from "./field-rac.module-DfEb7pBp.js";
|
|
12
|
-
import { u as $ } from "./use-text-input-class-name-
|
|
12
|
+
import { u as $ } from "./use-text-input-class-name-BXuk3TK7.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, FieldLayout: _ } = E(), { labelId: y } = I(), [R, D] = N(!1), F = u(o, t.Label), L = u(o, t.Control), T = u(o, t.Description), w = u(o, t.Error);
|
|
15
15
|
return /* @__PURE__ */ e.createElement(_, {
|
|
@@ -59,7 +59,7 @@ const t = ({ children: o, className: r }) => {
|
|
|
59
59
|
});
|
|
60
60
|
}, J = ({ className: o, showPasswordTooltipText: r, hidePasswordTooltipText: l, children: s, ...c }) => {
|
|
61
61
|
const { isVisible: n, onToggleVisibility: m } = c, { disabled: a } = E(), i = n ? l : r;
|
|
62
|
-
return /* @__PURE__ */ e.createElement(
|
|
62
|
+
return /* @__PURE__ */ e.createElement(U, {
|
|
63
63
|
type: "button",
|
|
64
64
|
isDisabled: a,
|
|
65
65
|
onPress: m,
|
|
@@ -74,7 +74,7 @@ t.Label = H;
|
|
|
74
74
|
t.Control = Q;
|
|
75
75
|
t.Input = z;
|
|
76
76
|
t.Toggle = J;
|
|
77
|
-
t.Description =
|
|
77
|
+
t.Description = j;
|
|
78
78
|
t.Error = G;
|
|
79
79
|
const K = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
80
80
|
viewBox: "0 0 24 24",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import r, { useCallback as P, useRef as
|
|
1
|
+
import r, { useCallback as P, useRef as j } from "react";
|
|
2
2
|
import { RicosViewer as w } from "@wix/ricos/viewer";
|
|
3
3
|
import p from "classnames";
|
|
4
4
|
import { TextField as z, Group as J, Input as K } from "react-aria-components";
|
|
5
|
-
import {
|
|
5
|
+
import { bn as N, bk as D, bf as T, bx as W, bp as X, R as Y, $ as Z, G as ee, u as re } from "./form-D3iU18lh.js";
|
|
6
6
|
import { f as u } 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-ClPQ03Jc.js";
|
|
8
|
+
import { L as ae } from "./field-label-headless-DhN8Lkuq.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
13
|
import { s as d } from "./field-rac.module-DfEb7pBp.js";
|
|
14
|
-
import { u as ue } from "./use-text-input-class-name-
|
|
14
|
+
import { u as ue } from "./use-text-input-class-name-BXuk3TK7.js";
|
|
15
15
|
function ie(e, t) {
|
|
16
16
|
return {
|
|
17
17
|
productId: e.id,
|
|
@@ -19,7 +19,7 @@ function ie(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, "."));
|
|
@@ -39,10 +39,10 @@ const n = ({ children: e }) => {
|
|
|
39
39
|
c,
|
|
40
40
|
o,
|
|
41
41
|
b
|
|
42
|
-
]),
|
|
42
|
+
]), k = P((l) => {
|
|
43
43
|
b(l);
|
|
44
|
-
const R =
|
|
45
|
-
if (R !==
|
|
44
|
+
const R = x(L(l, c)), Q = x(_);
|
|
45
|
+
if (R !== Q) {
|
|
46
46
|
if (R === void 0) {
|
|
47
47
|
s(null);
|
|
48
48
|
return;
|
|
@@ -57,21 +57,21 @@ const n = ({ children: e }) => {
|
|
|
57
57
|
c,
|
|
58
58
|
_,
|
|
59
59
|
b
|
|
60
|
-
]),
|
|
60
|
+
]), B = u(e, n.Label), U = u(e, n.Input), v = u(e, n.Description), H = u(e, n.Error);
|
|
61
61
|
return /* @__PURE__ */ r.createElement(G, {
|
|
62
62
|
fieldId: t,
|
|
63
|
-
renderLabel: () =>
|
|
63
|
+
renderLabel: () => B,
|
|
64
64
|
renderInput: () => /* @__PURE__ */ r.createElement(z, {
|
|
65
65
|
"aria-labelledby": `${M} ${$}`,
|
|
66
66
|
value: a ? F : "",
|
|
67
|
-
onChange:
|
|
67
|
+
onChange: k,
|
|
68
68
|
isDisabled: i,
|
|
69
69
|
isReadOnly: m,
|
|
70
70
|
isRequired: I,
|
|
71
71
|
isInvalid: y,
|
|
72
72
|
onBlur: q,
|
|
73
73
|
onFocus: E
|
|
74
|
-
},
|
|
74
|
+
}, U),
|
|
75
75
|
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, H, v)
|
|
76
76
|
});
|
|
77
77
|
}, f = ({ children: e, className: t }) => {
|
|
@@ -90,7 +90,7 @@ 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 } = N(), { inputId: i, labelId: m, prefixId: I, ariaDescribedBy: y } = D(), o =
|
|
93
|
+
const { id: t, placeholder: a, label: s } = N(), { inputId: i, labelId: m, prefixId: I, ariaDescribedBy: y } = D(), o = j(null);
|
|
94
94
|
return X(() => {
|
|
95
95
|
var E;
|
|
96
96
|
(E = o.current) == null || E.focus();
|
|
@@ -111,14 +111,14 @@ n.Label = ae;
|
|
|
111
111
|
n.Input = f;
|
|
112
112
|
n.Description = te;
|
|
113
113
|
n.Error = ne;
|
|
114
|
-
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14",
|
|
114
|
+
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", h = {
|
|
115
115
|
inputGroup: de,
|
|
116
116
|
currency: fe
|
|
117
117
|
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(w, {
|
|
118
118
|
content: e,
|
|
119
119
|
locale: t
|
|
120
120
|
}), be = () => {
|
|
121
|
-
const e = ue(
|
|
121
|
+
const e = ue(h.inputGroup);
|
|
122
122
|
return /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(n.Label, {
|
|
123
123
|
className: p(Y, d.label)
|
|
124
124
|
}, /* @__PURE__ */ r.createElement(n.Label.Required, {
|
|
@@ -126,7 +126,7 @@ const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", x = {
|
|
|
126
126
|
})), /* @__PURE__ */ r.createElement(n.Input, {
|
|
127
127
|
className: e
|
|
128
128
|
}, /* @__PURE__ */ r.createElement(n.Input.Currency, {
|
|
129
|
-
className:
|
|
129
|
+
className: h.currency
|
|
130
130
|
}), /* @__PURE__ */ r.createElement(n.Input.Value, {
|
|
131
131
|
className: p(d.innerInput, ce)
|
|
132
132
|
})), /* @__PURE__ */ r.createElement(n.Error, {
|
package/dist/component/{phone-input-field-rac-BUfe-B2i.js → phone-input-field-rac-Dqh4CXdC.js}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { RicosViewer as Ce } from "@wix/ricos/viewer";
|
|
2
2
|
import h from "classnames";
|
|
3
|
-
import t, { useMemo as
|
|
4
|
-
import {
|
|
3
|
+
import t, { useMemo as $, useState as j, useRef as F, useEffect as k, useCallback as Q, createContext as ee, useContext as G, useId as de } from "react";
|
|
4
|
+
import { b6 as ye, bx as w, bf as te, bw as Ee, bn as D, bk as ne, bp as fe, R as ge, $ as he, Q as be, x as Oe, G as _e, u as Ne } from "./form-D3iU18lh.js";
|
|
5
5
|
import { UNSAFE_PortalProvider as Se } from "react-aria";
|
|
6
|
-
import { Dialog as oe, OverlayTriggerStateContext as Le, ModalOverlay as Ie, Modal as ve, SearchField as Pe, Group as q, ListBoxItem as Fe, DialogTrigger as
|
|
6
|
+
import { Dialog as oe, OverlayTriggerStateContext as Le, ModalOverlay as Ie, Modal as ve, SearchField as Pe, Group as q, ListBoxItem as Fe, DialogTrigger as we, Select as De, Input as re, Autocomplete as Be } from "react-aria-components";
|
|
7
7
|
import { f as g, a as I } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as Re, E as xe } from "./field-error-headless-
|
|
9
|
-
import { L as Me } from "./field-label-headless-
|
|
10
|
-
import { N as Te, S as
|
|
11
|
-
import { u as
|
|
12
|
-
import { a as Ae, u as ke } from "./use-dropdown-trigger-class-name-
|
|
13
|
-
import { V as Ue, u as Ve } from "./use-dropdown-option-class-name-
|
|
8
|
+
import { D as Re, E as xe } from "./field-error-headless-ClPQ03Jc.js";
|
|
9
|
+
import { L as Me } from "./field-label-headless-DhN8Lkuq.js";
|
|
10
|
+
import { N as Te, S as $e } from "./non-modal-popover-D-u13tmp.js";
|
|
11
|
+
import { u as je } from "./use-invoke-callback-UH73A_J3.js";
|
|
12
|
+
import { a as Ae, u as ke } from "./use-dropdown-trigger-class-name-BrkmG0ad.js";
|
|
13
|
+
import { V as Ue, u as Ve } from "./use-dropdown-option-class-name-OD8brKoy.js";
|
|
14
14
|
import ae, { AsYouType as qe, isValidPhoneNumber as Ge, isSupportedCountry as He } from "libphonenumber-js";
|
|
15
15
|
import "libphonenumber-js/metadata.min.json";
|
|
16
16
|
import { C as W } from "./calling-country-codes-PyWuOTmF.js";
|
|
@@ -18,7 +18,7 @@ import { C as Ye } from "./chevron-down-icon-CcpVm6B-.js";
|
|
|
18
18
|
import { E as ze } from "./error-icon-hZxQ6DEy.js";
|
|
19
19
|
import { H as Z } from "./custom-focus-class-_483Pkwp.js";
|
|
20
20
|
import { s as O } from "./field-rac.module-DfEb7pBp.js";
|
|
21
|
-
import { u as Ke } from "./use-text-input-class-name-
|
|
21
|
+
import { u as Ke } from "./use-text-input-class-name-BXuk3TK7.js";
|
|
22
22
|
function J(e) {
|
|
23
23
|
const n = e ? ae(e) : void 0, r = n == null ? void 0 : n.country;
|
|
24
24
|
if (r)
|
|
@@ -44,8 +44,8 @@ function X(e, n) {
|
|
|
44
44
|
return e;
|
|
45
45
|
}
|
|
46
46
|
function Qe() {
|
|
47
|
-
const { t: e } =
|
|
48
|
-
return
|
|
47
|
+
const { t: e } = w(), { language: n } = te();
|
|
48
|
+
return $(() => Object.keys(W).reduce((o, a) => {
|
|
49
49
|
const c = W[a], l = H(c), i = e(`locale-dataset.countries.${c.toUpperCase()}`);
|
|
50
50
|
return l && He(a) && o.push({
|
|
51
51
|
countryName: i,
|
|
@@ -69,11 +69,11 @@ function V(e, n) {
|
|
|
69
69
|
return e.toLowerCase().includes(n.toLowerCase());
|
|
70
70
|
}
|
|
71
71
|
function Je({ value: e, defaultCountryCode: n, allowedCountryCodes: r, onChange: o }) {
|
|
72
|
-
const [a, c] =
|
|
72
|
+
const [a, c] = j(e || ""), l = F(U(e ?? null) ?? ""), [i, u] = j(n);
|
|
73
73
|
Ee(() => {
|
|
74
74
|
c(""), l.current = "", u(n), o("");
|
|
75
75
|
});
|
|
76
|
-
const m =
|
|
76
|
+
const m = $(() => J(a), [
|
|
77
77
|
a
|
|
78
78
|
]);
|
|
79
79
|
k(() => {
|
|
@@ -146,10 +146,10 @@ const se = /* @__PURE__ */ ee(null), _ = () => {
|
|
|
146
146
|
});
|
|
147
147
|
}, s = ({ children: e }) => {
|
|
148
148
|
var S, P;
|
|
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 } = D(), [i, u] = j(null), m = (P = (S = l == null ? void 0 : l.string) == null ? void 0 : S.phoneOptions) == null ? void 0 : P.allowedCountryCodes, C = Qe(), d = $(() => We(C, m), [
|
|
150
150
|
C,
|
|
151
151
|
m
|
|
152
|
-
]), p =
|
|
152
|
+
]), p = $(() => d.map((T) => T.shortCountryCode), [
|
|
153
153
|
d
|
|
154
154
|
]), { currentValue: f, selectedCountryCode: y, handlePhoneChange: L, handleCountryCodeChange: N } = Je({
|
|
155
155
|
value: r,
|
|
@@ -179,8 +179,8 @@ const se = /* @__PURE__ */ ee(null), _ = () => {
|
|
|
179
179
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, M, x)
|
|
180
180
|
}));
|
|
181
181
|
}, K = ({ children: e, className: n }) => {
|
|
182
|
-
const { labelId: r } = ne(), { hasError: o, disabled: a, readOnly: c } =
|
|
183
|
-
return /* @__PURE__ */ t.createElement(
|
|
182
|
+
const { labelId: r } = ne(), { hasError: o, disabled: a, readOnly: c } = D(), { t: l } = w(), { selectedCountryCode: i, countries: u } = _(), m = de(), C = i ? u.find((y) => y.shortCountryCode === i) : void 0, d = C && H(C.longCountryCode) || "", p = l("field.phone.country-code.aria-label"), f = C ? `${p}, ${C.countryName}, ${d}` : p;
|
|
183
|
+
return /* @__PURE__ */ t.createElement($e, {
|
|
184
184
|
isDisabled: a || c,
|
|
185
185
|
id: m,
|
|
186
186
|
"aria-label": f,
|
|
@@ -324,7 +324,7 @@ A.Name = me;
|
|
|
324
324
|
A.Code = pe;
|
|
325
325
|
b.Option = A;
|
|
326
326
|
const rt = ({ className: e }) => {
|
|
327
|
-
const { t: n } =
|
|
327
|
+
const { t: n } = w(), { inputId: r, ariaDescribedBy: o } = ne(), { id: a, placeholder: c, disabled: l, readOnly: i, required: u, label: m, hasError: C } = D(), { currentValue: d, handlePhoneChange: p } = _(), f = F(null);
|
|
328
328
|
return fe(() => {
|
|
329
329
|
var y;
|
|
330
330
|
(y = f.current) == null || y.focus({
|
|
@@ -346,8 +346,8 @@ const rt = ({ className: e }) => {
|
|
|
346
346
|
className: e
|
|
347
347
|
});
|
|
348
348
|
}, at = ({ children: e, ...n }) => {
|
|
349
|
-
const r = n, { isForcedOpen: o } = r, { disabled: a, readOnly: c, required: l, hasError: i } =
|
|
350
|
-
return /* @__PURE__ */ t.createElement(
|
|
349
|
+
const r = n, { isForcedOpen: o } = r, { disabled: a, readOnly: c, required: l, hasError: i } = D(), [u, m] = j(!1), { t: C } = w(), { selectedCountryCode: d, handleCountryCodeChange: p } = _(), f = o || u && !a && !c;
|
|
350
|
+
return /* @__PURE__ */ t.createElement(De, {
|
|
351
351
|
"aria-label": C("field.phone.country-code.aria-label"),
|
|
352
352
|
value: d ?? null,
|
|
353
353
|
onChange: (y) => p(y),
|
|
@@ -364,9 +364,9 @@ const rt = ({ className: e }) => {
|
|
|
364
364
|
}));
|
|
365
365
|
}, st = ({ children: e, ...n }) => {
|
|
366
366
|
const r = n;
|
|
367
|
-
return /* @__PURE__ */ t.createElement(
|
|
367
|
+
return /* @__PURE__ */ t.createElement(we, null, g(e, s.CountryButton), I(g(e, s.CountryOptions.Modal), r));
|
|
368
368
|
}, ct = ({ children: e, className: n }) => {
|
|
369
|
-
const r = F(null), o = F(null), a = F(!1), { id: c, disabled: l, hasError: i, showFlag: u, onFocus: m, onBlur: C } =
|
|
369
|
+
const r = F(null), o = F(null), a = F(!1), { id: c, disabled: l, hasError: i, showFlag: u, onFocus: m, onBlur: C } = D(), d = je(C), { countries: p } = _(), f = g(e, s.CountryDrawer), y = g(e, s.CountryPopover), L = g(e, s.PhoneNumber), N = p.length > 1, B = Ae(c) && !!y && N, R = typeof n == "function" ? ({ isHovered: v, isFocusWithin: S }) => n({
|
|
370
370
|
hasCountryOptions: N,
|
|
371
371
|
isHovered: v,
|
|
372
372
|
isFocusWithin: S
|
|
@@ -453,7 +453,7 @@ const lt = (e) => /* @__PURE__ */ t.createElement("svg", {
|
|
|
453
453
|
className: E.chevron,
|
|
454
454
|
"aria-hidden": "true"
|
|
455
455
|
}, /* @__PURE__ */ t.createElement(Ye, null)), Qt = () => {
|
|
456
|
-
const e = Ve(O.selectOptionWithoutFocusRing, E.option, Z), n = ke(E.control), r = Ke(E.countrySearch), { t: o } =
|
|
456
|
+
const e = Ve(O.selectOptionWithoutFocusRing, E.option, Z), n = ke(E.control), r = Ke(E.countrySearch), { t: o } = w(), { PortalContainer: a } = te(), c = /* @__PURE__ */ t.createElement(s.CountryOptions.Search, {
|
|
457
457
|
className: r,
|
|
458
458
|
"aria-label": o("field.phone.country-search-input.aria-label")
|
|
459
459
|
}, /* @__PURE__ */ t.createElement(ut, {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import t, { useMemo as H, useCallback as M, useRef as
|
|
1
|
+
import t, { useMemo as H, useCallback as M, useRef as U } from "react";
|
|
2
2
|
import { RicosViewer as K } from "@wix/ricos/viewer";
|
|
3
3
|
import _ from "classnames";
|
|
4
|
-
import { CheckboxField as z, CheckboxButton as
|
|
5
|
-
import {
|
|
6
|
-
import { f as I, a as
|
|
7
|
-
import { L as ue, g as me } from "./field-label-headless-
|
|
4
|
+
import { CheckboxField as z, CheckboxButton as X, NumberField as j, Group as J, Button as Q, Input as W } from "react-aria-components";
|
|
5
|
+
import { bn as x, bk as Y, bf as w, bx as Z, bp as ee, R as te, $ as ne, S as ae, V as oe, U as re, Q as se, G as le, u as ie, T as ce } from "./form-D3iU18lh.js";
|
|
6
|
+
import { f as I, a as b } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { L as ue, g as me } from "./field-label-headless-DhN8Lkuq.js";
|
|
8
8
|
import { f as pe } from "./format-currency-BwShJ9vM.js";
|
|
9
|
-
import { D as de, E as Ee } from "./field-error-headless-
|
|
9
|
+
import { D as de, E as Ee } from "./field-error-headless-ClPQ03Jc.js";
|
|
10
10
|
import { F as ye } from "./fieldset-headless-CD3fds9J.js";
|
|
11
|
-
import { g as
|
|
11
|
+
import { g as fe } from "./payment-field-utils-DobiK5Xh.js";
|
|
12
12
|
import { S as _e } from "./selection-indicator-XQ8MYHUQ.js";
|
|
13
|
-
import { E as
|
|
13
|
+
import { E as be } from "./error-icon-hZxQ6DEy.js";
|
|
14
14
|
import { C as Ie } from "./checkbox-indicator-module-classes-6173wvuW.js";
|
|
15
15
|
import { s as q } from "./field-rac.module-DfEb7pBp.js";
|
|
16
16
|
import { o as V } from "./options-rac.module-_THNq6Qq.js";
|
|
17
|
-
import { u as Oe } from "./use-element-state-class-name-
|
|
17
|
+
import { u as Oe } from "./use-element-state-class-name-B1r_nXW1.js";
|
|
18
18
|
var Le = /* @__PURE__ */ (function(e) {
|
|
19
19
|
return e.crop = "CROP", e.fit = "FIT", e;
|
|
20
20
|
})({}), k = /* @__PURE__ */ (function(e) {
|
|
@@ -28,7 +28,7 @@ function Ce({ maxItems: e, products: a } = {}) {
|
|
|
28
28
|
}
|
|
29
29
|
const o = ({ children: e }) => {
|
|
30
30
|
var D;
|
|
31
|
-
const { id: a, value: s, onChange: n, disabled: r, readOnly: c, required: y, onBlur: O, onFocus: l, hasError: u, validation: m, FieldLayout: p } =
|
|
31
|
+
const { id: a, value: s, onChange: n, disabled: r, readOnly: c, required: y, onBlur: O, onFocus: l, hasError: u, validation: m, FieldLayout: p } = x(), { inputId: v, labelId: N, ariaDescribedBy: h } = Y(), f = I(e, o.Label), g = I(e, o.Options), A = I(e, o.Description), L = I(e, o.Error), i = H(() => s || [], [
|
|
32
32
|
s
|
|
33
33
|
]), T = Ce((D = m == null ? void 0 : m.predefined) == null ? void 0 : D.paymentOptions) === k.many, F = M((S, R) => {
|
|
34
34
|
const d = i.filter((G) => G.productId !== S.productId), B = R ? [
|
|
@@ -42,7 +42,7 @@ const o = ({ children: e }) => {
|
|
|
42
42
|
]);
|
|
43
43
|
return /* @__PURE__ */ t.createElement(p, {
|
|
44
44
|
fieldId: a,
|
|
45
|
-
renderLabel: () =>
|
|
45
|
+
renderLabel: () => f,
|
|
46
46
|
renderInput: () => /* @__PURE__ */ t.createElement(ye, {
|
|
47
47
|
id: v,
|
|
48
48
|
ariaLabelledBy: N,
|
|
@@ -50,7 +50,7 @@ const o = ({ children: e }) => {
|
|
|
50
50
|
required: y,
|
|
51
51
|
onBlur: O,
|
|
52
52
|
onFocus: l
|
|
53
|
-
}, g ?
|
|
53
|
+
}, g ? b(g, {
|
|
54
54
|
allowMany: T,
|
|
55
55
|
productValues: i,
|
|
56
56
|
onProductChange: F,
|
|
@@ -61,15 +61,15 @@ const o = ({ children: e }) => {
|
|
|
61
61
|
renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, L, A)
|
|
62
62
|
});
|
|
63
63
|
}, $ = ({ children: e, className: a, ...s }) => {
|
|
64
|
-
const { allowMany: n, productValues: r, onProductChange: c, disabled: y, readOnly: O, hasError: l } = s, { options: u, validation: m, imageResize: p } =
|
|
64
|
+
const { allowMany: n, productValues: r, onProductChange: c, disabled: y, readOnly: O, hasError: l } = s, { options: u, validation: m, imageResize: p } = x(), { currency: v } = w(), { t: N } = Z(), h = I(e, o.Option);
|
|
65
65
|
return /* @__PURE__ */ t.createElement("div", {
|
|
66
66
|
className: a
|
|
67
|
-
}, u == null ? void 0 : u.map((
|
|
67
|
+
}, u == null ? void 0 : u.map((f, g) => {
|
|
68
68
|
var C, T, F, D, S;
|
|
69
|
-
const A = ((S = (D = (F = (T = (C = m == null ? void 0 : m.predefined) == null ? void 0 : C.paymentOptions) == null ? void 0 : T.products) == null ? void 0 : F.find((R) => R.id ===
|
|
70
|
-
return
|
|
71
|
-
key:
|
|
72
|
-
option:
|
|
69
|
+
const A = ((S = (D = (F = (T = (C = m == null ? void 0 : m.predefined) == null ? void 0 : C.paymentOptions) == null ? void 0 : T.products) == null ? void 0 : F.find((R) => R.id === f.value)) == null ? void 0 : D.fixedPriceOptions) == null ? void 0 : S.price) || "0", L = fe(N, v), i = r.find((R) => R.productId === f.value);
|
|
70
|
+
return b(h, {
|
|
71
|
+
key: f.id || f.value || f.label,
|
|
72
|
+
option: f,
|
|
73
73
|
price: A,
|
|
74
74
|
quantity: i == null ? void 0 : i.quantity,
|
|
75
75
|
isSelected: !!i,
|
|
@@ -84,13 +84,13 @@ const o = ({ children: e }) => {
|
|
|
84
84
|
});
|
|
85
85
|
}));
|
|
86
86
|
}, E = ({ children: e, className: a, ...s }) => {
|
|
87
|
-
const { option: n, price: r, quantity: c = 0, isSelected: y, allowMany: O, onProductChange: l, disabled: u, readOnly: m, hasError: p, currencyAriaLabel: v, imageResize: N, isFirst: h } = s, { id:
|
|
87
|
+
const { option: n, price: r, quantity: c = 0, isSelected: y, allowMany: O, onProductChange: l, disabled: u, readOnly: m, hasError: p, currencyAriaLabel: v, imageResize: N, isFirst: h } = s, { id: f } = x(), g = U(null), A = U(null), L = I(e, E.Image), i = I(e, E.Label), C = I(e, E.Price), T = I(e, E.Input), F = I(e, E.Quantity);
|
|
88
88
|
ee(() => {
|
|
89
89
|
var d;
|
|
90
90
|
h && ((d = g.current ?? A.current) == null || d.focus({
|
|
91
91
|
preventScroll: !0
|
|
92
92
|
}));
|
|
93
|
-
},
|
|
93
|
+
}, f);
|
|
94
94
|
const D = M((d) => {
|
|
95
95
|
l({
|
|
96
96
|
productId: n.value,
|
|
@@ -115,14 +115,14 @@ const o = ({ children: e }) => {
|
|
|
115
115
|
return O ? /* @__PURE__ */ t.createElement("div", {
|
|
116
116
|
className: a,
|
|
117
117
|
"data-hook": "product"
|
|
118
|
-
}, L ?
|
|
118
|
+
}, L ? b(L, {
|
|
119
119
|
option: n,
|
|
120
120
|
imageResize: N
|
|
121
|
-
}) : null, i ?
|
|
121
|
+
}) : null, i ? b(i, {
|
|
122
122
|
label: n.label
|
|
123
|
-
}) : null, C ?
|
|
123
|
+
}) : null, C ? b(C, {
|
|
124
124
|
price: r
|
|
125
|
-
}) : null, F ?
|
|
125
|
+
}) : null, F ? b(F, {
|
|
126
126
|
quantity: c,
|
|
127
127
|
onQuantityChange: S,
|
|
128
128
|
disabled: u,
|
|
@@ -137,18 +137,18 @@ const o = ({ children: e }) => {
|
|
|
137
137
|
isReadOnly: m,
|
|
138
138
|
isInvalid: p,
|
|
139
139
|
"aria-label": R
|
|
140
|
-
}, /* @__PURE__ */ t.createElement(
|
|
140
|
+
}, /* @__PURE__ */ t.createElement(X, {
|
|
141
141
|
ref: g,
|
|
142
142
|
className: a,
|
|
143
143
|
"data-hook": "product"
|
|
144
|
-
}, ({ isHovered: d, isFocused: B }) => /* @__PURE__ */ t.createElement(t.Fragment, null, L ?
|
|
144
|
+
}, ({ isHovered: d, isFocused: B }) => /* @__PURE__ */ t.createElement(t.Fragment, null, L ? b(L, {
|
|
145
145
|
option: n,
|
|
146
146
|
imageResize: N
|
|
147
|
-
}) : null, i ?
|
|
147
|
+
}) : null, i ? b(i, {
|
|
148
148
|
label: n.label
|
|
149
|
-
}) : null, C ?
|
|
149
|
+
}) : null, C ? b(C, {
|
|
150
150
|
price: r
|
|
151
|
-
}) : null,
|
|
151
|
+
}) : null, b(T, {
|
|
152
152
|
isSelected: y,
|
|
153
153
|
isHovered: d,
|
|
154
154
|
isFocused: B
|
|
@@ -195,7 +195,7 @@ const o = ({ children: e }) => {
|
|
|
195
195
|
}, [
|
|
196
196
|
u
|
|
197
197
|
]);
|
|
198
|
-
return /* @__PURE__ */ t.createElement(
|
|
198
|
+
return /* @__PURE__ */ t.createElement(j, {
|
|
199
199
|
value: s,
|
|
200
200
|
onChange: u,
|
|
201
201
|
minValue: 0,
|
|
@@ -263,7 +263,7 @@ const Se = "_options_519is_1", Pe = "_option_519is_1", Ne = "_optionInput_519is_
|
|
|
263
263
|
className: _(se, q.inputGroup, P.quantity)
|
|
264
264
|
}))), /* @__PURE__ */ t.createElement(o.Error, {
|
|
265
265
|
className: _(le, q.error)
|
|
266
|
-
}, /* @__PURE__ */ t.createElement(
|
|
266
|
+
}, /* @__PURE__ */ t.createElement(be, null), /* @__PURE__ */ t.createElement(o.Error.Text, null)), /* @__PURE__ */ t.createElement(o.Description, {
|
|
267
267
|
className: _(ie, q.description)
|
|
268
268
|
}, ve));
|
|
269
269
|
}, Ze = () => /* @__PURE__ */ t.createElement(Me, null);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import a, { useRef as F, useState as V, useEffect as T, useCallback as B } from "react";
|
|
2
|
-
import { RadioGroup as H, RadioField as k, RadioButton as
|
|
3
|
-
import {
|
|
2
|
+
import { RadioGroup as H, RadioField as k, RadioButton as x, TextField as A, Input as G } from "react-aria-components";
|
|
3
|
+
import { bn as g, bk as P, bx as D, bp as $ } from "./form-D3iU18lh.js";
|
|
4
4
|
import { f as d, a as v } from "./find-child-C60k4CxG.js";
|
|
5
|
-
import { D as U, E as
|
|
6
|
-
import { L as
|
|
5
|
+
import { D as U, E as M } from "./field-error-headless-ClPQ03Jc.js";
|
|
6
|
+
import { L as j } from "./field-label-headless-DhN8Lkuq.js";
|
|
7
7
|
import { S as w } from "./selection-indicator-XQ8MYHUQ.js";
|
|
8
8
|
const L = "Other", z = (e, t) => e == null ? void 0 : e.find((n) => (n.value ?? n.label) === t), S = (e, t) => !!t && !z(e, t), J = (e, t) => {
|
|
9
9
|
const l = t ? t.length + 2 : 0;
|
|
10
10
|
return e.slice(l);
|
|
11
11
|
}, i = ({ children: e, className: t }) => {
|
|
12
|
-
const { id: n, value: l, onChange: O, disabled: p, readOnly: f, required: b, onBlur: E, onFocus: m, hasError: r, FieldLayout: c, options: o } = g(), { inputId: h, labelId: C, ariaDescribedBy: I } =
|
|
12
|
+
const { id: n, value: l, onChange: O, disabled: p, readOnly: f, required: b, onBlur: E, onFocus: m, hasError: r, FieldLayout: c, options: o } = g(), { inputId: h, labelId: C, ariaDescribedBy: I } = P(), s = d(e, i.Label), _ = d(e, i.Options), R = d(e, i.Description), q = d(e, i.Error), N = S(o, l) ? L : l || null;
|
|
13
13
|
return /* @__PURE__ */ a.createElement(c, {
|
|
14
14
|
fieldId: n,
|
|
15
15
|
renderLabel: () => v(s, {
|
|
@@ -33,7 +33,7 @@ const L = "Other", z = (e, t) => e == null ? void 0 : e.find((n) => (n.value ??
|
|
|
33
33
|
});
|
|
34
34
|
}, K = ({ children: e, className: t }) => {
|
|
35
35
|
const { options: n, addOther: l, addOtherLabel: O, id: p, numberOfColumns: f, hasError: b } = g(), { t: E } = D(), m = d(e, i.Option), r = F(null), c = O || E("add-other.default-other-option-label") || L;
|
|
36
|
-
return
|
|
36
|
+
return $(() => {
|
|
37
37
|
var o;
|
|
38
38
|
(o = r.current) == null || o.focus();
|
|
39
39
|
}, p), /* @__PURE__ */ a.createElement("div", {
|
|
@@ -59,7 +59,7 @@ const L = "Other", z = (e, t) => e == null ? void 0 : e.find((n) => (n.value ??
|
|
|
59
59
|
className: t
|
|
60
60
|
}, /* @__PURE__ */ a.createElement(k, {
|
|
61
61
|
value: l
|
|
62
|
-
}, /* @__PURE__ */ a.createElement(
|
|
62
|
+
}, /* @__PURE__ */ a.createElement(x, {
|
|
63
63
|
ref: f,
|
|
64
64
|
className: C
|
|
65
65
|
}, ({ isSelected: s, isHovered: _, isFocused: R }) => /* @__PURE__ */ a.createElement(a.Fragment, null, v(c, {
|
|
@@ -90,13 +90,13 @@ const L = "Other", z = (e, t) => e == null ? void 0 : e.find((n) => (n.value ??
|
|
|
90
90
|
l,
|
|
91
91
|
o
|
|
92
92
|
]);
|
|
93
|
-
return /* @__PURE__ */ a.createElement(
|
|
93
|
+
return /* @__PURE__ */ a.createElement(A, {
|
|
94
94
|
"aria-label": o,
|
|
95
95
|
value: h,
|
|
96
96
|
onChange: I,
|
|
97
97
|
isDisabled: f,
|
|
98
98
|
isReadOnly: b
|
|
99
|
-
}, /* @__PURE__ */ a.createElement(
|
|
99
|
+
}, /* @__PURE__ */ a.createElement(G, {
|
|
100
100
|
ref: r,
|
|
101
101
|
className: e,
|
|
102
102
|
placeholder: O,
|
|
@@ -107,11 +107,11 @@ u.Label = Q;
|
|
|
107
107
|
u.Input = W;
|
|
108
108
|
u.Control = w;
|
|
109
109
|
u.OtherInput = X;
|
|
110
|
-
i.Label =
|
|
110
|
+
i.Label = j;
|
|
111
111
|
i.Options = K;
|
|
112
112
|
i.Option = u;
|
|
113
113
|
i.Description = U;
|
|
114
|
-
i.Error =
|
|
114
|
+
i.Error = M;
|
|
115
115
|
const Y = "_labelImage_1bq4s_1", Z = "_option_1bq4s_26", ee = "_optionInput_1bq4s_32", te = "_optionControl_1bq4s_50", oe = "_optionControlHover_1bq4s_72", ne = "_optionControlSelected_1bq4s_90", le = "_optionLabel_1bq4s_125", y = {
|
|
116
116
|
labelImage: Y,
|
|
117
117
|
option: Z,
|
package/dist/component/{radio-group-field-rac-BkKNVwMi.js → radio-group-field-rac-C0tLXhl5.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { RicosViewer as m } from "@wix/ricos/viewer";
|
|
2
2
|
import t from "classnames";
|
|
3
3
|
import e from "react";
|
|
4
|
-
import { a, s, R as n } from "./radio-button-module-classes-
|
|
4
|
+
import { a, s, R as n } from "./radio-button-module-classes-DlJi9a2f.js";
|
|
5
5
|
import { E as c } from "./error-icon-hZxQ6DEy.js";
|
|
6
6
|
import { s as r } from "./field-rac.module-DfEb7pBp.js";
|
|
7
|
-
import { R as i, $ as E, W as p, X as R, G as O, u as _, Y as I } from "./form-
|
|
7
|
+
import { R as i, $ as E, W as p, X as R, G as O, u as _, Y as I } from "./form-D3iU18lh.js";
|
|
8
8
|
import { o as L } from "./options-rac.module-_THNq6Qq.js";
|
|
9
|
-
import { u } from "./use-element-state-class-name-
|
|
10
|
-
import { u as N } from "./use-text-input-class-name-
|
|
9
|
+
import { u } from "./use-element-state-class-name-B1r_nXW1.js";
|
|
10
|
+
import { u as N } from "./use-text-input-class-name-BXuk3TK7.js";
|
|
11
11
|
const D = ({ content: o, locale: l }) => /* @__PURE__ */ e.createElement(m, {
|
|
12
12
|
content: o,
|
|
13
13
|
locale: l
|