@wix/form-elements 1.79.0 → 1.81.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 (106) hide show
  1. package/dist/component/{appointment-rac-lokvpd_p.js → appointment-rac-DmwbqZse.js} +82 -82
  2. package/dist/component/{bookings-address-rac-CU5NjBsy.js → bookings-address-rac-RCzVU87c.js} +1 -1
  3. package/dist/component/{bookings-email-rac-h3VGXrSQ.js → bookings-email-rac-Df_Wte1_.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-BtsTk_1b.js → bookings-first-name-rac-BmdRGYxF.js} +1 -1
  5. package/dist/component/{bookings-header-rac-BApE1hIE.js → bookings-header-rac-DewQWtkZ.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-BnO5iij1.js → bookings-last-name-rac-DmmNBuqy.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-BT1npKru.js → bookings-login-bar-rac-QskvFo0C.js} +5 -5
  8. package/dist/component/{bookings-phone-rac-DWf0haGa.js → bookings-phone-rac-7wn8IXna.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-C79XHlRL.js → bookings-rich-text-rac-B5nk0BlD.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-DNvhTChN.js → checkbox-field-rac-BnVNfYWL.js} +5 -5
  11. package/dist/component/{checkbox-group-field-headless-6hzWQkif.js → checkbox-group-field-headless-Bx5Y-RMP.js} +3 -3
  12. package/dist/component/{checkbox-group-field-rac-DbaB5Fx6.js → checkbox-group-field-rac-CZW28rj5.js} +7 -7
  13. package/dist/component/{checkbox-group-rac-BsKKhTeh.js → checkbox-group-rac-B20t8dTB.js} +1 -1
  14. package/dist/component/{checkbox-rac-Dx7LXOdw.js → checkbox-rac-ifC6qSE8.js} +1 -1
  15. package/dist/component/{contacts-address-rac-DJZ8_DKm.js → contacts-address-rac-XJRKvPlp.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-CWvsa7Kq.js → contacts-birthdate-rac-CKYESrPO.js} +1 -1
  17. package/dist/component/{contacts-company-rac-DgF8QpOb.js → contacts-company-rac-BXwEeb0p.js} +1 -1
  18. package/dist/component/{contacts-email-rac-CVqiij34.js → contacts-email-rac-D8Yspo_m.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-BwsRVRHq.js → contacts-first-name-rac-mvCGP1LJ.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-Blgm2DBB.js → contacts-last-name-rac-Clg9RXal.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-Dhtv3PGY.js → contacts-phone-rac-qEwjhByI.js} +1 -1
  22. package/dist/component/{contacts-position-rac-DYebFQea.js → contacts-position-rac-Bh8fvf2M.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-B_cvGaYj.js → contacts-subscribe-rac-DEQ2XkZo.js} +2 -2
  24. package/dist/component/{contacts-tax-id-rac-B_F4I7rf.js → contacts-tax-id-rac-0DUZ4tJz.js} +1 -1
  25. package/dist/component/{date-availability-Cc4kd1Yk.js → date-availability-2ek2RtXx.js} +1 -1
  26. package/dist/component/{date-input-field-rac-C__QbeDM.js → date-input-field-rac-Bp4SQB-t.js} +29 -29
  27. package/dist/component/{date-input-rac-BhzbmHYK.js → date-input-rac-CYsJcMe5.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-CASH891N.js → date-picker-field-rac-BGQvnSYI.js} +9 -9
  29. package/dist/component/{date-picker-rac-CMYAA925.js → date-picker-rac-BVncggYR.js} +1 -1
  30. package/dist/component/{date-time-input-field-rac-DPuxZ68o.js → date-time-input-field-rac-B1mggelc.js} +33 -33
  31. package/dist/component/{date-time-input-rac-BTJhrUXG.js → date-time-input-rac-DzdCno0L.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-5zlp2x1M.js → dext-checkbox-group-rac-CNCpeolD.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-Cn5u395b.js → dext-checkbox-rac-BYDQ58Mo.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-CFfQwbC_.js → dext-date-picker-rac-aYYk8Nrl.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-zRYi-0W6.js → dext-date-time-input-rac-v2v974p5.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-CtlNh5vF.js → dext-dropdown-rac-C846KZCe.js} +1 -1
  37. package/dist/component/{dext-email-rac-BQF4M5Mf.js → dext-email-rac-izjbfME9.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-GR4vTWMp.js → dext-number-input-rac-CnOFsD7l.js} +1 -1
  39. package/dist/component/{dext-phone-rac-COCdZPr9.js → dext-phone-rac-D8GMXD88.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-ZpHitbT0.js → dext-radio-group-rac-BtiyGCRh.js} +2 -2
  41. package/dist/component/{dext-rating-input-rac-Er2HC9eD.js → dext-rating-input-rac-BHJ1kitb.js} +1 -1
  42. package/dist/component/{dext-tags-rac-EciVMPQ0.js → dext-tags-rac-CvNjwS5R.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-D6JxrykV.js → dext-text-area-rac-X5L0Q3sC.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-CD3xkLpw.js → dext-text-input-rac-swkyAJqC.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-BNqCYy-H.js → dext-url-input-rac-BYlXOAkz.js} +1 -1
  46. package/dist/component/donation-rac-CDWLBZZM.js +318 -0
  47. package/dist/component/{dropdown-field-headless-NMc4cFx2.js → dropdown-field-headless-JJzbZvps.js} +3 -3
  48. package/dist/component/{dropdown-field-rac-hSbwxz3M.js → dropdown-field-rac-BodpIQ9Q.js} +5 -5
  49. package/dist/component/{dropdown-rac-DY2QSx-Q.js → dropdown-rac-Bfbxxx9k.js} +1 -1
  50. package/dist/component/{ecom-address-rac-CGlQmW6l.js → ecom-address-rac-BCnsL5tr.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-K3Dx-Boa.js → ecom-subscription-checkbox-rac-CNSdI_ty.js} +3 -3
  52. package/dist/component/{email-input-field-rac-DCKR6Yco.js → email-input-field-rac-Btaa4O5T.js} +48 -48
  53. package/dist/component/{events-repeater-rac-DS2hIZ81.js → events-repeater-rac-xBwqJddt.js} +10 -10
  54. package/dist/component/{events-rsvp-rac-iSG0hWt3.js → events-rsvp-rac-D90PwkHd.js} +3 -3
  55. package/dist/component/{field-error-headless-Lb5aaoR3.js → field-error-headless-BErhh9GG.js} +1 -1
  56. package/dist/component/{field-label-headless-C1VDQVhB.js → field-label-headless-BGyK-5xW.js} +1 -1
  57. package/dist/component/{file-upload-rac-BEUXTVXa.js → file-upload-rac-MxH3CVml.js} +21 -21
  58. package/dist/component/{fixed-payment-rac-BwrQJQ6w.js → fixed-payment-rac-DpBA9irF.js} +13 -13
  59. package/dist/component/{form-element-classes-BuM-vthE.js → form-element-classes-jC8D0LnK.js} +77 -63
  60. package/dist/component/{form-1k13yOes.js → form-f0tqdMye.js} +69 -69
  61. package/dist/component/form.css +1 -1
  62. package/dist/component/form.js +1 -1
  63. package/dist/component/{header-field-rac-BeFf5qfw.js → header-field-rac-BXxFqu9u.js} +3 -3
  64. package/dist/component/{header-rac-Cqvmjc8G.js → header-rac-BN70esac.js} +1 -1
  65. package/dist/component/image-choice-rac-DLBGIBXL.js +158 -0
  66. package/dist/component/{index-DhL-iYwY.js → index-BvB-uE1H.js} +2 -2
  67. package/dist/component/{index-B0SdXZJm.js → index-DXLEHYlA.js} +4 -4
  68. package/dist/component/{isObjectLike-DOWF1bjK.js → isObjectLike-BYOX5XY4.js} +1 -1
  69. package/dist/component/{multiline-address-field-rac-CBhxL2MB.js → multiline-address-field-rac-fcQYnPlO.js} +52 -52
  70. package/dist/component/{multiline-address-rac-BgZnu3UR.js → multiline-address-rac-D82Gbj3n.js} +1 -1
  71. package/dist/component/{number-input-field-rac-Cq0KLrSv.js → number-input-field-rac-B0-4Rz3w.js} +16 -16
  72. package/dist/component/{number-input-rac-ovbP_aP5.js → number-input-rac-Bnsvb-SO.js} +1 -1
  73. package/dist/component/{password-rac-DLKw8FXz.js → password-rac-BdBjFa8y.js} +15 -15
  74. package/dist/component/{payment-input-rac-EHufj8Y0.js → payment-input-rac-DkAGOvaF.js} +18 -18
  75. package/dist/component/{phone-input-field-rac-D1KzskYy.js → phone-input-field-rac-Ce_wuE46.js} +54 -54
  76. package/dist/component/{phone-rac-D71sfMS7.js → phone-rac-DslINtcH.js} +1 -1
  77. package/dist/component/{product-list-rac-BGrTM8kv.js → product-list-rac-C4P_SOyG.js} +25 -25
  78. package/dist/component/{quiz-radio-group-rac-BU2GBlqo.js → quiz-radio-group-rac-noy4fmD8.js} +2 -2
  79. package/dist/component/{radio-button-module-classes-BqNsWvgU.js → radio-button-module-classes-DXQ1UlmI.js} +3 -3
  80. package/dist/component/{radio-group-field-rac-BSY-fyxl.js → radio-group-field-rac-CYBDq7R1.js} +5 -5
  81. package/dist/component/{radio-group-rac-geRsORyh.js → radio-group-rac-CGHQFyJY.js} +1 -1
  82. package/dist/component/{rating-input-field-rac-D6gRUiSX.js → rating-input-field-rac-elaferlI.js} +18 -18
  83. package/dist/component/{rating-input-rac-BMtu7e5q.js → rating-input-rac-fnOtTKN8.js} +1 -1
  84. package/dist/component/{rich-content-rac.module-CFMzPWHV.js → rich-content-rac.module-DbwuwQeo.js} +1 -1
  85. package/dist/component/{rich-text-field-rac-D0Klsdj7.js → rich-text-field-rac-DtcQC8zU.js} +3 -3
  86. package/dist/component/{rich-text-rac-o7idQY51.js → rich-text-rac-CuT97sby.js} +1 -1
  87. package/dist/component/{service-dropdown-rac-BXq358Pw.js → service-dropdown-rac-rk2tzikX.js} +24 -24
  88. package/dist/component/{services-multi-choice-rac-DVRk7Ayt.js → services-multi-choice-rac-BMQyF_xs.js} +7 -7
  89. package/dist/component/{signature-rac-CblU7c_6.js → signature-rac-DeV9C6ta.js} +41 -41
  90. package/dist/component/{submit-button-rac-DYz_oLbv.js → submit-button-rac-BpN-FYtM.js} +2 -2
  91. package/dist/component/tags-field-rac-ByC9DnyH.js +217 -0
  92. package/dist/component/{tags-rac-yRjGACmm.js → tags-rac-Dabz4jHd.js} +1 -1
  93. package/dist/component/{text-area-field-rac-C4ytlqwT.js → text-area-field-rac-CtSa8XW_.js} +14 -14
  94. package/dist/component/{text-area-rac-DkCdp41z.js → text-area-rac-CDLF-_56.js} +1 -1
  95. package/dist/component/{text-input-field-rac-TSY90sCu.js → text-input-field-rac-C6fQYKhI.js} +5 -5
  96. package/dist/component/{text-input-headless-D3b0XErK.js → text-input-headless-BwVLU9cp.js} +3 -3
  97. package/dist/component/{text-input-rac-CKiScYKV.js → text-input-rac-CoGTzfo1.js} +1 -1
  98. package/dist/component/{time-input-rac-Cjs21F9f.js → time-input-rac-DQDupKTA.js} +17 -17
  99. package/dist/component/{url-input-field-rac-Bf5NoN4o.js → url-input-field-rac-4T8gcMHH.js} +8 -8
  100. package/dist/component/{url-input-rac-DqgvJboS.js → url-input-rac-_d6XRdKX.js} +1 -1
  101. package/dist/component/{use-element-state-class-name-DkaI8J4Y.js → use-element-state-class-name-BqmaTba3.js} +1 -1
  102. package/dist/component/{use-service-options-base-cL2N21mJ.js → use-service-options-base-CRgxxz7b.js} +1 -1
  103. package/package.json +2 -2
  104. package/dist/component/donation-rac-Du_qsPD6.js +0 -307
  105. package/dist/component/image-choice-rac-DU1Tf2-T.js +0 -146
  106. package/dist/component/tags-field-rac-D068ijAD.js +0 -206
@@ -1,146 +0,0 @@
1
- import e, { useMemo as M, useCallback as y, useRef as x } from "react";
2
- import { RicosViewer as T } from "@wix/ricos/viewer";
3
- import d from "classnames";
4
- import { ai as L, af as k, ab as B, ak as H, ac as P } from "./form-1k13yOes.js";
5
- import { CheckboxGroup as q, CheckboxField as G, CheckboxButton as U } from "react-aria-components";
6
- import { f as p, a as g } from "./find-child-C60k4CxG.js";
7
- import { L as w, g as z } from "./field-label-headless-C1VDQVhB.js";
8
- import { D as V, E as K } from "./field-error-headless-Lb5aaoR3.js";
9
- import { F as Q } from "./fieldset-headless-CD3fds9J.js";
10
- import { E as Y } from "./error-icon-hZxQ6DEy.js";
11
- import { s as b } from "./field-rac.module-ColNPUt0.js";
12
- import { z as $, P as j, t as J, u as W, v as X, p as Z, i as ee, F as te } from "./form-element-classes-BuM-vthE.js";
13
- const a = ({ children: t }) => {
14
- const { id: s, value: o, onChange: n, disabled: l, readOnly: i, required: r, onBlur: c, onFocus: m, hasError: E, FieldLayout: f } = L(), { inputId: C, labelId: _, ariaDescribedBy: O } = k(), R = p(t, a.Label), D = p(t, a.Options), N = p(t, a.Description), S = p(t, a.Error), A = M(() => o || [], [
15
- o
16
- ]), h = y((v) => {
17
- n == null || n(v);
18
- }, [
19
- n
20
- ]);
21
- return /* @__PURE__ */ e.createElement(f, {
22
- fieldId: s,
23
- renderLabel: () => R,
24
- renderInput: () => /* @__PURE__ */ e.createElement(Q, {
25
- id: C,
26
- ariaLabelledBy: _,
27
- ariaDescribedBy: O,
28
- required: r,
29
- onBlur: c,
30
- onFocus: m
31
- }, /* @__PURE__ */ e.createElement(q, {
32
- "aria-labelledby": _,
33
- value: A,
34
- onChange: h,
35
- isDisabled: l,
36
- isReadOnly: i,
37
- isRequired: r,
38
- isInvalid: E
39
- }, D)),
40
- renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, S, N)
41
- });
42
- }, F = ({ children: t, className: s }) => {
43
- const { isMobile: o } = B(), { id: n, options: l, numberOfColumns: i } = L(), r = p(t, F.Option);
44
- return /* @__PURE__ */ e.createElement("div", {
45
- className: s,
46
- "data-columns": o ? 1 : i
47
- }, l == null ? void 0 : l.map((c, m) => g(r, {
48
- key: c.id || c.label,
49
- option: c,
50
- isFirst: m === 0,
51
- fieldId: n
52
- })));
53
- }, ae = ({ className: t }) => /* @__PURE__ */ e.createElement("div", {
54
- "aria-hidden": "true",
55
- className: t
56
- }), ne = ({ className: t, ...s }) => {
57
- var m, E;
58
- const { option: o } = s, { choiceImageResize: n, choiceImageAlignment: l } = L(), i = (m = o.media) == null ? void 0 : m.image;
59
- if (!i)
60
- return null;
61
- const r = z(i, i.width, i.height);
62
- if (!r)
63
- return null;
64
- const c = ((E = o.media) == null ? void 0 : E.altText) || o.altText || i.altText || "";
65
- return /* @__PURE__ */ e.createElement("img", {
66
- className: t,
67
- src: r,
68
- alt: c,
69
- "data-fit": n,
70
- "data-alignment": l,
71
- "data-hook": "image-choice-option-image"
72
- });
73
- }, oe = ({ className: t, ...s }) => {
74
- const { option: o } = s;
75
- return !o.label || o.isLabelHidden ? null : /* @__PURE__ */ e.createElement("span", {
76
- className: t
77
- }, o.label);
78
- }, u = ({ children: t, className: s, ...o }) => {
79
- const { option: n, isFirst: l = !1, fieldId: i } = o, { disabled: r, readOnly: c, hasError: m } = L(), E = x(null);
80
- H(() => {
81
- var O;
82
- l && ((O = E.current) == null || O.focus({
83
- preventScroll: !0
84
- }));
85
- }, i);
86
- const f = p(t, u.Input), C = p(t, u.Image), _ = p(t, u.Label);
87
- return /* @__PURE__ */ e.createElement(G, {
88
- value: n.label,
89
- isDisabled: r,
90
- isReadOnly: c,
91
- isInvalid: m
92
- }, /* @__PURE__ */ e.createElement(U, {
93
- ref: E,
94
- "aria-label": n.isLabelHidden ? n.label : void 0,
95
- className: s,
96
- "data-hook": `image-choice-${n.label}`
97
- }, f, g(C, {
98
- option: n
99
- }), g(_, {
100
- option: n
101
- })));
102
- };
103
- u.Input = ae;
104
- u.Image = ne;
105
- u.Label = oe;
106
- a.Label = w;
107
- a.Options = F;
108
- F.Option = u;
109
- a.Description = V;
110
- a.Error = K;
111
- const se = "_options_v6xi4_1", ie = "_optionInput_v6xi4_25", le = "_option_v6xi4_1", re = "_optionLabel_v6xi4_95", ce = "_optionImage_v6xi4_128", I = {
112
- options: se,
113
- optionInput: ie,
114
- option: le,
115
- optionLabel: re,
116
- optionImage: ce
117
- }, me = ({ content: t, locale: s }) => /* @__PURE__ */ e.createElement(T, {
118
- content: t,
119
- locale: s
120
- }), pe = () => {
121
- const t = P(te.IMAGE_CHOICE_OPTION);
122
- return /* @__PURE__ */ e.createElement(a, null, /* @__PURE__ */ e.createElement(a.Label, {
123
- className: d($, b.label)
124
- }, /* @__PURE__ */ e.createElement(a.Label.Required, {
125
- className: d(j, b.requiredMark)
126
- })), /* @__PURE__ */ e.createElement(a.Options, {
127
- className: d(J, I.options)
128
- }, /* @__PURE__ */ e.createElement(a.Options.Option, {
129
- className: ({ isSelected: s }) => d(W, I.option, t, {
130
- [X]: s
131
- })
132
- }, /* @__PURE__ */ e.createElement(a.Options.Option.Input, {
133
- className: I.optionInput
134
- }), /* @__PURE__ */ e.createElement(a.Options.Option.Image, {
135
- className: I.optionImage
136
- }), /* @__PURE__ */ e.createElement(a.Options.Option.Label, {
137
- className: I.optionLabel
138
- }))), /* @__PURE__ */ e.createElement(a.Error, {
139
- className: d(Z, b.error)
140
- }, /* @__PURE__ */ e.createElement(Y, null), /* @__PURE__ */ e.createElement(a.Error.Text, null)), /* @__PURE__ */ e.createElement(a.Description, {
141
- className: d(ee, b.description)
142
- }, me));
143
- }, Re = () => /* @__PURE__ */ e.createElement(pe, null);
144
- export {
145
- Re as ImageChoiceRAC
146
- };
@@ -1,206 +0,0 @@
1
- import { RicosViewer as z } from "@wix/ricos/viewer";
2
- import _ from "classnames";
3
- import e, { useMemo as F, useState as K, useRef as V, useLayoutEffect as Q, useCallback as k } from "react";
4
- import { ai as y, af as Y, as as T, ab as j, ak as w, ac as J } from "./form-1k13yOes.js";
5
- import { CheckboxGroup as X, TextField as Z, Input as ee, CheckboxField as te, CheckboxButton as ae } from "react-aria-components";
6
- import { f, a as P } from "./find-child-C60k4CxG.js";
7
- import { E as x, D as B } from "./field-error-headless-Lb5aaoR3.js";
8
- import { L as $ } from "./field-label-headless-C1VDQVhB.js";
9
- import { F as ne } from "./fieldset-headless-CD3fds9J.js";
10
- import { N as g } from "./options-layout-constants-DEfIEJWD.js";
11
- import { E as se } from "./error-icon-hZxQ6DEy.js";
12
- import { s as S } from "./field-rac.module-ColNPUt0.js";
13
- import { z as oe, P as re, $ as le, a0 as ie, a1 as ce, y as ue, p as de, i as me, F as pe } from "./form-element-classes-BuM-vthE.js";
14
- import { o as Ee } from "./options-rac.module-KM-VT_KY.js";
15
- const N = "Other", he = (a, t) => {
16
- const c = t.length + 2;
17
- return (a.find((s) => s.startsWith(`${t}: `)) || "").slice(c);
18
- }, Oe = (a) => a.map((t) => t.value ?? t.label), W = ({ className: a, ...t }) => {
19
- const { label: l } = t;
20
- return /* @__PURE__ */ e.createElement("span", {
21
- className: a
22
- }, l);
23
- }, q = ({ className: a }) => {
24
- const { value: t, onChange: l, addOtherLabel: c, addOtherPlaceholder: i, otherInputCharacterLimit: s, disabled: u, readOnly: b, hasError: d } = y(), { t: m } = T(), o = c || m("add-other.default-other-option-label") || N, p = F(() => he(t || [], o), [
25
- t,
26
- o
27
- ]), [n, L] = K(p), E = V(l);
28
- Q(() => {
29
- E.current = l;
30
- });
31
- const I = k((h) => {
32
- L(h);
33
- const C = (t || []).filter((O) => !O.startsWith(`${o}:`) && O !== o), R = h ? `${o}: ${h}` : o;
34
- E.current([
35
- ...C,
36
- R
37
- ]);
38
- }, [
39
- t,
40
- o
41
- ]);
42
- return /* @__PURE__ */ e.createElement(Z, {
43
- value: n,
44
- onChange: I,
45
- isDisabled: u,
46
- isReadOnly: b,
47
- isInvalid: d,
48
- "aria-label": o
49
- }, /* @__PURE__ */ e.createElement(ee, {
50
- "data-hook": "tags-other-input",
51
- "data-filled": n ? !0 : void 0,
52
- placeholder: i,
53
- maxLength: s,
54
- className: a
55
- }));
56
- }, v = ({ children: a, className: t, ...l }) => {
57
- const { value: c, label: i, isOther: s, isFirstOption: u } = l, { id: b, value: d, onChange: m, options: o, disabled: p, readOnly: n, hasError: L } = y(), E = V(null);
58
- w(() => {
59
- var O;
60
- u && ((O = E.current) == null || O.focus({
61
- preventScroll: !0
62
- }));
63
- }, b);
64
- const I = f(a, W), h = F(() => d || [], [
65
- d
66
- ]), C = F(() => s ? h.find((O) => O === i || O.startsWith(`${i}: `)) || i : c, [
67
- s,
68
- h,
69
- i,
70
- c
71
- ]), R = k((O) => {
72
- const U = Oe(o || []), M = h.filter((H) => U.includes(H));
73
- m(O ? [
74
- ...M,
75
- i
76
- ] : M);
77
- }, [
78
- i,
79
- m,
80
- o,
81
- h
82
- ]);
83
- return /* @__PURE__ */ e.createElement(te, {
84
- inputRef: E,
85
- value: C,
86
- onChange: s ? R : void 0,
87
- isDisabled: p,
88
- isReadOnly: n,
89
- isInvalid: L
90
- }, /* @__PURE__ */ e.createElement(ae, {
91
- className: t,
92
- "data-hook": `tags-${s ? N : c}`
93
- }, P(I, {
94
- value: c,
95
- label: i,
96
- isOther: s,
97
- isFirstOption: u
98
- })));
99
- }, A = ({ children: a, className: t }) => {
100
- const { options: l, addOther: c, addOtherLabel: i, numberOfColumns: s = g.FREE_FLOW } = y(), { isMobile: u } = j(), { t: b } = T(), d = u && s !== g.FREE_FLOW ? g.ONE : s, m = i || b("add-other.default-other-option-label") || N, o = f(a, v), p = F(() => {
101
- const n = l || [];
102
- return c ? [
103
- ...n,
104
- {
105
- label: m,
106
- value: m,
107
- isOther: !0
108
- }
109
- ] : n;
110
- }, [
111
- l,
112
- c,
113
- m
114
- ]);
115
- return p.length === 0 ? null : /* @__PURE__ */ e.createElement("div", {
116
- className: t,
117
- "data-columns": d
118
- }, p.map((n, L) => {
119
- const E = n.value ?? n.label;
120
- return P(o, {
121
- key: n.isOther ? N : E,
122
- value: E,
123
- label: n.label,
124
- isOther: n.isOther,
125
- isFirstOption: L === 0
126
- });
127
- }));
128
- }, G = ({ children: a, className: t }) => {
129
- const { addOther: l, addOtherLabel: c, hasError: i, readOnly: s, value: u } = y(), { t: b } = T(), d = c || b("add-other.default-other-option-label") || N, m = f(a, A), o = f(a, q), p = F(() => !l || !u ? !1 : u.some((n) => n === d || n.startsWith(`${d}:`)), [
130
- l,
131
- u,
132
- d
133
- ]);
134
- return /* @__PURE__ */ e.createElement("div", {
135
- className: t,
136
- "data-invalid": i,
137
- "data-readonly": s
138
- }, m, p && o);
139
- }, r = ({ children: a }) => {
140
- const { id: t, value: l, onChange: c, FieldLayout: i, required: s, disabled: u, readOnly: b, hasError: d, onBlur: m, onFocus: o } = y(), { inputId: p, labelId: n, ariaDescribedBy: L } = Y(), E = F(() => l || [], [
141
- l
142
- ]), I = f(a, $), h = f(a, G), C = f(a, B), R = f(a, x);
143
- return /* @__PURE__ */ e.createElement(i, {
144
- fieldId: t,
145
- renderLabel: () => I,
146
- renderInput: () => /* @__PURE__ */ e.createElement(ne, {
147
- id: p,
148
- ariaLabelledBy: n,
149
- ariaDescribedBy: L,
150
- required: s,
151
- onBlur: m,
152
- onFocus: o
153
- }, /* @__PURE__ */ e.createElement(X, {
154
- "aria-labelledby": n,
155
- value: E,
156
- onChange: c,
157
- isDisabled: u,
158
- isReadOnly: b,
159
- isRequired: s,
160
- isInvalid: d
161
- }, h)),
162
- renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, R, C)
163
- });
164
- };
165
- A.Option = v;
166
- v.Label = W;
167
- r.Label = $;
168
- r.Control = G;
169
- r.Options = A;
170
- r.OtherInput = q;
171
- r.Description = B;
172
- r.Error = x;
173
- const be = "_control_1t32y_1", fe = "_options_1t32y_7", Le = "_option_1t32y_7", D = {
174
- control: be,
175
- options: fe,
176
- option: Le
177
- }, _e = ({ content: a, locale: t }) => /* @__PURE__ */ e.createElement(z, {
178
- content: a,
179
- locale: t
180
- }), ke = () => {
181
- const a = J(pe.TAGS_OPTION);
182
- return /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement(r.Label, {
183
- className: _(oe, S.label)
184
- }, /* @__PURE__ */ e.createElement(r.Label.Required, {
185
- className: _(re, S.requiredMark)
186
- })), /* @__PURE__ */ e.createElement(r.Control, {
187
- className: D.control
188
- }, /* @__PURE__ */ e.createElement(r.Options, {
189
- className: _(le, D.options)
190
- }, /* @__PURE__ */ e.createElement(r.Options.Option, {
191
- className: ({ isSelected: t }) => _(ie, D.option, a, {
192
- [ce]: t
193
- })
194
- }, /* @__PURE__ */ e.createElement(r.Options.Option.Label, {
195
- className: Ee.optionLabel
196
- }))), /* @__PURE__ */ e.createElement(r.OtherInput, {
197
- className: _(ue, S.input)
198
- })), /* @__PURE__ */ e.createElement(r.Error, {
199
- className: _(de, S.error)
200
- }, /* @__PURE__ */ e.createElement(se, null), /* @__PURE__ */ e.createElement(r.Error.Text, null)), /* @__PURE__ */ e.createElement(r.Description, {
201
- className: _(me, S.description)
202
- }, _e));
203
- };
204
- export {
205
- ke as T
206
- };