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 { CloseIcon } from "./close-icon";
export const closeButtonVariants = cva("inline-flex !h-[30px] !w-[30px] shrink-0 cursor-pointer items-center justify-center !rounded-[4px] border border-transparent text-neutral-grey-100 transition-colors hover:!rounded-[4px] hover:border-neutral-grey-10 hover:bg-neutral-grey-5 hover:text-neutral-grey-100 disabled:cursor-default disabled:opacity-40", {
    variants: {
        size: {
            xs: "",
            sm: "",
            md: "",
            lg: "",
        },
    },
    defaultVariants: {
        size: "sm",
    },
});
/** Standard close X button - muted icon, var(--color-neutral-grey-5) hover via bg-neutral-grey-5. */
export const CloseButton = React.forwardRef(({ className, size, label = "Close", iconSize: _iconSize, showTooltip = true, type = "button", ...props }, ref) => {
    const button = (_jsx("button", { ref: ref, type: type, "aria-label": label, title: showTooltip ? undefined : label, className: cn(closeButtonVariants({ size }), className), ...props, children: _jsx(CloseIcon, {}) }));
    if (!showTooltip) {
        return button;
    }
    return (_jsxs(Tooltip, { delayDuration: 500, children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { children: label })] }));
});
CloseButton.displayName = "CloseButton";
//# sourceMappingURL=close-button.js.map