@stackone/malachite 2.47.1 → 2.47.2

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.
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as w, Fragment as mt } from "react/jsx-runtime";
2
- import fe, { useId as pt, useState as P, useRef as T, useMemo as H, useCallback as m, useEffect as We, useLayoutEffect as ht, useInsertionEffect as gt } from "react";
2
+ import fe, { useId as pt, useState as P, useRef as T, useMemo as H, useCallback as h, useEffect as We, useLayoutEffect as ht, useInsertionEffect as gt } from "react";
3
3
  import { createPortal as bt } from "react-dom";
4
4
  import vt, { useFormFieldIds as xt } from "./BaseFormComponent.js";
5
5
  import yt from "./CustomIcons/CaretDownIcon.js";
@@ -12,68 +12,68 @@ import Be from "./Tooltip.js";
12
12
  import { getDeepActiveElement as Tt } from "./activeElement.js";
13
13
  import { CONTROL_TEXT_SIZE_CLASS as ue, CONTROL_TEXT_SIZE as kt } from "./controlTextSize.js";
14
14
  import { controlWidthStyle as Ge } from "./controlWidth.js";
15
- import { getTriggerVisual as Rt, DROPDOWN_TRIGGER_ATTR as _t } from "./dropdownTriggerStyle.js";
16
- import { pushEscapeLayer as Lt } from "./escapeLayers.js";
17
- import { measureMenuGeometry as Ot, MENU_MAX_HEIGHT_PX as Nt, MENU_SPECS as F } from "./floatingMenuGeometry.js";
18
- import { FOCUS_RING as Ct, FOCUS_RING_WITHIN_INPUT 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")), Ft = {
15
+ import { getTriggerVisual as Lt, DROPDOWN_TRIGGER_ATTR as Rt } from "./dropdownTriggerStyle.js";
16
+ import { pushEscapeLayer as Ot } from "./escapeLayers.js";
17
+ import { measureMenuGeometry as _t, MENU_MAX_HEIGHT_PX as Nt, MENU_SPECS as z } from "./floatingMenuGeometry.js";
18
+ import { FOCUS_RING as Ct } from "./focusRing.js";
19
+ import { hasBadge as At } from "./hasBadge.js";
20
+ import { ensureMultiSelectPanelStyles as Dt } from "./optionRowStyles.js";
21
+ import { usePopupLayer as Ht } from "./overlayLayers.js";
22
+ import { useTopLayer as Pt } from "./topLayer.js";
23
+ import { tooltipLines as Mt, isCut as Wt, isClamped as $t } from "./truncatedLines.js";
24
+ const Bt = fe.lazy(() => import("./ActionMenuTagHost.js")), Gt = {
25
25
  padding: "8px 10px",
26
26
  color: "var(--malachite-text-secondary, rgb(123, 123, 123))"
27
- }, z = {
27
+ }, F = {
28
28
  small: "h-[var(--malachite-control-height-small,28px)]",
29
29
  medium: "h-[var(--malachite-control-height-medium,32px)]",
30
30
  large: "h-[var(--malachite-control-height-large,42px)]"
31
31
  }, zt = {
32
- small: `${z.small} gap-[6px] px-2.5 ${ue.small} rounded-[var(--malachite-radius-10,10px)]`,
33
- medium: `${z.medium} gap-[8px] px-3 ${ue.medium} rounded-xl`,
34
- large: `${z.large} gap-[10px] px-4 ${ue.large} rounded-[var(--malachite-radius-xxl,14px)]`
35
- }, Kt = 10, Ke = "ArrowDown", Ue = "ArrowUp", Ye = "Enter", Ut = "Backspace", Yt = /* @__PURE__ */ new Set([Ke, Ue, Ye]), Ve = fe.forwardRef(
36
- ({ triggerRole: n, disabled: k, children: _, ...u }, g) => n !== "button" ? /* @__PURE__ */ r(
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
+ }, Ft = 10, Ke = "ArrowDown", Ye = "ArrowUp", Ue = "Enter", Kt = "Backspace", Yt = /* @__PURE__ */ new Set([Ke, Ye, Ue]), Ve = fe.forwardRef(
36
+ ({ triggerRole: n, disabled: k, children: R, ...u }, b) => n !== "button" ? /* @__PURE__ */ r(
37
37
  "div",
38
38
  {
39
- ref: g,
39
+ ref: b,
40
40
  role: n,
41
41
  tabIndex: k ? -1 : 0,
42
42
  ...u,
43
- children: _
43
+ children: R
44
44
  }
45
45
  ) : /* @__PURE__ */ r(
46
46
  "button",
47
47
  {
48
- ref: g,
48
+ ref: b,
49
49
  type: "button",
50
50
  disabled: k,
51
51
  ...u,
52
- children: _
52
+ children: R
53
53
  }
54
54
  )
55
55
  );
56
56
  Ve.displayName = "TriggerElement";
57
- const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
58
- const k = T(null), _ = T(null), u = n.description ? n.descriptionMode ?? "icon" : null, g = u === "subtitle", [N, Z] = P({ label: !0, subtitle: !0 }), C = () => {
59
- const E = $t(k.current), p = Bt(_.current);
60
- return !E && !p && u !== "hover" ? !1 : (Z({ label: E, subtitle: p }), !0);
61
- }, M = u === "hover" || g && N.subtitle, W = (E) => /* @__PURE__ */ r(
57
+ const ze = 0.6, Fe = 420, Ut = ({ 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 = Wt(k.current), f = $t(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
62
  Be,
63
63
  {
64
- text: Wt([
64
+ text: Mt([
65
65
  ["label", N.label && n.label],
66
66
  ["description", M && n.description]
67
67
  ]),
68
68
  shouldShow: C,
69
- delay: Fe,
70
- maxWidth: ze,
69
+ delay: ze,
70
+ maxWidth: Fe,
71
71
  triggerAs: "span",
72
72
  isShrinkable: !0,
73
73
  describesTrigger: u === "hover",
74
74
  children: E
75
75
  }
76
- ), b = /* @__PURE__ */ r(
76
+ ), p = /* @__PURE__ */ r(
77
77
  "span",
78
78
  {
79
79
  ref: k,
@@ -86,7 +86,7 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
86
86
  children: n.label
87
87
  }
88
88
  );
89
- return g ? W(
89
+ return b ? W(
90
90
  /* @__PURE__ */ w(
91
91
  "span",
92
92
  {
@@ -99,11 +99,11 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
99
99
  gap: 2
100
100
  },
101
101
  children: [
102
- b,
102
+ p,
103
103
  /* @__PURE__ */ r(
104
104
  "span",
105
105
  {
106
- ref: _,
106
+ ref: R,
107
107
  style: {
108
108
  fontSize: 12,
109
109
  color: "var(--malachite-text-secondary, rgb(123, 123, 123))",
@@ -133,13 +133,13 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
133
133
  gap: 6
134
134
  },
135
135
  children: [
136
- W(b),
136
+ W(p),
137
137
  u === "icon" && /* @__PURE__ */ r(
138
138
  Be,
139
139
  {
140
140
  text: n.description,
141
- delay: Fe,
142
- maxWidth: ze,
141
+ delay: ze,
142
+ maxWidth: Fe,
143
143
  children: /* @__PURE__ */ r(
144
144
  "span",
145
145
  {
@@ -157,20 +157,20 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
157
157
  ]
158
158
  }
159
159
  );
160
- }, br = ({
160
+ }, gr = ({
161
161
  options: n,
162
162
  value: k,
163
- defaultValue: _,
163
+ defaultValue: R,
164
164
  onChange: u,
165
- placeholder: g = "Select",
165
+ placeholder: b = "Select",
166
166
  renderTrigger: N,
167
167
  searchable: Z,
168
168
  size: C = "large",
169
169
  width: M = "auto",
170
170
  minWidth: W,
171
- disabled: b = !1,
171
+ disabled: p = !1,
172
172
  error: E = !1,
173
- loading: p = !1,
173
+ loading: f = !1,
174
174
  label: K,
175
175
  name: me,
176
176
  description: q,
@@ -197,34 +197,34 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
197
197
  label: K,
198
198
  description: q,
199
199
  hint: J
200
- }), [rt, nt] = P(() => _ ?? []), re = k !== void 0, f = re ? k : rt, [o, ne] = P(!1), [c, Te] = P(null), [R, at] = P(""), [x, A] = P(-1), U = T(null), B = T(null), L = T(null), ke = T(null);
201
- Mt(L, o);
202
- const lt = Pt("multiselect", o, L), Re = T([]), ae = H(() => new Set(f), [f]), s = H(
200
+ }), [rt, nt] = P(() => R ?? []), re = k !== void 0, m = re ? k : rt, [o, ne] = P(!1), [c, Te] = P(null), [L, at] = P(""), [x, A] = P(-1), Y = T(null), B = T(null), O = T(null), ke = T(null);
201
+ Pt(O, o);
202
+ const ot = Ht("multiselect", o, O), Le = T([]), ae = H(() => new Set(m), [m]), s = H(
203
203
  () => n.filter((e) => ae.has(e.value)),
204
204
  [n, ae]
205
- ), le = typeof be == "number" ? be : void 0, O = H(() => {
205
+ ), oe = typeof be == "number" ? be : void 0, _ = H(() => {
206
206
  if (!ve) return n;
207
- const e = R.trim().toLowerCase();
207
+ const e = L.trim().toLowerCase();
208
208
  return e ? n.filter((t) => (t.searchText ?? (typeof t.label == "string" ? t.label : "")).toLowerCase().includes(e)) : n;
209
- }, [n, R, ve]), oe = T(!1), _e = T(""), Y = m(
209
+ }, [n, L, ve]), le = T(!1), Re = T(""), U = h(
210
210
  (e, t) => {
211
- _e.current !== e && (_e.current = e, t && (oe.current = !0), at(e), $ == null || $(e));
211
+ Re.current !== e && (Re.current = e, t && (le.current = !0), at(e), $ == null || $(e));
212
212
  },
213
213
  [$]
214
- ), se = m(
215
- (e) => Y(e, !0),
216
- [Y]
217
- ), G = m(() => Y("", !1), [Y]);
214
+ ), se = h(
215
+ (e) => U(e, !0),
216
+ [U]
217
+ ), G = h(() => U("", !1), [U]);
218
218
  We(() => {
219
- oe.current && (A(-1), oe.current = !1);
220
- }, [R]);
221
- const ot = Z ?? ($ !== void 0 || n.length > Kt), Le = v ? !1 : ot, ie = m(() => {
219
+ le.current && (A(-1), le.current = !1);
220
+ }, [L]);
221
+ const lt = Z ?? ($ !== void 0 || n.length > Ft), Oe = v ? !1 : lt, ie = h(() => {
222
222
  var e, t;
223
- ne(!1), (e = L.current) != null && e.contains(Tt()) && ((t = U.current) == null || t.focus());
224
- }, []), D = m(() => {
225
- const e = U.current;
223
+ ne(!1), (e = O.current) != null && e.contains(Tt()) && ((t = Y.current) == null || t.focus());
224
+ }, []), D = h(() => {
225
+ const e = Y.current;
226
226
  if (!e) return;
227
- const t = Ot(L.current, {
227
+ const t = _t(O.current, {
228
228
  triggerRect: e.getBoundingClientRect(),
229
229
  preset: "standard",
230
230
  minWidth: W,
@@ -241,9 +241,9 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
241
241
  }
242
242
  D(), v && ((S = B.current) == null || S.focus());
243
243
  const e = () => D(), t = (y) => {
244
- const d = y.composedPath(), a = U.current, i = L.current;
244
+ const d = y.composedPath(), a = Y.current, i = O.current;
245
245
  (!a || !d.includes(a)) && (!i || !d.includes(i)) && ie();
246
- }, l = Lt(ie);
246
+ }, l = Ot(ie);
247
247
  return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), document.addEventListener("mousedown", t), () => {
248
248
  window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), document.removeEventListener("mousedown", t), l();
249
249
  };
@@ -251,97 +251,97 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
251
251
  if (!o)
252
252
  return;
253
253
  D();
254
- const e = L.current;
254
+ const e = O.current;
255
255
  if (!e || typeof ResizeObserver > "u")
256
256
  return;
257
257
  const t = new ResizeObserver(() => D());
258
258
  return t.observe(e), () => t.disconnect();
259
259
  }, [o, D]);
260
- const I = m(
260
+ const I = h(
261
261
  (e) => {
262
262
  re || nt(e), u == null || u(e);
263
263
  },
264
264
  [re, u]
265
- ), V = m(
265
+ ), V = h(
266
266
  (e) => n.some((t) => t.value === e && t.disabled),
267
267
  [n]
268
- ), ce = m(
268
+ ), ce = h(
269
269
  (e) => {
270
- V(e) || (f.includes(e) ? I(f.filter((t) => t !== e)) : I([...f, e]));
270
+ V(e) || (m.includes(e) ? I(m.filter((t) => t !== e)) : I([...m, e]));
271
271
  },
272
- [f, I, V]
272
+ [m, I, V]
273
273
  ), X = H(() => {
274
274
  const e = /* @__PURE__ */ new Set();
275
275
  for (const t of n)
276
276
  t.disabled && e.add(t.value);
277
277
  return e;
278
- }, [n]), st = m(
278
+ }, [n]), st = h(
279
279
  (e) => {
280
280
  e.stopPropagation();
281
- const t = f.filter((l) => X.has(l));
281
+ const t = m.filter((l) => X.has(l));
282
282
  I(t);
283
283
  },
284
- [I, f, X]
285
- ), Oe = m(
284
+ [I, m, X]
285
+ ), _e = h(
286
286
  (e, t) => {
287
- t.stopPropagation(), !V(e) && I(f.filter((l) => l !== e));
287
+ t.stopPropagation(), !V(e) && I(m.filter((l) => l !== e));
288
288
  },
289
- [f, I, V]
290
- ), j = m(
289
+ [m, I, V]
290
+ ), j = h(
291
291
  (e) => {
292
292
  if (!Yt.has(e.key)) return;
293
293
  if (e.preventDefault(), e.stopPropagation(), !o) {
294
294
  ne(!0);
295
295
  return;
296
296
  }
297
- const t = O.length;
297
+ const t = _.length;
298
298
  if (t === 0) return;
299
299
  const l = (d) => {
300
300
  requestAnimationFrame(() => {
301
- const a = Re.current[d], i = ke.current;
301
+ const a = Le.current[d], i = ke.current;
302
302
  if (!a || !i) return;
303
- const h = a.offsetTop, Pe = h + a.offsetHeight, Me = i.scrollTop, ft = Me + i.clientHeight;
303
+ const g = a.offsetTop, Pe = g + a.offsetHeight, Me = i.scrollTop, ft = Me + i.clientHeight;
304
304
  Pe > ft ? i.scrollTo({
305
305
  top: Pe - i.clientHeight,
306
306
  behavior: "smooth"
307
- }) : h < Me && i.scrollTo({ top: h, behavior: "smooth" });
307
+ }) : g < Me && i.scrollTo({ top: g, behavior: "smooth" });
308
308
  });
309
309
  }, S = (d) => {
310
310
  var i;
311
311
  let a = x;
312
- for (let h = 0; h < t; h++)
313
- if (a = d === 1 ? a < t - 1 ? a + 1 : 0 : a > 0 ? a - 1 : t - 1, !((i = O[a]) != null && i.disabled)) {
312
+ for (let g = 0; g < t; g++)
313
+ if (a = d === 1 ? a < t - 1 ? a + 1 : 0 : a > 0 ? a - 1 : t - 1, !((i = _[a]) != null && i.disabled)) {
314
314
  l(a), A(a);
315
315
  return;
316
316
  }
317
317
  }, y = () => {
318
318
  var i;
319
- if (x < 0 || x >= t || (i = O[x]) != null && i.disabled) return;
320
- const d = O[x].value;
319
+ if (x < 0 || x >= t || (i = _[x]) != null && i.disabled) return;
320
+ const d = _[x].value;
321
321
  ce(d), G();
322
- const a = n.findIndex((h) => h.value === d);
322
+ const a = n.findIndex((g) => g.value === d);
323
323
  A(a >= 0 ? a : -1), l(a >= 0 ? a : 0), requestAnimationFrame(() => {
324
- var h;
325
- return (h = B.current) == null ? void 0 : h.focus();
324
+ var g;
325
+ return (g = B.current) == null ? void 0 : g.focus();
326
326
  });
327
327
  };
328
328
  switch (e.key) {
329
329
  case Ke:
330
330
  S(1);
331
331
  break;
332
- case Ue:
332
+ case Ye:
333
333
  S(-1);
334
334
  break;
335
- case Ye:
335
+ case Ue:
336
336
  y();
337
337
  break;
338
338
  }
339
339
  },
340
- [o, O, x, ce, n, G]
341
- ), Ne = m(
340
+ [o, _, x, ce, n, G]
341
+ ), Ne = h(
342
342
  (e) => {
343
- if (e.key === Ut && R === "" && f.length > 0) {
344
- e.preventDefault(), I(f.slice(0, -1)), requestAnimationFrame(() => {
343
+ if (e.key === Kt && L === "" && m.length > 0) {
344
+ e.preventDefault(), I(m.slice(0, -1)), requestAnimationFrame(() => {
345
345
  var t;
346
346
  return (t = B.current) == null ? void 0 : t.focus();
347
347
  });
@@ -349,22 +349,23 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
349
349
  }
350
350
  j(e);
351
351
  },
352
- [j, R, f, I]
353
- ), Ce = s.length > 0 && !b && !p, it = Rt({
354
- disabled: b,
352
+ [j, L, m, I]
353
+ ), Ce = s.length > 0 && !p && !f, it = Lt({
354
+ disabled: p,
355
355
  error: E,
356
356
  open: o,
357
- loading: p,
357
+ loading: f,
358
358
  hasSelection: s.length > 0
359
359
  }), de = H(() => v ? /* @__PURE__ */ r(
360
360
  "input",
361
361
  {
362
362
  ref: B,
363
363
  type: "text",
364
- value: R,
364
+ value: L,
365
365
  onChange: (e) => se(e.target.value),
366
366
  onKeyDown: Ne,
367
- placeholder: s.length === 0 ? g : "",
367
+ disabled: p || f,
368
+ placeholder: s.length === 0 ? b : "",
368
369
  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))]",
369
370
  onMouseDown: (e) => {
370
371
  e.preventDefault();
@@ -372,16 +373,18 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
372
373
  }
373
374
  ) : null, [
374
375
  v,
375
- R,
376
+ L,
376
377
  se,
377
378
  Ne,
379
+ p,
380
+ f,
378
381
  s.length,
379
- g
382
+ b
380
383
  ]), ct = H(() => {
381
384
  if (N && s.length > 0)
382
385
  return N(s);
383
386
  if (ee && s.length > 0) {
384
- const e = le != null ? s.slice(0, le) : s, t = s.length - e.length;
387
+ const e = oe != null ? s.slice(0, oe) : s, t = s.length - e.length;
385
388
  return /* @__PURE__ */ w(
386
389
  "div",
387
390
  {
@@ -396,7 +399,7 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
396
399
  value: l.label,
397
400
  type: "default",
398
401
  textTransform: "none",
399
- onRemove: te && !b && !S ? (y) => Oe(l.value, y) : void 0,
402
+ onRemove: te && !p && !S ? (y) => _e(l.value, y) : void 0,
400
403
  className: "shrink-0"
401
404
  },
402
405
  l.value
@@ -411,33 +414,33 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
411
414
  }
412
415
  );
413
416
  }
414
- return v && s.length === 0 ? de : s.length === 0 ? /* @__PURE__ */ r("span", { className: "text-[var(--malachite-text-placeholder)]", children: g }) : s.length === 1 ? /* @__PURE__ */ r("span", { children: s[0].label }) : /* @__PURE__ */ r("span", { children: `${s.length} selected` });
417
+ 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` });
415
418
  }, [
416
419
  s,
417
420
  N,
418
421
  ee,
419
- le,
422
+ oe,
420
423
  te,
421
- b,
422
- Oe,
424
+ p,
425
+ _e,
423
426
  v,
424
427
  de,
425
- g,
428
+ b,
426
429
  X
427
430
  ]), dt = n.length === 0 ? "No options available" : "No results found";
428
431
  gt(() => {
429
- o && Ht();
432
+ o && Dt();
430
433
  }, [o]);
431
434
  const ut = {
432
435
  position: "fixed",
433
436
  top: (c == null ? void 0 : c.top) ?? 0,
434
437
  left: (c == null ? void 0 : c.left) ?? 0,
435
438
  width: c == null ? void 0 : c.width,
436
- background: F.standard.background,
437
- border: F.standard.border,
438
- borderRadius: F.standard.radius,
439
- boxShadow: F.standard.shadow,
440
- padding: F.standard.padding,
439
+ background: z.standard.background,
440
+ border: z.standard.border,
441
+ borderRadius: z.standard.radius,
442
+ boxShadow: z.standard.shadow,
443
+ padding: z.standard.padding,
441
444
  display: "flex",
442
445
  flexDirection: "column",
443
446
  gap: 4,
@@ -450,11 +453,12 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
450
453
  /* @__PURE__ */ w(
451
454
  Ve,
452
455
  {
453
- ref: U,
456
+ ref: Y,
454
457
  id: Ie,
455
458
  triggerRole: v ? "combobox" : ee && te ? "group" : "button",
456
- disabled: b || p,
457
- [_t]: "",
459
+ disabled: p || f,
460
+ [Rt]: "",
461
+ "data-open": o || void 0,
458
462
  "aria-haspopup": "listbox",
459
463
  "aria-expanded": o,
460
464
  "aria-controls": o ? we : void 0,
@@ -464,9 +468,9 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
464
468
  "aria-invalid": E || void 0,
465
469
  "aria-required": Q || void 0,
466
470
  "aria-describedby": tt,
467
- "aria-busy": p || void 0,
471
+ "aria-busy": f || void 0,
468
472
  onClick: () => {
469
- b || p || ne((e) => !e);
473
+ p || f || ne((e) => !e);
470
474
  },
471
475
  onKeyDown: j,
472
476
  style: {
@@ -474,7 +478,7 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
474
478
  ...it,
475
479
  ...Ze
476
480
  },
477
- className: `w-full ${zt[C]} border border-solid flex items-center font-normal text-[var(--malachite-text-primary)] ${b || p ? "cursor-not-allowed" : "cursor-pointer"} ${Ct} ${At} ${je}`,
481
+ className: `w-full ${zt[C]} border border-solid flex items-center font-normal text-[var(--malachite-text-primary)] ${p || f ? "cursor-not-allowed" : "cursor-pointer"} ${Ct} ${je}`,
478
482
  children: [
479
483
  /* @__PURE__ */ r(
480
484
  "span",
@@ -483,7 +487,7 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
483
487
  children: ct
484
488
  }
485
489
  ),
486
- p ? /* @__PURE__ */ r("span", { className: "flex items-center justify-center shrink-0 size-[14px]", children: /* @__PURE__ */ r(It, { size: "xxxsmall" }) }) : /* @__PURE__ */ r(
490
+ f ? /* @__PURE__ */ r("span", { className: "flex items-center justify-center shrink-0 size-[14px]", children: /* @__PURE__ */ r(It, { size: "xxxsmall" }) }) : /* @__PURE__ */ r(
487
491
  yt,
488
492
  {
489
493
  size: 13,
@@ -513,14 +517,14 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
513
517
  /* @__PURE__ */ w(
514
518
  "div",
515
519
  {
516
- ref: L,
520
+ ref: O,
517
521
  id: we,
518
522
  role: "listbox",
519
523
  "aria-multiselectable": "true",
520
- ...lt,
524
+ ...ot,
521
525
  style: ut,
522
526
  children: [
523
- Le && /* @__PURE__ */ w(
527
+ Oe && /* @__PURE__ */ w(
524
528
  "div",
525
529
  {
526
530
  style: {
@@ -548,7 +552,7 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
548
552
  "input",
549
553
  {
550
554
  type: "text",
551
- value: R,
555
+ value: L,
552
556
  onChange: (e) => se(e.target.value),
553
557
  onKeyDown: j,
554
558
  placeholder: "Search",
@@ -568,7 +572,7 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
568
572
  ]
569
573
  }
570
574
  ),
571
- Le && /* @__PURE__ */ r(
575
+ Oe && /* @__PURE__ */ r(
572
576
  "div",
573
577
  {
574
578
  "aria-hidden": "true",
@@ -595,17 +599,17 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
595
599
  scrollbarWidth: "thin",
596
600
  scrollbarColor: "var(--malachite-text-placeholder, rgb(187, 187, 187)) transparent"
597
601
  },
598
- children: O.length === 0 ? (
602
+ children: _.length === 0 ? (
599
603
  // `role="listbox"` admits only option/group children.
600
- /* @__PURE__ */ r("div", { role: "presentation", style: Ft, children: dt })
601
- ) : O.map((e, t) => {
604
+ /* @__PURE__ */ r("div", { role: "presentation", style: Gt, children: dt })
605
+ ) : _.map((e, t) => {
602
606
  const l = ae.has(e.value), S = t === x, y = !!e.disabled;
603
607
  return /* @__PURE__ */ w(
604
608
  "button",
605
609
  {
606
610
  id: Ee(t),
607
611
  ref: (d) => {
608
- Re.current[t] = d;
612
+ Le.current[t] = d;
609
613
  },
610
614
  type: "button",
611
615
  role: "option",
@@ -639,8 +643,8 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
639
643
  color: l ? "var(--malachite-accent-foreground, rgb(2, 122, 66))" : "var(--malachite-text-primary, rgb(10, 10, 10))"
640
644
  },
641
645
  children: [
642
- /* @__PURE__ */ r(Vt, { option: e }),
643
- Dt(e.badge) && /* @__PURE__ */ r(
646
+ /* @__PURE__ */ r(Ut, { option: e }),
647
+ At(e.badge) && /* @__PURE__ */ r(
644
648
  "span",
645
649
  {
646
650
  style: {
@@ -648,7 +652,7 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
648
652
  flexShrink: 0,
649
653
  paddingLeft: 8
650
654
  },
651
- children: /* @__PURE__ */ r(fe.Suspense, { fallback: null, children: /* @__PURE__ */ r(Gt, { children: e.badge }) })
655
+ children: /* @__PURE__ */ r(fe.Suspense, { fallback: null, children: /* @__PURE__ */ r(Bt, { children: e.badge }) })
652
656
  }
653
657
  )
654
658
  ]
@@ -674,19 +678,19 @@ const Fe = 0.6, ze = 420, Vt = ({ option: n }) => {
674
678
  name: me ?? "",
675
679
  required: Q,
676
680
  requiredIndicator: Xe,
677
- loading: p,
681
+ loading: f,
678
682
  formControl: ge,
679
683
  description: q,
680
684
  controlId: Ie,
681
685
  labelId: Se,
682
686
  descriptionId: Qe,
683
687
  hintId: et,
684
- loadingComponent: M === void 0 ? /* @__PURE__ */ r($e, { heightClass: z[C] }) : /* @__PURE__ */ r("div", { style: Ge(M), children: /* @__PURE__ */ r($e, { heightClass: z[C] }) }),
688
+ loadingComponent: M === void 0 ? /* @__PURE__ */ r($e, { heightClass: F[C] }) : /* @__PURE__ */ r("div", { style: Ge(M), children: /* @__PURE__ */ r($e, { heightClass: F[C] }) }),
685
689
  children: He
686
690
  }
687
691
  ) : He;
688
692
  };
689
693
  export {
690
- br as default
694
+ gr as default
691
695
  };
692
696
  //# sourceMappingURL=MultiSelect.js.map