import { default as React } from 'react'; import { FeedbackTextProps } from '../../../../tedi/components/form/feedback-text/feedback-text'; import { FormLabelProps } from '../../../../tedi/components/form/form-label/form-label'; import { Direction, RowProps } from '../../../../tedi/components/layout/grid'; import { CheckProps } from '../check/check'; import { ChoiceGroupItemProps } from './choice-group.types'; export type TChoiceGroupValue = string | string[] | null; export type TChoiceGroupType = 'radio' | 'checkbox'; export type TChoiceGroupIndeterminateState = 'none' | 'some' | 'all'; export interface ChoiceGroupProps extends FormLabelProps { /** * ID of choice-group. */ id: string; /** * Item props array */ items: ChoiceGroupItemProps[]; /** * Direction for Row containing Items * @default column for type default / row for anything else * @deprecated use rowProps */ direction?: Direction; /** * Row props */ rowProps?: RowProps; /** * Name property on inputs */ name: string; /** * Input type * @default radio */ inputType?: TChoiceGroupType; /** * Form helper props */ helper?: FeedbackTextProps; /** * Custom class */ className?: string; /** * Default value of ChoiceGroup. Won't work with value and onChange. */ defaultValue?: TChoiceGroupValue; /** * The value of ChoiceGroup. Use to control value outside of component. Should use with onChange prop. */ value?: TChoiceGroupValue; /** * onChange handler */ onChange?: (value: TChoiceGroupValue) => void; /** * Type of ChoiceGroup * @default default */ type?: 'light' | 'selector' | 'filter' | 'default'; /** * Value can be one of two options:
* `true` - Uses default internal label.
* `string` - Label for the indeterminate checkbox.
* `function` - Function that can be used for conditional label.
* If omitted then the indeterminate checkbox isn't rendered. * Only works with `inputType="checkbox"` and `type="default"` */ indeterminateCheck?: boolean | string | ((state: TChoiceGroupIndeterminateState) => string); /** * Overridable Indeterminate Check props. * Applies only when `indeterminateCheckLabel` is used * @default { indented: true } */ indeterminateCheckProps?: { indented?: boolean; } & Partial>; } export declare const ChoiceGroup: (props: ChoiceGroupProps) => React.ReactElement; export default ChoiceGroup;