1 | 'use client';
|
2 |
|
3 | import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4 | import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
5 | import _extends from "@babel/runtime/helpers/esm/extends";
|
6 | import * as React from 'react';
|
7 | import PropTypes from 'prop-types';
|
8 | import clsx from 'clsx';
|
9 | import composeClasses from '@mui/utils/composeClasses';
|
10 | import { useDefaultProps } from '../DefaultPropsProvider';
|
11 | import styled from '../styles/styled';
|
12 | import { getToolbarUtilityClass } from './toolbarClasses';
|
13 | import { jsx as _jsx } from "react/jsx-runtime";
|
14 | var useUtilityClasses = function useUtilityClasses(ownerState) {
|
15 | var classes = ownerState.classes,
|
16 | disableGutters = ownerState.disableGutters,
|
17 | variant = ownerState.variant;
|
18 | var slots = {
|
19 | root: ['root', !disableGutters && 'gutters', variant]
|
20 | };
|
21 | return composeClasses(slots, getToolbarUtilityClass, classes);
|
22 | };
|
23 | var ToolbarRoot = styled('div', {
|
24 | name: 'MuiToolbar',
|
25 | slot: 'Root',
|
26 | overridesResolver: function overridesResolver(props, styles) {
|
27 | var ownerState = props.ownerState;
|
28 | return [styles.root, !ownerState.disableGutters && styles.gutters, styles[ownerState.variant]];
|
29 | }
|
30 | })(function (_ref) {
|
31 | var theme = _ref.theme,
|
32 | ownerState = _ref.ownerState;
|
33 | return _extends({
|
34 | position: 'relative',
|
35 | display: 'flex',
|
36 | alignItems: 'center'
|
37 | }, !ownerState.disableGutters && _defineProperty({
|
38 | paddingLeft: theme.spacing(2),
|
39 | paddingRight: theme.spacing(2)
|
40 | }, theme.breakpoints.up('sm'), {
|
41 | paddingLeft: theme.spacing(3),
|
42 | paddingRight: theme.spacing(3)
|
43 | }), ownerState.variant === 'dense' && {
|
44 | minHeight: 48
|
45 | });
|
46 | }, function (_ref3) {
|
47 | var theme = _ref3.theme,
|
48 | ownerState = _ref3.ownerState;
|
49 | return ownerState.variant === 'regular' && theme.mixins.toolbar;
|
50 | });
|
51 | var Toolbar = React.forwardRef(function Toolbar(inProps, ref) {
|
52 | var props = useDefaultProps({
|
53 | props: inProps,
|
54 | name: 'MuiToolbar'
|
55 | });
|
56 | var className = props.className,
|
57 | _props$component = props.component,
|
58 | component = _props$component === void 0 ? 'div' : _props$component,
|
59 | _props$disableGutters = props.disableGutters,
|
60 | disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters,
|
61 | _props$variant = props.variant,
|
62 | variant = _props$variant === void 0 ? 'regular' : _props$variant,
|
63 | other = _objectWithoutProperties(props, ["className", "component", "disableGutters", "variant"]);
|
64 | var ownerState = _extends({}, props, {
|
65 | component: component,
|
66 | disableGutters: disableGutters,
|
67 | variant: variant
|
68 | });
|
69 | var classes = useUtilityClasses(ownerState);
|
70 | return _jsx(ToolbarRoot, _extends({
|
71 | as: component,
|
72 | className: clsx(classes.root, className),
|
73 | ref: ref,
|
74 | ownerState: ownerState
|
75 | }, other));
|
76 | });
|
77 | process.env.NODE_ENV !== "production" ? Toolbar.propTypes = {
|
78 |
|
79 |
|
80 |
|
81 |
|
82 | |
83 |
|
84 |
|
85 |
|
86 | children: PropTypes.node,
|
87 | |
88 |
|
89 |
|
90 | classes: PropTypes.object,
|
91 | |
92 |
|
93 |
|
94 | className: PropTypes.string,
|
95 | |
96 |
|
97 |
|
98 |
|
99 | component: PropTypes.elementType,
|
100 | |
101 |
|
102 |
|
103 |
|
104 | disableGutters: PropTypes.bool,
|
105 | |
106 |
|
107 |
|
108 | sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
109 | |
110 |
|
111 |
|
112 |
|
113 | variant: PropTypes .oneOfType([PropTypes.oneOf(['dense', 'regular']), PropTypes.string])
|
114 | } : void 0;
|
115 | export default Toolbar; |
\ | No newline at end of file |