import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from "react";
import { cx } from "../../utils/cx";
export type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
export type ButtonSize = "sm" | "md" | "lg";
export interface ButtonProps extends ButtonHTMLAttributes {
/** Visual style. Use `primary` for the main action in a view, `danger` for destructive actions. */
variant?: ButtonVariant;
size?: ButtonSize;
/** Shows a spinner and blocks clicks while keeping the label readable to screen readers. */
loading?: boolean;
/** Icon rendered before the label. */
iconStart?: ReactNode;
/** Icon rendered after the label. */
iconEnd?: ReactNode;
/** Stretch to the width of the container. */
fullWidth?: boolean;
}
export const Button = forwardRef(function Button(
{
variant = "primary",
size = "md",
loading = false,
iconStart,
iconEnd,
fullWidth = false,
disabled,
type = "button",
className,
children,
onClick,
...rest
},
ref
) {
return (
);
});