You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c30794b
Browse filesBrowse the repository at this point in the historyBrowse files
feat(SelectableCard): under a finger the selection ring and border change in one frame
A selected card's mark is an inset ring, drawn in the card's shadow slot,
and the accent border. The ring cannot interpolate with the card's resting
shadow, so it appeared or vanished in one frame while the border faded over
the theme's fast duration: the mark changed in two steps. UIKit changes a
selection mark in the frame the selection lands (motion/uikit/selection.ts,
selection.mark.changeMs). Under a finger (a coarse primary pointer, the
touch resolver's TOUCH_QUERY, on every touch device) the card's box-shadow
and border-color transition now takes that clock, through the same
build-time mirror the checkbox and radio marks read
(Indicator/selectionMotion.stylex.ts), so ring and border change together.
A mouse keeps the theme's fade, and under Reduce Motion changes at once
(design:reduced-motion DR3).
[feat] Under a finger (a coarse primary pointer, on every touch device), a SelectableCard's selection mark now changes in one frame, as UIKit's selection marks do. Before, the inset ring appeared or vanished at once while the border faded over the theme's fast duration, so the mark changed in two steps. With a mouse the card keeps the theme's fade, and under Reduce Motion a mouse's change is now immediate.
{name: 'onChange',type: '(isSelected: boolean) => void',description: 'Called when toggled.',required: true},
27
-
{name: 'isDisabled',type: 'boolean',description: 'Disables the card.',default: 'false'},
46
+
{
47
+
name: 'label',
48
+
type: 'string',
49
+
description: 'Accessibility label.',
50
+
required: true,
51
+
},
52
+
{
53
+
name: 'isSelected',
54
+
type: 'boolean',
55
+
description:
56
+
'Controlled selection state. Under a finger (a coarse primary pointer) the selection ring and border change in one frame; with a mouse they fade over the theme’s fast duration.',
{name: 'elevation',type: "'none' | 'low' | 'med' | 'high'",description: 'Resting shadow depth. The selection ring composes on top, so a selected card keeps its shadow.',default: "'none'"},
{name: 'xstyle',type: 'StyleXStyles',description: 'StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value, not an inline style object like style={{}}.'},
94
+
{
95
+
name: 'xstyle',
96
+
type: 'StyleXStyles',
97
+
description:
98
+
'StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value, not an inline style object like style={{}}.',
{name: '--selectable-card-ring-color',description: 'Colour of the selection ring drawn for a variant a theme added. The built-in variants each ring in their own border token and ignore this; a theme that adds a variant sets it in the same rule as that variant\'s `backgroundColor`, because no token the component could pick is guaranteed to contrast with a fill it cannot know.',default: 'var(--color-accent)'},
42
-
{name: '--_press-overlay',description: 'Colour of the ::after interaction overlay for the hover and mouse states: transparent at rest, the hover overlay token on hover (hover-capable pointers), the pressed overlay token while a mouse holds `:active`. A press the touch press controller paints (`data-astryx-press`) is the overlay\'s image instead, at the press\'s strength, and the colour yields to it. Set on the card element by its own interaction arms.',default: 'transparent',private: true},
110
+
{
111
+
name: '--selectable-card-ring-color',
112
+
description:
113
+
"Colour of the selection ring drawn for a variant a theme added. The built-in variants each ring in their own border token and ignore this; a theme that adds a variant sets it in the same rule as that variant's `backgroundColor`, because no token the component could pick is guaranteed to contrast with a fill it cannot know.",
114
+
default: 'var(--color-accent)',
115
+
},
116
+
{
117
+
name: '--_press-overlay',
118
+
description:
119
+
"Colour of the ::after interaction overlay for the hover and mouse states: transparent at rest, the hover overlay token on hover (hover-capable pointers), the pressed overlay token while a mouse holds `:active`. A press the touch press controller paints (`data-astryx-press`) is the overlay's image instead, at the press's strength, and the colour yields to it. Set on the card element by its own interaction arms.",
/** The instant key of the Reduce Motion policy (motion/reducedMotion.ts). */
59
+
constREDUCED_MOTION_INSTANT=
60
+
'(prefers-reduced-motion: reduce) and (not (pointer: coarse))';
61
+
62
+
describe('SelectableCard selection mark',()=>{
63
+
it('changes its ring and border in one frame under a finger, keeps the theme’s duration with a mouse, and changes at once with a mouse under Reduce Motion',()=>{
0 commit comments