UNPKG

@engie-group/fluid-design-system-react

Version:

Fluid Design System React

92 lines (91 loc) 2.34 kB
import React from 'react'; import { TSizeVariants } from '../../global'; export declare const NJCheckbox: React.ForwardRefExoticComponent<ICheckboxProps & React.RefAttributes<HTMLInputElement>>; export interface ICheckboxProps { /** * Checkbox size **/ size?: Extract<TSizeVariants, 'md' | 'lg' | 'xl'>; /** * Whether the checkbox is checked or not **/ isChecked?: boolean; /** * Whether the checkbox is disabled or not **/ isDisabled?: boolean; /** * Whether input is required or not **/ isRequired?: boolean; /** * Whether checkbox is in success state */ hasSuccess?: boolean; /** * Whether checkbox is in error state */ hasError?: boolean; /** * Checkbox hint subscript text */ subscriptMessage?: string; /** * [Deprecated] Use `subscriptMessage` with `hasError={true}` instead of * Message to display if the field is in error state */ errorMessage?: string; /** * Aria label, for accessibility reasons **/ ariaLabel?: string; /** * Aria labeled by, for accessibility reasons **/ ariaLabelledBy?: string; /** * Input id **/ inputId: string; /** * Input name **/ name?: string; /** * Label */ label?: string; /** * Input value. If not passed, it will default to "on"/"off" **/ value?: string; /** * Input tabIndex */ tabIndex?: number; /** * Use the onChange function to get checked status and value from the parent **/ onChange?: (event?: React.ChangeEvent<HTMLInputElement>, checked?: boolean, value?: string) => void; /** * On Blur event **/ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void; /** * Children to pass if no label is set */ children?: React.ReactNode; /** * Whether a checkbox is only presentational and state-handled by a parent, can be useful for lists of checkboxes. * When set to `true`, the checkbox won't have any interaction. */ isPresentational?: boolean; /** * Optional additional className */ className?: string; /** * Whether the checkbox is in an indeterminate state or not. */ isIndeterminate?: boolean; }