@zsherman/charts 0.0.0-stage → 0.1.1

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.
Files changed (180) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +373 -0
  3. package/README.md +13 -2
  4. package/THIRD_PARTY_NOTICES.md +33 -0
  5. package/dist/dom/bar-list/bar-list.js +386 -0
  6. package/dist/dom/bar-list/bar-list.styles.js +171 -0
  7. package/dist/dom/bar-list/index.js +1 -0
  8. package/dist/dom/chart/chart.js +716 -0
  9. package/dist/dom/chart/chart.styles.js +165 -0
  10. package/dist/dom/chart/index.js +1 -0
  11. package/dist/dom/chart-grid/chart-grid.js +67 -0
  12. package/dist/dom/chart-grid/index.js +1 -0
  13. package/dist/dom/donut/donut.js +565 -0
  14. package/dist/dom/donut/donut.styles.js +111 -0
  15. package/dist/dom/donut/index.js +1 -0
  16. package/dist/dom/heat-graph/calendar.js +118 -0
  17. package/dist/dom/heat-graph/heat-graph.js +423 -0
  18. package/dist/dom/heat-graph/heat-graph.styles.js +168 -0
  19. package/dist/dom/heat-graph/index.js +1 -0
  20. package/dist/dom/heat-matrix/heat-matrix.js +346 -0
  21. package/dist/dom/heat-matrix/heat-matrix.styles.js +155 -0
  22. package/dist/dom/heat-matrix/index.js +1 -0
  23. package/dist/dom/heat-matrix/model.js +41 -0
  24. package/dist/dom/index.js +13 -0
  25. package/dist/dom/internal/colors.js +44 -0
  26. package/dist/dom/internal/floating-tip.js +83 -0
  27. package/dist/dom/internal/format.js +43 -0
  28. package/dist/dom/internal/grid-context.js +5 -0
  29. package/dist/dom/internal/hidden.styles.js +16 -0
  30. package/dist/dom/internal/legend.js +112 -0
  31. package/dist/dom/internal/legend.styles.js +108 -0
  32. package/dist/dom/internal/markers.js +101 -0
  33. package/dist/dom/internal/options.js +300 -0
  34. package/dist/dom/internal/place.js +27 -0
  35. package/dist/dom/internal/scheme-watch.js +73 -0
  36. package/dist/dom/internal/share.js +28 -0
  37. package/dist/dom/internal/types.js +0 -0
  38. package/dist/dom/row-chart/index.js +1 -0
  39. package/dist/dom/row-chart/model.js +59 -0
  40. package/dist/dom/row-chart/row-chart.js +691 -0
  41. package/dist/dom/row-chart/row-chart.styles.js +242 -0
  42. package/dist/dom/segmented-bar/index.js +1 -0
  43. package/dist/dom/segmented-bar/segmented-bar.js +280 -0
  44. package/dist/dom/segmented-bar/segmented-bar.styles.js +88 -0
  45. package/dist/dom/sparkline/index.js +1 -0
  46. package/dist/dom/sparkline/sparkline.js +145 -0
  47. package/dist/dom/stacked-histogram/histogram.js +137 -0
  48. package/dist/dom/stacked-histogram/index.js +1 -0
  49. package/dist/dom/stacked-histogram/stacked-histogram.js +761 -0
  50. package/dist/dom/stacked-histogram/stacked-histogram.styles.js +211 -0
  51. package/dist/dom/state-timeline/index.js +1 -0
  52. package/dist/dom/state-timeline/model.js +166 -0
  53. package/dist/dom/state-timeline/state-timeline.js +729 -0
  54. package/dist/dom/state-timeline/state-timeline.styles.js +171 -0
  55. package/dist/dom/status-history/index.js +1 -0
  56. package/dist/dom/status-history/status-history.js +542 -0
  57. package/dist/dom/status-history/status-history.styles.js +171 -0
  58. package/dist/solid/bar-list/bar-list.jsx +139 -0
  59. package/dist/solid/bar-list/bar-list.styles.jsx +171 -0
  60. package/dist/solid/bar-list/index.jsx +1 -0
  61. package/dist/solid/chart/chart.jsx +454 -0
  62. package/dist/solid/chart/chart.styles.jsx +165 -0
  63. package/dist/solid/chart/index.jsx +1 -0
  64. package/dist/solid/chart-grid/chart-grid.jsx +46 -0
  65. package/dist/solid/chart-grid/index.jsx +1 -0
  66. package/dist/solid/donut/donut.jsx +291 -0
  67. package/dist/solid/donut/donut.styles.jsx +111 -0
  68. package/dist/solid/donut/index.jsx +1 -0
  69. package/dist/solid/heat-graph/calendar.jsx +118 -0
  70. package/dist/solid/heat-graph/heat-graph.jsx +228 -0
  71. package/dist/solid/heat-graph/heat-graph.styles.jsx +168 -0
  72. package/dist/solid/heat-graph/index.jsx +1 -0
  73. package/dist/solid/heat-matrix/heat-matrix.jsx +165 -0
  74. package/dist/solid/heat-matrix/heat-matrix.styles.jsx +155 -0
  75. package/dist/solid/heat-matrix/index.jsx +1 -0
  76. package/dist/solid/heat-matrix/model.jsx +41 -0
  77. package/dist/solid/index.jsx +13 -0
  78. package/dist/solid/internal/colors.jsx +44 -0
  79. package/dist/solid/internal/floating-tip.jsx +68 -0
  80. package/dist/solid/internal/format.jsx +43 -0
  81. package/dist/solid/internal/grid-context.jsx +5 -0
  82. package/dist/solid/internal/hidden.styles.jsx +16 -0
  83. package/dist/solid/internal/legend.jsx +35 -0
  84. package/dist/solid/internal/legend.styles.jsx +108 -0
  85. package/dist/solid/internal/markers.jsx +101 -0
  86. package/dist/solid/internal/options.jsx +300 -0
  87. package/dist/solid/internal/place.jsx +27 -0
  88. package/dist/solid/internal/scheme-watch.jsx +73 -0
  89. package/dist/solid/internal/share.jsx +28 -0
  90. package/dist/solid/internal/types.jsx +0 -0
  91. package/dist/solid/row-chart/index.jsx +1 -0
  92. package/dist/solid/row-chart/model.jsx +59 -0
  93. package/dist/solid/row-chart/row-chart.jsx +312 -0
  94. package/dist/solid/row-chart/row-chart.styles.jsx +242 -0
  95. package/dist/solid/segmented-bar/index.jsx +1 -0
  96. package/dist/solid/segmented-bar/segmented-bar.jsx +125 -0
  97. package/dist/solid/segmented-bar/segmented-bar.styles.jsx +88 -0
  98. package/dist/solid/sparkline/index.jsx +1 -0
  99. package/dist/solid/sparkline/sparkline.jsx +88 -0
  100. package/dist/solid/stacked-histogram/histogram.jsx +137 -0
  101. package/dist/solid/stacked-histogram/index.jsx +1 -0
  102. package/dist/solid/stacked-histogram/stacked-histogram.jsx +381 -0
  103. package/dist/solid/stacked-histogram/stacked-histogram.styles.jsx +211 -0
  104. package/dist/solid/state-timeline/index.jsx +1 -0
  105. package/dist/solid/state-timeline/model.jsx +166 -0
  106. package/dist/solid/state-timeline/state-timeline.jsx +387 -0
  107. package/dist/solid/state-timeline/state-timeline.styles.jsx +171 -0
  108. package/dist/solid/status-history/index.jsx +1 -0
  109. package/dist/solid/status-history/status-history.jsx +279 -0
  110. package/dist/solid/status-history/status-history.styles.jsx +171 -0
  111. package/dist/styles.css +1 -0
  112. package/dist/types/bar-list/bar-list.d.ts +91 -0
  113. package/dist/types/bar-list/bar-list.styles.d.ts +148 -0
  114. package/dist/types/bar-list/index.d.ts +3 -0
  115. package/dist/types/chart/chart.d.ts +98 -0
  116. package/dist/types/chart/chart.styles.d.ts +145 -0
  117. package/dist/types/chart/index.d.ts +3 -0
  118. package/dist/types/chart-grid/chart-grid.d.ts +35 -0
  119. package/dist/types/chart-grid/index.d.ts +2 -0
  120. package/dist/types/donut/donut.d.ts +124 -0
  121. package/dist/types/donut/donut.styles.d.ts +96 -0
  122. package/dist/types/donut/index.d.ts +3 -0
  123. package/dist/types/heat-graph/calendar.d.ts +61 -0
  124. package/dist/types/heat-graph/heat-graph.d.ts +82 -0
  125. package/dist/types/heat-graph/heat-graph.styles.d.ts +141 -0
  126. package/dist/types/heat-graph/index.d.ts +4 -0
  127. package/dist/types/heat-matrix/heat-matrix.d.ts +65 -0
  128. package/dist/types/heat-matrix/heat-matrix.styles.d.ts +135 -0
  129. package/dist/types/heat-matrix/index.d.ts +3 -0
  130. package/dist/types/heat-matrix/model.d.ts +15 -0
  131. package/dist/types/index.d.ts +12 -0
  132. package/dist/types/internal/colors.d.ts +22 -0
  133. package/dist/types/internal/floating-tip.d.ts +15 -0
  134. package/dist/types/internal/format.d.ts +7 -0
  135. package/dist/types/internal/grid-context.d.ts +9 -0
  136. package/dist/types/internal/hidden.styles.d.ts +15 -0
  137. package/dist/types/internal/legend.d.ts +18 -0
  138. package/dist/types/internal/legend.styles.d.ts +96 -0
  139. package/dist/types/internal/markers.d.ts +16 -0
  140. package/dist/types/internal/options.d.ts +59 -0
  141. package/dist/types/internal/place.d.ts +20 -0
  142. package/dist/types/internal/scheme-watch.d.ts +12 -0
  143. package/dist/types/internal/share.d.ts +19 -0
  144. package/dist/types/internal/types.d.ts +163 -0
  145. package/dist/types/row-chart/index.d.ts +4 -0
  146. package/dist/types/row-chart/model.d.ts +50 -0
  147. package/dist/types/row-chart/row-chart.d.ts +148 -0
  148. package/dist/types/row-chart/row-chart.styles.d.ts +216 -0
  149. package/dist/types/segmented-bar/index.d.ts +3 -0
  150. package/dist/types/segmented-bar/segmented-bar.d.ts +65 -0
  151. package/dist/types/segmented-bar/segmented-bar.styles.d.ts +75 -0
  152. package/dist/types/sparkline/index.d.ts +3 -0
  153. package/dist/types/sparkline/sparkline.d.ts +38 -0
  154. package/dist/types/stacked-histogram/histogram.d.ts +48 -0
  155. package/dist/types/stacked-histogram/index.d.ts +4 -0
  156. package/dist/types/stacked-histogram/stacked-histogram.d.ts +73 -0
  157. package/dist/types/stacked-histogram/stacked-histogram.styles.d.ts +187 -0
  158. package/dist/types/state-timeline/index.d.ts +3 -0
  159. package/dist/types/state-timeline/model.d.ts +63 -0
  160. package/dist/types/state-timeline/state-timeline.d.ts +108 -0
  161. package/dist/types/state-timeline/state-timeline.styles.d.ts +151 -0
  162. package/dist/types/status-history/index.d.ts +3 -0
  163. package/dist/types/status-history/status-history.d.ts +72 -0
  164. package/dist/types/status-history/status-history.styles.d.ts +150 -0
  165. package/docs/api.json +1346 -0
  166. package/docs/bar-list.md +190 -0
  167. package/docs/chart-grid.md +77 -0
  168. package/docs/chart.md +355 -0
  169. package/docs/donut.md +182 -0
  170. package/docs/heat-graph.md +121 -0
  171. package/docs/heat-matrix.md +108 -0
  172. package/docs/llms.txt +68 -0
  173. package/docs/row-chart.md +193 -0
  174. package/docs/search-index.json +291 -0
  175. package/docs/segmented-bar.md +128 -0
  176. package/docs/sparkline.md +82 -0
  177. package/docs/stacked-histogram.md +123 -0
  178. package/docs/state-timeline.md +141 -0
  179. package/docs/status-history.md +121 -0
  180. package/package.json +109 -4
@@ -0,0 +1,163 @@
1
+ import type { JSX } from "@solidjs/web";
2
+ import type uPlot from "uplot";
3
+ /**
4
+ * Chart data in uPlot's aligned format: the x values first, then one array per series, all the same
5
+ * length. On a time axis the x values are Unix **seconds** (`date.getTime() / 1000`). `null` is a
6
+ * missing reading: lines break there and bars are left out.
7
+ */
8
+ export type ChartData = uPlot.AlignedData;
9
+ /** How a series is drawn. */
10
+ export type SeriesType = "line" | "area" | "bar";
11
+ /** A kit chart color (`chart-1` … `chart-8`, the `--sui-chart-*` tokens) or any CSS color. */
12
+ export type ChartColor = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8" | (string & {});
13
+ /** One y series: the entry at index `i` describes `data[i + 1]`. */
14
+ export interface ChartSeries {
15
+ /** Short noun for the legend, tooltip and keyboard readout ("Requests"). */
16
+ label: string;
17
+ /**
18
+ * `line` for a trend, `area` for one series whose volume matters, `bar` for values compared one by one.
19
+ * @defaultValue "line"
20
+ */
21
+ type?: SeriesType;
22
+ /**
23
+ * The mark's color. Defaults to the next chart token in order (series 1 takes `chart-1`), so a series
24
+ * keeps its color when others are hidden.
25
+ */
26
+ color?: ChartColor;
27
+ /**
28
+ * Line width in CSS pixels (lines and areas).
29
+ * @defaultValue 2
30
+ */
31
+ width?: number;
32
+ /** Dash pattern for a line (`[4, 4]`): a second cue beside color, for a target or a forecast. */
33
+ dash?: number[];
34
+ /** Draw a dot at each point of a line. Use it for a few points, not for dense series. */
35
+ points?: boolean;
36
+ /**
37
+ * Shown at first. People toggle series from the legend.
38
+ * @defaultValue true
39
+ */
40
+ show?: boolean;
41
+ /** Formats this series' values in the tooltip, legend and readout. Defaults to the y axis `format`. */
42
+ format?: (value: number) => string;
43
+ }
44
+ /** Options shared by both axes. */
45
+ export interface ChartAxis {
46
+ /**
47
+ * Draw the axis (ticks and labels).
48
+ * @defaultValue true
49
+ */
50
+ show?: boolean;
51
+ /** Grid lines across the plot. Defaults to on for y, off for x. */
52
+ grid?: boolean;
53
+ /** Axis title, drawn beside the y axis or below the x axis. */
54
+ label?: string;
55
+ /** Formats tick labels, and tooltip values when the series has no `format`. */
56
+ format?: (value: number) => string;
57
+ /** A fixed `[min, max]` instead of fitting the data, such as `[0, 100]` for percentages. */
58
+ range?: [number, number];
59
+ /** Allowed steps between ticks, such as `[1]` for whole numbers only. */
60
+ steps?: number[];
61
+ /** Space reserved for the axis in pixels (its width for y, height for x). */
62
+ size?: number;
63
+ }
64
+ /** The x axis. */
65
+ export interface ChartXAxis extends ChartAxis {
66
+ /**
67
+ * The x values are Unix seconds, ticks read as dates and times. Defaults to `true` unless `categories`
68
+ * is set.
69
+ */
70
+ time?: boolean;
71
+ /**
72
+ * Names for x values `0, 1, 2, …`: a category axis (months, regions, plans). The data's x array is
73
+ * then `[0, 1, 2, …]`.
74
+ */
75
+ categories?: string[];
76
+ }
77
+ /** The tooltip that follows the pointer (and the keyboard cursor). */
78
+ export interface ChartTooltip {
79
+ /** Formats the x value in the tooltip heading. Defaults to the x axis `format`, then a date or number. */
80
+ formatX?: (value: number) => string;
81
+ /**
82
+ * Your own content inside the tooltip box, in place of the heading and one row per series: a total, a
83
+ * share, a note. It's called once while the tooltip is open; read `point()` in your JSX and it follows
84
+ * the cursor. The box, its position and the keyboard stay the chart's.
85
+ */
86
+ render?: (point: () => ChartPoint) => JSX.Element;
87
+ }
88
+ /** One series at the cursor, in a `ChartPoint`. */
89
+ export interface ChartPointSeries {
90
+ /** The series' `label`. */
91
+ label: string;
92
+ /** Its own value at this x (not the running total of a stack); `null` where it has no reading. */
93
+ value: number | null;
94
+ /** The value as the tooltip writes it (the series' `format`, else the y axis', else the locale's). */
95
+ text: string;
96
+ /** Its color as CSS (`var(--sui-chart-1)`), for a swatch of your own. */
97
+ color: string;
98
+ /** `false` while it's hidden from the legend. */
99
+ shown: boolean;
100
+ }
101
+ /** The point under the cursor: what the tooltip shows and `onCursor` reports. */
102
+ export interface ChartPoint {
103
+ /** The index into the data arrays. */
104
+ index: number;
105
+ /** The x value (Unix seconds on a time axis, the index on a category axis). */
106
+ x: number;
107
+ /** The x value as the tooltip heading writes it. */
108
+ xText: string;
109
+ /** Every series, in order, hidden ones included (`shown: false`). */
110
+ series: ChartPointSeries[];
111
+ /** The series the pointer is on, or whose legend entry is hovered or focused (an index into `series`). */
112
+ focused: number | null;
113
+ }
114
+ /**
115
+ * A reference line or band across the plot: a target, a threshold, an incident window. Drawn in a text
116
+ * or status color with a dashed line, so it reads apart from the series.
117
+ */
118
+ export interface ChartMarker {
119
+ /** `"y"`: a horizontal line or band at a value (a target, an SLO). `"x"`: a vertical one at a time (a deploy, an incident). */
120
+ axis: "x" | "y";
121
+ /** One value for a line, `[from, to]` for a band. In the axis' units (Unix seconds on a time axis). */
122
+ value: number | [number, number];
123
+ /** Drawn beside it and read out with the chart's description ("Target", "SLO 200 ms"). */
124
+ label?: string;
125
+ /**
126
+ * `neutral` for a target or a reference, a status tone when it means a state (`danger` for an error
127
+ * budget, an incident). Say the same in `label`: color alone doesn't carry it.
128
+ * @defaultValue "neutral"
129
+ */
130
+ tone?: "neutral" | "accent" | "success" | "warning" | "danger";
131
+ /**
132
+ * The line's dash pattern in pixels.
133
+ * @defaultValue [6, 4]
134
+ */
135
+ dash?: number[];
136
+ }
137
+ /** A range of x values (data units: Unix seconds on a time axis). */
138
+ export interface ChartRange {
139
+ min: number;
140
+ max: number;
141
+ }
142
+ /** Imperative handle for data that changes outside Solid's reactivity (a socket buffer). */
143
+ export interface ChartController {
144
+ /** Replace the data without rebuilding the chart. Same as passing new `data`. */
145
+ setData: (data: ChartData) => void;
146
+ /** Zoom the x axis to a range. */
147
+ setXRange: (range: ChartRange) => void;
148
+ /** Fix the y axis to a range until the data changes. */
149
+ setYRange: (range: ChartRange) => void;
150
+ /** Undo a zoom: fit the x axis to the data again. */
151
+ resetZoom: () => void;
152
+ /** The underlying uPlot instance, for plugins and hooks of your own. `null` before mount and on the server. */
153
+ uplot: () => uPlot | null;
154
+ }
155
+ /** The chart's built-in strings. Also set app-wide with the kit's `LocaleProvider messages={{ chart }}`. */
156
+ export interface ChartLabels {
157
+ /** Read after the plot's name while it can take focus. */
158
+ keyboardHint: string;
159
+ /** The legend list's name, from the chart's `label`. */
160
+ legend: (label: string) => string;
161
+ }
162
+ /** A status tone, in the kit's status colors (Badge's tones): for a mark whose color means a state. */
163
+ export type ChartTone = "neutral" | "accent" | "info" | "success" | "warning" | "danger";
@@ -0,0 +1,4 @@
1
+ export { RowChart } from "./row-chart.js";
2
+ export type { RowChartLabels, RowChartPoint, RowChartPointSeries, RowChartProps, RowChartRow, RowChartSeries, RowChartTooltip, RowChartValue, } from "./row-chart.js";
3
+ export type { RowChartLayout } from "./model.js";
4
+ export type { ChartColor, ChartTone } from "../internal/types.js";
@@ -0,0 +1,50 @@
1
+ export type RowChartLayout = "grouped" | "stacked";
2
+ /** One bar of a row, or one segment of a stacked row's bar. */
3
+ export interface ModelBar {
4
+ /** The series' index. */
5
+ series: number;
6
+ /** The value as given; `null` for a missing one. */
7
+ raw: number | null;
8
+ /** What it counts as: a missing or negative value is 0. */
9
+ value: number;
10
+ /** Its length as a fraction of the scale's `max`, 0 to 1. */
11
+ fraction: number;
12
+ /** The value written ("20.6"). */
13
+ text: string;
14
+ /** Stacked: its share of the row's total. */
15
+ share: number;
16
+ /** Grouped, with `delta`: its change from the row's first value (0.549 for +54.9%), on the last bar. */
17
+ delta: number | undefined;
18
+ }
19
+ export interface ModelRow {
20
+ bars: ModelBar[];
21
+ /** Stacked: the sum of the row's values. */
22
+ total: number;
23
+ /** Stacked: the total's length as a fraction of the scale. */
24
+ fraction: number;
25
+ /** The row starts a group other than the one before it: a line separates them. */
26
+ groupStart: boolean;
27
+ }
28
+ export interface ModelInput {
29
+ rows: readonly {
30
+ values: readonly (number | null)[];
31
+ group?: string;
32
+ }[];
33
+ seriesCount: number;
34
+ layout: RowChartLayout;
35
+ /** The value a full-length bar stands for. Defaults to the largest bar (grouped) or row total (stacked). */
36
+ max: number | undefined;
37
+ delta: boolean;
38
+ format: (value: number) => string;
39
+ }
40
+ export declare function buildModel(input: ModelInput): {
41
+ rows: ModelRow[];
42
+ max: number;
43
+ };
44
+ /** A change as a signed percent: "+54.9%", "−3.2%", "0%". */
45
+ export declare function deltaFormat(locale: string): (delta: number) => string;
46
+ /**
47
+ * A bar's length beside the text after it: the bar takes its fraction of the row's width less the room
48
+ * kept for the longest text, so the text always fits after the longest bar.
49
+ */
50
+ export declare const barWidth: (fraction: number) => string;
@@ -0,0 +1,148 @@
1
+ import type { JSX } from "@solidjs/web";
2
+ import type { ChartColor, ChartTone } from "../internal/types.js";
3
+ import { type RowChartLayout } from "./model.js";
4
+ /** One series: the first bar of every row, the second, … (or a segment of each stacked bar). */
5
+ export interface RowChartSeries {
6
+ /** Its name in the legend, the tooltip and each row's name ("Baseline", "User vCPU"). */
7
+ label: string;
8
+ /** A short note after the name in the legend, set in the mono face: a version, a commit (`3e0ea36`). */
9
+ note?: string;
10
+ /** Its color: a chart token or any CSS color. Without `color` or `tone`, the chart tokens in order. */
11
+ color?: ChartColor;
12
+ /**
13
+ * A status tone instead of a chart color: `neutral` (gray) for a baseline or "before" that the other
14
+ * series are compared to. Ignored when `color` is set.
15
+ */
16
+ tone?: ChartTone;
17
+ }
18
+ /** One row: a category and its value for each series. */
19
+ export interface RowChartRow<T = unknown> {
20
+ /** What the row is ("Gcore eu-central"). */
21
+ label: string;
22
+ /** A line under the label: its configuration, a region, a size ("g1-cpu-4-4 · 16p · 4x4"). */
23
+ note?: string;
24
+ /** One value per series, in the series' order. Missing or negative values draw no bar and count as 0. */
25
+ values: readonly (number | null)[];
26
+ /** Rows with the same group sit together; a line separates one group from the next. */
27
+ group?: string;
28
+ /** Draw the row a step back: its bars mixed into the surface, its label lighter. A baseline, a "before". */
29
+ muted?: boolean;
30
+ /** This row's colors, by series, in place of the series' own (a kind of host drawn in its own color). */
31
+ colors?: readonly (ChartColor | undefined)[];
32
+ /** Identifies the row for the tooltip's `render` when labels repeat. Defaults to `label`. */
33
+ key?: string;
34
+ /** Your own data, handed back to `valueText` and the tooltip's `render`. */
35
+ data?: T;
36
+ }
37
+ /** What `valueText` writes after a bar (grouped) or after a stacked row's bar. */
38
+ export interface RowChartValue<T = unknown> {
39
+ row: RowChartRow<T>;
40
+ /** The series' index, or `null` for a stacked row's total. */
41
+ series: number | null;
42
+ /** The value (the total for a stacked row); a missing one counts as 0. */
43
+ value: number;
44
+ /** The text the chart would write: the value, with the change from the first series when `delta`. */
45
+ text: string;
46
+ /** With `delta`, on the last series: the change from the row's first value (0.549 for +54.9%). */
47
+ delta?: number;
48
+ }
49
+ /** One series in a row, as the tooltip shows it. */
50
+ export interface RowChartPointSeries {
51
+ label: string;
52
+ /** The value as given (`null` when missing). */
53
+ value: number | null;
54
+ /** The value written, with its change when `delta`. */
55
+ text: string;
56
+ /** Stacked: its share of the row's total, written ("32%"). */
57
+ share?: string;
58
+ /** Its color as CSS, for a swatch of your own. */
59
+ color: string;
60
+ }
61
+ /** The row under the pointer (or the keyboard): what the tooltip shows. */
62
+ export interface RowChartPoint<T = unknown> {
63
+ row: RowChartRow<T>;
64
+ /** The row's index in `rows`. */
65
+ index: number;
66
+ /** The sum of the row's values. */
67
+ total: number;
68
+ /** The total written. */
69
+ totalText: string;
70
+ series: RowChartPointSeries[];
71
+ }
72
+ /** The tooltip on a row: hovered, or reached with the arrow keys. */
73
+ export interface RowChartTooltip<T = unknown> {
74
+ /**
75
+ * Your own content inside the tooltip box. It's called once while the tooltip is open; read `point()`
76
+ * in your JSX and it follows the active row.
77
+ */
78
+ render?: (point: () => RowChartPoint<T>) => JSX.Element;
79
+ }
80
+ /** The words the chart writes. Also set app-wide with the kit's `LocaleProvider messages={{ rowChart }}`. */
81
+ export interface RowChartLabels {
82
+ /** A stacked row's sum, in the tooltip and each row's name ("Total"). */
83
+ total: string;
84
+ /** Read after the chart's name while it can take focus. */
85
+ keyboardHint: string;
86
+ /** The legend list's name, from the chart's `label`. */
87
+ legend: (label: string) => string;
88
+ /** In place of the rows when there are none. */
89
+ empty: string;
90
+ }
91
+ export interface RowChartProps<T = unknown> extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "class"> {
92
+ /** The chart's name for assistive technology: what is compared, by what ("Participants per vCPU, baseline vs candidate"). */
93
+ label: string;
94
+ /** The series, in the order of each row's `values`. */
95
+ series: readonly RowChartSeries[];
96
+ /** The rows, top to bottom, in the order given. */
97
+ rows: readonly RowChartRow<T>[];
98
+ /**
99
+ * `grouped`: one bar per series, under one another, to compare them row by row (before and after, A and
100
+ * B). `stacked`: one bar per row split into its series, for parts of a whole (user and kernel time).
101
+ * @defaultValue "grouped"
102
+ */
103
+ layout?: RowChartLayout;
104
+ /**
105
+ * The value a full-length bar stands for. Defaults to the largest bar (grouped) or row total (stacked).
106
+ * Pass the same `max` to charts that sit side by side so their bars compare.
107
+ */
108
+ max?: number;
109
+ /** How values are written. Defaults to the locale's numbers, compact from 10,000 (12.9K). */
110
+ format?: (value: number) => string;
111
+ /**
112
+ * Grouped: write the last series' change from the first after its value ("20.6 (+54.9%)"), for a
113
+ * baseline and a candidate.
114
+ */
115
+ delta?: boolean;
116
+ /**
117
+ * The text after each bar (grouped) or each stacked bar, in place of the chart's: add a share, a unit, a
118
+ * note. It's also read in each row's name.
119
+ */
120
+ valueText?: (value: RowChartValue<T>) => string;
121
+ /** The series legend above the rows. Defaults to on for two or more series. */
122
+ legend?: boolean;
123
+ /**
124
+ * The tooltip on a row: each series' value (and share, stacked) and the total. Also driven by the
125
+ * keyboard (arrow keys on the focused chart).
126
+ * @defaultValue true
127
+ */
128
+ tooltip?: boolean | RowChartTooltip<T>;
129
+ /** The words, in your wording or language (app-wide: `LocaleProvider messages.rowChart`). */
130
+ labels?: Partial<RowChartLabels>;
131
+ /** Extra classes on the root. */
132
+ class?: JSX.ClassValue;
133
+ }
134
+ /**
135
+ * Horizontal bars, one row per category: grouped to compare series row by row (a baseline and a
136
+ * candidate, with the change), or stacked to split each row into parts (user and kernel time). Labels
137
+ * with a note on the left, values after the bars, rows in groups, muted rows, a tooltip on hover and on
138
+ * the arrow keys. Plain DOM, so it renders on the server; each row is named in words.
139
+ *
140
+ * @example
141
+ * <RowChart
142
+ * label="Participants per vCPU"
143
+ * series={[{ label: "Baseline", tone: "neutral" }, { label: "Candidate" }]}
144
+ * rows={[{ label: "eu-central", values: [13.3, 20.6] }, { label: "us-east", values: [17.3, 22.3] }]}
145
+ * delta
146
+ * />
147
+ */
148
+ export declare function RowChart<T = unknown>(props: RowChartProps<T>): JSX.Element;
@@ -0,0 +1,216 @@
1
+ import * as stylex from "@stylexjs/stylex";
2
+ export declare const styles: Readonly<{
3
+ readonly root: Readonly<{
4
+ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
5
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
6
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
7
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
8
+ readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
9
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
10
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
11
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
12
+ }>;
13
+ readonly legend: Readonly<{
14
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
15
+ readonly flexWrap: stylex.StyleXClassNameFor<"flexWrap", "wrap">;
16
+ readonly columnGap: stylex.StyleXClassNameFor<"columnGap", string>;
17
+ readonly rowGap: stylex.StyleXClassNameFor<"rowGap", string>;
18
+ readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
19
+ readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
20
+ readonly listStyle: stylex.StyleXClassNameFor<"listStyle", "none">;
21
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
22
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
23
+ }>;
24
+ readonly legendItem: Readonly<{
25
+ readonly display: stylex.StyleXClassNameFor<"display", "inline-flex">;
26
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
27
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
28
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
29
+ }>;
30
+ readonly legendSwatch: Readonly<{
31
+ readonly display: stylex.StyleXClassNameFor<"display", "inline-flex">;
32
+ }>;
33
+ readonly legendNote: Readonly<{
34
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
35
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
36
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
37
+ readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
38
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
39
+ }>;
40
+ readonly plot: Readonly<{
41
+ readonly position: stylex.StyleXClassNameFor<"position", "relative">;
42
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
43
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
44
+ readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
45
+ readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "2px">;
46
+ readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "4px">;
47
+ readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", string>;
48
+ }>;
49
+ readonly rows: Readonly<{
50
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
51
+ readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "fit-content(40%) minmax(0, 1fr)">;
52
+ readonly columnGap: stylex.StyleXClassNameFor<"columnGap", string>;
53
+ readonly rowGap: stylex.StyleXClassNameFor<"rowGap", string>;
54
+ readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
55
+ readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
56
+ readonly listStyle: stylex.StyleXClassNameFor<"listStyle", "none">;
57
+ }>;
58
+ readonly row: Readonly<{
59
+ readonly position: stylex.StyleXClassNameFor<"position", "relative">;
60
+ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
61
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
62
+ readonly gridColumn: stylex.StyleXClassNameFor<"gridColumn", "1 / -1">;
63
+ readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "subgrid">;
64
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
65
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
66
+ readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", string>;
67
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
68
+ readonly marginInline: stylex.StyleXClassNameFor<"marginInline", `calc(-1 * ${stylex.StyleXVar<string>})`>;
69
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
70
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", unknown>;
71
+ readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "background-color">;
72
+ readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", string>;
73
+ }>;
74
+ readonly groupStart: Readonly<{
75
+ readonly marginBlockStart: stylex.StyleXClassNameFor<"marginBlockStart", string>;
76
+ readonly "::before": stylex.StyleXClassNameFor<"::before", {
77
+ readonly content: "''";
78
+ readonly position: "absolute";
79
+ readonly insetInline: stylex.StyleXVar<string>;
80
+ readonly top: `calc(-1 * (${stylex.StyleXVar<string>} + ${stylex.StyleXVar<string>}) / 2 - 0.5px)`;
81
+ readonly height: "1px";
82
+ readonly backgroundColor: {
83
+ readonly default: stylex.StyleXVar<string>;
84
+ readonly "@media (forced-colors: active)": "CanvasText";
85
+ };
86
+ }>;
87
+ }>;
88
+ readonly labelCell: Readonly<{
89
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
90
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
91
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
92
+ }>;
93
+ readonly label: Readonly<{
94
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
95
+ readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
96
+ readonly textOverflow: stylex.StyleXClassNameFor<"textOverflow", "ellipsis">;
97
+ readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
98
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
99
+ }>;
100
+ readonly labelMuted: Readonly<{
101
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
102
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
103
+ }>;
104
+ readonly note: Readonly<{
105
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
106
+ readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
107
+ readonly textOverflow: stylex.StyleXClassNameFor<"textOverflow", "ellipsis">;
108
+ readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
109
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
110
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
111
+ }>;
112
+ readonly bars: Readonly<{
113
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
114
+ readonly gap: stylex.StyleXClassNameFor<"gap", "2px">;
115
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
116
+ }>;
117
+ readonly line: Readonly<{
118
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
119
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
120
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
121
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
122
+ }>;
123
+ readonly bar: Readonly<{
124
+ readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 0>;
125
+ readonly height: stylex.StyleXClassNameFor<"height", "0.625rem">;
126
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "2px">;
127
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "var(--bar)">;
128
+ readonly forcedColorAdjust: stylex.StyleXClassNameFor<"forcedColorAdjust", "none">;
129
+ }>;
130
+ readonly stack: Readonly<{
131
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
132
+ readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 0>;
133
+ readonly gap: stylex.StyleXClassNameFor<"gap", "2px">;
134
+ readonly height: stylex.StyleXClassNameFor<"height", "0.875rem">;
135
+ readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
136
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "2px">;
137
+ }>;
138
+ readonly segment: Readonly<{
139
+ readonly flexBasis: stylex.StyleXClassNameFor<"flexBasis", 0>;
140
+ readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 1>;
141
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", "2px">;
142
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "var(--bar)">;
143
+ readonly forcedColorAdjust: stylex.StyleXClassNameFor<"forcedColorAdjust", "none">;
144
+ }>;
145
+ readonly barMuted: Readonly<{
146
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", `color-mix(in oklab, var(--bar) 45%, ${stylex.StyleXVar<string>})`>;
147
+ }>;
148
+ readonly value: Readonly<{
149
+ readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 0>;
150
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
151
+ readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
152
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
153
+ readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
154
+ readonly unicodeBidi: stylex.StyleXClassNameFor<"unicodeBidi", "plaintext">;
155
+ }>;
156
+ readonly valueStrong: Readonly<{
157
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
158
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
159
+ }>;
160
+ readonly tooltip: Readonly<{
161
+ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
162
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
163
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
164
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", "10rem">;
165
+ readonly maxWidth: stylex.StyleXClassNameFor<"maxWidth", "min(20rem, calc(100vw - 16px))">;
166
+ readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", string>;
167
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
168
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
169
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
170
+ readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", "1px">;
171
+ readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "solid">;
172
+ readonly borderColor: stylex.StyleXClassNameFor<"borderColor", string>;
173
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
174
+ readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", string>;
175
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
176
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
177
+ }>;
178
+ readonly tooltipHeading: Readonly<{
179
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
180
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
181
+ readonly paddingBlockEnd: stylex.StyleXClassNameFor<"paddingBlockEnd", string>;
182
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
183
+ }>;
184
+ readonly tooltipNote: Readonly<{
185
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
186
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
187
+ }>;
188
+ readonly tooltipRow: Readonly<{
189
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
190
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
191
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
192
+ }>;
193
+ readonly tooltipLabel: Readonly<{
194
+ readonly flexGrow: stylex.StyleXClassNameFor<"flexGrow", 1>;
195
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
196
+ }>;
197
+ readonly tooltipValue: Readonly<{
198
+ readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
199
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
200
+ readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
201
+ readonly unicodeBidi: stylex.StyleXClassNameFor<"unicodeBidi", "plaintext">;
202
+ }>;
203
+ readonly tooltipShare: Readonly<{
204
+ readonly minWidth: stylex.StyleXClassNameFor<"minWidth", "3rem">;
205
+ readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "end">;
206
+ readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
207
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
208
+ readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
209
+ readonly unicodeBidi: stylex.StyleXClassNameFor<"unicodeBidi", "plaintext">;
210
+ }>;
211
+ readonly empty: Readonly<{
212
+ readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
213
+ readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", string>;
214
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
215
+ }>;
216
+ }>;
@@ -0,0 +1,3 @@
1
+ export { SegmentedBar } from "./segmented-bar.js";
2
+ export type { SegmentedBarLabels, SegmentedBarMarker, SegmentedBarProps, SegmentedBarSegment, } from "./segmented-bar.js";
3
+ export type { ChartColor, ChartTone } from "../internal/types.js";
@@ -0,0 +1,65 @@
1
+ import type { JSX } from "@solidjs/web";
2
+ import type { ChartColor, ChartTone } from "../internal/types.js";
3
+ /** One part of the bar. */
4
+ export interface SegmentedBarSegment {
5
+ /** What the part is ("Passed", "Photos"). */
6
+ label: string;
7
+ /** Its amount. A missing or negative value counts as 0 and draws nothing; it keeps its legend row. */
8
+ value: number | null;
9
+ /**
10
+ * A status tone, for a breakdown by state (passed, failed, skipped): the kit's status colors, as Badge
11
+ * uses them. Ignored when `color` is set.
12
+ */
13
+ tone?: ChartTone;
14
+ /** The part's color: a chart token or any CSS color. Without `color` or `tone`, the chart tokens in order. */
15
+ color?: ChartColor;
16
+ }
17
+ /** A tick on the bar: a target, a limit, "you are here". */
18
+ export interface SegmentedBarMarker {
19
+ /** Where it sits, in the segments' units (out of `max`, or of the total). */
20
+ value: number;
21
+ /** Its text above the bar, also read at the end of the bar's name ("Goal: 80%"). */
22
+ label: string;
23
+ }
24
+ /** The words the bar writes. Also set app-wide with the kit's `LocaleProvider messages={{ segmentedBar }}`. */
25
+ export interface SegmentedBarLabels {
26
+ /** The rest of `max`, in the name and the legend ("Free"). */
27
+ remaining: string;
28
+ /** In place of the legend, and in the name, when there are no segments. */
29
+ empty: string;
30
+ }
31
+ export interface SegmentedBarProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "class"> {
32
+ /** What the bar shows ("Storage", "Test results"). Its name is this, then each part's share, written from the data. */
33
+ label: string;
34
+ /** The parts, in order from the start. */
35
+ segments: readonly SegmentedBarSegment[];
36
+ /**
37
+ * The whole, for "used of total" (84 GB of 100 GB): the rest stays empty track. Without it, the segments
38
+ * fill the bar (100%). A total above `max` fills the bar.
39
+ */
40
+ max?: number;
41
+ /** A tick with its own label: a target or a limit. */
42
+ marker?: SegmentedBarMarker;
43
+ /** A legend under the bar: each part's swatch, label, value and share (and the rest of `max`). */
44
+ legend?: boolean;
45
+ /** How values are written in the legend. Defaults to the locale's numbers, compact from 10,000. */
46
+ format?: (value: number) => string;
47
+ /**
48
+ * The bar's height in pixels.
49
+ * @defaultValue 8
50
+ */
51
+ height?: number;
52
+ /** The words, in your wording or language (app-wide: `LocaleProvider messages.segmentedBar`). */
53
+ labels?: Partial<SegmentedBarLabels>;
54
+ /** Extra classes on the root. */
55
+ class?: JSX.ClassValue;
56
+ }
57
+ /**
58
+ * One bar split into parts: a breakdown by category or status that fills the bar (100%), or parts "used of"
59
+ * a `max`, with an optional marker and a legend. The bar is an image named from the data ("Storage: Photos
60
+ * 42%, Video 30%, Remaining 28%"); the legend carries the values. Plain DOM, so it renders on the server.
61
+ *
62
+ * @example
63
+ * <SegmentedBar label="Test results" segments={[{ label: "Passed", value: 182, tone: "success" }, { label: "Failed", value: 6, tone: "danger" }]} legend />
64
+ */
65
+ export declare function SegmentedBar(props: SegmentedBarProps): JSX.Element;