/**
 * 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_pconsole = require('../../global/js/utils/pconsole.js');
const require_settings = require('../../settings.js');
const require_BreadcrumbWithOverflow = require('../BreadcrumbWithOverflow/BreadcrumbWithOverflow.js');
let react = require("react");
react = require_runtime.__toESM(react);
let prop_types = require("prop-types");
prop_types = require_runtime.__toESM(prop_types);
let _carbon_react = require("@carbon/react");

//#region src/components/SimpleHeader/SimpleHeader.jsx
/**
* Copyright IBM Corp. 2023, 2025
*
* 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__ */ require_runtime.__toESM(require_index.default);
const blockClass = `${require_settings.pkg.prefix}--simple-header`;
const componentName = "SimpleHeader";
/**
* The SimpleHeader is not public and only used internally by CreateFullPage.
*
* Component varieties:
* - Header with Breadcrumbs
* - Header with Title
* - Header with Breadcrumbs and Title
*
*
* The component will throw a warning message if neither a title or breadcrumbs are provided
* since it requires at least one of them.
* */
const SimpleHeader = ({ breadcrumbs, className, title, noTrailingSlash = true, maxVisible, overflowAriaLabel, overflowTooltipAlign, ...rest }) => {
	const warnIfNoTitleOrBreadcrumbs = (0, react.useCallback)(() => {
		if (!title && !breadcrumbs?.length) require_pconsole.default.error(`Warning: You have tried using a ${componentName} component without specifying a title or breadcrumbs props`);
	}, [breadcrumbs, title]);
	(0, react.useEffect)(() => {
		warnIfNoTitleOrBreadcrumbs();
	}, [
		title,
		breadcrumbs,
		warnIfNoTitleOrBreadcrumbs
	]);
	return /* @__PURE__ */ react.default.createElement("header", {
		className: (0, import_classnames.default)(blockClass, className),
		...rest
	}, breadcrumbs?.length > 0 && /* @__PURE__ */ react.default.createElement(require_BreadcrumbWithOverflow.BreadcrumbWithOverflow, {
		noTrailingSlash,
		className: (0, import_classnames.default)(`${blockClass}__breadcrumbs`),
		breadcrumbs,
		maxVisible,
		overflowAriaLabel,
		overflowTooltipAlign
	}), title && /* @__PURE__ */ react.default.createElement(_carbon_react.Heading, { className: (0, import_classnames.default)(`${blockClass}__title`) }, title));
};
SimpleHeader.propTypes = {
	breadcrumbs: prop_types.default.arrayOf(prop_types.default.shape({
		key: prop_types.default.string.isRequired,
		label: prop_types.default.string.isRequired,
		href: prop_types.default.string,
		title: prop_types.default.string,
		isCurrentPage: prop_types.default.bool
	})),
	className: prop_types.default.string,
	maxVisible: prop_types.default.number,
	noTrailingSlash: prop_types.default.bool,
	overflowAriaLabel: prop_types.default.string,
	overflowTooltipAlign: _carbon_react.Tooltip.propTypes.align,
	title: prop_types.default.string
};

//#endregion
exports.SimpleHeader = SimpleHeader;