@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,1565 @@
|
|
|
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, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Avatar, Badge, Button, Card, CardHeader, EmptyState, IconButton, IconTile, Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, OrbitSpinner, RowList, RowListItem, RowListPanel, RowListSkeleton, Switch } from "@orbitcommerce/constellation";
|
|
7
|
+
import { CaretRightIcon, CopyIcon, DesktopIcon, DeviceMobileIcon, DotsThreeIcon, EyeIcon, KeyIcon, PencilSimpleIcon, PlugsIcon, ShieldCheckIcon, ShieldWarningIcon, ShoppingBagIcon, TrashIcon, WebhooksLogoIcon } from "@orbitcommerce/constellation/icons";
|
|
8
|
+
//#region src/pages/components/row-list.tsx
|
|
9
|
+
function Preview() {
|
|
10
|
+
return /* @__PURE__ */ jsxs(RowList, {
|
|
11
|
+
className: "row-list-preview",
|
|
12
|
+
size: "sm",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsx(RowListItem, {
|
|
15
|
+
leading: /* @__PURE__ */ jsx(IconTile, {
|
|
16
|
+
size: "sm",
|
|
17
|
+
children: /* @__PURE__ */ jsx(KeyIcon, {})
|
|
18
|
+
}),
|
|
19
|
+
title: "Orders sync",
|
|
20
|
+
badges: /* @__PURE__ */ jsx(Badge, {
|
|
21
|
+
size: "sm",
|
|
22
|
+
tone: "positive",
|
|
23
|
+
children: "Active"
|
|
24
|
+
}),
|
|
25
|
+
description: "Last used today"
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsx(RowListItem, {
|
|
28
|
+
leading: /* @__PURE__ */ jsx(IconTile, {
|
|
29
|
+
size: "sm",
|
|
30
|
+
children: /* @__PURE__ */ jsx(WebhooksLogoIcon, {})
|
|
31
|
+
}),
|
|
32
|
+
title: "Stock webhook",
|
|
33
|
+
description: "Last used 3 days ago"
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ jsx(RowListItem, {
|
|
36
|
+
leading: /* @__PURE__ */ jsx(IconTile, {
|
|
37
|
+
size: "sm",
|
|
38
|
+
children: /* @__PURE__ */ jsx(PlugsIcon, {})
|
|
39
|
+
}),
|
|
40
|
+
title: "Courier plugin",
|
|
41
|
+
dimmed: true,
|
|
42
|
+
description: "Switched off"
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** Ghost icon buttons for the end of a row. */
|
|
48
|
+
function Edit({ name }) {
|
|
49
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, {
|
|
50
|
+
label: `Edit ${name}`,
|
|
51
|
+
size: "sm",
|
|
52
|
+
children: /* @__PURE__ */ jsx(PencilSimpleIcon, {})
|
|
53
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
54
|
+
label: `Delete ${name}`,
|
|
55
|
+
size: "sm",
|
|
56
|
+
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
57
|
+
})] });
|
|
58
|
+
}
|
|
59
|
+
var REASONS = [
|
|
60
|
+
{
|
|
61
|
+
name: "Not as expected",
|
|
62
|
+
note: "Shown to customers on the return form",
|
|
63
|
+
active: true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "Damaged in transit",
|
|
67
|
+
note: "Asks the customer for a photo",
|
|
68
|
+
active: true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "Wrong size",
|
|
72
|
+
note: "Used for clothing only",
|
|
73
|
+
active: false
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
function ReturnReasons() {
|
|
77
|
+
const [active, setActive] = useState(() => REASONS.map((r) => r.active));
|
|
78
|
+
return /* @__PURE__ */ jsx(RowList, {
|
|
79
|
+
size: "lg",
|
|
80
|
+
"aria-label": "Return reasons",
|
|
81
|
+
children: REASONS.map((reason, i) => /* @__PURE__ */ jsx(RowListItem, {
|
|
82
|
+
title: reason.name,
|
|
83
|
+
badges: active[i] ? null : /* @__PURE__ */ jsx(Badge, {
|
|
84
|
+
size: "sm",
|
|
85
|
+
children: "Inactive"
|
|
86
|
+
}),
|
|
87
|
+
description: reason.note,
|
|
88
|
+
dimmed: !active[i],
|
|
89
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
90
|
+
size: "sm",
|
|
91
|
+
variant: "ghost",
|
|
92
|
+
onClick: () => setActive((was) => was.map((on, j) => j === i ? !on : on)),
|
|
93
|
+
children: active[i] ? "Disable" : "Enable"
|
|
94
|
+
}), /* @__PURE__ */ jsx(Edit, { name: reason.name })] })
|
|
95
|
+
}, reason.name))
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
var ROLES = [
|
|
99
|
+
{
|
|
100
|
+
name: "Owner",
|
|
101
|
+
note: "Everything, including billing and who owns the store",
|
|
102
|
+
count: 48,
|
|
103
|
+
system: true
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "Fulfilment",
|
|
107
|
+
note: "Picks, packs and ships orders",
|
|
108
|
+
count: 14,
|
|
109
|
+
system: false
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "Support",
|
|
113
|
+
note: "Replies to customers and issues refunds",
|
|
114
|
+
count: 19,
|
|
115
|
+
system: false
|
|
116
|
+
}
|
|
117
|
+
];
|
|
118
|
+
function Roles() {
|
|
119
|
+
const [opened, setOpened] = useState(null);
|
|
120
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(RowList, {
|
|
121
|
+
"aria-label": "Roles",
|
|
122
|
+
children: ROLES.map((role) => /* @__PURE__ */ jsx(RowListItem, {
|
|
123
|
+
leading: /* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(ShieldCheckIcon, {}) }),
|
|
124
|
+
title: role.name,
|
|
125
|
+
badges: role.system ? /* @__PURE__ */ jsx(Badge, {
|
|
126
|
+
size: "sm",
|
|
127
|
+
children: "System"
|
|
128
|
+
}) : void 0,
|
|
129
|
+
description: role.note,
|
|
130
|
+
meta: `${role.count} permissions`,
|
|
131
|
+
onClick: () => setOpened(role.name),
|
|
132
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, {
|
|
133
|
+
label: `Duplicate ${role.name}`,
|
|
134
|
+
size: "sm",
|
|
135
|
+
onClick: () => setOpened(`a copy of ${role.name}`),
|
|
136
|
+
children: /* @__PURE__ */ jsx(CopyIcon, {})
|
|
137
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
138
|
+
label: `Edit ${role.name}`,
|
|
139
|
+
size: "sm",
|
|
140
|
+
onClick: () => setOpened(`${role.name} for editing`),
|
|
141
|
+
children: /* @__PURE__ */ jsx(PencilSimpleIcon, {})
|
|
142
|
+
})] })
|
|
143
|
+
}, role.name))
|
|
144
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
145
|
+
className: "row-list-status",
|
|
146
|
+
"aria-live": "polite",
|
|
147
|
+
children: opened ? `Opened ${opened}.` : "Press a row, or one of its buttons."
|
|
148
|
+
})] });
|
|
149
|
+
}
|
|
150
|
+
var STORES = [
|
|
151
|
+
{
|
|
152
|
+
name: "Harbour Desk Co",
|
|
153
|
+
domain: "harbourdesk.example.com"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "Fernhill Interiors",
|
|
157
|
+
domain: "fernhill.example.com"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "Wren Stationery",
|
|
161
|
+
domain: "wren.example.com"
|
|
162
|
+
}
|
|
163
|
+
];
|
|
164
|
+
function StorePicker() {
|
|
165
|
+
const [opening, setOpening] = useState(null);
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
if (!opening) return;
|
|
168
|
+
const timer = window.setTimeout(() => setOpening(null), 1800);
|
|
169
|
+
return () => window.clearTimeout(timer);
|
|
170
|
+
}, [opening]);
|
|
171
|
+
return /* @__PURE__ */ jsx(RowList, {
|
|
172
|
+
"aria-label": "Your stores",
|
|
173
|
+
children: STORES.map((store) => {
|
|
174
|
+
const isOpening = opening === store.name;
|
|
175
|
+
return /* @__PURE__ */ jsx(RowListItem, {
|
|
176
|
+
leading: /* @__PURE__ */ jsx(Avatar, {
|
|
177
|
+
name: store.name,
|
|
178
|
+
shape: "square",
|
|
179
|
+
size: "lg"
|
|
180
|
+
}),
|
|
181
|
+
title: store.name,
|
|
182
|
+
description: store.domain,
|
|
183
|
+
selected: isOpening,
|
|
184
|
+
busy: isOpening,
|
|
185
|
+
disabled: opening !== null && !isOpening,
|
|
186
|
+
onClick: () => setOpening(store.name),
|
|
187
|
+
trailing: isOpening ? /* @__PURE__ */ jsx(OrbitSpinner, { size: 16 }) : /* @__PURE__ */ jsx(CaretRightIcon, {})
|
|
188
|
+
}, store.name);
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
var CONVERSATIONS = [
|
|
193
|
+
{
|
|
194
|
+
who: "sarah.whitfield@example.com",
|
|
195
|
+
last: "Is my order still due on Friday?",
|
|
196
|
+
time: "2 min",
|
|
197
|
+
needsReply: true
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
who: "Priya Shah",
|
|
201
|
+
last: "Thanks, that fixed it.",
|
|
202
|
+
time: "1 h",
|
|
203
|
+
needsReply: false
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
who: "imran.aziz@example.com",
|
|
207
|
+
last: "Can I change the delivery address?",
|
|
208
|
+
time: "Yesterday",
|
|
209
|
+
needsReply: false
|
|
210
|
+
}
|
|
211
|
+
];
|
|
212
|
+
function Conversations() {
|
|
213
|
+
const [current, setCurrent] = useState(0);
|
|
214
|
+
return /* @__PURE__ */ jsx(RowList, {
|
|
215
|
+
size: "md",
|
|
216
|
+
"aria-label": "Conversations",
|
|
217
|
+
children: CONVERSATIONS.map((chat, i) => /* @__PURE__ */ jsx(RowListItem, {
|
|
218
|
+
title: chat.who,
|
|
219
|
+
badges: chat.needsReply ? /* @__PURE__ */ jsx(Badge, {
|
|
220
|
+
size: "sm",
|
|
221
|
+
tone: "negative",
|
|
222
|
+
children: "Needs reply"
|
|
223
|
+
}) : void 0,
|
|
224
|
+
description: chat.last,
|
|
225
|
+
meta: chat.time,
|
|
226
|
+
selected: i === current,
|
|
227
|
+
onClick: () => setCurrent(i)
|
|
228
|
+
}, chat.who))
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
function Webhooks() {
|
|
232
|
+
const [on, setOn] = useState([true, false]);
|
|
233
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
234
|
+
padding: "md",
|
|
235
|
+
className: "row-list-card",
|
|
236
|
+
children: [/* @__PURE__ */ jsx(CardHeader, {
|
|
237
|
+
icon: /* @__PURE__ */ jsx(WebhooksLogoIcon, {}),
|
|
238
|
+
title: "Webhooks",
|
|
239
|
+
description: "Tell your own systems when something happens."
|
|
240
|
+
}), /* @__PURE__ */ jsx(RowList, {
|
|
241
|
+
variant: "inset",
|
|
242
|
+
"aria-label": "Webhooks",
|
|
243
|
+
children: [{
|
|
244
|
+
topic: "order.created",
|
|
245
|
+
url: "https://hooks.example.com/orders"
|
|
246
|
+
}, {
|
|
247
|
+
topic: "stock.low",
|
|
248
|
+
url: "https://hooks.example.com/stock"
|
|
249
|
+
}].map((hook, i) => /* @__PURE__ */ jsx(RowListItem, {
|
|
250
|
+
title: hook.topic,
|
|
251
|
+
description: hook.url,
|
|
252
|
+
dimmed: !on[i],
|
|
253
|
+
actions: /* @__PURE__ */ jsx(Switch, {
|
|
254
|
+
size: "sm",
|
|
255
|
+
"aria-label": `${hook.topic} is active`,
|
|
256
|
+
checked: on[i],
|
|
257
|
+
onCheckedChange: (next) => setOn((was) => was.map((value, j) => j === i ? next : value))
|
|
258
|
+
})
|
|
259
|
+
}, hook.topic))
|
|
260
|
+
})]
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
function Returns() {
|
|
264
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
265
|
+
className: "row-list-record",
|
|
266
|
+
children: [/* @__PURE__ */ jsx("h4", {
|
|
267
|
+
className: "row-list-record__title",
|
|
268
|
+
children: "Returns"
|
|
269
|
+
}), /* @__PURE__ */ jsx(RowList, {
|
|
270
|
+
variant: "bleed",
|
|
271
|
+
"aria-label": "Returns on this order",
|
|
272
|
+
children: [{
|
|
273
|
+
number: "RET-1042",
|
|
274
|
+
note: "Refund · 2 items",
|
|
275
|
+
date: "12 Oct"
|
|
276
|
+
}, {
|
|
277
|
+
number: "RET-1039",
|
|
278
|
+
note: "Exchange · 1 item",
|
|
279
|
+
date: "9 Oct"
|
|
280
|
+
}].map((r) => /* @__PURE__ */ jsx(RowListItem, {
|
|
281
|
+
title: r.number,
|
|
282
|
+
description: r.note,
|
|
283
|
+
meta: r.date,
|
|
284
|
+
onClick: () => {},
|
|
285
|
+
trailing: /* @__PURE__ */ jsx(CaretRightIcon, {})
|
|
286
|
+
}, r.number))
|
|
287
|
+
})]
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
function RowActionsMenu() {
|
|
291
|
+
return /* @__PURE__ */ jsx(RowList, {
|
|
292
|
+
"aria-label": "API keys",
|
|
293
|
+
children: ["Orders sync", "Stock export"].map((name) => /* @__PURE__ */ jsx(RowListItem, {
|
|
294
|
+
leading: /* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(KeyIcon, {}) }),
|
|
295
|
+
title: name,
|
|
296
|
+
description: "Created 3 October, last used today",
|
|
297
|
+
actions: /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
|
|
298
|
+
asChild: true,
|
|
299
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
300
|
+
label: `More actions for ${name}`,
|
|
301
|
+
size: "sm",
|
|
302
|
+
children: /* @__PURE__ */ jsx(DotsThreeIcon, { weight: "bold" })
|
|
303
|
+
})
|
|
304
|
+
}), /* @__PURE__ */ jsxs(MenuContent, {
|
|
305
|
+
align: "end",
|
|
306
|
+
children: [
|
|
307
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
308
|
+
icon: /* @__PURE__ */ jsx(PencilSimpleIcon, {}),
|
|
309
|
+
children: "Rename"
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
312
|
+
icon: /* @__PURE__ */ jsx(CopyIcon, {}),
|
|
313
|
+
children: "Copy key prefix"
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
316
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
317
|
+
icon: /* @__PURE__ */ jsx(TrashIcon, {}),
|
|
318
|
+
tone: "critical",
|
|
319
|
+
children: "Revoke key"
|
|
320
|
+
})
|
|
321
|
+
]
|
|
322
|
+
})] })
|
|
323
|
+
}, name))
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
/** A switched-off row that still opens, between an active one and a disabled one. Press the figures to see it open. */
|
|
327
|
+
function SwitchedOff() {
|
|
328
|
+
const [last, setLast] = useState(null);
|
|
329
|
+
const tile = /* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(ShieldCheckIcon, {}) });
|
|
330
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(RowList, {
|
|
331
|
+
"aria-label": "Roles, one of them switched off",
|
|
332
|
+
children: [
|
|
333
|
+
/* @__PURE__ */ jsx(RowListItem, {
|
|
334
|
+
leading: tile,
|
|
335
|
+
title: "Fulfilment",
|
|
336
|
+
badges: /* @__PURE__ */ jsx(Badge, {
|
|
337
|
+
size: "sm",
|
|
338
|
+
tone: "positive",
|
|
339
|
+
children: "Active"
|
|
340
|
+
}),
|
|
341
|
+
description: "Picks, packs and ships orders",
|
|
342
|
+
meta: "14 permissions",
|
|
343
|
+
onClick: () => setLast("Opened Fulfilment.")
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ jsx(RowListItem, {
|
|
346
|
+
leading: tile,
|
|
347
|
+
title: "Seasonal packer",
|
|
348
|
+
badges: /* @__PURE__ */ jsx(Badge, {
|
|
349
|
+
size: "sm",
|
|
350
|
+
children: "Inactive"
|
|
351
|
+
}),
|
|
352
|
+
description: "Switched off until November, but it still opens",
|
|
353
|
+
meta: "6 permissions",
|
|
354
|
+
dimmed: true,
|
|
355
|
+
onClick: () => setLast("Opened Seasonal packer."),
|
|
356
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
357
|
+
size: "sm",
|
|
358
|
+
variant: "ghost",
|
|
359
|
+
onClick: () => setLast("Enabled Seasonal packer."),
|
|
360
|
+
children: "Enable"
|
|
361
|
+
})
|
|
362
|
+
}),
|
|
363
|
+
/* @__PURE__ */ jsx(RowListItem, {
|
|
364
|
+
leading: tile,
|
|
365
|
+
title: "Legacy import",
|
|
366
|
+
description: "Disabled: it cannot be opened.",
|
|
367
|
+
meta: "2 permissions",
|
|
368
|
+
disabled: true,
|
|
369
|
+
onClick: () => setLast("Opened Legacy import.")
|
|
370
|
+
})
|
|
371
|
+
]
|
|
372
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
373
|
+
className: "row-list-status",
|
|
374
|
+
"aria-live": "polite",
|
|
375
|
+
children: last ?? "Press the Seasonal packer row, its figure included, then Enable."
|
|
376
|
+
})] });
|
|
377
|
+
}
|
|
378
|
+
/** Descriptions that wrap, with the mark and the actions kept at the top of the row. */
|
|
379
|
+
function LongText() {
|
|
380
|
+
return /* @__PURE__ */ jsxs(RowList, {
|
|
381
|
+
align: "start",
|
|
382
|
+
"aria-label": "Policies",
|
|
383
|
+
children: [/* @__PURE__ */ jsx(RowListItem, {
|
|
384
|
+
leading: /* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(ShieldCheckIcon, {}) }),
|
|
385
|
+
title: "Returns policy",
|
|
386
|
+
description: "Customers can return most items within 30 days of delivery, as long as they are unused and in their original packaging. Personalised items cannot be returned.",
|
|
387
|
+
wrap: true,
|
|
388
|
+
meta: "Updated 3 Oct",
|
|
389
|
+
onClick: () => {},
|
|
390
|
+
actions: /* @__PURE__ */ jsx(Edit, { name: "Returns policy" })
|
|
391
|
+
}), /* @__PURE__ */ jsx(RowListItem, {
|
|
392
|
+
leading: /* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(ShieldCheckIcon, {}) }),
|
|
393
|
+
title: "Shipping policy",
|
|
394
|
+
description: "Orders placed before 2pm leave the warehouse the same day. We ship to the UK and Ireland, and tracked delivery is included on every order.",
|
|
395
|
+
wrap: true,
|
|
396
|
+
meta: "Updated 9 Oct",
|
|
397
|
+
onClick: () => {},
|
|
398
|
+
actions: /* @__PURE__ */ jsx(Edit, { name: "Shipping policy" })
|
|
399
|
+
})]
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
/** The frame alone, no hairline between rows. */
|
|
403
|
+
function PlainRows() {
|
|
404
|
+
return /* @__PURE__ */ jsx(RowList, {
|
|
405
|
+
dividers: false,
|
|
406
|
+
"aria-label": "Delivery services",
|
|
407
|
+
children: [
|
|
408
|
+
"Royal Mail Tracked 48",
|
|
409
|
+
"Royal Mail Special Delivery",
|
|
410
|
+
"DPD Next Day"
|
|
411
|
+
].map((name) => /* @__PURE__ */ jsx(RowListItem, {
|
|
412
|
+
title: name,
|
|
413
|
+
description: "Zone 1, 2 and 3",
|
|
414
|
+
actions: /* @__PURE__ */ jsx(Edit, { name })
|
|
415
|
+
}, name))
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
function Sample({ variant, size }) {
|
|
419
|
+
return /* @__PURE__ */ jsxs(RowList, {
|
|
420
|
+
variant,
|
|
421
|
+
size,
|
|
422
|
+
"aria-label": `${size ?? "md"} rows`,
|
|
423
|
+
children: [/* @__PURE__ */ jsx(RowListItem, {
|
|
424
|
+
title: "Orders sync",
|
|
425
|
+
description: "Last used today",
|
|
426
|
+
actions: /* @__PURE__ */ jsx(IconButton, {
|
|
427
|
+
label: "Edit",
|
|
428
|
+
size: "sm",
|
|
429
|
+
children: /* @__PURE__ */ jsx(PencilSimpleIcon, {})
|
|
430
|
+
})
|
|
431
|
+
}), /* @__PURE__ */ jsx(RowListItem, {
|
|
432
|
+
title: "Stock export",
|
|
433
|
+
description: "Last used 3 days ago",
|
|
434
|
+
actions: /* @__PURE__ */ jsx(IconButton, {
|
|
435
|
+
label: "Edit",
|
|
436
|
+
size: "sm",
|
|
437
|
+
children: /* @__PURE__ */ jsx(PencilSimpleIcon, {})
|
|
438
|
+
})
|
|
439
|
+
})]
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
/** One of everything, for the two themes side by side. */
|
|
443
|
+
function Everything() {
|
|
444
|
+
return /* @__PURE__ */ jsxs(RowList, {
|
|
445
|
+
"aria-label": "Everything",
|
|
446
|
+
children: [
|
|
447
|
+
/* @__PURE__ */ jsx(RowListItem, {
|
|
448
|
+
leading: /* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(ShieldCheckIcon, {}) }),
|
|
449
|
+
title: "Owner",
|
|
450
|
+
badges: /* @__PURE__ */ jsx(Badge, {
|
|
451
|
+
size: "sm",
|
|
452
|
+
children: "System"
|
|
453
|
+
}),
|
|
454
|
+
description: "Everything, including billing",
|
|
455
|
+
onClick: () => {},
|
|
456
|
+
actions: /* @__PURE__ */ jsx(IconButton, {
|
|
457
|
+
label: "Duplicate Owner",
|
|
458
|
+
size: "sm",
|
|
459
|
+
children: /* @__PURE__ */ jsx(CopyIcon, {})
|
|
460
|
+
})
|
|
461
|
+
}),
|
|
462
|
+
/* @__PURE__ */ jsx(RowListItem, {
|
|
463
|
+
leading: /* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(ShieldCheckIcon, {}) }),
|
|
464
|
+
title: "Fulfilment",
|
|
465
|
+
description: "Picks, packs and ships orders",
|
|
466
|
+
selected: true,
|
|
467
|
+
onClick: () => {}
|
|
468
|
+
}),
|
|
469
|
+
/* @__PURE__ */ jsx(RowListItem, {
|
|
470
|
+
leading: /* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(ShieldCheckIcon, {}) }),
|
|
471
|
+
title: "Seasonal packer",
|
|
472
|
+
description: "Switched off until November",
|
|
473
|
+
dimmed: true,
|
|
474
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
475
|
+
size: "sm",
|
|
476
|
+
variant: "ghost",
|
|
477
|
+
children: "Enable"
|
|
478
|
+
})
|
|
479
|
+
})
|
|
480
|
+
]
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
function Labelled({ children }) {
|
|
484
|
+
return /* @__PURE__ */ jsx("div", {
|
|
485
|
+
className: "row-list-labelled",
|
|
486
|
+
children
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
/** The plugin list with a release waiting for consent, and an invitation whose decline asks first. */
|
|
490
|
+
function RowStrips() {
|
|
491
|
+
const [later, setLater] = useState(false);
|
|
492
|
+
const [asking, setAsking] = useState(false);
|
|
493
|
+
const [declining, setDeclining] = useState(false);
|
|
494
|
+
const [declined, setDeclined] = useState(false);
|
|
495
|
+
useEffect(() => {
|
|
496
|
+
if (!declining) return void 0;
|
|
497
|
+
const timer = window.setTimeout(() => {
|
|
498
|
+
setDeclining(false);
|
|
499
|
+
setAsking(false);
|
|
500
|
+
setDeclined(true);
|
|
501
|
+
}, 1200);
|
|
502
|
+
return () => window.clearTimeout(timer);
|
|
503
|
+
}, [declining]);
|
|
504
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
505
|
+
className: "row-list-stage row-list-strips",
|
|
506
|
+
children: [/* @__PURE__ */ jsxs(RowList, {
|
|
507
|
+
"aria-label": "Installed plugins",
|
|
508
|
+
children: [/* @__PURE__ */ jsx(RowListItem, {
|
|
509
|
+
leading: /* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(PlugsIcon, {}) }),
|
|
510
|
+
title: "Harbour Sync",
|
|
511
|
+
description: "Stock and orders with Harbour Desk Co",
|
|
512
|
+
href: "#strips",
|
|
513
|
+
trailing: /* @__PURE__ */ jsx(CaretRightIcon, {}),
|
|
514
|
+
notice: later ? void 0 : {
|
|
515
|
+
icon: /* @__PURE__ */ jsx(ShieldWarningIcon, {}),
|
|
516
|
+
message: "Version 2.4 wants to read your customers. It stays on 2.3 until you agree.",
|
|
517
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
518
|
+
size: "sm",
|
|
519
|
+
variant: "secondary",
|
|
520
|
+
children: "Review"
|
|
521
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
522
|
+
size: "sm",
|
|
523
|
+
variant: "ghost",
|
|
524
|
+
onClick: () => setLater(true),
|
|
525
|
+
children: "Later"
|
|
526
|
+
})] })
|
|
527
|
+
}
|
|
528
|
+
}), /* @__PURE__ */ jsx(RowListItem, {
|
|
529
|
+
leading: /* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(WebhooksLogoIcon, {}) }),
|
|
530
|
+
title: "Order webhooks",
|
|
531
|
+
description: "3 endpoints",
|
|
532
|
+
href: "#strips",
|
|
533
|
+
trailing: /* @__PURE__ */ jsx(CaretRightIcon, {})
|
|
534
|
+
})]
|
|
535
|
+
}), /* @__PURE__ */ jsx(RowList, {
|
|
536
|
+
"aria-label": "Invitations",
|
|
537
|
+
children: /* @__PURE__ */ jsx(RowListItem, {
|
|
538
|
+
leading: /* @__PURE__ */ jsx(Avatar, { name: "Fernhill Workspace Ltd" }),
|
|
539
|
+
title: "Fernhill Workspace Ltd",
|
|
540
|
+
description: declined ? "Declined" : "Callum Reid invited you as Staff. Expires in 6 days.",
|
|
541
|
+
dimmed: declined,
|
|
542
|
+
actions: declined ? null : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
543
|
+
size: "sm",
|
|
544
|
+
variant: "secondary",
|
|
545
|
+
onClick: () => setAsking(true),
|
|
546
|
+
children: "Decline"
|
|
547
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
548
|
+
size: "sm",
|
|
549
|
+
variant: "primary",
|
|
550
|
+
children: "Accept"
|
|
551
|
+
})] }),
|
|
552
|
+
confirm: asking ? {
|
|
553
|
+
message: "Decline this invitation? Fernhill will need to invite you again.",
|
|
554
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
555
|
+
size: "sm",
|
|
556
|
+
variant: "secondary",
|
|
557
|
+
onClick: () => setAsking(false),
|
|
558
|
+
children: "Keep"
|
|
559
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
560
|
+
size: "sm",
|
|
561
|
+
variant: "critical",
|
|
562
|
+
loading: declining,
|
|
563
|
+
onClick: () => setDeclining(true),
|
|
564
|
+
children: "Decline"
|
|
565
|
+
})] })
|
|
566
|
+
} : void 0
|
|
567
|
+
})
|
|
568
|
+
})]
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
/** A live feed of visitors, in a panel that scrolls between its head and foot. */
|
|
572
|
+
var VISITS = [
|
|
573
|
+
{
|
|
574
|
+
id: "a",
|
|
575
|
+
place: "Leeds, GB",
|
|
576
|
+
device: "desktop",
|
|
577
|
+
fresh: true,
|
|
578
|
+
what: "Bought the Arden ergonomic chair",
|
|
579
|
+
when: "Just now",
|
|
580
|
+
amount: "£289.00"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
id: "b",
|
|
584
|
+
place: "Bristol, GB",
|
|
585
|
+
device: "mobile",
|
|
586
|
+
fresh: false,
|
|
587
|
+
what: "Viewed Oak veneer desk, 1600mm",
|
|
588
|
+
when: "2 minutes ago"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
id: "c",
|
|
592
|
+
place: "Glasgow, GB",
|
|
593
|
+
device: "desktop",
|
|
594
|
+
fresh: true,
|
|
595
|
+
what: "Added a three drawer pedestal to the basket",
|
|
596
|
+
when: "4 minutes ago"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
id: "d",
|
|
600
|
+
place: "Cardiff, GB",
|
|
601
|
+
device: "mobile",
|
|
602
|
+
fresh: false,
|
|
603
|
+
what: "Viewed Task chairs",
|
|
604
|
+
when: "6 minutes ago"
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
id: "e",
|
|
608
|
+
place: "Belfast, GB",
|
|
609
|
+
device: "desktop",
|
|
610
|
+
fresh: false,
|
|
611
|
+
what: "Viewed Height adjustable desks",
|
|
612
|
+
when: "9 minutes ago"
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
id: "f",
|
|
616
|
+
place: "Norwich, GB",
|
|
617
|
+
device: "mobile",
|
|
618
|
+
fresh: false,
|
|
619
|
+
what: "Bought a monitor arm",
|
|
620
|
+
when: "12 minutes ago",
|
|
621
|
+
amount: "£64.00"
|
|
622
|
+
}
|
|
623
|
+
];
|
|
624
|
+
function LiveFeed() {
|
|
625
|
+
const [arrivals, setArrivals] = useState(0);
|
|
626
|
+
const visits = [...Array.from({ length: arrivals }, (_, index) => ({
|
|
627
|
+
id: `new-${arrivals - index}`,
|
|
628
|
+
place: [
|
|
629
|
+
"York, GB",
|
|
630
|
+
"Bath, GB",
|
|
631
|
+
"Derby, GB"
|
|
632
|
+
][(arrivals - index) % 3],
|
|
633
|
+
device: "desktop",
|
|
634
|
+
fresh: true,
|
|
635
|
+
what: "Viewed Arden ergonomic chair",
|
|
636
|
+
when: "Just now",
|
|
637
|
+
amount: void 0
|
|
638
|
+
})), ...VISITS];
|
|
639
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
640
|
+
className: "row-list-live-feed",
|
|
641
|
+
children: [/* @__PURE__ */ jsx(RowListPanel, {
|
|
642
|
+
title: "Live activity",
|
|
643
|
+
status: /* @__PURE__ */ jsx("span", {
|
|
644
|
+
className: "row-list-live",
|
|
645
|
+
"aria-hidden": "true"
|
|
646
|
+
}),
|
|
647
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
648
|
+
size: "xs",
|
|
649
|
+
variant: "ghost",
|
|
650
|
+
children: "All"
|
|
651
|
+
}),
|
|
652
|
+
footer: `Showing ${visits.length} of ${42 + arrivals}`,
|
|
653
|
+
maxHeight: 300,
|
|
654
|
+
children: /* @__PURE__ */ jsx(RowList, {
|
|
655
|
+
variant: "inset",
|
|
656
|
+
align: "start",
|
|
657
|
+
children: visits.map((visit) => /* @__PURE__ */ jsx(RowListItem, {
|
|
658
|
+
leading: /* @__PURE__ */ jsx(IconTile, {
|
|
659
|
+
shape: "circle",
|
|
660
|
+
size: "sm",
|
|
661
|
+
children: visit.amount ? /* @__PURE__ */ jsx(ShoppingBagIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {})
|
|
662
|
+
}),
|
|
663
|
+
overline: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
664
|
+
visit.device === "mobile" ? /* @__PURE__ */ jsx(DeviceMobileIcon, { "aria-label": "Phone" }) : /* @__PURE__ */ jsx(DesktopIcon, { "aria-label": "Computer" }),
|
|
665
|
+
visit.fresh ? /* @__PURE__ */ jsx(Badge, {
|
|
666
|
+
size: "sm",
|
|
667
|
+
tone: "accent",
|
|
668
|
+
children: "New visitor"
|
|
669
|
+
}) : null,
|
|
670
|
+
/* @__PURE__ */ jsx("span", { children: visit.when })
|
|
671
|
+
] }),
|
|
672
|
+
title: visit.place,
|
|
673
|
+
description: visit.what,
|
|
674
|
+
meta: visit.amount
|
|
675
|
+
}, visit.id))
|
|
676
|
+
})
|
|
677
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
678
|
+
size: "sm",
|
|
679
|
+
variant: "secondary",
|
|
680
|
+
onClick: () => setArrivals(arrivals + 1),
|
|
681
|
+
children: "A visitor arrives"
|
|
682
|
+
})]
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
/** Changelog entries: the category, New and when over the title, a two-line excerpt, the whole entry a way in. */
|
|
686
|
+
function Changelog() {
|
|
687
|
+
return /* @__PURE__ */ jsxs(RowList, {
|
|
688
|
+
"aria-label": "What's new",
|
|
689
|
+
align: "start",
|
|
690
|
+
children: [/* @__PURE__ */ jsx(RowListItem, {
|
|
691
|
+
href: "#feeds",
|
|
692
|
+
overline: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
693
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
694
|
+
size: "sm",
|
|
695
|
+
tone: "info",
|
|
696
|
+
children: "Feature"
|
|
697
|
+
}),
|
|
698
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
699
|
+
size: "sm",
|
|
700
|
+
tone: "accent",
|
|
701
|
+
children: "New"
|
|
702
|
+
}),
|
|
703
|
+
/* @__PURE__ */ jsx("span", { children: "2 days ago" })
|
|
704
|
+
] }),
|
|
705
|
+
title: "Bulk price editing",
|
|
706
|
+
description: "Change the price of many products at once from the product list: pick them, choose Edit prices, and set a new price, a percentage or an amount off. Every change is kept in the product's history, so you can see who changed what.",
|
|
707
|
+
descriptionLines: 2,
|
|
708
|
+
trailing: /* @__PURE__ */ jsx(CaretRightIcon, {})
|
|
709
|
+
}), /* @__PURE__ */ jsx(RowListItem, {
|
|
710
|
+
href: "#feeds",
|
|
711
|
+
overline: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Badge, {
|
|
712
|
+
size: "sm",
|
|
713
|
+
children: "Improvement"
|
|
714
|
+
}), /* @__PURE__ */ jsx("span", { children: "1 week ago" })] }),
|
|
715
|
+
title: "Faster order search",
|
|
716
|
+
description: "Search finds orders by the customer's postcode and by the last four digits of the card used to pay, and shows results as you type.",
|
|
717
|
+
descriptionLines: 2,
|
|
718
|
+
trailing: /* @__PURE__ */ jsx(CaretRightIcon, {})
|
|
719
|
+
})]
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
function Page() {
|
|
723
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
724
|
+
title: "Row list",
|
|
725
|
+
status: "new",
|
|
726
|
+
importNames: [
|
|
727
|
+
"RowList",
|
|
728
|
+
"RowListItem",
|
|
729
|
+
"RowListSkeleton"
|
|
730
|
+
],
|
|
731
|
+
lead: "One card of rows, each with a leading mark, a title with badges, a quiet line of detail and its own actions. Reach for it for the lists that are not tables: API keys, webhooks, roles, plugins, stores, conversations. The card is the container; the rows part on a hairline.",
|
|
732
|
+
children: [
|
|
733
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
734
|
+
id: "settings-rows",
|
|
735
|
+
title: "Settings rows",
|
|
736
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
737
|
+
"A stack of small cards becomes one card of rows. Each row has a title, a quiet line under it and its actions at the end. ",
|
|
738
|
+
/* @__PURE__ */ jsx("code", { children: "size=\"lg\"" }),
|
|
739
|
+
" gives the 16px rows the settings pages use. A row switched off says so in a badge, quietens its title and fades its detail, its badges and its mark, never its buttons, so the way back on stays plain to see."
|
|
740
|
+
] }),
|
|
741
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
742
|
+
align: "fill",
|
|
743
|
+
code: `
|
|
744
|
+
<RowList size="lg" aria-label="Return reasons">
|
|
745
|
+
<RowListItem
|
|
746
|
+
title="Not as expected"
|
|
747
|
+
description="Shown to customers on the return form"
|
|
748
|
+
actions={
|
|
749
|
+
<>
|
|
750
|
+
<Button size="sm" variant="ghost">Disable</Button>
|
|
751
|
+
<IconButton label="Edit Not as expected" size="sm"><PencilSimpleIcon /></IconButton>
|
|
752
|
+
<IconButton label="Delete Not as expected" size="sm"><TrashIcon /></IconButton>
|
|
753
|
+
</>
|
|
754
|
+
}
|
|
755
|
+
/>
|
|
756
|
+
…
|
|
757
|
+
<RowListItem title="Wrong size" badges={<Badge size="sm">Inactive</Badge>} dimmed … />
|
|
758
|
+
</RowList>`,
|
|
759
|
+
children: /* @__PURE__ */ jsx(ReturnReasons, {})
|
|
760
|
+
})
|
|
761
|
+
}),
|
|
762
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
763
|
+
id: "open",
|
|
764
|
+
title: "Rows that open something",
|
|
765
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
766
|
+
"Give a row ",
|
|
767
|
+
/* @__PURE__ */ jsx("code", { children: "onClick" }),
|
|
768
|
+
" or ",
|
|
769
|
+
/* @__PURE__ */ jsx("code", { children: "href" }),
|
|
770
|
+
", or pass a router link with ",
|
|
771
|
+
/* @__PURE__ */ jsx("code", { children: "asChild" }),
|
|
772
|
+
", and the title becomes one real link or button, stretched over the whole row. The row tints on hover and shows a focus ring round the row. Pressing the row, its badge, its mark, its figures or the empty space opens it. The actions sit above that link, never inside it, so pressing one does its own thing and nothing nests."
|
|
773
|
+
] }),
|
|
774
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
775
|
+
align: "fill",
|
|
776
|
+
code: `
|
|
777
|
+
<RowList aria-label="Roles">
|
|
778
|
+
<RowListItem
|
|
779
|
+
leading={<IconTile><ShieldCheckIcon /></IconTile>}
|
|
780
|
+
title="Owner"
|
|
781
|
+
badges={<Badge size="sm">System</Badge>}
|
|
782
|
+
description="Everything, including billing and who owns the store"
|
|
783
|
+
meta="48 permissions"
|
|
784
|
+
onClick={() => open('Owner')}
|
|
785
|
+
actions={
|
|
786
|
+
<>
|
|
787
|
+
<IconButton label="Duplicate Owner" size="sm"><CopyIcon /></IconButton>
|
|
788
|
+
<IconButton label="Edit Owner" size="sm"><PencilSimpleIcon /></IconButton>
|
|
789
|
+
</>
|
|
790
|
+
}
|
|
791
|
+
/>
|
|
792
|
+
…
|
|
793
|
+
</RowList>`,
|
|
794
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
795
|
+
className: "row-list-stage",
|
|
796
|
+
children: /* @__PURE__ */ jsx(Roles, {})
|
|
797
|
+
})
|
|
798
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
799
|
+
title: "Links, router links and new tabs",
|
|
800
|
+
children: /* @__PURE__ */ jsx(DocTable, {
|
|
801
|
+
columns: ["You give", "The title becomes"],
|
|
802
|
+
rows: [
|
|
803
|
+
[/* @__PURE__ */ jsx("code", { children: "onClick" }), /* @__PURE__ */ jsxs(Fragment$1, { children: ["a ", /* @__PURE__ */ jsx("code", { children: "button" })] })],
|
|
804
|
+
[/* @__PURE__ */ jsx("code", { children: "href" }), /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
805
|
+
"an ",
|
|
806
|
+
/* @__PURE__ */ jsx("code", { children: "a" }),
|
|
807
|
+
"; with ",
|
|
808
|
+
/* @__PURE__ */ jsx("code", { children: "target=\"_blank\"" }),
|
|
809
|
+
" it also sets ",
|
|
810
|
+
/* @__PURE__ */ jsx("code", { children: "rel" })
|
|
811
|
+
] })],
|
|
812
|
+
[/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "asChild" }), " and a child element"] }), /* @__PURE__ */ jsxs(Fragment$1, { children: ["that element, filled with the title: ", /* @__PURE__ */ jsx("code", { children: "<RowListItem asChild title=\"Fernhill\"><Link to=\"/companies/1\" /></RowListItem>" })] })],
|
|
813
|
+
["none of these", "plain text: a static row, with no hover and no link"]
|
|
814
|
+
]
|
|
815
|
+
})
|
|
816
|
+
})]
|
|
817
|
+
}),
|
|
818
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
819
|
+
id: "selected",
|
|
820
|
+
title: "Selected and active",
|
|
821
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
822
|
+
/* @__PURE__ */ jsx("code", { children: "selected" }),
|
|
823
|
+
" marks the row in use, such as the open conversation, with a pale teal wash and a line of light on its edge, the same treatment a selected table row takes. On a row that opens something it also sets",
|
|
824
|
+
" ",
|
|
825
|
+
/* @__PURE__ */ jsx("code", { children: "aria-current" }),
|
|
826
|
+
". A table row and a list row look alike when chosen, so a page with both reads as one."
|
|
827
|
+
] }),
|
|
828
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
829
|
+
align: "fill",
|
|
830
|
+
code: `
|
|
831
|
+
<RowList aria-label="Conversations">
|
|
832
|
+
<RowListItem
|
|
833
|
+
title="sarah.whitfield@example.com"
|
|
834
|
+
badges={<Badge size="sm" tone="negative">Needs reply</Badge>}
|
|
835
|
+
description="Is my order still due on Friday?"
|
|
836
|
+
meta="2 min"
|
|
837
|
+
selected={current === 0}
|
|
838
|
+
onClick={() => setCurrent(0)}
|
|
839
|
+
/>
|
|
840
|
+
…
|
|
841
|
+
</RowList>`,
|
|
842
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
843
|
+
className: "row-list-stage",
|
|
844
|
+
children: /* @__PURE__ */ jsx(Conversations, {})
|
|
845
|
+
})
|
|
846
|
+
})
|
|
847
|
+
}),
|
|
848
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
849
|
+
id: "dimmed",
|
|
850
|
+
title: "Switched off, and out of reach",
|
|
851
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
852
|
+
/* @__PURE__ */ jsx("code", { children: "dimmed" }),
|
|
853
|
+
" is a row that is switched off or inactive: its detail, badges and mark fade to half and its title turns quiet, its actions stay at full strength so the way back on is plain, and a row that opens something still opens from anywhere on it, its figures included. Say it in words too, with a badge: the fade alone is not a message.",
|
|
854
|
+
" ",
|
|
855
|
+
/* @__PURE__ */ jsx("code", { children: "disabled" }),
|
|
856
|
+
" fades the same parts and the title to half, stops the hover and cannot be opened."
|
|
857
|
+
] }),
|
|
858
|
+
children: [
|
|
859
|
+
/* @__PURE__ */ jsx(Example, {
|
|
860
|
+
align: "fill",
|
|
861
|
+
code: `
|
|
862
|
+
<RowList aria-label="Roles">
|
|
863
|
+
<RowListItem title="Fulfilment" badges={<Badge size="sm" tone="positive">Active</Badge>} meta="14 permissions" onClick={open} />
|
|
864
|
+
<RowListItem
|
|
865
|
+
title="Seasonal packer"
|
|
866
|
+
badges={<Badge size="sm">Inactive</Badge>}
|
|
867
|
+
description="Switched off until November"
|
|
868
|
+
meta="6 permissions"
|
|
869
|
+
dimmed
|
|
870
|
+
onClick={open}
|
|
871
|
+
actions={<Button size="sm" variant="ghost">Enable</Button>}
|
|
872
|
+
/>
|
|
873
|
+
<RowListItem title="Legacy import" meta="2 permissions" disabled onClick={open} />
|
|
874
|
+
</RowList>`,
|
|
875
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
876
|
+
className: "row-list-stage",
|
|
877
|
+
children: /* @__PURE__ */ jsx(SwitchedOff, {})
|
|
878
|
+
})
|
|
879
|
+
}),
|
|
880
|
+
/* @__PURE__ */ jsx(Note, {
|
|
881
|
+
title: "Why only the words fade",
|
|
882
|
+
children: "The row's link is its title, stretched over the row. Fading that link, or the heading that holds it, would draw it in a layer of its own: the figures would sit over it, so pressing them opened nothing, and its focus ring would fade with it. The parts that hold no link fade instead, and the title through its colour, so the whole row still opens and the ring stays at full strength."
|
|
883
|
+
}),
|
|
884
|
+
/* @__PURE__ */ jsxs(Note, {
|
|
885
|
+
title: "For what is switched off, not for what matters less",
|
|
886
|
+
children: [
|
|
887
|
+
"A dimmed row still opens and its actions still work, so its title keeps to the 4.5:1 text contrast in",
|
|
888
|
+
" ",
|
|
889
|
+
/* @__PURE__ */ jsx("code", { children: "--o-fg-3" }),
|
|
890
|
+
", quiet but readable. Its detail at half strength is near 2.3:1 on white, as the vendor dashboard's row at half strength is, so use ",
|
|
891
|
+
/* @__PURE__ */ jsx("code", { children: "dimmed" }),
|
|
892
|
+
" for a row that is switched off, and say so in a badge; do not use it to quiet a row that is simply less important. A disabled row cannot be used, which text contrast exempts, and its title fades to half."
|
|
893
|
+
]
|
|
894
|
+
})
|
|
895
|
+
]
|
|
896
|
+
}),
|
|
897
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
898
|
+
id: "navigation",
|
|
899
|
+
title: "Navigation lists",
|
|
900
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
901
|
+
"A list of places to go: stores, companies, plugins. ",
|
|
902
|
+
/* @__PURE__ */ jsx("code", { children: "leading" }),
|
|
903
|
+
" takes an avatar or a logo,",
|
|
904
|
+
" ",
|
|
905
|
+
/* @__PURE__ */ jsx("code", { children: "trailing" }),
|
|
906
|
+
" a chevron that moves 2px on hover, and while one row opens something the others take",
|
|
907
|
+
" ",
|
|
908
|
+
/* @__PURE__ */ jsx("code", { children: "disabled" }),
|
|
909
|
+
" and it takes ",
|
|
910
|
+
/* @__PURE__ */ jsx("code", { children: "selected" }),
|
|
911
|
+
" and ",
|
|
912
|
+
/* @__PURE__ */ jsx("code", { children: "busy" }),
|
|
913
|
+
" with a spinner in place of its chevron. Press a store to see it. A short list of plain links, each an icon tile with a sentence and an arrow and no badges or buttons, is a ",
|
|
914
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
915
|
+
to: "/components/link-row",
|
|
916
|
+
children: "Link row"
|
|
917
|
+
}),
|
|
918
|
+
" list."
|
|
919
|
+
] }),
|
|
920
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
921
|
+
align: "fill",
|
|
922
|
+
code: `
|
|
923
|
+
<RowList aria-label="Your stores">
|
|
924
|
+
{stores.map((store) => {
|
|
925
|
+
const isOpening = opening === store.name
|
|
926
|
+
return (
|
|
927
|
+
<RowListItem
|
|
928
|
+
key={store.name}
|
|
929
|
+
leading={<Avatar name={store.name} shape="square" size="lg" />}
|
|
930
|
+
title={store.name}
|
|
931
|
+
description={store.domain}
|
|
932
|
+
selected={isOpening}
|
|
933
|
+
busy={isOpening}
|
|
934
|
+
disabled={opening !== null && !isOpening}
|
|
935
|
+
onClick={() => open(store)}
|
|
936
|
+
trailing={isOpening ? <OrbitSpinner size={16} /> : <CaretRightIcon />}
|
|
937
|
+
/>
|
|
938
|
+
)
|
|
939
|
+
})}
|
|
940
|
+
</RowList>`,
|
|
941
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
942
|
+
className: "row-list-stage",
|
|
943
|
+
children: /* @__PURE__ */ jsx(StorePicker, {})
|
|
944
|
+
})
|
|
945
|
+
})
|
|
946
|
+
}),
|
|
947
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
948
|
+
id: "actions",
|
|
949
|
+
title: "Row actions",
|
|
950
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
951
|
+
/* @__PURE__ */ jsx("code", { children: "actions" }),
|
|
952
|
+
" is a slot at the end of the row, and you fill it: a few kit",
|
|
953
|
+
" ",
|
|
954
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
955
|
+
to: "/components/icon-button",
|
|
956
|
+
children: "icon buttons"
|
|
957
|
+
}),
|
|
958
|
+
", a ",
|
|
959
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
960
|
+
to: "/components/switch",
|
|
961
|
+
children: "switch"
|
|
962
|
+
}),
|
|
963
|
+
", or one icon button that opens a ",
|
|
964
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
965
|
+
to: "/components/menu",
|
|
966
|
+
children: "menu"
|
|
967
|
+
}),
|
|
968
|
+
" when there are more than two. The list adds no menu of its own. Every icon-only action needs a ",
|
|
969
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
970
|
+
"; say which row it is for (\"Edit Owner\"), because a screen reader meets the buttons one after another."
|
|
971
|
+
] }),
|
|
972
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
973
|
+
align: "fill",
|
|
974
|
+
code: `
|
|
975
|
+
<RowListItem
|
|
976
|
+
title="Orders sync"
|
|
977
|
+
description="Created 3 October, last used today"
|
|
978
|
+
actions={
|
|
979
|
+
<Menu>
|
|
980
|
+
<MenuTrigger asChild>
|
|
981
|
+
<IconButton label="More actions for Orders sync" size="sm"><DotsThreeIcon weight="bold" /></IconButton>
|
|
982
|
+
</MenuTrigger>
|
|
983
|
+
<MenuContent align="end">
|
|
984
|
+
<MenuItem icon={<PencilSimpleIcon />}>Rename</MenuItem>
|
|
985
|
+
<MenuItem icon={<CopyIcon />}>Copy key prefix</MenuItem>
|
|
986
|
+
<MenuSeparator />
|
|
987
|
+
<MenuItem icon={<TrashIcon />} tone="critical">Revoke key</MenuItem>
|
|
988
|
+
</MenuContent>
|
|
989
|
+
</Menu>
|
|
990
|
+
}
|
|
991
|
+
/>`,
|
|
992
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
993
|
+
className: "row-list-stage",
|
|
994
|
+
children: /* @__PURE__ */ jsx(RowActionsMenu, {})
|
|
995
|
+
})
|
|
996
|
+
}), /* @__PURE__ */ jsx(Note, {
|
|
997
|
+
title: "Narrow rows and phones",
|
|
998
|
+
children: "A row never squeezes its words below 7rem: when the figures and the actions would, the actions move under the words and sit at the end of their own line. Below 640px the title and its badges wrap instead of being cut, the description keeps two lines, and the mark, the figures and the actions stay centred on the row."
|
|
999
|
+
})]
|
|
1000
|
+
}),
|
|
1001
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
1002
|
+
id: "strips",
|
|
1003
|
+
title: "Strips attached to a row",
|
|
1004
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1005
|
+
"A row can carry a strip inside its own item. ",
|
|
1006
|
+
/* @__PURE__ */ jsx("code", { children: "notice" }),
|
|
1007
|
+
" is a compact notice above the row (a plugin's new version waiting for consent), a wash in its tone with its own controls. ",
|
|
1008
|
+
/* @__PURE__ */ jsx("code", { children: "confirm" }),
|
|
1009
|
+
" is a question under the row that stands in for its actions while it is asked (\"Decline this invitation?\" Keep, Decline, with the action's own loading). Both sit above the row's link. Opening the question from an action moves focus to its first button, and closing it brings focus back. Press Decline."
|
|
1010
|
+
] }),
|
|
1011
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1012
|
+
align: "fill",
|
|
1013
|
+
code: `
|
|
1014
|
+
<RowListItem
|
|
1015
|
+
title="Harbour Sync"
|
|
1016
|
+
href="/plugins/harbour-sync"
|
|
1017
|
+
notice={{
|
|
1018
|
+
icon: <ShieldWarningIcon />,
|
|
1019
|
+
message: 'Version 2.4 wants to read your customers. It stays on 2.3 until you agree.',
|
|
1020
|
+
actions: <><Button size="sm">Review</Button><Button size="sm" variant="ghost">Later</Button></>,
|
|
1021
|
+
}}
|
|
1022
|
+
/>
|
|
1023
|
+
|
|
1024
|
+
<RowListItem
|
|
1025
|
+
title="Fernhill Workspace Ltd"
|
|
1026
|
+
description="Callum Reid invited you as Staff. Expires in 6 days."
|
|
1027
|
+
actions={<><Button size="sm" onClick={ask}>Decline</Button><Button size="sm" variant="primary">Accept</Button></>}
|
|
1028
|
+
confirm={asking ? {
|
|
1029
|
+
message: 'Decline this invitation? Fernhill will need to invite you again.',
|
|
1030
|
+
actions: <><Button size="sm" onClick={keep}>Keep</Button><Button size="sm" variant="critical" loading={declining} onClick={decline}>Decline</Button></>,
|
|
1031
|
+
} : undefined}
|
|
1032
|
+
/>`,
|
|
1033
|
+
children: /* @__PURE__ */ jsx(RowStrips, {})
|
|
1034
|
+
})
|
|
1035
|
+
}),
|
|
1036
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
1037
|
+
id: "feeds",
|
|
1038
|
+
title: "Feeds and excerpts",
|
|
1039
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1040
|
+
/* @__PURE__ */ jsx("code", { children: "overline" }),
|
|
1041
|
+
" sets a quiet line over the title of what the row is: its category, a New badge, how long ago.",
|
|
1042
|
+
/* @__PURE__ */ jsx("code", { children: " descriptionLines" }),
|
|
1043
|
+
" lets an excerpt run to 2 or 3 lines before it is cut. ",
|
|
1044
|
+
/* @__PURE__ */ jsx("code", { children: "RowListPanel" }),
|
|
1045
|
+
" holds rows that scroll between a fixed head (the title, a live dot, filters) and a foot (\"Showing 6 of 42\"), at most",
|
|
1046
|
+
" ",
|
|
1047
|
+
/* @__PURE__ */ jsx("code", { children: "maxHeight" }),
|
|
1048
|
+
" tall; its scrolling region takes keyboard focus and is named by the title, and a row arriving at the top keeps the place of a reader who has scrolled down, while a reader at the top sees it come in."
|
|
1049
|
+
] }),
|
|
1050
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1051
|
+
align: "fill",
|
|
1052
|
+
code: `
|
|
1053
|
+
<RowListPanel title="Live activity" status={<LiveDot />} actions={<Button size="xs" variant="ghost">All</Button>} footer="Showing 6 of 42" maxHeight={300}>
|
|
1054
|
+
<RowList variant="inset" align="start">
|
|
1055
|
+
<RowListItem
|
|
1056
|
+
leading={<IconTile shape="circle" size="sm"><ShoppingBagIcon /></IconTile>}
|
|
1057
|
+
overline={<><DesktopIcon aria-label="Computer" /><Badge size="sm" tone="accent">New visitor</Badge><span>Just now</span></>}
|
|
1058
|
+
title="Leeds, GB"
|
|
1059
|
+
description="Bought the Arden ergonomic chair"
|
|
1060
|
+
meta="£289.00"
|
|
1061
|
+
/>
|
|
1062
|
+
</RowList>
|
|
1063
|
+
</RowListPanel>
|
|
1064
|
+
|
|
1065
|
+
<RowList aria-label="What's new" align="start">
|
|
1066
|
+
<RowListItem
|
|
1067
|
+
href="/changelog/bulk-price-editing"
|
|
1068
|
+
overline={<><Badge size="sm" tone="info">Feature</Badge><Badge size="sm" tone="accent">New</Badge><span>2 days ago</span></>}
|
|
1069
|
+
title="Bulk price editing"
|
|
1070
|
+
description="Change the price of many products at once from the product list..."
|
|
1071
|
+
descriptionLines={2}
|
|
1072
|
+
trailing={<CaretRightIcon />}
|
|
1073
|
+
/>
|
|
1074
|
+
</RowList>`,
|
|
1075
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1076
|
+
className: "row-list-feeds",
|
|
1077
|
+
children: [/* @__PURE__ */ jsx(LiveFeed, {}), /* @__PURE__ */ jsx(Changelog, {})]
|
|
1078
|
+
})
|
|
1079
|
+
})
|
|
1080
|
+
}),
|
|
1081
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
1082
|
+
id: "wrapping",
|
|
1083
|
+
title: "Long text and plain lists",
|
|
1084
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1085
|
+
"A description is one cut line unless you give the row ",
|
|
1086
|
+
/* @__PURE__ */ jsx("code", { children: "wrap" }),
|
|
1087
|
+
". With ",
|
|
1088
|
+
/* @__PURE__ */ jsx("code", { children: "align=\"start\"" }),
|
|
1089
|
+
" on the list, the mark, the figures and the actions stay at the top of the row beside the first line instead of floating to the middle of a tall one. ",
|
|
1090
|
+
/* @__PURE__ */ jsxs("code", { children: ["dividers=", "{false}"] }),
|
|
1091
|
+
" takes the hairlines away and leaves the frame."
|
|
1092
|
+
] }),
|
|
1093
|
+
children: [/* @__PURE__ */ jsx(SubSection, {
|
|
1094
|
+
title: "Wrapping descriptions, aligned to the top",
|
|
1095
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1096
|
+
align: "fill",
|
|
1097
|
+
code: `
|
|
1098
|
+
<RowList align="start" aria-label="Policies">
|
|
1099
|
+
<RowListItem
|
|
1100
|
+
leading={<IconTile><ShieldCheckIcon /></IconTile>}
|
|
1101
|
+
title="Returns policy"
|
|
1102
|
+
description="Customers can return most items within 30 days of delivery, …"
|
|
1103
|
+
wrap
|
|
1104
|
+
meta="Updated 3 Oct"
|
|
1105
|
+
onClick={() => {}}
|
|
1106
|
+
actions={<IconButton label="Edit Returns policy" size="sm"><PencilSimpleIcon /></IconButton>}
|
|
1107
|
+
/>
|
|
1108
|
+
…
|
|
1109
|
+
</RowList>`,
|
|
1110
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1111
|
+
className: "row-list-stage",
|
|
1112
|
+
children: /* @__PURE__ */ jsx(LongText, {})
|
|
1113
|
+
})
|
|
1114
|
+
})
|
|
1115
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
1116
|
+
title: "No hairlines between rows",
|
|
1117
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1118
|
+
align: "fill",
|
|
1119
|
+
code: `
|
|
1120
|
+
<RowList dividers={false} aria-label="Delivery services">
|
|
1121
|
+
<RowListItem title="Royal Mail Tracked 48" description="Zone 1, 2 and 3" actions={…} />
|
|
1122
|
+
…
|
|
1123
|
+
</RowList>`,
|
|
1124
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1125
|
+
className: "row-list-stage",
|
|
1126
|
+
children: /* @__PURE__ */ jsx(PlainRows, {})
|
|
1127
|
+
})
|
|
1128
|
+
})
|
|
1129
|
+
})]
|
|
1130
|
+
}),
|
|
1131
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
1132
|
+
id: "variants",
|
|
1133
|
+
title: "Variants",
|
|
1134
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1135
|
+
/* @__PURE__ */ jsx("code", { children: "card" }),
|
|
1136
|
+
" is the default: one hairline-framed card, 16px corners. ",
|
|
1137
|
+
/* @__PURE__ */ jsx("code", { children: "inset" }),
|
|
1138
|
+
" drops the frame for rows inside a ",
|
|
1139
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
1140
|
+
to: "/components/card",
|
|
1141
|
+
children: "Card"
|
|
1142
|
+
}),
|
|
1143
|
+
", whose own padding is the margin; the first and last rows keep 4px above and below, so the list sits close to the card's header and footer. ",
|
|
1144
|
+
/* @__PURE__ */ jsx("code", { children: "bleed" }),
|
|
1145
|
+
" drops the frame and the rules: a row's hover wash reaches 12px past the list on both sides, so its words stay in line with the text above. Use it for a few links inside a record section."
|
|
1146
|
+
] }),
|
|
1147
|
+
children: [/* @__PURE__ */ jsx(SubSection, {
|
|
1148
|
+
title: "Inset, inside a card",
|
|
1149
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1150
|
+
align: "fill",
|
|
1151
|
+
code: `
|
|
1152
|
+
<Card>
|
|
1153
|
+
<CardHeader icon={<WebhooksLogoIcon />} title="Webhooks" description="Tell your own systems when something happens." />
|
|
1154
|
+
<RowList variant="inset" aria-label="Webhooks">
|
|
1155
|
+
<RowListItem title="order.created" description="https://hooks.example.com/orders" actions={<Switch size="sm" checked aria-label="order.created is active" />} />
|
|
1156
|
+
<RowListItem title="stock.low" description="https://hooks.example.com/stock" dimmed actions={<Switch size="sm" aria-label="stock.low is active" />} />
|
|
1157
|
+
</RowList>
|
|
1158
|
+
</Card>`,
|
|
1159
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1160
|
+
className: "row-list-stage",
|
|
1161
|
+
children: /* @__PURE__ */ jsx(Webhooks, {})
|
|
1162
|
+
})
|
|
1163
|
+
})
|
|
1164
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
1165
|
+
title: "Bleed, in a record section",
|
|
1166
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1167
|
+
align: "fill",
|
|
1168
|
+
code: `
|
|
1169
|
+
<h4>Returns</h4>
|
|
1170
|
+
<RowList variant="bleed" aria-label="Returns on this order">
|
|
1171
|
+
<RowListItem title="RET-1042" description="Refund · 2 items" meta="12 Oct" onClick={() => {}} trailing={<CaretRightIcon />} />
|
|
1172
|
+
<RowListItem title="RET-1039" description="Exchange · 1 item" meta="9 Oct" onClick={() => {}} trailing={<CaretRightIcon />} />
|
|
1173
|
+
</RowList>`,
|
|
1174
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1175
|
+
className: "row-list-stage",
|
|
1176
|
+
children: /* @__PURE__ */ jsx(Returns, {})
|
|
1177
|
+
})
|
|
1178
|
+
})
|
|
1179
|
+
})]
|
|
1180
|
+
}),
|
|
1181
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
1182
|
+
id: "sizes",
|
|
1183
|
+
title: "Sizes",
|
|
1184
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1185
|
+
"Row padding by size: ",
|
|
1186
|
+
/* @__PURE__ */ jsx("code", { children: "sm" }),
|
|
1187
|
+
" 10px by 14px, ",
|
|
1188
|
+
/* @__PURE__ */ jsx("code", { children: "md" }),
|
|
1189
|
+
" (default) 12px by 16px, ",
|
|
1190
|
+
/* @__PURE__ */ jsx("code", { children: "lg" }),
|
|
1191
|
+
" 16px all round, the settings pages' rows. A row grows to fit its words, so two lines of text make it taller than one. Below 640px every size pads 12px at the sides (16px at ",
|
|
1192
|
+
/* @__PURE__ */ jsx("code", { children: "lg" }),
|
|
1193
|
+
")."
|
|
1194
|
+
] }),
|
|
1195
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1196
|
+
align: "fill",
|
|
1197
|
+
code: `
|
|
1198
|
+
<RowList size="sm">…</RowList>
|
|
1199
|
+
<RowList size="md">…</RowList>
|
|
1200
|
+
<RowList size="lg">…</RowList>`,
|
|
1201
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1202
|
+
className: "row-list-sizes",
|
|
1203
|
+
children: [
|
|
1204
|
+
/* @__PURE__ */ jsxs(Labelled, { children: [/* @__PURE__ */ jsx("span", { children: "sm" }), /* @__PURE__ */ jsx(Sample, { size: "sm" })] }),
|
|
1205
|
+
/* @__PURE__ */ jsxs(Labelled, { children: [/* @__PURE__ */ jsx("span", { children: "md" }), /* @__PURE__ */ jsx(Sample, { size: "md" })] }),
|
|
1206
|
+
/* @__PURE__ */ jsxs(Labelled, { children: [/* @__PURE__ */ jsx("span", { children: "lg" }), /* @__PURE__ */ jsx(Sample, { size: "lg" })] })
|
|
1207
|
+
]
|
|
1208
|
+
})
|
|
1209
|
+
})
|
|
1210
|
+
}),
|
|
1211
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
1212
|
+
id: "loading",
|
|
1213
|
+
title: "Loading and empty",
|
|
1214
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1215
|
+
/* @__PURE__ */ jsx("code", { children: "RowListSkeleton" }),
|
|
1216
|
+
" draws rows in the shape of the list in the same frame, so the list does not jump when it arrives. It is hidden from assistive technology and marked busy; give it an ",
|
|
1217
|
+
/* @__PURE__ */ jsx("code", { children: "aria-label" }),
|
|
1218
|
+
" if it needs a name. When there is nothing to list, replace the whole card with an",
|
|
1219
|
+
" ",
|
|
1220
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
1221
|
+
to: "/components/empty-state",
|
|
1222
|
+
children: "empty state"
|
|
1223
|
+
}),
|
|
1224
|
+
"."
|
|
1225
|
+
] }),
|
|
1226
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1227
|
+
align: "fill",
|
|
1228
|
+
code: `
|
|
1229
|
+
<RowListSkeleton rows={3} aria-label="Loading API keys" />
|
|
1230
|
+
|
|
1231
|
+
<EmptyState size="sm" title="No API keys yet" description="Create a key to let another system read your orders." />`,
|
|
1232
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1233
|
+
className: "row-list-sizes",
|
|
1234
|
+
children: [/* @__PURE__ */ jsx(RowListSkeleton, {
|
|
1235
|
+
rows: 3,
|
|
1236
|
+
"aria-label": "Loading API keys"
|
|
1237
|
+
}), /* @__PURE__ */ jsx(EmptyState, {
|
|
1238
|
+
size: "sm",
|
|
1239
|
+
title: "No API keys yet",
|
|
1240
|
+
description: "Create a key to let another system read your orders."
|
|
1241
|
+
})]
|
|
1242
|
+
})
|
|
1243
|
+
})
|
|
1244
|
+
}),
|
|
1245
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
1246
|
+
id: "both-themes",
|
|
1247
|
+
title: "In both themes",
|
|
1248
|
+
description: /* @__PURE__ */ jsx("p", { children: "A row that opens something, the selected row and a switched-off row, light and dark side by side. Point at the first row, or tab to it, to see the wash and the focus ring." }),
|
|
1249
|
+
children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsx("div", {
|
|
1250
|
+
className: "row-list-theme",
|
|
1251
|
+
children: /* @__PURE__ */ jsx(Everything, {})
|
|
1252
|
+
}) })
|
|
1253
|
+
}),
|
|
1254
|
+
/* @__PURE__ */ jsx(Fragment$1, {}),
|
|
1255
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
1256
|
+
id: "guidelines",
|
|
1257
|
+
title: "Guidelines",
|
|
1258
|
+
children: [/* @__PURE__ */ jsx(DoDont, {
|
|
1259
|
+
do: {
|
|
1260
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1261
|
+
className: "row-list-dd",
|
|
1262
|
+
children: /* @__PURE__ */ jsxs(RowList, {
|
|
1263
|
+
size: "sm",
|
|
1264
|
+
children: [/* @__PURE__ */ jsx(RowListItem, {
|
|
1265
|
+
title: "Orders sync",
|
|
1266
|
+
description: "Last used today"
|
|
1267
|
+
}), /* @__PURE__ */ jsx(RowListItem, {
|
|
1268
|
+
title: "Stock export",
|
|
1269
|
+
description: "Last used 3 days ago"
|
|
1270
|
+
})]
|
|
1271
|
+
})
|
|
1272
|
+
}),
|
|
1273
|
+
caption: "One card of rows, parted by a hairline."
|
|
1274
|
+
},
|
|
1275
|
+
dont: {
|
|
1276
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1277
|
+
className: "row-list-dd row-list-dd--boxes",
|
|
1278
|
+
children: [/* @__PURE__ */ jsx(Card, {
|
|
1279
|
+
padding: "sm",
|
|
1280
|
+
children: "Orders sync"
|
|
1281
|
+
}), /* @__PURE__ */ jsx(Card, {
|
|
1282
|
+
padding: "sm",
|
|
1283
|
+
children: "Stock export"
|
|
1284
|
+
})]
|
|
1285
|
+
}),
|
|
1286
|
+
caption: "A stack of boxes, each framed alone. It reads as several things, not one list."
|
|
1287
|
+
}
|
|
1288
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
1289
|
+
"A row either opens something or is static. Do not give a static row a hover tint, and do not make a row open something when its actions are the point.",
|
|
1290
|
+
"Keep the title to a name and the description to one line. Put detail in the row it belongs to, not a longer title.",
|
|
1291
|
+
"At most three actions on a row. For more, use one icon button that opens a menu.",
|
|
1292
|
+
"Destructive actions confirm. A trash icon on a row is one slip away from a delete, so ask first.",
|
|
1293
|
+
"Tabular data you compare across rows belongs in a table, not a list."
|
|
1294
|
+
] })]
|
|
1295
|
+
}),
|
|
1296
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
1297
|
+
id: "accessibility",
|
|
1298
|
+
title: "Accessibility",
|
|
1299
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
1300
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1301
|
+
"The list is a real list, so a screen reader announces how many rows it has. Name it with ",
|
|
1302
|
+
/* @__PURE__ */ jsx("code", { children: "aria-label" }),
|
|
1303
|
+
" ",
|
|
1304
|
+
"when a page has more than one."
|
|
1305
|
+
] }),
|
|
1306
|
+
/* @__PURE__ */ jsx(Fragment$1, { children: "A row that opens something has one link or button, named by the title and described by the description. The actions are separate controls after it in the tab order, so a screen reader meets the link, then its buttons, then the next row." }),
|
|
1307
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1308
|
+
"Name every icon-only action with ",
|
|
1309
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
1310
|
+
" and the row it belongs to."
|
|
1311
|
+
] }),
|
|
1312
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1313
|
+
/* @__PURE__ */ jsx("code", { children: "selected" }),
|
|
1314
|
+
" sets ",
|
|
1315
|
+
/* @__PURE__ */ jsx("code", { children: "aria-current=\"true\"" }),
|
|
1316
|
+
" on the row's link or button, and on the row itself when it opens nothing, so the state is not the wash alone."
|
|
1317
|
+
] }),
|
|
1318
|
+
"A disabled row is skipped by Tab. A disabled link loses its href; a disabled router link (asChild) keeps the address its own element carries, but its click is cancelled, it is no tab stop and it says aria-disabled. A busy row says so with aria-busy.",
|
|
1319
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1320
|
+
"On a row that opens something, anything in ",
|
|
1321
|
+
/* @__PURE__ */ jsx("code", { children: "leading" }),
|
|
1322
|
+
", ",
|
|
1323
|
+
/* @__PURE__ */ jsx("code", { children: "badges" }),
|
|
1324
|
+
", ",
|
|
1325
|
+
/* @__PURE__ */ jsx("code", { children: "meta" }),
|
|
1326
|
+
" or",
|
|
1327
|
+
" ",
|
|
1328
|
+
/* @__PURE__ */ jsx("code", { children: "description" }),
|
|
1329
|
+
" sits under the row's link, so a pointer cannot press it: put controls in",
|
|
1330
|
+
" ",
|
|
1331
|
+
/* @__PURE__ */ jsx("code", { children: "actions" }),
|
|
1332
|
+
". A drag grip or a checkbox at the start of a row that opens something cannot be used; make that row static, or move the control into ",
|
|
1333
|
+
/* @__PURE__ */ jsx("code", { children: "actions" }),
|
|
1334
|
+
"."
|
|
1335
|
+
] }),
|
|
1336
|
+
"A dimmed row is also said in words (an Inactive badge): the fade alone is no message, and its focus ring and its link stay at full strength.",
|
|
1337
|
+
"The focus ring sits inside the row, 2px, so the card never clips it.",
|
|
1338
|
+
"The trailing mark and the leading tile are decorative and hidden."
|
|
1339
|
+
] })
|
|
1340
|
+
}),
|
|
1341
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
1342
|
+
id: "props",
|
|
1343
|
+
title: "Props",
|
|
1344
|
+
description: /* @__PURE__ */ jsx("p", { children: "RowList also accepts every native list attribute; RowListItem every list item attribute." }),
|
|
1345
|
+
children: [
|
|
1346
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
1347
|
+
title: "RowList",
|
|
1348
|
+
rows: [
|
|
1349
|
+
{
|
|
1350
|
+
name: "variant",
|
|
1351
|
+
type: "'card' | 'inset' | 'bleed'",
|
|
1352
|
+
default: "'card'",
|
|
1353
|
+
description: "A hairline-framed card, rows with no frame inside a Card, or rows whose hover wash bleeds 12px."
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
name: "size",
|
|
1357
|
+
type: "'sm' | 'md' | 'lg'",
|
|
1358
|
+
default: "'md'",
|
|
1359
|
+
description: "Row padding: 10px by 14px, 12px by 16px, or 16px all round."
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
name: "dividers",
|
|
1363
|
+
type: "boolean",
|
|
1364
|
+
default: "true",
|
|
1365
|
+
description: "A hairline between rows. The bleed variant never draws one."
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
name: "align",
|
|
1369
|
+
type: "'center' | 'start'",
|
|
1370
|
+
default: "'center'",
|
|
1371
|
+
description: "Where the row's contents line up. Use start when the words may wrap onto several lines."
|
|
1372
|
+
}
|
|
1373
|
+
]
|
|
1374
|
+
}),
|
|
1375
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
1376
|
+
title: "RowListItem",
|
|
1377
|
+
rows: [
|
|
1378
|
+
{
|
|
1379
|
+
name: "title",
|
|
1380
|
+
type: "ReactNode",
|
|
1381
|
+
required: true,
|
|
1382
|
+
description: "What the row is. The link or button when the row opens something."
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
name: "description",
|
|
1386
|
+
type: "ReactNode",
|
|
1387
|
+
description: "The quiet line under the title. One line, cut with an ellipsis."
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
name: "badges",
|
|
1391
|
+
type: "ReactNode",
|
|
1392
|
+
description: "Badges after the title. They wrap under it on a narrow row."
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
name: "leading",
|
|
1396
|
+
type: "ReactNode",
|
|
1397
|
+
description: "What starts the row: an IconTile, an Avatar, a logo. Decorative: on a row that opens something it is under the link, so not for controls."
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
name: "meta",
|
|
1401
|
+
type: "ReactNode",
|
|
1402
|
+
description: "Quiet figures before the actions, such as a count or a price. Never wraps. A 0 is drawn. Under the link too, so not for controls."
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
name: "trailing",
|
|
1406
|
+
type: "ReactNode",
|
|
1407
|
+
description: "What ends a row that opens something: a chevron or a spinner. Moves 2px on hover. Decorative."
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
name: "actions",
|
|
1411
|
+
type: "ReactNode",
|
|
1412
|
+
description: "Controls at the end of the row: kit IconButtons, a Switch or a Menu trigger. They sit beside the link, never inside it."
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
name: "href",
|
|
1416
|
+
type: "string",
|
|
1417
|
+
description: "Makes the title an anchor that covers the row."
|
|
1418
|
+
},
|
|
1419
|
+
{
|
|
1420
|
+
name: "target / rel",
|
|
1421
|
+
type: "string",
|
|
1422
|
+
description: "For a link. target=\"_blank\" sets rel=\"noopener noreferrer\" unless you give rel."
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
name: "onClick",
|
|
1426
|
+
type: "(event) => void",
|
|
1427
|
+
description: "Makes the title a button that covers the row."
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
name: "asChild",
|
|
1431
|
+
type: "boolean",
|
|
1432
|
+
default: "false",
|
|
1433
|
+
description: "Render the one child element, typically a router link, as the row's link. Leave the element empty."
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
name: "selected",
|
|
1437
|
+
type: "boolean",
|
|
1438
|
+
default: "false",
|
|
1439
|
+
description: "The row in use: a pale wash and a line of light. Sets aria-current on its link, or on the row when it opens nothing."
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
name: "dimmed",
|
|
1443
|
+
type: "boolean",
|
|
1444
|
+
default: "false",
|
|
1445
|
+
description: "Switched off or inactive: the detail, badges and mark fade and the title turns quiet (still 4.5:1); the actions do not, and a row that opens something still does."
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
name: "disabled",
|
|
1449
|
+
type: "boolean",
|
|
1450
|
+
default: "false",
|
|
1451
|
+
description: "The row cannot be opened. It fades like a dimmed row, takes no hover and is out of the tab order."
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
name: "busy",
|
|
1455
|
+
type: "boolean",
|
|
1456
|
+
default: "false",
|
|
1457
|
+
description: "The row is opening something: the pointer shows it waits, and aria-busy is set."
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
name: "wrap",
|
|
1461
|
+
type: "boolean",
|
|
1462
|
+
default: "false",
|
|
1463
|
+
description: "Let the description wrap onto as many lines as it needs."
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
name: "overline",
|
|
1467
|
+
type: "ReactNode",
|
|
1468
|
+
description: "A quiet line over the title: a category badge, New, how long ago. Badges and a time, never a label of words."
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
name: "descriptionLines",
|
|
1472
|
+
type: "1 | 2 | 3",
|
|
1473
|
+
default: "1",
|
|
1474
|
+
description: "Let the description run to 2 or 3 lines before it is cut. wrap wins."
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
name: "notice",
|
|
1478
|
+
type: "RowListNotice",
|
|
1479
|
+
description: "{ message, icon?, actions?, tone? }: a compact notice strip above the row, in the same item, above its link."
|
|
1480
|
+
},
|
|
1481
|
+
{
|
|
1482
|
+
name: "confirm",
|
|
1483
|
+
type: "RowListConfirm",
|
|
1484
|
+
description: "{ message, actions }: a question under the row that replaces its actions while it is there. Focus moves to it and back."
|
|
1485
|
+
}
|
|
1486
|
+
]
|
|
1487
|
+
}),
|
|
1488
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
1489
|
+
title: "RowListSkeleton",
|
|
1490
|
+
rows: [
|
|
1491
|
+
{
|
|
1492
|
+
name: "rows",
|
|
1493
|
+
type: "number",
|
|
1494
|
+
default: "3",
|
|
1495
|
+
description: "How many rows to draw."
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
name: "leading",
|
|
1499
|
+
type: "boolean",
|
|
1500
|
+
default: "true",
|
|
1501
|
+
description: "Draw a tile before the words."
|
|
1502
|
+
},
|
|
1503
|
+
{
|
|
1504
|
+
name: "description",
|
|
1505
|
+
type: "boolean",
|
|
1506
|
+
default: "true",
|
|
1507
|
+
description: "Draw the quiet second line."
|
|
1508
|
+
},
|
|
1509
|
+
{
|
|
1510
|
+
name: "…RowList props",
|
|
1511
|
+
type: "variant, size, dividers, align",
|
|
1512
|
+
description: "The frame it loads into."
|
|
1513
|
+
}
|
|
1514
|
+
]
|
|
1515
|
+
}),
|
|
1516
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
1517
|
+
title: "RowListPanel",
|
|
1518
|
+
rows: [
|
|
1519
|
+
{
|
|
1520
|
+
name: "title",
|
|
1521
|
+
type: "ReactNode",
|
|
1522
|
+
required: true,
|
|
1523
|
+
description: "The panel's name, in its head. It names the scrolling region."
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
name: "titleAs",
|
|
1527
|
+
type: "'h2' | 'h3' | 'h4' | 'p'",
|
|
1528
|
+
default: "'h3'",
|
|
1529
|
+
description: "The title element."
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
name: "status",
|
|
1533
|
+
type: "ReactNode",
|
|
1534
|
+
description: "Beside the title: a live dot, a count."
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
name: "actions",
|
|
1538
|
+
type: "ReactNode",
|
|
1539
|
+
description: "At the end of the head: filters, a View all link."
|
|
1540
|
+
},
|
|
1541
|
+
{
|
|
1542
|
+
name: "footer",
|
|
1543
|
+
type: "ReactNode",
|
|
1544
|
+
description: "Under the rows: \"Showing 15 of 42\", a Load more button."
|
|
1545
|
+
},
|
|
1546
|
+
{
|
|
1547
|
+
name: "maxHeight",
|
|
1548
|
+
type: "number | string",
|
|
1549
|
+
default: "420",
|
|
1550
|
+
description: "The most the rows take before they scroll. A number is px."
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
name: "children",
|
|
1554
|
+
type: "ReactNode",
|
|
1555
|
+
description: "The rows: a RowList, best inset or bleed, or an empty state."
|
|
1556
|
+
}
|
|
1557
|
+
]
|
|
1558
|
+
})
|
|
1559
|
+
]
|
|
1560
|
+
})
|
|
1561
|
+
]
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
//#endregion
|
|
1565
|
+
export { Page, Preview };
|