import { jsx as _jsx } from "react/jsx-runtime";
import { b } from "./treeviewBem.js";
import { makeItemId } from "./utils.js";
/**
 * @internal
 */
export function UiTreeviewRoot({ handleKeyDown, children, ariaAttributes, path, style, dataTestId, }) {
    const activeDescendant = path.length > 0 ? makeItemId(ariaAttributes.id, path) : undefined;
    return (_jsx("div", { ...ariaAttributes, className: b(), style: style, "data-testid": dataTestId, tabIndex: ariaAttributes.tabIndex ?? 0, onKeyDown: handleKeyDown, role: "tree", "aria-activedescendant": activeDescendant, children: children }));
}
