@stapel/workspaces-react 0.19.0 → 0.19.1
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/CHANGELOG.md +35 -0
- package/dist/default/WorkspacesPage.d.ts.map +1 -1
- package/dist/default/WorkspacesPage.js +3 -2
- package/dist/default/WorkspacesPage.js.map +1 -1
- package/dist/default/parts.d.ts.map +1 -1
- package/dist/default/parts.js +6 -3
- package/dist/default/parts.js.map +1 -1
- package/llms.txt +1 -1
- package/manifest.json +1 -1
- package/package.json +5 -5
- package/src/analytics/generated/events.json +1 -1
- package/src/default/WorkspacesPage.tsx +8 -1
- package/src/default/parts.tsx +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @stapel/workspaces-react
|
|
2
2
|
|
|
3
|
+
## 0.19.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f79bdc3: tokens-antd: a gated control is semantically off and interactively ALIVE — it can be tapped, focused, and can say why it will not do the thing
|
|
8
|
+
|
|
9
|
+
`GatedControl` handed callers `bind.disabled` and its own JSDoc told them to spread it straight onto the control. That produced an html-`disabled` element, which fires no events in any browser: it cannot be clicked, cannot take focus, cannot be described to a screen reader that never reaches it, and cannot carry the one gesture that mattered — the tap that should open the sign-in door standing behind the gate. Every gated control across the ~20 pairs using it was inert, and the wrong instruction was half the defect: the docs taught the shape that broke it.
|
|
10
|
+
|
|
11
|
+
Measured on a live deployment: an anonymous visitor taps the favourite heart and nothing happens at all — no sentence, no tooltip, no door (walker defects D45/D72).
|
|
12
|
+
|
|
13
|
+
**The corrected contract.** While the gate is shut a control is now `aria-disabled="true"` and NOT html-disabled, so it stays focusable and keeps receiving events. The ACTION is suppressed by `GatedControl` itself, in a capture-phase wrapper (`display: contents`, so no pair's layout moves by a pixel): the caller's `onClick`, keyboard activation, typing, IME input, paste and drop are swallowed before the control sees them. Callers write their handlers exactly as if the gate did not exist. The activation comes back as the new `onBlockedActivate`, which is where a pair opens its door. The reason stays where it was — visible text wired by `aria-describedby` — and where a `PaneGate` pools it into one footnote, the gesture now brings a `role="status"` copy of the sentence back to the control it belongs to. A blocked `GatedButton` keeps antd's exact disabled paint (its own `-disabled` class, which sets no `pointer-events`), so nothing about any screen looks different.
|
|
14
|
+
|
|
15
|
+
`GatedControlProps.whenBlocked` holds the two deliberate opt-outs, neither of them the default:
|
|
16
|
+
|
|
17
|
+
- `"inert"` — html `disabled`, for the rare control that must be switched off at the browser level. `attributes-react`'s catalogue lock is the one place in the fleet that asks for it, and now says so.
|
|
18
|
+
- `"annotate"` — the control stays fully usable and only gains the sentence, for a gate that judges the VALUE rather than refusing the person: `calendar-react`'s slot-length field must stay editable, because editing it is how the reason goes away, and `search-react`'s sort must still pick the options that are not the blocked one.
|
|
19
|
+
|
|
20
|
+
`useBlockedButtonClassName()` is exported for render-prop call sites that paint their own button and want the same unavailable look rather than a second grey.
|
|
21
|
+
|
|
22
|
+
**⚠️ The readiness-signal hazard, and its cure.** `element.disabled` is now permanently `false` on every gated control in the fleet. Any test using it as a readiness signal — `await waitFor(() => expect(save.disabled).toBe(false))`, meaning "wait until this is allowed" — returns instantly and mis-times SILENTLY: every assertion after it reads an unseeded component, and the failure looks like broken product logic rather than a gate that had not opened. One pair's suite went green → 21 failures across unrelated files on exactly this. Wait on the stamp instead, which is what such a wait was always asking:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
await waitFor(() =>
|
|
26
|
+
expect(
|
|
27
|
+
screen.getByTestId("save-gate").getAttribute("data-stapel-gated")
|
|
28
|
+
).toBe("available")
|
|
29
|
+
);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`data-stapel-gated="available" | "blocked"` is on the wrapper of every gated control in all three modes (`GatedButton` names it `<testId>-gate`). For a point assertion on one element, read `aria-disabled`. Never `disabled`.
|
|
33
|
+
|
|
34
|
+
**ChoiceChips** carried the same defect on its own chips and is fixed the same way: a chip at the cap is `aria-disabled` and focusable, and the tap is refused in the handler, so the row's sentence reaches a keyboard.
|
|
35
|
+
|
|
36
|
+
**The consumers.** Every `GatedButton` call site (64 imports across 20 pairs) is fixed with no code change — the correction is in the substrate. The render-prop call sites that consumed the binding field-by-field now spread it whole: `billing-react`'s auto-recharge switch, `calendar-react`'s RSVP buttons, `moderation-react`'s sanction checkbox, `notifications-react`'s push switch, `attributes-react`'s at-max add button. `tasks-react`'s assignee picker is a host slot rendering its own control out of reach of the suppression, so it is handed a plain verdict on purpose. `workspaces-react` had two hand-rolled gates that never went through `GatedControl` at all — a row-action column and the create button on a failed roster read — and both now use the same anatomy.
|
|
37
|
+
|
|
3
38
|
## 0.19.0
|
|
4
39
|
|
|
5
40
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspacesPage.d.ts","sourceRoot":"","sources":["../../src/default/WorkspacesPage.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkspacesPage.d.ts","sourceRoot":"","sources":["../../src/default/WorkspacesPage.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AA2B1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKjD,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,MAAM,CAAC,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;CACrC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAavE"}
|
|
@@ -23,7 +23,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
23
23
|
import { useId, useState } from "react";
|
|
24
24
|
import { Button, Card, Flex, Input, Typography, theme as antdTheme } from "antd";
|
|
25
25
|
import { actionAvailable, actionBlocked, loadStateFromQuery, requireLoaded, useT, useTPlural, } from "@stapel/core";
|
|
26
|
-
import { EmptyState, ErrorAlert, GatedButton, LoadList, SkinDialog, SkinTheme, } from "@stapel/tokens-antd/skin";
|
|
26
|
+
import { EmptyState, ErrorAlert, GatedButton, LoadList, SkinDialog, SkinTheme, useBlockedButtonClassName, } from "@stapel/tokens-antd/skin";
|
|
27
27
|
import { spacing } from "@stapel/tokens";
|
|
28
28
|
import { WorkspaceList } from "../headless/WorkspaceList.js";
|
|
29
29
|
import { useWorkspaces } from "../model/queries.js";
|
|
@@ -54,11 +54,12 @@ function PageBody(props) {
|
|
|
54
54
|
// this screen, and the button points at it.
|
|
55
55
|
const listState = loadStateFromQuery(listQuery);
|
|
56
56
|
const listFailed = listState.status === "failed";
|
|
57
|
+
const blockedLook = useBlockedButtonClassName();
|
|
57
58
|
const createGate = requireLoaded(listState, (loaded) => loaded.can_create_workspace === true
|
|
58
59
|
? actionAvailable()
|
|
59
60
|
: actionBlocked(WORKSPACES_I18N_KEYS.listCreateBlockedPolicy));
|
|
60
61
|
const rows = bag.state.status === "ready" ? bag.state.data : [];
|
|
61
|
-
return (_jsxs("div", { style: SCREEN_STACK, children: [_jsxs(Card, { children: [_jsxs(Flex, { justify: "space-between", align: "flex-start", gap: spacing["4"], wrap: true, children: [_jsxs(Flex, { vertical: true, gap: spacing["1"], children: [_jsx(Typography.Title, { level: 4, style: { marginTop: 0, marginBottom: 0 }, children: t(WORKSPACES_I18N_KEYS.pageTitle) }), _jsx(Typography.Text, { type: "secondary", children: t(WORKSPACES_I18N_KEYS.pageSubtitle) }), bag.state.status === "ready" && (_jsx(Muted, { testId: "workspaces-count", children: tPlural(WORKSPACES_I18N_KEYS.listCount, { count: rows.length }) }))] }), listFailed ? (_jsx(Button, { type: "primary", disabled: true, "aria-describedby": failureId, "data-disabled-reason": "the roster read failed; the alert below says so once and carries the retry", "data-analytics": "none", "data-analytics-reason": "local-ui-open-create-dialog", "data-testid": "workspaces-create-open", children: t(WORKSPACES_I18N_KEYS.listCreate) })) : (_jsx(GatedButton, { gate: createGate, type: "primary", onClick: () => setCreating(true), testId: "workspaces-create-open", "data-analytics": "none", "data-analytics-reason": "local-ui-open-create-dialog", children: t(WORKSPACES_I18N_KEYS.listCreate) }))] }), list?.is_guest === true && (_jsx("div", { style: { marginTop: spacing["3"] }, children: _jsx(Muted, { testId: "workspaces-guest", children: t(WORKSPACES_I18N_KEYS.listGuestNotice) }) })), _jsx(ErrorAlert, { thrown: bag.createError, style: { marginTop: spacing["3"] }, testId: "workspaces-create-error" }), _jsx("div", { style: { marginTop: spacing["4"] }, children: _jsx(LoadList, { state: bag.state, testId: "workspaces-list", onRetry: bag.refetch, failed: (error) => (_jsx("div", { id: failureId, children: _jsx(LoadFailure, { error: error, onRetry: bag.refetch, testId: "workspaces-list-failed" }) })), empty: _jsx(EmptyState, { title: t(WORKSPACES_I18N_KEYS.listEmpty), testId: "workspaces-list-empty",
|
|
62
|
+
return (_jsxs("div", { style: SCREEN_STACK, children: [_jsxs(Card, { children: [_jsxs(Flex, { justify: "space-between", align: "flex-start", gap: spacing["4"], wrap: true, children: [_jsxs(Flex, { vertical: true, gap: spacing["1"], children: [_jsx(Typography.Title, { level: 4, style: { marginTop: 0, marginBottom: 0 }, children: t(WORKSPACES_I18N_KEYS.pageTitle) }), _jsx(Typography.Text, { type: "secondary", children: t(WORKSPACES_I18N_KEYS.pageSubtitle) }), bag.state.status === "ready" && (_jsx(Muted, { testId: "workspaces-count", children: tPlural(WORKSPACES_I18N_KEYS.listCount, { count: rows.length }) }))] }), listFailed ? (_jsx(Button, { type: "primary", "aria-disabled": true, className: blockedLook, "aria-describedby": failureId, "data-disabled-reason": "the roster read failed; the alert below says so once and carries the retry", "data-analytics": "none", "data-analytics-reason": "local-ui-open-create-dialog", "data-testid": "workspaces-create-open", children: t(WORKSPACES_I18N_KEYS.listCreate) })) : (_jsx(GatedButton, { gate: createGate, type: "primary", onClick: () => setCreating(true), testId: "workspaces-create-open", "data-analytics": "none", "data-analytics-reason": "local-ui-open-create-dialog", children: t(WORKSPACES_I18N_KEYS.listCreate) }))] }), list?.is_guest === true && (_jsx("div", { style: { marginTop: spacing["3"] }, children: _jsx(Muted, { testId: "workspaces-guest", children: t(WORKSPACES_I18N_KEYS.listGuestNotice) }) })), _jsx(ErrorAlert, { thrown: bag.createError, style: { marginTop: spacing["3"] }, testId: "workspaces-create-error" }), _jsx("div", { style: { marginTop: spacing["4"] }, children: _jsx(LoadList, { state: bag.state, testId: "workspaces-list", onRetry: bag.refetch, failed: (error) => (_jsx("div", { id: failureId, children: _jsx(LoadFailure, { error: error, onRetry: bag.refetch, testId: "workspaces-list-failed" }) })), empty: _jsx(EmptyState, { title: t(WORKSPACES_I18N_KEYS.listEmpty), testId: "workspaces-list-empty",
|
|
62
63
|
// The RESTRICTION is stated once, beside the switched-off
|
|
63
64
|
// control above; this line is the other half — what the person
|
|
64
65
|
// can actually do about it. Saying "this installation does not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspacesPage.js","sourceRoot":"","sources":["../../src/default/WorkspacesPage.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AACjF,OAAO,EACL,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,IAAI,EACJ,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,
|
|
1
|
+
{"version":3,"file":"WorkspacesPage.js","sourceRoot":"","sources":["../../src/default/WorkspacesPage.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,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tC,GAAG,YAAY,GAAG,IAAI,CAmCtB;AAED,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,GAAG,YAAY,CA+Df;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,GAAG,YAAY,CAqBf;AAED,6EAA6E;AAC7E,eAAO,MAAM,YAAY,EAAE,aAG1B,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,WAAW,EAAE,aAGzB,CAAC"}
|
package/dist/default/parts.js
CHANGED
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
14
14
|
import { useId } from "react";
|
|
15
15
|
import { Avatar, Button, Flex, Tag, Typography } from "antd";
|
|
16
16
|
import { STAPEL_UI_KEYS, useT } from "@stapel/core";
|
|
17
|
-
import { ErrorAlert } from "@stapel/tokens-antd/skin";
|
|
17
|
+
import { ErrorAlert, useBlockedButtonClassName } from "@stapel/tokens-antd/skin";
|
|
18
18
|
import { spacing, fontSize } from "@stapel/tokens";
|
|
19
19
|
/** The muted sentence that sits under a control or beside a value. */
|
|
20
20
|
export function Muted(props) {
|
|
@@ -94,6 +94,7 @@ export function AnchorPager(props) {
|
|
|
94
94
|
export function RowActions(props) {
|
|
95
95
|
const t = useT();
|
|
96
96
|
const reasonId = useId();
|
|
97
|
+
const blockedLook = useBlockedButtonClassName();
|
|
97
98
|
const collected = [];
|
|
98
99
|
if (props.reason !== undefined) {
|
|
99
100
|
collected.push(props.reason);
|
|
@@ -110,9 +111,11 @@ export function RowActions(props) {
|
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
const anyBlocked = props.actions.some((action) => !action.gate.available);
|
|
113
|
-
return (_jsxs(_Fragment, { children: [_jsx(Flex, { gap: spacing["2"], align: "center", wrap: true, children: props.actions.map((action) => (_jsx(Button, { type: "link", size: "small", danger: action.danger === true,
|
|
114
|
+
return (_jsxs(_Fragment, { children: [_jsx(Flex, { gap: spacing["2"], align: "center", wrap: true, children: props.actions.map((action) => (_jsx(Button, { type: "link", size: "small", danger: action.danger === true, ...(action.gate.available
|
|
115
|
+
? { onClick: action.onClick }
|
|
116
|
+
: { "aria-disabled": true, className: blockedLook }), ...(anyBlocked && !action.gate.available
|
|
114
117
|
? { "aria-describedby": reasonId }
|
|
115
|
-
: {}),
|
|
118
|
+
: {}), "data-analytics": "none", "data-analytics-reason": "passthrough \u2014 the caller's onClick carries the tracked action", ...(action.testId !== undefined ? { "data-testid": action.testId } : {}), children: action.label }, action.key))) }), collected.length > 0 && (_jsx("div", { id: reasonId, "data-stapel-gated-reason": "", style: { flexBasis: "100%", minWidth: 0 }, ...(props.testId !== undefined ? { "data-testid": props.testId } : {}), children: collected.map((sentence) => (_jsx("div", { children: _jsx(Muted, { children: sentence }) }, sentence))) }))] }));
|
|
116
119
|
}
|
|
117
120
|
/**
|
|
118
121
|
* A failed read, said once, in a shape a 390px screen can hold.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../../src/default/parts.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../../src/default/parts.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEnD,sEAAsE;AACtE,MAAM,UAAU,KAAK,CAAC,KAGrB;IACC,OAAO,CACL,KAAC,UAAU,CAAC,IAAI,IACd,IAAI,EAAC,WAAW,EAChB,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,KACrC,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,C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AS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC,CAAC,SAAS,YAE5E,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,GACjB,CACV,IACI,CACR,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;CAClB,CAAC;AAEF,mDAAmD;AACnD,MAAM,CAAC,MAAM,WAAW,GAAkB;IACxC,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;CAClB,CAAC"}
|
package/llms.txt
CHANGED
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stapel/workspaces-react",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"description": "Headless React flow pair for stapel-workspaces: typed API client, TanStack Query hooks, flow machines, headless components, and i18n keys. Zero visual opinion.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
],
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@stapel/core": ">=0.18.1 <1.0.0",
|
|
71
|
-
"@stapel/tokens-antd": ">=0.
|
|
71
|
+
"@stapel/tokens-antd": ">=0.16.0",
|
|
72
72
|
"@tanstack/react-query": "^5.0.0",
|
|
73
73
|
"antd": ">=5.20.0 <7",
|
|
74
74
|
"react": ">=19"
|
|
@@ -95,10 +95,10 @@
|
|
|
95
95
|
"size-limit": "^11.2.0",
|
|
96
96
|
"typescript": "^5.8.3",
|
|
97
97
|
"vitest": "^3.2.4",
|
|
98
|
-
"@stapel/core": "^0.18.1",
|
|
99
98
|
"@stapel/showcase": "^0.3.0",
|
|
100
|
-
"@stapel/tokens": "^0.
|
|
101
|
-
"@stapel/tokens
|
|
99
|
+
"@stapel/tokens-antd": "^0.16.0",
|
|
100
|
+
"@stapel/tokens": "^0.7.0",
|
|
101
|
+
"@stapel/core": "^0.23.1"
|
|
102
102
|
},
|
|
103
103
|
"engines": {
|
|
104
104
|
"node": ">=22"
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
LoadList,
|
|
38
38
|
SkinDialog,
|
|
39
39
|
SkinTheme,
|
|
40
|
+
useBlockedButtonClassName,
|
|
40
41
|
} from "@stapel/tokens-antd/skin";
|
|
41
42
|
import { spacing } from "@stapel/tokens";
|
|
42
43
|
import { WorkspaceList } from "../headless/WorkspaceList.js";
|
|
@@ -100,6 +101,7 @@ function PageBody(props: {
|
|
|
100
101
|
// this screen, and the button points at it.
|
|
101
102
|
const listState = loadStateFromQuery(listQuery);
|
|
102
103
|
const listFailed = listState.status === "failed";
|
|
104
|
+
const blockedLook = useBlockedButtonClassName();
|
|
103
105
|
const createGate = requireLoaded(listState, (loaded) =>
|
|
104
106
|
loaded.can_create_workspace === true
|
|
105
107
|
? actionAvailable()
|
|
@@ -129,7 +131,12 @@ function PageBody(props: {
|
|
|
129
131
|
{listFailed ? (
|
|
130
132
|
<Button
|
|
131
133
|
type="primary"
|
|
132
|
-
disabled
|
|
134
|
+
// `aria-disabled` + antd's own unavailable paint, never html
|
|
135
|
+
// `disabled`: the button has to stay focusable for the
|
|
136
|
+
// `aria-describedby` below to be announced at all, and it
|
|
137
|
+
// carries no `onClick`, so there is nothing to suppress.
|
|
138
|
+
aria-disabled
|
|
139
|
+
className={blockedLook}
|
|
133
140
|
aria-describedby={failureId}
|
|
134
141
|
data-disabled-reason="the roster read failed; the alert below says so once and carries the retry"
|
|
135
142
|
data-analytics="none"
|
package/src/default/parts.tsx
CHANGED
|
@@ -15,7 +15,7 @@ import type { CSSProperties, ReactElement, ReactNode } from "react";
|
|
|
15
15
|
import { Avatar, Button, Flex, Tag, Typography } from "antd";
|
|
16
16
|
import { STAPEL_UI_KEYS, useT } from "@stapel/core";
|
|
17
17
|
import type { ActionAvailability } from "@stapel/core";
|
|
18
|
-
import { ErrorAlert } from "@stapel/tokens-antd/skin";
|
|
18
|
+
import { ErrorAlert, useBlockedButtonClassName } from "@stapel/tokens-antd/skin";
|
|
19
19
|
import { spacing, fontSize } from "@stapel/tokens";
|
|
20
20
|
|
|
21
21
|
/** The muted sentence that sits under a control or beside a value. */
|
|
@@ -204,6 +204,7 @@ export function RowActions(props: {
|
|
|
204
204
|
}): ReactElement {
|
|
205
205
|
const t = useT();
|
|
206
206
|
const reasonId = useId();
|
|
207
|
+
const blockedLook = useBlockedButtonClassName();
|
|
207
208
|
|
|
208
209
|
const collected: string[] = [];
|
|
209
210
|
if (props.reason !== undefined) {
|
|
@@ -228,11 +229,17 @@ export function RowActions(props: {
|
|
|
228
229
|
type="link"
|
|
229
230
|
size="small"
|
|
230
231
|
danger={action.danger === true}
|
|
231
|
-
disabled
|
|
232
|
+
// `aria-disabled` and painted unavailable, never html `disabled`:
|
|
233
|
+
// an inert button fires nothing, so it cannot be focused, cannot
|
|
234
|
+
// be described to the screen reader that never reaches it, and
|
|
235
|
+
// cannot acknowledge the tap. The action is withheld by not
|
|
236
|
+
// wiring `onClick`, which is this row's own suppression.
|
|
237
|
+
{...(action.gate.available
|
|
238
|
+
? { onClick: action.onClick }
|
|
239
|
+
: { "aria-disabled": true as const, className: blockedLook })}
|
|
232
240
|
{...(anyBlocked && !action.gate.available
|
|
233
241
|
? { "aria-describedby": reasonId }
|
|
234
242
|
: {})}
|
|
235
|
-
onClick={action.onClick}
|
|
236
243
|
data-analytics="none"
|
|
237
244
|
data-analytics-reason="passthrough — the caller's onClick carries the tracked action"
|
|
238
245
|
{...(action.testId !== undefined ? { "data-testid": action.testId } : {})}
|