@procivis/one-react-native-components 0.3.53 → 0.3.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/credential/credential.js +6 -3
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item-icon.js +3 -1
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/history/history-list-screen.js +2 -2
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
- package/lib/commonjs/components/proof-request/select-credential.js +7 -3
- package/lib/commonjs/components/proof-request/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential.js +6 -9
- package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/index.js +7 -0
- package/lib/commonjs/ui-components/buttons/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/share-button.js +54 -0
- package/lib/commonjs/ui-components/buttons/share-button.js.map +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-card.js +14 -29
- package/lib/commonjs/ui-components/credential/card/credential-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +27 -28
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +10 -6
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/header/header.js +7 -5
- package/lib/commonjs/ui-components/header/header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-details.js +3 -1
- package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
- package/lib/commonjs/ui-components/icons/icons.js +123 -1
- package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
- package/lib/commonjs/ui-components/index.js +11 -0
- package/lib/commonjs/ui-components/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/loading-result.js +8 -1
- package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
- package/lib/commonjs/ui-components/nfc/index.js +14 -0
- package/lib/commonjs/ui-components/nfc/index.js.map +1 -0
- package/lib/commonjs/ui-components/nfc/nfc-process.js +77 -0
- package/lib/commonjs/ui-components/nfc/nfc-process.js.map +1 -0
- package/lib/commonjs/ui-components/screens/section-list-screen.js +20 -5
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/animated-search-bar.js +10 -8
- package/lib/commonjs/ui-components/searchbar/animated-search-bar.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +2 -1
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +4 -4
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +13 -3
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/index.js +11 -0
- package/lib/commonjs/utils/hooks/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/nfc/nfc-status.js +40 -0
- package/lib/commonjs/utils/hooks/nfc/nfc-status.js.map +1 -0
- package/lib/commonjs/utils/index.js +12 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +18 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +1 -1
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/commonjs/utils/url.js +80 -0
- package/lib/commonjs/utils/url.js.map +1 -0
- package/lib/module/components/credential/credential.js +5 -3
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +3 -1
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/history/history-list-screen.js +2 -2
- package/lib/module/components/history/history-list-screen.js.map +1 -1
- package/lib/module/components/proof-request/select-credential.js +5 -2
- package/lib/module/components/proof-request/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/share-credential.js +7 -10
- package/lib/module/components/proof-request/share-credential.js.map +1 -1
- package/lib/module/ui-components/buttons/index.js +2 -1
- package/lib/module/ui-components/buttons/index.js.map +1 -1
- package/lib/module/ui-components/buttons/share-button.js +47 -0
- package/lib/module/ui-components/buttons/share-button.js.map +1 -0
- package/lib/module/ui-components/credential/card/credential-card.js +15 -30
- package/lib/module/ui-components/credential/card/credential-card.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +27 -28
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-list-item.js +10 -6
- package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/module/ui-components/header/header.js +7 -5
- package/lib/module/ui-components/header/header.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +4 -2
- package/lib/module/ui-components/history/history-details.js.map +1 -1
- package/lib/module/ui-components/icons/icons.js +117 -0
- package/lib/module/ui-components/icons/icons.js.map +1 -1
- package/lib/module/ui-components/index.js +1 -0
- package/lib/module/ui-components/index.js.map +1 -1
- package/lib/module/ui-components/loader/loading-result.js +8 -1
- package/lib/module/ui-components/loader/loading-result.js.map +1 -1
- package/lib/module/ui-components/nfc/index.js +3 -0
- package/lib/module/ui-components/nfc/index.js.map +1 -0
- package/lib/module/ui-components/nfc/nfc-process.js +69 -0
- package/lib/module/ui-components/nfc/nfc-process.js.map +1 -0
- package/lib/module/ui-components/screens/section-list-screen.js +21 -6
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/module/ui-components/searchbar/animated-search-bar.js +10 -8
- package/lib/module/ui-components/searchbar/animated-search-bar.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +1 -1
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +1 -0
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +4 -4
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +12 -2
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/index.js +1 -0
- package/lib/module/utils/hooks/index.js.map +1 -1
- package/lib/module/utils/hooks/nfc/nfc-status.js +32 -0
- package/lib/module/utils/hooks/nfc/nfc-status.js.map +1 -0
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +18 -1
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js +1 -1
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/module/utils/url.js +71 -0
- package/lib/module/utils/url.js.map +1 -0
- package/lib/typescript/components/proof-request/share-credential.d.ts +4 -5
- package/lib/typescript/ui-components/buttons/index.d.ts +3 -1
- package/lib/typescript/ui-components/buttons/share-button.d.ts +10 -0
- package/lib/typescript/ui-components/credential/card/credential-card.d.ts +1 -0
- package/lib/typescript/ui-components/header/header.d.ts +1 -1
- package/lib/typescript/ui-components/icons/icons.d.ts +5 -0
- package/lib/typescript/ui-components/index.d.ts +1 -0
- package/lib/typescript/ui-components/loader/loading-result.d.ts +2 -0
- package/lib/typescript/ui-components/nfc/index.d.ts +2 -0
- package/lib/typescript/ui-components/nfc/nfc-process.d.ts +17 -0
- package/lib/typescript/ui-components/screens/section-list-screen.d.ts +2 -1
- package/lib/typescript/ui-components/searchbar/animated-search-bar.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/backup.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/core-init.d.ts +2 -1
- package/lib/typescript/utils/hooks/core/credentials.d.ts +2 -6
- package/lib/typescript/utils/hooks/core/proofs.d.ts +9 -1
- package/lib/typescript/utils/hooks/index.d.ts +1 -0
- package/lib/typescript/utils/hooks/nfc/nfc-status.d.ts +6 -0
- package/lib/typescript/utils/index.d.ts +1 -0
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +6 -6
- package/lib/typescript/utils/parsers/credential.d.ts +6 -3
- package/lib/typescript/utils/url.d.ts +19 -0
- package/package.json +7 -3
- package/src/components/credential/credential.tsx +4 -2
- package/src/components/history/history-list-item-icon.tsx +2 -0
- package/src/components/history/history-list-screen.tsx +9 -7
- package/src/components/proof-request/select-credential.tsx +4 -2
- package/src/components/proof-request/share-credential.tsx +10 -10
- package/src/ui-components/buttons/index.ts +4 -0
- package/src/ui-components/buttons/share-button.stories.tsx +25 -0
- package/src/ui-components/buttons/share-button.tsx +55 -0
- package/src/ui-components/credential/card/credential-card.stories.tsx +14 -2
- package/src/ui-components/credential/card/credential-card.tsx +16 -23
- package/src/ui-components/credential/card/credential-details-card.stories.tsx +14 -4
- package/src/ui-components/credential/card/credential-details-card.tsx +32 -34
- package/src/ui-components/credential/card/credential-details-list-item.tsx +10 -6
- package/src/ui-components/detail/detail.stories.tsx +3 -3
- package/src/ui-components/header/header.stories.tsx +8 -6
- package/src/ui-components/header/header.tsx +7 -5
- package/src/ui-components/history/history-details.tsx +3 -1
- package/src/ui-components/icons/icons.tsx +107 -0
- package/src/ui-components/index.ts +1 -0
- package/src/ui-components/loader/loading-result.stories.tsx +4 -1
- package/src/ui-components/loader/loading-result.tsx +7 -0
- package/src/ui-components/nfc/index.ts +3 -0
- package/src/ui-components/nfc/nfc-process.tsx +80 -0
- package/src/ui-components/screens/section-list-screen.tsx +21 -4
- package/src/ui-components/searchbar/animated-search-bar.tsx +11 -9
- package/src/utils/hooks/core/backup.ts +5 -2
- package/src/utils/hooks/core/core-init.ts +5 -1
- package/src/utils/hooks/core/credentials.ts +3 -3
- package/src/utils/hooks/core/proofs.ts +20 -5
- package/src/utils/hooks/index.ts +1 -0
- package/src/utils/hooks/nfc/nfc-status.ts +31 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/parsers/credential-sharing.tsx +34 -11
- package/src/utils/parsers/credential.ts +8 -4
- package/src/utils/parsers/query.ts +1 -0
- package/src/utils/url.ts +61 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_testID","_accessibilityHistoryWrappers","_blurView","_interopRequireDefault","_imageOrComponent","_typography","_colorSchemeContext","_credentialHeader","_credentialImageCarousel","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","CredentialCardShadow","exports","shadowColor","shadowOffset","height","width","shadowOpacity","shadowRadius","CredentialCardRatio","CredentialCard","cardCarouselImages","cardImage","color","credentialId","header","notice","onCardPress","onHeaderPress","style","testID","_header$color","colorScheme","useAppColorScheme","tappableHeaderHeight","setTappableHeaderHeight","useState","cardSize","setCardSize","onCardLayoutChange","useCallback","event","nativeEvent","layout","onHeaderLayoutChange","headerPressHandler","cardPressHandler","noticeIconView","useMemo","noticeIcon","undefined","React","isValidElement","NoticeIconComponent","createElement","shouldShowCarousel","View","onLayout","styles","card","Image","concatTestID","source","imageSource","image","String","backgroundColor","TouchableOpacity","cardButton","onPress","marginTop","imagesToRender","carouselSize","activeOpacity","disabled","blurStyle","noticeTextWrapper","text","preset","noticeText","StyleSheet","create","borderRadius","overflow","position","aspectRatio","top","bottom","columnGap","flexDirection","justifyContent","paddingBottom","paddingHorizontal","paddingTop","marginVertical","flex","_default"],"sources":["credential-card.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo, useState } from 'react';\nimport { ColorValue, Image, LayoutChangeEvent, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { TouchableOpacity } from '../../accessibility/accessibilityHistoryWrappers';\nimport BlurView from '../../blur/blur-view';\nimport ImageOrComponent, { ImageOrComponentSource } from '../../image/image-or-component';\nimport Typography from '../../text/typography';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialHeader, { CredentialHeaderProps } from './credential-header';\nimport CarouselComponent, { CarouselImage } from './credential-image-carousel';\n\nexport const CredentialCardShadow: Pick<ViewStyle, 'shadowColor' | 'shadowOffset' | 'shadowOpacity' | 'shadowRadius'> =\n {\n shadowColor: '#10274226',\n shadowOffset: {\n height: 5,\n width: 0,\n },\n shadowOpacity: 1,\n shadowRadius: 7,\n };\n\nexport const CredentialCardRatio = 18 / 11;\n\nexport type CredentialCardNotice = {\n text: string;\n noticeIcon?: React.ComponentType<any> | React.ReactElement;\n};\n\nexport type CredentialCardProps = {\n cardCarouselImages?: CarouselImage[];\n cardImage?: ImageOrComponentSource;\n color?: ColorValue;\n credentialId?: string;\n header: CredentialHeaderProps;\n notice?: CredentialCardNotice;\n onCardPress?: (credentialId?: string) => void;\n onHeaderPress?: (credentialId?: string) => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n};\n\nconst CredentialCard: FC<CredentialCardProps> = ({\n cardCarouselImages = [],\n cardImage,\n color = '#5A69F3',\n credentialId,\n header,\n notice,\n onCardPress,\n onHeaderPress,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const [tappableHeaderHeight, setTappableHeaderHeight] = useState<number>();\n const [cardSize, setCardSize] = useState<{ height: number; width: number }>();\n\n const onCardLayoutChange = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setCardSize({ width, height });\n }, []);\n\n const onHeaderLayoutChange = useCallback((event: LayoutChangeEvent) => {\n setTappableHeaderHeight(event.nativeEvent.layout.height);\n }, []);\n\n const headerPressHandler = useCallback(() => {\n onHeaderPress?.(credentialId);\n }, [credentialId, onHeaderPress]);\n\n const cardPressHandler = useCallback(() => {\n onCardPress?.(credentialId);\n }, [credentialId, onCardPress]);\n\n const noticeIconView: React.ReactElement | undefined = useMemo(() => {\n if (!notice?.noticeIcon) {\n return undefined;\n }\n if (React.isValidElement(notice.noticeIcon)) {\n return notice.noticeIcon;\n } else {\n const NoticeIconComponent = notice.noticeIcon as React.ComponentType<any>;\n return <NoticeIconComponent />;\n }\n }, [notice?.noticeIcon]);\n\n const shouldShowCarousel = cardSize?.width && cardSize.height;\n return (\n <View onLayout={onCardLayoutChange} style={[styles.card, style]} testID={testID}>\n {cardImage ? (\n 'imageSource' in cardImage ? (\n <View style={styles.cardImage}>\n <Image testID={concatTestID(testID, 'imageSource')} source={cardImage.imageSource} style={styles.image} />\n </View>\n ) : (\n <ImageOrComponent testID={concatTestID(testID, 'cardImage')} source={cardImage} style={styles.cardImage} />\n )\n ) : (\n <View\n testID={concatTestID(testID, 'cardBackgroundColor', String(color))}\n style={[styles.cardImage, { backgroundColor: color }]}\n />\n )}\n {onCardPress && <TouchableOpacity style={styles.cardButton} onPress={cardPressHandler} />}\n {shouldShowCarousel ? (\n <CarouselComponent\n style={{ marginTop: tappableHeaderHeight ?? 0 }}\n imagesToRender={cardCarouselImages ?? []}\n carouselSize={{\n width: cardSize.width,\n height: cardSize.height - (tappableHeaderHeight ?? 0),\n }}\n testID={concatTestID(testID, 'carousel')}\n />\n ) : null}\n <TouchableOpacity\n onLayout={onHeaderLayoutChange}\n activeOpacity={0.9}\n disabled={!onHeaderPress}\n onPress={headerPressHandler}\n style={styles.header}>\n <CredentialHeader {...header} color={header.color ?? color} testID={concatTestID(testID, 'header')} />\n </TouchableOpacity>\n {notice && (\n <BlurView blurStyle=\"soft\" style={[styles.notice]} testID={concatTestID(testID, 'notice')}>\n {noticeIconView && <View style={styles.noticeIcon}>{noticeIconView}</View>}\n <View style={styles.noticeTextWrapper}>\n <Typography\n color={colorScheme.text}\n preset=\"xs/line-height-small\"\n style={styles.noticeText}\n testID={concatTestID(testID, 'notice.text')}>\n {notice.text}\n </Typography>\n </View>\n </BlurView>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n card: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n cardButton: {\n height: '100%',\n position: 'absolute',\n width: '100%',\n },\n cardImage: {\n aspectRatio: CredentialCardRatio,\n width: '100%',\n },\n header: {\n position: 'absolute',\n top: 0,\n width: '100%',\n },\n image: {\n height: '100%',\n width: '100%',\n },\n notice: {\n bottom: 0,\n columnGap: 6,\n flexDirection: 'row',\n justifyContent: 'flex-start',\n paddingBottom: 6,\n paddingHorizontal: 12,\n paddingTop: 2,\n position: 'absolute',\n width: '100%',\n },\n noticeIcon: {\n marginTop: 4,\n },\n noticeText: {\n marginVertical: 5,\n },\n noticeTextWrapper: {\n flex: 1,\n },\n});\n\nexport default CredentialCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,6BAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,WAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAJ,sBAAA,CAAAL,OAAA;AACA,IAAAU,wBAAA,GAAAL,sBAAA,CAAAL,OAAA;AAA+E,SAAAK,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA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reactNative","_testID","_accessibilityHistoryWrappers","_blurView","_interopRequireDefault","_imageOrComponent","_typography","_colorSchemeContext","_credentialHeader","_credentialImageCarousel","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","CredentialCardShadow","exports","shadowColor","shadowOffset","height","width","shadowOpacity","shadowRadius","CredentialCardRatio","CredentialCard","cardCarouselImages","cardImage","color","credentialId","header","notice","onCardPress","onHeaderPress","style","testID","_header$color","colorScheme","useAppColorScheme","cardSize","Math","ceil","headerPressHandler","useCallback","cardPressHandler","noticeIconView","useMemo","noticeIcon","undefined","React","isValidElement","NoticeIconComponent","createElement","shouldShowCarousel","View","styles","card","Image","concatTestID","source","imageSource","image","String","backgroundColor","TouchableOpacity","cardButton","onPress","carousel","imagesToRender","carouselSize","activeOpacity","disabled","blurStyle","noticeTextWrapper","text","preset","noticeText","StyleSheet","create","borderRadius","overflow","position","marginTop","top","bottom","columnGap","flexDirection","justifyContent","paddingBottom","paddingHorizontal","paddingTop","marginVertical","flex","_default"],"sources":["credential-card.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo } from 'react';\nimport { ColorValue, Image, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { TouchableOpacity } from '../../accessibility/accessibilityHistoryWrappers';\nimport BlurView from '../../blur/blur-view';\nimport ImageOrComponent, { ImageOrComponentSource } from '../../image/image-or-component';\nimport Typography from '../../text/typography';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialHeader, { CredentialHeaderProps } from './credential-header';\nimport CarouselComponent, { CarouselImage } from './credential-image-carousel';\n\nexport const CredentialCardShadow: Pick<ViewStyle, 'shadowColor' | 'shadowOffset' | 'shadowOpacity' | 'shadowRadius'> =\n {\n shadowColor: '#10274226',\n shadowOffset: {\n height: 5,\n width: 0,\n },\n shadowOpacity: 1,\n shadowRadius: 7,\n };\n\nexport const CredentialCardRatio = 18 / 11;\n\nexport type CredentialCardNotice = {\n text: string;\n noticeIcon?: React.ComponentType<any> | React.ReactElement;\n};\n\nexport type CredentialCardProps = {\n cardCarouselImages?: CarouselImage[];\n cardImage?: ImageOrComponentSource;\n color?: ColorValue;\n credentialId?: string;\n header: CredentialHeaderProps;\n notice?: CredentialCardNotice;\n onCardPress?: (credentialId?: string) => void;\n onHeaderPress?: (credentialId?: string) => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n width: number;\n};\n\nconst CredentialCard: FC<CredentialCardProps> = ({\n cardCarouselImages = [],\n cardImage,\n color = '#5A69F3',\n credentialId,\n header,\n notice,\n onCardPress,\n onHeaderPress,\n style,\n testID,\n width,\n}) => {\n const colorScheme = useAppColorScheme();\n const cardSize = {\n width,\n height: Math.ceil(width / CredentialCardRatio),\n };\n\n const headerPressHandler = useCallback(() => {\n onHeaderPress?.(credentialId);\n }, [credentialId, onHeaderPress]);\n\n const cardPressHandler = useCallback(() => {\n onCardPress?.(credentialId);\n }, [credentialId, onCardPress]);\n\n const noticeIconView: React.ReactElement | undefined = useMemo(() => {\n if (!notice?.noticeIcon) {\n return undefined;\n }\n if (React.isValidElement(notice.noticeIcon)) {\n return notice.noticeIcon;\n } else {\n const NoticeIconComponent = notice.noticeIcon as React.ComponentType<any>;\n return <NoticeIconComponent />;\n }\n }, [notice?.noticeIcon]);\n\n const shouldShowCarousel = cardSize?.width && cardSize.height;\n return (\n <View style={[styles.card, cardSize, style]} testID={testID}>\n {cardImage ? (\n 'imageSource' in cardImage ? (\n <View style={cardSize}>\n <Image testID={concatTestID(testID, 'imageSource')} source={cardImage.imageSource} style={styles.image} />\n </View>\n ) : (\n <ImageOrComponent testID={concatTestID(testID, 'cardImage')} source={cardImage} style={cardSize} />\n )\n ) : (\n <View\n testID={concatTestID(testID, 'cardBackgroundColor', String(color))}\n style={[cardSize, { backgroundColor: color }]}\n />\n )}\n {onCardPress && <TouchableOpacity style={styles.cardButton} onPress={cardPressHandler} />}\n {shouldShowCarousel ? (\n <CarouselComponent\n style={styles.carousel}\n imagesToRender={cardCarouselImages ?? []}\n carouselSize={{\n width: cardSize.width,\n height: cardSize.height - 60,\n }}\n testID={concatTestID(testID, 'carousel')}\n />\n ) : null}\n <TouchableOpacity\n activeOpacity={0.9}\n disabled={!onHeaderPress}\n onPress={headerPressHandler}\n style={styles.header}>\n <CredentialHeader {...header} color={header.color ?? color} testID={concatTestID(testID, 'header')} />\n </TouchableOpacity>\n {notice && (\n <BlurView blurStyle=\"soft\" style={[styles.notice]} testID={concatTestID(testID, 'notice')}>\n {noticeIconView && <View style={styles.noticeIcon}>{noticeIconView}</View>}\n <View style={styles.noticeTextWrapper}>\n <Typography\n color={colorScheme.text}\n preset=\"xs/line-height-small\"\n style={styles.noticeText}\n testID={concatTestID(testID, 'notice.text')}>\n {notice.text}\n </Typography>\n </View>\n </BlurView>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n card: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n cardButton: {\n height: '100%',\n position: 'absolute',\n width: '100%',\n },\n carousel: {\n marginTop: 60,\n },\n header: {\n position: 'absolute',\n top: 0,\n width: '100%',\n },\n image: {\n height: '100%',\n width: '100%',\n },\n notice: {\n bottom: 0,\n columnGap: 6,\n flexDirection: 'row',\n justifyContent: 'flex-start',\n paddingBottom: 6,\n paddingHorizontal: 12,\n paddingTop: 2,\n position: 'absolute',\n width: '100%',\n },\n noticeIcon: {\n marginTop: 4,\n },\n noticeText: {\n marginVertical: 5,\n },\n noticeTextWrapper: {\n flex: 1,\n },\n});\n\nexport default CredentialCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,6BAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAC,sBAAA,CAAA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,EAAEqB,MAAM,CAACqB,UAAW;IACzBzC,MAAM,EAAE,IAAAuB,oBAAY,EAACvB,MAAM,EAAE,aAAa;EAAE,GAC3CJ,MAAM,CAAC2C,IACE,CACR,CACE,CAER,CAAC;AAEX,CAAC;AAED,MAAMnB,MAAM,GAAGsB,uBAAU,CAACC,MAAM,CAAC;EAC/BtB,IAAI,EAAE;IACJuB,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDf,UAAU,EAAE;IACV7C,MAAM,EAAE,MAAM;IACd6D,QAAQ,EAAE,UAAU;IACpB5D,KAAK,EAAE;EACT,CAAC;EACD8C,QAAQ,EAAE;IACRe,SAAS,EAAE;EACb,CAAC;EACDpD,MAAM,EAAE;IACNmD,QAAQ,EAAE,UAAU;IACpBE,GAAG,EAAE,CAAC;IACN9D,KAAK,EAAE;EACT,CAAC;EACDwC,KAAK,EAAE;IACLzC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACT,CAAC;EACDU,MAAM,EAAE;IACNqD,MAAM,EAAE,CAAC;IACTC,SAAS,EAAE,CAAC;IACZC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,YAAY;IAC5BC,aAAa,EAAE,CAAC;IAChBC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE,CAAC;IACbT,QAAQ,EAAE,UAAU;IACpB5D,KAAK,EAAE;EACT,CAAC;EACD0B,UAAU,EAAE;IACVmC,SAAS,EAAE;EACb,CAAC;EACDN,UAAU,EAAE;IACVe,cAAc,EAAE;EAClB,CAAC;EACDlB,iBAAiB,EAAE;IACjBmB,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAA5E,OAAA,CAAAzB,OAAA,GAEYiC,cAAc","ignoreList":[]}
|
|
@@ -12,12 +12,13 @@ var _buttons = require("../../buttons");
|
|
|
12
12
|
var _credential = require("../../icons/credential");
|
|
13
13
|
var _colorSchemeContext = require("../../theme/color-scheme-context");
|
|
14
14
|
var _credentialAttributeItem = _interopRequireDefault(require("../credential-attribute-item"));
|
|
15
|
-
var _credentialCard =
|
|
15
|
+
var _credentialCard = _interopRequireWildcard(require("./credential-card"));
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
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); }
|
|
20
20
|
const PREVIEW_ATTRIBUTES_COUNT = 3;
|
|
21
|
+
const SEE_ALL_BUTTON_HEIGHT = 78;
|
|
21
22
|
const CredentialDetailsCard = ({
|
|
22
23
|
animate = true,
|
|
23
24
|
attributes,
|
|
@@ -35,17 +36,12 @@ const CredentialDetailsCard = ({
|
|
|
35
36
|
const colorScheme = (0, _colorSchemeContext.useAppColorScheme)();
|
|
36
37
|
const [previewAttributesHeight, setPreviewAttributesHeight] = (0, _react.useState)();
|
|
37
38
|
const [fullAttributesHeight, setFullAttributesHeight] = (0, _react.useState)();
|
|
38
|
-
const [buttonViewHeight, setButtonViewHeight] = (0, _react.useState)();
|
|
39
39
|
const [allAttributesRendered, setAllAttributesRendered] = (0, _react.useState)(attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT || !showAllButtonLabel);
|
|
40
40
|
const CaretIcon = expanded ? _credential.UpIcon : _credential.DownIcon;
|
|
41
|
+
const cardHeight = Math.ceil(card.width / _credentialCard.CredentialCardRatio);
|
|
41
42
|
const currentHeight = (0, _reactNativeReanimated.useSharedValue)(undefined);
|
|
42
43
|
const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];
|
|
43
44
|
const extraAttributes = (0, _react.useMemo)(() => attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : [], [attributes]);
|
|
44
|
-
(0, _react.useEffect)(() => {
|
|
45
|
-
if (!extraAttributes || allAttributesRendered) {
|
|
46
|
-
setButtonViewHeight(0);
|
|
47
|
-
}
|
|
48
|
-
}, [extraAttributes, allAttributesRendered]);
|
|
49
45
|
(0, _react.useEffect)(() => {
|
|
50
46
|
if (extraAttributes.length === 0) {
|
|
51
47
|
const viewStyle = _reactNative.StyleSheet.flatten([styles.allAttributesWrapper, footer && styles.allAttributesWrapperWithFooter]);
|
|
@@ -54,35 +50,41 @@ const CredentialDetailsCard = ({
|
|
|
54
50
|
}
|
|
55
51
|
}, [extraAttributes, footer]);
|
|
56
52
|
(0, _react.useEffect)(() => {
|
|
57
|
-
if (previewAttributesHeight === undefined
|
|
53
|
+
if (previewAttributesHeight === undefined) {
|
|
58
54
|
return;
|
|
59
55
|
}
|
|
60
56
|
if (allAttributesRendered && fullAttributesHeight === undefined) {
|
|
61
57
|
return;
|
|
62
58
|
}
|
|
59
|
+
const buttonViewHeight = !extraAttributes || allAttributesRendered ? 0 : SEE_ALL_BUTTON_HEIGHT;
|
|
63
60
|
const additionalAttributesHeight = fullAttributesHeight !== null && fullAttributesHeight !== void 0 ? fullAttributesHeight : 0;
|
|
64
61
|
const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;
|
|
65
|
-
const
|
|
62
|
+
const fullHeight = previewAttributesHeight + additionalHeight;
|
|
63
|
+
if (!animate) {
|
|
64
|
+
currentHeight.value = fullHeight;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const newHeight = expanded ? fullHeight : 0;
|
|
66
68
|
if (currentHeight.value === undefined || !animate) {
|
|
67
69
|
currentHeight.value = newHeight;
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
70
|
-
const duration =
|
|
72
|
+
const duration = fullHeight / 5;
|
|
71
73
|
currentHeight.value = (0, _reactNativeReanimated.withTiming)(newHeight, {
|
|
72
74
|
duration
|
|
73
75
|
});
|
|
74
|
-
}, [allAttributesRendered,
|
|
75
|
-
const
|
|
76
|
+
}, [allAttributesRendered, currentHeight, animate, expanded, extraAttributes, fullAttributesHeight, previewAttributes.length, previewAttributesHeight]);
|
|
77
|
+
const animatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
|
|
76
78
|
if (currentHeight.value === undefined) {
|
|
77
79
|
if (expanded) {
|
|
78
80
|
return {};
|
|
79
81
|
}
|
|
80
82
|
return {
|
|
81
|
-
height:
|
|
83
|
+
height: cardHeight
|
|
82
84
|
};
|
|
83
85
|
}
|
|
84
86
|
return {
|
|
85
|
-
height: currentHeight.value
|
|
87
|
+
height: cardHeight + currentHeight.value
|
|
86
88
|
};
|
|
87
89
|
}, [expanded, currentHeight]);
|
|
88
90
|
const onPreviewAttrContentLayout = (0, _react.useCallback)(event => {
|
|
@@ -91,9 +93,6 @@ const CredentialDetailsCard = ({
|
|
|
91
93
|
const onFullAttrContentLayout = (0, _react.useCallback)(event => {
|
|
92
94
|
setFullAttributesHeight(event.nativeEvent.layout.height);
|
|
93
95
|
}, []);
|
|
94
|
-
const onButtonViewLayout = (0, _react.useCallback)(event => {
|
|
95
|
-
setButtonViewHeight(event.nativeEvent.layout.height);
|
|
96
|
-
}, []);
|
|
97
96
|
const footerView = (0, _react.useMemo)(() => {
|
|
98
97
|
if (!footer) {
|
|
99
98
|
return undefined;
|
|
@@ -110,10 +109,11 @@ const CredentialDetailsCard = ({
|
|
|
110
109
|
...cardProps
|
|
111
110
|
} = card;
|
|
112
111
|
const renderExtraAttributes = allAttributesRendered || previewAttributesHeight !== undefined && currentHeight.value !== undefined;
|
|
113
|
-
|
|
112
|
+
const ContainerComponent = animate ? _reactNativeReanimated.default.View : _reactNative.View;
|
|
113
|
+
return /*#__PURE__*/_react.default.createElement(ContainerComponent, _extends({
|
|
114
114
|
style: [styles.detailsCard, {
|
|
115
115
|
backgroundColor: colorScheme.white
|
|
116
|
-
}, style]
|
|
116
|
+
}, animate ? animatedStyle : undefined, style]
|
|
117
117
|
}, viewProps, {
|
|
118
118
|
testID: (0, _testID.concatTestID)(card.testID, expanded ? 'expanded' : 'collapsed')
|
|
119
119
|
}), /*#__PURE__*/_react.default.createElement(_credentialCard.default, _extends({}, cardProps, {
|
|
@@ -122,9 +122,7 @@ const CredentialDetailsCard = ({
|
|
|
122
122
|
accessory: (_header$accessory = header.accessory) !== null && _header$accessory !== void 0 ? _header$accessory : cardProps.onHeaderPress ? CaretIcon : undefined
|
|
123
123
|
},
|
|
124
124
|
style: [styles.card, cardProps.style]
|
|
125
|
-
})), previewAttributes.length > 0 && /*#__PURE__*/_react.default.createElement(
|
|
126
|
-
style: [styles.attributesAnimatedWrapper, credentialAttributesStyle]
|
|
127
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
125
|
+
})), previewAttributes.length > 0 && /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
128
126
|
style: styles.attributesWrapper
|
|
129
127
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
130
128
|
onLayout: onPreviewAttrContentLayout,
|
|
@@ -136,8 +134,7 @@ const CredentialDetailsCard = ({
|
|
|
136
134
|
onImagePreview: onImagePreview,
|
|
137
135
|
onPress: onAttributeSelected
|
|
138
136
|
}, attribute)))), !allAttributesRendered && extraAttributes.length > 0 && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
139
|
-
style: styles.
|
|
140
|
-
onLayout: onButtonViewLayout
|
|
137
|
+
style: styles.buttonWrapper
|
|
141
138
|
}, /*#__PURE__*/_react.default.createElement(_buttons.Button, {
|
|
142
139
|
onPress: () => setAllAttributesRendered(true),
|
|
143
140
|
type: _buttons.ButtonType.Secondary,
|
|
@@ -167,12 +164,14 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
167
164
|
allAttributesWrapperWithFooter: {
|
|
168
165
|
paddingBottom: 0
|
|
169
166
|
},
|
|
170
|
-
attributesAnimatedWrapper: {
|
|
171
|
-
overflow: 'hidden'
|
|
172
|
-
},
|
|
173
167
|
attributesWrapper: {
|
|
174
168
|
paddingTop: 7,
|
|
175
|
-
|
|
169
|
+
width: '100%'
|
|
170
|
+
},
|
|
171
|
+
buttonWrapper: {
|
|
172
|
+
height: SEE_ALL_BUTTON_HEIGHT,
|
|
173
|
+
paddingBottom: 12,
|
|
174
|
+
paddingHorizontal: 4,
|
|
176
175
|
width: '100%'
|
|
177
176
|
},
|
|
178
177
|
card: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_testID","_buttons","_credential","_colorSchemeContext","_credentialAttributeItem","_interopRequireDefault","_credentialCard","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","PREVIEW_ATTRIBUTES_COUNT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","useAppColorScheme","previewAttributesHeight","setPreviewAttributesHeight","useState","fullAttributesHeight","setFullAttributesHeight","buttonViewHeight","setButtonViewHeight","allAttributesRendered","setAllAttributesRendered","CaretIcon","UpIcon","DownIcon","currentHeight","useSharedValue","undefined","previewAttributes","slice","extraAttributes","useMemo","useEffect","viewStyle","StyleSheet","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","additionalAttributesHeight","additionalHeight","newHeight","value","duration","withTiming","credentialAttributesStyle","useAnimatedStyle","height","onPreviewAttrContentLayout","useCallback","event","nativeEvent","layout","onFullAttrContentLayout","onButtonViewLayout","footerView","React","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","View","detailsCard","backgroundColor","white","concatTestID","accessory","onHeaderPress","attributesAnimatedWrapper","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","Button","type","ButtonType","Secondary","title","index","create","paddingHorizontal","width","overflow","paddingTop","position","borderRadius","marginTop","_default","exports"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps } 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;\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 const [buttonViewHeight, setButtonViewHeight] = 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 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 || allAttributesRendered) {\n setButtonViewHeight(0);\n }\n }, [extraAttributes, allAttributesRendered]);\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined || buttonViewHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;\n const newHeight = expanded || !animate ? previewAttributesHeight + additionalHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = !expanded\n ? 250\n : allAttributesRendered\n ? previewAttributes.length * 50\n : extraAttributes.length * 50;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n buttonViewHeight,\n currentHeight,\n animate,\n expanded,\n extraAttributes.length,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n ]);\n\n const credentialAttributesStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: 0,\n };\n }\n return {\n height: 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 onButtonViewLayout = useCallback((event: LayoutChangeEvent) => {\n setButtonViewHeight(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 return (\n <View\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, 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 <Animated.View style={[styles.attributesAnimatedWrapper, credentialAttributesStyle]}>\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.allAttributesWrapper} onLayout={onButtonViewLayout}>\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 </Animated.View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </View>\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 attributesAnimatedWrapper: {\n overflow: 'hidden',\n },\n attributesWrapper: {\n paddingTop: 7,\n position: 'absolute',\n width: '100%',\n },\n card: {\n borderRadius: 0,\n },\n detailsCard: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,eAAA,GAAAD,sBAAA,CAAAR,OAAA;AAAwE,SAAAQ,uBAAAE,CAAA,WAAAA,C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AAC;AAED,MAAMrB,MAAM,GAAGF,uBAAU,CAACwD,MAAM,CAAC;EAC/BrD,oBAAoB,EAAE;IACpBG,aAAa,EAAE,EAAE;IACjBmD,iBAAiB,EAAE,CAAC;IACpBC,KAAK,EAAE;EACT,CAAC;EACDtD,8BAA8B,EAAE;IAC9BE,aAAa,EAAE;EACjB,CAAC;EACDgC,yBAAyB,EAAE;IACzBqB,QAAQ,EAAE;EACZ,CAAC;EACDpB,iBAAiB,EAAE;IACjBqB,UAAU,EAAE,CAAC;IACbC,QAAQ,EAAE,UAAU;IACpBH,KAAK,EAAE;EACT,CAAC;EACD3F,IAAI,EAAE;IACJ+F,YAAY,EAAE;EAChB,CAAC;EACD9B,WAAW,EAAE;IACX8B,YAAY,EAAE,EAAE;IAChBH,QAAQ,EAAE;EACZ,CAAC;EACD1F,MAAM,EAAE;IACN8F,SAAS,EAAE;EACb,CAAC;EACDtB,wBAAwB,EAAE;IACxBgB,iBAAiB,EAAE,CAAC;IACpBC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAA9H,OAAA,GAEYyB,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_testID","_buttons","_credential","_colorSchemeContext","_credentialAttributeItem","_interopRequireDefault","_credentialCard","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","PREVIEW_ATTRIBUTES_COUNT","SEE_ALL_BUTTON_HEIGHT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","useAppColorScheme","previewAttributesHeight","setPreviewAttributesHeight","useState","fullAttributesHeight","setFullAttributesHeight","allAttributesRendered","setAllAttributesRendered","CaretIcon","UpIcon","DownIcon","cardHeight","Math","ceil","width","CredentialCardRatio","currentHeight","useSharedValue","undefined","previewAttributes","slice","extraAttributes","useMemo","useEffect","viewStyle","StyleSheet","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","buttonViewHeight","additionalAttributesHeight","additionalHeight","fullHeight","value","newHeight","duration","withTiming","animatedStyle","useAnimatedStyle","height","onPreviewAttrContentLayout","useCallback","event","nativeEvent","layout","onFullAttrContentLayout","footerView","React","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","ContainerComponent","Animated","View","detailsCard","backgroundColor","white","concatTestID","accessory","onHeaderPress","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","buttonWrapper","Button","type","ButtonType","Secondary","title","index","create","paddingHorizontal","paddingTop","borderRadius","overflow","marginTop","_default","exports"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps, CredentialCardRatio } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\nconst SEE_ALL_BUTTON_HEIGHT = 78;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n\n const CaretIcon = expanded ? UpIcon : DownIcon;\n\n const cardHeight = Math.ceil(card.width / CredentialCardRatio);\n const currentHeight = useSharedValue<number | undefined>(undefined);\n\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 },\n detailsCard: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,eAAA,GAAAV,uBAAA,CAAAC,OAAA;AAA6F,SAAAQ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AAU,EAAE,CAAC;IACbxE,KAAK,EAAE;EACT,CAAC;EACD+D,aAAa,EAAE;IACbnC,MAAM,EAAEzD,qBAAqB;IAC7B8C,aAAa,EAAE,EAAE;IACjBsD,iBAAiB,EAAE,CAAC;IACpBvE,KAAK,EAAE;EACT,CAAC;EACDzB,IAAI,EAAE;IACJkG,YAAY,EAAE;EAChB,CAAC;EACD3B,WAAW,EAAE;IACX2B,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDjG,MAAM,EAAE;IACNkG,SAAS,EAAE;EACb,CAAC;EACDrB,wBAAwB,EAAE;IACxBiB,iBAAiB,EAAE,CAAC;IACpBvE,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAA4E,QAAA,GAAAC,OAAA,CAAAnI,OAAA,GAEY0B,qBAAqB","ignoreList":[]}
|
|
@@ -51,7 +51,7 @@ const CredentialDetailsCardListItem = ({
|
|
|
51
51
|
};
|
|
52
52
|
}, [cardListItemHeight, lastItem, expanded]);
|
|
53
53
|
const cardWrapperStyle = {
|
|
54
|
-
minHeight: cardWidth ? cardWidth / _credentialCard.CredentialCardRatio : undefined
|
|
54
|
+
minHeight: cardWidth ? Math.ceil(cardWidth / _credentialCard.CredentialCardRatio) : undefined
|
|
55
55
|
};
|
|
56
56
|
const onContentLayout = (0, _react.useCallback)(event => {
|
|
57
57
|
var _StyleSheet$flatten$b, _StyleSheet$flatten;
|
|
@@ -59,20 +59,24 @@ const CredentialDetailsCardListItem = ({
|
|
|
59
59
|
width,
|
|
60
60
|
height
|
|
61
61
|
} = event.nativeEvent.layout;
|
|
62
|
+
const borderWidth = (_StyleSheet$flatten$b = (_StyleSheet$flatten = _reactNative.StyleSheet.flatten(style)) === null || _StyleSheet$flatten === void 0 ? void 0 : _StyleSheet$flatten.borderWidth) !== null && _StyleSheet$flatten$b !== void 0 ? _StyleSheet$flatten$b : 0;
|
|
63
|
+
const cardHeight = Math.round(height) + 2 * borderWidth;
|
|
64
|
+
if (cardHeight === detailsCardHeight) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
62
67
|
setCardWidth(width);
|
|
63
68
|
if (!minHeight) {
|
|
64
|
-
setMinHeight(lastItem ? width / _credentialCard.CredentialCardRatio : 60);
|
|
69
|
+
setMinHeight(lastItem ? Math.ceil(width / _credentialCard.CredentialCardRatio) : 60);
|
|
65
70
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}, [lastItem, minHeight, style]);
|
|
71
|
+
setDetailsCardHeight(cardHeight);
|
|
72
|
+
}, [lastItem, minHeight, style, detailsCardHeight]);
|
|
69
73
|
return /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.View, {
|
|
70
74
|
style: [styles.animatedWrapper, animatedCardWrapperStyle, style]
|
|
71
75
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
72
76
|
style: [styles.cardWrapper, cardWrapperStyle]
|
|
73
77
|
}, /*#__PURE__*/_react.default.createElement(_credentialDetailsCard.default, _extends({
|
|
74
78
|
animate: false,
|
|
75
|
-
expanded:
|
|
79
|
+
expanded: true,
|
|
76
80
|
onLayout: onContentLayout,
|
|
77
81
|
style: detailsCardStyle
|
|
78
82
|
}, props))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_credentialCard","_credentialDetailsCard","_interopRequireDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","CredentialDetailsCardListItem","detailsCardStyle","expanded","lastItem","style","props","cardWidth","setCardWidth","useState","minHeight","setMinHeight","detailsCardHeight","setDetailsCardHeight","cardListItemHeight","useSharedValue","undefined","useEffect","newValue","value","withTiming","duration","animatedCardWrapperStyle","useAnimatedStyle","height","cardWrapperStyle","CredentialCardRatio","onContentLayout","useCallback","event","_StyleSheet$flatten$b","_StyleSheet$flatten","width","nativeEvent","layout","borderWidth","StyleSheet","flatten","createElement","View","styles","animatedWrapper","cardWrapper","animate","onLayout","create","CredentialCardShadow","borderRadius","overflow","_default","exports"],"sources":["credential-details-list-item.tsx"],"sourcesContent":["import React, { FC, useCallback, useEffect, useState } from 'react';\nimport { LayoutChangeEvent, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { CredentialCardRatio, CredentialCardShadow } from './credential-card';\nimport CredentialDetailsCard, { CredentialDetailsCardProps } from './credential-details-card';\n\nexport type CredentialDetailsCardListItemProps = Omit<CredentialDetailsCardProps, 'animate'> & {\n detailsCardStyle?: StyleProp<ViewStyle>;\n lastItem?: boolean;\n};\n\nconst CredentialDetailsCardListItem: FC<CredentialDetailsCardListItemProps> = ({\n detailsCardStyle,\n expanded,\n lastItem,\n style,\n ...props\n}) => {\n const [cardWidth, setCardWidth] = useState<number>();\n const [minHeight, setMinHeight] = useState<number>();\n const [detailsCardHeight, setDetailsCardHeight] = useState<number>();\n\n const cardListItemHeight = useSharedValue<number | undefined>(undefined);\n\n useEffect(() => {\n if (!detailsCardHeight || !minHeight) {\n return;\n }\n const newValue = expanded ? detailsCardHeight : minHeight;\n if (cardListItemHeight.value === undefined) {\n cardListItemHeight.value = newValue;\n return;\n }\n cardListItemHeight.value = withTiming(newValue, {\n duration: 250,\n });\n }, [cardListItemHeight, detailsCardHeight, minHeight, expanded]);\n\n const animatedCardWrapperStyle = useAnimatedStyle(() => {\n if (cardListItemHeight.value !== undefined) {\n return {\n height: cardListItemHeight.value,\n };\n }\n if (lastItem || expanded) {\n return {};\n }\n return {\n height: 60,\n };\n }, [cardListItemHeight, lastItem, expanded]);\n\n const cardWrapperStyle: ViewStyle = {\n minHeight: cardWidth ? cardWidth / CredentialCardRatio : undefined,\n }\n\n const onContentLayout = useCallback(\n (event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setCardWidth(width);\n if (!minHeight) {\n setMinHeight(lastItem ? width / CredentialCardRatio : 60);\n }\n
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_credentialCard","_credentialDetailsCard","_interopRequireDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","CredentialDetailsCardListItem","detailsCardStyle","expanded","lastItem","style","props","cardWidth","setCardWidth","useState","minHeight","setMinHeight","detailsCardHeight","setDetailsCardHeight","cardListItemHeight","useSharedValue","undefined","useEffect","newValue","value","withTiming","duration","animatedCardWrapperStyle","useAnimatedStyle","height","cardWrapperStyle","Math","ceil","CredentialCardRatio","onContentLayout","useCallback","event","_StyleSheet$flatten$b","_StyleSheet$flatten","width","nativeEvent","layout","borderWidth","StyleSheet","flatten","cardHeight","round","createElement","View","styles","animatedWrapper","cardWrapper","animate","onLayout","create","CredentialCardShadow","borderRadius","overflow","_default","exports"],"sources":["credential-details-list-item.tsx"],"sourcesContent":["import React, { FC, useCallback, useEffect, useState } from 'react';\nimport { LayoutChangeEvent, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { CredentialCardRatio, CredentialCardShadow } from './credential-card';\nimport CredentialDetailsCard, { CredentialDetailsCardProps } from './credential-details-card';\n\nexport type CredentialDetailsCardListItemProps = Omit<CredentialDetailsCardProps, 'animate'> & {\n detailsCardStyle?: StyleProp<ViewStyle>;\n lastItem?: boolean;\n};\n\nconst CredentialDetailsCardListItem: FC<CredentialDetailsCardListItemProps> = ({\n detailsCardStyle,\n expanded,\n lastItem,\n style,\n ...props\n}) => {\n const [cardWidth, setCardWidth] = useState<number>();\n const [minHeight, setMinHeight] = useState<number>();\n const [detailsCardHeight, setDetailsCardHeight] = useState<number>();\n\n const cardListItemHeight = useSharedValue<number | undefined>(undefined);\n\n useEffect(() => {\n if (!detailsCardHeight || !minHeight) {\n return;\n }\n const newValue = expanded ? detailsCardHeight : minHeight;\n if (cardListItemHeight.value === undefined) {\n cardListItemHeight.value = newValue;\n return;\n }\n cardListItemHeight.value = withTiming(newValue, {\n duration: 250,\n });\n }, [cardListItemHeight, detailsCardHeight, minHeight, expanded]);\n\n const animatedCardWrapperStyle = useAnimatedStyle(() => {\n if (cardListItemHeight.value !== undefined) {\n return {\n height: cardListItemHeight.value,\n };\n }\n if (lastItem || expanded) {\n return {};\n }\n return {\n height: 60,\n };\n }, [cardListItemHeight, lastItem, expanded]);\n\n const cardWrapperStyle: ViewStyle = {\n minHeight: cardWidth ? Math.ceil(cardWidth / CredentialCardRatio) : undefined,\n }\n\n const onContentLayout = useCallback(\n (event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n const borderWidth = StyleSheet.flatten(style)?.borderWidth ?? 0;\n const cardHeight = Math.round(height) + 2 * borderWidth;\n if (cardHeight === detailsCardHeight) {\n return;\n }\n setCardWidth(width);\n if (!minHeight) {\n setMinHeight(lastItem ? Math.ceil(width / CredentialCardRatio) : 60);\n }\n setDetailsCardHeight(cardHeight);\n },\n [lastItem, minHeight, style, detailsCardHeight],\n );\n\n return (\n <Animated.View style={[styles.animatedWrapper, animatedCardWrapperStyle, style]}>\n <View style={[styles.cardWrapper, cardWrapperStyle]}>\n <CredentialDetailsCard\n animate={false}\n expanded={true}\n onLayout={onContentLayout}\n style={detailsCardStyle}\n {...props}\n />\n </View>\n </Animated.View>\n );\n};\n\nconst styles = StyleSheet.create({\n animatedWrapper: {\n ...CredentialCardShadow,\n },\n cardWrapper: {\n borderRadius: 10,\n height: '100%',\n overflow: 'hidden',\n },\n});\n\nexport default CredentialDetailsCardListItem;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,I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I,CAACO,KAAK,GAAGN,mCAAmB,CAAC,GAAG,EAAE,CAAC;IACtE;IACAf,oBAAoB,CAAC2B,UAAU,CAAC;EAClC,CAAC,EACD,CAACpC,QAAQ,EAAEM,SAAS,EAAEL,KAAK,EAAEO,iBAAiB,CAChD,CAAC;EAED,oBACE7C,MAAA,CAAAU,OAAA,CAAAiE,aAAA,CAACvE,sBAAA,CAAAM,OAAQ,CAACkE,IAAI;IAACtC,KAAK,EAAE,CAACuC,MAAM,CAACC,eAAe,EAAEvB,wBAAwB,EAAEjB,KAAK;EAAE,gBAC9EtC,MAAA,CAAAU,OAAA,CAAAiE,aAAA,CAACxE,YAAA,CAAAyE,IAAI;IAACtC,KAAK,EAAE,CAACuC,MAAM,CAACE,WAAW,EAAErB,gBAAgB;EAAE,gBAClD1D,MAAA,CAAAU,OAAA,CAAAiE,aAAA,CAACrE,sBAAA,CAAAI,OAAqB,EAAAkB,QAAA;IACpBoD,OAAO,EAAE,KAAM;IACf5C,QAAQ,EAAE,IAAK;IACf6C,QAAQ,EAAEnB,eAAgB;IAC1BxB,KAAK,EAAEH;EAAiB,GACpBI,KAAK,CACV,CACG,CACO,CAAC;AAEpB,CAAC;AAED,MAAMsC,MAAM,GAAGN,uBAAU,CAACW,MAAM,CAAC;EAC/BJ,eAAe,EAAE;IACf,GAAGK;EACL,CAAC;EACDJ,WAAW,EAAE;IACXK,YAAY,EAAE,EAAE;IAChB3B,MAAM,EAAE,MAAM;IACd4B,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7E,OAAA,GAEYwB,6BAA6B","ignoreList":[]}
|
|
@@ -27,7 +27,7 @@ const backButtonHitSlop = {
|
|
|
27
27
|
*/
|
|
28
28
|
const Header = ({
|
|
29
29
|
onBack,
|
|
30
|
-
|
|
30
|
+
rightButtons,
|
|
31
31
|
style,
|
|
32
32
|
titleRowStyle,
|
|
33
33
|
testID,
|
|
@@ -44,8 +44,8 @@ const Header = ({
|
|
|
44
44
|
hitSlop: backButtonHitSlop,
|
|
45
45
|
onPress: onBack,
|
|
46
46
|
testID: (0, _utils.concatTestID)(testID, 'back')
|
|
47
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, null),
|
|
48
|
-
style: [styles.titleRow, onBack ? styles.titleRow2nd : styles.titleRowNoBackButton, (onBack || !
|
|
47
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, null), rightButtons), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
48
|
+
style: [styles.titleRow, onBack ? styles.titleRow2nd : styles.titleRowNoBackButton, (onBack || !rightButtons) && styles.titleRowNoRightButton, titleRowStyle]
|
|
49
49
|
}, typeof title === 'string' ? /*#__PURE__*/_react.default.createElement(_text.Typography, {
|
|
50
50
|
accessibilityRole: "header",
|
|
51
51
|
color: colorScheme.text,
|
|
@@ -54,9 +54,9 @@ const Header = ({
|
|
|
54
54
|
testID: (0, _utils.concatTestID)(testID, 'title')
|
|
55
55
|
}, title) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
56
56
|
style: styles.title
|
|
57
|
-
}, title), !onBack &&
|
|
57
|
+
}, title), !onBack && rightButtons && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
58
58
|
style: styles.rightButtonWrapper
|
|
59
|
-
},
|
|
59
|
+
}, rightButtons)));
|
|
60
60
|
};
|
|
61
61
|
const styles = _reactNative.StyleSheet.create({
|
|
62
62
|
backButtonRow: {
|
|
@@ -72,6 +72,8 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
72
72
|
},
|
|
73
73
|
rightButtonWrapper: {
|
|
74
74
|
alignItems: 'center',
|
|
75
|
+
flexDirection: 'row',
|
|
76
|
+
gap: '16',
|
|
75
77
|
height: 48,
|
|
76
78
|
justifyContent: 'center',
|
|
77
79
|
paddingHorizontal: 12,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_utils","_buttons","_text","_theme","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","backButtonHitSlop","top","bottom","left","right","Header","onBack","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_utils","_buttons","_text","_theme","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","backButtonHitSlop","top","bottom","left","right","Header","onBack","rightButtons","style","titleRowStyle","testID","title","viewProps","colorScheme","useAppColorScheme","createElement","View","styles","container","backButtonRow","BackButton","hitSlop","onPress","concatTestID","titleRow","titleRow2nd","titleRowNoBackButton","titleRowNoRightButton","Typography","accessibilityRole","color","text","preset","rightButtonWrapper","StyleSheet","create","alignItems","flexDirection","justifyContent","minHeight","paddingHorizontal","width","gap","height","paddingTop","flex","paddingBottom","paddingLeft","paddingRight","marginBottom","marginTop","_default","exports"],"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> = ({ onBack, rightButtons, style, titleRowStyle, testID, title, ...viewProps }) => {\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 hitSlop={backButtonHitSlop} onPress={onBack} testID={concatTestID(testID, 'back')} />\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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA6C,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WA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K,EAAE;EACT,CAAC;EACDvB,SAAS,EAAE;IACTuB,KAAK,EAAE;EACT,CAAC;EACDR,kBAAkB,EAAE;IAClBG,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBK,GAAG,EAAE,IAAI;IACTC,MAAM,EAAE,EAAE;IACVL,cAAc,EAAE,QAAQ;IACxBE,iBAAiB,EAAE,EAAE;IACrBI,UAAU,EAAE;EACd,CAAC;EACDjC,KAAK,EAAE;IACLkC,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE,CAAC;IAAE;IAClBF,UAAU,EAAE;EACd,CAAC;EACDpB,QAAQ,EAAE;IACRa,aAAa,EAAE,KAAK;IACpBU,WAAW,EAAE,EAAE;IACfC,YAAY,EAAE,CAAC;IACfP,KAAK,EAAE;EACT,CAAC;EACDhB,WAAW,EAAE;IACXwB,YAAY,EAAE;EAChB,CAAC;EACDvB,oBAAoB,EAAE;IACpBwB,SAAS,EAAE;EACb,CAAC;EACDvB,qBAAqB,EAAE;IACrBqB,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAjE,OAAA,GAEYkB,MAAM","ignoreList":[]}
|
|
@@ -38,6 +38,7 @@ const HistoryDetailsView = ({
|
|
|
38
38
|
onHeaderPress,
|
|
39
39
|
setInitialCredential
|
|
40
40
|
} = (0, _utils.useCredentialListExpandedCard)();
|
|
41
|
+
const cardWidth = (0, _react.useMemo)(() => _reactNative.Dimensions.get('window').width - 32, []);
|
|
41
42
|
|
|
42
43
|
// Expand the first credential
|
|
43
44
|
(0, _react.useEffect)(() => {
|
|
@@ -132,7 +133,8 @@ const HistoryDetailsView = ({
|
|
|
132
133
|
...props.credentialCard,
|
|
133
134
|
card: {
|
|
134
135
|
...props.credentialCard.card,
|
|
135
|
-
onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress
|
|
136
|
+
onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress,
|
|
137
|
+
width: cardWidth
|
|
136
138
|
}
|
|
137
139
|
};
|
|
138
140
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_components","_headerButtons","_utils","_accessibility","_buttons","_credential","_icons","_screens","_text","_theme","_dataItem","_interopRequireDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","HistoryDetailsView","assets","data","headerButton","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_assets$cards","_assets$cards2","colorScheme","useAppColorScheme","expandedCredential","onHeaderPress","setInitialCredential","useCredentialListExpandedCard","useEffect","cards","id","credentialDetails","credentialId","credentialCard","card","moreInfoHeaderButton","useMemo","_labels$infoButtonAcc","undefined","createElement","HeaderInfoButton","onPress","concatTestID","accessibilityLabel","infoButtonAccessibility","hasAssets","header","ScrollViewScreen","leftItem","BackButton","rightItem","static","title","scrollView","style","styles","content","View","section","backgroundColor","white","EntityDetails","entity","borderColor","background","CredentialHeader","credentialHeader","blur","attribute","date","value","action","last","label","valueColor","color","valueIcon","icon","Typography","text","preset","sectionHeader","relatedAssets","TouchableOpacity","disabled","onPressed","accessory","NextIcon","assetsHeader","map","props","index","key","credential","CredentialDetails","expanded","lastItem","itemProps","headerPressable","toString","CredentialDetailsCardListItem","exports","StyleSheet","create","borderRadius","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, 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\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 },\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 },\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 marginBottom: 12,\n padding: 12,\n },\n sectionHeader: {\n marginHorizontal: 4,\n marginVertical: 16,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAMA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU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CAAAoD,aAAA,CAAC7D,WAAA,CAAA0H,6BAA6B,EAAA/F,QAAA,KACxB4F,SAAS;QACbF,QAAQ,EAAEvE,kBAAkB,KAAKkE,KAAK,CAACzD,cAAc,CAACC,IAAI,CAACF,YAAa;QACxEgE,QAAQ,EAAEL,KAAK,KAAKlF,MAAM,GAAG,CAAE;QAC/BS,cAAc,EAAEA;MAAe,EAChC,CACG,CAAC;IAEX;EACF,CAAC,CACe,CAAC;AAEvB,CAAC;AAACmF,OAAA,CAAA1F,kBAAA,GAAAA,kBAAA;AAEF,MAAM4C,MAAM,GAAG+C,uBAAU,CAACC,MAAM,CAAC;EAC/Bf,YAAY,EAAE;IACZgB,YAAY,EAAE;EAChB,CAAC;EACDhD,OAAO,EAAE;IACPiD,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE;EACd,CAAC;EACDb,UAAU,EAAE;IACVc,YAAY,EAAE;EAChB,CAAC;EACD7C,MAAM,EAAE;IACN8C,iBAAiB,EAAE,CAAC;IACpBC,aAAa,EAAE;EACjB,CAAC;EACD/D,MAAM,EAAE;IACN8D,iBAAiB,EAAE,CAAC;IACpBE,SAAS,EAAE,CAAC,CAAC;IACbD,aAAa,EAAE,EAAE;IACjBJ,iBAAiB,EAAE;EACrB,CAAC;EACD/C,OAAO,EAAE;IACP8C,YAAY,EAAE,CAAC;IACfG,YAAY,EAAE,EAAE;IAChBI,OAAO,EAAE;EACX,CAAC;EACD9B,aAAa,EAAE;IACb+B,gBAAgB,EAAE,CAAC;IACnBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_components","_headerButtons","_utils","_accessibility","_buttons","_credential","_icons","_screens","_text","_theme","_dataItem","_interopRequireDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","HistoryDetailsView","assets","data","headerButton","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_assets$cards","_assets$cards2","colorScheme","useAppColorScheme","expandedCredential","onHeaderPress","setInitialCredential","useCredentialListExpandedCard","cardWidth","useMemo","Dimensions","width","useEffect","cards","id","credentialDetails","credentialId","credentialCard","card","moreInfoHeaderButton","_labels$infoButtonAcc","undefined","createElement","HeaderInfoButton","onPress","concatTestID","accessibilityLabel","infoButtonAccessibility","hasAssets","header","ScrollViewScreen","leftItem","BackButton","rightItem","static","title","scrollView","style","styles","content","View","section","backgroundColor","white","EntityDetails","entity","borderColor","background","CredentialHeader","credentialHeader","blur","attribute","date","value","action","last","label","valueColor","color","valueIcon","icon","Typography","text","preset","sectionHeader","relatedAssets","TouchableOpacity","disabled","onPressed","accessory","NextIcon","assetsHeader","map","props","index","key","credential","CredentialDetails","expanded","lastItem","itemProps","headerPressable","toString","CredentialDetailsCardListItem","exports","StyleSheet","create","borderRadius","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 },\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 marginBottom: 12,\n padding: 12,\n },\n sectionHeader: {\n marginHorizontal: 4,\n marginVertical: 16,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAMA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,SAAA,GAAAC,sBAAA,CAAAb,OAAA;AAAmC,SAAAa,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CA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