Skip to content

Commit 2e77071

Browse files
committed
Merge meta#8309 (meta#8076: main's meta#8663 rows in motion/README.md) into meta#8315
2 parents 9486526 + 58dbb1a commit 2e77071

69 files changed

Lines changed: 5755 additions & 456 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/action-group-tracker.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+
[internal] One tracker for a held finger across a group of targets (an alert's or an action sheet's actions, a menu's rows, a segmented control's segments, a page control's dots): it reads the targets' rects once, resolves the finger against them (or by the owner's rule), paints or reports the highlight, and runs the target through its own click at the lift. Nothing a consumer sees changes.
6+
7+
@vjeux
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[fix] ChatComposerInput keeps focus and its Tab stop when disabled instead of moving focus to the page. Disabled editors block editing, paste/drop, trigger selection, imperative mutations, and submission while retaining their draft and accessible description.
6+
@korkt-kim

‎.changeset/core-hit-area.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 shared touch hit-area utility (utils/hitArea.ts) that grows a target toward 44 px under a coarse pointer and stops at half the gap to each neighbour, so a tap goes to the nearer target. Not exported.
6+
7+
@cixzhang
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+
[fix] Popover: an open popover no longer pulls in a Tab pressed elsewhere on the page. Keyboard users can move through the rest of the page in order while a popover is open, for example a list next to a non-modal comment popover. Focus inside the popover still cycles with Tab and Shift+Tab, and Escape still closes it and returns focus to its trigger. `useFocusTrap` applies the same rule: it holds focus that is inside its container and leaves Tabs that start outside to the page. This meets `component:Popover` DEC-9. Fixes #7687.
6+
7+
@cixzhang

‎.changeset/resolve-snap-point.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: the motion foundation has one release policy, `motion/resolveSnapPoint.ts` (where a release lands: a flick goes at least to the next snap point, a release moving back toward its start cancels to it), on the `selectSnapPoint` primitive; paging moves to `motion/selectPage.ts` on top of it. No behavior change.
6+
7+
@cixzhang
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+
[fix] SideNav: a collapsed rail item's tooltip now binds to the link or button itself rather than the row around it, so the focusable control is the WAI-ARIA tooltip pattern's trigger and is described by the tooltip (`aria-describedby`) from its first render. Keyboard focus on it now shows the label. As with other link and button tooltips, a touch tap activates the control without opening the tooltip. A disabled item still shows its label on hover.
6+
7+
@ernestt @thewebartisan7

‎.changeset/touch-support.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] Adds an internal entry, reserved for Astryx's own packages, through which Lab components reach the gesture core that Core components import directly. No component uses it yet, and apps import nothing new.
6+
7+
@vjeux

‎apps/sandbox/src/app/(sandbox)/pages/motion-lab/LabDemos.tsx‎

Lines changed: 107 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {Badge} from '@astryxdesign/core/Badge';
3434
import {Button} from '@astryxdesign/core/Button';
3535
import {Card} from '@astryxdesign/core/Card';
3636
import {CheckboxInput} from '@astryxdesign/core/CheckboxInput';
37+
import {ProgressBar} from '@astryxdesign/core/ProgressBar';
3738
import {Tab, TabList} from '@astryxdesign/core/TabList';
3839
// A swizzled copy of core's TabList carrying the proposed travelling indicator.
3940
import {
@@ -43,6 +44,7 @@ import {
4344
import {Skeleton} from '@astryxdesign/core/Skeleton';
4445
import {SideNav, SideNavItem, SideNavSection} from '@astryxdesign/core/SideNav';
4546
import {Token} from '@astryxdesign/core/Token';
47+
import {themeProps} from '@astryxdesign/core/utils';
4648
import {HStack, VStack} from '@astryxdesign/core/Layout';
4749
import {Text} from '@astryxdesign/core/Text';
4850
import {useMotionLab} from './MotionLabStore';
@@ -937,6 +939,61 @@ export function OriginRig({kind}: {kind: 'zero' | 'centre' | 'anchored'}) {
937939
);
938940
}
939941

942+
// --- progress fill -----------------------------------------------------------
943+
944+
/** The values a fast upload might report, one per tick. */
945+
const FILL_STEPS = [12, 58, 34, 86] as const;
946+
947+
/**
948+
* The determinate fill on a data change. Before is the real ProgressBar,
949+
* which transitions `width` (a layout property, every frame of every tick).
950+
* After is a sandbox copy of its track and fill that moves the same fill with
951+
* `transform: scaleX()` on the same token and curve, so only the technique
952+
* differs. It carries ProgressBar's theming targets (root, track and fill),
953+
* so the theme paints it as it paints the real bar.
954+
*/
955+
export function ProgressFillRig({mode}: {mode: Mode}) {
956+
const [step, setStep] = useState(0);
957+
useLoop(() => setStep(current => (current + 1) % FILL_STEPS.length), 1600);
958+
const value = FILL_STEPS[step];
959+
960+
return (
961+
<VStack gap={2} {...stylex.props(sx.full)}>
962+
{mode === 'before' ? (
963+
<ProgressBar label="Uploading" value={value} hasValueLabel />
964+
) : (
965+
<div {...themeProps('progress-bar', {variant: 'accent'})}>
966+
<VStack gap={1}>
967+
<HStack gap={2} hAlign="between">
968+
<Text>Uploading</Text>
969+
<Text color="secondary">{value}%</Text>
970+
</HStack>
971+
<div
972+
{...themeProps('progress-bar-track')}
973+
className={`astryx-progress-bar-track ${styles.fillTrack}`}
974+
role="progressbar"
975+
aria-label="Uploading"
976+
aria-valuemin={0}
977+
aria-valuemax={100}
978+
aria-valuenow={value}>
979+
<div
980+
{...themeProps('progress-bar-fill', {variant: 'accent'})}
981+
className={`astryx-progress-bar-fill ${styles.fillScale}`}
982+
style={{transform: `scaleX(${value / 100})`}}
983+
/>
984+
</div>
985+
</VStack>
986+
</div>
987+
)}
988+
<Hint>
989+
{mode === 'before'
990+
? 'Width is a layout property: every frame of every tick re-lays out the bar. A fast upload ticks often enough to behave like a layout loop.'
991+
: 'The same fill on transform: scaleX, so it runs on the compositor. The cost shows at the ends: the rounded caps squash at small values, which is why this needs an exception or a different structure before it ships.'}
992+
</Hint>
993+
</VStack>
994+
);
995+
}
996+
940997
// --- loops -------------------------------------------------------------------
941998

942999
export function LoopRig({policy}: {policy: 'today' | 'delete' | 'degrade'}) {
@@ -986,28 +1043,60 @@ export function LoopRig({policy}: {policy: 'today' | 'delete' | 'degrade'}) {
9861043

9871044
// --- table tint (the 150ms rows) ---------------------------------------------
9881045

989-
export function TintRig({mode}: {mode: Mode}) {
1046+
const TINT_ROWS = [
1047+
['Quarterly report', 'Draft', '2 min ago'],
1048+
['Design review', 'Scheduled', '1 h ago'],
1049+
['Launch checklist', 'In progress', '3 h ago'],
1050+
['Onboarding flow', 'Shipped', 'Yesterday'],
1051+
['Pricing page', 'Draft', 'Yesterday'],
1052+
['Support macros', 'In review', '2 days ago'],
1053+
['Search ranking', 'Blocked', '3 days ago'],
1054+
['Release notes', 'Shipped', 'Last week'],
1055+
];
1056+
1057+
/**
1058+
* Table rows' hover tint, over enough rows that sweeping the pointer down the
1059+
* table shows what the duration costs. `before` is Table today (a hardcoded
1060+
* 150ms on the CSS default curve); `after` reads the state token and changes at
1061+
* once under Reduce Motion (design:reduced-motion DR3); `none` deletes the
1062+
* transition, which is the option the rubric asks the preview to make visible.
1063+
*/
1064+
export function TintRig({mode}: {mode: Mode | 'none'}) {
1065+
const rowClass =
1066+
mode === 'none'
1067+
? `${styles.tintRow} ${styles.tintRowNone}`
1068+
: mode === 'after'
1069+
? `${styles.tintRow} ${styles.tintRowToken}`
1070+
: styles.tintRow;
9901071
return (
9911072
<VStack gap={1} {...stylex.props(sx.full)}>
992-
{['Row one', 'Row two', 'Row three'].map(row => (
993-
<div
994-
key={row}
995-
className={styles.tintRow}
996-
style={
997-
mode === 'after'
998-
? {
999-
['--tint-duration' as string]: 'var(--lab-duration-state)',
1000-
['--tint-ease' as string]: 'var(--ease-state)',
1001-
}
1002-
: undefined
1003-
}>
1004-
<Text type="supporting">{row}</Text>
1005-
</div>
1006-
))}
1073+
<table className={styles.tintTable}>
1074+
<tbody>
1075+
{TINT_ROWS.map(([name, status, updated]) => (
1076+
<tr key={name} className={rowClass}>
1077+
<td>
1078+
<Text type="supporting">{name}</Text>
1079+
</td>
1080+
<td>
1081+
<Text type="supporting" color="secondary">
1082+
{status}
1083+
</Text>
1084+
</td>
1085+
<td>
1086+
<Text type="supporting" color="secondary">
1087+
{updated}
1088+
</Text>
1089+
</td>
1090+
</tr>
1091+
))}
1092+
</tbody>
1093+
</table>
10071094
<Hint>
10081095
{mode === 'before'
1009-
? 'Hardcoded 150ms with the CSS default curve.'
1010-
: 'The state token, at 175ms with --ease-state.'}
1096+
? 'Hardcoded 150ms with the CSS default curve. A literal: no token, rail switch or device setting reaches it, so it fades the same everywhere.'
1097+
: mode === 'after'
1098+
? 'The state token with --ease-state. When the device asks for reduced motion, the tint changes at once on every rail setting (design:reduced-motion DR3): the colour still says which row is under the pointer.'
1099+
: "No transition at all: the tint is immediate, whatever the rail or the device's reduced-motion setting. Sweep the pointer down the table and compare it with the fades."}
10111100
</Hint>
10121101
</VStack>
10131102
);

‎apps/sandbox/src/app/(sandbox)/pages/motion-lab/MotionControlRail.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function MotionControlRail() {
7474

7575
return (
7676
<HStack gap={3} vAlign="center" wrap="wrap" {...stylex.props(sx.rail)}>
77-
<HStack gap={1.5} vAlign="center">
77+
<HStack gap={1.5} vAlign="center" wrap="wrap">
7878
<Text type="supporting" color="secondary">
7979
Speed
8080
</Text>

‎apps/sandbox/src/app/(sandbox)/pages/motion-lab/MotionLab.module.css‎

Lines changed: 90 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,20 +736,104 @@
736736
}
737737
}
738738

739+
/* ------------------------------------------------------- progress fill ---- */
740+
741+
/* A copy of ProgressBar's track and fill (8px, muted track, accent fill, full
742+
radius) whose fill moves with transform instead of width, on the same token
743+
and curve core uses, so the pair differs only in technique. */
744+
.fillTrack {
745+
position: relative;
746+
height: 8px;
747+
border-radius: var(--radius-full);
748+
overflow: hidden;
749+
}
750+
751+
.fillScale {
752+
position: absolute;
753+
inset: 0;
754+
border-radius: inherit;
755+
transform-origin: left center;
756+
transition: transform var(--duration-medium) var(--ease-standard);
757+
}
758+
759+
/* Core's own paint, in Core's layer, so a theme's rule for the
760+
ProgressBar targets (the copy carries their classes) wins as it does on
761+
the real bar. */
762+
@layer astryx-base {
763+
.fillTrack {
764+
background: var(--color-background-muted);
765+
}
766+
767+
.fillScale {
768+
background: var(--color-accent);
769+
}
770+
}
771+
772+
[dir='rtl'] .fillScale {
773+
transform-origin: right center;
774+
}
775+
776+
/* Forced colours paint the track and fill as Canvas: Core's fill keeps its
777+
shape with a CanvasText outline, and so does the copy. */
778+
@media (forced-colors: active) {
779+
.fillScale {
780+
outline: 1px solid CanvasText;
781+
outline-offset: -1px;
782+
}
783+
}
784+
739785
/* ---------------------------------------------------------------- tint ---- */
740786

741787
/* The Table hover tint, at whatever duration and curve is being argued over.
742788
Rows 1-9 of the violation table are this, and the honest finding is that
743-
150ms and 175ms are near-indistinguishable at 1x. */
789+
150ms and 175ms are near-indistinguishable at 1x, which is why the preview
790+
also shows the tint with no transition at all. */
791+
.tintTable {
792+
width: 100%;
793+
/* Three panes share a narrow window: the columns shrink to the pane. */
794+
table-layout: fixed;
795+
border-collapse: separate;
796+
border-spacing: 0;
797+
}
798+
799+
.tintTable td {
800+
padding: var(--space-2, 6px) var(--space-3, 10px);
801+
border-bottom: 1px solid var(--color-border);
802+
overflow-wrap: anywhere;
803+
}
804+
805+
/* Also the "real rule" rows on the Bugs page, which are divs: the padding
806+
and radius are theirs (a table row ignores both). */
744807
.tintRow {
745808
padding: var(--space-2, 6px) var(--space-3, 10px);
746809
border-radius: var(--radius-sm, 6px);
747810
transition: background-color var(--tint-duration, 150ms)
748811
var(--tint-ease, ease);
749812
}
750813

814+
/* The hover overlay token Astryx ships (the rig used to read two names no
815+
theme defines, so the tint never showed). */
751816
.tintRow:hover {
752-
background: var(--color-background-hover, var(--color-background-elevated));
817+
background-color: var(--color-overlay-hover);
818+
}
819+
820+
/* The state token, as Table would read it. */
821+
.tintRowToken {
822+
transition: background-color var(--lab-duration-state) var(--ease-state);
823+
}
824+
825+
/* Reduce Motion: the tint is a change of state, so with a fine pointer it
826+
lands at once (design:reduced-motion DR3), and an instant change is also
827+
within DR2's "200 ms or less" on touch. */
828+
@media (prefers-reduced-motion: reduce) {
829+
.tintRowToken {
830+
transition: none;
831+
}
832+
}
833+
834+
/* Deleting the transition, the option the preview makes visible. */
835+
.tintRowNone {
836+
transition: none;
753837
}
754838

755839
/* NavItem's hover tint (NavTintRig). Before: as shipped, it snaps on where
@@ -783,8 +867,11 @@
783867
transition-property: background-color;
784868
}
785869

870+
/* The hover overlay token Astryx ships: the rule used to read two names no
871+
theme defines, so the row never tinted and the pane showed nothing to
872+
compare. */
786873
.noopRow:hover {
787-
background: var(--color-background-hover, var(--color-background-elevated));
874+
background-color: var(--color-overlay-hover);
788875
}
789876

790877
/* ------------------------------------------------------------- origin ----- */

0 commit comments

Comments
 (0)