@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.
Files changed (115) hide show
  1. package/dist/component/{appointment-rac-D2F4vgf1.js → appointment-rac-C9-XwsPI.js} +295 -296
  2. package/dist/component/{bookings-address-rac-_5S8J8_i.js → bookings-address-rac-jrrCPWjw.js} +1 -1
  3. package/dist/component/{bookings-email-rac-6vmDR9nS.js → bookings-email-rac-J9-RMEbf.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-DtTJ4T2K.js → bookings-first-name-rac-CH7-6JmA.js} +1 -1
  5. package/dist/component/{bookings-header-rac-B3dsEwzR.js → bookings-header-rac-C2JV-ciN.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-B3idkbi8.js → bookings-last-name-rac-0a9CwiaV.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-CrRBcQwT.js → bookings-login-bar-rac-4Mb7MQYe.js} +21 -22
  8. package/dist/component/{bookings-phone-rac-BE0yWNnj.js → bookings-phone-rac-vYx5r5jn.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-CYo1l0-6.js → bookings-rich-text-rac-CWg1FgUp.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-boTtXVEt.js → checkbox-field-rac-Dwx1leKA.js} +27 -28
  11. package/dist/component/{checkbox-group-field-headless-DnkUvDm8.js → checkbox-group-field-headless-AFWgXzx_.js} +41 -41
  12. package/dist/component/{checkbox-group-field-rac-DrDTgHMg.js → checkbox-group-field-rac-CO8kmWJp.js} +6 -6
  13. package/dist/component/{checkbox-group-rac-v3ozUBpo.js → checkbox-group-rac-_79HsFF4.js} +1 -1
  14. package/dist/component/{checkbox-rac-YSLE-RnG.js → checkbox-rac-B_tbMfjo.js} +1 -1
  15. package/dist/component/{contacts-address-rac-C653yaHZ.js → contacts-address-rac-SJ5Tvzd0.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-BeAQ6shx.js → contacts-birthdate-rac-BU1L3sbW.js} +1 -1
  17. package/dist/component/{contacts-company-rac-BglKOoTG.js → contacts-company-rac-Y4B8KhDa.js} +1 -1
  18. package/dist/component/{contacts-email-rac-D6m7ynfc.js → contacts-email-rac-CQW84o7C.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-Dgxn0tUJ.js → contacts-first-name-rac-Dtai-wtH.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-1UyIuRKH.js → contacts-last-name-rac--ixuu3ri.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-BQ77BlW4.js → contacts-phone-rac-HOHfSvT-.js} +1 -1
  22. package/dist/component/{contacts-position-rac-BUDUv7lv.js → contacts-position-rac-BPMkh6yf.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-DdtA0qKW.js → contacts-subscribe-rac-D0_RMwJb.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-WUaKcNl0.js → contacts-tax-id-rac-CZJmMiVf.js} +1 -1
  25. package/dist/component/{date-availability-XjBFq8jt.js → date-availability-C4dDHvuc.js} +1 -1
  26. package/dist/component/{date-input-field-rac-aY2zuuKs.js → date-input-field-rac-8oERZcqh.js} +79 -80
  27. package/dist/component/{date-input-rac-DRiP2_97.js → date-input-rac-CYRojmW6.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-Bzl-d3Uj.js → date-picker-field-rac-CIspU7No.js} +87 -88
  29. package/dist/component/{date-picker-rac-DHHUh8vn.js → date-picker-rac-D0Y0zf2J.js} +1 -1
  30. package/dist/component/{date-time-input-field-rac-DP_StuLr.js → date-time-input-field-rac-0daWK65I.js} +73 -74
  31. package/dist/component/{date-time-input-rac-B11KIxsf.js → date-time-input-rac-BemKPk1j.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-BHZBqyWv.js → dext-checkbox-group-rac-BpFNn56W.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-BIlAqEvV.js → dext-checkbox-rac-DOISgubJ.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-CHBXNrZi.js → dext-date-picker-rac-CNGhFg_g.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-BYtliKry.js → dext-date-time-input-rac-BuUIvJRr.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-C2VPSFV5.js → dext-dropdown-rac-DtND-Dbo.js} +1 -1
  37. package/dist/component/{dext-email-rac-Fnb0Ggcs.js → dext-email-rac-CmjLFOi8.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-DopfSyFi.js → dext-number-input-rac-DHTNg1dh.js} +1 -1
  39. package/dist/component/{dext-phone-rac-Rn4i_2rc.js → dext-phone-rac-BrrU5qH_.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-bNaskJpK.js → dext-radio-group-rac-CD3MGfAM.js} +4 -4
  41. package/dist/component/{dext-rating-input-rac-DL6ZZd7d.js → dext-rating-input-rac-BETGJZmt.js} +1 -1
  42. package/dist/component/{dext-tags-rac-TsUPoImO.js → dext-tags-rac-Coo9jN-T.js} +4 -4
  43. package/dist/component/{dext-text-area-rac-BIuY7LTd.js → dext-text-area-rac-CNWjqhUT.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-CSYPW0Qi.js → dext-text-input-rac-CCWyDexv.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-_g0lqGfW.js → dext-url-input-rac-Dtakkgmk.js} +1 -1
  46. package/dist/component/{donation-rac-BYKFtsyR.js → donation-rac-BboGm_k_.js} +101 -102
  47. package/dist/component/{dropdown-field-headless-CBaqlNZi.js → dropdown-field-headless-BTMJGUwY.js} +16 -16
  48. package/dist/component/{dropdown-field-rac-CCAGSMm3.js → dropdown-field-rac-CDRV8ckB.js} +5 -5
  49. package/dist/component/{dropdown-rac-C_EqUsZ1.js → dropdown-rac-kEuU2pXW.js} +1 -1
  50. package/dist/component/{ecom-address-rac-Bw9eH0iF.js → ecom-address-rac-BgKL9ElH.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-B5PVOO2a.js → ecom-subscription-checkbox-rac-CDhJsNPD.js} +6 -6
  52. package/dist/component/{email-input-field-rac-B2kqQ6yo.js → email-input-field-rac-DdOd86NX.js} +54 -55
  53. package/dist/component/{events-repeater-rac--4OnUxWE.js → events-repeater-rac-_VJ30dpB.js} +62 -63
  54. package/dist/component/{events-rsvp-rac-CczCoo3T.js → events-rsvp-rac-DA-261bq.js} +5 -5
  55. package/dist/component/{field-error-headless-D3-1L5sf.js → field-error-headless-CovyN0GI.js} +8 -8
  56. package/dist/component/{field-label-headless-Du4ckIVy.js → field-label-headless-DVvX2QaH.js} +11 -11
  57. package/dist/component/file-upload-rac-bhEPUJPs.js +561 -0
  58. package/dist/component/fixed-payment-rac-DmI6MeKc.js +61 -0
  59. package/dist/component/{form-DQauhsho.js → form-BTDgyr54.js} +3430 -3244
  60. package/dist/component/form.css +1 -1
  61. package/dist/component/form.js +3 -3
  62. package/dist/component/header-field-rac-C0rUjmo0.js +24 -0
  63. package/dist/component/{header-rac-CR9T3Pnu.js → header-rac-DRMO22PV.js} +1 -1
  64. package/dist/component/{image-choice-rac-DJ_8v467.js → image-choice-rac-CQDQ7AlD.js} +32 -33
  65. package/dist/component/{index-CcUTIUWM.js → index-B9QlosT1.js} +12 -12
  66. package/dist/component/{index-BB7d_9Dv.js → index-CNWT9t6j.js} +66 -66
  67. package/dist/component/{isObjectLike-xvPa_08X.js → isObjectLike-c0td2WCR.js} +1 -1
  68. package/dist/component/{multiline-address-field-rac-CyaFOloE.js → multiline-address-field-rac-D8bVxRsD.js} +124 -125
  69. package/dist/component/{multiline-address-rac-CaHGUN_f.js → multiline-address-rac-g-6RB7o8.js} +1 -1
  70. package/dist/component/number-input-field-rac-BaOwQ5Ya.js +92 -0
  71. package/dist/component/{number-input-rac-DMKX6nhk.js → number-input-rac-BXv8-Pnj.js} +1 -1
  72. package/dist/component/{password-rac-0RUXPAn6.js → password-rac-BB9XeSSZ.js} +36 -37
  73. package/dist/component/{payment-input-rac-CHSZ3-Lt.js → payment-input-rac-DwnSV9rM.js} +41 -42
  74. package/dist/component/{phone-input-field-rac-JmIFcP1e.js → phone-input-field-rac-CC3C4ToW.js} +56 -57
  75. package/dist/component/{phone-rac-BLRnAPXP.js → phone-rac-DpNhSaE0.js} +1 -1
  76. package/dist/component/{product-list-rac-BkF5tDwt.js → product-list-rac-BAESk3B6.js} +74 -75
  77. package/dist/component/{quiz-radio-group-rac-32cCMTUS.js → quiz-radio-group-rac-PS6AZr63.js} +1 -1
  78. package/dist/component/{radio-button-module-classes-IOulhuSH.js → radio-button-module-classes-CXcn5unY.js} +30 -30
  79. package/dist/component/{radio-group-field-rac-CJwku6e0.js → radio-group-field-rac-pt8xbDfS.js} +6 -6
  80. package/dist/component/{radio-group-rac-BiW-9Abj.js → radio-group-rac-DkzkM6N_.js} +1 -1
  81. package/dist/component/{rating-input-field-rac-B9cwaROK.js → rating-input-field-rac-DDHBkR4x.js} +43 -44
  82. package/dist/component/{rating-input-rac-BpwlNvzQ.js → rating-input-rac-CcsDmLus.js} +1 -1
  83. package/dist/component/{rich-content-rac.module-B1uyPmtK.js → rich-content-rac.module-B2vsO6fj.js} +4 -4
  84. package/dist/component/rich-text-field-rac-CvKht2eC.js +21 -0
  85. package/dist/component/{rich-text-rac-VfeZxS27.js → rich-text-rac-CRpSffQB.js} +1 -1
  86. package/dist/component/{service-dropdown-rac-BCfs8IhW.js → service-dropdown-rac-BOpdXNjG.js} +36 -37
  87. package/dist/component/{services-multi-choice-rac-CCqdF_7P.js → services-multi-choice-rac-t0wdSt_T.js} +20 -21
  88. package/dist/component/{signature-rac-DOyMo3u0.js → signature-rac-2LsIYYIX.js} +141 -142
  89. package/dist/component/{submit-button-rac-C2uA5DeE.js → submit-button-rac-BbE8dS35.js} +26 -27
  90. package/dist/component/{tags-field-rac-C_uIw2by.js → tags-field-rac-BnsBxReU.js} +44 -45
  91. package/dist/component/{tags-rac-1pQ-fpe_.js → tags-rac-BFH4RINA.js} +1 -1
  92. package/dist/component/{text-area-field-rac-DqlOkm7e.js → text-area-field-rac-Ag7_gniM.js} +28 -29
  93. package/dist/component/{text-area-rac-DPdkrFcH.js → text-area-rac-ByUX0p2O.js} +1 -1
  94. package/dist/component/{text-input-field-rac-CmXm6r1w.js → text-input-field-rac-D3MZ8teu.js} +3 -3
  95. package/dist/component/{text-input-headless-DD__2DFf.js → text-input-headless-CwONErsY.js} +12 -12
  96. package/dist/component/{text-input-rac-DRHyQEH7.js → text-input-rac-DLXdAhkK.js} +1 -1
  97. package/dist/component/{time-input-rac-BJPIymQY.js → time-input-rac-Bs55lTON.js} +33 -34
  98. package/dist/component/url-input-field-rac-FG-bCh-E.js +74 -0
  99. package/dist/component/{url-input-rac-C0ChQUzq.js → url-input-rac-BOKuCMTe.js} +1 -1
  100. package/dist/component/use-dropdown-option-class-name-DjV7FW5y.js +21 -0
  101. package/dist/component/{use-element-state-class-name-BatTc2bw.js → use-element-state-class-name-DB1AzkvF.js} +1 -1
  102. package/dist/component/{use-is-forced-open-dropdown-B0jiPTmS.js → use-is-forced-open-dropdown-ifUIpuwL.js} +7 -7
  103. package/dist/component/{use-service-options-base-oeE7xszw.js → use-service-options-base-B11cq0HH.js} +7 -7
  104. package/dist/component/use-text-input-class-name-va1PzWFg.js +23 -0
  105. package/dist/form.d.ts +21 -1
  106. package/package.json +2 -2
  107. package/dist/component/file-upload-rac-DbdkUbWM.js +0 -484
  108. package/dist/component/fixed-payment-rac-f9-01iDN.js +0 -62
  109. package/dist/component/form-element-classes-bLFmhsKw.js +0 -137
  110. package/dist/component/header-field-rac-DamDk5BR.js +0 -25
  111. package/dist/component/number-input-field-rac-BuYUzDWV.js +0 -93
  112. package/dist/component/rich-text-field-rac-C_qE7Ykg.js +0 -22
  113. package/dist/component/url-input-field-rac-CFDYkZ6I.js +0 -75
  114. package/dist/component/use-dropdown-option-class-name-3L5ZmNLK.js +0 -21
  115. package/dist/component/use-text-input-class-name-LQ5S-NLh.js +0 -24
@@ -1,484 +0,0 @@
1
- import t, { useState as H, useRef as V, useMemo as oe, useEffect as se, useCallback as P, createContext as pe, useContext as fe } from "react";
2
- import { RicosViewer as Ee } from "@wix/ricos/viewer";
3
- import B from "classnames";
4
- import { ag as Fe, au as ie, ap as ge, i as he, as as xe, e as re, at as be, ah as ce, ak as j, am as Ce } from "./form-DQauhsho.js";
5
- import { E as Le } from "./error-icon-hZxQ6DEy.js";
6
- import { s as I } from "./field-rac.module-B4l_0KRU.js";
7
- import { v as ne, J as De, Q as Ne, j as le, o as ae } from "./form-element-classes-bLFmhsKw.js";
8
- import { f as h, a as z } from "./find-child-C60k4CxG.js";
9
- import { b as ve, a as ye, D as _e, E as Te } from "./field-error-headless-D3-1L5sf.js";
10
- import { L as Be } from "./field-label-headless-Du4ckIVy.js";
11
- import { DropZone as Re, Text as Se, FileTrigger as Me, Button as de, ProgressBar as Ie } from "react-aria-components";
12
- const we = {
13
- Video: "video/*",
14
- Image: "image/*",
15
- Audio: "audio/*",
16
- Document: ".ai, .cdr, .csv, .doc, .docb, .docx, .dot, .dotx, .dwg, .eps, .epub, .fla, .gpx, .ical, .icalendar, .ics, .ifb, .indd, .ipynb, .key, .kml, .kmz, .mobi, .mtf, .mtx, .numbers, .odg, .odp, .ods, .odt, .otp, .ots, .ott, .oxps, .pages, .pdf, .pdn, .pkg, .pot, .potx, .pps, .ppsx, .ppt, .pptx, .psd, .pub, .rtf, .sldx, .txt, .json, .vcf, .xcf, .xls, .xlsx, .xlt, .xltx, .xlw, .xps,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel",
17
- Archive: ".zip, .rar, .tar, .tar.gz, .gz, .gzip, .jar, .7z, .fgz, .webarchive",
18
- Model3D: ".gltf, .glb"
19
- }, Ae = (e) => {
20
- const { actions: r, formId: n } = Fe();
21
- return async (o, i, d) => {
22
- if (!(r != null && r.uploadFile) || !o.length)
23
- return r != null && r.uploadFile || console.error("No uploadFile action"), o.length || console.error("No files to upload"), [];
24
- const x = o.map(({ file: l }) => r.uploadFile({
25
- file: l,
26
- formId: n,
27
- uploadTarget: e
28
- }).then((s) => {
29
- const { id: b, displayName: m, url: c, isPrivate: N } = s, v = {
30
- fileId: b,
31
- displayName: m || l.name,
32
- url: N ? void 0 : c,
33
- fileType: l.type || "application/octet-stream"
34
- };
35
- return i({
36
- file: l,
37
- uploadedFile: v
38
- }), v;
39
- }).catch((s) => {
40
- d(s, l);
41
- }));
42
- return (await Promise.all(x)).filter((l) => l !== void 0);
43
- };
44
- };
45
- function Ze({ valueSliderLimit: e, value: r, explanationText: n, target: o, onChange: i, uploadFileFormats: d, onBlur: x, onFilesCleared: D }) {
46
- const [l, s] = H(ke(r)), [b, m] = H(r || []), [c, N] = H(), v = Ae(o), { t: E } = ie(), k = ge().includes(he.BUTTONS_HOVER), { setFormStatus: y } = xe(), S = V(!1), _ = V(i);
47
- _.current = i;
48
- const C = oe(() => l.some((u) => u.state === "uploading"), [
49
- l
50
- ]);
51
- se(() => {
52
- S.current !== C && (S.current = C, y(o, C ? re.BUSY : re.READY));
53
- }, [
54
- C,
55
- y,
56
- o
57
- ]);
58
- const U = P(() => {
59
- if (!l.length)
60
- return n;
61
- const F = l.filter((u) => u.state === "uploading").length;
62
- if (F) {
63
- const u = l.filter((p) => p.state === "uploaded" && p.file.size > 0).length, g = u / (u + F);
64
- return E("form.file-upload.uploading", {
65
- count: Math.round(g * 100)
66
- });
67
- }
68
- return n || E("form.file-upload.explanation-text", {
69
- count: l.length
70
- });
71
- }, [
72
- l,
73
- n,
74
- E
75
- ]), M = P(async (F) => {
76
- await v(F, ({ file: u, uploadedFile: g }) => {
77
- s((p) => p.map((f) => f.file === u ? {
78
- file: u,
79
- state: "uploaded"
80
- } : f)), m((p) => {
81
- var L;
82
- const f = [
83
- ...p
84
- ].concat(g);
85
- return (L = _.current) == null || L.call(_, f), f;
86
- });
87
- }, (u, g) => {
88
- s((p) => p.map((f) => f.file === g ? {
89
- file: g,
90
- state: "error",
91
- errorMessage: E("form.file-upload.error.upload-failed")
92
- } : f));
93
- });
94
- }, [
95
- v,
96
- E
97
- ]), O = async (F) => {
98
- if (c && N(void 0), F) {
99
- if (l.length + F.length > e) {
100
- N(E("form.file-upload.error.upload-limit", {
101
- limit: e
102
- }));
103
- return;
104
- }
105
- const p = Array.from(F).reduce((f, L) => (l.some((W) => W.file.name === L.name) || f.push({
106
- file: L,
107
- state: "uploading"
108
- }), f), []);
109
- s([
110
- ...l,
111
- ...p
112
- ]), await M(p);
113
- }
114
- }, q = (F) => {
115
- const u = l[F];
116
- if (b && i && u.state !== "error") {
117
- const g = b.filter((f) => f.displayName !== u.file.name);
118
- i(g), m(g);
119
- const p = l.filter((f) => f.file.name !== u.file.name);
120
- s(p), p.length === 0 && D();
121
- } else {
122
- const g = l.filter((p) => p !== u);
123
- s(g), g.length === 0 && D();
124
- }
125
- }, $ = () => {
126
- c && N(void 0), x();
127
- }, K = d.map((F) => we[F]).join(), Q = P(() => {
128
- s([]), m([]);
129
- }, []);
130
- return be(Q), {
131
- files: l,
132
- limitError: c,
133
- hover: k,
134
- getExplanationText: U,
135
- handleChange: O,
136
- handleDelete: q,
137
- accept: K,
138
- handleBlur: $
139
- };
140
- }
141
- function ke(e = []) {
142
- const r = e || [];
143
- try {
144
- return r.map((n) => ({
145
- file: new File([
146
- new Int8Array(0)
147
- ], n.displayName, {
148
- type: n.fileType
149
- }),
150
- state: "uploaded"
151
- }));
152
- } catch (n) {
153
- console.error(n);
154
- }
155
- return [];
156
- }
157
- const me = /* @__PURE__ */ pe(void 0);
158
- function Z() {
159
- const e = fe(me);
160
- if (typeof e > "u")
161
- throw new Error("FileUpload components must be used within FileUpload");
162
- return e;
163
- }
164
- const A = ({ children: e, className: r }) => {
165
- const { ariaDescribedBy: n } = ce(), { disabled: o, hasError: i } = j(), { handleFileChange: d } = Z(), x = h(e, A.Title), D = h(e, A.Subtitle), l = h(e, A.Button);
166
- return /* @__PURE__ */ t.createElement(Re, {
167
- "aria-describedby": n,
168
- className: r,
169
- "data-invalid": i,
170
- isDisabled: o,
171
- onDrop: async (s) => {
172
- const b = [];
173
- for (const m of s.items)
174
- if (m.kind === "file") {
175
- const c = await m.getFile();
176
- c && b.push(c);
177
- }
178
- if (b.length > 0) {
179
- const m = new DataTransfer();
180
- b.forEach((c) => m.items.add(c)), d(m.files);
181
- }
182
- }
183
- }, /* @__PURE__ */ t.createElement(Se, {
184
- slot: "label"
185
- }, x, D), l);
186
- }, Ue = ({ className: e, children: r }) => {
187
- const { limitReached: n } = Z();
188
- return /* @__PURE__ */ t.createElement("p", {
189
- className: e
190
- }, r({
191
- limitReached: n
192
- }));
193
- }, Oe = ({ className: e, children: r }) => {
194
- const { limitReached: n } = Z();
195
- return /* @__PURE__ */ t.createElement("p", {
196
- className: e
197
- }, r({
198
- limitReached: n
199
- }));
200
- }, G = ({ className: e, children: r, "aria-roledescription": n }) => {
201
- const { ariaDescribedBy: o, inputId: i, labelId: d, errorId: x } = ce(), { disabled: D, required: l, onFocus: s, hasError: b, errorMessage: m } = j(), { handleFileChange: c, accept: N, multiple: v, buttonRef: E, handleBlur: R, limitError: k, files: y } = Z(), S = (y == null ? void 0 : y.some((C) => C.errorMessage)) ?? !1, _ = !!(b || m || k || S);
202
- return /* @__PURE__ */ t.createElement(Me, {
203
- acceptedFileTypes: N ? N.split(",") : void 0,
204
- allowsMultiple: v,
205
- onSelect: (C) => {
206
- if (C) {
207
- const U = Array.from(C), M = new DataTransfer();
208
- U.forEach((O) => M.items.add(O)), c(M.files);
209
- }
210
- }
211
- }, /* @__PURE__ */ t.createElement(de, {
212
- ref: E,
213
- id: i,
214
- "aria-labelledby": d,
215
- "aria-describedby": [
216
- o,
217
- x
218
- ].filter(Boolean).join(" "),
219
- render: (C) => /* @__PURE__ */ t.createElement("button", {
220
- ...C,
221
- "aria-roledescription": n,
222
- "aria-invalid": _ || void 0,
223
- "aria-required": l
224
- }),
225
- isDisabled: D,
226
- className: e,
227
- onFocus: s,
228
- onBlur: R
229
- }, r));
230
- }, Pe = ({ className: e }) => {
231
- const { buttonText: r } = j();
232
- return /* @__PURE__ */ t.createElement("span", {
233
- className: e
234
- }, r);
235
- };
236
- G.Text = Pe;
237
- A.Title = Ue;
238
- A.Subtitle = Oe;
239
- A.Button = G;
240
- const T = ({ children: e, className: r, ...n }) => {
241
- const { file: o, index: i } = n, d = o.file.name, x = h(e, T.Name), D = h(e, T.Remove), l = h(e, T.Spinner), s = h(e, T.Error);
242
- return /* @__PURE__ */ t.createElement("div", {
243
- className: r
244
- }, z(x, {
245
- fileName: d
246
- }), o.state === "uploading" ? l : z(D, {
247
- index: i,
248
- fileName: d
249
- }), o.errorMessage && z(s, {
250
- errorMessage: o.errorMessage
251
- }));
252
- }, ze = ({ className: e, ...r }) => {
253
- const { fileName: n } = r;
254
- return /* @__PURE__ */ t.createElement("span", {
255
- className: e
256
- }, n);
257
- }, Ve = ({ className: e, "aria-label": r, children: n, ...o }) => {
258
- const { fileName: i, index: d } = o, { disabled: x } = j(), { handleDelete: D, fileRemoveButtonRefs: l } = Z(), s = V(null);
259
- se(() => {
260
- const m = l.current, c = i;
261
- return m[c] = s, () => {
262
- m[c] === s && (m[c] = void 0);
263
- };
264
- }, [
265
- i,
266
- l
267
- ]);
268
- const b = () => {
269
- D(d);
270
- };
271
- return /* @__PURE__ */ t.createElement(de, {
272
- ref: s,
273
- "aria-disabled": x,
274
- "aria-label": r,
275
- "aria-description": i,
276
- onClick: b,
277
- className: e,
278
- isDisabled: x
279
- }, n);
280
- }, ue = ({ className: e, children: r, ...n }) => {
281
- const { errorMessage: o } = n;
282
- return o ? /* @__PURE__ */ t.createElement(ye, {
283
- value: o
284
- }, /* @__PURE__ */ t.createElement("div", {
285
- className: e,
286
- role: "alert"
287
- }, r)) : null;
288
- }, je = ({ className: e, "aria-label": r, children: n }) => /* @__PURE__ */ t.createElement(Ie, {
289
- "aria-label": r,
290
- className: e,
291
- isIndeterminate: !0
292
- }, n);
293
- T.Name = ze;
294
- T.Remove = Ve;
295
- T.Spinner = je;
296
- T.Error = ue;
297
- ue.Text = ve;
298
- const X = ({ children: e, className: r }) => {
299
- const { files: n } = Z(), o = h(e, X.File);
300
- return !n || n.length === 0 ? null : /* @__PURE__ */ t.createElement("div", {
301
- className: r
302
- }, n.map((i, d) => z(o, {
303
- key: i.file.name || d,
304
- file: i,
305
- index: d
306
- })));
307
- };
308
- X.File = T;
309
- const J = (e) => e.file.name, a = ({ children: e }) => {
310
- const { id: r, value: n, onChange: o, uploadFileFormats: i, valueSliderLimit: d, target: x, explanationText: D, onBlur: l, hasError: s, errorMessage: b, FieldLayout: m } = j(), c = V(null), N = V({}), v = P(() => {
311
- var L;
312
- (L = c.current) == null || L.focus();
313
- }, []), { files: E, limitError: R, hover: k, getExplanationText: y, handleBlur: S, handleChange: _, handleDelete: C, accept: U } = Ze({
314
- valueSliderLimit: d,
315
- value: n,
316
- explanationText: D,
317
- target: x,
318
- onChange: o,
319
- uploadFileFormats: i,
320
- onBlur: l,
321
- onFilesCleared: v
322
- }), M = P((L) => {
323
- var te;
324
- const ee = E[L], W = J(ee);
325
- E.length > 1 && ((te = (E.filter((Y) => J(Y) !== W).map((Y) => N.current[J(Y)]).find(Boolean) ?? c).current) == null || te.focus()), C(L);
326
- }, [
327
- C,
328
- E
329
- ]), O = d > 1, q = E.length >= d, $ = oe(() => ({
330
- handleFileChange: _,
331
- handleBlur: S,
332
- handleDelete: M,
333
- files: E,
334
- accept: U,
335
- limitReached: q,
336
- multiple: O,
337
- getExplanationText: y,
338
- hover: k,
339
- limitError: R,
340
- buttonRef: c,
341
- fileRemoveButtonRefs: N
342
- }), [
343
- _,
344
- S,
345
- M,
346
- E,
347
- U,
348
- q,
349
- O,
350
- y,
351
- k,
352
- R
353
- ]), K = h(e, a.Label), Q = h(e, a.DropZone), F = h(e, a.Button), u = h(e, a.Explanation), g = h(e, a.Files), p = h(e, a.Description), f = h(e, a.Error);
354
- return Ce(() => {
355
- var L;
356
- (L = c.current) == null || L.focus();
357
- }, r), /* @__PURE__ */ t.createElement(me.Provider, {
358
- value: $
359
- }, /* @__PURE__ */ t.createElement(m, {
360
- fieldId: r,
361
- renderLabel: () => K,
362
- renderInput: () => Q ?? F,
363
- renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, z(f, {
364
- hasError: !!(s || R),
365
- errorMessage: R ?? b
366
- }), p, u, g)
367
- }));
368
- }, qe = ({ className: e }) => {
369
- const { getExplanationText: r } = Z(), n = r();
370
- return n ? /* @__PURE__ */ t.createElement("p", {
371
- className: e
372
- }, n) : null;
373
- };
374
- a.Label = Be;
375
- a.DropZone = A;
376
- a.Button = G;
377
- a.Explanation = qe;
378
- a.Files = X;
379
- a.Description = _e;
380
- a.Error = Te;
381
- const $e = (e) => /* @__PURE__ */ t.createElement("svg", {
382
- viewBox: "0 0 24 24",
383
- width: 24,
384
- height: 24,
385
- fill: "currentColor",
386
- "aria-hidden": "true",
387
- ...e
388
- }, /* @__PURE__ */ t.createElement("path", {
389
- d: "M12 12 12 6 11 6 11 12 5 12 5 13 11 13 11 19 12 19 12 13 18 13 18 12z"
390
- })), Ke = (e) => /* @__PURE__ */ t.createElement("svg", {
391
- viewBox: "0 0 24 24",
392
- width: 24,
393
- height: 24,
394
- fill: "currentColor",
395
- "aria-hidden": "true",
396
- ...e
397
- }, /* @__PURE__ */ t.createElement("path", {
398
- d: "M12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 Z M12,20 C16.418278,20 20,16.418278 20,12 C20,7.581722 16.418278,4 12,4 C7.581722,4 4,7.581722 4,12 C4,16.418278 7.581722,20 12,20 Z M12.7287834,7.27532214 C12.9203342,7.46687299 13.0199347,7.73174979 13.0020527,8.00205275 L13.0020527,12.0020527 C13.0199347,12.2723557 12.9203342,12.5372325 12.7287834,12.7287834 C12.5372325,12.9203342 12.2723557,13.0199347 12.0020527,13.0020527 C11.7317498,13.0199347 11.466873,12.9203342 11.2753221,12.7287834 C11.0837713,12.5372325 10.9841708,12.2723557 11.0020527,12.0020527 L11.0020527,8.00205275 C10.9841708,7.73174979 11.0837713,7.46687299 11.2753221,7.27532214 C11.466873,7.08377129 11.7317498,6.98417081 12.0020527,7.00205275 C12.2723557,6.98417081 12.5372325,7.08377129 12.7287834,7.27532214 Z M12.7287834,15.2753221 C12.9203342,15.466873 13.0199347,15.7317498 13.0020527,16.0020527 C13.0199347,16.2723557 12.9203342,16.5372325 12.7287834,16.7287834 C12.5372325,16.9203342 12.2723557,17.0199347 12.0020527,17.0020527 C11.7317498,17.0199347 11.466873,16.9203342 11.2753221,16.7287834 C11.0837713,16.5372325 10.9841708,16.2723557 11.0020527,16.0020527 C10.9841708,15.7317498 11.0837713,15.466873 11.2753221,15.2753221 C11.466873,15.0837713 11.7317498,14.9841708 12.0020527,15.0020527 C12.2723557,14.9841708 12.5372325,15.0837713 12.7287834,15.2753221 Z"
399
- })), Qe = (e) => /* @__PURE__ */ t.createElement("svg", {
400
- viewBox: "0 0 24 24",
401
- width: 24,
402
- height: 24,
403
- fill: "currentColor",
404
- "aria-hidden": "true",
405
- ...e
406
- }, /* @__PURE__ */ t.createElement("path", {
407
- d: "M17,17 C17,18.6568542 15.6568542,20 14,20 L9,20 C7.34314575,20 6,18.6568542 6,17 L6,7 L5,7 L5,6 L18,6 L18,7 L17,7 L17,17 Z M9,9 L10,9 L10,16 L9,16 L9,9 Z M11,9 L12,9 L12,16 L11,16 L11,9 Z M13,9 L14,9 L14,16 L13,16 L13,9 Z M7,17 C7,18.1045695 7.8954305,19 9,19 L14,19 C15.1045695,19 16,18.1045695 16,17 L16,7 L7,7 L7,17 Z M13,6 L13,5 L10,5 L10,6 L9,6 L9,5 C9,4.44771525 9.44771525,4 10,4 L13,4 C13.5522847,4 14,4.44771525 14,5 L14,6 L13,6 Z"
408
- })), We = () => {
409
- const r = "calc(50% - 2px)";
410
- return /* @__PURE__ */ t.createElement("svg", {
411
- fill: "none",
412
- width: "100%",
413
- height: "100%",
414
- viewBox: "0 0 32 32"
415
- }, /* @__PURE__ */ t.createElement("circle", {
416
- cx: "50%",
417
- cy: "50%",
418
- r
419
- }), /* @__PURE__ */ t.createElement("circle", {
420
- cx: "50%",
421
- cy: "50%",
422
- r,
423
- // Normalize the path length to 100 so we can easily set stroke-dashoffset to a fixed arc.
424
- pathLength: "100",
425
- // Add extra gap between dashes so the arc reads correctly in Chrome.
426
- strokeDasharray: "100 200",
427
- strokeDashoffset: 75,
428
- strokeLinecap: "round",
429
- style: {
430
- rotate: "-90deg",
431
- transformOrigin: "center center"
432
- }
433
- }, /* @__PURE__ */ t.createElement("animateTransform", {
434
- attributeName: "transform",
435
- type: "rotate",
436
- dur: "0.75s",
437
- values: "0;360",
438
- repeatCount: "indefinite"
439
- })));
440
- }, Ye = "_explanation_16me0_1", He = "_files_16me0_5", Je = "_file_16me0_5", Ge = "_fileName_16me0_24", Xe = "_removeButton_16me0_32", et = "_spinner_16me0_72", tt = "_fileError_16me0_88", w = {
441
- explanation: Ye,
442
- files: He,
443
- file: Je,
444
- fileName: Ge,
445
- removeButton: Xe,
446
- spinner: et,
447
- fileError: tt
448
- }, rt = ({ content: e, locale: r }) => /* @__PURE__ */ t.createElement(Ee, {
449
- content: e,
450
- locale: r
451
- }), nt = () => {
452
- const { t: e } = ie();
453
- return /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(a.Label, {
454
- className: B(ne, I.label)
455
- }, /* @__PURE__ */ t.createElement(a.Label.Required, {
456
- className: B(De, I.requiredMark)
457
- })), /* @__PURE__ */ t.createElement(a.Button, {
458
- className: B(Ne, I.uploadButton),
459
- "aria-roledescription": e("file-upload.aria-roledescription")
460
- }, /* @__PURE__ */ t.createElement($e, null), /* @__PURE__ */ t.createElement(a.Button.Text, null)), /* @__PURE__ */ t.createElement(a.Explanation, {
461
- className: B(le, I.description, w.explanation)
462
- }), /* @__PURE__ */ t.createElement(a.Files, {
463
- className: B(ne, w.files)
464
- }, /* @__PURE__ */ t.createElement(a.Files.File, {
465
- className: w.file
466
- }, /* @__PURE__ */ t.createElement(a.Files.File.Name, {
467
- className: w.fileName
468
- }), /* @__PURE__ */ t.createElement(a.Files.File.Spinner, {
469
- className: w.spinner,
470
- "aria-label": e("file-upload.file.uploading-spinner.aria-label")
471
- }, /* @__PURE__ */ t.createElement(We, null)), /* @__PURE__ */ t.createElement(a.Files.File.Remove, {
472
- className: w.removeButton,
473
- "aria-label": e("file-upload.delete-file.aria-label")
474
- }, /* @__PURE__ */ t.createElement(Qe, null)), /* @__PURE__ */ t.createElement(a.Files.File.Error, {
475
- className: B(ae, I.error, w.fileError)
476
- }, /* @__PURE__ */ t.createElement(Ke, null), /* @__PURE__ */ t.createElement(a.Files.File.Error.Text, null)))), /* @__PURE__ */ t.createElement(a.Description, {
477
- className: B(le, I.description)
478
- }, rt), /* @__PURE__ */ t.createElement(a.Error, {
479
- className: B(ae, I.error)
480
- }, /* @__PURE__ */ t.createElement(Le, null), /* @__PURE__ */ t.createElement(a.Error.Text, null)));
481
- }, Ft = () => /* @__PURE__ */ t.createElement(nt, null);
482
- export {
483
- Ft as FileUploadRAC
484
- };
@@ -1,62 +0,0 @@
1
- import t, { useMemo as b } from "react";
2
- import { RicosViewer as A } from "@wix/ricos/viewer";
3
- import u from "classnames";
4
- import { ak as C, ac as I, ah as P } from "./form-DQauhsho.js";
5
- import { f as c, a as O } from "./find-child-C60k4CxG.js";
6
- import { f as S } from "./format-currency-BwShJ9vM.js";
7
- import { D as x, E as N } from "./field-error-headless-D3-1L5sf.js";
8
- import { L as R } from "./field-label-headless-Du4ckIVy.js";
9
- import { s as L } from "./field-rac.module-B4l_0KRU.js";
10
- import { v, w as M, j as g } from "./form-element-classes-bLFmhsKw.js";
11
- const e = ({ children: r }) => {
12
- var p;
13
- const { id: n, validation: a, FieldLayout: l } = C(), { currency: o, regionalFormat: m } = I(), s = b(() => {
14
- var d, E, f;
15
- return (f = (E = (d = a == null ? void 0 : a.predefined) == null ? void 0 : d.paymentOptions) == null ? void 0 : E.products) == null ? void 0 : f[0];
16
- }, [
17
- a
18
- ]), i = (p = s == null ? void 0 : s.fixedPriceOptions) == null ? void 0 : p.price, y = c(r, e.Label), F = c(r, e.Amount), D = c(r, e.Description), _ = c(r, e.Error);
19
- return /* @__PURE__ */ t.createElement(l, {
20
- fieldId: n,
21
- renderLabel: () => y,
22
- renderInput: () => O(F, {
23
- price: i,
24
- currencyCode: o == null ? void 0 : o.code,
25
- locale: m
26
- }),
27
- renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, _, D)
28
- });
29
- }, B = ({ className: r, ...n }) => {
30
- const { price: a, currencyCode: l, locale: o } = n, { inputId: m, ariaDescribedBy: s } = P(), i = S({
31
- amount: a,
32
- currency: l,
33
- locale: o
34
- });
35
- return /* @__PURE__ */ t.createElement("span", {
36
- id: m,
37
- "aria-describedby": s,
38
- className: r,
39
- "data-hook": "fixed-payment-value"
40
- }, i);
41
- }, T = ({ className: r }) => /* @__PURE__ */ t.createElement(R, {
42
- className: r
43
- }, null);
44
- e.Label = T;
45
- e.Amount = B;
46
- e.Description = x;
47
- e.Error = N;
48
- const V = "_value_c7203_1", k = {
49
- value: V
50
- }, w = ({ content: r, locale: n }) => /* @__PURE__ */ t.createElement(A, {
51
- content: r,
52
- locale: n
53
- }), h = () => /* @__PURE__ */ t.createElement(e, null, /* @__PURE__ */ t.createElement(e.Label, {
54
- className: u(v, L.label)
55
- }), /* @__PURE__ */ t.createElement(e.Amount, {
56
- className: u(M, k.value)
57
- }), /* @__PURE__ */ t.createElement(e.Description, {
58
- className: u(g, L.description)
59
- }, w)), X = () => /* @__PURE__ */ t.createElement(h, null);
60
- export {
61
- X as FixedPaymentRAC
62
- };
@@ -1,137 +0,0 @@
1
- const o = {
2
- RADIO_GROUP: "radioGroup",
3
- CHECKBOX_GROUP: "checkboxGroup",
4
- CHECKBOX: "checkbox",
5
- PRODUCT_LIST: "productList",
6
- TAGS: "tags",
7
- DONATION: "donation",
8
- IMAGE_CHOICE: "imageChoice",
9
- RATINGS: "ratings",
10
- RADIO_GROUP_RADIO_BUTTON: "radioGroupRadioButton",
11
- CHECKBOX_GROUP_INDICATOR: "checkboxGroupIndicator",
12
- CHECKBOX_INDICATOR: "checkboxIndicator",
13
- PRODUCT_LIST_INDICATOR: "productListIndicator",
14
- TAGS_OPTION: "tagsOption",
15
- DONATION_OPTION: "donationOption",
16
- IMAGE_CHOICE_OPTION: "imageChoiceOption",
17
- IMAGE_CHOICE_OPTION_IMAGE: "imageChoiceOptionImage",
18
- RATING_OPTION: "ratingOption",
19
- TIME_SLOT: "timeSlot",
20
- TEXT_INPUT: "textInput",
21
- POPOVER: "popover",
22
- DROPDOWN_OPTION: "dropdownOption"
23
- }, e = "form-field-label", _ = "form-field-required-indicator", O = "form-field-description", t = "form-field-error", i = "form-field-input", r = "form-field-upload-button", I = "form-field-popover", s = "form-field-dropdown-trigger", n = {
24
- key: o.DROPDOWN_OPTION,
25
- parent: o.POPOVER,
26
- base: "form-field-dropdown-option",
27
- selected: "form-field-dropdown-option--selected",
28
- hover: "form-field-dropdown-option--hover"
29
- }, c = "form-field-suggestion", d = "form-field-option-label", a = "form-field-radio-group", f = "form-field-radio-group-option-label", R = {
30
- key: o.RADIO_GROUP_RADIO_BUTTON,
31
- parent: o.RADIO_GROUP,
32
- base: "form-field-radio-group-radio-button",
33
- selected: "form-field-radio-group-radio-button--selected",
34
- hover: "form-field-radio-group-radio-button--hover"
35
- }, T = "form-field-checkbox-group", E = "form-field-checkbox-group-option-label", C = {
36
- key: o.CHECKBOX_GROUP_INDICATOR,
37
- parent: o.CHECKBOX_GROUP,
38
- base: "form-field-checkbox-group-indicator",
39
- selected: "form-field-checkbox-group-indicator--selected",
40
- hover: "form-field-checkbox-group-indicator--hover"
41
- }, l = "form-field-checkbox", L = "form-field-checkbox-label", S = {
42
- key: o.CHECKBOX_INDICATOR,
43
- parent: o.CHECKBOX,
44
- base: "form-field-checkbox-indicator",
45
- selected: "form-field-checkbox-indicator--selected",
46
- hover: "form-field-checkbox-indicator--hover"
47
- }, A = "form-field-product-list", D = "form-field-product-list-product-name", F = "form-field-product-list-price", m = {
48
- key: o.PRODUCT_LIST_INDICATOR,
49
- parent: o.PRODUCT_LIST,
50
- base: "form-field-product-list-indicator",
51
- selected: "form-field-product-list-indicator--selected",
52
- hover: "form-field-product-list-indicator--hover"
53
- }, N = "form-field-tags", p = {
54
- key: o.TAGS_OPTION,
55
- parent: o.TAGS,
56
- base: "form-field-tags-option",
57
- selected: "form-field-tags-option--selected",
58
- hover: "form-field-tags-option--hover"
59
- }, M = "form-field-donation", P = {
60
- key: o.DONATION_OPTION,
61
- parent: o.DONATION,
62
- base: "form-field-donation-option",
63
- selected: "form-field-donation-option--selected",
64
- hover: "form-field-donation-option--hover"
65
- }, h = "form-field-image-choice", b = {
66
- key: o.IMAGE_CHOICE_OPTION,
67
- parent: o.IMAGE_CHOICE,
68
- base: "form-field-image-choice-option",
69
- selected: "form-field-image-choice-option--selected",
70
- hover: "form-field-image-choice-option--hover"
71
- }, u = "form-field-image-choice-option-image", G = {
72
- key: o.TIME_SLOT,
73
- base: "form-field-time-slot",
74
- selected: "form-field-time-slot--selected",
75
- hover: "form-field-time-slot--hover"
76
- }, U = {
77
- key: o.TEXT_INPUT,
78
- base: "form-field-text-input",
79
- hover: "form-field-text-input--hover"
80
- }, g = "form-field-info-banner", B = "form-field-calendar", k = "form-field-date-picker-calendar", v = "form-field-date-title", H = "form-field-info-text", x = "form-field-ratings", X = {
81
- key: o.RATING_OPTION,
82
- parent: o.RATINGS,
83
- base: "form-field-rating-option",
84
- selected: "form-field-rating-option--selected",
85
- hover: "form-field-rating-option--hover"
86
- }, K = "form-field-show-more-button", y = "form-rich-content", w = "form-submit-button", W = "form-submit-button-label", V = "animated-icon", q = "form-submit-button-icon", Q = "form-next-button", j = "form-previous-button";
87
- export {
88
- V as A,
89
- F as B,
90
- D as C,
91
- a as D,
92
- f as E,
93
- o as F,
94
- R as G,
95
- x as H,
96
- X as I,
97
- _ as J,
98
- K,
99
- c as L,
100
- N as M,
101
- p as N,
102
- U as O,
103
- G as P,
104
- r as Q,
105
- Q as R,
106
- j as S,
107
- y as T,
108
- w as U,
109
- q as V,
110
- W,
111
- B as a,
112
- l as b,
113
- T as c,
114
- C as d,
115
- E as e,
116
- S as f,
117
- L as g,
118
- k as h,
119
- v as i,
120
- O as j,
121
- M as k,
122
- P as l,
123
- n as m,
124
- s as n,
125
- t as o,
126
- h as p,
127
- b as q,
128
- u as r,
129
- g as s,
130
- H as t,
131
- i as u,
132
- e as v,
133
- d as w,
134
- I as x,
135
- A as y,
136
- m as z
137
- };