import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cva } from "class-variance-authority";
import * as React from "react";
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip";
import { cn } from "../../lib/utils";
import { DeleteIcon } from "./delete-icon";
const ICON_SIZE = {
    xs: "xs",
    sm: "sm",
    md: "md",
    lg: "lg",
};
export const deleteButtonVariants = cva("inline-flex shrink-0 cursor-pointer items-center justify-center rounded-md text-neutral-grey-50 transition-colors hover:bg-neutral-grey-5 hover:text-neutral-grey-50 disabled:cursor-default disabled:opacity-40", {
    variants: {
        size: {
            xs: "h-5 w-5",
            sm: "h-7 w-7",
            md: "h-8 w-8",
            lg: "h-9 w-9",
        },
    },
    defaultVariants: {
        size: "sm",
    },
});
/** Standard delete/trash icon button — muted icon, var(--color-neutral-grey-5) hover via bg-neutral-grey-5. */
export const DeleteButton = React.forwardRef(({ className, size, label, iconSize, showTooltip = true, type = "button", ...props }, ref) => {
    const resolvedSize = size ?? "sm";
    const button = (_jsx("button", { ref: ref, type: type, "aria-label": label, className: cn(deleteButtonVariants({ size: resolvedSize }), className), ...props, children: _jsx(DeleteIcon, { size: iconSize ?? ICON_SIZE[resolvedSize] }) }));
    if (!showTooltip) {
        return button;
    }
    return (_jsxs(Tooltip, { delayDuration: 500, children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { children: label })] }));
});
DeleteButton.displayName = "DeleteButton";
//# sourceMappingURL=delete-button.js.map