Skip to content

Commit 47a1734

Browse files
committed
Merge 3fecfc2 (#8110) as a dependency
# Conflicts: # packages/core/src/motion/uikit/index.ts
2 parents 0b31ddb + 3fecfc2 commit 47a1734

36 files changed

Lines changed: 5085 additions & 28 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[internal] AlertDialog's touch tracking runs on the shared action-group tracker, the one any gesture recognizer can drive (a menu tracking the finger that opened it from its trigger, a segmented control, a page control). AlertDialog's behavior is unchanged.
6+
7+
@vjeux

‎.changeset/action-group-tracker.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[internal] One tracker for a held finger across a group of targets (an alert's or an action sheet's actions, a menu's rows, a segmented control's segments, a page control's dots): it reads the targets' rects once, resolves the finger against them (or by the owner's rule), paints or reports the highlight, and runs the target through its own click at the lift. Nothing a consumer sees changes.
6+
7+
@vjeux
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[fix] AlertDialog: on a touch screen, under a finger or a pen, the two actions are tracked as one group, the way iOS tracks an alert's actions. A finger that lands on one action and slides to the other now runs the action it lifts on. Before, iOS Safari ran the action the finger first touched (Delete, when the finger slid to Cancel), and other browsers ran nothing and left the alert open. The touched action highlights as soon as it is touched instead of 150 ms later, the highlight follows the finger between the actions, and lifting off both still runs nothing. A mouse, the keyboard and assistive technology keep each button's own click, and text stays selectable with a mouse.
6+
7+
@vjeux
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@astryxdesign/core': patch
3+
'@astryxdesign/cli': patch
4+
---
5+
6+
[feat] AlertDialog: under a finger the alert appears and leaves the way an iOS alert does. It scales down into place from 1.2 while it and the dimming fade in, and it fades out with the dimming when it closes, on the alert's measured spring; the animation keeps running when the page is busy. While it appears a touch does nothing (keys and assistive technology still act), and while it leaves nothing reaches it: a touch, a click, a key or an assistive-technology activation does nothing. With reduced motion it only cross-fades. With a mouse nothing changes. Themes can retune the alert's presentation and dismissal durations (`alertController.present.durationMs`, `alertController.dismiss.durationMs`), listed in `astryx docs motion`.
7+
8+
@vjeux

‎.changeset/touch-selection-lock.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[experimental] A held finger or pen no longer starts text selection or the iOS callout on a press-tracked control or cell, or on a recognizer created with the new `preventsTextSelection` option (`@astryxdesign/core/gestures/experimental`), as on UIKit controls. The gesture host turns them off for the contact and restores them when it ends, on a non-text input under the finger inside such an element too (WebKit's own style makes every input selectable), and only for recognizers that would take the touch; the document press controller (`usePressFeedback` rows) takes the same lock on any coarse pointer. Text fields keep their selection, a mouse keeps desktop selection, and other pans leave their content selectable.
6+
7+
@vjeux

‎packages/cli/assets/docs/motion.doc.mjs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@ const calmTheme = defineTheme({
184184
headers: ['Role', 'CSS variable', 'Kind', 'Default'],
185185
rows: [
186186
// motion-roles:start (generated by scripts/generate-motion-roles.mjs)
187+
[
188+
'alertController.dismiss.durationMs',
189+
'--motion-alert-controller-dismiss-duration-ms',
190+
'duration',
191+
'404ms',
192+
],
193+
[
194+
'alertController.present.durationMs',
195+
'--motion-alert-controller-present-duration-ms',
196+
'duration',
197+
'404ms',
198+
],
187199
[
188200
'navigation.transitionMs',
189201
'--motion-navigation-transition-ms',

‎packages/cli/test/__golden__/no-icon-set/docs-topics.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"touch-motion",
202202
"best-practices"
203203
],
204-
"skeleton": "d2f0fea1e87d53e70f4e7f542844d17c6fecf13c25300df0ed1d0cac71aa4023",
204+
"skeleton": "811a2fd09827321c397207e21618b5afb222a835ba9c8f0b0dd2d94cf8487fce",
205205
"mentions": []
206206
},
207207
"principles": {

‎packages/core/src/AlertDialog/AlertDialog.doc.mjs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const docs = {
2121
],
2222
usage: {
2323
description:
24-
'AlertDialog asks the user to confirm a destructive or irreversible action before it happens. Use it for things like deleting content, revoking access, or discarding unsaved changes.\n\nIt implements the WAI-ARIA APG [Alert Dialog pattern](https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/): `role="alertdialog"`, a title linked by `aria-labelledby`, a consequence description linked by `aria-describedby`, focus moved into the dialog on open and returned to the trigger on close, and no dismissal by clicking outside. Escape cancels.\n\nAlertDialog passes its requested width through to Dialog, which clamps the surface to the container and dynamic viewport with token gutters. Generic Dialog footers should wrap, but Dialog does not own action semantics or order; consumer composition controls that. AlertDialog owns its confirmation semantics: above 640px, actions render horizontally and may move onto another row; at 640px and below, the destructive action appears above Cancel and both buttons fill the footer width. Button labels retain their standard single-line behavior. The breakpoint follows available width, not pointer or hover capability. The body scrolls when block space is constrained.\n\nFor cases where you want to show an alert without managing open state, use the `useImperativeAlertDialog` hook: call `alert.show(options)` and render `alert.element` in your tree.',
24+
'AlertDialog asks the user to confirm a destructive or irreversible action before it happens. Use it for things like deleting content, revoking access, or discarding unsaved changes.\n\nIt implements the WAI-ARIA APG [Alert Dialog pattern](https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/): `role="alertdialog"`, a title linked by `aria-labelledby`, a consequence description linked by `aria-describedby`, focus moved into the dialog on open and returned to the trigger on close, and no dismissal by clicking outside. Escape cancels.\n\nAlertDialog passes its requested width through to Dialog, which clamps the surface to the container and dynamic viewport with token gutters. Generic Dialog footers should wrap, but Dialog does not own action semantics or order; consumer composition controls that. AlertDialog owns its confirmation semantics: above 640px, actions render horizontally and may move onto another row; at 640px and below, the destructive action appears above Cancel and both buttons fill the footer width. Button labels retain their standard single-line behavior. The breakpoint follows available width, not pointer or hover capability. The body scrolls when block space is constrained.\n\nOn a touch screen the two actions are tracked as one group under a finger or a pen, the way iOS tracks the actions of an alert: the action under the finger highlights as soon as it is touched, the highlight follows the finger from one action to the other, and lifting the finger runs the action under it. Lifting it off both actions runs nothing. A mouse, the keyboard and assistive technology keep the click of each button.\n\nUnder a finger, on any touch device, the alert also appears and leaves the way an iOS alert does: it scales down slightly into place while it and the dimming fade in, and it fades out with the dimming when it closes. While it appears a touch does nothing (keys and assistive technology still act), and while it leaves nothing reaches it: a touch, a click, a key or an assistive-technology activation does nothing. With reduced motion it only cross-fades. With a mouse it keeps the theme entrance and closes at once.\n\nFor cases where you want to show an alert without managing open state, use the `useImperativeAlertDialog` hook: call `alert.show(options)` and render `alert.element` in your tree.',
2525
bestPractices: [
2626
{
2727
guidance: true,
@@ -174,7 +174,7 @@ export const docs = {
174174
type: 'number | string',
175175
default: '400',
176176
description:
177-
'Requested dialog width. Dialog preserves this preferred width and clamps it to the container and dynamic viewport with token gutters.',
177+
'Requested dialog width. Dialog preserves this preferred width and clamps it to the container and dynamic viewport with token gutters. Without one, a finger gets the iOS alert width, 320.',
178178
},
179179
{
180180
name: 'isInline',
@@ -196,7 +196,7 @@ export const docsDense = {
196196
'Confirms destructive/irreversible action before it happens (delete, revoke access, discard unsaved changes).',
197197
usage: {
198198
description:
199-
'AlertDialog confirms destructive/irreversible action (delete, revoke access, discard changes). Implements WAI-ARIA APG Alert Dialog pattern (https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/): role="alertdialog", aria-labelledby title, aria-describedby description, focus into dialog on open + back to trigger on close, no outside-click dismissal, Escape cancels. Dialog preserves requested width + clamps it to container/dynamic viewport gutters. Generic Dialog footers wrap while consumers own action order. AlertDialog owns confirmation action layout: >640px horizontal buttons may move to another row; <=640px puts the destructive action above Cancel and makes both buttons full width regardless of pointer/hover capability. Button labels remain single-line. Body scrolls when height constrained. To show w/o managing open state, use useImperativeAlertDialog hook: call alert.show(options) + render alert.element in tree.',
199+
'AlertDialog confirms destructive/irreversible action (delete, revoke access, discard changes). Implements WAI-ARIA APG Alert Dialog pattern (https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/): role="alertdialog", aria-labelledby title, aria-describedby description, focus into dialog on open + back to trigger on close, no outside-click dismissal, Escape cancels. Dialog preserves requested width + clamps it to container/dynamic viewport gutters. Generic Dialog footers wrap while consumers own action order. AlertDialog owns confirmation action layout: >640px horizontal buttons may move to another row; <=640px puts the destructive action above Cancel and makes both buttons full width regardless of pointer/hover capability. Button labels remain single-line. Body scrolls when height constrained. Touch (finger or pen): both actions tracked as one group like iOS alerts (action under finger highlights at once, highlight follows finger between actions, lift runs action under finger, lift off both runs nothing); mouse/keyboard/AT keep each button click. Under a finger (any touch device), motion like iOS alerts: scales down into place + fades in with the dim, fades out with the dim on close; touch ignored while it appears (keys/AT still act), no input (touch, click, key, AT) while it leaves; reduced motion = cross-fade only; with a mouse, theme entrance + closes at once. To show w/o managing open state, use useImperativeAlertDialog hook: call alert.show(options) + render alert.element in tree.',
200200
bestPractices: [
201201
{
202202
guidance: true,

0 commit comments

Comments
 (0)