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