@procivis/one-react-native-components 0.3.53 → 0.3.71
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/credential/credential.js +6 -3
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item-icon.js +3 -1
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/history/history-list-screen.js +2 -2
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
- package/lib/commonjs/components/proof-request/select-credential.js +7 -3
- package/lib/commonjs/components/proof-request/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential.js +6 -9
- package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/index.js +7 -0
- package/lib/commonjs/ui-components/buttons/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/share-button.js +54 -0
- package/lib/commonjs/ui-components/buttons/share-button.js.map +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-card.js +14 -29
- package/lib/commonjs/ui-components/credential/card/credential-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +27 -28
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +10 -6
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/header/header.js +7 -5
- package/lib/commonjs/ui-components/header/header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-details.js +3 -1
- package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
- package/lib/commonjs/ui-components/icons/icons.js +123 -1
- package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
- package/lib/commonjs/ui-components/index.js +11 -0
- package/lib/commonjs/ui-components/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/loading-result.js +8 -1
- package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
- package/lib/commonjs/ui-components/nfc/index.js +14 -0
- package/lib/commonjs/ui-components/nfc/index.js.map +1 -0
- package/lib/commonjs/ui-components/nfc/nfc-process.js +77 -0
- package/lib/commonjs/ui-components/nfc/nfc-process.js.map +1 -0
- package/lib/commonjs/ui-components/screens/section-list-screen.js +20 -5
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/animated-search-bar.js +10 -8
- package/lib/commonjs/ui-components/searchbar/animated-search-bar.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +2 -1
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +4 -4
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +13 -3
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/index.js +11 -0
- package/lib/commonjs/utils/hooks/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/nfc/nfc-status.js +40 -0
- package/lib/commonjs/utils/hooks/nfc/nfc-status.js.map +1 -0
- package/lib/commonjs/utils/index.js +12 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +18 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +1 -1
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/commonjs/utils/url.js +80 -0
- package/lib/commonjs/utils/url.js.map +1 -0
- package/lib/module/components/credential/credential.js +5 -3
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +3 -1
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/history/history-list-screen.js +2 -2
- package/lib/module/components/history/history-list-screen.js.map +1 -1
- package/lib/module/components/proof-request/select-credential.js +5 -2
- package/lib/module/components/proof-request/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/share-credential.js +7 -10
- package/lib/module/components/proof-request/share-credential.js.map +1 -1
- package/lib/module/ui-components/buttons/index.js +2 -1
- package/lib/module/ui-components/buttons/index.js.map +1 -1
- package/lib/module/ui-components/buttons/share-button.js +47 -0
- package/lib/module/ui-components/buttons/share-button.js.map +1 -0
- package/lib/module/ui-components/credential/card/credential-card.js +15 -30
- package/lib/module/ui-components/credential/card/credential-card.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +27 -28
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-list-item.js +10 -6
- package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/module/ui-components/header/header.js +7 -5
- package/lib/module/ui-components/header/header.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +4 -2
- package/lib/module/ui-components/history/history-details.js.map +1 -1
- package/lib/module/ui-components/icons/icons.js +117 -0
- package/lib/module/ui-components/icons/icons.js.map +1 -1
- package/lib/module/ui-components/index.js +1 -0
- package/lib/module/ui-components/index.js.map +1 -1
- package/lib/module/ui-components/loader/loading-result.js +8 -1
- package/lib/module/ui-components/loader/loading-result.js.map +1 -1
- package/lib/module/ui-components/nfc/index.js +3 -0
- package/lib/module/ui-components/nfc/index.js.map +1 -0
- package/lib/module/ui-components/nfc/nfc-process.js +69 -0
- package/lib/module/ui-components/nfc/nfc-process.js.map +1 -0
- package/lib/module/ui-components/screens/section-list-screen.js +21 -6
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/module/ui-components/searchbar/animated-search-bar.js +10 -8
- package/lib/module/ui-components/searchbar/animated-search-bar.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +1 -1
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +1 -0
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +4 -4
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +12 -2
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/index.js +1 -0
- package/lib/module/utils/hooks/index.js.map +1 -1
- package/lib/module/utils/hooks/nfc/nfc-status.js +32 -0
- package/lib/module/utils/hooks/nfc/nfc-status.js.map +1 -0
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +18 -1
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js +1 -1
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/module/utils/url.js +71 -0
- package/lib/module/utils/url.js.map +1 -0
- package/lib/typescript/components/proof-request/share-credential.d.ts +4 -5
- package/lib/typescript/ui-components/buttons/index.d.ts +3 -1
- package/lib/typescript/ui-components/buttons/share-button.d.ts +10 -0
- package/lib/typescript/ui-components/credential/card/credential-card.d.ts +1 -0
- package/lib/typescript/ui-components/header/header.d.ts +1 -1
- package/lib/typescript/ui-components/icons/icons.d.ts +5 -0
- package/lib/typescript/ui-components/index.d.ts +1 -0
- package/lib/typescript/ui-components/loader/loading-result.d.ts +2 -0
- package/lib/typescript/ui-components/nfc/index.d.ts +2 -0
- package/lib/typescript/ui-components/nfc/nfc-process.d.ts +17 -0
- package/lib/typescript/ui-components/screens/section-list-screen.d.ts +2 -1
- package/lib/typescript/ui-components/searchbar/animated-search-bar.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/backup.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/core-init.d.ts +2 -1
- package/lib/typescript/utils/hooks/core/credentials.d.ts +2 -6
- package/lib/typescript/utils/hooks/core/proofs.d.ts +9 -1
- package/lib/typescript/utils/hooks/index.d.ts +1 -0
- package/lib/typescript/utils/hooks/nfc/nfc-status.d.ts +6 -0
- package/lib/typescript/utils/index.d.ts +1 -0
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +6 -6
- package/lib/typescript/utils/parsers/credential.d.ts +6 -3
- package/lib/typescript/utils/url.d.ts +19 -0
- package/package.json +7 -3
- package/src/components/credential/credential.tsx +4 -2
- package/src/components/history/history-list-item-icon.tsx +2 -0
- package/src/components/history/history-list-screen.tsx +9 -7
- package/src/components/proof-request/select-credential.tsx +4 -2
- package/src/components/proof-request/share-credential.tsx +10 -10
- package/src/ui-components/buttons/index.ts +4 -0
- package/src/ui-components/buttons/share-button.stories.tsx +25 -0
- package/src/ui-components/buttons/share-button.tsx +55 -0
- package/src/ui-components/credential/card/credential-card.stories.tsx +14 -2
- package/src/ui-components/credential/card/credential-card.tsx +16 -23
- package/src/ui-components/credential/card/credential-details-card.stories.tsx +14 -4
- package/src/ui-components/credential/card/credential-details-card.tsx +32 -34
- package/src/ui-components/credential/card/credential-details-list-item.tsx +10 -6
- package/src/ui-components/detail/detail.stories.tsx +3 -3
- package/src/ui-components/header/header.stories.tsx +8 -6
- package/src/ui-components/header/header.tsx +7 -5
- package/src/ui-components/history/history-details.tsx +3 -1
- package/src/ui-components/icons/icons.tsx +107 -0
- package/src/ui-components/index.ts +1 -0
- package/src/ui-components/loader/loading-result.stories.tsx +4 -1
- package/src/ui-components/loader/loading-result.tsx +7 -0
- package/src/ui-components/nfc/index.ts +3 -0
- package/src/ui-components/nfc/nfc-process.tsx +80 -0
- package/src/ui-components/screens/section-list-screen.tsx +21 -4
- package/src/ui-components/searchbar/animated-search-bar.tsx +11 -9
- package/src/utils/hooks/core/backup.ts +5 -2
- package/src/utils/hooks/core/core-init.ts +5 -1
- package/src/utils/hooks/core/credentials.ts +3 -3
- package/src/utils/hooks/core/proofs.ts +20 -5
- package/src/utils/hooks/index.ts +1 -0
- package/src/utils/hooks/nfc/nfc-status.ts +31 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/parsers/credential-sharing.tsx +34 -11
- package/src/utils/parsers/credential.ts +8 -4
- package/src/utils/parsers/query.ts +1 -0
- package/src/utils/url.ts +61 -0
|
@@ -40,7 +40,9 @@ const defaultIcons = {
|
|
|
40
40
|
PROOF: HistoryProofRequestIcon,
|
|
41
41
|
PROOF_SCHEMA: HistorySchemaIcon,
|
|
42
42
|
TRUST_ANCHOR: HistoryTrustAnchorIcon,
|
|
43
|
-
TRUST_ENTITY: HistoryTrustedEntityIcon
|
|
43
|
+
TRUST_ENTITY: HistoryTrustedEntityIcon,
|
|
44
|
+
WALLET_UNIT: HistoryTrustedEntityIcon,
|
|
45
|
+
WALLET_UNIT_ATTESTATION: HistoryTrustedEntityIcon
|
|
44
46
|
}
|
|
45
47
|
};
|
|
46
48
|
export const getHistoryItemActionIcon = action => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HistoryActionEnum","HistoryEntityTypeEnum","React","useMemo","HistoryBackupCreatedIcon","HistoryBackupRestoredIcon","HistoryCertificateIcon","HistoryCredentialIcon","HistoryDidIcon","HistoryIdentifierIcon","HistoryIssueIcon","HistoryItemIcon","HistoryKeyIcon","HistoryOrganisationIcon","HistoryProofRequestIcon","HistoryRevokeIcon","HistorySchemaIcon","HistoryStatusAcceptedIcon","HistoryStatusDeleteIcon","HistoryStatusErrorIcon","HistoryStatusSuspendIcon","HistorySuspendIcon","HistoryTrustAnchorIcon","HistoryTrustedEntityIcon","defaultIcons","actions","ACCEPTED","ACTIVATED","CLAIMS_REMOVED","CREATED","DEACTIVATED","DELETED","ERRORED","IMPORTED","ISSUED","OFFERED","PENDING","REJECTED","REMOVED","REQUESTED","RESTORED","RETRACTED","REVOKED","SHARED","SUSPENDED","UPDATED","WITHDRAWN","REACTIVATED","CSR_GENERATED","EXPIRED","entityTypes","BACKUP","CERTIFICATE","CREDENTIAL","CREDENTIAL_SCHEMA","DID","IDENTIFIER","KEY","ORGANISATION","PROOF","PROOF_SCHEMA","TRUST_ANCHOR","TRUST_ENTITY","getHistoryItemActionIcon","action","_defaultIcons$actions","HistoryListItemIcon","item","statusIcon","typeIcon","_defaultIcons$entityT","entityType","createElement","StatusIcon","TypeIcon"],"sources":["history-list-item-icon.tsx"],"sourcesContent":["import { HistoryActionEnum, HistoryEntityTypeEnum, 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 HistoryActionEnum]: FC<SvgProps> };\n entityTypes: { [key in keyof typeof HistoryEntityTypeEnum]: 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 },\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 TRUST_ANCHOR: HistoryTrustAnchorIcon,\n TRUST_ENTITY: HistoryTrustedEntityIcon,\n },\n};\n\nexport const getHistoryItemActionIcon = (action: HistoryActionEnum) => {\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 HistoryEntityTypeEnum.BACKUP:\n switch (item.action) {\n case HistoryActionEnum.CREATED:\n return HistoryBackupCreatedIcon;\n case HistoryActionEnum.RESTORED:\n return HistoryBackupRestoredIcon;\n default:\n break;\n }\n break;\n case HistoryEntityTypeEnum.CREDENTIAL:\n switch (item.action) {\n case HistoryActionEnum.REVOKED:\n return HistoryRevokeIcon;\n case HistoryActionEnum.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,SAASA,iBAAiB,EAAEC,qBAAqB,QAAyB,iCAAiC;AAC3G,OAAOC,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAG1C,SACEC,wBAAwB,EACxBC,yBAAyB,EACzBC,sBAAsB,EACtBC,qBAAqB,EACrBC,cAAc,EACdC,qBAAqB,EACrBC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,uBAAuB,EACvBC,uBAAuB,EACvBC,iBAAiB,EACjBC,iBAAiB,EACjBC,yBAAyB,EACzBC,uBAAuB,EACvBC,sBAAsB,EACtBC,wBAAwB,EACxBC,kBAAkB,EAClBC,sBAAsB,EACtBC,wBAAwB,QACnB,qBAAqB;AAE5B,MAAMC,YAGL,GAAG;EACFC,OAAO,EAAE;IACPC,QAAQ,EAAET,yBAAyB;IACnCU,SAAS,EAAEV,yBAAyB;IACpCW,cAAc,EAAEV,uBAAuB;IACvCW,OAAO,EAAEZ,yBAAyB;IAClCa,WAAW,EAAEX,sBAAsB;IACnCY,OAAO,EAAEb,uBAAuB;IAChCc,OAAO,EAAEb,sBAAsB;IAC/Bc,QAAQ,EAAEhB,yBAAyB;IACnCiB,MAAM,EAAEjB,yBAAyB;IACjCkB,OAAO,EAAElB,yBAAyB;IAClCmB,OAAO,EAAEnB,yBAAyB;IAClCoB,QAAQ,EAAElB,sBAAsB;IAChCmB,OAAO,EAAEpB,uBAAuB;IAChCqB,SAAS,EAAEtB,yBAAyB;IACpCuB,QAAQ,EAAEvB,yBAAyB;IACnCwB,SAAS,EAAEtB,sBAAsB;IACjCuB,OAAO,EAAEvB,sBAAsB;IAC/BwB,MAAM,EAAE1B,yBAAyB;IACjC2B,SAAS,EAAExB,wBAAwB;IACnCyB,OAAO,EAAE5B,yBAAyB;IAClC6B,SAAS,EAAE3B,sBAAsB;IACjC4B,WAAW,EAAE9B,yBAAyB;IACtC+B,aAAa,EAAE/B,yBAAyB;IACxCgC,OAAO,EAAE9B;EACX,CAAC;EACD+B,WAAW,EAAE;IACXC,MAAM,EAAEpC,iBAAiB;IACzBqC,WAAW,EAAE9C,sBAAsB;IACnC+C,UAAU,EAAE9C,qBAAqB;IACjC+C,iBAAiB,EAAEtC,iBAAiB;IACpCuC,GAAG,EAAE/C,cAAc;IACnBgD,UAAU,EAAE/C,qBAAqB;IACjCgD,GAAG,EAAE7C,cAAc;IACnB8C,YAAY,EAAE7C,uBAAuB;IACrC8C,KAAK,EAAE7C,uBAAuB;IAC9B8C,YAAY,EAAE5C,iBAAiB;IAC/B6C,YAAY,EAAEvC,sBAAsB;IACpCwC,YAAY,EAAEvC;
|
|
1
|
+
{"version":3,"names":["HistoryActionEnum","HistoryEntityTypeEnum","React","useMemo","HistoryBackupCreatedIcon","HistoryBackupRestoredIcon","HistoryCertificateIcon","HistoryCredentialIcon","HistoryDidIcon","HistoryIdentifierIcon","HistoryIssueIcon","HistoryItemIcon","HistoryKeyIcon","HistoryOrganisationIcon","HistoryProofRequestIcon","HistoryRevokeIcon","HistorySchemaIcon","HistoryStatusAcceptedIcon","HistoryStatusDeleteIcon","HistoryStatusErrorIcon","HistoryStatusSuspendIcon","HistorySuspendIcon","HistoryTrustAnchorIcon","HistoryTrustedEntityIcon","defaultIcons","actions","ACCEPTED","ACTIVATED","CLAIMS_REMOVED","CREATED","DEACTIVATED","DELETED","ERRORED","IMPORTED","ISSUED","OFFERED","PENDING","REJECTED","REMOVED","REQUESTED","RESTORED","RETRACTED","REVOKED","SHARED","SUSPENDED","UPDATED","WITHDRAWN","REACTIVATED","CSR_GENERATED","EXPIRED","entityTypes","BACKUP","CERTIFICATE","CREDENTIAL","CREDENTIAL_SCHEMA","DID","IDENTIFIER","KEY","ORGANISATION","PROOF","PROOF_SCHEMA","TRUST_ANCHOR","TRUST_ENTITY","WALLET_UNIT","WALLET_UNIT_ATTESTATION","getHistoryItemActionIcon","action","_defaultIcons$actions","HistoryListItemIcon","item","statusIcon","typeIcon","_defaultIcons$entityT","entityType","createElement","StatusIcon","TypeIcon"],"sources":["history-list-item-icon.tsx"],"sourcesContent":["import { HistoryActionEnum, HistoryEntityTypeEnum, 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 HistoryActionEnum]: FC<SvgProps> };\n entityTypes: { [key in keyof typeof HistoryEntityTypeEnum]: 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 },\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 TRUST_ANCHOR: HistoryTrustAnchorIcon,\n TRUST_ENTITY: HistoryTrustedEntityIcon,\n WALLET_UNIT: HistoryTrustedEntityIcon,\n WALLET_UNIT_ATTESTATION: HistoryTrustedEntityIcon,\n },\n};\n\nexport const getHistoryItemActionIcon = (action: HistoryActionEnum) => {\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 HistoryEntityTypeEnum.BACKUP:\n switch (item.action) {\n case HistoryActionEnum.CREATED:\n return HistoryBackupCreatedIcon;\n case HistoryActionEnum.RESTORED:\n return HistoryBackupRestoredIcon;\n default:\n break;\n }\n break;\n case HistoryEntityTypeEnum.CREDENTIAL:\n switch (item.action) {\n case HistoryActionEnum.REVOKED:\n return HistoryRevokeIcon;\n case HistoryActionEnum.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.entity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AAiB,CAAC0C,OAAO;YAC5B,OAAO3B,iBAAiB;UAC1B,KAAKf,iBAAiB,CAAC4C,SAAS;YAC9B,OAAOvB,kBAAkB;UAC3B;YACE;QACJ;QACA;MACF;QACE;IACJ;IAEA,QAAAmD,qBAAA,GAAOhD,YAAY,CAAC0B,WAAW,CAACmB,IAAI,CAACI,UAAU,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAAI9D,gBAAgB;EACtE,CAAC,EAAE,CAAC2D,IAAI,CAACH,MAAM,EAAEG,IAAI,CAACI,UAAU,CAAC,CAAC;EAClC,oBAAOvE,KAAA,CAAAwE,aAAA,CAAC/D,eAAe;IAACgE,UAAU,EAAEL,UAAW;IAACM,QAAQ,EAAEL;EAAS,CAAE,CAAC;AACxE,CAAC","ignoreList":[]}
|
|
@@ -81,11 +81,11 @@ export const HistoryListScreen = ({
|
|
|
81
81
|
}),
|
|
82
82
|
scrollOffset: scrollOffset,
|
|
83
83
|
searchBar: !searchBarVisible ? undefined : {
|
|
84
|
-
|
|
84
|
+
rightButtons: onOpenFilter ? [/*#__PURE__*/React.createElement(FilterButton, {
|
|
85
85
|
active: Boolean(queryParams.credentialSchemaId),
|
|
86
86
|
onPress: onOpenFilter,
|
|
87
87
|
testID: concatTestID(testID, 'filter')
|
|
88
|
-
}) : undefined,
|
|
88
|
+
})] : undefined,
|
|
89
89
|
rightButtonAlwaysVisible: true,
|
|
90
90
|
searchBarProps: {
|
|
91
91
|
onSearchPhraseChange: setSearchPhrase,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["debounce","React","useEffect","useMemo","useState","Animated","StyleSheet","View","BackButton","FilterButton","FoldableHeader","NavigationHeader","Typography","useAppColorScheme","concatTestID","groupEntriesByDay","useListContentInset","HistoryListView","HistoryListScreen","children","groupItems","itemInfoLabelMode","labels","onBackPressed","onHistoryItemPressed","onOpenFilter","onSearchPhraseChange","queryParams","testID","_queryParams$search","colorScheme","empty","setEmpty","scrollOffset","Value","searchPhrase","setSearchPhrase","searchBarVisible","Boolean","search","text","handleSearchPhraseChange","undefined","headerHeight","insets","additionalBottomPadding","createElement","style","styles","container","backgroundColor","background","emptyNotice","white","marginTop","paddingTop","align","color","preset","emptyTitle","shaded","emptySubtitle","contentContainerStyle","itemProps","infoLabelMode","onPress","onEmpty","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","query","list","header","leftItem","title","searchBar","
|
|
1
|
+
{"version":3,"names":["debounce","React","useEffect","useMemo","useState","Animated","StyleSheet","View","BackButton","FilterButton","FoldableHeader","NavigationHeader","Typography","useAppColorScheme","concatTestID","groupEntriesByDay","useListContentInset","HistoryListView","HistoryListScreen","children","groupItems","itemInfoLabelMode","labels","onBackPressed","onHistoryItemPressed","onOpenFilter","onSearchPhraseChange","queryParams","testID","_queryParams$search","colorScheme","empty","setEmpty","scrollOffset","Value","searchPhrase","setSearchPhrase","searchBarVisible","Boolean","search","text","handleSearchPhraseChange","undefined","headerHeight","insets","additionalBottomPadding","createElement","style","styles","container","backgroundColor","background","emptyNotice","white","marginTop","paddingTop","align","color","preset","emptyTitle","shaded","emptySubtitle","contentContainerStyle","itemProps","infoLabelMode","onPress","onEmpty","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","query","list","header","leftItem","title","searchBar","rightButtons","active","credentialSchemaId","rightButtonAlwaysVisible","searchBarProps","placeholder","staticHeader","create","flex","borderRadius","marginHorizontal","paddingBottom","paddingHorizontal","opacity"],"sources":["history-list-screen.tsx"],"sourcesContent":["import { HistoryListItem, HistoryListQuery } from '@procivis/react-native-one-core';\nimport { debounce } from 'lodash';\nimport React, { FC, PropsWithChildren, useEffect, useMemo, useState } from 'react';\nimport { Animated, StyleSheet, View } from 'react-native';\n\nimport {\n BackButton,\n FilterButton,\n FoldableHeader,\n NavigationHeader,\n Typography,\n useAppColorScheme,\n} from '../../ui-components';\nimport { concatTestID, groupEntriesByDay, HistoryGroupByDaySection, useListContentInset } from '../../utils';\nimport { HistoryListLabels, HistoryListView } from './history-list';\nimport { HistoryListItemViewProps } from './history-list-item';\n\nexport type HistoryListScreenLabels = {\n emptyTitle: string;\n emptySubtitle: string;\n list: HistoryListLabels;\n title: string;\n search: string;\n};\n\nexport type HistoryListScreenProps = {\n groupItems?: (entries: HistoryListItem[]) => HistoryGroupByDaySection[];\n itemInfoLabelMode?: HistoryListItemViewProps['infoLabelMode'];\n labels: HistoryListScreenLabels;\n onBackPressed: () => void;\n onHistoryItemPressed: (historyItem: HistoryListItem) => void;\n onOpenFilter?: () => void;\n onSearchPhraseChange: (searchPhrase: string | undefined) => void;\n queryParams: Partial<HistoryListQuery>;\n testID?: string;\n};\n\nexport const HistoryListScreen: FC<PropsWithChildren<HistoryListScreenProps>> = ({\n children,\n groupItems = groupEntriesByDay,\n itemInfoLabelMode = 'entity',\n labels,\n onBackPressed,\n onHistoryItemPressed,\n onOpenFilter,\n onSearchPhraseChange,\n queryParams,\n testID = 'HistoryScreen',\n}) => {\n const colorScheme = useAppColorScheme();\n const [empty, setEmpty] = useState<boolean>(false);\n const [scrollOffset] = useState(() => new Animated.Value(0));\n\n const [searchPhrase, setSearchPhrase] = useState<string>('');\n const searchBarVisible = !empty || Boolean(queryParams.search?.text);\n\n const handleSearchPhraseChange = useMemo(() => debounce(onSearchPhraseChange, 500), [onSearchPhraseChange]);\n useEffect(() => {\n handleSearchPhraseChange(searchPhrase || undefined);\n }, [searchPhrase, handleSearchPhraseChange]);\n\n const headerHeight = searchBarVisible ? 112 : 70;\n\n const insets = useListContentInset({\n additionalBottomPadding: 24,\n headerHeight,\n });\n\n return (\n <View\n style={[\n styles.container,\n {\n backgroundColor: colorScheme.background,\n },\n ]}\n testID={testID}>\n {empty && (\n <View\n style={[\n styles.emptyNotice,\n {\n backgroundColor: colorScheme.white,\n marginTop: insets.paddingTop,\n },\n ]}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s\">\n {labels.emptyTitle}\n </Typography>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-small\" style={styles.shaded}>\n {labels.emptySubtitle}\n </Typography>\n </View>\n )}\n <HistoryListView\n contentContainerStyle={insets}\n groupItems={groupItems}\n itemProps={{ infoLabelMode: itemInfoLabelMode, onPress: onHistoryItemPressed }}\n onEmpty={setEmpty}\n onScroll={Animated.event([{ nativeEvent: { contentOffset: { y: scrollOffset } } }], {\n useNativeDriver: true,\n })}\n query={queryParams}\n testID={concatTestID(testID, 'list')}\n labels={labels.list}\n />\n {children}\n <FoldableHeader\n header={\n <NavigationHeader\n backgroundColor={'transparent'}\n leftItem={<BackButton onPress={onBackPressed} testID={concatTestID(testID, 'back')} />}\n title={labels.title}\n />\n }\n scrollOffset={scrollOffset}\n searchBar={\n !searchBarVisible\n ? undefined\n : {\n rightButtons: onOpenFilter\n ? [\n <FilterButton\n active={Boolean(queryParams.credentialSchemaId)}\n onPress={onOpenFilter}\n testID={concatTestID(testID, 'filter')}\n />,\n ]\n : undefined,\n rightButtonAlwaysVisible: true,\n searchBarProps: {\n onSearchPhraseChange: setSearchPhrase,\n placeholder: labels.search,\n searchPhrase,\n testID: concatTestID(testID, 'search'),\n },\n }\n }\n staticHeader={!searchBarVisible}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n emptyNotice: {\n borderRadius: 12,\n marginHorizontal: 16,\n paddingBottom: 20,\n paddingHorizontal: 12,\n paddingTop: 16,\n },\n shaded: {\n opacity: 0.7,\n },\n});\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,QAAQ;AACjC,OAAOC,KAAK,IAA2BC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAClF,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,SACEC,UAAU,EACVC,YAAY,EACZC,cAAc,EACdC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,QACZ,qBAAqB;AAC5B,SAASC,YAAY,EAAEC,iBAAiB,EAA4BC,mBAAmB,QAAQ,aAAa;AAC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CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Dimensions } from 'react-native';
|
|
2
3
|
import { CredentialDetailsCardListItem } from '../../ui-components';
|
|
3
4
|
import { useCoreConfig } from '../../utils/hooks/core/core-config';
|
|
4
5
|
import { useCredentialDetail } from '../../utils/hooks/core/credentials';
|
|
@@ -19,6 +20,7 @@ export const SelectCredential = ({
|
|
|
19
20
|
const {
|
|
20
21
|
data: config
|
|
21
22
|
} = useCoreConfig();
|
|
23
|
+
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
22
24
|
if (!credential || !config) {
|
|
23
25
|
return null;
|
|
24
26
|
}
|
|
@@ -30,7 +32,8 @@ export const SelectCredential = ({
|
|
|
30
32
|
attributes: attributes,
|
|
31
33
|
card: {
|
|
32
34
|
...card,
|
|
33
|
-
onHeaderPress: onPress
|
|
35
|
+
onHeaderPress: onPress,
|
|
36
|
+
width: cardWidth
|
|
34
37
|
},
|
|
35
38
|
expanded: selected,
|
|
36
39
|
lastItem: lastItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","CredentialDetailsCardListItem","useCoreConfig","useCredentialDetail","selectCredentialCardFromCredential","SelectCredential","credentialId","labels","lastItem","onImagePreview","onPress","request","selected","testID","data","credential","config","card","attributes","createElement","onHeaderPress","expanded"],"sources":["select-credential.tsx"],"sourcesContent":["import { PresentationDefinitionRequestedCredential } from '@procivis/react-native-one-core';\nimport React, { FC } from 'react';\nimport { ImageSourcePropType } from 'react-native';\n\nimport { CredentialDetailsCardListItem } from '../../ui-components';\nimport { useCoreConfig } from '../../utils/hooks/core/core-config';\nimport { useCredentialDetail } from '../../utils/hooks/core/credentials';\nimport { selectCredentialCardFromCredential, ShareCredentialCardLabels } from '../../utils/parsers/credential-sharing';\n\nexport const SelectCredential: FC<{\n credentialId: string;\n labels: ShareCredentialCardLabels;\n lastItem: boolean;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onPress?: () => void;\n request: PresentationDefinitionRequestedCredential;\n selected: boolean;\n testID: string;\n}> = ({ credentialId, labels, lastItem, onImagePreview, onPress, request, selected, testID }) => {\n const { data: credential } = useCredentialDetail(credentialId);\n const { data: config } = useCoreConfig();\n\n if (!credential || !config) {\n return null;\n }\n\n const { card, attributes } = selectCredentialCardFromCredential(\n credential,\n selected,\n request,\n config,\n testID,\n labels,\n );\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n onHeaderPress: onPress,\n }}\n expanded={selected}\n lastItem={lastItem}\n onImagePreview={onImagePreview}\n />\n );\n};\n"],"mappings":"AACA,OAAOA,KAAK,
|
|
1
|
+
{"version":3,"names":["React","useMemo","Dimensions","CredentialDetailsCardListItem","useCoreConfig","useCredentialDetail","selectCredentialCardFromCredential","SelectCredential","credentialId","labels","lastItem","onImagePreview","onPress","request","selected","testID","data","credential","config","cardWidth","get","width","card","attributes","createElement","onHeaderPress","expanded"],"sources":["select-credential.tsx"],"sourcesContent":["import { PresentationDefinitionRequestedCredential } from '@procivis/react-native-one-core';\nimport React, { FC, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType } from 'react-native';\n\nimport { CredentialDetailsCardListItem } from '../../ui-components';\nimport { useCoreConfig } from '../../utils/hooks/core/core-config';\nimport { useCredentialDetail } from '../../utils/hooks/core/credentials';\nimport { selectCredentialCardFromCredential, ShareCredentialCardLabels } from '../../utils/parsers/credential-sharing';\n\nexport const SelectCredential: FC<{\n credentialId: string;\n labels: ShareCredentialCardLabels;\n lastItem: boolean;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onPress?: () => void;\n request: PresentationDefinitionRequestedCredential;\n selected: boolean;\n testID: string;\n}> = ({ credentialId, labels, lastItem, onImagePreview, onPress, request, selected, testID }) => {\n const { data: credential } = useCredentialDetail(credentialId);\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);\n\n if (!credential || !config) {\n return null;\n }\n\n const { card, attributes } = selectCredentialCardFromCredential(\n credential,\n selected,\n request,\n config,\n testID,\n labels,\n );\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n onHeaderPress: onPress,\n width: cardWidth,\n }}\n expanded={selected}\n lastItem={lastItem}\n onImagePreview={onImagePreview}\n />\n );\n};\n"],"mappings":"AACA,OAAOA,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAC1C,SAASC,UAAU,QAA6B,cAAc;AAE9D,SAASC,6BAA6B,QAAQ,qBAAqB;AACnE,SAASC,aAAa,QAAQ,oCAAoC;AAClE,SAASC,mBAAmB,QAAQ,oCAAoC;AACxE,SAASC,kCAAkC,QAAmC,wCAAwC;AAEtH,OAAO,MAAMC,gBASX,GAAGA,CAAC;EAAEC,YAAY;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,cAAc;EAAEC,OAAO;EAAEC,OAAO;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAK;EAC/F,MAAM;IAAEC,IAAI,EAAEC;EAAW,CAAC,GAAGZ,mBAAmB,CAACG,YAAY,CAAC;EAC9D,MAAM;IAAEQ,IAAI,EAAEE;EAAO,CAAC,GAAGd,aAAa,CAAC,CAAC;EACxC,MAAMe,SAAS,GAAGlB,OAAO,CAAC,MAAMC,UAAU,CAACkB,GAAG,CAAC,QAAQ,CAAC,CAACC,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC;EAExE,IAAI,CAACJ,UAAU,IAAI,CAACC,MAAM,EAAE;IAC1B,OAAO,IAAI;EACb;EAEA,MAAM;IAAEI,IAAI;IAAEC;EAAW,CAAC,GAAGjB,kCAAkC,CAC7DW,UAAU,EACVH,QAAQ,EACRD,OAAO,EACPK,MAAM,EACNH,MAAM,EACNN,MACF,CAAC;EAED,oBACET,KAAA,CAAAwB,aAAA,CAACrB,6BAA6B;IAC5BoB,UAAU,EAAEA,UAAW;IACvBD,IAAI,EAAE;MACJ,GAAGA,IAAI;MACPG,aAAa,EAAEb,OAAO;MACtBS,KAAK,EAAEF;IACT,CAAE;IACFO,QAAQ,EAAEZ,QAAS;IACnBJ,QAAQ,EAAEA,QAAS;IACnBC,cAAc,EAAEA;EAAe,CAChC,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { CredentialStateEnum } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Dimensions, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { Button, ButtonType, CredentialDetailsCardListItem, Typography, useAppColorScheme } from '../../ui-components';
|
|
5
5
|
import { concatTestID } from '../../utils';
|
|
6
6
|
import { useCoreConfig } from '../../utils/hooks/core/core-config';
|
|
7
|
-
import { useCredentialDetail } from '../../utils/hooks/core/credentials';
|
|
8
7
|
import { getValidityState, ValidityState } from '../../utils/parsers/credential';
|
|
9
8
|
import { shareCredentialCardFromCredential } from '../../utils/parsers/credential-sharing';
|
|
10
9
|
export const ShareCredential = ({
|
|
11
10
|
allCredentials,
|
|
12
|
-
credentialId,
|
|
13
11
|
expanded,
|
|
14
12
|
labels,
|
|
15
13
|
lastItem,
|
|
@@ -25,13 +23,11 @@ export const ShareCredential = ({
|
|
|
25
23
|
}) => {
|
|
26
24
|
var _credential$issuer;
|
|
27
25
|
const colorScheme = useAppColorScheme();
|
|
28
|
-
const
|
|
29
|
-
data: credential,
|
|
30
|
-
isLoading
|
|
31
|
-
} = useCredentialDetail(selectedCredentialId);
|
|
26
|
+
const credential = allCredentials.find(c => c.id === selectedCredentialId);
|
|
32
27
|
const {
|
|
33
28
|
data: config
|
|
34
29
|
} = useCoreConfig();
|
|
30
|
+
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
35
31
|
const selectionOptions = useMemo(() => request.applicableCredentials.filter(applicableCredentialId => allCredentials.some(({
|
|
36
32
|
id,
|
|
37
33
|
state
|
|
@@ -106,7 +102,7 @@ export const ShareCredential = ({
|
|
|
106
102
|
}));
|
|
107
103
|
}
|
|
108
104
|
}, [colorScheme, expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);
|
|
109
|
-
if (
|
|
105
|
+
if (!config) {
|
|
110
106
|
return null;
|
|
111
107
|
}
|
|
112
108
|
const {
|
|
@@ -117,8 +113,9 @@ export const ShareCredential = ({
|
|
|
117
113
|
attributes: attributes,
|
|
118
114
|
card: {
|
|
119
115
|
...card,
|
|
120
|
-
credentialId,
|
|
121
|
-
onHeaderPress
|
|
116
|
+
credentialId: request.id,
|
|
117
|
+
onHeaderPress,
|
|
118
|
+
width: cardWidth
|
|
122
119
|
},
|
|
123
120
|
expanded: expanded,
|
|
124
121
|
footer: footer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CredentialStateEnum","React","useMemo","StyleSheet","View","Button","ButtonType","CredentialDetailsCardListItem","Typography","useAppColorScheme","concatTestID","useCoreConfig","useCredentialDetail","getValidityState","ValidityState","shareCredentialCardFromCredential","ShareCredential","allCredentials","credentialId","expanded","labels","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","request","selectedCredentialId","selectedFields","style","testID","_credential$issuer","colorScheme","data","credential","isLoading","config","selectionOptions","applicableCredentials","filter","applicableCredentialId","some","id","state","ACCEPTED","multipleCredentialsAvailable","length","validityState","issuer","undefined","invalid","lvvcIssuanceDate","validityCredentialNbf","Date","footer","Revoked","createElement","styles","notice","backgroundColor","background","align","color","text","preset","revokedCredentialNotice","Suspended","suspendedCredentialNotice","invalidCredentialNotice","multipleCredentialsNotice","onPress","noticeButton","title","multipleCredentialsSelect","type","Secondary","card","attributes","Boolean","onAttributeSelected","borderColor","create","borderRadius","borderWidth","marginBottom","marginHorizontal","padding","marginTop","paddingVertical"],"sources":["share-credential.tsx"],"sourcesContent":["import {\n CredentialListItem,\n CredentialStateEnum,\n PresentationDefinitionField,\n PresentationDefinitionRequestedCredential,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useMemo } from 'react';\nimport { ImageSourcePropType, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { Button, ButtonType, CredentialDetailsCardListItem, Typography, useAppColorScheme } from '../../ui-components';\nimport { concatTestID } from '../../utils';\nimport { useCoreConfig } from '../../utils/hooks/core/core-config';\nimport { useCredentialDetail } from '../../utils/hooks/core/credentials';\nimport { getValidityState, ValidityState } from '../../utils/parsers/credential';\nimport { shareCredentialCardFromCredential, ShareCredentialCardLabels } from '../../utils/parsers/credential-sharing';\n\nexport type ShareCredentialLabels = ShareCredentialCardLabels & {\n revokedCredentialNotice: string;\n suspendedCredentialNotice: string;\n invalidCredentialNotice: string;\n multipleCredentialsNotice: string;\n multipleCredentialsSelect: string;\n};\n\nexport const ShareCredential: FunctionComponent<{\n allCredentials: CredentialListItem[];\n credentialId: string;\n expanded?: boolean;\n labels: ShareCredentialLabels;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (_id: PresentationDefinitionField['id'], _selected: boolean) => void;\n request: PresentationDefinitionRequestedCredential;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionField['id']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n}> = ({\n allCredentials,\n credentialId,\n expanded,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n request,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { data: credential, isLoading } = useCredentialDetail(selectedCredentialId);\n const { data: config } = useCoreConfig();\n\n const selectionOptions = useMemo(\n () =>\n request.applicableCredentials.filter((applicableCredentialId) =>\n allCredentials.some(({ id, state }) => id === applicableCredentialId && state === CredentialStateEnum.ACCEPTED),\n ),\n [allCredentials, request],\n );\n const multipleCredentialsAvailable = selectionOptions.length > 1;\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const invalid = useMemo(() => {\n if (!credential?.lvvcIssuanceDate || !request.validityCredentialNbf) {\n return false;\n }\n return new Date(credential.lvvcIssuanceDate) < new Date(request.validityCredentialNbf);\n }, [credential, request]);\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.revoked')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.revokedCredentialNotice}\n </Typography>\n </View>\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.suspended')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.suspendedCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (invalid) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.invalid')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.invalidCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.multiple')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.multipleCredentialsNotice}\n </Typography>\n <Button\n onPress={onSelectCredential}\n style={styles.noticeButton}\n testID={concatTestID(testID, 'notice.multiple.button')}\n title={labels.multipleCredentialsSelect}\n type={ButtonType.Secondary}\n />\n </View>\n );\n }\n }, [colorScheme, expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);\n\n if (isLoading || !config) {\n return null;\n }\n\n const { card, attributes } = shareCredentialCardFromCredential(\n credential,\n invalid,\n Boolean(expanded),\n multipleCredentialsAvailable,\n request,\n selectedFields,\n config,\n testID,\n labels,\n );\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId,\n onHeaderPress,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onSelectField}\n onImagePreview={onImagePreview}\n style={[styles.credential, { borderColor: colorScheme.background }, style]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n credential: {\n borderRadius: 10,\n borderWidth: 1,\n marginBottom: 8,\n },\n notice: {\n marginBottom: 22,\n marginHorizontal: 12,\n padding: 12,\n },\n noticeButton: {\n marginTop: 24,\n paddingVertical: 11,\n },\n});\n"],"mappings":"AAAA,SAEEA,mBAAmB,QAGd,iCAAiC;AACxC,OAAOC,KAAK,IAAuBC,OAAO,QAAQ,OAAO;AACzD,SAAyCC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAE1F,SAASC,MAAM,EAAEC,UAAU,EAAEC,6BAA6B,EAAEC,UAAU,EAAEC,iBAAiB,QAAQ,qBAAqB;AACtH,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,aAAa,QAAQ,oCAAoC;AAClE,SAASC,mBAAmB,QAAQ,oCAAoC;AACxE,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,gCAAgC;AAChF,SAASC,iCAAiC,QAAmC,wCAAwC;AAUrH,OAAO,MAAMC,eAeX,GAAGA,CAAC;EACJC,cAAc;EACdC,YAAY;EACZC,QAAQ;EACRC,MAAM;EACNC,QAAQ;EACRC,aAAa;EACbC,cAAc;EACdC,kBAAkB;EAClBC,aAAa;EACbC,OAAO;EACPC,oBAAoB;EACpBC,cAAc;EACdC,KAAK;EACLC;AACF,CAAC,KAAK;EAAA,IAAAC,kBAAA;EACJ,MAAMC,WAAW,GAAGvB,iBAAiB,CAAC,CAAC;EACvC,MAAM;IAAEwB,IAAI,EAAEC,UAAU;I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AW;IACvBD,IAAI,EAAE;MACJ,GAAGA,IAAI;MACP1D,YAAY;MACZI;IACF,CAAE;IACFH,QAAQ,EAAEA,QAAS;IACnBmC,MAAM,EAAEA,MAAO;IACfjC,QAAQ,EAAEA,QAAS;IACnB0D,mBAAmB,EAAEtD,aAAc;IACnCF,cAAc,EAAEA,cAAe;IAC/BM,KAAK,EAAE,CAAC4B,MAAM,CAACvB,UAAU,EAAE;MAAE8C,WAAW,EAAEhD,WAAW,CAAC4B;IAAW,CAAC,EAAE/B,KAAK,CAAE;IAC3EC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAED,MAAM2B,MAAM,GAAGtD,UAAU,CAAC8E,MAAM,CAAC;EAC/B/C,UAAU,EAAE;IACVgD,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE;EAChB,CAAC;EACD1B,MAAM,EAAE;IACN0B,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,EAAE;IACpBC,OAAO,EAAE;EACX,CAAC;EACDf,YAAY,EAAE;IACZgB,SAAS,EAAE,EAAE;IACbC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["CredentialStateEnum","React","useMemo","Dimensions","StyleSheet","View","Button","ButtonType","CredentialDetailsCardListItem","Typography","useAppColorScheme","concatTestID","useCoreConfig","getValidityState","ValidityState","shareCredentialCardFromCredential","ShareCredential","allCredentials","expanded","labels","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","request","selectedCredentialId","selectedFields","style","testID","_credential$issuer","colorScheme","credential","find","c","id","data","config","cardWidth","get","width","selectionOptions","applicableCredentials","filter","applicableCredentialId","some","state","ACCEPTED","multipleCredentialsAvailable","length","validityState","issuer","undefined","invalid","lvvcIssuanceDate","validityCredentialNbf","Date","footer","Revoked","createElement","styles","notice","backgroundColor","background","align","color","text","preset","revokedCredentialNotice","Suspended","suspendedCredentialNotice","invalidCredentialNotice","multipleCredentialsNotice","onPress","noticeButton","title","multipleCredentialsSelect","type","Secondary","card","attributes","Boolean","credentialId","onAttributeSelected","borderColor","create","borderRadius","borderWidth","marginBottom","marginHorizontal","padding","marginTop","paddingVertical"],"sources":["share-credential.tsx"],"sourcesContent":["import {\n CredentialDetail,\n CredentialListItem,\n CredentialStateEnum,\n PresentationDefinitionField,\n PresentationDefinitionRequestedCredential,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { Button, ButtonType, CredentialDetailsCardListItem, Typography, useAppColorScheme } from '../../ui-components';\nimport { concatTestID } from '../../utils';\nimport { useCoreConfig } from '../../utils/hooks/core/core-config';\nimport { getValidityState, ValidityState } from '../../utils/parsers/credential';\nimport { shareCredentialCardFromCredential, ShareCredentialCardLabels } from '../../utils/parsers/credential-sharing';\n\nexport type ShareCredentialLabels = ShareCredentialCardLabels & {\n invalidCredentialNotice: string;\n multipleCredentialsNotice: string;\n multipleCredentialsSelect: string;\n revokedCredentialNotice: string;\n suspendedCredentialNotice: string;\n};\n\nexport const ShareCredential: FunctionComponent<{\n allCredentials: CredentialDetail[];\n expanded?: boolean;\n labels: ShareCredentialLabels;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (_id: PresentationDefinitionField['id'], _selected: boolean) => void;\n request: PresentationDefinitionRequestedCredential;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionField['id']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n}> = ({\n allCredentials,\n expanded,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n request,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const credential = allCredentials.find((c) => c.id === selectedCredentialId);\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);\n\n const selectionOptions = useMemo(\n () =>\n request.applicableCredentials.filter((applicableCredentialId) =>\n allCredentials.some(({ id, state }) => id === applicableCredentialId && state === CredentialStateEnum.ACCEPTED),\n ),\n [allCredentials, request],\n );\n const multipleCredentialsAvailable = selectionOptions.length > 1;\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const invalid = useMemo(() => {\n if (!credential?.lvvcIssuanceDate || !request.validityCredentialNbf) {\n return false;\n }\n return new Date(credential.lvvcIssuanceDate) < new Date(request.validityCredentialNbf);\n }, [credential, request]);\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.revoked')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.revokedCredentialNotice}\n </Typography>\n </View>\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.suspended')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.suspendedCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (invalid) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.invalid')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.invalidCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.multiple')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.multipleCredentialsNotice}\n </Typography>\n <Button\n onPress={onSelectCredential}\n style={styles.noticeButton}\n testID={concatTestID(testID, 'notice.multiple.button')}\n title={labels.multipleCredentialsSelect}\n type={ButtonType.Secondary}\n />\n </View>\n );\n }\n }, [colorScheme, expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);\n\n if (!config) {\n return null;\n }\n\n const { card, attributes } = shareCredentialCardFromCredential(\n credential,\n invalid,\n Boolean(expanded),\n multipleCredentialsAvailable,\n request,\n selectedFields,\n config,\n testID,\n labels,\n );\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId: request.id,\n onHeaderPress,\n width: cardWidth,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onSelectField}\n onImagePreview={onImagePreview}\n style={[styles.credential, { borderColor: colorScheme.background }, style]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n credential: {\n borderRadius: 10,\n borderWidth: 1,\n marginBottom: 8,\n },\n notice: {\n marginBottom: 22,\n marginHorizontal: 12,\n padding: 12,\n },\n noticeButton: {\n marginTop: 24,\n paddingVertical: 11,\n },\n});\n"],"mappings":"AAAA,SAGEA,mBAAmB,QAGd,iCAAiC;AACxC,OAAOC,KAAK,IAAuBC,OAAO,QAAQ,OAAO;AACzD,SAASC,UAAU,EAAkCC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAEtG,SAASC,MAAM,EAAEC,UAAU,EAAEC,6BAA6B,EAAEC,UAAU,EAAEC,iBAAiB,QAAQ,qBAAqB;AACtH,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,aAAa,QAAQ,oCAAoC;AAClE,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,gCAAgC;AAChF,SAASC,iCAAiC,QAAmC,wCAAwC;AAUrH,OAAO,MAAMC,eAcX,GAAGA,CAAC;EACJC,cAAc;EACdC,QAAQ;EACRC,MAAM;EACNC,QAAQ;EACRC,aAAa;EACbC,cAAc;EACdC,kBAAkB;EAClBC,a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EACb;EAEA,MAAM;IAAE0C,IAAI;IAAEC;EAAW,CAAC,GAAGjE,iCAAiC,CAC5DiB,UAAU,EACVqB,OAAO,EACP4B,OAAO,CAAC/D,QAAQ,CAAC,EACjB8B,4BAA4B,EAC5BvB,OAAO,EACPE,cAAc,EACdU,MAAM,EACNR,MAAM,EACNV,MACF,CAAC;EAED,oBACElB,KAAA,CAAA0D,aAAA,CAACnD,6BAA6B;IAC5BwE,UAAU,EAAEA,UAAW;IACvBD,IAAI,EAAE;MACJ,GAAGA,IAAI;MACPG,YAAY,EAAEzD,OAAO,CAACU,EAAE;MACxBd,aAAa;MACbmB,KAAK,EAAEF;IACT,CAAE;IACFpB,QAAQ,EAAEA,QAAS;IACnBuC,MAAM,EAAEA,MAAO;IACfrC,QAAQ,EAAEA,QAAS;IACnB+D,mBAAmB,EAAE3D,aAAc;IACnCF,cAAc,EAAEA,cAAe;IAC/BM,KAAK,EAAE,CAACgC,MAAM,CAAC5B,UAAU,EAAE;MAAEoD,WAAW,EAAErD,WAAW,CAACgC;IAAW,CAAC,EAAEnC,KAAK,CAAE;IAC3EC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAED,MAAM+B,MAAM,GAAGxD,UAAU,CAACiF,MAAM,CAAC;EAC/BrD,UAAU,EAAE;IACVsD,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE;EAChB,CAAC;EACD3B,MAAM,EAAE;IACN2B,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,EAAE;IACpBC,OAAO,EAAE;EACX,CAAC;EACDhB,YAAY,EAAE;IACZiB,SAAS,EAAE,EAAE;IACbC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -5,5 +5,6 @@ import FilterButton from './filter-button';
|
|
|
5
5
|
import GhostButton from './ghost-button';
|
|
6
6
|
import HoldButton from './hold-button';
|
|
7
7
|
import ScanButton from './scan-button';
|
|
8
|
-
|
|
8
|
+
import ShareButton from './share-button';
|
|
9
|
+
export { BackButton, BackButtonIcon, Button, ButtonType, ConnectivityButton, ConnectivityTransport, FilterButton, GhostButton, HoldButton, ScanButton, ShareButton };
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BackButton","BackButtonIcon","Button","ButtonType","ConnectivityButton","ConnectivityTransport","FilterButton","GhostButton","HoldButton","ScanButton"],"sources":["index.ts"],"sourcesContent":["import type { BackButtonProps } from './back-button';\nimport BackButton, { BackButtonIcon } from './back-button';\nimport type { ButtonProps } from './button';\nimport { Button, ButtonType } from './button';\nimport type { ConnectivityButtonProps } from './connectivity-button';\nimport ConnectivityButton, { ConnectivityTransport } from './connectivity-button';\nimport type { FilterButtonProps } from './filter-button';\nimport FilterButton from './filter-button';\nimport type { GhostButtonProps } from './ghost-button';\nimport GhostButton from './ghost-button';\nimport type { HoldButtonProps } from './hold-button';\nimport HoldButton from './hold-button';\nimport type { ScanButtonProps } from './scan-button';\nimport ScanButton from './scan-button';\n\nexport {\n BackButton,\n BackButtonIcon,\n BackButtonProps,\n Button,\n ButtonProps,\n ButtonType,\n ConnectivityButton,\n ConnectivityButtonProps,\n ConnectivityTransport,\n FilterButton,\n FilterButtonProps,\n GhostButton,\n GhostButtonProps,\n HoldButton,\n HoldButtonProps,\n ScanButton,\n ScanButtonProps,\n};\n"],"mappings":"AACA,OAAOA,UAAU,IAAIC,cAAc,QAAQ,eAAe;AAE1D,SAASC,MAAM,EAAEC,UAAU,QAAQ,UAAU;AAE7C,OAAOC,kBAAkB,IAAIC,qBAAqB,QAAQ,uBAAuB;AAEjF,OAAOC,YAAY,MAAM,iBAAiB;AAE1C,OAAOC,WAAW,MAAM,gBAAgB;AAExC,OAAOC,UAAU,MAAM,eAAe;AAEtC,OAAOC,UAAU,MAAM,eAAe;AAEtC,
|
|
1
|
+
{"version":3,"names":["BackButton","BackButtonIcon","Button","ButtonType","ConnectivityButton","ConnectivityTransport","FilterButton","GhostButton","HoldButton","ScanButton","ShareButton"],"sources":["index.ts"],"sourcesContent":["import type { BackButtonProps } from './back-button';\nimport BackButton, { BackButtonIcon } from './back-button';\nimport type { ButtonProps } from './button';\nimport { Button, ButtonType } from './button';\nimport type { ConnectivityButtonProps } from './connectivity-button';\nimport ConnectivityButton, { ConnectivityTransport } from './connectivity-button';\nimport type { FilterButtonProps } from './filter-button';\nimport FilterButton from './filter-button';\nimport type { GhostButtonProps } from './ghost-button';\nimport GhostButton from './ghost-button';\nimport type { HoldButtonProps } from './hold-button';\nimport HoldButton from './hold-button';\nimport type { ScanButtonProps } from './scan-button';\nimport ScanButton from './scan-button';\nimport type { ShareButtonProps } from './share-button';\nimport ShareButton from './share-button';\n\nexport {\n BackButton,\n BackButtonIcon,\n BackButtonProps,\n Button,\n ButtonProps,\n ButtonType,\n ConnectivityButton,\n ConnectivityButtonProps,\n ConnectivityTransport,\n FilterButton,\n FilterButtonProps,\n GhostButton,\n GhostButtonProps,\n HoldButton,\n HoldButtonProps,\n ScanButton,\n ScanButtonProps,\n ShareButton,\n ShareButtonProps,\n};\n"],"mappings":"AACA,OAAOA,UAAU,IAAIC,cAAc,QAAQ,eAAe;AAE1D,SAASC,MAAM,EAAEC,UAAU,QAAQ,UAAU;AAE7C,OAAOC,kBAAkB,IAAIC,qBAAqB,QAAQ,uBAAuB;AAEjF,OAAOC,YAAY,MAAM,iBAAiB;AAE1C,OAAOC,WAAW,MAAM,gBAAgB;AAExC,OAAOC,UAAU,MAAM,eAAe;AAEtC,OAAOC,UAAU,MAAM,eAAe;AAEtC,OAAOC,WAAW,MAAM,gBAAgB;AAExC,SACEV,UAAU,EACVC,cAAc,EAEdC,MAAM,EAENC,UAAU,EACVC,kBAAkB,EAElBC,qBAAqB,EACrBC,YAAY,EAEZC,WAAW,EAEXC,UAAU,EAEVC,UAAU,EAEVC,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { concatTestID } from '../../utils';
|
|
4
|
+
import { TouchableHighlight } from '../accessibility';
|
|
5
|
+
import { Typography } from '../text';
|
|
6
|
+
import { useAppColorScheme } from '../theme';
|
|
7
|
+
import { LinkIcon } from '../icons';
|
|
8
|
+
const ShareButton = ({
|
|
9
|
+
onPress,
|
|
10
|
+
style,
|
|
11
|
+
title,
|
|
12
|
+
testID
|
|
13
|
+
}) => {
|
|
14
|
+
const colorScheme = useAppColorScheme();
|
|
15
|
+
return /*#__PURE__*/React.createElement(TouchableHighlight, {
|
|
16
|
+
onPress: onPress,
|
|
17
|
+
style: [styles.button, style],
|
|
18
|
+
testID: testID
|
|
19
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
20
|
+
style: [styles.container, {
|
|
21
|
+
backgroundColor: colorScheme.white
|
|
22
|
+
}]
|
|
23
|
+
}, /*#__PURE__*/React.createElement(LinkIcon, {
|
|
24
|
+
color: colorScheme.text
|
|
25
|
+
}), title && /*#__PURE__*/React.createElement(Typography, {
|
|
26
|
+
testID: concatTestID(testID, 'title'),
|
|
27
|
+
color: colorScheme.text,
|
|
28
|
+
preset: "s"
|
|
29
|
+
}, title)));
|
|
30
|
+
};
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
button: {
|
|
33
|
+
borderRadius: 5,
|
|
34
|
+
overflow: 'hidden'
|
|
35
|
+
},
|
|
36
|
+
container: {
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
flexDirection: 'row',
|
|
39
|
+
gap: 5,
|
|
40
|
+
height: 32,
|
|
41
|
+
paddingLeft: 4,
|
|
42
|
+
paddingRight: 6,
|
|
43
|
+
paddingVertical: 5
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export default ShareButton;
|
|
47
|
+
//# sourceMappingURL=share-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","concatTestID","TouchableHighlight","Typography","useAppColorScheme","LinkIcon","ShareButton","onPress","style","title","testID","colorScheme","createElement","styles","button","container","backgroundColor","white","color","text","preset","create","borderRadius","overflow","alignItems","flexDirection","gap","height","paddingLeft","paddingRight","paddingVertical"],"sources":["share-button.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { TouchableHighlight } from '../accessibility';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\nimport { LinkIcon } from '../icons';\n\nexport type ShareButtonProps = {\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n title?: string;\n testID?: string;\n};\n\nconst ShareButton: FC<ShareButtonProps> = ({\n onPress,\n style,\n title,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n\n return (\n <TouchableHighlight onPress={onPress} style={[styles.button, style]} testID={testID}>\n <View style={[styles.container, { backgroundColor: colorScheme.white }]}>\n <LinkIcon color={colorScheme.text} />\n {title && (\n <Typography testID={concatTestID(testID, 'title')} color={colorScheme.text} preset=\"s\">\n {title}\n </Typography>\n )}\n </View>\n </TouchableHighlight>\n );\n};\n\nconst styles = StyleSheet.create({\n button: {\n borderRadius: 5,\n overflow: 'hidden',\n },\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: 5,\n height: 32,\n paddingLeft: 4,\n paddingRight: 6,\n paddingVertical: 5,\n },\n});\n\nexport default ShareButton;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,SAASC,QAAQ,QAAQ,UAAU;AASnC,MAAMC,WAAiC,GAAGA,CAAC;EACzCC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGP,iBAAiB,CAAC,CAAC;EAEvC,oBACEN,KAAA,CAAAc,aAAA,CAACV,kBAAkB;IAACK,OAAO,EAAEA,OAAQ;IAACC,KAAK,EAAE,CAACK,MAAM,CAACC,MAAM,EAAEN,KAAK,CAAE;IAACE,MAAM,EAAEA;EAAO,gBAClFZ,KAAA,CAAAc,aAAA,CAACZ,IAAI;IAACQ,KAAK,EAAE,CAACK,MAAM,CAACE,SAAS,EAAE;MAAEC,eAAe,EAAEL,WAAW,CAACM;IAAM,CAAC;EAAE,gBACtEnB,KAAA,CAAAc,aAAA,CAACP,QAAQ;IAACa,KAAK,EAAEP,WAAW,CAACQ;EAAK,CAAE,CAAC,EACpCV,KAAK,iBACJX,KAAA,CAAAc,aAAA,CAACT,UAAU;IAACO,MAAM,EAAET,YAAY,CAACS,MAAM,EAAE,OAAO,CAAE;IAACQ,KAAK,EAAEP,WAAW,CAACQ,IAAK;IAACC,MAAM,EAAC;EAAG,GACnFX,KACS,CAEV,CACY,CAAC;AAEzB,CAAC;AAED,MAAMI,MAAM,GAAGd,UAAU,CAACsB,MAAM,CAAC;EAC/BP,MAAM,EAAE;IACNQ,YAAY,EAAE,CAAC;IACfC,QAAQ,EAAE;EACZ,CAAC;EACDR,SAAS,EAAE;IACTS,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE,CAAC;IACfC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAEF,eAAexB,WAAW","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
import React, { useCallback, useMemo
|
|
2
|
+
import React, { useCallback, useMemo } from 'react';
|
|
3
3
|
import { Image, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { concatTestID } from '../../../utils/testID';
|
|
5
5
|
import { TouchableOpacity } from '../../accessibility/accessibilityHistoryWrappers';
|
|
@@ -29,25 +29,15 @@ const CredentialCard = ({
|
|
|
29
29
|
onCardPress,
|
|
30
30
|
onHeaderPress,
|
|
31
31
|
style,
|
|
32
|
-
testID
|
|
32
|
+
testID,
|
|
33
|
+
width
|
|
33
34
|
}) => {
|
|
34
35
|
var _header$color;
|
|
35
36
|
const colorScheme = useAppColorScheme();
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
width,
|
|
41
|
-
height
|
|
42
|
-
} = event.nativeEvent.layout;
|
|
43
|
-
setCardSize({
|
|
44
|
-
width,
|
|
45
|
-
height
|
|
46
|
-
});
|
|
47
|
-
}, []);
|
|
48
|
-
const onHeaderLayoutChange = useCallback(event => {
|
|
49
|
-
setTappableHeaderHeight(event.nativeEvent.layout.height);
|
|
50
|
-
}, []);
|
|
37
|
+
const cardSize = {
|
|
38
|
+
width,
|
|
39
|
+
height: Math.ceil(width / CredentialCardRatio)
|
|
40
|
+
};
|
|
51
41
|
const headerPressHandler = useCallback(() => {
|
|
52
42
|
onHeaderPress === null || onHeaderPress === void 0 || onHeaderPress(credentialId);
|
|
53
43
|
}, [credentialId, onHeaderPress]);
|
|
@@ -67,11 +57,10 @@ const CredentialCard = ({
|
|
|
67
57
|
}, [notice === null || notice === void 0 ? void 0 : notice.noticeIcon]);
|
|
68
58
|
const shouldShowCarousel = (cardSize === null || cardSize === void 0 ? void 0 : cardSize.width) && cardSize.height;
|
|
69
59
|
return /*#__PURE__*/React.createElement(View, {
|
|
70
|
-
|
|
71
|
-
style: [styles.card, style],
|
|
60
|
+
style: [styles.card, cardSize, style],
|
|
72
61
|
testID: testID
|
|
73
62
|
}, cardImage ? 'imageSource' in cardImage ? /*#__PURE__*/React.createElement(View, {
|
|
74
|
-
style:
|
|
63
|
+
style: cardSize
|
|
75
64
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
76
65
|
testID: concatTestID(testID, 'imageSource'),
|
|
77
66
|
source: cardImage.imageSource,
|
|
@@ -79,27 +68,24 @@ const CredentialCard = ({
|
|
|
79
68
|
})) : /*#__PURE__*/React.createElement(ImageOrComponent, {
|
|
80
69
|
testID: concatTestID(testID, 'cardImage'),
|
|
81
70
|
source: cardImage,
|
|
82
|
-
style:
|
|
71
|
+
style: cardSize
|
|
83
72
|
}) : /*#__PURE__*/React.createElement(View, {
|
|
84
73
|
testID: concatTestID(testID, 'cardBackgroundColor', String(color)),
|
|
85
|
-
style: [
|
|
74
|
+
style: [cardSize, {
|
|
86
75
|
backgroundColor: color
|
|
87
76
|
}]
|
|
88
77
|
}), onCardPress && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
89
78
|
style: styles.cardButton,
|
|
90
79
|
onPress: cardPressHandler
|
|
91
80
|
}), shouldShowCarousel ? /*#__PURE__*/React.createElement(CarouselComponent, {
|
|
92
|
-
style:
|
|
93
|
-
marginTop: tappableHeaderHeight !== null && tappableHeaderHeight !== void 0 ? tappableHeaderHeight : 0
|
|
94
|
-
},
|
|
81
|
+
style: styles.carousel,
|
|
95
82
|
imagesToRender: cardCarouselImages !== null && cardCarouselImages !== void 0 ? cardCarouselImages : [],
|
|
96
83
|
carouselSize: {
|
|
97
84
|
width: cardSize.width,
|
|
98
|
-
height: cardSize.height -
|
|
85
|
+
height: cardSize.height - 60
|
|
99
86
|
},
|
|
100
87
|
testID: concatTestID(testID, 'carousel')
|
|
101
88
|
}) : null, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
102
|
-
onLayout: onHeaderLayoutChange,
|
|
103
89
|
activeOpacity: 0.9,
|
|
104
90
|
disabled: !onHeaderPress,
|
|
105
91
|
onPress: headerPressHandler,
|
|
@@ -132,9 +118,8 @@ const styles = StyleSheet.create({
|
|
|
132
118
|
position: 'absolute',
|
|
133
119
|
width: '100%'
|
|
134
120
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
width: '100%'
|
|
121
|
+
carousel: {
|
|
122
|
+
marginTop: 60
|
|
138
123
|
},
|
|
139
124
|
header: {
|
|
140
125
|
position: 'absolute',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","useState","Image","StyleSheet","View","concatTestID","TouchableOpacity","BlurView","ImageOrComponent","Typography","useAppColorScheme","CredentialHeader","CarouselComponent","CredentialCardShadow","shadowColor","shadowOffset","height","width","shadowOpacity","shadowRadius","CredentialCardRatio","CredentialCard","cardCarouselImages","cardImage","color","credentialId","header","notice","onCardPress","onHeaderPress","style","testID","_header$color","colorScheme","tappableHeaderHeight","setTappableHeaderHeight","cardSize","setCardSize","onCardLayoutChange","event","nativeEvent","layout","onHeaderLayoutChange","headerPressHandler","cardPressHandler","noticeIconView","noticeIcon","undefined","isValidElement","NoticeIconComponent","createElement","shouldShowCarousel","onLayout","styles","card","source","imageSource","image","String","backgroundColor","cardButton","onPress","marginTop","imagesToRender","carouselSize","activeOpacity","disabled","_extends","blurStyle","noticeTextWrapper","text","preset","noticeText","create","borderRadius","overflow","position","aspectRatio","top","bottom","columnGap","flexDirection","justifyContent","paddingBottom","paddingHorizontal","paddingTop","marginVertical","flex"],"sources":["credential-card.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo, useState } from 'react';\nimport { ColorValue, Image, LayoutChangeEvent, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { TouchableOpacity } from '../../accessibility/accessibilityHistoryWrappers';\nimport BlurView from '../../blur/blur-view';\nimport ImageOrComponent, { ImageOrComponentSource } from '../../image/image-or-component';\nimport Typography from '../../text/typography';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialHeader, { CredentialHeaderProps } from './credential-header';\nimport CarouselComponent, { CarouselImage } from './credential-image-carousel';\n\nexport const CredentialCardShadow: Pick<ViewStyle, 'shadowColor' | 'shadowOffset' | 'shadowOpacity' | 'shadowRadius'> =\n {\n shadowColor: '#10274226',\n shadowOffset: {\n height: 5,\n width: 0,\n },\n shadowOpacity: 1,\n shadowRadius: 7,\n };\n\nexport const CredentialCardRatio = 18 / 11;\n\nexport type CredentialCardNotice = {\n text: string;\n noticeIcon?: React.ComponentType<any> | React.ReactElement;\n};\n\nexport type CredentialCardProps = {\n cardCarouselImages?: CarouselImage[];\n cardImage?: ImageOrComponentSource;\n color?: ColorValue;\n credentialId?: string;\n header: CredentialHeaderProps;\n notice?: CredentialCardNotice;\n onCardPress?: (credentialId?: string) => void;\n onHeaderPress?: (credentialId?: string) => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n};\n\nconst CredentialCard: FC<CredentialCardProps> = ({\n cardCarouselImages = [],\n cardImage,\n color = '#5A69F3',\n credentialId,\n header,\n notice,\n onCardPress,\n onHeaderPress,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const [tappableHeaderHeight, setTappableHeaderHeight] = useState<number>();\n const [cardSize, setCardSize] = useState<{ height: number; width: number }>();\n\n const onCardLayoutChange = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setCardSize({ width, height });\n }, []);\n\n const onHeaderLayoutChange = useCallback((event: LayoutChangeEvent) => {\n setTappableHeaderHeight(event.nativeEvent.layout.height);\n }, []);\n\n const headerPressHandler = useCallback(() => {\n onHeaderPress?.(credentialId);\n }, [credentialId, onHeaderPress]);\n\n const cardPressHandler = useCallback(() => {\n onCardPress?.(credentialId);\n }, [credentialId, onCardPress]);\n\n const noticeIconView: React.ReactElement | undefined = useMemo(() => {\n if (!notice?.noticeIcon) {\n return undefined;\n }\n if (React.isValidElement(notice.noticeIcon)) {\n return notice.noticeIcon;\n } else {\n const NoticeIconComponent = notice.noticeIcon as React.ComponentType<any>;\n return <NoticeIconComponent />;\n }\n }, [notice?.noticeIcon]);\n\n const shouldShowCarousel = cardSize?.width && cardSize.height;\n return (\n <View onLayout={onCardLayoutChange} style={[styles.card, style]} testID={testID}>\n {cardImage ? (\n 'imageSource' in cardImage ? (\n <View style={styles.cardImage}>\n <Image testID={concatTestID(testID, 'imageSource')} source={cardImage.imageSource} style={styles.image} />\n </View>\n ) : (\n <ImageOrComponent testID={concatTestID(testID, 'cardImage')} source={cardImage} style={styles.cardImage} />\n )\n ) : (\n <View\n testID={concatTestID(testID, 'cardBackgroundColor', String(color))}\n style={[styles.cardImage, { backgroundColor: color }]}\n />\n )}\n {onCardPress && <TouchableOpacity style={styles.cardButton} onPress={cardPressHandler} />}\n {shouldShowCarousel ? (\n <CarouselComponent\n style={{ marginTop: tappableHeaderHeight ?? 0 }}\n imagesToRender={cardCarouselImages ?? []}\n carouselSize={{\n width: cardSize.width,\n height: cardSize.height - (tappableHeaderHeight ?? 0),\n }}\n testID={concatTestID(testID, 'carousel')}\n />\n ) : null}\n <TouchableOpacity\n onLayout={onHeaderLayoutChange}\n activeOpacity={0.9}\n disabled={!onHeaderPress}\n onPress={headerPressHandler}\n style={styles.header}>\n <CredentialHeader {...header} color={header.color ?? color} testID={concatTestID(testID, 'header')} />\n </TouchableOpacity>\n {notice && (\n <BlurView blurStyle=\"soft\" style={[styles.notice]} testID={concatTestID(testID, 'notice')}>\n {noticeIconView && <View style={styles.noticeIcon}>{noticeIconView}</View>}\n <View style={styles.noticeTextWrapper}>\n <Typography\n color={colorScheme.text}\n preset=\"xs/line-height-small\"\n style={styles.noticeText}\n testID={concatTestID(testID, 'notice.text')}>\n {notice.text}\n </Typography>\n </View>\n </BlurView>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n card: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n cardButton: {\n height: '100%',\n position: 'absolute',\n width: '100%',\n },\n cardImage: {\n aspectRatio: CredentialCardRatio,\n width: '100%',\n },\n header: {\n position: 'absolute',\n top: 0,\n width: '100%',\n },\n image: {\n height: '100%',\n width: '100%',\n },\n notice: {\n bottom: 0,\n columnGap: 6,\n flexDirection: 'row',\n justifyContent: 'flex-start',\n paddingBottom: 6,\n paddingHorizontal: 12,\n paddingTop: 2,\n position: 'absolute',\n width: '100%',\n },\n noticeIcon: {\n marginTop: 4,\n },\n noticeText: {\n marginVertical: 5,\n },\n noticeTextWrapper: {\n flex: 1,\n },\n});\n\nexport default CredentialCard;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACjE,SAAqBC,KAAK,EAAgCC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAE3G,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,gBAAgB,QAAQ,kDAAkD;AACnF,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,gBAAgB,MAAkC,gCAAgC;AACzF,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,OAAOC,gBAAgB,MAAiC,qBAAqB;AAC7E,OAAOC,iBAAiB,MAAyB,6BAA6B;AAE9E,OAAO,MAAMC,oBAAwG,GACnH;EACEC,WAAW,EAAE,WAAW;EACxBC,YAAY,EAAE;IACZC,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE;EACT,CAAC;EACDC,aAAa,EAAE,CAAC;EAChBC,YAAY,EAAE;AAChB,CAAC;AAEH,OAAO,MAAMC,mBAAmB,GAAG,EAAE,GAAG,EAAE;AAoB1C,MAAMC,cAAuC,GAAGA,CAAC;EAC/CC,kBAAkB,GAAG,EAAE;EACvBC,SAAS;EACTC,KAAK,GAAG,SAAS;EACjBC,YAAY;EACZC,MAAM;EACNC,MAAM;EACNC,WAAW;EACXC,aAAa;EACbC,KAAK;EACLC;AACF,CAAC,KAAK;EAAA,IAAAC,aAAA;EACJ,MAAMC,WAAW,GAAGvB,iBAAiB,CAAC,CAAC;EACvC,MAAM,CAACwB,oBAAo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,CAAC;EACDU,UAAU,EAAE;IACVc,cAAc,EAAE;EAClB,CAAC;EACDjB,iBAAiB,EAAE;IACjBkB,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,eAAelE,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","Image","StyleSheet","View","concatTestID","TouchableOpacity","BlurView","ImageOrComponent","Typography","useAppColorScheme","CredentialHeader","CarouselComponent","CredentialCardShadow","shadowColor","shadowOffset","height","width","shadowOpacity","shadowRadius","CredentialCardRatio","CredentialCard","cardCarouselImages","cardImage","color","credentialId","header","notice","onCardPress","onHeaderPress","style","testID","_header$color","colorScheme","cardSize","Math","ceil","headerPressHandler","cardPressHandler","noticeIconView","noticeIcon","undefined","isValidElement","NoticeIconComponent","createElement","shouldShowCarousel","styles","card","source","imageSource","image","String","backgroundColor","cardButton","onPress","carousel","imagesToRender","carouselSize","activeOpacity","disabled","_extends","blurStyle","noticeTextWrapper","text","preset","noticeText","create","borderRadius","overflow","position","marginTop","top","bottom","columnGap","flexDirection","justifyContent","paddingBottom","paddingHorizontal","paddingTop","marginVertical","flex"],"sources":["credential-card.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo } from 'react';\nimport { ColorValue, Image, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { TouchableOpacity } from '../../accessibility/accessibilityHistoryWrappers';\nimport BlurView from '../../blur/blur-view';\nimport ImageOrComponent, { ImageOrComponentSource } from '../../image/image-or-component';\nimport Typography from '../../text/typography';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialHeader, { CredentialHeaderProps } from './credential-header';\nimport CarouselComponent, { CarouselImage } from './credential-image-carousel';\n\nexport const CredentialCardShadow: Pick<ViewStyle, 'shadowColor' | 'shadowOffset' | 'shadowOpacity' | 'shadowRadius'> =\n {\n shadowColor: '#10274226',\n shadowOffset: {\n height: 5,\n width: 0,\n },\n shadowOpacity: 1,\n shadowRadius: 7,\n };\n\nexport const CredentialCardRatio = 18 / 11;\n\nexport type CredentialCardNotice = {\n text: string;\n noticeIcon?: React.ComponentType<any> | React.ReactElement;\n};\n\nexport type CredentialCardProps = {\n cardCarouselImages?: CarouselImage[];\n cardImage?: ImageOrComponentSource;\n color?: ColorValue;\n credentialId?: string;\n header: CredentialHeaderProps;\n notice?: CredentialCardNotice;\n onCardPress?: (credentialId?: string) => void;\n onHeaderPress?: (credentialId?: string) => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n width: number;\n};\n\nconst CredentialCard: FC<CredentialCardProps> = ({\n cardCarouselImages = [],\n cardImage,\n color = '#5A69F3',\n credentialId,\n header,\n notice,\n onCardPress,\n onHeaderPress,\n style,\n testID,\n width,\n}) => {\n const colorScheme = useAppColorScheme();\n const cardSize = {\n width,\n height: Math.ceil(width / CredentialCardRatio),\n };\n\n const headerPressHandler = useCallback(() => {\n onHeaderPress?.(credentialId);\n }, [credentialId, onHeaderPress]);\n\n const cardPressHandler = useCallback(() => {\n onCardPress?.(credentialId);\n }, [credentialId, onCardPress]);\n\n const noticeIconView: React.ReactElement | undefined = useMemo(() => {\n if (!notice?.noticeIcon) {\n return undefined;\n }\n if (React.isValidElement(notice.noticeIcon)) {\n return notice.noticeIcon;\n } else {\n const NoticeIconComponent = notice.noticeIcon as React.ComponentType<any>;\n return <NoticeIconComponent />;\n }\n }, [notice?.noticeIcon]);\n\n const shouldShowCarousel = cardSize?.width && cardSize.height;\n return (\n <View style={[styles.card, cardSize, style]} testID={testID}>\n {cardImage ? (\n 'imageSource' in cardImage ? (\n <View style={cardSize}>\n <Image testID={concatTestID(testID, 'imageSource')} source={cardImage.imageSource} style={styles.image} />\n </View>\n ) : (\n <ImageOrComponent testID={concatTestID(testID, 'cardImage')} source={cardImage} style={cardSize} />\n )\n ) : (\n <View\n testID={concatTestID(testID, 'cardBackgroundColor', String(color))}\n style={[cardSize, { backgroundColor: color }]}\n />\n )}\n {onCardPress && <TouchableOpacity style={styles.cardButton} onPress={cardPressHandler} />}\n {shouldShowCarousel ? (\n <CarouselComponent\n style={styles.carousel}\n imagesToRender={cardCarouselImages ?? []}\n carouselSize={{\n width: cardSize.width,\n height: cardSize.height - 60,\n }}\n testID={concatTestID(testID, 'carousel')}\n />\n ) : null}\n <TouchableOpacity\n activeOpacity={0.9}\n disabled={!onHeaderPress}\n onPress={headerPressHandler}\n style={styles.header}>\n <CredentialHeader {...header} color={header.color ?? color} testID={concatTestID(testID, 'header')} />\n </TouchableOpacity>\n {notice && (\n <BlurView blurStyle=\"soft\" style={[styles.notice]} testID={concatTestID(testID, 'notice')}>\n {noticeIconView && <View style={styles.noticeIcon}>{noticeIconView}</View>}\n <View style={styles.noticeTextWrapper}>\n <Typography\n color={colorScheme.text}\n preset=\"xs/line-height-small\"\n style={styles.noticeText}\n testID={concatTestID(testID, 'notice.text')}>\n {notice.text}\n </Typography>\n </View>\n </BlurView>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n card: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n cardButton: {\n height: '100%',\n position: 'absolute',\n width: '100%',\n },\n carousel: {\n marginTop: 60,\n },\n header: {\n position: 'absolute',\n top: 0,\n width: '100%',\n },\n image: {\n height: '100%',\n width: '100%',\n },\n notice: {\n bottom: 0,\n columnGap: 6,\n flexDirection: 'row',\n justifyContent: 'flex-start',\n paddingBottom: 6,\n paddingHorizontal: 12,\n paddingTop: 2,\n position: 'absolute',\n width: '100%',\n },\n noticeIcon: {\n marginTop: 4,\n },\n noticeText: {\n marginVertical: 5,\n },\n noticeTextWrapper: {\n flex: 1,\n },\n});\n\nexport default CredentialCard;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACvD,SAAqBC,KAAK,EAAaC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAExF,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,gBAAgB,QAAQ,kDAAkD;AACnF,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