@panneau/ui 5.0.0-alpha.17 → 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
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ Every component reads its own tokens, `--panneau-<component>-<token>`, which def
|
|
|
73
73
|
|
|
74
74
|
### Tones and appearances
|
|
75
75
|
|
|
76
|
-
Components with a color take a `tone`, like Bootstrap's theme colors: `neutral`, `accent`, `success`, `warning`, `danger` and `
|
|
76
|
+
Components with a color take a `tone`, like Bootstrap's theme colors: `neutral`, `accent`, `success`, `warning`, `danger`, `info` and `muted` are built in. What each one means for a state (`muted` is what is over: Archived, Cancelled) is written once, in [the tones of the protocol](../../docs/protocol.md#tones): follow it, so that a user learns the colors once. `Button`, `Badge` and `Alert` also take an `appearance` (`solid`, `outline`, `subtle`, and `ghost` for buttons):
|
|
77
77
|
|
|
78
78
|
```tsx
|
|
79
79
|
<Button tone="accent">Save</Button>
|
|
@@ -245,6 +245,17 @@ Charts (dashboard widgets, reports) use only the chart tokens of the theme, in b
|
|
|
245
245
|
|
|
246
246
|
Each default categorical color reaches 3:1 against the surface (WCAG non-text contrast), and the eight stay distinct for people with protanopia, deuteranopia or tritanopia: a test checks it. `checkTheme()` runs the same checks on the chart colors a theme sets, and `checkColorDifferences(colors)` on any palette.
|
|
247
247
|
|
|
248
|
+
`Stat` and `LineChart` are the charts of the dashboard ([decision 0064](../../docs/decisions/0064-dashboard-widgets.md)):
|
|
249
|
+
|
|
250
|
+
```tsx
|
|
251
|
+
<Stat label="Overdue" value={3} help="Since Monday" tone="danger" href="/entries?filter[late]=1" />
|
|
252
|
+
<LineChart label="Entries per day" points={[{ label: 'Oct 5', value: 4 }, { label: 'Oct 6', value: 8 }]} />
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
- `Stat` shows a number for the locale (`format` takes the options of `Intl.NumberFormat`), what it counts above it and its help under it. A `tone` colors the number only when it calls for attention: the help says why.
|
|
256
|
+
- `LineChart` draws a line and the area under it on a categorical chart color (`color`, from 0), with the top of its scale and its first and last labels. The plot is hidden from assistive technologies, which read the values in a table.
|
|
257
|
+
- Both draw a skeleton of their shape while their `value` or `points` are `undefined`.
|
|
258
|
+
|
|
248
259
|
### Checking a theme
|
|
249
260
|
|
|
250
261
|
`checkTheme(theme)` reports what a theme makes hard to read: text tokens against backgrounds (4.5:1), control borders and chart colors (3:1), the text of each tone on the surface and on its subtle background, and categorical chart colors that look alike with a color vision deficiency. The `panneau-check-theme` command runs it on a JSON theme or on an export of a module, and exits with 1 when a check fails, for CI:
|
|
@@ -389,6 +400,25 @@ function ArticleCard({ article }: { article: Article | undefined }) {
|
|
|
389
400
|
|
|
390
401
|
A skeleton never replaces content already shown: while it is fetched again, it stays, dimmed, with `aria-busy`, as in lists.
|
|
391
402
|
|
|
403
|
+
### Toasts
|
|
404
|
+
|
|
405
|
+
`useToast().show(content, options)` shows a toast in the region of the closest `PanneauRoot` ([decision 0062](../../docs/decisions/0062-toasts.md)):
|
|
406
|
+
|
|
407
|
+
```tsx
|
|
408
|
+
const toasts = useToast();
|
|
409
|
+
toasts.show(
|
|
410
|
+
{ title: '3 entries archived', tone: 'success', action: { label: 'Undo', onAction: undo } },
|
|
411
|
+
{ key: 'archive' },
|
|
412
|
+
);
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
- **Only when the page doesn't already say it.** A toast for what happened out of sight (a run that finished, a change made from a menu), for what can be undone, and for an error that has no place in the page (the network, a logout that failed). No toast where the page shows the result: a form says "Saved" in its footer, an error of a field stays on it, and a run that starts shows in the runs button of the shell.
|
|
416
|
+
- **Name the thing, and offer the next step**: what was done to what ("“Spring contest” saved", "3 entries archived"), and an `action` that leads to the result ("Open", "Download") or undoes it ("Undo").
|
|
417
|
+
- **One per thing**: a toast with the `key` of one already shown replaces it. At most three show at once; the older ones fold behind the newest and unfold on hover or focus.
|
|
418
|
+
- **Timeouts that match what the toast holds** (`getToastTimeout()`): about 5 seconds, longer for a longer text, about 10 seconds with an action, none for an error (`danger`). Timers pause while the region is hovered or focused. `timeout` sets another, `null` none.
|
|
419
|
+
- **Quiet**: a success has the neutral look with its icon; only warnings and errors color the edge.
|
|
420
|
+
- **At the bottom, centered**, above what sticks to the bottom of the page: such an element calls `useToastOffset(ref)`, as the footer of a form does. `PanneauRoot`'s `toastPlacement` puts them at `bottom-end` or `top-end` instead. On a phone, they take the whole width.
|
|
421
|
+
|
|
392
422
|
## Icons
|
|
393
423
|
|
|
394
424
|
Components take icons as components: any Lucide icon (`icon={Pencil}`), or a component with the same props.
|
package/dist/button/Button.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ export interface ButtonStyleProps {
|
|
|
43
43
|
fullWidth?: boolean;
|
|
44
44
|
}
|
|
45
45
|
export interface ButtonProps extends ButtonStyleProps, Omit<AriaButtonProps, 'className' | 'style' | 'children'> {
|
|
46
|
+
/** The keys that do what the button does, such as `Control+Enter`. */
|
|
47
|
+
'aria-keyshortcuts'?: string;
|
|
46
48
|
children?: ReactNode;
|
|
47
49
|
className?: string;
|
|
48
50
|
style?: CSSProperties;
|
|
@@ -57,8 +59,9 @@ export declare function ButtonContent({ icon, iconEnd, size, children, }: Pick<B
|
|
|
57
59
|
}): import("react").JSX.Element;
|
|
58
60
|
/**
|
|
59
61
|
* A button. With `isPending`, it shows a spinner, keeps its size and focus, and ignores presses
|
|
60
|
-
* while assistive technologies announce the pending state.
|
|
62
|
+
* while assistive technologies announce the pending state. `aria-keyshortcuts` gives the keys
|
|
63
|
+
* that do what it does.
|
|
61
64
|
*/
|
|
62
|
-
export declare function Button({ tone, appearance, variant, size, icon, iconEnd, fullWidth, isPending, children, className, ...props }: ButtonProps): import("react").JSX.Element;
|
|
65
|
+
export declare function Button({ tone, appearance, variant, size, icon, iconEnd, fullWidth, isPending, children, className, 'aria-keyshortcuts': keyShortcuts, render, ...props }: ButtonProps): import("react").JSX.Element;
|
|
63
66
|
export { styles as buttonStyles };
|
|
64
67
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAwB,KAAK,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElG,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,kFAAkF;AAClF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExE;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,cAAc;CAAG;AAElC;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,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C,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,uFAAuF;AACvF,wBAAgB,kBAAkB,CAAC,EAC/B,IAAI,EACJ,UAAU,EACV,OAAO,EACP,IAAW,EACX,SAAiB,EACjB,SAAS,GACZ,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC,GAAG;IAClF,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,GAAG,MAAM,CAeT;AAED,uCAAuC;AACvC,wBAAgB,aAAa,CAAC,EAC1B,IAAI,EACJ,OAAO,EACP,IAAW,EACX,QAAQ,GACX,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,+BAUhF;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACnB,IAAI,EACJ,UAAU,EACV,OAAO,EACP,IAAW,EACX,IAAI,EACJ,OAAO,EACP,SAAiB,EACjB,SAAiB,EACjB,QAAQ,EACR,SAAS,EACT,mBAAmB,EAAE,YAAY,EACjC,MAAM,EACN,GAAG,KAAK,EACX,EAAE,WAAW,+BAqCb;AAED,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,CAAC"}
|
package/dist/button/Button.js
CHANGED
|
@@ -79,54 +79,74 @@ function ButtonContent(t0) {
|
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* A button. With `isPending`, it shows a spinner, keeps its size and focus, and ignores presses
|
|
82
|
-
* while assistive technologies announce the pending state.
|
|
82
|
+
* while assistive technologies announce the pending state. `aria-keyshortcuts` gives the keys
|
|
83
|
+
* that do what it does.
|
|
83
84
|
*/
|
|
84
85
|
function Button$1(t0) {
|
|
85
|
-
const $ = c(
|
|
86
|
+
const $ = c(39);
|
|
86
87
|
let appearance;
|
|
87
88
|
let children;
|
|
88
89
|
let className;
|
|
89
90
|
let icon;
|
|
90
91
|
let iconEnd;
|
|
92
|
+
let keyShortcuts;
|
|
91
93
|
let props;
|
|
94
|
+
let render;
|
|
92
95
|
let t1;
|
|
93
96
|
let t2;
|
|
94
97
|
let t3;
|
|
95
98
|
let tone;
|
|
96
99
|
let variant;
|
|
97
100
|
if ($[0] !== t0) {
|
|
98
|
-
({tone, appearance, variant, size: t1, icon, iconEnd, fullWidth: t2, isPending: t3, children, className, ...props} = t0);
|
|
101
|
+
({tone, appearance, variant, size: t1, icon, iconEnd, fullWidth: t2, isPending: t3, children, className, "aria-keyshortcuts": keyShortcuts, render, ...props} = t0);
|
|
99
102
|
$[0] = t0;
|
|
100
103
|
$[1] = appearance;
|
|
101
104
|
$[2] = children;
|
|
102
105
|
$[3] = className;
|
|
103
106
|
$[4] = icon;
|
|
104
107
|
$[5] = iconEnd;
|
|
105
|
-
$[6] =
|
|
106
|
-
$[7] =
|
|
107
|
-
$[8] =
|
|
108
|
-
$[9] =
|
|
109
|
-
$[10] =
|
|
110
|
-
$[11] =
|
|
108
|
+
$[6] = keyShortcuts;
|
|
109
|
+
$[7] = props;
|
|
110
|
+
$[8] = render;
|
|
111
|
+
$[9] = t1;
|
|
112
|
+
$[10] = t2;
|
|
113
|
+
$[11] = t3;
|
|
114
|
+
$[12] = tone;
|
|
115
|
+
$[13] = variant;
|
|
111
116
|
} else {
|
|
112
117
|
appearance = $[1];
|
|
113
118
|
children = $[2];
|
|
114
119
|
className = $[3];
|
|
115
120
|
icon = $[4];
|
|
116
121
|
iconEnd = $[5];
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
keyShortcuts = $[6];
|
|
123
|
+
props = $[7];
|
|
124
|
+
render = $[8];
|
|
125
|
+
t1 = $[9];
|
|
126
|
+
t2 = $[10];
|
|
127
|
+
t3 = $[11];
|
|
128
|
+
tone = $[12];
|
|
129
|
+
variant = $[13];
|
|
123
130
|
}
|
|
124
131
|
const size = t1 === void 0 ? "md" : t1;
|
|
125
132
|
const fullWidth = t2 === void 0 ? false : t2;
|
|
126
133
|
const isPending = t3 === void 0 ? false : t3;
|
|
127
134
|
let t4;
|
|
128
|
-
if ($[
|
|
129
|
-
t4 =
|
|
135
|
+
if ($[14] !== keyShortcuts || $[15] !== render) {
|
|
136
|
+
t4 = keyShortcuts === void 0 ? render : (domProps, values) => {
|
|
137
|
+
const withShortcuts = {
|
|
138
|
+
...domProps,
|
|
139
|
+
"aria-keyshortcuts": keyShortcuts
|
|
140
|
+
};
|
|
141
|
+
return render !== void 0 ? render(withShortcuts, values) : /* @__PURE__ */ jsx("button", { ...withShortcuts });
|
|
142
|
+
};
|
|
143
|
+
$[14] = keyShortcuts;
|
|
144
|
+
$[15] = render;
|
|
145
|
+
$[16] = t4;
|
|
146
|
+
} else t4 = $[16];
|
|
147
|
+
let t5;
|
|
148
|
+
if ($[17] !== appearance || $[18] !== className || $[19] !== fullWidth || $[20] !== isPending || $[21] !== size || $[22] !== tone || $[23] !== variant) {
|
|
149
|
+
t5 = getButtonClassName({
|
|
130
150
|
tone,
|
|
131
151
|
appearance,
|
|
132
152
|
variant,
|
|
@@ -134,54 +154,56 @@ function Button$1(t0) {
|
|
|
134
154
|
fullWidth,
|
|
135
155
|
className: cx(isPending && Button_module_default.pending, className)
|
|
136
156
|
});
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
} else
|
|
146
|
-
let
|
|
147
|
-
if ($[
|
|
148
|
-
|
|
157
|
+
$[17] = appearance;
|
|
158
|
+
$[18] = className;
|
|
159
|
+
$[19] = fullWidth;
|
|
160
|
+
$[20] = isPending;
|
|
161
|
+
$[21] = size;
|
|
162
|
+
$[22] = tone;
|
|
163
|
+
$[23] = variant;
|
|
164
|
+
$[24] = t5;
|
|
165
|
+
} else t5 = $[24];
|
|
166
|
+
let t6;
|
|
167
|
+
if ($[25] !== children || $[26] !== icon || $[27] !== iconEnd || $[28] !== size) {
|
|
168
|
+
t6 = /* @__PURE__ */ jsx(ButtonContent, {
|
|
149
169
|
icon,
|
|
150
170
|
iconEnd,
|
|
151
171
|
size,
|
|
152
172
|
children
|
|
153
173
|
});
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
} else
|
|
160
|
-
let
|
|
161
|
-
if ($[
|
|
162
|
-
|
|
174
|
+
$[25] = children;
|
|
175
|
+
$[26] = icon;
|
|
176
|
+
$[27] = iconEnd;
|
|
177
|
+
$[28] = size;
|
|
178
|
+
$[29] = t6;
|
|
179
|
+
} else t6 = $[29];
|
|
180
|
+
let t7;
|
|
181
|
+
if ($[30] !== isPending) {
|
|
182
|
+
t7 = isPending ? /* @__PURE__ */ jsx("span", {
|
|
163
183
|
className: Button_module_default.spinner,
|
|
164
184
|
children: /* @__PURE__ */ jsx(Spinner, { size: "sm" })
|
|
165
185
|
}) : null;
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
} else
|
|
169
|
-
let
|
|
170
|
-
if ($[
|
|
171
|
-
|
|
186
|
+
$[30] = isPending;
|
|
187
|
+
$[31] = t7;
|
|
188
|
+
} else t7 = $[31];
|
|
189
|
+
let t8;
|
|
190
|
+
if ($[32] !== isPending || $[33] !== props || $[34] !== t4 || $[35] !== t5 || $[36] !== t6 || $[37] !== t7) {
|
|
191
|
+
t8 = /* @__PURE__ */ jsxs(Button, {
|
|
172
192
|
...props,
|
|
193
|
+
render: t4,
|
|
173
194
|
isPending,
|
|
174
|
-
className:
|
|
175
|
-
children: [
|
|
195
|
+
className: t5,
|
|
196
|
+
children: [t6, t7]
|
|
176
197
|
});
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
|
|
184
|
-
|
|
198
|
+
$[32] = isPending;
|
|
199
|
+
$[33] = props;
|
|
200
|
+
$[34] = t4;
|
|
201
|
+
$[35] = t5;
|
|
202
|
+
$[36] = t6;
|
|
203
|
+
$[37] = t7;
|
|
204
|
+
$[38] = t8;
|
|
205
|
+
} else t8 = $[38];
|
|
206
|
+
return t8;
|
|
185
207
|
}
|
|
186
208
|
//#endregion
|
|
187
209
|
export { Button$1 as Button, ButtonContent, Button_module_default as buttonStyles, getButtonClassName };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","names":["CSSProperties","ReactNode","Button","AriaButton","ButtonProps","AriaButtonProps","Icon","IconComponent","Spinner","toneClass","Tone","cx","styles","ButtonAppearance","ButtonVariants","ButtonVariant","ALIASES","Record","tone","appearance","primary","secondary","ghost","danger","isAlias","variant","Object","hasOwn","ButtonStyleProps","size","icon","iconEnd","fullWidth","Omit","children","className","style","getButtonClassName","Pick","alias","undefined","resolvedTone","resolvedAppearance","button","sm","ButtonContent","t0","$","_c","t1","t2","t3","t4","content","props","isPending","pending","t5","t6","spinner","t7","buttonStyles","styles","_c","Button","AriaButton"],"sources":["../../src/button/Button.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport { Button as AriaButton, type ButtonProps as AriaButtonProps } from 'react-aria-components';\n\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { Spinner } from '../spinner/Spinner';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Button.module.css';\n\n/** How a button uses its tone, like Bootstrap's `.btn-*` and `.btn-outline-*`. */\nexport type ButtonAppearance = 'solid' | 'outline' | 'subtle' | 'ghost';\n\n/**\n * Named variants of `Button`, registered by a theme (`components.button.variants`). Declare them\n * here so that `variant=\"pill\"` type-checks:\n *\n * ```ts\n * declare module '@panneau/ui' {\n * interface ButtonVariants {\n * pill: true;\n * }\n * }\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extended by projects\nexport interface ButtonVariants {}\n\n/**\n * The variants of the first alpha, kept as aliases of a tone and an appearance: `primary` is\n * accent solid, `secondary` neutral outline, `ghost` neutral ghost, `danger` danger solid.\n *\n * @deprecated Use `tone` and `appearance`.\n */\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\n\nconst ALIASES: Record<ButtonVariant, { tone: Tone; appearance: ButtonAppearance }> = {\n primary: { tone: 'accent', appearance: 'solid' },\n secondary: { tone: 'neutral', appearance: 'outline' },\n ghost: { tone: 'neutral', appearance: 'ghost' },\n danger: { tone: 'danger', appearance: 'solid' },\n};\n\nfunction isAlias(variant: string): variant is ButtonVariant {\n return Object.hasOwn(ALIASES, variant);\n}\n\n/** The look of a button, shared by `Button` and `LinkButton`. */\nexport interface ButtonStyleProps {\n /** Defaults to `neutral`. */\n tone?: Tone;\n /** Defaults to `outline` for the neutral tone, and `solid` for the others. */\n appearance?: ButtonAppearance;\n /** A named variant of the theme, or one of the deprecated aliases (`primary`…). */\n variant?: ButtonVariant | (keyof ButtonVariants & string);\n size?: 'sm' | 'md';\n /** Icon before the label. */\n icon?: IconComponent;\n /** Icon after the label. */\n iconEnd?: IconComponent;\n /** Takes the full width of its container. */\n fullWidth?: boolean;\n}\n\nexport interface ButtonProps\n extends ButtonStyleProps, Omit<AriaButtonProps, 'className' | 'style' | 'children'> {\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\n/** The class names of a button from its style props, for `Button` and `LinkButton`. */\nexport function getButtonClassName({\n tone,\n appearance,\n variant,\n size = 'md',\n fullWidth = false,\n className,\n}: Pick<ButtonStyleProps, 'tone' | 'appearance' | 'variant' | 'size' | 'fullWidth'> & {\n className?: string | undefined;\n}): string {\n const alias = variant !== undefined && isAlias(variant) ? ALIASES[variant] : undefined;\n const resolvedTone = tone ?? alias?.tone ?? 'neutral';\n const resolvedAppearance =\n appearance ?? alias?.appearance ?? (resolvedTone === 'neutral' ? 'outline' : 'solid');\n return cx(\n 'panneau-button',\n styles.button,\n toneClass(resolvedTone),\n styles[resolvedAppearance],\n variant !== undefined && alias === undefined && `panneau-button-variant-${variant}`,\n size === 'sm' && styles.sm,\n fullWidth && styles.fullWidth,\n className,\n );\n}\n\n/** The icons and label of a button. */\nexport function ButtonContent({\n icon,\n iconEnd,\n size = 'md',\n children,\n}: Pick<ButtonStyleProps, 'icon' | 'iconEnd' | 'size'> & { children?: ReactNode }) {\n return (\n <span className={styles.content}>\n {icon !== undefined ? <Icon icon={icon} size={size === 'sm' ? 'sm' : 'md'} /> : null}\n {children}\n {iconEnd !== undefined ? (\n <Icon icon={iconEnd} size={size === 'sm' ? 'sm' : 'md'} />\n ) : null}\n </span>\n );\n}\n\n/**\n * A button. With `isPending`, it shows a spinner, keeps its size and focus, and ignores presses\n * while assistive technologies announce the pending state.\n */\nexport function Button({\n tone,\n appearance,\n variant,\n size = 'md',\n icon,\n iconEnd,\n fullWidth = false,\n isPending = false,\n children,\n className,\n ...props\n}: ButtonProps) {\n return (\n <AriaButton\n {...props}\n isPending={isPending}\n className={getButtonClassName({\n tone,\n appearance,\n variant,\n size,\n fullWidth,\n className: cx(isPending && styles.pending, className),\n })}\n >\n <ButtonContent icon={icon} iconEnd={iconEnd} size={size}>\n {children}\n </ButtonContent>\n {isPending ? (\n <span className={styles.spinner}>\n <Spinner size=\"sm\" />\n </span>\n ) : null}\n </AriaButton>\n );\n}\n\nexport { styles as buttonStyles };\n"],"mappings":";;;;;;;;;AAoCA,IAAMgB,UAA+E;CACjFI,SAAS;EAAEF,MAAM;EAAUC,YAAY;CAAQ;CAC/CE,WAAW;EAAEH,MAAM;EAAWC,YAAY;CAAU;CACpDG,OAAO;EAAEJ,MAAM;EAAWC,YAAY;CAAQ;CAC9CI,QAAQ;EAAEL,MAAM;EAAUC,YAAY;CAAQ;AAClD;AAEA,SAASK,QAA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A;CAAA,IAAAa;CAAA,IAAAb,EAAA,QAAAQ,aAAAR,EAAA,QAAAO,SAAAP,EAAA,QAAAK,MAAAL,EAAA,QAAAU,MAAAV,EAAA,QAAAW,IAAA;EAnBZE,KAAA,qBAACK,QAAD;GAAW,GACHX;GACOC;GACA,WAAAH;GAHf,UAAA,CAYIK,IAGCC,EAfM;;EAoBEX,EAAA,MAAAQ;EAAAR,EAAA,MAAAO;EAAAP,EAAA,MAAAK;EAAAL,EAAA,MAAAU;EAAAV,EAAA,MAAAW;EAAAX,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OApBba;AAoBa"}
|
|
1
|
+
{"version":3,"file":"Button.js","names":["CSSProperties","ReactNode","Button","AriaButton","ButtonProps","AriaButtonProps","Icon","IconComponent","Spinner","toneClass","Tone","cx","styles","ButtonAppearance","ButtonVariants","ButtonVariant","ALIASES","Record","tone","appearance","primary","secondary","ghost","danger","isAlias","variant","Object","hasOwn","ButtonStyleProps","size","icon","iconEnd","fullWidth","Omit","children","className","style","getButtonClassName","Pick","alias","undefined","resolvedTone","resolvedAppearance","button","sm","ButtonContent","t0","$","_c","t1","t2","t3","t4","content","keyShortcuts","props","render","isPending","domProps","values","withShortcuts","t5","pending","t6","t7","spinner","t8","buttonStyles","styles","_c","Button","AriaButton"],"sources":["../../src/button/Button.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport { Button as AriaButton, type ButtonProps as AriaButtonProps } from 'react-aria-components';\n\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { Spinner } from '../spinner/Spinner';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Button.module.css';\n\n/** How a button uses its tone, like Bootstrap's `.btn-*` and `.btn-outline-*`. */\nexport type ButtonAppearance = 'solid' | 'outline' | 'subtle' | 'ghost';\n\n/**\n * Named variants of `Button`, registered by a theme (`components.button.variants`). Declare them\n * here so that `variant=\"pill\"` type-checks:\n *\n * ```ts\n * declare module '@panneau/ui' {\n * interface ButtonVariants {\n * pill: true;\n * }\n * }\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extended by projects\nexport interface ButtonVariants {}\n\n/**\n * The variants of the first alpha, kept as aliases of a tone and an appearance: `primary` is\n * accent solid, `secondary` neutral outline, `ghost` neutral ghost, `danger` danger solid.\n *\n * @deprecated Use `tone` and `appearance`.\n */\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\n\nconst ALIASES: Record<ButtonVariant, { tone: Tone; appearance: ButtonAppearance }> = {\n primary: { tone: 'accent', appearance: 'solid' },\n secondary: { tone: 'neutral', appearance: 'outline' },\n ghost: { tone: 'neutral', appearance: 'ghost' },\n danger: { tone: 'danger', appearance: 'solid' },\n};\n\nfunction isAlias(variant: string): variant is ButtonVariant {\n return Object.hasOwn(ALIASES, variant);\n}\n\n/** The look of a button, shared by `Button` and `LinkButton`. */\nexport interface ButtonStyleProps {\n /** Defaults to `neutral`. */\n tone?: Tone;\n /** Defaults to `outline` for the neutral tone, and `solid` for the others. */\n appearance?: ButtonAppearance;\n /** A named variant of the theme, or one of the deprecated aliases (`primary`…). */\n variant?: ButtonVariant | (keyof ButtonVariants & string);\n size?: 'sm' | 'md';\n /** Icon before the label. */\n icon?: IconComponent;\n /** Icon after the label. */\n iconEnd?: IconComponent;\n /** Takes the full width of its container. */\n fullWidth?: boolean;\n}\n\nexport interface ButtonProps\n extends ButtonStyleProps, Omit<AriaButtonProps, 'className' | 'style' | 'children'> {\n /** The keys that do what the button does, such as `Control+Enter`. */\n 'aria-keyshortcuts'?: string;\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\n/** The class names of a button from its style props, for `Button` and `LinkButton`. */\nexport function getButtonClassName({\n tone,\n appearance,\n variant,\n size = 'md',\n fullWidth = false,\n className,\n}: Pick<ButtonStyleProps, 'tone' | 'appearance' | 'variant' | 'size' | 'fullWidth'> & {\n className?: string | undefined;\n}): string {\n const alias = variant !== undefined && isAlias(variant) ? ALIASES[variant] : undefined;\n const resolvedTone = tone ?? alias?.tone ?? 'neutral';\n const resolvedAppearance =\n appearance ?? alias?.appearance ?? (resolvedTone === 'neutral' ? 'outline' : 'solid');\n return cx(\n 'panneau-button',\n styles.button,\n toneClass(resolvedTone),\n styles[resolvedAppearance],\n variant !== undefined && alias === undefined && `panneau-button-variant-${variant}`,\n size === 'sm' && styles.sm,\n fullWidth && styles.fullWidth,\n className,\n );\n}\n\n/** The icons and label of a button. */\nexport function ButtonContent({\n icon,\n iconEnd,\n size = 'md',\n children,\n}: Pick<ButtonStyleProps, 'icon' | 'iconEnd' | 'size'> & { children?: ReactNode }) {\n return (\n <span className={styles.content}>\n {icon !== undefined ? <Icon icon={icon} size={size === 'sm' ? 'sm' : 'md'} /> : null}\n {children}\n {iconEnd !== undefined ? (\n <Icon icon={iconEnd} size={size === 'sm' ? 'sm' : 'md'} />\n ) : null}\n </span>\n );\n}\n\n/**\n * A button. With `isPending`, it shows a spinner, keeps its size and focus, and ignores presses\n * while assistive technologies announce the pending state. `aria-keyshortcuts` gives the keys\n * that do what it does.\n */\nexport function Button({\n tone,\n appearance,\n variant,\n size = 'md',\n icon,\n iconEnd,\n fullWidth = false,\n isPending = false,\n children,\n className,\n 'aria-keyshortcuts': keyShortcuts,\n render,\n ...props\n}: ButtonProps) {\n return (\n <AriaButton\n {...props}\n // React Aria leaves `aria-keyshortcuts` out of the button's attributes\n render={\n keyShortcuts === undefined\n ? render\n : (domProps, values) => {\n const withShortcuts = { ...domProps, 'aria-keyshortcuts': keyShortcuts };\n return render !== undefined ? (\n render(withShortcuts, values)\n ) : (\n <button {...withShortcuts} />\n );\n }\n }\n isPending={isPending}\n className={getButtonClassName({\n tone,\n appearance,\n variant,\n size,\n fullWidth,\n className: cx(isPending && styles.pending, className),\n })}\n >\n <ButtonContent icon={icon} iconEnd={iconEnd} size={size}>\n {children}\n </ButtonContent>\n {isPending ? (\n <span className={styles.sp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B;EAAAhB,EAAA,MAAAiB;EAAAjB,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAjCbmB;AAiCa"}
|
package/dist/index.d.ts
CHANGED
|
@@ -35,12 +35,14 @@ export { ThemeScope, type ThemeScopeProps } from './root/ThemeScope.js';
|
|
|
35
35
|
export { SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, } from './segmented-control/SegmentedControl.js';
|
|
36
36
|
export { type MultipleSelectProps, type OptionValue, Select, type SelectBaseProps, type SelectOption, type SelectProps, type SingleSelectProps, } from './select/Select.js';
|
|
37
37
|
export { Inline, type InlineProps } from './inline/Inline.js';
|
|
38
|
+
export { LineChart, type LineChartPoint, type LineChartProps } from './line-chart/LineChart.js';
|
|
38
39
|
export { BREAKPOINTS, type Breakpoint, type Justification, type Responsive, type Space, } from './layout/responsive.js';
|
|
39
40
|
export { Prose, type ProseProps } from './prose/Prose.js';
|
|
40
41
|
export { LoadingRegion, type LoadingRegionProps } from './skeleton/LoadingRegion.js';
|
|
41
42
|
export { Skeleton, type SkeletonProps } from './skeleton/Skeleton.js';
|
|
42
43
|
export { Spinner, type SpinnerProps } from './spinner/Spinner.js';
|
|
43
44
|
export { Stack, type StackProps } from './stack/Stack.js';
|
|
45
|
+
export { Stat, type StatProps } from './stat/Stat.js';
|
|
44
46
|
export { Switch, type SwitchProps } from './switch/Switch.js';
|
|
45
47
|
export { Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, } from './tabs/Tabs.js';
|
|
46
48
|
export { Text, type TextFamily, type TextProps, type TextSize } from './text/Text.js';
|
|
@@ -59,6 +61,6 @@ export { type ThemeFont, type ThemeFontFace, type ThemeFontStylesheet } from './
|
|
|
59
61
|
export { type ColorScheme, type Density, type Theme } from './theme/theme.js';
|
|
60
62
|
export { BUILT_IN_TONES, type PanneauTones, type Tone, type ToneInput, type ToneSurfaces, type ToneValues, deriveTone, toneClassName, } from './theme/tones.js';
|
|
61
63
|
export { TimeInput, type TimeInputProps } from './time-input/TimeInput.js';
|
|
62
|
-
export { type ToastContent, type ToastOptions, type ToastTone, type Toasts, useToast, } from './toast/Toast.js';
|
|
64
|
+
export { MAX_VISIBLE_TOASTS, type ToastContent, type ToastOptions, type ToastPlacement, type ToastTone, type Toasts, getToastTimeout, useToast, useToastOffset, } from './toast/Toast.js';
|
|
63
65
|
export { Tooltip, type TooltipProps } from './tooltip/Tooltip.js';
|
|
64
66
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EACL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,KAAK,EACL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,MAAM,EACN,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,cAAc,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,aAAa,EACb,eAAe,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,u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AK,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
|
@@ -4,7 +4,7 @@ import { Spinner } from "./spinner/Spinner.js";
|
|
|
4
4
|
import { BUILT_IN_TONES, deriveTone, toneClassName } from "./theme/tones.js";
|
|
5
5
|
import { Button } from "./button/Button.js";
|
|
6
6
|
import { getNamedIcon, loadNamedIcon } from "./icon/namedIcons.js";
|
|
7
|
-
import { useToast } from "./toast/Toast.js";
|
|
7
|
+
import { MAX_VISIBLE_TOASTS, getToastTimeout, useToast, useToastOffset } from "./toast/Toast.js";
|
|
8
8
|
import { PanneauRoot, usePortalContainer } from "./root/PanneauRoot.js";
|
|
9
9
|
import { Tooltip } from "./tooltip/Tooltip.js";
|
|
10
10
|
import { IconButton } from "./icon-button/IconButton.js";
|
|
@@ -39,21 +39,23 @@ import { ThemeScope } from "./root/ThemeScope.js";
|
|
|
39
39
|
import { SegmentedControl } from "./segmented-control/SegmentedControl.js";
|
|
40
40
|
import { Select } from "./select/Select.js";
|
|
41
41
|
import { Inline } from "./inline/Inline.js";
|
|
42
|
+
import { Skeleton } from "./skeleton/Skeleton.js";
|
|
43
|
+
import { CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, chartColors } from "./theme/chartColors.js";
|
|
44
|
+
import { LineChart } from "./line-chart/LineChart.js";
|
|
42
45
|
import { Prose } from "./prose/Prose.js";
|
|
43
46
|
import { LoadingRegion } from "./skeleton/LoadingRegion.js";
|
|
44
|
-
import { Skeleton } from "./skeleton/Skeleton.js";
|
|
45
47
|
import { Stack } from "./stack/Stack.js";
|
|
48
|
+
import { Stat } from "./stat/Stat.js";
|
|
46
49
|
import { Switch } from "./switch/Switch.js";
|
|
47
50
|
import { Tab, TabList, TabPanel, Tabs } from "./tabs/Tabs.js";
|
|
48
51
|
import { Text } from "./text/Text.js";
|
|
49
52
|
import { TextArea } from "./text-area/TextArea.js";
|
|
50
53
|
import { TextInput } from "./text-input/TextInput.js";
|
|
51
54
|
import { bootstrapTheme, bootstrapTone } from "./theme/bootstrap.js";
|
|
52
|
-
import { CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, chartColors } from "./theme/chartColors.js";
|
|
53
55
|
import { checkColorDifferences } from "./theme/colorVision.js";
|
|
54
56
|
import { checkTheme } from "./theme/checkTheme.js";
|
|
55
57
|
import { defineComponentTokens } from "./theme/componentTokens.js";
|
|
56
58
|
import { componentTokens } from "./theme/components.js";
|
|
57
59
|
import { SEMANTIC_TOKENS } from "./theme/semanticTokens.js";
|
|
58
60
|
import { defineTheme, findUnknownTokens, mergeThemes } from "./theme/defineTheme.js";
|
|
59
|
-
export { Alert, BREAKPOINTS, BUILT_IN_TONES, Badge, Button, CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, Card, Checkbox, ComboBox, CommandPalette, Container, DatePicker, DateRangePicker, Dialog, DialogTrigger, Disclosure, Divider, Fieldset, Grid, GridItem, Heading, Icon, IconButton, Inline, LinkButton, LoadingRegion, Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, NumberInput, PanneauRoot, PillTrigger, Popover, PopoverTrigger, Prose, RadioGroup, SEMANTIC_TOKENS, SegmentedControl, Select, Skeleton, Slider, Spinner, Stack, Switch, Tab, TabList, TabPanel, Tabs, TagsInput, Text, TextArea, TextInput, ThemeScope, TimeInput, Tooltip, bootstrapTheme, bootstrapTone, chartColors, checkColorDifferences, checkTheme, componentTokens, defineComponentTokens, defineTheme, deriveTone, findUnknownTokens, getNamedIcon, isApplePlatform, loadNamedIcon, matchCommands, mergeThemes, normalizeSearch, toneClassName, useCommandShortcut, usePanneauIntl, usePortalContainer, useToast };
|
|
61
|
+
export { Alert, BREAKPOINTS, BUILT_IN_TONES, Badge, Button, CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, Card, Checkbox, ComboBox, CommandPalette, Container, DatePicker, DateRangePicker, Dialog, DialogTrigger, Disclosure, Divider, Fieldset, Grid, GridItem, Heading, Icon, IconButton, Inline, LineChart, LinkButton, LoadingRegion, MAX_VISIBLE_TOASTS, Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, NumberInput, PanneauRoot, PillTrigger, Popover, PopoverTrigger, Prose, RadioGroup, SEMANTIC_TOKENS, SegmentedControl, Select, Skeleton, Slider, Spinner, Stack, Stat, Switch, Tab, TabList, TabPanel, Tabs, TagsInput, Text, TextArea, TextInput, ThemeScope, TimeInput, Tooltip, bootstrapTheme, bootstrapTone, chartColors, checkColorDifferences, checkTheme, componentTokens, defineComponentTokens, defineTheme, deriveTone, findUnknownTokens, getNamedIcon, getToastTimeout, isApplePlatform, loadNamedIcon, matchCommands, mergeThemes, normalizeSearch, toneClassName, useCommandShortcut, usePanneauIntl, usePortalContainer, useToast, useToastOffset };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.panneau-line-chart-chart {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--panneau-space-1);
|
|
5
|
+
min-width: 0;
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.panneau-line-chart-plot {
|
|
10
|
+
position: relative;
|
|
11
|
+
height: var(--_panneau-line-chart-height, var(--panneau-line-chart-height, 8rem));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.panneau-line-chart-svg {
|
|
15
|
+
display: block;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
overflow: visible;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.panneau-line-chart-baseline {
|
|
22
|
+
stroke: var(--panneau-color-border);
|
|
23
|
+
stroke-width: 1px;
|
|
24
|
+
vector-effect: non-scaling-stroke;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.panneau-line-chart-area {
|
|
28
|
+
fill: var(--_panneau-line-chart-color);
|
|
29
|
+
fill-opacity: var(--panneau-line-chart-area-opacity, 0.12);
|
|
30
|
+
stroke: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.panneau-line-chart-line {
|
|
34
|
+
fill: none;
|
|
35
|
+
stroke: var(--_panneau-line-chart-color);
|
|
36
|
+
stroke-width: var(--panneau-line-chart-line-width, 2px);
|
|
37
|
+
stroke-linejoin: round;
|
|
38
|
+
stroke-linecap: round;
|
|
39
|
+
vector-effect: non-scaling-stroke;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* A path of no length with a round cap: a dot that the stretched plot doesn't deform. */
|
|
43
|
+
.panneau-line-chart-dot {
|
|
44
|
+
fill: none;
|
|
45
|
+
stroke: var(--_panneau-line-chart-color);
|
|
46
|
+
stroke-width: var(--panneau-line-chart-dot-size, 6px);
|
|
47
|
+
stroke-linecap: round;
|
|
48
|
+
vector-effect: non-scaling-stroke;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.panneau-line-chart-max,
|
|
52
|
+
.panneau-line-chart-labels {
|
|
53
|
+
font-size: var(--panneau-line-chart-label-font-size, var(--panneau-font-size-xs));
|
|
54
|
+
font-variant-numeric: var(--panneau-font-numeric);
|
|
55
|
+
color: var(--panneau-color-text-muted);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.panneau-line-chart-max {
|
|
59
|
+
position: absolute;
|
|
60
|
+
inset-block-start: 0;
|
|
61
|
+
inset-inline-start: 0;
|
|
62
|
+
line-height: 1;
|
|
63
|
+
transform: translateY(-50%);
|
|
64
|
+
padding-inline-end: var(--panneau-space-1);
|
|
65
|
+
background-color: var(--panneau-card-bg, var(--panneau-color-surface));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.panneau-line-chart-labels {
|
|
69
|
+
display: flex;
|
|
70
|
+
justify-content: space-between;
|
|
71
|
+
gap: var(--panneau-space-2);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.panneau-line-chart-visually-hidden {
|
|
75
|
+
position: absolute;
|
|
76
|
+
width: 1px;
|
|
77
|
+
height: 1px;
|
|
78
|
+
padding: 0;
|
|
79
|
+
margin: -1px;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
clip-path: inset(50%);
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
border: 0;
|
|
84
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** A point of a `LineChart`. */
|
|
2
|
+
export interface LineChartPoint {
|
|
3
|
+
/** What the point is, under the chart and in its table: a day, a week, a month. */
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
}
|
|
7
|
+
export interface LineChartProps {
|
|
8
|
+
/** What the chart shows: the caption of its table, for assistive technologies. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** The points, in order. Left `undefined` while they load: a skeleton of the plot. */
|
|
11
|
+
points?: LineChartPoint[] | undefined;
|
|
12
|
+
/** Formats a value, in the table and the top of the scale. Defaults to a number of the locale. */
|
|
13
|
+
formatValue?: (value: number) => string;
|
|
14
|
+
/** Height of the plot, without the labels: `'10rem'`. Defaults to the `height` token. */
|
|
15
|
+
height?: string;
|
|
16
|
+
/** The categorical color of the line, from 0. Defaults to the first. */
|
|
17
|
+
color?: number;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A line of values over time, on the categorical chart colors of the theme: the line, the area
|
|
22
|
+
* under it, the top of its scale, and the labels of its first and last points. The plot is hidden
|
|
23
|
+
* from assistive technologies, which read the values in a table instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare function LineChart({ label, points, formatValue, height, color, className, }: LineChartProps): import("react").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../src/line-chart/LineChart.tsx"],"names":[],"mappings":"AAQA,gCAAgC;AAChC,MAAM,WAAW,cAAc;IAC3B,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,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,kGAAkG;IAClG,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,yFAAyF;IACzF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACtB,KAAK,EACL,MAAM,EACN,WAAW,EACX,MAAM,EACN,KAAS,EACT,SAAS,GACZ,EAAE,cAAc,+BAuFhB"}
|