import { TooltipPosition } from '../Tooltip/Tooltip.types'; import { ButtonHTMLAttributes, ReactNode } from 'react'; /** * Visual variants for the Button component * Extended to match ib-ui platform variants */ export type ButtonVariant = 'primary' | 'primaryInverse' | 'secondary' | 'secondaryInverse' | 'ghost' | 'ghostInverse' | 'ghostDanger' | 'positive' | 'danger' | 'destructive' | 'link' | 'outlinePrimary' | 'outlineSecondary' | 'outlineSuccess' | 'outlineError' | 'outlineDanger' | 'outlineWarning'; /** * Font weight options for button text */ export type ButtonFontWeight = 'bold' | 'normal'; /** * Size variants for the Button component * Extended to include xs from ib-ui */ export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg'; /** * Tooltip props for button tooltips */ export interface ButtonTooltipProps { /** Position of the tooltip */ position?: TooltipPosition; /** Delay before showing tooltip (ms) */ delay?: number; /** Delay before hiding tooltip (ms) */ hideDelay?: number; /** Maximum width of tooltip */ maxWidth?: number | string; /** Custom z-index for tooltip */ zIndex?: number; } /** * Base button props without children requirement */ interface BaseButtonProps extends Omit, 'children'> { /** Visual variant */ variant?: ButtonVariant; /** Size variant */ size?: ButtonSize; /** Full width button */ fullWidth?: boolean; /** Disabled state */ disabled?: boolean; /** Loading state with spinner */ loading?: boolean; /** Icon to display before text (alias: leftIcon) */ icon?: ReactNode; /** Icon to display before text */ leftIcon?: ReactNode; /** Icon to display after text */ rightIcon?: ReactNode; /** Button type attribute */ type?: 'button' | 'submit' | 'reset'; /** Click handler */ onClick?: (event: React.MouseEvent) => void; /** Additional CSS classes */ className?: string; /** Accessible label */ 'aria-label'?: string; /** Test ID for testing (deprecated, use dataTestId) */ 'data-testid'?: string; /** Test identifier for automated testing */ dataTestId?: string; /** Data identifier for ib-ui compatibility */ dataId?: string; /** Active/pressed state for toggle buttons */ active?: boolean; /** Tooltip content - wraps button in Tooltip component */ tooltip?: ReactNode; /** Props to pass to the tooltip component */ tooltipProps?: ButtonTooltipProps; /** Fixed width in pixels */ width?: number; /** Responsive mode - auto fullWidth on mobile (not implemented yet) */ responsive?: boolean; /** Show help cursor instead of pointer */ showHelpCursor?: boolean; /** Font weight for button text */ fontWeight?: ButtonFontWeight; /** Custom outline color for outline variants (CSS color value) */ outlineColor?: string; /** Custom background color for solid variants (CSS color value) */ backgroundColor?: string; /** Custom text color for solid variants (CSS color value) */ textColor?: string; } /** * Button with children (text content) */ interface ButtonWithChildren extends BaseButtonProps { /** Button content */ children: ReactNode; } /** * Icon-only button (requires aria-label) */ interface IconOnlyButton extends BaseButtonProps { /** Button content - optional for icon-only buttons */ children?: never; /** Icon is required for icon-only buttons */ icon: ReactNode; /** Accessible label is required for icon-only buttons */ 'aria-label': string; } /** * Props for the Button component * Extended with ib-ui props while maintaining backward compatibility */ export type ButtonProps = ButtonWithChildren | IconOnlyButton; export {}; //# sourceMappingURL=Button.types.d.ts.map