UNPKG

@carbon/ibm-products

Version:
61 lines (59 loc) 2.1 kB
/** * 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_PageHeaderUtils = require("../PageHeaderUtils.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/PageHeader/next/PageHeaderContentText.tsx /** * Copyright IBM Corp. 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. */ var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default); const PageHeaderContentText = ({ className, children, subtitle, subtitleAs = "h2", ...other }) => { const classNames = (0, import_classnames.default)({ [`${require_PageHeaderUtils.blockClass}__content__body`]: true }, className); return /* @__PURE__ */ react.default.createElement("div", { className: classNames, ...other }, subtitle && /* @__PURE__ */ react.default.createElement(_carbon_react.unstable_Text, { as: subtitleAs, className: `${require_PageHeaderUtils.blockClass}__content__subtitle` }, subtitle), children); }; PageHeaderContentText.displayName = "PageHeaderContentText"; PageHeaderContentText.propTypes = { /** * Provide child elements to be rendered inside PageHeaderContentText. */ children: prop_types.default.node, /** * Specify an optional className to be added to your PageHeaderContentText */ className: prop_types.default.string, /** * The PageHeaderContent's subtitle */ subtitle: prop_types.default.string, /** * Specify the element used to render the subtitle. */ subtitleAs: prop_types.default.oneOf([ "h2", "h3", "h4", "h5", "h6" ]) }; //#endregion exports.PageHeaderContentText = PageHeaderContentText;