@sphereon/ui-components.core 0.1.3-unstable.99 → 0.2.1-unstable.2

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.
@@ -6,6 +6,7 @@
6
6
  "credential_status_valid": "Valid",
7
7
  "credential_status_expired": "Expired",
8
8
  "credential_status_revoked": "Revoked",
9
+ "credential_status_draft": "Draft",
9
10
  "workflow_status_approved": "Approved",
10
11
  "workflow_status_archived": "Archived",
11
12
  "workflow_status_declined": "Declined",
@@ -15,5 +16,23 @@
15
16
  "status_missing": "Unknown",
16
17
  "action_filter_caption": "Filter",
17
18
  "action_show_caption": "Show:",
18
- "result_count_label": "Showing {{count}} from {{maxCount}} results"
19
+ "result_count_label": "Showing {{count}} from {{maxCount}} results",
20
+ "action_delete_label": "Delete",
21
+ "table_pagination_input_caption_go_to": "Go to",
22
+ "table_pagination_input_caption_page": "page",
23
+ "drag_and_drop_upload_image_caption": "Click or drag to upload an image",
24
+ "drag_and_drop_upload_evidence_caption": "Click or drag to upload an evidence document",
25
+ "credential_attach_image_description": "This image will be attached to the credential.",
26
+ "credential_attach_evidence_description": "This document will be refer to the credential.",
27
+ "passport_photo_alt": "Passport Photo",
28
+ "credential_issuance_wizard_title": "Issue credential",
29
+ "credential_issuance_wizard_credential_type_label": "Credential type",
30
+ "credential_issuance_wizard_evidence_title": "Evidence",
31
+ "credential_issuance_wizard_evidence_optional_title": "(optional)",
32
+ "credential_issuance_wizard_evidence_description": "Optionally, you can upload one or more documents or files that you want to attach to this credential.",
33
+ "file_permission_public_label": "Public",
34
+ "file_permission_private_label": "Private",
35
+ "credentials_view_item_expires_on": "Expires on",
36
+ "json_data_view_attribute_column_label": "Attribute",
37
+ "json_data_view_value_column_label": "Value"
19
38
  }
@@ -6,6 +6,7 @@
6
6
  "credential_status_valid": "Geldig",
7
7
  "credential_status_expired": "Verlopen",
8
8
  "credential_status_revoked": "Ingetrokken",
9
+ "credential_status_draft": "Ontwerp",
9
10
  "workflow_status_approved": "Goedgekeurd",
10
11
  "workflow_status_archived": "Gearchiveerd",
11
12
  "workflow_status_declined": "Afgewezen",
@@ -15,5 +16,23 @@
15
16
  "status_missing": "Onbekent",
16
17
  "action_filter_caption": "Filter",
17
18
  "action_show_caption": "Toon:",
18
- "result_count_label": "Toon {{count}} van {{maxCount}} resultaten"
19
+ "result_count_label": "Toon {{count}} van {{maxCount}} resultaten",
20
+ "action_delete_label": "Verwijder",
21
+ "table_pagination_input_caption_go_to": "Ga naar",
22
+ "table_pagination_input_caption_page": "pagina",
23
+ "drag_and_drop_upload_image_caption": "Klik of sleep om een afbeelding te uploaden",
24
+ "drag_and_drop_upload_evidence_caption": "Klik of sleep om een bewijsdocument te uploaden",
25
+ "credential_attach_image_description": "Deze afbeelding wordt aan de credential toegevoegd.",
26
+ "credential_attach_evidence_description": "Dit document verwijst naar de credential.",
27
+ "passport_photo_alt": "Pasfoto",
28
+ "credential_issuance_wizard_title": "Credential uitgeven",
29
+ "credential_issuance_wizard_credential_type_label": "Credential type",
30
+ "credential_issuance_wizard_evidence_title": "Bewijs",
31
+ "credential_issuance_wizard_evidence_optional_title": "(optioneel)",
32
+ "credential_issuance_wizard_evidence_description": "Optioneel kunt u een of meer documenten of bestanden uploaden die u aan deze credential wilt toevoegen.",
33
+ "file_permission_public_label": "Openbaar",
34
+ "file_permission_private_label": "Privaat",
35
+ "credentials_view_item_expires_on": "Vervalt op",
36
+ "json_data_view_attribute_column_label": "Attribuut",
37
+ "json_data_view_value_column_label": "Waarde"
19
38
  }
@@ -1 +1,2 @@
1
1
  export declare const emailAddressValidationRegex: RegExp;
2
+ export declare const base64UriValidationRegex: RegExp;
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.emailAddressValidationRegex = void 0;
3
+ exports.base64UriValidationRegex = exports.emailAddressValidationRegex = void 0;
4
4
  exports.emailAddressValidationRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
5
+ exports.base64UriValidationRegex = /^data:image\/[a-zA-Z]+;base64,[A-Za-z0-9+\/_-]*(={0,2})?$/;
@@ -10,15 +10,15 @@ type FontColor = 'dark' | 'light' | 'secondaryButton' | 'greyedOut' | 'lightGrey
10
10
  export declare const fontColors: Record<FontColor, string>;
11
11
  type HighLightGradient = 100 | 200;
12
12
  export declare const gradientsColors: Record<HighLightGradient, GradientProperties>;
13
- type Border = 'dark' | 'light' | 'lightGrey';
13
+ type Border = 'dark' | 'light' | 'lightGrey' | 'darkGrey' | 'purple';
14
14
  export declare const borderColors: Record<Border, string>;
15
15
  type Profile = 100 | 200 | 300 | 400 | 500;
16
16
  export declare const profileColors: Record<Profile, string>;
17
17
  type Alerts = 'primaryLight' | 'secondaryLight';
18
18
  export declare const alertColors: Record<Alerts, string>;
19
- type SelectionElement = 'primaryDark' | 'primaryBorderDark';
19
+ type SelectionElement = 'primaryDark' | 'primaryBorderDark' | 'selectedRow';
20
20
  export declare const selectionElementColors: Record<SelectionElement, string>;
21
- type Element = 'blue' | 'lightGrey' | 'purple' | 100 | 200;
21
+ type Element = 'blue' | 'lightGrey' | 'purple' | 100 | 200 | 300;
22
22
  export declare const elementColors: Record<Element, string>;
23
23
  type Button = 100;
24
24
  export declare const buttonColors: Record<Button, string>;
@@ -22,12 +22,13 @@ exports.statusColors = {
22
22
  verified: '#00C249',
23
23
  unverified: '#FF9900',
24
24
  error: '#D74500',
25
- New: '#7276F7',
26
- Approved: '#00C249',
27
- Pending: '#0B81FF',
28
- Archived: '#B3B3B3',
29
- Declined: '#D74500',
30
- Done: '#00C249'
25
+ "new": '#7276F7',
26
+ approved: '#00C249',
27
+ pending: '#0B81FF',
28
+ archived: '#B3B3B3',
29
+ declined: '#D74500',
30
+ done: '#00C249',
31
+ draft: '#0B81FF'
31
32
  };
32
33
  exports.fontColors = {
33
34
  dark: '#303030',
@@ -49,7 +50,9 @@ exports.gradientsColors = {
49
50
  exports.borderColors = {
50
51
  dark: '#404D7A',
51
52
  light: '#E3E3E3',
52
- lightGrey: '#ACACAC'
53
+ lightGrey: '#ACACAC',
54
+ darkGrey: '#303030',
55
+ purple: '#7276F7'
53
56
  };
54
57
  exports.profileColors = {
55
58
  100: '#EE5209',
@@ -64,14 +67,16 @@ exports.alertColors = {
64
67
  };
65
68
  exports.selectionElementColors = {
66
69
  primaryDark: '#0B81FF',
67
- primaryBorderDark: '#FBFBFB'
70
+ primaryBorderDark: '#FBFBFB',
71
+ selectedRow: '#B7B8D9'
68
72
  };
69
73
  exports.elementColors = {
70
74
  blue: '#0B81FF',
71
75
  lightGrey: '#C4C4C4',
72
76
  purple: '#7276F7',
73
77
  100: '#F25409',
74
- 200: '#f78854'
78
+ 200: '#F78854',
79
+ 300: '#8D9099'
75
80
  };
76
81
  exports.buttonColors = {
77
82
  100: '#8B1900'
@@ -4,4 +4,4 @@ export type LineHeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 64;
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' | 'h1Regular' | 'h1SemiBold' | 'h2Regular' | 'h2SemiBold' | 'h3Regular' | 'h3SemiBold' | 'h4Regular' | 'h4SemiBold' | 'h5Regular' | 'h5SemiBold' | 'h6' | 'h7SemiBold' | 'Regular64';
7
+ export type FontStyle = 'h0SemiBold' | 'h1Regular' | 'h1SemiBold' | 'h2Regular' | 'h2SemiBold' | 'h3Regular' | 'h3SemiBold' | 'h4Regular' | 'h4SemiBold' | 'h5Regular' | 'h5SemiBold' | 'h6' | 'h7Regular' | 'h7SemiBold' | 'Regular64';
@@ -0,0 +1,5 @@
1
+ export type ParsedBase64Uri = {
2
+ base64Uri: string;
3
+ base64: string;
4
+ mimeType: string;
5
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ exports.__esModule = true;
@@ -1,7 +1,7 @@
1
1
  export declare enum ButtonIcon {
2
2
  ADD = "add",
3
3
  ARROW_DOWN = "arrowDown",
4
- BITTERBALLEN = "bitterballen",
4
+ MEATBALLS = "meatballs",
5
5
  DELETE = "delete",
6
6
  FILTER = "filter"
7
7
  }
@@ -5,7 +5,7 @@ var ButtonIcon;
5
5
  (function (ButtonIcon) {
6
6
  ButtonIcon["ADD"] = "add";
7
7
  ButtonIcon["ARROW_DOWN"] = "arrowDown";
8
- ButtonIcon["BITTERBALLEN"] = "bitterballen";
8
+ ButtonIcon["MEATBALLS"] = "meatballs";
9
9
  ButtonIcon["DELETE"] = "delete";
10
10
  ButtonIcon["FILTER"] = "filter";
11
11
  })(ButtonIcon = exports.ButtonIcon || (exports.ButtonIcon = {}));
@@ -1,18 +1,19 @@
1
1
  export declare enum CredentialStatus {
2
2
  VALID = "valid",
3
3
  EXPIRED = "expired",
4
- REVOKED = "revoked"
4
+ REVOKED = "revoked",
5
+ DRAFT = "draft"
5
6
  }
6
7
  export declare enum IssuerStatus {
7
8
  VERIFIED = "verified",
8
9
  UNVERIFIED = "unverified"
9
10
  }
10
11
  export declare enum WorkflowStatus {
11
- NEW = "New",
12
- APPROVED = "Approved",
13
- DECLINED = "Declined",
14
- PENDING = "Pending",
15
- DONE = "Done",
16
- ARCHIVED = "Archived"
12
+ NEW = "new",
13
+ APPROVED = "approved",
14
+ DECLINED = "declined",
15
+ PENDING = "pending",
16
+ DONE = "done",
17
+ ARCHIVED = "archived"
17
18
  }
18
19
  export type LabelStatus = CredentialStatus | IssuerStatus | WorkflowStatus;
@@ -6,6 +6,7 @@ var CredentialStatus;
6
6
  CredentialStatus["VALID"] = "valid";
7
7
  CredentialStatus["EXPIRED"] = "expired";
8
8
  CredentialStatus["REVOKED"] = "revoked";
9
+ CredentialStatus["DRAFT"] = "draft";
9
10
  })(CredentialStatus = exports.CredentialStatus || (exports.CredentialStatus = {}));
10
11
  var IssuerStatus;
11
12
  (function (IssuerStatus) {
@@ -14,10 +15,10 @@ var IssuerStatus;
14
15
  })(IssuerStatus = exports.IssuerStatus || (exports.IssuerStatus = {}));
15
16
  var WorkflowStatus;
16
17
  (function (WorkflowStatus) {
17
- WorkflowStatus["NEW"] = "New";
18
- WorkflowStatus["APPROVED"] = "Approved";
19
- WorkflowStatus["DECLINED"] = "Declined";
20
- WorkflowStatus["PENDING"] = "Pending";
21
- WorkflowStatus["DONE"] = "Done";
22
- WorkflowStatus["ARCHIVED"] = "Archived";
18
+ WorkflowStatus["NEW"] = "new";
19
+ WorkflowStatus["APPROVED"] = "approved";
20
+ WorkflowStatus["DECLINED"] = "declined";
21
+ WorkflowStatus["PENDING"] = "pending";
22
+ WorkflowStatus["DONE"] = "done";
23
+ WorkflowStatus["ARCHIVED"] = "archived";
23
24
  })(WorkflowStatus = exports.WorkflowStatus || (exports.WorkflowStatus = {}));
@@ -1,9 +1,13 @@
1
1
  export type ImageSize = {
2
2
  height: number;
3
3
  width: number;
4
+ aspectRatio?: number;
4
5
  };
5
6
  export type ImageAttributes = {
6
7
  uri?: string;
7
8
  alt?: string;
8
9
  dimensions?: ImageSize;
10
+ style?: {
11
+ height?: number;
12
+ };
9
13
  };
@@ -6,3 +6,4 @@ export * from './localization';
6
6
  export * from './tab';
7
7
  export * from './toast';
8
8
  export * from './style';
9
+ export * from './base64';
@@ -22,3 +22,4 @@ __exportStar(require("./localization"), exports);
22
22
  __exportStar(require("./tab"), exports);
23
23
  __exportStar(require("./toast"), exports);
24
24
  __exportStar(require("./style"), exports);
25
+ __exportStar(require("./base64"), exports);
@@ -0,0 +1,3 @@
1
+ import { ParsedBase64Uri } from '../types';
2
+ export declare const getFileSizeDisplay: (bytes: number) => string;
3
+ export declare const parseBase64Uri: (base64Uri: string) => ParsedBase64Uri;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.parseBase64Uri = exports.getFileSizeDisplay = void 0;
4
+ var getFileSizeDisplay = function (bytes) {
5
+ if (bytes < 1024) {
6
+ return "".concat(bytes, " B");
7
+ }
8
+ else if (bytes <= 1024 * 1024) {
9
+ return "".concat((bytes / 1024).toFixed(1), " KB");
10
+ }
11
+ else if (bytes <= 1024 * 1024 * 1024) {
12
+ return "".concat((bytes / (1024 * 1024)).toFixed(1), " MB");
13
+ }
14
+ else {
15
+ return "".concat((bytes / (1024 * 1024 * 1024)).toFixed(1), " GB");
16
+ }
17
+ };
18
+ exports.getFileSizeDisplay = getFileSizeDisplay;
19
+ var parseBase64Uri = function (base64Uri) {
20
+ var base64Parts = base64Uri.split(';base64,');
21
+ var mimeType = base64Parts[0].replace('data:', '');
22
+ return {
23
+ base64Uri: base64Uri,
24
+ base64: base64Parts[1],
25
+ mimeType: mimeType
26
+ };
27
+ };
28
+ exports.parseBase64Uri = parseBase64Uri;
@@ -1 +1,2 @@
1
1
  export declare const calculateAspectRatio: (width: number, height: number) => number;
2
+ export declare const isBase64ImageUri: (value: unknown) => boolean;
@@ -1,7 +1,15 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.calculateAspectRatio = void 0;
3
+ exports.isBase64ImageUri = exports.calculateAspectRatio = void 0;
4
+ var regexes_1 = require("../regexes");
4
5
  var calculateAspectRatio = function (width, height) {
5
6
  return width / height;
6
7
  };
7
8
  exports.calculateAspectRatio = calculateAspectRatio;
9
+ var isBase64ImageUri = function (value) {
10
+ if (typeof value === 'string') {
11
+ return regexes_1.base64UriValidationRegex.test(value);
12
+ }
13
+ return false;
14
+ };
15
+ exports.isBase64ImageUri = isBase64ImageUri;
@@ -18,6 +18,8 @@ var getStatusTranslation = function (status) {
18
18
  return Localization_1["default"].translate('credential_status_expired');
19
19
  case types_1.CredentialStatus.REVOKED:
20
20
  return Localization_1["default"].translate('credential_status_revoked');
21
+ case types_1.CredentialStatus.DRAFT:
22
+ return Localization_1["default"].translate('credential_status_draft');
21
23
  case types_1.WorkflowStatus.APPROVED:
22
24
  return Localization_1["default"].translate('workflow_status_approved');
23
25
  case types_1.WorkflowStatus.ARCHIVED:
@@ -0,0 +1,2 @@
1
+ export declare const isBoolean: (value: unknown) => boolean;
2
+ export declare const parseToBoolean: (value: unknown) => boolean | null;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.parseToBoolean = exports.isBoolean = void 0;
4
+ var isBoolean = function (value) {
5
+ if (typeof value === 'boolean') {
6
+ return true;
7
+ }
8
+ else if (typeof value === 'string') {
9
+ var lowercaseValue = value.toLowerCase();
10
+ return lowercaseValue === 'true' || lowercaseValue === 'false';
11
+ }
12
+ else {
13
+ return false;
14
+ }
15
+ };
16
+ exports.isBoolean = isBoolean;
17
+ var parseToBoolean = function (value) {
18
+ if (typeof value === 'boolean') {
19
+ return value;
20
+ }
21
+ else if (typeof value === 'string') {
22
+ var lowercaseValue = value.toLowerCase();
23
+ if (lowercaseValue === 'true') {
24
+ return true;
25
+ }
26
+ else if (lowercaseValue === 'false') {
27
+ return false;
28
+ }
29
+ }
30
+ return null;
31
+ };
32
+ exports.parseToBoolean = parseToBoolean;
@@ -2,3 +2,5 @@ export * from './ImageUtils';
2
2
  export * from './DateUtils';
3
3
  export * from './TranslationUtils';
4
4
  export * from './UserUtils';
5
+ export * from './FileUtils';
6
+ export * from './TypeUtils';
@@ -18,3 +18,5 @@ __exportStar(require("./ImageUtils"), exports);
18
18
  __exportStar(require("./DateUtils"), exports);
19
19
  __exportStar(require("./TranslationUtils"), exports);
20
20
  __exportStar(require("./UserUtils"), exports);
21
+ __exportStar(require("./FileUtils"), exports);
22
+ __exportStar(require("./TypeUtils"), 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.3-unstable.99+c8885e8",
4
+ "version": "0.2.1-unstable.2+4c8020a",
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>",
@@ -35,13 +35,13 @@
35
35
  "@types/i18n-js": "^3.8.4",
36
36
  "@types/lodash.memoize": "^4.1.7",
37
37
  "@types/node": "^20.4.0",
38
- "@types/react": "~18.0.14",
38
+ "@types/react": "~18.2.67",
39
39
  "@types/styled-components": "^5.1.15",
40
40
  "react": "18.2.0",
41
41
  "typescript": "4.9.5"
42
42
  },
43
43
  "peerDependencies": {
44
- "react": ">= 16.8.0"
44
+ "react": ">= 18"
45
45
  },
46
- "gitHead": "c8885e82d8b36ec6f2564dcc33d4aa4933a759ea"
46
+ "gitHead": "4c8020a435287a10dca85c22eac2a8841a9ad6ed"
47
47
  }