lucid-ui
Version:
A UI component library from Xandr.
93 lines • 3.5 kB
TypeScript
import React from 'react';
import PropTypes from 'prop-types';
import { StandardProps, Overwrite } from '../../util/component-types';
export interface ICheckboxPropsRaw extends StandardProps {
/** Indicates whether the component should appear in an "indeterminate" or
* "partially checked" state. This prop takes precedence over
* \`isSelected\`.
*/
isIndeterminate: boolean;
/** Indicates whether the component should appear and act disabled by having
* a "greyed out" palette and ignoring user interactions.
*/
isDisabled: boolean;
/** Indicates that the component is in the "selected" state when true and in
* the "unselected" state when false. This props is ignored if
* \`isIndeterminate\` is \`true\`.
*/
isSelected: boolean;
/** Called when the user clicks on the component or when they press the space
* key while the component is in focus.
*/
onSelect: (isSelected: boolean, { event, props, }: {
event: React.MouseEvent<HTMLInputElement>;
props: ICheckboxProps;
}) => void;
/** A string title that is displayed on hover. */
title?: string;
}
export declare type ICheckboxProps = Overwrite<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, ICheckboxPropsRaw>;
export declare const defaultProps: {
isIndeterminate: boolean;
isDisabled: boolean;
isSelected: boolean;
onSelect: (...args: any[]) => void;
};
export declare const Checkbox: {
(props: ICheckboxProps): React.ReactElement;
displayName: string;
peek: {
description: string;
notes: {
overview: string;
intendedUse: string;
technicalRecommendations: string;
};
categories: string[];
};
defaultProps: {
isIndeterminate: boolean;
isDisabled: boolean;
isSelected: boolean;
onSelect: (...args: any[]) => void;
};
propTypes: {
/**
Appended to the component-specific class names set on the root element.
*/
className: PropTypes.Requireable<string>;
/**
Indicates whether the component should appear in an "indeterminate" or
"partially checked" state. This prop takes precedence over
\`isSelected\`.
*/
isIndeterminate: PropTypes.Requireable<boolean>;
/**
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. This props is ignored if
\`isIndeterminate\` is \`true\`.
*/
isSelected: PropTypes.Requireable<boolean>;
/**
Called when the user clicks on the component or when they press the space
key while the component is in focus. Signature:
\`(isSelected, { event, props }) => {}\`
*/
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
/**
Passed through to the root element.
*/
style: PropTypes.Requireable<object>;
/**
A string title that is displayed on hover.
*/
title: PropTypes.Requireable<string>;
};
};
export default Checkbox;
//# sourceMappingURL=Checkbox.d.ts.map