@stackone/malachite 2.86.0 → 2.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/COMPONENTS.md +3 -2
  2. package/dist/components/Card.js +128 -75
  3. package/dist/components/Card.js.map +1 -1
  4. package/dist/components/FilterSearch.js +228 -224
  5. package/dist/components/FilterSearch.js.map +1 -1
  6. package/dist/components/FrameHeader.js +36 -0
  7. package/dist/components/FrameHeader.js.map +1 -0
  8. package/dist/components/LoadingBar.js +5 -5
  9. package/dist/components/LoadingBar.js.map +1 -1
  10. package/dist/components/MultiSelect.js +431 -382
  11. package/dist/components/MultiSelect.js.map +1 -1
  12. package/dist/components/Table/Table.js +630 -606
  13. package/dist/components/Table/Table.js.map +1 -1
  14. package/dist/components/TimeBarChart/TimeBarChart.js +241 -0
  15. package/dist/components/TimeBarChart/TimeBarChart.js.map +1 -0
  16. package/dist/components/TimeBarChart/TimeBarChartAxes.js +49 -0
  17. package/dist/components/TimeBarChart/TimeBarChartAxes.js.map +1 -0
  18. package/dist/components/TimeBarChart/TimeBarChartBars.js +58 -0
  19. package/dist/components/TimeBarChart/TimeBarChartBars.js.map +1 -0
  20. package/dist/components/TimeBarChart/TimeBarChartLegend.js +29 -0
  21. package/dist/components/TimeBarChart/TimeBarChartLegend.js.map +1 -0
  22. package/dist/components/TimeBarChart/TimeBarChartTable.js +33 -0
  23. package/dist/components/TimeBarChart/TimeBarChartTable.js.map +1 -0
  24. package/dist/components/TimeBarChart/TimeBarChartTooltip.js +77 -0
  25. package/dist/components/TimeBarChart/TimeBarChartTooltip.js.map +1 -0
  26. package/dist/components/TimeBarChart/stackLayout.js +25 -0
  27. package/dist/components/TimeBarChart/stackLayout.js.map +1 -0
  28. package/dist/components/TimeBarChart/timeBuckets.js +133 -0
  29. package/dist/components/TimeBarChart/timeBuckets.js.map +1 -0
  30. package/dist/components/TimeBarChart/tones.js +10 -0
  31. package/dist/components/TimeBarChart/tones.js.map +1 -0
  32. package/dist/components/dateMath.js +1 -0
  33. package/dist/components/dateMath.js.map +1 -1
  34. package/dist/components/filterSearchModel.js +53 -45
  35. package/dist/components/filterSearchModel.js.map +1 -1
  36. package/dist/components/frameStyles.js +14 -0
  37. package/dist/components/frameStyles.js.map +1 -0
  38. package/dist/components/headerContent.js +10 -0
  39. package/dist/components/headerContent.js.map +1 -0
  40. package/dist/index.d.ts +123 -3
  41. package/dist/index.js +24 -22
  42. package/dist/index.js.map +1 -1
  43. package/dist/tailwind.css.js +1 -1
  44. package/dist/theme.js +340 -340
  45. package/dist/theme.js.map +1 -1
  46. package/package.json +1 -1
@@ -1,38 +1,38 @@
1
- import { jsxs as f, Fragment as B, jsx as l } from "react/jsx-runtime";
2
- import { useId as je, useState as F, useRef as E, useMemo as U, useEffect as X, useCallback as q, useLayoutEffect as we, useInsertionEffect as Ue } from "react";
3
- import { createPortal as Xe } from "react-dom";
4
- import qe from "./CustomIcons/CaretDownIcon.js";
5
- import Be from "./CustomIcons/CheckmarkIcon.js";
6
- import ke from "./CustomIcons/DismissIcon.js";
7
- import Ve from "./CustomIcons/SearchIcon.js";
8
- import Ze from "./Spinner.js";
9
- import { CONTROL_TEXT_SIZE_CLASS as J, CONTROL_TEXT_SIZE as Ke } from "./controlTextSize.js";
10
- import { controlWidthStyle as Qe } from "./controlWidth.js";
11
- import { getTriggerVisual as Ye, DROPDOWN_TRIGGER_ATTR as Je } from "./dropdownTriggerStyle.js";
12
- import { pushEscapeLayer as et } from "./escapeLayers.js";
13
- import { orderSelections as tt, resolveMode as rt, filterRows as Se, searchRows as nt, chipText as it, removeFilter as ot, clearAll as lt, selectAll as at, deselectAll as st, toggleValue as ct } from "./filterSearchModel.js";
14
- import { ensureFilterSearchStyles as dt, FILTER_SEARCH_CLASS as I } from "./filterSearchStyles.js";
15
- import { measureMenuGeometry as pt, MENU_MAX_HEIGHT_PX as ut, MENU_SPECS as O } from "./floatingMenuGeometry.js";
16
- import { FOCUS_RING as ee } from "./focusRing.js";
17
- import { usePopupLayer as mt } from "./overlayLayers.js";
18
- import { useTopLayer as ft } from "./topLayer.js";
19
- import { useLatestRef as ht } from "./useLatestRef.js";
20
- const gt = {
21
- small: `min-h-[var(--malachite-control-height-small,28px)] gap-1 px-2.5 py-[2px] ${J.small} rounded-[var(--malachite-radius-10,10px)]`,
22
- medium: `min-h-[var(--malachite-control-height-medium,32px)] gap-1 px-3 py-[3px] ${J.medium} rounded-xl`,
23
- large: `min-h-[var(--malachite-control-height-large,42px)] gap-1.5 px-4 py-[6px] ${J.large} rounded-[var(--malachite-radius-xxl,14px)]`
24
- }, xt = {
1
+ import { jsxs as f, Fragment as V, jsx as l } from "react/jsx-runtime";
2
+ import { useId as Xe, useState as F, useRef as E, useMemo as H, useEffect as q, useCallback as B, useLayoutEffect as ke, useInsertionEffect as qe } from "react";
3
+ import { createPortal as Be } from "react-dom";
4
+ import Ve from "./CustomIcons/CaretDownIcon.js";
5
+ import Ze from "./CustomIcons/CheckmarkIcon.js";
6
+ import Se from "./CustomIcons/DismissIcon.js";
7
+ import Ke from "./CustomIcons/SearchIcon.js";
8
+ import Qe from "./Spinner.js";
9
+ import { CONTROL_TEXT_SIZE_CLASS as ee, CONTROL_TEXT_SIZE as Ye } from "./controlTextSize.js";
10
+ import { controlWidthStyle as Je } from "./controlWidth.js";
11
+ import { getTriggerVisual as et, DROPDOWN_TRIGGER_ATTR as tt } from "./dropdownTriggerStyle.js";
12
+ import { pushEscapeLayer as rt } from "./escapeLayers.js";
13
+ import { orderSelections as nt, resolveMode as it, openFilterOf as ot, filterRows as Ee, searchRows as lt, chipText as at, removeFilter as st, clearAll as ct, selectAll as pt, deselectAll as dt, toggleValue as ut } from "./filterSearchModel.js";
14
+ import { ensureFilterSearchStyles as mt, FILTER_SEARCH_CLASS as N } from "./filterSearchStyles.js";
15
+ import { measureMenuGeometry as ft, MENU_MAX_HEIGHT_PX as ht, MENU_SPECS as P } from "./floatingMenuGeometry.js";
16
+ import { FOCUS_RING as te } from "./focusRing.js";
17
+ import { usePopupLayer as gt } from "./overlayLayers.js";
18
+ import { useTopLayer as xt } from "./topLayer.js";
19
+ import { useLatestRef as bt } from "./useLatestRef.js";
20
+ const vt = {
21
+ small: `min-h-[var(--malachite-control-height-small,28px)] gap-1 px-2.5 py-[2px] ${ee.small} rounded-[var(--malachite-radius-10,10px)]`,
22
+ medium: `min-h-[var(--malachite-control-height-medium,32px)] gap-1 px-3 py-[3px] ${ee.medium} rounded-xl`,
23
+ large: `min-h-[var(--malachite-control-height-large,42px)] gap-1.5 px-4 py-[6px] ${ee.large} rounded-[var(--malachite-radius-xxl,14px)]`
24
+ }, yt = {
25
25
  small: "gap-1",
26
26
  medium: "gap-1",
27
27
  large: "gap-1.5"
28
- }, te = {
28
+ }, re = {
29
29
  resting: "bg-[var(--malachite-tag-default-background,rgba(123,123,123,0.1))] text-[var(--malachite-text-primary,rgb(10,10,10))]",
30
30
  active: "bg-[var(--malachite-accent-background,rgb(0,175,102))] text-[var(--malachite-card-background,rgb(255,255,255))]"
31
- }, bt = 5, re = (i) => !!i && !(i.kind === "item" && i.row.item.disabled), vt = (i, s) => {
32
- for (let g = Math.max(s, 0); g < i.length; g++)
33
- if (re(i[g])) return g;
31
+ }, wt = 5, ne = (i) => !!i && !(i.kind === "item" && i.row.item.disabled), kt = (i, h) => {
32
+ for (let a = Math.max(h, 0); a < i.length; a++)
33
+ if (ne(i[a])) return a;
34
34
  return -1;
35
- }, yt = {
35
+ }, St = {
36
36
  display: "flex",
37
37
  alignItems: "center",
38
38
  gap: 8,
@@ -45,33 +45,33 @@ const gt = {
45
45
  font: "inherit",
46
46
  cursor: "pointer",
47
47
  minWidth: 0
48
- }, Ee = {
48
+ }, Re = {
49
49
  borderRadius: 6,
50
50
  padding: "2px 6px",
51
51
  flexShrink: 0,
52
52
  whiteSpace: "nowrap"
53
- }, V = {
53
+ }, Z = {
54
54
  overflow: "hidden",
55
55
  textOverflow: "ellipsis",
56
56
  whiteSpace: "nowrap",
57
57
  minWidth: 0
58
- }, Re = { ...V, marginLeft: "auto", flexShrink: 1 }, Ce = (i) => i.preventDefault(), wt = (i) => {
58
+ }, Ce = { ...Z, marginLeft: "auto", flexShrink: 1 }, Ne = (i) => i.preventDefault(), Et = (i) => {
59
59
  i.preventDefault(), i.stopPropagation();
60
- }, kt = ({ row: i, showFilter: s }) => {
60
+ }, Rt = ({ row: i, showFilter: h }) => {
61
61
  if (i.kind === "filter")
62
- return /* @__PURE__ */ f(B, { children: [
63
- /* @__PURE__ */ l("span", { className: I.pill, style: Ee, children: i.filter.label }),
64
- i.filter.info && /* @__PURE__ */ l("span", { style: V, children: i.filter.info }),
65
- i.filter.example && /* @__PURE__ */ l("span", { className: I.hint, style: Re, children: i.filter.example })
62
+ return /* @__PURE__ */ f(V, { children: [
63
+ /* @__PURE__ */ l("span", { className: N.pill, style: Re, children: i.filter.label }),
64
+ i.filter.info && /* @__PURE__ */ l("span", { style: Z, children: i.filter.info }),
65
+ i.filter.example && /* @__PURE__ */ l("span", { className: N.hint, style: Ce, children: i.filter.example })
66
66
  ] });
67
67
  if (i.kind === "toggle")
68
68
  return /* @__PURE__ */ l("span", { style: { color: "var(--malachite-text-primary, rgb(10, 10, 10))" }, children: i.toggle === "select" ? "Select All" : "Deselect All" });
69
- const { item: g, filter: R, selected: Z } = i.row;
70
- return /* @__PURE__ */ f(B, { children: [
71
- s && /* @__PURE__ */ l("span", { className: I.pill, style: Ee, children: R.label }),
72
- /* @__PURE__ */ l("span", { style: V, children: g.label }),
73
- Z ? /* @__PURE__ */ l(
74
- Be,
69
+ const { item: a, filter: I, selected: T } = i.row;
70
+ return /* @__PURE__ */ f(V, { children: [
71
+ h && /* @__PURE__ */ l("span", { className: N.pill, style: Re, children: I.label }),
72
+ /* @__PURE__ */ l("span", { style: Z, children: a.label }),
73
+ T ? /* @__PURE__ */ l(
74
+ Ze,
75
75
  {
76
76
  size: 16,
77
77
  style: {
@@ -80,34 +80,35 @@ const gt = {
80
80
  color: "var(--malachite-accent-background, rgb(0, 175, 102))"
81
81
  }
82
82
  }
83
- ) : s && R.info && /* @__PURE__ */ l("span", { className: I.hint, style: Re, children: R.info })
83
+ ) : h && I.info && /* @__PURE__ */ l("span", { className: N.hint, style: Ce, children: I.info })
84
84
  ] });
85
- }, Gt = ({
85
+ }, Xt = ({
86
86
  filters: i,
87
- value: s,
88
- onChange: g,
89
- onClear: R,
90
- onActiveFilterChange: Z,
87
+ searchFilters: h,
88
+ value: a,
89
+ onChange: I,
90
+ onClear: T,
91
+ onActiveFilterChange: Ie,
91
92
  placeholder: K = "Search",
92
93
  size: Q = "medium",
93
- width: Ne,
94
- loading: p = !1,
94
+ width: De,
95
+ loading: d = !1,
95
96
  disabled: u = !1,
96
- clearable: Ie = !1,
97
- maxVisibleChips: De = 4,
98
- className: Ae = "",
99
- style: Le,
100
- id: Te,
101
- "aria-label": ne,
102
- "aria-labelledby": ie
97
+ clearable: Ae = !1,
98
+ maxVisibleChips: Le = 4,
99
+ className: Te = "",
100
+ style: $e,
101
+ id: Me,
102
+ "aria-label": ie,
103
+ "aria-labelledby": oe
103
104
  }) => {
104
- var ye;
105
- const oe = je(), le = `${oe}-listbox`, ae = (e) => `${oe}-option-${e}`, [a, Y] = F(!1), [x, y] = F(""), [c, $e] = F(null), [se, m] = F(0), [d, ce] = F(null), D = E(null), T = E(null), w = E(null), H = E(null), de = E([]);
106
- ft(w, a);
107
- const Me = mt("multiselect", a, w), pe = E(/* @__PURE__ */ new Map()), $ = U(() => {
105
+ var we;
106
+ const le = Xe(), ae = `${le}-listbox`, se = (e) => `${le}-option-${e}`, [s, Y] = F(!1), [x, y] = F(""), [c, _e] = F(null), [ce, m] = F(0), [p, pe] = F(null), D = E(null), $ = E(null), w = E(null), z = E(null), de = E([]);
107
+ xt(w, s);
108
+ const Oe = gt("multiselect", s, w), ue = E(/* @__PURE__ */ new Map()), M = H(() => {
108
109
  var t;
109
- const e = new Map(pe.current);
110
- for (const r of i) {
110
+ const e = new Map(ue.current);
111
+ for (const r of [...h ?? [], ...i]) {
111
112
  const n = ((t = e.get(r.value)) == null ? void 0 : t.items) ?? /* @__PURE__ */ new Map();
112
113
  e.set(r.value, {
113
114
  label: r.label,
@@ -118,54 +119,57 @@ const gt = {
118
119
  });
119
120
  }
120
121
  return e;
121
- }, [i]);
122
- X(() => {
123
- pe.current = $;
124
- }, [$]);
125
- const ue = E([]), M = U(
126
- () => tt(s, ue.current, c),
127
- [s, c]
128
- );
129
- X(() => {
122
+ }, [i, h]);
123
+ q(() => {
130
124
  ue.current = M;
131
125
  }, [M]);
132
- const h = rt(c, x), C = i.find((e) => e.value === c), me = E(c), P = ht(Z), k = q(
126
+ const me = E([]), _ = H(
127
+ () => nt(a, me.current, c),
128
+ [a, c]
129
+ );
130
+ q(() => {
131
+ me.current = _;
132
+ }, [_]);
133
+ const g = it(c, x), J = h ?? i, R = H(
134
+ () => ot(c, i, h, a),
135
+ [c, i, h, a]
136
+ ), fe = E(c), W = bt(Ie), k = B(
133
137
  (e) => {
134
138
  var t;
135
- me.current !== e && (me.current = e, $e(e), (t = P.current) == null || t.call(P, e));
139
+ fe.current !== e && (fe.current = e, _e(e), (t = W.current) == null || t.call(W, e));
136
140
  },
137
- [P]
138
- ), b = U(() => {
139
- if (p) return [];
140
- if (h === "filters") return i.map((r) => ({ kind: "filter", filter: r }));
141
- const { toggle: e, items: t } = h === "items" ? Se(C, s, x) : nt(i, s, x);
141
+ [W]
142
+ ), b = H(() => {
143
+ if (d) return [];
144
+ if (g === "filters") return i.map((r) => ({ kind: "filter", filter: r }));
145
+ const { toggle: e, items: t } = g === "items" ? Ee(R, a, x) : lt(J, a, x);
142
146
  return [
143
147
  ...e ? [{ kind: "toggle", toggle: e }] : [],
144
148
  ...t.map((r) => ({ kind: "item", row: r }))
145
149
  ];
146
- }, [p, h, i, C, s, x]), z = U(() => {
147
- const e = new Map(s.map((n) => [n.filter, n.items])), t = (n) => {
148
- const o = $.get(n), v = e.get(n);
150
+ }, [d, g, i, J, R, a, x]), G = H(() => {
151
+ const e = new Map(a.map((n) => [n.filter, n.items])), t = (n) => {
152
+ const o = M.get(n), v = e.get(n);
149
153
  if (!v)
150
154
  return n === c ? [{ filter: n, text: (o == null ? void 0 : o.label) ?? n }] : [];
151
- if (!o && p) return [];
152
- const N = v.map((S) => (o == null ? void 0 : o.items.get(S)) ?? S);
153
- return [{ filter: n, text: it((o == null ? void 0 : o.label) ?? n, N) }];
154
- }, r = c !== null && !M.includes(c);
155
- return [...M, ...r ? [c] : []].flatMap(t);
156
- }, [M, s, $, p, c]), fe = z.slice(0, De), he = z.length - fe.length, W = q(
155
+ if (!o && d) return [];
156
+ const C = v.map((S) => (o == null ? void 0 : o.items.get(S)) ?? S);
157
+ return [{ filter: n, text: at((o == null ? void 0 : o.label) ?? n, C) }];
158
+ }, r = c !== null && !_.includes(c);
159
+ return [..._, ...r ? [c] : []].flatMap(t);
160
+ }, [_, a, M, d, c]), he = G.slice(0, Le), ge = G.length - he.length, j = B(
157
161
  ({ next: e, changes: t }) => {
158
- t.length > 0 && g(e, t);
162
+ t.length > 0 && I(e, t);
159
163
  },
160
- [g]
161
- ), A = q(() => {
162
- Y(!1), y(""), k(null), ce(null);
163
- }, [k]), G = () => {
164
- u || a || (m(0), Y(!0));
165
- }, _ = q(() => {
164
+ [I]
165
+ ), A = B(() => {
166
+ Y(!1), y(""), k(null), pe(null);
167
+ }, [k]), U = () => {
168
+ u || s || (m(0), Y(!0));
169
+ }, O = B(() => {
166
170
  const e = D.current;
167
- e && ce(
168
- pt(w.current, {
171
+ e && pe(
172
+ ft(w.current, {
169
173
  triggerRect: e.getBoundingClientRect(),
170
174
  preset: "standard",
171
175
  viewportWidth: window.innerWidth,
@@ -173,141 +177,141 @@ const gt = {
173
177
  })
174
178
  );
175
179
  }, []);
176
- X(() => {
177
- u && a && A();
178
- }, [u, a, A]), X(() => {
179
- if (!a) return;
180
+ q(() => {
181
+ u && s && A();
182
+ }, [u, s, A]), q(() => {
183
+ if (!s) return;
180
184
  const e = (o) => {
181
- const v = o.composedPath(), N = D.current, S = w.current;
182
- (!N || !v.includes(N)) && (!S || !v.includes(S)) && A();
185
+ const v = o.composedPath(), C = D.current, S = w.current;
186
+ (!C || !v.includes(C)) && (!S || !v.includes(S)) && A();
183
187
  };
184
188
  let t = null;
185
189
  const r = () => {
186
190
  t === null && (t = requestAnimationFrame(() => {
187
- t = null, _();
191
+ t = null, O();
188
192
  }));
189
- }, n = et(A);
193
+ }, n = rt(A);
190
194
  return document.addEventListener("mousedown", e), window.addEventListener("scroll", r, !0), window.addEventListener("resize", r), () => {
191
195
  document.removeEventListener("mousedown", e), window.removeEventListener("scroll", r, !0), window.removeEventListener("resize", r), t !== null && cancelAnimationFrame(t), n();
192
196
  };
193
- }, [a, A, _]), we(() => {
194
- if (!a || (_(), typeof ResizeObserver > "u")) return;
195
- const e = new ResizeObserver(() => _());
197
+ }, [s, A, O]), ke(() => {
198
+ if (!s || (O(), typeof ResizeObserver > "u")) return;
199
+ const e = new ResizeObserver(() => O());
196
200
  return w.current && e.observe(w.current), D.current && e.observe(D.current), () => e.disconnect();
197
- }, [a, _]), we(() => {
198
- H.current && (H.current.scrollTop = 0);
199
- }, [h, c, x]), Ue(() => {
200
- a && dt();
201
- }, [a]);
202
- const ge = (e) => {
201
+ }, [s, O]), ke(() => {
202
+ z.current && (z.current.scrollTop = 0);
203
+ }, [g, c, x]), qe(() => {
204
+ s && mt();
205
+ }, [s]);
206
+ const xe = (e) => {
203
207
  requestAnimationFrame(() => {
204
- const t = de.current[e], r = H.current;
208
+ const t = de.current[e], r = z.current;
205
209
  if (!t || !r) return;
206
210
  const n = t.offsetTop, o = n + t.offsetHeight;
207
211
  o > r.scrollTop + r.clientHeight ? r.scrollTop = o - r.clientHeight : n < r.scrollTop && (r.scrollTop = n);
208
212
  });
209
- }, xe = (e) => {
213
+ }, be = (e) => {
210
214
  if (e.kind === "filter") {
211
215
  k(e.filter.value), y(""), m(0);
212
216
  return;
213
217
  }
214
218
  if (e.kind === "toggle") {
215
- const j = h === "items" && C ? [C] : i;
216
- W(
217
- e.toggle === "select" ? at(j, s, x) : st(j, s, x)
219
+ const X = g === "items" && R ? [R] : J;
220
+ j(
221
+ e.toggle === "select" ? pt(X, a, x) : dt(X, a, x)
218
222
  ), y(""), m(0);
219
223
  return;
220
224
  }
221
225
  const { item: t, filter: r } = e.row;
222
226
  if (t.disabled) return;
223
- const n = ct(s, r.value, t.value);
224
- if (W(n), y(""), h !== "items") {
227
+ const n = ut(a, r.value, t.value);
228
+ if (j(n), y(""), g !== "items") {
225
229
  m(0);
226
230
  return;
227
231
  }
228
- const { toggle: o, items: v } = Se(r, n.next, ""), N = v.findIndex((j) => j.item.value === t.value), S = N < 0 ? 0 : N + (o ? 1 : 0);
229
- m(S), ge(S);
230
- }, _e = (e) => {
232
+ const { toggle: o, items: v } = Ee(r, n.next, ""), C = v.findIndex((X) => X.item.value === t.value), S = C < 0 ? 0 : C + (o ? 1 : 0);
233
+ m(S), xe(S);
234
+ }, Fe = (e) => {
231
235
  if (b.length === 0) return;
232
- let t = L < 0 ? se : L;
236
+ let t = L < 0 ? ce : L;
233
237
  for (let r = 0; r < b.length; r++)
234
- if (t = (t + e + b.length) % b.length, re(b[t])) {
235
- m(t), ge(t);
238
+ if (t = (t + e + b.length) % b.length, ne(b[t])) {
239
+ m(t), xe(t);
236
240
  return;
237
241
  }
238
- }, be = (e) => {
239
- e === c && k(null), W(ot(s, e));
240
- }, Fe = (e) => {
242
+ }, ve = (e) => {
243
+ e === c && k(null), j(st(a, e));
244
+ }, He = (e) => {
241
245
  var t;
242
- u || p || (k(e), y(""), m(0), Y(!0), (t = T.current) == null || t.focus());
243
- }, Oe = (e) => {
246
+ u || d || (k(e), y(""), m(0), Y(!0), (t = $.current) == null || t.focus());
247
+ }, Pe = (e) => {
244
248
  if (!(e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229))
245
249
  switch (e.key) {
246
250
  case "ArrowDown":
247
251
  case "ArrowUp": {
248
- if (e.preventDefault(), !a) {
249
- G();
252
+ if (e.preventDefault(), !s) {
253
+ U();
250
254
  return;
251
255
  }
252
- _e(e.key === "ArrowDown" ? 1 : -1);
256
+ Fe(e.key === "ArrowDown" ? 1 : -1);
253
257
  return;
254
258
  }
255
259
  case "Enter": {
256
- if (e.preventDefault(), !a) {
257
- G();
260
+ if (e.preventDefault(), !s) {
261
+ U();
258
262
  return;
259
263
  }
260
264
  const t = b[L];
261
- re(t) && xe(t);
265
+ ne(t) && be(t);
262
266
  return;
263
267
  }
264
268
  case "Backspace": {
265
269
  if (x !== "") return;
266
- if (c !== null && !s.some((o) => o.filter === c)) {
270
+ if (c !== null && !a.some((o) => o.filter === c)) {
267
271
  e.preventDefault(), k(null), m(0);
268
272
  return;
269
273
  }
270
- const r = z.filter((o) => s.some((v) => v.filter === o.filter)), n = r[r.length - 1];
274
+ const r = G.filter((o) => a.some((v) => v.filter === o.filter)), n = r[r.length - 1];
271
275
  if (!n) return;
272
- e.preventDefault(), be(n.filter);
276
+ e.preventDefault(), ve(n.filter);
273
277
  return;
274
278
  }
275
279
  }
276
- }, He = (e) => {
277
- e.stopPropagation(), W(lt(s)), k(null), y(""), R == null || R();
278
- }, Pe = () => {
280
+ }, ze = (e) => {
281
+ e.stopPropagation(), j(ct(a)), k(null), y(""), T == null || T();
282
+ }, We = () => {
279
283
  k(null), y(""), m(0);
280
- }, ve = Ie && s.length > 0 && !u && !p, L = a ? vt(b, se) : -1, ze = Ye({ disabled: u, open: a }), We = h === "filters" ? "No filters available" : "No matching values", Ge = {
284
+ }, ye = Ae && a.length > 0 && !u && !d, L = s ? kt(b, ce) : -1, Ge = et({ disabled: u, open: s }), je = g === "filters" ? "No filters available" : "No matching values", Ue = {
281
285
  position: "fixed",
282
- top: (d == null ? void 0 : d.top) ?? 0,
283
- left: (d == null ? void 0 : d.left) ?? 0,
284
- width: d == null ? void 0 : d.width,
285
- background: O.standard.background,
286
- border: O.standard.border,
287
- borderRadius: O.standard.radius,
288
- boxShadow: O.standard.shadow,
289
- padding: O.standard.padding,
286
+ top: (p == null ? void 0 : p.top) ?? 0,
287
+ left: (p == null ? void 0 : p.left) ?? 0,
288
+ width: p == null ? void 0 : p.width,
289
+ background: P.standard.background,
290
+ border: P.standard.border,
291
+ borderRadius: P.standard.radius,
292
+ boxShadow: P.standard.shadow,
293
+ padding: P.standard.padding,
290
294
  display: "flex",
291
295
  flexDirection: "column",
292
296
  gap: 4,
293
- maxHeight: (d == null ? void 0 : d.maxHeight) ?? ut,
294
- fontSize: Ke[Q],
295
- visibility: d ? "visible" : "hidden",
296
- opacity: d ? 1 : 0
297
+ maxHeight: (p == null ? void 0 : p.maxHeight) ?? ht,
298
+ fontSize: Ye[Q],
299
+ visibility: p ? "visible" : "hidden",
300
+ opacity: p ? 1 : 0
297
301
  };
298
- return /* @__PURE__ */ f(B, { children: [
302
+ return /* @__PURE__ */ f(V, { children: [
299
303
  /* @__PURE__ */ f(
300
304
  "div",
301
305
  {
302
- className: `relative min-w-0 ${Ae}`,
303
- style: { ...Qe(Ne), ...Le },
306
+ className: `relative min-w-0 ${Te}`,
307
+ style: { ...Je(De), ...$e },
304
308
  children: [
305
309
  /* @__PURE__ */ f(
306
310
  "div",
307
311
  {
308
312
  ref: D,
309
- [Je]: "",
310
- "data-open": a || void 0,
313
+ [tt]: "",
314
+ "data-open": s || void 0,
311
315
  onBlur: (e) => {
312
316
  var r, n;
313
317
  const t = e.relatedTarget;
@@ -315,16 +319,16 @@ const gt = {
315
319
  },
316
320
  onMouseDown: (e) => {
317
321
  var t;
318
- u || (e.target !== T.current && e.preventDefault(), (t = T.current) == null || t.focus(), G());
322
+ u || (e.target !== $.current && e.preventDefault(), (t = $.current) == null || t.focus(), U());
319
323
  },
320
324
  style: {
321
325
  transition: "border-color 0.15s ease, box-shadow 0.15s ease",
322
- ...ze
326
+ ...Ge
323
327
  },
324
- className: `w-full min-w-0 flex items-center border border-solid font-normal ${gt[Q]} ${u ? "cursor-not-allowed" : "cursor-text"}`,
328
+ className: `w-full min-w-0 flex items-center border border-solid font-normal ${vt[Q]} ${u ? "cursor-not-allowed" : "cursor-text"}`,
325
329
  children: [
326
330
  /* @__PURE__ */ l(
327
- Ve,
331
+ Ke,
328
332
  {
329
333
  size: 13,
330
334
  className: "shrink-0 mr-1",
@@ -334,15 +338,15 @@ const gt = {
334
338
  /* @__PURE__ */ f(
335
339
  "div",
336
340
  {
337
- className: `flex flex-1 min-w-0 flex-wrap items-center ${xt[Q]} ${ve ? "pr-[18px]" : ""}`,
341
+ className: `flex flex-1 min-w-0 flex-wrap items-center ${yt[Q]} ${ye ? "pr-[18px]" : ""}`,
338
342
  children: [
339
- fe.map((e) => {
340
- const t = a && e.filter === c;
343
+ he.map((e) => {
344
+ const t = s && e.filter === c;
341
345
  return /* @__PURE__ */ f(
342
346
  "span",
343
347
  {
344
- onMouseDown: wt,
345
- className: `inline-flex items-center gap-1 max-w-[max(60px,calc(100%-64px))] min-w-0 h-[22px] pl-1.5 pr-1 rounded-md text-xs ${t ? te.active : te.resting}`,
348
+ onMouseDown: Et,
349
+ className: `inline-flex items-center gap-1 max-w-[max(60px,calc(100%-64px))] min-w-0 h-[22px] pl-1.5 pr-1 rounded-md text-xs ${t ? re.active : re.resting}`,
346
350
  children: [
347
351
  /* @__PURE__ */ l(
348
352
  "button",
@@ -351,8 +355,8 @@ const gt = {
351
355
  disabled: u,
352
356
  title: e.text,
353
357
  "aria-label": `Edit filter ${e.text}`,
354
- onClick: () => Fe(e.filter),
355
- className: `truncate min-w-0 bg-transparent border-none p-0 text-[length:inherit] text-current ${u || p ? "cursor-default" : "cursor-pointer"} ${ee}`,
358
+ onClick: () => He(e.filter),
359
+ className: `truncate min-w-0 bg-transparent border-none p-0 text-[length:inherit] text-current ${u || d ? "cursor-default" : "cursor-pointer"} ${te}`,
356
360
  children: e.text
357
361
  }
358
362
  ),
@@ -363,10 +367,10 @@ const gt = {
363
367
  "aria-label": `Remove filter ${e.text}`,
364
368
  onClick: (r) => {
365
369
  var n;
366
- r.stopPropagation(), be(e.filter), (n = T.current) == null || n.focus();
370
+ r.stopPropagation(), ve(e.filter), (n = $.current) == null || n.focus();
367
371
  },
368
- className: `flex items-center justify-center shrink-0 bg-transparent border-none p-0 text-current opacity-70 hover:opacity-100 cursor-pointer ${ee}`,
369
- children: /* @__PURE__ */ l(ke, { size: 10 })
372
+ className: `flex items-center justify-center shrink-0 bg-transparent border-none p-0 text-current opacity-70 hover:opacity-100 cursor-pointer ${te}`,
373
+ children: /* @__PURE__ */ l(Se, { size: 10 })
370
374
  }
371
375
  )
372
376
  ]
@@ -374,82 +378,82 @@ const gt = {
374
378
  e.filter
375
379
  );
376
380
  }),
377
- he > 0 && /* @__PURE__ */ f(
381
+ ge > 0 && /* @__PURE__ */ f(
378
382
  "span",
379
383
  {
380
- className: `inline-flex items-center h-[22px] px-1.5 rounded-md text-xs ${te.resting}`,
384
+ className: `inline-flex items-center h-[22px] px-1.5 rounded-md text-xs ${re.resting}`,
381
385
  children: [
382
386
  "+",
383
- he
387
+ ge
384
388
  ]
385
389
  }
386
390
  ),
387
391
  /* @__PURE__ */ l(
388
392
  "input",
389
393
  {
390
- ref: T,
391
- id: Te,
394
+ ref: $,
395
+ id: Me,
392
396
  type: "text",
393
397
  role: "combobox",
394
398
  value: x,
395
399
  disabled: u,
396
- placeholder: z.length === 0 ? K : "",
400
+ placeholder: G.length === 0 ? K : "",
397
401
  autoComplete: "off",
398
402
  spellCheck: !1,
399
- "aria-label": ie ? void 0 : ne ?? K,
400
- "aria-labelledby": ie,
403
+ "aria-label": oe ? void 0 : ie ?? K,
404
+ "aria-labelledby": oe,
401
405
  "aria-haspopup": "listbox",
402
406
  "aria-autocomplete": "list",
403
- "aria-expanded": a,
404
- "aria-controls": a ? le : void 0,
405
- "aria-activedescendant": L >= 0 ? ae(L) : void 0,
406
- "aria-busy": p || void 0,
407
+ "aria-expanded": s,
408
+ "aria-controls": s ? ae : void 0,
409
+ "aria-activedescendant": L >= 0 ? se(L) : void 0,
410
+ "aria-busy": d || void 0,
407
411
  onChange: (e) => {
408
- y(e.target.value), m(0), G();
412
+ y(e.target.value), m(0), U();
409
413
  },
410
- onKeyDown: Oe,
414
+ onKeyDown: Pe,
411
415
  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"
412
416
  }
413
417
  )
414
418
  ]
415
419
  }
416
420
  ),
417
- /* @__PURE__ */ l("span", { className: "flex items-center justify-center shrink-0 size-[14px] ml-1", children: p ? /* @__PURE__ */ l(Ze, { size: "xxxsmall" }) : /* @__PURE__ */ l(
418
- qe,
421
+ /* @__PURE__ */ l("span", { className: "flex items-center justify-center shrink-0 size-[14px] ml-1", children: d ? /* @__PURE__ */ l(Qe, { size: "xxxsmall" }) : /* @__PURE__ */ l(
422
+ Ve,
419
423
  {
420
424
  size: 13,
421
425
  style: {
422
- color: a ? "var(--malachite-text-primary, rgb(10, 10, 10))" : "var(--malachite-text-placeholder, rgb(187, 187, 187))",
426
+ color: s ? "var(--malachite-text-primary, rgb(10, 10, 10))" : "var(--malachite-text-placeholder, rgb(187, 187, 187))",
423
427
  transition: "transform 0.2s ease, color 0.2s ease",
424
- transform: a ? "rotate(180deg)" : "rotate(0deg)"
428
+ transform: s ? "rotate(180deg)" : "rotate(0deg)"
425
429
  }
426
430
  }
427
431
  ) })
428
432
  ]
429
433
  }
430
434
  ),
431
- ve && /* @__PURE__ */ l(
435
+ ye && /* @__PURE__ */ l(
432
436
  "button",
433
437
  {
434
438
  type: "button",
435
439
  "aria-label": "Clear filters",
436
- onMouseDown: Ce,
437
- onClick: He,
438
- className: `absolute top-0 bottom-0 right-[30px] flex items-center justify-center px-[2px] bg-transparent border-none text-[var(--malachite-text-placeholder)] hover:text-[var(--malachite-text-primary)] cursor-pointer ${ee}`,
439
- children: /* @__PURE__ */ l(ke, { size: 10 })
440
+ onMouseDown: Ne,
441
+ onClick: ze,
442
+ className: `absolute top-0 bottom-0 right-[30px] flex items-center justify-center px-[2px] bg-transparent border-none text-[var(--malachite-text-placeholder)] hover:text-[var(--malachite-text-primary)] cursor-pointer ${te}`,
443
+ children: /* @__PURE__ */ l(Se, { size: 10 })
440
444
  }
441
445
  )
442
446
  ]
443
447
  }
444
448
  ),
445
- a && Xe(
449
+ s && Be(
446
450
  /* @__PURE__ */ f(
447
451
  "div",
448
452
  {
449
453
  ref: w,
450
- ...Me,
451
- style: Ge,
452
- onMouseDown: Ce,
454
+ ...Oe,
455
+ style: Ue,
456
+ onMouseDown: Ne,
453
457
  children: [
454
458
  /* @__PURE__ */ l(
455
459
  "div",
@@ -461,14 +465,14 @@ const gt = {
461
465
  gap: 4,
462
466
  minWidth: 0
463
467
  },
464
- children: h === "items" ? /* @__PURE__ */ f(B, { children: [
468
+ children: g === "items" ? /* @__PURE__ */ f(V, { children: [
465
469
  /* @__PURE__ */ l(
466
470
  "button",
467
471
  {
468
472
  type: "button",
469
473
  tabIndex: -1,
470
- onClick: Pe,
471
- className: I.crumb,
474
+ onClick: We,
475
+ className: N.crumb,
472
476
  style: {
473
477
  background: "none",
474
478
  border: "none",
@@ -479,19 +483,19 @@ const gt = {
479
483
  children: "Filters"
480
484
  }
481
485
  ),
482
- /* @__PURE__ */ l("span", { style: V, children: `> ${(C == null ? void 0 : C.label) ?? ((ye = $.get(c ?? "")) == null ? void 0 : ye.label) ?? ""}` })
486
+ /* @__PURE__ */ l("span", { style: Z, children: `> ${(R == null ? void 0 : R.label) ?? ((we = M.get(c ?? "")) == null ? void 0 : we.label) ?? ""}` })
483
487
  ] }) : "Filters"
484
488
  }
485
489
  ),
486
490
  /* @__PURE__ */ f(
487
491
  "div",
488
492
  {
489
- ref: H,
490
- id: le,
493
+ ref: z,
494
+ id: ae,
491
495
  role: "listbox",
492
- "aria-multiselectable": h !== "filters",
493
- "aria-label": ne ?? K,
494
- "aria-busy": p || void 0,
496
+ "aria-multiselectable": g !== "filters",
497
+ "aria-label": ie ?? K,
498
+ "aria-busy": d || void 0,
495
499
  style: {
496
500
  display: "flex",
497
501
  flexDirection: "column",
@@ -503,11 +507,11 @@ const gt = {
503
507
  scrollbarWidth: "thin"
504
508
  },
505
509
  children: [
506
- p && Array.from({ length: bt }, (e, t) => /* @__PURE__ */ l(
510
+ d && Array.from({ length: wt }, (e, t) => /* @__PURE__ */ l(
507
511
  "div",
508
512
  {
509
513
  role: "presentation",
510
- className: I.loading,
514
+ className: N.loading,
511
515
  style: {
512
516
  height: 24,
513
517
  margin: "4px 10px",
@@ -517,7 +521,7 @@ const gt = {
517
521
  },
518
522
  t
519
523
  )),
520
- !p && b.length === 0 && /* @__PURE__ */ l(
524
+ !d && b.length === 0 && /* @__PURE__ */ l(
521
525
  "div",
522
526
  {
523
527
  role: "presentation",
@@ -525,7 +529,7 @@ const gt = {
525
529
  padding: "6px 10px",
526
530
  color: "var(--malachite-text-secondary, rgb(123, 123, 123))"
527
531
  },
528
- children: We
532
+ children: je
529
533
  }
530
534
  ),
531
535
  b.map((e, t) => {
@@ -533,7 +537,7 @@ const gt = {
533
537
  return /* @__PURE__ */ l(
534
538
  "button",
535
539
  {
536
- id: ae(t),
540
+ id: se(t),
537
541
  ref: (o) => {
538
542
  de.current[t] = o;
539
543
  },
@@ -544,13 +548,13 @@ const gt = {
544
548
  "aria-disabled": n || void 0,
545
549
  "data-highlighted": t === L,
546
550
  "data-disabled": n,
547
- className: I.row,
551
+ className: N.row,
548
552
  onMouseEnter: () => {
549
553
  n || m(t);
550
554
  },
551
- onClick: () => xe(e),
552
- style: yt,
553
- children: /* @__PURE__ */ l(kt, { row: e, showFilter: h === "search" })
555
+ onClick: () => be(e),
556
+ style: St,
557
+ children: /* @__PURE__ */ l(Rt, { row: e, showFilter: g === "search" })
554
558
  },
555
559
  r
556
560
  );
@@ -566,7 +570,7 @@ const gt = {
566
570
  ] });
567
571
  };
568
572
  export {
569
- Gt as FilterSearch,
570
- Gt as default
573
+ Xt as FilterSearch,
574
+ Xt as default
571
575
  };
572
576
  //# sourceMappingURL=FilterSearch.js.map