import { jsx as _jsx } from "react/jsx-runtime";
import { cva } from 'class-variance-authority';
import { cn } from '../../lib/utils.js';
const spinnerVariants = cva('animate-spinner inline-block rounded-full', {
    variants: {
        size: {
            sm: 'size-4',
            md: 'size-6',
            lg: 'size-10',
        },
    },
    defaultVariants: {
        size: 'md',
    },
});
const BORDER_WIDTH = {
    sm: '3px',
    md: '4px',
    lg: '8px',
};
function Spinner({ className, size = 'md', ...props }) {
    const b = BORDER_WIDTH[size ?? 'md'];
    return (_jsx("div", { "data-slot": "spinner", role: "status", "aria-label": "Loading", className: cn(spinnerVariants({ size }), className), style: {
            background: `conic-gradient(from 220deg, transparent 0%, currentColor 80%, transparent 100%)`,
            WebkitMask: `radial-gradient(farthest-side, #0000 calc(100% - ${b}), #000 calc(100% - ${b} + 1px))`,
        }, ...props }));
}
export { Spinner, spinnerVariants };
