import React, { forwardRef, useCallback } from "react"; import { cl } from "../../../utils/helpers"; import { useMergeRefs } from "../../../utils/hooks"; type CheckboxInputProps = React.InputHTMLAttributes & { indeterminate?: boolean; children?: never; standalone?: boolean; /** * Reduces pseudo-element target-size. */ compact?: boolean; }; const CheckboxInput = forwardRef( ( { className, indeterminate, standalone = true, compact, ...rest }: CheckboxInputProps, forwardedRef, ) => { const indeterminateRef = useCallback( (el: HTMLInputElement | null) => { if (el) { el.indeterminate = indeterminate ?? false; } }, [indeterminate], ); const mergedRef = useMergeRefs(indeterminateRef, forwardedRef); return (
); }, ); export { CheckboxInput }; export type { CheckboxInputProps };