UNPKG

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

Version:

Fluid Design System React

63 lines (62 loc) 1.95 kB
import React from 'react'; import { WithHTMLAttributes } from '../../utils/typeHelpers'; import { NJRadioProps } from './NJRadio'; export declare const NJRadioGroup: React.ForwardRefExoticComponent<import("../../utils/typeHelpers").HTMLAttributesWithoutComponentProps<"fieldset", NJRadioGroupOwnProps> & NJRadioGroupRef & { /** * Whether the radio group should be displayed in column or row */ orientation?: "column" | "row"; /** * Radio group selected radio component by id */ checkedId?: NJRadioProps["id"]; /** * Legend to label the radio group */ legend: string; /** * Message to provide when radio group is in error state */ errorMessage?: string; /** * All children radio components **/ children: React.ReactElement<NJRadioProps>[]; onChange?: (id: string, value: string, event: React.ChangeEvent<HTMLInputElement>) => void; /** * Optional additional className **/ className?: string; } & React.RefAttributes<HTMLFieldSetElement>>; type NJRadioGroupRef = { legendRef?: React.Ref<HTMLLegendElement>; }; type NJRadioGroupOwnProps = NJRadioGroupRef & { /** * Whether the radio group should be displayed in column or row */ orientation?: 'column' | 'row'; /** * Radio group selected radio component by id */ checkedId?: NJRadioProps['id']; /** * Legend to label the radio group */ legend: string; /** * Message to provide when radio group is in error state */ errorMessage?: string; /** * All children radio components **/ children: React.ReactElement<NJRadioProps>[]; onChange?: (id: string, value: string, event: React.ChangeEvent<HTMLInputElement>) => void; /** * Optional additional className **/ className?: string; }; export type NJRadioGroupProps = WithHTMLAttributes<NJRadioGroupOwnProps, 'fieldset'>; export {};