@stackone/malachite 2.105.1 → 2.107.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.
@@ -1,38 +1,40 @@
1
- import { jsxs as m, Fragment as Z, jsx as l } from "react/jsx-runtime";
2
- import ft, { useId as ht, useState as z, useRef as w, useEffect as W, useMemo as q, useCallback as ne, useLayoutEffect as Pe, useInsertionEffect as gt } from "react";
3
- import { createPortal as xt } from "react-dom";
4
- import bt from "./CustomIcons/CaretDownIcon.js";
5
- import vt from "./CustomIcons/CheckmarkIcon.js";
6
- import ze from "./CustomIcons/DismissIcon.js";
7
- import yt from "./CustomIcons/FilterIcon.js";
8
- import Be from "./CustomIcons/SearchIcon.js";
9
- import We from "./Spinner.js";
10
- import { CONTROL_TEXT_SIZE_CLASS as de, CONTROL_TEXT_SIZE as wt } from "./controlTextSize.js";
11
- import { controlWidthStyle as kt } from "./controlWidth.js";
12
- import { getTriggerVisual as St, DROPDOWN_TRIGGER_ATTR as Nt } from "./dropdownTriggerStyle.js";
13
- import { pushEscapeLayer as Rt } from "./escapeLayers.js";
14
- import { orderSelections as It, resolveMode as $t, openFilterOf as Et, filterRows as Ge, searchRows as Ct, chipText as Tt, removeFilter as _t, commitText as Lt, selectAll as At, deselectAll as Dt, toggleValue as Mt, clearAll as Ht } from "./filterSearchModel.js";
15
- import { ensureFilterSearchStyles as Ft, FILTER_SEARCH_CLASS as L } from "./filterSearchStyles.js";
16
- import { measureMenuGeometry as Ot, MENU_MAX_HEIGHT_PX as Pt, MENU_SPECS as B } from "./floatingMenuGeometry.js";
17
- import { FOCUS_RING_INSET as Ue, FOCUS_RING as Ve } from "./focusRing.js";
18
- import { usePopupLayer as zt } from "./overlayLayers.js";
19
- import { useTopLayer as Wt } from "./topLayer.js";
20
- import { useFollowTrigger as Gt } from "./useFollowTrigger.js";
21
- import { useLatestRef as ue } from "./useLatestRef.js";
22
- const Ut = {
23
- small: `min-h-[var(--malachite-control-height-small,28px)] gap-1 px-2.5 py-[2px] ${de.small} rounded-[var(--malachite-radius-10,10px)]`,
24
- medium: `min-h-[var(--malachite-control-height-medium,32px)] gap-1 px-3 py-[3px] ${de.medium} rounded-xl`,
25
- large: `min-h-[var(--malachite-control-height-large,42px)] gap-1.5 px-4 py-[6px] ${de.large} rounded-[var(--malachite-radius-xxl,14px)]`
26
- }, Vt = {
1
+ import { jsxs as p, Fragment as J, jsx as o } from "react/jsx-runtime";
2
+ import xt, { useId as bt, useState as W, useRef as S, useEffect as G, useMemo as U, useCallback as ie, useLayoutEffect as Oe, useInsertionEffect as vt } from "react";
3
+ import { createPortal as yt } from "react-dom";
4
+ import wt from "./CustomIcons/CaretDownIcon.js";
5
+ import kt from "./CustomIcons/CheckmarkIcon.js";
6
+ import Me from "./CustomIcons/DismissIcon.js";
7
+ import St from "./CustomIcons/FilterIcon.js";
8
+ import Ze from "./CustomIcons/SearchIcon.js";
9
+ import { FilterSearchPanel as Nt } from "./FilterSearchPanel.js";
10
+ import { Popover as Et } from "./Popover.js";
11
+ import Pe from "./Spinner.js";
12
+ import { CONTROL_TEXT_SIZE_CLASS as ce, CONTROL_TEXT_SIZE as $t } from "./controlTextSize.js";
13
+ import { controlWidthStyle as Rt } from "./controlWidth.js";
14
+ import { getTriggerVisual as Ct, DROPDOWN_TRIGGER_ATTR as It } from "./dropdownTriggerStyle.js";
15
+ import { pushEscapeLayer as Dt } from "./escapeLayers.js";
16
+ import { orderSelections as At, resolveMode as Tt, openFilterOf as He, filterRows as ze, searchRows as _t, chipText as Lt, removeFilter as Fe, commitText as We, selectAll as Ot, deselectAll as Mt, toggleValue as Pt, clearAll as Ht } from "./filterSearchModel.js";
17
+ import { ensureFilterSearchStyles as zt, FILTER_SEARCH_CLASS as O } from "./filterSearchStyles.js";
18
+ import { measureMenuGeometry as Ft, MENU_MAX_HEIGHT_PX as Wt, MENU_SPECS as Y } from "./floatingMenuGeometry.js";
19
+ import { FOCUS_RING_INSET as Ge, FOCUS_RING as Ue } from "./focusRing.js";
20
+ import { usePopupLayer as Gt } from "./overlayLayers.js";
21
+ import { useTopLayer as Ut } from "./topLayer.js";
22
+ import { useFollowTrigger as Vt } from "./useFollowTrigger.js";
23
+ import { useLatestRef as de } from "./useLatestRef.js";
24
+ const jt = {
25
+ small: `min-h-[var(--malachite-control-height-small,28px)] gap-1 px-2.5 py-[2px] ${ce.small} rounded-[var(--malachite-radius-10,10px)]`,
26
+ medium: `min-h-[var(--malachite-control-height-medium,32px)] gap-1 px-3 py-[3px] ${ce.medium} rounded-xl`,
27
+ large: `min-h-[var(--malachite-control-height-large,42px)] gap-1.5 px-4 py-[6px] ${ce.large} rounded-[var(--malachite-radius-xxl,14px)]`
28
+ }, Kt = {
27
29
  small: "gap-1",
28
30
  medium: "gap-1",
29
31
  large: "gap-1.5"
30
- }, je = "bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-text-primary,rgb(10,10,10))]", _ = {
31
- resting: `border-[var(--malachite-card-border,rgb(232,232,232))] ${je}`,
32
- active: `border-[var(--malachite-accent-background,rgb(0,175,102))] ${je}`,
32
+ }, Ve = "bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-text-primary,rgb(10,10,10))]", L = {
33
+ resting: `border-[var(--malachite-card-border,rgb(232,232,232))] ${Ve}`,
34
+ active: `border-[var(--malachite-accent-background,rgb(0,175,102))] ${Ve}`,
33
35
  muted: "bg-[var(--malachite-tag-default-background,rgba(123,123,123,0.1))] text-[var(--malachite-text-secondary,rgb(123,123,123))]",
34
36
  divider: "border-0 border-r border-solid border-[var(--malachite-card-border,rgb(232,232,232))]"
35
- }, jt = 5, Xt = 440, Kt = 2, me = (i) => !!i && !(i.kind === "item" && i.row.item.disabled), qt = (i) => {
37
+ }, Xt = 5, qt = 2, pe = (i) => !!i && !(i.kind === "item" && i.row.item.disabled), Zt = (i) => {
36
38
  switch (i.kind) {
37
39
  case "text":
38
40
  return "text";
@@ -43,11 +45,11 @@ const Ut = {
43
45
  case "item":
44
46
  return `item:${i.row.filter.value}:${i.row.item.value}`;
45
47
  }
46
- }, Bt = (i, y) => {
47
- for (let o = Math.max(y, 0); o < i.length; o++)
48
- if (me(i[o])) return o;
48
+ }, Yt = (i, b) => {
49
+ for (let a = Math.max(b, 0); a < i.length; a++)
50
+ if (pe(i[a])) return a;
49
51
  return -1;
50
- }, Zt = {
52
+ }, Jt = {
51
53
  display: "flex",
52
54
  alignItems: "center",
53
55
  gap: 8,
@@ -60,43 +62,43 @@ const Ut = {
60
62
  font: "inherit",
61
63
  cursor: "pointer",
62
64
  minWidth: 0
63
- }, Xe = {
65
+ }, je = {
64
66
  borderRadius: 6,
65
67
  padding: "2px 6px",
66
68
  flexShrink: 0,
67
69
  whiteSpace: "nowrap"
68
- }, Y = {
70
+ }, Q = {
69
71
  overflow: "hidden",
70
72
  textOverflow: "ellipsis",
71
73
  whiteSpace: "nowrap",
72
74
  minWidth: 0
73
- }, Ke = { ...Y, marginLeft: "auto", flexShrink: 1 }, Yt = {
75
+ }, Ke = { ...Q, marginLeft: "auto", flexShrink: 1 }, Qt = {
74
76
  display: "inline-flex",
75
77
  alignItems: "center",
76
78
  flexShrink: 0
77
- }, qe = (i) => i.preventDefault(), Jt = (i) => {
79
+ }, Xe = (i) => i.preventDefault(), qe = (i) => {
78
80
  i.preventDefault(), i.stopPropagation();
79
- }, Qt = ({ row: i, showFilter: y }) => {
81
+ }, Bt = ({ row: i, showFilter: b }) => {
80
82
  if (i.kind === "text")
81
- return /* @__PURE__ */ m(Z, { children: [
82
- /* @__PURE__ */ l(Be, { size: 13, style: { flexShrink: 0 } }),
83
- /* @__PURE__ */ l("span", { style: Y, children: `${i.label} "${i.text}"` })
83
+ return /* @__PURE__ */ p(J, { children: [
84
+ /* @__PURE__ */ o(Ze, { size: 13, style: { flexShrink: 0 } }),
85
+ /* @__PURE__ */ o("span", { style: Q, children: `${i.label} "${i.text}"` })
84
86
  ] });
85
87
  if (i.kind === "filter")
86
- return /* @__PURE__ */ m(Z, { children: [
87
- /* @__PURE__ */ l("span", { className: L.pill, style: Xe, children: i.filter.label }),
88
- i.filter.info && /* @__PURE__ */ l("span", { style: Y, children: i.filter.info }),
89
- i.filter.example && /* @__PURE__ */ l("span", { className: L.hint, style: Ke, children: i.filter.example })
88
+ return /* @__PURE__ */ p(J, { children: [
89
+ /* @__PURE__ */ o("span", { className: O.pill, style: je, children: i.filter.label }),
90
+ i.filter.info && /* @__PURE__ */ o("span", { style: Q, children: i.filter.info }),
91
+ i.filter.example && /* @__PURE__ */ o("span", { className: O.hint, style: Ke, children: i.filter.example })
90
92
  ] });
91
93
  if (i.kind === "toggle")
92
- return /* @__PURE__ */ l("span", { style: { color: "var(--malachite-text-primary, rgb(10, 10, 10))" }, children: i.toggle === "select" ? "Select All" : "Deselect All" });
93
- const { item: o, filter: A, selected: G } = i.row;
94
- return /* @__PURE__ */ m(Z, { children: [
95
- y && /* @__PURE__ */ l("span", { className: L.pill, style: Xe, children: A.label }),
96
- o.icon && /* @__PURE__ */ l("span", { style: Yt, children: o.icon }),
97
- /* @__PURE__ */ l("span", { style: Y, children: o.label }),
98
- G ? /* @__PURE__ */ l(
99
- vt,
94
+ return /* @__PURE__ */ o("span", { style: { color: "var(--malachite-text-primary, rgb(10, 10, 10))" }, children: i.toggle === "select" ? "Select All" : "Deselect All" });
95
+ const { item: a, filter: M, selected: V } = i.row;
96
+ return /* @__PURE__ */ p(J, { children: [
97
+ b && /* @__PURE__ */ o("span", { className: O.pill, style: je, children: M.label }),
98
+ a.icon && /* @__PURE__ */ o("span", { style: Qt, children: a.icon }),
99
+ /* @__PURE__ */ o("span", { style: Q, children: a.label }),
100
+ V ? /* @__PURE__ */ o(
101
+ kt,
100
102
  {
101
103
  size: 16,
102
104
  style: {
@@ -105,381 +107,399 @@ const Ut = {
105
107
  color: "var(--malachite-accent-background, rgb(0, 175, 102))"
106
108
  }
107
109
  }
108
- ) : y && A.info && /* @__PURE__ */ l("span", { className: L.hint, style: Ke, children: A.info })
110
+ ) : b && M.info && /* @__PURE__ */ o("span", { className: O.hint, style: Ke, children: M.info })
109
111
  ] });
110
- }, wr = ({
112
+ }, Nr = ({
111
113
  filters: i,
112
- searchFilters: y,
113
- value: o,
114
- onChange: A,
115
- onClear: G,
116
- onActiveFilterChange: Ze,
117
- onQueryChange: Ye,
118
- textFilter: D,
119
- placeholder: ie = "Search",
120
- size: le = "medium",
121
- width: Je,
122
- loading: g = !1,
114
+ searchFilters: b,
115
+ value: a,
116
+ onChange: M,
117
+ onClear: V,
118
+ onActiveFilterChange: Ye,
119
+ onQueryChange: Je,
120
+ textFilter: P,
121
+ placeholder: oe = "Search",
122
+ size: ae = "medium",
123
+ width: Qe,
124
+ loading: h = !1,
123
125
  disabled: f = !1,
124
- clearable: Qe = !1,
126
+ clearable: Be = !1,
125
127
  maxVisibleChips: et = 4,
126
- filtersButton: M = !1,
128
+ filtersButton: g = !1,
127
129
  className: tt = "",
128
130
  style: rt,
129
131
  id: nt,
130
- "aria-label": pe,
131
- "aria-labelledby": fe
132
+ "aria-label": me,
133
+ "aria-labelledby": ue
132
134
  }) => {
133
- var Oe;
134
- const he = ht(), ge = `${he}-listbox`, xe = (e) => `${he}-option-${e}`, [c, J] = z(!1), [p, k] = z(""), N = ue(Ye), oe = w("");
135
- W(() => {
135
+ var Le;
136
+ const fe = bt(), he = `${fe}-listbox`, ge = (e) => `${fe}-option-${e}`, [c, xe] = W(!1), [u, v] = W(""), $ = de(Je), le = S("");
137
+ G(() => {
136
138
  var e;
137
- oe.current !== p && (oe.current = p, (e = N.current) == null || e.call(N, p));
138
- }, [p, N]), W(
139
+ le.current !== u && (le.current = u, (e = $.current) == null || e.call($, u));
140
+ }, [u, $]), G(
139
141
  () => () => {
140
142
  var e;
141
- oe.current !== "" && ((e = N.current) == null || e.call(N, ""));
143
+ le.current !== "" && ((e = $.current) == null || e.call($, ""));
142
144
  },
143
- [N]
145
+ [$]
144
146
  );
145
- const [d, it] = z(null), [be, x] = z(0), [h, ve] = z(null), [Q, se] = z(!1), C = w(null), ye = w(null), H = w(null), R = w(null), ee = w(null), we = w([]);
146
- Wt(R, c);
147
- const lt = zt("multiselect", c, R), ke = w(/* @__PURE__ */ new Map()), U = q(() => {
147
+ const [m, it] = W(null), [be, y] = W(0), [x, ve] = W(null), [B, ee] = W(!1);
148
+ f && B && ee(!1);
149
+ const ye = S(!1), A = S(null), H = S(null), R = S(null), te = S(null), we = S([]);
150
+ Ut(R, c);
151
+ const ot = Gt("multiselect", c, R), ke = S(/* @__PURE__ */ new Map()), j = U(() => {
148
152
  const e = new Map(ke.current), t = /* @__PURE__ */ new Set();
149
- for (const n of [...y ?? [], ...i]) {
150
- const r = e.get(n.value), a = new Map(r == null ? void 0 : r.items), s = new Map(r == null ? void 0 : r.icons);
151
- for (const u of n.items) {
152
- a.set(u.value, u.label);
153
- const v = `${n.value}\0${u.value}`;
154
- u.icon ? (s.set(u.value, u.icon), t.add(v)) : t.has(v) || s.delete(u.value);
153
+ for (const n of [...b ?? [], ...i]) {
154
+ const r = e.get(n.value), s = new Map(r == null ? void 0 : r.items), l = new Map(r == null ? void 0 : r.icons);
155
+ for (const d of n.items) {
156
+ s.set(d.value, d.label);
157
+ const k = `${n.value}\0${d.value}`;
158
+ d.icon ? (l.set(d.value, d.icon), t.add(k)) : t.has(k) || l.delete(d.value);
155
159
  }
156
160
  e.set(n.value, {
157
161
  label: n.label,
158
162
  chipLabel: n.chipLabel !== !1,
159
- items: a,
160
- icons: s
163
+ items: s,
164
+ icons: l
161
165
  });
162
166
  }
163
167
  return e;
164
- }, [i, y]);
165
- W(() => {
166
- ke.current = U;
167
- }, [U]);
168
- const Se = w([]), V = q(
169
- () => It(o, Se.current, d),
170
- [o, d]
168
+ }, [i, b]);
169
+ G(() => {
170
+ ke.current = j;
171
+ }, [j]);
172
+ const Se = S([]), K = U(
173
+ () => At(a, Se.current, m),
174
+ [a, m]
171
175
  );
172
- W(() => {
173
- Se.current = V;
174
- }, [V]);
175
- const b = $t(d, p), ae = y ?? i, T = q(
176
- () => Et(d, i, y, o),
177
- [d, i, y, o]
178
- ), Ne = w(d), te = ue(Ze), I = ne(
176
+ G(() => {
177
+ Se.current = K;
178
+ }, [K]);
179
+ const w = Tt(m, u), se = b ?? i, T = U(
180
+ () => He(m, i, b, a),
181
+ [m, i, b, a]
182
+ ), at = U(() => {
183
+ if (!g) return [];
184
+ const e = new Set(i.map((r) => r.value)), t = new Set(a.map((r) => r.filter)), n = (b ?? []).filter(
185
+ (r) => !e.has(r.value) && t.has(r.value)
186
+ );
187
+ return [...i, ...n].map(
188
+ (r) => He(r.value, i, b, a) ?? r
189
+ );
190
+ }, [g, i, b, a]), Ne = S(m), re = de(Ye), C = ie(
179
191
  (e) => {
180
192
  var t;
181
- Ne.current !== e && (Ne.current = e, it(e), (t = te.current) == null || t.call(te, e));
193
+ Ne.current !== e && (Ne.current = e, it(e), (t = re.current) == null || t.call(re, e));
182
194
  },
183
- [te]
184
- ), F = D == null ? void 0 : D.value, j = D == null ? void 0 : D.label, S = q(() => {
185
- if (g) return [];
186
- if (b === "filters") return i.map((r) => ({ kind: "filter", filter: r }));
187
- const { toggle: e, items: t } = b === "items" ? Ge(T, o, p) : Ct(ae, o, p);
195
+ [re]
196
+ ), N = P == null ? void 0 : P.value, X = P == null ? void 0 : P.label, E = U(() => {
197
+ if (h || g) return [];
198
+ if (w === "filters") return i.map((r) => ({ kind: "filter", filter: r }));
199
+ const { toggle: e, items: t } = w === "items" ? ze(T, a, u) : _t(se, a, u);
188
200
  return [
189
- ...b === "search" && j !== void 0 ? [{ kind: "text", label: j, text: p.trim() }] : [],
201
+ ...w === "search" && X !== void 0 ? [{ kind: "text", label: X, text: u.trim() }] : [],
190
202
  ...e ? [{ kind: "toggle", toggle: e }] : [],
191
203
  ...t.map((r) => ({ kind: "item", row: r }))
192
204
  ];
193
- }, [g, b, i, ae, T, o, p, j]), re = q(() => {
194
- const e = new Map(o.map((r) => [r.filter, r.items])), t = (r) => {
195
- const a = r === F, s = a ? void 0 : U.get(r), u = a ? j ?? r : (s == null ? void 0 : s.label) ?? r, v = e.get(r);
196
- if (!v)
197
- return r === d ? [{ filter: r, text: u, label: u, values: [] }] : [];
198
- if (!a && !s && g) return [];
199
- const E = v.map((P) => ({
200
- value: P,
201
- label: (s == null ? void 0 : s.items.get(P)) ?? P,
202
- icon: s == null ? void 0 : s.icons.get(P)
205
+ }, [
206
+ h,
207
+ g,
208
+ w,
209
+ i,
210
+ se,
211
+ T,
212
+ a,
213
+ u,
214
+ X
215
+ ]), ne = U(() => {
216
+ const e = new Map(a.map((r) => [r.filter, r.items])), t = (r) => {
217
+ const s = r === N, l = s ? void 0 : j.get(r), d = s ? X ?? r : (l == null ? void 0 : l.label) ?? r, k = e.get(r);
218
+ if (!k)
219
+ return r === m ? [{ filter: r, text: d, label: d, values: [] }] : [];
220
+ if (!s && !l && h) return [];
221
+ const D = k.map((F) => ({
222
+ value: F,
223
+ label: (l == null ? void 0 : l.items.get(F)) ?? F,
224
+ icon: l == null ? void 0 : l.icons.get(F)
203
225
  }));
204
226
  return [
205
227
  {
206
228
  filter: r,
207
- text: Tt(
208
- u,
209
- E.map((P) => P.label)
229
+ text: Lt(
230
+ d,
231
+ D.map((F) => F.label)
210
232
  ),
211
233
  // With no values to show, the chip keeps its name rather than drawing empty.
212
- label: (s == null ? void 0 : s.chipLabel) === !1 && E.length > 0 ? null : u,
213
- values: E
234
+ label: (l == null ? void 0 : l.chipLabel) === !1 && D.length > 0 ? null : d,
235
+ values: D
214
236
  }
215
237
  ];
216
- }, n = d !== null && !V.includes(d);
217
- return [...V, ...n ? [d] : []].flatMap(t);
218
- }, [V, o, U, g, d, F, j]), Re = re.slice(0, et), Ie = re.length - Re.length, X = ne(
238
+ }, n = m !== null && !K.includes(m);
239
+ return [...K, ...n ? [m] : []].flatMap(t);
240
+ }, [K, a, j, h, m, N, X]), Ee = ne.slice(0, et), $e = ne.length - Ee.length, I = ie(
219
241
  ({ next: e, changes: t }) => {
220
- t.length > 0 && A(e, t);
242
+ t.length > 0 && M(e, t);
221
243
  },
222
- [A]
223
- ), $ = ne(() => {
224
- J(!1), k(""), I(null), ve(null), se(!1);
225
- }, [I]), ce = () => {
226
- f || c || (x(0), J(!0));
227
- }, K = ne(() => {
228
- const e = C.current;
229
- if (!e) return;
230
- const t = e.getBoundingClientRect(), n = Q ? ye.current : null, r = n == null ? void 0 : n.getBoundingClientRect();
231
- ve(
232
- Ot(R.current, {
233
- // The field's edges top and bottom, so the menu clears the bar however tall it wraps.
234
- triggerRect: r ? {
235
- top: t.top,
236
- bottom: t.bottom,
237
- left: r.left,
238
- right: r.right,
239
- width: r.width
240
- } : t,
244
+ [M]
245
+ ), _ = ie(() => {
246
+ xe(!1), v(""), C(null), ve(null);
247
+ }, [C]), q = () => {
248
+ f || c || g || (y(0), xe(!0));
249
+ }, Z = ie(() => {
250
+ const e = A.current;
251
+ e && ve(
252
+ Ft(R.current, {
253
+ triggerRect: e.getBoundingClientRect(),
241
254
  preset: "standard",
242
- ...r && { minWidth: Xt, align: "right" },
243
255
  viewportWidth: window.innerWidth,
244
256
  viewportHeight: window.innerHeight
245
257
  })
246
258
  );
247
- }, [Q]), $e = ue(K);
248
- Gt(c, C, K, $), W(() => {
249
- f && c && $();
250
- }, [f, c, $]), W(() => {
259
+ }, []), Re = de(Z);
260
+ Vt(c, A, Z, _), G(() => {
261
+ f && c && _();
262
+ }, [f, c, _]), G(() => {
251
263
  if (!c) return;
252
- const e = (a) => {
253
- const s = a.composedPath(), u = C.current, v = R.current;
254
- (!u || !s.includes(u)) && (!v || !s.includes(v)) && $();
264
+ const e = (s) => {
265
+ const l = s.composedPath(), d = A.current, k = R.current;
266
+ (!d || !l.includes(d)) && (!k || !l.includes(k)) && _();
255
267
  };
256
268
  let t = null;
257
269
  const n = () => {
258
270
  t === null && (t = requestAnimationFrame(() => {
259
- t = null, $e.current();
271
+ t = null, Re.current();
260
272
  }));
261
- }, r = Rt($);
273
+ }, r = Dt(_);
262
274
  return document.addEventListener("mousedown", e), window.addEventListener("resize", n), () => {
263
275
  document.removeEventListener("mousedown", e), window.removeEventListener("resize", n), t !== null && cancelAnimationFrame(t), r();
264
276
  };
265
- }, [c, $, $e]), Pe(() => {
266
- if (!c || (K(), typeof ResizeObserver > "u")) return;
267
- const e = new ResizeObserver(() => K());
268
- return R.current && e.observe(R.current), C.current && e.observe(C.current), () => e.disconnect();
269
- }, [c, K]), Pe(() => {
270
- ee.current && (ee.current.scrollTop = 0);
271
- }, [b, d, p]), gt(() => {
272
- c && Ft();
277
+ }, [c, _, Re]), Oe(() => {
278
+ if (!c || (Z(), typeof ResizeObserver > "u")) return;
279
+ const e = new ResizeObserver(() => Z());
280
+ return R.current && e.observe(R.current), A.current && e.observe(A.current), () => e.disconnect();
281
+ }, [c, Z]), Oe(() => {
282
+ te.current && (te.current.scrollTop = 0);
283
+ }, [w, m, u]), vt(() => {
284
+ c && zt();
273
285
  }, [c]);
274
- const Ee = (e) => {
286
+ const Ce = (e) => {
275
287
  requestAnimationFrame(() => {
276
- const t = we.current[e], n = ee.current;
288
+ const t = we.current[e], n = te.current;
277
289
  if (!t || !n) return;
278
- const r = t.offsetTop, a = r + t.offsetHeight;
279
- a > n.scrollTop + n.clientHeight ? n.scrollTop = a - n.clientHeight : r < n.scrollTop && (n.scrollTop = r);
290
+ const r = t.offsetTop, s = r + t.offsetHeight;
291
+ s > n.scrollTop + n.clientHeight ? n.scrollTop = s - n.clientHeight : r < n.scrollTop && (n.scrollTop = r);
280
292
  });
281
- }, Ce = (e) => {
293
+ }, Ie = (e) => {
282
294
  if (e.kind === "text") {
283
- F !== void 0 && X(Lt(o, F, e.text)), k(""), x(0);
295
+ N !== void 0 && I(We(a, N, e.text)), v(""), y(0);
284
296
  return;
285
297
  }
286
298
  if (e.kind === "filter") {
287
- I(e.filter.value), k(""), x(0);
299
+ C(e.filter.value), v(""), y(0);
288
300
  return;
289
301
  }
290
302
  if (e.kind === "toggle") {
291
- const E = b === "items" && T ? [T] : ae;
292
- X(
293
- e.toggle === "select" ? At(E, o, p) : Dt(E, o, p)
294
- ), k(""), x(0);
303
+ const D = w === "items" && T ? [T] : se;
304
+ I(
305
+ e.toggle === "select" ? Ot(D, a, u) : Mt(D, a, u)
306
+ ), v(""), y(0);
295
307
  return;
296
308
  }
297
309
  const { item: t, filter: n } = e.row;
298
310
  if (t.disabled) return;
299
- const r = Mt(o, n.value, t.value);
300
- if (X(r), k(""), b !== "items") {
301
- x(0);
311
+ const r = Pt(a, n.value, t.value);
312
+ if (I(r), v(""), w !== "items") {
313
+ y(0);
302
314
  return;
303
315
  }
304
- const { toggle: a, items: s } = Ge(n, r.next, ""), u = s.findIndex((E) => E.item.value === t.value), v = u < 0 ? 0 : u + (a ? 1 : 0);
305
- x(v), Ee(v);
306
- }, ot = (e) => {
307
- if (S.length === 0) return;
308
- let t = O < 0 ? be : O;
309
- for (let n = 0; n < S.length; n++)
310
- if (t = (t + e + S.length) % S.length, me(S[t])) {
311
- x(t), Ee(t);
316
+ const { toggle: s, items: l } = ze(n, r.next, ""), d = l.findIndex((D) => D.item.value === t.value), k = d < 0 ? 0 : d + (s ? 1 : 0);
317
+ y(k), Ce(k);
318
+ }, lt = (e) => {
319
+ if (E.length === 0) return;
320
+ let t = z < 0 ? be : z;
321
+ for (let n = 0; n < E.length; n++)
322
+ if (t = (t + e + E.length) % E.length, pe(E[t])) {
323
+ y(t), Ce(t);
324
+ return;
325
+ }
326
+ }, De = (e) => {
327
+ e === m && C(null), I(Fe(a, e));
328
+ }, st = (e, t) => {
329
+ var r, s, l;
330
+ if (f || h) return;
331
+ const n = e === N ? (r = a.find((d) => d.filter === e)) == null ? void 0 : r.items[0] : void 0;
332
+ if (g && n === void 0) {
333
+ ee(!(t ? ye.current : B));
334
+ return;
335
+ }
336
+ if (g && n !== void 0) {
337
+ I(Fe(a, e)), v(n), (s = H.current) == null || s.focus();
338
+ return;
339
+ }
340
+ C(n === void 0 ? e : null), v(n ?? ""), y(0), q(), (l = H.current) == null || l.focus();
341
+ }, ct = (e) => {
342
+ const t = u.trim();
343
+ e.key === "Enter" && N !== void 0 && t !== "" ? (e.preventDefault(), I(We(a, N, t)), v("")) : e.key === "Escape" && u !== "" && (e.preventDefault(), v(""));
344
+ }, dt = (e) => {
345
+ if (!(e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229)) {
346
+ if (g && e.key !== "Backspace") {
347
+ ct(e);
312
348
  return;
313
349
  }
314
- }, Te = (e) => {
315
- e === d && I(null), X(_t(o, e));
316
- }, st = (e) => {
317
- var n, r;
318
- if (f || g) return;
319
- const t = e === F ? (n = o.find((a) => a.filter === e)) == null ? void 0 : n.items[0] : void 0;
320
- I(t === void 0 ? e : null), k(t ?? ""), x(0), se(!1), J(!0), (r = H.current) == null || r.focus();
321
- }, at = (e) => {
322
- if (!(e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229))
323
350
  switch (e.key) {
324
351
  case "ArrowDown":
325
352
  case "ArrowUp": {
326
353
  if (e.preventDefault(), !c) {
327
- Ae();
354
+ q();
328
355
  return;
329
356
  }
330
- ot(e.key === "ArrowDown" ? 1 : -1);
357
+ lt(e.key === "ArrowDown" ? 1 : -1);
331
358
  return;
332
359
  }
333
360
  case "Enter": {
334
361
  if (e.preventDefault(), !c) {
335
- Ae();
362
+ q();
336
363
  return;
337
364
  }
338
- const t = S[O];
339
- me(t) && Ce(t);
365
+ const t = E[z];
366
+ pe(t) && Ie(t);
340
367
  return;
341
368
  }
342
369
  case "Backspace": {
343
- if (p !== "") return;
344
- if (d !== null && !o.some((a) => a.filter === d)) {
345
- e.preventDefault(), I(null), x(0);
370
+ if (u !== "") return;
371
+ if (m !== null && !a.some((s) => s.filter === m)) {
372
+ e.preventDefault(), C(null), y(0);
346
373
  return;
347
374
  }
348
- const n = re.filter((a) => o.some((s) => s.filter === a.filter)), r = n[n.length - 1];
375
+ const n = ne.filter((s) => a.some((l) => l.filter === s.filter)), r = n[n.length - 1];
349
376
  if (!r) return;
350
- e.preventDefault(), Te(r.filter);
377
+ e.preventDefault(), De(r.filter);
351
378
  return;
352
379
  }
353
380
  }
354
- }, ct = (e) => {
355
- e.stopPropagation(), X(Ht(o)), I(null), k(""), G == null || G();
356
- }, _e = () => {
357
- I(null), k(""), x(0);
358
- }, Le = () => {
359
- _e(), se(!0), J(!0);
360
- }, dt = () => {
361
- var e;
362
- if (c && Q && d === null && p === "") {
363
- $();
364
- return;
365
381
  }
366
- Le(), (e = H.current) == null || e.focus();
367
- }, Ae = () => {
368
- M ? Le() : ce();
369
- }, De = o.filter(
370
- (e) => e.filter !== F && e.items.length > 0
371
- ).length, Me = Qe && o.length > 0 && !f && !g, O = c ? Bt(S, be) : -1, ut = St({ disabled: f, open: c }), He = (e) => ({
382
+ }, pt = (e) => {
383
+ e.stopPropagation(), I(Ht(a)), C(null), v(""), V == null || V();
384
+ }, mt = () => {
385
+ C(null), v(""), y(0);
386
+ }, Ae = a.filter(
387
+ (e) => e.filter !== N && e.items.length > 0
388
+ ).length, Te = Be && a.length > 0 && !f && !h, z = c ? Yt(E, be) : -1, ut = Ct({ disabled: f, open: c }), ft = g ? { role: "searchbox" } : { role: "combobox", ...((e) => ({
372
389
  "aria-haspopup": "listbox",
373
390
  "aria-expanded": e,
374
- "aria-controls": e ? ge : void 0
375
- }), Fe = Me && /* @__PURE__ */ l(
391
+ "aria-controls": e ? he : void 0
392
+ }))(c), "aria-autocomplete": "list" }, _e = Te && /* @__PURE__ */ o(
376
393
  "button",
377
394
  {
378
395
  type: "button",
379
396
  "aria-label": "Clear filters",
380
- onMouseDown: qe,
381
- onClick: ct,
382
- className: `${M ? "" : "absolute top-0 bottom-0 right-[30px] "}flex items-center justify-center px-[2px] bg-transparent border-none text-[var(--malachite-text-placeholder,rgb(187,187,187))] hover:text-[var(--malachite-text-primary,rgb(10,10,10))] cursor-pointer ${Ve}`,
383
- children: /* @__PURE__ */ l(ze, { size: 10 })
397
+ onMouseDown: Xe,
398
+ onClick: pt,
399
+ className: `${g ? "" : "absolute top-0 bottom-0 right-[30px] "}flex items-center justify-center px-[2px] bg-transparent border-none text-[var(--malachite-text-placeholder,rgb(187,187,187))] hover:text-[var(--malachite-text-primary,rgb(10,10,10))] cursor-pointer ${Ue}`,
400
+ children: /* @__PURE__ */ o(Me, { size: 10 })
384
401
  }
385
- ), mt = b === "filters" ? "No filters available" : "No matching values", pt = {
402
+ ), ht = w === "filters" ? "No filters available" : "No matching values", gt = {
386
403
  position: "fixed",
387
- top: (h == null ? void 0 : h.top) ?? 0,
388
- left: (h == null ? void 0 : h.left) ?? 0,
389
- width: h == null ? void 0 : h.width,
390
- background: B.standard.background,
391
- border: B.standard.border,
392
- borderRadius: B.standard.radius,
393
- boxShadow: B.standard.shadow,
394
- padding: B.standard.padding,
404
+ top: (x == null ? void 0 : x.top) ?? 0,
405
+ left: (x == null ? void 0 : x.left) ?? 0,
406
+ width: x == null ? void 0 : x.width,
407
+ background: Y.standard.background,
408
+ border: Y.standard.border,
409
+ borderRadius: Y.standard.radius,
410
+ boxShadow: Y.standard.shadow,
411
+ padding: Y.standard.padding,
395
412
  display: "flex",
396
413
  flexDirection: "column",
397
414
  gap: 4,
398
- maxHeight: (h == null ? void 0 : h.maxHeight) ?? Pt,
399
- fontSize: wt[le],
400
- visibility: h ? "visible" : "hidden",
401
- opacity: h ? 1 : 0
415
+ maxHeight: (x == null ? void 0 : x.maxHeight) ?? Wt,
416
+ fontSize: $t[ae],
417
+ visibility: x ? "visible" : "hidden",
418
+ opacity: x ? 1 : 0
402
419
  };
403
- return /* @__PURE__ */ m(Z, { children: [
404
- /* @__PURE__ */ m(
420
+ return /* @__PURE__ */ p(J, { children: [
421
+ /* @__PURE__ */ p(
405
422
  "div",
406
423
  {
407
424
  className: `relative min-w-0 ${tt}`,
408
- style: { ...kt(Je), ...rt },
425
+ style: { ...Rt(Qe), ...rt },
409
426
  children: [
410
- /* @__PURE__ */ m(
427
+ /* @__PURE__ */ p(
411
428
  "div",
412
429
  {
413
- ref: C,
414
- [Nt]: "",
430
+ ref: A,
431
+ [It]: "",
415
432
  "data-open": c || void 0,
416
433
  onBlur: (e) => {
417
434
  var n, r;
418
435
  const t = e.relatedTarget;
419
- t && ((n = C.current) != null && n.contains(t) || (r = R.current) != null && r.contains(t)) || $();
436
+ t && ((n = A.current) != null && n.contains(t) || (r = R.current) != null && r.contains(t)) || g || _();
420
437
  },
421
438
  onMouseDown: (e) => {
422
439
  var t;
423
- f || (e.target !== H.current && e.preventDefault(), (t = H.current) == null || t.focus(), M || ce());
440
+ f || !e.currentTarget.contains(e.target) || (e.target !== H.current && e.preventDefault(), (t = H.current) == null || t.focus(), q());
424
441
  },
425
442
  style: {
426
443
  transition: "border-color 0.15s ease, box-shadow 0.15s ease",
427
444
  ...ut
428
445
  },
429
- className: `w-full min-w-0 flex items-center border border-solid font-normal ${Ut[le]} ${f ? "cursor-not-allowed" : "cursor-text"}`,
446
+ className: `w-full min-w-0 flex items-center border border-solid font-normal ${jt[ae]} ${f ? "cursor-not-allowed" : "cursor-text"}`,
430
447
  children: [
431
- /* @__PURE__ */ l(
432
- Be,
448
+ /* @__PURE__ */ o(
449
+ Ze,
433
450
  {
434
451
  size: 13,
435
452
  className: "shrink-0 mr-1",
436
453
  style: { color: "var(--malachite-text-placeholder, rgb(187, 187, 187))" }
437
454
  }
438
455
  ),
439
- /* @__PURE__ */ m(
456
+ /* @__PURE__ */ p(
440
457
  "div",
441
458
  {
442
- className: `flex flex-1 min-w-0 flex-wrap items-center ${Vt[le]} ${Me && !M ? "pr-[18px]" : ""}`,
459
+ className: `flex flex-1 min-w-0 flex-wrap items-center ${Kt[ae]} ${Te && !g ? "pr-[18px]" : ""}`,
443
460
  children: [
444
- Re.map((e) => {
445
- const t = c && e.filter === d, n = e.values.slice(0, Kt), r = e.values.length - n.length;
446
- return /* @__PURE__ */ m(
461
+ Ee.map((e) => {
462
+ const t = c && e.filter === m, n = e.values.slice(0, qt), r = e.values.length - n.length;
463
+ return /* @__PURE__ */ p(
447
464
  "span",
448
465
  {
449
- onMouseDown: Jt,
450
- className: `inline-flex items-stretch max-w-[max(60px,calc(100%-64px))] min-w-0 h-[22px] rounded-md border border-solid overflow-hidden text-xs ${t ? _.active : _.resting}`,
466
+ onMouseDown: qe,
467
+ className: `inline-flex items-stretch max-w-[max(60px,calc(100%-64px))] min-w-0 h-[22px] rounded-md border border-solid overflow-hidden text-xs ${t ? L.active : L.resting}`,
451
468
  children: [
452
- /* @__PURE__ */ m(
469
+ /* @__PURE__ */ p(
453
470
  "button",
454
471
  {
455
472
  type: "button",
456
473
  disabled: f,
457
474
  title: e.text,
458
475
  "aria-label": `Edit filter ${e.text}`,
459
- onClick: () => st(e.filter),
460
- className: `flex items-stretch min-w-0 bg-transparent border-none p-0 text-[length:inherit] text-current ${f || g ? "cursor-default" : "cursor-pointer"} ${Ue}`,
476
+ onPointerDown: () => {
477
+ ye.current = B;
478
+ },
479
+ onClick: (s) => st(e.filter, s.detail > 0),
480
+ className: `flex items-stretch min-w-0 bg-transparent border-none p-0 text-[length:inherit] text-current ${f || h ? "cursor-default" : "cursor-pointer"} ${Ge}`,
461
481
  children: [
462
- e.label !== null && /* @__PURE__ */ l(
482
+ e.label !== null && /* @__PURE__ */ o(
463
483
  "span",
464
484
  {
465
- className: `flex items-center min-w-0 px-1.5 ${_.muted} ${_.divider}`,
466
- children: /* @__PURE__ */ l("span", { className: "truncate", children: e.label })
485
+ className: `flex items-center min-w-0 px-1.5 ${L.muted} ${L.divider}`,
486
+ children: /* @__PURE__ */ o("span", { className: "truncate", children: e.label })
467
487
  }
468
488
  ),
469
- n.length > 0 && /* @__PURE__ */ m(
489
+ n.length > 0 && /* @__PURE__ */ p(
470
490
  "span",
471
491
  {
472
492
  className: `flex items-center gap-1 min-w-0 pl-1.5 font-medium ${f ? "pr-1.5" : ""}`,
473
493
  children: [
474
- /* @__PURE__ */ l("span", { className: "truncate", children: n.map((a, s) => /* @__PURE__ */ m(ft.Fragment, { children: [
475
- s > 0 && ", ",
476
- a.icon && /* @__PURE__ */ l("span", { className: "inline-flex items-center align-middle mr-1", children: a.icon }),
477
- a.label
478
- ] }, a.value)) }),
479
- r > 0 && /* @__PURE__ */ m(
494
+ /* @__PURE__ */ o("span", { className: "truncate", children: n.map((s, l) => /* @__PURE__ */ p(xt.Fragment, { children: [
495
+ l > 0 && ", ",
496
+ s.icon && /* @__PURE__ */ o("span", { className: "inline-flex items-center align-middle mr-1", children: s.icon }),
497
+ s.label
498
+ ] }, s.value)) }),
499
+ r > 0 && /* @__PURE__ */ p(
480
500
  "span",
481
501
  {
482
- className: `shrink-0 px-1 rounded text-[11px] leading-4 ${_.muted}`,
502
+ className: `shrink-0 px-1 rounded text-[11px] leading-4 ${L.muted}`,
483
503
  children: [
484
504
  "+",
485
505
  r
@@ -492,17 +512,17 @@ const Ut = {
492
512
  ]
493
513
  }
494
514
  ),
495
- !f && /* @__PURE__ */ l(
515
+ !f && /* @__PURE__ */ o(
496
516
  "button",
497
517
  {
498
518
  type: "button",
499
519
  "aria-label": `Remove filter ${e.text}`,
500
- onClick: (a) => {
501
- var s;
502
- a.stopPropagation(), Te(e.filter), (s = H.current) == null || s.focus();
520
+ onClick: (s) => {
521
+ var l;
522
+ s.stopPropagation(), De(e.filter), (l = H.current) == null || l.focus();
503
523
  },
504
- className: `flex items-center justify-center shrink-0 bg-transparent border-none px-1.5 text-[var(--malachite-text-secondary,rgb(123,123,123))] hover:text-[var(--malachite-text-primary,rgb(10,10,10))] cursor-pointer ${Ue}`,
505
- children: /* @__PURE__ */ l(ze, { size: 10 })
524
+ className: `flex items-center justify-center shrink-0 bg-transparent border-none px-1.5 text-[var(--malachite-text-secondary,rgb(123,123,123))] hover:text-[var(--malachite-text-primary,rgb(10,10,10))] cursor-pointer ${Ge}`,
525
+ children: /* @__PURE__ */ o(Me, { size: 10 })
506
526
  }
507
527
  )
508
528
  ]
@@ -510,78 +530,95 @@ const Ut = {
510
530
  e.filter
511
531
  );
512
532
  }),
513
- Ie > 0 && /* @__PURE__ */ m(
533
+ $e > 0 && /* @__PURE__ */ p(
514
534
  "span",
515
535
  {
516
- className: `inline-flex items-center h-[22px] px-1.5 rounded-md border border-solid text-xs font-medium ${_.resting}`,
536
+ className: `inline-flex items-center h-[22px] px-1.5 rounded-md border border-solid text-xs font-medium ${L.resting}`,
517
537
  children: [
518
538
  "+",
519
- Ie
539
+ $e
520
540
  ]
521
541
  }
522
542
  ),
523
- /* @__PURE__ */ l(
543
+ /* @__PURE__ */ o(
524
544
  "input",
525
545
  {
526
546
  ref: H,
527
547
  id: nt,
528
548
  type: "text",
529
- role: "combobox",
530
- value: p,
549
+ ...ft,
550
+ value: u,
531
551
  disabled: f,
532
- placeholder: re.length === 0 ? ie : "",
552
+ placeholder: ne.length === 0 ? oe : "",
533
553
  autoComplete: "off",
534
554
  spellCheck: !1,
535
- "aria-label": fe ? void 0 : pe ?? ie,
536
- "aria-labelledby": fe,
537
- ...He(c),
538
- "aria-autocomplete": "list",
539
- "aria-activedescendant": O >= 0 ? xe(O) : void 0,
540
- "aria-busy": g || void 0,
555
+ "aria-label": ue ? void 0 : me ?? oe,
556
+ "aria-labelledby": ue,
557
+ "aria-activedescendant": z >= 0 ? ge(z) : void 0,
558
+ "aria-busy": h || void 0,
541
559
  onChange: (e) => {
542
- k(e.target.value), x(0), ce();
560
+ v(e.target.value), y(0), ee(!1), q();
543
561
  },
544
- onKeyDown: at,
562
+ onKeyDown: dt,
545
563
  className: "flex-1 min-w-[60px] border-none outline-none bg-transparent p-0 text-[length:inherit] text-[var(--malachite-text-primary,rgb(10,10,10))] placeholder:text-[var(--malachite-text-placeholder,rgb(187,187,187))] disabled:cursor-not-allowed"
546
564
  }
547
565
  )
548
566
  ]
549
567
  }
550
568
  ),
551
- M ? /* @__PURE__ */ m("span", { className: "flex items-center self-stretch shrink-0 gap-1.5 ml-1", children: [
552
- g && /* @__PURE__ */ l(We, { size: "xxxsmall" }),
553
- Fe,
554
- /* @__PURE__ */ l(
569
+ g ? /* @__PURE__ */ p("span", { className: "flex items-center self-stretch shrink-0 gap-1.5 ml-1", children: [
570
+ h && /* @__PURE__ */ o(Pe, { size: "xxxsmall" }),
571
+ _e,
572
+ /* @__PURE__ */ o(
555
573
  "span",
556
574
  {
557
575
  "aria-hidden": "true",
558
576
  className: "w-px self-stretch my-1 bg-[var(--malachite-card-border,rgb(232,232,232))]"
559
577
  }
560
578
  ),
561
- /* @__PURE__ */ m(
562
- "button",
579
+ /* @__PURE__ */ o(
580
+ Et,
563
581
  {
564
- ref: ye,
565
- type: "button",
566
- disabled: f,
567
- ...He(c && Q),
568
- onClick: dt,
569
- className: `flex items-center gap-1 h-[22px] px-1.5 rounded-md bg-transparent border-none font-medium text-[length:inherit] text-[var(--malachite-text-primary,rgb(10,10,10))] hover:bg-[var(--malachite-tag-default-background,rgba(123,123,123,0.1))] disabled:cursor-not-allowed cursor-pointer ${Ve}`,
570
- children: [
571
- /* @__PURE__ */ l(yt, { size: 12 }),
572
- "Filters",
573
- De > 0 && /* @__PURE__ */ l(
574
- "span",
575
- {
576
- className: `min-w-4 px-1 rounded text-[11px] leading-4 text-center ${_.muted}`,
577
- children: De
578
- }
579
- )
580
- ]
582
+ open: B,
583
+ onOpenChange: ee,
584
+ "aria-label": "Filters",
585
+ placement: "bottom-end",
586
+ padding: "none",
587
+ className: "w-[300px]",
588
+ trigger: /* @__PURE__ */ p(
589
+ "button",
590
+ {
591
+ type: "button",
592
+ disabled: f,
593
+ onMouseDown: qe,
594
+ className: `flex items-center gap-1 h-[22px] px-1.5 rounded-md bg-transparent border-none font-medium text-[length:inherit] text-[var(--malachite-text-primary,rgb(10,10,10))] hover:bg-[var(--malachite-tag-default-background,rgba(123,123,123,0.1))] disabled:cursor-not-allowed cursor-pointer ${Ue}`,
595
+ children: [
596
+ /* @__PURE__ */ o(St, { size: 12 }),
597
+ "Filters",
598
+ Ae > 0 && /* @__PURE__ */ o(
599
+ "span",
600
+ {
601
+ className: `min-w-4 px-1 rounded text-[11px] leading-4 text-center ${L.muted}`,
602
+ children: Ae
603
+ }
604
+ )
605
+ ]
606
+ }
607
+ ),
608
+ children: /* @__PURE__ */ o(
609
+ Nt,
610
+ {
611
+ filters: at,
612
+ value: a,
613
+ onChange: I,
614
+ keep: N,
615
+ loading: h
616
+ }
617
+ )
581
618
  }
582
619
  )
583
- ] }) : /* @__PURE__ */ l("span", { className: "flex items-center justify-center shrink-0 size-[14px] ml-1", children: g ? /* @__PURE__ */ l(We, { size: "xxxsmall" }) : /* @__PURE__ */ l(
584
- bt,
620
+ ] }) : /* @__PURE__ */ o("span", { className: "flex items-center justify-center shrink-0 size-[14px] ml-1", children: h ? /* @__PURE__ */ o(Pe, { size: "xxxsmall" }) : /* @__PURE__ */ o(
621
+ wt,
585
622
  {
586
623
  size: 13,
587
624
  style: {
@@ -594,20 +631,20 @@ const Ut = {
594
631
  ]
595
632
  }
596
633
  ),
597
- !M && Fe
634
+ !g && _e
598
635
  ]
599
636
  }
600
637
  ),
601
- c && xt(
602
- /* @__PURE__ */ m(
638
+ c && yt(
639
+ /* @__PURE__ */ p(
603
640
  "div",
604
641
  {
605
642
  ref: R,
606
- ...lt,
607
- style: pt,
608
- onMouseDown: qe,
643
+ ...ot,
644
+ style: gt,
645
+ onMouseDown: Xe,
609
646
  children: [
610
- /* @__PURE__ */ l(
647
+ /* @__PURE__ */ o(
611
648
  "div",
612
649
  {
613
650
  style: {
@@ -617,14 +654,14 @@ const Ut = {
617
654
  gap: 4,
618
655
  minWidth: 0
619
656
  },
620
- children: b === "items" ? /* @__PURE__ */ m(Z, { children: [
621
- /* @__PURE__ */ l(
657
+ children: w === "items" ? /* @__PURE__ */ p(J, { children: [
658
+ /* @__PURE__ */ o(
622
659
  "button",
623
660
  {
624
661
  type: "button",
625
662
  tabIndex: -1,
626
- onClick: _e,
627
- className: L.crumb,
663
+ onClick: mt,
664
+ className: O.crumb,
628
665
  style: {
629
666
  background: "none",
630
667
  border: "none",
@@ -635,19 +672,19 @@ const Ut = {
635
672
  children: "Filters"
636
673
  }
637
674
  ),
638
- /* @__PURE__ */ l("span", { style: Y, children: `> ${(T == null ? void 0 : T.label) ?? ((Oe = U.get(d ?? "")) == null ? void 0 : Oe.label) ?? ""}` })
675
+ /* @__PURE__ */ o("span", { style: Q, children: `> ${(T == null ? void 0 : T.label) ?? ((Le = j.get(m ?? "")) == null ? void 0 : Le.label) ?? ""}` })
639
676
  ] }) : "Filters"
640
677
  }
641
678
  ),
642
- /* @__PURE__ */ m(
679
+ /* @__PURE__ */ p(
643
680
  "div",
644
681
  {
645
- ref: ee,
646
- id: ge,
682
+ ref: te,
683
+ id: he,
647
684
  role: "listbox",
648
- "aria-multiselectable": b !== "filters",
649
- "aria-label": pe ?? ie,
650
- "aria-busy": g || void 0,
685
+ "aria-multiselectable": w !== "filters",
686
+ "aria-label": me ?? oe,
687
+ "aria-busy": h || void 0,
651
688
  style: {
652
689
  display: "flex",
653
690
  flexDirection: "column",
@@ -659,11 +696,11 @@ const Ut = {
659
696
  scrollbarWidth: "thin"
660
697
  },
661
698
  children: [
662
- g && Array.from({ length: jt }, (e, t) => /* @__PURE__ */ l(
699
+ h && Array.from({ length: Xt }, (e, t) => /* @__PURE__ */ o(
663
700
  "div",
664
701
  {
665
702
  role: "presentation",
666
- className: L.loading,
703
+ className: O.loading,
667
704
  style: {
668
705
  height: 24,
669
706
  margin: "4px 10px",
@@ -673,7 +710,7 @@ const Ut = {
673
710
  },
674
711
  t
675
712
  )),
676
- !g && S.length === 0 && /* @__PURE__ */ l(
713
+ !h && E.length === 0 && /* @__PURE__ */ o(
677
714
  "div",
678
715
  {
679
716
  role: "presentation",
@@ -681,15 +718,15 @@ const Ut = {
681
718
  padding: "6px 10px",
682
719
  color: "var(--malachite-text-secondary, rgb(123, 123, 123))"
683
720
  },
684
- children: mt
721
+ children: ht
685
722
  }
686
723
  ),
687
- S.map((e, t) => {
724
+ E.map((e, t) => {
688
725
  const n = e.kind === "item" && !!e.row.item.disabled;
689
- return /* @__PURE__ */ l(
726
+ return /* @__PURE__ */ o(
690
727
  "button",
691
728
  {
692
- id: xe(t),
729
+ id: ge(t),
693
730
  ref: (r) => {
694
731
  we.current[t] = r;
695
732
  },
@@ -698,17 +735,17 @@ const Ut = {
698
735
  role: "option",
699
736
  "aria-selected": e.kind === "item" ? e.row.selected : !1,
700
737
  "aria-disabled": n || void 0,
701
- "data-highlighted": t === O,
738
+ "data-highlighted": t === z,
702
739
  "data-disabled": n,
703
- className: L.row,
740
+ className: O.row,
704
741
  onMouseEnter: () => {
705
- n || x(t);
742
+ n || y(t);
706
743
  },
707
- onClick: () => Ce(e),
708
- style: Zt,
709
- children: /* @__PURE__ */ l(Qt, { row: e, showFilter: b === "search" })
744
+ onClick: () => Ie(e),
745
+ style: Jt,
746
+ children: /* @__PURE__ */ o(Bt, { row: e, showFilter: w === "search" })
710
747
  },
711
- qt(e)
748
+ Zt(e)
712
749
  );
713
750
  })
714
751
  ]
@@ -722,7 +759,7 @@ const Ut = {
722
759
  ] });
723
760
  };
724
761
  export {
725
- wr as FilterSearch,
726
- wr as default
762
+ Nr as FilterSearch,
763
+ Nr as default
727
764
  };
728
765
  //# sourceMappingURL=FilterSearch.js.map