@carbon/ibm-products
Version:
Carbon for IBM Products
55 lines (48 loc) • 1.69 kB
JavaScript
/**
* 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.
*/
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
import React__default from 'react';
import { Button } from '@carbon/react';
import PropTypes from '../../_virtual/index.js';
import cx from 'classnames';
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
import { pkg } from '../../settings.js';
// The block part of our conventional BEM class names (blockClass__E--M).
const blockClass = `${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.
*/
let InlineTipButton = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
let {
children,
className,
...rest
} = _ref;
return /*#__PURE__*/React__default.createElement(Button, _extends({}, rest, {
className: cx(blockClass, className),
ref: ref
}, getDevtoolsProps(componentName), {
size: "md",
kind: "ghost"
}), children);
});
InlineTipButton = pkg.checkComponentEnabled(InlineTipButton, componentName);
InlineTipButton.displayName = componentName;
InlineTipButton.propTypes = {
/**
* Provide the contents of the InlineTipButton.
*/
children: PropTypes.node.isRequired,
/**
* Provide an optional class to be applied to the containing node.
*/
className: PropTypes.string
/* TODO: add types and DocGen for all props. */
};
export { InlineTipButton };