@orbitcommerce/constellation-docs 1.0.0 → 1.2.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 (235) hide show
  1. package/dist/docs.css +14764 -2237
  2. package/dist/index.js +2 -2
  3. package/dist/pages/{Playground-CNbBbErC.js → Playground-Mk1yIWXb.js} +2 -2
  4. package/dist/pages/_address-data-L9BR499w.js +161 -0
  5. package/dist/pages/_builder-demo-C0eJUmPU.js +282 -0
  6. package/dist/pages/_card-art-0be5ncyV.js +18 -0
  7. package/dist/pages/_conversation-samples-Bq7cn-4d.js +70 -0
  8. package/dist/pages/{_figures-data-BDmScEny.js → _figures-data-DaDvB7Nm.js} +5 -5
  9. package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
  10. package/dist/pages/{_overlays-specimens-Dpn6oiyH.js → _overlays-specimens-bawR331Z.js} +33 -23
  11. package/dist/pages/_preview-specimens-DKQC9HAo.js +153 -0
  12. package/dist/pages/accordion-Sg0TUqxB.js +1036 -0
  13. package/dist/pages/address-autocomplete-DP0PUOlK.js +360 -0
  14. package/dist/pages/address-block-BZOOOPA9.js +368 -0
  15. package/dist/pages/address-fields-CwSqro3W.js +277 -0
  16. package/dist/pages/ai-highlight-D3x2vD83.js +642 -0
  17. package/dist/pages/{alert-BD4e6QTh.js → alert-D3i7xZTU.js} +195 -50
  18. package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
  19. package/dist/pages/{app-shell-KbA-nRqZ.js → app-shell-D4hdlHps.js} +133 -54
  20. package/dist/pages/{area-chart-B91dLcGo.js → area-chart-BEWFwiB2.js} +183 -27
  21. package/dist/pages/{avatar-DPPHXJAu.js → avatar-BFEqQViw.js} +194 -12
  22. package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
  23. package/dist/pages/{badge-C9JR0thI.js → badge-0-PyMrih.js} +441 -135
  24. package/dist/pages/bar-chart-DkLogYlt.js +1060 -0
  25. package/dist/pages/bar-fold-B-3XeIDZ.js +360 -0
  26. package/dist/pages/board-card-D2tZY_mU.js +415 -0
  27. package/dist/pages/brand-mark-BqiLvFSR.js +417 -0
  28. package/dist/pages/{button-D3V912P4.js → button-DAyfssDY.js} +276 -79
  29. package/dist/pages/{calendar-DSDZ9nRH.js → calendar-Ds7KsgSI.js} +69 -17
  30. package/dist/pages/canvas-stage-1KiPspkX.js +472 -0
  31. package/dist/pages/card-CQEM1_wc.js +1567 -0
  32. package/dist/pages/caret-suggestions-oHI6QvqW.js +526 -0
  33. package/dist/pages/chart-legend-B20AbakD.js +724 -0
  34. package/dist/pages/chat-composer-CwzUJYIa.js +437 -0
  35. package/dist/pages/checkbox-BG9Zkb6j.js +1581 -0
  36. package/dist/pages/checklist-card-DEyykVFS.js +783 -0
  37. package/dist/pages/chip-Ck-o3Ui6.js +839 -0
  38. package/dist/pages/chip-list-k1LxXuCi.js +414 -0
  39. package/dist/pages/clamp-text-n-iE8RDR.js +203 -0
  40. package/dist/pages/coachmark-Be2ghobT.js +366 -0
  41. package/dist/pages/code-block-Dv_Y5GYq.js +622 -0
  42. package/dist/pages/collab-field-CfqqK7d2.js +696 -0
  43. package/dist/pages/color-field-CZpfcA-A.js +1127 -0
  44. package/dist/pages/{colour-BwuO8xAv.js → colour-q2ntvI0w.js} +496 -20
  45. package/dist/pages/column-mapper-TsTG39cl.js +502 -0
  46. package/dist/pages/combobox-DvK2j5tI.js +1334 -0
  47. package/dist/pages/{command-palette-xAD7fOg6.js → command-palette-CJ7uBA04.js} +201 -58
  48. package/dist/pages/comment-box-CDSGYhr5.js +346 -0
  49. package/dist/pages/composer-D4B0NgpA.js +689 -0
  50. package/dist/pages/condition-builder-BZy2ZGXe.js +715 -0
  51. package/dist/pages/conflict-chooser-C--_9UIS.js +210 -0
  52. package/dist/pages/context-menu-F9DV30ia.js +487 -0
  53. package/dist/pages/copy-button-Cn7WiKRF.js +568 -0
  54. package/dist/pages/copy-field-D3Xt3Jq6.js +511 -0
  55. package/dist/pages/danger-zone-Db_UUeiP.js +564 -0
  56. package/dist/pages/date-input-GOW067EB.js +956 -0
  57. package/dist/pages/{date-picker-BYSa816m.js → date-picker-GdBciR99.js} +186 -38
  58. package/dist/pages/date-time-BLKCXtVZ.js +678 -0
  59. package/dist/pages/{delta-CtAo0eIM.js → delta-CNAGv8JY.js} +266 -61
  60. package/dist/pages/description-list-BPeXn1eW.js +1268 -0
  61. package/dist/pages/device-switcher-BCaN99c1.js +554 -0
  62. package/dist/pages/dialog-CRpkRC98.js +3164 -0
  63. package/dist/pages/{docs-BNOb7AqR.js → docs-lM2UBSir.js} +20 -15
  64. package/dist/pages/doodle-nzkqi2UI.js +201 -0
  65. package/dist/pages/drag-ghost-B6kpzC3O.js +426 -0
  66. package/dist/pages/drill-menu-cskH5mol.js +490 -0
  67. package/dist/pages/dropzone-DOY_Rhw0.js +1069 -0
  68. package/dist/pages/element-toolbar-DZIhXlCJ.js +498 -0
  69. package/dist/pages/emoji-picker-CqaWaffD.js +235 -0
  70. package/dist/pages/empty-state-4U2txFpI.js +1113 -0
  71. package/dist/pages/facet-filters-McbBeY9e.js +353 -0
  72. package/dist/pages/figure-D-HF5vCj.js +563 -0
  73. package/dist/pages/figure-strip-BB3mNl7D.js +1364 -0
  74. package/dist/pages/{figure-tabs-CoPFzzKz.js → figure-tabs-QOeQMY6N.js} +153 -35
  75. package/dist/pages/file-chip-DMDjtlqQ.js +738 -0
  76. package/dist/pages/filter-pill-DzqNOsD4.js +1295 -0
  77. package/dist/pages/font-picker-Bqhu0QMh.js +416 -0
  78. package/dist/pages/form-grid-BfWCVlie.js +692 -0
  79. package/dist/pages/gallery-BBk2EOri.js +453 -0
  80. package/dist/pages/gif-picker-CnoDTCaL.js +270 -0
  81. package/dist/pages/gradient-editor-Bqxp7Fxj.js +378 -0
  82. package/dist/pages/grouped-checklist-gNZ0tBKU.js +477 -0
  83. package/dist/pages/heatmap-BohgIcNk.js +507 -0
  84. package/dist/pages/highlight-text-BfxzfmvS.js +287 -0
  85. package/dist/pages/{home-dashboard-CFQwDtC9.js → home-dashboard-CxPmvduE.js} +21 -18
  86. package/dist/pages/hosted-embed-Jef3aIMP.js +163 -0
  87. package/dist/pages/hosted-field-BLh-53AE.js +208 -0
  88. package/dist/pages/hosted-field-DEpI4lVS.js +514 -0
  89. package/dist/pages/{icon-button-C9eSVPPW.js → icon-button-Bu4Gj5sy.js} +370 -31
  90. package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
  91. package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
  92. package/dist/pages/{icons-sxkTs5Ob.js → icons-CJ9Aar3d.js} +315 -52
  93. package/dist/pages/image-cropper-NyougqLH.js +466 -0
  94. package/dist/pages/image-field-7knBv4mJ.js +567 -0
  95. package/dist/pages/import-result-CmTtGXW_.js +486 -0
  96. package/dist/pages/inline-confirm-CEcI5Lxo.js +327 -0
  97. package/dist/pages/inline-edit-Ba39SzhM.js +1125 -0
  98. package/dist/pages/input-CzLCzfyx.js +2372 -0
  99. package/dist/pages/{installation-DpsX8G_n.js → installation-C3UcpQJT.js} +112 -29
  100. package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
  101. package/dist/pages/kanban-Dy9sPAI0.js +740 -0
  102. package/dist/pages/{kbd-cNfDoikz.js → kbd-UNj4zqxn.js} +15 -14
  103. package/dist/pages/layout-primitives-CPRaZeyt.js +483 -0
  104. package/dist/pages/line-chart-CntWxeMF.js +1117 -0
  105. package/dist/pages/link-CXqvAg9z.js +689 -0
  106. package/dist/pages/link-picker-BMFGCC67.js +478 -0
  107. package/dist/pages/link-row-x8yaUuWc.js +595 -0
  108. package/dist/pages/{live-globe-ClvLn9Lb.js → live-globe-95ROMhGQ.js} +191 -47
  109. package/dist/pages/loading-overlay-BeGuXM9G.js +456 -0
  110. package/dist/pages/loading-state-BNbCo51C.js +556 -0
  111. package/dist/pages/log-viewer-BQz8I_a2.js +503 -0
  112. package/dist/pages/{logo-BfGF1Pq9.js → logo-B38rnzoq.js} +13 -13
  113. package/dist/pages/lottie_light-CxEH8eiR.js +9116 -0
  114. package/dist/pages/markdown-Ied72vMT.js +237 -0
  115. package/dist/pages/markdown-field-BfnIEKZH.js +193 -0
  116. package/dist/pages/media-banner-DkStCia0.js +233 -0
  117. package/dist/pages/{menu-by2sgQ09.js → menu-NrLYKqKp.js} +623 -109
  118. package/dist/pages/message-thread-Bo4zbxqu.js +731 -0
  119. package/dist/pages/meta-line-D5p2TycR.js +371 -0
  120. package/dist/pages/model-viewer-BfokvHoc.js +60288 -0
  121. package/dist/pages/model-viewer-C8PFO8wk.js +577 -0
  122. package/dist/pages/month-calendar-T1vw9Rup.js +457 -0
  123. package/dist/pages/{motion-BvTGc2Dk.js → motion-CrXtiBvA.js} +20 -10
  124. package/dist/pages/number-input-CuyMZg18.js +968 -0
  125. package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
  126. package/dist/pages/{orbit-spinner-Dil1Z3Oy.js → orbit-spinner-Dxv5qAhr.js} +30 -14
  127. package/dist/pages/otp-input-CVRoX1mw.js +591 -0
  128. package/dist/pages/{overview-BPEbZQ6g.js → overview-LA9XRhZc.js} +4 -4
  129. package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
  130. package/dist/pages/{pagination-BBUnGvv5.js → pagination-C1EgVtW4.js} +74 -29
  131. package/dist/pages/palette-tile-X9ZXu2Z0.js +414 -0
  132. package/dist/pages/password-field-DHEQKyUC.js +912 -0
  133. package/dist/pages/person-cell-BmjbADBz.js +564 -0
  134. package/dist/pages/phone-input-B3G7Qpb2.js +747 -0
  135. package/dist/pages/plan-card-DRaA6RuB.js +621 -0
  136. package/dist/pages/plan-card-DtloWvMh.js +258 -0
  137. package/dist/pages/plan-comparison-BVIGTtbd.js +559 -0
  138. package/dist/pages/plan-grid-cfPVTB5V.js +251 -0
  139. package/dist/pages/point-list-BbPmZjsm.js +222 -0
  140. package/dist/pages/{popover-Db1gLDpb.js → popover-C3Oar9D5.js} +76 -14
  141. package/dist/pages/presence-avatars-CRZIk8n9.js +328 -0
  142. package/dist/pages/preview-frame-Bcwk0y_Q.js +1631 -0
  143. package/dist/pages/price-CRBLoa9h.js +604 -0
  144. package/dist/pages/{principles-CeAIOIdt.js → principles-pnDyfHpK.js} +9 -9
  145. package/dist/pages/print-page-BkLv6bW8.js +513 -0
  146. package/dist/pages/profile-hero-CC9dUzuN.js +498 -0
  147. package/dist/pages/progress-CP_awmo4.js +904 -0
  148. package/dist/pages/progress-ring-JuOAwk2T.js +576 -0
  149. package/dist/pages/{radio-group-CkdBWWfG.js → radio-group-C-4tg6FS.js} +580 -18
  150. package/dist/pages/radius-control-B2kRA2Ch.js +441 -0
  151. package/dist/pages/rating-CweKN2SX.js +471 -0
  152. package/dist/pages/record-layout-DUP_X0RL.js +719 -0
  153. package/dist/pages/record-pager-y9D7JFgb.js +278 -0
  154. package/dist/pages/registry-BZg-xAbi.js +594 -0
  155. package/dist/pages/{release-Dvo684UJ.js → release-Cs6tl16C.js} +4 -1
  156. package/dist/pages/repeater-BRZYKRQa.js +1351 -0
  157. package/dist/pages/reply-feedback-BDnHprla.js +192 -0
  158. package/dist/pages/reveal-BygENBbL.js +460 -0
  159. package/dist/pages/rich-text-DOFQZEpT.js +156 -0
  160. package/dist/pages/rich-text-editor-BhIM20JI.js +1265 -0
  161. package/dist/pages/rolldown-runtime-CbKu08Hx.js +25 -0
  162. package/dist/pages/{rolling-number-qmvH84Mq.js → rolling-number-GR3Cyfpz.js} +12 -12
  163. package/dist/pages/row-list-Dl6CYhC-.js +1565 -0
  164. package/dist/pages/rule-list-DTCmIMpT.js +648 -0
  165. package/dist/pages/save-status-B5KkyMZP.js +378 -0
  166. package/dist/pages/schedule-YycI95O1.js +243 -0
  167. package/dist/pages/scroll-area-B2sGm23Q.js +423 -0
  168. package/dist/pages/{search-field-BN7MWGQ4.js → search-field-D1uG7R6A.js} +15 -15
  169. package/dist/pages/search-menu-DMuXyUUW.js +580 -0
  170. package/dist/pages/secret-field-Dj9x3LL8.js +337 -0
  171. package/dist/pages/section-rail-BtTCETS5.js +637 -0
  172. package/dist/pages/section-v2Pubup9.js +639 -0
  173. package/dist/pages/{segmented-control-CTbIpRBW.js → segmented-control-D-FB1K1T.js} +450 -37
  174. package/dist/pages/{select-DguELoRR.js → select-DZ43NpOm.js} +22 -17
  175. package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
  176. package/dist/pages/{separator-CPZub9pv.js → separator-CFwqRvfO.js} +99 -22
  177. package/dist/pages/serp-preview-BGwORjmo.js +346 -0
  178. package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
  179. package/dist/pages/{shape-DKvA0YKr.js → shape-DzniHAVT.js} +10 -10
  180. package/dist/pages/share-list-D4wgBxKN.js +926 -0
  181. package/dist/pages/side-panel-CCtkrZjs.js +811 -0
  182. package/dist/pages/site-preview-Dj1hM2Yo.js +353 -0
  183. package/dist/pages/skeleton-C1F5HkAu.js +1325 -0
  184. package/dist/pages/skip-link-BxznhSkz.js +252 -0
  185. package/dist/pages/slider-CAoPURKD.js +774 -0
  186. package/dist/pages/sortable-card-Sr44uCpI.js +424 -0
  187. package/dist/pages/sortable-list-DUAleYE1.js +1298 -0
  188. package/dist/pages/sortable-tree-BLzK-hTE.js +737 -0
  189. package/dist/pages/spacing-box-CtuvzxQu.js +550 -0
  190. package/dist/pages/{sparkline-DMMYGbHn.js → sparkline-D3aavCly.js} +301 -22
  191. package/dist/pages/split-bar-DYgZnFID.js +414 -0
  192. package/dist/pages/split-button-Be08-VI-.js +335 -0
  193. package/dist/pages/split-pane-lSNZgTKt.js +523 -0
  194. package/dist/pages/status-badge-DOdNhmzn.js +1074 -0
  195. package/dist/pages/status-checklist-CWkjCZIC.js +1152 -0
  196. package/dist/pages/status-dot-D99gAGsV.js +567 -0
  197. package/dist/pages/stepper-CxKTbEA-.js +1093 -0
  198. package/dist/pages/success-mark-CqFTOBEu.js +142 -0
  199. package/dist/pages/swatch-H_kNvHuC.js +565 -0
  200. package/dist/pages/{switch-B-Qe4kcT.js → switch-C93K6j9h.js} +151 -51
  201. package/dist/pages/table-CL0vomno.js +3225 -0
  202. package/dist/pages/{tabs-B4M-usCV.js → tabs-Dh0mUsLw.js} +256 -21
  203. package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
  204. package/dist/pages/task-card-Dv0sR1-w.js +295 -0
  205. package/dist/pages/{textarea-fTuUZRQb.js → textarea-CCM-SnGN.js} +271 -15
  206. package/dist/pages/thumbnail-DwFJL_k1.js +1147 -0
  207. package/dist/pages/time-input-CA9-uZAa.js +442 -0
  208. package/dist/pages/time-zone-select-CEtMXVYO.js +296 -0
  209. package/dist/pages/timeline-BsMUTlpR.js +1798 -0
  210. package/dist/pages/{toast-CKP03zjy.js → toast-zXLRiMRT.js} +240 -25
  211. package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
  212. package/dist/pages/toolbar-B9l_fHKy.js +754 -0
  213. package/dist/pages/{tooltip-CBYil3kt.js → tooltip-LHtCUkF-.js} +162 -33
  214. package/dist/pages/translation-field-CTRXiF2N.js +251 -0
  215. package/dist/pages/tree-checklist-CJj3OcLg.js +451 -0
  216. package/dist/pages/tree-select-DU1qXHy_.js +492 -0
  217. package/dist/pages/tree-view-g_RjLtAb.js +739 -0
  218. package/dist/pages/{typography-PCbg8Bhg.js → typography-BSijtiRl.js} +153 -12
  219. package/dist/pages/unit-input-Dml4fjmK.js +659 -0
  220. package/dist/pages/upload-rules-yozEzSah.js +419 -0
  221. package/dist/pages/url-upload-input-SSnMgfpA.js +307 -0
  222. package/dist/pages/value-change-CnubDKyO.js +489 -0
  223. package/dist/pages/weekly-hours-i2EpsmTx.js +287 -0
  224. package/dist/pages/widget-preview-CUJMyZ_k.js +625 -0
  225. package/dist/pages/working-status-CENemSsw.js +389 -0
  226. package/manifest.json +10984 -1108
  227. package/package.json +2 -2
  228. package/dist/pages/card-DUggbis3.js +0 -659
  229. package/dist/pages/checkbox-DwimQaK3.js +0 -365
  230. package/dist/pages/dialog-BRAf4LMh.js +0 -1451
  231. package/dist/pages/empty-state-C-mLrXW2.js +0 -417
  232. package/dist/pages/input-KF9Gkawf.js +0 -1093
  233. package/dist/pages/registry-CroHzK9I.js +0 -244
  234. package/dist/pages/skeleton-DLuBhP46.js +0 -561
  235. package/dist/pages/table-AMoODng4.js +0 -607
@@ -0,0 +1,1117 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { d as Section$1, i as DocPage, m as ThemePair, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
4
+ import { useState } from "react";
5
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
+ import { LineChart, SegmentedControl, dateFormatter } from "@orbitcommerce/constellation";
7
+ //#region src/pages/components/line-chart.tsx
8
+ var DAYS = [
9
+ "2026-09-01",
10
+ "2026-09-02",
11
+ "2026-09-03",
12
+ "2026-09-04",
13
+ "2026-09-05",
14
+ "2026-09-06",
15
+ "2026-09-07",
16
+ "2026-09-08",
17
+ "2026-09-09",
18
+ "2026-09-10"
19
+ ];
20
+ var ONLINE = [
21
+ 24,
22
+ 28,
23
+ 31,
24
+ 27,
25
+ 38,
26
+ 46,
27
+ 35,
28
+ 41,
29
+ 44,
30
+ 39
31
+ ];
32
+ var TRADE = [
33
+ 9,
34
+ 11,
35
+ 8,
36
+ 12,
37
+ 14,
38
+ 18,
39
+ 10,
40
+ 13,
41
+ 15,
42
+ 12
43
+ ];
44
+ var STORE = [
45
+ 6,
46
+ 7,
47
+ 9,
48
+ 6,
49
+ 11,
50
+ 15,
51
+ 12,
52
+ 9,
53
+ 10,
54
+ 13
55
+ ];
56
+ var SALES = DAYS.map((date, i) => ({
57
+ date,
58
+ values: {
59
+ online: ONLINE[i],
60
+ trade: TRADE[i],
61
+ store: STORE[i]
62
+ }
63
+ }));
64
+ var CHANNEL_SERIES = [
65
+ {
66
+ key: "online",
67
+ label: "Online"
68
+ },
69
+ {
70
+ key: "trade",
71
+ label: "Trade"
72
+ },
73
+ {
74
+ key: "store",
75
+ label: "In store"
76
+ }
77
+ ];
78
+ var ORDERS = [
79
+ 39,
80
+ 46,
81
+ 48,
82
+ 45,
83
+ 63,
84
+ 79,
85
+ 57,
86
+ 63,
87
+ 69,
88
+ 64
89
+ ];
90
+ var REVENUE = [
91
+ 1840,
92
+ 2210,
93
+ 1980,
94
+ 2050,
95
+ 2640,
96
+ 3310,
97
+ 2480,
98
+ 2720,
99
+ 2890,
100
+ 2610
101
+ ];
102
+ var DAILY = DAYS.map((date, i) => ({
103
+ date,
104
+ values: {
105
+ orders: ORDERS[i],
106
+ revenue: REVENUE[i]
107
+ }
108
+ }));
109
+ var DELIVERIES_VALUES = [
110
+ 18,
111
+ 22,
112
+ 19,
113
+ null,
114
+ 25,
115
+ 21,
116
+ 24
117
+ ];
118
+ var DELIVERIES = DAYS.slice(0, 7).map((date, i) => ({
119
+ date,
120
+ values: { deliveries: DELIVERIES_VALUES[i] ?? null }
121
+ }));
122
+ var DELIVERY_SERIES = [{
123
+ key: "deliveries",
124
+ label: "Deliveries"
125
+ }];
126
+ var RANGES = [
127
+ {
128
+ label: "Desk chairs",
129
+ values: {
130
+ basket: 312,
131
+ last: 288
132
+ }
133
+ },
134
+ {
135
+ label: "Sit-stand desks",
136
+ values: {
137
+ basket: 486,
138
+ last: 452
139
+ }
140
+ },
141
+ {
142
+ label: "Lighting",
143
+ values: {
144
+ basket: 94,
145
+ last: 102
146
+ }
147
+ },
148
+ {
149
+ label: "Acoustic panels and screens",
150
+ values: {
151
+ basket: 228,
152
+ last: 196
153
+ }
154
+ },
155
+ {
156
+ label: "Storage",
157
+ values: {
158
+ basket: 174,
159
+ last: 181
160
+ }
161
+ },
162
+ {
163
+ label: "Soft seating",
164
+ values: {
165
+ basket: 642,
166
+ last: 590
167
+ }
168
+ }
169
+ ];
170
+ var BASKET_SERIES = [{
171
+ key: "basket",
172
+ label: "This quarter",
173
+ formatValue: (v) => `£${v}`
174
+ }, {
175
+ key: "last",
176
+ label: "Last quarter",
177
+ dash: "dashed",
178
+ color: "var(--o-chart-2)",
179
+ formatValue: (v) => `£${v}`
180
+ }];
181
+ var CHATS = [
182
+ 42,
183
+ 51,
184
+ 47,
185
+ 58,
186
+ 63,
187
+ 39,
188
+ 34,
189
+ 49,
190
+ 55,
191
+ 61
192
+ ];
193
+ var TICKETS = [
194
+ 12,
195
+ 15,
196
+ 11,
197
+ 18,
198
+ 21,
199
+ 9,
200
+ 8,
201
+ 14,
202
+ 16,
203
+ 19
204
+ ];
205
+ var RESOLVED = [
206
+ 38,
207
+ 44,
208
+ 45,
209
+ 50,
210
+ 57,
211
+ 37,
212
+ 33,
213
+ 43,
214
+ 51,
215
+ 55
216
+ ];
217
+ var VOLUME = DAYS.map((date, i) => ({
218
+ date,
219
+ values: {
220
+ chats: CHATS[i],
221
+ tickets: TICKETS[i],
222
+ resolved: RESOLVED[i]
223
+ }
224
+ }));
225
+ var VOLUME_SERIES = [
226
+ {
227
+ key: "chats",
228
+ label: "Conversations"
229
+ },
230
+ {
231
+ key: "tickets",
232
+ label: "Tickets",
233
+ dash: "dashed"
234
+ },
235
+ {
236
+ key: "resolved",
237
+ label: "Resolved",
238
+ dash: "dotted"
239
+ }
240
+ ];
241
+ var MONTHS = [
242
+ "2026-04-01",
243
+ "2026-05-01",
244
+ "2026-06-01",
245
+ "2026-07-01",
246
+ "2026-08-01",
247
+ "2026-09-01"
248
+ ];
249
+ var SUBS = [
250
+ 4200,
251
+ 4380,
252
+ 4610,
253
+ 4720,
254
+ 4980,
255
+ 5240
256
+ ];
257
+ var PLUGINS = [
258
+ 1180,
259
+ 1320,
260
+ 1240,
261
+ 1460,
262
+ 1390,
263
+ 1610
264
+ ];
265
+ var THEMES = [
266
+ 640,
267
+ 520,
268
+ 710,
269
+ 590,
270
+ 680,
271
+ 760
272
+ ];
273
+ var REVENUE_MIX = MONTHS.map((date, i) => ({
274
+ date,
275
+ values: {
276
+ subs: SUBS[i],
277
+ plugins: PLUGINS[i],
278
+ themes: THEMES[i]
279
+ }
280
+ }));
281
+ var REVENUE_SERIES = [
282
+ {
283
+ key: "subs",
284
+ label: "Subscriptions"
285
+ },
286
+ {
287
+ key: "plugins",
288
+ label: "Plugin sales"
289
+ },
290
+ {
291
+ key: "themes",
292
+ label: "Theme sales"
293
+ }
294
+ ];
295
+ var monthFormat = dateFormatter("en-GB", { month: "short" });
296
+ var monthLongFormat = dateFormatter("en-GB", {
297
+ month: "long",
298
+ year: "numeric"
299
+ });
300
+ var CPU = [
301
+ 18,
302
+ 22,
303
+ 31,
304
+ 46,
305
+ 52,
306
+ 63,
307
+ 58,
308
+ 41,
309
+ 37,
310
+ 44,
311
+ 49,
312
+ 35
313
+ ].map((cpu, i) => ({
314
+ date: new Date(2026, 8, 3, 8 + Math.floor(i / 2), i % 2 * 30),
315
+ values: {
316
+ cpu,
317
+ memory: [
318
+ 54,
319
+ 55,
320
+ 57,
321
+ 61,
322
+ 63,
323
+ 66,
324
+ 65,
325
+ 62,
326
+ 60,
327
+ 61,
328
+ 63,
329
+ 60
330
+ ][i]
331
+ }
332
+ }));
333
+ var CPU_SERIES = [{
334
+ key: "cpu",
335
+ label: "CPU",
336
+ formatValue: (v) => `${v}%`
337
+ }, {
338
+ key: "memory",
339
+ label: "Memory",
340
+ dash: "dashed",
341
+ formatValue: (v) => `${v}%`
342
+ }];
343
+ var timeFormat = dateFormatter("en-GB", {
344
+ hour: "2-digit",
345
+ minute: "2-digit"
346
+ });
347
+ var dayTimeFormat = dateFormatter("en-GB", {
348
+ weekday: "short",
349
+ day: "numeric",
350
+ month: "short",
351
+ hour: "2-digit",
352
+ minute: "2-digit"
353
+ });
354
+ var countCompact = new Intl.NumberFormat("en-GB", {
355
+ notation: "compact",
356
+ maximumFractionDigits: 1
357
+ });
358
+ var gbp = new Intl.NumberFormat("en-GB", {
359
+ style: "currency",
360
+ currency: "GBP"
361
+ });
362
+ var gbpCompact = new Intl.NumberFormat("en-GB", {
363
+ style: "currency",
364
+ currency: "GBP",
365
+ notation: "compact",
366
+ maximumFractionDigits: 1
367
+ });
368
+ var formatCountTick = (v) => countCompact.format(v);
369
+ var formatGbp = (v) => gbp.format(v);
370
+ var formatGbpTick = (v) => gbpCompact.format(v);
371
+ function Preview() {
372
+ return /* @__PURE__ */ jsx("div", {
373
+ className: "line-chart-preview",
374
+ children: /* @__PURE__ */ jsx(LineChart, {
375
+ data: SALES.slice(0, 8),
376
+ series: CHANNEL_SERIES,
377
+ height: 132
378
+ })
379
+ });
380
+ }
381
+ function StatesDemo() {
382
+ const [state, setState] = useState("data");
383
+ return /* @__PURE__ */ jsxs("div", {
384
+ className: "line-chart-demo",
385
+ children: [/* @__PURE__ */ jsx("div", {
386
+ className: "line-chart-demo__controls",
387
+ children: /* @__PURE__ */ jsx(SegmentedControl, {
388
+ "aria-label": "Chart state",
389
+ size: "sm",
390
+ value: state,
391
+ onValueChange: setState,
392
+ options: [
393
+ {
394
+ value: "data",
395
+ label: "With data"
396
+ },
397
+ {
398
+ value: "loading",
399
+ label: "Loading"
400
+ },
401
+ {
402
+ value: "empty",
403
+ label: "Empty"
404
+ }
405
+ ]
406
+ })
407
+ }), /* @__PURE__ */ jsx(LineChart, {
408
+ data: state === "data" ? SALES : [],
409
+ series: CHANNEL_SERIES,
410
+ loading: state === "loading",
411
+ emptyMessage: "No sales in this period yet"
412
+ })]
413
+ });
414
+ }
415
+ function Page() {
416
+ return /* @__PURE__ */ jsxs(DocPage, {
417
+ title: "Line chart",
418
+ status: "new",
419
+ importNames: ["LineChart"],
420
+ lead: "One or several series over dates as lines or filled areas, each scaled against the left axis or, when a series asks for it, a right axis of its own. Reach for it to show how figures move together over time, an orders line beside a money line, or several channels compared across a period.",
421
+ children: [
422
+ /* @__PURE__ */ jsx(Section$1, {
423
+ id: "basics",
424
+ title: "Basics",
425
+ description: /* @__PURE__ */ jsxs("p", { children: [
426
+ "Give it one point per date, oldest first, with dates as ",
427
+ /* @__PURE__ */ jsx("code", { children: "YYYY-MM-DD" }),
428
+ " strings (read as local dates) or ",
429
+ /* @__PURE__ */ jsx("code", { children: "Date" }),
430
+ " objects, and a series for each line. Hover or tap the plot, or tab to it and use the arrow keys, to read every series at a date: the readout opens beside the crosshair, centred on the points it reads."
431
+ ] }),
432
+ children: /* @__PURE__ */ jsx(Example, {
433
+ clientOnly: true,
434
+ align: "fill",
435
+ code: `
436
+ const days = ['2026-09-01', '2026-09-02', '2026-09-03' /* ... */]
437
+
438
+ <LineChart
439
+ data={days.map((date, i) => ({
440
+ date,
441
+ values: { online: online[i]!, trade: trade[i]!, store: store[i]! },
442
+ }))}
443
+ series={[
444
+ { key: 'online', label: 'Online' },
445
+ { key: 'trade', label: 'Trade' },
446
+ { key: 'store', label: 'In store' },
447
+ ]}
448
+ />`,
449
+ children: /* @__PURE__ */ jsx(LineChart, {
450
+ data: SALES,
451
+ series: CHANNEL_SERIES
452
+ })
453
+ })
454
+ }),
455
+ /* @__PURE__ */ jsxs(Section$1, {
456
+ id: "variants",
457
+ title: "Variants",
458
+ description: /* @__PURE__ */ jsxs("p", { children: [
459
+ "A series is a line by default. Set ",
460
+ /* @__PURE__ */ jsx("code", { children: "variant=\"area\"" }),
461
+ " on the chart to fill every series, or on one series to fill only it. Fill one or two series; past three, the fills hide each other. A series can also be ",
462
+ /* @__PURE__ */ jsx("code", { children: "dashed" }),
463
+ ", for a plan or a comparison beside the real figures."
464
+ ] }),
465
+ children: [/* @__PURE__ */ jsx(SubSection, {
466
+ title: "Area",
467
+ description: /* @__PURE__ */ jsx("p", { children: "The fill is the series' colour at 18% under the line, fading to nothing at the axis, so areas that overlap stay clean." }),
468
+ children: /* @__PURE__ */ jsx(Example, {
469
+ clientOnly: true,
470
+ align: "fill",
471
+ code: `
472
+ <LineChart data={sales} series={channels} variant="area" />`,
473
+ children: /* @__PURE__ */ jsx(LineChart, {
474
+ data: SALES,
475
+ series: CHANNEL_SERIES,
476
+ variant: "area"
477
+ })
478
+ })
479
+ }), /* @__PURE__ */ jsx(SubSection, {
480
+ title: "A dashed series",
481
+ description: /* @__PURE__ */ jsxs("p", { children: [
482
+ "Mark one series ",
483
+ /* @__PURE__ */ jsx("code", { children: "dashed" }),
484
+ " so it reads as secondary, for a target, a plan or last period's line. The dash keeps its length at any width, and the legend and the readout key the series dashed too."
485
+ ] }),
486
+ children: /* @__PURE__ */ jsx(Example, {
487
+ clientOnly: true,
488
+ align: "fill",
489
+ code: `
490
+ <LineChart
491
+ data={sales}
492
+ series={[
493
+ { key: 'online', label: 'Online' },
494
+ { key: 'trade', label: 'Trade', dashed: true },
495
+ ]}
496
+ />`,
497
+ children: /* @__PURE__ */ jsx(LineChart, {
498
+ data: SALES,
499
+ series: [{
500
+ key: "online",
501
+ label: "Online"
502
+ }, {
503
+ key: "trade",
504
+ label: "Trade",
505
+ dashed: true
506
+ }]
507
+ })
508
+ })
509
+ })]
510
+ }),
511
+ /* @__PURE__ */ jsx(Section$1, {
512
+ id: "second-axis",
513
+ title: "A second axis",
514
+ description: /* @__PURE__ */ jsxs("p", { children: [
515
+ "Give a series ",
516
+ /* @__PURE__ */ jsx("code", { children: "axis=\"right\"" }),
517
+ " when its unit differs from the rest, and the chart draws a right axis whose labels share the left axis' gridlines. Money and a count can then share one chart: the orders line is scaled to the left axis and the revenue line to the right, each named in the legend and the readout. A series may carry its own ",
518
+ /* @__PURE__ */ jsx("code", { children: "formatValue" }),
519
+ " (money, here) over the chart's."
520
+ ] }),
521
+ children: /* @__PURE__ */ jsx(Example, {
522
+ clientOnly: true,
523
+ align: "fill",
524
+ code: `
525
+ const gbp = new Intl.NumberFormat('en-GB', { style: 'currency', currency: 'GBP' })
526
+ const gbpCompact = new Intl.NumberFormat('en-GB', {
527
+ style: 'currency', currency: 'GBP', notation: 'compact', maximumFractionDigits: 1,
528
+ })
529
+ const compact = new Intl.NumberFormat('en-GB', { notation: 'compact', maximumFractionDigits: 1 })
530
+
531
+ <LineChart
532
+ data={daily} // { date, values: { orders, revenue } }
533
+ series={[
534
+ { key: 'orders', label: 'Orders' },
535
+ { key: 'revenue', label: 'Revenue', axis: 'right', formatValue: (v) => gbp.format(v) },
536
+ ]}
537
+ formatTick={(v) => compact.format(v)}
538
+ formatRightTick={(v) => gbpCompact.format(v)}
539
+ />`,
540
+ children: /* @__PURE__ */ jsx(LineChart, {
541
+ data: DAILY,
542
+ series: [{
543
+ key: "orders",
544
+ label: "Orders"
545
+ }, {
546
+ key: "revenue",
547
+ label: "Revenue",
548
+ axis: "right",
549
+ formatValue: formatGbp
550
+ }],
551
+ formatTick: formatCountTick,
552
+ formatRightTick: formatGbpTick
553
+ })
554
+ })
555
+ }),
556
+ /* @__PURE__ */ jsx(Section$1, {
557
+ id: "gaps",
558
+ title: "Gaps in the data",
559
+ description: /* @__PURE__ */ jsxs("p", { children: [
560
+ "A ",
561
+ /* @__PURE__ */ jsx("code", { children: "null" }),
562
+ " value breaks the line: no point is drawn and the path restarts after the gap, so the chart never draws a line across a day it does not know, and the readout says \"No data\" there. Use it for a day with no data rather than a zero, which would read as a real fall to nothing. A day with a gap on both sides, or a chart of one date, is drawn as a dot."
563
+ ] }),
564
+ children: /* @__PURE__ */ jsx(Example, {
565
+ clientOnly: true,
566
+ align: "fill",
567
+ code: `
568
+ <LineChart
569
+ data={[
570
+ { date: '2026-09-01', values: { deliveries: 18 } },
571
+ { date: '2026-09-02', values: { deliveries: 22 } },
572
+ { date: '2026-09-03', values: { deliveries: 19 } },
573
+ { date: '2026-09-04', values: { deliveries: null } }, // a break, nothing drawn across it
574
+ { date: '2026-09-05', values: { deliveries: 25 } },
575
+ /* ... */
576
+ ]}
577
+ series={[{ key: 'deliveries', label: 'Deliveries' }]}
578
+ />`,
579
+ children: /* @__PURE__ */ jsx(LineChart, {
580
+ data: DELIVERIES,
581
+ series: DELIVERY_SERIES
582
+ })
583
+ })
584
+ }),
585
+ /* @__PURE__ */ jsx(Section$1, {
586
+ id: "categories",
587
+ title: "Names in place of dates",
588
+ description: /* @__PURE__ */ jsxs("p", { children: [
589
+ "A line can run over categories as well as days: give each point a ",
590
+ /* @__PURE__ */ jsx("code", { children: "label" }),
591
+ " in place of a",
592
+ " ",
593
+ /* @__PURE__ */ jsx("code", { children: "date" }),
594
+ " (",
595
+ /* @__PURE__ */ jsx("code", { children: "LineChartCategoryDatum" }),
596
+ "), in the order to read them. The names sit under the plot, cut at 14 characters and thinned when they crowd, and the readout and the table keep each whole. The generated words say \"category\" rather than \"date\"."
597
+ ] }),
598
+ children: /* @__PURE__ */ jsx(Example, {
599
+ clientOnly: true,
600
+ align: "fill",
601
+ code: `
602
+ <LineChart
603
+ data={[
604
+ { label: 'Desk chairs', values: { basket: 312, last: 288 } },
605
+ { label: 'Sit-stand desks', values: { basket: 486, last: 452 } },
606
+ /* ... */
607
+ ]}
608
+ series={[
609
+ { key: 'basket', label: 'This quarter' },
610
+ { key: 'last', label: 'Last quarter', dash: 'dashed', color: 'var(--o-chart-2)' },
611
+ ]}
612
+ />`,
613
+ children: /* @__PURE__ */ jsx(LineChart, {
614
+ data: RANGES,
615
+ series: BASKET_SERIES,
616
+ formatTick: (v) => `£${v}`,
617
+ height: 220
618
+ })
619
+ })
620
+ }),
621
+ /* @__PURE__ */ jsx(Section$1, {
622
+ id: "dashes",
623
+ title: "Dash patterns",
624
+ description: /* @__PURE__ */ jsxs("p", { children: [
625
+ /* @__PURE__ */ jsx("code", { children: "dash" }),
626
+ " draws a series ",
627
+ /* @__PURE__ */ jsx("code", { children: "solid" }),
628
+ ", ",
629
+ /* @__PURE__ */ jsx("code", { children: "dashed" }),
630
+ " or ",
631
+ /* @__PURE__ */ jsx("code", { children: "dotted" }),
632
+ ". Give each line of a busy chart its own as well as its own colour, so the lines part even where the colours sit close, for anyone who does not see them apart. The legend and the readout key each line the way it is drawn."
633
+ ] }),
634
+ children: /* @__PURE__ */ jsx(Example, {
635
+ clientOnly: true,
636
+ align: "fill",
637
+ code: `
638
+ <LineChart
639
+ data={volumeByDay}
640
+ series={[
641
+ { key: 'chats', label: 'Conversations' },
642
+ { key: 'tickets', label: 'Tickets', dash: 'dashed' },
643
+ { key: 'resolved', label: 'Resolved', dash: 'dotted' },
644
+ ]}
645
+ wholeTicks
646
+ />`,
647
+ children: /* @__PURE__ */ jsx(LineChart, {
648
+ data: VOLUME,
649
+ series: VOLUME_SERIES,
650
+ wholeTicks: true,
651
+ height: 220
652
+ })
653
+ })
654
+ }),
655
+ /* @__PURE__ */ jsx(Section$1, {
656
+ id: "stacked",
657
+ title: "Stacked bands",
658
+ description: /* @__PURE__ */ jsxs("p", { children: [
659
+ /* @__PURE__ */ jsx("code", { children: "mode=\"stacked\"" }),
660
+ " sets the left axis' series one on another, each a band of its colour over the one before, so the top line is their total and each band's depth is its share. The readout lists each series' own figure and the total, and the hidden table adds a total column. Stack only parts of one whole, in a steady order; a ",
661
+ /* @__PURE__ */ jsx("code", { children: "null" }),
662
+ " counts as nothing in the stack."
663
+ ] }),
664
+ children: /* @__PURE__ */ jsx(Example, {
665
+ clientOnly: true,
666
+ align: "fill",
667
+ code: `
668
+ <LineChart
669
+ data={revenueByMonth}
670
+ series={[
671
+ { key: 'subs', label: 'Subscriptions' },
672
+ { key: 'plugins', label: 'Plugin sales' },
673
+ { key: 'themes', label: 'Theme sales' },
674
+ ]}
675
+ mode="stacked"
676
+ formatValue={formatGbp}
677
+ />`,
678
+ children: /* @__PURE__ */ jsx(LineChart, {
679
+ data: REVENUE_MIX,
680
+ series: REVENUE_SERIES,
681
+ mode: "stacked",
682
+ formatValue: formatGbp,
683
+ formatTick: formatGbpTick,
684
+ formatDate: (d) => monthFormat.format(d),
685
+ formatTooltipDate: (d) => monthLongFormat.format(d),
686
+ height: 240
687
+ })
688
+ })
689
+ }),
690
+ /* @__PURE__ */ jsx(Section$1, {
691
+ id: "fixed-axis",
692
+ title: "A fixed value axis",
693
+ description: /* @__PURE__ */ jsxs("p", { children: [
694
+ "A percentage reads best on its whole range. ",
695
+ /* @__PURE__ */ jsx("code", { children: "min" }),
696
+ " and ",
697
+ /* @__PURE__ */ jsx("code", { children: "max" }),
698
+ " fix the left axis' ends (0 to 100 for a server's CPU and memory), whatever the data, with round gridlines inside them; a value past an end is drawn at it. ",
699
+ /* @__PURE__ */ jsx("code", { children: "wholeTicks" }),
700
+ " keeps a count's axis on whole numbers and",
701
+ " ",
702
+ /* @__PURE__ */ jsx("code", { children: "maxTicks" }),
703
+ " caps its gridlines, as on the bar chart."
704
+ ] }),
705
+ children: /* @__PURE__ */ jsx(Example, {
706
+ clientOnly: true,
707
+ align: "fill",
708
+ code: `
709
+ <LineChart
710
+ data={loadByHalfHour}
711
+ series={[
712
+ { key: 'cpu', label: 'CPU', formatValue: (v) => \`\${v}%\` },
713
+ { key: 'memory', label: 'Memory', dash: 'dashed', formatValue: (v) => \`\${v}%\` },
714
+ ]}
715
+ min={0}
716
+ max={100}
717
+ formatTick={(v) => \`\${v}%\`}
718
+ />`,
719
+ children: /* @__PURE__ */ jsx(LineChart, {
720
+ data: CPU,
721
+ series: CPU_SERIES,
722
+ min: 0,
723
+ max: 100,
724
+ formatTick: (v) => `${v}%`,
725
+ formatDate: (d) => timeFormat.format(d),
726
+ formatTooltipDate: (d) => dayTimeFormat.format(d),
727
+ height: 220
728
+ })
729
+ })
730
+ }),
731
+ /* @__PURE__ */ jsx(Section$1, {
732
+ id: "states",
733
+ title: "Loading and empty",
734
+ description: /* @__PURE__ */ jsxs("p", { children: [
735
+ "With ",
736
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
737
+ " and no data yet, a shimmering placeholder stands where the plot will be. With no data, ",
738
+ /* @__PURE__ */ jsx("code", { children: "emptyMessage" }),
739
+ " sits in the middle. Either way the plot keeps four even gridlines and the axis labels no scale, so nothing jumps when the data lands."
740
+ ] }),
741
+ children: /* @__PURE__ */ jsx(Example, {
742
+ clientOnly: true,
743
+ align: "fill",
744
+ code: `
745
+ <LineChart data={sales} series={series} />
746
+ <LineChart data={[]} series={series} loading />
747
+ <LineChart data={[]} series={series} emptyMessage="No sales in this period yet" />`,
748
+ children: /* @__PURE__ */ jsx(StatesDemo, {})
749
+ })
750
+ }),
751
+ /* @__PURE__ */ jsx(Section$1, {
752
+ id: "themes",
753
+ title: "Both themes",
754
+ description: /* @__PURE__ */ jsx("p", { children: "The lines, the fills, the gridlines and the readout are drawn from the theme's tokens." }),
755
+ children: /* @__PURE__ */ jsx(ThemePair, {
756
+ clientOnly: true,
757
+ align: "fill",
758
+ children: /* @__PURE__ */ jsx(LineChart, {
759
+ data: SALES,
760
+ series: CHANNEL_SERIES,
761
+ height: 200
762
+ })
763
+ })
764
+ }),
765
+ /* @__PURE__ */ jsx(Section$1, {
766
+ id: "accessibility",
767
+ title: "Accessibility",
768
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
769
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
770
+ "The plot is one focusable group, described as a chart, with a summary for its name, generated from the series and dates unless you pass ",
771
+ /* @__PURE__ */ jsx("code", { children: "label" }),
772
+ ". The generated one ends by saying how to read it with the arrow keys."
773
+ ] }),
774
+ "Tab to the plot and it reads the latest date. The left and right arrows step through the dates, Home and End jump to the ends, and Escape hides the readout; the next arrow picks up where it left off. Each step is announced politely.",
775
+ "On a touch screen, a tap reads the date under the finger and the readout follows a drag. It stays when the finger lifts, until a tap anywhere else or a scroll.",
776
+ "A visually hidden table repeats every figure (a column per series, a row per date), and the legend names each series, so the shape and the numbers are both available to assistive technology.",
777
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
778
+ "While ",
779
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
780
+ ", the plot is marked busy. The readout itself is hidden from assistive technology, because the announcement already says what it shows."
781
+ ] }),
782
+ "The focus ring is teal, 2px, and sits 6px outside the plot.",
783
+ "Every movement respects reduced motion: without it, the lines fade in rather than drawing on.",
784
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
785
+ "The words it adds for assistive technology are English by default, and each one can be replaced:",
786
+ " ",
787
+ /* @__PURE__ */ jsx("code", { children: "legendLabel" }),
788
+ ", ",
789
+ /* @__PURE__ */ jsx("code", { children: "dateLabel" }),
790
+ ", ",
791
+ /* @__PURE__ */ jsx("code", { children: "noDataLabel" }),
792
+ ", ",
793
+ /* @__PURE__ */ jsx("code", { children: "keyboardHint" }),
794
+ ",",
795
+ " ",
796
+ /* @__PURE__ */ jsx("code", { children: "roleDescription" }),
797
+ ", and ",
798
+ /* @__PURE__ */ jsx("code", { children: "categoryLabel" }),
799
+ " and ",
800
+ /* @__PURE__ */ jsx("code", { children: "totalLabel" }),
801
+ " when they apply."
802
+ ] }),
803
+ "Under forced colours the lines keep their colours (the chart is SVG), and so do the legend’s and the readout’s keys; the crosshair takes the system text colour."
804
+ ] })
805
+ }),
806
+ /* @__PURE__ */ jsxs(Section$1, {
807
+ id: "guidelines",
808
+ title: "Guidelines",
809
+ children: [/* @__PURE__ */ jsx(DoDont, {
810
+ clientOnly: true,
811
+ do: {
812
+ children: /* @__PURE__ */ jsx("div", {
813
+ className: "line-chart-dodont",
814
+ children: /* @__PURE__ */ jsx(LineChart, {
815
+ data: SALES,
816
+ series: [{
817
+ key: "online",
818
+ label: "Online"
819
+ }, {
820
+ key: "trade",
821
+ label: "Trade"
822
+ }],
823
+ height: 140
824
+ })
825
+ }),
826
+ caption: "Lines for a few series on one axis: each is read against the same gridlines."
827
+ },
828
+ dont: {
829
+ children: /* @__PURE__ */ jsx("div", {
830
+ className: "line-chart-dodont",
831
+ children: /* @__PURE__ */ jsx(LineChart, {
832
+ data: SALES,
833
+ series: CHANNEL_SERIES,
834
+ variant: "area",
835
+ height: 140
836
+ })
837
+ }),
838
+ caption: "Filled areas hide each other once there are several. Keep the fill for one or two series."
839
+ }
840
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
841
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
842
+ "A line chart shows change over time. For a figure across categories with no time, use a",
843
+ " ",
844
+ /* @__PURE__ */ jsx(DocLink, {
845
+ to: "/components/bar-chart",
846
+ children: "Bar chart"
847
+ }),
848
+ ", and for a single quiet trend a",
849
+ " ",
850
+ /* @__PURE__ */ jsx(DocLink, {
851
+ to: "/components/sparkline",
852
+ children: "Sparkline"
853
+ }),
854
+ "."
855
+ ] }),
856
+ "Use a right axis only when the units differ, and name both series in the legend. A second axis can make two lines cross where they never did, so read it as two charts sharing a plot.",
857
+ "Keep to about four series: past that, the legend and the readout become a list, and the lines crowd. Consider one chart per measure instead.",
858
+ "A gap is a null value, not a zero: the line breaks, which is honest about the missing day.",
859
+ "Give it room: 240px (the default) on a page, 200px at the least. The height includes the date labels; the legend sits above."
860
+ ] })]
861
+ }),
862
+ /* @__PURE__ */ jsxs(Section$1, {
863
+ id: "props",
864
+ title: "Props",
865
+ description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native div attribute except children." }),
866
+ children: [
867
+ /* @__PURE__ */ jsx(PropsTable, { rows: [
868
+ {
869
+ name: "data",
870
+ type: "readonly (LineChartDatum | LineChartCategoryDatum)[]",
871
+ required: true,
872
+ description: "One point per date, oldest first; or one per category, in the order to read them."
873
+ },
874
+ {
875
+ name: "series",
876
+ type: "readonly LineChartSeries[]",
877
+ required: true,
878
+ description: "The lines, in order. More than one shows the legend."
879
+ },
880
+ {
881
+ name: "variant",
882
+ type: "'line' | 'area'",
883
+ default: "'line'",
884
+ description: "How every series is drawn unless it names its own."
885
+ },
886
+ {
887
+ name: "mode",
888
+ type: "'overlap' | 'stacked'",
889
+ default: "'overlap'",
890
+ description: "Every series from the axis, or the left axis' series stacked into bands with a total."
891
+ },
892
+ {
893
+ name: "height",
894
+ type: "number",
895
+ default: "240",
896
+ description: "Height in px of the plot and its date labels. The legend sits above."
897
+ },
898
+ {
899
+ name: "min",
900
+ type: "number",
901
+ default: "0",
902
+ description: "Fixes the left axis' lowest value."
903
+ },
904
+ {
905
+ name: "max",
906
+ type: "number",
907
+ description: "Fixes the left axis' highest value (100 for a percentage)."
908
+ },
909
+ {
910
+ name: "wholeTicks",
911
+ type: "boolean",
912
+ default: "false",
913
+ description: "Labels the left axis in whole numbers only."
914
+ },
915
+ {
916
+ name: "maxTicks",
917
+ type: "number",
918
+ description: "At most this many gridlines on the left axis."
919
+ },
920
+ {
921
+ name: "formatValue",
922
+ type: "(value: number) => string",
923
+ default: "grouped number",
924
+ description: "Values in the readout and the hidden table, unless a series gives its own."
925
+ },
926
+ {
927
+ name: "formatTick",
928
+ type: "(value: number) => string",
929
+ default: "compact number",
930
+ description: "The left value axis, e.g. \"2.5k\"."
931
+ },
932
+ {
933
+ name: "formatRightTick",
934
+ type: "(value: number) => string",
935
+ default: "formatTick",
936
+ description: "The right value axis, when a series uses it."
937
+ },
938
+ {
939
+ name: "formatDate",
940
+ type: "(date: Date) => string",
941
+ default: "day and month",
942
+ description: "Dates under the plot, e.g. \"3 Sep\"."
943
+ },
944
+ {
945
+ name: "formatTooltipDate",
946
+ type: "(date: Date) => string",
947
+ default: "weekday, day and month",
948
+ description: "The date heading the readout."
949
+ },
950
+ {
951
+ name: "legend",
952
+ type: "boolean",
953
+ default: "true when more than one series",
954
+ description: "Shows the legend above the chart."
955
+ },
956
+ {
957
+ name: "loading",
958
+ type: "boolean",
959
+ default: "false",
960
+ description: "A shimmering placeholder while the data is on its way."
961
+ },
962
+ {
963
+ name: "emptyMessage",
964
+ type: "ReactNode",
965
+ default: "'Nothing to show for this period yet'",
966
+ description: "Shown in the plot when there is no data."
967
+ },
968
+ {
969
+ name: "label",
970
+ type: "string",
971
+ description: "Names the chart for assistive technology, and captions the hidden table."
972
+ },
973
+ {
974
+ name: "legendLabel",
975
+ type: "string",
976
+ default: "label, or 'Series'",
977
+ description: "Names the legend for assistive technology."
978
+ },
979
+ {
980
+ name: "dateLabel",
981
+ type: "string",
982
+ default: "'Date'",
983
+ description: "Heads the hidden table’s column of dates."
984
+ },
985
+ {
986
+ name: "categoryLabel",
987
+ type: "string",
988
+ default: "'Category'",
989
+ description: "Heads the hidden table’s column of names, when the points are categories."
990
+ },
991
+ {
992
+ name: "totalLabel",
993
+ type: "string",
994
+ default: "'Total'",
995
+ description: "Names the stack’s total in the readout and the table."
996
+ },
997
+ {
998
+ name: "noDataLabel",
999
+ type: "string",
1000
+ default: "'No data'",
1001
+ description: "Stands in the readout, and in what is announced, for a series with no value on a date."
1002
+ },
1003
+ {
1004
+ name: "keyboardHint",
1005
+ type: "string",
1006
+ default: "'Use the arrow keys to read each date.' (or 'each category.')",
1007
+ description: "Ends the summary generated when there is no label."
1008
+ },
1009
+ {
1010
+ name: "roleDescription",
1011
+ type: "string",
1012
+ default: "'chart'",
1013
+ description: "What assistive technology calls the plot after its name."
1014
+ }
1015
+ ] }),
1016
+ /* @__PURE__ */ jsx(PropsTable, {
1017
+ title: "LineChartDatum",
1018
+ rows: [
1019
+ {
1020
+ name: "date",
1021
+ type: "string | Date",
1022
+ required: true,
1023
+ description: "The day or bucket. YYYY-MM-DD strings are read as local dates."
1024
+ },
1025
+ {
1026
+ name: "values",
1027
+ type: "Record<string, number | null>",
1028
+ required: true,
1029
+ description: "One value per series key. A null breaks the line, so nothing is drawn across the gap."
1030
+ },
1031
+ {
1032
+ name: "readoutLabel",
1033
+ type: "string",
1034
+ description: "Heads the readout, is announced and names the table row, when the date alone says too little."
1035
+ }
1036
+ ]
1037
+ }),
1038
+ /* @__PURE__ */ jsx(PropsTable, {
1039
+ title: "LineChartCategoryDatum",
1040
+ rows: [
1041
+ {
1042
+ name: "label",
1043
+ type: "string",
1044
+ required: true,
1045
+ description: "The category’s name: on the axis (cut at 14 characters), the readout and the table."
1046
+ },
1047
+ {
1048
+ name: "values",
1049
+ type: "Record<string, number | null>",
1050
+ required: true,
1051
+ description: "One value per series key."
1052
+ },
1053
+ {
1054
+ name: "readoutLabel",
1055
+ type: "string",
1056
+ description: "Heads the readout when it should say more than the name."
1057
+ }
1058
+ ]
1059
+ }),
1060
+ /* @__PURE__ */ jsx(PropsTable, {
1061
+ title: "LineChartSeries",
1062
+ rows: [
1063
+ {
1064
+ name: "key",
1065
+ type: "string",
1066
+ required: true,
1067
+ description: "The key this series reads from each datum's values."
1068
+ },
1069
+ {
1070
+ name: "label",
1071
+ type: "string",
1072
+ required: true,
1073
+ description: "The name in the legend, the readout and the hidden table."
1074
+ },
1075
+ {
1076
+ name: "color",
1077
+ type: "string",
1078
+ description: "A CSS colour. Defaults to the categorical palette, in order: var(--o-chart-1), var(--o-chart-3) and on."
1079
+ },
1080
+ {
1081
+ name: "axis",
1082
+ type: "'left' | 'right'",
1083
+ default: "'left'",
1084
+ description: "Which value axis the series is scaled against. Any right series draws a right axis."
1085
+ },
1086
+ {
1087
+ name: "variant",
1088
+ type: "'line' | 'area'",
1089
+ description: "Overrides the chart's variant for the one series."
1090
+ },
1091
+ {
1092
+ name: "dashed",
1093
+ type: "boolean",
1094
+ default: "false",
1095
+ description: "Draws the line with a dashed stroke; the same as dash='dashed'."
1096
+ },
1097
+ {
1098
+ name: "dash",
1099
+ type: "'solid' | 'dashed' | 'dotted'",
1100
+ default: "'solid'",
1101
+ description: "How the line is drawn, keyed the same way in the legend and the readout."
1102
+ },
1103
+ {
1104
+ name: "formatValue",
1105
+ type: "(value: number) => string",
1106
+ description: "Overrides the chart's for this series, e.g. money on the right axis."
1107
+ }
1108
+ ]
1109
+ }),
1110
+ /* @__PURE__ */ jsx(Fragment$1, {})
1111
+ ]
1112
+ })
1113
+ ]
1114
+ });
1115
+ }
1116
+ //#endregion
1117
+ export { Page, Preview };