@procivis/one-react-native-components 0.3.132 → 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.
- package/lib/commonjs/components/history/history-list-item-icon.js +2 -0
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/scan-button.js +122 -27
- package/lib/commonjs/ui-components/buttons/scan-button.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +37 -18
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js +13 -4
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/commonjs/ui-components/icons/icons.js +36 -2
- package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
- package/lib/commonjs/ui-components/list/wallet/empty-list.js +2 -1
- package/lib/commonjs/ui-components/list/wallet/empty-list.js.map +1 -1
- package/lib/commonjs/ui-components/notice/wallet-notice.js +4 -2
- package/lib/commonjs/ui-components/notice/wallet-notice.js.map +1 -1
- package/lib/commonjs/ui-components/text/expandableTypography.js +64 -0
- package/lib/commonjs/ui-components/text/expandableTypography.js.map +1 -0
- package/lib/commonjs/ui-components/text/index.js +15 -0
- package/lib/commonjs/ui-components/text/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js +24 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +20 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +1 -5
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +17 -11
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +12 -4
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +2 -0
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/ui-components/buttons/scan-button.js +124 -29
- package/lib/module/ui-components/buttons/scan-button.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +37 -18
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/credential-attribute-item.js +13 -4
- package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/module/ui-components/icons/icons.js +32 -0
- package/lib/module/ui-components/icons/icons.js.map +1 -1
- package/lib/module/ui-components/list/wallet/empty-list.js +2 -1
- package/lib/module/ui-components/list/wallet/empty-list.js.map +1 -1
- package/lib/module/ui-components/notice/wallet-notice.js +4 -2
- package/lib/module/ui-components/notice/wallet-notice.js.map +1 -1
- package/lib/module/ui-components/text/expandableTypography.js +55 -0
- package/lib/module/ui-components/text/expandableTypography.js.map +1 -0
- package/lib/module/ui-components/text/index.js +2 -1
- package/lib/module/ui-components/text/index.js.map +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js +24 -1
- package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/wallet-unit.js +18 -0
- package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +1 -5
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +18 -12
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +10 -4
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/typescript/ui-components/buttons/scan-button.d.ts +9 -3
- package/lib/typescript/ui-components/credential/card/credential-details-card.d.ts +3 -0
- package/lib/typescript/ui-components/credential/credential-attribute-item.d.ts +3 -0
- package/lib/typescript/ui-components/icons/icons.d.ts +2 -0
- package/lib/typescript/ui-components/list/wallet/empty-list.d.ts +2 -2
- package/lib/typescript/ui-components/text/expandableTypography.d.ts +10 -0
- package/lib/typescript/ui-components/text/index.d.ts +2 -1
- package/lib/typescript/ui-components/text/typography.d.ts +14 -14
- package/lib/typescript/utils/hooks/app-state.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +5 -1
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +4 -3
- package/lib/typescript/utils/parsers/credential.d.ts +2 -1
- package/package.json +3 -3
- package/src/components/history/history-list-item-icon.tsx +2 -0
- package/src/ui-components/buttons/scan-button.tsx +130 -38
- package/src/ui-components/credential/card/credential-details-card.tsx +46 -19
- package/src/ui-components/credential/credential-attribute-item.tsx +15 -3
- package/src/ui-components/icons/icons.tsx +24 -0
- package/src/ui-components/list/wallet/empty-list.tsx +11 -8
- package/src/ui-components/notice/wallet-notice.tsx +4 -2
- package/src/ui-components/text/expandableTypography.tsx +71 -0
- package/src/ui-components/text/index.ts +2 -1
- package/src/utils/hooks/core/credential-schemas.ts +23 -1
- package/src/utils/hooks/core/wallet-unit.ts +21 -0
- package/src/utils/parsers/credential-sharing-v2.tsx +1 -5
- package/src/utils/parsers/credential-sharing.tsx +20 -9
- package/src/utils/parsers/credential.ts +14 -3
|
@@ -19,6 +19,7 @@ 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,
|
|
@@ -54,6 +55,7 @@ const defaultIcons = {
|
|
|
54
55
|
IDENTIFIER: _uiComponents.HistoryIdentifierIcon,
|
|
55
56
|
KEY: _uiComponents.HistoryKeyIcon,
|
|
56
57
|
ORGANISATION: _uiComponents.HistoryOrganisationIcon,
|
|
58
|
+
QES_DOCUMENT: _uiComponents.HistoryCredentialIcon,
|
|
57
59
|
PROOF: _uiComponents.HistoryProofRequestIcon,
|
|
58
60
|
PROOF_SCHEMA: _uiComponents.HistorySchemaIcon,
|
|
59
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","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","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 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 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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AEA,QAAAN,qBAAA,GAAOtF,YAAY,CAACuC,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,oBAAO9G,MAAA,CAAAS,OAAA,CAAA4G,aAAA,CAACnH,aAAA,CAAAoH,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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YACzB,OAAOwE,uCAAyB;UAClC;YACE;QACJ;QACA;MACF,KAAKH,qCAAiB,CAAC7C,UAAU;QAC/B,QAAQuC,IAAI,CAACJ,MAAM;UACjB,KAAKW,iCAAa,CAACpE,OAAO;YACxB,OAAOmB,+BAAiB;UAC1B,KAAKiD,iCAAa,CAAClE,SAAS;YAC1B,OAAOqE,gCAAkB;UAC3B;YACE;QACJ;QACA;MACF;QACE;IACJ;IAEA,QAAAN,qBAAA,GAAOxF,YAAY,CAACwC,WAAW,CAAC4C,IAAI,CAACK,UAAU,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAAIO,8BAAgB;EACtE,CAAC,EAAE,CAACX,IAAI,CAACJ,MAAM,EAAEI,IAAI,CAACK,UAAU,CAAC,CAAC;EAClC,oBAAOhH,MAAA,CAAAS,OAAA,CAAA8G,aAAA,CAACrH,aAAA,CAAAsH,eAAe;IAACC,UAAU,EAAEb,UAAW;IAACc,QAAQ,EAAEb;EAAS,CAAE,CAAC;AACxE,CAAC;AAACJ,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","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
|
-
|
|
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
|
-
|
|
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:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
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.
|
|
77
|
+
style: styles.scanBlurWrapper
|
|
41
78
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
42
|
-
style: [styles.
|
|
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
|
-
|
|
110
|
+
scanBlurWrapper: {
|
|
53
111
|
borderRadius: 28,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
padding: 8,
|
|
57
|
-
width: 104
|
|
112
|
+
flex: 1,
|
|
113
|
+
padding: 8
|
|
58
114
|
},
|
|
59
|
-
|
|
115
|
+
scanButton: {
|
|
60
116
|
borderRadius: 28,
|
|
61
|
-
|
|
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.
|
|
123
|
+
shadowOpacity: 0.25,
|
|
72
124
|
shadowRadius: 24,
|
|
73
|
-
width:
|
|
125
|
+
width: SCAN_WIDTH,
|
|
126
|
+
zIndex: 1
|
|
74
127
|
},
|
|
75
|
-
|
|
128
|
+
scanInner: {
|
|
76
129
|
alignItems: 'center',
|
|
77
130
|
borderRadius: 20,
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
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,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAI7C,MAAMO,OAAe,GAAG;EAAEC,GAAG,EAAE,EAAE;EAAEC,IAAI,EAAE,EAAE;EAAEC,MAAM,EAAE,EAAE;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,GAAAC,OAAA,CAAAhD,OAAA,GACvBkB,UAAU;AAEzB,MAAMe,MAAM,GAAGgB,uBAAU,CAACC,MAAM,CAAC;EAC/BZ,WAAW,EAAE;IACXa,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,MAAM,EAAE,EAAE;IACVC,OAAO,EAAE,CAAC;IACVC,KAAK,EAAE;EACT,CAAC;EACDrB,MAAM,EAAE;IACNiB,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,MAAM,EAAE,EAAE;IACVtC,IAAI,EAAE,KAAK;IACXyC,UAAU,EAAE,CAAC,EAAE;IACfC,QAAQ,EAAE,UAAU;IACpBC,WAAW,EAAE,SAAS;IACtBC,YAAY,EAAE;MAAEN,MAAM,EAAE,CAAC;MAAEE,KAAK,EAAE;IAAE,CAAC;IACrCK,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,EAAE;IAChBN,KAAK,EAAE;EACT,CAAC;EACDf,WAAW,EAAE;IACXsB,UAAU,EAAE,QAAQ;IACpBX,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,MAAM,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;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,OAAA,EAAAF,CAAA;AAU7C,MAAMG,OAAe,GAAG;EAAEC,GAAG,EAAE,EAAE;EAAEC,IAAI,EAAE,EAAE;EAAEC,MAAM,EAAE,EAAE;EAAEC,KAAK,EAAE;AAAG,CAAC;AAEpE,MAAMC,UAAU,GAAG,GAAG;AACtB,MAAMC,WAAW,GAAG,EAAE;AACtB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C;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 =
|
|
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 && !
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
|
|
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%'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_testID","_buttons","_credential","_colorSchemeContext","_credentialAttributeItem","_interopRequireDefault","_credentialCard","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","PREVIEW_ATTRIBUTES_COUNT","SEE_ALL_BUTTON_HEIGHT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","useAppColorScheme","previewAttributesHeight","setPreviewAttributesHeight","useState","fullAttributesHeight","setFullAttributesHeight","allAttributesRendered","setAllAttributesRendered","CaretIcon","UpIcon","DownIcon","cardHeight","Math","ceil","width","CredentialCardRatio","currentHeight","useSharedValue","undefined","animatedHeightSet","setAnimatedHeightSet","previewAttributes","slice","extraAttributes","useMemo","useEffect","viewStyle","StyleSheet","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","buttonViewHeight","additionalAttributesHeight","additionalHeight","fullHeight","value","newHeight","duration","withTiming","animatedStyle","useAnimatedStyle","height","onPreviewAttrContentLayout","useCallback","event","nativeEvent","layout","onFullAttrContentLayout","footerView","React","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","ContainerComponent","Animated","View","detailsCard","backgroundColor","white","concatTestID","accessory","onHeaderPress","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","buttonWrapper","Button","type","ButtonType","Secondary","title","index","create","paddingHorizontal","paddingTop","borderRadius","borderWidth","overflow","marginTop","_default","exports"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps, CredentialCardRatio } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\nconst SEE_ALL_BUTTON_HEIGHT = 78;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n\n const CaretIcon = expanded ? UpIcon : DownIcon;\n\n const cardHeight = Math.ceil(card.width / CredentialCardRatio);\n const currentHeight = useSharedValue<number | undefined>(undefined);\n const [animatedHeightSet, setAnimatedHeightSet] = useState(false);\n\n const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];\n const extraAttributes = useMemo(() => (attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : []), [attributes]);\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const buttonViewHeight = !extraAttributes || allAttributesRendered ? 0 : SEE_ALL_BUTTON_HEIGHT;\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;\n const fullHeight = previewAttributesHeight + additionalHeight;\n\n setAnimatedHeightSet(true);\n if (!animate) {\n currentHeight.value = fullHeight;\n return;\n }\n\n const newHeight = expanded ? fullHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = fullHeight / 5;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n currentHeight,\n animate,\n expanded,\n extraAttributes,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n ]);\n\n const animatedStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: cardHeight,\n };\n }\n return {\n height: cardHeight + currentHeight.value,\n };\n }, [expanded, currentHeight]);\n\n const onPreviewAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setPreviewAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onFullAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setFullAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const footerView: ReactElement | undefined = useMemo(() => {\n if (!footer) {\n return undefined;\n }\n if (React.isValidElement(footer)) {\n return footer;\n } else {\n const FooterComponent = footer as React.ComponentType<any>;\n return <FooterComponent />;\n }\n }, [footer]);\n\n const { header, ...cardProps } = card;\n\n const renderExtraAttributes = allAttributesRendered || (previewAttributesHeight !== undefined && animatedHeightSet);\n\n const ContainerComponent = animate ? Animated.View : View;\n return (\n <ContainerComponent\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, animate ? animatedStyle : undefined, style]}\n {...viewProps}\n testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>\n <CredentialCard\n {...cardProps}\n header={{ ...header, accessory: header.accessory ?? (cardProps.onHeaderPress ? CaretIcon : undefined) }}\n style={[styles.card, cardProps.style]}\n />\n {previewAttributes.length > 0 && (\n <View>\n <View style={styles.attributesWrapper}>\n <View onLayout={onPreviewAttrContentLayout} style={styles.previewAttributesWrapper}>\n {previewAttributes.map((attribute, idx) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && !extraAttributes.length && idx === previewAttributes.length - 1}\n testID={concatTestID(testID, 'attribute', idx.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n {!allAttributesRendered && extraAttributes.length > 0 && (\n <View style={styles.buttonWrapper}>\n <Button\n onPress={() => setAllAttributesRendered(true)}\n type={ButtonType.Secondary}\n testID={concatTestID(testID, 'showAllAttributesButton')}\n title={showAllButtonLabel!}\n />\n </View>\n )}\n {renderExtraAttributes && (\n <View\n style={[styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter]}\n onLayout={onFullAttrContentLayout}>\n {extraAttributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && index === length - 1}\n testID={concatTestID(testID, 'attribute', index.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n )}\n </View>\n </View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </ContainerComponent>\n );\n};\n\nconst styles = StyleSheet.create({\n allAttributesWrapper: {\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n allAttributesWrapperWithFooter: {\n paddingBottom: 0,\n },\n attributesWrapper: {\n paddingTop: 7,\n width: '100%',\n },\n buttonWrapper: {\n height: SEE_ALL_BUTTON_HEIGHT,\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n card: {\n borderRadius: 0,\n borderWidth: 0,\n },\n detailsCard: {\n borderRadius: 10,\n borderWidth: 0,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,eAAA,GAAAV,uBAAA,CAAAC,OAAA;AAA6F,SAAAQ,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,OAAAC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","_reactNative","_reactNativeReanimated","_testID","_buttons","_credential","_colorSchemeContext","_credentialAttributeItem","_interopRequireDefault","_credentialCard","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","PREVIEW_ATTRIBUTES_COUNT","SEE_ALL_BUTTON_HEIGHT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","showLessButtonLabel","moreLabel","lessLabel","testID","viewProps","_header$accessory","colorScheme","useAppColorScheme","previewAttributesHeight","setPreviewAttributesHeight","useState","fullAttributesHeight","setFullAttributesHeight","allAttributesRendered","setAllAttributesRendered","CaretIcon","UpIcon","DownIcon","cardHeight","Math","ceil","width","CredentialCardRatio","currentHeight","useSharedValue","undefined","animatedHeightSet","setAnimatedHeightSet","previewAttributes","slice","extraAttributes","useMemo","showSeeAllButton","isExpanded","useEffect","viewStyle","StyleSheet","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","buttonViewHeight","additionalAttributesHeight","additionalHeight","fullHeight","value","newHeight","duration","withTiming","animatedStyle","useAnimatedStyle","height","onPreviewAttrContentLayout","useCallback","event","nativeEvent","layout","onFullAttrContentLayout","footerView","React","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","ContainerComponent","Animated","View","detailsCard","backgroundColor","white","concatTestID","accessory","onHeaderPress","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","allAttributesWrapperWithButton","hidden","index","buttonWrapper","Button","prev","type","ButtonType","Secondary","title","create","paddingHorizontal","paddingTop","justifyContent","borderRadius","borderWidth","overflow","marginTop","display","_default","exports"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps, CredentialCardRatio } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n showLessButtonLabel?: string;\n moreLabel?: string;\n lessLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\nconst SEE_ALL_BUTTON_HEIGHT = 78;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel = 'Show all',\n showLessButtonLabel = 'Show less',\n moreLabel = 'More',\n lessLabel = 'Less',\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n const CaretIcon = expanded ? UpIcon : DownIcon;\n const cardHeight = Math.ceil(card.width / CredentialCardRatio);\n const currentHeight = useSharedValue<number | undefined>(undefined);\n const [animatedHeightSet, setAnimatedHeightSet] = useState(false);\n const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];\n const extraAttributes = useMemo(() => (attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : []), [attributes]);\n const showSeeAllButton = extraAttributes.length > 0;\n const isExpanded = allAttributesRendered;\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const buttonViewHeight = showSeeAllButton ? SEE_ALL_BUTTON_HEIGHT : 0;\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight + buttonViewHeight : buttonViewHeight;\n const fullHeight = previewAttributesHeight + additionalHeight;\n\n setAnimatedHeightSet(true);\n if (!animate) {\n currentHeight.value = fullHeight;\n return;\n }\n\n const newHeight = expanded ? fullHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = fullHeight / 5;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n currentHeight,\n animate,\n expanded,\n extraAttributes,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n showSeeAllButton,\n ]);\n\n const animatedStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: cardHeight,\n };\n }\n return {\n height: cardHeight + currentHeight.value,\n };\n }, [expanded, currentHeight]);\n\n const onPreviewAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setPreviewAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onFullAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setFullAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const footerView: ReactElement | undefined = useMemo(() => {\n if (!footer) {\n return undefined;\n }\n if (React.isValidElement(footer)) {\n return footer;\n } else {\n const FooterComponent = footer as React.ComponentType<any>;\n return <FooterComponent />;\n }\n }, [footer]);\n\n const { header, ...cardProps } = card;\n\n const renderExtraAttributes = allAttributesRendered || (previewAttributesHeight !== undefined && animatedHeightSet);\n\n const ContainerComponent = animate ? Animated.View : View;\n return (\n <ContainerComponent\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, animate ? animatedStyle : undefined, style]}\n {...viewProps}\n testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>\n <CredentialCard\n {...cardProps}\n header={{ ...header, accessory: header.accessory ?? (cardProps.onHeaderPress ? CaretIcon : undefined) }}\n style={[styles.card, cardProps.style]}\n />\n {previewAttributes.length > 0 && (\n <View>\n <View style={styles.attributesWrapper}>\n <View onLayout={onPreviewAttrContentLayout} style={styles.previewAttributesWrapper}>\n {previewAttributes.map((attribute, idx) => (\n <CredentialAttributeItem\n moreLabel={moreLabel}\n lessLabel={lessLabel}\n key={attribute.id}\n last={!footerView && !showSeeAllButton && idx === previewAttributes.length - 1}\n testID={concatTestID(testID, 'attribute', idx.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n isExpanded={isExpanded}\n {...attribute}\n />\n ))}\n </View>\n\n {renderExtraAttributes && (\n <View\n style={[\n styles.allAttributesWrapper,\n footerView && styles.allAttributesWrapperWithFooter,\n showSeeAllButton && styles.allAttributesWrapperWithButton,\n !allAttributesRendered && styles.hidden,\n ]}\n onLayout={onFullAttrContentLayout}>\n {extraAttributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n moreLabel={moreLabel}\n lessLabel={lessLabel}\n key={attribute.id}\n last={!footerView && !showSeeAllButton && index === length - 1}\n testID={concatTestID(testID, 'attribute', index.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n isExpanded={isExpanded}\n {...attribute}\n />\n ))}\n </View>\n )}\n\n {showSeeAllButton && (\n <View style={styles.buttonWrapper}>\n <Button\n onPress={() => setAllAttributesRendered((prev) => !prev)}\n type={ButtonType.Secondary}\n testID={concatTestID(testID, 'showAllAttributesButton')}\n title={isExpanded ? showLessButtonLabel : showAllButtonLabel}\n />\n </View>\n )}\n </View>\n </View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </ContainerComponent>\n );\n};\n\nconst styles = StyleSheet.create({\n allAttributesWrapper: {\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n allAttributesWrapperWithButton: {\n paddingBottom: 0,\n },\n allAttributesWrapperWithFooter: {\n paddingBottom: 0,\n },\n attributesWrapper: {\n paddingTop: 7,\n width: '100%',\n },\n buttonWrapper: {\n height: SEE_ALL_BUTTON_HEIGHT,\n justifyContent: 'flex-end',\n paddingBottom: 12,\n paddingHorizontal: 4,\n paddingTop: 0,\n width: '100%',\n },\n card: {\n borderRadius: 0,\n borderWidth: 0,\n },\n detailsCard: {\n borderRadius: 10,\n borderWidth: 0,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n hidden: {\n display: 'none',\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,eAAA,GAAAV,uBAAA,CAAAC,OAAA;AAA6F,SAAAQ,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,O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native");
|
|
|
9
9
|
var _color = require("../../utils/color");
|
|
10
10
|
var _testID = require("../../utils/testID");
|
|
11
11
|
var _accessibilityHistoryWrappers = require("../accessibility/accessibilityHistoryWrappers");
|
|
12
|
+
var _expandableTypography = _interopRequireDefault(require("../text/expandableTypography"));
|
|
12
13
|
var _typography = _interopRequireDefault(require("../text/typography"));
|
|
13
14
|
var _colorSchemeContext = require("../theme/color-scheme-context");
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -69,7 +70,10 @@ const CredentialAttributeItem = ({
|
|
|
69
70
|
testID,
|
|
70
71
|
value,
|
|
71
72
|
values,
|
|
72
|
-
valueErrorColor
|
|
73
|
+
valueErrorColor,
|
|
74
|
+
isExpanded,
|
|
75
|
+
moreLabel,
|
|
76
|
+
lessLabel
|
|
73
77
|
}) => {
|
|
74
78
|
const colorScheme = (0, _colorSchemeContext.useAppColorScheme)();
|
|
75
79
|
const imagePreviewHandler = (0, _react.useCallback)(() => {
|
|
@@ -134,11 +138,15 @@ const CredentialAttributeItem = ({
|
|
|
134
138
|
testID: (0, _testID.concatTestID)(testID, 'image'),
|
|
135
139
|
source: image,
|
|
136
140
|
style: styles.dataItemImage
|
|
137
|
-
})), value && /*#__PURE__*/_react.default.createElement(
|
|
141
|
+
})), value && /*#__PURE__*/_react.default.createElement(_expandableTypography.default, {
|
|
138
142
|
color: valueErrorColor ? colorScheme.error : colorScheme.text,
|
|
139
|
-
numberOfLines:
|
|
143
|
+
numberOfLines: 3,
|
|
144
|
+
ellipsizeMode: "tail",
|
|
140
145
|
preset: "s",
|
|
146
|
+
hideExpandButton: !isExpanded && !listValue && !nested,
|
|
141
147
|
style: listValue ? styles.listValue : undefined,
|
|
148
|
+
moreLabel: moreLabel,
|
|
149
|
+
lessLabel: lessLabel,
|
|
142
150
|
testID: (0, _testID.concatTestID)(testID, 'value')
|
|
143
151
|
}, value), isObject && attributes.map((attribute, index, {
|
|
144
152
|
length
|
|
@@ -169,7 +177,8 @@ const CredentialAttributeItem = ({
|
|
|
169
177
|
const styles = _reactNative.StyleSheet.create({
|
|
170
178
|
attributeItem: {
|
|
171
179
|
flex: 1,
|
|
172
|
-
paddingLeft: 8
|
|
180
|
+
paddingLeft: 8,
|
|
181
|
+
paddingRight: 8
|
|
173
182
|
},
|
|
174
183
|
attributeItemContainer: {
|
|
175
184
|
marginTop: 2
|