@orbitcommerce/constellation-docs 1.0.0 → 1.2.1
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-BvxQWBTy.js +403 -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-CXZ3V1d4.js +1612 -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-hg7txTc3.js +1381 -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-DRUWNVHP.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-D3a3QGKJ.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-BSfEqHY8.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-BCPvtP8J.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-CbiibLwn.js} +581 -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-CNR7zpf7.js +594 -0
- package/dist/pages/{release-Dvo684UJ.js → release-DYBCY7jm.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-mq_pNXza.js +3232 -0
- package/dist/pages/{tabs-B4M-usCV.js → tabs-Cf4MZ8Fq.js} +257 -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 +10989 -1108
- package/package.json +3 -3
- 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,738 @@
|
|
|
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 { n as DESK_PHOTO, r as LAMP_PHOTO, t as CHAIR_PHOTO } from "./_conversation-samples-Bq7cn-4d.js";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Badge, Button, FileChip, FileChipRow, IconButton } from "@orbitcommerce/constellation";
|
|
7
|
+
import { BellIcon, DownloadSimpleIcon, FileCsvIcon, FilePdfIcon, PencilSimpleIcon } from "@orbitcommerce/constellation/icons";
|
|
8
|
+
//#region src/pages/components/file-chip.tsx
|
|
9
|
+
function Preview() {
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
className: "file-chip-preview",
|
|
12
|
+
children: [/* @__PURE__ */ jsx(FileChip, {
|
|
13
|
+
name: "prices.csv",
|
|
14
|
+
size: 52431,
|
|
15
|
+
onRemove: () => {}
|
|
16
|
+
}), /* @__PURE__ */ jsx(FileChip, {
|
|
17
|
+
variant: "row",
|
|
18
|
+
name: "guide.pdf",
|
|
19
|
+
size: 25e5,
|
|
20
|
+
status: "uploading",
|
|
21
|
+
progress: 64,
|
|
22
|
+
icon: /* @__PURE__ */ jsx(FilePdfIcon, {})
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** A card with the Replace button doing its work: choose a file and the chip takes it. */
|
|
27
|
+
function ReplaceDemo() {
|
|
28
|
+
const [file, setFile] = useState({
|
|
29
|
+
name: "sample-products.csv",
|
|
30
|
+
size: 52431
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: "file-chip-stack",
|
|
34
|
+
children: /* @__PURE__ */ jsx(FileChip, {
|
|
35
|
+
name: file.name,
|
|
36
|
+
size: file.size,
|
|
37
|
+
accept: ".csv,.xls,.xlsx",
|
|
38
|
+
maxSize: 5242880,
|
|
39
|
+
onReplace: (next) => setFile({
|
|
40
|
+
name: next.name,
|
|
41
|
+
size: next.size
|
|
42
|
+
}),
|
|
43
|
+
onRemove: () => setFile({
|
|
44
|
+
name: "sample-products.csv",
|
|
45
|
+
size: 52431
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/** An upload that counts up, can fail part of the way, and starts again on Try again. */
|
|
51
|
+
function UploadDemo() {
|
|
52
|
+
const [status, setStatus] = useState("uploading");
|
|
53
|
+
const [progress, setProgress] = useState(0);
|
|
54
|
+
const timer = useRef(void 0);
|
|
55
|
+
const stop = () => {
|
|
56
|
+
clearInterval(timer.current);
|
|
57
|
+
timer.current = void 0;
|
|
58
|
+
};
|
|
59
|
+
/** Counts up 4% at a time. With `failAt`, drops the connection when it gets there. */
|
|
60
|
+
const start = (failAt) => {
|
|
61
|
+
stop();
|
|
62
|
+
setStatus("uploading");
|
|
63
|
+
setProgress(0);
|
|
64
|
+
let at = 0;
|
|
65
|
+
timer.current = setInterval(() => {
|
|
66
|
+
at += 4;
|
|
67
|
+
if (failAt !== void 0 && at >= failAt) {
|
|
68
|
+
stop();
|
|
69
|
+
setStatus("error");
|
|
70
|
+
} else if (at >= 100) {
|
|
71
|
+
stop();
|
|
72
|
+
setProgress(100);
|
|
73
|
+
setStatus("done");
|
|
74
|
+
} else setProgress(at);
|
|
75
|
+
}, 90);
|
|
76
|
+
};
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
start(60);
|
|
79
|
+
return stop;
|
|
80
|
+
}, []);
|
|
81
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
82
|
+
className: "file-chip-stack",
|
|
83
|
+
children: [/* @__PURE__ */ jsx(FileChip, {
|
|
84
|
+
name: "price-list-autumn.csv",
|
|
85
|
+
size: 346e4,
|
|
86
|
+
status,
|
|
87
|
+
progress: status === "uploading" ? progress : void 0,
|
|
88
|
+
error: "The connection dropped at 60%.",
|
|
89
|
+
onRetry: () => start(),
|
|
90
|
+
onRemove: stop
|
|
91
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
92
|
+
className: "file-chip-actions",
|
|
93
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
94
|
+
size: "sm",
|
|
95
|
+
onClick: () => start(60),
|
|
96
|
+
children: "Upload again, and fail"
|
|
97
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
98
|
+
size: "sm",
|
|
99
|
+
onClick: () => start(),
|
|
100
|
+
children: "Upload again"
|
|
101
|
+
})]
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
var STATUS_COPY = {
|
|
106
|
+
name: "price-list-autumn.csv",
|
|
107
|
+
size: 346e4
|
|
108
|
+
};
|
|
109
|
+
function Statuses({ variant }) {
|
|
110
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
111
|
+
className: "file-chip-stack",
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx(FileChip, {
|
|
114
|
+
variant,
|
|
115
|
+
animateIn: false,
|
|
116
|
+
...STATUS_COPY,
|
|
117
|
+
onRemove: () => {}
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ jsx(FileChip, {
|
|
120
|
+
variant,
|
|
121
|
+
animateIn: false,
|
|
122
|
+
...STATUS_COPY,
|
|
123
|
+
status: "uploading",
|
|
124
|
+
onRemove: () => {}
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ jsx(FileChip, {
|
|
127
|
+
variant,
|
|
128
|
+
animateIn: false,
|
|
129
|
+
...STATUS_COPY,
|
|
130
|
+
status: "uploading",
|
|
131
|
+
progress: 42,
|
|
132
|
+
onRemove: () => {}
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ jsx(FileChip, {
|
|
135
|
+
variant,
|
|
136
|
+
animateIn: false,
|
|
137
|
+
...STATUS_COPY,
|
|
138
|
+
status: "done",
|
|
139
|
+
onRemove: () => {}
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ jsx(FileChip, {
|
|
142
|
+
variant,
|
|
143
|
+
animateIn: false,
|
|
144
|
+
...STATUS_COPY,
|
|
145
|
+
status: "error",
|
|
146
|
+
error: "The file is empty. Check it and try again.",
|
|
147
|
+
onRetry: () => {},
|
|
148
|
+
onRemove: () => {}
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function Attachments() {
|
|
154
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
155
|
+
className: "file-chip-stack",
|
|
156
|
+
"data-gap": "sm",
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ jsx(FileChip, {
|
|
159
|
+
variant: "row",
|
|
160
|
+
name: "Setup guide.pdf",
|
|
161
|
+
size: 25e5,
|
|
162
|
+
icon: /* @__PURE__ */ jsx(FilePdfIcon, {}),
|
|
163
|
+
badges: /* @__PURE__ */ jsx(Badge, {
|
|
164
|
+
tone: "neutral",
|
|
165
|
+
children: "Sample"
|
|
166
|
+
}),
|
|
167
|
+
meta: "Unlimited downloads, no expiry",
|
|
168
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, {
|
|
169
|
+
label: "Edit Setup guide.pdf",
|
|
170
|
+
size: "sm",
|
|
171
|
+
children: /* @__PURE__ */ jsx(PencilSimpleIcon, {})
|
|
172
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
173
|
+
label: "Notify buyers of Setup guide.pdf",
|
|
174
|
+
size: "sm",
|
|
175
|
+
children: /* @__PURE__ */ jsx(BellIcon, {})
|
|
176
|
+
})] }),
|
|
177
|
+
onRemove: () => {}
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ jsx(FileChip, {
|
|
180
|
+
variant: "row",
|
|
181
|
+
name: "Product data sheet v3.csv",
|
|
182
|
+
size: 48200,
|
|
183
|
+
icon: /* @__PURE__ */ jsx(FileCsvIcon, {}),
|
|
184
|
+
badges: /* @__PURE__ */ jsx(Badge, {
|
|
185
|
+
tone: "accent",
|
|
186
|
+
children: "v3"
|
|
187
|
+
}),
|
|
188
|
+
meta: "Downloaded 14 times",
|
|
189
|
+
actions: /* @__PURE__ */ jsx(IconButton, {
|
|
190
|
+
label: "Download Product data sheet v3.csv",
|
|
191
|
+
size: "sm",
|
|
192
|
+
children: /* @__PURE__ */ jsx(DownloadSimpleIcon, {})
|
|
193
|
+
}),
|
|
194
|
+
onRemove: () => {}
|
|
195
|
+
}),
|
|
196
|
+
/* @__PURE__ */ jsx(FileChip, {
|
|
197
|
+
variant: "row",
|
|
198
|
+
name: "Warranty terms.pdf",
|
|
199
|
+
size: 31e4,
|
|
200
|
+
icon: /* @__PURE__ */ jsx(FilePdfIcon, {}),
|
|
201
|
+
onRemove: () => {}
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/** A composer's attachments: pills that upload, finish or fail, and go when removed. */
|
|
207
|
+
function PillsDemo() {
|
|
208
|
+
const start = [
|
|
209
|
+
{
|
|
210
|
+
id: "chair",
|
|
211
|
+
name: "arden-chair-front.jpg",
|
|
212
|
+
preview: CHAIR_PHOTO,
|
|
213
|
+
status: "done"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "lamp",
|
|
217
|
+
name: "harbour-lamp-brass-close-up.jpg",
|
|
218
|
+
preview: LAMP_PHOTO,
|
|
219
|
+
status: "uploading"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: "terms",
|
|
223
|
+
name: "trade-terms-2026.pdf",
|
|
224
|
+
status: "done"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: "desk",
|
|
228
|
+
name: "oak-desk-1600.png",
|
|
229
|
+
preview: DESK_PHOTO,
|
|
230
|
+
status: "error"
|
|
231
|
+
}
|
|
232
|
+
];
|
|
233
|
+
const [files, setFiles] = useState(start);
|
|
234
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
235
|
+
className: "file-chip-stack",
|
|
236
|
+
children: [/* @__PURE__ */ jsx(FileChipRow, {
|
|
237
|
+
"aria-label": "Attachments",
|
|
238
|
+
children: files.map((file) => /* @__PURE__ */ jsx(FileChip, {
|
|
239
|
+
variant: "pill",
|
|
240
|
+
name: file.name,
|
|
241
|
+
preview: file.preview,
|
|
242
|
+
status: file.status,
|
|
243
|
+
error: file.status === "error" ? "The file is over 10 MB." : void 0,
|
|
244
|
+
onRemove: () => setFiles((all) => all.filter((f) => f.id !== file.id))
|
|
245
|
+
}, file.id))
|
|
246
|
+
}), files.length < start.length ? /* @__PURE__ */ jsx("div", {
|
|
247
|
+
className: "file-chip-actions",
|
|
248
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
249
|
+
size: "sm",
|
|
250
|
+
onClick: () => setFiles(start),
|
|
251
|
+
children: "Put them back"
|
|
252
|
+
})
|
|
253
|
+
}) : null]
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function Page() {
|
|
257
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
258
|
+
title: "File chip",
|
|
259
|
+
status: "new",
|
|
260
|
+
importNames: ["FileChip", "FileChipRow"],
|
|
261
|
+
lead: "A chosen or attached file on one line: its type, name and size, how it is getting on, and what can be done with it. It takes the place of a dropzone once a file is picked, stacks as rows in a list of attachments, and sits as a pill over a composer's field.",
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
264
|
+
id: "card",
|
|
265
|
+
title: "Card",
|
|
266
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
267
|
+
"The card is the chosen-file card of an import: bordered, roomy, a bare document glyph over the name and the size. It settles in from 6px below as it appears, so the swap from the zone does not jump. Give it",
|
|
268
|
+
" ",
|
|
269
|
+
/* @__PURE__ */ jsx("code", { children: "onReplace" }),
|
|
270
|
+
" and it carries a Replace button that opens the file chooser and hands over what was chosen, held to the same ",
|
|
271
|
+
/* @__PURE__ */ jsx("code", { children: "accept" }),
|
|
272
|
+
", ",
|
|
273
|
+
/* @__PURE__ */ jsx("code", { children: "maxSize" }),
|
|
274
|
+
" and ",
|
|
275
|
+
/* @__PURE__ */ jsx("code", { children: "validate" }),
|
|
276
|
+
" rules as a dropzone."
|
|
277
|
+
] }),
|
|
278
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
279
|
+
align: "fill",
|
|
280
|
+
code: `
|
|
281
|
+
<FileChip
|
|
282
|
+
name={file.name}
|
|
283
|
+
size={file.size}
|
|
284
|
+
accept=".csv,.xls,.xlsx"
|
|
285
|
+
maxSize={5 * 1024 * 1024}
|
|
286
|
+
onReplace={(next) => setFile(next)}
|
|
287
|
+
onRemove={() => setFile(undefined)}
|
|
288
|
+
/>`,
|
|
289
|
+
caption: "Choose another file with Replace. A PNG is not taken: the chip says why where the size was.",
|
|
290
|
+
children: /* @__PURE__ */ jsx(ReplaceDemo, {})
|
|
291
|
+
}), /* @__PURE__ */ jsx(Fragment$1, {})]
|
|
292
|
+
}),
|
|
293
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
294
|
+
id: "row",
|
|
295
|
+
title: "Row",
|
|
296
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
297
|
+
"The row is one line of a list of attachments: the type icon on a tile, the name with its size and any badges after it, and a quiet ",
|
|
298
|
+
/* @__PURE__ */ jsx("code", { children: "meta" }),
|
|
299
|
+
" line under. Your own controls go in ",
|
|
300
|
+
/* @__PURE__ */ jsx("code", { children: "actions" }),
|
|
301
|
+
", before the built-in Replace, Try again and remove. A row does not animate in, so a list does not arrive all at once."
|
|
302
|
+
] }),
|
|
303
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
304
|
+
align: "fill",
|
|
305
|
+
code: `
|
|
306
|
+
<FileChip
|
|
307
|
+
variant="row"
|
|
308
|
+
name="Setup guide.pdf"
|
|
309
|
+
size={2_500_000}
|
|
310
|
+
icon={<FilePdfIcon />}
|
|
311
|
+
badges={<Badge tone="neutral">Sample</Badge>}
|
|
312
|
+
meta="Unlimited downloads, no expiry"
|
|
313
|
+
actions={
|
|
314
|
+
<>
|
|
315
|
+
<IconButton label="Edit Setup guide.pdf" size="sm"><PencilSimpleIcon /></IconButton>
|
|
316
|
+
<IconButton label="Notify buyers of Setup guide.pdf" size="sm"><BellIcon /></IconButton>
|
|
317
|
+
</>
|
|
318
|
+
}
|
|
319
|
+
onRemove={() => remove(file)}
|
|
320
|
+
/>`,
|
|
321
|
+
children: /* @__PURE__ */ jsx(Attachments, {})
|
|
322
|
+
}), /* @__PURE__ */ jsx(Note, {
|
|
323
|
+
title: "Name every icon button",
|
|
324
|
+
children: "Each action you add is yours to name, and the name should say which file it acts on: \"Edit Setup guide.pdf\", not \"Edit\". The built-in remove button does this for you."
|
|
325
|
+
})]
|
|
326
|
+
}),
|
|
327
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
328
|
+
id: "status",
|
|
329
|
+
title: "Status",
|
|
330
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
331
|
+
/* @__PURE__ */ jsx("code", { children: "ready" }),
|
|
332
|
+
" is a file chosen or attached. While it is ",
|
|
333
|
+
/* @__PURE__ */ jsx("code", { children: "uploading" }),
|
|
334
|
+
", the icon becomes a spinner and the second line says the progress in words (\"Uploading… 42%\"); leave ",
|
|
335
|
+
/* @__PURE__ */ jsx("code", { children: "progress" }),
|
|
336
|
+
" out when it is not known. ",
|
|
337
|
+
/* @__PURE__ */ jsx("code", { children: "done" }),
|
|
338
|
+
" turns the chip green with a check. ",
|
|
339
|
+
/* @__PURE__ */ jsx("code", { children: "error" }),
|
|
340
|
+
" turns it red with a warning, the ",
|
|
341
|
+
/* @__PURE__ */ jsx("code", { children: "error" }),
|
|
342
|
+
" you give in a sentence, and Try again when you pass",
|
|
343
|
+
" ",
|
|
344
|
+
/* @__PURE__ */ jsx("code", { children: "onRetry" }),
|
|
345
|
+
". The chip draws no bar of its own: the words are the progress, and assistive tech reads them as a progress bar."
|
|
346
|
+
] }),
|
|
347
|
+
children: [
|
|
348
|
+
/* @__PURE__ */ jsx(Example, {
|
|
349
|
+
align: "fill",
|
|
350
|
+
code: `
|
|
351
|
+
<FileChip name="price-list-autumn.csv" size={3_460_000} onRemove={remove} />
|
|
352
|
+
<FileChip name="price-list-autumn.csv" size={3_460_000} status="uploading" onRemove={remove} />
|
|
353
|
+
<FileChip name="price-list-autumn.csv" size={3_460_000} status="uploading" progress={42} onRemove={remove} />
|
|
354
|
+
<FileChip name="price-list-autumn.csv" size={3_460_000} status="done" onRemove={remove} />
|
|
355
|
+
<FileChip
|
|
356
|
+
name="price-list-autumn.csv"
|
|
357
|
+
size={3_460_000}
|
|
358
|
+
status="error"
|
|
359
|
+
error="The file is empty. Check it and try again."
|
|
360
|
+
onRetry={retry}
|
|
361
|
+
onRemove={remove}
|
|
362
|
+
/>`,
|
|
363
|
+
children: /* @__PURE__ */ jsx(Statuses, {})
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
366
|
+
title: "An upload under way",
|
|
367
|
+
description: /* @__PURE__ */ jsx("p", { children: "Here an upload counts up, fails part of the way, and goes again from Try again. While it uploads, the remove button cancels, and Replace is off." }),
|
|
368
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
369
|
+
align: "fill",
|
|
370
|
+
code: `
|
|
371
|
+
<FileChip
|
|
372
|
+
name="price-list-autumn.csv"
|
|
373
|
+
size={3_460_000}
|
|
374
|
+
status={status}
|
|
375
|
+
progress={status === 'uploading' ? progress : undefined}
|
|
376
|
+
error="The connection dropped at 60%."
|
|
377
|
+
onRetry={retry}
|
|
378
|
+
onRemove={cancel}
|
|
379
|
+
/>`,
|
|
380
|
+
children: /* @__PURE__ */ jsx(UploadDemo, {})
|
|
381
|
+
})
|
|
382
|
+
}),
|
|
383
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
384
|
+
title: "As rows",
|
|
385
|
+
description: /* @__PURE__ */ jsx("p", { children: "The same five states in the row variant." }),
|
|
386
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
387
|
+
align: "fill",
|
|
388
|
+
code: `
|
|
389
|
+
<FileChip variant="row" name="price-list-autumn.csv" size={3_460_000} onRemove={remove} />
|
|
390
|
+
<FileChip variant="row" name="price-list-autumn.csv" size={3_460_000} status="uploading" onRemove={remove} />
|
|
391
|
+
<FileChip variant="row" name="price-list-autumn.csv" size={3_460_000} status="uploading" progress={42} onRemove={remove} />
|
|
392
|
+
<FileChip variant="row" name="price-list-autumn.csv" size={3_460_000} status="done" onRemove={remove} />
|
|
393
|
+
<FileChip
|
|
394
|
+
variant="row"
|
|
395
|
+
name="price-list-autumn.csv"
|
|
396
|
+
size={3_460_000}
|
|
397
|
+
status="error"
|
|
398
|
+
error="The file is empty. Check it and try again."
|
|
399
|
+
onRetry={retry}
|
|
400
|
+
onRemove={remove}
|
|
401
|
+
/>`,
|
|
402
|
+
children: /* @__PURE__ */ jsx(Statuses, { variant: "row" })
|
|
403
|
+
})
|
|
404
|
+
})
|
|
405
|
+
]
|
|
406
|
+
}),
|
|
407
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
408
|
+
id: "pill",
|
|
409
|
+
title: "Pill",
|
|
410
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
411
|
+
/* @__PURE__ */ jsx("code", { children: "variant=\"pill\"" }),
|
|
412
|
+
" is a compact attachment in a composer, in a wrapping ",
|
|
413
|
+
/* @__PURE__ */ jsx("code", { children: "FileChipRow" }),
|
|
414
|
+
" over the field. It keeps a 28px ",
|
|
415
|
+
/* @__PURE__ */ jsx("code", { children: "preview" }),
|
|
416
|
+
" of an image (an object URL of the file being attached), or the file's glyph, while it uploads and after: the status does not take its place. Uploading adds a small spinner after the name, a failure says \"Failed\" in red with the reason for a screen reader and on hover, and the remove sits at its end. The name is cut at 110px and read in full on hover. A pill draws only these; the size line, Replace, Try again, badges and actions are for the card and the row."
|
|
417
|
+
] }),
|
|
418
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
419
|
+
align: "fill",
|
|
420
|
+
code: `<FileChipRow aria-label="Attachments">
|
|
421
|
+
{attachments.map((file) => (
|
|
422
|
+
<FileChip
|
|
423
|
+
key={file.id}
|
|
424
|
+
variant="pill"
|
|
425
|
+
name={file.name}
|
|
426
|
+
preview={file.previewUrl}
|
|
427
|
+
status={file.status}
|
|
428
|
+
error={file.error}
|
|
429
|
+
onRemove={() => remove(file.id)}
|
|
430
|
+
/>
|
|
431
|
+
))}
|
|
432
|
+
</FileChipRow>`,
|
|
433
|
+
children: /* @__PURE__ */ jsx(PillsDemo, {})
|
|
434
|
+
})
|
|
435
|
+
}),
|
|
436
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
437
|
+
id: "long-names",
|
|
438
|
+
title: "Long names",
|
|
439
|
+
description: /* @__PURE__ */ jsx("p", { children: "A name that does not fit is cut with an ellipsis and read in full on hover (it is the element's title). The size, badges and buttons keep their room." }),
|
|
440
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
441
|
+
align: "fill",
|
|
442
|
+
code: `<FileChip name="supplier-price-list-autumn-2026-final-v3-approved.csv" size={3_460_000} onRemove={remove} />`,
|
|
443
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
444
|
+
className: "file-chip-narrow",
|
|
445
|
+
children: /* @__PURE__ */ jsx(FileChip, {
|
|
446
|
+
name: "supplier-price-list-autumn-2026-final-v3-approved.csv",
|
|
447
|
+
size: 346e4,
|
|
448
|
+
onRemove: () => {}
|
|
449
|
+
})
|
|
450
|
+
})
|
|
451
|
+
})
|
|
452
|
+
}),
|
|
453
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
454
|
+
id: "disabled",
|
|
455
|
+
title: "Disabled",
|
|
456
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
457
|
+
/* @__PURE__ */ jsx("code", { children: "disabled" }),
|
|
458
|
+
" switches off the built-in buttons while something else runs, such as an import that has started. They stay in the tab order, ",
|
|
459
|
+
/* @__PURE__ */ jsx("code", { children: "aria-disabled" }),
|
|
460
|
+
" as a busy button is, so one that holds focus keeps it, and a press does nothing. Your own ",
|
|
461
|
+
/* @__PURE__ */ jsx("code", { children: "actions" }),
|
|
462
|
+
" are yours to switch off."
|
|
463
|
+
] }),
|
|
464
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
465
|
+
align: "fill",
|
|
466
|
+
code: `<FileChip name="sample-products.csv" size={52_431} disabled onReplace={replace} onRemove={remove} />`,
|
|
467
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
468
|
+
className: "file-chip-stack",
|
|
469
|
+
children: /* @__PURE__ */ jsx(FileChip, {
|
|
470
|
+
name: "sample-products.csv",
|
|
471
|
+
size: 52431,
|
|
472
|
+
disabled: true,
|
|
473
|
+
onReplace: () => {},
|
|
474
|
+
onRemove: () => {}
|
|
475
|
+
})
|
|
476
|
+
})
|
|
477
|
+
})
|
|
478
|
+
}),
|
|
479
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
480
|
+
id: "both-themes",
|
|
481
|
+
title: "In both themes",
|
|
482
|
+
description: /* @__PURE__ */ jsx("p", { children: "The five states as a card and as a row, light and dark side by side." }),
|
|
483
|
+
children: /* @__PURE__ */ jsx(ThemePair, {
|
|
484
|
+
align: "fill",
|
|
485
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
486
|
+
className: "file-chip-stack",
|
|
487
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
488
|
+
className: "file-chip-group",
|
|
489
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
490
|
+
className: "file-chip-group__name",
|
|
491
|
+
children: "Card"
|
|
492
|
+
}), /* @__PURE__ */ jsx(Statuses, {})]
|
|
493
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
494
|
+
className: "file-chip-group",
|
|
495
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
496
|
+
className: "file-chip-group__name",
|
|
497
|
+
children: "Row"
|
|
498
|
+
}), /* @__PURE__ */ jsx(Statuses, { variant: "row" })]
|
|
499
|
+
})]
|
|
500
|
+
})
|
|
501
|
+
})
|
|
502
|
+
}),
|
|
503
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
504
|
+
id: "guidelines",
|
|
505
|
+
title: "Guidelines",
|
|
506
|
+
children: [/* @__PURE__ */ jsx(DoDont, {
|
|
507
|
+
do: {
|
|
508
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
509
|
+
className: "file-chip-stack",
|
|
510
|
+
children: /* @__PURE__ */ jsx(FileChip, {
|
|
511
|
+
name: "Setup guide.pdf",
|
|
512
|
+
size: 25e5,
|
|
513
|
+
animateIn: false,
|
|
514
|
+
status: "error",
|
|
515
|
+
error: "The file is over the 2 MB limit.",
|
|
516
|
+
onRetry: () => {},
|
|
517
|
+
onRemove: () => {}
|
|
518
|
+
})
|
|
519
|
+
}),
|
|
520
|
+
caption: "Say what went wrong in a sentence the person can act on, and offer Try again."
|
|
521
|
+
},
|
|
522
|
+
dont: {
|
|
523
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
524
|
+
className: "file-chip-stack",
|
|
525
|
+
children: /* @__PURE__ */ jsx(FileChip, {
|
|
526
|
+
name: "Setup guide.pdf",
|
|
527
|
+
size: 25e5,
|
|
528
|
+
animateIn: false,
|
|
529
|
+
status: "error",
|
|
530
|
+
error: "Error 413",
|
|
531
|
+
onRemove: () => {}
|
|
532
|
+
})
|
|
533
|
+
}),
|
|
534
|
+
caption: "An error code the person cannot read, and no way to try again."
|
|
535
|
+
}
|
|
536
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
537
|
+
"Put a chip where the Dropzone was once a file is chosen, with autoFocus, so a keyboard user does not lose their place when the zone goes. A list of attachments is a stack of rows, which never set autoFocus.",
|
|
538
|
+
"Use the card for one file in a step and the row for a list. Mixing them in one list reads as two different things.",
|
|
539
|
+
"Keep the second line short. Meta is one fact or two, not a paragraph.",
|
|
540
|
+
"Pass the size as a byte count and let the chip format it. If you only have words (\"about 50 KB\"), pass them as a string.",
|
|
541
|
+
"Leave progress out rather than guess it: an upload that says 100% and keeps going loses trust.",
|
|
542
|
+
"Name every action you add after the file it acts on."
|
|
543
|
+
] })]
|
|
544
|
+
}),
|
|
545
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
546
|
+
id: "accessibility",
|
|
547
|
+
title: "Accessibility",
|
|
548
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
549
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
550
|
+
"While uploading, its second line is a ",
|
|
551
|
+
/* @__PURE__ */ jsx("code", { children: "progressbar" }),
|
|
552
|
+
" named \"Uploading… price-list-autumn.csv\" with the percentage as its value (none while it is not known). The spinner is decorative. The chip is not",
|
|
553
|
+
" ",
|
|
554
|
+
/* @__PURE__ */ jsx("code", { children: "aria-busy" }),
|
|
555
|
+
": its status is inside it, and a screen reader may wait for a busy element before it reads a change under it."
|
|
556
|
+
] }),
|
|
557
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
558
|
+
"A failed upload's reason is a ",
|
|
559
|
+
/* @__PURE__ */ jsx("code", { children: "role=\"alert\"" }),
|
|
560
|
+
", so it is announced when it appears. A refused Replace file is announced the same way."
|
|
561
|
+
] }),
|
|
562
|
+
/* @__PURE__ */ jsx(Fragment$1, { children: "An invisible polite status in the chip, there from the first render, says \"Uploading…\" as an upload starts and \"Uploaded\" as it finishes. A chip that appears already uploading or done says nothing: it has not changed. The green check is decoration, and the state is never carried by colour alone: the check, the warning and the spinner are different shapes." }),
|
|
563
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
564
|
+
"The chip is a group named for the file, so focus that lands on it says which file it is. Replace stays a button that can hold focus while the file uploads (it is ",
|
|
565
|
+
/* @__PURE__ */ jsx("code", { children: "aria-disabled" }),
|
|
566
|
+
", not",
|
|
567
|
+
" ",
|
|
568
|
+
/* @__PURE__ */ jsx("code", { children: "disabled" }),
|
|
569
|
+
", which would drop focus to the page). When Try again goes because the upload has started again, focus moves to the chip. If you remove the chip itself, place focus yourself: on the next row, or on the zone that takes its place."
|
|
570
|
+
] }),
|
|
571
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
572
|
+
"The remove button is named after the file: \"Remove price-list-autumn.csv\". All the sentences are",
|
|
573
|
+
" ",
|
|
574
|
+
/* @__PURE__ */ jsx("code", { children: "labels" }),
|
|
575
|
+
"."
|
|
576
|
+
] }),
|
|
577
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "autoFocus" }), " moves focus to the chip when it appears, for the chip that takes a Dropzone's place. It does so only when nothing else holds focus, so a file that arrives while the person types elsewhere does not take their place, and a chip drawn with the page must not set it. The chip is focusable but never a tab stop, so the next Tab goes to its first button."] }),
|
|
578
|
+
"Under reduced motion the chip appears without its small rise, and the spinner breathes instead of orbiting."
|
|
579
|
+
] })
|
|
580
|
+
}),
|
|
581
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
582
|
+
id: "props",
|
|
583
|
+
title: "Props",
|
|
584
|
+
children: [
|
|
585
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
586
|
+
title: "FileChip",
|
|
587
|
+
rows: [
|
|
588
|
+
{
|
|
589
|
+
name: "name",
|
|
590
|
+
type: "string",
|
|
591
|
+
required: true,
|
|
592
|
+
description: "The name of the file. Long names are cut with an ellipsis and read in full on hover."
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
name: "size",
|
|
596
|
+
type: "number | string",
|
|
597
|
+
description: "A byte count (formatted as \"51.2 KB\") or a size already in words. Left out when unknown."
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
name: "variant",
|
|
601
|
+
type: "'card' | 'row' | 'pill'",
|
|
602
|
+
default: "'card'",
|
|
603
|
+
description: "The chosen-file card of an import, one line of a list of attachments, or a compact attachment in a composer."
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
name: "preview",
|
|
607
|
+
type: "string",
|
|
608
|
+
description: "Pill only: a picture of the file, drawn 28px square in the glyph’s place and kept in every status."
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
name: "status",
|
|
612
|
+
type: "'ready' | 'uploading' | 'done' | 'error'",
|
|
613
|
+
default: "'ready'",
|
|
614
|
+
description: "A spinner and progress, a green check, or a red warning with the reason."
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
name: "progress",
|
|
618
|
+
type: "number",
|
|
619
|
+
description: "How far an upload has got, 0 to 100. Leave it out while that is not known."
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
name: "error",
|
|
623
|
+
type: "ReactNode",
|
|
624
|
+
description: "Why an upload failed, in a sentence. Announced when it appears."
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
name: "icon",
|
|
628
|
+
type: "ReactNode",
|
|
629
|
+
description: "An icon for the type of file. Taken over by a spinner, check or warning when the status is not ready, except in a pill, which keeps it."
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
name: "badges",
|
|
633
|
+
type: "ReactNode",
|
|
634
|
+
description: "Badges after the name in a row."
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
name: "meta",
|
|
638
|
+
type: "ReactNode",
|
|
639
|
+
description: "A quiet line under the name."
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: "actions",
|
|
643
|
+
type: "ReactNode",
|
|
644
|
+
description: "Your own controls, before the built-in ones."
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
name: "onReplace",
|
|
648
|
+
type: "(file: File) => void",
|
|
649
|
+
description: "Adds a Replace button that opens the file chooser and hands the chosen file here."
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
name: "accept, maxSize, validate",
|
|
653
|
+
type: "as Dropzone",
|
|
654
|
+
description: "The rules the Replace chooser holds the new file to."
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
name: "onReject",
|
|
658
|
+
type: "(rejections: FileRejection[]) => void",
|
|
659
|
+
description: "A file Replace refused, with its reason. Without it the chip says the refusal itself, in place of the size, until the next choice."
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
name: "onRetry",
|
|
663
|
+
type: "() => void",
|
|
664
|
+
description: "Adds a Try again button to a failed upload."
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
name: "onRemove",
|
|
668
|
+
type: "() => void",
|
|
669
|
+
description: "Adds a remove button. While uploading it cancels."
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
name: "disabled",
|
|
673
|
+
type: "boolean",
|
|
674
|
+
default: "false",
|
|
675
|
+
description: "Switches off the built-in buttons. They stay focusable, aria-disabled."
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
name: "animateIn",
|
|
679
|
+
type: "boolean",
|
|
680
|
+
description: "Settle in from 6px below as it appears. Defaults to true for a card and false for a row."
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
name: "autoFocus",
|
|
684
|
+
type: "boolean",
|
|
685
|
+
description: "Moves focus to the chip when it appears, if nothing else holds focus. Set it on the chip that replaces a Dropzone, never on one drawn with the page."
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
name: "labels",
|
|
689
|
+
type: "Partial<FileChipLabels>",
|
|
690
|
+
description: "Reword the sentences the chip says: replace, remove(name), retry, uploading(progress), uploaded, failed, failedShort (a pill’s “Failed”), and the refusals a chooser can give (rejectType, rejectSize). fileChipLabels is the English set."
|
|
691
|
+
}
|
|
692
|
+
]
|
|
693
|
+
}),
|
|
694
|
+
/* @__PURE__ */ jsx("p", {
|
|
695
|
+
className: "doc-section__description",
|
|
696
|
+
children: "FileChip also accepts the native div attributes, except children and title."
|
|
697
|
+
}),
|
|
698
|
+
/* @__PURE__ */ jsx(DocTable, {
|
|
699
|
+
columns: [
|
|
700
|
+
"Status",
|
|
701
|
+
"Icon",
|
|
702
|
+
"Second line",
|
|
703
|
+
"Tint"
|
|
704
|
+
],
|
|
705
|
+
rows: [
|
|
706
|
+
[
|
|
707
|
+
/* @__PURE__ */ jsx("code", { children: "ready" }),
|
|
708
|
+
"Your icon, or a document",
|
|
709
|
+
"The size, then meta",
|
|
710
|
+
"None"
|
|
711
|
+
],
|
|
712
|
+
[
|
|
713
|
+
/* @__PURE__ */ jsx("code", { children: "uploading" }),
|
|
714
|
+
"A spinner",
|
|
715
|
+
"Uploading… and the percentage",
|
|
716
|
+
"The accent glyph"
|
|
717
|
+
],
|
|
718
|
+
[
|
|
719
|
+
/* @__PURE__ */ jsx("code", { children: "done" }),
|
|
720
|
+
"A filled check",
|
|
721
|
+
"The size, with \"Uploaded\" announced",
|
|
722
|
+
"Green"
|
|
723
|
+
],
|
|
724
|
+
[
|
|
725
|
+
/* @__PURE__ */ jsx("code", { children: "error" }),
|
|
726
|
+
"A filled warning",
|
|
727
|
+
"The error, or \"Upload failed\"",
|
|
728
|
+
"Red"
|
|
729
|
+
]
|
|
730
|
+
]
|
|
731
|
+
})
|
|
732
|
+
]
|
|
733
|
+
})
|
|
734
|
+
]
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
//#endregion
|
|
738
|
+
export { Page, Preview };
|