# @hua-labs/motion-core - AI Documentation
# Version: 2.4.1
# Auto-generated by generate-docs — do not edit manually

package:
  name: "@hua-labs/motion-core"
  version: "2.4.1"
  description: "HUA Motion Core - Essential animation hooks for React developers"
  license: "MIT"

overview: "A collection of 60+ React animation hooks built on a ref-based engine. Direct DOM manipulation for consistent performance with zero external dependencies. All hooks are TypeScript-native and SSR-compatible. React Native support via dedicated native hooks using the Animated API, with package-owned motion intent metadata and a read-only projection catalog for AI builders and future SDUI/MCP projections."

exports:
  main:
    path: "@hua-labs/motion-core"
    provides:
      - name: "MotionEngine"
        type: "class"
        description: "Zero-dependency pure JavaScript motion engine class"
      - name: "motionEngine"
        type: "variable"
        description: "Singleton instance of MotionEngine"
      - name: "TransitionEffects"
        type: "class"
        description: "Transition effect system class (fade, slide, scale, etc.)"
      - name: "transitionEffects"
        type: "variable"
        description: "Singleton instance of TransitionEffects"
      - name: "useSimplePageMotion"
        type: "hook"
        description: "Simple fade+slide page entrance animation"
      - name: "usePageMotions"
        type: "hook"
        description: "Multi-element page entrance orchestration"
      - name: "useSmartMotion"
        type: "hook"
        description: "Adaptive motion based on device performance"
      - name: "useUnifiedMotion"
        type: "hook"
        description: "All-in-one motion hook with presets"
      - name: "useFadeIn"
        type: "hook"
        description: "Fade-in animation hook"
      - name: "useSlideUp"
        type: "hook"
        description: "Slide-up entrance animation"
      - name: "useSlideLeft"
        type: "hook"
        description: "Slide-left entrance animation"
      - name: "useSlideRight"
        type: "hook"
        description: "Slide-right entrance animation"
      - name: "useScaleIn"
        type: "hook"
        description: "Scale-in entrance animation"
      - name: "useBounceIn"
        type: "hook"
        description: "Bounce-in entrance animation"
      - name: "usePulse"
        type: "hook"
        description: "Repeating pulse animation"
      - name: "useSpringMotion"
        type: "hook"
        description: "Spring physics animation"
      - name: "useGradient"
        type: "hook"
        description: "Animated gradient background"
      - name: "useHoverMotion"
        type: "hook"
        description: "Hover interaction animation"
      - name: "useClickToggle"
        type: "hook"
        description: "Click-triggered toggle animation"
      - name: "useFocusToggle"
        type: "hook"
        description: "Focus-triggered toggle animation"
      - name: "useScrollReveal"
        type: "hook"
        description: "Scroll-triggered reveal animation"
      - name: "useScrollProgress"
        type: "hook"
        description: "Scroll position as 0-1 progress value"
      - name: "useMotionState"
        type: "hook"
        description: "Animation state tracking (idle, running, complete)"
      - name: "useRepeat"
        type: "hook"
        description: "Repeating animation with configurable count"
      - name: "useToggleMotion"
        type: "hook"
        description: "Toggle between two animation states"
      - name: "useSlideDown"
        type: "hook"
        description: "Slide-down entrance animation"
      - name: "useInView"
        type: "hook"
        description: "IntersectionObserver-based visibility detection"
      - name: "useMouse"
        type: "hook"
        description: "Mouse position tracking"
      - name: "useReducedMotion"
        type: "hook"
        description: "Detect prefers-reduced-motion setting"
      - name: "useReducedMotionObject"
        type: "hook"
        description: "Returns { prefersReducedMotion } object (extended form of useReducedMotion)"
      - name: "useWindowSize"
        type: "hook"
        description: "Responsive window size tracking"
      - name: "getMotionIntentManifest"
        type: "function"
        description: "Return typed static motion intent metadata for AI builders and future projections"
      - name: "getNativeMotionParityTable"
        type: "function"
        description: "Return React Native support rows derived from the motion intent manifest"
      - name: "getMotionIntentProjectionCatalog"
        type: "function"
        description: "Return JSON-serializable package-owned motion intent projection metadata for future SDUI/MCP consumers"
      - name: "motionIntentManifest"
        type: "variable"
        description: "Package-owned static motion intent manifest"
      - name: "nativeMotionParityTable"
        type: "variable"
        description: "React Native support table derived from the motion intent manifest"
      - name: "motionIntentProjectionCatalog"
        type: "variable"
        description: "Static read-only motion intent projection catalog derived from the manifest"
      - name: "useGesture"
        type: "hook"
        description: "Multi-gesture handler (drag, swipe, pinch)"
      - name: "useGestureMotion"
        type: "hook"
        description: "Gesture-driven motion animation"
      - name: "useButtonEffect"
        type: "hook"
        description: "Ripple / press feedback effect for buttons"
      - name: "useVisibilityToggle"
        type: "hook"
        description: "Animate an element in/out based on a boolean visibility flag"
      - name: "useScrollToggle"
        type: "hook"
        description: "Toggle animation state based on scroll position threshold"
      - name: "useCardList"
        type: "hook"
        description: "Staggered entrance animation for a list of cards"
      - name: "useLoadingSpinner"
        type: "hook"
        description: "Continuous rotation animation for loading spinners"
      - name: "useNavigation"
        type: "hook"
        description: "Slide/fade animation for navigation transitions"
      - name: "useSkeleton"
        type: "hook"
        description: "Shimmer animation for skeleton loading placeholders"
      - name: "useTypewriter"
        type: "hook"
        description: "Typewriter character-by-character text reveal animation"
      - name: "useCustomCursor"
        type: "hook"
        description: "Custom cursor tracking and animation"
      - name: "useMagneticCursor"
        type: "hook"
        description: "Magnetic cursor attraction effect for interactive elements"
      - name: "useSmoothScroll"
        type: "hook"
        description: "Smooth programmatic scroll with easing"
      - name: "useElementProgress"
        type: "hook"
        description: "Track an element's scroll progress as a 0–1 value"
      - name: "neutral"
        type: "variable"
        description: "Built-in neutral motion profile (minimal, system-respecting)"
      - name: "hua"
        type: "variable"
        description: "Built-in hua motion profile (expressive, brand-aligned)"
      - name: "resolveProfile"
        type: "function"
        description: "Resolve a built-in profile name or MotionProfile object to a MotionProfile"
      - name: "mergeProfileOverrides"
        type: "function"
        description: "Deep-merge overrides into a base MotionProfile"
      - name: "MotionProfileProvider"
        type: "component"
        description: "React context provider that supplies a MotionProfile to the subtree"
      - name: "useMotionProfile"
        type: "hook"
        description: "Hook to read the current MotionProfile from context"
      - name: "observeElement"
        type: "function"
        description: "Shared IntersectionObserver helper — observe an element and invoke a callback on visibility change"
      - name: "linear"
        type: "function"
        description: "Linear easing (no acceleration)"
      - name: "easeIn"
        type: "function"
        description: "Ease-in curve (slow start)"
      - name: "easeOut"
        type: "function"
        description: "Ease-out curve (slow end)"
      - name: "easeInOut"
        type: "function"
        description: "Smooth ease-in-out curve"
      - name: "getEasing"
        type: "function"
        description: "Get easing function by name"
      - name: "applyEasing"
        type: "function"
        description: "Apply an easing function to a raw progress value (throws on invalid)"
      - name: "safeApplyEasing"
        type: "function"
        description: "Apply an easing function to a progress value, falling back to linear on error"
      - name: "isValidEasing"
        type: "function"
        description: "Check whether a string is a recognised EasingType name"
      - name: "getAvailableEasings"
        type: "function"
        description: "Return the list of all registered easing names"
      - name: "isEasingFunction"
        type: "function"
        description: "Type-guard that checks whether a value is a callable EasingFunction"
      - name: "easingPresets"
        type: "variable"
        description: "Map of named easing preset strings to EasingFunction objects"
      - name: "getPresetEasing"
        type: "function"
        description: "Look up an EasingFunction by preset name"
      - name: "calculateSpring"
        type: "function"
        description: "Pure function that computes spring position/velocity for a given time step"
      - name: "useAutoFade"
        type: "hook"
        description: "Auto-looping fade animation"
      - name: "useAutoPlay"
        type: "hook"
        description: "Auto-looping playback animation"
      - name: "useAutoScale"
        type: "hook"
        description: "Auto-looping scale animation"
      - name: "useAutoSlide"
        type: "hook"
        description: "Auto-looping slide animation"
      - name: "useMotionOrchestra"
        type: "hook"
        description: "[DEPRECATED] Use useOrchestration instead. Multi-mode orchestrator (sequential/parallel/stagger) with dynamic step registration"
      - name: "useOrchestration"
        type: "hook"
        description: "rAF-based timeline engine with seek, speed, reverse support"
      - name: "useSequence"
        type: "hook"
        description: "[DEPRECATED] 2.x compatibility bridge for the legacy sequence hook API. Use useOrchestration for new timeline work; removal should only happen in a future major release."
      - name: "createParallelTimeline"
        type: "function"
        description: "Create parallel useOrchestration timeline steps that share a start offset"
      - name: "createSequenceTimeline"
        type: "function"
        description: "Create sequential useOrchestration timeline steps with cumulative offsets"
      - name: "createStaggerTimeline"
        type: "function"
        description: "Create staggered useOrchestration timeline steps with overlapping start offsets"
      - name: "useLayoutMotion"
        type: "hook"
        description: "Layout change animation with FLIP technique"
      - name: "createLayoutTransition"
        type: "function"
        description: "Factory function to create layout transition configs"
      - name: "useKeyboardToggle"
        type: "hook"
        description: "Keyboard shortcut-triggered toggle animation"
      - name: "useScrollDirection"
        type: "hook"
        description: "Detect scroll direction (up/down) for show/hide patterns"
      - name: "useStickyToggle"
        type: "hook"
        description: "Toggle animation based on sticky scroll threshold"
      - name: "useInteractive"
        type: "hook"
        description: "Combined hover/press/focus interaction state"
      - name: "usePerformanceMonitor"
        type: "hook"
        description: "FPS and frame timing monitor for motion performance"
      - name: "useLanguageAwareMotion"
        type: "hook"
        description: "Direction-aware motion that adapts to LTR/RTL languages"
      - name: "useGameLoop"
        type: "hook"
        description: "Fixed-timestep game loop with state management"
      - name: "useMotion"
        type: "hook"
        description: "Flexible single-element motion hook with from/to config"
      - name: "useViewportToggle"
        type: "hook"
        description: "IntersectionObserver-based viewport visibility toggle (renamed from pro useVisibilityToggle)"
      - name: "useScrollPositionToggle"
        type: "hook"
        description: "pageYOffset-based scroll position toggle (renamed from pro useScrollToggle)"
      - name: "Motion"
        type: "component"
        description: "React wrapper component that applies a motion hook to its child element via ref"
      - name: "useCountUp"
        type: "hook"
        description: "Animated counter that counts up to a target number"
      - name: "useClipReveal"
        type: "hook"
        description: "Clip-path reveal animation (wipe-in effect)"
      - name: "useBlurIn"
        type: "hook"
        description: "Blur-to-clear entrance animation"
      - name: "useStagger"
        type: "hook"
        description: "Orchestrate staggered entrance animations across a list of elements"
      - name: "MOTION_PRESETS"
        type: "variable"
        description: "Built-in preset configurations keyed by element role (hero, title, button, card, text, image)"
      - name: "PAGE_MOTIONS"
        type: "variable"
        description: "Page-level motion configs keyed by page type (home, dashboard, product, blog)"
      - name: "mergeWithPreset"
        type: "function"
        description: "Merge a MotionPreset with custom overrides"
      - name: "getPagePreset"
        type: "function"
        description: "Get PageMotionsConfig for a given PageType"
      - name: "getMotionPreset"
        type: "function"
        description: "Get a MotionPreset by element role string"
      - name: "useFadeIn (native)"
        type: "hook"
        description: "Native fade-in using Animated.timing"
      - name: "useSlideUp (native)"
        type: "hook"
        description: "Native slide-up using Animated.parallel"
      - name: "useSlideDown (native)"
        type: "hook"
        description: "Native slide-down using Animated.parallel"
      - name: "useSlideLeft (native)"
        type: "hook"
        description: "Native slide-left using Animated.parallel"
      - name: "useSlideRight (native)"
        type: "hook"
        description: "Native slide-right using Animated.parallel"
      - name: "useScaleIn (native)"
        type: "hook"
        description: "Native scale-in using Animated.parallel"
      - name: "useBounceIn (native)"
        type: "hook"
        description: "Native bounce-in using Animated.spring"
      - name: "useSpringMotion (native)"
        type: "hook"
        description: "Native generic spring animation with animateTo()"
      - name: "usePulse (native)"
        type: "hook"
        description: "Native looping pulse using Animated.loop"
      - name: "useStagger (native)"
        type: "hook"
        description: "Native staggered list animation using Animated.stagger"

  subpaths:
    - path: "@hua-labs/motion-core/native"
      description: "React Native hooks using Animated API (useFadeIn, useSlide*, useScaleIn, useBounceIn, useSpringMotion, usePulse, useStagger)"
    - path: "@hua-labs/motion-core/manifest"
      description: "Server-safe static motion intent manifest and projection catalog without React hook/runtime exports"

features:
  - "60+ animation hooks — Fade, slide, scale, scroll, interactions, gestures, orchestration"
  - "Zero dependencies — Pure JavaScript motion engine"
  - "Ref-based — Direct DOM manipulation for consistent performance"
  - "SSR compatible — Works with Next.js, Remix, and SSR frameworks"
  - "React Native — 10 native hooks via Animated API (separate entry point)"
  - "AX motion intent manifest — typed package-owned metadata for AI builders"
  - "Motion intent projection catalog — JSON-serializable read-only contract for future SDUI/MCP consumers"
  - "Native reduced motion bridge — React Native AccessibilityInfo support"
  - "Fully tested — Comprehensive test coverage"

related_packages:
  - "@hua-labs/hua"

ax:
  schemaVersion: "hua-package-ax.v1"
  catalogKind: "motion-intent"
  sourcePackage: "@hua-labs/motion-core"
  sourceExport: "getMotionIntentProjectionCatalog"
  entryCount: 8
  targetRowCount: 32
  surfaceRowCount: 16
  targets:
    - "mcp"
    - "native"
    - "sdui"
    - "web"
  surfaces:
    - "docs"
    - "package-export"
  supportSummary:
    direct: 11
    manifest-only: 17
    selected-subset: 4
  executionSummary:
    declaration-only: 17
    runtime: 15
  caveatSummary:
    - "mcp: manifest-only"
    - "native: manifest-only"
    - "sdui: manifest-only"

compatibility:
  react: ">=19.0.0"
  node: ">=20.0.0"
