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

//#region src/components/Tearsheet/Tearsheet.tsx
/**
* Copyright IBM Corp. 2020, 2023
*
* 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 = "Tearsheet";
/**
* A tearsheet is a mostly full-screen type of dialog that keeps users
* in-context and focused by bringing actionable content front and center while
* revealing parts of the UI behind it. There is also a narrow variant of the
* tearsheet.
*
* A tearsheet comprises up to 5 zones, allowing for flexibility depending on
* the content: a heading area including a title, an optional navigation area
* that sits just below the heading, an optional influencer which is a side
* panel on either the left or right side, the main content area, and a set of
* action buttons.
*/
const Tearsheet = React.forwardRef((props, ref) => {
	const { influencerPosition = "left", influencerWidth = "narrow", children, ...rest } = props;
	return /* @__PURE__ */ React.createElement(TearsheetShell, {
		...getDevtoolsProps(componentName),
		...rest,
		influencerPosition,
		influencerWidth,
		ref,
		size: "wide"
	}, children);
});
Tearsheet.displayName = componentName;
const deprecatedProps = { verticalPosition: PropTypes.oneOf(["normal", "lower"]) };
Tearsheet.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,
	headerActions: PropTypes.element,
	influencer: PropTypes.element,
	influencerPosition: PropTypes.oneOf(["left", "right"]),
	influencerWidth: PropTypes.oneOf(["narrow", "wide"]),
	label: PropTypes.node,
	launcherButtonRef: PropTypes.any,
	navigation: PropTypes.element,
	onClose: PropTypes.func,
	open: PropTypes.bool,
	portalTarget: portalType,
	selectorPrimaryFocus: PropTypes.string,
	selectorsFloatingMenus: PropTypes.arrayOf(PropTypes.string),
	title: PropTypes.node,
	...deprecatedProps
};

//#endregion
export { Tearsheet };