@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,729 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as DocLink } from "./host-B6znjEgQ.js";
|
|
3
|
+
import { a as DocTable, d as Section, 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-BNOb7AqR.js";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Badge, IconButton } from "@orbitcommerce/constellation";
|
|
7
|
+
import { ClockIcon, MinusIcon, PlusIcon, ReceiptIcon, StorefrontIcon, TagIcon } from "@orbitcommerce/constellation/icons";
|
|
8
|
+
//#region src/pages/components/badge.tsx
|
|
9
|
+
function Preview() {
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
className: "badge-preview",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
14
|
+
tone: "positive",
|
|
15
|
+
children: "Paid"
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
18
|
+
tone: "warning",
|
|
19
|
+
dot: true,
|
|
20
|
+
children: "Unfulfilled"
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
23
|
+
tone: "negative",
|
|
24
|
+
children: "Refunded"
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
27
|
+
variant: "outline",
|
|
28
|
+
children: "Trade"
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
31
|
+
tone: "info",
|
|
32
|
+
children: "Click and collect"
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
35
|
+
variant: "solid",
|
|
36
|
+
tone: "accent",
|
|
37
|
+
children: "3"
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
var TONES = [
|
|
43
|
+
"neutral",
|
|
44
|
+
"accent",
|
|
45
|
+
"positive",
|
|
46
|
+
"negative",
|
|
47
|
+
"warning",
|
|
48
|
+
"info"
|
|
49
|
+
];
|
|
50
|
+
var VARIANTS = [
|
|
51
|
+
"subtle",
|
|
52
|
+
"solid",
|
|
53
|
+
"outline"
|
|
54
|
+
];
|
|
55
|
+
var capitalise = (word) => word.charAt(0).toUpperCase() + word.slice(1);
|
|
56
|
+
/** Every tone in every variant, labelled with the tone's name. */
|
|
57
|
+
function BadgeMatrix() {
|
|
58
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
59
|
+
className: "badge-matrix",
|
|
60
|
+
children: [VARIANTS.map((variant) => /* @__PURE__ */ jsx("span", {
|
|
61
|
+
className: "badge-matrix__head",
|
|
62
|
+
children: capitalise(variant)
|
|
63
|
+
}, variant)), TONES.map((tone) => VARIANTS.map((variant) => /* @__PURE__ */ jsx(Badge, {
|
|
64
|
+
tone,
|
|
65
|
+
variant,
|
|
66
|
+
children: capitalise(tone)
|
|
67
|
+
}, `${tone}-${variant}`)))]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function LiveCount() {
|
|
71
|
+
const [count, setCount] = useState(7);
|
|
72
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
73
|
+
/* @__PURE__ */ jsxs("span", {
|
|
74
|
+
className: "badge-count",
|
|
75
|
+
children: ["Unfulfilled orders", /* @__PURE__ */ jsx(Badge, {
|
|
76
|
+
variant: "solid",
|
|
77
|
+
tone: "accent",
|
|
78
|
+
children: count
|
|
79
|
+
})]
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
82
|
+
label: "One fewer",
|
|
83
|
+
size: "sm",
|
|
84
|
+
variant: "secondary",
|
|
85
|
+
onClick: () => setCount((n) => Math.max(0, n - 1)),
|
|
86
|
+
children: /* @__PURE__ */ jsx(MinusIcon, {})
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
89
|
+
label: "One more",
|
|
90
|
+
size: "sm",
|
|
91
|
+
variant: "secondary",
|
|
92
|
+
onClick: () => setCount((n) => n + 1),
|
|
93
|
+
children: /* @__PURE__ */ jsx(PlusIcon, {})
|
|
94
|
+
})
|
|
95
|
+
] });
|
|
96
|
+
}
|
|
97
|
+
var tone = (name) => /* @__PURE__ */ jsx("code", { children: name });
|
|
98
|
+
/** A status badge with its tone beside it, for the mapping table. */
|
|
99
|
+
function Status({ tone: meaning, icon, children }) {
|
|
100
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
101
|
+
className: "badge-status",
|
|
102
|
+
children: [/* @__PURE__ */ jsx(Badge, {
|
|
103
|
+
tone: meaning,
|
|
104
|
+
icon,
|
|
105
|
+
children
|
|
106
|
+
}), /* @__PURE__ */ jsx("code", { children: meaning })]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function Page() {
|
|
110
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
111
|
+
title: "Badge",
|
|
112
|
+
status: "stable",
|
|
113
|
+
importNames: ["Badge"],
|
|
114
|
+
lead: "A small pill that labels a status, a count or a category. Reach for it when one or two words tell the merchant the state of something at a glance: Paid, Unfulfilled, 3 new.",
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
117
|
+
id: "tones",
|
|
118
|
+
title: "Tones",
|
|
119
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
120
|
+
"The tone is the meaning. ",
|
|
121
|
+
/* @__PURE__ */ jsx("code", { children: "neutral" }),
|
|
122
|
+
" is the default. The four status tones carry the same meaning everywhere in Orbit, so a merchant learns them once."
|
|
123
|
+
] }),
|
|
124
|
+
children: [/* @__PURE__ */ jsxs(Example, {
|
|
125
|
+
code: `
|
|
126
|
+
<Badge>Draft</Badge>
|
|
127
|
+
<Badge tone="accent">New</Badge>
|
|
128
|
+
<Badge tone="positive">Paid</Badge>
|
|
129
|
+
<Badge tone="negative">Refunded</Badge>
|
|
130
|
+
<Badge tone="warning">Low stock</Badge>
|
|
131
|
+
<Badge tone="info">Scheduled</Badge>`,
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ jsx(Badge, { children: "Draft" }),
|
|
134
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
135
|
+
tone: "accent",
|
|
136
|
+
children: "New"
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
139
|
+
tone: "positive",
|
|
140
|
+
children: "Paid"
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
143
|
+
tone: "negative",
|
|
144
|
+
children: "Refunded"
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
147
|
+
tone: "warning",
|
|
148
|
+
children: "Low stock"
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
151
|
+
tone: "info",
|
|
152
|
+
children: "Scheduled"
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
156
|
+
title: "What each tone means",
|
|
157
|
+
children: /* @__PURE__ */ jsx(DocTable, {
|
|
158
|
+
columns: [
|
|
159
|
+
"Tone",
|
|
160
|
+
"Means",
|
|
161
|
+
"For example"
|
|
162
|
+
],
|
|
163
|
+
rows: [
|
|
164
|
+
[
|
|
165
|
+
tone("neutral"),
|
|
166
|
+
"No judgement: not started, closed, or just a fact.",
|
|
167
|
+
"Draft, Cancelled, Archived"
|
|
168
|
+
],
|
|
169
|
+
[
|
|
170
|
+
tone("accent"),
|
|
171
|
+
"Orbit teal: what Orbit wants you to notice. New, live, a count asking for attention. Not a status.",
|
|
172
|
+
"New, Live, 3"
|
|
173
|
+
],
|
|
174
|
+
[
|
|
175
|
+
tone("positive"),
|
|
176
|
+
"Done and good. Nothing to do.",
|
|
177
|
+
"Paid, Fulfilled, In stock"
|
|
178
|
+
],
|
|
179
|
+
[
|
|
180
|
+
tone("negative"),
|
|
181
|
+
"Something failed, or money went back out.",
|
|
182
|
+
"Payment failed, Refunded, Disputed"
|
|
183
|
+
],
|
|
184
|
+
[
|
|
185
|
+
tone("warning"),
|
|
186
|
+
"Needs the merchant soon, or money is still owed.",
|
|
187
|
+
"Unfulfilled, Low stock, Awaiting payment"
|
|
188
|
+
],
|
|
189
|
+
[
|
|
190
|
+
tone("info"),
|
|
191
|
+
"Worth knowing, nothing to do.",
|
|
192
|
+
"Click and collect, Scheduled, Pre-order"
|
|
193
|
+
]
|
|
194
|
+
]
|
|
195
|
+
})
|
|
196
|
+
})]
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
199
|
+
id: "variants",
|
|
200
|
+
title: "Variants",
|
|
201
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
202
|
+
"Three materials. ",
|
|
203
|
+
/* @__PURE__ */ jsx("code", { children: "subtle" }),
|
|
204
|
+
" is the default and is right for status. ",
|
|
205
|
+
/* @__PURE__ */ jsx("code", { children: "solid" }),
|
|
206
|
+
" is for counts and the few states that must shout. ",
|
|
207
|
+
/* @__PURE__ */ jsx("code", { children: "outline" }),
|
|
208
|
+
" is for categories and quiet flags that sit beside a status without competing with it."
|
|
209
|
+
] }),
|
|
210
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
211
|
+
align: "start",
|
|
212
|
+
code: `
|
|
213
|
+
<Badge tone="positive">Paid</Badge>
|
|
214
|
+
<Badge tone="warning">Unfulfilled</Badge>
|
|
215
|
+
<Badge tone="negative">Refunded</Badge>
|
|
216
|
+
|
|
217
|
+
<Badge variant="solid" tone="accent">3</Badge>
|
|
218
|
+
<Badge variant="solid">12</Badge>
|
|
219
|
+
<Badge variant="solid" tone="negative">99+</Badge>
|
|
220
|
+
<Badge variant="solid" tone="negative">Overdue</Badge>
|
|
221
|
+
|
|
222
|
+
<Badge variant="outline">Trade</Badge>
|
|
223
|
+
<Badge variant="outline" tone="info">Pre-order</Badge>
|
|
224
|
+
<Badge variant="outline" tone="warning">Sample data</Badge>`,
|
|
225
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
226
|
+
className: "badge-rows",
|
|
227
|
+
children: [
|
|
228
|
+
/* @__PURE__ */ jsxs("div", {
|
|
229
|
+
className: "badge-row",
|
|
230
|
+
children: [
|
|
231
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
232
|
+
tone: "positive",
|
|
233
|
+
children: "Paid"
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
236
|
+
tone: "warning",
|
|
237
|
+
children: "Unfulfilled"
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
240
|
+
tone: "negative",
|
|
241
|
+
children: "Refunded"
|
|
242
|
+
})
|
|
243
|
+
]
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ jsxs("div", {
|
|
246
|
+
className: "badge-row",
|
|
247
|
+
children: [
|
|
248
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
249
|
+
variant: "solid",
|
|
250
|
+
tone: "accent",
|
|
251
|
+
children: "3"
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
254
|
+
variant: "solid",
|
|
255
|
+
children: "12"
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
258
|
+
variant: "solid",
|
|
259
|
+
tone: "negative",
|
|
260
|
+
children: "99+"
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
263
|
+
variant: "solid",
|
|
264
|
+
tone: "negative",
|
|
265
|
+
children: "Overdue"
|
|
266
|
+
})
|
|
267
|
+
]
|
|
268
|
+
}),
|
|
269
|
+
/* @__PURE__ */ jsxs("div", {
|
|
270
|
+
className: "badge-row",
|
|
271
|
+
children: [
|
|
272
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
273
|
+
variant: "outline",
|
|
274
|
+
children: "Trade"
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
277
|
+
variant: "outline",
|
|
278
|
+
tone: "info",
|
|
279
|
+
children: "Pre-order"
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
282
|
+
variant: "outline",
|
|
283
|
+
tone: "warning",
|
|
284
|
+
children: "Sample data"
|
|
285
|
+
})
|
|
286
|
+
]
|
|
287
|
+
})
|
|
288
|
+
]
|
|
289
|
+
})
|
|
290
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
291
|
+
title: "When to use each",
|
|
292
|
+
children: /* @__PURE__ */ jsx(DocTable, {
|
|
293
|
+
columns: ["Variant", "Use it for"],
|
|
294
|
+
rows: [
|
|
295
|
+
[/* @__PURE__ */ jsx("code", { children: "subtle" }), "Status in lists, rows and headers: a tinted pill with toned text. The default."],
|
|
296
|
+
[/* @__PURE__ */ jsx("code", { children: "solid" }), "Counts, and strong states such as Overdue. A single digit becomes a circle."],
|
|
297
|
+
[/* @__PURE__ */ jsx("code", { children: "outline" }), "Categories and quiet flags: Trade, Pre-order, VAT 20%, Sample data."]
|
|
298
|
+
]
|
|
299
|
+
})
|
|
300
|
+
})]
|
|
301
|
+
}),
|
|
302
|
+
/* @__PURE__ */ jsx(Section, {
|
|
303
|
+
id: "both-themes",
|
|
304
|
+
title: "In both themes",
|
|
305
|
+
description: /* @__PURE__ */ jsx("p", { children: "Every tone in every variant, light and dark side by side. In dark the washes deepen and the status hues lift, so toned text still reads as ink with a colour." }),
|
|
306
|
+
children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsx(BadgeMatrix, {}) })
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ jsx(Section, {
|
|
309
|
+
id: "sizes",
|
|
310
|
+
title: "Sizes",
|
|
311
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
312
|
+
/* @__PURE__ */ jsx("code", { children: "md" }),
|
|
313
|
+
" is 22px tall with 12px text, the default. ",
|
|
314
|
+
/* @__PURE__ */ jsx("code", { children: "sm" }),
|
|
315
|
+
" is 18px with 11px text, for dense table rows and beside 13px text."
|
|
316
|
+
] }),
|
|
317
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
318
|
+
align: "start",
|
|
319
|
+
code: `
|
|
320
|
+
<Badge tone="positive">Paid</Badge>
|
|
321
|
+
<Badge tone="warning" dot>Unfulfilled</Badge>
|
|
322
|
+
<Badge variant="outline">VAT 20%</Badge>
|
|
323
|
+
<Badge variant="solid" tone="accent">5</Badge>
|
|
324
|
+
|
|
325
|
+
<Badge size="sm" tone="positive">Paid</Badge>
|
|
326
|
+
<Badge size="sm" tone="warning" dot>Unfulfilled</Badge>
|
|
327
|
+
<Badge size="sm" variant="outline">VAT 20%</Badge>
|
|
328
|
+
<Badge size="sm" variant="solid" tone="accent">5</Badge>`,
|
|
329
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
330
|
+
className: "badge-rows",
|
|
331
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
332
|
+
className: "badge-row",
|
|
333
|
+
children: [
|
|
334
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
335
|
+
tone: "positive",
|
|
336
|
+
children: "Paid"
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
339
|
+
tone: "warning",
|
|
340
|
+
dot: true,
|
|
341
|
+
children: "Unfulfilled"
|
|
342
|
+
}),
|
|
343
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
344
|
+
variant: "outline",
|
|
345
|
+
children: "VAT 20%"
|
|
346
|
+
}),
|
|
347
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
348
|
+
variant: "solid",
|
|
349
|
+
tone: "accent",
|
|
350
|
+
children: "5"
|
|
351
|
+
})
|
|
352
|
+
]
|
|
353
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
354
|
+
className: "badge-row",
|
|
355
|
+
children: [
|
|
356
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
357
|
+
size: "sm",
|
|
358
|
+
tone: "positive",
|
|
359
|
+
children: "Paid"
|
|
360
|
+
}),
|
|
361
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
362
|
+
size: "sm",
|
|
363
|
+
tone: "warning",
|
|
364
|
+
dot: true,
|
|
365
|
+
children: "Unfulfilled"
|
|
366
|
+
}),
|
|
367
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
368
|
+
size: "sm",
|
|
369
|
+
variant: "outline",
|
|
370
|
+
children: "VAT 20%"
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
373
|
+
size: "sm",
|
|
374
|
+
variant: "solid",
|
|
375
|
+
tone: "accent",
|
|
376
|
+
children: "5"
|
|
377
|
+
})
|
|
378
|
+
]
|
|
379
|
+
})]
|
|
380
|
+
})
|
|
381
|
+
})
|
|
382
|
+
}),
|
|
383
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
384
|
+
id: "dot-and-pulse",
|
|
385
|
+
title: "Dot and pulse",
|
|
386
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
387
|
+
/* @__PURE__ */ jsx("code", { children: "dot" }),
|
|
388
|
+
" puts a small tone dot before the label. It helps the eye scan a column of mixed states by colour before reading, so use it for every badge in that column or none. ",
|
|
389
|
+
/* @__PURE__ */ jsx("code", { children: "pulse" }),
|
|
390
|
+
" makes the dot send out a ring on a loop, like a transmission: only for states that are live right now."
|
|
391
|
+
] }),
|
|
392
|
+
children: [/* @__PURE__ */ jsxs(Example, {
|
|
393
|
+
code: `
|
|
394
|
+
<Badge tone="warning" dot>Unfulfilled</Badge>
|
|
395
|
+
<Badge tone="positive" dot>Fulfilled</Badge>
|
|
396
|
+
<Badge dot>Paused</Badge>
|
|
397
|
+
<Badge tone="positive" pulse>Store live</Badge>
|
|
398
|
+
<Badge tone="accent" pulse>Syncing catalogue</Badge>`,
|
|
399
|
+
children: [
|
|
400
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
401
|
+
tone: "warning",
|
|
402
|
+
dot: true,
|
|
403
|
+
children: "Unfulfilled"
|
|
404
|
+
}),
|
|
405
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
406
|
+
tone: "positive",
|
|
407
|
+
dot: true,
|
|
408
|
+
children: "Fulfilled"
|
|
409
|
+
}),
|
|
410
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
411
|
+
dot: true,
|
|
412
|
+
children: "Paused"
|
|
413
|
+
}),
|
|
414
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
415
|
+
tone: "positive",
|
|
416
|
+
pulse: true,
|
|
417
|
+
children: "Store live"
|
|
418
|
+
}),
|
|
419
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
420
|
+
tone: "accent",
|
|
421
|
+
pulse: true,
|
|
422
|
+
children: "Syncing catalogue"
|
|
423
|
+
})
|
|
424
|
+
]
|
|
425
|
+
}), /* @__PURE__ */ jsx(Note, {
|
|
426
|
+
title: "Reduced motion",
|
|
427
|
+
children: "When the system asks for reduced motion the pulse stops sending rings and the dot breathes in place instead, so a live state still looks live."
|
|
428
|
+
})]
|
|
429
|
+
}),
|
|
430
|
+
/* @__PURE__ */ jsx(Section, {
|
|
431
|
+
id: "icons",
|
|
432
|
+
title: "With an icon",
|
|
433
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
434
|
+
/* @__PURE__ */ jsx("code", { children: "icon" }),
|
|
435
|
+
" leads the label at 12px (11px at ",
|
|
436
|
+
/* @__PURE__ */ jsx("code", { children: "sm" }),
|
|
437
|
+
"). Use one when the picture says something the word alone does not, such as how an order is being collected. The icon is decorative; the label still has to carry the meaning."
|
|
438
|
+
] }),
|
|
439
|
+
children: /* @__PURE__ */ jsxs(Example, {
|
|
440
|
+
code: `
|
|
441
|
+
<Badge tone="info" icon={<StorefrontIcon />}>Click and collect</Badge>
|
|
442
|
+
<Badge tone="warning" icon={<ClockIcon />}>Due today</Badge>
|
|
443
|
+
<Badge tone="accent" icon={<TagIcon />}>On sale</Badge>
|
|
444
|
+
<Badge variant="outline" icon={<ReceiptIcon />}>VAT invoice</Badge>`,
|
|
445
|
+
children: [
|
|
446
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
447
|
+
tone: "info",
|
|
448
|
+
icon: /* @__PURE__ */ jsx(StorefrontIcon, {}),
|
|
449
|
+
children: "Click and collect"
|
|
450
|
+
}),
|
|
451
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
452
|
+
tone: "warning",
|
|
453
|
+
icon: /* @__PURE__ */ jsx(ClockIcon, {}),
|
|
454
|
+
children: "Due today"
|
|
455
|
+
}),
|
|
456
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
457
|
+
tone: "accent",
|
|
458
|
+
icon: /* @__PURE__ */ jsx(TagIcon, {}),
|
|
459
|
+
children: "On sale"
|
|
460
|
+
}),
|
|
461
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
462
|
+
variant: "outline",
|
|
463
|
+
icon: /* @__PURE__ */ jsx(ReceiptIcon, {}),
|
|
464
|
+
children: "VAT invoice"
|
|
465
|
+
})
|
|
466
|
+
]
|
|
467
|
+
})
|
|
468
|
+
}),
|
|
469
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
470
|
+
id: "counts",
|
|
471
|
+
title: "Counts",
|
|
472
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
473
|
+
"A badge whose only content is a number, or a string of digits such as ",
|
|
474
|
+
/* @__PURE__ */ jsx("code", { children: "\"99+\"" }),
|
|
475
|
+
", is a count. A number is formatted the UK way (",
|
|
476
|
+
/* @__PURE__ */ jsx("code", { children: "{1204}" }),
|
|
477
|
+
" shows as 1,204); a string is shown as written. A solid count is compact, and a single digit becomes a circle. When the value changes the badge bumps once, never on first render. Press the buttons to see it."
|
|
478
|
+
] }),
|
|
479
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
480
|
+
code: `
|
|
481
|
+
const [count, setCount] = useState(7)
|
|
482
|
+
|
|
483
|
+
<span>Unfulfilled orders</span>
|
|
484
|
+
<Badge variant="solid" tone="accent">{count}</Badge>
|
|
485
|
+
<IconButton label="One fewer" size="sm" variant="secondary" onClick={() => setCount((n) => Math.max(0, n - 1))}>
|
|
486
|
+
<MinusIcon />
|
|
487
|
+
</IconButton>
|
|
488
|
+
<IconButton label="One more" size="sm" variant="secondary" onClick={() => setCount((n) => n + 1)}>
|
|
489
|
+
<PlusIcon />
|
|
490
|
+
</IconButton>`,
|
|
491
|
+
children: /* @__PURE__ */ jsx(LiveCount, {})
|
|
492
|
+
}), /* @__PURE__ */ jsxs(Example, {
|
|
493
|
+
code: `
|
|
494
|
+
<Badge variant="solid" tone="accent">3</Badge>
|
|
495
|
+
<Badge variant="solid">12</Badge>
|
|
496
|
+
<Badge variant="solid" tone="info">{1204}</Badge>
|
|
497
|
+
<Badge variant="solid" tone="negative">99+</Badge>
|
|
498
|
+
<Badge size="sm" variant="solid" tone="accent">5</Badge>`,
|
|
499
|
+
children: [
|
|
500
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
501
|
+
variant: "solid",
|
|
502
|
+
tone: "accent",
|
|
503
|
+
children: "3"
|
|
504
|
+
}),
|
|
505
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
506
|
+
variant: "solid",
|
|
507
|
+
children: "12"
|
|
508
|
+
}),
|
|
509
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
510
|
+
variant: "solid",
|
|
511
|
+
tone: "info",
|
|
512
|
+
children: 1204
|
|
513
|
+
}),
|
|
514
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
515
|
+
variant: "solid",
|
|
516
|
+
tone: "negative",
|
|
517
|
+
children: "99+"
|
|
518
|
+
}),
|
|
519
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
520
|
+
size: "sm",
|
|
521
|
+
variant: "solid",
|
|
522
|
+
tone: "accent",
|
|
523
|
+
children: "5"
|
|
524
|
+
})
|
|
525
|
+
]
|
|
526
|
+
})]
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
529
|
+
id: "order-statuses",
|
|
530
|
+
title: "Order statuses",
|
|
531
|
+
description: /* @__PURE__ */ jsx("p", { children: "The mapping for orders in Orbit Commerce's store dashboard. Pick the tone by what the merchant has to do next, not by how the word feels: warning when it needs them or money is still owed, negative when something failed or money went back out." }),
|
|
532
|
+
children: [/* @__PURE__ */ jsx(DocTable, {
|
|
533
|
+
columns: ["Status and tone", "Use it when"],
|
|
534
|
+
rows: [
|
|
535
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
536
|
+
tone: "positive",
|
|
537
|
+
children: "Paid"
|
|
538
|
+
}), "The money is in. Nothing to do."],
|
|
539
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
540
|
+
tone: "warning",
|
|
541
|
+
children: "Awaiting payment"
|
|
542
|
+
}), "The customer still owes it: a bank transfer, an invoice or a payment link."],
|
|
543
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
544
|
+
tone: "warning",
|
|
545
|
+
children: "Partially paid"
|
|
546
|
+
}), "A deposit is in and the balance is still owed."],
|
|
547
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
548
|
+
tone: "negative",
|
|
549
|
+
children: "Payment failed"
|
|
550
|
+
}), "The charge did not go through. Do not ship yet."],
|
|
551
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
552
|
+
tone: "negative",
|
|
553
|
+
children: "Disputed"
|
|
554
|
+
}), "The customer's bank has opened a chargeback, and it needs a reply."],
|
|
555
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
556
|
+
tone: "negative",
|
|
557
|
+
children: "Refunded"
|
|
558
|
+
}), "Money went back to the customer. A part refund says so: Partially refunded."],
|
|
559
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
560
|
+
tone: "warning",
|
|
561
|
+
children: "Unfulfilled"
|
|
562
|
+
}), "Paid and waiting to ship: the next job."],
|
|
563
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
564
|
+
tone: "warning",
|
|
565
|
+
children: "Partially fulfilled"
|
|
566
|
+
}), "Some items have shipped and the rest are waiting."],
|
|
567
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
568
|
+
tone: "positive",
|
|
569
|
+
children: "Fulfilled"
|
|
570
|
+
}), "Everything has shipped. Delivered works the same way."],
|
|
571
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
572
|
+
tone: "info",
|
|
573
|
+
icon: /* @__PURE__ */ jsx(StorefrontIcon, {}),
|
|
574
|
+
children: "Click and collect"
|
|
575
|
+
}), "How the order is reaching the customer. Useful to know, nothing to do."],
|
|
576
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
577
|
+
tone: "neutral",
|
|
578
|
+
children: "Draft"
|
|
579
|
+
}), "A draft order that has not been sent or paid."],
|
|
580
|
+
[/* @__PURE__ */ jsx(Status, {
|
|
581
|
+
tone: "neutral",
|
|
582
|
+
children: "Cancelled"
|
|
583
|
+
}), "Closed. Nothing more will happen."]
|
|
584
|
+
]
|
|
585
|
+
}), /* @__PURE__ */ jsxs(Note, {
|
|
586
|
+
title: "Teal is not a status",
|
|
587
|
+
children: [
|
|
588
|
+
"Orbit teal is the brand's line of light, not a state. Use ",
|
|
589
|
+
/* @__PURE__ */ jsx("code", { children: "accent" }),
|
|
590
|
+
" only when you mean Orbit's own emphasis: something new, something live, a count that wants attention. A paid order is",
|
|
591
|
+
" ",
|
|
592
|
+
/* @__PURE__ */ jsx("code", { children: "positive" }),
|
|
593
|
+
", never teal."
|
|
594
|
+
]
|
|
595
|
+
})]
|
|
596
|
+
}),
|
|
597
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
598
|
+
id: "guidelines",
|
|
599
|
+
title: "Guidelines",
|
|
600
|
+
children: [
|
|
601
|
+
/* @__PURE__ */ jsx(DoDont, {
|
|
602
|
+
do: {
|
|
603
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Badge, {
|
|
604
|
+
tone: "positive",
|
|
605
|
+
children: "Paid"
|
|
606
|
+
}), /* @__PURE__ */ jsx(Badge, {
|
|
607
|
+
variant: "solid",
|
|
608
|
+
tone: "accent",
|
|
609
|
+
children: "3"
|
|
610
|
+
})] }),
|
|
611
|
+
caption: "Status tones for status. Teal marks what Orbit wants you to notice, such as a count."
|
|
612
|
+
},
|
|
613
|
+
dont: {
|
|
614
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Badge, {
|
|
615
|
+
tone: "accent",
|
|
616
|
+
children: "Paid"
|
|
617
|
+
}), /* @__PURE__ */ jsx(Badge, {
|
|
618
|
+
tone: "accent",
|
|
619
|
+
children: "Fulfilled"
|
|
620
|
+
})] }),
|
|
621
|
+
caption: "A teal status reads as a brand label, and sits too close to the green of good states."
|
|
622
|
+
}
|
|
623
|
+
}),
|
|
624
|
+
/* @__PURE__ */ jsx(DoDont, {
|
|
625
|
+
do: {
|
|
626
|
+
children: /* @__PURE__ */ jsx(Badge, {
|
|
627
|
+
tone: "warning",
|
|
628
|
+
children: "Unfulfilled"
|
|
629
|
+
}),
|
|
630
|
+
caption: "One or two words that name the state."
|
|
631
|
+
},
|
|
632
|
+
dont: {
|
|
633
|
+
children: /* @__PURE__ */ jsx(Badge, {
|
|
634
|
+
tone: "warning",
|
|
635
|
+
children: "This order is still waiting to be sent out"
|
|
636
|
+
}),
|
|
637
|
+
caption: "A sentence in a pill is cut off in tables and makes a column hard to scan. Put detail in the row."
|
|
638
|
+
}
|
|
639
|
+
}),
|
|
640
|
+
/* @__PURE__ */ jsx(Guidelines, { items: [
|
|
641
|
+
"Sentence case, one or two words: \"Unfulfilled\", \"Awaiting payment\". Never all caps.",
|
|
642
|
+
"Keep the same word for the same state across the dashboard, so a filter, a badge and a message agree.",
|
|
643
|
+
"One status per column. A row can carry a payment badge and a fulfilment badge, each in its own column.",
|
|
644
|
+
"Pulse only for live states (a store taking orders, a sync running). A pulse that never stops means nothing.",
|
|
645
|
+
"A badge is a label, not a control. To filter by status, use a button or a segmented control."
|
|
646
|
+
] })
|
|
647
|
+
]
|
|
648
|
+
}),
|
|
649
|
+
/* @__PURE__ */ jsx(Section, {
|
|
650
|
+
id: "accessibility",
|
|
651
|
+
title: "Accessibility",
|
|
652
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
653
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
654
|
+
"Renders a plain ",
|
|
655
|
+
/* @__PURE__ */ jsx("code", { children: "span" }),
|
|
656
|
+
". Screen readers read its words in place, so the label must make sense on its own: the state, not a colour."
|
|
657
|
+
] }),
|
|
658
|
+
"Dots and icons are hidden from assistive tech. Colour is never the only signal, because the label names the state.",
|
|
659
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
660
|
+
"A count reads as just the number. Keep the words that give it meaning beside it (\"Unfulfilled orders 7\"), or add them in a visually hidden span with the ",
|
|
661
|
+
/* @__PURE__ */ jsx("code", { children: "o-sr-only" }),
|
|
662
|
+
" class next to the badge. Text inside the badge would stop it being treated as a count."
|
|
663
|
+
] }),
|
|
664
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
665
|
+
"A badge that needs explaining can sit inside a ",
|
|
666
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
667
|
+
to: "/components/tooltip",
|
|
668
|
+
children: "Tooltip"
|
|
669
|
+
}),
|
|
670
|
+
". Give it",
|
|
671
|
+
" ",
|
|
672
|
+
/* @__PURE__ */ jsxs("code", { children: ["tabIndex=", "{0}"] }),
|
|
673
|
+
" so keyboard users can reach it."
|
|
674
|
+
] }),
|
|
675
|
+
"Under reduced motion the pulse breathes in place and counts change without the bump."
|
|
676
|
+
] })
|
|
677
|
+
}),
|
|
678
|
+
/* @__PURE__ */ jsx(Section, {
|
|
679
|
+
id: "props",
|
|
680
|
+
title: "Props",
|
|
681
|
+
description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native span attribute." }),
|
|
682
|
+
children: /* @__PURE__ */ jsx(PropsTable, { rows: [
|
|
683
|
+
{
|
|
684
|
+
name: "tone",
|
|
685
|
+
type: "'neutral' | 'accent' | 'positive' | 'negative' | 'warning' | 'info'",
|
|
686
|
+
default: "'neutral'",
|
|
687
|
+
description: "What the badge means. Status tones are for status only."
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
name: "variant",
|
|
691
|
+
type: "'subtle' | 'solid' | 'outline'",
|
|
692
|
+
default: "'subtle'",
|
|
693
|
+
description: "Material: a tinted pill with toned text, a filled pill, or a hairline ring."
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
name: "size",
|
|
697
|
+
type: "'sm' | 'md'",
|
|
698
|
+
default: "'md'",
|
|
699
|
+
description: "18px with 11px text, or 22px with 12px text."
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: "dot",
|
|
703
|
+
type: "boolean",
|
|
704
|
+
default: "false",
|
|
705
|
+
description: "A tone dot before the label: 6px, or 5px at sm."
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
name: "pulse",
|
|
709
|
+
type: "boolean",
|
|
710
|
+
default: "false",
|
|
711
|
+
description: "The dot sends out a ring on a loop. Live states only. Implies dot."
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
name: "icon",
|
|
715
|
+
type: "ReactNode",
|
|
716
|
+
description: "Leading icon, 12px (11px at sm). Decorative."
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
name: "children",
|
|
720
|
+
type: "ReactNode",
|
|
721
|
+
description: "The label. A number, or a string of digits such as \"99+\", is treated as a count."
|
|
722
|
+
}
|
|
723
|
+
] })
|
|
724
|
+
})
|
|
725
|
+
]
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
//#endregion
|
|
729
|
+
export { Page, Preview };
|