@carbon/react
Version:
React components for the Carbon Design System
41 lines (35 loc) • 1.12 kB
JavaScript
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
var cx = require('classnames');
var React = require('react');
var usePrefix = require('../../internal/usePrefix.js');
var PropTypes = require('prop-types');
function SideNavLinkText({
className: customClassName,
children,
...rest
}) {
const prefix = usePrefix.usePrefix();
const className = cx(`${prefix}--side-nav__link-text`, customClassName);
return /*#__PURE__*/React.createElement("span", _rollupPluginBabelHelpers.extends({}, rest, {
className: className
}), children);
}
SideNavLinkText.propTypes = {
/**
* Provide the content for the link text
*/
children: PropTypes.node.isRequired,
/**
* Provide an optional class to be applied to the containing node
*/
className: PropTypes.string
};
exports.default = SideNavLinkText;