1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
3 | import * as React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | import clsx from 'clsx';
|
6 | import withStyles from '../styles/withStyles';
|
7 | export const styles = theme => ({
|
8 |
|
9 | root: {
|
10 | position: 'relative',
|
11 | display: 'flex',
|
12 | alignItems: 'center'
|
13 | },
|
14 |
|
15 |
|
16 | gutters: {
|
17 | paddingLeft: theme.spacing(2),
|
18 | paddingRight: theme.spacing(2),
|
19 | [theme.breakpoints.up('sm')]: {
|
20 | paddingLeft: theme.spacing(3),
|
21 | paddingRight: theme.spacing(3)
|
22 | }
|
23 | },
|
24 |
|
25 |
|
26 | regular: theme.mixins.toolbar,
|
27 |
|
28 |
|
29 | dense: {
|
30 | minHeight: 48
|
31 | }
|
32 | });
|
33 | const Toolbar = React.forwardRef(function Toolbar(props, ref) {
|
34 | const {
|
35 | classes,
|
36 | className,
|
37 | component: Component = 'div',
|
38 | disableGutters = false,
|
39 | variant = 'regular'
|
40 | } = props,
|
41 | other = _objectWithoutPropertiesLoose(props, ["classes", "className", "component", "disableGutters", "variant"]);
|
42 |
|
43 | return React.createElement(Component, _extends({
|
44 | className: clsx(classes.root, classes[variant], className, !disableGutters && classes.gutters),
|
45 | ref: ref
|
46 | }, other));
|
47 | });
|
48 | process.env.NODE_ENV !== "production" ? Toolbar.propTypes = {
|
49 | |
50 |
|
51 |
|
52 | children: PropTypes.node,
|
53 |
|
54 | |
55 |
|
56 |
|
57 |
|
58 | classes: PropTypes.object.isRequired,
|
59 |
|
60 | |
61 |
|
62 |
|
63 | className: PropTypes.string,
|
64 |
|
65 | |
66 |
|
67 |
|
68 |
|
69 | component: PropTypes
|
70 |
|
71 | .elementType,
|
72 |
|
73 | |
74 |
|
75 |
|
76 | disableGutters: PropTypes.bool,
|
77 |
|
78 | |
79 |
|
80 |
|
81 | variant: PropTypes.oneOf(['regular', 'dense'])
|
82 | } : void 0;
|
83 | export default withStyles(styles, {
|
84 | name: 'MuiToolbar'
|
85 | })(Toolbar); |
\ | No newline at end of file |