@astryx-vue/core 0.30.0 → 0.30.1
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/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-D_lrpZz_.js → AlertDialog-B_p1yL3k.js} +7 -7
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-CxUmt6hX.js → AppShell-D3KZSLvb.js} +5 -5
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-DT5RbxDa.js → AvatarGroup-Dd-yDDNz.js} +2 -2
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-Ctg1puM6.js → Banner-DKmvoMxD.js} +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-CmNOXlZO.js → BottomSheet-Btf8Yn8k.js} +845 -276
- package/dist/{BottomSheet-_K41Oliv.js → BottomSheet-CQGtoh2x.js} +1 -1
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-CdGqhFKU.js → Breadcrumbs-D6825HQI.js} +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-CvHeZGf1.js → Button-DdPty46q.js} +2 -2
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/{ButtonGroup-CUN_rC57.js → ButtonGroup-oI99JAyN.js} +3 -3
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-CbdHb8MD.js → Carousel-BNr79JpP.js} +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-B7ccEmTR.js → Chat-BadS0fEx.js} +2 -2
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-5r6VWqId.js → CheckboxInput-CzP8gP3v.js} +3 -3
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxListItem-CKeQzQ0W.js → CheckboxListItem-CxBjpX3d.js} +4 -4
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-ChmOwgYq.js → ClickableCard-B86P2aiM.js} +1 -1
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-4i1vvmOc.js → CodeBlock-Cgm4uOhG.js} +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-B2vrr_YP.js → Collapsible-CfTN722D.js} +3 -3
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BMwvTjff.js → CommandPalette-BgVwGtdA.js} +2 -2
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-B4iFyilD.js → ComplexSelector-DqWJVx7H.js} +2 -2
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-DquYeIEF.js → ContextMenu-C9dJGu3M.js} +3 -3
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-MNNyi4XK.js → DateInput-CGKaozkw.js} +3 -3
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-DOHntScL.js → DateRangeInput-BVHXgzXz.js} +3 -3
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-BaghFHW6.js → DateTimeInput-DRm3lekJ.js} +5 -5
- package/dist/Dialog/index.js +3 -3
- package/dist/{Dialog-Ctha_b_L.js → Dialog-BN-NycQr.js} +1 -1
- package/dist/{Dialog-CGf64DqF.js → Dialog-Dt0gNuMT.js} +1 -1
- package/dist/{DialogHeader-BxTV37GT.js → DialogHeader-CSH2_5v-.js} +2 -2
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/{Drawer-DAnc2ut9.js → Drawer-PeMgE4iA.js} +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-BPi0pm0w.js → DropdownMenu-C9bvYZPt.js} +5 -5
- package/dist/{DropdownMenu-DuSVFQoS.js → DropdownMenu-_lQQyQCn.js} +6 -6
- package/dist/Field/index.js +3 -3
- package/dist/{Field-d5R_kRMv.js → Field-D-fRqyso.js} +1 -1
- package/dist/{FieldInfoTip-BhKtjq3g.js → FieldInfoTip-Bstp5Lvd.js} +1 -1
- package/dist/{FieldLabel-BHNpYFx7.js → FieldLabel-lV_qLaGp.js} +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-BCg4HROm.js → FileInput-CTNnDIkm.js} +3 -3
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-BZgU_THt.js → IconButton-DPezhVBA.js} +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InfoTip/index.js +1 -1
- package/dist/{InfoTip-E2-OzKti.js → InfoTip-B4BFfLtT.js} +1 -1
- package/dist/{InputClearButton-B62_uexC.js → InputClearButton-CxU3iv-5.js} +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/{InputGroup-DKBqRYFf.js → InputGroup-CraWGK6Y.js} +1 -1
- package/dist/{Item-C8UAQwFQ.js → Item-C9u_kQUO.js} +15 -14
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-Bou1gTfv.js → Lightbox-BNUG9CQ1.js} +1 -1
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link-CaJ5lmKk.js → Link-Bwgpn-di.js} +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-BlrEngDO.js → ListItem-_lOmngHp.js} +2 -2
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-BE6vdvPG.js → Markdown-BlEi5UGN.js} +2 -2
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-D5yGMHU4.js → MobileNavToggle-wVa9dzH1.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-CNzTagqr.js → MoreMenu-MmvMRWv5.js} +3 -3
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-MGEiRi1W.js → MultiSelector-DXrKQLmq.js} +4 -4
- package/dist/NavItem/index.js +1 -1
- package/dist/{NavItem-kj9FbbFS.js → NavItem-D4xHjSTo.js} +1 -1
- package/dist/NavMenu/index.js +2 -2
- package/dist/{NavMenu-ZN5cqCxO.js → NavMenu-NCg3VjAQ.js} +2 -2
- package/dist/{NavMenuItem-xm3e0V8q.js → NavMenuItem-Bla6fYVl.js} +3 -3
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-D4ECOHh_.js → NumberInput-DicgvFte.js} +3 -3
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-DI9MZnuQ.js → Outline-DlO_97b4.js} +3 -3
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-m1tf_fR1.js → OverflowList-BYYz3ePw.js} +1 -1
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-BdjxuxM3.js → Pagination-DM_W9Ue-.js} +3 -3
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-DEj8xWN-.js → Popover-CxReY-4u.js} +5 -5
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-BJDFietK.js → PowerSearch-BwUWZG3p.js} +19 -19
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-B3UoJrOA.js → RadioGroup-CsJYGjyx.js} +3 -3
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioListItem-CD7kUGlN.js → RadioListItem-Yc3K82YE.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-DGd6JlaD.js → SegmentedControl-C-F5dkcG.js} +2 -2
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-GRWYx3iD.js → SelectableCard-CwfpgsS8.js} +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-BD0u-5Fy.js → Selector-bH99g1vj.js} +2 -2
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-DoqCLRiX.js → SideNav-C1ZxusAB.js} +6 -6
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-DHR7HZ7N.js → Slider-Bq_7Nskr.js} +2 -2
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-CCuggsov.js → Stepper-CWluGqBs.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-CnFC7jGw.js → Switch-DTPvMAxd.js} +2 -2
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-fMlX8m6n.js → TabList-C4i7UZkp.js} +3 -3
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-DoKmVdhZ.js → Table-ClHIgsKO.js} +13 -13
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-y9mmYAIy.js → TextArea-J2_wct0p.js} +4 -4
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-BLGEh7vE.js → TextInput-Da1TYd57.js} +4 -4
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-Dm8krgGF.js → Thumbnail-1LsaJ4_m.js} +2 -2
- package/dist/{TimeField-DS30hnty.js → TimeField-i5ESA500.js} +2 -2
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-DcY4b3dg.js → TimeInput-frnKZo1M.js} +2 -2
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-BhBuBHu8.js → Timestamp-SseS_qtf.js} +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-CnLk7LzS.js → Toast-tAq4S96S.js} +149 -20
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-B9IJcpdJ.js → ToggleButton-B6hBzeVl.js} +3 -3
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-C7Dt5ygK.js → Token-DTGUCgpn.js} +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-D7ZCTbnf.js → Tokenizer-iFZAuIwu.js} +7 -7
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Toolbar/index.js +1 -1
- package/dist/{Toolbar-DSWH8ll4.js → Toolbar-BHkPxDxA.js} +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CK_F6Ud5.js → TopNav-CcIayfsW.js} +4 -4
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-Dh0uAj2B.js → TreeList-Da_OKrv_.js} +4 -4
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-Cs-46obm.js → Typeahead-BD6xXNKh.js} +3 -3
- package/dist/VelocityTracker-DgjmootV.js +165 -0
- package/dist/{animator-BGq5a6vT.js → animator-CEHDYTfQ.js} +29 -173
- package/dist/{batch-BhaAWUIt.js → batch-D2a2MsSW.js} +4 -19
- package/dist/bezier-Dko5MnTp.js +37 -0
- package/dist/{clickGuard-FrlnECMp.js → clickGuard-C3VmOLhI.js} +2 -1
- package/dist/composables/index.js +7 -7
- package/dist/composables-Bs0O_SRd.js +2548 -0
- package/dist/{context-jtpQfR6F.js → context-NKb_prrS.js} +2 -2
- package/dist/{edge-CJIswPTX.js → edge-tj-cLZYh.js} +1 -1
- package/dist/{edgeRide-Drk4V-MC.js → edgeRide-DcUqLXE2.js} +4 -4
- package/dist/{handle-BazRxHwq.js → handle-CwxCHapJ.js} +1 -1
- package/dist/{holdEntranceInput-DMCOeRqu.js → holdEntranceInput-DgimbgGm.js} +1 -1
- package/dist/{index-BVeTS-R5.d.ts → index-3qz8Qztx.d.ts} +4 -4
- package/dist/{index-Q1oG9yIT.d.ts → index-B-3EGjfQ.d.ts} +2 -2
- package/dist/{index-C1e8LNx2.d.ts → index-BjqoHLMq.d.ts} +1 -1
- package/dist/{index-DQ3akoRZ.d.ts → index-Bu4R0WZA.d.ts} +3 -3
- package/dist/{index-BDZCJ9ri.d.ts → index-BuubzuE8.d.ts} +2 -2
- package/dist/{index-BL9fE6gs.d.ts → index-Cw4CUe06.d.ts} +5 -5
- package/dist/{index-CUuUoX3h.d.ts → index-JE1HrzdJ.d.ts} +3 -3
- package/dist/{index-hUa5oQ5O.d.ts → index-m3DOxOw6.d.ts} +42 -42
- package/dist/index.d.ts +9 -9
- package/dist/index.js +85 -85
- package/dist/{inputHold-BmChuR9x.js → inputHold-DW2LYHb5.js} +4 -4
- package/dist/{inputHoldState-pblUT4oh.js → inputHoldState-xntIqr5W.js} +2 -1
- package/dist/{inputStream-LZdK8luP.js → inputStream-bPd9eB2b.js} +2 -49
- package/dist/isRtlElement-NHuH48AA.js +23 -0
- package/dist/{landing-CBaXCGEg.js → landing-Bi7X7w_7.js} +3 -3
- package/dist/{lazyBottomSheet-Cmd-WMEE.js → lazyBottomSheet-BVZ1yH8g.js} +1 -1
- package/dist/{timing-CSHWQbTJ.js → linearEasing-ScK9LqAY.js} +30 -1
- package/dist/{bezier-Df-yGuNZ.js → presentation-Cy_yf56y.js} +2 -39
- package/dist/{pressFeedback-DVR5V1b6.js → pressFeedback-9dqGYjxv.js} +2 -2
- package/dist/{resolveMotion-CurhYTVC.js → resolveMotion-1cwESYvK.js} +202 -1
- package/dist/resolveSnapPoint-DdZyBkT4.js +717 -0
- package/dist/{flatTree-BB4yPMNL.js → sharedRealm-H1OrlP0V.js} +49 -1
- package/dist/{themeTiming-BFDOPRjK.js → themeTiming-NUkH9HsU.js} +1 -1
- package/dist/{touchHold-CFJlSClt.js → touchHold-DXtx7npm.js} +1 -1
- package/dist/{useActionGroupTracking-C6BzQzvp.js → useActionGroupTracking-CLFF7FI2.js} +2 -2
- package/dist/{useAnimatedLayout-DC2l3WrE.js → useAnimatedLayout-DWWc31RR.js} +1 -1
- package/dist/{composables-BTRbNgmR.js → useAttachment-BuNyeUXy.js} +44 -3464
- package/dist/{useChatStreamScroll-Cv51kRT0.js → useChatStreamScroll-CuMzkXgD.js} +1 -1
- package/dist/{useInputStatusIcon-BngSzjVd.js → useInputStatusIcon-BqV6YzTV.js} +1 -1
- package/dist/{useListFocus-CkHfsZp0.js → useListFocus-Ccd_HU9T.js} +2 -23
- package/dist/{useMenuDrillIn-BQx6lQMz.js → useMenuDrillIn-Cj6MM77J.js} +1 -1
- package/dist/{useMenuEntranceHold-buV5S9yk.js → useMenuEntranceHold-HznOwIry.js} +1 -1
- package/dist/{useMenuHover-CfQtWMg-.js → useMenuHover-DoBatZeD.js} +1 -1
- package/dist/{useMenuPress-DU6pAIHy.js → useMenuPress-DcwVUsQO.js} +3 -3
- package/dist/{usePressFeedback-BhNcuxQv.js → usePressFeedback-DHdmAsMp.js} +1 -1
- package/dist/{useTouchHitArea-CNZyA18Y.js → useTouchHitArea-SY1ITxSJ.js} +2 -2
- package/package.json +1 -1
- package/styles/bottom-sheet.css +28 -8
- package/dist/{index-D8lv2BiD.d.ts → index-BqhgeAT4.d.ts} +1 -1
|
@@ -0,0 +1,717 @@
|
|
|
1
|
+
import { p as scroll, v as registerMotionTable, y as registerSpringRole } from "./pressGesture-BzIBmKF2.js";
|
|
2
|
+
//#region src/motion/springRole.ts
|
|
3
|
+
/**
|
|
4
|
+
* Registers the row as the role `springs.<name>` and returns it. A page that
|
|
5
|
+
* plays no spring ships no springs registry. Each spring role registers
|
|
6
|
+
* itself when the module that plays it loads (one idempotent in-memory write,
|
|
7
|
+
* no DOM). Write each call with the pure annotation, so a bundle that does
|
|
8
|
+
* not use the row drops the call.
|
|
9
|
+
*/
|
|
10
|
+
function springRole(name, spring) {
|
|
11
|
+
return registerSpringRole(`springs.${name}`, spring);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/motion/uikit/menuSprings.ts
|
|
15
|
+
/**
|
|
16
|
+
* @file menuSprings.ts
|
|
17
|
+
* @input Nothing; data only
|
|
18
|
+
* @output The springs of UIKit's alerts, action sheets, menus and context
|
|
19
|
+
* menus, each in the vocabulary of its source
|
|
20
|
+
* @position Part of the springs domain of the UIKit constants table:
|
|
21
|
+
* springs.ts re-exports every row and lists them in `springs`
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Alert (UIAlertController .alert) appearing: fades in and scales from
|
|
25
|
+
* 1.2 to 1, the dimming fading in alongside. UIKit asks
|
|
26
|
+
* `UIView.animate(withDuration: 0.404, usingSpringWithDamping: 600,
|
|
27
|
+
* initialSpringVelocity: 0)`; the damping clamps to critical, and the
|
|
28
|
+
* spring settles at 0.404 s.
|
|
29
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
30
|
+
* iPhone 17 Pro, UIView.animate hooked and CASpringAnimation dumped
|
|
31
|
+
* (mass 1, stiffness 522.350, damping 45.710, duration 0.404),
|
|
32
|
+
* Oct 23 2026
|
|
33
|
+
*/
|
|
34
|
+
const ALERT_PRESENT_SPRING = {
|
|
35
|
+
mass: 1,
|
|
36
|
+
stiffness: 522.35,
|
|
37
|
+
damping: 45.71
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Alert dismissing: the same spring, opacity only.
|
|
41
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
42
|
+
* iPhone 17 Pro, CASpringAnimation dump, Oct 23 2026
|
|
43
|
+
*/
|
|
44
|
+
const ALERT_DISMISS_SPRING = {
|
|
45
|
+
mass: 1,
|
|
46
|
+
stiffness: 522.35,
|
|
47
|
+
damping: 45.71
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Action sheet (UIAlertController .actionSheet) appearing: identical to
|
|
51
|
+
* the alert.
|
|
52
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
53
|
+
* iPhone 17 Pro, CASpringAnimation dump, Oct 23 2026
|
|
54
|
+
*/
|
|
55
|
+
const ACTION_SHEET_PRESENT_SPRING = {
|
|
56
|
+
mass: 1,
|
|
57
|
+
stiffness: 522.35,
|
|
58
|
+
damping: 45.71
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Action sheet dismissing: identical to the alert.
|
|
62
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
63
|
+
* iPhone 17 Pro, CASpringAnimation dump, Oct 23 2026
|
|
64
|
+
*/
|
|
65
|
+
const ACTION_SHEET_DISMISS_SPRING = {
|
|
66
|
+
mass: 1,
|
|
67
|
+
stiffness: 522.35,
|
|
68
|
+
damping: 45.71
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* UIMenu (from a button) opening; UIKit drives it per frame and lets it
|
|
72
|
+
* track a finger still on the screen.
|
|
73
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
74
|
+
* iPhone 17 Pro, `_animateUsingSpringWithDampingRatio:response:tracking:`
|
|
75
|
+
* hooked (0.8, 0.32, tracking), Oct 23 2026
|
|
76
|
+
*/
|
|
77
|
+
const MENU_OPEN_SPRING = /* @__PURE__ */ springRole("menuOpen", {
|
|
78
|
+
response: .32,
|
|
79
|
+
dampingRatio: .8
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* UIMenu closing (a tap outside).
|
|
83
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
84
|
+
* iPhone 17 Pro, the same hook (0.85, 0.35, not tracking), Oct 23 2026
|
|
85
|
+
*/
|
|
86
|
+
const MENU_CLOSE_SPRING = /* @__PURE__ */ springRole("menuClose", {
|
|
87
|
+
response: .35,
|
|
88
|
+
dampingRatio: .85
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* A sub-menu opening in place (its row tapped on a phone): a card laid over
|
|
92
|
+
* the parent's rows from the tapped row grows down to fit the sub-menu, the
|
|
93
|
+
* menu's box with it, and the parent's rows recede, on this spring
|
|
94
|
+
* (spec:AST-094 FR34).
|
|
95
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
96
|
+
* iPhone 17 Pro, a pull-down button at y 150 whose menu opens downward
|
|
97
|
+
* (Alpha, Beta, Sort By ▸ (Name, Date, Size), Delete), every menu label,
|
|
98
|
+
* image and view read per 60 Hz tick, Oct 24 2026 (t from the tap-down;
|
|
99
|
+
* the lift at 60 ms): the menu's box kept its top and grew 188 → 190.9
|
|
100
|
+
* (106 ms), 198.1 (123), 218.1 (156), 238.5 (189), 255.6 (223), 268.2
|
|
101
|
+
* (256), 276.7 (289), 282.1 (324), 285.2 (359), 286.8 (389), 287.6 (424),
|
|
102
|
+
* settling at 287.2; the parent rows' opacity followed it (1 → 0.5 by 389
|
|
103
|
+
* ms). UIKit's own spring for it, logged as the
|
|
104
|
+
* `UIViewSpringAnimationBehavior` it starts a few ms after the lift on
|
|
105
|
+
* every sub-menu row (four captures): damping ratio 0.85, response 0.4 s.
|
|
106
|
+
* It fits the box's eleven frames to 0.12 pt rms of the 99 pt travel
|
|
107
|
+
* (start 89.5 ms), as a free single-spring fit does (0.86, 0.395)
|
|
108
|
+
*/
|
|
109
|
+
const SUB_MENU_OPEN_SPRING = /* @__PURE__ */ springRole("subMenuOpen", {
|
|
110
|
+
response: .4,
|
|
111
|
+
dampingRatio: .85
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Back out of a sub-menu (its header tapped): the card shrinks back up into
|
|
115
|
+
* the row, the menu's box with it, and the parent's rows come back, on this
|
|
116
|
+
* spring (spec:AST-094 FR34).
|
|
117
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
118
|
+
* iPhone 17 Pro, the same menu and readings, Oct 24 2026 (t from the
|
|
119
|
+
* tap-down; the lift at 60 ms): the box 287.2 → 284.3 (128 ms), 268.7
|
|
120
|
+
* (160), 249.9 (195), 233 (228), 219.6 (260), 209.6 (296), 202.5 (329),
|
|
121
|
+
* 197.6 (361), 194.3 (395), 192.1 (428), 189.7 (494), 188 (628); the
|
|
122
|
+
* parent rows' opacity 0.5 → 0.59 (160), 0.69 (195), 0.77 (228), 0.84
|
|
123
|
+
* (260), 0.89 (296), 0.93 (329), 0.95 (361), 0.97 (395), 0.99 (461), 1
|
|
124
|
+
* (527). UIKit's own spring for it, logged as the
|
|
125
|
+
* `UIViewSpringAnimationBehavior` it starts on every header back (three
|
|
126
|
+
* captures): damping ratio 1, response 0.4 s. It fits the box's twelve
|
|
127
|
+
* frames to 0.28 pt rms of the 99 pt travel (start 111 ms), the opacity to
|
|
128
|
+
* 0.0055 rms
|
|
129
|
+
*/
|
|
130
|
+
const SUB_MENU_BACK_SPRING = /* @__PURE__ */ springRole("subMenuBack", {
|
|
131
|
+
response: .4,
|
|
132
|
+
dampingRatio: 1
|
|
133
|
+
});
|
|
134
|
+
/**
|
|
135
|
+
* Context menu (UIContextMenuInteraction): the preview lifting once the
|
|
136
|
+
* long press commits.
|
|
137
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
138
|
+
* iPhone 17 Pro, the same hook (0.8, 0.32, tracking), Oct 23 2026
|
|
139
|
+
*/
|
|
140
|
+
const CONTEXT_MENU_LIFT_SPRING = /* @__PURE__ */ springRole("contextMenuLift", {
|
|
141
|
+
response: .32,
|
|
142
|
+
dampingRatio: .8
|
|
143
|
+
});
|
|
144
|
+
/**
|
|
145
|
+
* Context menu dismissing (a tap outside).
|
|
146
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
147
|
+
* iPhone 17 Pro, the same hook (0.85, 0.35, not tracking), Oct 23 2026
|
|
148
|
+
*/
|
|
149
|
+
const CONTEXT_MENU_DISMISS_SPRING = /* @__PURE__ */ springRole("contextMenuDismiss", {
|
|
150
|
+
response: .35,
|
|
151
|
+
dampingRatio: .85
|
|
152
|
+
});
|
|
153
|
+
/**
|
|
154
|
+
* Context menu: the menu's entrance beside the lifted preview and the preview
|
|
155
|
+
* shadow's rise and fade (the preview's growth and the backdrop's fade take
|
|
156
|
+
* the lift spring above).
|
|
157
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
158
|
+
* iPhone 17 Pro, per-frame morph and platter layers, Oct 23 2026: the menu
|
|
159
|
+
* content's opacity, blur and scale, the morph container's centre and the
|
|
160
|
+
* preview shadow's opacity each fit (0.30, 0.80), rms ≤ 0.001; the issued
|
|
161
|
+
* UIViewSpringAnimationBehaviorSettings are (0.8, 0.3)
|
|
162
|
+
*/
|
|
163
|
+
const CONTEXT_MENU_MORPH_SPRING = /* @__PURE__ */ springRole("contextMenuMorph", {
|
|
164
|
+
response: .3,
|
|
165
|
+
dampingRatio: .8
|
|
166
|
+
});
|
|
167
|
+
/**
|
|
168
|
+
* What UIKit plays for a menu with Reduce Motion on: critically damped,
|
|
169
|
+
* slower, no overshoot. A reference reading of UIKit only, never played:
|
|
170
|
+
* under reduced motion no core transition springs (`design:reduced-motion`
|
|
171
|
+
* DR1); a touch presentation cross-fades instead (DR2), and nothing opts
|
|
172
|
+
* out (DR4, `spec:AST-094` FR8).
|
|
173
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
174
|
+
* iPhone 17 Pro, `_animateUsingSpringWithDampingRatio:response:tracking:`
|
|
175
|
+
* hooked with Reduce Motion on (1.0, 0.4), Oct 23 2026
|
|
176
|
+
*/
|
|
177
|
+
const MENU_REDUCED_MOTION_SPRING = {
|
|
178
|
+
response: .4,
|
|
179
|
+
dampingRatio: 1
|
|
180
|
+
};
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/motion/uikit/springs.ts
|
|
183
|
+
/**
|
|
184
|
+
* @file springs.ts
|
|
185
|
+
* @input Nothing; data only
|
|
186
|
+
* @output One export per UIKit / SwiftUI interaction spring the touch
|
|
187
|
+
* presentations use (`SHEET_PRESENT_SPRING`, `SETTLE_SPRING`, …), each in
|
|
188
|
+
* the vocabulary of its source (SpringDescription: duration/bounce,
|
|
189
|
+
* response/dampingRatio or mass/stiffness/damping; a reader normalizes them
|
|
190
|
+
* to one form), and `springs`, the table of all of them by row name
|
|
191
|
+
* @position The springs domain of the UIKit constants table (motion/uikit)
|
|
192
|
+
*
|
|
193
|
+
* Every leaf carries one or more `@source` (apple-docs | wwdc | webkit |
|
|
194
|
+
* measured | GUESS); webkit and GUESS values also carry the `@measure` task
|
|
195
|
+
* that will confirm or replace them (MEASUREMENTS.md lists them all).
|
|
196
|
+
* uikit.test.ts enforces both.
|
|
197
|
+
*
|
|
198
|
+
* Most springs are measured on iOS 26.2 or documented by Apple; one is still
|
|
199
|
+
* a GUESS (`banner`). `switchThumbMove` is the switch's measured travel,
|
|
200
|
+
* which uikit/switch.ts reads. A guess starts from the nearest sourced
|
|
201
|
+
* spring and names it. A component built on the table gets the measured
|
|
202
|
+
* value the moment it lands, without changing.
|
|
203
|
+
*
|
|
204
|
+
* Press highlight in/out are fades, not springs: see timing.ts.
|
|
205
|
+
*/
|
|
206
|
+
/**
|
|
207
|
+
* SwiftUI `.smooth`: no bounce. Also SwiftUI's `Spring()` and
|
|
208
|
+
* `.spring(duration:bounce:)` defaults.
|
|
209
|
+
* @source apple-docs https://developer.apple.com/documentation/swiftui/spring/smooth(duration:extrabounce:)
|
|
210
|
+
*/
|
|
211
|
+
const SETTLE_SPRING = /* @__PURE__ */ springRole("settle", {
|
|
212
|
+
duration: .5,
|
|
213
|
+
bounce: 0
|
|
214
|
+
});
|
|
215
|
+
/**
|
|
216
|
+
* SwiftUI `.snappy`: "small amount of bounce", base bounce 0.15.
|
|
217
|
+
* @source apple-docs https://developer.apple.com/documentation/swiftui/spring/snappy(duration:extrabounce:)
|
|
218
|
+
*/
|
|
219
|
+
const QUICK_CHANGE_SPRING = /* @__PURE__ */ springRole("quickChange", {
|
|
220
|
+
duration: .5,
|
|
221
|
+
bounce: .15
|
|
222
|
+
});
|
|
223
|
+
/**
|
|
224
|
+
* SwiftUI `.bouncy`: base bounce 0.3.
|
|
225
|
+
* @source apple-docs https://developer.apple.com/documentation/swiftui/spring/bouncy(duration:extrabounce:)
|
|
226
|
+
*/
|
|
227
|
+
const EMPHASIS_SPRING = /* @__PURE__ */ springRole("emphasis", {
|
|
228
|
+
duration: .5,
|
|
229
|
+
bounce: .3
|
|
230
|
+
});
|
|
231
|
+
/**
|
|
232
|
+
* SwiftUI `interactiveSpring()` defaults: for a value that tracks a finger.
|
|
233
|
+
* @source apple-docs https://developer.apple.com/documentation/swiftui/animation/interactivespring(response:dampingfraction:blendduration:)
|
|
234
|
+
*/
|
|
235
|
+
const FINGER_TRACKING_SPRING = /* @__PURE__ */ springRole("fingerTracking", {
|
|
236
|
+
response: .15,
|
|
237
|
+
dampingRatio: .86
|
|
238
|
+
});
|
|
239
|
+
/**
|
|
240
|
+
* SwiftUI `Animation.default` since iOS 17 (what `withAnimation` uses).
|
|
241
|
+
* @source apple-docs https://developer.apple.com/documentation/swiftui/animation/default
|
|
242
|
+
*/
|
|
243
|
+
const STATE_CHANGE_SPRING = /* @__PURE__ */ springRole("stateChange", {
|
|
244
|
+
response: .55,
|
|
245
|
+
dampingRatio: 1
|
|
246
|
+
});
|
|
247
|
+
/**
|
|
248
|
+
* SwiftUI `.spring(response:dampingFraction:blendDuration:)` defaults.
|
|
249
|
+
* @source apple-docs https://developer.apple.com/documentation/swiftui/animation/spring(response:dampingfraction:blendduration:)
|
|
250
|
+
*/
|
|
251
|
+
const DIRECT_CHANGE_SPRING = /* @__PURE__ */ springRole("directChange", {
|
|
252
|
+
response: .5,
|
|
253
|
+
dampingRatio: .825
|
|
254
|
+
});
|
|
255
|
+
/**
|
|
256
|
+
* UIKit `UIView.animate(springDuration:bounce:…)` defaults (iOS 17).
|
|
257
|
+
* @source apple-docs https://developer.apple.com/documentation/uikit/uiview/animate(springduration:bounce:initialspringvelocity:delay:options:animations:completion:)
|
|
258
|
+
*/
|
|
259
|
+
const TIMED_CHANGE_SPRING = /* @__PURE__ */ springRole("timedChange", {
|
|
260
|
+
duration: .5,
|
|
261
|
+
bounce: 0
|
|
262
|
+
});
|
|
263
|
+
/**
|
|
264
|
+
* UIKit's default spring, `UISpringTimingParameters()`: Apple documents
|
|
265
|
+
* its damping ratio as 4.56, which is exactly 500 ÷ (2·√(3·1000)).
|
|
266
|
+
* Overdamped on paper; Core Animation treats overdamping as critical
|
|
267
|
+
* unless told otherwise, so in effect it is a critically
|
|
268
|
+
* damped spring with ω₀ = 18.26 rad/s (response 0.344 s) that settles in
|
|
269
|
+
* 0.506 s. The keyboard does not use it (see `keyboard`).
|
|
270
|
+
* @source apple-docs https://developer.apple.com/documentation/uikit/uispringtimingparameters/init() (damping ratio 4.56)
|
|
271
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
272
|
+
* iPhone 17 Pro, CAAnimation read, Oct 23 2026: UISpringTimingParameters()
|
|
273
|
+
* is mass 3, stiffness 1000, damping 500; UIKit runs it for 0.505824 s
|
|
274
|
+
* (clamped to critical) whatever duration the animator was given, and
|
|
275
|
+
* `UIView.animate` with curve 7 outside the keyboard is this spring with
|
|
276
|
+
* its duration forced to 0.5 s
|
|
277
|
+
*/
|
|
278
|
+
const VIEW_CHANGE_SPRING = /* @__PURE__ */ springRole("viewChange", {
|
|
279
|
+
mass: 3,
|
|
280
|
+
stiffness: 1e3,
|
|
281
|
+
damping: 500
|
|
282
|
+
});
|
|
283
|
+
/**
|
|
284
|
+
* Push (programmatic or a row tap): the incoming card slides in from the
|
|
285
|
+
* trailing edge, the outgoing card shifts by `navigation.parallax`. The
|
|
286
|
+
* spring does not start from rest: it starts at
|
|
287
|
+
* `navigation.pushVelocity` × the travel per second.
|
|
288
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
289
|
+
* iPhone 17 Pro, time-free fit of the (value, velocity) pairs UIKit
|
|
290
|
+
* writes to the cards' CAPresentationModifiers every frame (rms 5e-4 of
|
|
291
|
+
* the travel), Oct 23 2026
|
|
292
|
+
*/
|
|
293
|
+
const NAVIGATION_PUSH_SPRING = {
|
|
294
|
+
response: .3,
|
|
295
|
+
dampingRatio: 1
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Pop (back button or programmatic): identical to the push.
|
|
299
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
300
|
+
* iPhone 17 Pro, CAPresentationModifier fit as for the push, Oct 23 2026
|
|
301
|
+
*/
|
|
302
|
+
const NAVIGATION_POP_SPRING = {
|
|
303
|
+
response: .3,
|
|
304
|
+
dampingRatio: 1
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* Interactive pop finishing or cancelling after the finger lifts, starting
|
|
308
|
+
* from the finger's velocity; which one is `navigation.interactivePop*`.
|
|
309
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
310
|
+
* iPhone 17 Pro, CAPresentationModifier fit over released swipes,
|
|
311
|
+
* Oct 23 2026
|
|
312
|
+
*/
|
|
313
|
+
const NAVIGATION_INTERACTIVE_POP_FINISH_SPRING = {
|
|
314
|
+
response: .3,
|
|
315
|
+
dampingRatio: .85
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* Navigation bar elements (Liquid Glass) moving during a push or pop.
|
|
319
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
320
|
+
* iPhone 17 Pro, UIView.animate(springDuration: 0.6, bounce: 0,
|
|
321
|
+
* .beginFromCurrentState) calls hooked during transitions, Oct 23 2026
|
|
322
|
+
*/
|
|
323
|
+
const NAVIGATION_BAR_ELEMENTS_SPRING = {
|
|
324
|
+
duration: .6,
|
|
325
|
+
bounce: 0
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* Sheet presented programmatically: UIKit's default spring
|
|
329
|
+
* (`UIViewPropertyAnimator(duration: 0.4, timingParameters:
|
|
330
|
+
* UISpringTimingParameters())`), which renders critically damped at
|
|
331
|
+
* response 0.344 s; the same at the medium and large detents.
|
|
332
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
333
|
+
* iPhone 17 Pro, CAAnimation dump (mass 3, stiffness 1000, damping 500,
|
|
334
|
+
* duration 0.5, allowsOverdamping off), Oct 23 2026
|
|
335
|
+
*/
|
|
336
|
+
const SHEET_PRESENT_SPRING = {
|
|
337
|
+
mass: 3,
|
|
338
|
+
stiffness: 1e3,
|
|
339
|
+
damping: 500
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* Sheet dismissed programmatically (Cancel / Done / a scrim tap).
|
|
343
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
344
|
+
* iPhone 17 Pro, CAAnimation dump, the same spring as the presentation,
|
|
345
|
+
* Oct 23 2026
|
|
346
|
+
*/
|
|
347
|
+
const SHEET_DISMISS_SPRING = {
|
|
348
|
+
mass: 3,
|
|
349
|
+
stiffness: 1e3,
|
|
350
|
+
damping: 500
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Detent change (`animateChanges`) and the settle after a slow release
|
|
354
|
+
* (below the sheet's fast-release speed, which the sheet's own table
|
|
355
|
+
* records): critically damped at the same pace as the presentation.
|
|
356
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
357
|
+
* iPhone 17 Pro, `_UISpringParameters(dampingRatio: 1, response:
|
|
358
|
+
* 0.3441442326)` hooked, CASpringAnimation mass 1, stiffness 333.333,
|
|
359
|
+
* damping 36.515, Oct 23 2026
|
|
360
|
+
*/
|
|
361
|
+
const SHEET_DETENT_SPRING = {
|
|
362
|
+
response: .3441442326,
|
|
363
|
+
dampingRatio: 1
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* The settle after a fast release (from the sheet's fast-release speed
|
|
367
|
+
* on), toward a detent or out of the screen: same pace, 80 % damping;
|
|
368
|
+
* UIKit hands it the finger's velocity.
|
|
369
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
370
|
+
* iPhone 17 Pro, CASpringAnimation dump over 36 releases (mass 1,
|
|
371
|
+
* stiffness 333.333, damping 29.212), Oct 23 2026
|
|
372
|
+
*/
|
|
373
|
+
const SHEET_RELEASE_FAST_SPRING = {
|
|
374
|
+
response: .3441442326,
|
|
375
|
+
dampingRatio: .8
|
|
376
|
+
};
|
|
377
|
+
/**
|
|
378
|
+
* Sheet dismissed by a swipe: the fast-release spring.
|
|
379
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
380
|
+
* iPhone 17 Pro, CASpringAnimation dump (300 pt swipe in 0.15 s:
|
|
381
|
+
* stiffness 333.333, damping 29.212), Oct 23 2026
|
|
382
|
+
*/
|
|
383
|
+
const SHEET_DISMISS_SWIPE_SPRING = /* @__PURE__ */ springRole("sheetDismissSwipe", {
|
|
384
|
+
response: .3441442326,
|
|
385
|
+
dampingRatio: .8
|
|
386
|
+
});
|
|
387
|
+
/**
|
|
388
|
+
* UISwitch thumb travelling between off and on, measured: the switch table's
|
|
389
|
+
* `travel` reads this row, so the value has one home.
|
|
390
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
391
|
+
* iPhone 17 Pro, the lens's position behavior read on a tap (damping 1,
|
|
392
|
+
* response 0.3); the lens center after a 50 ms tap and after a 1 s hold
|
|
393
|
+
* fits one spring at 0.31 / 1 (rms 0.11 pt), Oct 23 2026
|
|
394
|
+
*/
|
|
395
|
+
const SWITCH_THUMB_MOVE_SPRING = {
|
|
396
|
+
response: .3,
|
|
397
|
+
dampingRatio: 1
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* Keyboard frame animation, show and hide alike: critically damped,
|
|
401
|
+
* response 0.2667 s. The notification reports curve 7 and 0.3833 s
|
|
402
|
+
* (`timing.keyboardNotificationMs`); Core Animation cuts the spring there.
|
|
403
|
+
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
404
|
+
* iPhone 17 Pro, CAAnimation read on the keyboard host and a
|
|
405
|
+
* keyboardLayoutGuide-pinned view, Oct 23 2026
|
|
406
|
+
*/
|
|
407
|
+
const KEYBOARD_SPRING = {
|
|
408
|
+
mass: 1,
|
|
409
|
+
stiffness: 555.0265,
|
|
410
|
+
damping: 47.118
|
|
411
|
+
};
|
|
412
|
+
/**
|
|
413
|
+
* Banner / toast sliding in from the top edge (system notification
|
|
414
|
+
* banner as the reference).
|
|
415
|
+
* @source GUESS — UIKit's default spring
|
|
416
|
+
* @measure M-T1
|
|
417
|
+
*/
|
|
418
|
+
const BANNER_SPRING = {
|
|
419
|
+
mass: 3,
|
|
420
|
+
stiffness: 1e3,
|
|
421
|
+
damping: 500
|
|
422
|
+
};
|
|
423
|
+
/**
|
|
424
|
+
* UISlider's release: after a finger lifts, the thumb settles on this spring
|
|
425
|
+
* toward 0.4 of the release's momentum projection. It is critically damped,
|
|
426
|
+
* so it never overshoots a target ahead of it.
|
|
427
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
428
|
+
* `UIViewSpringAnimationBehavior` at the lift reads response 0.4 and
|
|
429
|
+
* damping ratio 1. Four releases fit it per frame (the UIKit slider
|
|
430
|
+
* table). Oct 23 2026
|
|
431
|
+
*/
|
|
432
|
+
const SLIDER_RELEASE_SPRING = /* @__PURE__ */ springRole("sliderRelease", {
|
|
433
|
+
response: .4,
|
|
434
|
+
dampingRatio: 1
|
|
435
|
+
});
|
|
436
|
+
/**
|
|
437
|
+
* UISlider's lift: a finger's touch-down scales the thumb up on this spring.
|
|
438
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
439
|
+
* thumb's scale per frame after touch-down (the UIKit slider table).
|
|
440
|
+
* Oct 23 2026
|
|
441
|
+
*/
|
|
442
|
+
const SLIDER_LIFT_SPRING = /* @__PURE__ */ springRole("sliderLift", {
|
|
443
|
+
response: .215,
|
|
444
|
+
dampingRatio: .6
|
|
445
|
+
});
|
|
446
|
+
/**
|
|
447
|
+
* UISlider's drop: the lift's end scales the thumb back down on this spring.
|
|
448
|
+
* @source measured: UIKit lab, iOS 26.2 simulator, iPhone 17 Pro. The
|
|
449
|
+
* thumb's scale per frame after the lift (the UIKit slider table).
|
|
450
|
+
* Oct 23 2026
|
|
451
|
+
*/
|
|
452
|
+
const SLIDER_DROP_SPRING = /* @__PURE__ */ springRole("sliderDrop", {
|
|
453
|
+
response: .5,
|
|
454
|
+
dampingRatio: .7
|
|
455
|
+
});
|
|
456
|
+
/**
|
|
457
|
+
* Every spring above, by row name: the table the existing readers use. A
|
|
458
|
+
* component imports only the rows it plays (`architecture:component-style-authoring`
|
|
459
|
+
* INV6), each the same object as its row here.
|
|
460
|
+
*/
|
|
461
|
+
const springs = {
|
|
462
|
+
settle: SETTLE_SPRING,
|
|
463
|
+
quickChange: QUICK_CHANGE_SPRING,
|
|
464
|
+
emphasis: EMPHASIS_SPRING,
|
|
465
|
+
fingerTracking: FINGER_TRACKING_SPRING,
|
|
466
|
+
stateChange: STATE_CHANGE_SPRING,
|
|
467
|
+
directChange: DIRECT_CHANGE_SPRING,
|
|
468
|
+
timedChange: TIMED_CHANGE_SPRING,
|
|
469
|
+
viewChange: VIEW_CHANGE_SPRING,
|
|
470
|
+
navigationPush: NAVIGATION_PUSH_SPRING,
|
|
471
|
+
navigationPop: NAVIGATION_POP_SPRING,
|
|
472
|
+
navigationInteractivePopFinish: NAVIGATION_INTERACTIVE_POP_FINISH_SPRING,
|
|
473
|
+
navigationBarElements: NAVIGATION_BAR_ELEMENTS_SPRING,
|
|
474
|
+
sheetPresent: SHEET_PRESENT_SPRING,
|
|
475
|
+
sheetDismiss: SHEET_DISMISS_SPRING,
|
|
476
|
+
sheetDetent: SHEET_DETENT_SPRING,
|
|
477
|
+
sheetReleaseFast: SHEET_RELEASE_FAST_SPRING,
|
|
478
|
+
sheetDismissSwipe: SHEET_DISMISS_SWIPE_SPRING,
|
|
479
|
+
alertPresent: ALERT_PRESENT_SPRING,
|
|
480
|
+
alertDismiss: ALERT_DISMISS_SPRING,
|
|
481
|
+
actionSheetPresent: ACTION_SHEET_PRESENT_SPRING,
|
|
482
|
+
actionSheetDismiss: ACTION_SHEET_DISMISS_SPRING,
|
|
483
|
+
menuOpen: MENU_OPEN_SPRING,
|
|
484
|
+
menuClose: MENU_CLOSE_SPRING,
|
|
485
|
+
subMenuOpen: SUB_MENU_OPEN_SPRING,
|
|
486
|
+
subMenuBack: SUB_MENU_BACK_SPRING,
|
|
487
|
+
contextMenuLift: CONTEXT_MENU_LIFT_SPRING,
|
|
488
|
+
contextMenuDismiss: CONTEXT_MENU_DISMISS_SPRING,
|
|
489
|
+
contextMenuMorph: CONTEXT_MENU_MORPH_SPRING,
|
|
490
|
+
menuReducedMotion: MENU_REDUCED_MOTION_SPRING,
|
|
491
|
+
switchThumbMove: SWITCH_THUMB_MOVE_SPRING,
|
|
492
|
+
keyboard: KEYBOARD_SPRING,
|
|
493
|
+
banner: BANNER_SPRING,
|
|
494
|
+
sliderRelease: SLIDER_RELEASE_SPRING,
|
|
495
|
+
sliderLift: SLIDER_LIFT_SPRING,
|
|
496
|
+
sliderDrop: SLIDER_DROP_SPRING
|
|
497
|
+
};
|
|
498
|
+
/**
|
|
499
|
+
* The only springs that are motion roles. The touch presentations' record
|
|
500
|
+
* names some, and a component's own record names others, such as Slider's
|
|
501
|
+
* three. The generated motion role table lists each with its record.
|
|
502
|
+
* The registry takes these rows alone, so registering ships no other spring.
|
|
503
|
+
*/
|
|
504
|
+
const SPRING_ROLES = {
|
|
505
|
+
fingerTracking: FINGER_TRACKING_SPRING,
|
|
506
|
+
emphasis: EMPHASIS_SPRING,
|
|
507
|
+
settle: SETTLE_SPRING,
|
|
508
|
+
quickChange: QUICK_CHANGE_SPRING,
|
|
509
|
+
viewChange: VIEW_CHANGE_SPRING,
|
|
510
|
+
timedChange: TIMED_CHANGE_SPRING,
|
|
511
|
+
stateChange: STATE_CHANGE_SPRING,
|
|
512
|
+
directChange: DIRECT_CHANGE_SPRING,
|
|
513
|
+
menuOpen: MENU_OPEN_SPRING,
|
|
514
|
+
menuClose: MENU_CLOSE_SPRING,
|
|
515
|
+
subMenuOpen: SUB_MENU_OPEN_SPRING,
|
|
516
|
+
subMenuBack: SUB_MENU_BACK_SPRING,
|
|
517
|
+
sheetDismissSwipe: SHEET_DISMISS_SWIPE_SPRING,
|
|
518
|
+
contextMenuLift: CONTEXT_MENU_LIFT_SPRING,
|
|
519
|
+
contextMenuDismiss: CONTEXT_MENU_DISMISS_SPRING,
|
|
520
|
+
contextMenuMorph: CONTEXT_MENU_MORPH_SPRING,
|
|
521
|
+
sliderRelease: SLIDER_RELEASE_SPRING,
|
|
522
|
+
sliderLift: SLIDER_LIFT_SPRING,
|
|
523
|
+
sliderDrop: SLIDER_DROP_SPRING
|
|
524
|
+
};
|
|
525
|
+
/**
|
|
526
|
+
* Registers the role springs (`SPRING_ROLES`) as internal motion roles
|
|
527
|
+
* (motion/roles.ts), by their row names (`springs.settle`). Every other
|
|
528
|
+
* spring, UIKit's menu spring under Reduce Motion and the keyboard's
|
|
529
|
+
* included, is not a role. Each role row registers itself when it loads, so
|
|
530
|
+
* a call registers nothing new. A call still puts all 19 role rows in the
|
|
531
|
+
* caller's bundle.
|
|
532
|
+
*/
|
|
533
|
+
function registerSpringsTable() {
|
|
534
|
+
registerMotionTable("springs", SPRING_ROLES, { roles: Object.keys(SPRING_ROLES) });
|
|
535
|
+
}
|
|
536
|
+
//#endregion
|
|
537
|
+
//#region src/motion/projection.ts
|
|
538
|
+
/**
|
|
539
|
+
* @file projection.ts
|
|
540
|
+
* @input A release position and velocity, candidate rest points
|
|
541
|
+
* @output Exports `projectDistance` / `project` (WWDC18's momentum
|
|
542
|
+
* projection) and `selectSnapPoint` (the release target UIKit-style)
|
|
543
|
+
* @position Pure math; no DOM, no React
|
|
544
|
+
*
|
|
545
|
+
* WWDC18 "Designing Fluid Interfaces" (session 803): a thrown object goes to
|
|
546
|
+
* the endpoint nearest to where it WOULD coast if it were scrolled, not the
|
|
547
|
+
* endpoint nearest to where the finger let go. The talk's projection
|
|
548
|
+
* function, verbatim in units/s:
|
|
549
|
+
*
|
|
550
|
+
* func project(initialVelocity: CGFloat, decelerationRate: CGFloat) -> CGFloat {
|
|
551
|
+
* return (initialVelocity / 1000.0) * decelerationRate / (1.0 - decelerationRate)
|
|
552
|
+
* }
|
|
553
|
+
*
|
|
554
|
+
* used with `UIScrollView.DecelerationRate.normal`. A slow release projects
|
|
555
|
+
* onto itself, so it places; a flick continues past the finger.
|
|
556
|
+
*/
|
|
557
|
+
/** Distance a surface released at `velocity` units/s coasts (WWDC18). */
|
|
558
|
+
function projectDistance(velocity, rate = scroll.decelerationRate.normal) {
|
|
559
|
+
if (!(rate > 0 && rate < 1)) throw new RangeError(`projection: rate must be in (0, 1), got ${rate}`);
|
|
560
|
+
return velocity / 1e3 * rate / (1 - rate);
|
|
561
|
+
}
|
|
562
|
+
/** Where a surface released at `position` with `velocity` would come to rest. */
|
|
563
|
+
function project(position, velocity, rate = scroll.decelerationRate.normal) {
|
|
564
|
+
return position + projectDistance(velocity, rate);
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* The rest point a release goes to: the one nearest the projected rest
|
|
568
|
+
* position. This is the math primitive (projection + nearest); the release
|
|
569
|
+
* policy on top of it (a flick advances at least one detent, a release moving
|
|
570
|
+
* back toward its start cancels) is `resolveSnapPoint` (resolveSnapPoint.ts), so a
|
|
571
|
+
* component's release rule calls that rather than adding its own. `fromIndex` + `maxSteps` limit how many points away from the
|
|
572
|
+
* starting one a single release may travel (by index order; pass points
|
|
573
|
+
* sorted along the axis). Ties go to the point in the direction of travel.
|
|
574
|
+
*
|
|
575
|
+
* @example
|
|
576
|
+
* ```
|
|
577
|
+
* // A sheet with detents at 0, 300 and 600 px, released at 320 px moving
|
|
578
|
+
* // 900 px/s toward 600: projected ≈ 769 → 600.
|
|
579
|
+
* selectSnapPoint([0, 300, 600], {position: 320, velocity: 900});
|
|
580
|
+
* ```
|
|
581
|
+
*/
|
|
582
|
+
function selectSnapPoint(points, { position, velocity, rate = scroll.decelerationRate.normal, fromIndex, maxSteps }) {
|
|
583
|
+
if (points.length === 0) throw new RangeError("projection: selectSnapPoint needs at least one point");
|
|
584
|
+
const projected = project(position, velocity, rate);
|
|
585
|
+
let lo = 0;
|
|
586
|
+
let hi = points.length - 1;
|
|
587
|
+
if (fromIndex != null && maxSteps != null) {
|
|
588
|
+
const from = Math.min(Math.max(fromIndex, 0), points.length - 1);
|
|
589
|
+
lo = Math.max(lo, from - maxSteps);
|
|
590
|
+
hi = Math.min(hi, from + maxSteps);
|
|
591
|
+
}
|
|
592
|
+
let best = lo;
|
|
593
|
+
let bestDistance = Infinity;
|
|
594
|
+
for (let i = lo; i <= hi; i++) {
|
|
595
|
+
const distance = Math.abs(points[i] - projected);
|
|
596
|
+
const isTie = Math.abs(distance - bestDistance) < 1e-9;
|
|
597
|
+
const isAhead = Math.sign(points[i] - points[best]) === Math.sign(velocity);
|
|
598
|
+
if (distance < bestDistance - 1e-9 || isTie && isAhead) {
|
|
599
|
+
best = i;
|
|
600
|
+
bestDistance = distance;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
return {
|
|
604
|
+
index: best,
|
|
605
|
+
value: points[best],
|
|
606
|
+
projected
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region src/motion/resolveSnapPoint.ts
|
|
611
|
+
/**
|
|
612
|
+
* @file resolveSnapPoint.ts
|
|
613
|
+
* @input A release (position and velocity on one axis), the points it can
|
|
614
|
+
* land on, and the release policy's thresholds
|
|
615
|
+
* @output Exports resolveSnapPoint: the index of the snap point a release lands on,
|
|
616
|
+
* and the projected rest position it was judged from
|
|
617
|
+
* @position The release policy of the motion foundation, on
|
|
618
|
+
* `selectSnapPoint` (projection.ts), which stays the math primitive
|
|
619
|
+
* (projection + nearest). Pure: no DOM, no React. Internal to core: not
|
|
620
|
+
* exported from the package or any barrel (resolveSnapPoint.test.ts locks
|
|
621
|
+
* that). A component's release rule calls it with its own points and
|
|
622
|
+
* thresholds; this is the one "where does a release land" helper, so a
|
|
623
|
+
* second one should not be added beside it.
|
|
624
|
+
*
|
|
625
|
+
* - A slow release lands on the snap point nearest where it would come to rest:
|
|
626
|
+
* its position, or, with `projection`, its position plus the distance it
|
|
627
|
+
* would coast at its velocity (projection.ts). Below
|
|
628
|
+
* `projection.minSpeed` nothing is projected, so it lands on the snap point
|
|
629
|
+
* nearest where it was let go. A tie goes the way a projected release
|
|
630
|
+
* moves, and otherwise to the earlier snap point (`selectSnapPoint`).
|
|
631
|
+
* - A flick (`flickThreshold` or faster) lands at least on the next snap point
|
|
632
|
+
* beyond its position in the direction it moves, or on the nearest
|
|
633
|
+
* snap point to its projection if that is farther. A snap point within
|
|
634
|
+
* `tolerance` of the position counts as reached, so the flick goes on to
|
|
635
|
+
* the one after it. With `flickPastProjection`, a flick lands on the first
|
|
636
|
+
* snap point at or past its projection instead. A projection that passes a
|
|
637
|
+
* snap point carries the flick on.
|
|
638
|
+
* - With `start` (where the drag began), a release moving back toward it
|
|
639
|
+
* cancels to the snap point nearest `start`, whatever its travel so far or its
|
|
640
|
+
* speed.
|
|
641
|
+
* - With `fromIndex` and `maxSteps`, a release lands at most `maxSteps`
|
|
642
|
+
* points away from the one at `fromIndex` (a pager's one page per
|
|
643
|
+
* release).
|
|
644
|
+
*
|
|
645
|
+
* Snap points are ascending positions on the axis; velocities are in the same
|
|
646
|
+
* units per second, positive toward larger positions.
|
|
647
|
+
*/
|
|
648
|
+
/** The deceleration rate whose projection reaches `seconds` of the velocity. */
|
|
649
|
+
function rateForProjection(seconds) {
|
|
650
|
+
const ms = seconds * 1e3;
|
|
651
|
+
return ms / (1 + ms);
|
|
652
|
+
}
|
|
653
|
+
/** The index of the snap point nearest `position` (the first on a tie). */
|
|
654
|
+
function nearestIndex(points, position) {
|
|
655
|
+
let best = 0;
|
|
656
|
+
for (let i = 1; i < points.length; i += 1) if (Math.abs(points[i] - position) < Math.abs(points[best] - position)) best = i;
|
|
657
|
+
return best;
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* The snap point a release lands on.
|
|
661
|
+
*
|
|
662
|
+
* @example
|
|
663
|
+
* ```
|
|
664
|
+
* // Snap points at 0, 300 and 640 px. Released at 300 px moving toward 640 at
|
|
665
|
+
* // 1200 px/s, a flick: on to 640, although its projection (420 px) is
|
|
666
|
+
* // nearer 300.
|
|
667
|
+
* resolveSnapPoint({
|
|
668
|
+
* points: [0, 300, 640],
|
|
669
|
+
* position: 300,
|
|
670
|
+
* velocity: 1200,
|
|
671
|
+
* flickThreshold: 1008,
|
|
672
|
+
* tolerance: 1,
|
|
673
|
+
* projection: {seconds: 0.1, minSpeed: 250},
|
|
674
|
+
* start: 0,
|
|
675
|
+
* }); // {index: 2, projected: 420}
|
|
676
|
+
* ```
|
|
677
|
+
*/
|
|
678
|
+
function resolveSnapPoint({ points, position, velocity, flickThreshold, tolerance = 0, flickPastProjection = false, projection, start, fromIndex, maxSteps }) {
|
|
679
|
+
if (points.length === 0) throw new RangeError("resolveSnapPoint needs at least one snap point");
|
|
680
|
+
const choice = selectSnapPoint(points, {
|
|
681
|
+
position,
|
|
682
|
+
velocity: projection == null || Math.abs(velocity) < (projection.minSpeed ?? 0) ? 0 : velocity,
|
|
683
|
+
rate: projection == null ? void 0 : rateForProjection(projection.seconds),
|
|
684
|
+
fromIndex,
|
|
685
|
+
maxSteps
|
|
686
|
+
});
|
|
687
|
+
let index = choice.index;
|
|
688
|
+
if (Math.abs(velocity) >= flickThreshold) {
|
|
689
|
+
let next = -1;
|
|
690
|
+
if (velocity > 0) next = points.findIndex((d) => d > position + tolerance);
|
|
691
|
+
else for (let i = points.length - 1; i >= 0 && next === -1; i -= 1) if (points[i] < position - tolerance) next = i;
|
|
692
|
+
if (next !== -1 && (velocity > 0 ? next > index : next < index)) index = next;
|
|
693
|
+
if (flickPastProjection) {
|
|
694
|
+
const projected = choice.projected;
|
|
695
|
+
let past = velocity > 0 ? points.length - 1 : 0;
|
|
696
|
+
if (velocity > 0) {
|
|
697
|
+
const at = points.findIndex((d) => d >= projected - tolerance);
|
|
698
|
+
past = at === -1 ? past : at;
|
|
699
|
+
} else for (let i = points.length - 1; i >= 0; i -= 1) if (points[i] <= projected + tolerance) {
|
|
700
|
+
past = i;
|
|
701
|
+
break;
|
|
702
|
+
}
|
|
703
|
+
if (velocity > 0 ? past > index : past < index) index = past;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
if (start != null && velocity !== 0 && Math.sign(velocity) === Math.sign(start - position)) index = nearestIndex(points, start);
|
|
707
|
+
if (fromIndex != null && maxSteps != null) {
|
|
708
|
+
const from = Math.min(Math.max(fromIndex, 0), points.length - 1);
|
|
709
|
+
index = Math.min(Math.max(index, from - maxSteps), from + maxSteps);
|
|
710
|
+
}
|
|
711
|
+
return {
|
|
712
|
+
index,
|
|
713
|
+
projected: choice.projected
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
//#endregion
|
|
717
|
+
export { registerSpringsTable as n, springs as r, resolveSnapPoint as t };
|