@sb1/ffe-system-message-react 6.4.6 → 6.4.8

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,19 +1,14 @@
1
1
  var _excluded = ["alert"];
2
-
3
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); }
4
-
5
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; }
6
-
7
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
-
9
5
  import React from 'react';
10
6
  import { func, string, number, node, oneOf, bool } from 'prop-types';
11
7
  import UtropstegnIkon from "@sb1/ffe-icons-react/es/utropstegn-ikon";
12
8
  import SystemMessage from './SystemMessage';
13
9
  export default function SystemErrorMessage(props) {
14
10
  var alert = props.alert,
15
- rest = _objectWithoutProperties(props, _excluded);
16
-
11
+ rest = _objectWithoutProperties(props, _excluded);
17
12
  return /*#__PURE__*/React.createElement(SystemMessage, _extends({
18
13
  modifier: "error",
19
14
  icon: /*#__PURE__*/React.createElement(UtropstegnIkon, {
@@ -32,28 +27,21 @@ SystemErrorMessage.defaultProps = {
32
27
  };
33
28
  SystemErrorMessage.propTypes = {
34
29
  animationLengthMs: number,
35
-
36
30
  /** The content of the system message */
37
31
  children: node.isRequired,
38
-
39
32
  /** Additional classes added to the surrounding div */
40
33
  className: string,
41
-
42
34
  /** Override the default icon - use with caution! */
43
35
  icon: node,
44
-
45
36
  /** 'nb', 'nn', or 'en' */
46
37
  locale: oneOf(['en', 'nb', 'nn']),
47
-
48
38
  /**
49
39
  * The type of system message. Used internally only-
50
40
  * @ignore
51
41
  **/
52
42
  modifier: oneOf(['error', 'info', 'success', 'news']),
53
-
54
43
  /** Callback for when the system message has been closed (after animation ends) */
55
44
  onClose: func,
56
-
57
45
  /** When false, role is not set to alert, avoids message from being read up immediately after page load. Default value is true. */
58
46
  alert: bool
59
47
  };
@@ -1,5 +1,4 @@
1
1
  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); }
2
-
3
2
  import React from 'react';
4
3
  import InfoIkon from "@sb1/ffe-icons-react/es/info-ikon";
5
4
  import SystemMessage from './SystemMessage';
@@ -1,48 +1,28 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
-
3
2
  var _excluded = ["animationLengthMs", "children", "className", "icon", "locale", "modifier", "onColoredBg"];
4
-
5
3
  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); }
6
-
7
4
  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; }
8
-
9
5
  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; }
10
-
11
6
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
-
13
7
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
14
-
15
8
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
-
17
9
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
18
-
19
10
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
-
21
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
22
-
23
12
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
24
-
25
13
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
26
-
27
14
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
28
-
29
15
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
30
-
31
16
  import React, { Component } from 'react';
32
17
  import { func, string, number, node, oneOf, bool } from 'prop-types';
33
18
  import classNames from 'classnames';
34
19
  import KryssIkon from "@sb1/ffe-icons-react/es/kryss-ikon";
35
-
36
20
  var SystemMessage = /*#__PURE__*/function (_Component) {
37
21
  _inherits(SystemMessage, _Component);
38
-
39
22
  var _super = _createSuper(SystemMessage);
40
-
41
23
  function SystemMessage() {
42
24
  var _this;
43
-
44
25
  _classCallCheck(this, SystemMessage);
45
-
46
26
  _this = _super.call(this);
47
27
  _this.close = _this.close.bind(_assertThisInitialized(_this));
48
28
  _this.state = {
@@ -50,15 +30,13 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
50
30
  };
51
31
  return _this;
52
32
  }
53
-
54
33
  _createClass(SystemMessage, [{
55
34
  key: "close",
56
35
  value: function close(event) {
57
36
  var _this2 = this;
58
-
59
37
  var _this$props = this.props,
60
- animationLengthMs = _this$props.animationLengthMs,
61
- onClose = _this$props.onClose;
38
+ animationLengthMs = _this$props.animationLengthMs,
39
+ onClose = _this$props.onClose;
62
40
  var self = this._self;
63
41
  self.style.height = "".concat(self.offsetHeight, "px");
64
42
  setTimeout(function () {
@@ -77,21 +55,18 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
77
55
  key: "render",
78
56
  value: function render() {
79
57
  var _this3 = this;
80
-
81
58
  var _this$props2 = this.props,
82
- animationLengthMs = _this$props2.animationLengthMs,
83
- children = _this$props2.children,
84
- className = _this$props2.className,
85
- icon = _this$props2.icon,
86
- locale = _this$props2.locale,
87
- modifier = _this$props2.modifier,
88
- onColoredBg = _this$props2.onColoredBg,
89
- rest = _objectWithoutProperties(_this$props2, _excluded);
90
-
59
+ animationLengthMs = _this$props2.animationLengthMs,
60
+ children = _this$props2.children,
61
+ className = _this$props2.className,
62
+ icon = _this$props2.icon,
63
+ locale = _this$props2.locale,
64
+ modifier = _this$props2.modifier,
65
+ onColoredBg = _this$props2.onColoredBg,
66
+ rest = _objectWithoutProperties(_this$props2, _excluded);
91
67
  if (this.state.closed) {
92
68
  return null;
93
69
  }
94
-
95
70
  return /*#__PURE__*/React.createElement("div", _extends({
96
71
  className: classNames('ffe-system-message-wrapper', "ffe-system-message-wrapper--".concat(modifier), {
97
72
  'ffe-system-message-wrapper--coloredbg': onColoredBg
@@ -118,10 +93,8 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
118
93
  }))));
119
94
  }
120
95
  }]);
121
-
122
96
  return SystemMessage;
123
97
  }(Component);
124
-
125
98
  SystemMessage.defaultProps = {
126
99
  animationLengthMs: 300,
127
100
  locale: 'nb',
@@ -131,28 +104,21 @@ SystemMessage.defaultProps = {
131
104
  };
132
105
  SystemMessage.propTypes = {
133
106
  animationLengthMs: number,
134
-
135
107
  /** The content of the system message */
136
108
  children: node.isRequired,
137
-
138
109
  /** Additional classes added to the surrounding div */
139
110
  className: string,
140
-
141
111
  /** Override the default icon - use with caution! */
142
112
  icon: node.isRequired,
143
-
144
113
  /** 'nb', 'nn', or 'en' */
145
114
  locale: oneOf(['en', 'nb', 'nn']),
146
-
147
115
  /**
148
116
  * The type of system message. Used internally only-
149
117
  * @ignore
150
118
  **/
151
119
  modifier: oneOf(['error', 'info', 'success', 'news']),
152
-
153
120
  /** Callback for when the system message has been closed (after animation ends) */
154
121
  onClose: func,
155
-
156
122
  /* Adds alternative styling for better contrast on certain backgrounds */
157
123
  onColoredBg: bool
158
124
  };
@@ -1,5 +1,4 @@
1
1
  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); }
2
-
3
2
  import React from 'react';
4
3
  import InfoIkon from "@sb1/ffe-icons-react/es/info-ikon";
5
4
  import SystemMessage from './SystemMessage';
@@ -1,5 +1,4 @@
1
1
  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); }
2
-
3
2
  import React from 'react';
4
3
  import HakeIkon from "@sb1/ffe-icons-react/es/hake-ikon";
5
4
  import SystemMessage from './SystemMessage';
@@ -4,29 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = SystemErrorMessage;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = require("prop-types");
11
-
12
9
  var _utropstegnIkon = _interopRequireDefault(require("@sb1/ffe-icons-react/lib/utropstegn-ikon"));
13
-
14
10
  var _SystemMessage = _interopRequireDefault(require("./SystemMessage"));
15
-
16
11
  var _excluded = ["alert"];
17
-
18
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
13
  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); }
21
-
22
14
  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; }
23
-
24
15
  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; }
25
-
26
16
  function SystemErrorMessage(props) {
27
17
  var alert = props.alert,
28
- rest = _objectWithoutProperties(props, _excluded);
29
-
18
+ rest = _objectWithoutProperties(props, _excluded);
30
19
  return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
31
20
  modifier: "error",
32
21
  icon: /*#__PURE__*/_react.default.createElement(_utropstegnIkon.default, {
@@ -35,7 +24,6 @@ function SystemErrorMessage(props) {
35
24
  role: alert ? 'alert' : undefined
36
25
  }, rest));
37
26
  }
38
-
39
27
  SystemErrorMessage.defaultProps = {
40
28
  animationLengthMs: 300,
41
29
  locale: 'nb',
@@ -46,28 +34,21 @@ SystemErrorMessage.defaultProps = {
46
34
  };
47
35
  SystemErrorMessage.propTypes = {
48
36
  animationLengthMs: _propTypes.number,
49
-
50
37
  /** The content of the system message */
51
38
  children: _propTypes.node.isRequired,
52
-
53
39
  /** Additional classes added to the surrounding div */
54
40
  className: _propTypes.string,
55
-
56
41
  /** Override the default icon - use with caution! */
57
42
  icon: _propTypes.node,
58
-
59
43
  /** 'nb', 'nn', or 'en' */
60
44
  locale: (0, _propTypes.oneOf)(['en', 'nb', 'nn']),
61
-
62
45
  /**
63
46
  * The type of system message. Used internally only-
64
47
  * @ignore
65
48
  **/
66
49
  modifier: (0, _propTypes.oneOf)(['error', 'info', 'success', 'news']),
67
-
68
50
  /** Callback for when the system message has been closed (after animation ends) */
69
51
  onClose: _propTypes.func,
70
-
71
52
  /** When false, role is not set to alert, avoids message from being read up immediately after page load. Default value is true. */
72
53
  alert: _propTypes.bool
73
54
  };
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = SystemInfoMessage;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _infoIkon = _interopRequireDefault(require("@sb1/ffe-icons-react/lib/info-ikon"));
11
-
12
9
  var _SystemMessage = _interopRequireDefault(require("./SystemMessage"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  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); }
17
-
18
12
  function SystemInfoMessage(props) {
19
13
  return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
20
14
  modifier: "info",
@@ -1,64 +1,37 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _propTypes = require("prop-types");
13
-
14
10
  var _classnames = _interopRequireDefault(require("classnames"));
15
-
16
11
  var _kryssIkon = _interopRequireDefault(require("@sb1/ffe-icons-react/lib/kryss-ikon"));
17
-
18
12
  var _excluded = ["animationLengthMs", "children", "className", "icon", "locale", "modifier", "onColoredBg"];
19
-
20
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
16
  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); }
27
-
28
17
  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; }
29
-
30
18
  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; }
31
-
32
19
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
-
34
20
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
35
-
36
21
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
-
38
22
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
39
-
40
23
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
41
-
42
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
43
-
44
25
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
45
-
46
26
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
47
-
48
27
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
49
-
50
28
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
51
-
52
29
  var SystemMessage = /*#__PURE__*/function (_Component) {
53
30
  _inherits(SystemMessage, _Component);
54
-
55
31
  var _super = _createSuper(SystemMessage);
56
-
57
32
  function SystemMessage() {
58
33
  var _this;
59
-
60
34
  _classCallCheck(this, SystemMessage);
61
-
62
35
  _this = _super.call(this);
63
36
  _this.close = _this.close.bind(_assertThisInitialized(_this));
64
37
  _this.state = {
@@ -66,15 +39,13 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
66
39
  };
67
40
  return _this;
68
41
  }
69
-
70
42
  _createClass(SystemMessage, [{
71
43
  key: "close",
72
44
  value: function close(event) {
73
45
  var _this2 = this;
74
-
75
46
  var _this$props = this.props,
76
- animationLengthMs = _this$props.animationLengthMs,
77
- onClose = _this$props.onClose;
47
+ animationLengthMs = _this$props.animationLengthMs,
48
+ onClose = _this$props.onClose;
78
49
  var self = this._self;
79
50
  self.style.height = "".concat(self.offsetHeight, "px");
80
51
  setTimeout(function () {
@@ -93,21 +64,18 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
93
64
  key: "render",
94
65
  value: function render() {
95
66
  var _this3 = this;
96
-
97
67
  var _this$props2 = this.props,
98
- animationLengthMs = _this$props2.animationLengthMs,
99
- children = _this$props2.children,
100
- className = _this$props2.className,
101
- icon = _this$props2.icon,
102
- locale = _this$props2.locale,
103
- modifier = _this$props2.modifier,
104
- onColoredBg = _this$props2.onColoredBg,
105
- rest = _objectWithoutProperties(_this$props2, _excluded);
106
-
68
+ animationLengthMs = _this$props2.animationLengthMs,
69
+ children = _this$props2.children,
70
+ className = _this$props2.className,
71
+ icon = _this$props2.icon,
72
+ locale = _this$props2.locale,
73
+ modifier = _this$props2.modifier,
74
+ onColoredBg = _this$props2.onColoredBg,
75
+ rest = _objectWithoutProperties(_this$props2, _excluded);
107
76
  if (this.state.closed) {
108
77
  return null;
109
78
  }
110
-
111
79
  return /*#__PURE__*/_react.default.createElement("div", _extends({
112
80
  className: (0, _classnames.default)('ffe-system-message-wrapper', "ffe-system-message-wrapper--".concat(modifier), {
113
81
  'ffe-system-message-wrapper--coloredbg': onColoredBg
@@ -134,10 +102,8 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
134
102
  }))));
135
103
  }
136
104
  }]);
137
-
138
105
  return SystemMessage;
139
106
  }(_react.Component);
140
-
141
107
  SystemMessage.defaultProps = {
142
108
  animationLengthMs: 300,
143
109
  locale: 'nb',
@@ -147,28 +113,21 @@ SystemMessage.defaultProps = {
147
113
  };
148
114
  SystemMessage.propTypes = {
149
115
  animationLengthMs: _propTypes.number,
150
-
151
116
  /** The content of the system message */
152
117
  children: _propTypes.node.isRequired,
153
-
154
118
  /** Additional classes added to the surrounding div */
155
119
  className: _propTypes.string,
156
-
157
120
  /** Override the default icon - use with caution! */
158
121
  icon: _propTypes.node.isRequired,
159
-
160
122
  /** 'nb', 'nn', or 'en' */
161
123
  locale: (0, _propTypes.oneOf)(['en', 'nb', 'nn']),
162
-
163
124
  /**
164
125
  * The type of system message. Used internally only-
165
126
  * @ignore
166
127
  **/
167
128
  modifier: (0, _propTypes.oneOf)(['error', 'info', 'success', 'news']),
168
-
169
129
  /** Callback for when the system message has been closed (after animation ends) */
170
130
  onClose: _propTypes.func,
171
-
172
131
  /* Adds alternative styling for better contrast on certain backgrounds */
173
132
  onColoredBg: _propTypes.bool
174
133
  };
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = SystemNewsMessage;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _infoIkon = _interopRequireDefault(require("@sb1/ffe-icons-react/lib/info-ikon"));
11
-
12
9
  var _SystemMessage = _interopRequireDefault(require("./SystemMessage"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  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); }
17
-
18
12
  function SystemNewsMessage(props) {
19
13
  return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
20
14
  modifier: "news",
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = SystemSuccessMessage;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _hakeIkon = _interopRequireDefault(require("@sb1/ffe-icons-react/lib/hake-ikon"));
11
-
12
9
  var _SystemMessage = _interopRequireDefault(require("./SystemMessage"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  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); }
17
-
18
12
  function SystemSuccessMessage(props) {
19
13
  return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
20
14
  modifier: "success",
package/lib/index.js CHANGED
@@ -27,13 +27,8 @@ Object.defineProperty(exports, "SystemSuccessMessage", {
27
27
  return _SystemSuccessMessage.default;
28
28
  }
29
29
  });
30
-
31
30
  var _SystemErrorMessage = _interopRequireDefault(require("./SystemErrorMessage"));
32
-
33
31
  var _SystemInfoMessage = _interopRequireDefault(require("./SystemInfoMessage"));
34
-
35
32
  var _SystemNewsMessage = _interopRequireDefault(require("./SystemNewsMessage"));
36
-
37
33
  var _SystemSuccessMessage = _interopRequireDefault(require("./SystemSuccessMessage"));
38
-
39
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
1
  {
2
- "name": "@sb1/ffe-system-message-react",
3
- "version": "6.4.6",
4
- "description": "SpareBank 1 System Message komponent",
5
- "license": "MIT",
6
- "author": "SpareBank 1",
7
- "files": [
8
- "lib",
9
- "es",
10
- "types"
11
- ],
12
- "main": "lib/index.js",
13
- "module": "es/index.js",
14
- "types": "types/index.d.ts",
15
- "repository": {
16
- "type": "git",
17
- "url": "ssh://git@github.com:SpareBank1/designsystem.git"
18
- },
19
- "scripts": {
20
- "build": "ffe-buildtool babel",
21
- "watch": "ffe-buildtool babel-watch",
22
- "lint": "eslint src",
23
- "test": "ffe-buildtool jest",
24
- "test:watch": "ffe-buildtool jest --watch"
25
- },
26
- "dependencies": {
27
- "@sb1/ffe-grid-react": "^12.0.0",
28
- "classnames": "^2.3.1",
29
- "prop-types": "^15.7.2"
30
- },
31
- "devDependencies": {
32
- "@sb1/ffe-buildtool": "^0.4.1",
33
- "@sb1/ffe-icons-react": "^7.3.3",
34
- "react": "^16.9.0",
35
- "react-dom": "^16.9.0"
36
- },
37
- "peerDependencies": {
38
- "@sb1/ffe-icons-react": "*",
39
- "@sb1/ffe-system-message": "*",
40
- "react": ">=16.9.0"
41
- },
42
- "publishConfig": {
43
- "access": "public"
44
- },
45
- "gitHead": "4e1226ba50e091c930cd6aa4bdc72b2f4c0f524f"
2
+ "name": "@sb1/ffe-system-message-react",
3
+ "version": "6.4.8",
4
+ "description": "SpareBank 1 System Message komponent",
5
+ "license": "MIT",
6
+ "author": "SpareBank 1",
7
+ "files": [
8
+ "lib",
9
+ "es",
10
+ "types"
11
+ ],
12
+ "main": "lib/index.js",
13
+ "module": "es/index.js",
14
+ "types": "types/index.d.ts",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "ssh://git@github.com:SpareBank1/designsystem.git"
18
+ },
19
+ "scripts": {
20
+ "build": "ffe-buildtool babel",
21
+ "watch": "ffe-buildtool babel-watch",
22
+ "lint": "eslint src",
23
+ "test": "ffe-buildtool jest",
24
+ "test:watch": "ffe-buildtool jest --watch"
25
+ },
26
+ "dependencies": {
27
+ "@sb1/ffe-grid-react": "^12.0.2",
28
+ "classnames": "^2.3.1",
29
+ "prop-types": "^15.7.2"
30
+ },
31
+ "devDependencies": {
32
+ "@sb1/ffe-buildtool": "^0.4.1",
33
+ "@sb1/ffe-icons-react": "^7.3.3",
34
+ "react": "^16.9.0",
35
+ "react-dom": "^16.9.0"
36
+ },
37
+ "peerDependencies": {
38
+ "@sb1/ffe-icons-react": "*",
39
+ "@sb1/ffe-system-message": "*",
40
+ "react": ">=16.9.0"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "gitHead": "3878d43f98432f838d8f2f2da396f8fc40d0d311"
46
46
  }