@estiva-app/ui 0.121.0 → 0.123.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/ActivityLine.d.ts.map +1 -1
- package/dist/ListTable.d.ts +4 -2
- package/dist/ListTable.d.ts.map +1 -1
- package/dist/MembersPill.d.ts +7 -1
- package/dist/MembersPill.d.ts.map +1 -1
- package/dist/Select.d.ts +2 -0
- package/dist/Select.d.ts.map +1 -1
- package/dist/index.js +27 -12
- package/dist/index.js.map +2 -2
- package/dist/linked.d.ts +6 -0
- package/dist/linked.d.ts.map +1 -1
- package/dist/linkedFrom.d.ts +5 -0
- package/dist/linkedFrom.d.ts.map +1 -1
- package/package.json +1 -1
- package/registry.json +8 -1
- package/src/ActivityLine.mdx +3 -1
- package/src/ActivityLine.test.tsx +9 -0
- package/src/ActivityLine.tsx +6 -1
- package/src/LinkParts.tsx +1 -1
- package/src/ListTable.mdx +7 -5
- package/src/ListTable.test.tsx +17 -0
- package/src/ListTable.tsx +12 -9
- package/src/MembersPill.mdx +6 -0
- package/src/MembersPill.stories.tsx +5 -0
- package/src/MembersPill.test.tsx +38 -0
- package/src/MembersPill.tsx +18 -2
- package/src/Select.stories.tsx +11 -0
- package/src/Select.test.tsx +16 -0
- package/src/Select.tsx +6 -2
- package/src/linked.ts +6 -0
- package/src/linkedFrom.test.tsx +25 -1
- package/src/linkedFrom.ts +15 -4
package/dist/linked.d.ts
CHANGED
|
@@ -31,6 +31,12 @@ export interface PickerOption {
|
|
|
31
31
|
picture?: string;
|
|
32
32
|
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
33
33
|
bot?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Shown but not offered: the current value when the picker cannot offer it,
|
|
36
|
+
* a status no listing names. Greyed, above the rest; picking another replaces
|
|
37
|
+
* it (Miky, 30 Oct, EAC-2).
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean;
|
|
34
40
|
}
|
|
35
41
|
/**
|
|
36
42
|
* A value the reader may be able to change from the card: a status, or who
|
package/dist/linked.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linked.d.ts","sourceRoot":"","sources":["../src/linked.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,kCAAuB,CAAA;AAE5C,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;AAE3C,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAEjE,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,YAAY,CAAA;CACrB;AAED,+EAA+E;AAC/E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED,kCAAkC;AAClC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,qDAAqD;IACrD,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,GAAG,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"linked.d.ts","sourceRoot":"","sources":["../src/linked.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,kCAAuB,CAAA;AAE5C,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;AAE3C,sEAAsE;AACtE,MA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ED,2HAA2H;AAC3H,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE1D;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,2HAA2H;IAC3H,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,SAAS,GAAG,SAAS,CAAA;IAC3D,2FAA2F;IAC3F,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;IAC5C,gBAAgB;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAoBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;CAAO,GAAG,eAAe,CA4C5J;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IAC5B,gFAAgF;IAChF,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,gBAAgB;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,oHAAoH;AACpH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,iBAAiB,CAuCpF"}
|
package/dist/linkedFrom.d.ts
CHANGED
|
@@ -47,6 +47,11 @@ export interface LinkedSource {
|
|
|
47
47
|
archived?: unknown;
|
|
48
48
|
/** When it last changed, in seconds (interop 0.64). */
|
|
49
49
|
changedAt?: number;
|
|
50
|
+
/** How far along it is, as interop counts it for every app (interop 0.102): done over every child not dropped. */
|
|
51
|
+
progress?: {
|
|
52
|
+
done: number;
|
|
53
|
+
total: number;
|
|
54
|
+
};
|
|
50
55
|
}
|
|
51
56
|
/** `T` is the app's own object type (interop's `ForeignObject`), so `hrefOf` takes it as it is. */
|
|
52
57
|
export interface LinkedFromOptions<T extends LinkedSource = LinkedSource> {
|
package/dist/linkedFrom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkedFrom.d.ts","sourceRoot":"","sources":["../src/linkedFrom.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAe,kBAAkB,EAAE,UAAU,EAA4C,MAAM,UAAU,CAAA;AAExI,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iDAAiD;IACjD,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED,uCAAuC;AACvC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,uFAAuF;AACvF,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC9D;AAED,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,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
6
|
"package": "@estiva-app/ui",
|
|
7
|
-
"packageVersion": "0.
|
|
7
|
+
"packageVersion": "0.123.0",
|
|
8
8
|
"exports": 256,
|
|
9
9
|
"typeExports": 270,
|
|
10
10
|
"files": null
|
|
@@ -7128,6 +7128,12 @@
|
|
|
7128
7128
|
"required": false,
|
|
7129
7129
|
"note": "Opens the list — usually a `MembersDialog`."
|
|
7130
7130
|
},
|
|
7131
|
+
{
|
|
7132
|
+
"name": "readOnly",
|
|
7133
|
+
"takes": "true/false",
|
|
7134
|
+
"required": false,
|
|
7135
|
+
"note": "Says who is in it and is nothing to press: the pill's own look, not greyed as a disabled one — in a list's row, which opens its thing (Katerina, 17 November: \"clicking on the pill should not show the members list."
|
|
7136
|
+
},
|
|
7131
7137
|
{
|
|
7132
7138
|
"name": "label",
|
|
7133
7139
|
"takes": "text",
|
|
@@ -7150,6 +7156,7 @@
|
|
|
7150
7156
|
"docPage": "src/MembersPill.mdx",
|
|
7151
7157
|
"app": null,
|
|
7152
7158
|
"looks": [
|
|
7159
|
+
"rounded-md border border-border-default font-sans font-medium text-btn-default text-text-primary",
|
|
7153
7160
|
"text-caption text-text-secondary signal:font-mono signal:text-small signal:tabular-nums"
|
|
7154
7161
|
]
|
|
7155
7162
|
},
|
package/src/ActivityLine.mdx
CHANGED
|
@@ -18,7 +18,9 @@ One thing that happened, in a list of them: a mark for what kind of thing it is,
|
|
|
18
18
|
- `did`: what they did, after their name, in the app's words.
|
|
19
19
|
- `where`: the place it was said, before the words, on a list that mixes
|
|
20
20
|
places; absent on the place's own list.
|
|
21
|
-
- `seen`: an Earlier line — the name in the secondary text.
|
|
21
|
+
- `seen`: an Earlier line — the name in the secondary text, and no tint. A
|
|
22
|
+
new line (the default) wears the accent's wash, so what is new reads apart
|
|
23
|
+
at a glance; the pointer's fill still shows over it.
|
|
22
24
|
|
|
23
25
|
<Canvas of={ActivityLineStories.Seen} />
|
|
24
26
|
|
|
@@ -44,4 +44,13 @@ describe('ActivityLine', () => {
|
|
|
44
44
|
expect(row.className).toContain('rounded-lg')
|
|
45
45
|
expect(row.className).not.toMatch(/\bborder\b/)
|
|
46
46
|
})
|
|
47
|
+
|
|
48
|
+
it('a new line wears the accent’s wash, a seen one none; the pointer’s fill still shows over it (Katerina, 16 November)', () => {
|
|
49
|
+
const { rerender } = render(<ActivityLine {...line} />)
|
|
50
|
+
const row = () => screen.getByRole('button')
|
|
51
|
+
expect(row().className).toContain('bg-accent-wash')
|
|
52
|
+
expect(row().className).toContain('hover:bg-bg-hover')
|
|
53
|
+
rerender(<ActivityLine {...line} seen />)
|
|
54
|
+
expect(row().className).not.toContain('bg-accent-wash')
|
|
55
|
+
})
|
|
47
56
|
})
|
package/src/ActivityLine.tsx
CHANGED
|
@@ -58,7 +58,12 @@ export function ActivityLine({ person, did, time, mark, where, words, seen = fal
|
|
|
58
58
|
</span>
|
|
59
59
|
</MenuItemBody>
|
|
60
60
|
)
|
|
61
|
-
|
|
61
|
+
/*
|
|
62
|
+
A new line wears the accent's wash, the open replies row's tint, so what is new reads apart from what was seen at a
|
|
63
|
+
glance, under its "New" heading too (Katerina, 6 November: "We also need to have new stuff with bg color"; 16
|
|
64
|
+
November: "let's use background color on new items"). Seen, it is plain. The pointer's fill still shows over it.
|
|
65
|
+
*/
|
|
66
|
+
const row = menuItemClassName({ size: 'default', className: cn(!seen && 'bg-accent-wash', className) })
|
|
62
67
|
if (href) {
|
|
63
68
|
return (
|
|
64
69
|
<Link href={href} variant="plain" className={row} {...(onClick ? { onClick } : {})} {...rest}>
|
package/src/LinkParts.tsx
CHANGED
|
@@ -193,7 +193,7 @@ export function LinkPickers({ status, owner, ownerLabel = 'Owner', readOnly = fa
|
|
|
193
193
|
onChange={(value) => status.onChange?.(value)}
|
|
194
194
|
ariaLabel="Status"
|
|
195
195
|
disabledReason={disabledReason}
|
|
196
|
-
options={status.options.map((option) => ({ value: option.value, label: option.label, leading: option.colour && <StatusIcon colour={option.colour}
|
|
196
|
+
options={status.options.map((option) => ({ value: option.value, label: option.label, leading: option.colour && <StatusIcon colour={option.colour} />, ...(option.disabled ? { disabled: true } : {}) }))}
|
|
197
197
|
/>
|
|
198
198
|
))}
|
|
199
199
|
{owner &&
|
package/src/ListTable.mdx
CHANGED
|
@@ -46,10 +46,12 @@ A list of things on a page, under column headings: each row leads to its thing,
|
|
|
46
46
|
|
|
47
47
|
<Canvas of={ListTableStories.NotReadYet} />
|
|
48
48
|
|
|
49
|
-
- It takes the whole width it is given. The name
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
- It takes the whole width it is given. The name and what it is about take
|
|
50
|
+
the room on the left; the facts sit together on the right, before the end,
|
|
51
|
+
24px apart, as are the name and the first fact (Katerina, 17 November:
|
|
52
|
+
"everything is crammed together on the left … we need air for them to
|
|
53
|
+
breathe"). From 16 November the name was capped at 384px with the facts
|
|
54
|
+
beside it; they read as one crammed block.
|
|
53
55
|
|
|
54
56
|
<Canvas of={ListTableStories.OnAWidePage} />
|
|
55
57
|
|
|
@@ -105,7 +107,7 @@ import { Button, ListTable, ListTableRow } from '@estiva-app/ui'
|
|
|
105
107
|
| Hides columns by its own width, `low` first | `hidden sm:block` on a column |
|
|
106
108
|
| Draws a row's fill, its 8px corners and no edge | `rounded-md hover:bg-bg-hover` on a row |
|
|
107
109
|
| Makes the whole row the link, its end above it | a covering link and `relative` by hand |
|
|
108
|
-
|
|
|
110
|
+
| Gives the name the room on the left and puts the facts together on the right, 24px apart | a width of your own on the name, a gap by hand |
|
|
109
111
|
|
|
110
112
|
## Props
|
|
111
113
|
|
package/src/ListTable.test.tsx
CHANGED
|
@@ -13,6 +13,23 @@ afterEach(cleanup)
|
|
|
13
13
|
const columns = [{ label: 'Team', width: 'large' as const }, { label: 'Active', keep: 'low' as const }]
|
|
14
14
|
|
|
15
15
|
describe('ListTable', () => {
|
|
16
|
+
// "Everything is crammed together on the left … names/desc at the left and the rest on the right" (Katerina, 17 November).
|
|
17
|
+
it('gives the name the room on the left and puts the facts together on the right, 24px apart', () => {
|
|
18
|
+
render(
|
|
19
|
+
<ListTable aria-label="Items" columns={columns}>
|
|
20
|
+
<ListTableRow href="/one" label="Item one" cells={['Group one', undefined]} />
|
|
21
|
+
</ListTable>,
|
|
22
|
+
)
|
|
23
|
+
const row = screen.getByText('Item one').closest('[role=row]') as HTMLElement
|
|
24
|
+
const name = within(row).getAllByRole('cell')[0]!
|
|
25
|
+
expect(name.className.split(' ')).toContain('flex-1')
|
|
26
|
+
expect(name.className.split(' ')).not.toContain('max-w-sm')
|
|
27
|
+
expect(row.className.split(' ')).toContain('gap-6')
|
|
28
|
+
const heads = screen.getAllByRole('columnheader')[0]!.parentElement!
|
|
29
|
+
expect(heads.className.split(' ')).toContain('gap-6')
|
|
30
|
+
expect(screen.getAllByRole('columnheader')[0]!.className.split(' ')).not.toContain('max-w-sm')
|
|
31
|
+
})
|
|
32
|
+
|
|
16
33
|
it('heads its columns, and each row has one cell per heading, a dash where it is not read', () => {
|
|
17
34
|
render(
|
|
18
35
|
<ListTable aria-label="Items" columns={columns}>
|
package/src/ListTable.tsx
CHANGED
|
@@ -71,8 +71,8 @@ const DEFAULT_WIDTH = 'medium'
|
|
|
71
71
|
const sizeOf = (column: ListTableColumn) => column.width ?? DEFAULT_WIDTH
|
|
72
72
|
/** The row's 12px either side, the icon and its 12px gap. */
|
|
73
73
|
const ROW_FRAME_PX = 24 + 16 + 12
|
|
74
|
-
/** Each column's
|
|
75
|
-
const GAP_PX =
|
|
74
|
+
/** Each column's 24px gap before it: room between the facts (Katerina, 17 November: "we need air for them to breathe"). */
|
|
75
|
+
const GAP_PX = 24
|
|
76
76
|
const END_PX = 64
|
|
77
77
|
|
|
78
78
|
type Shown = 'all' | 'high' | 'none'
|
|
@@ -87,8 +87,10 @@ const widthOf = (columns: ListTableColumn[], end: boolean) =>
|
|
|
87
87
|
* A list of things on a page, under column headings: each row leads to its thing, with its name and what it is about,
|
|
88
88
|
* then a few short facts in columns, then an action at its end. The columns give way to the name by the list's own
|
|
89
89
|
* width, not the window's — `low` ones first, then `high` ones — so a list beside a sidebar keeps its names. The name
|
|
90
|
-
* is
|
|
91
|
-
*
|
|
90
|
+
* and what it is about take the room on the left, the facts sit together on the right before the end, 24px apart
|
|
91
|
+
* (Katerina, 17 November: "everything is crammed together on the left … the names/desc at the left and the rest on the
|
|
92
|
+
* right was a more correct way"; from 16 November the name was capped at 384px with the facts beside it). The list
|
|
93
|
+
* takes the whole width it is given, as every page's body does (16 November).
|
|
92
94
|
*
|
|
93
95
|
* Peek's Explore topics, Ship's Topics and Leaf's Explore topics each drew this by hand, class for class, and their
|
|
94
96
|
* columns hid only at the phone's width: in a narrow window the names were cut to two letters (Katerina, 16 November).
|
|
@@ -117,9 +119,9 @@ export function ListTable({ 'aria-label': label, nameLabel = 'Name', columns, en
|
|
|
117
119
|
{/* With no columns there is nothing to head: the part's own heading names the list, and a lone "Name" said nothing (Katerina, 16 November). */}
|
|
118
120
|
{columns.length > 0 && (
|
|
119
121
|
// Hidden, it is out of the flow too: the rows start where the list does, with no gap for it.
|
|
120
|
-
<div role="row" className={cn('flex items-center gap-
|
|
122
|
+
<div role="row" className={cn('flex items-center gap-6 px-3 text-caption text-text-muted', !headings && 'sr-only')}>
|
|
121
123
|
{/* Over the name, past the icon; as wide as the names' cells. */}
|
|
122
|
-
<span role="columnheader" className="min-w-0
|
|
124
|
+
<span role="columnheader" className="min-w-0 flex-1 pl-7">
|
|
123
125
|
{nameLabel}
|
|
124
126
|
</span>
|
|
125
127
|
{columns.map((column) =>
|
|
@@ -147,9 +149,10 @@ export function ListTableRow({ href, label, description, icon, cells, end, onCli
|
|
|
147
149
|
if (!table) throw new Error('ListTableRow is a row of a ListTable: put it inside one.')
|
|
148
150
|
return (
|
|
149
151
|
// A row's look in every list: 8px corners, the fill under the pointer and no edge.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
// 24px between the name and each fact, and before the end (Katerina, 17 November): they touched at 12.
|
|
153
|
+
<div role="row" className="relative flex min-w-0 items-center gap-6 rounded-lg px-3 py-2 hover:bg-bg-hover" {...rest}>
|
|
154
|
+
{/* The name takes the room left, so the facts sit together on the right (Katerina, 17 November). */}
|
|
155
|
+
<span role="cell" className="flex min-w-0 flex-1 items-center gap-3">
|
|
153
156
|
{icon != null && <span className="flex shrink-0 items-center text-text-secondary">{icon}</span>}
|
|
154
157
|
{/* 2px between the name and its line, as every two-line row in the kit (LinkCard, LinkRow, PartCard, a tall MenuItem); they touched (Katerina, 16 November). */}
|
|
155
158
|
<Link href={href} variant="plain" cover className="flex min-w-0 flex-1 flex-col gap-0.5" {...(onClick ? { onClick } : {})}>
|
package/src/MembersPill.mdx
CHANGED
|
@@ -35,6 +35,12 @@ const [open, setOpen] = useState(false)
|
|
|
35
35
|
- `count` is the number beside the faces when it is not `members.length` —
|
|
36
36
|
pass three faces and the real total.
|
|
37
37
|
- No `onClick` disables it; no members draws nothing.
|
|
38
|
+
- `readOnly` says who is in it and is nothing to press: the same pixels, not
|
|
39
|
+
greyed as a disabled pill — in a list's row, which opens its thing; the row
|
|
40
|
+
is what is pressed (Katerina, 17 November: "clicking on the pill should not
|
|
41
|
+
show the members list").
|
|
42
|
+
|
|
43
|
+
<Canvas of={MembersPillStories.ReadOnly} />
|
|
38
44
|
|
|
39
45
|
## What it owns
|
|
40
46
|
|
|
@@ -32,6 +32,11 @@ export const Disabled: Story = {
|
|
|
32
32
|
args: { onClick: undefined },
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/** `readOnly`: who is in it and nothing to press — the pill's own look, not greyed — in a list's row, which opens its thing (Katerina, 17 November). */
|
|
36
|
+
export const ReadOnly: Story = {
|
|
37
|
+
args: { onClick: undefined, readOnly: true },
|
|
38
|
+
}
|
|
39
|
+
|
|
35
40
|
/** No members draws nothing at all. */
|
|
36
41
|
export const Empty: Story = {
|
|
37
42
|
args: { members: [] },
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
/**
|
|
3
|
+
* The pill: up to three faces and the number; it opens the list, is disabled with nothing to open, and read-only it is
|
|
4
|
+
* nothing to press at all, in its own look (Katerina, 17 November).
|
|
5
|
+
*/
|
|
6
|
+
import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
7
|
+
import { cleanup, render, screen } from '@testing-library/react'
|
|
8
|
+
import userEvent from '@testing-library/user-event'
|
|
9
|
+
import { MembersPill } from './MembersPill'
|
|
10
|
+
|
|
11
|
+
afterEach(cleanup)
|
|
12
|
+
|
|
13
|
+
const people = [{ name: 'Ana Duarte' }, { name: 'Ben Okafor' }, { name: 'Chloé Martin' }]
|
|
14
|
+
|
|
15
|
+
describe('MembersPill', () => {
|
|
16
|
+
it('opens the list when pressed', async () => {
|
|
17
|
+
const onClick = vi.fn()
|
|
18
|
+
render(<MembersPill members={people} count={9} onClick={onClick} />)
|
|
19
|
+
await userEvent.click(screen.getByRole('button', { name: '9 members' }))
|
|
20
|
+
expect(onClick).toHaveBeenCalled()
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
// "Clicking on the pill should not show the members list. And we need to use the estiva ui component" (Katerina, 17 November).
|
|
24
|
+
it('read-only, it says who is in it and is nothing to press, in the pill’s own look, not greyed', () => {
|
|
25
|
+
render(<MembersPill members={people} count={9} readOnly />)
|
|
26
|
+
expect(screen.queryByRole('button')).toBeNull()
|
|
27
|
+
const pill = screen.getByRole('img', { name: '9 members' })
|
|
28
|
+
expect(pill.textContent).toContain('9')
|
|
29
|
+
const classes = pill.className.split(' ')
|
|
30
|
+
expect(classes).toEqual(expect.arrayContaining(['h-8', 'border', 'border-border-default', 'text-text-primary']))
|
|
31
|
+
expect(classes).not.toContain('bg-bg-disabled')
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it('read-only with nobody in it draws nothing', () => {
|
|
35
|
+
const { container } = render(<MembersPill members={[]} readOnly />)
|
|
36
|
+
expect(container.firstChild).toBeNull()
|
|
37
|
+
})
|
|
38
|
+
})
|
package/src/MembersPill.tsx
CHANGED
|
@@ -10,6 +10,12 @@ export interface MembersPillProps {
|
|
|
10
10
|
count?: number
|
|
11
11
|
/** Opens the list — usually a `MembersDialog`. Without it the pill is disabled. */
|
|
12
12
|
onClick?: () => void
|
|
13
|
+
/**
|
|
14
|
+
* Says who is in it and is nothing to press: the pill's own look, not greyed as a disabled one — in a list's row,
|
|
15
|
+
* which opens its thing (Katerina, 17 November: "clicking on the pill should not show the members list. And we need to
|
|
16
|
+
* use the estiva ui component"). `onClick` is not taken with it.
|
|
17
|
+
*/
|
|
18
|
+
readOnly?: boolean
|
|
13
19
|
/** The button's accessible name, when the list it opens is not "members" — "Who follows <name>: 4". Defaults to "4 members". */
|
|
14
20
|
label?: string
|
|
15
21
|
className?: string
|
|
@@ -25,11 +31,21 @@ export interface MembersPillProps {
|
|
|
25
31
|
* pick of 15 September). `disabled` rather than another element when there is
|
|
26
32
|
* nothing to press, so one element keeps one set of pixels.
|
|
27
33
|
*/
|
|
28
|
-
export function MembersPill({ members, count, onClick, label, className }: MembersPillProps) {
|
|
34
|
+
export function MembersPill({ members, count, onClick, readOnly = false, label, className }: MembersPillProps) {
|
|
29
35
|
const total = count ?? members.length
|
|
30
36
|
if (total === 0) return null
|
|
37
|
+
const name = label ?? `${total} ${total === 1 ? 'member' : 'members'}`
|
|
38
|
+
if (readOnly)
|
|
39
|
+
return (
|
|
40
|
+
// The outlined Button's own pixels — its height, corners, line and words — with nothing to press: one picture, read as one.
|
|
41
|
+
// @estiva-escape(no-copied-look): the read-only pill IS the outlined Button's look, drawn without a button
|
|
42
|
+
<span role="img" aria-label={name} className={cn('inline-flex h-8 min-h-8 shrink-0 items-center gap-2 rounded-md border border-border-default pl-[3px] pr-2 font-sans font-medium text-btn-default text-text-primary', className)}>
|
|
43
|
+
<AvatarGroup members={members} />
|
|
44
|
+
<span className={cn(MONO_CAPTION_CLASSES, 'signal:tabular-nums')}>{total}</span>
|
|
45
|
+
</span>
|
|
46
|
+
)
|
|
31
47
|
return (
|
|
32
|
-
<Button variant="outlined" aria-label={
|
|
48
|
+
<Button variant="outlined" aria-label={name} disabled={!onClick} onClick={onClick} className={cn('gap-2 pl-[3px] pr-2', className)}>
|
|
33
49
|
<AvatarGroup members={members} />
|
|
34
50
|
<span className={cn(MONO_CAPTION_CLASSES, 'signal:tabular-nums')}>{total}</span>
|
|
35
51
|
</Button>
|
package/src/Select.stories.tsx
CHANGED
|
@@ -85,6 +85,17 @@ export const WithLeading: Story = {
|
|
|
85
85
|
),
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/** A current value the select cannot offer: shown first and greyed, as a shut menu row; picking another replaces it. */
|
|
89
|
+
export const ACurrentValueNotOffered: Story = {
|
|
90
|
+
render: (args) => (
|
|
91
|
+
<Demo
|
|
92
|
+
{...args}
|
|
93
|
+
initial="blocked"
|
|
94
|
+
options={[{ value: 'blocked', label: 'blocked', disabled: true }, ...args.options]}
|
|
95
|
+
/>
|
|
96
|
+
),
|
|
97
|
+
}
|
|
98
|
+
|
|
88
99
|
/** In a `Field`, which is how a select appears in a form. */
|
|
89
100
|
export const InAField: Story = {
|
|
90
101
|
render: (args) => (
|
package/src/Select.test.tsx
CHANGED
|
@@ -57,6 +57,22 @@ describe('Select', () => {
|
|
|
57
57
|
expect(trigger.getAttribute('aria-expanded')).toBe('false')
|
|
58
58
|
})
|
|
59
59
|
|
|
60
|
+
it('a disabled option is shown as the current value but cannot be picked; another one can', async () => {
|
|
61
|
+
const user = userEvent.setup()
|
|
62
|
+
const onChange = vi.fn()
|
|
63
|
+
const options = [{ value: 'item', label: 'Item one', disabled: true }, ...STATUSES]
|
|
64
|
+
render(<Select value="item" onChange={onChange} options={options} ariaLabel="Status" />)
|
|
65
|
+
const trigger = screen.getByRole('combobox', { name: 'Status' })
|
|
66
|
+
expect(trigger.textContent).toContain('Item one')
|
|
67
|
+
await user.click(trigger)
|
|
68
|
+
const shut = await screen.findByRole('option', { name: /Item one/ })
|
|
69
|
+
expect(shut.getAttribute('aria-disabled')).toBe('true')
|
|
70
|
+
await user.click(shut)
|
|
71
|
+
expect(onChange).not.toHaveBeenCalled()
|
|
72
|
+
await user.click(screen.getByRole('option', { name: 'Done' }))
|
|
73
|
+
expect(onChange).toHaveBeenCalledWith('done')
|
|
74
|
+
})
|
|
75
|
+
|
|
60
76
|
it('disabledReason: held shut, reachable by Tab, and it says why', async () => {
|
|
61
77
|
const user = userEvent.setup()
|
|
62
78
|
const onChange = vi.fn()
|
package/src/Select.tsx
CHANGED
|
@@ -40,6 +40,8 @@ export interface SelectOption {
|
|
|
40
40
|
label: string
|
|
41
41
|
/** Drawn before the label, 16px — an Avatar, an icon. */
|
|
42
42
|
leading?: ReactNode
|
|
43
|
+
/** Shown, greyed, and not pickable: a current value the select cannot offer (a status no listing names). */
|
|
44
|
+
disabled?: boolean
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
export interface SelectProps {
|
|
@@ -201,6 +203,7 @@ export function Select({ value, onChange, options, size = 'default', fill = 'fie
|
|
|
201
203
|
<BaseSelect.Item
|
|
202
204
|
key={option.value}
|
|
203
205
|
value={option.value}
|
|
206
|
+
disabled={option.disabled}
|
|
204
207
|
/* The highlight is Base UI's `data-highlighted` — pointer and
|
|
205
208
|
keyboard set the same attribute, so what the DOM says and
|
|
206
209
|
what the row looks like cannot disagree. It used to be an
|
|
@@ -211,11 +214,12 @@ export function Select({ value, onChange, options, size = 'default', fill = 'fie
|
|
|
211
214
|
Select adds is its own: the ✓ at the end, and the chosen
|
|
212
215
|
row in medium weight. No fade on the highlight, as in every
|
|
213
216
|
menu (Katerina, 2026-09-05). */
|
|
214
|
-
|
|
217
|
+
// A disabled option is a shut row, as a MenuItem with its reason: the arrow, no fill, its words and icon greyed.
|
|
218
|
+
className={cn(menuItemClassName({ size: 'default', shut: option.disabled }), 'justify-between data-[selected]:font-medium')}
|
|
215
219
|
>
|
|
216
220
|
<span className="flex min-w-0 items-center gap-2">
|
|
217
221
|
{option.leading && <span className="flex shrink-0 items-center">{option.leading}</span>}
|
|
218
|
-
<BaseSelect.ItemText className=
|
|
222
|
+
<BaseSelect.ItemText className={cn('truncate text-body-2', option.disabled ? 'text-text-disabled' : 'text-text-primary')}>{option.label}</BaseSelect.ItemText>
|
|
219
223
|
</span>
|
|
220
224
|
<BaseSelect.ItemIndicator
|
|
221
225
|
render={<IconCheck size={16} stroke={1.5} className="shrink-0 text-text-secondary" />}
|
package/src/linked.ts
CHANGED
|
@@ -48,6 +48,12 @@ export interface PickerOption {
|
|
|
48
48
|
picture?: string
|
|
49
49
|
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
50
50
|
bot?: boolean
|
|
51
|
+
/**
|
|
52
|
+
* Shown but not offered: the current value when the picker cannot offer it,
|
|
53
|
+
* a status no listing names. Greyed, above the rest; picking another replaces
|
|
54
|
+
* it (Miky, 30 Oct, EAC-2).
|
|
55
|
+
*/
|
|
56
|
+
disabled?: boolean
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
/**
|
package/src/linkedFrom.test.tsx
CHANGED
|
@@ -109,11 +109,35 @@ describe('a card built from interop’s projection', () => {
|
|
|
109
109
|
expect(rows).toEqual(['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5', 'Item 6', 'Item 7'])
|
|
110
110
|
})
|
|
111
111
|
|
|
112
|
-
it('counts every item in its ring, listed or not, a dropped one in the total and not as done', () => {
|
|
112
|
+
it('counts every item in its ring, listed or not, a dropped one in the total and not as done, from an interop that does not count', () => {
|
|
113
113
|
render(<LinkCard link={linkStateFrom(GROUP, UNREAD, options())} />)
|
|
114
114
|
expect(screen.getByText('3/9')).toBeTruthy()
|
|
115
115
|
})
|
|
116
116
|
|
|
117
|
+
it('draws the progress interop counts, the one every app draws: a dropped item out of both numbers', () => {
|
|
118
|
+
render(<LinkCard link={linkStateFrom({ ...GROUP, progress: { done: 3, total: 8 } }, UNREAD, options())} />)
|
|
119
|
+
expect(screen.getByText('3/8')).toBeTruthy()
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
it('shows a status no listing names as the current value, by its id, greyed and not pickable, above the rest', async () => {
|
|
123
|
+
const user = userEvent.setup()
|
|
124
|
+
const onAct = vi.fn()
|
|
125
|
+
const blocked = { ...GROUP, actions: [{ ...GROUP.actions[0], current: 'blocked' }, GROUP.actions[1]] }
|
|
126
|
+
render(<LinkCard link={linkStateFrom(blocked, UNREAD, options({ onAct }))} />)
|
|
127
|
+
const status = screen.getByRole('combobox', { name: 'Status' })
|
|
128
|
+
expect(status.textContent).toContain('blocked')
|
|
129
|
+
await user.click(status)
|
|
130
|
+
const listed = await screen.findAllByRole('option')
|
|
131
|
+
// The first is the current value, so it carries the chosen row's ✓.
|
|
132
|
+
expect(listed[0].textContent).toMatch(/^blocked/)
|
|
133
|
+
expect(listed.slice(1).map((option) => option.textContent)).toEqual(['Todo', 'Doing', 'Done', 'Dropped'])
|
|
134
|
+
expect(listed[0].getAttribute('aria-disabled')).toBe('true')
|
|
135
|
+
await user.click(listed[0])
|
|
136
|
+
expect(onAct).not.toHaveBeenCalled()
|
|
137
|
+
await user.click(screen.getByRole('option', { name: /Doing/ }))
|
|
138
|
+
expect(onAct).toHaveBeenCalledWith('set-status', 'doing')
|
|
139
|
+
})
|
|
140
|
+
|
|
117
141
|
it('shows its key before its title, in the card and in the chip', () => {
|
|
118
142
|
render(<LinkCard link={linkStateFrom(GROUP, UNREAD, options())} />)
|
|
119
143
|
expect(screen.getByText('ABC')).toBeTruthy()
|
package/src/linkedFrom.ts
CHANGED
|
@@ -59,6 +59,8 @@ export interface LinkedSource {
|
|
|
59
59
|
archived?: unknown
|
|
60
60
|
/** When it last changed, in seconds (interop 0.64). */
|
|
61
61
|
changedAt?: number
|
|
62
|
+
/** How far along it is, as interop counts it for every app (interop 0.102): done over every child not dropped. */
|
|
63
|
+
progress?: { done: number; total: number }
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
/** `T` is the app's own object type (interop's `ForeignObject`), so `hrefOf` takes it as it is. */
|
|
@@ -186,11 +188,13 @@ function childrenOf<T extends LinkedSource>(object: T, options: LinkedFromOption
|
|
|
186
188
|
}
|
|
187
189
|
|
|
188
190
|
/**
|
|
189
|
-
* How far along it is, when every item has a status:
|
|
190
|
-
*
|
|
191
|
-
*
|
|
191
|
+
* How far along it is, when every item has a status: interop's count, the one
|
|
192
|
+
* every app draws — done over every item not cancelled, so a finished project
|
|
193
|
+
* reads full (Miky, 17 Nov; interop 0.102's `progress`). From an older interop,
|
|
194
|
+
* the green ones over all of them, as before.
|
|
192
195
|
*/
|
|
193
196
|
function doneOf(object: LinkedSource): { done: number; total: number } | undefined {
|
|
197
|
+
if (object.progress) return object.progress
|
|
194
198
|
const children = object.children
|
|
195
199
|
if (!children?.length || children.some((child) => !child.slots.status)) return undefined
|
|
196
200
|
return { done: children.filter((child) => child.slots.status?.colour === 'green').length, total: children.length }
|
|
@@ -200,9 +204,16 @@ function statusOf(object: LinkedSource, onAct: LinkedFromOptions['onAct']): Link
|
|
|
200
204
|
const { slots } = object
|
|
201
205
|
const action = object.actions.find((one) => one.control === 'select' && one.field && one.field === slots.status?.field)
|
|
202
206
|
if (action) {
|
|
207
|
+
const offered = (action.options ?? []).map((option) => ({ value: option.value, label: option.label, colour: colourOf(option.colour) }))
|
|
208
|
+
// A status no listing names (a company's own, another app's) is the current value all the same: shown by its id,
|
|
209
|
+
// greyed and not offered, above the statuses on offer (Miky, 30 Oct), in the neutral grey (Katerina, 30 Oct).
|
|
210
|
+
const unlisted =
|
|
211
|
+
action.current && !offered.some((option) => option.value === action.current)
|
|
212
|
+
? [{ value: action.current, label: action.current, colour: 'neutral' as const, disabled: true }]
|
|
213
|
+
: []
|
|
203
214
|
return {
|
|
204
215
|
value: action.current,
|
|
205
|
-
options:
|
|
216
|
+
options: [...unlisted, ...offered],
|
|
206
217
|
...(onAct ? { onChange: (value: string) => onAct(action.id, value) } : {}),
|
|
207
218
|
}
|
|
208
219
|
}
|