import { z } from "zod/v4";
import type { JSX } from "solid-js";
import type { ComponentMeta } from "../../meta";
export const RadioGroupRootPropsSchema = z.object({
  value: z.string().optional().describe("Controlled selected value"),
  defaultValue: z.string().optional().describe("Initial selected value (uncontrolled)"),
  name: z.string().optional().describe("Native form field name for the radio group"),
  disabled: z.boolean().optional().describe("Whether the entire radio group is disabled"),
  required: z.boolean().optional().describe("Whether a selection is required for form submission"),
  orientation: z.enum(["horizontal", "vertical"]).optional().describe("Layout orientation of the radio group items"),
});
export interface RadioGroupRootProps extends z.infer<typeof RadioGroupRootPropsSchema> {
  onValueChange?: (value: string) => void;
  children: JSX.Element;
}
export const RadioGroupItemPropsSchema = z.object({
  value: z.string().describe("The value this radio item represents"),
  disabled: z.boolean().optional().describe("Whether this individual radio item is disabled"),
});
export interface RadioGroupItemProps extends z.infer<typeof RadioGroupItemPropsSchema> {
  children?: JSX.Element;
}
export const RadioGroupMeta: ComponentMeta = {
  name: "RadioGroup", description: "Group of mutually exclusive options where only one can be selected",
  parts: ["Root", "Item", "ItemInput", "ItemControl", "ItemIndicator", "ItemLabel", "Label", "Description", "ErrorMessage"] as const,
  requiredParts: ["Root", "Item"] as const,
} as const;
