import { z } from "zod/v4";
import type { JSX } from "solid-js";
import type { ComponentMeta } from "../../meta";
export const CheckboxRootPropsSchema = z.object({
  checked: z.boolean().optional().describe("Controlled checked state of the checkbox"),
  defaultChecked: z.boolean().optional().describe("Initial checked state (uncontrolled)"),
  disabled: z.boolean().optional().describe("Whether the checkbox is disabled"),
  required: z.boolean().optional().describe("Whether the checkbox is required for form submission"),
  name: z.string().optional().describe("Native form field name — renders a hidden checkbox input"),
  value: z.string().optional().describe("Value submitted with the form when checked. Defaults to 'on'"),
});
export interface CheckboxRootProps extends z.infer<typeof CheckboxRootPropsSchema> {
  onCheckedChange?: (checked: boolean) => void;
  children: JSX.Element;
}
export const CheckboxMeta: ComponentMeta = {
  name: "Checkbox", description: "Toggle control for boolean input, supports indeterminate state",
  parts: ["Root", "Input", "Control", "Indicator", "Label", "Description", "ErrorMessage"] as const,
  requiredParts: ["Root"] as const,
} as const;
