cozy-ui 70.2.2 → 70.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/.bundlemonrc +1 -2
- package/CHANGELOG.md +24 -0
- package/package.json +2 -1
- package/react/Alert/Readme.md +132 -0
- package/react/Alert/index.jsx +115 -0
- package/react/AlertTitle/Readme.md +1 -0
- package/react/AlertTitle/index.jsx +3 -0
- package/react/BottomSheet/BackdropOrFragment.jsx +6 -2
- package/react/BottomSheet/BottomSheet.jsx +61 -62
- package/react/BottomSheet/constants.js +1 -0
- package/react/BottomSheet/helpers.js +17 -0
- package/react/BottomSheet/helpers.spec.js +50 -1
- package/react/CozyDialogs/styles.styl +2 -2
- package/react/MuiCozyTheme/makeOverrides.js +128 -1
- package/react/Snackbar/Readme.md +81 -1
- package/react/Snackbar/index.js +19 -1
- package/react/__snapshots__/examples.spec.jsx.snap +557 -303
- package/react/examples.spec.jsx +1 -0
- package/react/index.js +2 -0
- package/transpiled/react/Alert/index.js +106 -0
- package/transpiled/react/AlertTitle/index.js +2 -0
- package/transpiled/react/BottomSheet/BackdropOrFragment.js +3 -1
- package/transpiled/react/BottomSheet/BottomSheet.js +18 -18
- package/transpiled/react/BottomSheet/constants.js +1 -0
- package/transpiled/react/BottomSheet/helpers.js +15 -0
- package/transpiled/react/MuiCozyTheme/makeOverrides.js +118 -2
- package/transpiled/react/Snackbar/index.js +20 -1
- package/transpiled/react/index.js +3 -1
- package/transpiled/react/stylesheet.css +1 -1
package/react/examples.spec.jsx
CHANGED
package/react/index.js
CHANGED
|
@@ -108,3 +108,5 @@ export { default as Chips } from './Chips'
|
|
|
108
108
|
export { default as PieChart } from './PieChart'
|
|
109
109
|
export { default as DropdownText } from './DropdownText'
|
|
110
110
|
export { default as CircleButton } from './CircleButton'
|
|
111
|
+
export { default as Alert } from './Alert'
|
|
112
|
+
export { default as AlertTitle } from './AlertTitle'
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "icon", "severity", "block", "color", "square", "action", "variant", "children"];
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import cx from 'classnames';
|
|
7
|
+
import MuiAlert from '@material-ui/lab/Alert';
|
|
8
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
9
|
+
import Icon from "cozy-ui/transpiled/react/Icon";
|
|
10
|
+
import CheckCircleIcon from "cozy-ui/transpiled/react/Icons/CheckCircle";
|
|
11
|
+
import WarningIcon from "cozy-ui/transpiled/react/Icons/Warning";
|
|
12
|
+
import WarningCircleIcon from "cozy-ui/transpiled/react/Icons/WarningCircle";
|
|
13
|
+
import InfoIcon from "cozy-ui/transpiled/react/Icons/Info";
|
|
14
|
+
var DEFAULT_ICON_SIZE = 16;
|
|
15
|
+
var defaultIconMapping = {
|
|
16
|
+
success: /*#__PURE__*/React.createElement(Icon, {
|
|
17
|
+
icon: CheckCircleIcon
|
|
18
|
+
}),
|
|
19
|
+
warning: /*#__PURE__*/React.createElement(Icon, {
|
|
20
|
+
icon: WarningIcon
|
|
21
|
+
}),
|
|
22
|
+
error: /*#__PURE__*/React.createElement(Icon, {
|
|
23
|
+
icon: WarningCircleIcon
|
|
24
|
+
}),
|
|
25
|
+
info: /*#__PURE__*/React.createElement(Icon, {
|
|
26
|
+
icon: InfoIcon
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var makeIcon = function makeIcon(icon, severity) {
|
|
31
|
+
// used to remove icon
|
|
32
|
+
if (icon === false) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return icon || ['primary', 'secondary'].includes(severity) && /*#__PURE__*/React.createElement(Icon, {
|
|
37
|
+
icon: InfoIcon
|
|
38
|
+
}) || undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var useStyles = makeStyles({
|
|
42
|
+
message: {
|
|
43
|
+
maxWidth: function maxWidth(_ref) {
|
|
44
|
+
var block = _ref.block,
|
|
45
|
+
iconSize = _ref.iconSize;
|
|
46
|
+
return block && "calc(100% - ".concat(iconSize + 16, "px)");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
var Alert = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
51
|
+
var _icon$props;
|
|
52
|
+
|
|
53
|
+
var className = _ref2.className,
|
|
54
|
+
icon = _ref2.icon,
|
|
55
|
+
severity = _ref2.severity,
|
|
56
|
+
block = _ref2.block,
|
|
57
|
+
color = _ref2.color,
|
|
58
|
+
square = _ref2.square,
|
|
59
|
+
action = _ref2.action,
|
|
60
|
+
variant = _ref2.variant,
|
|
61
|
+
children = _ref2.children,
|
|
62
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
63
|
+
|
|
64
|
+
var madeSeverity = ['primary', 'secondary'].includes(severity) ? 'success' : severity;
|
|
65
|
+
var madeIcon = makeIcon(icon, severity);
|
|
66
|
+
var iconSize = (icon === null || icon === void 0 ? void 0 : (_icon$props = icon.props) === null || _icon$props === void 0 ? void 0 : _icon$props.size) || DEFAULT_ICON_SIZE;
|
|
67
|
+
var styles = useStyles({
|
|
68
|
+
iconSize: iconSize,
|
|
69
|
+
block: block
|
|
70
|
+
});
|
|
71
|
+
return /*#__PURE__*/React.createElement(MuiAlert, _extends({
|
|
72
|
+
ref: ref,
|
|
73
|
+
style: {
|
|
74
|
+
backgroundColor: color,
|
|
75
|
+
borderRadius: square && 0
|
|
76
|
+
},
|
|
77
|
+
className: cx(className, "cozyAlert-".concat(severity, "-").concat(variant), {
|
|
78
|
+
block: block
|
|
79
|
+
}, {
|
|
80
|
+
action: Boolean(action)
|
|
81
|
+
}),
|
|
82
|
+
classes: styles,
|
|
83
|
+
variant: variant,
|
|
84
|
+
severity: madeSeverity,
|
|
85
|
+
iconMapping: defaultIconMapping,
|
|
86
|
+
icon: madeIcon,
|
|
87
|
+
action: action
|
|
88
|
+
}, props), children);
|
|
89
|
+
});
|
|
90
|
+
Alert.displayName = 'Alert';
|
|
91
|
+
Alert.propTypes = {
|
|
92
|
+
className: PropTypes.string,
|
|
93
|
+
icon: PropTypes.oneOfType([PropTypes.element, PropTypes.bool]),
|
|
94
|
+
severity: PropTypes.oneOf(['primary', 'secondary', 'success', 'error', 'warning', 'info']),
|
|
95
|
+
block: PropTypes.bool,
|
|
96
|
+
color: PropTypes.string,
|
|
97
|
+
square: PropTypes.bool,
|
|
98
|
+
variant: PropTypes.oneOf(['standard', 'outlined', 'filled'])
|
|
99
|
+
};
|
|
100
|
+
Alert.defaultProps = {
|
|
101
|
+
severity: 'primary',
|
|
102
|
+
block: false,
|
|
103
|
+
square: false,
|
|
104
|
+
variant: 'standard'
|
|
105
|
+
};
|
|
106
|
+
export default Alert;
|
|
@@ -3,13 +3,15 @@ import Backdrop from "cozy-ui/transpiled/react/Backdrop";
|
|
|
3
3
|
|
|
4
4
|
var BackdropOrFragment = function BackdropOrFragment(_ref) {
|
|
5
5
|
var showBackdrop = _ref.showBackdrop,
|
|
6
|
+
onClick = _ref.onClick,
|
|
6
7
|
children = _ref.children;
|
|
7
8
|
var Comp = showBackdrop ? Backdrop : Fragment;
|
|
8
9
|
var props = showBackdrop ? {
|
|
9
10
|
style: {
|
|
10
11
|
zIndex: 'var(--zIndex-overlay)'
|
|
11
12
|
},
|
|
12
|
-
open: showBackdrop
|
|
13
|
+
open: showBackdrop,
|
|
14
|
+
onClick: onClick
|
|
13
15
|
} : undefined;
|
|
14
16
|
return /*#__PURE__*/React.createElement(Comp, props, children);
|
|
15
17
|
};
|
|
@@ -14,10 +14,9 @@ import Fade from '@material-ui/core/Fade';
|
|
|
14
14
|
import { getFlagshipMetadata } from 'cozy-device-helper';
|
|
15
15
|
import Stack from "cozy-ui/transpiled/react/Stack";
|
|
16
16
|
import Paper from "cozy-ui/transpiled/react/Paper";
|
|
17
|
-
import ClickAwayListener from "cozy-ui/transpiled/react/ClickAwayListener";
|
|
18
17
|
import BackdropOrFragment from "cozy-ui/transpiled/react/BottomSheet/BackdropOrFragment";
|
|
19
|
-
import { computeMaxHeight, computeMediumHeight, computeMinHeight, makeOverridenChildren, setTopPosition, setBottomPosition } from "cozy-ui/transpiled/react/BottomSheet/helpers";
|
|
20
|
-
|
|
18
|
+
import { computeMaxHeight, computeMediumHeight, computeMinHeight, makeOverridenChildren, setTopPosition, setBottomPosition, minimizeAndClose } from "cozy-ui/transpiled/react/BottomSheet/helpers";
|
|
19
|
+
import { ANIMATION_DURATION } from "cozy-ui/transpiled/react/BottomSheet/constants";
|
|
21
20
|
|
|
22
21
|
var createStyles = function createStyles(_ref) {
|
|
23
22
|
var squared = _ref.squared,
|
|
@@ -50,7 +49,8 @@ var createStyles = function createStyles(_ref) {
|
|
|
50
49
|
position: 'fixed',
|
|
51
50
|
bottom: 0,
|
|
52
51
|
left: 0,
|
|
53
|
-
backgroundColor: 'var(--paperBackgroundColor)'
|
|
52
|
+
backgroundColor: 'var(--paperBackgroundColor)',
|
|
53
|
+
zIndex: 'var(--zIndex-overlay)'
|
|
54
54
|
},
|
|
55
55
|
flagshipImmersive: {
|
|
56
56
|
backgroundColor: 'var(--paperBackgroundColor)',
|
|
@@ -148,13 +148,6 @@ var BottomSheet = function BottomSheet(_ref2) {
|
|
|
148
148
|
onClose && onClose();
|
|
149
149
|
}, [onClose]);
|
|
150
150
|
|
|
151
|
-
var handleMinimizeAndClose = function handleMinimizeAndClose() {
|
|
152
|
-
if (backdrop) {
|
|
153
|
-
setCurrentIndex(0);
|
|
154
|
-
setTimeout(handleClose, ANIMATION_DURATION);
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
|
|
158
151
|
var handleOnIndexChange = function handleOnIndexChange(snapIndex) {
|
|
159
152
|
var maxHeightSnapIndex = peekHeights.length - 1;
|
|
160
153
|
setCurrentIndex(snapIndex);
|
|
@@ -217,8 +210,17 @@ var BottomSheet = function BottomSheet(_ref2) {
|
|
|
217
210
|
return /*#__PURE__*/React.createElement(React.Fragment, null, getFlagshipMetadata().immersive && /*#__PURE__*/React.createElement("span", {
|
|
218
211
|
style: styles.flagshipImmersive
|
|
219
212
|
}), /*#__PURE__*/React.createElement(BackdropOrFragment, {
|
|
220
|
-
showBackdrop: showBackdrop
|
|
221
|
-
|
|
213
|
+
showBackdrop: showBackdrop,
|
|
214
|
+
onClick: function onClick() {
|
|
215
|
+
return minimizeAndClose({
|
|
216
|
+
backdrop: backdrop,
|
|
217
|
+
setCurrentIndex: setCurrentIndex,
|
|
218
|
+
setIsTopPosition: setIsTopPosition,
|
|
219
|
+
setIsBottomPosition: setIsBottomPosition,
|
|
220
|
+
handleClose: handleClose
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}), /*#__PURE__*/React.createElement(MuiBottomSheet, {
|
|
222
224
|
peekHeights: peekHeights,
|
|
223
225
|
defaultHeight: initPos,
|
|
224
226
|
backdrop: false,
|
|
@@ -238,9 +240,7 @@ var BottomSheet = function BottomSheet(_ref2) {
|
|
|
238
240
|
disabledClosing: !onClose,
|
|
239
241
|
hidden: isHidden,
|
|
240
242
|
snapPointSeekerMode: "next"
|
|
241
|
-
}, /*#__PURE__*/React.createElement(
|
|
242
|
-
onClickAway: handleMinimizeAndClose
|
|
243
|
-
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
|
|
243
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
244
244
|
ref: innerContentRef
|
|
245
245
|
}, /*#__PURE__*/React.createElement(Paper, {
|
|
246
246
|
"data-testid": "bottomSheet-header",
|
|
@@ -258,12 +258,12 @@ var BottomSheet = function BottomSheet(_ref2) {
|
|
|
258
258
|
style: {
|
|
259
259
|
height: backdrop ? 0 : bottomSpacerHeight
|
|
260
260
|
}
|
|
261
|
-
}))
|
|
261
|
+
})), !isBottomPosition && /*#__PURE__*/React.createElement(Fade, {
|
|
262
262
|
in: true,
|
|
263
263
|
timeout: ANIMATION_DURATION
|
|
264
264
|
}, /*#__PURE__*/React.createElement("div", {
|
|
265
265
|
style: styles.bounceSafer
|
|
266
|
-
})))
|
|
266
|
+
})));
|
|
267
267
|
};
|
|
268
268
|
|
|
269
269
|
BottomSheet.defaultProps = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var ANIMATION_DURATION = 250;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { getFlagshipMetadata } from 'cozy-device-helper';
|
|
3
|
+
import { ANIMATION_DURATION } from "cozy-ui/transpiled/react/BottomSheet/constants";
|
|
3
4
|
export var computeMaxHeight = function computeMaxHeight(toolbarProps) {
|
|
4
5
|
var ref = toolbarProps.ref,
|
|
5
6
|
height = toolbarProps.height;
|
|
@@ -82,4 +83,18 @@ export var setBottomPosition = function setBottomPosition(_ref4) {
|
|
|
82
83
|
if (snapIndex !== 0 && isBottomPosition) {
|
|
83
84
|
setIsBottomPosition(false);
|
|
84
85
|
}
|
|
86
|
+
};
|
|
87
|
+
export var minimizeAndClose = function minimizeAndClose(_ref5) {
|
|
88
|
+
var backdrop = _ref5.backdrop,
|
|
89
|
+
setCurrentIndex = _ref5.setCurrentIndex,
|
|
90
|
+
setIsTopPosition = _ref5.setIsTopPosition,
|
|
91
|
+
setIsBottomPosition = _ref5.setIsBottomPosition,
|
|
92
|
+
handleClose = _ref5.handleClose;
|
|
93
|
+
|
|
94
|
+
if (backdrop) {
|
|
95
|
+
setCurrentIndex(0);
|
|
96
|
+
setIsTopPosition(false);
|
|
97
|
+
setIsBottomPosition(true);
|
|
98
|
+
setTimeout(handleClose, ANIMATION_DURATION);
|
|
99
|
+
}
|
|
85
100
|
};
|
|
@@ -4,13 +4,71 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
|
-
import { alpha } from '@material-ui/core/styles';
|
|
7
|
+
import { alpha, lighten, darken } from '@material-ui/core/styles';
|
|
8
8
|
var SWITCH_BAR_WIDTH = 25;
|
|
9
9
|
export var makeThemeOverrides = function makeThemeOverrides(theme) {
|
|
10
10
|
var createOverrides = theme.palette.type === 'dark' ? makeInvertedOverrides : makeOverrides;
|
|
11
11
|
return createOverrides(theme);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
var makeAlertColor = function makeAlertColor(theme, color) {
|
|
15
|
+
var themeColorByColor = {
|
|
16
|
+
primary: theme.palette[color].main,
|
|
17
|
+
secondary: theme.palette.text.primary
|
|
18
|
+
}; // same approach as Mui, see https://github.com/mui/material-ui/blob/v4.x/packages/material-ui-lab/src/Alert/Alert.js#L28
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
'&-standard': {
|
|
22
|
+
color: darken(themeColorByColor[color], 0.6),
|
|
23
|
+
backgroundColor: lighten(themeColorByColor[color], 0.9),
|
|
24
|
+
'& $icon': {
|
|
25
|
+
color: themeColorByColor[color]
|
|
26
|
+
},
|
|
27
|
+
'& $action': {
|
|
28
|
+
'& button[title="Close"]': {
|
|
29
|
+
color: theme.palette.text.secondary
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
'&-outlined': {
|
|
34
|
+
color: darken(themeColorByColor[color], 0.6),
|
|
35
|
+
border: "1px solid ".concat(themeColorByColor[color]),
|
|
36
|
+
'& $icon': {
|
|
37
|
+
color: themeColorByColor[color]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
'&-filled': {
|
|
41
|
+
backgroundColor: color === 'secondary' ? theme.palette.grey[600] : themeColorByColor[color]
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
var makeAlertInvertedColor = function makeAlertInvertedColor(theme, color) {
|
|
47
|
+
return {
|
|
48
|
+
'&-standard': {
|
|
49
|
+
color: theme.palette.primary.main,
|
|
50
|
+
backgroundColor: theme.palette.background.default,
|
|
51
|
+
'& $icon': {
|
|
52
|
+
color: theme.palette[color].main
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
'&-outlined': {
|
|
56
|
+
color: theme.palette.primary.main,
|
|
57
|
+
border: "1px solid ".concat(theme.palette.primary.main),
|
|
58
|
+
'& $icon': {
|
|
59
|
+
color: theme.palette[color].main
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
'&-filled': {
|
|
63
|
+
color: theme.palette[color].contrastText,
|
|
64
|
+
backgroundColor: color === 'secondary' ? theme.palette.grey[200] : theme.palette[color].main,
|
|
65
|
+
'& $icon': {
|
|
66
|
+
color: theme.palette[color].contrastText
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
14
72
|
var makeChipStyleByColor = function makeChipStyleByColor(theme, color) {
|
|
15
73
|
return {
|
|
16
74
|
color: theme.palette.text[color] || theme.palette[color].main,
|
|
@@ -755,6 +813,47 @@ var makeOverrides = function makeOverrides(theme) {
|
|
|
755
813
|
'&-info': makeChipStyleByColor(theme, 'info')
|
|
756
814
|
}
|
|
757
815
|
}
|
|
816
|
+
},
|
|
817
|
+
MuiAlert: {
|
|
818
|
+
root: {
|
|
819
|
+
padding: '8px 16px',
|
|
820
|
+
'&.cozyAlert': {
|
|
821
|
+
'&-primary': makeAlertColor(theme, 'primary'),
|
|
822
|
+
'&-secondary': makeAlertColor(theme, 'secondary')
|
|
823
|
+
},
|
|
824
|
+
'& $icon': {
|
|
825
|
+
paddingTop: '9px'
|
|
826
|
+
},
|
|
827
|
+
'&.block': {
|
|
828
|
+
flexWrap: 'wrap',
|
|
829
|
+
'& $action': {
|
|
830
|
+
display: 'block',
|
|
831
|
+
width: '100%',
|
|
832
|
+
paddingLeft: 0,
|
|
833
|
+
textAlign: 'right'
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
message: {
|
|
838
|
+
display: 'flex',
|
|
839
|
+
alignItems: 'center',
|
|
840
|
+
flexWrap: 'wrap'
|
|
841
|
+
},
|
|
842
|
+
action: {
|
|
843
|
+
marginRight: '-6px'
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
MuiAlertTitle: {
|
|
847
|
+
root: {
|
|
848
|
+
width: '100%',
|
|
849
|
+
fontWeight: 'bold'
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
MuiSnackbarContent: {
|
|
853
|
+
root: {
|
|
854
|
+
padding: '4px 12px',
|
|
855
|
+
backgroundColor: theme.palette.grey[600]
|
|
856
|
+
}
|
|
758
857
|
}
|
|
759
858
|
};
|
|
760
859
|
};
|
|
@@ -816,7 +915,24 @@ var makeInvertedOverrides = function makeInvertedOverrides(invertedTheme) {
|
|
|
816
915
|
color: invertedTheme.palette.error.main
|
|
817
916
|
}
|
|
818
917
|
}
|
|
819
|
-
}
|
|
918
|
+
},
|
|
919
|
+
MuiAlert: _objectSpread(_objectSpread({}, makeOverrides(invertedTheme).MuiAlert), {}, {
|
|
920
|
+
root: _objectSpread(_objectSpread({}, makeOverrides(invertedTheme).MuiAlert.root), {}, {
|
|
921
|
+
'&.cozyAlert': {
|
|
922
|
+
'&-primary': makeAlertInvertedColor(invertedTheme, 'primary'),
|
|
923
|
+
'&-secondary': makeAlertInvertedColor(invertedTheme, 'secondary'),
|
|
924
|
+
'&-success': makeAlertInvertedColor(invertedTheme, 'success'),
|
|
925
|
+
'&-error': makeAlertInvertedColor(invertedTheme, 'error'),
|
|
926
|
+
'&-warning': makeAlertInvertedColor(invertedTheme, 'warning'),
|
|
927
|
+
'&-info': makeAlertInvertedColor(invertedTheme, 'info')
|
|
928
|
+
}
|
|
929
|
+
})
|
|
930
|
+
}),
|
|
931
|
+
MuiSnackbarContent: _objectSpread(_objectSpread({}, makeOverrides(invertedTheme).MuiSnackbarContent), {}, {
|
|
932
|
+
root: _objectSpread(_objectSpread({}, makeOverrides(invertedTheme).MuiSnackbarContent.root), {}, {
|
|
933
|
+
backgroundColor: invertedTheme.palette.grey[200]
|
|
934
|
+
})
|
|
935
|
+
})
|
|
820
936
|
});
|
|
821
937
|
|
|
822
938
|
invertedOverrides.MuiSwitch = _objectSpread(_objectSpread({}, invertedOverrides.MuiSwitch), {}, {
|
|
@@ -1,2 +1,21 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children"];
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
1
5
|
import MuiSnackbar from '@material-ui/core/Snackbar';
|
|
2
|
-
|
|
6
|
+
var Snackbar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
7
|
+
var children = _ref.children,
|
|
8
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
+
|
|
10
|
+
return /*#__PURE__*/React.createElement(MuiSnackbar, _extends({
|
|
11
|
+
ref: ref
|
|
12
|
+
}, props), children);
|
|
13
|
+
});
|
|
14
|
+
Snackbar.displayName = 'Snackbar';
|
|
15
|
+
Snackbar.defaultProps = {
|
|
16
|
+
anchorOrigin: {
|
|
17
|
+
vertical: 'top',
|
|
18
|
+
horizontal: 'center'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export default Snackbar;
|
|
@@ -85,4 +85,6 @@ export { default as FilePicker } from './FilePicker';
|
|
|
85
85
|
export { default as Chips } from './Chips';
|
|
86
86
|
export { default as PieChart } from './PieChart';
|
|
87
87
|
export { default as DropdownText } from './DropdownText';
|
|
88
|
-
export { default as CircleButton } from './CircleButton';
|
|
88
|
+
export { default as CircleButton } from './CircleButton';
|
|
89
|
+
export { default as Alert } from './Alert';
|
|
90
|
+
export { default as AlertTitle } from './AlertTitle';
|