/**
 * 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 { ProductiveCard } from "../ProductiveCard/ProductiveCard.js";
import React from "react";
import PropTypes from "prop-types";

//#region src/components/EditUpdateCards/EditUpdateCards.tsx
/**
* Copyright IBM Corp. 2022, 2024
*
* 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}--edit-update-cards`;
const componentName = "EditUpdateCards";
/**
* **This component is deprecated.** <br>
Editable cards allow a user to view, modify, and save the content contained within the card.
These cards are generally used in instances where a user needs to make changes to a resource instances
(ex. configuration details), account plan, etc. Editable cards allow a user to edit something within context.
@deprecated
*/
const EditUpdateCards = React.forwardRef(({ actionIcons, actionsPlacement, className, description, editChildren, editMode, label, onPrimaryButtonClick, onSecondaryButtonClick, previewChildren, title, titleSize, primaryButtonIcon, primaryButtonText, secondaryButtonIcon, secondaryButtonText, ...rest }, ref) => {
	const conditionalProps = {
		onPrimaryButtonClick,
		onSecondaryButtonClick,
		primaryButtonIcon,
		primaryButtonKind: "ghost",
		primaryButtonPlacement: "top",
		primaryButtonText,
		secondaryButtonIcon,
		secondaryButtonKind: "ghost",
		secondaryButtonPlacement: "top",
		secondaryButtonText
	};
	return /* @__PURE__ */ React.createElement("div", {
		...rest,
		className: (0, import_classnames.default)(blockClass, className, { [`${blockClass}__actions-bottom`]: actionsPlacement === "bottom" }),
		ref,
		...getDevtoolsProps(componentName)
	}, /* @__PURE__ */ React.createElement(ProductiveCard, {
		actionIcons,
		actionsPlacement,
		className,
		description,
		label,
		title,
		titleSize,
		...editMode && conditionalProps
	}, editMode === false && /* @__PURE__ */ React.createElement("div", null, previewChildren), editMode && /* @__PURE__ */ React.createElement("div", null, editChildren)));
});
/**@ts-ignore*/
EditUpdateCards.deprecated = {
	level: "warn",
	details: `This component is deprecated and will be removed in the next major version.`
};
EditUpdateCards.displayName = componentName;
EditUpdateCards.propTypes = {
	actionIcons: PropTypes.arrayOf(PropTypes.shape({
		id: PropTypes.string,
		icon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
		onKeyDown: PropTypes.func,
		onClick: PropTypes.func,
		iconDescription: PropTypes.string,
		href: PropTypes.string,
		link: PropTypes.shape({ href: PropTypes.string.isRequired })
	})),
	actionsPlacement: PropTypes.oneOf(["top", "bottom"]),
	className: PropTypes.string,
	description: PropTypes.string,
	editChildren: PropTypes.node,
	editMode: PropTypes.bool,
	label: PropTypes.string,
	onPrimaryButtonClick: PropTypes.func,
	onSecondaryButtonClick: PropTypes.func,
	previewChildren: PropTypes.node,
	primaryButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
	primaryButtonKind: PropTypes.oneOf(["primary", "ghost"]),
	primaryButtonPlacement: PropTypes.oneOf(["top", "bottom"]),
	primaryButtonText: PropTypes.string,
	secondaryButtonHref: PropTypes.string,
	secondaryButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
	secondaryButtonKind: PropTypes.oneOf(["secondary", "ghost"]),
	secondaryButtonPlacement: PropTypes.oneOf(["top", "bottom"]),
	secondaryButtonText: PropTypes.string,
	title: PropTypes.string,
	titleSize: PropTypes.oneOf(["default", "large"])
};

//#endregion
export { EditUpdateCards };