import { jsx } from "react/jsx-runtime";
import { Slot } from "@radix-ui/react-slot";
import { cva } from "class-variance-authority";
import { cn } from "@open-mercato/shared/lib/utils";
const iconButtonVariants = cva(
  "inline-flex items-center justify-center rounded-md cursor-pointer transition-all outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
  {
    variants: {
      variant: {
        outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
        ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50"
      },
      size: {
        xs: "size-6",
        sm: "size-7",
        default: "size-8",
        lg: "size-9"
      }
    },
    defaultVariants: {
      variant: "outline",
      size: "default"
    }
  }
);
function IconButton({
  className,
  variant,
  size,
  asChild = false,
  ...props
}) {
  const Comp = asChild ? Slot : "button";
  return /* @__PURE__ */ jsx(Comp, { "data-slot": "icon-button", type: asChild ? void 0 : "button", className: cn(iconButtonVariants({ variant, size, className })), ...props });
}
export {
  IconButton,
  iconButtonVariants
};
//# sourceMappingURL=icon-button.js.map
