Skip to content

Add animation framework with per-brand-kit motion tokens and @ottabase/motion package - #114

Draft
thinkdj with Copilot wants to merge 4 commits into
mainfrom
copilot/add-animation-framework
Draft

Add animation framework with per-brand-kit motion tokens and @ottabase/motion package#114
thinkdj with Copilot wants to merge 4 commits into
mainfrom
copilot/add-animation-framework

Conversation

Copilot AI commented Feb 19, 2026

Copy link
Copy Markdown

Adds brand-kit-aware animation infrastructure: extended motion tokens in brand-engine, a new @ottabase/motion package with transition presets powered by Motion, and merges latest main.

Library choice: Motion (motiondev)

Bundle React License
Motion ~2.5 kB core First-class MIT
Framer Motion ~32 kB First-class MIT
GSAP ~23 kB Plugin Proprietary

Motion wins on bundle size (critical for Workers edge deployment), tree-shakeability, and native CSS variable integration.

Brand-engine: Extended TokenMotion

Six new tokens, all optional with defaults, flowing through the existing resolve → CSS var pipeline:

  • easingSpring — bounce/elastic cubic-bezier
  • scaleFrom / scaleTo — enter/exit scale factors
  • slideOffset — slide distance for drawer/sidebar animations
  • opacityFrom — starting opacity for fades
  • reducedMotion — accessibility preference

All 8 theme presets updated with distinct per-brand personalities (e.g. funky: scaleFrom: 0.9, slideOffset: 16px vs crisp: scaleFrom: 0.98, slideOffset: 4px).

New @ottabase/motion package

Seven presets built from brand tokens, consumed via hooks:

import { motion, AnimatePresence } from 'motion/react';
import { useBrandMotion } from '@ottabase/motion';

function Menu({ open, children }) {
  const presets = useBrandMotion();
  return (
    <AnimatePresence>
      {open && <motion.div {...presets.fadeScale}>{children}</motion.div>}
    </AnimatePresence>
  );
}
  • Presets: fade, fadeUp, fadeDown, fadeScale, slideLeft, slideRight, scaleSpring
  • Hooks: useBrandMotion(), useTransitionPreset(name), useMotionTokens()
  • Pure functions (no React): buildPresets(), parseDuration(), parseEasing(), parseOffset()

Merge from main

Resolved conflicts in tokens.ts, defaults.ts, css-runtime.ts — combined our new animation tokens with main's disableAnimations toggle, ModeValue<T> generics, --motion-* aliases, and typography extended properties. Updated @ottabase/motion hooks to include the new disableAnimations field.

  • brand-engine: 177 tests passing
  • motion: 20 tests passing

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 19, 2026 21:19
…aleTo, slideOffset, opacityFrom, reducedMotion

Co-authored-by: thinkdj <688055+thinkdj@users.noreply.github.com>
…s, and tests

Co-authored-by: thinkdj <688055+thinkdj@users.noreply.github.com>
Copilot AI changed the title [WIP] Add animation and transitions to framework Add animation framework with per-brand-kit motion tokens and @ottabase/motion package Feb 19, 2026
Copilot AI requested a review from thinkdj February 19, 2026 21:33
…s, css-runtime.ts

Co-authored-by: thinkdj <688055+thinkdj@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants