@stackone/malachite 2.85.0 → 2.87.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 (56) hide show
  1. package/COMPONENTS.md +6 -5
  2. package/dist/components/Accordion.js +130 -103
  3. package/dist/components/Accordion.js.map +1 -1
  4. package/dist/components/Button.js.map +1 -1
  5. package/dist/components/Card.js +128 -75
  6. package/dist/components/Card.js.map +1 -1
  7. package/dist/components/FilterSearch.js +228 -224
  8. package/dist/components/FilterSearch.js.map +1 -1
  9. package/dist/components/FrameHeader.js +36 -0
  10. package/dist/components/FrameHeader.js.map +1 -0
  11. package/dist/components/LoadingBar.js +5 -5
  12. package/dist/components/LoadingBar.js.map +1 -1
  13. package/dist/components/MultiSelect.js +431 -382
  14. package/dist/components/MultiSelect.js.map +1 -1
  15. package/dist/components/SplitButton.js.map +1 -1
  16. package/dist/components/Surface.js +211 -159
  17. package/dist/components/Surface.js.map +1 -1
  18. package/dist/components/Table/Table.js +630 -606
  19. package/dist/components/Table/Table.js.map +1 -1
  20. package/dist/components/TimeBarChart/TimeBarChart.js +241 -0
  21. package/dist/components/TimeBarChart/TimeBarChart.js.map +1 -0
  22. package/dist/components/TimeBarChart/TimeBarChartAxes.js +49 -0
  23. package/dist/components/TimeBarChart/TimeBarChartAxes.js.map +1 -0
  24. package/dist/components/TimeBarChart/TimeBarChartBars.js +58 -0
  25. package/dist/components/TimeBarChart/TimeBarChartBars.js.map +1 -0
  26. package/dist/components/TimeBarChart/TimeBarChartLegend.js +29 -0
  27. package/dist/components/TimeBarChart/TimeBarChartLegend.js.map +1 -0
  28. package/dist/components/TimeBarChart/TimeBarChartTable.js +33 -0
  29. package/dist/components/TimeBarChart/TimeBarChartTable.js.map +1 -0
  30. package/dist/components/TimeBarChart/TimeBarChartTooltip.js +77 -0
  31. package/dist/components/TimeBarChart/TimeBarChartTooltip.js.map +1 -0
  32. package/dist/components/TimeBarChart/stackLayout.js +25 -0
  33. package/dist/components/TimeBarChart/stackLayout.js.map +1 -0
  34. package/dist/components/TimeBarChart/timeBuckets.js +133 -0
  35. package/dist/components/TimeBarChart/timeBuckets.js.map +1 -0
  36. package/dist/components/TimeBarChart/tones.js +10 -0
  37. package/dist/components/TimeBarChart/tones.js.map +1 -0
  38. package/dist/components/buttonStyles.js +2 -0
  39. package/dist/components/buttonStyles.js.map +1 -1
  40. package/dist/components/dateMath.js +1 -0
  41. package/dist/components/dateMath.js.map +1 -1
  42. package/dist/components/filterSearchModel.js +53 -45
  43. package/dist/components/filterSearchModel.js.map +1 -1
  44. package/dist/components/focusRing.js +8 -7
  45. package/dist/components/focusRing.js.map +1 -1
  46. package/dist/components/frameStyles.js +14 -0
  47. package/dist/components/frameStyles.js.map +1 -0
  48. package/dist/components/headerContent.js +10 -0
  49. package/dist/components/headerContent.js.map +1 -0
  50. package/dist/index.d.ts +149 -18
  51. package/dist/index.js +24 -22
  52. package/dist/index.js.map +1 -1
  53. package/dist/tailwind.css.js +1 -1
  54. package/dist/theme.js +340 -340
  55. package/dist/theme.js.map +1 -1
  56. package/package.json +1 -1
@@ -1,82 +1,85 @@
1
- import { jsx as r, jsxs as w, Fragment as pt } from "react/jsx-runtime";
2
- import fe, { useId as ht, useState as P, useRef as T, useMemo as H, useCallback as h, useEffect as We, useLayoutEffect as gt, useInsertionEffect as bt } from "react";
3
- import { createPortal as vt } from "react-dom";
4
- import xt, { useFormFieldIds as yt } from "./BaseFormComponent.js";
5
- import wt from "./CustomIcons/CaretDownIcon.js";
6
- import Et from "./CustomIcons/InfoFilledIcon.js";
7
- import It from "./CustomIcons/SearchIcon.js";
8
- import $e from "./LoadingInput.js";
9
- import St from "./Spinner.js";
10
- import { Tag as Tt } from "./Tag.js";
11
- import Be from "./Tooltip.js";
12
- import { getDeepActiveElement as kt } from "./activeElement.js";
13
- import { CONTROL_TEXT_SIZE_CLASS as ue, CONTROL_TEXT_SIZE as Lt } from "./controlTextSize.js";
14
- import { controlWidthStyle as Ge } from "./controlWidth.js";
15
- import { getTriggerVisual as Rt, DROPDOWN_TRIGGER_ATTR as Ot } from "./dropdownTriggerStyle.js";
16
- import { pushEscapeLayer as _t } from "./escapeLayers.js";
17
- import { measureMenuGeometry as Nt, MENU_MAX_HEIGHT_PX as Ct, MENU_SPECS as z } from "./floatingMenuGeometry.js";
18
- import { FOCUS_RING as At } from "./focusRing.js";
19
- import { hasBadge as Dt } from "./hasBadge.js";
20
- import { ensureMultiSelectPanelStyles as Ht } from "./optionRowStyles.js";
21
- import { usePopupLayer as Pt } from "./overlayLayers.js";
22
- import { useTopLayer as Mt } from "./topLayer.js";
23
- import { tooltipLines as Wt, isCut as $t, isClamped as Bt } from "./truncatedLines.js";
24
- const Gt = fe.lazy(() => import("./ActionMenuTagHost.js")), zt = {
1
+ import { jsx as r, jsxs as E, Fragment as je } from "react/jsx-runtime";
2
+ import pe, { useId as Ve, useState as $, useRef as k, useMemo as W, useCallback as x, useEffect as Be, useLayoutEffect as Et, useInsertionEffect as It } from "react";
3
+ import { createPortal as St } from "react-dom";
4
+ import Tt, { useFormFieldIds as kt } from "./BaseFormComponent.js";
5
+ import Lt from "./CustomIcons/CaretDownIcon.js";
6
+ import Rt from "./CustomIcons/InfoFilledIcon.js";
7
+ import Ot from "./CustomIcons/SearchIcon.js";
8
+ import { FieldMessage as _t } from "./FieldMessage.js";
9
+ import { FormItem as Nt } from "./FormItem.js";
10
+ import Ge from "./LoadingInput.js";
11
+ import At from "./Spinner.js";
12
+ import { Tag as Mt } from "./Tag.js";
13
+ import ze from "./Tooltip.js";
14
+ import { getDeepActiveElement as Ke } from "./activeElement.js";
15
+ import { CONTROL_TEXT_SIZE_CLASS as me, CONTROL_TEXT_SIZE as Dt } from "./controlTextSize.js";
16
+ import { controlWidthStyle as Ye } from "./controlWidth.js";
17
+ import { getTriggerVisual as Ht, DROPDOWN_TRIGGER_ATTR as Ct } from "./dropdownTriggerStyle.js";
18
+ import { pushEscapeLayer as Pt } from "./escapeLayers.js";
19
+ import { measureMenuGeometry as Wt, MENU_MAX_HEIGHT_PX as $t, MENU_SPECS as Y } from "./floatingMenuGeometry.js";
20
+ import { FOCUS_RING as Bt } from "./focusRing.js";
21
+ import { hasBadge as Gt } from "./hasBadge.js";
22
+ import { ensureMultiSelectPanelStyles as zt } from "./optionRowStyles.js";
23
+ import { usePopupLayer as Kt } from "./overlayLayers.js";
24
+ import { useTopLayer as Yt } from "./topLayer.js";
25
+ import { useLatestRef as Ut } from "./useLatestRef.js";
26
+ import { tooltipLines as Ft, isCut as jt, isClamped as Vt } from "./truncatedLines.js";
27
+ const Xt = pe.lazy(() => import("./ActionMenuTagHost.js")), qt = {
25
28
  padding: "8px 10px",
26
29
  color: "var(--malachite-text-secondary, rgb(123, 123, 123))"
27
- }, F = {
30
+ }, U = {
28
31
  small: "h-[var(--malachite-control-height-small,28px)]",
29
32
  medium: "h-[var(--malachite-control-height-medium,32px)]",
30
33
  large: "h-[var(--malachite-control-height-large,42px)]"
31
- }, Ft = {
32
- small: `${F.small} gap-[6px] px-2.5 ${ue.small} rounded-[var(--malachite-radius-10,10px)]`,
33
- medium: `${F.medium} gap-[8px] px-3 ${ue.medium} rounded-xl`,
34
- large: `${F.large} gap-[10px] px-4 ${ue.large} rounded-[var(--malachite-radius-xxl,14px)]`
35
- }, Kt = 10, Ke = "ArrowDown", Ye = "ArrowUp", Ue = "Enter", Yt = "Backspace", Ut = /* @__PURE__ */ new Set([Ke, Ye, Ue]), Ve = fe.forwardRef(
36
- ({ triggerRole: n, disabled: k, children: R, ...u }, b) => n !== "button" ? /* @__PURE__ */ r(
34
+ }, Zt = {
35
+ small: `${U.small} gap-[6px] px-2.5 ${me.small} rounded-[var(--malachite-radius-10,10px)]`,
36
+ medium: `${U.medium} gap-[8px] px-3 ${me.medium} rounded-xl`,
37
+ large: `${U.large} gap-[10px] px-4 ${me.large} rounded-[var(--malachite-radius-xxl,14px)]`
38
+ }, Jt = 10, Xe = "ArrowDown", qe = "ArrowUp", Ze = "Enter", Qt = "Backspace", er = /* @__PURE__ */ new Set([Xe, qe, Ze]), Je = pe.forwardRef(
39
+ ({ triggerRole: n, disabled: y, children: I, ...s }, b) => n !== "button" ? /* @__PURE__ */ r(
37
40
  "div",
38
41
  {
39
42
  ref: b,
40
43
  role: n,
41
- tabIndex: k ? -1 : 0,
42
- ...u,
43
- children: R
44
+ tabIndex: y ? -1 : 0,
45
+ ...s,
46
+ children: I
44
47
  }
45
48
  ) : /* @__PURE__ */ r(
46
49
  "button",
47
50
  {
48
51
  ref: b,
49
52
  type: "button",
50
- disabled: k,
51
- ...u,
52
- children: R
53
+ disabled: y,
54
+ ...s,
55
+ children: I
53
56
  }
54
57
  )
55
58
  );
56
- Ve.displayName = "TriggerElement";
57
- const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
58
- const k = T(null), R = T(null), u = n.description ? n.descriptionMode ?? "icon" : null, b = u === "subtitle", [N, Z] = P({ label: !0, subtitle: !0 }), C = () => {
59
- const E = $t(k.current), f = Bt(R.current);
60
- return !E && !f && u !== "hover" ? !1 : (Z({ label: E, subtitle: f }), !0);
61
- }, M = u === "hover" || b && N.subtitle, W = (E) => /* @__PURE__ */ r(
62
- Be,
59
+ Je.displayName = "TriggerElement";
60
+ const Ue = 0.6, Fe = 420, tr = ({ option: n }) => {
61
+ const y = k(null), I = k(null), s = n.description ? n.descriptionMode ?? "icon" : null, b = s === "subtitle", [L, B] = $({ label: !0, subtitle: !0 }), _ = () => {
62
+ const v = jt(y.current), i = Vt(I.current);
63
+ return !v && !i && s !== "hover" ? !1 : (B({ label: v, subtitle: i }), !0);
64
+ }, R = s === "hover" || b && L.subtitle, M = (v) => /* @__PURE__ */ r(
65
+ ze,
63
66
  {
64
- text: Wt([
65
- ["label", N.label && n.label],
66
- ["description", M && n.description]
67
+ text: Ft([
68
+ ["label", L.label && n.label],
69
+ ["description", R && n.description]
67
70
  ]),
68
- shouldShow: C,
69
- delay: ze,
71
+ shouldShow: _,
72
+ delay: Ue,
70
73
  maxWidth: Fe,
71
74
  triggerAs: "span",
72
75
  isShrinkable: !0,
73
- describesTrigger: u === "hover",
74
- children: E
76
+ describesTrigger: s === "hover",
77
+ children: v
75
78
  }
76
- ), p = /* @__PURE__ */ r(
79
+ ), d = /* @__PURE__ */ r(
77
80
  "span",
78
81
  {
79
- ref: k,
82
+ ref: y,
80
83
  style: {
81
84
  display: "block",
82
85
  overflow: "hidden",
@@ -86,8 +89,8 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
86
89
  children: n.label
87
90
  }
88
91
  );
89
- return b ? W(
90
- /* @__PURE__ */ w(
92
+ return b ? M(
93
+ /* @__PURE__ */ E(
91
94
  "span",
92
95
  {
93
96
  style: {
@@ -99,11 +102,11 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
99
102
  gap: 2
100
103
  },
101
104
  children: [
102
- p,
105
+ d,
103
106
  /* @__PURE__ */ r(
104
107
  "span",
105
108
  {
106
- ref: R,
109
+ ref: I,
107
110
  style: {
108
111
  fontSize: 12,
109
112
  color: "var(--malachite-text-secondary, rgb(123, 123, 123))",
@@ -122,7 +125,7 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
122
125
  ]
123
126
  }
124
127
  )
125
- ) : /* @__PURE__ */ w(
128
+ ) : /* @__PURE__ */ E(
126
129
  "span",
127
130
  {
128
131
  style: {
@@ -133,12 +136,12 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
133
136
  gap: 6
134
137
  },
135
138
  children: [
136
- W(p),
137
- u === "icon" && /* @__PURE__ */ r(
138
- Be,
139
+ M(d),
140
+ s === "icon" && /* @__PURE__ */ r(
141
+ ze,
139
142
  {
140
143
  text: n.description,
141
- delay: ze,
144
+ delay: Ue,
142
145
  maxWidth: Fe,
143
146
  children: /* @__PURE__ */ r(
144
147
  "span",
@@ -148,8 +151,8 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
148
151
  color: "var(--malachite-text-placeholder, rgb(187, 187, 187))"
149
152
  },
150
153
  "aria-label": "More information",
151
- onClick: (E) => E.stopPropagation(),
152
- children: n.descriptionIcon ?? /* @__PURE__ */ r(Et, { size: 14 })
154
+ onClick: (v) => v.stopPropagation(),
155
+ children: n.descriptionIcon ?? /* @__PURE__ */ r(Rt, { size: 14 })
153
156
  }
154
157
  )
155
158
  }
@@ -157,375 +160,393 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
157
160
  ]
158
161
  }
159
162
  );
160
- }, br = ({
163
+ }, Qe = ({
161
164
  options: n,
162
- value: k,
163
- defaultValue: R,
164
- onChange: u,
165
+ value: y,
166
+ defaultValue: I,
167
+ onChange: s,
165
168
  placeholder: b = "Select",
166
- renderTrigger: N,
167
- searchable: Z,
168
- size: C = "large",
169
- width: M = "auto",
170
- minWidth: W,
171
- disabled: p = !1,
172
- error: E = !1,
173
- loading: f = !1,
174
- label: K,
175
- name: me,
176
- description: q,
177
- tooltip: pe,
178
- hint: J,
179
- hintIcon: Xe,
180
- rightSideContent: he,
181
- required: Q = !1,
182
- requiredIndicator: je,
183
- formControl: ge,
184
- chips: ee = !1,
185
- chipsRemovable: te = !0,
186
- chipsMax: be = "auto",
187
- inlineSearch: v = !1,
188
- onSearchChange: $,
189
- localFilter: ve = !0,
190
- className: Ze = "",
191
- style: qe,
192
- id: Je,
193
- "aria-label": xe,
194
- "aria-labelledby": Qe
169
+ renderTrigger: L,
170
+ searchable: B,
171
+ size: _ = "large",
172
+ width: R = "auto",
173
+ minWidth: M,
174
+ disabled: d = !1,
175
+ error: v = !1,
176
+ loading: i = !1,
177
+ label: F,
178
+ name: he,
179
+ description: J,
180
+ tooltip: ge,
181
+ hint: Q,
182
+ hintIcon: et,
183
+ rightSideContent: be,
184
+ required: ee = !1,
185
+ requiredIndicator: tt,
186
+ formControl: ve,
187
+ chips: te = !1,
188
+ chipsRemovable: re = !0,
189
+ chipsMax: xe = "auto",
190
+ inlineSearch: S = !1,
191
+ onSearchChange: G,
192
+ localFilter: ye = !0,
193
+ className: rt = "",
194
+ style: nt,
195
+ id: ot,
196
+ "aria-label": we,
197
+ "aria-labelledby": lt,
198
+ errorMessageId: at,
199
+ onFieldLeave: st
195
200
  }) => {
196
- const ye = ht(), we = `${ye}-listbox`, Ee = (e) => `${ye}-option-${e}`, { controlId: Ie, labelId: Se, descriptionId: et, hintId: tt, describedBy: rt } = yt({
197
- id: Je,
198
- label: K,
199
- description: q,
200
- hint: J
201
- }), [nt, at] = P(() => R ?? []), re = k !== void 0, m = re ? k : nt, [o, ne] = P(!1), [c, Te] = P(null), [L, ot] = P(""), [x, A] = P(-1), Y = T(null), B = T(null), O = T(null), ke = T(null);
202
- Mt(O, o);
203
- const lt = Pt("multiselect", o, O), Le = T([]), ae = H(() => new Set(m), [m]), s = H(
201
+ const Ee = Ve(), Ie = `${Ee}-listbox`, Se = (e) => `${Ee}-option-${e}`, { controlId: Te, labelId: ke, descriptionId: it, hintId: ct, describedBy: dt } = kt({
202
+ id: ot,
203
+ label: F,
204
+ description: J,
205
+ hint: Q
206
+ }), [ut, ft] = $(() => I ?? []), ne = y !== void 0, h = ne ? y : ut, [a, oe] = $(!1), [m, Le] = $(null), [N, mt] = $(""), [T, C] = $(-1), j = k(null), le = k(null), D = Ut(st), z = k(null), A = k(null), Re = k(null);
207
+ Yt(A, a);
208
+ const pt = Kt("multiselect", a, A), Oe = k([]), ae = W(() => new Set(h), [h]), c = W(
204
209
  () => n.filter((e) => ae.has(e.value)),
205
210
  [n, ae]
206
- ), oe = typeof be == "number" ? be : void 0, _ = H(() => {
207
- if (!ve) return n;
208
- const e = L.trim().toLowerCase();
211
+ ), se = typeof xe == "number" ? xe : void 0, H = W(() => {
212
+ if (!ye) return n;
213
+ const e = N.trim().toLowerCase();
209
214
  return e ? n.filter((t) => (t.searchText ?? (typeof t.label == "string" ? t.label : "")).toLowerCase().includes(e)) : n;
210
- }, [n, L, ve]), le = T(!1), Re = T(""), U = h(
215
+ }, [n, N, ye]), ie = k(!1), _e = k(""), V = x(
211
216
  (e, t) => {
212
- Re.current !== e && (Re.current = e, t && (le.current = !0), ot(e), $ == null || $(e));
217
+ _e.current !== e && (_e.current = e, t && (ie.current = !0), mt(e), G == null || G(e));
213
218
  },
214
- [$]
215
- ), se = h(
216
- (e) => U(e, !0),
217
- [U]
218
- ), G = h(() => U("", !1), [U]);
219
- We(() => {
220
- le.current && (A(-1), le.current = !1);
221
- }, [L]);
222
- const st = Z ?? ($ !== void 0 || n.length > Kt), Oe = v ? !1 : st, ie = h(() => {
223
- var e, t;
224
- ne(!1), (e = O.current) != null && e.contains(kt()) && ((t = Y.current) == null || t.focus());
225
- }, []), D = h(() => {
226
- const e = Y.current;
219
+ [G]
220
+ ), ce = x(
221
+ (e) => V(e, !0),
222
+ [V]
223
+ ), K = x(() => V("", !1), [V]);
224
+ Be(() => {
225
+ ie.current && (C(-1), ie.current = !1);
226
+ }, [N]);
227
+ const ht = B ?? (G !== void 0 || n.length > Jt), Ne = S ? !1 : ht, de = x(() => {
228
+ var e, t, o, u;
229
+ oe(!1), (e = A.current) != null && e.contains(Ke()) && ((t = j.current) == null || t.focus()), (o = le.current) != null && o.contains(Ke()) || (u = D.current) == null || u.call(D);
230
+ }, [D]), P = x(() => {
231
+ const e = j.current;
227
232
  if (!e) return;
228
- const t = Nt(O.current, {
233
+ const t = Wt(A.current, {
229
234
  triggerRect: e.getBoundingClientRect(),
230
235
  preset: "standard",
231
- minWidth: W,
236
+ minWidth: M,
232
237
  viewportWidth: window.innerWidth,
233
238
  viewportHeight: window.innerHeight
234
239
  });
235
- Te(t);
236
- }, [W]);
237
- We(() => {
238
- var S;
239
- if (!o) {
240
- G(), A(-1), Te(null);
240
+ Le(t);
241
+ }, [M]);
242
+ Be(() => {
243
+ var u;
244
+ if (!a) {
245
+ K(), C(-1), Le(null);
241
246
  return;
242
247
  }
243
- D(), v && ((S = B.current) == null || S.focus());
244
- const e = () => D(), t = (y) => {
245
- const d = y.composedPath(), a = Y.current, i = O.current;
246
- (!a || !d.includes(a)) && (!i || !d.includes(i)) && ie();
247
- }, l = _t(ie);
248
+ P(), S && ((u = z.current) == null || u.focus());
249
+ const e = () => P(), t = (g) => {
250
+ const p = g.composedPath(), l = j.current, f = A.current;
251
+ (!l || !p.includes(l)) && (!f || !p.includes(f)) && de();
252
+ }, o = Pt(de);
248
253
  return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), document.addEventListener("mousedown", t), () => {
249
- window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), document.removeEventListener("mousedown", t), l();
254
+ window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), document.removeEventListener("mousedown", t), o();
250
255
  };
251
- }, [o, D, v, G, ie]), gt(() => {
252
- if (!o)
256
+ }, [a, P, S, K, de]), Et(() => {
257
+ if (!a)
253
258
  return;
254
- D();
255
- const e = O.current;
259
+ P();
260
+ const e = A.current;
256
261
  if (!e || typeof ResizeObserver > "u")
257
262
  return;
258
- const t = new ResizeObserver(() => D());
263
+ const t = new ResizeObserver(() => P());
259
264
  return t.observe(e), () => t.disconnect();
260
- }, [o, D]);
261
- const I = h(
265
+ }, [a, P]);
266
+ const O = x(
262
267
  (e) => {
263
- re || at(e), u == null || u(e);
268
+ ne || ft(e), s == null || s(e);
264
269
  },
265
- [re, u]
266
- ), V = h(
270
+ [ne, s]
271
+ ), X = x(
267
272
  (e) => n.some((t) => t.value === e && t.disabled),
268
273
  [n]
269
- ), ce = h(
274
+ ), ue = x(
270
275
  (e) => {
271
- V(e) || (m.includes(e) ? I(m.filter((t) => t !== e)) : I([...m, e]));
276
+ X(e) || (h.includes(e) ? O(h.filter((t) => t !== e)) : O([...h, e]));
272
277
  },
273
- [m, I, V]
274
- ), X = H(() => {
278
+ [h, O, X]
279
+ ), q = W(() => {
275
280
  const e = /* @__PURE__ */ new Set();
276
281
  for (const t of n)
277
282
  t.disabled && e.add(t.value);
278
283
  return e;
279
- }, [n]), it = h(
284
+ }, [n]), gt = x(
280
285
  (e) => {
281
286
  e.stopPropagation();
282
- const t = m.filter((l) => X.has(l));
283
- I(t);
287
+ const t = h.filter((o) => q.has(o));
288
+ O(t);
284
289
  },
285
- [I, m, X]
286
- ), _e = h(
290
+ [O, h, q]
291
+ ), Ae = x(
287
292
  (e, t) => {
288
- t.stopPropagation(), !V(e) && I(m.filter((l) => l !== e));
293
+ t.stopPropagation(), !X(e) && O(h.filter((o) => o !== e));
289
294
  },
290
- [m, I, V]
291
- ), j = h(
295
+ [h, O, X]
296
+ ), Z = x(
292
297
  (e) => {
293
- if (!Ut.has(e.key)) return;
294
- if (e.preventDefault(), e.stopPropagation(), !o) {
295
- ne(!0);
298
+ if (!er.has(e.key)) return;
299
+ if (e.preventDefault(), e.stopPropagation(), !a) {
300
+ oe(!0);
296
301
  return;
297
302
  }
298
- const t = _.length;
303
+ const t = H.length;
299
304
  if (t === 0) return;
300
- const l = (d) => {
305
+ const o = (p) => {
301
306
  requestAnimationFrame(() => {
302
- const a = Le.current[d], i = ke.current;
303
- if (!a || !i) return;
304
- const g = a.offsetTop, Pe = g + a.offsetHeight, Me = i.scrollTop, mt = Me + i.clientHeight;
305
- Pe > mt ? i.scrollTo({
306
- top: Pe - i.clientHeight,
307
+ const l = Oe.current[p], f = Re.current;
308
+ if (!l || !f) return;
309
+ const w = l.offsetTop, We = w + l.offsetHeight, $e = f.scrollTop, wt = $e + f.clientHeight;
310
+ We > wt ? f.scrollTo({
311
+ top: We - f.clientHeight,
307
312
  behavior: "smooth"
308
- }) : g < Me && i.scrollTo({ top: g, behavior: "smooth" });
313
+ }) : w < $e && f.scrollTo({ top: w, behavior: "smooth" });
309
314
  });
310
- }, S = (d) => {
311
- var i;
312
- let a = x;
313
- for (let g = 0; g < t; g++)
314
- if (a = d === 1 ? a < t - 1 ? a + 1 : 0 : a > 0 ? a - 1 : t - 1, !((i = _[a]) != null && i.disabled)) {
315
- l(a), A(a);
315
+ }, u = (p) => {
316
+ var f;
317
+ let l = T;
318
+ for (let w = 0; w < t; w++)
319
+ if (l = p === 1 ? l < t - 1 ? l + 1 : 0 : l > 0 ? l - 1 : t - 1, !((f = H[l]) != null && f.disabled)) {
320
+ o(l), C(l);
316
321
  return;
317
322
  }
318
- }, y = () => {
319
- var i;
320
- if (x < 0 || x >= t || (i = _[x]) != null && i.disabled) return;
321
- const d = _[x].value;
322
- ce(d), G();
323
- const a = n.findIndex((g) => g.value === d);
324
- A(a >= 0 ? a : -1), l(a >= 0 ? a : 0), requestAnimationFrame(() => {
325
- var g;
326
- return (g = B.current) == null ? void 0 : g.focus();
323
+ }, g = () => {
324
+ var f;
325
+ if (T < 0 || T >= t || (f = H[T]) != null && f.disabled) return;
326
+ const p = H[T].value;
327
+ ue(p), K();
328
+ const l = n.findIndex((w) => w.value === p);
329
+ C(l >= 0 ? l : -1), o(l >= 0 ? l : 0), requestAnimationFrame(() => {
330
+ var w;
331
+ return (w = z.current) == null ? void 0 : w.focus();
327
332
  });
328
333
  };
329
334
  switch (e.key) {
330
- case Ke:
331
- S(1);
335
+ case Xe:
336
+ u(1);
332
337
  break;
333
- case Ye:
334
- S(-1);
338
+ case qe:
339
+ u(-1);
335
340
  break;
336
- case Ue:
337
- y();
341
+ case Ze:
342
+ g();
338
343
  break;
339
344
  }
340
345
  },
341
- [o, _, x, ce, n, G]
342
- ), Ne = h(
346
+ [a, H, T, ue, n, K]
347
+ ), Me = x(
343
348
  (e) => {
344
- if (e.key === Yt && L === "" && m.length > 0) {
345
- e.preventDefault(), I(m.slice(0, -1)), requestAnimationFrame(() => {
349
+ if (e.key === Qt && N === "" && h.length > 0) {
350
+ e.preventDefault(), O(h.slice(0, -1)), requestAnimationFrame(() => {
346
351
  var t;
347
- return (t = B.current) == null ? void 0 : t.focus();
352
+ return (t = z.current) == null ? void 0 : t.focus();
348
353
  });
349
354
  return;
350
355
  }
351
- j(e);
356
+ Z(e);
352
357
  },
353
- [j, L, m, I]
354
- ), Ce = s.length > 0 && !p && !f, ct = Rt({
355
- disabled: p,
356
- error: E,
357
- open: o,
358
- loading: f,
359
- hasSelection: s.length > 0
360
- }), de = H(() => v ? /* @__PURE__ */ r(
358
+ [Z, N, h, O]
359
+ ), De = c.length > 0 && !d && !i, bt = Ht({
360
+ disabled: d,
361
+ error: v,
362
+ open: a,
363
+ loading: i,
364
+ hasSelection: c.length > 0
365
+ }), fe = W(() => S ? /* @__PURE__ */ r(
361
366
  "input",
362
367
  {
363
- ref: B,
368
+ ref: z,
364
369
  type: "text",
365
- value: L,
366
- onChange: (e) => se(e.target.value),
367
- onKeyDown: Ne,
368
- disabled: p || f,
369
- placeholder: s.length === 0 ? b : "",
370
+ value: N,
371
+ onChange: (e) => ce(e.target.value),
372
+ onKeyDown: Me,
373
+ disabled: d || i,
374
+ placeholder: c.length === 0 ? b : "",
370
375
  className: "flex-1 w-full min-w-[40px] border-none outline-none bg-transparent text-[length:inherit] p-0 text-[var(--malachite-text-primary,rgb(10,10,10))]",
371
376
  onMouseDown: (e) => {
372
377
  e.preventDefault();
373
378
  }
374
379
  }
375
380
  ) : null, [
376
- v,
377
- L,
378
- se,
379
- Ne,
380
- p,
381
- f,
382
- s.length,
381
+ S,
382
+ N,
383
+ ce,
384
+ Me,
385
+ d,
386
+ i,
387
+ c.length,
383
388
  b
384
- ]), dt = H(() => {
385
- if (N && s.length > 0)
386
- return N(s);
387
- if (ee && s.length > 0) {
388
- const e = oe != null ? s.slice(0, oe) : s, t = s.length - e.length;
389
- return /* @__PURE__ */ w(
389
+ ]), vt = W(() => {
390
+ if (L && c.length > 0)
391
+ return L(c);
392
+ if (te && c.length > 0) {
393
+ const e = se != null ? c.slice(0, se) : c, t = c.length - e.length;
394
+ return /* @__PURE__ */ E(
390
395
  "div",
391
396
  {
392
397
  className: "flex items-center gap-1 overflow-hidden min-w-0 flex-1",
393
398
  style: { flexWrap: "nowrap" },
394
399
  children: [
395
- e.map((l) => {
396
- const S = X.has(l.value);
400
+ e.map((o) => {
401
+ const u = q.has(o.value);
397
402
  return /* @__PURE__ */ r(
398
- Tt,
403
+ Mt,
399
404
  {
400
- value: l.label,
405
+ value: o.label,
401
406
  type: "default",
402
407
  textTransform: "none",
403
- onRemove: te && !p && !S ? (y) => _e(l.value, y) : void 0,
408
+ onRemove: re && !d && !u ? (g) => Ae(o.value, g) : void 0,
404
409
  className: "shrink-0"
405
410
  },
406
- l.value
411
+ o.value
407
412
  );
408
413
  }),
409
- t > 0 && /* @__PURE__ */ w("span", { className: "shrink-0 text-xs text-[var(--malachite-text-secondary,rgb(123,123,123))]", children: [
414
+ t > 0 && /* @__PURE__ */ E("span", { className: "shrink-0 text-xs text-[var(--malachite-text-secondary,rgb(123,123,123))]", children: [
410
415
  "+",
411
416
  t
412
417
  ] }),
413
- de
418
+ fe
414
419
  ]
415
420
  }
416
421
  );
417
422
  }
418
- return v && s.length === 0 ? de : s.length === 0 ? /* @__PURE__ */ r("span", { className: "text-[var(--malachite-text-placeholder)]", children: b }) : s.length === 1 ? /* @__PURE__ */ r("span", { children: s[0].label }) : /* @__PURE__ */ r("span", { children: `${s.length} selected` });
423
+ return S && c.length === 0 ? fe : c.length === 0 ? /* @__PURE__ */ r("span", { className: "text-[var(--malachite-text-placeholder)]", children: b }) : c.length === 1 ? /* @__PURE__ */ r("span", { children: c[0].label }) : /* @__PURE__ */ r("span", { children: `${c.length} selected` });
419
424
  }, [
420
- s,
421
- N,
422
- ee,
423
- oe,
425
+ c,
426
+ L,
424
427
  te,
425
- p,
426
- _e,
427
- v,
428
- de,
428
+ se,
429
+ re,
430
+ d,
431
+ Ae,
432
+ S,
433
+ fe,
429
434
  b,
430
- X
431
- ]), ut = n.length === 0 ? "No options available" : "No results found";
432
- bt(() => {
433
- o && Ht();
434
- }, [o]);
435
- const ft = {
435
+ q
436
+ ]), xt = n.length === 0 ? "No options available" : "No results found";
437
+ It(() => {
438
+ a && zt();
439
+ }, [a]);
440
+ const yt = {
436
441
  position: "fixed",
437
- top: (c == null ? void 0 : c.top) ?? 0,
438
- left: (c == null ? void 0 : c.left) ?? 0,
439
- width: c == null ? void 0 : c.width,
440
- background: z.standard.background,
441
- border: z.standard.border,
442
- borderRadius: z.standard.radius,
443
- boxShadow: z.standard.shadow,
444
- padding: z.standard.padding,
442
+ top: (m == null ? void 0 : m.top) ?? 0,
443
+ left: (m == null ? void 0 : m.left) ?? 0,
444
+ width: m == null ? void 0 : m.width,
445
+ background: Y.standard.background,
446
+ border: Y.standard.border,
447
+ borderRadius: Y.standard.radius,
448
+ boxShadow: Y.standard.shadow,
449
+ padding: Y.standard.padding,
445
450
  display: "flex",
446
451
  flexDirection: "column",
447
452
  gap: 4,
448
- maxHeight: (c == null ? void 0 : c.maxHeight) ?? Ct,
449
- fontSize: Lt[C],
450
- visibility: c ? "visible" : "hidden",
451
- opacity: c ? 1 : 0
452
- }, Ae = !!(q || pe || J || he || me || ge || Q), De = Ae && !!K, He = /* @__PURE__ */ w(pt, { children: [
453
- /* @__PURE__ */ w("div", { className: "relative", style: Ge(M), children: [
454
- /* @__PURE__ */ w(
455
- Ve,
456
- {
457
- ref: Y,
458
- id: Ie,
459
- triggerRole: v ? "combobox" : ee && te ? "group" : "button",
460
- disabled: p || f,
461
- [Ot]: "",
462
- "data-open": o || void 0,
463
- "aria-haspopup": "listbox",
464
- "aria-expanded": o,
465
- "aria-controls": o ? we : void 0,
466
- "aria-activedescendant": v && o && x >= 0 ? Ee(x) : void 0,
467
- "aria-labelledby": Qe ?? (De && !xe ? Se : void 0),
468
- "aria-label": xe ?? (De ? void 0 : K),
469
- "aria-invalid": E || void 0,
470
- "aria-required": Q || void 0,
471
- "aria-describedby": rt,
472
- "aria-busy": f || void 0,
473
- onClick: () => {
474
- p || f || ne((e) => !e);
475
- },
476
- onKeyDown: j,
477
- style: {
478
- transition: "border-color 0.15s ease, box-shadow 0.15s ease",
479
- ...ct,
480
- ...qe
481
- },
482
- className: `w-full ${Ft[C]} border border-solid flex items-center font-normal text-[var(--malachite-text-primary)] ${p || f ? "cursor-not-allowed" : "cursor-pointer"} ${At} ${Ze}`,
483
- children: [
484
- /* @__PURE__ */ r(
485
- "span",
486
- {
487
- className: `flex-1 min-w-0 text-left ${v ? "flex" : "truncate"} ${Ce ? "pr-[18px]" : ""}`,
488
- children: dt
489
- }
490
- ),
491
- f ? /* @__PURE__ */ r("span", { className: "flex items-center justify-center shrink-0 size-[14px]", children: /* @__PURE__ */ r(St, { size: "xxxsmall" }) }) : /* @__PURE__ */ r(
492
- wt,
493
- {
494
- size: 13,
495
- className: "shrink-0",
496
- style: {
497
- color: o ? "var(--malachite-text-primary, rgb(10, 10, 10))" : "var(--malachite-text-placeholder, rgb(187, 187, 187))",
498
- transition: "transform 0.2s ease, color 0.2s ease",
499
- transform: o ? "rotate(180deg)" : "rotate(0deg)"
500
- }
501
- }
502
- )
503
- ]
504
- }
505
- ),
506
- Ce && /* @__PURE__ */ r(
507
- "button",
508
- {
509
- type: "button",
510
- "aria-label": "Clear selection",
511
- onClick: it,
512
- className: "absolute top-0 bottom-0 right-[28px] flex items-center justify-center px-[2px] leading-none bg-transparent border-none text-[var(--malachite-text-placeholder)] hover:text-[var(--malachite-text-primary)] cursor-pointer",
513
- children: "×"
514
- }
515
- )
516
- ] }),
517
- o && vt(
518
- /* @__PURE__ */ w(
453
+ maxHeight: (m == null ? void 0 : m.maxHeight) ?? $t,
454
+ fontSize: Dt[_],
455
+ visibility: m ? "visible" : "hidden",
456
+ opacity: m ? 1 : 0
457
+ }, He = !!(J || ge || Q || be || he || ve || ee), Ce = He && !!F, Pe = /* @__PURE__ */ E(je, { children: [
458
+ /* @__PURE__ */ E(
459
+ "div",
460
+ {
461
+ ref: le,
462
+ className: "relative",
463
+ style: Ye(R),
464
+ onBlur: (e) => {
465
+ var o;
466
+ const t = e.relatedTarget;
467
+ t && ((o = le.current) != null && o.contains(t)) || queueMicrotask(() => {
468
+ var u, g;
469
+ t && ((u = A.current) != null && u.contains(t)) || (g = D.current) == null || g.call(D);
470
+ });
471
+ },
472
+ children: [
473
+ /* @__PURE__ */ E(
474
+ Je,
475
+ {
476
+ ref: j,
477
+ id: Te,
478
+ triggerRole: S ? "combobox" : te && re ? "group" : "button",
479
+ disabled: d || i,
480
+ [Ct]: "",
481
+ "data-open": a || void 0,
482
+ "aria-haspopup": "listbox",
483
+ "aria-expanded": a,
484
+ "aria-controls": a ? Ie : void 0,
485
+ "aria-activedescendant": S && a && T >= 0 ? Se(T) : void 0,
486
+ "aria-labelledby": lt ?? (Ce && !we ? ke : void 0),
487
+ "aria-label": we ?? (Ce ? void 0 : F),
488
+ "aria-invalid": v || void 0,
489
+ "aria-required": ee || void 0,
490
+ "aria-describedby": [dt, at].filter(Boolean).join(" ") || void 0,
491
+ "aria-busy": i || void 0,
492
+ onClick: () => {
493
+ d || i || oe((e) => !e);
494
+ },
495
+ onKeyDown: Z,
496
+ style: {
497
+ transition: "border-color 0.15s ease, box-shadow 0.15s ease",
498
+ ...bt,
499
+ ...nt
500
+ },
501
+ className: `w-full ${Zt[_]} border border-solid flex items-center font-normal text-[var(--malachite-text-primary)] ${d || i ? "cursor-not-allowed" : "cursor-pointer"} ${Bt} ${rt}`,
502
+ children: [
503
+ /* @__PURE__ */ r(
504
+ "span",
505
+ {
506
+ className: `flex-1 min-w-0 text-left ${S ? "flex" : "truncate"} ${De ? "pr-[18px]" : ""}`,
507
+ children: vt
508
+ }
509
+ ),
510
+ i ? /* @__PURE__ */ r("span", { className: "flex items-center justify-center shrink-0 size-[14px]", children: /* @__PURE__ */ r(At, { size: "xxxsmall" }) }) : /* @__PURE__ */ r(
511
+ Lt,
512
+ {
513
+ size: 13,
514
+ className: "shrink-0",
515
+ style: {
516
+ color: a ? "var(--malachite-text-primary, rgb(10, 10, 10))" : "var(--malachite-text-placeholder, rgb(187, 187, 187))",
517
+ transition: "transform 0.2s ease, color 0.2s ease",
518
+ transform: a ? "rotate(180deg)" : "rotate(0deg)"
519
+ }
520
+ }
521
+ )
522
+ ]
523
+ }
524
+ ),
525
+ De && /* @__PURE__ */ r(
526
+ "button",
527
+ {
528
+ type: "button",
529
+ "aria-label": "Clear selection",
530
+ onClick: gt,
531
+ className: "absolute top-0 bottom-0 right-[28px] flex items-center justify-center px-[2px] leading-none bg-transparent border-none text-[var(--malachite-text-placeholder)] hover:text-[var(--malachite-text-primary)] cursor-pointer",
532
+ children: "×"
533
+ }
534
+ )
535
+ ]
536
+ }
537
+ ),
538
+ a && St(
539
+ /* @__PURE__ */ E(
519
540
  "div",
520
541
  {
521
- ref: O,
522
- id: we,
542
+ ref: A,
543
+ id: Ie,
523
544
  role: "listbox",
524
545
  "aria-multiselectable": "true",
525
- ...lt,
526
- style: ft,
546
+ ...pt,
547
+ style: yt,
527
548
  children: [
528
- Oe && /* @__PURE__ */ w(
549
+ Ne && /* @__PURE__ */ E(
529
550
  "div",
530
551
  {
531
552
  style: {
@@ -540,7 +561,7 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
540
561
  },
541
562
  children: [
542
563
  /* @__PURE__ */ r(
543
- It,
564
+ Ot,
544
565
  {
545
566
  size: 13,
546
567
  style: {
@@ -553,9 +574,9 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
553
574
  "input",
554
575
  {
555
576
  type: "text",
556
- value: L,
557
- onChange: (e) => se(e.target.value),
558
- onKeyDown: j,
577
+ value: N,
578
+ onChange: (e) => ce(e.target.value),
579
+ onKeyDown: Z,
559
580
  placeholder: "Search",
560
581
  "aria-label": "Search options",
561
582
  autoFocus: !0,
@@ -573,7 +594,7 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
573
594
  ]
574
595
  }
575
596
  ),
576
- Oe && /* @__PURE__ */ r(
597
+ Ne && /* @__PURE__ */ r(
577
598
  "div",
578
599
  {
579
600
  "aria-hidden": "true",
@@ -588,7 +609,7 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
588
609
  /* @__PURE__ */ r(
589
610
  "div",
590
611
  {
591
- ref: ke,
612
+ ref: Re,
592
613
  style: {
593
614
  display: "flex",
594
615
  flexDirection: "column",
@@ -600,34 +621,34 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
600
621
  scrollbarWidth: "thin",
601
622
  scrollbarColor: "var(--malachite-text-placeholder, rgb(187, 187, 187)) transparent"
602
623
  },
603
- children: _.length === 0 ? (
624
+ children: H.length === 0 ? (
604
625
  // `role="listbox"` admits only option/group children.
605
- /* @__PURE__ */ r("div", { role: "presentation", style: zt, children: ut })
606
- ) : _.map((e, t) => {
607
- const l = ae.has(e.value), S = t === x, y = !!e.disabled;
608
- return /* @__PURE__ */ w(
626
+ /* @__PURE__ */ r("div", { role: "presentation", style: qt, children: xt })
627
+ ) : H.map((e, t) => {
628
+ const o = ae.has(e.value), u = t === T, g = !!e.disabled;
629
+ return /* @__PURE__ */ E(
609
630
  "button",
610
631
  {
611
- id: Ee(t),
612
- ref: (d) => {
613
- Le.current[t] = d;
632
+ id: Se(t),
633
+ ref: (p) => {
634
+ Oe.current[t] = p;
614
635
  },
615
636
  type: "button",
616
637
  role: "option",
617
- "aria-selected": l,
618
- "aria-disabled": y || void 0,
638
+ "aria-selected": o,
639
+ "aria-disabled": g || void 0,
619
640
  onClick: () => {
620
- var d;
621
- ce(e.value), G(), (d = B.current) == null || d.focus();
641
+ var p;
642
+ ue(e.value), K(), (p = z.current) == null || p.focus();
622
643
  },
623
- onMouseEnter: () => A(t),
644
+ onMouseEnter: () => C(t),
624
645
  onMouseLeave: () => {
625
- x === t && A(-1);
646
+ T === t && C(-1);
626
647
  },
627
648
  className: "malachite-multiselect-option",
628
- "data-checked": l,
629
- "data-highlighted": S,
630
- "data-disabled": y,
649
+ "data-checked": o,
650
+ "data-highlighted": u,
651
+ "data-disabled": g,
631
652
  style: {
632
653
  display: "flex",
633
654
  alignItems: "center",
@@ -639,13 +660,13 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
639
660
  borderRadius: 8,
640
661
  padding: "8px 10px",
641
662
  font: "inherit",
642
- cursor: y ? "not-allowed" : "pointer",
643
- opacity: y ? 0.6 : 1,
644
- color: l ? "var(--malachite-accent-foreground, rgb(2, 122, 66))" : "var(--malachite-text-primary, rgb(10, 10, 10))"
663
+ cursor: g ? "not-allowed" : "pointer",
664
+ opacity: g ? 0.6 : 1,
665
+ color: o ? "var(--malachite-accent-foreground, rgb(2, 122, 66))" : "var(--malachite-text-primary, rgb(10, 10, 10))"
645
666
  },
646
667
  children: [
647
- /* @__PURE__ */ r(Vt, { option: e }),
648
- Dt(e.badge) && /* @__PURE__ */ r(
668
+ /* @__PURE__ */ r(tr, { option: e }),
669
+ Gt(e.badge) && /* @__PURE__ */ r(
649
670
  "span",
650
671
  {
651
672
  style: {
@@ -653,7 +674,7 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
653
674
  flexShrink: 0,
654
675
  paddingLeft: 8
655
676
  },
656
- children: /* @__PURE__ */ r(fe.Suspense, { fallback: null, children: /* @__PURE__ */ r(Gt, { children: e.badge }) })
677
+ children: /* @__PURE__ */ r(pe.Suspense, { fallback: null, children: /* @__PURE__ */ r(Xt, { children: e.badge }) })
657
678
  }
658
679
  )
659
680
  ]
@@ -669,30 +690,58 @@ const ze = 0.6, Fe = 420, Vt = ({ option: n }) => {
669
690
  document.body
670
691
  )
671
692
  ] });
672
- return Ae ? /* @__PURE__ */ r(
673
- xt,
693
+ return He ? /* @__PURE__ */ r(
694
+ Tt,
674
695
  {
675
- label: K,
676
- hint: J,
677
- hintIcon: Xe,
678
- rightSideContent: he,
679
- tooltip: pe,
680
- name: me ?? "",
681
- required: Q,
682
- requiredIndicator: je,
683
- loading: f,
684
- formControl: ge,
685
- description: q,
686
- controlId: Ie,
687
- labelId: Se,
688
- descriptionId: et,
689
- hintId: tt,
690
- loadingComponent: M === void 0 ? /* @__PURE__ */ r($e, { heightClass: F[C] }) : /* @__PURE__ */ r("div", { style: Ge(M), children: /* @__PURE__ */ r($e, { heightClass: F[C] }) }),
691
- children: He
696
+ label: F,
697
+ hint: Q,
698
+ hintIcon: et,
699
+ rightSideContent: be,
700
+ tooltip: ge,
701
+ name: he ?? "",
702
+ required: ee,
703
+ requiredIndicator: tt,
704
+ loading: i,
705
+ formControl: ve,
706
+ description: J,
707
+ controlId: Te,
708
+ labelId: ke,
709
+ descriptionId: it,
710
+ hintId: ct,
711
+ loadingComponent: R === void 0 ? /* @__PURE__ */ r(Ge, { heightClass: U[_] }) : /* @__PURE__ */ r("div", { style: Ye(R), children: /* @__PURE__ */ r(Ge, { heightClass: U[_] }) }),
712
+ children: Pe
692
713
  }
693
- ) : He;
694
- };
714
+ ) : Pe;
715
+ }, rr = ({
716
+ formControl: n,
717
+ name: y,
718
+ error: I,
719
+ onChange: s,
720
+ ...b
721
+ }) => {
722
+ const L = `${Ve()}-error`;
723
+ return /* @__PURE__ */ r(Nt, { control: n, name: y, children: ({ error: B, message: _, onFieldChange: R, onFieldBlur: M, value: d }) => {
724
+ const v = I === !1 ? void 0 : _;
725
+ return /* @__PURE__ */ E(je, { children: [
726
+ /* @__PURE__ */ r(
727
+ Qe,
728
+ {
729
+ ...b,
730
+ name: y,
731
+ value: Array.isArray(d) ? d : [],
732
+ error: I ?? B,
733
+ errorMessageId: v ? L : void 0,
734
+ onFieldLeave: M,
735
+ onChange: (i) => {
736
+ R == null || R(i), s == null || s(i);
737
+ }
738
+ }
739
+ ),
740
+ /* @__PURE__ */ r(_t, { id: L, message: v, spaced: !0 })
741
+ ] });
742
+ } });
743
+ }, Or = (n) => n.formControl ? /* @__PURE__ */ r(rr, { ...n }) : /* @__PURE__ */ r(Qe, { ...n });
695
744
  export {
696
- br as default
745
+ Or as default
697
746
  };
698
747
  //# sourceMappingURL=MultiSelect.js.map