import { cva } from 'class-variance-authority';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsxs, jsx } from 'react/jsx-runtime';

// src/ai/loading-indicator/loading-indicator.tsx
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
var loadingIndicatorVariants = cva("inline-flex items-center gap-2 text-muted-foreground", {
  variants: {
    size: {
      sm: "text-xs",
      default: "text-sm",
      lg: "text-base"
    }
  },
  defaultVariants: { size: "default" }
});
function LoadingIndicator({
  variant = "dots",
  size,
  label,
  className,
  ...props
}) {
  const ariaLabel = label ?? "Loading";
  return /* @__PURE__ */ jsxs(
    "div",
    {
      role: "status",
      "aria-live": "polite",
      className: cn(loadingIndicatorVariants({ size }), className),
      ...props,
      children: [
        variant === "dots" ? /* @__PURE__ */ jsx(Dots, {}) : null,
        variant === "pulse" ? /* @__PURE__ */ jsx(Pulse, {}) : null,
        variant === "bar" ? /* @__PURE__ */ jsx(Bar, {}) : null,
        label ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: label }) : null,
        /* @__PURE__ */ jsx("span", { className: "sr-only", children: ariaLabel })
      ]
    }
  );
}
function Dots() {
  return /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
    /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-current [animation-delay:-0.3s]" }),
    /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-current [animation-delay:-0.15s]" }),
    /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-current" })
  ] });
}
function Pulse() {
  return /* @__PURE__ */ jsx("span", { className: "h-2 w-2 animate-pulse rounded-full bg-current" });
}
function Bar() {
  return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1", children: [
    /* @__PURE__ */ jsx("span", { className: "h-0.5 w-2 animate-pulse rounded-full bg-current [animation-delay:-0.4s]" }),
    /* @__PURE__ */ jsx("span", { className: "h-0.5 w-3 animate-pulse rounded-full bg-current [animation-delay:-0.2s]" }),
    /* @__PURE__ */ jsx("span", { className: "h-0.5 w-4 animate-pulse rounded-full bg-current" })
  ] });
}

export { LoadingIndicator, loadingIndicatorVariants };
//# sourceMappingURL=loading-indicator.js.map
//# sourceMappingURL=loading-indicator.js.map