@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,1060 @@
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 { BarChart, SegmentedControl } from "@orbitcommerce/constellation";
7
+ //#region src/pages/components/bar-chart.tsx
8
+ var VIEWS = [
9
+ {
10
+ label: "Mon",
11
+ values: { views: 412 }
12
+ },
13
+ {
14
+ label: "Tue",
15
+ values: { views: 486 }
16
+ },
17
+ {
18
+ label: "Wed",
19
+ values: { views: 531 }
20
+ },
21
+ {
22
+ label: "Thu",
23
+ values: { views: 498 }
24
+ },
25
+ {
26
+ label: "Fri",
27
+ values: { views: 612 }
28
+ },
29
+ {
30
+ label: "Sat",
31
+ values: { views: 743 }
32
+ },
33
+ {
34
+ label: "Sun",
35
+ values: { views: 588 }
36
+ }
37
+ ];
38
+ var VIEWS_SERIES = [{
39
+ key: "views",
40
+ label: "Views"
41
+ }];
42
+ var CHANNELS = [
43
+ {
44
+ label: "Mon",
45
+ values: {
46
+ online: 24,
47
+ trade: 9,
48
+ store: 6
49
+ }
50
+ },
51
+ {
52
+ label: "Tue",
53
+ values: {
54
+ online: 28,
55
+ trade: 11,
56
+ store: 7
57
+ }
58
+ },
59
+ {
60
+ label: "Wed",
61
+ values: {
62
+ online: 31,
63
+ trade: 8,
64
+ store: 9
65
+ }
66
+ },
67
+ {
68
+ label: "Thu",
69
+ values: {
70
+ online: 27,
71
+ trade: 12,
72
+ store: 6
73
+ }
74
+ },
75
+ {
76
+ label: "Fri",
77
+ values: {
78
+ online: 38,
79
+ trade: 14,
80
+ store: 11
81
+ }
82
+ },
83
+ {
84
+ label: "Sat",
85
+ values: {
86
+ online: 46,
87
+ trade: 18,
88
+ store: 15
89
+ }
90
+ },
91
+ {
92
+ label: "Sun",
93
+ values: {
94
+ online: 35,
95
+ trade: 10,
96
+ store: 12
97
+ }
98
+ }
99
+ ];
100
+ var CHANNEL_SERIES = [
101
+ {
102
+ key: "online",
103
+ label: "Online"
104
+ },
105
+ {
106
+ key: "trade",
107
+ label: "Trade"
108
+ },
109
+ {
110
+ key: "store",
111
+ label: "In store"
112
+ }
113
+ ];
114
+ var PRODUCTS = [
115
+ {
116
+ label: "Arden ergonomic chair",
117
+ values: { units: 182 }
118
+ },
119
+ {
120
+ label: "Oslo sit-stand desk",
121
+ values: { units: 149 }
122
+ },
123
+ {
124
+ label: "Lumen desk lamp",
125
+ values: { units: 121 }
126
+ },
127
+ {
128
+ label: "Harbour three-seat sofa",
129
+ values: { units: 74 }
130
+ },
131
+ {
132
+ label: "Fern acoustic panel set",
133
+ values: { units: 58 }
134
+ }
135
+ ];
136
+ var PRODUCTS_SERIES = [{
137
+ key: "units",
138
+ label: "Units sold"
139
+ }];
140
+ var HOURS = [
141
+ 3,
142
+ 5,
143
+ 2,
144
+ 7,
145
+ 4,
146
+ 6,
147
+ 1
148
+ ].map((orders, i) => ({
149
+ label: `${String(12 + i).padStart(2, "0")}:00`,
150
+ readoutLabel: `Wed 3 Sep, ${String(12 + i).padStart(2, "0")}:00`,
151
+ values: { orders }
152
+ }));
153
+ var ORDERS_SERIES = [{
154
+ key: "orders",
155
+ label: "Orders"
156
+ }];
157
+ var RATINGS = [
158
+ {
159
+ label: "1 star",
160
+ values: { chats: 6 }
161
+ },
162
+ {
163
+ label: "2 stars",
164
+ values: { chats: 9 }
165
+ },
166
+ {
167
+ label: "3 stars",
168
+ values: { chats: 21 }
169
+ },
170
+ {
171
+ label: "4 stars",
172
+ values: { chats: 58 }
173
+ },
174
+ {
175
+ label: "5 stars",
176
+ values: { chats: 112 }
177
+ }
178
+ ];
179
+ var RATINGS_SERIES = [{
180
+ key: "chats",
181
+ label: "Rated chats"
182
+ }];
183
+ var BEST_SELLERS = [
184
+ {
185
+ label: "Arden ergonomic chair",
186
+ values: { units: 182 }
187
+ },
188
+ {
189
+ label: "Oslo sit-stand desk",
190
+ values: { units: 149 }
191
+ },
192
+ {
193
+ label: "Lumen desk lamp",
194
+ values: { units: 121 }
195
+ },
196
+ {
197
+ label: "Harbour three-seat sofa",
198
+ values: { units: 74 }
199
+ },
200
+ {
201
+ label: "Fern acoustic panel set",
202
+ values: { units: 58 }
203
+ },
204
+ {
205
+ label: "Wren bar stool",
206
+ values: { units: 47 }
207
+ },
208
+ {
209
+ label: "Pike oak bookshelf",
210
+ values: { units: 39 }
211
+ },
212
+ {
213
+ label: "Tern coat stand",
214
+ values: { units: 22 }
215
+ }
216
+ ];
217
+ var UNITS_SERIES = [{
218
+ key: "units",
219
+ label: "Units sold"
220
+ }];
221
+ var REQUESTS = [
222
+ {
223
+ label: "Mon",
224
+ values: { requests: 1240 }
225
+ },
226
+ {
227
+ label: "Tue",
228
+ values: { requests: 1310 }
229
+ },
230
+ {
231
+ label: "Wed",
232
+ values: { requests: 1188 }
233
+ },
234
+ {
235
+ label: "Thu",
236
+ values: { requests: null }
237
+ },
238
+ {
239
+ label: "Fri",
240
+ values: { requests: 1422 }
241
+ },
242
+ {
243
+ label: "Sat",
244
+ values: { requests: 980 }
245
+ },
246
+ {
247
+ label: "Sun",
248
+ values: { requests: 860 }
249
+ }
250
+ ];
251
+ var REQUESTS_SERIES = [{
252
+ key: "requests",
253
+ label: "Requests"
254
+ }];
255
+ var STOCK = [
256
+ {
257
+ label: "Week 1",
258
+ values: { net: 42 }
259
+ },
260
+ {
261
+ label: "Week 2",
262
+ values: { net: 18 }
263
+ },
264
+ {
265
+ label: "Week 3",
266
+ values: { net: -26 }
267
+ },
268
+ {
269
+ label: "Week 4",
270
+ values: { net: -9 }
271
+ },
272
+ {
273
+ label: "Week 5",
274
+ values: { net: 31 }
275
+ },
276
+ {
277
+ label: "Week 6",
278
+ values: { net: 12 }
279
+ }
280
+ ];
281
+ var STOCK_SERIES = [{
282
+ key: "net",
283
+ label: "Net units"
284
+ }];
285
+ var PREVIEW_DATA = CHANNELS.slice(0, 5);
286
+ function Preview() {
287
+ return /* @__PURE__ */ jsx("div", {
288
+ className: "bar-chart-preview",
289
+ children: /* @__PURE__ */ jsx(BarChart, {
290
+ data: PREVIEW_DATA,
291
+ series: CHANNEL_SERIES,
292
+ height: 132
293
+ })
294
+ });
295
+ }
296
+ function StatesDemo() {
297
+ const [state, setState] = useState("data");
298
+ return /* @__PURE__ */ jsxs("div", {
299
+ className: "bar-chart-demo",
300
+ children: [/* @__PURE__ */ jsx("div", {
301
+ className: "bar-chart-demo__controls",
302
+ children: /* @__PURE__ */ jsx(SegmentedControl, {
303
+ "aria-label": "Chart state",
304
+ size: "sm",
305
+ value: state,
306
+ onValueChange: setState,
307
+ options: [
308
+ {
309
+ value: "data",
310
+ label: "With data"
311
+ },
312
+ {
313
+ value: "stale",
314
+ label: "Stale"
315
+ },
316
+ {
317
+ value: "loading",
318
+ label: "Loading"
319
+ },
320
+ {
321
+ value: "empty",
322
+ label: "Empty"
323
+ }
324
+ ]
325
+ })
326
+ }), /* @__PURE__ */ jsx(BarChart, {
327
+ data: state === "data" || state === "stale" ? VIEWS : [],
328
+ series: VIEWS_SERIES,
329
+ stale: state === "stale",
330
+ loading: state === "loading",
331
+ emptyMessage: "No views in this period yet"
332
+ })]
333
+ });
334
+ }
335
+ function Page() {
336
+ return /* @__PURE__ */ jsxs(DocPage, {
337
+ title: "Bar chart",
338
+ status: "new",
339
+ importNames: ["BarChart"],
340
+ lead: "Bars for one or several series over categories: columns by default or rows to the right, grouped side by side or stacked, with a legend, a readout on each category and a table for assistive technology. Reach for it to compare one figure across a few categories.",
341
+ children: [
342
+ /* @__PURE__ */ jsx(Section$1, {
343
+ id: "basics",
344
+ title: "Basics",
345
+ description: /* @__PURE__ */ jsx("p", { children: "Give it one row per category, in the order you want them read, and a series for each set of bars. The value axis always takes in zero, because a bar is read by its length from it. Hover or tap a band, or tab to the plot and use the arrow keys, to read a category: the readout opens beside it, where there is room, rather than over the bars it reads." }),
346
+ children: /* @__PURE__ */ jsx(Example, {
347
+ clientOnly: true,
348
+ align: "fill",
349
+ code: `
350
+ const week = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
351
+ const views = [412, 486, 531, 498, 612, 743, 588]
352
+
353
+ <BarChart
354
+ data={week.map((label, i) => ({ label, values: { views: views[i]! } }))}
355
+ series={[{ key: 'views', label: 'Views' }]}
356
+ />`,
357
+ children: /* @__PURE__ */ jsx(BarChart, {
358
+ data: VIEWS,
359
+ series: VIEWS_SERIES
360
+ })
361
+ })
362
+ }),
363
+ /* @__PURE__ */ jsxs(Section$1, {
364
+ id: "series",
365
+ title: "Several series",
366
+ description: /* @__PURE__ */ jsxs("p", { children: [
367
+ "Name each series with a ",
368
+ /* @__PURE__ */ jsx("code", { children: "key" }),
369
+ " and a ",
370
+ /* @__PURE__ */ jsx("code", { children: "label" }),
371
+ ": the label is used in the legend, the readout and the hidden table, and each datum's ",
372
+ /* @__PURE__ */ jsx("code", { children: "values" }),
373
+ " map is read by the key. With more than one series the legend shows above the plot; pass ",
374
+ /* @__PURE__ */ jsxs("code", { children: ["legend=", "{false}"] }),
375
+ " to hide it."
376
+ ] }),
377
+ children: [/* @__PURE__ */ jsx(SubSection, {
378
+ title: "Grouped",
379
+ description: /* @__PURE__ */ jsxs("p", { children: [
380
+ "The default, ",
381
+ /* @__PURE__ */ jsx("code", { children: "mode=\"grouped\"" }),
382
+ ": a category's bars sit side by side, each read against the axis on its own."
383
+ ] }),
384
+ children: /* @__PURE__ */ jsx(Example, {
385
+ clientOnly: true,
386
+ align: "fill",
387
+ code: `
388
+ const channels = [
389
+ { key: 'online', label: 'Online' },
390
+ { key: 'trade', label: 'Trade' },
391
+ { key: 'store', label: 'In store' },
392
+ ]
393
+
394
+ <BarChart
395
+ data={week.map((label, i) => ({
396
+ label,
397
+ values: { online: online[i]!, trade: trade[i]!, store: store[i]! },
398
+ }))}
399
+ series={channels}
400
+ />`,
401
+ children: /* @__PURE__ */ jsx(BarChart, {
402
+ data: CHANNELS,
403
+ series: CHANNEL_SERIES
404
+ })
405
+ })
406
+ }), /* @__PURE__ */ jsx(SubSection, {
407
+ title: "Stacked",
408
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "mode=\"stacked\"" }), " sets a category's bars end to end into one bar, square at the axis and round only at its free end; a series with nothing in a category draws no segment there. Use it only when each series is a part of the category's whole, because the segments below the top are hard to compare."] }),
409
+ children: /* @__PURE__ */ jsx(Example, {
410
+ clientOnly: true,
411
+ align: "fill",
412
+ code: `
413
+ <BarChart
414
+ data={ordersByChannel} // { label, values: { online, trade, store } }
415
+ series={channels}
416
+ mode="stacked"
417
+ />`,
418
+ children: /* @__PURE__ */ jsx(BarChart, {
419
+ data: CHANNELS,
420
+ series: CHANNEL_SERIES,
421
+ mode: "stacked"
422
+ })
423
+ })
424
+ })]
425
+ }),
426
+ /* @__PURE__ */ jsx(Section$1, {
427
+ id: "horizontal",
428
+ title: "Horizontal bars",
429
+ description: /* @__PURE__ */ jsxs("p", { children: [
430
+ /* @__PURE__ */ jsx("code", { children: "orientation=\"horizontal\"" }),
431
+ " runs the bars out to the right, for long category names such as product titles. The names take the room they need, up to 40% of the chart or 240px, and a longer one ends in an ellipsis on the axis while the readout shows it in full. A horizontal chart ignores",
432
+ " ",
433
+ /* @__PURE__ */ jsx("code", { children: "height" }),
434
+ " and grows with its rows instead, 32px each."
435
+ ] }),
436
+ children: /* @__PURE__ */ jsx(Example, {
437
+ clientOnly: true,
438
+ align: "fill",
439
+ code: `
440
+ <BarChart
441
+ data={[
442
+ { label: 'Arden ergonomic chair', values: { units: 182 } },
443
+ { label: 'Oslo sit-stand desk', values: { units: 149 } },
444
+ { label: 'Lumen desk lamp', values: { units: 121 } },
445
+ /* ... */
446
+ ]}
447
+ series={[{ key: 'units', label: 'Units sold' }]}
448
+ orientation="horizontal"
449
+ />`,
450
+ children: /* @__PURE__ */ jsx(BarChart, {
451
+ data: PRODUCTS,
452
+ series: PRODUCTS_SERIES,
453
+ orientation: "horizontal"
454
+ })
455
+ })
456
+ }),
457
+ /* @__PURE__ */ jsx(Section$1, {
458
+ id: "readout-heading",
459
+ title: "A fuller readout heading",
460
+ description: /* @__PURE__ */ jsxs("p", { children: [
461
+ "The axis has room for a short label and the readout for a full one. Give a category a",
462
+ " ",
463
+ /* @__PURE__ */ jsx("code", { children: "readoutLabel" }),
464
+ " and it heads the readout, is what is announced and names the row of the hidden table, while ",
465
+ /* @__PURE__ */ jsx("code", { children: "label" }),
466
+ " stays on the axis: \"14:00\" under the bar, \"Wed 3 Sep, 14:00\" when it is read."
467
+ ] }),
468
+ children: /* @__PURE__ */ jsx(Example, {
469
+ clientOnly: true,
470
+ align: "fill",
471
+ code: `
472
+ <BarChart
473
+ data={hours.map((h) => ({
474
+ label: formatHour(h.start), // "14:00"
475
+ readoutLabel: formatDayHour(h.start), // "Wed 3 Sep, 14:00"
476
+ values: { orders: h.orders },
477
+ }))}
478
+ series={[{ key: 'orders', label: 'Orders' }]}
479
+ wholeTicks
480
+ />`,
481
+ children: /* @__PURE__ */ jsx(BarChart, {
482
+ data: HOURS,
483
+ series: ORDERS_SERIES,
484
+ wholeTicks: true,
485
+ height: 200
486
+ })
487
+ })
488
+ }),
489
+ /* @__PURE__ */ jsx(Section$1, {
490
+ id: "whole-ticks",
491
+ title: "Counts in whole numbers",
492
+ description: /* @__PURE__ */ jsxs("p", { children: [
493
+ "A count is never 2.5 orders. ",
494
+ /* @__PURE__ */ jsx("code", { children: "wholeTicks" }),
495
+ " keeps every gridline on a whole number, so seven orders read 0, 5, 10 rather than 0, 2.5, 5, 7.5, and ",
496
+ /* @__PURE__ */ jsx("code", { children: "maxTicks" }),
497
+ " caps how many gridlines there are (zero included) on a small chart, the step growing until they fit."
498
+ ] }),
499
+ children: /* @__PURE__ */ jsx(Example, {
500
+ clientOnly: true,
501
+ align: "fill",
502
+ code: `
503
+ <BarChart data={hours} series={series} />
504
+ <BarChart data={hours} series={series} wholeTicks />
505
+ <BarChart data={views} series={series} maxTicks={3} />`,
506
+ children: /* @__PURE__ */ jsxs("div", {
507
+ className: "bar-chart-trio",
508
+ children: [
509
+ /* @__PURE__ */ jsxs("figure", {
510
+ className: "bar-chart-figure",
511
+ children: [/* @__PURE__ */ jsx(BarChart, {
512
+ data: HOURS,
513
+ series: ORDERS_SERIES,
514
+ height: 140
515
+ }), /* @__PURE__ */ jsx("figcaption", { children: "Default steps" })]
516
+ }),
517
+ /* @__PURE__ */ jsxs("figure", {
518
+ className: "bar-chart-figure",
519
+ children: [/* @__PURE__ */ jsx(BarChart, {
520
+ data: HOURS,
521
+ series: ORDERS_SERIES,
522
+ height: 140,
523
+ wholeTicks: true
524
+ }), /* @__PURE__ */ jsx("figcaption", { children: "wholeTicks" })]
525
+ }),
526
+ /* @__PURE__ */ jsxs("figure", {
527
+ className: "bar-chart-figure",
528
+ children: [/* @__PURE__ */ jsx(BarChart, {
529
+ data: VIEWS,
530
+ series: VIEWS_SERIES,
531
+ height: 140,
532
+ maxTicks: 3
533
+ }), /* @__PURE__ */ jsx("figcaption", { children: "maxTicks of 3" })]
534
+ })
535
+ ]
536
+ })
537
+ })
538
+ }),
539
+ /* @__PURE__ */ jsx(Section$1, {
540
+ id: "ramp",
541
+ title: "A ramp across ordered buckets",
542
+ description: /* @__PURE__ */ jsxs("p", { children: [
543
+ "Some categories are steps of one thing, in an order that means something: a rating from one star to five.",
544
+ " ",
545
+ /* @__PURE__ */ jsx("code", { children: "colorBy=\"ramp\"" }),
546
+ " gives each category the next step of the sequential ramp, least to most, rather than a colour of its own, so the bars read as one scale. In dark the ramp flips, so the most is still the step furthest from the surface. The axis says what each bar is, so one series needs no legend; with one, a series' key is the ramp it is drawn in."
547
+ ] }),
548
+ children: /* @__PURE__ */ jsx(ThemePair, {
549
+ clientOnly: true,
550
+ align: "fill",
551
+ children: /* @__PURE__ */ jsx(BarChart, {
552
+ data: RATINGS,
553
+ series: RATINGS_SERIES,
554
+ colorBy: "ramp",
555
+ wholeTicks: true,
556
+ height: 180
557
+ })
558
+ })
559
+ }),
560
+ /* @__PURE__ */ jsx(Section$1, {
561
+ id: "tilted",
562
+ title: "Long names on many columns",
563
+ description: /* @__PURE__ */ jsxs("p", { children: [
564
+ "Columns are thin and names are long. ",
565
+ /* @__PURE__ */ jsx("code", { children: "tiltLabelsAfter" }),
566
+ " tilts the category labels once there are more columns than it, and labels every one, cut at 14 characters, each ending under its column. They tilt 30 degrees, steeper as the columns narrow so neighbours never touch, and the chart makes room at its start for the first name rather than cut it. Only columns narrower than a line of type (11px), where even upright names would touch, drop every other label. The readout and the table keep the whole name. For a handful of long names, a horizontal chart reads better still."
567
+ ] }),
568
+ children: /* @__PURE__ */ jsx(Example, {
569
+ clientOnly: true,
570
+ align: "fill",
571
+ code: `
572
+ <BarChart
573
+ data={bestSellers} // eight products
574
+ series={[{ key: 'units', label: 'Units sold' }]}
575
+ tiltLabelsAfter={5}
576
+ />`,
577
+ children: /* @__PURE__ */ jsx(BarChart, {
578
+ data: BEST_SELLERS,
579
+ series: UNITS_SERIES,
580
+ tiltLabelsAfter: 5,
581
+ height: 200
582
+ })
583
+ })
584
+ }),
585
+ /* @__PURE__ */ jsxs(Section$1, {
586
+ id: "peak",
587
+ title: "The peak's value",
588
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "peakLabel" }), " writes the highest bar's value over it (or a stack's total), so the one figure most people want reads without a hover. It steps aside while the readout is open, and the chart keeps a line of room over the plot for it; on a horizontal chart, room past the bars as wide as the figure."] }),
589
+ children: [/* @__PURE__ */ jsx(Example, {
590
+ clientOnly: true,
591
+ align: "fill",
592
+ code: `<BarChart data={views} series={series} peakLabel />`,
593
+ children: /* @__PURE__ */ jsx(BarChart, {
594
+ data: VIEWS,
595
+ series: VIEWS_SERIES,
596
+ peakLabel: true,
597
+ height: 200
598
+ })
599
+ }), /* @__PURE__ */ jsx(Example, {
600
+ clientOnly: true,
601
+ align: "fill",
602
+ code: `<BarChart data={takingsByProduct} series={series} orientation="horizontal" peakLabel formatValue={formatGbp} />`,
603
+ children: /* @__PURE__ */ jsx(BarChart, {
604
+ data: PRODUCTS.map((p) => ({
605
+ ...p,
606
+ values: { units: (p.values.units ?? 0) * 6.6 }
607
+ })),
608
+ series: [{
609
+ key: "units",
610
+ label: "Takings"
611
+ }],
612
+ orientation: "horizontal",
613
+ peakLabel: true,
614
+ formatValue: (v) => new Intl.NumberFormat("en-GB", {
615
+ style: "currency",
616
+ currency: "GBP"
617
+ }).format(v),
618
+ formatTick: (v) => new Intl.NumberFormat("en-GB", {
619
+ style: "currency",
620
+ currency: "GBP",
621
+ notation: "compact"
622
+ }).format(v)
623
+ })
624
+ })]
625
+ }),
626
+ /* @__PURE__ */ jsx(Section$1, {
627
+ id: "missing",
628
+ title: "A value nobody measured",
629
+ description: /* @__PURE__ */ jsxs("p", { children: [
630
+ "A day the meter missed is not a quiet day. With ",
631
+ /* @__PURE__ */ jsx("code", { children: "missing=\"stub\"" }),
632
+ ", a ",
633
+ /* @__PURE__ */ jsx("code", { children: "null" }),
634
+ " (or a key the category lacks) is drawn as a short mark on the axis and read as \"Not measured\" in the readout, the announcement and the table. By default a null is drawn as nothing and read as 0, as it always was; choose the stub wherever no data and zero mean different things."
635
+ ] }),
636
+ children: /* @__PURE__ */ jsx(Example, {
637
+ clientOnly: true,
638
+ align: "fill",
639
+ code: `
640
+ <BarChart
641
+ data={[
642
+ { label: 'Wed', values: { requests: 1188 } },
643
+ { label: 'Thu', values: { requests: null } }, // the meter missed it
644
+ { label: 'Fri', values: { requests: 1422 } },
645
+ ]}
646
+ series={[{ key: 'requests', label: 'Requests' }]}
647
+ missing="stub"
648
+ />`,
649
+ children: /* @__PURE__ */ jsx(BarChart, {
650
+ data: REQUESTS,
651
+ series: REQUESTS_SERIES,
652
+ missing: "stub",
653
+ height: 180
654
+ })
655
+ })
656
+ }),
657
+ /* @__PURE__ */ jsx(Section$1, {
658
+ id: "below-zero",
659
+ title: "Below zero",
660
+ description: /* @__PURE__ */ jsx("p", { children: "A value below zero is a bar down from a zero line, and the value axis spans the lowest value to the highest on round steps, with zero always a gridline. Each side is square at the line and round at its free end. In a stack, the parts below zero stack down from the line and the rest up." }),
661
+ children: /* @__PURE__ */ jsx(Example, {
662
+ clientOnly: true,
663
+ align: "fill",
664
+ code: `
665
+ <BarChart
666
+ data={weeks} // { label: 'Week 3', values: { net: -26 } }
667
+ series={[{ key: 'net', label: 'Net units' }]}
668
+ />`,
669
+ children: /* @__PURE__ */ jsx(BarChart, {
670
+ data: STOCK,
671
+ series: STOCK_SERIES,
672
+ height: 200
673
+ })
674
+ })
675
+ }),
676
+ /* @__PURE__ */ jsx(Section$1, {
677
+ id: "table-toggle",
678
+ title: "Show as table",
679
+ description: /* @__PURE__ */ jsxs("p", { children: [
680
+ /* @__PURE__ */ jsx("code", { children: "tableToggle" }),
681
+ " puts a \"Show as table\" button at the end of the chart's head, which swaps the plot for a real table of the same figures (the kit's Table, scrolling sideways on a phone) and back. It is for anyone who would rather read the numbers; the hidden table a screen reader reads is always there, and stands down while the visible one shows, so nothing is read twice. Focus stays on the button. Hold the view yourself with ",
682
+ /* @__PURE__ */ jsx("code", { children: "view" }),
683
+ " and ",
684
+ /* @__PURE__ */ jsx("code", { children: "onViewChange" }),
685
+ "."
686
+ ] }),
687
+ children: /* @__PURE__ */ jsx(Example, {
688
+ clientOnly: true,
689
+ align: "fill",
690
+ code: `<BarChart data={ordersByChannel} series={channels} label="Orders by channel" tableToggle />`,
691
+ children: /* @__PURE__ */ jsx(BarChart, {
692
+ data: CHANNELS,
693
+ series: CHANNEL_SERIES,
694
+ label: "Orders by channel",
695
+ tableToggle: true,
696
+ height: 200
697
+ })
698
+ })
699
+ }),
700
+ /* @__PURE__ */ jsx(Section$1, {
701
+ id: "states",
702
+ title: "Loading and empty",
703
+ description: /* @__PURE__ */ jsxs("p", { children: [
704
+ "With ",
705
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
706
+ " and no data yet, a shimmering placeholder stands where the bars will be. With no data, ",
707
+ /* @__PURE__ */ jsx("code", { children: "emptyMessage" }),
708
+ " sits in the middle of the plot. Either way the gridlines stay and the axis labels no scale, so nothing jumps when the data lands. With data already drawn, ",
709
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
710
+ " dims the plot and holds it until the new data lands; ",
711
+ /* @__PURE__ */ jsx("code", { children: "stale" }),
712
+ " dims figures you show as a stand-in (the last range's, while the next loads) and keeps them readable, and says after the chart's name and in its tables' captions that they are earlier figures (",
713
+ /* @__PURE__ */ jsx("code", { children: "labels.stale" }),
714
+ ")."
715
+ ] }),
716
+ children: /* @__PURE__ */ jsx(Example, {
717
+ clientOnly: true,
718
+ align: "fill",
719
+ code: `
720
+ <BarChart data={views} series={series} />
721
+ <BarChart data={[]} series={series} loading />
722
+ <BarChart data={[]} series={series} emptyMessage="No views in this period yet" />
723
+ <BarChart data={lastRange} series={series} stale />`,
724
+ children: /* @__PURE__ */ jsx(StatesDemo, {})
725
+ })
726
+ }),
727
+ /* @__PURE__ */ jsx(Section$1, {
728
+ id: "themes",
729
+ title: "Both themes",
730
+ description: /* @__PURE__ */ jsx("p", { children: "The bars, the gridlines and the readout are drawn from the theme's tokens, so both read the same." }),
731
+ children: /* @__PURE__ */ jsx(ThemePair, {
732
+ clientOnly: true,
733
+ align: "fill",
734
+ children: /* @__PURE__ */ jsx(BarChart, {
735
+ data: CHANNELS,
736
+ series: CHANNEL_SERIES,
737
+ height: 200
738
+ })
739
+ })
740
+ }),
741
+ /* @__PURE__ */ jsx(Section$1, {
742
+ id: "accessibility",
743
+ title: "Accessibility",
744
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
745
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
746
+ "The plot is one focusable group, described as a chart, with a summary for its name, generated from the data unless you pass ",
747
+ /* @__PURE__ */ jsx("code", { children: "label" }),
748
+ ". The generated one ends by saying how to read it with the arrow keys."
749
+ ] }),
750
+ "Tab to the plot and it reads the first category. The arrow keys step through the categories, 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.",
751
+ "On a touch screen, a tap reads the band under the finger and the readout follows a drag. It stays when the finger lifts, until a tap anywhere else.",
752
+ "A visually hidden table repeats every figure (a column per series, a row per category), so the numbers are available to assistive technology, and the legend names each series.",
753
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
754
+ "While ",
755
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
756
+ ", the plot is marked busy. The readout itself is hidden from assistive technology, because the announcement already says what it shows."
757
+ ] }),
758
+ "The focus ring is teal, 2px, and sits 6px outside the plot.",
759
+ "The table toggle is a button that names what it does (\"Show as table\", then \"Show as chart\") and keeps focus as the view swaps. The visible table is a real table with a caption, column and row headers.",
760
+ "A value nobody measured (with missing=\"stub\") is said as \"Not measured\", never as 0. The peak’s value and the stub are pictures only: the readout and the table say the figures.",
761
+ "While stale, the plot’s name and the tables’ captions end \"Earlier figures, shown while the new ones load\", so stand-in figures are not heard as current.",
762
+ "If the data goes while the table is open, the toggle goes with it and focus is handed to the plot, which says what became of the chart.",
763
+ "Under forced colours the bars keep their colours (the chart is SVG), and so do the legend’s keys and the readout’s, so a key still matches its bar; the readout takes a hairline edge.",
764
+ "Every movement respects reduced motion: without it, the bars appear in place rather than growing from the axis.",
765
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
766
+ "The words it adds for assistive technology are English by default, and each one can be replaced:",
767
+ " ",
768
+ /* @__PURE__ */ jsx("code", { children: "legendLabel" }),
769
+ ", ",
770
+ /* @__PURE__ */ jsx("code", { children: "categoryLabel" }),
771
+ ", ",
772
+ /* @__PURE__ */ jsx("code", { children: "keyboardHint" }),
773
+ ",",
774
+ " ",
775
+ /* @__PURE__ */ jsx("code", { children: "roleDescription" }),
776
+ ", and ",
777
+ /* @__PURE__ */ jsx("code", { children: "labels" }),
778
+ " for the toggle, \"Not measured\" and the stale note (",
779
+ /* @__PURE__ */ jsx("code", { children: "barChartLabels" }),
780
+ " is the English set)."
781
+ ] })
782
+ ] })
783
+ }),
784
+ /* @__PURE__ */ jsxs(Section$1, {
785
+ id: "guidelines",
786
+ title: "Guidelines",
787
+ children: [/* @__PURE__ */ jsx(DoDont, {
788
+ clientOnly: true,
789
+ do: {
790
+ children: /* @__PURE__ */ jsx("div", {
791
+ className: "bar-chart-dodont",
792
+ children: /* @__PURE__ */ jsx(BarChart, {
793
+ data: CHANNELS,
794
+ series: CHANNEL_SERIES,
795
+ height: 140
796
+ })
797
+ }),
798
+ caption: "Grouped bars for figures that stand on their own: each bar is read against the axis."
799
+ },
800
+ dont: {
801
+ children: /* @__PURE__ */ jsx("div", {
802
+ className: "bar-chart-dodont",
803
+ children: /* @__PURE__ */ jsx(BarChart, {
804
+ data: CHANNELS,
805
+ series: CHANNEL_SERIES,
806
+ mode: "stacked",
807
+ height: 140
808
+ })
809
+ }),
810
+ caption: "Stacked bars hide the channels below the total. Use them only for parts of one whole."
811
+ }
812
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
813
+ "Keep the categories few, read at a glance: up to about ten columns, or eight rows. More than that, use a table, or a horizontal chart for long names.",
814
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
815
+ "For a figure over time, reach for an ",
816
+ /* @__PURE__ */ jsx(DocLink, {
817
+ to: "/components/area-chart",
818
+ children: "Area chart"
819
+ }),
820
+ " or a",
821
+ " ",
822
+ /* @__PURE__ */ jsx(DocLink, {
823
+ to: "/components/sparkline",
824
+ children: "Sparkline"
825
+ }),
826
+ ". A bar chart compares categories; it does not show a trend."
827
+ ] }),
828
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
829
+ "Word the axis with ",
830
+ /* @__PURE__ */ jsx("code", { children: "formatTick" }),
831
+ " (a compact number is the default) and the readout with",
832
+ " ",
833
+ /* @__PURE__ */ jsx("code", { children: "formatValue" }),
834
+ ", so a long amount does not widen every gridline."
835
+ ] }),
836
+ "Give it room: 240px (the default) on a page, 200px at the least. The height is the plot alone, and the category labels add their row under it (a line or area chart’s height includes its date labels). The legend sits above."
837
+ ] })]
838
+ }),
839
+ /* @__PURE__ */ jsxs(Section$1, {
840
+ id: "props",
841
+ title: "Props",
842
+ description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native div attribute except children." }),
843
+ children: [
844
+ /* @__PURE__ */ jsx(PropsTable, { rows: [
845
+ {
846
+ name: "data",
847
+ type: "readonly BarChartDatum[]",
848
+ required: true,
849
+ description: "One row per category, in the order you want them read."
850
+ },
851
+ {
852
+ name: "series",
853
+ type: "readonly BarChartSeries[]",
854
+ required: true,
855
+ description: "The bars in each category, in order. More than one shows the legend."
856
+ },
857
+ {
858
+ name: "orientation",
859
+ type: "'vertical' | 'horizontal'",
860
+ default: "'vertical'",
861
+ description: "Columns, or bars that run out to the right."
862
+ },
863
+ {
864
+ name: "mode",
865
+ type: "'grouped' | 'stacked'",
866
+ default: "'grouped'",
867
+ description: "Bars side by side, or stacked into one bar per category."
868
+ },
869
+ {
870
+ name: "height",
871
+ type: "number",
872
+ default: "240",
873
+ description: "Plot height in px for vertical, not counting the category labels under it (a line or area chart’s height includes its dates). A horizontal chart grows with its rows instead (32px each)."
874
+ },
875
+ {
876
+ name: "formatValue",
877
+ type: "(value: number) => string",
878
+ default: "grouped number",
879
+ description: "Values in the readout and the hidden table."
880
+ },
881
+ {
882
+ name: "formatTick",
883
+ type: "(value: number) => string",
884
+ default: "compact number",
885
+ description: "The value axis labels, e.g. \"2.5k\"."
886
+ },
887
+ {
888
+ name: "wholeTicks",
889
+ type: "boolean",
890
+ default: "false",
891
+ description: "Labels the value axis in whole numbers only, for a count."
892
+ },
893
+ {
894
+ name: "maxTicks",
895
+ type: "number",
896
+ description: "At most this many gridlines, zero included."
897
+ },
898
+ {
899
+ name: "colorBy",
900
+ type: "'series' | 'ramp'",
901
+ default: "'series'",
902
+ description: "Colour by series, or each category the next step of the sequential ramp (ordered buckets)."
903
+ },
904
+ {
905
+ name: "tiltLabelsAfter",
906
+ type: "number",
907
+ description: "Tilts and shows every category label, cut at 14 characters, past this many columns: 30 degrees, steeper on narrow columns."
908
+ },
909
+ {
910
+ name: "tableToggle",
911
+ type: "boolean",
912
+ default: "false",
913
+ description: "A button that swaps the plot for a visible table and back."
914
+ },
915
+ {
916
+ name: "view",
917
+ type: "'chart' | 'table'",
918
+ description: "The view, held by you."
919
+ },
920
+ {
921
+ name: "defaultView",
922
+ type: "'chart' | 'table'",
923
+ default: "'chart'",
924
+ description: "The first view, held by the chart."
925
+ },
926
+ {
927
+ name: "onViewChange",
928
+ type: "(view: 'chart' | 'table') => void",
929
+ description: "Called with the view asked for."
930
+ },
931
+ {
932
+ name: "peakLabel",
933
+ type: "boolean",
934
+ default: "false",
935
+ description: "Writes the highest bar’s value over it, hidden while the readout shows."
936
+ },
937
+ {
938
+ name: "missing",
939
+ type: "'zero' | 'stub'",
940
+ default: "'zero'",
941
+ description: "A null read as 0 and drawn as nothing, or drawn as a stub and read as \"Not measured\"."
942
+ },
943
+ {
944
+ name: "stale",
945
+ type: "boolean",
946
+ default: "false",
947
+ description: "Dims figures shown as a stand-in, still readable."
948
+ },
949
+ {
950
+ name: "legend",
951
+ type: "boolean",
952
+ default: "true when more than one series",
953
+ description: "Shows the legend above the chart."
954
+ },
955
+ {
956
+ name: "loading",
957
+ type: "boolean",
958
+ default: "false",
959
+ description: "A shimmering placeholder while the data is on its way."
960
+ },
961
+ {
962
+ name: "emptyMessage",
963
+ type: "ReactNode",
964
+ default: "'Nothing to show yet'",
965
+ description: "Shown in the plot when there is no data."
966
+ },
967
+ {
968
+ name: "label",
969
+ type: "string",
970
+ description: "Names the chart for assistive technology, and captions the hidden table."
971
+ },
972
+ {
973
+ name: "legendLabel",
974
+ type: "string",
975
+ default: "label, or 'Series'",
976
+ description: "Names the legend for assistive technology."
977
+ },
978
+ {
979
+ name: "categoryLabel",
980
+ type: "string",
981
+ default: "'Category'",
982
+ description: "Heads the hidden table’s column of category names."
983
+ },
984
+ {
985
+ name: "keyboardHint",
986
+ type: "string",
987
+ default: "'Use the arrow keys to read each category.'",
988
+ description: "Ends the summary generated when there is no label."
989
+ },
990
+ {
991
+ name: "roleDescription",
992
+ type: "string",
993
+ default: "'chart'",
994
+ description: "What assistive technology calls the plot after its name."
995
+ },
996
+ {
997
+ name: "labels",
998
+ type: "Partial<BarChartLabels>",
999
+ default: "barChartLabels",
1000
+ description: "Its words: showTable, showChart, missing and stale."
1001
+ }
1002
+ ] }),
1003
+ /* @__PURE__ */ jsx(PropsTable, {
1004
+ title: "BarChartDatum",
1005
+ rows: [
1006
+ {
1007
+ name: "label",
1008
+ type: "string",
1009
+ required: true,
1010
+ description: "The category's name, on the axis and in the readout."
1011
+ },
1012
+ {
1013
+ name: "values",
1014
+ type: "Record<string, number | null>",
1015
+ required: true,
1016
+ description: "One value per series key. A missing or null value draws nothing, or a stub with missing=\"stub\". A value below zero is drawn below a zero line."
1017
+ },
1018
+ {
1019
+ name: "readoutLabel",
1020
+ type: "string",
1021
+ default: "label",
1022
+ description: "Heads the readout, is announced and names the table row, when it should say more than the axis."
1023
+ },
1024
+ {
1025
+ name: "color",
1026
+ type: "string",
1027
+ description: "A CSS colour for this category's bars, over the series' and the ramp's."
1028
+ }
1029
+ ]
1030
+ }),
1031
+ /* @__PURE__ */ jsx(PropsTable, {
1032
+ title: "BarChartSeries",
1033
+ rows: [
1034
+ {
1035
+ name: "key",
1036
+ type: "string",
1037
+ required: true,
1038
+ description: "The key this series reads from each datum's values."
1039
+ },
1040
+ {
1041
+ name: "label",
1042
+ type: "string",
1043
+ required: true,
1044
+ description: "The name in the legend, the readout and the hidden table."
1045
+ },
1046
+ {
1047
+ name: "color",
1048
+ type: "string",
1049
+ description: "A CSS colour. Defaults to the categorical palette, in order: var(--o-chart-1), var(--o-chart-3) and on."
1050
+ }
1051
+ ]
1052
+ }),
1053
+ /* @__PURE__ */ jsx(Fragment$1, {})
1054
+ ]
1055
+ })
1056
+ ]
1057
+ });
1058
+ }
1059
+ //#endregion
1060
+ export { Page, Preview };