@wix/form-elements 1.135.0 → 1.137.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 (110) hide show
  1. package/dist/component/appointment-rac-DETLNlLb.js +1010 -0
  2. package/dist/component/{bookings-address-rac-BK-sU26E.js → bookings-address-rac-ZLK-g-4b.js} +1 -1
  3. package/dist/component/{bookings-email-rac-DZ3HVkyn.js → bookings-email-rac-C-406Pj1.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-Ci4PHqOr.js → bookings-first-name-rac-ClxJPAU2.js} +1 -1
  5. package/dist/component/{bookings-header-rac-C_MYNrDA.js → bookings-header-rac-B_xKyowA.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-CdNlwyjm.js → bookings-last-name-rac-DcExtGsO.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-CP2JcaVr.js → bookings-login-bar-rac-B5Gpk-kG.js} +6 -6
  8. package/dist/component/{bookings-phone-rac-BV8sqxil.js → bookings-phone-rac-DJSSDoRL.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-DQtcYRsh.js → bookings-rich-text-rac-D-v6z1Fs.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-DPNqHTNc.js → checkbox-field-rac-DJmjpsmU.js} +121 -121
  11. package/dist/component/{checkbox-group-field-headless-DhhynlgN.js → checkbox-group-field-headless-C4A_Kv1U.js} +19 -19
  12. package/dist/component/{checkbox-group-field-rac-B3zOW7qr.js → checkbox-group-field-rac-M1l5h3ii.js} +4 -4
  13. package/dist/component/{checkbox-group-rac-Qy03hO31.js → checkbox-group-rac-DRdzHVfR.js} +1 -1
  14. package/dist/component/{checkbox-rac-DYr3RaHj.js → checkbox-rac-Cyhg2Wvd.js} +1 -1
  15. package/dist/component/{contacts-address-rac-Bi-etpfX.js → contacts-address-rac-BQvrTPCI.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-D2LLjX9P.js → contacts-birthdate-rac-DIMg-UlR.js} +1 -1
  17. package/dist/component/{contacts-company-rac-C9ImoG_i.js → contacts-company-rac-OgWSVsmZ.js} +1 -1
  18. package/dist/component/{contacts-email-rac-DeGblC9V.js → contacts-email-rac-39IQYxTe.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-Xk3m57jK.js → contacts-first-name-rac-CjwVQGS7.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-BKE-1IYB.js → contacts-last-name-rac-C6ftvjMG.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-CHmtTutD.js → contacts-phone-rac-ldsxrFQH.js} +1 -1
  22. package/dist/component/{contacts-position-rac-BS3TySLG.js → contacts-position-rac-3RzQeh2P.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac--fpczJiB.js → contacts-subscribe-rac-CfuH705u.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-CHkn8vkL.js → contacts-tax-id-rac-D85Dm5Pa.js} +1 -1
  25. package/dist/component/{date-availability-70Vb-dlb.js → date-availability-DcYOAszO.js} +1 -1
  26. package/dist/component/{date-input-field-rac-BlkYEYM_.js → date-input-field-rac-D4cr7NGI.js} +52 -52
  27. package/dist/component/{date-input-rac-JdNFk07Q.js → date-input-rac-BwJwmoZr.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-DHu11mY1.js → date-picker-field-rac-C-IM7SHk.js} +5 -5
  29. package/dist/component/{date-picker-rac-CZtWhFzM.js → date-picker-rac-BkAp8Bgb.js} +1 -1
  30. package/dist/component/{date-time-input-field-rac-cHAALqS5.js → date-time-input-field-rac-DGCd-WUh.js} +58 -58
  31. package/dist/component/{date-time-input-rac-Dz7GfoJO.js → date-time-input-rac-ClLzxACj.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-ZNKzyWda.js → dext-checkbox-group-rac-DI26D3eR.js} +4 -4
  33. package/dist/component/{dext-checkbox-rac-DfPFXrKu.js → dext-checkbox-rac-CRJq1RxN.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-BPbl65qK.js → dext-date-picker-rac-CvzQs_Te.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-D5ywbLtW.js → dext-date-time-input-rac-Dtysjtim.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-BuVsPZOU.js → dext-dropdown-rac-DHGo26Az.js} +1 -1
  37. package/dist/component/{dext-email-rac-DRjt3lqT.js → dext-email-rac-BpnNEdVF.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-Bzrl87fo.js → dext-number-input-rac-C5iW_ei6.js} +1 -1
  39. package/dist/component/{dext-phone-rac-LibvQb8h.js → dext-phone-rac-KCTWlcaK.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-BTWnIvwW.js → dext-radio-group-rac-ad6j8I4s.js} +4 -4
  41. package/dist/component/{dext-rating-input-rac-DTlnOcC8.js → dext-rating-input-rac-B4AvCMi0.js} +1 -1
  42. package/dist/component/{dext-tags-rac-YdeijviH.js → dext-tags-rac-BMathc_H.js} +4 -4
  43. package/dist/component/{dext-text-area-rac-CdCzQYey.js → dext-text-area-rac-Xb-pGhSZ.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-B28RTezm.js → dext-text-input-rac-CSE8qfGF.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-B0ZBPbAb.js → dext-url-input-rac-Bq4iz5z9.js} +1 -1
  46. package/dist/component/donation-rac-DRUbysCr.js +306 -0
  47. package/dist/component/{dropdown-field-headless-DVZnbZAM.js → dropdown-field-headless-DO592qOP.js} +8 -8
  48. package/dist/component/{dropdown-field-rac-DWCj_Grt.js → dropdown-field-rac-C2yjQI-C.js} +7 -7
  49. package/dist/component/{dropdown-rac-Bpo-F5sc.js → dropdown-rac-DlrGt2kE.js} +1 -1
  50. package/dist/component/{ecom-address-rac-vJ0ku_Ld.js → ecom-address-rac-D_StW_li.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-DgVReM6c.js → ecom-subscription-checkbox-rac-CrdttyUU.js} +2 -2
  52. package/dist/component/{email-input-field-rac-BXJGOBg-.js → email-input-field-rac-DqXazwV3.js} +46 -46
  53. package/dist/component/{events-repeater-rac-CrXE_ppd.js → events-repeater-rac-DDpRs7rY.js} +23 -23
  54. package/dist/component/{events-rsvp-rac-BGg3P1CQ.js → events-rsvp-rac-BN9axMYX.js} +10 -10
  55. package/dist/component/{field-error-headless-C3eOy1_l.js → field-error-headless-JU1yiTVE.js} +6 -6
  56. package/dist/component/{field-label-headless-BMmR_IeF.js → field-label-headless-CD4_8Ros.js} +7 -7
  57. package/dist/component/{file-upload-rac-Umix6wXx.js → file-upload-rac-CQTx6hEf.js} +50 -50
  58. package/dist/component/{fixed-payment-rac-CfIJCBjb.js → fixed-payment-rac-B5cRBcxY.js} +12 -12
  59. package/dist/component/{form-CYPNOMwk.js → form-Mla9_phC.js} +831 -823
  60. package/dist/component/form.css +1 -1
  61. package/dist/component/form.js +1 -1
  62. package/dist/component/{header-field-rac-oxHUTKYV.js → header-field-rac-B_F66ChH.js} +4 -4
  63. package/dist/component/{header-rac-DTGV923r.js → header-rac-BX6Df8ej.js} +1 -1
  64. package/dist/component/{image-choice-rac-B9JGl_h7.js → image-choice-rac-Ce01EhFJ.js} +32 -32
  65. package/dist/component/{index-C_ktc-yO.js → index-Ch7II1GU.js} +5 -5
  66. package/dist/component/{index-BOKSOnDK.js → index-DoIW9Cb6.js} +107 -107
  67. package/dist/component/{isObjectLike-Di8V7txC.js → isObjectLike-C1TnJWn6.js} +7 -7
  68. package/dist/component/{multiline-address-field-rac-zgmTbXlg.js → multiline-address-field-rac-DVDEcHtq.js} +115 -115
  69. package/dist/component/{multiline-address-rac-Cyb3dvBf.js → multiline-address-rac-BJ8ln_G5.js} +1 -1
  70. package/dist/component/{number-input-field-rac-DquqqRy_.js → number-input-field-rac-DTfx9YgL.js} +24 -24
  71. package/dist/component/{number-input-rac-G2DdTbk2.js → number-input-rac-pg7cmYpS.js} +1 -1
  72. package/dist/component/{password-rac-DJCU0F38.js → password-rac-D8BKTB_H.js} +50 -50
  73. package/dist/component/{payment-input-rac-DlIYza6N.js → payment-input-rac-HBquclKy.js} +38 -38
  74. package/dist/component/{phone-input-field-rac-B10TInMa.js → phone-input-field-rac-Fgfg5HwA.js} +56 -56
  75. package/dist/component/{phone-rac-BuyttJpM.js → phone-rac-pivMTIyc.js} +1 -1
  76. package/dist/component/{product-list-rac-WrSJwQ_g.js → product-list-rac-DauIxK2R.js} +61 -61
  77. package/dist/component/{quiz-radio-group-rac-CHxZ_pK_.js → quiz-radio-group-rac-B0OtjxKf.js} +1 -1
  78. package/dist/component/{radio-button-module-classes-DjJU-8ZB.js → radio-button-module-classes-Cu3KM625.js} +3 -3
  79. package/dist/component/{radio-group-field-rac-BImiqcKa.js → radio-group-field-rac-0dJHtf3G.js} +10 -10
  80. package/dist/component/{radio-group-rac-CDkJeGpN.js → radio-group-rac-CqtO1JqM.js} +1 -1
  81. package/dist/component/{rating-input-field-rac-Dsr_S5qN.js → rating-input-field-rac-CMny6OSF.js} +28 -28
  82. package/dist/component/{rating-input-rac-BJUW8U93.js → rating-input-rac-DA4iU_-m.js} +1 -1
  83. package/dist/component/{rich-content-rac.module-BfQJqA-x.js → rich-content-rac.module-CZX0cZst.js} +3 -3
  84. package/dist/component/{rich-text-field-rac-DIuZbu_u.js → rich-text-field-rac-Dtm6xFcj.js} +7 -7
  85. package/dist/component/{rich-text-rac-C39fpEiP.js → rich-text-rac-ClqIW5ds.js} +1 -1
  86. package/dist/component/service-dropdown-rac-_4T1OZGq.js +146 -0
  87. package/dist/component/{services-multi-choice-rac-GVb4qA7g.js → services-multi-choice-rac-BVim-jnM.js} +7 -7
  88. package/dist/component/{signature-rac-nC5pr6nB.js → signature-rac-D7w8WTLO.js} +73 -73
  89. package/dist/component/{submit-button-rac-eUjgrx9Q.js → submit-button-rac-BkUDj1dU.js} +12 -12
  90. package/dist/component/{tags-field-rac-zv30chSd.js → tags-field-rac-Di1aK4E2.js} +27 -27
  91. package/dist/component/{tags-rac-PnS2SxVP.js → tags-rac-CJ5f4Doi.js} +1 -1
  92. package/dist/component/{text-area-field-rac-DLeOMD4g.js → text-area-field-rac-DFjrT9fs.js} +16 -16
  93. package/dist/component/{text-area-rac-jZ_mh45C.js → text-area-rac-DBANidv_.js} +1 -1
  94. package/dist/component/{text-input-field-rac-DifV7Erd.js → text-input-field-rac-DJDzqR6d.js} +5 -5
  95. package/dist/component/{text-input-headless-DhVEjorY.js → text-input-headless-CG4wbxMG.js} +6 -6
  96. package/dist/component/{text-input-rac-Ce4qKN9M.js → text-input-rac-V0tK1Gj2.js} +1 -1
  97. package/dist/component/{time-input-rac-1kW3aDIo.js → time-input-rac-LSoyg8Ao.js} +46 -46
  98. package/dist/component/{url-input-field-rac-D9xXAQCq.js → url-input-field-rac-DI0SdDI0.js} +23 -23
  99. package/dist/component/{url-input-rac-SaAybDdN.js → url-input-rac-obx2Uf2F.js} +1 -1
  100. package/dist/component/{use-dropdown-option-class-name-C_MO_0JS.js → use-dropdown-option-class-name-BM-NiVtO.js} +2 -2
  101. package/dist/component/{use-dropdown-trigger-class-name-D7EMiD-M.js → use-dropdown-trigger-class-name-BHwQ-wZa.js} +4 -4
  102. package/dist/component/{use-element-state-class-name-DZFi3Z42.js → use-element-state-class-name-DAYz5X_i.js} +1 -1
  103. package/dist/component/{use-hoverable-input-class-name-JAZ1mif0.js → use-hoverable-input-class-name-DZ-4NGpv.js} +2 -2
  104. package/dist/component/{use-service-options-base-ZX4iaxzr.js → use-service-options-base-BOjt2sg9.js} +4 -4
  105. package/dist/component/use-text-input-class-name-Bqj4OoIw.js +6 -0
  106. package/package.json +2 -2
  107. package/dist/component/appointment-rac-CYCddSl9.js +0 -1010
  108. package/dist/component/donation-rac-_0cwsIAq.js +0 -314
  109. package/dist/component/service-dropdown-rac-Bc9hEpx3.js +0 -146
  110. package/dist/component/use-text-input-class-name-XFjQX8q1.js +0 -6
@@ -1,314 +0,0 @@
1
- import n, { useMemo as M, 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 { ax as j, bh as L, be as B, br as ue, b9 as z, bj as me, I as pe, U as de, q as Ie, v as Ce, p as Ee, r as fe } from "./form-CYPNOMwk.js";
7
- import { f, a as y } from "./find-child-C60k4CxG.js";
8
- import { a as Q } from "./format-currency-BwShJ9vM.js";
9
- import { D as he, E as Oe } from "./field-error-headless-C3eOy1_l.js";
10
- import { L as _e } from "./field-label-headless-BMmR_IeF.js";
11
- import { a as be, b as ye } from "./numeric-input-utils-CuBMi4-a.js";
12
- import { g as Ne } from "./payment-field-utils-DobiK5Xh.js";
13
- import { u as ge } from "./use-synced-display-value-DcAxdn3M.js";
14
- import { E as Fe } from "./error-icon-hZxQ6DEy.js";
15
- import { s as v } from "./field-rac.module-DfEb7pBp.js";
16
- import { o as De } from "./options-rac.module-_THNq6Qq.js";
17
- import { u as ve } from "./use-element-state-class-name-DZFi3Z42.js";
18
- import { u as Se } from "./use-text-input-class-name-XFjQX8q1.js";
19
- function Re(e, t) {
20
- return e.reduce((o, r) => (o[r[t]] = r, o), {});
21
- }
22
- function Le(e) {
23
- return Re(e, "id");
24
- }
25
- const Ae = 0.01;
26
- function Te(e) {
27
- var t;
28
- return ((t = e == null ? void 0 : e.fixedPriceOptions) == null ? void 0 : t.price) || "0";
29
- }
30
- function W(e, t) {
31
- const o = Number(t || "0");
32
- return {
33
- productId: e.id,
34
- price: e.priceType === j.DYNAMIC_PRICE ? o : String(o),
35
- quantity: 1
36
- };
37
- }
38
- function xe(e) {
39
- return e.find((t) => t.priceType === j.DYNAMIC_PRICE);
40
- }
41
- function Pe(e, t) {
42
- return (e == null ? void 0 : e.productId) === (t == null ? void 0 : t.id) ? String((e == null ? void 0 : e.price) ?? "") : "";
43
- }
44
- function Me(e, t, o) {
45
- const r = (t == null ? void 0 : t.productId) === e ? void 0 : e, a = r ? o[r] : void 0;
46
- return a ? [
47
- W(a, Te(a))
48
- ] : [];
49
- }
50
- const s = ({ children: e }) => {
51
- const { id: t, value: o, onChange: r, disabled: a, required: u, onBlur: m, onFocus: I, validation: i, addOther: p, addOtherPlaceholder: c, FieldLayout: h, hasError: b } = L(), { labelId: O } = B(), { t: C } = ue(), { currency: A, regionalFormat: N } = z(), d = o == null ? void 0 : o[0], g = M(() => {
52
- var E, P;
53
- return ((P = (E = i == null ? void 0 : i.predefined) == null ? void 0 : E.paymentOptions) == null ? void 0 : P.products) || [];
54
- }, [
55
- i
56
- ]), T = M(() => Le(g), [
57
- g
58
- ]), l = M(() => p ? xe(g) : void 0, [
59
- g,
60
- p
61
- ]), J = Pe(d, l), [q, x] = ge({
62
- sourceValue: J,
63
- format: (E) => ye(String(E ?? ""), N),
64
- regionalFormat: N
65
- }), w = F((E) => {
66
- r(Me(E, d, T)), x("");
67
- }, [
68
- r,
69
- T,
70
- d,
71
- x
72
- ]), k = F((E) => {
73
- l && r(typeof E == "number" ? [
74
- W(l, String(E))
75
- ] : []);
76
- }, [
77
- r,
78
- l
79
- ]), $ = M(() => ce(k, 500), [
80
- k
81
- ]), K = F((E) => {
82
- (d == null ? void 0 : d.productId) !== (l == null ? void 0 : l.id) && r(void 0);
83
- const { validInput: P, validNumber: ne } = be(E.target.value, Ae, q, N);
84
- x(P), $(ne);
85
- }, [
86
- N,
87
- r,
88
- d,
89
- l,
90
- q,
91
- $,
92
- x
93
- ]), H = (d == null ? void 0 : d.productId) || null, X = F(() => {
94
- l != null && l.id && H !== l.id && w(l.id);
95
- }, [
96
- l == null ? void 0 : l.id,
97
- H,
98
- w
99
- ]), Z = f(e, s.Label), V = f(e, s.Control), ee = f(e, s.Description), te = f(e, s.Error);
100
- return /* @__PURE__ */ n.createElement(h, {
101
- fieldId: t,
102
- renderLabel: () => Z,
103
- renderInput: () => /* @__PURE__ */ n.createElement(se, {
104
- "aria-labelledby": O,
105
- value: H,
106
- onChange: w,
107
- isDisabled: a,
108
- isInvalid: b,
109
- isRequired: u,
110
- onBlur: m,
111
- onFocus: I
112
- }, V ? y(V, {
113
- productsById: T,
114
- addOther: p,
115
- customAmount: q,
116
- onCustomAmountInputChange: K,
117
- currency: A,
118
- t: C,
119
- placeholder: c === void 0 ? C("donation.other-option.placeholder") : c,
120
- customAmountProductId: l == null ? void 0 : l.id,
121
- onFocusCustomInput: X
122
- }) : null),
123
- renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, te, ee)
124
- });
125
- }, Be = ({ children: e, className: t, ...o }) => {
126
- const { productsById: r, addOther: a, customAmount: u, onCustomAmountInputChange: m, currency: I, t: i, placeholder: p, customAmountProductId: c, onFocusCustomInput: h } = o, { hasError: b } = L(), O = f(e, s.Options), C = f(e, s.OtherInput);
127
- return /* @__PURE__ */ n.createElement("div", {
128
- className: t,
129
- "data-invalid": b
130
- }, O ? y(O, {
131
- productsById: r
132
- }) : null, a && c && /* @__PURE__ */ n.createElement(G, {
133
- value: c,
134
- style: {
135
- position: "absolute",
136
- width: "1px",
137
- height: "1px",
138
- padding: "0",
139
- margin: "-1px",
140
- overflow: "hidden",
141
- clip: "rect(0, 0, 0, 0)",
142
- whiteSpace: "nowrap",
143
- border: "0"
144
- }
145
- }, /* @__PURE__ */ n.createElement(Y, {
146
- "aria-label": i("donation.other-option.label", "Custom amount")
147
- }, i("donation.other-option.label", "Custom amount"))), C && a ? y(C, {
148
- customAmount: u,
149
- onCustomAmountInputChange: m,
150
- currency: I,
151
- t: i,
152
- placeholder: p,
153
- customAmountProductId: c,
154
- onFocusCustomInput: h
155
- }) : null);
156
- }, U = ({ children: e, className: t, ...o }) => {
157
- const { productsById: r } = o, { options: a, numberOfColumns: u } = L(), m = f(e, U.Option);
158
- return /* @__PURE__ */ n.createElement("div", {
159
- className: t,
160
- "data-columns": u
161
- }, a.map((I) => {
162
- var c;
163
- const i = r[I.value], p = (c = i == null ? void 0 : i.fixedPriceOptions) == null ? void 0 : c.price;
164
- return y(m, {
165
- key: I.value,
166
- value: I.value,
167
- price: p || "0"
168
- });
169
- }));
170
- }, S = ({ children: e, className: t, ...o }) => {
171
- const { value: r, price: a } = o, { id: u } = L(), { currency: m, regionalFormat: I } = z(), i = f(e, S.Value), p = f(e, S.Currency), { isCurrencyPrefixed: c } = Q({
172
- amount: a,
173
- currency: m == null ? void 0 : m.code,
174
- locale: I
175
- }), h = oe(null);
176
- me(() => {
177
- var O, C;
178
- (C = (O = h.current) == null ? void 0 : O.querySelector("input")) == null || C.focus();
179
- }, u);
180
- const b = i ? y(i, {
181
- price: a
182
- }) : null;
183
- return /* @__PURE__ */ n.createElement(G, {
184
- value: r
185
- }, /* @__PURE__ */ n.createElement(Y, {
186
- className: t,
187
- ref: h
188
- }, /* @__PURE__ */ n.createElement(n.Fragment, null, c && p, b, !c && p)));
189
- }, ze = ({ className: e, ...t }) => {
190
- const { price: o } = t, { currency: r, regionalFormat: a } = z(), { value: u } = Q({
191
- amount: o,
192
- currency: r == null ? void 0 : r.code,
193
- locale: a
194
- });
195
- return /* @__PURE__ */ n.createElement("span", {
196
- className: e
197
- }, u);
198
- }, qe = ({ className: e }) => {
199
- const { currency: t } = z();
200
- return /* @__PURE__ */ n.createElement("span", {
201
- className: e
202
- }, (t == null ? void 0 : t.sign) || (t == null ? void 0 : t.code) || "");
203
- };
204
- S.Value = ze;
205
- S.Currency = qe;
206
- const R = ({ children: e, className: t, ...o }) => {
207
- const { customAmount: r, onCustomAmountInputChange: a, currency: u, t: m, placeholder: I, customAmountProductId: i, onFocusCustomInput: p } = o, { disabled: c, hasError: h } = L(), { labelId: b, prefixId: O } = B(), C = f(e, R.Currency), A = f(e, R.Value), N = F((g) => {
208
- a({
209
- target: {
210
- value: g
211
- }
212
- });
213
- }, [
214
- a
215
- ]), d = F(() => {
216
- p();
217
- }, [
218
- p
219
- ]);
220
- return /* @__PURE__ */ n.createElement(ae, {
221
- "aria-labelledby": `${b} ${O}`,
222
- value: r,
223
- onChange: N,
224
- onFocus: d,
225
- isDisabled: c,
226
- isInvalid: h
227
- }, /* @__PURE__ */ n.createElement(le, {
228
- className: t,
229
- isDisabled: c,
230
- isInvalid: h
231
- }, r && u && C ? y(C, {
232
- currency: u,
233
- t: m
234
- }) : null, A ? y(A, {
235
- placeholder: I,
236
- customAmountProductId: i
237
- }) : null));
238
- }, we = ({ className: e, ...t }) => {
239
- const { currency: o, t: r } = t, { prefixId: a } = B();
240
- return /* @__PURE__ */ n.createElement("span", {
241
- id: a,
242
- "aria-hidden": !1,
243
- "aria-label": Ne(r, o),
244
- className: e
245
- }, (o == null ? void 0 : o.sign) || (o == null ? void 0 : o.code) || "");
246
- }, He = ({ className: e, ...t }) => {
247
- const { placeholder: o, customAmountProductId: r } = t, { ariaDescribedBy: a, labelId: u, prefixId: m } = B();
248
- return /* @__PURE__ */ n.createElement(ie, {
249
- id: r,
250
- "aria-labelledby": `${u} ${m}`,
251
- "aria-describedby": a,
252
- placeholder: o,
253
- inputMode: "decimal",
254
- autoComplete: "off",
255
- className: e
256
- });
257
- };
258
- R.Currency = we;
259
- R.Value = He;
260
- U.Option = S;
261
- s.Label = _e;
262
- s.Control = Be;
263
- s.Options = U;
264
- s.OtherInput = R;
265
- s.Description = he;
266
- s.Error = Oe;
267
- const Ue = "_control_1ulzi_1", ke = "_options_1ulzi_7", $e = "_option_1ulzi_7", Ve = "_optionHover_1ulzi_40", Ge = "_optionSelected_1ulzi_40", Ye = "_optionCurrency_1ulzi_90", je = "_otherInput_1ulzi_94", Qe = "_otherInputCurrency_1ulzi_113", _ = {
268
- control: Ue,
269
- options: ke,
270
- option: $e,
271
- optionHover: Ve,
272
- optionSelected: Ge,
273
- optionCurrency: Ye,
274
- otherInput: je,
275
- otherInputCurrency: Qe
276
- }, We = ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(re, {
277
- content: e,
278
- locale: t
279
- }), Je = {
280
- base: _.option,
281
- selected: _.optionSelected,
282
- hover: _.optionHover
283
- }, Ke = () => {
284
- const e = Se(_.otherInput), t = ve({
285
- globalClasses: fe,
286
- moduleClasses: Je
287
- });
288
- return /* @__PURE__ */ n.createElement(s, null, /* @__PURE__ */ n.createElement(s.Label, {
289
- className: D(pe, v.label)
290
- }, /* @__PURE__ */ n.createElement(s.Label.Required, {
291
- className: D(de, v.requiredMark)
292
- })), /* @__PURE__ */ n.createElement(s.Control, {
293
- className: _.control
294
- }, /* @__PURE__ */ n.createElement(s.Options, {
295
- className: D(Ie, De.options, _.options)
296
- }, /* @__PURE__ */ n.createElement(s.Options.Option, {
297
- className: t
298
- }, /* @__PURE__ */ n.createElement(s.Options.Option.Value, null), /* @__PURE__ */ n.createElement(s.Options.Option.Currency, {
299
- className: _.optionCurrency
300
- }))), /* @__PURE__ */ n.createElement(s.OtherInput, {
301
- className: e
302
- }, /* @__PURE__ */ n.createElement(s.OtherInput.Currency, {
303
- className: _.otherInputCurrency
304
- }), /* @__PURE__ */ n.createElement(s.OtherInput.Value, {
305
- className: v.innerInput
306
- }))), /* @__PURE__ */ n.createElement(s.Error, {
307
- className: D(Ce, v.error)
308
- }, /* @__PURE__ */ n.createElement(Fe, null), /* @__PURE__ */ n.createElement(s.Error.Text, null)), /* @__PURE__ */ n.createElement(s.Description, {
309
- className: D(Ee, v.description)
310
- }, We));
311
- }, Et = () => /* @__PURE__ */ n.createElement(Ke, null);
312
- export {
313
- Et as DonationRAC
314
- };
@@ -1,146 +0,0 @@
1
- import t, { useRef as T, useMemo as _, useCallback as h, useEffect as b } from "react";
2
- import { RicosViewer as w } from "@wix/ricos/viewer";
3
- import E from "classnames";
4
- import { bd as P, br as A, F as M, bh as y, b9 as U, aj as V, I as x, U as H, K as k, v as q, p as B } from "./form-CYPNOMwk.js";
5
- import { u as W } from "./use-service-options-base-ZX4iaxzr.js";
6
- import { D as u } from "./dropdown-field-headless-DVZnbZAM.js";
7
- import { C as j } from "./chevron-down-icon-CcpVm6B-.js";
8
- import { E as K } from "./error-icon-hZxQ6DEy.js";
9
- import { H as Q } from "./custom-focus-class-_483Pkwp.js";
10
- import { s as a } from "./field-rac.module-DfEb7pBp.js";
11
- import { u as Y } from "./use-dropdown-option-class-name-C_MO_0JS.js";
12
- import { u as z } from "./use-dropdown-trigger-class-name-D7EMiD-M.js";
13
- const G = "00000000-0000-0000-0000-000000000000", J = (e) => {
14
- const { actions: o } = P(), { t: C } = A(), { addOther: n, addOtherLabel: p } = e, c = p || C("add-other.default-other-option-label"), i = T(!0), d = _(() => {
15
- var s;
16
- return ((s = e.options) == null ? void 0 : s.map((m) => m.id ?? "")) ?? [];
17
- }, [
18
- e.options
19
- ]), O = h((s) => n ? [
20
- ...s,
21
- {
22
- value: c,
23
- label: c,
24
- id: G
25
- }
26
- ] : s, [
27
- n,
28
- c
29
- ]), { isLoading: f, options: l, isEmpty: S, shouldRender: I, setIsLoading: D, setOptions: F, setIsEmpty: g, processOptions: L } = W({
30
- fieldType: M.SERVICES_DROPDOWN,
31
- isEditor: e.isEditor,
32
- postProcessOptions: O
33
- }), R = h(async () => {
34
- if (i.current && (o != null && o.fetchServices) && d.length > 0) {
35
- i.current = !1, D(!0);
36
- let s;
37
- try {
38
- s = await o.fetchServices({
39
- serviceIds: d
40
- });
41
- } catch (m) {
42
- console.error(m);
43
- }
44
- if (s) {
45
- const m = L(s);
46
- g(!n && m.length === 0), F(m);
47
- } else
48
- i.current = !0;
49
- D(!1);
50
- }
51
- }, [
52
- o,
53
- d,
54
- L,
55
- n,
56
- D,
57
- F,
58
- g
59
- ]);
60
- b(() => {
61
- if (!e.isEditor && l.length > 0) {
62
- const s = n ? l.length - 1 : l.length;
63
- g(s === 0);
64
- }
65
- }, [
66
- l,
67
- n,
68
- g,
69
- e.isEditor
70
- ]);
71
- const v = h(() => {
72
- e.onFocus && e.onFocus(), i.current && R();
73
- }, [
74
- R,
75
- e.onFocus
76
- ]), N = h(
77
- (s) => {
78
- e.onChange && e.onChange(s), i.current = !0;
79
- },
80
- // eslint-disable-next-line react-hooks/exhaustive-deps
81
- [
82
- e.onChange
83
- ]
84
- );
85
- return {
86
- isLoading: f,
87
- options: l,
88
- isEmpty: S,
89
- onFocus: v,
90
- onChange: N,
91
- shouldRender: I
92
- };
93
- }, r = ({ children: e }) => {
94
- const o = y(), { addOther: C } = o, n = U(), p = o.isEditor || n.isEditor || n.isComposer, { isLoading: c, options: i, isEmpty: d, onFocus: O, onChange: f, shouldRender: l } = J({
95
- ...o,
96
- isEditor: p
97
- }), S = _(() => ({
98
- ...o,
99
- options: c ? [] : i,
100
- isLoading: c,
101
- onFocus: O,
102
- onChange: f
103
- }), [
104
- o,
105
- i,
106
- c,
107
- O,
108
- f
109
- ]);
110
- return !p && d && !C || !l ? null : /* @__PURE__ */ t.createElement(V.Provider, {
111
- value: {
112
- v2: S
113
- }
114
- }, /* @__PURE__ */ t.createElement(u, null, e));
115
- };
116
- r.Label = u.Label;
117
- r.Trigger = u.Trigger;
118
- r.Options = u.Options;
119
- r.Description = u.Description;
120
- r.Error = u.Error;
121
- const X = ({ content: e, locale: o }) => /* @__PURE__ */ t.createElement(w, {
122
- content: e,
123
- locale: o
124
- }), Z = () => {
125
- const e = z(a.dropdownTrigger), o = Y(Q);
126
- return /* @__PURE__ */ t.createElement(r, null, /* @__PURE__ */ t.createElement(r.Label, {
127
- className: E(x, a.label)
128
- }, /* @__PURE__ */ t.createElement(r.Label.Required, {
129
- className: E(H, a.requiredMark)
130
- })), /* @__PURE__ */ t.createElement(r.Trigger, {
131
- className: e
132
- }, /* @__PURE__ */ t.createElement(j, {
133
- className: a.dropdownIcon
134
- })), /* @__PURE__ */ t.createElement(r.Options, {
135
- className: E(k, a.selectPopover, a.dropdownPopover)
136
- }, /* @__PURE__ */ t.createElement(r.Options.Option, {
137
- className: o
138
- })), /* @__PURE__ */ t.createElement(r.Error, {
139
- className: E(q, a.error)
140
- }, /* @__PURE__ */ t.createElement(K, null), /* @__PURE__ */ t.createElement(r.Error.Text, null)), /* @__PURE__ */ t.createElement(r.Description, {
141
- className: E(B, a.description)
142
- }, X));
143
- }, ue = () => /* @__PURE__ */ t.createElement(Z, null);
144
- export {
145
- ue as ServiceDropdownRAC
146
- };
@@ -1,6 +0,0 @@
1
- import { a5 as a } from "./form-CYPNOMwk.js";
2
- import { u as e } from "./use-hoverable-input-class-name-JAZ1mif0.js";
3
- const m = (...s) => e(a, s);
4
- export {
5
- m as u
6
- };