@occmundial/occ-atomic 3.0.0-beta.2 → 3.0.0-beta.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/CHANGELOG.md +185 -0
  2. package/build/Banner/Banner.js +30 -40
  3. package/build/Banner/Banner.test.js +64 -17
  4. package/build/Banner/__snapshots__/Banner.test.js.snap +0 -28
  5. package/build/Banner/index.js +1 -6
  6. package/build/Button/__snapshots__/Button.test.js.snap +18 -20
  7. package/build/Button/styles.js +6 -8
  8. package/build/Checkbox/Checkbox.js +48 -3
  9. package/build/Checkbox/__snapshots__/Checkbox.test.js.snap +81 -49
  10. package/build/Checkbox/styles.js +91 -48
  11. package/build/Pill/Choice/Choice.js +73 -81
  12. package/build/Pill/Choice/styles.js +64 -20
  13. package/build/Pill/Group/Group.js +5 -2
  14. package/build/Pill/Group/styles.js +31 -31
  15. package/build/Pill/Pill.js +4 -3
  16. package/build/Pill/Stack/Stack.js +7 -12
  17. package/build/Pill/Stack/styles.js +43 -33
  18. package/build/Pill/__snapshots__/Pill.test.js.snap +14 -24
  19. package/build/Pill/styles.js +22 -27
  20. package/build/Radio/Radio.js +42 -6
  21. package/build/Radio/__snapshots__/Radio.test.js.snap +81 -80
  22. package/build/Radio/styles.js +93 -85
  23. package/build/SlideToggle/SlideToggle.js +38 -6
  24. package/build/SlideToggle/SlideToggle.test.js +2 -2
  25. package/build/SlideToggle/__snapshots__/SlideToggle.test.js.snap +53 -37
  26. package/build/SlideToggle/styles.js +65 -45
  27. package/build/Text/Text.js +4 -2
  28. package/build/TextField/TextField.js +7 -6
  29. package/build/TextField/__snapshots__/TextField.test.js.snap +3 -0
  30. package/build/TextField/styles.js +3 -0
  31. package/build/Tip/Tip.js +52 -95
  32. package/build/Tip/Tip.test.js +29 -6
  33. package/build/Tip/TipText/index.js +32 -0
  34. package/build/Tip/__snapshots__/Tip.test.js.snap +85 -15
  35. package/build/Tip/styles.js +80 -31
  36. package/build/Toaster/Toast/Toast.js +69 -64
  37. package/build/Toaster/Toast/styles.js +72 -46
  38. package/build/Toaster/Toaster.js +3 -2
  39. package/build/Toaster/Toaster.test.js +5 -2
  40. package/build/Toaster/__snapshots__/Toaster.test.js.snap +1 -1
  41. package/build/Toaster/styles.js +3 -3
  42. package/build/tokens/colors.json +3 -3
  43. package/package.json +4 -1
  44. package/build/Banner/styles.js +0 -41
@@ -4,44 +4,114 @@ exports[`Tip matches the snapshot 1`] = `ShallowWrapper {}`;
4
4
 
5
5
  exports[`Tip styles matches the snapshot 1`] = `
6
6
  Object {
7
+ "closeIconMargin": Object {
8
+ "marginLeft": "16px",
9
+ },
10
+ "closeIconSmallMargin": Object {
11
+ "marginLeft": "12px",
12
+ },
7
13
  "container": Object {
14
+ "@media screen and (min-width:576px)": Object {
15
+ "padding": Array [
16
+ "8px",
17
+ "16px",
18
+ ],
19
+ },
8
20
  "alignItems": "center",
9
- "borderRadius": 6,
10
- "padding": 16,
21
+ "borderRadius": "4px",
22
+ "minHeight": "56px",
23
+ "outlineOffset": "-1px",
24
+ "padding": "12px",
11
25
  },
12
26
  "cta": Object {
27
+ "alignSelf": "start",
13
28
  "cursor": "pointer",
29
+ "font": "400 14px/1.5 'OccText', sans-serif",
30
+ "margin": Array [
31
+ "8px",
32
+ 0,
33
+ 0,
34
+ ],
14
35
  "textDecoration": "underline",
36
+ "textWrap": "nowrap",
37
+ },
38
+ "ctaAlert": Object {
39
+ "alignSelf": "center",
40
+ "margin": Array [
41
+ 0,
42
+ 0,
43
+ 0,
44
+ "16px",
45
+ ],
46
+ },
47
+ "ctaBanner": Object {
48
+ "alignSelf": "center",
49
+ "margin": Array [
50
+ 0,
51
+ 0,
52
+ 0,
53
+ "8px",
54
+ ],
15
55
  },
16
56
  "error": Object {
17
- "backgroundColor": "#fcebeb",
57
+ "backgroundColor": "#fce8e8",
58
+ "outline": "1px solid #FBDFDF",
59
+ },
60
+ "growText": Object {
61
+ "flexGrow": 1,
18
62
  },
19
63
  "icon": Object {
20
- "marginRight": 8,
64
+ "flexShrink": 0,
65
+ "marginRight": "8px",
21
66
  },
22
67
  "info": Object {
23
- "backgroundColor": "#efebf7",
68
+ "backgroundColor": "#e3efff",
69
+ "outline": "1px solid #b9d7ff",
70
+ },
71
+ "maxWidth": Object {
72
+ "margin": Array [
73
+ 0,
74
+ "auto",
75
+ ],
76
+ "maxWidth": "1200px",
24
77
  },
25
78
  "noBorderRadius": Object {
26
79
  "borderRadius": 0,
27
80
  },
28
- "promote": Object {
29
- "backgroundColor": "#222222",
81
+ "normalText": Object {
82
+ "display": "inline-block",
83
+ "font": "400 14px/1.5 'OccText', sans-serif",
84
+ "margin": 0,
30
85
  },
31
- "spacedClose": Object {
32
- "marginRight": 48,
86
+ "promote": Object {
87
+ "backgroundColor": "#000",
88
+ "outline": "1px solid rgba(255,255,255,0.2)",
33
89
  },
34
90
  "success": Object {
35
- "backgroundColor": "#e6f5eb",
91
+ "backgroundColor": "#ebfbf1",
92
+ "outline": "1px solid #d7f6e3",
93
+ },
94
+ "textContainer": Object {
95
+ "flex": 1,
96
+ },
97
+ "textError": Object {
98
+ "color": "#8b1313",
99
+ },
100
+ "textInfo": Object {
101
+ "color": "#083CAE",
102
+ },
103
+ "textPromote": Object {
104
+ "color": "#fff",
36
105
  },
37
- "text": Object {
38
- "maxWidth": "100%",
106
+ "textSuccess": Object {
107
+ "color": "#16542e",
39
108
  },
40
- "textWithIcon": Object {
41
- "maxWidth": "calc(100% - 32px)",
109
+ "textWarning": Object {
110
+ "color": "#664a0e",
42
111
  },
43
112
  "warning": Object {
44
- "backgroundColor": "#fffaed",
113
+ "backgroundColor": "#fff8e9",
114
+ "outline": "1px solid #fff1d3",
45
115
  },
46
116
  }
47
117
  `;
@@ -5,61 +5,110 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
 
8
- var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
8
+ var _grid = _interopRequireDefault(require("../subatomic/grid"));
9
9
 
10
- var _colors = _interopRequireDefault(require("../subatomic/colors"));
10
+ var _colors = _interopRequireDefault(require("../tokens/colors.json"));
11
+
12
+ var _fonts = _interopRequireDefault(require("../tokens/fonts.json"));
13
+
14
+ var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
15
+
16
+ var _borderRadius = _interopRequireDefault(require("../tokens/borderRadius.json"));
17
+
18
+ var _styles = require("../Text/styles");
11
19
 
12
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
21
 
14
- var infoLight = _colors["default"].infoLight,
15
- warningLight = _colors["default"].warningLight,
16
- successLight = _colors["default"].successLight,
17
- errorLight = _colors["default"].errorLight,
18
- grey900 = _colors["default"].grey900;
19
- var radius = _spacing["default"].radius,
20
- large = _spacing["default"].large,
21
- medium = _spacing["default"].medium,
22
- small = _spacing["default"].small,
23
- tiny = _spacing["default"].tiny;
22
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+
24
24
  var _default = {
25
- container: {
26
- padding: small,
27
- borderRadius: radius,
28
- alignItems: 'center'
29
- },
25
+ container: _defineProperty({
26
+ padding: _spacing["default"]['size-3'],
27
+ borderRadius: _borderRadius["default"]['br-xs'],
28
+ minHeight: '56px',
29
+ alignItems: 'center',
30
+ outlineOffset: '-1px'
31
+ }, "@media screen and (min-width:".concat(_grid["default"].xs, "px)"), {
32
+ padding: [_spacing["default"]['size-2'], _spacing["default"]['size-4']]
33
+ }),
30
34
  noBorderRadius: {
31
35
  borderRadius: 0
32
36
  },
33
37
  info: {
34
- backgroundColor: infoLight
38
+ backgroundColor: _colors["default"].alert.info.bg,
39
+ outline: "1px solid ".concat(_colors["default"].alert.info.border)
35
40
  },
36
41
  warning: {
37
- backgroundColor: warningLight
42
+ backgroundColor: _colors["default"].alert.warning.bg,
43
+ outline: "1px solid ".concat(_colors["default"].alert.warning.border)
38
44
  },
39
45
  success: {
40
- backgroundColor: successLight
46
+ backgroundColor: _colors["default"].alert.success.bg,
47
+ outline: "1px solid ".concat(_colors["default"].alert.success.border)
41
48
  },
42
49
  error: {
43
- backgroundColor: errorLight
50
+ backgroundColor: _colors["default"].alert.error.bg,
51
+ outline: "1px solid ".concat(_colors["default"].alert.error.border)
44
52
  },
45
53
  promote: {
46
- backgroundColor: grey900
54
+ backgroundColor: _colors["default"].alert.neutral.bg,
55
+ outline: "1px solid ".concat(_colors["default"].alert.neutral.border)
47
56
  },
48
- icon: {
49
- marginRight: tiny
57
+ textInfo: {
58
+ color: _colors["default"].text.indigo.primary
59
+ },
60
+ textWarning: {
61
+ color: _colors["default"].text.warning
62
+ },
63
+ textSuccess: {
64
+ color: _colors["default"].text.success
50
65
  },
51
- text: {
52
- maxWidth: '100%'
66
+ textError: {
67
+ color: _colors["default"].text.error
53
68
  },
54
- textWithIcon: {
55
- maxWidth: "calc(100% - ".concat(medium, "px)")
69
+ textPromote: {
70
+ color: _colors["default"].text.white.primary
56
71
  },
57
- spacedClose: {
58
- marginRight: large
72
+ icon: {
73
+ marginRight: _spacing["default"]['size-2'],
74
+ flexShrink: 0
75
+ },
76
+ closeIconMargin: {
77
+ marginLeft: _spacing["default"]['size-4']
78
+ },
79
+ closeIconSmallMargin: {
80
+ marginLeft: _spacing["default"]['size-3']
59
81
  },
60
82
  cta: {
61
83
  textDecoration: 'underline',
62
- cursor: 'pointer'
84
+ font: (0, _styles.parseFontValue)(_fonts["default"]['alert-default']),
85
+ cursor: 'pointer',
86
+ textWrap: 'nowrap',
87
+ margin: [_spacing["default"]['size-2'], 0, 0],
88
+ alignSelf: 'start'
89
+ },
90
+ ctaAlert: {
91
+ margin: [0, 0, 0, _spacing["default"]['size-4']],
92
+ alignSelf: 'center'
93
+ },
94
+ ctaBanner: {
95
+ margin: [0, 0, 0, _spacing["default"]['size-2']],
96
+ alignSelf: 'center'
97
+ },
98
+ normalText: {
99
+ font: (0, _styles.parseFontValue)(_fonts["default"]['alert-default']),
100
+ display: 'inline-block',
101
+ margin: 0
102
+ },
103
+ textContainer: {
104
+ flex: 1
105
+ },
106
+ growText: {
107
+ flexGrow: 1
108
+ },
109
+ maxWidth: {
110
+ maxWidth: '1200px',
111
+ margin: [0, 'auto']
63
112
  }
64
113
  };
65
114
  exports["default"] = _default;
@@ -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("../../subatomic/colors"));
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
- var getIconData = function getIconData() {
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
- onMouseEnter: pauseTimer,
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
- className: classes.content
65
+ justifyContent: "between"
81
66
  }, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
82
67
  display: "flex",
83
- alignItems: "center"
84
- }, hasIcon && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
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
- }, title && /*#__PURE__*/_react["default"].createElement(_Text["default"], _extends({
91
- subheading: true
92
- }, textColor), title), description && /*#__PURE__*/_react["default"].createElement(_Text["default"], textColor, description))), action && /*#__PURE__*/_react["default"].createElement("button", {
93
- className: classes.action,
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
- }, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
98
- display: "flex",
99
- alignItems: "center",
100
- className: classes.actionWrap
101
- }, /*#__PURE__*/_react["default"].createElement(_Text["default"], _extends({}, textColor, {
102
- strong: true,
103
- className: classes.actionText
104
- }), action.label)))));
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
- hasIcon: _propTypes["default"].bool,
114
- onClose: _propTypes["default"].func.isRequired
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("../../subatomic/colors"));
8
+ var _colors = _interopRequireDefault(require("../../tokens/colors.json"));
9
9
 
10
- var _spacing = _interopRequireDefault(require("../../subatomic/spacing"));
10
+ var _fonts = _interopRequireDefault(require("../../tokens/fonts.json"));
11
11
 
12
- var _shadows = _interopRequireDefault(require("../../subatomic/shadows"));
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 _iconSizes = _interopRequireDefault(require("../../subatomic/iconSizes"));
20
+ var _styles = require("../../Text/styles");
17
21
 
18
- var _toast, _icon, _action;
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: _spacing["default"].radius,
37
- boxShadow: _shadows["default"].lvl5,
38
- padding: [_spacing["default"].tiny, _spacing["default"].small],
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
- padding: _spacing["default"].small
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
- background: _colors["default"].success
60
+ backgroundColor: _colors["default"].alert.success.bg,
61
+ outline: "1px solid ".concat(_colors["default"].alert.success.border)
55
62
  },
56
63
  error: {
57
- background: _colors["default"].error
64
+ backgroundColor: _colors["default"].alert.error.bg,
65
+ outline: "1px solid ".concat(_colors["default"].alert.error.border)
58
66
  },
59
67
  warning: {
60
- background: _colors["default"].warning
68
+ backgroundColor: _colors["default"].alert.warning.bg,
69
+ outline: "1px solid ".concat(_colors["default"].alert.warning.border)
61
70
  },
62
71
  info: {
63
- background: _colors["default"].info
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
- content: _defineProperty({}, "@media screen and (max-width:".concat(_grid["default"].xs - 1, "px)"), {
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: (_icon = {
69
- marginRight: _spacing["default"].small,
70
- width: _iconSizes["default"].small,
71
- height: _iconSizes["default"].small
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
- textTransform: 'uppercase',
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;
@@ -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
- hasIcon: toast.hasIcon,
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('button').simulate('click');
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-12 Toast-content-0-1-7\\"><div class=\\"Flexbox-flex-0-1-12 Flexbox-acenter-0-1-29\\"><div class=\\"\\" style=\\"flex: 1;\\"><p class=\\"Text-text-0-1-44 Text-h5-0-1-50 Text-whitePrimary-0-1-70\\">Title</p></div></div></div></div></div>"`;
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>"`;