UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

176 lines (175 loc) 5.94 kB
import React from 'react'; import { StandardProps, Overwrite } from '../../util/component-types'; import { IRadioGroupState } from './RadioGroup.reducers'; import { IRadioButtonLabeledLabelProps } from '../RadioButtonLabeled/RadioButtonLabeled'; import { IRadioButtonProps } from '../RadioButton/RadioButton'; interface IRadioGroupPropsRaw extends StandardProps { /** * Passed along to the \`RadioGroup.RadioButton\' children whose \'name\' * props are ignored. */ name: string; /** * Called when the user clicks on one of the child radio buttons or when * they press the space key while one is in focus, and only called when the * component is in the unselected state. \`props\` refers to the child * \`RadioButton\` props. Signature: \`(selectedIndex, { event, props }) => {}\` */ onSelect: (selectedIndex: string | number, { event, props, }: { event: React.MouseEvent; props: IRadioButtonProps; }) => void; /** * Indicates which \`RadioGroup.RadioButton\' child is currently * selected. The index of the last \`RadioGroup.RadioButton\` child with * \'isSelected\' equal to true takes precedence over this prop. */ selectedIndex: number; /** * Indicates whether all \`RadioGroup.RadioButton\' children should appear * and act disabled by having a "greyed out" palette and ignoring user * interactions. */ isDisabled: boolean; } declare type IRadioGroupProps = Overwrite<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, IRadioGroupPropsRaw>; declare const RadioGroup: { (props: IRadioGroupProps): JSX.Element; displayName: string; propTypes: { children: any; className: any; name: any; onSelect: any; selectedIndex: any; isDisabled: any; }; peek: { description: string; notes: { overview: string; intendedUse: string; technicalRecommendations: string; }; categories: string[]; madeFrom: string[]; }; defaultProps: { name: string; onSelect: (...args: any[]) => void; selectedIndex: number; isDisabled: boolean; }; reducers: { onSelect(state: IRadioGroupState | undefined, selectedIndex: number): { selectedIndex: number; }; }; RadioButton: { (props: Overwrite<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("../RadioButton/RadioButton").IRadioButtonPropsRaw>): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>; defaultProps: { isDisabled: boolean; isSelected: boolean; onSelect: (...args: any[]) => void; }; displayName: string; peek: { description: string; notes: { overview: string; intendedUse: string; technicalRecommendations: string; }; categories: string[]; }; propTypes: { className: any; isDisabled: any; isSelected: any; name: any; onSelect: any; style: any; }; }; Label: { (props: IRadioButtonLabeledLabelProps): null; peek: { description: string; }; propTypes: { children: any; }; displayName: string; }; }; declare const _default: { (props: Overwrite<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, IRadioGroupPropsRaw>): JSX.Element; displayName: string; propTypes: { children: any; className: any; name: any; onSelect: any; selectedIndex: any; isDisabled: any; }; peek: { description: string; notes: { overview: string; intendedUse: string; technicalRecommendations: string; }; categories: string[]; madeFrom: string[]; }; defaultProps: { name: string; onSelect: (...args: any[]) => void; selectedIndex: number; isDisabled: boolean; }; reducers: { onSelect(state: IRadioGroupState | undefined, selectedIndex: number): { selectedIndex: number; }; }; RadioButton: { (props: Overwrite<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("../RadioButton/RadioButton").IRadioButtonPropsRaw>): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>; defaultProps: { isDisabled: boolean; isSelected: boolean; onSelect: (...args: any[]) => void; }; displayName: string; peek: { description: string; notes: { overview: string; intendedUse: string; technicalRecommendations: string; }; categories: string[]; }; propTypes: { className: any; isDisabled: any; isSelected: any; name: any; onSelect: any; style: any; }; }; Label: { (props: IRadioButtonLabeledLabelProps): null; peek: { description: string; }; propTypes: { children: any; }; displayName: string; }; } & import("../../util/state-management").IHybridComponent<Overwrite<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, IRadioGroupPropsRaw>, IRadioGroupState>; export default _default; export { RadioGroup as RadioGroupDumb };