/**
 * 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.
 */

import { __toESM } from "../../../_virtual/_rolldown/runtime.js";
import { require_classnames } from "../../../node_modules/classnames/index.js";
import { AddSelectContext, blockClass } from "./context.js";
import AddSelectBody from "./AddSelectBody.js";
import AddSelectContent from "./AddSelectContent.js";
import AddSelectColumn from "./AddSelectColumn.js";
import AddSelectRow from "./AddSelectRow.js";
import AddSelectSelectionSummary from "./AddSelectSelectionSummary.js";
import AddSelectSelectionSummaryItem from "./AddSelectSelectionSummaryItem.js";
import AddSelectItemPanel from "./AddSelectItemPanel.js";
import React, { forwardRef } from "react";
import PropTypes from "prop-types";
//#region src/components/AddSelect/next/AddSelect.tsx
/**
* Copyright IBM Corp. 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.
*/
var import_classnames = /* @__PURE__ */ __toESM(require_classnames());
/**
* AddSelect - Composable component for adding/selecting items
* @example
* ```jsx
* <AddSelect onItemSelect={handleSelect}>
*   <AddSelect.Body
*     itemsLabel="Items"
*     globalSearchLabel="Search"
*     itemCount={items.length}
*   >
*     <AddSelect.Column multi={true} title="Categories">
*       {items.map(item => (
*         <AddSelect.Row
*           key={item.id}
*           itemId={item.id}
*           title={item.title}
*           value={item.value}
*         />
*       ))}
*     </AddSelect.Column>
*   </AddSelect.Body>
* </AddSelect>
* ```
*/
const AddSelect = forwardRef(({ children, className, onItemSelect, selectedItems, ...rest }, ref) => {
	return /* @__PURE__ */ React.createElement(AddSelectContext.Provider, { value: {
		onItemSelect,
		selectedItems
	} }, /* @__PURE__ */ React.createElement("div", {
		className: (0, import_classnames.default)(blockClass, className),
		ref,
		...rest
	}, children));
});
AddSelect.propTypes = {
	children: PropTypes.node,
	className: PropTypes.string,
	/**@ts-ignore */
	onItemSelect: PropTypes.func,
	/**@ts-ignore */
	selectedItems: PropTypes.instanceOf(Set)
};
AddSelect.Body = AddSelectBody;
AddSelect.Content = AddSelectContent;
AddSelect.Column = AddSelectColumn;
AddSelect.Row = AddSelectRow;
AddSelect.SelectionSummary = AddSelectSelectionSummary;
AddSelect.SelectionSummaryItem = AddSelectSelectionSummaryItem;
AddSelect.ItemPanel = AddSelectItemPanel;
AddSelect.displayName = "AddSelect";
//#endregion
export { AddSelect };
