import type { ButtonIconSpec } from '@ankhorage/surface'; import type { ReactNode } from 'react'; import type { ZoraBaseProps } from './base'; export interface TreeItemNode { id: TId; label: ReactNode; icon?: ButtonIconSpec; children?: readonly TreeItemNode[]; disabled?: boolean; meta?: ReactNode; actions?: ReactNode; } export interface TreeItemRenderProps { node: TreeItemNode; depth: number; selected: boolean; expanded: boolean; hasChildren: boolean; } export interface TreeViewProps extends ZoraBaseProps { nodes: readonly TreeItemNode[]; selectedId?: TId; expandedIds?: readonly TId[]; defaultExpandedIds?: readonly TId[]; onSelect?: (id: TId) => void; onExpandedChange?: (ids: readonly TId[]) => void; renderItem?: (props: TreeItemRenderProps) => ReactNode; expansionIndicator?: 'chevron' | 'folder'; }