@sb1/ffe-system-message-react 8.0.33 → 9.0.1
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/README.md +0 -5
- package/es/SystemErrorMessage.js +29 -51
- package/es/SystemInfoMessage.js +29 -26
- package/es/SystemMessage.js +36 -126
- package/es/SystemNewsMessage.js +29 -26
- package/es/SystemSuccessMessage.js +29 -26
- package/es/index.js +4 -5
- package/es/texts.js +40 -44
- package/lib/SystemErrorMessage.js +37 -59
- package/lib/SystemInfoMessage.js +37 -34
- package/lib/SystemMessage.js +64 -133
- package/lib/SystemNewsMessage.js +37 -34
- package/lib/SystemSuccessMessage.js +37 -34
- package/lib/index.js +10 -33
- package/lib/texts.js +42 -49
- package/package.json +8 -8
- package/types/SystemErrorMessage.d.ts +7 -0
- package/types/SystemInfoMessage.d.ts +5 -0
- package/types/SystemMessage.d.ts +15 -0
- package/types/SystemNewsMessage.d.ts +5 -0
- package/types/SystemSuccessMessage.d.ts +5 -0
- package/types/index.d.ts +4 -31
- package/types/texts.d.ts +47 -0
- package/es/index.d.js +0 -1
- package/lib/index.d.js +0 -6
package/lib/texts.js
CHANGED
|
@@ -1,56 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.texts = void 0;
|
|
7
4
|
var nb = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
close: 'Lukk',
|
|
6
|
+
error: {
|
|
7
|
+
ariaLabel: 'Feilmelding',
|
|
8
|
+
},
|
|
9
|
+
info: {
|
|
10
|
+
ariaLabel: 'Infomelding',
|
|
11
|
+
},
|
|
12
|
+
success: {
|
|
13
|
+
ariaLabel: 'Suksessmelding',
|
|
14
|
+
},
|
|
15
|
+
news: {
|
|
16
|
+
ariaLabel: 'Nyhetsmelding',
|
|
17
|
+
},
|
|
21
18
|
};
|
|
22
19
|
var nn = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
close: 'Lukk',
|
|
21
|
+
error: {
|
|
22
|
+
ariaLabel: 'Feilmelding',
|
|
23
|
+
},
|
|
24
|
+
info: {
|
|
25
|
+
ariaLabel: 'Infomelding',
|
|
26
|
+
},
|
|
27
|
+
success: {
|
|
28
|
+
ariaLabel: 'Suksessmelding',
|
|
29
|
+
},
|
|
30
|
+
news: {
|
|
31
|
+
ariaLabel: 'Nyheitsmelding',
|
|
32
|
+
},
|
|
36
33
|
};
|
|
37
34
|
var en = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
close: 'Close',
|
|
36
|
+
error: {
|
|
37
|
+
ariaLabel: 'Error message',
|
|
38
|
+
},
|
|
39
|
+
info: {
|
|
40
|
+
ariaLabel: 'Info message',
|
|
41
|
+
},
|
|
42
|
+
success: {
|
|
43
|
+
ariaLabel: 'Success message',
|
|
44
|
+
},
|
|
45
|
+
news: {
|
|
46
|
+
ariaLabel: 'News message',
|
|
47
|
+
},
|
|
51
48
|
};
|
|
52
|
-
|
|
53
|
-
nb: nb,
|
|
54
|
-
nn: nn,
|
|
55
|
-
en: en
|
|
56
|
-
};
|
|
49
|
+
exports.texts = { nb: nb, nn: nn, en: en };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-system-message-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"description": "SpareBank 1 System Message komponent",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
"url": "ssh://git@github.com:SpareBank1/designsystem.git"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "ffe-buildtool
|
|
20
|
+
"build": "ffe-buildtool tsc",
|
|
21
21
|
"watch": "ffe-buildtool babel-watch",
|
|
22
|
-
"lint": "eslint src",
|
|
23
|
-
"lint:fix": "eslint src --fix",
|
|
22
|
+
"lint": "eslint src --ext ts,tsx",
|
|
23
|
+
"lint:fix": "eslint src --fix --ext ts,tsx",
|
|
24
24
|
"test": "ffe-buildtool jest",
|
|
25
25
|
"test:watch": "ffe-buildtool jest --watch"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sb1/ffe-
|
|
28
|
+
"@sb1/ffe-collapse-react": "^4.0.2",
|
|
29
|
+
"@sb1/ffe-grid-react": "^14.0.0",
|
|
29
30
|
"@sb1/ffe-icons-react": "^10.0.1",
|
|
30
31
|
"@sb1/ffe-system-message": "^8.0.17",
|
|
31
|
-
"classnames": "^2.3.1"
|
|
32
|
-
"prop-types": "^15.7.2"
|
|
32
|
+
"classnames": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@sb1/ffe-buildtool": "^0.6.1",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "f60e155135540d2dd5b2b8cd0ac379c2a2dcb09d"
|
|
46
46
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SystemMessageProps } from './SystemMessage';
|
|
3
|
+
export interface SystemErrorMessageProps extends Omit<SystemMessageProps, 'modifier'> {
|
|
4
|
+
/** When false, role is not set to alert, avoids message from being read up immediately after page load. Default value is true. */
|
|
5
|
+
alert?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const SystemErrorMessage: React.FC<SystemErrorMessageProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SystemMessageProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
icon?: React.ReactNode;
|
|
4
|
+
locale?: 'en' | 'nb' | 'nn';
|
|
5
|
+
/** Callback for when the system message has been closed (after animation ends) */
|
|
6
|
+
onCloseRest?: () => void;
|
|
7
|
+
/** Adds alternative styling for better contrast on certain backgrounds */
|
|
8
|
+
onColoredBg?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The type of system message. Used internally only-
|
|
11
|
+
* @ignore
|
|
12
|
+
**/
|
|
13
|
+
modifier: 'error' | 'info' | 'success' | 'news';
|
|
14
|
+
}
|
|
15
|
+
export declare const SystemMessage: React.FC<SystemMessageProps>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
animationLengthMs?: number;
|
|
6
|
-
icon?: React.ReactNode;
|
|
7
|
-
locale?: 'en' | 'nb' | 'nn';
|
|
8
|
-
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
9
|
-
onColoredBg?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface SystemErrorMessageProps extends SystemMessageProps {
|
|
13
|
-
alert?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare class SystemErrorMessage extends React.Component<
|
|
17
|
-
SystemErrorMessageProps,
|
|
18
|
-
any
|
|
19
|
-
> {}
|
|
20
|
-
declare class SystemInfoMessage extends React.Component<
|
|
21
|
-
SystemMessageProps,
|
|
22
|
-
any
|
|
23
|
-
> {}
|
|
24
|
-
declare class SystemNewsMessage extends React.Component<
|
|
25
|
-
SystemMessageProps,
|
|
26
|
-
any
|
|
27
|
-
> {}
|
|
28
|
-
declare class SystemSuccessMessage extends React.Component<
|
|
29
|
-
SystemMessageProps,
|
|
30
|
-
any
|
|
31
|
-
> {}
|
|
1
|
+
export { SystemErrorMessage, SystemErrorMessageProps, } from './SystemErrorMessage';
|
|
2
|
+
export { SystemInfoMessage, SystemInfoMessageProps } from './SystemInfoMessage';
|
|
3
|
+
export { SystemNewsMessage, SystemNewsMessageProps } from './SystemNewsMessage';
|
|
4
|
+
export { SystemSuccessMessage, SystemSuccessMessageProps, } from './SystemSuccessMessage';
|
package/types/texts.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const texts: {
|
|
2
|
+
nb: {
|
|
3
|
+
readonly close: "Lukk";
|
|
4
|
+
readonly error: {
|
|
5
|
+
readonly ariaLabel: "Feilmelding";
|
|
6
|
+
};
|
|
7
|
+
readonly info: {
|
|
8
|
+
readonly ariaLabel: "Infomelding";
|
|
9
|
+
};
|
|
10
|
+
readonly success: {
|
|
11
|
+
readonly ariaLabel: "Suksessmelding";
|
|
12
|
+
};
|
|
13
|
+
readonly news: {
|
|
14
|
+
readonly ariaLabel: "Nyhetsmelding";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
nn: {
|
|
18
|
+
readonly close: "Lukk";
|
|
19
|
+
readonly error: {
|
|
20
|
+
readonly ariaLabel: "Feilmelding";
|
|
21
|
+
};
|
|
22
|
+
readonly info: {
|
|
23
|
+
readonly ariaLabel: "Infomelding";
|
|
24
|
+
};
|
|
25
|
+
readonly success: {
|
|
26
|
+
readonly ariaLabel: "Suksessmelding";
|
|
27
|
+
};
|
|
28
|
+
readonly news: {
|
|
29
|
+
readonly ariaLabel: "Nyheitsmelding";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
en: {
|
|
33
|
+
readonly close: "Close";
|
|
34
|
+
readonly error: {
|
|
35
|
+
readonly ariaLabel: "Error message";
|
|
36
|
+
};
|
|
37
|
+
readonly info: {
|
|
38
|
+
readonly ariaLabel: "Info message";
|
|
39
|
+
};
|
|
40
|
+
readonly success: {
|
|
41
|
+
readonly ariaLabel: "Success message";
|
|
42
|
+
};
|
|
43
|
+
readonly news: {
|
|
44
|
+
readonly ariaLabel: "News message";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
package/es/index.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
package/lib/index.d.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
var React = _interopRequireWildcard(require("react"));
|
|
5
|
-
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); }
|
|
6
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|