// ============================================================================ // Stylescape | Tree View Manager // ============================================================================ // Turns nested lists into a WAI-ARIA tree (role=tree/treeitem/group) with // a roving tabindex, arrow-key navigation, Home/End, "*" and type-ahead. // Supports data-ss="tree" for declarative initialisation. // ============================================================================ /** * Configuration options for TreeViewManager */ export interface TreeViewOptions { /** Select an item as soon as it receives focus */ selectOnFocus?: boolean; /** Jump to items by typing the start of their label */ typeahead?: boolean; /** Milliseconds before the type-ahead buffer resets */ typeaheadTimeout?: number; /** Called when an item is selected */ onSelect?: (item: HTMLElement) => void; /** Called when a branch expands or collapses */ onToggle?: (item: HTMLElement, expanded: boolean) => void; } const ITEM_CLASS = "ss-c-tree__item"; const LABEL_CLASS = "ss-c-tree__label"; const GROUP_CLASS = "ss-c-tree__group"; /** * Accessible tree view built from nested `