basalt-ui 2.27.1 → 2.28.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.
- package/CHANGELOG.md +111 -0
- package/MIGRATING.md +172 -12
- package/agent/rules/basalt-batteries.md +1 -1
- package/agent/rules/basalt-mantine.md +1 -1
- package/agent/rules/basalt-tokens.md +2 -2
- package/agent/skills/basalt-design/SKILL.md +1 -1
- package/agent/skills/basalt-design/references/catalogue.md +40 -36
- package/agent/skills/basalt-design/references/recipes.md +47 -0
- package/configs/oxlint-basalt.json +2 -1
- package/configs/oxlint-plugin.js +110 -2
- package/configs/oxlint-plugin.test.ts +99 -4
- package/dist/agent/chat/thread-message.d.ts +1 -160
- package/dist/agent/chat/thread-message.d.ts.map +1 -1
- package/dist/agent/chat/thread-message.js +7 -162
- package/dist/agent/chat/virtualize.d.ts +5 -5
- package/dist/charts/ChartCard.d.ts +5 -2
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +46 -13
- package/dist/charts/Lines.d.ts.map +1 -1
- package/dist/charts/Lines.js +11 -4
- package/dist/charts/Sparkline.d.ts +9 -2
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +104 -41
- package/dist/charts/chart-box.module.css +69 -3
- package/dist/charts/chart-box.module.css.d.ts +5 -0
- package/dist/charts/chart-card.module.css +12 -4
- package/dist/charts/chart-card.module.css.d.ts +1 -0
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +21 -19
- package/dist/charts/labels.d.ts +13 -3
- package/dist/charts/labels.d.ts.map +1 -1
- package/dist/charts/labels.js +131 -20
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +1 -1
- package/dist/charts/ref-label.d.ts +31 -8
- package/dist/charts/ref-label.d.ts.map +1 -1
- package/dist/charts/ref-label.js +40 -9
- package/dist/charts/sparkline.module.css +6 -0
- package/dist/charts/state.d.ts +3 -3
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +20 -2
- package/dist/cli/shot/capture.d.ts +6 -1
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +18 -5
- package/dist/common/empty-copy.d.ts +16 -0
- package/dist/common/empty-copy.d.ts.map +1 -0
- package/dist/common/empty-copy.js +9 -0
- package/dist/common/virtual-rows.d.ts +196 -0
- package/dist/common/virtual-rows.d.ts.map +1 -0
- package/dist/common/virtual-rows.js +290 -0
- package/dist/controls/controls.module.css +33 -1
- package/dist/controls/controls.module.css.d.ts +2 -0
- package/dist/controls/enum-filter.d.ts.map +1 -1
- package/dist/controls/enum-filter.js +8 -2
- package/dist/controls/filter-pill.d.ts +27 -3
- package/dist/controls/filter-pill.d.ts.map +1 -1
- package/dist/controls/filter-pill.js +15 -4
- package/dist/controls/form-layout.d.ts +9 -3
- package/dist/controls/form-layout.d.ts.map +1 -1
- package/dist/controls/form-layout.js +74 -12
- package/dist/controls/form-layout.module.css +112 -7
- package/dist/controls/form-layout.module.css.d.ts +1 -0
- package/dist/controls/multi-select-filter.d.ts +2 -2
- package/dist/controls/multi-select-filter.d.ts.map +1 -1
- package/dist/controls/multi-select-filter.js +12 -6
- package/dist/controls/range-filter.d.ts +1 -1
- package/dist/controls/range-filter.d.ts.map +1 -1
- package/dist/controls/range-filter.js +8 -2
- package/dist/dashboard/bar-list.d.ts +1 -1
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +6 -2
- package/dist/dashboard/bar-list.module.css +0 -2
- package/dist/dashboard/board-nav.d.ts +22 -0
- package/dist/dashboard/board-nav.d.ts.map +1 -0
- package/dist/dashboard/board-nav.js +49 -0
- package/dist/dashboard/board.d.ts +52 -0
- package/dist/dashboard/board.d.ts.map +1 -0
- package/dist/dashboard/board.js +228 -0
- package/dist/dashboard/board.module.css +160 -0
- package/dist/dashboard/board.module.css.d.ts +26 -0
- package/dist/dashboard/empty-state.d.ts +3 -3
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/empty-state.js +13 -6
- package/dist/dashboard/event-list-model.d.ts +51 -0
- package/dist/dashboard/event-list-model.d.ts.map +1 -0
- package/dist/dashboard/event-list-model.js +72 -0
- package/dist/dashboard/event-list-rows.d.ts +23 -0
- package/dist/dashboard/event-list-rows.d.ts.map +1 -0
- package/dist/dashboard/event-list-rows.js +93 -0
- package/dist/dashboard/event-list-scroll.d.ts +27 -0
- package/dist/dashboard/event-list-scroll.d.ts.map +1 -0
- package/dist/dashboard/event-list-scroll.js +103 -0
- package/dist/dashboard/event-list-skeleton.d.ts +10 -0
- package/dist/dashboard/event-list-skeleton.d.ts.map +1 -0
- package/dist/dashboard/event-list-skeleton.js +36 -0
- package/dist/dashboard/event-list.d.ts +65 -0
- package/dist/dashboard/event-list.d.ts.map +1 -0
- package/dist/dashboard/event-list.js +178 -0
- package/dist/dashboard/event-list.module.css +283 -0
- package/dist/dashboard/event-list.module.css.d.ts +33 -0
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +4 -0
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +5 -3
- package/dist/dashboard/meter.module.css +2 -1
- package/dist/dashboard/query-state.js +1 -1
- package/dist/dashboard/settings-section.d.ts +4 -1
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +1 -1
- package/dist/dashboard/settings-section.module.css +19 -4
- package/dist/dashboard/stat-card-parts.d.ts +5 -1
- package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
- package/dist/dashboard/stat-card-parts.js +8 -3
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +26 -7
- package/dist/dashboard/stat-card.module.css +31 -7
- package/dist/dashboard/stat-card.module.css.d.ts +3 -0
- package/dist/dashboard/stat-strip.js +1 -1
- package/dist/dashboard/stat-strip.module.css +4 -1
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +15 -2
- package/dist/dashboard/widget-header.module.css +17 -1
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/shell/app-main.module.css +18 -0
- package/dist/styles.css +46 -8
- package/dist/surfaces.d.ts +2 -2
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +8 -2
- package/dist/table/cell-kinds.d.ts +44 -0
- package/dist/table/cell-kinds.d.ts.map +1 -0
- package/dist/table/cell-kinds.js +169 -0
- package/dist/table/cell-kinds.module.css +55 -0
- package/dist/table/cell-kinds.module.css.d.ts +15 -0
- package/dist/table/data-table-fold.d.ts +147 -0
- package/dist/table/data-table-fold.d.ts.map +1 -0
- package/dist/table/data-table-fold.js +288 -0
- package/dist/table/data-table-state.d.ts +10 -3
- package/dist/table/data-table-state.d.ts.map +1 -1
- package/dist/table/data-table-state.js +11 -6
- package/dist/table/data-table.d.ts +11 -26
- package/dist/table/data-table.d.ts.map +1 -1
- package/dist/table/data-table.js +354 -254
- package/dist/table/data-table.module.css +210 -3
- package/dist/table/data-table.module.css.d.ts +12 -0
- package/dist/table/table-features.d.ts +34 -4
- package/dist/table/table-features.d.ts.map +1 -1
- package/dist/table/table-features.js +10 -0
- package/dist/theme/card-inset.module.css +35 -0
- package/dist/theme/controls.module.css +32 -0
- package/dist/theme/ctl-theme.d.ts.map +1 -1
- package/dist/theme/ctl-theme.js +5 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +14 -10
- package/dist/tokens/core.d.ts +1 -0
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +1 -0
- package/dist/tokens/derive.js +1 -1
- package/dist/tokens/palette.d.ts +2 -1
- package/dist/tokens/palette.d.ts.map +1 -1
- package/llms.txt +34 -5
- package/package.json +1 -1
- package/src/agent/chat/thread-message.tsx +10 -403
- package/src/agent/chat/virtualize.ts +5 -5
- package/src/charts/ChartCard.tsx +79 -17
- package/src/charts/Lines.tsx +13 -4
- package/src/charts/Sparkline.tsx +131 -45
- package/src/charts/chart-box.module.css +69 -3
- package/src/charts/chart-box.module.css.d.ts +5 -0
- package/src/charts/chart-card.module.css +12 -4
- package/src/charts/chart-card.module.css.d.ts +1 -0
- package/src/charts/compile.ts +24 -20
- package/src/charts/labels.ts +175 -24
- package/src/charts/legend.tsx +3 -2
- package/src/charts/ref-label.ts +86 -17
- package/src/charts/sparkline.module.css +6 -0
- package/src/charts/state.tsx +36 -7
- package/src/cli/shot/capture.ts +29 -6
- package/src/common/empty-copy.ts +17 -0
- package/src/common/virtual-rows.tsx +682 -0
- package/src/controls/controls.module.css +33 -1
- package/src/controls/controls.module.css.d.ts +2 -0
- package/src/controls/enum-filter.tsx +8 -2
- package/src/controls/filter-pill.tsx +80 -27
- package/src/controls/form-layout.module.css +112 -7
- package/src/controls/form-layout.module.css.d.ts +1 -0
- package/src/controls/form-layout.tsx +115 -22
- package/src/controls/multi-select-filter.tsx +22 -11
- package/src/controls/range-filter.tsx +9 -3
- package/src/dashboard/bar-list.module.css +0 -2
- package/src/dashboard/bar-list.tsx +8 -5
- package/src/dashboard/board-nav.ts +67 -0
- package/src/dashboard/board.module.css +160 -0
- package/src/dashboard/board.module.css.d.ts +26 -0
- package/src/dashboard/board.tsx +394 -0
- package/src/dashboard/empty-state.tsx +16 -9
- package/src/dashboard/event-list-model.ts +113 -0
- package/src/dashboard/event-list-rows.tsx +120 -0
- package/src/dashboard/event-list-scroll.ts +145 -0
- package/src/dashboard/event-list-skeleton.tsx +58 -0
- package/src/dashboard/event-list.module.css +283 -0
- package/src/dashboard/event-list.module.css.d.ts +33 -0
- package/src/dashboard/event-list.tsx +309 -0
- package/src/dashboard/index.ts +2 -0
- package/src/dashboard/meter-parts.tsx +9 -2
- package/src/dashboard/meter.module.css +2 -1
- package/src/dashboard/query-state.tsx +1 -1
- package/src/dashboard/settings-section.module.css +19 -4
- package/src/dashboard/settings-section.tsx +7 -2
- package/src/dashboard/stat-card-parts.tsx +20 -3
- package/src/dashboard/stat-card.module.css +31 -7
- package/src/dashboard/stat-card.module.css.d.ts +3 -0
- package/src/dashboard/stat-card.tsx +25 -6
- package/src/dashboard/stat-strip.module.css +4 -1
- package/src/dashboard/stat-strip.tsx +1 -1
- package/src/dashboard/widget-header.module.css +17 -1
- package/src/dashboard/widget-header.tsx +29 -5
- package/src/guard/index.ts +2 -0
- package/src/index.ts +4 -0
- package/src/shell/app-main.module.css +18 -0
- package/src/styles.css +46 -8
- package/src/surfaces.ts +7 -1
- package/src/table/cell-kinds.module.css +55 -0
- package/src/table/cell-kinds.module.css.d.ts +15 -0
- package/src/table/cell-kinds.tsx +234 -0
- package/src/table/data-table-fold.tsx +514 -0
- package/src/table/data-table-state.ts +24 -13
- package/src/table/data-table.module.css +210 -3
- package/src/table/data-table.module.css.d.ts +12 -0
- package/src/table/data-table.tsx +406 -359
- package/src/table/table-features.ts +44 -4
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +2 -66
- package/src/theme/card-inset.module.css +35 -0
- package/src/theme/controls.module.css +32 -0
- package/src/theme/ctl-theme.tsx +8 -0
- package/src/theme/index.ts +12 -8
- package/src/tokens/core.ts +1 -0
- package/src/tokens/derive.ts +1 -1
- package/src/tokens/palette.ts +4 -1
|
@@ -19,6 +19,9 @@ declare const classes: {
|
|
|
19
19
|
readonly empty: string
|
|
20
20
|
readonly skeletonValue: string
|
|
21
21
|
readonly skeletonVisual: string
|
|
22
|
+
readonly skeletonValueRow: string
|
|
23
|
+
readonly skeletonValueWithDelta: string
|
|
24
|
+
readonly skeletonDelta: string
|
|
22
25
|
readonly skeletonFooter: string
|
|
23
26
|
readonly skeletonRowBox: string
|
|
24
27
|
readonly skeletonRow: string
|
|
@@ -101,7 +101,7 @@ function StripCell({
|
|
|
101
101
|
...state === void 0 && rows !== void 0 && { "data-strip-has-rows": "" },
|
|
102
102
|
...cell.stale && { "data-stale": "true" },
|
|
103
103
|
children: [
|
|
104
|
-
/* @__PURE__ */ jsxs("div", { className: classes.head, "data-strip-head": true, children: [
|
|
104
|
+
/* @__PURE__ */ jsxs("div", { className: classes.head, "data-strip-head": true, "data-basalt-header-block": true, children: [
|
|
105
105
|
/* @__PURE__ */ jsxs("div", { className: classes.captionLine, children: [
|
|
106
106
|
/* @__PURE__ */ jsxs("div", { className: classes.captionMain, children: [
|
|
107
107
|
/* @__PURE__ */ jsxs("span", { className: classes.lead, children: [
|
|
@@ -378,15 +378,18 @@
|
|
|
378
378
|
.footerCell {
|
|
379
379
|
flex: 1 1 14rem;
|
|
380
380
|
min-width: 0;
|
|
381
|
+
font-size: var(--vx-text-sm);
|
|
381
382
|
padding: var(--vx-space-stack-md);
|
|
382
383
|
border-inline-start: 1px solid var(--vx-divider);
|
|
383
384
|
border-block-start: 1px solid var(--vx-divider);
|
|
384
385
|
}
|
|
385
386
|
|
|
386
387
|
/* A footer entry `under` a cell is part of that cell: it sits in the slot under the article, inset like
|
|
387
|
-
* the article, split from the readings by the strip's own hairline.
|
|
388
|
+
* the article, split from the readings by the strip's own hairline. Both footer slots take the strip's
|
|
389
|
+
* `sm` step, never the inherited body size (it would outrank the cell's own statement). */
|
|
388
390
|
.underCell {
|
|
389
391
|
min-width: 0;
|
|
392
|
+
font-size: var(--vx-text-sm);
|
|
390
393
|
margin: var(--vx-space-stack-md) var(--vx-space-stack-md) 0;
|
|
391
394
|
padding-block-start: var(--vx-space-stack-sm);
|
|
392
395
|
border-block-start: 1px solid var(--vx-divider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-header.d.ts","sourceRoot":"","sources":["../../src/dashboard/widget-header.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,OAAO,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGnE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L,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,iBAAiB,+BAmEnB"}
|
|
@@ -13,6 +13,15 @@ function cardOf(trigger) {
|
|
|
13
13
|
}
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
|
+
const FACTS = "[data-basalt-facts], [data-basalt-facts-skeleton]";
|
|
17
|
+
function headerBlockOf(trigger, card) {
|
|
18
|
+
const marked = trigger.closest("[data-basalt-header-block]");
|
|
19
|
+
if (marked !== null && card.contains(marked)) return [marked];
|
|
20
|
+
const root = trigger.closest("[data-tier]");
|
|
21
|
+
if (root === null || root === card || !card.contains(root)) return [];
|
|
22
|
+
const siblings = [...root.parentElement?.children ?? []];
|
|
23
|
+
return [root, ...siblings.filter((el) => el !== root && el.matches(FACTS))];
|
|
24
|
+
}
|
|
16
25
|
function useBubblePosition(open, triggerRef, bubbleRef) {
|
|
17
26
|
const [pos, setPos] = useState(null);
|
|
18
27
|
useIsomorphicLayoutEffect(() => {
|
|
@@ -28,7 +37,11 @@ function useBubblePosition(open, triggerRef, bubbleRef) {
|
|
|
28
37
|
const b = bubble.getBoundingClientRect();
|
|
29
38
|
const viewW = document.documentElement.clientWidth;
|
|
30
39
|
const viewH = document.documentElement.clientHeight;
|
|
31
|
-
const
|
|
40
|
+
const block = card === null ? [] : headerBlockOf(trigger, card);
|
|
41
|
+
const blockRects = block.map((el) => el.getBoundingClientRect());
|
|
42
|
+
const blockTop = Math.min(t.top, ...blockRects.map((r) => r.top));
|
|
43
|
+
const blockBottom = Math.max(t.bottom, ...blockRects.map((r) => r.bottom));
|
|
44
|
+
const below = blockBottom + BUBBLE_GAP;
|
|
32
45
|
const above = t.top - BUBBLE_GAP - b.height;
|
|
33
46
|
const overflows = below + b.height > viewH - BUBBLE_EDGE;
|
|
34
47
|
const viewportFlip = above >= BUBBLE_EDGE ? above : below;
|
|
@@ -38,7 +51,7 @@ function useBubblePosition(open, triggerRef, bubbleRef) {
|
|
|
38
51
|
if (above >= floor) top = above;
|
|
39
52
|
else if (card !== null) {
|
|
40
53
|
const slid = Math.max(floor, viewH - BUBBLE_EDGE - b.height);
|
|
41
|
-
const covers = slid <
|
|
54
|
+
const covers = slid < blockBottom && slid + b.height > blockTop;
|
|
42
55
|
top = covers ? viewportFlip : slid;
|
|
43
56
|
}
|
|
44
57
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* Layout keys on the enclosing card's OWN width (`container: basalt-card`, declared by ChartCard /
|
|
13
13
|
* StatCard / Section — docs/DESIGN-CORE.md § Layout, elevation, shapes), never the viewport: below 480px the subtitle folds
|
|
14
|
-
* into the info glyph; from 480px (wave 8) `value` + `delta` move onto the title row. Wrapping and
|
|
14
|
+
* into the info glyph (a ChartCard keeps it, wrapped to two lines — wave 43); from 480px (wave 8) `value` + `delta` move onto the title row. Wrapping and
|
|
15
15
|
* shrinking are unconditional. The subtitle ALSO folds (regardless of width) whenever the card's own
|
|
16
16
|
* height is under 280px — see the `[data-basalt-card-short]` block below (wave 8's header-economy
|
|
17
17
|
* law). No enclosing card, no container: the standard layout. Container conditions are px literals
|
|
@@ -394,6 +394,22 @@
|
|
|
394
394
|
.foldNote {
|
|
395
395
|
display: block;
|
|
396
396
|
}
|
|
397
|
+
|
|
398
|
+
/* A chart card keeps its subtitle (argo's line/dot key) on its own line at every width: up to two
|
|
399
|
+
* lines, then an ellipsis; the full text stays in the DOM. StatCard and Section still fold. The
|
|
400
|
+
* short-height block below out-ranks this (its selector is one class heavier). */
|
|
401
|
+
[data-basalt-chart-header] .subtitle {
|
|
402
|
+
display: -webkit-box;
|
|
403
|
+
-webkit-box-orient: vertical;
|
|
404
|
+
-webkit-line-clamp: 2;
|
|
405
|
+
line-clamp: 2;
|
|
406
|
+
overflow: hidden;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
[data-basalt-chart-header] .foldGlyph,
|
|
410
|
+
[data-basalt-chart-header] .foldNote {
|
|
411
|
+
display: none;
|
|
412
|
+
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/index.js
CHANGED
|
@@ -348,6 +348,8 @@ const PLUGIN_RULE_IDS = /* @__PURE__ */ new Set([
|
|
|
348
348
|
"no-dev-helper",
|
|
349
349
|
// AST-only: a `<ViewTransition>` ancestor of `<Outlet>` is a JSX-ancestry claim over two import-resolved names.
|
|
350
350
|
"route-view-transition",
|
|
351
|
+
// AST-only: a text-colour position (`c=`, a `style` object's `color`) is a JSX/property claim over a member chain.
|
|
352
|
+
"status-fill-as-text",
|
|
351
353
|
// These two honour `basalt-agent-allow`, never `theme-allow` — but they are still REAL ids, so
|
|
352
354
|
// a `theme-allow ai-sdk-major` must parse as a (useless) scoped annotation rather than as prose.
|
|
353
355
|
"agent-no-raw-usechat",
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { ThemeToggle } from './theme/theme-toggle.js';
|
|
|
15
15
|
export { StatusDot, type StatusDotProps } from './theme/status-dot.js';
|
|
16
16
|
export { StatusVerdict, type StatusVerdictProps } from './theme/status-verdict.js';
|
|
17
17
|
export { BasaltShell, PageBar, PageAside, useSizeClass, PageTitle, type ShellBaseProps, type SidebarBlock, type SettingsMenuItem, } from './shell/index.js';
|
|
18
|
-
export { WidgetHeader, DeltaBadge, Section, StatCard, type StatCardBreakdownRow, type StatCardSparklineSize, StatGroup, type StatStripCell, type StatStripRow, EmptyState, SettingsSection, SettingsRow, DangerZone, Meter, type MeterProps, type MeterSegment, type MeterTick, type MeterZone, BarList, type BarListProps, PageSummary, type PageSummaryProps, } from './dashboard/index.js';
|
|
18
|
+
export { WidgetHeader, DeltaBadge, Section, StatCard, type StatCardBreakdownRow, type StatCardSparklineSize, StatGroup, type StatStripCell, type StatStripRow, EmptyState, SettingsSection, SettingsRow, DangerZone, Meter, type MeterProps, type MeterSegment, type MeterTick, type MeterZone, BarList, type BarListProps, EventList, type EventListProps, Board, type BoardProps, PageSummary, type PageSummaryProps, } from './dashboard/index.js';
|
|
19
19
|
export { unwrap } from './unwrap.js';
|
|
20
20
|
export type { BasaltRegister, SeriesKey } from './register.js';
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACnG,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,KAAK,IAAI,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC/E,OAAO,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,YAAY,EACZ,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,eAAe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gB,GACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,KAAK,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,OAAO,EACP,KAAK,YAAY,EACjB,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,EACL,KAAK,UAAU,EACf,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAMjC,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,8 @@ import {
|
|
|
34
34
|
DangerZone,
|
|
35
35
|
Meter,
|
|
36
36
|
BarList,
|
|
37
|
+
EventList,
|
|
38
|
+
Board,
|
|
37
39
|
PageSummary
|
|
38
40
|
} from "./dashboard/index.js";
|
|
39
41
|
import { unwrap } from "./unwrap.js";
|
|
@@ -41,9 +43,11 @@ export {
|
|
|
41
43
|
BarList,
|
|
42
44
|
BasaltProvider,
|
|
43
45
|
BasaltShell,
|
|
46
|
+
Board,
|
|
44
47
|
DangerZone,
|
|
45
48
|
DeltaBadge,
|
|
46
49
|
EmptyState,
|
|
50
|
+
EventList,
|
|
47
51
|
Meter,
|
|
48
52
|
PageAside,
|
|
49
53
|
PageBar,
|
|
@@ -107,6 +107,24 @@
|
|
|
107
107
|
* table's page-sticky offset reads it instead of repeating this module's `sm` switch.
|
|
108
108
|
*/
|
|
109
109
|
--basalt-main-pad-block: var(--vx-space-stack-md);
|
|
110
|
+
/*
|
|
111
|
+
* PUBLIC `--basalt-main-content-h` — the height of Main's CONTENT box: what an element at
|
|
112
|
+
* `height: var(--basalt-main-content-h)` needs to fill the scrollport with nothing to scroll (a
|
|
113
|
+
* map, an editor, a full-page canvas). Descendants inherit the resolved length.
|
|
114
|
+
*
|
|
115
|
+
* It is the viewport minus the five things that are not content: the header offset, the footer
|
|
116
|
+
* offset PLUS the safe-area inset (same pair as `margin-bottom` above), the band, and Main's block
|
|
117
|
+
* padding twice. The band is `--basalt-page-bar-h` (its content box, published by `PageBar`) plus
|
|
118
|
+
* its own 1 px `border-bottom` the var never counts (`page-aside.module.css` explains the same
|
|
119
|
+
* pixel): `var(--basalt-page-bar-h, -1px) + 1px` adds it only while a band exists and nets to 0
|
|
120
|
+
* without one. `h="100%"` cannot do this job — Main sizes itself by flex, so a percentage height
|
|
121
|
+
* on a child does not resolve against it.
|
|
122
|
+
*/
|
|
123
|
+
--basalt-main-content-h: calc(
|
|
124
|
+
100dvh - var(--app-shell-header-offset, 0px) - var(--app-shell-footer-offset, 0px) -
|
|
125
|
+
env(safe-area-inset-bottom, 0px) - (var(--basalt-page-bar-h, -1px) + 1px) - 2 *
|
|
126
|
+
var(--basalt-main-pad-block)
|
|
127
|
+
);
|
|
110
128
|
padding: var(--basalt-main-pad-block) var(--app-shell-padding);
|
|
111
129
|
/* Without this a wide flex/grid child (a bare table, a nowrap control row) sizes Main to ITSELF. */
|
|
112
130
|
min-width: 0;
|
package/dist/styles.css
CHANGED
|
@@ -177,14 +177,6 @@
|
|
|
177
177
|
outline-color: var(--vx-accent);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
/* The chart host is a focusable element Mantine does not own, so no `mantine-focus-*` class reaches
|
|
181
|
-
it and the UA ring paints instead: a white double ring in dark (argo strength strip and
|
|
182
|
-
diagnostics at dark 390). There is no media or pointer branch behind it. */
|
|
183
|
-
.basalt-chart:focus-visible {
|
|
184
|
-
outline: 2px solid var(--vx-accent);
|
|
185
|
-
outline-offset: calc(0.125rem * var(--mantine-scale));
|
|
186
|
-
}
|
|
187
|
-
|
|
188
180
|
/* Hubot Sans is a condensed display face — the spec pins it at 88% font-stretch everywhere it
|
|
189
181
|
lands (headings + the Mantine Title component). Read from the knob declared above rather than
|
|
190
182
|
hardcoded here, so a consumer retunes it in one declaration instead of fighting these bare
|
|
@@ -394,6 +386,52 @@
|
|
|
394
386
|
}
|
|
395
387
|
}
|
|
396
388
|
|
|
389
|
+
/* MapLibre's compact attribution (Wave 43, argo's astro Map tab). basalt has no maplibre dependency;
|
|
390
|
+
* this only restyles the control a consumer's map renders, onto the radius scale and the micro text
|
|
391
|
+
* size: the shipped 12 px radius on the box and its 24 px button is off the scale and, over a card,
|
|
392
|
+
* a nested step under 3 px. The box takes the control tier (4 px under a flush card), the button the
|
|
393
|
+
* Mantine `xs` step (4 px under the box).
|
|
394
|
+
*
|
|
395
|
+
* UNLAYERED on purpose: `maplibre-gl.css` is unlayered, and an unlayered rule beats every layered
|
|
396
|
+
* one whatever the specificity, so a `@layer basalt` block would lose to it. The doubled `:root`
|
|
397
|
+
* lifts each rule to (0,4,0), over maplibre's highest (0,3,0) (`.maplibregl-ctrl-bottom-left >
|
|
398
|
+
* .maplibregl-ctrl-attrib.maplibregl-compact-show`, which sets its own 12 px radius), whichever
|
|
399
|
+
* stylesheet loads last and in every corner and state. A consumer overrides with a longer selector,
|
|
400
|
+
* or an equal one later in source. `.maplibregl-ctrl-group` is not here: its 4 px radius is already
|
|
401
|
+
* a scale step. */
|
|
402
|
+
:root:root .maplibregl-ctrl.maplibregl-ctrl-attrib {
|
|
403
|
+
border-radius: var(--vx-radius-ctrl);
|
|
404
|
+
background-color: var(--vx-surface-panel);
|
|
405
|
+
color: var(--vx-muted);
|
|
406
|
+
font-size: var(--vx-text-micro);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
:root:root .maplibregl-ctrl-attrib a {
|
|
410
|
+
color: inherit;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/* One step under the box, snapped onto the scale like the SegmentedControl indicator: 2 when the box
|
|
414
|
+
* leaves a 3 px step, else square. */
|
|
415
|
+
:root:root .maplibregl-ctrl-attrib-button {
|
|
416
|
+
/* theme-allow css-raw-surface — a snapped nested step: the scale's 2 px xs, or square under a small box */
|
|
417
|
+
border-radius: round(down, min(2px, max(0px, var(--vx-radius-ctrl) - 3px)), 2px);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/* The glyph is maplibre's dark SVG background-image, drawn again as a mask in the muted ink so it
|
|
421
|
+
* follows the scheme (a `filter` would also invert the button's own fill). */
|
|
422
|
+
:root:root .maplibregl-ctrl-attrib-button {
|
|
423
|
+
background-image: none;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
:root:root .maplibregl-ctrl-attrib-button::after {
|
|
427
|
+
content: '';
|
|
428
|
+
position: absolute;
|
|
429
|
+
inset: 0;
|
|
430
|
+
background-color: var(--vx-muted);
|
|
431
|
+
mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0v-3'/%3E%3C/svg%3E")
|
|
432
|
+
center / 24px 24px no-repeat;
|
|
433
|
+
}
|
|
434
|
+
|
|
397
435
|
/* chart-engine:start — generated by scripts/gen-chart-css.ts from chartEngineCss() */
|
|
398
436
|
@layer basalt {
|
|
399
437
|
:root {
|
package/dist/surfaces.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export type RuleName = 'tokens' | 'charts' | 'mantine' | 'state' | 'controls' |
|
|
|
32
32
|
* const id: PluginRuleId = 'hand-rolled-filter' // ok
|
|
33
33
|
* // const bad: PluginRuleId = 'hand-rolled-filters' // tsc error
|
|
34
34
|
*/
|
|
35
|
-
export declare const PLUGIN_RULE_ID_LIST: readonly ["no-raw-font-size", "raw-size-literal", "card-inset", "chart-in-raw-surface", "shadow-basalt-export", "hand-rolled-shell", "raw-scroll-container", "hand-rolled-filter", "control-outside-home", "bound-control-outside-home", "control-size-literal", "in-body-page-title", "responsive-twin", "search-literal-link", "use-search-from-literal", "query-fn-unwrap", "forms-field-key", "chart-engine-boundary", "chart-host-single", "token-layer-boundary", "agent-no-raw-usechat", "ai-sdk-major", "no-import-meta-env", "raw-breakpoint", "no-dev-helper", "route-view-transition"];
|
|
35
|
+
export declare const PLUGIN_RULE_ID_LIST: readonly ["no-raw-font-size", "raw-size-literal", "card-inset", "chart-in-raw-surface", "shadow-basalt-export", "hand-rolled-shell", "raw-scroll-container", "hand-rolled-filter", "control-outside-home", "bound-control-outside-home", "control-size-literal", "in-body-page-title", "responsive-twin", "search-literal-link", "use-search-from-literal", "query-fn-unwrap", "forms-field-key", "chart-engine-boundary", "chart-host-single", "token-layer-boundary", "agent-no-raw-usechat", "ai-sdk-major", "no-import-meta-env", "raw-breakpoint", "no-dev-helper", "route-view-transition", "status-fill-as-text"];
|
|
36
36
|
/** One registered oxlint plugin rule id — the literal union of {@link PLUGIN_RULE_ID_LIST}. */
|
|
37
37
|
export type PluginRuleId = (typeof PLUGIN_RULE_ID_LIST)[number];
|
|
38
38
|
/** The 3 shipped skill names (agent/skills/basalt-{name}/SKILL.md, placed into a consumer's
|
|
@@ -205,7 +205,7 @@ export declare const SURFACES: {
|
|
|
205
205
|
readonly rule: "tokens";
|
|
206
206
|
readonly skill: readonly ["basalt-design", "basalt-charts"];
|
|
207
207
|
readonly guardKinds: readonly ["raw-hex", "raw-color-fn", "off-identity-accent", "off-system-surface-var", "raw-font-family", "raw-radius", "raw-surface", "inline-font-size", "css-raw-surface", "surface-shadow-override", "unknown-vx-token", "series-palette", "theme-allow-unscoped"];
|
|
208
|
-
readonly pluginRules: readonly ["no-raw-font-size", "raw-size-literal", "token-layer-boundary"];
|
|
208
|
+
readonly pluginRules: readonly ["no-raw-font-size", "raw-size-literal", "status-fill-as-text", "token-layer-boundary"];
|
|
209
209
|
readonly description: "VX token refs, buildPaletteCss, defineSeries, seriesTokens, groupTokens, alpha (Mantine-free)";
|
|
210
210
|
readonly globs: {
|
|
211
211
|
readonly shipped: readonly ["**/tokens/**"];
|
package/dist/surfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../src/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAA;AAE3F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../src/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAA;AAE3F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,0lBA4BtB,CAAA;AAEV,+FAA+F;AAC/F,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,CAAA;AAExE;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,iBAAiB,GAAG,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,eAAe,CAAA;AAEpG;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,IAAI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MAAM,CAAqC,CAAA;AAEnG;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACzC,OAAO,CAET"}
|
package/dist/surfaces.js
CHANGED
|
@@ -24,7 +24,8 @@ const PLUGIN_RULE_ID_LIST = [
|
|
|
24
24
|
"no-import-meta-env",
|
|
25
25
|
"raw-breakpoint",
|
|
26
26
|
"no-dev-helper",
|
|
27
|
-
"route-view-transition"
|
|
27
|
+
"route-view-transition",
|
|
28
|
+
"status-fill-as-text"
|
|
28
29
|
];
|
|
29
30
|
const v = (spec, message, extra) => ({
|
|
30
31
|
spec,
|
|
@@ -162,7 +163,12 @@ const SURFACES = {
|
|
|
162
163
|
// The type-scale rules live with the tokens, not with `.`: both police a value that left the
|
|
163
164
|
// `--vx-*` system, which is this surface's whole subject. `token-layer-boundary` is the
|
|
164
165
|
// repo-local-only rule that keeps the layer upstream of Mantine (see below).
|
|
165
|
-
pluginRules: [
|
|
166
|
+
pluginRules: [
|
|
167
|
+
"no-raw-font-size",
|
|
168
|
+
"raw-size-literal",
|
|
169
|
+
"status-fill-as-text",
|
|
170
|
+
"token-layer-boundary"
|
|
171
|
+
],
|
|
166
172
|
description: "VX token refs, buildPaletteCss, defineSeries, seriesTokens, groupTokens, alpha (Mantine-free)",
|
|
167
173
|
globs: {
|
|
168
174
|
shipped: ["**/tokens/**"],
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Cell, Column, RowData } from '@tanstack/react-table';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { BasaltTableFeatures, DataTableAlign, DataTableColumnKind } from './table-features.js';
|
|
4
|
+
/**
|
|
5
|
+
* The table's own default `cell` (TanStack's, restated), installed as `defaultColumn.cell` so a
|
|
6
|
+
* column WITHOUT a renderer is identifiable by identity: v9 merges its default into every
|
|
7
|
+
* `columnDef`, so `columnDef.cell === undefined` can never be asked.
|
|
8
|
+
*/
|
|
9
|
+
export declare function DEFAULT_CELL(props: {
|
|
10
|
+
renderValue(): unknown;
|
|
11
|
+
}): string | null;
|
|
12
|
+
/** Reads `meta.kind`, throwing on a value outside the seven — the check a type cannot make at runtime. */
|
|
13
|
+
export declare function resolveKind<T extends RowData>(column: Column<BasaltTableFeatures, T, unknown>): DataTableColumnKind | undefined;
|
|
14
|
+
/** Figures read right: the kind's default alignment, which an explicit `meta.align` overrides. */
|
|
15
|
+
export declare function kindAlign(kind: DataTableColumnKind | undefined): DataTableAlign | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Column sizing law (SPEC § 6.6): a data column is as wide as its header or widest cell (body cells
|
|
18
|
+
* hold one line), and the slack of a wide container goes to ONE place — the LAST `text` column (a
|
|
19
|
+
* notes/detail column that may wrap), else a trailing spacer after the last data column — so a name
|
|
20
|
+
* sits beside its figures, never a third of the table away. An `entity` column is content-sized.
|
|
21
|
+
* `fixedIds` (the checkbox and actions columns) fit too but are not data. An earlier `text` column
|
|
22
|
+
* keeps its auto share (it may wrap), and a table where no column opted into a kind renders as
|
|
23
|
+
* before: no fit marks, no spacer.
|
|
24
|
+
*/
|
|
25
|
+
export declare function planColumnSizing<T extends RowData>(columns: readonly Column<BasaltTableFeatures, T, unknown>[], fixedIds: ReadonlySet<string>): {
|
|
26
|
+
fitIds: ReadonlySet<string>;
|
|
27
|
+
spacer: boolean;
|
|
28
|
+
};
|
|
29
|
+
/** A loading bar shaped like the kind's value: a figure short and flush right, a chip chip-sized. */
|
|
30
|
+
export declare function KindSkeleton({ kind, right, }: {
|
|
31
|
+
kind: DataTableColumnKind | undefined;
|
|
32
|
+
right: boolean;
|
|
33
|
+
}): ReactNode;
|
|
34
|
+
export declare function kindClass(kind: DataTableColumnKind): string;
|
|
35
|
+
/** The cell of a column with a `kind`: the column's own `cell` if it has one, else the kind's content. */
|
|
36
|
+
export declare function KindCell<T extends RowData>({ kind, cell, }: {
|
|
37
|
+
kind: DataTableColumnKind;
|
|
38
|
+
cell: Cell<BasaltTableFeatures, T, unknown>;
|
|
39
|
+
}): ReactNode;
|
|
40
|
+
/** A cell's content through its kind when it has one — the body cell and the fold disclosure share it. */
|
|
41
|
+
export declare function CellContent<T extends RowData>({ cell, }: {
|
|
42
|
+
cell: Cell<BasaltTableFeatures, T, unknown>;
|
|
43
|
+
}): ReactNode;
|
|
44
|
+
//# sourceMappingURL=cell-kinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-kinds.d.ts","sourceRoot":"","sources":["../../src/table/cell-kinds.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAElE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAGhG;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAAE,WAAW,IAAI,OAAO,CAAA;CAAE,iBAE7D;AAID,0GAA0G;AAC1G,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,EAC3C,MAAM,EAAE,MAAM,CAAC,mBAAmB,EAAE,CAAC,EAAE,OAAO,CAAC,GAC9C,mBAAmB,GAAG,SAAS,CAUjC;AAED,kGAAkG;AAClG,wBAAgB,SAAS,CAAC,IAAI,EAAE,mBAAmB,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAE3F;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,OAAO,EAChD,OAAO,EAAE,SAAS,MAAM,CAAC,mBAAmB,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,EAC3D,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,GAC5B;IAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAYlD;AAiBD,qGAAqG;AACrG,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAK,GACN,EAAE;IACD,IAAI,EAAE,mBAAmB,GAAG,SAAS,CAAA;IACrC,KAAK,EAAE,OAAO,CAAA;CACf,GAAG,SAAS,CAYZ;AAYD,wBAAgB,SAAS,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAE3D;AA8DD,0GAA0G;AAC1G,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,EAC1C,IAAI,EACJ,IAAI,GACL,EAAE;IACD,IAAI,EAAE,mBAAmB,CAAA;IACzB,IAAI,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,EAAE,OAAO,CAAC,CAAA;CAC5C,GAAG,SAAS,CA+BZ;AAED,0GAA0G;AAC1G,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,EAC7C,IAAI,GACL,EAAE;IACD,IAAI,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,EAAE,OAAO,CAAC,CAAA;CAC5C,GAAG,SAAS,CAGZ"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, Skeleton, Tooltip } from "@mantine/core";
|
|
3
|
+
import { FlexRender } from "@tanstack/react-table";
|
|
4
|
+
import { cx } from "../common/props.js";
|
|
5
|
+
import { Meter } from "../dashboard/meter.js";
|
|
6
|
+
import { dateTime, integer, relativeTime } from "../format/index.js";
|
|
7
|
+
import { numberFormat } from "../format/shared.js";
|
|
8
|
+
import { DATA_TABLE_COLUMN_KINDS } from "./table-features.js";
|
|
9
|
+
import classes from "./cell-kinds.module.css";
|
|
10
|
+
function DEFAULT_CELL(props) {
|
|
11
|
+
return props.renderValue()?.toString?.() ?? null;
|
|
12
|
+
}
|
|
13
|
+
const KINDS = new Set(DATA_TABLE_COLUMN_KINDS);
|
|
14
|
+
function resolveKind(column) {
|
|
15
|
+
const kind = column.columnDef.meta?.kind;
|
|
16
|
+
if (kind === void 0) return void 0;
|
|
17
|
+
if (!KINDS.has(kind)) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`BasaltDataTable: column "${column.id}" has meta.kind=${JSON.stringify(kind)} \u2014 expected ${DATA_TABLE_COLUMN_KINDS.map((k) => `'${k}'`).join(" | ")}.`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return kind;
|
|
23
|
+
}
|
|
24
|
+
function kindAlign(kind) {
|
|
25
|
+
return kind === "number" || kind === "money" ? "right" : void 0;
|
|
26
|
+
}
|
|
27
|
+
function planColumnSizing(columns, fixedIds) {
|
|
28
|
+
const data = columns.filter((column) => !fixedIds.has(column.id));
|
|
29
|
+
const kinds = new Map(data.map((column) => [column.id, resolveKind(column)]));
|
|
30
|
+
const fitIds = new Set(columns.filter((column) => fixedIds.has(column.id)).map((c) => c.id));
|
|
31
|
+
const hasKinds = data.some((column) => kinds.get(column.id) !== void 0);
|
|
32
|
+
if (!hasKinds) return { fitIds, spacer: false };
|
|
33
|
+
const slackId = data.findLast((column) => kinds.get(column.id) === "text")?.id;
|
|
34
|
+
for (const column of data) {
|
|
35
|
+
if (column.id === slackId || kinds.get(column.id) === "text") continue;
|
|
36
|
+
fitIds.add(column.id);
|
|
37
|
+
}
|
|
38
|
+
return { fitIds, spacer: slackId === void 0 };
|
|
39
|
+
}
|
|
40
|
+
const SKELETON_WIDTH = {
|
|
41
|
+
number: "3rem",
|
|
42
|
+
money: "3rem",
|
|
43
|
+
status: "4.5rem",
|
|
44
|
+
"relative-time": "4.5rem",
|
|
45
|
+
meter: "4rem",
|
|
46
|
+
entity: "100%",
|
|
47
|
+
text: "10rem",
|
|
48
|
+
kindless: "100%"
|
|
49
|
+
};
|
|
50
|
+
function KindSkeleton({
|
|
51
|
+
kind,
|
|
52
|
+
right
|
|
53
|
+
}) {
|
|
54
|
+
const chip = kind === "status";
|
|
55
|
+
const width = SKELETON_WIDTH[kind ?? "kindless"];
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
57
|
+
Skeleton,
|
|
58
|
+
{
|
|
59
|
+
height: chip ? 20 : 16,
|
|
60
|
+
radius: "sm",
|
|
61
|
+
w: width,
|
|
62
|
+
maw: "100%",
|
|
63
|
+
...right && { ml: "auto" }
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
const KIND_CLASS = {
|
|
68
|
+
entity: classes.entity,
|
|
69
|
+
status: classes.status,
|
|
70
|
+
number: classes.number,
|
|
71
|
+
money: classes.number,
|
|
72
|
+
"relative-time": classes.relativeTime,
|
|
73
|
+
meter: classes.meter,
|
|
74
|
+
text: classes.text
|
|
75
|
+
};
|
|
76
|
+
function kindClass(kind) {
|
|
77
|
+
return cx(KIND_CLASS[kind]);
|
|
78
|
+
}
|
|
79
|
+
function formatFigure(value) {
|
|
80
|
+
return Number.isInteger(value) ? integer(value) : numberFormat(void 0, { signDisplay: "negative", maximumFractionDigits: 20 }).format(value);
|
|
81
|
+
}
|
|
82
|
+
function formatMoney(value, currency) {
|
|
83
|
+
const digits = numberFormat(void 0, { style: "currency", currency }).resolvedOptions().maximumFractionDigits;
|
|
84
|
+
return numberFormat(void 0, {
|
|
85
|
+
signDisplay: "negative",
|
|
86
|
+
minimumFractionDigits: digits,
|
|
87
|
+
maximumFractionDigits: digits
|
|
88
|
+
}).format(value);
|
|
89
|
+
}
|
|
90
|
+
const chipColor = (color) => color === void 0 || color === "gray" ? "var(--vx-faint)" : color;
|
|
91
|
+
const Dash = () => /* @__PURE__ */ jsx("span", { className: classes.dash, children: "\u2014" });
|
|
92
|
+
function isAbsent(value) {
|
|
93
|
+
return value === null || value === void 0 || value === "";
|
|
94
|
+
}
|
|
95
|
+
function toDate(value) {
|
|
96
|
+
if (!(value instanceof Date) && typeof value !== "number" && typeof value !== "string") {
|
|
97
|
+
return void 0;
|
|
98
|
+
}
|
|
99
|
+
const date = new Date(value);
|
|
100
|
+
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
101
|
+
}
|
|
102
|
+
function columnLabel(column) {
|
|
103
|
+
const { header } = column.columnDef;
|
|
104
|
+
return typeof header === "string" ? header : column.id;
|
|
105
|
+
}
|
|
106
|
+
function RelativeTime({ value }) {
|
|
107
|
+
const date = toDate(value);
|
|
108
|
+
if (date === void 0) return /* @__PURE__ */ jsx(Dash, {});
|
|
109
|
+
const full = dateTime(date);
|
|
110
|
+
return (
|
|
111
|
+
// Below the cell and on keyboard focus: above it the tip covered the header's label on row one.
|
|
112
|
+
/* @__PURE__ */ jsx(Tooltip, { label: full, position: "bottom", events: { hover: true, focus: true, touch: false }, children: /* @__PURE__ */ jsxs("time", { dateTime: date.toISOString(), tabIndex: 0, children: [
|
|
113
|
+
relativeTime(date),
|
|
114
|
+
/* @__PURE__ */ jsx("span", { className: classes.srOnly, children: `, ${full}` })
|
|
115
|
+
] }) })
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
function KindCell({
|
|
119
|
+
kind,
|
|
120
|
+
cell
|
|
121
|
+
}) {
|
|
122
|
+
const { column } = cell;
|
|
123
|
+
const { cell: render, meta } = column.columnDef;
|
|
124
|
+
if (render !== DEFAULT_CELL) return /* @__PURE__ */ jsx(FlexRender, { cell });
|
|
125
|
+
const value = cell.getValue();
|
|
126
|
+
switch (kind) {
|
|
127
|
+
case "number":
|
|
128
|
+
case "money": {
|
|
129
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return /* @__PURE__ */ jsx(Dash, {});
|
|
130
|
+
return kind === "money" ? formatMoney(value, meta?.currency ?? "USD") : formatFigure(value);
|
|
131
|
+
}
|
|
132
|
+
case "relative-time":
|
|
133
|
+
return /* @__PURE__ */ jsx(RelativeTime, { value });
|
|
134
|
+
case "status":
|
|
135
|
+
if (isAbsent(value)) return /* @__PURE__ */ jsx(Dash, {});
|
|
136
|
+
return /* @__PURE__ */ jsx(Badge, { color: chipColor(meta?.statusColor?.(value)), children: String(value) });
|
|
137
|
+
case "meter":
|
|
138
|
+
return /* @__PURE__ */ jsx(
|
|
139
|
+
Meter,
|
|
140
|
+
{
|
|
141
|
+
size: "row",
|
|
142
|
+
label: columnLabel(column),
|
|
143
|
+
value: typeof value === "number" ? value : null,
|
|
144
|
+
max: meta?.meterMax ?? 1
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
case "entity":
|
|
148
|
+
case "text":
|
|
149
|
+
return isAbsent(value) ? /* @__PURE__ */ jsx(Dash, {}) : String(value);
|
|
150
|
+
default:
|
|
151
|
+
return kind;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function CellContent({
|
|
155
|
+
cell
|
|
156
|
+
}) {
|
|
157
|
+
const kind = resolveKind(cell.column);
|
|
158
|
+
return kind === void 0 ? /* @__PURE__ */ jsx(FlexRender, { cell }) : /* @__PURE__ */ jsx(KindCell, { kind, cell });
|
|
159
|
+
}
|
|
160
|
+
export {
|
|
161
|
+
CellContent,
|
|
162
|
+
DEFAULT_CELL,
|
|
163
|
+
KindCell,
|
|
164
|
+
KindSkeleton,
|
|
165
|
+
kindAlign,
|
|
166
|
+
kindClass,
|
|
167
|
+
planColumnSizing,
|
|
168
|
+
resolveKind
|
|
169
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Cell kinds (`meta.kind`, SPEC § 6.6). Each class is the CHROME of one kind on its `<td>`; the font
|
|
3
|
+
* SIZE stays the theme's `sm` on `td`. Colours are tokens, never literals.
|
|
4
|
+
*/
|
|
5
|
+
.entity {
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
font-weight: 500;
|
|
9
|
+
color: var(--vx-ink);
|
|
10
|
+
text-overflow: ellipsis;
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.status {
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* SPEC D33: figures are the proportional sans with lining tabular numerals; only times are mono. */
|
|
19
|
+
.number {
|
|
20
|
+
font-variant-numeric: tabular-nums;
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
color: var(--vx-ink);
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.relativeTime {
|
|
27
|
+
font-family: var(--mantine-font-family-monospace);
|
|
28
|
+
font-variant-numeric: tabular-nums;
|
|
29
|
+
color: var(--vx-muted);
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.meter {
|
|
34
|
+
min-width: calc(4rem * var(--mantine-scale));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.text {
|
|
38
|
+
color: var(--vx-ink);
|
|
39
|
+
white-space: normal;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* An absent value: a muted em dash, never an empty cell. */
|
|
43
|
+
.dash {
|
|
44
|
+
color: var(--vx-faint);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* The full date for assistive tech, inside the `<time>`: visually hidden, still announced. */
|
|
48
|
+
.srOnly {
|
|
49
|
+
position: absolute;
|
|
50
|
+
width: 1px;
|
|
51
|
+
height: 1px;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
clip-path: inset(50%);
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly dash: string
|
|
7
|
+
readonly entity: string
|
|
8
|
+
readonly meter: string
|
|
9
|
+
readonly number: string
|
|
10
|
+
readonly relativeTime: string
|
|
11
|
+
readonly srOnly: string
|
|
12
|
+
readonly status: string
|
|
13
|
+
readonly text: string
|
|
14
|
+
}
|
|
15
|
+
export default classes
|