@sb1/ffe-system-message-react 8.0.15 → 8.0.16
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/SystemErrorMessage.js +6 -3
- package/es/SystemInfoMessage.js +20 -5
- package/es/SystemMessage.js +2 -1
- package/es/SystemNewsMessage.js +20 -5
- package/es/SystemSuccessMessage.js +20 -5
- package/es/texts.js +62 -0
- package/lib/SystemErrorMessage.js +6 -3
- package/lib/SystemInfoMessage.js +20 -5
- package/lib/SystemMessage.js +2 -1
- package/lib/SystemNewsMessage.js +20 -5
- package/lib/SystemSuccessMessage.js +20 -5
- package/lib/texts.js +68 -0
- package/package.json +2 -2
package/es/SystemErrorMessage.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
var _excluded = ["alert"];
|
|
1
|
+
var _excluded = ["alert", "locale"];
|
|
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; }
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { func, string, number, node, oneOf, bool } from 'prop-types';
|
|
7
7
|
import { Icon } from '@sb1/ffe-icons-react';
|
|
8
|
+
import texts from './texts';
|
|
8
9
|
import SystemMessage from './SystemMessage';
|
|
9
10
|
export default function SystemErrorMessage(props) {
|
|
10
11
|
var alert = props.alert,
|
|
12
|
+
locale = props.locale,
|
|
11
13
|
rest = _objectWithoutProperties(props, _excluded);
|
|
12
14
|
var priorityHighIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTE4Ny4wOHEtMjEuNTM3IDAtMzYuNjYyLTE1LjMzN3QtMTUuMTI1LTM2Ljg3NHEwLTIxLjUzNyAxNS4zMzctMzYuNjYyIDE1LjMzNy0xNS4xMjQgMzYuODc0LTE1LjEyNCAyMS41MzcgMCAzNi42NjIgMTUuMzM3dDE1LjEyNSAzNi44NzRxMCAyMS41MzctMTUuMzM3IDM2LjY2MS0xNS4zMzcgMTUuMTI1LTM2Ljg3NCAxNS4xMjVabS0uMDYyLTE5Ni4xNTFxLTE5LjM0MSAwLTMyLjg0LTEzLjcwOS0xMy41LTEzLjcwOS0xMy41LTMyLjk2di0zMTYuNjg1cTAtMTkuMjUxIDEzLjc3NC0zMi43OTQgMTMuNzczLTEzLjU0MiAzMy4xMTQtMTMuNTQyIDE5LjM0MSAwIDMyLjg0IDEzLjcwOSAxMy41IDEzLjcwOSAxMy41IDMyLjk2djMxNi42ODVxMCAxOS4yNTEtMTMuNzc0IDMyLjc5NC0xMy43NzMgMTMuNTQyLTMzLjExNCAxMy41NDJaIi8+PC9zdmc+';
|
|
13
15
|
return /*#__PURE__*/React.createElement(SystemMessage, _extends({
|
|
14
16
|
modifier: "error",
|
|
15
|
-
"aria-label":
|
|
17
|
+
"aria-label": texts[locale].error.ariaLabel,
|
|
18
|
+
locale: locale,
|
|
16
19
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
17
|
-
ariaLabel:
|
|
20
|
+
ariaLabel: texts[locale].error.icon,
|
|
18
21
|
fileUrl: priorityHighIconSmall,
|
|
19
22
|
size: "sm"
|
|
20
23
|
}),
|
package/es/SystemInfoMessage.js
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
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
6
|
import { Icon } from '@sb1/ffe-icons-react';
|
|
7
|
+
import texts from './texts';
|
|
4
8
|
import SystemMessage from './SystemMessage';
|
|
5
|
-
|
|
9
|
+
import { oneOf } from 'prop-types';
|
|
10
|
+
export default function SystemInfoMessage(_ref) {
|
|
11
|
+
var locale = _ref.locale,
|
|
12
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
6
13
|
var infoIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTY3MnEtMjUuOTQyIDAtNDMuODY0LTE4LjEzNS0xNy45MjMtMTguMTM2LTE3LjkyMy00NC4wNzd0MTguMTM1LTQzLjg2NHExOC4xMzUtMTcuOTIzIDQ0LjA3Ni0xNy45MjMgMjUuOTQyIDAgNDMuODY0IDE4LjEzNiAxNy45MjMgMTguMTM1IDE3LjkyMyA0NC4wNzZ0LTE4LjEzNSA0My44NjRRNTA1LjcyOS02NzIgNDc5Ljc4OC02NzJabS4yNTcgNTA3Ljk5OXEtMjAuODE0IDAtMzUuNDI5LTE0LjU4NC0xNC42MTUtMTQuNTgzLTE0LjYxNS0zNS40MTZ2LTI5Ni42MTRxMC0yMC44MzMgMTQuNTctMzUuNDE2IDE0LjU3LTE0LjU4MyAzNS4zODQtMTQuNTgzdDM1LjQyOSAxNC41ODNxMTQuNjE1IDE0LjU4MyAxNC42MTUgMzUuNDE2djI5Ni42MTRxMCAyMC44MzMtMTQuNTcgMzUuNDE2LTE0LjU3IDE0LjU4NC0zNS4zODQgMTQuNTg0WiIvPjwvc3ZnPg==';
|
|
7
14
|
return /*#__PURE__*/React.createElement(SystemMessage, _extends({
|
|
8
15
|
modifier: "info",
|
|
9
|
-
"aria-label":
|
|
16
|
+
"aria-label": texts[locale].info.ariaLabel,
|
|
17
|
+
locale: locale,
|
|
10
18
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
11
|
-
ariaLabel:
|
|
19
|
+
ariaLabel: texts[locale].info.icon,
|
|
12
20
|
size: "sm",
|
|
13
21
|
fileUrl: infoIconSmall
|
|
14
22
|
})
|
|
15
|
-
},
|
|
16
|
-
}
|
|
23
|
+
}, rest));
|
|
24
|
+
}
|
|
25
|
+
SystemInfoMessage.defaultProps = {
|
|
26
|
+
locale: 'nb'
|
|
27
|
+
};
|
|
28
|
+
SystemInfoMessage.propTypes = {
|
|
29
|
+
/** 'nb', 'nn', or 'en' */
|
|
30
|
+
locale: oneOf(['en', 'nb', 'nn'])
|
|
31
|
+
};
|
package/es/SystemMessage.js
CHANGED
|
@@ -22,6 +22,7 @@ import React, { Component } from 'react';
|
|
|
22
22
|
import { func, string, number, node, oneOf, bool } from 'prop-types';
|
|
23
23
|
import classNames from 'classnames';
|
|
24
24
|
import { Icon } from '@sb1/ffe-icons-react';
|
|
25
|
+
import texts from './texts';
|
|
25
26
|
var SystemMessage = /*#__PURE__*/function (_Component) {
|
|
26
27
|
_inherits(SystemMessage, _Component);
|
|
27
28
|
function SystemMessage() {
|
|
@@ -89,7 +90,7 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
|
|
|
89
90
|
}, icon && /*#__PURE__*/React.cloneElement(icon, _objectSpread({}, icon.props))), /*#__PURE__*/React.createElement("p", {
|
|
90
91
|
className: "ffe-system-message__content"
|
|
91
92
|
}, children), /*#__PURE__*/React.createElement("button", {
|
|
92
|
-
"aria-label": locale
|
|
93
|
+
"aria-label": texts[locale].close,
|
|
93
94
|
className: "ffe-system-message__close",
|
|
94
95
|
onClick: this.close,
|
|
95
96
|
type: "button"
|
package/es/SystemNewsMessage.js
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
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
6
|
import { Icon } from '@sb1/ffe-icons-react';
|
|
7
|
+
import texts from './texts';
|
|
4
8
|
import SystemMessage from './SystemMessage';
|
|
5
|
-
|
|
9
|
+
import { oneOf } from 'prop-types';
|
|
10
|
+
export default function SystemNewsMessage(_ref) {
|
|
11
|
+
var locale = _ref.locale,
|
|
12
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
6
13
|
var infoIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTY3MnEtMjUuOTQyIDAtNDMuODY0LTE4LjEzNS0xNy45MjMtMTguMTM2LTE3LjkyMy00NC4wNzd0MTguMTM1LTQzLjg2NHExOC4xMzUtMTcuOTIzIDQ0LjA3Ni0xNy45MjMgMjUuOTQyIDAgNDMuODY0IDE4LjEzNiAxNy45MjMgMTguMTM1IDE3LjkyMyA0NC4wNzZ0LTE4LjEzNSA0My44NjRRNTA1LjcyOS02NzIgNDc5Ljc4OC02NzJabS4yNTcgNTA3Ljk5OXEtMjAuODE0IDAtMzUuNDI5LTE0LjU4NC0xNC42MTUtMTQuNTgzLTE0LjYxNS0zNS40MTZ2LTI5Ni42MTRxMC0yMC44MzMgMTQuNTctMzUuNDE2IDE0LjU3LTE0LjU4MyAzNS4zODQtMTQuNTgzdDM1LjQyOSAxNC41ODNxMTQuNjE1IDE0LjU4MyAxNC42MTUgMzUuNDE2djI5Ni42MTRxMCAyMC44MzMtMTQuNTcgMzUuNDE2LTE0LjU3IDE0LjU4NC0zNS4zODQgMTQuNTg0WiIvPjwvc3ZnPg==';
|
|
7
14
|
return /*#__PURE__*/React.createElement(SystemMessage, _extends({
|
|
8
15
|
modifier: "news",
|
|
9
|
-
"aria-label":
|
|
16
|
+
"aria-label": texts[locale].news.ariaLabel,
|
|
17
|
+
locale: locale,
|
|
10
18
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
11
|
-
ariaLabel:
|
|
19
|
+
ariaLabel: texts[locale].news.icon,
|
|
12
20
|
size: "sm",
|
|
13
21
|
fileUrl: infoIconSmall
|
|
14
22
|
})
|
|
15
|
-
},
|
|
16
|
-
}
|
|
23
|
+
}, rest));
|
|
24
|
+
}
|
|
25
|
+
SystemNewsMessage.defaultProps = {
|
|
26
|
+
locale: 'nb'
|
|
27
|
+
};
|
|
28
|
+
SystemNewsMessage.propTypes = {
|
|
29
|
+
/** 'nb', 'nn', or 'en' */
|
|
30
|
+
locale: oneOf(['en', 'nb', 'nn'])
|
|
31
|
+
};
|
|
@@ -1,16 +1,31 @@
|
|
|
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
6
|
import { Icon } from '@sb1/ffe-icons-react';
|
|
7
|
+
import texts from './texts';
|
|
4
8
|
import SystemMessage from './SystemMessage';
|
|
5
|
-
|
|
9
|
+
import { oneOf } from 'prop-types';
|
|
10
|
+
export default function SystemSuccessMessage(_ref) {
|
|
11
|
+
var locale = _ref.locale,
|
|
12
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
6
13
|
var checkIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Im0zOTUtMzcyLjM4NCAyNzAuNTM5LTI2OS41MzhxNy45MjMtNy45MjMgMTcuNjkyLTcuNjE2IDkuNzY5LjMwOCAxOC4wNzYgOC42MTYgOC4zMDggOC4zMDcgOC4zMDggMTcuODg0IDAgOS41NzYtOC4zMDggMTcuODg0bC0yODMgMjgyLjk5OXEtOS44NDYgOS44NDYtMjIuODA3IDkuODQ2LTEyLjk2MSAwLTIyLjgwNy05Ljg0NmwtMTE0LTExMy45OTlxLTcuOTIzLTcuOTIzLTguMzA4LTE3LjY5Mi0uMzg0LTkuNzY5IDcuOTIzLTE4LjA3NiA4LjMwOC04LjMwOCAxNy44ODQtOC4zMDggOS41NzcgMCAxNy44ODQgOC4zMDhMMzk1LTM3Mi4zODRaIi8+PC9zdmc+';
|
|
7
14
|
return /*#__PURE__*/React.createElement(SystemMessage, _extends({
|
|
8
15
|
modifier: "success",
|
|
9
|
-
"aria-label":
|
|
16
|
+
"aria-label": texts[locale].success.ariaLabel,
|
|
17
|
+
locale: locale,
|
|
10
18
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
11
|
-
ariaLabel:
|
|
19
|
+
ariaLabel: texts[locale].success.icon,
|
|
12
20
|
size: "sm",
|
|
13
21
|
fileUrl: checkIconSmall
|
|
14
22
|
})
|
|
15
|
-
},
|
|
16
|
-
}
|
|
23
|
+
}, rest));
|
|
24
|
+
}
|
|
25
|
+
SystemSuccessMessage.defaultProps = {
|
|
26
|
+
locale: 'nb'
|
|
27
|
+
};
|
|
28
|
+
SystemSuccessMessage.propTypes = {
|
|
29
|
+
/** 'nb', 'nn', or 'en' */
|
|
30
|
+
locale: oneOf(['en', 'nb', 'nn'])
|
|
31
|
+
};
|
package/es/texts.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var nb = {
|
|
2
|
+
close: 'Lukk',
|
|
3
|
+
error: {
|
|
4
|
+
ariaLabel: 'Feilmelding',
|
|
5
|
+
icon: 'Utropstegn'
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
ariaLabel: 'Infomelding',
|
|
9
|
+
icon: 'Infotegn'
|
|
10
|
+
},
|
|
11
|
+
success: {
|
|
12
|
+
ariaLabel: 'Suksessmelding',
|
|
13
|
+
icon: 'Hake'
|
|
14
|
+
},
|
|
15
|
+
news: {
|
|
16
|
+
ariaLabel: 'Nyhetsmelding',
|
|
17
|
+
icon: 'Infotegn'
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var nn = {
|
|
21
|
+
close: 'Lukk',
|
|
22
|
+
error: {
|
|
23
|
+
ariaLabel: 'Feilmelding',
|
|
24
|
+
icon: 'Utropsteikn'
|
|
25
|
+
},
|
|
26
|
+
info: {
|
|
27
|
+
ariaLabel: 'Infomelding',
|
|
28
|
+
icon: 'Infoteikn'
|
|
29
|
+
},
|
|
30
|
+
success: {
|
|
31
|
+
ariaLabel: 'Suksessmelding',
|
|
32
|
+
icon: 'Hake'
|
|
33
|
+
},
|
|
34
|
+
news: {
|
|
35
|
+
ariaLabel: 'Nyheitsmelding',
|
|
36
|
+
icon: 'Infoteikn'
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var en = {
|
|
40
|
+
close: 'Close',
|
|
41
|
+
error: {
|
|
42
|
+
ariaLabel: 'Error message',
|
|
43
|
+
icon: 'Exclamation mark'
|
|
44
|
+
},
|
|
45
|
+
info: {
|
|
46
|
+
ariaLabel: 'Info message',
|
|
47
|
+
icon: 'Info sign'
|
|
48
|
+
},
|
|
49
|
+
success: {
|
|
50
|
+
ariaLabel: 'Success message',
|
|
51
|
+
icon: 'Check mark'
|
|
52
|
+
},
|
|
53
|
+
news: {
|
|
54
|
+
ariaLabel: 'News message',
|
|
55
|
+
icon: 'Info sign'
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export default {
|
|
59
|
+
nb: nb,
|
|
60
|
+
nn: nn,
|
|
61
|
+
en: en
|
|
62
|
+
};
|
|
@@ -7,21 +7,24 @@ exports.default = SystemErrorMessage;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _ffeIconsReact = require("@sb1/ffe-icons-react");
|
|
10
|
+
var _texts = _interopRequireDefault(require("./texts"));
|
|
10
11
|
var _SystemMessage = _interopRequireDefault(require("./SystemMessage"));
|
|
11
|
-
var _excluded = ["alert"];
|
|
12
|
+
var _excluded = ["alert", "locale"];
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
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); }
|
|
14
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; }
|
|
15
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; }
|
|
16
17
|
function SystemErrorMessage(props) {
|
|
17
18
|
var alert = props.alert,
|
|
19
|
+
locale = props.locale,
|
|
18
20
|
rest = _objectWithoutProperties(props, _excluded);
|
|
19
21
|
var priorityHighIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTE4Ny4wOHEtMjEuNTM3IDAtMzYuNjYyLTE1LjMzN3QtMTUuMTI1LTM2Ljg3NHEwLTIxLjUzNyAxNS4zMzctMzYuNjYyIDE1LjMzNy0xNS4xMjQgMzYuODc0LTE1LjEyNCAyMS41MzcgMCAzNi42NjIgMTUuMzM3dDE1LjEyNSAzNi44NzRxMCAyMS41MzctMTUuMzM3IDM2LjY2MS0xNS4zMzcgMTUuMTI1LTM2Ljg3NCAxNS4xMjVabS0uMDYyLTE5Ni4xNTFxLTE5LjM0MSAwLTMyLjg0LTEzLjcwOS0xMy41LTEzLjcwOS0xMy41LTMyLjk2di0zMTYuNjg1cTAtMTkuMjUxIDEzLjc3NC0zMi43OTQgMTMuNzczLTEzLjU0MiAzMy4xMTQtMTMuNTQyIDE5LjM0MSAwIDMyLjg0IDEzLjcwOSAxMy41IDEzLjcwOSAxMy41IDMyLjk2djMxNi42ODVxMCAxOS4yNTEtMTMuNzc0IDMyLjc5NC0xMy43NzMgMTMuNTQyLTMzLjExNCAxMy41NDJaIi8+PC9zdmc+';
|
|
20
22
|
return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
|
|
21
23
|
modifier: "error",
|
|
22
|
-
"aria-label":
|
|
24
|
+
"aria-label": _texts.default[locale].error.ariaLabel,
|
|
25
|
+
locale: locale,
|
|
23
26
|
icon: /*#__PURE__*/_react.default.createElement(_ffeIconsReact.Icon, {
|
|
24
|
-
ariaLabel:
|
|
27
|
+
ariaLabel: _texts.default[locale].error.icon,
|
|
25
28
|
fileUrl: priorityHighIconSmall,
|
|
26
29
|
size: "sm"
|
|
27
30
|
}),
|
package/lib/SystemInfoMessage.js
CHANGED
|
@@ -6,18 +6,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = SystemInfoMessage;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _ffeIconsReact = require("@sb1/ffe-icons-react");
|
|
9
|
+
var _texts = _interopRequireDefault(require("./texts"));
|
|
9
10
|
var _SystemMessage = _interopRequireDefault(require("./SystemMessage"));
|
|
11
|
+
var _propTypes = require("prop-types");
|
|
12
|
+
var _excluded = ["locale"];
|
|
10
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
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); }
|
|
12
|
-
function
|
|
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; }
|
|
17
|
+
function SystemInfoMessage(_ref) {
|
|
18
|
+
var locale = _ref.locale,
|
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
13
20
|
var infoIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTY3MnEtMjUuOTQyIDAtNDMuODY0LTE4LjEzNS0xNy45MjMtMTguMTM2LTE3LjkyMy00NC4wNzd0MTguMTM1LTQzLjg2NHExOC4xMzUtMTcuOTIzIDQ0LjA3Ni0xNy45MjMgMjUuOTQyIDAgNDMuODY0IDE4LjEzNiAxNy45MjMgMTguMTM1IDE3LjkyMyA0NC4wNzZ0LTE4LjEzNSA0My44NjRRNTA1LjcyOS02NzIgNDc5Ljc4OC02NzJabS4yNTcgNTA3Ljk5OXEtMjAuODE0IDAtMzUuNDI5LTE0LjU4NC0xNC42MTUtMTQuNTgzLTE0LjYxNS0zNS40MTZ2LTI5Ni42MTRxMC0yMC44MzMgMTQuNTctMzUuNDE2IDE0LjU3LTE0LjU4MyAzNS4zODQtMTQuNTgzdDM1LjQyOSAxNC41ODNxMTQuNjE1IDE0LjU4MyAxNC42MTUgMzUuNDE2djI5Ni42MTRxMCAyMC44MzMtMTQuNTcgMzUuNDE2LTE0LjU3IDE0LjU4NC0zNS4zODQgMTQuNTg0WiIvPjwvc3ZnPg==';
|
|
14
21
|
return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
|
|
15
22
|
modifier: "info",
|
|
16
|
-
"aria-label":
|
|
23
|
+
"aria-label": _texts.default[locale].info.ariaLabel,
|
|
24
|
+
locale: locale,
|
|
17
25
|
icon: /*#__PURE__*/_react.default.createElement(_ffeIconsReact.Icon, {
|
|
18
|
-
ariaLabel:
|
|
26
|
+
ariaLabel: _texts.default[locale].info.icon,
|
|
19
27
|
size: "sm",
|
|
20
28
|
fileUrl: infoIconSmall
|
|
21
29
|
})
|
|
22
|
-
},
|
|
23
|
-
}
|
|
30
|
+
}, rest));
|
|
31
|
+
}
|
|
32
|
+
SystemInfoMessage.defaultProps = {
|
|
33
|
+
locale: 'nb'
|
|
34
|
+
};
|
|
35
|
+
SystemInfoMessage.propTypes = {
|
|
36
|
+
/** 'nb', 'nn', or 'en' */
|
|
37
|
+
locale: (0, _propTypes.oneOf)(['en', 'nb', 'nn'])
|
|
38
|
+
};
|
package/lib/SystemMessage.js
CHANGED
|
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _propTypes = require("prop-types");
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _ffeIconsReact = require("@sb1/ffe-icons-react");
|
|
12
|
+
var _texts = _interopRequireDefault(require("./texts"));
|
|
12
13
|
var _excluded = ["animationLengthMs", "children", "className", "icon", "locale", "modifier", "onColoredBg"];
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -98,7 +99,7 @@ var SystemMessage = /*#__PURE__*/function (_Component) {
|
|
|
98
99
|
}, icon && /*#__PURE__*/_react.default.cloneElement(icon, _objectSpread({}, icon.props))), /*#__PURE__*/_react.default.createElement("p", {
|
|
99
100
|
className: "ffe-system-message__content"
|
|
100
101
|
}, children), /*#__PURE__*/_react.default.createElement("button", {
|
|
101
|
-
"aria-label": locale
|
|
102
|
+
"aria-label": _texts.default[locale].close,
|
|
102
103
|
className: "ffe-system-message__close",
|
|
103
104
|
onClick: this.close,
|
|
104
105
|
type: "button"
|
package/lib/SystemNewsMessage.js
CHANGED
|
@@ -6,18 +6,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = SystemNewsMessage;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _ffeIconsReact = require("@sb1/ffe-icons-react");
|
|
9
|
+
var _texts = _interopRequireDefault(require("./texts"));
|
|
9
10
|
var _SystemMessage = _interopRequireDefault(require("./SystemMessage"));
|
|
11
|
+
var _propTypes = require("prop-types");
|
|
12
|
+
var _excluded = ["locale"];
|
|
10
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
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); }
|
|
12
|
-
function
|
|
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; }
|
|
17
|
+
function SystemNewsMessage(_ref) {
|
|
18
|
+
var locale = _ref.locale,
|
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
13
20
|
var infoIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00NzkuNzg4LTY3MnEtMjUuOTQyIDAtNDMuODY0LTE4LjEzNS0xNy45MjMtMTguMTM2LTE3LjkyMy00NC4wNzd0MTguMTM1LTQzLjg2NHExOC4xMzUtMTcuOTIzIDQ0LjA3Ni0xNy45MjMgMjUuOTQyIDAgNDMuODY0IDE4LjEzNiAxNy45MjMgMTguMTM1IDE3LjkyMyA0NC4wNzZ0LTE4LjEzNSA0My44NjRRNTA1LjcyOS02NzIgNDc5Ljc4OC02NzJabS4yNTcgNTA3Ljk5OXEtMjAuODE0IDAtMzUuNDI5LTE0LjU4NC0xNC42MTUtMTQuNTgzLTE0LjYxNS0zNS40MTZ2LTI5Ni42MTRxMC0yMC44MzMgMTQuNTctMzUuNDE2IDE0LjU3LTE0LjU4MyAzNS4zODQtMTQuNTgzdDM1LjQyOSAxNC41ODNxMTQuNjE1IDE0LjU4MyAxNC42MTUgMzUuNDE2djI5Ni42MTRxMCAyMC44MzMtMTQuNTcgMzUuNDE2LTE0LjU3IDE0LjU4NC0zNS4zODQgMTQuNTg0WiIvPjwvc3ZnPg==';
|
|
14
21
|
return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
|
|
15
22
|
modifier: "news",
|
|
16
|
-
"aria-label":
|
|
23
|
+
"aria-label": _texts.default[locale].news.ariaLabel,
|
|
24
|
+
locale: locale,
|
|
17
25
|
icon: /*#__PURE__*/_react.default.createElement(_ffeIconsReact.Icon, {
|
|
18
|
-
ariaLabel:
|
|
26
|
+
ariaLabel: _texts.default[locale].news.icon,
|
|
19
27
|
size: "sm",
|
|
20
28
|
fileUrl: infoIconSmall
|
|
21
29
|
})
|
|
22
|
-
},
|
|
23
|
-
}
|
|
30
|
+
}, rest));
|
|
31
|
+
}
|
|
32
|
+
SystemNewsMessage.defaultProps = {
|
|
33
|
+
locale: 'nb'
|
|
34
|
+
};
|
|
35
|
+
SystemNewsMessage.propTypes = {
|
|
36
|
+
/** 'nb', 'nn', or 'en' */
|
|
37
|
+
locale: (0, _propTypes.oneOf)(['en', 'nb', 'nn'])
|
|
38
|
+
};
|
|
@@ -6,18 +6,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = SystemSuccessMessage;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _ffeIconsReact = require("@sb1/ffe-icons-react");
|
|
9
|
+
var _texts = _interopRequireDefault(require("./texts"));
|
|
9
10
|
var _SystemMessage = _interopRequireDefault(require("./SystemMessage"));
|
|
11
|
+
var _propTypes = require("prop-types");
|
|
12
|
+
var _excluded = ["locale"];
|
|
10
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
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); }
|
|
12
|
-
function
|
|
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; }
|
|
17
|
+
function SystemSuccessMessage(_ref) {
|
|
18
|
+
var locale = _ref.locale,
|
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
13
20
|
var checkIconSmall = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Im0zOTUtMzcyLjM4NCAyNzAuNTM5LTI2OS41MzhxNy45MjMtNy45MjMgMTcuNjkyLTcuNjE2IDkuNzY5LjMwOCAxOC4wNzYgOC42MTYgOC4zMDggOC4zMDcgOC4zMDggMTcuODg0IDAgOS41NzYtOC4zMDggMTcuODg0bC0yODMgMjgyLjk5OXEtOS44NDYgOS44NDYtMjIuODA3IDkuODQ2LTEyLjk2MSAwLTIyLjgwNy05Ljg0NmwtMTE0LTExMy45OTlxLTcuOTIzLTcuOTIzLTguMzA4LTE3LjY5Mi0uMzg0LTkuNzY5IDcuOTIzLTE4LjA3NiA4LjMwOC04LjMwOCAxNy44ODQtOC4zMDggOS41NzcgMCAxNy44ODQgOC4zMDhMMzk1LTM3Mi4zODRaIi8+PC9zdmc+';
|
|
14
21
|
return /*#__PURE__*/_react.default.createElement(_SystemMessage.default, _extends({
|
|
15
22
|
modifier: "success",
|
|
16
|
-
"aria-label":
|
|
23
|
+
"aria-label": _texts.default[locale].success.ariaLabel,
|
|
24
|
+
locale: locale,
|
|
17
25
|
icon: /*#__PURE__*/_react.default.createElement(_ffeIconsReact.Icon, {
|
|
18
|
-
ariaLabel:
|
|
26
|
+
ariaLabel: _texts.default[locale].success.icon,
|
|
19
27
|
size: "sm",
|
|
20
28
|
fileUrl: checkIconSmall
|
|
21
29
|
})
|
|
22
|
-
},
|
|
23
|
-
}
|
|
30
|
+
}, rest));
|
|
31
|
+
}
|
|
32
|
+
SystemSuccessMessage.defaultProps = {
|
|
33
|
+
locale: 'nb'
|
|
34
|
+
};
|
|
35
|
+
SystemSuccessMessage.propTypes = {
|
|
36
|
+
/** 'nb', 'nn', or 'en' */
|
|
37
|
+
locale: (0, _propTypes.oneOf)(['en', 'nb', 'nn'])
|
|
38
|
+
};
|
package/lib/texts.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var nb = {
|
|
8
|
+
close: 'Lukk',
|
|
9
|
+
error: {
|
|
10
|
+
ariaLabel: 'Feilmelding',
|
|
11
|
+
icon: 'Utropstegn'
|
|
12
|
+
},
|
|
13
|
+
info: {
|
|
14
|
+
ariaLabel: 'Infomelding',
|
|
15
|
+
icon: 'Infotegn'
|
|
16
|
+
},
|
|
17
|
+
success: {
|
|
18
|
+
ariaLabel: 'Suksessmelding',
|
|
19
|
+
icon: 'Hake'
|
|
20
|
+
},
|
|
21
|
+
news: {
|
|
22
|
+
ariaLabel: 'Nyhetsmelding',
|
|
23
|
+
icon: 'Infotegn'
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var nn = {
|
|
27
|
+
close: 'Lukk',
|
|
28
|
+
error: {
|
|
29
|
+
ariaLabel: 'Feilmelding',
|
|
30
|
+
icon: 'Utropsteikn'
|
|
31
|
+
},
|
|
32
|
+
info: {
|
|
33
|
+
ariaLabel: 'Infomelding',
|
|
34
|
+
icon: 'Infoteikn'
|
|
35
|
+
},
|
|
36
|
+
success: {
|
|
37
|
+
ariaLabel: 'Suksessmelding',
|
|
38
|
+
icon: 'Hake'
|
|
39
|
+
},
|
|
40
|
+
news: {
|
|
41
|
+
ariaLabel: 'Nyheitsmelding',
|
|
42
|
+
icon: 'Infoteikn'
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var en = {
|
|
46
|
+
close: 'Close',
|
|
47
|
+
error: {
|
|
48
|
+
ariaLabel: 'Error message',
|
|
49
|
+
icon: 'Exclamation mark'
|
|
50
|
+
},
|
|
51
|
+
info: {
|
|
52
|
+
ariaLabel: 'Info message',
|
|
53
|
+
icon: 'Info sign'
|
|
54
|
+
},
|
|
55
|
+
success: {
|
|
56
|
+
ariaLabel: 'Success message',
|
|
57
|
+
icon: 'Check mark'
|
|
58
|
+
},
|
|
59
|
+
news: {
|
|
60
|
+
ariaLabel: 'News message',
|
|
61
|
+
icon: 'Info sign'
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var _default = exports.default = {
|
|
65
|
+
nb: nb,
|
|
66
|
+
nn: nn,
|
|
67
|
+
en: en
|
|
68
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-system-message-react",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.16",
|
|
4
4
|
"description": "SpareBank 1 System Message komponent",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "6fac635d56e4bec7be541c6381b87dd4e6e213ee"
|
|
45
45
|
}
|