@wix/form-elements 1.101.0 → 1.103.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.
Files changed (114) hide show
  1. package/dist/component/{appointment-rac-Bz666XRl.js → appointment-rac-DW5YPIgy.js} +4 -4
  2. package/dist/component/{bookings-address-rac-BeOnUsml.js → bookings-address-rac-7ODYuuSG.js} +1 -1
  3. package/dist/component/{bookings-email-rac-DG28agAj.js → bookings-email-rac-BCnhC0YX.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-gR3z4-ab.js → bookings-first-name-rac-DvpfHse1.js} +1 -1
  5. package/dist/component/{bookings-header-rac-Z8uH4Ld4.js → bookings-header-rac-Dohy9hCz.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-BQIL81Rd.js → bookings-last-name-rac-CVDRbwd7.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-DLDBFIUw.js → bookings-login-bar-rac-DavjHZGh.js} +1 -1
  8. package/dist/component/{bookings-phone-rac-DZBdi31-.js → bookings-phone-rac-Cj6Dz0vX.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-uJfFKnlR.js → bookings-rich-text-rac-DjmnegM6.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-CESygdpa.js → checkbox-field-rac-DbJQI0lK.js} +4 -4
  11. package/dist/component/checkbox-group-field-headless-BWCsolHw.js +205 -0
  12. package/dist/component/{checkbox-group-field-rac-B4xHxrnm.js → checkbox-group-field-rac-Cmc2pwQi.js} +7 -5
  13. package/dist/component/{checkbox-group-rac-Cj1QP0mi.js → checkbox-group-rac-q3wI6hQH.js} +1 -1
  14. package/dist/component/{checkbox-rac-CwDeLVTg.js → checkbox-rac-BsutELL1.js} +1 -1
  15. package/dist/component/{contacts-address-rac-CR0VgQjc.js → contacts-address-rac-BUCtejza.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-BKP3MEUH.js → contacts-birthdate-rac-1E453ZgP.js} +1 -1
  17. package/dist/component/{contacts-company-rac-2KfK3HUv.js → contacts-company-rac-DrK20x29.js} +1 -1
  18. package/dist/component/{contacts-email-rac-C-StCCdk.js → contacts-email-rac-CMiWMV_P.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-DluPdJrM.js → contacts-first-name-rac-DPwXc8-1.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-BPFDtu0m.js → contacts-last-name-rac-CeuRsbGC.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-DCjYThvu.js → contacts-phone-rac-Cwjc5too.js} +1 -1
  22. package/dist/component/{contacts-position-rac-70Y5K0-2.js → contacts-position-rac-C8w3NNCn.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-CkpV9O6Z.js → contacts-subscribe-rac-CFejp0de.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-Cc7RlBvQ.js → contacts-tax-id-rac-xNks1IAv.js} +1 -1
  25. package/dist/component/{date-availability-BNMZIIVi.js → date-availability-xTIFwK6x.js} +1 -1
  26. package/dist/component/{date-input-field-rac-B7U8YKrm.js → date-input-field-rac-DcoJJUZc.js} +6 -6
  27. package/dist/component/{date-input-rac-CYooWhMb.js → date-input-rac-CnZAuOkP.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-FmHlyJdB.js → date-picker-field-rac-D__137lA.js} +5 -5
  29. package/dist/component/{date-picker-rac-DLwn7AKn.js → date-picker-rac-DQ42fhVP.js} +1 -1
  30. package/dist/component/{date-time-input-field-rac-eGxHBFDW.js → date-time-input-field-rac-BHBAMq3g.js} +6 -6
  31. package/dist/component/{date-time-input-rac-2E-AZjJU.js → date-time-input-rac-DbIAF6nq.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-1yuZvgHa.js → dext-checkbox-group-rac-Ds2w4V3q.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-DM0XXP68.js → dext-checkbox-rac-DSidRTEl.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-CMzKfaWk.js → dext-date-picker-rac-Derm4Q3d.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-CFq1kbpd.js → dext-date-time-input-rac-BcyPuijC.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-BdhFCJOG.js → dext-dropdown-rac-kDuk--KF.js} +1 -1
  37. package/dist/component/{dext-email-rac-B7pSx32V.js → dext-email-rac-xys-YMg2.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-BySDR8wu.js → dext-number-input-rac-BZpAijhk.js} +1 -1
  39. package/dist/component/{dext-phone-rac-BG5s3WRz.js → dext-phone-rac-CMPboOsF.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-rLbHat4_.js → dext-radio-group-rac-5h9c9bW2.js} +2 -2
  41. package/dist/component/{dext-rating-input-rac-Q6sOA59G.js → dext-rating-input-rac-BobDzEXB.js} +1 -1
  42. package/dist/component/{dext-tags-rac-ChmYbfhb.js → dext-tags-rac-DoJWzkrn.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-D3sAPT-i.js → dext-text-area-rac-BIRCFM2F.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-Pt4j-NHE.js → dext-text-input-rac-Bzx5hcyp.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-jVL0Hmzh.js → dext-url-input-rac-C9hlh97b.js} +1 -1
  46. package/dist/component/donation-rac-CpEduCy1.js +318 -0
  47. package/dist/component/{dropdown-field-headless-CppwKBfX.js → dropdown-field-headless-Dcbu807N.js} +4 -4
  48. package/dist/component/{dropdown-field-rac-CgBmIDaT.js → dropdown-field-rac-mJwCTpQA.js} +2 -2
  49. package/dist/component/{dropdown-rac-BMweA5uI.js → dropdown-rac-N5I5XU3B.js} +1 -1
  50. package/dist/component/{ecom-address-rac-O0_CQxUW.js → ecom-address-rac-_0TO5pFZ.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-Cmu1KuGg.js → ecom-subscription-checkbox-rac-DNdz6UCu.js} +2 -2
  52. package/dist/component/{email-input-field-rac-D_5MccPr.js → email-input-field-rac-VDJC1JLs.js} +3 -3
  53. package/dist/component/{events-repeater-rac-8Y4pq7V2.js → events-repeater-rac-CzBVzG00.js} +4 -4
  54. package/dist/component/{events-rsvp-rac-BYydUMNS.js → events-rsvp-rac--ADJlIQz.js} +24 -20
  55. package/dist/component/{field-error-headless-gUwzDWOe.js → field-error-headless-_ADCIvnx.js} +1 -1
  56. package/dist/component/{field-label-headless-Co6yOqfY.js → field-label-headless-DiDxuhCI.js} +1 -1
  57. package/dist/component/{file-upload-rac-DCPcAuy6.js → file-upload-rac-CiYo9UQA.js} +3 -3
  58. package/dist/component/{fixed-payment-rac-BYxHFMz7.js → fixed-payment-rac-DgNVdELB.js} +3 -3
  59. package/dist/component/{form-xpXT6sSe.js → form-DPmF8iaT.js} +69 -69
  60. package/dist/component/form.css +1 -1
  61. package/dist/component/form.js +1 -1
  62. package/dist/component/{header-field-rac-D6Ooi7Mr.js → header-field-rac-BuJTUp5S.js} +2 -2
  63. package/dist/component/{header-rac-DnGs8ZQz.js → header-rac-BphcUkmo.js} +1 -1
  64. package/dist/component/image-choice-rac-CZSMzLY2.js +162 -0
  65. package/dist/component/{index-DDN9WMAP.js → index-B0DLHSXg.js} +4 -4
  66. package/dist/component/{index-BycimQIL.js → index-BEIxTlpO.js} +2 -2
  67. package/dist/component/{isObjectLike-CO5vOu2v.js → isObjectLike-DuXP52EV.js} +1 -1
  68. package/dist/component/{multiline-address-field-rac-Ceqa3t-S.js → multiline-address-field-rac-CNJyTqJt.js} +7 -7
  69. package/dist/component/{multiline-address-rac-DUEzLbEj.js → multiline-address-rac-DG7xjt6A.js} +1 -1
  70. package/dist/component/{number-input-field-rac-bpQgiO2z.js → number-input-field-rac-Bj2AK7Oj.js} +4 -4
  71. package/dist/component/{number-input-rac-igcMPISW.js → number-input-rac-JPgr87Xh.js} +1 -1
  72. package/dist/component/options-rac.module-CTDdATiz.js +8 -0
  73. package/dist/component/{password-rac-BT1z4LAW.js → password-rac-J0ySzA6j.js} +4 -4
  74. package/dist/component/{payment-input-rac-COxjqEMn.js → payment-input-rac-B1VmJQeD.js} +4 -4
  75. package/dist/component/{phone-input-field-rac-CDeMaVl7.js → phone-input-field-rac-SWP8Xkh-.js} +6 -6
  76. package/dist/component/{phone-rac-BCL0hoBl.js → phone-rac-BU33sXKk.js} +1 -1
  77. package/dist/component/{product-list-rac-BI9J6Cv5.js → product-list-rac-dk3gFLyb.js} +5 -5
  78. package/dist/component/{quiz-radio-group-rac-oevpys_A.js → quiz-radio-group-rac-BFlVZj9U.js} +1 -1
  79. package/dist/component/radio-button-module-classes-DgiY7sw3.js +133 -0
  80. package/dist/component/{radio-group-field-rac-2y5gEEt7.js → radio-group-field-rac-qD-GQu2A.js} +23 -21
  81. package/dist/component/{radio-group-rac-DF769GN5.js → radio-group-rac-CIY9Gj99.js} +1 -1
  82. package/dist/component/{rating-input-field-rac-DzuWl96q.js → rating-input-field-rac-BVWuvhkf.js} +4 -4
  83. package/dist/component/{rating-input-rac-DOwiqhty.js → rating-input-rac-C3HFmqHX.js} +1 -1
  84. package/dist/component/{rich-content-rac.module-B0CKQkBJ.js → rich-content-rac.module-QBgwAjEA.js} +1 -1
  85. package/dist/component/{rich-text-field-rac-CHfUVOQg.js → rich-text-field-rac-BohVUJm1.js} +2 -2
  86. package/dist/component/{rich-text-rac-CyfDUzdG.js → rich-text-rac-BST0y6Gq.js} +1 -1
  87. package/dist/component/{service-dropdown-rac-DSOEw_Pz.js → service-dropdown-rac-DZSY9T2v.js} +4 -4
  88. package/dist/component/services-multi-choice-rac-hD8TI7n7.js +89 -0
  89. package/dist/component/{signature-rac-CQgKDpSA.js → signature-rac-D9G6D7Pa.js} +3 -3
  90. package/dist/component/{submit-button-rac-CkcToyXk.js → submit-button-rac-D4vOTaQ9.js} +1 -1
  91. package/dist/component/tags-field-rac-CoNoLUAV.js +220 -0
  92. package/dist/component/{tags-rac-De-oJJeH.js → tags-rac-BGT8KWvN.js} +1 -1
  93. package/dist/component/{text-area-field-rac-Abh_6vvi.js → text-area-field-rac-x-LWaPSL.js} +4 -4
  94. package/dist/component/{text-area-rac-CPtigptv.js → text-area-rac-B0KN3TR1.js} +1 -1
  95. package/dist/component/{text-input-field-rac-mmA4MWmn.js → text-input-field-rac-DH5j0Tvv.js} +2 -2
  96. package/dist/component/{text-input-headless-_LKXMy0W.js → text-input-headless-Slo-xa7H.js} +3 -3
  97. package/dist/component/{text-input-rac-Dwc5DpDr.js → text-input-rac-_VrGU08X.js} +1 -1
  98. package/dist/component/{time-input-rac-DXaTD0kX.js → time-input-rac-DS5uFTDp.js} +4 -4
  99. package/dist/component/{url-input-field-rac-DmFkKHcU.js → url-input-field-rac-yCewMKD-.js} +4 -4
  100. package/dist/component/{url-input-rac-B0_9AJIF.js → url-input-rac-D7cuZG08.js} +1 -1
  101. package/dist/component/{use-dropdown-option-class-name-DXfUR3FK.js → use-dropdown-option-class-name-DbjgH9K1.js} +1 -1
  102. package/dist/component/{use-element-state-class-name-DnTajLN7.js → use-element-state-class-name-C2_dMWlH.js} +1 -1
  103. package/dist/component/{use-is-forced-open-dropdown-aQ729ktc.js → use-is-forced-open-dropdown-VcOCKx-3.js} +1 -1
  104. package/dist/component/{use-service-options-base-DY2mUh8f.js → use-service-options-base-Cu9nE-aZ.js} +1 -1
  105. package/dist/component/{use-text-input-class-name-ZQJA7JHr.js → use-text-input-class-name-DMokiXwB.js} +2 -2
  106. package/package.json +2 -2
  107. package/dist/component/checkbox-group-field-headless-Bz_FnjxO.js +0 -205
  108. package/dist/component/donation-rac-D_ljVWm9.js +0 -319
  109. package/dist/component/image-choice-rac-B9t4gM5n.js +0 -158
  110. package/dist/component/options-layout-constants-DEfIEJWD.js +0 -6
  111. package/dist/component/options-rac.module-KM-VT_KY.js +0 -7
  112. package/dist/component/radio-button-module-classes-CJ00fK3C.js +0 -132
  113. package/dist/component/services-multi-choice-rac-Bw3adRvE.js +0 -85
  114. package/dist/component/tags-field-rac-BEuOFlHS.js +0 -218
@@ -1,205 +0,0 @@
1
- import i, { useMemo as F, useCallback as _, useRef as P, useState as w, useEffect as U } from "react";
2
- import { CheckboxGroup as W, CheckboxField as A, CheckboxButton as j, TextField as z, Input as J } from "react-aria-components";
3
- import { debounce as K } from "ts-debounce";
4
- import { ak as N, ah as Q, au as X, ac as Y, am as Z } from "./form-xpXT6sSe.js";
5
- import { f as L, a as k } from "./find-child-C60k4CxG.js";
6
- import { D as ee, E as te } from "./field-error-headless-gUwzDWOe.js";
7
- import { L as ae } from "./field-label-headless-Co6yOqfY.js";
8
- import { F as ne } from "./fieldset-headless-CD3fds9J.js";
9
- import { N as se } from "./options-layout-constants-DEfIEJWD.js";
10
- import { S as le } from "./selection-indicator-XQ8MYHUQ.js";
11
- const R = "Other", oe = (e, t) => e.some((o) => !t.includes(o)), B = (e, t) => e.length > 0 && oe(e, t), re = (e, t) => {
12
- const o = t == null ? void 0 : t("add-other.default-other-option-label");
13
- return e || o || R;
14
- }, T = (e, t) => {
15
- const n = t ? t.length + 2 : 0;
16
- return (e.find((r) => r.startsWith(`${t}: `)) || "").slice(n);
17
- }, D = (e) => e.map((t) => t.value ?? t.label), C = ({ children: e }) => {
18
- const t = N(), { id: o, value: n, onChange: a, disabled: r, required: u, onBlur: I, onFocus: b, hasError: p, FieldLayout: c } = t, { inputId: f, labelId: d, ariaDescribedBy: l } = Q(), O = L(e, C.Label), h = L(e, C.Options), g = L(e, C.Description), v = L(e, C.Error), s = F(() => n || [], [
19
- n
20
- ]), E = _((V) => {
21
- a == null || a(V);
22
- }, [
23
- a
24
- ]);
25
- return /* @__PURE__ */ i.createElement(c, {
26
- fieldId: o,
27
- renderLabel: () => O,
28
- renderInput: () => /* @__PURE__ */ i.createElement(ne, {
29
- id: f,
30
- ariaLabelledBy: d,
31
- ariaDescribedBy: l,
32
- required: u,
33
- onBlur: I,
34
- onFocus: b
35
- }, /* @__PURE__ */ i.createElement(W, {
36
- "aria-labelledby": d,
37
- value: s,
38
- onChange: E,
39
- isDisabled: r,
40
- isRequired: u,
41
- isInvalid: p
42
- }, h)),
43
- renderDescription: () => /* @__PURE__ */ i.createElement(i.Fragment, null, v, g)
44
- });
45
- }, $ = ({ children: e, className: t }) => {
46
- const o = N(), { id: n, options: a, addOther: r, addOtherLabel: u, numberOfColumns: I } = o, { t: b } = X(), { isMobile: p } = Y(), c = L(e, $.Option), f = re(u, b), d = p ? se.ONE : I;
47
- return /* @__PURE__ */ i.createElement("div", {
48
- className: t,
49
- "data-columns": d
50
- }, a == null ? void 0 : a.map((l, O) => {
51
- const h = l.value ?? l.label;
52
- return k(c, {
53
- key: l.id || l.label,
54
- value: h,
55
- label: l.label,
56
- isFirst: O === 0,
57
- fieldId: n
58
- });
59
- }), r && k(c, {
60
- key: R,
61
- value: R,
62
- label: f,
63
- isOther: !0
64
- }));
65
- }, ce = ({ className: e, ...t }) => {
66
- const { label: o } = t;
67
- return /* @__PURE__ */ i.createElement("span", {
68
- className: e
69
- }, o);
70
- }, x = ({ children: e, className: t, ...o }) => {
71
- const { value: n, label: a, isFirst: r = !1, isOther: u = !1, fieldId: I } = o, b = N(), { value: p, onChange: c, disabled: f, readOnly: d, hasError: l, options: O } = b, h = P(null);
72
- Z(() => {
73
- var m;
74
- r && ((m = h.current) == null || m.focus({
75
- preventScroll: !0
76
- }));
77
- }, I);
78
- const g = L(e, x.Label), v = L(e, x.Input), s = F(() => p || [], [
79
- p
80
- ]), E = F(() => u ? s.find((m) => m === a || m.startsWith(`${a}: `)) || a : n, [
81
- u,
82
- s,
83
- a,
84
- n
85
- ]), V = _((m) => {
86
- if (!u)
87
- return;
88
- const y = D(O || []), S = s.filter((H) => y.includes(H)), G = m ? [
89
- ...S,
90
- a
91
- ] : S;
92
- c == null || c(G);
93
- }, [
94
- u,
95
- a,
96
- c,
97
- O,
98
- s
99
- ]);
100
- return /* @__PURE__ */ i.createElement(A, {
101
- value: E,
102
- onChange: u ? V : void 0,
103
- isDisabled: f,
104
- isReadOnly: d,
105
- isInvalid: l
106
- }, /* @__PURE__ */ i.createElement(j, {
107
- ref: h,
108
- className: t,
109
- "data-hook": `checkbox-${a}`
110
- }, ({ isSelected: m, isHovered: y }) => /* @__PURE__ */ i.createElement(i.Fragment, null, k(v, {
111
- isSelected: m,
112
- isHovered: y
113
- }), k(g, {
114
- label: a
115
- }))));
116
- };
117
- x.Label = ce;
118
- x.Input = le;
119
- const M = ({ children: e, ...t }) => {
120
- const { value: o, label: n, isFirst: a = !1, isOther: r = !1, fieldId: u } = t, I = N(), { value: b, onChange: p, options: c, addOtherPlaceholder: f, otherInputCharacterLimit: d, disabled: l, readOnly: O, hasError: h } = I, g = L(e, x), v = L(e, q), s = F(() => b || [], [
121
- b
122
- ]), E = F(() => {
123
- if (!r)
124
- return !1;
125
- const V = D(c || []);
126
- return B(s, V);
127
- }, [
128
- r,
129
- s,
130
- c
131
- ]);
132
- return /* @__PURE__ */ i.createElement(i.Fragment, null, k(g, {
133
- value: o,
134
- label: n,
135
- isFirst: a,
136
- isOther: r,
137
- fieldId: u
138
- }), r && E && k(v, {
139
- fieldValue: s,
140
- onChange: p,
141
- label: n,
142
- placeholder: f,
143
- maxLength: d,
144
- disabled: l,
145
- readOnly: O,
146
- hasError: h,
147
- ariaLabel: n,
148
- addOtherLabel: n,
149
- options: c
150
- }));
151
- }, q = ({ className: e, inputClassName: t, ...o }) => {
152
- const { fieldValue: n, onChange: a, label: r, placeholder: u, maxLength: I, disabled: b, readOnly: p, hasError: c, ariaLabel: f, addOtherLabel: d, options: l } = o, [O, h] = w(() => {
153
- const s = D(l || []);
154
- return B(n, s) ? T(n, d) : "";
155
- });
156
- U(() => {
157
- const s = D(l || []), E = B(n, s);
158
- h(E ? T(n, d) : "");
159
- }, [
160
- n,
161
- l,
162
- d
163
- ]);
164
- const g = F(() => K((s) => {
165
- const E = D(l || []), V = n.filter((S) => E.includes(S)), m = s ? `${d}: ${s}` : r, y = [
166
- ...V,
167
- m
168
- ];
169
- a(y);
170
- }, 500), [
171
- a,
172
- l,
173
- n,
174
- d,
175
- r
176
- ]), v = _((s) => {
177
- h(s), g(s);
178
- }, [
179
- g
180
- ]);
181
- return /* @__PURE__ */ i.createElement(z, {
182
- "aria-label": f,
183
- value: O,
184
- onChange: v,
185
- isDisabled: b,
186
- isReadOnly: p,
187
- isInvalid: c,
188
- className: e
189
- }, /* @__PURE__ */ i.createElement(J, {
190
- className: t,
191
- placeholder: u,
192
- maxLength: I,
193
- "aria-label": f
194
- }));
195
- };
196
- C.Label = ae;
197
- C.Options = $;
198
- $.Option = M;
199
- M.Checkbox = x;
200
- M.OtherInput = q;
201
- C.Description = ee;
202
- C.Error = te;
203
- export {
204
- C
205
- };
@@ -1,319 +0,0 @@
1
- import n, { useMemo as x, useCallback as F, useRef as oe } from "react";
2
- import { RicosViewer as re } from "@wix/ricos/viewer";
3
- import D from "classnames";
4
- import { RadioGroup as se, RadioField as G, RadioButton as Y, TextField as ae, Group as le, Input as ie } from "react-aria-components";
5
- import { debounce as ce } from "ts-debounce";
6
- import { P as Q, ak as L, ah as B, au as ue, ac as A, am as me } from "./form-xpXT6sSe.js";
7
- import { f, a as y } from "./find-child-C60k4CxG.js";
8
- import { a as W } from "./format-currency-BwShJ9vM.js";
9
- import { D as pe, E as de } from "./field-error-headless-gUwzDWOe.js";
10
- import { L as Ce } from "./field-label-headless-Co6yOqfY.js";
11
- import { N as Ie } from "./options-layout-constants-DEfIEJWD.js";
12
- import { a as Ee, b as fe } from "./numeric-input-utils-CuBMi4-a.js";
13
- import { g as Oe } from "./payment-field-utils-DobiK5Xh.js";
14
- import { u as he } from "./use-synced-display-value-DcAxdn3M.js";
15
- import { E as _e } from "./error-icon-hZxQ6DEy.js";
16
- import { s as S } from "./field-rac.module-DobpyqOd.js";
17
- import { C as be, S as ye, k as Ne, r as ge, j as Fe, l as De } from "./form-element-classes-BtKlobUX.js";
18
- import { o as Se } from "./options-rac.module-KM-VT_KY.js";
19
- import { u as Re } from "./use-element-state-class-name-DnTajLN7.js";
20
- import { u as ve } from "./use-text-input-class-name-ZQJA7JHr.js";
21
- function Le(e, t) {
22
- return e.reduce((o, r) => (o[r[t]] = r, o), {});
23
- }
24
- function Ae(e) {
25
- return Le(e, "id");
26
- }
27
- const je = 0.01;
28
- function Te(e) {
29
- var t;
30
- return ((t = e == null ? void 0 : e.fixedPriceOptions) == null ? void 0 : t.price) || "0";
31
- }
32
- function z(e, t) {
33
- const o = Number(t || "0");
34
- return {
35
- productId: e.id,
36
- price: e.priceType === Q.DYNAMIC_PRICE ? o : String(o),
37
- quantity: 1
38
- };
39
- }
40
- function Me(e) {
41
- return e.find((t) => t.priceType === Q.DYNAMIC_PRICE);
42
- }
43
- function Pe(e, t) {
44
- return (e == null ? void 0 : e.productId) === (t == null ? void 0 : t.id) ? String((e == null ? void 0 : e.price) ?? "") : "";
45
- }
46
- function xe(e, t, o) {
47
- const r = (t == null ? void 0 : t.productId) === e ? void 0 : e, a = r ? o[r] : void 0;
48
- return a ? [
49
- z(a, Te(a))
50
- ] : [];
51
- }
52
- const s = ({ children: e }) => {
53
- const { id: t, value: o, onChange: r, disabled: a, required: m, onBlur: p, onFocus: h, validation: c, addOther: u, addOtherPlaceholder: i, FieldLayout: C, hasError: O } = L(), { labelId: _ } = B(), { t: I } = ue(), { currency: j, regionalFormat: N } = A(), d = o == null ? void 0 : o[0], g = x(() => {
54
- var E, P;
55
- return ((P = (E = c == null ? void 0 : c.predefined) == null ? void 0 : E.paymentOptions) == null ? void 0 : P.products) || [];
56
- }, [
57
- c
58
- ]), T = x(() => Ae(g), [
59
- g
60
- ]), l = x(() => u ? Me(g) : void 0, [
61
- g,
62
- u
63
- ]), J = Pe(d, l), [k, M] = he({
64
- sourceValue: J,
65
- format: (E) => fe(String(E ?? ""), N),
66
- regionalFormat: N
67
- }), q = F((E) => {
68
- r(xe(E, d, T)), M("");
69
- }, [
70
- r,
71
- T,
72
- d,
73
- M
74
- ]), H = F((E) => {
75
- l && r(typeof E == "number" ? [
76
- z(l, String(E))
77
- ] : []);
78
- }, [
79
- r,
80
- l
81
- ]), $ = x(() => ce(H, 500), [
82
- H
83
- ]), K = F((E) => {
84
- (d == null ? void 0 : d.productId) !== (l == null ? void 0 : l.id) && r(void 0);
85
- const { validInput: P, validNumber: ne } = Ee(E.target.value, je, k, N);
86
- M(P), $(ne);
87
- }, [
88
- N,
89
- r,
90
- d,
91
- l,
92
- k,
93
- $,
94
- M
95
- ]), w = (d == null ? void 0 : d.productId) || null, X = F(() => {
96
- l != null && l.id && w !== l.id && q(l.id);
97
- }, [
98
- l == null ? void 0 : l.id,
99
- w,
100
- q
101
- ]), Z = f(e, s.Label), V = f(e, s.Control), ee = f(e, s.Description), te = f(e, s.Error);
102
- return /* @__PURE__ */ n.createElement(C, {
103
- fieldId: t,
104
- renderLabel: () => Z,
105
- renderInput: () => /* @__PURE__ */ n.createElement(se, {
106
- "aria-labelledby": _,
107
- value: w,
108
- onChange: q,
109
- isDisabled: a,
110
- isInvalid: O,
111
- isRequired: m,
112
- onBlur: p,
113
- onFocus: h
114
- }, V ? y(V, {
115
- productsById: T,
116
- addOther: u,
117
- customAmount: k,
118
- onCustomAmountInputChange: K,
119
- currency: j,
120
- t: I,
121
- placeholder: i === void 0 ? I("donation.other-option.placeholder") : i,
122
- customAmountProductId: l == null ? void 0 : l.id,
123
- onFocusCustomInput: X
124
- }) : null),
125
- renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, te, ee)
126
- });
127
- }, Be = ({ children: e, className: t, ...o }) => {
128
- const { productsById: r, addOther: a, customAmount: m, onCustomAmountInputChange: p, currency: h, t: c, placeholder: u, customAmountProductId: i, onFocusCustomInput: C } = o, { hasError: O } = L(), _ = f(e, s.Options), I = f(e, s.OtherInput);
129
- return /* @__PURE__ */ n.createElement("div", {
130
- className: t,
131
- "data-invalid": O
132
- }, _ ? y(_, {
133
- productsById: r
134
- }) : null, a && i && /* @__PURE__ */ n.createElement(G, {
135
- value: i,
136
- style: {
137
- position: "absolute",
138
- width: "1px",
139
- height: "1px",
140
- padding: "0",
141
- margin: "-1px",
142
- overflow: "hidden",
143
- clip: "rect(0, 0, 0, 0)",
144
- whiteSpace: "nowrap",
145
- border: "0"
146
- }
147
- }, /* @__PURE__ */ n.createElement(Y, {
148
- "aria-label": c("donation.other-option.label", "Custom amount")
149
- }, c("donation.other-option.label", "Custom amount"))), I && a ? y(I, {
150
- customAmount: m,
151
- onCustomAmountInputChange: p,
152
- currency: h,
153
- t: c,
154
- placeholder: u,
155
- customAmountProductId: i,
156
- onFocusCustomInput: C
157
- }) : null);
158
- }, U = ({ children: e, className: t, ...o }) => {
159
- const { productsById: r } = o, { options: a, numberOfColumns: m } = L(), { isMobile: p } = A(), h = f(e, U.Option), c = p ? Ie.ONE : m;
160
- return /* @__PURE__ */ n.createElement("div", {
161
- className: t,
162
- "data-columns": c
163
- }, a.map((u) => {
164
- var O;
165
- const i = r[u.value], C = (O = i == null ? void 0 : i.fixedPriceOptions) == null ? void 0 : O.price;
166
- return y(h, {
167
- key: u.value,
168
- value: u.value,
169
- price: C || "0"
170
- });
171
- }));
172
- }, R = ({ children: e, className: t, ...o }) => {
173
- const { value: r, price: a } = o, { id: m } = L(), { currency: p, regionalFormat: h } = A(), c = f(e, R.Value), u = f(e, R.Currency), { isCurrencyPrefixed: i } = W({
174
- amount: a,
175
- currency: p == null ? void 0 : p.code,
176
- locale: h
177
- }), C = oe(null);
178
- me(() => {
179
- var _, I;
180
- (I = (_ = C.current) == null ? void 0 : _.querySelector("input")) == null || I.focus();
181
- }, m);
182
- const O = c ? y(c, {
183
- price: a
184
- }) : null;
185
- return /* @__PURE__ */ n.createElement(G, {
186
- value: r
187
- }, /* @__PURE__ */ n.createElement(Y, {
188
- className: t,
189
- ref: C
190
- }, /* @__PURE__ */ n.createElement(n.Fragment, null, i && u, O, !i && u)));
191
- }, ke = ({ className: e, ...t }) => {
192
- const { price: o } = t, { currency: r, regionalFormat: a } = A(), { value: m } = W({
193
- amount: o,
194
- currency: r == null ? void 0 : r.code,
195
- locale: a
196
- });
197
- return /* @__PURE__ */ n.createElement("span", {
198
- className: e
199
- }, m);
200
- }, qe = ({ className: e }) => {
201
- const { currency: t } = A();
202
- return /* @__PURE__ */ n.createElement("span", {
203
- className: e
204
- }, (t == null ? void 0 : t.sign) || (t == null ? void 0 : t.code) || "");
205
- };
206
- R.Value = ke;
207
- R.Currency = qe;
208
- const v = ({ children: e, className: t, ...o }) => {
209
- const { customAmount: r, onCustomAmountInputChange: a, currency: m, t: p, placeholder: h, customAmountProductId: c, onFocusCustomInput: u } = o, { disabled: i, hasError: C } = L(), { labelId: O, prefixId: _ } = B(), I = f(e, v.Currency), j = f(e, v.Value), N = F((g) => {
210
- a({
211
- target: {
212
- value: g
213
- }
214
- });
215
- }, [
216
- a
217
- ]), d = F(() => {
218
- u();
219
- }, [
220
- u
221
- ]);
222
- return /* @__PURE__ */ n.createElement(ae, {
223
- "aria-labelledby": `${O} ${_}`,
224
- value: r,
225
- onChange: N,
226
- onFocus: d,
227
- isDisabled: i,
228
- isInvalid: C
229
- }, /* @__PURE__ */ n.createElement(le, {
230
- className: t,
231
- isDisabled: i,
232
- isInvalid: C
233
- }, r && m && I ? y(I, {
234
- currency: m,
235
- t: p
236
- }) : null, j ? y(j, {
237
- placeholder: h,
238
- customAmountProductId: c
239
- }) : null));
240
- }, we = ({ className: e, ...t }) => {
241
- const { currency: o, t: r } = t, { prefixId: a } = B();
242
- return /* @__PURE__ */ n.createElement("span", {
243
- id: a,
244
- "aria-hidden": !1,
245
- "aria-label": Oe(r, o),
246
- className: e
247
- }, (o == null ? void 0 : o.sign) || (o == null ? void 0 : o.code) || "");
248
- }, Ue = ({ className: e, ...t }) => {
249
- const { placeholder: o, customAmountProductId: r } = t, { ariaDescribedBy: a, labelId: m, prefixId: p } = B();
250
- return /* @__PURE__ */ n.createElement(ie, {
251
- id: r,
252
- "aria-labelledby": `${m} ${p}`,
253
- "aria-describedby": a,
254
- placeholder: o,
255
- inputMode: "decimal",
256
- autoComplete: "off",
257
- className: e
258
- });
259
- };
260
- v.Currency = we;
261
- v.Value = Ue;
262
- U.Option = R;
263
- s.Label = Ce;
264
- s.Control = Be;
265
- s.Options = U;
266
- s.OtherInput = v;
267
- s.Description = pe;
268
- s.Error = de;
269
- const He = "_control_1jl2j_1", $e = "_options_1jl2j_7", Ve = "_option_1jl2j_7", Ge = "_optionHover_1jl2j_43", Ye = "_optionSelected_1jl2j_43", Qe = "_optionCurrency_1jl2j_93", We = "_otherInput_1jl2j_97", ze = "_otherInputCurrency_1jl2j_116", b = {
270
- control: He,
271
- options: $e,
272
- option: Ve,
273
- optionHover: Ge,
274
- optionSelected: Ye,
275
- optionCurrency: Qe,
276
- otherInput: We,
277
- otherInputCurrency: ze
278
- }, Je = ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(re, {
279
- content: e,
280
- locale: t
281
- }), Ke = {
282
- base: b.option,
283
- selected: b.optionSelected,
284
- hover: b.optionHover
285
- }, Xe = () => {
286
- const e = ve(b.otherInput), t = Re({
287
- globalClasses: De,
288
- moduleClasses: Ke
289
- });
290
- return /* @__PURE__ */ n.createElement(s, null, /* @__PURE__ */ n.createElement(s.Label, {
291
- className: D(be, S.label)
292
- }, /* @__PURE__ */ n.createElement(s.Label.Required, {
293
- className: D(ye, S.requiredMark)
294
- })), /* @__PURE__ */ n.createElement(s.Control, {
295
- className: b.control
296
- }, /* @__PURE__ */ n.createElement(s.Options, {
297
- className: D(Ne, Se.options, b.options)
298
- }, /* @__PURE__ */ n.createElement(s.Options.Option, {
299
- className: ({ isSelected: o, isHovered: r }) => t({
300
- isSelected: o,
301
- isHovered: r
302
- })
303
- }, /* @__PURE__ */ n.createElement(s.Options.Option.Value, null), /* @__PURE__ */ n.createElement(s.Options.Option.Currency, {
304
- className: b.optionCurrency
305
- }))), /* @__PURE__ */ n.createElement(s.OtherInput, {
306
- className: e
307
- }, /* @__PURE__ */ n.createElement(s.OtherInput.Currency, {
308
- className: b.otherInputCurrency
309
- }), /* @__PURE__ */ n.createElement(s.OtherInput.Value, {
310
- className: S.innerInput
311
- }))), /* @__PURE__ */ n.createElement(s.Error, {
312
- className: D(ge, S.error)
313
- }, /* @__PURE__ */ n.createElement(_e, null), /* @__PURE__ */ n.createElement(s.Error.Text, null)), /* @__PURE__ */ n.createElement(s.Description, {
314
- className: D(Fe, S.description)
315
- }, Je));
316
- }, ht = () => /* @__PURE__ */ n.createElement(Xe, null);
317
- export {
318
- ht as DonationRAC
319
- };
@@ -1,158 +0,0 @@
1
- import e, { useMemo as y, useCallback as H, useRef as T } from "react";
2
- import { RicosViewer as k } from "@wix/ricos/viewer";
3
- import I from "classnames";
4
- import { ak as C, ah as G, ac as x, am as P, ad as B } from "./form-xpXT6sSe.js";
5
- import { CheckboxGroup as q, CheckboxField as U, CheckboxButton as w } from "react-aria-components";
6
- import { f as p, a as F } from "./find-child-C60k4CxG.js";
7
- import { L as V, g as j } from "./field-label-headless-Co6yOqfY.js";
8
- import { D as z, E as K } from "./field-error-headless-gUwzDWOe.js";
9
- import { F as Q } from "./fieldset-headless-CD3fds9J.js";
10
- import { E as Y } from "./error-icon-hZxQ6DEy.js";
11
- import { s as b } from "./field-rac.module-DobpyqOd.js";
12
- import { C as $, S as J, v as W, x as X, r as Z, j as ee, w as te, F as f } from "./form-element-classes-BtKlobUX.js";
13
- import { u as oe } from "./use-element-state-class-name-DnTajLN7.js";
14
- const o = ({ children: t }) => {
15
- const { id: s, value: n, onChange: a, disabled: l, readOnly: i, required: r, onBlur: c, onFocus: m, hasError: E, FieldLayout: L } = C(), { inputId: g, labelId: _, ariaDescribedBy: O } = G(), R = p(t, o.Label), N = p(t, o.Options), S = p(t, o.Description), A = p(t, o.Error), D = y(() => n || [], [
16
- n
17
- ]), M = H((v) => {
18
- a == null || a(v);
19
- }, [
20
- a
21
- ]);
22
- return /* @__PURE__ */ e.createElement(L, {
23
- fieldId: s,
24
- renderLabel: () => R,
25
- renderInput: () => /* @__PURE__ */ e.createElement(Q, {
26
- id: g,
27
- ariaLabelledBy: _,
28
- ariaDescribedBy: O,
29
- required: r,
30
- onBlur: c,
31
- onFocus: m
32
- }, /* @__PURE__ */ e.createElement(q, {
33
- "aria-labelledby": _,
34
- value: D,
35
- onChange: M,
36
- isDisabled: l,
37
- isReadOnly: i,
38
- isRequired: r,
39
- isInvalid: E
40
- }, N)),
41
- renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, A, S)
42
- });
43
- }, h = ({ children: t, className: s }) => {
44
- const { isMobile: n } = x(), { id: a, options: l, numberOfColumns: i } = C(), r = p(t, h.Option);
45
- return /* @__PURE__ */ e.createElement("div", {
46
- className: s,
47
- "data-columns": n ? 1 : i
48
- }, l == null ? void 0 : l.map((c, m) => F(r, {
49
- key: c.id || c.label,
50
- option: c,
51
- isFirst: m === 0,
52
- fieldId: a
53
- })));
54
- }, ae = ({ className: t }) => /* @__PURE__ */ e.createElement("div", {
55
- "aria-hidden": "true",
56
- className: t
57
- }), ne = ({ className: t, ...s }) => {
58
- var m, E;
59
- const { option: n } = s, { choiceImageResize: a, choiceImageAlignment: l } = C(), i = (m = n.media) == null ? void 0 : m.image, r = i && j(i, i.width, i.height);
60
- if (!i || !r)
61
- return /* @__PURE__ */ e.createElement("div", {
62
- className: t,
63
- "data-placeholder": !0,
64
- "data-hook": "image-choice-option-image"
65
- });
66
- const c = ((E = n.media) == null ? void 0 : E.altText) || n.altText || i.altText || "";
67
- return /* @__PURE__ */ e.createElement("img", {
68
- className: t,
69
- src: r,
70
- alt: c,
71
- "data-fit": a,
72
- "data-alignment": l,
73
- "data-hook": "image-choice-option-image"
74
- });
75
- }, se = ({ className: t, ...s }) => {
76
- const { option: n } = s;
77
- return !n.label || n.isLabelHidden ? null : /* @__PURE__ */ e.createElement("span", {
78
- className: t
79
- }, n.label);
80
- }, u = ({ children: t, className: s, ...n }) => {
81
- const { option: a, isFirst: l = !1, fieldId: i } = n, { disabled: r, readOnly: c, hasError: m } = C(), E = T(null);
82
- P(() => {
83
- var O;
84
- l && ((O = E.current) == null || O.focus({
85
- preventScroll: !0
86
- }));
87
- }, i);
88
- const L = p(t, u.Input), g = p(t, u.Image), _ = p(t, u.Label);
89
- return /* @__PURE__ */ e.createElement(U, {
90
- value: a.label,
91
- isDisabled: r,
92
- isReadOnly: c,
93
- isInvalid: m
94
- }, /* @__PURE__ */ e.createElement(w, {
95
- ref: E,
96
- "aria-label": a.isLabelHidden ? a.label : void 0,
97
- className: s,
98
- "data-hook": `image-choice-${a.label}`
99
- }, L, F(g, {
100
- option: a
101
- }), F(_, {
102
- option: a
103
- })));
104
- };
105
- u.Input = ae;
106
- u.Image = ne;
107
- u.Label = se;
108
- o.Label = V;
109
- o.Options = h;
110
- h.Option = u;
111
- o.Description = z;
112
- o.Error = K;
113
- const ie = "_options_h283c_1", le = "_optionInput_h283c_25", re = "_option_h283c_1", ce = "_optionHover_h283c_61", me = "_optionSelected_h283c_61", pe = "_optionLabel_h283c_101", Ee = "_optionImage_h283c_132", d = {
114
- options: ie,
115
- optionInput: le,
116
- option: re,
117
- optionHover: ce,
118
- optionSelected: me,
119
- optionLabel: pe,
120
- optionImage: Ee
121
- }, de = ({ content: t, locale: s }) => /* @__PURE__ */ e.createElement(k, {
122
- content: t,
123
- locale: s
124
- }), ue = {
125
- base: d.option,
126
- selected: d.optionSelected,
127
- hover: d.optionHover
128
- }, Ie = () => {
129
- const t = oe({
130
- globalClasses: te,
131
- moduleClasses: ue
132
- }), s = B(f.IMAGE_CHOICE, f.IMAGE_CHOICE_OPTION, f.IMAGE_CHOICE_OPTION_IMAGE);
133
- return /* @__PURE__ */ e.createElement(o, null, /* @__PURE__ */ e.createElement(o.Label, {
134
- className: I($, b.label)
135
- }, /* @__PURE__ */ e.createElement(o.Label.Required, {
136
- className: I(J, b.requiredMark)
137
- })), /* @__PURE__ */ e.createElement(o.Options, {
138
- className: I(W, d.options)
139
- }, /* @__PURE__ */ e.createElement(o.Options.Option, {
140
- className: ({ isSelected: n, isHovered: a }) => t({
141
- isSelected: n,
142
- isHovered: a
143
- })
144
- }, /* @__PURE__ */ e.createElement(o.Options.Option.Input, {
145
- className: d.optionInput
146
- }), /* @__PURE__ */ e.createElement(o.Options.Option.Image, {
147
- className: I(X, d.optionImage, s)
148
- }), /* @__PURE__ */ e.createElement(o.Options.Option.Label, {
149
- className: d.optionLabel
150
- }))), /* @__PURE__ */ e.createElement(o.Error, {
151
- className: I(Z, b.error)
152
- }, /* @__PURE__ */ e.createElement(Y, null), /* @__PURE__ */ e.createElement(o.Error.Text, null)), /* @__PURE__ */ e.createElement(o.Description, {
153
- className: I(ee, b.description)
154
- }, de));
155
- }, De = () => /* @__PURE__ */ e.createElement(Ie, null);
156
- export {
157
- De as ImageChoiceRAC
158
- };
@@ -1,6 +0,0 @@
1
- var T = /* @__PURE__ */ (function(r) {
2
- return r[r.FREE_FLOW = 0] = "FREE_FLOW", r[r.ONE = 1] = "ONE", r[r.TWO = 2] = "TWO", r[r.THREE = 3] = "THREE", r;
3
- })({});
4
- export {
5
- T as N
6
- };
@@ -1,7 +0,0 @@
1
- const o = "_options_fhx2z_1", t = "_optionLabel_fhx2z_20", n = {
2
- options: o,
3
- optionLabel: t
4
- };
5
- export {
6
- n as o
7
- };