@carbon/ibm-cloud-cognitive-cdai
Version:
Carbon for Cloud & Cognitive CD&AI UI components
49 lines (48 loc) • 1.94 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["className", "children", "ariaLabel"],
_excluded2 = ["className"];
//
// Copyright IBM Corp. 2020, 2020
//
// 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 React from 'react';
import { SideNavLink, SideNavMenu } from 'carbon-components-react';
import { idePrefix } from '../../../globals/js/settings';
import PropTypes from 'prop-types';
export var IdeSideNavLink = function IdeSideNavLink(_ref) {
var _ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className,
_ref$children = _ref.children,
children = _ref$children === void 0 ? /*#__PURE__*/React.createElement(React.Fragment, null) : _ref$children,
_ref$ariaLabel = _ref.ariaLabel,
ariaLabel = _ref$ariaLabel === void 0 ? '' : _ref$ariaLabel,
others = _objectWithoutProperties(_ref, _excluded);
return /*#__PURE__*/React.createElement(SideNavLink, _extends({}, others, {
className: "".concat(idePrefix, "-navigation--altHover-link ").concat(className)
// eslint-disable-next-line
,
children: children,
"aria-label": ariaLabel,
large: true
}));
};
export var IdeSideNavMenu = function IdeSideNavMenu(_ref2) {
var _ref2$className = _ref2.className,
className = _ref2$className === void 0 ? '' : _ref2$className,
others = _objectWithoutProperties(_ref2, _excluded2);
return /*#__PURE__*/React.createElement(SideNavMenu, _extends({}, others, {
className: "".concat(idePrefix, "-navigation--altHover-menu ").concat(className),
large: true
}));
};
IdeSideNavLink.propTypes = {
ariaLabel: PropTypes.string,
children: PropTypes.node,
className: PropTypes.string
};
IdeSideNavMenu.propTypes = {
className: PropTypes.string
};