@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.
Files changed (62) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +6 -2
  3. package/dist/docs.css +8260 -0
  4. package/dist/index.d.ts +33 -0
  5. package/dist/index.js +308 -0
  6. package/dist/pages/Playground-CNbBbErC.js +129 -0
  7. package/dist/pages/_figures-data-BDmScEny.js +606 -0
  8. package/dist/pages/_foundations-blXWyYh8.js +30 -0
  9. package/dist/pages/_overlays-specimens-Dpn6oiyH.js +310 -0
  10. package/dist/pages/alert-BD4e6QTh.js +769 -0
  11. package/dist/pages/app-shell-KbA-nRqZ.js +1479 -0
  12. package/dist/pages/area-chart-B91dLcGo.js +562 -0
  13. package/dist/pages/avatar-DPPHXJAu.js +713 -0
  14. package/dist/pages/badge-C9JR0thI.js +729 -0
  15. package/dist/pages/button-D3V912P4.js +518 -0
  16. package/dist/pages/calendar-DSDZ9nRH.js +630 -0
  17. package/dist/pages/card-DUggbis3.js +659 -0
  18. package/dist/pages/checkbox-DwimQaK3.js +365 -0
  19. package/dist/pages/colour-BwuO8xAv.js +1498 -0
  20. package/dist/pages/command-palette-xAD7fOg6.js +1243 -0
  21. package/dist/pages/date-picker-BYSa816m.js +1421 -0
  22. package/dist/pages/delta-CtAo0eIM.js +574 -0
  23. package/dist/pages/dialog-BRAf4LMh.js +1451 -0
  24. package/dist/pages/docs-BNOb7AqR.js +515 -0
  25. package/dist/pages/empty-state-C-mLrXW2.js +417 -0
  26. package/dist/pages/figure-tabs-CoPFzzKz.js +460 -0
  27. package/dist/pages/home-dashboard-CFQwDtC9.js +959 -0
  28. package/dist/pages/host-B6znjEgQ.js +109 -0
  29. package/dist/pages/icon-button-C9eSVPPW.js +861 -0
  30. package/dist/pages/icons-sxkTs5Ob.js +473 -0
  31. package/dist/pages/input-KF9Gkawf.js +1093 -0
  32. package/dist/pages/installation-DpsX8G_n.js +445 -0
  33. package/dist/pages/kbd-cNfDoikz.js +544 -0
  34. package/dist/pages/live-globe-ClvLn9Lb.js +571 -0
  35. package/dist/pages/logo-BfGF1Pq9.js +571 -0
  36. package/dist/pages/menu-by2sgQ09.js +1618 -0
  37. package/dist/pages/motion-BvTGc2Dk.js +855 -0
  38. package/dist/pages/orbit-spinner-Dil1Z3Oy.js +332 -0
  39. package/dist/pages/overview-BPEbZQ6g.js +130 -0
  40. package/dist/pages/pagination-BBUnGvv5.js +249 -0
  41. package/dist/pages/popover-Db1gLDpb.js +1136 -0
  42. package/dist/pages/principles-CeAIOIdt.js +483 -0
  43. package/dist/pages/radio-group-CkdBWWfG.js +1077 -0
  44. package/dist/pages/registry-CroHzK9I.js +244 -0
  45. package/dist/pages/release-Dvo684UJ.js +13 -0
  46. package/dist/pages/rolling-number-qmvH84Mq.js +529 -0
  47. package/dist/pages/search-field-BN7MWGQ4.js +693 -0
  48. package/dist/pages/segmented-control-CTbIpRBW.js +777 -0
  49. package/dist/pages/select-DguELoRR.js +1429 -0
  50. package/dist/pages/separator-CPZub9pv.js +351 -0
  51. package/dist/pages/shape-DKvA0YKr.js +627 -0
  52. package/dist/pages/skeleton-DLuBhP46.js +561 -0
  53. package/dist/pages/sparkline-DMMYGbHn.js +668 -0
  54. package/dist/pages/switch-B-Qe4kcT.js +517 -0
  55. package/dist/pages/table-AMoODng4.js +607 -0
  56. package/dist/pages/tabs-B4M-usCV.js +1455 -0
  57. package/dist/pages/textarea-fTuUZRQb.js +693 -0
  58. package/dist/pages/toast-CKP03zjy.js +1176 -0
  59. package/dist/pages/tooltip-CBYil3kt.js +697 -0
  60. package/dist/pages/typography-PCbg8Bhg.js +735 -0
  61. package/manifest.json +3125 -0
  62. package/package.json +35 -4
@@ -0,0 +1,713 @@
1
+ "use client";
2
+ 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";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { Avatar, AvatarGroup, initialsOf } from "@orbitcommerce/constellation";
5
+ //#region src/pages/components/avatar.tsx
6
+ var PEOPLE = [
7
+ "Imran Aziz",
8
+ "Amara Okafor",
9
+ "Priya Shah",
10
+ "Grace Liu",
11
+ "Rhys Evans",
12
+ "Callum Reid"
13
+ ];
14
+ var STORES = [
15
+ "Fernhill Interiors",
16
+ "Harbour Desk Co",
17
+ "Northgate Seating",
18
+ "Thistle & Oak",
19
+ "Linden Workspace",
20
+ "Wren Stationery"
21
+ ];
22
+ var svgUrl = (markup) => `data:image/svg+xml,${encodeURIComponent(markup)}`;
23
+ var wrenLogoUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\"><rect width=\"64\" height=\"64\" fill=\"#3d5a47\"/><text x=\"32\" y=\"43\" text-anchor=\"middle\" font-family=\"Georgia, serif\" font-size=\"30\" fill=\"#f2ede1\">W</text></svg>");
24
+ var lindenMarkUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\"><circle cx=\"32\" cy=\"32\" r=\"27\" fill=\"none\" stroke=\"#c0643a\" stroke-width=\"6\"/><text x=\"32\" y=\"43\" text-anchor=\"middle\" font-family=\"Georgia, serif\" font-size=\"29\" font-weight=\"700\" fill=\"#c0643a\">L</text></svg>");
25
+ /** An image that cannot be decoded, so the avatar falls back to initials. */
26
+ var urlThatFails = "data:image/png;base64,AAAA";
27
+ var mutedStrip = {
28
+ background: "var(--o-bg-muted)",
29
+ padding: 12,
30
+ borderRadius: 12
31
+ };
32
+ var mutedSurface = {
33
+ ...mutedStrip,
34
+ "--o-avatar-surface": "var(--o-bg-muted)"
35
+ };
36
+ function Preview() {
37
+ return /* @__PURE__ */ jsxs("div", {
38
+ className: "avatar-preview",
39
+ children: [/* @__PURE__ */ jsx(AvatarGroup, {
40
+ size: "lg",
41
+ max: 4,
42
+ children: PEOPLE.slice(0, 5).map((name) => /* @__PURE__ */ jsx(Avatar, { name }, name))
43
+ }), /* @__PURE__ */ jsxs("div", {
44
+ className: "avatar-preview__row",
45
+ children: [
46
+ /* @__PURE__ */ jsx(Avatar, {
47
+ size: "lg",
48
+ shape: "square",
49
+ name: "Harbour Desk Co"
50
+ }),
51
+ /* @__PURE__ */ jsx(Avatar, {
52
+ size: "lg",
53
+ name: "Priya Shah",
54
+ status: "online"
55
+ }),
56
+ /* @__PURE__ */ jsx(Avatar, {
57
+ size: "lg",
58
+ shape: "square",
59
+ name: "Linden Workspace"
60
+ })
61
+ ]
62
+ })]
63
+ });
64
+ }
65
+ function Team({ max, size }) {
66
+ return /* @__PURE__ */ jsx(AvatarGroup, {
67
+ max,
68
+ size,
69
+ "aria-label": "Staff on this order",
70
+ children: PEOPLE.map((name) => /* @__PURE__ */ jsx(Avatar, { name }, name))
71
+ });
72
+ }
73
+ function Page() {
74
+ return /* @__PURE__ */ jsxs(DocPage, {
75
+ title: "Avatar",
76
+ status: "stable",
77
+ importNames: [
78
+ "Avatar",
79
+ "AvatarGroup",
80
+ "initialsOf"
81
+ ],
82
+ lead: "A person or a store, as a small circle or square. It shows an image when there is one and initials on a quiet tint when there is not, so every customer, colleague and shop has a face in lists, menus and headers.",
83
+ children: [
84
+ /* @__PURE__ */ jsxs(Section, {
85
+ id: "sizes",
86
+ title: "Sizes",
87
+ description: /* @__PURE__ */ jsxs("p", { children: [
88
+ "Five sizes. ",
89
+ /* @__PURE__ */ jsx("code", { children: "md" }),
90
+ " is the default. Initials are set at 40% of the size, so they stay in proportion at every step."
91
+ ] }),
92
+ children: [/* @__PURE__ */ jsxs(Example, {
93
+ code: `
94
+ <Avatar size="xs" name="Priya Shah" />
95
+ <Avatar size="sm" name="Priya Shah" />
96
+ <Avatar name="Priya Shah" />
97
+ <Avatar size="lg" name="Priya Shah" />
98
+ <Avatar size="xl" name="Priya Shah" />`,
99
+ children: [
100
+ /* @__PURE__ */ jsx(Avatar, {
101
+ size: "xs",
102
+ name: "Priya Shah"
103
+ }),
104
+ /* @__PURE__ */ jsx(Avatar, {
105
+ size: "sm",
106
+ name: "Priya Shah"
107
+ }),
108
+ /* @__PURE__ */ jsx(Avatar, { name: "Priya Shah" }),
109
+ /* @__PURE__ */ jsx(Avatar, {
110
+ size: "lg",
111
+ name: "Priya Shah"
112
+ }),
113
+ /* @__PURE__ */ jsx(Avatar, {
114
+ size: "xl",
115
+ name: "Priya Shah"
116
+ })
117
+ ]
118
+ }), /* @__PURE__ */ jsx(DocTable, {
119
+ columns: [
120
+ "Size",
121
+ "Pixels",
122
+ "Use it for"
123
+ ],
124
+ rows: [
125
+ [
126
+ /* @__PURE__ */ jsx("code", { children: "xs" }),
127
+ "20",
128
+ "Inline with text, and in dense tables."
129
+ ],
130
+ [
131
+ /* @__PURE__ */ jsx("code", { children: "sm" }),
132
+ "24",
133
+ "Rows in lists and tables."
134
+ ],
135
+ [
136
+ /* @__PURE__ */ jsx("code", { children: "md" }),
137
+ "32",
138
+ "The default: menus, cards, activity."
139
+ ],
140
+ [
141
+ /* @__PURE__ */ jsx("code", { children: "lg" }),
142
+ "40",
143
+ "Page headers and summaries."
144
+ ],
145
+ [
146
+ /* @__PURE__ */ jsx("code", { children: "xl" }),
147
+ "56",
148
+ "A customer's or a colleague's own page."
149
+ ]
150
+ ]
151
+ })]
152
+ }),
153
+ /* @__PURE__ */ jsx(Section, {
154
+ id: "people-and-stores",
155
+ title: "People and stores",
156
+ description: /* @__PURE__ */ jsx("p", { children: "People are circles, the default. Stores, brands and suppliers are rounded squares, with corners at 28% of the size. The shape also changes the initials: a person takes their first and last name, a store its first two words, which is how shop names are shortened." }),
157
+ children: /* @__PURE__ */ jsx(Example, {
158
+ align: "fill",
159
+ code: `
160
+ <Avatar size="lg" name="Priya Shah" alt="" /> Priya Shah
161
+ <Avatar size="lg" name="Callum James Reid" alt="" /> Callum James Reid
162
+
163
+ <Avatar size="lg" shape="square" name="Harbour Desk Co" alt="" /> Harbour Desk Co
164
+ <Avatar size="lg" shape="square" name="The Copper Kettle Ltd" alt="" /> The Copper Kettle Ltd
165
+ <Avatar size="lg" shape="square" name="Thistle & Oak" alt="" /> Thistle & Oak`,
166
+ children: /* @__PURE__ */ jsx("div", {
167
+ className: "avatar-people",
168
+ children: [
169
+ {
170
+ name: "Priya Shah",
171
+ note: "PS: first and last name"
172
+ },
173
+ {
174
+ name: "Callum James Reid",
175
+ note: "CR: skips the middle name"
176
+ },
177
+ {
178
+ name: "Harbour Desk Co",
179
+ note: "HD: first two words",
180
+ store: true
181
+ },
182
+ {
183
+ name: "The Copper Kettle Ltd",
184
+ note: "CK: skips The and Ltd",
185
+ store: true
186
+ },
187
+ {
188
+ name: "Thistle & Oak",
189
+ note: "TO: skips the ampersand",
190
+ store: true
191
+ }
192
+ ].map((item) => /* @__PURE__ */ jsxs("span", {
193
+ className: "avatar-person",
194
+ children: [/* @__PURE__ */ jsx(Avatar, {
195
+ size: "lg",
196
+ shape: item.store ? "square" : "circle",
197
+ name: item.name,
198
+ alt: ""
199
+ }), /* @__PURE__ */ jsxs("span", { children: [item.name, /* @__PURE__ */ jsx("span", {
200
+ className: "avatar-person__meta",
201
+ children: item.note
202
+ })] })]
203
+ }, item.name))
204
+ })
205
+ })
206
+ }),
207
+ /* @__PURE__ */ jsxs(Section, {
208
+ id: "tints",
209
+ title: "Tints",
210
+ description: /* @__PURE__ */ jsx("p", { children: "Without an image, initials sit on one of six quiet tints: Orbit teal turned a little either way around the colour wheel, plus a slate. The tint is picked from the name, so the same person or shop gets the same colour everywhere, on every visit." }),
211
+ children: [/* @__PURE__ */ jsx(Example, {
212
+ code: `
213
+ <Avatar size="lg" name="Imran Aziz" />
214
+ <Avatar size="lg" name="Amara Okafor" />
215
+ <Avatar size="lg" name="Priya Shah" />
216
+ <Avatar size="lg" name="Grace Liu" />
217
+ <Avatar size="lg" name="Rhys Evans" />
218
+ <Avatar size="lg" name="Callum Reid" />
219
+
220
+ <Avatar size="lg" shape="square" name="Fernhill Interiors" />
221
+ {/* …one for each store */}`,
222
+ children: /* @__PURE__ */ jsxs("div", {
223
+ className: "avatar-rows",
224
+ children: [/* @__PURE__ */ jsx("div", {
225
+ className: "avatar-row",
226
+ children: PEOPLE.map((name) => /* @__PURE__ */ jsx(Avatar, {
227
+ size: "lg",
228
+ name
229
+ }, name))
230
+ }), /* @__PURE__ */ jsx("div", {
231
+ className: "avatar-row",
232
+ children: STORES.map((name) => /* @__PURE__ */ jsx(Avatar, {
233
+ size: "lg",
234
+ shape: "square",
235
+ name
236
+ }, name))
237
+ })]
238
+ })
239
+ }), /* @__PURE__ */ jsx(SubSection, {
240
+ title: "Choosing the tint yourself",
241
+ description: /* @__PURE__ */ jsxs("p", { children: [
242
+ "Pass ",
243
+ /* @__PURE__ */ jsx("code", { children: "seed" }),
244
+ ", such as a customer ID, when names can change or collide. Here two different customers share a name, and the seed tells them apart."
245
+ ] }),
246
+ children: /* @__PURE__ */ jsxs(Example, {
247
+ code: `
248
+ <Avatar size="lg" name="Priya Shah" seed="cus_1042" />
249
+ <Avatar size="lg" name="Priya Shah" seed="cus_2231" />`,
250
+ children: [/* @__PURE__ */ jsx(Avatar, {
251
+ size: "lg",
252
+ name: "Priya Shah",
253
+ seed: "cus_1042"
254
+ }), /* @__PURE__ */ jsx(Avatar, {
255
+ size: "lg",
256
+ name: "Priya Shah",
257
+ seed: "cus_2231"
258
+ })]
259
+ })
260
+ })]
261
+ }),
262
+ /* @__PURE__ */ jsx(Section, {
263
+ id: "status",
264
+ title: "Status",
265
+ description: /* @__PURE__ */ jsxs("p", { children: [
266
+ "A presence dot on the rim, for colleagues: ",
267
+ /* @__PURE__ */ jsx("code", { children: "online" }),
268
+ ", ",
269
+ /* @__PURE__ */ jsx("code", { children: "away" }),
270
+ " or ",
271
+ /* @__PURE__ */ jsx("code", { children: "busy" }),
272
+ ". Each has its own shape as well as its own colour (a solid dot, a ring, a dot with a bar), so it reads without colour. The dot scales with the avatar."
273
+ ] }),
274
+ children: /* @__PURE__ */ jsx(Example, {
275
+ code: `
276
+ <Avatar size="lg" name="Priya Shah" status="online" />
277
+ <Avatar size="lg" name="Callum Reid" status="away" />
278
+ <Avatar size="lg" name="Grace Liu" status="busy" />
279
+ <Avatar size="lg" shape="square" name="Thistle & Oak" status="online" />
280
+
281
+ <Avatar size="xs" name="Rhys Evans" status="online" />
282
+ <Avatar size="sm" name="Rhys Evans" status="away" />
283
+ <Avatar name="Rhys Evans" status="busy" />
284
+ <Avatar size="xl" name="Rhys Evans" status="online" />`,
285
+ children: /* @__PURE__ */ jsxs("div", {
286
+ className: "avatar-rows",
287
+ children: [/* @__PURE__ */ jsxs("div", {
288
+ className: "avatar-row",
289
+ children: [
290
+ /* @__PURE__ */ jsx(Avatar, {
291
+ size: "lg",
292
+ name: "Priya Shah",
293
+ status: "online"
294
+ }),
295
+ /* @__PURE__ */ jsx(Avatar, {
296
+ size: "lg",
297
+ name: "Callum Reid",
298
+ status: "away"
299
+ }),
300
+ /* @__PURE__ */ jsx(Avatar, {
301
+ size: "lg",
302
+ name: "Grace Liu",
303
+ status: "busy"
304
+ }),
305
+ /* @__PURE__ */ jsx(Avatar, {
306
+ size: "lg",
307
+ shape: "square",
308
+ name: "Thistle & Oak",
309
+ status: "online"
310
+ })
311
+ ]
312
+ }), /* @__PURE__ */ jsxs("div", {
313
+ className: "avatar-row",
314
+ children: [
315
+ /* @__PURE__ */ jsx(Avatar, {
316
+ size: "xs",
317
+ name: "Rhys Evans",
318
+ status: "online"
319
+ }),
320
+ /* @__PURE__ */ jsx(Avatar, {
321
+ size: "sm",
322
+ name: "Rhys Evans",
323
+ status: "away"
324
+ }),
325
+ /* @__PURE__ */ jsx(Avatar, {
326
+ name: "Rhys Evans",
327
+ status: "busy"
328
+ }),
329
+ /* @__PURE__ */ jsx(Avatar, {
330
+ size: "xl",
331
+ name: "Rhys Evans",
332
+ status: "online"
333
+ })
334
+ ]
335
+ })]
336
+ })
337
+ })
338
+ }),
339
+ /* @__PURE__ */ jsxs(Section, {
340
+ id: "images",
341
+ title: "Images and fallbacks",
342
+ description: /* @__PURE__ */ jsxs("p", { children: [
343
+ "Pass ",
344
+ /* @__PURE__ */ jsx("code", { children: "src" }),
345
+ " and the image fades in once it has loaded (a cached image shows at once). If it is missing or fails, the initials stay. Logos that must not touch the edge take ",
346
+ /* @__PURE__ */ jsx("code", { children: "fit=\"contain\"" }),
347
+ ": the mark is inset on the canvas colour. With no name at all, a quiet silhouette stands in for a person and a shopfront for a store."
348
+ ] }),
349
+ children: [/* @__PURE__ */ jsxs(Example, {
350
+ code: `
351
+ <Avatar size="lg" shape="square" name="Wren Stationery" src={wrenLogoUrl} />
352
+ <Avatar size="lg" shape="square" fit="contain" name="Linden Workspace" src={lindenMarkUrl} />
353
+ <Avatar size="lg" name="Hannah Doyle" src={urlThatFails} />
354
+ <Avatar size="lg" />
355
+ <Avatar size="lg" shape="square" />`,
356
+ children: [
357
+ /* @__PURE__ */ jsx(Avatar, {
358
+ size: "lg",
359
+ shape: "square",
360
+ name: "Wren Stationery",
361
+ src: wrenLogoUrl
362
+ }),
363
+ /* @__PURE__ */ jsx(Avatar, {
364
+ size: "lg",
365
+ shape: "square",
366
+ fit: "contain",
367
+ name: "Linden Workspace",
368
+ src: lindenMarkUrl
369
+ }),
370
+ /* @__PURE__ */ jsx(Avatar, {
371
+ size: "lg",
372
+ name: "Hannah Doyle",
373
+ src: urlThatFails
374
+ }),
375
+ /* @__PURE__ */ jsx(Avatar, { size: "lg" }),
376
+ /* @__PURE__ */ jsx(Avatar, {
377
+ size: "lg",
378
+ shape: "square"
379
+ })
380
+ ]
381
+ }), /* @__PURE__ */ jsx(Note, {
382
+ title: "Logos in dark",
383
+ children: "A contained logo sits on the canvas colour, which is near black in dark. A dark logo on a clear ground disappears there: ask for a mark that reads on both, or pass the right file for each theme."
384
+ })]
385
+ }),
386
+ /* @__PURE__ */ jsxs(Section, {
387
+ id: "groups",
388
+ title: "Groups",
389
+ description: /* @__PURE__ */ jsxs("p", { children: [
390
+ /* @__PURE__ */ jsx("code", { children: "AvatarGroup" }),
391
+ " overlaps avatars, each cut out of the one beneath by a ring in the surface colour. It sets the size and shape for all of them. With ",
392
+ /* @__PURE__ */ jsx("code", { children: "max" }),
393
+ ", the rest collapse into a +N chip. Point at one and it comes forward."
394
+ ] }),
395
+ children: [/* @__PURE__ */ jsxs(Example, {
396
+ code: `
397
+ <AvatarGroup max={4} aria-label="Staff on this order">
398
+ <Avatar name="Imran Aziz" />
399
+ <Avatar name="Amara Okafor" />
400
+ <Avatar name="Priya Shah" />
401
+ <Avatar name="Grace Liu" />
402
+ <Avatar name="Rhys Evans" />
403
+ <Avatar name="Callum Reid" />
404
+ </AvatarGroup>
405
+
406
+ <AvatarGroup size="sm" shape="square" max={3} aria-label="Your stores">
407
+ {stores.map((name) => <Avatar key={name} name={name} />)}
408
+ </AvatarGroup>
409
+
410
+ <AvatarGroup size="lg" aria-label="Viewing this order">
411
+ <Avatar name="Priya Shah" />
412
+ <Avatar name="Grace Liu" />
413
+ <Avatar name="Callum Reid" />
414
+ </AvatarGroup>`,
415
+ children: [
416
+ /* @__PURE__ */ jsx(Team, { max: 4 }),
417
+ /* @__PURE__ */ jsx(AvatarGroup, {
418
+ size: "sm",
419
+ shape: "square",
420
+ max: 3,
421
+ "aria-label": "Your stores",
422
+ children: STORES.map((name) => /* @__PURE__ */ jsx(Avatar, { name }, name))
423
+ }),
424
+ /* @__PURE__ */ jsxs(AvatarGroup, {
425
+ size: "lg",
426
+ "aria-label": "Viewing this order",
427
+ children: [
428
+ /* @__PURE__ */ jsx(Avatar, { name: "Priya Shah" }),
429
+ /* @__PURE__ */ jsx(Avatar, { name: "Grace Liu" }),
430
+ /* @__PURE__ */ jsx(Avatar, { name: "Callum Reid" })
431
+ ]
432
+ })
433
+ ]
434
+ }), /* @__PURE__ */ jsx(SubSection, {
435
+ title: "On other surfaces",
436
+ description: /* @__PURE__ */ jsxs("p", { children: [
437
+ "The rings and status dots are cut in the colour of the surface behind them: the canvas by default, and sunken cards set their own. On any other surface, set ",
438
+ /* @__PURE__ */ jsx("code", { children: "--o-avatar-surface" }),
439
+ " on a parent to that surface's colour, or the cut-outs show as halos."
440
+ ] }),
441
+ children: /* @__PURE__ */ jsx(Example, {
442
+ code: `
443
+ <div style={{ background: 'var(--o-bg-muted)', '--o-avatar-surface': 'var(--o-bg-muted)' }}>
444
+ <AvatarGroup max={4} aria-label="Staff on this order">…</AvatarGroup>
445
+ </div>`,
446
+ children: /* @__PURE__ */ jsx("div", {
447
+ style: mutedSurface,
448
+ children: /* @__PURE__ */ jsx(Team, { max: 4 })
449
+ })
450
+ })
451
+ })]
452
+ }),
453
+ /* @__PURE__ */ jsx(Section, {
454
+ id: "both-themes",
455
+ title: "In both themes",
456
+ description: /* @__PURE__ */ jsx("p", { children: "All six tints for people and for stores, with status and a group, light and dark side by side." }),
457
+ children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsxs("div", {
458
+ className: "avatar-rows",
459
+ children: [
460
+ /* @__PURE__ */ jsx("div", {
461
+ className: "avatar-row",
462
+ children: PEOPLE.map((name) => /* @__PURE__ */ jsx(Avatar, {
463
+ size: "lg",
464
+ name
465
+ }, name))
466
+ }),
467
+ /* @__PURE__ */ jsx("div", {
468
+ className: "avatar-row",
469
+ children: STORES.map((name) => /* @__PURE__ */ jsx(Avatar, {
470
+ size: "lg",
471
+ shape: "square",
472
+ name
473
+ }, name))
474
+ }),
475
+ /* @__PURE__ */ jsxs("div", {
476
+ className: "avatar-row",
477
+ children: [
478
+ /* @__PURE__ */ jsx(Avatar, {
479
+ size: "lg",
480
+ name: "Priya Shah",
481
+ status: "online"
482
+ }),
483
+ /* @__PURE__ */ jsx(Avatar, {
484
+ size: "lg",
485
+ name: "Callum Reid",
486
+ status: "away"
487
+ }),
488
+ /* @__PURE__ */ jsx(Avatar, {
489
+ size: "lg",
490
+ name: "Grace Liu",
491
+ status: "busy"
492
+ }),
493
+ /* @__PURE__ */ jsx(Team, { max: 3 })
494
+ ]
495
+ })
496
+ ]
497
+ }) })
498
+ }),
499
+ /* @__PURE__ */ jsx(Section, {
500
+ id: "initials",
501
+ title: "Initials",
502
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "initialsOf(name, kind)" }), " is the function the avatar uses, exported for anywhere else you need the same letters. It drops company suffixes (Ltd, Limited, LLP, PLC, Inc), a leading \"The\" and stray punctuation, and keeps accented letters."] }),
503
+ children: /* @__PURE__ */ jsx(DocTable, {
504
+ columns: [
505
+ "Name",
506
+ "As a person",
507
+ "As a store"
508
+ ],
509
+ rows: [
510
+ "Priya Shah",
511
+ "Callum James Reid",
512
+ "Harbour Desk Co",
513
+ "The Copper Kettle Ltd",
514
+ "Thistle & Oak",
515
+ "Élodie Durand",
516
+ "Fernhill"
517
+ ].map((name) => [
518
+ name,
519
+ /* @__PURE__ */ jsx("code", { children: `'${initialsOf(name)}'` }),
520
+ /* @__PURE__ */ jsx("code", { children: `'${initialsOf(name, "store")}'` })
521
+ ])
522
+ })
523
+ }),
524
+ /* @__PURE__ */ jsxs(Section, {
525
+ id: "guidelines",
526
+ title: "Guidelines",
527
+ children: [
528
+ /* @__PURE__ */ jsx(DoDont, {
529
+ do: {
530
+ children: /* @__PURE__ */ jsx(Avatar, {
531
+ size: "lg",
532
+ shape: "square",
533
+ name: "Harbour Desk Co"
534
+ }),
535
+ caption: "A store is a rounded square, and its initials come from its first two words: HD."
536
+ },
537
+ dont: {
538
+ children: /* @__PURE__ */ jsx(Avatar, {
539
+ size: "lg",
540
+ name: "Harbour Desk Co"
541
+ }),
542
+ caption: "As a circle it reads as a person, and takes the first and last words: HC."
543
+ }
544
+ }),
545
+ /* @__PURE__ */ jsx(DoDont, {
546
+ do: {
547
+ children: /* @__PURE__ */ jsx("div", {
548
+ style: mutedSurface,
549
+ children: /* @__PURE__ */ jsx(Team, { max: 4 })
550
+ }),
551
+ caption: "On a surface of your own, set --o-avatar-surface so the cut-outs match it."
552
+ },
553
+ dont: {
554
+ children: /* @__PURE__ */ jsx("div", {
555
+ style: mutedStrip,
556
+ children: /* @__PURE__ */ jsx(Team, { max: 4 })
557
+ }),
558
+ caption: "Left on the canvas colour, the rings show as white halos on the grey."
559
+ }
560
+ }),
561
+ /* @__PURE__ */ jsx(Guidelines, { items: [
562
+ "Always pass name, even with an image: it names the avatar, and it is the fallback when the image fails.",
563
+ "Use status for colleagues only. A customer does not have a presence.",
564
+ "Keep a group to what fits: max={3} or max={4}, and let the +N chip say the rest.",
565
+ "Put the name beside the avatar in lists. An avatar alone is a face, not an answer."
566
+ ] })
567
+ ]
568
+ }),
569
+ /* @__PURE__ */ jsx(Section, {
570
+ id: "accessibility",
571
+ title: "Accessibility",
572
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
573
+ /* @__PURE__ */ jsxs(Fragment, { children: [
574
+ "The avatar is an image named by ",
575
+ /* @__PURE__ */ jsx("code", { children: "name" }),
576
+ " (or ",
577
+ /* @__PURE__ */ jsx("code", { children: "alt" }),
578
+ "), with its status: \"Priya Shah (Online)\". The picture inside has an empty alt, so the name is read once."
579
+ ] }),
580
+ /* @__PURE__ */ jsxs(Fragment, { children: [
581
+ "When the name is written beside it, pass ",
582
+ /* @__PURE__ */ jsx("code", { children: "alt=\"\"" }),
583
+ ". The initials still come from",
584
+ " ",
585
+ /* @__PURE__ */ jsx("code", { children: "name" }),
586
+ ", and the avatar is hidden from screen readers so the name is not read twice."
587
+ ] }),
588
+ /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("code", { children: "statusLabel" }), " replaces the words read for the status, for translations."] }),
589
+ /* @__PURE__ */ jsxs(Fragment, { children: [
590
+ "A group has the ",
591
+ /* @__PURE__ */ jsx("code", { children: "group" }),
592
+ " role: name it with ",
593
+ /* @__PURE__ */ jsx("code", { children: "aria-label" }),
594
+ " (\"Staff on this order\"). The +N chip reads as \"2 more\"; ",
595
+ /* @__PURE__ */ jsx("code", { children: "overflowLabel" }),
596
+ " translates it."
597
+ ] }),
598
+ "The lift on hover in a group is dropped under reduced motion."
599
+ ] })
600
+ }),
601
+ /* @__PURE__ */ jsxs(Section, {
602
+ id: "props",
603
+ title: "Props",
604
+ children: [
605
+ /* @__PURE__ */ jsx(PropsTable, {
606
+ title: "Avatar",
607
+ rows: [
608
+ {
609
+ name: "name",
610
+ type: "string",
611
+ description: "Person or store name: the accessible name, the initials and the tint come from it."
612
+ },
613
+ {
614
+ name: "src",
615
+ type: "string | null",
616
+ description: "Image URL. Falls back to initials if it is missing or fails to load."
617
+ },
618
+ {
619
+ name: "alt",
620
+ type: "string",
621
+ description: "Accessible name when it should differ from name. An empty string hides the avatar from screen readers."
622
+ },
623
+ {
624
+ name: "size",
625
+ type: "'xs' | 'sm' | 'md' | 'lg' | 'xl'",
626
+ default: "'md'",
627
+ description: "20, 24, 32, 40 or 56px. Inherited from an AvatarGroup."
628
+ },
629
+ {
630
+ name: "shape",
631
+ type: "'circle' | 'square'",
632
+ default: "'circle'",
633
+ description: "Circle for people, square for stores and brands. Inherited from an AvatarGroup."
634
+ },
635
+ {
636
+ name: "fit",
637
+ type: "'cover' | 'contain'",
638
+ default: "'cover'",
639
+ description: "contain insets the image on the canvas colour, for logos."
640
+ },
641
+ {
642
+ name: "status",
643
+ type: "'online' | 'away' | 'busy'",
644
+ description: "Presence dot on the rim, included in the accessible name."
645
+ },
646
+ {
647
+ name: "statusLabel",
648
+ type: "string",
649
+ description: "Words read for the status. Defaults to \"Online\", \"Away\" or \"Busy\"."
650
+ },
651
+ {
652
+ name: "seed",
653
+ type: "string",
654
+ description: "Picks the tint instead of name, e.g. a stable customer ID."
655
+ }
656
+ ]
657
+ }),
658
+ /* @__PURE__ */ jsx("p", {
659
+ className: "doc-section__description",
660
+ children: "Avatar also accepts every native span attribute except children."
661
+ }),
662
+ /* @__PURE__ */ jsx(PropsTable, {
663
+ title: "AvatarGroup",
664
+ rows: [
665
+ {
666
+ name: "max",
667
+ type: "number",
668
+ description: "Most avatars to show. The rest collapse into a +N chip."
669
+ },
670
+ {
671
+ name: "size",
672
+ type: "'xs' | 'sm' | 'md' | 'lg' | 'xl'",
673
+ default: "'md'",
674
+ description: "Size for every avatar in the group."
675
+ },
676
+ {
677
+ name: "shape",
678
+ type: "'circle' | 'square'",
679
+ description: "Shape for every avatar in the group, unless one sets its own."
680
+ },
681
+ {
682
+ name: "overflowLabel",
683
+ type: "(hidden: number) => string",
684
+ default: "(n) => `${n} more`",
685
+ description: "Accessible text for the +N chip."
686
+ }
687
+ ]
688
+ }),
689
+ /* @__PURE__ */ jsx("p", {
690
+ className: "doc-section__description",
691
+ children: "AvatarGroup also accepts every native div attribute."
692
+ }),
693
+ /* @__PURE__ */ jsx(PropsTable, {
694
+ title: "initialsOf(name, kind)",
695
+ rows: [{
696
+ name: "name",
697
+ type: "string",
698
+ required: true,
699
+ description: "The name to shorten. Returns an empty string when there is nothing to use."
700
+ }, {
701
+ name: "kind",
702
+ type: "'person' | 'store'",
703
+ default: "'person'",
704
+ description: "First and last word for a person; first two words for a store."
705
+ }]
706
+ })
707
+ ]
708
+ })
709
+ ]
710
+ });
711
+ }
712
+ //#endregion
713
+ export { Page, Preview };