lucid-ui
Version:
A UI component library from Xandr.
83 lines • 3.02 kB
TypeScript
import React from 'react';
import PropTypes from 'prop-types';
import { StandardProps, Overwrite } from '../../util/component-types';
export interface IRadioButtonPropsRaw extends StandardProps {
/** Indicates whether the component should appear and act disabled by having
* a "greyed out" palette and ignoring user interactions.
*
* @default false
*/
isDisabled: boolean;
/** Indicates that the component is in the "selected" state when true and in
* the "unselected" state when false.
*
* @default false
*/
isSelected: boolean;
/** Optional name for the input element */
name?: string;
/** Called when the user clicks on the component or when they press the space
* key while the component is in focus, and only called when the component
* is in the unselected state.
*/
onSelect: (isSelected: boolean, { event, props, }: {
event: React.MouseEvent<HTMLSpanElement>;
props: IRadioButtonProps;
}) => void;
}
export declare type IRadioButtonProps = Overwrite<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, IRadioButtonPropsRaw>;
export declare const defaultProps: {
isDisabled: boolean;
isSelected: boolean;
onSelect: (...args: any[]) => void;
};
export declare const RadioButton: {
(props: IRadioButtonProps): React.ReactElement;
defaultProps: {
isDisabled: boolean;
isSelected: boolean;
onSelect: (...args: any[]) => void;
};
displayName: string;
peek: {
description: string;
notes: {
overview: string;
intendedUse: string;
technicalRecommendations: string;
};
categories: string[];
};
propTypes: {
/**
Appended to the component-specific class names set on the root element.
*/
className: PropTypes.Requireable<string>;
/**
Indicates whether the component should appear and act disabled by having
a "greyed out" palette and ignoring user interactions.
*/
isDisabled: PropTypes.Requireable<boolean>;
/**
Indicates that the component is in the "selected" state when true and in
the "unselected" state when false.
*/
isSelected: PropTypes.Requireable<boolean>;
/**
Optional name for the input element.
*/
name: PropTypes.Requireable<string>;
/**
Called when the user clicks on the component or when they press the space
key while the component is in focus, and only called when the component
is in the unselected state. Signature: \`(true, { event, props }) => {}\`
*/
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
/**
Passed through to the root element.
*/
style: PropTypes.Requireable<object>;
};
};
export default RadioButton;
//# sourceMappingURL=RadioButton.d.ts.map