UNPKG

@carbon/ibm-products

Version:

Carbon for IBM Products

55 lines (48 loc) 1.75 kB
/** * Copyright IBM Corp. 2020, 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. */ 'use strict'; var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js'); var React = require('react'); var react = require('@carbon/react'); var index = require('../../_virtual/index.js'); var cx = require('classnames'); var devtools = require('../../global/js/utils/devtools.js'); var settings = require('../../settings.js'); // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${settings.pkg.prefix}--inline-tip__button`; const componentName = 'InlineTipButton'; // NOTE: the component SCSS is not imported here: it is rolled up separately. /** * This is a standard Carbon button, styled specifically for use inside InlineTip. */ exports.InlineTipButton = /*#__PURE__*/React.forwardRef((_ref, ref) => { let { children, className, ...rest } = _ref; return /*#__PURE__*/React.createElement(react.Button, _rollupPluginBabelHelpers.extends({}, rest, { className: cx(blockClass, className), ref: ref }, devtools.getDevtoolsProps(componentName), { size: "md", kind: "ghost" }), children); }); exports.InlineTipButton = settings.pkg.checkComponentEnabled(exports.InlineTipButton, componentName); exports.InlineTipButton.displayName = componentName; exports.InlineTipButton.propTypes = { /** * Provide the contents of the InlineTipButton. */ children: index.default.node.isRequired, /** * Provide an optional class to be applied to the containing node. */ className: index.default.string /* TODO: add types and DocGen for all props. */ };