import './useViewTransitions.module.css'; import type { IViewTransitionsOptions, IViewTransitionsAPI } from '../Morph.types'; /** * Hook for the View Transitions API. * * Provides a wrapper around the native View Transitions API * with automatic feature detection and fallback handling. * * Browser support: * - Chrome 111+ * - Firefox 144+ * - Safari latest * * View transition styles are applied via CSS module, eliminating * the need for runtime style injection. Elements should have * `view-transition-name` applied via inline style or CSS class. * * @param options - Optional view transition name (deprecated, use inline style) * @returns View Transitions API with support detection and transition trigger * * @example * ```tsx * const { isSupported, startTransition } = useViewTransitions(); * * const handleTransition = async () => { * await startTransition(() => { * setActiveImage(nextImage); * }); * }; * * // Apply view-transition-name to elements *