Skip to content

Commit 87ef5e3

Browse files
authored
docs(SelectableCard): the forced-colors ring can scroll out of view, and disabled dims it (#14047)
docs(SelectableCard): the forced-colors ring can scroll out of view, and disabled dims it FR3's gap now says the ring on a fixed-height card whose content scrolls can leave view entirely, not only move. FR5 states that its half opacity also dims a selected disabled card's forced-colors ring, which WCAG 1.4.11 exempts as an inactive component.
1 parent 32adb4e commit 87ef5e3

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎docs/specs/components/SelectableCard/SelectableCard.spec.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ Consumer migration instructions belong in consumer docs and release notes.
141141

142142
## Behavioral and layout contract
143143

144-
| ID | Invariant | Basis |
145-
| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------ |
146-
| FR1 | SelectableCard renders `component:Card` with the given `variant`, `elevation`, `padding`, and sizing. The root also carries the `selectable-card` target reflecting `variant`, `selected`, and, while disabled, `disabled`, and the first child is a visually hidden native `input type="checkbox"` named by `label` with `checked` equal to `isSelected`. | Current source and tests |
147-
| FR2 | While enabled, a click on the card surface, a click or Space on the checkbox, or Enter on the checkbox calls `onChange(!isSelected)` exactly once. A click that belongs to nested interactive content, an open Tooltip or HoverCard surface (`component:Tooltip` FR11), or selected text does not toggle. A caller `onClick` runs after the toggle for a surface click, before it for a click or Space on the checkbox, and not at all for Enter; it also runs for clicks that do not toggle, including a click inside an open Tooltip or HoverCard surface. At the next minor, staged as `[breaking]`, a click inside an open layer stops at the layer root and the caller `onClick` no longer receives it (`architecture:layer-runtime` INV17); implementation gap: the current source still delivers that click to `onClick`. A caller `onMouseUp` runs after the card's own handling. | Current source and tests |
148-
| FR3 | Selection adds a 2px inset ring through Card's ring variable, so layout does not move, and composes with any elevation shadow. `default`, `transparent`, and `muted` ring in `--color-accent`; each palette variant rings in its `--color-border-<name>`; a theme-added variant rings in `--selectable-card-ring-color`. Selection also colors the border in the ring color where Card draws one, which is only the `default` variant. Under forced colors, which drop the ring's shadow and repaint the border, a selected card, enabled or disabled, draws a 2px ring in the system `Highlight` color inside its edge instead, on a layer that takes no space and that a theme's border color on the card does not reach, so the selection stays visible, a toggle moves nothing, and the ring keeps `Highlight` under a theme that sets the card's border color; an unselected card draws none. On a fixed-height card whose content scrolls, the ring scrolls with that content. | Current source and tests |
149-
| FR4 | While enabled, the surface paints the shared hover overlay under a hover-capable pointer and the pressed overlay for mouse and touch presses; a press from any pointer that starts on a nested interactive element shows no pressed paint on the card, since it does not activate the card (`architecture:press-feedback` INV7). A touch press shows at once. Under the touch presentation, its release fades on the theme's exit motion tokens (`--duration-exit`, `--ease-exit`), per `spec:AST-094` FR5; a mouse press keeps the card's desktop press styling. Keyboard focus on the hidden checkbox shows one indicator on the card root (`architecture:interaction-modality` INV3). | Current source and tests |
150-
| FR5 | `isDisabled` dims the card to half opacity, removes the card's own click and mouseup handling and the caller's `onClick` and `onMouseUp` (other caller event props still reach the root) and the hover and pressed overlays (`spec:AST-085` FR6), and keeps the checkbox focusable with `aria-disabled="true"`; no click, Space, or Enter calls `onChange`. The disabled state is reflected on the owning target as `data-disabled` (`architecture:component-theming-surface` INV6). | Current source and tests |
151-
| FR6 | `ref` reaches the Card root. Supported DOM, ARIA, data, and event props reach the root; `xstyle`, `className`, and `style` merge after the component's interactive styles. | Current source and tests |
144+
| ID | Invariant | Basis |
145+
| --- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
146+
| FR1 | SelectableCard renders `component:Card` with the given `variant`, `elevation`, `padding`, and sizing. The root also carries the `selectable-card` target reflecting `variant`, `selected`, and, while disabled, `disabled`, and the first child is a visually hidden native `input type="checkbox"` named by `label` with `checked` equal to `isSelected`. | Current source and tests |
147+
| FR2 | While enabled, a click on the card surface, a click or Space on the checkbox, or Enter on the checkbox calls `onChange(!isSelected)` exactly once. A click that belongs to nested interactive content, an open Tooltip or HoverCard surface (`component:Tooltip` FR11), or selected text does not toggle. A caller `onClick` runs after the toggle for a surface click, before it for a click or Space on the checkbox, and not at all for Enter; it also runs for clicks that do not toggle, including a click inside an open Tooltip or HoverCard surface. At the next minor, staged as `[breaking]`, a click inside an open layer stops at the layer root and the caller `onClick` no longer receives it (`architecture:layer-runtime` INV17); implementation gap: the current source still delivers that click to `onClick`. A caller `onMouseUp` runs after the card's own handling. | Current source and tests |
148+
| FR3 | Selection adds a 2px inset ring through Card's ring variable, so layout does not move, and composes with any elevation shadow. `default`, `transparent`, and `muted` ring in `--color-accent`; each palette variant rings in its `--color-border-<name>`; a theme-added variant rings in `--selectable-card-ring-color`. Selection also colors the border in the ring color where Card draws one, which is only the `default` variant. Under forced colors, which drop the ring's shadow and repaint the border, a selected card, enabled or disabled, draws a 2px ring in the system `Highlight` color inside its edge instead, on a layer that takes no space and that a theme's border color on the card does not reach, so the selection stays visible, a toggle moves nothing, and the ring keeps `Highlight` under a theme that sets the card's border color; an unselected card draws none. On a fixed-height card whose content scrolls, the ring scrolls with that content and can leave view entirely. | Current source and tests |
149+
| FR4 | While enabled, the surface paints the shared hover overlay under a hover-capable pointer and the pressed overlay for mouse and touch presses; a press from any pointer that starts on a nested interactive element shows no pressed paint on the card, since it does not activate the card (`architecture:press-feedback` INV7). A touch press shows at once. Under the touch presentation, its release fades on the theme's exit motion tokens (`--duration-exit`, `--ease-exit`), per `spec:AST-094` FR5; a mouse press keeps the card's desktop press styling. Keyboard focus on the hidden checkbox shows one indicator on the card root (`architecture:interaction-modality` INV3). | Current source and tests |
150+
| FR5 | `isDisabled` dims the card to half opacity, removes the card's own click and mouseup handling and the caller's `onClick` and `onMouseUp` (other caller event props still reach the root) and the hover and pressed overlays (`spec:AST-085` FR6), and keeps the checkbox focusable with `aria-disabled="true"`; no click, Space, or Enter calls `onChange`. The half opacity also dims a selected disabled card's forced-colors ring (FR3); WCAG 1.4.11 exempts inactive components from its contrast minimum. The disabled state is reflected on the owning target as `data-disabled` (`architecture:component-theming-surface` INV6). | Current source and tests |
151+
| FR6 | `ref` reaches the Card root. Supported DOM, ARIA, data, and event props reach the root; `xstyle`, `className`, and `style` merge after the component's interactive styles. | Current source and tests |
152152

153153
### Allowed variation
154154

0 commit comments

Comments
 (0)