@aphrody/m3-motion 3.2.5 → 3.3.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 @@
1
+ {"version":3,"sources":["../src/springs.ts","../src/easings.ts","../src/spring-interpolation.ts","../src/components/M3Fade.tsx","../src/components/M3SharedAxis.tsx","../src/components/M3FadeThrough.tsx","../src/components/M3Collapse.tsx","../src/components/M3ContainerTransform.tsx","../src/components/M3Transition.tsx","../src/components/M3ListStagger.tsx","../src/hooks/useM3Animate.ts"],"names":["x1","y1","x2","y2","React","React2","jsx","motion","AnimatePresence","React4","React6","React7"],"mappings":";;;;;AAUO,IAAM,SAAA,GAAY;AAAA,EACvB,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,QAAA;AAAA,MACN,SAAA,EAAW,GAAA;AAAA,MACX,OAAA,EAAS,EAAA;AAAA,MACT,IAAA,EAAM;AAAA,KACR;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,QAAA;AAAA,MACN,SAAA,EAAW,GAAA;AAAA,MACX,OAAA,EAAS,EAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR,GACF;AAAA,EACA,OAAA,EAAS;AAAA,IACP,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,QAAA;AAAA,MACN,SAAA,EAAW,GAAA;AAAA,MACX,OAAA,EAAS,EAAA;AAAA,MACT,IAAA,EAAM;AAAA,KACR;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,QAAA;AAAA,MACN,SAAA,EAAW,GAAA;AAAA,MACX,OAAA,EAAS,EAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR,GACF;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,QAAA;AAAA,MACN,SAAA,EAAW,EAAA;AAAA,MACX,OAAA,EAAS,EAAA;AAAA,MACT,IAAA,EAAM;AA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QACA;AAAA,OACF;AAAA,IACF;AAEA,IAAA,IACE,OAAO,sBAAsB,QAAA,IAC7B,iBAAA,YAA6B,WAC5B,OAAO,iBAAA,KAAsB,YAC5B,iBAAA,KAAsB,IAAA,IACtB,aAAa,iBAAA,IACf,OAAO,sBAAsB,QAAA,IAC5B,OAAO,sBAAsB,QAAA,IAC5B,iBAAA,KAAsB,IAAA,IACtB,KAAA,IAAS,iBAAA,EACX;AACA,MAAA,OAAQ,OAAA,CAA6B,mBAAmB,SAAA,EAAW;AAAA,QACjE,MAAM,SAAA,CAAU,UAAA;AAAA,QAChB,UAAU,WAAA,CAAY,OAAA;AAAA,QACtB,GAAI,OAAO,OAAA,KAAY,YAAY,OAAA,KAAY,IAAA,GAAO,UAAU;AAAC,OAClE,CAAA;AAAA,IACH;AAEA,IAAA,OAAQ,OAAA,CAA6B,mBAAmB,SAAA,EAAW;AAAA,MACjE,MAAM,SAAA,CAAU,UAAA;AAAA,MAChB,UAAU,WAAA,CAAY,OAAA;AAAA,MACtB,GAAI,OAAO,OAAA,KAAY,YAAY,OAAA,KAAY,IAAA,GAAO,UAAU;AAAC,KAClE,CAAA;AAAA,EACH,CAAA;AAEA,EAAA,OAAO,CAAC,OAAO,SAAS,CAAA;AAC1B","file":"index.js","sourcesContent":["import type { Transition } from \"motion/react\";\r\n\r\n/**\r\n * Material Design 3 Spring Transition Presets.\r\n * Driven by physical stiffness, damping, and mass.\r\n *\r\n * Category Guide:\r\n * - Spatial: Used for movement (x/y positions, width/height, scale, borders). Includes overshoot (bounce).\r\n * - Effects: Used for color changes, opacities, and gradients. Critically damped (no overshoot).\r\n */\r\nexport const m3Springs = {\r\n fast: {\r\n spatial: {\r\n type: \"spring\",\r\n stiffness: 400,\r\n damping: 24,\r\n mass: 0.8,\r\n } as Transition,\r\n effects: {\r\n type: \"spring\",\r\n stiffness: 350,\r\n damping: 37,\r\n mass: 0.8,\r\n } as Transition,\r\n },\r\n default: {\r\n spatial: {\r\n type: \"spring\",\r\n stiffness: 220,\r\n damping: 17,\r\n mass: 1.0,\r\n } as Transition,\r\n effects: {\r\n type: \"spring\",\r\n stiffness: 180,\r\n damping: 26,\r\n mass: 1.0,\r\n } as Transition,\r\n },\r\n slow: {\r\n spatial: {\r\n type: \"spring\",\r\n stiffness: 80,\r\n damping: 12,\r\n mass: 1.2,\r\n } as Transition,\r\n effects: {\r\n type: \"spring\",\r\n stiffness: 70,\r\n damping: 16,\r\n mass: 1.2,\r\n } as Transition,\r\n },\r\n} as const;\r\n","/**\r\n * Material Design 3 Easing Presets.\r\n * Represented as cubic-bezier array coordinates [x1, y1, x2, y2].\r\n *\r\n * Source of truth: packages/material-web/tokens/versions/v0_192/_md-sys-motion.scss\r\n * and docs/01-md3-spec-foundations.md §7.1\r\n *\r\n * Note on `emphasized`: the full M3 emphasized path is a 2-segment spline\r\n * (not expressible as a single cubic-bezier). The token file maps\r\n * easing-emphasized to cubic-bezier(0.2, 0, 0, 1) — identical to standard —\r\n * because that is the closest single-bezier approximation used in web\r\n * implementations. Use emphasizedDecelerate / emphasizedAccelerate for\r\n * enter/exit transitions respectively (recommended practice per spec §7.1).\r\n */\r\nexport const m3Easings = {\r\n /** Closest single-bezier approximation. Use emphasizedDecelerate/Accelerate for transitions. */\r\n emphasized: [0.2, 0.0, 0.0, 1.0],\r\n emphasizedDecelerate: [0.05, 0.7, 0.1, 1.0],\r\n emphasizedAccelerate: [0.3, 0.0, 0.8, 0.15],\r\n standard: [0.2, 0.0, 0.0, 1.0],\r\n standardDecelerate: [0.0, 0.0, 0.0, 1.0],\r\n standardAccelerate: [0.3, 0.0, 1.0, 1.0],\r\n linear: [0.0, 0.0, 1.0, 1.0],\r\n /** Legacy (M2 default) — kept for migration compatibility. */\r\n legacy: [0.4, 0.0, 0.2, 1.0],\r\n legacyDecelerate: [0.0, 0.0, 0.2, 1.0],\r\n legacyAccelerate: [0.4, 0.0, 1.0, 1.0],\r\n} as const;\r\n\r\nexport type M3EasingKey = keyof typeof m3Easings;\r\nexport type M3EasingValue = (typeof m3Easings)[M3EasingKey];\r\n\r\n/**\r\n * Material Design 3 Duration Presets (in seconds, compatible with Motion duration option).\r\n *\r\n * Canonical values from _md-sys-motion.scss:\r\n * short1=50ms, short2=100ms, short3=150ms, short4=200ms\r\n * medium1=250ms, medium2=300ms, medium3=350ms, medium4=400ms\r\n * long1=450ms, long2=500ms, long3=550ms, long4=600ms\r\n * extraLong1=700ms, extraLong2=800ms, extraLong3=900ms, extraLong4=1000ms\r\n */\r\nexport const m3Durations = {\r\n short1: 0.05,\r\n short2: 0.1,\r\n short3: 0.15,\r\n short4: 0.2,\r\n medium1: 0.25,\r\n medium2: 0.3,\r\n medium3: 0.35,\r\n medium4: 0.4,\r\n long1: 0.45,\r\n long2: 0.5,\r\n long3: 0.55,\r\n long4: 0.6,\r\n extraLong1: 0.7,\r\n extraLong2: 0.8,\r\n extraLong3: 0.9,\r\n extraLong4: 1.0,\r\n} as const;\r\n\r\nexport type M3DurationKey = keyof typeof m3Durations;\r\nexport type M3DurationValue = (typeof m3Durations)[M3DurationKey];\r\n","// SPDX-License-Identifier: Apache-2.0\r\n\r\n/**\r\n * Physical spring interpolation for the Web platform (M3 Expressive, Phase 3.1).\r\n *\r\n * The React components in this package drive springs through `motion/react`,\r\n * which runs a per-frame numerical integrator. Lit components from\r\n * `@material/web` live inside a Shadow DOM and have no access to Motion, so\r\n * they can only animate through CSS transitions (a single `cubic-bezier`) or\r\n * the Web Animations API (`element.animate(keyframes, options)`).\r\n *\r\n * This module is the bridge: it turns the same physical spring parameters\r\n * (`stiffness` / `damping` / `mass`) used by {@link m3Springs} into:\r\n *\r\n * 1. a settle-time estimate in milliseconds ({@link springDurationMs}),\r\n * 2. a single `cubic-bezier(...)` CSS easing approximation\r\n * ({@link springToCssEasing}), and\r\n * 3. an exact sampling of the analytical damped-spring solution as WAAPI\r\n * keyframes ({@link springToWaapiKeyframes}), which — unlike a\r\n * cubic-bezier — preserves overshoot/bounce.\r\n *\r\n * All functions are pure, deterministic and SSR-safe: there is no DOM access\r\n * at module load or call time. `Keyframe` is referenced only as a DOM lib\r\n * type. The maths handle the three damping regimes (under-, critically- and\r\n * over-damped) without dividing by zero.\r\n *\r\n * Physical model (mass-spring-damper, m x'' + c x' + k x = 0):\r\n * - natural angular frequency w0 = sqrt(k / m)\r\n * - damping ratio zeta = c / (2 * sqrt(k * m))\r\n * - damped angular frequency wd = w0 * sqrt(1 - zeta^2) (under-damped)\r\n *\r\n * Here `k` = stiffness, `c` = damping, `m` = mass.\r\n */\r\n\r\n/** Physical parameters of a mass-spring-damper system. */\r\nexport interface SpringParams {\r\n /** Spring stiffness `k` (> 0). Higher = snappier. */\r\n stiffness: number;\r\n /** Damping coefficient `c` (>= 0). Higher = less / no bounce. */\r\n damping: number;\r\n /** Mass `m` (> 0). Defaults to 1. Higher = slower, heavier feel. */\r\n mass?: number;\r\n}\r\n\r\n/** One sample of the analytical spring solution, progress-normalised. */\r\nexport interface SpringSample {\r\n /** Timeline position in [0, 1]. */\r\n offset: number;\r\n /**\r\n * Animated value at this offset. With `from`/`to` defaults (0 -> 1) this\r\n * is the normalised progress and may exceed 1 (overshoot) for\r\n * under-damped springs — that is the whole point of WAAPI sampling.\r\n */\r\n value: number;\r\n}\r\n\r\n/** Result bundle for WAAPI consumption. */\r\nexport interface SpringWaapi {\r\n /** Progress-normalised samples (always present, easy to remap). */\r\n samples: SpringSample[];\r\n /**\r\n * Ready-to-use `Keyframe[]`. Empty `{ offset }`-only objects unless a\r\n * property mapper is supplied via {@link springToWaapiKeyframes} options;\r\n * use {@link springKeyframesForProperty} to project `samples` onto a CSS\r\n * property such as `transform` or `opacity`.\r\n */\r\n keyframes: Keyframe[];\r\n /** WAAPI `KeyframeEffectOptions`-compatible timing. */\r\n options: { duration: number; easing: string };\r\n}\r\n\r\nconst MIN_DURATION_MS = 50;\r\nconst MAX_DURATION_MS = 2000;\r\n/** Envelope threshold for \"settled\": within 0.5% of the rest position. */\r\nconst SETTLE_THRESHOLD = 0.005;\r\nconst DEFAULT_MASS = 1;\r\nconst DEFAULT_STEPS = 60;\r\n\r\n/** Clamp helper (deterministic, NaN-safe via the final fallback). */\r\nfunction clamp(value: number, min: number, max: number): number {\r\n if (value < min) return min;\r\n if (value > max) return max;\r\n return value;\r\n}\r\n\r\n/**\r\n * Normalise raw params: enforce a positive mass/stiffness and a non-negative\r\n * damping so the downstream maths never produce NaN/Infinity.\r\n */\r\nfunction normalize(params: SpringParams): { k: number; c: number; m: number } {\r\n const m = params.mass != null && params.mass > 0 ? params.mass : DEFAULT_MASS;\r\n const k = params.stiffness > 0 ? params.stiffness : 1;\r\n const c = params.damping >= 0 ? params.damping : 0;\r\n return { k, c, m };\r\n}\r\n\r\n/** Natural angular frequency `w0 = sqrt(k / m)`. */\r\nfunction naturalFrequency(k: number, m: number): number {\r\n return Math.sqrt(k / m);\r\n}\r\n\r\n/** Damping ratio `zeta = c / (2 * sqrt(k * m))`. */\r\nfunction dampingRatio(k: number, c: number, m: number): number {\r\n const denom = 2 * Math.sqrt(k * m);\r\n return denom > 0 ? c / denom : 0;\r\n}\r\n\r\n/**\r\n * Estimate the spring settle time in milliseconds.\r\n *\r\n * The motion decays under the exponential envelope `exp(-zeta * w0 * t)`. The\r\n * system is considered settled once that envelope drops below\r\n * {@link SETTLE_THRESHOLD} (0.5%):\r\n *\r\n * exp(-zeta * w0 * t) = threshold\r\n * => t = -ln(threshold) / (zeta * w0)\r\n *\r\n * For over-damped systems (`zeta > 1`) the slow real root dominates the decay,\r\n * so we use the smaller-magnitude pole `s = w0 * (zeta - sqrt(zeta^2 - 1))`\r\n * instead of `zeta * w0`, which would otherwise badly under-estimate the tail.\r\n *\r\n * The result is clamped to a sensible UI range\r\n * [{@link MIN_DURATION_MS}, {@link MAX_DURATION_MS}].\r\n */\r\nexport function springDurationMs(params: SpringParams): number {\r\n const { k, c, m } = normalize(params);\r\n const w0 = naturalFrequency(k, m);\r\n const zeta = dampingRatio(k, c, m);\r\n\r\n // Effective decay rate (1/s). For under/critically-damped this is zeta*w0;\r\n // for over-damped the dominant (slowest) pole governs the tail.\r\n let decayRate: number;\r\n if (zeta > 1) {\r\n const root = Math.sqrt(zeta * zeta - 1);\r\n decayRate = w0 * (zeta - root);\r\n } else {\r\n decayRate = zeta * w0;\r\n }\r\n\r\n if (!(decayRate > 0) || !Number.isFinite(decayRate)) {\r\n // Undamped or degenerate: cap at the maximum.\r\n return MAX_DURATION_MS;\r\n }\r\n\r\n const settleSeconds = -Math.log(SETTLE_THRESHOLD) / decayRate;\r\n const settleMs = settleSeconds * 1000;\r\n return clamp(settleMs, MIN_DURATION_MS, MAX_DURATION_MS);\r\n}\r\n\r\n/**\r\n * Approximate a spring with a single CSS `cubic-bezier(x1,y1,x2,y2)` easing.\r\n *\r\n * LIMITATION: a cubic-bezier easing is monotonic in time and its output is\r\n * conceptually clamped to [0, 1] by the CSS engine for most properties, so it\r\n * **cannot represent overshoot/bounce**. For bouncy (under-damped) spatial\r\n * springs we therefore fall back to an expressive M3 decelerate curve\r\n * (`cubic-bezier(0.05, 0.7, 0.1, 1)` = `emphasizedDecelerate`) which reads as\r\n * a lively settle without the impossible overshoot. Use\r\n * {@link springToWaapiKeyframes} when real bounce is required.\r\n *\r\n * Control points are derived from the damping ratio `zeta`:\r\n * - low zeta (bouncy) -> sharper attack, snappier feel\r\n * - high zeta (smooth) -> gentle ease-out, closer to standard decelerate\r\n *\r\n * The mapping is deterministic and the control points are bounded to valid\r\n * cubic-bezier ranges (x in [0, 1]; y unbounded by spec but kept in [0, 1]).\r\n */\r\nexport function springToCssEasing(params: SpringParams): string {\r\n const { k, c, m } = normalize(params);\r\n const zeta = dampingRatio(k, c, m);\r\n\r\n // Bouncy springs (visibly under-damped) overshoot, which a cubic-bezier\r\n // cannot express -> fall back to an expressive M3 decelerate.\r\n if (zeta < 0.85) {\r\n const [x1, y1, x2, y2] = [0.05, 0.7, 0.1, 1.0];\r\n return `cubic-bezier(${x1}, ${y1}, ${x2}, ${y2})`;\r\n }\r\n\r\n // For near-critical / over-damped springs we synthesise a decelerate\r\n // curve whose attack sharpens as zeta drops toward 1. Map zeta in\r\n // [0.85, ~2+] onto an interpolation factor t in [1, 0] (clamped), where\r\n // t=1 is the sharpest valid attack and t=0 a soft standard ease-out.\r\n const t = clamp((zeta - 0.85) / (1.6 - 0.85), 0, 1);\r\n\r\n // Endpoints of the interpolation:\r\n // sharp (t = 0): emphasized-ish decelerate, vivid attack\r\n // smooth (t = 1): standard decelerate, gentle\r\n const x1 = lerp(0.1, 0.0, t);\r\n const y1 = lerp(0.65, 0.0, t);\r\n const x2 = lerp(0.2, 0.0, t);\r\n const y2 = 1.0;\r\n\r\n return `cubic-bezier(${round(x1)}, ${round(y1)}, ${round(x2)}, ${round(y2)})`;\r\n}\r\n\r\nfunction lerp(a: number, b: number, t: number): number {\r\n return a + (b - a) * t;\r\n}\r\n\r\nfunction round(n: number): number {\r\n return Math.round(n * 1000) / 1000;\r\n}\r\n\r\n/**\r\n * Evaluate the analytical position of a unit-step damped spring at time `t`\r\n * (seconds), starting at rest at 0 and settling to 1.\r\n *\r\n * Closed-form solutions of `m x'' + c x' + k x = k` with `x(0)=0`, `x'(0)=0`:\r\n *\r\n * - Under-damped (zeta < 1):\r\n * x(t) = 1 - e^{-zeta w0 t} ( cos(wd t) + (zeta w0 / wd) sin(wd t) )\r\n * with wd = w0 sqrt(1 - zeta^2)\r\n * - Critically damped (zeta == 1):\r\n * x(t) = 1 - e^{-w0 t} (1 + w0 t)\r\n * - Over-damped (zeta > 1):\r\n * with poles s1,2 = -w0 (zeta -/+ sqrt(zeta^2 - 1)),\r\n * x(t) = 1 - ( s2 e^{s1 t} - s1 e^{s2 t} ) / (s2 - s1)\r\n *\r\n * The under-damped branch is the only one that can return values > 1\r\n * (overshoot). The `wd` divide is guarded: it is only used when\r\n * `1 - zeta^2 > 0`, so there is no division by zero at the regime boundaries.\r\n */\r\nfunction springPosition(t: number, w0: number, zeta: number): number {\r\n if (t <= 0) return 0;\r\n\r\n if (zeta < 1 - 1e-6) {\r\n // Under-damped.\r\n const wd = w0 * Math.sqrt(1 - zeta * zeta);\r\n const envelope = Math.exp(-zeta * w0 * t);\r\n const osc = Math.cos(wd * t) + ((zeta * w0) / wd) * Math.sin(wd * t);\r\n return 1 - envelope * osc;\r\n }\r\n\r\n if (zeta <= 1 + 1e-6) {\r\n // Critically damped (treat the boundary band as critical for stability).\r\n const envelope = Math.exp(-w0 * t);\r\n return 1 - envelope * (1 + w0 * t);\r\n }\r\n\r\n // Over-damped: two distinct real poles.\r\n const root = Math.sqrt(zeta * zeta - 1);\r\n const s1 = -w0 * (zeta - root);\r\n const s2 = -w0 * (zeta + root);\r\n const e1 = Math.exp(s1 * t);\r\n const e2 = Math.exp(s2 * t);\r\n return 1 - (s2 * e1 - s1 * e2) / (s2 - s1);\r\n}\r\n\r\n/**\r\n * Sample the analytical damped-spring solution into WAAPI-ready data.\r\n *\r\n * Returns {@link SpringWaapi} containing:\r\n * - `samples`: `{ offset, value }[]` of the progress curve (value in `from`\r\n * -> `to` units; may overshoot past `to` for under-damped springs),\r\n * - `keyframes`: `Keyframe[]` carrying only `offset` unless `opts.property`\r\n * is given (see below),\r\n * - `options`: `{ duration, easing: \"linear\" }` — easing is `linear`\r\n * because the spring shape is fully baked into the per-frame samples.\r\n *\r\n * Options:\r\n * - `steps` : number of samples (default {@link DEFAULT_STEPS}, min 2).\r\n * - `from`/`to` : start/end values (defaults 0 -> 1).\r\n * - `property` + `unit`/`format` : project samples onto a CSS property so the\r\n * returned `keyframes` are directly consumable by `element.animate`.\r\n *\r\n * Examples:\r\n * springToWaapiKeyframes(p, { property: \"transform\", format: (v) => `translateX(${v}px)`, from: 100, to: 0 })\r\n * springToWaapiKeyframes(p, { property: \"opacity\" })\r\n *\r\n * The first sample is exactly `{ offset: 0, value: from }`; the last is\r\n * `{ offset: 1, value: to }` (snapped to the rest position so the animation\r\n * always finishes precisely on target, even though the analytical value at the\r\n * truncated settle time may differ by the sub-threshold tail).\r\n */\r\nexport function springToWaapiKeyframes(\r\n params: SpringParams,\r\n opts?: {\r\n steps?: number;\r\n from?: number;\r\n to?: number;\r\n /** CSS property name to emit on each keyframe (e.g. \"transform\"). */\r\n property?: string;\r\n /** Format a numeric value into the property string (overrides `unit`). */\r\n format?: (value: number) => string;\r\n /** Unit suffix when `format` is absent (e.g. \"px\", \"%\"). */\r\n unit?: string;\r\n },\r\n): SpringWaapi {\r\n const { k, c, m } = normalize(params);\r\n const w0 = naturalFrequency(k, m);\r\n const zeta = dampingRatio(k, c, m);\r\n\r\n const steps = Math.max(2, Math.floor(opts?.steps ?? DEFAULT_STEPS));\r\n const from = opts?.from ?? 0;\r\n const to = opts?.to ?? 1;\r\n const span = to - from;\r\n\r\n const duration = springDurationMs(params);\r\n const durationSeconds = duration / 1000;\r\n\r\n const samples: SpringSample[] = [];\r\n for (let i = 0; i < steps; i++) {\r\n const offset = i / (steps - 1);\r\n let value: number;\r\n if (i === 0) {\r\n value = from;\r\n } else if (i === steps - 1) {\r\n // Snap the final frame exactly to the target.\r\n value = to;\r\n } else {\r\n const t = offset * durationSeconds;\r\n const progress = springPosition(t, w0, zeta);\r\n value = from + span * progress;\r\n }\r\n samples.push({ offset, value });\r\n }\r\n\r\n const keyframes = opts?.property\r\n ? buildKeyframes(samples, opts.property, opts.format, opts.unit)\r\n : samples.map((s) => ({ offset: s.offset }) as Keyframe);\r\n\r\n return {\r\n samples,\r\n keyframes,\r\n // Easing is linear: the spring's shape is encoded in the samples\r\n // themselves, so the browser must interpolate them at constant rate.\r\n options: { duration, easing: \"linear\" },\r\n };\r\n}\r\n\r\n/**\r\n * Project spring {@link SpringSample}s onto a CSS property, returning\r\n * `Keyframe[]` ready for `element.animate`.\r\n *\r\n * @param samples output of {@link springToWaapiKeyframes}.\r\n * @param property CSS property name, e.g. \"transform\" or \"opacity\".\r\n * @param format optional formatter (value -> CSS string); overrides `unit`.\r\n * @param unit unit suffix used when no `format` is given (default \"\").\r\n */\r\nexport function springKeyframesForProperty(\r\n samples: readonly SpringSample[],\r\n property: string,\r\n format?: (value: number) => string,\r\n unit?: string,\r\n): Keyframe[] {\r\n return buildKeyframes(samples, property, format, unit);\r\n}\r\n\r\nfunction buildKeyframes(\r\n samples: readonly SpringSample[],\r\n property: string,\r\n format?: (value: number) => string,\r\n unit?: string,\r\n): Keyframe[] {\r\n const suffix = unit ?? \"\";\r\n return samples.map((s) => {\r\n const css = format ? format(s.value) : `${s.value}${suffix}`;\r\n // `Keyframe` indexes string property names, so a dynamic key is valid.\r\n return { offset: s.offset, [property]: css } as Keyframe;\r\n });\r\n}\r\n\r\n/**\r\n * Spring preset shape as authored in {@link m3Springs} (a Motion `Transition`\r\n * augmented with the physical fields). Kept minimal so we depend only on the\r\n * numeric fields, not on the full Motion type.\r\n */\r\nexport interface SpringPresetLike {\r\n stiffness?: number;\r\n damping?: number;\r\n mass?: number;\r\n}\r\n\r\n/**\r\n * Extract {@link SpringParams} from an {@link m3Springs} entry (or any\r\n * compatible preset object) for reuse on the Lit / WAAPI side.\r\n *\r\n * Missing fields fall back to the `default.spatial` M3 preset values so the\r\n * result is always a usable, finite spring.\r\n *\r\n * @example\r\n * springFromPreset(m3Springs.default.spatial) // { stiffness: 220, damping: 17, mass: 1 }\r\n */\r\nexport function springFromPreset(preset: SpringPresetLike): SpringParams {\r\n return {\r\n stiffness: preset.stiffness != null && preset.stiffness > 0 ? preset.stiffness : 220,\r\n damping: preset.damping != null && preset.damping >= 0 ? preset.damping : 17,\r\n mass: preset.mass != null && preset.mass > 0 ? preset.mass : DEFAULT_MASS,\r\n };\r\n}\r\n","import * as React from \"react\";\r\nimport { motion, AnimatePresence } from \"motion/react\";\r\nimport type { HTMLMotionProps } from \"motion/react\";\r\nimport { m3Easings, m3Durations } from \"../easings.js\";\r\n\r\nexport interface M3FadeProps extends HTMLMotionProps<\"div\"> {\r\n /**\r\n * If true, the component will transition in. If false, it will transition out.\r\n * If omitted, the component behaves as a standard motion element meant to be unmounted/mounted\r\n * by an external <AnimatePresence>.\r\n */\r\n in?: boolean;\r\n /**\r\n * If true, animate the transition on initial mount.\r\n * @default true\r\n */\r\n appear?: boolean;\r\n}\r\n\r\n/**\r\n * M3Fade transition component.\r\n * Fades elements in/out using Material 3 standard decelerate/accelerate curves.\r\n */\r\nexport const M3Fade = React.forwardRef<HTMLDivElement, M3FadeProps>(\r\n ({ in: inProp, appear = true, children, ...props }, ref) => {\r\n const variants = {\r\n initial: { opacity: 0 },\r\n animate: {\r\n opacity: 1,\r\n transition: {\r\n ease: m3Easings.emphasizedDecelerate,\r\n duration: m3Durations.medium2,\r\n },\r\n },\r\n exit: {\r\n opacity: 0,\r\n transition: {\r\n ease: m3Easings.emphasizedAccelerate,\r\n duration: m3Durations.short4,\r\n },\r\n },\r\n };\r\n\r\n const content = (\r\n <motion.div\r\n ref={ref}\r\n variants={variants}\r\n initial={appear ? \"initial\" : false}\r\n animate=\"animate\"\r\n exit=\"exit\"\r\n style={{ willChange: \"opacity\" }}\r\n {...props}\r\n >\r\n {children}\r\n </motion.div>\r\n );\r\n\r\n if (inProp !== undefined) {\r\n return <AnimatePresence>{inProp ? content : null}</AnimatePresence>;\r\n }\r\n\r\n return content;\r\n },\r\n);\r\n\r\nM3Fade.displayName = \"M3Fade\";\r\n","import * as React from \"react\";\r\nimport { motion, AnimatePresence } from \"motion/react\";\r\nimport type { HTMLMotionProps, Transition, Variants } from \"motion/react\";\r\nimport { m3Easings, m3Durations } from \"../easings.js\";\r\n\r\nexport interface M3SharedAxisProps extends HTMLMotionProps<\"div\"> {\r\n /**\r\n * If true, the component will transition in. If false, it will transition out.\r\n * If omitted, the component behaves as a standard motion element meant to be unmounted/mounted\r\n * by an external <AnimatePresence>.\r\n */\r\n in?: boolean;\r\n /**\r\n * Axis of translation.\r\n * @default \"x\"\r\n */\r\n axis?: \"x\" | \"y\" | \"z\";\r\n /**\r\n * Direction of navigation. If true, slides forward/up/zoom-in. If false, slides backward/down/zoom-out.\r\n * @default true\r\n */\r\n forward?: boolean;\r\n /**\r\n * If true, animate the transition on initial mount.\r\n * @default true\r\n */\r\n appear?: boolean;\r\n /**\r\n * Custom transition for the shared axis animation.\r\n */\r\n transition?: Transition;\r\n}\r\n\r\n/**\r\n * M3SharedAxis transition component.\r\n * Implements the Material 3 Shared Axis motion pattern (X, Y, Z axes).\r\n */\r\nexport const M3SharedAxis = React.forwardRef<HTMLDivElement, M3SharedAxisProps>(\r\n ({ in: inProp, axis = \"x\", forward = true, appear = true, transition: customTransition, variants: customVariants, children, ...props }, ref) => {\r\n // Offset values according to M3 specifications (usually 30px translation or ~8% scale change)\r\n const translateOffset = 30;\r\n const scaleOffset = 0.08;\r\n\r\n const defaultVariants: Variants = {\r\n initial: {\r\n opacity: 0,\r\n x: axis === \"x\" ? (forward ? translateOffset : -translateOffset) : 0,\r\n y: axis === \"y\" ? (forward ? translateOffset : -translateOffset) : 0,\r\n scale: axis === \"z\" ? (forward ? 1 - scaleOffset : 1 + scaleOffset) : 1,\r\n },\r\n animate: {\r\n opacity: 1,\r\n x: 0,\r\n y: 0,\r\n scale: 1,\r\n transition: customTransition || {\r\n x: { ease: m3Easings.emphasizedDecelerate, duration: m3Durations.medium2 },\r\n y: { ease: m3Easings.emphasizedDecelerate, duration: m3Durations.medium2 },\r\n scale: { ease: m3Easings.emphasizedDecelerate, duration: m3Durations.medium2 },\r\n opacity: { ease: m3Easings.standard, duration: m3Durations.medium2 },\r\n },\r\n },\r\n exit: {\r\n opacity: 0,\r\n x: axis === \"x\" ? (forward ? -translateOffset : translateOffset) : 0,\r\n y: axis === \"y\" ? (forward ? -translateOffset : translateOffset) : 0,\r\n scale: axis === \"z\" ? (forward ? 1 + scaleOffset : 1 - scaleOffset) : 1,\r\n transition: customTransition || {\r\n x: { ease: m3Easings.emphasizedAccelerate, duration: m3Durations.short4 },\r\n y: { ease: m3Easings.emphasizedAccelerate, duration: m3Durations.short4 },\r\n scale: { ease: m3Easings.emphasizedAccelerate, duration: m3Durations.short4 },\r\n opacity: { ease: m3Easings.standard, duration: m3Durations.short4 },\r\n },\r\n },\r\n };\r\n\r\n const resolvedVariants = customVariants || defaultVariants;\r\n\r\n const content = (\r\n <motion.div\r\n ref={ref}\r\n variants={resolvedVariants}\r\n initial={appear ? \"initial\" : false}\r\n animate=\"animate\"\r\n exit=\"exit\"\r\n style={{ willChange: \"opacity, transform\" }}\r\n {...props}\r\n >\r\n {children}\r\n </motion.div>\r\n );\r\n\r\n if (inProp !== undefined) {\r\n return <AnimatePresence mode=\"wait\">{inProp ? content : null}</AnimatePresence>;\r\n }\r\n\r\n return content;\r\n },\r\n);\r\n\r\nM3SharedAxis.displayName = \"M3SharedAxis\";\r\n\r\n","import * as React from \"react\";\r\nimport { motion, AnimatePresence } from \"motion/react\";\r\nimport type { HTMLMotionProps, Transition, Variants } from \"motion/react\";\r\nimport { m3Easings } from \"../easings.js\";\r\n\r\nexport interface M3FadeThroughProps extends HTMLMotionProps<\"div\"> {\r\n /**\r\n * Unique key representing the active view/content. Changing this key triggers the transition.\r\n */\r\n stateKey: React.Key;\r\n /**\r\n * Custom transition for the fade through animation.\r\n */\r\n transition?: Transition;\r\n}\r\n\r\n/**\r\n * M3FadeThrough transition component.\r\n * Implements the Material 3 Fade Through navigation pattern.\r\n * The outgoing element fades out over 90ms, followed by the incoming element fading in and scaling up over 210ms.\r\n */\r\nexport const M3FadeThrough: React.FC<M3FadeThroughProps> = ({ stateKey, transition: customTransition, variants: customVariants, children, ...props }) => {\r\n const defaultVariants: Variants = {\r\n initial: {\r\n opacity: 0,\r\n scale: 0.92,\r\n },\r\n animate: {\r\n opacity: 1,\r\n scale: 1,\r\n transition: customTransition || {\r\n opacity: {\r\n ease: m3Easings.emphasizedDecelerate,\r\n duration: 0.21,\r\n },\r\n scale: {\r\n ease: m3Easings.emphasizedDecelerate,\r\n duration: 0.21,\r\n },\r\n },\r\n },\r\n exit: {\r\n opacity: 0,\r\n transition: customTransition || {\r\n opacity: {\r\n ease: m3Easings.emphasizedAccelerate,\r\n duration: 0.09,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const resolvedVariants = customVariants || defaultVariants;\r\n\r\n return (\r\n <AnimatePresence mode=\"wait\">\r\n <motion.div\r\n key={stateKey}\r\n variants={resolvedVariants}\r\n initial=\"initial\"\r\n animate=\"animate\"\r\n exit=\"exit\"\r\n style={{ willChange: \"opacity, transform\" }}\r\n {...props}\r\n >\r\n {children}\r\n </motion.div>\r\n </AnimatePresence>\r\n );\r\n};\r\n\r\nM3FadeThrough.displayName = \"M3FadeThrough\";\r\n\r\n","import * as React from \"react\";\r\nimport { motion, AnimatePresence } from \"motion/react\";\r\nimport type { HTMLMotionProps } from \"motion/react\";\r\nimport { m3Easings, m3Durations } from \"../easings.js\";\r\n\r\nexport interface M3CollapseProps extends HTMLMotionProps<\"div\"> {\r\n /**\r\n * If true, the component expands. If false, it collapses.\r\n * If omitted, the component behaves as a standard motion element meant to be unmounted/mounted\r\n * by an external <AnimatePresence>.\r\n */\r\n in?: boolean;\r\n /**\r\n * If true, animate the transition on initial mount.\r\n * @default false\r\n */\r\n appear?: boolean;\r\n}\r\n\r\n/**\r\n * M3Collapse transition component.\r\n * Animates the height and opacity of its children, perfect for accordions, menus, or disclosures.\r\n */\r\nexport const M3Collapse = React.forwardRef<HTMLDivElement, M3CollapseProps>(\r\n ({ in: inProp, appear = false, children, ...props }, ref) => {\r\n const variants = {\r\n initial: { height: 0, opacity: 0 },\r\n animate: {\r\n height: \"auto\",\r\n opacity: 1,\r\n transition: {\r\n height: {\r\n ease: m3Easings.emphasized,\r\n duration: m3Durations.medium4,\r\n },\r\n opacity: {\r\n ease: m3Easings.standard,\r\n duration: m3Durations.medium2,\r\n },\r\n },\r\n },\r\n exit: {\r\n height: 0,\r\n opacity: 0,\r\n transition: {\r\n height: {\r\n ease: m3Easings.emphasized,\r\n duration: m3Durations.medium4,\r\n },\r\n opacity: {\r\n ease: m3Easings.standard,\r\n duration: m3Durations.medium2,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const content = (\r\n <motion.div\r\n ref={ref}\r\n variants={variants}\r\n initial={appear ? \"initial\" : false}\r\n animate=\"animate\"\r\n exit=\"exit\"\r\n style={{ overflow: \"hidden\", willChange: \"height, opacity\" }}\r\n {...props}\r\n >\r\n {children}\r\n </motion.div>\r\n );\r\n\r\n if (inProp !== undefined) {\r\n return <AnimatePresence initial={appear}>{inProp ? content : null}</AnimatePresence>;\r\n }\r\n\r\n return content;\r\n },\r\n);\r\n\r\nM3Collapse.displayName = \"M3Collapse\";\r\n","import * as React from \"react\";\r\nimport { motion } from \"motion/react\";\r\nimport type { HTMLMotionProps, Transition, MotionStyle } from \"motion/react\";\r\nimport { m3Springs } from \"../springs.js\";\r\nimport { m3Easings } from \"../easings.js\";\r\n\r\nexport interface M3ContainerTransformProps extends HTMLMotionProps<\"div\"> {\r\n /**\r\n * Shared identifier linking the starting container (e.g., card) and ending container (e.g., detail page).\r\n */\r\n layoutId?: string;\r\n /**\r\n * Speed preset to use for the morphing animation.\r\n * @default \"default\"\r\n */\r\n speed?: \"fast\" | \"default\" | \"slow\";\r\n /**\r\n * If true, renders the expanded container state.\r\n * @default false\r\n */\r\n isExpanded?: boolean;\r\n}\r\n\r\nexport interface M3ContainerTransformContextValue {\r\n isExpanded: boolean;\r\n speed: \"fast\" | \"default\" | \"slow\";\r\n}\r\n\r\nexport const M3ContainerTransformContext = React.createContext<M3ContainerTransformContextValue | null>(null);\r\n\r\n/**\r\n * Helper function to generate spec-compliant cross-fade timings.\r\n */\r\nfunction getDefaultTransition(isActive: boolean, speed: \"fast\" | \"default\" | \"slow\"): Transition {\r\n if (speed === \"fast\") {\r\n return isActive\r\n ? { delay: 0.05, duration: 0.15, ease: m3Easings.emphasizedDecelerate }\r\n : { duration: 0.08, ease: m3Easings.emphasizedAccelerate };\r\n }\r\n if (speed === \"slow\") {\r\n return isActive\r\n ? { delay: 0.2, duration: 0.6, ease: m3Easings.emphasizedDecelerate }\r\n : { duration: 0.25, ease: m3Easings.emphasizedAccelerate };\r\n }\r\n // Default speed\r\n return isActive\r\n ? { delay: 0.1, duration: 0.35, ease: m3Easings.emphasizedDecelerate }\r\n : { duration: 0.15, ease: m3Easings.emphasizedAccelerate };\r\n}\r\n\r\n/**\r\n * M3ContainerTransform component.\r\n * Implements the Material 3 Container Transform motion pattern using shared element transitions.\r\n * Use the same layoutId on both source and target containers to morph them smoothly.\r\n */\r\nexport const M3ContainerTransform = React.forwardRef<HTMLDivElement, M3ContainerTransformProps>(\r\n ({ layoutId, speed = \"default\", isExpanded = false, children, transition, style, ...props }, ref) => {\r\n // Select the M3 spatial spring configuration based on speed\r\n const springConfig = m3Springs[speed].spatial;\r\n\r\n const contextValue = React.useMemo(\r\n () => ({ isExpanded, speed }),\r\n [isExpanded, speed]\r\n );\r\n\r\n return (\r\n <M3ContainerTransformContext.Provider value={contextValue}>\r\n <motion.div\r\n ref={ref}\r\n layoutId={layoutId}\r\n layout\r\n transition={transition || springConfig}\r\n style={{\r\n willChange: \"transform, border-radius\",\r\n overflow: \"hidden\",\r\n ...style,\r\n }}\r\n {...props}\r\n >\r\n {children}\r\n </motion.div>\r\n </M3ContainerTransformContext.Provider>\r\n );\r\n },\r\n);\r\n\r\nM3ContainerTransform.displayName = \"M3ContainerTransform\";\r\n\r\nexport interface M3ContainerTransformStartProps extends HTMLMotionProps<\"div\"> {\r\n /**\r\n * Overrides the active state. By default, active when isExpanded is false.\r\n */\r\n active?: boolean;\r\n}\r\n\r\n/**\r\n * M3ContainerTransformStart component.\r\n * Represents the starting content (e.g., Card content) inside M3ContainerTransform.\r\n * Prevents aspect ratio distortion and fades out during the container transform morph.\r\n */\r\nexport const M3ContainerTransformStart = React.forwardRef<HTMLDivElement, M3ContainerTransformStartProps>(\r\n ({ active, children, style, transition, layout = \"position\", ...props }, ref) => {\r\n const context = React.useContext(M3ContainerTransformContext);\r\n const isActive = active ?? (context ? !context.isExpanded : true);\r\n const speed = context?.speed ?? \"default\";\r\n\r\n const baseStyle: MotionStyle = {\r\n width: \"100%\",\r\n height: \"100%\",\r\n boxSizing: \"border-box\",\r\n pointerEvents: isActive ? \"auto\" : \"none\",\r\n ...(!isActive && {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n }),\r\n ...style,\r\n };\r\n\r\n const resolvedTransition = transition || getDefaultTransition(isActive, speed);\r\n\r\n return (\r\n <motion.div\r\n ref={ref}\r\n layout={layout}\r\n animate={{ opacity: isActive ? 1 : 0 }}\r\n transition={resolvedTransition}\r\n style={baseStyle}\r\n {...props}\r\n >\r\n {children}\r\n </motion.div>\r\n );\r\n },\r\n);\r\n\r\nM3ContainerTransformStart.displayName = \"M3ContainerTransformStart\";\r\n\r\nexport interface M3ContainerTransformEndProps extends HTMLMotionProps<\"div\"> {\r\n /**\r\n * Overrides the active state. By default, active when isExpanded is true.\r\n */\r\n active?: boolean;\r\n}\r\n\r\n/**\r\n * M3ContainerTransformEnd component.\r\n * Represents the target content (e.g., Detail page content) inside M3ContainerTransform.\r\n * Prevents aspect ratio distortion and fades in during the container transform morph.\r\n */\r\nexport const M3ContainerTransformEnd = React.forwardRef<HTMLDivElement, M3ContainerTransformEndProps>(\r\n ({ active, children, style, transition, layout = \"position\", ...props }, ref) => {\r\n const context = React.useContext(M3ContainerTransformContext);\r\n const isActive = active ?? (context ? context.isExpanded : true);\r\n const speed = context?.speed ?? \"default\";\r\n\r\n const baseStyle: MotionStyle = {\r\n width: \"100%\",\r\n height: \"100%\",\r\n boxSizing: \"border-box\",\r\n pointerEvents: isActive ? \"auto\" : \"none\",\r\n ...(!isActive && {\r\n position: \"absolute\",\r\n top: 0,\r\n left: 0,\r\n }),\r\n ...style,\r\n };\r\n\r\n const resolvedTransition = transition || getDefaultTransition(isActive, speed);\r\n\r\n return (\r\n <motion.div\r\n ref={ref}\r\n layout={layout}\r\n initial={{ opacity: 0 }}\r\n animate={{ opacity: isActive ? 1 : 0 }}\r\n transition={resolvedTransition}\r\n style={baseStyle}\r\n {...props}\r\n >\r\n {children}\r\n </motion.div>\r\n );\r\n },\r\n);\r\n\r\nM3ContainerTransformEnd.displayName = \"M3ContainerTransformEnd\";\r\n\r\n","\"use client\";\r\nimport * as React from \"react\";\r\nimport { AnimatePresence, motion } from \"motion/react\";\r\nimport type { HTMLMotionProps, MotionStyle, Transition, Variants } from \"motion/react\";\r\nimport { m3Easings, m3Durations } from \"../easings.js\";\r\n\r\nexport type M3TransitionPattern =\r\n | \"fade\"\r\n | \"fade-through\"\r\n | \"shared-axis-x\"\r\n | \"shared-axis-y\"\r\n | \"shared-axis-z\"\r\n | \"collapse\";\r\n\r\nexport interface M3TransitionProps extends Omit<HTMLMotionProps<\"div\">, \"variants\" | \"style\"> {\r\n style?: MotionStyle;\r\n /**\r\n * Unique key representing the active view/content. Changing this key triggers the transition.\r\n */\r\n stateKey: React.Key;\r\n /**\r\n * Which M3 transition pattern to apply.\r\n * @default \"fade\"\r\n */\r\n pattern?: M3TransitionPattern;\r\n /**\r\n * Direction of navigation for shared-axis-* patterns.\r\n * @default true\r\n */\r\n forward?: boolean;\r\n /**\r\n * Custom variants — overrides the pattern defaults entirely.\r\n */\r\n variants?: Variants;\r\n /**\r\n * AnimatePresence mode.\r\n * @default \"wait\"\r\n */\r\n mode?: \"wait\" | \"sync\" | \"popLayout\";\r\n}\r\n\r\nconst OFFSET = 30;\r\nconst SCALE_OFFSET = 0.08;\r\n\r\nfunction buildVariants(pattern: M3TransitionPattern, forward: boolean): Variants {\r\n const enterTransition: Transition = {\r\n ease: m3Easings.emphasizedDecelerate,\r\n duration: m3Durations.medium2,\r\n };\r\n const exitTransition: Transition = {\r\n ease: m3Easings.emphasizedAccelerate,\r\n duration: m3Durations.short4,\r\n };\r\n\r\n switch (pattern) {\r\n case \"fade-through\":\r\n return {\r\n initial: { opacity: 0, scale: 0.92 },\r\n animate: {\r\n opacity: 1,\r\n scale: 1,\r\n transition: {\r\n opacity: { ease: m3Easings.emphasizedDecelerate, duration: 0.21 },\r\n scale: { ease: m3Easings.emphasizedDecelerate, duration: 0.21 },\r\n },\r\n },\r\n exit: {\r\n opacity: 0,\r\n transition: { opacity: { ease: m3Easings.emphasizedAccelerate, duration: 0.09 } },\r\n },\r\n };\r\n case \"shared-axis-x\":\r\n return {\r\n initial: { opacity: 0, x: forward ? OFFSET : -OFFSET },\r\n animate: {\r\n opacity: 1,\r\n x: 0,\r\n transition: {\r\n x: enterTransition,\r\n opacity: { ease: m3Easings.standard, duration: m3Durations.medium2 },\r\n },\r\n },\r\n exit: {\r\n opacity: 0,\r\n x: forward ? -OFFSET : OFFSET,\r\n transition: {\r\n x: exitTransition,\r\n opacity: { ease: m3Easings.standard, duration: m3Durations.short4 },\r\n },\r\n },\r\n };\r\n case \"shared-axis-y\":\r\n return {\r\n initial: { opacity: 0, y: forward ? OFFSET : -OFFSET },\r\n animate: {\r\n opacity: 1,\r\n y: 0,\r\n transition: {\r\n y: enterTransition,\r\n opacity: { ease: m3Easings.standard, duration: m3Durations.medium2 },\r\n },\r\n },\r\n exit: {\r\n opacity: 0,\r\n y: forward ? -OFFSET : OFFSET,\r\n transition: {\r\n y: exitTransition,\r\n opacity: { ease: m3Easings.standard, duration: m3Durations.short4 },\r\n },\r\n },\r\n };\r\n case \"shared-axis-z\":\r\n return {\r\n initial: { opacity: 0, scale: forward ? 1 - SCALE_OFFSET : 1 + SCALE_OFFSET },\r\n animate: {\r\n opacity: 1,\r\n scale: 1,\r\n transition: {\r\n scale: enterTransition,\r\n opacity: { ease: m3Easings.standard, duration: m3Durations.medium2 },\r\n },\r\n },\r\n exit: {\r\n opacity: 0,\r\n scale: forward ? 1 + SCALE_OFFSET : 1 - SCALE_OFFSET,\r\n transition: {\r\n scale: exitTransition,\r\n opacity: { ease: m3Easings.standard, duration: m3Durations.short4 },\r\n },\r\n },\r\n };\r\n case \"collapse\":\r\n return {\r\n initial: { height: 0, opacity: 0 },\r\n animate: {\r\n height: \"auto\",\r\n opacity: 1,\r\n transition: {\r\n height: { ease: m3Easings.emphasized, duration: m3Durations.medium4 },\r\n opacity: { ease: m3Easings.standard, duration: m3Durations.medium2 },\r\n },\r\n },\r\n exit: {\r\n height: 0,\r\n opacity: 0,\r\n transition: {\r\n height: { ease: m3Easings.emphasized, duration: m3Durations.medium4 },\r\n opacity: { ease: m3Easings.standard, duration: m3Durations.medium2 },\r\n },\r\n },\r\n };\r\n case \"fade\":\r\n default:\r\n return {\r\n initial: { opacity: 0 },\r\n animate: { opacity: 1, transition: enterTransition },\r\n exit: { opacity: 0, transition: exitTransition },\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * M3Transition — generic Material 3 transition wrapper.\r\n * Supports all standard M3 patterns via the `pattern` prop.\r\n * The `stateKey` prop drives AnimatePresence re-mounts.\r\n */\r\nexport const M3Transition = React.forwardRef<HTMLDivElement, M3TransitionProps>(\r\n (\r\n {\r\n stateKey,\r\n pattern = \"fade\",\r\n forward = true,\r\n mode = \"wait\",\r\n variants,\r\n children,\r\n style,\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const resolvedVariants = variants ?? buildVariants(pattern, forward);\r\n const baseStyle: MotionStyle =\r\n pattern === \"collapse\" ? { overflow: \"hidden\" } : { willChange: \"opacity, transform\" };\r\n const resolvedStyle: MotionStyle = { ...baseStyle, ...style };\r\n\r\n return (\r\n <AnimatePresence mode={mode}>\r\n <motion.div\r\n key={stateKey}\r\n ref={ref}\r\n variants={resolvedVariants}\r\n initial=\"initial\"\r\n animate=\"animate\"\r\n exit=\"exit\"\r\n style={resolvedStyle}\r\n {...props}\r\n >\r\n {children}\r\n </motion.div>\r\n </AnimatePresence>\r\n );\r\n },\r\n);\r\n\r\nM3Transition.displayName = \"M3Transition\";\r\n","\"use client\";\r\nimport * as React from \"react\";\r\nimport { AnimatePresence, motion } from \"motion/react\";\r\nimport type { HTMLMotionProps, Variants } from \"motion/react\";\r\nimport { m3Easings, m3Durations } from \"../easings.js\";\r\n\r\nexport interface M3ListStaggerProps {\r\n /**\r\n * Delay between each child item entering the scene (seconds).\r\n * @default 0.05\r\n */\r\n staggerDelay?: number;\r\n /**\r\n * Delay before the stagger sequence starts (seconds).\r\n * @default 0\r\n */\r\n delayChildren?: number;\r\n /**\r\n * If true, items animate on initial render.\r\n * @default true\r\n */\r\n appear?: boolean;\r\n className?: string;\r\n style?: React.CSSProperties;\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport interface M3ListStaggerItemProps extends HTMLMotionProps<\"div\"> {\r\n children?: React.ReactNode;\r\n}\r\n\r\nconst containerVariants: Variants = {\r\n hidden: {},\r\n visible: (_custom: { staggerDelay: number; delayChildren: number }) => ({\r\n transition: {\r\n staggerChildren: _custom.staggerDelay,\r\n delayChildren: _custom.delayChildren,\r\n },\r\n }),\r\n exit: {},\r\n};\r\n\r\nconst itemVariants: Variants = {\r\n hidden: { opacity: 0, y: 8 },\r\n visible: {\r\n opacity: 1,\r\n y: 0,\r\n transition: {\r\n ease: m3Easings.emphasizedDecelerate,\r\n duration: m3Durations.medium2,\r\n },\r\n },\r\n exit: {\r\n opacity: 0,\r\n y: 4,\r\n transition: {\r\n ease: m3Easings.emphasizedAccelerate,\r\n duration: m3Durations.short3,\r\n },\r\n },\r\n};\r\n\r\n/**\r\n * M3ListStagger — stagger container for list-item enter/exit animations.\r\n *\r\n * Usage:\r\n * <M3ListStagger>\r\n * {items.map(item => <M3ListStaggerItem key={item.id}>{item.label}</M3ListStaggerItem>)}\r\n * </M3ListStagger>\r\n */\r\nexport const M3ListStagger = React.forwardRef<HTMLDivElement, M3ListStaggerProps>(\r\n ({ staggerDelay = 0.05, delayChildren = 0, appear = true, children, className, style }, ref) => {\r\n return (\r\n <AnimatePresence>\r\n <motion.div\r\n ref={ref}\r\n className={className}\r\n style={style}\r\n variants={containerVariants}\r\n initial={appear ? \"hidden\" : false}\r\n animate=\"visible\"\r\n exit=\"exit\"\r\n custom={{ staggerDelay, delayChildren }}\r\n >\r\n {children}\r\n </motion.div>\r\n </AnimatePresence>\r\n );\r\n },\r\n);\r\n\r\nM3ListStagger.displayName = \"M3ListStagger\";\r\n\r\n/**\r\n * M3ListStaggerItem — a single animated item inside M3ListStagger.\r\n * Must be a direct or indirect descendant of M3ListStagger to inherit variants.\r\n */\r\nexport const M3ListStaggerItem = React.forwardRef<HTMLDivElement, M3ListStaggerItemProps>(\r\n ({ children, style, ...props }, ref) => {\r\n return (\r\n <motion.div\r\n ref={ref}\r\n variants={itemVariants}\r\n style={{ willChange: \"opacity, transform\", ...style }}\r\n {...props}\r\n >\r\n {children}\r\n </motion.div>\r\n );\r\n },\r\n);\r\n\r\nM3ListStaggerItem.displayName = \"M3ListStaggerItem\";\r\n","import { useAnimate } from \"motion/react\";\r\nimport type {\r\n AnimationScope,\r\n AnimationPlaybackControlsWithThen,\r\n AnimationSequence,\r\n SequenceOptions,\r\n ElementOrSelector,\r\n DOMKeyframesDefinition,\r\n AnimationOptions,\r\n MotionValue,\r\n UnresolvedValueKeyframe,\r\n ValueAnimationTransition,\r\n ObjectTarget,\r\n} from \"motion/react\";\r\nimport { m3Easings, m3Durations } from \"../easings.js\";\r\n\r\n/**\r\n * Overloaded type for the scoped animate function returned by useM3Animate.\r\n * Mirrors the overload set of the underlying motion animate, adding M3 defaults.\r\n */\r\nexport interface M3AnimateFn {\r\n (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen;\r\n (\r\n value: string | MotionValue<string>,\r\n keyframes: string | UnresolvedValueKeyframe<string>[],\r\n options?: ValueAnimationTransition<string>,\r\n ): AnimationPlaybackControlsWithThen;\r\n (\r\n value: number | MotionValue<number>,\r\n keyframes: number | UnresolvedValueKeyframe<number>[],\r\n options?: ValueAnimationTransition<number>,\r\n ): AnimationPlaybackControlsWithThen;\r\n <V extends string | number>(\r\n value: V | MotionValue<V>,\r\n keyframes: V | UnresolvedValueKeyframe<V>[],\r\n options?: ValueAnimationTransition<V>,\r\n ): AnimationPlaybackControlsWithThen;\r\n (\r\n element: ElementOrSelector,\r\n keyframes: DOMKeyframesDefinition,\r\n options?: AnimationOptions,\r\n ): AnimationPlaybackControlsWithThen;\r\n <O extends object>(\r\n object: O | O[],\r\n keyframes: ObjectTarget<O>,\r\n options?: AnimationOptions,\r\n ): AnimationPlaybackControlsWithThen;\r\n}\r\n\r\n/**\r\n * A custom hook wrapping motion's `useAnimate` that injects Material 3 motion defaults\r\n * (emphasized easing and medium2 duration) for all imperative DOM animations.\r\n *\r\n * SSR-safe: useAnimate creates refs; no DOM access occurs at module or render time.\r\n */\r\nexport function useM3Animate<T extends Element = HTMLElement>(): [AnimationScope<T>, M3AnimateFn] {\r\n const [scope, animate] = useAnimate<T>();\r\n\r\n const m3Animate: M3AnimateFn = (\r\n elementOrSelector: unknown,\r\n keyframes?: unknown,\r\n options?: unknown,\r\n ) => {\r\n if (Array.isArray(elementOrSelector)) {\r\n // Sequence overload\r\n return (animate as CallableFunction)(\r\n elementOrSelector,\r\n keyframes as SequenceOptions,\r\n ) as AnimationPlaybackControlsWithThen;\r\n }\r\n\r\n if (\r\n typeof elementOrSelector === \"string\" ||\r\n elementOrSelector instanceof Element ||\r\n (typeof elementOrSelector === \"object\" &&\r\n elementOrSelector !== null &&\r\n \"current\" in elementOrSelector) ||\r\n typeof elementOrSelector === \"number\" ||\r\n (typeof elementOrSelector === \"object\" &&\r\n elementOrSelector !== null &&\r\n \"get\" in elementOrSelector)\r\n ) {\r\n return (animate as CallableFunction)(elementOrSelector, keyframes, {\r\n ease: m3Easings.emphasized,\r\n duration: m3Durations.medium2,\r\n ...(typeof options === \"object\" && options !== null ? options : {}),\r\n }) as AnimationPlaybackControlsWithThen;\r\n }\r\n\r\n return (animate as CallableFunction)(elementOrSelector, keyframes, {\r\n ease: m3Easings.emphasized,\r\n duration: m3Durations.medium2,\r\n ...(typeof options === \"object\" && options !== null ? options : {}),\r\n }) as AnimationPlaybackControlsWithThen;\r\n };\r\n\r\n return [scope, m3Animate];\r\n}\r\n"]}
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Physical spring interpolation for the Web platform (M3 Expressive, Phase 3.1).
3
+ *
4
+ * The React components in this package drive springs through `motion/react`,
5
+ * which runs a per-frame numerical integrator. Lit components from
6
+ * `@material/web` live inside a Shadow DOM and have no access to Motion, so
7
+ * they can only animate through CSS transitions (a single `cubic-bezier`) or
8
+ * the Web Animations API (`element.animate(keyframes, options)`).
9
+ *
10
+ * This module is the bridge: it turns the same physical spring parameters
11
+ * (`stiffness` / `damping` / `mass`) used by {@link m3Springs} into:
12
+ *
13
+ * 1. a settle-time estimate in milliseconds ({@link springDurationMs}),
14
+ * 2. a single `cubic-bezier(...)` CSS easing approximation
15
+ * ({@link springToCssEasing}), and
16
+ * 3. an exact sampling of the analytical damped-spring solution as WAAPI
17
+ * keyframes ({@link springToWaapiKeyframes}), which — unlike a
18
+ * cubic-bezier — preserves overshoot/bounce.
19
+ *
20
+ * All functions are pure, deterministic and SSR-safe: there is no DOM access
21
+ * at module load or call time. `Keyframe` is referenced only as a DOM lib
22
+ * type. The maths handle the three damping regimes (under-, critically- and
23
+ * over-damped) without dividing by zero.
24
+ *
25
+ * Physical model (mass-spring-damper, m x'' + c x' + k x = 0):
26
+ * - natural angular frequency w0 = sqrt(k / m)
27
+ * - damping ratio zeta = c / (2 * sqrt(k * m))
28
+ * - damped angular frequency wd = w0 * sqrt(1 - zeta^2) (under-damped)
29
+ *
30
+ * Here `k` = stiffness, `c` = damping, `m` = mass.
31
+ */
32
+ /** Physical parameters of a mass-spring-damper system. */
33
+ export interface SpringParams {
34
+ /** Spring stiffness `k` (> 0). Higher = snappier. */
35
+ stiffness: number;
36
+ /** Damping coefficient `c` (>= 0). Higher = less / no bounce. */
37
+ damping: number;
38
+ /** Mass `m` (> 0). Defaults to 1. Higher = slower, heavier feel. */
39
+ mass?: number;
40
+ }
41
+ /** One sample of the analytical spring solution, progress-normalised. */
42
+ export interface SpringSample {
43
+ /** Timeline position in [0, 1]. */
44
+ offset: number;
45
+ /**
46
+ * Animated value at this offset. With `from`/`to` defaults (0 -> 1) this
47
+ * is the normalised progress and may exceed 1 (overshoot) for
48
+ * under-damped springs — that is the whole point of WAAPI sampling.
49
+ */
50
+ value: number;
51
+ }
52
+ /** Result bundle for WAAPI consumption. */
53
+ export interface SpringWaapi {
54
+ /** Progress-normalised samples (always present, easy to remap). */
55
+ samples: SpringSample[];
56
+ /**
57
+ * Ready-to-use `Keyframe[]`. Empty `{ offset }`-only objects unless a
58
+ * property mapper is supplied via {@link springToWaapiKeyframes} options;
59
+ * use {@link springKeyframesForProperty} to project `samples` onto a CSS
60
+ * property such as `transform` or `opacity`.
61
+ */
62
+ keyframes: Keyframe[];
63
+ /** WAAPI `KeyframeEffectOptions`-compatible timing. */
64
+ options: {
65
+ duration: number;
66
+ easing: string;
67
+ };
68
+ }
69
+ /**
70
+ * Estimate the spring settle time in milliseconds.
71
+ *
72
+ * The motion decays under the exponential envelope `exp(-zeta * w0 * t)`. The
73
+ * system is considered settled once that envelope drops below
74
+ * {@link SETTLE_THRESHOLD} (0.5%):
75
+ *
76
+ * exp(-zeta * w0 * t) = threshold
77
+ * => t = -ln(threshold) / (zeta * w0)
78
+ *
79
+ * For over-damped systems (`zeta > 1`) the slow real root dominates the decay,
80
+ * so we use the smaller-magnitude pole `s = w0 * (zeta - sqrt(zeta^2 - 1))`
81
+ * instead of `zeta * w0`, which would otherwise badly under-estimate the tail.
82
+ *
83
+ * The result is clamped to a sensible UI range
84
+ * [{@link MIN_DURATION_MS}, {@link MAX_DURATION_MS}].
85
+ */
86
+ export declare function springDurationMs(params: SpringParams): number;
87
+ /**
88
+ * Approximate a spring with a single CSS `cubic-bezier(x1,y1,x2,y2)` easing.
89
+ *
90
+ * LIMITATION: a cubic-bezier easing is monotonic in time and its output is
91
+ * conceptually clamped to [0, 1] by the CSS engine for most properties, so it
92
+ * **cannot represent overshoot/bounce**. For bouncy (under-damped) spatial
93
+ * springs we therefore fall back to an expressive M3 decelerate curve
94
+ * (`cubic-bezier(0.05, 0.7, 0.1, 1)` = `emphasizedDecelerate`) which reads as
95
+ * a lively settle without the impossible overshoot. Use
96
+ * {@link springToWaapiKeyframes} when real bounce is required.
97
+ *
98
+ * Control points are derived from the damping ratio `zeta`:
99
+ * - low zeta (bouncy) -> sharper attack, snappier feel
100
+ * - high zeta (smooth) -> gentle ease-out, closer to standard decelerate
101
+ *
102
+ * The mapping is deterministic and the control points are bounded to valid
103
+ * cubic-bezier ranges (x in [0, 1]; y unbounded by spec but kept in [0, 1]).
104
+ */
105
+ export declare function springToCssEasing(params: SpringParams): string;
106
+ /**
107
+ * Sample the analytical damped-spring solution into WAAPI-ready data.
108
+ *
109
+ * Returns {@link SpringWaapi} containing:
110
+ * - `samples`: `{ offset, value }[]` of the progress curve (value in `from`
111
+ * -> `to` units; may overshoot past `to` for under-damped springs),
112
+ * - `keyframes`: `Keyframe[]` carrying only `offset` unless `opts.property`
113
+ * is given (see below),
114
+ * - `options`: `{ duration, easing: "linear" }` — easing is `linear`
115
+ * because the spring shape is fully baked into the per-frame samples.
116
+ *
117
+ * Options:
118
+ * - `steps` : number of samples (default {@link DEFAULT_STEPS}, min 2).
119
+ * - `from`/`to` : start/end values (defaults 0 -> 1).
120
+ * - `property` + `unit`/`format` : project samples onto a CSS property so the
121
+ * returned `keyframes` are directly consumable by `element.animate`.
122
+ *
123
+ * Examples:
124
+ * springToWaapiKeyframes(p, { property: "transform", format: (v) => `translateX(${v}px)`, from: 100, to: 0 })
125
+ * springToWaapiKeyframes(p, { property: "opacity" })
126
+ *
127
+ * The first sample is exactly `{ offset: 0, value: from }`; the last is
128
+ * `{ offset: 1, value: to }` (snapped to the rest position so the animation
129
+ * always finishes precisely on target, even though the analytical value at the
130
+ * truncated settle time may differ by the sub-threshold tail).
131
+ */
132
+ export declare function springToWaapiKeyframes(params: SpringParams, opts?: {
133
+ steps?: number;
134
+ from?: number;
135
+ to?: number;
136
+ /** CSS property name to emit on each keyframe (e.g. "transform"). */
137
+ property?: string;
138
+ /** Format a numeric value into the property string (overrides `unit`). */
139
+ format?: (value: number) => string;
140
+ /** Unit suffix when `format` is absent (e.g. "px", "%"). */
141
+ unit?: string;
142
+ }): SpringWaapi;
143
+ /**
144
+ * Project spring {@link SpringSample}s onto a CSS property, returning
145
+ * `Keyframe[]` ready for `element.animate`.
146
+ *
147
+ * @param samples output of {@link springToWaapiKeyframes}.
148
+ * @param property CSS property name, e.g. "transform" or "opacity".
149
+ * @param format optional formatter (value -> CSS string); overrides `unit`.
150
+ * @param unit unit suffix used when no `format` is given (default "").
151
+ */
152
+ export declare function springKeyframesForProperty(samples: readonly SpringSample[], property: string, format?: (value: number) => string, unit?: string): Keyframe[];
153
+ /**
154
+ * Spring preset shape as authored in {@link m3Springs} (a Motion `Transition`
155
+ * augmented with the physical fields). Kept minimal so we depend only on the
156
+ * numeric fields, not on the full Motion type.
157
+ */
158
+ export interface SpringPresetLike {
159
+ stiffness?: number;
160
+ damping?: number;
161
+ mass?: number;
162
+ }
163
+ /**
164
+ * Extract {@link SpringParams} from an {@link m3Springs} entry (or any
165
+ * compatible preset object) for reuse on the Lit / WAAPI side.
166
+ *
167
+ * Missing fields fall back to the `default.spatial` M3 preset values so the
168
+ * result is always a usable, finite spring.
169
+ *
170
+ * @example
171
+ * springFromPreset(m3Springs.default.spatial) // { stiffness: 220, damping: 17, mass: 1 }
172
+ */
173
+ export declare function springFromPreset(preset: SpringPresetLike): SpringParams;
174
+ //# sourceMappingURL=spring-interpolation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spring-interpolation.d.ts","sourceRoot":"","sources":["../src/spring-interpolation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,0DAA0D;AAC1D,MAAM,WAAW,YAAY;IAC3B,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yEAAyE;AACzE,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IAC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C,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,YAAY,CAMvE"}
@@ -0,0 +1,24 @@
1
+ import type { Transition } from "motion/react";
2
+ /**
3
+ * Material Design 3 Spring Transition Presets.
4
+ * Driven by physical stiffness, damping, and mass.
5
+ *
6
+ * Category Guide:
7
+ * - Spatial: Used for movement (x/y positions, width/height, scale, borders). Includes overshoot (bounce).
8
+ * - Effects: Used for color changes, opacities, and gradients. Critically damped (no overshoot).
9
+ */
10
+ export declare const m3Springs: {
11
+ readonly fast: {
12
+ readonly spatial: Transition;
13
+ readonly effects: Transition;
14
+ };
15
+ readonly default: {
16
+ readonly spatial: Transition;
17
+ readonly effects: Transition;
18
+ };
19
+ readonly slow: {
20
+ readonly spatial: Transition;
21
+ readonly effects: Transition;
22
+ };
23
+ };
24
+ //# sourceMappingURL=springs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"springs.d.ts","sourceRoot":"","sources":["../src/springs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS;aACpB,IAAI;iBACF,OAAO,EAKF,UAAU;iBACf,OAAO,EAKF,UAAU;;aAEjB,OAAO;iBACL,OAAO,EAKF,UAAU;iBACf,OAAO,EAKF,UAAU;;aAEjB,IAAI;iBACF,OAAO,EAKF,UAAU;iBACf,OAAO,EAKF,UAAU;;CAET,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aphrody/m3-motion",
3
- "version": "3.2.5",
3
+ "version": "3.3.0",
4
4
  "description": "Material 3 animation plugin powered by Motion (formerly Framer Motion)",
5
5
  "homepage": "https://github.com/aphrody-code/material-web/tree/main/packages/m3-motion#readme",
6
6
  "bugs": {
@@ -35,16 +35,20 @@
35
35
  "test": "bun test"
36
36
  },
37
37
  "dependencies": {
38
- "motion": "catalog:"
38
+ "motion": "^12.43.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@types/react": "catalog:",
42
- "react": "catalog:",
43
- "tsup": "catalog:",
44
- "typescript": "catalog:"
41
+ "@aphrody/m3-config": "3.3.0",
42
+ "@types/react": "^19.3.0",
43
+ "react": "^19.3.0",
44
+ "tsup": "^8.5.1",
45
+ "typescript": "^7.0.2"
45
46
  },
46
47
  "peerDependencies": {
47
48
  "motion": ">=12.0.0",
48
49
  "react": ">=18.0.0"
50
+ },
51
+ "engines": {
52
+ "bun": ">=1.4.2"
49
53
  }
50
54
  }