/**
 * 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 { getDevtoolsProps } from "../../global/js/utils/devtools.js";
import { prepareProps } from "../../global/js/utils/props-helper.js";
import { AddSelect } from "../AddSelect/AddSelect.js";
import React, { forwardRef } from "react";
import PropTypes from "prop-types";

//#region src/components/SingleAddSelect/SingleAddSelect.tsx
const componentName = "SingleAddSelect";
/**
* Used to add or select one or more items from larger lists or hierarchies.
*/
const SingleAddSelect = forwardRef((props, ref) => {
	const validProps = prepareProps(props, [
		"columnInputPlaceholder",
		"globalFilters",
		"globalFiltersIconDescription",
		"globalFiltersPlaceholderText",
		"globalFiltersPrimaryButtonText",
		"globalFiltersSecondaryButtonText",
		"influencerTitle",
		"multi",
		"noSelectionDescription",
		"noSelectionTitle",
		"removeIconDescription"
	]);
	return /* @__PURE__ */ React.createElement(AddSelect, {
		...validProps,
		ref,
		...getDevtoolsProps(componentName),
		multi: false
	});
});
SingleAddSelect.propTypes = {
	className: PropTypes.string,
	description: PropTypes.string,
	globalSearchLabel: PropTypes.string,
	globalSearchPlaceholder: PropTypes.string,
	items: PropTypes.shape({ entries: PropTypes.arrayOf(PropTypes.shape({
		children: PropTypes.object,
		id: PropTypes.string.isRequired,
		title: PropTypes.string.isRequired,
		value: PropTypes.string.isRequired
	})) }),
	itemsLabel: PropTypes.string,
	noResultsDescription: PropTypes.string,
	noResultsTitle: PropTypes.string,
	noTearsheet: PropTypes.bool,
	onClose: PropTypes.func,
	onCloseButtonText: PropTypes.string,
	onSubmit: PropTypes.func,
	onSubmitButtonText: PropTypes.string,
	open: PropTypes.bool,
	searchResultsLabel: PropTypes.string,
	title: PropTypes.string
};
SingleAddSelect.displayName = componentName;

//#endregion
export { SingleAddSelect };