import * as React from 'react'; import { type TreeNode } from './use-tree-view'; interface TreeViewProps extends React.HTMLAttributes { data: TreeNode[]; /** Called when a node is clicked or activated via keyboard. */ onNodeClick?: (node: TreeNode) => void; /** Called when a node becomes the selected item. Prefer this over `onNodeClick` for selection logic. */ onNodeSelect?: (node: TreeNode) => void; defaultExpanded?: string[]; /** Controlled selected node ID. When provided, selection state is managed externally. */ selectedNodeId?: string; /** Accessible label for the tree widget. */ ariaLabel?: string; } /** * Hierarchical tree navigation component. * * @description * Renders a nested tree structure for browsing hierarchical data such as file * systems, category trees, or organizational charts. Nodes can be expanded * and collapsed independently. Supports custom icons per node, controlled * selection, and full WAI-ARIA keyboard navigation. * * Headless logic is available via `useTreeView` for custom tree UIs. * * @ai-rules * 1. Each `TreeNode` must have a unique `id`. * 2. Leaf nodes (no `children`) do not render expand arrows. * 3. Use `onNodeSelect` for selection and `onNodeClick` for any click side-effect. * 4. Pass `selectedNodeId` to control selection externally. * 5. Keyboard: Arrow Up/Down navigate siblings, Arrow Right expands / enters child, Arrow Left collapses / goes to parent, Home/End jump to first/last visible node. */ declare const TreeView: React.ForwardRefExoticComponent>; export { TreeView }; export type { TreeViewProps }; export type { TreeNode } from './use-tree-view';