Skip to content

Commit b366394

Browse files
committed
chore(core): a pager that pages like a UIKit paging scroll view
1 parent 7a881c4 commit b366394

12 files changed

Lines changed: 2593 additions & 29 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/cli': patch
3+
---
4+
5+
[docs] The motion role table drops `scroll.paging.snap` and lists the paging roles a theme can retune: `paging.settle`, `paging.animatedScroll.durationMs` and `paging.animatedScroll.curve`.
6+
7+
@vjeux

‎.changeset/uikit-pager.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[chore] Internal: a pager for touch presentations that pages like a UIKit paging scroll view. A horizontal pan moves the pages one to one and rubber-bands at the ends. The release picks the page with UIKit's rule and settles on UIKit's paging curve on the compositor, and a finger can catch it mid-flight. Its settle spring and `setContentOffset`'s duration and curve are motion roles (`paging.settle`, `paging.animatedScroll.durationMs`, `paging.animatedScroll.curve`) that a theme can retune. Not exported from the package entry point; no component uses it yet.
6+
7+
@vjeux

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,25 @@ const calmTheme = defineTheme({
190190
'duration',
191191
'350ms',
192192
],
193-
['scroll.bounce', '--motion-scroll-bounce', 'spring', '0.5s 0'],
194193
[
195-
'scroll.paging.snap',
196-
'--motion-scroll-paging-snap',
194+
'paging.animatedScroll.curve',
195+
'--motion-paging-animated-scroll-curve',
196+
'curve',
197+
'cubic-bezier(0.364212, 0, 0.635788, 1)',
198+
],
199+
[
200+
'paging.animatedScroll.durationMs',
201+
'--motion-paging-animated-scroll-duration-ms',
202+
'duration',
203+
'300ms',
204+
],
205+
[
206+
'paging.settle',
207+
'--motion-paging-settle',
197208
'spring',
198-
'0.5s 0',
209+
'0.3723s 0.1225',
199210
],
211+
['scroll.bounce', '--motion-scroll-bounce', 'spring', '0.5s 0'],
200212
[
201213
'springs.actionSheetDismiss',
202214
'--motion-springs-action-sheet-dismiss',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"touch-motion",
202202
"best-practices"
203203
],
204-
"skeleton": "a86303e70a6cb63931e8e29c3b470b94f8edcc0b15576a907680a376213faddc",
204+
"skeleton": "98c9196254cdf2ebb6fb700b0395137fd5d1128e0ebc41c257c577e8cf6c0ee8",
205205
"mentions": []
206206
},
207207
"principles": {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) Meta Platforms, Inc. and affiliates.
2+
3+
/**
4+
* @file pagerBundle.ts
5+
* @input The pager and the paging math
6+
* @output The surface the pager's browser proofs bundle onto their fixture
7+
* page (esbuild, IIFE global `Pager`)
8+
* @position Test-only entry of usePager.interaction.browser.spec.ts
9+
*/
10+
11+
export {createPager} from '../usePager';
12+
export {
13+
pagingReleaseVelocity,
14+
selectPage,
15+
solveAnimatedPageScroll,
16+
solvePaging,
17+
} from '../../motion/paging';
18+
export {rubberBand} from '../../motion/rubberBand';
19+
export {paging} from '../../motion/uikit/paging';
20+
export {VelocityTracker} from '../../gestures/VelocityTracker';

0 commit comments

Comments
 (0)