import type { Snippet } from "svelte"; /** * Shared context contract between {@link SelectableList} and its slotted * {@link SelectableRow} children. The list owns selection + roving tabindex and * exposes reactive getters the rows read to derive their own `role` / `tabindex` * / `aria-selected`, plus callbacks for registration and activation. When a row * is used STANDALONE (no list) `getContext` returns undefined and the row falls * back to its own `role` / `tabindex` / selection state. */ export declare const SELECTABLE_LIST_KEY: unique symbol; export type SelectableListContext = { /** True when the list manages selection/roving for its rows. */ readonly managed: true; /** listbox role for the wrapper → rows are "option". */ readonly itemRole: "option"; /** Register a row element; returns an unregister callback. disabled is forwarded so the list can skip it during keyboard navigation. */ register: (el: HTMLElement, value: string | undefined, disabled?: boolean) => () => void; /** Is the row with this element currently selected? */ isSelected: (el: HTMLElement) => boolean; /** Should the row with this element be the roving-tabindex stop (tabindex 0)? */ isTabStop: (el: HTMLElement) => boolean; /** Row was activated (click / Space / Enter). The list toggles selection. */ activate: (el: HTMLElement) => void; /** Row received focus → becomes the roving tab stop. */ focusRow: (el: HTMLElement) => void; /** Arrow / Home / End navigation from a row. */ navigate: (el: HTMLElement, key: string) => void; }; export type SelectableRowProps = { /** * Selected state (bindable). Honoured when the row is used STANDALONE; inside * a {@link SelectableList} the list is the source of truth and drives the * selected styling, so this prop is ignored for managed rows. */ selected?: boolean; /** Notified on every toggle with the new selected state (standalone rows). */ onselect?: (selected: boolean) => void; /** Non-interactive when true. */ disabled?: boolean; /** Stable value, surfaced as `data-value` and used by the list for `value`. */ value?: string; /** Native link target. When set on a standalone row, the row renders as an anchor. */ href?: string; /** * ARIA role for the standalone row. Defaults to "button" for standalone use — * "option" is only valid inside a listbox and would be invalid without one. * Inside a SelectableList the role is always forced to "option". */ role?: string; /** * Opt-in left accent bar on the selected state. Off by default so the * selected item is a calm tinted surface + accented text (two signals only). */ accentBar?: boolean; /** Leading slot (icon / avatar). */ leading?: Snippet; /** Trailing slot (meta / icon). */ trailing?: Snippet; /** Main content. */ children?: Snippet; /** * Optional secondary line (the "legend") rendered MUTED and smaller UNDER * `children`. When present the content column stacks vertically (a * `--hasCaption` modifier); when absent the row stays single-line and * byte-identical. The caption joins the row's accessible name by default (the * SR reads "label, caption"); wrap it `aria-hidden` if it is purely * decorative. MUST NOT contain interactive controls — a row is a single tab * stop. */ caption?: Snippet; class?: string; }; declare const SelectableRow: import("svelte").Component; type SelectableRow = ReturnType; export default SelectableRow; //# sourceMappingURL=SelectableRow.svelte.d.ts.map