@carbon/ibm-products
Version:
Carbon for IBM Products
40 lines (38 loc) • 1.49 kB
JavaScript
/**
* 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 { __toESM } from "../../_virtual/_rolldown/runtime.js";
import { require_classnames } from "../../node_modules/classnames/index.js";
import { pkg } from "../../settings.js";
import { useWebTerminal } from "./hooks/index.js";
import React from "react";
import PropTypes from "prop-types";
//#region src/components/WebTerminal/WebTerminalContentWrapper.tsx
/**
* Copyright IBM Corp. 2022, 2022
*
* 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__ */ __toESM(require_classnames());
const componentName = "WebTerminalContentWrapper";
const blockClass = `${pkg.prefix}--web-terminal-content-wrapper`;
const WebTerminalContentWrapper = React.forwardRef(({ children, ...rest }, ref) => {
const { open } = useWebTerminal();
return /* @__PURE__ */ React.createElement("div", {
ref,
className: (0, import_classnames.default)([blockClass, { [`${blockClass}--open`]: open }]),
...rest
}, children);
});
WebTerminalContentWrapper.displayName = componentName;
WebTerminalContentWrapper.propTypes = {
/**
* Pass in content as children.
*/
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired };
//#endregion
export { WebTerminalContentWrapper };