@orbitcommerce/constellation-docs 0.0.0-stage → 1.0.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 +8260 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +308 -0
- package/dist/pages/Playground-CNbBbErC.js +129 -0
- package/dist/pages/_figures-data-BDmScEny.js +606 -0
- package/dist/pages/_foundations-blXWyYh8.js +30 -0
- package/dist/pages/_overlays-specimens-Dpn6oiyH.js +310 -0
- package/dist/pages/alert-BD4e6QTh.js +769 -0
- package/dist/pages/app-shell-KbA-nRqZ.js +1479 -0
- package/dist/pages/area-chart-B91dLcGo.js +562 -0
- package/dist/pages/avatar-DPPHXJAu.js +713 -0
- package/dist/pages/badge-C9JR0thI.js +729 -0
- package/dist/pages/button-D3V912P4.js +518 -0
- package/dist/pages/calendar-DSDZ9nRH.js +630 -0
- package/dist/pages/card-DUggbis3.js +659 -0
- package/dist/pages/checkbox-DwimQaK3.js +365 -0
- package/dist/pages/colour-BwuO8xAv.js +1498 -0
- package/dist/pages/command-palette-xAD7fOg6.js +1243 -0
- package/dist/pages/date-picker-BYSa816m.js +1421 -0
- package/dist/pages/delta-CtAo0eIM.js +574 -0
- package/dist/pages/dialog-BRAf4LMh.js +1451 -0
- package/dist/pages/docs-BNOb7AqR.js +515 -0
- package/dist/pages/empty-state-C-mLrXW2.js +417 -0
- package/dist/pages/figure-tabs-CoPFzzKz.js +460 -0
- package/dist/pages/home-dashboard-CFQwDtC9.js +959 -0
- package/dist/pages/host-B6znjEgQ.js +109 -0
- package/dist/pages/icon-button-C9eSVPPW.js +861 -0
- package/dist/pages/icons-sxkTs5Ob.js +473 -0
- package/dist/pages/input-KF9Gkawf.js +1093 -0
- package/dist/pages/installation-DpsX8G_n.js +445 -0
- package/dist/pages/kbd-cNfDoikz.js +544 -0
- package/dist/pages/live-globe-ClvLn9Lb.js +571 -0
- package/dist/pages/logo-BfGF1Pq9.js +571 -0
- package/dist/pages/menu-by2sgQ09.js +1618 -0
- package/dist/pages/motion-BvTGc2Dk.js +855 -0
- package/dist/pages/orbit-spinner-Dil1Z3Oy.js +332 -0
- package/dist/pages/overview-BPEbZQ6g.js +130 -0
- package/dist/pages/pagination-BBUnGvv5.js +249 -0
- package/dist/pages/popover-Db1gLDpb.js +1136 -0
- package/dist/pages/principles-CeAIOIdt.js +483 -0
- package/dist/pages/radio-group-CkdBWWfG.js +1077 -0
- package/dist/pages/registry-CroHzK9I.js +244 -0
- package/dist/pages/release-Dvo684UJ.js +13 -0
- package/dist/pages/rolling-number-qmvH84Mq.js +529 -0
- package/dist/pages/search-field-BN7MWGQ4.js +693 -0
- package/dist/pages/segmented-control-CTbIpRBW.js +777 -0
- package/dist/pages/select-DguELoRR.js +1429 -0
- package/dist/pages/separator-CPZub9pv.js +351 -0
- package/dist/pages/shape-DKvA0YKr.js +627 -0
- package/dist/pages/skeleton-DLuBhP46.js +561 -0
- package/dist/pages/sparkline-DMMYGbHn.js +668 -0
- package/dist/pages/switch-B-Qe4kcT.js +517 -0
- package/dist/pages/table-AMoODng4.js +607 -0
- package/dist/pages/tabs-B4M-usCV.js +1455 -0
- package/dist/pages/textarea-fTuUZRQb.js +693 -0
- package/dist/pages/toast-CKP03zjy.js +1176 -0
- package/dist/pages/tooltip-CBYil3kt.js +697 -0
- package/dist/pages/typography-PCbg8Bhg.js +735 -0
- package/manifest.json +3125 -0
- package/package.json +35 -4
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { d as Section, i as DocPage, n as CodeBlock, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-BNOb7AqR.js";
|
|
3
|
+
import { n as useCopied, t as LiveStatus } from "./_foundations-blXWyYh8.js";
|
|
4
|
+
import { useMemo, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Button, EmptyState, IconButton, SearchField, SegmentedControl, Sidebar, SidebarItem, SidebarNav, SidebarSection, Tooltip } from "@orbitcommerce/constellation";
|
|
7
|
+
import { ArrowSquareOutIcon, ArrowsClockwiseIcon, ArrowsDownUpIcon, ArticleIcon, BarcodeIcon, BellIcon, CalendarDotsIcon, ChartLineUpIcon, CheckCircleIcon, CheckIcon, ClockCountdownIcon, ClockIcon, CopySimpleIcon, CreditCardIcon, CurrencyGbpIcon, DotsThreeIcon, DownloadSimpleIcon, EyeIcon, FactoryIcon, FunnelSimpleIcon, GearSixIcon, GiftIcon, HandGrabbingIcon, HourglassIcon, HouseIcon, ImageSquareIcon, InfoIcon, InvoiceIcon, LifebuoyIcon, LightningIcon, LinkSimpleIcon, MagnifyingGlassIcon, MapPinIcon, MegaphoneIcon, PackageIcon, PaperPlaneTiltIcon, PencilSimpleIcon, PlusIcon, PrinterIcon, PuzzlePieceIcon, ReceiptIcon, SealPercentIcon, ShieldCheckIcon, ShoppingBagIcon, ShoppingCartIcon, SignOutIcon, SparkleIcon, SquaresFourIcon, StarIcon, StorefrontIcon, TagIcon, TicketIcon, ToolboxIcon, TrashIcon, TruckIcon, UploadSimpleIcon, UserCircleIcon, UsersThreeIcon, WarningCircleIcon, WarningIcon, XCircleIcon, XIcon } from "@orbitcommerce/constellation/icons";
|
|
8
|
+
//#region src/pages/foundations/icons.tsx
|
|
9
|
+
var entry = (name, Glyph, keywords) => ({
|
|
10
|
+
name,
|
|
11
|
+
Glyph,
|
|
12
|
+
keywords
|
|
13
|
+
});
|
|
14
|
+
var CATALOGUE = [
|
|
15
|
+
{
|
|
16
|
+
id: "commerce",
|
|
17
|
+
title: "Commerce",
|
|
18
|
+
icons: [
|
|
19
|
+
entry("ReceiptIcon", ReceiptIcon, "orders sales receipt"),
|
|
20
|
+
entry("PackageIcon", PackageIcon, "products parcel box stock"),
|
|
21
|
+
entry("ShoppingCartIcon", ShoppingCartIcon, "cart basket marketplace checkout"),
|
|
22
|
+
entry("ShoppingBagIcon", ShoppingBagIcon, "bag purchases shopping"),
|
|
23
|
+
entry("StorefrontIcon", StorefrontIcon, "store shop storefront online store"),
|
|
24
|
+
entry("CreditCardIcon", CreditCardIcon, "payments card pay"),
|
|
25
|
+
entry("InvoiceIcon", InvoiceIcon, "invoice purchase orders bill"),
|
|
26
|
+
entry("TruckIcon", TruckIcon, "delivery shipping dispatch courier"),
|
|
27
|
+
entry("TagIcon", TagIcon, "price label tag"),
|
|
28
|
+
entry("SealPercentIcon", SealPercentIcon, "discounts promotions sale offer"),
|
|
29
|
+
entry("GiftIcon", GiftIcon, "gift cards present"),
|
|
30
|
+
entry("TicketIcon", TicketIcon, "vouchers codes tickets events"),
|
|
31
|
+
entry("BarcodeIcon", BarcodeIcon, "sku barcode scan stock"),
|
|
32
|
+
entry("CurrencyGbpIcon", CurrencyGbpIcon, "money pounds takings revenue price"),
|
|
33
|
+
entry("FactoryIcon", FactoryIcon, "suppliers manufacturer trade"),
|
|
34
|
+
entry("ToolboxIcon", ToolboxIcon, "fulfilment packing tools"),
|
|
35
|
+
entry("HandGrabbingIcon", HandGrabbingIcon, "click and collect pickup collection"),
|
|
36
|
+
entry("UsersThreeIcon", UsersThreeIcon, "customers people team"),
|
|
37
|
+
entry("CalendarDotsIcon", CalendarDotsIcon, "bookings calendar appointments dates"),
|
|
38
|
+
entry("ArrowsClockwiseIcon", ArrowsClockwiseIcon, "subscriptions sync refresh repeat")
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "navigation",
|
|
43
|
+
title: "Navigation",
|
|
44
|
+
icons: [
|
|
45
|
+
entry("HouseIcon", HouseIcon, "home dashboard"),
|
|
46
|
+
entry("SquaresFourIcon", SquaresFourIcon, "dashboard apps grid overview"),
|
|
47
|
+
entry("ChartLineUpIcon", ChartLineUpIcon, "analytics reports performance"),
|
|
48
|
+
entry("MegaphoneIcon", MegaphoneIcon, "marketing campaigns announcements"),
|
|
49
|
+
entry("ImageSquareIcon", ImageSquareIcon, "media images library photos"),
|
|
50
|
+
entry("ArticleIcon", ArticleIcon, "blog content pages articles"),
|
|
51
|
+
entry("PuzzlePieceIcon", PuzzlePieceIcon, "plugins apps extensions"),
|
|
52
|
+
entry("GearSixIcon", GearSixIcon, "settings preferences"),
|
|
53
|
+
entry("SparkleIcon", SparkleIcon, "nebula ai assistant magic"),
|
|
54
|
+
entry("BellIcon", BellIcon, "notifications alerts"),
|
|
55
|
+
entry("MagnifyingGlassIcon", MagnifyingGlassIcon, "search find"),
|
|
56
|
+
entry("UserCircleIcon", UserCircleIcon, "account profile user"),
|
|
57
|
+
entry("LifebuoyIcon", LifebuoyIcon, "help support"),
|
|
58
|
+
entry("SignOutIcon", SignOutIcon, "sign out log out leave")
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "actions",
|
|
63
|
+
title: "Actions",
|
|
64
|
+
icons: [
|
|
65
|
+
entry("PlusIcon", PlusIcon, "add create new"),
|
|
66
|
+
entry("PencilSimpleIcon", PencilSimpleIcon, "edit rename change"),
|
|
67
|
+
entry("TrashIcon", TrashIcon, "delete remove bin"),
|
|
68
|
+
entry("CopySimpleIcon", CopySimpleIcon, "copy duplicate"),
|
|
69
|
+
entry("DownloadSimpleIcon", DownloadSimpleIcon, "download export csv"),
|
|
70
|
+
entry("UploadSimpleIcon", UploadSimpleIcon, "upload import"),
|
|
71
|
+
entry("ArrowSquareOutIcon", ArrowSquareOutIcon, "open external new tab view store"),
|
|
72
|
+
entry("FunnelSimpleIcon", FunnelSimpleIcon, "filter narrow"),
|
|
73
|
+
entry("ArrowsDownUpIcon", ArrowsDownUpIcon, "sort order reorder"),
|
|
74
|
+
entry("DotsThreeIcon", DotsThreeIcon, "more actions overflow menu"),
|
|
75
|
+
entry("PrinterIcon", PrinterIcon, "print packing slip label"),
|
|
76
|
+
entry("PaperPlaneTiltIcon", PaperPlaneTiltIcon, "send email invoice"),
|
|
77
|
+
entry("LinkSimpleIcon", LinkSimpleIcon, "link url address"),
|
|
78
|
+
entry("EyeIcon", EyeIcon, "preview view show"),
|
|
79
|
+
entry("XIcon", XIcon, "close dismiss cancel"),
|
|
80
|
+
entry("CheckIcon", CheckIcon, "done confirm tick")
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "status",
|
|
85
|
+
title: "Status",
|
|
86
|
+
icons: [
|
|
87
|
+
entry("CheckCircleIcon", CheckCircleIcon, "success paid complete fulfilled"),
|
|
88
|
+
entry("WarningIcon", WarningIcon, "warning attention caution"),
|
|
89
|
+
entry("WarningCircleIcon", WarningCircleIcon, "error problem invalid"),
|
|
90
|
+
entry("InfoIcon", InfoIcon, "information help note"),
|
|
91
|
+
entry("XCircleIcon", XCircleIcon, "failed cancelled refused"),
|
|
92
|
+
entry("ClockIcon", ClockIcon, "pending waiting time"),
|
|
93
|
+
entry("ClockCountdownIcon", ClockCountdownIcon, "expiring trial countdown due"),
|
|
94
|
+
entry("HourglassIcon", HourglassIcon, "processing in progress"),
|
|
95
|
+
entry("LightningIcon", LightningIcon, "automation instant fast"),
|
|
96
|
+
entry("ShieldCheckIcon", ShieldCheckIcon, "verified protected secure trusted"),
|
|
97
|
+
entry("StarIcon", StarIcon, "reviews rating favourite featured"),
|
|
98
|
+
entry("MapPinIcon", MapPinIcon, "address location postcode")
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
];
|
|
102
|
+
var TOTAL = CATALOGUE.reduce((n, c) => n + c.icons.length, 0);
|
|
103
|
+
var WEIGHT_OPTIONS = [
|
|
104
|
+
{
|
|
105
|
+
value: "regular",
|
|
106
|
+
label: "Regular"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
value: "duotone",
|
|
110
|
+
label: "Duotone"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
value: "fill",
|
|
114
|
+
label: "Fill"
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
function matches(icon, query) {
|
|
118
|
+
const q = query.trim().toLowerCase();
|
|
119
|
+
if (!q) return true;
|
|
120
|
+
return `${icon.name} ${icon.keywords}`.toLowerCase().includes(q);
|
|
121
|
+
}
|
|
122
|
+
function Browser() {
|
|
123
|
+
const [query, setQuery] = useState("");
|
|
124
|
+
const [weight, setWeight] = useState("regular");
|
|
125
|
+
const { copied, copy } = useCopied();
|
|
126
|
+
const groups = useMemo(() => CATALOGUE.map((g) => ({
|
|
127
|
+
...g,
|
|
128
|
+
icons: g.icons.filter((i) => matches(i, query))
|
|
129
|
+
})).filter((g) => g.icons.length > 0), [query]);
|
|
130
|
+
const shown = groups.reduce((n, g) => n + g.icons.length, 0);
|
|
131
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
132
|
+
className: "icons-browser",
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ jsxs("div", {
|
|
135
|
+
className: "icons-browser__bar",
|
|
136
|
+
children: [/* @__PURE__ */ jsx(SearchField, {
|
|
137
|
+
className: "icons-browser__search",
|
|
138
|
+
value: query,
|
|
139
|
+
onValueChange: setQuery,
|
|
140
|
+
placeholder: `Search ${TOTAL} icons`,
|
|
141
|
+
"aria-label": "Search icons"
|
|
142
|
+
}), /* @__PURE__ */ jsx(SegmentedControl, {
|
|
143
|
+
"aria-label": "Weight",
|
|
144
|
+
size: "md",
|
|
145
|
+
value: weight,
|
|
146
|
+
onValueChange: setWeight,
|
|
147
|
+
options: WEIGHT_OPTIONS
|
|
148
|
+
})]
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ jsx("p", {
|
|
151
|
+
className: "icons-browser__status",
|
|
152
|
+
"aria-hidden": "true",
|
|
153
|
+
children: copied ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
154
|
+
/* @__PURE__ */ jsx(CheckIcon, { weight: "bold" }),
|
|
155
|
+
" Copied ",
|
|
156
|
+
/* @__PURE__ */ jsx("code", { children: copied }),
|
|
157
|
+
". Paste it into your import."
|
|
158
|
+
] }) : query ? `${shown} of ${TOTAL} icons. Select one to copy its import name.` : "Select an icon to copy its import name."
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ jsx(LiveStatus, { message: copied ? `Copied ${copied}` : null }),
|
|
161
|
+
groups.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
162
|
+
size: "sm",
|
|
163
|
+
title: "No icons match",
|
|
164
|
+
description: "Try a word like order, delivery or settings.",
|
|
165
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
166
|
+
size: "sm",
|
|
167
|
+
onClick: () => setQuery(""),
|
|
168
|
+
children: "Clear search"
|
|
169
|
+
})
|
|
170
|
+
}) : groups.map((group) => /* @__PURE__ */ jsxs("section", {
|
|
171
|
+
className: "icons-group",
|
|
172
|
+
"aria-labelledby": `icons-${group.id}`,
|
|
173
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
174
|
+
className: "icons-group__title",
|
|
175
|
+
id: `icons-${group.id}`,
|
|
176
|
+
children: group.title
|
|
177
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
178
|
+
className: "icons-grid",
|
|
179
|
+
children: group.icons.map(({ name, Glyph }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", {
|
|
180
|
+
type: "button",
|
|
181
|
+
className: "icons-tile",
|
|
182
|
+
"data-copied": copied === name ? "" : void 0,
|
|
183
|
+
onClick: () => copy(name),
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ jsx("span", {
|
|
186
|
+
className: "icons-tile__glyph",
|
|
187
|
+
"aria-hidden": "true",
|
|
188
|
+
children: copied === name ? /* @__PURE__ */ jsx(CheckIcon, { weight: "bold" }) : /* @__PURE__ */ jsx(Glyph, { weight })
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ jsx("span", {
|
|
191
|
+
className: "icons-tile__name",
|
|
192
|
+
children: name.replace(/Icon$/, "")
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ jsxs("span", {
|
|
195
|
+
className: "o-sr-only",
|
|
196
|
+
children: [", copy ", name]
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
}) }, name))
|
|
200
|
+
})]
|
|
201
|
+
}, group.id))
|
|
202
|
+
]
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
var WEIGHT_SAMPLES = [
|
|
206
|
+
ReceiptIcon,
|
|
207
|
+
PackageIcon,
|
|
208
|
+
UsersThreeIcon,
|
|
209
|
+
GearSixIcon
|
|
210
|
+
];
|
|
211
|
+
function NavSample() {
|
|
212
|
+
const [active, setActive] = useState("orders");
|
|
213
|
+
return /* @__PURE__ */ jsx("div", {
|
|
214
|
+
className: "icons-nav",
|
|
215
|
+
children: /* @__PURE__ */ jsx(Sidebar, {
|
|
216
|
+
label: "Example sidebar",
|
|
217
|
+
children: /* @__PURE__ */ jsx(SidebarNav, {
|
|
218
|
+
label: "Example pages",
|
|
219
|
+
children: /* @__PURE__ */ jsx(SidebarSection, { children: [
|
|
220
|
+
{
|
|
221
|
+
id: "home",
|
|
222
|
+
label: "Home",
|
|
223
|
+
Glyph: HouseIcon
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: "orders",
|
|
227
|
+
label: "Orders",
|
|
228
|
+
Glyph: ReceiptIcon
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: "products",
|
|
232
|
+
label: "Products",
|
|
233
|
+
Glyph: PackageIcon
|
|
234
|
+
}
|
|
235
|
+
].map(({ id, label, Glyph }) => /* @__PURE__ */ jsx(SidebarItem, {
|
|
236
|
+
itemId: id,
|
|
237
|
+
label,
|
|
238
|
+
icon: /* @__PURE__ */ jsx(Glyph, { weight: "regular" }),
|
|
239
|
+
activeIcon: /* @__PURE__ */ jsx(Glyph, { weight: "duotone" }),
|
|
240
|
+
active: active === id,
|
|
241
|
+
onSelect: () => setActive(id)
|
|
242
|
+
}, id)) })
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function Page() {
|
|
248
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
249
|
+
title: "Icons",
|
|
250
|
+
lead: "Phosphor's line set, served through the kit's icons entry. Regular at rest, duotone when active, fill only for emphasis.",
|
|
251
|
+
importNames: ["PackageIcon", "ReceiptIcon"],
|
|
252
|
+
importFrom: "@orbitcommerce/constellation/icons",
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ jsx(Section, {
|
|
255
|
+
id: "weights",
|
|
256
|
+
title: "Weights",
|
|
257
|
+
description: /* @__PURE__ */ jsx("p", { children: "Three of Phosphor's six weights are in use. Regular is the default. Duotone marks what is active or selected: in the sidebar the current page's icon turns duotone and takes the accent. Fill is for emphasis, sparingly." }),
|
|
258
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
259
|
+
align: "fill",
|
|
260
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
261
|
+
className: "icons-weights",
|
|
262
|
+
children: [
|
|
263
|
+
"regular",
|
|
264
|
+
"duotone",
|
|
265
|
+
"fill"
|
|
266
|
+
].map((weight) => /* @__PURE__ */ jsxs("figure", {
|
|
267
|
+
className: "icons-weight",
|
|
268
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
269
|
+
className: "icons-weight__row",
|
|
270
|
+
"aria-hidden": "true",
|
|
271
|
+
children: WEIGHT_SAMPLES.map((Glyph, i) => /* @__PURE__ */ jsx(Glyph, {
|
|
272
|
+
size: 24,
|
|
273
|
+
weight
|
|
274
|
+
}, i))
|
|
275
|
+
}), /* @__PURE__ */ jsxs("figcaption", { children: [/* @__PURE__ */ jsx("strong", { children: weight === "regular" ? "Regular" : weight === "duotone" ? "Duotone" : "Fill" }), /* @__PURE__ */ jsx("span", { children: weight === "regular" ? "At rest. The default." : weight === "duotone" ? "Active or selected." : "Emphasis only." })] })]
|
|
276
|
+
}, weight))
|
|
277
|
+
})
|
|
278
|
+
})
|
|
279
|
+
}),
|
|
280
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
281
|
+
id: "sizes",
|
|
282
|
+
title: "Sizes",
|
|
283
|
+
description: /* @__PURE__ */ jsx("p", { children: "16px in controls, 18px in navigation, 20px in empty states and larger tiles. The kit's components size their icons for you, so pass the icon bare: a button's icon follows the button's size (13, 15, 16 or 18px)." }),
|
|
284
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
285
|
+
align: "fill",
|
|
286
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
287
|
+
className: "icons-sizes",
|
|
288
|
+
children: [
|
|
289
|
+
16,
|
|
290
|
+
18,
|
|
291
|
+
20
|
|
292
|
+
].map((size) => /* @__PURE__ */ jsxs("figure", {
|
|
293
|
+
className: "icons-size",
|
|
294
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
295
|
+
className: "icons-size__box",
|
|
296
|
+
style: {
|
|
297
|
+
width: size,
|
|
298
|
+
height: size
|
|
299
|
+
},
|
|
300
|
+
"aria-hidden": "true",
|
|
301
|
+
children: /* @__PURE__ */ jsx(PackageIcon, { size })
|
|
302
|
+
}), /* @__PURE__ */ jsxs("figcaption", { children: [/* @__PURE__ */ jsxs("strong", {
|
|
303
|
+
className: "o-num",
|
|
304
|
+
children: [size, "px"]
|
|
305
|
+
}), /* @__PURE__ */ jsx("span", { children: size === 16 ? "Controls" : size === 18 ? "Navigation" : "Empty states and tiles" })] })]
|
|
306
|
+
}, size))
|
|
307
|
+
})
|
|
308
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
309
|
+
title: "In context",
|
|
310
|
+
description: /* @__PURE__ */ jsx("p", { children: "A 16px icon in a button and an icon button; 18px icons in the sidebar, duotone on the current page. Choose a page." }),
|
|
311
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
312
|
+
surface: "ground",
|
|
313
|
+
code: `
|
|
314
|
+
<Button icon={<PlusIcon />}>Add product</Button>
|
|
315
|
+
|
|
316
|
+
<SidebarItem
|
|
317
|
+
label="Orders"
|
|
318
|
+
icon={<ReceiptIcon weight="regular" />}
|
|
319
|
+
activeIcon={<ReceiptIcon weight="duotone" />}
|
|
320
|
+
active
|
|
321
|
+
/>`,
|
|
322
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
323
|
+
className: "icons-context",
|
|
324
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
325
|
+
className: "icons-context__controls",
|
|
326
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
327
|
+
icon: /* @__PURE__ */ jsx(PlusIcon, {}),
|
|
328
|
+
children: "Add product"
|
|
329
|
+
}), /* @__PURE__ */ jsx(Tooltip, {
|
|
330
|
+
content: "Print packing slip",
|
|
331
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
332
|
+
label: "Print packing slip",
|
|
333
|
+
variant: "secondary",
|
|
334
|
+
children: /* @__PURE__ */ jsx(PrinterIcon, {})
|
|
335
|
+
})
|
|
336
|
+
})]
|
|
337
|
+
}), /* @__PURE__ */ jsx(NavSample, {})]
|
|
338
|
+
})
|
|
339
|
+
})
|
|
340
|
+
})]
|
|
341
|
+
}),
|
|
342
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
343
|
+
id: "labels",
|
|
344
|
+
title: "Icon-only controls need a label",
|
|
345
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
346
|
+
"An icon on its own says nothing to a screen reader. ",
|
|
347
|
+
/* @__PURE__ */ jsx("code", { children: "IconButton" }),
|
|
348
|
+
" requires a ",
|
|
349
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
350
|
+
": it becomes the accessible name, and the tooltip when you wrap it in ",
|
|
351
|
+
/* @__PURE__ */ jsx("code", { children: "Tooltip" }),
|
|
352
|
+
"."
|
|
353
|
+
] }),
|
|
354
|
+
children: [/* @__PURE__ */ jsx(DoDont, {
|
|
355
|
+
do: {
|
|
356
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
357
|
+
className: "icons-toolbar",
|
|
358
|
+
children: [
|
|
359
|
+
/* @__PURE__ */ jsx(Tooltip, {
|
|
360
|
+
content: "Print packing slip",
|
|
361
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
362
|
+
label: "Print packing slip",
|
|
363
|
+
children: /* @__PURE__ */ jsx(PrinterIcon, {})
|
|
364
|
+
})
|
|
365
|
+
}),
|
|
366
|
+
/* @__PURE__ */ jsx(Tooltip, {
|
|
367
|
+
content: "Duplicate order",
|
|
368
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
369
|
+
label: "Duplicate order",
|
|
370
|
+
children: /* @__PURE__ */ jsx(CopySimpleIcon, {})
|
|
371
|
+
})
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ jsx(Tooltip, {
|
|
374
|
+
content: "More actions",
|
|
375
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
376
|
+
label: "More actions",
|
|
377
|
+
children: /* @__PURE__ */ jsx(DotsThreeIcon, {})
|
|
378
|
+
})
|
|
379
|
+
})
|
|
380
|
+
]
|
|
381
|
+
}),
|
|
382
|
+
caption: "Every icon button is named, and says its name on hover and focus."
|
|
383
|
+
},
|
|
384
|
+
dont: {
|
|
385
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
386
|
+
className: "icons-toolbar",
|
|
387
|
+
children: [
|
|
388
|
+
/* @__PURE__ */ jsx("span", {
|
|
389
|
+
className: "icons-bare",
|
|
390
|
+
"aria-hidden": "true",
|
|
391
|
+
children: /* @__PURE__ */ jsx(PrinterIcon, {})
|
|
392
|
+
}),
|
|
393
|
+
/* @__PURE__ */ jsx("span", {
|
|
394
|
+
className: "icons-bare",
|
|
395
|
+
"aria-hidden": "true",
|
|
396
|
+
children: /* @__PURE__ */ jsx(CopySimpleIcon, {})
|
|
397
|
+
}),
|
|
398
|
+
/* @__PURE__ */ jsx("span", {
|
|
399
|
+
className: "icons-bare",
|
|
400
|
+
"aria-hidden": "true",
|
|
401
|
+
children: /* @__PURE__ */ jsx(DotsThreeIcon, {})
|
|
402
|
+
})
|
|
403
|
+
]
|
|
404
|
+
}),
|
|
405
|
+
caption: "Unnamed icons read out as \"button, button, button\", and the meaning is left to guesswork."
|
|
406
|
+
}
|
|
407
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
408
|
+
"When an action is not universally understood, give it a word: a button with an icon and a label.",
|
|
409
|
+
"Icons take the text colour. Colour them only through a component state (the active nav icon) or a status.",
|
|
410
|
+
"No padlock or lock icons in merchant-facing UI, including for plan-gated features. Say what the plan adds instead.",
|
|
411
|
+
"Decorative icons are hidden from assistive tech. The kit's components do this for you; on a standalone icon, add aria-hidden."
|
|
412
|
+
] })]
|
|
413
|
+
}),
|
|
414
|
+
/* @__PURE__ */ jsx(Section, {
|
|
415
|
+
id: "browse",
|
|
416
|
+
title: "Browse the set",
|
|
417
|
+
description: /* @__PURE__ */ jsx("p", { children: "The icons Orbit uses, grouped by job. Search by name or by what it is for, switch the weight, and select an icon to copy its import name. Every other Phosphor icon is available from the same entry." }),
|
|
418
|
+
children: /* @__PURE__ */ jsx(Browser, {})
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
421
|
+
id: "in-code",
|
|
422
|
+
title: "In code",
|
|
423
|
+
description: /* @__PURE__ */ jsx("p", { children: "Import from the kit, never from Phosphor directly, so the set can be swapped for Orbit's own drawings later without touching product code." }),
|
|
424
|
+
children: [/* @__PURE__ */ jsx(CodeBlock, {
|
|
425
|
+
lang: "tsx",
|
|
426
|
+
code: `
|
|
427
|
+
import { PackageIcon, ReceiptIcon } from '@orbitcommerce/constellation/icons'
|
|
428
|
+
|
|
429
|
+
// Inside one of the kit's components, pass the icon bare: the component sizes it.
|
|
430
|
+
<Button icon={<PackageIcon />}>Add product</Button>
|
|
431
|
+
|
|
432
|
+
// On its own, set the size and weight, and hide it when it is decoration.
|
|
433
|
+
<ReceiptIcon size={18} weight="duotone" aria-hidden="true" />`
|
|
434
|
+
}), /* @__PURE__ */ jsx(PropsTable, {
|
|
435
|
+
title: "Icon props",
|
|
436
|
+
rows: [
|
|
437
|
+
{
|
|
438
|
+
name: "size",
|
|
439
|
+
type: "number | string",
|
|
440
|
+
default: "'1em'",
|
|
441
|
+
description: "Width and height. 1em follows the font size around it."
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
name: "weight",
|
|
445
|
+
type: "'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone'",
|
|
446
|
+
default: "'regular'",
|
|
447
|
+
description: "Orbit uses regular, duotone and fill."
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: "color",
|
|
451
|
+
type: "string",
|
|
452
|
+
default: "'currentColor'",
|
|
453
|
+
description: "Leave it: icons take the text colour."
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
name: "mirrored",
|
|
457
|
+
type: "boolean",
|
|
458
|
+
default: "false",
|
|
459
|
+
description: "Flips the icon horizontally, for right-to-left layouts."
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
name: "alt",
|
|
463
|
+
type: "string",
|
|
464
|
+
description: "Adds a title to the SVG, for the rare icon that carries meaning on its own."
|
|
465
|
+
}
|
|
466
|
+
]
|
|
467
|
+
})]
|
|
468
|
+
})
|
|
469
|
+
]
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
//#endregion
|
|
473
|
+
export { Page };
|