theme/motion-values
import { … } from 'zidane-ui'ui/src/theme/motion-values.ts
Constants#
MENU_FADE_RATIOConstant#
A menu's enter opacity lands ahead of its scale: ~100ms of the 140ms menu.
const MENU_FADE_RATIO = 0.7MOTION_NAMESConstant#
Every MotionName, in the order of MOTIONS.
const MOTION_NAMES: MotionName[]MOTIONSConstant#
The curve of every MotionName: its spring (when it has one), tween duration in
seconds and easing.
const MOTIONS: Readonly<Record<MotionName, MotionSpec>>Interfaces#
MotionSpecInterface#
The curve of one MotionName.
interface MotionSpecProperties
| Name | Type | Description |
|---|---|---|
| duration | number | Tween (the twin, or the only curve): seconds + cubic-bezier. |
| ease | readonly [number, number, number, number] | The tween's easing, as cubic-bezier control points. |
| fade? | boolean | Opacity / colour: kept (briefly) under reduced motion; movement drops to 0. |
| reduced? | number | Reduced motion keeps it as an opacity-only tween of this many seconds (the menus). |
| spring? | { bounce: number; visualDuration: number } | Spring: perceived duration in seconds and bounce (0 = critically damped). Absent: never springs. |
Types#
MotionNameType#
Name of a motion in the design system's vocabulary. snap, pop, panel, slide and
settle are movement that springs; exit is a fast straight exit; fade and fade-out are
the opacity curves for entering and leaving; menu and menu-exit are the menu tweens.
type MotionName =
| 'snap'
| 'pop'
| 'panel'
| 'slide'
| 'settle'
| 'reorder'
| 'exit'
| 'fade'
| 'fade-out'
| 'menu'
| 'menu-exit'