import React, { forwardRef } from "react"; import { BodyShort } from "../../typography"; import { omit, useId } from "../../utils-external"; import { cl } from "../../utils/helpers"; import { ReadOnlyIconWithTitle } from "../ReadOnlyIcon"; import { CheckboxInput } from "./checkbox-input/CheckboxInput"; import { CheckboxProps } from "./types"; import useCheckbox from "./useCheckbox"; export const Checkbox = forwardRef( (props: CheckboxProps, forwardedRef) => { const { inputProps, hasError, size, readOnly, nested } = useCheckbox(props); const descriptionId = useId(); const { className, description, children, indeterminate, hideLabel } = props; return (
{!nested && readOnly && } {children} {description && ( {description} )}
); }, ); export default Checkbox;