@astryxdesign/core 0.7.7-canary.550ff21 → 0.7.7-canary.559b005

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.
Files changed (264) hide show
  1. package/dist/Avatar/Avatar.d.ts.map +1 -1
  2. package/dist/Avatar/Avatar.js +1 -1
  3. package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
  4. package/dist/Breadcrumbs/BreadcrumbItem.js +2 -1
  5. package/dist/Button/Button.d.ts.map +1 -1
  6. package/dist/Button/Button.js +3 -2
  7. package/dist/DateInput/Wheel.d.ts +17 -1
  8. package/dist/DateInput/Wheel.d.ts.map +1 -1
  9. package/dist/DateInput/Wheel.js +179 -19
  10. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  11. package/dist/DateRangeInput/DateRangeInput.js +63 -49
  12. package/dist/Dialog/Dialog.d.ts.map +1 -1
  13. package/dist/Dialog/Dialog.js +49 -12
  14. package/dist/Drawer/Drawer.d.ts.map +1 -1
  15. package/dist/Drawer/Drawer.js +15 -10
  16. package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -1
  17. package/dist/Drawer/useDrawerDialogPresence.js +4 -0
  18. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  19. package/dist/DropdownMenu/DropdownMenu.js +20 -4
  20. package/dist/InfoTip/InfoTip.d.ts +63 -0
  21. package/dist/InfoTip/InfoTip.d.ts.map +1 -0
  22. package/dist/InfoTip/InfoTip.js +126 -0
  23. package/dist/InfoTip/index.d.ts +10 -0
  24. package/dist/InfoTip/index.d.ts.map +1 -0
  25. package/dist/InfoTip/index.js +12 -0
  26. package/dist/Layer/layerClickBoundary.d.ts +7 -1
  27. package/dist/Layer/layerClickBoundary.d.ts.map +1 -1
  28. package/dist/Layer/layerClickBoundary.js +2 -2
  29. package/dist/Layer/useBackdropPress.d.ts +27 -0
  30. package/dist/Layer/useBackdropPress.d.ts.map +1 -0
  31. package/dist/Layer/useBackdropPress.js +53 -0
  32. package/dist/Layer/usePressPin.d.ts +95 -0
  33. package/dist/Layer/usePressPin.d.ts.map +1 -0
  34. package/dist/Layer/usePressPin.js +365 -0
  35. package/dist/Layer/useTouchTrigger.d.ts +23 -1
  36. package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
  37. package/dist/Layer/useTouchTrigger.js +45 -7
  38. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  39. package/dist/Lightbox/Lightbox.js +2 -1
  40. package/dist/Popover/usePopover.d.ts.map +1 -1
  41. package/dist/Popover/usePopover.js +56 -7
  42. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  43. package/dist/PowerSearch/PowerSearch.js +38 -30
  44. package/dist/ProgressBar/ProgressBar.d.ts +1 -1
  45. package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
  46. package/dist/ProgressBar/ProgressBar.js +33 -6
  47. package/dist/SegmentedControl/SegmentedControl.d.ts +3 -1
  48. package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  49. package/dist/SegmentedControl/SegmentedControl.js +115 -8
  50. package/dist/SegmentedControl/SegmentedControlContext.d.ts +6 -0
  51. package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
  52. package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -0
  53. package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
  54. package/dist/SegmentedControl/SegmentedControlItem.js +10 -2
  55. package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts +357 -0
  56. package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -0
  57. package/dist/SegmentedControl/useSegmentedSelectionMotion.js +1349 -0
  58. package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +70 -0
  59. package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -0
  60. package/dist/SegmentedControl/useSegmentedTouchTracking.js +264 -0
  61. package/dist/Selector/Selector.d.ts.map +1 -1
  62. package/dist/Selector/Selector.js +96 -67
  63. package/dist/Selector/optionShape.d.ts +24 -0
  64. package/dist/Selector/optionShape.d.ts.map +1 -0
  65. package/dist/Selector/optionShape.js +48 -0
  66. package/dist/Selector/selectableOptionEntries.d.ts +20 -0
  67. package/dist/Selector/selectableOptionEntries.d.ts.map +1 -0
  68. package/dist/Selector/selectableOptionEntries.js +38 -0
  69. package/dist/Selector/utils.d.ts +2 -17
  70. package/dist/Selector/utils.d.ts.map +1 -1
  71. package/dist/Selector/utils.js +3 -51
  72. package/dist/Switch/Switch.d.ts +1 -1
  73. package/dist/Switch/Switch.d.ts.map +1 -1
  74. package/dist/Switch/Switch.js +200 -46
  75. package/dist/Switch/switchFill.d.ts +31 -0
  76. package/dist/Switch/switchFill.d.ts.map +1 -0
  77. package/dist/Switch/switchFill.js +88 -0
  78. package/dist/Switch/switchTouch.d.ts +74 -0
  79. package/dist/Switch/switchTouch.d.ts.map +1 -0
  80. package/dist/Switch/switchTouch.js +125 -0
  81. package/dist/Switch/useSwitchTouch.d.ts +276 -0
  82. package/dist/Switch/useSwitchTouch.d.ts.map +1 -0
  83. package/dist/Switch/useSwitchTouch.js +939 -0
  84. package/dist/TabList/Tab.d.ts.map +1 -1
  85. package/dist/TabList/Tab.js +4 -3
  86. package/dist/Toast/Toast.d.ts.map +1 -1
  87. package/dist/Toast/Toast.js +5 -0
  88. package/dist/Token/Token.d.ts.map +1 -1
  89. package/dist/Token/Token.js +1 -0
  90. package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
  91. package/dist/Tokenizer/Tokenizer.js +12 -5
  92. package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +3 -0
  93. package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -0
  94. package/dist/Tokenizer/TokenizerItemRemovableContext.js +17 -0
  95. package/dist/Tooltip/Tooltip.d.ts +30 -6
  96. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  97. package/dist/Tooltip/Tooltip.js +5 -0
  98. package/dist/Tooltip/index.d.ts +1 -1
  99. package/dist/Tooltip/index.d.ts.map +1 -1
  100. package/dist/Tooltip/useTooltip.d.ts +31 -5
  101. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  102. package/dist/Tooltip/useTooltip.js +59 -18
  103. package/dist/Typeahead/Typeahead.d.ts.map +1 -1
  104. package/dist/Typeahead/Typeahead.js +26 -15
  105. package/dist/astryx.css +125 -2
  106. package/dist/gestures/GestureHost.d.ts.map +1 -1
  107. package/dist/gestures/GestureHost.js +71 -14
  108. package/dist/gestures/PressTracker.d.ts +6 -0
  109. package/dist/gestures/PressTracker.d.ts.map +1 -1
  110. package/dist/gestures/PressTracker.js +3 -0
  111. package/dist/gestures/types.d.ts +6 -0
  112. package/dist/gestures/types.d.ts.map +1 -1
  113. package/dist/gestures/usePressTracker.d.ts.map +1 -1
  114. package/dist/gestures/usePressTracker.js +1 -0
  115. package/dist/gestures/wheelSegmenter.d.ts +14 -3
  116. package/dist/gestures/wheelSegmenter.d.ts.map +1 -1
  117. package/dist/gestures/wheelSegmenter.js +32 -8
  118. package/dist/hooks/actionGroupTracker.d.ts +3 -3
  119. package/dist/hooks/actionGroupTracker.d.ts.map +1 -1
  120. package/dist/hooks/actionGroupTracker.js +6 -53
  121. package/dist/hooks/useAttachment.d.ts +16 -8
  122. package/dist/hooks/useAttachment.d.ts.map +1 -1
  123. package/dist/hooks/useAttachment.js +35 -15
  124. package/dist/hooks/useFocusTrap.d.ts +15 -0
  125. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  126. package/dist/hooks/useFocusTrap.js +13 -2
  127. package/dist/hooks/useHighlightedOptionScroll.d.ts.map +1 -1
  128. package/dist/hooks/useHighlightedOptionScroll.js +14 -11
  129. package/dist/hooks/useMediaQuery.d.ts +2 -1
  130. package/dist/hooks/useMediaQuery.d.ts.map +1 -1
  131. package/dist/hooks/useMediaQuery.js +7 -4
  132. package/dist/hooks/usePager.d.ts +261 -0
  133. package/dist/hooks/usePager.d.ts.map +1 -0
  134. package/dist/hooks/usePager.js +1169 -0
  135. package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts +8 -0
  136. package/dist/i18n/generated-english/InfoTip/InfoTip.generated.d.ts.map +1 -0
  137. package/dist/i18n/generated-english/InfoTip/InfoTip.generated.js +12 -0
  138. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  139. package/dist/i18n/generated-locales/en.generated.js +2 -1
  140. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  141. package/dist/i18n/generated-locales/pseudo.generated.js +2 -1
  142. package/dist/index.d.ts +1 -0
  143. package/dist/index.d.ts.map +1 -1
  144. package/dist/index.js +1 -0
  145. package/dist/motion/paging.d.ts +16 -5
  146. package/dist/motion/paging.d.ts.map +1 -1
  147. package/dist/motion/paging.js +34 -14
  148. package/dist/motion/roles.d.ts +7 -1
  149. package/dist/motion/roles.d.ts.map +1 -1
  150. package/dist/motion/roles.js +20 -1
  151. package/dist/motion/uikit/index.d.ts +7 -4
  152. package/dist/motion/uikit/index.d.ts.map +1 -1
  153. package/dist/motion/uikit/index.js +7 -4
  154. package/dist/motion/uikit/paging.d.ts +31 -20
  155. package/dist/motion/uikit/paging.d.ts.map +1 -1
  156. package/dist/motion/uikit/paging.js +41 -11
  157. package/dist/motion/uikit/progressBar.d.ts +27 -7
  158. package/dist/motion/uikit/progressBar.d.ts.map +1 -1
  159. package/dist/motion/uikit/progressBar.js +31 -11
  160. package/dist/motion/uikit/segmented.d.ts +55 -0
  161. package/dist/motion/uikit/segmented.d.ts.map +1 -0
  162. package/dist/motion/uikit/segmented.js +77 -0
  163. package/dist/motion/uikit/springs.d.ts +8 -42
  164. package/dist/motion/uikit/springs.d.ts.map +1 -1
  165. package/dist/motion/uikit/springs.js +12 -42
  166. package/dist/motion/uikit/switch.d.ts +166 -0
  167. package/dist/motion/uikit/switch.d.ts.map +1 -0
  168. package/dist/motion/uikit/switch.js +186 -0
  169. package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts +18 -0
  170. package/dist/privateAttributes/pressHoldsDrag.stylex.d.ts.map +1 -0
  171. package/dist/privateAttributes/pressHoldsDrag.stylex.js +28 -0
  172. package/dist/privateAttributes/segmentTitle.stylex.d.ts +5 -0
  173. package/dist/privateAttributes/segmentTitle.stylex.d.ts.map +1 -0
  174. package/dist/privateAttributes/segmentTitle.stylex.js +22 -0
  175. package/dist/utils/browserClickWait.d.ts +35 -0
  176. package/dist/utils/browserClickWait.d.ts.map +1 -0
  177. package/dist/utils/browserClickWait.js +123 -0
  178. package/dist/utils/clickGuard.d.ts +7 -1
  179. package/dist/utils/clickGuard.d.ts.map +1 -1
  180. package/dist/utils/clickGuard.js +23 -1
  181. package/dist/utils/pressFeedback.d.ts.map +1 -1
  182. package/dist/utils/pressFeedback.js +5 -0
  183. package/locales/en.json +4 -0
  184. package/locales/pseudo.json +3 -0
  185. package/package.json +9 -4
  186. package/src/Avatar/Avatar.tsx +3 -1
  187. package/src/Breadcrumbs/BreadcrumbItem.tsx +4 -1
  188. package/src/Button/Button.tsx +3 -2
  189. package/src/DateInput/Wheel.tsx +174 -14
  190. package/src/DateRangeInput/DateRangeInput.doc.mjs +3 -2
  191. package/src/DateRangeInput/DateRangeInput.tsx +117 -71
  192. package/src/Dialog/Dialog.tsx +62 -11
  193. package/src/Drawer/Drawer.tsx +27 -10
  194. package/src/Drawer/useDrawerDialogPresence.ts +4 -0
  195. package/src/DropdownMenu/DropdownMenu.tsx +28 -6
  196. package/src/InfoTip/InfoTip.doc.mjs +192 -0
  197. package/src/InfoTip/InfoTip.tsx +186 -0
  198. package/src/InfoTip/index.ts +14 -0
  199. package/src/Layer/layerClickBoundary.ts +2 -2
  200. package/src/Layer/useBackdropPress.ts +81 -0
  201. package/src/Layer/usePressPin.ts +516 -0
  202. package/src/Layer/useTouchTrigger.ts +56 -6
  203. package/src/Lightbox/Lightbox.tsx +2 -1
  204. package/src/Popover/usePopover.tsx +71 -9
  205. package/src/PowerSearch/PowerSearch.tsx +38 -31
  206. package/src/ProgressBar/ProgressBar.doc.mjs +4 -2
  207. package/src/ProgressBar/ProgressBar.tsx +67 -7
  208. package/src/SegmentedControl/SegmentedControl.doc.mjs +3 -3
  209. package/src/SegmentedControl/SegmentedControl.tsx +179 -5
  210. package/src/SegmentedControl/SegmentedControlContext.ts +6 -0
  211. package/src/SegmentedControl/SegmentedControlItem.tsx +14 -2
  212. package/src/SegmentedControl/useSegmentedSelectionMotion.ts +1637 -0
  213. package/src/SegmentedControl/useSegmentedTouchTracking.ts +308 -0
  214. package/src/Selector/Selector.tsx +136 -89
  215. package/src/Selector/optionShape.ts +64 -0
  216. package/src/Selector/selectableOptionEntries.ts +39 -0
  217. package/src/Selector/utils.ts +9 -68
  218. package/src/Switch/Switch.doc.mjs +3 -3
  219. package/src/Switch/Switch.tsx +412 -86
  220. package/src/Switch/switchFill.ts +106 -0
  221. package/src/Switch/switchTouch.ts +186 -0
  222. package/src/Switch/useSwitchTouch.ts +1051 -0
  223. package/src/TabList/Tab.tsx +5 -3
  224. package/src/Toast/Toast.tsx +5 -0
  225. package/src/Token/Token.tsx +2 -0
  226. package/src/Tokenizer/Tokenizer.tsx +15 -5
  227. package/src/Tokenizer/TokenizerItemRemovableContext.ts +22 -0
  228. package/src/Tooltip/Tooltip.doc.mjs +21 -6
  229. package/src/Tooltip/Tooltip.tsx +42 -5
  230. package/src/Tooltip/index.ts +1 -0
  231. package/src/Tooltip/useTooltip.doc.mjs +4 -2
  232. package/src/Tooltip/useTooltip.tsx +84 -21
  233. package/src/Typeahead/Typeahead.tsx +29 -15
  234. package/src/gestures/GestureHost.ts +100 -11
  235. package/src/gestures/PressTracker.ts +10 -0
  236. package/src/gestures/types.ts +6 -0
  237. package/src/gestures/usePressTracker.ts +2 -0
  238. package/src/gestures/wheelSegmenter.ts +36 -7
  239. package/src/hooks/actionGroupTracker.ts +12 -56
  240. package/src/hooks/useAttachment.ts +56 -14
  241. package/src/hooks/useFocusTrap.ts +26 -2
  242. package/src/hooks/useHighlightedOptionScroll.ts +15 -11
  243. package/src/hooks/useMediaQuery.doc.mjs +2 -2
  244. package/src/hooks/useMediaQuery.ts +13 -4
  245. package/src/hooks/usePager.ts +1446 -0
  246. package/src/i18n/generated-english/InfoTip/InfoTip.generated.ts +13 -0
  247. package/src/i18n/generated-locales/en.generated.ts +1 -0
  248. package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
  249. package/src/index.ts +1 -0
  250. package/src/motion/MEASUREMENTS.md +36 -27
  251. package/src/motion/README.md +3 -1
  252. package/src/motion/paging.ts +37 -14
  253. package/src/motion/roles.ts +20 -1
  254. package/src/motion/uikit/index.ts +6 -5
  255. package/src/motion/uikit/paging.ts +41 -10
  256. package/src/motion/uikit/progressBar.ts +31 -11
  257. package/src/motion/uikit/segmented.ts +74 -0
  258. package/src/motion/uikit/springs.ts +12 -42
  259. package/src/motion/uikit/switch.ts +174 -0
  260. package/src/privateAttributes/pressHoldsDrag.stylex.ts +28 -0
  261. package/src/privateAttributes/segmentTitle.stylex.ts +22 -0
  262. package/src/utils/browserClickWait.ts +133 -0
  263. package/src/utils/clickGuard.ts +28 -1
  264. package/src/utils/pressFeedback.ts +5 -0
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @generated by scripts/generate-i18n-runtime.mjs from packages/core/locales/en.json,
5
+ * holding the English for the catalog keys named in packages/core/src/InfoTip/InfoTip.tsx.
6
+ * Do not edit by hand. Run `pnpm generate:i18n-runtime` instead.
7
+ */
8
+
9
+ const english: Readonly<Record<string, string>> = {
10
+ "@astryx.infoTip.label": "More information"
11
+ };
12
+
13
+ export default english;
@@ -632,6 +632,7 @@ const runtimeCatalog: Readonly<Record<string, string>> = {
632
632
  '@astryx.comments.loading': 'Loading comments',
633
633
  '@astryx.comments.olderFailed': "Earlier comments couldn't load",
634
634
  '@astryx.comments.postFailed': "Your comment couldn't be posted.",
635
+ '@astryx.infoTip.label': 'More information',
635
636
  };
636
637
 
637
638
  export default runtimeCatalog;
@@ -643,6 +643,7 @@ const runtimeCatalog: Readonly<Record<string, string>> = {
643
643
  '@astryx.comments.loading': '⟦Łóàðíñĝ çóɱɱéñţš⟧',
644
644
  '@astryx.comments.olderFailed': "⟦Éàřłíéř çóɱɱéñţš çóúłðñ'ţ łóàð⟧",
645
645
  '@astryx.comments.postFailed': "⟦Ýóúř çóɱɱéñţ çóúłðñ'ţ ƀé þóšţéð.⟧",
646
+ '@astryx.infoTip.label': '⟦Ṁóřé íñƒóřɱàţíóñ⟧',
646
647
  };
647
648
 
648
649
  export default runtimeCatalog;
package/src/index.ts CHANGED
@@ -71,6 +71,7 @@ export * from './SelectableCard';
71
71
  export * from './Selector';
72
72
  export * from './MultiSelector';
73
73
  export * from './Icon';
74
+ export * from './InfoTip';
74
75
  export * from './Indicator';
75
76
  export * from './InputGroup';
76
77
  export * from './Item';
@@ -37,27 +37,28 @@ installed); rows marked † also on iOS 18 for the pre-glass delta. iPhone
37
37
 
38
38
  ## Shared (foundation)
39
39
 
40
- | ID | What | App and gesture | Extract | Method | Feeds |
41
- | ----- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
42
- | M-S1 | Deceleration rates | none | `UIScrollView.DecelerationRate.normal.rawValue`, `.fast.rawValue` | D | `scroll.decelerationRate` |
43
- | M-S2 | Momentum coast | A long list (Contacts, or a probe table of 500 rows): flicks released at 1000, 2500, 5000 pt/s | contentOffset(t) from release to rest; decay constant; per-millisecond vs per-frame model; the speed at which it stops | C | `scroll.decelerationRate` |
44
- | M-S3 | Bounce-back spring | Same list: drag 120 pt past the top, hold still, release; a flick into the top edge at 3000 pt/s | contentOffset(t) after release and after edge contact; spring response and damping ratio; velocity hand-off | C | `scroll.bounce` |
45
- | M-S5 | Rubber band | Same list on an 852 pt view: drag 100, 300, 600 pt past the top; a horizontal pager | displayed overflow against finger overflow; confirm c = 0.55 and d = the view's size on the axis | C | `scroll.rubberBand` |
46
- | M-PG1 | Paging | Photos full-screen swipes; a probe paging scroll view | page chosen per release position × velocity (thresholds; at most one page?); contentOffset(t) onto the page | B, C | `paging` |
47
- | M-ST1 | Scroll to top | Settings scrolled down 500, 2000, 8000 pt; tap the status bar | contentOffset(t); duration against distance; curve or spring fit | B, C | `scroll.scrollToTopRate` |
48
- | M-N1 | Navigation push | Settings: tap General | incoming leading edge x(t), outgoing x(t) (parallax fraction), dimming alpha(t); animation parameters | A, B | `springs.navigationPush` |
49
- | M-N2 | Navigation pop | General: back button | same as M-N1 | A, B | `springs.navigationPop` |
50
- | M-N3 | Interactive pop | Settings ▸ General: edge swipe released at 40 % of the width at 600 pt/s (finishes) and at 30 % at rest (cancels) | x(t) after release; spring parameters; the finish / cancel rule (position, velocity) | A, B | `springs.navigationInteractivePopFinish` |
51
- | M-A1 | Alert | Probe app: `UIAlertController(.alert)` presented and dismissed | scale(t), alpha(t) of the alert and the dimming view; animation parameters | A | `springs.alertPresent`, `.alertDismiss` |
52
- | M-AS1 | Action sheet and menu | Probe app: `.actionSheet`; a button with a `UIMenu` as its primary action; Files: the … menu | scale, alpha, position (t) on open and close; animation parameters | A, B | `springs.actionSheet*`, `.menu*` |
53
- | M-CM1 | Context menu | Files: long-press an item; dismiss by tapping outside | preview scale(t) on lift, backdrop blur and dim (t), menu scale(t); the preview's return on dismiss | A, B | `springs.contextMenu*` |
54
- | M-K1 | UIKit legacy spring | Probe app: `UIView.animate(withDuration:usingSpringWithDamping:initialSpringVelocity:)`, durations 0.3, 0.5, 1 × ratios 0.5, 0.8, 1 × velocities 0, 2 | the `CASpringAnimation` UIKit attaches: mass, stiffness, damping, initialVelocity, duration, settlingDuration | A | `springs.ts` (UIKit's legacy springs) |
55
- | M-K2 | Default spring, keyboard | Probe app: an animator with `UISpringTimingParameters()`; focus and blur a text field | both springs' parameters and allowsOverdamping; the keyboard notification's duration and curve | A, D | `springs.viewChange`, `.keyboard`, `timing.keyboard*` |
56
- | M-CA1 | Settling duration | none: `CASpringAnimation` mass 1, stiffness 100, damping 5, 10, 15, 20, 40 × initialVelocity 0, 5, −5 × allowsOverdamping on, off | `settlingDuration` of each (checks the critically damped and overdamped branches) | D | `springs.ts` (settling) |
57
- | M-T1 | Banner | A notification pushed to the simulator while an app is in the foreground | banner y(t) in and out; time on screen | B | `springs.banner` |
58
- | M-RM1 | Reduced Motion | Reduce Motion on, Prefer Cross-Fade Transitions on and off: Settings push and pop, an alert (sheets: M-SH13; controls: M-SW11, M-SL12, M-SG15) | which transitions become cross-fades; alpha(t), duration and curve; what still moves | B | `timing.reducedMotionCrossFadeMs` (played at 200 ms: `design:reduced-motion` DR2 caps it, DEC-1 of 2026-10-24, departing from the measured 0.5 s) |
59
- | M-PR1 | Press release curve | Settings and Contacts: a row tapped and released (the deselect cross-fade) | the timing function Core Animation attaches to the deselect fade (control points) | A | `timing.press.highlightOutCurve` |
60
- | M-NB1 | Navigation bar hide / show | none | `UINavigationController.hideShowBarDuration` | D | `timing.navigationBarHideShowMs` |
40
+ | ID | What | App and gesture | Extract | Method | Feeds |
41
+ | ----- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
42
+ | M-S1 | Deceleration rates | none | `UIScrollView.DecelerationRate.normal.rawValue`, `.fast.rawValue` | D | `scroll.decelerationRate` |
43
+ | M-S2 | Momentum coast | A long list (Contacts, or a probe table of 500 rows): flicks released at 1000, 2500, 5000 pt/s | contentOffset(t) from release to rest; decay constant; per-millisecond vs per-frame model; the speed at which it stops | C | `scroll.decelerationRate` |
44
+ | M-S3 | Bounce-back spring | Same list: drag 120 pt past the top, hold still, release; a flick into the top edge at 3000 pt/s | contentOffset(t) after release and after edge contact; spring response and damping ratio; velocity hand-off | C | `scroll.bounce` |
45
+ | M-S5 | Rubber band | Same list on an 852 pt view: drag 100, 300, 600 pt past the top; a horizontal pager | displayed overflow against finger overflow; confirm c = 0.55 and d = the view's size on the axis | C | `scroll.rubberBand` |
46
+ | M-PG1 | Paging | Photos full-screen swipes; a probe paging scroll view | page chosen per release position × velocity (thresholds; at most one page?); contentOffset(t) onto the page | B, C | `paging` |
47
+ | M-ST1 | Scroll to top | Settings scrolled down 500, 2000, 8000 pt; tap the status bar | contentOffset(t); duration against distance; curve or spring fit | B, C | `scroll.scrollToTopRate` |
48
+ | M-N1 | Navigation push | Settings: tap General | incoming leading edge x(t), outgoing x(t) (parallax fraction), dimming alpha(t); animation parameters | A, B | `springs.navigationPush` |
49
+ | M-N2 | Navigation pop | General: back button | same as M-N1 | A, B | `springs.navigationPop` |
50
+ | M-N3 | Interactive pop | Settings ▸ General: edge swipe released at 40 % of the width at 600 pt/s (finishes) and at 30 % at rest (cancels) | x(t) after release; spring parameters; the finish / cancel rule (position, velocity) | A, B | `springs.navigationInteractivePopFinish` |
51
+ | M-A1 | Alert | Probe app: `UIAlertController(.alert)` presented and dismissed | scale(t), alpha(t) of the alert and the dimming view; animation parameters | A | `springs.alertPresent`, `.alertDismiss` |
52
+ | M-AS1 | Action sheet and menu | Probe app: `.actionSheet`; a button with a `UIMenu` as its primary action; Files: the … menu | scale, alpha, position (t) on open and close; animation parameters | A, B | `springs.actionSheet*`, `.menu*` |
53
+ | M-CM1 | Context menu | Files: long-press an item; dismiss by tapping outside | preview scale(t) on lift, backdrop blur and dim (t), menu scale(t); the preview's return on dismiss | A, B | `springs.contextMenu*` |
54
+ | M-K1 | UIKit legacy spring | Probe app: `UIView.animate(withDuration:usingSpringWithDamping:initialSpringVelocity:)`, durations 0.3, 0.5, 1 × ratios 0.5, 0.8, 1 × velocities 0, 2 | the `CASpringAnimation` UIKit attaches: mass, stiffness, damping, initialVelocity, duration, settlingDuration | A | `springs.ts` (UIKit's legacy springs) |
55
+ | M-K2 | Default spring, keyboard | Probe app: an animator with `UISpringTimingParameters()`; focus and blur a text field | both springs' parameters and allowsOverdamping; the keyboard notification's duration and curve | A, D | `springs.viewChange`, `.keyboard`, `timing.keyboard*` |
56
+ | M-CA1 | Settling duration | none: `CASpringAnimation` mass 1, stiffness 100, damping 5, 10, 15, 20, 40 × initialVelocity 0, 5, −5 × allowsOverdamping on, off | `settlingDuration` of each (checks the critically damped and overdamped branches) | D | `springs.ts` (settling) |
57
+ | M-T1 | Banner | A notification pushed to the simulator while an app is in the foreground | banner y(t) in and out; time on screen | B | `springs.banner` |
58
+ | M-RM1 | Reduced Motion | Reduce Motion on, Prefer Cross-Fade Transitions on and off: Settings push and pop, an alert (sheets: M-SH13; controls: M-SW11, M-SL12, M-SG15) | which transitions become cross-fades; alpha(t), duration and curve; what still moves | B | `timing.reducedMotionCrossFadeMs` (played at 200 ms: `design:reduced-motion` DR2 caps it, DEC-1 of 2026-10-24, departing from the measured 0.5 s) |
59
+ | M-PR1 | Press release curve | Settings and Contacts: a row tapped and released (the deselect cross-fade) | the timing function Core Animation attaches to the deselect fade (control points) | A | `timing.press.highlightOutCurve` |
60
+ | M-NB1 | Navigation bar hide / show | none | `UINavigationController.hideShowBarDuration` | D | `timing.navigationBarHideShowMs` |
61
+ | M-PB1 | Indeterminate pulse | Reduce Motion on: Safari loading a page (its indeterminate bar) beside ProgressBar's reduced-motion pulse | Not a parity value: an owner value (`component:ProgressBar` DEC-2); confirm the 2000 ms pulse reads as calm and the 0.84 floor keeps 3:1 (AR4) | B | `progressBar.reducedMotionPulseMs`, `progressBar.reducedMotionPulseFloor` |
61
62
 
62
63
  Done (UIKit lab, iOS 26.2 simulator, Oct 23 2026; values in `uikit/` tagged
63
64
  `measured:`): M-S1, M-NB1, M-K2, M-CA1 (underdamped grid matched to the last
@@ -128,12 +129,13 @@ Subject "switch S": the first switch in Settings ▸ Accessibility ▸ Display &
128
129
  Text Size (Bold Text row); a minimal host app holds a UISwitch on a plain view
129
130
  where a switch outside any scroll view is needed.
130
131
 
131
- Captured (iOS 26.2 simulator, Oct 23 2026), with their values landing in the
132
- switch's own table: M-SW02, M-SW03, M-SW04, M-SW05, M-SW06, M-SW09 (UISwitch
133
- makes no haptic call), M-SW11 (Reduce Motion: the lift stays, the stretch
134
- goes), M-SW16 (iOS 26.2). Until that table lands they stay open here, and
135
- `springs.switchThumbMove` and `switchThumbStretch` keep WebKit's values.
136
- Partly: M-SW07 (a single tap only). Still open: M-SW17, and M-SW11's On/Off
132
+ Captured (iOS 26.2 simulator, Oct 23 2026), with their values in the
133
+ switch's own table (`uikit/switch.ts`): M-SW02, M-SW03, M-SW04, M-SW05,
134
+ M-SW06, M-SW09 (UISwitch makes no haptic call), M-SW11 (Reduce Motion: the
135
+ lift stays, the stretch goes), M-SW16 (iOS 26.2). `springs.switchThumbMove`
136
+ holds the measured travel the switch's table reads; WebKit's
137
+ `switchThumbStretch` is retired for the table's `lift`. Partly: M-SW07 (a single
138
+ tap only). Still open: M-SW17, and M-SW11's On/Off
137
139
  labels, Reduce Transparency and Bold Text.
138
140
 
139
141
  | ID | Scene | Gesture | Extract | Method |
@@ -217,6 +219,13 @@ Bookmarks sheet.
217
219
  | M-SG18 | iPad S1 (touch; pointer if available) | tap, hold, drag; hover | differences from iPhone | B |
218
220
  | M-SG19 | Safari showing the segmented stories vs S1 | the segmented storyboards side by side | synced recordings (parity proof) | B |
219
221
 
222
+ Done (UIKit lab, iOS 26.2 simulator, Oct 23–24 2026; in the segmented control's
223
+ own table, `uikit/segmented.ts`, tagged `measured:`): M-SG02 (the selection
224
+ spring and the drag clamp; the tracking spring is the shared
225
+ `springs.fingerTracking`; the lift was measured too and is not in the table,
226
+ since a pressed thumb's lift is a theme's) and M-SG03 (the tap's frames,
227
+ fitted per frame).
228
+
220
229
  ## Sheets (UISheetPresentationController)
221
230
 
222
231
  Probe app "SheetProbe" on an iPhone 16 Pro (iPad Pro 11" for M-SH11 / M-SH20 /
@@ -20,8 +20,10 @@ roles through `resolveMotion`.
20
20
  | `uikit/timing.ts` | Non-spring clocks and curves: press highlight, Core Animation's named curves, keyboard, Reduced Motion cross-fade. |
21
21
  | `uikit/paging.ts` | A paging UIScrollView: the integrator that settles a release on its page, the page rule, the catch, `setContentOffset(animated:)`. |
22
22
  | `uikit/navigation.ts` | UINavigationController: push velocity, parallax, dimming, transition clock, interactive pop finish rule. |
23
- | `uikit/progressBar.ts` | UIProgressView's fill: the whole-track duration and curve (two roles), its minimum length and empty alpha. |
23
+ | `uikit/progressBar.ts` | UIProgressView's fill: the whole-track duration and curve, its minimum length and empty alpha; the reduced-motion pulse (three roles). |
24
24
  | `uikit/gestures.ts` | Gesture recognizer thresholds, the velocity filter and haptic stand-ins, as `{value, unit}` entries (sources in JSDoc). |
25
+ | `uikit/segmented.ts` | UISegmentedControl: the selection indicator's spring; under Reduce Motion the animator's cross-fade replaces it. |
26
+ | `uikit/switch.ts` | UISwitch on iOS 26.2: geometry, the lift, settle, travel and tracking springs, the flip distance, the track colour. |
25
27
  | `roles.ts` | The internal motion roles: the springs, durations and curves `spec:AST-094` FR4 names, registered by the shared tables, and a role's CSS form read back. |
26
28
  | `roleValue.ts` | A role's CSS form, written: a spring's duration and bounce, a duration in ms, a curve's `cubic-bezier()`. |
27
29
  | `resolveMotion.ts` | A role's value: its table value, as the per-role tables stay internal (`spec:AST-094` DEC-15). |
@@ -6,7 +6,7 @@
6
6
  * paging constants
7
7
  * @output Exports `pagingSettleVelocity`, `solvePaging` (UIKit's paging settle
8
8
  * as a curve the animator plays) and `solveAnimatedPageScroll`
9
- * @position Pure math, with no DOM and no React
9
+ * @position Pure math, with no DOM and no React; hooks/usePager.ts reads it
10
10
  *
11
11
  * SYNC: When modified, update:
12
12
  * - /packages/core/src/motion/paging.test.ts
@@ -14,6 +14,7 @@
14
14
  */
15
15
 
16
16
  import type {MotionCurve} from './animator';
17
+ import {cubicBezier, type BezierPoints} from './bezier';
17
18
  import {paging} from './uikit/paging';
18
19
 
19
20
  /**
@@ -106,33 +107,55 @@ export function solvePaging({
106
107
  }
107
108
 
108
109
  /**
109
- * `setContentOffset(_:animated:)`: `paging.animatedScroll.duration` on a
110
- * sinusoidal ease-in-out, whatever the distance. UIKit starts it from the
111
- * current offset and drops any velocity, as here.
110
+ * `setContentOffset(_:animated:)`: `paging.animatedScroll.durationMs` on its
111
+ * curve, from the current offset, at any distance. The pager passes the
112
+ * duration and curve that `resolveMotion` gives, which are the measured values
113
+ * of the table.
114
+ *
115
+ * `velocity` (px/s) is the velocity of a move that this one retargets. The new
116
+ * curve starts at it and still ends on `to`, at rest and on time. A new target
117
+ * keeps the current velocity, where UIKit drops it. The carry is a Hermite
118
+ * term, v × duration × u(1 − u)², less the curve's own starting slope. So a
119
+ * move from rest is the curve itself.
112
120
  */
113
121
  export function solveAnimatedPageScroll({
114
122
  from,
115
123
  to,
124
+ durationMs = paging.animatedScroll.durationMs,
125
+ curve = paging.animatedScroll.curve,
126
+ velocity,
116
127
  }: {
117
128
  from: number;
118
129
  to: number;
130
+ durationMs?: number;
131
+ curve?: BezierPoints;
132
+ velocity?: number;
119
133
  }): MotionCurve {
120
- const {duration} = paging.animatedScroll;
134
+ const duration = durationMs / 1000;
121
135
  const distance = to - from;
136
+ const ease = cubicBezier(curve);
137
+ const progress = (u: number) => ease(Math.min(1, Math.max(0, u)));
138
+ // The carry, in px: the retargeted velocity over the whole duration, less
139
+ // what the curve's own starting slope already gives.
140
+ const startSlope = progress(1e-4) / 1e-4;
141
+ const carry =
142
+ velocity == null ? 0 : velocity * duration - distance * startSlope;
143
+ const at = (t: number) => {
144
+ const u = Math.min(1, Math.max(0, t / duration));
145
+ return from + distance * progress(u) + carry * u * (1 - u) * (1 - u);
146
+ };
122
147
  return {
123
148
  duration,
124
- at: t => {
125
- const u = Math.min(1, Math.max(0, t / duration));
126
- return from + (distance * (1 - Math.cos(Math.PI * u))) / 2;
127
- },
149
+ at,
128
150
  velocity: t => {
129
- if (t <= 0 || t >= duration) {
151
+ if (t <= 0) {
152
+ return velocity ?? 0;
153
+ }
154
+ if (t >= duration) {
130
155
  return 0;
131
156
  }
132
- return (
133
- ((distance * Math.PI) / (2 * duration)) *
134
- Math.sin((Math.PI * t) / duration)
135
- );
157
+ const h = Math.min(1e-4, t / 2, (duration - t) / 2);
158
+ return (at(t + h) - at(t - h)) / (2 * h);
136
159
  },
137
160
  };
138
161
  }
@@ -5,7 +5,8 @@
5
5
  * @input The motion tables (motion/uikit and each component's own table)
6
6
  * @output registerMotionTable, motionRoleOf, motionRoleIn, listMotionRoles,
7
7
  * motionRoleVariable, and the CSS form of a role's value
8
- * (formatMotionRoleValue, parseMotionRoleValue)
8
+ * (formatMotionRoleValue, parseMotionRoleValue), and parseCssEasing for a
9
+ * CSS transition's easing
9
10
  * @position Motion foundation, internal to core: read by the code that
10
11
  * resolves a role when a motion starts. No public API writes a role: touch
11
12
  * motion stays internal until the public motion-token set is decided.
@@ -260,3 +261,21 @@ export function parseMotionRoleValue(
260
261
  ? points
261
262
  : null;
262
263
  }
264
+
265
+ /** The CSS easing keywords, as the control points CSS gives them. */
266
+ const EASING_KEYWORDS: Readonly<Record<string, MotionCurvePoints>> = {
267
+ linear: [0, 0, 1, 1],
268
+ ease: [0.25, 0.1, 0.25, 1],
269
+ 'ease-in': [0.42, 0, 1, 1],
270
+ 'ease-out': [0, 0, 0.58, 1],
271
+ 'ease-in-out': [0.42, 0, 0.58, 1],
272
+ };
273
+
274
+ /**
275
+ * Reads a CSS easing, a keyword or a `cubic-bezier()`, as a curve role's value
276
+ * is read. Returns null for any other easing, such as `steps()`.
277
+ */
278
+ export function parseCssEasing(text: string): MotionCurvePoints | null {
279
+ const value = text.trim();
280
+ return EASING_KEYWORDS[value] ?? parseMotionRoleValue('curve', value);
281
+ }
@@ -4,9 +4,10 @@
4
4
  * @file index.ts
5
5
  * @input The domain files of the UIKit constants table
6
6
  * @output Re-exports `springs` and one constant per spring (`SHEET_PRESENT_SPRING`,
7
- * …), `scroll`, `timing`, `navigation`, `progressBar`, the `slider` domain
8
- * and the gesture thresholds (one `UIKIT_*` group per recognizer, their
9
- * union `UIKIT_GESTURES`, and the haptic tables)
7
+ * …), `scroll`, `timing`, `navigation`, `progressBar`, `segmentedControl`,
8
+ * the `slider` and switch (`switchControl`) domains, and the gesture
9
+ * thresholds (one `UIKIT_*` group per recognizer, their union
10
+ * `UIKIT_GESTURES`, and the haptic tables)
10
11
  * @position Entry of the UIKit constants table (motion/uikit). Internal to
11
12
  * core: not exported from the package entry point
12
13
  *
@@ -41,6 +42,7 @@ export {
41
42
  export {navigation, registerNavigationTable} from './navigation';
42
43
  export {progressBar, registerProgressBarTable} from './progressBar';
43
44
  export {registerScrollTable, scroll} from './scroll';
45
+ export {segmentedControl} from './segmented';
44
46
  export {slider} from './slider';
45
47
  export {
46
48
  ACTION_SHEET_DISMISS_SPRING,
@@ -63,7 +65,6 @@ export {
63
65
  NAVIGATION_POP_SPRING,
64
66
  NAVIGATION_PUSH_SPRING,
65
67
  QUICK_CHANGE_SPRING,
66
- SEGMENTED_THUMB_SPRING,
67
68
  SETTLE_SPRING,
68
69
  SHEET_DETENT_SPRING,
69
70
  SHEET_DISMISS_SPRING,
@@ -74,10 +75,10 @@ export {
74
75
  SUB_MENU_BACK_SPRING,
75
76
  SUB_MENU_OPEN_SPRING,
76
77
  SWITCH_THUMB_MOVE_SPRING,
77
- SWITCH_THUMB_STRETCH_SPRING,
78
78
  TIMED_CHANGE_SPRING,
79
79
  VIEW_CHANGE_SPRING,
80
80
  registerSpringsTable,
81
81
  springs,
82
82
  } from './springs';
83
+ export {switchControl} from './switch';
83
84
  export {registerTimingTable, timing} from './timing';
@@ -3,7 +3,8 @@
3
3
  /**
4
4
  * @file paging.ts
5
5
  * @input Nothing; data only
6
- * @output Exports `paging`, the measured constants of a paging UIScrollView
6
+ * @output Exports `paging`, the measured constants of a paging UIScrollView,
7
+ * and `registerPagingTable`, which registers them with the motion registry
7
8
  * @position The paging domain of the UIKit constants table (motion/uikit). Only
8
9
  * core reads it, so the `uikit` namespace does not re-export it
9
10
  *
@@ -12,6 +13,8 @@
12
13
  * - /packages/core/src/motion/paging.ts and paging.test.ts
13
14
  */
14
15
 
16
+ import {registerMotionTable} from '../roles';
17
+
15
18
  export const paging = {
16
19
  /**
17
20
  * After the lift, one model moves the content: the settle onto the chosen
@@ -70,7 +73,8 @@ export const paging = {
70
73
  release: {
71
74
  /**
72
75
  * Released slower than `advanceSpeed`, the scroll view settles on the page
73
- * nearest the content position: past half a page, the next one.
76
+ * nearest the content position: past half a page, the next one. The pager
77
+ * keeps the start page instead for a release that moves back toward it.
74
78
  * @source measured: UIKit lab, iOS 26.2 simulator, Oct 23 2026. In releases
75
79
  * at rest from page 1, content at 48.5 % of the page stays, and 57.5 %
76
80
  * goes to the next page. On a second 402 pt pager, 45 % stays and 55 %
@@ -121,9 +125,9 @@ export const paging = {
121
125
  */
122
126
  catchStopMs: 85,
123
127
  /**
124
- * A horizontal pager's pan begins only for a drag within atan(1 ÷ this) of
125
- * horizontal (26.6° for 2). A steeper drag goes to the vertical scroll around
126
- * it. Between 26.6° and 45°, neither moves.
128
+ * In a sheet, a horizontal pager's pan begins only for a drag within atan(1 ÷
129
+ * this) of horizontal (26.6° for 2). A steeper drag goes to the sheet.
130
+ * Between 26.6° and 45°, neither moves.
127
131
  * @source measured: UIKit lab, iOS 26.2 simulator, Oct 23 2026. A scroll
128
132
  * view's directional lock holds the major axis up to 25° and frees it from
129
133
  * 30°. An inline calendar pager in a sheet pages at 20° from horizontal. At
@@ -131,23 +135,36 @@ export const paging = {
131
135
  * the sheet.
132
136
  */
133
137
  panAxisRatio: 2,
138
+ /**
139
+ * Inside a vertical scroll view, exactly one of the pager and the scroll view
140
+ * takes a drag, decided once by its dominant axis. The pager takes it when
141
+ * |dx| ≥ this × |dy|, 45° and the tie included. The scroll view takes any
142
+ * other drag.
143
+ * @source measured: UIKit lab, iOS 26.2 simulator, Oct 24 2026. A 402 × 300
144
+ * paging view sits in a full-screen vertical scroll view, with 150 pt drags
145
+ * at 0–90°. The pager takes 0–45°, and the page takes 50–90°. At 35°, the
146
+ * outer view stays at 0 through 86 pt of vertical travel. The choice
147
+ * happens at 10–15 pt of travel.
148
+ */
149
+ nestedPanAxisRatio: 1,
134
150
  animatedScroll: {
135
151
  /**
136
- * `setContentOffset(_:animated:)` duration. It is the same for one page and
137
- * for five, as for a page control's tap.
152
+ * `setContentOffset(_:animated:)` duration in milliseconds. It is the same
153
+ * for one page and for five, as for a page control's tap.
138
154
  * @source measured: UIKit lab, iOS 26.2 simulator, Oct 23 2026.
139
155
  * `_contentOffsetAnimationDuration` reads 0.3, and five animated moves of
140
156
  * 1 to 5 pages each last 0.30 s.
141
157
  */
142
- duration: 0.3,
158
+ durationMs: 300,
143
159
  /**
144
160
  * Its curve is a sinusoidal ease-in-out: x = from + (to − from) · (1 − cos
145
- * πu) ÷ 2, for u = t ÷ duration.
161
+ * πu) ÷ 2, for u = t ÷ duration. This cubic bézier matches it to 0.02 % of
162
+ * the distance (0.09 pt over a 402 pt page).
146
163
  * @source measured: UIKit lab, iOS 26.2 simulator, Oct 23 2026. The five
147
164
  * moves fit the sinusoid to 0.14–0.51 pt RMS, and a 2010 pt move fits to
148
165
  * 0.20 pt. The curve easeInEaseOut (0.42, 0, 0.58, 1) misses by 7.7 pt.
149
166
  */
150
- curve: 'sineInOut',
167
+ curve: [0.364212, 0, 0.635788, 1],
151
168
  },
152
169
  /**
153
170
  * Past the first or last page, the content follows the finger through the
@@ -160,3 +177,17 @@ export const paging = {
160
177
  */
161
178
  rubberBandDimension: 'pageWidth',
162
179
  } as const;
180
+
181
+ /**
182
+ * Registers this table with the motion registry (motion/roles.ts). The pager
183
+ * then reads `setContentOffset(_:animated:)`'s duration and curve through
184
+ * `resolveMotion`, as it reads every touch motion. The table lists no role,
185
+ * because no motion role names any of its values, so each plays as measured.
186
+ * Nothing registers on import, and a second call does nothing.
187
+ */
188
+ export function registerPagingTable(): void {
189
+ registerMotionTable('paging', paging, {
190
+ // Who gets the touch, not how anything moves.
191
+ exclude: ['catchStopMs'],
192
+ });
193
+ }
@@ -4,11 +4,11 @@
4
4
  * @file progressBar.ts
5
5
  * @input Nothing: data only
6
6
  * @output Exports `progressBar` (UIProgressView's fill: the whole-track
7
- * duration and curve, its minimum length and its empty alpha) and
8
- * `registerProgressBarTable`
7
+ * duration and curve, its minimum length and its empty alpha; and the
8
+ * reduced-motion pulse) and `registerProgressBarTable`
9
9
  * @position ProgressBar's rows of the UIKit constants table (motion/uikit).
10
10
  * Lengths are in pt (CSS px), durations in ms, alphas in 0..1. Tests check
11
- * each leaf's `@source`.
11
+ * each leaf's `@source`, and each GUESS's `@measure`.
12
12
  *
13
13
  * SYNC: When modified, update
14
14
  * /packages/core/src/ProgressBar/ProgressBarTouch.ts and
@@ -18,10 +18,11 @@
18
18
  import {registerMotionTable} from '../roles';
19
19
 
20
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.
21
+ * UIProgressView's values, for ProgressBar. Three values are motion roles in
22
+ * the generated motion role table: the whole-track duration,
23
+ * `progress.fillTrackMs`, its curve, `progress.curves.fill`, and the
24
+ * reduced-motion pulse, `progress.reducedMotionPulseMs`. Every other value is
25
+ * an internal constant.
25
26
  */
26
27
  export const progressBar = {
27
28
  /**
@@ -43,6 +44,24 @@ export const progressBar = {
43
44
  */
44
45
  fill: [0, 0, 1, 1],
45
46
  },
47
+ /**
48
+ * Under reduced motion the indeterminate fill stops travelling and pulses
49
+ * its opacity in place. Each way takes this long, on the `timing.curves.move`
50
+ * curve. A busy loop, so tempo does not scale it.
51
+ * @source GUESS — An owner value, not a UIKit number. iOS Safari pulses its
52
+ * indeterminate bar for 1 s between 0.30 and 0.60 opacity. ProgressBar
53
+ * pulses slower, at a floor that keeps the bar visible.
54
+ * @measure M-PB1
55
+ */
56
+ reducedMotionPulseMs: 2000,
57
+ /**
58
+ * That pulse's lowest opacity. It is the lowest at which every tone that
59
+ * reaches 3:1 against the track at full opacity still does. That holds in
60
+ * the light and dark default themes.
61
+ * @source GUESS — An owner value, not a UIKit number.
62
+ * @measure M-PB1
63
+ */
64
+ reducedMotionPulseFloor: 0.84,
46
65
  progressView: {
47
66
  /**
48
67
  * The track's height in the `.default` style; the fill is as tall.
@@ -71,12 +90,13 @@ export const progressBar = {
71
90
  } as const;
72
91
 
73
92
  /**
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.
93
+ * Registers the table's three roles, for the generated motion role table and
94
+ * its test, which call it. Nothing at runtime reads the registry:
95
+ * `resolveMotion` returns the table value. Idempotent, and nothing runs on
96
+ * import.
77
97
  */
78
98
  export function registerProgressBarTable(): void {
79
99
  registerMotionTable('progress', progressBar, {
80
- roles: ['fillTrackMs', 'curves.fill'],
100
+ roles: ['fillTrackMs', 'curves.fill', 'reducedMotionPulseMs'],
81
101
  });
82
102
  }
@@ -0,0 +1,74 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file segmented.ts
5
+ * @input Nothing; data only
6
+ * @output Exports `segmentedControl`, UISegmentedControl's selection slide
7
+ * spring and its drag overshoot; and `registerSegmentedTable`, which
8
+ * registers the spring as an internal motion role
9
+ * @position The segmented-control domain of the UIKit constants table
10
+ * (motion/uikit); read by SegmentedControl's touch presentation
11
+ *
12
+ * SYNC: When modified, update:
13
+ * - /packages/core/src/SegmentedControl/useSegmentedSelectionMotion.ts
14
+ * - /packages/core/src/motion/README.md (domain list)
15
+ */
16
+
17
+ import {registerMotionTable} from '../roles';
18
+
19
+ /**
20
+ * UIKit's own UISegmentedControl, measured with three text segments in a
21
+ * 300 × 31 pt control. A tap and a programmatic change follow the same
22
+ * spring. Every leaf carries a `@source`, and uikit.test.ts checks it.
23
+ *
24
+ * Some UIKit motion is left out on purpose. UIKit cross-fades the two titles
25
+ * that change, over 0.2 s. Astryx switches them at once, because a
26
+ * cross-fade needs a second copy of each title. Under Reduce Motion, UIKit's
27
+ * lens fades in at the new segment and scales from 0.88. Astryx allows no
28
+ * scaling there, so the animator's Reduce Motion cross-fade replaces it.
29
+ * UIKit's lens also lifts and stretches under a finger. A theme role owns
30
+ * the lift, and the stretch is not modeled. The lens chases a dragging
31
+ * finger on the shared `springs.fingerTracking` role, which matches the
32
+ * values UIKit reports for this control.
33
+ */
34
+ export const segmentedControl = {
35
+ /**
36
+ * The selection indicator's slide from the old segment to the new one,
37
+ * after a tap or a programmatic change. Its response is 0.40 s and its
38
+ * damping ratio 0.85. That gives about 1.25 pt of overshoot on a 200 pt
39
+ * move, settled by about 0.6 s. The width follows the same spring when the
40
+ * segments differ in width.
41
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
42
+ * iPhone 17 Pro, UIViewSpringAnimationBehavior read on the lens position
43
+ * for a tap and a programmatic set (dampingRatio 0.85, response 0.40,
44
+ * tracking off), Oct 23 2026
45
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
46
+ * iPhone 17 Pro, per-frame log of the lens's presentation position and
47
+ * velocity (method C) for a tap, a programmatic set and an animated set,
48
+ * least-squares spring fit (response 0.395 / 0.405 / 0.400 s, damping
49
+ * ratio 0.855 / 0.845 / 0.850, rms at most 0.65 pt over 200 pt),
50
+ * Oct 23 2026
51
+ */
52
+ selectionSpring: {response: 0.4, dampingRatio: 0.85},
53
+ /**
54
+ * How far past the first or last segment's center the lens follows a
55
+ * dragging finger, in pt. Beyond that, the lens stays put while the finger
56
+ * goes on.
57
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
58
+ * iPhone 17 Pro, a drag 60 pt past the last segment: the lens stops about
59
+ * 11 pt past its center (312 vs 301), Oct 23 2026
60
+ */
61
+ dragOvershoot: 11,
62
+ } as const;
63
+
64
+ /**
65
+ * Registers this table with the motion registry (motion/roles.ts). The
66
+ * slide's spring becomes an internal motion role. The drag overshoot is not
67
+ * motion, so it stays an internal constant. Nothing registers on import, and
68
+ * a second call does nothing.
69
+ */
70
+ export function registerSegmentedTable(): void {
71
+ registerMotionTable('segmented', segmentedControl, {
72
+ roles: ['selectionSpring'],
73
+ });
74
+ }