basalt-ui 2.21.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/MIGRATING.md +452 -12
- package/agent/agents/basalt-design-reviewer.md +1 -1
- package/agent/rules/basalt-tokens.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +1 -1
- package/agent/skills/basalt-design/references/anti-defaults.md +1 -1
- package/agent/skills/basalt-design/references/catalogue.md +1 -0
- package/dist/charts/BandStrip.d.ts.map +1 -1
- package/dist/charts/BandStrip.js +73 -3
- package/dist/charts/Bars.d.ts.map +1 -1
- package/dist/charts/Bars.js +6 -0
- package/dist/charts/CartesianChart.d.ts +10 -0
- package/dist/charts/CartesianChart.d.ts.map +1 -1
- package/dist/charts/CartesianChart.js +8 -5
- package/dist/charts/ChartCard.d.ts +12 -3
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +39 -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 +14 -2
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +101 -22
- 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 +38 -1
- package/dist/charts/band-fold.d.ts.map +1 -1
- package/dist/charts/band-fold.js +18 -1
- package/dist/charts/chart-box.module.css +19 -0
- package/dist/charts/chart-card.module.css +25 -0
- 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 +7 -0
- package/dist/charts/compile.d.ts +25 -6
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +152 -72
- 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 +21 -6
- package/dist/charts/labels.d.ts.map +1 -1
- package/dist/charts/labels.js +52 -17
- 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 +43 -0
- package/dist/charts/ref-label.d.ts.map +1 -0
- package/dist/charts/ref-label.js +75 -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 +13 -17
- package/dist/charts/sparkline.module.css.d.ts +1 -2
- package/dist/charts/state.d.ts +2 -0
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +5 -2
- package/dist/charts/types.d.ts +18 -8
- package/dist/charts/types.d.ts.map +1 -1
- 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/init.d.ts +2 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +68 -4
- 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 +202 -36
- package/dist/cli/shot/detect.d.ts.map +1 -1
- package/dist/cli/shot/detect.js +17 -1
- package/dist/cli/shot/playwright.d.ts +13 -2
- 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 +4 -0
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/shot/types.js +2 -0
- 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/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 +6 -1
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +15 -8
- package/dist/dashboard/bar-list.module.css +83 -0
- package/dist/dashboard/bar-list.module.css.d.ts +1 -0
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +2 -2
- 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 +84 -5
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +100 -15
- package/dist/dashboard/meter-parts.d.ts +9 -1
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +276 -74
- package/dist/dashboard/meter.d.ts +54 -65
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +21 -4
- package/dist/dashboard/meter.module.css +76 -0
- package/dist/dashboard/meter.module.css.d.ts +6 -0
- 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.map +1 -1
- package/dist/dashboard/query-state.js +1 -1
- 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 -5
- package/dist/dashboard/stat-card.module.css +36 -0
- package/dist/dashboard/stat-group.module.css +7 -0
- package/dist/dashboard/stat-strip.d.ts +22 -6
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +104 -60
- package/dist/dashboard/stat-strip.module.css +122 -53
- package/dist/dashboard/stat-strip.module.css.d.ts +4 -0
- package/dist/dashboard/visual-slot.d.ts +7 -1
- package/dist/dashboard/visual-slot.d.ts.map +1 -1
- package/dist/dashboard/visual-slot.js +3 -1
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +0 -5
- 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 +43 -4
- 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 +37 -0
- package/dist/theme/controls.module.css.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +18 -27
- package/dist/theme/status-verdict.d.ts.map +1 -1
- package/dist/theme/status-verdict.js +9 -1
- 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/palette.d.ts +11 -10
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +11 -10
- package/dist/tokens/status-text.d.ts.map +1 -1
- package/dist/tokens/status-text.js +3 -1
- package/llms.txt +42 -22
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +83 -3
- package/src/charts/Bars.tsx +7 -0
- package/src/charts/CartesianChart.tsx +18 -3
- package/src/charts/ChartCard.tsx +54 -13
- 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 +135 -25
- package/src/charts/StackedArea.tsx +14 -4
- package/src/charts/band-fold.ts +50 -1
- package/src/charts/chart-box.module.css +19 -0
- package/src/charts/chart-card.module.css +25 -0
- package/src/charts/chart-dates.ts +30 -0
- package/src/charts/chart-legend.module.css +7 -0
- package/src/charts/compile.ts +253 -87
- package/src/charts/date-tick-format.ts +10 -13
- package/src/charts/labels.ts +81 -26
- 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 +131 -0
- package/src/charts/scales.ts +22 -2
- package/src/charts/sparkline.module.css +13 -17
- package/src/charts/sparkline.module.css.d.ts +1 -2
- package/src/charts/state.tsx +9 -4
- package/src/charts/types.ts +18 -8
- package/src/cli/doctor-upgrade.ts +1 -1
- package/src/cli/init.ts +100 -3
- package/src/cli/shot/capture.ts +266 -35
- package/src/cli/shot/detect.ts +18 -1
- package/src/cli/shot/playwright.ts +20 -4
- package/src/cli/shot/types.ts +5 -0
- package/src/cli/tokens-css.ts +18 -20
- 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 +83 -0
- package/src/dashboard/bar-list.module.css.d.ts +1 -0
- package/src/dashboard/bar-list.tsx +107 -69
- package/src/dashboard/delta-badge.tsx +6 -2
- package/src/dashboard/index.ts +1 -0
- package/src/dashboard/meter-model.ts +207 -24
- package/src/dashboard/meter-parts.tsx +349 -67
- package/src/dashboard/meter.module.css +76 -0
- package/src/dashboard/meter.module.css.d.ts +6 -0
- package/src/dashboard/meter.tsx +72 -18
- 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 +1 -1
- 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 +36 -0
- package/src/dashboard/stat-card.tsx +12 -6
- package/src/dashboard/stat-group.module.css +7 -0
- package/src/dashboard/stat-strip.module.css +122 -53
- package/src/dashboard/stat-strip.module.css.d.ts +4 -0
- package/src/dashboard/stat-strip.tsx +176 -91
- package/src/dashboard/visual-slot.ts +12 -3
- package/src/guard/index.ts +0 -5
- package/src/guard/vx-names.ts +2 -0
- package/src/index.ts +2 -0
- package/src/styles.css +43 -4
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +200 -68
- package/src/theme/chrome-vars.ts +77 -8
- package/src/theme/controls.module.css +37 -0
- package/src/theme/controls.module.css.d.ts +2 -0
- package/src/theme/index.ts +22 -32
- package/src/theme/status-verdict.tsx +5 -1
- package/src/tokens/core.ts +4 -1
- package/src/tokens/derive.ts +32 -3
- package/src/tokens/palette.ts +11 -10
- package/src/tokens/status-text.ts +2 -0
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, the nested-radius lint
|
|
190
|
+
* step, 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
|
/**
|
|
@@ -1087,6 +1084,8 @@ declare function buildPaletteDataUncached(config: DeriveConfig): {
|
|
|
1087
1084
|
readonly bg: ColorPair;
|
|
1088
1085
|
readonly panel: ColorPair;
|
|
1089
1086
|
readonly panelHover: ColorPair;
|
|
1087
|
+
readonly rowHover: ColorPair;
|
|
1088
|
+
readonly rowSelected: ColorPair;
|
|
1090
1089
|
readonly elevated: ColorPair;
|
|
1091
1090
|
readonly border: ColorPair;
|
|
1092
1091
|
readonly hairline: ColorPair;
|
|
@@ -1294,6 +1293,8 @@ export declare const SURFACE: {
|
|
|
1294
1293
|
readonly bg: ColorPair;
|
|
1295
1294
|
readonly panel: ColorPair;
|
|
1296
1295
|
readonly panelHover: ColorPair;
|
|
1296
|
+
readonly rowHover: ColorPair;
|
|
1297
|
+
readonly rowSelected: ColorPair;
|
|
1297
1298
|
readonly elevated: ColorPair;
|
|
1298
1299
|
readonly border: ColorPair;
|
|
1299
1300
|
readonly hairline: ColorPair;
|
|
@@ -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,CAAA;IACZ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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, the nested-radius lint
|
|
126
|
+
* step, 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) {
|
|
@@ -799,6 +796,10 @@ function buildPaletteDataUncached(config) {
|
|
|
799
796
|
panel: DERIVED.surface.panel,
|
|
800
797
|
// cards, controls
|
|
801
798
|
panelHover: DERIVED.surface.panelHover,
|
|
799
|
+
// Row hover / selected on a panel — the panel one ink step along (`derive.ts`), visible in both
|
|
800
|
+
// schemes where `panelHover` (lighter than `panel` in light) is not.
|
|
801
|
+
rowHover: DERIVED.surface.rowHover,
|
|
802
|
+
rowSelected: DERIVED.surface.rowSelected,
|
|
802
803
|
// Elevated surface (chart area, `--mantine-color-default-hover`) — same lift as panel-hover.
|
|
803
804
|
elevated: DERIVED.surface.elevated,
|
|
804
805
|
border: DERIVED.surface.border,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-text.d.ts","sourceRoot":"","sources":["../../src/tokens/status-text.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAGrD,KAAK,IAAI,GAAG,OAAO,GAAG,MAAM,CAAA;AAC5B,KAAK,IAAI,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MA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,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQhF;AAoBD,gEAAgE;AAChE,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,GACtC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAM9B"}
|
package/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# basalt-ui v2.
|
|
1
|
+
# basalt-ui v2.23.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.23.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
|
|
@@ -103,14 +104,17 @@ Signature: Meter(props: MeterProps): JSX.Element
|
|
|
103
104
|
loading?: boolean
|
|
104
105
|
emptyText?: string
|
|
105
106
|
shape?: "bar" | "ring"
|
|
106
|
-
target?: number
|
|
107
|
-
ticks?: readonly MeterTick[]
|
|
107
|
+
target?: number
|
|
108
|
+
ticks?: readonly MeterTick[]
|
|
108
109
|
tone?: "muted" | "ink" [with segments | zones]
|
|
109
110
|
size?: "row" [with segments | zones]
|
|
110
111
|
startCaption?: ReactNode [with segments | zones]
|
|
111
112
|
endCaption?: ReactNode [with segments | zones]
|
|
113
|
+
reading?: boolean [with segments | zones]
|
|
112
114
|
value?: number | null [with zones]
|
|
113
115
|
color?: string
|
|
116
|
+
track?: boolean
|
|
117
|
+
stops?: readonly { at: number; color: string; }[]
|
|
114
118
|
segments: readonly MeterSegment[]
|
|
115
119
|
zones: readonly MeterZone[]
|
|
116
120
|
forecastCaption?: string [with segments]
|
|
@@ -133,6 +137,14 @@ Signature: PageBar(props: PageBarProps): ReactNode
|
|
|
133
137
|
filters?: ReactNode
|
|
134
138
|
filtersEnd?: BarAction[]
|
|
135
139
|
tabs?: ReactNode
|
|
140
|
+
Signature: PageSummary(props: PageSummaryProps): JSX.Element
|
|
141
|
+
one of: loading=false | loading=true
|
|
142
|
+
className?: string
|
|
143
|
+
style?: CSSProperties
|
|
144
|
+
sentence?: ReactNode
|
|
145
|
+
facts?: readonly Fact[]
|
|
146
|
+
aside?: ReactNode
|
|
147
|
+
loading?: false | true
|
|
136
148
|
Signature: PageTitle(props: PageTitleProps): ReactNode
|
|
137
149
|
className?: string
|
|
138
150
|
style?: CSSProperties
|
|
@@ -141,21 +153,8 @@ Signature: PageTitle(props: PageTitleProps): ReactNode
|
|
|
141
153
|
subtitle?: ReactNode
|
|
142
154
|
icon?: ReactNode
|
|
143
155
|
Signature: Section(props: SectionProps): JSX.Element
|
|
144
|
-
icon?: ReactNode
|
|
145
156
|
className?: string
|
|
146
157
|
style?: CSSProperties
|
|
147
|
-
title: string
|
|
148
|
-
subtitle?: string
|
|
149
|
-
info?: string
|
|
150
|
-
value?: string
|
|
151
|
-
unit?: string
|
|
152
|
-
delta?: number
|
|
153
|
-
deltaPeriod?: string
|
|
154
|
-
deltaPolarity?: DeltaPolarity
|
|
155
|
-
deltaFormat?: (delta: number) => string
|
|
156
|
-
deltaGlyph?: boolean
|
|
157
|
-
sparkline?: ReactNode
|
|
158
|
-
count?: number
|
|
159
158
|
classNames?: Partial<Record<SectionSlot, string>>
|
|
160
159
|
actions?: SectionActions
|
|
161
160
|
query?: QueryStateLike<unknown>
|
|
@@ -169,6 +168,20 @@ Signature: Section(props: SectionProps): JSX.Element
|
|
|
169
168
|
summary?: ReactNode
|
|
170
169
|
id?: string
|
|
171
170
|
children: ReactNode
|
|
171
|
+
icon?: ReactNode [with title]
|
|
172
|
+
subtitle?: string [with title]
|
|
173
|
+
info?: string [with title]
|
|
174
|
+
value?: string [with title]
|
|
175
|
+
unit?: string [with title]
|
|
176
|
+
delta?: number [with title]
|
|
177
|
+
deltaPeriod?: string [with title]
|
|
178
|
+
deltaPolarity?: DeltaPolarity [with title]
|
|
179
|
+
deltaFormat?: (delta: number) => string [with title]
|
|
180
|
+
deltaGlyph?: boolean [with title]
|
|
181
|
+
sparkline?: ReactNode [with title]
|
|
182
|
+
count?: number [with title]
|
|
183
|
+
title: string
|
|
184
|
+
aria-label?: string
|
|
172
185
|
Signature: SettingsRow(props: SettingsRowProps): JSX.Element
|
|
173
186
|
className?: string
|
|
174
187
|
style?: CSSProperties
|
|
@@ -221,7 +234,8 @@ Signature: StatGroup(props: StatGroupProps): JSX.Element
|
|
|
221
234
|
children: ReactNode [with variant="grid"]
|
|
222
235
|
label: string [with variant="strip"]
|
|
223
236
|
cells: readonly StatStripCell[] [with variant="strip"]
|
|
224
|
-
footer?: readonly
|
|
237
|
+
footer?: readonly StatStripFooterEntry[] [with variant="strip"]
|
|
238
|
+
shotAbsent?: readonly StatStripShotState[] [with variant="strip"]
|
|
225
239
|
Signature: StatusDot(props: StatusDotProps): JSX.Element
|
|
226
240
|
className?: string
|
|
227
241
|
style?: CSSProperties
|
|
@@ -304,7 +318,7 @@ Signature: BandStrip(props: BandStripProps<T, X, K>): ReactElement<unknown, stri
|
|
|
304
318
|
cursorGroup?: string
|
|
305
319
|
cursorResolution?: CursorResolution
|
|
306
320
|
tooltip?: false | ChartTooltipConfig<T, X>
|
|
307
|
-
states: readonly (
|
|
321
|
+
states: readonly (Pick<ChartSeries<never>, "label" | "legend" | "to…
|
|
308
322
|
getBand: (d: T) => BandSpan
|
|
309
323
|
fold?: BandFold<T>
|
|
310
324
|
absentState?: K
|
|
@@ -370,6 +384,8 @@ Signature: ChartCard(props: ChartCardProps): ReactElement<unknown, string | JSXE
|
|
|
370
384
|
actions?: ReactNode
|
|
371
385
|
state?: ChartState
|
|
372
386
|
placeholderHeight?: number | ResponsiveChartHeight
|
|
387
|
+
stale?: boolean
|
|
388
|
+
stateNoun?: string
|
|
373
389
|
onRetry?: (() => void)
|
|
374
390
|
retrying?: boolean
|
|
375
391
|
stateAction?: ReactNode
|
|
@@ -450,6 +466,7 @@ Signature: Lines(props: LinesProps<T, X>): ReactElement<unknown, string | JSXEle
|
|
|
450
466
|
cursorResolution?: CursorResolution
|
|
451
467
|
tooltip?: false | ChartTooltipConfig<T, X>
|
|
452
468
|
thresholds?: [X] extends [string] ? never : readonly Threshold[]
|
|
469
|
+
naming?: "auto" | "legend" | "endLabels"
|
|
453
470
|
Signature: MirroredBars(props: MirroredBarsProps<T, X, K>): ReactElement<unknown, string | JSXElementConstructor<any>>
|
|
454
471
|
className?: string
|
|
455
472
|
style?: CSSProperties
|
|
@@ -475,15 +492,17 @@ Signature: Sparkline(props: SparklineProps): ReactElement<unknown, string | JSXE
|
|
|
475
492
|
className?: string
|
|
476
493
|
style?: CSSProperties
|
|
477
494
|
ariaLabel: string
|
|
478
|
-
data: readonly number[]
|
|
495
|
+
data: readonly number[] | readonly { at: Date | number | string; …
|
|
479
496
|
height: number
|
|
480
497
|
width?: number
|
|
481
498
|
mark?: "bar" | "line"
|
|
482
499
|
color?: string
|
|
500
|
+
tone?: "muted"
|
|
483
501
|
emphasizeLast?: boolean
|
|
484
502
|
emphasisColor?: string
|
|
485
503
|
state?: ChartState
|
|
486
504
|
reference?: number | "mean"
|
|
505
|
+
referenceLabel?: string
|
|
487
506
|
format?: ((value: number) => string)
|
|
488
507
|
labels?: readonly string[]
|
|
489
508
|
Signature: StackedArea(props: StackedAreaProps<T, X>): ReactElement<unknown, string | JSXElementConstructor<any>>
|
|
@@ -505,6 +524,7 @@ Signature: StackedArea(props: StackedAreaProps<T, X>): ReactElement<unknown, str
|
|
|
505
524
|
cursorResolution?: CursorResolution
|
|
506
525
|
tooltip?: false | ChartTooltipConfig<T, X>
|
|
507
526
|
series: readonly StackedAreaBand<T>[]
|
|
527
|
+
fillOpacity?: number
|
|
508
528
|
y?: Omit<AxisConfig<T>, "scale">
|
|
509
529
|
Signature: chartCursor(group: string): ChartCursorController<ChartValue, ChartValue>
|
|
510
530
|
Signature: chartCurve(name: CurveName): ChartCurve
|
|
@@ -521,10 +541,10 @@ Signature: CONTAINER_CLASSES: { micro: 0, compact: 240, regular: 480, wide: 800
|
|
|
521
541
|
Signature: CONTAINER_GRID_BREAKPOINTS: { xs: "240px", sm: "480px", md: "800px", lg: "800px", xl: "800px" }
|
|
522
542
|
Signature: CONTAINER_KEYS: { compact: "240px", regular: "480px", wide: "800px" }
|
|
523
543
|
Signature: VX: { full key list below }
|
|
524
|
-
lineWidth, line2Width, axisFont, dotR, dashArray, legendGap,
|
|
544
|
+
lineWidth, line2Width, axisFont, dotR, dashArray, legendGap, radiusCard, radiusCtrl, radiusPill, hit, good, goodSoft, bad, warn, goodSolid, badSolid, warnSolid, goodRef, badRef, warnRef, line, line2, axis, axisStroke, grid, crosshair, dotStroke, legendText, tooltipMuted, neutral, ink, ink2, muted, faint, accent, accentHover, accentFill, accentFillHover, onAccent, divider, shadowCard, shadowCtrl, shadowRaised, shadowOverlay, minPxPerTick, minPlotHeight, zIndexFloating
|
|
525
545
|
text: { nano, micro, xs, sm, md, lg, xl, h2, kpi, h1, display }
|
|
526
546
|
space: { controlHeightTag, controlHeightWidget, controlHeightCtl, pageBarRowHeight, sectionHeaderHeight, widgetHeaderHeight, sidebarBlockRowHeight, controlGap, sheetRowHeight }
|
|
527
|
-
surface: { bg, panel, panelHover, elevated, subtle, overlay, field, border, hairline }
|
|
547
|
+
surface: { bg, panel, panelHover, rowHover, rowSelected, elevated, subtle, overlay, field, border, hairline }
|
|
528
548
|
status: { excellent, good, warn, bad, neutral }
|
|
529
549
|
margin: { top, right, bottom, left }
|
|
530
550
|
Signature: alpha(token: string, a: number): string
|
package/package.json
CHANGED
package/src/charts/BandStrip.tsx
CHANGED
|
@@ -14,13 +14,21 @@
|
|
|
14
14
|
import { barY } from '@tanstack/charts/bar'
|
|
15
15
|
import { decorative } from '@tanstack/charts/mark/decorative'
|
|
16
16
|
import { rect } from '@tanstack/charts/rect'
|
|
17
|
+
import { text } from '@tanstack/charts/text'
|
|
17
18
|
import { useCallback, useMemo } from 'react'
|
|
18
19
|
import type { ReactElement } from 'react'
|
|
19
20
|
import { oneOf, requiredProp } from '../common/errors'
|
|
20
21
|
import { NON_FINITE } from '../format/shared'
|
|
21
22
|
import { VX, alpha } from '../tokens'
|
|
22
23
|
import { CartesianRung } from './CartesianChart'
|
|
23
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
BAND_GLYPH_MIN_PX,
|
|
26
|
+
NOTCH_PX,
|
|
27
|
+
glyphOf,
|
|
28
|
+
groupsOf,
|
|
29
|
+
resolveNamedState,
|
|
30
|
+
toneOf,
|
|
31
|
+
} from './band-fold'
|
|
24
32
|
import type { Group, NamedChartState } from './band-fold'
|
|
25
33
|
import { emphasis } from './marks'
|
|
26
34
|
import { rowX } from './types'
|
|
@@ -115,6 +123,8 @@ const ZX_ANCHOR = [{ fill: 'transparent' }] as const
|
|
|
115
123
|
const UNKNOWN_FILL = alpha(VX.neutral, 0.2)
|
|
116
124
|
|
|
117
125
|
type Cell = { f0: number; f1: number; y0: number; y1: number }
|
|
126
|
+
/** A state's glyph at a band's centre, on the rung's `[0, 1]` zone scale. */
|
|
127
|
+
type Glyph = { f: number; glyph: string }
|
|
118
128
|
/** Cells sharing one paint: a `rect` mark takes a constant fill and opacity. */
|
|
119
129
|
type Layer = { fill: string; opacity: number; cells: Cell[] }
|
|
120
130
|
/** A slot that answers the pointer: its own source datum, and the (possibly merged) one it reads. */
|
|
@@ -258,6 +268,8 @@ function layoutBands<T>(input: LayoutInput<T>): {
|
|
|
258
268
|
base: Layer[]
|
|
259
269
|
markers: Layer[]
|
|
260
270
|
hits: Hit<T>[]
|
|
271
|
+
glyphs: Glyph[]
|
|
272
|
+
notches: Layer[]
|
|
261
273
|
} {
|
|
262
274
|
const { data, getBand, fold, absentState: absentKey } = input
|
|
263
275
|
const cap = Math.floor(input.width / (fold?.minBandPx ?? DEFAULT_MIN_BAND_PX))
|
|
@@ -275,6 +287,8 @@ function layoutBands<T>(input: LayoutInput<T>): {
|
|
|
275
287
|
absentKey,
|
|
276
288
|
}
|
|
277
289
|
const hits: Hit<T>[] = []
|
|
290
|
+
const glyphs: Glyph[] = []
|
|
291
|
+
const notches = new Map<string, Layer>()
|
|
278
292
|
|
|
279
293
|
for (const g of groups) {
|
|
280
294
|
const datum = fold && g.items.length > 1 ? fold.merge(g.items) : g.items[0]
|
|
@@ -282,6 +296,33 @@ function layoutBands<T>(input: LayoutInput<T>): {
|
|
|
282
296
|
const span = getBand(datum)
|
|
283
297
|
const cell = { f0: g.start / data.length, f1: (g.start + g.items.length) / data.length }
|
|
284
298
|
const answers = paintSpan(ctx, span, cell)
|
|
299
|
+
const named = input.states.get(span.state)
|
|
300
|
+
const glyph = named && glyphOf(named)
|
|
301
|
+
// The primary part's centre: an absent share is taken from the right edge.
|
|
302
|
+
if (answers.primary && glyph) {
|
|
303
|
+
const share = absentShareOf(span, absentKey)
|
|
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
|
+
}
|
|
325
|
+
}
|
|
285
326
|
g.items.forEach((source, i) => {
|
|
286
327
|
const slot = g.start + i
|
|
287
328
|
if (answers.primary) hits.push({ slot, source, state: span.state, datum })
|
|
@@ -289,7 +330,13 @@ function layoutBands<T>(input: LayoutInput<T>): {
|
|
|
289
330
|
hits.push({ slot, source, state: absentKey, datum })
|
|
290
331
|
})
|
|
291
332
|
}
|
|
292
|
-
return {
|
|
333
|
+
return {
|
|
334
|
+
base: [...ctx.base.values()],
|
|
335
|
+
markers: [...ctx.markers.values()],
|
|
336
|
+
hits,
|
|
337
|
+
glyphs,
|
|
338
|
+
notches: [...notches.values()],
|
|
339
|
+
}
|
|
293
340
|
}
|
|
294
341
|
|
|
295
342
|
export function BandStrip<T, X extends ChartX = ChartX, K extends string = string>(
|
|
@@ -337,7 +384,7 @@ export function BandStrip<T, X extends ChartX = ChartX, K extends string = strin
|
|
|
337
384
|
|
|
338
385
|
const marks = useCallback(
|
|
339
386
|
(plot: PlotContext<T, X>): ChartMarks => {
|
|
340
|
-
const { base, markers, hits } = layoutBands({
|
|
387
|
+
const { base, markers, hits, glyphs, notches } = layoutBands({
|
|
341
388
|
data,
|
|
342
389
|
getBand,
|
|
343
390
|
fold,
|
|
@@ -370,6 +417,38 @@ export function BandStrip<T, X extends ChartX = ChartX, K extends string = strin
|
|
|
370
417
|
}),
|
|
371
418
|
),
|
|
372
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
|
+
),
|
|
435
|
+
...(glyphs.length > 0
|
|
436
|
+
? [
|
|
437
|
+
decorative(
|
|
438
|
+
text(glyphs, {
|
|
439
|
+
id: 'band-glyphs',
|
|
440
|
+
x: 'f',
|
|
441
|
+
y: () => 0.5,
|
|
442
|
+
xScale: 'zx',
|
|
443
|
+
text: 'glyph',
|
|
444
|
+
fill: VX.surface.panel,
|
|
445
|
+
fontSize: VX.text.xs,
|
|
446
|
+
fontWeight: 600,
|
|
447
|
+
anchor: 'middle',
|
|
448
|
+
}),
|
|
449
|
+
),
|
|
450
|
+
]
|
|
451
|
+
: []),
|
|
373
452
|
...(rows.length > 0
|
|
374
453
|
? [
|
|
375
454
|
barY(rows, {
|
|
@@ -431,6 +510,7 @@ export function BandStrip<T, X extends ChartX = ChartX, K extends string = strin
|
|
|
431
510
|
series={series}
|
|
432
511
|
marks={marks}
|
|
433
512
|
band
|
|
513
|
+
tooltipBelow
|
|
434
514
|
y={STRIP_AXIS}
|
|
435
515
|
xZones={ZX_ANCHOR}
|
|
436
516
|
cursorResolution={cursorResolution}
|
package/src/charts/Bars.tsx
CHANGED
|
@@ -107,6 +107,8 @@ export function Bars<T, X extends ChartX = ChartX>(props: BarsProps<T, X>): Reac
|
|
|
107
107
|
const byKey = new Map(bars.map((b) => [b.key, b]))
|
|
108
108
|
const rows = visibleBars.flatMap((s) => plot.rows(s.key))
|
|
109
109
|
const h = plot.highlighted
|
|
110
|
+
const solid = ({ datum }: { datum: PlotRow<T, X> }): string =>
|
|
111
|
+
byKey.get(datum.series)?.color ?? 'transparent'
|
|
110
112
|
const fill = (row: PlotRow<T, X>): string => {
|
|
111
113
|
const bar = byKey.get(row.series)
|
|
112
114
|
if (!bar) return 'transparent'
|
|
@@ -123,6 +125,9 @@ export function Bars<T, X extends ChartX = ChartX>(props: BarsProps<T, X>): Reac
|
|
|
123
125
|
y: 'y',
|
|
124
126
|
z: 'series',
|
|
125
127
|
fill,
|
|
128
|
+
// The hovered x is its own highlight: the bar reads at full strength (no dimming, no
|
|
129
|
+
// point marker, no crosshair rule: that is line-chart chrome; `focusRing={false}` on the rung).
|
|
130
|
+
states: [{ when: { focus: 'x' }, style: { fill: solid } }],
|
|
126
131
|
layout:
|
|
127
132
|
layout === 'grouped'
|
|
128
133
|
? group({ padding: 0.1 })
|
|
@@ -144,6 +149,8 @@ export function Bars<T, X extends ChartX = ChartX>(props: BarsProps<T, X>): Reac
|
|
|
144
149
|
series={series}
|
|
145
150
|
marks={marks}
|
|
146
151
|
band
|
|
152
|
+
crosshair={false}
|
|
153
|
+
focusRing={false}
|
|
147
154
|
reverseRows={layout !== 'grouped'}
|
|
148
155
|
{...(layout !== 'grouped' && { stack: layout })}
|
|
149
156
|
/>
|
|
@@ -27,6 +27,14 @@ export type RungOptions = {
|
|
|
27
27
|
reverseRows?: boolean
|
|
28
28
|
/** How the bar series combine for the auto domain. */
|
|
29
29
|
stack?: 'stacked' | 'normalized'
|
|
30
|
+
/** The tooltip opens below the chart (a strip of cells), above only when there is no room. */
|
|
31
|
+
tooltipBelow?: boolean
|
|
32
|
+
/** No vertical rule under the cursor (a bar kind's hover is the bar itself). */
|
|
33
|
+
crosshair?: boolean
|
|
34
|
+
/** No engine point marker on the focused datum (a bar kind's hover is the bar itself). */
|
|
35
|
+
focusRing?: boolean
|
|
36
|
+
/** The legend goes from the wide class up, where `Lines`' end labels name the series. */
|
|
37
|
+
hideLegendAtWide?: boolean
|
|
30
38
|
}
|
|
31
39
|
|
|
32
40
|
// A size container: the legend picks none/dots/chips from this box's width in CSS, so the server
|
|
@@ -85,6 +93,8 @@ export type ChartShellProps<T> = Pick<
|
|
|
85
93
|
compile: (ctx: ShellContext) => CartesianDefinition
|
|
86
94
|
/** Recompile when the measured width changes (default: it is not an input). */
|
|
87
95
|
byWidth?: boolean
|
|
96
|
+
/** `auto` legend only: hidden from the wide class up (CSS). */
|
|
97
|
+
hideLegendAtWide?: boolean
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
/**
|
|
@@ -94,6 +104,7 @@ export type ChartShellProps<T> = Pick<
|
|
|
94
104
|
*/
|
|
95
105
|
export function ChartShell<T>(props: ChartShellProps<T>): ReactElement {
|
|
96
106
|
const { ariaLabel, legend, height, state, className, style, series, compile, byWidth } = props
|
|
107
|
+
const { hideLegendAtWide } = props
|
|
97
108
|
const chartId = useId()
|
|
98
109
|
const inCard = useInChartCard()
|
|
99
110
|
const { ref, width: measured, coarse } = useChartSize()
|
|
@@ -115,8 +126,9 @@ export function ChartShell<T>(props: ChartShellProps<T>): ReactElement {
|
|
|
115
126
|
)
|
|
116
127
|
|
|
117
128
|
// ── legend: micro has none, compact shows dots, regular and wide show chips (CSS, § 9.6) ──────
|
|
118
|
-
|
|
129
|
+
// A single entry names nothing the title, axis and tooltip do not: no legend unless asked for.
|
|
119
130
|
const entryCount = legendEntries(series, false)[0]?.length ?? 0
|
|
131
|
+
const config = legend === false ? null : (legend ?? (entryCount > 1 ? {} : null))
|
|
120
132
|
const shown = config !== null && entryCount > 0
|
|
121
133
|
const toggle = config?.toggle ?? entryCount >= 2
|
|
122
134
|
const onToggle = useCallback((key: string) => {
|
|
@@ -139,9 +151,10 @@ export function ChartShell<T>(props: ChartShellProps<T>): ReactElement {
|
|
|
139
151
|
onToggle={onToggle}
|
|
140
152
|
onHighlight={setHighlighted}
|
|
141
153
|
concealed={resolved !== null}
|
|
154
|
+
hideAtWide={hideLegendAtWide === true}
|
|
142
155
|
/>
|
|
143
156
|
) : null,
|
|
144
|
-
[shown, series, hidden, config?.groups, toggle, onToggle, resolved],
|
|
157
|
+
[shown, series, hidden, config?.groups, toggle, onToggle, resolved, hideLegendAtWide],
|
|
145
158
|
)
|
|
146
159
|
// `header` is the enclosing card's header row (`top` outside a card); either way the legend is
|
|
147
160
|
// the first thing in the chart's own markup.
|
|
@@ -176,7 +189,8 @@ export function ChartShell<T>(props: ChartShellProps<T>): ReactElement {
|
|
|
176
189
|
export function CartesianRung<T, X extends ChartX>(
|
|
177
190
|
props: CartesianChartProps<T, X> & RungOptions,
|
|
178
191
|
): ReactElement {
|
|
179
|
-
const { ariaLabel, legend, height, state, className, style, series, ...spec } =
|
|
192
|
+
const { ariaLabel, legend, height, state, className, style, series, hideLegendAtWide, ...spec } =
|
|
193
|
+
props
|
|
180
194
|
const stable = useShallowStable({ ...spec, series })
|
|
181
195
|
const compile = useCallback(
|
|
182
196
|
(ctx: ShellContext) => compileCartesian({ ...stable, ...ctx }),
|
|
@@ -197,6 +211,7 @@ export function CartesianRung<T, X extends ChartX>(
|
|
|
197
211
|
{...(state !== undefined && { state })}
|
|
198
212
|
{...(className !== undefined && { className })}
|
|
199
213
|
{...(style !== undefined && { style })}
|
|
214
|
+
{...(hideLegendAtWide && { hideLegendAtWide })}
|
|
200
215
|
/>
|
|
201
216
|
)
|
|
202
217
|
}
|