UNPKG

@carbon/ibm-products

Version:
83 lines (81 loc) 2.78 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_settings = require("../../settings.js"); const require_devtools = require("../../global/js/utils/devtools.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/CoachmarkBeacon/CoachmarkBeacon.tsx var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default); const blockClass = `${require_settings.pkg.prefix}--coachmark-beacon`; const componentName = "CoachmarkBeacon"; const defaults = { kind: "default" }; /** * Use beacon for the target prop of a Coachmark component. * @deprecated This component is deprecated. */ const CoachmarkBeacon = react.default.forwardRef((props, ref) => { const { label, className, kind = defaults.kind, buttonProps, ...rest } = props; return /* @__PURE__ */ react.default.createElement("span", { ...rest, className: (0, import_classnames.default)(blockClass, `${blockClass}-${kind}`, className), ref, ...require_devtools.getDevtoolsProps(componentName), role: "tooltip" }, /* @__PURE__ */ react.default.createElement("button", { type: "button", ...buttonProps, className: `${blockClass}__target` }, /* @__PURE__ */ react.default.createElement("svg", { className: `${blockClass}__center`, "aria-label": label }, /* @__PURE__ */ react.default.createElement("title", null, label), /* @__PURE__ */ react.default.createElement("circle", { r: 1, cx: 38, cy: 38 })))); }); /**@ts-ignore*/ CoachmarkBeacon.deprecated = { level: "warn", details: `${componentName} is deprecated.` }; CoachmarkBeacon.displayName = componentName; CoachmarkBeacon.propTypes = { /** * button props */ buttonProps: prop_types.default.shape({ /**@ts-ignore*/ ..._carbon_react.Button.propTypes, /**@ts-ignore*/ onClick: prop_types.default.func, onDoubleClick: prop_types.default.func, tabIndex: prop_types.default.number, ["aria-expanded"]: prop_types.default.bool }), /** * Optional class name for this component. */ className: prop_types.default.string, /** * What style of beacon. * BEACON_KIND is an exported enum from the Coachmark and can be used for this value. * @see {@link BEACON_KIND} */ kind: prop_types.default.oneOf(["default"]), /** * The aria label. */ label: prop_types.default.string.isRequired }; //#endregion exports.CoachmarkBeacon = CoachmarkBeacon;