/** * `ChipGroup` — a tap-to-select grid of pill chips (`.tai-chip`), in two modes. * * `single` is a `role="radiogroup"` of `role="radio"` chips carrying `aria-checked`: * exactly one value is selected, the arrow keys move the selection, and only the * selected chip (or the first, when none is) sits in the tab order. `multi` is a * group of toggle buttons carrying `aria-pressed`: any number are selected, the * arrow keys move focus, and Space/Enter (the native button activation) toggles the * focused chip. * * Roving tabindex and arrow-key movement are owned here — there is no multi-select * primitive to borrow — so both modes share one keyboard model: ←/↑ to the previous * chip, →/↓ to the next (wrapping), Home/End to the ends, skipping disabled chips. * The handler rides each chip (a button, an interactive element) rather than the * container, so no static element carries an interaction. Like `RadioGroup`, the * group takes its accessible name from an enclosing group `Field`, not a label of * its own. */ import type { ReactNode } from 'react'; /** One selectable chip: its answer `value` and the visible `label`. */ export interface ChipOption { readonly value: string; readonly label: string; readonly disabled?: boolean; } export type ChipGroupProps = { /** Exactly one value selected — a `radiogroup` of radios. */ readonly mode: 'single'; readonly options: readonly ChipOption[]; readonly value: string; readonly onValueChange: (value: string) => void; readonly disabled?: boolean; } | { /** Any number selected — a group of `aria-pressed` toggle buttons. */ readonly mode: 'multi'; readonly options: readonly ChipOption[]; readonly value: readonly string[]; readonly onValueChange: (value: readonly string[]) => void; readonly disabled?: boolean; }; export declare function ChipGroup(props: ChipGroupProps): ReactNode; //# sourceMappingURL=chip-group.d.ts.map