An open source design system that's fully customizable and agent ready
TypeScript
perf(core): one export per UIKit gesture group (#8468)
Cindy Zhang16770e300706
diff --git a/.changeset/uikit-gestures-named-groups.md b/.changeset/uikit-gestures-named-groups.mdnew file mode 100644index 0000000000..1a0476203a--- /dev/null+++ b/.changeset/uikit-gestures-named-groups.md@@ -0,0 +1,7 @@+---+'@astryxdesign/core': patch+---++[chore] Internal: the UIKit gesture thresholds are one export per recognizer (`UIKIT_TAP`, `UIKIT_PAN`, `UIKIT_PRESS`, …), so a touch component bundles only the group it reads. The table's notes say that the status-bar scroll-to-top does not coast under Reduce Motion and that UIKit's Reduce Motion menu spring is never played. No behavior change.++@cixzhangdiff --git a/packages/core/src/motion/uikit/gestures.test.ts b/packages/core/src/motion/uikit/gestures.test.tsindex 2b80409c21..bdeb7dbd5a 100644--- a/packages/core/src/motion/uikit/gestures.test.ts+++ b/packages/core/src/motion/uikit/gestures.test.ts@@ -12,10 +12,13 @@import {describe, expect, it} from 'vitest';import {PRESS_GESTURE_MEMORY_MS} from '../../utils/pressFeedback';import {PRESS_SLOP_PX} from '../../utils/pressGesture';+import {press} from './timing';import {HAPTIC_FEEDBACK_KINDS,HAPTIC_VIBRATION_PATTERNS,UIKIT_GESTURES,+ UIKIT_PRESS,+ UIKIT_ROTATION,type GestureConstant,} from './gestures';@@ -63,6 +66,13 @@ describe('UIKIT_GESTURES', () => {expect(UIKIT_GESTURES.press.momentumMemory.value).toBe(PRESS_GESTURE_MEMORY_MS,);+ // Written as numbers in the table so each group bundles alone.+ expect(UIKIT_PRESS.quickTapFlash.value).toBe(press.flashMs);+ expect(UIKIT_PRESS.scrollBrake.value).toBe(press.scrollBrakeMs);+ expect(UIKIT_ROTATION.hysteresis.value).toBeCloseTo(+ (5 * Math.PI) / 180,+ 15,+ );});it('keeps the pan decision within the distance WebKit claims a scroll at', () => {diff --git a/packages/core/src/motion/uikit/gestures.ts b/packages/core/src/motion/uikit/gestures.tsindex 77243930da..4e6963b375 100644--- a/packages/core/src/motion/uikit/gestures.ts+++ b/packages/core/src/motion/uikit/gestures.ts@@ -3,8 +3,10 @@/*** @file gestures.ts* @input Nothing: plain data- * @output Exports UIKIT_GESTURES, the gesture thresholds gesture recognizers- * read, and the GestureConstant type: a value and its unit+ * @output Exports one constant per recognizer or domain (UIKIT_TAP,+ * UIKIT_LONG_PRESS, UIKIT_PAN, …, UIKIT_PRESS, UIKIT_VELOCITY), the gesture+ * thresholds recognizers read, a reader importing only its group; their+ * union UIKIT_GESTURES; and the GestureConstant type: a value and its unit* @position Gesture half of the UIKit constants table. Springs, scroll* physics and timing live beside it in this folder; no component carries a* gesture number of its own.@@ -18,9 +20,9 @@* that will confirm or replace them (MEASUREMENTS.md lists them all).* uikit.test.ts enforces both. Only the value and its unit ship: where a* number comes from stays in its JSDoc, out of the bundle. The press clocks- * are the same entries as `DELAYS_CONTENT_TOUCHES_MS` (`scroll.delaysContentTouchesMs`)- * and `press` (`timing.press`), imported by name so reading one threshold- * does not bundle the scroll and timing tables. Safari on iOS runs UIKit's own+ * are the same values as `DELAYS_CONTENT_TOUCHES_MS` and timing's `press`,+ * written as numbers so each group bundles alone; gestures.test.ts holds+ * them equal. Safari on iOS runs UIKit's own* recognizers for tap-to-click, long press, double tap and the start of a* page scroll, so many guesses can be settled by measuring Safari itself.*@@ -39,7 +41,6 @@*/import {DELAYS_CONTENT_TOUCHES_MS} from './scroll';-import {press} from './timing';export type GestureConstantUnit ='px' | 'ms' | 'px/s' | 'rad' | 'ratio' | 'count';@@ -53,216 +54,245 @@ export interface GestureConstant<T = number> {readonly unit: GestureConstantUnit;}+export const UIKIT_TAP = {+ /**+ * How far each finger may travel from where it landed before a tap+ * fails, as a distance.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: UITapGestureRecognizer+ * _allowableMovement 45; 44 pt taps, 46 pt fails, the same on the+ * diagonal+ */+ allowableMovement: {value: 45, unit: 'px'},+ /**+ * Longest interval between one tap lifting and the next landing.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: _maximumIntervalBetweenSuccessiveTaps+ * 0.35 s; 330 ms double-taps, 370 ms does not+ */+ maximumIntervalBetweenTaps: {value: 350, unit: 'ms'},+ /**+ * How far a later tap may land from the first one of the sequence.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: _allowableSeparation is unbounded and+ * the 45 pt movement rule applies between taps; 44 pt double-taps, 46+ * does not+ */+ allowableSeparation: {value: 45, unit: 'px'},+ /**+ * Longest a finger may stay down and still tap.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: maximumTapDuration 1.5 s; a 1.4 s hold+ * taps, 1.6 s does not+ */+ maximumTapDuration: {value: 1500, unit: 'ms'},+} as const satisfies Record<string, GestureConstant>;++export const UIKIT_LONG_PRESS = {+ /**+ * UILongPressGestureRecognizer.minimumPressDuration default.+ * @source apple-docs+ * https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer/minimumpressduration+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: _minimumPressDuration 0.5+ */+ minimumPressDuration: {value: 500, unit: 'ms'},+ /**+ * UILongPressGestureRecognizer.allowableMovement default, a distance.+ * @source apple-docs+ * https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer/allowablemovement+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: a (7, 7) drift begins, (7.2, 7.2) fails+ */+ allowableMovement: {value: 10, unit: 'px'},+} as const satisfies Record<string, GestureConstant>;++export const UIKIT_PAN = {+ /**+ * Travel before a pan begins, PER AXIS: |dx| or |dy| reaching it. The+ * translation is reset when the pan begins, so the hysteresis is not+ * part of it. Kept below the distance at which WebKit claims a drag for+ * scrolling, so a pan that must cancel the native scroll still sees+ * cancelable `touchmove`s.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: UIPanGestureRecognizer _hysteresis 10; x+ * and y began at 10.0, a diagonal at (10.67, 10.67); translation(in:) is+ * 0 at .began+ */+ hysteresis: {value: 10, unit: 'px'},+} as const satisfies Record<string, GestureConstant>;++export const UIKIT_SWIPE = {+ /**+ * Travel along the swipe direction before a swipe is recognized.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: UISwipeGestureRecognizer minimum primary+ * movement 50; recognized during the motion; 40 pt does not+ */+ minimumDistance: {value: 50, unit: 'px'},+ /**+ * Longest a swipe may take before it fails.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: UISwipeGestureRecognizer maximum+ * duration 0.5 s+ */+ maximumDuration: {value: 500, unit: 'ms'},+ /**+ * Travel across the swipe direction that fails it.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: UISwipeGestureRecognizer maximum+ * secondary movement 50+ */+ maximumSecondaryMovement: {value: 50, unit: 'px'},+ /**+ * How the minimum movement relaxes over time. Read, not modelled: a+ * 120 pt swipe over 0.8 s was recognized at 303 ms, below 50 pt of travel.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: UISwipeGestureRecognizer+ * rateOfMinimumMovementDecay 0.06 (not modelled)+ */+ minimumMovementDecay: {value: 0.06, unit: 'ratio'},+} as const satisfies Record<string, GestureConstant>;++export const UIKIT_PINCH = {+ /**+ * Change of the distance between two fingers before a pinch begins. The+ * scale is then measured against the starting span moved by this much,+ * so it does not jump.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: UIPinchGestureRecognizer _hysteresis 8;+ * out from 120 began at 144 with scale 1.125 (= 144 / 128)+ */+ hysteresis: {value: 8, unit: 'px'},+} as const satisfies Record<string, GestureConstant>;++export const UIKIT_ROTATION = {+ /**+ * Rotation of the two-finger vector before a rotation begins.+ * @source GUESS — UIRotationGestureRecognizer has no scalar threshold among+ * its ivars; 5 degrees. The simulator HID cannot rotate two fingers: a+ * device run (or an XCUITest rotate) logging the angle at .began.+ * @measure M-G10+ */+ // 5° in radians, written out so the group bundles alone.+ hysteresis: {value: 0.08726646259971647, unit: 'rad'},+} as const satisfies Record<string, GestureConstant>;++export const UIKIT_SCREEN_EDGE_PAN = {+ /**+ * Width of the band at the screen edge a touch must land in.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: UIScreenEdgePanGestureRecognizer+ * _edgeRegionSize 40.2 on a 402 pt wide screen (10 % of it); edge pans+ * cannot begin from simulator HID+ */+ edgeRegion: {value: 40.2, unit: 'px'},+ /**+ * Travel before an edge pan begins.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: the screen-edge pan hysteresis ivar 15+ */+ hysteresis: {value: 15, unit: 'px'},+} as const satisfies Record<string, GestureConstant>;++export const UIKIT_CONTROL = {+ /**+ * How far outside its bounds a UIControl keeps a press inside: a finger+ * dragged out is still "inside" until it passes this margin.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: UIButton (.system) stays inside up to 70+ * pt out, touchDragExit at 71, touchDragEnter at 69 coming back;+ * touchUpInside up to 70, touchUpOutside from 71+ */+ trackingExpansion: {value: 70, unit: 'px'},+} as const satisfies Record<string, GestureConstant>;++export const UIKIT_PRESS = {+ /**+ * UIScrollView.delaysContentTouches: a touch in a scroller highlights after+ * this.+ * @source measured: Settings and Contacts, iOS 26.2 simulator, HID touches+ * filmed at 60 fps (utils/pressGesture.ts), Oct 6 2026+ */+ contentTouchDelay: {value: DELAYS_CONTENT_TOUCHES_MS, unit: 'ms'},+ /**+ * A tap shorter than the delay shows the highlight at the lift for this+ * long.+ * @source measured: Settings and Contacts, iOS 26.2 simulator, HID touches+ * filmed at 60 fps (utils/pressGesture.ts), Oct 6 2026+ */+ quickTapFlash: {value: 100, unit: 'ms'},+ /**+ * Travel at which a press is a scroll, not a press.+ * @source measured: Mobile Safari 26.2, iOS 26.2 simulator, slow HID drag+ * on a scrollable page (1 pt steps): last cancelable touchmove at 10 px,+ * pointercancel and the first uncancelable touchmove at 11 px, Oct 23+ * 2026+ */+ slop: {value: 10, unit: 'px'},+ /**+ * A touch this soon after a finger-driven scroll moved is a brake, not a+ * press.+ * @source measured: Settings and Contacts, iOS 26.2 simulator, HID touches+ * filmed at 60 fps (utils/pressGesture.ts), Oct 6 2026+ */+ scrollBrake: {value: 150, unit: 'ms'},+ /**+ * How long after a finger was down a scroll can still be that finger's+ * momentum (the brake only counts scrolls a finger drove).+ * @source GUESS — The press model bound (utils/pressFeedback.ts): iOS+ * momentum runs for a second or two after the lift.+ * @measure M-G19+ */+ momentumMemory: {value: 3000, unit: 'ms'},+} as const satisfies Record<string, GestureConstant>;++export const UIKIT_VELOCITY = {+ /**+ * UIPanGestureRecognizer.velocity(in:) is this times the newest event's+ * instantaneous velocity plus the rest times the previous event's+ * (instantaneous velocity: position change over timestamp change between+ * consecutive events, the touch-down counting as the first). The lift+ * does not update it, and a finger at rest sends no events, so a release+ * after a pause reports the last moving value.+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed+ * with HID touches, Oct 23 2026: fitted to all 69 velocity(in:) values of+ * six HID streams (constant, accelerating, pauses before the lift) to 0.0+ * pt/s+ */+ currentWeight: {value: 0.2, unit: 'ratio'},+} as const satisfies Record<string, GestureConstant>;++export const UIKIT_CLICK = {+ /**+ * Longest the system waits for the browser's click after a touch it+ * swallows. iOS and Chromium deliver it right after `touchend`; this only+ * bounds a click that never comes.+ * @source GUESS — A safety bound, not a UIKit number.+ * @measure M-G17+ */+ strayClickWindow: {value: 1000, unit: 'ms'},+} as const satisfies Record<string, GestureConstant>;++/**+ * Every group in one object, for a reader that needs several. A reader of+ * one group imports it by name instead (`UIKIT_PAN`): object properties do+ * not tree-shake, so this object bundles every group+ * (`architecture:component-style-authoring` INV6).+ */export const UIKIT_GESTURES = {- tap: {- /**- * How far each finger may travel from where it landed before a tap- * fails, as a distance.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: UITapGestureRecognizer- * _allowableMovement 45; 44 pt taps, 46 pt fails, the same on the- * diagonal- */- allowableMovement: {value: 45, unit: 'px'},- /**- * Longest interval between one tap lifting and the next landing.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: _maximumIntervalBetweenSuccessiveTaps- * 0.35 s; 330 ms double-taps, 370 ms does not- */- maximumIntervalBetweenTaps: {value: 350, unit: 'ms'},- /**- * How far a later tap may land from the first one of the sequence.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: _allowableSeparation is unbounded and- * the 45 pt movement rule applies between taps; 44 pt double-taps, 46- * does not- */- allowableSeparation: {value: 45, unit: 'px'},- /**- * Longest a finger may stay down and still tap.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: maximumTapDuration 1.5 s; a 1.4 s hold- * taps, 1.6 s does not- */- maximumTapDuration: {value: 1500, unit: 'ms'},- },- longPress: {- /**- * UILongPressGestureRecognizer.minimumPressDuration default.- * @source apple-docs- * https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer/minimumpressduration- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: _minimumPressDuration 0.5- */- minimumPressDuration: {value: 500, unit: 'ms'},- /**- * UILongPressGestureRecognizer.allowableMovement default, a distance.- * @source apple-docs- * https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer/allowablemovement- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: a (7, 7) drift begins, (7.2, 7.2) fails- */- allowableMovement: {value: 10, unit: 'px'},- },- pan: {- /**- * Travel before a pan begins, PER AXIS: |dx| or |dy| reaching it. The- * translation is reset when the pan begins, so the hysteresis is not- * part of it. Kept below the distance at which WebKit claims a drag for- * scrolling, so a pan that must cancel the native scroll still sees- * cancelable `touchmove`s.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: UIPanGestureRecognizer _hysteresis 10; x- * and y began at 10.0, a diagonal at (10.67, 10.67); translation(in:) is- * 0 at .began- */- hysteresis: {value: 10, unit: 'px'},- },- swipe: {- /**- * Travel along the swipe direction before a swipe is recognized.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: UISwipeGestureRecognizer minimum primary- * movement 50; recognized during the motion; 40 pt does not- */- minimumDistance: {value: 50, unit: 'px'},- /**- * Longest a swipe may take before it fails.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: UISwipeGestureRecognizer maximum- * duration 0.5 s- */- maximumDuration: {value: 500, unit: 'ms'},- /**- * Travel across the swipe direction that fails it.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: UISwipeGestureRecognizer maximum- * secondary movement 50- */- maximumSecondaryMovement: {value: 50, unit: 'px'},- /**- * How the minimum movement relaxes over time. Read, not modelled: a- * 120 pt swipe over 0.8 s was recognized at 303 ms, below 50 pt of travel.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: UISwipeGestureRecognizer- * rateOfMinimumMovementDecay 0.06 (not modelled)- */- minimumMovementDecay: {value: 0.06, unit: 'ratio'},- },- pinch: {- /**- * Change of the distance between two fingers before a pinch begins. The- * scale is then measured against the starting span moved by this much,- * so it does not jump.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: UIPinchGestureRecognizer _hysteresis 8;- * out from 120 began at 144 with scale 1.125 (= 144 / 128)- */- hysteresis: {value: 8, unit: 'px'},- },- rotation: {- /**- * Rotation of the two-finger vector before a rotation begins.- * @source GUESS — UIRotationGestureRecognizer has no scalar threshold among- * its ivars; 5 degrees. The simulator HID cannot rotate two fingers: a- * device run (or an XCUITest rotate) logging the angle at .began.- * @measure M-G10- */- hysteresis: {value: (5 * Math.PI) / 180, unit: 'rad'},- },- screenEdgePan: {- /**- * Width of the band at the screen edge a touch must land in.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: UIScreenEdgePanGestureRecognizer- * _edgeRegionSize 40.2 on a 402 pt wide screen (10 % of it); edge pans- * cannot begin from simulator HID- */- edgeRegion: {value: 40.2, unit: 'px'},- /**- * Travel before an edge pan begins.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: the screen-edge pan hysteresis ivar 15- */- hysteresis: {value: 15, unit: 'px'},- },- control: {- /**- * How far outside its bounds a UIControl keeps a press inside: a finger- * dragged out is still "inside" until it passes this margin.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: UIButton (.system) stays inside up to 70- * pt out, touchDragExit at 71, touchDragEnter at 69 coming back;- * touchUpInside up to 70, touchUpOutside from 71- */- trackingExpansion: {value: 70, unit: 'px'},- },- press: {- /**- * UIScrollView.delaysContentTouches: a touch in a scroller highlights after- * this.- * @source measured: Settings and Contacts, iOS 26.2 simulator, HID touches- * filmed at 60 fps (utils/pressGesture.ts), Oct 6 2026- */- contentTouchDelay: {value: DELAYS_CONTENT_TOUCHES_MS, unit: 'ms'},- /**- * A tap shorter than the delay shows the highlight at the lift for this- * long.- * @source measured: Settings and Contacts, iOS 26.2 simulator, HID touches- * filmed at 60 fps (utils/pressGesture.ts), Oct 6 2026- */- quickTapFlash: {value: press.flashMs, unit: 'ms'},- /**- * Travel at which a press is a scroll, not a press.- * @source measured: Mobile Safari 26.2, iOS 26.2 simulator, slow HID drag- * on a scrollable page (1 pt steps): last cancelable touchmove at 10 px,- * pointercancel and the first uncancelable touchmove at 11 px, Oct 23- * 2026- */- slop: {value: 10, unit: 'px'},- /**- * A touch this soon after a finger-driven scroll moved is a brake, not a- * press.- * @source measured: Settings and Contacts, iOS 26.2 simulator, HID touches- * filmed at 60 fps (utils/pressGesture.ts), Oct 6 2026- */- scrollBrake: {value: press.scrollBrakeMs, unit: 'ms'},- /**- * How long after a finger was down a scroll can still be that finger's- * momentum (the brake only counts scrolls a finger drove).- * @source GUESS — The press model bound (utils/pressFeedback.ts): iOS- * momentum runs for a second or two after the lift.- * @measure M-G19- */- momentumMemory: {value: 3000, unit: 'ms'},- },- velocity: {- /**- * UIPanGestureRecognizer.velocity(in:) is this times the newest event's- * instantaneous velocity plus the rest times the previous event's- * (instantaneous velocity: position change over timestamp change between- * consecutive events, the touch-down counting as the first). The lift- * does not update it, and a finger at rest sends no events, so a release- * after a pause reports the last moving value.- * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed- * with HID touches, Oct 23 2026: fitted to all 69 velocity(in:) values of- * six HID streams (constant, accelerating, pauses before the lift) to 0.0- * pt/s- */- currentWeight: {value: 0.2, unit: 'ratio'},- },- click: {- /**- * Longest the system waits for the browser's click after a touch it- * swallows. iOS and Chromium deliver it right after `touchend`; this only- * bounds a click that never comes.- * @source GUESS — A safety bound, not a UIKit number.- * @measure M-G17- */- strayClickWindow: {value: 1000, unit: 'ms'},- },-} as const satisfies Record<string, Record<string, GestureConstant>>;+ tap: UIKIT_TAP,+ longPress: UIKIT_LONG_PRESS,+ pan: UIKIT_PAN,+ swipe: UIKIT_SWIPE,+ pinch: UIKIT_PINCH,+ rotation: UIKIT_ROTATION,+ screenEdgePan: UIKIT_SCREEN_EDGE_PAN,+ control: UIKIT_CONTROL,+ press: UIKIT_PRESS,+ velocity: UIKIT_VELOCITY,+ click: UIKIT_CLICK,+} as const;/*** The feedback kinds UIKit's generators offer: UISelectionFeedbackGenerator,diff --git a/packages/core/src/motion/uikit/index.ts b/packages/core/src/motion/uikit/index.tsindex 7f10784449..6eb75fba2d 100644--- a/packages/core/src/motion/uikit/index.ts+++ b/packages/core/src/motion/uikit/index.ts@@ -4,7 +4,8 @@* @file index.ts* @input The domain files of the UIKit constants table* @output Re-exports `springs`, `scroll`, `timing`, `navigation` and the- * gesture thresholds (`UIKIT_GESTURES` and the haptic tables)+ * gesture thresholds (one `UIKIT_*` group per recognizer, their union+ * `UIKIT_GESTURES`, and the haptic tables)* @position Entry of the UIKit constants table (motion/uikit). Internal to* core: not exported from the package entry point*@@ -20,7 +21,18 @@export {HAPTIC_FEEDBACK_KINDS,HAPTIC_VIBRATION_PATTERNS,+ UIKIT_CLICK,+ UIKIT_CONTROL,UIKIT_GESTURES,+ UIKIT_LONG_PRESS,+ UIKIT_PAN,+ UIKIT_PINCH,+ UIKIT_PRESS,+ UIKIT_ROTATION,+ UIKIT_SCREEN_EDGE_PAN,+ UIKIT_SWIPE,+ UIKIT_TAP,+ UIKIT_VELOCITY,type GestureConstant,type GestureConstantUnit,type HapticFeedbackKind,diff --git a/packages/core/src/motion/uikit/scroll.ts b/packages/core/src/motion/uikit/scroll.tsindex 833e93c996..b4eefd7876 100644--- a/packages/core/src/motion/uikit/scroll.ts+++ b/packages/core/src/motion/uikit/scroll.ts@@ -113,7 +113,9 @@ export const scroll = {* approaches the top as 1 − e^(−9.7 t) whatever the distance (done in about* 1.6 s for 500, 2000 or 8000 pt), which is a decay at this per-millisecond* rate (e^(−0.0097)) whose rest point is the top: a decay with a- * starting velocity of 9.7 × the distance per second.+ * starting velocity of 9.7 × the distance per second. It is not a throw's+ * momentum, so under Reduce Motion it does not coast: it follows+ * `design:reduced-motion` DR2 (the coast exception covers only a throw).* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,* iPhone 17 Pro, setContentOffset log after status-bar taps (starts 85–95* ms after the tap), Oct 23 2026diff --git a/packages/core/src/motion/uikit/springs.ts b/packages/core/src/motion/uikit/springs.tsindex 569d345c14..cd6d1a152e 100644--- a/packages/core/src/motion/uikit/springs.ts+++ b/packages/core/src/motion/uikit/springs.ts@@ -262,10 +262,11 @@ export const springs = {*/contextMenuDismiss: MENU_CLOSE_SPRING,/**- * Menus opening and closing under Reduce Motion: critically damped,- * slower, no overshoot. A reference reading only: under reduced motion a- * touch presentation follows `design:reduced-motion` DR2 and DR4, not this- * spring (`spec:AST-094` FR8).+ * What UIKit plays for a menu with Reduce Motion on: critically damped,+ * slower, no overshoot. A reference reading of UIKit only, never played:+ * under reduced motion no core transition springs (`design:reduced-motion`+ * DR1); a touch presentation cross-fades instead (DR2), and nothing opts+ * out (DR4, `spec:AST-094` FR8).* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,* iPhone 17 Pro, `_animateUsingSpringWithDampingRatio:response:tracking:`* hooked with Reduce Motion on (1.0, 0.4), Oct 23 2026diff --git a/packages/core/src/motion/uikit/uikit.test.ts b/packages/core/src/motion/uikit/uikit.test.tsindex 3ac1607fdd..ce0accc192 100644--- a/packages/core/src/motion/uikit/uikit.test.ts+++ b/packages/core/src/motion/uikit/uikit.test.ts@@ -65,10 +65,23 @@ function leavesOf(file: string): Leaf[] {/^export const \w+ = \{$/.test(line) ? [index] : [],);expect(starts.length).toBeGreaterThan(0);- return starts.flatMap(start => leavesFrom(file, lines, start));+ // The groups this file exports itself: a leaf that only names one of them+ // is checked where that group is declared.+ const exported = new Set(+ lines.flatMap(line => {+ const match = /^export const (\w+) = \{$/.exec(line);+ return match == null ? [] : [match[1]];+ }),+ );+ return starts.flatMap(start => leavesFrom(file, lines, start, exported));}-function leavesFrom(file: string, lines: string[], start: number): Leaf[] {+function leavesFrom(+ file: string,+ lines: string[],+ start: number,+ exported: ReadonlySet<string>,+): Leaf[] {const leaves: Leaf[] = [];let doc = '';let inDoc = false;@@ -103,9 +116,10 @@ function leavesFrom(file: string, lines: string[], start: number): Leaf[] {if (trimmed.startsWith('} as const')) {break;}- // A group exported on its own and read back by name (`press,`): its- // leaves are checked where it is declared.- if (/^\w+,$/.test(trimmed)) {+ // A group exported on its own and read back by name (`press,` or+ // `tap: UIKIT_TAP,`): its leaves are checked where it is declared.+ const reference = /^(?:\w+: )?(\w+),$/.exec(trimmed);+ if (reference != null && exported.has(reference[1])) {doc = '';continue;}