@alea-design/motion 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,211 @@
1
+ import { type CSSProperties, type ElementType, type PointerEvent as ReactPointerEvent, type ReactElement, type ReactNode } from 'react';
2
+ /** The enter/exit presets. Each maps to the keyframes alea-m-<preset>-in and -out in motion.css. */
3
+ export type MotionPreset = 'fade' | 'scale' | 'pop' | 'rise' | 'drop' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'blur' | 'zoom' | 'flip' | 'morph' | 'none';
4
+ /** The easing tokens, or any CSS easing. */
5
+ export type MotionEasing = 'out' | 'in' | 'in-out' | 'standard' | 'emphasized' | 'spring' | (string & {});
6
+ export interface MotionOptions {
7
+ /** How it comes in. */
8
+ enter?: MotionPreset;
9
+ /** How it goes out. Default: the same preset as enter. */
10
+ exit?: MotionPreset;
11
+ /** Enter duration in ms. */
12
+ duration?: number;
13
+ /** Exit duration in ms. Default 60% of duration. */
14
+ exitDuration?: number;
15
+ easing?: MotionEasing;
16
+ /** Delay before entering, in ms. */
17
+ delay?: number;
18
+ }
19
+ /** What a component's motion prop takes: a preset name, false for none, or options. Leave it out for the component's default. */
20
+ export type MotionProp = MotionPreset | false | MotionOptions;
21
+ /** The inline style for a motion prop: sets --alea-enter, --alea-exit and their timing on that one element (they don't inherit). */
22
+ export declare function motionStyle(motion: MotionProp | undefined): CSSProperties | undefined;
23
+ /** Merges a motion prop into a style prop (style props that are functions of the state are wrapped). */
24
+ export declare function withMotionStyle<S>(style: S, motion: MotionProp | undefined): S;
25
+ /** Components whose default motion can be changed for the whole app. */
26
+ export type MotionComponent = 'popover' | 'select' | 'menu' | 'tooltip' | 'dialog' | 'drawer' | 'toast' | 'command' | 'hovercard' | 'datepicker' | 'tour';
27
+ export declare const MOTION_SELECTORS: Record<MotionComponent, string>;
28
+ export interface MotionConfig {
29
+ /** expressive (default), productive (shorter and quieter, for dense apps), reduced (fades only) or off (no animation). */
30
+ mode?: 'expressive' | 'productive' | 'reduced' | 'off';
31
+ /** Follow the OS reduced motion setting (system, default), always reduce, or never (only when you offer your own switch). */
32
+ reduced?: 'system' | 'always' | 'never';
33
+ /** Multiplies every duration: 0.8 is snappier, 1.2 calmer. */
34
+ speed?: number;
35
+ /** Multiplies distances, scales and blur: 0 is fades only, 1 the default, 1.5 bolder. */
36
+ intensity?: number;
37
+ /** The default motion per component type, for the whole app. */
38
+ components?: Partial<Record<MotionComponent, MotionProp>>;
39
+ }
40
+ /** The token overrides for speed and intensity (set them on the root or a wrapper). */
41
+ export declare function motionVariables(c?: MotionConfig): Record<string, string>;
42
+ /** The attributes for a root: data-alea-motion and data-alea-reduced. */
43
+ export declare function motionAttributes(c?: MotionConfig): Record<string, string>;
44
+ /** CSS for per-component defaults, scoped under a selector (":root" for the page). */
45
+ export declare function motionComponentCss(components?: MotionConfig['components'], scope?: string): string;
46
+ /** True when motion should be reduced: the OS setting, or data-alea-motion / data-alea-reduced on <html>. */
47
+ export declare function useReducedMotion(): boolean;
48
+ /** Whether an element is on screen (IntersectionObserver). With once, it stays true after the first time. */
49
+ export declare function useInView<T extends Element>(options?: {
50
+ once?: boolean;
51
+ margin?: string;
52
+ threshold?: number;
53
+ }): readonly [import("react").RefObject<T | null>, boolean];
54
+ /** Marks the element data-alea-offscreen while it is out of view, which pauses every animation inside it (motion.css). One IntersectionObserver is shared by all. Returns the cleanup. */
55
+ export declare function pauseWhenOffscreen(el: Element): () => void;
56
+ /** A ref for a looping decoration (an aurora, a marquee, meteors, orbs): its animations pause while it is off screen and resume when it comes back. */
57
+ export declare function useOffscreenPause<T extends Element = HTMLElement>(): import("react").RefObject<T | null>;
58
+ /** 'up' or 'down' as the page scrolls (after a small threshold), for headers that hide on scroll. */
59
+ export declare function useScrollDirection(threshold?: number): 'up' | 'down';
60
+ /** Ripple: spread the returned props on any element; a ripple grows from the pointer on press. */
61
+ export declare function useRipple<T extends HTMLElement>(): {
62
+ onPointerDown: (e: ReactPointerEvent<T>) => void;
63
+ className: string;
64
+ };
65
+ /** Runs a DOM update inside a view transition when the browser has them (the route pattern). */
66
+ export declare function startViewTransition(update: () => void | Promise<void>): void;
67
+ type AsProps = {
68
+ as?: ElementType;
69
+ className?: string;
70
+ style?: CSSProperties;
71
+ children?: ReactNode;
72
+ [key: string]: unknown;
73
+ };
74
+ /** Content that enters when it scrolls into view (once). Without JavaScript it is simply shown. */
75
+ export declare function Reveal({ as, motion, delay, once, stagger, className, style, children, ...rest }: AsProps & {
76
+ /** The enter preset. Default rise. */
77
+ motion?: MotionPreset | MotionOptions;
78
+ /** Delay in ms. */
79
+ delay?: number;
80
+ /** Plays only the first time it enters the view. Default true. */
81
+ once?: boolean;
82
+ /** Children enter one after another instead of the whole block. */
83
+ stagger?: boolean;
84
+ }): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
85
+ /** Keeps a child mounted while it plays its exit (the dissolve preset by default), then unmounts it. */
86
+ export declare function Presence({ show, exitClassName, children }: {
87
+ show: boolean; /** The class that plays the exit. Default alea-dissolve-out. */
88
+ exitClassName?: string;
89
+ children: ReactElement<{
90
+ className?: string;
91
+ ref?: unknown;
92
+ }>;
93
+ }): ReactElement<{
94
+ className?: string;
95
+ ref?: unknown;
96
+ }, string | import("react").JSXElementConstructor<any>> | null;
97
+ /** Text or an icon that changes with a short blur crossfade (the swap pattern). Give it a key-able value. */
98
+ export declare function TextSwap({ children, as, className, direction, variant }: {
99
+ children: ReactNode;
100
+ as?: ElementType;
101
+ className?: string; /** Which way the new text enters. Default up. */
102
+ direction?: 'up' | 'down'; /** blur (text) or scale (icons). */
103
+ variant?: 'blur' | 'scale';
104
+ }): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
105
+ /** A number whose digits roll to the new value (the roll pattern). Screen readers get the formatted value once. */
106
+ export declare function NumberRoll({ value, format, locale, className }: {
107
+ value: number; /** Intl.NumberFormat options: currency, percent, compact. */
108
+ format?: Intl.NumberFormatOptions; /** A BCP 47 locale. Default the browser's. */
109
+ locale?: string;
110
+ className?: string;
111
+ }): import("react").JSX.Element;
112
+ /** Animates its height when its content changes size (the resize pattern). */
113
+ export declare function AutoHeight({ children, className, as }: {
114
+ children: ReactNode;
115
+ className?: string;
116
+ as?: ElementType;
117
+ }): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
118
+ /** A thin bar at the top that fills as the page scrolls (CSS scroll timeline where supported). */
119
+ export declare function ScrollProgress({ className }: {
120
+ className?: string;
121
+ }): import("react").JSX.Element;
122
+ /** Text that arrives in chunks (AI answers): new chunks fade in, a caret shows while streaming. */
123
+ export declare function StreamingText({ chunks, streaming, className, as }: {
124
+ chunks: string[]; /** Shows a caret while more is coming. */
125
+ streaming?: boolean;
126
+ className?: string;
127
+ as?: ElementType;
128
+ }): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
129
+ export interface MorphProps {
130
+ /** Elements with the same id morph into each other: when one replaces the other, the new one grows from the old one's box. */
131
+ id: string;
132
+ /** The element to render. Default div. */
133
+ as?: ElementType;
134
+ /** Duration in ms. Default the slow motion token (480). */
135
+ duration?: number;
136
+ /** Easing. Default a strong deceleration with no overshoot. */
137
+ easing?: string;
138
+ /** Fades the content in after the box has moved (default true), so text never looks stretched. */
139
+ fadeContent?: boolean;
140
+ className?: string;
141
+ style?: CSSProperties;
142
+ children?: ReactNode;
143
+ [key: string]: unknown;
144
+ }
145
+ /** A shared element: give two elements the same id and, when one replaces the other (a card that opens into its detail, a button that becomes a panel), the new one morphs from the old one's position, size and corners. Works without View Transitions; respects reduced motion. */
146
+ export declare function Morph({ id, as, duration, easing, fadeContent, className, style, children, ...rest }: MorphProps): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
147
+ /** Two icons that morph into each other: the active one turns and grows in while the other blurs out (play and pause, menu and close, copy and check). */
148
+ export declare function MorphIcon({ from, to, active, className }: {
149
+ from: ReactNode; /** The icon while active. */
150
+ to: ReactNode; /** Shows the to icon. */
151
+ active: boolean;
152
+ className?: string;
153
+ }): import("react").JSX.Element;
154
+ /** The named patterns you can put on your own elements (the CSS behind them is .alea-m in utilities.css). */
155
+ export type MotionPattern = 'fade' | 'pop' | 'rise' | 'drop' | 'scale' | 'zoom' | 'blur' | 'flip' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'badge' | 'nudge' | 'pulse' | 'draw' | 'lift' | 'press' | 'tint' | 'glow' | 'hint' | 'stagger';
156
+ /** When a pattern plays: on mount (default), while hovered, pressed or focused, when it scrolls into view, each time a value changes, or in a loop. */
157
+ export type MotionTrigger = 'mount' | 'hover' | 'press' | 'focus' | 'visible' | 'change' | 'loop';
158
+ export interface UseMotionOptions {
159
+ /** When it plays. Default 'mount'. */
160
+ on?: MotionTrigger;
161
+ /** With on="change": the value that replays the pattern each time it changes (not on the first render). */
162
+ value?: unknown;
163
+ /** Wait before playing, in ms. */
164
+ delay?: number;
165
+ /** How long it takes, in ms. Default the pattern's token. */
166
+ duration?: number;
167
+ /** With on="visible": play only the first time (default) or each time it scrolls in. */
168
+ once?: boolean;
169
+ }
170
+ /** Any Alea Motion pattern on your own element: spread the result on it (it carries a ref, a class and data attributes). */
171
+ export declare function useMotion<T extends HTMLElement = HTMLElement>(pattern: MotionPattern, { on, value, delay, duration, once }?: UseMotionOptions): {
172
+ ref: import("react").RefObject<T | null>;
173
+ 'data-stagger': string;
174
+ style: CSSProperties;
175
+ className?: undefined;
176
+ } | {
177
+ ref: import("react").RefObject<T | null>;
178
+ className: string;
179
+ style: CSSProperties;
180
+ 'data-stagger'?: undefined;
181
+ } | {
182
+ style: CSSProperties;
183
+ 'data-alea-loop'?: string | undefined;
184
+ ref: import("react").RefObject<T | null>;
185
+ className: string;
186
+ 'data-m': "fade" | "scale" | "pop" | "rise" | "drop" | "slide-up" | "slide-down" | "slide-left" | "slide-right" | "blur" | "zoom" | "flip" | "badge" | "nudge" | "pulse" | "draw" | "lift" | "press" | "tint" | "glow" | "hint";
187
+ 'data-m-on': MotionTrigger;
188
+ 'data-stagger'?: undefined;
189
+ };
190
+ export interface MotionProps extends UseMotionOptions {
191
+ /** The pattern: pop, rise, nudge, pulse, badge, lift, press… */
192
+ pattern: MotionPattern;
193
+ /** One element (any Alea component or your own): it gets the pattern, no wrapper is added. */
194
+ children: ReactElement;
195
+ }
196
+ /** Puts an Alea Motion pattern on its child, with no wrapper: <Motion pattern="pop" on="change" value={count}><Badge>{count}</Badge></Motion>. */
197
+ export declare function Motion({ pattern, children, ...options }: MotionProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
198
+ /** A box whose layers drift with the pointer (and, with scroll, with the page): the hero pattern. Layers are
199
+ * ParallaxLayer children with a depth; a depth of 1 moves the full strength, 0.3 a third of it. Nothing moves
200
+ * with reduced motion, and without JavaScript the layers simply sit still. */
201
+ export declare function Parallax({ as, strength, scroll, className, style, children, ...rest }: AsProps & {
202
+ /** How far a depth-1 layer travels, in px. Default 16. */
203
+ strength?: number;
204
+ /** Also drift vertically as the box crosses the viewport. Default false. */
205
+ scroll?: boolean;
206
+ }): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
207
+ /** One layer of a Parallax: depth 1 moves the full strength, 0 stays put; negative depths move the other way. */
208
+ export declare function ParallaxLayer({ as, depth, className, style, children, ...rest }: AsProps & {
209
+ depth?: number;
210
+ }): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
211
+ export {};
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@alea-design/motion",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Alea Motion: a motion system for interfaces. Tokens, named patterns, microinteractions and effects in CSS for any stack, plus small React helpers. Reduced motion built in.",
5
+ "keywords": [
6
+ "motion",
7
+ "animation",
8
+ "transitions",
9
+ "microinteractions",
10
+ "reduced motion",
11
+ "react",
12
+ "css",
13
+ "design system"
14
+ ],
15
+ "homepage": "https://alea.alevasquez.dev",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/alevascha/alea-design.git",
19
+ "directory": "packages/motion"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/alevascha/alea-design/issues"
23
+ },
24
+ "author": "Alejandro Vasquez (https://alevasquez.dev)",
25
+ "license": "MIT",
26
+ "type": "module",
27
+ "main": "dist/index.js",
28
+ "types": "dist/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "default": "./dist/index.js"
33
+ },
34
+ "./motion.css": "./src/motion.css",
35
+ "./patterns.css": "./src/patterns.css",
36
+ "./utilities.css": "./src/utilities.css"
37
+ },
38
+ "sideEffects": [
39
+ "*.css"
40
+ ],
41
+ "files": [
42
+ "dist",
43
+ "src/*.css",
44
+ "LICENSE",
45
+ "README.md"
46
+ ],
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "scripts": {
51
+ "build": "vite build && tsc -p tsconfig.build.json",
52
+ "typecheck": "tsc --noEmit",
53
+ "test": "vitest run --root ../react src/__tests__/motion"
54
+ },
55
+ "peerDependencies": {
56
+ "react": ">=18.3"
57
+ }
58
+ }
package/src/motion.css ADDED
@@ -0,0 +1,285 @@
1
+ /* Alea Motion. Every animation in the kit is one of these patterns, built only
2
+ from the motion tokens (--alea-motion-*). Nothing here changes layout. With
3
+ reduced motion the distances, scales and stagger go to zero (things fade,
4
+ nothing moves) and decorative loops stop. See the Motion page in the docs.
5
+
6
+ pop anchored overlays grow from their trigger popover, select, combobox, menus, date pickers, hover card, tooltip
7
+ rise page-level overlays come up a little dialog, alert dialog, command palette, toast, tour
8
+ slide panels come in from their edge drawer, bottom sheet, mobile nav
9
+ stagger items enter one after another command palette results (popover options and menu items arrive with their popover)
10
+ expand content opens to its height accordion, spoiler, tree, navigation menu panels
11
+ glide the selection moves to the new item tabs, segmented control, toggle group
12
+ lift clickable surfaces rise on hover interactive cards, kanban cards, image tiles, float button
13
+ press controls shrink a little while pressed buttons, icon buttons, toggles, tags, pagination, tools
14
+ morph an icon turns into its other state chevrons, burger, check marks, theme toggle, copy
15
+ tint hover and selection colors fade in options, menu items, list rows, links, inputs
16
+ nudge an invalid field shakes once text fields, selects, pickers after a failed submit
17
+ draw strokes and bars grow into place check marks, progress, steps, charts
18
+ pulse something live or new breathes status dots, indicators, live badges
19
+ shimmer a sheen sweeps over a placeholder skeleton
20
+ (patterns.css: swap, roll, badge pop, success, dissolve, resize, fan, ripple, hold, hint, reveal, scroll, stream, route)
21
+
22
+ HOW TO CHANGE IT
23
+ 1. Globally: set the tokens (--alea-motion-duration-base...), or data-alea-motion on <html>:
24
+ "productive" (shorter, quieter), "expressive" (default), "reduced" (fades only) or "off".
25
+ 2. Per component type, in your CSS: .alea-popover { --alea-enter: alea-m-fade-in; --alea-exit: alea-m-fade-out; }
26
+ 3. Per instance, with the motion prop: <Select motion="fade" />, <Dialog motion={{ enter: 'scale', duration: 300 }} />
27
+ The enter/exit variables do not inherit (@property), so a dialog's motion never leaks into the select inside it.
28
+ Presets: fade, scale, pop, rise, drop, slide-up, slide-down, slide-left, slide-right, blur, zoom, flip, morph, none. */
29
+
30
+ @import './patterns.css';
31
+ @import './utilities.css';
32
+
33
+ @property --alea-enter { syntax: '*'; inherits: false; }
34
+ @property --alea-exit { syntax: '*'; inherits: false; }
35
+ @property --alea-enter-duration { syntax: '*'; inherits: false; }
36
+ @property --alea-exit-duration { syntax: '*'; inherits: false; }
37
+ @property --alea-enter-ease { syntax: '*'; inherits: false; }
38
+ @property --alea-exit-ease { syntax: '*'; inherits: false; }
39
+ @property --alea-enter-delay { syntax: '*'; inherits: false; }
40
+
41
+ /* ------------------------------------------------------------------ the preset keyframes (alea-m-<preset>-in / -out) */
42
+ @keyframes alea-m-fade-in { from { opacity: 0.01; } }
43
+ @keyframes alea-m-fade-out { to { opacity: 0.01; } }
44
+ @keyframes alea-m-scale-in { from { opacity: 0.01; transform: scale(var(--alea-motion-scale-from)); } }
45
+ @keyframes alea-m-scale-out { to { opacity: 0.01; transform: scale(var(--alea-motion-scale-from)); } }
46
+ @keyframes alea-m-pop-in { from { opacity: 0.01; transform: translate(var(--alea-pop-x, 0), var(--alea-pop-y, 0)) scale(var(--alea-motion-scale-from)); } }
47
+ @keyframes alea-m-pop-out { to { opacity: 0.01; transform: scale(calc((1 + var(--alea-motion-scale-from)) / 2)); } }
48
+ @keyframes alea-m-rise-in { from { opacity: 0.01; transform: translateY(var(--alea-rise-y, var(--alea-motion-distance-lg))) scale(calc((1 + var(--alea-motion-scale-from)) / 2)); } }
49
+ @keyframes alea-m-rise-out { to { opacity: 0.01; transform: translateY(var(--alea-motion-distance-sm)) scale(calc((1 + var(--alea-motion-scale-from)) / 2)); } }
50
+ @keyframes alea-m-drop-in { from { opacity: 0.01; transform: translateY(calc(var(--alea-motion-distance-lg) * -1)); } }
51
+ @keyframes alea-m-drop-out { to { opacity: 0.01; transform: translateY(calc(var(--alea-motion-distance-sm) * -1)); } }
52
+ @keyframes alea-m-slide-up-in { from { opacity: 0.4; transform: translateY(var(--alea-slide-distance, calc(var(--alea-motion-distance-lg) * 2))); } }
53
+ @keyframes alea-m-slide-up-out { to { opacity: 0.01; transform: translateY(var(--alea-slide-distance, calc(var(--alea-motion-distance-lg) * 2))); } }
54
+ @keyframes alea-m-slide-down-in { from { opacity: 0.4; transform: translateY(calc(var(--alea-slide-distance, calc(var(--alea-motion-distance-lg) * 2)) * -1)); } }
55
+ @keyframes alea-m-slide-down-out { to { opacity: 0.01; transform: translateY(calc(var(--alea-slide-distance, calc(var(--alea-motion-distance-lg) * 2)) * -1)); } }
56
+ @keyframes alea-m-slide-left-in { from { opacity: 0.4; transform: translateX(var(--alea-slide-distance, calc(var(--alea-motion-distance-lg) * 2))); } }
57
+ @keyframes alea-m-slide-left-out { to { opacity: 0.01; transform: translateX(var(--alea-slide-distance, calc(var(--alea-motion-distance-lg) * 2))); } }
58
+ @keyframes alea-m-slide-right-in { from { opacity: 0.4; transform: translateX(calc(var(--alea-slide-distance, calc(var(--alea-motion-distance-lg) * 2)) * -1)); } }
59
+ @keyframes alea-m-slide-right-out { to { opacity: 0.01; transform: translateX(calc(var(--alea-slide-distance, calc(var(--alea-motion-distance-lg) * 2)) * -1)); } }
60
+ @keyframes alea-m-blur-in { from { opacity: 0.01; filter: blur(var(--alea-motion-blur-md)); transform: scale(calc((1 + var(--alea-motion-scale-from)) / 2)); } }
61
+ @keyframes alea-m-blur-out { to { opacity: 0.01; filter: blur(var(--alea-motion-blur-sm)); } }
62
+ @keyframes alea-m-zoom-in { from { opacity: 0.01; transform: scale(calc(1 - (1 - var(--alea-motion-scale-from)) * 4)); } }
63
+ @keyframes alea-m-zoom-out { to { opacity: 0.01; transform: scale(calc(1 - (1 - var(--alea-motion-scale-from)) * 2)); } }
64
+ @keyframes alea-m-flip-in { from { opacity: 0.01; transform: perspective(800px) rotateX(calc(var(--alea-motion-rotate, 12deg) * -1)) translateY(var(--alea-motion-distance-sm)); } }
65
+ @keyframes alea-m-flip-out { to { opacity: 0.01; transform: perspective(800px) rotateX(calc(var(--alea-motion-rotate, 12deg) * 0.5)); } }
66
+ /* morph: an anchored menu grows out of its trigger's shape (React Aria sets --trigger-width) */
67
+ @keyframes alea-m-morph-in { from { opacity: 0.4; clip-path: inset(0 calc(100% - var(--trigger-width, 100%)) calc(100% - var(--alea-size-control-md, 40px)) 0 round var(--alea-radius-full)); } to { clip-path: inset(0 0 0 0 round var(--alea-radius-md)); } }
68
+ @keyframes alea-m-morph-out { to { opacity: 0.01; clip-path: inset(0 calc(100% - var(--trigger-width, 100%)) calc(100% - var(--alea-size-control-md, 40px)) 0 round var(--alea-radius-full)); } }
69
+ /* drawers: from their own edge (--alea-slide is set per placement below) */
70
+ @keyframes alea-m-edge-in { from { transform: var(--alea-slide); opacity: 0.4; } }
71
+ @keyframes alea-m-edge-out { to { transform: var(--alea-slide); opacity: 0.4; } }
72
+ @keyframes alea-m-toast-in { from { opacity: 0.01; filter: blur(var(--alea-motion-blur-sm)); transform: translateY(var(--alea-motion-distance-md)) scale(var(--alea-motion-scale-from)); } }
73
+ @keyframes alea-m-toast-out { to { opacity: 0.01; transform: translateX(var(--alea-motion-distance-lg)); } }
74
+
75
+ @keyframes alea-item-in { from { opacity: 0.01; transform: translateY(var(--alea-motion-distance-sm)); } }
76
+ @keyframes alea-nudge { 0%, 100% { transform: none; } 20% { transform: translateX(calc(var(--alea-motion-distance-sm) * -1)); } 40% { transform: translateX(var(--alea-motion-distance-sm)); } 60% { transform: translateX(calc(var(--alea-motion-distance-sm) * -0.5)); } 80% { transform: translateX(calc(var(--alea-motion-distance-sm) * 0.5)); } }
77
+ @keyframes alea-ping { to { transform: scale(2.2); opacity: 0.01; } }
78
+ @keyframes alea-check-pop { 0% { transform: scale(var(--alea-motion-scale-press)); } 60% { transform: scale(calc(2 - var(--alea-motion-scale-press))); } 100% { transform: none; } }
79
+
80
+ /* ------------------------------------------------------------------ presets on an element (data-motion), used by the motion prop and by hand */
81
+ [data-motion='fade'] { --alea-enter: alea-m-fade-in; --alea-exit: alea-m-fade-out; }
82
+ [data-motion='scale'] { --alea-enter: alea-m-scale-in; --alea-exit: alea-m-scale-out; }
83
+ [data-motion='pop'] { --alea-enter: alea-m-pop-in; --alea-exit: alea-m-pop-out; }
84
+ [data-motion='rise'] { --alea-enter: alea-m-rise-in; --alea-exit: alea-m-rise-out; }
85
+ [data-motion='drop'] { --alea-enter: alea-m-drop-in; --alea-exit: alea-m-drop-out; }
86
+ [data-motion='slide-up'] { --alea-enter: alea-m-slide-up-in; --alea-exit: alea-m-slide-up-out; }
87
+ [data-motion='slide-down'] { --alea-enter: alea-m-slide-down-in; --alea-exit: alea-m-slide-down-out; }
88
+ [data-motion='slide-left'] { --alea-enter: alea-m-slide-left-in; --alea-exit: alea-m-slide-left-out; }
89
+ [data-motion='slide-right'] { --alea-enter: alea-m-slide-right-in; --alea-exit: alea-m-slide-right-out; }
90
+ [data-motion='blur'] { --alea-enter: alea-m-blur-in; --alea-exit: alea-m-blur-out; }
91
+ [data-motion='zoom'] { --alea-enter: alea-m-zoom-in; --alea-exit: alea-m-zoom-out; }
92
+ [data-motion='flip'] { --alea-enter: alea-m-flip-in; --alea-exit: alea-m-flip-out; }
93
+ [data-motion='morph'] { --alea-enter: alea-m-morph-in; --alea-exit: alea-m-morph-out; }
94
+ [data-motion='none'] { --alea-enter: none; --alea-exit: none; }
95
+
96
+ /* ------------------------------------------------------------------ pop: anchored overlays */
97
+ .alea-popover, .alea-tooltip { transform-origin: var(--trigger-anchor-point, top center); }
98
+ .alea-popover[data-placement='bottom'], .alea-tooltip[data-placement='bottom'] { --alea-pop-y: calc(var(--alea-motion-distance-sm) * -1); }
99
+ .alea-popover[data-placement='top'], .alea-tooltip[data-placement='top'] { --alea-pop-y: var(--alea-motion-distance-sm); }
100
+ .alea-popover[data-placement='left'], .alea-tooltip[data-placement='left'] { --alea-pop-x: var(--alea-motion-distance-sm); }
101
+ .alea-popover[data-placement='right'], .alea-tooltip[data-placement='right'] { --alea-pop-x: calc(var(--alea-motion-distance-sm) * -1); }
102
+ .alea-popover[data-entering] { animation: var(--alea-enter-duration, var(--alea-motion-duration-base)) var(--alea-enter-ease, var(--alea-motion-ease-out)) var(--alea-enter-delay, 0s) both var(--alea-enter, alea-m-pop-in); }
103
+ .alea-popover[data-exiting] { animation: var(--alea-exit-duration, var(--alea-motion-duration-fast)) var(--alea-exit-ease, var(--alea-motion-ease-in)) 0s forwards var(--alea-exit, alea-m-pop-out); }
104
+ .alea-tooltip[data-entering] { animation: var(--alea-enter-duration, var(--alea-motion-duration-fast)) var(--alea-enter-ease, var(--alea-motion-ease-out)) var(--alea-enter-delay, 0s) both var(--alea-enter, alea-m-pop-in); }
105
+ .alea-tooltip[data-exiting] { animation: var(--alea-exit-duration, var(--alea-motion-duration-instant)) var(--alea-exit-ease, var(--alea-motion-ease-in)) 0s forwards var(--alea-exit, alea-m-fade-out); }
106
+ .alea-navmenu-panel:not([hidden]) { transform-origin: top left; --alea-pop-y: calc(var(--alea-motion-distance-sm) * -1); animation: var(--alea-enter-duration, var(--alea-motion-duration-base)) var(--alea-enter-ease, var(--alea-motion-ease-out)) 0s both var(--alea-enter, alea-m-pop-in); }
107
+
108
+ /* ------------------------------------------------------------------ rise: page-level overlays */
109
+ :is(.alea-modal, .alea-command)[data-entering] { --alea-rise-y: var(--alea-motion-distance-md); animation: var(--alea-enter-duration, var(--alea-motion-duration-base)) var(--alea-enter-ease, var(--alea-motion-ease-out)) var(--alea-enter-delay, 0s) both var(--alea-enter, alea-m-rise-in); }
110
+ :is(.alea-modal, .alea-command)[data-exiting] { animation: var(--alea-exit-duration, var(--alea-motion-duration-fast)) var(--alea-exit-ease, var(--alea-motion-ease-in)) 0s forwards var(--alea-exit, alea-m-rise-out); }
111
+ :is(.alea-modal-overlay, .alea-command-overlay)[data-entering] { animation: alea-m-fade-in var(--alea-motion-duration-base) var(--alea-motion-ease-out); }
112
+ :is(.alea-modal-overlay, .alea-command-overlay)[data-exiting] { animation: alea-m-fade-out var(--alea-motion-duration-fast) var(--alea-motion-ease-in) forwards; }
113
+ .alea-toast { animation: var(--alea-enter-duration, var(--alea-motion-duration-slow)) var(--alea-enter-ease, var(--alea-motion-ease-out)) var(--alea-enter-delay, 0s) both var(--alea-enter, alea-m-toast-in); }
114
+ .alea-toast[data-exiting] { animation: var(--alea-exit-duration, var(--alea-motion-duration-fast)) var(--alea-exit-ease, var(--alea-motion-ease-in)) 0s forwards var(--alea-exit, alea-m-toast-out); pointer-events: none; }
115
+ .alea-tour-card { animation: var(--alea-enter-duration, var(--alea-motion-duration-slow)) var(--alea-enter-ease, var(--alea-motion-ease-out)) 0s both var(--alea-enter, alea-m-rise-in); }
116
+ .alea-alert[data-live] { animation: alea-item-in var(--alea-motion-duration-base) var(--alea-motion-ease-out); }
117
+
118
+ /* ------------------------------------------------------------------ slide: drawers from their edge; they fade a little too, so reduced motion still has an entrance */
119
+ .alea-drawer[data-entering] { animation: var(--alea-enter-duration, var(--alea-motion-duration-slow)) var(--alea-enter-ease, var(--alea-motion-ease-out)) var(--alea-enter-delay, 0s) both var(--alea-enter, alea-m-edge-in); }
120
+ .alea-drawer[data-exiting] { animation: var(--alea-exit-duration, var(--alea-motion-duration-base)) var(--alea-exit-ease, var(--alea-motion-ease-in)) 0s forwards var(--alea-exit, alea-m-edge-out); }
121
+ .alea-drawer[data-placement='end'] { --alea-slide: translateX(var(--alea-motion-slide, 100%)); }
122
+ .alea-drawer[data-placement='start'] { --alea-slide: translateX(calc(var(--alea-motion-slide, 100%) * -1)); }
123
+ .alea-drawer[data-placement='bottom'] { --alea-slide: translateY(var(--alea-motion-slide, 100%)); }
124
+ .alea-drawer[data-placement='top'] { --alea-slide: translateY(calc(var(--alea-motion-slide, 100%) * -1)); }
125
+
126
+ /* the drawer's backdrop is its parent: it enters and leaves with the panel, or the panel would fade out with it before it finished sliding */
127
+ .alea-drawer-overlay[data-entering] { animation-duration: var(--alea-enter-duration, var(--alea-motion-duration-slow)); }
128
+ .alea-drawer-overlay[data-exiting] { animation-duration: var(--alea-exit-duration, var(--alea-motion-duration-base)); }
129
+
130
+ /* ------------------------------------------------------------------ stagger: the first ten items of a list that just opened come in one after another */
131
+ /* command results only: the options and menu items of a popover arrive with it, so one surface carries one motion */
132
+ /* items come in from slightly above: what sticks out goes past the top edge, which never makes the list scroll (no scrollbar flash) */
133
+ .alea-command-item { animation: alea-item-drop var(--alea-motion-duration-base) var(--alea-motion-ease-out) both; }
134
+ @keyframes alea-item-drop { from { opacity: 0.01; transform: translateY(calc(var(--alea-motion-distance-sm) * -1)); } }
135
+ .alea-command-item:nth-child(2) { animation-delay: calc(var(--alea-motion-stagger) * 1); }
136
+ .alea-command-item:nth-child(3) { animation-delay: calc(var(--alea-motion-stagger) * 2); }
137
+ .alea-command-item:nth-child(4) { animation-delay: calc(var(--alea-motion-stagger) * 3); }
138
+ .alea-command-item:nth-child(5) { animation-delay: calc(var(--alea-motion-stagger) * 4); }
139
+ .alea-command-item:nth-child(6) { animation-delay: calc(var(--alea-motion-stagger) * 5); }
140
+ .alea-command-item:nth-child(7) { animation-delay: calc(var(--alea-motion-stagger) * 6); }
141
+ .alea-command-item:nth-child(8) { animation-delay: calc(var(--alea-motion-stagger) * 7); }
142
+ .alea-command-item:nth-child(9) { animation-delay: calc(var(--alea-motion-stagger) * 8); }
143
+ .alea-command-item:nth-child(n+10) { animation-delay: calc(var(--alea-motion-stagger) * 9); }
144
+
145
+ /* ------------------------------------------------------------------ expand */
146
+ .alea-accordion-item[data-expanded] .alea-accordion-content { animation: alea-item-in var(--alea-motion-duration-base) var(--alea-motion-ease-out); }
147
+ .alea-tree-item { animation: alea-item-in var(--alea-motion-duration-base) var(--alea-motion-ease-out); }
148
+ .alea-spoiler-body { transition-duration: var(--alea-motion-duration-slow); transition-timing-function: var(--alea-motion-ease-out); }
149
+
150
+ /* ------------------------------------------------------------------ glide: one indicator per group moves between items (React Aria SelectionIndicator) */
151
+ .alea-tab, .alea-segmented-item { position: relative; isolation: isolate; }
152
+ .alea-tab-label, .alea-segmented-label, .alea-toggle-label, .alea-toggle-icon { position: relative; z-index: 1; }
153
+ .alea-sel-indicator {
154
+ position: absolute; z-index: 0; inset: 0; width: 100%; border-radius: inherit; pointer-events: none;
155
+ transition: translate var(--alea-motion-duration-base) var(--alea-motion-ease-emphasized), width var(--alea-motion-duration-base) var(--alea-motion-ease-emphasized), height var(--alea-motion-duration-base) var(--alea-motion-ease-emphasized), opacity var(--alea-motion-duration-fast) var(--alea-motion-ease-standard);
156
+ }
157
+ .alea-sel-indicator[data-entering] { animation: alea-m-fade-in var(--alea-motion-duration-fast) var(--alea-motion-ease-out); }
158
+ .alea-sel-indicator[data-exiting] { animation: alea-m-fade-out var(--alea-motion-duration-fast) var(--alea-motion-ease-in) forwards; }
159
+ .alea-tabs[data-variant='underline'] .alea-sel-indicator { inset: auto 0 0; left: var(--alea-space-3, 12px); width: calc(100% - var(--alea-space-3) * 2); height: 2px; border-radius: var(--alea-radius-2xs, 2px); background: var(--alea-gradient-accent-linear); }
160
+ .alea-tabs[data-orientation='vertical'][data-variant='underline'] .alea-sel-indicator { inset: var(--alea-space-2, 8px) auto var(--alea-space-2, 8px) 0; left: 0; width: 2px; height: calc(100% - var(--alea-space-2) * 2); }
161
+ .alea-tabs[data-variant='pills'] .alea-sel-indicator, .alea-segmented .alea-sel-indicator { background: var(--alea-chip-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
162
+ .alea-toggle-group .alea-sel-indicator { background: var(--alea-surface-raised); box-shadow: var(--alea-shadow-card), inset 0 0 0 1px var(--alea-border-strong); }
163
+
164
+ /* ------------------------------------------------------------------ lift */
165
+ :is(.alea-card[data-interactive], .alea-kanban-card, a.alea-imagelist-tile, .alea-float-btn, .alea-b-tile, .alea-b-pcard) {
166
+ transition: transform var(--alea-motion-duration-base) var(--alea-motion-ease-out), box-shadow var(--alea-motion-duration-base) var(--alea-motion-ease-out), background-color var(--alea-motion-duration-fast) var(--alea-motion-ease-standard);
167
+ }
168
+ :is(.alea-card[data-interactive], a.alea-imagelist-tile, .alea-float-btn):hover, .alea-kanban-card[data-hovered] { transform: translateY(var(--alea-motion-lift)); }
169
+ .alea-kanban-card[data-hovered] { box-shadow: var(--alea-shadow-pop), inset 0 0 0 1px var(--alea-border); }
170
+
171
+ /* ------------------------------------------------------------------ press */
172
+ :is(.alea-button, .alea-toggle-button, .alea-toggle-item, .alea-segmented-item, .alea-tag, .alea-page, .alea-rating-item, .alea-carousel-dot)[data-pressed],
173
+ :is(.alea-mdeditor-tool, .alea-menubar-item, .alea-bottomnav-item, .alea-burger, .alea-drag-handle, .alea-float-btn, .alea-navmenu-item, .alea-toast-action, .alea-grid-edit):active {
174
+ transform: scale(var(--alea-motion-scale-press));
175
+ }
176
+ :is(.alea-toggle-button, .alea-toggle-item, .alea-segmented-item, .alea-tag, .alea-page, .alea-mdeditor-tool, .alea-menubar-item, .alea-bottomnav-item, .alea-burger, .alea-drag-handle, .alea-navmenu-item, .alea-toast-action) {
177
+ transition-property: transform, background-color, color, box-shadow, opacity;
178
+ transition-duration: var(--alea-motion-duration-instant), var(--alea-motion-duration-fast), var(--alea-motion-duration-fast), var(--alea-motion-duration-fast), var(--alea-motion-duration-fast);
179
+ transition-timing-function: var(--alea-motion-ease-out);
180
+ }
181
+ .alea-card[data-interactive]:active { transform: translateY(0) scale(calc(1 - (1 - var(--alea-motion-scale-press)) * 0.125)); }
182
+
183
+ /* ------------------------------------------------------------------ morph */
184
+ .alea-select-chevron, .alea-combobox-chevron, .alea-tree-chevron, .alea-navmenu-chevron, .alea-accordion-chevron { transition: transform var(--alea-motion-duration-base) var(--alea-motion-ease-emphasized); }
185
+ :is(.alea-select-trigger, .alea-combobox-button, .alea-select-trigger-button)[aria-expanded='true'] .alea-select-chevron, .alea-select[data-open] .alea-select-chevron, .alea-combobox[data-open] :is(.alea-select-chevron, .alea-combobox-chevron) { transform: rotate(180deg); }
186
+ .alea-tree-item[data-expanded] .alea-tree-chevron { transform: rotate(90deg); }
187
+ .alea-check[data-selected] .alea-check-box, .alea-radio[data-selected] .alea-radio-dot { animation: alea-check-pop var(--alea-motion-duration-base) var(--alea-motion-ease-emphasized); }
188
+ .alea-check-box svg { transition-timing-function: var(--alea-motion-ease-emphasized); }
189
+ .alea-rating-item[data-selected] .alea-rating-star { animation: alea-check-pop var(--alea-motion-duration-base) var(--alea-motion-ease-emphasized); }
190
+ .alea-burger span { transition-timing-function: var(--alea-motion-ease-emphasized); }
191
+
192
+ /* ------------------------------------------------------------------ tint */
193
+ :is(.alea-option, .alea-menu-item, .alea-command-item, .alea-list-item, .alea-tree-item, .alea-sidebar-link, .alea-navmenu-link, .alea-crumb-link, .alea-mdeditor-tool, .alea-menubar-item, .alea-accordion-trigger, .alea-anchor-link, .alea-icon-button, .alea-datagrid tr, .alea-tr) {
194
+ transition: background-color var(--alea-motion-duration-instant) var(--alea-motion-ease-standard), color var(--alea-motion-duration-instant) var(--alea-motion-ease-standard), box-shadow var(--alea-motion-duration-fast) var(--alea-motion-ease-standard);
195
+ }
196
+
197
+ /* ------------------------------------------------------------------ nudge: once, when a field turns invalid */
198
+ .alea-field[data-invalid] :is(.alea-input-wrap, .alea-select-trigger, .alea-textarea, .alea-date-wrap) { animation: alea-nudge var(--alea-motion-duration-slow) var(--alea-motion-ease-out); }
199
+
200
+ /* ------------------------------------------------------------------ draw */
201
+ .alea-meter-fill { transition: width var(--alea-motion-duration-slow) var(--alea-motion-ease-out); }
202
+ .alea-step-dot { transition: background-color var(--alea-motion-duration-base) var(--alea-motion-ease-standard), box-shadow var(--alea-motion-duration-base) var(--alea-motion-ease-standard), transform var(--alea-motion-duration-base) var(--alea-motion-ease-emphasized); }
203
+
204
+ /* ------------------------------------------------------------------ pulse */
205
+ .alea-badge[data-pulse] .alea-badge-dot, .alea-avatar-status[data-pulse] { position: relative; }
206
+ .alea-badge[data-pulse] .alea-badge-dot::after, .alea-avatar-status[data-pulse]::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: alea-ping 1.6s var(--alea-motion-ease-out) infinite; }
207
+
208
+ /* ------------------------------------------------------------------ loops: paused while they are off screen (useOffscreenPause sets data-alea-offscreen) */
209
+ [data-alea-offscreen], [data-alea-offscreen]::before, [data-alea-offscreen]::after, [data-alea-offscreen] *, [data-alea-offscreen] *::before, [data-alea-offscreen] *::after { animation-play-state: paused !important; }
210
+
211
+ /* ------------------------------------------------------------------ global modes: data-alea-motion on <html> (or any .alea-root) */
212
+ /* productive: shorter and quieter, for dense apps and dashboards (brisk, minimal motion) */
213
+ [data-alea-motion='productive'] {
214
+ --alea-motion-duration-fast: 120ms; --alea-motion-duration-base: 200ms; --alea-motion-duration-slow: 280ms; --alea-motion-duration-slower: 400ms;
215
+ --alea-motion-distance-sm: 4px; --alea-motion-distance-md: 8px; --alea-motion-distance-lg: 12px; --alea-motion-scale-from: 0.96; --alea-motion-stagger: 16ms; --alea-motion-blur-md: 4px;
216
+ --alea-motion-ease-emphasized: var(--alea-motion-ease-out); --alea-motion-ease-spring: var(--alea-motion-ease-out); --alea-motion-spring: var(--alea-motion-ease-out);
217
+ }
218
+ /* expressive: the default values, named so a region can switch back */
219
+ [data-alea-motion='expressive'] { --alea-motion-duration-base: 320ms; --alea-motion-duration-slow: 480ms; }
220
+ /* off: no animation or transition at all (React Aria then opens and closes at once) */
221
+ [data-alea-motion='off'], [data-alea-motion='off'] *, [data-alea-motion='off'] *::before, [data-alea-motion='off'] *::after { animation: none !important; transition: none !important; }
222
+
223
+ /* ------------------------------------------------------------------ reduced motion: fade, don't move; stop decorative loops.
224
+ Applies with the OS setting (unless data-alea-reduced="never"), or always with data-alea-reduced="always" or data-alea-motion="reduced". */
225
+ @media (prefers-reduced-motion: reduce) {
226
+ :root:not([data-alea-reduced='never']), :root:not([data-alea-reduced='never']) :is(.alea-root, [data-theme], [data-alea-motion]) {
227
+ --alea-motion-distance-sm: 0px; --alea-motion-distance-md: 0px; --alea-motion-distance-lg: 0px; --alea-motion-rotate: 0deg;
228
+ --alea-motion-scale-from: 1; --alea-motion-scale-press: 1; --alea-motion-lift: 0px; --alea-motion-stagger: 0ms; --alea-motion-slide: 0%; --alea-slide-distance: 0px;
229
+ --alea-motion-blur-sm: 0px; --alea-motion-blur-md: 0px; --alea-motion-blur-lg: 0px;
230
+ --alea-motion-ease-emphasized: var(--alea-motion-ease-out); --alea-motion-ease-spring: var(--alea-motion-ease-out); --alea-motion-spring: var(--alea-motion-ease-out);
231
+ --alea-motion-duration-slow: var(--alea-motion-duration-base); --alea-motion-duration-slower: var(--alea-motion-duration-base);
232
+ }
233
+ :root:not([data-alea-reduced='never']) :is(.alea-field[data-invalid] :is(.alea-input-wrap, .alea-select-trigger, .alea-textarea, .alea-date-wrap), [data-alea-loop], .alea-badge[data-pulse] .alea-badge-dot::after, .alea-avatar-status[data-pulse]::after, .alea-status-dot[data-pulse]::after, .alea-indicator[data-processing]::before, .alea-image[data-state='loading'], .alea-orb, .alea-orbs *) { animation: none !important; }
234
+ :root:not([data-alea-reduced='never']) .alea-skeleton { animation-duration: 3s; }
235
+ /* loading spinners keep turning (they carry meaning), only slower; decorative pulses stop */
236
+ :root:not([data-alea-reduced='never']) :is(.alea-spinner svg, .alea-dot-loader i, .alea-progress-circle svg[data-indeterminate]) { animation-duration: 2.4s; }
237
+ :root:not([data-alea-reduced='never']) .alea-gradient-dot[data-pulse] { animation: none !important; }
238
+ /* reveals (bars grow, lines draw, words rise) appear at once, a stroke is already drawn, the ripple is not shown, a morph fades */
239
+ :root:not([data-alea-reduced='never']) :is(.alea-chart-line, .alea-chart-area, .alea-chart-bar, .alea-pie-slice, .alea-funnel-bar, .alea-bullet-value, .alea-gauge-arc, .alea-radial-arc, .alea-progress-seg-part, .alea-split-word, .alea-success-check path, .alea-m[data-m='draw']) { animation: none !important; }
240
+ :root:not([data-alea-reduced='never']) :is(.alea-chart-line, .alea-success-check path) { stroke-dashoffset: 0; }
241
+ :root:not([data-alea-reduced='never']) .alea-ripple { display: none; }
242
+ :root:not([data-alea-reduced='never'])[data-motion='morph'], :root:not([data-alea-reduced='never']) [data-motion='morph'] { --alea-enter: alea-m-fade-in; --alea-exit: alea-m-fade-out; }
243
+ }
244
+ :is([data-alea-motion='reduced'], [data-alea-reduced='always']), :is([data-alea-motion='reduced'], [data-alea-reduced='always']) :is(.alea-root, [data-theme]) {
245
+ --alea-motion-distance-sm: 0px; --alea-motion-distance-md: 0px; --alea-motion-distance-lg: 0px; --alea-motion-rotate: 0deg;
246
+ --alea-motion-scale-from: 1; --alea-motion-scale-press: 1; --alea-motion-lift: 0px; --alea-motion-stagger: 0ms; --alea-motion-slide: 0%; --alea-slide-distance: 0px;
247
+ --alea-motion-blur-sm: 0px; --alea-motion-blur-md: 0px; --alea-motion-blur-lg: 0px;
248
+ --alea-motion-ease-emphasized: var(--alea-motion-ease-out); --alea-motion-ease-spring: var(--alea-motion-ease-out); --alea-motion-spring: var(--alea-motion-ease-out);
249
+ --alea-motion-duration-slow: var(--alea-motion-duration-base); --alea-motion-duration-slower: var(--alea-motion-duration-base);
250
+ }
251
+ :is([data-alea-motion='reduced'], [data-alea-reduced='always']) :is(.alea-field[data-invalid] :is(.alea-input-wrap, .alea-select-trigger, .alea-textarea, .alea-date-wrap), [data-alea-loop], .alea-badge[data-pulse] .alea-badge-dot::after, .alea-avatar-status[data-pulse]::after, .alea-status-dot[data-pulse]::after, .alea-indicator[data-processing]::before, .alea-image[data-state='loading'], .alea-orb, .alea-orbs *) { animation: none !important; }
252
+ :is([data-alea-motion='reduced'], [data-alea-reduced='always']) :is(.alea-spinner svg, .alea-dot-loader i, .alea-progress-circle svg[data-indeterminate]) { animation-duration: 2.4s; }
253
+ :is([data-alea-motion='reduced'], [data-alea-reduced='always']) .alea-gradient-dot[data-pulse] { animation: none !important; }
254
+ /* reveals (bars grow, lines draw, words rise) appear at once, a stroke is already drawn, the ripple is not shown, a morph fades */
255
+ :is([data-alea-motion='reduced'], [data-alea-reduced='always']) :is(.alea-chart-line, .alea-chart-area, .alea-chart-bar, .alea-pie-slice, .alea-funnel-bar, .alea-bullet-value, .alea-gauge-arc, .alea-radial-arc, .alea-progress-seg-part, .alea-split-word, .alea-success-check path, .alea-m[data-m='draw']) { animation: none !important; }
256
+ :is([data-alea-motion='reduced'], [data-alea-reduced='always']) :is(.alea-chart-line, .alea-success-check path) { stroke-dashoffset: 0; }
257
+ :is([data-alea-motion='reduced'], [data-alea-reduced='always']) .alea-ripple { display: none; }
258
+ :is([data-alea-motion='reduced'], [data-alea-reduced='always'])[data-motion='morph'], :is([data-alea-motion='reduced'], [data-alea-reduced='always']) [data-motion='morph'] { --alea-enter: alea-m-fade-in; --alea-exit: alea-m-fade-out; }
259
+
260
+ /* ------------------------------------------------------------------ the patterns, applied to the rest of the kit */
261
+ /* rise: content that appears as a state of its own */
262
+ :is(.alea-empty, .alea-result) { animation: alea-m-rise-in var(--alea-motion-duration-slow) var(--alea-motion-ease-out) both; }
263
+ /* stagger: lists that arrive together */
264
+ :is(.alea-timeline, .alea-upload-list, .alea-transfer-list .alea-list) > * { animation: alea-item-in var(--alea-motion-duration-base) var(--alea-motion-ease-out) both; }
265
+ :is(.alea-timeline, .alea-upload-list) > :nth-child(2) { animation-delay: calc(var(--alea-motion-stagger) * 1); }
266
+ :is(.alea-timeline, .alea-upload-list) > :nth-child(3) { animation-delay: calc(var(--alea-motion-stagger) * 2); }
267
+ :is(.alea-timeline, .alea-upload-list) > :nth-child(4) { animation-delay: calc(var(--alea-motion-stagger) * 3); }
268
+ :is(.alea-timeline, .alea-upload-list) > :nth-child(n+5) { animation-delay: calc(var(--alea-motion-stagger) * 4); }
269
+ /* pop: a tag the user adds (the group sets data-added on tags that mount after it); the tags on first paint stay still */
270
+ .alea-tag[data-added] { animation: alea-m-scale-in var(--alea-motion-duration-base) var(--alea-motion-ease-emphasized) both; }
271
+ /* pop + glide: chart tooltips appear softly and follow the pointer */
272
+ .alea-chart-tooltip { animation: alea-m-fade-in var(--alea-motion-duration-fast) var(--alea-motion-ease-out) both; transition: left var(--alea-motion-duration-fast) var(--alea-motion-ease-out), top var(--alea-motion-duration-fast) var(--alea-motion-ease-out), transform var(--alea-motion-duration-fast) var(--alea-motion-ease-out); }
273
+ /* slide: a calendar month comes in from the side you moved to */
274
+ .alea-calview-grid[data-dir] { animation: alea-calview-in var(--alea-motion-duration-base) var(--alea-motion-ease-out) both; }
275
+ @keyframes alea-calview-in { from { opacity: 0.01; transform: translateX(calc(var(--alea-motion-distance-lg) * var(--alea-cal-dir, 1))); } }
276
+ .alea-calview-grid[data-dir='-1'] { --alea-cal-dir: -1; }
277
+ /* press: swatches and color pickers */
278
+ :is(.alea-swatch, .alea-color-swatch, .alea-swatch-item) { transition: transform var(--alea-motion-duration-fast) var(--alea-motion-ease-out), box-shadow var(--alea-motion-duration-fast) var(--alea-motion-ease-standard); }
279
+ :is(.alea-swatch, .alea-swatch-item)[data-pressed], .alea-color-swatch:active { transform: scale(var(--alea-motion-scale-press)); }
280
+
281
+ /* Parallax: layers follow the pointer (--alea-par-x/y in -1..1) and, with scroll, the page (--alea-par-s) */
282
+ .alea-parallax { position: relative; }
283
+ .alea-parallax-layer { transform: translate3d(calc(var(--alea-par-x, 0) * var(--alea-par-strength, 16px) * var(--alea-depth, 0.5)), calc((var(--alea-par-y, 0) + var(--alea-par-s, 0) * 2) * var(--alea-par-strength, 16px) * var(--alea-depth, 0.5)), 0); transition: transform var(--alea-motion-duration-slow, 400ms) var(--alea-motion-ease-out, ease-out); will-change: transform; }
284
+ @media (prefers-reduced-motion: reduce) { .alea-parallax-layer { transform: none; transition: none; } }
285
+ [data-alea-motion='reduced'] .alea-parallax-layer, [data-alea-motion='off'] .alea-parallax-layer { transform: none; transition: none; }