@procivis/one-react-native-components 0.3.143 → 0.3.147

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.
Files changed (53) hide show
  1. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +6 -3
  2. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  3. package/lib/commonjs/ui-components/credential/card/credential-header.js +8 -38
  4. package/lib/commonjs/ui-components/credential/card/credential-header.js.map +1 -1
  5. package/lib/commonjs/ui-components/credential/card/credential-logo.js +71 -0
  6. package/lib/commonjs/ui-components/credential/card/credential-logo.js.map +1 -0
  7. package/lib/commonjs/ui-components/credential/card/index.js +7 -0
  8. package/lib/commonjs/ui-components/credential/card/index.js.map +1 -1
  9. package/lib/commonjs/ui-components/input/selection-input.js +69 -53
  10. package/lib/commonjs/ui-components/input/selection-input.js.map +1 -1
  11. package/lib/commonjs/ui-components/text/index.js +1 -9
  12. package/lib/commonjs/ui-components/text/index.js.map +1 -1
  13. package/lib/commonjs/utils/hooks/core/transaction.js +20 -0
  14. package/lib/commonjs/utils/hooks/core/transaction.js.map +1 -0
  15. package/lib/commonjs/utils/parsers/credential.js +22 -14
  16. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  17. package/lib/commonjs/utils/parsers/query.js +1 -1
  18. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  19. package/lib/module/components/proof-request/v2/share-credential-v2-group.js +6 -3
  20. package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  21. package/lib/module/ui-components/credential/card/credential-header.js +8 -38
  22. package/lib/module/ui-components/credential/card/credential-header.js.map +1 -1
  23. package/lib/module/ui-components/credential/card/credential-logo.js +64 -0
  24. package/lib/module/ui-components/credential/card/credential-logo.js.map +1 -0
  25. package/lib/module/ui-components/credential/card/index.js +2 -0
  26. package/lib/module/ui-components/credential/card/index.js.map +1 -1
  27. package/lib/module/ui-components/input/selection-input.js +70 -54
  28. package/lib/module/ui-components/input/selection-input.js.map +1 -1
  29. package/lib/module/ui-components/text/index.js +2 -2
  30. package/lib/module/ui-components/text/index.js.map +1 -1
  31. package/lib/module/utils/hooks/core/transaction.js +13 -0
  32. package/lib/module/utils/hooks/core/transaction.js.map +1 -0
  33. package/lib/module/utils/parsers/credential.js +20 -13
  34. package/lib/module/utils/parsers/credential.js.map +1 -1
  35. package/lib/module/utils/parsers/query.js +1 -1
  36. package/lib/module/utils/parsers/query.js.map +1 -1
  37. package/lib/typescript/ui-components/credential/card/credential-logo.d.ts +17 -0
  38. package/lib/typescript/ui-components/credential/card/index.d.ts +3 -0
  39. package/lib/typescript/ui-components/input/selection-input.d.ts +3 -7
  40. package/lib/typescript/ui-components/text/index.d.ts +2 -1
  41. package/lib/typescript/utils/hooks/core/transaction.d.ts +2 -0
  42. package/lib/typescript/utils/parsers/credential.d.ts +2 -1
  43. package/package.json +5 -3
  44. package/src/components/proof-request/v2/share-credential-v2-group.tsx +3 -0
  45. package/src/ui-components/credential/card/credential-header.tsx +9 -37
  46. package/src/ui-components/credential/card/credential-logo.stories.tsx +45 -0
  47. package/src/ui-components/credential/card/credential-logo.tsx +79 -0
  48. package/src/ui-components/credential/card/index.ts +5 -8
  49. package/src/ui-components/input/selection-input.tsx +85 -65
  50. package/src/ui-components/text/index.ts +2 -1
  51. package/src/utils/hooks/core/transaction.ts +18 -0
  52. package/src/utils/parsers/credential.ts +27 -13
  53. package/src/utils/parsers/query.ts +1 -0
@@ -19,6 +19,7 @@ import {
19
19
  CredentialCardProps,
20
20
  CredentialDetailsCardProps,
21
21
  CredentialHeaderProps,
22
+ CredentialLogoProps,
22
23
  } from '../../ui-components/credential';
23
24
  import { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';
24
25
  import {
@@ -86,6 +87,30 @@ const formatCredentialDetail = (
86
87
  return attributeValue.value ?? '';
87
88
  };
88
89
 
90
+ export const credentialLogoFromCredential = (
91
+ credential: CredentialDetail,
92
+ config: CoreConfig,
93
+ testID: string,
94
+ language: string | undefined,
95
+ ): Omit<CredentialLogoProps, 'size'> => {
96
+ const { layoutProperties } = credential.schema;
97
+ const defaultLanguage = config.globalSettings.defaultLanguage;
98
+ return {
99
+ color: layoutProperties?.logo?.backgroundColor,
100
+ credentialName:
101
+ getTranslatedLabel(credential.schema.translations?.name, language, defaultLanguage) ?? credential.schema.name,
102
+ icon: layoutProperties?.logo?.image
103
+ ? {
104
+ imageSource: {
105
+ uri: layoutProperties.logo.image,
106
+ },
107
+ }
108
+ : undefined,
109
+ iconLabelColor: layoutProperties?.logo?.fontColor,
110
+ testID,
111
+ };
112
+ };
113
+
89
114
  export const hasMsoValidityIssues = (credential: CredentialDetail): boolean => {
90
115
  const mdocMsoValidityIssue = Boolean(
91
116
  credential.mdocMsoValidity?.nextUpdate && new Date(credential.mdocMsoValidity.nextUpdate) < new Date(),
@@ -174,6 +199,7 @@ export const cardHeaderFromCredential = (
174
199
  labels: CardHeaderLabels,
175
200
  language: string | undefined,
176
201
  ): Omit<CredentialHeaderProps, 'style'> => {
202
+ const logoProps = credentialLogoFromCredential(credential, config, '', language);
177
203
  const {
178
204
  credentialDetailPrimary,
179
205
  credentialDetailSecondary,
@@ -181,25 +207,13 @@ export const cardHeaderFromCredential = (
181
207
  credentialDetailTestID,
182
208
  statusIcon,
183
209
  } = credentialDetailFromCredential(credential, claims, config, testID, labels, language);
184
- const { layoutProperties } = credential.schema;
185
- const defaultLanguage = config.globalSettings.defaultLanguage;
186
210
 
187
211
  return {
188
- color: layoutProperties?.logo?.backgroundColor,
212
+ ...logoProps,
189
213
  credentialDetailErrorColor,
190
214
  credentialDetailPrimary,
191
215
  credentialDetailSecondary,
192
216
  credentialDetailTestID,
193
- credentialName:
194
- getTranslatedLabel(credential.schema.translations?.name, language, defaultLanguage) ?? credential.schema.name,
195
- icon: layoutProperties?.logo?.image
196
- ? {
197
- imageSource: {
198
- uri: layoutProperties.logo.image,
199
- },
200
- }
201
- : undefined,
202
- iconLabelColor: layoutProperties?.logo?.fontColor,
203
217
  statusIcon,
204
218
  testID,
205
219
  };
@@ -71,6 +71,7 @@ export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<Histo
71
71
  'proofSchemaId',
72
72
  'search',
73
73
  'users',
74
+ 'trustCollectionId',
74
75
  ]);
75
76
  };
76
77