basalt-ui 2.22.0 → 2.23.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 +27 -0
- package/MIGRATING.md +187 -12
- package/agent/agents/basalt-design-reviewer.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +1 -1
- package/dist/charts/BandStrip.d.ts.map +1 -1
- package/dist/charts/BandStrip.js +51 -5
- package/dist/charts/Bars.d.ts.map +1 -1
- package/dist/charts/Bars.js +2 -1
- package/dist/charts/CartesianChart.d.ts +2 -0
- package/dist/charts/CartesianChart.d.ts.map +1 -1
- package/dist/charts/ChartCard.d.ts +1 -1
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +25 -15
- package/dist/charts/Sparkline.d.ts +8 -2
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +67 -13
- package/dist/charts/band-fold.d.ts +22 -4
- package/dist/charts/band-fold.d.ts.map +1 -1
- package/dist/charts/band-fold.js +10 -2
- package/dist/charts/chart-dates.d.ts +12 -0
- package/dist/charts/chart-dates.d.ts.map +1 -0
- package/dist/charts/chart-dates.js +16 -0
- package/dist/charts/compile.d.ts +8 -0
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +30 -21
- package/dist/charts/date-tick-format.d.ts +5 -5
- package/dist/charts/date-tick-format.d.ts.map +1 -1
- package/dist/charts/date-tick-format.js +3 -7
- package/dist/charts/labels.d.ts +7 -3
- package/dist/charts/labels.d.ts.map +1 -1
- package/dist/charts/labels.js +28 -17
- package/dist/charts/ref-label.d.ts +17 -0
- package/dist/charts/ref-label.d.ts.map +1 -1
- package/dist/charts/ref-label.js +13 -1
- package/dist/charts/sparkline.module.css +8 -11
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +3 -1
- package/dist/charts/types.d.ts +4 -3
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +9 -5
- package/dist/cli/shot/detect.js +8 -5
- package/dist/cli/shot/playwright.d.ts +8 -0
- package/dist/cli/shot/playwright.d.ts.map +1 -1
- package/dist/cli/shot/playwright.js +5 -1
- package/dist/cli/shot/types.d.ts +2 -0
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/tokens-css.d.ts +5 -7
- package/dist/cli/tokens-css.d.ts.map +1 -1
- package/dist/cli/tokens-css.js +11 -12
- package/dist/dashboard/bar-list.d.ts +6 -1
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +8 -0
- package/dist/dashboard/bar-list.module.css +30 -0
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +2 -2
- package/dist/dashboard/meter-model.d.ts +25 -20
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +24 -12
- package/dist/dashboard/meter-parts.d.ts +1 -1
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +39 -4
- package/dist/dashboard/meter.d.ts +14 -8
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +1 -1
- package/dist/dashboard/meter.module.css +15 -0
- package/dist/dashboard/meter.module.css.d.ts +1 -0
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +1 -1
- package/dist/dashboard/stat-card-parts.js +1 -1
- package/dist/dashboard/stat-card.module.css +25 -6
- package/dist/dashboard/stat-group.module.css +7 -0
- package/dist/dashboard/stat-strip.d.ts +15 -5
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +50 -34
- package/dist/dashboard/stat-strip.module.css +83 -61
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +0 -5
- package/dist/styles.css +18 -11
- package/dist/theme/controls.module.css +14 -0
- package/dist/theme/controls.module.css.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +10 -7
- package/dist/theme/status-verdict.d.ts.map +1 -1
- package/dist/theme/status-verdict.js +9 -1
- package/dist/tokens/palette.d.ts +7 -10
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +7 -10
- package/llms.txt +6 -4
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +55 -5
- package/src/charts/Bars.tsx +2 -1
- package/src/charts/CartesianChart.tsx +2 -0
- package/src/charts/ChartCard.tsx +32 -19
- package/src/charts/Sparkline.tsx +92 -19
- package/src/charts/band-fold.ts +25 -6
- package/src/charts/chart-dates.ts +30 -0
- package/src/charts/compile.ts +64 -23
- package/src/charts/date-tick-format.ts +10 -13
- package/src/charts/labels.ts +43 -22
- package/src/charts/ref-label.ts +27 -0
- package/src/charts/sparkline.module.css +8 -11
- package/src/charts/state.tsx +6 -3
- package/src/charts/types.ts +4 -3
- package/src/cli/shot/capture.ts +15 -3
- package/src/cli/shot/detect.ts +9 -9
- package/src/cli/shot/playwright.ts +18 -2
- package/src/cli/shot/types.ts +2 -0
- package/src/cli/tokens-css.ts +18 -20
- package/src/dashboard/bar-list.module.css +30 -0
- package/src/dashboard/bar-list.tsx +29 -0
- package/src/dashboard/delta-badge.tsx +6 -2
- package/src/dashboard/meter-model.ts +58 -41
- package/src/dashboard/meter-parts.tsx +66 -5
- package/src/dashboard/meter.module.css +15 -0
- package/src/dashboard/meter.module.css.d.ts +1 -0
- package/src/dashboard/meter.tsx +15 -11
- package/src/dashboard/query-state.tsx +1 -1
- package/src/dashboard/stat-card-parts.tsx +1 -1
- package/src/dashboard/stat-card.module.css +25 -6
- package/src/dashboard/stat-group.module.css +7 -0
- package/src/dashboard/stat-strip.module.css +83 -61
- package/src/dashboard/stat-strip.tsx +93 -54
- package/src/guard/index.ts +0 -5
- package/src/styles.css +18 -11
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +14 -8
- package/src/theme/controls.module.css +14 -0
- package/src/theme/controls.module.css.d.ts +1 -0
- package/src/theme/index.ts +10 -7
- package/src/theme/status-verdict.tsx +5 -1
- package/src/tokens/palette.ts +7 -10
|
@@ -43,6 +43,13 @@
|
|
|
43
43
|
gap: var(--vx-space-stack-md);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/* A card with a qualifier tells its row-mates to reserve the qualifier line in a narrow card, so the
|
|
47
|
+
* values of one group share a baseline (`stat-card.module.css`). Group-wide, not per row: the row a
|
|
48
|
+
* card lands in depends on the container, which a selector cannot read. */
|
|
49
|
+
.root:has([data-stat-qualifier]) {
|
|
50
|
+
--basalt-stat-qualifier-reserve: 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
/* 260px is StatGroup's own literal (docs/DESIGN-CORE.md § Layout, elevation, shapes), not a container class: one column below it,
|
|
47
54
|
* so every cell leads a row and the rail draws no leading hairline at all. */
|
|
48
55
|
@container basalt-grid (max-width: 259.9px) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { BasaltProps, Tone } from '../common/props.js';
|
|
3
|
+
/** The URL shot states an anchor can declare itself absent in (`data-shot-absent`). */
|
|
4
|
+
type StatStripShotState = 'empty' | 'loading' | 'error';
|
|
3
5
|
export type StatStripRow = {
|
|
4
6
|
key: string;
|
|
5
7
|
label: string;
|
|
@@ -55,19 +57,27 @@ export type StatStripCell = {
|
|
|
55
57
|
stale?: boolean;
|
|
56
58
|
/** Empty or failed: replaces the readings; `loading` wins while pending. */
|
|
57
59
|
state?: StatStripCellState;
|
|
60
|
+
/** The shot states this cell's anchor is absent in; replaces the group's `shotAbsent`. */
|
|
61
|
+
shotAbsent?: readonly StatStripShotState[];
|
|
62
|
+
};
|
|
63
|
+
export type StatStripFooterEntry = {
|
|
64
|
+
key: string;
|
|
65
|
+
content: ReactNode;
|
|
66
|
+
/** The `key` of the cell this entry qualifies. From the full desktop width (800px) it sits in that
|
|
67
|
+
* cell's column; below it, and for a key that names no cell, it takes the full width under the grid. */
|
|
68
|
+
under?: string;
|
|
58
69
|
};
|
|
59
70
|
export type StatStripProps = BasaltProps & {
|
|
60
71
|
/** The strip's accessible name. */
|
|
61
72
|
label: string;
|
|
62
73
|
cells: readonly StatStripCell[];
|
|
63
74
|
/** Wider cells under the cells. */
|
|
64
|
-
footer?: readonly
|
|
65
|
-
key: string;
|
|
66
|
-
content: ReactNode;
|
|
67
|
-
}[];
|
|
75
|
+
footer?: readonly StatStripFooterEntry[];
|
|
68
76
|
/** The DESKTOP column count. Default: the cell count, capped at 6. */
|
|
69
77
|
cols?: 2 | 3 | 4 | 5 | 6;
|
|
78
|
+
/** The shot states the page hides the whole strip in (`data-shot-absent` on every derived anchor). */
|
|
79
|
+
shotAbsent?: readonly StatStripShotState[];
|
|
70
80
|
};
|
|
71
|
-
export declare function StatStrip({ label, cells, footer, cols, className, style }: StatStripProps): import("react").JSX.Element;
|
|
81
|
+
export declare function StatStrip({ label, cells, footer, cols, shotAbsent, className, style, }: StatStripProps): import("react").JSX.Element;
|
|
72
82
|
export {};
|
|
73
83
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"stat-strip.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-strip.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAQxD,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,E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E,KAAK,CAAC,EAAE,kBAAkB,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;4GACwG;IACxG,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACzC,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,sEAAsE;IACtE,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;AA+ID,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,GACN,EAAE,cAAc,+BA2DhB"}
|
|
@@ -9,6 +9,7 @@ import { VX } from "../tokens/index.js";
|
|
|
9
9
|
import { InfoGlyph } from "./widget-header.js";
|
|
10
10
|
import classes from "./stat-strip.module.css";
|
|
11
11
|
import { HOSTED, VisualSlotContext } from "./visual-slot.js";
|
|
12
|
+
const absentAttr = (states) => states === void 0 || states.length === 0 ? {} : { "data-shot-absent": states.join(" ") };
|
|
12
13
|
const EMPTY = "\u2014";
|
|
13
14
|
function CellState({ state }) {
|
|
14
15
|
if (state.kind === "empty") {
|
|
@@ -21,29 +22,22 @@ function CellState({ state }) {
|
|
|
21
22
|
return /* @__PURE__ */ jsxs("div", { className: classes.error, role: "alert", "data-strip-state": "error", children: [
|
|
22
23
|
/* @__PURE__ */ jsxs("span", { className: classes.errorHead, children: [
|
|
23
24
|
/* @__PURE__ */ jsx(StatusDot, { color: VX.status.bad }),
|
|
24
|
-
"
|
|
25
|
+
"Could not load"
|
|
25
26
|
] }),
|
|
26
27
|
/* @__PURE__ */ jsx("p", { className: classes.reason, children: message }),
|
|
27
28
|
state.onRetry !== void 0 && /* @__PURE__ */ jsx(RetryButton, { onClick: state.onRetry, retrying: state.retrying ?? false })
|
|
28
29
|
] });
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (cell.visual !== void 0) return 4;
|
|
35
|
-
return cell.footer !== void 0 ? 3 : 2;
|
|
36
|
-
}
|
|
37
|
-
function StripCell({ cell }) {
|
|
31
|
+
function StripCell({
|
|
32
|
+
cell,
|
|
33
|
+
shotAbsent
|
|
34
|
+
}) {
|
|
38
35
|
const captionId = useId();
|
|
39
36
|
const { rows, loading } = cell;
|
|
40
37
|
const state = loading ? void 0 : cell.state;
|
|
41
38
|
const hasHero = cell.value !== void 0 || rows === void 0;
|
|
42
|
-
const ownFooter = cell.visual !== void 0 && rows === void 0;
|
|
43
|
-
const heroFooter = hasHero && cell.visual === void 0 && rows === void 0;
|
|
44
39
|
const hostSlot = !hasHero ? null : cell.tone === void 0 ? HOSTED : { tone: cell.tone };
|
|
45
|
-
const
|
|
46
|
-
const footerEl = cell.footer !== void 0 && /* @__PURE__ */ jsx("div", { className: cx(classes.footer, heroFooter && classes.heroFooter), "data-strip-footer": true, children: cell.footer });
|
|
40
|
+
const footerEl = cell.footer !== void 0 && /* @__PURE__ */ jsx("div", { className: classes.footer, "data-strip-footer": true, children: cell.footer });
|
|
47
41
|
const heroEl = loading ? /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonValue, radius: "sm" }) : /* @__PURE__ */ jsxs("div", { className: classes.valueRow, children: [
|
|
48
42
|
/* @__PURE__ */ jsx(
|
|
49
43
|
"span",
|
|
@@ -58,15 +52,16 @@ function StripCell({ cell }) {
|
|
|
58
52
|
cell.delta
|
|
59
53
|
] });
|
|
60
54
|
return (
|
|
61
|
-
// The slot owns the dividers and
|
|
55
|
+
// The slot owns the dividers and runs the row; the article inside ends at its content.
|
|
62
56
|
/* @__PURE__ */ jsx("div", { className: classes.cell, "data-strip-slot": true, children: /* @__PURE__ */ jsxs(
|
|
63
57
|
"article",
|
|
64
58
|
{
|
|
65
59
|
className: classes.content,
|
|
66
|
-
style: { "--basalt-strip-span": lastTrack },
|
|
67
60
|
"data-strip-cell": cell.key,
|
|
68
61
|
"data-shot": `strip-${cell.key}`,
|
|
69
62
|
"aria-labelledby": captionId,
|
|
63
|
+
...absentAttr(cell.shotAbsent ?? shotAbsent),
|
|
64
|
+
...state !== void 0 && { "data-strip-has-state": "" },
|
|
70
65
|
...state === void 0 && cell.visual !== void 0 && { "data-strip-has-visual": "" },
|
|
71
66
|
...state === void 0 && rows !== void 0 && { "data-strip-has-rows": "" },
|
|
72
67
|
...cell.stale && { "data-stale": "true" },
|
|
@@ -86,54 +81,75 @@ function StripCell({ cell }) {
|
|
|
86
81
|
),
|
|
87
82
|
cell.info !== void 0 && /* @__PURE__ */ jsx(InfoGlyph, { text: cell.info })
|
|
88
83
|
] }),
|
|
89
|
-
cell.qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, children: cell.qualifier })
|
|
84
|
+
cell.qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, title: cell.qualifier, children: cell.qualifier })
|
|
90
85
|
] }),
|
|
91
86
|
cell.action !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.action, "data-strip-action": true, children: cell.action })
|
|
92
87
|
] }),
|
|
93
88
|
state !== void 0 && /* @__PURE__ */ jsx(CellState, { state }),
|
|
94
89
|
state === void 0 && hasHero && heroEl,
|
|
95
|
-
state === void 0 &&
|
|
96
|
-
state === void 0 && cell.visual !== void 0 && /* @__PURE__ */ jsxs("div", { className: classes.visualStack, children: [
|
|
97
|
-
/* @__PURE__ */ jsx("div", { className: classes.visual, "data-strip-visual": true, children: /* @__PURE__ */ jsx(VisualSlotContext.Provider, { value: hostSlot, children: cell.visual }) }),
|
|
98
|
-
ownFooter && footerEl
|
|
99
|
-
] }),
|
|
90
|
+
state === void 0 && cell.visual !== void 0 && /* @__PURE__ */ jsx("div", { className: classes.visual, "data-strip-visual": true, children: /* @__PURE__ */ jsx(VisualSlotContext.Provider, { value: hostSlot, children: cell.visual }) }),
|
|
100
91
|
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: [
|
|
101
92
|
/* @__PURE__ */ jsx("span", { className: classes.rowLabel, children: row.label }),
|
|
102
93
|
/* @__PURE__ */ jsx("span", { className: classes.visual, children: row.visual }),
|
|
103
94
|
/* @__PURE__ */ jsx("span", { className: classes.rowValue, children: row.hideValue ? null : row.value ?? EMPTY }),
|
|
104
95
|
/* @__PURE__ */ jsx("span", { children: row.delta })
|
|
105
96
|
] }, row.key)) })),
|
|
106
|
-
state === void 0 &&
|
|
97
|
+
state === void 0 && footerEl
|
|
107
98
|
]
|
|
108
99
|
}
|
|
109
100
|
) })
|
|
110
101
|
);
|
|
111
102
|
}
|
|
112
|
-
function StatStrip({
|
|
103
|
+
function StatStrip({
|
|
104
|
+
label,
|
|
105
|
+
cells,
|
|
106
|
+
footer,
|
|
107
|
+
cols,
|
|
108
|
+
shotAbsent,
|
|
109
|
+
className,
|
|
110
|
+
style
|
|
111
|
+
}) {
|
|
113
112
|
const desktop = cols ?? Math.min(Math.max(cells.length, 2), 6);
|
|
114
113
|
const mid = desktop === 4 ? 2 : Math.min(desktop, 3);
|
|
114
|
+
const columnOf = (key) => {
|
|
115
|
+
const at = cells.findIndex((cell) => cell.key === key);
|
|
116
|
+
return at < 0 ? void 0 : at % desktop + 1;
|
|
117
|
+
};
|
|
118
|
+
const hasQualifier = cells.some((cell) => cell.qualifier !== void 0);
|
|
119
|
+
const hasAction = cells.some((cell) => cell.action !== void 0);
|
|
120
|
+
const placed = footer?.some((entry) => columnOf(entry.under) !== void 0) ?? false;
|
|
115
121
|
return /* @__PURE__ */ jsx("div", { className: cx(classes.container, className), style, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(
|
|
116
122
|
Card.Section,
|
|
117
123
|
{
|
|
118
124
|
component: "section",
|
|
119
125
|
"aria-label": label,
|
|
120
126
|
className: classes.clip,
|
|
127
|
+
...hasQualifier && { "data-strip-qualifier": "" },
|
|
128
|
+
...hasAction && { "data-strip-action-row": "" },
|
|
121
129
|
style: {
|
|
122
130
|
"--basalt-strip-cols": desktop,
|
|
123
131
|
"--basalt-strip-cols-sm": mid
|
|
124
132
|
},
|
|
125
133
|
children: [
|
|
126
|
-
/* @__PURE__ */ jsx("div", { className: classes.cells, children: cells.map((cell) => /* @__PURE__ */ jsx(StripCell, { cell }, cell.key)) }),
|
|
127
|
-
footer !== void 0 && footer.length > 0 && /* @__PURE__ */ jsx("div", { className: classes.footerRow, children: footer.map((entry) =>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
/* @__PURE__ */ jsx("div", { className: classes.cells, children: cells.map((cell) => /* @__PURE__ */ jsx(StripCell, { cell, shotAbsent }, cell.key)) }),
|
|
135
|
+
footer !== void 0 && footer.length > 0 && /* @__PURE__ */ jsx("div", { className: classes.footerRow, ...placed && { "data-placed": "" }, children: footer.map((entry) => {
|
|
136
|
+
const column = columnOf(entry.under);
|
|
137
|
+
return /* @__PURE__ */ jsx(
|
|
138
|
+
"div",
|
|
139
|
+
{
|
|
140
|
+
className: classes.footerCell,
|
|
141
|
+
"data-strip-footer-cell": entry.key,
|
|
142
|
+
"data-shot": `strip-footer-${entry.key}`,
|
|
143
|
+
...absentAttr(shotAbsent),
|
|
144
|
+
...column !== void 0 && {
|
|
145
|
+
"data-under": entry.under,
|
|
146
|
+
style: { "--basalt-strip-footer-col": column }
|
|
147
|
+
},
|
|
148
|
+
children: entry.content
|
|
149
|
+
},
|
|
150
|
+
entry.key
|
|
151
|
+
);
|
|
152
|
+
}) })
|
|
137
153
|
]
|
|
138
154
|
}
|
|
139
155
|
) }) });
|
|
@@ -28,27 +28,26 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/* The CELL is the row-high column: it owns the hairlines, so they run the whole row however short
|
|
31
|
-
* the cell inside it ends. It paints nothing else — the one surface stays the Card's.
|
|
31
|
+
* the cell inside it ends. It paints nothing else — the one surface stays the Card's. It is also the
|
|
32
|
+
* size container the caption line answers to (a cell is ~170px at 390, ~250px at 1440). */
|
|
32
33
|
.cell {
|
|
33
34
|
display: grid;
|
|
34
|
-
|
|
35
|
-
grid-template-rows: subgrid;
|
|
35
|
+
align-content: start;
|
|
36
36
|
min-width: 0;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
container-type: inline-size;
|
|
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. */
|
|
40
41
|
padding-block-end: var(--vx-space-stack-md);
|
|
41
42
|
box-shadow:
|
|
42
43
|
-1px 0 0 var(--vx-divider),
|
|
43
44
|
0 -1px 0 var(--vx-divider);
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
/* The CONTENT
|
|
47
|
-
* so its own box ends at its content instead of at the row's bottom. */
|
|
47
|
+
/* The CONTENT is a plain column: its box ends at its content, whatever a sibling holds below. */
|
|
48
48
|
.content {
|
|
49
|
-
display:
|
|
50
|
-
|
|
51
|
-
grid-template-rows: subgrid;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
52
51
|
align-self: start;
|
|
53
52
|
min-width: 0;
|
|
54
53
|
padding: var(--vx-space-stack-md) var(--vx-space-stack-md) 0;
|
|
@@ -63,18 +62,11 @@
|
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
/* Cells align by
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* row. A part a cell lacks collapses its track (the spacing is a margin on the part, not a gap).
|
|
71
|
-
* A footer rides with what it captions: under a hero alone it takes the hero-footer track right
|
|
72
|
-
* below the hero, under a visual it rides in the visual track (`.visualStack`); only a rows
|
|
73
|
-
* cell's footer uses the shared footer track. A hero-less cell (rows only) starts its rows in the
|
|
74
|
-
* visual track, so the hero track above them is the one void, and only as tall as a sibling's
|
|
75
|
-
* value. */
|
|
65
|
+
/* Cells align by CONSTRUCTION, not by shared tracks: the parts above the value have equal height in
|
|
66
|
+
* every cell of a row (one caption line; a reserved qualifier line in a narrow cell when any cell has
|
|
67
|
+
* a qualifier), so a row shares one caption top and one value baseline. Below the value each cell
|
|
68
|
+
* stacks its own parts and ends at its last one. */
|
|
76
69
|
.content > * {
|
|
77
|
-
grid-column: 1;
|
|
78
70
|
min-width: 0;
|
|
79
71
|
}
|
|
80
72
|
|
|
@@ -82,33 +74,6 @@
|
|
|
82
74
|
margin-block-start: var(--vx-space-stack-sm);
|
|
83
75
|
}
|
|
84
76
|
|
|
85
|
-
.valueRow,
|
|
86
|
-
.skeletonValue,
|
|
87
|
-
.error {
|
|
88
|
-
grid-row: 2;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/* A hero's footer has its own track right under the hero track, so it hugs the value however tall a
|
|
92
|
-
* sibling's visual is, and a cell without a footer never spans (or reserves) it. */
|
|
93
|
-
.content > .heroFooter {
|
|
94
|
-
grid-row: 3;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.content > .visualStack,
|
|
98
|
-
.content > .reason,
|
|
99
|
-
.content > .rows {
|
|
100
|
-
grid-row: 4;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.content[data-strip-has-visual] > .rows {
|
|
104
|
-
grid-row: 5;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.content > .footer:not(.heroFooter) {
|
|
108
|
-
grid-row: 6;
|
|
109
|
-
align-self: start;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
77
|
@container basalt-grid (max-width: 479.9px) {
|
|
113
78
|
.cells {
|
|
114
79
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
@@ -126,20 +91,25 @@
|
|
|
126
91
|
}
|
|
127
92
|
|
|
128
93
|
.captionLine {
|
|
129
|
-
grid-row: 1;
|
|
130
94
|
display: flex;
|
|
131
95
|
flex-wrap: nowrap;
|
|
132
|
-
align-items:
|
|
96
|
+
align-items: flex-start;
|
|
133
97
|
column-gap: var(--vx-space-control-gap);
|
|
134
98
|
min-width: 0;
|
|
135
99
|
}
|
|
136
100
|
|
|
137
|
-
/*
|
|
101
|
+
/* A cell with an action reserves the control's height on every caption line of the strip, so the
|
|
102
|
+
* values stay level whichever cell carries one. */
|
|
103
|
+
[data-strip-action-row] .captionLine {
|
|
104
|
+
min-height: calc(var(--vx-space-control-height-widget, 1.5rem) * var(--mantine-scale, 1));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Caption and qualifier share one line: the caption keeps its words, the qualifier gives way first. */
|
|
138
108
|
.captionMain {
|
|
139
109
|
display: flex;
|
|
140
110
|
flex: 1 1 0;
|
|
141
|
-
flex-wrap:
|
|
142
|
-
align-items:
|
|
111
|
+
flex-wrap: nowrap;
|
|
112
|
+
align-items: baseline;
|
|
143
113
|
column-gap: var(--vx-space-control-gap);
|
|
144
114
|
min-width: 0;
|
|
145
115
|
}
|
|
@@ -162,17 +132,48 @@
|
|
|
162
132
|
font-family: var(--basalt-font-mono);
|
|
163
133
|
font-size: var(--vx-text-micro);
|
|
164
134
|
font-weight: 500;
|
|
135
|
+
line-height: 1.4;
|
|
165
136
|
letter-spacing: 0.06em;
|
|
166
137
|
text-transform: uppercase;
|
|
167
138
|
color: var(--vx-faint);
|
|
168
139
|
}
|
|
169
140
|
|
|
170
|
-
/* The lowercase qualifier is the muted sans (mono is for the UPPERCASE caption only).
|
|
171
|
-
* item, so when it does not fit beside the caption it wraps WHOLE onto its own line below. */
|
|
141
|
+
/* The lowercase qualifier is the muted sans (mono is for the UPPERCASE caption only). */
|
|
172
142
|
.qualifier {
|
|
143
|
+
flex: 0 100 auto;
|
|
144
|
+
min-width: 0;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
text-overflow: ellipsis;
|
|
147
|
+
white-space: nowrap;
|
|
173
148
|
font-size: var(--vx-text-micro);
|
|
149
|
+
line-height: 1.4;
|
|
174
150
|
color: var(--vx-muted);
|
|
175
|
-
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* A narrow cell (~170px at 390): the qualifier takes its own line under the caption, and when any cell
|
|
154
|
+
* of the strip has a qualifier every cell reserves that line, so values share a baseline. */
|
|
155
|
+
@container basalt-card (max-width: 239.9px) {
|
|
156
|
+
.captionMain {
|
|
157
|
+
flex-wrap: wrap;
|
|
158
|
+
align-content: flex-start;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.qualifier {
|
|
162
|
+
flex: 0 0 100%;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.qualifier {
|
|
166
|
+
line-height: 1.25;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
[data-strip-qualifier] .captionMain {
|
|
170
|
+
min-height: calc(var(--vx-text-micro) * (1.4 + 1.25));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* The two caption lines read as one block: the value follows at the tight step. */
|
|
174
|
+
[data-strip-qualifier] .captionLine + * {
|
|
175
|
+
margin-block-start: var(--vx-space-stack-xs);
|
|
176
|
+
}
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
/* A control at the end of the caption line: it keeps its size, the caption truncates first. */
|
|
@@ -230,10 +231,6 @@
|
|
|
230
231
|
min-width: 0;
|
|
231
232
|
}
|
|
232
233
|
|
|
233
|
-
.visualStack > .footer {
|
|
234
|
-
margin-block-start: var(--vx-space-stack-sm);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
234
|
/* A Sparkline's hover readout takes this line above its plot (`charts/sparkline.module.css`). The
|
|
238
235
|
* cell's own stack gap already sits above it; the slot reserves the rest, so the chip never covers
|
|
239
236
|
* the value. */
|
|
@@ -245,6 +242,12 @@
|
|
|
245
242
|
padding-top: max(0px, calc(var(--basalt-spark-readout-h) - var(--vx-space-stack-sm)));
|
|
246
243
|
}
|
|
247
244
|
|
|
245
|
+
/* The state copy keeps the cell's inset on every side: the article ends at its own last track, so the
|
|
246
|
+
* foot inset (carried by the row-high slot, further down) cannot reach it. */
|
|
247
|
+
.content[data-strip-has-state] {
|
|
248
|
+
padding-block-end: var(--vx-space-stack-md);
|
|
249
|
+
}
|
|
250
|
+
|
|
248
251
|
/* An empty cell's reason and an errored cell's message: one muted `sm` line, wrapping rather than
|
|
249
252
|
* clipping (a 390px two-column cell is ~170px wide). */
|
|
250
253
|
.reason {
|
|
@@ -329,6 +332,25 @@
|
|
|
329
332
|
text-align: start;
|
|
330
333
|
}
|
|
331
334
|
|
|
335
|
+
/* From the full desktop count a footer entry may sit under the cell it qualifies (`under`): the row
|
|
336
|
+
* takes the cells' column grid, an entry with `--basalt-strip-footer-col` sits in that column, and any
|
|
337
|
+
* other takes the full row. Each entry keeps its own leading hairlines (`.footerCell`, below), so a
|
|
338
|
+
* placed entry reads as attached to its column and the columns beside it stay the strip's surface. */
|
|
339
|
+
@container basalt-grid (min-width: 800px) {
|
|
340
|
+
.footerRow[data-placed] {
|
|
341
|
+
display: grid;
|
|
342
|
+
grid-template-columns: repeat(var(--basalt-strip-cols), minmax(0, 1fr));
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.footerRow[data-placed] > .footerCell {
|
|
346
|
+
grid-column: 1 / -1;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.footerRow[data-placed] > .footerCell[data-under] {
|
|
350
|
+
grid-column: var(--basalt-strip-footer-col);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
332
354
|
.footerCell {
|
|
333
355
|
flex: 1 1 14rem;
|
|
334
356
|
min-width: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAO7E,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,CAAA;AAgU9D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CA8BpE,CAAA;AA8cD,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,EAAE,WAiBlC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAO7E,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,S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,EAAE,CAAA;IACjC,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAA;IACzC,oFAAoF;IACpF,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,oGAAoG;IACpG,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IACxC,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,WAAW,GACf,mBAAmB,EAAE,CA+BvB;AAED,kGAAkG;AAClG,eAAO,MAAM,uBAAuB,6BAA6B,CAAA;AAEjE;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAM9F"}
|
package/dist/guard/index.js
CHANGED
|
@@ -266,11 +266,6 @@ const GRACE_PERIOD_KINDS = {
|
|
|
266
266
|
since: "2.16.0",
|
|
267
267
|
promote: "2.24.0",
|
|
268
268
|
why: "The scale moved to 8/12/16/20/24 and the CSS micro ceiling dropped 10 \u2192 7 in 2.16.0: a literal 8px/10px in CSS is newly a finding."
|
|
269
|
-
},
|
|
270
|
-
"series-palette": {
|
|
271
|
-
since: "2.21.0",
|
|
272
|
-
promote: "2.23.0",
|
|
273
|
-
why: "New in 2.21.0: the series file is judged by computed lightness, chroma, colour-blind separation and contrast; a palette that was tuned by eye is newly a finding."
|
|
274
269
|
}
|
|
275
270
|
};
|
|
276
271
|
function severityOf(kind, cfg) {
|
package/dist/styles.css
CHANGED
|
@@ -31,6 +31,21 @@
|
|
|
31
31
|
@import '@fontsource-variable/hubot-sans';
|
|
32
32
|
@import '@fontsource-variable/jetbrains-mono';
|
|
33
33
|
|
|
34
|
+
/* Hubot Sans has no `zero` OpenType feature and its default zero is slashed, so a head-face "2026" or
|
|
35
|
+
* "90 days" cannot be fixed with `font-feature-settings`. Digits come from the sans instead: this
|
|
36
|
+
* face covers U+0030-0039 only, cut from the Nunito Sans variable file, and leads
|
|
37
|
+
* `--basalt-font-head`, so Hubot draws every letter and Nunito every digit. */
|
|
38
|
+
@font-face {
|
|
39
|
+
/* theme-allow raw-font-family — declares the face, uses nothing */
|
|
40
|
+
font-family: 'Basalt Head Digits';
|
|
41
|
+
font-style: normal;
|
|
42
|
+
font-display: swap;
|
|
43
|
+
font-weight: 200 1000;
|
|
44
|
+
src: url('@fontsource-variable/nunito-sans/files/nunito-sans-latin-wght-normal.woff2')
|
|
45
|
+
format('woff2-variations');
|
|
46
|
+
unicode-range: U+0030-0039;
|
|
47
|
+
}
|
|
48
|
+
|
|
34
49
|
/* Font stack — overridable via the --basalt-font-* custom properties. */
|
|
35
50
|
@layer base {
|
|
36
51
|
:root {
|
|
@@ -42,9 +57,10 @@
|
|
|
42
57
|
--basalt-font-sans:
|
|
43
58
|
'Nunito Sans Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
|
|
44
59
|
Helvetica, Arial, sans-serif;
|
|
60
|
+
/* A consumer that sets its own head family replaces this stack, digit face included, by design. */
|
|
45
61
|
--basalt-font-head:
|
|
46
|
-
'Hubot Sans Variable', ui-sans-serif, system-ui, -apple-system,
|
|
47
|
-
Arial, sans-serif;
|
|
62
|
+
'Basalt Head Digits', 'Hubot Sans Variable', ui-sans-serif, system-ui, -apple-system,
|
|
63
|
+
'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
48
64
|
--basalt-font-mono: 'JetBrains Mono Variable', ui-monospace, 'SF Mono', Menlo, monospace;
|
|
49
65
|
/* Hero values, unit/count/delta text, bar-list and meter figures: proportional sans, lining
|
|
50
66
|
figures. Set to `var(--basalt-font-mono)` to restore the pre-Wave-35 mono numerals. */
|
|
@@ -67,15 +83,6 @@
|
|
|
67
83
|
text-size-adjust: 100%;
|
|
68
84
|
}
|
|
69
85
|
|
|
70
|
-
/* A slashed zero belongs to data text only. Hubot Sans (the heading face) draws one, and it leaked
|
|
71
|
-
into every title that borrows the face (`2026`, `90 days`). `zero` is OFF by default and nothing
|
|
72
|
-
in the package turns it on, so this is the off state at the root: it inherits into every head-face
|
|
73
|
-
surface whether a heading element, a Mantine title or a CSS-module class that only sets the
|
|
74
|
-
family, and is a no-op on the mono stack. */
|
|
75
|
-
:root {
|
|
76
|
-
font-feature-settings: 'zero' 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
86
|
/* Mono data text drops its ligatures: `<>` in a facts line is two characters, not a diamond. Reaches
|
|
80
87
|
the mono stack by element (code, kbd, samp, pre), by contract (`data-numeric`, `data-monospace`),
|
|
81
88
|
by Mantine's `ff="monospace"` inline style, and by the stack's own var in an inline style. Body
|
|
@@ -323,6 +323,12 @@ html .tableRoot tbody tr:last-of-type {
|
|
|
323
323
|
border-bottom: none;
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
+
/* A status word is the text as written ("Healthy"), not Mantine's UPPERCASE default; a caller who wants
|
|
327
|
+
* a micro-caption passes `tt="uppercase"`, which is inline and wins. `html` outranks Mantine's class. */
|
|
328
|
+
html .badgeRoot {
|
|
329
|
+
text-transform: none;
|
|
330
|
+
}
|
|
331
|
+
|
|
326
332
|
/*
|
|
327
333
|
* Badge status dot: a coloured `light` Badge is the neutral surface + ink word with a leading dot in the
|
|
328
334
|
* status colour (`badgeVars` writes the `--badge-dot*` vars; nothing here without them). The dot is a
|
|
@@ -359,3 +365,11 @@ html .tableRoot tbody tr:last-of-type {
|
|
|
359
365
|
.badgeSection img {
|
|
360
366
|
object-fit: contain;
|
|
361
367
|
}
|
|
368
|
+
|
|
369
|
+
/*
|
|
370
|
+
* Alert: an inline Code inside it sits one nested step (3px) under the Alert's own radius
|
|
371
|
+
* (craft-1/nested-radius-step). The Code theme reads `--basalt-code-radius`; the Alert supplies it.
|
|
372
|
+
*/
|
|
373
|
+
.alertRoot {
|
|
374
|
+
--basalt-code-radius: max(0px, calc(var(--alert-radius, var(--vx-radius-ctrl)) - 3px));
|
|
375
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EA0CV,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,eAAe,CAAA;AAStB,OAAO,KAAK,EAAe,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAKpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAWvD;;;;;GAKG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAIvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAMvD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAenE,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,iBAAiB;QACzB,YAAY,CAAC,EAAE,YAAY,CAAA;QAC3B,WAAW,CAAC,EAAE,iBAAiB,CAAA;QAC/B,YAAY,CAAC,EAAE,YAAY,CAAA;QAC3B,aAAa,CAAC,EAAE,WAAW,CAAA;KAC5B;CACF;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EA0CV,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,eAAe,CAAA;AAStB,OAAO,KAAK,EAAe,YAAY,EAAE,WAAW,EAAE,MAAM,mBAA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IAEzB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAE1B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;CAC7B,CAAA;AAYD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC,EACrD,OAAO,CAAC,EAAE,wBAAwB,GACjC,oBAAoB,CAiCtB"}
|
package/dist/theme/index.js
CHANGED
|
@@ -266,6 +266,7 @@ function buildTheme(data, options = {}) {
|
|
|
266
266
|
// already on-system (defaultRadius 'md' control tier + the variant color resolver), so only
|
|
267
267
|
// the title font is overridden.
|
|
268
268
|
Alert: ext({
|
|
269
|
+
classNames: { root: controlsClasses.alertRoot },
|
|
269
270
|
styles: {
|
|
270
271
|
title: {
|
|
271
272
|
fontFamily: "var(--basalt-font-head)",
|
|
@@ -508,11 +509,11 @@ function buildTheme(data, options = {}) {
|
|
|
508
509
|
// label that no longer fits its equal share truncates instead of forcing the column wide.
|
|
509
510
|
//
|
|
510
511
|
// The track's padding is `SPACE_FIXED.segmentedTrackInset`, a plain literal — NOT a
|
|
511
|
-
// `--vx-space-*` var — because it is density-EXEMPT
|
|
512
|
-
//
|
|
513
|
-
//
|
|
514
|
-
//
|
|
515
|
-
//
|
|
512
|
+
// `--vx-space-*` var — because it is density-EXEMPT (see that constant's doc in
|
|
513
|
+
// `tokens/palette.ts`). The INDICATOR radius is the track's per-instance radius (`--sc-radius`,
|
|
514
|
+
// which Mantine sets on the root from the `radius` prop) minus 3 px: exact concentricity would
|
|
515
|
+
// be track − inset (2 px), but `craft-1/nested-radius-step` wants nested surfaces ≥ 3 px apart
|
|
516
|
+
// and that lint step wins. A custom `radius` therefore nests too.
|
|
516
517
|
SegmentedControl: ext({
|
|
517
518
|
defaultProps: { radius: radius.ctrl },
|
|
518
519
|
classNames: {
|
|
@@ -551,7 +552,8 @@ function buildTheme(data, options = {}) {
|
|
|
551
552
|
// ink-12% fill sat one shade from the track and read as a hover state.
|
|
552
553
|
boxShadow: "var(--vx-shadow-raised)",
|
|
553
554
|
outline: "1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)",
|
|
554
|
-
|
|
555
|
+
// Track radius − 3 px: craft-1/nested-radius-step beats exact concentricity.
|
|
556
|
+
borderRadius: "max(0px, calc(var(--sc-radius, var(--vx-radius-ctrl)) - 3px))"
|
|
555
557
|
},
|
|
556
558
|
// Conditionally spread the WHOLE key (never a present `label: undefined`) — the package
|
|
557
559
|
// builds under `exactOptionalPropertyTypes`, which treats a key present-but-`undefined` as
|
|
@@ -770,7 +772,8 @@ function buildTheme(data, options = {}) {
|
|
|
770
772
|
styles: {
|
|
771
773
|
root: {
|
|
772
774
|
backgroundColor: "color-mix(in srgb, var(--vx-ink) 7%, transparent)",
|
|
773
|
-
|
|
775
|
+
// An Alert re-points the var (`controls.module.css`) so a nested Code steps down.
|
|
776
|
+
borderRadius: "var(--basalt-code-radius, var(--vx-radius-tight))"
|
|
774
777
|
}
|
|
775
778
|
}
|
|
776
779
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-verdict.d.ts","sourceRoot":"","sources":["../../src/theme/status-verdict.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAIlD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,kBAAkB,+
|
|
1
|
+
{"version":3,"file":"status-verdict.d.ts","sourceRoot":"","sources":["../../src/theme/status-verdict.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAIlD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,kBAAkB,+BAc1F"}
|
|
@@ -5,7 +5,15 @@ import classes from "./status-verdict.module.css";
|
|
|
5
5
|
function StatusVerdict({ color, word, phrase, className, style }) {
|
|
6
6
|
return /* @__PURE__ */ jsxs("span", { className: cx(classes.verdict, className), ...style !== void 0 && { style }, children: [
|
|
7
7
|
/* @__PURE__ */ jsx(StatusDot, { color }),
|
|
8
|
-
/* @__PURE__ */ jsx(
|
|
8
|
+
/* @__PURE__ */ jsx(
|
|
9
|
+
"span",
|
|
10
|
+
{
|
|
11
|
+
"data-verdict-word": "",
|
|
12
|
+
title: phrase ?? word,
|
|
13
|
+
...phrase !== void 0 && { "aria-hidden": true },
|
|
14
|
+
children: word
|
|
15
|
+
}
|
|
16
|
+
),
|
|
9
17
|
phrase !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.hidden, children: phrase })
|
|
10
18
|
] });
|
|
11
19
|
}
|