@combine-labs/combine-polaris
Version:
Combine Lab's product component library. Forked from Shopify's Polaris.
36 lines (35 loc) • 1.36 kB
TypeScript
import * as React from 'react';
import { WithAppProviderProps } from '../AppProvider';
import { Error } from '../../types';
export interface BaseProps {
/** Label for the checkbox */
label: React.ReactNode;
/** Visually hide the label */
labelHidden?: boolean;
/** Checkbox is selected. `indeterminate` shows a horizontal line in the checkbox */
checked?: boolean | 'indeterminate' | 'inactiveChecked';
/** Additional text to aide in use */
helpText?: React.ReactNode;
/** Disable input */
disabled?: boolean;
/** ID for form input */
id?: string;
/** Name for form input */
name?: string;
/** Value for form input */
value?: string;
/** Display an error message */
error?: Error | boolean;
/** Callback when checkbox is toggled */
onChange?(newChecked: boolean, id: string): void;
/** Callback when checkbox is focussed */
onFocus?(): void;
/** Callback when focus is removed */
onBlur?(): void;
}
export interface Props extends BaseProps {
}
export declare type CombinedProps = Props & WithAppProviderProps;
declare function Checkbox({ id, label, labelHidden, helpText, checked, error, disabled, onChange, onFocus, onBlur, name, value, }: CombinedProps): JSX.Element;
declare const _default: React.ComponentClass<Props> & typeof Checkbox;
export default _default;