/**
 * 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_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/CreateSidePanel/CreateSidePanel.tsx
/**
* Copyright IBM Corp. 2021, 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}--create-side-panel`;
const componentName = "CreateSidePanel";
/**
* Use with medium complexity creations if the user needs page context. On-page content can be seen and interacted with.
*/
const CreateSidePanel = react.default.forwardRef(({ className, children, disableSubmit, formTitle, formDescription, id, onRequestClose, onRequestSubmit, open, primaryButtonText, secondaryButtonText, selectorPageContent, selectorPrimaryFocus, 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 selectorPageContent && /* @__PURE__ */ react.default.createElement(require_SidePanel.SidePanel, {
		...rest,
		id,
		open,
		ref,
		selectorPageContent,
		onRequestClose,
		title,
		subtitle,
		selectorPrimaryFocus,
		...require_devtools.getDevtoolsProps(componentName),
		placement: "right",
		slideIn: true,
		animateTitle: false,
		className: (0, import_classnames.default)(blockClass, className),
		size: "md",
		actions
	}, /* @__PURE__ */ react.default.createElement("h3", {
		className: `${blockClass}__form-title-text ${blockClass}__content-text`,
		id: formTitleId
	}, formTitle), /* @__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,
		onSubmit: (e) => e.preventDefault()
	}, children));
});
CreateSidePanel.displayName = componentName;
CreateSidePanel.propTypes = {
	children: prop_types.default.oneOfType([prop_types.default.arrayOf(prop_types.default.node), prop_types.default.node]).isRequired,
	className: prop_types.default.string,
	description: prop_types.default.node,
	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,
	primaryButtonText: prop_types.default.string.isRequired,
	secondaryButtonText: prop_types.default.string.isRequired,
	selectorPageContent: prop_types.default.string.isRequired,
	selectorPrimaryFocus: prop_types.default.node.isRequired,
	slug: prop_types.default.node,
	subtitle: prop_types.default.node,
	title: prop_types.default.string.isRequired
};

//#endregion
exports.CreateSidePanel = CreateSidePanel;