import type { ReactNode } from "react"; import type { TreeNodeData } from "../Tree/types"; type TreeSelectSize = "small" | "medium" | "large"; export interface TreeSelectProps { /** Tree data array using TreeNodeData shape ({ key, title, children?, disabled? }). */ treeData: TreeNodeData[]; /** Controlled selected value (node key). */ value?: string; /** Default selected value (uncontrolled). */ defaultValue?: string; /** Callback fired when value changes. */ onChange?: (value: string) => void; /** Label displayed above the component. */ label?: string; /** Error message displayed below the component. */ error?: string; /** Help text displayed below the component. */ helpText?: ReactNode; /** Mark the field as required. */ required?: boolean; /** Placeholder text when no value is selected. */ placeholder?: string; /** Disable the component. */ isDisabled?: boolean; /** Enable search/filter in dropdown. */ isSearchable?: boolean; /** Show a clear button when a value is selected. */ isClearable?: boolean; /** Size of the trigger. */ size?: TreeSelectSize; /** Remap data keys. `label` maps to TreeNodeData.title, `value` maps to TreeNodeData.key. */ fieldNames?: { label?: string; value?: string; }; /** Custom icon rendered at the end of the trigger (replaces default chevron). */ suffixIcon?: ReactNode; /** Custom expand/collapse icon for tree nodes. */ switcherIcon?: ReactNode | ((props: { expanded: boolean; }) => ReactNode); /** Keys of nodes to expand by default when dropdown opens. */ defaultExpandedKeys?: string[]; /** Auto-expand parent when child is expanded. */ autoExpandParent?: boolean; /** Additional CSS class for the container. */ className?: string; } export type { TreeNodeData };