UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

42 lines (38 loc) 1.12 kB
/** * MSKCC 2021, 2024 */ import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js'; import cx from 'classnames'; import PropTypes from 'prop-types'; import React__default from 'react'; import { AriaLabelPropType } from '../../../prop-types/AriaPropTypes.js'; const HeaderWidths = ['default', 'fluid', 'max']; function Header(_ref) { let { className: customClassName, children, width = 'default', ...rest } = _ref; const className = cx('msk-header', 'msk-header--next', customClassName, // must be one of the widths, if not, go to default { [`msk-header--width-${width}`]: width }); return /*#__PURE__*/React__default.createElement("header", _extends({ className: className, role: "banner" }, rest), children); } Header.displayName = 'Header'; Header.propTypes = { /** * Required props for the accessibility label of the header */ ...AriaLabelPropType, as: PropTypes.elementType, children: PropTypes.node, className: PropTypes.string, width: PropTypes.oneOf(HeaderWidths) }; export { Header, HeaderWidths, Header as default };