@astryxdesign/core 0.7.6 → 0.7.7-canary.1d04d40
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/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +23 -3
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +16 -9
- package/dist/Chat/ChatComposerInput.d.ts +9 -0
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +2 -0
- package/dist/Chat/ChatMessage.js +2 -2
- package/dist/Chat/chatMessage.vars.stylex.d.ts +8 -8
- package/dist/Chat/chatMessage.vars.stylex.js +8 -8
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +8 -1
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +72 -2
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +6 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts +13 -3
- package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -1
- package/dist/DropdownMenu/useMenuOverflow.js +31 -8
- package/dist/Field/PanelSearchInput.d.ts.map +1 -1
- package/dist/Field/PanelSearchInput.js +8 -1
- package/dist/Field/textEntryTraits.d.ts +6 -6
- package/dist/Field/textEntryTraits.js +6 -6
- package/dist/Layer/layerClickBoundary.d.ts +7 -1
- package/dist/Layer/layerClickBoundary.d.ts.map +1 -1
- package/dist/Layer/layerClickBoundary.js +2 -2
- package/dist/Layer/usePressPin.d.ts +95 -0
- package/dist/Layer/usePressPin.d.ts.map +1 -0
- package/dist/Layer/usePressPin.js +335 -0
- package/dist/Layer/useTouchTrigger.d.ts +23 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +29 -2
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +1 -0
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +20 -9
- package/dist/ProgressBar/ProgressBarTouch.d.ts +29 -0
- package/dist/ProgressBar/ProgressBarTouch.d.ts.map +1 -0
- package/dist/ProgressBar/ProgressBarTouch.js +91 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +25 -13
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +404 -131
- package/dist/Slider/sliderTouchController.d.ts +189 -0
- package/dist/Slider/sliderTouchController.d.ts.map +1 -0
- package/dist/Slider/sliderTouchController.js +1017 -0
- package/dist/Slider/useSliderTouch.d.ts +22 -0
- package/dist/Slider/useSliderTouch.d.ts.map +1 -0
- package/dist/Slider/useSliderTouch.js +56 -0
- package/dist/Tooltip/Tooltip.d.ts +30 -6
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +5 -0
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +31 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +59 -18
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +19 -9
- package/dist/astryx.css +40 -6
- package/dist/gestures/GestureArena.d.ts +21 -2
- package/dist/gestures/GestureArena.d.ts.map +1 -1
- package/dist/gestures/GestureArena.js +23 -3
- package/dist/gestures/GestureHost.d.ts +123 -3
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +791 -12
- package/dist/gestures/GestureRecognizer.d.ts +15 -1
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/GestureRecognizer.js +12 -0
- package/dist/gestures/PanGestureRecognizer.d.ts +8 -0
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PinchGestureRecognizer.d.ts +5 -1
- package/dist/gestures/PinchGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PinchGestureRecognizer.js +10 -0
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts +3 -3
- package/dist/gestures/ScreenEdgePanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/ScreenEdgePanGestureRecognizer.js +7 -5
- package/dist/gestures/nativeScroll.d.ts +16 -2
- package/dist/gestures/nativeScroll.d.ts.map +1 -1
- package/dist/gestures/nativeScroll.js +39 -8
- package/dist/gestures/recognizerInternals.d.ts +4 -2
- package/dist/gestures/recognizerInternals.d.ts.map +1 -1
- package/dist/gestures/types.d.ts +11 -0
- package/dist/gestures/types.d.ts.map +1 -1
- package/dist/gestures/types.js +7 -0
- package/dist/gestures/wheelSegmenter.d.ts +45 -0
- package/dist/gestures/wheelSegmenter.d.ts.map +1 -0
- package/dist/gestures/wheelSegmenter.js +98 -0
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +140 -19
- package/dist/motion/paging.d.ts +58 -0
- package/dist/motion/paging.d.ts.map +1 -0
- package/dist/motion/paging.js +128 -0
- package/dist/motion/uikit/index.d.ts +5 -3
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +5 -3
- package/dist/motion/uikit/paging.d.ts +160 -0
- package/dist/motion/uikit/paging.d.ts.map +1 -0
- package/dist/motion/uikit/paging.js +162 -0
- package/dist/motion/uikit/progressBar.d.ts +59 -0
- package/dist/motion/uikit/progressBar.d.ts.map +1 -0
- package/dist/motion/uikit/progressBar.js +82 -0
- package/dist/motion/uikit/scroll.d.ts +0 -19
- package/dist/motion/uikit/scroll.d.ts.map +1 -1
- package/dist/motion/uikit/scroll.js +2 -21
- package/dist/motion/uikit/slider.d.ts +97 -0
- package/dist/motion/uikit/slider.d.ts.map +1 -0
- package/dist/motion/uikit/slider.js +111 -0
- package/dist/motion/uikit/springs.d.ts +46 -1
- package/dist/motion/uikit/springs.d.ts.map +1 -1
- package/dist/motion/uikit/springs.js +48 -4
- package/dist/utils/selectionLock.d.ts +43 -0
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +394 -6
- package/package.json +5 -5
- package/src/AppShell/AppShell.doc.mjs +10 -0
- package/src/AppShell/AppShell.tsx +48 -2
- package/src/BottomSheet/BottomSheetPanel.tsx +16 -9
- package/src/Chat/Chat.doc.mjs +1 -0
- package/src/Chat/ChatComposerInput.doc.mjs +11 -0
- package/src/Chat/ChatComposerInput.tsx +11 -0
- package/src/Chat/ChatMessage.tsx +2 -2
- package/src/Chat/chatMessage.vars.stylex.ts +8 -8
- package/src/CommandPalette/CommandPaletteInput.tsx +6 -0
- package/src/DateInput/MonthScroller.tsx +63 -5
- package/src/Drawer/Drawer.tsx +6 -0
- package/src/DropdownMenu/useMenuOverflow.ts +44 -8
- package/src/Field/PanelSearchInput.tsx +6 -0
- package/src/Field/textEntryTraits.ts +6 -6
- package/src/Layer/layerClickBoundary.ts +2 -2
- package/src/Layer/usePressPin.ts +481 -0
- package/src/Layer/useTouchTrigger.ts +37 -1
- package/src/Link/Link.tsx +3 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +3 -3
- package/src/ProgressBar/ProgressBar.tsx +82 -11
- package/src/ProgressBar/ProgressBarTouch.ts +109 -0
- package/src/Selector/Selector.tsx +29 -2
- package/src/Slider/Slider.doc.mjs +11 -7
- package/src/Slider/Slider.tsx +539 -132
- package/src/Slider/sliderTouchController.ts +1209 -0
- package/src/Slider/useSliderTouch.ts +78 -0
- package/src/Tooltip/Tooltip.doc.mjs +21 -6
- package/src/Tooltip/Tooltip.tsx +42 -5
- package/src/Tooltip/index.ts +1 -0
- package/src/Tooltip/useTooltip.doc.mjs +4 -2
- package/src/Tooltip/useTooltip.tsx +84 -21
- package/src/Typeahead/BaseTypeahead.tsx +16 -8
- package/src/gestures/GestureArena.ts +45 -4
- package/src/gestures/GestureHost.ts +949 -12
- package/src/gestures/GestureRecognizer.ts +28 -0
- package/src/gestures/PanGestureRecognizer.ts +8 -0
- package/src/gestures/PinchGestureRecognizer.ts +16 -1
- package/src/gestures/README.md +82 -3
- package/src/gestures/ScreenEdgePanGestureRecognizer.ts +7 -5
- package/src/gestures/nativeScroll.ts +49 -9
- package/src/gestures/recognizerInternals.ts +9 -2
- package/src/gestures/types.ts +12 -0
- package/src/gestures/wheelSegmenter.ts +114 -0
- package/src/motion/MEASUREMENTS.md +8 -1
- package/src/motion/README.md +6 -3
- package/src/motion/animator.ts +193 -25
- package/src/motion/paging.ts +138 -0
- package/src/motion/uikit/index.ts +5 -3
- package/src/motion/uikit/paging.ts +162 -0
- package/src/motion/uikit/progressBar.ts +82 -0
- package/src/motion/uikit/scroll.ts +2 -18
- package/src/motion/uikit/slider.ts +105 -0
- package/src/motion/uikit/springs.ts +37 -2
- package/src/utils/selectionLock.ts +501 -6
- package/dist/motion/selectPage.d.ts +0 -26
- package/dist/motion/selectPage.d.ts.map +0 -1
- package/dist/motion/selectPage.js +0 -55
- package/src/motion/selectPage.ts +0 -55
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file progressBar.ts
|
|
5
|
+
* @input Nothing: data only
|
|
6
|
+
* @output Exports `progressBar` (UIProgressView's fill: the whole-track
|
|
7
|
+
* duration and curve, its minimum length and its empty alpha) and
|
|
8
|
+
* `registerProgressBarTable`
|
|
9
|
+
* @position ProgressBar's rows of the UIKit constants table (motion/uikit).
|
|
10
|
+
* Lengths are in pt (CSS px), durations in ms, alphas in 0..1. Tests check
|
|
11
|
+
* each leaf's `@source`.
|
|
12
|
+
*
|
|
13
|
+
* SYNC: When modified, update
|
|
14
|
+
* /packages/core/src/ProgressBar/ProgressBarTouch.ts and
|
|
15
|
+
* /packages/core/src/ProgressBar/ProgressBar.test.tsx.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import {registerMotionTable} from '../roles';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* UIProgressView's values, for ProgressBar. Two values are motion roles in the
|
|
22
|
+
* generated motion role table: the whole-track duration,
|
|
23
|
+
* `progress.fillTrackMs`, and its curve, `progress.curves.fill`. Every other
|
|
24
|
+
* value is an internal constant.
|
|
25
|
+
*/
|
|
26
|
+
export const progressBar = {
|
|
27
|
+
/**
|
|
28
|
+
* setProgress(_:animated: true) runs this long for a change of the whole
|
|
29
|
+
* track (0 → 1). A smaller change runs in proportion, measured on the model
|
|
30
|
+
* values: 0.2 → 0.8 takes 0.6 s. A retargeted fill starts from wherever it
|
|
31
|
+
* is drawn.
|
|
32
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
33
|
+
* iPhone 17 Pro, UIView animation on the fill's frame (duration,
|
|
34
|
+
* beginFromCurrentState) for jumps of 0.6, 0.4 and 0.6, Oct 23 2026
|
|
35
|
+
*/
|
|
36
|
+
fillTrackMs: 1000,
|
|
37
|
+
curves: {
|
|
38
|
+
/**
|
|
39
|
+
* That animation's curve: linear, and Reduce Motion leaves it unchanged.
|
|
40
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
41
|
+
* iPhone 17 Pro, the fill's position animation (timing function
|
|
42
|
+
* linear), with Reduce Motion off and on, Oct 23 2026
|
|
43
|
+
*/
|
|
44
|
+
fill: [0, 0, 1, 1],
|
|
45
|
+
},
|
|
46
|
+
progressView: {
|
|
47
|
+
/**
|
|
48
|
+
* The track's height in the `.default` style; the fill is as tall.
|
|
49
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
50
|
+
* iPhone 17 Pro, intrinsic size of UIProgressView(progressViewStyle:
|
|
51
|
+
* .default), Oct 23 2026
|
|
52
|
+
*/
|
|
53
|
+
heightPt: 4,
|
|
54
|
+
/**
|
|
55
|
+
* Above zero progress, the fill is never narrower than this many track
|
|
56
|
+
* heights: 8 pt on the 4 pt track. At 0.005 of a 300 pt track it is 8 pt
|
|
57
|
+
* wide; at 0.05 it is 15 pt.
|
|
58
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
59
|
+
* iPhone 17 Pro, the fill image view's frame at progress 0, 0.005,
|
|
60
|
+
* 0.01, 0.05, 0.5 and 1, Oct 23 2026
|
|
61
|
+
*/
|
|
62
|
+
minimumFillHeights: 2,
|
|
63
|
+
/**
|
|
64
|
+
* At progress 0 the fill is transparent (alpha 0, still at its minimum
|
|
65
|
+
* width).
|
|
66
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
67
|
+
* iPhone 17 Pro, the fill image view's alpha at progress 0, Oct 23 2026
|
|
68
|
+
*/
|
|
69
|
+
emptyFillAlpha: 0,
|
|
70
|
+
},
|
|
71
|
+
} as const;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Registers the table's two roles, for the generated motion role table and its
|
|
75
|
+
* test, which call it. Nothing at runtime reads the registry: `resolveMotion`
|
|
76
|
+
* returns the table value. Idempotent, and nothing runs on import.
|
|
77
|
+
*/
|
|
78
|
+
export function registerProgressBarTable(): void {
|
|
79
|
+
registerMotionTable('progress', progressBar, {
|
|
80
|
+
roles: ['fillTrackMs', 'curves.fill'],
|
|
81
|
+
});
|
|
82
|
+
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @file scroll.ts
|
|
5
5
|
* @input Nothing; data only
|
|
6
6
|
* @output Exports `scroll`, the UIScrollView constants: deceleration rates,
|
|
7
|
-
* the rubber-band coefficient, the bounce-back spring
|
|
8
|
-
*
|
|
7
|
+
* the rubber-band coefficient, the bounce-back spring and the content-touch
|
|
8
|
+
* delay
|
|
9
9
|
* @position The scroll domain of the UIKit constants table (motion/uikit);
|
|
10
10
|
* read by the motion math and components
|
|
11
11
|
*
|
|
@@ -82,22 +82,6 @@ export const scroll = {
|
|
|
82
82
|
* @measure M-S3
|
|
83
83
|
*/
|
|
84
84
|
bounce: {duration: 0.5, bounce: 0},
|
|
85
|
-
paging: {
|
|
86
|
-
/**
|
|
87
|
-
* Deceleration rate a paging release is projected with to pick the next
|
|
88
|
-
* page.
|
|
89
|
-
* @source GUESS — UIScrollView paging behaves like a fast scroll view;
|
|
90
|
-
* the rate it uses internally is not documented
|
|
91
|
-
* @measure M-PG1
|
|
92
|
-
*/
|
|
93
|
-
projectionRate: 0.99,
|
|
94
|
-
/**
|
|
95
|
-
* The spring that carries a paging scroll view onto its page.
|
|
96
|
-
* @source GUESS — SwiftUI `.smooth` default until measured
|
|
97
|
-
* @measure M-PG1
|
|
98
|
-
*/
|
|
99
|
-
snap: {duration: 0.5, bounce: 0},
|
|
100
|
-
},
|
|
101
85
|
/**
|
|
102
86
|
* `delaysContentTouches`: how long a scroll view holds a touch-down from
|
|
103
87
|
* its content while it decides whether the touch is a scroll (no highlight
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file slider.ts
|
|
5
|
+
* @input Nothing: data only
|
|
6
|
+
* @output Exports `slider`: UISlider's hit target, tracking rule, release
|
|
7
|
+
* coast, lift, drop and end haptic, measured on the iOS 26.2 simulator
|
|
8
|
+
* @position The slider domain of the UIKit constants table (motion/uikit).
|
|
9
|
+
* Lengths are in pt (CSS px). Tests check each leaf's `@source`.
|
|
10
|
+
*
|
|
11
|
+
* SYNC: When modified, update:
|
|
12
|
+
* - /packages/core/src/Slider/sliderTouchController.ts
|
|
13
|
+
* - /packages/core/src/Slider/Slider.tsx
|
|
14
|
+
* - /packages/core/src/motion/uikit/slider.test.ts
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import {SLIDER_RELEASE_SPRING} from './springs';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* UISlider's touch values: hit target, tracking, release coast, lift, drop
|
|
21
|
+
* and the end-of-track haptic.
|
|
22
|
+
*/
|
|
23
|
+
export const slider = {
|
|
24
|
+
/**
|
|
25
|
+
* The thumb's touch target, a square in pt centered on the thumb. It is
|
|
26
|
+
* the 37 × 24 pt thumb grown by its hit edge insets: 12 pt above and
|
|
27
|
+
* below, 5.5 pt left and right. UIKit hit-tests inside the control's frame
|
|
28
|
+
* first, so the lab's 40 pt frame clipped it to 48 × 40.
|
|
29
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro.
|
|
30
|
+
* `_thumbHitEdgeInsets` reads {−12, −5.5, −12, −5.5}. Touch-downs on a
|
|
31
|
+
* 4 pt grid take the thumb from −24 to +20 pt in x. A track tap away
|
|
32
|
+
* from the thumb moves nothing. Oct 23 2026
|
|
33
|
+
*/
|
|
34
|
+
thumbHitTarget: 48,
|
|
35
|
+
/**
|
|
36
|
+
* Value range per track length of finger travel. The value moves by
|
|
37
|
+
* (max − min) × translation ÷ the track's full length. The translation
|
|
38
|
+
* counts from the pan's threshold: the touch-down point plus 10 pt along
|
|
39
|
+
* the track. 1 means one full range per track length.
|
|
40
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. In
|
|
41
|
+
* drags at 120 to 2000 pt/s, each event's value is v0 plus the
|
|
42
|
+
* translation past 10 pt ÷ 300. Past the max end, the value leaves 1
|
|
43
|
+
* only once the finger comes back past where it reached 1. Oct 23 2026
|
|
44
|
+
*/
|
|
45
|
+
trackingGain: 1,
|
|
46
|
+
/**
|
|
47
|
+
* The coast after the lift. The thumb and the value spring from where the
|
|
48
|
+
* finger left them to the projected target, with the release velocity.
|
|
49
|
+
* Critically damped, it never overshoots a target ahead of it.
|
|
50
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
51
|
+
* `UIViewSpringAnimationBehavior` at the lift reads response 0.4 and
|
|
52
|
+
* damping ratio 1. Four releases fit it per frame, at rms 0.11 pt or
|
|
53
|
+
* less. Oct 23 2026
|
|
54
|
+
*/
|
|
55
|
+
releaseSpring: SLIDER_RELEASE_SPRING,
|
|
56
|
+
/**
|
|
57
|
+
* The deceleration rate of the coast's momentum projection, per ms
|
|
58
|
+
* (WWDC18's `project`). It is not UIScrollView's normal rate (0.998), so
|
|
59
|
+
* pass it to the projection explicitly.
|
|
60
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
61
|
+
* release behavior's projection deceleration reads 0.996. Oct 23 2026
|
|
62
|
+
*/
|
|
63
|
+
releaseProjectionRate: 0.996,
|
|
64
|
+
/**
|
|
65
|
+
* How much of the projection the coast travels. The target is the lift
|
|
66
|
+
* value plus this share of the projected distance. A finger lifted outside
|
|
67
|
+
* the control's tracking bounds coasts back to the lift value instead.
|
|
68
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
69
|
+
* release behavior's target smoothing reads 0.4. A 126.9 pt/s release
|
|
70
|
+
* travels 12.56 pt, against 12.64 predicted. Oct 23 2026
|
|
71
|
+
*/
|
|
72
|
+
releaseProjectionShare: 0.4,
|
|
73
|
+
/**
|
|
74
|
+
* The thumb's growth under a finger, uniform about its center (37 × 24 to
|
|
75
|
+
* 57.35 × 37.2 pt).
|
|
76
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The lens
|
|
77
|
+
* frame settled during an 800 ms hold. Oct 23 2026
|
|
78
|
+
*/
|
|
79
|
+
liftScale: 1.55,
|
|
80
|
+
/**
|
|
81
|
+
* The lift: the thumb grows to `liftScale` when the finger lands.
|
|
82
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The lens
|
|
83
|
+
* width per frame in an 800 ms hold fits one spring at rms 0.31 pt.
|
|
84
|
+
* Oct 23 2026
|
|
85
|
+
*/
|
|
86
|
+
liftSpring: {response: 0.215, dampingRatio: 0.6},
|
|
87
|
+
/**
|
|
88
|
+
* The drop: the thumb shrinks back to its rest size when the finger lifts,
|
|
89
|
+
* while the coast runs.
|
|
90
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
91
|
+
* lens's spring at the lift of an 800 ms hold reads response 0.5 s and
|
|
92
|
+
* damping ratio 0.7. The width per frame fits it at rms 0.10 pt.
|
|
93
|
+
* Oct 23 2026
|
|
94
|
+
*/
|
|
95
|
+
dropSpring: {response: 0.5, dampingRatio: 0.7},
|
|
96
|
+
/**
|
|
97
|
+
* The feedback each time the value reaches an end, once per entry. It
|
|
98
|
+
* re-arms when the value leaves the end, in the drag and the coast. UIKit
|
|
99
|
+
* plays "Micro Tap Medium", and the web stand-in is the closest kind.
|
|
100
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
101
|
+
* haptics log of drags into both ends shows the fluid slider generator's
|
|
102
|
+
* "Micro Tap Medium" once per entry. Oct 23 2026
|
|
103
|
+
*/
|
|
104
|
+
endHaptic: 'impactMedium',
|
|
105
|
+
} as const;
|
|
@@ -454,6 +454,33 @@ export const KEYBOARD_SPRING = {
|
|
|
454
454
|
*/
|
|
455
455
|
export const BANNER_SPRING = {mass: 3, stiffness: 1000, damping: 500} as const;
|
|
456
456
|
|
|
457
|
+
/**
|
|
458
|
+
* UISlider's release: after a finger lifts, the thumb settles on this spring
|
|
459
|
+
* toward 0.4 of the release's momentum projection. It is critically damped,
|
|
460
|
+
* so it never overshoots a target ahead of it.
|
|
461
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
462
|
+
* `UIViewSpringAnimationBehavior` at the lift reads response 0.4 and
|
|
463
|
+
* damping ratio 1. Four releases fit it per frame (the UIKit slider
|
|
464
|
+
* table). Oct 23 2026
|
|
465
|
+
*/
|
|
466
|
+
export const SLIDER_RELEASE_SPRING = {response: 0.4, dampingRatio: 1} as const;
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* UISlider's lift: a finger's touch-down scales the thumb up on this spring.
|
|
470
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
471
|
+
* thumb's scale per frame after touch-down (the UIKit slider table).
|
|
472
|
+
* Oct 23 2026
|
|
473
|
+
*/
|
|
474
|
+
export const SLIDER_LIFT_SPRING = {response: 0.215, dampingRatio: 0.6} as const;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* UISlider's drop: the lift's end scales the thumb back down on this spring.
|
|
478
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
479
|
+
* thumb's scale per frame after the lift (the UIKit slider table).
|
|
480
|
+
* Oct 23 2026
|
|
481
|
+
*/
|
|
482
|
+
export const SLIDER_DROP_SPRING = {response: 0.5, dampingRatio: 0.7} as const;
|
|
483
|
+
|
|
457
484
|
/**
|
|
458
485
|
* Every spring above, by row name: the table the existing readers use. A
|
|
459
486
|
* component imports only the rows it plays (`architecture:component-style-authoring`
|
|
@@ -494,10 +521,15 @@ export const springs = {
|
|
|
494
521
|
segmentedThumb: SEGMENTED_THUMB_SPRING,
|
|
495
522
|
keyboard: KEYBOARD_SPRING,
|
|
496
523
|
banner: BANNER_SPRING,
|
|
524
|
+
sliderRelease: SLIDER_RELEASE_SPRING,
|
|
525
|
+
sliderLift: SLIDER_LIFT_SPRING,
|
|
526
|
+
sliderDrop: SLIDER_DROP_SPRING,
|
|
497
527
|
} as const;
|
|
498
528
|
|
|
499
529
|
/**
|
|
500
|
-
* The
|
|
530
|
+
* The only springs that are motion roles. The touch presentations' record
|
|
531
|
+
* names some, and a component's own record names others, such as Slider's
|
|
532
|
+
* three. The generated motion role table lists each with its record.
|
|
501
533
|
* The registry takes these rows alone, so registering ships no other spring.
|
|
502
534
|
*/
|
|
503
535
|
const SPRING_ROLES = {
|
|
@@ -516,10 +548,13 @@ const SPRING_ROLES = {
|
|
|
516
548
|
contextMenuLift: CONTEXT_MENU_LIFT_SPRING,
|
|
517
549
|
contextMenuDismiss: CONTEXT_MENU_DISMISS_SPRING,
|
|
518
550
|
contextMenuMorph: CONTEXT_MENU_MORPH_SPRING,
|
|
551
|
+
sliderRelease: SLIDER_RELEASE_SPRING,
|
|
552
|
+
sliderLift: SLIDER_LIFT_SPRING,
|
|
553
|
+
sliderDrop: SLIDER_DROP_SPRING,
|
|
519
554
|
};
|
|
520
555
|
|
|
521
556
|
/**
|
|
522
|
-
* Registers the springs
|
|
557
|
+
* Registers the role springs (`SPRING_ROLES`) as internal motion roles
|
|
523
558
|
* (motion/roles.ts), by their row names (`springs.settle`). Every other
|
|
524
559
|
* spring, UIKit's menu spring under Reduce Motion and the keyboard's
|
|
525
560
|
* included, is not a role. Nothing registers on import: the touch code that
|