@orbitcommerce/constellation-docs 0.0.0-stage → 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.
- package/LICENSE.md +6 -0
- package/README.md +6 -2
- package/dist/docs.css +20787 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +308 -0
- package/dist/pages/Playground-Mk1yIWXb.js +129 -0
- package/dist/pages/_address-data-L9BR499w.js +161 -0
- package/dist/pages/_builder-demo-C0eJUmPU.js +282 -0
- package/dist/pages/_card-art-0be5ncyV.js +18 -0
- package/dist/pages/_conversation-samples-Bq7cn-4d.js +70 -0
- package/dist/pages/_figures-data-DaDvB7Nm.js +606 -0
- package/dist/pages/_foundations-blXWyYh8.js +30 -0
- package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
- package/dist/pages/_overlays-specimens-bawR331Z.js +320 -0
- package/dist/pages/_preview-specimens-DKQC9HAo.js +153 -0
- package/dist/pages/accordion-Sg0TUqxB.js +1036 -0
- package/dist/pages/address-autocomplete-DP0PUOlK.js +360 -0
- package/dist/pages/address-block-BZOOOPA9.js +368 -0
- package/dist/pages/address-fields-CwSqro3W.js +277 -0
- package/dist/pages/ai-highlight-D3x2vD83.js +642 -0
- package/dist/pages/alert-D3i7xZTU.js +914 -0
- package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
- package/dist/pages/app-shell-D4hdlHps.js +1558 -0
- package/dist/pages/area-chart-BEWFwiB2.js +718 -0
- package/dist/pages/avatar-BFEqQViw.js +895 -0
- package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
- package/dist/pages/badge-0-PyMrih.js +1035 -0
- package/dist/pages/bar-chart-DkLogYlt.js +1060 -0
- package/dist/pages/bar-fold-B-3XeIDZ.js +360 -0
- package/dist/pages/board-card-D2tZY_mU.js +415 -0
- package/dist/pages/brand-mark-BqiLvFSR.js +417 -0
- package/dist/pages/button-DAyfssDY.js +715 -0
- package/dist/pages/calendar-Ds7KsgSI.js +682 -0
- package/dist/pages/canvas-stage-1KiPspkX.js +472 -0
- package/dist/pages/card-CQEM1_wc.js +1567 -0
- package/dist/pages/caret-suggestions-oHI6QvqW.js +526 -0
- package/dist/pages/chart-legend-B20AbakD.js +724 -0
- package/dist/pages/chat-composer-CwzUJYIa.js +437 -0
- package/dist/pages/checkbox-BG9Zkb6j.js +1581 -0
- package/dist/pages/checklist-card-DEyykVFS.js +783 -0
- package/dist/pages/chip-Ck-o3Ui6.js +839 -0
- package/dist/pages/chip-list-k1LxXuCi.js +414 -0
- package/dist/pages/clamp-text-n-iE8RDR.js +203 -0
- package/dist/pages/coachmark-Be2ghobT.js +366 -0
- package/dist/pages/code-block-Dv_Y5GYq.js +622 -0
- package/dist/pages/collab-field-CfqqK7d2.js +696 -0
- package/dist/pages/color-field-CZpfcA-A.js +1127 -0
- package/dist/pages/colour-q2ntvI0w.js +1974 -0
- package/dist/pages/column-mapper-TsTG39cl.js +502 -0
- package/dist/pages/combobox-DvK2j5tI.js +1334 -0
- package/dist/pages/command-palette-CJ7uBA04.js +1386 -0
- package/dist/pages/comment-box-CDSGYhr5.js +346 -0
- package/dist/pages/composer-D4B0NgpA.js +689 -0
- package/dist/pages/condition-builder-BZy2ZGXe.js +715 -0
- package/dist/pages/conflict-chooser-C--_9UIS.js +210 -0
- package/dist/pages/context-menu-F9DV30ia.js +487 -0
- package/dist/pages/copy-button-Cn7WiKRF.js +568 -0
- package/dist/pages/copy-field-D3Xt3Jq6.js +511 -0
- package/dist/pages/danger-zone-Db_UUeiP.js +564 -0
- package/dist/pages/date-input-GOW067EB.js +956 -0
- package/dist/pages/date-picker-GdBciR99.js +1569 -0
- package/dist/pages/date-time-BLKCXtVZ.js +678 -0
- package/dist/pages/delta-CNAGv8JY.js +779 -0
- package/dist/pages/description-list-BPeXn1eW.js +1268 -0
- package/dist/pages/device-switcher-BCaN99c1.js +554 -0
- package/dist/pages/dialog-CRpkRC98.js +3164 -0
- package/dist/pages/docs-lM2UBSir.js +520 -0
- package/dist/pages/doodle-nzkqi2UI.js +201 -0
- package/dist/pages/drag-ghost-B6kpzC3O.js +426 -0
- package/dist/pages/drill-menu-cskH5mol.js +490 -0
- package/dist/pages/dropzone-DOY_Rhw0.js +1069 -0
- package/dist/pages/element-toolbar-DZIhXlCJ.js +498 -0
- package/dist/pages/emoji-picker-CqaWaffD.js +235 -0
- package/dist/pages/empty-state-4U2txFpI.js +1113 -0
- package/dist/pages/facet-filters-McbBeY9e.js +353 -0
- package/dist/pages/figure-D-HF5vCj.js +563 -0
- package/dist/pages/figure-strip-BB3mNl7D.js +1364 -0
- package/dist/pages/figure-tabs-QOeQMY6N.js +578 -0
- package/dist/pages/file-chip-DMDjtlqQ.js +738 -0
- package/dist/pages/filter-pill-DzqNOsD4.js +1295 -0
- package/dist/pages/font-picker-Bqhu0QMh.js +416 -0
- package/dist/pages/form-grid-BfWCVlie.js +692 -0
- package/dist/pages/gallery-BBk2EOri.js +453 -0
- package/dist/pages/gif-picker-CnoDTCaL.js +270 -0
- package/dist/pages/gradient-editor-Bqxp7Fxj.js +378 -0
- package/dist/pages/grouped-checklist-gNZ0tBKU.js +477 -0
- package/dist/pages/heatmap-BohgIcNk.js +507 -0
- package/dist/pages/highlight-text-BfxzfmvS.js +287 -0
- package/dist/pages/home-dashboard-CxPmvduE.js +962 -0
- package/dist/pages/host-B6znjEgQ.js +109 -0
- package/dist/pages/hosted-embed-Jef3aIMP.js +163 -0
- package/dist/pages/hosted-field-BLh-53AE.js +208 -0
- package/dist/pages/hosted-field-DEpI4lVS.js +514 -0
- package/dist/pages/icon-button-Bu4Gj5sy.js +1200 -0
- package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
- package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
- package/dist/pages/icons-CJ9Aar3d.js +736 -0
- package/dist/pages/image-cropper-NyougqLH.js +466 -0
- package/dist/pages/image-field-7knBv4mJ.js +567 -0
- package/dist/pages/import-result-CmTtGXW_.js +486 -0
- package/dist/pages/inline-confirm-CEcI5Lxo.js +327 -0
- package/dist/pages/inline-edit-Ba39SzhM.js +1125 -0
- package/dist/pages/input-CzLCzfyx.js +2372 -0
- package/dist/pages/installation-C3UcpQJT.js +528 -0
- package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
- package/dist/pages/kanban-Dy9sPAI0.js +740 -0
- package/dist/pages/kbd-UNj4zqxn.js +545 -0
- package/dist/pages/layout-primitives-CPRaZeyt.js +483 -0
- package/dist/pages/line-chart-CntWxeMF.js +1117 -0
- package/dist/pages/link-CXqvAg9z.js +689 -0
- package/dist/pages/link-picker-BMFGCC67.js +478 -0
- package/dist/pages/link-row-x8yaUuWc.js +595 -0
- package/dist/pages/live-globe-95ROMhGQ.js +715 -0
- package/dist/pages/loading-overlay-BeGuXM9G.js +456 -0
- package/dist/pages/loading-state-BNbCo51C.js +556 -0
- package/dist/pages/log-viewer-BQz8I_a2.js +503 -0
- package/dist/pages/logo-B38rnzoq.js +571 -0
- package/dist/pages/lottie_light-CxEH8eiR.js +9116 -0
- package/dist/pages/markdown-Ied72vMT.js +237 -0
- package/dist/pages/markdown-field-BfnIEKZH.js +193 -0
- package/dist/pages/media-banner-DkStCia0.js +233 -0
- package/dist/pages/menu-NrLYKqKp.js +2132 -0
- package/dist/pages/message-thread-Bo4zbxqu.js +731 -0
- package/dist/pages/meta-line-D5p2TycR.js +371 -0
- package/dist/pages/model-viewer-BfokvHoc.js +60288 -0
- package/dist/pages/model-viewer-C8PFO8wk.js +577 -0
- package/dist/pages/month-calendar-T1vw9Rup.js +457 -0
- package/dist/pages/motion-CrXtiBvA.js +865 -0
- package/dist/pages/number-input-CuyMZg18.js +968 -0
- package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
- package/dist/pages/orbit-spinner-Dxv5qAhr.js +348 -0
- package/dist/pages/otp-input-CVRoX1mw.js +591 -0
- package/dist/pages/overview-LA9XRhZc.js +130 -0
- package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
- package/dist/pages/pagination-C1EgVtW4.js +294 -0
- package/dist/pages/palette-tile-X9ZXu2Z0.js +414 -0
- package/dist/pages/password-field-DHEQKyUC.js +912 -0
- package/dist/pages/person-cell-BmjbADBz.js +564 -0
- package/dist/pages/phone-input-B3G7Qpb2.js +747 -0
- package/dist/pages/plan-card-DRaA6RuB.js +621 -0
- package/dist/pages/plan-card-DtloWvMh.js +258 -0
- package/dist/pages/plan-comparison-BVIGTtbd.js +559 -0
- package/dist/pages/plan-grid-cfPVTB5V.js +251 -0
- package/dist/pages/point-list-BbPmZjsm.js +222 -0
- package/dist/pages/popover-C3Oar9D5.js +1198 -0
- package/dist/pages/presence-avatars-CRZIk8n9.js +328 -0
- package/dist/pages/preview-frame-Bcwk0y_Q.js +1631 -0
- package/dist/pages/price-CRBLoa9h.js +604 -0
- package/dist/pages/principles-pnDyfHpK.js +483 -0
- package/dist/pages/print-page-BkLv6bW8.js +513 -0
- package/dist/pages/profile-hero-CC9dUzuN.js +498 -0
- package/dist/pages/progress-CP_awmo4.js +904 -0
- package/dist/pages/progress-ring-JuOAwk2T.js +576 -0
- package/dist/pages/radio-group-C-4tg6FS.js +1639 -0
- package/dist/pages/radius-control-B2kRA2Ch.js +441 -0
- package/dist/pages/rating-CweKN2SX.js +471 -0
- package/dist/pages/record-layout-DUP_X0RL.js +719 -0
- package/dist/pages/record-pager-y9D7JFgb.js +278 -0
- package/dist/pages/registry-BZg-xAbi.js +594 -0
- package/dist/pages/release-Cs6tl16C.js +16 -0
- package/dist/pages/repeater-BRZYKRQa.js +1351 -0
- package/dist/pages/reply-feedback-BDnHprla.js +192 -0
- package/dist/pages/reveal-BygENBbL.js +460 -0
- package/dist/pages/rich-text-DOFQZEpT.js +156 -0
- package/dist/pages/rich-text-editor-BhIM20JI.js +1265 -0
- package/dist/pages/rolldown-runtime-CbKu08Hx.js +25 -0
- package/dist/pages/rolling-number-GR3Cyfpz.js +529 -0
- package/dist/pages/row-list-Dl6CYhC-.js +1565 -0
- package/dist/pages/rule-list-DTCmIMpT.js +648 -0
- package/dist/pages/save-status-B5KkyMZP.js +378 -0
- package/dist/pages/schedule-YycI95O1.js +243 -0
- package/dist/pages/scroll-area-B2sGm23Q.js +423 -0
- package/dist/pages/search-field-D1uG7R6A.js +693 -0
- package/dist/pages/search-menu-DMuXyUUW.js +580 -0
- package/dist/pages/secret-field-Dj9x3LL8.js +337 -0
- package/dist/pages/section-rail-BtTCETS5.js +637 -0
- package/dist/pages/section-v2Pubup9.js +639 -0
- package/dist/pages/segmented-control-D-FB1K1T.js +1190 -0
- package/dist/pages/select-DZ43NpOm.js +1434 -0
- package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
- package/dist/pages/separator-CFwqRvfO.js +428 -0
- package/dist/pages/serp-preview-BGwORjmo.js +346 -0
- package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
- package/dist/pages/shape-DzniHAVT.js +627 -0
- package/dist/pages/share-list-D4wgBxKN.js +926 -0
- package/dist/pages/side-panel-CCtkrZjs.js +811 -0
- package/dist/pages/site-preview-Dj1hM2Yo.js +353 -0
- package/dist/pages/skeleton-C1F5HkAu.js +1325 -0
- package/dist/pages/skip-link-BxznhSkz.js +252 -0
- package/dist/pages/slider-CAoPURKD.js +774 -0
- package/dist/pages/sortable-card-Sr44uCpI.js +424 -0
- package/dist/pages/sortable-list-DUAleYE1.js +1298 -0
- package/dist/pages/sortable-tree-BLzK-hTE.js +737 -0
- package/dist/pages/spacing-box-CtuvzxQu.js +550 -0
- package/dist/pages/sparkline-D3aavCly.js +947 -0
- package/dist/pages/split-bar-DYgZnFID.js +414 -0
- package/dist/pages/split-button-Be08-VI-.js +335 -0
- package/dist/pages/split-pane-lSNZgTKt.js +523 -0
- package/dist/pages/status-badge-DOdNhmzn.js +1074 -0
- package/dist/pages/status-checklist-CWkjCZIC.js +1152 -0
- package/dist/pages/status-dot-D99gAGsV.js +567 -0
- package/dist/pages/stepper-CxKTbEA-.js +1093 -0
- package/dist/pages/success-mark-CqFTOBEu.js +142 -0
- package/dist/pages/swatch-H_kNvHuC.js +565 -0
- package/dist/pages/switch-C93K6j9h.js +617 -0
- package/dist/pages/table-CL0vomno.js +3225 -0
- package/dist/pages/tabs-Dh0mUsLw.js +1690 -0
- package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
- package/dist/pages/task-card-Dv0sR1-w.js +295 -0
- package/dist/pages/textarea-CCM-SnGN.js +949 -0
- package/dist/pages/thumbnail-DwFJL_k1.js +1147 -0
- package/dist/pages/time-input-CA9-uZAa.js +442 -0
- package/dist/pages/time-zone-select-CEtMXVYO.js +296 -0
- package/dist/pages/timeline-BsMUTlpR.js +1798 -0
- package/dist/pages/toast-zXLRiMRT.js +1391 -0
- package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
- package/dist/pages/toolbar-B9l_fHKy.js +754 -0
- package/dist/pages/tooltip-LHtCUkF-.js +826 -0
- package/dist/pages/translation-field-CTRXiF2N.js +251 -0
- package/dist/pages/tree-checklist-CJj3OcLg.js +451 -0
- package/dist/pages/tree-select-DU1qXHy_.js +492 -0
- package/dist/pages/tree-view-g_RjLtAb.js +739 -0
- package/dist/pages/typography-BSijtiRl.js +876 -0
- package/dist/pages/unit-input-Dml4fjmK.js +659 -0
- package/dist/pages/upload-rules-yozEzSah.js +419 -0
- package/dist/pages/url-upload-input-SSnMgfpA.js +307 -0
- package/dist/pages/value-change-CnubDKyO.js +489 -0
- package/dist/pages/weekly-hours-i2EpsmTx.js +287 -0
- package/dist/pages/widget-preview-CUJMyZ_k.js +625 -0
- package/dist/pages/working-status-CENemSsw.js +389 -0
- package/manifest.json +13001 -0
- package/package.json +35 -4
|
@@ -0,0 +1,1364 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as DocLink } from "./host-B6znjEgQ.js";
|
|
3
|
+
import { a as DocTable, d as Section$1, i as DocPage, l as Note, m as ThemePair, n as CodeBlock$1, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
4
|
+
import { n as SupplierMetrics, r as SupplierMetricsLoading } from "./_kpi-examples-DeGCBB9T.js";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Button, Card, Delta, FigureStrip, RollingNumber, SegmentedControl, Sparkline } from "@orbitcommerce/constellation";
|
|
8
|
+
import { ArrowRightIcon, ShoppingBagIcon, StorefrontIcon, UsersIcon } from "@orbitcommerce/constellation/icons";
|
|
9
|
+
//#region src/pages/components/figure-strip.tsx
|
|
10
|
+
var GBP = {
|
|
11
|
+
style: "currency",
|
|
12
|
+
currency: "GBP"
|
|
13
|
+
};
|
|
14
|
+
/** A trading month, as the analytics page of an invented furniture shop: four headline figures. */
|
|
15
|
+
var HEADLINES = [
|
|
16
|
+
{
|
|
17
|
+
key: "sales",
|
|
18
|
+
label: "Gross sales",
|
|
19
|
+
value: /* @__PURE__ */ jsx(RollingNumber, {
|
|
20
|
+
value: 2630.5,
|
|
21
|
+
format: GBP
|
|
22
|
+
}),
|
|
23
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
24
|
+
value: 12.4,
|
|
25
|
+
size: "sm"
|
|
26
|
+
}),
|
|
27
|
+
hint: "vs previous period"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: "orders",
|
|
31
|
+
label: "Orders",
|
|
32
|
+
value: /* @__PURE__ */ jsx(RollingNumber, {
|
|
33
|
+
value: 38,
|
|
34
|
+
format: { maximumFractionDigits: 0 }
|
|
35
|
+
}),
|
|
36
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
37
|
+
value: 8.6,
|
|
38
|
+
size: "sm"
|
|
39
|
+
}),
|
|
40
|
+
hint: "vs previous period"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: "aov",
|
|
44
|
+
label: "Average order value",
|
|
45
|
+
value: /* @__PURE__ */ jsx(RollingNumber, {
|
|
46
|
+
value: 71.77,
|
|
47
|
+
format: GBP
|
|
48
|
+
}),
|
|
49
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
50
|
+
value: -6.4,
|
|
51
|
+
size: "sm"
|
|
52
|
+
}),
|
|
53
|
+
hint: "vs previous period"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: "returning",
|
|
57
|
+
label: "Returning customers",
|
|
58
|
+
value: "66.7%",
|
|
59
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
60
|
+
value: -3.3,
|
|
61
|
+
size: "sm"
|
|
62
|
+
}),
|
|
63
|
+
hint: "vs previous period"
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
function Preview() {
|
|
67
|
+
return /* @__PURE__ */ jsx(FigureStrip, {
|
|
68
|
+
"aria-label": "Headline figures",
|
|
69
|
+
columns: 2,
|
|
70
|
+
style: { width: 219 },
|
|
71
|
+
items: [{
|
|
72
|
+
key: "sales",
|
|
73
|
+
label: "Sales",
|
|
74
|
+
value: "£2,630",
|
|
75
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
76
|
+
value: 12.4,
|
|
77
|
+
size: "sm"
|
|
78
|
+
})
|
|
79
|
+
}, {
|
|
80
|
+
key: "orders",
|
|
81
|
+
label: "Orders",
|
|
82
|
+
value: "38",
|
|
83
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
84
|
+
value: -4.2,
|
|
85
|
+
size: "sm"
|
|
86
|
+
})
|
|
87
|
+
}]
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/** A strip in a container of a chosen width, to see it fold by the container and not the window. */
|
|
91
|
+
function Narrowing() {
|
|
92
|
+
const [width, setWidth] = useState("wide");
|
|
93
|
+
const px = {
|
|
94
|
+
wide: "100%",
|
|
95
|
+
medium: "700px",
|
|
96
|
+
narrow: "540px",
|
|
97
|
+
phone: "360px"
|
|
98
|
+
}[width];
|
|
99
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
100
|
+
className: "figure-strip-demo",
|
|
101
|
+
children: [/* @__PURE__ */ jsx(SegmentedControl, {
|
|
102
|
+
"aria-label": "Container width",
|
|
103
|
+
size: "sm",
|
|
104
|
+
value: width,
|
|
105
|
+
onValueChange: setWidth,
|
|
106
|
+
options: [
|
|
107
|
+
{
|
|
108
|
+
value: "wide",
|
|
109
|
+
label: "Wide"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
value: "medium",
|
|
113
|
+
label: "700px"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
value: "narrow",
|
|
117
|
+
label: "540px"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
value: "phone",
|
|
121
|
+
label: "360px"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
125
|
+
className: "figure-strip-demo__frame",
|
|
126
|
+
style: { width: px },
|
|
127
|
+
children: [/* @__PURE__ */ jsx(FigureStrip, {
|
|
128
|
+
"aria-label": "Four across",
|
|
129
|
+
columns: 4,
|
|
130
|
+
items: HEADLINES.map(({ hint: _hint, ...rest }) => rest)
|
|
131
|
+
}), /* @__PURE__ */ jsx(FigureStrip, {
|
|
132
|
+
"aria-label": "Three across",
|
|
133
|
+
columns: 3,
|
|
134
|
+
items: HEADLINES.slice(0, 3).map(({ hint: _hint, change: _change, ...rest }) => rest)
|
|
135
|
+
})]
|
|
136
|
+
})]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/** A feed run's detail and a month of orders, as a supplier sees them: short counts, five and six across. */
|
|
140
|
+
var RUN = [
|
|
141
|
+
{
|
|
142
|
+
key: "total",
|
|
143
|
+
label: "Total rows",
|
|
144
|
+
value: "1,204"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
key: "matched",
|
|
148
|
+
label: "Matched",
|
|
149
|
+
value: "1,180"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
key: "updated",
|
|
153
|
+
label: "Updated",
|
|
154
|
+
value: "312",
|
|
155
|
+
tone: "positive"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: "skipped",
|
|
159
|
+
label: "Skipped",
|
|
160
|
+
value: "868",
|
|
161
|
+
quiet: true
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
key: "failed",
|
|
165
|
+
label: "Failed",
|
|
166
|
+
value: "24",
|
|
167
|
+
tone: "negative"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
key: "duration",
|
|
171
|
+
label: "Duration",
|
|
172
|
+
value: "2m 14s"
|
|
173
|
+
}
|
|
174
|
+
];
|
|
175
|
+
var PERFORMANCE = [
|
|
176
|
+
{
|
|
177
|
+
key: "orders",
|
|
178
|
+
label: "Orders",
|
|
179
|
+
value: "186"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
key: "dispatched",
|
|
183
|
+
label: "Dispatched",
|
|
184
|
+
value: "171"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
key: "dispatch",
|
|
188
|
+
label: "Average dispatch",
|
|
189
|
+
value: "1.4 days"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
key: "late",
|
|
193
|
+
label: "Late",
|
|
194
|
+
value: "6",
|
|
195
|
+
tone: "warning"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
key: "cancelled",
|
|
199
|
+
label: "Cancelled",
|
|
200
|
+
value: "3"
|
|
201
|
+
}
|
|
202
|
+
];
|
|
203
|
+
/** Five and six across in a container of a chosen width, to see them fold to three and then two. */
|
|
204
|
+
function ManyAcross() {
|
|
205
|
+
const [width, setWidth] = useState("wide");
|
|
206
|
+
const px = {
|
|
207
|
+
wide: "960px",
|
|
208
|
+
medium: "820px",
|
|
209
|
+
narrow: "680px",
|
|
210
|
+
phone: "360px"
|
|
211
|
+
}[width];
|
|
212
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
213
|
+
className: "figure-strip-demo",
|
|
214
|
+
children: [/* @__PURE__ */ jsx(SegmentedControl, {
|
|
215
|
+
"aria-label": "Container width",
|
|
216
|
+
size: "sm",
|
|
217
|
+
value: width,
|
|
218
|
+
onValueChange: setWidth,
|
|
219
|
+
options: [
|
|
220
|
+
{
|
|
221
|
+
value: "wide",
|
|
222
|
+
label: "960px"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
value: "medium",
|
|
226
|
+
label: "820px"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
value: "narrow",
|
|
230
|
+
label: "680px"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
value: "phone",
|
|
234
|
+
label: "360px"
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
238
|
+
className: "figure-strip-demo__scroll",
|
|
239
|
+
role: "region",
|
|
240
|
+
"aria-label": "Strips at the chosen width",
|
|
241
|
+
tabIndex: 0,
|
|
242
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
243
|
+
className: "figure-strip-demo__frame",
|
|
244
|
+
style: { width: px },
|
|
245
|
+
children: [/* @__PURE__ */ jsx(FigureStrip, {
|
|
246
|
+
"aria-label": "Feed run",
|
|
247
|
+
columns: 6,
|
|
248
|
+
items: RUN
|
|
249
|
+
}), /* @__PURE__ */ jsx(FigureStrip, {
|
|
250
|
+
"aria-label": "Orders this month",
|
|
251
|
+
columns: 5,
|
|
252
|
+
items: PERFORMANCE
|
|
253
|
+
})]
|
|
254
|
+
})
|
|
255
|
+
})]
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
var STAGES = [
|
|
259
|
+
{
|
|
260
|
+
key: "trial",
|
|
261
|
+
label: "Trial",
|
|
262
|
+
value: "12",
|
|
263
|
+
hint: "3 ending in 3 days"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
key: "paying",
|
|
267
|
+
label: "Paying",
|
|
268
|
+
value: "48",
|
|
269
|
+
tone: "positive",
|
|
270
|
+
hint: "£3,120 a month"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
key: "issues",
|
|
274
|
+
label: "Payment issues",
|
|
275
|
+
value: "4",
|
|
276
|
+
tone: "warning"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
key: "dead",
|
|
280
|
+
label: "Dead zone",
|
|
281
|
+
value: "0",
|
|
282
|
+
quiet: true
|
|
283
|
+
}
|
|
284
|
+
];
|
|
285
|
+
function StageFilter() {
|
|
286
|
+
const [active, setActive] = useState("paying");
|
|
287
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
288
|
+
className: "figure-strip-demo",
|
|
289
|
+
children: [/* @__PURE__ */ jsx(FigureStrip, {
|
|
290
|
+
"aria-label": "Merchants by stage",
|
|
291
|
+
items: STAGES,
|
|
292
|
+
active,
|
|
293
|
+
onSelect: (key) => setActive((now) => now === key ? null : key)
|
|
294
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
295
|
+
className: "figure-strip-demo__readout",
|
|
296
|
+
children: active ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
297
|
+
"The list below is filtered to ",
|
|
298
|
+
/* @__PURE__ */ jsx("strong", { children: STAGES.find((s) => s.key === active)?.label.toLowerCase() }),
|
|
299
|
+
". Press it again to clear."
|
|
300
|
+
] }) : "The list below shows every merchant."
|
|
301
|
+
})]
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
var COMPLIANCE = [
|
|
305
|
+
{
|
|
306
|
+
key: "critical",
|
|
307
|
+
label: "Critical",
|
|
308
|
+
value: "3",
|
|
309
|
+
tone: "negative"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
key: "urgent",
|
|
313
|
+
label: "Urgent",
|
|
314
|
+
value: "7",
|
|
315
|
+
tone: "warning"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
key: "warning",
|
|
319
|
+
label: "Warning",
|
|
320
|
+
value: "12"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
key: "stalled",
|
|
324
|
+
label: "Not warned",
|
|
325
|
+
value: "41",
|
|
326
|
+
selectable: false
|
|
327
|
+
}
|
|
328
|
+
];
|
|
329
|
+
/** Three figures that filter and one that is only a count. */
|
|
330
|
+
function MixedFilter() {
|
|
331
|
+
const [active, setActive] = useState("urgent");
|
|
332
|
+
return /* @__PURE__ */ jsx("div", {
|
|
333
|
+
className: "figure-strip-demo",
|
|
334
|
+
children: /* @__PURE__ */ jsx(FigureStrip, {
|
|
335
|
+
"aria-label": "Merchants by compliance",
|
|
336
|
+
items: COMPLIANCE,
|
|
337
|
+
active,
|
|
338
|
+
onSelect: (key) => setActive((now) => now === key ? null : key)
|
|
339
|
+
})
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
var QUEUE = [
|
|
343
|
+
{
|
|
344
|
+
key: "open",
|
|
345
|
+
label: "Open",
|
|
346
|
+
value: "14",
|
|
347
|
+
hint: "3 late",
|
|
348
|
+
href: "#links",
|
|
349
|
+
tone: "warning"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
key: "waiting",
|
|
353
|
+
label: "Waiting on customer",
|
|
354
|
+
value: "6",
|
|
355
|
+
href: "#links"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
key: "solved",
|
|
359
|
+
label: "Solved this week",
|
|
360
|
+
value: "212",
|
|
361
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
362
|
+
value: 4.1,
|
|
363
|
+
size: "sm"
|
|
364
|
+
}),
|
|
365
|
+
href: "#links"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
key: "all",
|
|
369
|
+
label: "All time",
|
|
370
|
+
value: "2,481"
|
|
371
|
+
}
|
|
372
|
+
];
|
|
373
|
+
function LoadingDemo() {
|
|
374
|
+
const [state, setState] = useState("loading");
|
|
375
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
376
|
+
className: "figure-strip-demo",
|
|
377
|
+
children: [/* @__PURE__ */ jsx(SegmentedControl, {
|
|
378
|
+
"aria-label": "State",
|
|
379
|
+
size: "sm",
|
|
380
|
+
value: state,
|
|
381
|
+
onValueChange: setState,
|
|
382
|
+
options: [{
|
|
383
|
+
value: "loading",
|
|
384
|
+
label: "Loading"
|
|
385
|
+
}, {
|
|
386
|
+
value: "loaded",
|
|
387
|
+
label: "Loaded"
|
|
388
|
+
}]
|
|
389
|
+
}), /* @__PURE__ */ jsx(FigureStrip, {
|
|
390
|
+
"aria-label": "Headline figures",
|
|
391
|
+
items: HEADLINES,
|
|
392
|
+
loading: state === "loading"
|
|
393
|
+
})]
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
function Matrix() {
|
|
397
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
398
|
+
className: "figure-strip-pair",
|
|
399
|
+
children: [
|
|
400
|
+
/* @__PURE__ */ jsx(FigureStrip, {
|
|
401
|
+
"aria-label": "Headline figures",
|
|
402
|
+
items: HEADLINES
|
|
403
|
+
}),
|
|
404
|
+
/* @__PURE__ */ jsx(FigureStrip, {
|
|
405
|
+
"aria-label": "Merchant counts",
|
|
406
|
+
layout: "inline",
|
|
407
|
+
items: [
|
|
408
|
+
{
|
|
409
|
+
key: "orders",
|
|
410
|
+
label: "Orders",
|
|
411
|
+
value: "38"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
key: "spent",
|
|
415
|
+
label: "Lifetime value",
|
|
416
|
+
value: "£2,630.50"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
key: "last",
|
|
420
|
+
label: "Last order",
|
|
421
|
+
value: "6 Oct 2026"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
key: "returns",
|
|
425
|
+
label: "Returns",
|
|
426
|
+
value: "0",
|
|
427
|
+
quiet: true
|
|
428
|
+
}
|
|
429
|
+
]
|
|
430
|
+
}),
|
|
431
|
+
/* @__PURE__ */ jsx(FigureStrip, {
|
|
432
|
+
"aria-label": "Merchant stages",
|
|
433
|
+
columns: 4,
|
|
434
|
+
items: STAGES,
|
|
435
|
+
active: "paying",
|
|
436
|
+
onSelect: () => {}
|
|
437
|
+
}),
|
|
438
|
+
/* @__PURE__ */ jsx(FigureStrip, {
|
|
439
|
+
"aria-label": "Support queue",
|
|
440
|
+
columns: 4,
|
|
441
|
+
items: QUEUE
|
|
442
|
+
})
|
|
443
|
+
]
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
var code = (value) => /* @__PURE__ */ jsx("code", { children: value });
|
|
447
|
+
var Tile = ({ children }) => /* @__PURE__ */ jsx("div", {
|
|
448
|
+
className: "figure-strip-dodont",
|
|
449
|
+
children
|
|
450
|
+
});
|
|
451
|
+
function Page() {
|
|
452
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
453
|
+
title: "Figure strip",
|
|
454
|
+
status: "new",
|
|
455
|
+
importNames: ["FigureStrip"],
|
|
456
|
+
lead: "Headline figures on a hairline, read-only: a quiet label over a Sora figure, how it moved, and a line of context. The place a page's key numbers go, under its head. No cards.",
|
|
457
|
+
children: [
|
|
458
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
459
|
+
id: "basics",
|
|
460
|
+
title: "Basics",
|
|
461
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
462
|
+
"Give it ",
|
|
463
|
+
/* @__PURE__ */ jsx("code", { children: "items" }),
|
|
464
|
+
". Each has a ",
|
|
465
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
466
|
+
" and a ",
|
|
467
|
+
/* @__PURE__ */ jsx("code", { children: "value" }),
|
|
468
|
+
", already formatted, so a figure can be a string or a ",
|
|
469
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
470
|
+
to: "/components/rolling-number",
|
|
471
|
+
children: "RollingNumber"
|
|
472
|
+
}),
|
|
473
|
+
" that rolls like a till. Add a",
|
|
474
|
+
" ",
|
|
475
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
476
|
+
to: "/components/delta",
|
|
477
|
+
children: "Delta"
|
|
478
|
+
}),
|
|
479
|
+
" as ",
|
|
480
|
+
/* @__PURE__ */ jsx("code", { children: "change" }),
|
|
481
|
+
" and a quiet ",
|
|
482
|
+
/* @__PURE__ */ jsx("code", { children: "hint" }),
|
|
483
|
+
" after it. The strip is the same figures as ",
|
|
484
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
485
|
+
to: "/components/figure-tabs",
|
|
486
|
+
children: "Figure tabs"
|
|
487
|
+
}),
|
|
488
|
+
", without the tabs."
|
|
489
|
+
] }),
|
|
490
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
491
|
+
align: "fill",
|
|
492
|
+
code: `
|
|
493
|
+
<FigureStrip
|
|
494
|
+
aria-label="Headline figures"
|
|
495
|
+
items={[
|
|
496
|
+
{
|
|
497
|
+
key: 'sales',
|
|
498
|
+
label: 'Gross sales',
|
|
499
|
+
value: <RollingNumber value={2630.5} format={GBP} />,
|
|
500
|
+
change: <Delta value={12.4} size="sm" />,
|
|
501
|
+
hint: 'vs previous period',
|
|
502
|
+
},
|
|
503
|
+
{ key: 'orders', label: 'Orders', value: <RollingNumber value={38} format={WHOLE} />, change: <Delta value={8.6} size="sm" />, hint: 'vs previous period' },
|
|
504
|
+
{ key: 'aov', label: 'Average order value', value: <RollingNumber value={71.77} format={GBP} />, change: <Delta value={-6.4} size="sm" />, hint: 'vs previous period' },
|
|
505
|
+
{ key: 'returning', label: 'Returning customers', value: '66.7%', change: <Delta value={-3.3} size="sm" />, hint: 'vs previous period' },
|
|
506
|
+
]}
|
|
507
|
+
/>`,
|
|
508
|
+
children: /* @__PURE__ */ jsx(FigureStrip, {
|
|
509
|
+
"aria-label": "Headline figures",
|
|
510
|
+
items: HEADLINES
|
|
511
|
+
})
|
|
512
|
+
}), /* @__PURE__ */ jsxs(Note, {
|
|
513
|
+
title: "Money and numbers are the caller's",
|
|
514
|
+
children: [
|
|
515
|
+
"The strip does not format anything. Pass the text, or a ",
|
|
516
|
+
/* @__PURE__ */ jsx("code", { children: "RollingNumber" }),
|
|
517
|
+
" with the currency and locale you want, and write a deduction with a true minus (−£4.20), never a hyphen."
|
|
518
|
+
]
|
|
519
|
+
})]
|
|
520
|
+
}),
|
|
521
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
522
|
+
id: "columns",
|
|
523
|
+
title: "Columns",
|
|
524
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
525
|
+
/* @__PURE__ */ jsx("code", { children: "columns=\"auto\"" }),
|
|
526
|
+
" (the default) puts one figure in each column up to four, three across for five or six, and four across beyond, so the rows come out even. Ask for ",
|
|
527
|
+
/* @__PURE__ */ jsx("code", { children: "2" }),
|
|
528
|
+
", ",
|
|
529
|
+
/* @__PURE__ */ jsx("code", { children: "3" }),
|
|
530
|
+
" or ",
|
|
531
|
+
/* @__PURE__ */ jsx("code", { children: "4" }),
|
|
532
|
+
" to choose. A strip folds by the width of ",
|
|
533
|
+
/* @__PURE__ */ jsx("em", { children: "its own container" }),
|
|
534
|
+
", not the window: four across folds to two rows of two at 804px or less, three at 603px or less, and every strip tightens at 600px or less. A hairline closes every row that has another below it, folded or not. A docked panel narrows a strip the way a phone does. Change the width below."
|
|
535
|
+
] }),
|
|
536
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
537
|
+
align: "fill",
|
|
538
|
+
code: `
|
|
539
|
+
<FigureStrip columns={4} items={…} /> // 2 × 2 at 804px or less
|
|
540
|
+
<FigureStrip columns={3} items={…} /> // 2 + 1 at 603px or less
|
|
541
|
+
<FigureStrip items={…} /> // auto: as many as there are figures, up to four`,
|
|
542
|
+
children: /* @__PURE__ */ jsx(Narrowing, {})
|
|
543
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
544
|
+
title: "Five and six across",
|
|
545
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
546
|
+
"For a row of short counts (a feed run's rows, a month of orders by stage), ask for ",
|
|
547
|
+
/* @__PURE__ */ jsx("code", { children: "5" }),
|
|
548
|
+
" or",
|
|
549
|
+
" ",
|
|
550
|
+
/* @__PURE__ */ jsx("code", { children: "6" }),
|
|
551
|
+
"; ",
|
|
552
|
+
/* @__PURE__ */ jsx("code", { children: "auto" }),
|
|
553
|
+
" never chooses them. A cell may then be as narrow as 150px: six hold above 900px of strip and five above 750px. Narrower, both fold to three across, and to two at 603px or less, ruled under every row as the others are. Change the width."
|
|
554
|
+
] }),
|
|
555
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
556
|
+
align: "fill",
|
|
557
|
+
code: `
|
|
558
|
+
<FigureStrip columns={6} items={run} /> // 3 across at 900px or less, 2 at 603px
|
|
559
|
+
<FigureStrip columns={5} items={performance} /> // 3 across at 750px or less, 2 at 603px`,
|
|
560
|
+
children: /* @__PURE__ */ jsx(ManyAcross, {})
|
|
561
|
+
})
|
|
562
|
+
})]
|
|
563
|
+
}),
|
|
564
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
565
|
+
id: "layouts",
|
|
566
|
+
title: "Layout and size",
|
|
567
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
568
|
+
/* @__PURE__ */ jsx("code", { children: "grid" }),
|
|
569
|
+
" (default) is for the figures that head a page: columns on a hairline, a short rule between them.",
|
|
570
|
+
" ",
|
|
571
|
+
/* @__PURE__ */ jsx("code", { children: "inline" }),
|
|
572
|
+
" is for a record's hero or a row of counts: the figures sit side by side between two rules with no separators, and fold two across at 600px or less. The figure is 1.625rem (",
|
|
573
|
+
/* @__PURE__ */ jsx("code", { children: "md" }),
|
|
574
|
+
") or 1.3125rem (",
|
|
575
|
+
/* @__PURE__ */ jsx("code", { children: "sm" }),
|
|
576
|
+
"); an inline strip is ",
|
|
577
|
+
/* @__PURE__ */ jsx("code", { children: "sm" }),
|
|
578
|
+
" unless asked."
|
|
579
|
+
] }),
|
|
580
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
581
|
+
align: "fill",
|
|
582
|
+
code: `
|
|
583
|
+
<FigureStrip layout="inline" items={[
|
|
584
|
+
{ key: 'orders', label: 'Orders', value: '38' },
|
|
585
|
+
{ key: 'spent', label: 'Lifetime value', value: '£2,630.50' },
|
|
586
|
+
{ key: 'last', label: 'Last order', value: '6 Oct 2026' },
|
|
587
|
+
{ key: 'returns', label: 'Returns', value: '0', quiet: true },
|
|
588
|
+
]} />
|
|
589
|
+
|
|
590
|
+
<FigureStrip size="sm" columns={3} items={…} />`,
|
|
591
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
592
|
+
className: "figure-strip-pair",
|
|
593
|
+
children: [/* @__PURE__ */ jsx(FigureStrip, {
|
|
594
|
+
"aria-label": "Customer",
|
|
595
|
+
layout: "inline",
|
|
596
|
+
items: [
|
|
597
|
+
{
|
|
598
|
+
key: "orders",
|
|
599
|
+
label: "Orders",
|
|
600
|
+
value: "38"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
key: "spent",
|
|
604
|
+
label: "Lifetime value",
|
|
605
|
+
value: "£2,630.50"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
key: "last",
|
|
609
|
+
label: "Last order",
|
|
610
|
+
value: "6 Oct 2026"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
key: "returns",
|
|
614
|
+
label: "Returns",
|
|
615
|
+
value: "0",
|
|
616
|
+
quiet: true
|
|
617
|
+
}
|
|
618
|
+
]
|
|
619
|
+
}), /* @__PURE__ */ jsx(FigureStrip, {
|
|
620
|
+
"aria-label": "Counts",
|
|
621
|
+
size: "sm",
|
|
622
|
+
columns: 3,
|
|
623
|
+
items: [
|
|
624
|
+
{
|
|
625
|
+
key: "open",
|
|
626
|
+
label: "Open",
|
|
627
|
+
value: "14"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
key: "late",
|
|
631
|
+
label: "Late",
|
|
632
|
+
value: "3",
|
|
633
|
+
tone: "negative"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
key: "held",
|
|
637
|
+
label: "On hold",
|
|
638
|
+
value: "2"
|
|
639
|
+
}
|
|
640
|
+
]
|
|
641
|
+
})]
|
|
642
|
+
})
|
|
643
|
+
})
|
|
644
|
+
}),
|
|
645
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
646
|
+
id: "cells",
|
|
647
|
+
title: "Icon, dot, tone, quiet and an action",
|
|
648
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
649
|
+
"Most strips are words and figures, and that is the default. When a figure needs more, an ",
|
|
650
|
+
/* @__PURE__ */ jsx("code", { children: "item" }),
|
|
651
|
+
" takes an",
|
|
652
|
+
" ",
|
|
653
|
+
/* @__PURE__ */ jsx("code", { children: "icon" }),
|
|
654
|
+
" before the label, a ",
|
|
655
|
+
/* @__PURE__ */ jsx("code", { children: "dot" }),
|
|
656
|
+
" that ties it to a series or a column (a tone, or any colour), a",
|
|
657
|
+
" ",
|
|
658
|
+
/* @__PURE__ */ jsx("code", { children: "tone" }),
|
|
659
|
+
" for the one figure that needs chasing, ",
|
|
660
|
+
/* @__PURE__ */ jsx("code", { children: "quiet" }),
|
|
661
|
+
" for a figure with nothing to show, and an",
|
|
662
|
+
" ",
|
|
663
|
+
/* @__PURE__ */ jsx("code", { children: "action" }),
|
|
664
|
+
" after the figure: a small button, a sparkline."
|
|
665
|
+
] }),
|
|
666
|
+
children: [
|
|
667
|
+
/* @__PURE__ */ jsx(Example, {
|
|
668
|
+
align: "fill",
|
|
669
|
+
code: `
|
|
670
|
+
<FigureStrip columns={4} items={[
|
|
671
|
+
{ key: 'orders', label: 'Orders', icon: <ShoppingBagIcon />, value: '38', change: <Delta value={8.6} size="sm" /> },
|
|
672
|
+
{ key: 'late', label: 'Late', dot: 'negative', value: '3', tone: 'negative', hint: 'ship by today' },
|
|
673
|
+
{ key: 'trend', label: 'Sessions', icon: <UsersIcon />, value: '1,204',
|
|
674
|
+
action: <Sparkline data={[4, 6, 5, 9, 8, 12, 11, 15]} width={64} height={24} /> },
|
|
675
|
+
{ key: 'returns', label: 'Returns', dot: '#7c3aed', value: '0', quiet: true },
|
|
676
|
+
]} />`,
|
|
677
|
+
children: /* @__PURE__ */ jsx(FigureStrip, {
|
|
678
|
+
"aria-label": "Cells",
|
|
679
|
+
columns: 4,
|
|
680
|
+
items: [
|
|
681
|
+
{
|
|
682
|
+
key: "orders",
|
|
683
|
+
label: "Orders",
|
|
684
|
+
icon: /* @__PURE__ */ jsx(ShoppingBagIcon, {}),
|
|
685
|
+
value: "38",
|
|
686
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
687
|
+
value: 8.6,
|
|
688
|
+
size: "sm"
|
|
689
|
+
})
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
key: "late",
|
|
693
|
+
label: "Late",
|
|
694
|
+
dot: "negative",
|
|
695
|
+
value: "3",
|
|
696
|
+
tone: "negative",
|
|
697
|
+
hint: "ship by today"
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
key: "trend",
|
|
701
|
+
label: "Sessions",
|
|
702
|
+
icon: /* @__PURE__ */ jsx(UsersIcon, {}),
|
|
703
|
+
value: "1,204",
|
|
704
|
+
action: /* @__PURE__ */ jsx(Sparkline, {
|
|
705
|
+
data: [
|
|
706
|
+
4,
|
|
707
|
+
6,
|
|
708
|
+
5,
|
|
709
|
+
9,
|
|
710
|
+
8,
|
|
711
|
+
12,
|
|
712
|
+
11,
|
|
713
|
+
15
|
|
714
|
+
],
|
|
715
|
+
width: 64,
|
|
716
|
+
height: 24
|
|
717
|
+
})
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
key: "returns",
|
|
721
|
+
label: "Returns",
|
|
722
|
+
dot: "#7c3aed",
|
|
723
|
+
value: "0",
|
|
724
|
+
quiet: true
|
|
725
|
+
}
|
|
726
|
+
]
|
|
727
|
+
})
|
|
728
|
+
}),
|
|
729
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
730
|
+
title: "A trailing button",
|
|
731
|
+
description: /* @__PURE__ */ jsx("p", { children: "The action sits on the figure's row, after the value, for a way in to what the figure describes." }),
|
|
732
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
733
|
+
align: "fill",
|
|
734
|
+
code: `
|
|
735
|
+
<FigureStrip columns={3} items={[
|
|
736
|
+
{ key: 'theme', label: 'Theme', icon: <StorefrontIcon />, value: 'Arden',
|
|
737
|
+
action: <Button size="sm" variant="secondary" iconEnd={<ArrowRightIcon />}>Customise</Button> },
|
|
738
|
+
…
|
|
739
|
+
]} />`,
|
|
740
|
+
children: /* @__PURE__ */ jsx(FigureStrip, {
|
|
741
|
+
"aria-label": "Storefront",
|
|
742
|
+
columns: 3,
|
|
743
|
+
items: [
|
|
744
|
+
{
|
|
745
|
+
key: "theme",
|
|
746
|
+
label: "Theme",
|
|
747
|
+
icon: /* @__PURE__ */ jsx(StorefrontIcon, {}),
|
|
748
|
+
value: "Arden",
|
|
749
|
+
action: /* @__PURE__ */ jsx(Button, {
|
|
750
|
+
size: "sm",
|
|
751
|
+
variant: "secondary",
|
|
752
|
+
iconEnd: /* @__PURE__ */ jsx(ArrowRightIcon, {}),
|
|
753
|
+
children: "Customise"
|
|
754
|
+
})
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
key: "pages",
|
|
758
|
+
label: "Pages",
|
|
759
|
+
icon: /* @__PURE__ */ jsx(ShoppingBagIcon, {}),
|
|
760
|
+
value: "14"
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
key: "visitors",
|
|
764
|
+
label: "Visitors",
|
|
765
|
+
icon: /* @__PURE__ */ jsx(UsersIcon, {}),
|
|
766
|
+
value: "1,204",
|
|
767
|
+
hint: "last 7 days"
|
|
768
|
+
}
|
|
769
|
+
]
|
|
770
|
+
})
|
|
771
|
+
})
|
|
772
|
+
}),
|
|
773
|
+
/* @__PURE__ */ jsx(Note, {
|
|
774
|
+
title: "Figures stay ink",
|
|
775
|
+
children: "A tone is for the one figure that needs chasing, such as late orders in amber or red, and a zero goes quiet whatever its tone. Do not colour a strip to make it lively."
|
|
776
|
+
})
|
|
777
|
+
]
|
|
778
|
+
}),
|
|
779
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
780
|
+
id: "filter",
|
|
781
|
+
title: "A filter strip",
|
|
782
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
783
|
+
"Give the strip ",
|
|
784
|
+
/* @__PURE__ */ jsx("code", { children: "onSelect" }),
|
|
785
|
+
" and every figure becomes a toggle button, with ",
|
|
786
|
+
/* @__PURE__ */ jsx("code", { children: "active" }),
|
|
787
|
+
" naming the pressed one. It is for counts above a list that filter it: the stage of each merchant, the status of each order. Pressing the active figure calls ",
|
|
788
|
+
/* @__PURE__ */ jsx("code", { children: "onSelect" }),
|
|
789
|
+
" again, so the page decides whether that clears the filter. A figure that drives a chart is a tab: use ",
|
|
790
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
791
|
+
to: "/components/figure-tabs",
|
|
792
|
+
children: "Figure tabs"
|
|
793
|
+
}),
|
|
794
|
+
"."
|
|
795
|
+
] }),
|
|
796
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
797
|
+
align: "fill",
|
|
798
|
+
code: `
|
|
799
|
+
const [active, setActive] = useState<string | null>('paying')
|
|
800
|
+
|
|
801
|
+
<FigureStrip
|
|
802
|
+
aria-label="Merchants by stage"
|
|
803
|
+
items={stages}
|
|
804
|
+
active={active}
|
|
805
|
+
onSelect={(key) => setActive((now) => (now === key ? null : key))}
|
|
806
|
+
/>`,
|
|
807
|
+
children: /* @__PURE__ */ jsx(StageFilter, {})
|
|
808
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
809
|
+
title: "A figure that is not a filter",
|
|
810
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
811
|
+
"A strip may have a figure with nothing to filter by among ones that have. Mark it ",
|
|
812
|
+
/* @__PURE__ */ jsx("code", { children: "selectable: false" }),
|
|
813
|
+
" and it is drawn as plain words and a number: not a button, not a tab stop, never announced as pressed, and free to carry an",
|
|
814
|
+
" ",
|
|
815
|
+
/* @__PURE__ */ jsx("code", { children: "action" }),
|
|
816
|
+
". Here the first three filter the list and the fourth is only a count."
|
|
817
|
+
] }),
|
|
818
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
819
|
+
align: "fill",
|
|
820
|
+
code: `
|
|
821
|
+
<FigureStrip
|
|
822
|
+
aria-label="Merchants by compliance"
|
|
823
|
+
items={[
|
|
824
|
+
{ key: 'critical', label: 'Critical', value: '3', tone: 'negative' },
|
|
825
|
+
{ key: 'urgent', label: 'Urgent', value: '7', tone: 'warning' },
|
|
826
|
+
{ key: 'warning', label: 'Warning', value: '12' },
|
|
827
|
+
{ key: 'stalled', label: 'Not warned', value: '41', selectable: false },
|
|
828
|
+
]}
|
|
829
|
+
active={active}
|
|
830
|
+
onSelect={setActive}
|
|
831
|
+
/>`,
|
|
832
|
+
children: /* @__PURE__ */ jsx(MixedFilter, {})
|
|
833
|
+
})
|
|
834
|
+
})]
|
|
835
|
+
}),
|
|
836
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
837
|
+
id: "links",
|
|
838
|
+
title: "Figures that link",
|
|
839
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
840
|
+
"Give a figure an ",
|
|
841
|
+
/* @__PURE__ */ jsx("code", { children: "href" }),
|
|
842
|
+
" and its whole cell is a link: the count a page opens with that is also the way in to the list it counts. It is named by its words, as a toggle button is (\"Open 14 3 late\"), and has the same pointer, hover tint and focus ring as a button cell. A link is not a toggle, so it is never pressed and ",
|
|
843
|
+
/* @__PURE__ */ jsx("code", { children: "onSelect" }),
|
|
844
|
+
" is not called for it; in a filter strip, figures with an ",
|
|
845
|
+
/* @__PURE__ */ jsx("code", { children: "href" }),
|
|
846
|
+
" are links and the rest are still buttons. A link cannot hold a control, so its ",
|
|
847
|
+
/* @__PURE__ */ jsx("code", { children: "action" }),
|
|
848
|
+
" is not drawn. The cell that has no ",
|
|
849
|
+
/* @__PURE__ */ jsx("code", { children: "href" }),
|
|
850
|
+
" stays plain words and a number."
|
|
851
|
+
] }),
|
|
852
|
+
children: [
|
|
853
|
+
/* @__PURE__ */ jsx(Example, {
|
|
854
|
+
align: "fill",
|
|
855
|
+
code: `
|
|
856
|
+
<FigureStrip
|
|
857
|
+
aria-label="Support queue"
|
|
858
|
+
columns={4}
|
|
859
|
+
items={[
|
|
860
|
+
{ key: 'open', label: 'Open', value: '14', hint: '3 late', tone: 'warning', href: '/tickets?status=open' },
|
|
861
|
+
{ key: 'waiting', label: 'Waiting on customer', value: '6', href: '/tickets?status=waiting' },
|
|
862
|
+
{ key: 'solved', label: 'Solved this week', value: '212', change: <Delta value={4.1} size="sm" />, href: '/tickets?status=solved' },
|
|
863
|
+
{ key: 'all', label: 'All time', value: '2,481' },
|
|
864
|
+
]}
|
|
865
|
+
/>`,
|
|
866
|
+
children: /* @__PURE__ */ jsx(FigureStrip, {
|
|
867
|
+
"aria-label": "Support queue",
|
|
868
|
+
columns: 4,
|
|
869
|
+
items: QUEUE
|
|
870
|
+
})
|
|
871
|
+
}),
|
|
872
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
873
|
+
title: "With a router link",
|
|
874
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
875
|
+
"A plain ",
|
|
876
|
+
/* @__PURE__ */ jsx("code", { children: "href" }),
|
|
877
|
+
" is a full page load. In an app with a router, pass ",
|
|
878
|
+
/* @__PURE__ */ jsx("code", { children: "renderLink" }),
|
|
879
|
+
": it is called for each figure that has an ",
|
|
880
|
+
/* @__PURE__ */ jsx("code", { children: "href" }),
|
|
881
|
+
" with the cell's props (the address as ",
|
|
882
|
+
/* @__PURE__ */ jsx("code", { children: "href" }),
|
|
883
|
+
", ",
|
|
884
|
+
/* @__PURE__ */ jsx("code", { children: "target" }),
|
|
885
|
+
" and",
|
|
886
|
+
" ",
|
|
887
|
+
/* @__PURE__ */ jsx("code", { children: "rel" }),
|
|
888
|
+
" if the figure set them, and the ",
|
|
889
|
+
/* @__PURE__ */ jsx("code", { children: "className" }),
|
|
890
|
+
", data attributes and words that draw the cell) and returns the one element that is the cell. Put every prop on it. It is a render prop, because a cell has words of its own and not an empty element to fill, as ",
|
|
891
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
892
|
+
to: "/components/link-row",
|
|
893
|
+
children: "LinkRow"
|
|
894
|
+
}),
|
|
895
|
+
" and",
|
|
896
|
+
" ",
|
|
897
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
898
|
+
to: "/components/link",
|
|
899
|
+
children: "Link"
|
|
900
|
+
}),
|
|
901
|
+
" do with ",
|
|
902
|
+
/* @__PURE__ */ jsx("code", { children: "asChild" }),
|
|
903
|
+
"."
|
|
904
|
+
] }),
|
|
905
|
+
children: /* @__PURE__ */ jsx(CodeBlock$1, { code: `
|
|
906
|
+
import { Link } from 'react-router'
|
|
907
|
+
|
|
908
|
+
<FigureStrip
|
|
909
|
+
aria-label="Support queue"
|
|
910
|
+
items={items}
|
|
911
|
+
renderLink={({ href, ...props }) => <Link to={href} {...props} />}
|
|
912
|
+
/>` })
|
|
913
|
+
}),
|
|
914
|
+
/* @__PURE__ */ jsxs(Note, {
|
|
915
|
+
title: "A strip with a link is a group of cells",
|
|
916
|
+
children: [
|
|
917
|
+
"A plain strip is a description list, and an anchor cannot sit in one. As soon as one figure has an ",
|
|
918
|
+
/* @__PURE__ */ jsx("code", { children: "href" }),
|
|
919
|
+
" the strip is drawn as a group of cells, as a filter strip is: the figures are no longer terms and descriptions to a screen reader, and the link is named by all its words. Give the strip an ",
|
|
920
|
+
/* @__PURE__ */ jsx("code", { children: "aria-label" }),
|
|
921
|
+
"."
|
|
922
|
+
]
|
|
923
|
+
})
|
|
924
|
+
]
|
|
925
|
+
}),
|
|
926
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
927
|
+
id: "with-chart",
|
|
928
|
+
title: "With a chart under it",
|
|
929
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
930
|
+
"A strip of the numbers someone opens a dashboard for, each with a ",
|
|
931
|
+
/* @__PURE__ */ jsx("code", { children: "trend" }),
|
|
932
|
+
" (a small",
|
|
933
|
+
" ",
|
|
934
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
935
|
+
to: "/components/sparkline",
|
|
936
|
+
children: "Sparkline"
|
|
937
|
+
}),
|
|
938
|
+
") and a chart under the strip for the one they choose.",
|
|
939
|
+
" ",
|
|
940
|
+
/* @__PURE__ */ jsx("code", { children: "panel" }),
|
|
941
|
+
" draws the chart for a figure's key; with it the figures open and close the panel:",
|
|
942
|
+
" ",
|
|
943
|
+
/* @__PURE__ */ jsx("code", { children: "active" }),
|
|
944
|
+
" is the open one (",
|
|
945
|
+
/* @__PURE__ */ jsx("code", { children: "null" }),
|
|
946
|
+
" for closed) and ",
|
|
947
|
+
/* @__PURE__ */ jsx("code", { children: "onActiveChange" }),
|
|
948
|
+
" is called with the figure pressed, or ",
|
|
949
|
+
/* @__PURE__ */ jsx("code", { children: "null" }),
|
|
950
|
+
" when the open one is pressed again. While it is open, pointing at or focusing another figure previews its chart. ",
|
|
951
|
+
/* @__PURE__ */ jsx("code", { children: "footer" }),
|
|
952
|
+
" is a row under the figures (a period, a note), and ends with a chevron that opens and closes the chart. The panel opens on its row and fades in; closed, it is inert. Press a figure, point at the others, press it again, then try the chevron."
|
|
953
|
+
] }),
|
|
954
|
+
children: [
|
|
955
|
+
/* @__PURE__ */ jsx(Example, {
|
|
956
|
+
align: "fill",
|
|
957
|
+
code: `
|
|
958
|
+
const [active, setActive] = useState<string | null>('orders')
|
|
959
|
+
|
|
960
|
+
<FigureStrip
|
|
961
|
+
aria-label="Your numbers"
|
|
962
|
+
items={figures.map((f) => ({ ...f, trend: <Sparkline data={f.points} width={72} height={28} /> }))}
|
|
963
|
+
active={active}
|
|
964
|
+
onActiveChange={setActive}
|
|
965
|
+
panel={(key) => <AreaChart height={220} data={series[key]} valueLabel={labels[key]} />}
|
|
966
|
+
footer={
|
|
967
|
+
<>
|
|
968
|
+
<SegmentedControl aria-label="Period" size="sm" value={period} onValueChange={setPeriod} options={periods} />
|
|
969
|
+
<span>Purchase orders and profile views cover the last 30 days</span>
|
|
970
|
+
</>
|
|
971
|
+
}
|
|
972
|
+
/>`,
|
|
973
|
+
children: /* @__PURE__ */ jsx(SupplierMetrics, {})
|
|
974
|
+
}),
|
|
975
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
976
|
+
title: "Trends on their way",
|
|
977
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
978
|
+
/* @__PURE__ */ jsx("code", { children: "trendLoading" }),
|
|
979
|
+
" holds a trend's place with a skeleton while its series loads (the figures may come first), and every trend shows one while the strip is ",
|
|
980
|
+
/* @__PURE__ */ jsx("code", { children: "loading" }),
|
|
981
|
+
"."
|
|
982
|
+
] }),
|
|
983
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
984
|
+
align: "fill",
|
|
985
|
+
code: `<FigureStrip loading items={figures.map((f) => ({ ...f, trendLoading: true }))} … />`,
|
|
986
|
+
children: /* @__PURE__ */ jsx(SupplierMetricsLoading, {})
|
|
987
|
+
})
|
|
988
|
+
}),
|
|
989
|
+
/* @__PURE__ */ jsxs(Note, {
|
|
990
|
+
title: "Expanded, not pressed",
|
|
991
|
+
children: [
|
|
992
|
+
"A figure that opens the chart is a disclosure: it says it is expanded (or not) and that it controls the panel, which is a region named by the figure it shows. A filter strip (",
|
|
993
|
+
/* @__PURE__ */ jsx("code", { children: "onSelect" }),
|
|
994
|
+
" alone) keeps its toggle buttons. A trend inside a figure that is a button is hidden from assistive tech: the figure and its change say it in words, and the chart says the rest."
|
|
995
|
+
]
|
|
996
|
+
})
|
|
997
|
+
]
|
|
998
|
+
}),
|
|
999
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
1000
|
+
id: "loading",
|
|
1001
|
+
title: "Loading",
|
|
1002
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1003
|
+
"While the numbers are on their way, ",
|
|
1004
|
+
/* @__PURE__ */ jsx("code", { children: "loading" }),
|
|
1005
|
+
" draws a shimmer where each figure will be and holds back what moved. Never a zero: a zero would read as news. The labels stay, so what is loading is still named, and a screen reader hears",
|
|
1006
|
+
" ",
|
|
1007
|
+
/* @__PURE__ */ jsx("code", { children: "loadingLabel" }),
|
|
1008
|
+
" once. The strip keeps the least height it will have: the row under a figure stays, with its hint shown and the change itself withheld, so nothing below it moves when the numbers arrive, unless the loaded change wraps under its figure or an action drops below it. Switch between the two."
|
|
1009
|
+
] }),
|
|
1010
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1011
|
+
align: "fill",
|
|
1012
|
+
code: `<FigureStrip items={items} loading={isLoading} loadingLabel="Loading figures" />`,
|
|
1013
|
+
children: /* @__PURE__ */ jsx(LoadingDemo, {})
|
|
1014
|
+
})
|
|
1015
|
+
}),
|
|
1016
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
1017
|
+
id: "both-themes",
|
|
1018
|
+
title: "In both themes",
|
|
1019
|
+
description: /* @__PURE__ */ jsx("p", { children: "A grid, an inline strip and a filter strip, light and dark side by side." }),
|
|
1020
|
+
children: /* @__PURE__ */ jsx(ThemePair, {
|
|
1021
|
+
align: "fill",
|
|
1022
|
+
children: /* @__PURE__ */ jsx(Matrix, {})
|
|
1023
|
+
})
|
|
1024
|
+
}),
|
|
1025
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
1026
|
+
id: "guidelines",
|
|
1027
|
+
title: "Guidelines",
|
|
1028
|
+
children: [
|
|
1029
|
+
/* @__PURE__ */ jsx(DoDont, {
|
|
1030
|
+
do: {
|
|
1031
|
+
children: /* @__PURE__ */ jsx(Tile, { children: /* @__PURE__ */ jsx(FigureStrip, {
|
|
1032
|
+
"aria-label": "Takings",
|
|
1033
|
+
columns: 2,
|
|
1034
|
+
items: [{
|
|
1035
|
+
key: "sales",
|
|
1036
|
+
label: "Sales",
|
|
1037
|
+
value: "£2,630",
|
|
1038
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
1039
|
+
value: 12.4,
|
|
1040
|
+
size: "sm"
|
|
1041
|
+
})
|
|
1042
|
+
}, {
|
|
1043
|
+
key: "orders",
|
|
1044
|
+
label: "Orders",
|
|
1045
|
+
value: "38",
|
|
1046
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
1047
|
+
value: -4.2,
|
|
1048
|
+
size: "sm"
|
|
1049
|
+
})
|
|
1050
|
+
}]
|
|
1051
|
+
}) }),
|
|
1052
|
+
caption: "Figures on a hairline, under the page head. Nothing around them."
|
|
1053
|
+
},
|
|
1054
|
+
dont: {
|
|
1055
|
+
children: /* @__PURE__ */ jsx(Tile, { children: /* @__PURE__ */ jsxs("div", {
|
|
1056
|
+
className: "figure-strip-dodont--cards",
|
|
1057
|
+
children: [/* @__PURE__ */ jsxs(Card, {
|
|
1058
|
+
padding: "sm",
|
|
1059
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1060
|
+
className: "figure-strip-dodont__label",
|
|
1061
|
+
children: "Sales"
|
|
1062
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1063
|
+
className: "figure-strip-dodont__value",
|
|
1064
|
+
children: "£2,630"
|
|
1065
|
+
})]
|
|
1066
|
+
}), /* @__PURE__ */ jsxs(Card, {
|
|
1067
|
+
padding: "sm",
|
|
1068
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1069
|
+
className: "figure-strip-dodont__label",
|
|
1070
|
+
children: "Orders"
|
|
1071
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1072
|
+
className: "figure-strip-dodont__value",
|
|
1073
|
+
children: "38"
|
|
1074
|
+
})]
|
|
1075
|
+
})]
|
|
1076
|
+
}) }),
|
|
1077
|
+
caption: "A box round each figure. The page turns into a grid of cards, and the figures lose their place."
|
|
1078
|
+
}
|
|
1079
|
+
}),
|
|
1080
|
+
/* @__PURE__ */ jsx(DocTable, {
|
|
1081
|
+
columns: ["Reach for", "When"],
|
|
1082
|
+
rows: [
|
|
1083
|
+
[code("FigureStrip"), "Headline numbers a page opens with. Read-only, or a filter over a list below it."],
|
|
1084
|
+
[/* @__PURE__ */ jsx(DocLink, {
|
|
1085
|
+
to: "/components/figure-tabs",
|
|
1086
|
+
children: "FigureTabs"
|
|
1087
|
+
}), "The figures are tabs: the one you choose drives the chart under it."],
|
|
1088
|
+
[/* @__PURE__ */ jsx(DocLink, {
|
|
1089
|
+
to: "/components/delta",
|
|
1090
|
+
children: "Delta"
|
|
1091
|
+
}), "One change on its own: in a table cell, or beside a heading."],
|
|
1092
|
+
[/* @__PURE__ */ jsx(DocLink, {
|
|
1093
|
+
to: "/components/card",
|
|
1094
|
+
children: "Card"
|
|
1095
|
+
}), "A figure with its own actions and a body of content under it. Not for a row of numbers."]
|
|
1096
|
+
]
|
|
1097
|
+
}),
|
|
1098
|
+
/* @__PURE__ */ jsx(Guidelines, { items: [
|
|
1099
|
+
"Keep labels short and in sentence case: \"Gross sales\", \"Awaiting reply\". The figure does the talking.",
|
|
1100
|
+
"Four figures read at a glance, and up to six is still a strip. More than that is a table: put them there.",
|
|
1101
|
+
"Put the strip under the page head and above the list or chart it summarises.",
|
|
1102
|
+
"Pass the comparison as the hint (\"vs previous period\") so every Delta in the strip says what it is against.",
|
|
1103
|
+
"Show the loading shimmer, never a zero, while a query is in flight. If it fails, say so in place of the strip.",
|
|
1104
|
+
"Link a figure only to the list it counts: \"Open 14\" goes to the open tickets. A figure that goes somewhere unrelated is a surprise."
|
|
1105
|
+
] })
|
|
1106
|
+
]
|
|
1107
|
+
}),
|
|
1108
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
1109
|
+
id: "accessibility",
|
|
1110
|
+
title: "Accessibility",
|
|
1111
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
1112
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1113
|
+
"A plain strip is a description list: the label is the ",
|
|
1114
|
+
/* @__PURE__ */ jsx("code", { children: "dt" }),
|
|
1115
|
+
", the figure its ",
|
|
1116
|
+
/* @__PURE__ */ jsx("code", { children: "dd" }),
|
|
1117
|
+
", so a screen reader hears \"Gross sales, £2,630.50\". The change and hint follow as further descriptions."
|
|
1118
|
+
] }),
|
|
1119
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1120
|
+
"With ",
|
|
1121
|
+
/* @__PURE__ */ jsx("code", { children: "onSelect" }),
|
|
1122
|
+
" it is a group of buttons with ",
|
|
1123
|
+
/* @__PURE__ */ jsx("code", { children: "aria-pressed" }),
|
|
1124
|
+
", each its own tab stop that Enter and Space press. Each is named by its words: \"Trial 12 3 ending in 3 days\". Give the strip an ",
|
|
1125
|
+
/* @__PURE__ */ jsx("code", { children: "aria-label" }),
|
|
1126
|
+
" and it is a named group."
|
|
1127
|
+
] }),
|
|
1128
|
+
"A Delta carries its direction in words and an arrow, never colour alone. Keep the hint beside it so the comparison is read.",
|
|
1129
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1130
|
+
"Loading marks the list ",
|
|
1131
|
+
/* @__PURE__ */ jsx("code", { children: "aria-busy" }),
|
|
1132
|
+
" and hides the shimmer from assistive tech. The words go in a polite status beside the list, not in it (a busy region can hold back what is inside it), and the status is in the page before its words are, which follow a moment later: a live region that arrives with its words already in it is often not read."
|
|
1133
|
+
] }),
|
|
1134
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1135
|
+
"A figure marked ",
|
|
1136
|
+
/* @__PURE__ */ jsx("code", { children: "selectable: false" }),
|
|
1137
|
+
" in a filter strip is not a button and is not a tab stop, so a screen reader does not announce a toggle that does nothing."
|
|
1138
|
+
] }),
|
|
1139
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1140
|
+
"A figure with an ",
|
|
1141
|
+
/* @__PURE__ */ jsx("code", { children: "href" }),
|
|
1142
|
+
" is a link named by its words (\"Open 14 3 late\"), in the tab order, with the focus ring a button cell has. It is never ",
|
|
1143
|
+
/* @__PURE__ */ jsx("code", { children: "aria-pressed" }),
|
|
1144
|
+
": it goes somewhere and does not toggle. A strip with a link in it is a group of cells, not a description list."
|
|
1145
|
+
] }),
|
|
1146
|
+
"The chosen figure of a filter strip is told by more than colour: a teal line under it and its label going from slate to ink, and in forced colours its label is underlined too. Under reduced motion the shimmer stops."
|
|
1147
|
+
] })
|
|
1148
|
+
}),
|
|
1149
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
1150
|
+
id: "differences",
|
|
1151
|
+
title: "Where it differs from the vendor dashboard",
|
|
1152
|
+
description: /* @__PURE__ */ jsx("p", { children: "The cells, the hairlines and the figure are the vendor dashboard's analytics strip, measured in the running app. These are the places the kit chooses differently." }),
|
|
1153
|
+
children: /* @__PURE__ */ jsx(DocTable, {
|
|
1154
|
+
columns: [
|
|
1155
|
+
"Where",
|
|
1156
|
+
"Vendor dashboard",
|
|
1157
|
+
"Kit"
|
|
1158
|
+
],
|
|
1159
|
+
rows: [
|
|
1160
|
+
[
|
|
1161
|
+
"What it folds by",
|
|
1162
|
+
"The window: two across at 1100px or less. In its default shell the strip is the window less 296px, so that is 804px of strip.",
|
|
1163
|
+
/* @__PURE__ */ jsx(Fragment$1, { children: "The strip's own container, at the same 804px, so the number matches in the default shell and a docked panel folds the strip as a narrow window does. Below about 1000px the vendor dashboard's sidebar becomes a 68px rail and its strip is 692 to 892px wide but still two across, where the kit is four across from 805px of strip: no one width matches every shell." })
|
|
1164
|
+
],
|
|
1165
|
+
[
|
|
1166
|
+
"The phone strip",
|
|
1167
|
+
"At a 640px window (a strip of 600px): cells of 14px 12px 16px with a 6px gap, and a 1.3rem figure.",
|
|
1168
|
+
"The same at 600px of strip."
|
|
1169
|
+
],
|
|
1170
|
+
[
|
|
1171
|
+
"Three across",
|
|
1172
|
+
"The analytics strip has four figures, so the vendor dashboard has no fold for three.",
|
|
1173
|
+
"Folds at 603px, so a cell is never narrower than the vendor dashboard's at its fold (201px)."
|
|
1174
|
+
],
|
|
1175
|
+
[
|
|
1176
|
+
"Loading",
|
|
1177
|
+
"Keeps the row under the figure at 22px with its hint, so the strip is the same height.",
|
|
1178
|
+
"The same: the row stays (22px at least) with its hint, and the change is withheld."
|
|
1179
|
+
]
|
|
1180
|
+
]
|
|
1181
|
+
})
|
|
1182
|
+
}),
|
|
1183
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
1184
|
+
id: "props",
|
|
1185
|
+
title: "Props",
|
|
1186
|
+
description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native div attribute." }),
|
|
1187
|
+
children: [/* @__PURE__ */ jsx(PropsTable, { rows: [
|
|
1188
|
+
{
|
|
1189
|
+
name: "items",
|
|
1190
|
+
type: "FigureStripItem[]",
|
|
1191
|
+
required: true,
|
|
1192
|
+
description: "The figures, left to right."
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
name: "columns",
|
|
1196
|
+
type: "'auto' | 1 | 2 | 3 | 4 | 5 | 6",
|
|
1197
|
+
default: "'auto'",
|
|
1198
|
+
description: "How many across. auto: one each up to four, three for five or six, four beyond. Four fold to two at 804px of strip or less, three at 603px, by the strip's width. Five and six (short counts, never auto) fold to three at 750px and 900px, and to two at 603px."
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
name: "layout",
|
|
1202
|
+
type: "'grid' | 'inline'",
|
|
1203
|
+
default: "'grid'",
|
|
1204
|
+
description: "Columns on a hairline, or side by side between two rules."
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
name: "size",
|
|
1208
|
+
type: "'md' | 'sm'",
|
|
1209
|
+
default: "'md' in a grid, 'sm' inline",
|
|
1210
|
+
description: "The figure at 1.625rem or 1.3125rem."
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
name: "loading",
|
|
1214
|
+
type: "boolean",
|
|
1215
|
+
default: "false",
|
|
1216
|
+
description: "A shimmer where the figures will be, and nothing that moved. The strip keeps its height: the row under a figure stays, with its hint."
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
name: "loadingLabel",
|
|
1220
|
+
type: "string",
|
|
1221
|
+
default: "'Loading figures'",
|
|
1222
|
+
description: "What a screen reader hears when loading starts: a polite status that is in the page before its words."
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
name: "onSelect",
|
|
1226
|
+
type: "(key: string) => void",
|
|
1227
|
+
description: "Makes each figure a toggle button that calls this with its key. Without it the strip is a plain list."
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
name: "active",
|
|
1231
|
+
type: "string | null",
|
|
1232
|
+
description: "The key of the pressed figure, with onSelect."
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
name: "renderLink",
|
|
1236
|
+
type: "(props: FigureStripLinkProps, item: FigureStripItem) => ReactElement",
|
|
1237
|
+
description: "Draws the cell of a figure with an href as your own link (a router link). Receives the cell's props and the item, and returns the one element that is the cell, with every prop on it."
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
name: "panel",
|
|
1241
|
+
type: "(key: string) => ReactNode",
|
|
1242
|
+
description: "A chart under the strip for the open figure (or the one being previewed). With it the figures open and close the panel, and say they are expanded."
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
name: "onActiveChange",
|
|
1246
|
+
type: "(key: string | null) => void",
|
|
1247
|
+
description: "With panel: called with the figure to open, or null when the open one is pressed again (or the chevron closes it)."
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
name: "footer",
|
|
1251
|
+
type: "ReactNode",
|
|
1252
|
+
description: "A row under the figures: a period control, a note. With panel it ends with the chevron."
|
|
1253
|
+
},
|
|
1254
|
+
{
|
|
1255
|
+
name: "disclosure",
|
|
1256
|
+
type: "boolean",
|
|
1257
|
+
default: "true",
|
|
1258
|
+
description: "With panel: false leaves the chevron out."
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
name: "panelLabels",
|
|
1262
|
+
type: "Partial<FigurePanelLabels>",
|
|
1263
|
+
description: "The chevron's words: show (\"Show the chart\") and hide (\"Hide the chart\"). FIGURE_PANEL_LABELS is the English set."
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
name: "aria-label",
|
|
1267
|
+
type: "string",
|
|
1268
|
+
description: "Names the strip as a group."
|
|
1269
|
+
}
|
|
1270
|
+
] }), /* @__PURE__ */ jsx(PropsTable, {
|
|
1271
|
+
title: "Each item",
|
|
1272
|
+
rows: [
|
|
1273
|
+
{
|
|
1274
|
+
name: "key",
|
|
1275
|
+
type: "string",
|
|
1276
|
+
required: true,
|
|
1277
|
+
description: "Identifies the figure: the React key, and what onSelect is called with."
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
name: "label",
|
|
1281
|
+
type: "ReactNode",
|
|
1282
|
+
required: true,
|
|
1283
|
+
description: "Names the figure."
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
name: "value",
|
|
1287
|
+
type: "ReactNode",
|
|
1288
|
+
required: true,
|
|
1289
|
+
description: "The figure, already formatted. A RollingNumber for one that rolls."
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
name: "change",
|
|
1293
|
+
type: "ReactNode",
|
|
1294
|
+
description: "How it moved: usually a Delta."
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
name: "hint",
|
|
1298
|
+
type: "ReactNode",
|
|
1299
|
+
description: "Quiet context after the change: \"vs previous 30 days\"."
|
|
1300
|
+
},
|
|
1301
|
+
{
|
|
1302
|
+
name: "icon",
|
|
1303
|
+
type: "ReactNode",
|
|
1304
|
+
description: "Leads the label. Decorative. Off by default."
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
name: "trend",
|
|
1308
|
+
type: "ReactNode",
|
|
1309
|
+
description: "A trend after the figure: a small Sparkline. Drawn on every kind of cell; hidden from assistive tech inside a button or a link."
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
name: "trendLoading",
|
|
1313
|
+
type: "boolean",
|
|
1314
|
+
description: "A skeleton in the trend's place while its series loads."
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
name: "action",
|
|
1318
|
+
type: "ReactNode",
|
|
1319
|
+
description: "A control after the figure: a small Button, a Sparkline. Ignored on a figure that is a button (with onSelect) or a link (with href)."
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
name: "selectable",
|
|
1323
|
+
type: "boolean",
|
|
1324
|
+
default: "true",
|
|
1325
|
+
description: "With onSelect, false draws this figure as plain words and a number: not a button, not a tab stop."
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
name: "href",
|
|
1329
|
+
type: "string",
|
|
1330
|
+
description: "Makes the figure a link: the whole cell is an anchor going here. Not a toggle; its action is not drawn."
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
name: "target",
|
|
1334
|
+
type: "string",
|
|
1335
|
+
description: "With href: where to open it. _blank also sets rel=\"noopener noreferrer\" unless you give rel."
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
name: "rel",
|
|
1339
|
+
type: "string",
|
|
1340
|
+
description: "With href: its rel. Replaces the noopener noreferrer a _blank target would set."
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
name: "quiet",
|
|
1344
|
+
type: "boolean",
|
|
1345
|
+
description: "Nothing to show: the figure goes quiet."
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
name: "tone",
|
|
1349
|
+
type: "'neutral' | 'accent' | 'positive' | 'negative' | 'warning' | 'info'",
|
|
1350
|
+
description: "Colours the figure, for the one that needs chasing."
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
name: "dot",
|
|
1354
|
+
type: "string",
|
|
1355
|
+
description: "A dot beside the label: a tone name, or any CSS colour."
|
|
1356
|
+
}
|
|
1357
|
+
]
|
|
1358
|
+
})]
|
|
1359
|
+
})
|
|
1360
|
+
]
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
//#endregion
|
|
1364
|
+
export { Page, Preview };
|