@sb1/ffe-message-box-react 10.0.14 → 10.0.15
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/ErrorMessage.js +0 -1
- package/es/InfoMessage.js +0 -1
- package/es/SuccessMessage.js +0 -1
- package/es/TipsMessage.js +15 -5
- package/es/texts.js +18 -18
- package/lib/ErrorMessage.js +0 -1
- package/lib/InfoMessage.js +0 -1
- package/lib/SuccessMessage.js +0 -1
- package/lib/TipsMessage.js +14 -4
- package/lib/texts.js +18 -18
- package/package.json +2 -2
package/es/ErrorMessage.js
CHANGED
|
@@ -17,7 +17,6 @@ var ErrorMessage = function ErrorMessage(props) {
|
|
|
17
17
|
ariaLabel: texts[locale].error.ariaLabel,
|
|
18
18
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
19
19
|
fileUrl: priorityHighIcon,
|
|
20
|
-
ariaLabel: texts[locale].error.icon,
|
|
21
20
|
size: "xl"
|
|
22
21
|
}),
|
|
23
22
|
role: alert ? 'alert' : 'group'
|
package/es/InfoMessage.js
CHANGED
package/es/SuccessMessage.js
CHANGED
package/es/TipsMessage.js
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
|
+
var _excluded = ["locale"];
|
|
1
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
|
+
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
|
+
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; }
|
|
2
5
|
import React from 'react';
|
|
3
|
-
import { node, string } from 'prop-types';
|
|
6
|
+
import { node, oneOf, string } from 'prop-types';
|
|
4
7
|
import { Icon } from '@sb1/ffe-icons-react';
|
|
5
8
|
import BaseMessage from './BaseMessage';
|
|
9
|
+
import texts from './texts';
|
|
6
10
|
var TipsMessage = function TipsMessage(props) {
|
|
11
|
+
var locale = props.locale,
|
|
12
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
7
13
|
var lightbulbIcon = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iNDgiPjxwYXRoIGQ9Ik00ODAtOTYuOTI0cS0zMC45MjMgMC01My4wNzctMjEtMjIuMTUzLTIxLTIzLjY5Mi01MS45MjNoMTUzLjUzOHEtMS41MzkgMzAuOTIzLTIzLjY5MiA1MS45MjMtMjIuMTU0IDIxLTUzLjA3NyAyMVpNMzUxLjA3Ny0yNDEuNDYzcS05LjY2MyAwLTE2LjE3Ny02LjU2Ny02LjUxNS02LjU2Ni02LjUxNS0xNi4zMDd0Ni41MTUtMTYuMTI1cTYuNTE0LTYuMzg0IDE2LjE3Ny02LjM4NGgyNTcuODQ2cTkuNjYzIDAgMTYuMTc3IDYuNTY2IDYuNTE1IDYuNTY3IDYuNTE1IDE2LjMwOCAwIDkuNzQtNi41MTUgMTYuMTI1LTYuNTE0IDYuMzg0LTE2LjE3NyA2LjM4NEgzNTEuMDc3Wm0tMTkuOTk5LTExNnEtNjAuNjE1LTQwLjY5Mi05NS44NDYtMTAwLjM4NHQtMzUuMjMxLTEzNC41MzdxMC0xMTQuNjkyIDgyLjY1NC0xOTcuMzQ1UTM2NS4zMDgtODcyLjM4MyA0ODAtODcyLjM4M3QxOTcuMzQ1IDgyLjY1NHE4Mi42NTQgODIuNjUzIDgyLjY1NCAxOTcuMzQ1IDAgNzQuODQ1LTM0LjkyMyAxMzQuNTM3LTM0LjkyMyA1OS42OTItOTYuMTU0IDEwMC4zODRIMzMxLjA3OFptMTYuMjMtNDUuMzgzaDI2NS43NzFxNDcuNDU5LTMyIDc0LjQ5OC04Mi4wMjkgMjcuMDM4LTUwLjAyOSAyNy4wMzgtMTA3LjUwOSAwLTk3LjA3Ny02OC43NjktMTY1Ljg0NlQ0ODAtODI2Ljk5OXEtOTcuMDc3IDAtMTY1Ljg0NiA2OC43NjlUMjQ1LjM4NS01OTIuNHEwIDU3LjYwNSAyNy4wMzggMTA3LjU3OSAyNy4wMzkgNDkuOTc1IDc0Ljg4NSA4MS45NzVabTEzMi42OTIgMFoiLz48L3N2Zz4=';
|
|
8
14
|
return /*#__PURE__*/React.createElement(BaseMessage, _extends({
|
|
9
15
|
type: "tips",
|
|
10
|
-
|
|
16
|
+
ariaLabel: texts[locale].tip.ariaLabel,
|
|
11
17
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
12
18
|
fileUrl: lightbulbIcon,
|
|
13
|
-
ariaLabel: "Lysp\xE6re",
|
|
14
19
|
size: "xl"
|
|
15
20
|
})
|
|
16
|
-
},
|
|
21
|
+
}, rest));
|
|
22
|
+
};
|
|
23
|
+
TipsMessage.defaultProps = {
|
|
24
|
+
locale: 'nb'
|
|
17
25
|
};
|
|
18
26
|
TipsMessage.propTypes = {
|
|
19
27
|
/** The content of the message box */
|
|
@@ -23,6 +31,8 @@ TipsMessage.propTypes = {
|
|
|
23
31
|
/** The icon to show. Has a default value, but can be overridden */
|
|
24
32
|
icon: node,
|
|
25
33
|
/** An optional title for the message */
|
|
26
|
-
title: node
|
|
34
|
+
title: node,
|
|
35
|
+
/** 'nb', 'nn', or 'en' */
|
|
36
|
+
locale: oneOf(['en', 'nb', 'nn'])
|
|
27
37
|
};
|
|
28
38
|
export default TipsMessage;
|
package/es/texts.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
var nb = {
|
|
2
2
|
error: {
|
|
3
|
-
ariaLabel: 'Feilmelding'
|
|
4
|
-
icon: 'Utropstegn'
|
|
3
|
+
ariaLabel: 'Feilmelding'
|
|
5
4
|
},
|
|
6
5
|
info: {
|
|
7
|
-
ariaLabel: 'Infomelding'
|
|
8
|
-
icon: 'Infotegn'
|
|
6
|
+
ariaLabel: 'Infomelding'
|
|
9
7
|
},
|
|
10
8
|
success: {
|
|
11
|
-
ariaLabel: 'Suksessmelding'
|
|
12
|
-
|
|
9
|
+
ariaLabel: 'Suksessmelding'
|
|
10
|
+
},
|
|
11
|
+
tip: {
|
|
12
|
+
ariaLabel: 'Tipsmelding'
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
var nn = {
|
|
16
16
|
error: {
|
|
17
|
-
ariaLabel: 'Feilmelding'
|
|
18
|
-
icon: 'Utropsteikn'
|
|
17
|
+
ariaLabel: 'Feilmelding'
|
|
19
18
|
},
|
|
20
19
|
info: {
|
|
21
|
-
ariaLabel: 'Infomelding'
|
|
22
|
-
icon: 'Infoteikn'
|
|
20
|
+
ariaLabel: 'Infomelding'
|
|
23
21
|
},
|
|
24
22
|
success: {
|
|
25
|
-
ariaLabel: 'Suksessmelding'
|
|
26
|
-
|
|
23
|
+
ariaLabel: 'Suksessmelding'
|
|
24
|
+
},
|
|
25
|
+
tip: {
|
|
26
|
+
ariaLabel: 'Tipsmelding'
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
var en = {
|
|
30
30
|
error: {
|
|
31
|
-
ariaLabel: 'Error message'
|
|
32
|
-
icon: 'Exclamation mark'
|
|
31
|
+
ariaLabel: 'Error message'
|
|
33
32
|
},
|
|
34
33
|
info: {
|
|
35
|
-
ariaLabel: 'Info message'
|
|
36
|
-
icon: 'Info sign'
|
|
34
|
+
ariaLabel: 'Info message'
|
|
37
35
|
},
|
|
38
36
|
success: {
|
|
39
|
-
ariaLabel: 'Success message'
|
|
40
|
-
|
|
37
|
+
ariaLabel: 'Success message'
|
|
38
|
+
},
|
|
39
|
+
tip: {
|
|
40
|
+
ariaLabel: 'Tip message'
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
export default {
|
package/lib/ErrorMessage.js
CHANGED
|
@@ -24,7 +24,6 @@ var ErrorMessage = function ErrorMessage(props) {
|
|
|
24
24
|
ariaLabel: _texts.default[locale].error.ariaLabel,
|
|
25
25
|
icon: /*#__PURE__*/_react.default.createElement(_ffeIconsReact.Icon, {
|
|
26
26
|
fileUrl: priorityHighIcon,
|
|
27
|
-
ariaLabel: _texts.default[locale].error.icon,
|
|
28
27
|
size: "xl"
|
|
29
28
|
}),
|
|
30
29
|
role: alert ? 'alert' : 'group'
|
package/lib/InfoMessage.js
CHANGED
|
@@ -22,7 +22,6 @@ var InfoMessage = function InfoMessage(_ref) {
|
|
|
22
22
|
type: "info",
|
|
23
23
|
ariaLabel: _texts.default[locale].info.ariaLabel,
|
|
24
24
|
icon: /*#__PURE__*/_react.default.createElement(_ffeIconsReact.Icon, {
|
|
25
|
-
ariaLabel: _texts.default[locale].info.icon,
|
|
26
25
|
fileUrl: infoIcon,
|
|
27
26
|
size: "xl"
|
|
28
27
|
})
|
package/lib/SuccessMessage.js
CHANGED
|
@@ -23,7 +23,6 @@ var SuccessMessage = function SuccessMessage(_ref) {
|
|
|
23
23
|
ariaLabel: _texts.default[locale].success.ariaLabel,
|
|
24
24
|
icon: /*#__PURE__*/_react.default.createElement(_ffeIconsReact.Icon, {
|
|
25
25
|
fileUrl: checkIcon,
|
|
26
|
-
ariaLabel: _texts.default[locale].success.icon,
|
|
27
26
|
size: "xl"
|
|
28
27
|
})
|
|
29
28
|
}, rest));
|
package/lib/TipsMessage.js
CHANGED
|
@@ -8,19 +8,27 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _ffeIconsReact = require("@sb1/ffe-icons-react");
|
|
10
10
|
var _BaseMessage = _interopRequireDefault(require("./BaseMessage"));
|
|
11
|
+
var _texts = _interopRequireDefault(require("./texts"));
|
|
12
|
+
var _excluded = ["locale"];
|
|
11
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
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
|
+
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
|
+
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; }
|
|
13
17
|
var TipsMessage = function TipsMessage(props) {
|
|
18
|
+
var locale = props.locale,
|
|
19
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
14
20
|
var lightbulbIcon = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iNDgiPjxwYXRoIGQ9Ik00ODAtOTYuOTI0cS0zMC45MjMgMC01My4wNzctMjEtMjIuMTUzLTIxLTIzLjY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ariaLabel: _texts.default[locale].tip.ariaLabel,
|
|
18
24
|
icon: /*#__PURE__*/_react.default.createElement(_ffeIconsReact.Icon, {
|
|
19
25
|
fileUrl: lightbulbIcon,
|
|
20
|
-
ariaLabel: "Lysp\xE6re",
|
|
21
26
|
size: "xl"
|
|
22
27
|
})
|
|
23
|
-
},
|
|
28
|
+
}, rest));
|
|
29
|
+
};
|
|
30
|
+
TipsMessage.defaultProps = {
|
|
31
|
+
locale: 'nb'
|
|
24
32
|
};
|
|
25
33
|
TipsMessage.propTypes = {
|
|
26
34
|
/** The content of the message box */
|
|
@@ -30,6 +38,8 @@ TipsMessage.propTypes = {
|
|
|
30
38
|
/** The icon to show. Has a default value, but can be overridden */
|
|
31
39
|
icon: _propTypes.node,
|
|
32
40
|
/** An optional title for the message */
|
|
33
|
-
title: _propTypes.node
|
|
41
|
+
title: _propTypes.node,
|
|
42
|
+
/** 'nb', 'nn', or 'en' */
|
|
43
|
+
locale: (0, _propTypes.oneOf)(['en', 'nb', 'nn'])
|
|
34
44
|
};
|
|
35
45
|
var _default = exports.default = TipsMessage;
|
package/lib/texts.js
CHANGED
|
@@ -6,44 +6,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var nb = {
|
|
8
8
|
error: {
|
|
9
|
-
ariaLabel: 'Feilmelding'
|
|
10
|
-
icon: 'Utropstegn'
|
|
9
|
+
ariaLabel: 'Feilmelding'
|
|
11
10
|
},
|
|
12
11
|
info: {
|
|
13
|
-
ariaLabel: 'Infomelding'
|
|
14
|
-
icon: 'Infotegn'
|
|
12
|
+
ariaLabel: 'Infomelding'
|
|
15
13
|
},
|
|
16
14
|
success: {
|
|
17
|
-
ariaLabel: 'Suksessmelding'
|
|
18
|
-
|
|
15
|
+
ariaLabel: 'Suksessmelding'
|
|
16
|
+
},
|
|
17
|
+
tip: {
|
|
18
|
+
ariaLabel: 'Tipsmelding'
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
var nn = {
|
|
22
22
|
error: {
|
|
23
|
-
ariaLabel: 'Feilmelding'
|
|
24
|
-
icon: 'Utropsteikn'
|
|
23
|
+
ariaLabel: 'Feilmelding'
|
|
25
24
|
},
|
|
26
25
|
info: {
|
|
27
|
-
ariaLabel: 'Infomelding'
|
|
28
|
-
icon: 'Infoteikn'
|
|
26
|
+
ariaLabel: 'Infomelding'
|
|
29
27
|
},
|
|
30
28
|
success: {
|
|
31
|
-
ariaLabel: 'Suksessmelding'
|
|
32
|
-
|
|
29
|
+
ariaLabel: 'Suksessmelding'
|
|
30
|
+
},
|
|
31
|
+
tip: {
|
|
32
|
+
ariaLabel: 'Tipsmelding'
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
var en = {
|
|
36
36
|
error: {
|
|
37
|
-
ariaLabel: 'Error message'
|
|
38
|
-
icon: 'Exclamation mark'
|
|
37
|
+
ariaLabel: 'Error message'
|
|
39
38
|
},
|
|
40
39
|
info: {
|
|
41
|
-
ariaLabel: 'Info message'
|
|
42
|
-
icon: 'Info sign'
|
|
40
|
+
ariaLabel: 'Info message'
|
|
43
41
|
},
|
|
44
42
|
success: {
|
|
45
|
-
ariaLabel: 'Success message'
|
|
46
|
-
|
|
43
|
+
ariaLabel: 'Success message'
|
|
44
|
+
},
|
|
45
|
+
tip: {
|
|
46
|
+
ariaLabel: 'Tip message'
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
var _default = exports.default = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-message-box-react",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "SpareBank 1",
|
|
6
6
|
"files": [
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "a16b7e585429fc416939e2d1d50b6d8a2b050c0b"
|
|
45
45
|
}
|