/**
 * 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 { getDevtoolsProps } from "../../global/js/utils/devtools.js";
import "../../global/js/utils/props-helper.js";
import { EmptyStateV2 } from "./EmptyStateV2.deprecated.js";
import { EmptyStateContent } from "./EmptyStateContent.js";
import React from "react";
import PropTypes from "prop-types";
import { Button } from "@carbon/react";

//#region src/components/EmptyStates/EmptyState.tsx
/**
* Copyright IBM Corp. 2020, 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__ */ __toESM(require_classnames());
const blockClass = `${pkg.prefix}--empty-state`;
const componentName = "EmptyState";
var sizes = /* @__PURE__ */ function(sizes) {
	sizes["lg"] = "lg";
	sizes["sm"] = "sm";
	return sizes;
}(sizes || {});
const defaults = {
	position: "top",
	size: sizes.lg
};
/**
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
*/
const EmptyState = React.forwardRef(({ v2 = false, ...props }, ref) => {
	if (v2) return /* @__PURE__ */ React.createElement(EmptyStateV2, props);
	const { action, className, illustration, illustrationDescription, illustrationPosition = defaults.position, link, size = defaults.size, headingAs, subtitle, title, ...rest } = props;
	return /* @__PURE__ */ React.createElement("div", {
		...rest,
		className: (0, import_classnames.default)(blockClass, `${blockClass}-type--default`, className, { [`${blockClass}-position--${illustrationPosition}`]: !!illustration }),
		ref,
		...getDevtoolsProps(componentName)
	}, illustration && /* @__PURE__ */ React.createElement("img", {
		src: illustration,
		alt: illustrationDescription,
		className: (0, import_classnames.default)([`${blockClass}__illustration`, `${blockClass}__illustration--${size}`]),
		"aria-hidden": "true"
	}), /* @__PURE__ */ React.createElement(EmptyStateContent, {
		action,
		link,
		size,
		headingAs,
		subtitle,
		title: title ?? ""
	}));
});
EmptyState.propTypes = {
	action: PropTypes.shape({
		...Button.propTypes,
		kind: PropTypes.oneOf([
			"primary",
			"secondary",
			"tertiary"
		]),
		renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
		onClick: Button.propTypes.onClick,
		text: PropTypes.string
	}),
	className: PropTypes.string,
	headingAs: PropTypes.elementType,
	illustration: PropTypes.string,
	illustrationDescription: PropTypes.string,
	illustrationPosition: PropTypes.oneOf([
		"top",
		"right",
		"bottom",
		"left"
	]),
	link: PropTypes.any,
	size: PropTypes.oneOf(["lg", "sm"]),
	subtitle: PropTypes.node,
	title: PropTypes.node.isRequired,
	v2: PropTypes.bool
};
EmptyState.displayName = componentName;

//#endregion
export { EmptyState, defaults };