@sb1/ffe-system-message-react 6.2.13 → 6.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.
@@ -15,7 +15,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
15
15
 
16
16
  var _kryssIkon = _interopRequireDefault(require("@sb1/ffe-icons-react/lib/kryss-ikon"));
17
17
 
18
- var _excluded = ["animationLengthMs", "children", "className", "icon", "locale", "modifier"];
18
+ var _excluded = ["animationLengthMs", "children", "className", "icon", "locale", "modifier", "onColoredBg"];
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
@@ -101,6 +101,7 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
101
101
  icon = _this$props2.icon,
102
102
  locale = _this$props2.locale,
103
103
  modifier = _this$props2.modifier,
104
+ onColoredBg = _this$props2.onColoredBg,
104
105
  rest = _objectWithoutProperties(_this$props2, _excluded);
105
106
 
106
107
  if (this.state.closed) {
@@ -108,7 +109,9 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
108
109
  }
109
110
 
110
111
  return /*#__PURE__*/_react.default.createElement("div", _extends({
111
- className: (0, _classnames.default)('ffe-system-message-wrapper', "ffe-system-message-wrapper--".concat(modifier), className),
112
+ className: (0, _classnames.default)('ffe-system-message-wrapper', "ffe-system-message-wrapper--".concat(modifier), {
113
+ 'ffe-system-message-wrapper--coloredbg': onColoredBg
114
+ }, className),
112
115
  ref: function ref(_self) {
113
116
  _this3._self = _self;
114
117
  },
@@ -164,7 +167,10 @@ SystemMessage.propTypes = {
164
167
  modifier: (0, _propTypes.oneOf)(['error', 'info', 'success', 'news']),
165
168
 
166
169
  /** Callback for when the system message has been closed (after animation ends) */
167
- onClose: _propTypes.func
170
+ onClose: _propTypes.func,
171
+
172
+ /* Adds alternative styling for better contrast on certain backgrounds */
173
+ onColoredBg: _propTypes.bool
168
174
  };
169
175
  var _default = SystemMessage;
170
176
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-system-message-react",
3
- "version": "6.2.13",
3
+ "version": "6.3.0",
4
4
  "description": "SpareBank 1 System Message komponent",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "scripts": {
19
19
  "build": "ffe-buildtool babel",
20
+ "watch": "ffe-buildtool babel-watch",
20
21
  "lint": "eslint src",
21
22
  "test": "jest",
22
23
  "test:watch": "jest --watch"
@@ -25,13 +26,13 @@
25
26
  "setupTestFrameworkScriptFile": "../../test-setup.js"
26
27
  },
27
28
  "dependencies": {
28
- "@sb1/ffe-grid-react": "^11.1.2",
29
+ "@sb1/ffe-grid-react": "^11.1.5",
29
30
  "classnames": "^2.3.1",
30
31
  "prop-types": "^15.7.2"
31
32
  },
32
33
  "devDependencies": {
33
- "@sb1/ffe-buildtool": "^0.2.0",
34
- "@sb1/ffe-icons-react": "^7.2.21",
34
+ "@sb1/ffe-buildtool": "^0.3.2",
35
+ "@sb1/ffe-icons-react": "^7.2.22",
35
36
  "enzyme": "^3.7.0",
36
37
  "enzyme-adapter-react-16": "^1.7.0",
37
38
  "jest": "^26.0.0",
@@ -46,5 +47,5 @@
46
47
  "publishConfig": {
47
48
  "access": "public"
48
49
  },
49
- "gitHead": "5da885a3bba8e6990f1f06796983ca0f1add9d9a"
50
+ "gitHead": "a65e9a094adc4226cf148163f9729d2398fdd3ed"
50
51
  }
package/types/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export interface SystemMessageProps {
7
7
  icon?: React.ReactNode;
8
8
  locale?: 'en' | 'nb' | 'nn';
9
9
  onClose?: (e: React.MouseEvent | undefined) => void;
10
+ onColoredBg?: boolean;
10
11
  }
11
12
 
12
13
  export interface SystemErrorMessageProps extends SystemMessageProps {