// Native checkbox with a token-drawn indicator. The label element wraps the // input, so the whole row is a hit target without a manual `for`/`id` pairing. import type { JSX } from 'solid-js'; import { ariaBool } from '../a11y'; import { cx } from '../cx'; import styles from './Checkbox.module.scss'; export interface CheckboxProps { /** Already-translated label. Required — an unlabelled checkbox is a bug. */ label: string; id?: string | undefined; name?: string | undefined; value?: string | undefined; /** * The id of the `
` this box submits with, when it cannot sit inside it — a row checkbox in * a table whose page already holds another form. The platform's own association, no script. */ form?: string | undefined; checked?: boolean | undefined; /** Tri-state for "some children selected". The ONLY thing mirrored to `aria-checked`. */ indeterminate?: boolean | undefined; disabled?: boolean | undefined; required?: boolean | undefined; description?: string | undefined; class?: string | undefined; 'aria-describedby'?: string | undefined; 'aria-invalid'?: boolean | undefined; onChange?: JSX.EventHandlerUnion | undefined; } export function Checkbox(props: CheckboxProps): JSX.Element { return ( ); }