@sphereon/ui-components.core 0.1.2-next.12 → 0.1.2-next.17

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 CHANGED
@@ -1,5 +1,25 @@
1
- import Localization from './localization/Localization';
2
- export * from './utils';
3
- export * from './types';
4
- export * from './styles';
5
- export { Localization };
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
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
+ 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,3 +1,4 @@
1
+ "use strict";
1
2
  var __assign = (this && this.__assign) || function () {
2
3
  __assign = Object.assign || function(t) {
3
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -9,36 +10,41 @@ var __assign = (this && this.__assign) || function () {
9
10
  };
10
11
  return __assign.apply(this, arguments);
11
12
  };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
12
16
  var _a;
13
- import i18n from 'i18n-js';
14
- import memoize from 'lodash.memoize';
15
- import { SupportedLanguage } from '../types';
17
+ exports.__esModule = true;
18
+ exports.translate = void 0;
19
+ var i18n_js_1 = __importDefault(require("i18n-js"));
20
+ var lodash_memoize_1 = __importDefault(require("lodash.memoize"));
21
+ var types_1 = require("../types");
16
22
  var Localization = (function () {
17
23
  function Localization() {
18
24
  }
19
25
  var _b;
20
26
  _b = Localization;
21
27
  Localization.translationGetters = (_a = {},
22
- _a[SupportedLanguage.ENGLISH] = function () { return require('./translations/en.json'); },
23
- _a[SupportedLanguage.DUTCH] = function () { return require('./translations/nl.json'); },
28
+ _a[types_1.SupportedLanguage.ENGLISH] = function () { return require('./translations/en.json'); },
29
+ _a[types_1.SupportedLanguage.DUTCH] = function () { return require('./translations/nl.json'); },
24
30
  _a);
25
- Localization.translate = memoize(function (key, config) {
31
+ Localization.translate = (0, lodash_memoize_1["default"])(function (key, config) {
26
32
  var _a, _c;
27
- if (Object.keys(i18n.translations).length === 0) {
28
- i18n.translations = (_a = {},
29
- _a[SupportedLanguage.ENGLISH] = Localization.translationGetters[SupportedLanguage.ENGLISH](),
33
+ if (Object.keys(i18n_js_1["default"].translations).length === 0) {
34
+ i18n_js_1["default"].translations = (_a = {},
35
+ _a[types_1.SupportedLanguage.ENGLISH] = Localization.translationGetters[types_1.SupportedLanguage.ENGLISH](),
30
36
  _a);
31
- i18n.locale = SupportedLanguage.ENGLISH;
37
+ i18n_js_1["default"].locale = types_1.SupportedLanguage.ENGLISH;
32
38
  }
33
39
  else {
34
- i18n.translations = (_c = {},
35
- _c[i18n.locale] = __assign(__assign({}, i18n.translations[i18n.locale]), Localization.translationGetters[_b.findSupportedLanguage(i18n.locale) || SupportedLanguage.ENGLISH]()),
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]()),
36
42
  _c);
37
43
  }
38
- return i18n.t(key, config);
44
+ return i18n_js_1["default"].t(key, config);
39
45
  }, function (key, config) { return (config ? key + JSON.stringify(config) : key); });
40
46
  Localization.findSupportedLanguage = function (locale) {
41
- for (var _i = 0, _a = Object.values(SupportedLanguage); _i < _a.length; _i++) {
47
+ for (var _i = 0, _a = Object.values(types_1.SupportedLanguage); _i < _a.length; _i++) {
42
48
  var language = _a[_i];
43
49
  if (language === locale) {
44
50
  return language;
@@ -46,9 +52,9 @@ var Localization = (function () {
46
52
  }
47
53
  };
48
54
  Localization.getLocale = function () {
49
- return i18n.locale || SupportedLanguage.ENGLISH;
55
+ return i18n_js_1["default"].locale || types_1.SupportedLanguage.ENGLISH;
50
56
  };
51
57
  return Localization;
52
58
  }());
53
- export var translate = Localization.translate;
54
- export default Localization;
59
+ exports.translate = Localization.translate;
60
+ exports["default"] = Localization;
@@ -1,3 +1,19 @@
1
- export * from './ssi/colors';
2
- export * from './ssi/typography';
3
- export * from './ssi/css';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
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,44 +1,47 @@
1
- export var backgroundColors = {
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.profileColors = exports.borderColors = exports.gradientColors = exports.fontColors = exports.statusColors = exports.logoColors = exports.credentialCardColors = exports.backgroundColors = void 0;
4
+ exports.backgroundColors = {
2
5
  primaryDark: '#202537',
3
6
  secondaryDark: '#2C334B',
4
7
  primaryLight: '#FBFBFB',
5
8
  secondaryLight: '#E3E3FF',
6
- lightGrey: '#E3E3E3',
9
+ lightGrey: '#E3E3E3'
7
10
  };
8
- export var credentialCardColors = {
9
- default: '#5BDED2',
11
+ exports.credentialCardColors = {
12
+ "default": '#5BDED2'
10
13
  };
11
- export var logoColors = {
12
- default: '#FBFBFB',
14
+ exports.logoColors = {
15
+ "default": '#FBFBFB'
13
16
  };
14
- export var statusColors = {
17
+ exports.statusColors = {
15
18
  valid: '#00C249',
16
19
  expired: '#FF9900',
17
20
  revoked: '#EE5309',
18
21
  verified: '#00C249',
19
22
  unverified: '#FF9900',
20
- error: '#D74500',
23
+ error: '#D74500'
21
24
  };
22
- export var fontColors = {
25
+ exports.fontColors = {
23
26
  dark: '#303030',
24
27
  light: '#FBFBFB',
25
28
  secondaryButton: '#7664F2',
26
29
  greyedOut: '#8F8F8F',
27
- lightGrey: '#8D9099',
30
+ lightGrey: '#8D9099'
28
31
  };
29
- export var gradientColors = {
32
+ exports.gradientColors = {
30
33
  100: 'linear-gradient(135deg, #7276f7 0%, #7c40e8 100%)',
31
- 200: 'linear-gradient(135deg, #F90 0%, #EE5309 100%)',
34
+ 200: 'linear-gradient(135deg, #F90 0%, #EE5309 100%)'
32
35
  };
33
- export var borderColors = {
36
+ exports.borderColors = {
34
37
  dark: '#404D7A',
35
38
  light: '#E3E3E3',
36
- lightGrey: '#ACACAC',
39
+ lightGrey: '#ACACAC'
37
40
  };
38
- export var profileColors = {
41
+ exports.profileColors = {
39
42
  100: '#EE5209',
40
43
  200: '#FF9900',
41
44
  300: '#5BDED3',
42
45
  400: '#0B81FF',
43
- 500: '#BD2DFF',
46
+ 500: '#BD2DFF'
44
47
  };
@@ -1,7 +1,10 @@
1
+ "use strict";
1
2
  var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
3
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
4
  return cooked;
4
5
  };
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"])));
6
+ exports.__esModule = true;
7
+ exports.SSIRoundedEdgesCss = void 0;
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"])));
7
10
  var templateObject_1;
@@ -1,4 +1,7 @@
1
- export var fontSize = {
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.fontWeight = exports.lineHeight = exports.fontSize = void 0;
4
+ exports.fontSize = {
2
5
  100: 9,
3
6
  200: 10,
4
7
  300: 11,
@@ -6,9 +9,9 @@ export var fontSize = {
6
9
  500: 14,
7
10
  600: 16,
8
11
  700: 24,
9
- 800: 36,
12
+ 800: 36
10
13
  };
11
- export var lineHeight = {
14
+ exports.lineHeight = {
12
15
  100: 13.5,
13
16
  200: 15,
14
17
  300: 16.5,
@@ -16,9 +19,9 @@ export var lineHeight = {
16
19
  500: 21,
17
20
  600: 24,
18
21
  700: 34,
19
- 800: 54,
22
+ 800: 54
20
23
  };
21
- export var fontWeight = {
24
+ exports.fontWeight = {
22
25
  normal: 'normal',
23
26
  bold: 'bold',
24
27
  100: '100',
@@ -29,5 +32,5 @@ export var fontWeight = {
29
32
  600: '600',
30
33
  700: '700',
31
34
  800: '800',
32
- 900: '900',
35
+ 900: '900'
33
36
  };
@@ -1,11 +1,14 @@
1
- export var CredentialStatus;
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.IssuerStatus = exports.CredentialStatus = void 0;
4
+ var CredentialStatus;
2
5
  (function (CredentialStatus) {
3
6
  CredentialStatus["VALID"] = "valid";
4
7
  CredentialStatus["EXPIRED"] = "expired";
5
8
  CredentialStatus["REVOKED"] = "revoked";
6
- })(CredentialStatus || (CredentialStatus = {}));
7
- export var IssuerStatus;
9
+ })(CredentialStatus = exports.CredentialStatus || (exports.CredentialStatus = {}));
10
+ var IssuerStatus;
8
11
  (function (IssuerStatus) {
9
12
  IssuerStatus["VERIFIED"] = "verified";
10
13
  IssuerStatus["UNVERIFIED"] = "unverified";
11
- })(IssuerStatus || (IssuerStatus = {}));
14
+ })(IssuerStatus = exports.IssuerStatus || (exports.IssuerStatus = {}));
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ exports.__esModule = true;
@@ -1,3 +1,19 @@
1
- export * from './credential';
2
- export * from './image';
3
- export * from './localization';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
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,5 +1,8 @@
1
- export var SupportedLanguage;
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.SupportedLanguage = void 0;
4
+ var SupportedLanguage;
2
5
  (function (SupportedLanguage) {
3
6
  SupportedLanguage["ENGLISH"] = "en";
4
7
  SupportedLanguage["DUTCH"] = "nl";
5
- })(SupportedLanguage || (SupportedLanguage = {}));
8
+ })(SupportedLanguage = exports.SupportedLanguage || (exports.SupportedLanguage = {}));
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __assign = (this && this.__assign) || function () {
2
3
  __assign = Object.assign || function(t) {
3
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -9,33 +10,41 @@ var __assign = (this && this.__assign) || function () {
9
10
  };
10
11
  return __assign.apply(this, arguments);
11
12
  };
12
- import Localization from '../localization/Localization';
13
- export var EPOCH_MILLISECONDS = 1000;
14
- export var DATE_FORMAT_OPTIONS = {
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
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 = {
15
21
  year: 'numeric',
16
22
  month: 'numeric',
17
- day: 'numeric',
23
+ day: 'numeric'
18
24
  };
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' }));
25
+ var toLocalDateTimeString = function (date) {
26
+ return new Date(formatDate(date)).toLocaleString(Localization_1["default"].getLocale(), __assign(__assign({}, exports.DATE_FORMAT_OPTIONS), { hour: 'numeric', minute: 'numeric', second: 'numeric' }));
21
27
  };
22
- export var toLocalDateString = function (date) {
23
- return new Date(formatDate(date)).toLocaleDateString(Localization.getLocale(), DATE_FORMAT_OPTIONS);
28
+ exports.toLocalDateTimeString = toLocalDateTimeString;
29
+ var toLocalDateString = function (date) {
30
+ return new Date(formatDate(date)).toLocaleDateString(Localization_1["default"].getLocale(), exports.DATE_FORMAT_OPTIONS);
24
31
  };
32
+ exports.toLocalDateString = toLocalDateString;
25
33
  var formatDate = function (date) {
26
34
  var epoch = date;
27
35
  epoch = removeFractionalPart(epoch);
28
36
  if (!isEpochMilli(epoch)) {
29
- epoch = makeEpochMilli(epoch);
37
+ epoch = (0, exports.makeEpochMilli)(epoch);
30
38
  }
31
39
  return epoch;
32
40
  };
33
- export var makeEpochMilli = function (date) {
41
+ var makeEpochMilli = function (date) {
34
42
  if (!isEpochMilli(date)) {
35
- date = date * EPOCH_MILLISECONDS;
43
+ date = date * exports.EPOCH_MILLISECONDS;
36
44
  }
37
45
  return date;
38
46
  };
47
+ exports.makeEpochMilli = makeEpochMilli;
39
48
  var isEpochMilli = function (date) {
40
49
  return date.toString().length > 10;
41
50
  };
@@ -1,3 +1,7 @@
1
- export var calculateAspectRatio = function (width, height) {
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.calculateAspectRatio = void 0;
4
+ var calculateAspectRatio = function (width, height) {
2
5
  return width / height;
3
6
  };
7
+ exports.calculateAspectRatio = calculateAspectRatio;
@@ -1,18 +1,25 @@
1
- import { CredentialStatus, IssuerStatus } from '../types';
2
- import Localization from '../localization/Localization';
3
- export var getStatusTranslation = function (status) {
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
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) {
4
10
  switch (status) {
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');
11
+ case types_1.IssuerStatus.VERIFIED:
12
+ return Localization_1["default"].translate('issuer_status_verified');
13
+ case types_1.IssuerStatus.UNVERIFIED:
14
+ return Localization_1["default"].translate('issuer_status_unverified');
15
+ case types_1.CredentialStatus.VALID:
16
+ return Localization_1["default"].translate('credential_status_valid');
17
+ case types_1.CredentialStatus.EXPIRED:
18
+ return Localization_1["default"].translate('credential_status_expired');
19
+ case types_1.CredentialStatus.REVOKED:
20
+ return Localization_1["default"].translate('credential_status_revoked');
15
21
  default:
16
- return Localization.translate('status_missing');
22
+ return Localization_1["default"].translate('status_missing');
17
23
  }
18
24
  };
25
+ exports.getStatusTranslation = getStatusTranslation;
@@ -1,4 +1,7 @@
1
- export var getInitials = function (fullName) {
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.getInitials = void 0;
4
+ var getInitials = function (fullName) {
2
5
  if (fullName && fullName.length > 0) {
3
6
  var namePartsArray = fullName.trim().split(' ');
4
7
  var firstInitial = '';
@@ -20,3 +23,4 @@ export var getInitials = function (fullName) {
20
23
  }
21
24
  return '?';
22
25
  };
26
+ exports.getInitials = getInitials;
@@ -1,4 +1,20 @@
1
- export * from './ImageUtils';
2
- export * from './DateUtils';
3
- export * from './TranslationUtils';
4
- export * from './UserUtils';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
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("./ImageUtils"), exports);
18
+ __exportStar(require("./DateUtils"), exports);
19
+ __exportStar(require("./TranslationUtils"), exports);
20
+ __exportStar(require("./UserUtils"), 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.1.2-next.12+e845cd6",
4
+ "version": "0.1.2-next.17+6679422",
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": "e845cd64e05e4ad3af3844d3779341367700c4dc"
46
+ "gitHead": "6679422f3058b7c2420555c47ffe12891ba5acd9"
47
47
  }