basalt-ui 2.1.0 → 2.3.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 +31 -0
- package/MIGRATING.md +46 -12
- package/configs/oxlint.json +1 -0
- package/dist/charts/BandStrip.d.ts +7 -7
- package/dist/charts/BandStrip.d.ts.map +1 -1
- package/dist/charts/Bars.d.ts +4 -4
- package/dist/charts/Bars.d.ts.map +1 -1
- package/dist/charts/ChartCard.d.ts +10 -10
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +2 -1
- package/dist/charts/Donut.d.ts +5 -5
- package/dist/charts/Donut.d.ts.map +1 -1
- package/dist/charts/DualPanel.d.ts +9 -9
- package/dist/charts/DualPanel.d.ts.map +1 -1
- package/dist/charts/Heatmap.d.ts +18 -16
- package/dist/charts/Heatmap.d.ts.map +1 -1
- package/dist/charts/Heatmap.js +8 -2
- package/dist/charts/MirroredBars.d.ts +9 -9
- package/dist/charts/MirroredBars.d.ts.map +1 -1
- package/dist/charts/Sparkline.d.ts +9 -5
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +18 -12
- package/dist/charts/StackedArea.d.ts +2 -2
- package/dist/charts/StackedArea.d.ts.map +1 -1
- package/dist/charts/compile.d.ts +17 -1
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +56 -2
- package/dist/charts/index.d.ts +1 -0
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/charts/index.js +3 -1
- package/dist/charts/state.d.ts +3 -0
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +14 -3
- package/dist/charts/types.d.ts +64 -61
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/cli/doctor.js +2 -2
- package/dist/dashboard/index.d.ts +1 -1
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +3 -1
- package/dist/dashboard/stat-card.d.ts +16 -1
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +14 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +12 -10
- package/src/charts/Bars.tsx +4 -4
- package/src/charts/ChartCard.tsx +17 -11
- package/src/charts/Donut.tsx +5 -5
- package/src/charts/DualPanel.tsx +13 -6
- package/src/charts/Heatmap.tsx +23 -15
- package/src/charts/MirroredBars.tsx +8 -8
- package/src/charts/Sparkline.tsx +14 -6
- package/src/charts/StackedArea.tsx +2 -2
- package/src/charts/compile.ts +92 -1
- package/src/charts/index.ts +1 -0
- package/src/charts/state.tsx +15 -3
- package/src/charts/types.ts +70 -57
- package/src/cli/doctor.ts +2 -2
- package/src/dashboard/index.ts +6 -1
- package/src/dashboard/stat-card.tsx +34 -3
- package/src/index.ts +1 -0
package/dist/charts/Sparkline.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { dot } from "@tanstack/charts/dot";
|
|
3
3
|
import { decorative } from "@tanstack/charts/mark/decorative";
|
|
4
4
|
import { lineY } from "@tanstack/charts/line";
|
|
@@ -9,6 +9,7 @@ import { VX } from "../tokens/index.js";
|
|
|
9
9
|
import { chartCurve } from "./curves.js";
|
|
10
10
|
import { barMark } from "./marks.js";
|
|
11
11
|
import { ChartEngine, idPrefixOf } from "./host.js";
|
|
12
|
+
import { ChartPlaceholder, resolveChartState } from "./state.js";
|
|
12
13
|
import { CHART_THEME } from "./theme.js";
|
|
13
14
|
const LINE_WIDTH = 1.6;
|
|
14
15
|
const DOT_R = 2.5;
|
|
@@ -95,6 +96,7 @@ function Sparkline(props) {
|
|
|
95
96
|
color = VX.faint,
|
|
96
97
|
emphasizeLast = false,
|
|
97
98
|
emphasisColor = VX.accent,
|
|
99
|
+
state,
|
|
98
100
|
className,
|
|
99
101
|
style
|
|
100
102
|
} = props;
|
|
@@ -105,22 +107,26 @@ function Sparkline(props) {
|
|
|
105
107
|
if (range === null) return null;
|
|
106
108
|
return compileSparkline(rows, range, mark, color, emphasizeLast ? emphasisColor : null);
|
|
107
109
|
}, [data, mark, color, emphasizeLast, emphasisColor]);
|
|
108
|
-
|
|
110
|
+
const resolved = resolveChartState(state);
|
|
111
|
+
return /* @__PURE__ */ jsxs(
|
|
109
112
|
"div",
|
|
110
113
|
{
|
|
111
114
|
"data-basalt-sparkline": "",
|
|
112
115
|
...className !== void 0 && { className },
|
|
113
116
|
style: { width: width ?? "100%", height, minWidth: 0, ...style },
|
|
114
|
-
children:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
children: [
|
|
118
|
+
resolved !== null && /* @__PURE__ */ jsx(ChartPlaceholder, { state, height, compact: true }),
|
|
119
|
+
resolved === null && definition !== null && /* @__PURE__ */ jsx(
|
|
120
|
+
ChartEngine,
|
|
121
|
+
{
|
|
122
|
+
definition,
|
|
123
|
+
ariaLabel,
|
|
124
|
+
height,
|
|
125
|
+
idPrefix: idPrefixOf(id, "spark"),
|
|
126
|
+
coarse: false
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
]
|
|
124
130
|
}
|
|
125
131
|
);
|
|
126
132
|
}
|
|
@@ -3,13 +3,13 @@ import type { CartesianChartProps, ChartSeries, ChartX } from './types.js';
|
|
|
3
3
|
/** A band. Stacked areas read the left axis and draw no line, so the line fields are absent. */
|
|
4
4
|
export type StackedAreaBand<T> = Pick<ChartSeries<T>, 'key' | 'label' | 'color' | 'getValue' | 'formatValue' | 'tooltip' | 'legend' | 'role' | 'note'> & {
|
|
5
5
|
/** Default 0.85. */
|
|
6
|
-
fillOpacity?: number;
|
|
6
|
+
fillOpacity?: number | undefined;
|
|
7
7
|
};
|
|
8
8
|
export type StackedAreaProps<T, X extends ChartX = ChartX> = Omit<CartesianChartProps<T, X>, 'marks' | 'y' | 'y2' | 'series'> & {
|
|
9
9
|
/** The bands, bottom to top. */
|
|
10
10
|
series: readonly StackedAreaBand<T>[];
|
|
11
11
|
/** No `scale`: a log axis has no additive zero to stack from. */
|
|
12
|
-
y?: Omit<NonNullable<CartesianChartProps<T, X>['y']>, 'scale'
|
|
12
|
+
y?: Omit<NonNullable<CartesianChartProps<T, X>['y']>, 'scale'> | undefined;
|
|
13
13
|
};
|
|
14
14
|
export declare function StackedArea<T, X extends ChartX = ChartX>(props: StackedAreaProps<T, X>): ReactElement;
|
|
15
15
|
//# sourceMappingURL=StackedArea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackedArea.d.ts","sourceRoot":"","sources":["../../src/charts/StackedArea.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAKzC,OAAO,KAAK,EAAE,mBAAmB,EAAc,WAAW,EAAE,MAAM,EAAe,MAAM,SAAS,CAAA;AAIhG,gGAAgG;AAChG,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,IAAI,CACnC,WAAW,CAAC,CAAC,CAAC,EACd,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAChG,GAAG;IACF,oBAAoB;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"StackedArea.d.ts","sourceRoot":"","sources":["../../src/charts/StackedArea.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAKzC,OAAO,KAAK,EAAE,mBAAmB,EAAc,WAAW,EAAE,MAAM,EAAe,MAAM,SAAS,CAAA;AAIhG,gGAAgG;AAChG,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,IAAI,CACnC,WAAW,CAAC,CAAC,CAAC,EACd,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAChG,GAAG;IACF,oBAAoB;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CAC/D,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EACzB,OAAO,GAAG,GAAG,GAAG,IAAI,GAAG,QAAQ,CAChC,GAAG;IACF,gCAAgC;IAChC,MAAM,EAAE,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAA;IACrC,iEAAiE;IACjE,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;CAC3E,CAAA;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EACtD,KAAK,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC5B,YAAY,CAqCd"}
|
package/dist/charts/compile.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChartGradient, ChartPositionScaleOptions, ChartValue, ResponsiveChartDefinition } from '@tanstack/charts/types/core';
|
|
2
2
|
import type { ContainerClass } from '../tokens/size-classes.js';
|
|
3
3
|
import type { XScaleModel } from './scales.js';
|
|
4
|
-
import type { AxisConfig, CartesianChartProps, ChartSeries, ChartX } from './types.js';
|
|
4
|
+
import type { AxisConfig, CartesianChartProps, ChartSeries, ChartX, ZoneSpec } from './types.js';
|
|
5
5
|
/**
|
|
6
6
|
* The compiled definition. Annotated on purpose: TanStack's inferred definition type names internal
|
|
7
7
|
* modules (`dist/scene`, `cursor-host-contract`) and fails declaration emit (TS2883 / TS4058).
|
|
@@ -48,6 +48,12 @@ export declare function yGuide<T>(opts: {
|
|
|
48
48
|
side: 'left' | 'right';
|
|
49
49
|
grid: boolean;
|
|
50
50
|
}): Omit<ChartPositionScaleOptions<number>, 'scale'>;
|
|
51
|
+
/**
|
|
52
|
+
* Every n-th value, n the smallest stride that leaves at most the class's x tick count (the same
|
|
53
|
+
* ladder a continuous x axis counts to). A band axis labels every value it is given and only drops
|
|
54
|
+
* the ones that collide, so a short-label grid (18 hour columns) would otherwise draw all of them.
|
|
55
|
+
*/
|
|
56
|
+
export declare function strideTicks<V>(values: readonly V[], cls: ContainerClass): V[];
|
|
51
57
|
export declare function xGuide<X extends ChartX>(opts: {
|
|
52
58
|
model: XScaleModel<X>;
|
|
53
59
|
xTicks: number | readonly X[] | undefined;
|
|
@@ -57,6 +63,16 @@ export declare function xGuide<X extends ChartX>(opts: {
|
|
|
57
63
|
/** Gradient resource id for a series' area fill; the host's `idPrefix` scopes it per chart. */
|
|
58
64
|
export declare const areaGradientId: (index: number) => string;
|
|
59
65
|
export declare function areaGradient(index: number, color: string): ChartGradient;
|
|
66
|
+
/**
|
|
67
|
+
* A series area filled by value zone: a vertical gradient whose stops sit at the zone boundaries.
|
|
68
|
+
* The engine writes `<linearGradient>` in the default `objectBoundingBox` units, so offsets are
|
|
69
|
+
* fractions of the AREA's own box, not of the plot: from the larger of the series' maximum and 0 down
|
|
70
|
+
* to the smaller of its minimum and 0, the baseline the area closes to even when the y domain
|
|
71
|
+
* excludes 0. A boundary at value `v` sits at `(ceiling - v) / (ceiling - floor)`. Hard edges:
|
|
72
|
+
* neighbouring zones meet at one offset; overlapping zones never run backwards. `null` when no zone
|
|
73
|
+
* reaches the area (the caller keeps the plain series-colour fade). Linear axes only.
|
|
74
|
+
*/
|
|
75
|
+
export declare function zoneAreaGradient(index: number, zones: readonly ZoneSpec[], values: readonly (number | null)[]): ChartGradient | null;
|
|
60
76
|
export declare function compileCartesian<T, X extends ChartX>(input: CartesianInput<T, X>): CartesianDefinition;
|
|
61
77
|
export {};
|
|
62
78
|
//# sourceMappingURL=compile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/charts/compile.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAEV,aAAa,EAEb,yBAAyB,EAEzB,UAAU,EACV,yBAAyB,EAE1B,MAAM,6BAA6B,CAAA;AAGpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EAEnB,WAAW,EAEX,MAAM,
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/charts/compile.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAEV,aAAa,EAEb,yBAAyB,EAEzB,UAAU,EACV,yBAAyB,EAE1B,MAAM,6BAA6B,CAAA;AAGpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EAEnB,WAAW,EAEX,MAAM,EAEN,QAAQ,EACT,MAAM,SAAS,CAAA;AAEhB;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;AAE/F,gGAAgG;AAChG,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,IAAI,CACpD,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EACvB,MAAM,GACN,GAAG,GACH,QAAQ,GACR,OAAO,GACP,GAAG,GACH,IAAI,GACJ,QAAQ,GACR,SAAS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,CAAC,EAAE,CAAC,SAAS,MAAM,EAClD,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,mBAAmB,CAwDrB"}
|
package/dist/charts/compile.js
CHANGED
|
@@ -86,6 +86,10 @@ function xTickPolicy(model, xTicks) {
|
|
|
86
86
|
};
|
|
87
87
|
return { count: xTicks };
|
|
88
88
|
}
|
|
89
|
+
function strideTicks(values, cls) {
|
|
90
|
+
const stride = Math.max(1, Math.ceil(values.length / LADDER[cls].xTicks));
|
|
91
|
+
return values.filter((_, i) => i % stride === 0);
|
|
92
|
+
}
|
|
89
93
|
function xGuide(opts) {
|
|
90
94
|
const { model, xTicks, format, cls } = opts;
|
|
91
95
|
const ladder = LADDER[cls];
|
|
@@ -120,6 +124,54 @@ function areaGradient(index, color) {
|
|
|
120
124
|
]
|
|
121
125
|
};
|
|
122
126
|
}
|
|
127
|
+
const areaTint = (color) => `color-mix(in srgb, ${color} var(--vx-area-top), transparent)`;
|
|
128
|
+
function zoneAreaGradient(index, zones, values) {
|
|
129
|
+
let floor = 0;
|
|
130
|
+
let ceiling = 0;
|
|
131
|
+
for (const v of values) {
|
|
132
|
+
if (v === null || !Number.isFinite(v)) continue;
|
|
133
|
+
if (v < floor) floor = v;
|
|
134
|
+
if (v > ceiling) ceiling = v;
|
|
135
|
+
}
|
|
136
|
+
const span = ceiling - floor;
|
|
137
|
+
if (span <= 0) return null;
|
|
138
|
+
const offsetOf = (v) => (ceiling - Math.min(ceiling, Math.max(floor, v))) / span;
|
|
139
|
+
const reaching = zones.filter((z) => !Number.isNaN(z.from) && !Number.isNaN(z.to) && z.to > floor && z.from < ceiling).toSorted((p, q) => q.to - p.to);
|
|
140
|
+
let previous = 0;
|
|
141
|
+
const stops = reaching.flatMap(
|
|
142
|
+
(z) => [offsetOf(z.to), offsetOf(z.from)].map((raw) => {
|
|
143
|
+
previous = Math.max(previous, raw);
|
|
144
|
+
return { offset: previous, color: areaTint(z.fill) };
|
|
145
|
+
})
|
|
146
|
+
);
|
|
147
|
+
if (stops.length === 0) return null;
|
|
148
|
+
return { id: areaGradientId(index), x1: 0, y1: 0, x2: 0, y2: 1, stops };
|
|
149
|
+
}
|
|
150
|
+
let warnedLogZones = false;
|
|
151
|
+
function guardLogZones(onLog) {
|
|
152
|
+
if (!onLog) return false;
|
|
153
|
+
const message = "area: 'zones' cannot use a log axis; use area: true";
|
|
154
|
+
if (process.env.NODE_ENV !== "production") throw new Error(message);
|
|
155
|
+
if (!warnedLogZones) console.error(message);
|
|
156
|
+
warnedLogZones = true;
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
function seriesAreaGradient(s, index, input, axes) {
|
|
160
|
+
const plain = areaGradient(
|
|
161
|
+
index,
|
|
162
|
+
typeof s.area === "string" && s.area !== "zones" ? s.area : s.color
|
|
163
|
+
);
|
|
164
|
+
if (s.area !== "zones") return plain;
|
|
165
|
+
const side = axes.onRight(s) ? "right" : "left";
|
|
166
|
+
const axisConfig = side === "right" ? input.y2 : input.y;
|
|
167
|
+
if (guardLogZones(axisConfig?.scale === "log")) return plain;
|
|
168
|
+
const zones = (input.zones ?? []).filter((z) => axes.scaleId(z.axisSide) === axes.scaleId(side));
|
|
169
|
+
return zoneAreaGradient(
|
|
170
|
+
index,
|
|
171
|
+
zones,
|
|
172
|
+
input.data.map((d) => s.getValue(d))
|
|
173
|
+
) ?? plain;
|
|
174
|
+
}
|
|
123
175
|
const isBar = (s) => s.mark === "bar";
|
|
124
176
|
const STACK_POSITIVE_KEY = "__stack+";
|
|
125
177
|
const STACK_NEGATIVE_KEY = "__stack-";
|
|
@@ -333,7 +385,7 @@ function compileCartesian(input) {
|
|
|
333
385
|
const rows = rowsOf(input, visibleKeys);
|
|
334
386
|
const formatX = (v) => input.formatX ? input.formatX(v) : defaultFormatX(v);
|
|
335
387
|
const gradients = input.series.flatMap(
|
|
336
|
-
(s, i) => s.area ? [
|
|
388
|
+
(s, i) => s.area ? [seriesAreaGradient(s, i, input, axes)] : []
|
|
337
389
|
);
|
|
338
390
|
return {
|
|
339
391
|
chart: ({ width, height }) => {
|
|
@@ -378,9 +430,11 @@ export {
|
|
|
378
430
|
dateTicks,
|
|
379
431
|
defaultFormatX,
|
|
380
432
|
defaultNumberFormat,
|
|
433
|
+
strideTicks,
|
|
381
434
|
utcAxisDate,
|
|
382
435
|
utcHeaderDate,
|
|
383
436
|
visibleSeries,
|
|
384
437
|
xGuide,
|
|
385
|
-
yGuide
|
|
438
|
+
yGuide,
|
|
439
|
+
zoneAreaGradient
|
|
386
440
|
};
|
package/dist/charts/index.d.ts
CHANGED
|
@@ -17,5 +17,6 @@ export { DualPanel, type DualPanelProps, type DualPanelLine, type DualPanelBar }
|
|
|
17
17
|
export { MirroredBars, type MirroredBarsProps, type MirroredBarsSeries, type MirroredBarPane, } from './MirroredBars.js';
|
|
18
18
|
export { ChartCard, type ChartCardProps, type ChartCardSlot } from './ChartCard.js';
|
|
19
19
|
export { chartCursor } from './cursor.js';
|
|
20
|
+
export { chartCurve, type CurveName } from './curves.js';
|
|
20
21
|
export type { AxisConfig, CartesianChartProps, ChartLegendConfig, ChartMarks, ChartSeries, ChartState, ChartTooltipConfig, ChartTooltipRow, ChartX, CursorResolution, PlotContext, RefLine, ResponsiveChartHeight, Threshold, XZoneSpec, ZoneSpec, } from './types.js';
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/charts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,KAAK,gBA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KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AACxF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,QAAQ,GACd,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AACnG,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AACrD,YAAY,EACV,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,SAAS,EACT,SAAS,EACT,QAAQ,GACT,MAAM,SAAS,CAAA"}
|
package/dist/charts/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from "./MirroredBars.js";
|
|
15
15
|
import { ChartCard } from "./ChartCard.js";
|
|
16
16
|
import { chartCursor } from "./cursor.js";
|
|
17
|
+
import { chartCurve } from "./curves.js";
|
|
17
18
|
export {
|
|
18
19
|
BandStrip,
|
|
19
20
|
Bars,
|
|
@@ -26,5 +27,6 @@ export {
|
|
|
26
27
|
MirroredBars,
|
|
27
28
|
Sparkline,
|
|
28
29
|
StackedArea,
|
|
29
|
-
chartCursor
|
|
30
|
+
chartCursor,
|
|
31
|
+
chartCurve
|
|
30
32
|
};
|
package/dist/charts/state.d.ts
CHANGED
|
@@ -13,5 +13,8 @@ export declare function ChartPlaceholder(props: {
|
|
|
13
13
|
state: ChartState | undefined;
|
|
14
14
|
height?: ChartBoxHeight;
|
|
15
15
|
action?: ReactNode;
|
|
16
|
+
/** For a box too small to hold a sentence (a sparkline): error and empty show a `—` and carry the
|
|
17
|
+
* label as the accessible name and the hover title. */
|
|
18
|
+
compact?: boolean;
|
|
16
19
|
}): ReactElement | null;
|
|
17
20
|
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/charts/state.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAInE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;AAErE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,kBAAkB,CAMnF;AAsBD;8EAC8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,KAAK,EAAE,UAAU,GAAG,SAAS,CAAA;IAC7B,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,MAAM,CAAC,EAAE,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/charts/state.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAInE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;AAErE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,kBAAkB,CAMnF;AAsBD;8EAC8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,KAAK,EAAE,UAAU,GAAG,SAAS,CAAA;IAC7B,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB;2DACuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG,YAAY,GAAG,IAAI,CAyCtB"}
|
package/dist/charts/state.js
CHANGED
|
@@ -35,16 +35,27 @@ function ChartPlaceholder(props) {
|
|
|
35
35
|
/* @__PURE__ */ jsx("output", { "aria-label": "Loading chart", "aria-busy": "true", className: stateClass, style })
|
|
36
36
|
);
|
|
37
37
|
const label = kind === "error" ? toErrorMessage(props.state?.error, "The chart failed to load.") : emptyLabel(props.state);
|
|
38
|
-
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
|
+
const body = props.compact ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2014" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
39
|
/* @__PURE__ */ jsx("span", { children: label }),
|
|
40
40
|
props.action
|
|
41
41
|
] });
|
|
42
|
+
const name = props.compact ? { "aria-label": label, title: label } : {};
|
|
42
43
|
if (kind === "error")
|
|
43
44
|
return fit(
|
|
44
|
-
/* @__PURE__ */ jsx(
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
role: "alert",
|
|
49
|
+
"data-basalt-chart-state": kind,
|
|
50
|
+
className: stateClass,
|
|
51
|
+
style,
|
|
52
|
+
...name,
|
|
53
|
+
children: body
|
|
54
|
+
}
|
|
55
|
+
)
|
|
45
56
|
);
|
|
46
57
|
return fit(
|
|
47
|
-
/* @__PURE__ */ jsx("output", { "data-basalt-chart-state": kind, className: stateClass, style, children: body })
|
|
58
|
+
/* @__PURE__ */ jsx("output", { "data-basalt-chart-state": kind, className: stateClass, style, ...name, children: body })
|
|
48
59
|
);
|
|
49
60
|
}
|
|
50
61
|
export {
|
package/dist/charts/types.d.ts
CHANGED
|
@@ -22,40 +22,42 @@ export type ChartSeries<T> = {
|
|
|
22
22
|
* series whose `getValue` is always `null` is a legend-only entry (a zone or reference key). */
|
|
23
23
|
getValue: (d: T) => number | null;
|
|
24
24
|
/** The legend swatch shape. Default: the kind's own mark (`line` in `Lines`, `bar` in `Bars`). */
|
|
25
|
-
mark?: 'line' | 'bar' | 'area';
|
|
25
|
+
mark?: 'line' | 'bar' | 'area' | undefined;
|
|
26
26
|
/** Default `'solid'`; `'dashed'` is `VX.dashArray` on the line, the legend and the tooltip. */
|
|
27
|
-
dash?: 'solid' | 'dashed';
|
|
27
|
+
dash?: 'solid' | 'dashed' | undefined;
|
|
28
28
|
/** Interpolation between points. Default `'monotone'`. A piecewise-constant quantity (a price
|
|
29
29
|
* tier, a config value) is a step: a smoothed curve draws values that never existed. */
|
|
30
|
-
curve?: CurveName;
|
|
31
|
-
strokeWidth?: number;
|
|
30
|
+
curve?: CurveName | undefined;
|
|
31
|
+
strokeWidth?: number | undefined;
|
|
32
32
|
/** Dims the plotted stroke (a faint companion line). Strokes only. */
|
|
33
|
-
strokeOpacity?: number;
|
|
33
|
+
strokeOpacity?: number | undefined;
|
|
34
34
|
/** Bars and areas. */
|
|
35
|
-
fillOpacity?: number;
|
|
36
|
-
/** `Lines`: a soft gradient fill under the line — `true` in the series color,
|
|
37
|
-
|
|
35
|
+
fillOpacity?: number | undefined;
|
|
36
|
+
/** `Lines`: a soft gradient fill under the line — `true` in the series color, a color ref, or
|
|
37
|
+
* `'zones'`: a vertical gradient coloured by the chart's `zones` on this series' axis, hard stops
|
|
38
|
+
* at the zone boundaries (no zone in reach: the series color). Linear axes only. */
|
|
39
|
+
area?: boolean | 'zones' | (string & {}) | undefined;
|
|
38
40
|
/** Which y axis the series is measured against. `'right'` needs the chart's `y2`. */
|
|
39
|
-
axis?: 'left' | 'right';
|
|
41
|
+
axis?: 'left' | 'right' | undefined;
|
|
40
42
|
/** Legend grouping: series → overlay → reference. Default `'series'`. */
|
|
41
|
-
role?: 'series' | 'overlay' | 'reference';
|
|
43
|
+
role?: 'series' | 'overlay' | 'reference' | undefined;
|
|
42
44
|
/** `false` keeps it out of the legend (a companion line folded under `parent`). Default `true`. */
|
|
43
|
-
legend?: boolean;
|
|
45
|
+
legend?: boolean | undefined;
|
|
44
46
|
/** `false` draws and legends it but never lists it as a tooltip row. Default `true`. */
|
|
45
|
-
tooltip?: boolean;
|
|
47
|
+
tooltip?: boolean | undefined;
|
|
46
48
|
/** A companion (an MA line) names its parent, so a legend toggle and hover keep the pair. */
|
|
47
|
-
parent?: string;
|
|
49
|
+
parent?: string | undefined;
|
|
48
50
|
/** A short qualifier after the label in the legend and the tooltip row, in muted text. */
|
|
49
|
-
note?: string;
|
|
51
|
+
note?: string | undefined;
|
|
50
52
|
/** Per-series tooltip value format; receives the datum so a row can read more than the value. */
|
|
51
|
-
formatValue?: (v: number, d: T) => string;
|
|
53
|
+
formatValue?: ((v: number, d: T) => string) | undefined;
|
|
52
54
|
/** A marker at a point (a PR star, a status dot); `null` for none. */
|
|
53
|
-
getMarker?: (d: T) => {
|
|
54
|
-
color?: string;
|
|
55
|
-
r?: number;
|
|
56
|
-
fillOpacity?: number;
|
|
57
|
-
ring?: boolean;
|
|
58
|
-
} | null;
|
|
55
|
+
getMarker?: ((d: T) => {
|
|
56
|
+
color?: string | undefined;
|
|
57
|
+
r?: number | undefined;
|
|
58
|
+
fillOpacity?: number | undefined;
|
|
59
|
+
ring?: boolean | undefined;
|
|
60
|
+
} | null) | undefined;
|
|
59
61
|
};
|
|
60
62
|
/** One y axis. */
|
|
61
63
|
export type AxisConfig<T> = {
|
|
@@ -64,31 +66,31 @@ export type AxisConfig<T> = {
|
|
|
64
66
|
* reference-line bounds; a tuple fixes it; a function computes it from the data and the visible
|
|
65
67
|
* series (so a legend toggle can shrink a stacked domain).
|
|
66
68
|
*/
|
|
67
|
-
domain?: readonly [number, number] | 'auto' | ((data: readonly T[], visible: readonly ChartSeries<T>[]) => readonly [number, number]);
|
|
69
|
+
domain?: readonly [number, number] | 'auto' | ((data: readonly T[], visible: readonly ChartSeries<T>[]) => readonly [number, number]) | undefined;
|
|
68
70
|
/** When `'auto'`: the raw upper bound is at least this; padding applies after. */
|
|
69
|
-
autoMaxFloor?: number;
|
|
71
|
+
autoMaxFloor?: number | undefined;
|
|
70
72
|
/** When `'auto'`: the lower bound is at most this. Default `0` (a zero baseline); `Infinity` pads
|
|
71
73
|
* down from the data minimum instead. Ignored on a log axis. */
|
|
72
|
-
autoMinCeil?: number;
|
|
74
|
+
autoMinCeil?: number | undefined;
|
|
73
75
|
/** When `'auto'`: padding multiplier away from the data. Default `1.1`. */
|
|
74
|
-
autoPad?: number;
|
|
76
|
+
autoPad?: number | undefined;
|
|
75
77
|
/** A tick count, or the exact tick values. Default: one per ~48px of plot height, ≤ 5. */
|
|
76
|
-
ticks?: number | readonly number[];
|
|
78
|
+
ticks?: number | readonly number[] | undefined;
|
|
77
79
|
/** Tick and tooltip formatter. Default: compact numbers (`12.5k`). */
|
|
78
|
-
format?: (v: number) => string;
|
|
80
|
+
format?: ((v: number) => string) | undefined;
|
|
79
81
|
/** Horizontal grid rules. Default: on for `y`, off for `y2`. */
|
|
80
|
-
grid?: boolean;
|
|
82
|
+
grid?: boolean | undefined;
|
|
81
83
|
/** Round the domain outward to nice ticks. Default `false` (a fixed domain stays fixed). */
|
|
82
|
-
nice?: boolean;
|
|
84
|
+
nice?: boolean | undefined;
|
|
83
85
|
/** Default `'linear'`. A log axis floors at the smallest positive visible value. */
|
|
84
|
-
scale?: 'linear' | 'log';
|
|
86
|
+
scale?: 'linear' | 'log' | undefined;
|
|
85
87
|
};
|
|
86
88
|
/** A horizontal band on one y axis. `±Infinity` reaches the plot edge. */
|
|
87
89
|
export type ZoneSpec = {
|
|
88
90
|
from: number;
|
|
89
91
|
to: number;
|
|
90
92
|
fill: string;
|
|
91
|
-
axisSide?: 'left' | 'right';
|
|
93
|
+
axisSide?: 'left' | 'right' | undefined;
|
|
92
94
|
};
|
|
93
95
|
/**
|
|
94
96
|
* A vertical band between two x values. An omitted bound is the plot's own edge. `'edge'` widens a
|
|
@@ -96,17 +98,17 @@ export type ZoneSpec = {
|
|
|
96
98
|
* from one hour to another, both hours included).
|
|
97
99
|
*/
|
|
98
100
|
export type XZoneSpec<X extends ChartX = ChartX> = {
|
|
99
|
-
from?: X;
|
|
100
|
-
to?: X;
|
|
101
|
+
from?: X | undefined;
|
|
102
|
+
to?: X | undefined;
|
|
101
103
|
fill: string;
|
|
102
|
-
align?: 'center' | 'edge';
|
|
104
|
+
align?: 'center' | 'edge' | undefined;
|
|
103
105
|
};
|
|
104
106
|
/** A horizontal reference line — annotation only, no domain role beyond staying inside the plot. */
|
|
105
107
|
export type RefLine = {
|
|
106
108
|
value: number;
|
|
107
109
|
color: string;
|
|
108
|
-
dashed?: boolean;
|
|
109
|
-
axis?: 'left' | 'right';
|
|
110
|
+
dashed?: boolean | undefined;
|
|
111
|
+
axis?: 'left' | 'right' | undefined;
|
|
110
112
|
};
|
|
111
113
|
/** A fill between the line and a value, on one side of it, tracking the line. */
|
|
112
114
|
export type Threshold = {
|
|
@@ -126,40 +128,41 @@ export type ChartTooltipRow = {
|
|
|
126
128
|
export type ChartTooltipConfig<T, X extends ChartX = ChartX> = {
|
|
127
129
|
/** The tooltip title. Default: the x value through `formatX`'s long form (a date reads
|
|
128
130
|
* `Mon Sep 1 2026`). */
|
|
129
|
-
formatHeader?: (x: X, d: T) => string;
|
|
131
|
+
formatHeader?: ((x: X, d: T) => string) | undefined;
|
|
130
132
|
/** Rows after the per-series rows (a total, a zone badge, a context line). `visible`/`hidden` are
|
|
131
133
|
* the legend's split, so a row never names a series the plot no longer draws. */
|
|
132
|
-
rows?: (d: T, ctx: {
|
|
134
|
+
rows?: ((d: T, ctx: {
|
|
133
135
|
visible: readonly ChartSeries<T>[];
|
|
134
136
|
hidden: readonly ChartSeries<T>[];
|
|
135
|
-
}) => readonly ChartTooltipRow[];
|
|
137
|
+
}) => readonly ChartTooltipRow[]) | undefined;
|
|
136
138
|
/** Show this chart's tooltip while it FOLLOWS a sibling's cursor. Default `false`: only the chart
|
|
137
139
|
* under the pointer or keyboard focus shows a tooltip and a live region. */
|
|
138
|
-
onFollow?: boolean;
|
|
140
|
+
onFollow?: boolean | undefined;
|
|
139
141
|
};
|
|
140
142
|
export type ChartLegendConfig = {
|
|
141
143
|
/** Default `'bottom'`. `'header'` draws the legend at the top of the chart body, spaced as the
|
|
142
144
|
* enclosing `ChartCard`'s header legend row (in the chart's own markup, so it is in the server
|
|
143
145
|
* HTML and the header never grows); outside a card it is `'top'`. */
|
|
144
|
-
placement?: 'top' | 'bottom' | 'header';
|
|
146
|
+
placement?: 'top' | 'bottom' | 'header' | undefined;
|
|
145
147
|
/** Visually separate roles: series | overlay | reference. */
|
|
146
|
-
groups?: boolean;
|
|
148
|
+
groups?: boolean | undefined;
|
|
147
149
|
/** Clicking an entry hides that series. Default: on whenever there are two or more entries. */
|
|
148
|
-
toggle?: boolean;
|
|
150
|
+
toggle?: boolean | undefined;
|
|
149
151
|
};
|
|
150
152
|
/** A height per container class, `base` below `regular`. A plain number is fixed. */
|
|
151
153
|
export type ResponsiveChartHeight = {
|
|
152
154
|
base: number;
|
|
153
|
-
regular?: number;
|
|
154
|
-
wide?: number;
|
|
155
|
+
regular?: number | undefined;
|
|
156
|
+
wide?: number | undefined;
|
|
155
157
|
};
|
|
156
158
|
/** The three "nothing to draw" states, pending → error → empty. */
|
|
157
159
|
export type ChartState = {
|
|
158
|
-
pending?: boolean;
|
|
160
|
+
pending?: boolean | undefined;
|
|
159
161
|
/** Truthy = the query failed; an `Error`'s message is the label. */
|
|
160
162
|
error?: unknown;
|
|
161
|
-
/** `true`, or the empty label itself.
|
|
162
|
-
|
|
163
|
+
/** `true`, or the empty label itself. The label is the one way to say WHY (`'No runs match the
|
|
164
|
+
* filter'` vs `'No runs yet'`): § 9 fixes the state shape, so there is no reason field. */
|
|
165
|
+
empty?: boolean | string | undefined;
|
|
163
166
|
};
|
|
164
167
|
/** A row of `plot.rows(key)`: one per datum, `y: null` kept as a gap. */
|
|
165
168
|
export type PlotRow<T, X extends ChartX = ChartX> = {
|
|
@@ -199,27 +202,27 @@ export type CartesianChartProps<T, X extends ChartX = ChartX> = BasaltProps & {
|
|
|
199
202
|
series: readonly ChartSeries<T>[];
|
|
200
203
|
/** The plot's marks. Draw `plot.rows(key)` / `plot.visible`, never `series` directly. */
|
|
201
204
|
marks: (plot: PlotContext<T, X>) => ChartMarks;
|
|
202
|
-
y?: AxisConfig<T
|
|
205
|
+
y?: AxisConfig<T> | undefined;
|
|
203
206
|
/** A right axis; series with `axis: 'right'` and marks bound to `plot.y2` read it. */
|
|
204
|
-
y2?: AxisConfig<T
|
|
207
|
+
y2?: AxisConfig<T> | undefined;
|
|
205
208
|
/** A tick count, or the exact x tick values. Default: by container class. */
|
|
206
|
-
xTicks?: number | readonly X[];
|
|
209
|
+
xTicks?: number | readonly X[] | undefined;
|
|
207
210
|
/** Tick label for an x value. Default: `DD.MM` for dates, compact numbers, strings verbatim. */
|
|
208
|
-
formatX?: (x: X) => string;
|
|
209
|
-
zones?: readonly ZoneSpec[];
|
|
210
|
-
xZones?: readonly XZoneSpec<X>[];
|
|
211
|
-
refLines?: readonly RefLine[];
|
|
211
|
+
formatX?: ((x: X) => string) | undefined;
|
|
212
|
+
zones?: readonly ZoneSpec[] | undefined;
|
|
213
|
+
xZones?: readonly XZoneSpec<X>[] | undefined;
|
|
214
|
+
refLines?: readonly RefLine[] | undefined;
|
|
212
215
|
/** `false` hides the legend. */
|
|
213
|
-
legend?: ChartLegendConfig | false;
|
|
216
|
+
legend?: ChartLegendConfig | false | undefined;
|
|
214
217
|
/** Default: the height law (measured width × class ratio, 160–420px, ≤ 45vh on touch). */
|
|
215
|
-
height?: number | ResponsiveChartHeight;
|
|
216
|
-
state?: ChartState;
|
|
218
|
+
height?: number | ResponsiveChartHeight | undefined;
|
|
219
|
+
state?: ChartState | undefined;
|
|
217
220
|
/** Joins a named cursor group instead of the page-shared default. */
|
|
218
|
-
cursorGroup?: string;
|
|
221
|
+
cursorGroup?: string | undefined;
|
|
219
222
|
/** Default `'nearest'`. `'leading'` for a series keyed by a bucket's leading edge (a weekly
|
|
220
223
|
* value keyed by its Monday). */
|
|
221
|
-
cursorResolution?: CursorResolution;
|
|
222
|
-
tooltip?: ChartTooltipConfig<T, X> | false;
|
|
224
|
+
cursorResolution?: CursorResolution | undefined;
|
|
225
|
+
tooltip?: ChartTooltipConfig<T, X> | false | undefined;
|
|
223
226
|
};
|
|
224
227
|
/** The x channel of a `plot.rows()` row, as an accessor (a field name does not type-check against a
|
|
225
228
|
* generic `X`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/charts/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAE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AS,CAAA;IACxC,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,CAAA;IACvC,MAAM,CAAC,EAAE,SAAS,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,CAAA;IAC5C,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,SAAS,CAAA;IACzC,gCAAgC;IAChC,MAAM,CAAC,EAAE,iBAAiB,GAAG,KAAK,GAAG,SAAS,CAAA;IAC9C,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAAA;IACnD,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IAC9B,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC;qCACiC;IACjC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;IAC/C,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,GAAG,SAAS,CAAA;CACvD,CAAA;AAED;mBACmB;AACnB,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,CAAU,CAAA"}
|
package/dist/cli/doctor.js
CHANGED
|
@@ -266,7 +266,7 @@ basalt-ui doctor \u2014 ${cwd}
|
|
|
266
266
|
],
|
|
267
267
|
[
|
|
268
268
|
"dropped-subpaths: no import of a basalt-ui subpath the install lacks",
|
|
269
|
-
droppedSubpathsCheck(
|
|
269
|
+
droppedSubpathsCheck(appDir, cfg, install)
|
|
270
270
|
],
|
|
271
271
|
[
|
|
272
272
|
"app-wiring: the entry mounts BasaltProvider and the router tree is generated",
|
|
@@ -275,7 +275,7 @@ basalt-ui doctor \u2014 ${cwd}
|
|
|
275
275
|
["exact-peers: installed exact-pinned peers match basalt-ui", exactPeersCheck(cwd, install)],
|
|
276
276
|
[
|
|
277
277
|
"subpath-peers: every imported basalt-ui subpath has its required peers installed",
|
|
278
|
-
subpathPeersCheck(
|
|
278
|
+
subpathPeersCheck(appDir, cfg, install)
|
|
279
279
|
],
|
|
280
280
|
[
|
|
281
281
|
"config-keys: the basalt config block sets only keys basalt-ui reads",
|
|
@@ -1,7 +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 { StatCard, type StatCardBreakdownRow, type StatCardTone } from './stat-card.js';
|
|
4
|
+
export { StatCard, type StatCardBreakdownRow, type StatCardSparklineSize, type StatCardTone, } from './stat-card.js';
|
|
5
5
|
export { StatGroup } from './stat-group.js';
|
|
6
6
|
export { EmptyState } from './empty-state.js';
|
|
7
7
|
export { SettingsSection, SettingsRow, DangerZone } from './settings-section.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,
|
|
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,EACL,QAAQ,EACR,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,GAClB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/dashboard/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
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 {
|
|
4
|
+
import {
|
|
5
|
+
StatCard
|
|
6
|
+
} from "./stat-card.js";
|
|
5
7
|
import { StatGroup } from "./stat-group.js";
|
|
6
8
|
import { EmptyState } from "./empty-state.js";
|
|
7
9
|
import { SettingsSection, SettingsRow, DangerZone } from "./settings-section.js";
|