@helpwave/hightide
Version:
helpwave's component and theming library
42 lines (39 loc) • 1.31 kB
text/typescript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { CheckedState } from '@radix-ui/react-checkbox';
import { LabelProps } from './Label.mjs';
import 'react';
type CheckBoxSize = 'small' | 'medium' | 'large';
type CheckboxProps = {
/** used for the label's `for` attribute */
id?: string;
label?: Omit<LabelProps, 'id'>;
/**
* @default false
*/
checked: CheckedState;
disabled?: boolean;
onChange?: (checked: boolean) => void;
onChangeTristate?: (checked: CheckedState) => void;
size?: CheckBoxSize;
className?: string;
containerClassName?: string;
};
/**
* A Tristate checkbox
*
* The state is managed by the parent
*/
declare const Checkbox: ({ id, label, checked, disabled, onChange, onChangeTristate, size, className, containerClassName }: CheckboxProps) => react_jsx_runtime.JSX.Element;
type CheckboxUncontrolledProps = Omit<CheckboxProps, 'value' | 'checked'> & {
/**
* @default false
*/
defaultValue?: CheckedState;
};
/**
* A Tristate checkbox
*
* The state is managed by this component
*/
declare const CheckboxUncontrolled: ({ onChange, onChangeTristate, defaultValue, ...props }: CheckboxUncontrolledProps) => react_jsx_runtime.JSX.Element;
export { Checkbox, type CheckboxProps, CheckboxUncontrolled };