@sphereon/ui-components.core 0.4.1-unstable.162 → 0.4.1-unstable.164
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 +3 -3
- package/dist/localization/Localization.js +34 -51
- package/dist/regexes/index.js +1 -1
- package/dist/styles/index.js +1 -1
- package/dist/styles/ssi/colors.js +16 -16
- package/dist/styles/ssi/css/index.js +5 -8
- package/dist/styles/ssi/typography.js +4 -4
- package/dist/types/base64/index.js +1 -1
- package/dist/types/button/index.js +2 -2
- package/dist/types/credential/index.js +4 -4
- package/dist/types/image/index.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/label/index.js +2 -2
- package/dist/types/localization/index.js +2 -2
- package/dist/types/roles/index.js +2 -2
- package/dist/types/style/index.js +2 -2
- package/dist/types/tab/index.js +1 -1
- package/dist/types/toast/index.js +2 -2
- package/dist/utils/ColorUtils.js +6 -6
- package/dist/utils/DateUtils.js +12 -23
- package/dist/utils/FileUtils.js +11 -11
- package/dist/utils/ImageUtils.js +4 -4
- package/dist/utils/TranslationUtils.js +17 -17
- package/dist/utils/TypeUtils.js +5 -5
- package/dist/utils/UserUtils.js +8 -8
- package/dist/utils/index.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -16,10 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
|
-
exports
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.Localization = void 0;
|
|
21
|
-
|
|
22
|
-
exports.Localization = Localization_1
|
|
21
|
+
const Localization_1 = __importDefault(require("./localization/Localization"));
|
|
22
|
+
exports.Localization = Localization_1.default;
|
|
23
23
|
__exportStar(require("./utils"), exports);
|
|
24
24
|
__exportStar(require("./types"), exports);
|
|
25
25
|
__exportStar(require("./styles"), exports);
|
|
@@ -1,60 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
var _a;
|
|
17
|
-
exports
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
7
|
exports.translate = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
const i18n_js_1 = __importDefault(require("i18n-js"));
|
|
9
|
+
const lodash_memoize_1 = __importDefault(require("lodash.memoize"));
|
|
10
|
+
const types_1 = require("../types");
|
|
11
|
+
class Localization {
|
|
12
|
+
}
|
|
13
|
+
_a = Localization;
|
|
14
|
+
Localization.translationGetters = {
|
|
15
|
+
[types_1.SupportedLanguage.ENGLISH]: () => require('./translations/en.json'),
|
|
16
|
+
[types_1.SupportedLanguage.DUTCH]: () => require('./translations/nl.json'),
|
|
17
|
+
};
|
|
18
|
+
Localization.translate = (0, lodash_memoize_1.default)((key, config) => {
|
|
19
|
+
if (Object.keys(i18n_js_1.default.translations).length === 0) {
|
|
20
|
+
i18n_js_1.default.translations = {
|
|
21
|
+
[types_1.SupportedLanguage.ENGLISH]: _a.translationGetters[types_1.SupportedLanguage.ENGLISH](),
|
|
22
|
+
};
|
|
23
|
+
i18n_js_1.default.locale = types_1.SupportedLanguage.ENGLISH;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_a);
|
|
37
|
-
i18n_js_1["default"].locale = types_1.SupportedLanguage.ENGLISH;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
i18n_js_1["default"].translations = (_c = {},
|
|
41
|
-
_c[i18n_js_1["default"].locale] = __assign(__assign({}, i18n_js_1["default"].translations[i18n_js_1["default"].locale]), Localization.translationGetters[_b.findSupportedLanguage(i18n_js_1["default"].locale) || types_1.SupportedLanguage.ENGLISH]()),
|
|
42
|
-
_c);
|
|
43
|
-
}
|
|
44
|
-
return i18n_js_1["default"].t(key, config);
|
|
45
|
-
}, function (key, config) { return (config ? key + JSON.stringify(config) : key); });
|
|
46
|
-
Localization.findSupportedLanguage = function (locale) {
|
|
47
|
-
for (var _i = 0, _a = Object.values(types_1.SupportedLanguage); _i < _a.length; _i++) {
|
|
48
|
-
var language = _a[_i];
|
|
49
|
-
if (language === locale) {
|
|
50
|
-
return language;
|
|
51
|
-
}
|
|
25
|
+
else {
|
|
26
|
+
i18n_js_1.default.translations = {
|
|
27
|
+
[i18n_js_1.default.locale]: Object.assign(Object.assign({}, i18n_js_1.default.translations[i18n_js_1.default.locale]), _a.translationGetters[_a.findSupportedLanguage(i18n_js_1.default.locale) || types_1.SupportedLanguage.ENGLISH]()),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return i18n_js_1.default.t(key, config);
|
|
31
|
+
}, (key, config) => (config ? key + JSON.stringify(config) : key));
|
|
32
|
+
Localization.findSupportedLanguage = (locale) => {
|
|
33
|
+
for (const language of Object.values(types_1.SupportedLanguage)) {
|
|
34
|
+
if (language === locale) {
|
|
35
|
+
return language;
|
|
52
36
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}());
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
Localization.getLocale = () => {
|
|
40
|
+
return i18n_js_1.default.locale || types_1.SupportedLanguage.ENGLISH;
|
|
41
|
+
};
|
|
59
42
|
exports.translate = Localization.translate;
|
|
60
|
-
exports
|
|
43
|
+
exports.default = Localization;
|
package/dist/regexes/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IS_IMAGE_FILE_EXTENSION_REGEX = exports.IS_IMAGE_URI_REGEX = exports.base64UriValidationRegex = exports.emailAddressValidationRegex = void 0;
|
|
4
4
|
exports.emailAddressValidationRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
|
|
5
5
|
exports.base64UriValidationRegex = /^data:image\/[a-zA-Z]+;base64,[A-Za-z0-9+\/_-]*(={0,2})?$/;
|
package/dist/styles/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
exports
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ssi/colors"), exports);
|
|
18
18
|
__exportStar(require("./ssi/typography"), exports);
|
|
19
19
|
__exportStar(require("./ssi/css"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buttonColors = exports.elementColors = exports.selectionElementColors = exports.alertColors = exports.profileColors = exports.borderColors = exports.gradientsColors = exports.fontColors = exports.statusColors = exports.logoColors = exports.credentialCardColors = exports.backgroundColors = void 0;
|
|
4
4
|
exports.backgroundColors = {
|
|
5
5
|
primaryDark: '#202537',
|
|
@@ -7,13 +7,13 @@ exports.backgroundColors = {
|
|
|
7
7
|
primaryLight: '#FBFBFB',
|
|
8
8
|
secondaryLight: '#E3E3FF',
|
|
9
9
|
lightGrey: '#E3E3E3',
|
|
10
|
-
orange: '#D74500'
|
|
10
|
+
orange: '#D74500',
|
|
11
11
|
};
|
|
12
12
|
exports.credentialCardColors = {
|
|
13
|
-
|
|
13
|
+
default: '#5BDED2',
|
|
14
14
|
};
|
|
15
15
|
exports.logoColors = {
|
|
16
|
-
|
|
16
|
+
default: '#FBFBFB',
|
|
17
17
|
};
|
|
18
18
|
exports.statusColors = {
|
|
19
19
|
valid: '#00C249',
|
|
@@ -22,53 +22,53 @@ exports.statusColors = {
|
|
|
22
22
|
verified: '#00C249',
|
|
23
23
|
unverified: '#FF9900',
|
|
24
24
|
error: '#D74500',
|
|
25
|
-
|
|
25
|
+
new: '#7276F7',
|
|
26
26
|
approved: '#00C249',
|
|
27
27
|
pending: '#0B81FF',
|
|
28
28
|
archived: '#B3B3B3',
|
|
29
29
|
declined: '#D74500',
|
|
30
30
|
done: '#00C249',
|
|
31
|
-
draft: '#0B81FF'
|
|
31
|
+
draft: '#0B81FF',
|
|
32
32
|
};
|
|
33
33
|
exports.fontColors = {
|
|
34
34
|
dark: '#303030',
|
|
35
35
|
light: '#FBFBFB',
|
|
36
36
|
secondaryButton: '#7664F2',
|
|
37
37
|
greyedOut: '#8F8F8F',
|
|
38
|
-
lightGrey: '#8D9099'
|
|
38
|
+
lightGrey: '#8D9099',
|
|
39
39
|
};
|
|
40
40
|
exports.gradientsColors = {
|
|
41
41
|
100: {
|
|
42
42
|
primaryColor: '#7276F7',
|
|
43
|
-
secondaryColor: '#7C40E8'
|
|
43
|
+
secondaryColor: '#7C40E8',
|
|
44
44
|
},
|
|
45
45
|
200: {
|
|
46
46
|
primaryColor: '#FF9900',
|
|
47
|
-
secondaryColor: '#EE5309'
|
|
48
|
-
}
|
|
47
|
+
secondaryColor: '#EE5309',
|
|
48
|
+
},
|
|
49
49
|
};
|
|
50
50
|
exports.borderColors = {
|
|
51
51
|
dark: '#404D7A',
|
|
52
52
|
light: '#E3E3E3',
|
|
53
53
|
lightGrey: '#ACACAC',
|
|
54
54
|
darkGrey: '#303030',
|
|
55
|
-
purple: '#7276F7'
|
|
55
|
+
purple: '#7276F7',
|
|
56
56
|
};
|
|
57
57
|
exports.profileColors = {
|
|
58
58
|
100: '#EE5209',
|
|
59
59
|
200: '#FF9900',
|
|
60
60
|
300: '#5BDED3',
|
|
61
61
|
400: '#0B81FF',
|
|
62
|
-
500: '#BD2DFF'
|
|
62
|
+
500: '#BD2DFF',
|
|
63
63
|
};
|
|
64
64
|
exports.alertColors = {
|
|
65
65
|
primaryLight: '#FBFBFB',
|
|
66
|
-
secondaryLight: '#EBEBEB'
|
|
66
|
+
secondaryLight: '#EBEBEB',
|
|
67
67
|
};
|
|
68
68
|
exports.selectionElementColors = {
|
|
69
69
|
primaryDark: '#0B81FF',
|
|
70
70
|
primaryBorderDark: '#FBFBFB',
|
|
71
|
-
selectedRow: '#B7B8D9'
|
|
71
|
+
selectedRow: '#B7B8D9',
|
|
72
72
|
};
|
|
73
73
|
exports.elementColors = {
|
|
74
74
|
blue: '#0B81FF',
|
|
@@ -76,8 +76,8 @@ exports.elementColors = {
|
|
|
76
76
|
purple: '#7276F7',
|
|
77
77
|
100: '#F25409',
|
|
78
78
|
200: '#F78854',
|
|
79
|
-
300: '#8D9099'
|
|
79
|
+
300: '#8D9099',
|
|
80
80
|
};
|
|
81
81
|
exports.buttonColors = {
|
|
82
|
-
100: '#8B1900'
|
|
82
|
+
100: '#8B1900',
|
|
83
83
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
exports.__esModule = true;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
3
|
exports.SSIRoundedEdgesCss = void 0;
|
|
8
|
-
|
|
9
|
-
exports.SSIRoundedEdgesCss = (0, styled_components_1.css)
|
|
10
|
-
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.SSIRoundedEdgesCss = (0, styled_components_1.css) `
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fontWeight = exports.lineHeight = exports.fontSize = void 0;
|
|
4
4
|
exports.fontSize = {
|
|
5
5
|
100: 9,
|
|
@@ -10,7 +10,7 @@ exports.fontSize = {
|
|
|
10
10
|
600: 16,
|
|
11
11
|
700: 24,
|
|
12
12
|
800: 36,
|
|
13
|
-
64: 64
|
|
13
|
+
64: 64,
|
|
14
14
|
};
|
|
15
15
|
exports.lineHeight = {
|
|
16
16
|
100: 13.5,
|
|
@@ -21,7 +21,7 @@ exports.lineHeight = {
|
|
|
21
21
|
600: 24,
|
|
22
22
|
700: 34,
|
|
23
23
|
800: 54,
|
|
24
|
-
64: 64
|
|
24
|
+
64: 64,
|
|
25
25
|
};
|
|
26
26
|
exports.fontWeight = {
|
|
27
27
|
normal: 'normal',
|
|
@@ -34,5 +34,5 @@ exports.fontWeight = {
|
|
|
34
34
|
600: '600',
|
|
35
35
|
700: '700',
|
|
36
36
|
800: '800',
|
|
37
|
-
900: '900'
|
|
37
|
+
900: '900',
|
|
38
38
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ButtonIcon = void 0;
|
|
4
4
|
var ButtonIcon;
|
|
5
5
|
(function (ButtonIcon) {
|
|
@@ -12,4 +12,4 @@ var ButtonIcon;
|
|
|
12
12
|
ButtonIcon["DELETE"] = "delete";
|
|
13
13
|
ButtonIcon["FILTER"] = "filter";
|
|
14
14
|
ButtonIcon["VIEW"] = "view";
|
|
15
|
-
})(ButtonIcon
|
|
15
|
+
})(ButtonIcon || (exports.ButtonIcon = ButtonIcon = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WorkflowStatus = exports.IssuerStatus = exports.CredentialStatus = void 0;
|
|
4
4
|
var CredentialStatus;
|
|
5
5
|
(function (CredentialStatus) {
|
|
@@ -7,12 +7,12 @@ var CredentialStatus;
|
|
|
7
7
|
CredentialStatus["EXPIRED"] = "expired";
|
|
8
8
|
CredentialStatus["REVOKED"] = "revoked";
|
|
9
9
|
CredentialStatus["DRAFT"] = "draft";
|
|
10
|
-
})(CredentialStatus
|
|
10
|
+
})(CredentialStatus || (exports.CredentialStatus = CredentialStatus = {}));
|
|
11
11
|
var IssuerStatus;
|
|
12
12
|
(function (IssuerStatus) {
|
|
13
13
|
IssuerStatus["VERIFIED"] = "verified";
|
|
14
14
|
IssuerStatus["UNVERIFIED"] = "unverified";
|
|
15
|
-
})(IssuerStatus
|
|
15
|
+
})(IssuerStatus || (exports.IssuerStatus = IssuerStatus = {}));
|
|
16
16
|
var WorkflowStatus;
|
|
17
17
|
(function (WorkflowStatus) {
|
|
18
18
|
WorkflowStatus["NEW"] = "new";
|
|
@@ -21,4 +21,4 @@ var WorkflowStatus;
|
|
|
21
21
|
WorkflowStatus["PENDING"] = "pending";
|
|
22
22
|
WorkflowStatus["DONE"] = "done";
|
|
23
23
|
WorkflowStatus["ARCHIVED"] = "archived";
|
|
24
|
-
})(WorkflowStatus
|
|
24
|
+
})(WorkflowStatus || (exports.WorkflowStatus = WorkflowStatus = {}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/types/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
exports
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./button"), exports);
|
|
18
18
|
__exportStar(require("./credential"), exports);
|
|
19
19
|
__exportStar(require("./image"), exports);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LabelType = void 0;
|
|
4
4
|
var LabelType;
|
|
5
5
|
(function (LabelType) {
|
|
6
6
|
LabelType["ISSUER"] = "Issuer";
|
|
7
7
|
LabelType["VERIFIER"] = "Verifier";
|
|
8
|
-
})(LabelType
|
|
8
|
+
})(LabelType || (exports.LabelType = LabelType = {}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SupportedLanguage = void 0;
|
|
4
4
|
var SupportedLanguage;
|
|
5
5
|
(function (SupportedLanguage) {
|
|
6
6
|
SupportedLanguage["ENGLISH"] = "en";
|
|
7
7
|
SupportedLanguage["DUTCH"] = "nl";
|
|
8
|
-
})(SupportedLanguage
|
|
8
|
+
})(SupportedLanguage || (exports.SupportedLanguage = SupportedLanguage = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RoleType = void 0;
|
|
4
4
|
var RoleType;
|
|
5
5
|
(function (RoleType) {
|
|
@@ -7,4 +7,4 @@ var RoleType;
|
|
|
7
7
|
RoleType["ISSUER"] = "ISSUER";
|
|
8
8
|
RoleType["RELYING_PARTY"] = "RELYING_PARTY";
|
|
9
9
|
RoleType["ADMIN"] = "ADMIN";
|
|
10
|
-
})(RoleType
|
|
10
|
+
})(RoleType || (exports.RoleType = RoleType = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OpacityStyleEnum = void 0;
|
|
4
4
|
var OpacityStyleEnum;
|
|
5
5
|
(function (OpacityStyleEnum) {
|
|
6
6
|
OpacityStyleEnum[OpacityStyleEnum["DISABLED"] = 0.5] = "DISABLED";
|
|
7
|
-
})(OpacityStyleEnum
|
|
7
|
+
})(OpacityStyleEnum || (exports.OpacityStyleEnum = OpacityStyleEnum = {}));
|
package/dist/types/tab/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ToastType = void 0;
|
|
4
4
|
var ToastType;
|
|
5
5
|
(function (ToastType) {
|
|
6
6
|
ToastType["SUCCESS"] = "ssiToastSuccess";
|
|
7
7
|
ToastType["ERROR"] = "ssiToastError";
|
|
8
|
-
})(ToastType
|
|
8
|
+
})(ToastType || (exports.ToastType = ToastType = {}));
|
package/dist/utils/ColorUtils.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseColor = void 0;
|
|
4
|
-
|
|
4
|
+
const parseColor = (color) => {
|
|
5
5
|
if (!color || typeof color !== 'string') {
|
|
6
6
|
return 'currentColor';
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
const trimmed = color.trim();
|
|
9
9
|
if (!trimmed) {
|
|
10
10
|
return 'currentColor';
|
|
11
11
|
}
|
|
12
12
|
if (trimmed.startsWith('--')) {
|
|
13
|
-
return
|
|
13
|
+
return `var(${trimmed})`;
|
|
14
14
|
}
|
|
15
15
|
if (trimmed.startsWith('$')) {
|
|
16
|
-
return
|
|
16
|
+
return `var(--${trimmed.slice(1)})`;
|
|
17
17
|
}
|
|
18
18
|
if (trimmed.includes('.') && !trimmed.includes('(')) {
|
|
19
|
-
return
|
|
19
|
+
return `var(--${trimmed.replace(/\./g, '-')})`;
|
|
20
20
|
}
|
|
21
21
|
return trimmed;
|
|
22
22
|
};
|
package/dist/utils/DateUtils.js
CHANGED
|
@@ -1,37 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
6
|
exports.makeEpochMilli = exports.formatDate = exports.toLocalDateString = exports.toLocalDateTimeString = exports.DATE_FORMAT_OPTIONS = exports.EPOCH_MILLISECONDS = void 0;
|
|
18
|
-
|
|
7
|
+
const Localization_1 = __importDefault(require("../localization/Localization"));
|
|
19
8
|
exports.EPOCH_MILLISECONDS = 1000;
|
|
20
9
|
exports.DATE_FORMAT_OPTIONS = {
|
|
21
10
|
year: 'numeric',
|
|
22
11
|
month: 'numeric',
|
|
23
|
-
day: 'numeric'
|
|
12
|
+
day: 'numeric',
|
|
24
13
|
};
|
|
25
|
-
|
|
26
|
-
return new Date((0, exports.formatDate)(date)).toLocaleString(Localization_1
|
|
14
|
+
const toLocalDateTimeString = (date) => {
|
|
15
|
+
return new Date((0, exports.formatDate)(date)).toLocaleString(Localization_1.default.getLocale(), Object.assign(Object.assign({}, exports.DATE_FORMAT_OPTIONS), { hour: 'numeric', minute: 'numeric', second: 'numeric' }));
|
|
27
16
|
};
|
|
28
17
|
exports.toLocalDateTimeString = toLocalDateTimeString;
|
|
29
|
-
|
|
30
|
-
return new Date((0, exports.formatDate)(date)).toLocaleDateString(Localization_1
|
|
18
|
+
const toLocalDateString = (date) => {
|
|
19
|
+
return new Date((0, exports.formatDate)(date)).toLocaleDateString(Localization_1.default.getLocale(), exports.DATE_FORMAT_OPTIONS);
|
|
31
20
|
};
|
|
32
21
|
exports.toLocalDateString = toLocalDateString;
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
const formatDate = (date) => {
|
|
23
|
+
let epoch = date;
|
|
35
24
|
epoch = removeFractionalPart(epoch);
|
|
36
25
|
if (!isEpochMilli(epoch)) {
|
|
37
26
|
epoch = (0, exports.makeEpochMilli)(epoch);
|
|
@@ -39,17 +28,17 @@ var formatDate = function (date) {
|
|
|
39
28
|
return epoch;
|
|
40
29
|
};
|
|
41
30
|
exports.formatDate = formatDate;
|
|
42
|
-
|
|
31
|
+
const makeEpochMilli = (date) => {
|
|
43
32
|
if (!isEpochMilli(date)) {
|
|
44
33
|
date = date * exports.EPOCH_MILLISECONDS;
|
|
45
34
|
}
|
|
46
35
|
return date;
|
|
47
36
|
};
|
|
48
37
|
exports.makeEpochMilli = makeEpochMilli;
|
|
49
|
-
|
|
38
|
+
const isEpochMilli = (date) => {
|
|
50
39
|
return date.toString().length > 10;
|
|
51
40
|
};
|
|
52
|
-
|
|
41
|
+
const removeFractionalPart = (date) => {
|
|
53
42
|
if (date.toString().indexOf('.') >= 0) {
|
|
54
43
|
return Number(date.toString().split('.')[0]);
|
|
55
44
|
}
|
package/dist/utils/FileUtils.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseBase64Uri = exports.getFileSizeDisplay = void 0;
|
|
4
|
-
|
|
4
|
+
const getFileSizeDisplay = (bytes) => {
|
|
5
5
|
if (bytes < 1024) {
|
|
6
|
-
return
|
|
6
|
+
return `${bytes} B`;
|
|
7
7
|
}
|
|
8
8
|
else if (bytes <= 1024 * 1024) {
|
|
9
|
-
return
|
|
9
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
10
10
|
}
|
|
11
11
|
else if (bytes <= 1024 * 1024 * 1024) {
|
|
12
|
-
return
|
|
12
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
|
-
return
|
|
15
|
+
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
exports.getFileSizeDisplay = getFileSizeDisplay;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const parseBase64Uri = (base64Uri) => {
|
|
20
|
+
const base64Parts = base64Uri.split(';base64,');
|
|
21
|
+
const mimeType = base64Parts[0].replace('data:', '');
|
|
22
22
|
return {
|
|
23
|
-
base64Uri
|
|
23
|
+
base64Uri,
|
|
24
24
|
base64: base64Parts[1],
|
|
25
|
-
mimeType
|
|
25
|
+
mimeType,
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
exports.parseBase64Uri = parseBase64Uri;
|
package/dist/utils/ImageUtils.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isBase64ImageUri = exports.calculateAspectRatio = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const regexes_1 = require("../regexes");
|
|
5
|
+
const calculateAspectRatio = (width, height) => {
|
|
6
6
|
return width / height;
|
|
7
7
|
};
|
|
8
8
|
exports.calculateAspectRatio = calculateAspectRatio;
|
|
9
|
-
|
|
9
|
+
const isBase64ImageUri = (value) => {
|
|
10
10
|
if (typeof value === 'string') {
|
|
11
11
|
return regexes_1.base64UriValidationRegex.test(value);
|
|
12
12
|
}
|
|
@@ -2,38 +2,38 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getStatusTranslation = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const types_1 = require("../types");
|
|
8
|
+
const Localization_1 = __importDefault(require("../localization/Localization"));
|
|
9
|
+
const getStatusTranslation = (status) => {
|
|
10
10
|
switch (status) {
|
|
11
11
|
case types_1.IssuerStatus.VERIFIED:
|
|
12
|
-
return Localization_1
|
|
12
|
+
return Localization_1.default.translate('issuer_status_verified');
|
|
13
13
|
case types_1.IssuerStatus.UNVERIFIED:
|
|
14
|
-
return Localization_1
|
|
14
|
+
return Localization_1.default.translate('issuer_status_unverified');
|
|
15
15
|
case types_1.CredentialStatus.VALID:
|
|
16
|
-
return Localization_1
|
|
16
|
+
return Localization_1.default.translate('credential_status_valid');
|
|
17
17
|
case types_1.CredentialStatus.EXPIRED:
|
|
18
|
-
return Localization_1
|
|
18
|
+
return Localization_1.default.translate('credential_status_expired');
|
|
19
19
|
case types_1.CredentialStatus.REVOKED:
|
|
20
|
-
return Localization_1
|
|
20
|
+
return Localization_1.default.translate('credential_status_revoked');
|
|
21
21
|
case types_1.CredentialStatus.DRAFT:
|
|
22
|
-
return Localization_1
|
|
22
|
+
return Localization_1.default.translate('credential_status_draft');
|
|
23
23
|
case types_1.WorkflowStatus.APPROVED:
|
|
24
|
-
return Localization_1
|
|
24
|
+
return Localization_1.default.translate('workflow_status_approved');
|
|
25
25
|
case types_1.WorkflowStatus.ARCHIVED:
|
|
26
|
-
return Localization_1
|
|
26
|
+
return Localization_1.default.translate('workflow_status_archived');
|
|
27
27
|
case types_1.WorkflowStatus.DECLINED:
|
|
28
|
-
return Localization_1
|
|
28
|
+
return Localization_1.default.translate('workflow_status_declined');
|
|
29
29
|
case types_1.WorkflowStatus.DONE:
|
|
30
|
-
return Localization_1
|
|
30
|
+
return Localization_1.default.translate('workflow_status_done');
|
|
31
31
|
case types_1.WorkflowStatus.NEW:
|
|
32
|
-
return Localization_1
|
|
32
|
+
return Localization_1.default.translate('workflow_status_new');
|
|
33
33
|
case types_1.WorkflowStatus.PENDING:
|
|
34
|
-
return Localization_1
|
|
34
|
+
return Localization_1.default.translate('workflow_status_pending');
|
|
35
35
|
default:
|
|
36
|
-
return Localization_1
|
|
36
|
+
return Localization_1.default.translate('status_missing');
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
exports.getStatusTranslation = getStatusTranslation;
|
package/dist/utils/TypeUtils.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseToBoolean = exports.isBoolean = void 0;
|
|
4
|
-
|
|
4
|
+
const isBoolean = (value) => {
|
|
5
5
|
if (typeof value === 'boolean') {
|
|
6
6
|
return true;
|
|
7
7
|
}
|
|
8
8
|
else if (typeof value === 'string') {
|
|
9
|
-
|
|
9
|
+
const lowercaseValue = value.toLowerCase();
|
|
10
10
|
return lowercaseValue === 'true' || lowercaseValue === 'false';
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
@@ -14,12 +14,12 @@ var isBoolean = function (value) {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
exports.isBoolean = isBoolean;
|
|
17
|
-
|
|
17
|
+
const parseToBoolean = (value) => {
|
|
18
18
|
if (typeof value === 'boolean') {
|
|
19
19
|
return value;
|
|
20
20
|
}
|
|
21
21
|
else if (typeof value === 'string') {
|
|
22
|
-
|
|
22
|
+
const lowercaseValue = value.toLowerCase();
|
|
23
23
|
if (lowercaseValue === 'true') {
|
|
24
24
|
return true;
|
|
25
25
|
}
|
package/dist/utils/UserUtils.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInitials = void 0;
|
|
4
|
-
|
|
4
|
+
const getInitials = (fullName) => {
|
|
5
5
|
if (fullName && fullName.length > 0) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const namePartsArray = fullName.trim().split(' ');
|
|
7
|
+
let firstInitial = '';
|
|
8
|
+
let lastInitial = '';
|
|
9
9
|
if (namePartsArray.length > 0) {
|
|
10
|
-
|
|
10
|
+
const firstName = namePartsArray[0];
|
|
11
11
|
if (firstName.length > 0) {
|
|
12
12
|
firstInitial = firstName[0];
|
|
13
13
|
}
|
|
14
14
|
if (namePartsArray.length > 1) {
|
|
15
|
-
|
|
15
|
+
const lastPart = namePartsArray[namePartsArray.length - 1];
|
|
16
16
|
if (lastPart.length > 0) {
|
|
17
17
|
lastInitial = lastPart[0];
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
const initials = `${firstInitial}${lastInitial}`;
|
|
22
22
|
return initials.toUpperCase();
|
|
23
23
|
}
|
|
24
24
|
return '?';
|
package/dist/utils/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
exports
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ImageUtils"), exports);
|
|
18
18
|
__exportStar(require("./DateUtils"), exports);
|
|
19
19
|
__exportStar(require("./TranslationUtils"), exports);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ui-components.core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.4.1-unstable.
|
|
4
|
+
"version": "0.4.1-unstable.164+4ae7ffd",
|
|
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,10 +43,10 @@
|
|
|
43
43
|
"@types/lodash.memoize": "^4.1.7",
|
|
44
44
|
"@types/react": "~18.2.67",
|
|
45
45
|
"react": "18.2.0",
|
|
46
|
-
"typescript": "
|
|
46
|
+
"typescript": "~5.8.3"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": ">= 18.2"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "4ae7ffdd2a3edf2c4c7631c59ea5a8129e6ca8c1"
|
|
52
52
|
}
|