UNPKG

1.52 kBTypeScriptView Raw
1import * as React from 'react';
2import { PickOptional } from '../../helpers/typeUtils';
3import { OUIAProps } from '../../helpers';
4export interface CheckboxProps extends Omit<React.HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'disabled' | 'label'>, OUIAProps {
5 /** Additional classes added to the Checkbox. */
6 className?: string;
7 /** Flag to show if the Checkbox selection is valid or invalid. */
8 isValid?: boolean;
9 /** Flag to show if the Checkbox is disabled. */
10 isDisabled?: boolean;
11 /** Flag to show if the Checkbox is checked. If null, the checkbox will be indeterminate (partially checked). */
12 isChecked?: boolean | null;
13 checked?: boolean;
14 /** A callback for when the Checkbox selection changes. */
15 onChange?: (checked: boolean, event: React.FormEvent<HTMLInputElement>) => void;
16 /** Label text of the checkbox. */
17 label?: React.ReactNode;
18 /** Id of the checkbox. */
19 id: string;
20 /** Aria-label of the checkbox. */
21 'aria-label'?: string;
22 /** Description text of the checkbox. */
23 description?: React.ReactNode;
24 /** Body text of the checkbox */
25 body?: React.ReactNode;
26}
27interface CheckboxState {
28 ouiaStateId: string;
29}
30export declare class Checkbox extends React.Component<CheckboxProps, CheckboxState> {
31 static displayName: string;
32 static defaultProps: PickOptional<CheckboxProps>;
33 constructor(props: any);
34 private handleChange;
35 render(): JSX.Element;
36}
37export {};
38//# sourceMappingURL=Checkbox.d.ts.map
\No newline at end of file