2022-06-05 18:56:42 +00:00
|
|
|
import classNames from 'classnames';
|
2022-12-21 21:27:50 +00:00
|
|
|
import type { ComponentProps } from 'react';
|
|
|
|
import { forwardRef } from 'react';
|
|
|
|
|
2022-06-05 18:56:42 +00:00
|
|
|
import styles from './styles.module.css';
|
|
|
|
|
2022-12-21 21:27:50 +00:00
|
|
|
type Props = Omit<ComponentProps<'input'>, 'type'> & {
|
|
|
|
indeterminate?: boolean;
|
|
|
|
};
|
2022-07-02 22:27:29 +00:00
|
|
|
|
2022-12-21 21:27:50 +00:00
|
|
|
export default forwardRef<HTMLInputElement, Props>(({ className, indeterminate, ...props }, ref) => (
|
2022-07-02 22:27:29 +00:00
|
|
|
<input
|
|
|
|
ref={ref}
|
|
|
|
type={'checkbox'}
|
2022-12-21 21:27:50 +00:00
|
|
|
className={classNames(
|
|
|
|
'form-checkbox',
|
|
|
|
{
|
|
|
|
[styles.checkbox]: true,
|
|
|
|
[styles.indeterminate]: indeterminate,
|
|
|
|
},
|
|
|
|
className,
|
|
|
|
)}
|
2022-07-02 22:27:29 +00:00
|
|
|
{...props}
|
|
|
|
/>
|
2022-06-05 18:56:42 +00:00
|
|
|
));
|