/** @module @airtable/blocks/ui: Button */ /** */ import PropTypes from 'prop-types'; import * as React from 'react'; import { EnumType } from '../private_utils'; import { OptionalResponsiveProp } from './system/utils/types'; import { MaxWidthProps, MinWidthProps, WidthProps, FlexItemSetProps, PositionSetProps, MarginProps } from './system'; import { ControlSizeProp } from './control_sizes'; import { AriaProps } from './types/aria_props'; import { TooltipAnchorProps } from './types/tooltip_anchor_props'; import { IconName } from './icon_config'; /** * Style props for the {@link Button} component. Also accepts: * * {@link FlexItemSetProps} * * {@link MarginProps} * * {@link MaxWidthProps} * * {@link MinWidthProps} * * {@link PositionSetProps} * * {@link WidthProps} * * @noInheritDoc */ interface ButtonStyleProps extends MaxWidthProps, MinWidthProps, WidthProps, FlexItemSetProps, PositionSetProps, MarginProps { /** Defines the display type of an element, which consists of the two basic qualities of how an element generates boxes — the outer display type defining how the box participates in flow layout, and the inner display type defining how the children of the box are laid out. */ display?: OptionalResponsiveProp<'inline-flex' | 'flex' | 'none'>; } export declare const buttonStylePropTypes: { display: PropTypes.Validator; }; /** * Variants for the {@link Button} component: * * • **default** * * Gray button for toolbars and other generic actions. * * • **primary** * * Blue button used for primary actions and CTAs. There should only be one primary button present at a time. Often used in {@link Dialog} and bottom bars. * * • **secondary** * * Transparent button that pairs with the primary button. This is typically used for cancel or back buttons. * * • **danger** * * Red button that replaces primary buttons for dangerous or otherwise difficult-to-reverse actions like record deletion. */ type ButtonVariant = EnumType; declare const ButtonVariant: { default: "default"; danger: "danger"; primary: "primary"; secondary: "secondary"; }; /** * Props for the {@link Button} component. Also accepts: * * {@link AriaProps} * * {@link ButtonStyleProps} * * @noInheritDoc * @docsPath UI/components/Button */ export interface ButtonProps extends AriaProps, ButtonStyleProps, TooltipAnchorProps { /** The size of the button. Defaults to `default`. Can be a responsive prop object. */ size?: ControlSizeProp; /** The variant of the button. Defaults to `default`. */ variant?: ButtonVariant; /** The name of the icon or a React node. For more details, see the {@link IconName|list of supported icons}. */ icon?: IconName | React.ReactElement; /** The type of the button. Defaults to `button`. */ type?: 'button' | 'submit' | 'reset'; /** The `id` attribute. */ id?: string; /** Indicates whether or not the user can interact with the button. */ disabled?: boolean; /** Indicates if the button can be focused and if/where it participates in sequential keyboard navigation. */ tabIndex?: number; /** The contents of the button. */ children?: React.ReactNode | string; /** Click event handler. Also handles Space and Enter keypress events. */ onClick?: (e?: React.MouseEvent) => unknown; /** Extra `className`s to apply to the button, separated by spaces. */ className?: string; /** Extra styles to apply to the button. */ style?: React.CSSProperties; /** The `aria-selected` attribute. */ 'aria-selected'?: boolean; } declare const ForwardedRefButton: React.ForwardRefExoticComponent>; export default ForwardedRefButton; //# sourceMappingURL=button.d.ts.map