@wix/form-elements 1.147.0 → 1.148.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 (112) hide show
  1. package/dist/component/{appointment-rac-BG5-bIZU.js → appointment-rac-BNqXl3dq.js} +93 -89
  2. package/dist/component/{bookings-address-rac-8e8PqKsp.js → bookings-address-rac-DzLf588z.js} +1 -1
  3. package/dist/component/{bookings-email-rac-CtlnU8ws.js → bookings-email-rac-BCNWH7ss.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-CrivNlXM.js → bookings-first-name-rac-D36aHUOJ.js} +1 -1
  5. package/dist/component/{bookings-header-rac-DWDAjfqq.js → bookings-header-rac-CNr2y2ES.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-qAthWem2.js → bookings-last-name-rac-yHE6ZIxr.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-BNyUDqlM.js → bookings-login-bar-rac-C3weOc1i.js} +1 -1
  8. package/dist/component/{bookings-phone-rac-Tc39XLr7.js → bookings-phone-rac-CIo_ApRf.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-CPNaPtFK.js → bookings-rich-text-rac-rgKnvt57.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-DEa78Tpf.js → checkbox-field-rac-CMaVxLNe.js} +9 -7
  11. package/dist/component/{checkbox-group-field-headless-BxBaMg29.js → checkbox-group-field-headless-XPtqS8Km.js} +3 -3
  12. package/dist/component/{checkbox-group-field-rac-CRRP03Qk.js → checkbox-group-field-rac-C_58XfQt.js} +6 -6
  13. package/dist/component/{checkbox-group-rac-TOofMGl3.js → checkbox-group-rac-FQrWViSh.js} +1 -1
  14. package/dist/component/{checkbox-indicator-module-classes-6173wvuW.js → checkbox-indicator-module-classes-akWZsZNn.js} +1 -1
  15. package/dist/component/{checkbox-rac-CHMHr8Ry.js → checkbox-rac-C5Lj2b1N.js} +1 -1
  16. package/dist/component/{contacts-address-rac-Bc5yDvTL.js → contacts-address-rac-OhpLzD0X.js} +1 -1
  17. package/dist/component/{contacts-birthdate-rac-Ubtg5ncv.js → contacts-birthdate-rac-Dnqq84ct.js} +1 -1
  18. package/dist/component/{contacts-company-rac-BksH9IoV.js → contacts-company-rac-DMnTF55t.js} +1 -1
  19. package/dist/component/{contacts-email-rac-DDPEtMAm.js → contacts-email-rac-DmZhScW2.js} +1 -1
  20. package/dist/component/{contacts-first-name-rac-DUlCvEdx.js → contacts-first-name-rac-B6A4fuzK.js} +1 -1
  21. package/dist/component/{contacts-last-name-rac-BikqNgUr.js → contacts-last-name-rac-DVz97lew.js} +1 -1
  22. package/dist/component/{contacts-phone-rac-B4OEgM_8.js → contacts-phone-rac-DV8aO0uS.js} +1 -1
  23. package/dist/component/{contacts-position-rac-BfybzySV.js → contacts-position-rac-BP_yBIE4.js} +1 -1
  24. package/dist/component/{contacts-subscribe-rac-CMHb33v1.js → contacts-subscribe-rac-wmTprtLf.js} +1 -1
  25. package/dist/component/{contacts-tax-id-rac-C-qEqwO5.js → contacts-tax-id-rac-CUEPBQye.js} +1 -1
  26. package/dist/component/{date-availability-DZ3J3LLm.js → date-availability-BK_0gLRv.js} +1 -1
  27. package/dist/component/{date-input-field-rac-DeL5vuE7.js → date-input-field-rac-BfWPvRnd.js} +75 -69
  28. package/dist/component/{date-input-rac-Di6TQvFf.js → date-input-rac-B7vAMRBX.js} +1 -1
  29. package/dist/component/{date-picker-field-rac-BcdpTkjV.js → date-picker-field-rac-CpDY4EkU.js} +10 -8
  30. package/dist/component/{date-picker-rac-Brne65gr.js → date-picker-rac-BCswaZB1.js} +1 -1
  31. package/dist/component/{date-time-input-field-rac-BtQfAxRp.js → date-time-input-field-rac-D9w4eEa0.js} +115 -109
  32. package/dist/component/{date-time-input-rac-DM_HXiqV.js → date-time-input-rac-_im8-JRC.js} +1 -1
  33. package/dist/component/{dext-checkbox-group-rac-WTVwhGG0.js → dext-checkbox-group-rac-Di7B1Wzv.js} +2 -2
  34. package/dist/component/{dext-checkbox-rac-BR5YwmLQ.js → dext-checkbox-rac-BPendOsP.js} +1 -1
  35. package/dist/component/{dext-date-picker-rac-DvDuRGYi.js → dext-date-picker-rac-_-Ig9Qn6.js} +1 -1
  36. package/dist/component/{dext-date-time-input-rac-C6RgbaVv.js → dext-date-time-input-rac-dKFW87yu.js} +1 -1
  37. package/dist/component/{dext-dropdown-rac-CWjSdcZx.js → dext-dropdown-rac-Cpdpps7P.js} +1 -1
  38. package/dist/component/{dext-email-rac-D-C1gVTq.js → dext-email-rac-D4UmYH5m.js} +1 -1
  39. package/dist/component/{dext-number-input-rac-YKzZS2ZG.js → dext-number-input-rac-DUetGnYJ.js} +1 -1
  40. package/dist/component/{dext-phone-rac-CFZlEH2a.js → dext-phone-rac-Bsz_DAT9.js} +1 -1
  41. package/dist/component/{dext-radio-group-rac-DiH0wIIl.js → dext-radio-group-rac-B_soj2FD.js} +2 -2
  42. package/dist/component/{dext-rating-input-rac-D0s-i0qO.js → dext-rating-input-rac-cm40qt4O.js} +1 -1
  43. package/dist/component/{dext-tags-rac-Br48OQQ5.js → dext-tags-rac-D1ULx6t1.js} +2 -2
  44. package/dist/component/{dext-text-area-rac-6jG8gJ7i.js → dext-text-area-rac-IkL67rHB.js} +1 -1
  45. package/dist/component/{dext-text-input-rac-FAJTCXuf.js → dext-text-input-rac-DsYSTEL2.js} +1 -1
  46. package/dist/component/{dext-url-input-rac-BoMP8sQB.js → dext-url-input-rac-BKvEkpYu.js} +1 -1
  47. package/dist/component/{donation-rac-DNi4p-v5.js → donation-rac-CaCXMa-H.js} +60 -58
  48. package/dist/component/{dropdown-field-headless-7SCC-xOC.js → dropdown-field-headless-DcrQK8mL.js} +29 -27
  49. package/dist/component/{dropdown-field-rac-CMzZh6J6.js → dropdown-field-rac-CuGoz_6I.js} +4 -4
  50. package/dist/component/{dropdown-rac-qeugpHXY.js → dropdown-rac-rIe6ZqaZ.js} +1 -1
  51. package/dist/component/{ecom-address-rac-D8b_L5md.js → ecom-address-rac-DT0rzvvp.js} +1 -1
  52. package/dist/component/{ecom-subscription-checkbox-rac-BnAuR9La.js → ecom-subscription-checkbox-rac-ZfbiME6e.js} +2 -2
  53. package/dist/component/{email-input-field-rac-CunXRyc5.js → email-input-field-rac-8Qn3yskh.js} +4 -4
  54. package/dist/component/{events-repeater-rac-DMjyIOkB.js → events-repeater-rac-DyHrMd3y.js} +12 -8
  55. package/dist/component/{events-rsvp-rac-BsuDPq2K.js → events-rsvp-rac-CoL-euuc.js} +4 -4
  56. package/dist/component/{field-error-headless-E8WjFr_n.js → field-error-headless-RylIeqXr.js} +1 -1
  57. package/dist/component/{field-label-headless-BakLOu5E.js → field-label-headless-d3hZxIEc.js} +1 -1
  58. package/dist/component/field-rac.module-DP0lkkEv.js +25 -0
  59. package/dist/component/{file-upload-rac-Clu_c--0.js → file-upload-rac-rXbabrgc.js} +148 -144
  60. package/dist/component/{fixed-payment-rac-CzAXxsb-.js → fixed-payment-rac-CaR7pXXA.js} +4 -4
  61. package/dist/component/{form-DHAKwnLt.js → form-DhIEC3nB.js} +2251 -2256
  62. package/dist/component/form.css +1 -1
  63. package/dist/component/form.js +1 -1
  64. package/dist/component/{header-field-rac-CwmVpz3r.js → header-field-rac-nELbyGjP.js} +2 -2
  65. package/dist/component/{header-rac-ahkGRjSy.js → header-rac-q80EQNmM.js} +1 -1
  66. package/dist/component/{image-choice-rac-BwxkkdUu.js → image-choice-rac-CLMiTQK0.js} +32 -32
  67. package/dist/component/{index-BQf23zZi.js → index-C-jVrv9Y.js} +4 -4
  68. package/dist/component/{index-BFi_n6B7.js → index-DnLJzPM-.js} +2 -2
  69. package/dist/component/{isObjectLike-DHcMRYYH.js → isObjectLike-Bf577MHV.js} +1 -1
  70. package/dist/component/{multiline-address-field-rac-C6xaqNOk.js → multiline-address-field-rac-BVAv1w9F.js} +106 -88
  71. package/dist/component/{multiline-address-rac-DF4TFuDx.js → multiline-address-rac-qMuUHA9U.js} +1 -1
  72. package/dist/component/{number-input-field-rac-uVJ3SBv2.js → number-input-field-rac-B_vnBWFG.js} +16 -14
  73. package/dist/component/{number-input-rac-D6ERhrSM.js → number-input-rac-BPCIW8Fz.js} +1 -1
  74. package/dist/component/{password-rac-CAiC0ZKl.js → password-rac-D72HG72u.js} +13 -11
  75. package/dist/component/{payment-input-rac-Bu25xvby.js → payment-input-rac-DthVgsAi.js} +13 -11
  76. package/dist/component/{phone-input-field-rac-32qUvCsC.js → phone-input-field-rac-XIPkH8Fb.js} +7 -7
  77. package/dist/component/{phone-rac-mNrpj30q.js → phone-rac-U94fCfer.js} +1 -1
  78. package/dist/component/{product-list-rac-zHdM9rHw.js → product-list-rac-BRMGPyhr.js} +49 -49
  79. package/dist/component/{quiz-radio-group-rac-BaSlT8w3.js → quiz-radio-group-rac-DafNzzgX.js} +1 -1
  80. package/dist/component/radio-button-module-classes-DtFlHID_.js +134 -0
  81. package/dist/component/{radio-group-field-rac-DI0UgTBr.js → radio-group-field-rac-BXrYWjew.js} +5 -5
  82. package/dist/component/{radio-group-rac-D2ESG8J4.js → radio-group-rac-BNyFfQYV.js} +1 -1
  83. package/dist/component/{rating-input-field-rac-BYT2XqOK.js → rating-input-field-rac-KbkiVCZ7.js} +5 -5
  84. package/dist/component/{rating-input-rac-D-5CmVAX.js → rating-input-rac-zT4vPkwP.js} +1 -1
  85. package/dist/component/{rich-content-rac.module-Dp9Advo9.js → rich-content-rac.module-C0OQetct.js} +1 -1
  86. package/dist/component/{rich-text-field-rac-COEUwoXQ.js → rich-text-field-rac-T4NoShC0.js} +2 -2
  87. package/dist/component/{rich-text-rac-CQZLjBQ0.js → rich-text-rac-m6VRCRZu.js} +1 -1
  88. package/dist/component/{service-dropdown-rac-BTtJVFv8.js → service-dropdown-rac-BFwKhL1l.js} +5 -5
  89. package/dist/component/{services-multi-choice-rac-hbY3g0Kb.js → services-multi-choice-rac-DjzcuRWv.js} +7 -7
  90. package/dist/component/{signature-rac-CTCNclwL.js → signature-rac-B1LPKnIw.js} +271 -269
  91. package/dist/component/{submit-button-rac-kKGeVgsG.js → submit-button-rac-Cz3PVtW4.js} +2 -2
  92. package/dist/component/{tags-field-rac-CVf7oQr_.js → tags-field-rac-DzSoL__s.js} +75 -75
  93. package/dist/component/{tags-rac-DiX1_nTT.js → tags-rac-DMYJDrm-.js} +1 -1
  94. package/dist/component/{text-area-field-rac-IhBNXiDl.js → text-area-field-rac-SuMzBm-Q.js} +15 -13
  95. package/dist/component/{text-area-rac-DHevCtFF.js → text-area-rac-C-zmnJgt.js} +1 -1
  96. package/dist/component/{text-input-field-rac-Da3_wTdh.js → text-input-field-rac-BmQlXTK9.js} +4 -4
  97. package/dist/component/text-input-headless-BsrjGTK4.js +47 -0
  98. package/dist/component/{text-input-rac-564LIZ1_.js → text-input-rac-DhQFKG4h.js} +1 -1
  99. package/dist/component/{time-input-rac-p-Nnsxp_.js → time-input-rac-CRZZdbTI.js} +29 -27
  100. package/dist/component/{url-input-field-rac-DjrcpRtm.js → url-input-field-rac-D617Pvsf.js} +20 -18
  101. package/dist/component/{url-input-rac-B3brpyop.js → url-input-rac-CLvxaWZz.js} +1 -1
  102. package/dist/component/{use-dropdown-trigger-class-name-BWTT7ltv.js → use-dropdown-trigger-class-name-C4uqTKFP.js} +4 -4
  103. package/dist/component/{use-element-state-class-name-CUZuhFvZ.js → use-element-state-class-name-DJx-T0zf.js} +1 -1
  104. package/dist/component/{use-hoverable-input-class-name-ugX8-g4E.js → use-hoverable-input-class-name-pwVZXwrY.js} +3 -3
  105. package/dist/component/{use-is-forced-open-dropdown-DUZMvWpk.js → use-is-forced-open-dropdown-DBpm1D-o.js} +1 -1
  106. package/dist/component/{use-service-options-base-hqO9Ev38.js → use-service-options-base-xHeVTve3.js} +1 -1
  107. package/dist/component/use-text-input-class-name-CrEjJ2Z8.js +6 -0
  108. package/package.json +2 -2
  109. package/dist/component/field-rac.module-DfEb7pBp.js +0 -25
  110. package/dist/component/radio-button-module-classes-BdWjkBlX.js +0 -132
  111. package/dist/component/text-input-headless-DcZRRXCp.js +0 -45
  112. package/dist/component/use-text-input-class-name-wp9dzpEy.js +0 -6
@@ -2,14 +2,14 @@ import t, { useState as Y, useRef as k, useMemo as fe, useEffect as ne, useCallb
2
2
  import Le from "@wix/editor-react-components/AnimatedIcon";
3
3
  import { RicosViewer as xe } from "@wix/ricos/viewer";
4
4
  import Z from "classnames";
5
- import { bk as Ce, by as oe, bt as ve, ar as Ne, bw as De, ak as ie, bx as Te, bl as Ee, bo as z, bq as Se, bi as Be, bh as ye, S as Ie, a0 as Re, b as Ze, K as Ae, L as ce, v as ue, I as de, H as me, J as Me, f as te } from "./form-DHAKwnLt.js";
5
+ import { bk as Ce, by as re, bt as ve, ar as Ne, bw as De, ak as ie, bx as Se, bl as Ee, bo as V, bq as Te, bi as Be, bh as ye, S as Ie, a0 as Re, b as Ze, K as Ae, L as ce, v as ue, I as de, H as pe, J as Me, f as te } from "./form-DhIEC3nB.js";
6
6
  import { E as Oe } from "./error-icon-hZxQ6DEy.js";
7
- import { s as $ } from "./field-rac.module-DfEb7pBp.js";
8
- import { u as pe } from "./use-element-state-class-name-CUZuhFvZ.js";
7
+ import { s as $ } from "./field-rac.module-DP0lkkEv.js";
8
+ import { u as me } from "./use-element-state-class-name-DJx-T0zf.js";
9
9
  import { DropZone as Ue, Text as we, FileTrigger as He, Button as Fe, ProgressBar as Pe, VisuallyHidden as ke } from "react-aria-components";
10
10
  import { f as L, a as W } from "./find-child-C60k4CxG.js";
11
- import { b as qe, a as ze, D as Ve, E as Ke } from "./field-error-headless-E8WjFr_n.js";
12
- import { L as je } from "./field-label-headless-BakLOu5E.js";
11
+ import { b as ze, a as Ve, D as qe, E as Ke } from "./field-error-headless-RylIeqXr.js";
12
+ import { L as je } from "./field-label-headless-d3hZxIEc.js";
13
13
  const $e = {
14
14
  Video: "video/*",
15
15
  Image: "image/*",
@@ -18,36 +18,36 @@ const $e = {
18
18
  Archive: ".zip, .rar, .tar, .tar.gz, .gz, .gzip, .jar, .7z, .fgz, .webarchive",
19
19
  Model3D: ".gltf, .glb"
20
20
  }, Ye = (e) => {
21
- const { actions: n, formId: o } = Ce();
21
+ const { actions: n, formId: r } = Ce();
22
22
  return async (l, s, d) => {
23
23
  if (!(n != null && n.uploadFile) || !l.length)
24
24
  return n != null && n.uploadFile || console.error("No uploadFile action"), l.length || console.error("No files to upload"), [];
25
- const E = l.map(({ file: r }) => n.uploadFile({
26
- file: r,
27
- formId: o,
25
+ const E = l.map(({ file: o }) => n.uploadFile({
26
+ file: o,
27
+ formId: r,
28
28
  uploadTarget: e
29
29
  }).then((i) => {
30
- const { id: C, displayName: m, url: p, isPrivate: c } = i, T = {
30
+ const { id: C, displayName: p, url: m, isPrivate: c } = i, S = {
31
31
  fileId: C,
32
- displayName: m || r.name,
33
- url: c ? void 0 : p,
34
- fileType: r.type || "application/octet-stream"
32
+ displayName: p || o.name,
33
+ url: c ? void 0 : m,
34
+ fileType: o.type || "application/octet-stream"
35
35
  };
36
36
  return s({
37
- file: r,
38
- uploadedFile: T
39
- }), T;
37
+ file: o,
38
+ uploadedFile: S
39
+ }), S;
40
40
  }).catch((i) => {
41
- d(i, r);
41
+ d(i, o);
42
42
  }));
43
- return (await Promise.all(E)).filter((r) => r !== void 0);
43
+ return (await Promise.all(E)).filter((o) => o !== void 0);
44
44
  };
45
45
  };
46
- function We({ valueSliderLimit: e, value: n, explanationText: o, target: l, onChange: s, uploadFileFormats: d, onBlur: E, onFilesCleared: x }) {
47
- const [r, i] = Y(Je(n)), [C, m] = Y(n || []), [p, c] = Y(), T = Ye(l), { t: v } = oe(), g = ve().includes(Ne.BUTTONS_HOVER), { setFormStatus: B } = De(), I = k(!1), y = k(s);
46
+ function We({ valueSliderLimit: e, value: n, explanationText: r, target: l, onChange: s, uploadFileFormats: d, onBlur: E, onFilesCleared: x }) {
47
+ const [o, i] = Y(Je(n)), [C, p] = Y(n || []), [m, c] = Y(), S = Ye(l), { t: v } = re(), g = ve().includes(Ne.BUTTONS_HOVER), { setFormStatus: B } = De(), I = k(!1), y = k(s);
48
48
  y.current = s;
49
- const N = fe(() => r.some((f) => f.state === "uploading"), [
50
- r
49
+ const N = fe(() => o.some((f) => f.state === "uploading"), [
50
+ o
51
51
  ]);
52
52
  ne(() => {
53
53
  I.current !== N && (I.current = N, B(l, N ? ie.BUSY : ie.READY));
@@ -57,31 +57,31 @@ function We({ valueSliderLimit: e, value: n, explanationText: o, target: l, onCh
57
57
  l
58
58
  ]);
59
59
  const u = M(() => {
60
- if (!r.length)
60
+ if (!o.length)
61
61
  return;
62
- const h = r.filter((f) => f.state === "uploading").length;
62
+ const h = o.filter((f) => f.state === "uploading").length;
63
63
  if (h) {
64
- const f = r.filter((F) => F.state === "uploaded" && F.file.size > 0).length, _ = f / (f + h);
64
+ const f = o.filter((F) => F.state === "uploaded" && F.file.size > 0).length, _ = f / (f + h);
65
65
  return v("form.file-upload.uploading", {
66
66
  count: Math.round(_ * 100)
67
67
  });
68
68
  }
69
69
  return v("form.file-upload.explanation-text", {
70
- count: r.length
70
+ count: o.length
71
71
  });
72
72
  }, [
73
- r,
73
+ o,
74
74
  v
75
- ]), R = M(() => r.length ? r.some((f) => f.state === "uploading") ? u() : o || u() : o, [
76
- r,
75
+ ]), R = M(() => o.length ? o.some((f) => f.state === "uploading") ? u() : r || u() : r, [
77
76
  o,
77
+ r,
78
78
  u
79
- ]), S = M(async (h) => {
80
- await T(h, ({ file: f, uploadedFile: _ }) => {
79
+ ]), T = M(async (h) => {
80
+ await S(h, ({ file: f, uploadedFile: _ }) => {
81
81
  i((F) => F.map((b) => b.file === f ? {
82
82
  file: f,
83
83
  state: "uploaded"
84
- } : b)), m((F) => {
84
+ } : b)), p((F) => {
85
85
  var w;
86
86
  const b = [
87
87
  ...F
@@ -96,44 +96,44 @@ function We({ valueSliderLimit: e, value: n, explanationText: o, target: l, onCh
96
96
  } : b));
97
97
  });
98
98
  }, [
99
- T,
99
+ S,
100
100
  v
101
101
  ]), K = async (h) => {
102
- if (p && c(void 0), h) {
103
- if (r.length + h.length > e) {
102
+ if (m && c(void 0), h) {
103
+ if (o.length + h.length > e) {
104
104
  c(v("form.file-upload.error.upload-limit", {
105
105
  limit: e
106
106
  }));
107
107
  return;
108
108
  }
109
- const F = Array.from(h).reduce((b, w) => (r.some((H) => H.file.name === w.name) || b.push({
109
+ const F = Array.from(h).reduce((b, w) => (o.some((H) => H.file.name === w.name) || b.push({
110
110
  file: w,
111
111
  state: "uploading"
112
112
  }), b), []);
113
113
  i([
114
- ...r,
114
+ ...o,
115
115
  ...F
116
- ]), await S(F);
116
+ ]), await T(F);
117
117
  }
118
118
  }, U = (h) => {
119
- const f = r[h];
119
+ const f = o[h];
120
120
  if (C && s && f.state !== "error") {
121
121
  const _ = C.filter((b) => b.displayName !== f.file.name);
122
- s(_), m(_);
123
- const F = r.filter((b) => b.file.name !== f.file.name);
122
+ s(_), p(_);
123
+ const F = o.filter((b) => b.file.name !== f.file.name);
124
124
  i(F), F.length === 0 && x();
125
125
  } else {
126
- const _ = r.filter((F) => F !== f);
126
+ const _ = o.filter((F) => F !== f);
127
127
  i(_), _.length === 0 && x();
128
128
  }
129
129
  }, j = () => {
130
- p && c(void 0), E();
130
+ m && c(void 0), E();
131
131
  }, J = d.map((h) => $e[h]).join(), X = M(() => {
132
- i([]), m([]);
132
+ i([]), p([]);
133
133
  }, []);
134
- return Te(X), {
135
- files: r,
136
- limitError: p,
134
+ return Se(X), {
135
+ files: o,
136
+ limitError: m,
137
137
  hover: g,
138
138
  getExplanationText: R,
139
139
  getStatusText: u,
@@ -146,135 +146,135 @@ function We({ valueSliderLimit: e, value: n, explanationText: o, target: l, onCh
146
146
  function Je(e = []) {
147
147
  const n = e || [];
148
148
  try {
149
- return n.map((o) => ({
149
+ return n.map((r) => ({
150
150
  file: new File([
151
151
  new Int8Array(0)
152
- ], o.displayName, {
153
- type: o.fileType
152
+ ], r.displayName, {
153
+ type: r.fileType
154
154
  }),
155
155
  state: "uploaded"
156
156
  }));
157
- } catch (o) {
158
- console.error(o);
157
+ } catch (r) {
158
+ console.error(r);
159
159
  }
160
160
  return [];
161
161
  }
162
162
  const be = /* @__PURE__ */ he(void 0);
163
- function V() {
163
+ function q() {
164
164
  const e = _e(be);
165
165
  if (typeof e > "u")
166
166
  throw new Error("FileUpload components must be used within FileUpload");
167
167
  return e;
168
168
  }
169
- const q = ({ children: e, className: n }) => {
170
- const { ariaDescribedBy: o } = Ee(), { disabled: l, hasError: s } = z(), { handleFileChange: d, limitReached: E } = V();
169
+ const z = ({ children: e, className: n }) => {
170
+ const { ariaDescribedBy: r } = Ee(), { disabled: l, hasError: s } = V(), { handleFileChange: d, limitReached: E } = q();
171
171
  if (E)
172
172
  return null;
173
- const x = L(e, q.Title), r = L(e, q.Subtitle), i = L(e, q.Button);
173
+ const x = L(e, z.Title), o = L(e, z.Subtitle), i = L(e, z.Button);
174
174
  return /* @__PURE__ */ t.createElement(Ue, {
175
- "aria-describedby": o,
175
+ "aria-describedby": r,
176
176
  className: n,
177
177
  "data-invalid": s,
178
178
  isDisabled: l,
179
179
  onDrop: async (C) => {
180
- const m = [];
181
- for (const p of C.items)
182
- if (p.kind === "file") {
183
- const c = await p.getFile();
184
- c && m.push(c);
180
+ const p = [];
181
+ for (const m of C.items)
182
+ if (m.kind === "file") {
183
+ const c = await m.getFile();
184
+ c && p.push(c);
185
185
  }
186
- if (m.length > 0) {
187
- const p = new DataTransfer();
188
- m.forEach((c) => p.items.add(c)), d(p.files);
186
+ if (p.length > 0) {
187
+ const m = new DataTransfer();
188
+ p.forEach((c) => m.items.add(c)), d(m.files);
189
189
  }
190
190
  }
191
191
  }, /* @__PURE__ */ t.createElement(we, {
192
192
  slot: "label"
193
- }, x, r), i);
193
+ }, x, o), i);
194
194
  }, Qe = ({ className: e, children: n }) => {
195
- const { limitReached: o } = V();
195
+ const { limitReached: r } = q();
196
196
  return /* @__PURE__ */ t.createElement("p", {
197
197
  className: e
198
198
  }, n({
199
- limitReached: o
199
+ limitReached: r
200
200
  }));
201
201
  }, Ge = ({ className: e, children: n }) => {
202
- const { limitReached: o } = V(), { explanationText: l } = z();
202
+ const { limitReached: r } = q(), { explanationText: l } = V();
203
203
  return /* @__PURE__ */ t.createElement("p", {
204
204
  className: e
205
205
  }, l || n({
206
- limitReached: o
206
+ limitReached: r
207
207
  }));
208
- }, re = ({ className: e, children: n, "aria-roledescription": o, onHoverStart: l, onHoverEnd: s, onFocusChange: d }) => {
209
- const { ariaDescribedBy: E, inputId: x, labelId: r, errorId: i } = Ee(), { disabled: C, required: m, onFocus: p, hasError: c, errorMessage: T } = z(), { handleFileChange: v, accept: O, multiple: g, buttonRef: B, handleBlur: I, limitError: y, files: N } = V(), u = (N == null ? void 0 : N.some((S) => S.errorMessage)) ?? !1, R = !!(c || T || y || u);
208
+ }, oe = ({ className: e, children: n, "aria-roledescription": r, onHoverStart: l, onHoverEnd: s, onFocusChange: d }) => {
209
+ const { ariaDescribedBy: E, inputId: x, labelId: o, errorId: i } = Ee(), { disabled: C, required: p, onFocus: m, hasError: c, errorMessage: S } = V(), { handleFileChange: v, accept: O, multiple: g, buttonRef: B, handleBlur: I, limitError: y, files: N } = q(), u = (N == null ? void 0 : N.some((T) => T.errorMessage)) ?? !1, R = !!(c || S || y || u);
210
210
  return /* @__PURE__ */ t.createElement(He, {
211
211
  acceptedFileTypes: O ? O.split(",") : void 0,
212
212
  allowsMultiple: g,
213
- onSelect: (S) => {
214
- if (S) {
215
- const K = Array.from(S), U = new DataTransfer();
213
+ onSelect: (T) => {
214
+ if (T) {
215
+ const K = Array.from(T), U = new DataTransfer();
216
216
  K.forEach((j) => U.items.add(j)), v(U.files);
217
217
  }
218
218
  }
219
219
  }, /* @__PURE__ */ t.createElement(Fe, {
220
220
  ref: B,
221
221
  id: x,
222
- "aria-labelledby": r,
222
+ "aria-labelledby": o,
223
223
  "aria-describedby": [
224
224
  E,
225
225
  i
226
226
  ].filter(Boolean).join(" "),
227
- render: (S) => /* @__PURE__ */ t.createElement("button", {
228
- ...S,
229
- "aria-roledescription": o,
227
+ render: (T) => /* @__PURE__ */ t.createElement("button", {
228
+ ...T,
229
+ "aria-roledescription": r,
230
230
  "aria-invalid": R || void 0,
231
- "aria-required": m
231
+ "aria-required": p
232
232
  }),
233
233
  isDisabled: C,
234
234
  className: e,
235
- onFocus: p,
235
+ onFocus: m,
236
236
  onBlur: I,
237
237
  onHoverStart: l,
238
238
  onHoverEnd: s,
239
239
  onFocusChange: d
240
240
  }, n));
241
241
  }, Xe = ({ className: e }) => {
242
- const { buttonText: n } = z();
242
+ const { buttonText: n } = V();
243
243
  return /* @__PURE__ */ t.createElement("span", {
244
244
  className: e
245
245
  }, n);
246
246
  };
247
- re.Text = Xe;
248
- q.Title = Qe;
249
- q.Subtitle = Ge;
250
- q.Button = re;
251
- const A = ({ children: e, className: n, ...o }) => {
252
- const { file: l, index: s } = o, d = l.file.name, E = L(e, A.Name), x = L(e, A.Remove), r = L(e, A.Spinner), i = L(e, A.Error);
247
+ oe.Text = Xe;
248
+ z.Title = Qe;
249
+ z.Subtitle = Ge;
250
+ z.Button = oe;
251
+ const A = ({ children: e, className: n, ...r }) => {
252
+ const { file: l, index: s } = r, d = l.file.name, E = L(e, A.Name), x = L(e, A.Remove), o = L(e, A.Spinner), i = L(e, A.Error);
253
253
  return /* @__PURE__ */ t.createElement("div", {
254
254
  className: n
255
255
  }, W(E, {
256
256
  fileName: d
257
- }), l.state === "uploading" ? r : W(x, {
257
+ }), l.state === "uploading" ? o : W(x, {
258
258
  index: s,
259
259
  fileName: d
260
260
  }), l.errorMessage && W(i, {
261
261
  errorMessage: l.errorMessage
262
262
  }));
263
263
  }, et = ({ className: e, ...n }) => {
264
- const { fileName: o } = n;
264
+ const { fileName: r } = n;
265
265
  return /* @__PURE__ */ t.createElement("span", {
266
266
  className: e
267
- }, o);
268
- }, tt = ({ className: e, "aria-label": n, children: o, ...l }) => {
269
- const { fileName: s, index: d } = l, { disabled: E } = z(), { handleDelete: x, fileRemoveButtonRefs: r } = V(), i = k(null);
267
+ }, r);
268
+ }, tt = ({ className: e, "aria-label": n, children: r, ...l }) => {
269
+ const { fileName: s, index: d } = l, { disabled: E } = V(), { handleDelete: x, fileRemoveButtonRefs: o } = q(), i = k(null);
270
270
  ne(() => {
271
- const m = r.current, p = s;
272
- return m[p] = i, () => {
273
- m[p] === i && (m[p] = void 0);
271
+ const p = o.current, m = s;
272
+ return p[m] = i, () => {
273
+ p[m] === i && (p[m] = void 0);
274
274
  };
275
275
  }, [
276
276
  s,
277
- r
277
+ o
278
278
  ]);
279
279
  const C = () => {
280
280
  x(d);
@@ -287,30 +287,30 @@ const A = ({ children: e, className: n, ...o }) => {
287
287
  onClick: C,
288
288
  className: e,
289
289
  isDisabled: E
290
- }, o);
291
- }, ge = ({ className: e, children: n, ...o }) => {
292
- const { errorMessage: l } = o;
293
- return l ? /* @__PURE__ */ t.createElement(ze, {
290
+ }, r);
291
+ }, ge = ({ className: e, children: n, ...r }) => {
292
+ const { errorMessage: l } = r;
293
+ return l ? /* @__PURE__ */ t.createElement(Ve, {
294
294
  value: l
295
295
  }, /* @__PURE__ */ t.createElement("div", {
296
296
  className: e,
297
297
  role: "alert"
298
298
  }, n)) : null;
299
- }, nt = ({ className: e, "aria-label": n, children: o }) => /* @__PURE__ */ t.createElement(Pe, {
299
+ }, nt = ({ className: e, "aria-label": n, children: r }) => /* @__PURE__ */ t.createElement(Pe, {
300
300
  "aria-label": n,
301
301
  className: e,
302
302
  isIndeterminate: !0
303
- }, o);
303
+ }, r);
304
304
  A.Name = et;
305
305
  A.Remove = tt;
306
306
  A.Spinner = nt;
307
307
  A.Error = ge;
308
- ge.Text = qe;
308
+ ge.Text = ze;
309
309
  const le = ({ children: e, className: n }) => {
310
- const { files: o } = V(), l = L(e, le.File);
311
- return !o || o.length === 0 ? null : /* @__PURE__ */ t.createElement("div", {
310
+ const { files: r } = q(), l = L(e, le.File);
311
+ return !r || r.length === 0 ? null : /* @__PURE__ */ t.createElement("div", {
312
312
  className: n
313
- }, o.map((s, d) => W(l, {
313
+ }, r.map((s, d) => W(l, {
314
314
  key: s.file.name || d,
315
315
  file: s,
316
316
  index: d
@@ -318,12 +318,12 @@ const le = ({ children: e, className: n }) => {
318
318
  };
319
319
  le.File = A;
320
320
  const G = (e) => e.file.name, a = ({ children: e }) => {
321
- const { t: n } = oe(), { id: o, value: l, onChange: s, uploadFileFormats: d, valueSliderLimit: E, target: x, explanationText: r, onBlur: i, hasError: C, errorMessage: m, FieldLayout: p } = z(), c = k(null), T = k({}), v = k(!1), O = M(() => {
321
+ const { t: n } = re(), { id: r, value: l, onChange: s, uploadFileFormats: d, valueSliderLimit: E, target: x, explanationText: o, onBlur: i, hasError: C, errorMessage: p, FieldLayout: m } = V(), c = k(null), S = k({}), v = k(!1), O = M(() => {
322
322
  c.current ? c.current.focus() : v.current = !0;
323
- }, []), { files: g, limitError: B, hover: I, getExplanationText: y, getStatusText: N, handleBlur: u, handleChange: R, handleDelete: S, accept: K } = We({
323
+ }, []), { files: g, limitError: B, hover: I, getExplanationText: y, getStatusText: N, handleBlur: u, handleChange: R, handleDelete: T, accept: K } = We({
324
324
  valueSliderLimit: E,
325
325
  value: l,
326
- explanationText: r,
326
+ explanationText: o,
327
327
  target: x,
328
328
  onChange: s,
329
329
  uploadFileFormats: d,
@@ -332,9 +332,9 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
332
332
  }), U = M((H) => {
333
333
  var se;
334
334
  const Q = g[H], P = G(Q);
335
- g.length > 1 && ((se = (g.filter((ee) => G(ee) !== P).map((ee) => T.current[G(ee)]).find(Boolean) ?? c).current) == null || se.focus()), S(H);
335
+ g.length > 1 && ((se = (g.filter((ee) => G(ee) !== P).map((ee) => S.current[G(ee)]).find(Boolean) ?? c).current) == null || se.focus()), T(H);
336
336
  }, [
337
- S,
337
+ T,
338
338
  g
339
339
  ]);
340
340
  ne(() => {
@@ -355,7 +355,7 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
355
355
  hover: I,
356
356
  limitError: B,
357
357
  buttonRef: c,
358
- fileRemoveButtonRefs: T
358
+ fileRemoveButtonRefs: S
359
359
  }), [
360
360
  R,
361
361
  u,
@@ -369,22 +369,26 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
369
369
  I,
370
370
  B
371
371
  ]), h = L(e, a.Label), f = L(e, a.DropZone), _ = L(e, a.Button), F = L(e, a.Explanation), b = L(e, a.Files), w = L(e, a.Description), ae = L(e, a.Error);
372
- return Se(() => {
372
+ return Te(() => {
373
373
  var H, Q;
374
374
  if (c.current) {
375
- c.current.focus();
375
+ c.current.focus({
376
+ preventScroll: !0
377
+ });
376
378
  return;
377
379
  }
378
- (Q = (H = g.map((P) => T.current[G(P)]).find((P) => P == null ? void 0 : P.current)) == null ? void 0 : H.current) == null || Q.focus();
379
- }, o), /* @__PURE__ */ t.createElement(be.Provider, {
380
+ (Q = (H = g.map((P) => S.current[G(P)]).find((P) => P == null ? void 0 : P.current)) == null ? void 0 : H.current) == null || Q.focus({
381
+ preventScroll: !0
382
+ });
383
+ }, r), /* @__PURE__ */ t.createElement(be.Provider, {
380
384
  value: X
381
- }, /* @__PURE__ */ t.createElement(p, {
382
- fieldId: o,
385
+ }, /* @__PURE__ */ t.createElement(m, {
386
+ fieldId: r,
383
387
  renderLabel: () => h,
384
388
  renderInput: () => f ?? _,
385
389
  renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, W(ae, {
386
390
  hasError: !!(C || B),
387
- errorMessage: B ?? m
391
+ errorMessage: B ?? p
388
392
  }), /* @__PURE__ */ t.createElement(ke, {
389
393
  role: "status",
390
394
  "aria-live": "polite",
@@ -393,20 +397,20 @@ const G = (e) => e.file.name, a = ({ children: e }) => {
393
397
  count: g.length
394
398
  })), F, b, w)
395
399
  }));
396
- }, ot = ({ className: e, showUploadStatusOnly: n }) => {
397
- const { files: o, getExplanationText: l, getStatusText: s } = V(), d = n ? s() : l();
398
- return o.length === 1 || !d ? null : /* @__PURE__ */ t.createElement("p", {
400
+ }, rt = ({ className: e, showUploadStatusOnly: n }) => {
401
+ const { files: r, getExplanationText: l, getStatusText: s } = q(), d = n ? s() : l();
402
+ return r.length === 1 || !d ? null : /* @__PURE__ */ t.createElement("p", {
399
403
  className: e
400
404
  }, d);
401
405
  };
402
406
  a.Label = je;
403
- a.DropZone = q;
404
- a.Button = re;
405
- a.Explanation = ot;
407
+ a.DropZone = z;
408
+ a.Button = oe;
409
+ a.Explanation = rt;
406
410
  a.Files = le;
407
- a.Description = Ve;
411
+ a.Description = qe;
408
412
  a.Error = Ke;
409
- const rt = (e) => /* @__PURE__ */ t.createElement("svg", {
413
+ const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
410
414
  viewBox: "0 0 24 24",
411
415
  width: 24,
412
416
  height: 24,
@@ -465,13 +469,13 @@ const rt = (e) => /* @__PURE__ */ t.createElement("svg", {
465
469
  values: "0;360",
466
470
  repeatCount: "indefinite"
467
471
  })));
468
- }, it = "_dropZone_9tg5q_1", ct = "_dropZoneHover_9tg5q_27", ut = "_dropZoneTitle_9tg5q_52", dt = "_dropZoneSubtitle_9tg5q_57", mt = "_button_9tg5q_61", pt = "_buttonHover_9tg5q_114", ft = "_explanation_9tg5q_131", Et = "_files_9tg5q_135", Ft = "_file_9tg5q_135", bt = "_fileName_9tg5q_185", gt = "_buttonLabel_9tg5q_193", ht = "_removeButton_9tg5q_197", _t = "_spinner_9tg5q_244", Lt = "_fileError_9tg5q_260", D = {
472
+ }, it = "_dropZone_8sprf_1", ct = "_dropZoneHover_8sprf_27", ut = "_dropZoneTitle_8sprf_69", dt = "_dropZoneSubtitle_8sprf_74", pt = "_button_8sprf_78", mt = "_buttonHover_8sprf_131", ft = "_explanation_8sprf_148", Et = "_files_8sprf_152", Ft = "_file_8sprf_152", bt = "_fileName_8sprf_202", gt = "_buttonLabel_8sprf_210", ht = "_removeButton_8sprf_214", _t = "_spinner_8sprf_261", Lt = "_fileError_8sprf_277", D = {
469
473
  dropZone: it,
470
474
  dropZoneHover: ct,
471
475
  dropZoneTitle: ut,
472
476
  dropZoneSubtitle: dt,
473
- button: mt,
474
- buttonHover: pt,
477
+ button: pt,
478
+ buttonHover: mt,
475
479
  explanation: ft,
476
480
  files: Et,
477
481
  file: Ft,
@@ -485,33 +489,33 @@ const rt = (e) => /* @__PURE__ */ t.createElement("svg", {
485
489
  locale: n
486
490
  }), Ct = () => {
487
491
  var B, I, y, N;
488
- const { t: e } = oe(), { disabled: n, readOnly: o } = z(), l = !n && !o, s = pe({
492
+ const { t: e } = re(), { disabled: n, readOnly: r } = V(), l = !n && !r, s = me({
489
493
  globalClasses: de,
490
494
  moduleClasses: {
491
495
  base: D.dropZone,
492
496
  hover: D.dropZoneHover
493
497
  }
494
- }), d = pe({
498
+ }), d = me({
495
499
  globalClasses: Me,
496
500
  moduleClasses: {
497
501
  base: D.button,
498
502
  hover: D.buttonHover
499
503
  }
500
- }), E = (N = (y = (I = (B = Be().fileUpload) == null ? void 0 : B.elementProps) == null ? void 0 : I.uploadButton) == null ? void 0 : y.elementProps) == null ? void 0 : N.icon, { wix: x, className: r, ...i } = E ?? {}, C = ye(te.FILE_UPLOAD, te.UPLOAD_BUTTON, te.UPLOAD_BUTTON_LABEL), m = k(null), [p, c] = Y(!1), [T, v] = Y(!1), O = M(() => {
504
+ }), E = (N = (y = (I = (B = Be().fileUpload) == null ? void 0 : B.elementProps) == null ? void 0 : I.uploadButton) == null ? void 0 : y.elementProps) == null ? void 0 : N.icon, { wix: x, className: o, ...i } = E ?? {}, C = ye(te.FILE_UPLOAD, te.UPLOAD_BUTTON, te.UPLOAD_BUTTON_LABEL), p = k(null), [m, c] = Y(!1), [S, v] = Y(!1), O = M(() => {
501
505
  var u;
502
- c(!0), (u = m.current) == null || u.runAnimationForward();
506
+ c(!0), (u = p.current) == null || u.runAnimationForward();
503
507
  }, []), g = M(() => {
504
508
  var u;
505
- c(!1), (u = m.current) == null || u.runAnimationBackward();
509
+ c(!1), (u = p.current) == null || u.runAnimationBackward();
506
510
  }, []);
507
511
  return /* @__PURE__ */ t.createElement(a, null, /* @__PURE__ */ t.createElement(a.Label, {
508
512
  className: Z(Ie, $.label)
509
513
  }, /* @__PURE__ */ t.createElement(a.Label.Required, {
510
514
  className: Z(Re, $.requiredMark)
511
515
  })), /* @__PURE__ */ t.createElement(a.DropZone, {
512
- className: ({ isHovered: u, isFocused: R, isDropTarget: S }) => s({
516
+ className: ({ isHovered: u, isFocused: R, isDropTarget: T }) => s({
513
517
  isSelected: !1,
514
- isHovered: u || S,
518
+ isHovered: u || T,
515
519
  isFocused: R,
516
520
  isInteractive: l
517
521
  })
@@ -532,11 +536,11 @@ const rt = (e) => /* @__PURE__ */ t.createElement("svg", {
532
536
  onFocusChange: v
533
537
  }, i.svg ? /* @__PURE__ */ t.createElement(Le, {
534
538
  ...i,
535
- ref: m,
536
- className: Z(Ze, Ae, r)
537
- }) : E ? null : /* @__PURE__ */ t.createElement(rt, null), /* @__PURE__ */ t.createElement(a.DropZone.Button.Text, {
539
+ ref: p,
540
+ className: Z(Ze, Ae, o)
541
+ }) : E ? null : /* @__PURE__ */ t.createElement(ot, null), /* @__PURE__ */ t.createElement(a.DropZone.Button.Text, {
538
542
  className: Z(ce.base, D.buttonLabel, C, {
539
- [ce.hover]: l && (p || T)
543
+ [ce.hover]: l && (m || S)
540
544
  })
541
545
  }))), /* @__PURE__ */ t.createElement(a.Explanation, {
542
546
  className: Z(ue, $.description, D.explanation),
@@ -554,11 +558,11 @@ const rt = (e) => /* @__PURE__ */ t.createElement("svg", {
554
558
  className: D.removeButton,
555
559
  "aria-label": e("file-upload.delete-file.aria-label")
556
560
  }, /* @__PURE__ */ t.createElement(at, null)), /* @__PURE__ */ t.createElement(a.Files.File.Error, {
557
- className: Z(me, $.error, D.fileError)
561
+ className: Z(pe, $.error, D.fileError)
558
562
  }, /* @__PURE__ */ t.createElement(lt, null), /* @__PURE__ */ t.createElement(a.Files.File.Error.Text, null)))), /* @__PURE__ */ t.createElement(a.Description, {
559
563
  className: Z(ue, $.description)
560
564
  }, xt), /* @__PURE__ */ t.createElement(a.Error, {
561
- className: Z(me, $.error)
565
+ className: Z(pe, $.error)
562
566
  }, /* @__PURE__ */ t.createElement(Oe, null), /* @__PURE__ */ t.createElement(a.Error.Text, null)));
563
567
  }, Ut = () => /* @__PURE__ */ t.createElement(Ct, null);
564
568
  export {
@@ -1,12 +1,12 @@
1
1
  import t, { useMemo as _ } from "react";
2
2
  import { RicosViewer as A } from "@wix/ricos/viewer";
3
3
  import u from "classnames";
4
- import { bo as C, bg as I, bl as P, S, M as x, v as N } from "./form-DHAKwnLt.js";
4
+ import { bo as C, bg as I, bl as P, S, M as x, v as N } from "./form-DhIEC3nB.js";
5
5
  import { f as c, a as R } from "./find-child-C60k4CxG.js";
6
6
  import { f as O } from "./format-currency-BwShJ9vM.js";
7
- import { D as v, E as M } from "./field-error-headless-E8WjFr_n.js";
8
- import { L as g } from "./field-label-headless-BakLOu5E.js";
9
- import { s as F } from "./field-rac.module-DfEb7pBp.js";
7
+ import { D as v, E as M } from "./field-error-headless-RylIeqXr.js";
8
+ import { L as g } from "./field-label-headless-d3hZxIEc.js";
9
+ import { s as F } from "./field-rac.module-DP0lkkEv.js";
10
10
  const e = ({ children: r }) => {
11
11
  var p;
12
12
  const { id: a, validation: n, FieldLayout: l } = C(), { currency: o, regionalFormat: m } = I(), s = _(() => {