import * as React from 'react'; import { IconElement, TooltipCommonProps } from '../common'; import { ValuesOf } from '../utils/typeUtils'; import { SIZES } from './Button.constants'; export type ButtonWithAsProp = ButtonAsButtonProps | ButtonAsAnchorProps | ButtonGenericProps | ButtonAsComponentProps; export type ButtonAsButtonProps = React.ButtonHTMLAttributes & T & { /** Renders component as any other component or a given HTML tag. */ as?: 'button'; /** Defines a callback function which is called every time a button is clicked. */ onClick?: React.MouseEventHandler; }; export type ButtonAsAnchorProps = React.AnchorHTMLAttributes & T & { /** Renders component as any other component or a given HTML tag. */ as: 'a'; /** Defines a callback function which is called every time a button is clicked. */ onClick?: React.MouseEventHandler; }; export type ButtonGenericProps = T & { /** Renders component as any other component or a given HTML tag. */ as: keyof Omit; /** Defines a callback function which is called every time a button is clicked. */ onClick?: React.MouseEventHandler; [additionalProps: string]: any; }; export type ButtonAsComponentProps = T & { /** Renders component as any other component or a given HTML tag. */ as: React.ComponentType; /** Defines a callback function which is called every time a button is clicked. */ onClick?: React.MouseEventHandler; [additionalProps: string]: any; }; export type ButtonProps = ButtonWithAsProp<{ /** Accepts any item as a child element. For all common cases pass a standard text string. */ children?: React.ReactNode; /** Specifies a CSS class name to be appended to the component's root element. * @internal */ className?: string; /** Specifies the skin of a button. */ skin?: ButtonSkin; /** Specifies the priority of a button. */ priority?: ButtonPriority; /** * Controls the size of a button. * @default medium */ size?: ButtonSize; /** Sets button width to fill a 100% of a parent container width. */ fullWidth?: boolean; /** Pass an icon or a component to display at the end of a label (e.g., svg, image, etc.) */ suffixIcon?: IconElement; /** Pass an icon or a component to display at the front of a label (e.g., svg, image, etc.) */ prefixIcon?: IconElement; /** Specifies whether user interactions are disabled. */ disabled?: boolean; /** Applies a data-hook HTML attribute that can be used in the tests. */ dataHook?: string; /** Specifies whether component handles text overflow with ellipsis. If enabled, a label that exceeds the available space is displayed inside a tooltip when the user hovers over the button. */ ellipsis?: boolean; /** Applies internal dataHook for internal testkits. * @internal */ internalDataHook?: string; /** Specifies whether the full button label is displayed in a tooltip when label overflows available space. * * Behaviour is enabled by default. Set property value to false to show ellipsis without a tooltip. */ showTooltip?: boolean; /** Allows to pass all common tooltip props. Use it to customize a tooltip created from text ellipsis. * @linkTypeTo Tooltip */ tooltipProps?: TooltipCommonProps; }>; export declare class Button extends React.Component { } type ButtonSkinAll = 'standard' | 'inverted' | 'destructive' | 'premium' | 'dark' | 'light' | 'transparent' | 'premium-light' | 'ai'; export type ButtonSkinSupported = Exclude; /** @deprecated will be removed in next major release. Use `skin="standard"` with `priority="secondary"` instead. */ export type ButtonSkinDeprecated = Extract; export type ButtonSkin = ButtonSkinSupported | ButtonSkinDeprecated; export type ButtonPriority = 'primary' | 'secondary' | 'tertiary'; export type ButtonSize = ValuesOf; export {}; //# sourceMappingURL=Button.types.d.ts.map