import React from 'react'; import type { GetRef } from '../utils/refs'; import type { Colors, CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types'; import type { BuiltInTooltipConfig } from './tooltip/types'; type ButtonColors = 'default' | 'primary' | 'critical'; type ButtonVariants = 'filled' | 'outlined' | 'ghost'; type ButtonSizes = 'default' | 'small'; type ButtonThemes = 'onLight' | 'onDark'; type IconOnlyConfig = { icon: React.ReactNode; label?: never; tooltipConfig: BuiltInTooltipConfig; 'aria-label': string; }; type LabelOnlyConfig = { icon?: never; label: React.ReactNode; tooltipConfig?: BuiltInTooltipConfig; }; type LabelAndIconConfig = { icon: React.ReactNode; label: React.ReactNode; tooltipConfig?: BuiltInTooltipConfig; }; type ButtonLabelConfig = IconOnlyConfig | LabelOnlyConfig | LabelAndIconConfig; type BadgeConfig = { number: number; upperBound?: number; backgroundColor: Colors; textColor: Colors; }; type ModernButtonProps = { 'aria-controls'?: string; 'aria-expanded'?: React.AriaAttributes['aria-expanded']; 'aria-pressed'?: boolean; badge?: BadgeConfig; color?: ButtonColors; disabled?: boolean; getRef?: GetRef; iconPosition?: 'start' | 'end'; id?: string; isActive?: boolean; linkComponent?: 'a' | React.ComponentType; linkProps?: Record; name?: string; onBlur?: React.FocusEventHandler; onClick?: React.MouseEventHandler; onFocus?: React.FocusEventHandler; onMouseDown?: React.MouseEventHandler; onMouseEnter?: React.MouseEventHandler; onMouseLeave?: React.MouseEventHandler; onMouseUp?: React.MouseEventHandler; size?: ButtonSizes; theme?: ButtonThemes; title?: string; type?: 'button' | 'submit'; variant?: ButtonVariants; } & CommonComponentProps & MarginModifierProp & ModifierClassProp & ButtonLabelConfig; /** * The ModernButton component is a flexible button component that should be preferred for new implementations. * * It supports various configurations such as colors, sizes, and variants and can render as a button or a link. * * It can be used as a label only, icon only, or icon + label button, and supports a built-in tooltip for better accessibility. * * When both `icon` and `label` are provided, the button will render both, with the `iconPosition` determining the placement of the icon. * If only `icon` is provided, the button will be treated as an icon-only button and requires an `aria-label` and `tooltipConfig` for accessibility. * * The `theme` prop determines the button's color scheme, with 'onLight' and 'onDark' being available options. They are relatively self explanatory * but `onDark` can also be used to render a solid white background button if needed despite not being over a dark background. * * The `badge` prop allows displaying a circular badge with a number in the top-right corner of the button. * Badge colors can be customized via the `backgroundColor` and `textColor` properties within the badge configuration. * If an `upperBound` is provided, the badge will display a '+' sign when the number exceeds this value. * For example, if `badge.number` is 5 and `badge.upperBound` is 3, the badge will display '2+'. * * Default values: * - `color`: 'default' * - `iconPosition`: 'start' * - `size`: 'default' * - `theme`: 'onLight' * - `variant`: 'filled' */ export declare function ModernButton({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, badge, color, disabled, getRef, id, icon, iconPosition, isActive, label, linkComponent, linkProps, margin, name, onBlur, onClick, onFocus, onMouseDown, onMouseEnter, onMouseLeave, onMouseUp, size, theme, title, tooltipConfig, type, variant, ...rest }: ModernButtonProps): React.JSX.Element; export {};