basalt-ui 2.20.0 → 2.22.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 +72 -0
- package/MIGRATING.md +394 -12
- package/agent/agents/basalt-design-reviewer.md +22 -5
- package/agent/rules/basalt-tokens.md +3 -3
- package/agent/skills/basalt-design/SKILL.md +10 -23
- package/agent/skills/basalt-design/references/anti-defaults.md +24 -0
- package/agent/skills/basalt-design/references/catalogue.md +49 -0
- package/agent/skills/basalt-design/references/concept.md +36 -0
- package/agent/skills/basalt-design/references/encoding-rules.md +45 -0
- package/agent/skills/basalt-design/references/stat-tile.md +24 -0
- package/agent/templates/AGENTS-block.md.tpl +3 -3
- package/configs/oxlint-plugin.js +1 -0
- package/dist/charts/BandStrip.d.ts.map +1 -1
- package/dist/charts/BandStrip.js +27 -3
- package/dist/charts/Bars.d.ts.map +1 -1
- package/dist/charts/Bars.js +5 -0
- package/dist/charts/CartesianChart.d.ts +8 -0
- package/dist/charts/CartesianChart.d.ts.map +1 -1
- package/dist/charts/CartesianChart.js +8 -5
- package/dist/charts/ChartCard.d.ts +17 -4
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +33 -8
- package/dist/charts/DualPanel.d.ts.map +1 -1
- package/dist/charts/DualPanel.js +5 -8
- package/dist/charts/Heatmap.d.ts +12 -1
- package/dist/charts/Heatmap.d.ts.map +1 -1
- package/dist/charts/Heatmap.js +34 -5
- package/dist/charts/Lines.d.ts +3 -0
- package/dist/charts/Lines.d.ts.map +1 -1
- package/dist/charts/Lines.js +29 -6
- package/dist/charts/MirroredBars.d.ts.map +1 -1
- package/dist/charts/MirroredBars.js +4 -6
- package/dist/charts/Sparkline.d.ts +7 -1
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +39 -14
- package/dist/charts/StackedArea.d.ts +4 -1
- package/dist/charts/StackedArea.d.ts.map +1 -1
- package/dist/charts/StackedArea.js +9 -3
- package/dist/charts/band-fold.d.ts +20 -1
- package/dist/charts/band-fold.d.ts.map +1 -1
- package/dist/charts/band-fold.js +9 -0
- package/dist/charts/chart-box.module.css +19 -0
- package/dist/charts/chart-card.module.css +25 -0
- package/dist/charts/chart-legend.module.css +7 -0
- package/dist/charts/compile.d.ts +17 -6
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +145 -74
- package/dist/charts/labels.d.ts +15 -4
- package/dist/charts/labels.d.ts.map +1 -1
- package/dist/charts/labels.js +34 -10
- package/dist/charts/legend.d.ts +2 -0
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +7 -21
- package/dist/charts/marks.js +1 -1
- package/dist/charts/panel.d.ts +0 -6
- package/dist/charts/panel.d.ts.map +1 -1
- package/dist/charts/panel.js +1 -10
- package/dist/charts/ref-label.d.ts +26 -0
- package/dist/charts/ref-label.d.ts.map +1 -0
- package/dist/charts/ref-label.js +63 -0
- package/dist/charts/scales.d.ts +4 -1
- package/dist/charts/scales.d.ts.map +1 -1
- package/dist/charts/scales.js +14 -3
- package/dist/charts/sparkline.module.css +10 -11
- package/dist/charts/sparkline.module.css.d.ts +1 -2
- package/dist/charts/state.d.ts +7 -0
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +4 -1
- package/dist/charts/types.d.ts +14 -5
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/cli/check-theme.d.ts.map +1 -1
- package/dist/cli/check-theme.js +3 -0
- package/dist/cli/doctor-upgrade.d.ts +1 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +1 -0
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +3 -2
- package/dist/cli/index.d.ts +4 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +27 -15
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +71 -6
- package/dist/cli/shot/capture.d.ts +21 -2
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +200 -33
- package/dist/cli/shot/detect.d.ts +51 -0
- package/dist/cli/shot/detect.d.ts.map +1 -0
- package/dist/cli/shot/detect.js +409 -0
- package/dist/cli/shot/index.d.ts.map +1 -1
- package/dist/cli/shot/index.js +7 -4
- package/dist/cli/shot/measure.d.ts +2 -0
- package/dist/cli/shot/measure.d.ts.map +1 -1
- package/dist/cli/shot/measure.js +2 -0
- package/dist/cli/shot/playwright.d.ts +5 -2
- package/dist/cli/shot/playwright.d.ts.map +1 -1
- package/dist/cli/shot/types.d.ts +6 -1
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/shot/types.js +4 -0
- package/dist/cli/sync.d.ts +2 -0
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +2 -2
- package/dist/common/retry-button.d.ts +12 -0
- package/dist/common/retry-button.d.ts.map +1 -0
- package/dist/common/retry-button.js +22 -0
- package/dist/common/retry-button.module.css +58 -0
- package/dist/common/retry-button.module.css.d.ts +8 -0
- package/dist/controls/controls.module.css +11 -1
- package/dist/controls/filter-pill.d.ts.map +1 -1
- package/dist/controls/filter-pill.js +1 -0
- package/dist/controls/sync-button.d.ts.map +1 -1
- package/dist/controls/sync-button.js +22 -3
- package/dist/controls/sync-button.module.css +34 -2
- package/dist/controls/sync-button.module.css.d.ts +1 -0
- package/dist/dashboard/bar-list.d.ts +5 -2
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +9 -10
- package/dist/dashboard/bar-list.module.css +53 -0
- package/dist/dashboard/bar-list.module.css.d.ts +1 -0
- package/dist/dashboard/index.d.ts +1 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +2 -0
- package/dist/dashboard/meter-model.d.ts +108 -6
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +123 -19
- package/dist/dashboard/meter-parts.d.ts +8 -0
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +345 -146
- package/dist/dashboard/meter.d.ts +50 -63
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +24 -3
- package/dist/dashboard/meter.module.css +79 -65
- package/dist/dashboard/meter.module.css.d.ts +7 -7
- package/dist/dashboard/page-summary.d.ts +20 -0
- package/dist/dashboard/page-summary.d.ts.map +1 -0
- package/dist/dashboard/page-summary.js +28 -0
- package/dist/dashboard/page-summary.module.css +89 -0
- package/dist/dashboard/page-summary.module.css.d.ts +15 -0
- package/dist/dashboard/query-state.d.ts +1 -1
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +3 -2
- package/dist/dashboard/section.d.ts +25 -2
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.js +10 -5
- package/dist/dashboard/section.module.css +23 -0
- package/dist/dashboard/section.module.css.d.ts +1 -0
- package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
- package/dist/dashboard/stat-card-parts.js +1 -1
- package/dist/dashboard/stat-card.d.ts +4 -2
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +7 -4
- package/dist/dashboard/stat-card.module.css +17 -0
- package/dist/dashboard/stat-strip.d.ts +24 -1
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +97 -39
- package/dist/dashboard/stat-strip.module.css +147 -17
- package/dist/dashboard/stat-strip.module.css.d.ts +8 -0
- package/dist/dashboard/visual-slot.d.ts +8 -0
- package/dist/dashboard/visual-slot.d.ts.map +1 -0
- package/dist/dashboard/visual-slot.js +7 -0
- package/dist/guard/index.d.ts +15 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +14 -0
- package/dist/guard/palette.d.ts +51 -0
- package/dist/guard/palette.d.ts.map +1 -0
- package/dist/guard/palette.js +190 -0
- package/dist/guard/series-file.d.ts +15 -0
- package/dist/guard/series-file.d.ts.map +1 -0
- package/dist/guard/series-file.js +29 -0
- package/dist/guard/types.d.ts +3 -3
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/guard/vx-names.d.ts.map +1 -1
- package/dist/guard/vx-names.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/styles.css +34 -2
- package/dist/surfaces.d.ts +1 -1
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +2 -0
- package/dist/theme/chrome-vars.d.ts +20 -5
- package/dist/theme/chrome-vars.d.ts.map +1 -1
- package/dist/theme/chrome-vars.js +46 -3
- package/dist/theme/controls.module.css +33 -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 +11 -5
- package/dist/tokens/core.d.ts +2 -1
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +6 -1
- package/dist/tokens/derive.d.ts +3 -1
- package/dist/tokens/derive.d.ts.map +1 -1
- package/dist/tokens/derive.js +16 -1
- package/dist/tokens/oklab.d.ts +28 -0
- package/dist/tokens/oklab.d.ts.map +1 -0
- package/dist/tokens/oklab.js +73 -0
- package/dist/tokens/palette.d.ts +4 -0
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +4 -0
- package/dist/tokens/status-text.d.ts.map +1 -1
- package/dist/tokens/status-text.js +3 -1
- package/llms.txt +43 -23
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +33 -3
- package/src/charts/Bars.tsx +6 -0
- package/src/charts/CartesianChart.tsx +16 -3
- package/src/charts/ChartCard.tsx +43 -7
- package/src/charts/DualPanel.tsx +3 -6
- package/src/charts/Heatmap.tsx +54 -5
- package/src/charts/Lines.tsx +56 -10
- package/src/charts/MirroredBars.tsx +3 -5
- package/src/charts/Sparkline.tsx +50 -13
- package/src/charts/StackedArea.tsx +14 -4
- package/src/charts/band-fold.ts +31 -1
- package/src/charts/chart-box.module.css +19 -0
- package/src/charts/chart-card.module.css +25 -0
- package/src/charts/chart-legend.module.css +7 -0
- package/src/charts/compile.ts +210 -85
- package/src/charts/labels.ts +48 -14
- package/src/charts/legend.tsx +10 -20
- package/src/charts/marks.ts +1 -1
- package/src/charts/panel.tsx +1 -16
- package/src/charts/ref-label.ts +104 -0
- package/src/charts/scales.ts +22 -2
- package/src/charts/sparkline.module.css +10 -11
- package/src/charts/sparkline.module.css.d.ts +1 -2
- package/src/charts/state.tsx +12 -1
- package/src/charts/types.ts +14 -5
- package/src/cli/check-theme.ts +3 -0
- package/src/cli/doctor-upgrade.ts +1 -1
- package/src/cli/help.ts +18 -1
- package/src/cli/index.ts +48 -17
- package/src/cli/init.ts +102 -4
- package/src/cli/shot/capture.ts +266 -34
- package/src/cli/shot/detect.ts +550 -0
- package/src/cli/shot/index.ts +8 -4
- package/src/cli/shot/measure.ts +4 -0
- package/src/cli/shot/playwright.ts +2 -2
- package/src/cli/shot/types.ts +8 -1
- package/src/cli/sync.ts +4 -2
- package/src/common/retry-button.module.css +58 -0
- package/src/common/retry-button.module.css.d.ts +8 -0
- package/src/common/retry-button.tsx +29 -0
- package/src/controls/controls.module.css +11 -1
- package/src/controls/filter-pill.tsx +2 -0
- package/src/controls/sync-button.module.css +34 -2
- package/src/controls/sync-button.module.css.d.ts +1 -0
- package/src/controls/sync-button.tsx +40 -4
- package/src/dashboard/bar-list.module.css +53 -0
- package/src/dashboard/bar-list.module.css.d.ts +1 -0
- package/src/dashboard/bar-list.tsx +88 -76
- package/src/dashboard/index.ts +1 -0
- package/src/dashboard/meter-model.ts +265 -28
- package/src/dashboard/meter-parts.tsx +424 -163
- package/src/dashboard/meter.module.css +79 -65
- package/src/dashboard/meter.module.css.d.ts +7 -7
- package/src/dashboard/meter.tsx +77 -17
- package/src/dashboard/page-summary.module.css +89 -0
- package/src/dashboard/page-summary.module.css.d.ts +15 -0
- package/src/dashboard/page-summary.tsx +95 -0
- package/src/dashboard/query-state.tsx +4 -7
- package/src/dashboard/section.module.css +23 -0
- package/src/dashboard/section.module.css.d.ts +1 -0
- package/src/dashboard/section.tsx +59 -11
- package/src/dashboard/stat-card-parts.tsx +5 -1
- package/src/dashboard/stat-card.module.css +17 -0
- package/src/dashboard/stat-card.tsx +14 -5
- package/src/dashboard/stat-strip.module.css +147 -17
- package/src/dashboard/stat-strip.module.css.d.ts +8 -0
- package/src/dashboard/stat-strip.tsx +182 -56
- package/src/dashboard/visual-slot.ts +17 -0
- package/src/guard/index.ts +16 -4
- package/src/guard/palette.ts +261 -0
- package/src/guard/series-file.ts +51 -0
- package/src/guard/types.ts +3 -2
- package/src/guard/vx-names.ts +2 -0
- package/src/index.ts +2 -0
- package/src/styles.css +34 -2
- package/src/surfaces.ts +2 -0
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +220 -60
- package/src/theme/chrome-vars.ts +77 -8
- package/src/theme/controls.module.css +33 -0
- package/src/theme/controls.module.css.d.ts +1 -0
- package/src/theme/index.ts +18 -5
- package/src/tokens/core.ts +4 -1
- package/src/tokens/derive.ts +32 -3
- package/src/tokens/oklab.ts +97 -0
- package/src/tokens/palette.ts +4 -0
- package/src/tokens/status-text.ts +2 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import classes from "./retry-button.module.css";
|
|
3
|
+
function RetryButton({
|
|
4
|
+
onClick,
|
|
5
|
+
retrying = false
|
|
6
|
+
}) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"button",
|
|
9
|
+
{
|
|
10
|
+
type: "button",
|
|
11
|
+
className: classes.retry,
|
|
12
|
+
"data-basalt-retry": "",
|
|
13
|
+
disabled: retrying,
|
|
14
|
+
...retrying && { "aria-busy": true },
|
|
15
|
+
onClick,
|
|
16
|
+
children: "Retry"
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
RetryButton
|
|
22
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The one Retry. ErrorState (Mantine, StatCard / pages), ChartCard's placeholder and a strip cell's
|
|
3
|
+
* error all render this, so the three read as one button. It is a plain element because `./charts`
|
|
4
|
+
* resolves with no Mantine, and it is styled to be a Mantine `size="xs" variant="default"` Button
|
|
5
|
+
* reading the same `--vx-*` tokens the theme binds that button to: panel fill (elevated on hover), no
|
|
6
|
+
* border, `shadow-raised`, the control radius, the xs type size, the theme's inline padding step and
|
|
7
|
+
* Mantine's 30px xs height. `--mantine-scale` carries the app's scale knob, 1 where Mantine is absent.
|
|
8
|
+
*/
|
|
9
|
+
.retry {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
flex: none;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
height: calc(1.875rem * var(--mantine-scale, 1));
|
|
16
|
+
padding-block: 0;
|
|
17
|
+
padding-inline: calc(var(--vx-space-stack-md, 0.75rem) * var(--mantine-scale, 1));
|
|
18
|
+
border: calc(0.0625rem * var(--mantine-scale, 1)) solid transparent;
|
|
19
|
+
border-radius: var(--vx-radius-ctrl);
|
|
20
|
+
background: var(--vx-surface-panel);
|
|
21
|
+
box-shadow: var(--vx-shadow-raised);
|
|
22
|
+
color: var(--mantine-color-default-color, var(--vx-ink));
|
|
23
|
+
font: inherit;
|
|
24
|
+
font-size: var(--vx-text-xs);
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
user-select: none;
|
|
30
|
+
transition: box-shadow 120ms ease;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.retry:focus-visible {
|
|
34
|
+
outline: calc(0.125rem * var(--mantine-scale, 1)) solid
|
|
35
|
+
var(--mantine-primary-color-filled, var(--vx-accent-fill));
|
|
36
|
+
outline-offset: calc(0.125rem * var(--mantine-scale, 1));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Hover is a pointer affordance: a touch tap would leave it stuck on. */
|
|
40
|
+
@media (hover: hover) {
|
|
41
|
+
.retry:hover:not(:disabled) {
|
|
42
|
+
background: var(--vx-surface-elevated);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Busy is Mantine's disabled paint: its own disabled colour and background, flat, no border. */
|
|
47
|
+
.retry:disabled {
|
|
48
|
+
background: var(--mantine-color-disabled, var(--vx-surface-subtle));
|
|
49
|
+
color: var(--mantine-color-disabled-color, var(--vx-muted));
|
|
50
|
+
box-shadow: none;
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media (prefers-reduced-motion: reduce) {
|
|
55
|
+
.retry {
|
|
56
|
+
transition: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -112,7 +112,9 @@
|
|
|
112
112
|
.pill {
|
|
113
113
|
--vx-hit-gap: var(--vx-space-control-gap);
|
|
114
114
|
position: relative;
|
|
115
|
-
|
|
115
|
+
/* A filter pill fits its selected option; this is only the ceiling. 15rem clipped an ordinary site
|
|
116
|
+
* or project name (argo astro site select) — 24rem holds a long one and the label truncates past it. */
|
|
117
|
+
max-width: 24rem;
|
|
116
118
|
border-color: color-mix(in srgb, var(--vx-ink) 12%, transparent);
|
|
117
119
|
}
|
|
118
120
|
|
|
@@ -353,6 +355,14 @@
|
|
|
353
355
|
flex: 0 1 auto;
|
|
354
356
|
}
|
|
355
357
|
|
|
358
|
+
/* Mantine's own inline-start inset is `--input-height / 3` = 10.67px, off every step. The `ctl` inset
|
|
359
|
+
* is the one the buttons beside it already use, so the value lines up with their labels. Set on the
|
|
360
|
+
* input itself: the `--input-padding-inline-start` var is declared on a CHILD of the root this class
|
|
361
|
+
* lands on, so a root-level override would be shadowed. */
|
|
362
|
+
.phoneSelect input {
|
|
363
|
+
padding-inline-start: var(--button-padding-x-ctl);
|
|
364
|
+
}
|
|
365
|
+
|
|
356
366
|
/* ── The facet list (MultiSelectFilter, `panel` + `sheet` surfaces) ──────────────────────────────── */
|
|
357
367
|
|
|
358
368
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-pill.d.ts","sourceRoot":"","sources":["../../src/controls/filter-pill.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAKlD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;IACzB,iGAAiG;IACjG,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB;sFACkF;IAClF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,6FAA6F;IAC7F,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,SAAS,EACT,KAAK,GACN,EAAE,eAAe,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"filter-pill.d.ts","sourceRoot":"","sources":["../../src/controls/filter-pill.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAKlD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;IACzB,iGAAiG;IACjG,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB;sFACkF;IAClF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,6FAA6F;IAC7F,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,SAAS,EACT,KAAK,GACN,EAAE,eAAe,GAAG,SAAS,CAgE7B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,SAAS,CAa1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-button.d.ts","sourceRoot":"","sources":["../../src/controls/sync-button.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"sync-button.d.ts","sourceRoot":"","sources":["../../src/controls/sync-button.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAOlD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,OAAO,EAAE,OAAO,CAAA;IAChB,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IACtC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB;sEACkE;IAClE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAA;IACxB;yBACqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,+EAA+E;AAC/E,eAAO,MAAM,cAAc,QAAS,CAAA;AA+DpC;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,eAAe,EACf,MAAM,EACN,KAAK,EACL,KAAc,EACd,KAAK,EACL,SAAS,EACT,KAAK,GACN,EAAE,eAAe,GAAG,SAAS,CAyE7B"}
|
|
@@ -3,6 +3,7 @@ import { ActionIcon, Button, Tooltip } from "@mantine/core";
|
|
|
3
3
|
import { useSyncExternalStore } from "react";
|
|
4
4
|
import { cx } from "../common/props.js";
|
|
5
5
|
import { relativeTime } from "../format/index.js";
|
|
6
|
+
import { numberFormat } from "../format/shared.js";
|
|
6
7
|
import { IconSlot } from "../theme/icon-slot.js";
|
|
7
8
|
import { RefreshGlyph } from "./glyphs.js";
|
|
8
9
|
import classes from "./sync-button.module.css";
|
|
@@ -11,14 +12,29 @@ function toMillis(at) {
|
|
|
11
12
|
if (at === null || at === void 0) return void 0;
|
|
12
13
|
return at instanceof Date ? at.getTime() : at;
|
|
13
14
|
}
|
|
14
|
-
function useRelativeAge(at) {
|
|
15
|
+
function useRelativeAge(at, format = (timestamp) => relativeTime(timestamp, { style: "short" })) {
|
|
15
16
|
const timestamp = toMillis(at);
|
|
16
17
|
return useSyncExternalStore(
|
|
17
18
|
timestamp === void 0 ? subscribeNever : subscribeAgeTick,
|
|
18
|
-
() => timestamp === void 0 ? void 0 :
|
|
19
|
+
() => timestamp === void 0 ? void 0 : format(timestamp),
|
|
19
20
|
() => void 0
|
|
20
21
|
);
|
|
21
22
|
}
|
|
23
|
+
const COMPACT_UNITS = [
|
|
24
|
+
{ unit: "day", seconds: 86400 },
|
|
25
|
+
{ unit: "hour", seconds: 3600 },
|
|
26
|
+
{ unit: "minute", seconds: 60 }
|
|
27
|
+
];
|
|
28
|
+
function compactAge(timestamp) {
|
|
29
|
+
const seconds = Math.max(0, (Date.now() - timestamp) / 1e3);
|
|
30
|
+
const step = COMPACT_UNITS.find((u) => seconds >= u.seconds);
|
|
31
|
+
if (step === void 0) return relativeTime(timestamp, { style: "short" });
|
|
32
|
+
return numberFormat(void 0, {
|
|
33
|
+
style: "unit",
|
|
34
|
+
unit: step.unit,
|
|
35
|
+
unitDisplay: "narrow"
|
|
36
|
+
}).format(Math.floor(seconds / step.seconds));
|
|
37
|
+
}
|
|
22
38
|
const subscribeNever = () => () => {
|
|
23
39
|
};
|
|
24
40
|
function subscribeAgeTick(onTick) {
|
|
@@ -36,6 +52,7 @@ function SyncButton({
|
|
|
36
52
|
style
|
|
37
53
|
}) {
|
|
38
54
|
const age = useRelativeAge(lastCompletedAt);
|
|
55
|
+
const shortAge = useRelativeAge(lastCompletedAt, compactAge);
|
|
39
56
|
const tooltip = error ?? age;
|
|
40
57
|
const name = error !== void 0 ? `${label} \u2014 ${error}` : label;
|
|
41
58
|
const control = {
|
|
@@ -80,12 +97,14 @@ function SyncButton({
|
|
|
80
97
|
{
|
|
81
98
|
variant: "default",
|
|
82
99
|
className: cx(classes.pageButton, className),
|
|
100
|
+
...age !== void 0 && { "data-with-age": true },
|
|
83
101
|
...style !== void 0 && { style },
|
|
84
102
|
leftSection: /* @__PURE__ */ jsx(IconSlot, { children: /* @__PURE__ */ jsx(RefreshGlyph, { className: syncing ? classes.spin : void 0 }) }),
|
|
85
103
|
...control,
|
|
86
104
|
children: [
|
|
87
105
|
/* @__PURE__ */ jsx("span", { className: classes.label, children: label }),
|
|
88
|
-
age !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.age, children: age })
|
|
106
|
+
age !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.age, children: age }),
|
|
107
|
+
shortAge !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.ageCompact, "data-sync-age": "compact", children: shortAge })
|
|
89
108
|
]
|
|
90
109
|
}
|
|
91
110
|
)
|
|
@@ -34,8 +34,22 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* The phone form's age (`2 m`): hidden above `sm`, where the long age already sits beside the label.
|
|
38
|
+
* `nowrap` is the whole point of it — a two-token string that wraps inside a 32px button is worse
|
|
39
|
+
* than no age at all.
|
|
40
|
+
*/
|
|
41
|
+
.ageCompact {
|
|
42
|
+
display: none;
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
color: var(--vx-muted);
|
|
45
|
+
font-family: var(--basalt-font-mono);
|
|
46
|
+
font-size: var(--vx-text-xs);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/*
|
|
50
|
+
* `scope: 'page'` below `sm`: the label and the long age go, the glyph stays, and the button
|
|
51
|
+
* collapses to the square icon form (spec §3) — unless an age exists, in which case the compact age
|
|
52
|
+
* rides beside the glyph and the square pin is released (argo m365 refresh at 390). Hidden, not unmounted — a second
|
|
39
53
|
* mount under `hiddenFrom` is exactly the responsive twin law C9 forbids, which is also why the
|
|
40
54
|
* accessible name lives on `aria-label` rather than in this text.
|
|
41
55
|
*
|
|
@@ -52,6 +66,10 @@
|
|
|
52
66
|
display: none;
|
|
53
67
|
}
|
|
54
68
|
|
|
69
|
+
.ageCompact {
|
|
70
|
+
display: inline;
|
|
71
|
+
}
|
|
72
|
+
|
|
55
73
|
.pageButton {
|
|
56
74
|
--button-padding-x: 0;
|
|
57
75
|
|
|
@@ -61,4 +79,18 @@
|
|
|
61
79
|
.pageButton :global(.mantine-Button-section[data-position='left']) {
|
|
62
80
|
margin-inline-end: 0;
|
|
63
81
|
}
|
|
82
|
+
|
|
83
|
+
/* An age beside the glyph: content-width, on the `ctl` inset, glyph and age one control gap apart. */
|
|
84
|
+
.pageButton[data-with-age] {
|
|
85
|
+
--button-padding-x: var(--button-padding-x-ctl);
|
|
86
|
+
|
|
87
|
+
/* Mantine divides the inline-start padding by 1.5 when a left section exists — off the scale. */
|
|
88
|
+
padding-inline: var(--button-padding-x-ctl);
|
|
89
|
+
width: auto;
|
|
90
|
+
flex: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pageButton[data-with-age] :global(.mantine-Button-section[data-position='left']) {
|
|
94
|
+
margin-inline-end: var(--vx-space-control-gap);
|
|
95
|
+
}
|
|
64
96
|
}
|
|
@@ -24,8 +24,11 @@ export type BarListProps = BasaltProps & {
|
|
|
24
24
|
format?: (value: number, part: 'value' | 'max') => string;
|
|
25
25
|
/** Scale end shared by rows without their own `max`. Default: the largest of those rows' values. */
|
|
26
26
|
max?: number;
|
|
27
|
-
/**
|
|
28
|
-
|
|
27
|
+
/**
|
|
28
|
+
* `thin` (default): label on its own line above a thin bar, value right-aligned on that line.
|
|
29
|
+
* `inline`: the label sits inside a heavier track, the value outside it.
|
|
30
|
+
*/
|
|
31
|
+
variant?: 'thin' | 'inline';
|
|
29
32
|
/** The first row's bar takes the accent. Off by default. */
|
|
30
33
|
accentLeader?: boolean;
|
|
31
34
|
/** Renders row-shaped skeletons. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-list.d.ts","sourceRoot":"","sources":["../../src/dashboard/bar-list.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bar-list.d.ts","sourceRoot":"","sources":["../../src/dashboard/bar-list.tsx"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAIlD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,6FAA6F;IAC7F,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACvC,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,6EAA6E;IAC7E,KAAK,EAAE,SAAS,WAAW,EAAE,CAAA;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,KAAK,KAAK,MAAM,CAAA;IACzD,oGAAoG;IACpG,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IAC3B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAMD,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,KAAK,EACL,MAAe,EACf,GAAG,EACH,OAAgB,EAChB,YAAoB,EACpB,OAAe,EACf,WAAe,EACf,SAAqB,EACrB,SAAS,EACT,KAAK,GACN,EAAE,YAAY,+BAmGd"}
|
|
@@ -9,7 +9,7 @@ function BarList({
|
|
|
9
9
|
items,
|
|
10
10
|
format = asText,
|
|
11
11
|
max,
|
|
12
|
-
variant = "
|
|
12
|
+
variant = "thin",
|
|
13
13
|
accentLeader = false,
|
|
14
14
|
loading = false,
|
|
15
15
|
loadingRows = 5,
|
|
@@ -18,13 +18,13 @@ function BarList({
|
|
|
18
18
|
style
|
|
19
19
|
}) {
|
|
20
20
|
if (loading) {
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ jsx("div", { className: cx(classes.frame, className), style, children: /* @__PURE__ */ jsxs("div", { className: classes.root, "aria-busy": "true", children: [
|
|
22
22
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: `Loading ${label}` }),
|
|
23
23
|
Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonRow, "data-bar-skeleton": true }, i))
|
|
24
|
-
] });
|
|
24
|
+
] }) });
|
|
25
25
|
}
|
|
26
26
|
if (items.length === 0) {
|
|
27
|
-
return /* @__PURE__ */ jsx("
|
|
27
|
+
return /* @__PURE__ */ jsx("div", { className: cx(classes.frame, className), style, children: /* @__PURE__ */ jsx("output", { className: classes.root, "aria-label": label, children: /* @__PURE__ */ jsx("span", { className: classes.empty, children: emptyText }) }) });
|
|
28
28
|
}
|
|
29
29
|
const scale = max ?? items.reduce(
|
|
30
30
|
(top, i) => i.max === void 0 && Number.isFinite(i.value) ? Math.max(top, i.value) : top,
|
|
@@ -33,16 +33,15 @@ function BarList({
|
|
|
33
33
|
const thin = variant === "thin";
|
|
34
34
|
const hasSecondary = items.some((i) => hasContent(i.secondary));
|
|
35
35
|
return (
|
|
36
|
-
// The
|
|
37
|
-
/* @__PURE__ */ jsx(
|
|
36
|
+
// The frame is the width container the wide layout keys on (a container cannot restyle its own grid).
|
|
37
|
+
/* @__PURE__ */ jsx("div", { className: cx(classes.frame, className), style, children: /* @__PURE__ */ jsx(
|
|
38
38
|
"ul",
|
|
39
39
|
{
|
|
40
|
-
className:
|
|
41
|
-
style,
|
|
40
|
+
className: classes.root,
|
|
42
41
|
role: "list",
|
|
43
42
|
"aria-label": label,
|
|
44
43
|
"data-secondary": hasSecondary ? "" : void 0,
|
|
45
|
-
"data-variant":
|
|
44
|
+
"data-variant": variant,
|
|
46
45
|
children: items.map((item, i) => {
|
|
47
46
|
const isLeader = accentLeader && i === 0;
|
|
48
47
|
const rowScale = item.max ?? scale;
|
|
@@ -81,7 +80,7 @@ function BarList({
|
|
|
81
80
|
] }, item.key ?? `${item.label}-${i}`);
|
|
82
81
|
})
|
|
83
82
|
}
|
|
84
|
-
)
|
|
83
|
+
) })
|
|
85
84
|
);
|
|
86
85
|
}
|
|
87
86
|
export {
|
|
@@ -5,6 +5,19 @@
|
|
|
5
5
|
* row never wraps: the label truncates, the value is nowrap.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/*
|
|
9
|
+
* The width container the wide layout keys on (a container cannot restyle its own grid), in every
|
|
10
|
+
* state. It is named `basalt-card` because the theme guard permits only the declared names; that
|
|
11
|
+
* shadows an enclosing card's container for the list's descendants only, and the query below measures
|
|
12
|
+
* the LIST's own inline size, not the card's. `inline-size: 100%` keeps it from collapsing to zero in
|
|
13
|
+
* a flex row or an auto track (size containment ignores content width).
|
|
14
|
+
*/
|
|
15
|
+
.frame {
|
|
16
|
+
container: basalt-card / inline-size;
|
|
17
|
+
inline-size: 100%;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
.root {
|
|
9
22
|
display: grid;
|
|
10
23
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
@@ -164,3 +177,43 @@
|
|
|
164
177
|
text-overflow: ellipsis;
|
|
165
178
|
white-space: nowrap;
|
|
166
179
|
}
|
|
180
|
+
|
|
181
|
+
/*
|
|
182
|
+
* Wide (a container of 480px or more): one row, `[label][value][secondary][track]`. The label column fits the
|
|
183
|
+
* longest label (capped at 40% or 14rem, the rest truncates with its `title`), value and secondary are right-
|
|
184
|
+
* aligned and shared by every row, and the track takes the remaining width on the one scale — a
|
|
185
|
+
* full-scale bar ends at the track end, never under a value. Compact keeps the stacked thin layout.
|
|
186
|
+
*/
|
|
187
|
+
@container basalt-card (width >= 480px) {
|
|
188
|
+
.root[data-variant='thin'] {
|
|
189
|
+
grid-template-columns: fit-content(min(40%, 14rem)) auto minmax(0, 1fr);
|
|
190
|
+
column-gap: var(--vx-space-stack-md, 0.75rem);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.root[data-variant='thin'][data-secondary] {
|
|
194
|
+
grid-template-columns: fit-content(min(40%, 14rem)) auto fit-content(30%) minmax(0, 1fr);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.root[data-variant='thin'] .row {
|
|
198
|
+
grid-template-rows: auto;
|
|
199
|
+
align-items: center;
|
|
200
|
+
padding-block: 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.root[data-variant='thin'] .track {
|
|
204
|
+
grid-column: auto;
|
|
205
|
+
align-self: center;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.root[data-variant='thin'] .label {
|
|
209
|
+
display: block;
|
|
210
|
+
white-space: nowrap;
|
|
211
|
+
text-overflow: ellipsis;
|
|
212
|
+
-webkit-line-clamp: unset;
|
|
213
|
+
line-clamp: unset;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.root[data-variant='thin'] .secondary {
|
|
217
|
+
text-align: end;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { WidgetHeader } from './widget-header.js';
|
|
2
2
|
export { DeltaBadge } from './delta-badge.js';
|
|
3
3
|
export { Section } from './section.js';
|
|
4
|
+
export { PageSummary, type PageSummaryProps } from './page-summary.js';
|
|
4
5
|
export { StatCard, type StatCardBreakdownRow, type StatCardSparklineSize } from './stat-card.js';
|
|
5
6
|
export { StatGroup } from './stat-group.js';
|
|
6
7
|
export type { StatStripCell, StatStripRow } from './stat-strip.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,KAAK,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAChD,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAChD,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/dashboard/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WidgetHeader } from "./widget-header.js";
|
|
2
2
|
import { DeltaBadge } from "./delta-badge.js";
|
|
3
3
|
import { Section } from "./section.js";
|
|
4
|
+
import { PageSummary } from "./page-summary.js";
|
|
4
5
|
import { StatCard } from "./stat-card.js";
|
|
5
6
|
import { StatGroup } from "./stat-group.js";
|
|
6
7
|
import { EmptyState } from "./empty-state.js";
|
|
@@ -13,6 +14,7 @@ export {
|
|
|
13
14
|
DeltaBadge,
|
|
14
15
|
EmptyState,
|
|
15
16
|
Meter,
|
|
17
|
+
PageSummary,
|
|
16
18
|
Section,
|
|
17
19
|
SettingsRow,
|
|
18
20
|
SettingsSection,
|
|
@@ -7,12 +7,27 @@ export type MeterSegment = {
|
|
|
7
7
|
value: number;
|
|
8
8
|
label: string;
|
|
9
9
|
color?: string;
|
|
10
|
+
/**
|
|
11
|
+
* `'muted'`: the part takes a step of the muted ramp (a lightness step per muted part). A `color`
|
|
12
|
+
* wins. Steps stay ≥15 points apart up to five muted parts; more merge at the cap.
|
|
13
|
+
*/
|
|
14
|
+
tone?: 'muted';
|
|
10
15
|
forecast?: boolean;
|
|
11
16
|
};
|
|
12
17
|
export type MeterZone = {
|
|
13
18
|
from: number;
|
|
14
19
|
to: number;
|
|
15
20
|
label: string;
|
|
21
|
+
/**
|
|
22
|
+
* `'muted'`: the band takes its step of the muted ramp instead of the line ramp. A `color` wins.
|
|
23
|
+
* Steps stay ≥15 points apart up to six zones; more merge at the cap.
|
|
24
|
+
*/
|
|
25
|
+
tone?: 'muted';
|
|
26
|
+
/**
|
|
27
|
+
* A shorter name for a narrow track. The row tries `label`, then `short`, and only then hides the
|
|
28
|
+
* name; the holding zone always shows its full `label`. The described-by text keeps `label`.
|
|
29
|
+
*/
|
|
30
|
+
short?: string;
|
|
16
31
|
color?: string;
|
|
17
32
|
};
|
|
18
33
|
/** A mark on the track at `at` (in the reading's units). A label is captioned beside it. */
|
|
@@ -20,6 +35,33 @@ export type MeterTick = {
|
|
|
20
35
|
at: number;
|
|
21
36
|
label?: string;
|
|
22
37
|
};
|
|
38
|
+
/** A colour of a `stops` gradient at `at` (in the reading's units); the colour is the consumer's. */
|
|
39
|
+
type MeterStop = {
|
|
40
|
+
at: number;
|
|
41
|
+
color: string;
|
|
42
|
+
};
|
|
43
|
+
/** A ramp step's strength in percent of its neutral: from `lo`, spread over `step` across the steps. */
|
|
44
|
+
export declare const RAMP_ZONE: {
|
|
45
|
+
lo: number;
|
|
46
|
+
step: number;
|
|
47
|
+
solo: number;
|
|
48
|
+
};
|
|
49
|
+
export declare const RAMP_PART: {
|
|
50
|
+
lo: number;
|
|
51
|
+
step: number;
|
|
52
|
+
solo: number;
|
|
53
|
+
};
|
|
54
|
+
/** Neighbouring steps stay at least this far apart (the contrast the zone ramp always had), up to `RAMP_MAX`. */
|
|
55
|
+
export declare const RAMP_MIN_STEP = 15;
|
|
56
|
+
export declare const RAMP_MAX = 95;
|
|
57
|
+
/**
|
|
58
|
+
* Step `index` of `count`. The spread is floored at `RAMP_MIN_STEP` per step, so a ramp stays
|
|
59
|
+
* distinguishable by lightness up to six zones (five segments); past that the last steps clamp at
|
|
60
|
+
* `RAMP_MAX` and merge, which is the cue to group parts.
|
|
61
|
+
*/
|
|
62
|
+
export declare function rampStrength(index: number, count: number, ramp: typeof RAMP_ZONE): number;
|
|
63
|
+
/** A zone's fill: its own colour, else its step of the line (or, `tone="muted"`, the muted) ramp. */
|
|
64
|
+
export declare function zoneFill(zone: MeterZone, index: number, count: number): string;
|
|
23
65
|
/** One tick on the track: its percent position and what it says (caption `label`, aria `text`). */
|
|
24
66
|
export type TickMark = {
|
|
25
67
|
key: string;
|
|
@@ -43,12 +85,17 @@ export type PartCaption = {
|
|
|
43
85
|
label: string;
|
|
44
86
|
text: string;
|
|
45
87
|
color: string | undefined;
|
|
88
|
+
/** Where the part starts on the track, in percent: the caption sits under it when they all fit. */
|
|
89
|
+
startPct: number;
|
|
46
90
|
};
|
|
47
|
-
/** One zone's name on the
|
|
91
|
+
/** One zone's name on the label row: its span's centre and width (percent) and whether it holds the reading. */
|
|
48
92
|
export type ZoneLabel = {
|
|
49
93
|
key: string;
|
|
50
94
|
label: string;
|
|
51
|
-
|
|
95
|
+
/** The fallback name, when the zone has one. */
|
|
96
|
+
short?: string;
|
|
97
|
+
centrePct: number;
|
|
98
|
+
widthPct: number;
|
|
52
99
|
holding: boolean;
|
|
53
100
|
};
|
|
54
101
|
/**
|
|
@@ -62,6 +109,13 @@ type Format = (value: number) => string;
|
|
|
62
109
|
* is DROPPED, never clamped: a mark pinned to the end would state a position it is not at.
|
|
63
110
|
*/
|
|
64
111
|
export declare function tickMarks(ticks: readonly MeterTick[] | undefined, min: number, max: number, format: Format): TickMark[];
|
|
112
|
+
/** A `stops` gradient's colour list, in order along the track; `at` outside `[min, max]` clamps. */
|
|
113
|
+
export declare function stopsGradient(stops: readonly MeterStop[], min: number, span: number): string;
|
|
114
|
+
/** A ring's marks (target, ticks): the angle clockwise from the top, and the accessible text. */
|
|
115
|
+
export declare function ringMarks(target: number | undefined, ticks: readonly MeterTick[] | undefined, min: number, max: number, format: Format): {
|
|
116
|
+
angle: number;
|
|
117
|
+
text: string;
|
|
118
|
+
}[];
|
|
65
119
|
export declare const isReading: (n: number | null | undefined) => n is number;
|
|
66
120
|
/** The track's span. A track that ends at or before its start falls back to 1 and is `valid: false`. */
|
|
67
121
|
export declare function spanOf(min: number, max: number): {
|
|
@@ -92,11 +146,35 @@ export type LabelBox = {
|
|
|
92
146
|
right: number;
|
|
93
147
|
};
|
|
94
148
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* Boxes are relative to the row's own start edge.
|
|
149
|
+
* A label on the shared row: its measured box and, for a zone name, the span it must stay inside.
|
|
150
|
+
* The holding zone's name never hides for width: it ignores its span and is shifted into the row.
|
|
98
151
|
*/
|
|
99
|
-
export
|
|
152
|
+
export type RowLabel = {
|
|
153
|
+
box: LabelBox;
|
|
154
|
+
span?: LabelBox;
|
|
155
|
+
holding?: boolean;
|
|
156
|
+
/** A tick at the track's start or end: it yields to every zone name it would touch. */
|
|
157
|
+
end?: boolean;
|
|
158
|
+
short?: LabelBox;
|
|
159
|
+
};
|
|
160
|
+
/** The placement of the row's labels, index-aligned with the input. */
|
|
161
|
+
export type RowPlacement = {
|
|
162
|
+
shown: boolean[];
|
|
163
|
+
/** Index-aligned with `shown`: the label shows as its `short` box rather than the full one. */
|
|
164
|
+
short: boolean[];
|
|
165
|
+
/** Pixels a shown label moves along the row's physical x axis to stay inside it (0 unless clamped). */
|
|
166
|
+
shift: number[];
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Which labels of the row show, in input order. The holding zone's name claims its place first (it
|
|
170
|
+
* is the reading's verdict, so it never hides for width: it may spill past its span, shifted inside
|
|
171
|
+
* the row); the other ticks go next; every other zone name then shows only
|
|
172
|
+
* when it lies inside the row and its own span and clears every label already kept, trying its full
|
|
173
|
+
* name and then its `short` box; the end ticks (at the track's start or end) go last, so they yield
|
|
174
|
+
* to any name they would touch. A tick keeps at least `gap` px (one gap step of the host's
|
|
175
|
+
* spacing) from every other label; zone names among themselves only must not touch. A hidden name is still named in the described-by text.
|
|
176
|
+
*/
|
|
177
|
+
export declare function placeRowLabels(labels: readonly RowLabel[], rowWidth: number, gap?: number): RowPlacement;
|
|
100
178
|
/** A zone band as left edge + width in percent, clipped to the track. */
|
|
101
179
|
export declare function zoneBand(zone: MeterZone, min: number, span: number): {
|
|
102
180
|
start: number;
|
|
@@ -109,6 +187,7 @@ export type BarInput = {
|
|
|
109
187
|
format: Format;
|
|
110
188
|
segments?: readonly MeterSegment[] | undefined;
|
|
111
189
|
zones?: readonly MeterZone[] | undefined;
|
|
190
|
+
stops?: readonly MeterStop[] | undefined;
|
|
112
191
|
target?: number | undefined;
|
|
113
192
|
ticks?: readonly MeterTick[] | undefined;
|
|
114
193
|
color?: string | undefined;
|
|
@@ -124,6 +203,8 @@ export type BarModel = {
|
|
|
124
203
|
captionMode: CaptionMode;
|
|
125
204
|
/** Only in `parts` mode: one caption per part, in order. Empty otherwise. */
|
|
126
205
|
partCaptions: readonly PartCaption[];
|
|
206
|
+
/** The `stops` gradient's colour list; absent without `stops`. */
|
|
207
|
+
stopsCss: string | undefined;
|
|
127
208
|
/** Only on a zoned track: every zone's name, in zone order. Empty otherwise. */
|
|
128
209
|
zoneLabels: readonly ZoneLabel[];
|
|
129
210
|
ticks: readonly TickMark[];
|
|
@@ -141,5 +222,26 @@ export declare function startCaptionText(model: BarModel, override: ReactNode |
|
|
|
141
222
|
export declare function modelBar(input: BarInput): BarModel;
|
|
142
223
|
/** The ring's one arc, as a fraction of the circumference. */
|
|
143
224
|
export declare const ringFraction: (reading: number, min: number, max: number) => number;
|
|
225
|
+
/** One caption on the marks row: its natural width and where it is anchored (`pct`), else its edge. */
|
|
226
|
+
export type MarkItem = {
|
|
227
|
+
width: number;
|
|
228
|
+
pct?: number;
|
|
229
|
+
edge?: 'end';
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Where each caption of the marks row starts (px, logical start edge), index-aligned with `items`: an
|
|
233
|
+
* anchored caption is centred on its mark and clamped inside the row, the others sit at the start (or,
|
|
234
|
+
* `edge: 'end'`, the end). `null` when nothing is anchored, the row is unmeasured, a caption is wider
|
|
235
|
+
* than the row, or two captions would sit closer than `gap`: the row then flows and wraps instead.
|
|
236
|
+
*/
|
|
237
|
+
export declare function placeMarkCaptions(items: readonly MarkItem[], rowWidth: number, gap: number): number[] | null;
|
|
238
|
+
/**
|
|
239
|
+
* Whether every categorical part's caption fits under its own segment: left-aligned at the part's
|
|
240
|
+
* start and ending before the next part's start (less `gap`) or the row's end. A zero-width part never fits.
|
|
241
|
+
*/
|
|
242
|
+
export declare function partsFitUnder(parts: readonly {
|
|
243
|
+
startPct: number;
|
|
244
|
+
width: number;
|
|
245
|
+
}[], rowWidth: number, gap: number): boolean;
|
|
144
246
|
export {};
|
|
145
247
|
//# sourceMappingURL=meter-model.d.ts.map
|