import { jsx } from 'react/jsx-runtime';
import React__default, { useMemo } from 'react';
import { spinnerTheme } from './Spinner.theme.js';
import { cn } from '../../../utils/cn.js';

const Spinner = React__default.forwardRef(({ size = 'md', color = 'primary', className, theme, ...props }, ref) => {
    // Merge custom theme with default theme
    const currentTheme = useMemo(() => theme ? { ...spinnerTheme, ...theme } : spinnerTheme, [theme]);
    return (jsx("div", { ref: ref, className: cn(currentTheme.baseStyle), ...props, children: jsx("div", { className: cn(currentTheme.animation, currentTheme.sizes[size], currentTheme.colors[color], className), role: "status", "aria-label": "loading" }) }));
});
Spinner.displayName = 'Spinner';

export { Spinner };
