@carbon/ibm-products
Version:
Carbon for IBM Products
59 lines (51 loc) • 1.87 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.
*/
;
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');
var icons = require('@carbon/react/icons');
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');
var _Launch;
// The block part of our conventional BEM class names (blockClass__E--M).
const blockClass = `${settings.pkg.prefix}--inline-tip__link`;
const componentName = 'InlineTipLink';
// NOTE: the component SCSS is not imported here: it is rolled up separately.
/**
* This is a standard Carbon link, styled specifically for use inside InlineTip.
*/
exports.InlineTipLink = /*#__PURE__*/React.forwardRef((_ref, ref) => {
let {
children,
className,
...rest
} = _ref;
return /*#__PURE__*/React.createElement(react.Link, _rollupPluginBabelHelpers.extends({}, rest, {
className: cx(blockClass, className),
ref: ref
}, devtools.getDevtoolsProps(componentName), {
renderIcon: () => _Launch || (_Launch = /*#__PURE__*/React.createElement(icons.Launch, {
size: 16
}))
}), children);
});
exports.InlineTipLink = settings.pkg.checkComponentEnabled(exports.InlineTipLink, componentName);
exports.InlineTipLink.displayName = componentName;
exports.InlineTipLink.propTypes = {
/**
* Provide the contents of the InlineTipLink.
*/
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. */
};