@procivis/one-react-native-components 0.3.115 → 0.3.130
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 +2 -1
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item-icon.js +3 -3
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item.js +2 -8
- package/lib/commonjs/components/history/history-list-item.js.map +1 -1
- package/lib/commonjs/components/history/history-list-screen.js +1 -1
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -11
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/select-credential.js +2 -1
- package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js +2 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js +2 -1
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +3 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +4 -2
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/commonjs/components/trust-info/index.js +29 -0
- package/lib/commonjs/components/trust-info/index.js.map +1 -0
- package/lib/commonjs/components/trust-info/trust-info.js +79 -0
- package/lib/commonjs/components/trust-info/trust-info.js.map +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +3 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
- package/lib/commonjs/ui-components/header/header.js +2 -0
- package/lib/commonjs/ui-components/header/header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-details.js +2 -2
- package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
- package/lib/commonjs/ui-components/icons/contact.js +45 -0
- package/lib/commonjs/ui-components/icons/contact.js.map +1 -0
- package/lib/commonjs/ui-components/icons/credential.js +3 -3
- package/lib/commonjs/ui-components/icons/credential.js.map +1 -1
- package/lib/commonjs/ui-components/icons/icons.js +20 -1
- package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
- package/lib/commonjs/ui-components/icons/index.js +11 -0
- package/lib/commonjs/ui-components/icons/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/loading-result.js +2 -0
- package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
- package/lib/commonjs/ui-components/screens/index.js +7 -0
- package/lib/commonjs/ui-components/screens/index.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +28 -24
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/trust-info-details-screen.js +384 -0
- package/lib/commonjs/ui-components/screens/trust-info-details-screen.js.map +1 -0
- package/lib/commonjs/utils/date.js +4 -5
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/cache.js +8 -4
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-config.js +1 -6
- package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-context.js +0 -15
- package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +40 -1
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/index.js +0 -11
- package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +12 -1
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-list.js +19 -3
- package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/verifier-instance.js +22 -3
- package/lib/commonjs/utils/hooks/core/verifier-instance.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +2 -2
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +14 -14
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +20 -18
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +36 -22
- 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/translations.js +15 -0
- package/lib/commonjs/utils/translations.js.map +1 -0
- package/lib/module/components/credential/credential.js +2 -1
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +3 -3
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/history/history-list-item.js +3 -9
- package/lib/module/components/history/history-list-item.js.map +1 -1
- package/lib/module/components/history/history-list-screen.js +1 -1
- package/lib/module/components/history/history-list-screen.js.map +1 -1
- package/lib/module/components/index.js +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/proof-request/v1/select-credential.js +2 -1
- package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/v1/share-credential.js +2 -1
- package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/module/components/proof-request/v2/select-credential-v2.js +2 -1
- package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js +3 -1
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2.js +4 -2
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/module/components/trust-info/index.js +4 -0
- package/lib/module/components/trust-info/index.js.map +1 -0
- package/lib/module/components/trust-info/trust-info.js +70 -0
- package/lib/module/components/trust-info/trust-info.js.map +1 -0
- package/lib/module/ui-components/credential/card/credential-details-card.js +3 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/header/foldable-header.js.map +1 -1
- package/lib/module/ui-components/header/header.js +2 -0
- package/lib/module/ui-components/header/header.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +3 -3
- package/lib/module/ui-components/history/history-details.js.map +1 -1
- package/lib/module/ui-components/icons/contact.js +34 -0
- package/lib/module/ui-components/icons/contact.js.map +1 -0
- package/lib/module/ui-components/icons/credential.js +1 -1
- package/lib/module/ui-components/icons/credential.js.map +1 -1
- package/lib/module/ui-components/icons/icons.js +18 -0
- package/lib/module/ui-components/icons/icons.js.map +1 -1
- package/lib/module/ui-components/icons/index.js +1 -0
- package/lib/module/ui-components/icons/index.js.map +1 -1
- package/lib/module/ui-components/loader/loading-result.js +2 -0
- package/lib/module/ui-components/loader/loading-result.js.map +1 -1
- package/lib/module/ui-components/screens/index.js +2 -0
- package/lib/module/ui-components/screens/index.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js +29 -25
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/screens/trust-info-details-screen.js +375 -0
- package/lib/module/ui-components/screens/trust-info-details-screen.js.map +1 -0
- package/lib/module/utils/date.js +4 -5
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/hooks/core/cache.js +8 -4
- package/lib/module/utils/hooks/core/cache.js.map +1 -1
- package/lib/module/utils/hooks/core/core-config.js +0 -4
- package/lib/module/utils/hooks/core/core-config.js.map +1 -1
- package/lib/module/utils/hooks/core/core-context.js +0 -15
- package/lib/module/utils/hooks/core/core-context.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +37 -1
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/index.js +0 -1
- package/lib/module/utils/hooks/core/index.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +10 -0
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-list.js +20 -4
- package/lib/module/utils/hooks/core/trust-list.js.map +1 -1
- package/lib/module/utils/hooks/core/verifier-instance.js +20 -2
- package/lib/module/utils/hooks/core/verifier-instance.js.map +1 -1
- package/lib/module/utils/hooks/core/wallet-unit.js +2 -2
- package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +15 -15
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +20 -18
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +37 -23
- 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/translations.js +8 -0
- package/lib/module/utils/translations.js.map +1 -0
- package/lib/typescript/components/credential/credential.d.ts +1 -0
- package/lib/typescript/components/history/history-list-item.d.ts +1 -1
- package/lib/typescript/components/index.d.ts +1 -1
- package/lib/typescript/components/proof-request/v1/select-credential.d.ts +1 -0
- package/lib/typescript/components/proof-request/v1/share-credential.d.ts +1 -0
- package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +1 -0
- package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +1 -0
- package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +1 -0
- package/lib/typescript/components/trust-info/index.d.ts +3 -0
- package/lib/typescript/components/trust-info/trust-info.d.ts +19 -0
- package/lib/typescript/ui-components/header/header.d.ts +2 -0
- package/lib/typescript/ui-components/history/history-details.d.ts +2 -2
- package/lib/typescript/ui-components/icons/contact.d.ts +4 -0
- package/lib/typescript/ui-components/icons/credential.d.ts +1 -1
- package/lib/typescript/ui-components/icons/icons.d.ts +1 -0
- package/lib/typescript/ui-components/icons/index.d.ts +1 -0
- package/lib/typescript/ui-components/screens/index.d.ts +3 -0
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +5 -12
- package/lib/typescript/ui-components/screens/trust-info-details-screen.d.ts +32 -0
- package/lib/typescript/utils/hooks/core/core-config.d.ts +0 -1
- package/lib/typescript/utils/hooks/core/core-context.d.ts +0 -1
- package/lib/typescript/utils/hooks/core/credentials.d.ts +5 -1
- package/lib/typescript/utils/hooks/core/index.d.ts +0 -1
- package/lib/typescript/utils/hooks/core/proofs.d.ts +2 -0
- package/lib/typescript/utils/hooks/core/trust-list.d.ts +1 -4
- package/lib/typescript/utils/hooks/core/verifier-instance.d.ts +2 -0
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +2 -2
- package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +3 -3
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +6 -6
- package/lib/typescript/utils/parsers/credential.d.ts +5 -5
- package/lib/typescript/utils/parsers/query.d.ts +1 -1
- package/lib/typescript/utils/translations.d.ts +1 -0
- package/package.json +8 -8
- package/src/components/credential/credential.tsx +3 -0
- package/src/components/history/history-list-item-icon.tsx +2 -2
- package/src/components/history/history-list-item.tsx +4 -9
- package/src/components/history/history-list-screen.tsx +1 -1
- package/src/components/index.ts +1 -1
- package/src/components/proof-request/v1/select-credential.tsx +3 -1
- package/src/components/proof-request/v1/share-credential.tsx +3 -0
- package/src/components/proof-request/v2/select-credential-v2.tsx +3 -1
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +4 -0
- package/src/components/proof-request/v2/share-credential-v2.tsx +5 -0
- package/src/components/trust-info/index.ts +4 -0
- package/src/components/trust-info/trust-info.tsx +90 -0
- package/src/ui-components/credential/card/credential-details-card.tsx +3 -2
- package/src/ui-components/header/foldable-header.tsx +10 -9
- package/src/ui-components/header/header.tsx +18 -3
- package/src/ui-components/history/history-details.tsx +4 -4
- package/src/ui-components/icons/contact.tsx +26 -0
- package/src/ui-components/icons/credential.tsx +1 -1
- package/src/ui-components/icons/icons.tsx +18 -0
- package/src/ui-components/icons/index.ts +1 -0
- package/src/ui-components/loader/loading-result.tsx +7 -1
- package/src/ui-components/screens/index.ts +3 -0
- package/src/ui-components/screens/nerd-mode-screen.tsx +49 -41
- package/src/ui-components/screens/trust-info-details-screen.tsx +472 -0
- package/src/utils/date.ts +7 -14
- package/src/utils/hooks/core/cache.ts +12 -4
- package/src/utils/hooks/core/core-config.ts +1 -6
- package/src/utils/hooks/core/core-context.tsx +0 -24
- package/src/utils/hooks/core/credentials.ts +43 -1
- package/src/utils/hooks/core/index.ts +0 -1
- package/src/utils/hooks/core/proofs.ts +14 -0
- package/src/utils/hooks/core/trust-list.ts +22 -11
- package/src/utils/hooks/core/verifier-instance.ts +23 -2
- package/src/utils/hooks/core/wallet-unit.ts +3 -3
- package/src/utils/parsers/credential-sharing-v2.tsx +29 -12
- package/src/utils/parsers/credential-sharing.tsx +33 -16
- package/src/utils/parsers/credential.ts +45 -14
- package/src/utils/parsers/query.ts +3 -0
- package/src/utils/translations.ts +10 -0
- package/lib/commonjs/components/entity/EntityButtons.js +0 -64
- package/lib/commonjs/components/entity/EntityButtons.js.map +0 -1
- package/lib/commonjs/components/entity/entity-attributes.js +0 -65
- package/lib/commonjs/components/entity/entity-attributes.js.map +0 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +0 -67
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +0 -1
- package/lib/commonjs/components/entity/entity-details.js +0 -101
- package/lib/commonjs/components/entity/entity-details.js.map +0 -1
- package/lib/commonjs/components/entity/index.js +0 -14
- package/lib/commonjs/components/entity/index.js.map +0 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +0 -147
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +0 -1
- package/lib/module/components/entity/EntityButtons.js +0 -56
- package/lib/module/components/entity/EntityButtons.js.map +0 -1
- package/lib/module/components/entity/entity-attributes.js +0 -57
- package/lib/module/components/entity/entity-attributes.js.map +0 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +0 -58
- package/lib/module/components/entity/entity-details-with-buttons.js.map +0 -1
- package/lib/module/components/entity/entity-details.js +0 -92
- package/lib/module/components/entity/entity-details.js.map +0 -1
- package/lib/module/components/entity/index.js +0 -3
- package/lib/module/components/entity/index.js.map +0 -1
- package/lib/module/utils/hooks/core/trust-entity.js +0 -136
- package/lib/module/utils/hooks/core/trust-entity.js.map +0 -1
- package/lib/typescript/components/entity/EntityButtons.d.ts +0 -14
- package/lib/typescript/components/entity/entity-attributes.d.ts +0 -15
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +0 -18
- package/lib/typescript/components/entity/entity-details.d.ts +0 -21
- package/lib/typescript/components/entity/index.d.ts +0 -3
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +0 -17
- package/src/components/entity/EntityButtons.tsx +0 -79
- package/src/components/entity/entity-attributes.tsx +0 -80
- package/src/components/entity/entity-details-with-buttons.tsx +0 -75
- package/src/components/entity/entity-details.tsx +0 -145
- package/src/components/entity/index.ts +0 -4
- package/src/utils/hooks/core/trust-entity.ts +0 -172
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","Dimensions","StyleSheet","CredentialDetailsCardListItem","useAppColorScheme","concatTestID","getValidityState","useCoreConfig","ValidityState","shareCredentialCardFromV2PresentationCredential","SelectShareCredentialCardNotice","ShareCredentialCardNotice","GroupedShareCredentialV2Padding","ShareCredentialV2","credentialQuery","credentialRequestId","expanded","grouped","headerAccessory","labels","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","selectedCredentialId","selectedFields","style","testID","_applicableCredential","_credential$issuer","colorScheme","applicableCredentials","type_","undefined","failureHint","credential","find","c","id","data","config","cardWidth","get","width","multipleCredentialsAvailable","Boolean","length","validityState","issuer","footer","Revoked","createElement","text","revokedCredentialNotice","Suspended","suspendedCredentialNotice","reason","invalidCredentialNotice","buttonTitle","multipleCredentialsSelect","onPress","multipleCredentialsNotice","onAttributeSelected","fieldPath","selected","card","header","attributes","accessory","credentialId","styles","groupedCredential","bordered","borderColor","background","create","borderWidth","borderRadius","marginBottom","marginHorizontal"],"sources":["share-credential-v2.tsx"],"sourcesContent":["import {\n ApplicableCredentialOrFailureHint,\n CredentialListItem,\n PresentationDefinitionV2Claim,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useCallback, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';\nimport { concatTestID, getValidityState, useCoreConfig, ValidityState } from '../../../utils';\nimport { shareCredentialCardFromV2PresentationCredential } from '../../../utils/parsers/credential-sharing-v2';\nimport { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';\nimport { ShareCredentialCardNotice } from '../share-credential-card-notice';\nimport { ShareCredentialLabels } from '../v1';\n\nexport type ShareCredentialV2Props = {\n credentialQuery: ApplicableCredentialOrFailureHint;\n credentialRequestId: string;\n expanded?: boolean;\n grouped?: boolean;\n headerAccessory?: React.ComponentType<any> | React.ReactElement;\n labels: ShareCredentialLabels;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (\n credentialId: CredentialListItem['id'],\n fieldPath: PresentationDefinitionV2Claim['path'],\n selected: boolean,\n ) => void;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionV2Claim['path']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n};\n\nexport const GroupedShareCredentialV2Padding = 4;\n\nexport const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({\n credentialQuery,\n credentialRequestId,\n expanded,\n grouped,\n headerAccessory,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const applicableCredentials =\n credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.applicableCredentials : undefined;\n const failureHint = credentialQuery.type_ === 'FAILURE_HINT' ? credentialQuery.failureHint : undefined;\n const credential = applicableCredentials?.find((c) => c.id === selectedCredentialId) ?? applicableCredentials?.[0];\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(\n () => Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0),\n [grouped],\n );\n\n const multipleCredentialsAvailable = Boolean(applicableCredentials?.length && applicableCredentials.length > 1);\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.revoked')}\n text={labels.revokedCredentialNotice}\n />\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.suspended')}\n text={labels.suspendedCredentialNotice}\n />\n );\n }\n\n if (failureHint?.reason === 'VALIDITY') {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.invalid')}\n text={labels.invalidCredentialNotice}\n />\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <SelectShareCredentialCardNotice\n buttonTitle={labels.multipleCredentialsSelect}\n onPress={onSelectCredential}\n testID={concatTestID(testID, 'notice.multiple')}\n text={labels.multipleCredentialsNotice}\n />\n );\n }\n }, [\n expanded,\n failureHint?.reason,\n labels.invalidCredentialNotice,\n labels.multipleCredentialsNotice,\n labels.multipleCredentialsSelect,\n labels.revokedCredentialNotice,\n labels.suspendedCredentialNotice,\n multipleCredentialsAvailable,\n onSelectCredential,\n testID,\n validityState,\n ]);\n\n const onAttributeSelected = useCallback(\n (fieldPath: PresentationDefinitionV2Claim['path'], selected: boolean) => {\n if (!selectedCredentialId) {\n return;\n }\n onSelectField(selectedCredentialId, fieldPath, selected);\n },\n [onSelectField, selectedCredentialId],\n );\n\n if (!config) {\n return null;\n }\n\n const {\n card: { header, ...card },\n attributes,\n } = shareCredentialCardFromV2PresentationCredential(\n credential,\n failureHint,\n Boolean(expanded),\n multipleCredentialsAvailable,\n selectedFields,\n config,\n testID,\n labels,\n );\n\n if (headerAccessory) {\n header.accessory = headerAccessory;\n }\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId: credentialRequestId,\n header,\n onHeaderPress,\n width: cardWidth,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onAttributeSelected}\n onImagePreview={onImagePreview}\n style={[\n styles.credential,\n grouped ? styles.groupedCredential : styles.bordered,\n { borderColor: colorScheme.background },\n style,\n ]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n bordered: {\n borderWidth: 1,\n },\n credential: {\n borderRadius: 10,\n borderWidth: 0,\n marginBottom: 8,\n },\n groupedCredential: {\n marginHorizontal: GroupedShareCredentialV2Padding,\n },\n});\n"],"mappings":"AAKA,OAAOA,KAAK,IAAuBC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACtE,SAASC,UAAU,EAAkCC,UAAU,QAAmB,cAAc;AAEhG,SAASC,6BAA6B,EAAEC,iBAAiB,QAAQ,wBAAwB;AACzF,SAASC,YAAY,EAAEC,gBAAgB,EAAEC,aAAa,EAAEC,aAAa,QAAQ,gBAAgB;AAC7F,SAASC,+CAA+C,QAAQ,8CAA8C;AAC9G,SAASC,+BAA+B,QAAQ,wCAAwC;AACxF,SAASC,yBAAyB,QAAQ,iCAAiC;AAyB3E,OAAO,MAAMC,+BAA+B,GAAG,CAAC;AAEhD,OAAO,MAAMC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QAAS;IACnB2C,mBAAmB,EAAEA,mBAAoB;IACzCzC,cAAc,EAAEA,cAAe;IAC/BK,KAAK,EAAE,CACL4C,MAAM,CAACnC,UAAU,EACjBnB,OAAO,GAAGsD,MAAM,CAACC,iBAAiB,GAAGD,MAAM,CAACE,QAAQ,EACpD;MAAEC,WAAW,EAAE3C,WAAW,CAAC4C;IAAW,CAAC,EACvChD,KAAK,CACL;IACFC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAED,MAAM2C,MAAM,GAAGrE,UAAU,CAAC0E,MAAM,CAAC;EAC/BH,QAAQ,EAAE;IACRI,WAAW,EAAE;EACf,CAAC;EACDzC,UAAU,EAAE;IACV0C,YAAY,EAAE,EAAE;IAChBD,WAAW,EAAE,CAAC;IACdE,YAAY,EAAE;EAChB,CAAC;EACDP,iBAAiB,EAAE;IACjBQ,gBAAgB,EAAEpE;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","Dimensions","StyleSheet","CredentialDetailsCardListItem","useAppColorScheme","concatTestID","getValidityState","useCoreConfig","ValidityState","shareCredentialCardFromV2PresentationCredential","SelectShareCredentialCardNotice","ShareCredentialCardNotice","GroupedShareCredentialV2Padding","ShareCredentialV2","credentialQuery","credentialRequestId","expanded","grouped","headerAccessory","labels","language","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","selectedCredentialId","selectedFields","style","testID","_applicableCredential","_credentialQuery$purp","_credential$issuer","colorScheme","applicableCredentials","type_","undefined","failureHint","credential","find","c","id","data","config","cardWidth","get","width","purpose","multipleCredentialsAvailable","Boolean","length","validityState","issuer","footer","Revoked","createElement","text","revokedCredentialNotice","Suspended","suspendedCredentialNotice","reason","invalidCredentialNotice","buttonTitle","multipleCredentialsSelect","onPress","multipleCredentialsNotice","onAttributeSelected","fieldPath","selected","card","header","attributes","accessory","credentialId","styles","groupedCredential","bordered","borderColor","background","create","borderWidth","borderRadius","marginBottom","marginHorizontal"],"sources":["share-credential-v2.tsx"],"sourcesContent":["import {\n ApplicableCredentialOrFailureHint,\n CredentialListItem,\n PresentationDefinitionV2Claim,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useCallback, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';\nimport { concatTestID, getValidityState, useCoreConfig, ValidityState } from '../../../utils';\nimport { shareCredentialCardFromV2PresentationCredential } from '../../../utils/parsers/credential-sharing-v2';\nimport { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';\nimport { ShareCredentialCardNotice } from '../share-credential-card-notice';\nimport { ShareCredentialLabels } from '../v1';\n\nexport type ShareCredentialV2Props = {\n credentialQuery: ApplicableCredentialOrFailureHint;\n credentialRequestId: string;\n expanded?: boolean;\n grouped?: boolean;\n headerAccessory?: React.ComponentType<any> | React.ReactElement;\n labels: ShareCredentialLabels;\n language: string;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (\n credentialId: CredentialListItem['id'],\n fieldPath: PresentationDefinitionV2Claim['path'],\n selected: boolean,\n ) => void;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionV2Claim['path']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n};\n\nexport const GroupedShareCredentialV2Padding = 4;\n\nexport const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({\n credentialQuery,\n credentialRequestId,\n expanded,\n grouped,\n headerAccessory,\n labels,\n language,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const applicableCredentials =\n credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.applicableCredentials : undefined;\n const failureHint = credentialQuery.type_ === 'FAILURE_HINT' ? credentialQuery.failureHint : undefined;\n const credential = applicableCredentials?.find((c) => c.id === selectedCredentialId) ?? applicableCredentials?.[0];\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(\n () => Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0),\n [grouped],\n );\n const purpose = credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.purpose?.[language] : undefined;\n\n const multipleCredentialsAvailable = Boolean(applicableCredentials?.length && applicableCredentials.length > 1);\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.revoked')}\n text={labels.revokedCredentialNotice}\n />\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.suspended')}\n text={labels.suspendedCredentialNotice}\n />\n );\n }\n\n if (failureHint?.reason === 'VALIDITY') {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.invalid')}\n text={labels.invalidCredentialNotice}\n />\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <SelectShareCredentialCardNotice\n buttonTitle={labels.multipleCredentialsSelect}\n onPress={onSelectCredential}\n testID={concatTestID(testID, 'notice.multiple')}\n text={labels.multipleCredentialsNotice}\n />\n );\n }\n }, [\n expanded,\n failureHint?.reason,\n labels.invalidCredentialNotice,\n labels.multipleCredentialsNotice,\n labels.multipleCredentialsSelect,\n labels.revokedCredentialNotice,\n labels.suspendedCredentialNotice,\n multipleCredentialsAvailable,\n onSelectCredential,\n testID,\n validityState,\n ]);\n\n const onAttributeSelected = useCallback(\n (fieldPath: PresentationDefinitionV2Claim['path'], selected: boolean) => {\n if (!selectedCredentialId) {\n return;\n }\n onSelectField(selectedCredentialId, fieldPath, selected);\n },\n [onSelectField, selectedCredentialId],\n );\n\n if (!config) {\n return null;\n }\n\n const {\n card: { header, ...card },\n attributes,\n } = shareCredentialCardFromV2PresentationCredential(\n credential,\n failureHint,\n Boolean(expanded),\n multipleCredentialsAvailable,\n purpose,\n selectedFields,\n config,\n testID,\n labels,\n language,\n );\n\n if (headerAccessory) {\n header.accessory = headerAccessory;\n }\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId: credentialRequestId,\n header,\n onHeaderPress,\n width: cardWidth,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onAttributeSelected}\n onImagePreview={onImagePreview}\n style={[\n styles.credential,\n grouped ? styles.groupedCredential : styles.bordered,\n { borderColor: colorScheme.background },\n style,\n ]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n bordered: {\n borderWidth: 1,\n },\n credential: {\n borderRadius: 10,\n borderWidth: 0,\n marginBottom: 8,\n },\n groupedCredential: {\n marginHorizontal: GroupedShareCredentialV2Padding,\n },\n});\n"],"mappings":"AAKA,OAAOA,KAAK,IAAuBC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACtE,SAASC,UAAU,EAAkCC,UAAU,QAAmB,cAAc;AAEhG,SAASC,6BAA6B,EAAEC,iBAAiB,QAAQ,wBAAwB;AACzF,SAASC,YAAY,EAAEC,gBAAgB,EAAEC,aAAa,EAAEC,aAAa,QAAQ,gBAAgB;AAC7F,SAASC,+CAA+C,QAAQ,8CAA8C;AAC9G,SAASC,+BAA+B,QAAQ,wCAAwC;AACxF,SAASC,yBAAyB,QAAQ,iCAAiC;AA0B3E,OAAO,MAAMC,+BAA+B,GAAG,CAAC;AAEhD,OAAO,MAAMC,iBAA4D,GAAGA,CAAC;EAC3EC,eAAe;EACfC,mBAAmB;EACnBC,QAAQ;EACRC,OAAO;EACPC,eAAe;EACfC,MAAM;EACNC,QAAQ;EACRC,QA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Aa;MACbwB,KAAK,EAAEF;IACT,CAAE;IACF5B,QAAQ,EAAEA,QAAS;IACnBqC,MAAM,EAAEA,MAAO;IACfhC,QAAQ,EAAEA,QAAS;IACnB6C,mBAAmB,EAAEA,mBAAoB;IACzC3C,cAAc,EAAEA,cAAe;IAC/BK,KAAK,EAAE,CACL8C,MAAM,CAACpC,UAAU,EACjBrB,OAAO,GAAGyD,MAAM,CAACC,iBAAiB,GAAGD,MAAM,CAACE,QAAQ,EACpD;MAAEC,WAAW,EAAE5C,WAAW,CAAC6C;IAAW,CAAC,EACvClD,KAAK,CACL;IACFC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAED,MAAM6C,MAAM,GAAGxE,UAAU,CAAC6E,MAAM,CAAC;EAC/BH,QAAQ,EAAE;IACRI,WAAW,EAAE;EACf,CAAC;EACD1C,UAAU,EAAE;IACV2C,YAAY,EAAE,EAAE;IAChBD,WAAW,EAAE,CAAC;IACdE,YAAY,EAAE;EAChB,CAAC;EACDP,iBAAiB,EAAE;IACjBQ,gBAAgB,EAAEvE;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TrustInfo"],"sources":["index.ts"],"sourcesContent":["import TrustInfo from './trust-info';\n\nexport * from './trust-info';\nexport { TrustInfo };\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,cAAc;AAEpC,cAAc,cAAc;AAC5B,SAASA,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
import { TouchableOpacity } from '../../ui-components';
|
|
4
|
+
import EntityCluster from '../../ui-components/entity/entity-cluster';
|
|
5
|
+
import { EntityNotTrustedIcon, EntityTrustedIcon, UpIcon } from '../../ui-components/icons';
|
|
6
|
+
import { concatTestID } from '../../utils';
|
|
7
|
+
const TrustInfo = ({
|
|
8
|
+
labels,
|
|
9
|
+
onPress,
|
|
10
|
+
style,
|
|
11
|
+
sublineColor,
|
|
12
|
+
testID,
|
|
13
|
+
textColor,
|
|
14
|
+
trustInformation
|
|
15
|
+
}) => {
|
|
16
|
+
const avatarProps = useMemo(() => {
|
|
17
|
+
var _trustInformation$nam;
|
|
18
|
+
const placeholderText = (_trustInformation$nam = trustInformation === null || trustInformation === void 0 ? void 0 : trustInformation.name.substring(0, 1)) !== null && _trustInformation$nam !== void 0 ? _trustInformation$nam : labels.unknown.substring(0, 1);
|
|
19
|
+
const statusIcon = trustInformation ? /*#__PURE__*/React.createElement(EntityTrustedIcon, {
|
|
20
|
+
testID: concatTestID(testID, 'statusIcon', 'trusted')
|
|
21
|
+
}) : /*#__PURE__*/React.createElement(EntityNotTrustedIcon, {
|
|
22
|
+
testID: concatTestID(testID, 'statusIcon', 'notTrusted')
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
placeholderText,
|
|
26
|
+
statusIcon
|
|
27
|
+
};
|
|
28
|
+
}, [labels, testID, trustInformation]);
|
|
29
|
+
const trustEntityName = useMemo(() => {
|
|
30
|
+
var _trustInformation$nam2;
|
|
31
|
+
return (_trustInformation$nam2 = trustInformation === null || trustInformation === void 0 ? void 0 : trustInformation.name) !== null && _trustInformation$nam2 !== void 0 ? _trustInformation$nam2 : labels.unknown;
|
|
32
|
+
}, [labels.unknown, trustInformation]);
|
|
33
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
34
|
+
disabled: !onPress || !trustInformation,
|
|
35
|
+
onPress: onPress,
|
|
36
|
+
style: [styles.button, style]
|
|
37
|
+
}, /*#__PURE__*/React.createElement(EntityCluster, {
|
|
38
|
+
avatar: avatarProps,
|
|
39
|
+
entityName: trustEntityName,
|
|
40
|
+
style: styles.cluster,
|
|
41
|
+
subline: trustInformation ? undefined : labels.unknownSubline,
|
|
42
|
+
sublineColor: sublineColor,
|
|
43
|
+
testID: testID,
|
|
44
|
+
textColor: textColor
|
|
45
|
+
}), onPress && trustInformation && /*#__PURE__*/React.createElement(UpIcon, {
|
|
46
|
+
color: textColor,
|
|
47
|
+
style: styles.chevron
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
50
|
+
const styles = StyleSheet.create({
|
|
51
|
+
button: {
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
flexWrap: 'nowrap',
|
|
55
|
+
width: '100%'
|
|
56
|
+
},
|
|
57
|
+
chevron: {
|
|
58
|
+
marginLeft: 10,
|
|
59
|
+
marginRight: 18,
|
|
60
|
+
transform: [{
|
|
61
|
+
rotate: '90deg'
|
|
62
|
+
}]
|
|
63
|
+
},
|
|
64
|
+
cluster: {
|
|
65
|
+
flex: 1,
|
|
66
|
+
flexShrink: 1
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export default TrustInfo;
|
|
70
|
+
//# sourceMappingURL=trust-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useMemo","StyleSheet","TouchableOpacity","EntityCluster","EntityNotTrustedIcon","EntityTrustedIcon","UpIcon","concatTestID","TrustInfo","labels","onPress","style","sublineColor","testID","textColor","trustInformation","avatarProps","_trustInformation$nam","placeholderText","name","substring","unknown","statusIcon","createElement","trustEntityName","_trustInformation$nam2","disabled","styles","button","avatar","entityName","cluster","subline","undefined","unknownSubline","color","chevron","create","alignItems","flexDirection","flexWrap","width","marginLeft","marginRight","transform","rotate","flex","flexShrink"],"sources":["trust-info.tsx"],"sourcesContent":["import React, { FC, useMemo } from 'react';\nimport { StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { AvatarProps, TouchableOpacity } from '../../ui-components';\nimport EntityCluster from '../../ui-components/entity/entity-cluster';\nimport { EntityNotTrustedIcon, EntityTrustedIcon, UpIcon } from '../../ui-components/icons';\nimport { concatTestID } from '../../utils';\n\nexport type TrustInfoLabels = {\n unknown: string;\n unknownSubline: string;\n};\n\nexport type TrustInfoProps = {\n labels: TrustInfoLabels;\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n sublineColor?: string;\n testID?: string;\n textColor?: string;\n trustInformation?: {\n name: string;\n };\n};\n\nconst TrustInfo: FC<TrustInfoProps> = ({\n labels,\n onPress,\n style,\n sublineColor,\n testID,\n textColor,\n trustInformation,\n}) => {\n const avatarProps: AvatarProps | undefined = useMemo(() => {\n const placeholderText = trustInformation?.name.substring(0, 1) ?? labels.unknown.substring(0, 1);\n\n const statusIcon = trustInformation ? (\n <EntityTrustedIcon testID={concatTestID(testID, 'statusIcon', 'trusted')} />\n ) : (\n <EntityNotTrustedIcon testID={concatTestID(testID, 'statusIcon', 'notTrusted')} />\n );\n\n return {\n placeholderText,\n statusIcon,\n };\n }, [labels, testID, trustInformation]);\n\n const trustEntityName = useMemo(() => trustInformation?.name ?? labels.unknown, [labels.unknown, trustInformation]);\n\n return (\n <TouchableOpacity disabled={!onPress || !trustInformation} onPress={onPress} style={[styles.button, style]}>\n <EntityCluster\n avatar={avatarProps}\n entityName={trustEntityName}\n style={styles.cluster}\n subline={trustInformation ? undefined : labels.unknownSubline}\n sublineColor={sublineColor}\n testID={testID}\n textColor={textColor}\n />\n {onPress && trustInformation && <UpIcon color={textColor} style={styles.chevron} />}\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n button: {\n alignItems: 'center',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n width: '100%',\n },\n chevron: {\n marginLeft: 10,\n marginRight: 18,\n transform: [\n {\n rotate: '90deg',\n },\n ],\n },\n cluster: {\n flex: 1,\n flexShrink: 1,\n },\n});\n\nexport default TrustInfo;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAC1C,SAAoBC,UAAU,QAAmB,cAAc;AAE/D,SAAsBC,gBAAgB,QAAQ,qBAAqB;AACnE,OAAOC,aAAa,MAAM,2CAA2C;AACrE,SAASC,oBAAoB,EAAEC,iBAAiB,EAAEC,MAAM,QAAQ,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CAACK,gBAAiB;IAACL,OAAO,EAAEA,OAAQ;IAACC,KAAK,EAAE,CAACgB,MAAM,CAACC,MAAM,EAAEjB,KAAK;EAAE,gBACzGZ,KAAA,CAAAwB,aAAA,CAACpB,aAAa;IACZ0B,MAAM,EAAEb,WAAY;IACpBc,UAAU,EAAEN,eAAgB;IAC5Bb,KAAK,EAAEgB,MAAM,CAACI,OAAQ;IACtBC,OAAO,EAAEjB,gBAAgB,GAAGkB,SAAS,GAAGxB,MAAM,CAACyB,cAAe;IAC9DtB,YAAY,EAAEA,YAAa;IAC3BC,MAAM,EAAEA,MAAO;IACfC,SAAS,EAAEA;EAAU,CACtB,CAAC,EACDJ,OAAO,IAAIK,gBAAgB,iBAAIhB,KAAA,CAAAwB,aAAA,CAACjB,MAAM;IAAC6B,KAAK,EAAErB,SAAU;IAACH,KAAK,EAAEgB,MAAM,CAACS;EAAQ,CAAE,CAClE,CAAC;AAEvB,CAAC;AAED,MAAMT,MAAM,GAAG1B,UAAU,CAACoC,MAAM,CAAC;EAC/BT,MAAM,EAAE;IACNU,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,QAAQ;IAClBC,KAAK,EAAE;EACT,CAAC;EACDL,OAAO,EAAE;IACPM,UAAU,EAAE,EAAE;IACdC,WAAW,EAAE,EAAE;IACfC,SAAS,EAAE,CACT;MACEC,MAAM,EAAE;IACV,CAAC;EAEL,CAAC;EACDd,OAAO,EAAE;IACPe,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAevC,SAAS","ignoreList":[]}
|
|
@@ -31,6 +31,7 @@ const CredentialDetailsCard = ({
|
|
|
31
31
|
const CaretIcon = expanded ? UpIcon : DownIcon;
|
|
32
32
|
const cardHeight = Math.ceil(card.width / CredentialCardRatio);
|
|
33
33
|
const currentHeight = useSharedValue(undefined);
|
|
34
|
+
const [animatedHeightSet, setAnimatedHeightSet] = useState(false);
|
|
34
35
|
const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];
|
|
35
36
|
const extraAttributes = useMemo(() => attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : [], [attributes]);
|
|
36
37
|
useEffect(() => {
|
|
@@ -51,6 +52,7 @@ const CredentialDetailsCard = ({
|
|
|
51
52
|
const additionalAttributesHeight = fullAttributesHeight !== null && fullAttributesHeight !== void 0 ? fullAttributesHeight : 0;
|
|
52
53
|
const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;
|
|
53
54
|
const fullHeight = previewAttributesHeight + additionalHeight;
|
|
55
|
+
setAnimatedHeightSet(true);
|
|
54
56
|
if (!animate) {
|
|
55
57
|
currentHeight.value = fullHeight;
|
|
56
58
|
return;
|
|
@@ -99,7 +101,7 @@ const CredentialDetailsCard = ({
|
|
|
99
101
|
header,
|
|
100
102
|
...cardProps
|
|
101
103
|
} = card;
|
|
102
|
-
const renderExtraAttributes = allAttributesRendered || previewAttributesHeight !== undefined &&
|
|
104
|
+
const renderExtraAttributes = allAttributesRendered || previewAttributesHeight !== undefined && animatedHeightSet;
|
|
103
105
|
const ContainerComponent = animate ? Animated.View : View;
|
|
104
106
|
return /*#__PURE__*/React.createElement(ContainerComponent, _extends({
|
|
105
107
|
style: [styles.detailsCard, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","concatTestID","Button","ButtonType","DownIcon","UpIcon","useAppColorScheme","CredentialAttributeItem","CredentialCard","CredentialCardRatio","PREVIEW_ATTRIBUTES_COUNT","SEE_ALL_BUTTON_HEIGHT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","previewAttributesHeight","setPreviewAttributesHeight","fullAttributesHeight","setFullAttributesHeight","allAttributesRendered","setAllAttributesRendered","length","CaretIcon","cardHeight","Math","ceil","width","currentHeight","undefined","previewAttributes","slice","extraAttributes","viewStyle","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","buttonViewHeight","additionalAttributesHeight","additionalHeight","fullHeight","value","newHeight","duration","animatedStyle","height","onPreviewAttrContentLayout","event","nativeEvent","layout","onFullAttrContentLayout","footerView","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","ContainerComponent","_extends","detailsCard","backgroundColor","white","accessory","onHeaderPress","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","buttonWrapper","type","Secondary","title","index","create","paddingHorizontal","paddingTop","borderRadius","borderWidth","overflow","marginTop"],"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\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 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 =\n allAttributesRendered || (previewAttributesHeight !== undefined && currentHeight.value !== undefined);\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,OAAOA,KAAK,IAAqCC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACzG,SAAiDC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAClG,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,QAAQ,yBAAyB;AAEhG,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,MAAM,EAAEC,UAAU,QAAQ,eAAe;AAClD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AACzD,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,OAAOC,uBAAuB,MAA+B,8BAA8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QAAQ,CAAC,CAAC,CAAE;IAC5DrE,cAAc,EAAEA,cAAe;IAC/BsE,OAAO,EAAErE;EAAoB,GACzB+D,SAAS,CACd,CACF,CACG,CAEJ,CACF,CACP,EACAlB,UAAU,gBAAG1E,KAAA,CAAA6E,aAAA,CAACvE,IAAI;IAACwB,KAAK,EAAEyB,MAAM,CAAC5B;EAAO,GAAE+C,UAAiB,CAAC,GAAG,IAC9C,CAAC;AAEzB,CAAC;AAED,MAAMnB,MAAM,GAAGlD,UAAU,CAACmG,MAAM,CAAC;EAC/BhD,oBAAoB,EAAE;IACpBG,aAAa,EAAE,EAAE;IACjB8C,iBAAiB,EAAE,CAAC;IACpB1D,KAAK,EAAE;EACT,CAAC;EACDU,8BAA8B,EAAE;IAC9BE,aAAa,EAAE;EACjB,CAAC;EACD6B,iBAAiB,EAAE;IACjBkB,UAAU,EAAE,CAAC;IACb3D,KAAK,EAAE;EACT,CAAC;EACDoD,aAAa,EAAE;IACb/B,MAAM,EAAE/C,qBAAqB;IAC7BsC,aAAa,EAAE,EAAE;IACjB8C,iBAAiB,EAAE,CAAC;IACpB1D,KAAK,EAAE;EACT,CAAC;EACDtB,IAAI,EAAE;IACJkF,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE;EACf,CAAC;EACDzB,WAAW,EAAE;IACXwB,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,QAAQ,EAAE;EACZ,CAAC;EACDlF,MAAM,EAAE;IACNmF,SAAS,EAAE;EACb,CAAC;EACDpB,wBAAwB,EAAE;IACxBe,iBAAiB,EAAE,CAAC;IACpB1D,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAezB,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","concatTestID","Button","ButtonType","DownIcon","UpIcon","useAppColorScheme","CredentialAttributeItem","CredentialCard","CredentialCardRatio","PREVIEW_ATTRIBUTES_COUNT","SEE_ALL_BUTTON_HEIGHT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","previewAttributesHeight","setPreviewAttributesHeight","fullAttributesHeight","setFullAttributesHeight","allAttributesRendered","setAllAttributesRendered","length","CaretIcon","cardHeight","Math","ceil","width","currentHeight","undefined","animatedHeightSet","setAnimatedHeightSet","previewAttributes","slice","extraAttributes","viewStyle","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","buttonViewHeight","additionalAttributesHeight","additionalHeight","fullHeight","value","newHeight","duration","animatedStyle","height","onPreviewAttrContentLayout","event","nativeEvent","layout","onFullAttrContentLayout","footerView","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","ContainerComponent","_extends","detailsCard","backgroundColor","white","accessory","onHeaderPress","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","buttonWrapper","type","Secondary","title","index","create","paddingHorizontal","paddingTop","borderRadius","borderWidth","overflow","marginTop"],"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,OAAOA,KAAK,IAAqCC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACzG,SAAiDC,UAAU,EAAEC,IAAI,Q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IAChBC,WAAW,EAAE,CAAC;IACdC,QAAQ,EAAE;EACZ,CAAC;EACDpF,MAAM,EAAE;IACNqF,SAAS,EAAE;EACb,CAAC;EACDpB,wBAAwB,EAAE;IACxBe,iBAAiB,EAAE,CAAC;IACpB5D,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAezB,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useState","Animated","StyleSheet","View","useSafeAreaInsets","BlurView","AnimatedSearchBar","useAppColorScheme","FoldableSearchHeader","staticHeader","scrollOffset","searchBar","header","withNotice","safeAreaInsets","colorScheme","collapsed","setCollapsed","headerHeight","setHeaderHeight","containerPaddingTop","top","containerPaddingStyle","paddingTop","id","addListener","value","removeListener","playHeaderFoldAnimation","scrollHeaderAnimatedStyle","transform","translateY","interpolate","extrapolate","inputRange","outputRange","undefined","fadeHeaderOutAnimatedStyle","opacity","onHeaderLayout","event","nativeEvent","layout","height","createElement","style","styles","headerContainer","noticeBorderRadius","blurFill","blurStyle","color","background","absoluteFill","onLayout","_extends","create","bottom","left","overflow","position","right","width","borderTopLeftRadius","borderTopRightRadius"],"sources":["foldable-header.tsx"],"sourcesContent":["import React, { FunctionComponent, ReactElement, useCallback, useEffect, useState } from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport BlurView from '../blur/blur-view';\nimport AnimatedSearchBar, { AnimatedSearchBarProps } from '../searchbar/animated-search-bar';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type FoldableHeaderProps = {\n header: ReactElement;\n scrollOffset: Animated.Value;\n searchBar?: Omit<AnimatedSearchBarProps, 'collapsed'>;\n // if true, the header won't fold / fade out on scroll\n staticHeader?: boolean;\n withNotice?: boolean;\n};\n\nconst FoldableSearchHeader: FunctionComponent<FoldableHeaderProps> = ({\n staticHeader = false,\n scrollOffset,\n searchBar,\n header,\n withNotice,\n}) => {\n const safeAreaInsets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const [collapsed, setCollapsed] = useState(header ? false : true);\n const [headerHeight, setHeaderHeight] = useState<number>();\n\n const containerPaddingTop = withNotice ? 15 : safeAreaInsets.top;\n const containerPaddingStyle = {\n paddingTop: containerPaddingTop,\n };\n\n useEffect(() => {\n const id = scrollOffset.addListener(({ value }) => {\n if (!headerHeight) {\n return;\n }\n\n if (value > headerHeight) {\n setCollapsed(true);\n } else {\n setCollapsed(false);\n }\n });\n return () => {\n scrollOffset.removeListener(id);\n };\n }, [scrollOffset, searchBar, headerHeight]);\n\n const playHeaderFoldAnimation = !staticHeader && headerHeight;\n\n const scrollHeaderAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation\n ? {\n transform: [{\n
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useState","Animated","StyleSheet","View","useSafeAreaInsets","BlurView","AnimatedSearchBar","useAppColorScheme","FoldableSearchHeader","staticHeader","scrollOffset","searchBar","header","withNotice","safeAreaInsets","colorScheme","collapsed","setCollapsed","headerHeight","setHeaderHeight","containerPaddingTop","top","containerPaddingStyle","paddingTop","id","addListener","value","removeListener","playHeaderFoldAnimation","scrollHeaderAnimatedStyle","transform","translateY","interpolate","extrapolate","inputRange","outputRange","undefined","fadeHeaderOutAnimatedStyle","opacity","onHeaderLayout","event","nativeEvent","layout","height","createElement","style","styles","headerContainer","noticeBorderRadius","blurFill","blurStyle","color","background","absoluteFill","onLayout","_extends","create","bottom","left","overflow","position","right","width","borderTopLeftRadius","borderTopRightRadius"],"sources":["foldable-header.tsx"],"sourcesContent":["import React, { FunctionComponent, ReactElement, useCallback, useEffect, useState } from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport BlurView from '../blur/blur-view';\nimport AnimatedSearchBar, { AnimatedSearchBarProps } from '../searchbar/animated-search-bar';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type FoldableHeaderProps = {\n header: ReactElement;\n scrollOffset: Animated.Value;\n searchBar?: Omit<AnimatedSearchBarProps, 'collapsed'>;\n // if true, the header won't fold / fade out on scroll\n staticHeader?: boolean;\n withNotice?: boolean;\n};\n\nconst FoldableSearchHeader: FunctionComponent<FoldableHeaderProps> = ({\n staticHeader = false,\n scrollOffset,\n searchBar,\n header,\n withNotice,\n}) => {\n const safeAreaInsets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const [collapsed, setCollapsed] = useState(header ? false : true);\n const [headerHeight, setHeaderHeight] = useState<number>();\n\n const containerPaddingTop = withNotice ? 15 : safeAreaInsets.top;\n const containerPaddingStyle = {\n paddingTop: containerPaddingTop,\n };\n\n useEffect(() => {\n const id = scrollOffset.addListener(({ value }) => {\n if (!headerHeight) {\n return;\n }\n\n if (value > headerHeight) {\n setCollapsed(true);\n } else {\n setCollapsed(false);\n }\n });\n return () => {\n scrollOffset.removeListener(id);\n };\n }, [scrollOffset, searchBar, headerHeight]);\n\n const playHeaderFoldAnimation = !staticHeader && headerHeight;\n\n const scrollHeaderAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation\n ? {\n transform: [\n {\n translateY: scrollOffset.interpolate({\n extrapolate: 'clamp',\n inputRange: [0, headerHeight],\n outputRange: [0, -headerHeight],\n }),\n },\n ],\n }\n : undefined;\n\n const fadeHeaderOutAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation\n ? {\n opacity: scrollOffset.interpolate({\n extrapolate: 'clamp',\n inputRange: [0, headerHeight / 2],\n outputRange: [1, 0],\n }),\n }\n : undefined;\n\n const onHeaderLayout = useCallback(\n (event: LayoutChangeEvent) => {\n setHeaderHeight(event.nativeEvent.layout.height);\n },\n [setHeaderHeight],\n );\n\n return (\n <Animated.View\n style={[styles.headerContainer, containerPaddingStyle, withNotice ? styles.noticeBorderRadius : undefined]}>\n <Animated.View style={scrollHeaderAnimatedStyle}>\n <View style={[styles.blurFill, { top: -containerPaddingTop }]}>\n <BlurView\n blurStyle={'header'}\n color={colorScheme.background}\n style={[StyleSheet.absoluteFill, withNotice ? styles.noticeBorderRadius : undefined]}\n />\n </View>\n {header && (\n <Animated.View onLayout={onHeaderLayout} style={fadeHeaderOutAnimatedStyle}>\n {header}\n </Animated.View>\n )}\n {searchBar && <AnimatedSearchBar {...searchBar} collapsed={collapsed} />}\n </Animated.View>\n </Animated.View>\n );\n};\n\nconst styles = StyleSheet.create({\n blurFill: {\n bottom: 0,\n left: 0,\n overflow: 'hidden',\n position: 'absolute',\n right: 0,\n },\n headerContainer: {\n overflow: 'hidden',\n position: 'absolute',\n width: '100%',\n },\n noticeBorderRadius: {\n borderTopLeftRadius: 30,\n borderTopRightRadius: 30,\n overflow: 'hidden',\n },\n});\n\nexport default FoldableSearchHeader;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAqCC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAChG,SAASC,QAAQ,EAAqBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACvF,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,OAAOC,QAAQ,MAAM,mBAAmB;AACxC,OAAOC,iBAAiB,MAAkC,kCAAkC;AAC5F,SAASC,iBAAiB,QAAQ,+BAA+B;AAWjE,MAAMC,oBAA4D,GAAGA,CAAC;EACpEC,YAAY,GAAG,KAAK;EACpBC,YAAY;EACZC,SAAS;EACTC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,MAAMC,cAAc,GAAGV,iBAAiB,CAAC,CAAC;EAC1C,MAAMW,WAAW,GAAGR,iBAAiB,CAAC,CAAC;EACvC,MAAM,CAACS,SAAS,EAAEC,YAAY,CAAC,GAAGjB,QAAQ,CAACY,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC;EACjE,MAAM,CAACM,YAAY,EA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EAAE,QAAQ;IAClBC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT,CAAC;EACDd,eAAe,EAAE;IACfY,QAAQ,EAAE,QAAQ;IAClBC,QAAQ,EAAE,UAAU;IACpBE,KAAK,EAAE;EACT,CAAC;EACDd,kBAAkB,EAAE;IAClBe,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBL,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,eAAenD,oBAAoB","ignoreList":[]}
|
|
@@ -19,6 +19,7 @@ const backButtonHitSlop = {
|
|
|
19
19
|
* states (Default + Dashboard)
|
|
20
20
|
*/
|
|
21
21
|
const Header = ({
|
|
22
|
+
backIcon,
|
|
22
23
|
onBack,
|
|
23
24
|
rightButtons,
|
|
24
25
|
style,
|
|
@@ -35,6 +36,7 @@ const Header = ({
|
|
|
35
36
|
style: styles.backButtonRow
|
|
36
37
|
}, /*#__PURE__*/React.createElement(BackButton, {
|
|
37
38
|
hitSlop: backButtonHitSlop,
|
|
39
|
+
icon: backIcon,
|
|
38
40
|
onPress: onBack,
|
|
39
41
|
testID: concatTestID(testID, 'back')
|
|
40
42
|
}), /*#__PURE__*/React.createElement(View, null), rightButtons), /*#__PURE__*/React.createElement(View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","View","concatTestID","BackButton","Typography","useAppColorScheme","backButtonHitSlop","top","bottom","left","right","Header","onBack","rightButtons","style","titleRowStyle","testID","title","viewProps","colorScheme","createElement","_extends","styles","container","backButtonRow","hitSlop","onPress","titleRow","titleRow2nd","titleRowNoBackButton","titleRowNoRightButton","accessibilityRole","color","text","preset","rightButtonWrapper","create","alignItems","flexDirection","justifyContent","minHeight","paddingHorizontal","width","gap","height","paddingTop","flex","paddingBottom","paddingLeft","paddingRight","marginBottom","marginTop"],"sources":["header.tsx"],"sourcesContent":["import React, { FC, ReactNode } from 'react';\nimport { Insets, StyleProp, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { BackButton } from '../buttons';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\nexport interface HeaderProps extends ViewProps {\n onBack?: () => void;\n rightButtons?: ReactNode[];\n style?: StyleProp<ViewStyle>;\n titleRowStyle?: StyleProp<ViewStyle>;\n title: ReactNode;\n}\n\nconst backButtonHitSlop: Insets = { top: 12, bottom: 12, left: 20, right: 20 };\n\n/**\n * Unified screen header\n *\n * Following the design: https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=425-18624\n * states (Default + Dashboard)\n */\nconst Header: FC<HeaderProps> = ({
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","concatTestID","BackButton","Typography","useAppColorScheme","backButtonHitSlop","top","bottom","left","right","Header","backIcon","onBack","rightButtons","style","titleRowStyle","testID","title","viewProps","colorScheme","createElement","_extends","styles","container","backButtonRow","hitSlop","icon","onPress","titleRow","titleRow2nd","titleRowNoBackButton","titleRowNoRightButton","accessibilityRole","color","text","preset","rightButtonWrapper","create","alignItems","flexDirection","justifyContent","minHeight","paddingHorizontal","width","gap","height","paddingTop","flex","paddingBottom","paddingLeft","paddingRight","marginBottom","marginTop"],"sources":["header.tsx"],"sourcesContent":["import React, { FC, ReactNode } from 'react';\nimport { Insets, StyleProp, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { BackButton, BackButtonIcon } from '../buttons';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\nexport interface HeaderProps extends ViewProps {\n backIcon?: BackButtonIcon;\n onBack?: () => void;\n rightButtons?: ReactNode[];\n style?: StyleProp<ViewStyle>;\n titleRowStyle?: StyleProp<ViewStyle>;\n title: ReactNode;\n}\n\nconst backButtonHitSlop: Insets = { top: 12, bottom: 12, left: 20, right: 20 };\n\n/**\n * Unified screen header\n *\n * Following the design: https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=425-18624\n * states (Default + Dashboard)\n */\nconst Header: FC<HeaderProps> = ({\n backIcon,\n onBack,\n rightButtons,\n style,\n titleRowStyle,\n testID,\n title,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n\n return (\n <View style={[styles.container, style]} testID={testID} {...viewProps}>\n {onBack && (\n <View style={styles.backButtonRow}>\n <BackButton\n hitSlop={backButtonHitSlop}\n icon={backIcon}\n onPress={onBack}\n testID={concatTestID(testID, 'back')}\n />\n <View />\n {rightButtons}\n </View>\n )}\n\n <View\n style={[\n styles.titleRow,\n onBack ? styles.titleRow2nd : styles.titleRowNoBackButton,\n (onBack || !rightButtons) && styles.titleRowNoRightButton,\n titleRowStyle,\n ]}>\n {typeof title === 'string' ? (\n <Typography\n accessibilityRole=\"header\"\n color={colorScheme.text}\n preset=\"l\"\n style={styles.title}\n testID={concatTestID(testID, 'title')}>\n {title}\n </Typography>\n ) : (\n <View style={styles.title}>{title}</View>\n )}\n\n {!onBack && rightButtons && <View style={styles.rightButtonWrapper}>{rightButtons}</View>}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n backButtonRow: {\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n minHeight: 48,\n paddingHorizontal: 20,\n width: '100%',\n },\n container: {\n width: '100%',\n },\n rightButtonWrapper: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: '16',\n height: 48,\n justifyContent: 'center',\n paddingHorizontal: 12,\n paddingTop: 2,\n },\n title: {\n flex: 1,\n paddingBottom: 8, // to compensate \"l\" font line-height difference\n paddingTop: 9,\n },\n titleRow: {\n flexDirection: 'row',\n paddingLeft: 20,\n paddingRight: 8,\n width: '100%',\n },\n titleRow2nd: {\n marginBottom: 12,\n },\n titleRowNoBackButton: {\n marginTop: 12,\n },\n titleRowNoRightButton: {\n paddingRight: 20,\n },\n});\n\nexport default Header;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAyB,OAAO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EAAE,KAAK;IACpBU,WAAW,EAAE,EAAE;IACfC,YAAY,EAAE,CAAC;IACfP,KAAK,EAAE;EACT,CAAC;EACDd,WAAW,EAAE;IACXsB,YAAY,EAAE;EAChB,CAAC;EACDrB,oBAAoB,EAAE;IACpBsB,SAAS,EAAE;EACb,CAAC;EACDrB,qBAAqB,EAAE;IACrBmB,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAexC,MAAM","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
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
2
|
import React, { useEffect, useMemo } from 'react';
|
|
3
3
|
import { Dimensions, StyleSheet, View } from 'react-native';
|
|
4
|
-
import { CredentialDetails,
|
|
4
|
+
import { CredentialDetails, TrustInfo } from '../../components';
|
|
5
5
|
import { HeaderInfoButton } from '../../components/navigation/header-buttons';
|
|
6
6
|
import { concatTestID, useCredentialListExpandedCard } from '../../utils';
|
|
7
7
|
import { TouchableOpacity } from '../accessibility';
|
|
@@ -73,9 +73,9 @@ export const HistoryDetailsView = ({
|
|
|
73
73
|
style: [styles.section, {
|
|
74
74
|
backgroundColor: colorScheme.white
|
|
75
75
|
}]
|
|
76
|
-
}, data.header && 'entity' in data.header && /*#__PURE__*/React.createElement(
|
|
76
|
+
}, data.header && 'entity' in data.header && /*#__PURE__*/React.createElement(TrustInfo, _extends({}, data.header.entity, {
|
|
77
77
|
style: [styles.entity, {
|
|
78
|
-
|
|
78
|
+
borderBottomColor: colorScheme.background
|
|
79
79
|
}, data.header.entity.style]
|
|
80
80
|
})), data.header && 'credentialHeader' in data.header && /*#__PURE__*/React.createElement(CredentialHeader, _extends({}, data.header.credentialHeader, {
|
|
81
81
|
blur: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useMemo","Dimensions","StyleSheet","View","CredentialDetails","EntityDetails","HeaderInfoButton","concatTestID","useCredentialListExpandedCard","TouchableOpacity","BackButton","CredentialDetailsCardListItem","CredentialHeader","NextIcon","ScrollViewScreen","Typography","useAppColorScheme","DataItem","HistoryDetailsView","assets","data","headerButton","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_assets$cards","_assets$cards2","colorScheme","expandedCredential","onHeaderPress","setInitialCredential","cardWidth","get","width","cards","length","id","credentialDetails","credentialId","credentialCard","card","moreInfoHeaderButton","_labels$infoButtonAcc","undefined","createElement","onPress","accessibilityLabel","infoButtonAccessibility","hasAssets","header","leftItem","rightItem","static","title","scrollView","style","styles","content","section","backgroundColor","white","_extends","entity","borderColor","background","credentialHeader","blur","attribute","date","value","action","last","label","valueColor","color","valueIcon","icon","text","preset","sectionHeader","relatedAssets","disabled","onPressed","accessory","assetsHeader","map","props","index","key","credential","expanded","lastItem","itemProps","headerPressable","toString","create","borderRadius","borderWidth","paddingHorizontal","paddingTop","marginBottom","borderBottomWidth","paddingBottom","marginTop","padding","marginHorizontal","marginVertical"],"sources":["history-details.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useEffect, useMemo } from 'react';\nimport { ColorValue, Dimensions, ImageSourcePropType, StyleSheet, View } from 'react-native';\n\nimport { CredentialDetails, CredentialDetailsProps, EntityDetails, EntityDetailsProps } from '../../components';\nimport { HeaderInfoButton } from '../../components/navigation/header-buttons';\nimport { CardLabels, concatTestID, useCredentialListExpandedCard } from '../../utils';\nimport { TouchableOpacity } from '../accessibility';\nimport { BackButton } from '../buttons';\nimport {\n CredentialDetailsCardListItem,\n CredentialDetailsCardListItemProps,\n CredentialHeader,\n CredentialHeaderProps,\n} from '../credential';\nimport { NextIcon } from '../icons';\nimport { ScrollViewScreen } from '../screens';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\nimport DataItem from './data-item';\n\nexport type HistoryDetailsLabels = {\n credentialCard: CardLabels;\n data: {\n date: string;\n action: string;\n };\n infoButtonAccessibility?: string;\n relatedAssets: string;\n title: string;\n};\n\ntype CredentialDetails = Omit<\n CredentialDetailsProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n>;\n\ntype CredentialCard = Omit<\n CredentialDetailsCardListItemProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n> & {\n /** default: true */\n headerPressable?: boolean;\n};\n\nexport type HistoryDetailsViewProps = {\n assets?: {\n header?: CredentialHeaderProps & {\n onPressed?: () => void;\n };\n cards?: (\n | {\n credentialDetails: CredentialDetails;\n }\n | {\n credentialCard: CredentialCard;\n }\n )[];\n };\n data: {\n header?:\n | {\n entity: EntityDetailsProps;\n }\n | {\n credentialHeader: CredentialHeaderProps;\n };\n date: string;\n action: {\n icon: ComponentType<any> | ReactElement;\n label: string;\n color: ColorValue;\n testID?: string;\n };\n };\n headerButton?: ReactElement;\n labels: HistoryDetailsLabels;\n onBackPressed: () => void;\n onInfoPressed?: () => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n testID: string;\n};\n\nexport const HistoryDetailsView: FC<HistoryDetailsViewProps> = ({\n assets,\n data,\n headerButton,\n labels,\n onBackPressed,\n onInfoPressed,\n onImagePreview,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { expandedCredential, onHeaderPress, setInitialCredential } = useCredentialListExpandedCard();\n const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);\n\n // Expand the first credential\n useEffect(() => {\n if (assets?.cards && assets.cards.length > 0) {\n let id =\n 'credentialDetails' in assets.cards[0]\n ? assets.cards[0].credentialDetails.credentialId\n : assets.cards[0].credentialCard.card.credentialId;\n if (id) {\n setInitialCredential(id);\n }\n }\n }, [assets?.cards, setInitialCredential]);\n\n const moreInfoHeaderButton = useMemo(() => {\n if (headerButton) {\n return headerButton;\n }\n\n if (!onInfoPressed) {\n return undefined;\n }\n\n return (\n <HeaderInfoButton\n onPress={onInfoPressed}\n testID={concatTestID(testID, 'header', 'info')}\n accessibilityLabel={labels.infoButtonAccessibility ?? ''}\n />\n );\n }, [headerButton, labels.infoButtonAccessibility, onInfoPressed, testID]);\n\n const hasAssets = assets && (assets.header || assets.cards?.length);\n\n return (\n <ScrollViewScreen\n header={{\n leftItem: <BackButton onPress={onBackPressed} testID={concatTestID(testID, 'header', 'back')} />,\n rightItem: moreInfoHeaderButton,\n static: true,\n title: labels.title,\n }}\n scrollView={{\n style: styles.content,\n }}\n testID={testID}>\n <View style={[styles.section, { backgroundColor: colorScheme.white }]}>\n {data.header && 'entity' in data.header && (\n <EntityDetails\n {...data.header.entity}\n style={[styles.entity, { borderColor: colorScheme.background }, data.header.entity.style]}\n />\n )}\n {data.header && 'credentialHeader' in data.header && (\n <CredentialHeader\n {...data.header.credentialHeader}\n blur={false}\n style={[styles.header, { borderColor: colorScheme.background }, data.header.credentialHeader.style]}\n />\n )}\n <DataItem attribute={labels.data.date} value={data.date} />\n <DataItem\n attribute={labels.data.action}\n last\n testID={data.action.testID}\n value={data.action.label}\n valueColor={data.action.color}\n valueIcon={data.action.icon}\n />\n </View>\n\n {hasAssets && (\n <Typography color={colorScheme.text} preset=\"m\" style={styles.sectionHeader}>\n {labels.relatedAssets}\n </Typography>\n )}\n\n {assets?.header && (\n <TouchableOpacity disabled={!assets.header.onPressed} onPress={assets.header.onPressed}>\n <CredentialHeader\n {...assets.header}\n accessory={assets.header.onPressed ? <NextIcon color={colorScheme.text} /> : undefined}\n blur={false}\n style={[styles.assetsHeader, assets.header.style]}\n />\n </TouchableOpacity>\n )}\n {assets?.cards?.map((props, index, { length }) => {\n if ('credentialDetails' in props) {\n return (\n <View key={props.credentialDetails.credentialId} style={styles.credential}>\n <CredentialDetails\n {...props.credentialDetails}\n expanded={expandedCredential === props.credentialDetails.credentialId}\n labels={labels.credentialCard}\n lastItem={index === length - 1}\n onHeaderPress={onHeaderPress}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n } else {\n const itemProps = {\n ...props.credentialCard,\n card: {\n ...props.credentialCard.card,\n onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress,\n width: cardWidth,\n },\n };\n return (\n <View key={index.toString()} style={styles.credential}>\n <CredentialDetailsCardListItem\n {...itemProps}\n expanded={expandedCredential === props.credentialCard.card.credentialId}\n lastItem={index === length - 1}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n }\n })}\n </ScrollViewScreen>\n );\n};\n\nconst styles = StyleSheet.create({\n assetsHeader: {\n borderRadius: 8,\n borderWidth: 0,\n },\n content: {\n paddingHorizontal: 16,\n paddingTop: 12,\n },\n credential: {\n marginBottom: 4,\n },\n entity: {\n borderBottomWidth: 1,\n paddingBottom: 8,\n },\n header: {\n borderBottomWidth: 1,\n marginTop: -8,\n paddingBottom: 12,\n paddingHorizontal: 0,\n },\n section: {\n borderRadius: 8,\n borderWidth: 0,\n marginBottom: 12,\n padding: 12,\n },\n sectionHeader: {\n marginHorizontal: 4,\n marginVertical: 16,\n },\n});\n"],"mappings":";AAAA,OAAOA,KAAK,IAAqCC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAClF,SAAqBC,UAAU,EAAuBC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE5F,SAASC,iBAAiB,EAA0BC,aAAa,QAA4B,kBAAkB;AAC/G,SAASC,gBAAgB,QAAQ,4CAA4C;AAC7E,SAAqBC,YAAY,EAAEC,6BAA6B,QAAQ,aAAa;AACrF,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,UAAU,QAAQ,YAAY;AACvC,SACEC,6BAA6B,EAE7BC,gBAAgB,QAEX,eAAe;AACtB,SAASC,QAAQ,QAAQ,UAAU;AACnC,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,OAAOC,QAAQ,MAAM,aAAa;AAgElC,OAAO,MAAMC,kBAA+C,GAAGA,CA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,WAAW,EAAE,CAAC;IACdG,YAAY,EAAE,EAAE;IAChBI,OAAO,EAAE;EACX,CAAC;EACDzB,aAAa,EAAE;IACb0B,gBAAgB,EAAE,CAAC;IACnBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","Dimensions","StyleSheet","View","CredentialDetails","TrustInfo","HeaderInfoButton","concatTestID","useCredentialListExpandedCard","TouchableOpacity","BackButton","CredentialDetailsCardListItem","CredentialHeader","NextIcon","ScrollViewScreen","Typography","useAppColorScheme","DataItem","HistoryDetailsView","assets","data","headerButton","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_assets$cards","_assets$cards2","colorScheme","expandedCredential","onHeaderPress","setInitialCredential","cardWidth","get","width","cards","length","id","credentialDetails","credentialId","credentialCard","card","moreInfoHeaderButton","_labels$infoButtonAcc","undefined","createElement","onPress","accessibilityLabel","infoButtonAccessibility","hasAssets","header","leftItem","rightItem","static","title","scrollView","style","styles","content","section","backgroundColor","white","_extends","entity","borderBottomColor","background","credentialHeader","blur","borderColor","attribute","date","value","action","last","label","valueColor","color","valueIcon","icon","text","preset","sectionHeader","relatedAssets","disabled","onPressed","accessory","assetsHeader","map","props","index","key","credential","expanded","lastItem","itemProps","headerPressable","toString","create","borderRadius","borderWidth","paddingHorizontal","paddingTop","marginBottom","borderBottomWidth","paddingBottom","marginTop","padding","marginHorizontal","marginVertical"],"sources":["history-details.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useEffect, useMemo } from 'react';\nimport { ColorValue, Dimensions, ImageSourcePropType, StyleSheet, View } from 'react-native';\n\nimport { CredentialDetails, CredentialDetailsProps, TrustInfo, TrustInfoProps } from '../../components';\nimport { HeaderInfoButton } from '../../components/navigation/header-buttons';\nimport { CardLabels, concatTestID, useCredentialListExpandedCard } from '../../utils';\nimport { TouchableOpacity } from '../accessibility';\nimport { BackButton } from '../buttons';\nimport {\n CredentialDetailsCardListItem,\n CredentialDetailsCardListItemProps,\n CredentialHeader,\n CredentialHeaderProps,\n} from '../credential';\nimport { NextIcon } from '../icons';\nimport { ScrollViewScreen } from '../screens';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\nimport DataItem from './data-item';\n\nexport type HistoryDetailsLabels = {\n credentialCard: CardLabels;\n data: {\n date: string;\n action: string;\n };\n infoButtonAccessibility?: string;\n relatedAssets: string;\n title: string;\n};\n\ntype CredentialDetails = Omit<\n CredentialDetailsProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n>;\n\ntype CredentialCard = Omit<\n CredentialDetailsCardListItemProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n> & {\n /** default: true */\n headerPressable?: boolean;\n};\n\nexport type HistoryDetailsViewProps = {\n assets?: {\n header?: CredentialHeaderProps & {\n onPressed?: () => void;\n };\n cards?: (\n | {\n credentialDetails: CredentialDetails;\n }\n | {\n credentialCard: CredentialCard;\n }\n )[];\n };\n data: {\n header?:\n | {\n entity: TrustInfoProps;\n }\n | {\n credentialHeader: CredentialHeaderProps;\n };\n date: string;\n action: {\n icon: ComponentType<any> | ReactElement;\n label: string;\n color: ColorValue;\n testID?: string;\n };\n };\n headerButton?: ReactElement;\n labels: HistoryDetailsLabels;\n onBackPressed: () => void;\n onInfoPressed?: () => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n testID: string;\n};\n\nexport const HistoryDetailsView: FC<HistoryDetailsViewProps> = ({\n assets,\n data,\n headerButton,\n labels,\n onBackPressed,\n onInfoPressed,\n onImagePreview,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { expandedCredential, onHeaderPress, setInitialCredential } = useCredentialListExpandedCard();\n const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);\n\n // Expand the first credential\n useEffect(() => {\n if (assets?.cards && assets.cards.length > 0) {\n let id =\n 'credentialDetails' in assets.cards[0]\n ? assets.cards[0].credentialDetails.credentialId\n : assets.cards[0].credentialCard.card.credentialId;\n if (id) {\n setInitialCredential(id);\n }\n }\n }, [assets?.cards, setInitialCredential]);\n\n const moreInfoHeaderButton = useMemo(() => {\n if (headerButton) {\n return headerButton;\n }\n\n if (!onInfoPressed) {\n return undefined;\n }\n\n return (\n <HeaderInfoButton\n onPress={onInfoPressed}\n testID={concatTestID(testID, 'header', 'info')}\n accessibilityLabel={labels.infoButtonAccessibility ?? ''}\n />\n );\n }, [headerButton, labels.infoButtonAccessibility, onInfoPressed, testID]);\n\n const hasAssets = assets && (assets.header || assets.cards?.length);\n\n return (\n <ScrollViewScreen\n header={{\n leftItem: <BackButton onPress={onBackPressed} testID={concatTestID(testID, 'header', 'back')} />,\n rightItem: moreInfoHeaderButton,\n static: true,\n title: labels.title,\n }}\n scrollView={{\n style: styles.content,\n }}\n testID={testID}>\n <View style={[styles.section, { backgroundColor: colorScheme.white }]}>\n {data.header && 'entity' in data.header && (\n <TrustInfo\n {...data.header.entity}\n style={[styles.entity, { borderBottomColor: colorScheme.background }, data.header.entity.style]}\n />\n )}\n {data.header && 'credentialHeader' in data.header && (\n <CredentialHeader\n {...data.header.credentialHeader}\n blur={false}\n style={[styles.header, { borderColor: colorScheme.background }, data.header.credentialHeader.style]}\n />\n )}\n <DataItem attribute={labels.data.date} value={data.date} />\n <DataItem\n attribute={labels.data.action}\n last\n testID={data.action.testID}\n value={data.action.label}\n valueColor={data.action.color}\n valueIcon={data.action.icon}\n />\n </View>\n\n {hasAssets && (\n <Typography color={colorScheme.text} preset=\"m\" style={styles.sectionHeader}>\n {labels.relatedAssets}\n </Typography>\n )}\n\n {assets?.header && (\n <TouchableOpacity disabled={!assets.header.onPressed} onPress={assets.header.onPressed}>\n <CredentialHeader\n {...assets.header}\n accessory={assets.header.onPressed ? <NextIcon color={colorScheme.text} /> : undefined}\n blur={false}\n style={[styles.assetsHeader, assets.header.style]}\n />\n </TouchableOpacity>\n )}\n {assets?.cards?.map((props, index, { length }) => {\n if ('credentialDetails' in props) {\n return (\n <View key={props.credentialDetails.credentialId} style={styles.credential}>\n <CredentialDetails\n {...props.credentialDetails}\n expanded={expandedCredential === props.credentialDetails.credentialId}\n labels={labels.credentialCard}\n lastItem={index === length - 1}\n onHeaderPress={onHeaderPress}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n } else {\n const itemProps = {\n ...props.credentialCard,\n card: {\n ...props.credentialCard.card,\n onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress,\n width: cardWidth,\n },\n };\n return (\n <View key={index.toString()} style={styles.credential}>\n <CredentialDetailsCardListItem\n {...itemProps}\n expanded={expandedCredential === props.credentialCard.card.credentialId}\n lastItem={index === length - 1}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n }\n })}\n </ScrollViewScreen>\n );\n};\n\nconst styles = StyleSheet.create({\n assetsHeader: {\n borderRadius: 8,\n borderWidth: 0,\n },\n content: {\n paddingHorizontal: 16,\n paddingTop: 12,\n },\n credential: {\n marginBottom: 4,\n },\n entity: {\n borderBottomWidth: 1,\n paddingBottom: 8,\n },\n header: {\n borderBottomWidth: 1,\n marginTop: -8,\n paddingBottom: 12,\n paddingHorizontal: 0,\n },\n section: {\n borderRadius: 8,\n borderWidth: 0,\n marginBottom: 12,\n padding: 12,\n },\n sectionHeader: {\n marginHorizontal: 4,\n marginVertical: 16,\n },\n});\n"],"mappings":";AAAA,OAAOA,KAAK,IAAqCC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAClF,SAAqBC,UAAU,EAAuBC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE5F,SAASC,iBAAiB,EAA0BC,SAAS,QAAwB,kBAAkB;AACvG,SAASC,gBAAgB,QAAQ,4CAA4C;AAC7E,SAAqBC,YAAY,EAAEC,6BAA6B,QAAQ,aAAa;AACrF,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,UAAU,QAAQ,YAAY;AACvC,SACEC,6BAA6B,EAE7BC,gBAAgB,QAEX,eAAe;AACt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jB,CAAC;EACDtD,MAAM,EAAE;IACNqD,iBAAiB,EAAE,CAAC;IACpBE,SAAS,EAAE,CAAC,CAAC;IACbD,aAAa,EAAE,EAAE;IACjBJ,iBAAiB,EAAE;EACrB,CAAC;EACDzC,OAAO,EAAE;IACPuC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdG,YAAY,EAAE,EAAE;IAChBI,OAAO,EAAE;EACX,CAAC;EACDzB,aAAa,EAAE;IACb0B,gBAAgB,EAAE,CAAC;IACnBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 from 'react';
|
|
3
|
+
import Svg, { Path } from 'react-native-svg';
|
|
4
|
+
export const MailIcon = ({
|
|
5
|
+
color,
|
|
6
|
+
...props
|
|
7
|
+
}) => {
|
|
8
|
+
return /*#__PURE__*/React.createElement(Svg, _extends({
|
|
9
|
+
fill: "none",
|
|
10
|
+
height: 12,
|
|
11
|
+
viewBox: "0 0 17 12",
|
|
12
|
+
width: 17
|
|
13
|
+
}, props), /*#__PURE__*/React.createElement(Path, {
|
|
14
|
+
d: "M8.244 6.651c-.223 0-.442-.093-.656-.28L.758.355C1.124.118 1.587 0 2.147 0H14.35c.56 0 1.02.118 1.38.355L8.9 6.371c-.21.187-.428.28-.656.28zM.178 10.678a2.155 2.155 0 01-.13-.438A3.038 3.038 0 010 9.666V2.119c0-.237.016-.44.048-.608.036-.169.075-.287.116-.356l5.072 4.471-5.058 5.052zm1.763 1.107c-.25 0-.474-.027-.67-.082a1.553 1.553 0 01-.478-.219l5.202-5.202.998.889c.2.173.406.305.615.396.21.087.422.13.636.13.214 0 .426-.043.636-.13.214-.09.421-.223.622-.396l.998-.889 5.202 5.202c-.127.091-.29.164-.485.22a2.42 2.42 0 01-.663.081H1.94zm14.376-1.107L11.26 5.626l5.072-4.47c.037.068.073.186.11.355.036.168.054.371.054.608v7.547c0 .219-.018.41-.055.574-.032.164-.073.31-.123.438z",
|
|
15
|
+
fill: color,
|
|
16
|
+
opacity: 0.9
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
export const PhoneIcon = ({
|
|
20
|
+
color,
|
|
21
|
+
...props
|
|
22
|
+
}) => {
|
|
23
|
+
return /*#__PURE__*/React.createElement(Svg, _extends({
|
|
24
|
+
fill: "none",
|
|
25
|
+
height: 13,
|
|
26
|
+
viewBox: "0 0 13 13",
|
|
27
|
+
width: 13
|
|
28
|
+
}, props), /*#__PURE__*/React.createElement(Path, {
|
|
29
|
+
d: "M3.5 9.208c-.67-.665-1.27-1.36-1.798-2.085A11.126 11.126 0 01.458 4.956C.153 4.236 0 3.552 0 2.906c0-.43.073-.83.219-1.204.15-.374.367-.697.65-.97.2-.192.425-.36.676-.506C1.8.076 2.044 0 2.276 0a.69.69 0 01.486.198c.141.132.294.312.458.54l1.148 1.6c.128.182.217.346.267.492a1.3 1.3 0 01.075.424c0 .114-.016.22-.048.321-.032.1-.091.226-.178.376l-.642 1.1a20.5 20.5 0 01-.075.137.3.3 0 00-.028.124c0 .054.007.107.02.157.019.05.037.093.055.13.274.547.746 1.155 1.415 1.825.324.323.657.62.999.888.341.265.642.456.902.575.064.027.12.05.17.068a.732.732 0 00.302.007.93.93 0 00.157-.075l1.094-.602c.177-.096.319-.157.423-.184.11-.032.217-.048.322-.048.123 0 .241.023.355.068.119.041.283.135.492.28l1.668 1.197c.224.16.383.307.479.444.1.137.15.278.15.424 0 .187-.05.387-.15.601-.096.215-.27.463-.52.745a2.76 2.76 0 01-.964.69 3.086 3.086 0 01-1.257.254c-.648 0-1.333-.155-2.058-.465a11.295 11.295 0 01-2.188-1.265A17.799 17.799 0 013.5 9.208z",
|
|
30
|
+
fill: color,
|
|
31
|
+
opacity: 0.9
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Svg","Path","MailIcon","color","props","createElement","_extends","fill","height","viewBox","width","d","opacity","PhoneIcon"],"sources":["contact.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport Svg, { Path, SvgProps } from 'react-native-svg';\n\nexport const MailIcon: FC<SvgProps> = ({ color, ...props }) => {\n return (\n <Svg fill=\"none\" height={12} viewBox=\"0 0 17 12\" width={17} {...props}>\n <Path\n d=\"M8.244 6.651c-.223 0-.442-.093-.656-.28L.758.355C1.124.118 1.587 0 2.147 0H14.35c.56 0 1.02.118 1.38.355L8.9 6.371c-.21.187-.428.28-.656.28zM.178 10.678a2.155 2.155 0 01-.13-.438A3.038 3.038 0 010 9.666V2.119c0-.237.016-.44.048-.608.036-.169.075-.287.116-.356l5.072 4.471-5.058 5.052zm1.763 1.107c-.25 0-.474-.027-.67-.082a1.553 1.553 0 01-.478-.219l5.202-5.202.998.889c.2.173.406.305.615.396.21.087.422.13.636.13.214 0 .426-.043.636-.13.214-.09.421-.223.622-.396l.998-.889 5.202 5.202c-.127.091-.29.164-.485.22a2.42 2.42 0 01-.663.081H1.94zm14.376-1.107L11.26 5.626l5.072-4.47c.037.068.073.186.11.355.036.168.054.371.054.608v7.547c0 .219-.018.41-.055.574-.032.164-.073.31-.123.438z\"\n fill={color}\n opacity={0.9}\n />\n </Svg>\n );\n};\n\nexport const PhoneIcon: FC<SvgProps> = ({ color, ...props }) => {\n return (\n <Svg fill=\"none\" height={13} viewBox=\"0 0 13 13\" width={13} {...props}>\n <Path\n d=\"M3.5 9.208c-.67-.665-1.27-1.36-1.798-2.085A11.126 11.126 0 01.458 4.956C.153 4.236 0 3.552 0 2.906c0-.43.073-.83.219-1.204.15-.374.367-.697.65-.97.2-.192.425-.36.676-.506C1.8.076 2.044 0 2.276 0a.69.69 0 01.486.198c.141.132.294.312.458.54l1.148 1.6c.128.182.217.346.267.492a1.3 1.3 0 01.075.424c0 .114-.016.22-.048.321-.032.1-.091.226-.178.376l-.642 1.1a20.5 20.5 0 01-.075.137.3.3 0 00-.028.124c0 .054.007.107.02.157.019.05.037.093.055.13.274.547.746 1.155 1.415 1.825.324.323.657.62.999.888.341.265.642.456.902.575.064.027.12.05.17.068a.732.732 0 00.302.007.93.93 0 00.157-.075l1.094-.602c.177-.096.319-.157.423-.184.11-.032.217-.048.322-.048.123 0 .241.023.355.068.119.041.283.135.492.28l1.668 1.197c.224.16.383.307.479.444.1.137.15.278.15.424 0 .187-.05.387-.15.601-.096.215-.27.463-.52.745a2.76 2.76 0 01-.964.69 3.086 3.086 0 01-1.257.254c-.648 0-1.333-.155-2.058-.465a11.295 11.295 0 01-2.188-1.265A17.799 17.799 0 013.5 9.208z\"\n fill={color}\n opacity={0.9}\n />\n </Svg>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,OAAOC,GAAG,IAAIC,IAAI,QAAkB,kBAAkB;AAEtD,OAAO,MAAMC,QAAsB,GAAGA,CAAC;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,KAAK;EAC7D,oBACEL,KAAA,CAAAM,aAAA,CAACL,GAAG,EAAAM,QAAA;IAACC,IAAI,EAAC,MAAM;IAACC,MAAM,EAAE,EAAG;IAACC,OAAO,EAAC,WAAW;IAACC,KAAK,EAAE;EAAG,GAAKN,KAAK,gBACnEL,KAAA,CAAAM,aAAA,CAACJ,IAAI;IACHU,CAAC,EAAC,4qBAA4qB;IAC9qBJ,IAAI,EAAEJ,KAAM;IACZS,OAAO,EAAE;EAAI,CACd,CACE,CAAC;AAEV,CAAC;AAED,OAAO,MAAMC,SAAuB,GAAGA,CAAC;EAAEV,KAAK;EAAE,GAAGC;AAAM,CAAC,KAAK;EAC9D,oBACEL,KAAA,CAAAM,aAAA,CAACL,GAAG,EAAAM,QAAA;IAACC,IAAI,EAAC,MAAM;IAACC,MAAM,EAAE,EAAG;IAACC,OAAO,EAAC,WAAW;IAACC,KAAK,EAAE;EAAG,GAAKN,KAAK,gBACnEL,KAAA,CAAAM,aAAA,CAACJ,IAAI;IACHU,CAAC,EAAC,w6BAAw6B;IAC16BJ,IAAI,EAAEJ,KAAM;IACZS,OAAO,EAAE;EAAI,CACd,CACE,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -46,7 +46,7 @@ export const CredentialWarningIcon = ({
|
|
|
46
46
|
}));
|
|
47
47
|
|
|
48
48
|
// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=542-90920&m=dev
|
|
49
|
-
export const
|
|
49
|
+
export const CredentialNoticeInfoIcon = ({
|
|
50
50
|
...props
|
|
51
51
|
}) => {
|
|
52
52
|
const colorScheme = useAppColorScheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Svg","Path","useAppColorScheme","CredentialErrorIcon","props","createElement","_extends","fill","height","viewBox","width","d","stroke","strokeOpacity","strokeWidth","CredentialWarningIcon","CredentialNoticInfoIcon","colorScheme","text","fillRule","clipRule","CredentialNoticeWarningIcon","UpIcon","color","DownIcon","RequiredAttributeIcon"],"sources":["credential.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport Svg, { Path, SvgProps } from 'react-native-svg';\n\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\n// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=426-27862&m=dev\nexport const CredentialErrorIcon: FC<SvgProps> = ({ ...props }) => (\n <Svg fill=\"none\" height={22} viewBox=\"0 0 22 22\" width={22} {...props}>\n <Path\n d=\"M10.575 20a8.241 8.241 0 01-3.312-.672 8.649 8.649 0 01-2.74-1.851 8.837 8.837 0 01-1.85-2.74A8.242 8.242 0 012 11.425c0-1.173.224-2.277.672-3.312a8.793 8.793 0 014.582-4.59 8.243 8.243 0 013.312-.672c1.18 0 2.286.224 3.32.672a8.766 8.766 0 012.74 1.86 8.667 8.667 0 011.86 2.73 8.243 8.243 0 01.672 3.312 8.243 8.243 0 01-.673 3.312 8.768 8.768 0 01-4.598 4.59 8.241 8.241 0 01-3.312.673z\"\n fill=\"#D90D0D\"\n />\n <Path\n d=\"M3.814 18.181l.002.003c.882.881 1.9 1.57 3.051 2.062a9.242 9.242 0 003.708.754c1.303 0 2.542-.25 3.707-.754a9.766 9.766 0 005.12-5.111 9.244 9.244 0 00.756-3.71c0-1.304-.25-2.544-.755-3.71a9.666 9.666 0 00-2.071-3.041 9.765 9.765 0 00-3.048-2.069 9.263 9.263 0 00-3.718-.754c-1.304 0-2.544.25-3.71.754v.001a9.793 9.793 0 00-5.101 5.11A9.242 9.242 0 001 11.426c0 1.304.25 2.543.755 3.709a9.836 9.836 0 002.059 3.046z\"\n stroke=\"#fff\"\n strokeOpacity={0.2}\n strokeWidth={2}\n />\n <Path\n d=\"M8.433 14.712a.822.822 0 01-.58.225.773.773 0 01-.557-.225.773.773 0 01-.224-.556c0-.216.077-.398.232-.548l2.167-2.174-2.167-2.159a.768.768 0 01-.232-.547c0-.227.074-.413.224-.557a.773.773 0 01.556-.224c.216 0 .401.072.556.216l2.175 2.167 2.183-2.167a.759.759 0 01.556-.232c.216 0 .399.077.548.232.155.15.232.332.232.548 0 .21-.077.396-.232.556l-2.175 2.167 2.167 2.166c.155.144.232.33.232.556a.759.759 0 01-.232.556.755.755 0 01-.556.225.765.765 0 01-.565-.225l-2.158-2.166-2.15 2.166z\"\n fill=\"#fff\"\n />\n </Svg>\n);\n\n// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=415-5641&m=dev\nexport const CredentialWarningIcon: FC<SvgProps> = ({ ...props }) => (\n <Svg fill=\"none\" height={20} viewBox=\"0 0 22 20\" width={22} {...props}>\n <Path\n d=\"M4.357 17.967c-.481 0-.899-.105-1.253-.315a2.196 2.196 0 01-.822-.847A2.473 2.473 0 012 15.627c0-.421.11-.822.332-1.204L8.757 3.225c.216-.393.506-.689.871-.888a2.36 2.36 0 011.146-.299c.398 0 .777.1 1.137.299.36.194.653.49.88.888l6.425 11.198a2.384 2.384 0 01.332 1.204c0 .431-.097.824-.29 1.178a2.196 2.196 0 01-.822.847c-.35.21-.764.315-1.246.315H4.357z\"\n fill=\"#F7BF0B\"\n />\n <Path\n d=\"M1.4 17.274h-.001l.006.011c.281.515.683.927 1.188 1.227.534.316 1.134.455 1.764.455H17.19c.63 0 1.229-.138 1.759-.457.504-.3.905-.711 1.186-1.225.28-.512.413-1.071.413-1.659a3.345 3.345 0 00-.467-1.705L13.66 2.73v-.002a3.226 3.226 0 00-1.27-1.27 3.312 3.312 0 00-1.616-.42 3.36 3.36 0 00-1.624.42 3.172 3.172 0 00-1.265 1.276L1.467 13.92l-.001.002A3.364 3.364 0 001 15.627c0 .582.128 1.138.4 1.647z\"\n stroke=\"#fff\"\n strokeOpacity={0.2}\n strokeWidth={2}\n />\n <Path\n d=\"M11.538 11.51c-.011.514-.263.771-.756.771-.503 0-.763-.254-.78-.763l-.116-4.184a.766.766 0 01.232-.614c.166-.166.385-.25.656-.25.266 0 .484.084.656.25.171.16.252.368.24.622l-.132 4.167zM11.496 14.871c-.2.177-.437.266-.714.266-.277 0-.517-.089-.722-.266a.87.87 0 01-.299-.68c0-.272.1-.499.3-.681.198-.183.439-.274.721-.274.277 0 .515.091.714.274.2.182.299.41.299.68a.87.87 0 01-.299.681z\"\n fill=\"#000\"\n />\n </Svg>\n);\n\n// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=542-90920&m=dev\nexport const CredentialNoticInfoIcon: FC<SvgProps> = ({ ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg width={24} height={24} viewBox=\"0 0 24 24\" fill=\"none\" {...props}>\n <Path\n d=\"M12.36 10.732c.111 0 .2.09.2.2V15.8a.2.2 0 01-.2.2h-.66a.2.2 0 01-.2-.2v-4.868c0-.11.09-.2.2-.2h.66zM11.5 8.2c0-.11.09-.2.2-.2h.66c.111 0 .2.09.2.2v.699a.2.2 0 01-.2.2h-.66a.2.2 0 01-.2-.2V8.2z\"\n fill={colorScheme.text}\n />\n <Path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 19a7 7 0 100-14 7 7 0 000 14zm0 1a8 8 0 100-16 8 8 0 000 16z\"\n fill={colorScheme.text}\n />\n </Svg>\n );\n};\n\n// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=542-93002&m=dev\nexport const CredentialNoticeWarningIcon: FC<SvgProps> = ({ ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg width={24} height={24} viewBox=\"0 0 24 24\" fill=\"none\" {...props}>\n <Path\n d=\"M12.36 13.268a.2.2 0 00.2-.2V8.2a.2.2 0 00-.2-.2h-.66a.2.2 0 00-.2.2v4.868c0 .11.09.2.2.2h.66zM11.5 15.8c0 .11.09.2.2.2h.66a.2.2 0 00.2-.2v-.699a.2.2 0 00-.2-.2h-.66a.2.2 0 00-.2.2v.699z\"\n fill={colorScheme.text}\n />\n <Path\n d=\"M9.835 6.75c.962-1.667 3.368-1.667 4.33 0l4.33 7.5c.962 1.667-.24 3.75-2.165 3.75H7.67c-1.925 0-3.127-2.083-2.165-3.75l4.33-7.5z\"\n stroke={colorScheme.text}\n />\n </Svg>\n );\n};\n\n// https://www.figma.com/file/S3WwgTMHuqxAsfu5zElCzq/App-Icon-Library-(Design)?type=design&node-id=41-478&t=yVRMjIPtDiBwq5Ax-4\nexport const UpIcon: FC<SvgProps> = ({ color, ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg fill=\"none\" height={24} viewBox=\"0 0 24 24\" width={24} {...props}>\n <Path\n d=\"M5.60988 14.8705C5.53977 14.805 5.5 14.7135 5.5 14.6177C5.5 14.522 5.53977 14.4305 5.60988 14.3649L11.4841 8.5L17.4018 14.3649C17.5327 14.5082 17.5327 14.7272 17.4018 14.8705L16.8796 15.3906C16.8138 15.4604 16.722 15.5 16.6258 15.5C16.5297 15.5 16.4378 15.4604 16.372 15.3906L11.5131 10.5513L6.62518 15.3906C6.55937 15.4604 6.46751 15.5 6.37135 15.5C6.2752 15.5 6.18333 15.4604 6.11753 15.3906L5.60988 14.8705Z\"\n fill={color ?? colorScheme.text}\n />\n </Svg>\n );\n};\n\n// https://www.figma.com/file/S3WwgTMHuqxAsfu5zElCzq/App-Icon-Library-(Design)?type=design&node-id=41-477&t=yVRMjIPtDiBwq5Ax-4\nexport const DownIcon: FC<SvgProps> = ({ color, ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg fill=\"none\" height={24} viewBox=\"0 0 24 24\" width={24} {...props}>\n <Path\n d=\"M17.8901 9.12948C17.9602 9.19502 18 9.28652 18 9.38228C18 9.47804 17.9602 9.56954 17.8901 9.63508L12.0159 15.5L6.09821 9.63508C5.96726 9.49178 5.96726 9.27278 6.09821 9.12948L6.62036 8.60944C6.68616 8.53961 6.77803 8.5 6.87418 8.5C6.97034 8.5 7.06221 8.53961 7.12801 8.60944L11.9869 13.4487L16.8748 8.60944C16.9406 8.53961 17.0325 8.5 17.1286 8.5C17.2248 8.5 17.3167 8.53961 17.3825 8.60944L17.8901 9.12948Z\"\n fill={color ?? colorScheme.text}\n />\n </Svg>\n );\n};\n\nexport const RequiredAttributeIcon: FC<SvgProps> = ({ color, ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg fill=\"none\" height={24} viewBox=\"0 0 24 24\" width={24} {...props}>\n <Path\n d=\"M16.767 8.11a.432.432 0 00-.576 0l-6.013 5.941-3.109-3.149-.001-.001a.411.411 0 00-.576 0l-.375.364-.007.008a.432.432 0 000 .576l4.065 4.098 6.963-6.878.005-.005a.421.421 0 000-.568l-.368-.38-.008-.006z\"\n fill={color ?? colorScheme.text}\n />\n </Svg>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAc,OA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N,KAAK,gBACnEL,KAAA,CAAAM,aAAA,CAACJ,IAAI;IACHU,CAAC,EAAC,4MAA4M;IAC9MJ,IAAI,EAAEgB,KAAK,aAALA,KAAK,cAALA,KAAK,GAAIN,WAAW,CAACC;EAAK,CACjC,CACE,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Svg","Path","useAppColorScheme","CredentialErrorIcon","props","createElement","_extends","fill","height","viewBox","width","d","stroke","strokeOpacity","strokeWidth","CredentialWarningIcon","CredentialNoticeInfoIcon","colorScheme","text","fillRule","clipRule","CredentialNoticeWarningIcon","UpIcon","color","DownIcon","RequiredAttributeIcon"],"sources":["credential.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport Svg, { Path, SvgProps } from 'react-native-svg';\n\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\n// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=426-27862&m=dev\nexport const CredentialErrorIcon: FC<SvgProps> = ({ ...props }) => (\n <Svg fill=\"none\" height={22} viewBox=\"0 0 22 22\" width={22} {...props}>\n <Path\n d=\"M10.575 20a8.241 8.241 0 01-3.312-.672 8.649 8.649 0 01-2.74-1.851 8.837 8.837 0 01-1.85-2.74A8.242 8.242 0 012 11.425c0-1.173.224-2.277.672-3.312a8.793 8.793 0 014.582-4.59 8.243 8.243 0 013.312-.672c1.18 0 2.286.224 3.32.672a8.766 8.766 0 012.74 1.86 8.667 8.667 0 011.86 2.73 8.243 8.243 0 01.672 3.312 8.243 8.243 0 01-.673 3.312 8.768 8.768 0 01-4.598 4.59 8.241 8.241 0 01-3.312.673z\"\n fill=\"#D90D0D\"\n />\n <Path\n d=\"M3.814 18.181l.002.003c.882.881 1.9 1.57 3.051 2.062a9.242 9.242 0 003.708.754c1.303 0 2.542-.25 3.707-.754a9.766 9.766 0 005.12-5.111 9.244 9.244 0 00.756-3.71c0-1.304-.25-2.544-.755-3.71a9.666 9.666 0 00-2.071-3.041 9.765 9.765 0 00-3.048-2.069 9.263 9.263 0 00-3.718-.754c-1.304 0-2.544.25-3.71.754v.001a9.793 9.793 0 00-5.101 5.11A9.242 9.242 0 001 11.426c0 1.304.25 2.543.755 3.709a9.836 9.836 0 002.059 3.046z\"\n stroke=\"#fff\"\n strokeOpacity={0.2}\n strokeWidth={2}\n />\n <Path\n d=\"M8.433 14.712a.822.822 0 01-.58.225.773.773 0 01-.557-.225.773.773 0 01-.224-.556c0-.216.077-.398.232-.548l2.167-2.174-2.167-2.159a.768.768 0 01-.232-.547c0-.227.074-.413.224-.557a.773.773 0 01.556-.224c.216 0 .401.072.556.216l2.175 2.167 2.183-2.167a.759.759 0 01.556-.232c.216 0 .399.077.548.232.155.15.232.332.232.548 0 .21-.077.396-.232.556l-2.175 2.167 2.167 2.166c.155.144.232.33.232.556a.759.759 0 01-.232.556.755.755 0 01-.556.225.765.765 0 01-.565-.225l-2.158-2.166-2.15 2.166z\"\n fill=\"#fff\"\n />\n </Svg>\n);\n\n// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=415-5641&m=dev\nexport const CredentialWarningIcon: FC<SvgProps> = ({ ...props }) => (\n <Svg fill=\"none\" height={20} viewBox=\"0 0 22 20\" width={22} {...props}>\n <Path\n d=\"M4.357 17.967c-.481 0-.899-.105-1.253-.315a2.196 2.196 0 01-.822-.847A2.473 2.473 0 012 15.627c0-.421.11-.822.332-1.204L8.757 3.225c.216-.393.506-.689.871-.888a2.36 2.36 0 011.146-.299c.398 0 .777.1 1.137.299.36.194.653.49.88.888l6.425 11.198a2.384 2.384 0 01.332 1.204c0 .431-.097.824-.29 1.178a2.196 2.196 0 01-.822.847c-.35.21-.764.315-1.246.315H4.357z\"\n fill=\"#F7BF0B\"\n />\n <Path\n d=\"M1.4 17.274h-.001l.006.011c.281.515.683.927 1.188 1.227.534.316 1.134.455 1.764.455H17.19c.63 0 1.229-.138 1.759-.457.504-.3.905-.711 1.186-1.225.28-.512.413-1.071.413-1.659a3.345 3.345 0 00-.467-1.705L13.66 2.73v-.002a3.226 3.226 0 00-1.27-1.27 3.312 3.312 0 00-1.616-.42 3.36 3.36 0 00-1.624.42 3.172 3.172 0 00-1.265 1.276L1.467 13.92l-.001.002A3.364 3.364 0 001 15.627c0 .582.128 1.138.4 1.647z\"\n stroke=\"#fff\"\n strokeOpacity={0.2}\n strokeWidth={2}\n />\n <Path\n d=\"M11.538 11.51c-.011.514-.263.771-.756.771-.503 0-.763-.254-.78-.763l-.116-4.184a.766.766 0 01.232-.614c.166-.166.385-.25.656-.25.266 0 .484.084.656.25.171.16.252.368.24.622l-.132 4.167zM11.496 14.871c-.2.177-.437.266-.714.266-.277 0-.517-.089-.722-.266a.87.87 0 01-.299-.68c0-.272.1-.499.3-.681.198-.183.439-.274.721-.274.277 0 .515.091.714.274.2.182.299.41.299.68a.87.87 0 01-.299.681z\"\n fill=\"#000\"\n />\n </Svg>\n);\n\n// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=542-90920&m=dev\nexport const CredentialNoticeInfoIcon: FC<SvgProps> = ({ ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg width={24} height={24} viewBox=\"0 0 24 24\" fill=\"none\" {...props}>\n <Path\n d=\"M12.36 10.732c.111 0 .2.09.2.2V15.8a.2.2 0 01-.2.2h-.66a.2.2 0 01-.2-.2v-4.868c0-.11.09-.2.2-.2h.66zM11.5 8.2c0-.11.09-.2.2-.2h.66c.111 0 .2.09.2.2v.699a.2.2 0 01-.2.2h-.66a.2.2 0 01-.2-.2V8.2z\"\n fill={colorScheme.text}\n />\n <Path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 19a7 7 0 100-14 7 7 0 000 14zm0 1a8 8 0 100-16 8 8 0 000 16z\"\n fill={colorScheme.text}\n />\n </Svg>\n );\n};\n\n// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=542-93002&m=dev\nexport const CredentialNoticeWarningIcon: FC<SvgProps> = ({ ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg width={24} height={24} viewBox=\"0 0 24 24\" fill=\"none\" {...props}>\n <Path\n d=\"M12.36 13.268a.2.2 0 00.2-.2V8.2a.2.2 0 00-.2-.2h-.66a.2.2 0 00-.2.2v4.868c0 .11.09.2.2.2h.66zM11.5 15.8c0 .11.09.2.2.2h.66a.2.2 0 00.2-.2v-.699a.2.2 0 00-.2-.2h-.66a.2.2 0 00-.2.2v.699z\"\n fill={colorScheme.text}\n />\n <Path\n d=\"M9.835 6.75c.962-1.667 3.368-1.667 4.33 0l4.33 7.5c.962 1.667-.24 3.75-2.165 3.75H7.67c-1.925 0-3.127-2.083-2.165-3.75l4.33-7.5z\"\n stroke={colorScheme.text}\n />\n </Svg>\n );\n};\n\n// https://www.figma.com/file/S3WwgTMHuqxAsfu5zElCzq/App-Icon-Library-(Design)?type=design&node-id=41-478&t=yVRMjIPtDiBwq5Ax-4\nexport const UpIcon: FC<SvgProps> = ({ color, ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg fill=\"none\" height={24} viewBox=\"0 0 24 24\" width={24} {...props}>\n <Path\n d=\"M5.60988 14.8705C5.53977 14.805 5.5 14.7135 5.5 14.6177C5.5 14.522 5.53977 14.4305 5.60988 14.3649L11.4841 8.5L17.4018 14.3649C17.5327 14.5082 17.5327 14.7272 17.4018 14.8705L16.8796 15.3906C16.8138 15.4604 16.722 15.5 16.6258 15.5C16.5297 15.5 16.4378 15.4604 16.372 15.3906L11.5131 10.5513L6.62518 15.3906C6.55937 15.4604 6.46751 15.5 6.37135 15.5C6.2752 15.5 6.18333 15.4604 6.11753 15.3906L5.60988 14.8705Z\"\n fill={color ?? colorScheme.text}\n />\n </Svg>\n );\n};\n\n// https://www.figma.com/file/S3WwgTMHuqxAsfu5zElCzq/App-Icon-Library-(Design)?type=design&node-id=41-477&t=yVRMjIPtDiBwq5Ax-4\nexport const DownIcon: FC<SvgProps> = ({ color, ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg fill=\"none\" height={24} viewBox=\"0 0 24 24\" width={24} {...props}>\n <Path\n d=\"M17.8901 9.12948C17.9602 9.19502 18 9.28652 18 9.38228C18 9.47804 17.9602 9.56954 17.8901 9.63508L12.0159 15.5L6.09821 9.63508C5.96726 9.49178 5.96726 9.27278 6.09821 9.12948L6.62036 8.60944C6.68616 8.53961 6.77803 8.5 6.87418 8.5C6.97034 8.5 7.06221 8.53961 7.12801 8.60944L11.9869 13.4487L16.8748 8.60944C16.9406 8.53961 17.0325 8.5 17.1286 8.5C17.2248 8.5 17.3167 8.53961 17.3825 8.60944L17.8901 9.12948Z\"\n fill={color ?? colorScheme.text}\n />\n </Svg>\n );\n};\n\nexport const RequiredAttributeIcon: FC<SvgProps> = ({ color, ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg fill=\"none\" height={24} viewBox=\"0 0 24 24\" width={24} {...props}>\n <Path\n d=\"M16.767 8.11a.432.432 0 00-.576 0l-6.013 5.941-3.109-3.149-.001-.001a.411.411 0 00-.576 0l-.375.364-.007.008a.432.432 0 000 .576l4.065 4.098 6.963-6.878.005-.005a.421.421 0 000-.568l-.368-.38-.008-.006z\"\n fill={color ?? colorScheme.text}\n />\n </Svg>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,OAAOC,GAAG,IAAIC,IAAI,QAAkB,kBAAkB;AAEtD,SAASC,iBAAiB,QAAQ,+BAA+B;;AAEjE;AACA,OAAO,MAAMC,mBAAiC,GAAGA,CAAC;EAAE,GAAGC;AAAM,CAAC,kBAC5DL,KAAA,CAAAM,aAAA,CAACL,GAAG,EAAAM,QAAA;EAACC,IAAI,EAAC,MAAM;EAACC,MAAM,EAAE,EAAG;EAACC,OAAO,EAAC,WAAW;EAACC,KAAK,EAAE;AAAG,GAAKN,KAAK,gBACnEL,KAAA,CAAAM,aAAA,CAACJ,IAAI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