import { html, nothing, type TemplateResult } from 'lit';
import type { NuiType } from '../../types/nui-type.js';
import type { CheckboxSize } from './types.js';
export interface NuiCheckboxViewState {
checked: boolean;
disabled: boolean;
indeterminate: boolean;
invalid: boolean;
size: CheckboxSize | '';
name: string;
value: string;
readonly: boolean;
required: boolean;
inputId: string;
ariaLabel: string;
ariaLabelledby: string;
nuiType: NuiType;
checkboxClass: string;
}
export function getCheckboxClass(checkboxClass: string): string {
return ['nui-checkbox', checkboxClass].filter(Boolean).join(' ');
}
export function renderCheckboxIcon(
state: Pick,
): TemplateResult | typeof nothing {
if (state.indeterminate) {
return html`
`;
}
if (state.checked) {
return html`
`;
}
return nothing;
}
export function renderCheckbox(
state: NuiCheckboxViewState,
onChange: (event: Event) => void,
): TemplateResult {
const isActive = state.checked || state.indeterminate;
return html`
`;
}