'use strict';
import { jsxs, jsx } from 'react/jsx-runtime';
import { cn } from '../../../fd-toolbox/lib/utils.js';
import { cva } from 'class-variance-authority';
import { Loader2 } from 'lucide-react';
import { iconSizes } from '../icon/Icon.js';
import { uiElementVisibilityState } from '../../../base-repo/constants/ui-constants.js';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
const mediumSpinnerSize = "medium";
const spinnerVariants = cva("flex-col items-center justify-center", {
  variants: {
    show: {
      true: "flex",
      false: uiElementVisibilityState.hidden
    }
  },
  defaultVariants: {
    show: true
  }
});
const loaderVariants = cva("text-primary animate-spin", {
  variants: {
    size: {
      small: iconSizes.large,
      medium: "size-8",
      large: "size-12"
    }
  },
  defaultVariants: {
    size: mediumSpinnerSize
  }
});
function Spinner({
  size,
  show,
  children,
  className
}) {
  return /* @__PURE__ */jsxs("span", {
    className: spinnerVariants({
      show
    }),
    children: [/* @__PURE__ */jsx(Loader2, {
      className: cn(loaderVariants({
        size
      }), className)
    }), children]
  });
}
__name(Spinner, "Spinner");

export { Spinner };
