cozy-ui 135.2.0 → 135.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/assets/icons/ui/cross-circle.svg +1 -1
- package/package.json +1 -1
- package/react/ActionsBar/Readme.md +61 -11
- package/react/ActionsBar/ResponsiveAction.jsx +3 -5
- package/react/ActionsBar/index.jsx +98 -71
- package/react/AppBar/index.js +66 -1
- package/react/Icons/CrossCircle.jsx +1 -4
- package/react/MuiCozyTheme/overrides/makeDarkNormalOverrides.js +16 -1
- package/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +6 -0
- package/transpiled/react/ActionsBar/ResponsiveAction.js +3 -2
- package/transpiled/react/ActionsBar/index.js +37 -24
- package/transpiled/react/AppBar/index.d.ts +3 -2
- package/transpiled/react/AppBar/index.js +53 -1
- package/transpiled/react/Icon/icons-sprite.d.ts +1 -1
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/CrossCircle.js +1 -2
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkInvertedOverrides.d.ts +6 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkNormalOverrides.d.ts +12 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeDarkNormalOverrides.js +13 -1
- package/transpiled/react/MuiCozyTheme/overrides/makeLightInvertedOverrides.d.ts +6 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.d.ts +6 -0
- package/transpiled/react/MuiCozyTheme/overrides/makeLightNormalOverrides.js +6 -0
|
@@ -1,2 +1,54 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["color", "className"];
|
|
1
4
|
import MuiAppBar from '@material-ui/core/AppBar';
|
|
2
|
-
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { makeStyles } from "cozy-ui/transpiled/react/styles";
|
|
8
|
+
var useStyles = makeStyles(function (theme) {
|
|
9
|
+
return {
|
|
10
|
+
colorError: {
|
|
11
|
+
backgroundColor: theme.palette.error.main,
|
|
12
|
+
color: theme.palette.error.contrastText
|
|
13
|
+
},
|
|
14
|
+
colorWarning: {
|
|
15
|
+
backgroundColor: theme.palette.warning.main,
|
|
16
|
+
color: theme.palette.warning.contrastText
|
|
17
|
+
},
|
|
18
|
+
colorInfo: {
|
|
19
|
+
backgroundColor: theme.palette.info.main,
|
|
20
|
+
color: theme.palette.info.contrastText
|
|
21
|
+
},
|
|
22
|
+
colorSuccess: {
|
|
23
|
+
backgroundColor: theme.palette.success.main,
|
|
24
|
+
color: theme.palette.success.contrastText
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
var CUSTOM_COLOR_CLASSES = {
|
|
29
|
+
error: 'colorError',
|
|
30
|
+
warning: 'colorWarning',
|
|
31
|
+
info: 'colorInfo',
|
|
32
|
+
success: 'colorSuccess'
|
|
33
|
+
};
|
|
34
|
+
var AppBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
35
|
+
var color = _ref.color,
|
|
36
|
+
className = _ref.className,
|
|
37
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
|
|
39
|
+
var styles = useStyles();
|
|
40
|
+
var appBarColor = CUSTOM_COLOR_CLASSES[color] ? 'default' : color;
|
|
41
|
+
var customColorClass = CUSTOM_COLOR_CLASSES[color] ? styles[CUSTOM_COLOR_CLASSES[color]] : undefined;
|
|
42
|
+
return /*#__PURE__*/React.createElement(MuiAppBar, _extends({}, props, {
|
|
43
|
+
ref: ref,
|
|
44
|
+
color: appBarColor,
|
|
45
|
+
className: "".concat(className || '', " ").concat(customColorClass || '')
|
|
46
|
+
}));
|
|
47
|
+
});
|
|
48
|
+
AppBar.propTypes = {
|
|
49
|
+
color: PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary', 'transparent', 'error', 'warning', 'info', 'success'])
|
|
50
|
+
};
|
|
51
|
+
AppBar.defaultProps = {
|
|
52
|
+
color: 'default'
|
|
53
|
+
};
|
|
54
|
+
export default AppBar;
|