UNPKG

lucid-ui

Version:

A UI component library from Xandr.

232 lines 9.05 kB
import React from 'react'; import PropTypes from 'prop-types'; import { StandardProps, Overwrite } from '../../util/component-types'; import { IRadioGroupState } from './RadioGroup.reducers'; import { IRadioButtonLabeledLabelProps } from '../RadioButtonLabeled/RadioButtonLabeled'; import { IRadioButtonProps } from '../RadioButton/RadioButton'; /** RadioGroup */ export 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; } export declare type IRadioGroupProps = Overwrite<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, IRadioGroupPropsRaw>; declare const RadioGroup: { (props: IRadioGroupProps): JSX.Element; displayName: string; propTypes: { /** Should be instances of \`RadioGroup.RadioButton\` which supports the same props as \`RadioButton\`. */ children: PropTypes.Requireable<PropTypes.ReactNodeLike>; /** Appended to the component-specific class names set on the root element. */ className: PropTypes.Requireable<string>; /** Passed along to the \`RadioGroup.RadioButton\` children whose \`name\` props are ignored. */ name: PropTypes.Requireable<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: PropTypes.Requireable<(...args: any[]) => any>; /** Indicates which of the \`RadioGroup.RadioButton\` children is currently selected. The index of the last \`RadioGroup.RadioButton\` child with \`isSelected\` equal to true takes precedence over this prop. */ selectedIndex: PropTypes.Requireable<number>; /** Indicates whether all \`RadioGroup.RadioButton\` children should appear and act disabled by having a "greyed out" palette and ignoring user interactions. */ isDisabled: PropTypes.Requireable<boolean>; }; 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: IRadioButtonProps): React.ReactElement<any, string | React.JSXElementConstructor<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: PropTypes.Requireable<string>; isDisabled: PropTypes.Requireable<boolean>; isSelected: PropTypes.Requireable<boolean>; name: PropTypes.Requireable<string>; onSelect: PropTypes.Requireable<(...args: any[]) => any>; style: PropTypes.Requireable<object>; }; }; Label: { (props: IRadioButtonLabeledLabelProps): null; peek: { description: string; }; propTypes: { children: PropTypes.Requireable<PropTypes.ReactNodeLike>; }; displayName: string; }; }; declare const _default: { (props: IRadioGroupProps): JSX.Element; displayName: string; propTypes: { /** Should be instances of \`RadioGroup.RadioButton\` which supports the same props as \`RadioButton\`. */ children: PropTypes.Requireable<PropTypes.ReactNodeLike>; /** Appended to the component-specific class names set on the root element. */ className: PropTypes.Requireable<string>; /** Passed along to the \`RadioGroup.RadioButton\` children whose \`name\` props are ignored. */ name: PropTypes.Requireable<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: PropTypes.Requireable<(...args: any[]) => any>; /** Indicates which of the \`RadioGroup.RadioButton\` children is currently selected. The index of the last \`RadioGroup.RadioButton\` child with \`isSelected\` equal to true takes precedence over this prop. */ selectedIndex: PropTypes.Requireable<number>; /** Indicates whether all \`RadioGroup.RadioButton\` children should appear and act disabled by having a "greyed out" palette and ignoring user interactions. */ isDisabled: PropTypes.Requireable<boolean>; }; 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: IRadioButtonProps): React.ReactElement<any, string | React.JSXElementConstructor<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: PropTypes.Requireable<string>; isDisabled: PropTypes.Requireable<boolean>; isSelected: PropTypes.Requireable<boolean>; name: PropTypes.Requireable<string>; onSelect: PropTypes.Requireable<(...args: any[]) => any>; style: PropTypes.Requireable<object>; }; }; Label: { (props: IRadioButtonLabeledLabelProps): null; peek: { description: string; }; propTypes: { children: PropTypes.Requireable<PropTypes.ReactNodeLike>; }; displayName: string; }; } & import("../../util/state-management").IHybridComponent<IRadioGroupProps, IRadioGroupState>; export default _default; export { RadioGroup as RadioGroupDumb }; //# sourceMappingURL=RadioGroup.d.ts.map