@mechane-ai/elements 0.20.0 → 0.20.1
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.
- package/README.md +4 -1
- package/dist/{categorical-values-Cf-zlA1u.js → categorical-values-DG0kzYxN.js} +2 -2
- package/dist/{chart-frame-Cf6LBA8M.js → chart-frame-DxAZ0h_q.js} +49 -50
- package/dist/{chart-input-BTDzeBQU.js → chart-input-Dru0GScv.js} +1 -1
- package/dist/charts/cartesian.js +276 -226
- package/dist/charts/distribution.js +2 -2
- package/dist/charts/graph.js +82 -80
- package/dist/charts/hierarchy.js +3 -3
- package/dist/charts/matrix.js +136 -134
- package/dist/charts/timeline.js +1 -1
- package/dist/charts.js +1 -1
- package/dist/code-block-DlUwVaPP.js +182 -0
- package/dist/collections.js +140 -139
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +2 -2
- package/dist/content/markdown.js +108 -102
- package/dist/content/tree.js +41 -39
- package/dist/content.js +138 -136
- package/dist/elements.css +14 -0
- package/dist/layout.js +196 -194
- package/dist/navigation.js +0 -1
- package/dist/packages/charts/src/chart-cursor.d.ts +7 -0
- package/dist/packages/charts/src/chart-theme.d.ts +1 -7
- package/dist/packages/foundations/src/use-scroll-tab-index.d.ts +6 -0
- package/dist/pierre-diff-CHQsoQSZ.js +72 -0
- package/dist/use-scroll-tab-index-Dxpdh4W7.js +45 -0
- package/package.json +1 -1
- package/dist/code-block-D1_kzPrs.js +0 -180
- package/dist/pierre-diff-hAwARDse.js +0 -71
package/dist/collections.js
CHANGED
|
@@ -4,13 +4,14 @@ import { r as o, t as s } from "./src-d7EAi61b.js";
|
|
|
4
4
|
import { d as c } from "./src-0mocxTaR.js";
|
|
5
5
|
import { t as l } from "./accessibility-C-aIZ1Yx.js";
|
|
6
6
|
import { l as u, t as d } from "./constants.stylex-BILvnwUk.js";
|
|
7
|
+
import { t as ee } from "./use-scroll-tab-index-Dxpdh4W7.js";
|
|
7
8
|
import { mergeProps as f } from "@base-ui/react/merge-props";
|
|
8
9
|
import * as p from "@stylexjs/stylex";
|
|
9
|
-
import { Children as m, Fragment as
|
|
10
|
+
import { Children as m, Fragment as te, useEffect as h, useLayoutEffect as g, useMemo as ne, useRef as _, useState as v, useSyncExternalStore as re } from "react";
|
|
10
11
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
-
import { ArrowDown as
|
|
12
|
-
import { createColumnHelper as
|
|
13
|
-
import { defaultRangeExtractor as
|
|
12
|
+
import { ArrowDown as ie, ArrowUp as ae, ArrowUpDown as oe, ChevronLeft as S, ChevronRight as C, Settings2 as w, X as T } from "lucide-react";
|
|
13
|
+
import { createColumnHelper as se, tableFeatures as E, useTable as ce } from "@tanstack/react-table";
|
|
14
|
+
import { defaultRangeExtractor as le, useVirtualizer as ue } from "@tanstack/react-virtual";
|
|
14
15
|
// packages/collections/src/collection-controls.tsx
|
|
15
16
|
var D = { remove: {
|
|
16
17
|
kmuXW: "x2lah0s",
|
|
@@ -83,7 +84,7 @@ function A({ options: t, onChange: n, onReset: r, label: s = "Display options" }
|
|
|
83
84
|
})] })
|
|
84
85
|
}) })] });
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function j({ description: n, previous: r, next: i }) {
|
|
87
88
|
return /* @__PURE__ */ x("nav", {
|
|
88
89
|
"aria-label": "Pagination",
|
|
89
90
|
className: "x78zum5 x6s0dn4 x1qughib x1a02dak xaml1ju xeuugli",
|
|
@@ -125,11 +126,11 @@ function de({ end: e, viewport: t, onEndReached: n, content: r }) {
|
|
|
125
126
|
]);
|
|
126
127
|
}
|
|
127
128
|
// packages/collections/src/data-table.tsx
|
|
128
|
-
var fe = E({}), pe = 76,
|
|
129
|
+
var fe = E({}), pe = 76, M = d.compactTable.slice(7), me = /* @__PURE__ */ new Map([["ArrowUp", -1], ["ArrowDown", 1]]), N = {
|
|
129
130
|
kmVPX3: "x1717udv",
|
|
130
131
|
kMzoRj: "xc342km",
|
|
131
132
|
$$css: !0
|
|
132
|
-
},
|
|
133
|
+
}, P = {
|
|
133
134
|
frame: {
|
|
134
135
|
k7Eaqz: "xeuugli",
|
|
135
136
|
kMv6JI: "x1hz01jw",
|
|
@@ -252,14 +253,14 @@ var fe = E({}), pe = 76, j = d.compactTable.slice(7), me = /* @__PURE__ */ new M
|
|
|
252
253
|
$$css: !0
|
|
253
254
|
},
|
|
254
255
|
spacer: (e) => [
|
|
255
|
-
|
|
256
|
+
N,
|
|
256
257
|
{
|
|
257
258
|
kZKoxP: e == null ? e : "x16ye13r",
|
|
258
259
|
$$css: !0
|
|
259
260
|
},
|
|
260
261
|
{ "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
|
|
261
262
|
]
|
|
262
|
-
},
|
|
263
|
+
}, F = {
|
|
263
264
|
primary: {
|
|
264
265
|
minimumWidth: 240,
|
|
265
266
|
isFlexible: !0,
|
|
@@ -291,63 +292,63 @@ var fe = E({}), pe = 76, j = d.compactTable.slice(7), me = /* @__PURE__ */ new M
|
|
|
291
292
|
shouldTruncate: !1
|
|
292
293
|
}
|
|
293
294
|
}, he = {
|
|
294
|
-
fixed:
|
|
295
|
-
content:
|
|
296
|
-
}, F = {
|
|
297
|
-
primary: N.start,
|
|
298
|
-
text: N.start,
|
|
299
|
-
status: N.start,
|
|
300
|
-
number: N.end,
|
|
301
|
-
timestamp: N.end,
|
|
302
|
-
actions: N.end
|
|
303
|
-
}, ge = {
|
|
304
|
-
content: N.content,
|
|
305
|
-
fill: N.fillFrame
|
|
295
|
+
fixed: P.content,
|
|
296
|
+
content: P.contentCell
|
|
306
297
|
}, I = {
|
|
307
|
-
|
|
308
|
-
|
|
298
|
+
primary: P.start,
|
|
299
|
+
text: P.start,
|
|
300
|
+
status: P.start,
|
|
301
|
+
number: P.end,
|
|
302
|
+
timestamp: P.end,
|
|
303
|
+
actions: P.end
|
|
304
|
+
}, ge = {
|
|
305
|
+
content: P.content,
|
|
306
|
+
fill: P.fillFrame
|
|
307
|
+
}, _e = {
|
|
308
|
+
content: P.content,
|
|
309
|
+
fill: P.fillViewport
|
|
309
310
|
};
|
|
310
|
-
function
|
|
311
|
+
function ve(e) {
|
|
311
312
|
return e.map((e) => {
|
|
312
|
-
let t =
|
|
313
|
+
let t = F[e.role], n = e.width ?? (t.isFlexible ? void 0 : t.minimumWidth);
|
|
313
314
|
return {
|
|
314
315
|
...e,
|
|
315
316
|
...n === void 0 ? {} : { width: n }
|
|
316
317
|
};
|
|
317
318
|
});
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
+
function ye(e, t = 0) {
|
|
320
321
|
return {
|
|
321
|
-
minimumWidth: e.reduce((e, t) => e + (t.width ??
|
|
322
|
-
compactWidth: e.filter((e) => e.isSecondary !== !0).reduce((e, t) => e + (t.width ??
|
|
322
|
+
minimumWidth: e.reduce((e, t) => e + (t.width ?? F[t.role].minimumWidth), t),
|
|
323
|
+
compactWidth: e.filter((e) => e.isSecondary !== !0).reduce((e, t) => e + (t.width ?? F[t.role].minimumWidth), t)
|
|
323
324
|
};
|
|
324
325
|
}
|
|
325
|
-
function
|
|
326
|
-
let t = globalThis.matchMedia(
|
|
326
|
+
function be(e) {
|
|
327
|
+
let t = globalThis.matchMedia(M);
|
|
327
328
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
328
329
|
}
|
|
329
|
-
function
|
|
330
|
-
return globalThis.matchMedia(
|
|
330
|
+
function xe() {
|
|
331
|
+
return globalThis.matchMedia(M).matches;
|
|
331
332
|
}
|
|
332
|
-
function
|
|
333
|
-
return /* @__PURE__ */ x("colgroup", { children: [t && /* @__PURE__ */ b("col", { className: "x1d7z9mz xeuugli x1dc62k6" }), e.map((e) => /* @__PURE__ */ b("col", { ...p.props(e.width !== void 0 &&
|
|
333
|
+
function Se({ columns: e, canSelect: t = !1 }) {
|
|
334
|
+
return /* @__PURE__ */ x("colgroup", { children: [t && /* @__PURE__ */ b("col", { className: "x1d7z9mz xeuugli x1dc62k6" }), e.map((e) => /* @__PURE__ */ b("col", { ...p.props(e.width !== void 0 && P.width(e.width), e.isSecondary === !0 && P.secondary) }, e.id))] });
|
|
334
335
|
}
|
|
335
|
-
function
|
|
336
|
-
let i =
|
|
336
|
+
function L({ columns: e, sizing: t = "content", rowSizing: n = "fixed", hideHeaders: r = !1 }) {
|
|
337
|
+
let i = ve(e), { minimumWidth: a, compactWidth: o } = ye(i);
|
|
337
338
|
return /* @__PURE__ */ b("div", {
|
|
338
339
|
"aria-hidden": !0,
|
|
339
340
|
inert: !0,
|
|
340
|
-
...p.props(
|
|
341
|
+
...p.props(P.frame, ge[t], P.placeholder),
|
|
341
342
|
children: /* @__PURE__ */ b("div", {
|
|
342
|
-
...p.props(
|
|
343
|
+
...p.props(P.viewport, _e[t]),
|
|
343
344
|
children: /* @__PURE__ */ x("table", {
|
|
344
|
-
...p.props(
|
|
345
|
+
...p.props(P.table, P.fixed, P.minimumWidth(a, o)),
|
|
345
346
|
children: [
|
|
346
|
-
/* @__PURE__ */ b(
|
|
347
|
+
/* @__PURE__ */ b(Se, { columns: i }),
|
|
347
348
|
/* @__PURE__ */ b("thead", {
|
|
348
349
|
...p.props(r && l.hidden),
|
|
349
350
|
children: /* @__PURE__ */ b("tr", { children: i.map((e) => /* @__PURE__ */ b("th", {
|
|
350
|
-
...p.props(
|
|
351
|
+
...p.props(P.header, I[e.role], e.width !== void 0 && P.width(e.width), e.isSecondary === !0 && P.secondary),
|
|
351
352
|
children: /* @__PURE__ */ b("span", {
|
|
352
353
|
className: "x1lliihq xeuugli xb3r6kr xlyipyv xuxw1ft",
|
|
353
354
|
children: e.label
|
|
@@ -361,8 +362,8 @@ function z({ columns: e, sizing: t = "content", rowSizing: n = "fixed", hideHead
|
|
|
361
362
|
].map((e) => /* @__PURE__ */ b("tr", {
|
|
362
363
|
className: "x1n2onr6 xc8icb0 x1wtzb06 xso031l x1q0q8m5 x1qndepd x19k386i x1t1lzn6",
|
|
363
364
|
children: i.map((e) => /* @__PURE__ */ b("td", {
|
|
364
|
-
...p.props(
|
|
365
|
-
children: /* @__PURE__ */ b(
|
|
365
|
+
...p.props(P.cell, he[n], I[e.role], e.width !== void 0 && P.width(e.width), e.isSecondary === !0 && P.secondary),
|
|
366
|
+
children: /* @__PURE__ */ b(H, {
|
|
366
367
|
role: e.role,
|
|
367
368
|
isFixed: n === "fixed",
|
|
368
369
|
shouldTruncate: void 0,
|
|
@@ -375,7 +376,7 @@ function z({ columns: e, sizing: t = "content", rowSizing: n = "fixed", hideHead
|
|
|
375
376
|
})
|
|
376
377
|
});
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
+
function R({ children: e, leading: t, isDecorative: n = !1 }) {
|
|
379
380
|
return /* @__PURE__ */ x("span", {
|
|
380
381
|
"aria-hidden": n || void 0,
|
|
381
382
|
inert: n || void 0,
|
|
@@ -390,8 +391,8 @@ function B({ children: e, leading: t, isDecorative: n = !1 }) {
|
|
|
390
391
|
})]
|
|
391
392
|
});
|
|
392
393
|
}
|
|
393
|
-
function
|
|
394
|
-
return /* @__PURE__ */ x(
|
|
394
|
+
function z({ children: e, secondary: t, leading: n, trailing: r }) {
|
|
395
|
+
return /* @__PURE__ */ x(R, {
|
|
395
396
|
leading: n,
|
|
396
397
|
children: [/* @__PURE__ */ x("span", {
|
|
397
398
|
className: "x78zum5 x6s0dn4 x1hnptsi xeuugli",
|
|
@@ -410,8 +411,8 @@ function V({ children: e, secondary: t, leading: n, trailing: r }) {
|
|
|
410
411
|
})]
|
|
411
412
|
});
|
|
412
413
|
}
|
|
413
|
-
function
|
|
414
|
-
return /* @__PURE__ */ x(
|
|
414
|
+
function B({ leading: e, isSecondary: t = !1 }) {
|
|
415
|
+
return /* @__PURE__ */ x(R, {
|
|
415
416
|
leading: e,
|
|
416
417
|
isDecorative: !0,
|
|
417
418
|
children: [/* @__PURE__ */ b("span", {
|
|
@@ -423,77 +424,77 @@ function H({ leading: e, isSecondary: t = !1 }) {
|
|
|
423
424
|
})]
|
|
424
425
|
});
|
|
425
426
|
}
|
|
426
|
-
function
|
|
427
|
-
let A =
|
|
428
|
-
let e =
|
|
427
|
+
function V({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, onSortChange: s, selectedIds: c, onSelectionChange: d, selectionLabel: f, rowAction: m, activeRowId: y, focusRowId: S, hideCaption: C = !1, hideHeaders: w = !1, rowSizing: T = "fixed", window: E, endContent: D, onEndReached: O, footer: k }) {
|
|
428
|
+
let A = ne(() => ve(t), [t]), j = re(be, xe, () => !1), M = ne(() => {
|
|
429
|
+
let e = se();
|
|
429
430
|
return e.columns(A.map((t) => e.display({
|
|
430
431
|
id: t.id,
|
|
431
432
|
header: t.label
|
|
432
433
|
})));
|
|
433
|
-
}, [A]),
|
|
434
|
+
}, [A]), N = ce({
|
|
434
435
|
features: fe,
|
|
435
|
-
columns:
|
|
436
|
+
columns: M,
|
|
436
437
|
data: e,
|
|
437
438
|
getRowId: n
|
|
438
|
-
}),
|
|
439
|
+
}), F = ee(), L = F.viewport, R = _(null), z = _(null), B = _(null), [V, U] = v(0), [we, W] = v(), G = _(void 0), K = _(void 0), q = e.findIndex((e) => n(e) === we), J = A.findIndex((e) => e.role === "primary" && e.isSecondary !== !0), Y = J === -1 ? A.findIndex((e) => e.isSecondary !== !0) : J, X = typeof E?.height == "string" ? E.height : "content";
|
|
439
440
|
g(() => {
|
|
440
441
|
if (S === void 0) {
|
|
441
|
-
|
|
442
|
+
K.current = void 0;
|
|
442
443
|
return;
|
|
443
444
|
}
|
|
444
|
-
if (
|
|
445
|
-
let e =
|
|
445
|
+
if (K.current === S) return;
|
|
446
|
+
let e = L.current?.querySelector(`[data-row-id="${CSS.escape(S)}"] [data-row-action]`);
|
|
446
447
|
if (e == null) return;
|
|
447
448
|
let t = requestAnimationFrame(() => {
|
|
448
|
-
e.focus({ preventScroll: !0 }),
|
|
449
|
+
e.focus({ preventScroll: !0 }), K.current = S;
|
|
449
450
|
});
|
|
450
451
|
return () => cancelAnimationFrame(t);
|
|
451
452
|
}, [e, S]), de({
|
|
452
|
-
end:
|
|
453
|
+
end: R,
|
|
453
454
|
onEndReached: E === void 0 ? O : void 0,
|
|
454
455
|
content: e.length
|
|
455
456
|
}), h(() => {
|
|
456
|
-
let e =
|
|
457
|
+
let e = z.current, t = B.current;
|
|
457
458
|
if (E === void 0 || e === null || t === null) return;
|
|
458
|
-
let n = new ResizeObserver(() =>
|
|
459
|
+
let n = new ResizeObserver(() => U(e.offsetHeight + t.offsetHeight));
|
|
459
460
|
return n.observe(e), n.observe(t), () => n.disconnect();
|
|
460
461
|
}, [
|
|
461
462
|
E,
|
|
462
463
|
C,
|
|
463
464
|
w
|
|
464
465
|
]);
|
|
465
|
-
let Z =
|
|
466
|
+
let Z = ue({
|
|
466
467
|
count: e.length,
|
|
467
468
|
enabled: E !== void 0,
|
|
468
|
-
getScrollElement: () =>
|
|
469
|
+
getScrollElement: () => L.current,
|
|
469
470
|
getItemKey: (t) => {
|
|
470
471
|
let r = e[t];
|
|
471
472
|
if (r === void 0) throw RangeError("The virtual row is outside the supplied table page.");
|
|
472
473
|
return n(r);
|
|
473
474
|
},
|
|
474
475
|
estimateSize: () => T === "fixed" ? u.rowHeight : E?.estimatedRowHeight ?? u.rowHeight,
|
|
475
|
-
scrollMargin:
|
|
476
|
-
scrollPaddingStart:
|
|
476
|
+
scrollMargin: V,
|
|
477
|
+
scrollPaddingStart: V,
|
|
477
478
|
overscan: 6,
|
|
478
479
|
rangeExtractor: (t) => {
|
|
479
|
-
let n =
|
|
480
|
-
return
|
|
480
|
+
let n = le(t);
|
|
481
|
+
return q === -1 ? n : [.../* @__PURE__ */ new Set([
|
|
481
482
|
...n,
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
483
|
+
q - 1,
|
|
484
|
+
q,
|
|
485
|
+
q + 1
|
|
485
486
|
])].filter((t) => t >= 0 && t < e.length).toSorted((e, t) => e - t);
|
|
486
487
|
}
|
|
487
|
-
}),
|
|
488
|
+
}), Te = E === void 0 ? N.getRowModel().rows.map((e, t) => ({
|
|
488
489
|
row: e,
|
|
489
490
|
index: t,
|
|
490
491
|
spacerHeight: 0
|
|
491
492
|
})) : Z.getVirtualItems().flatMap((e, t, n) => {
|
|
492
|
-
let r =
|
|
493
|
+
let r = N.getRowModel().rows[e.index];
|
|
493
494
|
return r === void 0 ? [] : [{
|
|
494
495
|
row: r,
|
|
495
496
|
index: e.index,
|
|
496
|
-
spacerHeight: e.start - (n[t - 1]?.end ??
|
|
497
|
+
spacerHeight: e.start - (n[t - 1]?.end ?? V)
|
|
497
498
|
}];
|
|
498
499
|
}), Q = E !== void 0 && (e.length === 0 || Z.range?.endIndex === e.length - 1);
|
|
499
500
|
h(() => {
|
|
@@ -503,43 +504,43 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
503
504
|
O,
|
|
504
505
|
e.length
|
|
505
506
|
]), g(() => {
|
|
506
|
-
if (
|
|
507
|
-
let e = Array.from(
|
|
508
|
-
e != null && (e.focus({ preventScroll: E !== void 0 }),
|
|
507
|
+
if (G.current === void 0) return;
|
|
508
|
+
let e = Array.from(L.current?.querySelectorAll("[data-row-id]") ?? []).find((e) => e.dataset.rowId === G.current)?.querySelector("[data-row-action]");
|
|
509
|
+
e != null && (e.focus({ preventScroll: E !== void 0 }), G.current = void 0);
|
|
509
510
|
});
|
|
510
|
-
function
|
|
511
|
+
function Ee(t, r) {
|
|
511
512
|
let i = t.metaKey || t.ctrlKey, a = t.altKey || t.shiftKey;
|
|
512
513
|
if (i || a) return;
|
|
513
514
|
let o = me.get(t.key);
|
|
514
515
|
if (o === void 0) return;
|
|
515
516
|
t.preventDefault();
|
|
516
517
|
let s = r + o, c = e[s];
|
|
517
|
-
c !== void 0 && (
|
|
518
|
+
c !== void 0 && (G.current = n(c), W(G.current), E !== void 0 && Z.scrollToIndex(s, { align: "auto" }));
|
|
518
519
|
}
|
|
519
|
-
let $ = A.filter((e) => !
|
|
520
|
+
let $ = A.filter((e) => !j || e.isSecondary !== !0).length + (c === void 0 ? 0 : 1), De = c === void 0 ? 0 : pe, Oe = k != null && typeof k != "boolean", { minimumWidth: ke, compactWidth: Ae } = ye(A, De), je = Z.getTotalSize() - (Z.getVirtualItems().at(-1)?.end ?? V) + V;
|
|
520
521
|
return /* @__PURE__ */ x("div", {
|
|
521
|
-
...p.props(
|
|
522
|
+
...p.props(P.frame, ge[X]),
|
|
522
523
|
children: [/* @__PURE__ */ x("div", {
|
|
523
|
-
ref:
|
|
524
|
+
ref: F.ref,
|
|
524
525
|
role: "region",
|
|
525
526
|
"aria-label": r,
|
|
526
|
-
tabIndex:
|
|
527
|
-
...p.props(
|
|
527
|
+
tabIndex: F.tabIndex,
|
|
528
|
+
...p.props(P.viewport, _e[X], typeof E?.height == "number" && P.virtual(E.height)),
|
|
528
529
|
children: [/* @__PURE__ */ x("table", {
|
|
529
530
|
"aria-rowcount": E === void 0 ? void 0 : Math.max(1, e.length) + 1,
|
|
530
|
-
...p.props(
|
|
531
|
+
...p.props(P.table, P.fixed, P.minimumWidth(ke, Ae)),
|
|
531
532
|
children: [
|
|
532
533
|
/* @__PURE__ */ b("caption", {
|
|
533
|
-
ref:
|
|
534
|
-
...p.props(
|
|
534
|
+
ref: z,
|
|
535
|
+
...p.props(P.caption, C && l.hidden),
|
|
535
536
|
children: r
|
|
536
537
|
}),
|
|
537
|
-
/* @__PURE__ */ b(
|
|
538
|
+
/* @__PURE__ */ b(Se, {
|
|
538
539
|
columns: A,
|
|
539
540
|
canSelect: c !== void 0
|
|
540
541
|
}),
|
|
541
542
|
/* @__PURE__ */ b("thead", {
|
|
542
|
-
ref:
|
|
543
|
+
ref: B,
|
|
543
544
|
...p.props(w && l.hidden),
|
|
544
545
|
children: /* @__PURE__ */ x("tr", { children: [c !== void 0 && /* @__PURE__ */ b("th", {
|
|
545
546
|
scope: "col",
|
|
@@ -554,7 +555,7 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
554
555
|
scope: "col",
|
|
555
556
|
title: e.label,
|
|
556
557
|
"aria-sort": t,
|
|
557
|
-
...p.props(
|
|
558
|
+
...p.props(P.header, I[e.role], e.width !== void 0 && P.width(e.width), e.isSecondary === !0 && P.secondary),
|
|
558
559
|
children: e.canSort === !0 && s !== void 0 ? /* @__PURE__ */ x("button", {
|
|
559
560
|
type: "button",
|
|
560
561
|
className: "x3nfvp2 x6s0dn4 x1hnptsi x193iq5w xeuugli x2zujid x17oiadl x1717udv xc342km x1heor9g xjbqb8w xjb2p0i x1qlqyl8 x1pd3egz x15bjb6t x1ypdohk xp9636p x1s9zmfe x13qnu6 x9v5kkp x19rmrnh x7s97pk",
|
|
@@ -570,7 +571,7 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
570
571
|
children: [/* @__PURE__ */ b("span", {
|
|
571
572
|
className: "x1lliihq xeuugli xb3r6kr xlyipyv xuxw1ft",
|
|
572
573
|
children: e.label
|
|
573
|
-
}), b(t === "ascending" ?
|
|
574
|
+
}), b(t === "ascending" ? ae : t === "descending" ? ie : oe, {
|
|
574
575
|
size: 14,
|
|
575
576
|
"aria-hidden": "true",
|
|
576
577
|
className: "x2lah0s"
|
|
@@ -584,21 +585,21 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
584
585
|
}),
|
|
585
586
|
/* @__PURE__ */ x("tbody", {
|
|
586
587
|
onBlur: (e) => {
|
|
587
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
588
|
+
e.currentTarget.contains(e.relatedTarget) || W(void 0);
|
|
588
589
|
},
|
|
589
590
|
children: [
|
|
590
|
-
|
|
591
|
+
Te.map(({ row: e, index: t, spacerHeight: n }) => /* @__PURE__ */ x(te, { children: [n > 0 && /* @__PURE__ */ b("tr", {
|
|
591
592
|
"aria-hidden": "true",
|
|
592
593
|
children: /* @__PURE__ */ b("td", {
|
|
593
594
|
colSpan: $,
|
|
594
|
-
...p.props(
|
|
595
|
+
...p.props(P.spacer(n))
|
|
595
596
|
})
|
|
596
597
|
}), /* @__PURE__ */ x("tr", {
|
|
597
598
|
"data-index": t,
|
|
598
599
|
"data-row-id": e.id,
|
|
599
600
|
"aria-rowindex": E === void 0 ? void 0 : t + 2,
|
|
600
601
|
ref: E === void 0 || T === "fixed" ? void 0 : Z.measureElement,
|
|
601
|
-
onFocus: () =>
|
|
602
|
+
onFocus: () => W(e.id),
|
|
602
603
|
...{
|
|
603
604
|
0: { className: "x1n2onr6 xc8icb0 x1wtzb06 xso031l x1q0q8m5 x1qndepd x19k386i x1t1lzn6" },
|
|
604
605
|
2: { className: "x1n2onr6 xc8icb0 x1wtzb06 xso031l x1q0q8m5 x1qndepd x19k386i x1t1lzn6 x1ypdohk x1ecmtor" },
|
|
@@ -617,19 +618,19 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
617
618
|
children: /* @__PURE__ */ b(a.Indicator, {})
|
|
618
619
|
})
|
|
619
620
|
}), A.map((n, r) => /* @__PURE__ */ b("td", {
|
|
620
|
-
...p.props(
|
|
621
|
-
children: m !== void 0 && r ===
|
|
621
|
+
...p.props(P.cell, he[T], I[n.role], n.width !== void 0 && P.width(n.width), n.isSecondary === !0 && P.secondary),
|
|
622
|
+
children: m !== void 0 && r === Y ? /* @__PURE__ */ b(Ce, {
|
|
622
623
|
row: e.original,
|
|
623
624
|
action: m,
|
|
624
625
|
isActive: y === e.id,
|
|
625
|
-
onKeyDown: (e) =>
|
|
626
|
-
children: /* @__PURE__ */ b(
|
|
626
|
+
onKeyDown: (e) => Ee(e, t),
|
|
627
|
+
children: /* @__PURE__ */ b(H, {
|
|
627
628
|
role: n.role,
|
|
628
629
|
isFixed: T === "fixed",
|
|
629
630
|
shouldTruncate: n.shouldTruncate,
|
|
630
631
|
children: n.cell(e.original)
|
|
631
632
|
})
|
|
632
|
-
}) : /* @__PURE__ */ b(
|
|
633
|
+
}) : /* @__PURE__ */ b(H, {
|
|
633
634
|
role: n.role,
|
|
634
635
|
isFixed: T === "fixed",
|
|
635
636
|
shouldTruncate: n.shouldTruncate,
|
|
@@ -637,11 +638,11 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
637
638
|
})
|
|
638
639
|
}, n.id))]
|
|
639
640
|
})] }, e.id)),
|
|
640
|
-
E !== void 0 &&
|
|
641
|
+
E !== void 0 && je > 0 && /* @__PURE__ */ b("tr", {
|
|
641
642
|
"aria-hidden": "true",
|
|
642
643
|
children: /* @__PURE__ */ b("td", {
|
|
643
644
|
colSpan: $,
|
|
644
|
-
...p.props(
|
|
645
|
+
...p.props(P.spacer(je))
|
|
645
646
|
})
|
|
646
647
|
}),
|
|
647
648
|
e.length === 0 && /* @__PURE__ */ b("tr", { children: /* @__PURE__ */ b("td", {
|
|
@@ -653,21 +654,21 @@ function be({ rows: e, columns: t, getRowId: n, caption: r, empty: i, sort: o, o
|
|
|
653
654
|
})
|
|
654
655
|
]
|
|
655
656
|
}), /* @__PURE__ */ b("div", {
|
|
656
|
-
ref:
|
|
657
|
+
ref: R,
|
|
657
658
|
...{
|
|
658
659
|
0: {},
|
|
659
660
|
1: { className: "xid9utz xg7ukam x153jb6y xy8obcc xas2l8k x15x95ik x1az1eml" }
|
|
660
661
|
}[D !== void 0 | 0],
|
|
661
662
|
children: D
|
|
662
663
|
})]
|
|
663
|
-
}),
|
|
664
|
+
}), Oe && /* @__PURE__ */ b("div", {
|
|
664
665
|
className: "xg7ukam x178xt8z x13fuv20 xhjagg4",
|
|
665
666
|
children: k
|
|
666
667
|
})]
|
|
667
668
|
});
|
|
668
669
|
}
|
|
669
|
-
function
|
|
670
|
-
let i =
|
|
670
|
+
function H({ role: e, isFixed: t, shouldTruncate: n, children: r }) {
|
|
671
|
+
let i = F[e], a = t && i.shouldTruncate, o = typeof r == "string" && (n ?? a);
|
|
671
672
|
return /* @__PURE__ */ b("span", {
|
|
672
673
|
...{
|
|
673
674
|
0: { className: "x78zum5 x6s0dn4 xeuugli xh8yej3 xw3im37" },
|
|
@@ -689,12 +690,12 @@ function U({ role: e, isFixed: t, shouldTruncate: n, children: r }) {
|
|
|
689
690
|
})
|
|
690
691
|
});
|
|
691
692
|
}
|
|
692
|
-
function
|
|
693
|
+
function U(e) {
|
|
693
694
|
if (e.defaultPrevented || e.button !== 0) return !1;
|
|
694
695
|
let t = e.metaKey || e.ctrlKey, n = e.altKey || e.shiftKey;
|
|
695
696
|
return t || n ? !1 : e.detail === 0 || e.currentTarget.ownerDocument.getSelection()?.isCollapsed !== !1;
|
|
696
697
|
}
|
|
697
|
-
function
|
|
698
|
+
function Ce({ row: e, action: t, isActive: n, children: r, onKeyDown: i }) {
|
|
698
699
|
let a = t.label?.(e), o = t.href === void 0 ? /* @__PURE__ */ b("button", {
|
|
699
700
|
type: "button",
|
|
700
701
|
"aria-label": a,
|
|
@@ -702,7 +703,7 @@ function xe({ row: e, action: t, isActive: n, children: r, onKeyDown: i }) {
|
|
|
702
703
|
"data-row-action": !0,
|
|
703
704
|
onKeyDown: i,
|
|
704
705
|
onClick: (n) => {
|
|
705
|
-
|
|
706
|
+
U(n) && t.onActivate(e);
|
|
706
707
|
},
|
|
707
708
|
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",
|
|
708
709
|
children: r
|
|
@@ -712,7 +713,7 @@ function xe({ row: e, action: t, isActive: n, children: r, onKeyDown: i }) {
|
|
|
712
713
|
"data-row-action": !0,
|
|
713
714
|
onKeyDown: i,
|
|
714
715
|
onClick: (n) => {
|
|
715
|
-
t.onActivate !== void 0 &&
|
|
716
|
+
t.onActivate !== void 0 && U(n) && (n.preventDefault(), t.onActivate(e));
|
|
716
717
|
},
|
|
717
718
|
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",
|
|
718
719
|
children: r
|
|
@@ -724,7 +725,7 @@ function xe({ row: e, action: t, isActive: n, children: r, onKeyDown: i }) {
|
|
|
724
725
|
}) })] });
|
|
725
726
|
}
|
|
726
727
|
// packages/collections/src/collection-scroll.tsx
|
|
727
|
-
function
|
|
728
|
+
function we(r) {
|
|
728
729
|
switch (r.status) {
|
|
729
730
|
case "loading": return /* @__PURE__ */ b(t, {
|
|
730
731
|
role: "status",
|
|
@@ -754,16 +755,16 @@ function G(r) {
|
|
|
754
755
|
});
|
|
755
756
|
}
|
|
756
757
|
}
|
|
757
|
-
function
|
|
758
|
-
let o =
|
|
758
|
+
function W({ children: e, endContent: t, onEndReached: n, shouldFill: r = !1, endPosition: i = "end", label: a = "Collection" }) {
|
|
759
|
+
let o = ee(), s = o.viewport, c = _(null);
|
|
759
760
|
de({
|
|
760
|
-
end:
|
|
761
|
-
viewport: r ?
|
|
761
|
+
end: c,
|
|
762
|
+
viewport: r ? s : void 0,
|
|
762
763
|
onEndReached: n,
|
|
763
764
|
content: e
|
|
764
765
|
});
|
|
765
|
-
let
|
|
766
|
-
ref:
|
|
766
|
+
let l = /* @__PURE__ */ b("div", {
|
|
767
|
+
ref: c,
|
|
767
768
|
...{
|
|
768
769
|
0: {},
|
|
769
770
|
1: { className: "x15x95ik x1az1eml xid9utz x1c8xbx5 x153jb6y xy8obcc x1hz01jw xas2l8k x2b8uid" }
|
|
@@ -771,27 +772,27 @@ function K({ children: e, endContent: t, onEndReached: n, shouldFill: r = !1, en
|
|
|
771
772
|
children: t
|
|
772
773
|
});
|
|
773
774
|
return /* @__PURE__ */ x("div", {
|
|
774
|
-
ref: o,
|
|
775
|
+
ref: o.ref,
|
|
775
776
|
role: r ? "region" : void 0,
|
|
776
777
|
"aria-label": r ? a : void 0,
|
|
777
|
-
tabIndex:
|
|
778
|
+
tabIndex: o.tabIndex,
|
|
778
779
|
...{
|
|
779
780
|
0: { className: "xeuugli" },
|
|
780
781
|
1: { className: "xeuugli x98rzlu x2lwn1j x1odjw0f x1e4zzel x1t137rt x13qnu6 x9v5kkp x19rmrnh x1bqaal" }
|
|
781
782
|
}[!!r | 0],
|
|
782
783
|
children: [
|
|
783
|
-
i === "start" &&
|
|
784
|
+
i === "start" && l,
|
|
784
785
|
e,
|
|
785
|
-
i === "end" &&
|
|
786
|
+
i === "end" && l
|
|
786
787
|
]
|
|
787
788
|
});
|
|
788
789
|
}
|
|
789
790
|
// packages/collections/src/inspector.tsx
|
|
790
|
-
var
|
|
791
|
-
function
|
|
791
|
+
var G = 860;
|
|
792
|
+
function K({ master: t, detail: n, label: r, masterLabel: i, revealKey: a, returnFocusRef: o, ...s }) {
|
|
792
793
|
let c = _(null), l = _(null), u = _(null);
|
|
793
794
|
g(() => {
|
|
794
|
-
a !== void 0 && c.current !== null && u.current !== null && c.current.clientWidth <=
|
|
795
|
+
a !== void 0 && c.current !== null && u.current !== null && c.current.clientWidth <= G && (u.current.focus({ preventScroll: !0 }), u.current.scrollIntoView({
|
|
795
796
|
block: "start",
|
|
796
797
|
behavior: "instant"
|
|
797
798
|
}));
|
|
@@ -832,7 +833,7 @@ function J({ master: t, detail: n, label: r, masterLabel: i, revealKey: a, retur
|
|
|
832
833
|
})
|
|
833
834
|
});
|
|
834
835
|
}
|
|
835
|
-
function
|
|
836
|
+
function q({ items: e, ...t }) {
|
|
836
837
|
return /* @__PURE__ */ b("dl", {
|
|
837
838
|
...f({ className: "x1ghz6dp xrvj5dj xezdspq x1i3977y xuytk5h x1hz01jw xvmahel xtqrqnz x1778rvt" }, t),
|
|
838
839
|
children: e.map(({ label: e, value: t }) => /* @__PURE__ */ x("div", {
|
|
@@ -848,7 +849,7 @@ function Y({ items: e, ...t }) {
|
|
|
848
849
|
});
|
|
849
850
|
}
|
|
850
851
|
// packages/collections/src/list-footer.tsx
|
|
851
|
-
function
|
|
852
|
+
function J({ children: e, actions: t, ...n }) {
|
|
852
853
|
return /* @__PURE__ */ x("div", {
|
|
853
854
|
...f({ className: "x78zum5 x6s0dn4 x1qughib x1a02dak xeuugli x1n8ia3y x1qokhjc x1m92p3w x178xt8z x13fuv20 xhjagg4 x153jb6y x1hz01jw xvmahel xtqrqnz x1778rvt" }, n),
|
|
854
855
|
children: [/* @__PURE__ */ b("div", {
|
|
@@ -861,7 +862,7 @@ function Se({ children: e, actions: t, ...n }) {
|
|
|
861
862
|
});
|
|
862
863
|
}
|
|
863
864
|
// packages/collections/src/metrics.tsx
|
|
864
|
-
var
|
|
865
|
+
var Y = {
|
|
865
866
|
grid: {
|
|
866
867
|
k1xSpc: "x78zum5",
|
|
867
868
|
kwnvtZ: "x1a02dak",
|
|
@@ -879,14 +880,14 @@ var X = {
|
|
|
879
880
|
kogj98: "x1ghz6dp",
|
|
880
881
|
$$css: !0
|
|
881
882
|
}
|
|
882
|
-
},
|
|
883
|
-
inline:
|
|
884
|
-
columns:
|
|
883
|
+
}, X = {
|
|
884
|
+
inline: Y.grid,
|
|
885
|
+
columns: Y.columns
|
|
885
886
|
};
|
|
886
|
-
function
|
|
887
|
-
return /* @__PURE__ */ b("dl", { ...f(p.props(
|
|
887
|
+
function Z({ layout: e = "inline", ...t }) {
|
|
888
|
+
return /* @__PURE__ */ b("dl", { ...f(p.props(X[e]), t) });
|
|
888
889
|
}
|
|
889
|
-
function
|
|
890
|
+
function Te({ label: e, value: t, ...n }) {
|
|
890
891
|
return /* @__PURE__ */ x("div", {
|
|
891
892
|
...f({ className: "x3nfvp2 x1pha0wt x1a02dak xunmzkg xeuugli x1hz01jw xvmahel xtqrqnz x1778rvt" }, n),
|
|
892
893
|
children: [/* @__PURE__ */ b("dt", {
|
|
@@ -899,7 +900,7 @@ function Q({ label: e, value: t, ...n }) {
|
|
|
899
900
|
});
|
|
900
901
|
}
|
|
901
902
|
// packages/collections/src/timestamp.tsx
|
|
902
|
-
function
|
|
903
|
+
function Q({ dateTime: e, label: t, title: n }) {
|
|
903
904
|
return n === void 0 ? /* @__PURE__ */ b("time", {
|
|
904
905
|
dateTime: e,
|
|
905
906
|
className: "x1hz01jw xy8obcc xas2l8k x153jb6y xss6m8b xj0a0fe x13qnu6 x9v5kkp x19rmrnh x7s97pk",
|
|
@@ -915,14 +916,14 @@ function we({ dateTime: e, label: t, title: n }) {
|
|
|
915
916
|
}), /* @__PURE__ */ b(s.Portal, { children: /* @__PURE__ */ b(s.Positioner, { children: /* @__PURE__ */ b(s.Popup, { children: n }) }) })] });
|
|
916
917
|
}
|
|
917
918
|
// packages/collections/src/timeline.tsx
|
|
918
|
-
function
|
|
919
|
+
function Ee({ label: e, children: t }) {
|
|
919
920
|
return /* @__PURE__ */ b("ol", {
|
|
920
921
|
"aria-label": e,
|
|
921
922
|
className: "xe8uvvx x1ghz6dp x1717udv xeuugli",
|
|
922
923
|
children: t
|
|
923
924
|
});
|
|
924
925
|
}
|
|
925
|
-
function
|
|
926
|
+
function $({ icon: e, title: t, time: n, metadata: i, children: a, details: o, defaultOpen: s = !1 }) {
|
|
926
927
|
let [c, l] = v(s), u = /* @__PURE__ */ x("div", {
|
|
927
928
|
className: "x78zum5 x1pha0wt x1hnptsi x1a02dak xeuugli",
|
|
928
929
|
children: [/* @__PURE__ */ b("div", {
|
|
@@ -964,8 +965,8 @@ function Te({ icon: e, title: t, time: n, metadata: i, children: a, details: o,
|
|
|
964
965
|
})]
|
|
965
966
|
});
|
|
966
967
|
}
|
|
967
|
-
var
|
|
968
|
-
Root:
|
|
969
|
-
Item:
|
|
968
|
+
var De = {
|
|
969
|
+
Root: Ee,
|
|
970
|
+
Item: $
|
|
970
971
|
};
|
|
971
|
-
export {
|
|
972
|
+
export { we as CollectionEnd, j as CollectionPagination, W as CollectionScroll, O as CollectionToolbar, V as DataTable, L as DataTablePlaceholder, z as DataTableText, B as DataTableTextPlaceholder, q as Details, A as DisplayOptions, k as FilterChips, K as Inspector, J as ListFooter, Te as Metric, Z as MetricGrid, De as Timeline, Q as Timestamp };
|
package/dist/content/code.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as CodeBlock } from "../code-block-
|
|
1
|
+
export { t as CodeBlock } from "../code-block-DlUwVaPP.js";
|