import React, { ReactNode } from 'react'; import { ThemeOverrideProps } from '@xsolla/xui-core'; interface ButtonProps extends ThemeOverrideProps { /** Visual variant of the button */ variant?: "primary" | "secondary" | "tertiary" | "ghost"; /** Color tone of the button */ tone?: "brand" | "brandExtra" | "alert" | "mono"; /** Size of the button */ size?: "xl" | "lg" | "md" | "sm" | "xs"; /** Whether the button is disabled */ disabled?: boolean; /** Whether the button is in a loading state */ loading?: boolean; /** Button content */ children: React.ReactNode; /** * Activation handler. Invoked on click, or on Enter/Space when the button is * focused. Not called while `disabled` or `loading`. */ onPress?: () => void; /** * Icon to display on the left side. * Size and color are automatically set based on button size/state. * To override, specify size/color on the icon: `iconLeft={}` */ iconLeft?: React.ReactNode; /** * Icon to display on the right side. * Size and color are automatically set based on button size/state. * To override, specify size/color on the icon: `iconRight={}` */ iconRight?: React.ReactNode; /** Secondary text displayed inline with the main label (e.g., price), shown with 40% opacity */ sublabel?: string; /** Alignment of the label text */ labelAlignment?: "left" | "center"; /** * Small icon displayed directly to the left of the label text. * Size and color are automatically set based on button size/state. * To override, specify size/color on the icon: `labelIcon={}` */ labelIcon?: React.ReactNode; /** * Small icon displayed directly to the right of the label text. * Size and color are automatically set based on button size/state. * To override, specify size/color on the icon: `labelIconRight={}` */ labelIconRight?: React.ReactNode; /** Custom content slot for badges, tags, or other elements */ customContent?: React.ReactNode; /** Accessible label for screen readers (use for icon-only buttons) */ "aria-label"?: string; /** ID of element that describes this button */ "aria-describedby"?: string; /** Indicates the button controls an expandable element */ "aria-expanded"?: boolean; /** Indicates the type of popup triggered by the button */ "aria-haspopup"?: boolean | "menu" | "listbox" | "tree" | "grid" | "dialog"; /** Indicates the button is pressed (for toggle buttons) */ "aria-pressed"?: boolean | "mixed"; /** ID of the element this button controls */ "aria-controls"?: string; testID?: string; id?: string; /** HTML type attribute for the button */ type?: "button" | "submit" | "reset"; /** Whether the button should stretch to fill the full width of its container */ fullWidth?: boolean; } /** * Button - An accessible button component * * Renders as a semantic `