basalt-ui 2.28.0 → 2.29.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 +461 -401
- package/MIGRATING.md +202 -12
- package/agent/skills/basalt-app/SKILL.md +3 -3
- package/agent/skills/basalt-charts/SKILL.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +11 -5
- package/agent/skills/basalt-design/references/catalogue.md +3 -1
- package/agent/skills/basalt-design/references/recipes.md +1 -1
- package/agent/skills/basalt-design/references/states.md +1 -1
- package/configs/oxlint-plugin.js +2 -1
- package/configs/oxlint.json +1 -0
- package/dist/charts/ChartCard.d.ts +9 -5
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +68 -12
- package/dist/charts/Sparkline.d.ts +5 -0
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +53 -5
- package/dist/charts/chart-box.module.css +9 -2
- package/dist/charts/chart-card.module.css +16 -13
- package/dist/charts/chart-card.module.css.d.ts +2 -0
- package/dist/charts/compile.d.ts +1 -1
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +18 -9
- package/dist/charts/ref-label.d.ts +6 -0
- package/dist/charts/ref-label.d.ts.map +1 -1
- package/dist/charts/ref-label.js +19 -5
- package/dist/charts/sparkline.module.css +44 -0
- package/dist/charts/sparkline.module.css.d.ts +3 -0
- package/dist/charts/state.d.ts +1 -1
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +3 -3
- package/dist/cli/doctor-upgrade.d.ts +11 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +54 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +32 -0
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +8 -3
- package/dist/cli/index.d.ts +13 -13
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +36 -2
- package/dist/cli/init.d.ts +6 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +118 -27
- package/dist/cli/router-wiring.d.ts +3 -0
- package/dist/cli/router-wiring.d.ts.map +1 -1
- package/dist/cli/router-wiring.js +2 -0
- package/dist/cli/shot/capture.d.ts +28 -1
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +77 -7
- package/dist/cli/shot/detect.d.ts +4 -1
- package/dist/cli/shot/detect.d.ts.map +1 -1
- package/dist/cli/shot/detect.js +38 -16
- package/dist/cli/shot/index.d.ts.map +1 -1
- package/dist/cli/shot/index.js +9 -2
- package/dist/cli/shot/measure.d.ts.map +1 -1
- package/dist/cli/shot/measure.js +11 -2
- package/dist/cli/shot/types.d.ts +4 -1
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +10 -2
- package/dist/common/could-not-load.d.ts +13 -0
- package/dist/common/could-not-load.d.ts.map +1 -0
- package/dist/common/could-not-load.js +14 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +3 -0
- package/dist/common/props.d.ts +20 -0
- package/dist/common/props.d.ts.map +1 -1
- package/dist/common/props.js +13 -1
- package/dist/common/retry-button.module.css +7 -3
- package/dist/dashboard/bar-list.d.ts +4 -4
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +10 -7
- package/dist/dashboard/bar-list.module.css +21 -3
- package/dist/dashboard/board.d.ts +2 -2
- package/dist/dashboard/board.d.ts.map +1 -1
- package/dist/dashboard/board.js +31 -12
- package/dist/dashboard/board.module.css +19 -0
- package/dist/dashboard/board.module.css.d.ts +2 -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 +4 -2
- package/dist/dashboard/event-list-model.d.ts +3 -0
- package/dist/dashboard/event-list-model.d.ts.map +1 -1
- package/dist/dashboard/event-list-model.js +5 -1
- package/dist/dashboard/event-list-rows.d.ts.map +1 -1
- package/dist/dashboard/event-list-rows.js +2 -6
- package/dist/dashboard/event-list-scroll.d.ts +32 -4
- package/dist/dashboard/event-list-scroll.d.ts.map +1 -1
- package/dist/dashboard/event-list-scroll.js +117 -4
- package/dist/dashboard/event-list-skeleton.d.ts.map +1 -1
- package/dist/dashboard/event-list-skeleton.js +2 -4
- package/dist/dashboard/event-list.d.ts +4 -4
- package/dist/dashboard/event-list.d.ts.map +1 -1
- package/dist/dashboard/event-list.js +53 -23
- package/dist/dashboard/event-list.module.css +90 -37
- package/dist/dashboard/event-list.module.css.d.ts +1 -0
- package/dist/dashboard/meter-model.d.ts +6 -3
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +9 -4
- package/dist/dashboard/meter-parts.d.ts +3 -0
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +32 -4
- package/dist/dashboard/meter.d.ts +3 -3
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +10 -2
- package/dist/dashboard/meter.module.css +18 -11
- package/dist/dashboard/meter.module.css.d.ts +0 -1
- package/dist/dashboard/page-summary.d.ts +3 -3
- package/dist/dashboard/page-summary.d.ts.map +1 -1
- package/dist/dashboard/page-summary.js +7 -2
- package/dist/dashboard/page-summary.module.css +5 -2
- package/dist/dashboard/query-state.d.ts +9 -8
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +28 -10
- package/dist/dashboard/section.d.ts +11 -3
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.js +34 -7
- package/dist/dashboard/settings-section.d.ts +4 -4
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +11 -7
- package/dist/dashboard/settings-section.module.css +6 -0
- package/dist/dashboard/settings-section.module.css.d.ts +1 -0
- package/dist/dashboard/stat-card.d.ts +3 -3
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +24 -8
- package/dist/dashboard/stat-card.module.css +11 -0
- package/dist/dashboard/stat-group.d.ts +2 -2
- package/dist/dashboard/stat-group.d.ts.map +1 -1
- package/dist/dashboard/stat-group.js +10 -3
- package/dist/dashboard/stat-strip.d.ts +5 -4
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +41 -31
- package/dist/dashboard/stat-strip.module.css +4 -5
- package/dist/dashboard/visual-slot.d.ts +4 -0
- package/dist/dashboard/visual-slot.d.ts.map +1 -1
- package/dist/dashboard/visual-slot.js +2 -0
- package/dist/dashboard/widget-header.d.ts +6 -6
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +4 -2
- package/dist/dashboard/widget-header.module.css +6 -25
- package/dist/format/shared.d.ts.map +1 -1
- package/dist/format/shared.js +24 -1
- package/dist/guard/index.d.ts +1 -1
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +2 -1
- package/dist/styles.css +23 -0
- package/dist/table/cell-kinds.d.ts +10 -7
- package/dist/table/cell-kinds.d.ts.map +1 -1
- package/dist/table/cell-kinds.js +18 -7
- package/dist/table/data-table-fold.d.ts +13 -5
- package/dist/table/data-table-fold.d.ts.map +1 -1
- package/dist/table/data-table-fold.js +48 -16
- package/dist/table/data-table.d.ts +2 -2
- package/dist/table/data-table.d.ts.map +1 -1
- package/dist/table/data-table.js +16 -9
- package/dist/table/data-table.module.css +74 -2
- package/dist/table/data-table.module.css.d.ts +4 -0
- package/dist/theme/controls.module.css +23 -2
- package/llms.txt +263 -2
- package/package.json +1 -1
- package/src/charts/ChartCard.tsx +98 -16
- package/src/charts/Sparkline.tsx +84 -5
- package/src/charts/chart-box.module.css +9 -2
- package/src/charts/chart-card.module.css +16 -13
- package/src/charts/chart-card.module.css.d.ts +2 -0
- package/src/charts/compile.ts +37 -15
- package/src/charts/ref-label.ts +36 -9
- package/src/charts/sparkline.module.css +44 -0
- package/src/charts/sparkline.module.css.d.ts +3 -0
- package/src/charts/state.tsx +4 -3
- package/src/cli/doctor-upgrade.ts +75 -0
- package/src/cli/doctor.ts +36 -0
- package/src/cli/help.ts +16 -6
- package/src/cli/index.ts +73 -67
- package/src/cli/init.ts +157 -36
- package/src/cli/router-wiring.ts +2 -2
- package/src/cli/shot/capture.ts +109 -10
- package/src/cli/shot/detect.ts +46 -22
- package/src/cli/shot/index.ts +8 -2
- package/src/cli/shot/measure.ts +11 -2
- package/src/cli/shot/types.ts +4 -1
- package/src/cli/sync.ts +12 -2
- package/src/common/could-not-load.ts +22 -0
- package/src/common/index.ts +1 -0
- package/src/common/props.ts +30 -0
- package/src/common/retry-button.module.css +7 -3
- package/src/dashboard/bar-list.module.css +21 -3
- package/src/dashboard/bar-list.tsx +46 -41
- package/src/dashboard/board.module.css +19 -0
- package/src/dashboard/board.module.css.d.ts +2 -0
- package/src/dashboard/board.tsx +69 -48
- package/src/dashboard/empty-state.tsx +5 -2
- package/src/dashboard/event-list-model.ts +13 -1
- package/src/dashboard/event-list-rows.tsx +3 -6
- package/src/dashboard/event-list-scroll.ts +154 -8
- package/src/dashboard/event-list-skeleton.tsx +5 -1
- package/src/dashboard/event-list.module.css +90 -37
- package/src/dashboard/event-list.module.css.d.ts +1 -0
- package/src/dashboard/event-list.tsx +92 -65
- package/src/dashboard/meter-model.ts +16 -7
- package/src/dashboard/meter-parts.tsx +45 -13
- package/src/dashboard/meter.module.css +18 -11
- package/src/dashboard/meter.module.css.d.ts +0 -1
- package/src/dashboard/meter.tsx +36 -18
- package/src/dashboard/page-summary.module.css +5 -2
- package/src/dashboard/page-summary.tsx +13 -6
- package/src/dashboard/query-state.tsx +54 -29
- package/src/dashboard/section.tsx +83 -41
- package/src/dashboard/settings-section.module.css +6 -0
- package/src/dashboard/settings-section.module.css.d.ts +1 -0
- package/src/dashboard/settings-section.tsx +11 -6
- package/src/dashboard/stat-card.module.css +11 -0
- package/src/dashboard/stat-card.tsx +31 -8
- package/src/dashboard/stat-group.tsx +22 -14
- package/src/dashboard/stat-strip.module.css +4 -5
- package/src/dashboard/stat-strip.tsx +29 -20
- package/src/dashboard/visual-slot.ts +5 -0
- package/src/dashboard/widget-header.module.css +6 -25
- package/src/dashboard/widget-header.tsx +8 -5
- package/src/format/shared.ts +30 -1
- package/src/guard/index.ts +5 -1
- package/src/styles.css +23 -0
- package/src/table/cell-kinds.tsx +42 -13
- package/src/table/data-table-fold.tsx +65 -12
- package/src/table/data-table.module.css +74 -2
- package/src/table/data-table.module.css.d.ts +4 -0
- package/src/table/data-table.tsx +34 -13
- package/src/theme/controls.module.css +23 -2
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
* </StatGroup>
|
|
34
34
|
*/
|
|
35
35
|
import type { ReactNode } from 'react';
|
|
36
|
-
import type { BasaltProps } from '../common/props.js';
|
|
36
|
+
import type { BasaltProps, DataAttributes } from '../common/props.js';
|
|
37
37
|
import type { StatStripProps } from './stat-strip.js';
|
|
38
38
|
/** The desktop KPI column count. */
|
|
39
39
|
export type StatGroupCols = 2 | 3 | 4 | 5;
|
|
40
|
-
export type StatGridProps = BasaltProps & {
|
|
40
|
+
export type StatGridProps = BasaltProps & DataAttributes & {
|
|
41
41
|
variant?: 'grid';
|
|
42
42
|
/** The DESKTOP column count (`lg` and up). Default `4`. `sm` gets `min(cols, 3)` — except `4`, which gets 2 rather than an orphan row. A phone gets 2.
|
|
43
43
|
* Never a responsive object — the law is basalt's, see the module docblock. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-group.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-group.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"stat-group.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-group.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAGlD,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEzC,MAAM,MAAM,aAAa,GAAG,WAAW,GACrC,cAAc,GAAG;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;mFAC+E;IAC/E,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAEH;4FAC4F;AAC5F,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,cAAc,CAAC,CAAA;AAEpF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAM9C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cx } from "../common/props.js";
|
|
2
|
+
import { cx, pickDataAttributes } from "../common/props.js";
|
|
3
3
|
import { StatStrip } from "./stat-strip.js";
|
|
4
4
|
import classes from "./stat-group.module.css";
|
|
5
5
|
function StatGroup(props) {
|
|
@@ -9,7 +9,14 @@ function StatGroup(props) {
|
|
|
9
9
|
}
|
|
10
10
|
return /* @__PURE__ */ jsx(StatGrid, { ...props });
|
|
11
11
|
}
|
|
12
|
-
function StatGrid({
|
|
12
|
+
function StatGrid({
|
|
13
|
+
cols = 4,
|
|
14
|
+
divided = false,
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
style,
|
|
18
|
+
...rest
|
|
19
|
+
}) {
|
|
13
20
|
const smCols = cols === 4 ? 2 : Math.min(cols, 3);
|
|
14
21
|
return (
|
|
15
22
|
// Two boxes, and the outer one is not decoration: a size container is a container for its
|
|
@@ -19,7 +26,7 @@ function StatGrid({ cols = 4, divided = false, children, className, style }) {
|
|
|
19
26
|
// sized is the whole point. `container-type: inline-size` contains the inline axis only, so the
|
|
20
27
|
// wrapper's block size still comes from the grid: no percentage height resolves differently,
|
|
21
28
|
// and there is no paint containment, so nothing inside is clipped.
|
|
22
|
-
/* @__PURE__ */ jsx("div", { className: cx(classes.container, className), style, children: /* @__PURE__ */ jsx(
|
|
29
|
+
/* @__PURE__ */ jsx("div", { ...pickDataAttributes(rest), className: cx(classes.container, className), style, children: /* @__PURE__ */ jsx(
|
|
23
30
|
"div",
|
|
24
31
|
{
|
|
25
32
|
className: classes.root,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { BasaltProps, Tone } from '../common/props.js';
|
|
2
|
+
import type { BasaltProps, DataAttributes, Tone } from '../common/props.js';
|
|
3
3
|
/** The URL shot states an anchor can declare itself absent in (`data-shot-absent`). */
|
|
4
4
|
type StatStripShotState = 'empty' | 'loading' | 'error';
|
|
5
5
|
export type StatStripRow = {
|
|
@@ -76,17 +76,18 @@ export type StatStripFooterEntry = {
|
|
|
76
76
|
* omits where the strip itself shows, e.g. a fact that needs data the empty state lacks). */
|
|
77
77
|
shotAbsent?: readonly StatStripShotState[];
|
|
78
78
|
};
|
|
79
|
-
export type StatStripProps = BasaltProps & {
|
|
79
|
+
export type StatStripProps = BasaltProps & DataAttributes & {
|
|
80
80
|
/** The strip's accessible name. */
|
|
81
81
|
label: string;
|
|
82
82
|
cells: readonly StatStripCell[];
|
|
83
83
|
/** Wider cells under the cells. */
|
|
84
84
|
footer?: readonly StatStripFooterEntry[];
|
|
85
|
-
/** The DESKTOP column count. Default: the cell count, capped at 6.
|
|
85
|
+
/** The DESKTOP column count. Default: the cell count, capped at 6. A lone cell takes the whole strip
|
|
86
|
+
* whatever `cols` says. */
|
|
86
87
|
cols?: 2 | 3 | 4 | 5 | 6;
|
|
87
88
|
/** The shot states the page hides the whole strip in (`data-shot-absent` on every derived anchor). */
|
|
88
89
|
shotAbsent?: readonly StatStripShotState[];
|
|
89
90
|
};
|
|
90
|
-
export declare function StatStrip({ label, cells, footer, cols, shotAbsent, className, style, }: StatStripProps): import("react").JSX.Element;
|
|
91
|
+
export declare function StatStrip({ label, cells, footer, cols, shotAbsent, className, style, ...domProps }: StatStripProps): import("react").JSX.Element;
|
|
91
92
|
export {};
|
|
92
93
|
//# sourceMappingURL=stat-strip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-strip.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-strip.tsx"],"names":[],"mappings":"AA4CA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAIrD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"stat-strip.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-strip.tsx"],"names":[],"mappings":"AA4CA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAIrD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AASxE,uFAAuF;AACvF,KAAK,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAKvD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,KAAK,EAAE,MAAM,GAAG,IAAI,CA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AkB,CAAA;IAC1B,0FAA0F;IAC1F,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,SAAS,CAAA;IAClB;;+DAE2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;iGAC6F;IAC7F,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,WAAW,GACtC,cAAc,GAAG;IACf,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IAC/B,mCAAmC;IACnC,MAAM,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAA;IACxC;+BAC2B;IAC3B,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACxB,sGAAsG;IACtG,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAC3C,CAAA;AAyPH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,GAAG,QAAQ,EACZ,EAAE,cAAc,+BA4FhB"}
|
|
@@ -3,16 +3,17 @@ import { Card, Skeleton } from "@mantine/core";
|
|
|
3
3
|
import { useId, useRef } from "react";
|
|
4
4
|
import { toErrorMessage } from "../common/errors.js";
|
|
5
5
|
import { useIsomorphicLayoutEffect } from "../common/isomorphic-layout-effect.js";
|
|
6
|
-
import { cx } from "../common/props.js";
|
|
6
|
+
import { cx, pickDataAttributes } from "../common/props.js";
|
|
7
7
|
import { RetryButton } from "../common/retry-button.js";
|
|
8
8
|
import { StatusDot } from "../theme/status-dot.js";
|
|
9
9
|
import { VX } from "../tokens/index.js";
|
|
10
10
|
import { InfoGlyph } from "./widget-header.js";
|
|
11
11
|
import classes from "./stat-strip.module.css";
|
|
12
|
-
import {
|
|
12
|
+
import { couldNotLoad } from "../common/could-not-load.js";
|
|
13
|
+
import { HOSTED, HOSTED_LOADING, HOSTED_COMPACT, VisualSlotContext } from "./visual-slot.js";
|
|
13
14
|
const absentAttr = (states) => states === void 0 || states.length === 0 ? {} : { "data-shot-absent": states.join(" ") };
|
|
14
15
|
const EMPTY = "\u2014";
|
|
15
|
-
function CellState({ state }) {
|
|
16
|
+
function CellState({ state, caption }) {
|
|
16
17
|
if (state.kind === "empty") {
|
|
17
18
|
if (state.reason !== void 0) {
|
|
18
19
|
return /* @__PURE__ */ jsx("p", { className: classes.reason, "data-strip-reason": true, children: state.reason });
|
|
@@ -23,7 +24,7 @@ function CellState({ state }) {
|
|
|
23
24
|
return /* @__PURE__ */ jsxs("div", { className: classes.error, role: "alert", "data-strip-state": "error", children: [
|
|
24
25
|
/* @__PURE__ */ jsxs("span", { className: classes.errorHead, children: [
|
|
25
26
|
/* @__PURE__ */ jsx(StatusDot, { color: VX.status.bad }),
|
|
26
|
-
|
|
27
|
+
couldNotLoad(caption)
|
|
27
28
|
] }),
|
|
28
29
|
/* @__PURE__ */ jsx("p", { className: classes.reason, children: message }),
|
|
29
30
|
state.onRetry !== void 0 && /* @__PURE__ */ jsx(RetryButton, { onClick: state.onRetry, retrying: state.retrying ?? false })
|
|
@@ -121,7 +122,7 @@ function StripCell({
|
|
|
121
122
|
] }),
|
|
122
123
|
cell.action !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.action, "data-strip-action": true, children: cell.action })
|
|
123
124
|
] }),
|
|
124
|
-
state !== void 0 && /* @__PURE__ */ jsx(CellState, { state }),
|
|
125
|
+
state !== void 0 && /* @__PURE__ */ jsx(CellState, { state, caption: cell.caption }),
|
|
125
126
|
state === void 0 && hasHero && heroEl
|
|
126
127
|
] }),
|
|
127
128
|
state === void 0 && cell.visual !== void 0 && /* @__PURE__ */ jsxs(
|
|
@@ -138,7 +139,7 @@ function StripCell({
|
|
|
138
139
|
),
|
|
139
140
|
state === void 0 && rows !== void 0 && (loading ? /* @__PURE__ */ jsx("div", { className: classes.rows, "aria-hidden": "true", children: rows.map((row) => /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonRow, radius: "sm" }, row.key)) }) : /* @__PURE__ */ jsx("ul", { className: classes.rows, "data-strip-rows": true, children: rows.map((row) => /* @__PURE__ */ jsxs("li", { className: classes.row, "data-strip-row": row.key, children: [
|
|
140
141
|
/* @__PURE__ */ jsx("span", { className: classes.rowLabel, children: row.label }),
|
|
141
|
-
/* @__PURE__ */ jsx("span", { className: classes.visual, children: /* @__PURE__ */ jsx(VisualSlotContext.Provider, { value:
|
|
142
|
+
/* @__PURE__ */ jsx("span", { className: classes.visual, children: /* @__PURE__ */ jsx(VisualSlotContext.Provider, { value: HOSTED_COMPACT, children: row.visual }) }),
|
|
142
143
|
/* @__PURE__ */ jsx("span", { className: classes.rowValue, "data-strip-row-value": true, children: row.hideValue ? null : row.value ?? EMPTY }),
|
|
143
144
|
/* @__PURE__ */ jsx("span", { children: row.delta })
|
|
144
145
|
] }, row.key)) })),
|
|
@@ -185,9 +186,10 @@ function StatStrip({
|
|
|
185
186
|
cols,
|
|
186
187
|
shotAbsent,
|
|
187
188
|
className,
|
|
188
|
-
style
|
|
189
|
+
style,
|
|
190
|
+
...domProps
|
|
189
191
|
}) {
|
|
190
|
-
const desktop = cols ?? Math.min(Math.max(cells.length, 2), 6);
|
|
192
|
+
const desktop = cells.length === 1 ? 1 : cols ?? Math.min(Math.max(cells.length, 2), 6);
|
|
191
193
|
const mid = desktop === 4 ? 2 : Math.min(desktop, 3);
|
|
192
194
|
const keys = new Set(cells.map((cell) => cell.key));
|
|
193
195
|
const underOf = (key) => footer?.filter((entry) => entry.under === key) ?? [];
|
|
@@ -231,32 +233,40 @@ function StatStrip({
|
|
|
231
233
|
observer.observe(grid);
|
|
232
234
|
for (const head of grid.querySelectorAll("[data-strip-head]")) observer.observe(head);
|
|
233
235
|
}, [cells, footer]);
|
|
234
|
-
return /* @__PURE__ */ jsx(
|
|
235
|
-
|
|
236
|
+
return /* @__PURE__ */ jsx(
|
|
237
|
+
"div",
|
|
236
238
|
{
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
shotAbsent,
|
|
252
|
-
under: underOf(cell.key)
|
|
239
|
+
...pickDataAttributes(domProps),
|
|
240
|
+
className: cx(classes.container, className),
|
|
241
|
+
style,
|
|
242
|
+
children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(
|
|
243
|
+
Card.Section,
|
|
244
|
+
{
|
|
245
|
+
component: "section",
|
|
246
|
+
"aria-label": label,
|
|
247
|
+
className: classes.clip,
|
|
248
|
+
...hasQualifier && { "data-strip-qualifier": "" },
|
|
249
|
+
...hasAction && { "data-strip-action-row": "" },
|
|
250
|
+
style: {
|
|
251
|
+
"--basalt-strip-cols": desktop,
|
|
252
|
+
"--basalt-strip-cols-sm": mid
|
|
253
253
|
},
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
254
|
+
children: [
|
|
255
|
+
/* @__PURE__ */ jsx("div", { ref: gridRef, className: classes.cells, children: cells.map((cell) => /* @__PURE__ */ jsx(
|
|
256
|
+
StripCell,
|
|
257
|
+
{
|
|
258
|
+
cell,
|
|
259
|
+
shotAbsent,
|
|
260
|
+
under: underOf(cell.key)
|
|
261
|
+
},
|
|
262
|
+
cell.key
|
|
263
|
+
)) }),
|
|
264
|
+
rest.length > 0 && /* @__PURE__ */ jsx("div", { className: classes.footerRow, children: rest.map((entry) => /* @__PURE__ */ jsx(FooterCell, { entry, shotAbsent, under: false }, entry.key)) })
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
) })
|
|
258
268
|
}
|
|
259
|
-
)
|
|
269
|
+
);
|
|
260
270
|
}
|
|
261
271
|
export {
|
|
262
272
|
StatStrip
|
|
@@ -36,9 +36,6 @@
|
|
|
36
36
|
min-width: 0;
|
|
37
37
|
container-type: inline-size;
|
|
38
38
|
container-name: basalt-card;
|
|
39
|
-
/* The foot inset lives HERE, on the row-high slot, so a cell that ends early keeps the strip's
|
|
40
|
-
* surface under it. */
|
|
41
|
-
padding-block-end: var(--vx-space-stack-md);
|
|
42
39
|
box-shadow:
|
|
43
40
|
-1px 0 0 var(--vx-divider),
|
|
44
41
|
0 -1px 0 var(--vx-divider);
|
|
@@ -50,7 +47,7 @@
|
|
|
50
47
|
flex-direction: column;
|
|
51
48
|
align-self: start;
|
|
52
49
|
min-width: 0;
|
|
53
|
-
padding: var(--vx-space-stack-md)
|
|
50
|
+
padding: var(--vx-space-stack-md);
|
|
54
51
|
}
|
|
55
52
|
|
|
56
53
|
/* Forced colors drop box-shadows, so the hairlines come back as CanvasText borders. Every cell takes
|
|
@@ -166,6 +163,8 @@
|
|
|
166
163
|
* it, whether it sat beside the caption or wrapped under it, so values share a baseline. */
|
|
167
164
|
@container basalt-card (max-width: 239.9px) {
|
|
168
165
|
.qualifier {
|
|
166
|
+
/* Always on its own line under the caption: whether it fits beside it must not vary cell to cell. */
|
|
167
|
+
flex-basis: 100%;
|
|
169
168
|
line-height: 1.25;
|
|
170
169
|
}
|
|
171
170
|
|
|
@@ -390,7 +389,7 @@
|
|
|
390
389
|
.underCell {
|
|
391
390
|
min-width: 0;
|
|
392
391
|
font-size: var(--vx-text-sm);
|
|
393
|
-
margin: var(--vx-space-stack-md)
|
|
392
|
+
margin: var(--vx-space-stack-md);
|
|
394
393
|
padding-block-start: var(--vx-space-stack-sm);
|
|
395
394
|
border-block-start: 1px solid var(--vx-divider);
|
|
396
395
|
}
|
|
@@ -3,10 +3,14 @@ export interface VisualSlot {
|
|
|
3
3
|
readonly tone?: Tone;
|
|
4
4
|
/** The host is loading: a `Meter` in the slot draws its loading state without its own `loading`. */
|
|
5
5
|
readonly loading?: boolean;
|
|
6
|
+
/** A slot with no room for a caption (a multi-row cell's row, a `right`-placed sparkline): its `Sparkline` states no window of its own. */
|
|
7
|
+
readonly compact?: true;
|
|
6
8
|
}
|
|
7
9
|
/** A host with no verdict of its own: one shared object, so a provider never re-renders its readers. */
|
|
8
10
|
export declare const HOSTED: VisualSlot;
|
|
9
11
|
/** `HOSTED` while the host loads. */
|
|
10
12
|
export declare const HOSTED_LOADING: VisualSlot;
|
|
13
|
+
/** A slot too small for a caption under its visual. */
|
|
14
|
+
export declare const HOSTED_COMPACT: VisualSlot;
|
|
11
15
|
export declare const VisualSlotContext: import("react").Context<VisualSlot | null>;
|
|
12
16
|
//# sourceMappingURL=visual-slot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual-slot.d.ts","sourceRoot":"","sources":["../../src/dashboard/visual-slot.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;IACpB,oGAAoG;IACpG,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"visual-slot.d.ts","sourceRoot":"","sources":["../../src/dashboard/visual-slot.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;IACpB,oGAAoG;IACpG,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,2IAA2I;IAC3I,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAA;CACxB;AAED,wGAAwG;AACxG,eAAO,MAAM,MAAM,EAAE,UAAe,CAAA;AAEpC,qCAAqC;AACrC,eAAO,MAAM,cAAc,EAAE,UAA8B,CAAA;AAE3D,uDAAuD;AACvD,eAAO,MAAM,cAAc,EAAE,UAA8B,CAAA;AAE3D,eAAO,MAAM,iBAAiB,4CAAyC,CAAA"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
const HOSTED = {};
|
|
3
3
|
const HOSTED_LOADING = { loading: true };
|
|
4
|
+
const HOSTED_COMPACT = { compact: true };
|
|
4
5
|
const VisualSlotContext = createContext(null);
|
|
5
6
|
export {
|
|
6
7
|
HOSTED,
|
|
8
|
+
HOSTED_COMPACT,
|
|
7
9
|
HOSTED_LOADING,
|
|
8
10
|
VisualSlotContext
|
|
9
11
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { BasaltProps, SlotStylesProps } from '../common/props.js';
|
|
2
|
+
import type { BasaltProps, DataAttributes, SlotStylesProps } from '../common/props.js';
|
|
3
3
|
import type { DeltaPolarity } from './delta-badge.js';
|
|
4
4
|
export type WidgetHeaderTier = 'section' | 'widget' | 'group';
|
|
5
5
|
/**
|
|
@@ -13,7 +13,7 @@ export type WidgetHeaderTier = 'section' | 'widget' | 'group';
|
|
|
13
13
|
* caller can class itself.
|
|
14
14
|
*/
|
|
15
15
|
export type WidgetHeaderSlot = 'root' | 'title' | 'metric' | 'icon';
|
|
16
|
-
export type WidgetHeaderProps = BasaltProps & SlotStylesProps<WidgetHeaderSlot> & {
|
|
16
|
+
export type WidgetHeaderProps = BasaltProps & DataAttributes & SlotStylesProps<WidgetHeaderSlot> & {
|
|
17
17
|
/** `section` renders an `<h2>` at the section-header height; `widget` renders an `<h3>` at the
|
|
18
18
|
* tighter icon-tier height, display-only; `group` also renders an `<h3>` but as the quietest
|
|
19
19
|
* heading rank on the page — mono micro uppercase faint, one step below `widget` — for an
|
|
@@ -24,9 +24,9 @@ export type WidgetHeaderProps = BasaltProps & SlotStylesProps<WidgetHeaderSlot>
|
|
|
24
24
|
title: string;
|
|
25
25
|
/** Optional leading icon, rendered before the title. Decorative — hidden from assistive tech. */
|
|
26
26
|
icon?: ReactNode;
|
|
27
|
-
/** Optional muted line rendered below the title row.
|
|
28
|
-
*
|
|
29
|
-
* exactly one of the two shows). */
|
|
27
|
+
/** Optional muted line rendered below the title row. Visible text at every width (it wraps
|
|
28
|
+
* under the title); in a card shorter than 280px it folds into the info glyph's bubble instead
|
|
29
|
+
* (CSS only — exactly one of the two shows). */
|
|
30
30
|
subtitle?: string;
|
|
31
31
|
/**
|
|
32
32
|
* Renders an info glyph BESIDE the heading (never inside it — this text would otherwise become
|
|
@@ -138,5 +138,5 @@ export declare function InfoGlyph({ text, note, ariaLabel, className, }: {
|
|
|
138
138
|
ariaLabel?: string;
|
|
139
139
|
className?: string;
|
|
140
140
|
}): import("react").JSX.Element;
|
|
141
|
-
export declare function WidgetHeader({ tier, title, icon, subtitle, info, value, unit, delta, deltaPeriod, deltaPolarity, deltaFormat, deltaGlyph, sparkline, count, actions, className, style, classNames, }: WidgetHeaderProps): import("react").JSX.Element;
|
|
141
|
+
export declare function WidgetHeader({ tier, title, icon, subtitle, info, value, unit, delta, deltaPeriod, deltaPolarity, deltaFormat, deltaGlyph, sparkline, count, actions, className, style, classNames, ...rest }: WidgetHeaderProps): import("react").JSX.Element;
|
|
142
142
|
//# sourceMappingURL=widget-header.d.ts.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"widget-header.d.ts","sourceRoot":"","sources":["../../src/dashboard/widget-header.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,SAAS,EAAa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;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC,CAAA;AAEpG;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,CAAC,CAAA;AAE/E;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,iBAAiB,EACjB,OAAO,GAAG,aAAa,GAAG,eAAe,GAAG,aAAa,GAAG,YAAY,CACzE,CAAA;AA0HD;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,SAA8B,EAC9B,SAAS,GACV,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,+FAA+F;IAC/F,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;2DAGuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,+BA2EA;AAED,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,EACV,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAoEnB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useId, useRef, useState } from "react";
|
|
3
3
|
import { useIsomorphicLayoutEffect } from "../common/isomorphic-layout-effect.js";
|
|
4
|
-
import { cx } from "../common/props.js";
|
|
4
|
+
import { cx, pickDataAttributes } from "../common/props.js";
|
|
5
5
|
import { IconSlot } from "../theme/icon-slot.js";
|
|
6
6
|
import { DeltaBadge } from "./delta-badge.js";
|
|
7
7
|
import classes from "./widget-header.module.css";
|
|
@@ -164,12 +164,14 @@ function WidgetHeader({
|
|
|
164
164
|
actions,
|
|
165
165
|
className,
|
|
166
166
|
style,
|
|
167
|
-
classNames
|
|
167
|
+
classNames,
|
|
168
|
+
...rest
|
|
168
169
|
}) {
|
|
169
170
|
const Heading = tier === "section" ? "h2" : "h3";
|
|
170
171
|
return /* @__PURE__ */ jsxs(
|
|
171
172
|
"div",
|
|
172
173
|
{
|
|
174
|
+
...pickDataAttributes(rest),
|
|
173
175
|
className: cx(classes.root, classNames?.root, className),
|
|
174
176
|
"data-tier": tier,
|
|
175
177
|
...style !== void 0 && { style },
|
|
@@ -10,9 +10,8 @@
|
|
|
10
10
|
* `--mantine-spacing-*` fallbacks.
|
|
11
11
|
*
|
|
12
12
|
* Layout keys on the enclosing card's OWN width (`container: basalt-card`, declared by ChartCard /
|
|
13
|
-
* StatCard / Section — docs/DESIGN-CORE.md § Layout, elevation, shapes), never the viewport:
|
|
14
|
-
*
|
|
15
|
-
* shrinking are unconditional. The subtitle ALSO folds (regardless of width) whenever the card's own
|
|
13
|
+
* StatCard / Section — docs/DESIGN-CORE.md § Layout, elevation, shapes), never the viewport: the subtitle stays visible text at every width (it wraps under the title); from 480px (wave 8) `value` + `delta` move onto the title row. Wrapping and
|
|
14
|
+
* shrinking are unconditional. The subtitle folds into the info glyph (regardless of width) only when the card's own
|
|
16
15
|
* height is under 280px — see the `[data-basalt-card-short]` block below (wave 8's header-economy
|
|
17
16
|
* law). No enclosing card, no container: the standard layout. Container conditions are px literals
|
|
18
17
|
* of CONTAINER_CLASSES.
|
|
@@ -234,6 +233,7 @@
|
|
|
234
233
|
* section with both read as a two-line heading rather than a heading plus a note. */
|
|
235
234
|
.subtitle {
|
|
236
235
|
margin-top: 4px;
|
|
236
|
+
overflow-wrap: anywhere;
|
|
237
237
|
font-size: var(--vx-text-sm);
|
|
238
238
|
font-weight: 400;
|
|
239
239
|
color: var(--vx-muted);
|
|
@@ -380,24 +380,10 @@
|
|
|
380
380
|
color: var(--vx-muted);
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
-
/* Card narrower than 480px: the subtitle
|
|
384
|
-
*
|
|
383
|
+
/* Card narrower than 480px: the subtitle stays visible text under the title and wraps (a touch
|
|
384
|
+
* surface has no hover to open a fold glyph). A chart card also clamps it to two lines, then an
|
|
385
|
+
* ellipsis; the full text stays in the DOM. Only the short-height fold below still moves it. */
|
|
385
386
|
@container basalt-card (max-width: 479.9px) {
|
|
386
|
-
.subtitle {
|
|
387
|
-
display: none;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
.foldGlyph {
|
|
391
|
-
display: inline-flex;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
.foldNote {
|
|
395
|
-
display: block;
|
|
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
387
|
[data-basalt-chart-header] .subtitle {
|
|
402
388
|
display: -webkit-box;
|
|
403
389
|
-webkit-box-orient: vertical;
|
|
@@ -405,11 +391,6 @@
|
|
|
405
391
|
line-clamp: 2;
|
|
406
392
|
overflow: hidden;
|
|
407
393
|
}
|
|
408
|
-
|
|
409
|
-
[data-basalt-chart-header] .foldGlyph,
|
|
410
|
-
[data-basalt-chart-header] .foldNote {
|
|
411
|
-
display: none;
|
|
412
|
-
}
|
|
413
394
|
}
|
|
414
395
|
|
|
415
396
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/format/shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU,WAAM,CAAA;AAE7B,sDAAsD;AACtD,MAAM,MAA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,IAAI,GAAE,cAAmB,GAAG,IAAI,CAS5D;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,IAAI,IAAI,CAI1C;AAkCD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEjE;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,IAAI,CAAC,mBAAmB,GAChC,IAAI,CAAC,YAAY,CAGnB;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,IAAI,CAAC,qBAAqB,GAClC,IAAI,CAAC,cAAc,CASrB;AA6BD,mDAAmD;AACnD,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAE/C;+DAC+D;AAC/D,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAUlC;AAED;;;;0DAI0D;AAC1D,wBAAgB,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAGjE"}
|
package/dist/format/shared.js
CHANGED
|
@@ -48,7 +48,30 @@ function numberFormat(locale, options) {
|
|
|
48
48
|
function dateFormat(locale, options) {
|
|
49
49
|
const resolved = resolveLocale(locale);
|
|
50
50
|
const withZone = options.timeZone === void 0 && defaults.timeZone !== void 0 ? { ...options, timeZone: defaults.timeZone } : options;
|
|
51
|
-
return memoize(
|
|
51
|
+
return memoize(
|
|
52
|
+
dateCaches,
|
|
53
|
+
resolved,
|
|
54
|
+
withZone,
|
|
55
|
+
() => shortSeptember(new Intl.DateTimeFormat(resolved, withZone))
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
const toShortSeptember = (text) => text.replace(/\bSept\b/g, "Sep");
|
|
59
|
+
function shortSeptember(formatter) {
|
|
60
|
+
if (!formatter.resolvedOptions().locale.startsWith("en")) return formatter;
|
|
61
|
+
const nativeFormat = formatter.format;
|
|
62
|
+
const nativeParts = formatter.formatToParts.bind(formatter);
|
|
63
|
+
const format = (date) => toShortSeptember(nativeFormat(date));
|
|
64
|
+
const formatToParts = (date) => nativeParts(date).map(
|
|
65
|
+
(part) => part.type === "month" ? { ...part, value: toShortSeptember(part.value) } : part
|
|
66
|
+
);
|
|
67
|
+
const nativeRange = formatter.formatRange.bind(formatter);
|
|
68
|
+
const formatRange = (start, end) => toShortSeptember(nativeRange(start, end));
|
|
69
|
+
Object.defineProperties(formatter, {
|
|
70
|
+
format: { value: format },
|
|
71
|
+
formatRange: { value: formatRange },
|
|
72
|
+
formatToParts: { value: formatToParts }
|
|
73
|
+
});
|
|
74
|
+
return formatter;
|
|
52
75
|
}
|
|
53
76
|
function isFiniteNumber(value) {
|
|
54
77
|
return typeof value === "number" && Number.isFinite(value);
|
package/dist/guard/index.d.ts
CHANGED
|
@@ -201,7 +201,7 @@ export declare const GUARD_RULES: {
|
|
|
201
201
|
readonly kind: "raw-spacing";
|
|
202
202
|
readonly pattern: (cfg: GuardConfig) => RegExp;
|
|
203
203
|
readonly appliesTo: (relPath: string) => boolean;
|
|
204
|
-
readonly message:
|
|
204
|
+
readonly message: `Use the Mantine spacing token, not the number (p/m/gap): ${string}. A number that equals a step IS that token.`;
|
|
205
205
|
};
|
|
206
206
|
readonly 'raw-radius': {
|
|
207
207
|
readonly kind: "raw-radius";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,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,GAAG,MAAM,CAM9F"}
|
package/dist/guard/index.js
CHANGED
|
@@ -237,6 +237,7 @@ const SUB_16_FONT_SIZE = /font-?[Ss]ize\s*:\s*['"]?(-?\d+(?:\.\d+)?)(?:px)?['"]?
|
|
|
237
237
|
const DEFAULT_SPACING_STEPS = Object.values(SPACE_SCALE_LEVEL0).toSorted(
|
|
238
238
|
(a, b) => a - b
|
|
239
239
|
);
|
|
240
|
+
const SPACING_TOKEN_LIST = Object.entries(SPACE_SCALE_LEVEL0).map(([name, px]) => `${px} \u2192 "${name}"`).join(", ");
|
|
240
241
|
const DEFAULT_FORBIDDEN_ACCENTS = ["teal", "violet", "grape", "indigo", "pink"];
|
|
241
242
|
const DEFAULT_GUARD_CONFIG = {
|
|
242
243
|
spacingSteps: DEFAULT_SPACING_STEPS,
|
|
@@ -783,7 +784,7 @@ const GUARD_RULES = {
|
|
|
783
784
|
// JSX-prop-shaped (`p={16}`) — CSS has no `=`/`{}` prop syntax; gated off explicitly (see
|
|
784
785
|
// off-identity-accent above for why "never matches today" still gets an explicit gate).
|
|
785
786
|
appliesTo: (relPath) => !relPath.endsWith(".css"),
|
|
786
|
-
message:
|
|
787
|
+
message: `Use the Mantine spacing token, not the number (p/m/gap): ${SPACING_TOKEN_LIST}. A number that equals a step IS that token.`
|
|
787
788
|
},
|
|
788
789
|
"raw-radius": {
|
|
789
790
|
kind: "raw-radius",
|
package/dist/styles.css
CHANGED
|
@@ -153,6 +153,29 @@
|
|
|
153
153
|
font-size: max(var(--basalt-input-fz-floor, 16px), var(--input-fz, 1rem)) !important;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
/* Browser autofill paints its own yellow/blue over a field, and a focused Select keeps it. The UA
|
|
157
|
+
background cannot be overridden directly, so the field surface is painted over it with an inset
|
|
158
|
+
shadow and the long transition holds the UA colour off; text and caret keep the ink. A themed
|
|
159
|
+
`.input` sets its own `box-shadow` UNLAYERED, which outranks this layer: `controls.module.css`
|
|
160
|
+
re-points `--field-depth` under `:-webkit-autofill` for those. */
|
|
161
|
+
input:-webkit-autofill,
|
|
162
|
+
input:-webkit-autofill:hover,
|
|
163
|
+
input:-webkit-autofill:focus {
|
|
164
|
+
-webkit-text-fill-color: var(--vx-ink);
|
|
165
|
+
caret-color: var(--vx-ink);
|
|
166
|
+
box-shadow: 0 0 0 100vmax var(--vx-surface-field) inset;
|
|
167
|
+
transition: background-color 600000s 0s;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* A Slider's bar and thumb fill in ink, not the accent, unless it encodes a status: an explicit
|
|
171
|
+
`color=` writes `--slider-color` inline, which outranks this. Mantine's own default sits in
|
|
172
|
+
`@layer mantine`, so this layer wins. In the dark scheme the thumb is filled with the same var,
|
|
173
|
+
a light disc with its white border; the drag-value label does not read it. */
|
|
174
|
+
.mantine-Slider-root,
|
|
175
|
+
.mantine-RangeSlider-root {
|
|
176
|
+
--slider-color: var(--vx-ink);
|
|
177
|
+
}
|
|
178
|
+
|
|
156
179
|
/* `data-numeric` — one typographic law, every element. A number read as a MEASUREMENT (a preset
|
|
157
180
|
like `7d`/`30d`, a KPI value, a table cell, a count tag) is mono with tabular figures, so
|
|
158
181
|
digits line up column-wise and a changing value does not reflow its neighbours. Declared here,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Cell, Column, RowData } from '@tanstack/react-table';
|
|
1
|
+
import type { Cell, Column, Row, RowData } from '@tanstack/react-table';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { BasaltTableFeatures, DataTableAlign, DataTableColumnKind } from './table-features.js';
|
|
4
4
|
/**
|
|
@@ -15,14 +15,17 @@ export declare function resolveKind<T extends RowData>(column: Column<BasaltTabl
|
|
|
15
15
|
export declare function kindAlign(kind: DataTableColumnKind | undefined): DataTableAlign | undefined;
|
|
16
16
|
/**
|
|
17
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
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* hold one line), and the slack of a wide container goes to ONE place, so a value sits beside its name:
|
|
19
|
+
* the LAST data column when it is a `text`, `entity` or kindless one (the row's tail reads on after the
|
|
20
|
+
* columns before it); else the LAST `text` column (a notes/detail column that may wrap, ahead of figures);
|
|
21
|
+
* (one whose cells are not all short); else a trailing spacer after the last data column — never an `entity` with columns after it, which
|
|
22
|
+
* would put a short name hundreds of pixels from its next value.
|
|
21
23
|
* `fixedIds` (the checkbox and actions columns) fit too but are not data. An earlier `text` column
|
|
22
|
-
* keeps its auto share (it may wrap)
|
|
23
|
-
*
|
|
24
|
+
* keeps its auto share (it may wrap) unless every cell it holds is short ({@link SHORT_TEXT} characters:
|
|
25
|
+
* nothing to wrap, so it takes no slack either; `rows` says what it holds), and a table where no column
|
|
26
|
+
* opted into a kind renders as before: no fit marks, no spacer.
|
|
24
27
|
*/
|
|
25
|
-
export declare function planColumnSizing<T extends RowData>(columns: readonly Column<BasaltTableFeatures, T, unknown>[], fixedIds: ReadonlySet<string>): {
|
|
28
|
+
export declare function planColumnSizing<T extends RowData>(columns: readonly Column<BasaltTableFeatures, T, unknown>[], fixedIds: ReadonlySet<string>, rows: readonly Row<BasaltTableFeatures, T>[]): {
|
|
26
29
|
fitIds: ReadonlySet<string>;
|
|
27
30
|
spacer: boolean;
|
|
28
31
|
};
|
|
@@ -1 +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;
|
|
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,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAEvE,OA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