@panneau/ui 5.0.0-alpha.35 → 5.0.0-alpha.37
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/README.md +8 -2
- package/dist/bar-chart/BarChart.css +76 -0
- package/dist/bar-chart/BarChart.d.ts +33 -0
- package/dist/bar-chart/BarChart.d.ts.map +1 -0
- package/dist/bar-chart/BarChart.js +151 -0
- package/dist/bar-chart/BarChart.js.map +1 -0
- package/dist/bar-chart/BarChart.module.js +26 -0
- package/dist/bar-chart/BarChart.module.js.map +1 -0
- package/dist/bar-chart/tokens.d.ts +3 -0
- package/dist/bar-chart/tokens.d.ts.map +1 -0
- package/dist/bar-chart/tokens.js +17 -0
- package/dist/bar-chart/tokens.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/line-chart/LineChart.css +223 -24
- package/dist/line-chart/LineChart.d.ts +45 -10
- package/dist/line-chart/LineChart.d.ts.map +1 -1
- package/dist/line-chart/LineChart.js +580 -265
- package/dist/line-chart/LineChart.js.map +1 -1
- package/dist/line-chart/LineChart.module.js +42 -5
- package/dist/line-chart/LineChart.module.js.map +1 -1
- package/dist/line-chart/geometry.d.ts +37 -0
- package/dist/line-chart/geometry.d.ts.map +1 -0
- package/dist/line-chart/geometry.js +115 -0
- package/dist/line-chart/geometry.js.map +1 -0
- package/dist/line-chart/tokens.d.ts +1 -1
- package/dist/line-chart/tokens.d.ts.map +1 -1
- package/dist/line-chart/tokens.js +11 -7
- package/dist/line-chart/tokens.js.map +1 -1
- package/dist/meter/Meter.css +23 -0
- package/dist/meter/Meter.d.ts +26 -0
- package/dist/meter/Meter.d.ts.map +1 -0
- package/dist/meter/Meter.js +99 -0
- package/dist/meter/Meter.js.map +1 -0
- package/dist/meter/Meter.module.js +16 -0
- package/dist/meter/Meter.module.js.map +1 -0
- package/dist/meter/tokens.d.ts +3 -0
- package/dist/meter/tokens.d.ts.map +1 -0
- package/dist/meter/tokens.js +15 -0
- package/dist/meter/tokens.js.map +1 -0
- package/dist/stat/Stat.css +4 -0
- package/dist/stat/Stat.d.ts +11 -3
- package/dist/stat/Stat.d.ts.map +1 -1
- package/dist/stat/Stat.js +67 -42
- package/dist/stat/Stat.js.map +1 -1
- package/dist/stat/Stat.module.js +3 -1
- package/dist/stat/Stat.module.js.map +1 -1
- package/dist/theme/components.d.ts +3 -1
- package/dist/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +4 -0
- package/dist/theme/components.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -249,11 +249,17 @@ Each default categorical color reaches 3:1 against the surface (WCAG non-text co
|
|
|
249
249
|
|
|
250
250
|
```tsx
|
|
251
251
|
<Stat label="Overdue" value={3} help="Since Monday" tone="danger" href="/entries?filter[late]=1" />
|
|
252
|
-
<LineChart
|
|
252
|
+
<LineChart
|
|
253
|
+
label="Entries per day"
|
|
254
|
+
points={[
|
|
255
|
+
{ label: 'October 5, 2026', shortLabel: 'Oct 5', value: 4 },
|
|
256
|
+
{ label: 'October 6, 2026', shortLabel: 'Oct 6', value: 8 },
|
|
257
|
+
]}
|
|
258
|
+
/>
|
|
253
259
|
```
|
|
254
260
|
|
|
255
261
|
- `Stat` shows a number for the locale (`format` takes the options of `Intl.NumberFormat`), what it counts above it and its help under it. A `tone` colors the number only when it calls for attention: the help says why.
|
|
256
|
-
- `LineChart` draws a
|
|
262
|
+
- `LineChart` draws a curve and the area under it on a categorical chart color (`color`, from 0), a scale of round graduations, dates under it and the last value at the end of the line ([decision 0085](../../docs/decisions/0085-readable-line-charts.md)). `axisLabel`, `showMax`, `showLast`, `showAxis`, `domain` and `formatTick` fit it to its data; `curve="linear"` draws straight segments. `isInteractive` shows the value of the point under the pointer or chosen with the arrow keys, for a long series. The plot is hidden from assistive technologies, which read the values in a table.
|
|
257
263
|
- Both draw a skeleton of their shape while their `value` or `points` are `undefined`.
|
|
258
264
|
|
|
259
265
|
### Checking a theme
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.panneau-bar-chart-chart {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--panneau-bar-chart-gap, var(--panneau-space-3));
|
|
5
|
+
min-width: 0;
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
list-style: none;
|
|
9
|
+
font-size: var(--panneau-bar-chart-font-size, var(--panneau-font-size-sm));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.panneau-bar-chart-row {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--panneau-space-1);
|
|
16
|
+
min-width: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.panneau-bar-chart-text {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: baseline;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
gap: var(--panneau-space-3);
|
|
24
|
+
min-width: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.panneau-bar-chart-label {
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
color: var(--panneau-color-text);
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
text-overflow: ellipsis;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
a.panneau-bar-chart-label:hover,
|
|
36
|
+
a.panneau-bar-chart-label[data-hovered] {
|
|
37
|
+
text-decoration: underline;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.panneau-bar-chart-label[data-focus-visible] {
|
|
41
|
+
outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
|
|
42
|
+
outline-offset: 2px;
|
|
43
|
+
border-radius: var(--panneau-radius-sm);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.panneau-bar-chart-value {
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
font-variant-numeric: var(--panneau-font-numeric);
|
|
49
|
+
font-weight: var(--panneau-font-weight-medium);
|
|
50
|
+
color: var(--panneau-color-text);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.panneau-bar-chart-track {
|
|
54
|
+
height: var(--panneau-bar-chart-bar-height, 0.5rem);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* A bar on the categorical chart color of the chart, or the solid color of its tone. */
|
|
58
|
+
.panneau-bar-chart-bar {
|
|
59
|
+
height: 100%;
|
|
60
|
+
min-width: 2px;
|
|
61
|
+
background-color: var(--_panneau-bar-chart-color);
|
|
62
|
+
border-radius: var(--panneau-bar-chart-bar-radius, var(--panneau-radius-full));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.panneau-bar-chart-toned .panneau-bar-chart-bar {
|
|
66
|
+
background-color: var(--panneau-tone-solid);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* The rest, after the parts: it steps back. */
|
|
70
|
+
.panneau-bar-chart-other .panneau-bar-chart-label {
|
|
71
|
+
color: var(--panneau-color-text-muted);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.panneau-bar-chart-other .panneau-bar-chart-bar {
|
|
75
|
+
background-color: var(--panneau-color-border-control);
|
|
76
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Tone } from '../theme/tones.js';
|
|
2
|
+
/** A bar of a `BarChart`: a part of the total. */
|
|
3
|
+
export interface BarChartItem {
|
|
4
|
+
/** What the part is: `Failed`. */
|
|
5
|
+
label: string;
|
|
6
|
+
value: number;
|
|
7
|
+
/** Colors the bar with the solid color of a tone, as the tone of an option of a `select`. */
|
|
8
|
+
tone?: Tone | undefined;
|
|
9
|
+
/** Makes the label a link: to the list of what the bar counts. */
|
|
10
|
+
href?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface BarChartProps {
|
|
13
|
+
/** What the chart shows: the name of its list, for assistive technologies. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** The parts, in any order: the largest are drawn first. Left `undefined` while they load. */
|
|
16
|
+
items?: BarChartItem[] | undefined;
|
|
17
|
+
/** The rest of the total, past the items: a last row, "Other", whatever its size. */
|
|
18
|
+
other?: number | null | undefined;
|
|
19
|
+
/** Formats a value. Defaults to a number of the locale. */
|
|
20
|
+
formatValue?: (value: number) => string;
|
|
21
|
+
/** The categorical color of the bars without a tone, from 0. Defaults to the first. */
|
|
22
|
+
color?: number;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Horizontal bars of the parts of a total, the largest first, each with its label and its value
|
|
27
|
+
* formatted for the locale, and the rest of the total last, as "Other". Bars are on the categorical
|
|
28
|
+
* chart colors of the theme, or the color of their tone, and as long as their value against the
|
|
29
|
+
* largest one. Assistive technologies read a list of labels and values; the bars are hidden from
|
|
30
|
+
* them.
|
|
31
|
+
*/
|
|
32
|
+
export declare function BarChart({ label, items, other, formatValue, color, className, }: BarChartProps): import("react").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=BarChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../src/bar-chart/BarChart.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C,kDAAkD;AAClD,MAAM,WAAW,YAAY;IACzB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,6FAA6F;IAC7F,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC1B,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,KAAK,CAAC,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;IACnC,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,2DAA2D;IAC3D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACrB,KAAK,EACL,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAS,EACT,SAAS,GACZ,EAAE,aAAa,+BAoEf"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { cx } from "../utils/cx.js";
|
|
2
|
+
import { messages } from "../intl/messages.js";
|
|
3
|
+
import { usePanneauIntl } from "../intl/usePanneauIntl.js";
|
|
4
|
+
import { toneClass } from "../theme/toneClass.js";
|
|
5
|
+
import { Skeleton } from "../skeleton/Skeleton.js";
|
|
6
|
+
import { chartColors } from "../theme/chartColors.js";
|
|
7
|
+
import BarChart_module_default from "./BarChart.module.js";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
9
|
+
import { Link } from "react-aria-components";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
//#region src/bar-chart/BarChart.tsx
|
|
12
|
+
/** Rows of the skeleton. */
|
|
13
|
+
var SKELETON_ROWS = [
|
|
14
|
+
80,
|
|
15
|
+
55,
|
|
16
|
+
30
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Horizontal bars of the parts of a total, the largest first, each with its label and its value
|
|
20
|
+
* formatted for the locale, and the rest of the total last, as "Other". Bars are on the categorical
|
|
21
|
+
* chart colors of the theme, or the color of their tone, and as long as their value against the
|
|
22
|
+
* largest one. Assistive technologies read a list of labels and values; the bars are hidden from
|
|
23
|
+
* them.
|
|
24
|
+
*/
|
|
25
|
+
function BarChart(t0) {
|
|
26
|
+
const $ = c(23);
|
|
27
|
+
const { label, items, other, formatValue, color: t1, className } = t0;
|
|
28
|
+
const color = t1 === void 0 ? 0 : t1;
|
|
29
|
+
const intl = usePanneauIntl();
|
|
30
|
+
let t2;
|
|
31
|
+
if ($[0] !== formatValue || $[1] !== intl) {
|
|
32
|
+
t2 = formatValue ?? ((value) => intl.formatNumber(value));
|
|
33
|
+
$[0] = formatValue;
|
|
34
|
+
$[1] = intl;
|
|
35
|
+
$[2] = t2;
|
|
36
|
+
} else t2 = $[2];
|
|
37
|
+
const format = t2;
|
|
38
|
+
let t3;
|
|
39
|
+
if ($[3] !== color) {
|
|
40
|
+
t3 = chartColors.categorical(color);
|
|
41
|
+
$[3] = color;
|
|
42
|
+
$[4] = t3;
|
|
43
|
+
} else t3 = $[4];
|
|
44
|
+
let t4;
|
|
45
|
+
if ($[5] !== t3) {
|
|
46
|
+
t4 = { "--_panneau-bar-chart-color": t3 };
|
|
47
|
+
$[5] = t3;
|
|
48
|
+
$[6] = t4;
|
|
49
|
+
} else t4 = $[6];
|
|
50
|
+
const style = t4;
|
|
51
|
+
if (items === void 0) {
|
|
52
|
+
let t5;
|
|
53
|
+
if ($[7] !== className) {
|
|
54
|
+
t5 = cx("panneau-bar-chart", BarChart_module_default.chart, className);
|
|
55
|
+
$[7] = className;
|
|
56
|
+
$[8] = t5;
|
|
57
|
+
} else t5 = $[8];
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
60
|
+
t6 = SKELETON_ROWS.map(_temp);
|
|
61
|
+
$[9] = t6;
|
|
62
|
+
} else t6 = $[9];
|
|
63
|
+
let t7;
|
|
64
|
+
if ($[10] !== style || $[11] !== t5) {
|
|
65
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
66
|
+
className: t5,
|
|
67
|
+
style,
|
|
68
|
+
children: t6
|
|
69
|
+
});
|
|
70
|
+
$[10] = style;
|
|
71
|
+
$[11] = t5;
|
|
72
|
+
$[12] = t7;
|
|
73
|
+
} else t7 = $[12];
|
|
74
|
+
return t7;
|
|
75
|
+
}
|
|
76
|
+
const rest = other !== void 0 && other !== null && other > 0 ? other : null;
|
|
77
|
+
let t5;
|
|
78
|
+
if ($[13] !== className || $[14] !== format || $[15] !== intl || $[16] !== items || $[17] !== label || $[18] !== rest || $[19] !== style) {
|
|
79
|
+
const sorted = [...items].sort(_temp2);
|
|
80
|
+
const largest = Math.max(0, rest ?? 0, ...sorted.map(_temp3));
|
|
81
|
+
const rows = [...sorted, ...rest !== null ? [{
|
|
82
|
+
label: intl.formatMessage(messages.barChartOther),
|
|
83
|
+
value: rest,
|
|
84
|
+
isOther: true
|
|
85
|
+
}] : []];
|
|
86
|
+
let t6;
|
|
87
|
+
if ($[21] !== className) {
|
|
88
|
+
t6 = cx("panneau-bar-chart", BarChart_module_default.chart, className);
|
|
89
|
+
$[21] = className;
|
|
90
|
+
$[22] = t6;
|
|
91
|
+
} else t6 = $[22];
|
|
92
|
+
t5 = /* @__PURE__ */ jsx("ul", {
|
|
93
|
+
"aria-label": label,
|
|
94
|
+
className: t6,
|
|
95
|
+
style,
|
|
96
|
+
children: rows.map((row, index) => /* @__PURE__ */ jsxs("li", {
|
|
97
|
+
className: cx(BarChart_module_default.row, row.isOther === true && BarChart_module_default.other, row.tone !== void 0 && BarChart_module_default.toned, row.tone !== void 0 && toneClass(row.tone)),
|
|
98
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
99
|
+
className: BarChart_module_default.text,
|
|
100
|
+
children: [row.href !== void 0 ? /* @__PURE__ */ jsx(Link, {
|
|
101
|
+
href: row.href,
|
|
102
|
+
className: BarChart_module_default.label,
|
|
103
|
+
children: row.label
|
|
104
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
105
|
+
className: BarChart_module_default.label,
|
|
106
|
+
children: row.label
|
|
107
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
108
|
+
className: BarChart_module_default.value,
|
|
109
|
+
children: format(row.value)
|
|
110
|
+
})]
|
|
111
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className: BarChart_module_default.track,
|
|
113
|
+
"aria-hidden": "true",
|
|
114
|
+
children: row.value > 0 && largest > 0 ? /* @__PURE__ */ jsx("div", {
|
|
115
|
+
className: BarChart_module_default.bar,
|
|
116
|
+
style: { width: `${row.value / largest * 100}%` }
|
|
117
|
+
}) : null
|
|
118
|
+
})]
|
|
119
|
+
}, `${index}-${row.label}`))
|
|
120
|
+
});
|
|
121
|
+
$[13] = className;
|
|
122
|
+
$[14] = format;
|
|
123
|
+
$[15] = intl;
|
|
124
|
+
$[16] = items;
|
|
125
|
+
$[17] = label;
|
|
126
|
+
$[18] = rest;
|
|
127
|
+
$[19] = style;
|
|
128
|
+
$[20] = t5;
|
|
129
|
+
} else t5 = $[20];
|
|
130
|
+
return t5;
|
|
131
|
+
}
|
|
132
|
+
function _temp3(item) {
|
|
133
|
+
return item.value;
|
|
134
|
+
}
|
|
135
|
+
function _temp2(a, b) {
|
|
136
|
+
return b.value - a.value;
|
|
137
|
+
}
|
|
138
|
+
function _temp(width) {
|
|
139
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
140
|
+
className: BarChart_module_default.row,
|
|
141
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { width: `${width / 2 + 20}%` }), /* @__PURE__ */ jsx(Skeleton, {
|
|
142
|
+
shape: "rect",
|
|
143
|
+
width: `${width}%`,
|
|
144
|
+
height: "var(--panneau-bar-chart-bar-height, 0.5rem)"
|
|
145
|
+
})]
|
|
146
|
+
}, width);
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
export { BarChart };
|
|
150
|
+
|
|
151
|
+
//# sourceMappingURL=BarChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.js","names":["CSSProperties","Link","messages","usePanneauIntl","Skeleton","chartColors","toneClass","Tone","cx","styles","BarChartItem","label","value","tone","href","BarChartProps","items","other","formatValue","color","className","SKELETON_ROWS","BarChart","t0","$","_c","t1","undefined","intl","t2","formatNumber","format","t3","categorical","t4","style","t5","chart","t6","Symbol","for","map","_temp","t7","rest","sorted","sort","_temp2","largest","Math","max","_temp3","rows","formatMessage","barChartOther","isOther","row","index","toned","text","track","bar","width","item","a","b","_c","styles"],"sources":["../../src/bar-chart/BarChart.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { Link } from 'react-aria-components';\n\nimport { messages } from '../intl/messages';\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { Skeleton } from '../skeleton/Skeleton';\nimport { chartColors } from '../theme/chartColors';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './BarChart.module.css';\n\n/** A bar of a `BarChart`: a part of the total. */\nexport interface BarChartItem {\n /** What the part is: `Failed`. */\n label: string;\n value: number;\n /** Colors the bar with the solid color of a tone, as the tone of an option of a `select`. */\n tone?: Tone | undefined;\n /** Makes the label a link: to the list of what the bar counts. */\n href?: string | undefined;\n}\n\nexport interface BarChartProps {\n /** What the chart shows: the name of its list, for assistive technologies. */\n label: string;\n /** The parts, in any order: the largest are drawn first. Left `undefined` while they load. */\n items?: BarChartItem[] | undefined;\n /** The rest of the total, past the items: a last row, \"Other\", whatever its size. */\n other?: number | null | undefined;\n /** Formats a value. Defaults to a number of the locale. */\n formatValue?: (value: number) => string;\n /** The categorical color of the bars without a tone, from 0. Defaults to the first. */\n color?: number;\n className?: string;\n}\n\n/** Rows of the skeleton. */\nconst SKELETON_ROWS = [80, 55, 30];\n\n/**\n * Horizontal bars of the parts of a total, the largest first, each with its label and its value\n * formatted for the locale, and the rest of the total last, as \"Other\". Bars are on the categorical\n * chart colors of the theme, or the color of their tone, and as long as their value against the\n * largest one. Assistive technologies read a list of labels and values; the bars are hidden from\n * them.\n */\nexport function BarChart({\n label,\n items,\n other,\n formatValue,\n color = 0,\n className,\n}: BarChartProps) {\n const intl = usePanneauIntl();\n const format = formatValue ?? ((value: number) => intl.formatNumber(value));\n const style = { '--_panneau-bar-chart-color': chartColors.categorical(color) } as CSSProperties;\n if (items === undefined) {\n return (\n <div className={cx('panneau-bar-chart', styles.chart, className)} style={style}>\n {SKELETON_ROWS.map((width) => (\n <div key={width} className={styles.row}>\n <Skeleton width={`${width / 2 + 20}%`} />\n <Skeleton\n shape=\"rect\"\n width={`${width}%`}\n height=\"var(--panneau-bar-chart-bar-height, 0.5rem)\"\n />\n </div>\n ))}\n </div>\n );\n }\n const rest = other !== undefined && other !== null && other > 0 ? other : null;\n // The largest first; equal parts keep their order\n const sorted = [...items].sort((a, b) => b.value - a.value);\n const largest = Math.max(0, rest ?? 0, ...sorted.map((item) => item.value));\n const rows: (BarChartItem & { isOther?: boolean })[] = [\n ...sorted,\n ...(rest !== null\n ? [{ label: intl.formatMessage(messages.barChartOther), value: rest, isOther: true }]\n : []),\n ];\n return (\n <ul\n aria-label={label}\n className={cx('panneau-bar-chart', styles.chart, className)}\n style={style}\n >\n {rows.map((row, index) => (\n <li\n key={`${index}-${row.label}`}\n className={cx(\n styles.row,\n row.isOther === true && styles.other,\n row.tone !== undefined && styles.toned,\n row.tone !== undefined && toneClass(row.tone),\n )}\n >\n <div className={styles.text}>\n {row.href !== undefined ? (\n <Link href={row.href} className={styles.label}>\n {row.label}\n </Link>\n ) : (\n <span className={styles.label}>{row.label}</span>\n )}\n <span className={styles.value}>{format(row.value)}</span>\n </div>\n <div className={styles.track} aria-hidden=\"true\">\n {row.value > 0 && largest > 0 ? (\n <div\n className={styles.bar}\n style={{ width: `${(row.value / largest) * 100}%` }}\n />\n ) : null}\n </div>\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAsCA,IAAMqB,gBAAgB;CAAC;CAAI;CAAI;AAAE;;;;;;;;AASjC,SAAOC,SAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAkB,MAAA,EAAAd,OAAAK,OAAAC,OAAAC,aAAAC,OAAAO,IAAAN,cAAAG;CAKrB,MAAAJ,QAAAO,OAAAC,KAAAA,IAAA,I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ar-chart-chart";
|
|
4
|
+
var row = "panneau-bar-chart-row";
|
|
5
|
+
var text = "panneau-bar-chart-text";
|
|
6
|
+
var label = "panneau-bar-chart-label";
|
|
7
|
+
var value = "panneau-bar-chart-value";
|
|
8
|
+
var track = "panneau-bar-chart-track";
|
|
9
|
+
var bar = "panneau-bar-chart-bar";
|
|
10
|
+
var toned = "panneau-bar-chart-toned";
|
|
11
|
+
var other = "panneau-bar-chart-other";
|
|
12
|
+
var BarChart_module_default = {
|
|
13
|
+
chart,
|
|
14
|
+
row,
|
|
15
|
+
text,
|
|
16
|
+
label,
|
|
17
|
+
value,
|
|
18
|
+
track,
|
|
19
|
+
bar,
|
|
20
|
+
toned,
|
|
21
|
+
other
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { bar, chart, BarChart_module_default as default, label, other, row, text, toned, track, value };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=BarChart.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.module.js","names":[],"sources":["../../src/bar-chart/BarChart.module.css"],"sourcesContent":[".chart {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-bar-chart-gap, var(--panneau-space-3));\n min-width: 0;\n margin: 0;\n padding: 0;\n list-style: none;\n font-size: var(--panneau-bar-chart-font-size, var(--panneau-font-size-sm));\n}\n\n.row {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n min-width: 0;\n}\n\n.text {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: var(--panneau-space-3);\n min-width: 0;\n}\n\n.label {\n overflow: hidden;\n color: var(--panneau-color-text);\n text-decoration: none;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\na.label:hover,\na.label[data-hovered] {\n text-decoration: underline;\n}\n\n.label[data-focus-visible] {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 2px;\n border-radius: var(--panneau-radius-sm);\n}\n\n.value {\n flex-shrink: 0;\n font-variant-numeric: var(--panneau-font-numeric);\n font-weight: var(--panneau-font-weight-medium);\n color: var(--panneau-color-text);\n}\n\n.track {\n height: var(--panneau-bar-chart-bar-height, 0.5rem);\n}\n\n/* A bar on the categorical chart color of the chart, or the solid color of its tone. */\n.bar {\n height: 100%;\n min-width: 2px;\n background-color: var(--_panneau-bar-chart-color);\n border-radius: var(--panneau-bar-chart-bar-radius, var(--panneau-radius-full));\n}\n\n.toned .bar {\n background-color: var(--panneau-tone-solid);\n}\n\n/* The rest, after the parts: it steps back. */\n.other .label {\n color: var(--panneau-color-text-muted);\n}\n\n.other .bar {\n background-color: var(--panneau-color-border-control);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Tokens of BarChart. */
|
|
2
|
+
export declare const barChartTokens: import("../index.js").ComponentTokens<"bar-chart", "panneau-bar-chart-gap" | "panneau-bar-chart-font-size" | "panneau-bar-chart-bar-height" | "panneau-bar-chart-bar-radius">;
|
|
3
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/bar-chart/tokens.ts"],"names":[],"mappings":"AAEA,0BAA0B;AAC1B,eAAO,MAAM,cAAc,sKASzB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponentTokens } from "../theme/componentTokens.js";
|
|
2
|
+
//#region src/bar-chart/tokens.ts
|
|
3
|
+
/** Tokens of BarChart. */
|
|
4
|
+
var barChartTokens = defineComponentTokens("bar-chart", {
|
|
5
|
+
/** Height of a bar. */
|
|
6
|
+
"bar-height": "0.5rem",
|
|
7
|
+
/** Corners of a bar. */
|
|
8
|
+
"bar-radius": "var(--panneau-radius-full)",
|
|
9
|
+
/** Space between the rows. */
|
|
10
|
+
gap: "var(--panneau-space-3)",
|
|
11
|
+
/** Font size of the labels and the values. */
|
|
12
|
+
"font-size": "var(--panneau-font-size-sm)"
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { barChartTokens };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","barChartTokens","gap"],"sources":["../../src/bar-chart/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of BarChart. */\nexport const barChartTokens = defineComponentTokens('bar-chart', {\n /** Height of a bar. */\n 'bar-height': '0.5rem',\n /** Corners of a bar. */\n 'bar-radius': 'var(--panneau-radius-full)',\n /** Space between the rows. */\n gap: 'var(--panneau-space-3)',\n /** Font size of the labels and the values. */\n 'font-size': 'var(--panneau-font-size-sm)',\n});\n"],"mappings":";;;AAGA,IAAaC,iBAAiBD,sBAAsB,aAAa;;CAE7D,cAAc;;CAEd,cAAc;;CAEdE,KAAK;;CAEL,aAAa;AACjB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Alert, type AlertAppearance, type AlertProps, type AlertTone, type AlertVariants, } from './alert/Alert.js';
|
|
2
2
|
export { Aside, AsideLayout, type AsideLayoutProps, AsidePanel, type AsidePanelProps, type AsideProps, } from './aside/Aside.js';
|
|
3
3
|
export { Badge, type BadgeAppearance, type BadgeProps, type BadgeTone, type BadgeVariants, } from './badge/Badge.js';
|
|
4
|
+
export { BarChart, type BarChartItem, type BarChartProps } from './bar-chart/BarChart.js';
|
|
4
5
|
export { Button, type ButtonAppearance, type ButtonProps, type ButtonStyleProps, type ButtonVariant, type ButtonVariants, } from './button/Button.js';
|
|
5
6
|
export { LinkButton, type LinkButtonProps } from './button/LinkButton.js';
|
|
6
7
|
export { Card, type CardProps } from './card/Card.js';
|
|
@@ -38,6 +39,7 @@ export { SegmentedControl, type SegmentedControlOption, type SegmentedControlPro
|
|
|
38
39
|
export { type MultipleSelectProps, type OptionValue, Select, type SelectBaseProps, type SelectOption, type SelectProps, type SingleSelectProps, } from './select/Select.js';
|
|
39
40
|
export { Inline, type InlineProps } from './inline/Inline.js';
|
|
40
41
|
export { LineChart, type LineChartPoint, type LineChartProps } from './line-chart/LineChart.js';
|
|
42
|
+
export { Meter, type MeterProps } from './meter/Meter.js';
|
|
41
43
|
export { BREAKPOINTS, type Breakpoint, type Justification, type Responsive, type Space, } from './layout/responsive.js';
|
|
42
44
|
export { Prose, type ProseProps } from './prose/Prose.js';
|
|
43
45
|
export { LoadingRegion, type LoadingRegionProps } from './skeleton/LoadingRegion.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EACL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,KAAK,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,UAAU,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,KAAK,EACL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,MAAM,EACN,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,cAAc,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,a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O,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,8 @@ import { Skeleton } from "./skeleton/Skeleton.js";
|
|
|
14
14
|
import { usePreference } from "./utils/preference.js";
|
|
15
15
|
import { Aside, AsideLayout, AsidePanel } from "./aside/Aside.js";
|
|
16
16
|
import { Badge } from "./badge/Badge.js";
|
|
17
|
+
import { CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, chartColors } from "./theme/chartColors.js";
|
|
18
|
+
import { BarChart } from "./bar-chart/BarChart.js";
|
|
17
19
|
import { LinkButton } from "./button/LinkButton.js";
|
|
18
20
|
import { Card } from "./card/Card.js";
|
|
19
21
|
import { matchCommands, normalizeSearch } from "./command-palette/match.js";
|
|
@@ -42,8 +44,8 @@ import { ThemeScope } from "./root/ThemeScope.js";
|
|
|
42
44
|
import { SegmentedControl } from "./segmented-control/SegmentedControl.js";
|
|
43
45
|
import { Select } from "./select/Select.js";
|
|
44
46
|
import { Inline } from "./inline/Inline.js";
|
|
45
|
-
import { CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, chartColors } from "./theme/chartColors.js";
|
|
46
47
|
import { LineChart } from "./line-chart/LineChart.js";
|
|
48
|
+
import { Meter } from "./meter/Meter.js";
|
|
47
49
|
import { Prose } from "./prose/Prose.js";
|
|
48
50
|
import { LoadingRegion } from "./skeleton/LoadingRegion.js";
|
|
49
51
|
import { Stack } from "./stack/Stack.js";
|
|
@@ -60,4 +62,4 @@ import { defineComponentTokens } from "./theme/componentTokens.js";
|
|
|
60
62
|
import { componentTokens } from "./theme/components.js";
|
|
61
63
|
import { SEMANTIC_TOKENS } from "./theme/semanticTokens.js";
|
|
62
64
|
import { defineTheme, findUnknownTokens, mergeThemes } from "./theme/defineTheme.js";
|
|
63
|
-
export { Alert, Aside, AsideLayout, AsidePanel, BREAKPOINTS, BUILT_IN_TONES, Badge, Button, CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, Card, Checkbox, ComboBox, CommandPalette, Container, DatePicker, DateRangePicker, Dialog, DialogTrigger, Disclosure, Divider, Fieldset, Grid, GridItem, Heading, Icon, IconButton, Inline, LineChart, LinkButton, LoadingRegion, MAX_VISIBLE_TOASTS, Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, NumberInput, PanneauRoot, PillTrigger, Popover, PopoverTrigger, Prose, RadioGroup, SEMANTIC_TOKENS, SegmentedControl, Select, Skeleton, Slider, Spinner, Stack, Stat, Switch, Tab, TabList, TabPanel, Tabs, TagsInput, Text, TextArea, TextInput, ThemeScope, TimeInput, Tooltip, bootstrapTheme, bootstrapTone, chartColors, checkColorDifferences, checkTheme, componentTokens, defineComponentTokens, defineTheme, deriveTone, findUnknownTokens, getNamedIcon, getToastTimeout, isApplePlatform, loadNamedIcon, matchCommands, mergeThemes, normalizeSearch, toneClassName, useCommandShortcut, usePanneauIntl, usePortalContainer, usePreference, useToast, useToastOffset };
|
|
65
|
+
export { Alert, Aside, AsideLayout, AsidePanel, BREAKPOINTS, BUILT_IN_TONES, Badge, BarChart, Button, CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, Card, Checkbox, ComboBox, CommandPalette, Container, DatePicker, DateRangePicker, Dialog, DialogTrigger, Disclosure, Divider, Fieldset, Grid, GridItem, Heading, Icon, IconButton, Inline, LineChart, LinkButton, LoadingRegion, MAX_VISIBLE_TOASTS, Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, Meter, NumberInput, PanneauRoot, PillTrigger, Popover, PopoverTrigger, Prose, RadioGroup, SEMANTIC_TOKENS, SegmentedControl, Select, Skeleton, Slider, Spinner, Stack, Stat, Switch, Tab, TabList, TabPanel, Tabs, TagsInput, Text, TextArea, TextInput, ThemeScope, TimeInput, Tooltip, bootstrapTheme, bootstrapTone, chartColors, checkColorDifferences, checkTheme, componentTokens, defineComponentTokens, defineTheme, deriveTone, findUnknownTokens, getNamedIcon, getToastTimeout, isApplePlatform, loadNamedIcon, matchCommands, mergeThemes, normalizeSearch, toneClassName, useCommandShortcut, usePanneauIntl, usePortalContainer, usePreference, useToast, useToastOffset };
|