@sb1/ffe-message-box-react 7.0.6 → 7.2.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.
- package/es/BaseMessage.js +15 -9
- package/es/ErrorMessage.js +1 -1
- package/es/InfoMessage.js +1 -1
- package/es/SuccessMessage.js +1 -1
- package/es/TipsMessage.js +1 -1
- package/lib/BaseMessage.js +14 -8
- package/package.json +6 -12
- package/types/index.d.ts +1 -0
package/es/BaseMessage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["type", "title", "icon", "content", "children", "className"];
|
|
1
|
+
var _excluded = ["type", "title", "icon", "content", "children", "className", "onColoredBg"];
|
|
2
2
|
|
|
3
3
|
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); }
|
|
4
4
|
|
|
@@ -13,11 +13,11 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
13
13
|
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; }
|
|
14
14
|
|
|
15
15
|
import React from 'react';
|
|
16
|
-
import { node, oneOf, string } from 'prop-types';
|
|
16
|
+
import { bool, node, oneOf, string } from 'prop-types';
|
|
17
17
|
import classNames from 'classnames';
|
|
18
18
|
var iconStyles = {
|
|
19
|
-
width: '
|
|
20
|
-
height: '
|
|
19
|
+
width: '32px',
|
|
20
|
+
height: '32px'
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
var BaseMessage = function BaseMessage(props) {
|
|
@@ -28,18 +28,21 @@ var BaseMessage = function BaseMessage(props) {
|
|
|
28
28
|
children = props.children,
|
|
29
29
|
_props$className = props.className,
|
|
30
30
|
className = _props$className === void 0 ? '' : _props$className,
|
|
31
|
+
onColoredBg = props.onColoredBg,
|
|
31
32
|
rest = _objectWithoutProperties(props, _excluded);
|
|
32
33
|
|
|
33
34
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
34
|
-
className: classNames('ffe-message-box',
|
|
35
|
+
className: classNames('ffe-message-box', "ffe-message-box--".concat(type), {
|
|
36
|
+
'ffe-message-box--coloredbg': onColoredBg
|
|
37
|
+
}, className)
|
|
35
38
|
}, rest), /*#__PURE__*/React.createElement("span", {
|
|
36
|
-
className:
|
|
39
|
+
className: "ffe-message-box__icon"
|
|
37
40
|
}, /*#__PURE__*/React.cloneElement(icon, _objectSpread({
|
|
38
41
|
style: iconStyles
|
|
39
42
|
}, icon.props))), /*#__PURE__*/React.createElement("div", {
|
|
40
|
-
className:
|
|
43
|
+
className: "ffe-message-box__box"
|
|
41
44
|
}, title && /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className:
|
|
45
|
+
className: "ffe-message-box__title"
|
|
43
46
|
}, title), content && /*#__PURE__*/React.createElement("p", null, content), !content && children));
|
|
44
47
|
};
|
|
45
48
|
|
|
@@ -54,6 +57,9 @@ BaseMessage.propTypes = {
|
|
|
54
57
|
* Internal type enum for specifying the style of message box. Should not be used directly
|
|
55
58
|
* @ignore
|
|
56
59
|
*/
|
|
57
|
-
type: oneOf(['success', 'error', 'tips', 'info']).isRequired
|
|
60
|
+
type: oneOf(['success', 'error', 'tips', 'info']).isRequired,
|
|
61
|
+
|
|
62
|
+
/* Adds alternative styling for better contrast on certain backgrounds */
|
|
63
|
+
onColoredBg: bool
|
|
58
64
|
};
|
|
59
65
|
export default BaseMessage;
|
package/es/ErrorMessage.js
CHANGED
|
@@ -8,7 +8,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { node, string, bool } from 'prop-types';
|
|
11
|
-
import UtropstegnIkon from
|
|
11
|
+
import UtropstegnIkon from "@sb1/ffe-icons-react/es/utropstegn-ikon";
|
|
12
12
|
import BaseMessage from './BaseMessage';
|
|
13
13
|
|
|
14
14
|
var ErrorMessage = function ErrorMessage(props) {
|
package/es/InfoMessage.js
CHANGED
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { node, string } from 'prop-types';
|
|
5
|
-
import InfoIkon from
|
|
5
|
+
import InfoIkon from "@sb1/ffe-icons-react/es/info-ikon";
|
|
6
6
|
import BaseMessage from './BaseMessage';
|
|
7
7
|
|
|
8
8
|
var InfoMessage = function InfoMessage(props) {
|
package/es/SuccessMessage.js
CHANGED
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { node, string } from 'prop-types';
|
|
5
|
-
import HakeIkon from
|
|
5
|
+
import HakeIkon from "@sb1/ffe-icons-react/es/hake-ikon";
|
|
6
6
|
import BaseMessage from './BaseMessage';
|
|
7
7
|
|
|
8
8
|
var SuccessMessage = function SuccessMessage(props) {
|
package/es/TipsMessage.js
CHANGED
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { node, string } from 'prop-types';
|
|
5
|
-
import LyspareIkon from
|
|
5
|
+
import LyspareIkon from "@sb1/ffe-icons-react/es/lyspare-ikon";
|
|
6
6
|
import BaseMessage from './BaseMessage';
|
|
7
7
|
|
|
8
8
|
var TipsMessage = function TipsMessage(props) {
|
package/lib/BaseMessage.js
CHANGED
|
@@ -11,7 +11,7 @@ var _propTypes = require("prop-types");
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var _excluded = ["type", "title", "icon", "content", "children", "className"];
|
|
14
|
+
var _excluded = ["type", "title", "icon", "content", "children", "className", "onColoredBg"];
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
@@ -28,8 +28,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
28
28
|
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; }
|
|
29
29
|
|
|
30
30
|
var iconStyles = {
|
|
31
|
-
width: '
|
|
32
|
-
height: '
|
|
31
|
+
width: '32px',
|
|
32
|
+
height: '32px'
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
var BaseMessage = function BaseMessage(props) {
|
|
@@ -40,18 +40,21 @@ var BaseMessage = function BaseMessage(props) {
|
|
|
40
40
|
children = props.children,
|
|
41
41
|
_props$className = props.className,
|
|
42
42
|
className = _props$className === void 0 ? '' : _props$className,
|
|
43
|
+
onColoredBg = props.onColoredBg,
|
|
43
44
|
rest = _objectWithoutProperties(props, _excluded);
|
|
44
45
|
|
|
45
46
|
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
46
|
-
className: (0, _classnames.default)('ffe-message-box',
|
|
47
|
+
className: (0, _classnames.default)('ffe-message-box', "ffe-message-box--".concat(type), {
|
|
48
|
+
'ffe-message-box--coloredbg': onColoredBg
|
|
49
|
+
}, className)
|
|
47
50
|
}, rest), /*#__PURE__*/_react.default.createElement("span", {
|
|
48
|
-
className:
|
|
51
|
+
className: "ffe-message-box__icon"
|
|
49
52
|
}, /*#__PURE__*/_react.default.cloneElement(icon, _objectSpread({
|
|
50
53
|
style: iconStyles
|
|
51
54
|
}, icon.props))), /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
-
className:
|
|
55
|
+
className: "ffe-message-box__box"
|
|
53
56
|
}, title && /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
-
className:
|
|
57
|
+
className: "ffe-message-box__title"
|
|
55
58
|
}, title), content && /*#__PURE__*/_react.default.createElement("p", null, content), !content && children));
|
|
56
59
|
};
|
|
57
60
|
|
|
@@ -66,7 +69,10 @@ BaseMessage.propTypes = {
|
|
|
66
69
|
* Internal type enum for specifying the style of message box. Should not be used directly
|
|
67
70
|
* @ignore
|
|
68
71
|
*/
|
|
69
|
-
type: (0, _propTypes.oneOf)(['success', 'error', 'tips', 'info']).isRequired
|
|
72
|
+
type: (0, _propTypes.oneOf)(['success', 'error', 'tips', 'info']).isRequired,
|
|
73
|
+
|
|
74
|
+
/* Adds alternative styling for better contrast on certain backgrounds */
|
|
75
|
+
onColoredBg: _propTypes.bool
|
|
70
76
|
};
|
|
71
77
|
var _default = BaseMessage;
|
|
72
78
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-message-box-react",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "SpareBank 1",
|
|
6
6
|
"files": [
|
|
@@ -20,22 +20,16 @@
|
|
|
20
20
|
"build": "ffe-buildtool babel",
|
|
21
21
|
"watch": "ffe-buildtool babel-watch",
|
|
22
22
|
"lint": "eslint src",
|
|
23
|
-
"test": "jest",
|
|
24
|
-
"test:watch": "jest --watch"
|
|
25
|
-
},
|
|
26
|
-
"jest": {
|
|
27
|
-
"setupTestFrameworkScriptFile": "../../test-setup.js"
|
|
23
|
+
"test": "ffe-buildtool jest",
|
|
24
|
+
"test:watch": "ffe-buildtool jest --watch"
|
|
28
25
|
},
|
|
29
26
|
"dependencies": {
|
|
30
|
-
"@sb1/ffe-icons-react": "^7.
|
|
27
|
+
"@sb1/ffe-icons-react": "^7.3.0",
|
|
31
28
|
"classnames": "^2.3.1"
|
|
32
29
|
},
|
|
33
30
|
"devDependencies": {
|
|
34
|
-
"@sb1/ffe-buildtool": "^0.
|
|
35
|
-
"enzyme": "^3.7.0",
|
|
36
|
-
"enzyme-adapter-react-16": "^1.7.0",
|
|
31
|
+
"@sb1/ffe-buildtool": "^0.4.0",
|
|
37
32
|
"eslint": "^5.9.0",
|
|
38
|
-
"jest": "^26.0.0",
|
|
39
33
|
"prop-types": "^15.7.2",
|
|
40
34
|
"react": "^16.9.0",
|
|
41
35
|
"react-addons-test-utils": "^15.6.2",
|
|
@@ -48,5 +42,5 @@
|
|
|
48
42
|
"publishConfig": {
|
|
49
43
|
"access": "public"
|
|
50
44
|
},
|
|
51
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "a5570de7abf831ca6ee16a6b569aebabf6278dbb"
|
|
52
46
|
}
|