@wix/form-elements 1.107.0 → 1.109.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component/{appointment-rac-D2F4vgf1.js → appointment-rac-C9-XwsPI.js} +295 -296
- package/dist/component/{bookings-address-rac-_5S8J8_i.js → bookings-address-rac-jrrCPWjw.js} +1 -1
- package/dist/component/{bookings-email-rac-6vmDR9nS.js → bookings-email-rac-J9-RMEbf.js} +1 -1
- package/dist/component/{bookings-first-name-rac-DtTJ4T2K.js → bookings-first-name-rac-CH7-6JmA.js} +1 -1
- package/dist/component/{bookings-header-rac-B3dsEwzR.js → bookings-header-rac-C2JV-ciN.js} +1 -1
- package/dist/component/{bookings-last-name-rac-B3idkbi8.js → bookings-last-name-rac-0a9CwiaV.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-CrRBcQwT.js → bookings-login-bar-rac-4Mb7MQYe.js} +21 -22
- package/dist/component/{bookings-phone-rac-BE0yWNnj.js → bookings-phone-rac-vYx5r5jn.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-CYo1l0-6.js → bookings-rich-text-rac-CWg1FgUp.js} +1 -1
- package/dist/component/{checkbox-field-rac-boTtXVEt.js → checkbox-field-rac-Dwx1leKA.js} +27 -28
- package/dist/component/{checkbox-group-field-headless-DnkUvDm8.js → checkbox-group-field-headless-AFWgXzx_.js} +41 -41
- package/dist/component/{checkbox-group-field-rac-DrDTgHMg.js → checkbox-group-field-rac-CO8kmWJp.js} +6 -6
- package/dist/component/{checkbox-group-rac-v3ozUBpo.js → checkbox-group-rac-_79HsFF4.js} +1 -1
- package/dist/component/{checkbox-rac-YSLE-RnG.js → checkbox-rac-B_tbMfjo.js} +1 -1
- package/dist/component/{contacts-address-rac-C653yaHZ.js → contacts-address-rac-SJ5Tvzd0.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-BeAQ6shx.js → contacts-birthdate-rac-BU1L3sbW.js} +1 -1
- package/dist/component/{contacts-company-rac-BglKOoTG.js → contacts-company-rac-Y4B8KhDa.js} +1 -1
- package/dist/component/{contacts-email-rac-D6m7ynfc.js → contacts-email-rac-CQW84o7C.js} +1 -1
- package/dist/component/{contacts-first-name-rac-Dgxn0tUJ.js → contacts-first-name-rac-Dtai-wtH.js} +1 -1
- package/dist/component/{contacts-last-name-rac-1UyIuRKH.js → contacts-last-name-rac--ixuu3ri.js} +1 -1
- package/dist/component/{contacts-phone-rac-BQ77BlW4.js → contacts-phone-rac-HOHfSvT-.js} +1 -1
- package/dist/component/{contacts-position-rac-BUDUv7lv.js → contacts-position-rac-BPMkh6yf.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-DdtA0qKW.js → contacts-subscribe-rac-D0_RMwJb.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-WUaKcNl0.js → contacts-tax-id-rac-CZJmMiVf.js} +1 -1
- package/dist/component/{date-availability-XjBFq8jt.js → date-availability-C4dDHvuc.js} +1 -1
- package/dist/component/{date-input-field-rac-aY2zuuKs.js → date-input-field-rac-8oERZcqh.js} +79 -80
- package/dist/component/{date-input-rac-DRiP2_97.js → date-input-rac-CYRojmW6.js} +1 -1
- package/dist/component/{date-picker-field-rac-Bzl-d3Uj.js → date-picker-field-rac-CIspU7No.js} +87 -88
- package/dist/component/{date-picker-rac-DHHUh8vn.js → date-picker-rac-D0Y0zf2J.js} +1 -1
- package/dist/component/{date-time-input-field-rac-DP_StuLr.js → date-time-input-field-rac-0daWK65I.js} +73 -74
- package/dist/component/{date-time-input-rac-B11KIxsf.js → date-time-input-rac-BemKPk1j.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac-BHZBqyWv.js → dext-checkbox-group-rac-BpFNn56W.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BIlAqEvV.js → dext-checkbox-rac-DOISgubJ.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CHBXNrZi.js → dext-date-picker-rac-CNGhFg_g.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-BYtliKry.js → dext-date-time-input-rac-BuUIvJRr.js} +1 -1
- package/dist/component/{dext-dropdown-rac-C2VPSFV5.js → dext-dropdown-rac-DtND-Dbo.js} +1 -1
- package/dist/component/{dext-email-rac-Fnb0Ggcs.js → dext-email-rac-CmjLFOi8.js} +1 -1
- package/dist/component/{dext-number-input-rac-DopfSyFi.js → dext-number-input-rac-DHTNg1dh.js} +1 -1
- package/dist/component/{dext-phone-rac-Rn4i_2rc.js → dext-phone-rac-BrrU5qH_.js} +1 -1
- package/dist/component/{dext-radio-group-rac-bNaskJpK.js → dext-radio-group-rac-CD3MGfAM.js} +4 -4
- package/dist/component/{dext-rating-input-rac-DL6ZZd7d.js → dext-rating-input-rac-BETGJZmt.js} +1 -1
- package/dist/component/{dext-tags-rac-TsUPoImO.js → dext-tags-rac-Coo9jN-T.js} +4 -4
- package/dist/component/{dext-text-area-rac-BIuY7LTd.js → dext-text-area-rac-CNWjqhUT.js} +1 -1
- package/dist/component/{dext-text-input-rac-CSYPW0Qi.js → dext-text-input-rac-CCWyDexv.js} +1 -1
- package/dist/component/{dext-url-input-rac-_g0lqGfW.js → dext-url-input-rac-Dtakkgmk.js} +1 -1
- package/dist/component/{donation-rac-BYKFtsyR.js → donation-rac-BboGm_k_.js} +101 -102
- package/dist/component/{dropdown-field-headless-CBaqlNZi.js → dropdown-field-headless-BTMJGUwY.js} +16 -16
- package/dist/component/{dropdown-field-rac-CCAGSMm3.js → dropdown-field-rac-CDRV8ckB.js} +5 -5
- package/dist/component/{dropdown-rac-C_EqUsZ1.js → dropdown-rac-kEuU2pXW.js} +1 -1
- package/dist/component/{ecom-address-rac-Bw9eH0iF.js → ecom-address-rac-BgKL9ElH.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-B5PVOO2a.js → ecom-subscription-checkbox-rac-CDhJsNPD.js} +6 -6
- package/dist/component/{email-input-field-rac-B2kqQ6yo.js → email-input-field-rac-DdOd86NX.js} +54 -55
- package/dist/component/{events-repeater-rac--4OnUxWE.js → events-repeater-rac-_VJ30dpB.js} +62 -63
- package/dist/component/{events-rsvp-rac-CczCoo3T.js → events-rsvp-rac-DA-261bq.js} +5 -5
- package/dist/component/{field-error-headless-D3-1L5sf.js → field-error-headless-CovyN0GI.js} +8 -8
- package/dist/component/{field-label-headless-Du4ckIVy.js → field-label-headless-DVvX2QaH.js} +11 -11
- package/dist/component/file-upload-rac-bhEPUJPs.js +561 -0
- package/dist/component/fixed-payment-rac-DmI6MeKc.js +61 -0
- package/dist/component/{form-DQauhsho.js → form-BTDgyr54.js} +3430 -3244
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +3 -3
- package/dist/component/header-field-rac-C0rUjmo0.js +24 -0
- package/dist/component/{header-rac-CR9T3Pnu.js → header-rac-DRMO22PV.js} +1 -1
- package/dist/component/{image-choice-rac-DJ_8v467.js → image-choice-rac-CQDQ7AlD.js} +32 -33
- package/dist/component/{index-CcUTIUWM.js → index-B9QlosT1.js} +12 -12
- package/dist/component/{index-BB7d_9Dv.js → index-CNWT9t6j.js} +66 -66
- package/dist/component/{isObjectLike-xvPa_08X.js → isObjectLike-c0td2WCR.js} +1 -1
- package/dist/component/{multiline-address-field-rac-CyaFOloE.js → multiline-address-field-rac-D8bVxRsD.js} +124 -125
- package/dist/component/{multiline-address-rac-CaHGUN_f.js → multiline-address-rac-g-6RB7o8.js} +1 -1
- package/dist/component/number-input-field-rac-BaOwQ5Ya.js +92 -0
- package/dist/component/{number-input-rac-DMKX6nhk.js → number-input-rac-BXv8-Pnj.js} +1 -1
- package/dist/component/{password-rac-0RUXPAn6.js → password-rac-BB9XeSSZ.js} +36 -37
- package/dist/component/{payment-input-rac-CHSZ3-Lt.js → payment-input-rac-DwnSV9rM.js} +41 -42
- package/dist/component/{phone-input-field-rac-JmIFcP1e.js → phone-input-field-rac-CC3C4ToW.js} +56 -57
- package/dist/component/{phone-rac-BLRnAPXP.js → phone-rac-DpNhSaE0.js} +1 -1
- package/dist/component/{product-list-rac-BkF5tDwt.js → product-list-rac-BAESk3B6.js} +74 -75
- package/dist/component/{quiz-radio-group-rac-32cCMTUS.js → quiz-radio-group-rac-PS6AZr63.js} +1 -1
- package/dist/component/{radio-button-module-classes-IOulhuSH.js → radio-button-module-classes-CXcn5unY.js} +30 -30
- package/dist/component/{radio-group-field-rac-CJwku6e0.js → radio-group-field-rac-pt8xbDfS.js} +6 -6
- package/dist/component/{radio-group-rac-BiW-9Abj.js → radio-group-rac-DkzkM6N_.js} +1 -1
- package/dist/component/{rating-input-field-rac-B9cwaROK.js → rating-input-field-rac-DDHBkR4x.js} +43 -44
- package/dist/component/{rating-input-rac-BpwlNvzQ.js → rating-input-rac-CcsDmLus.js} +1 -1
- package/dist/component/{rich-content-rac.module-B1uyPmtK.js → rich-content-rac.module-B2vsO6fj.js} +4 -4
- package/dist/component/rich-text-field-rac-CvKht2eC.js +21 -0
- package/dist/component/{rich-text-rac-VfeZxS27.js → rich-text-rac-CRpSffQB.js} +1 -1
- package/dist/component/{service-dropdown-rac-BCfs8IhW.js → service-dropdown-rac-BOpdXNjG.js} +36 -37
- package/dist/component/{services-multi-choice-rac-CCqdF_7P.js → services-multi-choice-rac-t0wdSt_T.js} +20 -21
- package/dist/component/{signature-rac-DOyMo3u0.js → signature-rac-2LsIYYIX.js} +141 -142
- package/dist/component/{submit-button-rac-C2uA5DeE.js → submit-button-rac-BbE8dS35.js} +26 -27
- package/dist/component/{tags-field-rac-C_uIw2by.js → tags-field-rac-BnsBxReU.js} +44 -45
- package/dist/component/{tags-rac-1pQ-fpe_.js → tags-rac-BFH4RINA.js} +1 -1
- package/dist/component/{text-area-field-rac-DqlOkm7e.js → text-area-field-rac-Ag7_gniM.js} +28 -29
- package/dist/component/{text-area-rac-DPdkrFcH.js → text-area-rac-ByUX0p2O.js} +1 -1
- package/dist/component/{text-input-field-rac-CmXm6r1w.js → text-input-field-rac-D3MZ8teu.js} +3 -3
- package/dist/component/{text-input-headless-DD__2DFf.js → text-input-headless-CwONErsY.js} +12 -12
- package/dist/component/{text-input-rac-DRHyQEH7.js → text-input-rac-DLXdAhkK.js} +1 -1
- package/dist/component/{time-input-rac-BJPIymQY.js → time-input-rac-Bs55lTON.js} +33 -34
- package/dist/component/url-input-field-rac-FG-bCh-E.js +74 -0
- package/dist/component/{url-input-rac-C0ChQUzq.js → url-input-rac-BOKuCMTe.js} +1 -1
- package/dist/component/use-dropdown-option-class-name-DjV7FW5y.js +21 -0
- package/dist/component/{use-element-state-class-name-BatTc2bw.js → use-element-state-class-name-DB1AzkvF.js} +1 -1
- package/dist/component/{use-is-forced-open-dropdown-B0jiPTmS.js → use-is-forced-open-dropdown-ifUIpuwL.js} +7 -7
- package/dist/component/{use-service-options-base-oeE7xszw.js → use-service-options-base-B11cq0HH.js} +7 -7
- package/dist/component/use-text-input-class-name-va1PzWFg.js +23 -0
- package/dist/form.d.ts +21 -1
- package/package.json +2 -2
- package/dist/component/file-upload-rac-DbdkUbWM.js +0 -484
- package/dist/component/fixed-payment-rac-f9-01iDN.js +0 -62
- package/dist/component/form-element-classes-bLFmhsKw.js +0 -137
- package/dist/component/header-field-rac-DamDk5BR.js +0 -25
- package/dist/component/number-input-field-rac-BuYUzDWV.js +0 -93
- package/dist/component/rich-text-field-rac-C_qE7Ykg.js +0 -22
- package/dist/component/url-input-field-rac-CFDYkZ6I.js +0 -75
- package/dist/component/use-dropdown-option-class-name-3L5ZmNLK.js +0 -21
- package/dist/component/use-text-input-class-name-LQ5S-NLh.js +0 -24
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { RicosViewer as P } from "@wix/ricos/viewer";
|
|
2
|
+
import i from "classnames";
|
|
3
|
+
import r, { useState as U, useCallback as j, useEffect as Q, useRef as $ } from "react";
|
|
4
|
+
import { NumberField as z, Input as G } from "react-aria-components";
|
|
5
|
+
import { b9 as _, b6 as S, bj as H, bb as J, I as K, U as W, v as X, p as Y } from "./form-BTDgyr54.js";
|
|
6
|
+
import { f as c } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as Z, E as w } from "./field-error-headless-CovyN0GI.js";
|
|
8
|
+
import { L as ee } from "./field-label-headless-DVvX2QaH.js";
|
|
9
|
+
import { g as re, c as te } from "./numeric-input-utils-CuBMi4-a.js";
|
|
10
|
+
import { u as ne } from "./use-invoke-callback-UH73A_J3.js";
|
|
11
|
+
import { E as ae } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
+
import { s as p } from "./field-rac.module-B4l_0KRU.js";
|
|
13
|
+
import { u as se } from "./use-text-input-class-name-va1PzWFg.js";
|
|
14
|
+
const e = ({ children: t }) => {
|
|
15
|
+
var F, L, R;
|
|
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: y } = S(), D = ((F = n == null ? void 0 : n.number) == null ? void 0 : F.multipleOf) || 1, A = (L = n == null ? void 0 : n.number) == null ? void 0 : L.maximum, g = (R = n == null ? void 0 : n.number) == null ? void 0 : R.minimum, x = O(s), [T, I] = U(x), V = ne(E), h = c(t, e.Label), q = c(t, e.Input), M = c(t, e.Description), k = c(t, e.Error), B = j((N) => {
|
|
17
|
+
if (N === void 0 || Number.isNaN(N)) {
|
|
18
|
+
l(""), I(NaN);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const v = re(D), C = Number(N.toFixed(v));
|
|
22
|
+
l(C), I(C);
|
|
23
|
+
}, [
|
|
24
|
+
D,
|
|
25
|
+
l
|
|
26
|
+
]);
|
|
27
|
+
return Q(() => {
|
|
28
|
+
I(O(s));
|
|
29
|
+
}, [
|
|
30
|
+
s
|
|
31
|
+
]), /* @__PURE__ */ r.createElement(m, {
|
|
32
|
+
fieldId: a,
|
|
33
|
+
renderLabel: () => h,
|
|
34
|
+
renderInput: () => /* @__PURE__ */ r.createElement(z, {
|
|
35
|
+
"aria-labelledby": y,
|
|
36
|
+
value: T,
|
|
37
|
+
onChange: B,
|
|
38
|
+
isDisabled: d,
|
|
39
|
+
isRequired: b,
|
|
40
|
+
isReadOnly: o,
|
|
41
|
+
isInvalid: u,
|
|
42
|
+
onBlur: V,
|
|
43
|
+
onFocus: f,
|
|
44
|
+
minValue: g ?? void 0,
|
|
45
|
+
maxValue: A ?? void 0
|
|
46
|
+
}, q),
|
|
47
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, k, M)
|
|
48
|
+
});
|
|
49
|
+
}, le = ({ className: t }) => {
|
|
50
|
+
var u;
|
|
51
|
+
const { t: a } = H(), { inputId: s, ariaDescribedBy: l } = S(), { id: d, placeholder: b, validation: o, label: E, required: f } = _();
|
|
52
|
+
(u = o == null ? void 0 : o.number) != null && u.multipleOf;
|
|
53
|
+
const m = $(null);
|
|
54
|
+
return J(() => {
|
|
55
|
+
var n;
|
|
56
|
+
(n = m.current) == null || n.focus();
|
|
57
|
+
}, d), /* @__PURE__ */ r.createElement(G, {
|
|
58
|
+
ref: m,
|
|
59
|
+
id: s,
|
|
60
|
+
"aria-describedby": l,
|
|
61
|
+
"aria-label": E,
|
|
62
|
+
"aria-roledescription": a("field.number.aria-role-description"),
|
|
63
|
+
className: t,
|
|
64
|
+
inputMode: "decimal",
|
|
65
|
+
placeholder: b,
|
|
66
|
+
required: f
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
e.Label = ee;
|
|
70
|
+
e.Input = le;
|
|
71
|
+
e.Description = Z;
|
|
72
|
+
e.Error = w;
|
|
73
|
+
const O = (t) => te(t) ?? NaN, oe = ({ content: t, locale: a }) => /* @__PURE__ */ r.createElement(P, {
|
|
74
|
+
content: t,
|
|
75
|
+
locale: a
|
|
76
|
+
}), Le = () => {
|
|
77
|
+
const t = se();
|
|
78
|
+
return /* @__PURE__ */ r.createElement(e, null, /* @__PURE__ */ r.createElement(e.Label, {
|
|
79
|
+
className: i(K, p.label)
|
|
80
|
+
}, /* @__PURE__ */ r.createElement(e.Label.Required, {
|
|
81
|
+
className: i(W, p.requiredMark)
|
|
82
|
+
})), /* @__PURE__ */ r.createElement(e.Input, {
|
|
83
|
+
className: t
|
|
84
|
+
}), /* @__PURE__ */ r.createElement(e.Error, {
|
|
85
|
+
className: i(X, p.error)
|
|
86
|
+
}, /* @__PURE__ */ r.createElement(ae, null), /* @__PURE__ */ r.createElement(e.Error.Text, null)), /* @__PURE__ */ r.createElement(e.Description, {
|
|
87
|
+
className: i(Y, p.description)
|
|
88
|
+
}, oe));
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
Le as N
|
|
92
|
+
};
|
|
@@ -1,22 +1,21 @@
|
|
|
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
|
|
6
|
-
import { f as u, a as
|
|
7
|
-
import { D as
|
|
8
|
-
import { L as
|
|
9
|
-
import { E as
|
|
10
|
-
import { H as
|
|
4
|
+
import { b9 as E, b6 as I, bb as O, bj as A, I as B, U as v, v as V, p as P } from "./form-BTDgyr54.js";
|
|
5
|
+
import { TextField as M, Group as k, Input as q, Button as U } from "react-aria-components";
|
|
6
|
+
import { f as u, a as b } from "./find-child-C60k4CxG.js";
|
|
7
|
+
import { D as j, E as H } from "./field-error-headless-CovyN0GI.js";
|
|
8
|
+
import { L as W } from "./field-label-headless-DVvX2QaH.js";
|
|
9
|
+
import { E as Z } from "./error-icon-hZxQ6DEy.js";
|
|
10
|
+
import { H as G } from "./custom-focus-class-_483Pkwp.js";
|
|
11
11
|
import { s as p } from "./field-rac.module-B4l_0KRU.js";
|
|
12
|
-
import {
|
|
13
|
-
import { u as J } from "./use-text-input-class-name-LQ5S-NLh.js";
|
|
12
|
+
import { u as Q } from "./use-text-input-class-name-va1PzWFg.js";
|
|
14
13
|
const t = ({ children: o, className: r }) => {
|
|
15
|
-
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),
|
|
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);
|
|
16
15
|
return /* @__PURE__ */ e.createElement(_, {
|
|
17
16
|
fieldId: l,
|
|
18
17
|
renderLabel: () => F,
|
|
19
|
-
renderInput: () => /* @__PURE__ */ e.createElement(
|
|
18
|
+
renderInput: () => /* @__PURE__ */ e.createElement(M, {
|
|
20
19
|
"aria-labelledby": y,
|
|
21
20
|
value: s ?? "",
|
|
22
21
|
onChange: c,
|
|
@@ -27,30 +26,30 @@ const t = ({ children: o, className: r }) => {
|
|
|
27
26
|
onBlur: f,
|
|
28
27
|
onFocus: C,
|
|
29
28
|
className: r
|
|
30
|
-
},
|
|
29
|
+
}, b(L, {
|
|
31
30
|
isVisible: R,
|
|
32
|
-
onToggleVisibility: () => D((
|
|
31
|
+
onToggleVisibility: () => D((h) => !h)
|
|
33
32
|
})),
|
|
34
|
-
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, T,
|
|
33
|
+
renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, T, w)
|
|
35
34
|
});
|
|
36
|
-
},
|
|
35
|
+
}, $ = ({ children: o, className: r, ...l }) => {
|
|
37
36
|
const { isVisible: s, onToggleVisibility: c } = l, { disabled: n, hasError: m } = E(), a = u(o, t.Input), i = u(o, t.Toggle);
|
|
38
|
-
return /* @__PURE__ */ e.createElement(
|
|
37
|
+
return /* @__PURE__ */ e.createElement(k, {
|
|
39
38
|
className: r,
|
|
40
39
|
isDisabled: n,
|
|
41
40
|
isInvalid: m
|
|
42
|
-
},
|
|
41
|
+
}, b(a, {
|
|
43
42
|
isVisible: s
|
|
44
|
-
}),
|
|
43
|
+
}), b(i, {
|
|
45
44
|
isVisible: s,
|
|
46
45
|
onToggleVisibility: c
|
|
47
46
|
}));
|
|
48
|
-
},
|
|
47
|
+
}, z = ({ className: o, ...r }) => {
|
|
49
48
|
const { isVisible: l } = r, { id: s, placeholder: c } = E(), { inputId: n, ariaDescribedBy: m } = I(), a = S(null);
|
|
50
49
|
return O(() => {
|
|
51
50
|
var i;
|
|
52
51
|
(i = a.current) == null || i.focus();
|
|
53
|
-
}, s), /* @__PURE__ */ e.createElement(
|
|
52
|
+
}, s), /* @__PURE__ */ e.createElement(q, {
|
|
54
53
|
ref: a,
|
|
55
54
|
id: n,
|
|
56
55
|
type: l ? "text" : "password",
|
|
@@ -58,9 +57,9 @@ const t = ({ children: o, className: r }) => {
|
|
|
58
57
|
className: o,
|
|
59
58
|
placeholder: c
|
|
60
59
|
});
|
|
61
|
-
},
|
|
60
|
+
}, J = ({ className: o, showPasswordTooltipText: r, hidePasswordTooltipText: l, children: s, ...c }) => {
|
|
62
61
|
const { isVisible: n, onToggleVisibility: m } = c, { disabled: a } = E(), i = n ? l : r;
|
|
63
|
-
return /* @__PURE__ */ e.createElement(
|
|
62
|
+
return /* @__PURE__ */ e.createElement(U, {
|
|
64
63
|
type: "button",
|
|
65
64
|
isDisabled: a,
|
|
66
65
|
onPress: m,
|
|
@@ -71,12 +70,12 @@ const t = ({ children: o, className: r }) => {
|
|
|
71
70
|
isVisible: n
|
|
72
71
|
}));
|
|
73
72
|
};
|
|
74
|
-
t.Label =
|
|
75
|
-
t.Control =
|
|
76
|
-
t.Input =
|
|
77
|
-
t.Toggle =
|
|
78
|
-
t.Description =
|
|
79
|
-
t.Error =
|
|
73
|
+
t.Label = W;
|
|
74
|
+
t.Control = $;
|
|
75
|
+
t.Input = z;
|
|
76
|
+
t.Toggle = J;
|
|
77
|
+
t.Description = j;
|
|
78
|
+
t.Error = H;
|
|
80
79
|
const K = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
81
80
|
viewBox: "0 0 24 24",
|
|
82
81
|
width: "20",
|
|
@@ -112,30 +111,30 @@ const K = (o) => /* @__PURE__ */ e.createElement("svg", {
|
|
|
112
111
|
y1: "21",
|
|
113
112
|
x2: "21",
|
|
114
113
|
y2: "3"
|
|
115
|
-
})), Y = "_control_1malj_1", ee = "_toggleButton_1malj_15",
|
|
114
|
+
})), Y = "_control_1malj_1", ee = "_toggleButton_1malj_15", g = {
|
|
116
115
|
control: Y,
|
|
117
116
|
toggleButton: ee
|
|
118
117
|
}, te = ({ content: o, locale: r }) => /* @__PURE__ */ e.createElement(x, {
|
|
119
118
|
content: o,
|
|
120
119
|
locale: r
|
|
121
120
|
}), oe = () => {
|
|
122
|
-
const { t: o } = A(), r =
|
|
121
|
+
const { t: o } = A(), r = Q(g.control);
|
|
123
122
|
return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
|
|
124
|
-
className: d(
|
|
123
|
+
className: d(B, p.label)
|
|
125
124
|
}, /* @__PURE__ */ e.createElement(t.Label.Required, {
|
|
126
|
-
className: d(
|
|
125
|
+
className: d(v, p.requiredMark)
|
|
127
126
|
})), /* @__PURE__ */ e.createElement(t.Control, {
|
|
128
127
|
className: r
|
|
129
128
|
}, /* @__PURE__ */ e.createElement(t.Input, {
|
|
130
|
-
className: d(p.innerInput,
|
|
129
|
+
className: d(p.innerInput, G)
|
|
131
130
|
}), /* @__PURE__ */ e.createElement(t.Toggle, {
|
|
132
|
-
className:
|
|
131
|
+
className: g.toggleButton,
|
|
133
132
|
showPasswordTooltipText: o("forms.widget.modals.show-password-tooltip"),
|
|
134
133
|
hidePasswordTooltipText: o("forms.widget.modals.hide-password-tooltip")
|
|
135
134
|
}, ({ isVisible: l }) => l ? /* @__PURE__ */ e.createElement(X, null) : /* @__PURE__ */ e.createElement(K, null))), /* @__PURE__ */ e.createElement(t.Error, {
|
|
136
|
-
className: d(
|
|
137
|
-
}, /* @__PURE__ */ e.createElement(
|
|
138
|
-
className: d(
|
|
135
|
+
className: d(V, p.error)
|
|
136
|
+
}, /* @__PURE__ */ e.createElement(Z, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
|
|
137
|
+
className: d(P, p.description)
|
|
139
138
|
}, te));
|
|
140
139
|
}, be = () => /* @__PURE__ */ e.createElement(oe, null);
|
|
141
140
|
export {
|
|
@@ -1,18 +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 z, Group as J, Input as K } from "react-aria-components";
|
|
5
|
+
import { b9 as R, b6 as D, b1 as T, bj as W, bb as X, I as Y, U as Z, v as ee, p as re } from "./form-BTDgyr54.js";
|
|
6
6
|
import { f as i } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as
|
|
8
|
-
import { L as
|
|
9
|
-
import { f as N, g as
|
|
10
|
-
import { u as
|
|
11
|
-
import { E as
|
|
12
|
-
import { H as
|
|
7
|
+
import { D as te, E as ne } from "./field-error-headless-CovyN0GI.js";
|
|
8
|
+
import { L as ae } from "./field-label-headless-DVvX2QaH.js";
|
|
9
|
+
import { f as N, g as se } from "./payment-field-utils-DobiK5Xh.js";
|
|
10
|
+
import { u as oe } from "./use-synced-display-value-DcAxdn3M.js";
|
|
11
|
+
import { E as le } from "./error-icon-hZxQ6DEy.js";
|
|
12
|
+
import { H as ce } from "./custom-focus-class-_483Pkwp.js";
|
|
13
13
|
import { s as d } from "./field-rac.module-B4l_0KRU.js";
|
|
14
|
-
import {
|
|
15
|
-
import { u as ie } from "./use-text-input-class-name-LQ5S-NLh.js";
|
|
14
|
+
import { u as ie } from "./use-text-input-class-name-va1PzWFg.js";
|
|
16
15
|
function ue(e, t) {
|
|
17
16
|
return {
|
|
18
17
|
productId: e.id,
|
|
@@ -28,20 +27,20 @@ function h(e) {
|
|
|
28
27
|
}
|
|
29
28
|
const n = ({ children: e }) => {
|
|
30
29
|
var O, g, A, V;
|
|
31
|
-
const { id: t, value: a, onChange: s, disabled: u, readOnly: m, required:
|
|
30
|
+
const { id: t, value: a, onChange: s, disabled: u, readOnly: m, required: I, hasError: y, onBlur: o, onFocus: E, FieldLayout: M, validation: C } = R(), { labelId: q, prefixId: G } = D(), { regionalFormat: c } = T(), 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({
|
|
32
31
|
sourceValue: _,
|
|
33
32
|
format: (l) => N(String(l ?? ""), c),
|
|
34
33
|
regionalFormat: c
|
|
35
34
|
}), $ = P(() => {
|
|
36
35
|
const l = N(F, c);
|
|
37
|
-
|
|
36
|
+
b(l || ""), o == null || o();
|
|
38
37
|
}, [
|
|
39
38
|
F,
|
|
40
39
|
c,
|
|
41
40
|
o,
|
|
42
|
-
|
|
43
|
-
]),
|
|
44
|
-
|
|
41
|
+
b
|
|
42
|
+
]), U = P((l) => {
|
|
43
|
+
b(l);
|
|
45
44
|
const L = h(N(l, c)), j = h(_);
|
|
46
45
|
if (L !== j) {
|
|
47
46
|
if (L === void 0) {
|
|
@@ -57,27 +56,27 @@ const n = ({ children: e }) => {
|
|
|
57
56
|
S,
|
|
58
57
|
c,
|
|
59
58
|
_,
|
|
60
|
-
|
|
61
|
-
]), v = i(e, n.Label), B = i(e, n.Input),
|
|
59
|
+
b
|
|
60
|
+
]), v = i(e, n.Label), B = i(e, n.Input), k = i(e, n.Description), H = i(e, n.Error);
|
|
62
61
|
return /* @__PURE__ */ r.createElement(M, {
|
|
63
62
|
fieldId: t,
|
|
64
63
|
renderLabel: () => v,
|
|
65
|
-
renderInput: () => /* @__PURE__ */ r.createElement(
|
|
64
|
+
renderInput: () => /* @__PURE__ */ r.createElement(z, {
|
|
66
65
|
"aria-labelledby": `${q} ${G}`,
|
|
67
66
|
value: a ? F : "",
|
|
68
|
-
onChange:
|
|
67
|
+
onChange: U,
|
|
69
68
|
isDisabled: u,
|
|
70
69
|
isReadOnly: m,
|
|
71
|
-
isRequired:
|
|
72
|
-
isInvalid:
|
|
70
|
+
isRequired: I,
|
|
71
|
+
isInvalid: y,
|
|
73
72
|
onBlur: $,
|
|
74
73
|
onFocus: E
|
|
75
74
|
}, B),
|
|
76
|
-
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, H,
|
|
75
|
+
renderDescription: () => /* @__PURE__ */ r.createElement(r.Fragment, null, H, k)
|
|
77
76
|
});
|
|
78
77
|
}, f = ({ children: e, className: t }) => {
|
|
79
78
|
const { disabled: a, hasError: s } = R(), u = i(e, f.Currency), m = i(e, f.Value);
|
|
80
|
-
return /* @__PURE__ */ r.createElement(
|
|
79
|
+
return /* @__PURE__ */ r.createElement(J, {
|
|
81
80
|
className: t,
|
|
82
81
|
isDisabled: a,
|
|
83
82
|
isInvalid: s
|
|
@@ -87,11 +86,11 @@ const n = ({ children: e }) => {
|
|
|
87
86
|
return t ? /* @__PURE__ */ r.createElement("span", {
|
|
88
87
|
id: s,
|
|
89
88
|
"aria-hidden": !1,
|
|
90
|
-
"aria-label":
|
|
89
|
+
"aria-label": se(a, t),
|
|
91
90
|
className: e
|
|
92
91
|
}, t.sign || t.code) : null;
|
|
93
92
|
}, pe = ({ className: e }) => {
|
|
94
|
-
const { id: t, placeholder: a, label: s } = R(), { inputId: u, labelId: m, prefixId:
|
|
93
|
+
const { id: t, placeholder: a, label: s } = R(), { inputId: u, labelId: m, prefixId: I, ariaDescribedBy: y } = D(), o = Q(null);
|
|
95
94
|
return X(() => {
|
|
96
95
|
var E;
|
|
97
96
|
(E = o.current) == null || E.focus();
|
|
@@ -101,41 +100,41 @@ const n = ({ children: e }) => {
|
|
|
101
100
|
className: e,
|
|
102
101
|
placeholder: a,
|
|
103
102
|
"aria-label": s,
|
|
104
|
-
"aria-labelledby": `${m} ${
|
|
105
|
-
"aria-describedby":
|
|
103
|
+
"aria-labelledby": `${m} ${I}`,
|
|
104
|
+
"aria-describedby": y,
|
|
106
105
|
autoComplete: "off"
|
|
107
106
|
});
|
|
108
107
|
};
|
|
109
108
|
f.Currency = me;
|
|
110
109
|
f.Value = pe;
|
|
111
|
-
n.Label =
|
|
110
|
+
n.Label = ae;
|
|
112
111
|
n.Input = f;
|
|
113
|
-
n.Description =
|
|
114
|
-
n.Error =
|
|
112
|
+
n.Description = te;
|
|
113
|
+
n.Error = ne;
|
|
115
114
|
const de = "_inputGroup_vuy4u_1", fe = "_currency_vuy4u_14", x = {
|
|
116
115
|
inputGroup: de,
|
|
117
116
|
currency: fe
|
|
118
|
-
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(
|
|
117
|
+
}, Ee = ({ content: e, locale: t }) => /* @__PURE__ */ r.createElement(w, {
|
|
119
118
|
content: e,
|
|
120
119
|
locale: t
|
|
121
|
-
}),
|
|
120
|
+
}), be = () => {
|
|
122
121
|
const e = ie(x.inputGroup);
|
|
123
122
|
return /* @__PURE__ */ r.createElement(n, null, /* @__PURE__ */ r.createElement(n.Label, {
|
|
124
|
-
className: p(
|
|
123
|
+
className: p(Y, d.label)
|
|
125
124
|
}, /* @__PURE__ */ r.createElement(n.Label.Required, {
|
|
126
|
-
className: p(
|
|
125
|
+
className: p(Z, d.requiredMark)
|
|
127
126
|
})), /* @__PURE__ */ r.createElement(n.Input, {
|
|
128
127
|
className: e
|
|
129
128
|
}, /* @__PURE__ */ r.createElement(n.Input.Currency, {
|
|
130
129
|
className: x.currency
|
|
131
130
|
}), /* @__PURE__ */ r.createElement(n.Input.Value, {
|
|
132
|
-
className: p(d.innerInput,
|
|
131
|
+
className: p(d.innerInput, ce)
|
|
133
132
|
})), /* @__PURE__ */ r.createElement(n.Error, {
|
|
134
|
-
className: p(
|
|
135
|
-
}, /* @__PURE__ */ r.createElement(
|
|
136
|
-
className: p(
|
|
133
|
+
className: p(ee, d.error)
|
|
134
|
+
}, /* @__PURE__ */ r.createElement(le, null), /* @__PURE__ */ r.createElement(n.Error.Text, null)), /* @__PURE__ */ r.createElement(n.Description, {
|
|
135
|
+
className: p(re, d.description)
|
|
137
136
|
}, Ee));
|
|
138
|
-
},
|
|
137
|
+
}, Pe = () => /* @__PURE__ */ r.createElement(be, null);
|
|
139
138
|
export {
|
|
140
|
-
|
|
139
|
+
Pe as PaymentInputRAC
|
|
141
140
|
};
|