import React, { CSSProperties, FocusEventHandler, ReactNode } from 'react'; import { SIZES, ALIGN_ITEMS } from './Radio.constants'; import { ValuesOf } from '../utils/typeUtils'; export type RadioAlignItems = ValuesOf; export type RadioSize = ValuesOf; export type OnChangeEvent = Pick & React.ChangeEvent; export interface RadioProps { /** Applies a data-hook HTML attribute that can be used in tests. */ dataHook?: string; /** * Specifies a CSS class name to be appended to the component's root element. * @internal */ className?: string; /** Specifies whether a radio is selected. */ checked?: boolean; /** Specifies whether radio should be disabled. */ disabled?: boolean; /** Sets the label on the right side of a radio. The default accepted value is a text string, but it can be overridden to any other component. */ label?: ReactNode; /** Assigns an unique identifier for the radio. */ id?: string; /** Sets the value that the radio represents. */ value?: string | number; /** Sets a unique name for the radio. */ name?: string; /** Sets an accessible name for the radio when no visible label is rendered, applied as `aria-label`. */ ariaLabel?: string; /** Sets the id of the element that labels the radio, applied as `aria-labelledby`. */ ariaLabelledby?: string; /** Defines a callback function which is called when radio is selected. */ onChange?(event: OnChangeEvent): void; /** Defines a callback function which is called when cursor enters radio. */ onMouseEnter?(event: OnChangeEvent): void; /** Defines a callback function which is called when cursor leaves radio. */ onMouseLeave?(event: OnChangeEvent): void; /** Control radio alignment with a label. */ alignItems?: RadioAlignItems; /** Controls the size of the label text. * @default 'medium' */ size?: RadioSize; /** Applies inline styles to the component's root element. */ style?: CSSProperties; /** Accepts the focus handler that the `withFocusable` wrapper injects to track the focus state. The wrapper overrides any value passed here. * @internal */ focusableOnFocus?: FocusEventHandler; /** Accepts the blur handler that the `withFocusable` wrapper injects to track the focus state. The wrapper overrides any value passed here. * @internal */ focusableOnBlur?: FocusEventHandler; } //# sourceMappingURL=Radio.types.d.ts.map