@sphereon/ui-components.core 0.1.1 → 0.1.2-next.12
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/dist/index.js +5 -25
- package/dist/localization/Localization.js +17 -23
- package/dist/localization/translations/en.json +3 -1
- package/dist/localization/translations/nl.json +3 -1
- package/dist/styles/index.js +3 -19
- package/dist/styles/ssi/colors.d.ts +8 -2
- package/dist/styles/ssi/colors.js +28 -13
- package/dist/styles/ssi/css/index.js +2 -5
- package/dist/styles/ssi/typography.d.ts +1 -1
- package/dist/styles/ssi/typography.js +6 -9
- package/dist/types/credential/index.js +4 -7
- package/dist/types/image/index.js +1 -2
- package/dist/types/index.js +3 -19
- package/dist/types/localization/index.js +2 -5
- package/dist/utils/DateUtils.js +11 -20
- package/dist/utils/ImageUtils.js +1 -5
- package/dist/utils/TranslationUtils.js +14 -21
- package/dist/utils/UserUtils.d.ts +1 -0
- package/dist/utils/UserUtils.js +22 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +4 -19
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
exports.__esModule = true;
|
|
20
|
-
exports.Localization = void 0;
|
|
21
|
-
var Localization_1 = __importDefault(require("./localization/Localization"));
|
|
22
|
-
exports.Localization = Localization_1["default"];
|
|
23
|
-
__exportStar(require("./utils"), exports);
|
|
24
|
-
__exportStar(require("./types"), exports);
|
|
25
|
-
__exportStar(require("./styles"), exports);
|
|
1
|
+
import Localization from './localization/Localization';
|
|
2
|
+
export * from './utils';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './styles';
|
|
5
|
+
export { Localization };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,41 +9,36 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
12
|
var _a;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var lodash_memoize_1 = __importDefault(require("lodash.memoize"));
|
|
21
|
-
var types_1 = require("../types");
|
|
13
|
+
import i18n from 'i18n-js';
|
|
14
|
+
import memoize from 'lodash.memoize';
|
|
15
|
+
import { SupportedLanguage } from '../types';
|
|
22
16
|
var Localization = (function () {
|
|
23
17
|
function Localization() {
|
|
24
18
|
}
|
|
25
19
|
var _b;
|
|
26
20
|
_b = Localization;
|
|
27
21
|
Localization.translationGetters = (_a = {},
|
|
28
|
-
_a[
|
|
29
|
-
_a[
|
|
22
|
+
_a[SupportedLanguage.ENGLISH] = function () { return require('./translations/en.json'); },
|
|
23
|
+
_a[SupportedLanguage.DUTCH] = function () { return require('./translations/nl.json'); },
|
|
30
24
|
_a);
|
|
31
|
-
Localization.translate = (
|
|
25
|
+
Localization.translate = memoize(function (key, config) {
|
|
32
26
|
var _a, _c;
|
|
33
|
-
if (Object.keys(
|
|
34
|
-
|
|
35
|
-
_a[
|
|
27
|
+
if (Object.keys(i18n.translations).length === 0) {
|
|
28
|
+
i18n.translations = (_a = {},
|
|
29
|
+
_a[SupportedLanguage.ENGLISH] = Localization.translationGetters[SupportedLanguage.ENGLISH](),
|
|
36
30
|
_a);
|
|
37
|
-
|
|
31
|
+
i18n.locale = SupportedLanguage.ENGLISH;
|
|
38
32
|
}
|
|
39
33
|
else {
|
|
40
|
-
|
|
41
|
-
_c[
|
|
34
|
+
i18n.translations = (_c = {},
|
|
35
|
+
_c[i18n.locale] = __assign(__assign({}, i18n.translations[i18n.locale]), Localization.translationGetters[_b.findSupportedLanguage(i18n.locale) || SupportedLanguage.ENGLISH]()),
|
|
42
36
|
_c);
|
|
43
37
|
}
|
|
44
|
-
return
|
|
38
|
+
return i18n.t(key, config);
|
|
45
39
|
}, function (key, config) { return (config ? key + JSON.stringify(config) : key); });
|
|
46
40
|
Localization.findSupportedLanguage = function (locale) {
|
|
47
|
-
for (var _i = 0, _a = Object.values(
|
|
41
|
+
for (var _i = 0, _a = Object.values(SupportedLanguage); _i < _a.length; _i++) {
|
|
48
42
|
var language = _a[_i];
|
|
49
43
|
if (language === locale) {
|
|
50
44
|
return language;
|
|
@@ -52,9 +46,9 @@ var Localization = (function () {
|
|
|
52
46
|
}
|
|
53
47
|
};
|
|
54
48
|
Localization.getLocale = function () {
|
|
55
|
-
return
|
|
49
|
+
return i18n.locale || SupportedLanguage.ENGLISH;
|
|
56
50
|
};
|
|
57
51
|
return Localization;
|
|
58
52
|
}());
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
export var translate = Localization.translate;
|
|
54
|
+
export default Localization;
|
|
@@ -6,5 +6,7 @@
|
|
|
6
6
|
"credential_status_valid": "Geldig",
|
|
7
7
|
"credential_status_expired": "Verlopen",
|
|
8
8
|
"credential_status_revoked": "Ingetrokken",
|
|
9
|
-
"status_missing": "Onbekent"
|
|
9
|
+
"status_missing": "Onbekent",
|
|
10
|
+
"action_filter_caption": "Filter",
|
|
11
|
+
"action_show_caption": "Toon:"
|
|
10
12
|
}
|
package/dist/styles/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
exports.__esModule = true;
|
|
17
|
-
__exportStar(require("./ssi/colors"), exports);
|
|
18
|
-
__exportStar(require("./ssi/typography"), exports);
|
|
19
|
-
__exportStar(require("./ssi/css"), exports);
|
|
1
|
+
export * from './ssi/colors';
|
|
2
|
+
export * from './ssi/typography';
|
|
3
|
+
export * from './ssi/css';
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { LabelStatus } from '../../types';
|
|
2
|
-
type BackgroundColor = 'primaryDark' | 'secondaryDark' | 'primaryLight' | 'secondaryLight';
|
|
2
|
+
type BackgroundColor = 'primaryDark' | 'secondaryDark' | 'primaryLight' | 'secondaryLight' | 'lightGrey';
|
|
3
3
|
export declare const backgroundColors: Record<BackgroundColor, string>;
|
|
4
4
|
type CredentialCardColor = 'default';
|
|
5
5
|
export declare const credentialCardColors: Record<CredentialCardColor, string>;
|
|
6
6
|
type LogoColor = 'default';
|
|
7
7
|
export declare const logoColors: Record<LogoColor, string>;
|
|
8
8
|
export declare const statusColors: Record<LabelStatus | 'error', string>;
|
|
9
|
-
type FontColor = 'dark' | 'light' | 'secondaryButton' | 'greyedOut';
|
|
9
|
+
type FontColor = 'dark' | 'light' | 'secondaryButton' | 'greyedOut' | 'lightGrey';
|
|
10
10
|
export declare const fontColors: Record<FontColor, string>;
|
|
11
|
+
type Gradient = 100 | 200;
|
|
12
|
+
export declare const gradientColors: Record<Gradient, string>;
|
|
13
|
+
type Border = 'dark' | 'light' | 'lightGrey';
|
|
14
|
+
export declare const borderColors: Record<Border, string>;
|
|
15
|
+
type Profile = 100 | 200 | 300 | 400 | 500;
|
|
16
|
+
export declare const profileColors: Record<Profile, string>;
|
|
11
17
|
export {};
|
|
@@ -1,29 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.fontColors = exports.statusColors = exports.logoColors = exports.credentialCardColors = exports.backgroundColors = void 0;
|
|
4
|
-
exports.backgroundColors = {
|
|
1
|
+
export var backgroundColors = {
|
|
5
2
|
primaryDark: '#202537',
|
|
6
3
|
secondaryDark: '#2C334B',
|
|
7
4
|
primaryLight: '#FBFBFB',
|
|
8
|
-
secondaryLight: '#E3E3FF'
|
|
5
|
+
secondaryLight: '#E3E3FF',
|
|
6
|
+
lightGrey: '#E3E3E3',
|
|
9
7
|
};
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
export var credentialCardColors = {
|
|
9
|
+
default: '#5BDED2',
|
|
12
10
|
};
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
export var logoColors = {
|
|
12
|
+
default: '#FBFBFB',
|
|
15
13
|
};
|
|
16
|
-
|
|
14
|
+
export var statusColors = {
|
|
17
15
|
valid: '#00C249',
|
|
18
16
|
expired: '#FF9900',
|
|
19
17
|
revoked: '#EE5309',
|
|
20
18
|
verified: '#00C249',
|
|
21
19
|
unverified: '#FF9900',
|
|
22
|
-
error: '#D74500'
|
|
20
|
+
error: '#D74500',
|
|
23
21
|
};
|
|
24
|
-
|
|
22
|
+
export var fontColors = {
|
|
25
23
|
dark: '#303030',
|
|
26
24
|
light: '#FBFBFB',
|
|
27
25
|
secondaryButton: '#7664F2',
|
|
28
|
-
greyedOut: '#8F8F8F'
|
|
26
|
+
greyedOut: '#8F8F8F',
|
|
27
|
+
lightGrey: '#8D9099',
|
|
28
|
+
};
|
|
29
|
+
export var gradientColors = {
|
|
30
|
+
100: 'linear-gradient(135deg, #7276f7 0%, #7c40e8 100%)',
|
|
31
|
+
200: 'linear-gradient(135deg, #F90 0%, #EE5309 100%)',
|
|
32
|
+
};
|
|
33
|
+
export var borderColors = {
|
|
34
|
+
dark: '#404D7A',
|
|
35
|
+
light: '#E3E3E3',
|
|
36
|
+
lightGrey: '#ACACAC',
|
|
37
|
+
};
|
|
38
|
+
export var profileColors = {
|
|
39
|
+
100: '#EE5209',
|
|
40
|
+
200: '#FF9900',
|
|
41
|
+
300: '#5BDED3',
|
|
42
|
+
400: '#0B81FF',
|
|
43
|
+
500: '#BD2DFF',
|
|
29
44
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
3
|
return cooked;
|
|
5
4
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var styled_components_1 = require("styled-components");
|
|
9
|
-
exports.SSIRoundedEdgesCss = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 8px;\n"], ["\n border-radius: 8px;\n"])));
|
|
5
|
+
import { css } from 'styled-components';
|
|
6
|
+
export var SSIRoundedEdgesCss = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 8px;\n"], ["\n border-radius: 8px;\n"])));
|
|
10
7
|
var templateObject_1;
|
|
@@ -4,4 +4,4 @@ export type LineHeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800;
|
|
|
4
4
|
export declare const lineHeight: Record<LineHeight, number>;
|
|
5
5
|
export type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
6
6
|
export declare const fontWeight: Record<FontWeight, FontWeight>;
|
|
7
|
-
export type FontStyle = 'h0SemiBold' | 'h1SemiBold' | 'h2Regular' | 'h2SemiBold' | 'h3Regular' | 'h3SemiBold' | 'h4Regular' | 'h4SemiBold' | 'h5Regular' | 'h5SemiBold' | 'h6' | 'h7SemiBold';
|
|
7
|
+
export type FontStyle = 'h0SemiBold' | 'h1Regular' | 'h1SemiBold' | 'h2Regular' | 'h2SemiBold' | 'h3Regular' | 'h3SemiBold' | 'h4Regular' | 'h4SemiBold' | 'h5Regular' | 'h5SemiBold' | 'h6' | 'h7SemiBold';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.fontWeight = exports.lineHeight = exports.fontSize = void 0;
|
|
4
|
-
exports.fontSize = {
|
|
1
|
+
export var fontSize = {
|
|
5
2
|
100: 9,
|
|
6
3
|
200: 10,
|
|
7
4
|
300: 11,
|
|
@@ -9,9 +6,9 @@ exports.fontSize = {
|
|
|
9
6
|
500: 14,
|
|
10
7
|
600: 16,
|
|
11
8
|
700: 24,
|
|
12
|
-
800: 36
|
|
9
|
+
800: 36,
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export var lineHeight = {
|
|
15
12
|
100: 13.5,
|
|
16
13
|
200: 15,
|
|
17
14
|
300: 16.5,
|
|
@@ -19,9 +16,9 @@ exports.lineHeight = {
|
|
|
19
16
|
500: 21,
|
|
20
17
|
600: 24,
|
|
21
18
|
700: 34,
|
|
22
|
-
800: 54
|
|
19
|
+
800: 54,
|
|
23
20
|
};
|
|
24
|
-
|
|
21
|
+
export var fontWeight = {
|
|
25
22
|
normal: 'normal',
|
|
26
23
|
bold: 'bold',
|
|
27
24
|
100: '100',
|
|
@@ -32,5 +29,5 @@ exports.fontWeight = {
|
|
|
32
29
|
600: '600',
|
|
33
30
|
700: '700',
|
|
34
31
|
800: '800',
|
|
35
|
-
900: '900'
|
|
32
|
+
900: '900',
|
|
36
33
|
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.IssuerStatus = exports.CredentialStatus = void 0;
|
|
4
|
-
var CredentialStatus;
|
|
1
|
+
export var CredentialStatus;
|
|
5
2
|
(function (CredentialStatus) {
|
|
6
3
|
CredentialStatus["VALID"] = "valid";
|
|
7
4
|
CredentialStatus["EXPIRED"] = "expired";
|
|
8
5
|
CredentialStatus["REVOKED"] = "revoked";
|
|
9
|
-
})(CredentialStatus
|
|
10
|
-
var IssuerStatus;
|
|
6
|
+
})(CredentialStatus || (CredentialStatus = {}));
|
|
7
|
+
export var IssuerStatus;
|
|
11
8
|
(function (IssuerStatus) {
|
|
12
9
|
IssuerStatus["VERIFIED"] = "verified";
|
|
13
10
|
IssuerStatus["UNVERIFIED"] = "unverified";
|
|
14
|
-
})(IssuerStatus
|
|
11
|
+
})(IssuerStatus || (IssuerStatus = {}));
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
exports.__esModule = true;
|
|
1
|
+
export {};
|
package/dist/types/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
exports.__esModule = true;
|
|
17
|
-
__exportStar(require("./credential"), exports);
|
|
18
|
-
__exportStar(require("./image"), exports);
|
|
19
|
-
__exportStar(require("./localization"), exports);
|
|
1
|
+
export * from './credential';
|
|
2
|
+
export * from './image';
|
|
3
|
+
export * from './localization';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.SupportedLanguage = void 0;
|
|
4
|
-
var SupportedLanguage;
|
|
1
|
+
export var SupportedLanguage;
|
|
5
2
|
(function (SupportedLanguage) {
|
|
6
3
|
SupportedLanguage["ENGLISH"] = "en";
|
|
7
4
|
SupportedLanguage["DUTCH"] = "nl";
|
|
8
|
-
})(SupportedLanguage
|
|
5
|
+
})(SupportedLanguage || (SupportedLanguage = {}));
|
package/dist/utils/DateUtils.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,41 +9,33 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
exports.__esModule = true;
|
|
17
|
-
exports.makeEpochMilli = exports.toLocalDateString = exports.toLocalDateTimeString = exports.DATE_FORMAT_OPTIONS = exports.EPOCH_MILLISECONDS = void 0;
|
|
18
|
-
var Localization_1 = __importDefault(require("../localization/Localization"));
|
|
19
|
-
exports.EPOCH_MILLISECONDS = 1000;
|
|
20
|
-
exports.DATE_FORMAT_OPTIONS = {
|
|
12
|
+
import Localization from '../localization/Localization';
|
|
13
|
+
export var EPOCH_MILLISECONDS = 1000;
|
|
14
|
+
export var DATE_FORMAT_OPTIONS = {
|
|
21
15
|
year: 'numeric',
|
|
22
16
|
month: 'numeric',
|
|
23
|
-
day: 'numeric'
|
|
17
|
+
day: 'numeric',
|
|
24
18
|
};
|
|
25
|
-
var toLocalDateTimeString = function (date) {
|
|
26
|
-
return new Date(formatDate(date)).toLocaleString(
|
|
19
|
+
export var toLocalDateTimeString = function (date) {
|
|
20
|
+
return new Date(formatDate(date)).toLocaleString(Localization.getLocale(), __assign(__assign({}, DATE_FORMAT_OPTIONS), { hour: 'numeric', minute: 'numeric', second: 'numeric' }));
|
|
27
21
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return new Date(formatDate(date)).toLocaleDateString(Localization_1["default"].getLocale(), exports.DATE_FORMAT_OPTIONS);
|
|
22
|
+
export var toLocalDateString = function (date) {
|
|
23
|
+
return new Date(formatDate(date)).toLocaleDateString(Localization.getLocale(), DATE_FORMAT_OPTIONS);
|
|
31
24
|
};
|
|
32
|
-
exports.toLocalDateString = toLocalDateString;
|
|
33
25
|
var formatDate = function (date) {
|
|
34
26
|
var epoch = date;
|
|
35
27
|
epoch = removeFractionalPart(epoch);
|
|
36
28
|
if (!isEpochMilli(epoch)) {
|
|
37
|
-
epoch =
|
|
29
|
+
epoch = makeEpochMilli(epoch);
|
|
38
30
|
}
|
|
39
31
|
return epoch;
|
|
40
32
|
};
|
|
41
|
-
var makeEpochMilli = function (date) {
|
|
33
|
+
export var makeEpochMilli = function (date) {
|
|
42
34
|
if (!isEpochMilli(date)) {
|
|
43
|
-
date = date *
|
|
35
|
+
date = date * EPOCH_MILLISECONDS;
|
|
44
36
|
}
|
|
45
37
|
return date;
|
|
46
38
|
};
|
|
47
|
-
exports.makeEpochMilli = makeEpochMilli;
|
|
48
39
|
var isEpochMilli = function (date) {
|
|
49
40
|
return date.toString().length > 10;
|
|
50
41
|
};
|
package/dist/utils/ImageUtils.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.calculateAspectRatio = void 0;
|
|
4
|
-
var calculateAspectRatio = function (width, height) {
|
|
1
|
+
export var calculateAspectRatio = function (width, height) {
|
|
5
2
|
return width / height;
|
|
6
3
|
};
|
|
7
|
-
exports.calculateAspectRatio = calculateAspectRatio;
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.getStatusTranslation = void 0;
|
|
7
|
-
var types_1 = require("../types");
|
|
8
|
-
var Localization_1 = __importDefault(require("../localization/Localization"));
|
|
9
|
-
var getStatusTranslation = function (status) {
|
|
1
|
+
import { CredentialStatus, IssuerStatus } from '../types';
|
|
2
|
+
import Localization from '../localization/Localization';
|
|
3
|
+
export var getStatusTranslation = function (status) {
|
|
10
4
|
switch (status) {
|
|
11
|
-
case
|
|
12
|
-
return
|
|
13
|
-
case
|
|
14
|
-
return
|
|
15
|
-
case
|
|
16
|
-
return
|
|
17
|
-
case
|
|
18
|
-
return
|
|
19
|
-
case
|
|
20
|
-
return
|
|
5
|
+
case IssuerStatus.VERIFIED:
|
|
6
|
+
return Localization.translate('issuer_status_verified');
|
|
7
|
+
case IssuerStatus.UNVERIFIED:
|
|
8
|
+
return Localization.translate('issuer_status_unverified');
|
|
9
|
+
case CredentialStatus.VALID:
|
|
10
|
+
return Localization.translate('credential_status_valid');
|
|
11
|
+
case CredentialStatus.EXPIRED:
|
|
12
|
+
return Localization.translate('credential_status_expired');
|
|
13
|
+
case CredentialStatus.REVOKED:
|
|
14
|
+
return Localization.translate('credential_status_revoked');
|
|
21
15
|
default:
|
|
22
|
-
return
|
|
16
|
+
return Localization.translate('status_missing');
|
|
23
17
|
}
|
|
24
18
|
};
|
|
25
|
-
exports.getStatusTranslation = getStatusTranslation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getInitials: (fullName: string) => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export var getInitials = function (fullName) {
|
|
2
|
+
if (fullName && fullName.length > 0) {
|
|
3
|
+
var namePartsArray = fullName.trim().split(' ');
|
|
4
|
+
var firstInitial = '';
|
|
5
|
+
var lastInitial = '';
|
|
6
|
+
if (namePartsArray.length > 0) {
|
|
7
|
+
var firstName = namePartsArray[0];
|
|
8
|
+
if (firstName.length > 0) {
|
|
9
|
+
firstInitial = firstName[0];
|
|
10
|
+
}
|
|
11
|
+
if (namePartsArray.length > 1) {
|
|
12
|
+
var lastPart = namePartsArray[namePartsArray.length - 1];
|
|
13
|
+
if (lastPart.length > 0) {
|
|
14
|
+
lastInitial = lastPart[0];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
var initials = "".concat(firstInitial).concat(lastInitial);
|
|
19
|
+
return initials.toUpperCase();
|
|
20
|
+
}
|
|
21
|
+
return '?';
|
|
22
|
+
};
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
exports.__esModule = true;
|
|
17
|
-
__exportStar(require("./ImageUtils"), exports);
|
|
18
|
-
__exportStar(require("./DateUtils"), exports);
|
|
19
|
-
__exportStar(require("./TranslationUtils"), exports);
|
|
1
|
+
export * from './ImageUtils';
|
|
2
|
+
export * from './DateUtils';
|
|
3
|
+
export * from './TranslationUtils';
|
|
4
|
+
export * from './UserUtils';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ui-components.core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2-next.12+e845cd6",
|
|
5
5
|
"description": "SSI UI components Core",
|
|
6
6
|
"repository": "git@github.com:Sphereon-Opensource/UI-Components.git",
|
|
7
7
|
"author": "Sphereon <dev@sphereon.com>",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": ">= 16.8.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e845cd64e05e4ad3af3844d3779341367700c4dc"
|
|
47
47
|
}
|