/**
 * Copyright IBM Corp. 2020, 2026
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_index = require("../../node_modules/classnames/index.js");
const require_settings = require("../../settings.js");
const require_AddSelectRow = require("./AddSelectRow.js");
const require_useFocus = require("./hooks/useFocus.js");
let react = require("react");
react = require_runtime.__toESM(react);
let prop_types = require("prop-types");
prop_types = require_runtime.__toESM(prop_types);
//#region src/components/AddSelect/AddSelectList.jsx
var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const blockClass = `${require_settings.pkg.prefix}--add-select__selections`;
const componentName = "AddSelectList";
let AddSelectList = ({ filteredItems, multi, ...rest }) => {
	const [focus, setFocus] = require_useFocus.default(filteredItems.length);
	return /* @__PURE__ */ react.default.createElement("div", {
		id: "add-select-focus",
		className: (0, import_classnames.default)(`${blockClass}-wrapper`, { [`${blockClass}-wrapper-multi`]: multi })
	}, /* @__PURE__ */ react.default.createElement("div", { className: `${blockClass}` }, /* @__PURE__ */ react.default.createElement("div", {
		className: `${blockClass}-body`,
		role: "treegrid",
		"aria-label": "add select tree label"
	}, filteredItems.map((item, index) => /* @__PURE__ */ react.default.createElement(require_AddSelectRow.AddSelectRow, {
		key: item.id,
		index,
		focus,
		setSize: filteredItems.length,
		item,
		multi,
		setFocus,
		...rest
	})))));
};
AddSelectList.propTypes = {
	filteredItems: prop_types.default.array,
	focus: prop_types.default.oneOfType([prop_types.default.number, prop_types.default.string]),
	multi: prop_types.default.bool
};
AddSelectList.displayName = componentName;
//#endregion
exports.AddSelectList = AddSelectList;
