import * as React from 'react'; import type { ButtonAriaProps, ButtonRoles } from '../../a11y/button_aria_attributes/button_aria_attributes'; import type { BasicHTMLHandle } from '../../handle/handle'; import type { Icon, IconSize } from '../../icons/icons'; import type { TooltipProps } from '../../tooltip/tooltip'; type Tone = 'primary' | 'secondary' | 'tertiary' | 'critical' | 'contrast'; export type Variant = Tone | 'linkButton' | 'subtleLinkButton'; export type IconPosition = 'start' | 'end' | 'top'; export type Size = 'default' | 'tiny' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'; export type Shape = 'block' | 'circle'; export type Alignment = 'start' | 'center' | 'end'; export type ButtonHandle = BasicHTMLHandle; type AllVariant = Variant | 'basic' | 'primaryNeutral' | 'secondaryNeutral' | 'tertiaryNeutral'; type IconProps = { icon?: Icon iconSize?: IconSize iconPosition?: IconPosition }; export type CommonTooltipProps = { tooltipLabel?: TooltipProps['label'] tooltipDescription?: TooltipProps['description'] tooltipDisabled?: TooltipProps['disabled'] tooltipShortcut?: TooltipProps['shortcut'] tooltipPlacement?: TooltipProps['placement'] tooltipLineClamp?: TooltipProps['lineClamp'] tooltipCloseOnClick?: TooltipProps['closeOnClick'] }; export type CommonEventHandlerProps = { onFocus?: React.FocusEventHandler onBlur?: React.FocusEventHandler onDragStart?: React.DragEventHandler onDragEnd?: React.DragEventHandler onMouseEnter?: (event: React.MouseEvent) => void onMouseLeave?: (event: React.MouseEvent) => void onMouseDown?: (event: React.MouseEvent) => void onContextMenu?: (event: React.MouseEvent) => void }; export type CommonProps = { ref?: React.Ref stretch?: boolean draggable?: boolean children?: React.ReactNode className?: string role?: Exclude tabIndex?: -1 disableActiveStyle?: boolean loading?: boolean loadingVariant?: 'spinner' | 'scan' loadingMessage?: string loadingFinishedMessage?: string size?: Size expandClickableArea?: boolean id?: string disabled?: boolean alignment?: Alignment } & IconProps & ButtonAriaProps & CommonTooltipProps & CommonEventHandlerProps; type ButtonOnlyProps = { type?: 'submit' | 'button' | 'reset' onClick?: (event: React.MouseEvent) => void onMouseUp?: (event: React.MouseEvent) => void onPointerDown?: React.PointerEventHandler onPointerUp?: React.PointerEventHandler onPointerLeave?: React.PointerEventHandler form?: string ariaPressed?: boolean }; type AnchorOnlyProps = { rel?: string download?: string | boolean href: string target?: string onClick?: (event: React.MouseEvent) => void }; export type BasicVariantOnlyProps = { noChildWrapper?: boolean buttonRef?: React.Ref LoadingIcon?: Icon }; type NonBasicVariantOnlyProps = { variant: AllVariant shape?: Shape }; export type ButtonProps = CommonProps & ButtonOnlyProps; export type AnchorProps = CommonProps & AnchorOnlyProps; type AllButtonProps = ButtonProps & BasicVariantOnlyProps & NonBasicVariantOnlyProps & Pick & { LoadingIcon?: Icon; containerClassName?: string }; export declare const useShouldDisableSubmit: (initialShouldDisableSubmit: boolean) => boolean; type ButtonInnerProps = AllButtonProps & { tooltipLabel?: never; isTruncatedRef?: React.Ref; }; export declare const ButtonInner: React.ComponentType; type AllAnchorProps = AnchorProps & BasicVariantOnlyProps & NonBasicVariantOnlyProps; type AnchorInnerProps = AllAnchorProps & { tooltipLabel?: never; isTruncatedRef?: React.Ref; }; export declare const AnchorInner: React.ComponentType; type AnchorWithTooltipProps = AllAnchorProps & { tooltipLabel: string; isTruncatedRef?: React.Ref; }; export declare const AnchorWithTooltip: React.ComponentType; type CommonCircleButtonProps = Omit & { elevated?: boolean }; export type CircleButtonPropsWithChildren = CommonCircleButtonProps & Required> & { ariaLabelledBy?: never; ariaLabel?: never; }; export type CircleButtonPropsWithoutChildren = CommonCircleButtonProps & (Required> | Required> | { tooltipLabel: string; containerClassName?: string }) & { children?: never; }; type CircleButtonWithoutLabelProps = CircleButtonPropsWithoutChildren & { variant: Variant }; export declare function CircleButtonWithoutLabel({ ref, ...props }: CircleButtonWithoutLabelProps): React.ReactNode; type CircleButtonWithLabelProps = CircleButtonPropsWithChildren & { variant: Variant }; export declare function CircleButtonWithLabel({ variant, children, tooltipLabel: tooltipLabelProp, ref, ...props }: CircleButtonWithLabelProps): React.ReactNode; export declare function InternalButton({ tooltipLabel: tooltipLabelProp, ref, ...props }: AllButtonProps): React.ReactNode; export declare function InternalAnchor({ tooltipLabel: tooltipLabelProp, ref, ...props }: AllAnchorProps): React.ReactNode; export declare const renderButtonOrAnchor: ({ ...props }: Omit | (Omit & { type: "link"; }), ref?: React.ForwardedRef) => React.JSX.Element; export {};