| 1 |
import { Component } from 'react'; |
| 2 |
import { PickOptional } from '../../helpers/typeUtils'; |
| 3 |
import { OUIAProps } from '../../helpers'; |
| 4 |
export interface RadioProps extends Omit<React.HTMLProps<HTMLInputElement>, 'disabled' | 'label' | 'onChange' | 'type'>, OUIAProps { |
| 5 |
/** Additional classes added to the radio wrapper. This wrapper will be div element by default. It will be a label element if |
| 6 |
* isLabelWrapped is true, or it can be overridden by any element specified in the component prop. |
| 7 |
*/ |
| 8 |
className?: string; |
| 9 |
/** Additional classes added to the radio input. */ |
| 10 |
inputClassName?: string; |
| 11 |
/** Id of the radio. */ |
| 12 |
id: string; |
| 13 |
/** Flag to indicate whether the radio wrapper element is a native label element for the radio input. Will not apply if a component prop (with a value other than a "label") is specified. */ |
| 14 |
isLabelWrapped?: boolean; |
| 15 |
/** Flag to show if the radio is checked. */ |
| 16 |
checked?: boolean; |
| 17 |
/** Flag to show if the radio is checked. */ |
| 18 |
isChecked?: boolean; |
| 19 |
/** Flag to show if the radio is disabled. */ |
| 20 |
isDisabled?: boolean; |
| 21 |
/** Flag to show if the radio selection is valid or invalid. */ |
| 22 |
isValid?: boolean; |
| 23 |
/** Label text of the radio. */ |
| 24 |
label?: React.ReactNode; |
| 25 |
/** Sets the position of the label. Defaults to 'end' (after the radio input). */ |
| 26 |
labelPosition?: 'start' | 'end'; |
| 27 |
/** Name for group of radios */ |
| 28 |
name: string; |
| 29 |
/** A callback for when the radio selection changes. */ |
| 30 |
onChange?: (event: React.FormEvent<HTMLInputElement>, checked: boolean) => void; |
| 31 |
/** Aria label for the radio. */ |
| 32 |
'aria-label'?: string; |
| 33 |
/** Description text of the radio. */ |
| 34 |
description?: React.ReactNode; |
| 35 |
/** Body of the radio. */ |
| 36 |
body?: React.ReactNode; |
| 37 |
/** Custom aria-describedby value for the radio input. If not provided and description is set, a unique ID will be generated automatically. */ |
| 38 |
'aria-describedby'?: string; |
| 39 |
/** Sets the radio wrapper component to render. Defaults to "div". If set to "label", behaves the same as if isLabelWrapped prop was specified. */ |
| 40 |
component?: React.ElementType; |
| 41 |
/** Value to overwrite the randomly generated data-ouia-component-id.*/ |
| 42 |
ouiaId?: number | string; |
| 43 |
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */ |
| 44 |
ouiaSafe?: boolean; |
| 45 |
} |
| 46 |
declare class Radio extends Component<RadioProps> { |
| 47 |
static displayName: string; |
| 48 |
static defaultProps: PickOptional<RadioProps>; |
| 49 |
constructor(props: RadioProps); |
| 50 |
handleChange: (event: React.FormEvent<HTMLInputElement>) => void; |
| 51 |
render(): import("react/jsx-runtime").JSX.Element; |
| 52 |
} |
| 53 |
export { Radio }; |
| 54 |
//# sourceMappingURL=Radio.d.ts.map |