basalt-ui 2.22.0 → 2.24.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 +68 -0
- package/MIGRATING.md +400 -12
- package/agent/agents/basalt-design-reviewer.md +3 -3
- package/agent/skills/basalt-design/SKILL.md +2 -2
- package/agent/skills/basalt-design/references/catalogue.md +22 -19
- package/agent/skills/basalt-design/references/states.md +39 -0
- 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 +19 -3
- package/dist/charts/CartesianChart.d.ts +2 -0
- package/dist/charts/CartesianChart.d.ts.map +1 -1
- package/dist/charts/CartesianChart.js +7 -3
- 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 +95 -15
- package/dist/charts/StackedArea.d.ts.map +1 -1
- package/dist/charts/StackedArea.js +5 -1
- 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/chart-legend.module.css +16 -0
- package/dist/charts/compile.d.ts +10 -0
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +77 -24
- 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/legend.d.ts +0 -6
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +87 -35
- 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 +62 -12
- package/dist/charts/sparkline.module.css.d.ts +1 -0
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +4 -2
- package/dist/charts/types.d.ts +15 -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/measure.js +19 -23
- 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 +18 -0
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +2 -2
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/meter-model.d.ts +55 -21
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +98 -17
- package/dist/dashboard/meter-parts.d.ts +9 -2
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +99 -21
- package/dist/dashboard/meter.d.ts +21 -8
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +14 -3
- package/dist/dashboard/meter.module.css +57 -2
- package/dist/dashboard/meter.module.css.d.ts +5 -0
- package/dist/dashboard/query-state.d.ts +7 -3
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +15 -7
- package/dist/dashboard/section.d.ts +2 -1
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.module.css +12 -0
- package/dist/dashboard/settings-section.d.ts +1 -1
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +3 -3
- package/dist/dashboard/stat-card-parts.js +1 -1
- package/dist/dashboard/stat-card.module.css +43 -10
- package/dist/dashboard/stat-group.module.css +15 -0
- package/dist/dashboard/stat-strip.d.ts +16 -5
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +100 -74
- package/dist/dashboard/stat-strip.module.css +68 -62
- package/dist/dashboard/stat-strip.module.css.d.ts +1 -0
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +19 -1
- package/dist/dashboard/widget-header.module.css +6 -0
- package/dist/guard/index.d.ts +2 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +1 -17
- package/dist/styles.css +18 -11
- package/dist/table/data-table.js +1 -1
- package/dist/theme/controls.module.css +19 -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 +12 -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 +7 -4
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +55 -5
- package/src/charts/Bars.tsx +31 -3
- package/src/charts/CartesianChart.tsx +9 -3
- package/src/charts/ChartCard.tsx +32 -19
- package/src/charts/Sparkline.tsx +139 -21
- package/src/charts/StackedArea.tsx +12 -1
- package/src/charts/band-fold.ts +25 -6
- package/src/charts/chart-dates.ts +30 -0
- package/src/charts/chart-legend.module.css +16 -0
- package/src/charts/compile.ts +148 -25
- package/src/charts/date-tick-format.ts +10 -13
- package/src/charts/labels.ts +43 -22
- package/src/charts/legend.tsx +70 -3
- package/src/charts/ref-label.ts +27 -0
- package/src/charts/sparkline.module.css +62 -12
- package/src/charts/sparkline.module.css.d.ts +1 -0
- package/src/charts/state.tsx +7 -4
- package/src/charts/types.ts +13 -3
- package/src/cli/shot/capture.ts +15 -3
- package/src/cli/shot/detect.ts +9 -9
- package/src/cli/shot/measure.ts +27 -27
- 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 +18 -0
- package/src/dashboard/bar-list.tsx +29 -0
- package/src/dashboard/delta-badge.tsx +6 -2
- package/src/dashboard/empty-state.tsx +4 -2
- package/src/dashboard/meter-model.ts +181 -47
- package/src/dashboard/meter-parts.tsx +187 -30
- package/src/dashboard/meter.module.css +57 -2
- package/src/dashboard/meter.module.css.d.ts +5 -0
- package/src/dashboard/meter.tsx +33 -10
- package/src/dashboard/query-state.tsx +20 -9
- package/src/dashboard/section.module.css +12 -0
- package/src/dashboard/section.tsx +2 -1
- package/src/dashboard/settings-section.tsx +4 -4
- package/src/dashboard/stat-card-parts.tsx +1 -1
- package/src/dashboard/stat-card.module.css +43 -10
- package/src/dashboard/stat-group.module.css +15 -0
- package/src/dashboard/stat-strip.module.css +68 -62
- package/src/dashboard/stat-strip.module.css.d.ts +1 -0
- package/src/dashboard/stat-strip.tsx +118 -59
- package/src/dashboard/widget-header.module.css +6 -0
- package/src/dashboard/widget-header.tsx +28 -1
- package/src/guard/index.ts +3 -19
- package/src/styles.css +18 -11
- package/src/table/data-table.tsx +1 -1
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +14 -8
- package/src/theme/controls.module.css +19 -0
- package/src/theme/controls.module.css.d.ts +1 -0
- package/src/theme/index.ts +12 -7
- package/src/theme/status-verdict.tsx +5 -1
- package/src/tokens/palette.ts +7 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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A;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,GACX,EAAE,iBAAiB,+BAmEnB"}
|
|
@@ -7,12 +7,19 @@ import { DeltaBadge } from "./delta-badge.js";
|
|
|
7
7
|
import classes from "./widget-header.module.css";
|
|
8
8
|
const BUBBLE_GAP = 7;
|
|
9
9
|
const BUBBLE_EDGE = 8;
|
|
10
|
+
function cardOf(trigger) {
|
|
11
|
+
for (let el = trigger.parentElement; el !== null; el = el.parentElement) {
|
|
12
|
+
if (getComputedStyle(el).containerName.split(/\s+/).includes("basalt-card")) return el;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
10
16
|
function useBubblePosition(open, triggerRef, bubbleRef) {
|
|
11
17
|
const [pos, setPos] = useState(null);
|
|
12
18
|
useIsomorphicLayoutEffect(() => {
|
|
13
19
|
if (!open) return;
|
|
14
20
|
const bubbleEl = bubbleRef.current;
|
|
15
21
|
if (bubbleEl !== null && typeof bubbleEl.showPopover === "function") bubbleEl.showPopover();
|
|
22
|
+
const card = triggerRef.current === null ? null : cardOf(triggerRef.current);
|
|
16
23
|
const place = () => {
|
|
17
24
|
const trigger = triggerRef.current;
|
|
18
25
|
const bubble = bubbleRef.current;
|
|
@@ -23,7 +30,18 @@ function useBubblePosition(open, triggerRef, bubbleRef) {
|
|
|
23
30
|
const viewH = document.documentElement.clientHeight;
|
|
24
31
|
const below = t.bottom + BUBBLE_GAP;
|
|
25
32
|
const above = t.top - BUBBLE_GAP - b.height;
|
|
26
|
-
const
|
|
33
|
+
const overflows = below + b.height > viewH - BUBBLE_EDGE;
|
|
34
|
+
const viewportFlip = above >= BUBBLE_EDGE ? above : below;
|
|
35
|
+
let top = below;
|
|
36
|
+
if (overflows) {
|
|
37
|
+
const floor = card === null ? BUBBLE_EDGE : Math.max(BUBBLE_EDGE, card.getBoundingClientRect().top);
|
|
38
|
+
if (above >= floor) top = above;
|
|
39
|
+
else if (card !== null) {
|
|
40
|
+
const slid = Math.max(floor, viewH - BUBBLE_EDGE - b.height);
|
|
41
|
+
const covers = slid < t.bottom && slid + b.height > t.top;
|
|
42
|
+
top = covers ? viewportFlip : slid;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
27
45
|
const left = Math.max(BUBBLE_EDGE, Math.min(t.left, viewW - BUBBLE_EDGE - b.width));
|
|
28
46
|
setPos((prev) => prev?.top === top && prev.left === left ? prev : { top, left });
|
|
29
47
|
};
|
|
@@ -230,6 +230,12 @@
|
|
|
230
230
|
color: var(--vx-muted);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
+
/* A Section shell holds three sizes: the title (`md`), this note and the count tag (`xs`), and the
|
|
234
|
+
* body (`sm`). The note steps down to the count tag's rung instead of sitting between them. */
|
|
235
|
+
.root[data-tier='section'] .subtitle {
|
|
236
|
+
font-size: var(--vx-text-xs);
|
|
237
|
+
}
|
|
238
|
+
|
|
233
239
|
/* `data-placement` is read by wave-3 composers wanting a `bleed` layout (docs/CONTROLS-SPEC.md
|
|
234
240
|
* §2.2's `sparklinePlacement` composer mapping) — this primitive only ever sets `right`. */
|
|
235
241
|
.sparkline {
|
package/dist/guard/index.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export type GraceEntry = {
|
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* Kinds still inside their grace minor — reported, not fatal, until the next minor promotes them.
|
|
34
|
-
* Empty since
|
|
35
|
-
*
|
|
34
|
+
* Empty since 2.24.0: `raw-spacing` and `inline-spacing` (since 2.16.0), the last tenants, promoted.
|
|
35
|
+
* It was empty once before, at 1.36.0, when `unknown-vx-token` promoted.
|
|
36
36
|
* See {@link GuardSeverity} for the doctrine and why basalt-ui in particular needs it.
|
|
37
37
|
*
|
|
38
38
|
* Adding a kind here is part of shipping it; removing the entry IS the promotion, and belongs in
|
|
@@ -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,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,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;;;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
|
@@ -256,23 +256,7 @@ const DEFAULT_GUARD_CONFIG = {
|
|
|
256
256
|
exemptRules: {},
|
|
257
257
|
severity: {}
|
|
258
258
|
};
|
|
259
|
-
const GRACE_PERIOD_KINDS = {
|
|
260
|
-
"raw-spacing": {
|
|
261
|
-
since: "2.16.0",
|
|
262
|
-
promote: "2.24.0",
|
|
263
|
-
why: "The spacing scale moved to 8/12/16/20/24 in 2.16.0: a prop value equal to a NEW step (p={16}) is newly a finding."
|
|
264
|
-
},
|
|
265
|
-
"inline-spacing": {
|
|
266
|
-
since: "2.16.0",
|
|
267
|
-
promote: "2.24.0",
|
|
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
|
-
}
|
|
275
|
-
};
|
|
259
|
+
const GRACE_PERIOD_KINDS = {};
|
|
276
260
|
function severityOf(kind, cfg) {
|
|
277
261
|
return cfg.severity?.[kind] ?? (Object.hasOwn(GRACE_PERIOD_KINDS, kind) ? "warn" : "error");
|
|
278
262
|
}
|
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
|
package/dist/table/data-table.js
CHANGED
|
@@ -662,7 +662,7 @@ function BasaltDataTable(props) {
|
|
|
662
662
|
ErrorState,
|
|
663
663
|
{
|
|
664
664
|
error: queryError.error,
|
|
665
|
-
title: "Could not load",
|
|
665
|
+
title: "Could not load rows",
|
|
666
666
|
tier: "section",
|
|
667
667
|
retrying: queryError.fetchStatus === "fetching",
|
|
668
668
|
onRetry: () => void queryError.refetch()
|
|
@@ -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,16 @@ 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), snapped down onto the radius scale (2, or 0 under a 5px Alert). The Code theme reads
|
|
372
|
+
* `--basalt-code-radius`; the Alert supplies it.
|
|
373
|
+
*/
|
|
374
|
+
.alertRoot {
|
|
375
|
+
--basalt-code-radius: round(
|
|
376
|
+
down,
|
|
377
|
+
min(2px, max(0px, var(--alert-radius, var(--vx-radius-ctrl)) - 3px)),
|
|
378
|
+
2px
|
|
379
|
+
);
|
|
380
|
+
}
|
|
@@ -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;A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CAAA;AA2R/E,6FAA6F;AAC7F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAE9E,8FAA8F;AAC9F,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAsF7D;;8FAE8F;AAC9F,eAAO,MAAM,oBAAoB,EAAE,oBACc,CAAA;AAEjD,kEAAkE;AAClE,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;IAE9B;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAA;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,12 @@ 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, snapped DOWN onto the radius
|
|
515
|
+
// scale: `craft-1/nested-radius-step` wants nested surfaces ≥ 3 px apart, SPEC § 8.1 rule 1 wants
|
|
516
|
+
// every radius on a § 5 step, and the only step that satisfies both under a 6 px track is 2
|
|
517
|
+
// (`RADIUS_STEP.scaleXs`; 0 when the track is under 5 px). A custom `radius` therefore nests too.
|
|
516
518
|
SegmentedControl: ext({
|
|
517
519
|
defaultProps: { radius: radius.ctrl },
|
|
518
520
|
classNames: {
|
|
@@ -551,7 +553,9 @@ function buildTheme(data, options = {}) {
|
|
|
551
553
|
// ink-12% fill sat one shade from the track and read as a hover state.
|
|
552
554
|
boxShadow: "var(--vx-shadow-raised)",
|
|
553
555
|
outline: "1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)",
|
|
554
|
-
|
|
556
|
+
// Nested radius snapped to the scale (SPEC § 8.1 rule 1): 2 when the track leaves a 3 px step, else 0.
|
|
557
|
+
// `--sc-radius` has no fallback: `defaultProps.radius` above guarantees Mantine sets it.
|
|
558
|
+
borderRadius: "round(down,min(2px,max(0px,var(--sc-radius) - 3px)),2px)"
|
|
555
559
|
},
|
|
556
560
|
// Conditionally spread the WHOLE key (never a present `label: undefined`) — the package
|
|
557
561
|
// builds under `exactOptionalPropertyTypes`, which treats a key present-but-`undefined` as
|
|
@@ -770,7 +774,8 @@ function buildTheme(data, options = {}) {
|
|
|
770
774
|
styles: {
|
|
771
775
|
root: {
|
|
772
776
|
backgroundColor: "color-mix(in srgb, var(--vx-ink) 7%, transparent)",
|
|
773
|
-
|
|
777
|
+
// An Alert re-points the var (`controls.module.css`) so a nested Code steps down.
|
|
778
|
+
borderRadius: "var(--basalt-code-radius, var(--vx-radius-tight))"
|
|
774
779
|
}
|
|
775
780
|
}
|
|
776
781
|
}),
|
|
@@ -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
|
}
|
package/dist/tokens/palette.d.ts
CHANGED
|
@@ -185,7 +185,9 @@ export declare const RADIUS_STEP: {
|
|
|
185
185
|
readonly floating: number;
|
|
186
186
|
/** SegmentedControl's active indicator, Kbd, Code — one step below the control radius. */
|
|
187
187
|
readonly tight: number;
|
|
188
|
-
/** Progress bar, and the Mantine scale's `sm` step — two steps below the control radius.
|
|
188
|
+
/** Progress bar, and the Mantine scale's `sm` step — two steps below the control radius. (No
|
|
189
|
+
* longer the SegmentedControl indicator: that is the track radius − 3 px snapped down onto the
|
|
190
|
+
* scale, set in `theme/index.ts`.) */
|
|
189
191
|
readonly fine: number;
|
|
190
192
|
/** The Mantine `radius` scale's `xs` step — independent of both anchors. */
|
|
191
193
|
readonly scaleXs: 2;
|
|
@@ -703,15 +705,10 @@ export declare const SPACE_FIXED: {
|
|
|
703
705
|
readonly readingProgressHeight: 2;
|
|
704
706
|
/** SegmentedControl track's optical inset (`styles.root` padding) — moved OUT of `SPACE_STEP` and
|
|
705
707
|
* exempted from the density knob because it is load-bearing for the nested-corner law
|
|
706
|
-
* (docs/DESIGN-SPEC.md §4)
|
|
707
|
-
*
|
|
708
|
-
*
|
|
709
|
-
*
|
|
710
|
-
* clamps to 0 against `ctrl` 1) — a density-tracking inset would break concentricity in both directions (verified: this
|
|
711
|
-
* inset's own value, HAD it stayed density-tracking, resolves via `scaleSpace(2, level, multiplier)`
|
|
712
|
-
* to 1 at density's floor level -3 and 3 at its ceiling level +3 — the widest swing `deriveSpacing`'s
|
|
713
|
-
* `[-3, 3]` range can produce) for no compensating benefit, since the two radii it sits between
|
|
714
|
-
* never move independently of each other. */
|
|
708
|
+
* (docs/DESIGN-SPEC.md §4). The indicator radius is the track radius − 3 px (the nested-radius
|
|
709
|
+
* lint step wins over exact concentricity, which would be track − inset), so the inset no longer
|
|
710
|
+
* sets a corner; it stays fixed because a density-tracking inset (1 at density -3, 3 at +3 via
|
|
711
|
+
* `scaleSpace(2, level, multiplier)`) would make the track's optical weight swing for no benefit. */
|
|
715
712
|
readonly segmentedTrackInset: 2;
|
|
716
713
|
};
|
|
717
714
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../src/tokens/palette.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;CAgCL,CAAA;AAEV;;;;GAIG;AACH,eAAO,MAAM,CAAC,GAAI,KAAK,SAAS,MAAM,EAAE,EAAE,cAAS,EAAE,aAAQ,KAAG,SAG9D,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;;;;;;;IASjB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;;;;;;;;;CAaK,CAAA;AAEV;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,C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M,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA8B,CAAA;AAElD,0FAA0F;AAC1F,eAAO,MAAM,GAAG;;;;;CAA0B,CAAA;AAE1C,mFAAmF;AACnF,eAAO,MAAM,MAAM;;;;;;CAA6B,CAAA;AAEhD;+BAC+B;AAC/B,eAAO,MAAM,IAAI;;;;;;;;;;;;;CAA2B,CAAA;AAE5C;+CAC+C;AAC/C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;CAA8B,CAAA"}
|
package/dist/tokens/palette.js
CHANGED
|
@@ -121,7 +121,9 @@ const RADIUS_STEP = {
|
|
|
121
121
|
/** SegmentedControl's active indicator, Kbd, Code — one step below the control radius. */
|
|
122
122
|
tight: DEFAULT_RADIUS_VALUES.tight,
|
|
123
123
|
// 5
|
|
124
|
-
/** Progress bar, and the Mantine scale's `sm` step — two steps below the control radius.
|
|
124
|
+
/** Progress bar, and the Mantine scale's `sm` step — two steps below the control radius. (No
|
|
125
|
+
* longer the SegmentedControl indicator: that is the track radius − 3 px snapped down onto the
|
|
126
|
+
* scale, set in `theme/index.ts`.) */
|
|
125
127
|
fine: DEFAULT_RADIUS_VALUES.fine,
|
|
126
128
|
// 4
|
|
127
129
|
/** The Mantine `radius` scale's `xs` step — independent of both anchors. */
|
|
@@ -631,15 +633,10 @@ const SPACE_FIXED = {
|
|
|
631
633
|
readingProgressHeight: 2,
|
|
632
634
|
/** SegmentedControl track's optical inset (`styles.root` padding) — moved OUT of `SPACE_STEP` and
|
|
633
635
|
* exempted from the density knob because it is load-bearing for the nested-corner law
|
|
634
|
-
* (docs/DESIGN-SPEC.md §4)
|
|
635
|
-
*
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
* clamps to 0 against `ctrl` 1) — a density-tracking inset would break concentricity in both directions (verified: this
|
|
639
|
-
* inset's own value, HAD it stayed density-tracking, resolves via `scaleSpace(2, level, multiplier)`
|
|
640
|
-
* to 1 at density's floor level -3 and 3 at its ceiling level +3 — the widest swing `deriveSpacing`'s
|
|
641
|
-
* `[-3, 3]` range can produce) for no compensating benefit, since the two radii it sits between
|
|
642
|
-
* never move independently of each other. */
|
|
636
|
+
* (docs/DESIGN-SPEC.md §4). The indicator radius is the track radius − 3 px (the nested-radius
|
|
637
|
+
* lint step wins over exact concentricity, which would be track − inset), so the inset no longer
|
|
638
|
+
* sets a corner; it stays fixed because a density-tracking inset (1 at density -3, 3 at +3 via
|
|
639
|
+
* `scaleSpace(2, level, multiplier)`) would make the track's optical weight swing for no benefit. */
|
|
643
640
|
segmentedTrackInset: 2
|
|
644
641
|
};
|
|
645
642
|
function scaleSpace(value, level, multiplier) {
|
package/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# basalt-ui v2.
|
|
1
|
+
# basalt-ui v2.24.0
|
|
2
2
|
# Opinionated framework for Mantine-based React apps — theme, app shell, TanStack Charts, toolchain presets
|
|
3
3
|
#
|
|
4
4
|
# Entry points: use the exact import specifier below; do not guess.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# A subpath's `Install:` line is its required peers; `OptionalPeers:` are import()-only, install on use.
|
|
14
14
|
|
|
15
15
|
Package: basalt-ui
|
|
16
|
-
Version: 2.
|
|
16
|
+
Version: 2.24.0
|
|
17
17
|
|
|
18
18
|
## basalt-ui
|
|
19
19
|
Import: import { ... } from 'basalt-ui'
|
|
@@ -29,6 +29,7 @@ Signature: BarList(props: BarListProps): JSX.Element
|
|
|
29
29
|
max?: number
|
|
30
30
|
variant?: "thin" | "inline"
|
|
31
31
|
accentLeader?: boolean
|
|
32
|
+
secondaryAlign?: "start" | "end"
|
|
32
33
|
loading?: boolean
|
|
33
34
|
loadingRows?: number
|
|
34
35
|
emptyText?: string
|
|
@@ -110,6 +111,7 @@ Signature: Meter(props: MeterProps): JSX.Element
|
|
|
110
111
|
startCaption?: ReactNode [with segments | zones]
|
|
111
112
|
endCaption?: ReactNode [with segments | zones]
|
|
112
113
|
reading?: boolean [with segments | zones]
|
|
114
|
+
readingAt?: "fill" | "start" [with segments | zones]
|
|
113
115
|
value?: number | null [with zones]
|
|
114
116
|
color?: string
|
|
115
117
|
track?: boolean
|
|
@@ -233,7 +235,8 @@ Signature: StatGroup(props: StatGroupProps): JSX.Element
|
|
|
233
235
|
children: ReactNode [with variant="grid"]
|
|
234
236
|
label: string [with variant="strip"]
|
|
235
237
|
cells: readonly StatStripCell[] [with variant="strip"]
|
|
236
|
-
footer?: readonly
|
|
238
|
+
footer?: readonly StatStripFooterEntry[] [with variant="strip"]
|
|
239
|
+
shotAbsent?: readonly StatStripShotState[] [with variant="strip"]
|
|
237
240
|
Signature: StatusDot(props: StatusDotProps): JSX.Element
|
|
238
241
|
className?: string
|
|
239
242
|
style?: CSSProperties
|
|
@@ -490,7 +493,7 @@ Signature: Sparkline(props: SparklineProps): ReactElement<unknown, string | JSXE
|
|
|
490
493
|
className?: string
|
|
491
494
|
style?: CSSProperties
|
|
492
495
|
ariaLabel: string
|
|
493
|
-
data: readonly number[]
|
|
496
|
+
data: readonly number[] | readonly { at: Date | number | string; …
|
|
494
497
|
height: number
|
|
495
498
|
width?: number
|
|
496
499
|
mark?: "bar" | "line"
|
package/package.json
CHANGED
package/src/charts/BandStrip.tsx
CHANGED
|
@@ -21,7 +21,14 @@ import { oneOf, requiredProp } from '../common/errors'
|
|
|
21
21
|
import { NON_FINITE } from '../format/shared'
|
|
22
22
|
import { VX, alpha } from '../tokens'
|
|
23
23
|
import { CartesianRung } from './CartesianChart'
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
BAND_GLYPH_MIN_PX,
|
|
26
|
+
NOTCH_PX,
|
|
27
|
+
glyphOf,
|
|
28
|
+
groupsOf,
|
|
29
|
+
resolveNamedState,
|
|
30
|
+
toneOf,
|
|
31
|
+
} from './band-fold'
|
|
25
32
|
import type { Group, NamedChartState } from './band-fold'
|
|
26
33
|
import { emphasis } from './marks'
|
|
27
34
|
import { rowX } from './types'
|
|
@@ -262,6 +269,7 @@ function layoutBands<T>(input: LayoutInput<T>): {
|
|
|
262
269
|
markers: Layer[]
|
|
263
270
|
hits: Hit<T>[]
|
|
264
271
|
glyphs: Glyph[]
|
|
272
|
+
notches: Layer[]
|
|
265
273
|
} {
|
|
266
274
|
const { data, getBand, fold, absentState: absentKey } = input
|
|
267
275
|
const cap = Math.floor(input.width / (fold?.minBandPx ?? DEFAULT_MIN_BAND_PX))
|
|
@@ -280,6 +288,7 @@ function layoutBands<T>(input: LayoutInput<T>): {
|
|
|
280
288
|
}
|
|
281
289
|
const hits: Hit<T>[] = []
|
|
282
290
|
const glyphs: Glyph[] = []
|
|
291
|
+
const notches = new Map<string, Layer>()
|
|
283
292
|
|
|
284
293
|
for (const g of groups) {
|
|
285
294
|
const datum = fold && g.items.length > 1 ? fold.merge(g.items) : g.items[0]
|
|
@@ -290,9 +299,29 @@ function layoutBands<T>(input: LayoutInput<T>): {
|
|
|
290
299
|
const named = input.states.get(span.state)
|
|
291
300
|
const glyph = named && glyphOf(named)
|
|
292
301
|
// The primary part's centre: an absent share is taken from the right edge.
|
|
293
|
-
if (answers.primary && glyph
|
|
302
|
+
if (answers.primary && glyph) {
|
|
294
303
|
const share = absentShareOf(span, absentKey)
|
|
295
|
-
|
|
304
|
+
const width = cell.f1 - cell.f0
|
|
305
|
+
// The fractions are float differences: a 16 px cell may measure 15.999… px.
|
|
306
|
+
if (width * input.width >= BAND_GLYPH_MIN_PX - 1e-6)
|
|
307
|
+
glyphs.push({ f: cell.f0 + (width * (1 - share)) / 2, glyph })
|
|
308
|
+
else {
|
|
309
|
+
// Too narrow for the glyph: a notch along the bottom keeps the state off hue alone.
|
|
310
|
+
const px = NOTCH_PX[toneOf(named) === 'bad' ? 'bad' : 'warn']
|
|
311
|
+
// The state's own fill pulled towards the ink: it reads on any surface, as a cut-out would not.
|
|
312
|
+
const fill = span.fill ?? named.color
|
|
313
|
+
paintInto(
|
|
314
|
+
notches,
|
|
315
|
+
`color-mix(in srgb, ${fill} 50%, ${VX.ink})`,
|
|
316
|
+
input.emphasis(span.state),
|
|
317
|
+
{
|
|
318
|
+
f0: cell.f0,
|
|
319
|
+
f1: cell.f0 + width * (1 - share),
|
|
320
|
+
y0: 0,
|
|
321
|
+
y1: Math.min(px / Math.max(input.height, 1), 0.5),
|
|
322
|
+
},
|
|
323
|
+
)
|
|
324
|
+
}
|
|
296
325
|
}
|
|
297
326
|
g.items.forEach((source, i) => {
|
|
298
327
|
const slot = g.start + i
|
|
@@ -301,7 +330,13 @@ function layoutBands<T>(input: LayoutInput<T>): {
|
|
|
301
330
|
hits.push({ slot, source, state: absentKey, datum })
|
|
302
331
|
})
|
|
303
332
|
}
|
|
304
|
-
return {
|
|
333
|
+
return {
|
|
334
|
+
base: [...ctx.base.values()],
|
|
335
|
+
markers: [...ctx.markers.values()],
|
|
336
|
+
hits,
|
|
337
|
+
glyphs,
|
|
338
|
+
notches: [...notches.values()],
|
|
339
|
+
}
|
|
305
340
|
}
|
|
306
341
|
|
|
307
342
|
export function BandStrip<T, X extends ChartX = ChartX, K extends string = string>(
|
|
@@ -349,7 +384,7 @@ export function BandStrip<T, X extends ChartX = ChartX, K extends string = strin
|
|
|
349
384
|
|
|
350
385
|
const marks = useCallback(
|
|
351
386
|
(plot: PlotContext<T, X>): ChartMarks => {
|
|
352
|
-
const { base, markers, hits, glyphs } = layoutBands({
|
|
387
|
+
const { base, markers, hits, glyphs, notches } = layoutBands({
|
|
353
388
|
data,
|
|
354
389
|
getBand,
|
|
355
390
|
fold,
|
|
@@ -382,6 +417,21 @@ export function BandStrip<T, X extends ChartX = ChartX, K extends string = strin
|
|
|
382
417
|
}),
|
|
383
418
|
),
|
|
384
419
|
),
|
|
420
|
+
...notches.map(({ fill, opacity, cells }, i) =>
|
|
421
|
+
decorative(
|
|
422
|
+
rect(cells, {
|
|
423
|
+
id: `band-notches-${i}`,
|
|
424
|
+
x1: 'f0',
|
|
425
|
+
x2: 'f1',
|
|
426
|
+
y1: 'y0',
|
|
427
|
+
y2: 'y1',
|
|
428
|
+
xScale: 'zx',
|
|
429
|
+
fill,
|
|
430
|
+
inset: 0,
|
|
431
|
+
...(opacity < 1 && { fillOpacity: opacity }),
|
|
432
|
+
}),
|
|
433
|
+
),
|
|
434
|
+
),
|
|
385
435
|
...(glyphs.length > 0
|
|
386
436
|
? [
|
|
387
437
|
decorative(
|