import React, { forwardRef, useEffect, useRef, type HTMLProps } from 'react'; import { mergeRefs } from '@wener/reaction'; import classNames from 'clsx'; import type { DaisyModifierProps } from '../utils/daisy'; import { daisy, omit } from '../utils/daisy'; export type CheckboxProps = HTMLProps & { indeterminate?: boolean; } & Pick; export const Checkbox = forwardRef(({ indeterminate, className, ...props }, _ref) => { const ref = useRef(null); useEffect(() => { if (typeof indeterminate === 'boolean' && ref.current) { ref.current.indeterminate = !props.checked && indeterminate; } }, [ref, indeterminate]); return ( ); }); Checkbox.displayName = 'Checkbox';