@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,926 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { d as Section$1, i as DocPage, l as Note, m as ThemePair, o as Example, 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 { Avatar, Button, Delta, EmptyState, SegmentedControl, ShareList, SkeletonList } from "@orbitcommerce/constellation";
7
+ import { ArrowClockwiseIcon } from "@orbitcommerce/constellation/icons";
8
+ //#region src/pages/components/share-list.tsx
9
+ /** Sales by channel: each row's share is its part of the total, so the lines add up to a whole. */
10
+ var CHANNELS = [
11
+ {
12
+ key: "online",
13
+ label: "Online store",
14
+ value: "£1,640.20",
15
+ share: .58
16
+ },
17
+ {
18
+ key: "marketplace",
19
+ label: "Marketplace",
20
+ value: "£620.00",
21
+ share: .22
22
+ },
23
+ {
24
+ key: "pos",
25
+ label: "Point of sale",
26
+ value: "£405.50",
27
+ share: .14
28
+ },
29
+ {
30
+ key: "wholesale",
31
+ label: "Wholesale",
32
+ value: "£160.00",
33
+ share: .06
34
+ }
35
+ ];
36
+ /** The same channels a period later: the lines glide to these. */
37
+ var CHANNELS_LATER = [
38
+ {
39
+ key: "online",
40
+ label: "Online store",
41
+ value: "£5,120.80",
42
+ share: .49
43
+ },
44
+ {
45
+ key: "marketplace",
46
+ label: "Marketplace",
47
+ value: "£2,890.40",
48
+ share: .28
49
+ },
50
+ {
51
+ key: "pos",
52
+ label: "Point of sale",
53
+ value: "£1,520.00",
54
+ share: .15
55
+ },
56
+ {
57
+ key: "wholesale",
58
+ label: "Wholesale",
59
+ value: "£910.30",
60
+ share: .08
61
+ }
62
+ ];
63
+ /** Best sellers: each row's share is against the leader, so the top one is a full line. */
64
+ var PRODUCTS = [
65
+ {
66
+ key: "arden",
67
+ name: "Arden ergonomic chair",
68
+ value: "£3,870.00",
69
+ share: 1,
70
+ change: 12.4
71
+ },
72
+ {
73
+ key: "linden",
74
+ name: "Linden standing desk",
75
+ value: "£2,740.00",
76
+ share: .71,
77
+ change: 8.1
78
+ },
79
+ {
80
+ key: "wren",
81
+ name: "Wren desk lamp",
82
+ value: "£1,180.00",
83
+ share: .3,
84
+ change: -3.2
85
+ },
86
+ {
87
+ key: "thistle",
88
+ name: "Thistle filing cabinet",
89
+ value: "£960.00",
90
+ share: .25,
91
+ change: .2
92
+ },
93
+ {
94
+ key: "fernhill",
95
+ name: "Fernhill monitor arm",
96
+ value: "£610.00",
97
+ share: .16,
98
+ change: 41
99
+ }
100
+ ];
101
+ var withPictures = () => PRODUCTS.map((product) => ({
102
+ key: product.key,
103
+ label: product.name,
104
+ value: product.value,
105
+ share: product.share,
106
+ delta: /* @__PURE__ */ jsx(Delta, {
107
+ size: "sm",
108
+ value: product.change
109
+ }),
110
+ media: /* @__PURE__ */ jsx(Avatar, {
111
+ shape: "square",
112
+ size: "lg",
113
+ name: product.name,
114
+ alt: ""
115
+ })
116
+ }));
117
+ /** A checkout funnel: each stage against the first, with how many were lost on the way. */
118
+ var FUNNEL = [
119
+ {
120
+ key: "visited",
121
+ label: "Visited the store",
122
+ value: "12,480",
123
+ share: 1
124
+ },
125
+ {
126
+ key: "viewed",
127
+ label: "Viewed a product",
128
+ value: "6,240",
129
+ share: .5,
130
+ hint: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", { children: "50% of sessions" }), /* @__PURE__ */ jsx("span", { children: "6,240 dropped" })] })
131
+ },
132
+ {
133
+ key: "basket",
134
+ label: "Added to basket",
135
+ value: "1,872",
136
+ share: .15,
137
+ hint: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", { children: "15% of sessions" }), /* @__PURE__ */ jsx("span", { children: "4,368 dropped" })] })
138
+ },
139
+ {
140
+ key: "checkout",
141
+ label: "Reached checkout",
142
+ value: "936",
143
+ share: .075,
144
+ hint: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", { children: "7.5% of sessions" }), /* @__PURE__ */ jsx("span", { children: "936 dropped" })] })
145
+ },
146
+ {
147
+ key: "purchased",
148
+ label: "Purchased",
149
+ value: "524",
150
+ share: .042,
151
+ hint: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", { children: "4.2% of sessions" }), /* @__PURE__ */ jsx("span", { children: "412 dropped" })] })
152
+ }
153
+ ];
154
+ function Preview() {
155
+ return /* @__PURE__ */ jsx("div", {
156
+ className: "share-list-preview",
157
+ children: /* @__PURE__ */ jsx(ShareList, {
158
+ "aria-label": "Sales by channel",
159
+ items: CHANNELS.slice(0, 3),
160
+ showShare: true
161
+ })
162
+ });
163
+ }
164
+ /** Two periods behind a switch, and a button that draws the list again: the line's two movements, seen. */
165
+ function Movement() {
166
+ const [period, setPeriod] = useState("7");
167
+ const [drawn, setDrawn] = useState(0);
168
+ return /* @__PURE__ */ jsxs("div", {
169
+ className: "share-list-demo",
170
+ children: [/* @__PURE__ */ jsxs("div", {
171
+ className: "share-list-demo__bar",
172
+ children: [/* @__PURE__ */ jsx(SegmentedControl, {
173
+ size: "sm",
174
+ "aria-label": "Period",
175
+ value: period,
176
+ onValueChange: setPeriod,
177
+ options: [{
178
+ value: "7",
179
+ label: "Last 7 days"
180
+ }, {
181
+ value: "30",
182
+ label: "Last 30 days"
183
+ }]
184
+ }), /* @__PURE__ */ jsx(Button, {
185
+ size: "sm",
186
+ variant: "ghost",
187
+ icon: /* @__PURE__ */ jsx(ArrowClockwiseIcon, {}),
188
+ onClick: () => setDrawn((now) => now + 1),
189
+ children: "Draw again"
190
+ })]
191
+ }), /* @__PURE__ */ jsx(ShareList, {
192
+ "aria-label": "Sales by channel",
193
+ showShare: true,
194
+ items: period === "7" ? CHANNELS : CHANNELS_LATER
195
+ }, drawn)]
196
+ });
197
+ }
198
+ /** The three states of a list that is fetched: loading, nothing to show, and the rows. */
199
+ /** A sales pipeline: the open stages against the biggest, then the closed ones in their status colours. */
200
+ var PIPELINE = [
201
+ {
202
+ key: "lead",
203
+ label: "Lead",
204
+ value: "14 deals, £42,000",
205
+ share: .36
206
+ },
207
+ {
208
+ key: "qualified",
209
+ label: "Qualified",
210
+ value: "9 deals, £31,500",
211
+ share: .27
212
+ },
213
+ {
214
+ key: "proposal",
215
+ label: "Proposal",
216
+ value: "6 deals, £25,200",
217
+ share: .21
218
+ },
219
+ {
220
+ key: "negotiation",
221
+ label: "Negotiation",
222
+ value: "3 deals, £12,600",
223
+ share: .11
224
+ },
225
+ {
226
+ key: "won",
227
+ label: "Closed won",
228
+ value: "2 deals, £4,800",
229
+ share: .04,
230
+ tone: "positive"
231
+ },
232
+ {
233
+ key: "lost",
234
+ label: "Closed lost",
235
+ value: "1 deal, £1,200",
236
+ share: .01,
237
+ tone: "negative"
238
+ }
239
+ ];
240
+ function PipelineStates() {
241
+ const [state, setState] = useState("loading");
242
+ return /* @__PURE__ */ jsxs("div", {
243
+ className: "share-list-demo",
244
+ children: [/* @__PURE__ */ jsx("div", {
245
+ className: "share-list-demo__bar",
246
+ children: /* @__PURE__ */ jsx(SegmentedControl, {
247
+ size: "sm",
248
+ "aria-label": "State",
249
+ value: state,
250
+ onValueChange: (next) => setState(next),
251
+ options: [
252
+ {
253
+ value: "loading",
254
+ label: "Loading"
255
+ },
256
+ {
257
+ value: "empty",
258
+ label: "No rows"
259
+ },
260
+ {
261
+ value: "loaded",
262
+ label: "Loaded"
263
+ }
264
+ ]
265
+ })
266
+ }), /* @__PURE__ */ jsx(ShareList, {
267
+ "aria-label": "Pipeline",
268
+ items: state === "loaded" ? PIPELINE : [],
269
+ loading: state === "loading",
270
+ loadingRows: 4,
271
+ empty: "No open deals in this pipeline yet.",
272
+ scale: "largest"
273
+ })]
274
+ });
275
+ }
276
+ function States() {
277
+ const [state, setState] = useState("loading");
278
+ return /* @__PURE__ */ jsxs("div", {
279
+ className: "share-list-demo",
280
+ children: [/* @__PURE__ */ jsx("div", {
281
+ className: "share-list-demo__bar",
282
+ children: /* @__PURE__ */ jsx(SegmentedControl, {
283
+ size: "sm",
284
+ "aria-label": "State",
285
+ value: state,
286
+ onValueChange: (next) => setState(next),
287
+ options: [
288
+ {
289
+ value: "loading",
290
+ label: "Loading"
291
+ },
292
+ {
293
+ value: "empty",
294
+ label: "No rows"
295
+ },
296
+ {
297
+ value: "loaded",
298
+ label: "Loaded"
299
+ }
300
+ ]
301
+ })
302
+ }), state === "loading" ? /* @__PURE__ */ jsx(SkeletonList, {
303
+ rows: 4,
304
+ lead: "none",
305
+ lines: 1,
306
+ bar: true,
307
+ label: "Loading sales by channel"
308
+ }) : state === "empty" ? /* @__PURE__ */ jsx(EmptyState, {
309
+ size: "sm",
310
+ titleAs: "p",
311
+ title: "No sales yet",
312
+ description: "Sales by channel appear here once an order comes in."
313
+ }) : /* @__PURE__ */ jsx(ShareList, {
314
+ "aria-label": "Sales by channel",
315
+ items: CHANNELS
316
+ })]
317
+ });
318
+ }
319
+ function Page() {
320
+ return /* @__PURE__ */ jsxs(DocPage, {
321
+ title: "Share list",
322
+ status: "new",
323
+ importNames: ["ShareList"],
324
+ lead: "Ranked rows that each say how much of a whole they are: a label, a figure, how it moved, and a thin teal line as long as the row's share. Use it for sales by channel, sign-ups by source, best sellers and the stages of a funnel.",
325
+ children: [
326
+ /* @__PURE__ */ jsx(Section$1, {
327
+ id: "basics",
328
+ title: "Basics",
329
+ description: /* @__PURE__ */ jsxs("p", { children: [
330
+ "Give it ",
331
+ /* @__PURE__ */ jsx("code", { children: "items" }),
332
+ ", largest first, and a name. Each row has a ",
333
+ /* @__PURE__ */ jsx("code", { children: "label" }),
334
+ ", a ",
335
+ /* @__PURE__ */ jsx("code", { children: "value" }),
336
+ " (the figure, already formatted) and a ",
337
+ /* @__PURE__ */ jsx("code", { children: "share" }),
338
+ " from 0 to 1, which is the length of its line: 4px, a pill, on the track the progress bar uses. Figures end at the same edge, so they read down as a column."
339
+ ] }),
340
+ children: /* @__PURE__ */ jsx(Example, {
341
+ align: "fill",
342
+ code: `
343
+ <ShareList
344
+ aria-label="Sales by channel"
345
+ items={[
346
+ { key: 'online', label: 'Online store', value: '£1,640.20', share: 0.58 },
347
+ { key: 'marketplace', label: 'Marketplace', value: '£620.00', share: 0.22 },
348
+ { key: 'pos', label: 'Point of sale', value: '£405.50', share: 0.14 },
349
+ { key: 'wholesale', label: 'Wholesale', value: '£160.00', share: 0.06 },
350
+ ]}
351
+ />`,
352
+ children: /* @__PURE__ */ jsx("div", {
353
+ className: "share-list-demo",
354
+ children: /* @__PURE__ */ jsx(ShareList, {
355
+ "aria-label": "Sales by channel",
356
+ items: CHANNELS
357
+ })
358
+ })
359
+ })
360
+ }),
361
+ /* @__PURE__ */ jsx(Section$1, {
362
+ id: "share-written",
363
+ title: "The share, written",
364
+ description: /* @__PURE__ */ jsxs("p", { children: [
365
+ "The line is a picture: it shows the share and says nothing. ",
366
+ /* @__PURE__ */ jsx("code", { children: "showShare" }),
367
+ " also writes it beside the figure, as the sales by channel on the analytics page does, and ",
368
+ /* @__PURE__ */ jsx("code", { children: "formatShare" }),
369
+ " says how (a whole percentage by default, with one decimal below 1% so a sliver is never written as 0%, or one decimal throughout as below). A screen reader hears the share either way, in words, whether or not it is written (see Accessibility)."
370
+ ] }),
371
+ children: /* @__PURE__ */ jsx(Example, {
372
+ align: "fill",
373
+ code: `
374
+ <ShareList aria-label="Sales by channel" items={channels} showShare />
375
+
376
+ <ShareList
377
+ aria-label="Sales by channel"
378
+ items={channels}
379
+ showShare
380
+ formatShare={(share) => \`\${(share * 100).toFixed(1)}%\`}
381
+ />`,
382
+ children: /* @__PURE__ */ jsxs("div", {
383
+ className: "share-list-demo",
384
+ "data-stacked": "",
385
+ children: [/* @__PURE__ */ jsx(ShareList, {
386
+ "aria-label": "Sales by channel, whole percentages",
387
+ items: CHANNELS,
388
+ showShare: true
389
+ }), /* @__PURE__ */ jsx(ShareList, {
390
+ "aria-label": "Sales by channel, one decimal",
391
+ items: CHANNELS,
392
+ showShare: true,
393
+ formatShare: (share) => `${(share * 100).toFixed(1)}%`
394
+ })]
395
+ })
396
+ })
397
+ }),
398
+ /* @__PURE__ */ jsx(Section$1, {
399
+ id: "whole",
400
+ title: "A share of what",
401
+ description: /* @__PURE__ */ jsxs("p", { children: [
402
+ "The list does not work the share out: you do, and you choose the whole. For a breakdown it is",
403
+ " ",
404
+ /* @__PURE__ */ jsx("code", { children: "value / total" }),
405
+ ", so the lines add up to a full track. For a ranking it is ",
406
+ /* @__PURE__ */ jsx("code", { children: "value / leader" }),
407
+ ", so the top row is a full line and the rest are measured against it. Say which in ",
408
+ /* @__PURE__ */ jsx("code", { children: "shareLabel" }),
409
+ ", the sentence a screen reader hears."
410
+ ] }),
411
+ children: /* @__PURE__ */ jsx(Example, {
412
+ align: "fill",
413
+ code: `
414
+ const leader = Math.max(...products.map((product) => product.sales))
415
+
416
+ <ShareList
417
+ aria-label="Best sellers"
418
+ shareLabel={(percent) => \`\${percent}% of the top seller\`}
419
+ items={products.map((product) => ({
420
+ key: product.id,
421
+ label: product.name,
422
+ value: money(product.sales),
423
+ share: product.sales / leader,
424
+ }))}
425
+ />`,
426
+ children: /* @__PURE__ */ jsx("div", {
427
+ className: "share-list-demo",
428
+ children: /* @__PURE__ */ jsx(ShareList, {
429
+ "aria-label": "Best sellers",
430
+ shareLabel: (percent) => `${percent}% of the top seller`,
431
+ items: PRODUCTS.map((product) => ({
432
+ key: product.key,
433
+ label: product.name,
434
+ value: product.value,
435
+ share: product.share
436
+ }))
437
+ })
438
+ })
439
+ })
440
+ }),
441
+ /* @__PURE__ */ jsx(Section$1, {
442
+ id: "change",
443
+ title: "With a change",
444
+ description: /* @__PURE__ */ jsxs("p", { children: [
445
+ /* @__PURE__ */ jsx("code", { children: "delta" }),
446
+ " sits after the figure. Pass the kit's ",
447
+ /* @__PURE__ */ jsx(DocLink, {
448
+ to: "/components/delta",
449
+ children: "Delta"
450
+ }),
451
+ " at size",
452
+ " ",
453
+ /* @__PURE__ */ jsx("code", { children: "sm" }),
454
+ ": it knows which way is good news (a rise in returns is not) and draws the arrow and the tone."
455
+ ] }),
456
+ children: /* @__PURE__ */ jsx(Example, {
457
+ align: "fill",
458
+ code: `
459
+ <ShareList
460
+ aria-label="Sales by channel"
461
+ items={[
462
+ { key: 'online', label: 'Online store', value: '£1,640.20', share: 0.58, delta: <Delta size="sm" value={12.4} /> },
463
+ { key: 'marketplace', label: 'Marketplace', value: '£620.00', share: 0.22, delta: <Delta size="sm" value={-3.2} /> },
464
+ { key: 'pos', label: 'Point of sale', value: '£405.50', share: 0.14, delta: <Delta size="sm" value={0.2} /> },
465
+ ]}
466
+ />`,
467
+ children: /* @__PURE__ */ jsx("div", {
468
+ className: "share-list-demo",
469
+ children: /* @__PURE__ */ jsx(ShareList, {
470
+ "aria-label": "Sales by channel, with changes",
471
+ items: [
472
+ {
473
+ ...CHANNELS[0],
474
+ delta: /* @__PURE__ */ jsx(Delta, {
475
+ size: "sm",
476
+ value: 12.4
477
+ })
478
+ },
479
+ {
480
+ ...CHANNELS[1],
481
+ delta: /* @__PURE__ */ jsx(Delta, {
482
+ size: "sm",
483
+ value: -3.2
484
+ })
485
+ },
486
+ {
487
+ ...CHANNELS[2],
488
+ delta: /* @__PURE__ */ jsx(Delta, {
489
+ size: "sm",
490
+ value: .2
491
+ })
492
+ }
493
+ ]
494
+ })
495
+ })
496
+ })
497
+ }),
498
+ /* @__PURE__ */ jsx(Section$1, {
499
+ id: "pictures",
500
+ title: "With pictures",
501
+ description: /* @__PURE__ */ jsxs("p", { children: [
502
+ /* @__PURE__ */ jsx("code", { children: "media" }),
503
+ " leads a row with a square ",
504
+ /* @__PURE__ */ jsx(DocLink, {
505
+ to: "/components/avatar",
506
+ children: "Avatar"
507
+ }),
508
+ " (size ",
509
+ /* @__PURE__ */ jsx("code", { children: "lg" }),
510
+ ") or an ",
511
+ /* @__PURE__ */ jsx(DocLink, {
512
+ to: "/components/icon-tile",
513
+ children: "IconTile"
514
+ }),
515
+ ". A list with any media draws the ranked look the vendor dashboard's best sellers have: rows 56px tall and closer together, and the figure steps back to a quiet 13px so the name leads. A long name takes up to two lines here before it is cut, so it can be read on a phone. Give every row a picture or none."
516
+ ] }),
517
+ children: /* @__PURE__ */ jsx(Example, {
518
+ align: "fill",
519
+ code: `
520
+ <ShareList
521
+ aria-label="Best sellers"
522
+ items={products.map((product) => ({
523
+ key: product.id,
524
+ label: product.name,
525
+ value: money(product.sales),
526
+ share: product.sales / leader,
527
+ delta: <Delta size="sm" value={product.change} />,
528
+ media: <Avatar shape="square" size="lg" name={product.name} alt="" />,
529
+ }))}
530
+ />`,
531
+ children: /* @__PURE__ */ jsx("div", {
532
+ className: "share-list-demo",
533
+ children: /* @__PURE__ */ jsx(ShareList, {
534
+ "aria-label": "Best sellers",
535
+ items: withPictures()
536
+ })
537
+ })
538
+ })
539
+ }),
540
+ /* @__PURE__ */ jsx(Section$1, {
541
+ id: "hint",
542
+ title: "A line under the line",
543
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "hint" }), " is one quiet line under the bar, for what the figure does not say. A funnel uses it for how much of the first stage a step kept and how many it lost. Its parts sit at the two edges and wrap together when the row is narrow."] }),
544
+ children: /* @__PURE__ */ jsx(Example, {
545
+ align: "fill",
546
+ code: `
547
+ <ShareList
548
+ aria-label="Checkout funnel"
549
+ items={[
550
+ { key: 'visited', label: 'Visited the store', value: '12,480', share: 1 },
551
+ {
552
+ key: 'viewed',
553
+ label: 'Viewed a product',
554
+ value: '6,240',
555
+ share: 0.5,
556
+ hint: (
557
+ <>
558
+ <span>50% of sessions</span>
559
+ <span>6,240 dropped</span>
560
+ </>
561
+ ),
562
+ },
563
+ // …
564
+ ]}
565
+ />`,
566
+ children: /* @__PURE__ */ jsx("div", {
567
+ className: "share-list-demo",
568
+ children: /* @__PURE__ */ jsx(ShareList, {
569
+ "aria-label": "Checkout funnel",
570
+ shareLabel: (percent) => `${percent}% of sessions`,
571
+ items: FUNNEL
572
+ })
573
+ })
574
+ })
575
+ }),
576
+ /* @__PURE__ */ jsxs(Section$1, {
577
+ id: "motion",
578
+ title: "Growing in",
579
+ description: /* @__PURE__ */ jsx("p", { children: "When the list arrives, each line grows from the start edge over 900ms, row after row (70ms apart, the first after 150ms), so a ranking reads top to bottom as it settles. When a share changes, the line glides to its new length. Under reduced motion the lines are simply there and a change is simply the new length." }),
580
+ children: [/* @__PURE__ */ jsx(Example, {
581
+ align: "fill",
582
+ code: `<ShareList key={drawn} aria-label="Sales by channel" showShare items={items} />`,
583
+ children: /* @__PURE__ */ jsx(Movement, {})
584
+ }), /* @__PURE__ */ jsxs(Note, {
585
+ title: "Why not a progress bar",
586
+ children: [
587
+ "A ",
588
+ /* @__PURE__ */ jsx(DocLink, {
589
+ to: "/components/progress",
590
+ children: "Progress"
591
+ }),
592
+ " is a ",
593
+ /* @__PURE__ */ jsx("code", { children: "progressbar" }),
594
+ " that reports how far along something is. A share is not progress, and a list of five of them would be five progress bars to a screen reader, each with a value and no meaning. The line here uses the progress bar's track and colour but is only a picture, and the row says its share in words."
595
+ ]
596
+ })]
597
+ }),
598
+ /* @__PURE__ */ jsx(Section$1, {
599
+ id: "pipeline",
600
+ title: "A pipeline: status, the biggest row and a summary",
601
+ description: /* @__PURE__ */ jsxs("p", { children: [
602
+ "A row's ",
603
+ /* @__PURE__ */ jsx("code", { children: "tone" }),
604
+ " colours its line by status, as a pipeline marks its won and lost stages (say the status in the label too). ",
605
+ /* @__PURE__ */ jsx("code", { children: "scale=\"largest\"" }),
606
+ " draws the biggest row full length and the rest against it, while each row still writes and says its own share. ",
607
+ /* @__PURE__ */ jsx("code", { children: "summary" }),
608
+ " sets figures under the list, past a hairline, each name over its value and a dot in the tone of the rows it sums."
609
+ ] }),
610
+ children: /* @__PURE__ */ jsx(Example, {
611
+ align: "fill",
612
+ code: `
613
+ <ShareList
614
+ aria-label="Pipeline"
615
+ scale="largest"
616
+ items={[
617
+ { key: 'lead', label: 'Lead', value: '14 deals, £42,000', share: 0.36 },
618
+ /* ... */
619
+ { key: 'won', label: 'Closed won', value: '2 deals, £4,800', share: 0.04, tone: 'positive' },
620
+ { key: 'lost', label: 'Closed lost', value: '1 deal, £1,200', share: 0.01, tone: 'negative' },
621
+ ]}
622
+ summary={[
623
+ { key: 'won', label: 'Won this quarter', value: '12 (£24,000)', tone: 'positive' },
624
+ { key: 'lost', label: 'Lost this quarter', value: '4', tone: 'negative' },
625
+ ]}
626
+ />`,
627
+ children: /* @__PURE__ */ jsx("div", {
628
+ className: "share-list-demo",
629
+ children: /* @__PURE__ */ jsx(ShareList, {
630
+ "aria-label": "Pipeline",
631
+ items: PIPELINE,
632
+ scale: "largest",
633
+ summary: [{
634
+ key: "won",
635
+ label: "Won this quarter",
636
+ value: "12 (£24,000)",
637
+ tone: "positive"
638
+ }, {
639
+ key: "lost",
640
+ label: "Lost this quarter",
641
+ value: "4",
642
+ tone: "negative"
643
+ }]
644
+ })
645
+ })
646
+ })
647
+ }),
648
+ /* @__PURE__ */ jsxs(Section$1, {
649
+ id: "states",
650
+ title: "Loading and nothing to show",
651
+ description: /* @__PURE__ */ jsxs("p", { children: [
652
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
653
+ " with no rows yet draws placeholder rows in the shape of the real ones (",
654
+ /* @__PURE__ */ jsx("code", { children: "loadingRows" }),
655
+ ", 3 by default), marks the list busy and says \"Loading\" once, beside it; with rows, they stay, dimmed, while the figures come again. ",
656
+ /* @__PURE__ */ jsx("code", { children: "empty" }),
657
+ " stands in for the list when there is nothing to rank; without it an empty list draws nothing, as it always has. For a whole panel with nothing in it, a ",
658
+ /* @__PURE__ */ jsx(DocLink, {
659
+ to: "/components/skeleton",
660
+ children: "SkeletonList"
661
+ }),
662
+ " and an",
663
+ " ",
664
+ /* @__PURE__ */ jsx(DocLink, {
665
+ to: "/components/empty-state",
666
+ children: "EmptyState"
667
+ }),
668
+ " still do the job, as in the second example."
669
+ ] }),
670
+ children: [/* @__PURE__ */ jsx(Example, {
671
+ align: "fill",
672
+ code: `
673
+ <ShareList
674
+ aria-label="Pipeline"
675
+ items={stages}
676
+ loading={isLoading}
677
+ empty="No open deals in this pipeline yet."
678
+ />`,
679
+ children: /* @__PURE__ */ jsx(PipelineStates, {})
680
+ }), /* @__PURE__ */ jsx(Example, {
681
+ align: "fill",
682
+ code: `
683
+ {loading ? (
684
+ <SkeletonList rows={4} lead="none" lines={1} bar label="Loading sales by channel" />
685
+ ) : items.length === 0 ? (
686
+ <EmptyState size="sm" title="No sales yet" description="Sales by channel appear here once an order comes in." />
687
+ ) : (
688
+ <ShareList aria-label="Sales by channel" items={items} />
689
+ )}`,
690
+ children: /* @__PURE__ */ jsx(States, {})
691
+ })]
692
+ }),
693
+ /* @__PURE__ */ jsx(Section$1, {
694
+ id: "both-themes",
695
+ title: "In both themes",
696
+ description: /* @__PURE__ */ jsx("p", { children: "A breakdown with its shares written, and the ranked look with pictures and changes, light and dark side by side." }),
697
+ children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsxs("div", {
698
+ className: "share-list-demo",
699
+ "data-stacked": "",
700
+ children: [/* @__PURE__ */ jsx(ShareList, {
701
+ "aria-label": "Sales by channel",
702
+ items: CHANNELS,
703
+ showShare: true
704
+ }), /* @__PURE__ */ jsx(ShareList, {
705
+ "aria-label": "Best sellers",
706
+ items: withPictures().slice(0, 3)
707
+ })]
708
+ }) })
709
+ }),
710
+ /* @__PURE__ */ jsx(Fragment$1, {}),
711
+ /* @__PURE__ */ jsxs(Section$1, {
712
+ id: "guidelines",
713
+ title: "Guidelines",
714
+ children: [/* @__PURE__ */ jsx(DoDont, {
715
+ do: {
716
+ children: /* @__PURE__ */ jsx("div", {
717
+ className: "share-list-demo",
718
+ children: /* @__PURE__ */ jsx(ShareList, {
719
+ "aria-label": "Sales by channel",
720
+ items: CHANNELS.slice(0, 3),
721
+ showShare: true
722
+ })
723
+ }),
724
+ caption: "Largest first, one whole, and the lines add up: each share is its part of the total."
725
+ },
726
+ dont: {
727
+ children: /* @__PURE__ */ jsx("div", {
728
+ className: "share-list-demo",
729
+ children: /* @__PURE__ */ jsx(ShareList, {
730
+ "aria-label": "Mixed measures",
731
+ items: [
732
+ {
733
+ key: "sales",
734
+ label: "Sales",
735
+ value: "£1,640.20",
736
+ share: .9
737
+ },
738
+ {
739
+ key: "conversion",
740
+ label: "Conversion rate",
741
+ value: "2.4%",
742
+ share: .9
743
+ },
744
+ {
745
+ key: "returns",
746
+ label: "Return rate",
747
+ value: "4.1%",
748
+ share: .2
749
+ }
750
+ ]
751
+ })
752
+ }),
753
+ caption: "Rows that measure different things cannot be a share of one whole: use figures, not lines."
754
+ }
755
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
756
+ "Pass the rows largest first. The list keeps your order and does not sort or rank for you.",
757
+ "Choose the whole once for the list and say it in shareLabel: \"of the total\", \"of sessions\", \"of the top seller\".",
758
+ "Keep the label to a few words: it is one line, cut with an ellipsis (two with pictures), and a text label carries its full text as a title.",
759
+ "Format the figure yourself (money, a count, \"1,240 sign-ups\"): a share list never guesses a currency or a unit.",
760
+ "Five to eight rows is the most it reads well at. Beyond that, show the top rows and a link to the full report."
761
+ ] })]
762
+ }),
763
+ /* @__PURE__ */ jsx(Section$1, {
764
+ id: "accessibility",
765
+ title: "Accessibility",
766
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
767
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
768
+ "The list is a real ordered list and needs a name, which the types ask for: ",
769
+ /* @__PURE__ */ jsx("code", { children: "aria-label" }),
770
+ " (\"Sales by channel\"), or ",
771
+ /* @__PURE__ */ jsx("code", { children: "aria-labelledby" }),
772
+ " pointing at the heading above it. A screen reader hears how many rows there are and which place each is in."
773
+ ] }),
774
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
775
+ "The line is decoration and hidden from assistive technology. Each row says its share in words after its figure: \"Online store, £1,640.20, 58% of the total\". ",
776
+ /* @__PURE__ */ jsx("code", { children: "shareLabel" }),
777
+ " writes that sentence, in your language and about your whole."
778
+ ] }),
779
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
780
+ "A written share (",
781
+ /* @__PURE__ */ jsx("code", { children: "showShare" }),
782
+ ") is hidden from assistive technology so it is not read twice: the sentence is the one place it is spoken."
783
+ ] }),
784
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
785
+ "A square avatar in ",
786
+ /* @__PURE__ */ jsx("code", { children: "media" }),
787
+ " takes ",
788
+ /* @__PURE__ */ jsx("code", { children: "alt=\"\"" }),
789
+ ": the label is written beside it, so the name is read once."
790
+ ] }),
791
+ "Nothing is told by colour alone: the line is the same teal on every row, and the figures are text.",
792
+ "In forced colours the track takes an outline and the line takes the highlight colour, so it stays visible.",
793
+ "Under reduced motion the lines do not grow in and a changed share does not glide."
794
+ ] })
795
+ }),
796
+ /* @__PURE__ */ jsxs(Section$1, {
797
+ id: "props",
798
+ title: "Props",
799
+ description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native ordered-list attribute except children." }),
800
+ children: [/* @__PURE__ */ jsx(PropsTable, {
801
+ title: "ShareList",
802
+ rows: [
803
+ {
804
+ name: "items",
805
+ type: "ShareListItem[]",
806
+ required: true,
807
+ description: "The rows, largest first. With none, the list draws nothing (or empty)."
808
+ },
809
+ {
810
+ name: "aria-label",
811
+ type: "string",
812
+ description: "The list's name for assistive technology. The list needs this or aria-labelledby: an unnamed list is a type error."
813
+ },
814
+ {
815
+ name: "aria-labelledby",
816
+ type: "string",
817
+ description: "The id of the heading that names the list, instead of aria-label."
818
+ },
819
+ {
820
+ name: "showShare",
821
+ type: "boolean",
822
+ default: "false",
823
+ description: "Writes each row's share beside its figure."
824
+ },
825
+ {
826
+ name: "formatShare",
827
+ type: "(share: number) => string",
828
+ default: "a whole percentage, 42%, or one decimal below 1%: 0.3%",
829
+ description: "How the written share reads, from the share (0 to 1)."
830
+ },
831
+ {
832
+ name: "shareLabel",
833
+ type: "(percent: number) => string",
834
+ default: "`${percent}% of the total`",
835
+ description: "What a screen reader hears for each row's share, from its percentage: whole, or one decimal below 1%. Translate it and say what it is a share of."
836
+ },
837
+ {
838
+ name: "scale",
839
+ type: "'whole' | 'largest'",
840
+ default: "'whole'",
841
+ description: "Lines as long as their shares, or against the biggest row. The share written and read stays the row's own."
842
+ },
843
+ {
844
+ name: "summary",
845
+ type: "ShareListSummaryItem[]",
846
+ description: "Figures under the list: { key, label, value, tone? }."
847
+ },
848
+ {
849
+ name: "loading",
850
+ type: "boolean",
851
+ default: "false",
852
+ description: "Placeholder rows with none, the rows dimmed with some; busy, and said once."
853
+ },
854
+ {
855
+ name: "loadingRows",
856
+ type: "number",
857
+ default: "3",
858
+ description: "How many placeholder rows stand in."
859
+ },
860
+ {
861
+ name: "empty",
862
+ type: "ReactNode",
863
+ description: "Shown where the rows would be; the list stays, named and empty, so a screen reader hears a list of none."
864
+ },
865
+ {
866
+ name: "labels",
867
+ type: "Partial<ShareListLabels>",
868
+ default: "shareListLabels",
869
+ description: "Its words: loading."
870
+ }
871
+ ]
872
+ }), /* @__PURE__ */ jsx(PropsTable, {
873
+ title: "ShareListItem",
874
+ rows: [
875
+ {
876
+ name: "key",
877
+ type: "string",
878
+ required: true,
879
+ description: "Identifies the row: the React key."
880
+ },
881
+ {
882
+ name: "label",
883
+ type: "ReactNode",
884
+ required: true,
885
+ description: "What the row is. One line, cut with an ellipsis (two in the ranked look, with media); a text label is also its title."
886
+ },
887
+ {
888
+ name: "value",
889
+ type: "ReactNode",
890
+ required: true,
891
+ description: "The figure, already formatted: \"£1,640.20\", \"1,240\"."
892
+ },
893
+ {
894
+ name: "share",
895
+ type: "number",
896
+ required: true,
897
+ description: "How much of the whole the row is, 0 to 1: the line's length. Held to 0 to 1; a value that is not a number draws no line."
898
+ },
899
+ {
900
+ name: "delta",
901
+ type: "ReactNode",
902
+ description: "How the figure moved: a Delta at size sm, set after the figure."
903
+ },
904
+ {
905
+ name: "media",
906
+ type: "ReactNode",
907
+ description: "What leads the row: a square Avatar (size lg, alt=\"\") or an IconTile. Give every row one or none."
908
+ },
909
+ {
910
+ name: "hint",
911
+ type: "ReactNode",
912
+ description: "One quiet line under the bar. Its parts sit at the two edges."
913
+ },
914
+ {
915
+ name: "tone",
916
+ type: "'positive' | 'negative' | 'warning' | 'neutral'",
917
+ description: "The row's status, coloured into its line. Without one the line is the accent."
918
+ }
919
+ ]
920
+ })]
921
+ })
922
+ ]
923
+ });
924
+ }
925
+ //#endregion
926
+ export { Page, Preview };