///
import { ITooltipProps } from "../../hocs/withTooltip";
export type ButtonVariant = "primary" | "secondary" | "tertiary" | "tertiary-inverse";
/**
* Use only for {@link ExternalLinkButton}
*/
export type ExternalButtonVariant = "external";
export type BaseButtonVariant = ButtonVariant | ExternalButtonVariant;
export type ButtonSize = "sm" | "md" | "lg";
type ButtonTextProps = {
/**
* Defines the displayable text for label.
*/
title: string;
icon?: never;
};
type ButtonIconTextProps = {
/**
* Defines the displayable text for label.
*/
title: string;
/**
* Defines an displayable icon on the left side.
*/
icon: React.ReactElement;
};
type ButtonIconProps = {
title?: never;
/**
* Defines an displayable icon on the left side.
*/
icon: React.ReactElement;
};
export type ButtonVariantProps = ButtonTextProps | ButtonIconTextProps | ButtonIconProps;
export type BaseButtonProps = {
as?: C;
/**
* Defined button size.
* @default "sm"
*/
size?: ButtonSize;
/**
* Defines button variant.
*/
variant: BaseButtonVariant;
/**
* Defines if a button is a destructive variant.
* Used in case of a destructive action, eg. deleting data.
*/
destructive?: boolean;
/**
* Defines a loading state. It displays a loader icon in the middle of the button.
*/
loading?: boolean;
/**
* Defines a tracking name for the button. On click, the event sent will will be `{trackName}.clicked`.
* If you have more tracking namespace, then the tracking event will be `{namespace}.{trackName}.clicked`.
*/
trackName: string;
/**
* Defines tracking data sent with the tracking event.
*/
trackData?: object;
} & React.ComponentPropsWithoutRef & ITooltipProps;
export {};