#![warn(missing_docs)]
#![forbid(unsafe_code)]
pub use leptos_motion_core::{
animation, spring, easing, performance, AnimationEngine, AnimationHandle, AnimationConfig,
Transition, Easing, SpringConfig, AnimationValue, Result
};
pub use leptos_motion_dom::{
MotionDiv, MotionSpan, AnimatePresence, PresenceMode, MotionProps,
DragConfig, DragAxis, DragConstraints, InteractiveState, motion_target
};
#[cfg(feature = "gestures")]
pub use leptos_motion_gestures::*;
#[cfg(feature = "layout")]
pub use leptos_motion_layout::*;
#[cfg(feature = "scroll")]
pub use leptos_motion_scroll::*;
pub use leptos_motion_macros::*;
pub mod presets {
pub use leptos_motion_core::animation::presets::*;
pub use leptos_motion_core::spring::presets::*;
pub use leptos_motion_core::easing::presets::*;
}
pub mod external {
pub use leptos::*;
pub use web_sys::{Element, HtmlElement, Event, MouseEvent, TouchEvent};
pub use wasm_bindgen::prelude::*;
}
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_version() {
assert!(!VERSION.is_empty());
assert!(!DESCRIPTION.is_empty());
}
#[test]
fn test_animation_value_creation() {
let opacity = AnimationValue::Number(1.0);
let position = AnimationValue::Pixels(100.0);
let rotation = AnimationValue::Degrees(45.0);
assert_eq!(opacity, AnimationValue::Number(1.0));
assert_eq!(position, AnimationValue::Pixels(100.0));
assert_eq!(rotation, AnimationValue::Degrees(45.0));
}
#[test]
fn test_transition_creation() {
let transition = Transition {
duration: Some(1.0),
ease: Easing::Spring(SpringConfig::default()),
..Default::default()
};
assert_eq!(transition.duration, Some(1.0));
assert!(matches!(transition.ease, Easing::Spring(_)));
}
}