export type ButtonGroupItem = { value: string | number; label?: string; disabled?: boolean; }; /** `single` = radio semantics; `multiple` = toggle set; `none` = action buttons. */ export type ButtonGroupMode = 'single' | 'multiple' | 'none'; export type ButtonGroupValue = string | number | Array | null; /** Reactive inputs are passed as getters so the core tracks live prop changes. */ export type ButtonGroupConfig = { items: () => ReadonlyArray; value: () => ButtonGroupValue; onChange?: (value: string | number | Array) => void; mode?: () => ButtonGroupMode; disabled?: () => boolean; orientation?: () => 'horizontal' | 'vertical'; /** Under `'rtl'` the horizontal Left/Right arrow direction flips. */ dir?: () => 'ltr' | 'rtl' | 'auto' | undefined; id?: () => string | undefined; invalid?: () => boolean; required?: () => boolean; error?: () => string | undefined; hint?: () => string | undefined; ariaLabel?: () => string | undefined; }; /** Normalize the value to an array (pure). */ export declare function toGroupArray(value: ButtonGroupValue): Array; export declare function createButtonGroup(config: ButtonGroupConfig): { /** Roving-focus target index (follows the selection in single mode). */ readonly activeIndex: number; /** Selected values as an array (single mode -> 0 or 1 entry). */ readonly selectedValues: (string | number)[]; isSelected: (v: string | number) => boolean; isActive: (i: number) => boolean; pick: (i: number) => void; move: (delta: number) => void; onKeydown: (e: KeyboardEvent) => void; /** Spread onto the group container element. */ rootProps: () => { onkeydown: (e: KeyboardEvent) => void; 'aria-invalid': "true" | undefined; 'aria-required': "true" | undefined; 'aria-describedby': string | undefined; 'aria-label': string | undefined; role: string; id: string | undefined; 'aria-orientation': "horizontal" | "vertical"; }; /** Spread onto the button element at `index`. */ buttonProps: (index: number) => { type: "button"; role: "radio" | undefined; 'data-idx': number; 'aria-checked': boolean | undefined; 'aria-pressed': boolean | undefined; 'data-selected': string | undefined; disabled: true | undefined; tabindex: number; onclick: () => void; }; }; export type ButtonGroup = ReturnType;