import { z } from "zod/v4";
import type { JSX } from "solid-js";
import type { ComponentMeta } from "../../meta";
export const SwitchRootPropsSchema = z.object({
  checked: z.boolean().optional().describe("Controlled checked state of the switch"),
  defaultChecked: z.boolean().optional().describe("Initial checked state (uncontrolled)"),
  disabled: z.boolean().optional().describe("Whether the switch is disabled"),
  required: z.boolean().optional().describe("Whether the switch 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 SwitchRootProps extends z.infer<typeof SwitchRootPropsSchema> {
  onCheckedChange?: (checked: boolean) => void;
  children: JSX.Element;
}
export const SwitchMeta: ComponentMeta = {
  name: "Switch", description: "Toggle control for on/off states, visually distinct from checkbox",
  parts: ["Root", "Input", "Control", "Thumb", "Label", "Description", "ErrorMessage"] as const,
  requiredParts: ["Root"] as const,
} as const;
