@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,563 @@
|
|
|
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, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Button, Delta, Figure, Inline, RollingNumber, Switch, percentChange } from "@orbitcommerce/constellation";
|
|
7
|
+
import { PlusIcon } from "@orbitcommerce/constellation/icons";
|
|
8
|
+
//#region src/pages/components/figure.tsx
|
|
9
|
+
var GBP = {
|
|
10
|
+
style: "currency",
|
|
11
|
+
currency: "GBP"
|
|
12
|
+
};
|
|
13
|
+
var WHOLE = { maximumFractionDigits: 0 };
|
|
14
|
+
function Preview() {
|
|
15
|
+
return /* @__PURE__ */ jsx(Figure, {
|
|
16
|
+
size: "lg",
|
|
17
|
+
label: "Sales today",
|
|
18
|
+
value: "£482.10",
|
|
19
|
+
meta: "3 orders",
|
|
20
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
21
|
+
value: 12,
|
|
22
|
+
size: "sm"
|
|
23
|
+
}),
|
|
24
|
+
hint: "vs same time yesterday"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** The home page's till: today's takings roll up as a sale comes in, against the same time yesterday. */
|
|
28
|
+
function Till() {
|
|
29
|
+
const [sales, setSales] = useState([
|
|
30
|
+
182.5,
|
|
31
|
+
129.6,
|
|
32
|
+
170
|
|
33
|
+
]);
|
|
34
|
+
const takings = sales.reduce((sum, sale) => sum + sale, 0);
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "figure-demo",
|
|
37
|
+
children: [/* @__PURE__ */ jsx(Figure, {
|
|
38
|
+
size: "hero",
|
|
39
|
+
label: "Sales today",
|
|
40
|
+
value: /* @__PURE__ */ jsx(RollingNumber, {
|
|
41
|
+
value: takings,
|
|
42
|
+
format: GBP
|
|
43
|
+
}),
|
|
44
|
+
meta: `${sales.length} orders`,
|
|
45
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
46
|
+
value: percentChange(takings, 431.2),
|
|
47
|
+
size: "sm"
|
|
48
|
+
}),
|
|
49
|
+
hint: "vs same time yesterday"
|
|
50
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
51
|
+
size: "sm",
|
|
52
|
+
variant: "soft",
|
|
53
|
+
icon: /* @__PURE__ */ jsx(PlusIcon, {}),
|
|
54
|
+
onClick: () => setSales((now) => [...now, 64.2]),
|
|
55
|
+
children: "Take a sale"
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function Loading() {
|
|
60
|
+
const [loading, setLoading] = useState(true);
|
|
61
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: "figure-demo",
|
|
63
|
+
children: [/* @__PURE__ */ jsx(Switch, {
|
|
64
|
+
checked: loading,
|
|
65
|
+
onCheckedChange: setLoading,
|
|
66
|
+
label: "Loading"
|
|
67
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
68
|
+
className: "figure-row",
|
|
69
|
+
children: [/* @__PURE__ */ jsx(Figure, {
|
|
70
|
+
loading,
|
|
71
|
+
size: "lg",
|
|
72
|
+
label: "Gross sales",
|
|
73
|
+
value: /* @__PURE__ */ jsx(RollingNumber, {
|
|
74
|
+
value: 2630.5,
|
|
75
|
+
format: GBP
|
|
76
|
+
}),
|
|
77
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
78
|
+
value: 12.4,
|
|
79
|
+
size: "sm"
|
|
80
|
+
}),
|
|
81
|
+
hint: "vs previous period"
|
|
82
|
+
}), /* @__PURE__ */ jsx(Figure, {
|
|
83
|
+
loading,
|
|
84
|
+
layout: "inline",
|
|
85
|
+
size: "lg",
|
|
86
|
+
value: /* @__PURE__ */ jsx(RollingNumber, {
|
|
87
|
+
value: 1204,
|
|
88
|
+
format: WHOLE
|
|
89
|
+
}),
|
|
90
|
+
label: "fulfilled",
|
|
91
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
92
|
+
value: 4.2,
|
|
93
|
+
size: "sm"
|
|
94
|
+
}),
|
|
95
|
+
meta: "12 pending",
|
|
96
|
+
metaDot: "warning"
|
|
97
|
+
})]
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
var code = (value) => /* @__PURE__ */ jsx("code", { children: value });
|
|
102
|
+
function Page() {
|
|
103
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
104
|
+
title: "Figure",
|
|
105
|
+
status: "new",
|
|
106
|
+
importNames: ["Figure"],
|
|
107
|
+
lead: "One figure on its own: the till at the head of a home page, a panel's total, a figure in a report. A quiet label and a Sora figure, with how it moved and a fact beside it.",
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
110
|
+
id: "basics",
|
|
111
|
+
title: "Basics",
|
|
112
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
113
|
+
"A label over a figure, with a row under it for a fact (",
|
|
114
|
+
/* @__PURE__ */ jsx("code", { children: "meta" }),
|
|
115
|
+
"), how it moved (",
|
|
116
|
+
/* @__PURE__ */ jsx("code", { children: "change" }),
|
|
117
|
+
", usually a ",
|
|
118
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
119
|
+
to: "/components/delta",
|
|
120
|
+
children: "Delta"
|
|
121
|
+
}),
|
|
122
|
+
") and a ",
|
|
123
|
+
/* @__PURE__ */ jsx("code", { children: "hint" }),
|
|
124
|
+
". The value comes formatted: a string, or a ",
|
|
125
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
126
|
+
to: "/components/rolling-number",
|
|
127
|
+
children: "RollingNumber"
|
|
128
|
+
}),
|
|
129
|
+
" for one that rolls. For a row of figures on a hairline, use a ",
|
|
130
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
131
|
+
to: "/components/figure-strip",
|
|
132
|
+
children: "Figure strip"
|
|
133
|
+
}),
|
|
134
|
+
"."
|
|
135
|
+
] }),
|
|
136
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
137
|
+
code: `
|
|
138
|
+
<Figure
|
|
139
|
+
label="Average order value"
|
|
140
|
+
value="£71.77"
|
|
141
|
+
change={<Delta value={-6.4} size="sm" />}
|
|
142
|
+
hint="vs previous period"
|
|
143
|
+
/>`,
|
|
144
|
+
children: /* @__PURE__ */ jsx(Figure, {
|
|
145
|
+
label: "Average order value",
|
|
146
|
+
value: "£71.77",
|
|
147
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
148
|
+
value: -6.4,
|
|
149
|
+
size: "sm"
|
|
150
|
+
}),
|
|
151
|
+
hint: "vs previous period"
|
|
152
|
+
})
|
|
153
|
+
})
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
156
|
+
id: "sizes",
|
|
157
|
+
title: "Sizes",
|
|
158
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
159
|
+
/* @__PURE__ */ jsx("code", { children: "hero" }),
|
|
160
|
+
" is the one figure a page leads with: 3rem (2.5rem on a phone) under a heading, its row at 14px, as the vendor dashboard's home till is. ",
|
|
161
|
+
/* @__PURE__ */ jsx("code", { children: "lg" }),
|
|
162
|
+
" is a panel's figure at 1.625rem, and",
|
|
163
|
+
" ",
|
|
164
|
+
/* @__PURE__ */ jsx("code", { children: "md" }),
|
|
165
|
+
" (the default) a figure among others at 1.3125rem."
|
|
166
|
+
] }),
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
169
|
+
title: "Hero",
|
|
170
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
171
|
+
"The label is an ",
|
|
172
|
+
/* @__PURE__ */ jsx("code", { children: "h2" }),
|
|
173
|
+
", since it heads its part of the page (",
|
|
174
|
+
/* @__PURE__ */ jsx("code", { children: "labelAs" }),
|
|
175
|
+
" picks another level). Press Take a sale: the takings roll like a till and the change moves with them."
|
|
176
|
+
] }),
|
|
177
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
178
|
+
align: "start",
|
|
179
|
+
code: `
|
|
180
|
+
<Figure
|
|
181
|
+
size="hero"
|
|
182
|
+
label="Sales today"
|
|
183
|
+
value={<RollingNumber value={takings} format={{ style: 'currency', currency: 'GBP' }} />}
|
|
184
|
+
meta={\`\${orders} orders\`}
|
|
185
|
+
change={<Delta value={percentChange(takings, yesterday)} size="sm" />}
|
|
186
|
+
hint="vs same time yesterday"
|
|
187
|
+
/>`,
|
|
188
|
+
children: /* @__PURE__ */ jsx(Till, {})
|
|
189
|
+
})
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
192
|
+
title: "Large and medium",
|
|
193
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
194
|
+
align: "start",
|
|
195
|
+
code: `
|
|
196
|
+
<Figure size="lg" label="Gross sales" value="£2,630.50" change={<Delta value={12.4} size="sm" />} hint="vs previous period" />
|
|
197
|
+
<Figure label="Refunds" value="£182.00" change={<Delta value={12.5} positiveIsGood={false} size="sm" />} hint="vs previous period" />`,
|
|
198
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
199
|
+
className: "figure-row",
|
|
200
|
+
children: [/* @__PURE__ */ jsx(Figure, {
|
|
201
|
+
size: "lg",
|
|
202
|
+
label: "Gross sales",
|
|
203
|
+
value: "£2,630.50",
|
|
204
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
205
|
+
value: 12.4,
|
|
206
|
+
size: "sm"
|
|
207
|
+
}),
|
|
208
|
+
hint: "vs previous period"
|
|
209
|
+
}), /* @__PURE__ */ jsx(Figure, {
|
|
210
|
+
label: "Refunds",
|
|
211
|
+
value: "£182.00",
|
|
212
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
213
|
+
value: 12.5,
|
|
214
|
+
positiveIsGood: false,
|
|
215
|
+
size: "sm"
|
|
216
|
+
}),
|
|
217
|
+
hint: "vs previous period"
|
|
218
|
+
})]
|
|
219
|
+
})
|
|
220
|
+
})
|
|
221
|
+
}),
|
|
222
|
+
/* @__PURE__ */ jsx(DocTable, {
|
|
223
|
+
columns: [
|
|
224
|
+
"Size",
|
|
225
|
+
"Figure",
|
|
226
|
+
"Label",
|
|
227
|
+
"The row under it"
|
|
228
|
+
],
|
|
229
|
+
rows: [
|
|
230
|
+
[
|
|
231
|
+
code("hero"),
|
|
232
|
+
"Sora 600, 3rem (2.5rem at 640px or less), -0.035em",
|
|
233
|
+
"14px 500, fg-2, an h2",
|
|
234
|
+
"14px; the meta in ink, the hint in fg-3"
|
|
235
|
+
],
|
|
236
|
+
[
|
|
237
|
+
code("lg"),
|
|
238
|
+
"Sora 600, 1.625rem",
|
|
239
|
+
"13px 500, fg-2 (fg-3 inline)",
|
|
240
|
+
"13px; the hint 12px in fg-3"
|
|
241
|
+
],
|
|
242
|
+
[
|
|
243
|
+
code("md"),
|
|
244
|
+
"Sora 600, 1.3125rem",
|
|
245
|
+
"13px 500, fg-2 (fg-3 inline)",
|
|
246
|
+
"13px; the hint 12px in fg-3"
|
|
247
|
+
]
|
|
248
|
+
]
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
253
|
+
id: "inline",
|
|
254
|
+
title: "Inline",
|
|
255
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
256
|
+
/* @__PURE__ */ jsx("code", { children: "layout=\"inline\"" }),
|
|
257
|
+
" puts the figure, then its label, then the change on one baseline (\"1,204 fulfilled\"), the label in fg-3, with the ",
|
|
258
|
+
/* @__PURE__ */ jsx("code", { children: "meta" }),
|
|
259
|
+
" on a quiet line under them and a",
|
|
260
|
+
" ",
|
|
261
|
+
/* @__PURE__ */ jsx("code", { children: "metaDot" }),
|
|
262
|
+
" before it (a tone, or any CSS colour): a panel's headline over its chart. For a pair that reads label first (\"Total £12,400\"), add ",
|
|
263
|
+
/* @__PURE__ */ jsx("code", { children: "labelFirst" }),
|
|
264
|
+
". Each figure wraps within itself, and a row of them wraps in an ",
|
|
265
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
266
|
+
to: "/components/layout-primitives",
|
|
267
|
+
children: "Inline"
|
|
268
|
+
}),
|
|
269
|
+
"."
|
|
270
|
+
] }),
|
|
271
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
272
|
+
align: "start",
|
|
273
|
+
code: `
|
|
274
|
+
<Figure
|
|
275
|
+
layout="inline"
|
|
276
|
+
size="lg"
|
|
277
|
+
value="1,204"
|
|
278
|
+
label="fulfilled"
|
|
279
|
+
change={<Delta value={4.2} size="sm" />}
|
|
280
|
+
meta="12 pending"
|
|
281
|
+
metaDot="warning"
|
|
282
|
+
/>`,
|
|
283
|
+
children: /* @__PURE__ */ jsx(Figure, {
|
|
284
|
+
layout: "inline",
|
|
285
|
+
size: "lg",
|
|
286
|
+
value: "1,204",
|
|
287
|
+
label: "fulfilled",
|
|
288
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
289
|
+
value: 4.2,
|
|
290
|
+
size: "sm"
|
|
291
|
+
}),
|
|
292
|
+
meta: "12 pending",
|
|
293
|
+
metaDot: "warning"
|
|
294
|
+
})
|
|
295
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
296
|
+
title: "Label first, in a row that wraps",
|
|
297
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
298
|
+
align: "start",
|
|
299
|
+
code: `
|
|
300
|
+
<Inline gap={6} rowGap={3}>
|
|
301
|
+
<Figure layout="inline" labelFirst label="Total" value="£12,400.00" change={<Delta value={8.1} size="sm" />} hint="vs previous period" />
|
|
302
|
+
<Figure layout="inline" labelFirst label="Orders" value="186" />
|
|
303
|
+
<Figure layout="inline" labelFirst label="Refunded" value="£310.00" />
|
|
304
|
+
</Inline>`,
|
|
305
|
+
children: /* @__PURE__ */ jsxs(Inline, {
|
|
306
|
+
gap: 6,
|
|
307
|
+
rowGap: 3,
|
|
308
|
+
children: [
|
|
309
|
+
/* @__PURE__ */ jsx(Figure, {
|
|
310
|
+
layout: "inline",
|
|
311
|
+
labelFirst: true,
|
|
312
|
+
label: "Total",
|
|
313
|
+
value: "£12,400.00",
|
|
314
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
315
|
+
value: 8.1,
|
|
316
|
+
size: "sm"
|
|
317
|
+
}),
|
|
318
|
+
hint: "vs previous period"
|
|
319
|
+
}),
|
|
320
|
+
/* @__PURE__ */ jsx(Figure, {
|
|
321
|
+
layout: "inline",
|
|
322
|
+
labelFirst: true,
|
|
323
|
+
label: "Orders",
|
|
324
|
+
value: "186"
|
|
325
|
+
}),
|
|
326
|
+
/* @__PURE__ */ jsx(Figure, {
|
|
327
|
+
layout: "inline",
|
|
328
|
+
labelFirst: true,
|
|
329
|
+
label: "Refunded",
|
|
330
|
+
value: "£310.00"
|
|
331
|
+
})
|
|
332
|
+
]
|
|
333
|
+
})
|
|
334
|
+
})
|
|
335
|
+
})]
|
|
336
|
+
}),
|
|
337
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
338
|
+
id: "words",
|
|
339
|
+
title: "A value that is words",
|
|
340
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
341
|
+
"A figure is one line, cut with an ellipsis if it must be. A value that is a sentence (\"100% of units have a cost price\") would be cut, so ",
|
|
342
|
+
/* @__PURE__ */ jsx("code", { children: "valueType=\"text\"" }),
|
|
343
|
+
" sets it in body type, 14px at 500 (15px at",
|
|
344
|
+
" ",
|
|
345
|
+
/* @__PURE__ */ jsx("code", { children: "lg" }),
|
|
346
|
+
"), and lets it wrap."
|
|
347
|
+
] }),
|
|
348
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
349
|
+
align: "start",
|
|
350
|
+
code: `
|
|
351
|
+
<Figure label="Cost coverage" value="100% of units have a cost price" valueType="text" />
|
|
352
|
+
<Figure label="Units sold" value="1,204" />`,
|
|
353
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
354
|
+
className: "figure-row figure-row--narrow",
|
|
355
|
+
children: [/* @__PURE__ */ jsx(Figure, {
|
|
356
|
+
label: "Cost coverage",
|
|
357
|
+
value: "100% of units have a cost price",
|
|
358
|
+
valueType: "text"
|
|
359
|
+
}), /* @__PURE__ */ jsx(Figure, {
|
|
360
|
+
label: "Units sold",
|
|
361
|
+
value: "1,204"
|
|
362
|
+
})]
|
|
363
|
+
})
|
|
364
|
+
})
|
|
365
|
+
}),
|
|
366
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
367
|
+
id: "loading",
|
|
368
|
+
title: "Loading",
|
|
369
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
370
|
+
/* @__PURE__ */ jsx("code", { children: "loading" }),
|
|
371
|
+
" shows a shimmer as tall as the figure's line, never a zero on its way, and holds back the change and the meta, which are data; the label and the hint are words and stay, so nothing moves when the figure lands. The figure is ",
|
|
372
|
+
/* @__PURE__ */ jsx("code", { children: "aria-busy" }),
|
|
373
|
+
" meanwhile."
|
|
374
|
+
] }),
|
|
375
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
376
|
+
align: "start",
|
|
377
|
+
code: `<Figure loading={loading} size="lg" label="Gross sales" value={…} change={…} hint="vs previous period" />`,
|
|
378
|
+
children: /* @__PURE__ */ jsx(Loading, {})
|
|
379
|
+
})
|
|
380
|
+
}),
|
|
381
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
382
|
+
id: "both-themes",
|
|
383
|
+
title: "In both themes",
|
|
384
|
+
description: /* @__PURE__ */ jsx("p", { children: "Every size and layout, light and dark side by side." }),
|
|
385
|
+
children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsxs("div", {
|
|
386
|
+
className: "figure-stack",
|
|
387
|
+
children: [
|
|
388
|
+
/* @__PURE__ */ jsx(Figure, {
|
|
389
|
+
size: "hero",
|
|
390
|
+
labelAs: "span",
|
|
391
|
+
label: "Sales today",
|
|
392
|
+
value: "£482.10",
|
|
393
|
+
meta: "3 orders",
|
|
394
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
395
|
+
value: 12,
|
|
396
|
+
size: "sm"
|
|
397
|
+
}),
|
|
398
|
+
hint: "vs same time yesterday"
|
|
399
|
+
}),
|
|
400
|
+
/* @__PURE__ */ jsx(Figure, {
|
|
401
|
+
layout: "inline",
|
|
402
|
+
size: "lg",
|
|
403
|
+
value: "1,204",
|
|
404
|
+
label: "fulfilled",
|
|
405
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
406
|
+
value: -2.1,
|
|
407
|
+
size: "sm"
|
|
408
|
+
}),
|
|
409
|
+
meta: "12 pending",
|
|
410
|
+
metaDot: "warning"
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ jsx(Figure, {
|
|
413
|
+
label: "Cost coverage",
|
|
414
|
+
value: "100% of units have a cost price",
|
|
415
|
+
valueType: "text"
|
|
416
|
+
})
|
|
417
|
+
]
|
|
418
|
+
}) })
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
421
|
+
id: "guidelines",
|
|
422
|
+
title: "Guidelines",
|
|
423
|
+
children: [/* @__PURE__ */ jsx(DoDont, {
|
|
424
|
+
do: {
|
|
425
|
+
children: /* @__PURE__ */ jsx(Figure, {
|
|
426
|
+
size: "lg",
|
|
427
|
+
label: "Gross sales",
|
|
428
|
+
value: "£2,630.50",
|
|
429
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
430
|
+
value: 12.4,
|
|
431
|
+
size: "sm"
|
|
432
|
+
})
|
|
433
|
+
}),
|
|
434
|
+
caption: "The figure stays ink; the change carries the colour on its own."
|
|
435
|
+
},
|
|
436
|
+
dont: {
|
|
437
|
+
children: /* @__PURE__ */ jsx(Figure, {
|
|
438
|
+
size: "lg",
|
|
439
|
+
label: "Gross sales",
|
|
440
|
+
value: /* @__PURE__ */ jsx("span", {
|
|
441
|
+
className: "figure-painted",
|
|
442
|
+
children: "£2,630.50"
|
|
443
|
+
})
|
|
444
|
+
}),
|
|
445
|
+
caption: "A coloured figure reads as a different kind of number."
|
|
446
|
+
}
|
|
447
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
448
|
+
"One hero a page: the figure the page is about. The rest are lg or md.",
|
|
449
|
+
"Say what a change is measured against, every time: \"vs same time yesterday\", \"vs previous period\".",
|
|
450
|
+
"Put a fact that needs chasing in the meta with a warning dot (\"12 pending\"), not in the figure's colour.",
|
|
451
|
+
"A value that is a sentence is valueType=\"text\"; a figure is never cut short to fit."
|
|
452
|
+
] })]
|
|
453
|
+
}),
|
|
454
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
455
|
+
id: "accessibility",
|
|
456
|
+
title: "Accessibility",
|
|
457
|
+
children: [/* @__PURE__ */ jsx(Guidelines, { items: [
|
|
458
|
+
"The parts are read in the order they are drawn, with a space between each: the label, the figure, then the row under it; inline, the figure, its label and the change.",
|
|
459
|
+
"A hero's label is a heading (h2 by default), so the till can be found by its name. Pick the level that fits the page with labelAs.",
|
|
460
|
+
"The meta's dot is decorative: the words say what it marks.",
|
|
461
|
+
"A RollingNumber is read as its plain value, not its reels. Give it live to announce changes.",
|
|
462
|
+
"It moves nothing of its own. Its colours are text colours, so forced colours need nothing of their own."
|
|
463
|
+
] }), /* @__PURE__ */ jsxs(Note, {
|
|
464
|
+
title: "For tests and styling",
|
|
465
|
+
children: [
|
|
466
|
+
"Its root is ",
|
|
467
|
+
/* @__PURE__ */ jsx("code", { children: ".o-stat" }),
|
|
468
|
+
" (",
|
|
469
|
+
/* @__PURE__ */ jsx("code", { children: ".o-figure" }),
|
|
470
|
+
" is a strip's cell), with ",
|
|
471
|
+
/* @__PURE__ */ jsx("code", { children: "data-size" }),
|
|
472
|
+
",",
|
|
473
|
+
" ",
|
|
474
|
+
/* @__PURE__ */ jsx("code", { children: "data-layout" }),
|
|
475
|
+
" and ",
|
|
476
|
+
/* @__PURE__ */ jsx("code", { children: "data-value" }),
|
|
477
|
+
"."
|
|
478
|
+
]
|
|
479
|
+
})]
|
|
480
|
+
}),
|
|
481
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
482
|
+
id: "props",
|
|
483
|
+
title: "Props",
|
|
484
|
+
description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native div attribute except children." }),
|
|
485
|
+
children: /* @__PURE__ */ jsx(PropsTable, {
|
|
486
|
+
title: "Figure",
|
|
487
|
+
rows: [
|
|
488
|
+
{
|
|
489
|
+
name: "label",
|
|
490
|
+
type: "ReactNode",
|
|
491
|
+
required: true,
|
|
492
|
+
description: "Names the figure."
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
name: "value",
|
|
496
|
+
type: "ReactNode",
|
|
497
|
+
required: true,
|
|
498
|
+
description: "The figure, already formatted: a string, or a RollingNumber."
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
name: "size",
|
|
502
|
+
type: "'hero' | 'lg' | 'md'",
|
|
503
|
+
default: "'md'",
|
|
504
|
+
description: "3rem (2.5rem on a phone), 1.625rem or 1.3125rem."
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
name: "layout",
|
|
508
|
+
type: "'stack' | 'inline'",
|
|
509
|
+
default: "'stack'",
|
|
510
|
+
description: "The label over the figure, or the figure, its label and the change on one baseline."
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
name: "labelAs",
|
|
514
|
+
type: "'span' | 'p' | 'h2' | 'h3' | 'h4'",
|
|
515
|
+
default: "'h2' for hero, 'span' otherwise",
|
|
516
|
+
description: "The label's element."
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
name: "labelFirst",
|
|
520
|
+
type: "boolean",
|
|
521
|
+
default: "false",
|
|
522
|
+
description: "Inline only: the label before the figure."
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
name: "change",
|
|
526
|
+
type: "ReactNode",
|
|
527
|
+
description: "How it moved: usually a Delta, size=\"sm\"."
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
name: "hint",
|
|
531
|
+
type: "ReactNode",
|
|
532
|
+
description: "Quiet context after the change."
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
name: "meta",
|
|
536
|
+
type: "ReactNode",
|
|
537
|
+
description: "A fact beside the figure: \"3 orders\", \"12 pending\". Leads the row under a stacked figure; its own line inline."
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
name: "metaDot",
|
|
541
|
+
type: "string",
|
|
542
|
+
description: "A dot before the meta: a tone name, or any CSS colour."
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
name: "valueType",
|
|
546
|
+
type: "'figure' | 'text'",
|
|
547
|
+
default: "'figure'",
|
|
548
|
+
description: "text sets a worded value in body type, wrapping."
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "loading",
|
|
552
|
+
type: "boolean",
|
|
553
|
+
default: "false",
|
|
554
|
+
description: "A shimmer the figure's height; the change and the meta wait for the data."
|
|
555
|
+
}
|
|
556
|
+
]
|
|
557
|
+
})
|
|
558
|
+
})
|
|
559
|
+
]
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
//#endregion
|
|
563
|
+
export { Page, Preview };
|