@indxsearch/systm 2.21.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/dist/components/BarMeter/BarMeter.d.ts +51 -0
- package/dist/components/BarSlider/BarSlider.d.ts +25 -0
- package/dist/components/Chart/Chart.d.ts +47 -1
- package/dist/components/GroupedBars/GroupedBars.d.ts +28 -0
- package/dist/components/Heatmap/Heatmap.d.ts +35 -0
- package/dist/components/RadarChart/RadarChart.d.ts +35 -0
- package/dist/components/RadialChart/RadialChart.d.ts +47 -0
- package/dist/components/ScrubSlider/ScrubSlider.d.ts +23 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +27 -0
- package/dist/components/Stat/Stat.d.ts +13 -3
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +3 -1
- package/dist/components/TreeCanvas/TreeCanvas.d.ts +41 -0
- package/dist/components/Waffle/Waffle.d.ts +25 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.es.js +2667 -854
- package/dist/systm.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.22.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a848bf1: `BarMeter` `shape="ring"`: the same bars around a circle, from the top clockwise, with the value in the middle and the label beneath. `size` sets the diameter, 72px by default; 48 is the smallest that holds a short value and fits a Stat as its value, and from 96 the ceiling joins the value on a second line. `label` is now optional in both shapes.
|
|
8
|
+
- 1bcaa7f: `BarMeter` `segments`: the row as shares of a whole instead of a level, each segment its share of the bars in a tone of its own, its name and share above it and a hairline between. Holders by kind, documents by type. A segment under 8 % of the row gets no head, the last one apart, and `labels="legend"` lists all segments under the bars instead. `value` and `max` are optional, since the segments are the whole.
|
|
9
|
+
- 79f891e: `BarMeter` `zones`: levels from which the filled bars change colour, cool blue when idle, teal when fine, a warning from 70 % and the signal red from 85 %, in both shapes. One bar in each zone's colour marks where it starts, so the thresholds are seen before they are reached; `color` overrides them.
|
|
10
|
+
- 029a381: `BarMeter`: a level against its ceiling as a row of bars, the filled ones in the ink and the rest dim, with a label above and the value and ceiling below. For CPU pressure, memory in use, a quota: where ProgressBar is a percentage on its way to done, this goes up and down. `color` paints the filled bars, for a level past a threshold.
|
|
11
|
+
- a8c906a: `BarSlider`: a slider that is its own row. The fill runs from the left edge to the value and spans the full height, the label sits inside at the left, the value at the right, and the handle is a thin line at the fill's edge. Sized like a Button (`default` 40px, `micro` 30px), so a stack of settings lines up with fields. `stepMarks` draws a dot per step on the track, `format` shapes the value shown.
|
|
12
|
+
- c946a3c: `Chart`: `yAxis` ("left" or "right") puts round ticks on the value axis, each with a faint gridline, and widens the range to them; `yFormat` sets their text, compact by default (1.2k, 3M). `references` are levels to read the data against, a threshold, an average, a quota: each a dashed line with its label in a tag at the right, in the ink or in a colour such as the signal red for a limit. A reference outside the data pulls the range out to include it.
|
|
13
|
+
- 1e09a2a: `Chart`: `fill` per series. `solid` is the series colour, flat on a bar and faint under a line, so a single series reads as an area; `hatch`, `dots` and `checker` are drawn in the colour on the 2px pixel grid, so two or three series tell apart in one tone. A bar is solid unless told otherwise; a line stays a wire unless given an area. The legend shows a patterned series' pattern.
|
|
14
|
+
- f684405: `Chart`: `low` and `high` on a line series, one value per point, draw a band behind the line, faint in the series colour or in its pattern when `fill` is one; the tooltip adds the range under the value, named by `rangeLabel`. Latency as the median with its p5 to p95 spread, a forecast with its margin.
|
|
15
|
+
- 6e9b5f5: `Chart`: `stacked` puts a bar chart's series on top of each other in one bar per label, in series order from the baseline, so the bar's height is the total; the range follows the totals and the tooltip lists each part and the total.
|
|
16
|
+
- 7a0fa0c: `Chart`: `step` on a line series holds the value flat until the next point and then jumps, for a record count or a quota that changes on a date. `signal` on a reference makes it a limit: whatever lies above it is drawn in the signal red, bars and points alike.
|
|
17
|
+
- 24d1515: `GroupedBars`: thin bars in labelled groups across the width, a group a day and a bar an hour, or a group a week and a bar a day. A hairline marks where each group starts with its name and a figure above; a band under each group takes its colour when it is highlighted, so one group stands out; the sample labels sit under the bands, as many as fit; hover reads a bar.
|
|
18
|
+
- 2eb549c: `Heatmap`: a grid of pixel cells toned by value, columns of `rows` cells filled top to bottom then the next column, zero the empty tone and the rest four steps up to the ink, with column labels beneath and row labels at the left, and on hover the cell outlined with its `format` text in a tooltip beside it. `calendarCells(from, to, valueOf)` lays days out as weeks across and weekdays down, Monday first, with month labels. For days a dataset woke, searches by hour and weekday, any count per cell of a regular grid.
|
|
19
|
+
- 9f9190f: `RadarChart`: a shape across a few dimensions, an axis a dimension with its name at the end and faint rings for the scale, a series as a polygon through its values with the Chart's square markers and a solid or patterned fill, several series with a legend, a max and a format per axis for dimensions in their own units, and hover on the nearest axis listing every series' value. For comparing profiles: a dataset this month against last.
|
|
20
|
+
- e542d87: `RadialChart`: bars around a clock face from the top clockwise, around a hollow centre that can hold a Stat. One series, a bar a sample with its length the value, a thin guide a sample to the rim and a dashed line at the start; several `series` sharing each sample's slot, each in its colour, with a legend; or `groups`, the rose, a wedge per group with its radius the value over a dim wedge, the name and value upright in it. `inverse` hangs the bars from the rim, growing inward over the ticks, a dial with its reading in the centre. Hover reads a bar by its angle, with `format` for the tooltip. The hours of a day, searches and asks by hour, a handful of kinds compared.
|
|
21
|
+
- 9e71991: `ScrubSlider`: a slider with no end. A ruler of ticks scrolls under a fixed handle, one step per tick as far as the drag goes, with a number field at the right that shows the value and takes one typed. `min` and `max` are optional bounds; arrow keys step, Shift steps ten.
|
|
22
|
+
- 0e126c1: `SegmentedControl`: one choice from a few, side by side with the chosen cell filled like a primary Button and the rest on the faint surface tone and touching, the button Tabs look with no gap and without the navigation, for the period of a chart, the interval of a graph, the type of a view. A cell is a word, an icon, or both; `size` micro (24px) or default (30px); `stretch` shares the width; a cell may carry a badge as a Tab does; arrow keys move between cells.
|
|
23
|
+
- 3dcb304: `Stat` `figure`: a graphic under the label, the value and foot beside it, for a BarMeter ring that carries the number. `value` is optional when a figure does.
|
|
24
|
+
- 13eb480: `Stat`: a `labelIcon`, a pixl icon before the label in the label's tone, for a row of tiles read at a glance.
|
|
25
|
+
- ce4a08f: `ToggleSwitch` takes `marks`: a 0 on the track when off and a | when on, the marks of a power switch, drawn in whole pixels.
|
|
26
|
+
- 373382a: `TreeCanvas`: a hierarchy as a horizontal tree of pills, a node its name and a count, children fanned out to the right on soft connectors, the chosen node and the path to it lit, the rest collapsed until opened. For a catalogue's categories. Arrow keys move between nodes, right opens and left closes; a node with many children shows the first fifty and a step to the rest; a list view gives the same tree as nested rows for a phone.
|
|
27
|
+
- c659761: `Waffle`: shares of a whole as a grid of pixel squares, each segment its share of the cells filled column by column from the left, the first in the ink and the rest down the tone ladder, with a legend beneath. `columns`, `rows` and `cell` set the shape (20 by 5 at 4px by default, so a cell is a percent); the ladder has four steps, so a fifth segment, or one that means something, takes a `color`. Where a pie would be, this is the pixel version.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- b6456d0: `Stat`: three rows, the label at the top, the value in the middle and the foot at the bottom. The middle takes the height the other two leave and centres what it holds, so in a `StatGroup` the labels line up at the top, the feet at the bottom, and a ring, a number and a chip sit on one middle line. A foot without a figure now spans the tile's width.
|
|
32
|
+
|
|
33
|
+
## 2.21.1
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Alert, Modal, Select and Breadcrumbs draw their icons at 14px. Pixel icons are a 7×5 grid and are only sharp at a multiple of seven, so at 12 or 16px they looked uneven on a standard (1x) screen.
|
|
38
|
+
|
|
3
39
|
## 2.21.0
|
|
4
40
|
|
|
5
41
|
### Minor Changes
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type BarMeterShape = 'bar' | 'ring';
|
|
3
|
+
/** A level from which the meter changes colour: warning from 70 %, the signal red from 85 %. */
|
|
4
|
+
export interface BarMeterZone {
|
|
5
|
+
/** Where the zone starts, as a share of max, 0 to 1. */
|
|
6
|
+
from: number;
|
|
7
|
+
color: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BarMeterSegment {
|
|
10
|
+
label: ReactNode;
|
|
11
|
+
value: number;
|
|
12
|
+
/** The segment's colour; without it, the tone ladder from the ink down, four steps. */
|
|
13
|
+
color?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface BarMeterProps {
|
|
16
|
+
/** What is measured: "CPU pressure", "Memory". A ring inside a Stat leaves it to the Stat. */
|
|
17
|
+
label?: ReactNode;
|
|
18
|
+
/** The level; with segments, left out: the segments are the whole. */
|
|
19
|
+
value?: number;
|
|
20
|
+
max?: number;
|
|
21
|
+
/**
|
|
22
|
+
* The row as shares of a whole: each segment its share of the bars in its own tone, with its
|
|
23
|
+
* name and share above it and a hairline between. Holders by kind, documents by type. The
|
|
24
|
+
* row shape only; value, max and the foot are not used.
|
|
25
|
+
*/
|
|
26
|
+
segments?: BarMeterSegment[];
|
|
27
|
+
/**
|
|
28
|
+
* Where the segments' names and shares go: 'heads' above each segment (a segment under 8 %
|
|
29
|
+
* of the row gets none, the last one apart), or 'legend', a list under the bars, for many or
|
|
30
|
+
* narrow segments.
|
|
31
|
+
*/
|
|
32
|
+
labels?: 'heads' | 'legend';
|
|
33
|
+
/** The value as shown at the left; defaults to the number itself. */
|
|
34
|
+
format?: (value: number) => ReactNode;
|
|
35
|
+
/** The ceiling as shown at the right; defaults to "of" and the formatted max. */
|
|
36
|
+
maxLabel?: ReactNode;
|
|
37
|
+
/** The filled bars' colour, for a level that has become a problem: the signal red past a threshold. Overrides the zones. */
|
|
38
|
+
color?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Levels from which the filled bars change colour: cool blue when idle, teal when fine, a
|
|
41
|
+
* warning from 70 %, the signal red from 85 %. One bar in each zone's colour marks where it
|
|
42
|
+
* starts, so the thresholds can be seen before they are reached.
|
|
43
|
+
*/
|
|
44
|
+
zones?: BarMeterZone[];
|
|
45
|
+
/** A row of bars (default) or a ring of them. */
|
|
46
|
+
shape?: BarMeterShape;
|
|
47
|
+
/** The ring's diameter in pixels; 72 by default, 48 the smallest that holds a value. From 96 the ceiling joins the value in the middle. The row ignores it. */
|
|
48
|
+
size?: number;
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
export declare function BarMeter({ label, value, max, segments, labels, format, maxLabel, color, zones, shape, size, className, }: BarMeterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type BarSliderSize = 'micro' | 'default';
|
|
3
|
+
export interface BarSliderProps {
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
value: number;
|
|
8
|
+
onChange: (value: number) => void;
|
|
9
|
+
onFinalChange?: (value: number) => void;
|
|
10
|
+
/** Shown inside the bar, at the left. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** The value as shown at the right; defaults to the number itself. */
|
|
13
|
+
format?: (value: number) => React.ReactNode;
|
|
14
|
+
/** Hide the value at the right. */
|
|
15
|
+
showValue?: boolean;
|
|
16
|
+
/** A dot at every step, on the part of the track the fill has not reached. */
|
|
17
|
+
stepMarks?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** 'default' is 40px like a default Button, 'micro' is 30px. */
|
|
20
|
+
size?: BarSliderSize;
|
|
21
|
+
className?: string;
|
|
22
|
+
'aria-label'?: string;
|
|
23
|
+
id?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const BarSlider: React.FC<BarSliderProps>;
|
|
@@ -1,8 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a series is filled: a bar, or the area under a line. 'solid' is the series colour, flat
|
|
3
|
+
* on a bar and faint under a line; the patterns are drawn in the series colour on the 2px pixel
|
|
4
|
+
* grid, so two series tell apart in one tone. 'none' leaves a line as a line.
|
|
5
|
+
*/
|
|
6
|
+
export type ChartFill = 'none' | 'solid' | 'hatch' | 'dots' | 'checker';
|
|
1
7
|
export interface ChartSeries {
|
|
2
8
|
label: string;
|
|
3
9
|
data: number[];
|
|
4
10
|
color?: string;
|
|
5
11
|
hoverColor?: string;
|
|
12
|
+
/** Bars are 'solid' unless told otherwise; a line is 'none', a wire, unless given an area. */
|
|
13
|
+
fill?: ChartFill;
|
|
14
|
+
/**
|
|
15
|
+
* Lines only: a range around the line, one value per point, drawn as a band behind it. The
|
|
16
|
+
* band is faint in the series colour, or its pattern when `fill` is one; the area under the
|
|
17
|
+
* line is then not drawn. Latency as p50 with p5 to p95, a forecast with its spread.
|
|
18
|
+
*/
|
|
19
|
+
low?: number[];
|
|
20
|
+
high?: number[];
|
|
21
|
+
/** What the range is, for the tooltip: "p5 to p95". "Range" when left out. */
|
|
22
|
+
rangeLabel?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Lines only: the value holds flat until the next point and then jumps, for what does not
|
|
25
|
+
* move between samples: a record count, a state, a quota that changes on a date.
|
|
26
|
+
*/
|
|
27
|
+
step?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** A level to read the data against: a threshold, an average, a quota, the value now. */
|
|
30
|
+
export interface ChartReference {
|
|
31
|
+
value: number;
|
|
32
|
+
/** Shown in a tag at the right end of the line; the formatted value when left out. */
|
|
33
|
+
label?: string;
|
|
34
|
+
/** The line's and the tag's colour: the signal red for a limit. The ink by default. */
|
|
35
|
+
color?: string;
|
|
36
|
+
/** A limit: whatever lies above the line is drawn in the signal red, bars and points alike. */
|
|
37
|
+
signal?: boolean;
|
|
6
38
|
}
|
|
7
39
|
/** A point where something happened (a change, a release), and what it was. */
|
|
8
40
|
export interface ChartMarker {
|
|
@@ -21,5 +53,19 @@ export interface ChartProps {
|
|
|
21
53
|
* listed in its tooltip. Several may share a point.
|
|
22
54
|
*/
|
|
23
55
|
markers?: ChartMarker[];
|
|
56
|
+
/**
|
|
57
|
+
* A value axis at the left or right: round ticks with a faint gridline each, the range widened
|
|
58
|
+
* to the ticks. Without it the chart keeps its midline and reads by the tooltip.
|
|
59
|
+
*/
|
|
60
|
+
yAxis?: 'none' | 'left' | 'right';
|
|
61
|
+
/** The tick labels, and a reference's label when it has none; compact by default: 1.2k, 3M. */
|
|
62
|
+
yFormat?: (value: number) => string;
|
|
63
|
+
/** Levels to read the data against, each a dashed line with its label in a tag at the right. */
|
|
64
|
+
references?: ChartReference[];
|
|
65
|
+
/**
|
|
66
|
+
* Bars only: the series on top of each other in one bar per label, in series order from the
|
|
67
|
+
* baseline, so the bar's height is the total. The tooltip lists each part and the total.
|
|
68
|
+
*/
|
|
69
|
+
stacked?: boolean;
|
|
24
70
|
}
|
|
25
|
-
export declare function Chart({ series, labels, type, height, showLegend, className, markers, }: ChartProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export declare function Chart({ series, labels, type, height, showLegend, className, markers, yAxis, yFormat, references, stacked, }: ChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface BarGroup {
|
|
3
|
+
label: string;
|
|
4
|
+
/** A figure beside the name: the group's total, its share. */
|
|
5
|
+
sublabel?: ReactNode;
|
|
6
|
+
values: number[];
|
|
7
|
+
/** The bars' and the band's colour when highlighted; the teal is the usual choice. */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** This group stands out: its bars and band in its colour, the rest in the ink. */
|
|
10
|
+
highlight?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface GroupedBarsProps {
|
|
13
|
+
groups: BarGroup[];
|
|
14
|
+
/** What each sample in a group is, for the tooltip and the labels under the band: the hours. */
|
|
15
|
+
labels?: string[];
|
|
16
|
+
/** The bars' height in pixels; 120 by default. */
|
|
17
|
+
height?: number;
|
|
18
|
+
/** The value that reaches the top; the largest by default. */
|
|
19
|
+
max?: number;
|
|
20
|
+
/** The gap between groups in pixels; 2 by default, so the groups read as one run parted by hairlines. */
|
|
21
|
+
gap?: number;
|
|
22
|
+
/** The tooltip's text for a value. The number by default. */
|
|
23
|
+
format?: (value: number, group: number, index: number) => string;
|
|
24
|
+
/** A name for assistive technology: "Searches by hour, this week". */
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function GroupedBars({ groups, labels, height, max, gap, format, 'aria-label': ariaLabel, className }: GroupedBarsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface HeatmapLabel {
|
|
3
|
+
/** The column (or row) the label sits at, from 0. */
|
|
4
|
+
at: number;
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface HeatmapProps {
|
|
8
|
+
/** One value per cell, column by column, top to bottom. null is a gap: no cell drawn. */
|
|
9
|
+
values: (number | null)[];
|
|
10
|
+
/** Cells down; 7 by default, a week. */
|
|
11
|
+
rows?: number;
|
|
12
|
+
/** The value that is the ink; the largest value by default. */
|
|
13
|
+
max?: number;
|
|
14
|
+
/** Labels beneath the grid, at the columns they name: months, hours. */
|
|
15
|
+
columnLabels?: HeatmapLabel[];
|
|
16
|
+
/** Labels left of the grid, at the rows they name: weekdays. */
|
|
17
|
+
rowLabels?: HeatmapLabel[];
|
|
18
|
+
/** A cell's side in pixels; 6 by default, with a 2px gap. */
|
|
19
|
+
cell?: number;
|
|
20
|
+
/** What a cell says on hover, in a tooltip beside it: the value and what it is. Nothing by default. */
|
|
21
|
+
format?: (value: number, index: number) => string;
|
|
22
|
+
/** A name for assistive technology: "Days woken, last six months". */
|
|
23
|
+
'aria-label'?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function levelOf(value: number, max: number): number;
|
|
27
|
+
export declare function Heatmap({ values, rows, max, columnLabels, rowLabels, cell, format, 'aria-label': ariaLabel, className, }: HeatmapProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export interface CalendarCells {
|
|
29
|
+
values: (number | null)[];
|
|
30
|
+
columnLabels: HeatmapLabel[];
|
|
31
|
+
rowLabels: HeatmapLabel[];
|
|
32
|
+
/** The day each cell is, by index; null where the cell is a gap. */
|
|
33
|
+
dates: (Date | null)[];
|
|
34
|
+
}
|
|
35
|
+
export declare function calendarCells(from: Date, to: Date, valueOf: (day: Date) => number): CalendarCells;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type RadarFill = 'none' | 'solid' | 'hatch' | 'dots' | 'checker';
|
|
2
|
+
export interface RadarAxis {
|
|
3
|
+
label: string;
|
|
4
|
+
/** This axis's own ceiling, for a dimension in its own unit; the chart's max otherwise. */
|
|
5
|
+
max?: number;
|
|
6
|
+
/** This axis's value as shown in the tooltip; the chart's format otherwise. */
|
|
7
|
+
format?: (value: number) => string;
|
|
8
|
+
}
|
|
9
|
+
export interface RadarSeries {
|
|
10
|
+
label: string;
|
|
11
|
+
/** One value an axis, in the axes' order. */
|
|
12
|
+
values: number[];
|
|
13
|
+
/** The line's and markers' colour; the first series is the ink, the rest need one. */
|
|
14
|
+
color?: string;
|
|
15
|
+
/** The shape's fill; 'solid' by default, faint in the colour. */
|
|
16
|
+
fill?: RadarFill;
|
|
17
|
+
}
|
|
18
|
+
export interface RadarChartProps {
|
|
19
|
+
axes: RadarAxis[];
|
|
20
|
+
series: RadarSeries[];
|
|
21
|
+
/** The diameter of the rim in pixels, the names outside it; 240 by default. */
|
|
22
|
+
size?: number;
|
|
23
|
+
/** The value that reaches the rim on every axis without a max of its own; the largest by default. */
|
|
24
|
+
max?: number;
|
|
25
|
+
/** The scale rings inside the rim; 3 by default. */
|
|
26
|
+
rings?: number;
|
|
27
|
+
/** A value as shown in the tooltip; the number by default. */
|
|
28
|
+
format?: (value: number) => string;
|
|
29
|
+
/** The legend under the chart with several series; on by default. */
|
|
30
|
+
showLegend?: boolean;
|
|
31
|
+
/** A name for assistive technology: "Dataset profile, this month and last". */
|
|
32
|
+
'aria-label'?: string;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function RadarChart({ axes, series, size, max, rings, format, showLegend, 'aria-label': ariaLabel, className, }: RadarChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface RadialSeries {
|
|
3
|
+
label: string;
|
|
4
|
+
values: number[];
|
|
5
|
+
/** The bars' colour; the first series is the ink, the rest need one. */
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface RadialGroup {
|
|
9
|
+
label: string;
|
|
10
|
+
value: number;
|
|
11
|
+
/** The sector's colour; the ink by default. */
|
|
12
|
+
color?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface RadialChartProps {
|
|
15
|
+
/** One series: a value a sample, from the top clockwise. */
|
|
16
|
+
values?: number[];
|
|
17
|
+
/** Several series over the same samples, each in its colour; the first is the ink. */
|
|
18
|
+
series?: RadialSeries[];
|
|
19
|
+
/** What each sample is, for the tooltip: a date, an hour. The index when left out. */
|
|
20
|
+
labels?: string[];
|
|
21
|
+
/** The rose: a wedge a group, its radius the group's value, the name and value in it. */
|
|
22
|
+
groups?: RadialGroup[];
|
|
23
|
+
/** The gap between the rose's wedges, in pixels, the same at the hollow and the rim; 4 by default. */
|
|
24
|
+
gap?: number;
|
|
25
|
+
/** The rose's corner radius in pixels; 8 by default, less on a small face. */
|
|
26
|
+
rounding?: number;
|
|
27
|
+
/** The diameter in pixels; 240 by default. */
|
|
28
|
+
size?: number;
|
|
29
|
+
/** The hollow centre's share of the radius; 0.4 by default. */
|
|
30
|
+
hollow?: number;
|
|
31
|
+
/** Bars hung from the rim, growing inward over the ticks, as a dial; the value sits in the centre. */
|
|
32
|
+
inverse?: boolean;
|
|
33
|
+
/** The value that reaches the rim; the largest by default. */
|
|
34
|
+
max?: number;
|
|
35
|
+
/** The bars' colour for one series; the ink by default. The hovered bar is always the ink. */
|
|
36
|
+
color?: string;
|
|
37
|
+
/** The tooltip's text for a value: the value and what it is. Nothing by default. */
|
|
38
|
+
format?: (value: number, index: number) => string;
|
|
39
|
+
/** What sits in the hollow centre: a total, a Stat. */
|
|
40
|
+
centre?: ReactNode;
|
|
41
|
+
/** The legend under several series; on by default. */
|
|
42
|
+
showLegend?: boolean;
|
|
43
|
+
/** A name for assistive technology: "Searches per day, last year". */
|
|
44
|
+
'aria-label'?: string;
|
|
45
|
+
className?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function RadialChart({ values, series, labels, groups, gap, rounding, size, hollow, inverse, max, color, format, centre, showLegend, 'aria-label': ariaLabel, className, }: RadialChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ScrubSliderProps {
|
|
3
|
+
value: number;
|
|
4
|
+
onChange: (value: number) => void;
|
|
5
|
+
/** Called when a drag ends or the field commits. */
|
|
6
|
+
onFinalChange?: (value: number) => void;
|
|
7
|
+
/** The value moves by this per tick (and per arrow key); Shift moves ten. */
|
|
8
|
+
step?: number;
|
|
9
|
+
/** Bounds are optional: without them the slider has no end. */
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
/** Shown at the left, outside the ruler. */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** A fixed width for the label, as CSS, so a stack of sliders lines up its rulers. */
|
|
15
|
+
labelWidth?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Width of the number field, as CSS; 70px by default. */
|
|
18
|
+
fieldWidth?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
'aria-label'?: string;
|
|
21
|
+
id?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const ScrubSlider: React.FC<ScrubSliderProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SegmentedItem<T extends string = string> {
|
|
3
|
+
value: T;
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
/** The cell's name when it is only an icon. */
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** A small count after the label, as on a Tab: the signal red asks for attention, 'info' is information. */
|
|
10
|
+
badge?: ReactNode;
|
|
11
|
+
badgeTone?: 'signal' | 'info';
|
|
12
|
+
}
|
|
13
|
+
export type SegmentedSize = 'micro' | 'default';
|
|
14
|
+
export interface SegmentedControlProps<T extends string = string> {
|
|
15
|
+
items: SegmentedItem<T>[];
|
|
16
|
+
value: T;
|
|
17
|
+
onChange: (value: T) => void;
|
|
18
|
+
/** 'micro' is 24px tall, for a panel header; 'default' 30px, the height of a micro Tab. */
|
|
19
|
+
size?: SegmentedSize;
|
|
20
|
+
/** Cells share the width equally instead of taking their content's. */
|
|
21
|
+
stretch?: boolean;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** What the choice is: "Period". */
|
|
24
|
+
'aria-label'?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function SegmentedControl<T extends string = string>({ items, value, onChange, size, stretch, disabled, 'aria-label': ariaLabel, className, }: SegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,11 +4,21 @@ import { ReactElement, ReactNode } from 'react';
|
|
|
4
4
|
* 28, 35. The value is set at 24px; 28 wide (20 tall) sits on its cap height.
|
|
5
5
|
*/
|
|
6
6
|
export declare const STAT_ICON_SIZE = 28;
|
|
7
|
+
/** Two cells of the pixl grid: 14 wide, 10 tall, on the label's x-height. */
|
|
8
|
+
export declare const STAT_LABEL_ICON_SIZE = 14;
|
|
7
9
|
export interface StatProps {
|
|
8
10
|
/** What the number is: "Searches", "Click-through". */
|
|
9
11
|
label: ReactNode;
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
+
/** A pixl icon before the label, at STAT_LABEL_ICON_SIZE in the label's tone: what the tile is
|
|
13
|
+
* about, a search, a cart, a CPU, for a row of tiles read at a glance. */
|
|
14
|
+
labelIcon?: ReactElement<{
|
|
15
|
+
size?: number | string;
|
|
16
|
+
color?: string;
|
|
17
|
+
}>;
|
|
18
|
+
/** The number, formatted; or a chip, for a state. Left out when the figure carries it. */
|
|
19
|
+
value?: ReactNode;
|
|
20
|
+
/** A graphic under the label, the value and foot beside it: a BarMeter ring with the number in it. */
|
|
21
|
+
figure?: ReactNode;
|
|
12
22
|
/** A pixl icon before the value, for a state ("Up", "Key set"): drawn at STAT_ICON_SIZE in the value's colour. */
|
|
13
23
|
icon?: ReactElement<{
|
|
14
24
|
size?: number | string;
|
|
@@ -23,7 +33,7 @@ export interface StatProps {
|
|
|
23
33
|
className?: string;
|
|
24
34
|
}
|
|
25
35
|
/** One number with its label, on the Base surface: a KPI, a count, a state. Put several in a StatGroup. */
|
|
26
|
-
export declare function Stat({ label, value, icon, color, hint, children, className }: StatProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare function Stat({ label, labelIcon, value, figure, icon, color, hint, children, className }: StatProps): import("react/jsx-runtime").JSX.Element;
|
|
27
37
|
export interface StatGroupProps {
|
|
28
38
|
children: ReactNode;
|
|
29
39
|
/**
|
|
@@ -6,8 +6,10 @@ type ToggleSwitchProps = {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
label?: string;
|
|
8
8
|
'aria-label'?: string;
|
|
9
|
-
/** `positive` turns the track
|
|
9
|
+
/** `positive` turns the track blue (teal in dark mode) when on, for settings where on versus off must be seen at a glance. */
|
|
10
10
|
variant?: 'default' | 'positive';
|
|
11
|
+
/** Draws a 0 on the track when off and a | when on, the marks of a power switch, in whole pixels. */
|
|
12
|
+
marks?: boolean;
|
|
11
13
|
};
|
|
12
14
|
export declare const ToggleSwitch: React.FC<ToggleSwitchProps>;
|
|
13
15
|
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface TreeNode {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** Shown in a chip beside the name: products in the category. */
|
|
6
|
+
count?: number;
|
|
7
|
+
children?: TreeNode[];
|
|
8
|
+
/** Marks after the count: a boost, a note. 14px pixl icons, each with a title. */
|
|
9
|
+
marks?: {
|
|
10
|
+
icon: ReactNode;
|
|
11
|
+
title: string;
|
|
12
|
+
}[];
|
|
13
|
+
/** Drawn dim: hidden from search, empty. */
|
|
14
|
+
muted?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface TreeCanvasProps {
|
|
17
|
+
roots: TreeNode[];
|
|
18
|
+
/** The chosen node's id. */
|
|
19
|
+
selected?: string;
|
|
20
|
+
onSelect?: (id: string) => void;
|
|
21
|
+
/** The ids open at first; the roots when left out. Opening is kept inside after that. */
|
|
22
|
+
defaultExpanded?: string[];
|
|
23
|
+
/** 'tree' draws the canvas; 'list' the same as nested rows. */
|
|
24
|
+
view?: 'tree' | 'list';
|
|
25
|
+
/** Children shown before the step to the rest; 50 by default. */
|
|
26
|
+
maxChildren?: number;
|
|
27
|
+
/** The count as shown; the number by default. */
|
|
28
|
+
format?: (count: number) => string;
|
|
29
|
+
/** A filter: only nodes it accepts stay, with the path down to each; an ancestor kept only as
|
|
30
|
+
* the way down is drawn muted, and a branch holding a match is opened. "Only boosted." */
|
|
31
|
+
visible?: (node: TreeNode) => boolean;
|
|
32
|
+
/** The canvas drawn at this scale, 1 by default: 0.5 shows twice the tree in the same room. */
|
|
33
|
+
zoom?: number;
|
|
34
|
+
/** When set or changed, the tree is opened to this many levels and closed below: 1 shows the
|
|
35
|
+
* roots, 2 their children. Left out, the opening is the component's own. */
|
|
36
|
+
openDepth?: number;
|
|
37
|
+
/** A name for assistive technology: "Categories of shop". */
|
|
38
|
+
'aria-label'?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function TreeCanvas({ roots, selected, onSelect, defaultExpanded, view, maxChildren, format, visible, zoom, openDepth, 'aria-label': ariaLabel, className, }: TreeCanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface WaffleSegment {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
value: number;
|
|
5
|
+
/** The segment's colour; without it, the tone ladder from the ink down, four steps, so a fifth segment needs one. */
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface WaffleProps {
|
|
9
|
+
segments: WaffleSegment[];
|
|
10
|
+
/** Cells across; 20 by default. */
|
|
11
|
+
columns?: number;
|
|
12
|
+
/** Cells down; 5 by default. */
|
|
13
|
+
rows?: number;
|
|
14
|
+
/** A cell's side in pixels; 4 by default, with a 2px gap. */
|
|
15
|
+
cell?: number;
|
|
16
|
+
/** The share as shown in the legend; defaults to a whole percent. */
|
|
17
|
+
format?: (fraction: number, value: number) => ReactNode;
|
|
18
|
+
/** The legend beneath the grid; on by default. */
|
|
19
|
+
legend?: boolean;
|
|
20
|
+
/** A name for assistive technology: "Portfolio by holding". */
|
|
21
|
+
'aria-label'?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function allocateCells(values: number[], total: number): number[];
|
|
25
|
+
export declare function Waffle({ segments, columns, rows, cell, format, legend, 'aria-label': ariaLabel, className, }: WaffleProps): import("react/jsx-runtime").JSX.Element;
|