@procivis/one-react-native-components 0.3.130 → 0.3.142

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 (126) hide show
  1. package/lib/commonjs/components/history/history-list-item-icon.js +3 -0
  2. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
  3. package/lib/commonjs/components/history/history-list-item.js +3 -4
  4. package/lib/commonjs/components/history/history-list-item.js.map +1 -1
  5. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +3 -1
  6. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
  7. package/lib/commonjs/ui-components/buttons/scan-button.js +122 -27
  8. package/lib/commonjs/ui-components/buttons/scan-button.js.map +1 -1
  9. package/lib/commonjs/ui-components/credential/card/credential-details-card.js +37 -18
  10. package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
  11. package/lib/commonjs/ui-components/credential/credential-attribute-item.js +13 -4
  12. package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
  13. package/lib/commonjs/ui-components/history/history-section-list-item.js +2 -2
  14. package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
  15. package/lib/commonjs/ui-components/history/index.js +0 -8
  16. package/lib/commonjs/ui-components/history/index.js.map +1 -1
  17. package/lib/commonjs/ui-components/icons/icons.js +36 -2
  18. package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
  19. package/lib/commonjs/ui-components/list/index.js +8 -0
  20. package/lib/commonjs/ui-components/list/index.js.map +1 -1
  21. package/lib/commonjs/ui-components/{history/history-item.js → list/list-item.js} +32 -22
  22. package/lib/commonjs/ui-components/list/list-item.js.map +1 -0
  23. package/lib/commonjs/ui-components/list/wallet/empty-list.js +2 -1
  24. package/lib/commonjs/ui-components/list/wallet/empty-list.js.map +1 -1
  25. package/lib/commonjs/ui-components/notice/wallet-notice.js +4 -2
  26. package/lib/commonjs/ui-components/notice/wallet-notice.js.map +1 -1
  27. package/lib/commonjs/ui-components/text/expandableTypography.js +64 -0
  28. package/lib/commonjs/ui-components/text/expandableTypography.js.map +1 -0
  29. package/lib/commonjs/ui-components/text/index.js +15 -0
  30. package/lib/commonjs/ui-components/text/index.js.map +1 -1
  31. package/lib/commonjs/utils/hooks/core/credential-schemas.js +24 -1
  32. package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
  33. package/lib/commonjs/utils/hooks/core/wallet-unit.js +20 -1
  34. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
  35. package/lib/commonjs/utils/parsers/credential-sharing-v2.js +8 -7
  36. package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
  37. package/lib/commonjs/utils/parsers/credential-sharing.js +17 -11
  38. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  39. package/lib/commonjs/utils/parsers/credential.js +12 -4
  40. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  41. package/lib/commonjs/utils/parsers/query.js +1 -1
  42. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  43. package/lib/module/components/history/history-list-item-icon.js +3 -0
  44. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  45. package/lib/module/components/history/history-list-item.js +4 -5
  46. package/lib/module/components/history/history-list-item.js.map +1 -1
  47. package/lib/module/components/proof-request/v2/share-credential-v2.js +3 -1
  48. package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
  49. package/lib/module/ui-components/buttons/scan-button.js +124 -29
  50. package/lib/module/ui-components/buttons/scan-button.js.map +1 -1
  51. package/lib/module/ui-components/credential/card/credential-details-card.js +37 -18
  52. package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
  53. package/lib/module/ui-components/credential/credential-attribute-item.js +13 -4
  54. package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
  55. package/lib/module/ui-components/history/history-section-list-item.js +2 -2
  56. package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
  57. package/lib/module/ui-components/history/index.js +0 -2
  58. package/lib/module/ui-components/history/index.js.map +1 -1
  59. package/lib/module/ui-components/icons/icons.js +32 -0
  60. package/lib/module/ui-components/icons/icons.js.map +1 -1
  61. package/lib/module/ui-components/list/index.js +2 -0
  62. package/lib/module/ui-components/list/index.js.map +1 -1
  63. package/lib/module/ui-components/{history/history-item.js → list/list-item.js} +32 -22
  64. package/lib/module/ui-components/list/list-item.js.map +1 -0
  65. package/lib/module/ui-components/list/wallet/empty-list.js +2 -1
  66. package/lib/module/ui-components/list/wallet/empty-list.js.map +1 -1
  67. package/lib/module/ui-components/notice/wallet-notice.js +4 -2
  68. package/lib/module/ui-components/notice/wallet-notice.js.map +1 -1
  69. package/lib/module/ui-components/text/expandableTypography.js +55 -0
  70. package/lib/module/ui-components/text/expandableTypography.js.map +1 -0
  71. package/lib/module/ui-components/text/index.js +2 -1
  72. package/lib/module/ui-components/text/index.js.map +1 -1
  73. package/lib/module/utils/hooks/core/credential-schemas.js +24 -1
  74. package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
  75. package/lib/module/utils/hooks/core/wallet-unit.js +18 -0
  76. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
  77. package/lib/module/utils/parsers/credential-sharing-v2.js +8 -7
  78. package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
  79. package/lib/module/utils/parsers/credential-sharing.js +18 -12
  80. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  81. package/lib/module/utils/parsers/credential.js +10 -4
  82. package/lib/module/utils/parsers/credential.js.map +1 -1
  83. package/lib/module/utils/parsers/query.js +1 -1
  84. package/lib/module/utils/parsers/query.js.map +1 -1
  85. package/lib/typescript/ui-components/buttons/scan-button.d.ts +9 -3
  86. package/lib/typescript/ui-components/credential/card/credential-details-card.d.ts +3 -0
  87. package/lib/typescript/ui-components/credential/credential-attribute-item.d.ts +3 -0
  88. package/lib/typescript/ui-components/history/history-section-list-item.d.ts +2 -2
  89. package/lib/typescript/ui-components/history/index.d.ts +0 -3
  90. package/lib/typescript/ui-components/icons/icons.d.ts +2 -0
  91. package/lib/typescript/ui-components/list/index.d.ts +3 -0
  92. package/lib/typescript/ui-components/{history/history-item.d.ts → list/list-item.d.ts} +4 -4
  93. package/lib/typescript/ui-components/list/wallet/empty-list.d.ts +2 -2
  94. package/lib/typescript/ui-components/text/expandableTypography.d.ts +10 -0
  95. package/lib/typescript/ui-components/text/index.d.ts +2 -1
  96. package/lib/typescript/ui-components/text/typography.d.ts +14 -14
  97. package/lib/typescript/utils/hooks/app-state.d.ts +1 -1
  98. package/lib/typescript/utils/hooks/core/credentials.d.ts +1 -1
  99. package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +5 -1
  100. package/lib/typescript/utils/parsers/credential-sharing.d.ts +4 -3
  101. package/lib/typescript/utils/parsers/credential.d.ts +2 -1
  102. package/lib/typescript/utils/parsers/query.d.ts +1 -1
  103. package/package.json +3 -3
  104. package/src/components/history/history-list-item-icon.tsx +3 -0
  105. package/src/components/history/history-list-item.tsx +3 -3
  106. package/src/components/proof-request/v2/share-credential-v2.tsx +2 -0
  107. package/src/ui-components/buttons/scan-button.tsx +130 -38
  108. package/src/ui-components/credential/card/credential-details-card.tsx +46 -19
  109. package/src/ui-components/credential/credential-attribute-item.tsx +15 -3
  110. package/src/ui-components/history/history-section-list-item.tsx +3 -3
  111. package/src/ui-components/history/index.ts +0 -3
  112. package/src/ui-components/icons/icons.tsx +24 -0
  113. package/src/ui-components/list/index.ts +3 -0
  114. package/src/ui-components/{history/history-item.tsx → list/list-item.tsx} +36 -33
  115. package/src/ui-components/list/wallet/empty-list.tsx +11 -8
  116. package/src/ui-components/notice/wallet-notice.tsx +4 -2
  117. package/src/ui-components/text/expandableTypography.tsx +71 -0
  118. package/src/ui-components/text/index.ts +2 -1
  119. package/src/utils/hooks/core/credential-schemas.ts +23 -1
  120. package/src/utils/hooks/core/wallet-unit.ts +21 -0
  121. package/src/utils/parsers/credential-sharing-v2.tsx +5 -6
  122. package/src/utils/parsers/credential-sharing.tsx +20 -9
  123. package/src/utils/parsers/credential.ts +14 -3
  124. package/src/utils/parsers/query.ts +2 -0
  125. package/lib/commonjs/ui-components/history/history-item.js.map +0 -1
  126. package/lib/module/ui-components/history/history-item.js.map +0 -1
@@ -19,10 +19,12 @@ const defaultIcons = {
19
19
  DELETED: _uiComponents.HistoryStatusDeleteIcon,
20
20
  ERRORED: _uiComponents.HistoryStatusErrorIcon,
21
21
  IMPORTED: _uiComponents.HistoryStatusAcceptedIcon,
22
+ SIGNED: _uiComponents.HistoryStatusAcceptedIcon,
22
23
  ISSUED: _uiComponents.HistoryStatusAcceptedIcon,
23
24
  OFFERED: _uiComponents.HistoryStatusAcceptedIcon,
24
25
  PENDING: _uiComponents.HistoryStatusAcceptedIcon,
25
26
  REJECTED: _uiComponents.HistoryStatusErrorIcon,
27
+ REFRESHED: _uiComponents.HistoryStatusAcceptedIcon,
26
28
  REMOVED: _uiComponents.HistoryStatusDeleteIcon,
27
29
  REQUESTED: _uiComponents.HistoryStatusAcceptedIcon,
28
30
  RESTORED: _uiComponents.HistoryStatusAcceptedIcon,
@@ -53,6 +55,7 @@ const defaultIcons = {
53
55
  IDENTIFIER: _uiComponents.HistoryIdentifierIcon,
54
56
  KEY: _uiComponents.HistoryKeyIcon,
55
57
  ORGANISATION: _uiComponents.HistoryOrganisationIcon,
58
+ QES_DOCUMENT: _uiComponents.HistoryCredentialIcon,
56
59
  PROOF: _uiComponents.HistoryProofRequestIcon,
57
60
  PROOF_SCHEMA: _uiComponents.HistorySchemaIcon,
58
61
  WALLET_UNIT: _uiComponents.HistoryTrustedEntityIcon,
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeOneCore","require","_react","_interopRequireWildcard","_uiComponents","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","defaultIcons","actions","ACCEPTED","HistoryStatusAcceptedIcon","ACTIVATED","CLAIMS_REMOVED","HistoryStatusDeleteIcon","CREATED","DEACTIVATED","HistoryStatusErrorIcon","DELETED","ERRORED","IMPORTED","ISSUED","OFFERED","PENDING","REJECTED","REMOVED","REQUESTED","RESTORED","RETRACTED","REVOKED","SHARED","SUSPENDED","HistoryStatusSuspendIcon","UPDATED","WITHDRAWN","REACTIVATED","CSR_GENERATED","EXPIRED","INTERACTION_CREATED","INTERACTION_ERRORED","INTERACTION_EXPIRED","DELIVERED","WRP_AC_RECEIVED","WRP_RC_RECEIVED","WRP_NR_RECEIVED","TRUST_RESOLVED","entityTypes","BACKUP","HistoryRevokeIcon","CERTIFICATE","HistoryCertificateIcon","CREDENTIAL","HistoryCredentialIcon","CREDENTIAL_SCHEMA","HistorySchemaIcon","DID","HistoryDidIcon","IDENTIFIER","HistoryIdentifierIcon","KEY","HistoryKeyIcon","ORGANISATION","HistoryOrganisationIcon","PROOF","HistoryProofRequestIcon","PROOF_SCHEMA","WALLET_UNIT","HistoryTrustedEntityIcon","WALLET_RELYING_PARTY","USER","PROVIDER","STS_ROLE","STS_ORGANISATION","STS_IAM_ROLE","STS_TOKEN","SIGNATURE","STS_SESSION","NOTIFICATION","SUPERVISORY_AUTHORITY","TRUST_LIST_PUBLICATION","HistoryTrustAnchorIcon","TRUST_COLLECTION","TRUST_LIST_SUBSCRIPTION","VERIFIER_INSTANCE","getHistoryItemActionIcon","action","_defaultIcons$actions","exports","HistoryListItemIcon","item","statusIcon","typeIcon","useMemo","_defaultIcons$entityT","entityType","HistoryEntityType","HistoryAction","HistoryBackupCreatedIcon","HistoryBackupRestoredIcon","HistorySuspendIcon","HistoryIssueIcon","createElement","HistoryItemIcon","StatusIcon","TypeIcon"],"sources":["history-list-item-icon.tsx"],"sourcesContent":["import { HistoryAction, HistoryEntityType, HistoryListItem } from '@procivis/react-native-one-core';\nimport React, { FC, useMemo } from 'react';\nimport { SvgProps } from 'react-native-svg';\n\nimport {\n HistoryBackupCreatedIcon,\n HistoryBackupRestoredIcon,\n HistoryCertificateIcon,\n HistoryCredentialIcon,\n HistoryDidIcon,\n HistoryIdentifierIcon,\n HistoryIssueIcon,\n HistoryItemIcon,\n HistoryKeyIcon,\n HistoryOrganisationIcon,\n HistoryProofRequestIcon,\n HistoryRevokeIcon,\n HistorySchemaIcon,\n HistoryStatusAcceptedIcon,\n HistoryStatusDeleteIcon,\n HistoryStatusErrorIcon,\n HistoryStatusSuspendIcon,\n HistorySuspendIcon,\n HistoryTrustAnchorIcon,\n HistoryTrustedEntityIcon,\n} from '../../ui-components';\n\nconst defaultIcons: {\n actions: { [key in keyof typeof HistoryAction]: FC<SvgProps> };\n entityTypes: { [key in keyof typeof HistoryEntityType]: FC<SvgProps> };\n} = {\n actions: {\n ACCEPTED: HistoryStatusAcceptedIcon,\n ACTIVATED: HistoryStatusAcceptedIcon,\n CLAIMS_REMOVED: HistoryStatusDeleteIcon,\n CREATED: HistoryStatusAcceptedIcon,\n DEACTIVATED: HistoryStatusErrorIcon,\n DELETED: HistoryStatusDeleteIcon,\n ERRORED: HistoryStatusErrorIcon,\n IMPORTED: HistoryStatusAcceptedIcon,\n ISSUED: HistoryStatusAcceptedIcon,\n OFFERED: HistoryStatusAcceptedIcon,\n PENDING: HistoryStatusAcceptedIcon,\n REJECTED: HistoryStatusErrorIcon,\n REMOVED: HistoryStatusDeleteIcon,\n REQUESTED: HistoryStatusAcceptedIcon,\n RESTORED: HistoryStatusAcceptedIcon,\n RETRACTED: HistoryStatusErrorIcon,\n REVOKED: HistoryStatusErrorIcon,\n SHARED: HistoryStatusAcceptedIcon,\n SUSPENDED: HistoryStatusSuspendIcon,\n UPDATED: HistoryStatusAcceptedIcon,\n WITHDRAWN: HistoryStatusErrorIcon,\n REACTIVATED: HistoryStatusAcceptedIcon,\n CSR_GENERATED: HistoryStatusAcceptedIcon,\n EXPIRED: HistoryStatusErrorIcon,\n INTERACTION_CREATED: HistoryStatusAcceptedIcon,\n INTERACTION_ERRORED: HistoryStatusErrorIcon,\n INTERACTION_EXPIRED: HistoryStatusErrorIcon,\n DELIVERED: HistoryStatusAcceptedIcon,\n WRP_AC_RECEIVED: HistoryStatusAcceptedIcon,\n WRP_RC_RECEIVED: HistoryStatusAcceptedIcon,\n WRP_NR_RECEIVED: HistoryStatusAcceptedIcon,\n TRUST_RESOLVED: HistoryStatusAcceptedIcon,\n },\n entityTypes: {\n BACKUP: HistoryRevokeIcon,\n CERTIFICATE: HistoryCertificateIcon,\n CREDENTIAL: HistoryCredentialIcon,\n CREDENTIAL_SCHEMA: HistorySchemaIcon,\n DID: HistoryDidIcon,\n IDENTIFIER: HistoryIdentifierIcon,\n KEY: HistoryKeyIcon,\n ORGANISATION: HistoryOrganisationIcon,\n PROOF: HistoryProofRequestIcon,\n PROOF_SCHEMA: HistorySchemaIcon,\n WALLET_UNIT: HistoryTrustedEntityIcon,\n WALLET_RELYING_PARTY: HistoryTrustedEntityIcon,\n USER: HistoryIdentifierIcon,\n PROVIDER: HistoryIdentifierIcon,\n STS_ROLE: HistoryIdentifierIcon,\n STS_ORGANISATION: HistoryOrganisationIcon,\n STS_IAM_ROLE: HistoryIdentifierIcon,\n STS_TOKEN: HistoryKeyIcon,\n SIGNATURE: HistoryCertificateIcon,\n STS_SESSION: HistoryIdentifierIcon,\n NOTIFICATION: HistoryCredentialIcon,\n SUPERVISORY_AUTHORITY: HistoryCertificateIcon,\n TRUST_LIST_PUBLICATION: HistoryTrustAnchorIcon,\n TRUST_COLLECTION: HistoryTrustAnchorIcon,\n TRUST_LIST_SUBSCRIPTION: HistoryTrustAnchorIcon,\n VERIFIER_INSTANCE: HistoryTrustedEntityIcon,\n },\n};\n\nexport const getHistoryItemActionIcon = (action: HistoryAction) => {\n return defaultIcons.actions[action] ?? HistoryStatusAcceptedIcon;\n};\n\nexport type HistoryListItemIconProps = {\n item: HistoryListItem;\n};\n\nexport const HistoryListItemIcon: FC<HistoryListItemIconProps> = ({ item }) => {\n const statusIcon = getHistoryItemActionIcon(item.action);\n const typeIcon = useMemo(() => {\n switch (item.entityType) {\n case HistoryEntityType.BACKUP:\n switch (item.action) {\n case HistoryAction.CREATED:\n return HistoryBackupCreatedIcon;\n case HistoryAction.RESTORED:\n return HistoryBackupRestoredIcon;\n default:\n break;\n }\n break;\n case HistoryEntityType.CREDENTIAL:\n switch (item.action) {\n case HistoryAction.REVOKED:\n return HistoryRevokeIcon;\n case HistoryAction.SUSPENDED:\n return HistorySuspendIcon;\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n return defaultIcons.entityTypes[item.entityType] ?? HistoryIssueIcon;\n }, [item.action, item.entityType]);\n return <HistoryItemIcon StatusIcon={statusIcon} TypeIcon={typeIcon} />;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAGA,IAAAG,aAAA,GAAAH,OAAA;AAqB6B,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CA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AAiD,GAAGA,CAAC;EAAEC;AAAK,CAAC,KAAK;EAC7E,MAAMC,UAAU,GAAGN,wBAAwB,CAACK,IAAI,CAACJ,MAAM,CAAC;EACxD,MAAMM,QAAQ,GAAG,IAAAC,cAAO,EAAC,MAAM;IAAA,IAAAC,qBAAA;IAC7B,QAAQJ,IAAI,CAACK,UAAU;MACrB,KAAKC,qCAAiB,CAAChD,MAAM;QAC3B,QAAQ0C,IAAI,CAACJ,MAAM;UACjB,KAAKW,iCAAa,CAACjF,OAAO;YACxB,OAAOkF,sCAAwB;UACjC,KAAKD,iCAAa,CAACrE,QAAQ;YACzB,OAAOuE,uCAAyB;UAClC;YACE;QACJ;QACA;MACF,KAAKH,qCAAiB,CAAC5C,UAAU;QAC/B,QAAQsC,IAAI,CAACJ,MAAM;UACjB,KAAKW,iCAAa,CAACnE,OAAO;YACxB,OAAOmB,+BAAiB;UAC1B,KAAKgD,iCAAa,CAACjE,SAAS;YAC1B,OAAOoE,gCAAkB;UAC3B;YACE;QACJ;QACA;MACF;QACE;IACJ;IAEA,QAAAN,qBAAA,GAAOrF,YAAY,CAACsC,WAAW,CAAC2C,IAAI,CAACK,UAAU,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAAIO,8BAAgB;EACtE,CAAC,EAAE,CAACX,IAAI,CAACJ,MAAM,EAAEI,IAAI,CAACK,UAAU,CAAC,CAAC;EAClC,oBAAO7G,MAAA,CAAAS,OAAA,CAAA2G,aAAA,CAAClH,aAAA,CAAAmH,eAAe;IAACC,UAAU,EAAEb,UAAW;IAACc,QAAQ,EAAEb;EAAS,CAAE,CAAC;AACxE,CAAC;AAACJ,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeOneCore","require","_react","_interopRequireWildcard","_uiComponents","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","defaultIcons","actions","ACCEPTED","HistoryStatusAcceptedIcon","ACTIVATED","CLAIMS_REMOVED","HistoryStatusDeleteIcon","CREATED","DEACTIVATED","HistoryStatusErrorIcon","DELETED","ERRORED","IMPORTED","SIGNED","ISSUED","OFFERED","PENDING","REJECTED","REFRESHED","REMOVED","REQUESTED","RESTORED","RETRACTED","REVOKED","SHARED","SUSPENDED","HistoryStatusSuspendIcon","UPDATED","WITHDRAWN","REACTIVATED","CSR_GENERATED","EXPIRED","INTERACTION_CREATED","INTERACTION_ERRORED","INTERACTION_EXPIRED","DELIVERED","WRP_AC_RECEIVED","WRP_RC_RECEIVED","WRP_NR_RECEIVED","TRUST_RESOLVED","entityTypes","BACKUP","HistoryRevokeIcon","CERTIFICATE","HistoryCertificateIcon","CREDENTIAL","HistoryCredentialIcon","CREDENTIAL_SCHEMA","HistorySchemaIcon","DID","HistoryDidIcon","IDENTIFIER","HistoryIdentifierIcon","KEY","HistoryKeyIcon","ORGANISATION","HistoryOrganisationIcon","QES_DOCUMENT","PROOF","HistoryProofRequestIcon","PROOF_SCHEMA","WALLET_UNIT","HistoryTrustedEntityIcon","WALLET_RELYING_PARTY","USER","PROVIDER","STS_ROLE","STS_ORGANISATION","STS_IAM_ROLE","STS_TOKEN","SIGNATURE","STS_SESSION","NOTIFICATION","SUPERVISORY_AUTHORITY","TRUST_LIST_PUBLICATION","HistoryTrustAnchorIcon","TRUST_COLLECTION","TRUST_LIST_SUBSCRIPTION","VERIFIER_INSTANCE","getHistoryItemActionIcon","action","_defaultIcons$actions","exports","HistoryListItemIcon","item","statusIcon","typeIcon","useMemo","_defaultIcons$entityT","entityType","HistoryEntityType","HistoryAction","HistoryBackupCreatedIcon","HistoryBackupRestoredIcon","HistorySuspendIcon","HistoryIssueIcon","createElement","HistoryItemIcon","StatusIcon","TypeIcon"],"sources":["history-list-item-icon.tsx"],"sourcesContent":["import { HistoryAction, HistoryEntityType, HistoryListItem } from '@procivis/react-native-one-core';\nimport React, { FC, useMemo } from 'react';\nimport { SvgProps } from 'react-native-svg';\n\nimport {\n HistoryBackupCreatedIcon,\n HistoryBackupRestoredIcon,\n HistoryCertificateIcon,\n HistoryCredentialIcon,\n HistoryDidIcon,\n HistoryIdentifierIcon,\n HistoryIssueIcon,\n HistoryItemIcon,\n HistoryKeyIcon,\n HistoryOrganisationIcon,\n HistoryProofRequestIcon,\n HistoryRevokeIcon,\n HistorySchemaIcon,\n HistoryStatusAcceptedIcon,\n HistoryStatusDeleteIcon,\n HistoryStatusErrorIcon,\n HistoryStatusSuspendIcon,\n HistorySuspendIcon,\n HistoryTrustAnchorIcon,\n HistoryTrustedEntityIcon,\n} from '../../ui-components';\n\nconst defaultIcons: {\n actions: { [key in keyof typeof HistoryAction]: FC<SvgProps> };\n entityTypes: { [key in keyof typeof HistoryEntityType]: FC<SvgProps> };\n} = {\n actions: {\n ACCEPTED: HistoryStatusAcceptedIcon,\n ACTIVATED: HistoryStatusAcceptedIcon,\n CLAIMS_REMOVED: HistoryStatusDeleteIcon,\n CREATED: HistoryStatusAcceptedIcon,\n DEACTIVATED: HistoryStatusErrorIcon,\n DELETED: HistoryStatusDeleteIcon,\n ERRORED: HistoryStatusErrorIcon,\n IMPORTED: HistoryStatusAcceptedIcon,\n SIGNED: HistoryStatusAcceptedIcon,\n ISSUED: HistoryStatusAcceptedIcon,\n OFFERED: HistoryStatusAcceptedIcon,\n PENDING: HistoryStatusAcceptedIcon,\n REJECTED: HistoryStatusErrorIcon,\n REFRESHED: HistoryStatusAcceptedIcon,\n REMOVED: HistoryStatusDeleteIcon,\n REQUESTED: HistoryStatusAcceptedIcon,\n RESTORED: HistoryStatusAcceptedIcon,\n RETRACTED: HistoryStatusErrorIcon,\n REVOKED: HistoryStatusErrorIcon,\n SHARED: HistoryStatusAcceptedIcon,\n SUSPENDED: HistoryStatusSuspendIcon,\n UPDATED: HistoryStatusAcceptedIcon,\n WITHDRAWN: HistoryStatusErrorIcon,\n REACTIVATED: HistoryStatusAcceptedIcon,\n CSR_GENERATED: HistoryStatusAcceptedIcon,\n EXPIRED: HistoryStatusErrorIcon,\n INTERACTION_CREATED: HistoryStatusAcceptedIcon,\n INTERACTION_ERRORED: HistoryStatusErrorIcon,\n INTERACTION_EXPIRED: HistoryStatusErrorIcon,\n DELIVERED: HistoryStatusAcceptedIcon,\n WRP_AC_RECEIVED: HistoryStatusAcceptedIcon,\n WRP_RC_RECEIVED: HistoryStatusAcceptedIcon,\n WRP_NR_RECEIVED: HistoryStatusAcceptedIcon,\n TRUST_RESOLVED: HistoryStatusAcceptedIcon,\n },\n entityTypes: {\n BACKUP: HistoryRevokeIcon,\n CERTIFICATE: HistoryCertificateIcon,\n CREDENTIAL: HistoryCredentialIcon,\n CREDENTIAL_SCHEMA: HistorySchemaIcon,\n DID: HistoryDidIcon,\n IDENTIFIER: HistoryIdentifierIcon,\n KEY: HistoryKeyIcon,\n ORGANISATION: HistoryOrganisationIcon,\n QES_DOCUMENT: HistoryCredentialIcon,\n PROOF: HistoryProofRequestIcon,\n PROOF_SCHEMA: HistorySchemaIcon,\n WALLET_UNIT: HistoryTrustedEntityIcon,\n WALLET_RELYING_PARTY: HistoryTrustedEntityIcon,\n USER: HistoryIdentifierIcon,\n PROVIDER: HistoryIdentifierIcon,\n STS_ROLE: HistoryIdentifierIcon,\n STS_ORGANISATION: HistoryOrganisationIcon,\n STS_IAM_ROLE: HistoryIdentifierIcon,\n STS_TOKEN: HistoryKeyIcon,\n SIGNATURE: HistoryCertificateIcon,\n STS_SESSION: HistoryIdentifierIcon,\n NOTIFICATION: HistoryCredentialIcon,\n SUPERVISORY_AUTHORITY: HistoryCertificateIcon,\n TRUST_LIST_PUBLICATION: HistoryTrustAnchorIcon,\n TRUST_COLLECTION: HistoryTrustAnchorIcon,\n TRUST_LIST_SUBSCRIPTION: HistoryTrustAnchorIcon,\n VERIFIER_INSTANCE: HistoryTrustedEntityIcon,\n },\n};\n\nexport const getHistoryItemActionIcon = (action: HistoryAction) => {\n return defaultIcons.actions[action] ?? HistoryStatusAcceptedIcon;\n};\n\nexport type HistoryListItemIconProps = {\n item: HistoryListItem;\n};\n\nexport const HistoryListItemIcon: FC<HistoryListItemIconProps> = ({ item }) => {\n const statusIcon = getHistoryItemActionIcon(item.action);\n const typeIcon = useMemo(() => {\n switch (item.entityType) {\n case HistoryEntityType.BACKUP:\n switch (item.action) {\n case HistoryAction.CREATED:\n return HistoryBackupCreatedIcon;\n case HistoryAction.RESTORED:\n return HistoryBackupRestoredIcon;\n default:\n break;\n }\n break;\n case HistoryEntityType.CREDENTIAL:\n switch (item.action) {\n case HistoryAction.REVOKED:\n return HistoryRevokeIcon;\n case HistoryAction.SUSPENDED:\n return HistorySuspendIcon;\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n return defaultIcons.entityTypes[item.entityType] ?? HistoryIssueIcon;\n }, [item.action, item.entityType]);\n return <HistoryItemIcon StatusIcon={statusIcon} TypeIcon={typeIcon} />;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAGA,IAAAG,aAAA,GAAAH,OAAA;AAqB6B,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,C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,EAAEb;EAAS,CAAE,CAAC;AACxE,CAAC;AAACJ,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -20,7 +20,6 @@ const HistoryListItemView = ({
20
20
  onPress,
21
21
  testID
22
22
  }) => {
23
- var _dateFormatter;
24
23
  const label = `${labels.entityTypes[item.entityType]} ${labels.actions[item.action]}`;
25
24
  const info = (0, _react.useMemo)(() => {
26
25
  switch (infoLabelMode) {
@@ -36,15 +35,15 @@ const HistoryListItemView = ({
36
35
  const pressHandler = (0, _react.useCallback)(() => {
37
36
  onPress === null || onPress === void 0 || onPress(item);
38
37
  }, [onPress, item]);
39
- return /*#__PURE__*/_react.default.createElement(_uiComponents.HistoryItemView, {
38
+ return /*#__PURE__*/_react.default.createElement(_uiComponents.ListItemView, {
39
+ accessory: dateFormatter(new Date(item.createdDate)),
40
40
  first: first,
41
41
  icon: icon,
42
42
  info: info,
43
43
  label: label,
44
44
  last: last,
45
45
  onPress: pressHandler,
46
- testID: testID,
47
- time: (_dateFormatter = dateFormatter(new Date(item.createdDate))) !== null && _dateFormatter !== void 0 ? _dateFormatter : ''
46
+ testID: testID
48
47
  });
49
48
  };
50
49
  exports.HistoryListItemView = HistoryListItemView;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_uiComponents","_utils","_historyListItemIcon","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HistoryListItemView","dateFormatter","formatTime","first","infoLabelMode","item","labels","last","onPress","testID","_dateFormatter","label","entityTypes","entityType","actions","action","info","useMemo","name","undefined","icon","createElement","HistoryListItemIcon","pressHandler","useCallback","HistoryItemView","time","Date","createdDate","exports"],"sources":["history-list-item.tsx"],"sourcesContent":["import { HistoryAction, HistoryEntityType, HistoryListItem } from '@procivis/react-native-one-core';\nimport React, { FC, useCallback, useMemo } from 'react';\n\nimport { HistoryItemView } from '../../ui-components';\nimport { formatTime } from '../../utils';\nimport { HistoryListItemIcon } from './history-list-item-icon';\n\nexport type HistoryListItemLabels = {\n actions: { [key in keyof typeof HistoryAction]: string };\n entityTypes: { [key in keyof typeof HistoryEntityType]: string };\n};\n\nexport interface HistoryListItemViewProps {\n dateFormatter?: (date: Date) => string;\n first?: boolean;\n infoLabelMode?: 'associatedLabel' | 'none';\n item: HistoryListItem;\n labels: HistoryListItemLabels;\n last?: boolean;\n onPress?: (item: HistoryListItem) => void;\n testID?: string;\n}\n\nexport const HistoryListItemView: FC<HistoryListItemViewProps> = ({\n dateFormatter = formatTime,\n first,\n infoLabelMode = 'associatedLabel',\n item,\n labels,\n last,\n onPress,\n testID,\n}) => {\n const label = `${labels.entityTypes[item.entityType]} ${labels.actions[item.action]}`;\n\n const info = useMemo(() => {\n switch (infoLabelMode) {\n case 'associatedLabel':\n return item.name;\n case 'none':\n return undefined;\n }\n }, [infoLabelMode, item]);\n\n const icon = <HistoryListItemIcon item={item} />;\n\n const pressHandler = useCallback(() => {\n onPress?.(item);\n }, [onPress, item]);\n\n return (\n <HistoryItemView\n first={first}\n icon={icon}\n info={info}\n label={label}\n last={last}\n onPress={pressHandler}\n testID={testID}\n time={dateFormatter(new Date(item.createdDate)) ?? ''}\n />\n );\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AAA+D,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SA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OAAOC,IAAI,CAACa,IAAI;MAClB,KAAK,MAAM;QACT,OAAOC,SAAS;IACpB;EACF,CAAC,EAAE,CAACf,aAAa,EAAEC,IAAI,CAAC,CAAC;EAEzB,MAAMe,IAAI,gBAAG9C,MAAA,CAAAY,OAAA,CAAAmC,aAAA,CAAC1C,oBAAA,CAAA2C,mBAAmB;IAACjB,IAAI,EAAEA;EAAK,CAAE,CAAC;EAEhD,MAAMkB,YAAY,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACrChB,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAGH,IAAI,CAAC;EACjB,CAAC,EAAE,CAACG,OAAO,EAAEH,IAAI,CAAC,CAAC;EAEnB,oBACE/B,MAAA,CAAAY,OAAA,CAAAmC,aAAA,CAAC5C,aAAA,CAAAgD,eAAe;IACdtB,KAAK,EAAEA,KAAM;IACbiB,IAAI,EAAEA,IAAK;IACXJ,IAAI,EAAEA,IAAK;IACXL,KAAK,EAAEA,KAAM;IACbJ,IAAI,EAAEA,IAAK;IACXC,OAAO,EAAEe,YAAa;IACtBd,MAAM,EAAEA,MAAO;IACfiB,IAAI,GAAAhB,cAAA,GAAET,aAAa,CAAC,IAAI0B,IAAI,CAACtB,IAAI,CAACuB,WAAW,CAAC,CAAC,cAAAlB,cAAA,cAAAA,cAAA,GAAI;EAAG,CACvD,CAAC;AAEN,CAAC;AAACmB,OAAA,CAAA7B,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_uiComponents","_utils","_historyListItemIcon","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HistoryListItemView","dateFormatter","formatTime","first","infoLabelMode","item","labels","last","onPress","testID","label","entityTypes","entityType","actions","action","info","useMemo","name","undefined","icon","createElement","HistoryListItemIcon","pressHandler","useCallback","ListItemView","accessory","Date","createdDate","exports"],"sources":["history-list-item.tsx"],"sourcesContent":["import { HistoryAction, HistoryEntityType, HistoryListItem } from '@procivis/react-native-one-core';\nimport React, { FC, useCallback, useMemo } from 'react';\n\nimport { ListItemView } from '../../ui-components';\nimport { formatTime } from '../../utils';\nimport { HistoryListItemIcon } from './history-list-item-icon';\n\nexport type HistoryListItemLabels = {\n actions: { [key in keyof typeof HistoryAction]: string };\n entityTypes: { [key in keyof typeof HistoryEntityType]: string };\n};\n\nexport interface HistoryListItemViewProps {\n dateFormatter?: (date: Date) => string;\n first?: boolean;\n infoLabelMode?: 'associatedLabel' | 'none';\n item: HistoryListItem;\n labels: HistoryListItemLabels;\n last?: boolean;\n onPress?: (item: HistoryListItem) => void;\n testID?: string;\n}\n\nexport const HistoryListItemView: FC<HistoryListItemViewProps> = ({\n dateFormatter = formatTime,\n first,\n infoLabelMode = 'associatedLabel',\n item,\n labels,\n last,\n onPress,\n testID,\n}) => {\n const label = `${labels.entityTypes[item.entityType]} ${labels.actions[item.action]}`;\n\n const info = useMemo(() => {\n switch (infoLabelMode) {\n case 'associatedLabel':\n return item.name;\n case 'none':\n return undefined;\n }\n }, [infoLabelMode, item]);\n\n const icon = <HistoryListItemIcon item={item} />;\n\n const pressHandler = useCallback(() => {\n onPress?.(item);\n }, [onPress, item]);\n\n return (\n <ListItemView\n accessory={dateFormatter(new Date(item.createdDate))}\n first={first}\n icon={icon}\n info={info}\n label={label}\n last={last}\n onPress={pressHandler}\n testID={testID}\n />\n );\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AAA+D,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAA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,MAAMC,IAAI,GAAG,IAAAC,cAAO,EAAC,MAAM;IACzB,QAAQZ,aAAa;MACnB,KAAK,iBAAiB;QACpB,OAAOC,IAAI,CAACY,IAAI;MAClB,KAAK,MAAM;QACT,OAAOC,SAAS;IACpB;EACF,CAAC,EAAE,CAACd,aAAa,EAAEC,IAAI,CAAC,CAAC;EAEzB,MAAMc,IAAI,gBAAG7C,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACzC,oBAAA,CAAA0C,mBAAmB;IAAChB,IAAI,EAAEA;EAAK,CAAE,CAAC;EAEhD,MAAMiB,YAAY,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACrCf,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAGH,IAAI,CAAC;EACjB,CAAC,EAAE,CAACG,OAAO,EAAEH,IAAI,CAAC,CAAC;EAEnB,oBACE/B,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAAC3C,aAAA,CAAA+C,YAAY;IACXC,SAAS,EAAExB,aAAa,CAAC,IAAIyB,IAAI,CAACrB,IAAI,CAACsB,WAAW,CAAC,CAAE;IACrDxB,KAAK,EAAEA,KAAM;IACbgB,IAAI,EAAEA,IAAK;IACXJ,IAAI,EAAEA,IAAK;IACXL,KAAK,EAAEA,KAAM;IACbH,IAAI,EAAEA,IAAK;IACXC,OAAO,EAAEc,YAAa;IACtBb,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAACmB,OAAA,CAAA5B,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ShareCredentialV2 = exports.GroupedShareCredentialV2Padding = void 0;
7
+ var _reactNativeOneCore = require("@procivis/react-native-one-core");
7
8
  var _react = _interopRequireWildcard(require("react"));
8
9
  var _reactNative = require("react-native");
9
10
  var _uiComponents = require("../../../ui-components");
@@ -45,7 +46,8 @@ const ShareCredentialV2 = ({
45
46
  const multipleCredentialsAvailable = Boolean((applicableCredentials === null || applicableCredentials === void 0 ? void 0 : applicableCredentials.length) && applicableCredentials.length > 1);
46
47
  const validityState = (0, _utils.getValidityState)(credential ? {
47
48
  ...credential,
48
- issuer: credential === null || credential === void 0 || (_credential$issuer = credential.issuer) === null || _credential$issuer === void 0 ? void 0 : _credential$issuer.id
49
+ issuer: credential === null || credential === void 0 || (_credential$issuer = credential.issuer) === null || _credential$issuer === void 0 ? void 0 : _credential$issuer.id,
50
+ type: _reactNativeOneCore.CredentialType.SINGLE
49
51
  } : undefined);
50
52
  const footer = (0, _react.useMemo)(() => {
51
53
  if (!expanded) {
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_uiComponents","_utils","_credentialSharingV","_selectShareCredentialCardNotice","_shareCredentialCardNotice","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","GroupedShareCredentialV2Padding","exports","ShareCredentialV2","credentialQuery","credentialRequestId","expanded","grouped","headerAccessory","labels","language","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","selectedCredentialId","selectedFields","style","testID","_applicableCredential","_credentialQuery$purp","_credential$issuer","colorScheme","useAppColorScheme","applicableCredentials","type_","undefined","failureHint","credential","find","c","id","data","config","useCoreConfig","cardWidth","useMemo","Dimensions","width","purpose","multipleCredentialsAvailable","Boolean","length","validityState","getValidityState","issuer","footer","ValidityState","Revoked","createElement","ShareCredentialCardNotice","concatTestID","text","revokedCredentialNotice","Suspended","suspendedCredentialNotice","reason","invalidCredentialNotice","SelectShareCredentialCardNotice","buttonTitle","multipleCredentialsSelect","onPress","multipleCredentialsNotice","onAttributeSelected","useCallback","fieldPath","selected","card","header","attributes","shareCredentialCardFromV2PresentationCredential","accessory","CredentialDetailsCardListItem","credentialId","styles","groupedCredential","bordered","borderColor","background","StyleSheet","create","borderWidth","borderRadius","marginBottom","marginHorizontal"],"sources":["share-credential-v2.tsx"],"sourcesContent":["import {\n ApplicableCredentialOrFailureHint,\n CredentialListItem,\n PresentationDefinitionV2Claim,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useCallback, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';\nimport { concatTestID, getValidityState, useCoreConfig, ValidityState } from '../../../utils';\nimport { shareCredentialCardFromV2PresentationCredential } from '../../../utils/parsers/credential-sharing-v2';\nimport { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';\nimport { ShareCredentialCardNotice } from '../share-credential-card-notice';\nimport { ShareCredentialLabels } from '../v1';\n\nexport type ShareCredentialV2Props = {\n credentialQuery: ApplicableCredentialOrFailureHint;\n credentialRequestId: string;\n expanded?: boolean;\n grouped?: boolean;\n headerAccessory?: React.ComponentType<any> | React.ReactElement;\n labels: ShareCredentialLabels;\n language: string;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (\n credentialId: CredentialListItem['id'],\n fieldPath: PresentationDefinitionV2Claim['path'],\n selected: boolean,\n ) => void;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionV2Claim['path']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n};\n\nexport const GroupedShareCredentialV2Padding = 4;\n\nexport const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({\n credentialQuery,\n credentialRequestId,\n expanded,\n grouped,\n headerAccessory,\n labels,\n language,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const applicableCredentials =\n credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.applicableCredentials : undefined;\n const failureHint = credentialQuery.type_ === 'FAILURE_HINT' ? credentialQuery.failureHint : undefined;\n const credential = applicableCredentials?.find((c) => c.id === selectedCredentialId) ?? applicableCredentials?.[0];\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(\n () => Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0),\n [grouped],\n );\n const purpose = credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.purpose?.[language] : undefined;\n\n const multipleCredentialsAvailable = Boolean(applicableCredentials?.length && applicableCredentials.length > 1);\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.revoked')}\n text={labels.revokedCredentialNotice}\n />\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.suspended')}\n text={labels.suspendedCredentialNotice}\n />\n );\n }\n\n if (failureHint?.reason === 'VALIDITY') {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.invalid')}\n text={labels.invalidCredentialNotice}\n />\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <SelectShareCredentialCardNotice\n buttonTitle={labels.multipleCredentialsSelect}\n onPress={onSelectCredential}\n testID={concatTestID(testID, 'notice.multiple')}\n text={labels.multipleCredentialsNotice}\n />\n );\n }\n }, [\n expanded,\n failureHint?.reason,\n labels.invalidCredentialNotice,\n labels.multipleCredentialsNotice,\n labels.multipleCredentialsSelect,\n labels.revokedCredentialNotice,\n labels.suspendedCredentialNotice,\n multipleCredentialsAvailable,\n onSelectCredential,\n testID,\n validityState,\n ]);\n\n const onAttributeSelected = useCallback(\n (fieldPath: PresentationDefinitionV2Claim['path'], selected: boolean) => {\n if (!selectedCredentialId) {\n return;\n }\n onSelectField(selectedCredentialId, fieldPath, selected);\n },\n [onSelectField, selectedCredentialId],\n );\n\n if (!config) {\n return null;\n }\n\n const {\n card: { header, ...card },\n attributes,\n } = shareCredentialCardFromV2PresentationCredential(\n credential,\n failureHint,\n Boolean(expanded),\n multipleCredentialsAvailable,\n purpose,\n selectedFields,\n config,\n testID,\n labels,\n language,\n );\n\n if (headerAccessory) {\n header.accessory = headerAccessory;\n }\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId: credentialRequestId,\n header,\n onHeaderPress,\n width: cardWidth,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onAttributeSelected}\n onImagePreview={onImagePreview}\n style={[\n styles.credential,\n grouped ? styles.groupedCredential : styles.bordered,\n { borderColor: colorScheme.background },\n style,\n ]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n bordered: {\n borderWidth: 1,\n },\n credential: {\n borderRadius: 10,\n borderWidth: 0,\n marginBottom: 8,\n },\n groupedCredential: {\n marginHorizontal: GroupedShareCredentialV2Padding,\n },\n});\n"],"mappings":";;;;;;AAKA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,gCAAA,GAAAL,OAAA;AACA,IAAAM,0BAAA,GAAAN,OAAA;AAA4E,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eA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QAAQ,EAAEA,QAAS;IACnByC,MAAM,EAAEA,MAAO;IACfpC,QAAQ,EAAEA,QAAS;IACnBqD,mBAAmB,EAAEA,mBAAoB;IACzCnD,cAAc,EAAEA,cAAe;IAC/BK,KAAK,EAAE,CACLyD,MAAM,CAAC9C,UAAU,EACjBtB,OAAO,GAAGoE,MAAM,CAACC,iBAAiB,GAAGD,MAAM,CAACE,QAAQ,EACpD;MAAEC,WAAW,EAAEvD,WAAW,CAACwD;IAAW,CAAC,EACvC7D,KAAK,CACL;IACFC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAACjB,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAEF,MAAMwE,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BJ,QAAQ,EAAE;IACRK,WAAW,EAAE;EACf,CAAC;EACDrD,UAAU,EAAE;IACVsD,YAAY,EAAE,EAAE;IAChBD,WAAW,EAAE,CAAC;IACdE,YAAY,EAAE;EAChB,CAAC;EACDR,iBAAiB,EAAE;IACjBS,gBAAgB,EAAEpF;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeOneCore","require","_react","_interopRequireWildcard","_reactNative","_uiComponents","_utils","_credentialSharingV","_selectShareCredentialCardNotice","_shareCredentialCardNotice","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","GroupedShareCredentialV2Padding","exports","ShareCredentialV2","credentialQuery","credentialRequestId","expanded","grouped","headerAccessory","labels","language","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","selectedCredentialId","selectedFields","style","testID","_applicableCredential","_credentialQuery$purp","_credential$issuer","colorScheme","useAppColorScheme","applicableCredentials","type_","undefined","failureHint","credential","find","c","id","data","config","useCoreConfig","cardWidth","useMemo","Dimensions","width","purpose","multipleCredentialsAvailable","Boolean","length","validityState","getValidityState","issuer","type","CredentialType","SINGLE","footer","ValidityState","Revoked","createElement","ShareCredentialCardNotice","concatTestID","text","revokedCredentialNotice","Suspended","suspendedCredentialNotice","reason","invalidCredentialNotice","SelectShareCredentialCardNotice","buttonTitle","multipleCredentialsSelect","onPress","multipleCredentialsNotice","onAttributeSelected","useCallback","fieldPath","selected","card","header","attributes","shareCredentialCardFromV2PresentationCredential","accessory","CredentialDetailsCardListItem","credentialId","styles","groupedCredential","bordered","borderColor","background","StyleSheet","create","borderWidth","borderRadius","marginBottom","marginHorizontal"],"sources":["share-credential-v2.tsx"],"sourcesContent":["import {\n ApplicableCredentialOrFailureHint,\n CredentialListItem,\n CredentialType,\n PresentationDefinitionV2Claim,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useCallback, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';\nimport { concatTestID, getValidityState, useCoreConfig, ValidityState } from '../../../utils';\nimport { shareCredentialCardFromV2PresentationCredential } from '../../../utils/parsers/credential-sharing-v2';\nimport { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';\nimport { ShareCredentialCardNotice } from '../share-credential-card-notice';\nimport { ShareCredentialLabels } from '../v1';\n\nexport type ShareCredentialV2Props = {\n credentialQuery: ApplicableCredentialOrFailureHint;\n credentialRequestId: string;\n expanded?: boolean;\n grouped?: boolean;\n headerAccessory?: React.ComponentType<any> | React.ReactElement;\n labels: ShareCredentialLabels;\n language: string;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (\n credentialId: CredentialListItem['id'],\n fieldPath: PresentationDefinitionV2Claim['path'],\n selected: boolean,\n ) => void;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionV2Claim['path']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n};\n\nexport const GroupedShareCredentialV2Padding = 4;\n\nexport const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({\n credentialQuery,\n credentialRequestId,\n expanded,\n grouped,\n headerAccessory,\n labels,\n language,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const applicableCredentials =\n credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.applicableCredentials : undefined;\n const failureHint = credentialQuery.type_ === 'FAILURE_HINT' ? credentialQuery.failureHint : undefined;\n const credential = applicableCredentials?.find((c) => c.id === selectedCredentialId) ?? applicableCredentials?.[0];\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(\n () => Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0),\n [grouped],\n );\n const purpose = credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.purpose?.[language] : undefined;\n\n const multipleCredentialsAvailable = Boolean(applicableCredentials?.length && applicableCredentials.length > 1);\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n type: CredentialType.SINGLE,\n }\n : undefined,\n );\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.revoked')}\n text={labels.revokedCredentialNotice}\n />\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.suspended')}\n text={labels.suspendedCredentialNotice}\n />\n );\n }\n\n if (failureHint?.reason === 'VALIDITY') {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.invalid')}\n text={labels.invalidCredentialNotice}\n />\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <SelectShareCredentialCardNotice\n buttonTitle={labels.multipleCredentialsSelect}\n onPress={onSelectCredential}\n testID={concatTestID(testID, 'notice.multiple')}\n text={labels.multipleCredentialsNotice}\n />\n );\n }\n }, [\n expanded,\n failureHint?.reason,\n labels.invalidCredentialNotice,\n labels.multipleCredentialsNotice,\n labels.multipleCredentialsSelect,\n labels.revokedCredentialNotice,\n labels.suspendedCredentialNotice,\n multipleCredentialsAvailable,\n onSelectCredential,\n testID,\n validityState,\n ]);\n\n const onAttributeSelected = useCallback(\n (fieldPath: PresentationDefinitionV2Claim['path'], selected: boolean) => {\n if (!selectedCredentialId) {\n return;\n }\n onSelectField(selectedCredentialId, fieldPath, selected);\n },\n [onSelectField, selectedCredentialId],\n );\n\n if (!config) {\n return null;\n }\n\n const {\n card: { header, ...card },\n attributes,\n } = shareCredentialCardFromV2PresentationCredential(\n credential,\n failureHint,\n Boolean(expanded),\n multipleCredentialsAvailable,\n purpose,\n selectedFields,\n config,\n testID,\n labels,\n language,\n );\n\n if (headerAccessory) {\n header.accessory = headerAccessory;\n }\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId: credentialRequestId,\n header,\n onHeaderPress,\n width: cardWidth,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onAttributeSelected}\n onImagePreview={onImagePreview}\n style={[\n styles.credential,\n grouped ? styles.groupedCredential : styles.bordered,\n { borderColor: colorScheme.background },\n style,\n ]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n bordered: {\n borderWidth: 1,\n },\n credential: {\n borderRadius: 10,\n borderWidth: 0,\n marginBottom: 8,\n },\n groupedCredential: {\n marginHorizontal: GroupedShareCredentialV2Padding,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;A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AO,CAACpC,QAAQ,CAAC,EACjBmC,4BAA4B,EAC5BD,OAAO,EACPvB,cAAc,EACdiB,MAAM,EACNf,MAAM,EACNV,MAAM,EACNC,QACF,CAAC;EAED,IAAIF,eAAe,EAAE;IACnBgE,MAAM,CAACG,SAAS,GAAGnE,eAAe;EACpC;EAEA,oBACEnC,MAAA,CAAAc,OAAA,CAAAkE,aAAA,CAAC7E,aAAA,CAAAoG,6BAA6B;IAC5BH,UAAU,EAAEA,UAAW;IACvBF,IAAI,EAAE;MACJ,GAAGA,IAAI;MACPM,YAAY,EAAExE,mBAAmB;MACjCmE,MAAM;MACN5D,aAAa;MACb2B,KAAK,EAAEH;IACT,CAAE;IACF9B,QAAQ,EAAEA,QAAS;IACnB4C,MAAM,EAAEA,MAAO;IACfvC,QAAQ,EAAEA,QAAS;IACnBwD,mBAAmB,EAAEA,mBAAoB;IACzCtD,cAAc,EAAEA,cAAe;IAC/BK,KAAK,EAAE,CACL4D,MAAM,CAACjD,UAAU,EACjBtB,OAAO,GAAGuE,MAAM,CAACC,iBAAiB,GAAGD,MAAM,CAACE,QAAQ,EACpD;MAAEC,WAAW,EAAE1D,WAAW,CAAC2D;IAAW,CAAC,EACvChE,KAAK,CACL;IACFC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAACjB,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAEF,MAAM2E,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BJ,QAAQ,EAAE;IACRK,WAAW,EAAE;EACf,CAAC;EACDxD,UAAU,EAAE;IACVyD,YAAY,EAAE,EAAE;IAChBD,WAAW,EAAE,CAAC;IACdE,YAAY,EAAE;EAChB,CAAC;EACDR,iBAAiB,EAAE;IACjBS,gBAAgB,EAAEvF;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -13,72 +13,167 @@ var _blurView = _interopRequireDefault(require("../blur/blur-view"));
13
13
  var _icons = require("../icons");
14
14
  var _theme = require("../theme");
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
17
16
  const hitSlop = {
18
17
  top: 10,
19
18
  left: 10,
20
19
  bottom: 10,
21
20
  right: 10
22
21
  };
22
+ const SCAN_WIDTH = 104;
23
+ const SCAN_HEIGHT = 80;
24
+ const SIDE_WIDTH = 94;
25
+ const SIDE_HEIGHT = 64;
26
+ const OVERLAP = 50;
23
27
  const ScanButton = /*#__PURE__*/_react.default.forwardRef(({
24
28
  style,
25
- ...props
29
+ onSignPress,
30
+ onIssuePress,
31
+ onScanPress,
32
+ testID
26
33
  }, ref) => {
27
34
  const t = (0, _accessibilityLanguage.useAccessibilityTranslation)();
28
35
  const colorScheme = (0, _theme.useAppColorScheme)();
29
36
  const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
30
- return /*#__PURE__*/_react.default.createElement(_accessibilityHistoryWrappers.TouchableOpacity, _extends({
37
+ const showLeftButton = onSignPress !== undefined;
38
+ const showRightButton = onIssuePress !== undefined;
39
+ const leftButtonOpacity = showLeftButton ? 1 : 0;
40
+ const rightButtonOpacity = showRightButton ? 1 : 0;
41
+ const bottomOffset = Math.max(24, insets.bottom);
42
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
43
+ style: [styles.wrapper, {
44
+ bottom: bottomOffset
45
+ }, style]
46
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
47
+ pointerEvents: showLeftButton ? 'auto' : 'none',
48
+ style: [styles.sideButtonContainer, {
49
+ opacity: leftButtonOpacity
50
+ }]
51
+ }, /*#__PURE__*/_react.default.createElement(_accessibilityHistoryWrappers.TouchableOpacity, {
52
+ accessibilityRole: "button",
53
+ hitSlop: hitSlop,
54
+ testID: `${testID}.sign`,
55
+ onPress: onSignPress,
56
+ style: styles.sideButton
57
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
58
+ style: [styles.sideInnerLeft, {
59
+ backgroundColor: colorScheme.white
60
+ }]
61
+ }, /*#__PURE__*/_react.default.createElement(_icons.SignIcon, {
62
+ color: colorScheme.black
63
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
64
+ style: [styles.sideLabel, {
65
+ color: colorScheme.black
66
+ }]
67
+ }, "Sign")))), /*#__PURE__*/_react.default.createElement(_accessibilityHistoryWrappers.TouchableOpacity, {
31
68
  accessibilityLabel: t('accessibility.icon.scan'),
32
69
  accessibilityRole: "button",
33
70
  hitSlop: hitSlop,
34
71
  ref: ref,
35
- style: [styles.button, {
36
- bottom: Math.max(24, insets.bottom)
37
- }, style]
38
- }, props), /*#__PURE__*/_react.default.createElement(_blurView.default, {
72
+ style: styles.scanButton,
73
+ testID: `${testID}.scan`,
74
+ onPress: onScanPress
75
+ }, /*#__PURE__*/_react.default.createElement(_blurView.default, {
39
76
  blurStyle: "soft",
40
- style: styles.blurWrapper
77
+ style: styles.scanBlurWrapper
41
78
  }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
42
- style: [styles.iconWrapper, {
79
+ style: [styles.scanInner, {
43
80
  backgroundColor: colorScheme.accent
44
81
  }]
45
82
  }, /*#__PURE__*/_react.default.createElement(_icons.ScanIcon, {
46
83
  color: colorScheme.white
47
- }))));
84
+ })))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
85
+ pointerEvents: showRightButton ? 'auto' : 'none',
86
+ style: [styles.sideButtonContainer, {
87
+ opacity: rightButtonOpacity
88
+ }]
89
+ }, /*#__PURE__*/_react.default.createElement(_accessibilityHistoryWrappers.TouchableOpacity, {
90
+ accessibilityRole: "button",
91
+ testID: `${testID}.issue`,
92
+ hitSlop: hitSlop,
93
+ onPress: onIssuePress,
94
+ style: styles.sideButton
95
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
96
+ style: [styles.sideInnerRight, {
97
+ backgroundColor: colorScheme.white
98
+ }]
99
+ }, /*#__PURE__*/_react.default.createElement(_icons.IssueIcon, {
100
+ color: colorScheme.black
101
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
102
+ style: [styles.sideLabel, {
103
+ color: colorScheme.black
104
+ }]
105
+ }, "Issue")))));
48
106
  });
49
107
  ScanButton.displayName = 'ScanButton';
50
108
  var _default = exports.default = ScanButton;
51
109
  const styles = _reactNative.StyleSheet.create({
52
- blurWrapper: {
110
+ scanBlurWrapper: {
53
111
  borderRadius: 28,
54
- borderWidth: 0,
55
- height: 80,
56
- padding: 8,
57
- width: 104
112
+ flex: 1,
113
+ padding: 8
58
114
  },
59
- button: {
115
+ scanButton: {
60
116
  borderRadius: 28,
61
- borderWidth: 0,
62
- height: 80,
63
- left: '50%',
64
- marginLeft: -52,
65
- position: 'absolute',
117
+ height: SCAN_HEIGHT,
66
118
  shadowColor: '#000000',
67
119
  shadowOffset: {
68
120
  height: 4,
69
121
  width: 0
70
122
  },
71
- shadowOpacity: 0.2,
123
+ shadowOpacity: 0.25,
72
124
  shadowRadius: 24,
73
- width: 104
125
+ width: SCAN_WIDTH,
126
+ zIndex: 1
74
127
  },
75
- iconWrapper: {
128
+ scanInner: {
76
129
  alignItems: 'center',
77
130
  borderRadius: 20,
78
- borderWidth: 0,
79
- height: '100%',
131
+ flex: 1,
132
+ justifyContent: 'center'
133
+ },
134
+ sideButton: {
135
+ borderRadius: 24,
136
+ flex: 1
137
+ },
138
+ sideButtonContainer: {
139
+ height: SIDE_HEIGHT,
140
+ marginHorizontal: -OVERLAP / 2,
141
+ width: SIDE_WIDTH,
142
+ zIndex: 0
143
+ },
144
+ sideInnerLeft: {
145
+ alignItems: 'center',
146
+ borderBottomLeftRadius: 22,
147
+ borderBottomRightRadius: 0,
148
+ borderTopLeftRadius: 22,
149
+ borderTopRightRadius: 0,
150
+ flex: 1,
151
+ justifyContent: 'center',
152
+ paddingRight: 10
153
+ },
154
+ sideInnerRight: {
155
+ alignItems: 'center',
156
+ borderBottomLeftRadius: 0,
157
+ borderBottomRightRadius: 22,
158
+ borderTopLeftRadius: 0,
159
+ borderTopRightRadius: 22,
160
+ flex: 1,
80
161
  justifyContent: 'center',
81
- width: '100%'
162
+ paddingLeft: 10
163
+ },
164
+ sideLabel: {
165
+ fontSize: 14,
166
+ fontWeight: '500',
167
+ marginTop: 6
168
+ },
169
+ wrapper: {
170
+ alignItems: 'center',
171
+ flexDirection: 'row',
172
+ height: SCAN_HEIGHT,
173
+ justifyContent: 'center',
174
+ left: 0,
175
+ position: 'absolute',
176
+ right: 0
82
177
  }
83
178
  });
84
179
  //# sourceMappingURL=scan-button.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeSafeAreaContext","_accessibilityHistoryWrappers","_accessibilityLanguage","_blurView","_icons","_theme","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","hitSlop","top","left","bottom","right","ScanButton","React","forwardRef","style","props","ref","useAccessibilityTranslation","colorScheme","useAppColorScheme","insets","useSafeAreaInsets","createElement","TouchableOpacity","accessibilityLabel","accessibilityRole","styles","button","Math","max","blurStyle","blurWrapper","View","iconWrapper","backgroundColor","accent","ScanIcon","color","white","displayName","_default","exports","StyleSheet","create","borderRadius","borderWidth","height","padding","width","marginLeft","position","shadowColor","shadowOffset","shadowOpacity","shadowRadius","alignItems","justifyContent"],"sources":["scan-button.tsx"],"sourcesContent":["import React from 'react';\nimport { Insets, StyleSheet, TouchableOpacityProps, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { TouchableOpacity, TouchableOpacityRef } from '../accessibility/accessibilityHistoryWrappers';\nimport { useAccessibilityTranslation } from '../accessibility/accessibilityLanguage';\nimport BlurView from '../blur/blur-view';\nimport { ScanIcon } from '../icons';\nimport { useAppColorScheme } from '../theme';\n\nexport type ScanButtonProps = TouchableOpacityProps;\n\nconst hitSlop: Insets = { top: 10, left: 10, bottom: 10, right: 10 };\n\nconst ScanButton = React.forwardRef<TouchableOpacityRef, ScanButtonProps>(({ style, ...props }, ref) => {\n const t = useAccessibilityTranslation();\n const colorScheme = useAppColorScheme();\n const insets = useSafeAreaInsets();\n\n return (\n <TouchableOpacity\n accessibilityLabel={t('accessibility.icon.scan')}\n accessibilityRole=\"button\"\n hitSlop={hitSlop}\n ref={ref}\n style={[styles.button, { bottom: Math.max(24, insets.bottom) }, style]}\n {...props}>\n <BlurView blurStyle=\"soft\" style={styles.blurWrapper}>\n <View style={[styles.iconWrapper, { backgroundColor: colorScheme.accent }]}>\n <ScanIcon color={colorScheme.white} />\n </View>\n </BlurView>\n </TouchableOpacity>\n );\n});\n\nScanButton.displayName = 'ScanButton';\nexport default ScanButton;\n\nconst styles = StyleSheet.create({\n blurWrapper: {\n borderRadius: 28,\n borderWidth: 0,\n height: 80,\n padding: 8,\n width: 104,\n },\n button: {\n borderRadius: 28,\n borderWidth: 0,\n height: 80,\n left: '50%',\n marginLeft: -52,\n position: 'absolute',\n shadowColor: '#000000',\n shadowOffset: { height: 4, width: 0 },\n shadowOpacity: 0.2,\n shadowRadius: 24,\n width: 104,\n },\n iconWrapper: {\n alignItems: 'center',\n borderRadius: 20,\n borderWidth: 0,\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,6BAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA6C,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OA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AAM,EAAE,MAAM;IACdU,cAAc,EAAE,QAAQ;IACxBR,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeSafeAreaContext","_accessibilityHistoryWrappers","_accessibilityLanguage","_blurView","_icons","_theme","e","__esModule","default","hitSlop","top","left","bottom","right","SCAN_WIDTH","SCAN_HEIGHT","SIDE_WIDTH","SIDE_HEIGHT","OVERLAP","ScanButton","React","forwardRef","style","onSignPress","onIssuePress","onScanPress","testID","ref","t","useAccessibilityTranslation","colorScheme","useAppColorScheme","insets","useSafeAreaInsets","showLeftButton","undefined","showRightButton","leftButtonOpacity","rightButtonOpacity","bottomOffset","Math","max","createElement","View","styles","wrapper","pointerEvents","sideButtonContainer","opacity","TouchableOpacity","accessibilityRole","onPress","sideButton","sideInnerLeft","backgroundColor","white","SignIcon","color","black","Text","sideLabel","accessibilityLabel","scanButton","blurStyle","scanBlurWrapper","scanInner","accent","ScanIcon","sideInnerRight","IssueIcon","displayName","_default","exports","StyleSheet","create","borderRadius","flex","padding","height","shadowColor","shadowOffset","width","shadowOpacity","shadowRadius","zIndex","alignItems","justifyContent","marginHorizontal","borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius","paddingRight","paddingLeft","fontSize","fontWeight","marginTop","flexDirection","position"],"sources":["scan-button.tsx"],"sourcesContent":["import React from 'react';\nimport { Insets, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { TouchableOpacity, TouchableOpacityRef } from '../accessibility/accessibilityHistoryWrappers';\nimport { useAccessibilityTranslation } from '../accessibility/accessibilityLanguage';\nimport BlurView from '../blur/blur-view';\nimport { IssueIcon, ScanIcon, SignIcon } from '../icons';\nimport { useAppColorScheme } from '../theme';\n\nexport type ScanButtonProps = {\n onSignPress?: () => void;\n onIssuePress?: () => void;\n onScanPress: () => void;\n testID?: string;\n style?: StyleProp<ViewStyle>;\n};\n\nconst hitSlop: Insets = { top: 10, left: 10, bottom: 10, right: 10 };\n\nconst SCAN_WIDTH = 104;\nconst SCAN_HEIGHT = 80;\nconst SIDE_WIDTH = 94;\nconst SIDE_HEIGHT = 64;\nconst OVERLAP = 50;\n\nconst ScanButton = React.forwardRef<TouchableOpacityRef, ScanButtonProps>(\n ({ style, onSignPress, onIssuePress, onScanPress, testID }, ref) => {\n const t = useAccessibilityTranslation();\n const colorScheme = useAppColorScheme();\n const insets = useSafeAreaInsets();\n const showLeftButton = onSignPress !== undefined;\n const showRightButton = onIssuePress !== undefined;\n const leftButtonOpacity = showLeftButton ? 1 : 0;\n const rightButtonOpacity = showRightButton ? 1 : 0;\n\n const bottomOffset = Math.max(24, insets.bottom);\n\n return (\n <View style={[styles.wrapper, { bottom: bottomOffset }, style as object]}>\n <View\n pointerEvents={showLeftButton ? 'auto' : 'none'}\n style={[styles.sideButtonContainer, { opacity: leftButtonOpacity }]}>\n <TouchableOpacity\n accessibilityRole=\"button\"\n hitSlop={hitSlop}\n testID={`${testID}.sign`}\n onPress={onSignPress}\n style={styles.sideButton}>\n <View style={[styles.sideInnerLeft, { backgroundColor: colorScheme.white }]}>\n <SignIcon color={colorScheme.black} />\n <Text style={[styles.sideLabel, { color: colorScheme.black }]}>Sign</Text>\n </View>\n </TouchableOpacity>\n </View>\n\n <TouchableOpacity\n accessibilityLabel={t('accessibility.icon.scan')}\n accessibilityRole=\"button\"\n hitSlop={hitSlop}\n ref={ref}\n style={styles.scanButton}\n testID={`${testID}.scan`}\n onPress={onScanPress}>\n <BlurView blurStyle=\"soft\" style={styles.scanBlurWrapper}>\n <View style={[styles.scanInner, { backgroundColor: colorScheme.accent }]}>\n <ScanIcon color={colorScheme.white} />\n </View>\n </BlurView>\n </TouchableOpacity>\n\n <View\n pointerEvents={showRightButton ? 'auto' : 'none'}\n style={[styles.sideButtonContainer, { opacity: rightButtonOpacity }]}>\n <TouchableOpacity\n accessibilityRole=\"button\"\n testID={`${testID}.issue`}\n hitSlop={hitSlop}\n onPress={onIssuePress}\n style={styles.sideButton}>\n <View style={[styles.sideInnerRight, { backgroundColor: colorScheme.white }]}>\n <IssueIcon color={colorScheme.black} />\n <Text style={[styles.sideLabel, { color: colorScheme.black }]}>Issue</Text>\n </View>\n </TouchableOpacity>\n </View>\n </View>\n );\n },\n);\n\nScanButton.displayName = 'ScanButton';\nexport default ScanButton;\n\nconst styles = StyleSheet.create({\n scanBlurWrapper: {\n borderRadius: 28,\n flex: 1,\n padding: 8,\n },\n scanButton: {\n borderRadius: 28,\n height: SCAN_HEIGHT,\n shadowColor: '#000000',\n shadowOffset: { height: 4, width: 0 },\n shadowOpacity: 0.25,\n shadowRadius: 24,\n width: SCAN_WIDTH,\n zIndex: 1,\n },\n scanInner: {\n alignItems: 'center',\n borderRadius: 20,\n flex: 1,\n justifyContent: 'center',\n },\n sideButton: {\n borderRadius: 24,\n flex: 1,\n },\n sideButtonContainer: {\n height: SIDE_HEIGHT,\n marginHorizontal: -OVERLAP / 2,\n width: SIDE_WIDTH,\n zIndex: 0,\n },\n sideInnerLeft: {\n alignItems: 'center',\n borderBottomLeftRadius: 22,\n borderBottomRightRadius: 0,\n borderTopLeftRadius: 22,\n borderTopRightRadius: 0,\n flex: 1,\n justifyContent: 'center',\n paddingRight: 10,\n },\n sideInnerRight: {\n alignItems: 'center',\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 22,\n borderTopLeftRadius: 0,\n borderTopRightRadius: 22,\n flex: 1,\n justifyContent: 'center',\n paddingLeft: 10,\n },\n sideLabel: {\n fontSize: 14,\n fontWeight: '500',\n marginTop: 6,\n },\n wrapper: {\n alignItems: 'center',\n flexDirection: 'row',\n height: SCAN_HEIGHT,\n justifyContent: 'center',\n left: 0,\n position: 'absolute',\n right: 0,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA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AAgB,EAAE,CAACrE,OAAO,GAAG,CAAC;IAC9B+D,KAAK,EAAEjE,UAAU;IACjBoE,MAAM,EAAE;EACV,CAAC;EACD/B,aAAa,EAAE;IACbgC,UAAU,EAAE,QAAQ;IACpBG,sBAAsB,EAAE,EAAE;IAC1BC,uBAAuB,EAAE,CAAC;IAC1BC,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,CAAC;IACvBf,IAAI,EAAE,CAAC;IACPU,cAAc,EAAE,QAAQ;IACxBM,YAAY,EAAE;EAChB,CAAC;EACDxB,cAAc,EAAE;IACdiB,UAAU,EAAE,QAAQ;IACpBG,sBAAsB,EAAE,CAAC;IACzBC,uBAAuB,EAAE,EAAE;IAC3BC,mBAAmB,EAAE,CAAC;IACtBC,oBAAoB,EAAE,EAAE;IACxBf,IAAI,EAAE,CAAC;IACPU,cAAc,EAAE,QAAQ;IACxBO,WAAW,EAAE;EACf,CAAC;EACDjC,SAAS,EAAE;IACTkC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,SAAS,EAAE;EACb,CAAC;EACDnD,OAAO,EAAE;IACPwC,UAAU,EAAE,QAAQ;IACpBY,aAAa,EAAE,KAAK;IACpBnB,MAAM,EAAE/D,WAAW;IACnBuE,cAAc,EAAE,QAAQ;IACxB3E,IAAI,EAAE,CAAC;IACPuF,QAAQ,EAAE,UAAU;IACpBrF,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
@@ -28,7 +28,10 @@ const CredentialDetailsCard = ({
28
28
  onImagePreview,
29
29
  onAttributeSelected,
30
30
  style,
31
- showAllButtonLabel,
31
+ showAllButtonLabel = 'Show all',
32
+ showLessButtonLabel = 'Show less',
33
+ moreLabel = 'More',
34
+ lessLabel = 'Less',
32
35
  testID,
33
36
  ...viewProps
34
37
  }) => {
@@ -43,6 +46,8 @@ const CredentialDetailsCard = ({
43
46
  const [animatedHeightSet, setAnimatedHeightSet] = (0, _react.useState)(false);
44
47
  const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];
45
48
  const extraAttributes = (0, _react.useMemo)(() => attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : [], [attributes]);
49
+ const showSeeAllButton = extraAttributes.length > 0;
50
+ const isExpanded = allAttributesRendered;
46
51
  (0, _react.useEffect)(() => {
47
52
  if (extraAttributes.length === 0) {
48
53
  const viewStyle = _reactNative.StyleSheet.flatten([styles.allAttributesWrapper, footer && styles.allAttributesWrapperWithFooter]);
@@ -57,9 +62,9 @@ const CredentialDetailsCard = ({
57
62
  if (allAttributesRendered && fullAttributesHeight === undefined) {
58
63
  return;
59
64
  }
60
- const buttonViewHeight = !extraAttributes || allAttributesRendered ? 0 : SEE_ALL_BUTTON_HEIGHT;
65
+ const buttonViewHeight = showSeeAllButton ? SEE_ALL_BUTTON_HEIGHT : 0;
61
66
  const additionalAttributesHeight = fullAttributesHeight !== null && fullAttributesHeight !== void 0 ? fullAttributesHeight : 0;
62
- const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;
67
+ const additionalHeight = allAttributesRendered ? additionalAttributesHeight + buttonViewHeight : buttonViewHeight;
63
68
  const fullHeight = previewAttributesHeight + additionalHeight;
64
69
  setAnimatedHeightSet(true);
65
70
  if (!animate) {
@@ -75,7 +80,7 @@ const CredentialDetailsCard = ({
75
80
  currentHeight.value = (0, _reactNativeReanimated.withTiming)(newHeight, {
76
81
  duration
77
82
  });
78
- }, [allAttributesRendered, currentHeight, animate, expanded, extraAttributes, fullAttributesHeight, previewAttributes.length, previewAttributesHeight]);
83
+ }, [allAttributesRendered, currentHeight, animate, expanded, extraAttributes, fullAttributesHeight, previewAttributes.length, previewAttributesHeight, showSeeAllButton]);
79
84
  const animatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
80
85
  if (currentHeight.value === undefined) {
81
86
  if (expanded) {
@@ -130,30 +135,36 @@ const CredentialDetailsCard = ({
130
135
  onLayout: onPreviewAttrContentLayout,
131
136
  style: styles.previewAttributesWrapper
132
137
  }, previewAttributes.map((attribute, idx) => /*#__PURE__*/_react.default.createElement(_credentialAttributeItem.default, _extends({
138
+ moreLabel: moreLabel,
139
+ lessLabel: lessLabel,
133
140
  key: attribute.id,
134
- last: !footerView && !extraAttributes.length && idx === previewAttributes.length - 1,
141
+ last: !footerView && !showSeeAllButton && idx === previewAttributes.length - 1,
135
142
  testID: (0, _testID.concatTestID)(testID, 'attribute', idx.toString()),
136
143
  onImagePreview: onImagePreview,
137
- onPress: onAttributeSelected
138
- }, attribute)))), !allAttributesRendered && extraAttributes.length > 0 && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
139
- style: styles.buttonWrapper
140
- }, /*#__PURE__*/_react.default.createElement(_buttons.Button, {
141
- onPress: () => setAllAttributesRendered(true),
142
- type: _buttons.ButtonType.Secondary,
143
- testID: (0, _testID.concatTestID)(testID, 'showAllAttributesButton'),
144
- title: showAllButtonLabel
145
- })), renderExtraAttributes && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
146
- style: [styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter],
144
+ onPress: onAttributeSelected,
145
+ isExpanded: isExpanded
146
+ }, attribute)))), renderExtraAttributes && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
147
+ style: [styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter, showSeeAllButton && styles.allAttributesWrapperWithButton, !allAttributesRendered && styles.hidden],
147
148
  onLayout: onFullAttrContentLayout
148
149
  }, extraAttributes.map((attribute, index, {
149
150
  length
150
151
  }) => /*#__PURE__*/_react.default.createElement(_credentialAttributeItem.default, _extends({
152
+ moreLabel: moreLabel,
153
+ lessLabel: lessLabel,
151
154
  key: attribute.id,
152
- last: !footerView && index === length - 1,
155
+ last: !footerView && !showSeeAllButton && index === length - 1,
153
156
  testID: (0, _testID.concatTestID)(testID, 'attribute', index.toString()),
154
157
  onImagePreview: onImagePreview,
155
- onPress: onAttributeSelected
156
- }, attribute)))))), footerView ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
158
+ onPress: onAttributeSelected,
159
+ isExpanded: isExpanded
160
+ }, attribute)))), showSeeAllButton && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
161
+ style: styles.buttonWrapper
162
+ }, /*#__PURE__*/_react.default.createElement(_buttons.Button, {
163
+ onPress: () => setAllAttributesRendered(prev => !prev),
164
+ type: _buttons.ButtonType.Secondary,
165
+ testID: (0, _testID.concatTestID)(testID, 'showAllAttributesButton'),
166
+ title: isExpanded ? showLessButtonLabel : showAllButtonLabel
167
+ })))), footerView ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
157
168
  style: styles.footer
158
169
  }, footerView) : null);
159
170
  };
@@ -163,6 +174,9 @@ const styles = _reactNative.StyleSheet.create({
163
174
  paddingHorizontal: 4,
164
175
  width: '100%'
165
176
  },
177
+ allAttributesWrapperWithButton: {
178
+ paddingBottom: 0
179
+ },
166
180
  allAttributesWrapperWithFooter: {
167
181
  paddingBottom: 0
168
182
  },
@@ -172,8 +186,10 @@ const styles = _reactNative.StyleSheet.create({
172
186
  },
173
187
  buttonWrapper: {
174
188
  height: SEE_ALL_BUTTON_HEIGHT,
189
+ justifyContent: 'flex-end',
175
190
  paddingBottom: 12,
176
191
  paddingHorizontal: 4,
192
+ paddingTop: 0,
177
193
  width: '100%'
178
194
  },
179
195
  card: {
@@ -188,6 +204,9 @@ const styles = _reactNative.StyleSheet.create({
188
204
  footer: {
189
205
  marginTop: 12
190
206
  },
207
+ hidden: {
208
+ display: 'none'
209
+ },
191
210
  previewAttributesWrapper: {
192
211
  paddingHorizontal: 4,
193
212
  width: '100%'