@panneau/ui 5.0.0-alpha.39 → 5.0.0-alpha.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +4 -1
  2. package/dist/chart-legend/ChartLegend.css +73 -0
  3. package/dist/chart-legend/ChartLegend.d.ts +32 -0
  4. package/dist/chart-legend/ChartLegend.d.ts.map +1 -0
  5. package/dist/chart-legend/ChartLegend.js +76 -0
  6. package/dist/chart-legend/ChartLegend.js.map +1 -0
  7. package/dist/chart-legend/ChartLegend.module.js +26 -0
  8. package/dist/chart-legend/ChartLegend.module.js.map +1 -0
  9. package/dist/index.d.ts +3 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +3 -1
  12. package/dist/line-chart/LineChart.css +31 -0
  13. package/dist/line-chart/LineChart.d.ts +24 -1
  14. package/dist/line-chart/LineChart.d.ts.map +1 -1
  15. package/dist/line-chart/LineChart.js +517 -533
  16. package/dist/line-chart/LineChart.js.map +1 -1
  17. package/dist/line-chart/LineChart.module.js +9 -1
  18. package/dist/line-chart/LineChart.module.js.map +1 -1
  19. package/dist/sparkline/Sparkline.css +44 -0
  20. package/dist/sparkline/Sparkline.d.ts +23 -0
  21. package/dist/sparkline/Sparkline.d.ts.map +1 -0
  22. package/dist/sparkline/Sparkline.js +164 -0
  23. package/dist/sparkline/Sparkline.js.map +1 -0
  24. package/dist/sparkline/Sparkline.module.js +20 -0
  25. package/dist/sparkline/Sparkline.module.js.map +1 -0
  26. package/dist/sparkline/tokens.d.ts +3 -0
  27. package/dist/sparkline/tokens.d.ts.map +1 -0
  28. package/dist/sparkline/tokens.js +17 -0
  29. package/dist/sparkline/tokens.js.map +1 -0
  30. package/dist/stat/Stat.css +30 -0
  31. package/dist/stat/Stat.d.ts +15 -1
  32. package/dist/stat/Stat.d.ts.map +1 -1
  33. package/dist/stat/Stat.js +48 -33
  34. package/dist/stat/Stat.js.map +1 -1
  35. package/dist/stat/Stat.module.js +9 -1
  36. package/dist/stat/Stat.module.js.map +1 -1
  37. package/dist/theme/components.d.ts +1 -0
  38. package/dist/theme/components.d.ts.map +1 -1
  39. package/dist/theme/components.js +2 -0
  40. package/dist/theme/components.js.map +1 -1
  41. package/package.json +3 -3
package/README.md CHANGED
@@ -260,7 +260,10 @@ Each default categorical color reaches 3:1 against the surface (WCAG non-text co
260
260
 
261
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.
262
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.
263
- - Both draw a skeleton of their shape while their `value` or `points` are `undefined`.
263
+ - With `series` instead of `points`, `LineChart` draws a line per series on the categorical colors or the color of a `tone`, stacked as areas with `stacked`, without values written on them, and its table has a column per line ([decision 0089](../../docs/decisions/0089-combined-widgets.md)). `ChartLegend` lists their names, totals and help beside it.
264
+ - `Stat` takes a `change` from a previous value: its direction, drawn as an arrow and said to assistive technologies, what it is (`12% from the previous 30 days`), and a `tone` only when the change is good or bad news.
265
+ - `Sparkline` draws a small line of values without a scale or labels, from the lowest to the highest: the trend beside a number, in a card or a row of a table. With a `label`, it is an image; without one, it is decorative.
266
+ - They draw a skeleton of their shape while their `value`, `points` or `values` are `undefined`.
264
267
 
265
268
  ### Checking a theme
266
269
 
@@ -0,0 +1,73 @@
1
+ .panneau-chart-legend-legend {
2
+ display: grid;
3
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
4
+ gap: var(--panneau-space-2) var(--panneau-space-4);
5
+ margin: 0;
6
+ padding: 0;
7
+ list-style: none;
8
+ font-size: var(--panneau-font-size-sm);
9
+ }
10
+
11
+ .panneau-chart-legend-item {
12
+ display: flex;
13
+ align-items: baseline;
14
+ gap: var(--panneau-space-2);
15
+ min-width: 0;
16
+ }
17
+
18
+ /* The color of the line: categorical, or the solid color of a tone. */
19
+ .panneau-chart-legend-swatch {
20
+ flex-shrink: 0;
21
+ align-self: center;
22
+ width: 0.625rem;
23
+ height: 0.625rem;
24
+ border-radius: 2px;
25
+ background-color: var(--_panneau-chart-legend-color);
26
+ }
27
+
28
+ .panneau-chart-legend-toned {
29
+ --_panneau-chart-legend-color: var(--panneau-tone-solid);
30
+ }
31
+
32
+ .panneau-chart-legend-text {
33
+ display: flex;
34
+ flex: 1;
35
+ flex-direction: column;
36
+ min-width: 0;
37
+ }
38
+
39
+ .panneau-chart-legend-label {
40
+ overflow: hidden;
41
+ color: var(--panneau-color-text);
42
+ text-decoration: none;
43
+ text-overflow: ellipsis;
44
+ white-space: nowrap;
45
+ }
46
+
47
+ a.panneau-chart-legend-label:hover,
48
+ a.panneau-chart-legend-label[data-hovered] {
49
+ text-decoration: underline;
50
+ }
51
+
52
+ .panneau-chart-legend-label[data-focus-visible] {
53
+ outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
54
+ outline-offset: 2px;
55
+ border-radius: var(--panneau-radius-sm);
56
+ }
57
+
58
+ .panneau-chart-legend-help {
59
+ font-size: var(--panneau-font-size-xs);
60
+ color: var(--panneau-color-text-muted);
61
+ }
62
+
63
+ .panneau-chart-legend-help-toned {
64
+ font-weight: var(--panneau-font-weight-medium);
65
+ color: var(--panneau-tone-text);
66
+ }
67
+
68
+ .panneau-chart-legend-value {
69
+ flex-shrink: 0;
70
+ font-variant-numeric: var(--panneau-font-numeric);
71
+ font-weight: var(--panneau-font-weight-medium);
72
+ color: var(--panneau-color-text);
73
+ }
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { Tone } from '../theme/tones.js';
3
+ /** An entry of a `ChartLegend`: a line or an area of a chart. */
4
+ export interface ChartLegendItem {
5
+ /** Its name: `Emails`. */
6
+ label: string;
7
+ /** Its value, formatted: its total over the chart. */
8
+ value?: ReactNode;
9
+ /** A line under its name: `4 failed`. */
10
+ help?: ReactNode;
11
+ /** The tone of `help`, when it calls for attention, which its words say too. */
12
+ helpTone?: Tone | undefined;
13
+ /** Its categorical color, from 0: the color of its line. Defaults to its place. */
14
+ color?: number | undefined;
15
+ /** The solid color of a tone instead, as its line. */
16
+ tone?: Tone | undefined;
17
+ /** Makes its name a link: to the list of what it counts. */
18
+ href?: string | undefined;
19
+ }
20
+ export interface ChartLegendProps {
21
+ /** What the legend is of, for assistive technologies: the name of the chart. */
22
+ label: string;
23
+ items: ChartLegendItem[];
24
+ className?: string | undefined;
25
+ }
26
+ /**
27
+ * The legend of a chart with several lines or areas: the color, the name, the value and a line of
28
+ * help of each, in the order of the chart. The colors repeat those of the chart, whose names say
29
+ * which is which: assistive technologies read a list of names and values.
30
+ */
31
+ export declare function ChartLegend({ label, items, className }: ChartLegendProps): import("react").JSX.Element;
32
+ //# sourceMappingURL=ChartLegend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartLegend.d.ts","sourceRoot":"","sources":["../../src/chart-legend/ChartLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAKtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC5B,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,yCAAyC;IACzC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC5B,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,sDAAsD;IACtD,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC7B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BA+CxE"}
@@ -0,0 +1,76 @@
1
+ import { cx } from "../utils/cx.js";
2
+ import { toneClass } from "../theme/toneClass.js";
3
+ import { chartColors } from "../theme/chartColors.js";
4
+ import ChartLegend_module_default from "./ChartLegend.module.js";
5
+ import { c } from "react/compiler-runtime";
6
+ import { Link } from "react-aria-components";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/chart-legend/ChartLegend.tsx
9
+ /**
10
+ * The legend of a chart with several lines or areas: the color, the name, the value and a line of
11
+ * help of each, in the order of the chart. The colors repeat those of the chart, whose names say
12
+ * which is which: assistive technologies read a list of names and values.
13
+ */
14
+ function ChartLegend(t0) {
15
+ const $ = c(8);
16
+ const { label, items, className } = t0;
17
+ let t1;
18
+ if ($[0] !== className) {
19
+ t1 = cx("panneau-chart-legend", ChartLegend_module_default.legend, className);
20
+ $[0] = className;
21
+ $[1] = t1;
22
+ } else t1 = $[1];
23
+ let t2;
24
+ if ($[2] !== items) {
25
+ t2 = items.map(_temp);
26
+ $[2] = items;
27
+ $[3] = t2;
28
+ } else t2 = $[3];
29
+ let t3;
30
+ if ($[4] !== label || $[5] !== t1 || $[6] !== t2) {
31
+ t3 = /* @__PURE__ */ jsx("ul", {
32
+ "aria-label": label,
33
+ className: t1,
34
+ children: t2
35
+ });
36
+ $[4] = label;
37
+ $[5] = t1;
38
+ $[6] = t2;
39
+ $[7] = t3;
40
+ } else t3 = $[7];
41
+ return t3;
42
+ }
43
+ function _temp(item, index) {
44
+ return /* @__PURE__ */ jsxs("li", {
45
+ className: ChartLegend_module_default.item,
46
+ children: [
47
+ /* @__PURE__ */ jsx("span", {
48
+ "aria-hidden": "true",
49
+ className: cx(ChartLegend_module_default.swatch, item.tone !== void 0 && ChartLegend_module_default.toned, item.tone !== void 0 && toneClass(item.tone)),
50
+ style: { "--_panneau-chart-legend-color": chartColors.categorical(item.color ?? index) }
51
+ }),
52
+ /* @__PURE__ */ jsxs("span", {
53
+ className: ChartLegend_module_default.text,
54
+ children: [item.href !== void 0 ? /* @__PURE__ */ jsx(Link, {
55
+ href: item.href,
56
+ className: ChartLegend_module_default.label,
57
+ children: item.label
58
+ }) : /* @__PURE__ */ jsx("span", {
59
+ className: ChartLegend_module_default.label,
60
+ children: item.label
61
+ }), item.help !== void 0 && item.help !== null ? /* @__PURE__ */ jsx("span", {
62
+ className: cx(ChartLegend_module_default.help, item.helpTone !== void 0 && ChartLegend_module_default.helpToned, item.helpTone !== void 0 && toneClass(item.helpTone)),
63
+ children: item.help
64
+ }) : null]
65
+ }),
66
+ item.value !== void 0 && item.value !== null ? /* @__PURE__ */ jsx("span", {
67
+ className: ChartLegend_module_default.value,
68
+ children: item.value
69
+ }) : null
70
+ ]
71
+ }, `${index}-${item.label}`);
72
+ }
73
+ //#endregion
74
+ export { ChartLegend };
75
+
76
+ //# sourceMappingURL=ChartLegend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartLegend.js","names":["CSSProperties","ReactNode","Link","chartColors","toneClass","Tone","cx","styles","ChartLegendItem","label","value","help","helpTone","color","tone","href","ChartLegendProps","items","className","ChartLegend","t0","$","_c","t1","legend","t2","map","_temp","t3","item","index","swatch","undefined","toned","categorical","text","helpToned","_c","styles"],"sources":["../../src/chart-legend/ChartLegend.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport { Link } from 'react-aria-components';\n\nimport { chartColors } from '../theme/chartColors';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './ChartLegend.module.css';\n\n/** An entry of a `ChartLegend`: a line or an area of a chart. */\nexport interface ChartLegendItem {\n /** Its name: `Emails`. */\n label: string;\n /** Its value, formatted: its total over the chart. */\n value?: ReactNode;\n /** A line under its name: `4 failed`. */\n help?: ReactNode;\n /** The tone of `help`, when it calls for attention, which its words say too. */\n helpTone?: Tone | undefined;\n /** Its categorical color, from 0: the color of its line. Defaults to its place. */\n color?: number | undefined;\n /** The solid color of a tone instead, as its line. */\n tone?: Tone | undefined;\n /** Makes its name a link: to the list of what it counts. */\n href?: string | undefined;\n}\n\nexport interface ChartLegendProps {\n /** What the legend is of, for assistive technologies: the name of the chart. */\n label: string;\n items: ChartLegendItem[];\n className?: string | undefined;\n}\n\n/**\n * The legend of a chart with several lines or areas: the color, the name, the value and a line of\n * help of each, in the order of the chart. The colors repeat those of the chart, whose names say\n * which is which: assistive technologies read a list of names and values.\n */\nexport function ChartLegend({ label, items, className }: ChartLegendProps) {\n return (\n <ul aria-label={label} className={cx('panneau-chart-legend', styles.legend, className)}>\n {items.map((item, index) => (\n <li key={`${index}-${item.label}`} className={styles.item}>\n <span\n aria-hidden=\"true\"\n className={cx(\n styles.swatch,\n item.tone !== undefined && styles.toned,\n item.tone !== undefined && toneClass(item.tone),\n )}\n style={\n {\n '--_panneau-chart-legend-color': chartColors.categorical(\n item.color ?? index,\n ),\n } as CSSProperties\n }\n />\n <span className={styles.text}>\n {item.href !== undefined ? (\n <Link href={item.href} className={styles.label}>\n {item.label}\n </Link>\n ) : (\n <span className={styles.label}>{item.label}</span>\n )}\n {item.help !== undefined && item.help !== null ? (\n <span\n className={cx(\n styles.help,\n item.helpTone !== undefined && styles.helpToned,\n item.helpTone !== undefined && toneClass(item.helpTone),\n )}\n >\n {item.help}\n </span>\n ) : null}\n </span>\n {item.value !== undefined && item.value !== null ? (\n <span className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,KAAId,SAAUiB,KAAAA,IACX,oBAAC,MAAD;KAAY,MAAAH,KAAId;KAAkB,WAAAR,2BAAME;KACnCoB,UAAAA,KAAIpB;IADJ,CAAA,IAIL,oBAAA,QAAA;KAAiB,WAAAF,2BAAME;KAASoB,UAAAA,KAAIpB;IAAc,CAAA,GAErDoB,KAAIlB,SAAUqB,KAAAA,KAAaH,KAAIlB,SAAU,OACtC,oBAAA,QAAA;KACe,WAAAL,GACPC,2BAAMI,MACNkB,KAAIjB,aAAcoB,KAAAA,KAAazB,2BAAM6B,WACrCP,KAAIjB,aAAcoB,KAAAA,KAAa5B,UAAUyB,KAAIjB,QAAS,CAC1D;KAECiB,UAAAA,KAAIlB;IACF,CAAA,IATV,IAWE;;GACNkB,KAAInB,UAAWsB,KAAAA,KAAaH,KAAInB,UAAW,OACxC,oBAAA,QAAA;IAAiB,WAAAH,2BAAMG;IAASmB,UAAAA,KAAInB;GAAc,CAAA,IADrD;EAGA;CAvCI,GAAA,GAAGoB,MAAK,GAAID,KAAIpB,OAuCpB;AAAA"}
@@ -0,0 +1,26 @@
1
+ import "./ChartLegend.css";
2
+ //#region src/chart-legend/ChartLegend.module.css
3
+ var legend = "panneau-chart-legend-legend";
4
+ var item = "panneau-chart-legend-item";
5
+ var swatch = "panneau-chart-legend-swatch";
6
+ var toned = "panneau-chart-legend-toned";
7
+ var text = "panneau-chart-legend-text";
8
+ var label = "panneau-chart-legend-label";
9
+ var help = "panneau-chart-legend-help";
10
+ var helpToned = "panneau-chart-legend-help-toned";
11
+ var value = "panneau-chart-legend-value";
12
+ var ChartLegend_module_default = {
13
+ legend,
14
+ item,
15
+ swatch,
16
+ toned,
17
+ text,
18
+ label,
19
+ help,
20
+ helpToned,
21
+ value
22
+ };
23
+ //#endregion
24
+ export { ChartLegend_module_default as default, help, helpToned, item, label, legend, swatch, text, toned, value };
25
+
26
+ //# sourceMappingURL=ChartLegend.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartLegend.module.js","names":[],"sources":["../../src/chart-legend/ChartLegend.module.css"],"sourcesContent":[".legend {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));\n gap: var(--panneau-space-2) var(--panneau-space-4);\n margin: 0;\n padding: 0;\n list-style: none;\n font-size: var(--panneau-font-size-sm);\n}\n\n.item {\n display: flex;\n align-items: baseline;\n gap: var(--panneau-space-2);\n min-width: 0;\n}\n\n/* The color of the line: categorical, or the solid color of a tone. */\n.swatch {\n flex-shrink: 0;\n align-self: center;\n width: 0.625rem;\n height: 0.625rem;\n border-radius: 2px;\n background-color: var(--_panneau-chart-legend-color);\n}\n\n.toned {\n --_panneau-chart-legend-color: var(--panneau-tone-solid);\n}\n\n.text {\n display: flex;\n flex: 1;\n flex-direction: column;\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.help {\n font-size: var(--panneau-font-size-xs);\n color: var(--panneau-color-text-muted);\n}\n\n.helpToned {\n font-weight: var(--panneau-font-weight-medium);\n color: var(--panneau-tone-text);\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"],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { BarChart, type BarChartItem, type BarChartProps } from './bar-chart/Bar
5
5
  export { Button, type ButtonAppearance, type ButtonProps, type ButtonStyleProps, type ButtonVariant, type ButtonVariants, } from './button/Button.js';
6
6
  export { LinkButton, type LinkButtonProps } from './button/LinkButton.js';
7
7
  export { Card, type CardProps } from './card/Card.js';
8
+ export { ChartLegend, type ChartLegendItem, type ChartLegendProps, } from './chart-legend/ChartLegend.js';
8
9
  export { CommandPalette, type CommandPaletteProps } from './command-palette/CommandPalette.js';
9
10
  export { type CommandPaletteGroup, type CommandPaletteItem, matchCommands, normalizeSearch, } from './command-palette/match.js';
10
11
  export { isApplePlatform, useCommandShortcut } from './command-palette/useCommandShortcut.js';
@@ -44,9 +45,10 @@ export { BREAKPOINTS, type Breakpoint, type Justification, type Responsive, type
44
45
  export { Prose, type ProseProps } from './prose/Prose.js';
45
46
  export { LoadingRegion, type LoadingRegionProps } from './skeleton/LoadingRegion.js';
46
47
  export { Skeleton, type SkeletonProps } from './skeleton/Skeleton.js';
48
+ export { Sparkline, type SparklineProps } from './sparkline/Sparkline.js';
47
49
  export { Spinner, type SpinnerProps } from './spinner/Spinner.js';
48
50
  export { Stack, type StackProps } from './stack/Stack.js';
49
- export { Stat, type StatProps } from './stat/Stat.js';
51
+ export { Stat, type StatChange, type StatProps } from './stat/Stat.js';
50
52
  export { Switch, type SwitchProps } from './switch/Switch.js';
51
53
  export { Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, } from './tabs/Tabs.js';
52
54
  export { Text, type TextFamily, type TextProps, type TextSize } from './text/Text.js';
@@ -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,EAAE,QAAQ,EAAE,KAAK,YAAY,EAA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,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EACH,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,UAAU,EACV,aAAa,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EACH,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,eAAe,EACf,QAAQ,EACR,cAAc,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -18,6 +18,7 @@ import { CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, chartColors } from "./
18
18
  import { BarChart } from "./bar-chart/BarChart.js";
19
19
  import { LinkButton } from "./button/LinkButton.js";
20
20
  import { Card } from "./card/Card.js";
21
+ import { ChartLegend } from "./chart-legend/ChartLegend.js";
21
22
  import { matchCommands, normalizeSearch } from "./command-palette/match.js";
22
23
  import { CommandPalette } from "./command-palette/CommandPalette.js";
23
24
  import { isApplePlatform, useCommandShortcut } from "./command-palette/useCommandShortcut.js";
@@ -48,6 +49,7 @@ import { LineChart } from "./line-chart/LineChart.js";
48
49
  import { Meter } from "./meter/Meter.js";
49
50
  import { Prose } from "./prose/Prose.js";
50
51
  import { LoadingRegion } from "./skeleton/LoadingRegion.js";
52
+ import { Sparkline } from "./sparkline/Sparkline.js";
51
53
  import { Stack } from "./stack/Stack.js";
52
54
  import { Stat } from "./stat/Stat.js";
53
55
  import { Switch } from "./switch/Switch.js";
@@ -62,4 +64,4 @@ import { defineComponentTokens } from "./theme/componentTokens.js";
62
64
  import { componentTokens } from "./theme/components.js";
63
65
  import { SEMANTIC_TOKENS } from "./theme/semanticTokens.js";
64
66
  import { defineTheme, findUnknownTokens, mergeThemes } from "./theme/defineTheme.js";
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 };
67
+ export { Alert, Aside, AsideLayout, AsidePanel, BREAKPOINTS, BUILT_IN_TONES, Badge, BarChart, Button, CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, Card, ChartLegend, 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, Sparkline, 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 };
@@ -120,6 +120,18 @@
120
120
  stroke: none;
121
121
  }
122
122
 
123
+ /* A line of several in the color of a tone */
124
+ .panneau-line-chart-toned {
125
+ --_panneau-line-chart-color: var(--panneau-tone-solid);
126
+ }
127
+
128
+ /* A stacked line: the area between it and the one under it */
129
+ .panneau-line-chart-stack-area {
130
+ fill: var(--_panneau-line-chart-color);
131
+ fill-opacity: calc(var(--panneau-line-chart-area-opacity, 0.2) * 1.75);
132
+ stroke: none;
133
+ }
134
+
123
135
  .panneau-line-chart-line {
124
136
  fill: none;
125
137
  stroke: var(--_panneau-line-chart-color);
@@ -238,6 +250,25 @@
238
250
  color: var(--panneau-color-text-muted);
239
251
  }
240
252
 
253
+ .panneau-line-chart-tooltip-row {
254
+ display: flex;
255
+ align-items: center;
256
+ gap: var(--panneau-space-1);
257
+ }
258
+
259
+ .panneau-line-chart-tooltip-row .panneau-line-chart-tooltip-value {
260
+ margin-inline-start: auto;
261
+ padding-inline-start: var(--panneau-space-2);
262
+ }
263
+
264
+ .panneau-line-chart-swatch {
265
+ flex-shrink: 0;
266
+ width: 0.625rem;
267
+ height: 0.625rem;
268
+ border-radius: 2px;
269
+ background-color: var(--_panneau-line-chart-color);
270
+ }
271
+
241
272
  .panneau-line-chart-dates {
242
273
  position: relative;
243
274
  grid-column: -2 / -1;
@@ -1,3 +1,4 @@
1
+ import type { Tone } from '../theme/tones.js';
1
2
  /** A point of a `LineChart`. */
2
3
  export interface LineChartPoint {
3
4
  /** What the point is, in its table and its tooltip: a day, a week, a month. */
@@ -6,11 +7,33 @@ export interface LineChartPoint {
6
7
  shortLabel?: string | undefined;
7
8
  value: number;
8
9
  }
10
+ /** A line of a `LineChart` with several. */
11
+ export interface LineChartSeries {
12
+ /** What the line is: a column of the table of the chart, and a line of its tooltip. */
13
+ label: string;
14
+ /**
15
+ * Its points, one per date, in the order of those of the first line, whose labels are the
16
+ * dates of the chart. A point missing is 0.
17
+ */
18
+ points: LineChartPoint[];
19
+ /** Its categorical color, from 0. Defaults to its place among the lines. */
20
+ color?: number | undefined;
21
+ /** The solid color of a tone instead. */
22
+ tone?: Tone | undefined;
23
+ }
9
24
  export interface LineChartProps {
10
25
  /** What the chart shows: the caption of its table, for assistive technologies. */
11
26
  label: string;
12
27
  /** The points, in order. Left `undefined` while they load: a skeleton of the plot. */
13
28
  points?: LineChartPoint[] | undefined;
29
+ /**
30
+ * Several lines over the same dates, instead of `points`: each on its categorical color or its
31
+ * tone, without values written on them (a legend beside the chart gives their names and
32
+ * totals). The table of the chart has a column per line.
33
+ */
34
+ series?: LineChartSeries[] | undefined;
35
+ /** Stacks the lines of `series`, as areas: the top one is their total. */
36
+ stacked?: boolean | undefined;
14
37
  /** Formats a value: in the table, the labels on the line and the tooltip. A number of the locale by default. */
15
38
  formatValue?: ((value: number) => string) | undefined;
16
39
  /**
@@ -57,5 +80,5 @@ export interface LineChartProps {
57
80
  * of the line. The plot is hidden from assistive technologies, which read the values in a table;
58
81
  * with `isInteractive`, the pointer and the arrow keys also show the value of each point.
59
82
  */
60
- export declare function LineChart({ label, points, formatValue, formatTick, axisLabel, showAxis, showLast, showMax, isInteractive, domain, curve, height, color, className, }: LineChartProps): import("react").JSX.Element;
83
+ export declare function LineChart({ label, points: ownPoints, series, stacked, formatValue, formatTick, axisLabel, showAxis, showLast, showMax, isInteractive, domain, curve, height, color, className, }: LineChartProps): import("react").JSX.Element;
61
84
  //# sourceMappingURL=LineChart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../src/line-chart/LineChart.tsx"],"names":[],"mappings":"AAUA,gCAAgC;AAChC,MAAM,WAAW,cAAc;IAC3B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC3B,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,MAAM,CAAC,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IACtC,gHAAgH;IAChH,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;IACtD;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;IACrD,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,GAAG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