/** The orientation of the radio group (vertical or horizontal). */
export type UiRadioGroupOrientation = 'vertical' | 'horizontal';
/** The reading direction of the radio group. */
export type UiRadioGroupDirection = 'ltr' | 'rtl';

/**
 * Shared props between `UiRadioGroup` and `UiRadioGroupItem`.
 * Note: `name` belongs to the group only.
 */
export type UiRadioGroupSharedProps = {
  /**
   * Render as child element (merges props into slotted element instead of wrapping).
   * @default false
   */
  asChild?: boolean;
  /**
   * Whether the component is disabled.
   * @default false
   */
  disabled?: boolean;
  /**
   * Whether the component is required.
   * @default false
   */
  required?: boolean;
};

/**
 * A group of radio buttons for single-choice selection. Use when users
 * must pick exactly one option from a visible list.
 * @category Form Inputs
 * @useCases single choice, option selection, survey question, settings
 * @keywords radio, radiogroup, option, choice, single, select, form
 * @related UiCheckbox, UiSelect
 */
export type UiRadioGroupProps = UiRadioGroupSharedProps & {
  /**
   * The name attribute applied to the radio group.
   */
  name: string;
  /**
   * The orientation of the radio group.
   * @default vertical
   */
  orientation?: UiRadioGroupOrientation;
  /**
   * The reading direction of the radio group.
   * @default ltr
   */
  dir?: UiRadioGroupDirection;
  /**
   * Whether keyboard navigation loops from last to first item.
   * @default true
   */
  loop?: boolean;
};

/**
 * Props for the UiRadioGroupItem component.
 * An individual radio button within a radio group.
 */
export type UiRadioGroupItemProps = UiRadioGroupSharedProps & {
  /**
   * The unique identifier for the radio item.
   */
  id: string;
  /**
   * The value of the radio item.
   */
  value: string;
};
