// @ts-nocheck import { createSignal } from "solid-js" import { CheckboxV2 } from "./checkbox-v2" const docs = `### Overview Binary and tri-state checkbox using Kobalte Checkbox. ### API - Forwards Kobalte Checkbox props (\`checked\`, \`defaultChecked\`, \`onChange\`, \`indeterminate\`, \`name\`, \`required\`, \`validationState\`, \`disabled\`, etc.). - Adds \`label\`, optional \`description\`, and \`hideLabel\`. ### Behavior - Controlled or uncontrolled via \`checked\` / \`defaultChecked\`. - Indeterminate is driven by the \`indeterminate\` prop (pass a reactive boolean, e.g. \`indeterminate={flag()}\`). ### Theming/tokens - Uses \`data-slot="checkbox-v2"\` and slot attributes aligned with radio item layout. ` export default { title: "UI V2/Checkbox", id: "components-checkbox-v2", component: CheckboxV2, tags: ["autodocs"], parameters: { docs: { description: { component: docs, }, }, }, } export const Basic = { render: () => ( ), } export const Controlled = { render: () => { const [checked, setChecked] = createSignal(false) return (
Checked: {String(checked())}
) }, } export const Indeterminate = { render: () => { const [indeterminate, setIndeterminate] = createSignal(true) const [checked, setChecked] = createSignal(false) return ( { setChecked(v) if (v) setIndeterminate(false) }} label="Select all" description="Starts indeterminate; checking clears mixed state." /> ) }, } export const States = { render: () => (
), }