@wix/form-elements 1.101.0 → 1.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/component/{appointment-rac-Bz666XRl.js → appointment-rac-DW5YPIgy.js} +4 -4
  2. package/dist/component/{bookings-address-rac-BeOnUsml.js → bookings-address-rac-7ODYuuSG.js} +1 -1
  3. package/dist/component/{bookings-email-rac-DG28agAj.js → bookings-email-rac-BCnhC0YX.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-gR3z4-ab.js → bookings-first-name-rac-DvpfHse1.js} +1 -1
  5. package/dist/component/{bookings-header-rac-Z8uH4Ld4.js → bookings-header-rac-Dohy9hCz.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-BQIL81Rd.js → bookings-last-name-rac-CVDRbwd7.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-DLDBFIUw.js → bookings-login-bar-rac-DavjHZGh.js} +1 -1
  8. package/dist/component/{bookings-phone-rac-DZBdi31-.js → bookings-phone-rac-Cj6Dz0vX.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-uJfFKnlR.js → bookings-rich-text-rac-DjmnegM6.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-CESygdpa.js → checkbox-field-rac-DbJQI0lK.js} +4 -4
  11. package/dist/component/checkbox-group-field-headless-BWCsolHw.js +205 -0
  12. package/dist/component/{checkbox-group-field-rac-B4xHxrnm.js → checkbox-group-field-rac-Cmc2pwQi.js} +7 -5
  13. package/dist/component/{checkbox-group-rac-Cj1QP0mi.js → checkbox-group-rac-q3wI6hQH.js} +1 -1
  14. package/dist/component/{checkbox-rac-CwDeLVTg.js → checkbox-rac-BsutELL1.js} +1 -1
  15. package/dist/component/{contacts-address-rac-CR0VgQjc.js → contacts-address-rac-BUCtejza.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-BKP3MEUH.js → contacts-birthdate-rac-1E453ZgP.js} +1 -1
  17. package/dist/component/{contacts-company-rac-2KfK3HUv.js → contacts-company-rac-DrK20x29.js} +1 -1
  18. package/dist/component/{contacts-email-rac-C-StCCdk.js → contacts-email-rac-CMiWMV_P.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-DluPdJrM.js → contacts-first-name-rac-DPwXc8-1.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-BPFDtu0m.js → contacts-last-name-rac-CeuRsbGC.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-DCjYThvu.js → contacts-phone-rac-Cwjc5too.js} +1 -1
  22. package/dist/component/{contacts-position-rac-70Y5K0-2.js → contacts-position-rac-C8w3NNCn.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-CkpV9O6Z.js → contacts-subscribe-rac-CFejp0de.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-Cc7RlBvQ.js → contacts-tax-id-rac-xNks1IAv.js} +1 -1
  25. package/dist/component/{date-availability-BNMZIIVi.js → date-availability-xTIFwK6x.js} +1 -1
  26. package/dist/component/{date-input-field-rac-B7U8YKrm.js → date-input-field-rac-DcoJJUZc.js} +6 -6
  27. package/dist/component/{date-input-rac-CYooWhMb.js → date-input-rac-CnZAuOkP.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-FmHlyJdB.js → date-picker-field-rac-D__137lA.js} +5 -5
  29. package/dist/component/{date-picker-rac-DLwn7AKn.js → date-picker-rac-DQ42fhVP.js} +1 -1
  30. package/dist/component/{date-time-input-field-rac-eGxHBFDW.js → date-time-input-field-rac-BHBAMq3g.js} +6 -6
  31. package/dist/component/{date-time-input-rac-2E-AZjJU.js → date-time-input-rac-DbIAF6nq.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-1yuZvgHa.js → dext-checkbox-group-rac-Ds2w4V3q.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-DM0XXP68.js → dext-checkbox-rac-DSidRTEl.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-CMzKfaWk.js → dext-date-picker-rac-Derm4Q3d.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-CFq1kbpd.js → dext-date-time-input-rac-BcyPuijC.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-BdhFCJOG.js → dext-dropdown-rac-kDuk--KF.js} +1 -1
  37. package/dist/component/{dext-email-rac-B7pSx32V.js → dext-email-rac-xys-YMg2.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-BySDR8wu.js → dext-number-input-rac-BZpAijhk.js} +1 -1
  39. package/dist/component/{dext-phone-rac-BG5s3WRz.js → dext-phone-rac-CMPboOsF.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-rLbHat4_.js → dext-radio-group-rac-5h9c9bW2.js} +2 -2
  41. package/dist/component/{dext-rating-input-rac-Q6sOA59G.js → dext-rating-input-rac-BobDzEXB.js} +1 -1
  42. package/dist/component/{dext-tags-rac-ChmYbfhb.js → dext-tags-rac-DoJWzkrn.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-D3sAPT-i.js → dext-text-area-rac-BIRCFM2F.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-Pt4j-NHE.js → dext-text-input-rac-Bzx5hcyp.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-jVL0Hmzh.js → dext-url-input-rac-C9hlh97b.js} +1 -1
  46. package/dist/component/donation-rac-CpEduCy1.js +318 -0
  47. package/dist/component/{dropdown-field-headless-CppwKBfX.js → dropdown-field-headless-Dcbu807N.js} +4 -4
  48. package/dist/component/{dropdown-field-rac-CgBmIDaT.js → dropdown-field-rac-mJwCTpQA.js} +2 -2
  49. package/dist/component/{dropdown-rac-BMweA5uI.js → dropdown-rac-N5I5XU3B.js} +1 -1
  50. package/dist/component/{ecom-address-rac-O0_CQxUW.js → ecom-address-rac-_0TO5pFZ.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-Cmu1KuGg.js → ecom-subscription-checkbox-rac-DNdz6UCu.js} +2 -2
  52. package/dist/component/{email-input-field-rac-D_5MccPr.js → email-input-field-rac-VDJC1JLs.js} +3 -3
  53. package/dist/component/{events-repeater-rac-8Y4pq7V2.js → events-repeater-rac-CzBVzG00.js} +4 -4
  54. package/dist/component/{events-rsvp-rac-BYydUMNS.js → events-rsvp-rac--ADJlIQz.js} +24 -20
  55. package/dist/component/{field-error-headless-gUwzDWOe.js → field-error-headless-_ADCIvnx.js} +1 -1
  56. package/dist/component/{field-label-headless-Co6yOqfY.js → field-label-headless-DiDxuhCI.js} +1 -1
  57. package/dist/component/{file-upload-rac-DCPcAuy6.js → file-upload-rac-CiYo9UQA.js} +3 -3
  58. package/dist/component/{fixed-payment-rac-BYxHFMz7.js → fixed-payment-rac-DgNVdELB.js} +3 -3
  59. package/dist/component/{form-xpXT6sSe.js → form-DPmF8iaT.js} +69 -69
  60. package/dist/component/form.css +1 -1
  61. package/dist/component/form.js +1 -1
  62. package/dist/component/{header-field-rac-D6Ooi7Mr.js → header-field-rac-BuJTUp5S.js} +2 -2
  63. package/dist/component/{header-rac-DnGs8ZQz.js → header-rac-BphcUkmo.js} +1 -1
  64. package/dist/component/image-choice-rac-CZSMzLY2.js +162 -0
  65. package/dist/component/{index-DDN9WMAP.js → index-B0DLHSXg.js} +4 -4
  66. package/dist/component/{index-BycimQIL.js → index-BEIxTlpO.js} +2 -2
  67. package/dist/component/{isObjectLike-CO5vOu2v.js → isObjectLike-DuXP52EV.js} +1 -1
  68. package/dist/component/{multiline-address-field-rac-Ceqa3t-S.js → multiline-address-field-rac-CNJyTqJt.js} +7 -7
  69. package/dist/component/{multiline-address-rac-DUEzLbEj.js → multiline-address-rac-DG7xjt6A.js} +1 -1
  70. package/dist/component/{number-input-field-rac-bpQgiO2z.js → number-input-field-rac-Bj2AK7Oj.js} +4 -4
  71. package/dist/component/{number-input-rac-igcMPISW.js → number-input-rac-JPgr87Xh.js} +1 -1
  72. package/dist/component/options-rac.module-CTDdATiz.js +8 -0
  73. package/dist/component/{password-rac-BT1z4LAW.js → password-rac-J0ySzA6j.js} +4 -4
  74. package/dist/component/{payment-input-rac-COxjqEMn.js → payment-input-rac-B1VmJQeD.js} +4 -4
  75. package/dist/component/{phone-input-field-rac-CDeMaVl7.js → phone-input-field-rac-SWP8Xkh-.js} +6 -6
  76. package/dist/component/{phone-rac-BCL0hoBl.js → phone-rac-BU33sXKk.js} +1 -1
  77. package/dist/component/{product-list-rac-BI9J6Cv5.js → product-list-rac-dk3gFLyb.js} +5 -5
  78. package/dist/component/{quiz-radio-group-rac-oevpys_A.js → quiz-radio-group-rac-BFlVZj9U.js} +1 -1
  79. package/dist/component/radio-button-module-classes-DgiY7sw3.js +133 -0
  80. package/dist/component/{radio-group-field-rac-2y5gEEt7.js → radio-group-field-rac-qD-GQu2A.js} +23 -21
  81. package/dist/component/{radio-group-rac-DF769GN5.js → radio-group-rac-CIY9Gj99.js} +1 -1
  82. package/dist/component/{rating-input-field-rac-DzuWl96q.js → rating-input-field-rac-BVWuvhkf.js} +4 -4
  83. package/dist/component/{rating-input-rac-DOwiqhty.js → rating-input-rac-C3HFmqHX.js} +1 -1
  84. package/dist/component/{rich-content-rac.module-B0CKQkBJ.js → rich-content-rac.module-QBgwAjEA.js} +1 -1
  85. package/dist/component/{rich-text-field-rac-CHfUVOQg.js → rich-text-field-rac-BohVUJm1.js} +2 -2
  86. package/dist/component/{rich-text-rac-CyfDUzdG.js → rich-text-rac-BST0y6Gq.js} +1 -1
  87. package/dist/component/{service-dropdown-rac-DSOEw_Pz.js → service-dropdown-rac-DZSY9T2v.js} +4 -4
  88. package/dist/component/services-multi-choice-rac-hD8TI7n7.js +89 -0
  89. package/dist/component/{signature-rac-CQgKDpSA.js → signature-rac-D9G6D7Pa.js} +3 -3
  90. package/dist/component/{submit-button-rac-CkcToyXk.js → submit-button-rac-D4vOTaQ9.js} +1 -1
  91. package/dist/component/tags-field-rac-CoNoLUAV.js +220 -0
  92. package/dist/component/{tags-rac-De-oJJeH.js → tags-rac-BGT8KWvN.js} +1 -1
  93. package/dist/component/{text-area-field-rac-Abh_6vvi.js → text-area-field-rac-x-LWaPSL.js} +4 -4
  94. package/dist/component/{text-area-rac-CPtigptv.js → text-area-rac-B0KN3TR1.js} +1 -1
  95. package/dist/component/{text-input-field-rac-mmA4MWmn.js → text-input-field-rac-DH5j0Tvv.js} +2 -2
  96. package/dist/component/{text-input-headless-_LKXMy0W.js → text-input-headless-Slo-xa7H.js} +3 -3
  97. package/dist/component/{text-input-rac-Dwc5DpDr.js → text-input-rac-_VrGU08X.js} +1 -1
  98. package/dist/component/{time-input-rac-DXaTD0kX.js → time-input-rac-DS5uFTDp.js} +4 -4
  99. package/dist/component/{url-input-field-rac-DmFkKHcU.js → url-input-field-rac-yCewMKD-.js} +4 -4
  100. package/dist/component/{url-input-rac-B0_9AJIF.js → url-input-rac-D7cuZG08.js} +1 -1
  101. package/dist/component/{use-dropdown-option-class-name-DXfUR3FK.js → use-dropdown-option-class-name-DbjgH9K1.js} +1 -1
  102. package/dist/component/{use-element-state-class-name-DnTajLN7.js → use-element-state-class-name-C2_dMWlH.js} +1 -1
  103. package/dist/component/{use-is-forced-open-dropdown-aQ729ktc.js → use-is-forced-open-dropdown-VcOCKx-3.js} +1 -1
  104. package/dist/component/{use-service-options-base-DY2mUh8f.js → use-service-options-base-Cu9nE-aZ.js} +1 -1
  105. package/dist/component/{use-text-input-class-name-ZQJA7JHr.js → use-text-input-class-name-DMokiXwB.js} +2 -2
  106. package/package.json +2 -2
  107. package/dist/component/checkbox-group-field-headless-Bz_FnjxO.js +0 -205
  108. package/dist/component/donation-rac-D_ljVWm9.js +0 -319
  109. package/dist/component/image-choice-rac-B9t4gM5n.js +0 -158
  110. package/dist/component/options-layout-constants-DEfIEJWD.js +0 -6
  111. package/dist/component/options-rac.module-KM-VT_KY.js +0 -7
  112. package/dist/component/radio-button-module-classes-CJ00fK3C.js +0 -132
  113. package/dist/component/services-multi-choice-rac-Bw3adRvE.js +0 -85
  114. package/dist/component/tags-field-rac-BEuOFlHS.js +0 -218
@@ -1,132 +0,0 @@
1
- import l, { useRef as S, useState as V, useEffect as B, useCallback as T } from "react";
2
- import { RadioGroup as H, RadioField as k, RadioButton as M, TextField as U, Input as A } from "react-aria-components";
3
- import { ak as v, ah as G, au as F, ac as P, am as $ } from "./form-xpXT6sSe.js";
4
- import { f as p, a as y } from "./find-child-C60k4CxG.js";
5
- import { D as q, E as x } from "./field-error-headless-gUwzDWOe.js";
6
- import { L as j } from "./field-label-headless-Co6yOqfY.js";
7
- import { N as w } from "./options-layout-constants-DEfIEJWD.js";
8
- import { S as z } from "./selection-indicator-XQ8MYHUQ.js";
9
- const L = "Other", J = (e, t) => e == null ? void 0 : e.find((o) => (o.value ?? o.label) === t), R = (e, t) => !!t && !J(e, t), K = (e, t) => {
10
- const a = t ? t.length + 2 : 0;
11
- return e.slice(a);
12
- }, c = ({ children: e }) => {
13
- const { id: t, value: o, onChange: a, disabled: O, readOnly: b, required: h, onBlur: f, onFocus: _, hasError: E, FieldLayout: r, options: s } = v(), { inputId: u, labelId: C, ariaDescribedBy: n } = G(), d = p(e, c.Label), i = p(e, c.Options), I = p(e, c.Description), N = p(e, c.Error), D = R(s, o) ? L : o || null;
14
- return /* @__PURE__ */ l.createElement(r, {
15
- fieldId: t,
16
- renderLabel: () => y(d, {
17
- as: "div"
18
- }),
19
- renderInput: () => /* @__PURE__ */ l.createElement(H, {
20
- id: u,
21
- "aria-labelledby": C,
22
- "aria-describedby": n,
23
- value: D,
24
- onChange: a,
25
- isDisabled: O,
26
- isReadOnly: b,
27
- isRequired: h,
28
- isInvalid: E,
29
- onBlur: f,
30
- onFocus: _
31
- }, i),
32
- renderDescription: () => /* @__PURE__ */ l.createElement(l.Fragment, null, N, I)
33
- });
34
- }, Q = ({ children: e, className: t }) => {
35
- const { options: o, addOther: a, addOtherLabel: O, id: b, numberOfColumns: h, hasError: f } = v(), { t: _ } = F(), { isMobile: E } = P(), r = p(e, c.Option), s = S(null), u = O || _("add-other.default-other-option-label") || L, C = E ? w.ONE : h;
36
- return $(() => {
37
- var n;
38
- (n = s.current) == null || n.focus();
39
- }, b), /* @__PURE__ */ l.createElement("div", {
40
- className: t,
41
- "data-columns": C,
42
- "data-invalid": f
43
- }, o.map((n, d) => y(r, {
44
- key: n.value ?? n.label,
45
- value: n.value ?? n.label,
46
- label: n.label,
47
- index: d,
48
- radioRef: d === 0 ? s : void 0
49
- })), a && y(r, {
50
- key: L,
51
- value: L,
52
- label: u,
53
- isOther: !0
54
- }));
55
- }, m = ({ children: e, className: t, ...o }) => {
56
- var d;
57
- const { value: a, label: O, isOther: b = !1, radioRef: h } = o, { value: f, options: _ } = v(), E = p(e, m.Label), r = p(e, m.Input), s = p(e, m.Control), u = p(e, m.OtherInput), C = b ? R(_, f) : f === a, n = (d = r == null ? void 0 : r.props) == null ? void 0 : d.className;
58
- return /* @__PURE__ */ l.createElement("div", {
59
- className: t
60
- }, /* @__PURE__ */ l.createElement(k, {
61
- value: a
62
- }, /* @__PURE__ */ l.createElement(M, {
63
- ref: h,
64
- className: n
65
- }, ({ isSelected: i, isHovered: I }) => /* @__PURE__ */ l.createElement(l.Fragment, null, y(s, {
66
- isSelected: i,
67
- isHovered: I
68
- }), y(E, {
69
- label: O
70
- })))), b && C && u);
71
- }, W = ({ className: e, ...t }) => {
72
- const { label: o } = t;
73
- return /* @__PURE__ */ l.createElement("span", {
74
- className: e
75
- }, o);
76
- }, X = (e) => null, Y = ({ className: e }) => {
77
- const { value: t, onChange: o, addOtherLabel: a, addOtherPlaceholder: O, otherInputCharacterLimit: b, disabled: h, readOnly: f, options: _ } = v(), { t: E } = F(), r = S(null), s = R(_, t), u = a || E("add-other.default-other-option-label") || L, [C, n] = V(s && t ? K(t, a) : "");
78
- B(() => {
79
- var i;
80
- s && r.current && ((i = r.current) == null || i.focus());
81
- }, [
82
- s
83
- ]);
84
- const d = T((i) => {
85
- let I;
86
- i ? I = `${a}: ${i}` : I = u, o(I), n(i);
87
- }, [
88
- o,
89
- a,
90
- u
91
- ]);
92
- return /* @__PURE__ */ l.createElement(U, {
93
- "aria-label": u,
94
- value: C,
95
- onChange: d,
96
- isDisabled: h,
97
- isReadOnly: f
98
- }, /* @__PURE__ */ l.createElement(A, {
99
- ref: r,
100
- className: e,
101
- placeholder: O,
102
- maxLength: b
103
- }));
104
- };
105
- m.Label = W;
106
- m.Input = X;
107
- m.Control = z;
108
- m.OtherInput = Y;
109
- c.Label = j;
110
- c.Options = Q;
111
- c.Option = m;
112
- c.Description = q;
113
- c.Error = x;
114
- const Z = "_labelImage_1neyf_1", ee = "_options_1neyf_26", te = "_option_1neyf_26", oe = "_optionInput_1neyf_46", ne = "_optionControl_1neyf_64", ae = "_optionControlHover_1neyf_86", le = "_optionControlSelected_1neyf_104", re = "_optionLabel_1neyf_139", g = {
115
- labelImage: Z,
116
- options: ee,
117
- option: te,
118
- optionInput: oe,
119
- optionControl: ne,
120
- optionControlHover: ae,
121
- optionControlSelected: le,
122
- optionLabel: re
123
- }, fe = {
124
- base: g.optionControl,
125
- selected: g.optionControlSelected,
126
- hover: g.optionControlHover
127
- };
128
- export {
129
- fe as R,
130
- c as a,
131
- g as s
132
- };
@@ -1,85 +0,0 @@
1
- import e, { useEffect as I, useMemo as L } from "react";
2
- import { RicosViewer as S } from "@wix/ricos/viewer";
3
- import r from "classnames";
4
- import { F as R, ak as d, h as D } from "./form-xpXT6sSe.js";
5
- import { u as f } from "./use-service-options-base-DY2mUh8f.js";
6
- import { C as n } from "./checkbox-group-field-headless-Bz_FnjxO.js";
7
- import { E as F } from "./error-icon-hZxQ6DEy.js";
8
- import { C as N } from "./checkbox-indicator-module-classes-DhbNznSB.js";
9
- import { s as a } from "./field-rac.module-DobpyqOd.js";
10
- import { C as h, S as b, c as M, e as A, r as v, j as x, d as P } from "./form-element-classes-BtKlobUX.js";
11
- import { o as _ } from "./options-rac.module-KM-VT_KY.js";
12
- import { u as T } from "./use-element-state-class-name-DnTajLN7.js";
13
- import { u as k } from "./use-text-input-class-name-ZQJA7JHr.js";
14
- const y = (s) => {
15
- var C;
16
- const { isLoading: o, options: i, isEmpty: c, shouldRender: m, setOptions: l, setIsEmpty: E, setHasInitialDataLoaded: p } = f({
17
- fieldType: R.SERVICES_MULTI_CHOICE,
18
- isEditor: s.isEditor
19
- }), u = (C = s.options) == null ? void 0 : C.every((O) => O.label && O.id);
20
- return I(() => {
21
- if (u && s.options) {
22
- l(s.options), E(s.options.length === 0), p(!0);
23
- return;
24
- }
25
- }, [
26
- u,
27
- s.options,
28
- l,
29
- E,
30
- p
31
- ]), {
32
- isLoading: o,
33
- options: i,
34
- isEmpty: c,
35
- shouldRender: m
36
- };
37
- }, t = ({ children: s }) => {
38
- const o = d(), { options: i, isEmpty: c, shouldRender: m } = y(o), l = L(() => ({
39
- ...o,
40
- options: i
41
- }), [
42
- o,
43
- i
44
- ]);
45
- return !o.isEditor && c || !m ? null : /* @__PURE__ */ e.createElement(D.Provider, {
46
- value: {
47
- v2: l
48
- }
49
- }, /* @__PURE__ */ e.createElement(n, null, s));
50
- };
51
- t.Label = n.Label;
52
- t.Options = n.Options;
53
- t.Description = n.Description;
54
- t.Error = n.Error;
55
- const B = ({ content: s, locale: o }) => /* @__PURE__ */ e.createElement(S, {
56
- content: s,
57
- locale: o
58
- }), H = () => {
59
- const s = T({
60
- globalClasses: P,
61
- moduleClasses: N
62
- }), o = k();
63
- return /* @__PURE__ */ e.createElement(t, null, /* @__PURE__ */ e.createElement(t.Label, {
64
- className: r(h, a.label)
65
- }, /* @__PURE__ */ e.createElement(t.Label.Required, {
66
- className: r(b, a.requiredMark)
67
- })), /* @__PURE__ */ e.createElement(t.Options, {
68
- className: r(M, _.options)
69
- }, /* @__PURE__ */ e.createElement(t.Options.Option, null, /* @__PURE__ */ e.createElement(t.Options.Option.Checkbox, {
70
- className: a.checkbox
71
- }, /* @__PURE__ */ e.createElement(t.Options.Option.Checkbox.Input, {
72
- className: s
73
- }), /* @__PURE__ */ e.createElement(t.Options.Option.Checkbox.Label, {
74
- className: r(A, _.optionLabel)
75
- })), /* @__PURE__ */ e.createElement(t.Options.Option.OtherInput, {
76
- inputClassName: o
77
- }))), /* @__PURE__ */ e.createElement(t.Error, {
78
- className: r(v, a.error)
79
- }, /* @__PURE__ */ e.createElement(F, null), /* @__PURE__ */ e.createElement(t.Error.Text, null)), /* @__PURE__ */ e.createElement(t.Description, {
80
- className: r(x, a.description)
81
- }, B));
82
- }, W = () => /* @__PURE__ */ e.createElement(H, null);
83
- export {
84
- W as ServicesMultiChoiceRAC
85
- };
@@ -1,218 +0,0 @@
1
- import { RicosViewer as j } from "@wix/ricos/viewer";
2
- import S from "classnames";
3
- import e, { useMemo as _, useState as Q, useRef as M, useLayoutEffect as w, useCallback as k } from "react";
4
- import { CheckboxGroup as z, TextField as J, Input as K, CheckboxField as X, CheckboxButton as Y } from "react-aria-components";
5
- import { ak as N, ah as Z, au as y, ac as ee, am as te } from "./form-xpXT6sSe.js";
6
- import { f, a as x } from "./find-child-C60k4CxG.js";
7
- import { E as B, D as $ } from "./field-error-headless-gUwzDWOe.js";
8
- import { L as H } from "./field-label-headless-Co6yOqfY.js";
9
- import { F as oe } from "./fieldset-headless-CD3fds9J.js";
10
- import { N as v } from "./options-layout-constants-DEfIEJWD.js";
11
- import { E as ae } from "./error-icon-hZxQ6DEy.js";
12
- import { s as D } from "./field-rac.module-DobpyqOd.js";
13
- import { C as ne, S as se, $ as re, r as le, j as ie, a0 as ce } from "./form-element-classes-BtKlobUX.js";
14
- import { o as ue } from "./options-rac.module-KM-VT_KY.js";
15
- import { u as de } from "./use-element-state-class-name-DnTajLN7.js";
16
- import { u as me } from "./use-text-input-class-name-ZQJA7JHr.js";
17
- const g = "Other", pe = (o, t) => {
18
- const s = t.length + 2;
19
- return (o.find((r) => r.startsWith(`${t}: `)) || "").slice(s);
20
- }, he = (o) => o.map((t) => t.value ?? t.label), P = ({ className: o, ...t }) => {
21
- const { label: n } = t;
22
- return /* @__PURE__ */ e.createElement("span", {
23
- className: o
24
- }, n);
25
- }, W = ({ className: o }) => {
26
- const { value: t, onChange: n, addOtherLabel: s, addOtherPlaceholder: c, otherInputCharacterLimit: r, disabled: u, readOnly: b, hasError: d } = N(), { t: m } = y(), l = s || m("add-other.default-other-option-label") || g, p = _(() => pe(t || [], l), [
27
- t,
28
- l
29
- ]), [a, L] = Q(p), h = M(n);
30
- w(() => {
31
- h.current = n;
32
- });
33
- const C = k((E) => {
34
- L(E);
35
- const I = (t || []).filter((O) => !O.startsWith(`${l}:`) && O !== l), F = E ? `${l}: ${E}` : l;
36
- h.current([
37
- ...I,
38
- F
39
- ]);
40
- }, [
41
- t,
42
- l
43
- ]);
44
- return /* @__PURE__ */ e.createElement(J, {
45
- value: a,
46
- onChange: C,
47
- isDisabled: u,
48
- isReadOnly: b,
49
- isInvalid: d,
50
- "aria-label": l
51
- }, /* @__PURE__ */ e.createElement(K, {
52
- "data-hook": "tags-other-input",
53
- "data-filled": a ? !0 : void 0,
54
- placeholder: c,
55
- maxLength: r,
56
- className: o
57
- }));
58
- }, T = ({ children: o, className: t, ...n }) => {
59
- const { value: s, label: c, isOther: r, isFirstOption: u } = n, { id: b, value: d, onChange: m, options: l, disabled: p, readOnly: a, hasError: L } = N(), h = M(null);
60
- te(() => {
61
- var O;
62
- u && ((O = h.current) == null || O.focus({
63
- preventScroll: !0
64
- }));
65
- }, b);
66
- const C = f(o, P), E = _(() => d || [], [
67
- d
68
- ]), I = _(() => r ? E.find((O) => O === c || O.startsWith(`${c}: `)) || c : s, [
69
- r,
70
- E,
71
- c,
72
- s
73
- ]), F = k((O) => {
74
- const G = he(l || []), A = E.filter((U) => G.includes(U));
75
- m(O ? [
76
- ...A,
77
- c
78
- ] : A);
79
- }, [
80
- c,
81
- m,
82
- l,
83
- E
84
- ]);
85
- return /* @__PURE__ */ e.createElement(X, {
86
- inputRef: h,
87
- value: I,
88
- onChange: r ? F : void 0,
89
- isDisabled: p,
90
- isReadOnly: a,
91
- isInvalid: L
92
- }, /* @__PURE__ */ e.createElement(Y, {
93
- className: t,
94
- "data-hook": `tags-${r ? g : s}`
95
- }, x(C, {
96
- value: s,
97
- label: c,
98
- isOther: r,
99
- isFirstOption: u
100
- })));
101
- }, V = ({ children: o, className: t }) => {
102
- const { options: n, addOther: s, addOtherLabel: c, numberOfColumns: r = v.FREE_FLOW } = N(), { isMobile: u } = ee(), { t: b } = y(), d = u && r !== v.FREE_FLOW ? v.ONE : r, m = c || b("add-other.default-other-option-label") || g, l = f(o, T), p = _(() => {
103
- const a = n || [];
104
- return s ? [
105
- ...a,
106
- {
107
- label: m,
108
- value: m,
109
- isOther: !0
110
- }
111
- ] : a;
112
- }, [
113
- n,
114
- s,
115
- m
116
- ]);
117
- return p.length === 0 ? null : /* @__PURE__ */ e.createElement("div", {
118
- className: t,
119
- "data-columns": d
120
- }, p.map((a, L) => {
121
- const h = a.value ?? a.label;
122
- return x(l, {
123
- key: a.isOther ? g : h,
124
- value: h,
125
- label: a.label,
126
- isOther: a.isOther,
127
- isFirstOption: L === 0
128
- });
129
- }));
130
- }, q = ({ children: o, className: t }) => {
131
- const { addOther: n, addOtherLabel: s, hasError: c, readOnly: r, value: u } = N(), { t: b } = y(), d = s || b("add-other.default-other-option-label") || g, m = f(o, V), l = f(o, W), p = _(() => !n || !u ? !1 : u.some((a) => a === d || a.startsWith(`${d}:`)), [
132
- n,
133
- u,
134
- d
135
- ]);
136
- return /* @__PURE__ */ e.createElement("div", {
137
- className: t,
138
- "data-invalid": c,
139
- "data-readonly": r
140
- }, m, p && l);
141
- }, i = ({ children: o }) => {
142
- const { id: t, value: n, onChange: s, FieldLayout: c, required: r, disabled: u, readOnly: b, hasError: d, onBlur: m, onFocus: l } = N(), { inputId: p, labelId: a, ariaDescribedBy: L } = Z(), h = _(() => n || [], [
143
- n
144
- ]), C = f(o, H), E = f(o, q), I = f(o, $), F = f(o, B);
145
- return /* @__PURE__ */ e.createElement(c, {
146
- fieldId: t,
147
- renderLabel: () => C,
148
- renderInput: () => /* @__PURE__ */ e.createElement(oe, {
149
- id: p,
150
- ariaLabelledBy: a,
151
- ariaDescribedBy: L,
152
- required: r,
153
- onBlur: m,
154
- onFocus: l
155
- }, /* @__PURE__ */ e.createElement(z, {
156
- "aria-labelledby": a,
157
- value: h,
158
- onChange: s,
159
- isDisabled: u,
160
- isReadOnly: b,
161
- isRequired: r,
162
- isInvalid: d
163
- }, E)),
164
- renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, F, I)
165
- });
166
- };
167
- V.Option = T;
168
- T.Label = P;
169
- i.Label = H;
170
- i.Control = q;
171
- i.Options = V;
172
- i.OtherInput = W;
173
- i.Description = $;
174
- i.Error = B;
175
- const Ee = "_control_7oh59_1", Oe = "_options_7oh59_7", be = "_option_7oh59_7", fe = "_optionHover_7oh59_72", Le = "_optionSelected_7oh59_72", R = {
176
- control: Ee,
177
- options: Oe,
178
- option: be,
179
- optionHover: fe,
180
- optionSelected: Le
181
- }, _e = ({ content: o, locale: t }) => /* @__PURE__ */ e.createElement(j, {
182
- content: o,
183
- locale: t
184
- }), Ce = {
185
- base: R.option,
186
- selected: R.optionSelected,
187
- hover: R.optionHover
188
- }, $e = () => {
189
- const o = de({
190
- globalClasses: ce,
191
- moduleClasses: Ce
192
- }), t = me();
193
- return /* @__PURE__ */ e.createElement(i, null, /* @__PURE__ */ e.createElement(i.Label, {
194
- className: S(ne, D.label)
195
- }, /* @__PURE__ */ e.createElement(i.Label.Required, {
196
- className: S(se, D.requiredMark)
197
- })), /* @__PURE__ */ e.createElement(i.Control, {
198
- className: R.control
199
- }, /* @__PURE__ */ e.createElement(i.Options, {
200
- className: S(re, R.options)
201
- }, /* @__PURE__ */ e.createElement(i.Options.Option, {
202
- className: ({ isSelected: n, isHovered: s }) => o({
203
- isSelected: n,
204
- isHovered: s
205
- })
206
- }, /* @__PURE__ */ e.createElement(i.Options.Option.Label, {
207
- className: ue.optionLabel
208
- }))), /* @__PURE__ */ e.createElement(i.OtherInput, {
209
- className: t
210
- })), /* @__PURE__ */ e.createElement(i.Error, {
211
- className: S(le, D.error)
212
- }, /* @__PURE__ */ e.createElement(ae, null), /* @__PURE__ */ e.createElement(i.Error.Text, null)), /* @__PURE__ */ e.createElement(i.Description, {
213
- className: S(ie, D.description)
214
- }, _e));
215
- };
216
- export {
217
- $e as T
218
- };