/** * CSS-only animation fallback system * * Provides CSS keyframe animations that mirror the motion types. * Use this for projects that don't want the Motion dependency. */ /** * CSS animation keyframes for each motion type */ declare const cssKeyframes = "\n/* MotionIcon CSS Animations */\n\n/* Scale animation */\n@keyframes motionicon-scale {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.15); }\n}\n\n/* Rotate animation */\n@keyframes motionicon-rotate {\n from { transform: rotate(0deg); }\n to { transform: rotate(180deg); }\n}\n\n/* Translate animation */\n@keyframes motionicon-translate {\n 0%, 100% { transform: translate(0, 0); }\n 50% { transform: translate(2px, -2px); }\n}\n\n/* Shake animation */\n@keyframes motionicon-shake {\n 0%, 100% { transform: translateX(0); }\n 20% { transform: translateX(-3px); }\n 40% { transform: translateX(3px); }\n 60% { transform: translateX(-3px); }\n 80% { transform: translateX(3px); }\n}\n\n/* Pulse animation */\n@keyframes motionicon-pulse {\n 0%, 100% { transform: scale(1); opacity: 1; }\n 50% { transform: scale(1.1); opacity: 0.8; }\n}\n\n/* Bounce animation */\n@keyframes motionicon-bounce {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-6px); }\n}\n\n/* Draw animation (opacity/scale fallback) */\n@keyframes motionicon-draw {\n 0% { opacity: 0.4; transform: scale(0.9); }\n 100% { opacity: 1; transform: scale(1); }\n}\n\n/* Spin animation */\n@keyframes motionicon-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n}\n\n/* Fade animation */\n@keyframes motionicon-fade {\n 0% { opacity: 0.6; }\n 100% { opacity: 1; }\n}\n\n/* Pop animation */\n@keyframes motionicon-pop {\n 0%, 100% { transform: scale(1) rotate(0deg); }\n 50% { transform: scale(1.15) rotate(5deg); }\n}\n\n/* Wiggle animation (custom) */\n@keyframes motionicon-wiggle {\n 0%, 100% { transform: rotate(0deg); }\n 15% { transform: rotate(-12deg); }\n 30% { transform: rotate(12deg); }\n 45% { transform: rotate(-8deg); }\n 60% { transform: rotate(8deg); }\n 75% { transform: rotate(-4deg); }\n 90% { transform: rotate(4deg); }\n}\n\n/* Heartbeat animation (custom) */\n@keyframes motionicon-heartbeat {\n 0%, 100% { transform: scale(1); }\n 14% { transform: scale(1.15); }\n 28% { transform: scale(1); }\n 42% { transform: scale(1.1); }\n}\n\n/* Swing animation (custom) */\n@keyframes motionicon-swing {\n 0%, 100% { transform: rotate(0deg); }\n 20% { transform: rotate(15deg); }\n 40% { transform: rotate(-10deg); }\n 60% { transform: rotate(5deg); }\n 80% { transform: rotate(-5deg); }\n}\n\n/* Float animation (custom) */\n@keyframes motionicon-float {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-8px); }\n}\n\n/* Path drawing animation for SVG strokes */\n@keyframes motionicon-draw-path {\n 0% { stroke-dashoffset: var(--path-length, 100); opacity: 0.3; }\n 100% { stroke-dashoffset: 0; opacity: 1; }\n}\n\n/* Path drawing loop animation */\n@keyframes motionicon-draw-path-loop {\n 0% { stroke-dashoffset: var(--path-length, 100); opacity: 0.5; }\n 40% { stroke-dashoffset: 0; opacity: 1; }\n 60% { stroke-dashoffset: 0; opacity: 1; }\n 100% { stroke-dashoffset: var(--path-length, 100); opacity: 0.5; }\n}\n"; /** * CSS classes for each motion type */ declare const cssAnimationClasses = "\n/* MotionIcon CSS Animation Classes */\n\n/* Base hover animation behavior */\n.motionicon-animated {\n transition: transform 0.2s ease;\n}\n\n/* Scale on hover */\n.motionicon-scale:hover {\n animation: motionicon-scale 0.3s ease forwards;\n}\n\n/* Rotate on hover */\n.motionicon-rotate:hover {\n animation: motionicon-rotate 0.4s ease forwards;\n}\n\n/* Translate on hover */\n.motionicon-translate:hover {\n animation: motionicon-translate 0.3s ease forwards;\n}\n\n/* Shake on hover */\n.motionicon-shake:hover {\n animation: motionicon-shake 0.4s ease;\n}\n\n/* Pulse loop */\n.motionicon-pulse {\n animation: motionicon-pulse 0.6s ease-in-out infinite;\n}\n\n/* Bounce on hover */\n.motionicon-bounce:hover {\n animation: motionicon-bounce 0.4s ease;\n}\n\n/* Draw on hover */\n.motionicon-draw:hover {\n animation: motionicon-draw 0.5s ease forwards;\n}\n\n/* Spin continuous */\n.motionicon-spin {\n animation: motionicon-spin 0.8s linear infinite;\n}\n\n/* Fade on hover */\n.motionicon-fade {\n opacity: 0.6;\n transition: opacity 0.2s ease;\n}\n.motionicon-fade:hover {\n opacity: 1;\n}\n\n/* Pop on hover */\n.motionicon-pop:hover {\n animation: motionicon-pop 0.3s ease forwards;\n}\n\n/* Wiggle on hover */\n.motionicon-wiggle:hover {\n animation: motionicon-wiggle 0.6s ease;\n}\n\n/* Heartbeat on hover */\n.motionicon-heartbeat:hover {\n animation: motionicon-heartbeat 0.8s ease;\n}\n\n/* Swing on hover */\n.motionicon-swing:hover {\n animation: motionicon-swing 0.6s ease;\n}\n\n/* Float continuous */\n.motionicon-float {\n animation: motionicon-float 1.5s ease-in-out infinite;\n}\n\n/* Trigger modes */\n.motionicon-trigger-hover:hover {\n animation-play-state: running;\n}\n\n.motionicon-trigger-loop {\n animation-iteration-count: infinite;\n}\n\n.motionicon-trigger-mount {\n animation-iteration-count: 1;\n animation-fill-mode: forwards;\n}\n\n/* SVG path drawing */\n.motionicon-draw-path {\n stroke-dasharray: var(--path-length, 100);\n stroke-dashoffset: var(--path-length, 100);\n}\n\n.motionicon-draw-path-hover:hover .motionicon-draw-path {\n animation: motionicon-draw-path 1.5s ease-in-out forwards;\n}\n\n.motionicon-draw-path-loop .motionicon-draw-path {\n animation: motionicon-draw-path-loop 3s ease-in-out infinite;\n}\n\n.motionicon-draw-path-mount .motionicon-draw-path {\n animation: motionicon-draw-path 1.5s ease-in-out forwards;\n}\n\n/* Reduced motion support */\n@media (prefers-reduced-motion: reduce) {\n .motionicon-animated,\n .motionicon-scale,\n .motionicon-rotate,\n .motionicon-translate,\n .motionicon-shake,\n .motionicon-pulse,\n .motionicon-bounce,\n .motionicon-draw,\n .motionicon-spin,\n .motionicon-fade,\n .motionicon-pop,\n .motionicon-wiggle,\n .motionicon-heartbeat,\n .motionicon-swing,\n .motionicon-float {\n animation: none !important;\n transition: none !important;\n }\n}\n"; /** * Complete CSS stylesheet with keyframes and classes */ declare const cssStylesheet = "\n/* MotionIcon CSS Animations */\n\n/* Scale animation */\n@keyframes motionicon-scale {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.15); }\n}\n\n/* Rotate animation */\n@keyframes motionicon-rotate {\n from { transform: rotate(0deg); }\n to { transform: rotate(180deg); }\n}\n\n/* Translate animation */\n@keyframes motionicon-translate {\n 0%, 100% { transform: translate(0, 0); }\n 50% { transform: translate(2px, -2px); }\n}\n\n/* Shake animation */\n@keyframes motionicon-shake {\n 0%, 100% { transform: translateX(0); }\n 20% { transform: translateX(-3px); }\n 40% { transform: translateX(3px); }\n 60% { transform: translateX(-3px); }\n 80% { transform: translateX(3px); }\n}\n\n/* Pulse animation */\n@keyframes motionicon-pulse {\n 0%, 100% { transform: scale(1); opacity: 1; }\n 50% { transform: scale(1.1); opacity: 0.8; }\n}\n\n/* Bounce animation */\n@keyframes motionicon-bounce {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-6px); }\n}\n\n/* Draw animation (opacity/scale fallback) */\n@keyframes motionicon-draw {\n 0% { opacity: 0.4; transform: scale(0.9); }\n 100% { opacity: 1; transform: scale(1); }\n}\n\n/* Spin animation */\n@keyframes motionicon-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n}\n\n/* Fade animation */\n@keyframes motionicon-fade {\n 0% { opacity: 0.6; }\n 100% { opacity: 1; }\n}\n\n/* Pop animation */\n@keyframes motionicon-pop {\n 0%, 100% { transform: scale(1) rotate(0deg); }\n 50% { transform: scale(1.15) rotate(5deg); }\n}\n\n/* Wiggle animation (custom) */\n@keyframes motionicon-wiggle {\n 0%, 100% { transform: rotate(0deg); }\n 15% { transform: rotate(-12deg); }\n 30% { transform: rotate(12deg); }\n 45% { transform: rotate(-8deg); }\n 60% { transform: rotate(8deg); }\n 75% { transform: rotate(-4deg); }\n 90% { transform: rotate(4deg); }\n}\n\n/* Heartbeat animation (custom) */\n@keyframes motionicon-heartbeat {\n 0%, 100% { transform: scale(1); }\n 14% { transform: scale(1.15); }\n 28% { transform: scale(1); }\n 42% { transform: scale(1.1); }\n}\n\n/* Swing animation (custom) */\n@keyframes motionicon-swing {\n 0%, 100% { transform: rotate(0deg); }\n 20% { transform: rotate(15deg); }\n 40% { transform: rotate(-10deg); }\n 60% { transform: rotate(5deg); }\n 80% { transform: rotate(-5deg); }\n}\n\n/* Float animation (custom) */\n@keyframes motionicon-float {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-8px); }\n}\n\n/* Path drawing animation for SVG strokes */\n@keyframes motionicon-draw-path {\n 0% { stroke-dashoffset: var(--path-length, 100); opacity: 0.3; }\n 100% { stroke-dashoffset: 0; opacity: 1; }\n}\n\n/* Path drawing loop animation */\n@keyframes motionicon-draw-path-loop {\n 0% { stroke-dashoffset: var(--path-length, 100); opacity: 0.5; }\n 40% { stroke-dashoffset: 0; opacity: 1; }\n 60% { stroke-dashoffset: 0; opacity: 1; }\n 100% { stroke-dashoffset: var(--path-length, 100); opacity: 0.5; }\n}\n\n\n/* MotionIcon CSS Animation Classes */\n\n/* Base hover animation behavior */\n.motionicon-animated {\n transition: transform 0.2s ease;\n}\n\n/* Scale on hover */\n.motionicon-scale:hover {\n animation: motionicon-scale 0.3s ease forwards;\n}\n\n/* Rotate on hover */\n.motionicon-rotate:hover {\n animation: motionicon-rotate 0.4s ease forwards;\n}\n\n/* Translate on hover */\n.motionicon-translate:hover {\n animation: motionicon-translate 0.3s ease forwards;\n}\n\n/* Shake on hover */\n.motionicon-shake:hover {\n animation: motionicon-shake 0.4s ease;\n}\n\n/* Pulse loop */\n.motionicon-pulse {\n animation: motionicon-pulse 0.6s ease-in-out infinite;\n}\n\n/* Bounce on hover */\n.motionicon-bounce:hover {\n animation: motionicon-bounce 0.4s ease;\n}\n\n/* Draw on hover */\n.motionicon-draw:hover {\n animation: motionicon-draw 0.5s ease forwards;\n}\n\n/* Spin continuous */\n.motionicon-spin {\n animation: motionicon-spin 0.8s linear infinite;\n}\n\n/* Fade on hover */\n.motionicon-fade {\n opacity: 0.6;\n transition: opacity 0.2s ease;\n}\n.motionicon-fade:hover {\n opacity: 1;\n}\n\n/* Pop on hover */\n.motionicon-pop:hover {\n animation: motionicon-pop 0.3s ease forwards;\n}\n\n/* Wiggle on hover */\n.motionicon-wiggle:hover {\n animation: motionicon-wiggle 0.6s ease;\n}\n\n/* Heartbeat on hover */\n.motionicon-heartbeat:hover {\n animation: motionicon-heartbeat 0.8s ease;\n}\n\n/* Swing on hover */\n.motionicon-swing:hover {\n animation: motionicon-swing 0.6s ease;\n}\n\n/* Float continuous */\n.motionicon-float {\n animation: motionicon-float 1.5s ease-in-out infinite;\n}\n\n/* Trigger modes */\n.motionicon-trigger-hover:hover {\n animation-play-state: running;\n}\n\n.motionicon-trigger-loop {\n animation-iteration-count: infinite;\n}\n\n.motionicon-trigger-mount {\n animation-iteration-count: 1;\n animation-fill-mode: forwards;\n}\n\n/* SVG path drawing */\n.motionicon-draw-path {\n stroke-dasharray: var(--path-length, 100);\n stroke-dashoffset: var(--path-length, 100);\n}\n\n.motionicon-draw-path-hover:hover .motionicon-draw-path {\n animation: motionicon-draw-path 1.5s ease-in-out forwards;\n}\n\n.motionicon-draw-path-loop .motionicon-draw-path {\n animation: motionicon-draw-path-loop 3s ease-in-out infinite;\n}\n\n.motionicon-draw-path-mount .motionicon-draw-path {\n animation: motionicon-draw-path 1.5s ease-in-out forwards;\n}\n\n/* Reduced motion support */\n@media (prefers-reduced-motion: reduce) {\n .motionicon-animated,\n .motionicon-scale,\n .motionicon-rotate,\n .motionicon-translate,\n .motionicon-shake,\n .motionicon-pulse,\n .motionicon-bounce,\n .motionicon-draw,\n .motionicon-spin,\n .motionicon-fade,\n .motionicon-pop,\n .motionicon-wiggle,\n .motionicon-heartbeat,\n .motionicon-swing,\n .motionicon-float {\n animation: none !important;\n transition: none !important;\n }\n}\n"; /** * Map of motion type to CSS class name */ declare const motionTypeToCssClass: Record; /** * Map of trigger type to CSS class modifier */ declare const triggerTypeToCssClass: Record; /** * Get CSS classes for an icon based on motion type and trigger * * @param motionType - The type of animation * @param trigger - When to trigger the animation * @returns Space-separated CSS class string */ declare function getCssAnimationClasses(motionType?: string, trigger?: string): string; /** * Inject CSS animations into the document head * * Call this once at app initialization to enable CSS animations. * Only runs in browser environment. * * @example * ```tsx * // In your app entry point * import { injectCssAnimations } from 'motionicon/css'; * * injectCssAnimations(); * ``` */ declare function injectCssAnimations(): void; /** * Remove injected CSS animations from the document */ declare function removeCssAnimations(): void; export { cssAnimationClasses, cssKeyframes, cssStylesheet, getCssAnimationClasses, injectCssAnimations, motionTypeToCssClass, removeCssAnimations, triggerTypeToCssClass };