@orbitcommerce/constellation-docs 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs.css +14764 -2237
- package/dist/index.js +2 -2
- package/dist/pages/{Playground-CNbBbErC.js → Playground-Mk1yIWXb.js} +2 -2
- 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-BDmScEny.js → _figures-data-DaDvB7Nm.js} +5 -5
- package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
- package/dist/pages/{_overlays-specimens-Dpn6oiyH.js → _overlays-specimens-bawR331Z.js} +33 -23
- 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-BD4e6QTh.js → alert-D3i7xZTU.js} +195 -50
- package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
- package/dist/pages/{app-shell-KbA-nRqZ.js → app-shell-D4hdlHps.js} +133 -54
- package/dist/pages/{area-chart-B91dLcGo.js → area-chart-BEWFwiB2.js} +183 -27
- package/dist/pages/{avatar-DPPHXJAu.js → avatar-BFEqQViw.js} +194 -12
- package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
- package/dist/pages/{badge-C9JR0thI.js → badge-0-PyMrih.js} +441 -135
- 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-D3V912P4.js → button-DAyfssDY.js} +276 -79
- package/dist/pages/{calendar-DSDZ9nRH.js → calendar-Ds7KsgSI.js} +69 -17
- 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-BwuO8xAv.js → colour-q2ntvI0w.js} +496 -20
- package/dist/pages/column-mapper-TsTG39cl.js +502 -0
- package/dist/pages/combobox-DvK2j5tI.js +1334 -0
- package/dist/pages/{command-palette-xAD7fOg6.js → command-palette-CJ7uBA04.js} +201 -58
- 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-BYSa816m.js → date-picker-GdBciR99.js} +186 -38
- package/dist/pages/date-time-BLKCXtVZ.js +678 -0
- package/dist/pages/{delta-CtAo0eIM.js → delta-CNAGv8JY.js} +266 -61
- 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-BNOb7AqR.js → docs-lM2UBSir.js} +20 -15
- 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-CoPFzzKz.js → figure-tabs-QOeQMY6N.js} +153 -35
- 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-CFQwDtC9.js → home-dashboard-CxPmvduE.js} +21 -18
- 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-C9eSVPPW.js → icon-button-Bu4Gj5sy.js} +370 -31
- package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
- package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
- package/dist/pages/{icons-sxkTs5Ob.js → icons-CJ9Aar3d.js} +315 -52
- 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-DpsX8G_n.js → installation-C3UcpQJT.js} +112 -29
- package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
- package/dist/pages/kanban-Dy9sPAI0.js +740 -0
- package/dist/pages/{kbd-cNfDoikz.js → kbd-UNj4zqxn.js} +15 -14
- 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-ClvLn9Lb.js → live-globe-95ROMhGQ.js} +191 -47
- 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-BfGF1Pq9.js → logo-B38rnzoq.js} +13 -13
- 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-by2sgQ09.js → menu-NrLYKqKp.js} +623 -109
- 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-BvTGc2Dk.js → motion-CrXtiBvA.js} +20 -10
- package/dist/pages/number-input-CuyMZg18.js +968 -0
- package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
- package/dist/pages/{orbit-spinner-Dil1Z3Oy.js → orbit-spinner-Dxv5qAhr.js} +30 -14
- package/dist/pages/otp-input-CVRoX1mw.js +591 -0
- package/dist/pages/{overview-BPEbZQ6g.js → overview-LA9XRhZc.js} +4 -4
- package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
- package/dist/pages/{pagination-BBUnGvv5.js → pagination-C1EgVtW4.js} +74 -29
- 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-Db1gLDpb.js → popover-C3Oar9D5.js} +76 -14
- 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-CeAIOIdt.js → principles-pnDyfHpK.js} +9 -9
- 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-CkdBWWfG.js → radio-group-C-4tg6FS.js} +580 -18
- 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-Dvo684UJ.js → release-Cs6tl16C.js} +4 -1
- 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-qmvH84Mq.js → rolling-number-GR3Cyfpz.js} +12 -12
- 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-BN7MWGQ4.js → search-field-D1uG7R6A.js} +15 -15
- 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-CTbIpRBW.js → segmented-control-D-FB1K1T.js} +450 -37
- package/dist/pages/{select-DguELoRR.js → select-DZ43NpOm.js} +22 -17
- package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
- package/dist/pages/{separator-CPZub9pv.js → separator-CFwqRvfO.js} +99 -22
- package/dist/pages/serp-preview-BGwORjmo.js +346 -0
- package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
- package/dist/pages/{shape-DKvA0YKr.js → shape-DzniHAVT.js} +10 -10
- 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-DMMYGbHn.js → sparkline-D3aavCly.js} +301 -22
- 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-B-Qe4kcT.js → switch-C93K6j9h.js} +151 -51
- package/dist/pages/table-CL0vomno.js +3225 -0
- package/dist/pages/{tabs-B4M-usCV.js → tabs-Dh0mUsLw.js} +256 -21
- package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
- package/dist/pages/task-card-Dv0sR1-w.js +295 -0
- package/dist/pages/{textarea-fTuUZRQb.js → textarea-CCM-SnGN.js} +271 -15
- 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-CKP03zjy.js → toast-zXLRiMRT.js} +240 -25
- package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
- package/dist/pages/toolbar-B9l_fHKy.js +754 -0
- package/dist/pages/{tooltip-CBYil3kt.js → tooltip-LHtCUkF-.js} +162 -33
- 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-PCbg8Bhg.js → typography-BSijtiRl.js} +153 -12
- 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 +10984 -1108
- package/package.json +2 -2
- package/dist/pages/card-DUggbis3.js +0 -659
- package/dist/pages/checkbox-DwimQaK3.js +0 -365
- package/dist/pages/dialog-BRAf4LMh.js +0 -1451
- package/dist/pages/empty-state-C-mLrXW2.js +0 -417
- package/dist/pages/input-KF9Gkawf.js +0 -1093
- package/dist/pages/registry-CroHzK9I.js +0 -244
- package/dist/pages/skeleton-DLuBhP46.js +0 -561
- package/dist/pages/table-AMoODng4.js +0 -607
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as DocLink } from "./host-B6znjEgQ.js";
|
|
3
|
-
import { a as DocTable, d as Section, 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-
|
|
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
4
|
import { useState } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { Button, Delta, formatDelta } from "@orbitcommerce/constellation";
|
|
6
|
+
import { Button, Delta, formatDelta, percentChange } from "@orbitcommerce/constellation";
|
|
7
7
|
import { CaretRightIcon } from "@orbitcommerce/constellation/icons";
|
|
8
8
|
//#region src/pages/components/delta.tsx
|
|
9
9
|
function Preview() {
|
|
@@ -46,7 +46,7 @@ function ChangingDelta() {
|
|
|
46
46
|
children: "Next day"
|
|
47
47
|
})] });
|
|
48
48
|
}
|
|
49
|
-
function FigureStrip() {
|
|
49
|
+
function FigureStrip$1() {
|
|
50
50
|
return /* @__PURE__ */ jsxs("div", {
|
|
51
51
|
className: "delta-strip",
|
|
52
52
|
children: [
|
|
@@ -127,10 +127,15 @@ function Page() {
|
|
|
127
127
|
return /* @__PURE__ */ jsxs(DocPage, {
|
|
128
128
|
title: "Delta",
|
|
129
129
|
status: "stable",
|
|
130
|
-
importNames: [
|
|
130
|
+
importNames: [
|
|
131
|
+
"Delta",
|
|
132
|
+
"formatDelta",
|
|
133
|
+
"percentChange",
|
|
134
|
+
"DELTA_LABELS"
|
|
135
|
+
],
|
|
131
136
|
lead: "How a figure moved: an arrow and a signed percentage on a tinted pill, with an optional comparison after it. It sits beside a figure and answers the merchant's next question: better or worse than before?",
|
|
132
137
|
children: [
|
|
133
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
138
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
134
139
|
id: "states",
|
|
135
140
|
title: "States",
|
|
136
141
|
description: /* @__PURE__ */ jsx("p", { children: "One arrow, turned to its heading: up and to the right when rising, down and to the right when falling, level when steady. A change under 0.5% either way is steady (noise, not news), so it stays neutral even though it keeps its sign. The pill is green when the change is good news and red when it is bad." }),
|
|
@@ -161,7 +166,7 @@ const [day, setDay] = useState(0)
|
|
|
161
166
|
})
|
|
162
167
|
})]
|
|
163
168
|
}),
|
|
164
|
-
/* @__PURE__ */ jsx(Section, {
|
|
169
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
165
170
|
id: "when-up-is-bad",
|
|
166
171
|
title: "When up is bad",
|
|
167
172
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -184,7 +189,127 @@ const [day, setDay] = useState(0)
|
|
|
184
189
|
})]
|
|
185
190
|
})
|
|
186
191
|
}),
|
|
187
|
-
/* @__PURE__ */ jsx(Section, {
|
|
192
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
193
|
+
id: "no-baseline",
|
|
194
|
+
title: "When there was nothing before",
|
|
195
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
196
|
+
"A change from 0 has no rate: dividing by nothing would say \"infinite\". ",
|
|
197
|
+
/* @__PURE__ */ jsx("code", { children: "percentChange(current, previous)" }),
|
|
198
|
+
" gives ",
|
|
199
|
+
/* @__PURE__ */ jsx("code", { children: "Infinity" }),
|
|
200
|
+
" then, and the delta says \"Up from 0\" in place of the percent, in the neutral tone, with the arrow still saying which way it went. ",
|
|
201
|
+
/* @__PURE__ */ jsx("code", { children: "noBaseline" }),
|
|
202
|
+
" says the same for a value you worked out yourself. Since nothing is compared, ",
|
|
203
|
+
/* @__PURE__ */ jsx("code", { children: "baselineLabel" }),
|
|
204
|
+
" takes the place of",
|
|
205
|
+
" ",
|
|
206
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
207
|
+
": \"in the previous 30 days\". Nothing on both sides is steady, 0.0%."
|
|
208
|
+
] }),
|
|
209
|
+
children: /* @__PURE__ */ jsxs(Example, {
|
|
210
|
+
code: `
|
|
211
|
+
<Delta value={percentChange(14, 0)} label="vs previous 30 days" baselineLabel="in the previous 30 days" />
|
|
212
|
+
<Delta value={-6} noBaseline />
|
|
213
|
+
<Delta value={percentChange(0, 0)} label="vs previous 30 days" />`,
|
|
214
|
+
children: [
|
|
215
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
216
|
+
value: percentChange(14, 0),
|
|
217
|
+
label: "vs previous 30 days",
|
|
218
|
+
baselineLabel: "in the previous 30 days"
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
221
|
+
value: -6,
|
|
222
|
+
noBaseline: true
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
225
|
+
value: percentChange(0, 0),
|
|
226
|
+
label: "vs previous 30 days"
|
|
227
|
+
})
|
|
228
|
+
]
|
|
229
|
+
})
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
232
|
+
id: "sentence",
|
|
233
|
+
title: "As a sentence",
|
|
234
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
235
|
+
/* @__PURE__ */ jsx("code", { children: "variant=\"sentence\"" }),
|
|
236
|
+
" drops the pill and the arrow for one line of words in the tone's colour, the percent a little heavier than the comparison: the line under a figure in a strip of counts, where a pill would be one more shape. A change that rounds to nothing says \"No change\", and no baseline says \"Up from 0\". It wraps like a sentence. ",
|
|
237
|
+
/* @__PURE__ */ jsx("code", { children: "md" }),
|
|
238
|
+
" is 13px, ",
|
|
239
|
+
/* @__PURE__ */ jsx("code", { children: "sm" }),
|
|
240
|
+
" 12px."
|
|
241
|
+
] }),
|
|
242
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
243
|
+
align: "start",
|
|
244
|
+
code: `
|
|
245
|
+
<Delta variant="sentence" value={25} label="vs previous 30 days" />
|
|
246
|
+
<Delta variant="sentence" value={-10} label="vs previous 30 days" />
|
|
247
|
+
<Delta variant="sentence" value={0} label="vs previous 30 days" />
|
|
248
|
+
<Delta variant="sentence" value={percentChange(14, 0)} baselineLabel="in the previous 30 days" />
|
|
249
|
+
<Delta variant="sentence" size="sm" value={12.5} positiveIsGood={false} label="refunds vs last month" />`,
|
|
250
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
251
|
+
className: "delta-sentences",
|
|
252
|
+
children: [
|
|
253
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
254
|
+
variant: "sentence",
|
|
255
|
+
value: 25,
|
|
256
|
+
label: "vs previous 30 days"
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
259
|
+
variant: "sentence",
|
|
260
|
+
value: -10,
|
|
261
|
+
label: "vs previous 30 days"
|
|
262
|
+
}),
|
|
263
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
264
|
+
variant: "sentence",
|
|
265
|
+
value: 0,
|
|
266
|
+
label: "vs previous 30 days"
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
269
|
+
variant: "sentence",
|
|
270
|
+
value: percentChange(14, 0),
|
|
271
|
+
baselineLabel: "in the previous 30 days"
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
274
|
+
variant: "sentence",
|
|
275
|
+
size: "sm",
|
|
276
|
+
value: 12.5,
|
|
277
|
+
positiveIsGood: false,
|
|
278
|
+
label: "refunds vs last month"
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
})
|
|
282
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
283
|
+
title: "Under a figure",
|
|
284
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
285
|
+
align: "start",
|
|
286
|
+
code: `
|
|
287
|
+
<span className="label">Profile views</span>
|
|
288
|
+
<span className="figure">1,204</span>
|
|
289
|
+
<Delta variant="sentence" value={percentChange(1204, 963)} precision={0} label="vs previous 30 days" />`,
|
|
290
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
291
|
+
className: "delta-stat",
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ jsx("span", {
|
|
294
|
+
className: "delta-stat__label",
|
|
295
|
+
children: "Profile views"
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ jsx("span", {
|
|
298
|
+
className: "delta-figure",
|
|
299
|
+
children: "1,204"
|
|
300
|
+
}),
|
|
301
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
302
|
+
variant: "sentence",
|
|
303
|
+
value: percentChange(1204, 963),
|
|
304
|
+
precision: 0,
|
|
305
|
+
label: "vs previous 30 days"
|
|
306
|
+
})
|
|
307
|
+
]
|
|
308
|
+
})
|
|
309
|
+
})
|
|
310
|
+
})]
|
|
311
|
+
}),
|
|
312
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
188
313
|
id: "with-figures",
|
|
189
314
|
title: "Beside a figure",
|
|
190
315
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -215,10 +340,10 @@ const [day, setDay] = useState(0)
|
|
|
215
340
|
<span className="label">Refunds</span>
|
|
216
341
|
<span className="figure">£182.00</span>
|
|
217
342
|
<Delta value={12.5} positiveIsGood={false} label="vs last month" />`,
|
|
218
|
-
children: /* @__PURE__ */ jsx(FigureStrip, {})
|
|
343
|
+
children: /* @__PURE__ */ jsx(FigureStrip$1, {})
|
|
219
344
|
})
|
|
220
345
|
}),
|
|
221
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
346
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
222
347
|
id: "sizes",
|
|
223
348
|
title: "Sizes",
|
|
224
349
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -331,7 +456,7 @@ const [day, setDay] = useState(0)
|
|
|
331
456
|
})
|
|
332
457
|
})]
|
|
333
458
|
}),
|
|
334
|
-
/* @__PURE__ */ jsx(Section, {
|
|
459
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
335
460
|
id: "precision",
|
|
336
461
|
title: "Precision",
|
|
337
462
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -359,7 +484,7 @@ const [day, setDay] = useState(0)
|
|
|
359
484
|
]
|
|
360
485
|
})
|
|
361
486
|
}),
|
|
362
|
-
/* @__PURE__ */ jsx(Section, {
|
|
487
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
363
488
|
id: "both-themes",
|
|
364
489
|
title: "In both themes",
|
|
365
490
|
description: /* @__PURE__ */ jsx("p", { children: "Every state and both sizes, light and dark side by side." }),
|
|
@@ -404,11 +529,38 @@ const [day, setDay] = useState(0)
|
|
|
404
529
|
value: .3
|
|
405
530
|
})
|
|
406
531
|
]
|
|
532
|
+
}),
|
|
533
|
+
/* @__PURE__ */ jsx("div", {
|
|
534
|
+
className: "delta-row",
|
|
535
|
+
children: /* @__PURE__ */ jsx(Delta, {
|
|
536
|
+
value: Number.POSITIVE_INFINITY,
|
|
537
|
+
baselineLabel: "in the previous 30 days"
|
|
538
|
+
})
|
|
539
|
+
}),
|
|
540
|
+
/* @__PURE__ */ jsxs("div", {
|
|
541
|
+
className: "delta-sentences",
|
|
542
|
+
children: [
|
|
543
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
544
|
+
variant: "sentence",
|
|
545
|
+
value: 25,
|
|
546
|
+
label: "vs previous 30 days"
|
|
547
|
+
}),
|
|
548
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
549
|
+
variant: "sentence",
|
|
550
|
+
value: -10,
|
|
551
|
+
label: "vs previous 30 days"
|
|
552
|
+
}),
|
|
553
|
+
/* @__PURE__ */ jsx(Delta, {
|
|
554
|
+
variant: "sentence",
|
|
555
|
+
value: 0,
|
|
556
|
+
label: "vs previous 30 days"
|
|
557
|
+
})
|
|
558
|
+
]
|
|
407
559
|
})
|
|
408
560
|
]
|
|
409
561
|
}) })
|
|
410
562
|
}),
|
|
411
|
-
/* @__PURE__ */ jsx(Section, {
|
|
563
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
412
564
|
id: "format-delta",
|
|
413
565
|
title: "formatDelta",
|
|
414
566
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -427,7 +579,7 @@ const [day, setDay] = useState(0)
|
|
|
427
579
|
]
|
|
428
580
|
})
|
|
429
581
|
}),
|
|
430
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
582
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
431
583
|
id: "guidelines",
|
|
432
584
|
title: "Guidelines",
|
|
433
585
|
children: [
|
|
@@ -484,13 +636,14 @@ const [day, setDay] = useState(0)
|
|
|
484
636
|
] })
|
|
485
637
|
]
|
|
486
638
|
}),
|
|
487
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
639
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
488
640
|
id: "accessibility",
|
|
489
641
|
title: "Accessibility",
|
|
490
642
|
children: [/* @__PURE__ */ jsx(Guidelines, { items: [
|
|
491
643
|
"The value carries the direction in text: a plus for a rise, a true minus sign for a fall, which screen readers read as minus. The arrow is hidden.",
|
|
492
644
|
"Whether the change is good is shown by colour alone. Where it matters, say it in words nearby, for example in the label (\"refunds vs last month\") or a summary line.",
|
|
493
|
-
"The comparison label is read straight after the value.",
|
|
645
|
+
"The comparison label is read straight after the value. In the sentence form the whole line is words, read as one: \"+25.0% vs previous 30 days\".",
|
|
646
|
+
"With no baseline the words say it (\"Up from 0\"), so a reader is never told a change is 0% when it is not.",
|
|
494
647
|
"Under reduced motion the arrow turns to its new heading at once instead of swinging; the colour change stays."
|
|
495
648
|
] }), /* @__PURE__ */ jsxs(Note, {
|
|
496
649
|
title: "For tests and styling",
|
|
@@ -501,71 +654,123 @@ const [day, setDay] = useState(0)
|
|
|
501
654
|
/* @__PURE__ */ jsx("code", { children: "rising" }),
|
|
502
655
|
", ",
|
|
503
656
|
/* @__PURE__ */ jsx("code", { children: "falling" }),
|
|
504
|
-
" or
|
|
657
|
+
" or",
|
|
658
|
+
" ",
|
|
505
659
|
/* @__PURE__ */ jsx("code", { children: "steady" }),
|
|
506
|
-
")
|
|
660
|
+
"), ",
|
|
507
661
|
/* @__PURE__ */ jsx("code", { children: "data-tone" }),
|
|
508
662
|
" (",
|
|
509
663
|
/* @__PURE__ */ jsx("code", { children: "positive" }),
|
|
510
664
|
", ",
|
|
511
665
|
/* @__PURE__ */ jsx("code", { children: "negative" }),
|
|
512
|
-
" or
|
|
666
|
+
" or",
|
|
667
|
+
" ",
|
|
513
668
|
/* @__PURE__ */ jsx("code", { children: "neutral" }),
|
|
514
|
-
")
|
|
669
|
+
"),",
|
|
670
|
+
" ",
|
|
671
|
+
/* @__PURE__ */ jsx("code", { children: "data-variant" }),
|
|
672
|
+
" (",
|
|
673
|
+
/* @__PURE__ */ jsx("code", { children: "pill" }),
|
|
674
|
+
" or ",
|
|
675
|
+
/* @__PURE__ */ jsx("code", { children: "sentence" }),
|
|
676
|
+
"), and ",
|
|
677
|
+
/* @__PURE__ */ jsx("code", { children: "data-baseline=\"none\"" }),
|
|
678
|
+
" ",
|
|
679
|
+
"when there was nothing before."
|
|
515
680
|
]
|
|
516
681
|
})]
|
|
517
682
|
}),
|
|
518
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
683
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
519
684
|
id: "props",
|
|
520
685
|
title: "Props",
|
|
521
686
|
description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native span attribute except children." }),
|
|
522
|
-
children: [
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
687
|
+
children: [
|
|
688
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
689
|
+
title: "Delta",
|
|
690
|
+
rows: [
|
|
691
|
+
{
|
|
692
|
+
name: "value",
|
|
693
|
+
type: "number",
|
|
694
|
+
required: true,
|
|
695
|
+
description: "Percentage change: 18.2 for +18.2%. Infinity (no baseline) says \"Up from 0\"; anything else that is not a finite number reads as 0."
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
name: "positiveIsGood",
|
|
699
|
+
type: "boolean",
|
|
700
|
+
default: "true",
|
|
701
|
+
description: "Whether a rise is good news. Set false for refunds, returns and abandoned checkouts."
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
name: "precision",
|
|
705
|
+
type: "number",
|
|
706
|
+
default: "1",
|
|
707
|
+
description: "Decimal places, 0 to 4."
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
name: "label",
|
|
711
|
+
type: "ReactNode",
|
|
712
|
+
description: "The comparison after the pill, e.g. \"vs yesterday\"."
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
name: "size",
|
|
716
|
+
type: "'sm' | 'md'",
|
|
717
|
+
default: "'md'",
|
|
718
|
+
description: "18px for tables and dense rows, 22px beside figures. The sentence form: 12px and 13px."
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
name: "variant",
|
|
722
|
+
type: "'pill' | 'sentence'",
|
|
723
|
+
default: "'pill'",
|
|
724
|
+
description: "The pill, or one toned line of words with no pill and no arrow."
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
name: "noBaseline",
|
|
728
|
+
type: "boolean",
|
|
729
|
+
default: "false",
|
|
730
|
+
description: "The earlier figure was 0: says \"Up from 0\" (or \"Down from 0\") in place of the percent. A value of Infinity says the same."
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
name: "baselineLabel",
|
|
734
|
+
type: "ReactNode",
|
|
735
|
+
default: "label",
|
|
736
|
+
description: "The comparison with no baseline, in place of label: \"in the previous 30 days\"."
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
name: "labels",
|
|
740
|
+
type: "Partial<DeltaLabels>",
|
|
741
|
+
description: "Its words: upFromZero, downFromZero, and noChange (the sentence form). DELTA_LABELS is the English set."
|
|
742
|
+
}
|
|
743
|
+
]
|
|
744
|
+
}),
|
|
745
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
746
|
+
title: "percentChange(current, previous)",
|
|
747
|
+
rows: [{
|
|
748
|
+
name: "current",
|
|
749
|
+
type: "number",
|
|
750
|
+
required: true,
|
|
751
|
+
description: "This period's figure."
|
|
752
|
+
}, {
|
|
753
|
+
name: "previous",
|
|
754
|
+
type: "number",
|
|
755
|
+
required: true,
|
|
756
|
+
description: "The earlier figure. 0 gives Infinity (or -Infinity for a fall; 0 when both are 0); a negative one is measured by its size."
|
|
757
|
+
}]
|
|
758
|
+
}),
|
|
759
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
760
|
+
title: "formatDelta(value, precision)",
|
|
761
|
+
rows: [{
|
|
526
762
|
name: "value",
|
|
527
763
|
type: "number",
|
|
528
764
|
required: true,
|
|
529
|
-
description: "Percentage change
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
name: "positiveIsGood",
|
|
533
|
-
type: "boolean",
|
|
534
|
-
default: "true",
|
|
535
|
-
description: "Whether a rise is good news. Set false for refunds, returns and abandoned checkouts."
|
|
536
|
-
},
|
|
537
|
-
{
|
|
765
|
+
description: "Percentage change."
|
|
766
|
+
}, {
|
|
538
767
|
name: "precision",
|
|
539
768
|
type: "number",
|
|
540
769
|
default: "1",
|
|
541
|
-
description: "Decimal places, 0
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
type: "ReactNode",
|
|
546
|
-
description: "The comparison after the pill, e.g. \"vs yesterday\"."
|
|
547
|
-
},
|
|
548
|
-
{
|
|
549
|
-
name: "size",
|
|
550
|
-
type: "'sm' | 'md'",
|
|
551
|
-
default: "'md'",
|
|
552
|
-
description: "18px for tables and dense rows, 22px beside figures."
|
|
553
|
-
}
|
|
554
|
-
]
|
|
555
|
-
}), /* @__PURE__ */ jsx(PropsTable, {
|
|
556
|
-
title: "formatDelta(value, precision)",
|
|
557
|
-
rows: [{
|
|
558
|
-
name: "value",
|
|
559
|
-
type: "number",
|
|
560
|
-
required: true,
|
|
561
|
-
description: "Percentage change."
|
|
562
|
-
}, {
|
|
563
|
-
name: "precision",
|
|
564
|
-
type: "number",
|
|
565
|
-
default: "1",
|
|
566
|
-
description: "Decimal places, rounded and held between 0 and 4."
|
|
567
|
-
}]
|
|
568
|
-
})]
|
|
770
|
+
description: "Decimal places, rounded and held between 0 and 4."
|
|
771
|
+
}]
|
|
772
|
+
})
|
|
773
|
+
]
|
|
569
774
|
})
|
|
570
775
|
]
|
|
571
776
|
});
|