/** * @usevyre/react — Radio * * AI CONTEXT: * ┌─────────────────────────────────────────────────────────────────┐ * │ Component: RadioGroup + Radio │ * │ Import: import { RadioGroup, Radio } from "@usevyre/react" │ * │ │ * │ CONTROLLED. RadioGroup owns the selected value. │ * │ │ * │ RadioGroup props: │ * │ value = string (controlled selected value) │ * │ defaultValue = string (uncontrolled) │ * │ onChange = (value: string) => void │ * │ name? = string (radio group name; auto if omitted) │ * │ disabled? = boolean (disables the whole group) │ * │ size? = "sm" | "md"(default) │ * │ orientation? = "vertical"(default) | "horizontal" │ * │ options? = { value; label; description?; disabled? }[] │ * │ → data-driven; OR pass children for custom layout │ * │ │ * │ Radio props (inside RadioGroup): │ * │ value = string (required) │ * │ label? = string │ * │ description? = string │ * │ disabled? = boolean │ * │ │ * │ Use options for simple lists; use children when you │ * │ need custom content. role="radiogroup" + arrow-key roving focus. │ * └─────────────────────────────────────────────────────────────────┘ * * @example * // Data-driven * * * // Composable * * * * */ import React from "react"; import type { BaseProps } from "../../types"; export interface RadioOption { value: string; label?: string; description?: string; disabled?: boolean; } type RadioSize = "sm" | "md"; export interface RadioGroupProps extends Omit, "onChange">, BaseProps { value?: string; defaultValue?: string; onChange?: (value: string) => void; name?: string; disabled?: boolean; size?: RadioSize; orientation?: "vertical" | "horizontal"; /** Data-driven options. Omit to pass children instead. */ options?: RadioOption[]; } export declare const RadioGroup: React.ForwardRefExoticComponent>; export interface RadioProps extends Omit, "onChange" | "size" | "value" | "type">, BaseProps { value: string; label?: string; description?: string; disabled?: boolean; } export declare const Radio: React.ForwardRefExoticComponent>; export {};