@wix/form-elements 1.133.0 → 1.134.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/component/{appointment-rac-D0mwr3TL.js → appointment-rac-CZHb5jGz.js} +246 -246
  2. package/dist/component/{bookings-address-rac-BEnmwXax.js → bookings-address-rac-F39MfGmX.js} +1 -1
  3. package/dist/component/{bookings-email-rac-D56j9PXc.js → bookings-email-rac-D4CurQjr.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-xu3S-ih_.js → bookings-first-name-rac-Bz9o1eLl.js} +1 -1
  5. package/dist/component/{bookings-header-rac-hfBabv7v.js → bookings-header-rac-6mfX0WGf.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-6bMvN0Cm.js → bookings-last-name-rac-CD1-B7Ao.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-DE70Omwf.js → bookings-login-bar-rac-2eQkfhBb.js} +17 -17
  8. package/dist/component/{bookings-phone-rac-D_EHRAiU.js → bookings-phone-rac-X6sSnHiH.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-BxgI9Zt6.js → bookings-rich-text-rac-f2artJnn.js} +1 -1
  10. package/dist/component/{calendar.module-DnhTT4QT.js → calendar.module-CKCBG_Pg.js} +11 -11
  11. package/dist/component/{checkbox-field-rac-BLDUOAXM.js → checkbox-field-rac-DoZ9bcw3.js} +26 -25
  12. package/dist/component/{checkbox-group-field-headless-CugSJIBp.js → checkbox-group-field-headless-B-d37T4z.js} +32 -31
  13. package/dist/component/{checkbox-group-field-rac-D4m9SmRX.js → checkbox-group-field-rac-0qYHz3g1.js} +6 -6
  14. package/dist/component/{checkbox-group-rac-BYqEsCwa.js → checkbox-group-rac-BqUJdAju.js} +1 -1
  15. package/dist/component/{checkbox-indicator-module-classes-zXKP5rD4.js → checkbox-indicator-module-classes-6173wvuW.js} +1 -1
  16. package/dist/component/{checkbox-rac-DkIBUAN7.js → checkbox-rac-BN-qNzpH.js} +1 -1
  17. package/dist/component/{contacts-address-rac-D1tzbiTM.js → contacts-address-rac-B7vWOTFf.js} +1 -1
  18. package/dist/component/{contacts-birthdate-rac-DO-1xG0u.js → contacts-birthdate-rac-Dl0OatzW.js} +1 -1
  19. package/dist/component/{contacts-company-rac-CzJK3YIo.js → contacts-company-rac-DIeGU0Bf.js} +1 -1
  20. package/dist/component/{contacts-email-rac-DLvMErBI.js → contacts-email-rac-BCH6ogWv.js} +1 -1
  21. package/dist/component/{contacts-first-name-rac-3RcSXL0h.js → contacts-first-name-rac-Cx-USWmx.js} +1 -1
  22. package/dist/component/{contacts-last-name-rac-BYoSi_QX.js → contacts-last-name-rac-CUZdJI9J.js} +1 -1
  23. package/dist/component/{contacts-phone-rac-DMYn0orB.js → contacts-phone-rac-hNCW_2UC.js} +1 -1
  24. package/dist/component/{contacts-position-rac-K1R6ihXo.js → contacts-position-rac-CJfOgxZc.js} +1 -1
  25. package/dist/component/{contacts-subscribe-rac-DsWNSH6t.js → contacts-subscribe-rac-69721_c9.js} +1 -1
  26. package/dist/component/{contacts-tax-id-rac-D7NjPiRf.js → contacts-tax-id-rac-CXXBqWIm.js} +1 -1
  27. package/dist/component/{date-availability-D3n6-g3h.js → date-availability-NQGPIrdZ.js} +1 -1
  28. package/dist/component/{date-input-field-rac-SyAmInlu.js → date-input-field-rac-C-we-suG.js} +60 -60
  29. package/dist/component/{date-input-rac-BQNOsWz1.js → date-input-rac-Cif7Bqxc.js} +1 -1
  30. package/dist/component/{date-picker-field-rac-DO1epod7.js → date-picker-field-rac-CHDkTXVH.js} +63 -63
  31. package/dist/component/{date-picker-rac-DQElftUu.js → date-picker-rac-DdhgbY6W.js} +1 -1
  32. package/dist/component/{date-time-input-field-rac-CV5wZSXO.js → date-time-input-field-rac-BjtDbiqE.js} +7 -7
  33. package/dist/component/{date-time-input-rac-DvHwpjnk.js → date-time-input-rac-BDP5SN-i.js} +1 -1
  34. package/dist/component/{dext-checkbox-group-rac-BfcKoslb.js → dext-checkbox-group-rac-CkF41kIR.js} +2 -2
  35. package/dist/component/{dext-checkbox-rac-DhadtXb5.js → dext-checkbox-rac-DjYpsxmq.js} +1 -1
  36. package/dist/component/{dext-date-picker-rac-0Dmo3mrG.js → dext-date-picker-rac-BxXZLogr.js} +1 -1
  37. package/dist/component/{dext-date-time-input-rac-Cnh7Aqiq.js → dext-date-time-input-rac-e4y_JjEx.js} +1 -1
  38. package/dist/component/{dext-dropdown-rac-CajXcYsB.js → dext-dropdown-rac-DsjB3ZX7.js} +1 -1
  39. package/dist/component/{dext-email-rac-DynJaiZt.js → dext-email-rac-ClPp1g4D.js} +1 -1
  40. package/dist/component/{dext-number-input-rac-LmTKwb80.js → dext-number-input-rac-D2nZNzyN.js} +1 -1
  41. package/dist/component/{dext-phone-rac-Cw2roq1_.js → dext-phone-rac-PNiQZ-Lr.js} +1 -1
  42. package/dist/component/{dext-radio-group-rac-CaNZJrkc.js → dext-radio-group-rac-DUltmMHM.js} +2 -2
  43. package/dist/component/{dext-rating-input-rac-CAL1jb0q.js → dext-rating-input-rac-C_apsfGT.js} +1 -1
  44. package/dist/component/{dext-tags-rac-BOp_amVK.js → dext-tags-rac-DkB_CmOD.js} +2 -2
  45. package/dist/component/{dext-text-area-rac-6DYTHIeh.js → dext-text-area-rac-CfoIK0S7.js} +1 -1
  46. package/dist/component/{dext-text-input-rac-CDWthvV3.js → dext-text-input-rac-CIOXlk6U.js} +1 -1
  47. package/dist/component/{dext-url-input-rac-CsS4NPYO.js → dext-url-input-rac-UHJAs3ck.js} +1 -1
  48. package/dist/component/{donation-rac-B7lFkotu.js → donation-rac-BJfvVi_d.js} +7 -10
  49. package/dist/component/{dropdown-field-headless-ajQghLaj.js → dropdown-field-headless-0DB-T-3t.js} +5 -5
  50. package/dist/component/{dropdown-field-rac-Bf5LQqSL.js → dropdown-field-rac-DB-pd2a8.js} +5 -5
  51. package/dist/component/{dropdown-rac-CJmA_ePl.js → dropdown-rac-4T4zRBVy.js} +1 -1
  52. package/dist/component/{ecom-address-rac-B49ZP2qc.js → ecom-address-rac-BjWD1sRX.js} +1 -1
  53. package/dist/component/{ecom-subscription-checkbox-rac-C8qImtxo.js → ecom-subscription-checkbox-rac-CYCufut6.js} +2 -2
  54. package/dist/component/{email-input-field-rac-B_bEWp5N.js → email-input-field-rac-DlLoY9jB.js} +4 -4
  55. package/dist/component/{events-repeater-rac-DXxqmIBX.js → events-repeater-rac-CPHJbWcZ.js} +48 -47
  56. package/dist/component/{events-rsvp-rac-BaJQLSv3.js → events-rsvp-rac-NXf8Fv3A.js} +4 -4
  57. package/dist/component/{field-error-headless-BxEFPwKI.js → field-error-headless-C-wyL0uw.js} +1 -1
  58. package/dist/component/{field-label-headless-5mewgrhq.js → field-label-headless-32mvEUId.js} +1 -1
  59. package/dist/component/field-rac.module-DfEb7pBp.js +25 -0
  60. package/dist/component/file-upload-rac-BicD_Bhj.js +566 -0
  61. package/dist/component/{fixed-payment-rac-S68bqvbB.js → fixed-payment-rac-DxHalHUv.js} +4 -4
  62. package/dist/component/{form-CPY-PtxT.js → form-B2wZnWX9.js} +69 -69
  63. package/dist/component/form.css +1 -1
  64. package/dist/component/form.js +1 -1
  65. package/dist/component/{header-field-rac-r6dYbnvA.js → header-field-rac-C47Te_oW.js} +2 -2
  66. package/dist/component/{header-rac-C9gaKsaE.js → header-rac-ChDYKTx5.js} +1 -1
  67. package/dist/component/{image-choice-rac-BbES5dAK.js → image-choice-rac-CqTBWpcY.js} +42 -45
  68. package/dist/component/{index-o-TpCHqo.js → index-BF_Aifc-.js} +4 -4
  69. package/dist/component/{index-C6zuIVeJ.js → index-Br8x_xx8.js} +2 -2
  70. package/dist/component/{isObjectLike-BSRiBVs9.js → isObjectLike-D4VXbd0T.js} +1 -1
  71. package/dist/component/{multiline-address-field-rac-BfVIiFyM.js → multiline-address-field-rac-DYcfzGJb.js} +8 -8
  72. package/dist/component/{multiline-address-rac-BOKBExhi.js → multiline-address-rac-DcGDGyL-.js} +1 -1
  73. package/dist/component/{number-input-field-rac-BRKFm8aA.js → number-input-field-rac-C_Fh8oeD.js} +5 -5
  74. package/dist/component/{number-input-rac-BNbCCb-g.js → number-input-rac-J2tCaAYx.js} +1 -1
  75. package/dist/component/{password-rac-BygVJf7f.js → password-rac-wlfBhft8.js} +5 -5
  76. package/dist/component/{payment-input-rac-CoMbHcHG.js → payment-input-rac-DKxy3uE0.js} +5 -5
  77. package/dist/component/{phone-input-field-rac-dFjxptEr.js → phone-input-field-rac-ClXUOLpB.js} +28 -29
  78. package/dist/component/{phone-rac-Dup3AP9J.js → phone-rac-D0-Poz1e.js} +1 -1
  79. package/dist/component/{product-list-rac-B62mNB_W.js → product-list-rac-TF5fgLyc.js} +69 -68
  80. package/dist/component/{quiz-radio-group-rac-DPMhDtr7.js → quiz-radio-group-rac-BX4V_6wg.js} +1 -1
  81. package/dist/component/{radio-button-module-classes-BMvPai_6.js → radio-button-module-classes-D8UpzVUK.js} +18 -17
  82. package/dist/component/{radio-group-field-rac-DPt2Zl4G.js → radio-group-field-rac-C0zCVtjj.js} +5 -5
  83. package/dist/component/{radio-group-rac-BZyGqFzr.js → radio-group-rac-DrKqgPRT.js} +1 -1
  84. package/dist/component/{rating-input-field-rac-C3E0KzV-.js → rating-input-field-rac-DjxfTgv5.js} +35 -33
  85. package/dist/component/{rating-input-rac-BKLz4l_D.js → rating-input-rac-DO4Bpdj3.js} +1 -1
  86. package/dist/component/{rich-content-rac.module-CQ1qa_zz.js → rich-content-rac.module-DUNKiTkT.js} +1 -1
  87. package/dist/component/{rich-text-field-rac-BfdA5KNz.js → rich-text-field-rac-DIOTzVwj.js} +2 -2
  88. package/dist/component/{rich-text-rac-BFbhfFuF.js → rich-text-rac-C_E_vEGz.js} +1 -1
  89. package/dist/component/{service-dropdown-rac-VulpHBki.js → service-dropdown-rac-B3gQT9Tj.js} +6 -6
  90. package/dist/component/{services-multi-choice-rac-CIx5UpfD.js → services-multi-choice-rac-D40hZhBB.js} +7 -7
  91. package/dist/component/{signature-rac-BdxMBfl9.js → signature-rac-CKXpb2WN.js} +269 -264
  92. package/dist/component/{submit-button-rac-CkuWGEyL.js → submit-button-rac-CDS-vtXq.js} +2 -2
  93. package/dist/component/{tags-field-rac-DKo_Yb5i.js → tags-field-rac-CdQWq8k5.js} +54 -57
  94. package/dist/component/{tags-rac-BimVd3ym.js → tags-rac-BwChqdGx.js} +1 -1
  95. package/dist/component/{text-area-field-rac-DEiLtCnb.js → text-area-field-rac-VCFJuHx4.js} +5 -5
  96. package/dist/component/{text-area-rac-CHZtsq0f.js → text-area-rac-BICVNsdn.js} +1 -1
  97. package/dist/component/{text-input-field-rac-CSHvUtRG.js → text-input-field-rac-C9gyRhcK.js} +4 -4
  98. package/dist/component/{text-input-headless-BYcExFPS.js → text-input-headless-BdkaD-re.js} +3 -3
  99. package/dist/component/{text-input-rac-D-R9btYo.js → text-input-rac-B7buOGbq.js} +1 -1
  100. package/dist/component/{time-input-rac-wkHemVzj.js → time-input-rac-CSFhEYi0.js} +5 -5
  101. package/dist/component/{url-input-field-rac-KJEcLyFk.js → url-input-field-rac-BIXokgHy.js} +5 -5
  102. package/dist/component/{url-input-rac-JFfEH389.js → url-input-rac-tTN0GaTH.js} +1 -1
  103. package/dist/component/{use-dropdown-option-class-name-BetaTWbW.js → use-dropdown-option-class-name-C6zB6TNA.js} +3 -3
  104. package/dist/component/{use-dropdown-trigger-class-name-C0ffAjFn.js → use-dropdown-trigger-class-name-CEq68SuK.js} +2 -2
  105. package/dist/component/use-element-state-class-name-BFZzVwqe.js +23 -0
  106. package/dist/component/use-hoverable-input-class-name-CzZmczhf.js +25 -0
  107. package/dist/component/{use-service-options-base-q0JTA7UI.js → use-service-options-base-DOCVW9ax.js} +1 -1
  108. package/dist/component/use-text-input-class-name-BNX3qkmh.js +6 -0
  109. package/package.json +2 -2
  110. package/dist/component/field-rac.module-BGN-O8tV.js +0 -25
  111. package/dist/component/file-upload-rac-D9Z1Cumr.js +0 -562
  112. package/dist/component/use-element-state-class-name-BOks3she.js +0 -20
  113. package/dist/component/use-hoverable-input-class-name-jxtCw16L.js +0 -23
  114. package/dist/component/use-text-input-class-name-CTa0bC4T.js +0 -6
@@ -1,562 +0,0 @@
1
- import t, { useState as J, useRef as H, useMemo as fe, useEffect as re, useCallback as M, createContext as he, useContext as _e } from "react";
2
- import Le from "@wix/editor-react-components/AnimatedIcon";
3
- import { RicosViewer as xe } from "@wix/ricos/viewer";
4
- import R from "classnames";
5
- import { bd as Ce, br as ne, bm as Ne, ak as ve, bp as De, ad as ie, bq as Te, be as Ee, bh as z, bj as Se, bb as Be, ba as ye, I as Ze, U as Re, b as Ae, a8 as Me, a9 as ce, p as de, u as ue, v as me, a7 as Ie, f as te } from "./form-CPY-PtxT.js";
6
- import { E as Oe } from "./error-icon-hZxQ6DEy.js";
7
- import { s as K } from "./field-rac.module-BGN-O8tV.js";
8
- import { u as pe } from "./use-element-state-class-name-BOks3she.js";
9
- import { DropZone as we, Text as Ue, FileTrigger as Pe, Button as be, ProgressBar as He, VisuallyHidden as ke } from "react-aria-components";
10
- import { f as x, a as $ } from "./find-child-C60k4CxG.js";
11
- import { b as ze, a as Ve, D as je, E as qe } from "./field-error-headless-BxEFPwKI.js";
12
- import { L as Ke } from "./field-label-headless-5mewgrhq.js";
13
- const $e = {
14
- Video: "video/*",
15
- Image: "image/*",
16
- Audio: "audio/*",
17
- 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",
18
- Archive: ".zip, .rar, .tar, .tar.gz, .gz, .gzip, .jar, .7z, .fgz, .webarchive",
19
- Model3D: ".gltf, .glb"
20
- }, Ye = (e) => {
21
- const { actions: r, formId: n } = Ce();
22
- return async (a, s, u) => {
23
- if (!(r != null && r.uploadFile) || !a.length)
24
- return r != null && r.uploadFile || console.error("No uploadFile action"), a.length || console.error("No files to upload"), [];
25
- const E = a.map(({ file: o }) => r.uploadFile({
26
- file: o,
27
- formId: n,
28
- uploadTarget: e
29
- }).then((i) => {
30
- const { id: N, displayName: m, url: p, isPrivate: d } = i, D = {
31
- fileId: N,
32
- displayName: m || o.name,
33
- url: d ? void 0 : p,
34
- fileType: o.type || "application/octet-stream"
35
- };
36
- return s({
37
- file: o,
38
- uploadedFile: D
39
- }), D;
40
- }).catch((i) => {
41
- u(i, o);
42
- }));
43
- return (await Promise.all(E)).filter((o) => o !== void 0);
44
- };
45
- };
46
- function We({ valueSliderLimit: e, value: r, explanationText: n, target: a, onChange: s, uploadFileFormats: u, onBlur: E, onFilesCleared: C }) {
47
- const [o, i] = J(Qe(r)), [N, m] = J(r || []), [p, d] = J(), D = Ye(a), { t: _ } = ne(), F = Ne().includes(ve.BUTTONS_HOVER), { setFormStatus: T } = De(), y = H(!1), c = H(s);
48
- c.current = s;
49
- const S = fe(() => o.some((f) => f.state === "uploading"), [
50
- o
51
- ]);
52
- re(() => {
53
- y.current !== S && (y.current = S, T(a, S ? ie.BUSY : ie.READY));
54
- }, [
55
- S,
56
- T,
57
- a
58
- ]);
59
- const Z = M(() => {
60
- if (!o.length)
61
- return;
62
- const h = o.filter((f) => f.state === "uploading").length;
63
- if (h) {
64
- const f = o.filter((b) => b.state === "uploaded" && b.file.size > 0).length, L = f / (f + h);
65
- return _("form.file-upload.uploading", {
66
- count: Math.round(L * 100)
67
- });
68
- }
69
- return _("form.file-upload.explanation-text", {
70
- count: o.length
71
- });
72
- }, [
73
- o,
74
- _
75
- ]), B = M(() => o.length ? o.some((f) => f.state === "uploading") ? Z() : n || Z() : n, [
76
- o,
77
- n,
78
- Z
79
- ]), j = M(async (h) => {
80
- await D(h, ({ file: f, uploadedFile: L }) => {
81
- i((b) => b.map((g) => g.file === f ? {
82
- file: f,
83
- state: "uploaded"
84
- } : g)), m((b) => {
85
- var w;
86
- const g = [
87
- ...b
88
- ].concat(L);
89
- return (w = c.current) == null || w.call(c, g), g;
90
- });
91
- }, (f, L) => {
92
- i((b) => b.map((g) => g.file === L ? {
93
- file: L,
94
- state: "error",
95
- errorMessage: _("form.file-upload.error.upload-failed")
96
- } : g));
97
- });
98
- }, [
99
- D,
100
- _
101
- ]), O = async (h) => {
102
- if (p && d(void 0), h) {
103
- if (o.length + h.length > e) {
104
- d(_("form.file-upload.error.upload-limit", {
105
- limit: e
106
- }));
107
- return;
108
- }
109
- const b = Array.from(h).reduce((g, w) => (o.some((U) => U.file.name === w.name) || g.push({
110
- file: w,
111
- state: "uploading"
112
- }), g), []);
113
- i([
114
- ...o,
115
- ...b
116
- ]), await j(b);
117
- }
118
- }, q = (h) => {
119
- const f = o[h];
120
- if (N && s && f.state !== "error") {
121
- const L = N.filter((g) => g.displayName !== f.file.name);
122
- s(L), m(L);
123
- const b = o.filter((g) => g.file.name !== f.file.name);
124
- i(b), b.length === 0 && C();
125
- } else {
126
- const L = o.filter((b) => b !== f);
127
- i(L), L.length === 0 && C();
128
- }
129
- }, Y = () => {
130
- p && d(void 0), E();
131
- }, W = u.map((h) => $e[h]).join(), X = M(() => {
132
- i([]), m([]);
133
- }, []);
134
- return Te(X), {
135
- files: o,
136
- limitError: p,
137
- hover: F,
138
- getExplanationText: B,
139
- getStatusText: Z,
140
- handleChange: O,
141
- handleDelete: q,
142
- accept: W,
143
- handleBlur: Y
144
- };
145
- }
146
- function Qe(e = []) {
147
- const r = e || [];
148
- try {
149
- return r.map((n) => ({
150
- file: new File([
151
- new Int8Array(0)
152
- ], n.displayName, {
153
- type: n.fileType
154
- }),
155
- state: "uploaded"
156
- }));
157
- } catch (n) {
158
- console.error(n);
159
- }
160
- return [];
161
- }
162
- const Fe = /* @__PURE__ */ he(void 0);
163
- function V() {
164
- const e = _e(Fe);
165
- if (typeof e > "u")
166
- throw new Error("FileUpload components must be used within FileUpload");
167
- return e;
168
- }
169
- const k = ({ children: e, className: r }) => {
170
- const { ariaDescribedBy: n } = Ee(), { disabled: a, hasError: s } = z(), { handleFileChange: u, limitReached: E } = V();
171
- if (E)
172
- return null;
173
- const C = x(e, k.Title), o = x(e, k.Subtitle), i = x(e, k.Button);
174
- return /* @__PURE__ */ t.createElement(we, {
175
- "aria-describedby": n,
176
- className: r,
177
- "data-invalid": s,
178
- isDisabled: a,
179
- onDrop: async (N) => {
180
- const m = [];
181
- for (const p of N.items)
182
- if (p.kind === "file") {
183
- const d = await p.getFile();
184
- d && m.push(d);
185
- }
186
- if (m.length > 0) {
187
- const p = new DataTransfer();
188
- m.forEach((d) => p.items.add(d)), u(p.files);
189
- }
190
- }
191
- }, /* @__PURE__ */ t.createElement(Ue, {
192
- slot: "label"
193
- }, C, o), i);
194
- }, Ge = ({ className: e, children: r }) => {
195
- const { limitReached: n } = V();
196
- return /* @__PURE__ */ t.createElement("p", {
197
- className: e
198
- }, r({
199
- limitReached: n
200
- }));
201
- }, Je = ({ className: e, children: r }) => {
202
- const { limitReached: n } = V(), { explanationText: a } = z();
203
- return /* @__PURE__ */ t.createElement("p", {
204
- className: e
205
- }, a || r({
206
- limitReached: n
207
- }));
208
- }, oe = ({ className: e, children: r, "aria-roledescription": n, onHoverStart: a, onHoverEnd: s }) => {
209
- const { ariaDescribedBy: u, inputId: E, labelId: C, errorId: o } = Ee(), { disabled: i, required: N, onFocus: m, hasError: p, errorMessage: d } = z(), { handleFileChange: D, accept: _, multiple: I, buttonRef: F, handleBlur: T, limitError: y, files: c } = V(), S = (c == null ? void 0 : c.some((B) => B.errorMessage)) ?? !1, Z = !!(p || d || y || S);
210
- return /* @__PURE__ */ t.createElement(Pe, {
211
- acceptedFileTypes: _ ? _.split(",") : void 0,
212
- allowsMultiple: I,
213
- onSelect: (B) => {
214
- if (B) {
215
- const j = Array.from(B), O = new DataTransfer();
216
- j.forEach((q) => O.items.add(q)), D(O.files);
217
- }
218
- }
219
- }, /* @__PURE__ */ t.createElement(be, {
220
- ref: F,
221
- id: E,
222
- "aria-labelledby": C,
223
- "aria-describedby": [
224
- u,
225
- o
226
- ].filter(Boolean).join(" "),
227
- render: (B) => /* @__PURE__ */ t.createElement("button", {
228
- ...B,
229
- "aria-roledescription": n,
230
- "aria-invalid": Z || void 0,
231
- "aria-required": N
232
- }),
233
- isDisabled: i,
234
- className: e,
235
- onFocus: m,
236
- onBlur: T,
237
- onHoverStart: a,
238
- onHoverEnd: s
239
- }, r));
240
- }, Xe = ({ className: e }) => {
241
- const { buttonText: r } = z();
242
- return /* @__PURE__ */ t.createElement("span", {
243
- className: e
244
- }, r);
245
- };
246
- oe.Text = Xe;
247
- k.Title = Ge;
248
- k.Subtitle = Je;
249
- k.Button = oe;
250
- const A = ({ children: e, className: r, ...n }) => {
251
- const { file: a, index: s } = n, u = a.file.name, E = x(e, A.Name), C = x(e, A.Remove), o = x(e, A.Spinner), i = x(e, A.Error);
252
- return /* @__PURE__ */ t.createElement("div", {
253
- className: r
254
- }, $(E, {
255
- fileName: u
256
- }), a.state === "uploading" ? o : $(C, {
257
- index: s,
258
- fileName: u
259
- }), a.errorMessage && $(i, {
260
- errorMessage: a.errorMessage
261
- }));
262
- }, et = ({ className: e, ...r }) => {
263
- const { fileName: n } = r;
264
- return /* @__PURE__ */ t.createElement("span", {
265
- className: e
266
- }, n);
267
- }, tt = ({ className: e, "aria-label": r, children: n, ...a }) => {
268
- const { fileName: s, index: u } = a, { disabled: E } = z(), { handleDelete: C, fileRemoveButtonRefs: o } = V(), i = H(null);
269
- re(() => {
270
- const m = o.current, p = s;
271
- return m[p] = i, () => {
272
- m[p] === i && (m[p] = void 0);
273
- };
274
- }, [
275
- s,
276
- o
277
- ]);
278
- const N = () => {
279
- C(u);
280
- };
281
- return /* @__PURE__ */ t.createElement(be, {
282
- ref: i,
283
- "aria-disabled": E,
284
- "aria-label": r,
285
- "aria-description": s,
286
- onClick: N,
287
- className: e,
288
- isDisabled: E
289
- }, n);
290
- }, ge = ({ className: e, children: r, ...n }) => {
291
- const { errorMessage: a } = n;
292
- return a ? /* @__PURE__ */ t.createElement(Ve, {
293
- value: a
294
- }, /* @__PURE__ */ t.createElement("div", {
295
- className: e,
296
- role: "alert"
297
- }, r)) : null;
298
- }, rt = ({ className: e, "aria-label": r, children: n }) => /* @__PURE__ */ t.createElement(He, {
299
- "aria-label": r,
300
- className: e,
301
- isIndeterminate: !0
302
- }, n);
303
- A.Name = et;
304
- A.Remove = tt;
305
- A.Spinner = rt;
306
- A.Error = ge;
307
- ge.Text = ze;
308
- const ae = ({ children: e, className: r }) => {
309
- const { files: n } = V(), a = x(e, ae.File);
310
- return !n || n.length === 0 ? null : /* @__PURE__ */ t.createElement("div", {
311
- className: r
312
- }, n.map((s, u) => $(a, {
313
- key: s.file.name || u,
314
- file: s,
315
- index: u
316
- })));
317
- };
318
- ae.File = A;
319
- const G = (e) => e.file.name, l = ({ children: e }) => {
320
- const { t: r } = ne(), { id: n, value: a, onChange: s, uploadFileFormats: u, valueSliderLimit: E, target: C, explanationText: o, onBlur: i, hasError: N, errorMessage: m, FieldLayout: p } = z(), d = H(null), D = H({}), _ = H(!1), I = M(() => {
321
- d.current ? d.current.focus() : _.current = !0;
322
- }, []), { files: F, limitError: T, hover: y, getExplanationText: c, getStatusText: S, handleBlur: Z, handleChange: B, handleDelete: j, accept: O } = We({
323
- valueSliderLimit: E,
324
- value: a,
325
- explanationText: o,
326
- target: C,
327
- onChange: s,
328
- uploadFileFormats: u,
329
- onBlur: i,
330
- onFilesCleared: I
331
- }), q = M((U) => {
332
- var se;
333
- const Q = F[U], P = G(Q);
334
- F.length > 1 && ((se = (F.filter((ee) => G(ee) !== P).map((ee) => D.current[G(ee)]).find(Boolean) ?? d).current) == null || se.focus()), j(U);
335
- }, [
336
- j,
337
- F
338
- ]);
339
- re(() => {
340
- _.current && d.current && (_.current = !1, d.current.focus());
341
- }, [
342
- F
343
- ]);
344
- const Y = E > 1, W = F.length >= E, X = fe(() => ({
345
- handleFileChange: B,
346
- handleBlur: Z,
347
- handleDelete: q,
348
- files: F,
349
- accept: O,
350
- limitReached: W,
351
- multiple: Y,
352
- getExplanationText: c,
353
- getStatusText: S,
354
- hover: y,
355
- limitError: T,
356
- buttonRef: d,
357
- fileRemoveButtonRefs: D
358
- }), [
359
- B,
360
- Z,
361
- q,
362
- F,
363
- O,
364
- W,
365
- Y,
366
- c,
367
- S,
368
- y,
369
- T
370
- ]), h = x(e, l.Label), f = x(e, l.DropZone), L = x(e, l.Button), b = x(e, l.Explanation), g = x(e, l.Files), w = x(e, l.Description), le = x(e, l.Error);
371
- return Se(() => {
372
- var U, Q;
373
- if (d.current) {
374
- d.current.focus();
375
- return;
376
- }
377
- (Q = (U = F.map((P) => D.current[G(P)]).find((P) => P == null ? void 0 : P.current)) == null ? void 0 : U.current) == null || Q.focus();
378
- }, n), /* @__PURE__ */ t.createElement(Fe.Provider, {
379
- value: X
380
- }, /* @__PURE__ */ t.createElement(p, {
381
- fieldId: n,
382
- renderLabel: () => h,
383
- renderInput: () => f ?? L,
384
- renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, $(le, {
385
- hasError: !!(N || T),
386
- errorMessage: T ?? m
387
- }), /* @__PURE__ */ t.createElement(ke, {
388
- role: "status",
389
- "aria-live": "polite",
390
- "aria-atomic": "true"
391
- }, r("form.file-upload.explanation-text", {
392
- count: F.length
393
- })), b, g, w)
394
- }));
395
- }, nt = ({ className: e, showUploadStatusOnly: r }) => {
396
- const { files: n, getExplanationText: a, getStatusText: s } = V(), u = r ? s() : a();
397
- return n.length === 1 || !u ? null : /* @__PURE__ */ t.createElement("p", {
398
- className: e
399
- }, u);
400
- };
401
- l.Label = Ke;
402
- l.DropZone = k;
403
- l.Button = oe;
404
- l.Explanation = nt;
405
- l.Files = ae;
406
- l.Description = je;
407
- l.Error = qe;
408
- const ot = (e) => /* @__PURE__ */ t.createElement("svg", {
409
- viewBox: "0 0 24 24",
410
- width: 24,
411
- height: 24,
412
- fill: "currentColor",
413
- "aria-hidden": "true",
414
- ...e
415
- }, /* @__PURE__ */ t.createElement("path", {
416
- 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"
417
- })), at = (e) => /* @__PURE__ */ t.createElement("svg", {
418
- viewBox: "0 0 24 24",
419
- width: 24,
420
- height: 24,
421
- fill: "currentColor",
422
- "aria-hidden": "true",
423
- ...e
424
- }, /* @__PURE__ */ t.createElement("path", {
425
- 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"
426
- })), lt = (e) => /* @__PURE__ */ t.createElement("svg", {
427
- viewBox: "0 0 24 24",
428
- width: 24,
429
- height: 24,
430
- fill: "currentColor",
431
- "aria-hidden": "true",
432
- ...e
433
- }, /* @__PURE__ */ t.createElement("path", {
434
- 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"
435
- })), st = () => {
436
- const r = "calc(50% - 2px)";
437
- return /* @__PURE__ */ t.createElement("svg", {
438
- fill: "none",
439
- width: "100%",
440
- height: "100%",
441
- viewBox: "0 0 32 32"
442
- }, /* @__PURE__ */ t.createElement("circle", {
443
- cx: "50%",
444
- cy: "50%",
445
- r
446
- }), /* @__PURE__ */ t.createElement("circle", {
447
- cx: "50%",
448
- cy: "50%",
449
- r,
450
- // Normalize the path length to 100 so we can easily set stroke-dashoffset to a fixed arc.
451
- pathLength: "100",
452
- // Add extra gap between dashes so the arc reads correctly in Chrome.
453
- strokeDasharray: "100 200",
454
- strokeDashoffset: 75,
455
- strokeLinecap: "round",
456
- style: {
457
- rotate: "-90deg",
458
- transformOrigin: "center center"
459
- }
460
- }, /* @__PURE__ */ t.createElement("animateTransform", {
461
- attributeName: "transform",
462
- type: "rotate",
463
- dur: "0.75s",
464
- values: "0;360",
465
- repeatCount: "indefinite"
466
- })));
467
- }, it = "_dropZone_crf8e_1", ct = "_dropZoneHover_crf8e_27", dt = "_dropZoneTitle_crf8e_52", ut = "_dropZoneSubtitle_crf8e_57", mt = "_button_crf8e_61", pt = "_buttonHover_crf8e_114", ft = "_explanation_crf8e_131", Et = "_files_crf8e_135", bt = "_file_crf8e_135", Ft = "_fileName_crf8e_185", gt = "_buttonLabel_crf8e_193", ht = "_removeButton_crf8e_197", _t = "_spinner_crf8e_243", Lt = "_fileError_crf8e_259", v = {
468
- dropZone: it,
469
- dropZoneHover: ct,
470
- dropZoneTitle: dt,
471
- dropZoneSubtitle: ut,
472
- button: mt,
473
- buttonHover: pt,
474
- explanation: ft,
475
- files: Et,
476
- file: bt,
477
- fileName: Ft,
478
- buttonLabel: gt,
479
- removeButton: ht,
480
- spinner: _t,
481
- fileError: Lt
482
- }, xt = ({ content: e, locale: r }) => /* @__PURE__ */ t.createElement(xe, {
483
- content: e,
484
- locale: r
485
- }), Ct = () => {
486
- var I, F, T, y;
487
- const { t: e } = ne(), { disabled: r, readOnly: n } = z(), a = !r && !n, s = pe({
488
- globalClasses: ue,
489
- moduleClasses: {
490
- base: v.dropZone,
491
- hover: v.dropZoneHover
492
- }
493
- }), u = pe({
494
- globalClasses: Ie,
495
- moduleClasses: {
496
- base: v.button,
497
- hover: v.buttonHover
498
- }
499
- }), E = (y = (T = (F = (I = Be().dropZone) == null ? void 0 : I.elementProps) == null ? void 0 : F.uploadButton) == null ? void 0 : T.elementProps) == null ? void 0 : y.icon, { wix: C, className: o, ...i } = E ?? {}, N = ye(te.DROP_ZONE, te.UPLOAD_BUTTON, te.UPLOAD_BUTTON_LABEL), m = H(null), [p, d] = J(!1), D = M(() => {
500
- var c;
501
- d(!0), (c = m.current) == null || c.runAnimationForward();
502
- }, []), _ = M(() => {
503
- var c;
504
- d(!1), (c = m.current) == null || c.runAnimationBackward();
505
- }, []);
506
- return /* @__PURE__ */ t.createElement(l, null, /* @__PURE__ */ t.createElement(l.Label, {
507
- className: R(Ze, K.label)
508
- }, /* @__PURE__ */ t.createElement(l.Label.Required, {
509
- className: R(Re, K.requiredMark)
510
- })), /* @__PURE__ */ t.createElement(l.DropZone, {
511
- className: ({ isHovered: c, isDropTarget: S }) => s({
512
- isSelected: !1,
513
- isHovered: c || S,
514
- isInteractive: a
515
- })
516
- }, /* @__PURE__ */ t.createElement(l.DropZone.Title, {
517
- className: v.dropZoneTitle
518
- }, ({ limitReached: c }) => e(c ? "file-upload.dropzone.limit-reached.title" : "file-upload.dropzone.title")), /* @__PURE__ */ t.createElement(l.DropZone.Subtitle, {
519
- className: v.dropZoneSubtitle
520
- }, ({ limitReached: c }) => e(c ? "file-upload.dropzone.limit-reached.subtitle" : "file-upload.dropzone.subtitle")), /* @__PURE__ */ t.createElement(l.DropZone.Button, {
521
- className: ({ isHovered: c }) => u({
522
- isSelected: !1,
523
- isHovered: c,
524
- isInteractive: a
525
- }),
526
- "aria-roledescription": e("file-upload.aria-roledescription"),
527
- onHoverStart: D,
528
- onHoverEnd: _
529
- }, i.svg ? /* @__PURE__ */ t.createElement(Le, {
530
- ...i,
531
- ref: m,
532
- className: R(Ae, Me, o)
533
- }) : E ? null : /* @__PURE__ */ t.createElement(ot, null), /* @__PURE__ */ t.createElement(l.DropZone.Button.Text, {
534
- className: R(ce.base, v.buttonLabel, N, {
535
- [ce.hover]: a && p
536
- })
537
- }))), /* @__PURE__ */ t.createElement(l.Explanation, {
538
- className: R(de, K.description, v.explanation),
539
- showUploadStatusOnly: !0
540
- }), /* @__PURE__ */ t.createElement(l.Files, {
541
- className: v.files
542
- }, /* @__PURE__ */ t.createElement(l.Files.File, {
543
- className: R(ue.base, v.file)
544
- }, /* @__PURE__ */ t.createElement(l.Files.File.Name, {
545
- className: v.fileName
546
- }), /* @__PURE__ */ t.createElement(l.Files.File.Spinner, {
547
- className: v.spinner,
548
- "aria-label": e("file-upload.file.uploading-spinner.aria-label")
549
- }, /* @__PURE__ */ t.createElement(st, null)), /* @__PURE__ */ t.createElement(l.Files.File.Remove, {
550
- className: v.removeButton,
551
- "aria-label": e("file-upload.delete-file.aria-label")
552
- }, /* @__PURE__ */ t.createElement(lt, null)), /* @__PURE__ */ t.createElement(l.Files.File.Error, {
553
- className: R(me, K.error, v.fileError)
554
- }, /* @__PURE__ */ t.createElement(at, null), /* @__PURE__ */ t.createElement(l.Files.File.Error.Text, null)))), /* @__PURE__ */ t.createElement(l.Description, {
555
- className: R(de, K.description)
556
- }, xt), /* @__PURE__ */ t.createElement(l.Error, {
557
- className: R(me, K.error)
558
- }, /* @__PURE__ */ t.createElement(Oe, null), /* @__PURE__ */ t.createElement(l.Error.Text, null)));
559
- }, wt = () => /* @__PURE__ */ t.createElement(Ct, null);
560
- export {
561
- wt as FileUploadRAC
562
- };
@@ -1,20 +0,0 @@
1
- import p from "classnames";
2
- import { ba as E, aJ as f } from "./form-CPY-PtxT.js";
3
- const J = ({ globalClasses: e, moduleClasses: c }) => {
4
- var d;
5
- const r = ((d = E(...f(e))) == null ? void 0 : d.split(/\s+/)) ?? [], h = [
6
- e.selected,
7
- e.hover
8
- ], o = !!e.selected && r.includes(e.selected), u = r.includes(e.hover);
9
- return ({ isSelected: m, isHovered: n, isInteractive: t = !0 }) => p(e.base, c.base, t ? r : r.filter((N) => !h.includes(N)), {
10
- [e.hover]: t && n,
11
- [c.hover]: t && (n || u)
12
- }, e.selected && {
13
- [e.selected]: t && m
14
- }, c.selected && {
15
- [c.selected]: t && (m || o)
16
- });
17
- };
18
- export {
19
- J as u
20
- };
@@ -1,23 +0,0 @@
1
- import { bh as i } from "./form-CPY-PtxT.js";
2
- import { s as e } from "./field-rac.module-BGN-O8tV.js";
3
- import { u as m } from "./use-element-state-class-name-BOks3she.js";
4
- const d = (s, a) => {
5
- const { disabled: t, readOnly: o } = i(), r = m({
6
- globalClasses: s,
7
- moduleClasses: {
8
- base: [
9
- e.input,
10
- ...a
11
- ].join(" "),
12
- hover: e.inputHover
13
- }
14
- });
15
- return ({ isHovered: l }) => r({
16
- isSelected: !1,
17
- isHovered: l,
18
- isInteractive: !t && !o
19
- });
20
- };
21
- export {
22
- d as u
23
- };
@@ -1,6 +0,0 @@
1
- import { a5 as a } from "./form-CPY-PtxT.js";
2
- import { u as e } from "./use-hoverable-input-class-name-jxtCw16L.js";
3
- const m = (...s) => e(a, s);
4
- export {
5
- m as u
6
- };