@mechane-ai/elements 0.39.0 → 0.41.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 (110) hide show
  1. package/NOTICE +11 -19
  2. package/README.md +49 -25
  3. package/dist/accessibility-P89UG9-r.js +25 -0
  4. package/dist/agent.js +1 -0
  5. package/dist/ai.js +50 -44
  6. package/dist/{categorical-values-BECG-J6R.js → categorical-values-DnGR_pQx.js} +3 -3
  7. package/dist/{chart-frame-CJFnI39T.js → chart-frame-BsyI1Zc8.js} +58 -57
  8. package/dist/{chart-input-DwAobO8Y.js → chart-input-r4S3-QCT.js} +2 -2
  9. package/dist/chart-navigation-D7OkLdSx.js +119 -0
  10. package/dist/charts/cartesian.js +560 -583
  11. package/dist/charts/distribution.js +218 -218
  12. package/dist/charts/graph.js +86 -85
  13. package/dist/charts/hierarchy.js +4 -4
  14. package/dist/charts/matrix.js +148 -147
  15. package/dist/charts/timeline.js +77 -76
  16. package/dist/charts.js +2 -2
  17. package/dist/code-block-C4K1sM9O.js +255 -0
  18. package/dist/collections.js +828 -607
  19. package/dist/constants.stylex-BILvnwUk.js +84 -0
  20. package/dist/content/code.js +1 -1
  21. package/dist/content/diff.js +3 -3
  22. package/dist/content/link.js +1 -1
  23. package/dist/content/markdown.js +2 -2
  24. package/dist/content/tree.js +184 -77
  25. package/dist/{content-link-B3ObdyZY.js → content-link-CBDqSvgP.js} +1 -1
  26. package/dist/content.js +1 -1
  27. package/dist/control-styles-D3q_Qyxi.js +179 -0
  28. package/dist/csp.js +14 -1
  29. package/dist/feedback.js +1 -1
  30. package/dist/forms/dates.js +359 -245
  31. package/dist/forms-I-WMHTkr.js +139 -0
  32. package/dist/forms.js +3 -3
  33. package/dist/index.js +1 -1
  34. package/dist/layout.js +271 -241
  35. package/dist/navigation/commands.js +87 -76
  36. package/dist/{navigation-D2_sGy3C.js → navigation-CveMIuXI.js} +1 -1
  37. package/dist/navigation.js +2 -2
  38. package/dist/overlays.js +1 -1
  39. package/dist/packages/ai/src/message-action.d.ts +1 -1
  40. package/dist/packages/charts/src/chart-navigation.d.ts +18 -2
  41. package/dist/packages/charts/src/chart-surface.d.ts +23 -0
  42. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +3 -2
  43. package/dist/packages/collections/src/data-table.d.ts +7 -2
  44. package/dist/packages/collections/src/index.d.ts +4 -1
  45. package/dist/packages/collections/src/query-controls.d.ts +18 -0
  46. package/dist/packages/collections/src/table-query.d.ts +64 -0
  47. package/dist/packages/collections/src/use-collection-controls.d.ts +3 -8
  48. package/dist/packages/content/src/pierre-theme.d.ts +0 -1
  49. package/dist/packages/core/src/actions.d.ts +15 -13
  50. package/dist/packages/core/src/copy-value.d.ts +3 -2
  51. package/dist/packages/core/src/disclosure.d.ts +14 -11
  52. package/dist/packages/feedback/src/notifications.d.ts +15 -15
  53. package/dist/packages/feedback/src/toast.d.ts +9 -3
  54. package/dist/packages/forms/src/combobox.d.ts +31 -41
  55. package/dist/packages/forms/src/dates/event-month.d.ts +17 -0
  56. package/dist/packages/forms/src/dates/index.d.ts +2 -0
  57. package/dist/packages/forms/src/field-styles.d.ts +0 -19
  58. package/dist/packages/forms/src/form-controls.d.ts +26 -24
  59. package/dist/packages/forms/src/forms.d.ts +17 -14
  60. package/dist/packages/forms/src/select-control.d.ts +6 -4
  61. package/dist/packages/forms/src/select.d.ts +14 -18
  62. package/dist/packages/forms/src/selection-state.d.ts +11 -0
  63. package/dist/packages/forms/src/selection-styles.d.ts +3 -0
  64. package/dist/packages/forms/src/selection.d.ts +21 -19
  65. package/dist/packages/foundations/src/agent/index.d.ts +2 -0
  66. package/dist/packages/foundations/src/control-state.d.ts +2 -3
  67. package/dist/packages/foundations/src/control-styles.d.ts +19 -0
  68. package/dist/packages/foundations/src/csp/index.d.ts +1 -1
  69. package/dist/packages/foundations/src/csp/provider.d.ts +3 -0
  70. package/dist/packages/foundations/src/style-composition.d.ts +4 -1
  71. package/dist/packages/layout/src/app-shell.d.ts +12 -1
  72. package/dist/packages/layout/src/index.d.ts +1 -1
  73. package/dist/packages/layout/src/navigation-rail.d.ts +15 -2
  74. package/dist/packages/layout/src/resizable.d.ts +2 -2
  75. package/dist/packages/layout/src/sidebar.d.ts +4 -3
  76. package/dist/packages/navigation/src/tab-styles.d.ts +1 -1
  77. package/dist/packages/navigation/src/tabs.d.ts +12 -10
  78. package/dist/packages/overlays/src/alert-dialog.d.ts +19 -13
  79. package/dist/packages/overlays/src/dialog.d.ts +39 -24
  80. package/dist/packages/overlays/src/drawer.d.ts +16 -26
  81. package/dist/packages/overlays/src/menu.d.ts +37 -44
  82. package/dist/packages/overlays/src/overlay-root.d.ts +10 -0
  83. package/dist/packages/overlays/src/popover.d.ts +11 -20
  84. package/dist/packages/overlays/src/preview.d.ts +6 -13
  85. package/dist/packages/overlays/src/tooltip.d.ts +12 -15
  86. package/dist/{pierre-diff-CaPsfQRo.js → pierre-diff-DJ3oOfPX.js} +5 -5
  87. package/dist/{src-DPRmO-JY.js → src-CNV1ewzb.js} +379 -407
  88. package/dist/{src-CSWIG_op.js → src-CQQvXi7a.js} +58 -81
  89. package/dist/{src-DWjAoOyd.js → src-D2OHco8V.js} +42 -41
  90. package/dist/src-DfOAlAd2.js +750 -0
  91. package/dist/src-na2DdkKI.js +561 -0
  92. package/dist/{src-C-Sx37kz.js → src-s3tWwnN4.js} +361 -518
  93. package/dist/styles.js +3 -0
  94. package/dist/{elements.css → styles2.css} +195 -97
  95. package/dist/tokens.js +3 -1
  96. package/dist/{tokens.stylex-CJbIDPB9.js → tokens.stylex-dF5CACEJ.js} +13 -93
  97. package/package.json +8 -9
  98. package/skills/elements-workspace/SKILL.md +12 -0
  99. package/dist/accessibility-C-aIZ1Yx.js +0 -15
  100. package/dist/chart-navigation-CBIeNtJq.js +0 -67
  101. package/dist/code-block-aC0Htt4N.js +0 -184
  102. package/dist/forms-BQQFas9g.js +0 -118
  103. package/dist/foundations.css +0 -7
  104. package/dist/packages/content/src/tree/pierre-tree.d.ts +0 -3
  105. package/dist/pierre-theme-BpNaWn1x.js +0 -126
  106. package/dist/pierre-tree-CYCRjdGG.js +0 -106
  107. package/dist/src-d7EAi61b.js +0 -617
  108. package/dist/src-nkgFDl-g.js +0 -1171
  109. package/dist/style-composition-uYlczSsB.js +0 -9
  110. package/styles.css +0 -2
@@ -1,21 +1,24 @@
1
- import { T as e, _ as t, c as n, i as r, p as i, w as a } from "./src-C-Sx37kz.js";
2
- import { r as o } from "./src-DPRmO-JY.js";
1
+ import { T as e, _ as t, c as n, i as r, p as i, w as a } from "./src-s3tWwnN4.js";
2
+ import { r as o } from "./src-CNV1ewzb.js";
3
3
  import { t as s } from "./header-styles-COxCYFZx.js";
4
- import { i as c, r as l, t as u } from "./src-d7EAi61b.js";
5
- import { f as d } from "./src-nkgFDl-g.js";
6
- import { t as f } from "./accessibility-C-aIZ1Yx.js";
7
- import { p, x as m } from "./tokens.stylex-CJbIDPB9.js";
8
- import { t as h } from "./use-scroll-tab-index-Dxpdh4W7.js";
9
- import { n as g } from "./forms-BQQFas9g.js";
10
- import { mergeProps as _ } from "@base-ui/react/merge-props";
11
- import * as v from "@stylexjs/stylex";
12
- import { Children as y, Fragment as ee, useEffect as b, useLayoutEffect as x, useMemo as S, useRef as C, useState as w, useSyncExternalStore as T } from "react";
13
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
14
- import { ArrowDown as k, ArrowUp as te, ArrowUpDown as ne, ChevronLeft as A, ChevronRight as j, CircleDashed as re, ListFilter as M, Search as N, Settings2 as P, X as ie } from "lucide-react";
15
- import { createColumnHelper as ae, tableFeatures as oe, useTable as se } from "@tanstack/react-table";
16
- import { defaultRangeExtractor as ce, useVirtualizer as le } from "@tanstack/react-virtual";
4
+ import { i as c, r as l, t as u } from "./src-na2DdkKI.js";
5
+ import { f as d } from "./src-DfOAlAd2.js";
6
+ import { t as f } from "./accessibility-P89UG9-r.js";
7
+ import { l as ee, t as p } from "./constants.stylex-BILvnwUk.js";
8
+ import { t as m } from "./use-scroll-tab-index-Dxpdh4W7.js";
9
+ import { n as h } from "./forms-I-WMHTkr.js";
10
+ import * as g from "@stylexjs/stylex";
11
+ import { Button as _ } from "@ui-sdk/react/button";
12
+ import { createParts as v, mergeProps as y } from "@ui-sdk/react/primitive";
13
+ import { Children as b, Fragment as x, createContext as S, useContext as C, useEffect as w, useLayoutEffect as te, useMemo as ne, useRef as T, useState as E, useSyncExternalStore as re } from "react";
14
+ import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
15
+ import { ArrowDown as ie, ArrowUp as ae, ArrowUpDown as oe, ChevronLeft as A, ChevronRight as j, CircleDashed as M, ListFilter as N, Search as se, Settings2 as ce, X as P } from "lucide-react";
16
+ import { useShortcut as F } from "@ui-sdk/react/shortcuts";
17
+ import { createColumnHelper as le, tableFeatures as ue, useTable as de } from "@tanstack/react-table";
18
+ import { defaultRangeExtractor as fe, useVirtualizer as pe } from "@tanstack/react-virtual";
19
+ import { definePrimitive as me } from "@ui-sdk/core";
17
20
  // packages/collections/src/collection-controls.tsx
18
- var F = {
21
+ var I = {
19
22
  toolbar: {
20
23
  kOIVth: "x1hnptsi",
21
24
  kMwMTN: "xbixft",
@@ -30,35 +33,35 @@ var F = {
30
33
  $$css: !0
31
34
  }
32
35
  };
33
- function I({ label: e, children: t, actions: n }) {
34
- let r = y.toArray(t).length > 0, i = y.toArray(n).length > 0;
35
- return !r && !i ? null : /* @__PURE__ */ O("div", {
36
+ function L({ label: e, children: t, actions: n }) {
37
+ let r = b.toArray(t).length > 0, i = b.toArray(n).length > 0;
38
+ return !r && !i ? null : /* @__PURE__ */ k("div", {
36
39
  role: "group",
37
40
  "aria-label": e,
38
- ...v.props(s.row, s.blockEnd, F.toolbar),
39
- children: [t, i && /* @__PURE__ */ D("div", {
41
+ ...g.props(s.row, s.blockEnd, I.toolbar),
42
+ children: [t, i && /* @__PURE__ */ O("div", {
40
43
  className: "x78zum5 x6s0dn4 x1a02dak x1hnptsi xeuugli xvc5jky",
41
44
  children: n
42
45
  })]
43
46
  });
44
47
  }
45
- function L({ filters: t, onRemove: n, label: r = "Applied filters" }) {
46
- return t.length === 0 ? null : /* @__PURE__ */ D("div", {
48
+ function he({ filters: t, onRemove: n, label: r = "Applied filters" }) {
49
+ return t.length === 0 ? null : /* @__PURE__ */ O("div", {
47
50
  role: "group",
48
51
  "aria-label": r,
49
52
  className: "x78zum5 x6s0dn4 x1a02dak x1hnptsi xeuugli",
50
- children: t.map((t) => /* @__PURE__ */ O("span", {
53
+ children: t.map((t) => /* @__PURE__ */ k("span", {
51
54
  className: "x1n2onr6 x9f619 x3nfvp2 x6s0dn4 xunmzkg x1f9pz31 x992rv9 xyibt8p x1ok0vyi xeuugli x193iq5w xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt x1s928wv x1j6awrg xarstr8 x5hscyn x86avzo x10z0kkz x1k48kgn x2q1x1w",
52
- children: [/* @__PURE__ */ D("span", {
55
+ children: [/* @__PURE__ */ O("span", {
53
56
  title: t.label,
54
57
  className: "xeuugli xb3r6kr xlyipyv xuxw1ft",
55
58
  children: t.label
56
- }), /* @__PURE__ */ D(e, {
59
+ }), /* @__PURE__ */ O(e, {
57
60
  "aria-label": `Remove ${t.label}`,
58
61
  variant: "ghost",
59
62
  onClick: () => n(t.id),
60
- xstyle: F.remove,
61
- children: /* @__PURE__ */ D(ie, {
63
+ xstyle: I.remove,
64
+ children: /* @__PURE__ */ O(P, {
62
65
  size: 14,
63
66
  "aria-hidden": "true"
64
67
  })
@@ -66,56 +69,56 @@ function L({ filters: t, onRemove: n, label: r = "Applied filters" }) {
66
69
  }, t.id))
67
70
  });
68
71
  }
69
- function ue({ options: t, onChange: n, onReset: r, label: i = "Display options" }) {
70
- return /* @__PURE__ */ O(l.Root, { children: [/* @__PURE__ */ D(l.Trigger, {
71
- render: /* @__PURE__ */ D(e, {
72
+ function R({ options: t, onChange: n, onReset: r, label: i = "Display options" }) {
73
+ return /* @__PURE__ */ k(l.Root, { children: [/* @__PURE__ */ O(l.Trigger, {
74
+ render: /* @__PURE__ */ O(e, {
72
75
  "aria-label": i,
73
76
  title: i
74
77
  }),
75
- children: /* @__PURE__ */ D(P, {
78
+ children: /* @__PURE__ */ O(ce, {
76
79
  size: 14,
77
80
  "aria-hidden": "true"
78
81
  })
79
- }), /* @__PURE__ */ D(l.Portal, { children: /* @__PURE__ */ D(l.Positioner, {
82
+ }), /* @__PURE__ */ k(l.Popup, {
80
83
  align: "end",
81
- children: /* @__PURE__ */ O(l.Popup, { children: [/* @__PURE__ */ D(l.Title, { children: "Display" }), /* @__PURE__ */ O("div", {
84
+ children: [/* @__PURE__ */ O(l.Title, { children: "Display" }), /* @__PURE__ */ k("div", {
82
85
  className: "xrvj5dj x1n8ia3y xfb3i0g",
83
- children: [t.map((e) => /* @__PURE__ */ O("label", {
86
+ children: [t.map((e) => /* @__PURE__ */ k("label", {
84
87
  className: "x78zum5 x6s0dn4 x1hnptsi xbixft xtqrqnz x1hz01jw x1778rvt xeuugli xj0a0fe",
85
- children: [/* @__PURE__ */ D(o.Root, {
88
+ children: [/* @__PURE__ */ O(o.Root, {
86
89
  checked: e.isChecked,
87
90
  onCheckedChange: (t) => n(e.id, t),
88
- disabled: e.isRequired,
89
- children: /* @__PURE__ */ D(o.Indicator, {})
91
+ disabled: e.isRequired === !0,
92
+ children: /* @__PURE__ */ O(o.Indicator, {})
90
93
  }), e.label]
91
- }, e.id)), r !== void 0 && /* @__PURE__ */ D(a, {
94
+ }, e.id)), r !== void 0 && /* @__PURE__ */ O(a, {
92
95
  type: "button",
93
96
  variant: "ghost",
94
97
  onClick: r,
95
98
  children: "Reset defaults"
96
99
  })]
97
- })] })
98
- }) })] });
100
+ })]
101
+ })] });
99
102
  }
100
- function de({ description: e, previous: t, next: r }) {
101
- return /* @__PURE__ */ O("nav", {
103
+ function z({ description: e, previous: t, next: r }) {
104
+ return /* @__PURE__ */ k("nav", {
102
105
  "aria-label": "Pagination",
103
106
  className: "x78zum5 x6s0dn4 x1qughib x1a02dak xaml1ju xeuugli",
104
- children: [/* @__PURE__ */ D(n, { children: e }), /* @__PURE__ */ O("div", {
107
+ children: [/* @__PURE__ */ O(n, { children: e }), /* @__PURE__ */ k("div", {
105
108
  className: "x78zum5 x6s0dn4 x1a02dak x1hnptsi xeuugli xvc5jky",
106
- children: [/* @__PURE__ */ O(a, {
109
+ children: [/* @__PURE__ */ k(a, {
107
110
  variant: "outline",
108
111
  disabled: t.disabled,
109
112
  onClick: t.onClick,
110
- children: [/* @__PURE__ */ D(A, {
113
+ children: [/* @__PURE__ */ O(A, {
111
114
  size: 16,
112
115
  "aria-hidden": "true"
113
116
  }), "Previous"]
114
- }), /* @__PURE__ */ O(a, {
117
+ }), /* @__PURE__ */ k(a, {
115
118
  variant: "outline",
116
119
  disabled: r.disabled,
117
120
  onClick: r.onClick,
118
- children: ["Next", /* @__PURE__ */ D(j, {
121
+ children: ["Next", /* @__PURE__ */ O(j, {
119
122
  size: 16,
120
123
  "aria-hidden": "true"
121
124
  })]
@@ -123,9 +126,422 @@ function de({ description: e, previous: t, next: r }) {
123
126
  })]
124
127
  });
125
128
  }
129
+ // packages/collections/src/table-query.tsx
130
+ var B = S(void 0);
131
+ function V(e) {
132
+ if (e.reason.trim().length === 0) throw Error("A table query exception requires a reason.");
133
+ }
134
+ function H({ search: e, filters: t, children: n, isFiltered: r = !1 }) {
135
+ return e === void 0 ? /* @__PURE__ */ O(B, {
136
+ value: void 0,
137
+ children: n
138
+ }) : (e !== !0 && V(e), t !== !0 && V(t), /* @__PURE__ */ O(B, {
139
+ value: r,
140
+ children: n
141
+ }));
142
+ }
143
+ function U(e) {
144
+ if ("reason" in e) V(e);
145
+ else {
146
+ if (e.length === 0) throw Error("Supply filter dimensions or explain why the table has none.");
147
+ if (new Set(e.map((e) => e.id)).size !== e.length) throw Error("Each table filter must have a unique ID.");
148
+ }
149
+ }
150
+ var W = [];
151
+ function G(e, t) {
152
+ let [n, r] = E(""), [i, a] = E(/* @__PURE__ */ new Map()), o = typeof t.search == "function" ? t.search : void 0;
153
+ typeof t.search != "function" && V(t.search), U(t.filters);
154
+ let s = "reason" in t.filters ? W : t.filters, c = o === void 0 ? void 0 : {
155
+ value: n,
156
+ onChange: r
157
+ }, l = n.trim().toLowerCase(), u = ne(() => s.map((t) => {
158
+ let n = new Set(e.map(t.value)), r = i.get(t.id);
159
+ r !== void 0 && n.add(r);
160
+ let o = Array.from(n, (e) => ({
161
+ value: `value:${e}`,
162
+ label: t.formatLabel?.(e) ?? (e === "" ? "Unspecified" : e)
163
+ }));
164
+ return {
165
+ id: t.id,
166
+ label: t.label,
167
+ options: [{
168
+ value: "",
169
+ label: "All"
170
+ }, ...o],
171
+ defaultValue: "",
172
+ value: r === void 0 ? "" : `value:${r}`,
173
+ onChange(e) {
174
+ a((n) => {
175
+ let r = new Map(n);
176
+ return e === "" ? r.delete(t.id) : r.set(t.id, e.slice(6)), r;
177
+ });
178
+ }
179
+ };
180
+ }), [
181
+ s,
182
+ i,
183
+ e
184
+ ]), d = l !== "" && o !== void 0, f = u.some((e) => e.value !== e.defaultValue);
185
+ return {
186
+ rows: d || f ? e.filter((e) => d && !o(e).toLowerCase().includes(l) ? !1 : s.every((t) => !i.has(t.id) || t.value(e) === i.get(t.id))) : e,
187
+ search: c,
188
+ filters: u,
189
+ isFiltered: d || f
190
+ };
191
+ }
192
+ function ge() {
193
+ let e = C(B);
194
+ if (e === void 0) throw Error("A frame-owned table requires its enclosing collection to supply TableQueryFrame.");
195
+ return e;
196
+ }
197
+ function _e(e) {
198
+ "reason" in e.search && V(e.search), U(e.filters);
199
+ let t = "reason" in e.search ? void 0 : e.search, n = "reason" in e.filters ? [] : e.filters;
200
+ return {
201
+ search: t,
202
+ filters: n,
203
+ isFiltered: !!t?.value.trim() || n.some((e) => e.value !== e.defaultValue)
204
+ };
205
+ }
206
+ // packages/collections/src/collection-filters.tsx
207
+ var K = {
208
+ search: {
209
+ kzqmXN: "xh8yej3",
210
+ k1K539: "x1kk91vl",
211
+ $$css: !0
212
+ },
213
+ icon: {
214
+ k1xSpc: "x78zum5",
215
+ kMwMTN: "x153jb6y",
216
+ $$css: !0
217
+ },
218
+ positive: {
219
+ kMwMTN: "x7ixh4y",
220
+ $$css: !0
221
+ },
222
+ warning: {
223
+ kMwMTN: "x1f9ixgr",
224
+ $$css: !0
225
+ },
226
+ negative: {
227
+ kMwMTN: "xr5kp14",
228
+ $$css: !0
229
+ }
230
+ }, ve = {
231
+ positive: K.positive,
232
+ negative: K.negative,
233
+ warning: K.warning,
234
+ neutral: void 0
235
+ }, ye = /* @__PURE__ */ new Set([
236
+ "Home",
237
+ "End",
238
+ "ArrowLeft",
239
+ "ArrowRight",
240
+ "Backspace",
241
+ "Delete"
242
+ ]);
243
+ function q({ option: e }) {
244
+ return /* @__PURE__ */ O("span", {
245
+ ...g.props(K.icon, ve[e.tone ?? "neutral"]),
246
+ children: e.icon ?? /* @__PURE__ */ O(M, {
247
+ size: 14,
248
+ "aria-hidden": !0
249
+ })
250
+ });
251
+ }
252
+ function J({ groups: t }) {
253
+ let [n, i] = E(""), a = t.filter((e) => e.label.toLowerCase().includes(n.toLowerCase())), o = t.length === 1 && t[0] !== void 0 ? `Filter by ${t[0].label.toLowerCase()}` : "Filters";
254
+ return /* @__PURE__ */ k(c.Root, {
255
+ onOpenChange: (e) => {
256
+ e || i("");
257
+ },
258
+ children: [/* @__PURE__ */ O(c.Trigger, {
259
+ render: /* @__PURE__ */ O(e, {
260
+ "aria-label": o,
261
+ title: "Filters"
262
+ }),
263
+ children: /* @__PURE__ */ O(N, {
264
+ size: 14,
265
+ "aria-hidden": !0
266
+ })
267
+ }), /* @__PURE__ */ k(c.Popup, {
268
+ align: "end",
269
+ children: [
270
+ /* @__PURE__ */ O(Y, {
271
+ label: "Find a filter",
272
+ value: n,
273
+ onChange: i
274
+ }),
275
+ a.map((e) => /* @__PURE__ */ O(X, { group: e }, e.id)),
276
+ a.length === 0 && /* @__PURE__ */ O("div", {
277
+ className: "x1hmw7ec x5g2kb4",
278
+ children: /* @__PURE__ */ O(r, { children: "No filters found" })
279
+ })
280
+ ]
281
+ })]
282
+ });
283
+ }
284
+ function Y({ label: e, value: t, onChange: n }) {
285
+ return /* @__PURE__ */ O(h, {
286
+ type: "search",
287
+ "aria-label": e,
288
+ placeholder: "Filter…",
289
+ autoFocus: !0,
290
+ value: t,
291
+ onValueChange: n,
292
+ onKeyDown: (e) => {
293
+ (e.key.length === 1 || ye.has(e.key)) && e.stopPropagation();
294
+ },
295
+ xstyle: K.search
296
+ });
297
+ }
298
+ function X({ group: e }) {
299
+ let [t, n] = E(""), i = e.options.filter((e) => e.label.toLowerCase().includes(t.toLowerCase()));
300
+ return /* @__PURE__ */ k(c.SubmenuRoot, {
301
+ onOpenChange: (e) => {
302
+ e || n("");
303
+ },
304
+ children: [/* @__PURE__ */ k(c.SubmenuTrigger, { children: [
305
+ e.icon ?? /* @__PURE__ */ O(N, {
306
+ size: 14,
307
+ "aria-hidden": !0
308
+ }),
309
+ /* @__PURE__ */ O("span", {
310
+ className: "x98rzlu xeuugli xj0a0fe",
311
+ children: e.label
312
+ }),
313
+ /* @__PURE__ */ O("span", {
314
+ className: "xazcve0 xb3r6kr xuxw1ft xlyipyv x153jb6y xy8obcc xas2l8k",
315
+ children: e.options.find((t) => t.value === e.value)?.label
316
+ }),
317
+ /* @__PURE__ */ O(j, {
318
+ size: 14,
319
+ "aria-hidden": !0
320
+ })
321
+ ] }), /* @__PURE__ */ k(c.Popup, {
322
+ align: "start",
323
+ "aria-label": e.label,
324
+ children: [
325
+ /* @__PURE__ */ O(Y, {
326
+ label: `Find ${e.label.toLowerCase()}`,
327
+ value: t,
328
+ onChange: n
329
+ }),
330
+ /* @__PURE__ */ O(c.RadioGroup, {
331
+ value: e.value,
332
+ onValueChange: e.onChange,
333
+ children: i.map((e) => /* @__PURE__ */ k(c.RadioItem, {
334
+ value: e.value,
335
+ closeOnSelect: !0,
336
+ children: [/* @__PURE__ */ O(q, { option: e }), /* @__PURE__ */ O("span", {
337
+ className: "x98rzlu xeuugli xj0a0fe",
338
+ children: e.label
339
+ })]
340
+ }, e.value))
341
+ }),
342
+ i.length === 0 && /* @__PURE__ */ O("div", {
343
+ className: "x1hmw7ec x5g2kb4",
344
+ children: /* @__PURE__ */ O(r, { children: "No options found" })
345
+ })
346
+ ]
347
+ })]
348
+ });
349
+ }
350
+ // packages/collections/src/query-controls.tsx
351
+ function be(e) {
352
+ return {
353
+ value: e.search?.value ?? "",
354
+ filters: e.selections,
355
+ disabled: e.isDisabled,
356
+ available: e.search !== void 0 || e.groups.length > 0
357
+ };
358
+ }
359
+ function xe(e) {
360
+ let t = JSON.parse(e);
361
+ if (Array.isArray(t) && t.length === 2) {
362
+ let e = t[0], n = t[1];
363
+ if (typeof e == "string" && typeof n == "string") return [e, n];
364
+ }
365
+ throw Error("Select a listed filter option, or provide a filter ID and value.");
366
+ }
367
+ var Se = me({
368
+ name: "collection-query",
369
+ options: {
370
+ search: "value",
371
+ groups: "list",
372
+ selections: "value",
373
+ isDisabled: "boolean"
374
+ },
375
+ state: be,
376
+ sync: be,
377
+ controlled: ["value", "filters"],
378
+ api: ({ options: e }) => ({
379
+ get setQuery() {
380
+ let { search: t, isDisabled: n } = e();
381
+ return n || t === void 0 ? null : (e) => {
382
+ if (typeof e != "string") throw TypeError("The search term must be a string.");
383
+ t.onChange(e);
384
+ };
385
+ },
386
+ get submitSearch() {
387
+ let { search: t, isDisabled: n } = e();
388
+ return n ? void 0 : t?.onSubmit;
389
+ },
390
+ get setFilter() {
391
+ let { groups: t, isDisabled: n } = e();
392
+ return n || t.length === 0 ? null : (e, n) => {
393
+ let [r, i] = n === void 0 ? xe(e) : [e, n], a = t.find((e) => e.id === r);
394
+ if (a === void 0 || !a.options.some((e) => e.value === i)) throw Error("Unknown filter or option. Choose one of the listed filter options.");
395
+ a.onChange(i);
396
+ };
397
+ },
398
+ items() {
399
+ return e().groups.flatMap((e) => e.options.map((t) => ({
400
+ value: JSON.stringify([e.id, t.value]),
401
+ label: `${e.label} · ${t.label}`
402
+ })));
403
+ }
404
+ }),
405
+ agent: {
406
+ actions: [
407
+ "setQuery",
408
+ "submitSearch",
409
+ "setFilter"
410
+ ],
411
+ items: (e) => e.items(),
412
+ shown: (e) => e.available && !e.disabled
413
+ },
414
+ slots: (e) => ({ root: e({ attrs: () => ({ role: "group" }) }) })
415
+ }), Ce = v(Se, { root: "div" }).Root, we = { input: {
416
+ k7Eaqz: "xeuugli",
417
+ kUk6DE: "x98rzlu",
418
+ $$css: !0
419
+ } };
420
+ function Te({ label: t = "Collection controls", search: n, filters: r = [], filterContent: i, chips: a = [], viewActions: o, display: s, isPlaceholder: c = !1, isReady: u }) {
421
+ let [d, f] = E(!1), [ee, p] = E(!1), m = T(null), g = T(null), _ = T(null), v = ne(() => Object.fromEntries(r.map((e) => [e.id, e.value])), [r]), y = c || !u, x = n !== void 0 && (d || n.value.length > 0);
422
+ te(() => {
423
+ d && !c && u && (_.current?.focus(), _.current?.select());
424
+ }, [
425
+ d,
426
+ c,
427
+ u
428
+ ]);
429
+ function S() {
430
+ (m.current ?? g.current?.querySelector("button"))?.focus();
431
+ }
432
+ function C() {
433
+ n !== void 0 && !c && u && (_.current?.focus(), _.current?.select(), f(!0));
434
+ }
435
+ function w() {
436
+ n?.onChange(""), f(!1), S();
437
+ }
438
+ function re(e) {
439
+ x && !e.defaultPrevented && e.key === "Escape" && e.target instanceof Element && e.target.closest("[role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"], [role=\"listbox\"], [data-native-find], input:not([data-view-find]), textarea, select") === null && (e.preventDefault(), e.stopPropagation(), w());
440
+ }
441
+ let D = r.filter((e) => e.value !== e.defaultValue).map((e) => ({
442
+ id: `filter:${e.id}`,
443
+ label: e.options.find((t) => t.value === e.value)?.label ?? e.value,
444
+ onRemove: () => e.onChange(e.defaultValue)
445
+ }));
446
+ for (let e of a) D.push({
447
+ ...e,
448
+ id: `chip:${e.id}`
449
+ });
450
+ let ie = i !== void 0 || r.length > 0, ae = b.toArray([o, s]).length > 0, oe = n !== void 0 || ie || ae, A = n?.label ?? "Search this view", j = n?.placeholder ?? "Find in view…";
451
+ return {
452
+ openSearch: C,
453
+ onKeyDown: re,
454
+ actions: oe ? /* @__PURE__ */ k(Ce, {
455
+ search: n,
456
+ groups: r,
457
+ selections: v,
458
+ isDisabled: y,
459
+ ref: g,
460
+ "aria-label": t,
461
+ "aria-hidden": y,
462
+ inert: y,
463
+ className: "x78zum5 x6s0dn4 x1a02dak x13a6bvl x1hnptsi xeuugli x193iq5w",
464
+ children: [
465
+ n !== void 0 && /* @__PURE__ */ O(e, {
466
+ ref: m,
467
+ type: "button",
468
+ disabled: c,
469
+ "aria-label": "Find in view",
470
+ title: "Find in view",
471
+ "data-view-find-trigger": !0,
472
+ "aria-expanded": x,
473
+ onClick: C,
474
+ children: /* @__PURE__ */ O(se, {
475
+ size: 14,
476
+ "aria-hidden": !0
477
+ })
478
+ }),
479
+ x && /* @__PURE__ */ k("div", {
480
+ className: "x78zum5 x6s0dn4 xunmzkg xdl07me x193iq5w",
481
+ children: [/* @__PURE__ */ O(h, {
482
+ ref: _,
483
+ type: "search",
484
+ disabled: c,
485
+ "data-view-find": !0,
486
+ "aria-label": A,
487
+ placeholder: j,
488
+ value: n.value,
489
+ onValueChange: n.onChange,
490
+ onKeyDown: (e) => {
491
+ e.key === "Enter" && n.onSubmit !== void 0 && (e.preventDefault(), n.onSubmit()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), w());
492
+ },
493
+ xstyle: we.input
494
+ }), /* @__PURE__ */ O(e, {
495
+ type: "button",
496
+ variant: "ghost",
497
+ "data-view-find-close": !0,
498
+ "aria-label": "Close search",
499
+ title: "Close search (Esc)",
500
+ onClick: w,
501
+ children: /* @__PURE__ */ O(P, {
502
+ size: 14,
503
+ "aria-hidden": !0
504
+ })
505
+ })]
506
+ }),
507
+ i === void 0 ? r.length > 0 ? /* @__PURE__ */ O(J, { groups: r }) : null : /* @__PURE__ */ k(l.Root, {
508
+ open: ee,
509
+ onOpenChange: p,
510
+ children: [/* @__PURE__ */ O(l.Trigger, {
511
+ render: /* @__PURE__ */ O(e, {
512
+ "aria-label": "Filters",
513
+ title: "Filters"
514
+ }),
515
+ children: /* @__PURE__ */ O(N, {
516
+ size: 14,
517
+ "aria-hidden": !0
518
+ })
519
+ }), /* @__PURE__ */ k(l.Popup, {
520
+ align: "end",
521
+ className: "x1m258z3 xw7nakj",
522
+ children: [/* @__PURE__ */ O(l.Title, { children: "Filters" }), i(() => p(!1))]
523
+ })]
524
+ }),
525
+ o,
526
+ s
527
+ ]
528
+ }) : void 0,
529
+ chips: D.length > 0 && /* @__PURE__ */ O("div", {
530
+ "aria-hidden": y,
531
+ inert: y,
532
+ className: "xjp7ctv",
533
+ children: /* @__PURE__ */ O(he, {
534
+ filters: D,
535
+ onRemove: (e) => {
536
+ S(), D.find((t) => t.id === e)?.onRemove();
537
+ }
538
+ })
539
+ })
540
+ };
541
+ }
126
542
  // packages/collections/src/use-end-reached.ts
127
- function fe({ end: e, viewport: t, onEndReached: n, content: r }) {
128
- b(() => {
543
+ function Ee({ end: e, viewport: t, onEndReached: n, content: r }) {
544
+ w(() => {
129
545
  if (n === void 0 || e.current === null) return;
130
546
  let r = new IntersectionObserver((e) => {
131
547
  e.some((e) => e.isIntersecting) && n();
@@ -139,11 +555,11 @@ function fe({ end: e, viewport: t, onEndReached: n, content: r }) {
139
555
  ]);
140
556
  }
141
557
  // packages/collections/src/data-table.tsx
142
- var pe = oe({}), me = 76, R = p.compactTable.slice(7), he = /* @__PURE__ */ new Map([["ArrowUp", -1], ["ArrowDown", 1]]), z = {
558
+ var De = ue({}), Oe = 76, ke = p.compactTable.slice(7), Ae = /* @__PURE__ */ new Map([["ArrowUp", -1], ["ArrowDown", 1]]), je = {
143
559
  kmVPX3: "x1717udv",
144
560
  kMzoRj: "xc342km",
145
561
  $$css: !0
146
- }, B = {
562
+ }, Z = {
147
563
  frame: {
148
564
  k7Eaqz: "xeuugli",
149
565
  kMv6JI: "x1hz01jw",
@@ -267,14 +683,14 @@ var pe = oe({}), me = 76, R = p.compactTable.slice(7), he = /* @__PURE__ */ new
267
683
  $$css: !0
268
684
  },
269
685
  spacer: (e) => [
270
- z,
686
+ je,
271
687
  {
272
688
  kZKoxP: e == null ? e : "x16ye13r",
273
689
  $$css: !0
274
690
  },
275
691
  { "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
276
692
  ]
277
- }, V = {
693
+ }, Q = {
278
694
  primary: {
279
695
  minimumWidth: 240,
280
696
  isFlexible: !0,
@@ -305,58 +721,58 @@ var pe = oe({}), me = 76, R = p.compactTable.slice(7), he = /* @__PURE__ */ new
305
721
  isFlexible: !1,
306
722
  shouldTruncate: !1
307
723
  }
308
- }, ge = {
309
- fixed: B.content,
310
- content: B.contentCell
311
- }, _e = {
312
- primary: B.start,
313
- text: B.start,
314
- status: B.start,
315
- number: B.end,
316
- timestamp: B.end,
317
- actions: B.end
318
- }, ve = {
319
- content: B.content,
320
- fill: B.fillFrame
321
- }, ye = {
322
- content: B.content,
323
- fill: B.fillViewport
724
+ }, Me = {
725
+ fixed: Z.content,
726
+ content: Z.contentCell
727
+ }, Ne = {
728
+ primary: Z.start,
729
+ text: Z.start,
730
+ status: Z.start,
731
+ number: Z.end,
732
+ timestamp: Z.end,
733
+ actions: Z.end
734
+ }, Pe = {
735
+ content: Z.content,
736
+ fill: Z.fillFrame
737
+ }, Fe = {
738
+ content: Z.content,
739
+ fill: Z.fillViewport
324
740
  };
325
- function be(e) {
741
+ function Ie(e) {
326
742
  return e.map((e) => {
327
- let t = V[e.role], n = e.width ?? (t.isFlexible ? void 0 : t.minimumWidth);
743
+ let t = Q[e.role], n = e.width ?? (t.isFlexible ? void 0 : t.minimumWidth);
328
744
  return {
329
745
  ...e,
330
746
  ...n === void 0 ? {} : { width: n }
331
747
  };
332
748
  });
333
749
  }
334
- function xe(e, t = 0) {
750
+ function Le(e, t = 0) {
335
751
  return {
336
- minimumWidth: e.reduce((e, t) => e + (t.width ?? V[t.role].minimumWidth), t),
337
- compactWidth: e.filter((e) => e.isSecondary !== !0).reduce((e, t) => e + (t.width ?? V[t.role].minimumWidth), t)
752
+ minimumWidth: e.reduce((e, t) => e + (t.width ?? Q[t.role].minimumWidth), t),
753
+ compactWidth: e.filter((e) => e.isSecondary !== !0).reduce((e, t) => e + (t.width ?? Q[t.role].minimumWidth), t)
338
754
  };
339
755
  }
340
- function Se(e) {
341
- let t = globalThis.matchMedia(R);
756
+ function Re(e) {
757
+ let t = globalThis.matchMedia(ke);
342
758
  return t.addEventListener("change", e), () => t.removeEventListener("change", e);
343
759
  }
344
- function Ce() {
345
- return globalThis.matchMedia(R).matches;
760
+ function ze() {
761
+ return globalThis.matchMedia(ke).matches;
346
762
  }
347
- function we({ columns: e, canSelect: t = !1 }) {
348
- return /* @__PURE__ */ O("colgroup", { children: [t && /* @__PURE__ */ D("col", { className: "x1d7z9mz xeuugli x1dc62k6" }), e.map((e) => /* @__PURE__ */ D("col", { ...v.props(e.width !== void 0 && B.width(e.width), e.isSecondary === !0 && B.secondary) }, e.id))] });
763
+ function Be({ columns: e, canSelect: t = !1 }) {
764
+ return /* @__PURE__ */ k("colgroup", { children: [t && /* @__PURE__ */ O("col", { className: "x1d7z9mz xeuugli x1dc62k6" }), e.map((e) => /* @__PURE__ */ O("col", { ...g.props(e.width !== void 0 && Z.width(e.width), e.isSecondary === !0 && Z.secondary) }, e.id))] });
349
765
  }
350
- function H({ columns: e, rows: t = 3, hideCaption: n = !0, ...r }) {
766
+ function Ve({ columns: e, rows: t = 3, hideCaption: n = !0, ...r }) {
351
767
  let i = typeof r.window?.height == "string" ? r.window.height : "content", a = Array.from({ length: t }, (e, t) => ({ id: String(t) })), o = e.map(({ placeholder: e, ...t }) => ({
352
768
  ...t,
353
- cell: () => e ?? /* @__PURE__ */ D(d, { width: "60%" })
769
+ cell: () => e ?? /* @__PURE__ */ O(d, { width: "60%" })
354
770
  }));
355
- return /* @__PURE__ */ D("div", {
771
+ return /* @__PURE__ */ O("div", {
356
772
  "aria-hidden": !0,
357
773
  inert: !0,
358
- ...v.props(ve[i], B.placeholder),
359
- children: /* @__PURE__ */ D(K, {
774
+ ...g.props(Pe[i], Z.placeholder),
775
+ children: /* @__PURE__ */ O(Ye, {
360
776
  ...r,
361
777
  hideCaption: n,
362
778
  rows: a,
@@ -366,220 +782,294 @@ function H({ columns: e, rows: t = 3, hideCaption: n = !0, ...r }) {
366
782
  })
367
783
  });
368
784
  }
369
- function U({ children: e, leading: t, isDecorative: n = !1 }) {
370
- let r = y.toArray(t).length > 0;
371
- return /* @__PURE__ */ O("span", {
785
+ function He({ children: e, leading: t, isDecorative: n = !1 }) {
786
+ let r = b.toArray(t).length > 0;
787
+ return /* @__PURE__ */ k("span", {
372
788
  "aria-hidden": n || void 0,
373
789
  inert: n || void 0,
374
790
  className: "x78zum5 x6s0dn4 x1n8ia3y xeuugli xh8yej3 x1hz01jw xtqrqnz x1778rvt xj57cvi",
375
- children: [r && /* @__PURE__ */ D("span", {
791
+ children: [r && /* @__PURE__ */ O("span", {
376
792
  "aria-hidden": !0,
377
793
  className: "x3nfvp2 x6s0dn4 x2lah0s",
378
794
  children: t
379
- }), /* @__PURE__ */ D("span", {
795
+ }), /* @__PURE__ */ O("span", {
380
796
  className: "x98rzlu xeuugli",
381
797
  children: e
382
798
  })]
383
799
  });
384
800
  }
385
- function W({ children: e, secondary: t, leading: n, trailing: r }) {
386
- let i = y.toArray(r).length > 0;
387
- return /* @__PURE__ */ O(U, {
801
+ function Ue({ children: e, secondary: t, leading: n, trailing: r }) {
802
+ let i = b.toArray(r).length > 0;
803
+ return /* @__PURE__ */ k(He, {
388
804
  leading: n,
389
- children: [/* @__PURE__ */ O("span", {
805
+ children: [/* @__PURE__ */ k("span", {
390
806
  className: "x78zum5 x6s0dn4 x1hnptsi xeuugli",
391
- children: [/* @__PURE__ */ D("span", {
807
+ children: [/* @__PURE__ */ O("span", {
392
808
  title: e,
393
809
  className: "x1lliihq xeuugli x14atkfc xs83m0k xb3r6kr xuxw1ft xlyipyv",
394
810
  children: e
395
- }), i && /* @__PURE__ */ D("span", {
811
+ }), i && /* @__PURE__ */ O("span", {
396
812
  className: "x3nfvp2 x6s0dn4 x2lah0s",
397
813
  children: r
398
814
  })]
399
- }), t !== void 0 && /* @__PURE__ */ D("span", {
815
+ }), t !== void 0 && /* @__PURE__ */ O("span", {
400
816
  title: t,
401
817
  className: "x1lliihq xeuugli xh8yej3 xb3r6kr xuxw1ft xlyipyv x153jb6y xy8obcc xas2l8k",
402
818
  children: t
403
819
  })]
404
820
  });
405
821
  }
406
- function G({ leading: e, isSecondary: t = !1 }) {
407
- return /* @__PURE__ */ O(U, {
822
+ function We({ leading: e, isSecondary: t = !1 }) {
823
+ return /* @__PURE__ */ k(He, {
408
824
  leading: e,
409
825
  isDecorative: !0,
410
- children: [/* @__PURE__ */ D("span", {
826
+ children: [/* @__PURE__ */ O("span", {
411
827
  className: "x1lliihq xeuugli xh8yej3",
412
- children: /* @__PURE__ */ D(d, { width: "70%" })
413
- }), t && /* @__PURE__ */ D("span", {
828
+ children: /* @__PURE__ */ O(d, { width: "70%" })
829
+ }), t && /* @__PURE__ */ O("span", {
414
830
  className: "x1lliihq xeuugli xh8yej3 x153jb6y xy8obcc xas2l8k",
415
- children: /* @__PURE__ */ D(d, { width: "45%" })
831
+ children: /* @__PURE__ */ O(d, { width: "45%" })
416
832
  })]
417
833
  });
418
834
  }
419
- function K({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: a, onSortChange: s, selectedIds: c, onSelectionChange: l, selectionLabel: u, rowAction: d, activeRowId: p, focusRowId: g, onRowHighlightChange: _, hideCaption: y = !1, hideHeaders: E = !1, rowSizing: A = "fixed", window: j, endContent: re, onEndReached: M, footer: N }) {
420
- let P = S(() => be(t), [t]), ie = T(Se, Ce, () => !1), oe = S(() => {
421
- let e = ae();
422
- return e.columns(P.map((t) => e.display({
835
+ function Ge({ query: e, ...t }) {
836
+ switch (e.mode) {
837
+ case "local":
838
+ if (t.onEndReached !== void 0) throw Error("Local table queries require all rows. Use a controlled or frame query for a paged source.");
839
+ return /* @__PURE__ */ O(qe, {
840
+ query: e,
841
+ table: t
842
+ });
843
+ case "controlled": return /* @__PURE__ */ O(Je, {
844
+ table: {
845
+ ...t,
846
+ filteredEmpty: t.filteredEmpty ?? t.empty
847
+ },
848
+ ..._e(e)
849
+ });
850
+ case "frame": return /* @__PURE__ */ O(Ke, { table: t });
851
+ case "static": return V(e), /* @__PURE__ */ O(H, { children: /* @__PURE__ */ O(Ye, { ...t }) });
852
+ }
853
+ }
854
+ function Ke({ table: e }) {
855
+ let t = ge();
856
+ return /* @__PURE__ */ O(H, { children: /* @__PURE__ */ O(Ye, {
857
+ ...e,
858
+ empty: t ? e.filteredEmpty ?? "No matching records." : e.empty
859
+ }) });
860
+ }
861
+ function qe({ query: e, table: t }) {
862
+ let { rows: n, search: r, filters: i, isFiltered: a } = G(t.rows, e);
863
+ return /* @__PURE__ */ O(Je, {
864
+ table: {
865
+ ...t,
866
+ rows: n
867
+ },
868
+ search: r,
869
+ filters: i,
870
+ isFiltered: a
871
+ });
872
+ }
873
+ function Je({ table: e, search: t, filters: n, isFiltered: r }) {
874
+ let i = Te({
875
+ ...t !== void 0 && { search: t },
876
+ filters: n,
877
+ isReady: !0,
878
+ label: e.caption
879
+ }), a = T(null), o = {
880
+ description: `Find in ${e.caption}`,
881
+ layer: a,
882
+ when: () => {
883
+ let e = a.current;
884
+ if (e === null) return !1;
885
+ let t = e.ownerDocument.activeElement;
886
+ return t === null || t.closest("[data-native-find], textarea, select, input:not([data-view-find]), [contenteditable=\"true\"], [role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"], [role=\"listbox\"]") !== null ? !1 : t.closest("[data-table-query]") === e || t === e.ownerDocument.body && e.ownerDocument.querySelectorAll("[data-view-find-trigger]").length === 1;
887
+ }
888
+ };
889
+ return F(t === void 0 ? null : "/", i.openSearch, o), F(t === void 0 ? null : "mod+f", i.openSearch, o), /* @__PURE__ */ O(H, { children: /* @__PURE__ */ k("div", {
890
+ ref: a,
891
+ "data-table-query": !0,
892
+ onKeyDown: i.onKeyDown,
893
+ ...g.props(Pe[typeof e.window?.height == "string" ? e.window.height : "content"]),
894
+ children: [(t !== void 0 || n.length > 0) && /* @__PURE__ */ O(L, {
895
+ label: `${e.caption} controls`,
896
+ actions: i.actions,
897
+ children: i.chips
898
+ }), /* @__PURE__ */ O(Ye, {
899
+ ...e,
900
+ empty: r ? e.filteredEmpty ?? "No matching records." : e.empty
901
+ })]
902
+ }) });
903
+ }
904
+ function Ye({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: a, onSortChange: s, selectedIds: c, onSelectionChange: l, selectionLabel: u, rowAction: d, activeRowId: p, focusRowId: h, onRowHighlightChange: v, hideCaption: y = !1, hideHeaders: b = !1, rowSizing: S = "fixed", window: C, endContent: D, onEndReached: A, footer: j }) {
905
+ let M = ne(() => Ie(t), [t]), N = re(Re, ze, () => !1), se = ne(() => {
906
+ let e = le();
907
+ return e.columns(M.map((t) => e.display({
423
908
  id: t.id,
424
909
  header: t.label
425
910
  })));
426
- }, [P]), F = se({
427
- features: pe,
428
- columns: oe,
911
+ }, [M]), ce = de({
912
+ features: De,
913
+ columns: se,
429
914
  data: e,
430
915
  getRowId: n
431
- }), I = h(), L = I.viewport, ue = C(null), de = C(null), R = C(null), [z, V] = w(0), [H, U] = w(), [W, G] = w(), K = C(void 0), q = C(void 0), J = C(void 0), Y = e.findIndex((e) => n(e) === H), De = P.findIndex((e) => e.role === "primary" && e.isSecondary !== !0), Oe = De === -1 ? P.findIndex((e) => e.isSecondary !== !0) : De, ke = typeof j?.height == "string" ? j.height : "content", Ae = new Set(e.map(n)), X = H !== void 0 && Ae.has(H) ? H : void 0;
432
- H !== void 0 && X === void 0 && U(void 0), fe({
916
+ }), P = m(), F = P.viewport, ue = T(null), me = T(null), I = T(null), [L, he] = E(0), [R, z] = E(), [B, V] = E(), H = T(void 0), U = T(void 0), W = T(void 0), G = e.findIndex((e) => n(e) === R), ge = M.findIndex((e) => e.role === "primary" && e.isSecondary !== !0), _e = ge === -1 ? M.findIndex((e) => e.isSecondary !== !0) : ge, K = typeof C?.height == "string" ? C.height : "content", ve = new Set(e.map(n)), ye = R !== void 0 && ve.has(R) ? R : void 0;
917
+ R !== void 0 && ye === void 0 && z(void 0), Ee({
433
918
  end: ue,
434
- onEndReached: j === void 0 ? M : void 0,
919
+ onEndReached: C === void 0 ? A : void 0,
435
920
  content: e.length
436
- }), b(() => {
437
- let e = de.current, t = R.current;
438
- if (j === void 0 || e === null || t === null) return;
439
- let n = new ResizeObserver(() => V(e.offsetHeight + t.offsetHeight));
921
+ }), w(() => {
922
+ let e = me.current, t = I.current;
923
+ if (C === void 0 || e === null || t === null) return;
924
+ let n = new ResizeObserver(() => he(e.offsetHeight + t.offsetHeight));
440
925
  return n.observe(e), n.observe(t), () => n.disconnect();
441
926
  }, [
442
- j,
927
+ C,
443
928
  y,
444
- E
929
+ b
445
930
  ]);
446
- let Z = le({
931
+ let q = pe({
447
932
  count: e.length,
448
- enabled: j !== void 0,
449
- getScrollElement: () => L.current,
933
+ enabled: C !== void 0,
934
+ getScrollElement: () => F.current,
450
935
  getItemKey: (t) => {
451
936
  let r = e[t];
452
937
  if (r === void 0) throw RangeError("The virtual row is outside the supplied table page.");
453
938
  return n(r);
454
939
  },
455
- estimateSize: () => A === "fixed" ? m.rowHeight : j?.estimatedRowHeight ?? m.rowHeight,
456
- scrollMargin: z,
457
- scrollPaddingStart: z,
940
+ estimateSize: () => S === "fixed" ? ee.rowHeight : C?.estimatedRowHeight ?? ee.rowHeight,
941
+ scrollMargin: L,
942
+ scrollPaddingStart: L,
458
943
  overscan: 6,
459
944
  rangeExtractor: (t) => {
460
- let n = ce(t);
461
- return Y === -1 ? n : [.../* @__PURE__ */ new Set([
945
+ let n = fe(t);
946
+ if (G === -1) return n;
947
+ let r = [
948
+ G - 1,
949
+ G,
950
+ G + 1
951
+ ].filter((t) => t >= 0 && t < e.length), i = n[0] ?? 0, a = n.at(-1) ?? -1;
952
+ return [
953
+ ...r.filter((e) => e < i),
462
954
  ...n,
463
- Y - 1,
464
- Y,
465
- Y + 1
466
- ])].filter((t) => t >= 0 && t < e.length).toSorted((e, t) => e - t);
955
+ ...r.filter((e) => e > a)
956
+ ];
467
957
  }
468
- }), je = j === void 0 ? F.getRowModel().rows.map((e, t) => ({
958
+ }), J = C === void 0 ? ce.getRowModel().rows.map((e, t) => ({
469
959
  row: e,
470
960
  index: t,
471
961
  spacerHeight: 0
472
- })) : Z.getVirtualItems().flatMap((e, t, n) => {
473
- let r = F.getRowModel().rows[e.index];
962
+ })) : q.getVirtualItems().flatMap((e, t, n) => {
963
+ let r = ce.getRowModel().rows[e.index];
474
964
  return r === void 0 ? [] : [{
475
965
  row: r,
476
966
  index: e.index,
477
- spacerHeight: e.start - (n[t - 1]?.end ?? z)
967
+ spacerHeight: e.start - (n[t - 1]?.end ?? L)
478
968
  }];
479
- }), Me = je.some(({ row: e }) => e.id === W) ? W : void 0, Q = Me ?? X;
480
- W !== void 0 && Me === void 0 && G(void 0), b(() => {
481
- if (_ === void 0) {
482
- K.current = void 0;
969
+ }), Y = J.some(({ row: e }) => e.id === B) ? B : void 0, X = Y ?? ye;
970
+ B !== void 0 && Y === void 0 && V(void 0), w(() => {
971
+ if (v === void 0) {
972
+ H.current = void 0;
483
973
  return;
484
974
  }
485
- if (K.current !== void 0 && K.current.id === Q) return;
975
+ if (H.current !== void 0 && H.current.id === X) return;
486
976
  let e = { isCurrent: !0 };
487
977
  return queueMicrotask(() => {
488
- e.isCurrent && (K.current = { id: Q }, _(Q));
978
+ e.isCurrent && (H.current = { id: X }, v(X));
489
979
  }), () => {
490
980
  e.isCurrent = !1;
491
981
  };
492
- }, [Q, _]);
493
- let Ne = je.some(({ row: e }) => e.id === g);
494
- x(() => {
495
- if (g === void 0) {
496
- J.current = void 0;
982
+ }, [X, v]);
983
+ let be = J.some(({ row: e }) => e.id === h);
984
+ te(() => {
985
+ if (h === void 0) {
986
+ W.current = void 0;
497
987
  return;
498
988
  }
499
- if (J.current === g) return;
500
- if (!Ne && j !== void 0) {
501
- let t = e.findIndex((e) => n(e) === g);
502
- t !== -1 && Z.scrollToIndex(t, { align: "auto" });
989
+ if (W.current === h) return;
990
+ if (!be && C !== void 0) {
991
+ let t = e.findIndex((e) => n(e) === h);
992
+ t !== -1 && q.scrollToIndex(t, { align: "auto" });
503
993
  return;
504
994
  }
505
- let t = L.current?.querySelector(`[data-row-id="${CSS.escape(g)}"] [data-row-action]`);
995
+ let t = F.current?.querySelector(`[data-row-id="${CSS.escape(h)}"] [data-row-action]`);
506
996
  if (t == null || t.matches(":disabled")) return;
507
997
  let r = requestAnimationFrame(() => {
508
- t.focus({ preventScroll: !0 }), document.activeElement === t && (J.current = g);
998
+ t.focus({ preventScroll: !0 }), document.activeElement === t && (W.current = h);
509
999
  });
510
1000
  return () => cancelAnimationFrame(r);
511
1001
  }, [
512
1002
  e,
513
- g,
1003
+ h,
514
1004
  d?.disabled,
515
- Ne,
516
- j,
1005
+ be,
1006
+ C,
517
1007
  n,
518
- L,
519
- Z
1008
+ F,
1009
+ q
520
1010
  ]);
521
- let Pe = j !== void 0 && (e.length === 0 || Z.range?.endIndex === e.length - 1);
522
- b(() => {
523
- Pe && M?.();
1011
+ let xe = C !== void 0 && (e.length === 0 || q.range?.endIndex === e.length - 1);
1012
+ w(() => {
1013
+ xe && A?.();
524
1014
  }, [
525
- Pe,
526
- M,
1015
+ xe,
1016
+ A,
527
1017
  e.length
528
- ]), x(() => {
529
- if (q.current === void 0) return;
530
- let e = Array.from(L.current?.querySelectorAll("[data-row-id]") ?? []).find((e) => e.dataset.rowId === q.current)?.querySelector("[data-row-action]");
531
- e != null && (e.focus({ preventScroll: j !== void 0 }), q.current = void 0);
1018
+ ]), te(() => {
1019
+ if (U.current === void 0) return;
1020
+ let e = Array.from(F.current?.querySelectorAll("[data-row-id]") ?? []).find((e) => e.dataset.rowId === U.current)?.querySelector("[data-row-action]");
1021
+ e != null && (e.focus({ preventScroll: C !== void 0 }), U.current = void 0);
532
1022
  });
533
- function Fe(t, r) {
1023
+ function Se(t, r) {
534
1024
  let i = t.metaKey || t.ctrlKey, a = t.altKey || t.shiftKey;
535
1025
  if (i || a) return;
536
- let o = he.get(t.key);
1026
+ let o = Ae.get(t.key);
537
1027
  if (o === void 0) return;
538
1028
  t.preventDefault();
539
1029
  let s = r + o, c = e[s];
540
- c !== void 0 && (q.current = n(c), U(q.current), j !== void 0 && Z.scrollToIndex(s, { align: "auto" }));
1030
+ c !== void 0 && (U.current = n(c), z(U.current), C !== void 0 && q.scrollToIndex(s, { align: "auto" }));
541
1031
  }
542
- let Ie = P.filter((e) => !ie || e.isSecondary !== !0).length + (c === void 0 ? 0 : 1), $ = c === void 0 ? 0 : me, Le = N != null && typeof N != "boolean", { minimumWidth: Re, compactWidth: ze } = xe(P, $), Be = Z.getTotalSize() - (Z.getVirtualItems().at(-1)?.end ?? z) + z;
543
- return /* @__PURE__ */ O("div", {
544
- ...v.props(B.frame, ve[ke]),
545
- children: [/* @__PURE__ */ O("div", {
546
- ref: I.ref,
1032
+ let Ce = M.filter((e) => !N || e.isSecondary !== !0).length + (c === void 0 ? 0 : 1), we = c === void 0 ? 0 : Oe, Te = j != null && typeof j != "boolean", { minimumWidth: ke, compactWidth: je } = Le(M, we), Q = q.getTotalSize() - (q.getVirtualItems().at(-1)?.end ?? L) + L;
1033
+ return /* @__PURE__ */ k("div", {
1034
+ ...g.props(Z.frame, Pe[K]),
1035
+ children: [/* @__PURE__ */ k("div", {
1036
+ ref: P.ref,
547
1037
  "data-table-viewport": !0,
548
1038
  role: "region",
549
1039
  "aria-label": r,
550
- tabIndex: I.tabIndex,
551
- ...v.props(B.viewport, ye[ke], typeof j?.height == "number" && B.virtual(j.height)),
552
- children: [/* @__PURE__ */ O("table", {
553
- "aria-rowcount": j === void 0 ? void 0 : Math.max(1, e.length) + 1,
554
- ...v.props(B.table, B.fixed, B.minimumWidth(Re, ze)),
1040
+ tabIndex: P.tabIndex,
1041
+ ...g.props(Z.viewport, Fe[K], typeof C?.height == "number" && Z.virtual(C.height)),
1042
+ children: [/* @__PURE__ */ k("table", {
1043
+ "aria-rowcount": C === void 0 ? void 0 : Math.max(1, e.length) + 1,
1044
+ ...g.props(Z.table, Z.fixed, Z.minimumWidth(ke, je)),
555
1045
  children: [
556
- /* @__PURE__ */ D("caption", {
557
- ref: de,
558
- ...v.props(B.caption, y && f.hidden),
1046
+ /* @__PURE__ */ O("caption", {
1047
+ ref: me,
1048
+ ...g.props(Z.caption, y && f.hidden),
559
1049
  children: r
560
1050
  }),
561
- /* @__PURE__ */ D(we, {
562
- columns: P,
1051
+ /* @__PURE__ */ O(Be, {
1052
+ columns: M,
563
1053
  canSelect: c !== void 0
564
1054
  }),
565
- /* @__PURE__ */ D("thead", {
566
- ref: R,
567
- ...v.props(E && f.hidden),
568
- children: /* @__PURE__ */ O("tr", { children: [c !== void 0 && /* @__PURE__ */ D("th", {
1055
+ /* @__PURE__ */ O("thead", {
1056
+ ref: I,
1057
+ ...g.props(b && f.hidden),
1058
+ children: /* @__PURE__ */ k("tr", { children: [c !== void 0 && /* @__PURE__ */ O("th", {
569
1059
  scope: "col",
570
1060
  className: "x9f619 x7wzq59 x13vifvy x11ru5tl x1krvmzm xt970qd xso031l x1q0q8m5 x1qndepd x153jb6y xpvm0e4 xj57cvi xy8obcc xas2l8k xuxw1ft x1d7z9mz xeuugli x1dc62k6",
571
- children: /* @__PURE__ */ D("span", {
572
- ...v.props(f.hidden),
1061
+ children: /* @__PURE__ */ O("span", {
1062
+ ...g.props(f.hidden),
573
1063
  children: "Select"
574
1064
  })
575
- }), P.map((e) => {
1065
+ }), M.map((e) => {
576
1066
  let t = a?.columnId === e.id ? a.direction : void 0;
577
- return /* @__PURE__ */ D("th", {
1067
+ return /* @__PURE__ */ O("th", {
578
1068
  scope: "col",
579
1069
  title: e.label,
580
1070
  "aria-sort": t,
581
- ...v.props(B.header, _e[e.role], e.width !== void 0 && B.width(e.width), e.isSecondary === !0 && B.secondary),
582
- children: e.canSort === !0 && s !== void 0 ? /* @__PURE__ */ O("button", {
1071
+ ...g.props(Z.header, Ne[e.role], e.width !== void 0 && Z.width(e.width), e.isSecondary === !0 && Z.secondary),
1072
+ children: e.canSort === !0 && s !== void 0 ? /* @__PURE__ */ k(_, {
583
1073
  type: "button",
584
1074
  className: "x3nfvp2 x6s0dn4 x1hnptsi x193iq5w xeuugli x2zujid x17oiadl x1717udv xc342km x1heor9g xjbqb8w xjb2p0i x1qlqyl8 x1pd3egz x15bjb6t x1ypdohk xp9636p x1s9zmfe x13qnu6 x9v5kkp x19rmrnh x7s97pk",
585
1075
  onClick: () => {
@@ -591,53 +1081,53 @@ function K({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: a, on
591
1081
  direction: "ascending"
592
1082
  });
593
1083
  },
594
- children: [/* @__PURE__ */ D("span", {
1084
+ children: [/* @__PURE__ */ O("span", {
595
1085
  className: "x1lliihq xeuugli xb3r6kr xlyipyv xuxw1ft",
596
1086
  children: e.label
597
- }), D(t === "ascending" ? te : t === "descending" ? k : ne, {
1087
+ }), O(t === "ascending" ? ae : t === "descending" ? ie : oe, {
598
1088
  size: 14,
599
1089
  "aria-hidden": "true",
600
1090
  className: "x2lah0s"
601
1091
  })]
602
- }) : /* @__PURE__ */ D("span", {
1092
+ }) : /* @__PURE__ */ O("span", {
603
1093
  className: "x1lliihq xeuugli xb3r6kr xlyipyv xuxw1ft",
604
1094
  children: e.label
605
1095
  })
606
1096
  }, e.id);
607
1097
  })] })
608
1098
  }),
609
- /* @__PURE__ */ O("tbody", {
610
- onPointerLeave: () => G(void 0),
611
- onKeyDownCapture: () => G(void 0),
1099
+ /* @__PURE__ */ k("tbody", {
1100
+ onPointerLeave: () => V(void 0),
1101
+ onKeyDownCapture: () => V(void 0),
612
1102
  onBlur: (e) => {
613
- e.currentTarget.contains(e.relatedTarget) || U(void 0);
1103
+ e.currentTarget.contains(e.relatedTarget) || z(void 0);
614
1104
  },
615
1105
  children: [
616
- je.map(({ row: e, index: t, spacerHeight: n }) => /* @__PURE__ */ O(ee, { children: [n > 0 && /* @__PURE__ */ D("tr", {
1106
+ J.map(({ row: e, index: t, spacerHeight: n }) => /* @__PURE__ */ k(x, { children: [n > 0 && /* @__PURE__ */ O("tr", {
617
1107
  "aria-hidden": "true",
618
- children: /* @__PURE__ */ D("td", {
619
- colSpan: Ie,
620
- ...v.props(B.spacer(n))
1108
+ children: /* @__PURE__ */ O("td", {
1109
+ colSpan: Ce,
1110
+ ...g.props(Z.spacer(n))
621
1111
  })
622
- }), /* @__PURE__ */ O("tr", {
1112
+ }), /* @__PURE__ */ k("tr", {
623
1113
  "data-index": t,
624
1114
  "data-row-id": e.id,
625
- "aria-rowindex": j === void 0 ? void 0 : t + 2,
626
- ref: j === void 0 || A === "fixed" ? void 0 : Z.measureElement,
1115
+ "aria-rowindex": C === void 0 ? void 0 : t + 2,
1116
+ ref: C === void 0 || S === "fixed" ? void 0 : q.measureElement,
627
1117
  onPointerMove: (t) => {
628
- t.pointerType === "mouse" && G(e.id);
1118
+ t.pointerType === "mouse" && V(e.id);
629
1119
  },
630
1120
  onPointerEnter: (t) => {
631
- t.pointerType === "mouse" && G(e.id);
1121
+ t.pointerType === "mouse" && V(e.id);
632
1122
  },
633
1123
  onPointerLeave: () => {
634
- G((t) => t === e.id ? void 0 : t);
1124
+ V((t) => t === e.id ? void 0 : t);
635
1125
  },
636
1126
  onPointerDown: (e) => {
637
- e.pointerType !== "mouse" && G(void 0);
1127
+ e.pointerType !== "mouse" && V(void 0);
638
1128
  },
639
1129
  onFocus: () => {
640
- G(void 0), U(e.id);
1130
+ V(void 0), z(e.id);
641
1131
  },
642
1132
  ...{
643
1133
  0: { className: "x1n2onr6 xc8icb0 x1wtzb06 xso031l x1q0q8m5 x1qndepd x19k386i x1t1lzn6" },
@@ -645,49 +1135,49 @@ function K({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: a, on
645
1135
  1: { className: "x1n2onr6 xc8icb0 x1wtzb06 xso031l x1q0q8m5 x1qndepd x19k386i x1t1lzn6 x1r8u7ye" },
646
1136
  3: { className: "x1n2onr6 xc8icb0 x1wtzb06 xso031l x1q0q8m5 x1qndepd x19k386i x1t1lzn6 x1ypdohk x1ecmtor x1r8u7ye" }
647
1137
  }[(d !== void 0 && d.disabled !== !0) << 1 | (c?.has(e.id) === !0 || p === e.id)],
648
- children: [c !== void 0 && /* @__PURE__ */ D("td", {
1138
+ children: [c !== void 0 && /* @__PURE__ */ O("td", {
649
1139
  className: "x9f619 xt970qd xxymvpz xj0a0fe x1d7z9mz xeuugli x1dc62k6 x1n2onr6 x1vjfegm",
650
- children: /* @__PURE__ */ D(o.Root, {
1140
+ children: /* @__PURE__ */ O(o.Root, {
651
1141
  "aria-label": u(e.original),
652
1142
  checked: c.has(e.id),
653
1143
  onCheckedChange: (t) => {
654
1144
  let n = new Set(c);
655
1145
  t ? n.add(e.id) : n.delete(e.id), l(n);
656
1146
  },
657
- children: /* @__PURE__ */ D(o.Indicator, {})
1147
+ children: /* @__PURE__ */ O(o.Indicator, {})
658
1148
  })
659
- }), P.map((n, r) => /* @__PURE__ */ D("td", {
660
- ...v.props(B.cell, ge[A], _e[n.role], n.width !== void 0 && B.width(n.width), n.isSecondary === !0 && B.secondary),
661
- children: d !== void 0 && r === Oe ? /* @__PURE__ */ D(Ee, {
1149
+ }), M.map((n, r) => /* @__PURE__ */ O("td", {
1150
+ ...g.props(Z.cell, Me[S], Ne[n.role], n.width !== void 0 && Z.width(n.width), n.isSecondary === !0 && Z.secondary),
1151
+ children: d !== void 0 && r === _e ? /* @__PURE__ */ O(Qe, {
662
1152
  row: e.original,
663
1153
  action: d,
664
1154
  isActive: p === e.id,
665
- onKeyDown: (e) => Fe(e, t),
666
- children: /* @__PURE__ */ D(Te, {
1155
+ onKeyDown: (e) => Se(e, t),
1156
+ children: /* @__PURE__ */ O(Xe, {
667
1157
  role: n.role,
668
- isFixed: A === "fixed",
1158
+ isFixed: S === "fixed",
669
1159
  shouldTruncate: n.shouldTruncate,
670
1160
  children: n.cell(e.original)
671
1161
  })
672
- }) : /* @__PURE__ */ D(Te, {
1162
+ }) : /* @__PURE__ */ O(Xe, {
673
1163
  role: n.role,
674
- isFixed: A === "fixed",
1164
+ isFixed: S === "fixed",
675
1165
  shouldTruncate: n.shouldTruncate,
676
1166
  children: n.cell(e.original)
677
1167
  })
678
1168
  }, n.id))]
679
1169
  })] }, e.id)),
680
- j !== void 0 && Be > 0 && /* @__PURE__ */ D("tr", {
1170
+ C !== void 0 && Q > 0 && /* @__PURE__ */ O("tr", {
681
1171
  "aria-hidden": "true",
682
- children: /* @__PURE__ */ D("td", {
683
- colSpan: Ie,
684
- ...v.props(B.spacer(Be))
1172
+ children: /* @__PURE__ */ O("td", {
1173
+ colSpan: Ce,
1174
+ ...g.props(Z.spacer(Q))
685
1175
  })
686
1176
  }),
687
- e.length === 0 && /* @__PURE__ */ D("tr", { children: /* @__PURE__ */ D("td", {
688
- colSpan: Ie,
1177
+ e.length === 0 && /* @__PURE__ */ O("tr", { children: /* @__PURE__ */ O("td", {
1178
+ colSpan: Ce,
689
1179
  className: "x1717udv",
690
- children: /* @__PURE__ */ D("div", {
1180
+ children: /* @__PURE__ */ O("div", {
691
1181
  className: "x9f619 x7wzq59 x1o0tod xzfn7dr x193iq5w x1ttojsm x2b8uid xeaf4i8 xj0a0fe x153jb6y",
692
1182
  children: i
693
1183
  })
@@ -695,28 +1185,28 @@ function K({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: a, on
695
1185
  ]
696
1186
  })
697
1187
  ]
698
- }), /* @__PURE__ */ D("div", {
1188
+ }), /* @__PURE__ */ O("div", {
699
1189
  ref: ue,
700
1190
  ...{
701
1191
  0: {},
702
1192
  1: { className: "xid9utz xg7ukam x153jb6y xy8obcc xas2l8k x15x95ik x1az1eml" }
703
- }[re !== void 0 | 0],
704
- children: re
1193
+ }[D !== void 0 | 0],
1194
+ children: D
705
1195
  })]
706
- }), Le && /* @__PURE__ */ D("div", {
1196
+ }), Te && /* @__PURE__ */ O("div", {
707
1197
  className: "xg7ukam x178xt8z x13fuv20 xhjagg4",
708
- children: N
1198
+ children: j
709
1199
  })]
710
1200
  });
711
1201
  }
712
- function Te({ role: e, isFixed: t, shouldTruncate: n, children: r }) {
713
- let i = V[e], a = t && i.shouldTruncate, o = typeof r == "string" && (n ?? a);
714
- return /* @__PURE__ */ D("span", {
1202
+ function Xe({ role: e, isFixed: t, shouldTruncate: n, children: r }) {
1203
+ let i = Q[e], a = t && i.shouldTruncate, o = typeof r == "string" && (n ?? a);
1204
+ return /* @__PURE__ */ O("span", {
715
1205
  ...{
716
1206
  0: { className: "x78zum5 x6s0dn4 xeuugli xh8yej3 xw3im37" },
717
1207
  1: { className: "x78zum5 x6s0dn4 xeuugli xh8yej3 xt7dq6l" }
718
1208
  }[!t | 0],
719
- children: /* @__PURE__ */ D("span", {
1209
+ children: /* @__PURE__ */ O("span", {
720
1210
  title: typeof r == "string" ? r : void 0,
721
1211
  ...{
722
1212
  0: { className: "x1lliihq xeuugli xh8yej3 x193iq5w xkfz77 x1ljc890" },
@@ -732,81 +1222,81 @@ function Te({ role: e, isFixed: t, shouldTruncate: n, children: r }) {
732
1222
  })
733
1223
  });
734
1224
  }
735
- function q(e) {
1225
+ function Ze(e) {
736
1226
  if (e.defaultPrevented || e.button !== 0) return !1;
737
1227
  let t = e.metaKey || e.ctrlKey, n = e.altKey || e.shiftKey;
738
1228
  return t || n ? !1 : e.detail === 0 || e.currentTarget.ownerDocument.getSelection()?.isCollapsed !== !1;
739
1229
  }
740
- function Ee({ row: e, action: t, isActive: n, children: r, onKeyDown: i }) {
741
- let a = t.label?.(e), o = t.href === void 0 ? /* @__PURE__ */ D("button", {
1230
+ function Qe({ row: e, action: t, isActive: n, children: r, onKeyDown: i }) {
1231
+ let a = t.label?.(e), o = t.href === void 0 ? /* @__PURE__ */ O(_, {
742
1232
  type: "button",
743
- disabled: t.disabled,
1233
+ disabled: t.disabled === !0,
744
1234
  "aria-label": a,
745
1235
  "aria-pressed": n,
746
1236
  "data-row-action": !0,
747
1237
  onKeyDown: i,
748
1238
  onClick: (n) => {
749
- q(n) && t.onActivate(e);
1239
+ Ze(n) && t.onActivate(e);
750
1240
  },
751
1241
  className: "x1rh3ycu x1hx0egp x78zum5 x6s0dn4 xh8yej3 xeuugli x17tes2r x17oiadl x1717udv xc342km x1ok0vyi x1heor9g xjbqb8w xjb2p0i x1qlqyl8 x1pd3egz x15bjb6t x16tdsg8 x1hl2dhg x1ypdohk x1t137rt x1s928wv x1j6awrg xarstr8 x11q50lq xa2q2qx x1x5eltu x1jdy9wv xtgyt42 x19mxcj1",
752
1242
  children: r
753
- }) : /* @__PURE__ */ D("a", {
1243
+ }) : /* @__PURE__ */ O("a", {
754
1244
  href: t.href(e),
755
1245
  "aria-label": a,
756
1246
  "data-row-action": !0,
757
1247
  onKeyDown: i,
758
1248
  onClick: (n) => {
759
- t.onActivate !== void 0 && q(n) && (n.preventDefault(), t.onActivate(e));
1249
+ t.onActivate !== void 0 && Ze(n) && (n.preventDefault(), t.onActivate(e));
760
1250
  },
761
1251
  className: "x1rh3ycu x1hx0egp x78zum5 x6s0dn4 xh8yej3 xeuugli x17tes2r x17oiadl x1717udv xc342km x1ok0vyi x1heor9g xjbqb8w xjb2p0i x1qlqyl8 x1pd3egz x15bjb6t x16tdsg8 x1hl2dhg x1ypdohk x1t137rt x1s928wv x1j6awrg xarstr8 x11q50lq xa2q2qx x1x5eltu x1jdy9wv xtgyt42 x19mxcj1",
762
1252
  children: r
763
1253
  });
764
- return a === void 0 ? o : /* @__PURE__ */ O(u.Root, { children: [/* @__PURE__ */ D(u.Trigger, { render: o }), /* @__PURE__ */ D(u.Portal, { children: /* @__PURE__ */ D(u.Positioner, {
1254
+ return a === void 0 ? o : /* @__PURE__ */ k(u.Root, { children: [/* @__PURE__ */ O(u.Trigger, { render: o }), /* @__PURE__ */ O(u.Popup, {
765
1255
  side: "top",
766
1256
  align: "start",
767
- children: /* @__PURE__ */ D(u.Popup, { children: a })
768
- }) })] });
1257
+ children: a
1258
+ })] });
769
1259
  }
770
1260
  // packages/collections/src/collection-scroll.tsx
771
- function J(e) {
1261
+ function $e(e) {
772
1262
  switch (e.status) {
773
- case "loading": return /* @__PURE__ */ D(n, {
1263
+ case "loading": return /* @__PURE__ */ O(n, {
774
1264
  role: "status",
775
1265
  variant: "caption",
776
1266
  tone: "muted",
777
1267
  children: e.message ?? "Loading…"
778
1268
  });
779
- case "complete": return e.message === void 0 ? null : /* @__PURE__ */ D(n, {
1269
+ case "complete": return e.message === void 0 ? null : /* @__PURE__ */ O(n, {
780
1270
  variant: "caption",
781
1271
  tone: "muted",
782
1272
  children: e.message
783
1273
  });
784
- case "ready": return /* @__PURE__ */ D(a, {
1274
+ case "ready": return /* @__PURE__ */ O(a, {
785
1275
  onClick: e.onLoadMore,
786
1276
  children: e.message ?? "Load more"
787
1277
  });
788
- case "error": return /* @__PURE__ */ O(i, {
1278
+ case "error": return /* @__PURE__ */ k(i, {
789
1279
  role: "status",
790
- children: [/* @__PURE__ */ D(n, {
1280
+ children: [/* @__PURE__ */ O(n, {
791
1281
  variant: "caption",
792
1282
  tone: "muted",
793
1283
  children: e.message ?? "More records could not be loaded."
794
- }), /* @__PURE__ */ D(a, {
1284
+ }), /* @__PURE__ */ O(a, {
795
1285
  onClick: e.onLoadMore,
796
1286
  children: "Retry"
797
1287
  })]
798
1288
  });
799
1289
  }
800
1290
  }
801
- function Y({ children: e, endContent: t, onEndReached: n, shouldFill: r = !1, endPosition: i = "end", label: a = "Collection" }) {
802
- let o = h(), s = o.viewport, c = C(null);
803
- fe({
1291
+ function et({ children: e, endContent: t, onEndReached: n, shouldFill: r = !1, endPosition: i = "end", label: a = "Collection" }) {
1292
+ let o = m(), s = o.viewport, c = T(null);
1293
+ Ee({
804
1294
  end: c,
805
1295
  viewport: r ? s : void 0,
806
1296
  onEndReached: n,
807
1297
  content: e
808
1298
  });
809
- let l = /* @__PURE__ */ D("div", {
1299
+ let l = /* @__PURE__ */ O("div", {
810
1300
  ref: c,
811
1301
  ...{
812
1302
  0: {},
@@ -814,7 +1304,7 @@ function Y({ children: e, endContent: t, onEndReached: n, shouldFill: r = !1, en
814
1304
  }[t !== void 0 | 0],
815
1305
  children: t
816
1306
  });
817
- return /* @__PURE__ */ O("div", {
1307
+ return /* @__PURE__ */ k("div", {
818
1308
  ref: o.ref,
819
1309
  role: r ? "region" : void 0,
820
1310
  "aria-label": r ? a : void 0,
@@ -831,11 +1321,11 @@ function Y({ children: e, endContent: t, onEndReached: n, shouldFill: r = !1, en
831
1321
  });
832
1322
  }
833
1323
  // packages/collections/src/inspector.tsx
834
- var De = 860;
835
- function Oe({ master: e, detail: t, label: n, masterLabel: r, revealKey: i, returnFocusRef: o, ...s }) {
836
- let c = C(null), l = C(null), u = C(null);
837
- x(() => {
838
- i !== void 0 && c.current !== null && u.current !== null && c.current.clientWidth <= De && (u.current.focus({ preventScroll: !0 }), u.current.scrollIntoView({
1324
+ var tt = 860;
1325
+ function nt({ master: e, detail: t, label: n, masterLabel: r, revealKey: i, returnFocusRef: o, ...s }) {
1326
+ let c = T(null), l = T(null), u = T(null);
1327
+ te(() => {
1328
+ i !== void 0 && c.current !== null && u.current !== null && c.current.clientWidth <= tt && (u.current.focus({ preventScroll: !0 }), u.current.scrollIntoView({
839
1329
  block: "start",
840
1330
  behavior: "instant"
841
1331
  }));
@@ -847,26 +1337,26 @@ function Oe({ master: e, detail: t, label: n, masterLabel: r, revealKey: i, retu
847
1337
  behavior: "instant"
848
1338
  });
849
1339
  }
850
- return /* @__PURE__ */ D("div", {
851
- ..._({ className: "x9vvk8s x12h1iku xeuugli xbixft x1hz01jw xtqrqnz x1778rvt" }, s),
852
- children: /* @__PURE__ */ O("div", {
1340
+ return /* @__PURE__ */ O("div", {
1341
+ ...y({ className: "x9vvk8s x12h1iku xeuugli xbixft x1hz01jw xtqrqnz x1778rvt" }, s),
1342
+ children: /* @__PURE__ */ k("div", {
853
1343
  ref: c,
854
1344
  className: "xrvj5dj x4ruv2j x1y7acmc x7a106z x1j825kq xeuugli",
855
- children: [/* @__PURE__ */ D("div", {
1345
+ children: [/* @__PURE__ */ O("div", {
856
1346
  ref: l,
857
1347
  role: "group",
858
1348
  "aria-label": r,
859
1349
  tabIndex: -1,
860
1350
  className: "xeuugli",
861
1351
  children: e
862
- }), /* @__PURE__ */ O("aside", {
1352
+ }), /* @__PURE__ */ k("aside", {
863
1353
  ref: u,
864
1354
  "aria-label": n,
865
1355
  tabIndex: -1,
866
1356
  className: "x7wzq59 x7cfggw xqfmuo8 xeuugli x1sbza1b xhuqrux xexx8yu xdz7uhd xpilrb4 xdctr63 x1t7ytsu x97x49r x972fbf x1mg79u0 x13fuv20 xhjagg4 x14ijc3v x13qnu6 x9v5kkp x19rmrnh x12ijfkc",
867
- children: [/* @__PURE__ */ D("div", {
1357
+ children: [/* @__PURE__ */ O("div", {
868
1358
  className: "x1s85apg x1yamub6 x1xxlxpq",
869
- children: /* @__PURE__ */ O(a, {
1359
+ children: /* @__PURE__ */ k(a, {
870
1360
  variant: "ghost",
871
1361
  onClick: d,
872
1362
  children: ["Back to ", r.toLowerCase()]
@@ -876,15 +1366,15 @@ function Oe({ master: e, detail: t, label: n, masterLabel: r, revealKey: i, retu
876
1366
  })
877
1367
  });
878
1368
  }
879
- function ke({ items: e, ...t }) {
880
- return /* @__PURE__ */ D("dl", {
881
- ..._({ className: "x1ghz6dp xrvj5dj xezdspq x1i3977y xuytk5h x1hz01jw xvmahel xtqrqnz x1778rvt" }, t),
882
- children: e.map(({ label: e, value: t }) => /* @__PURE__ */ O("div", {
1369
+ function rt({ items: e, ...t }) {
1370
+ return /* @__PURE__ */ O("dl", {
1371
+ ...y({ className: "x1ghz6dp xrvj5dj xezdspq x1i3977y xuytk5h x1hz01jw xvmahel xtqrqnz x1778rvt" }, t),
1372
+ children: e.map(({ label: e, value: t }) => /* @__PURE__ */ k("div", {
883
1373
  className: "xjp7ctv",
884
- children: [/* @__PURE__ */ D("dt", {
1374
+ children: [/* @__PURE__ */ O("dt", {
885
1375
  className: "xeuugli x153jb6y xj0a0fe",
886
1376
  children: e
887
- }), /* @__PURE__ */ D("dd", {
1377
+ }), /* @__PURE__ */ O("dd", {
888
1378
  className: "xeuugli x1ghz6dp xbixft xj0a0fe xss6m8b",
889
1379
  children: t
890
1380
  })]
@@ -892,20 +1382,20 @@ function ke({ items: e, ...t }) {
892
1382
  });
893
1383
  }
894
1384
  // packages/collections/src/list-footer.tsx
895
- function Ae({ children: e, actions: t, ...n }) {
896
- return /* @__PURE__ */ O("div", {
897
- ..._({ className: "x78zum5 x6s0dn4 x1qughib x1a02dak xeuugli x1n8ia3y x1qokhjc x1m92p3w x178xt8z x13fuv20 xhjagg4 x153jb6y x1hz01jw xvmahel xtqrqnz x1778rvt" }, n),
898
- children: [/* @__PURE__ */ D("div", {
1385
+ function it({ children: e, actions: t, ...n }) {
1386
+ return /* @__PURE__ */ k("div", {
1387
+ ...y({ className: "x78zum5 x6s0dn4 x1qughib x1a02dak xeuugli x1n8ia3y x1qokhjc x1m92p3w x178xt8z x13fuv20 xhjagg4 x153jb6y x1hz01jw xvmahel xtqrqnz x1778rvt" }, n),
1388
+ children: [/* @__PURE__ */ O("div", {
899
1389
  className: "xeuugli xj0a0fe",
900
1390
  children: e
901
- }), t != null && /* @__PURE__ */ D("div", {
1391
+ }), t != null && /* @__PURE__ */ O("div", {
902
1392
  className: "x78zum5 x6s0dn4 x1a02dak x1hnptsi xeuugli",
903
1393
  children: t
904
1394
  })]
905
1395
  });
906
1396
  }
907
1397
  // packages/collections/src/metrics.tsx
908
- var X = {
1398
+ var $ = {
909
1399
  grid: {
910
1400
  k1xSpc: "x78zum5",
911
1401
  kwnvtZ: "x1a02dak",
@@ -998,53 +1488,53 @@ var X = {
998
1488
  kCS8Yb: "x1l7klhg",
999
1489
  $$css: !0
1000
1490
  }
1001
- }, Z = {
1491
+ }, at = {
1002
1492
  inline: {
1003
1493
  metric: void 0,
1004
1494
  label: void 0,
1005
1495
  value: void 0,
1006
- detail: X.inlineDetail,
1496
+ detail: $.inlineDetail,
1007
1497
  valueWidth: "5ch"
1008
1498
  },
1009
1499
  statistic: {
1010
- metric: X.statistic,
1011
- label: X.stackedLabel,
1012
- value: X.statisticValue,
1500
+ metric: $.statistic,
1501
+ label: $.stackedLabel,
1502
+ value: $.statisticValue,
1013
1503
  detail: void 0,
1014
1504
  valueWidth: "5ch"
1015
1505
  },
1016
1506
  headline: {
1017
- metric: X.headline,
1018
- label: X.headlineLabel,
1019
- value: X.headlineValue,
1507
+ metric: $.headline,
1508
+ label: $.headlineLabel,
1509
+ value: $.headlineValue,
1020
1510
  detail: void 0,
1021
1511
  valueWidth: "9ch"
1022
1512
  }
1023
- }, je = {
1024
- inline: X.grid,
1025
- columns: X.columns
1513
+ }, ot = {
1514
+ inline: $.grid,
1515
+ columns: $.columns
1026
1516
  };
1027
- function Me({ layout: e = "inline", ...t }) {
1028
- return /* @__PURE__ */ D("dl", { ..._(v.props(je[e]), t) });
1517
+ function st({ layout: e = "inline", ...t }) {
1518
+ return /* @__PURE__ */ O("dl", { ...y(g.props(ot[e]), t) });
1029
1519
  }
1030
- function Q({ label: e, value: t, detail: n, isLoading: r = !1, hasDetail: i = !1, variant: a = "inline", trend: o, ...s }) {
1031
- let c = Z[a];
1032
- return /* @__PURE__ */ O("div", {
1033
- ..._(v.props(X.metric, c.metric), s),
1520
+ function ct({ label: e, value: t, detail: n, isLoading: r = !1, hasDetail: i = !1, variant: a = "inline", trend: o, ...s }) {
1521
+ let c = at[a];
1522
+ return /* @__PURE__ */ k("div", {
1523
+ ...y(g.props($.metric, c.metric), s),
1034
1524
  children: [
1035
- /* @__PURE__ */ D("dt", {
1036
- ...v.props(X.label, c.label),
1525
+ /* @__PURE__ */ O("dt", {
1526
+ ...g.props($.label, c.label),
1037
1527
  children: e
1038
1528
  }),
1039
- /* @__PURE__ */ D("dd", {
1040
- ...v.props(X.value, c.value),
1041
- children: r ? /* @__PURE__ */ D(d, { width: c.valueWidth }) : t
1529
+ /* @__PURE__ */ O("dd", {
1530
+ ...g.props($.value, c.value),
1531
+ children: r ? /* @__PURE__ */ O(d, { width: c.valueWidth }) : t
1042
1532
  }),
1043
- (r ? i : n !== void 0) && /* @__PURE__ */ D("dd", {
1044
- ...v.props(X.detail, c.detail),
1045
- children: r ? /* @__PURE__ */ D(d, { width: "24ch" }) : n
1533
+ (r ? i : n !== void 0) && /* @__PURE__ */ O("dd", {
1534
+ ...g.props($.detail, c.detail),
1535
+ children: r ? /* @__PURE__ */ O(d, { width: "24ch" }) : n
1046
1536
  }),
1047
- o !== void 0 && /* @__PURE__ */ D("dd", {
1537
+ o !== void 0 && /* @__PURE__ */ O("dd", {
1048
1538
  className: "x1ghz6dp xeuugli xh8yej3 xkh2ocl",
1049
1539
  children: o
1050
1540
  })
@@ -1052,64 +1542,64 @@ function Q({ label: e, value: t, detail: n, isLoading: r = !1, hasDetail: i = !1
1052
1542
  });
1053
1543
  }
1054
1544
  // packages/collections/src/timestamp.tsx
1055
- function Ne({ dateTime: e, label: t, title: n }) {
1056
- return n === void 0 ? /* @__PURE__ */ D("time", {
1545
+ function lt({ dateTime: e, label: t, title: n }) {
1546
+ return n === void 0 ? /* @__PURE__ */ O("time", {
1057
1547
  dateTime: e,
1058
1548
  className: "x1hz01jw xy8obcc xas2l8k x153jb6y xss6m8b xj0a0fe x13qnu6 x9v5kkp x19rmrnh x7s97pk",
1059
1549
  children: t
1060
- }) : /* @__PURE__ */ O(u.Root, { children: [/* @__PURE__ */ D(u.Trigger, {
1061
- render: /* @__PURE__ */ D("time", {
1550
+ }) : /* @__PURE__ */ k(u.Root, { children: [/* @__PURE__ */ O(u.Trigger, {
1551
+ render: /* @__PURE__ */ O("time", {
1062
1552
  dateTime: e,
1063
1553
  tabIndex: 0,
1064
1554
  "aria-label": n,
1065
1555
  className: "x1hz01jw xy8obcc xas2l8k x153jb6y xss6m8b xj0a0fe x13qnu6 x9v5kkp x19rmrnh x7s97pk"
1066
1556
  }),
1067
1557
  children: t
1068
- }), /* @__PURE__ */ D(u.Portal, { children: /* @__PURE__ */ D(u.Positioner, { children: /* @__PURE__ */ D(u.Popup, { children: n }) }) })] });
1558
+ }), /* @__PURE__ */ O(u.Popup, { children: n })] });
1069
1559
  }
1070
1560
  // packages/collections/src/timeline.tsx
1071
- function Pe({ label: e, children: t }) {
1072
- return /* @__PURE__ */ D("ol", {
1561
+ function ut({ label: e, children: t }) {
1562
+ return /* @__PURE__ */ O("ol", {
1073
1563
  "aria-label": e,
1074
1564
  className: "xe8uvvx x1ghz6dp x1717udv xeuugli",
1075
1565
  children: t
1076
1566
  });
1077
1567
  }
1078
- function Fe({ icon: e, title: n, time: r, metadata: i, children: a, details: o, defaultOpen: s = !1 }) {
1079
- let [c, l] = w(s), u = /* @__PURE__ */ O("div", {
1568
+ function dt({ icon: e, title: n, time: r, metadata: i, children: a, details: o, defaultOpen: s = !1 }) {
1569
+ let [c, l] = E(s), u = /* @__PURE__ */ k("div", {
1080
1570
  className: "x78zum5 x1pha0wt x1hnptsi x1a02dak xeuugli",
1081
- children: [/* @__PURE__ */ D("div", {
1571
+ children: [/* @__PURE__ */ O("div", {
1082
1572
  className: "xeuugli xk4h15q xj0a0fe",
1083
- children: o === void 0 ? n : /* @__PURE__ */ D(t.Trigger, {
1573
+ children: o === void 0 ? n : /* @__PURE__ */ O(t.Trigger, {
1084
1574
  className: "x14atkfc x16exltd x17oiadl xt970qd xlqzeqv",
1085
1575
  children: n
1086
1576
  })
1087
- }), r != null && /* @__PURE__ */ D("div", {
1577
+ }), r != null && /* @__PURE__ */ O("div", {
1088
1578
  className: "xeuugli x153jb6y xy8obcc xas2l8k xss6m8b xj0a0fe",
1089
1579
  children: r
1090
1580
  })]
1091
- }), d = /* @__PURE__ */ O(E, { children: [
1581
+ }), d = /* @__PURE__ */ k(D, { children: [
1092
1582
  u,
1093
- a != null && (!c || o === void 0) && /* @__PURE__ */ D("div", {
1583
+ a != null && (!c || o === void 0) && /* @__PURE__ */ O("div", {
1094
1584
  className: "xeuugli x1ewvobj xj0a0fe",
1095
1585
  children: a
1096
1586
  }),
1097
- i != null && /* @__PURE__ */ D("div", {
1587
+ i != null && /* @__PURE__ */ O("div", {
1098
1588
  className: "xeuugli x153jb6y xy8obcc xas2l8k xj0a0fe",
1099
1589
  children: i
1100
1590
  }),
1101
- o !== void 0 && /* @__PURE__ */ D(t.Panel, { children: o })
1591
+ o !== void 0 && /* @__PURE__ */ O(t.Panel, { children: o })
1102
1592
  ] });
1103
- return /* @__PURE__ */ O("li", {
1593
+ return /* @__PURE__ */ k("li", {
1104
1594
  className: "x1n2onr6 xrvj5dj x1eqwfih x1y1mm1b xhlx3wy xeuugli x1hz01jw xvmahel xtqrqnz x1778rvt xbixft x1cpjm7i x1hmns74 x1lk18uv x1gi6gvw x1jw5pjq x1vgi0k x1mi36wk x1wse844 xup0pd7",
1105
- children: [/* @__PURE__ */ D("span", {
1595
+ children: [/* @__PURE__ */ O("span", {
1106
1596
  "aria-hidden": !0,
1107
1597
  className: "x78zum5 x6s0dn4 xl56j7k x1b1e0sl x153jb6y",
1108
1598
  children: e
1109
- }), o === void 0 ? /* @__PURE__ */ D("div", {
1599
+ }), o === void 0 ? /* @__PURE__ */ O("div", {
1110
1600
  className: "xrvj5dj x1hnptsi xeuugli",
1111
1601
  children: d
1112
- }) : /* @__PURE__ */ D(t.Root, {
1602
+ }) : /* @__PURE__ */ O(t.Root, {
1113
1603
  open: c,
1114
1604
  onOpenChange: l,
1115
1605
  className: "xrvj5dj x1hnptsi xeuugli xh8yej3",
@@ -1117,277 +1607,8 @@ function Fe({ icon: e, title: n, time: r, metadata: i, children: a, details: o,
1117
1607
  })]
1118
1608
  });
1119
1609
  }
1120
- var Ie = {
1121
- Root: Pe,
1122
- Item: Fe
1123
- }, $ = {
1124
- search: {
1125
- kzqmXN: "xh8yej3",
1126
- k1K539: "x1kk91vl",
1127
- $$css: !0
1128
- },
1129
- icon: {
1130
- k1xSpc: "x78zum5",
1131
- kMwMTN: "x153jb6y",
1132
- $$css: !0
1133
- },
1134
- positive: {
1135
- kMwMTN: "x7ixh4y",
1136
- $$css: !0
1137
- },
1138
- warning: {
1139
- kMwMTN: "x1f9ixgr",
1140
- $$css: !0
1141
- },
1142
- negative: {
1143
- kMwMTN: "xr5kp14",
1144
- $$css: !0
1145
- }
1146
- }, Le = {
1147
- positive: $.positive,
1148
- negative: $.negative,
1149
- warning: $.warning,
1150
- neutral: void 0
1151
- }, Re = /* @__PURE__ */ new Set([
1152
- "Home",
1153
- "End",
1154
- "ArrowLeft",
1155
- "ArrowRight",
1156
- "Backspace",
1157
- "Delete"
1158
- ]);
1159
- function ze({ option: e }) {
1160
- return /* @__PURE__ */ D("span", {
1161
- ...v.props($.icon, Le[e.tone ?? "neutral"]),
1162
- children: e.icon ?? /* @__PURE__ */ D(re, {
1163
- size: 14,
1164
- "aria-hidden": !0
1165
- })
1166
- });
1167
- }
1168
- function Be({ groups: t }) {
1169
- let [n, i] = w(""), a = t.filter((e) => e.label.toLowerCase().includes(n.toLowerCase())), o = t.length === 1 && t[0] !== void 0 ? `Filter by ${t[0].label.toLowerCase()}` : "Filters";
1170
- return /* @__PURE__ */ O(c.Root, {
1171
- onOpenChange: (e) => {
1172
- e || i("");
1173
- },
1174
- children: [/* @__PURE__ */ D(c.Trigger, {
1175
- render: /* @__PURE__ */ D(e, {
1176
- "aria-label": o,
1177
- title: "Filters"
1178
- }),
1179
- children: /* @__PURE__ */ D(M, {
1180
- size: 14,
1181
- "aria-hidden": !0
1182
- })
1183
- }), /* @__PURE__ */ D(c.Portal, { children: /* @__PURE__ */ D(c.Positioner, {
1184
- align: "end",
1185
- children: /* @__PURE__ */ O(c.Popup, { children: [
1186
- /* @__PURE__ */ D(Ve, {
1187
- label: "Find a filter",
1188
- value: n,
1189
- onChange: i
1190
- }),
1191
- a.map((e) => /* @__PURE__ */ D(He, { group: e }, e.id)),
1192
- a.length === 0 && /* @__PURE__ */ D("div", {
1193
- className: "x1hmw7ec x5g2kb4",
1194
- children: /* @__PURE__ */ D(r, { children: "No filters found" })
1195
- })
1196
- ] })
1197
- }) })]
1198
- });
1199
- }
1200
- function Ve({ label: e, value: t, onChange: n }) {
1201
- return /* @__PURE__ */ D(g, {
1202
- type: "search",
1203
- "aria-label": e,
1204
- placeholder: "Filter…",
1205
- autoFocus: !0,
1206
- value: t,
1207
- onChange: (e) => n(e.target.value),
1208
- onKeyDown: (e) => {
1209
- (e.key.length === 1 || Re.has(e.key)) && e.stopPropagation();
1210
- },
1211
- xstyle: $.search
1212
- });
1213
- }
1214
- function He({ group: e }) {
1215
- let [t, n] = w(""), i = e.options.filter((e) => e.label.toLowerCase().includes(t.toLowerCase()));
1216
- return /* @__PURE__ */ O(c.SubmenuRoot, {
1217
- onOpenChange: (e) => {
1218
- e || n("");
1219
- },
1220
- children: [/* @__PURE__ */ O(c.SubmenuTrigger, { children: [
1221
- e.icon ?? /* @__PURE__ */ D(M, {
1222
- size: 14,
1223
- "aria-hidden": !0
1224
- }),
1225
- /* @__PURE__ */ D("span", {
1226
- className: "x98rzlu xeuugli xj0a0fe",
1227
- children: e.label
1228
- }),
1229
- /* @__PURE__ */ D("span", {
1230
- className: "xazcve0 xb3r6kr xuxw1ft xlyipyv x153jb6y xy8obcc xas2l8k",
1231
- children: e.options.find((t) => t.value === e.value)?.label
1232
- }),
1233
- /* @__PURE__ */ D(j, {
1234
- size: 14,
1235
- "aria-hidden": !0
1236
- })
1237
- ] }), /* @__PURE__ */ D(c.Portal, { children: /* @__PURE__ */ D(c.Positioner, {
1238
- align: "start",
1239
- children: /* @__PURE__ */ O(c.Popup, {
1240
- "aria-label": e.label,
1241
- children: [
1242
- /* @__PURE__ */ D(Ve, {
1243
- label: `Find ${e.label.toLowerCase()}`,
1244
- value: t,
1245
- onChange: n
1246
- }),
1247
- /* @__PURE__ */ D(c.RadioGroup, {
1248
- value: e.value,
1249
- onValueChange: e.onChange,
1250
- children: i.map((e) => /* @__PURE__ */ O(c.RadioItem, {
1251
- value: e.value,
1252
- closeOnClick: !0,
1253
- children: [/* @__PURE__ */ D(ze, { option: e }), /* @__PURE__ */ D("span", {
1254
- className: "x98rzlu xeuugli xj0a0fe",
1255
- children: e.label
1256
- })]
1257
- }, e.value))
1258
- }),
1259
- i.length === 0 && /* @__PURE__ */ D("div", {
1260
- className: "x1hmw7ec x5g2kb4",
1261
- children: /* @__PURE__ */ D(r, { children: "No options found" })
1262
- })
1263
- ]
1264
- })
1265
- }) })]
1266
- });
1267
- }
1268
- // packages/collections/src/use-collection-controls.tsx
1269
- var Ue = { input: {
1270
- k7Eaqz: "xeuugli",
1271
- kUk6DE: "x98rzlu",
1272
- $$css: !0
1273
- } };
1274
- function We({ search: t, filters: n = [], filterContent: r, chips: i = [], viewActions: a, display: o, isPlaceholder: s = !1, isReady: c }) {
1275
- let [u, d] = w(!1), [f, p] = w(!1), m = C(null), h = C(null), _ = C(null), v = s || !c, ee = t !== void 0 && (u || t.value.length > 0);
1276
- x(() => {
1277
- u && !s && c && (_.current?.focus(), _.current?.select());
1278
- }, [
1279
- u,
1280
- s,
1281
- c
1282
- ]);
1283
- function b() {
1284
- (m.current ?? h.current?.querySelector("button"))?.focus();
1285
- }
1286
- function S() {
1287
- t !== void 0 && !s && c && (_.current?.focus(), _.current?.select(), d(!0));
1288
- }
1289
- function T() {
1290
- t?.onChange(""), d(!1), b();
1291
- }
1292
- function E(e) {
1293
- ee && !e.defaultPrevented && e.key === "Escape" && e.target instanceof Element && e.target.closest("[role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"], [role=\"listbox\"], [data-native-find], input:not([data-view-find]), textarea, select") === null && (e.preventDefault(), e.stopPropagation(), T());
1294
- }
1295
- let k = n.filter((e) => e.value !== e.defaultValue).map((e) => ({
1296
- id: `filter:${e.id}`,
1297
- label: e.options.find((t) => t.value === e.value)?.label ?? e.value,
1298
- onRemove: () => e.onChange(e.defaultValue)
1299
- }));
1300
- for (let e of i) k.push({
1301
- ...e,
1302
- id: `chip:${e.id}`
1303
- });
1304
- let te = r !== void 0 || n.length > 0, ne = y.toArray([a, o]).length > 0, A = t !== void 0 || te || ne, j = t?.label ?? "Search this view", re = t?.placeholder ?? "Find in view…";
1305
- return {
1306
- openSearch: S,
1307
- onKeyDown: E,
1308
- actions: A ? /* @__PURE__ */ O("div", {
1309
- ref: h,
1310
- "aria-hidden": v,
1311
- inert: v,
1312
- className: "x78zum5 x6s0dn4 x1a02dak x13a6bvl x1hnptsi xeuugli x193iq5w",
1313
- children: [
1314
- t !== void 0 && /* @__PURE__ */ D(e, {
1315
- ref: m,
1316
- type: "button",
1317
- disabled: s,
1318
- "aria-label": "Find in view",
1319
- title: "Find in view",
1320
- "data-view-find-trigger": !0,
1321
- "aria-expanded": ee,
1322
- onClick: S,
1323
- children: /* @__PURE__ */ D(N, {
1324
- size: 14,
1325
- "aria-hidden": !0
1326
- })
1327
- }),
1328
- ee && /* @__PURE__ */ O("div", {
1329
- className: "x78zum5 x6s0dn4 xunmzkg xdl07me x193iq5w",
1330
- children: [/* @__PURE__ */ D(g, {
1331
- ref: _,
1332
- type: "search",
1333
- disabled: s,
1334
- "data-view-find": !0,
1335
- "aria-label": j,
1336
- placeholder: re,
1337
- value: t.value,
1338
- onChange: (e) => t.onChange(e.target.value),
1339
- onKeyDown: (e) => {
1340
- e.key === "Enter" && t.onSubmit !== void 0 && (e.preventDefault(), t.onSubmit()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), T());
1341
- },
1342
- xstyle: Ue.input
1343
- }), /* @__PURE__ */ D(e, {
1344
- type: "button",
1345
- variant: "ghost",
1346
- "data-view-find-close": !0,
1347
- "aria-label": "Close search",
1348
- title: "Close search (Esc)",
1349
- onClick: T,
1350
- children: /* @__PURE__ */ D(ie, {
1351
- size: 14,
1352
- "aria-hidden": !0
1353
- })
1354
- })]
1355
- }),
1356
- r === void 0 ? n.length > 0 ? /* @__PURE__ */ D(Be, { groups: n }) : null : /* @__PURE__ */ O(l.Root, {
1357
- open: f,
1358
- onOpenChange: p,
1359
- children: [/* @__PURE__ */ D(l.Trigger, {
1360
- render: /* @__PURE__ */ D(e, {
1361
- "aria-label": "Filters",
1362
- title: "Filters"
1363
- }),
1364
- children: /* @__PURE__ */ D(M, {
1365
- size: 14,
1366
- "aria-hidden": !0
1367
- })
1368
- }), /* @__PURE__ */ D(l.Portal, { children: /* @__PURE__ */ D(l.Positioner, {
1369
- align: "end",
1370
- children: /* @__PURE__ */ O(l.Popup, {
1371
- className: "x1m258z3 xw7nakj",
1372
- children: [/* @__PURE__ */ D(l.Title, { children: "Filters" }), r(() => p(!1))]
1373
- })
1374
- }) })]
1375
- }),
1376
- a,
1377
- o
1378
- ]
1379
- }) : void 0,
1380
- chips: k.length > 0 && /* @__PURE__ */ D("div", {
1381
- "aria-hidden": v,
1382
- inert: v,
1383
- className: "xjp7ctv",
1384
- children: /* @__PURE__ */ D(L, {
1385
- filters: k,
1386
- onRemove: (e) => {
1387
- b(), k.find((t) => t.id === e)?.onRemove();
1388
- }
1389
- })
1390
- })
1391
- };
1392
- }
1393
- export { J as CollectionEnd, Be as CollectionFilters, de as CollectionPagination, Y as CollectionScroll, I as CollectionToolbar, K as DataTable, H as DataTablePlaceholder, W as DataTableText, G as DataTableTextPlaceholder, ke as Details, ue as DisplayOptions, L as FilterChips, Oe as Inspector, Ae as ListFooter, Q as Metric, Me as MetricGrid, Ie as Timeline, Ne as Timestamp, We as useCollectionControls };
1610
+ var ft = {
1611
+ Root: ut,
1612
+ Item: dt
1613
+ };
1614
+ export { $e as CollectionEnd, J as CollectionFilters, z as CollectionPagination, et as CollectionScroll, L as CollectionToolbar, Ge as DataTable, Ve as DataTablePlaceholder, Ue as DataTableText, We as DataTableTextPlaceholder, rt as Details, R as DisplayOptions, he as FilterChips, nt as Inspector, it as ListFooter, ct as Metric, st as MetricGrid, H as TableQueryFrame, ft as Timeline, lt as Timestamp, Te as useCollectionControls, G as useLocalTableQuery };