/**
 * 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_settings = require('../../settings.js');
const require_devtools = require('../../global/js/utils/devtools.js');
const require_ProductiveCard = require('../ProductiveCard/ProductiveCard.js');
let react = require("react");
react = require_runtime.__toESM(react);
let prop_types = require("prop-types");
prop_types = require_runtime.__toESM(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__ */ require_runtime.__toESM(require_index.default);
const blockClass = `${require_settings.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.default.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.default.createElement("div", {
		...rest,
		className: (0, import_classnames.default)(blockClass, className, { [`${blockClass}__actions-bottom`]: actionsPlacement === "bottom" }),
		ref,
		...require_devtools.getDevtoolsProps(componentName)
	}, /* @__PURE__ */ react.default.createElement(require_ProductiveCard.ProductiveCard, {
		actionIcons,
		actionsPlacement,
		className,
		description,
		label,
		title,
		titleSize,
		...editMode && conditionalProps
	}, editMode === false && /* @__PURE__ */ react.default.createElement("div", null, previewChildren), editMode && /* @__PURE__ */ react.default.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: prop_types.default.arrayOf(prop_types.default.shape({
		id: prop_types.default.string,
		icon: prop_types.default.oneOfType([prop_types.default.func, prop_types.default.object]),
		onKeyDown: prop_types.default.func,
		onClick: prop_types.default.func,
		iconDescription: prop_types.default.string,
		href: prop_types.default.string,
		link: prop_types.default.shape({ href: prop_types.default.string.isRequired })
	})),
	actionsPlacement: prop_types.default.oneOf(["top", "bottom"]),
	className: prop_types.default.string,
	description: prop_types.default.string,
	editChildren: prop_types.default.node,
	editMode: prop_types.default.bool,
	label: prop_types.default.string,
	onPrimaryButtonClick: prop_types.default.func,
	onSecondaryButtonClick: prop_types.default.func,
	previewChildren: prop_types.default.node,
	primaryButtonIcon: prop_types.default.oneOfType([prop_types.default.func, prop_types.default.object]),
	primaryButtonKind: prop_types.default.oneOf(["primary", "ghost"]),
	primaryButtonPlacement: prop_types.default.oneOf(["top", "bottom"]),
	primaryButtonText: prop_types.default.string,
	secondaryButtonHref: prop_types.default.string,
	secondaryButtonIcon: prop_types.default.oneOfType([prop_types.default.func, prop_types.default.object]),
	secondaryButtonKind: prop_types.default.oneOf(["secondary", "ghost"]),
	secondaryButtonPlacement: prop_types.default.oneOf(["top", "bottom"]),
	secondaryButtonText: prop_types.default.string,
	title: prop_types.default.string,
	titleSize: prop_types.default.oneOf(["default", "large"])
};

//#endregion
exports.EditUpdateCards = EditUpdateCards;