UNPKG

aura-glass

Version:

A comprehensive glassmorphism design system for React applications with 142+ production-ready components

57 lines 2.01 kB
import React from 'react'; export interface MotionPreferenceContextType { prefersReducedMotion: boolean; isMotionSafe: boolean; motionPolicy: 'auto' | 'always-safe' | 'never-safe'; } /** * Hook to access motion preferences from context * * IMPORTANT: Use this instead of useReducedMotion() when you want centralized * motion preferences controlled by MotionPreferenceProvider at the app root. */ export declare const useMotionPreferenceContext: () => MotionPreferenceContextType; export interface MotionPreferenceProviderProps { children: React.ReactNode; /** * Initial motion preference for SSR/first render * - 'auto': Detect from user preference (default) * - 'always-safe': Force motion enabled, ignore user preference * - 'never-safe': Force motion disabled * * CRITICAL for SSR: Use 'always-safe' to prevent hydration mismatches * when you know your users don't prefer reduced motion. */ initialMotionPolicy?: 'auto' | 'always-safe' | 'never-safe'; /** * Initial value for prefersReducedMotion during SSR * Default: false (motion allowed) * * Set to true if you want to assume reduced motion during SSR */ initialPrefersReducedMotion?: boolean; } /** * MotionPreferenceProvider - Centralized motion preference management * * CRITICAL for SSR: Wrap your app root with this provider to: * 1. Prevent hydration mismatches from motion detection * 2. Centralize motion preferences across all AuraGlass components * 3. Control SSR behavior via props * * Example (SSR-safe): * ```tsx * <MotionPreferenceProvider initialMotionPolicy="always-safe"> * <App /> * </MotionPreferenceProvider> * ``` * * Example (respect user preference): * ```tsx * <MotionPreferenceProvider initialMotionPolicy="auto"> * <App /> * </MotionPreferenceProvider> * ``` */ export declare const MotionPreferenceProvider: React.FC<MotionPreferenceProviderProps>; //# sourceMappingURL=MotionPreferenceContext.d.ts.map