/* Copyright (C) 2023-2026 QuantumNous This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ import type { ReactNode } from 'react' import { Outlet, useRouterState } from '@tanstack/react-router' import { motion, useReducedMotion, type Variants } from 'motion/react' import { CARD_ITEM_VARIANTS, CARD_STAGGER_VARIANTS, MOTION_TRANSITION, MOTION_VARIANTS, STAGGER_ITEM_VARIANTS, STAGGER_VARIANTS, TABLE_ROW_VARIANTS, TABLE_STAGGER_VARIANTS, } from '@/lib/motion' interface PageTransitionProps { children: ReactNode className?: string } export function PageTransition(props: PageTransitionProps) { const shouldReduce = useReducedMotion() if (shouldReduce) { return
{props.children}
} return ( {props.children} ) } export function AnimatedOutlet() { const shouldReduce = useReducedMotion() const routeKey = useRouterState({ select: (s) => s.location.pathname, }) if (shouldReduce) { return (
) } return ( ) } interface StaggerContainerProps { children: ReactNode className?: string variants?: Variants } export function StaggerContainer(props: StaggerContainerProps) { const shouldReduce = useReducedMotion() if (shouldReduce) { return
{props.children}
} return ( {props.children} ) } interface StaggerItemProps { children: ReactNode className?: string variants?: Variants } export function StaggerItem(props: StaggerItemProps) { return ( {props.children} ) } export function TableStaggerContainer(props: StaggerContainerProps) { const shouldReduce = useReducedMotion() if (shouldReduce) { return <>{props.children} } return ( {props.children} ) } export function TableStaggerRow(props: StaggerItemProps) { return ( {props.children} ) } export function CardStaggerContainer(props: StaggerContainerProps) { const shouldReduce = useReducedMotion() if (shouldReduce) { return
{props.children}
} return ( {props.children} ) } export function CardStaggerItem(props: StaggerItemProps) { return ( {props.children} ) } interface FadeInProps { children: ReactNode className?: string delay?: number } export function FadeIn(props: FadeInProps) { const shouldReduce = useReducedMotion() if (shouldReduce) { return
{props.children}
} return ( {props.children} ) }