import type { ReactNode } from "react"; /** A payment-method row. Inside a `PaymentOptionGroup` it is a radio keyed by `value`; alone, `onSelect` makes it a toggle button. */ export interface PaymentOptionProps { /** Identifies the option inside a `PaymentOptionGroup`; required there. */ value?: string; /** Method name; also the row's accessible name when selectable. */ title: string; /** Muted line under the title, e.g. "Pay on delivery · ₹50 handling fee". */ subtitle?: string; /** Slot for a method icon or logo, shown in a 40px well. */ icon?: ReactNode; /** Short offer tag, e.g. "5% cashback". */ offer?: string; /** Standalone selection state; ignored inside a group, where the group's value decides. */ selected?: boolean; /** Called when the row is chosen; also fires inside a group, after the group updates. */ onSelect?: () => void; /** Dims the row and drops it from the tab order, e.g. COD above the order limit; say why in `subtitle`. */ disabled?: boolean; /** Revealed under the row only while it is selected, e.g. a UPI id input. Interactive content here sits outside the radio. */ children?: ReactNode; /** Test id on the row's outer element. */ "data-testid"?: string; } /** Radiogroup of `PaymentOption`s with a roving tab stop; arrow keys move focus and selection together. */ export interface PaymentOptionGroupProps { /** Selected option's `value`; controls the group when set. */ value?: string; /** Initially selected `value` when the group is uncontrolled. */ defaultValue?: string; /** Called with the new `value` when selection changes by click or arrow key. */ onValueChange?: (value: string) => void; /** Direct `PaymentOption` children; wrapping them in another component hides their `value` from the roving tab stop. */ children: ReactNode; /** Accessible name of the radiogroup; give this or `aria-labelledby`. */ "aria-label"?: string; /** Id of the element that names the radiogroup. */ "aria-labelledby"?: string; /** Test id on the radiogroup element. */ "data-testid"?: string; }