@panneau/ui 5.0.0-alpha.16 → 5.0.0-alpha.18
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 +31 -1
- package/dist/button/Button.d.ts +5 -2
- package/dist/button/Button.d.ts.map +1 -1
- package/dist/button/Button.js +76 -54
- package/dist/button/Button.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/line-chart/LineChart.css +84 -0
- package/dist/line-chart/LineChart.d.ts +26 -0
- package/dist/line-chart/LineChart.d.ts.map +1 -0
- package/dist/line-chart/LineChart.js +327 -0
- package/dist/line-chart/LineChart.js.map +1 -0
- package/dist/line-chart/LineChart.module.js +28 -0
- package/dist/line-chart/LineChart.module.js.map +1 -0
- package/dist/line-chart/tokens.d.ts +3 -0
- package/dist/line-chart/tokens.d.ts.map +1 -0
- package/dist/line-chart/tokens.js +19 -0
- package/dist/line-chart/tokens.js.map +1 -0
- package/dist/root/PanneauRoot.css +24 -0
- package/dist/root/PanneauRoot.d.ts +8 -1
- package/dist/root/PanneauRoot.d.ts.map +1 -1
- package/dist/root/PanneauRoot.js +98 -92
- package/dist/root/PanneauRoot.js.map +1 -1
- package/dist/root/PanneauRoot.module.js.map +1 -1
- package/dist/stat/Stat.css +45 -0
- package/dist/stat/Stat.d.ts +27 -0
- package/dist/stat/Stat.d.ts.map +1 -0
- package/dist/stat/Stat.js +87 -0
- package/dist/stat/Stat.js.map +1 -0
- package/dist/stat/Stat.module.js +18 -0
- package/dist/stat/Stat.module.js.map +1 -0
- package/dist/stat/tokens.d.ts +3 -0
- package/dist/stat/tokens.d.ts.map +1 -0
- package/dist/stat/tokens.js +21 -0
- package/dist/stat/tokens.js.map +1 -0
- package/dist/theme/Tone.css +14 -0
- package/dist/theme/Tone.module.js +4 -2
- package/dist/theme/Tone.module.js.map +1 -1
- package/dist/theme/bootstrap.d.ts.map +1 -1
- package/dist/theme/bootstrap.js +6 -0
- package/dist/theme/bootstrap.js.map +1 -1
- package/dist/theme/checkTheme.d.ts.map +1 -1
- package/dist/theme/checkTheme.js +24 -0
- package/dist/theme/checkTheme.js.map +1 -1
- package/dist/theme/components.d.ts +2 -0
- 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/dist/theme/index.js +1 -1
- package/dist/theme/semanticTokens.d.ts +1 -1
- package/dist/theme/semanticTokens.d.ts.map +1 -1
- package/dist/theme/semanticTokens.js +6 -0
- package/dist/theme/semanticTokens.js.map +1 -1
- package/dist/theme/tones.d.ts +14 -2
- package/dist/theme/tones.d.ts.map +1 -1
- package/dist/theme/tones.js +14 -2
- package/dist/theme/tones.js.map +1 -1
- package/dist/toast/Toast.css +131 -15
- package/dist/toast/Toast.d.ts +46 -9
- package/dist/toast/Toast.d.ts.map +1 -1
- package/dist/toast/Toast.js +190 -65
- package/dist/toast/Toast.js.map +1 -1
- package/dist/toast/Toast.module.js +5 -3
- package/dist/toast/Toast.module.js.map +1 -1
- package/dist/toast/tokens.js +1 -1
- package/dist/toast/tokens.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { cx } from "../utils/cx.js";
|
|
2
|
+
import { usePanneauIntl } from "../intl/usePanneauIntl.js";
|
|
3
|
+
import { Skeleton } from "../skeleton/Skeleton.js";
|
|
4
|
+
import { chartColors } from "../theme/chartColors.js";
|
|
5
|
+
import LineChart_module_default from "./LineChart.module.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/line-chart/LineChart.tsx
|
|
9
|
+
/** Points get dots up to this count: past it, only the last one has one. */
|
|
10
|
+
var MAX_DOTS = 31;
|
|
11
|
+
/**
|
|
12
|
+
* A line of values over time, on the categorical chart colors of the theme: the line, the area
|
|
13
|
+
* under it, the top of its scale, and the labels of its first and last points. The plot is hidden
|
|
14
|
+
* from assistive technologies, which read the values in a table instead.
|
|
15
|
+
*/
|
|
16
|
+
function LineChart(t0) {
|
|
17
|
+
const $ = c(91);
|
|
18
|
+
const { label, points, formatValue, height, color: t1, className } = t0;
|
|
19
|
+
const color = t1 === void 0 ? 0 : t1;
|
|
20
|
+
const intl = usePanneauIntl();
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[0] !== formatValue || $[1] !== intl) {
|
|
23
|
+
t2 = formatValue ?? ((value) => intl.formatNumber(value));
|
|
24
|
+
$[0] = formatValue;
|
|
25
|
+
$[1] = intl;
|
|
26
|
+
$[2] = t2;
|
|
27
|
+
} else t2 = $[2];
|
|
28
|
+
const format = t2;
|
|
29
|
+
let t3;
|
|
30
|
+
if ($[3] !== color) {
|
|
31
|
+
t3 = chartColors.categorical(color);
|
|
32
|
+
$[3] = color;
|
|
33
|
+
$[4] = t3;
|
|
34
|
+
} else t3 = $[4];
|
|
35
|
+
let t4;
|
|
36
|
+
if ($[5] !== height) {
|
|
37
|
+
t4 = height !== void 0 ? { "--_panneau-line-chart-height": height } : {};
|
|
38
|
+
$[5] = height;
|
|
39
|
+
$[6] = t4;
|
|
40
|
+
} else t4 = $[6];
|
|
41
|
+
let t5;
|
|
42
|
+
if ($[7] !== t3 || $[8] !== t4) {
|
|
43
|
+
t5 = {
|
|
44
|
+
"--_panneau-line-chart-color": t3,
|
|
45
|
+
...t4
|
|
46
|
+
};
|
|
47
|
+
$[7] = t3;
|
|
48
|
+
$[8] = t4;
|
|
49
|
+
$[9] = t5;
|
|
50
|
+
} else t5 = $[9];
|
|
51
|
+
const style = t5;
|
|
52
|
+
if (points === void 0) {
|
|
53
|
+
let t6;
|
|
54
|
+
if ($[10] !== className) {
|
|
55
|
+
t6 = cx("panneau-line-chart", LineChart_module_default.chart, className);
|
|
56
|
+
$[10] = className;
|
|
57
|
+
$[11] = t6;
|
|
58
|
+
} else t6 = $[11];
|
|
59
|
+
let t7;
|
|
60
|
+
let t8;
|
|
61
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
62
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
63
|
+
className: LineChart_module_default.plot,
|
|
64
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
65
|
+
shape: "rect",
|
|
66
|
+
height: "100%"
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
t8 = /* @__PURE__ */ jsx(Skeleton, { width: "100%" });
|
|
70
|
+
$[12] = t7;
|
|
71
|
+
$[13] = t8;
|
|
72
|
+
} else {
|
|
73
|
+
t7 = $[12];
|
|
74
|
+
t8 = $[13];
|
|
75
|
+
}
|
|
76
|
+
let t9;
|
|
77
|
+
if ($[14] !== style || $[15] !== t6) {
|
|
78
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
79
|
+
className: t6,
|
|
80
|
+
style,
|
|
81
|
+
children: [t7, t8]
|
|
82
|
+
});
|
|
83
|
+
$[14] = style;
|
|
84
|
+
$[15] = t6;
|
|
85
|
+
$[16] = t9;
|
|
86
|
+
} else t9 = $[16];
|
|
87
|
+
return t9;
|
|
88
|
+
}
|
|
89
|
+
let first;
|
|
90
|
+
let last;
|
|
91
|
+
let t10;
|
|
92
|
+
let t6;
|
|
93
|
+
let t7;
|
|
94
|
+
let t8;
|
|
95
|
+
let t9;
|
|
96
|
+
if ($[17] !== className || $[18] !== format || $[19] !== points || $[20] !== style) {
|
|
97
|
+
const values = points.map(_temp);
|
|
98
|
+
const low = Math.min(0, ...values);
|
|
99
|
+
const high = Math.max(low + 1, ...values);
|
|
100
|
+
const top = high + (high - low) * .08;
|
|
101
|
+
let t11;
|
|
102
|
+
if ($[28] !== points.length) {
|
|
103
|
+
t11 = (index) => points.length === 1 ? 50 : index / (points.length - 1) * 100;
|
|
104
|
+
$[28] = points.length;
|
|
105
|
+
$[29] = t11;
|
|
106
|
+
} else t11 = $[29];
|
|
107
|
+
const x = t11;
|
|
108
|
+
let t12;
|
|
109
|
+
if ($[30] !== low || $[31] !== top) {
|
|
110
|
+
t12 = (value_0) => 100 - (value_0 - low) / (top - low) * 100;
|
|
111
|
+
$[30] = low;
|
|
112
|
+
$[31] = top;
|
|
113
|
+
$[32] = t12;
|
|
114
|
+
} else t12 = $[32];
|
|
115
|
+
const y = t12;
|
|
116
|
+
let t13;
|
|
117
|
+
if ($[33] !== points || $[34] !== x || $[35] !== y) {
|
|
118
|
+
let t14;
|
|
119
|
+
if ($[37] !== x || $[38] !== y) {
|
|
120
|
+
t14 = (point_0, index_0) => `${index_0 === 0 ? "M" : "L"}${x(index_0)},${y(point_0.value)}`;
|
|
121
|
+
$[37] = x;
|
|
122
|
+
$[38] = y;
|
|
123
|
+
$[39] = t14;
|
|
124
|
+
} else t14 = $[39];
|
|
125
|
+
t13 = points.map(t14).join(" ");
|
|
126
|
+
$[33] = points;
|
|
127
|
+
$[34] = x;
|
|
128
|
+
$[35] = y;
|
|
129
|
+
$[36] = t13;
|
|
130
|
+
} else t13 = $[36];
|
|
131
|
+
const line = t13;
|
|
132
|
+
const zero = y(Math.max(low, 0));
|
|
133
|
+
first = points[0];
|
|
134
|
+
let t14;
|
|
135
|
+
if ($[40] !== points) {
|
|
136
|
+
t14 = points.at(-1);
|
|
137
|
+
$[40] = points;
|
|
138
|
+
$[41] = t14;
|
|
139
|
+
} else t14 = $[41];
|
|
140
|
+
last = t14;
|
|
141
|
+
if ($[42] !== className) {
|
|
142
|
+
t9 = cx("panneau-line-chart", LineChart_module_default.chart, className);
|
|
143
|
+
$[42] = className;
|
|
144
|
+
$[43] = t9;
|
|
145
|
+
} else t9 = $[43];
|
|
146
|
+
t10 = style;
|
|
147
|
+
t6 = LineChart_module_default.plot;
|
|
148
|
+
let t15;
|
|
149
|
+
if ($[44] !== zero) {
|
|
150
|
+
t15 = /* @__PURE__ */ jsx("line", {
|
|
151
|
+
className: LineChart_module_default.baseline,
|
|
152
|
+
x1: "0",
|
|
153
|
+
x2: "100",
|
|
154
|
+
y1: zero,
|
|
155
|
+
y2: zero
|
|
156
|
+
});
|
|
157
|
+
$[44] = zero;
|
|
158
|
+
$[45] = t15;
|
|
159
|
+
} else t15 = $[45];
|
|
160
|
+
let t16;
|
|
161
|
+
if ($[46] !== line || $[47] !== points.length || $[48] !== x || $[49] !== zero) {
|
|
162
|
+
t16 = points.length > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", {
|
|
163
|
+
className: LineChart_module_default.area,
|
|
164
|
+
d: `${line} L${x(points.length - 1)},${zero} L${x(0)},${zero} Z`
|
|
165
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
166
|
+
className: LineChart_module_default.line,
|
|
167
|
+
d: line
|
|
168
|
+
})] }) : null;
|
|
169
|
+
$[46] = line;
|
|
170
|
+
$[47] = points.length;
|
|
171
|
+
$[48] = x;
|
|
172
|
+
$[49] = zero;
|
|
173
|
+
$[50] = t16;
|
|
174
|
+
} else t16 = $[50];
|
|
175
|
+
let t17;
|
|
176
|
+
if ($[51] !== format || $[52] !== points || $[53] !== x || $[54] !== y) {
|
|
177
|
+
let t18;
|
|
178
|
+
if ($[56] !== format || $[57] !== points.length || $[58] !== x || $[59] !== y) {
|
|
179
|
+
t18 = (point_1, index_1) => points.length <= MAX_DOTS || index_1 === points.length - 1 ? /* @__PURE__ */ jsx("path", {
|
|
180
|
+
className: LineChart_module_default.dot,
|
|
181
|
+
d: `M${x(index_1)},${y(point_1.value)} h0`,
|
|
182
|
+
children: /* @__PURE__ */ jsx("title", { children: `${point_1.label}: ${format(point_1.value)}` })
|
|
183
|
+
}, point_1.label) : null;
|
|
184
|
+
$[56] = format;
|
|
185
|
+
$[57] = points.length;
|
|
186
|
+
$[58] = x;
|
|
187
|
+
$[59] = y;
|
|
188
|
+
$[60] = t18;
|
|
189
|
+
} else t18 = $[60];
|
|
190
|
+
t17 = points.map(t18);
|
|
191
|
+
$[51] = format;
|
|
192
|
+
$[52] = points;
|
|
193
|
+
$[53] = x;
|
|
194
|
+
$[54] = y;
|
|
195
|
+
$[55] = t17;
|
|
196
|
+
} else t17 = $[55];
|
|
197
|
+
if ($[61] !== t15 || $[62] !== t16 || $[63] !== t17) {
|
|
198
|
+
t7 = /* @__PURE__ */ jsxs("svg", {
|
|
199
|
+
className: LineChart_module_default.svg,
|
|
200
|
+
viewBox: "0 0 100 100",
|
|
201
|
+
preserveAspectRatio: "none",
|
|
202
|
+
"aria-hidden": "true",
|
|
203
|
+
focusable: "false",
|
|
204
|
+
children: [
|
|
205
|
+
t15,
|
|
206
|
+
t16,
|
|
207
|
+
t17
|
|
208
|
+
]
|
|
209
|
+
});
|
|
210
|
+
$[61] = t15;
|
|
211
|
+
$[62] = t16;
|
|
212
|
+
$[63] = t17;
|
|
213
|
+
$[64] = t7;
|
|
214
|
+
} else t7 = $[64];
|
|
215
|
+
t8 = points.length > 0 ? /* @__PURE__ */ jsx("span", {
|
|
216
|
+
className: LineChart_module_default.max,
|
|
217
|
+
"aria-hidden": "true",
|
|
218
|
+
children: format(Math.max(...values))
|
|
219
|
+
}) : null;
|
|
220
|
+
$[17] = className;
|
|
221
|
+
$[18] = format;
|
|
222
|
+
$[19] = points;
|
|
223
|
+
$[20] = style;
|
|
224
|
+
$[21] = first;
|
|
225
|
+
$[22] = last;
|
|
226
|
+
$[23] = t10;
|
|
227
|
+
$[24] = t6;
|
|
228
|
+
$[25] = t7;
|
|
229
|
+
$[26] = t8;
|
|
230
|
+
$[27] = t9;
|
|
231
|
+
} else {
|
|
232
|
+
first = $[21];
|
|
233
|
+
last = $[22];
|
|
234
|
+
t10 = $[23];
|
|
235
|
+
t6 = $[24];
|
|
236
|
+
t7 = $[25];
|
|
237
|
+
t8 = $[26];
|
|
238
|
+
t9 = $[27];
|
|
239
|
+
}
|
|
240
|
+
let t11;
|
|
241
|
+
if ($[65] !== t6 || $[66] !== t7 || $[67] !== t8) {
|
|
242
|
+
t11 = /* @__PURE__ */ jsxs("div", {
|
|
243
|
+
className: t6,
|
|
244
|
+
children: [t7, t8]
|
|
245
|
+
});
|
|
246
|
+
$[65] = t6;
|
|
247
|
+
$[66] = t7;
|
|
248
|
+
$[67] = t8;
|
|
249
|
+
$[68] = t11;
|
|
250
|
+
} else t11 = $[68];
|
|
251
|
+
let t12;
|
|
252
|
+
if ($[69] !== first || $[70] !== last || $[71] !== points.length) {
|
|
253
|
+
t12 = first !== void 0 && last !== void 0 ? /* @__PURE__ */ jsxs("div", {
|
|
254
|
+
className: LineChart_module_default.labels,
|
|
255
|
+
"aria-hidden": "true",
|
|
256
|
+
children: [/* @__PURE__ */ jsx("span", { children: first.label }), points.length > 1 ? /* @__PURE__ */ jsx("span", { children: last.label }) : null]
|
|
257
|
+
}) : null;
|
|
258
|
+
$[69] = first;
|
|
259
|
+
$[70] = last;
|
|
260
|
+
$[71] = points.length;
|
|
261
|
+
$[72] = t12;
|
|
262
|
+
} else t12 = $[72];
|
|
263
|
+
let t13;
|
|
264
|
+
if ($[73] !== label) {
|
|
265
|
+
t13 = /* @__PURE__ */ jsx("caption", { children: label });
|
|
266
|
+
$[73] = label;
|
|
267
|
+
$[74] = t13;
|
|
268
|
+
} else t13 = $[74];
|
|
269
|
+
let t14;
|
|
270
|
+
if ($[75] !== format || $[76] !== points) {
|
|
271
|
+
let t15;
|
|
272
|
+
if ($[78] !== format) {
|
|
273
|
+
t15 = (point_2) => /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", {
|
|
274
|
+
scope: "row",
|
|
275
|
+
children: point_2.label
|
|
276
|
+
}), /* @__PURE__ */ jsx("td", { children: format(point_2.value) })] }, point_2.label);
|
|
277
|
+
$[78] = format;
|
|
278
|
+
$[79] = t15;
|
|
279
|
+
} else t15 = $[79];
|
|
280
|
+
t14 = points.map(t15);
|
|
281
|
+
$[75] = format;
|
|
282
|
+
$[76] = points;
|
|
283
|
+
$[77] = t14;
|
|
284
|
+
} else t14 = $[77];
|
|
285
|
+
let t15;
|
|
286
|
+
if ($[80] !== t14) {
|
|
287
|
+
t15 = /* @__PURE__ */ jsx("tbody", { children: t14 });
|
|
288
|
+
$[80] = t14;
|
|
289
|
+
$[81] = t15;
|
|
290
|
+
} else t15 = $[81];
|
|
291
|
+
let t16;
|
|
292
|
+
if ($[82] !== t13 || $[83] !== t15) {
|
|
293
|
+
t16 = /* @__PURE__ */ jsxs("table", {
|
|
294
|
+
className: LineChart_module_default.visuallyHidden,
|
|
295
|
+
children: [t13, t15]
|
|
296
|
+
});
|
|
297
|
+
$[82] = t13;
|
|
298
|
+
$[83] = t15;
|
|
299
|
+
$[84] = t16;
|
|
300
|
+
} else t16 = $[84];
|
|
301
|
+
let t17;
|
|
302
|
+
if ($[85] !== t10 || $[86] !== t11 || $[87] !== t12 || $[88] !== t16 || $[89] !== t9) {
|
|
303
|
+
t17 = /* @__PURE__ */ jsxs("figure", {
|
|
304
|
+
className: t9,
|
|
305
|
+
style: t10,
|
|
306
|
+
children: [
|
|
307
|
+
t11,
|
|
308
|
+
t12,
|
|
309
|
+
t16
|
|
310
|
+
]
|
|
311
|
+
});
|
|
312
|
+
$[85] = t10;
|
|
313
|
+
$[86] = t11;
|
|
314
|
+
$[87] = t12;
|
|
315
|
+
$[88] = t16;
|
|
316
|
+
$[89] = t9;
|
|
317
|
+
$[90] = t17;
|
|
318
|
+
} else t17 = $[90];
|
|
319
|
+
return t17;
|
|
320
|
+
}
|
|
321
|
+
function _temp(point) {
|
|
322
|
+
return point.value;
|
|
323
|
+
}
|
|
324
|
+
//#endregion
|
|
325
|
+
export { LineChart };
|
|
326
|
+
|
|
327
|
+
//# sourceMappingURL=LineChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.js","names":["CSSProperties","usePanneauIntl","Skeleton","chartColors","cx","styles","LineChartPoint","label","value","LineChartProps","points","formatValue","height","color","className","MAX_DOTS","LineChart","t0","$","_c","t1","undefined","intl","t2","formatNumber","format","t3","categorical","t4","t5","style","t6","chart","t7","t8","Symbol","for","plot","t9","first","last","t10","values","map","_temp","low","Math","min","high","max","top","t11","length","index","x","t12","value_0","y","t13","t14","point_0","index_0","point","join","line","zero","at","t15","baseline","t16","area","t17","t18","point_1","index_1","dot","svg","labels","point_2","visuallyHidden","_c","styles","_Fragment"],"sources":["../../src/line-chart/LineChart.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { Skeleton } from '../skeleton/Skeleton';\nimport { chartColors } from '../theme/chartColors';\nimport { cx } from '../utils/cx';\nimport styles from './LineChart.module.css';\n\n/** A point of a `LineChart`. */\nexport interface LineChartPoint {\n /** What the point is, under the chart and in its table: a day, a week, a month. */\n label: string;\n value: number;\n}\n\nexport interface LineChartProps {\n /** What the chart shows: the caption of its table, for assistive technologies. */\n label: string;\n /** The points, in order. Left `undefined` while they load: a skeleton of the plot. */\n points?: LineChartPoint[] | undefined;\n /** Formats a value, in the table and the top of the scale. Defaults to a number of the locale. */\n formatValue?: (value: number) => string;\n /** Height of the plot, without the labels: `'10rem'`. Defaults to the `height` token. */\n height?: string;\n /** The categorical color of the line, from 0. Defaults to the first. */\n color?: number;\n className?: string;\n}\n\n/** Points get dots up to this count: past it, only the last one has one. */\nconst MAX_DOTS = 31;\n\n/**\n * A line of values over time, on the categorical chart colors of the theme: the line, the area\n * under it, the top of its scale, and the labels of its first and last points. The plot is hidden\n * from assistive technologies, which read the values in a table instead.\n */\nexport function LineChart({\n label,\n points,\n formatValue,\n height,\n color = 0,\n className,\n}: LineChartProps) {\n const intl = usePanneauIntl();\n const format = formatValue ?? ((value: number) => intl.formatNumber(value));\n const style = {\n '--_panneau-line-chart-color': chartColors.categorical(color),\n ...(height !== undefined ? { '--_panneau-line-chart-height': height } : {}),\n } as CSSProperties;\n if (points === undefined) {\n return (\n <div className={cx('panneau-line-chart', styles.chart, className)} style={style}>\n <div className={styles.plot}>\n <Skeleton shape=\"rect\" height=\"100%\" />\n </div>\n <Skeleton width=\"100%\" />\n </div>\n );\n }\n const values = points.map((point) => point.value);\n const low = Math.min(0, ...values);\n const high = Math.max(low + 1, ...values);\n // Room above the highest point, for the width of the line and its dot\n const top = high + (high - low) * 0.08;\n const x = (index: number) => (points.length === 1 ? 50 : (index / (points.length - 1)) * 100);\n const y = (value: number) => 100 - ((value - low) / (top - low)) * 100;\n const line = points\n .map((point, index) => `${index === 0 ? 'M' : 'L'}${x(index)},${y(point.value)}`)\n .join(' ');\n const zero = y(Math.max(low, 0));\n const first = points[0];\n const last = points.at(-1);\n return (\n <figure className={cx('panneau-line-chart', styles.chart, className)} style={style}>\n <div className={styles.plot}>\n <svg\n className={styles.svg}\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <line className={styles.baseline} x1=\"0\" x2=\"100\" y1={zero} y2={zero} />\n {points.length > 1 ? (\n <>\n <path\n className={styles.area}\n d={`${line} L${x(points.length - 1)},${zero} L${x(0)},${zero} Z`}\n />\n <path className={styles.line} d={line} />\n </>\n ) : null}\n {points.map((point, index) =>\n points.length <= MAX_DOTS || index === points.length - 1 ? (\n <path\n key={point.label}\n className={styles.dot}\n d={`M${x(index)},${y(point.value)} h0`}\n >\n <title>{`${point.label}: ${format(point.value)}`}</title>\n </path>\n ) : null,\n )}\n </svg>\n {points.length > 0 ? (\n <span className={styles.max} aria-hidden=\"true\">\n {format(Math.max(...values))}\n </span>\n ) : null}\n </div>\n {first !== undefined && last !== undefined ? (\n <div className={styles.labels} aria-hidden=\"true\">\n <span>{first.label}</span>\n {points.length > 1 ? <span>{last.label}</span> : null}\n </div>\n ) : null}\n <table className={styles.visuallyHidden}>\n <caption>{label}</caption>\n <tbody>\n {points.map((point) => (\n <tr key={point.label}>\n <th scope=\"row\">{point.label}</th>\n <td>{format(point.value)}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </figure>\n );\n}\n"],"mappings":";;;;;;;;;AA8BA,IAAMe,WAAW;;;;;;AAOjB,SAAOC,UAAAC,IAAA;CAAA,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OAAAA,MAAArD,EAAA;CAAA,OAtDTqD;AAsDS;AA5FV,SAAA3B,MAAAkB,OAAA;CAAA,OAwBkCA,MAAKtD;AAAM"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "./LineChart.css";
|
|
2
|
+
//#region src/line-chart/LineChart.module.css
|
|
3
|
+
var chart = "panneau-line-chart-chart";
|
|
4
|
+
var plot = "panneau-line-chart-plot";
|
|
5
|
+
var svg = "panneau-line-chart-svg";
|
|
6
|
+
var baseline = "panneau-line-chart-baseline";
|
|
7
|
+
var area = "panneau-line-chart-area";
|
|
8
|
+
var line = "panneau-line-chart-line";
|
|
9
|
+
var dot = "panneau-line-chart-dot";
|
|
10
|
+
var max = "panneau-line-chart-max";
|
|
11
|
+
var labels = "panneau-line-chart-labels";
|
|
12
|
+
var visuallyHidden = "panneau-line-chart-visually-hidden";
|
|
13
|
+
var LineChart_module_default = {
|
|
14
|
+
chart,
|
|
15
|
+
plot,
|
|
16
|
+
svg,
|
|
17
|
+
baseline,
|
|
18
|
+
area,
|
|
19
|
+
line,
|
|
20
|
+
dot,
|
|
21
|
+
max,
|
|
22
|
+
labels,
|
|
23
|
+
visuallyHidden
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { area, baseline, chart, LineChart_module_default as default, dot, labels, line, max, plot, svg, visuallyHidden };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=LineChart.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.module.js","names":[],"sources":["../../src/line-chart/LineChart.module.css"],"sourcesContent":[".chart {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n min-width: 0;\n margin: 0;\n}\n\n.plot {\n position: relative;\n height: var(--_panneau-line-chart-height, var(--panneau-line-chart-height, 8rem));\n}\n\n.svg {\n display: block;\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n.baseline {\n stroke: var(--panneau-color-border);\n stroke-width: 1px;\n vector-effect: non-scaling-stroke;\n}\n\n.area {\n fill: var(--_panneau-line-chart-color);\n fill-opacity: var(--panneau-line-chart-area-opacity, 0.12);\n stroke: none;\n}\n\n.line {\n fill: none;\n stroke: var(--_panneau-line-chart-color);\n stroke-width: var(--panneau-line-chart-line-width, 2px);\n stroke-linejoin: round;\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n}\n\n/* A path of no length with a round cap: a dot that the stretched plot doesn't deform. */\n.dot {\n fill: none;\n stroke: var(--_panneau-line-chart-color);\n stroke-width: var(--panneau-line-chart-dot-size, 6px);\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n}\n\n.max,\n.labels {\n font-size: var(--panneau-line-chart-label-font-size, var(--panneau-font-size-xs));\n font-variant-numeric: var(--panneau-font-numeric);\n color: var(--panneau-color-text-muted);\n}\n\n.max {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n line-height: 1;\n transform: translateY(-50%);\n padding-inline-end: var(--panneau-space-1);\n background-color: var(--panneau-card-bg, var(--panneau-color-surface));\n}\n\n.labels {\n display: flex;\n justify-content: space-between;\n gap: var(--panneau-space-2);\n}\n\n.visuallyHidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Tokens of LineChart. */
|
|
2
|
+
export declare const lineChartTokens: import("../index.js").ComponentTokens<"line-chart", "panneau-line-chart-height" | "panneau-line-chart-label-font-size" | "panneau-line-chart-line-width" | "panneau-line-chart-dot-size" | "panneau-line-chart-area-opacity">;
|
|
3
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/line-chart/tokens.ts"],"names":[],"mappings":"AAEA,2BAA2B;AAC3B,eAAO,MAAM,eAAe,sNAW1B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineComponentTokens } from "../theme/componentTokens.js";
|
|
2
|
+
//#region src/line-chart/tokens.ts
|
|
3
|
+
/** Tokens of LineChart. */
|
|
4
|
+
var lineChartTokens = defineComponentTokens("line-chart", {
|
|
5
|
+
/** Height of the plot, without the labels under it. */
|
|
6
|
+
height: "8rem",
|
|
7
|
+
/** Width of the line. */
|
|
8
|
+
"line-width": "2px",
|
|
9
|
+
/** Diameter of the dots of the points. */
|
|
10
|
+
"dot-size": "6px",
|
|
11
|
+
/** Opacity of the area under the line. */
|
|
12
|
+
"area-opacity": "0.12",
|
|
13
|
+
/** Font size of the labels. */
|
|
14
|
+
"label-font-size": "var(--panneau-font-size-xs)"
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { lineChartTokens };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","lineChartTokens","height"],"sources":["../../src/line-chart/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of LineChart. */\nexport const lineChartTokens = defineComponentTokens('line-chart', {\n /** Height of the plot, without the labels under it. */\n height: '8rem',\n /** Width of the line. */\n 'line-width': '2px',\n /** Diameter of the dots of the points. */\n 'dot-size': '6px',\n /** Opacity of the area under the line. */\n 'area-opacity': '0.12',\n /** Font size of the labels. */\n 'label-font-size': 'var(--panneau-font-size-xs)',\n});\n"],"mappings":";;;AAGA,IAAaC,kBAAkBD,sBAAsB,cAAc;;CAE/DE,QAAQ;;CAER,cAAc;;CAEd,YAAY;;CAEZ,gBAAgB;;CAEhB,mBAAmB;AACvB,CAAC"}
|
|
@@ -57,6 +57,12 @@
|
|
|
57
57
|
--panneau-color-info-solid: #1d4ed8;
|
|
58
58
|
--panneau-color-info-solid-hover: #1e40af;
|
|
59
59
|
--panneau-color-info-solid-text: #ffffff;
|
|
60
|
+
--panneau-color-muted: #52525b;
|
|
61
|
+
--panneau-color-muted-subtle: transparent;
|
|
62
|
+
--panneau-color-muted-border: #8b8b94;
|
|
63
|
+
--panneau-color-muted-solid: #52525b;
|
|
64
|
+
--panneau-color-muted-solid-hover: #3f3f46;
|
|
65
|
+
--panneau-color-muted-solid-text: #ffffff;
|
|
60
66
|
|
|
61
67
|
/*
|
|
62
68
|
* Data visualization: 8 categorical colors in a fixed order, a sequential ramp from low to high,
|
|
@@ -190,6 +196,12 @@
|
|
|
190
196
|
--panneau-color-info: #1d4ed8;
|
|
191
197
|
--panneau-color-info-subtle: #eff6ff;
|
|
192
198
|
--panneau-color-info-border: #93c5fd;
|
|
199
|
+
--panneau-color-muted: #52525b;
|
|
200
|
+
--panneau-color-muted-subtle: transparent;
|
|
201
|
+
--panneau-color-muted-border: #8b8b94;
|
|
202
|
+
--panneau-color-muted-solid: #52525b;
|
|
203
|
+
--panneau-color-muted-solid-hover: #3f3f46;
|
|
204
|
+
--panneau-color-muted-solid-text: #ffffff;
|
|
193
205
|
--panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);
|
|
194
206
|
--panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.08), 0 4px 12px rgb(0 0 0 / 0.08);
|
|
195
207
|
--panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.08), 0 16px 40px rgb(0 0 0 / 0.16);
|
|
@@ -246,6 +258,12 @@
|
|
|
246
258
|
--panneau-color-info: #93c5fd;
|
|
247
259
|
--panneau-color-info-subtle: rgb(30 58 138 / 0.35);
|
|
248
260
|
--panneau-color-info-border: #1d4ed8;
|
|
261
|
+
--panneau-color-muted: #a1a1aa;
|
|
262
|
+
--panneau-color-muted-subtle: transparent;
|
|
263
|
+
--panneau-color-muted-border: #71717a;
|
|
264
|
+
--panneau-color-muted-solid: #52525b;
|
|
265
|
+
--panneau-color-muted-solid-hover: #3f3f46;
|
|
266
|
+
--panneau-color-muted-solid-text: #ffffff;
|
|
249
267
|
--panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
|
|
250
268
|
--panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);
|
|
251
269
|
--panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.5);
|
|
@@ -303,6 +321,12 @@
|
|
|
303
321
|
--panneau-color-info: #93c5fd;
|
|
304
322
|
--panneau-color-info-subtle: rgb(30 58 138 / 0.35);
|
|
305
323
|
--panneau-color-info-border: #1d4ed8;
|
|
324
|
+
--panneau-color-muted: #a1a1aa;
|
|
325
|
+
--panneau-color-muted-subtle: transparent;
|
|
326
|
+
--panneau-color-muted-border: #71717a;
|
|
327
|
+
--panneau-color-muted-solid: #52525b;
|
|
328
|
+
--panneau-color-muted-solid-hover: #3f3f46;
|
|
329
|
+
--panneau-color-muted-solid-text: #ffffff;
|
|
306
330
|
--panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
|
|
307
331
|
--panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);
|
|
308
332
|
--panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.5);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
import { type NamedIconLoader } from '../icon/namedIcons.js';
|
|
3
3
|
import { type ColorScheme, type Density, type Theme } from '../theme/theme.js';
|
|
4
|
+
import { type ToastPlacement } from '../toast/Toast.js';
|
|
4
5
|
export interface PanneauRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
6
|
/**
|
|
6
7
|
* Tokens, tones, variants and fonts that override the default theme: `bootstrapTheme`, or a
|
|
@@ -42,6 +43,12 @@ export interface PanneauRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
42
43
|
* nonce React Aria reads too: that of `<meta property="csp-nonce">`, or `__webpack_nonce__`.
|
|
43
44
|
*/
|
|
44
45
|
nonce?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Where toasts show: `bottom` (centered, the default), `bottom-end` or `top-end`. At the bottom,
|
|
48
|
+
* they rise above what sticks to the bottom of the page, such as the footer of a form
|
|
49
|
+
* (`useToastOffset()`). On a phone, they take the whole width.
|
|
50
|
+
*/
|
|
51
|
+
toastPlacement?: ToastPlacement;
|
|
45
52
|
children?: ReactNode;
|
|
46
53
|
}
|
|
47
54
|
/**
|
|
@@ -83,5 +90,5 @@ export declare function usePortalContainer(): Element | null | undefined;
|
|
|
83
90
|
* any token with its own class on the root. Without an `IntlProvider` above it, it provides one
|
|
84
91
|
* with Panneau's messages in its `locale`.
|
|
85
92
|
*/
|
|
86
|
-
export declare function PanneauRoot({ theme, colorScheme, density, iconLoader, locale, messages, nonce: givenNonce, className, children, ...props }: PanneauRootProps): import("react").JSX.Element;
|
|
93
|
+
export declare function PanneauRoot({ theme, colorScheme, density, iconLoader, locale, messages, nonce: givenNonce, toastPlacement, className, children, ...props }: PanneauRootProps): import("react").JSX.Element;
|
|
87
94
|
//# sourceMappingURL=PanneauRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanneauRoot.d.ts","sourceRoot":"","sources":["../../src/root/PanneauRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAC;AAM1F,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,oBAAoB,CAAC;AAElF,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,KAAK,EAGb,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"PanneauRoot.d.ts","sourceRoot":"","sources":["../../src/root/PanneauRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAA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