/**
 * 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');
require('../../global/js/utils/props-helper.js');
const require_uuidv4 = require('../../global/js/utils/uuidv4.js');
const require_SidePanel = require('../SidePanel/SidePanel.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/EditSidePanel/EditSidePanel.tsx
var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const blockClass = `${require_settings.pkg.prefix}--edit-side-panel`;
const componentName = "EditSidePanel";
/**
* **This component is deprecated.** <br>
* Use with medium complexity edits if the user needs page context.
* @deprecated
*/
const EditSidePanel = react.default.forwardRef(({ children, className, disableSubmit, id, formTitle, formDescription, onRequestClose, onRequestSubmit, open, placement = "right", primaryButtonText, secondaryButtonText, selectorPrimaryFocus, selectorPageContent, size = "md", slideIn, subtitle, title, ...rest }, ref) => {
	const actions = [{
		label: primaryButtonText,
		onClick: (event) => {
			event.preventDefault();
			onRequestSubmit?.();
		},
		kind: "primary",
		disabled: disableSubmit,
		type: "submit"
	}, {
		label: secondaryButtonText,
		onClick: onRequestClose,
		kind: "secondary"
	}];
	const formTitleId = require_uuidv4.default();
	return /* @__PURE__ */ react.default.createElement(require_SidePanel.SidePanel, {
		...rest,
		open,
		ref,
		selectorPageContent,
		onRequestClose,
		title,
		subtitle,
		selectorPrimaryFocus,
		id,
		...require_devtools.getDevtoolsProps(componentName),
		placement,
		slideIn,
		animateTitle: false,
		className: (0, import_classnames.default)(blockClass, className),
		size,
		preventCloseOnClickOutside: true,
		actions
	}, formTitle && /* @__PURE__ */ react.default.createElement("h3", {
		id: formTitleId,
		className: `${blockClass}__form-title-text ${blockClass}__content-text`
	}, formTitle), formDescription && /* @__PURE__ */ react.default.createElement("p", { className: `${blockClass}__form-description-text ${blockClass}__content-text` }, formDescription), /* @__PURE__ */ react.default.createElement(_carbon_react.Form, {
		className: `${blockClass}__form`,
		"aria-labelledby": formTitleId
	}, children));
});
/**@ts-ignore*/
EditSidePanel.deprecated = {
	level: "warn",
	details: `This component is deprecated and will be removed in the next major version.`
};
EditSidePanel.displayName = componentName;
EditSidePanel.propTypes = {
	children: prop_types.default.oneOfType([prop_types.default.arrayOf(prop_types.default.node), prop_types.default.node]).isRequired,
	className: prop_types.default.string,
	disableSubmit: prop_types.default.bool,
	formDescription: prop_types.default.node,
	formTitle: prop_types.default.node.isRequired,
	id: prop_types.default.string,
	onRequestClose: prop_types.default.func,
	onRequestSubmit: prop_types.default.func,
	open: prop_types.default.bool.isRequired,
	placement: prop_types.default.oneOf(["left", "right"]),
	primaryButtonText: prop_types.default.string.isRequired,
	secondaryButtonText: prop_types.default.string.isRequired,
	selectorPageContent: prop_types.default.string,
	selectorPrimaryFocus: prop_types.default.node.isRequired,
	size: prop_types.default.oneOf([
		"xs",
		"sm",
		"md",
		"lg",
		"2xl"
	]),
	slideIn: prop_types.default.bool,
	slug: prop_types.default.node,
	subtitle: prop_types.default.node,
	title: prop_types.default.node.isRequired
};

//#endregion
exports.EditSidePanel = EditSidePanel;