/**
 * 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 { pkg } from "../../settings.js";
import React from "react";
import PropTypes from "prop-types";
import { IconButton } from "@carbon/react";

//#region src/components/ActionBar/ActionBarItem.tsx
var import_classnames = /* @__PURE__ */ __toESM(require_classnames());
const componentName = "ActionBarItem";
const blockClass = `${pkg.prefix}--action-bar-item`;
/**
* The ActionBarItem is used in the page header to populate the action bar
*/
const ActionBarItem = React.forwardRef(({ label, className, renderIcon, ...rest }, ref) => {
	const Icon = renderIcon;
	return /* @__PURE__ */ React.createElement(IconButton, {
		...rest,
		ref,
		className: (0, import_classnames.default)(blockClass, className),
		kind: "ghost",
		size: "md",
		align: "bottom-end",
		type: "button",
		label
	}, Icon ? /* @__PURE__ */ React.createElement(Icon, null) : null);
});
const reservedProps = [
	"kind",
	"size",
	"align",
	"type"
];
const propTypes = { ...IconButton.propTypes };
reservedProps.forEach((prop) => {
	delete propTypes[prop];
});
ActionBarItem.displayName = componentName;
ActionBarItem.propTypes = {
	...propTypes,
	className: PropTypes.string,
	label: PropTypes.string,
	onClick: PropTypes.func,
	renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
	tabIndex: PropTypes.number
};

//#endregion
export { ActionBarItem };