import * as React from "react"; import { AbstractPureComponent2, Alignment, ActionProps, IElementRefProps, MaybeElement } from "../../common"; import { IconName } from "../icon/icon"; export declare type ButtonProps = IButtonProps; /** @deprecated use ButtonProps */ export interface IButtonProps extends ActionProps, IElementRefProps { /** * If set to `true`, the button will display in an active state. * This is equivalent to setting `className={Classes.ACTIVE}`. * * @default false */ active?: boolean; /** * Text alignment within button. By default, icons and text will be centered * within the button. Passing `"left"` or `"right"` will align the button * text to that side and push `icon` and `rightIcon` to either edge. Passing * `"center"` will center the text and icons together. * * @default Alignment.CENTER */ alignText?: Alignment; /** Whether this button should expand to fill its container. */ fill?: boolean; /** Whether this button should use large styles. */ large?: boolean; /** * If set to `true`, the button will display a centered loading spinner instead of its contents. * The width of the button is not affected by the value of this prop. * * @default false */ loading?: boolean; /** Whether this button should use minimal styles. */ minimal?: boolean; /** Whether this button should use outlined styles. */ outlined?: boolean; /** Name of a Blueprint UI icon (or an icon element) to render after the text. */ rightIcon?: IconName | MaybeElement; /** Whether this button should use small styles. */ small?: boolean; /** * HTML `type` attribute of button. Accepted values are `"button"`, `"submit"`, and `"reset"`. * Note that this prop has no effect on `AnchorButton`; it only affects `Button`. * * @default "button" */ type?: "submit" | "reset" | "button"; } /** @deprecated use AnchorButtonProps */ export declare type IAnchorButtonProps = ButtonProps; export declare type AnchorButtonProps = IAnchorButtonProps; export interface IButtonState { isActive: boolean; } export declare abstract class AbstractButton extends AbstractPureComponent2 & (E extends HTMLButtonElement ? React.ButtonHTMLAttributes : React.AnchorHTMLAttributes), IButtonState> { state: { isActive: boolean; }; protected abstract buttonRef: HTMLElement | null; private currentKeyDown?; abstract render(): JSX.Element; protected getCommonButtonProps(): { className: string; disabled: (ButtonProps & (E extends HTMLButtonElement ? React.ButtonHTMLAttributes : React.AnchorHTMLAttributes))["loading"] | (ButtonProps & (E extends HTMLButtonElement ? React.ButtonHTMLAttributes : React.AnchorHTMLAttributes))["disabled"] | undefined; onBlur: (e: React.FocusEvent) => void; onClick: (ButtonProps & (E extends HTMLButtonElement ? React.ButtonHTMLAttributes : React.AnchorHTMLAttributes))["onClick"] | undefined; onKeyDown: (e: React.KeyboardEvent) => void; onKeyUp: (e: React.KeyboardEvent) => void; tabIndex: number | (ButtonProps & (E extends HTMLButtonElement ? React.ButtonHTMLAttributes : React.AnchorHTMLAttributes))["tabIndex"] | undefined; }; protected handleKeyDown: (e: React.KeyboardEvent) => void; protected handleKeyUp: (e: React.KeyboardEvent) => void; protected handleBlur: (e: React.FocusEvent) => void; protected renderChildren(): React.ReactNode; }