/** * createAccordion - the HEADLESS core behind : a WAI-ARIA accordion * (collapsible sections) with single- or multiple-expand, roving header focus * (Up/Down/Home/End) and full ARIA, exposed as **prop-getters** you spread onto * YOUR OWN markup. No styles, no DOM. Parity: Smart `smart-accordion`. * * ```svelte * * {#each items as it, i (it.id)} *

* {#if acc.isExpanded(it.id)}
...
{/if} * {/each} * ``` * * The styled is one renderer over this core. DOM focus movement is * a render concern: the component watches `focusTick`/`focusIndex` and calls * `.focus()` itself. */ export type AccordionItem = { id: string; label: string; disabled?: boolean; }; /** `single` keeps at most one panel open; `multiple` allows any number. */ export type AccordionExpandMode = 'single' | 'multiple'; /** Reactive inputs are passed as getters so the core tracks live prop changes. */ export type AccordionConfig = { items: () => ReadonlyArray; /** Expanded item ids (controlled). */ expanded: () => string[]; onChange?: (expandedIds: string[]) => void; expandMode?: () => AccordionExpandMode; disabled?: () => boolean; dir?: () => 'ltr' | 'rtl' | 'auto' | undefined; }; export declare function createAccordion(config: AccordionConfig): { /** Header index that should hold DOM focus after the latest keyboard move. */ readonly focusIndex: number; /** Monotonic counter; changes only on keyboard navigation. */ readonly focusTick: number; /** Currently-expanded item ids. */ readonly expandedIds: string[]; isExpanded: (itemId: string) => boolean; toggle: (i: number) => void; /** Spread onto the accordion root container. */ rootProps: () => { 'data-orientation': "vertical"; }; /** Spread onto the header