@orbitcommerce/constellation-docs 0.0.0-stage → 1.0.0

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 (62) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +6 -2
  3. package/dist/docs.css +8260 -0
  4. package/dist/index.d.ts +33 -0
  5. package/dist/index.js +308 -0
  6. package/dist/pages/Playground-CNbBbErC.js +129 -0
  7. package/dist/pages/_figures-data-BDmScEny.js +606 -0
  8. package/dist/pages/_foundations-blXWyYh8.js +30 -0
  9. package/dist/pages/_overlays-specimens-Dpn6oiyH.js +310 -0
  10. package/dist/pages/alert-BD4e6QTh.js +769 -0
  11. package/dist/pages/app-shell-KbA-nRqZ.js +1479 -0
  12. package/dist/pages/area-chart-B91dLcGo.js +562 -0
  13. package/dist/pages/avatar-DPPHXJAu.js +713 -0
  14. package/dist/pages/badge-C9JR0thI.js +729 -0
  15. package/dist/pages/button-D3V912P4.js +518 -0
  16. package/dist/pages/calendar-DSDZ9nRH.js +630 -0
  17. package/dist/pages/card-DUggbis3.js +659 -0
  18. package/dist/pages/checkbox-DwimQaK3.js +365 -0
  19. package/dist/pages/colour-BwuO8xAv.js +1498 -0
  20. package/dist/pages/command-palette-xAD7fOg6.js +1243 -0
  21. package/dist/pages/date-picker-BYSa816m.js +1421 -0
  22. package/dist/pages/delta-CtAo0eIM.js +574 -0
  23. package/dist/pages/dialog-BRAf4LMh.js +1451 -0
  24. package/dist/pages/docs-BNOb7AqR.js +515 -0
  25. package/dist/pages/empty-state-C-mLrXW2.js +417 -0
  26. package/dist/pages/figure-tabs-CoPFzzKz.js +460 -0
  27. package/dist/pages/home-dashboard-CFQwDtC9.js +959 -0
  28. package/dist/pages/host-B6znjEgQ.js +109 -0
  29. package/dist/pages/icon-button-C9eSVPPW.js +861 -0
  30. package/dist/pages/icons-sxkTs5Ob.js +473 -0
  31. package/dist/pages/input-KF9Gkawf.js +1093 -0
  32. package/dist/pages/installation-DpsX8G_n.js +445 -0
  33. package/dist/pages/kbd-cNfDoikz.js +544 -0
  34. package/dist/pages/live-globe-ClvLn9Lb.js +571 -0
  35. package/dist/pages/logo-BfGF1Pq9.js +571 -0
  36. package/dist/pages/menu-by2sgQ09.js +1618 -0
  37. package/dist/pages/motion-BvTGc2Dk.js +855 -0
  38. package/dist/pages/orbit-spinner-Dil1Z3Oy.js +332 -0
  39. package/dist/pages/overview-BPEbZQ6g.js +130 -0
  40. package/dist/pages/pagination-BBUnGvv5.js +249 -0
  41. package/dist/pages/popover-Db1gLDpb.js +1136 -0
  42. package/dist/pages/principles-CeAIOIdt.js +483 -0
  43. package/dist/pages/radio-group-CkdBWWfG.js +1077 -0
  44. package/dist/pages/registry-CroHzK9I.js +244 -0
  45. package/dist/pages/release-Dvo684UJ.js +13 -0
  46. package/dist/pages/rolling-number-qmvH84Mq.js +529 -0
  47. package/dist/pages/search-field-BN7MWGQ4.js +693 -0
  48. package/dist/pages/segmented-control-CTbIpRBW.js +777 -0
  49. package/dist/pages/select-DguELoRR.js +1429 -0
  50. package/dist/pages/separator-CPZub9pv.js +351 -0
  51. package/dist/pages/shape-DKvA0YKr.js +627 -0
  52. package/dist/pages/skeleton-DLuBhP46.js +561 -0
  53. package/dist/pages/sparkline-DMMYGbHn.js +668 -0
  54. package/dist/pages/switch-B-Qe4kcT.js +517 -0
  55. package/dist/pages/table-AMoODng4.js +607 -0
  56. package/dist/pages/tabs-B4M-usCV.js +1455 -0
  57. package/dist/pages/textarea-fTuUZRQb.js +693 -0
  58. package/dist/pages/toast-CKP03zjy.js +1176 -0
  59. package/dist/pages/tooltip-CBYil3kt.js +697 -0
  60. package/dist/pages/typography-PCbg8Bhg.js +735 -0
  61. package/manifest.json +3125 -0
  62. package/package.json +35 -4
@@ -0,0 +1,562 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { a as DocTable, d as Section, i as DocPage, l as Note, m as ThemePair, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-BNOb7AqR.js";
4
+ import { d as formatGbpTick, f as formatHour, h as takingsSeries, l as figuresFor, u as formatGbp } from "./_figures-data-BDmScEny.js";
5
+ import { useEffect, useMemo, useRef, useState } from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+ import { AreaChart, Button, SegmentedControl } from "@orbitcommerce/constellation";
8
+ import { ArrowsClockwiseIcon } from "@orbitcommerce/constellation/icons";
9
+ //#region src/pages/components/area-chart.tsx
10
+ var PREVIEW = takingsSeries(21, "none");
11
+ var LAST_30 = takingsSeries(30, "none");
12
+ var LAST_30_COMPARED = takingsSeries(30);
13
+ var LAST_14 = takingsSeries(14, "none");
14
+ var TODAY_BY_HOUR = figuresFor("today")[0].series;
15
+ var round2 = (n) => Math.round(n * 100) / 100;
16
+ function Preview() {
17
+ return /* @__PURE__ */ jsx("div", {
18
+ className: "area-chart-preview",
19
+ children: /* @__PURE__ */ jsx(AreaChart, {
20
+ data: PREVIEW,
21
+ height: 124,
22
+ formatValue: formatGbp,
23
+ formatTick: formatGbpTick
24
+ })
25
+ });
26
+ }
27
+ function RangeDemo() {
28
+ const [range, setRange] = useState("30");
29
+ const [compare, setCompare] = useState("previous");
30
+ const [refreshes, setRefreshes] = useState(0);
31
+ const days = Number(range);
32
+ const data = useMemo(() => {
33
+ const base = takingsSeries(days, compare);
34
+ if (!refreshes) return base;
35
+ return base.map((d, i) => ({
36
+ ...d,
37
+ value: round2(d.value * (1 + .1 * Math.sin(i * 1.7 + refreshes * 2.3)))
38
+ }));
39
+ }, [
40
+ days,
41
+ compare,
42
+ refreshes
43
+ ]);
44
+ return /* @__PURE__ */ jsxs("div", {
45
+ className: "area-chart-demo",
46
+ children: [/* @__PURE__ */ jsxs("div", {
47
+ className: "area-chart-demo__controls",
48
+ children: [
49
+ /* @__PURE__ */ jsx(SegmentedControl, {
50
+ "aria-label": "Range",
51
+ size: "sm",
52
+ value: range,
53
+ onValueChange: setRange,
54
+ options: [
55
+ {
56
+ value: "7",
57
+ label: "7 days"
58
+ },
59
+ {
60
+ value: "30",
61
+ label: "30 days"
62
+ },
63
+ {
64
+ value: "90",
65
+ label: "90 days"
66
+ }
67
+ ]
68
+ }),
69
+ /* @__PURE__ */ jsx(SegmentedControl, {
70
+ "aria-label": "Compare with",
71
+ size: "sm",
72
+ value: compare,
73
+ onValueChange: setCompare,
74
+ options: [{
75
+ value: "previous",
76
+ label: "Previous period"
77
+ }, {
78
+ value: "last-year",
79
+ label: "Last year"
80
+ }]
81
+ }),
82
+ /* @__PURE__ */ jsx(Button, {
83
+ size: "sm",
84
+ variant: "ghost",
85
+ icon: /* @__PURE__ */ jsx(ArrowsClockwiseIcon, {}),
86
+ onClick: () => setRefreshes((r) => r + 1),
87
+ children: "Refresh"
88
+ })
89
+ ]
90
+ }), /* @__PURE__ */ jsx(AreaChart, {
91
+ data,
92
+ height: 260,
93
+ valueLabel: `Last ${days} days`,
94
+ compareLabel: compare === "previous" ? `Previous ${days} days` : "Same days last year",
95
+ formatValue: formatGbp,
96
+ formatTick: formatGbpTick
97
+ })]
98
+ });
99
+ }
100
+ function StatesDemo() {
101
+ const [state, setState] = useState("loading");
102
+ return /* @__PURE__ */ jsxs("div", {
103
+ className: "area-chart-demo",
104
+ children: [/* @__PURE__ */ jsx("div", {
105
+ className: "area-chart-demo__controls",
106
+ children: /* @__PURE__ */ jsx(SegmentedControl, {
107
+ "aria-label": "Chart state",
108
+ size: "sm",
109
+ value: state,
110
+ onValueChange: setState,
111
+ options: [
112
+ {
113
+ value: "data",
114
+ label: "With data"
115
+ },
116
+ {
117
+ value: "loading",
118
+ label: "Loading"
119
+ },
120
+ {
121
+ value: "refreshing",
122
+ label: "Refreshing"
123
+ },
124
+ {
125
+ value: "empty",
126
+ label: "Empty"
127
+ }
128
+ ]
129
+ })
130
+ }), /* @__PURE__ */ jsx(AreaChart, {
131
+ data: state === "data" || state === "refreshing" ? LAST_30_COMPARED : [],
132
+ loading: state === "loading" || state === "refreshing",
133
+ emptyMessage: "No sales in this period yet",
134
+ valueLabel: "Last 30 days",
135
+ compareLabel: "Previous 30 days",
136
+ formatValue: formatGbp,
137
+ formatTick: formatGbpTick
138
+ })]
139
+ });
140
+ }
141
+ /**
142
+ * Holds the readout open on one day for review, by pointing at the plot the way a mouse would.
143
+ * Moving the real pointer over the chart takes over from there.
144
+ */
145
+ function HeldOpen({ at, children }) {
146
+ const ref = useRef(null);
147
+ useEffect(() => {
148
+ let frame = requestAnimationFrame(() => {
149
+ frame = requestAnimationFrame(() => {
150
+ const plot = ref.current?.querySelector(".o-area-chart__plot");
151
+ if (!plot) return;
152
+ const rect = plot.getBoundingClientRect();
153
+ plot.dispatchEvent(new PointerEvent("pointermove", {
154
+ bubbles: true,
155
+ clientX: rect.left + rect.width * at,
156
+ clientY: rect.top + rect.height / 2
157
+ }));
158
+ });
159
+ });
160
+ return () => cancelAnimationFrame(frame);
161
+ }, [at]);
162
+ return /* @__PURE__ */ jsx("div", {
163
+ ref,
164
+ className: "area-chart-held",
165
+ children
166
+ });
167
+ }
168
+ function Page() {
169
+ return /* @__PURE__ */ jsxs(DocPage, {
170
+ title: "Area chart",
171
+ status: "new",
172
+ importNames: ["AreaChart"],
173
+ lead: "The range chart: one figure over time as a single Orbit line over a wash that fades to nothing, with an optional dashed comparison and a readout that snaps to the nearest day. Reach for it under headline figures, for takings, orders or visits across a range.",
174
+ children: [
175
+ /* @__PURE__ */ jsx(Section, {
176
+ id: "basics",
177
+ title: "Basics",
178
+ description: /* @__PURE__ */ jsxs("p", { children: [
179
+ "Give it one point per day, oldest first, with dates as ",
180
+ /* @__PURE__ */ jsx("code", { children: "YYYY-MM-DD" }),
181
+ " strings (read as local dates) or ",
182
+ /* @__PURE__ */ jsx("code", { children: "Date" }),
183
+ " objects. Hover the chart, or tab to it and use the arrow keys, to read each day."
184
+ ] }),
185
+ children: /* @__PURE__ */ jsx(Example, {
186
+ clientOnly: true,
187
+ align: "fill",
188
+ code: `
189
+ const gbp = new Intl.NumberFormat('en-GB', { style: 'currency', currency: 'GBP' })
190
+ const gbpCompact = new Intl.NumberFormat('en-GB', {
191
+ style: 'currency', currency: 'GBP', notation: 'compact', maximumFractionDigits: 1,
192
+ })
193
+
194
+ <AreaChart
195
+ data={[{ date: '2026-08-31', value: 2412.5 }, /* one point per day */]}
196
+ valueLabel="Takings"
197
+ formatValue={(v) => gbp.format(v)}
198
+ formatTick={(v) => gbpCompact.format(v)}
199
+ />`,
200
+ children: /* @__PURE__ */ jsx(AreaChart, {
201
+ data: LAST_30,
202
+ valueLabel: "Takings",
203
+ formatValue: formatGbp,
204
+ formatTick: formatGbpTick
205
+ })
206
+ })
207
+ }),
208
+ /* @__PURE__ */ jsx(Section, {
209
+ id: "comparison",
210
+ title: "With a comparison",
211
+ description: /* @__PURE__ */ jsxs("p", { children: [
212
+ "Add ",
213
+ /* @__PURE__ */ jsx("code", { children: "compare" }),
214
+ " to each point and the chart draws the earlier period as a dashed grey line, adds a legend above the plot, and shows both values and the change in the readout. Name both series for what they are with ",
215
+ /* @__PURE__ */ jsx("code", { children: "valueLabel" }),
216
+ " and ",
217
+ /* @__PURE__ */ jsx("code", { children: "compareLabel" }),
218
+ "."
219
+ ] }),
220
+ children: /* @__PURE__ */ jsx(Example, {
221
+ clientOnly: true,
222
+ align: "fill",
223
+ code: `
224
+ <AreaChart
225
+ data={[{ date: '2026-08-31', value: 2412.5, compare: 2198 }, /* ... */]}
226
+ valueLabel="Last 30 days"
227
+ compareLabel="Previous 30 days"
228
+ formatValue={(v) => gbp.format(v)}
229
+ formatTick={(v) => gbpCompact.format(v)}
230
+ />`,
231
+ children: /* @__PURE__ */ jsx(AreaChart, {
232
+ data: LAST_30_COMPARED,
233
+ valueLabel: "Last 30 days",
234
+ compareLabel: "Previous 30 days",
235
+ formatValue: formatGbp,
236
+ formatTick: formatGbpTick
237
+ })
238
+ })
239
+ }),
240
+ /* @__PURE__ */ jsx(Section, {
241
+ id: "ranges",
242
+ title: "Ranges and refreshes",
243
+ description: /* @__PURE__ */ jsx("p", { children: "A new range (different days) redraws: the old line fades out as the new one is uncovered from the left. A refresh of the same range (same days, new figures) morphs the line, the wash and the gridlines in place, so you can see what changed. Switch the range, then press Refresh." }),
244
+ children: /* @__PURE__ */ jsx(Example, {
245
+ clientOnly: true,
246
+ align: "fill",
247
+ code: `
248
+ const [range, setRange] = useState('30')
249
+
250
+ <SegmentedControl aria-label="Range" size="sm" value={range} onValueChange={setRange}
251
+ options={[{ value: '7', label: '7 days' }, { value: '30', label: '30 days' }, { value: '90', label: '90 days' }]} />
252
+
253
+ <AreaChart
254
+ data={takings[range]}
255
+ height={260}
256
+ valueLabel={\`Last \${range} days\`}
257
+ compareLabel={\`Previous \${range} days\`}
258
+ formatValue={(v) => gbp.format(v)}
259
+ formatTick={(v) => gbpCompact.format(v)}
260
+ />`,
261
+ children: /* @__PURE__ */ jsx(RangeDemo, {})
262
+ })
263
+ }),
264
+ /* @__PURE__ */ jsx(Section, {
265
+ id: "readout",
266
+ title: "The readout",
267
+ description: /* @__PURE__ */ jsx("p", { children: "The crosshair snaps to the nearest day and the readout glides after it on a spring, opening on whichever side has room. It leads with the value in Sora, keys each series with a short stroke that matches its line, and shows the change against the comparison. Here it is held open on one day in both themes." }),
268
+ children: /* @__PURE__ */ jsx(ThemePair, {
269
+ clientOnly: true,
270
+ align: "fill",
271
+ children: /* @__PURE__ */ jsx(HeldOpen, {
272
+ at: .72,
273
+ children: /* @__PURE__ */ jsx(AreaChart, {
274
+ data: LAST_30_COMPARED,
275
+ height: 220,
276
+ valueLabel: "Last 30 days",
277
+ compareLabel: "Previous 30 days",
278
+ formatValue: formatGbp,
279
+ formatTick: formatGbpTick
280
+ })
281
+ })
282
+ })
283
+ }),
284
+ /* @__PURE__ */ jsxs(Section, {
285
+ id: "axes",
286
+ title: "Axes and formatting",
287
+ description: /* @__PURE__ */ jsx("p", { children: "Four formatters shape every label. The defaults are UK formats: dates such as \"3 Aug\" on the axis, \"Mon 3 Aug\" in the readout, and compact values such as \"2.5k\" on the gridlines. For hourly data, pass dates for each hour and format them as times (\"14:00\")." }),
288
+ children: [
289
+ /* @__PURE__ */ jsx(Example, {
290
+ clientOnly: true,
291
+ align: "fill",
292
+ code: `
293
+ const hour = (d: Date) => \`\${String(d.getHours()).padStart(2, '0')}:00\`
294
+
295
+ <AreaChart
296
+ data={todayByHour} // { date: Date at each hour, value, compare }
297
+ valueLabel="Today"
298
+ compareLabel="Yesterday"
299
+ formatDate={hour}
300
+ formatTooltipDate={(d) => \`Today, \${hour(d)}\`}
301
+ formatValue={(v) => gbp.format(v)}
302
+ formatTick={(v) => gbpCompact.format(v)}
303
+ />`,
304
+ children: /* @__PURE__ */ jsx(AreaChart, {
305
+ data: TODAY_BY_HOUR,
306
+ valueLabel: "Today",
307
+ compareLabel: "Yesterday",
308
+ formatDate: formatHour,
309
+ formatTooltipDate: (d) => `Today, ${formatHour(d)}`,
310
+ formatValue: formatGbp,
311
+ formatTick: formatGbpTick
312
+ })
313
+ }),
314
+ /* @__PURE__ */ jsx(DocTable, {
315
+ columns: [
316
+ "Prop",
317
+ "Formats",
318
+ "Default"
319
+ ],
320
+ rows: [
321
+ [
322
+ /* @__PURE__ */ jsx("code", { children: "formatDate" }),
323
+ "Dates under the plot",
324
+ "\"3 Aug\": day and short month, en-GB"
325
+ ],
326
+ [
327
+ /* @__PURE__ */ jsx("code", { children: "formatTooltipDate" }),
328
+ "The date heading the readout",
329
+ "\"Mon 3 Aug\": weekday, day and short month"
330
+ ],
331
+ [
332
+ /* @__PURE__ */ jsx("code", { children: "formatTick" }),
333
+ "Gridline labels",
334
+ "\"2.5k\": a compact number"
335
+ ],
336
+ [
337
+ /* @__PURE__ */ jsx("code", { children: "formatValue" }),
338
+ "Values in the readout and the accessible summary",
339
+ "\"2,512.4\": a grouped number"
340
+ ]
341
+ ]
342
+ }),
343
+ /* @__PURE__ */ jsxs(Note, {
344
+ title: "Sept, not Sep",
345
+ children: [
346
+ "The en-GB formats write September as \"Sept\" in current browsers, so the defaults show \"29 Sept\". Pass your own",
347
+ " ",
348
+ /* @__PURE__ */ jsx("code", { children: "formatDate" }),
349
+ " if you need three letters."
350
+ ]
351
+ }),
352
+ /* @__PURE__ */ jsx(SubSection, {
353
+ title: "How many labels",
354
+ description: /* @__PURE__ */ jsx("p", { children: "Dates are spaced to fit, roughly one per 84px, counted back from the latest day so today always has a label. The first and last labels align to the edges of the plot. Gridlines fall on round values (steps of 1, 2, 2.5 or 5) and always include zero." })
355
+ })
356
+ ]
357
+ }),
358
+ /* @__PURE__ */ jsx(Section, {
359
+ id: "states",
360
+ title: "Loading and empty",
361
+ description: /* @__PURE__ */ jsxs("p", { children: [
362
+ "With ",
363
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
364
+ " and no data yet, a soft silhouette of a chart shimmers where the plot will be. With ",
365
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
366
+ " and data already drawn, the chart holds its frame at half strength until the new data lands. With no data, ",
367
+ /* @__PURE__ */ jsx("code", { children: "emptyMessage" }),
368
+ " sits in the middle of the plot."
369
+ ] }),
370
+ children: /* @__PURE__ */ jsx(Example, {
371
+ clientOnly: true,
372
+ align: "fill",
373
+ code: `
374
+ <AreaChart data={[]} loading />
375
+ <AreaChart data={data} loading /> // refreshing: dims and holds its frame
376
+ <AreaChart data={[]} emptyMessage="No sales in this period yet" />`,
377
+ children: /* @__PURE__ */ jsx(StatesDemo, {})
378
+ })
379
+ }),
380
+ /* @__PURE__ */ jsx(Section, {
381
+ id: "motion",
382
+ title: "Motion",
383
+ children: /* @__PURE__ */ jsx(DocTable, {
384
+ columns: ["Moment", "What happens"],
385
+ rows: [
386
+ ["Arrival", "The line is uncovered left to right behind a soft edge over 720ms, and the wash settles in after it."],
387
+ ["A new range", "The old line fades out over 220ms while the new one is uncovered."],
388
+ ["A refresh", "The line, wash and comparison morph to their new shape over 720ms, and gridlines and their labels glide with them."],
389
+ ["Reading", "The crosshair, markers and readout glide from day to day on the snappy spring."],
390
+ ["Reduced motion", "The line fades in, refreshes swap without morphing, the readout jumps, and the loading silhouette breathes instead of shimmering."]
391
+ ]
392
+ })
393
+ }),
394
+ /* @__PURE__ */ jsxs(Section, {
395
+ id: "guidelines",
396
+ title: "Guidelines",
397
+ children: [/* @__PURE__ */ jsx(DoDont, {
398
+ clientOnly: true,
399
+ do: {
400
+ children: /* @__PURE__ */ jsx("div", {
401
+ className: "area-chart-dodont",
402
+ children: /* @__PURE__ */ jsx(AreaChart, {
403
+ data: LAST_14,
404
+ height: 140,
405
+ formatValue: formatGbp,
406
+ formatTick: formatGbpTick
407
+ })
408
+ }),
409
+ caption: "Compact money on the gridlines (\"£4k\"), full amounts in the readout where they can be read."
410
+ },
411
+ dont: {
412
+ children: /* @__PURE__ */ jsx("div", {
413
+ className: "area-chart-dodont",
414
+ children: /* @__PURE__ */ jsx(AreaChart, {
415
+ data: LAST_14,
416
+ height: 140,
417
+ formatValue: formatGbp,
418
+ formatTick: formatGbp
419
+ })
420
+ }),
421
+ caption: "Full amounts on the axis push the plot aside and make every gridline a figure to read."
422
+ }
423
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
424
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
425
+ "One figure at a time. To offer several, put them in ",
426
+ /* @__PURE__ */ jsx(DocLink, {
427
+ to: "/components/figure-tabs",
428
+ children: "Figure tabs"
429
+ }),
430
+ " ",
431
+ "above the chart and let it follow the one that is selected."
432
+ ] }),
433
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
434
+ "Choose the range with a ",
435
+ /* @__PURE__ */ jsx(DocLink, {
436
+ to: "/components/segmented-control",
437
+ children: "Segmented control"
438
+ }),
439
+ " above the chart, and compare with the period just before it, of the same length, unless the page says otherwise."
440
+ ] }),
441
+ "Name the comparison for what it is: \"Previous 30 days\" or \"Same days last year\", never just \"Before\".",
442
+ "Give it room: 240px (the default) on a page, 200px at the least. The height includes the date labels; the legend sits above."
443
+ ] })]
444
+ }),
445
+ /* @__PURE__ */ jsx(Section, {
446
+ id: "accessibility",
447
+ title: "Accessibility",
448
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
449
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
450
+ "The plot is an image with a summary for its name, generated from the data unless you pass",
451
+ " ",
452
+ /* @__PURE__ */ jsx("code", { children: "label" }),
453
+ ": the range, the highest and lowest days, and the comparison."
454
+ ] }),
455
+ "Tab to the plot and it reads the latest day. Left and right arrows step through the days, Home and End jump to the ends, and Escape hides the readout. Each step is announced politely.",
456
+ "The focus ring is teal, 2px, and sits 6px outside the plot.",
457
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
458
+ "While ",
459
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
460
+ ", the plot is marked busy. The readout itself is hidden from assistive tech, because the announcement already says what it shows."
461
+ ] }),
462
+ "Every movement respects reduced motion (see Motion)."
463
+ ] })
464
+ }),
465
+ /* @__PURE__ */ jsxs(Section, {
466
+ id: "props",
467
+ title: "Props",
468
+ description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native div attribute except children." }),
469
+ children: [/* @__PURE__ */ jsx(PropsTable, { rows: [
470
+ {
471
+ name: "data",
472
+ type: "readonly AreaChartDatum[]",
473
+ required: true,
474
+ description: "One point per day (or bucket), oldest first."
475
+ },
476
+ {
477
+ name: "height",
478
+ type: "number",
479
+ default: "240",
480
+ description: "Height in px of the plot and its date labels. The legend sits above."
481
+ },
482
+ {
483
+ name: "valueLabel",
484
+ type: "string",
485
+ default: "'This period'",
486
+ description: "Names the main series in the legend and the summary."
487
+ },
488
+ {
489
+ name: "compareLabel",
490
+ type: "string",
491
+ default: "'Previous period'",
492
+ description: "Names the comparison series."
493
+ },
494
+ {
495
+ name: "formatValue",
496
+ type: "(value: number) => string",
497
+ default: "grouped number",
498
+ description: "Values in the readout and the summary."
499
+ },
500
+ {
501
+ name: "formatTick",
502
+ type: "(value: number) => string",
503
+ default: "compact number",
504
+ description: "Gridline labels, e.g. \"2.5k\"."
505
+ },
506
+ {
507
+ name: "formatDate",
508
+ type: "(date: Date) => string",
509
+ default: "day and month",
510
+ description: "Dates under the plot, e.g. \"3 Aug\"."
511
+ },
512
+ {
513
+ name: "formatTooltipDate",
514
+ type: "(date: Date) => string",
515
+ default: "weekday, day and month",
516
+ description: "The date heading the readout."
517
+ },
518
+ {
519
+ name: "loading",
520
+ type: "boolean",
521
+ default: "false",
522
+ description: "A shimmering silhouette with no data; a dimmed, held frame with data."
523
+ },
524
+ {
525
+ name: "emptyMessage",
526
+ type: "ReactNode",
527
+ default: "'Nothing to show for this period yet'",
528
+ description: "Shown in the plot when data is empty."
529
+ },
530
+ {
531
+ name: "label",
532
+ type: "string",
533
+ description: "Accessible summary. Generated from the data when omitted."
534
+ }
535
+ ] }), /* @__PURE__ */ jsx(PropsTable, {
536
+ title: "AreaChartDatum",
537
+ rows: [
538
+ {
539
+ name: "date",
540
+ type: "string | Date",
541
+ required: true,
542
+ description: "The day or bucket. YYYY-MM-DD strings are read as local dates."
543
+ },
544
+ {
545
+ name: "value",
546
+ type: "number",
547
+ required: true,
548
+ description: "The figure for that day."
549
+ },
550
+ {
551
+ name: "compare",
552
+ type: "number | null",
553
+ description: "The same point in the comparison period, drawn dashed."
554
+ }
555
+ ]
556
+ })]
557
+ })
558
+ ]
559
+ });
560
+ }
561
+ //#endregion
562
+ export { Page, Preview };