Motion quality: shared tokens, reduced motion, dock and CTA fixes#25
Merged
Conversation
- lib/ease.ts becomes the single source for easing curves and spring presets (press, swap, layout, mouse-follow); --ease-out in globals.css synced to the dominant 0.16,1,0.3,1 curve - StatefulButton and MagneticButton now compose Button from base.tsx instead of carrying inline copies; registry source graph bundles imports automatically so installs stay self-contained - MagneticButton composes the Magnetic wrapper
- useReducedMotion now covers switch, tabs, dock, tilt-card, magnetic, command palette, animated number, number ticker, shared layout bg, stateful button and the swap action button; CSS media query alone cannot stop JS spring transforms - decorative cursor-follow effects (magnetic, tilt, dock magnification) skip touch devices via useHoverCapable to avoid sticky phantom hover - every inline cubic-bezier replaced with shared EASE_OUT token; swap constants re-export from lib/ease; previews, hero and docs migrated - modal, bottom sheet and token picker share SPRING_PANEL; dock pill and hover pills share SPRING_LAYOUT
The cloneElement injection guarded on '__dock' in child props, which is never true for JSX-created children, so every DockItem fell back to static defaults (44px, no magnification, Dock size/spring props ignored). Replace the prop-injection hack with React context. DockItem is also polymorphic now: onClick renders a real <button> with focus ring and aria-pressed; without onClick it stays a div wrapper so items that carry their own link or button keep valid HTML. Focus bubbles to the wrapper, so keyboard focus magnifies items the same way hover does.
Drop the cursor-proximity magnification machinery (mouse tracking, per-item springs, magnification/distance/spring props). Items render at a fixed size; the gliding active pill and button/div polymorphism stay.
Nav and hero CTAs used the CSS .press utility (120ms symmetric ease-out) which reads flat next to the spring-pressed buttons in the motion guide. New PressLink wraps next/link with the same SPRING_PRESS whileTap/ whileHover as the library Button, reduced-motion and touch aware.
button-base, button-stateful and button-magnetic get their own install slugs like the action-swap variants. The registry import graph bundles base.tsx and the magnetic wrapper into the variants that need them, so each command installs a complete working component.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Polish pass across the motion library and site. Goal: one cohesive motion language, production-ready accessibility, buttery press feel everywhere.
Motion tokens
Reduced motion and touch
Button family
Dock
Site CTAs
Accessibility
Docs
Verification