/**
 * 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 { getDevtoolsProps } from "../../global/js/utils/devtools.js";
import { allPropTypes, prepareProps } from "../../global/js/utils/props-helper.js";
import { TearsheetShell, portalType, tearsheetShellWideProps } from "./TearsheetShell.js";
import React from "react";
import PropTypes from "prop-types";
import { Button } from "@carbon/react";

//#region src/components/Tearsheet/TearsheetNarrow.tsx
/**
* Copyright IBM Corp. 2020, 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.
*/
const componentName = "TearsheetNarrow";
const defaults = { verticalPosition: "lower" };
/**
* A narrow tearsheet is a slimmer variant of the tearsheet, providing a dialog
* that keeps users in-context and focused by bringing actionable content front
* and center while revealing more of the UI behind it.
*
* A narrow tearsheet comprises 3 zones: a heading area including a title, the
* main content area, and a set of action buttons.
*/
const TearsheetNarrow = React.forwardRef(({ verticalPosition = defaults.verticalPosition, ...rest }, ref) => /* @__PURE__ */ React.createElement(TearsheetShell, {
	...getDevtoolsProps(componentName),
	...prepareProps(rest, tearsheetShellWideProps),
	verticalPosition,
	ref,
	size: "narrow"
}));
TearsheetNarrow.displayName = componentName;
const deprecatedProps = { verticalPosition: PropTypes.oneOf(["normal", "lower"]) };
TearsheetNarrow.propTypes = {
	actions: allPropTypes([PropTypes.arrayOf(PropTypes.shape({
		...Button.propTypes,
		kind: PropTypes.oneOf([
			"ghost",
			"danger--ghost",
			"secondary",
			"danger",
			"primary"
		]),
		label: PropTypes.string,
		loading: PropTypes.bool,
		onClick: Button.propTypes.onClick
	}))]),
	ariaLabel: PropTypes.string,
	className: PropTypes.string,
	closeIconDescription: PropTypes.string,
	description: PropTypes.node,
	hasCloseIcon: PropTypes.bool,
	label: PropTypes.node,
	onClose: PropTypes.func,
	open: PropTypes.bool,
	portalTarget: portalType,
	selectorPrimaryFocus: PropTypes.string,
	selectorsFloatingMenus: PropTypes.arrayOf(PropTypes.string),
	title: PropTypes.node,
	...deprecatedProps
};

//#endregion
export { TearsheetNarrow };