import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2025-2026 GoodData Corporation
import { Fragment } from "react";
import cx from "classnames";
import { e } from "./comboboxBem.js";
import { useComboboxState } from "./UiComboboxContext.js";
import { UiComboboxListItem } from "./UiComboboxListItem.js";
/** @internal */
export function UiComboboxList({ children, className, ...htmlProps }) {
    const { availableOptions, listboxId } = useComboboxState();
    return (_jsx("ul", { role: "listbox", ...htmlProps, id: listboxId, className: cx(e("list"), className), tabIndex: -1, children: availableOptions.map((option, index) => children ? (_jsx(Fragment, { children: children(option, index) }, option.id)) : (_jsx(UiComboboxListItem, { option: option, index: index }, option.id))) }));
}
