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

// src/primitives/error-state/error-state.tsx
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
var errorStateVariants = cva(
  [
    "flex flex-col items-center justify-center text-center",
    "rounded-md border px-[var(--space-6,1.5rem)] py-[var(--space-8,2rem)] gap-[var(--space-3,0.75rem)]"
  ].join(" "),
  {
    variants: {
      variant: {
        default: "border-border bg-muted/30",
        destructive: "border-destructive/30 bg-destructive/5"
      }
    },
    defaultVariants: { variant: "default" }
  }
);
var errorIconWrapperVariants = cva(
  "flex h-12 w-12 shrink-0 items-center justify-center rounded-full [&_svg]:size-6",
  {
    variants: {
      variant: {
        default: "bg-muted text-muted-foreground",
        destructive: "bg-destructive/10 text-destructive"
      }
    },
    defaultVariants: { variant: "default" }
  }
);
function ErrorState({
  className,
  variant,
  icon,
  title = "Something went wrong",
  message,
  action,
  ref,
  ...props
}) {
  return /* @__PURE__ */ jsxs(
    "div",
    {
      ref,
      role: "alert",
      className: cn(errorStateVariants({ variant }), className),
      ...props,
      children: [
        icon ? /* @__PURE__ */ jsx("div", { className: errorIconWrapperVariants({ variant }), "aria-hidden": "true", children: icon }) : null,
        /* @__PURE__ */ jsx("div", { className: "font-semibold text-foreground", children: title }),
        /* @__PURE__ */ jsx("div", { className: "max-w-md text-sm text-muted-foreground", children: message }),
        action ? /* @__PURE__ */ jsx("div", { className: "mt-[var(--space-2,0.5rem)]", children: action }) : null
      ]
    }
  );
}

export { ErrorState, errorStateVariants };
//# sourceMappingURL=error-state.js.map
//# sourceMappingURL=error-state.js.map