import classNames from "classnames"; import type { ReactNode } from "react"; import { Icon } from "./Icon"; import { IconTooltip } from "./IconTooltip"; import { HStack } from "./Stacks"; export interface CheckboxProps { checked: boolean | "indeterminate"; title: ReactNode; onChange: (checked: boolean) => void; className?: string; disabled?: boolean; inputWrapperClassName?: string; hideLabel?: boolean; fullWidth?: boolean; help?: ReactNode; } export function Checkbox({ checked, onChange, className, inputWrapperClassName, disabled, title, hideLabel, fullWidth, help, }: CheckboxProps) { return (
{ onChange(checked === "indeterminate" ? true : !checked); }} />
{!hideLabel && (
{title}
)} {help && }
); }