@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
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as DocLink } from "./host-B6znjEgQ.js";
|
|
3
|
+
import { a as DocTable, d as Section$1, i as DocPage, l as Note, m as ThemePair, n as CodeBlock$1, o as Example, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Button, Card, CardBody, CardHeader, LoadingOverlay, SegmentedControl } from "@orbitcommerce/constellation";
|
|
7
|
+
//#region src/pages/components/loading-overlay.tsx
|
|
8
|
+
var ORDERS = [
|
|
9
|
+
"Order #1042, Harbour Desk Co",
|
|
10
|
+
"Order #1041, Arden ergonomic chair",
|
|
11
|
+
"Order #1040, Priya Shah"
|
|
12
|
+
];
|
|
13
|
+
/** A short list of orders, left in place while the region reloads. */
|
|
14
|
+
function Orders() {
|
|
15
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
16
|
+
className: "loading-overlay-orders",
|
|
17
|
+
children: ORDERS.map((order) => /* @__PURE__ */ jsx("li", { children: order }, order))
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** The overlay with its announcement silenced, so the page's specimens do not read themselves out. */
|
|
21
|
+
function Quiet(props) {
|
|
22
|
+
return /* @__PURE__ */ jsx(LoadingOverlay, {
|
|
23
|
+
loading: true,
|
|
24
|
+
delay: 0,
|
|
25
|
+
labels: { loading: "" },
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/** A card region that loads for three seconds when asked, so the dimming and blocking can be seen. */
|
|
30
|
+
function Region() {
|
|
31
|
+
const [loading, setLoading] = useState(true);
|
|
32
|
+
const timer = useRef(void 0);
|
|
33
|
+
const load = useCallback(() => {
|
|
34
|
+
setLoading(true);
|
|
35
|
+
window.clearTimeout(timer.current);
|
|
36
|
+
timer.current = window.setTimeout(() => setLoading(false), 3e3);
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
load();
|
|
40
|
+
return () => window.clearTimeout(timer.current);
|
|
41
|
+
}, [load]);
|
|
42
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
className: "loading-overlay-demo",
|
|
44
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
45
|
+
size: "sm",
|
|
46
|
+
variant: "secondary",
|
|
47
|
+
onClick: load,
|
|
48
|
+
children: "Start a 3 second load"
|
|
49
|
+
}), /* @__PURE__ */ jsx(LoadingOverlay, {
|
|
50
|
+
loading,
|
|
51
|
+
label: "Loading your orders",
|
|
52
|
+
className: "loading-overlay-region",
|
|
53
|
+
children: /* @__PURE__ */ jsxs(Card, {
|
|
54
|
+
className: "loading-overlay-card",
|
|
55
|
+
children: [/* @__PURE__ */ jsx(CardHeader, { title: "Recent orders" }), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Orders, {}) })]
|
|
56
|
+
})
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** The label, under the spinner or hidden, or none at all. */
|
|
61
|
+
function Words() {
|
|
62
|
+
const [mode, setMode] = useState("label");
|
|
63
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
64
|
+
className: "loading-overlay-demo",
|
|
65
|
+
children: [/* @__PURE__ */ jsx(SegmentedControl, {
|
|
66
|
+
"aria-label": "Words",
|
|
67
|
+
size: "sm",
|
|
68
|
+
value: mode,
|
|
69
|
+
onValueChange: (value) => setMode(value),
|
|
70
|
+
options: [
|
|
71
|
+
{
|
|
72
|
+
value: "label",
|
|
73
|
+
label: "With a label"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
value: "hidden",
|
|
77
|
+
label: "Words hidden"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
value: "none",
|
|
81
|
+
label: "No label"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}), /* @__PURE__ */ jsx(LoadingOverlay, {
|
|
85
|
+
loading: true,
|
|
86
|
+
delay: 0,
|
|
87
|
+
label: mode === "none" ? void 0 : "Loading your orders",
|
|
88
|
+
showLabel: mode === "hidden" ? false : void 0,
|
|
89
|
+
className: "loading-overlay-region",
|
|
90
|
+
children: /* @__PURE__ */ jsxs(Card, {
|
|
91
|
+
className: "loading-overlay-card",
|
|
92
|
+
children: [/* @__PURE__ */ jsx(CardHeader, { title: "Recent orders" }), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Orders, {}) })]
|
|
93
|
+
})
|
|
94
|
+
})]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
var CLONE_STEPS = [
|
|
98
|
+
"Copying settings",
|
|
99
|
+
"Copying products",
|
|
100
|
+
"Copying pages",
|
|
101
|
+
"Copying media",
|
|
102
|
+
"Finishing up"
|
|
103
|
+
];
|
|
104
|
+
/** A store being cloned over its preview: the agency dashboard's clone, with the work's own progress and step. */
|
|
105
|
+
function Clone() {
|
|
106
|
+
const [progress, setProgress] = useState(null);
|
|
107
|
+
const timer = useRef(void 0);
|
|
108
|
+
useEffect(() => () => window.clearInterval(timer.current), []);
|
|
109
|
+
const start = () => {
|
|
110
|
+
window.clearInterval(timer.current);
|
|
111
|
+
setProgress(0);
|
|
112
|
+
timer.current = window.setInterval(() => {
|
|
113
|
+
setProgress((value) => {
|
|
114
|
+
const next = Math.min(100, (value ?? 0) + 3 + Math.round(Math.random() * 4));
|
|
115
|
+
if (next >= 100) {
|
|
116
|
+
window.clearInterval(timer.current);
|
|
117
|
+
window.setTimeout(() => setProgress(null), 900);
|
|
118
|
+
}
|
|
119
|
+
return next;
|
|
120
|
+
});
|
|
121
|
+
}, 280);
|
|
122
|
+
};
|
|
123
|
+
const step = progress === null ? void 0 : CLONE_STEPS[Math.min(CLONE_STEPS.length - 1, Math.floor(progress / 20))];
|
|
124
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
125
|
+
className: "loading-overlay-demo",
|
|
126
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
127
|
+
onClick: start,
|
|
128
|
+
disabled: progress !== null,
|
|
129
|
+
children: "Clone Harbour Desk Co"
|
|
130
|
+
}), /* @__PURE__ */ jsx(LoadingOverlay, {
|
|
131
|
+
loading: progress !== null,
|
|
132
|
+
delay: 0,
|
|
133
|
+
label: "Cloning...",
|
|
134
|
+
progress: progress ?? void 0,
|
|
135
|
+
detail: step,
|
|
136
|
+
className: "loading-overlay-region loading-overlay-preview-frame",
|
|
137
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
138
|
+
className: "loading-overlay-storefront",
|
|
139
|
+
"aria-label": "Harbour Desk Co storefront preview",
|
|
140
|
+
role: "img",
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ jsx("span", { className: "loading-overlay-storefront__bar" }),
|
|
143
|
+
/* @__PURE__ */ jsx("span", { className: "loading-overlay-storefront__hero" }),
|
|
144
|
+
/* @__PURE__ */ jsxs("span", {
|
|
145
|
+
className: "loading-overlay-storefront__row",
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
148
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
149
|
+
/* @__PURE__ */ jsx("span", {})
|
|
150
|
+
]
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
})
|
|
154
|
+
})]
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/** One overlay over a card, at rest, for the theme pair. */
|
|
158
|
+
function Specimen() {
|
|
159
|
+
return /* @__PURE__ */ jsx("div", {
|
|
160
|
+
className: "loading-overlay-demo",
|
|
161
|
+
children: /* @__PURE__ */ jsx(Quiet, {
|
|
162
|
+
className: "loading-overlay-region",
|
|
163
|
+
children: /* @__PURE__ */ jsxs(Card, {
|
|
164
|
+
className: "loading-overlay-card",
|
|
165
|
+
children: [/* @__PURE__ */ jsx(CardHeader, { title: "Recent orders" }), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Orders, {}) })]
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function Preview() {
|
|
171
|
+
return /* @__PURE__ */ jsx("div", {
|
|
172
|
+
className: "loading-overlay-preview",
|
|
173
|
+
children: /* @__PURE__ */ jsx(Quiet, {
|
|
174
|
+
className: "loading-overlay-region",
|
|
175
|
+
children: /* @__PURE__ */ jsxs(Card, {
|
|
176
|
+
className: "loading-overlay-preview-card",
|
|
177
|
+
children: [/* @__PURE__ */ jsx(CardHeader, { title: "Recent orders" }), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Orders, {}) })]
|
|
178
|
+
})
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
var code = (value) => /* @__PURE__ */ jsx("code", { children: value });
|
|
183
|
+
function Page() {
|
|
184
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
185
|
+
title: "Loading overlay",
|
|
186
|
+
status: "new",
|
|
187
|
+
importNames: ["LoadingOverlay"],
|
|
188
|
+
lead: "A layer over a region or the whole page while it loads: it dims what it covers, blocks pointer and keyboard use of it, shows the Orbit spinner with an optional label, and says the wait once.",
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
191
|
+
id: "basics",
|
|
192
|
+
title: "Basics",
|
|
193
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
194
|
+
"Use it when the content is already on screen and must be held still while it reloads: a card, a panel, a table area, or the whole page. The content stays, dimmed, so the region says what is loading without a layout jump. Do not use it for a first load with nothing to show yet (draw a ",
|
|
195
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
196
|
+
to: "/components/skeleton",
|
|
197
|
+
children: "skeleton"
|
|
198
|
+
}),
|
|
199
|
+
" in the shape of what is coming, or a ",
|
|
200
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
201
|
+
to: "/components/loading-state",
|
|
202
|
+
children: "LoadingState"
|
|
203
|
+
}),
|
|
204
|
+
"), and do not use it for an action the merchant started (a loading button says that)."
|
|
205
|
+
] }),
|
|
206
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
207
|
+
align: "fill",
|
|
208
|
+
clientOnly: true,
|
|
209
|
+
minHeight: 280,
|
|
210
|
+
caption: "Start a load and the card is dimmed and blocked for three seconds. The content stays in place throughout.",
|
|
211
|
+
code: `
|
|
212
|
+
<LoadingOverlay loading={loading} label="Loading your orders">
|
|
213
|
+
<Card>
|
|
214
|
+
<CardHeader title="Recent orders" />
|
|
215
|
+
<CardBody>
|
|
216
|
+
<Orders />
|
|
217
|
+
</CardBody>
|
|
218
|
+
</Card>
|
|
219
|
+
</LoadingOverlay>`,
|
|
220
|
+
children: /* @__PURE__ */ jsx(Region, {})
|
|
221
|
+
}), /* @__PURE__ */ jsxs(Note, {
|
|
222
|
+
title: "Blocked, not removed",
|
|
223
|
+
children: [
|
|
224
|
+
"While it is active the covered content is ",
|
|
225
|
+
/* @__PURE__ */ jsx("code", { children: "inert" }),
|
|
226
|
+
": a press or a key cannot reach it, and focus that was inside it moves to the layer. The overlay takes no focus of its own and traps none, so Tab moves straight past it."
|
|
227
|
+
]
|
|
228
|
+
})]
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
231
|
+
id: "words",
|
|
232
|
+
title: "What it says",
|
|
233
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
234
|
+
"The spinner is decoration and the visible label is hidden from assistive tech. One polite status carries the words, and says them once per wait. ",
|
|
235
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
236
|
+
" is both the words under the spinner and what is announced; ",
|
|
237
|
+
/* @__PURE__ */ jsx("code", { children: "showLabel" }),
|
|
238
|
+
" ",
|
|
239
|
+
"hides the words under the spinner but still announces them. With no ",
|
|
240
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
241
|
+
" the spinner shows alone and the wait is announced as ",
|
|
242
|
+
/* @__PURE__ */ jsx("code", { children: "labels.loading" }),
|
|
243
|
+
" (\"Loading\")."
|
|
244
|
+
] }),
|
|
245
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
246
|
+
align: "fill",
|
|
247
|
+
code: `
|
|
248
|
+
<LoadingOverlay loading label="Loading your orders">
|
|
249
|
+
<Orders />
|
|
250
|
+
</LoadingOverlay>
|
|
251
|
+
|
|
252
|
+
<LoadingOverlay loading label="Loading your orders" showLabel={false}>
|
|
253
|
+
<Orders />
|
|
254
|
+
</LoadingOverlay>
|
|
255
|
+
|
|
256
|
+
<LoadingOverlay loading>
|
|
257
|
+
<Orders />
|
|
258
|
+
</LoadingOverlay>`,
|
|
259
|
+
children: /* @__PURE__ */ jsx(Words, {})
|
|
260
|
+
})
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
263
|
+
id: "progress",
|
|
264
|
+
title: "A known amount of work",
|
|
265
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
266
|
+
"When the work knows how far it has got, pass ",
|
|
267
|
+
/* @__PURE__ */ jsx("code", { children: "progress" }),
|
|
268
|
+
" (0 to 100): a bar runs along the region's bottom edge, clipped to its corners, and the percent follows the words (\"Cloning... 42%\"). ",
|
|
269
|
+
/* @__PURE__ */ jsx("code", { children: "detail" }),
|
|
270
|
+
" is a quieter line under them, for the step the work is on. The status says the words as the wait starts, then the progress and the step again as the work moves on, every 10 points at most once every 3 seconds, so a screen reader hears it go on without hearing every percent. ",
|
|
271
|
+
/* @__PURE__ */ jsx("code", { children: "labels.percent" }),
|
|
272
|
+
" writes the percent the page's way (\"42 %\"). Leave ",
|
|
273
|
+
/* @__PURE__ */ jsx("code", { children: "progress" }),
|
|
274
|
+
" out while it is not known."
|
|
275
|
+
] }),
|
|
276
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
277
|
+
code: `
|
|
278
|
+
<LoadingOverlay
|
|
279
|
+
loading={job.status === 'running'}
|
|
280
|
+
delay={0}
|
|
281
|
+
label="Cloning..."
|
|
282
|
+
progress={job.progress} // 0 to 100
|
|
283
|
+
detail={stepLabel(job.step)} // "Copying products"
|
|
284
|
+
className="store-preview"
|
|
285
|
+
>
|
|
286
|
+
<StorefrontPreview store={store} />
|
|
287
|
+
</LoadingOverlay>`,
|
|
288
|
+
children: /* @__PURE__ */ jsx(Clone, {})
|
|
289
|
+
})
|
|
290
|
+
}),
|
|
291
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
292
|
+
id: "delay",
|
|
293
|
+
title: "The delay",
|
|
294
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
295
|
+
/* @__PURE__ */ jsx("code", { children: "delay" }),
|
|
296
|
+
" holds the layer back so a fast load never flashes. It is 150ms by default, and the announcement waits too. A load that finishes inside the delay shows nothing at all; a longer one shows the layer and, if it became active, says it is loading. Pass ",
|
|
297
|
+
/* @__PURE__ */ jsxs("code", { children: ["delay=", "{0}"] }),
|
|
298
|
+
" only when the wait is already known to be long."
|
|
299
|
+
] }),
|
|
300
|
+
children: /* @__PURE__ */ jsx(CodeBlock$1, { code: `
|
|
301
|
+
{/* The default: a load faster than 150ms never flashes. */}
|
|
302
|
+
<LoadingOverlay loading={saving}>
|
|
303
|
+
{content}
|
|
304
|
+
</LoadingOverlay>
|
|
305
|
+
|
|
306
|
+
{/* Show at once, and say it at once. */}
|
|
307
|
+
<LoadingOverlay loading={saving} delay={0}>
|
|
308
|
+
{content}
|
|
309
|
+
</LoadingOverlay>` })
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
312
|
+
id: "placement",
|
|
313
|
+
title: "Over the page",
|
|
314
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
315
|
+
/* @__PURE__ */ jsx("code", { children: "placement=\"region\"" }),
|
|
316
|
+
" (the default) wraps its children: the root is ",
|
|
317
|
+
/* @__PURE__ */ jsx("code", { children: "position: relative" }),
|
|
318
|
+
" and the layer is drawn across it, so only that region is dimmed and blocked. ",
|
|
319
|
+
/* @__PURE__ */ jsx("code", { children: "placement=\"page\"" }),
|
|
320
|
+
" fixes the layer over the viewport, above everything, while the children still render under it and are still ",
|
|
321
|
+
/* @__PURE__ */ jsx("code", { children: "inert" }),
|
|
322
|
+
". Use it for a page that reloads in place. It is not shown live here because it would cover this page."
|
|
323
|
+
] }),
|
|
324
|
+
children: /* @__PURE__ */ jsx(CodeBlock$1, { code: `
|
|
325
|
+
<LoadingOverlay loading={saving} placement="page">
|
|
326
|
+
<Checkout />
|
|
327
|
+
</LoadingOverlay>` })
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
330
|
+
id: "both-themes",
|
|
331
|
+
title: "In both themes",
|
|
332
|
+
description: /* @__PURE__ */ jsx("p", { children: "The region overlay, dimming a card, light and dark side by side." }),
|
|
333
|
+
children: /* @__PURE__ */ jsx(ThemePair, {
|
|
334
|
+
align: "fill",
|
|
335
|
+
children: /* @__PURE__ */ jsx(Specimen, {})
|
|
336
|
+
})
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
339
|
+
id: "accessibility",
|
|
340
|
+
title: "Accessibility",
|
|
341
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
342
|
+
"While it is active the covered content is inert: neither a press nor a key reaches it, and the kit moves focus to the layer if the content held it, so focus is never left on an inert element.",
|
|
343
|
+
"The card keeps aria-busy while it loads, and the polite status sits outside that busy element, so the wait is not held back with the content.",
|
|
344
|
+
"The spinner and the visible label are hidden from assistive tech; one role=\"status\" line carries the words and says them once per wait.",
|
|
345
|
+
"The overlay traps no focus and takes none of its own. The layer itself can take focus (a tabIndex of -1) only to rescue it from the content it just made inert, and then the focus ring is drawn round the raised panel that says what is happening.",
|
|
346
|
+
"A region overlay wraps its children and needs no positioning of yours; a page overlay fixes the layer over the viewport with the kit's overlay z-index."
|
|
347
|
+
] })
|
|
348
|
+
}),
|
|
349
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
350
|
+
id: "guidelines",
|
|
351
|
+
title: "Guidelines",
|
|
352
|
+
children: [/* @__PURE__ */ jsx(DocTable, {
|
|
353
|
+
columns: ["Reach for", "When"],
|
|
354
|
+
rows: [
|
|
355
|
+
[code("LoadingOverlay"), "The content is already there and must be held still while it reloads: a card, a panel, a table area or the page."],
|
|
356
|
+
[/* @__PURE__ */ jsx(DocLink, {
|
|
357
|
+
to: "/components/skeleton",
|
|
358
|
+
children: "Skeleton"
|
|
359
|
+
}), "The content has no known shape yet: draw the rows that are coming instead of dimming nothing."],
|
|
360
|
+
[/* @__PURE__ */ jsx(DocLink, {
|
|
361
|
+
to: "/components/loading-state",
|
|
362
|
+
children: "LoadingState"
|
|
363
|
+
}), "A block that holds the room of what is coming, for a first load."],
|
|
364
|
+
[/* @__PURE__ */ jsx(DocLink, {
|
|
365
|
+
to: "/components/progress",
|
|
366
|
+
children: "Progress"
|
|
367
|
+
}), "A long job with a known end: pair a bar with the overlay."]
|
|
368
|
+
]
|
|
369
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
370
|
+
"Reach for it when the content stays: the merchant keeps their bearings, and the region says why it is held still.",
|
|
371
|
+
"Keep the default delay. Only a wait you already know is long should show at once.",
|
|
372
|
+
"Name the wait in the label (\"Loading your orders\"), and pass labels translated: the kit says them in English.",
|
|
373
|
+
"One overlay over one region. Never nest them.",
|
|
374
|
+
"Do not mark the region busy yourself; the overlay does that, and a busy ancestor can hold the status back.",
|
|
375
|
+
"For a whole route that has nothing on it yet, use LoadingState placement=\"screen\" rather than a page overlay."
|
|
376
|
+
] })]
|
|
377
|
+
}),
|
|
378
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
379
|
+
id: "props",
|
|
380
|
+
title: "Props",
|
|
381
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
382
|
+
"Also accepts every native ",
|
|
383
|
+
/* @__PURE__ */ jsx("code", { children: "div" }),
|
|
384
|
+
" attribute, and a ref."
|
|
385
|
+
] }),
|
|
386
|
+
children: [/* @__PURE__ */ jsx(PropsTable, { rows: [
|
|
387
|
+
{
|
|
388
|
+
name: "loading",
|
|
389
|
+
type: "boolean",
|
|
390
|
+
required: true,
|
|
391
|
+
description: "Whether the covered content is loading."
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: "label",
|
|
395
|
+
type: "ReactNode",
|
|
396
|
+
description: "Words under the spinner, and what is announced: \"Setting up your store\". Defaults to labels.loading."
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: "showLabel",
|
|
400
|
+
type: "boolean",
|
|
401
|
+
default: "true when label is given",
|
|
402
|
+
description: "Show the words under the spinner. The words are still announced when hidden."
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
name: "placement",
|
|
406
|
+
type: "'region' | 'page'",
|
|
407
|
+
default: "'region'",
|
|
408
|
+
description: "Over the children it wraps, or fixed over the viewport while the children still render under it."
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: "delay",
|
|
412
|
+
type: "number",
|
|
413
|
+
default: "150",
|
|
414
|
+
description: "Wait this long, in milliseconds, before showing, so a fast load never flashes. The announcement waits too."
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: "progress",
|
|
418
|
+
type: "number",
|
|
419
|
+
description: "How far the work has got, 0 to 100: a bar on the bottom edge and the percent after the words, said again as it moves on. Leave it out while unknown."
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: "detail",
|
|
423
|
+
type: "ReactNode",
|
|
424
|
+
description: "A quieter line under the words: the step the work is on. Said with the progress when a string."
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
name: "labels",
|
|
428
|
+
type: "Partial<LoadingOverlayLabels>",
|
|
429
|
+
description: "Reword the words the overlay says itself."
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
name: "children",
|
|
433
|
+
type: "ReactNode",
|
|
434
|
+
description: "The content it covers, which it dims and blocks while loading."
|
|
435
|
+
}
|
|
436
|
+
] }), /* @__PURE__ */ jsx(PropsTable, {
|
|
437
|
+
title: "Labels",
|
|
438
|
+
rows: [{
|
|
439
|
+
name: "loading",
|
|
440
|
+
type: "string",
|
|
441
|
+
default: "'Loading'",
|
|
442
|
+
description: "Announced, and shown when label is not given and showLabel is true."
|
|
443
|
+
}, {
|
|
444
|
+
name: "percent",
|
|
445
|
+
type: "(value: number) => string",
|
|
446
|
+
default: "(value) => `${value}%`",
|
|
447
|
+
description: "How a progress is written after the words, and said."
|
|
448
|
+
}]
|
|
449
|
+
})]
|
|
450
|
+
}),
|
|
451
|
+
/* @__PURE__ */ jsx(Fragment$1, {})
|
|
452
|
+
]
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
export { Page, Preview };
|