UNPKG

@carbon/ibm-products

Version:
65 lines (63 loc) 2.5 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. */ import { __toESM } from "../../_virtual/_rolldown/runtime.js"; import { require_classnames } from "../../node_modules/classnames/index.js"; import { pkg } from "../../settings.js"; import { getDevtoolsProps } from "../../global/js/utils/devtools.js"; import React from "react"; import PropTypes from "prop-types"; //#region src/components/CoachmarkOverlayElement/CoachmarkOverlayElement.tsx /** * Copyright IBM Corp. 2023, 2025 * * 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 blockClass = `${pkg.prefix}--coachmark-overlay-element`; const componentName = "CoachmarkOverlayElement"; /** * Component to be displayed within a CoachmarkOverlayElements container. * Can be used 1 to N number, to display content in a Coachmark's overlay * in a carousel fashion. * @deprecated This component is deprecated. */ const CoachmarkOverlayElement = React.forwardRef(({ button, className, description, title, ...rest }, ref) => { return /* @__PURE__ */ React.createElement("div", { ...rest, className: (0, import_classnames.default)(blockClass, className, {}), ref, ...getDevtoolsProps(componentName) }, /* @__PURE__ */ React.createElement("div", { className: `${blockClass}__content` }, title && /* @__PURE__ */ React.createElement("h2", { className: `${blockClass}__title` }, title), description && /* @__PURE__ */ React.createElement("p", { className: `${blockClass}__body` }, description)), button && /* @__PURE__ */ React.createElement("div", { className: `${blockClass}__button` }, button)); }); /**@ts-ignore*/ CoachmarkOverlayElement.deprecated = { level: "warn", details: `${componentName} is deprecated.` }; CoachmarkOverlayElement.displayName = componentName; CoachmarkOverlayElement.propTypes = { /** * An optional button can be rendered below the description. * This can be a link, button, Coachmark button, etc. */ button: PropTypes.node, /** * Optional class name for this component. */ className: PropTypes.string, /** * The description of the Coachmark. */ description: PropTypes.node.isRequired, /** * The title of the Coachmark. */ title: PropTypes.string.isRequired }; //#endregion export { CoachmarkOverlayElement };