import React, { ReactNode } from "react"; import { SpaceProps } from "styled-system"; import { ButtonProps as LegacyButtonProps } from "../button.component"; import { TagProps } from "../../../__internal__/utils/helpers/tags/tags"; import { Size, Variant, VariantType } from "./button.config"; export type ButtonHandle = { /** Programmatically focus the button. */ focusButton: () => void; } | null; export interface ButtonProps extends Omit, SpaceProps, TagProps { /** Identifies the element(s) offering additional information about the button that the user might require. */ "aria-describedby"?: string; /** * The aria-label attribute of the button. */ "aria-label"?: string; /** Identifies the element(s) labelling the button. */ "aria-labelledby"?: string; /** The content that the button displays. */ children?: ReactNode; /** Flag to indicate that the button is disabled. */ disabled?: boolean; /** Flag to indicate that the button can be full-width. */ fullWidth?: boolean; /** The ID of the button. */ id?: string; /** Set the button to use a dark-mode appearance. */ inverse?: boolean; /** The name of the button. */ name?: string; /** Flag to indicate whether the button text can wrap over multiple lines. */ noWrap?: boolean; /** Handler to fire when the button is blurred. */ onBlur?: (ev: React.FocusEvent) => void; /** Handler to fire when the button is clicked. */ onClick?: (ev: React.MouseEvent | React.MouseEvent) => void; /** Handler to fire when the button is focused. */ onFocus?: (ev: React.FocusEvent) => void; /** Handler to fire when the button is activated via the Enter or Space keys. */ onKeyDown?: (ev: React.KeyboardEvent) => void; /** The size of the button. */ size?: Size; /** The HTML type that this button should use. */ type?: "button" | "reset" | "submit"; /** The variant of the button. */ variant?: Variant; /** The variant type of the button. */ variantType?: VariantType; /** * Used to transform button into anchor * */ href?: string; /** * HTML target attribute * */ target?: string; /** * HTML rel attribute * */ rel?: string; /** * @deprecated Please use `variantType` prop instead. * */ buttonType?: LegacyButtonProps["buttonType"]; /** * @deprecated Please use `variant="destructive"` instead. * */ destructive?: LegacyButtonProps["destructive"]; /** * @deprecated Please use `inverse` instead. * */ isWhite?: LegacyButtonProps["isWhite"]; } export declare const Button: React.ForwardRefExoticComponent>; export default Button;