import clsx from 'clsx'; import type { ChangeEvent } from 'react'; import type { ForwardedRef } from 'react'; import { forwardRef, useId } from 'react'; type Props = Readonly<{ defaultValue?: boolean; description?: string; disabled?: boolean; label: string; name?: string; onChange?: ( value: boolean, event: ChangeEvent, ) => undefined | void; value?: boolean; }>; function CheckboxInput( { defaultValue, description, disabled = false, label, name, value, onChange, }: Props, ref: ForwardedRef, ) { const id = useId(); const descriptionId = useId(); return (
{ onChange?.(event.target.checked, event); } : undefined } />
{description && (

{description}

)}
); } export default forwardRef(CheckboxInput);