import type { Transition } from "framer-motion"; /** * Shared motion for @colineapp/ui. Interface motion is fast and settles * without bounce; springs are reserved for direct manipulation (drag, * toggles) where a little overshoot reads as physical. `MotionConfig * reducedMotion="user"` in the provider turns transforms off for people * who ask for less motion. */ export const EASE_OUT = [0.22, 1, 0.36, 1] as const; export const transitions = { /** Enter/exit of panels, rows, and popovers. */ enter: { duration: 0.24, ease: EASE_OUT } satisfies Transition, /** Hover and press feedback. */ quick: { duration: 0.14, ease: EASE_OUT } satisfies Transition, /** Shared-layout indicators (tabs, segmented controls). */ indicator: { type: "spring", stiffness: 520, damping: 40, mass: 0.8 } satisfies Transition, /** Direct manipulation: drag and drop, switches. */ spring: { type: "spring", stiffness: 420, damping: 32 } satisfies Transition, } as const; /** Stagger list items by index, capped so long lists still arrive quickly. */ export function staggerDelay(index: number, step = 0.03, max = 0.3): number { return Math.min(index * step, max); } export const fadeUp = { initial: { opacity: 0, y: 6 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -4 }, } as const;