@sb1/ffe-system-message-react 8.0.23 → 8.0.25

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.
@@ -1,4 +1,4 @@
1
- var _excluded = ["alert", "locale"];
1
+ var _excluded = ["alert", "locale", "animationLengthMs", "onClose"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -8,8 +8,16 @@ import { Icon } from '@sb1/ffe-icons-react';
8
8
  import texts from './texts';
9
9
  import SystemMessage from './SystemMessage';
10
10
  export default function SystemErrorMessage(props) {
11
- var alert = props.alert,
12
- locale = props.locale,
11
+ var _props$alert = props.alert,
12
+ alert = _props$alert === void 0 ? true : _props$alert,
13
+ _props$locale = props.locale,
14
+ locale = _props$locale === void 0 ? 'nb' : _props$locale,
15
+ _props$animationLengt = props.animationLengthMs,
16
+ animationLengthMs = _props$animationLengt === void 0 ? 300 : _props$animationLengt,
17
+ _props$onClose = props.onClose,
18
+ onClose = _props$onClose === void 0 ? function (f) {
19
+ return f;
20
+ } : _props$onClose,
13
21
  rest = _objectWithoutProperties(props, _excluded);
14
22
  var priorityHighIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTE4Ny4wOHEtMjEuNTM3IDAtMzYuNjYyLTE1LjMzN3QtMTUuMTI1LTM2Ljg3NHEwLTIxLjUzNyAxNS4zMzctMzYuNjYyIDE1LjMzNy0xNS4xMjQgMzYuODc0LTE1LjEyNCAyMS41MzcgMCAzNi42NjIgMTUuMzM3dDE1LjEyNSAzNi44NzRxMCAyMS41MzctMTUuMzM3IDM2LjY2MS0xNS4zMzcgMTUuMTI1LTM2Ljg3NCAxNS4xMjVabS0uMDYyLTE5Ni4xNTFxLTE5LjM0MSAwLTMyLjg0LTEzLjcwOS0xMy41LTEzLjcwOS0xMy41LTMyLjk2di0zMTYuNjg1cTAtMTkuMjUxIDEzLjc3NC0zMi43OTQgMTMuNzczLTEzLjU0MiAzMy4xMTQtMTMuNTQyIDE5LjM0MSAwIDMyLjg0IDEzLjcwOSAxMy41IDEzLjcwOSAxMy41IDMyLjk2djMxNi42ODVxMCAxOS4yNTEtMTMuNzc0IDMyLjc5NC0xMy43NzMgMTMuNTQyLTMzLjExNCAxMy41NDJaIi8+PC9zdmc+';
15
23
  return /*#__PURE__*/React.createElement(SystemMessage, _extends({
@@ -20,17 +28,11 @@ export default function SystemErrorMessage(props) {
20
28
  fileUrl: priorityHighIconSmall,
21
29
  size: "sm"
22
30
  }),
23
- role: alert ? 'alert' : 'group'
31
+ role: alert ? 'alert' : 'group',
32
+ animationLengthMs: animationLengthMs,
33
+ onClose: onClose
24
34
  }, rest));
25
35
  }
26
- SystemErrorMessage.defaultProps = {
27
- animationLengthMs: 300,
28
- locale: 'nb',
29
- onClose: function onClose(f) {
30
- return f;
31
- },
32
- alert: true
33
- };
34
36
  SystemErrorMessage.propTypes = {
35
37
  animationLengthMs: number,
36
38
  /** The content of the system message */
@@ -8,7 +8,8 @@ import texts from './texts';
8
8
  import SystemMessage from './SystemMessage';
9
9
  import { oneOf } from 'prop-types';
10
10
  export default function SystemInfoMessage(_ref) {
11
- var locale = _ref.locale,
11
+ var _ref$locale = _ref.locale,
12
+ locale = _ref$locale === void 0 ? 'nb' : _ref$locale,
12
13
  rest = _objectWithoutProperties(_ref, _excluded);
13
14
  var infoIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTY3MnEtMjUuOTQyIDAtNDMuODY0LTE4LjEzNS0xNy45MjMtMTguMTM2LTE3LjkyMy00NC4wNzd0MTguMTM1LTQzLjg2NHExOC4xMzUtMTcuOTIzIDQ0LjA3Ni0xNy45MjMgMjUuOTQyIDAgNDMuODY0IDE4LjEzNiAxNy45MjMgMTguMTM1IDE3LjkyMyA0NC4wNzZ0LTE4LjEzNSA0My44NjRRNTA1LjcyOS02NzIgNDc5Ljc4OC02NzJabS4yNTcgNTA3Ljk5OXEtMjAuODE0IDAtMzUuNDI5LTE0LjU4NC0xNC42MTUtMTQuNTgzLTE0LjYxNS0zNS40MTZ2LTI5Ni42MTRxMC0yMC44MzMgMTQuNTctMzUuNDE2IDE0LjU3LTE0LjU4MyAzNS4zODQtMTQuNTgzdDM1LjQyOSAxNC41ODNxMTQuNjE1IDE0LjU4MyAxNC42MTUgMzUuNDE2djI5Ni42MTRxMCAyMC44MzMtMTQuNTcgMzUuNDE2LTE0LjU3IDE0LjU4NC0zNS4zODQgMTQuNTg0WiIvPjwvc3ZnPg==';
14
15
  return /*#__PURE__*/React.createElement(SystemMessage, _extends({
@@ -21,9 +22,6 @@ export default function SystemInfoMessage(_ref) {
21
22
  })
22
23
  }, rest));
23
24
  }
24
- SystemInfoMessage.defaultProps = {
25
- locale: 'nb'
26
- };
27
25
  SystemInfoMessage.propTypes = {
28
26
  /** 'nb', 'nn', or 'en' */
29
27
  locale: oneOf(['en', 'nb', 'nn'])
@@ -41,7 +41,10 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
41
41
  var _this2 = this;
42
42
  var _this$props = this.props,
43
43
  animationLengthMs = _this$props.animationLengthMs,
44
- onClose = _this$props.onClose;
44
+ _this$props$onClose = _this$props.onClose,
45
+ onClose = _this$props$onClose === void 0 ? function (f) {
46
+ return f;
47
+ } : _this$props$onClose;
45
48
  var self = this._self;
46
49
  self.style.height = "".concat(self.offsetHeight, "px");
47
50
  setTimeout(function () {
@@ -61,11 +64,13 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
61
64
  value: function render() {
62
65
  var _this3 = this;
63
66
  var _this$props2 = this.props,
64
- animationLengthMs = _this$props2.animationLengthMs,
67
+ _this$props2$animatio = _this$props2.animationLengthMs,
68
+ animationLengthMs = _this$props2$animatio === void 0 ? 300 : _this$props2$animatio,
65
69
  children = _this$props2.children,
66
70
  className = _this$props2.className,
67
71
  icon = _this$props2.icon,
68
- locale = _this$props2.locale,
72
+ _this$props2$locale = _this$props2.locale,
73
+ locale = _this$props2$locale === void 0 ? 'nb' : _this$props2$locale,
69
74
  modifier = _this$props2.modifier,
70
75
  onColoredBg = _this$props2.onColoredBg,
71
76
  rest = _objectWithoutProperties(_this$props2, _excluded);
@@ -101,13 +106,6 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
101
106
  }
102
107
  }]);
103
108
  }(Component);
104
- SystemMessage.defaultProps = {
105
- animationLengthMs: 300,
106
- locale: 'nb',
107
- onClose: function onClose(f) {
108
- return f;
109
- }
110
- };
111
109
  SystemMessage.propTypes = {
112
110
  animationLengthMs: number,
113
111
  /** The content of the system message */
@@ -8,7 +8,8 @@ import texts from './texts';
8
8
  import SystemMessage from './SystemMessage';
9
9
  import { oneOf } from 'prop-types';
10
10
  export default function SystemNewsMessage(_ref) {
11
- var locale = _ref.locale,
11
+ var _ref$locale = _ref.locale,
12
+ locale = _ref$locale === void 0 ? 'nb' : _ref$locale,
12
13
  rest = _objectWithoutProperties(_ref, _excluded);
13
14
  var infoIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTY3MnEtMjUuOTQyIDAtNDMuODY0LTE4LjEzNS0xNy45MjMtMTguMTM2LTE3LjkyMy00NC4wNzd0MTguMTM1LTQzLjg2NHExOC4xMzUtMTcuOTIzIDQ0LjA3Ni0xNy45MjMgMjUuOTQyIDAgNDMuODY0IDE4LjEzNiAxNy45MjMgMTguMTM1IDE3LjkyMyA0NC4wNzZ0LTE4LjEzNSA0My44NjRRNTA1LjcyOS02NzIgNDc5Ljc4OC02NzJabS4yNTcgNTA3Ljk5OXEtMjAuODE0IDAtMzUuNDI5LTE0LjU4NC0xNC42MTUtMTQuNTgzLTE0LjYxNS0zNS40MTZ2LTI5Ni42MTRxMC0yMC44MzMgMTQuNTctMzUuNDE2IDE0LjU3LTE0LjU4MyAzNS4zODQtMTQuNTgzdDM1LjQyOSAxNC41ODNxMTQuNjE1IDE0LjU4MyAxNC42MTUgMzUuNDE2djI5Ni42MTRxMCAyMC44MzMtMTQuNTcgMzUuNDE2LTE0LjU3IDE0LjU4NC0zNS4zODQgMTQuNTg0WiIvPjwvc3ZnPg==';
14
15
  return /*#__PURE__*/React.createElement(SystemMessage, _extends({
@@ -21,9 +22,6 @@ export default function SystemNewsMessage(_ref) {
21
22
  })
22
23
  }, rest));
23
24
  }
24
- SystemNewsMessage.defaultProps = {
25
- locale: 'nb'
26
- };
27
25
  SystemNewsMessage.propTypes = {
28
26
  /** 'nb', 'nn', or 'en' */
29
27
  locale: oneOf(['en', 'nb', 'nn'])
@@ -8,7 +8,8 @@ import texts from './texts';
8
8
  import SystemMessage from './SystemMessage';
9
9
  import { oneOf } from 'prop-types';
10
10
  export default function SystemSuccessMessage(_ref) {
11
- var locale = _ref.locale,
11
+ var _ref$locale = _ref.locale,
12
+ locale = _ref$locale === void 0 ? 'nb' : _ref$locale,
12
13
  rest = _objectWithoutProperties(_ref, _excluded);
13
14
  var checkIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Im0zOTUtMzcyLjM4NCAyNzAuNTM5LTI2OS41MzhxNy45MjMtNy45MjMgMTcuNjkyLTcuNjE2IDkuNzY5LjMwOCAxOC4wNzYgOC42MTYgOC4zMDggOC4zMDcgOC4zMDggMTcuODg0IDAgOS41NzYtOC4zMDggMTcuODg0bC0yODMgMjgyLjk5OXEtOS44NDYgOS44NDYtMjIuODA3IDkuODQ2LTEyLjk2MSAwLTIyLjgwNy05Ljg0NmwtMTE0LTExMy45OTlxLTcuOTIzLTcuOTIzLTguMzA4LTE3LjY5Mi0uMzg0LTkuNzY5IDcuOTIzLTE4LjA3NiA4LjMwOC04LjMwOCAxNy44ODQtOC4zMDggOS41NzcgMCAxNy44ODQgOC4zMDhMMzk1LTM3Mi4zODRaIi8+PC9zdmc+';
14
15
  return /*#__PURE__*/React.createElement(SystemMessage, _extends({
@@ -21,9 +22,6 @@ export default function SystemSuccessMessage(_ref) {
21
22
  })
22
23
  }, rest));
23
24
  }
24
- SystemSuccessMessage.defaultProps = {
25
- locale: 'nb'
26
- };
27
25
  SystemSuccessMessage.propTypes = {
28
26
  /** 'nb', 'nn', or 'en' */
29
27
  locale: oneOf(['en', 'nb', 'nn'])
@@ -9,14 +9,22 @@ var _propTypes = require("prop-types");
9
9
  var _ffeIconsReact = require("@sb1/ffe-icons-react");
10
10
  var _texts = _interopRequireDefault(require("./texts"));
11
11
  var _SystemMessage = _interopRequireDefault(require("./SystemMessage"));
12
- var _excluded = ["alert", "locale"];
12
+ var _excluded = ["alert", "locale", "animationLengthMs", "onClose"];
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
15
15
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
16
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
17
  function SystemErrorMessage(props) {
18
- var alert = props.alert,
19
- locale = props.locale,
18
+ var _props$alert = props.alert,
19
+ alert = _props$alert === void 0 ? true : _props$alert,
20
+ _props$locale = props.locale,
21
+ locale = _props$locale === void 0 ? 'nb' : _props$locale,
22
+ _props$animationLengt = props.animationLengthMs,
23
+ animationLengthMs = _props$animationLengt === void 0 ? 300 : _props$animationLengt,
24
+ _props$onClose = props.onClose,
25
+ onClose = _props$onClose === void 0 ? function (f) {
26
+ return f;
27
+ } : _props$onClose,
20
28
  rest = _objectWithoutProperties(props, _excluded);
21
29
  var priorityHighIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTE4Ny4wOHEtMjEuNTM3IDAtMzYuNjYyLTE1LjMzN3QtMTUuMTI1LTM2Ljg3NHEwLTIxLjUzNyAxNS4zMzctMzYuNjYyIDE1LjMzNy0xNS4xMjQgMzYuODc0LTE1LjEyNCAyMS41MzcgMCAzNi42NjIgMTUuMzM3dDE1LjEyNSAzNi44NzRxMCAyMS41MzctMTUuMzM3IDM2LjY2MS0xNS4zMzcgMTUuMTI1LTM2Ljg3NCAxNS4xMjVabS0uMDYyLTE5Ni4xNTFxLTE5LjM0MSAwLTMyLjg0LTEzLjcwOS0xMy41LTEzLjcwOS0xMy41LTMyLjk2di0zMTYuNjg1cTAtMTkuMjUxIDEzLjc3NC0zMi43OTQgMTMuNzczLTEzLjU0MiAzMy4xMTQtMTMuNTQyIDE5LjM0MSAwIDMyLjg0IDEzLjcwOSAxMy41IDEzLjcwOSAxMy41IDMyLjk2djMxNi42ODVxMCAxOS4yNTEtMTMuNzc0IDMyLjc5NC0xMy43NzMgMTMuNTQyLTMzLjExNCAxMy41NDJaIi8+PC9zdmc+';
22
30
  return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
@@ -27,17 +35,11 @@ function SystemErrorMessage(props) {
27
35
  fileUrl: priorityHighIconSmall,
28
36
  size: "sm"
29
37
  }),
30
- role: alert ? 'alert' : 'group'
38
+ role: alert ? 'alert' : 'group',
39
+ animationLengthMs: animationLengthMs,
40
+ onClose: onClose
31
41
  }, rest));
32
42
  }
33
- SystemErrorMessage.defaultProps = {
34
- animationLengthMs: 300,
35
- locale: 'nb',
36
- onClose: function onClose(f) {
37
- return f;
38
- },
39
- alert: true
40
- };
41
43
  SystemErrorMessage.propTypes = {
42
44
  animationLengthMs: _propTypes.number,
43
45
  /** The content of the system message */
@@ -15,7 +15,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
15
15
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
16
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
17
  function SystemInfoMessage(_ref) {
18
- var locale = _ref.locale,
18
+ var _ref$locale = _ref.locale,
19
+ locale = _ref$locale === void 0 ? 'nb' : _ref$locale,
19
20
  rest = _objectWithoutProperties(_ref, _excluded);
20
21
  var infoIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTY3MnEtMjUuOTQyIDAtNDMuODY0LTE4LjEzNS0xNy45MjMtMTguMTM2LTE3LjkyMy00NC4wNzd0MTguMTM1LTQzLjg2NHExOC4xMzUtMTcuOTIzIDQ0LjA3Ni0xNy45MjMgMjUuOTQyIDAgNDMuODY0IDE4LjEzNiAxNy45MjMgMTguMTM1IDE3LjkyMyA0NC4wNzZ0LTE4LjEzNSA0My44NjRRNTA1LjcyOS02NzIgNDc5Ljc4OC02NzJabS4yNTcgNTA3Ljk5OXEtMjAuODE0IDAtMzUuNDI5LTE0LjU4NC0xNC42MTUtMTQuNTgzLTE0LjYxNS0zNS40MTZ2LTI5Ni42MTRxMC0yMC44MzMgMTQuNTctMzUuNDE2IDE0LjU3LTE0LjU4MyAzNS4zODQtMTQuNTgzdDM1LjQyOSAxNC41ODNxMTQuNjE1IDE0LjU4MyAxNC42MTUgMzUuNDE2djI5Ni42MTRxMCAyMC44MzMtMTQuNTcgMzUuNDE2LTE0LjU3IDE0LjU4NC0zNS4zODQgMTQuNTg0WiIvPjwvc3ZnPg==';
21
22
  return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
@@ -28,9 +29,6 @@ function SystemInfoMessage(_ref) {
28
29
  })
29
30
  }, rest));
30
31
  }
31
- SystemInfoMessage.defaultProps = {
32
- locale: 'nb'
33
- };
34
32
  SystemInfoMessage.propTypes = {
35
33
  /** 'nb', 'nn', or 'en' */
36
34
  locale: (0, _propTypes.oneOf)(['en', 'nb', 'nn'])
@@ -50,7 +50,10 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
50
50
  var _this2 = this;
51
51
  var _this$props = this.props,
52
52
  animationLengthMs = _this$props.animationLengthMs,
53
- onClose = _this$props.onClose;
53
+ _this$props$onClose = _this$props.onClose,
54
+ onClose = _this$props$onClose === void 0 ? function (f) {
55
+ return f;
56
+ } : _this$props$onClose;
54
57
  var self = this._self;
55
58
  self.style.height = "".concat(self.offsetHeight, "px");
56
59
  setTimeout(function () {
@@ -70,11 +73,13 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
70
73
  value: function render() {
71
74
  var _this3 = this;
72
75
  var _this$props2 = this.props,
73
- animationLengthMs = _this$props2.animationLengthMs,
76
+ _this$props2$animatio = _this$props2.animationLengthMs,
77
+ animationLengthMs = _this$props2$animatio === void 0 ? 300 : _this$props2$animatio,
74
78
  children = _this$props2.children,
75
79
  className = _this$props2.className,
76
80
  icon = _this$props2.icon,
77
- locale = _this$props2.locale,
81
+ _this$props2$locale = _this$props2.locale,
82
+ locale = _this$props2$locale === void 0 ? 'nb' : _this$props2$locale,
78
83
  modifier = _this$props2.modifier,
79
84
  onColoredBg = _this$props2.onColoredBg,
80
85
  rest = _objectWithoutProperties(_this$props2, _excluded);
@@ -110,13 +115,6 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
110
115
  }
111
116
  }]);
112
117
  }(_react.Component);
113
- SystemMessage.defaultProps = {
114
- animationLengthMs: 300,
115
- locale: 'nb',
116
- onClose: function onClose(f) {
117
- return f;
118
- }
119
- };
120
118
  SystemMessage.propTypes = {
121
119
  animationLengthMs: _propTypes.number,
122
120
  /** The content of the system message */
@@ -15,7 +15,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
15
15
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
16
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
17
  function SystemNewsMessage(_ref) {
18
- var locale = _ref.locale,
18
+ var _ref$locale = _ref.locale,
19
+ locale = _ref$locale === void 0 ? 'nb' : _ref$locale,
19
20
  rest = _objectWithoutProperties(_ref, _excluded);
20
21
  var infoIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTY3MnEtMjUuOTQyIDAtNDMuODY0LTE4LjEzNS0xNy45MjMtMTguMTM2LTE3LjkyMy00NC4wNzd0MTguMTM1LTQzLjg2NHExOC4xMzUtMTcuOTIzIDQ0LjA3Ni0xNy45MjMgMjUuOTQyIDAgNDMuODY0IDE4LjEzNiAxNy45MjMgMTguMTM1IDE3LjkyMyA0NC4wNzZ0LTE4LjEzNSA0My44NjRRNTA1LjcyOS02NzIgNDc5Ljc4OC02NzJabS4yNTcgNTA3Ljk5OXEtMjAuODE0IDAtMzUuNDI5LTE0LjU4NC0xNC42MTUtMTQuNTgzLTE0LjYxNS0zNS40MTZ2LTI5Ni42MTRxMC0yMC44MzMgMTQuNTctMzUuNDE2IDE0LjU3LTE0LjU4MyAzNS4zODQtMTQuNTgzdDM1LjQyOSAxNC41ODNxMTQuNjE1IDE0LjU4MyAxNC42MTUgMzUuNDE2djI5Ni42MTRxMCAyMC44MzMtMTQuNTcgMzUuNDE2LTE0LjU3IDE0LjU4NC0zNS4zODQgMTQuNTg0WiIvPjwvc3ZnPg==';
21
22
  return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
@@ -28,9 +29,6 @@ function SystemNewsMessage(_ref) {
28
29
  })
29
30
  }, rest));
30
31
  }
31
- SystemNewsMessage.defaultProps = {
32
- locale: 'nb'
33
- };
34
32
  SystemNewsMessage.propTypes = {
35
33
  /** 'nb', 'nn', or 'en' */
36
34
  locale: (0, _propTypes.oneOf)(['en', 'nb', 'nn'])
@@ -15,7 +15,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
15
15
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
16
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
17
  function SystemSuccessMessage(_ref) {
18
- var locale = _ref.locale,
18
+ var _ref$locale = _ref.locale,
19
+ locale = _ref$locale === void 0 ? 'nb' : _ref$locale,
19
20
  rest = _objectWithoutProperties(_ref, _excluded);
20
21
  var checkIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Im0zOTUtMzcyLjM4NCAyNzAuNTM5LTI2OS41MzhxNy45MjMtNy45MjMgMTcuNjkyLTcuNjE2IDkuNzY5LjMwOCAxOC4wNzYgOC42MTYgOC4zMDggOC4zMDcgOC4zMDggMTcuODg0IDAgOS41NzYtOC4zMDggMTcuODg0bC0yODMgMjgyLjk5OXEtOS44NDYgOS44NDYtMjIuODA3IDkuODQ2LTEyLjk2MSAwLTIyLjgwNy05Ljg0NmwtMTE0LTExMy45OTlxLTcuOTIzLTcuOTIzLTguMzA4LTE3LjY5Mi0uMzg0LTkuNzY5IDcuOTIzLTE4LjA3NiA4LjMwOC04LjMwOCAxNy44ODQtOC4zMDggOS41NzcgMCAxNy44ODQgOC4zMDhMMzk1LTM3Mi4zODRaIi8+PC9zdmc+';
21
22
  return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
@@ -28,9 +29,6 @@ function SystemSuccessMessage(_ref) {
28
29
  })
29
30
  }, rest));
30
31
  }
31
- SystemSuccessMessage.defaultProps = {
32
- locale: 'nb'
33
- };
34
32
  SystemSuccessMessage.propTypes = {
35
33
  /** 'nb', 'nn', or 'en' */
36
34
  locale: (0, _propTypes.oneOf)(['en', 'nb', 'nn'])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-system-message-react",
3
- "version": "8.0.23",
3
+ "version": "8.0.25",
4
4
  "description": "SpareBank 1 System Message komponent",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -24,9 +24,9 @@
24
24
  "test:watch": "ffe-buildtool jest --watch"
25
25
  },
26
26
  "dependencies": {
27
- "@sb1/ffe-grid-react": "^13.2.9",
28
- "@sb1/ffe-icons-react": "^9.0.7",
29
- "@sb1/ffe-system-message": "^8.0.10",
27
+ "@sb1/ffe-grid-react": "^13.2.10",
28
+ "@sb1/ffe-icons-react": "^9.0.8",
29
+ "@sb1/ffe-system-message": "^8.0.11",
30
30
  "classnames": "^2.3.1",
31
31
  "prop-types": "^15.7.2"
32
32
  },
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "d9726eae887f19598f051c2f205506a0710b89e8"
44
+ "gitHead": "c291894cefef43c0607f844862e87031452a0d94"
45
45
  }
package/types/index.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  import * as React from 'react';
2
2
 
3
- export interface SystemMessageProps {
3
+ export interface SystemMessageProps
4
+ extends React.ComponentPropsWithoutRef<'div'> {
4
5
  animationLengthMs?: number;
5
- children: React.ReactNode;
6
- className?: string;
7
6
  icon?: React.ReactNode;
8
7
  locale?: 'en' | 'nb' | 'nn';
9
- onClose?: (e: React.MouseEvent | undefined) => void;
8
+ onClose?: React.MouseEventHandler<HTMLButtonElement>;
10
9
  onColoredBg?: boolean;
11
10
  }
12
11