@occmundial/occ-atomic 3.0.0-beta.20 → 3.0.0-beta.21
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 +17 -0
- package/build/Tip/Tip.js +1 -0
- package/build/Tip/__snapshots__/Tip.test.js.snap +0 -5
- package/build/Tip/styles.js +5 -10
- package/build/Toaster/Toast/Toast.js +69 -64
- package/build/Toaster/Toast/styles.js +72 -46
- package/build/Toaster/Toaster.js +3 -2
- package/build/Toaster/Toaster.test.js +5 -2
- package/build/Toaster/__snapshots__/Toaster.test.js.snap +1 -1
- package/build/Toaster/styles.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
# [3.0.0-beta.21](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.20...v3.0.0-beta.21) (2024-06-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Add outline border and merge with beta ([a212aa3](https://github.com/occmundial/occ-atomic/commit/a212aa3f87471092a246925e79a9d787535b13ba))
|
|
7
|
+
* Resolve conflicts ([99b08cb](https://github.com/occmundial/occ-atomic/commit/99b08cb290979fa7f1aad3dd2c04f65b1b494559))
|
|
8
|
+
* Resolve conflicts ([81776b7](https://github.com/occmundial/occ-atomic/commit/81776b701b168e66a1f1dfa7b785227b40a76dc9))
|
|
9
|
+
* Set md size for tip close icon ([759e6d1](https://github.com/occmundial/occ-atomic/commit/759e6d10842e2c55cf81d2aff57f60479e3a3395))
|
|
10
|
+
* Set min width for desktop and conditionated on mouse events ([98857fd](https://github.com/occmundial/occ-atomic/commit/98857fd313d247e618c64dbbaacea93c6ab084ae))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* Add close icon prop and conditionated onclose func ([e456d38](https://github.com/occmundial/occ-atomic/commit/e456d384a82d4b6105e27bb36d693b43d5608c1c))
|
|
16
|
+
* Update toaster with new design tokens ([88edaa8](https://github.com/occmundial/occ-atomic/commit/88edaa8fe5c3c04bc9f634f6a287c1614c893d15))
|
|
17
|
+
|
|
1
18
|
# [3.0.0-beta.20](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.19...v3.0.0-beta.20) (2024-06-25)
|
|
2
19
|
|
|
3
20
|
|
package/build/Tip/Tip.js
CHANGED
|
@@ -87,6 +87,7 @@ var Tip = function Tip(_ref) {
|
|
|
87
87
|
'data-testid': "".concat(testId, "__link")
|
|
88
88
|
}), cta.text))), onClose && /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
|
|
89
89
|
onClick: onClose,
|
|
90
|
+
size: "md",
|
|
90
91
|
className: size === 'small' ? classes.closeIconSmallMargin : classes.closeIconMargin,
|
|
91
92
|
icon: "x",
|
|
92
93
|
theme: theme === PROMOTE ? 'ghostWhite' : 'ghostGrey'
|
|
@@ -96,23 +96,18 @@ Object {
|
|
|
96
96
|
},
|
|
97
97
|
"textError": Object {
|
|
98
98
|
"color": "#8b1313",
|
|
99
|
-
"textDecorationColor": "#8b1313",
|
|
100
99
|
},
|
|
101
100
|
"textInfo": Object {
|
|
102
101
|
"color": "#083CAE",
|
|
103
|
-
"textDecorationColor": "#083CAE",
|
|
104
102
|
},
|
|
105
103
|
"textPromote": Object {
|
|
106
104
|
"color": "#fff",
|
|
107
|
-
"textDecorationColor": "#fff",
|
|
108
105
|
},
|
|
109
106
|
"textSuccess": Object {
|
|
110
107
|
"color": "#16542e",
|
|
111
|
-
"textDecorationColor": "#16542e",
|
|
112
108
|
},
|
|
113
109
|
"textWarning": Object {
|
|
114
110
|
"color": "#664a0e",
|
|
115
|
-
"textDecorationColor": "#664a0e",
|
|
116
111
|
},
|
|
117
112
|
"warning": Object {
|
|
118
113
|
"backgroundColor": "#fff8e9",
|
package/build/Tip/styles.js
CHANGED
|
@@ -55,24 +55,19 @@ var _default = {
|
|
|
55
55
|
outline: "1px solid ".concat(_colors["default"].alert.neutral.border)
|
|
56
56
|
},
|
|
57
57
|
textInfo: {
|
|
58
|
-
color: _colors["default"].text.indigo.primary
|
|
59
|
-
textDecorationColor: _colors["default"].text.indigo.primary
|
|
58
|
+
color: _colors["default"].text.indigo.primary
|
|
60
59
|
},
|
|
61
60
|
textWarning: {
|
|
62
|
-
color: _colors["default"].text.warning
|
|
63
|
-
textDecorationColor: _colors["default"].text.warning
|
|
61
|
+
color: _colors["default"].text.warning
|
|
64
62
|
},
|
|
65
63
|
textSuccess: {
|
|
66
|
-
color: _colors["default"].text.success
|
|
67
|
-
textDecorationColor: _colors["default"].text.success
|
|
64
|
+
color: _colors["default"].text.success
|
|
68
65
|
},
|
|
69
66
|
textError: {
|
|
70
|
-
color: _colors["default"].text.error
|
|
71
|
-
textDecorationColor: _colors["default"].text.error
|
|
67
|
+
color: _colors["default"].text.error
|
|
72
68
|
},
|
|
73
69
|
textPromote: {
|
|
74
|
-
color: _colors["default"].text.white.primary
|
|
75
|
-
textDecorationColor: _colors["default"].text.white.primary
|
|
70
|
+
color: _colors["default"].text.white.primary
|
|
76
71
|
},
|
|
77
72
|
icon: {
|
|
78
73
|
marginRight: _spacing["default"]['size-2'],
|
|
@@ -9,109 +9,114 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _Text = _interopRequireDefault(require("../../Text"));
|
|
13
|
-
|
|
14
12
|
var _Icon = _interopRequireDefault(require("../../Icon"));
|
|
15
13
|
|
|
16
14
|
var _Flexbox = _interopRequireDefault(require("../../Flexbox"));
|
|
17
15
|
|
|
18
|
-
var _colors = _interopRequireDefault(require("../../
|
|
16
|
+
var _colors = _interopRequireDefault(require("../../tokens/colors.json"));
|
|
17
|
+
|
|
18
|
+
var _Button = _interopRequireDefault(require("../../Button"));
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
21
|
|
|
22
22
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
23
|
|
|
24
|
+
var icons = {
|
|
25
|
+
info: 'info-circle',
|
|
26
|
+
warning: 'alert',
|
|
27
|
+
success: 'check-circle',
|
|
28
|
+
error: 'x-circle',
|
|
29
|
+
promote: null
|
|
30
|
+
};
|
|
31
|
+
var colorTextClasses = {
|
|
32
|
+
info: 'textInfo',
|
|
33
|
+
promote: 'textPromote',
|
|
34
|
+
warning: 'textWarning',
|
|
35
|
+
success: 'textSuccess',
|
|
36
|
+
error: 'textError'
|
|
37
|
+
};
|
|
38
|
+
|
|
24
39
|
var Toast = function Toast(_ref) {
|
|
25
40
|
var classes = _ref.classes,
|
|
26
41
|
theme = _ref.theme,
|
|
27
42
|
title = _ref.title,
|
|
28
43
|
description = _ref.description,
|
|
29
44
|
action = _ref.action,
|
|
30
|
-
hasIcon = _ref.hasIcon,
|
|
31
45
|
closing = _ref.closing,
|
|
32
46
|
onClose = _ref.onClose,
|
|
33
47
|
pauseTimer = _ref.pauseTimer,
|
|
34
|
-
resumeTimer = _ref.resumeTimer
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
switch (theme) {
|
|
38
|
-
case 'success':
|
|
39
|
-
return {
|
|
40
|
-
icon: 'check-circle',
|
|
41
|
-
color: _colors["default"].bgWhite
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
case 'error':
|
|
45
|
-
return {
|
|
46
|
-
icon: 'x-circle',
|
|
47
|
-
color: _colors["default"].bgWhite
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
case 'info':
|
|
51
|
-
return {
|
|
52
|
-
icon: 'info-circle',
|
|
53
|
-
color: _colors["default"].bgWhite
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
case 'warning':
|
|
57
|
-
return {
|
|
58
|
-
icon: 'alert',
|
|
59
|
-
color: _colors["default"].grey900
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var textColor = theme === 'warning' ? {} : {
|
|
65
|
-
white: true
|
|
66
|
-
};
|
|
67
|
-
var iconData = hasIcon ? getIconData() : null;
|
|
48
|
+
resumeTimer = _ref.resumeTimer,
|
|
49
|
+
closeIcon = _ref.closeIcon,
|
|
50
|
+
testId = _ref.testId;
|
|
68
51
|
|
|
69
52
|
var onActionClick = function onActionClick(action) {
|
|
70
53
|
action.onClick();
|
|
71
54
|
onClose();
|
|
72
55
|
};
|
|
73
56
|
|
|
74
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
75
|
-
className: "".concat(classes.toast, " ").concat(classes[theme]).concat(closing ? " ".concat(classes.closing) : '')
|
|
76
|
-
|
|
57
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
58
|
+
className: "".concat(classes.toast, " ").concat(classes[theme]).concat(closing ? " ".concat(classes.closing) : '')
|
|
59
|
+
}, !closeIcon && {
|
|
60
|
+
onMouseEnter: pauseTimer
|
|
61
|
+
}, !closeIcon && {
|
|
77
62
|
onMouseLeave: resumeTimer
|
|
78
|
-
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
|
63
|
+
}), /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
|
79
64
|
display: "flex",
|
|
80
|
-
|
|
65
|
+
justifyContent: "between"
|
|
81
66
|
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
|
82
67
|
display: "flex",
|
|
83
|
-
alignItems: "center"
|
|
84
|
-
|
|
85
|
-
iconName: iconData.icon,
|
|
86
|
-
colors: [iconData.color],
|
|
87
|
-
className: classes.icon
|
|
88
|
-
}), /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
alignSelf: "center",
|
|
89
70
|
flex: "1"
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
71
|
+
}, theme !== 'promote' && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
72
|
+
iconName: icons[theme],
|
|
73
|
+
className: classes.icon,
|
|
74
|
+
colors: [theme === 'info' ? _colors["default"].icon.brand["default"] : _colors["default"].icon[theme]]
|
|
75
|
+
}), /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
|
76
|
+
display: "flex",
|
|
77
|
+
flex: "1",
|
|
78
|
+
className: classes.content,
|
|
79
|
+
alignSelf: "start",
|
|
80
|
+
justifyContent: "between"
|
|
81
|
+
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
|
82
|
+
display: "flex",
|
|
83
|
+
direction: "col"
|
|
84
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
85
|
+
className: "".concat(classes.title, " ").concat(classes[colorTextClasses[theme]])
|
|
86
|
+
}, title), description && /*#__PURE__*/_react["default"].createElement("p", {
|
|
87
|
+
className: "".concat(classes.description, " ").concat(classes[colorTextClasses[theme]])
|
|
88
|
+
}, description)), action ? /*#__PURE__*/_react["default"].createElement("a", _extends({
|
|
89
|
+
className: "".concat(classes.actionText, " ").concat(classes[colorTextClasses[theme]]),
|
|
94
90
|
onClick: function onClick() {
|
|
95
91
|
return onActionClick(action);
|
|
96
92
|
}
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
93
|
+
}, testId && {
|
|
94
|
+
'data-testid': "".concat(testId, "__link")
|
|
95
|
+
}), action.label) : null)), !action && closeIcon ? /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
|
|
96
|
+
onClick: onClose,
|
|
97
|
+
className: classes.closeIcon,
|
|
98
|
+
icon: "x",
|
|
99
|
+
size: "md",
|
|
100
|
+
theme: theme === 'promote' ? 'ghostWhite' : 'ghostGrey'
|
|
101
|
+
}, testId && {
|
|
102
|
+
testId: "".concat(testId, "__close-icon")
|
|
103
|
+
})) : null));
|
|
105
104
|
};
|
|
106
105
|
|
|
107
106
|
Toast.propTypes = {
|
|
108
107
|
classes: _propTypes["default"].object.isRequired,
|
|
109
108
|
theme: _propTypes["default"].oneOf(['success', 'error', 'info', 'warning']),
|
|
110
|
-
title: _propTypes["default"].string,
|
|
109
|
+
title: _propTypes["default"].string.isRequired,
|
|
111
110
|
description: _propTypes["default"].string,
|
|
112
111
|
action: _propTypes["default"].object,
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
closing: _propTypes["default"].bool,
|
|
113
|
+
pauseTimer: _propTypes["default"].func,
|
|
114
|
+
resumeTimer: _propTypes["default"].func,
|
|
115
|
+
onClose: _propTypes["default"].func.isRequired,
|
|
116
|
+
closeIcon: _propTypes["default"].bool,
|
|
117
|
+
|
|
118
|
+
/** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
|
|
119
|
+
testId: _propTypes["default"].string
|
|
115
120
|
};
|
|
116
121
|
var _default = Toast;
|
|
117
122
|
exports["default"] = _default;
|
|
@@ -5,17 +5,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
|
|
8
|
-
var _colors = _interopRequireDefault(require("../../
|
|
8
|
+
var _colors = _interopRequireDefault(require("../../tokens/colors.json"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _fonts = _interopRequireDefault(require("../../tokens/fonts.json"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _spacing = _interopRequireDefault(require("../../tokens/spacing.json"));
|
|
13
|
+
|
|
14
|
+
var _borderRadius = _interopRequireDefault(require("../../tokens/borderRadius.json"));
|
|
15
|
+
|
|
16
|
+
var _shadows = _interopRequireDefault(require("../../tokens/shadows.json"));
|
|
13
17
|
|
|
14
18
|
var _grid = _interopRequireDefault(require("../../subatomic/grid"));
|
|
15
19
|
|
|
16
|
-
var
|
|
20
|
+
var _styles = require("../../Text/styles");
|
|
17
21
|
|
|
18
|
-
var _toast
|
|
22
|
+
var _toast;
|
|
19
23
|
|
|
20
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
25
|
|
|
@@ -33,16 +37,18 @@ var _default = {
|
|
|
33
37
|
}
|
|
34
38
|
},
|
|
35
39
|
toast: (_toast = {
|
|
36
|
-
borderRadius:
|
|
37
|
-
boxShadow: _shadows["default"]
|
|
38
|
-
padding:
|
|
40
|
+
borderRadius: _borderRadius["default"]['br-xs'],
|
|
41
|
+
boxShadow: _shadows["default"]['elevation-elevation-5'],
|
|
42
|
+
padding: _spacing["default"]['size-3'],
|
|
39
43
|
pointerEvents: 'auto',
|
|
40
44
|
zIndex: 1001,
|
|
41
45
|
animation: 'slideToasterIn 0.3s ease-out',
|
|
42
|
-
transition: '0.3s all ease-out'
|
|
46
|
+
transition: '0.3s all ease-out',
|
|
47
|
+
outlineOffset: '-1px'
|
|
43
48
|
}, _defineProperty(_toast, "@media screen and (min-width:".concat(_grid["default"].xs, "px)"), {
|
|
44
49
|
maxWidth: 480,
|
|
45
|
-
|
|
50
|
+
minWidth: 400,
|
|
51
|
+
padding: _spacing["default"]['size-4']
|
|
46
52
|
}), _defineProperty(_toast, "@media screen and (max-width:".concat(_grid["default"].xs - 1, "px)"), {
|
|
47
53
|
width: '100%'
|
|
48
54
|
}), _toast),
|
|
@@ -51,54 +57,74 @@ var _default = {
|
|
|
51
57
|
opacity: 0
|
|
52
58
|
},
|
|
53
59
|
success: {
|
|
54
|
-
|
|
60
|
+
backgroundColor: _colors["default"].alert.success.bg,
|
|
61
|
+
outline: "1px solid ".concat(_colors["default"].alert.success.border)
|
|
55
62
|
},
|
|
56
63
|
error: {
|
|
57
|
-
|
|
64
|
+
backgroundColor: _colors["default"].alert.error.bg,
|
|
65
|
+
outline: "1px solid ".concat(_colors["default"].alert.error.border)
|
|
58
66
|
},
|
|
59
67
|
warning: {
|
|
60
|
-
|
|
68
|
+
backgroundColor: _colors["default"].alert.warning.bg,
|
|
69
|
+
outline: "1px solid ".concat(_colors["default"].alert.warning.border)
|
|
61
70
|
},
|
|
62
71
|
info: {
|
|
63
|
-
|
|
72
|
+
backgroundColor: _colors["default"].alert.info.bg,
|
|
73
|
+
outline: "1px solid ".concat(_colors["default"].alert.info.border)
|
|
74
|
+
},
|
|
75
|
+
promote: {
|
|
76
|
+
backgroundColor: _colors["default"].alert.neutral.bg,
|
|
77
|
+
outline: "1px solid ".concat(_colors["default"].alert.neutral.border)
|
|
78
|
+
},
|
|
79
|
+
textInfo: {
|
|
80
|
+
color: _colors["default"].text.indigo.primary
|
|
81
|
+
},
|
|
82
|
+
textWarning: {
|
|
83
|
+
color: _colors["default"].text.warning
|
|
84
|
+
},
|
|
85
|
+
textSuccess: {
|
|
86
|
+
color: _colors["default"].text.success
|
|
87
|
+
},
|
|
88
|
+
textError: {
|
|
89
|
+
color: _colors["default"].text.error
|
|
90
|
+
},
|
|
91
|
+
textPromote: {
|
|
92
|
+
color: _colors["default"].text.white.primary
|
|
64
93
|
},
|
|
65
|
-
|
|
94
|
+
title: {
|
|
95
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['alert-default']),
|
|
96
|
+
margin: 0
|
|
97
|
+
},
|
|
98
|
+
description: {
|
|
99
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['alert-description']),
|
|
100
|
+
margin: [_spacing["default"]['size-1'], 0, 0]
|
|
101
|
+
},
|
|
102
|
+
content: _defineProperty({
|
|
66
103
|
flexDirection: 'column'
|
|
104
|
+
}, "@media screen and (min-width:".concat(_grid["default"].xs, "px)"), {
|
|
105
|
+
flexDirection: 'row'
|
|
67
106
|
}),
|
|
68
|
-
icon:
|
|
69
|
-
marginRight: _spacing["default"]
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, _defineProperty(_icon, "@media screen and (min-width:".concat(_grid["default"].xs, "px)"), {
|
|
73
|
-
width: _iconSizes["default"].base,
|
|
74
|
-
height: _iconSizes["default"].base
|
|
75
|
-
}), _defineProperty(_icon, "@media screen and (max-width:".concat(_grid["default"].xs - 1, "px)"), {
|
|
76
|
-
display: 'none'
|
|
77
|
-
}), _icon),
|
|
78
|
-
action: (_action = {
|
|
79
|
-
marginTop: _spacing["default"].xTiny,
|
|
80
|
-
cursor: 'pointer',
|
|
81
|
-
background: 'none',
|
|
82
|
-
border: 'none'
|
|
83
|
-
}, _defineProperty(_action, "@media screen and (min-width:".concat(_grid["default"].xs, "px)"), {
|
|
84
|
-
margin: -_spacing["default"].small,
|
|
85
|
-
marginLeft: _spacing["default"].small,
|
|
86
|
-
padding: [0, _spacing["default"].small],
|
|
87
|
-
borderRadius: [0, _spacing["default"].radius, _spacing["default"].radius, 0],
|
|
88
|
-
borderLeft: '1px solid rgba(255, 255, 255, 0.1)',
|
|
89
|
-
transition: '0.3s all',
|
|
90
|
-
'&:hover': {
|
|
91
|
-
background: 'rgba(255, 255, 255, 0.15)'
|
|
92
|
-
}
|
|
93
|
-
}), _defineProperty(_action, "@media screen and (max-width:".concat(_grid["default"].xs - 1, "px)"), {
|
|
94
|
-
alignSelf: 'flex-end'
|
|
95
|
-
}), _action),
|
|
107
|
+
icon: {
|
|
108
|
+
marginRight: _spacing["default"]['size-2'],
|
|
109
|
+
alignSelf: 'start'
|
|
110
|
+
},
|
|
96
111
|
actionWrap: {
|
|
97
112
|
height: '100%'
|
|
98
113
|
},
|
|
99
|
-
actionText: {
|
|
100
|
-
|
|
101
|
-
whiteSpace: 'nowrap'
|
|
114
|
+
actionText: _defineProperty({
|
|
115
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['link-small-strong']),
|
|
116
|
+
whiteSpace: 'nowrap',
|
|
117
|
+
textDecoration: 'underline',
|
|
118
|
+
cursor: 'pointer',
|
|
119
|
+
alignSelf: 'start',
|
|
120
|
+
margin: [_spacing["default"]['size-2'], 0, 0]
|
|
121
|
+
}, "@media screen and (min-width:".concat(_grid["default"].xs, "px)"), {
|
|
122
|
+
margin: [0, 0, 0, _spacing["default"]['size-4']],
|
|
123
|
+
alignSelf: 'center'
|
|
124
|
+
}),
|
|
125
|
+
closeIcon: {
|
|
126
|
+
marginLeft: _spacing["default"]['size-4'],
|
|
127
|
+
alignSelf: 'center'
|
|
102
128
|
}
|
|
103
129
|
};
|
|
104
130
|
exports["default"] = _default;
|
package/build/Toaster/Toaster.js
CHANGED
|
@@ -78,7 +78,7 @@ var Toaster = /*#__PURE__*/function (_React$Component) {
|
|
|
78
78
|
toast: toast,
|
|
79
79
|
toastId: toastId
|
|
80
80
|
}, function () {
|
|
81
|
-
_this.addTimer();
|
|
81
|
+
if (!toast.closeIcon) _this.addTimer();
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
84
|
|
|
@@ -164,8 +164,9 @@ var Toaster = /*#__PURE__*/function (_React$Component) {
|
|
|
164
164
|
title: toast.title,
|
|
165
165
|
theme: toast.type,
|
|
166
166
|
action: toast.action,
|
|
167
|
-
|
|
167
|
+
closeIcon: toast.closeIcon,
|
|
168
168
|
closing: toast.closing,
|
|
169
|
+
testId: toast.testId,
|
|
169
170
|
onClose: function onClose() {
|
|
170
171
|
return _this2.onClose(toast);
|
|
171
172
|
},
|
|
@@ -104,11 +104,14 @@ describe("Toaster", function () {
|
|
|
104
104
|
|
|
105
105
|
_functions.toaster.success({
|
|
106
106
|
title: 'Title',
|
|
107
|
-
action: action
|
|
107
|
+
action: action,
|
|
108
|
+
testId: "toaster-test"
|
|
108
109
|
});
|
|
109
110
|
|
|
110
111
|
wrapper.update();
|
|
111
|
-
wrapper.find(
|
|
112
|
+
wrapper.find({
|
|
113
|
+
"data-testid": 'toaster-test__link'
|
|
114
|
+
}).simulate('click');
|
|
112
115
|
expect(action.onClick).toHaveBeenCalled();
|
|
113
116
|
setTimeout(function () {
|
|
114
117
|
wrapper.update();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Toaster launches a toast 1`] = `"<div class=\\"container\\"><div class=\\"Toast-toast-0-1-1 Toast-success-0-1-3\\"><div class=\\"Flexbox-flex-0-1-
|
|
3
|
+
exports[`Toaster launches a toast 1`] = `"<div class=\\"container\\"><div class=\\"Toast-toast-0-1-1 Toast-success-0-1-3\\"><div class=\\"Flexbox-flex-0-1-20 Flexbox-jbetween-0-1-32\\"><div class=\\"Flexbox-flex-0-1-20 Flexbox-acenter-0-1-37 Flexbox-scenter-0-1-49\\" style=\\"flex: 1;\\"><svg class=\\"Icon-icon-0-1-55 Icon-icon-0-1-52 undefined__check-circle Toast-icon-0-1-16\\" width=\\"24\\" height=\\"24\\" fill=\\"#38d373\\" style=\\"transition: 0.3s all;\\"><use xlink:href=\\"undefined#undefined__check-circle\\"></use></svg><div class=\\"Flexbox-flex-0-1-20 Flexbox-jbetween-0-1-32 Flexbox-sstart-0-1-47 Toast-content-0-1-15\\" style=\\"flex: 1;\\"><div class=\\"Flexbox-flex-0-1-20 Flexbox-col-0-1-24\\"><p class=\\"Toast-title-0-1-13 Toast-textSuccess-0-1-10\\">Title</p></div></div></div></div></div></div>"`;
|
|
4
4
|
|
|
5
5
|
exports[`Toaster matches the snapshot 1`] = `"<div class=\\"container\\"></div>"`;
|
package/build/Toaster/styles.js
CHANGED
|
@@ -7,7 +7,7 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _grid = _interopRequireDefault(require("../subatomic/grid"));
|
|
9
9
|
|
|
10
|
-
var _spacing = _interopRequireDefault(require("../
|
|
10
|
+
var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
|
|
11
11
|
|
|
12
12
|
var _container;
|
|
13
13
|
|
|
@@ -21,9 +21,9 @@ var _default = {
|
|
|
21
21
|
zIndex: 1001,
|
|
22
22
|
bottom: 0,
|
|
23
23
|
left: 0,
|
|
24
|
-
padding: _spacing["default"]
|
|
24
|
+
padding: _spacing["default"]['size-4']
|
|
25
25
|
}, _defineProperty(_container, "@media screen and (min-width:".concat(_grid["default"].xs, "px)"), {
|
|
26
|
-
padding: _spacing["default"]
|
|
26
|
+
padding: _spacing["default"]['size-6']
|
|
27
27
|
}), _defineProperty(_container, "@media screen and (max-width:".concat(_grid["default"].xs - 1, "px)"), {
|
|
28
28
|
width: '100vw'
|
|
29
29
|
}), _defineProperty(_container, "pointerEvents", 'none'), _container)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@occmundial/occ-atomic",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.21",
|
|
4
4
|
"description": "Collection of shareable styled React components for OCC applications.",
|
|
5
5
|
"homepage": "http://occmundial.github.io/occ-atomic",
|
|
6
6
|
"main": "build/index.js",
|