UNPKG

@fluentui/react-northstar

Version:
54 lines (53 loc) 2.84 kB
import { Accessibility, RadioGroupBehaviorProps } from '@fluentui/accessibility'; import * as PropTypes from 'prop-types'; import * as React from 'react'; import { UIComponentProps, ChildrenComponentProps } from '../../utils'; import { RadioGroupItem, RadioGroupItemProps } from './RadioGroupItem'; import { ComponentEventHandler, ShorthandCollection, FluentComponentStaticProps } from '../../types'; export interface RadioGroupProps extends UIComponentProps, ChildrenComponentProps { /** Accessibility behavior if overridden by the user. */ accessibility?: Accessibility<RadioGroupBehaviorProps>; /** Value of the currently checked radio item. */ checkedValue?: number | string; /** * Called after radio group value is changed. * @param event - React's original SyntheticEvent. * @param data - All value props. */ onCheckedValueChange?: ComponentEventHandler<RadioGroupItemProps>; /** Initial checkedValue value. */ defaultCheckedValue?: number | string; /** Shorthand array of props for RadioGroup. */ items?: ShorthandCollection<RadioGroupItemProps>; /** A vertical radio group displays elements vertically. */ vertical?: boolean; } export declare const radioGroupClassName = "ui-radiogroup"; export declare type RadioGroupStylesProps = Required<Pick<RadioGroupProps, 'vertical'>>; /** * A RadioGroup allows user to select a value from a small set of mutually exclusive options. * * @accessibility * Implements [ARIA Radio Group](https://www.w3.org/TR/wai-aria-practices-1.1/#radiobutton) design pattern. * @accessibilityIssues * [JAWS narrates instruction message on each radio in radiogroup](https://github.com/FreedomScientific/VFO-standards-support/issues/473) */ export declare const RadioGroup: (<TExtendedElementType extends React.ElementType<any> = "div">(props: React.RefAttributes<HTMLDivElement> & Omit<import("@fluentui/react-bindings").PropsOfElement<TExtendedElementType>, "as" | keyof RadioGroupProps> & { as?: TExtendedElementType; } & RadioGroupProps) => JSX.Element) & { propTypes?: React.WeakValidationMap<RadioGroupProps> & { as: React.Requireable<string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any)>; }; contextTypes?: PropTypes.ValidationMap<any>; defaultProps?: Partial<RadioGroupProps & { as: "div"; }>; displayName?: string; readonly __PRIVATE_PROPS?: React.RefAttributes<HTMLDivElement> & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & { ref?: React.Ref<HTMLDivElement>; }, "as" | keyof RadioGroupProps> & { as?: "div"; } & RadioGroupProps; } & FluentComponentStaticProps<RadioGroupProps> & { Item: typeof RadioGroupItem; };