@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
@@ -32,6 +32,36 @@
32
32
  color: var(--panneau-tone-text);
33
33
  }
34
34
 
35
+ /* The change from a previous value: an arrow and what it is, in a tone only when it says so. */
36
+ .panneau-stat-change {
37
+ display: flex;
38
+ align-items: center;
39
+ gap: var(--panneau-space-1);
40
+ font-size: var(--panneau-stat-help-font-size, var(--panneau-font-size-sm));
41
+ font-weight: var(--panneau-font-weight-medium);
42
+ color: var(--panneau-color-text-muted);
43
+ }
44
+
45
+ .panneau-stat-change-toned {
46
+ color: var(--panneau-tone-text);
47
+ }
48
+
49
+ .panneau-stat-change-icon {
50
+ flex-shrink: 0;
51
+ }
52
+
53
+ .panneau-stat-visually-hidden {
54
+ position: absolute;
55
+ width: 1px;
56
+ height: 1px;
57
+ padding: 0;
58
+ margin: -1px;
59
+ overflow: hidden;
60
+ clip-path: inset(50%);
61
+ white-space: nowrap;
62
+ border: 0;
63
+ }
64
+
35
65
  .panneau-stat-meter {
36
66
  margin-block: var(--panneau-space-1);
37
67
  }
@@ -1,6 +1,18 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { FormatNumberOptions } from 'react-intl';
3
3
  import type { Tone } from '../theme/tones.js';
4
+ /** The change of a stat from a previous value: its direction and what it is. */
5
+ export interface StatChange {
6
+ /** Up or down, drawn as an arrow and said to assistive technologies; `none` without a change. */
7
+ direction: 'up' | 'down' | 'none';
8
+ /** The change, from what: `12% from the previous 30 days`. */
9
+ label: ReactNode;
10
+ /**
11
+ * `success` or `danger` when the change is good or bad news, which the label or the context
12
+ * says too. Neutral by default: a rise isn't always good.
13
+ */
14
+ tone?: Tone | undefined;
15
+ }
4
16
  export interface StatProps {
5
17
  /** What the number counts. */
6
18
  label?: ReactNode;
@@ -25,11 +37,13 @@ export interface StatProps {
25
37
  * target, the meter takes the `tone`, or `danger` without one.
26
38
  */
27
39
  target?: number | null | undefined;
40
+ /** The change from a previous value, under the number: `↑ 12% from the previous 30 days`. */
41
+ change?: StatChange | undefined;
28
42
  className?: string;
29
43
  }
30
44
  /**
31
45
  * A number in large type, with what it counts and a line of help, and a meter of its target when it
32
46
  * has one: a stat of a dashboard.
33
47
  */
34
- export declare function Stat({ label, value, format, help, tone, href, target, className }: StatProps): import("react").JSX.Element;
48
+ export declare function Stat({ label, value, format, help, tone, href, target, change, className, }: StatProps): import("react").JSX.Element;
35
49
  //# sourceMappingURL=Stat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stat.d.ts","sourceRoot":"","sources":["../../src/stat/Stat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAMtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C,MAAM,WAAW,SAAS;IACtB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,mFAAmF;IACnF,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,wDAAwD;IACxD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,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M,EACN,MAAM,EACN,SAAS,GACZ,EAAE,SAAS,+BAyFX"}
package/dist/stat/Stat.js CHANGED
@@ -1,10 +1,13 @@
1
1
  import { cx } from "../utils/cx.js";
2
+ import { Icon } from "../icon/Icon.js";
3
+ import { messages } from "../intl/messages.js";
2
4
  import { usePanneauIntl } from "../intl/usePanneauIntl.js";
3
5
  import { toneClass } from "../theme/toneClass.js";
4
6
  import { Skeleton } from "../skeleton/Skeleton.js";
5
7
  import { Meter as Meter$1 } from "../meter/Meter.js";
6
8
  import Stat_module_default from "./Stat.module.js";
7
9
  import { c } from "react/compiler-runtime";
10
+ import { ArrowDown, ArrowUp } from "lucide-react";
8
11
  import { Link } from "react-aria-components";
9
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
13
  import { useId } from "react";
@@ -14,8 +17,8 @@ import { useId } from "react";
14
17
  * has one: a stat of a dashboard.
15
18
  */
16
19
  function Stat(t0) {
17
- const $ = c(27);
18
- const { label, value, format, help, tone, href, target, className } = t0;
20
+ const $ = c(28);
21
+ const { label, value, format, help, tone, href, target, change, className } = t0;
19
22
  const intl = usePanneauIntl();
20
23
  const labelId = useId();
21
24
  const isLoading = value === void 0;
@@ -33,7 +36,7 @@ function Stat(t0) {
33
36
  $[3] = t1;
34
37
  } else t1 = $[3];
35
38
  let t2;
36
- if ($[4] !== format || $[5] !== hasLabel || $[6] !== help || $[7] !== intl || $[8] !== isLoading || $[9] !== labelId || $[10] !== target || $[11] !== tone || $[12] !== value) {
39
+ if ($[4] !== change || $[5] !== format || $[6] !== hasLabel || $[7] !== help || $[8] !== intl || $[9] !== isLoading || $[10] !== labelId || $[11] !== target || $[12] !== tone || $[13] !== value) {
37
40
  t2 = isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
38
41
  className: Stat_module_default.value,
39
42
  children: /* @__PURE__ */ jsx(Skeleton, { width: "3ch" })
@@ -45,6 +48,17 @@ function Stat(t0) {
45
48
  className: Stat_module_default.value,
46
49
  children: typeof value === "number" ? intl.formatNumber(value, format) : value
47
50
  }),
51
+ change !== void 0 ? /* @__PURE__ */ jsxs("div", {
52
+ className: cx(Stat_module_default.change, change.tone !== void 0 && Stat_module_default.changeToned, change.tone !== void 0 && toneClass(change.tone)),
53
+ children: [change.direction !== "none" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
54
+ icon: change.direction === "up" ? ArrowUp : ArrowDown,
55
+ size: "sm",
56
+ className: Stat_module_default.changeIcon
57
+ }), /* @__PURE__ */ jsxs("span", {
58
+ className: Stat_module_default.visuallyHidden,
59
+ children: [intl.formatMessage(change.direction === "up" ? messages.statChangeUp : messages.statChangeDown), " "]
60
+ })] }) : null, /* @__PURE__ */ jsx("span", { children: change.label })]
61
+ }) : null,
48
62
  typeof value === "number" && target !== void 0 && target !== null && target > 0 ? /* @__PURE__ */ jsx(Meter$1, {
49
63
  value,
50
64
  target,
@@ -58,38 +72,39 @@ function Stat(t0) {
58
72
  children: help
59
73
  }) : null
60
74
  ] });
61
- $[4] = format;
62
- $[5] = hasLabel;
63
- $[6] = help;
64
- $[7] = intl;
65
- $[8] = isLoading;
66
- $[9] = labelId;
67
- $[10] = target;
68
- $[11] = tone;
69
- $[12] = value;
70
- $[13] = t2;
71
- } else t2 = $[13];
75
+ $[4] = change;
76
+ $[5] = format;
77
+ $[6] = hasLabel;
78
+ $[7] = help;
79
+ $[8] = intl;
80
+ $[9] = isLoading;
81
+ $[10] = labelId;
82
+ $[11] = target;
83
+ $[12] = tone;
84
+ $[13] = value;
85
+ $[14] = t2;
86
+ } else t2 = $[14];
72
87
  let t3;
73
- if ($[14] !== t1 || $[15] !== t2) {
88
+ if ($[15] !== t1 || $[16] !== t2) {
74
89
  t3 = /* @__PURE__ */ jsxs(Fragment, { children: [t1, t2] });
75
- $[14] = t1;
76
- $[15] = t2;
77
- $[16] = t3;
78
- } else t3 = $[16];
90
+ $[15] = t1;
91
+ $[16] = t2;
92
+ $[17] = t3;
93
+ } else t3 = $[17];
79
94
  const content = t3;
80
95
  const t4 = tone !== void 0 && !isLoading && Stat_module_default.toned;
81
96
  let t5;
82
- if ($[17] !== className || $[18] !== isLoading || $[19] !== t4 || $[20] !== tone) {
97
+ if ($[18] !== className || $[19] !== isLoading || $[20] !== t4 || $[21] !== tone) {
83
98
  t5 = cx("panneau-stat", Stat_module_default.stat, t4, tone !== void 0 && !isLoading && toneClass(tone), className);
84
- $[17] = className;
85
- $[18] = isLoading;
86
- $[19] = t4;
87
- $[20] = tone;
88
- $[21] = t5;
89
- } else t5 = $[21];
99
+ $[18] = className;
100
+ $[19] = isLoading;
101
+ $[20] = t4;
102
+ $[21] = tone;
103
+ $[22] = t5;
104
+ } else t5 = $[22];
90
105
  const classes = t5;
91
106
  let t6;
92
- if ($[22] !== classes || $[23] !== content || $[24] !== href || $[25] !== isLoading) {
107
+ if ($[23] !== classes || $[24] !== content || $[25] !== href || $[26] !== isLoading) {
93
108
  t6 = href !== void 0 && !isLoading ? /* @__PURE__ */ jsx(Link, {
94
109
  href,
95
110
  className: classes,
@@ -98,12 +113,12 @@ function Stat(t0) {
98
113
  className: classes,
99
114
  children: content
100
115
  });
101
- $[22] = classes;
102
- $[23] = content;
103
- $[24] = href;
104
- $[25] = isLoading;
105
- $[26] = t6;
106
- } else t6 = $[26];
116
+ $[23] = classes;
117
+ $[24] = content;
118
+ $[25] = href;
119
+ $[26] = isLoading;
120
+ $[27] = t6;
121
+ } else t6 = $[27];
107
122
  return t6;
108
123
  }
109
124
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"Stat.js","names":["ReactNode","useId","Link","FormatNumberOptions","usePanneauIntl","Meter","Skeleton","toneClass","Tone","cx","styles","StatProps","label","value","format","help","tone","href","target","className","Stat","t0","$","_c","intl","labelId","isLoading","undefined","hasLabel","t1","t2","formatNumber","number","meter","t3","content","t4","toned","t5","stat","classes","t6","_c","styles","_Fragment","Meter"],"sources":["../../src/stat/Stat.tsx"],"sourcesContent":["import { type ReactNode, useId } from 'react';\nimport { Link } from 'react-aria-components';\nimport type { FormatNumberOptions } from 'react-intl';\n\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { Meter } from '../meter/Meter';\nimport { Skeleton } from '../skeleton/Skeleton';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Stat.module.css';\n\nexport interface StatProps {\n /** What the number counts. */\n label?: ReactNode;\n /**\n * The number, formatted for the locale, or text already formatted. Left `undefined` while it\n * loads: a skeleton of the number and its help, in a `LoadingRegion` of the caller.\n */\n value?: number | string | undefined;\n /** Options of `Intl.NumberFormat` for a number: a currency, a percent, compact. */\n format?: FormatNumberOptions;\n /** A line under the number: `3 more than last week`. */\n help?: ReactNode;\n /**\n * Colors the number, only when it calls for attention (`warning`, `danger`): the help says why,\n * since color alone says nothing to some users. Neutral by default, and at 0.\n */\n tone?: Tone | undefined;\n /** Makes the stat a link: to the list of what it counts. */\n href?: string | undefined;\n /**\n * A target for the number (a budget, a quota), above 0: a meter under the number. Past the\n * target, the meter takes the `tone`, or `danger` without one.\n */\n target?: number | null | undefined;\n className?: string;\n}\n\n/**\n * A number in large type, with what it counts and a line of help, and a meter of its target when it\n * has one: a stat of a dashboard.\n */\nexport function Stat({ label, value, format, help, tone, href, target, className }: StatProps) {\n const intl = usePanneauIntl();\n const labelId = useId();\n const isLoading = value === undefined;\n const hasLabel = label !== undefined && label !== null;\n const content = (\n <>\n {hasLabel ? (\n <div id={labelId} className={styles.label}>\n {label}\n </div>\n ) : null}\n {isLoading ? (\n <>\n <span className={styles.value}>\n <Skeleton width=\"3ch\" />\n </span>\n {help !== undefined ? (\n <span className={styles.help}>\n <Skeleton width=\"60%\" />\n </span>\n ) : null}\n </>\n ) : (\n <>\n <div className={styles.value}>\n {typeof value === 'number' ? intl.formatNumber(value, format) : value}\n </div>\n {typeof value === 'number' &&\n target !== undefined &&\n target !== null &&\n target > 0 ? (\n <Meter\n value={value}\n target={target}\n tone={value > target ? (tone ?? 'danger') : undefined}\n formatValue={(number) => intl.formatNumber(number, format)}\n {...(hasLabel && { 'aria-labelledby': labelId })}\n className={styles.meter}\n />\n ) : null}\n {help !== undefined && help !== null ? (\n <div className={styles.help}>{help}</div>\n ) : null}\n </>\n )}\n </>\n );\n const classes = cx(\n 'panneau-stat',\n styles.stat,\n tone !== undefined && !isLoading && styles.toned,\n tone !== undefined && !isLoading && toneClass(tone),\n className,\n );\n return href !== undefined && !isLoading ? (\n <Link href={href} className={classes}>\n {content}\n </Link>\n ) : (\n <div className={classes}>{content}</div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2CA,SAAOoB,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAc,MAAA,EAAAX,OAAAC,OAAAC,QAAAC,MAAAC,MAAAC,MAAAC,QAAAC,cAAAE;CACjB,MAAAG,OAAapB,eAAe;CAC5B,MAAAqB,UAAgBxB,MAAM;CACtB,MAAAyB,YAAkBb,UAAUc,KAAAA;CAC5B,MAAAC,WAAiBhB,UAAUe,KAAAA,KAAaf,UAAU;CAAK,IAAAiB;CAAA,IAAAP,EAAA,OAAAM,YAAAN,EAAA,OAAAV,SAAAU,EAAA,OAAAG,SAAA;EAG9CI,KAAAD,WACG,oBAAA,OAAA;GAASH,IAAAA;GAAoB,WAAAf,oBAAME;GAC9BA,UAAAA;EACC,CAAA,IAHT;EAIOU,EAAA,KAAAM;EAAAN,EAAA,KAAAV;EAAAU,EAAA,KAAAG;EAAAH,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAR,UAAAQ,EAAA,OAAAM,YAAAN,EAAA,OAAAP,QAAAO,EAAA,OAAAE,QAAAF,EAAA,OAAAI,aAAAJ,EAAA,OAAAG,WAAAH,EAAA,QAAAJ,UAAAI,EAAA,QAAAN,QAAAM,EAAA,QAAAT,OAAA;EACPiB,KAAAJ,YAA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AAA,MAAAO;EAAAP,EAAA,MAAAQ;EAAAR,EAAA,MAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAzCP,MAAAa,UACID;CA6CA,MAAAE,KAAApB,SAASW,KAAAA,KAAT,CAAuBD,aAAahB,oBAAM2B;CAAM,IAAAC;CAAA,IAAAhB,EAAA,QAAAH,aAAAG,EAAA,QAAAI,aAAAJ,EAAA,QAAAc,MAAAd,EAAA,QAAAN,MAAA;EAHpCsB,KAAA7B,GACZ,gBACAC,oBAAM6B,MACNH,IACApB,SAASW,KAAAA,KAAT,CAAuBD,aAAanB,UAAUS,IAAI,GAClDG,SACJ;EAACG,EAAA,MAAAH;EAAAG,EAAA,MAAAI;EAAAJ,EAAA,MAAAc;EAAAd,EAAA,MAAAN;EAAAM,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAND,MAAAkB,UAAgBF;CAMd,IAAAG;CAAA,IAAAnB,EAAA,QAAAkB,WAAAlB,EAAA,QAAAa,WAAAb,EAAA,QAAAL,QAAAK,EAAA,QAAAI,WAAA;EACKe,KAAAxB,SAASU,KAAAA,KAAT,CAAuBD,YAC1B,oBAAC,MAAD;GAAYT;GAAiBuB,WAAAA;GACxBL,UAAAA;EADA,CAAA,IAIL,oBAAA,OAAA;GAAgBK,WAAAA;GAAUL,UAAAA;EAAc,CAAA;EAC3Cb,EAAA,MAAAkB;EAAAlB,EAAA,MAAAa;EAAAb,EAAA,MAAAL;EAAAK,EAAA,MAAAI;EAAAJ,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OANMmB;AAMN"}
1
+ {"version":3,"file":"Stat.js","names":["ArrowDown","ArrowUp","ReactNode","useId","Link","FormatNumberOptions","Icon","messages","usePanneauIntl","Meter","Skeleton","toneClass","Tone","cx","styles","StatChange","direction","label","tone","StatProps","value","format","help","href","target","change","className","Stat","t0","$","_c","intl","labelId","isLoading","undefined","hasLabel","t1","t2","formatNumber","changeToned","changeIcon","visuallyHidden","formatMessage","statChangeUp","statChangeDown","number","meter","t3","content","t4","toned","t5","stat","classes","t6","_c","styles","_Fragment","Meter"],"sources":["../../src/stat/Stat.tsx"],"sourcesContent":["import { ArrowDown, ArrowUp } from 'lucide-react';\nimport { type ReactNode, useId } from 'react';\nimport { Link } from 'react-aria-components';\nimport type { FormatNumberOptions } from 'react-intl';\n\nimport { Icon } from '../icon/Icon';\nimport { messages } from '../intl/messages';\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { Meter } from '../meter/Meter';\nimport { Skeleton } from '../skeleton/Skeleton';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Stat.module.css';\n\n/** The change of a stat from a previous value: its direction and what it is. */\nexport interface StatChange {\n /** Up or down, drawn as an arrow and said to assistive technologies; `none` without a change. */\n direction: 'up' | 'down' | 'none';\n /** The change, from what: `12% from the previous 30 days`. */\n label: ReactNode;\n /**\n * `success` or `danger` when the change is good or bad news, which the label or the context\n * says too. Neutral by default: a rise isn't always good.\n */\n tone?: Tone | undefined;\n}\n\nexport interface StatProps {\n /** What the number counts. */\n label?: ReactNode;\n /**\n * The number, formatted for the locale, or text already formatted. Left `undefined` while it\n * loads: a skeleton of the number and its help, in a `LoadingRegion` of the caller.\n */\n value?: number | string | undefined;\n /** Options of `Intl.NumberFormat` for a number: a currency, a percent, compact. */\n format?: FormatNumberOptions;\n /** A line under the number: `3 more than last week`. */\n help?: ReactNode;\n /**\n * Colors the number, only when it calls for attention (`warning`, `danger`): the help says why,\n * since color alone says nothing to some users. Neutral by default, and at 0.\n */\n tone?: Tone | undefined;\n /** Makes the stat a link: to the list of what it counts. */\n href?: string | undefined;\n /**\n * A target for the number (a budget, a quota), above 0: a meter under the number. Past the\n * target, the meter takes the `tone`, or `danger` without one.\n */\n target?: number | null | undefined;\n /** The change from a previous value, under the number: `↑ 12% from the previous 30 days`. */\n change?: StatChange | undefined;\n className?: string;\n}\n\n/**\n * A number in large type, with what it counts and a line of help, and a meter of its target when it\n * has one: a stat of a dashboard.\n */\nexport function Stat({\n label,\n value,\n format,\n help,\n tone,\n href,\n target,\n change,\n className,\n}: StatProps) {\n const intl = usePanneauIntl();\n const labelId = useId();\n const isLoading = value === undefined;\n const hasLabel = label !== undefined && label !== null;\n const content = (\n <>\n {hasLabel ? (\n <div id={labelId} className={styles.label}>\n {label}\n </div>\n ) : null}\n {isLoading ? (\n <>\n <span className={styles.value}>\n <Skeleton width=\"3ch\" />\n </span>\n {help !== undefined ? (\n <span className={styles.help}>\n <Skeleton width=\"60%\" />\n </span>\n ) : null}\n </>\n ) : (\n <>\n <div className={styles.value}>\n {typeof value === 'number' ? intl.formatNumber(value, format) : value}\n </div>\n {change !== undefined ? (\n <div\n className={cx(\n styles.change,\n change.tone !== undefined && styles.changeToned,\n change.tone !== undefined && toneClass(change.tone),\n )}\n >\n {change.direction !== 'none' ? (\n <>\n <Icon\n icon={change.direction === 'up' ? ArrowUp : ArrowDown}\n size=\"sm\"\n className={styles.changeIcon}\n />\n <span className={styles.visuallyHidden}>\n {intl.formatMessage(\n change.direction === 'up'\n ? messages.statChangeUp\n : messages.statChangeDown,\n )}{' '}\n </span>\n </>\n ) : null}\n <span>{change.label}</span>\n </div>\n ) : null}\n {typeof value === 'number' &&\n target !== undefined &&\n target !== null &&\n target > 0 ? (\n <Meter\n value={value}\n target={target}\n tone={value > target ? (tone ?? 'danger') : undefined}\n formatValue={(number) => intl.formatNumber(number, format)}\n {...(hasLabel && { 'aria-labelledby': labelId })}\n className={styles.meter}\n />\n ) : null}\n {help !== undefined && help !== null ? (\n <div className={styles.help}>{help}</div>\n ) : null}\n </>\n )}\n </>\n );\n const classes = cx(\n 'panneau-stat',\n styles.stat,\n tone !== undefined && !isLoading && styles.toned,\n tone !== undefined && !isLoading && toneClass(tone),\n className,\n );\n return href !== undefined && !isLoading ? (\n <Link href={href} className={classes}>\n {content}\n </Link>\n ) : (\n <div className={classes}>{content}</div>\n );\n}\n"],"mappings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AAA,KAAAzB,EAAA;CAAA,OANMyB;AAMN"}
@@ -4,6 +4,10 @@ var stat = "panneau-stat";
4
4
  var label = "panneau-stat-label";
5
5
  var value = "panneau-stat-value";
6
6
  var toned = "panneau-stat-toned";
7
+ var change = "panneau-stat-change";
8
+ var changeToned = "panneau-stat-change-toned";
9
+ var changeIcon = "panneau-stat-change-icon";
10
+ var visuallyHidden = "panneau-stat-visually-hidden";
7
11
  var meter = "panneau-stat-meter";
8
12
  var help = "panneau-stat-help";
9
13
  var Stat_module_default = {
@@ -11,10 +15,14 @@ var Stat_module_default = {
11
15
  label,
12
16
  value,
13
17
  toned,
18
+ change,
19
+ changeToned,
20
+ changeIcon,
21
+ visuallyHidden,
14
22
  meter,
15
23
  help
16
24
  };
17
25
  //#endregion
18
- export { Stat_module_default as default, help, label, meter, stat, toned, value };
26
+ export { change, changeIcon, changeToned, Stat_module_default as default, help, label, meter, stat, toned, value, visuallyHidden };
19
27
 
20
28
  //# sourceMappingURL=Stat.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stat.module.js","names":[],"sources":["../../src/stat/Stat.module.css"],"sourcesContent":[".stat {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-stat-gap, var(--panneau-space-1));\n min-width: 0;\n color: var(--panneau-color-text);\n text-decoration: none;\n border-radius: var(--panneau-radius-sm);\n}\n\n.stat[data-focus-visible] {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 2px;\n}\n\n.label {\n font-size: var(--panneau-stat-label-font-size, var(--panneau-font-size-sm));\n font-weight: var(--panneau-font-weight-medium);\n color: var(--panneau-color-text-muted);\n}\n\n.value {\n font-family: var(--panneau-stat-value-font-family, var(--panneau-font-family-heading));\n font-size: var(--panneau-stat-value-font-size, 2rem);\n font-weight: var(--panneau-stat-value-font-weight, var(--panneau-font-weight-bold));\n font-variant-numeric: var(--panneau-font-numeric);\n line-height: var(--panneau-line-height-tight);\n}\n\n/* A tone only when the number calls for attention: the help says why, never the color alone. */\n.toned .value {\n color: var(--panneau-tone-text);\n}\n\n.meter {\n margin-block: var(--panneau-space-1);\n}\n\n.help {\n font-size: var(--panneau-stat-help-font-size, var(--panneau-font-size-sm));\n color: var(--panneau-color-text-muted);\n}\n\n.stat[href]:hover .value,\n.stat[data-hovered] .value {\n text-decoration: underline;\n text-decoration-thickness: 2px;\n text-underline-offset: 0.15em;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Stat.module.js","names":[],"sources":["../../src/stat/Stat.module.css"],"sourcesContent":[".stat {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-stat-gap, var(--panneau-space-1));\n min-width: 0;\n color: var(--panneau-color-text);\n text-decoration: none;\n border-radius: var(--panneau-radius-sm);\n}\n\n.stat[data-focus-visible] {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 2px;\n}\n\n.label {\n font-size: var(--panneau-stat-label-font-size, var(--panneau-font-size-sm));\n font-weight: var(--panneau-font-weight-medium);\n color: var(--panneau-color-text-muted);\n}\n\n.value {\n font-family: var(--panneau-stat-value-font-family, var(--panneau-font-family-heading));\n font-size: var(--panneau-stat-value-font-size, 2rem);\n font-weight: var(--panneau-stat-value-font-weight, var(--panneau-font-weight-bold));\n font-variant-numeric: var(--panneau-font-numeric);\n line-height: var(--panneau-line-height-tight);\n}\n\n/* A tone only when the number calls for attention: the help says why, never the color alone. */\n.toned .value {\n color: var(--panneau-tone-text);\n}\n\n/* The change from a previous value: an arrow and what it is, in a tone only when it says so. */\n.change {\n display: flex;\n align-items: center;\n gap: var(--panneau-space-1);\n font-size: var(--panneau-stat-help-font-size, var(--panneau-font-size-sm));\n font-weight: var(--panneau-font-weight-medium);\n color: var(--panneau-color-text-muted);\n}\n\n.changeToned {\n color: var(--panneau-tone-text);\n}\n\n.changeIcon {\n flex-shrink: 0;\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\n.meter {\n margin-block: var(--panneau-space-1);\n}\n\n.help {\n font-size: var(--panneau-stat-help-font-size, var(--panneau-font-size-sm));\n color: var(--panneau-color-text-muted);\n}\n\n.stat[href]:hover .value,\n.stat[data-hovered] .value {\n text-decoration: underline;\n text-decoration-thickness: 2px;\n text-underline-offset: 0.15em;\n}\n"],"mappings":""}
@@ -34,6 +34,7 @@ export declare const componentTokens: Readonly<{
34
34
  'segmented-control': Readonly<Record<"panneau-segmented-control-radius" | "panneau-segmented-control-padding" | "panneau-segmented-control-bg" | "panneau-segmented-control-border-color" | "panneau-segmented-control-segment-padding-x" | "panneau-segmented-control-segment-font-weight" | "panneau-segmented-control-segment-color" | "panneau-segmented-control-segment-color-hover" | "panneau-segmented-control-segment-bg-hover" | "panneau-segmented-control-segment-color-selected" | "panneau-segmented-control-segment-bg-selected" | "panneau-segmented-control-segment-shadow-selected", string>>;
35
35
  selected: Readonly<Record<"panneau-selected-text" | "panneau-selected-subtle" | "panneau-selected-bg", string>>;
36
36
  skeleton: Readonly<Record<"panneau-skeleton-color" | "panneau-skeleton-radius" | "panneau-skeleton-duration", string>>;
37
+ sparkline: Readonly<Record<"panneau-sparkline-height" | "panneau-sparkline-line-width" | "panneau-sparkline-dot-size" | "panneau-sparkline-area-opacity", string>>;
37
38
  spinner: Readonly<Record<"panneau-spinner-border-width", string>>;
38
39
  stack: Readonly<Record<"panneau-stack-gap", string>>;
39
40
  stat: Readonly<Record<"panneau-stat-gap" | "panneau-stat-label-font-size" | "panneau-stat-value-font-family" | "panneau-stat-value-font-size" | "panneau-stat-value-font-weight" | "panneau-stat-help-font-size", string>>;
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/theme/components.ts"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwC1B,CAAC;AAEH,gFAAgF;AAChF,MAAM,MAAM,kBAAkB,GAAG;KAC5B,SAAS,IAAI,MAAM,OAAO,eAAe,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC,SAAS,CAAC;CACzF,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/theme/components.ts"],"names":[],"mappings":"AAyCA;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyC1B,CAAC;AAEH,gFAAgF;AAChF,MAAM,MAAM,kBAAkB,GAAG;KAC5B,SAAS,IAAI,MAAM,OAAO,eAAe,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC,SAAS,CAAC;CACzF,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
@@ -28,6 +28,7 @@ import { radioTokens } from "../radio-group/tokens.js";
28
28
  import { segmentedControlTokens } from "../segmented-control/tokens.js";
29
29
  import { listBoxTokens } from "../select/listBoxTokens.js";
30
30
  import { skeletonTokens } from "../skeleton/tokens.js";
31
+ import { sparklineTokens } from "../sparkline/tokens.js";
31
32
  import { spinnerTokens } from "../spinner/tokens.js";
32
33
  import { stackTokens } from "../stack/tokens.js";
33
34
  import { statTokens } from "../stat/tokens.js";
@@ -74,6 +75,7 @@ var componentTokens = Object.freeze({
74
75
  "segmented-control": segmentedControlTokens.tokens,
75
76
  selected: selectedTokens.tokens,
76
77
  skeleton: skeletonTokens.tokens,
78
+ sparkline: sparklineTokens.tokens,
77
79
  spinner: spinnerTokens.tokens,
78
80
  stack: stackTokens.tokens,
79
81
  stat: statTokens.tokens,
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","names":["alertTokens","asideTokens","badgeTokens","barChartTokens","buttonTokens","cardTokens","checkboxTokens","commandPaletteTokens","containerTokens","calendarTokens","dialogTokens","disclosureTokens","dividerTokens","inputTokens","fieldTokens","gridTokens","headingTokens","iconTokens","inlineTokens","lineChartTokens","menuTokens","meterTokens","numberInputTokens","pillTriggerTokens","popoverTokens","proseTokens","radioTokens","segmentedControlTokens","listBoxTokens","skeletonTokens","spinnerTokens","stackTokens","statTokens","switchTokens","tabsTokens","textTokens","toastTokens","tooltipTokens","selectedTokens","componentTokens","Object","freeze","alert","tokens","aside","badge","button","calendar","card","checkbox","container","dialog","disclosure","divider","field","grid","heading","icon","inline","input","menu","meter","popover","prose","radio","selected","skeleton","spinner","stack","stat","switch","tabs","text","toast","tooltip","ComponentTokenName","Component"],"sources":["../../src/theme/components.ts"],"sourcesContent":["import { alertTokens } from '../alert/tokens';\nimport { asideTokens } from '../aside/tokens';\nimport { badgeTokens } from '../badge/tokens';\nimport { barChartTokens } from '../bar-chart/tokens';\nimport { buttonTokens } from '../button/tokens';\nimport { cardTokens } from '../card/tokens';\nimport { checkboxTokens } from '../checkbox/tokens';\nimport { commandPaletteTokens } from '../command-palette/tokens';\nimport { containerTokens } from '../container/tokens';\nimport { calendarTokens } from '../date-picker/calendarTokens';\nimport { dialogTokens } from '../dialog/tokens';\nimport { disclosureTokens } from '../disclosure/tokens';\nimport { dividerTokens } from '../divider/tokens';\nimport { inputTokens } from '../field/inputTokens';\nimport { fieldTokens } from '../field/tokens';\nimport { gridTokens } from '../grid/tokens';\nimport { headingTokens } from '../heading/tokens';\nimport { iconTokens } from '../icon/tokens';\nimport { inlineTokens } from '../inline/tokens';\nimport { lineChartTokens } from '../line-chart/tokens';\nimport { menuTokens } from '../menu/tokens';\nimport { meterTokens } from '../meter/tokens';\nimport { numberInputTokens } from '../number-input/tokens';\nimport { pillTriggerTokens } from '../pill-trigger/tokens';\nimport { popoverTokens } from '../popover/tokens';\nimport { proseTokens } from '../prose/tokens';\nimport { radioTokens } from '../radio-group/tokens';\nimport { segmentedControlTokens } from '../segmented-control/tokens';\nimport { listBoxTokens } from '../select/listBoxTokens';\nimport { skeletonTokens } from '../skeleton/tokens';\nimport { spinnerTokens } from '../spinner/tokens';\nimport { stackTokens } from '../stack/tokens';\nimport { statTokens } from '../stat/tokens';\nimport { switchTokens } from '../switch/tokens';\nimport { tabsTokens } from '../tabs/tokens';\nimport { textTokens } from '../text/tokens';\nimport { toastTokens } from '../toast/tokens';\nimport { tooltipTokens } from '../tooltip/tokens';\nimport { selectedTokens } from './selectedTokens';\n\n/**\n * The component tokens of `@panneau/ui` and their defaults, by component: what a theme, a scope or\n * a project's CSS can set to restyle one component without touching the others (decision 0024).\n */\nexport const componentTokens = Object.freeze({\n alert: alertTokens.tokens,\n aside: asideTokens.tokens,\n badge: badgeTokens.tokens,\n 'bar-chart': barChartTokens.tokens,\n button: buttonTokens.tokens,\n calendar: calendarTokens.tokens,\n card: cardTokens.tokens,\n checkbox: checkboxTokens.tokens,\n 'command-palette': commandPaletteTokens.tokens,\n container: containerTokens.tokens,\n dialog: dialogTokens.tokens,\n disclosure: disclosureTokens.tokens,\n divider: dividerTokens.tokens,\n field: fieldTokens.tokens,\n grid: gridTokens.tokens,\n heading: headingTokens.tokens,\n icon: iconTokens.tokens,\n inline: inlineTokens.tokens,\n input: inputTokens.tokens,\n 'line-chart': lineChartTokens.tokens,\n 'list-box': listBoxTokens.tokens,\n menu: menuTokens.tokens,\n meter: meterTokens.tokens,\n 'number-input': numberInputTokens.tokens,\n 'pill-trigger': pillTriggerTokens.tokens,\n popover: popoverTokens.tokens,\n prose: proseTokens.tokens,\n radio: radioTokens.tokens,\n 'segmented-control': segmentedControlTokens.tokens,\n selected: selectedTokens.tokens,\n skeleton: skeletonTokens.tokens,\n spinner: spinnerTokens.tokens,\n stack: stackTokens.tokens,\n stat: statTokens.tokens,\n switch: switchTokens.tokens,\n tabs: tabsTokens.tokens,\n text: textTokens.tokens,\n toast: toastTokens.tokens,\n tooltip: tooltipTokens.tokens,\n});\n\n/** The name of a component token of `@panneau/ui`, without the leading `--`. */\nexport type ComponentTokenName = {\n [Component in keyof typeof componentTokens]: keyof (typeof componentTokens)[Component];\n}[keyof typeof componentTokens];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAauC,kBAAkBC,OAAOC,OAAO;CACzCC,OAAO1C,YAAY2C;CACnBC,OAAO3C,YAAY0C;CACnBE,OAAO3C,YAAYyC;CACnB,aAAaxC,eAAewC;CAC5BG,QAAQ1C,aAAauC;CACrBI,UAAUtC,eAAekC;CACzBK,MAAM3C,WAAWsC;CACjBM,UAAU3C,eAAeqC;CACzB,mBAAmBpC,qBAAqBoC;CACxCO,WAAW1C,gBAAgBmC;CAC3BQ,QAAQzC,aAAaiC;CACrBS,YAAYzC,iBAAiBgC;CAC7BU,SAASzC,cAAc+B;CACvBW,OAAOxC,YAAY6B;CACnBY,MAAMxC,WAAW4B;CACjBa,SAASxC,cAAc2B;CACvBc,MAAMxC,WAAW0B;CACjBe,QAAQxC,aAAayB;CACrBgB,OAAO9C,YAAY8B;CACnB,cAAcxB,gBAAgBwB;CAC9B,YAAYf,cAAce;CAC1BiB,MAAMxC,WAAWuB;CACjBkB,OAAOxC,YAAYsB;CACnB,gBAAgBrB,kBAAkBqB;CAClC,gBAAgBpB,kBAAkBoB;CAClCmB,SAAStC,cAAcmB;CACvBoB,OAAOtC,YAAYkB;CACnBqB,OAAOtC,YAAYiB;CACnB,qBAAqBhB,uBAAuBgB;CAC5CsB,UAAU3B,eAAeK;CACzBuB,UAAUrC,eAAec;CACzBwB,SAASrC,cAAca;CACvByB,OAAOrC,YAAYY;CACnB0B,MAAMrC,WAAWW;CACjB2B,QAAQrC,aAAaU;CACrB4B,MAAMrC,WAAWS;CACjB6B,MAAMrC,WAAWQ;CACjB8B,OAAOrC,YAAYO;CACnB+B,SAASrC,cAAcM;AAC3B,CAAC"}
1
+ {"version":3,"file":"components.js","names":["alertTokens","asideTokens","badgeTokens","barChartTokens","buttonTokens","cardTokens","checkboxTokens","commandPaletteTokens","containerTokens","calendarTokens","dialogTokens","disclosureTokens","dividerTokens","inputTokens","fieldTokens","gridTokens","headingTokens","iconTokens","inlineTokens","lineChartTokens","menuTokens","meterTokens","numberInputTokens","pillTriggerTokens","popoverTokens","proseTokens","radioTokens","segmentedControlTokens","listBoxTokens","skeletonTokens","sparklineTokens","spinnerTokens","stackTokens","statTokens","switchTokens","tabsTokens","textTokens","toastTokens","tooltipTokens","selectedTokens","componentTokens","Object","freeze","alert","tokens","aside","badge","button","calendar","card","checkbox","container","dialog","disclosure","divider","field","grid","heading","icon","inline","input","menu","meter","popover","prose","radio","selected","skeleton","sparkline","spinner","stack","stat","switch","tabs","text","toast","tooltip","ComponentTokenName","Component"],"sources":["../../src/theme/components.ts"],"sourcesContent":["import { alertTokens } from '../alert/tokens';\nimport { asideTokens } from '../aside/tokens';\nimport { badgeTokens } from '../badge/tokens';\nimport { barChartTokens } from '../bar-chart/tokens';\nimport { buttonTokens } from '../button/tokens';\nimport { cardTokens } from '../card/tokens';\nimport { checkboxTokens } from '../checkbox/tokens';\nimport { commandPaletteTokens } from '../command-palette/tokens';\nimport { containerTokens } from '../container/tokens';\nimport { calendarTokens } from '../date-picker/calendarTokens';\nimport { dialogTokens } from '../dialog/tokens';\nimport { disclosureTokens } from '../disclosure/tokens';\nimport { dividerTokens } from '../divider/tokens';\nimport { inputTokens } from '../field/inputTokens';\nimport { fieldTokens } from '../field/tokens';\nimport { gridTokens } from '../grid/tokens';\nimport { headingTokens } from '../heading/tokens';\nimport { iconTokens } from '../icon/tokens';\nimport { inlineTokens } from '../inline/tokens';\nimport { lineChartTokens } from '../line-chart/tokens';\nimport { menuTokens } from '../menu/tokens';\nimport { meterTokens } from '../meter/tokens';\nimport { numberInputTokens } from '../number-input/tokens';\nimport { pillTriggerTokens } from '../pill-trigger/tokens';\nimport { popoverTokens } from '../popover/tokens';\nimport { proseTokens } from '../prose/tokens';\nimport { radioTokens } from '../radio-group/tokens';\nimport { segmentedControlTokens } from '../segmented-control/tokens';\nimport { listBoxTokens } from '../select/listBoxTokens';\nimport { skeletonTokens } from '../skeleton/tokens';\nimport { sparklineTokens } from '../sparkline/tokens';\nimport { spinnerTokens } from '../spinner/tokens';\nimport { stackTokens } from '../stack/tokens';\nimport { statTokens } from '../stat/tokens';\nimport { switchTokens } from '../switch/tokens';\nimport { tabsTokens } from '../tabs/tokens';\nimport { textTokens } from '../text/tokens';\nimport { toastTokens } from '../toast/tokens';\nimport { tooltipTokens } from '../tooltip/tokens';\nimport { selectedTokens } from './selectedTokens';\n\n/**\n * The component tokens of `@panneau/ui` and their defaults, by component: what a theme, a scope or\n * a project's CSS can set to restyle one component without touching the others (decision 0024).\n */\nexport const componentTokens = Object.freeze({\n alert: alertTokens.tokens,\n aside: asideTokens.tokens,\n badge: badgeTokens.tokens,\n 'bar-chart': barChartTokens.tokens,\n button: buttonTokens.tokens,\n calendar: calendarTokens.tokens,\n card: cardTokens.tokens,\n checkbox: checkboxTokens.tokens,\n 'command-palette': commandPaletteTokens.tokens,\n container: containerTokens.tokens,\n dialog: dialogTokens.tokens,\n disclosure: disclosureTokens.tokens,\n divider: dividerTokens.tokens,\n field: fieldTokens.tokens,\n grid: gridTokens.tokens,\n heading: headingTokens.tokens,\n icon: iconTokens.tokens,\n inline: inlineTokens.tokens,\n input: inputTokens.tokens,\n 'line-chart': lineChartTokens.tokens,\n 'list-box': listBoxTokens.tokens,\n menu: menuTokens.tokens,\n meter: meterTokens.tokens,\n 'number-input': numberInputTokens.tokens,\n 'pill-trigger': pillTriggerTokens.tokens,\n popover: popoverTokens.tokens,\n prose: proseTokens.tokens,\n radio: radioTokens.tokens,\n 'segmented-control': segmentedControlTokens.tokens,\n selected: selectedTokens.tokens,\n skeleton: skeletonTokens.tokens,\n sparkline: sparklineTokens.tokens,\n spinner: spinnerTokens.tokens,\n stack: stackTokens.tokens,\n stat: statTokens.tokens,\n switch: switchTokens.tokens,\n tabs: tabsTokens.tokens,\n text: textTokens.tokens,\n toast: toastTokens.tokens,\n tooltip: tooltipTokens.tokens,\n});\n\n/** The name of a component token of `@panneau/ui`, without the leading `--`. */\nexport type ComponentTokenName = {\n [Component in keyof typeof componentTokens]: keyof (typeof componentTokens)[Component];\n}[keyof typeof componentTokens];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAawC,kBAAkBC,OAAOC,OAAO;CACzCC,OAAO3C,YAAY4C;CACnBC,OAAO5C,YAAY2C;CACnBE,OAAO5C,YAAY0C;CACnB,aAAazC,eAAeyC;CAC5BG,QAAQ3C,aAAawC;CACrBI,UAAUvC,eAAemC;CACzBK,MAAM5C,WAAWuC;CACjBM,UAAU5C,eAAesC;CACzB,mBAAmBrC,qBAAqBqC;CACxCO,WAAW3C,gBAAgBoC;CAC3BQ,QAAQ1C,aAAakC;CACrBS,YAAY1C,iBAAiBiC;CAC7BU,SAAS1C,cAAcgC;CACvBW,OAAOzC,YAAY8B;CACnBY,MAAMzC,WAAW6B;CACjBa,SAASzC,cAAc4B;CACvBc,MAAMzC,WAAW2B;CACjBe,QAAQzC,aAAa0B;CACrBgB,OAAO/C,YAAY+B;CACnB,cAAczB,gBAAgByB;CAC9B,YAAYhB,cAAcgB;CAC1BiB,MAAMzC,WAAWwB;CACjBkB,OAAOzC,YAAYuB;CACnB,gBAAgBtB,kBAAkBsB;CAClC,gBAAgBrB,kBAAkBqB;CAClCmB,SAASvC,cAAcoB;CACvBoB,OAAOvC,YAAYmB;CACnBqB,OAAOvC,YAAYkB;CACnB,qBAAqBjB,uBAAuBiB;CAC5CsB,UAAU3B,eAAeK;CACzBuB,UAAUtC,eAAee;CACzBwB,WAAWtC,gBAAgBc;CAC3ByB,SAAStC,cAAca;CACvB0B,OAAOtC,YAAYY;CACnB2B,MAAMtC,WAAWW;CACjB4B,QAAQtC,aAAaU;CACrB6B,MAAMtC,WAAWS;CACjB8B,MAAMtC,WAAWQ;CACjB+B,OAAOtC,YAAYO;CACnBgC,SAAStC,cAAcM;AAC3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/ui",
3
- "version": "5.0.0-alpha.39",
3
+ "version": "5.0.0-alpha.41",
4
4
  "description": "Design tokens, themes and accessible primitives of Panneau, built on React Aria Components.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -57,10 +57,10 @@
57
57
  "react-intl": "^12.0.0"
58
58
  },
59
59
  "dependencies": {
60
- "@panneau/intl": "5.0.0-alpha.39",
60
+ "@panneau/intl": "5.0.0-alpha.41",
61
61
  "lucide-react": "^1.57.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@panneau/protocol": "5.0.0-alpha.39"
64
+ "@panneau/protocol": "5.0.0-alpha.41"
65
65
  }
66
66
  }