@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,1113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
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";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Button, Card, CardBody, CardHeader, EmptyState, OrbitMark, SegmentedControl, Select } from "@orbitcommerce/constellation";
|
|
6
|
+
import { ArrowCounterClockwiseIcon, ArrowLeftIcon, HouseIcon, NotePencilIcon, PlusIcon, ShareNetworkIcon, UploadSimpleIcon } from "@orbitcommerce/constellation/icons";
|
|
7
|
+
//#region src/pages/components/empty-state.tsx
|
|
8
|
+
function Preview() {
|
|
9
|
+
return /* @__PURE__ */ jsx(EmptyState, {
|
|
10
|
+
size: "sm",
|
|
11
|
+
titleAs: "p",
|
|
12
|
+
title: "No orders yet",
|
|
13
|
+
description: "Share your store to bring in the first one.",
|
|
14
|
+
className: "empty-state-preview",
|
|
15
|
+
style: { padding: 0 }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/** A drawn picture for the illustration examples: a price tag on a stack of cards, in the kit's own tokens. */
|
|
19
|
+
function DiscountArt() {
|
|
20
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
21
|
+
viewBox: "0 0 256 160",
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
className: "empty-state-art",
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsx("rect", {
|
|
26
|
+
x: "40",
|
|
27
|
+
y: "40",
|
|
28
|
+
width: "150",
|
|
29
|
+
height: "96",
|
|
30
|
+
rx: "14",
|
|
31
|
+
className: "empty-state-art__card empty-state-art__card--back"
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ jsx("rect", {
|
|
34
|
+
x: "62",
|
|
35
|
+
y: "24",
|
|
36
|
+
width: "150",
|
|
37
|
+
height: "96",
|
|
38
|
+
rx: "14",
|
|
39
|
+
className: "empty-state-art__card"
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ jsx("path", {
|
|
42
|
+
d: "M150 52h34l18 18-34 34-18-18z",
|
|
43
|
+
className: "empty-state-art__tag"
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx("circle", {
|
|
46
|
+
cx: "176",
|
|
47
|
+
cy: "66",
|
|
48
|
+
r: "5",
|
|
49
|
+
className: "empty-state-art__hole"
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ jsx("rect", {
|
|
52
|
+
x: "82",
|
|
53
|
+
y: "48",
|
|
54
|
+
width: "52",
|
|
55
|
+
height: "10",
|
|
56
|
+
rx: "5",
|
|
57
|
+
className: "empty-state-art__line"
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ jsx("rect", {
|
|
60
|
+
x: "82",
|
|
61
|
+
y: "68",
|
|
62
|
+
width: "34",
|
|
63
|
+
height: "10",
|
|
64
|
+
rx: "5",
|
|
65
|
+
className: "empty-state-art__line empty-state-art__line--quiet"
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The affiliate dashboard's email verification screen: it arrives checking the link, then says how it went, in place. The
|
|
72
|
+
* buttons stand in for the server's answer.
|
|
73
|
+
*/
|
|
74
|
+
function VerifyEmail() {
|
|
75
|
+
const [outcome, setOutcome] = useState("verifying");
|
|
76
|
+
const verifying = outcome === "verifying";
|
|
77
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
78
|
+
className: "empty-state-verify",
|
|
79
|
+
children: [/* @__PURE__ */ jsx(EmptyState, {
|
|
80
|
+
loading: verifying,
|
|
81
|
+
tone: outcome === "failed" ? "error" : "success",
|
|
82
|
+
titleAs: "h2",
|
|
83
|
+
title: verifying ? "Verifying your email..." : outcome === "verified" ? "Email verified" : "Verification failed",
|
|
84
|
+
description: verifying ? "This takes a moment." : outcome === "verified" ? "You can now sign in to your affiliate dashboard." : "The link has expired. Ask for a new one and try again.",
|
|
85
|
+
actions: verifying ? void 0 : outcome === "verified" ? /* @__PURE__ */ jsx(Button, {
|
|
86
|
+
variant: "primary",
|
|
87
|
+
children: "Sign in"
|
|
88
|
+
}) : /* @__PURE__ */ jsx(Button, {
|
|
89
|
+
variant: "secondary",
|
|
90
|
+
children: "Send a new link"
|
|
91
|
+
})
|
|
92
|
+
}), /* @__PURE__ */ jsx(SegmentedControl, {
|
|
93
|
+
size: "sm",
|
|
94
|
+
"aria-label": "The server's answer",
|
|
95
|
+
value: outcome,
|
|
96
|
+
onValueChange: setOutcome,
|
|
97
|
+
options: [
|
|
98
|
+
{
|
|
99
|
+
value: "verifying",
|
|
100
|
+
label: "Verifying"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
value: "verified",
|
|
104
|
+
label: "Verified"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
value: "failed",
|
|
108
|
+
label: "Failed"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/** The plugin subscribe gate: a plan to choose between the words and Subscribe. */
|
|
115
|
+
function SubscribeGate() {
|
|
116
|
+
const [plan, setPlan] = useState("monthly");
|
|
117
|
+
return /* @__PURE__ */ jsx(EmptyState, {
|
|
118
|
+
title: "Subscribe to activate Live chat",
|
|
119
|
+
description: "Chat with customers on your storefront, and keep every conversation in one inbox.",
|
|
120
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
121
|
+
variant: "primary",
|
|
122
|
+
children: "Subscribe"
|
|
123
|
+
}),
|
|
124
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
125
|
+
className: "empty-state-plan",
|
|
126
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
127
|
+
className: "empty-state-plan__label",
|
|
128
|
+
id: "empty-state-plan",
|
|
129
|
+
children: "Plan"
|
|
130
|
+
}), /* @__PURE__ */ jsx(Select, {
|
|
131
|
+
"aria-labelledby": "empty-state-plan",
|
|
132
|
+
value: plan,
|
|
133
|
+
onValueChange: setPlan,
|
|
134
|
+
options: [{
|
|
135
|
+
value: "monthly",
|
|
136
|
+
label: "Live chat (£12 a month)"
|
|
137
|
+
}, {
|
|
138
|
+
value: "team",
|
|
139
|
+
label: "Live chat for teams (£29 a month)"
|
|
140
|
+
}]
|
|
141
|
+
})]
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function NoOrdersYet() {
|
|
146
|
+
return /* @__PURE__ */ jsx(EmptyState, {
|
|
147
|
+
title: "No orders yet",
|
|
148
|
+
description: "When customers buy, their orders land here. Share your store to bring in the first one.",
|
|
149
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
150
|
+
variant: "primary",
|
|
151
|
+
icon: /* @__PURE__ */ jsx(ShareNetworkIcon, {}),
|
|
152
|
+
children: "Share your store"
|
|
153
|
+
}), /* @__PURE__ */ jsx(Button, { children: "Create draft order" })] })
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function NoProductsYet() {
|
|
157
|
+
return /* @__PURE__ */ jsx(EmptyState, {
|
|
158
|
+
title: "No products yet",
|
|
159
|
+
description: "Add your first product, or bring your catalogue across from a spreadsheet.",
|
|
160
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
161
|
+
variant: "primary",
|
|
162
|
+
icon: /* @__PURE__ */ jsx(PlusIcon, {}),
|
|
163
|
+
children: "Add product"
|
|
164
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
165
|
+
icon: /* @__PURE__ */ jsx(UploadSimpleIcon, {}),
|
|
166
|
+
children: "Import CSV"
|
|
167
|
+
})] })
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function Arrival() {
|
|
171
|
+
const [run, setRun] = useState(0);
|
|
172
|
+
return /* @__PURE__ */ jsx(Example, {
|
|
173
|
+
code: `
|
|
174
|
+
<EmptyState
|
|
175
|
+
title="No products yet"
|
|
176
|
+
description="Add your first product, or bring your catalogue across from a spreadsheet."
|
|
177
|
+
actions={
|
|
178
|
+
<>
|
|
179
|
+
<Button variant="primary" icon={<PlusIcon />}>Add product</Button>
|
|
180
|
+
<Button icon={<UploadSimpleIcon />}>Import CSV</Button>
|
|
181
|
+
</>
|
|
182
|
+
}
|
|
183
|
+
/>`,
|
|
184
|
+
caption: /* @__PURE__ */ jsx(Button, {
|
|
185
|
+
size: "xs",
|
|
186
|
+
variant: "soft",
|
|
187
|
+
icon: /* @__PURE__ */ jsx(ArrowCounterClockwiseIcon, {}),
|
|
188
|
+
onClick: () => setRun((n) => n + 1),
|
|
189
|
+
children: "Replay the arrival"
|
|
190
|
+
}),
|
|
191
|
+
children: /* @__PURE__ */ jsx(NoProductsYet, {}, run)
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function NotFound() {
|
|
195
|
+
const [run, setRun] = useState(0);
|
|
196
|
+
return /* @__PURE__ */ jsx(Example, {
|
|
197
|
+
code: `
|
|
198
|
+
// A not-found page of your own makes the title the page's heading: titleAs="h1". Inside this page it is a paragraph.
|
|
199
|
+
<EmptyState
|
|
200
|
+
size="lg"
|
|
201
|
+
titleAs="p"
|
|
202
|
+
mark={<OrbitMark state="adrift" />}
|
|
203
|
+
title="Lost in orbit?"
|
|
204
|
+
description="The page you're looking for drifted off. It may have been moved or deleted, or the address was mistyped."
|
|
205
|
+
actions={
|
|
206
|
+
<>
|
|
207
|
+
<Button icon={<ArrowLeftIcon />}>Go back</Button>
|
|
208
|
+
<Button variant="primary" icon={<HouseIcon />}>Dashboard</Button>
|
|
209
|
+
</>
|
|
210
|
+
}
|
|
211
|
+
/>`,
|
|
212
|
+
caption: /* @__PURE__ */ jsx(Button, {
|
|
213
|
+
size: "xs",
|
|
214
|
+
variant: "soft",
|
|
215
|
+
icon: /* @__PURE__ */ jsx(ArrowCounterClockwiseIcon, {}),
|
|
216
|
+
onClick: () => setRun((n) => n + 1),
|
|
217
|
+
children: "Replay the drift"
|
|
218
|
+
}),
|
|
219
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
220
|
+
size: "lg",
|
|
221
|
+
titleAs: "p",
|
|
222
|
+
mark: /* @__PURE__ */ jsx(OrbitMark, { state: "adrift" }),
|
|
223
|
+
title: "Lost in orbit?",
|
|
224
|
+
description: "The page you're looking for drifted off. It may have been moved or deleted, or the address was mistyped.",
|
|
225
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
226
|
+
icon: /* @__PURE__ */ jsx(ArrowLeftIcon, {}),
|
|
227
|
+
children: "Go back"
|
|
228
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
229
|
+
variant: "primary",
|
|
230
|
+
icon: /* @__PURE__ */ jsx(HouseIcon, {}),
|
|
231
|
+
children: "Dashboard"
|
|
232
|
+
})] })
|
|
233
|
+
}, run)
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
/** A failed load whose retry runs for a moment and fails again, so the spinner on the button can be seen. */
|
|
237
|
+
function FailedLoad({ placement, size, title = "Couldn't load orders", description = "Check your connection and try again.", detail = "503 /api/orders", technicalDetails }) {
|
|
238
|
+
const [retrying, setRetrying] = useState(false);
|
|
239
|
+
const timer = useRef(void 0);
|
|
240
|
+
useEffect(() => () => window.clearTimeout(timer.current), []);
|
|
241
|
+
return /* @__PURE__ */ jsx(EmptyState, {
|
|
242
|
+
tone: "error",
|
|
243
|
+
placement,
|
|
244
|
+
size,
|
|
245
|
+
titleAs: size === "lg" ? "h2" : void 0,
|
|
246
|
+
className: placement === "page" ? "empty-state-page" : void 0,
|
|
247
|
+
title,
|
|
248
|
+
description,
|
|
249
|
+
detail,
|
|
250
|
+
technicalDetails,
|
|
251
|
+
retrying,
|
|
252
|
+
onRetry: () => {
|
|
253
|
+
setRetrying(true);
|
|
254
|
+
timer.current = window.setTimeout(() => setRetrying(false), 1800);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* A failed load that fails once more and then works, as a retry does on a bad connection: the panel says it is retrying, says
|
|
260
|
+
* its words again when it fails again, and when it works the page's own content takes over and takes focus.
|
|
261
|
+
*/
|
|
262
|
+
function RetryOutcome() {
|
|
263
|
+
const [state, setState] = useState("failed");
|
|
264
|
+
const attempts = useRef(0);
|
|
265
|
+
const timer = useRef(void 0);
|
|
266
|
+
const heading = useRef(null);
|
|
267
|
+
useEffect(() => () => window.clearTimeout(timer.current), []);
|
|
268
|
+
useEffect(() => {
|
|
269
|
+
if (state === "loaded") heading.current?.focus();
|
|
270
|
+
}, [state]);
|
|
271
|
+
return /* @__PURE__ */ jsx(Example, {
|
|
272
|
+
align: "fill",
|
|
273
|
+
code: `
|
|
274
|
+
const heading = useRef<HTMLElement>(null)
|
|
275
|
+
const failedBefore = useRef(false)
|
|
276
|
+
|
|
277
|
+
// Remember that it failed: a first load that works never had a panel to leave, so focus is left where it is.
|
|
278
|
+
useEffect(() => {
|
|
279
|
+
if (orders.isError) failedBefore.current = true
|
|
280
|
+
}, [orders.isError])
|
|
281
|
+
|
|
282
|
+
// A retry that works replaces the panel with your content and focus falls to the page: send it to the heading.
|
|
283
|
+
useEffect(() => {
|
|
284
|
+
if (orders.isSuccess && failedBefore.current) heading.current?.focus()
|
|
285
|
+
}, [orders.isSuccess])
|
|
286
|
+
|
|
287
|
+
{orders.isError ? (
|
|
288
|
+
<Card padding="none">
|
|
289
|
+
<EmptyState
|
|
290
|
+
tone="error"
|
|
291
|
+
title="Couldn't load orders"
|
|
292
|
+
description="Check your connection and try again."
|
|
293
|
+
detail="503 /api/orders"
|
|
294
|
+
onRetry={orders.refetch}
|
|
295
|
+
retrying={orders.isFetching}
|
|
296
|
+
/>
|
|
297
|
+
</Card>
|
|
298
|
+
) : (
|
|
299
|
+
<Card>
|
|
300
|
+
<CardHeader title="Orders" titleRef={heading} />
|
|
301
|
+
<CardBody>…</CardBody>
|
|
302
|
+
</Card>
|
|
303
|
+
)}`,
|
|
304
|
+
caption: /* @__PURE__ */ jsx(Button, {
|
|
305
|
+
size: "xs",
|
|
306
|
+
variant: "soft",
|
|
307
|
+
icon: /* @__PURE__ */ jsx(ArrowCounterClockwiseIcon, {}),
|
|
308
|
+
onClick: () => {
|
|
309
|
+
window.clearTimeout(timer.current);
|
|
310
|
+
attempts.current = 0;
|
|
311
|
+
setState("failed");
|
|
312
|
+
},
|
|
313
|
+
children: "Start again"
|
|
314
|
+
}),
|
|
315
|
+
children: state === "loaded" ? /* @__PURE__ */ jsxs(Card, {
|
|
316
|
+
className: "empty-state-loaded",
|
|
317
|
+
children: [/* @__PURE__ */ jsx(CardHeader, {
|
|
318
|
+
title: "Orders",
|
|
319
|
+
titleRef: heading
|
|
320
|
+
}), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsxs("ul", {
|
|
321
|
+
className: "empty-state-loaded__list",
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ jsx("li", { children: "#1048 Amara Okafor" }),
|
|
324
|
+
/* @__PURE__ */ jsx("li", { children: "#1047 Callum Reid" }),
|
|
325
|
+
/* @__PURE__ */ jsx("li", { children: "#1046 Grace Liu" })
|
|
326
|
+
]
|
|
327
|
+
}) })]
|
|
328
|
+
}) : /* @__PURE__ */ jsx(Card, {
|
|
329
|
+
padding: "none",
|
|
330
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
331
|
+
tone: "error",
|
|
332
|
+
title: "Couldn't load orders",
|
|
333
|
+
description: "Check your connection and try again.",
|
|
334
|
+
detail: "503 /api/orders",
|
|
335
|
+
retrying: state === "retrying",
|
|
336
|
+
onRetry: () => {
|
|
337
|
+
attempts.current += 1;
|
|
338
|
+
setState("retrying");
|
|
339
|
+
timer.current = window.setTimeout(() => setState(attempts.current >= 2 ? "loaded" : "failed"), 1400);
|
|
340
|
+
}
|
|
341
|
+
})
|
|
342
|
+
})
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
function Page() {
|
|
346
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
347
|
+
title: "Empty state",
|
|
348
|
+
status: "stable",
|
|
349
|
+
importNames: ["EmptyState", "OrbitMark"],
|
|
350
|
+
lead: "What a view shows before there is anything in it: a small drawn orbit, a plain title, a line on what will appear, and the next move. Emptiness is an invitation to act, never a dead end. And when a view could not load, the same component says so.",
|
|
351
|
+
children: [
|
|
352
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
353
|
+
id: "pages-and-cards",
|
|
354
|
+
title: "In a page or a card",
|
|
355
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "md" }), ", the default, is for a whole page or a card that has nothing in it yet. Give it the move that fills it: when the empty state is the page's main content, that move is the page's one primary button."] }),
|
|
356
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
357
|
+
code: `
|
|
358
|
+
<EmptyState
|
|
359
|
+
title="No orders yet"
|
|
360
|
+
description="When customers buy, their orders land here. Share your store to bring in the first one."
|
|
361
|
+
actions={
|
|
362
|
+
<>
|
|
363
|
+
<Button variant="primary" icon={<ShareNetworkIcon />}>Share your store</Button>
|
|
364
|
+
<Button>Create draft order</Button>
|
|
365
|
+
</>
|
|
366
|
+
}
|
|
367
|
+
/>`,
|
|
368
|
+
children: /* @__PURE__ */ jsx(NoOrdersYet, {})
|
|
369
|
+
})
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
372
|
+
id: "panels-and-results",
|
|
373
|
+
title: "In a panel or a list of results",
|
|
374
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "sm" }), " tightens everything (a 14px title, less padding, and no mark) for panels, search results and filtered lists. It says why the list is empty, and the action undoes whatever emptied it. The mark stays off at this size: two or three small planets side by side on one screen read as clutter."] }),
|
|
375
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
376
|
+
align: "fill",
|
|
377
|
+
code: `
|
|
378
|
+
<Card padding="none">
|
|
379
|
+
<EmptyState
|
|
380
|
+
size="sm"
|
|
381
|
+
title="No products match “oak desk”"
|
|
382
|
+
description="Try a shorter search, or check the spelling."
|
|
383
|
+
actions={<Button size="sm" variant="soft">Clear search</Button>}
|
|
384
|
+
/>
|
|
385
|
+
</Card>
|
|
386
|
+
|
|
387
|
+
<Card padding="none">
|
|
388
|
+
<EmptyState
|
|
389
|
+
size="sm"
|
|
390
|
+
title="No orders match these filters"
|
|
391
|
+
description="Nothing paid by card is waiting to ship this week."
|
|
392
|
+
actions={<Button size="sm" variant="soft">Clear filters</Button>}
|
|
393
|
+
/>
|
|
394
|
+
</Card>
|
|
395
|
+
|
|
396
|
+
<Card padding="none" variant="sunken">
|
|
397
|
+
<EmptyState
|
|
398
|
+
size="sm"
|
|
399
|
+
title="Nothing to fulfil"
|
|
400
|
+
description="Every paid order has shipped. New ones will appear here."
|
|
401
|
+
actions={<Button size="sm" variant="ghost">View shipped orders</Button>}
|
|
402
|
+
/>
|
|
403
|
+
</Card>`,
|
|
404
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
405
|
+
className: "empty-state-grid",
|
|
406
|
+
children: [
|
|
407
|
+
/* @__PURE__ */ jsx(Card, {
|
|
408
|
+
padding: "none",
|
|
409
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
410
|
+
size: "sm",
|
|
411
|
+
title: "No products match “oak desk”",
|
|
412
|
+
description: "Try a shorter search, or check the spelling.",
|
|
413
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
414
|
+
size: "sm",
|
|
415
|
+
variant: "soft",
|
|
416
|
+
children: "Clear search"
|
|
417
|
+
})
|
|
418
|
+
})
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ jsx(Card, {
|
|
421
|
+
padding: "none",
|
|
422
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
423
|
+
size: "sm",
|
|
424
|
+
title: "No orders match these filters",
|
|
425
|
+
description: "Nothing paid by card is waiting to ship this week.",
|
|
426
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
427
|
+
size: "sm",
|
|
428
|
+
variant: "soft",
|
|
429
|
+
children: "Clear filters"
|
|
430
|
+
})
|
|
431
|
+
})
|
|
432
|
+
}),
|
|
433
|
+
/* @__PURE__ */ jsx(Card, {
|
|
434
|
+
padding: "none",
|
|
435
|
+
variant: "sunken",
|
|
436
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
437
|
+
size: "sm",
|
|
438
|
+
title: "Nothing to fulfil",
|
|
439
|
+
description: "Every paid order has shipped. New ones will appear here.",
|
|
440
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
441
|
+
size: "sm",
|
|
442
|
+
variant: "ghost",
|
|
443
|
+
children: "View shipped orders"
|
|
444
|
+
})
|
|
445
|
+
})
|
|
446
|
+
})
|
|
447
|
+
]
|
|
448
|
+
})
|
|
449
|
+
})
|
|
450
|
+
}),
|
|
451
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
452
|
+
id: "whole-screen",
|
|
453
|
+
title: "A whole screen",
|
|
454
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
455
|
+
/* @__PURE__ */ jsx("code", { children: "lg" }),
|
|
456
|
+
" fills a screen that has nothing else on it: a page that was not found, a server that did not answer, a store the merchant cannot open. The title speaks in Display and the mark grows to 128px. For a page that was not found, pass ",
|
|
457
|
+
/* @__PURE__ */ jsx("code", { children: "<OrbitMark state=\"adrift\" />" }),
|
|
458
|
+
": the satellite slips off its orbit, leaves a dotted trail, and bobs where it stopped. Make the title the page's ",
|
|
459
|
+
/* @__PURE__ */ jsx("code", { children: "h1" }),
|
|
460
|
+
"."
|
|
461
|
+
] }),
|
|
462
|
+
children: /* @__PURE__ */ jsx(NotFound, {})
|
|
463
|
+
}),
|
|
464
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
465
|
+
id: "failed-load",
|
|
466
|
+
title: "When it failed to load",
|
|
467
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
468
|
+
"A view that could not load is not an empty one. ",
|
|
469
|
+
/* @__PURE__ */ jsx("code", { children: "tone=\"error\"" }),
|
|
470
|
+
" swaps the orbit for a warning in a red-washed tile, announces itself as an alert, and takes ",
|
|
471
|
+
/* @__PURE__ */ jsx("code", { children: "onRetry" }),
|
|
472
|
+
": a \"Try again\" button, first among the actions, that spins while ",
|
|
473
|
+
/* @__PURE__ */ jsx("code", { children: "retrying" }),
|
|
474
|
+
" and keeps focus. Give it ",
|
|
475
|
+
/* @__PURE__ */ jsx("code", { children: "detail" }),
|
|
476
|
+
" for a line a person can quote to support (a status and a request), left in English. Press the button: the first retry fails again and the second works. With a screen reader on, the panel says Retrying, then says its words again when a retry fails, because nothing in the alert changed to say so; when one works the panel is replaced by your content, and focus falls to the page unless you move it, as here to the heading."
|
|
477
|
+
] }),
|
|
478
|
+
children: [
|
|
479
|
+
/* @__PURE__ */ jsx(RetryOutcome, {}),
|
|
480
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
481
|
+
title: "A whole screen",
|
|
482
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
483
|
+
/* @__PURE__ */ jsx("code", { children: "size=\"lg\"" }),
|
|
484
|
+
" is the failed load of a whole screen: a 72px tile and a display title. A page that crashed or could not be found has its own error page; this is for a view that could not load its data. Give the title",
|
|
485
|
+
" ",
|
|
486
|
+
/* @__PURE__ */ jsx("code", { children: "titleAs=\"h1\"" }),
|
|
487
|
+
" when it is the page's heading."
|
|
488
|
+
] }),
|
|
489
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
490
|
+
align: "fill",
|
|
491
|
+
code: `
|
|
492
|
+
// When it is the page's own heading, give the title titleAs="h1". Inside this page it keeps its h3.
|
|
493
|
+
<Card padding="none">
|
|
494
|
+
<EmptyState
|
|
495
|
+
tone="error"
|
|
496
|
+
size="lg"
|
|
497
|
+
title="Couldn't open this plugin"
|
|
498
|
+
description="It may have been removed. Try again, or go back to your plugins."
|
|
499
|
+
detail="404 /api/plugins/42"
|
|
500
|
+
onRetry={refetch}
|
|
501
|
+
retrying={isFetching}
|
|
502
|
+
/>
|
|
503
|
+
</Card>`,
|
|
504
|
+
children: /* @__PURE__ */ jsx(Card, {
|
|
505
|
+
padding: "none",
|
|
506
|
+
children: /* @__PURE__ */ jsx(FailedLoad, {
|
|
507
|
+
size: "lg",
|
|
508
|
+
title: "Couldn't open this plugin",
|
|
509
|
+
description: "It may have been removed. Try again, or go back to your plugins.",
|
|
510
|
+
detail: "404 /api/plugins/42"
|
|
511
|
+
})
|
|
512
|
+
})
|
|
513
|
+
})
|
|
514
|
+
}),
|
|
515
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
516
|
+
title: "Technical details",
|
|
517
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
518
|
+
"The server's own message helps when a retry keeps failing, but it is written for a developer. Pass it as",
|
|
519
|
+
" ",
|
|
520
|
+
/* @__PURE__ */ jsx("code", { children: "technicalDetails" }),
|
|
521
|
+
" and it is folded under the actions behind \"Technical details\" (",
|
|
522
|
+
/* @__PURE__ */ jsx("code", { children: "technicalDetailsLabel" }),
|
|
523
|
+
", in English until you translate it), so it is there for whoever needs it without being the first thing a person reads. ",
|
|
524
|
+
/* @__PURE__ */ jsx("code", { children: "detail" }),
|
|
525
|
+
" stays the short line to quote, with the words."
|
|
526
|
+
] }),
|
|
527
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
528
|
+
code: `
|
|
529
|
+
<EmptyState
|
|
530
|
+
tone="error"
|
|
531
|
+
placement="section"
|
|
532
|
+
title="Couldn't load the dev stores"
|
|
533
|
+
description="Check your connection and try again."
|
|
534
|
+
onRetry={refetch}
|
|
535
|
+
retrying={isFetching}
|
|
536
|
+
technicalDetails={error.message}
|
|
537
|
+
/>`,
|
|
538
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
539
|
+
className: "empty-state-details",
|
|
540
|
+
children: /* @__PURE__ */ jsx(FailedLoad, {
|
|
541
|
+
placement: "section",
|
|
542
|
+
title: "Couldn't load the dev stores",
|
|
543
|
+
detail: "",
|
|
544
|
+
technicalDetails: "Request failed with status code 503\nGET /api/affiliates/dev-stores?page=1: upstream timed out after 30s"
|
|
545
|
+
})
|
|
546
|
+
})
|
|
547
|
+
})
|
|
548
|
+
}),
|
|
549
|
+
/* @__PURE__ */ jsx(Note, {
|
|
550
|
+
title: "Never get-started copy for a failure",
|
|
551
|
+
children: "Someone with real records who sees \"No orders yet\" after a failed request thinks their data is gone. Draw an error wherever a query can fail, and keep the empty state for a request that came back with nothing."
|
|
552
|
+
}),
|
|
553
|
+
/* @__PURE__ */ jsx(Fragment$1, {})
|
|
554
|
+
]
|
|
555
|
+
}),
|
|
556
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
557
|
+
id: "placement",
|
|
558
|
+
title: "Where it sits",
|
|
559
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
560
|
+
/* @__PURE__ */ jsx("code", { children: "placement" }),
|
|
561
|
+
" says how the state sits in its page. ",
|
|
562
|
+
/* @__PURE__ */ jsx("code", { children: "inline" }),
|
|
563
|
+
" is how it has always sat: in the flow, with the size's own padding. ",
|
|
564
|
+
/* @__PURE__ */ jsx("code", { children: "section" }),
|
|
565
|
+
" is a quiet well under a heading, small unless you say otherwise. ",
|
|
566
|
+
/* @__PURE__ */ jsx("code", { children: "page" }),
|
|
567
|
+
" is the free canvas of a page: at least 560px tall (or the window less 180px, if that is less), with a little more room under it than over it so what it holds sits at the optical centre. A page whose canvas is a flex column can add ",
|
|
568
|
+
/* @__PURE__ */ jsx("code", { children: "flex: 1" }),
|
|
569
|
+
" to fill it exactly; the dashboard kit's list empty state measures the canvas."
|
|
570
|
+
] }),
|
|
571
|
+
children: [
|
|
572
|
+
/* @__PURE__ */ jsx(Example, {
|
|
573
|
+
align: "fill",
|
|
574
|
+
code: `
|
|
575
|
+
<EmptyState placement="section" title="No plugins yet" description="Install one to add features to your store." />
|
|
576
|
+
|
|
577
|
+
<EmptyState tone="error" placement="section" title="Couldn't load plugins" onRetry={refetch} />
|
|
578
|
+
|
|
579
|
+
<EmptyState tone="error" placement="page" title="Couldn't open this plugin" onRetry={refetch} />`,
|
|
580
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
581
|
+
className: "empty-state-placements",
|
|
582
|
+
children: [
|
|
583
|
+
/* @__PURE__ */ jsx(EmptyState, {
|
|
584
|
+
placement: "section",
|
|
585
|
+
title: "No plugins yet",
|
|
586
|
+
description: "Install one to add features to your store."
|
|
587
|
+
}),
|
|
588
|
+
/* @__PURE__ */ jsx(FailedLoad, {
|
|
589
|
+
placement: "section",
|
|
590
|
+
title: "Couldn't load plugins",
|
|
591
|
+
description: "Check your connection and try again.",
|
|
592
|
+
detail: "503 /api/plugins"
|
|
593
|
+
}),
|
|
594
|
+
/* @__PURE__ */ jsx("div", {
|
|
595
|
+
className: "empty-state-frame",
|
|
596
|
+
children: /* @__PURE__ */ jsx(FailedLoad, {
|
|
597
|
+
placement: "page",
|
|
598
|
+
title: "Couldn't open this plugin",
|
|
599
|
+
description: "It may have been removed. Try again, or go back to your plugins.",
|
|
600
|
+
detail: "404 /api/plugins/42"
|
|
601
|
+
})
|
|
602
|
+
})
|
|
603
|
+
]
|
|
604
|
+
})
|
|
605
|
+
}),
|
|
606
|
+
/* @__PURE__ */ jsx("p", {
|
|
607
|
+
className: "doc-section__description",
|
|
608
|
+
children: "The page example is shortened to fit this page; in a real one it is at least 560px tall."
|
|
609
|
+
}),
|
|
610
|
+
/* @__PURE__ */ jsx(Fragment$1, {})
|
|
611
|
+
]
|
|
612
|
+
}),
|
|
613
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
614
|
+
id: "illustration",
|
|
615
|
+
title: "An illustration",
|
|
616
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
617
|
+
"A list that has a picture of its own passes it as ",
|
|
618
|
+
/* @__PURE__ */ jsx("code", { children: "illustration" }),
|
|
619
|
+
", an ",
|
|
620
|
+
/* @__PURE__ */ jsx("code", { children: "img" }),
|
|
621
|
+
" or an",
|
|
622
|
+
" ",
|
|
623
|
+
/* @__PURE__ */ jsx("code", { children: "svg" }),
|
|
624
|
+
", in place of the mark. It is drawn 192px wide on a phone and 256px wide from 640px, with 16px more room under it, so the title sits about 30px below the picture. Tall art is sized by its height instead,",
|
|
625
|
+
" ",
|
|
626
|
+
/* @__PURE__ */ jsx("code", { children: "illustrationFit=\"height\"" }),
|
|
627
|
+
": 192px tall. Give the image an empty ",
|
|
628
|
+
/* @__PURE__ */ jsx("code", { children: "alt" }),
|
|
629
|
+
" when the words say it all."
|
|
630
|
+
] }),
|
|
631
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
632
|
+
code: `
|
|
633
|
+
<EmptyState
|
|
634
|
+
illustration={<img src="/discount.svg" alt="" />}
|
|
635
|
+
title="No discounts yet"
|
|
636
|
+
description="Create one to offer money off at checkout."
|
|
637
|
+
actions={<Button variant="primary" icon={<PlusIcon />}>Create discount</Button>}
|
|
638
|
+
/>`,
|
|
639
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
640
|
+
illustration: /* @__PURE__ */ jsx(DiscountArt, {}),
|
|
641
|
+
title: "No discounts yet",
|
|
642
|
+
description: "Create one to offer money off at checkout.",
|
|
643
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
644
|
+
variant: "primary",
|
|
645
|
+
icon: /* @__PURE__ */ jsx(PlusIcon, {}),
|
|
646
|
+
children: "Create discount"
|
|
647
|
+
})
|
|
648
|
+
})
|
|
649
|
+
})
|
|
650
|
+
}),
|
|
651
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
652
|
+
id: "children",
|
|
653
|
+
title: "Between the words and the actions",
|
|
654
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "children" }), " sit between the words and the actions, centred and no wider than the words: a choice to make before the next move, such as a plan above Subscribe, or a short list of what happens next."] }),
|
|
655
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
656
|
+
code: `
|
|
657
|
+
<EmptyState
|
|
658
|
+
title="Subscribe to activate Live chat"
|
|
659
|
+
description="Chat with customers on your storefront, and keep every conversation in one inbox."
|
|
660
|
+
actions={<Button variant="primary">Subscribe</Button>}
|
|
661
|
+
>
|
|
662
|
+
<Select aria-label="Plan" value={plan} onValueChange={setPlan} options={plans} />
|
|
663
|
+
</EmptyState>`,
|
|
664
|
+
children: /* @__PURE__ */ jsx(SubscribeGate, {})
|
|
665
|
+
})
|
|
666
|
+
}),
|
|
667
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
668
|
+
id: "outcome",
|
|
669
|
+
title: "An outcome, and the wait before it",
|
|
670
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
671
|
+
"A screen that says something went through (an email verified, an invite accepted, a form submitted) is",
|
|
672
|
+
" ",
|
|
673
|
+
/* @__PURE__ */ jsx("code", { children: "tone=\"success\"" }),
|
|
674
|
+
": a 64px green disc with a check, the icon tile's outcome disc, with 24px between the disc, the words and the next move. While it waits for that answer it is ",
|
|
675
|
+
/* @__PURE__ */ jsx("code", { children: "loading" }),
|
|
676
|
+
": the same disc, neutral, holding a spinner, and a title that says what it is waiting for. When the answer comes, set the tone it ended in and its words; the disc changes in place and a polite status reads the new title and description. A failure after the wait (",
|
|
677
|
+
/* @__PURE__ */ jsx("code", { children: "tone=\"error\"" }),
|
|
678
|
+
") stays on the disc, red with a cross, so the screen does not shift; a failed load that never waited keeps the error's tile."
|
|
679
|
+
] }),
|
|
680
|
+
children: [
|
|
681
|
+
/* @__PURE__ */ jsx(Example, {
|
|
682
|
+
code: `
|
|
683
|
+
<EmptyState
|
|
684
|
+
loading={verifying}
|
|
685
|
+
tone={failed ? 'error' : 'success'}
|
|
686
|
+
title={verifying ? 'Verifying your email...' : failed ? 'Verification failed' : 'Email verified'}
|
|
687
|
+
description={verifying ? 'This takes a moment.' : failed ? 'The link has expired.' : 'You can now sign in.'}
|
|
688
|
+
actions={verifying ? undefined : <Button variant="primary">Sign in</Button>}
|
|
689
|
+
/>`,
|
|
690
|
+
children: /* @__PURE__ */ jsx(VerifyEmail, {})
|
|
691
|
+
}),
|
|
692
|
+
/* @__PURE__ */ jsxs(SubSection, {
|
|
693
|
+
title: "Small, in a panel",
|
|
694
|
+
children: [/* @__PURE__ */ jsx("p", { children: "A small success keeps a smaller disc (40px), where a small empty state draws no mark: a submitted form in a side panel still says it went through." }), /* @__PURE__ */ jsx(Example, {
|
|
695
|
+
code: `
|
|
696
|
+
<EmptyState size="sm" tone="success" title="Request sent" description="We'll reply within a working day." />`,
|
|
697
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
698
|
+
className: "empty-state-panel",
|
|
699
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
700
|
+
size: "sm",
|
|
701
|
+
tone: "success",
|
|
702
|
+
title: "Request sent",
|
|
703
|
+
description: "We'll reply within a working day."
|
|
704
|
+
})
|
|
705
|
+
})
|
|
706
|
+
})]
|
|
707
|
+
}),
|
|
708
|
+
/* @__PURE__ */ jsxs(SubSection, {
|
|
709
|
+
title: "On a whole screen",
|
|
710
|
+
children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
711
|
+
"A screen of its own, such as an invite accepted from an email, is ",
|
|
712
|
+
/* @__PURE__ */ jsx("code", { children: "size=\"lg\"" }),
|
|
713
|
+
": the disc grows to 96px beside the Display title, as the orbit and the error tile do."
|
|
714
|
+
] }), /* @__PURE__ */ jsx(Example, {
|
|
715
|
+
code: `
|
|
716
|
+
<EmptyState
|
|
717
|
+
size="lg"
|
|
718
|
+
tone="success"
|
|
719
|
+
titleAs="h1"
|
|
720
|
+
title="Invite accepted"
|
|
721
|
+
description="You can now manage this store's orders and products."
|
|
722
|
+
actions={<Button variant="primary">Go to dashboard</Button>}
|
|
723
|
+
/>`,
|
|
724
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
725
|
+
size: "lg",
|
|
726
|
+
tone: "success",
|
|
727
|
+
titleAs: "h2",
|
|
728
|
+
title: "Invite accepted",
|
|
729
|
+
description: "You can now manage this store's orders and products.",
|
|
730
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
731
|
+
variant: "primary",
|
|
732
|
+
children: "Go to dashboard"
|
|
733
|
+
})
|
|
734
|
+
})
|
|
735
|
+
})]
|
|
736
|
+
})
|
|
737
|
+
]
|
|
738
|
+
}),
|
|
739
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
740
|
+
id: "the-mark",
|
|
741
|
+
title: "The mark",
|
|
742
|
+
description: /* @__PURE__ */ jsx("p", { children: "A neutral planet inside a tilted teal orbit, from the Orbit logo. On arrival the mark settles in, the satellite travels once around the planet drawing its orbit behind it, and comes to rest at the upper right, where the comet sits in the logo. The words rise into place after it. It plays once, then holds still." }),
|
|
743
|
+
children: [/* @__PURE__ */ jsx(Arrival, {}), /* @__PURE__ */ jsx(SubSection, {
|
|
744
|
+
title: "Without the mark",
|
|
745
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
746
|
+
/* @__PURE__ */ jsx("code", { children: "sm" }),
|
|
747
|
+
" empty states have no mark. On a page, pass ",
|
|
748
|
+
/* @__PURE__ */ jsxs("code", { children: ["mark=", "{null}"] }),
|
|
749
|
+
" where it would crowd the words. ",
|
|
750
|
+
/* @__PURE__ */ jsx("code", { children: "mark" }),
|
|
751
|
+
" also takes your own illustration in its place, at any size."
|
|
752
|
+
] }),
|
|
753
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
754
|
+
code: `
|
|
755
|
+
<Card padding="sm">
|
|
756
|
+
<CardHeader title="Notes" icon={<NotePencilIcon />} />
|
|
757
|
+
<EmptyState
|
|
758
|
+
size="sm"
|
|
759
|
+
title="No notes on this order"
|
|
760
|
+
description="Notes are for your team. Customers never see them."
|
|
761
|
+
actions={<Button size="sm" icon={<PlusIcon />}>Add a note</Button>}
|
|
762
|
+
/>
|
|
763
|
+
</Card>`,
|
|
764
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
765
|
+
className: "empty-state-panel",
|
|
766
|
+
children: /* @__PURE__ */ jsxs(Card, {
|
|
767
|
+
padding: "sm",
|
|
768
|
+
children: [/* @__PURE__ */ jsx(CardHeader, {
|
|
769
|
+
title: "Notes",
|
|
770
|
+
icon: /* @__PURE__ */ jsx(NotePencilIcon, {})
|
|
771
|
+
}), /* @__PURE__ */ jsx(EmptyState, {
|
|
772
|
+
size: "sm",
|
|
773
|
+
title: "No notes on this order",
|
|
774
|
+
description: "Notes are for your team. Customers never see them.",
|
|
775
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
776
|
+
size: "sm",
|
|
777
|
+
icon: /* @__PURE__ */ jsx(PlusIcon, {}),
|
|
778
|
+
children: "Add a note"
|
|
779
|
+
})
|
|
780
|
+
})]
|
|
781
|
+
})
|
|
782
|
+
})
|
|
783
|
+
})
|
|
784
|
+
})]
|
|
785
|
+
}),
|
|
786
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
787
|
+
id: "both-themes",
|
|
788
|
+
title: "In both themes",
|
|
789
|
+
description: /* @__PURE__ */ jsx("p", { children: "An empty state and a failed load in a section, light and dark side by side. In dark the orbit and its satellite take the night accent, the planet stays a shade off the canvas, and the error tile takes the night red." }),
|
|
790
|
+
children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsxs("div", {
|
|
791
|
+
className: "empty-state-theme-stack",
|
|
792
|
+
children: [/* @__PURE__ */ jsx(NoProductsYet, {}), /* @__PURE__ */ jsx(FailedLoad, { placement: "section" })]
|
|
793
|
+
}) })
|
|
794
|
+
}),
|
|
795
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
796
|
+
id: "writing",
|
|
797
|
+
title: "Writing an empty state",
|
|
798
|
+
description: /* @__PURE__ */ jsx("p", { children: "An empty view is the moment a merchant is most likely to wonder what to do. Say what is empty, what will fill it, and offer the move that fills it. Even a finished job (\"Nothing to fulfil\") points somewhere useful." }),
|
|
799
|
+
children: [
|
|
800
|
+
/* @__PURE__ */ jsx(DoDont, {
|
|
801
|
+
do: {
|
|
802
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
803
|
+
size: "sm",
|
|
804
|
+
title: "No customers yet",
|
|
805
|
+
description: "Customers appear here after their first order, or when you import a list.",
|
|
806
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
807
|
+
size: "sm",
|
|
808
|
+
icon: /* @__PURE__ */ jsx(UploadSimpleIcon, {}),
|
|
809
|
+
children: "Import customers"
|
|
810
|
+
})
|
|
811
|
+
}),
|
|
812
|
+
caption: "What is empty, what will fill it, and the move that fills it."
|
|
813
|
+
},
|
|
814
|
+
dont: {
|
|
815
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
816
|
+
size: "sm",
|
|
817
|
+
title: "No data"
|
|
818
|
+
}),
|
|
819
|
+
caption: "\"No data\" is a dead end: it says neither what is missing nor what to do."
|
|
820
|
+
}
|
|
821
|
+
}),
|
|
822
|
+
/* @__PURE__ */ jsx(DoDont, {
|
|
823
|
+
do: {
|
|
824
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
825
|
+
size: "sm",
|
|
826
|
+
title: "Nothing to fulfil",
|
|
827
|
+
description: "Every paid order has shipped.",
|
|
828
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
829
|
+
size: "sm",
|
|
830
|
+
variant: "ghost",
|
|
831
|
+
children: "View shipped orders"
|
|
832
|
+
})
|
|
833
|
+
}),
|
|
834
|
+
caption: "Plain and calm, the way a person would say it."
|
|
835
|
+
},
|
|
836
|
+
dont: {
|
|
837
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
838
|
+
size: "sm",
|
|
839
|
+
title: "0 results returned",
|
|
840
|
+
description: "The request completed with no records."
|
|
841
|
+
}),
|
|
842
|
+
caption: "Error-sounding copy worries the merchant about a problem that is not there."
|
|
843
|
+
}
|
|
844
|
+
}),
|
|
845
|
+
/* @__PURE__ */ jsx(DoDont, {
|
|
846
|
+
do: {
|
|
847
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
848
|
+
tone: "error",
|
|
849
|
+
size: "sm",
|
|
850
|
+
title: "Couldn't load orders",
|
|
851
|
+
description: "Check your connection and try again.",
|
|
852
|
+
onRetry: () => {}
|
|
853
|
+
}),
|
|
854
|
+
caption: "A failed load says so, and offers the way back."
|
|
855
|
+
},
|
|
856
|
+
dont: {
|
|
857
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
858
|
+
size: "sm",
|
|
859
|
+
title: "No orders yet",
|
|
860
|
+
description: "When customers buy, their orders land here.",
|
|
861
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
862
|
+
size: "sm",
|
|
863
|
+
icon: /* @__PURE__ */ jsx(ShareNetworkIcon, {}),
|
|
864
|
+
children: "Share your store"
|
|
865
|
+
})
|
|
866
|
+
}),
|
|
867
|
+
caption: "The onboarding copy after a failed request. To someone with real orders it reads as lost data."
|
|
868
|
+
}
|
|
869
|
+
}),
|
|
870
|
+
/* @__PURE__ */ jsx(Guidelines, { items: [
|
|
871
|
+
"Title: what is empty, plainly, in sentence case with no full stop, such as No orders yet.",
|
|
872
|
+
"\"Yet\" when it fills on its own, \"match\" when a search or filter emptied it, \"Nothing to\" when the work is done.",
|
|
873
|
+
"Description: a sentence or two on what will appear, or what to try. It wraps at about 44 characters.",
|
|
874
|
+
"Actions: one or two, each named for what it does. The primary only when the empty state is the page's main content.",
|
|
875
|
+
"Never blame the merchant, and never sound like an error. If it is one (a request failed), use tone=\"error\" and say so plainly."
|
|
876
|
+
] })
|
|
877
|
+
]
|
|
878
|
+
}),
|
|
879
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
880
|
+
id: "accessibility",
|
|
881
|
+
title: "Accessibility",
|
|
882
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
883
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
884
|
+
"The title is an ",
|
|
885
|
+
/* @__PURE__ */ jsx("code", { children: "h3" }),
|
|
886
|
+
" by default. Set ",
|
|
887
|
+
/* @__PURE__ */ jsx("code", { children: "titleAs" }),
|
|
888
|
+
" to fit the page outline: an",
|
|
889
|
+
" ",
|
|
890
|
+
/* @__PURE__ */ jsx("code", { children: "h2" }),
|
|
891
|
+
" when the empty state is the page's main content, a ",
|
|
892
|
+
/* @__PURE__ */ jsx("code", { children: "p" }),
|
|
893
|
+
" inside a panel that already has a heading."
|
|
894
|
+
] }),
|
|
895
|
+
"The mark is decorative and hidden from assistive tech.",
|
|
896
|
+
"When an empty state replaces results as someone types or filters, announce the change yourself, for example with a polite live region that says \"No results\". An empty state does not announce itself.",
|
|
897
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
898
|
+
"An error does: ",
|
|
899
|
+
/* @__PURE__ */ jsx("code", { children: "tone=\"error\"" }),
|
|
900
|
+
" is a ",
|
|
901
|
+
/* @__PURE__ */ jsx("code", { children: "role=\"alert\"" }),
|
|
902
|
+
", so a failed load is read out when it appears. A ",
|
|
903
|
+
/* @__PURE__ */ jsx("code", { children: "role" }),
|
|
904
|
+
" of your own wins, for a state that is on the page from the start."
|
|
905
|
+
] }),
|
|
906
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
907
|
+
"A ",
|
|
908
|
+
/* @__PURE__ */ jsx("code", { children: "success" }),
|
|
909
|
+
" is read as the page it is, with no alert. A screen that has waited (",
|
|
910
|
+
/* @__PURE__ */ jsx("code", { children: "loading" }),
|
|
911
|
+
") keeps a polite status from the moment the wait starts, and it says the outcome's title and description when the wait ends, a failure included, and again whenever the tone changes after that: that screen is never made an alert, which would say it twice or not at all. A screen that arrives waiting says nothing at first; its heading says what it is waiting for."
|
|
912
|
+
] }),
|
|
913
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
914
|
+
"The retry is a real button. While ",
|
|
915
|
+
/* @__PURE__ */ jsx("code", { children: "retrying" }),
|
|
916
|
+
" it is ",
|
|
917
|
+
/* @__PURE__ */ jsx("code", { children: "aria-busy" }),
|
|
918
|
+
", ignores presses, and keeps focus, so a keyboard user is not thrown back to the top of the page."
|
|
919
|
+
] }),
|
|
920
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
921
|
+
"A polite status beside the alert (not inside it: a live region inside another is read unpredictably) says",
|
|
922
|
+
" ",
|
|
923
|
+
/* @__PURE__ */ jsx("code", { children: "retryingLabel" }),
|
|
924
|
+
" while a retry runs, and says the title and description again if it ends with the panel still there. A failed retry changes nothing in the alert, so without that a person who pressed Try again would hear nothing at all. Each attempt gets a region of its own, so a retry that fails again in a few milliseconds is heard too."
|
|
925
|
+
] }),
|
|
926
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
927
|
+
"When a retry works, your content replaces the panel, and focus falls to the page. Move it to that content's heading (give it ",
|
|
928
|
+
/* @__PURE__ */ jsxs("code", { children: ["tabIndex=", "{-1}"] }),
|
|
929
|
+
"), as the example does: the panel cannot know where it should go."
|
|
930
|
+
] }),
|
|
931
|
+
"Under reduced motion the satellite does not travel: the orbit is drawn whole, and the mark, words and actions fade in without moving. Adrift, the satellite waits at the end of its trail and does not bob."
|
|
932
|
+
] })
|
|
933
|
+
}),
|
|
934
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
935
|
+
id: "differences",
|
|
936
|
+
title: "Where it differs from the vendor dashboard",
|
|
937
|
+
description: /* @__PURE__ */ jsx("p", { children: "The error tile and the two placements are the vendor dashboard's own (the payments failed load, the plugin state screens), measured in the running app. These are the places the kit chooses differently." }),
|
|
938
|
+
children: /* @__PURE__ */ jsx(DocTable, {
|
|
939
|
+
columns: [
|
|
940
|
+
"Where",
|
|
941
|
+
"Vendor dashboard",
|
|
942
|
+
"Kit"
|
|
943
|
+
],
|
|
944
|
+
rows: [
|
|
945
|
+
[
|
|
946
|
+
"A failed load",
|
|
947
|
+
"Two looks: the picking and purchasing lists draw a 40px grey disc and a small secondary button (legacy utility classes); the payments pages draw a 44px red-washed tile.",
|
|
948
|
+
"The red-washed tile, 44px (36px small, 72px for a whole screen). It is the one that is deliberately designed, and it reads as a failure where a grey disc reads as an empty list."
|
|
949
|
+
],
|
|
950
|
+
[
|
|
951
|
+
"Announcing it",
|
|
952
|
+
"Not an alert: its load error panel has no role, so nothing says that a load failed.",
|
|
953
|
+
"Always an alert."
|
|
954
|
+
],
|
|
955
|
+
[
|
|
956
|
+
"Placement",
|
|
957
|
+
"A wrapper div around the empty state carries the placement, and its padding adds to the empty state's own.",
|
|
958
|
+
"The empty state carries it, and the padding adds in the same way, so the two render alike."
|
|
959
|
+
],
|
|
960
|
+
[
|
|
961
|
+
"Filling the canvas",
|
|
962
|
+
"A hook measures the page and grows the wrapper to the free height.",
|
|
963
|
+
"A page is at least 560px tall (the window less 180px if shorter). The dashboard kit's ListEmptyState keeps the measuring hook."
|
|
964
|
+
],
|
|
965
|
+
[
|
|
966
|
+
"The title's line",
|
|
967
|
+
"The payments failed load has a 25.6px line under its 15px title.",
|
|
968
|
+
"The kit's own: a 19.5px line, as every empty state has."
|
|
969
|
+
],
|
|
970
|
+
[
|
|
971
|
+
"The retry",
|
|
972
|
+
"A small secondary button, always. Nothing says it is retrying, or that it failed again.",
|
|
973
|
+
"The same, and the primary button when the state fills the page. A polite status says Retrying, and says the panel's words again if the retry fails again."
|
|
974
|
+
],
|
|
975
|
+
[
|
|
976
|
+
"A verification screen",
|
|
977
|
+
"The affiliate and agency dashboards draw the 64px disc by hand: green with a check, red with a cross, and a spinner that is grey on a muted disc in one and teal with no disc in the other. Nothing says the outcome when it arrives.",
|
|
978
|
+
"tone=\"success\" and loading draw the icon tile's outcome disc, the spinner always in its neutral disc, and a failure after the wait stays on it, red with a cross, so the screen does not shift as it changes. A polite status says the outcome. The spacing is theirs, 24px (space-y-6), between the disc, the words and the button."
|
|
979
|
+
]
|
|
980
|
+
]
|
|
981
|
+
})
|
|
982
|
+
}),
|
|
983
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
984
|
+
id: "props",
|
|
985
|
+
title: "Props",
|
|
986
|
+
description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native div attribute except title." }),
|
|
987
|
+
children: [/* @__PURE__ */ jsx(PropsTable, { rows: [
|
|
988
|
+
{
|
|
989
|
+
name: "title",
|
|
990
|
+
type: "ReactNode",
|
|
991
|
+
required: true,
|
|
992
|
+
description: "What is empty, plainly: \"No orders yet\". For an error, what failed: \"Couldn't load orders\"."
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
name: "description",
|
|
996
|
+
type: "ReactNode",
|
|
997
|
+
description: "What will fill it, or what to do next. A sentence or two."
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
name: "detail",
|
|
1001
|
+
type: "ReactNode",
|
|
1002
|
+
description: "A quiet line a person can quote: a status and a request. Leave it in English."
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
name: "actions",
|
|
1006
|
+
type: "ReactNode",
|
|
1007
|
+
description: "One or two buttons: the next move. They follow the retry button."
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
name: "technicalDetails",
|
|
1011
|
+
type: "ReactNode",
|
|
1012
|
+
description: "The server's own message, folded under the actions behind technicalDetailsLabel."
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
name: "technicalDetailsLabel",
|
|
1016
|
+
type: "string",
|
|
1017
|
+
default: "'Technical details'",
|
|
1018
|
+
description: "The fold's summary. English by default: pass it translated."
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
name: "size",
|
|
1022
|
+
type: "'sm' | 'md' | 'lg'",
|
|
1023
|
+
default: "'md', or 'sm' for a section",
|
|
1024
|
+
description: "sm for panels and search results, md for pages and cards, lg for a whole screen."
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
name: "tone",
|
|
1028
|
+
type: "'default' | 'error' | 'success'",
|
|
1029
|
+
default: "'default'",
|
|
1030
|
+
description: "error is a view that could not load: a red-washed mark, announced as an alert. success is a screen that says something went through: a green disc with a check."
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
name: "loading",
|
|
1034
|
+
type: "boolean",
|
|
1035
|
+
default: "false",
|
|
1036
|
+
description: "The screen waits for its outcome: the same disc, neutral, holding a spinner. A failure after it stays on the disc, red. When it ends, a polite status says the new title and description."
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
name: "placement",
|
|
1040
|
+
type: "'inline' | 'section' | 'page'",
|
|
1041
|
+
default: "'inline'",
|
|
1042
|
+
description: "In the flow, a sunken well under a heading, or the free canvas of a page."
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
name: "onRetry",
|
|
1046
|
+
type: "() => void",
|
|
1047
|
+
description: "Draws a Try again button first among the actions and calls this when it is pressed. The primary button on a page, a small secondary one otherwise."
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
name: "retrying",
|
|
1051
|
+
type: "boolean",
|
|
1052
|
+
default: "false",
|
|
1053
|
+
description: "The retry is running: its button spins, ignores presses and keeps focus, and a status says it is retrying, then says the panel's words again if it ends with the panel still there."
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
name: "retryLabel",
|
|
1057
|
+
type: "string",
|
|
1058
|
+
default: "'Try again'",
|
|
1059
|
+
description: "The retry button's words. English by default: pass it translated."
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
name: "retryingLabel",
|
|
1063
|
+
type: "string",
|
|
1064
|
+
default: "'Retrying'",
|
|
1065
|
+
description: "What a screen reader hears while a retry runs. English by default: pass it translated."
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
name: "mark",
|
|
1069
|
+
type: "ReactNode",
|
|
1070
|
+
description: "Replaces the mark (the orbit, the error tile, or the outcome disc), e.g. with <OrbitMark state=\"adrift\" /> or an illustration. null hides it."
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
name: "titleAs",
|
|
1074
|
+
type: "'h1' | 'h2' | 'h3' | 'h4' | 'p'",
|
|
1075
|
+
default: "'h3'",
|
|
1076
|
+
description: "Element for the title."
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
name: "illustration",
|
|
1080
|
+
type: "ReactNode",
|
|
1081
|
+
description: "A picture of your own in place of the mark: 192px wide on a phone, 256px from 640px."
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
name: "illustrationFit",
|
|
1085
|
+
type: "'width' | 'height'",
|
|
1086
|
+
default: "'width'",
|
|
1087
|
+
description: "Size the illustration by its width, or by its height (192px) for tall art."
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
name: "children",
|
|
1091
|
+
type: "ReactNode",
|
|
1092
|
+
description: "Something between the words and the actions: a plan select above Subscribe."
|
|
1093
|
+
}
|
|
1094
|
+
] }), /* @__PURE__ */ jsx(SubSection, {
|
|
1095
|
+
title: "OrbitMark",
|
|
1096
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1097
|
+
"The mark on its own, for the ",
|
|
1098
|
+
/* @__PURE__ */ jsx("code", { children: "mark" }),
|
|
1099
|
+
" prop. Also accepts every native svg attribute."
|
|
1100
|
+
] }),
|
|
1101
|
+
children: /* @__PURE__ */ jsx(PropsTable, { rows: [{
|
|
1102
|
+
name: "state",
|
|
1103
|
+
type: "'rest' | 'adrift'",
|
|
1104
|
+
default: "'rest'",
|
|
1105
|
+
description: "rest travels once around and settles. adrift slips off the orbit, for a page that was not found."
|
|
1106
|
+
}] })
|
|
1107
|
+
})]
|
|
1108
|
+
})
|
|
1109
|
+
]
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1112
|
+
//#endregion
|
|
1113
|
+
export { Page, Preview };
|