@charcuterie/ui 3.11.0 → 3.13.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/dist/Avatar/Avatar.d.ts +163 -0
- package/dist/Avatar/Avatar.d.ts.map +1 -0
- package/dist/Avatar/Avatar.js +139 -0
- package/dist/Avatar/Avatar.js.map +1 -0
- package/dist/Board/BoardLaneList.d.ts +29 -0
- package/dist/Board/BoardLaneList.d.ts.map +1 -1
- package/dist/Board/BoardLaneList.js +2 -1
- package/dist/Board/BoardLaneList.js.map +1 -1
- package/dist/CopyButton/CopyButton.d.ts +67 -0
- package/dist/CopyButton/CopyButton.d.ts.map +1 -0
- package/dist/CopyButton/CopyButton.js +76 -0
- package/dist/CopyButton/CopyButton.js.map +1 -0
- package/dist/CopyButton/copyText.d.ts +23 -0
- package/dist/CopyButton/copyText.d.ts.map +1 -0
- package/dist/CopyButton/copyText.js +65 -0
- package/dist/CopyButton/copyText.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Avatar/Avatar.mdx +92 -0
- package/src/Avatar/Avatar.stories.tsx +254 -0
- package/src/Avatar/Avatar.test.tsx +143 -0
- package/src/Avatar/Avatar.tsx +270 -0
- package/src/Board/Board.mdx +26 -0
- package/src/Board/Board.stories.tsx +47 -21
- package/src/Board/Board.test.tsx +62 -0
- package/src/Board/BoardLaneList.tsx +52 -1
- package/src/CopyButton/CopyButton.mdx +84 -0
- package/src/CopyButton/CopyButton.stories.tsx +111 -0
- package/src/CopyButton/CopyButton.test.tsx +227 -0
- package/src/CopyButton/CopyButton.tsx +155 -0
- package/src/CopyButton/copyText.ts +68 -0
- package/src/index.ts +11 -0
- package/src/sourceRules.test.ts +15 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyText.js","sourceRoot":"","sources":["../../src/CopyButton/copyText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AACH,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ export type { BlockSizeResolver, ColumnPersistence, } from "./AdaptiveGrid/useAd
|
|
|
40
40
|
export { localStorageColumnPersistence, readStoredChoice, useAdaptiveColumns, viewportBlockSizeResolver, } from "./AdaptiveGrid/useAdaptiveColumns.ts";
|
|
41
41
|
export type { AlertProps, AlertSize, } from "./Alert/Alert.tsx";
|
|
42
42
|
export { Alert } from "./Alert/Alert.tsx";
|
|
43
|
+
export type { AvatarProps, AvatarSize, } from "./Avatar/Avatar.tsx";
|
|
44
|
+
export { Avatar } from "./Avatar/Avatar.tsx";
|
|
43
45
|
export type { BadgeProps } from "./Badge/Badge.tsx";
|
|
44
46
|
export { Badge } from "./Badge/Badge.tsx";
|
|
45
47
|
export type { BadgeShapeProps } from "./Badge/useBadgeShape.tsx";
|
|
@@ -66,6 +68,9 @@ export type { ColorSchemeIcons, ColorSchemeToggleProps, } from "./ColorSchemeTog
|
|
|
66
68
|
export { ColorSchemeToggle } from "./ColorSchemeToggle/ColorSchemeToggle.tsx";
|
|
67
69
|
export type { ComboboxProps } from "./Combobox/Combobox.tsx";
|
|
68
70
|
export { Combobox } from "./Combobox/Combobox.tsx";
|
|
71
|
+
export type { CopyButtonProps, CopyStatus, } from "./CopyButton/CopyButton.tsx";
|
|
72
|
+
export { CopyButton } from "./CopyButton/CopyButton.tsx";
|
|
73
|
+
export { copyText } from "./CopyButton/copyText.ts";
|
|
69
74
|
export { CATEGORICAL_APPEARANCE_CLASS, CATEGORICAL_CONTENT_CLASS, CATEGORICAL_HOVER_CLASS, CATEGORICAL_SOLID_FILL_CLASS, } from "./categoricalStyles.ts";
|
|
70
75
|
export type { BadgeSize } from "./controlStyles.ts";
|
|
71
76
|
export { BADGE_SIZE_CLASS, CONTROL_BASE_CLASS, CONTROL_SIZE_CLASS, DOT_SIZE_CLASS, getControlClassName, ICON_CONTROL_SIZE_CLASS, MIN_TOUCH_TARGET_CLASS, SPINNER_SIZE_CLASS, } from "./controlStyles.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,cAAc,GACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,iCAAiC,CAAA;AACxC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,sCAAsC,CAAA;AAC7C,YAAY,EACV,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,YAAY,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,YAAY,EACV,SAAS,EACT,UAAU,GACX,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,m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M,uBAAuB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAClE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ export { AdaptiveGrid } from "./AdaptiveGrid/AdaptiveGrid.js";
|
|
|
35
35
|
export { chooseColumns, DEFAULT_MAX_AUTO_COLUMNS, DEFAULT_MAX_MANUAL_COLUMNS, DEFAULT_MIN_COLUMN_INLINE_SIZE_PX, getColumnChoices, getContentMaxInlineSize, } from "./AdaptiveGrid/chooseColumns.js";
|
|
36
36
|
export { localStorageColumnPersistence, readStoredChoice, useAdaptiveColumns, viewportBlockSizeResolver, } from "./AdaptiveGrid/useAdaptiveColumns.js";
|
|
37
37
|
export { Alert } from "./Alert/Alert.js";
|
|
38
|
+
export { Avatar } from "./Avatar/Avatar.js";
|
|
38
39
|
export { Badge } from "./Badge/Badge.js";
|
|
39
40
|
export { BadgeButton } from "./BadgeButton/BadgeButton.js";
|
|
40
41
|
export { Board } from "./Board/Board.js";
|
|
@@ -46,6 +47,8 @@ export { Checkbox } from "./Checkbox/Checkbox.js";
|
|
|
46
47
|
export { ColorSchemeSwitcher } from "./ColorSchemeSwitcher/ColorSchemeSwitcher.js";
|
|
47
48
|
export { ColorSchemeToggle } from "./ColorSchemeToggle/ColorSchemeToggle.js";
|
|
48
49
|
export { Combobox } from "./Combobox/Combobox.js";
|
|
50
|
+
export { CopyButton } from "./CopyButton/CopyButton.js";
|
|
51
|
+
export { copyText } from "./CopyButton/copyText.js";
|
|
49
52
|
export { CATEGORICAL_APPEARANCE_CLASS, CATEGORICAL_CONTENT_CLASS, CATEGORICAL_HOVER_CLASS, CATEGORICAL_SOLID_FILL_CLASS, } from "./categoricalStyles.js";
|
|
50
53
|
export { BADGE_SIZE_CLASS, CONTROL_BASE_CLASS, CONTROL_SIZE_CLASS, DOT_SIZE_CLASS, getControlClassName, ICON_CONTROL_SIZE_CLASS, MIN_TOUCH_TARGET_CLASS, SPINNER_SIZE_CLASS, } from "./controlStyles.js";
|
|
51
54
|
export { DataTable } from "./DataTable/DataTable.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAOH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA2B,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAiC,CAAA;AAE9D,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,iCAAiC,CAAA;AAKxC,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,sCAAsC,CAAA;AAK7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAOH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA2B,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAiC,CAAA;AAE9D,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,iCAAi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O,EAAE,OAAO,EAAE,MAAM,sBAAuB,CAAA;AAO/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAuB,CAAA;AAM/C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAqB,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAqB,CAAA;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAO1B,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAiB,CAAA;AAKtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAyB,CAAA;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAmB,CAAA;AAKzC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAyB,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAOpE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAuB,CAAA;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAuB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAuC,CAAA;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAqC,CAAA"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Canvas, Controls, Meta } from "@storybook/addon-docs/blocks";
|
|
2
|
+
|
|
3
|
+
import * as AvatarStories from "./Avatar.stories";
|
|
4
|
+
|
|
5
|
+
<Meta of={AvatarStories} />
|
|
6
|
+
|
|
7
|
+
# Avatar
|
|
8
|
+
|
|
9
|
+
A person, as a coloured chip — a glyph or an initial, with the name attached where only
|
|
10
|
+
assistive technology and a hover can reach it. It exists to **delete a printed name**: a
|
|
11
|
+
board whose cards all say "Owner" has spent a column on a word that a colour says faster.
|
|
12
|
+
|
|
13
|
+
<Canvas of={AvatarStories.Default} />
|
|
14
|
+
|
|
15
|
+
## Props
|
|
16
|
+
|
|
17
|
+
<Controls />
|
|
18
|
+
|
|
19
|
+
## Unassigned draws nothing, and the component owns that
|
|
20
|
+
|
|
21
|
+
`name` accepts `null` and `undefined`, and either one renders `null`. That is the decision,
|
|
22
|
+
not an accident of the type.
|
|
23
|
+
|
|
24
|
+
A grey "None" placeholder is a design system talking over the reader: it repeats a fact
|
|
25
|
+
nobody needed, down every unassigned row, at the same visual weight as the chips that mean
|
|
26
|
+
something. The alternative — a ternary at every call site — puts the same decision in a
|
|
27
|
+
board, a table, a card footer and a detail pane, each written on a different day, and the
|
|
28
|
+
one that forgets is the one that ships the grey circle. Absence is expressed once, here.
|
|
29
|
+
It is the same call `Board` makes with `onMove`: no handler means no affordance rather than
|
|
30
|
+
a dead one.
|
|
31
|
+
|
|
32
|
+
An app that genuinely wants to *say* "unassigned" still can. That is text, or an
|
|
33
|
+
`EmptyState`, and neither of them is an avatar.
|
|
34
|
+
|
|
35
|
+
Where a column of rows has to keep one start edge, **the layout reserves the slot** — a
|
|
36
|
+
grid column sized in `em` of the row's own type, which the unassigned row leaves empty.
|
|
37
|
+
That is a decision about alignment, made once by the thing that owns the alignment, rather
|
|
38
|
+
than a placeholder chip pretending to be data. `InAList` below is that composition.
|
|
39
|
+
|
|
40
|
+
Keep the wrapper. A component that returns `null` contributes **no grid item**, so a bare
|
|
41
|
+
`<Avatar>` in a grid cell lets the unassigned row's next element slide into the reserved
|
|
42
|
+
column — the one way this goes wrong, and it goes wrong silently.
|
|
43
|
+
|
|
44
|
+
## The name is never visible text
|
|
45
|
+
|
|
46
|
+
`role="img"` with an `aria-label`, exactly as `Swatch` does, so
|
|
47
|
+
`getByRole("img", { name })` is one stable handle whether the chip is showing a photo, a
|
|
48
|
+
glyph or two letters. `title` carries the same string for a pointer — the letters `AL` are
|
|
49
|
+
not a name, and hover is the only channel a sighted reader has.
|
|
50
|
+
|
|
51
|
+
There is deliberately no `isNameVisible`. An avatar with its name printed beside it is a
|
|
52
|
+
name with a decoration in front of it; a layout that wants that should print the name and
|
|
53
|
+
skip the chip.
|
|
54
|
+
|
|
55
|
+
## The colour is derived, never invented
|
|
56
|
+
|
|
57
|
+
<Canvas of={AvatarStories.AllVariants} />
|
|
58
|
+
|
|
59
|
+
`categorical` is the ten-wide non-semantic scale — the same one `Badge` takes — and **not**
|
|
60
|
+
an `intent`. An intent is a claim the design system makes about state, and a person is not
|
|
61
|
+
`danger`.
|
|
62
|
+
|
|
63
|
+
With no `categorical`, the index comes from `getCategoricalIndex` in
|
|
64
|
+
`@charcuterie/tokens`: a pure function of the key, so the same person is the same colour on
|
|
65
|
+
every machine, on every reload, and in a server render. Pass `categoricalKey` with the
|
|
66
|
+
user's **id** wherever one exists — the hash does no normalization on purpose, so hashing a
|
|
67
|
+
name means a rename or a trailing space silently repaints somebody the reader had already
|
|
68
|
+
learned to recognise.
|
|
69
|
+
|
|
70
|
+
Ten colours means collisions past ten people. That is a property of the palette rather than
|
|
71
|
+
a fault in the hash: the colour helps you *scan* a list, and the accessible name is what
|
|
72
|
+
identifies.
|
|
73
|
+
|
|
74
|
+
## A photo is never the only thing
|
|
75
|
+
|
|
76
|
+
<Canvas of={AvatarStories.AllStates} />
|
|
77
|
+
|
|
78
|
+
`imageUrl` is optional and falls back to the initials when it is absent, when it 404s, and
|
|
79
|
+
when a signed URL has expired. A hand-rolled avatar shows the browser's broken-image glyph
|
|
80
|
+
in all three, because nobody writes the `onError` handler until they have seen it happen.
|
|
81
|
+
|
|
82
|
+
The failed URL is stored rather than a `hasFailed` boolean, so a second photo gets its own
|
|
83
|
+
attempt with no effect syncing a prop back into state.
|
|
84
|
+
|
|
85
|
+
## There is no `AvatarGroup`
|
|
86
|
+
|
|
87
|
+
Deliberately. A stack of overlapping chips with a `+3` needs answers to which three
|
|
88
|
+
survive, in what order, and what the overflow announces — and no consumer has asked the
|
|
89
|
+
question yet. A row of `Avatar`s in a flex box is what a multi-assignee list looks like
|
|
90
|
+
until one does.
|
|
91
|
+
|
|
92
|
+
<Canvas of={AvatarStories.InAList} />
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
|
|
3
|
+
import { categoricalArgType } from "../argTypes.storyHelpers.ts"
|
|
4
|
+
import {
|
|
5
|
+
StoryCell,
|
|
6
|
+
StoryGrid,
|
|
7
|
+
StoryRow,
|
|
8
|
+
StorySection,
|
|
9
|
+
} from "../board.storyHelpers.tsx"
|
|
10
|
+
import { Card } from "../Card/Card.tsx"
|
|
11
|
+
import { Avatar } from "./Avatar.tsx"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* **Invented, every one of them.** The component was built for a
|
|
15
|
+
* household task board, so its real fixture is a list of the people
|
|
16
|
+
* who live there — which must never reach a published repo and
|
|
17
|
+
* doubly never a committed screenshot, because a PNG is opaque to
|
|
18
|
+
* every grep and no text scrub can redact it.
|
|
19
|
+
*
|
|
20
|
+
* So this is a fictional studio's roster: two-word names, a mononym,
|
|
21
|
+
* a name whose first character is outside the BMP, and a
|
|
22
|
+
* non-human account.
|
|
23
|
+
*/
|
|
24
|
+
const ROSTER = [
|
|
25
|
+
{ id: "user-1", name: "Ada Lovelace" },
|
|
26
|
+
{ id: "user-2", name: "Wren Okonkwo" },
|
|
27
|
+
{ id: "user-3", name: "Bo" },
|
|
28
|
+
{ id: "user-4", name: "Ines Marchetti" },
|
|
29
|
+
{ id: "user-5", name: "Tomas Ericsson" },
|
|
30
|
+
] as const
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A photo that needs no network and no fixture file. The initials
|
|
34
|
+
* behind it are what the reader sees the moment it is absent, which
|
|
35
|
+
* is the state that actually matters.
|
|
36
|
+
*/
|
|
37
|
+
const PORTRAIT_URL = `data:image/svg+xml;utf8,${encodeURIComponent(
|
|
38
|
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" fill="#2F6F4E"/><circle cx="32" cy="24" r="12" fill="#F2E8CF"/><rect x="12" y="40" width="40" height="28" rx="14" fill="#F2E8CF"/></svg>',
|
|
39
|
+
)}`
|
|
40
|
+
|
|
41
|
+
/** 404s, which is what makes the fallback real rather than mocked. */
|
|
42
|
+
const MISSING_PORTRAIT_URL =
|
|
43
|
+
"/charcuterie-missing-portrait.png"
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A stand-in for an app's own glyph set. The library ships none, so
|
|
47
|
+
* a story that wants one has to bring it — and a letter is the safe
|
|
48
|
+
* choice in a sandbox whose font may lack the symbol.
|
|
49
|
+
*/
|
|
50
|
+
const AgentGlyph = () => <span>{"AI"}</span>
|
|
51
|
+
|
|
52
|
+
const meta = {
|
|
53
|
+
title: "Components/Data/Avatar",
|
|
54
|
+
component: Avatar,
|
|
55
|
+
parameters: { layout: "padded" },
|
|
56
|
+
argTypes: { categorical: categoricalArgType },
|
|
57
|
+
args: {
|
|
58
|
+
appearance: "soft",
|
|
59
|
+
categorical: undefined,
|
|
60
|
+
categoricalKey: undefined,
|
|
61
|
+
icon: undefined,
|
|
62
|
+
imageUrl: undefined,
|
|
63
|
+
initials: undefined,
|
|
64
|
+
name: "Ada Lovelace",
|
|
65
|
+
size: "md",
|
|
66
|
+
},
|
|
67
|
+
} satisfies Meta<typeof Avatar>
|
|
68
|
+
|
|
69
|
+
export default meta
|
|
70
|
+
|
|
71
|
+
type Story = StoryObj<typeof meta>
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Two letters on a colour nobody chose. The name is on the chip for
|
|
75
|
+
* a screen reader and on hover for a pointer, and it is not printed
|
|
76
|
+
* anywhere — `getByRole("img", { name: "Ada Lovelace" })` resolves.
|
|
77
|
+
*/
|
|
78
|
+
export const Default: Story = {}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The three appearances, and the ten colours the scale holds.
|
|
82
|
+
*
|
|
83
|
+
* `soft` is the default because a lane of solid chips competes with
|
|
84
|
+
* the card titles beside them. `solid` is for a chip that is the
|
|
85
|
+
* only colour in its row; `outline` is the quiet one.
|
|
86
|
+
*/
|
|
87
|
+
export const AllVariants: Story = {
|
|
88
|
+
render: (avatarProps) => (
|
|
89
|
+
<StorySection title="The colour is a hash of the key, so the same person is the same colour on every machine and every reload.">
|
|
90
|
+
<StoryGrid columns={3}>
|
|
91
|
+
{(["soft", "outline", "solid"] as const).map(
|
|
92
|
+
(appearance) => (
|
|
93
|
+
<StoryCell key={appearance} label={appearance}>
|
|
94
|
+
<StoryRow>
|
|
95
|
+
{ROSTER.map((person) => (
|
|
96
|
+
<Avatar
|
|
97
|
+
{...avatarProps}
|
|
98
|
+
appearance={appearance}
|
|
99
|
+
categoricalKey={person.id}
|
|
100
|
+
key={person.id}
|
|
101
|
+
name={person.name}
|
|
102
|
+
/>
|
|
103
|
+
))}
|
|
104
|
+
</StoryRow>
|
|
105
|
+
</StoryCell>
|
|
106
|
+
),
|
|
107
|
+
)}
|
|
108
|
+
</StoryGrid>
|
|
109
|
+
</StorySection>
|
|
110
|
+
),
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Everything the chip can be showing, including the two that are
|
|
115
|
+
* easy to get wrong: a photo that does not load, and nobody at all.
|
|
116
|
+
*/
|
|
117
|
+
export const AllStates: Story = {
|
|
118
|
+
render: (avatarProps) => (
|
|
119
|
+
<StoryGrid columns={2}>
|
|
120
|
+
<StoryCell label="sizes">
|
|
121
|
+
<StoryRow>
|
|
122
|
+
<Avatar {...avatarProps} size="sm" />
|
|
123
|
+
|
|
124
|
+
<Avatar {...avatarProps} size="md" />
|
|
125
|
+
|
|
126
|
+
<Avatar {...avatarProps} size="lg" />
|
|
127
|
+
</StoryRow>
|
|
128
|
+
</StoryCell>
|
|
129
|
+
|
|
130
|
+
<StoryCell label="a mononym gets one letter">
|
|
131
|
+
<Avatar {...avatarProps} name="Bo" />
|
|
132
|
+
</StoryCell>
|
|
133
|
+
|
|
134
|
+
<StoryCell label="a glyph instead of the letters">
|
|
135
|
+
<Avatar
|
|
136
|
+
{...avatarProps}
|
|
137
|
+
icon={<AgentGlyph />}
|
|
138
|
+
name="Agentic"
|
|
139
|
+
/>
|
|
140
|
+
</StoryCell>
|
|
141
|
+
|
|
142
|
+
<StoryCell label="a chosen colour beats the hash">
|
|
143
|
+
<StoryRow>
|
|
144
|
+
<Avatar
|
|
145
|
+
{...avatarProps}
|
|
146
|
+
categorical={4}
|
|
147
|
+
name="Wren Okonkwo"
|
|
148
|
+
/>
|
|
149
|
+
|
|
150
|
+
<Avatar
|
|
151
|
+
{...avatarProps}
|
|
152
|
+
categorical={9}
|
|
153
|
+
name="Ines Marchetti"
|
|
154
|
+
/>
|
|
155
|
+
</StoryRow>
|
|
156
|
+
</StoryCell>
|
|
157
|
+
|
|
158
|
+
<StoryCell label="a photo, clipped to the circle">
|
|
159
|
+
<Avatar
|
|
160
|
+
{...avatarProps}
|
|
161
|
+
imageUrl={PORTRAIT_URL}
|
|
162
|
+
name="Tomas Ericsson"
|
|
163
|
+
size="lg"
|
|
164
|
+
/>
|
|
165
|
+
</StoryCell>
|
|
166
|
+
|
|
167
|
+
<StoryCell label="a photo that 404s falls back to the letters">
|
|
168
|
+
<Avatar
|
|
169
|
+
{...avatarProps}
|
|
170
|
+
imageUrl={MISSING_PORTRAIT_URL}
|
|
171
|
+
name="Kit Sandoval"
|
|
172
|
+
size="lg"
|
|
173
|
+
/>
|
|
174
|
+
</StoryCell>
|
|
175
|
+
|
|
176
|
+
<StoryCell label="unassigned draws nothing at all">
|
|
177
|
+
{/*
|
|
178
|
+
* There is no chip in this cell, and that is the assertion.
|
|
179
|
+
* A grey "None" placeholder is a fact nobody needed,
|
|
180
|
+
* repeated down every unassigned row at the same weight as
|
|
181
|
+
* the chips that mean something.
|
|
182
|
+
*/}
|
|
183
|
+
<Avatar {...avatarProps} name={null} />
|
|
184
|
+
</StoryCell>
|
|
185
|
+
</StoryGrid>
|
|
186
|
+
),
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The placement it was built for: a row per task, the chip answering
|
|
191
|
+
* "whose is this?" without spending a column on the word.
|
|
192
|
+
*
|
|
193
|
+
* The middle row is unassigned. It draws nothing, so the row is
|
|
194
|
+
* shorter by exactly one chip and says nothing false.
|
|
195
|
+
*/
|
|
196
|
+
export const InAList: Story = {
|
|
197
|
+
render: () => (
|
|
198
|
+
<Card heading="Today">
|
|
199
|
+
<ul className="flex list-none flex-col gap-2 p-0">
|
|
200
|
+
{[
|
|
201
|
+
{
|
|
202
|
+
assignee: ROSTER[0],
|
|
203
|
+
title:
|
|
204
|
+
"Fold the second scheduler into the broker",
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
assignee: undefined,
|
|
208
|
+
title: "Fingerprint duplicate uploads",
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
assignee: ROSTER[1],
|
|
212
|
+
title: "One composed Storybook for the fleet",
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
assignee: ROSTER[3],
|
|
216
|
+
title: "Retire the legacy rest_command bridge",
|
|
217
|
+
},
|
|
218
|
+
].map((task) => (
|
|
219
|
+
<li
|
|
220
|
+
/*
|
|
221
|
+
* The chip's slot is **reserved by the layout**, in `em`
|
|
222
|
+
* of the row's own type, and the unassigned row simply
|
|
223
|
+
* leaves it empty. That is the composition the "draws
|
|
224
|
+
* nothing" rule asks for: a grid column keeps every
|
|
225
|
+
* title on one start edge without the design system
|
|
226
|
+
* inventing a grey placeholder to hold the space open.
|
|
227
|
+
*
|
|
228
|
+
* The wrapper around the chip is what makes it work. A
|
|
229
|
+
* component that returns `null` contributes **no grid
|
|
230
|
+
* item**, so without it the title of an unassigned row
|
|
231
|
+
* slides into the first column — which is the one way
|
|
232
|
+
* this composition goes wrong, and it goes wrong
|
|
233
|
+
* silently.
|
|
234
|
+
*/
|
|
235
|
+
className="grid grid-cols-[2em_1fr] items-center gap-3"
|
|
236
|
+
key={task.title}
|
|
237
|
+
>
|
|
238
|
+
<span className="justify-self-center">
|
|
239
|
+
<Avatar
|
|
240
|
+
categoricalKey={task.assignee?.id}
|
|
241
|
+
name={task.assignee?.name}
|
|
242
|
+
size="sm"
|
|
243
|
+
/>
|
|
244
|
+
</span>
|
|
245
|
+
|
|
246
|
+
<span className="text-content-secondary text-sm">
|
|
247
|
+
{task.title}
|
|
248
|
+
</span>
|
|
249
|
+
</li>
|
|
250
|
+
))}
|
|
251
|
+
</ul>
|
|
252
|
+
</Card>
|
|
253
|
+
),
|
|
254
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { composeStories } from "@storybook/react"
|
|
2
|
+
import { expect, waitFor } from "storybook/test"
|
|
3
|
+
import { test } from "vitest"
|
|
4
|
+
|
|
5
|
+
import { expectNoAxeViolations } from "../expectNoAxeViolations.testHelpers.ts"
|
|
6
|
+
import { mountStory } from "../mountStory.testHelpers.ts"
|
|
7
|
+
import { expectAgentDrivable } from "../testing/index.ts"
|
|
8
|
+
import * as stories from "./Avatar.stories.tsx"
|
|
9
|
+
|
|
10
|
+
const { AllStates, AllVariants, Default, InAList } =
|
|
11
|
+
composeStories(stories)
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The whole contract in one test: the name reaches assistive
|
|
15
|
+
* technology and a pointer, and reaches the page as text **nowhere
|
|
16
|
+
* at all**. The component exists to delete a printed "Owner" from
|
|
17
|
+
* every card on a board, so a name that leaks back into the DOM as
|
|
18
|
+
* text is the one regression that matters.
|
|
19
|
+
*/
|
|
20
|
+
test("the name is readable by an agent and never printed", async () => {
|
|
21
|
+
const { canvas } = await mountStory(Default)
|
|
22
|
+
|
|
23
|
+
const avatar = expectAgentDrivable(canvas, {
|
|
24
|
+
name: "Ada Lovelace",
|
|
25
|
+
role: "img",
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
await expect(avatar).toHaveAttribute(
|
|
29
|
+
"title",
|
|
30
|
+
"Ada Lovelace",
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
// The letters are what is on screen, and they are hidden from the
|
|
34
|
+
// accessibility tree so the chip is announced once.
|
|
35
|
+
await expect(canvas.getByText("AL")).toHaveAttribute(
|
|
36
|
+
"aria-hidden",
|
|
37
|
+
"true",
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
await expect(
|
|
41
|
+
canvas.queryByText("Ada Lovelace"),
|
|
42
|
+
).toBeNull()
|
|
43
|
+
|
|
44
|
+
await expectNoAxeViolations(avatar)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Unassigned draws nothing — not a grey placeholder, not an empty
|
|
49
|
+
* circle, not a whitespace-sized gap that shifts the row.
|
|
50
|
+
*
|
|
51
|
+
* Asserted through the story rather than by rendering the component
|
|
52
|
+
* directly, because the failure this prevents is a *layout* one: a
|
|
53
|
+
* row with no assignee has to look like a row with no assignee.
|
|
54
|
+
*/
|
|
55
|
+
test("an unassigned avatar renders nothing at all", async () => {
|
|
56
|
+
const { canvas } = await mountStory(AllStates)
|
|
57
|
+
|
|
58
|
+
// Nine chips are storied and a tenth is `name={null}`.
|
|
59
|
+
await expect(canvas.getAllByRole("img")).toHaveLength(9)
|
|
60
|
+
|
|
61
|
+
await expect(canvas.queryByText("None")).toBeNull()
|
|
62
|
+
|
|
63
|
+
// And the same in the list placement: four rows, three chips.
|
|
64
|
+
const list = await mountStory(InAList)
|
|
65
|
+
|
|
66
|
+
await expect(
|
|
67
|
+
list.canvas.getAllByRole("listitem"),
|
|
68
|
+
).toHaveLength(4)
|
|
69
|
+
|
|
70
|
+
await expect(
|
|
71
|
+
list.canvas.getAllByRole("img"),
|
|
72
|
+
).toHaveLength(3)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* A photo is never the only thing. An expired signed URL, a 404, or
|
|
77
|
+
* an app with no photos at all lands on the initials rather than on
|
|
78
|
+
* a broken-image glyph — which is what a hand-rolled avatar shows,
|
|
79
|
+
* because nobody writes the `onError` until they see it.
|
|
80
|
+
*/
|
|
81
|
+
test("a photo that fails falls back to the initials", async () => {
|
|
82
|
+
const { canvas } = await mountStory(AllStates)
|
|
83
|
+
|
|
84
|
+
const broken = expectAgentDrivable(canvas, {
|
|
85
|
+
name: "Kit Sandoval",
|
|
86
|
+
role: "img",
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
await waitFor(async () => {
|
|
90
|
+
await expect(broken.querySelector("img")).toBeNull()
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
await expect(broken).toHaveTextContent("KS")
|
|
94
|
+
|
|
95
|
+
// The photo that *does* load stays a photo, so the fallback is not
|
|
96
|
+
// simply "the image never renders".
|
|
97
|
+
const loaded = expectAgentDrivable(canvas, {
|
|
98
|
+
name: "Tomas Ericsson",
|
|
99
|
+
role: "img",
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
await expect(loaded.querySelector("img")).not.toBeNull()
|
|
103
|
+
|
|
104
|
+
// The image carries no name of its own — the chip already has one,
|
|
105
|
+
// and a second copy is how an avatar gets announced twice.
|
|
106
|
+
await expect(loaded.querySelector("img")).toHaveAttribute(
|
|
107
|
+
"alt",
|
|
108
|
+
"",
|
|
109
|
+
)
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The colour is a pure function of the key, so the same person is
|
|
114
|
+
* the same colour in every appearance, on every machine, and in a
|
|
115
|
+
* server render. A colour assigned at random on first render is a
|
|
116
|
+
* different colour on the next reload, which is the failure mode
|
|
117
|
+
* `getCategoricalIndex` exists to prevent.
|
|
118
|
+
*/
|
|
119
|
+
test("one person is one colour, and a chosen index wins", async () => {
|
|
120
|
+
const { canvas } = await mountStory(AllVariants)
|
|
121
|
+
|
|
122
|
+
const indexes = new Set(
|
|
123
|
+
canvas
|
|
124
|
+
.getAllByRole("img", { name: "Ada Lovelace" })
|
|
125
|
+
.map(
|
|
126
|
+
(avatar: HTMLElement) =>
|
|
127
|
+
/categorical-(\d+)-/.exec(avatar.className)?.[1],
|
|
128
|
+
),
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
await expect(indexes.size).toBe(1)
|
|
132
|
+
|
|
133
|
+
await expect(indexes.has(undefined)).toBe(false)
|
|
134
|
+
|
|
135
|
+
// A stored pick is not a hash — it is passed, and it wins.
|
|
136
|
+
const states = await mountStory(AllStates)
|
|
137
|
+
|
|
138
|
+
await expect(
|
|
139
|
+
states.canvas.getByRole("img", {
|
|
140
|
+
name: "Wren Okonkwo",
|
|
141
|
+
}),
|
|
142
|
+
).toHaveClass("bg-categorical-4-surface")
|
|
143
|
+
})
|