import { AriaButtonProps as RaButtonProps } from 'react-aria'; import { HTMLChakraProps, RecipeProps, UnstyledProp } from '@chakra-ui/react/styled-system'; import { SemanticPalettesOnly } from '../../type-utils'; type ButtonRecipeProps = { /** * Size variant of the button * @default "md" */ size?: RecipeProps<"nimbusButton">["size"]; /** * Visual style variant of the button * @default "subtle" */ variant?: RecipeProps<"nimbusButton">["variant"]; } & UnstyledProp; export type ButtonRootSlotProps = Omit, "slot" | "colorPalette"> & { slot?: string | null | undefined; /** * Color palette for the button */ colorPalette?: SemanticPalettesOnly; }; /** * Native HTML button props that have a preferred React Aria equivalent. * Each prop is annotated with the recommended alternative. */ type NativePropsWithAriaEquivalents = { /** * @deprecated Use `onPress` instead — it provides unified press handling * across mouse, touch, and keyboard interactions. */ onClick?: React.MouseEventHandler; /** * @deprecated Use `onHoverStart` instead — it ignores emulated mouse * events on touch devices. */ onMouseEnter?: React.MouseEventHandler; /** * @deprecated Use `onHoverEnd` instead — it ignores emulated mouse * events on touch devices. */ onMouseLeave?: React.MouseEventHandler; /** * @deprecated Use `isDisabled` instead — it additionally manages * `aria-disabled` for non-native button elements. */ disabled?: boolean; /** * @deprecated Use `isDisabled` instead — React Aria manages * `aria-disabled` automatically based on `isDisabled`. */ "aria-disabled"?: boolean | "true" | "false"; /** * @deprecated Use `excludeFromTabOrder` instead — it provides a semantic * boolean to remove the button from the tab order. */ tabIndex?: number; }; export type ButtonProps = Omit & RaButtonProps & NativePropsWithAriaEquivalents & { /** * Data attributes for testing or custom metadata */ [key: `data-${string}`]: unknown; /** * Slot name for React Aria Components composition */ slot?: string | null | undefined; /** * Ref forwarding to the button element */ ref?: React.Ref; }; export {};