@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,486 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as DocTable, d as Section$1, i as DocPage, o as Example, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Button, ImportResult } from "@orbitcommerce/constellation";
|
|
6
|
+
//#region src/pages/components/import-result.tsx
|
|
7
|
+
var PROBLEMS = [
|
|
8
|
+
"Price is missing",
|
|
9
|
+
"Status must be active, draft or archived",
|
|
10
|
+
"SKU is already used by another product",
|
|
11
|
+
"Weight must be a number"
|
|
12
|
+
];
|
|
13
|
+
/** Rows that failed, as the server reports them: a row number, the product's handle where the file has one, and why. */
|
|
14
|
+
var ERRORS = Array.from({ length: 34 }, (_, index) => ({
|
|
15
|
+
row: index * 3 + 4,
|
|
16
|
+
identifier: index % 4 === 3 ? void 0 : `oak-desk-${index + 1}`,
|
|
17
|
+
messages: index % 5 === 0 ? [PROBLEMS[index % 4], PROBLEMS[(index + 1) % 4]] : [PROBLEMS[index % 4]]
|
|
18
|
+
}));
|
|
19
|
+
var SKIPPED = [
|
|
20
|
+
{
|
|
21
|
+
row: 2,
|
|
22
|
+
identifier: "arden-ergonomic-chair",
|
|
23
|
+
messages: "Already exists"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
row: 3,
|
|
27
|
+
identifier: "linen-pinboard",
|
|
28
|
+
messages: "Already exists"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
row: 9,
|
|
32
|
+
identifier: "walnut-monitor-riser",
|
|
33
|
+
messages: "Already exists"
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
var WARNINGS = [{
|
|
37
|
+
row: 5,
|
|
38
|
+
identifier: "beech-storage-unit",
|
|
39
|
+
messages: "The column \"Internal notes\" was ignored."
|
|
40
|
+
}, {
|
|
41
|
+
row: 12,
|
|
42
|
+
identifier: "steel-filing-cabinet",
|
|
43
|
+
messages: "The category \"Office > Storage > Metal\" was created."
|
|
44
|
+
}];
|
|
45
|
+
function Preview() {
|
|
46
|
+
return /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: "import-result-preview",
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
children: /* @__PURE__ */ jsx(ImportResult, {
|
|
50
|
+
state: "done",
|
|
51
|
+
counts: {
|
|
52
|
+
created: 1204,
|
|
53
|
+
updated: 36
|
|
54
|
+
},
|
|
55
|
+
titleAs: "p",
|
|
56
|
+
style: { padding: 0 }
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** The import running and finishing, with the bar driven by a timer in place of the server's polls. */
|
|
61
|
+
function RunningImport() {
|
|
62
|
+
const [state, setState] = useState("running");
|
|
63
|
+
const [progress, setProgress] = useState(0);
|
|
64
|
+
const [run, setRun] = useState(0);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (state !== "running") return void 0;
|
|
67
|
+
const timer = window.setInterval(() => {
|
|
68
|
+
setProgress((was) => {
|
|
69
|
+
const next = Math.min(100, was + 9);
|
|
70
|
+
if (next === 100) window.setTimeout(() => setState("done"), 400);
|
|
71
|
+
return next;
|
|
72
|
+
});
|
|
73
|
+
}, 450);
|
|
74
|
+
return () => window.clearInterval(timer);
|
|
75
|
+
}, [state, run]);
|
|
76
|
+
const again = () => {
|
|
77
|
+
setProgress(0);
|
|
78
|
+
setState("running");
|
|
79
|
+
setRun((count) => count + 1);
|
|
80
|
+
};
|
|
81
|
+
const running = state === "running";
|
|
82
|
+
return /* @__PURE__ */ jsx("div", {
|
|
83
|
+
className: "import-result-stage",
|
|
84
|
+
children: /* @__PURE__ */ jsx(ImportResult, {
|
|
85
|
+
state,
|
|
86
|
+
progress,
|
|
87
|
+
title: running ? "Importing 1,240 products" : void 0,
|
|
88
|
+
description: running ? "This can take a few minutes. You can close this and keep working." : void 0,
|
|
89
|
+
counts: {
|
|
90
|
+
created: 1204,
|
|
91
|
+
updated: 36,
|
|
92
|
+
failed: 3
|
|
93
|
+
},
|
|
94
|
+
errors: ERRORS.slice(0, 3),
|
|
95
|
+
downloadName: "products",
|
|
96
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
97
|
+
variant: "secondary",
|
|
98
|
+
size: "sm",
|
|
99
|
+
"aria-disabled": running || void 0,
|
|
100
|
+
onClick: running ? void 0 : again,
|
|
101
|
+
children: "Run it again"
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
var OUTCOMES = [
|
|
107
|
+
{
|
|
108
|
+
outcome: "success",
|
|
109
|
+
counts: {
|
|
110
|
+
created: 1204,
|
|
111
|
+
updated: 36
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
outcome: "partial",
|
|
116
|
+
counts: {
|
|
117
|
+
created: 1170,
|
|
118
|
+
failed: 34
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
outcome: "failed",
|
|
123
|
+
counts: { failed: 34 }
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
outcome: "skipped",
|
|
127
|
+
counts: { skipped: 1240 }
|
|
128
|
+
}
|
|
129
|
+
];
|
|
130
|
+
function Page() {
|
|
131
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
132
|
+
title: "Import result",
|
|
133
|
+
status: "new",
|
|
134
|
+
importNames: ["ImportResult"],
|
|
135
|
+
lead: "An import's progress and its result, as one panel: a spinner and a bar while it runs, then a disc tinted for how it went, what it created, updated, skipped and failed, and the rows to fix, ten at a time, each list a CSV to download.",
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
138
|
+
id: "basics",
|
|
139
|
+
title: "Basics",
|
|
140
|
+
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
141
|
+
"Give it the import's ",
|
|
142
|
+
/* @__PURE__ */ jsx("code", { children: "state" }),
|
|
143
|
+
": ",
|
|
144
|
+
/* @__PURE__ */ jsx("code", { children: "running" }),
|
|
145
|
+
" while it works, with its ",
|
|
146
|
+
/* @__PURE__ */ jsx("code", { children: "progress" }),
|
|
147
|
+
" from 0 to 100, then ",
|
|
148
|
+
/* @__PURE__ */ jsx("code", { children: "done" }),
|
|
149
|
+
" with the ",
|
|
150
|
+
/* @__PURE__ */ jsx("code", { children: "counts" }),
|
|
151
|
+
" the server sent back and the rows it could not take. While it runs the bar never leaves the page: no progress yet, or a poll that reports 0 mid-import, is an empty bar, not a missing one."
|
|
152
|
+
] }), /* @__PURE__ */ jsxs("p", { children: [
|
|
153
|
+
"The outcome is read from the counts (",
|
|
154
|
+
/* @__PURE__ */ jsx("code", { children: "importOutcome" }),
|
|
155
|
+
"): rows created or updated and none failed is a success, some of each is partial, failures alone is failed, and a file whose every row was skipped is nothing new. Where the counts leave something out, or a result has none, the lists stand in: rows in ",
|
|
156
|
+
/* @__PURE__ */ jsx("code", { children: "errors" }),
|
|
157
|
+
" are failures. Only a result that reports nothing, as an export does, is done with no counts. Pass",
|
|
158
|
+
" ",
|
|
159
|
+
/* @__PURE__ */ jsx("code", { children: "outcome" }),
|
|
160
|
+
" when you know better."
|
|
161
|
+
] })] }),
|
|
162
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
163
|
+
code: `
|
|
164
|
+
<ImportResult
|
|
165
|
+
state={job.state}
|
|
166
|
+
progress={job.progress}
|
|
167
|
+
title={job.state === 'running' ? 'Importing 1,240 products' : undefined}
|
|
168
|
+
counts={result?.summary}
|
|
169
|
+
errors={result?.errors}
|
|
170
|
+
downloadName="products"
|
|
171
|
+
/>`,
|
|
172
|
+
children: /* @__PURE__ */ jsx(RunningImport, {})
|
|
173
|
+
})
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
176
|
+
id: "outcomes",
|
|
177
|
+
title: "Outcomes",
|
|
178
|
+
description: /* @__PURE__ */ jsx("p", { children: "Each outcome has its disc, the icon tile's 64px outcome disc: green with a check when everything went in, amber with a warning when some rows failed, red with a cross when none went in, and neutral with a dash when every row was skipped, so nothing changed. Under the title, a line for each count over 0, its mark in the same tones: green for what went in, neutral for skips and red for failures." }),
|
|
179
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
180
|
+
code: `
|
|
181
|
+
<ImportResult state="done" counts={{ created: 1204, updated: 36 }} />
|
|
182
|
+
<ImportResult state="done" counts={{ created: 1170, failed: 34 }} />
|
|
183
|
+
<ImportResult state="done" counts={{ failed: 34 }} />
|
|
184
|
+
<ImportResult state="done" counts={{ skipped: 1240 }} />`,
|
|
185
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
186
|
+
className: "import-result-grid",
|
|
187
|
+
children: OUTCOMES.map(({ outcome, counts }) => /* @__PURE__ */ jsx("div", {
|
|
188
|
+
className: "import-result-cell",
|
|
189
|
+
children: /* @__PURE__ */ jsx(ImportResult, {
|
|
190
|
+
state: "done",
|
|
191
|
+
counts,
|
|
192
|
+
titleAs: "h4"
|
|
193
|
+
})
|
|
194
|
+
}, outcome))
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
199
|
+
id: "lists",
|
|
200
|
+
title: "The rows to fix",
|
|
201
|
+
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
202
|
+
/* @__PURE__ */ jsx("code", { children: "errors" }),
|
|
203
|
+
", ",
|
|
204
|
+
/* @__PURE__ */ jsx("code", { children: "skipped" }),
|
|
205
|
+
" and ",
|
|
206
|
+
/* @__PURE__ */ jsx("code", { children: "warnings" }),
|
|
207
|
+
" are the rows the server reported, each with its row number, the item's name where the file gives one (a handle, an order number), and its messages. Each list folds behind a toggle with its count and opens onto its rows ten at a time (\"1–10 of 34\"); Download CSV saves the whole list, the row, the item and the messages, as ",
|
|
208
|
+
/* @__PURE__ */ jsx("code", { children: "products-errors-2026-10-15.csv" }),
|
|
209
|
+
"."
|
|
210
|
+
] }), /* @__PURE__ */ jsx("p", { children: "Warnings are rows that went in with a note: a column that was ignored, a category it created. Skipped rows are ones it left alone, such as products that already exist." })] }),
|
|
211
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
212
|
+
code: `
|
|
213
|
+
<ImportResult
|
|
214
|
+
state="done"
|
|
215
|
+
counts={{ created: 1170, skipped: 3, failed: 34 }}
|
|
216
|
+
errors={errors}
|
|
217
|
+
skipped={skipped}
|
|
218
|
+
warnings={warnings}
|
|
219
|
+
downloadName="products"
|
|
220
|
+
/>`,
|
|
221
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
222
|
+
className: "import-result-stage",
|
|
223
|
+
children: /* @__PURE__ */ jsx(ImportResult, {
|
|
224
|
+
state: "done",
|
|
225
|
+
counts: {
|
|
226
|
+
created: 1170,
|
|
227
|
+
skipped: 3,
|
|
228
|
+
failed: 34
|
|
229
|
+
},
|
|
230
|
+
errors: ERRORS,
|
|
231
|
+
skipped: SKIPPED,
|
|
232
|
+
warnings: WARNINGS,
|
|
233
|
+
downloadName: "products"
|
|
234
|
+
})
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
}),
|
|
238
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
239
|
+
id: "failed-request",
|
|
240
|
+
title: "A failed request",
|
|
241
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
242
|
+
"When the request itself fails before any row is read (a 500, a timeout), there is no result to count:",
|
|
243
|
+
" ",
|
|
244
|
+
/* @__PURE__ */ jsx("code", { children: "state=\"failed\"" }),
|
|
245
|
+
" says that nothing was imported, as an alert, with the server's own message as a quiet",
|
|
246
|
+
" ",
|
|
247
|
+
/* @__PURE__ */ jsx("code", { children: "detail" }),
|
|
248
|
+
" to quote."
|
|
249
|
+
] }),
|
|
250
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
251
|
+
code: `
|
|
252
|
+
<ImportResult
|
|
253
|
+
state="failed"
|
|
254
|
+
detail="Request failed with status code 500"
|
|
255
|
+
actions={<Button variant="secondary" size="sm" onClick={retry}>Try again</Button>}
|
|
256
|
+
/>`,
|
|
257
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
258
|
+
className: "import-result-stage",
|
|
259
|
+
children: /* @__PURE__ */ jsx(ImportResult, {
|
|
260
|
+
state: "failed",
|
|
261
|
+
detail: "Request failed with status code 500",
|
|
262
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
263
|
+
variant: "secondary",
|
|
264
|
+
size: "sm",
|
|
265
|
+
children: "Try again"
|
|
266
|
+
})
|
|
267
|
+
})
|
|
268
|
+
})
|
|
269
|
+
})
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
272
|
+
id: "export",
|
|
273
|
+
title: "An export",
|
|
274
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
275
|
+
"An export is the same panel in its own words: ",
|
|
276
|
+
/* @__PURE__ */ jsx("code", { children: "title" }),
|
|
277
|
+
" and ",
|
|
278
|
+
/* @__PURE__ */ jsx("code", { children: "description" }),
|
|
279
|
+
" in place of the state's own, the bar's name in ",
|
|
280
|
+
/* @__PURE__ */ jsx("code", { children: "labels.progress" }),
|
|
281
|
+
", and ",
|
|
282
|
+
/* @__PURE__ */ jsx("code", { children: "actions" }),
|
|
283
|
+
" for what comes after."
|
|
284
|
+
] }),
|
|
285
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
286
|
+
code: `
|
|
287
|
+
<ImportResult
|
|
288
|
+
state="running"
|
|
289
|
+
progress={64}
|
|
290
|
+
title="Exporting inventory"
|
|
291
|
+
description="We'll save the file when it's ready."
|
|
292
|
+
labels={{ progress: 'Export progress' }}
|
|
293
|
+
/>
|
|
294
|
+
<ImportResult
|
|
295
|
+
state="done"
|
|
296
|
+
title="Export complete"
|
|
297
|
+
description="inventory-2026-10-15.csv, 2,418 items, has been saved to your downloads."
|
|
298
|
+
actions={<Button variant="primary" size="sm">Close</Button>}
|
|
299
|
+
/>`,
|
|
300
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
301
|
+
className: "import-result-grid",
|
|
302
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
303
|
+
className: "import-result-cell",
|
|
304
|
+
children: /* @__PURE__ */ jsx(ImportResult, {
|
|
305
|
+
state: "running",
|
|
306
|
+
progress: 64,
|
|
307
|
+
title: "Exporting inventory",
|
|
308
|
+
description: "We'll save the file when it's ready.",
|
|
309
|
+
labels: { progress: "Export progress" },
|
|
310
|
+
titleAs: "h4"
|
|
311
|
+
})
|
|
312
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
313
|
+
className: "import-result-cell",
|
|
314
|
+
children: /* @__PURE__ */ jsx(ImportResult, {
|
|
315
|
+
state: "done",
|
|
316
|
+
title: "Export complete",
|
|
317
|
+
description: "inventory-2026-10-15.csv, 2,418 items, has been saved to your downloads.",
|
|
318
|
+
titleAs: "h4",
|
|
319
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
320
|
+
variant: "primary",
|
|
321
|
+
size: "sm",
|
|
322
|
+
children: "Close"
|
|
323
|
+
})
|
|
324
|
+
})
|
|
325
|
+
})]
|
|
326
|
+
})
|
|
327
|
+
})
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
330
|
+
id: "writing",
|
|
331
|
+
title: "Writing",
|
|
332
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
333
|
+
"Its words are in English by default; pass the page's language in ",
|
|
334
|
+
/* @__PURE__ */ jsx("code", { children: "labels" }),
|
|
335
|
+
", and your own nouns where the counts should say what they count (\"12 products created\")."
|
|
336
|
+
] }),
|
|
337
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
338
|
+
code: `
|
|
339
|
+
<ImportResult
|
|
340
|
+
state="done"
|
|
341
|
+
counts={{ created: 12, skipped: 2 }}
|
|
342
|
+
labels={{
|
|
343
|
+
createdCount: (count) => (count === 1 ? '1 order created' : \`\${count} orders created\`),
|
|
344
|
+
skippedCount: (count) => \`\${count} orders skipped (they already exist)\`,
|
|
345
|
+
}}
|
|
346
|
+
/>`,
|
|
347
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
348
|
+
className: "import-result-stage",
|
|
349
|
+
children: /* @__PURE__ */ jsx(ImportResult, {
|
|
350
|
+
state: "done",
|
|
351
|
+
counts: {
|
|
352
|
+
created: 12,
|
|
353
|
+
skipped: 2
|
|
354
|
+
},
|
|
355
|
+
labels: {
|
|
356
|
+
createdCount: (count) => count === 1 ? "1 order created" : `${count} orders created`,
|
|
357
|
+
skippedCount: (count) => `${count} orders skipped (they already exist)`
|
|
358
|
+
}
|
|
359
|
+
})
|
|
360
|
+
})
|
|
361
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
362
|
+
"Say what happened in the title, and what to do next in the line under it. \"Import finished with errors\", then \"Some rows were imported and some failed.\"",
|
|
363
|
+
"Keep the server's messages as they are in the lists: they are what a person searches the file for.",
|
|
364
|
+
"Name the file for what it holds: downloadName=\"orders\" saves orders-errors-2026-10-15.csv."
|
|
365
|
+
] })]
|
|
366
|
+
}),
|
|
367
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
368
|
+
id: "accessibility",
|
|
369
|
+
title: "Accessibility",
|
|
370
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
371
|
+
"The bar is a progressbar named \"Import progress\", with its value. The disc is decorative: the title says how it went.",
|
|
372
|
+
"When it goes from running to done, a polite status that was in the page all along says the outcome, its line and its counts. A result that arrives done says nothing: it is read as the panel it is.",
|
|
373
|
+
"A failed request is an alert, so it is said at once, and the status stays quiet so it is not said twice.",
|
|
374
|
+
"Each list's toggle is a button with aria-expanded, and its Download CSV button's name says which list it saves (\"Download CSV of errors\") and starts with the words it shows.",
|
|
375
|
+
"Paging keeps focus on the arrow that was pressed; an arrow at the end of the list rests and stays in the tab order.",
|
|
376
|
+
"Under reduced motion the disc and the words fade in without moving, and the caret turns without a transition."
|
|
377
|
+
] })
|
|
378
|
+
}),
|
|
379
|
+
/* @__PURE__ */ jsx(Fragment$1, {}),
|
|
380
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
381
|
+
id: "props",
|
|
382
|
+
title: "Props",
|
|
383
|
+
description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native div attribute except title, and a ref." }),
|
|
384
|
+
children: [
|
|
385
|
+
/* @__PURE__ */ jsx(PropsTable, { rows: [
|
|
386
|
+
{
|
|
387
|
+
name: "state",
|
|
388
|
+
type: "'running' | 'done' | 'failed'",
|
|
389
|
+
required: true,
|
|
390
|
+
description: "Working, reported back, or a request that failed before any row was read."
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
name: "progress",
|
|
394
|
+
type: "number | null",
|
|
395
|
+
default: "0",
|
|
396
|
+
description: "How far it has got, 0 to 100, while it runs. The bar stays on the page whatever it is told."
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: "counts",
|
|
400
|
+
type: "JobCounts",
|
|
401
|
+
description: "What a finished import did: { created, updated, skipped, failed }. Each over 0 is a line of its own."
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
name: "outcome",
|
|
405
|
+
type: "'success' | 'partial' | 'failed' | 'skipped'",
|
|
406
|
+
default: "importOutcome(counts, lists)",
|
|
407
|
+
description: "How it went, when the counts and the lists do not say it."
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
name: "errors, skipped, warnings",
|
|
411
|
+
type: "ImportIssue[]",
|
|
412
|
+
description: "The rows to list: { row?, identifier?, messages? }."
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: "title, description",
|
|
416
|
+
type: "ReactNode",
|
|
417
|
+
description: "In place of the state's own title and line."
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: "detail",
|
|
421
|
+
type: "ReactNode",
|
|
422
|
+
description: "A quiet line under the words: for a failed request, the server's message."
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
name: "actions",
|
|
426
|
+
type: "ReactNode",
|
|
427
|
+
description: "What comes after the result: Close, View products."
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
name: "downloadName",
|
|
431
|
+
type: "string",
|
|
432
|
+
default: "'import'",
|
|
433
|
+
description: "The start of each downloaded file's name: products saves products-errors-2026-10-15.csv."
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
name: "pageSize",
|
|
437
|
+
type: "number",
|
|
438
|
+
default: "10",
|
|
439
|
+
description: "Rows to a page in each list."
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
name: "titleAs",
|
|
443
|
+
type: "'h2' | 'h3' | 'h4' | 'p'",
|
|
444
|
+
default: "'h3'",
|
|
445
|
+
description: "Element for the title."
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
name: "labels",
|
|
449
|
+
type: "Partial<ImportResultLabels>",
|
|
450
|
+
description: "Its words, in English by default (importResultLabels)."
|
|
451
|
+
}
|
|
452
|
+
] }),
|
|
453
|
+
/* @__PURE__ */ jsx(DocTable, {
|
|
454
|
+
columns: ["Label", "English"],
|
|
455
|
+
rows: [
|
|
456
|
+
[/* @__PURE__ */ jsx("code", { children: "running, runningHint, progress" }), "\"Importing\", \"This can take a few minutes.\", \"Import progress\""],
|
|
457
|
+
[/* @__PURE__ */ jsx("code", { children: "successTitle, partialTitle, failedTitle, skippedTitle" }), "\"Import finished\", \"Import finished with errors\", \"Import failed\", \"Nothing new to import\""],
|
|
458
|
+
[/* @__PURE__ */ jsx("code", { children: "successHint, partialHint, failedHint, skippedHint" }), "\"Everything in the file was imported.\", \"Some rows were imported and some failed.\", …"],
|
|
459
|
+
[/* @__PURE__ */ jsx("code", { children: "requestFailedTitle, requestFailedHint" }), "\"Import failed\", \"Nothing was imported. Fix the problem and try again.\""],
|
|
460
|
+
[/* @__PURE__ */ jsx("code", { children: "createdCount(count) … failedCount(count)" }), "\"1,204 created\", \"36 updated\", \"3 skipped\", \"34 failed\""],
|
|
461
|
+
[/* @__PURE__ */ jsx("code", { children: "errorsList(count), skippedList(count), warningsList(count)" }), "\"Errors (34)\", \"Skipped (3)\", \"Warnings (2)\""],
|
|
462
|
+
[/* @__PURE__ */ jsx("code", { children: "download, downloadErrors, downloadSkipped, downloadWarnings" }), "\"Download CSV\", \"Download CSV of errors\", …"],
|
|
463
|
+
[/* @__PURE__ */ jsx("code", { children: "errorsPages, range(from, to, total), previousPage, nextPage, page(n), pageOf(n, count)" }), "\"Pages of errors\", \"1–10 of 34\", \"Previous page\", \"Next page\", \"Page 2\", \"Page 2 of 4\""],
|
|
464
|
+
[/* @__PURE__ */ jsx("code", { children: "row(row), noMessage" }), "\"Row 12\", \"No reason given\""],
|
|
465
|
+
[/* @__PURE__ */ jsx("code", { children: "csvRow, csvItem, csvMessages" }), "\"Row\", \"Item\", \"Messages\""]
|
|
466
|
+
]
|
|
467
|
+
}),
|
|
468
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
469
|
+
title: "Helpers",
|
|
470
|
+
rows: [{
|
|
471
|
+
name: "importOutcome(counts, lists?)",
|
|
472
|
+
type: "ImportOutcome",
|
|
473
|
+
description: "How an import went, read from its counts as the dashboard reads them, and from its errors and skipped rows where the counts leave them out."
|
|
474
|
+
}, {
|
|
475
|
+
name: "importIssuesCsv(issues, columns?)",
|
|
476
|
+
type: "string",
|
|
477
|
+
description: "A list of rows as a CSV, each cell kept from being read as a formula and quoted when it must be."
|
|
478
|
+
}]
|
|
479
|
+
})
|
|
480
|
+
]
|
|
481
|
+
})
|
|
482
|
+
]
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
//#endregion
|
|
486
|
+
export { Page, Preview };
|