1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
3 | import React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | import classNames from 'classnames';
|
6 | import { mapToCssModules, tagPropType } from './utils';
|
7 | var propTypes = {
|
8 | tag: tagPropType,
|
9 | listTag: tagPropType,
|
10 | className: PropTypes.string,
|
11 | listClassName: PropTypes.string,
|
12 | cssModule: PropTypes.object,
|
13 | children: PropTypes.node,
|
14 | 'aria-label': PropTypes.string
|
15 | };
|
16 | var defaultProps = {
|
17 | tag: 'nav',
|
18 | listTag: 'ol',
|
19 | 'aria-label': 'breadcrumb'
|
20 | };
|
21 |
|
22 | var Breadcrumb = function Breadcrumb(props) {
|
23 | var className = props.className,
|
24 | listClassName = props.listClassName,
|
25 | cssModule = props.cssModule,
|
26 | children = props.children,
|
27 | Tag = props.tag,
|
28 | ListTag = props.listTag,
|
29 | label = props['aria-label'],
|
30 | attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "children", "tag", "listTag", "aria-label"]);
|
31 |
|
32 | var classes = mapToCssModules(classNames(className), cssModule);
|
33 | var listClasses = mapToCssModules(classNames('breadcrumb', listClassName), cssModule);
|
34 | return React.createElement(Tag, _extends({}, attributes, {
|
35 | className: classes,
|
36 | "aria-label": label
|
37 | }), React.createElement(ListTag, {
|
38 | className: listClasses
|
39 | }, children));
|
40 | };
|
41 |
|
42 | Breadcrumb.propTypes = propTypes;
|
43 | Breadcrumb.defaultProps = defaultProps;
|
44 | export default Breadcrumb; |
\ | No newline at end of file |