import React from 'react'; import { cn } from '../utils/cn'; export type LoadingType = 'spinner' | 'dots' | 'progress' | 'slide' | 'circle' | 'pulse' | 'wave'; export interface LoadingSpinnerProps { /** * Type of loading animation * @default 'spinner' */ type?: LoadingType; /** * Size of the loading indicator * @default 'md' */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Color of the loading indicator */ color?: string; /** * CSS class to apply to the loading container */ className?: string; /** * ARIA label for accessibility * @default 'Loading' */ ariaLabel?: string; } /** * LoadingSpinner component - Displays various loading animations */ export const LoadingSpinner: React.FC = ({ type = 'spinner', size = 'md', color, className, ariaLabel = 'Loading', }) => { // Generate size classes const sizeClasses = { xs: 'rpt-loader--xs', sm: 'rpt-loader--sm', md: 'rpt-loader--md', lg: 'rpt-loader--lg', xl: 'rpt-loader--xl', }; return (
{type === 'spinner' && ( )} {type === 'dots' && ( <> )} {type === 'progress' && (
)} {type === 'slide' && (
)} {type === 'circle' && ( )} {type === 'pulse' && (
)} {type === 'wave' && (
)}
); }; export default LoadingSpinner;