@procivis/one-react-native-components 0.3.53 → 0.3.62
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/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 +100 -1
- package/lib/commonjs/ui-components/icons/icons.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 +4 -3
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +23 -4
- 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 +3 -1
- package/lib/commonjs/utils/hooks/core/proofs.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/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/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 +95 -0
- package/lib/module/ui-components/icons/icons.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 +5 -4
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +21 -3
- 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 +3 -1
- package/lib/module/utils/hooks/core/proofs.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/typescript/components/proof-request/share-credential.d.ts +4 -5
- 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 +4 -0
- 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 +4 -1
- package/lib/typescript/utils/hooks/core/credentials.d.ts +2 -6
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +6 -6
- package/lib/typescript/utils/parsers/credential.d.ts +6 -3
- package/package.json +3 -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/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 +85 -0
- package/src/ui-components/searchbar/animated-search-bar.tsx +11 -9
- package/src/utils/hooks/core/backup.ts +8 -2
- package/src/utils/hooks/core/core-init.ts +28 -2
- package/src/utils/hooks/core/credentials.ts +3 -3
- package/src/utils/hooks/core/proofs.ts +3 -1
- package/src/utils/parsers/credential-sharing.tsx +34 -11
- package/src/utils/parsers/credential.ts +8 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","concatTestID","Button","ButtonType","DownIcon","UpIcon","useAppColorScheme","CredentialAttributeItem","CredentialCard","PREVIEW_ATTRIBUTES_COUNT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","previewAttributesHeight","setPreviewAttributesHeight","fullAttributesHeight","setFullAttributesHeight","buttonViewHeight","setButtonViewHeight","allAttributesRendered","setAllAttributesRendered","length","CaretIcon","currentHeight","undefined","previewAttributes","slice","extraAttributes","viewStyle","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","additionalAttributesHeight","additionalHeight","newHeight","value","duration","credentialAttributesStyle","height","onPreviewAttrContentLayout","event","nativeEvent","layout","onFullAttrContentLayout","onButtonViewLayout","footerView","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","_extends","detailsCard","backgroundColor","white","accessory","onHeaderPress","attributesAnimatedWrapper","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","type","Secondary","title","index","create","paddingHorizontal","width","overflow","paddingTop","position","borderRadius","marginTop"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps } 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 previewA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BmB,QAAQ,EAAE;EACZ,CAAC;EACDlB,iBAAiB,EAAE;IACjBmB,UAAU,EAAE,CAAC;IACbC,QAAQ,EAAE,UAAU;IACpBH,KAAK,EAAE;EACT,CAAC;EACD7E,IAAI,EAAE;IACJiF,YAAY,EAAE;EAChB,CAAC;EACD3B,WAAW,EAAE;IACX2B,YAAY,EAAE,EAAE;IAChBH,QAAQ,EAAE;EACZ,CAAC;EACD5E,MAAM,EAAE;IACNgF,SAAS,EAAE;EACb,CAAC;EACDpB,wBAAwB,EAAE;IACxBc,iBAAiB,EAAE,CAAC;IACpBC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAehF,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","concatTestID","Button","ButtonType","DownIcon","UpIcon","useAppColorScheme","CredentialAttributeItem","CredentialCard","CredentialCardRatio","PREVIEW_ATTRIBUTES_COUNT","SEE_ALL_BUTTON_HEIGHT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","previewAttributesHeight","setPreviewAttributesHeight","fullAttributesHeight","setFullAttributesHeight","allAttributesRendered","setAllAttributesRendered","length","CaretIcon","cardHeight","Math","ceil","width","currentHeight","undefined","previewAttributes","slice","extraAttributes","viewStyle","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","buttonViewHeight","additionalAttributesHeight","additionalHeight","fullHeight","value","newHeight","duration","animatedStyle","height","onPreviewAttrContentLayout","event","nativeEvent","layout","onFullAttrContentLayout","footerView","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","ContainerComponent","_extends","detailsCard","backgroundColor","white","accessory","onHeaderPress","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","buttonWrapper","type","Secondary","title","index","create","paddingHorizontal","paddingTop","borderRadius","overflow","marginTop"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps, CredentialCardRatio } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\nconst SEE_ALL_BUTTON_HEIGHT = 78;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n\n const CaretIcon = expanded ? UpIcon : DownIcon;\n\n const cardHeight = Math.ceil(card.width / CredentialCardRatio);\n const currentHeight = useSharedValue<number | undefined>(undefined);\n\n const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];\n const extraAttributes = useMemo(() => (attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : []), [attributes]);\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const buttonViewHeight = !extraAttributes || allAttributesRendered ? 0 : SEE_ALL_BUTTON_HEIGHT;\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;\n const fullHeight = previewAttributesHeight + additionalHeight;\n\n if (!animate) {\n currentHeight.value = fullHeight;\n return;\n }\n\n const newHeight = expanded ? fullHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = fullHeight / 5;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n currentHeight,\n animate,\n expanded,\n extraAttributes,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n ]);\n\n const animatedStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: cardHeight,\n };\n }\n return {\n height: cardHeight + currentHeight.value,\n };\n }, [expanded, currentHeight]);\n\n const onPreviewAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setPreviewAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onFullAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setFullAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const footerView: ReactElement | undefined = useMemo(() => {\n if (!footer) {\n return undefined;\n }\n if (React.isValidElement(footer)) {\n return footer;\n } else {\n const FooterComponent = footer as React.ComponentType<any>;\n return <FooterComponent />;\n }\n }, [footer]);\n\n const { header, ...cardProps } = card;\n\n const renderExtraAttributes =\n allAttributesRendered || (previewAttributesHeight !== undefined && currentHeight.value !== undefined);\n\n const ContainerComponent = animate ? Animated.View : View;\n return (\n <ContainerComponent\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, animate ? animatedStyle : undefined, style]}\n {...viewProps}\n testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>\n <CredentialCard\n {...cardProps}\n header={{ ...header, accessory: header.accessory ?? (cardProps.onHeaderPress ? CaretIcon : undefined) }}\n style={[styles.card, cardProps.style]}\n />\n {previewAttributes.length > 0 && (\n <View>\n <View style={styles.attributesWrapper}>\n <View onLayout={onPreviewAttrContentLayout} style={styles.previewAttributesWrapper}>\n {previewAttributes.map((attribute, idx) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && !extraAttributes.length && idx === previewAttributes.length - 1}\n testID={concatTestID(testID, 'attribute', idx.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n {!allAttributesRendered && extraAttributes.length > 0 && (\n <View style={styles.buttonWrapper}>\n <Button\n onPress={() => setAllAttributesRendered(true)}\n type={ButtonType.Secondary}\n testID={concatTestID(testID, 'showAllAttributesButton')}\n title={showAllButtonLabel!}\n />\n </View>\n )}\n {renderExtraAttributes && (\n <View\n style={[styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter]}\n onLayout={onFullAttrContentLayout}>\n {extraAttributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && index === length - 1}\n testID={concatTestID(testID, 'attribute', index.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n )}\n </View>\n </View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </ContainerComponent>\n );\n};\n\nconst styles = StyleSheet.create({\n allAttributesWrapper: {\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n allAttributesWrapperWithFooter: {\n paddingBottom: 0,\n },\n attributesWrapper: {\n paddingTop: 7,\n width: '100%',\n },\n buttonWrapper: {\n height: SEE_ALL_BUTTON_HEIGHT,\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n card: {\n borderRadius: 0,\n },\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,OAAOA,KAAK,IAAqCC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACzG,SAAiDC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAClG,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,QAAQ,yBAAyB;AAEhG,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,MAAM,EAAEC,UAAU,QAAQ,eAAe;AAClD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AACzD,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,OAAOC,uBAAuB,MAA+B,8BAA8B;AAC3F,OAAOC,cAAc,IAAyBC,mBAAmB,QAAQ,mBAAmB;AAa5F,MAAMC,wBAAwB,GAAG,CAAC;AAClC,MAAMC,qBAAqB,GAAG,EAAE;AAEhC,MAAMC,qBAAqD,GAAGA,CAAC;EAC7DC,OAAO,GAAG,IAAI;EACdC,UAAU;EACVC,IAAI;EACJC,QAAQ;EACRC,MAAM;EACNC,cAAc;EACdC,mBAAmB;EACnBC,KAAK;EACLC,kBAAkB;EAClBC,MAAM;EACN,GAAGC;AACL,CAAC,KAAK;EAAA,IAAAC,iBAAA;EACJ,MAAMC,WAAW,GAAGnB,iBAAiB,CAAC,CAAC;EACvC,MAAM,CAACoB,uBAAuB,EAAEC,0BAA0B,CAA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DU,8BAA8B,EAAE;IAC9BE,aAAa,EAAE;EACjB,CAAC;EACD6B,iBAAiB,EAAE;IACjBkB,UAAU,EAAE,CAAC;IACb3D,KAAK,EAAE;EACT,CAAC;EACDoD,aAAa,EAAE;IACb/B,MAAM,EAAE/C,qBAAqB;IAC7BsC,aAAa,EAAE,EAAE;IACjB8C,iBAAiB,EAAE,CAAC;IACpB1D,KAAK,EAAE;EACT,CAAC;EACDtB,IAAI,EAAE;IACJkF,YAAY,EAAE;EAChB,CAAC;EACDxB,WAAW,EAAE;IACXwB,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDjF,MAAM,EAAE;IACNkF,SAAS,EAAE;EACb,CAAC;EACDnB,wBAAwB,EAAE;IACxBe,iBAAiB,EAAE,CAAC;IACpB1D,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAezB,qBAAqB","ignoreList":[]}
|
|
@@ -42,7 +42,7 @@ const CredentialDetailsCardListItem = ({
|
|
|
42
42
|
};
|
|
43
43
|
}, [cardListItemHeight, lastItem, expanded]);
|
|
44
44
|
const cardWrapperStyle = {
|
|
45
|
-
minHeight: cardWidth ? cardWidth / CredentialCardRatio : undefined
|
|
45
|
+
minHeight: cardWidth ? Math.ceil(cardWidth / CredentialCardRatio) : undefined
|
|
46
46
|
};
|
|
47
47
|
const onContentLayout = useCallback(event => {
|
|
48
48
|
var _StyleSheet$flatten$b, _StyleSheet$flatten;
|
|
@@ -50,20 +50,24 @@ const CredentialDetailsCardListItem = ({
|
|
|
50
50
|
width,
|
|
51
51
|
height
|
|
52
52
|
} = event.nativeEvent.layout;
|
|
53
|
+
const borderWidth = (_StyleSheet$flatten$b = (_StyleSheet$flatten = StyleSheet.flatten(style)) === null || _StyleSheet$flatten === void 0 ? void 0 : _StyleSheet$flatten.borderWidth) !== null && _StyleSheet$flatten$b !== void 0 ? _StyleSheet$flatten$b : 0;
|
|
54
|
+
const cardHeight = Math.round(height) + 2 * borderWidth;
|
|
55
|
+
if (cardHeight === detailsCardHeight) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
53
58
|
setCardWidth(width);
|
|
54
59
|
if (!minHeight) {
|
|
55
|
-
setMinHeight(lastItem ? width / CredentialCardRatio : 60);
|
|
60
|
+
setMinHeight(lastItem ? Math.ceil(width / CredentialCardRatio) : 60);
|
|
56
61
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}, [lastItem, minHeight, style]);
|
|
62
|
+
setDetailsCardHeight(cardHeight);
|
|
63
|
+
}, [lastItem, minHeight, style, detailsCardHeight]);
|
|
60
64
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
61
65
|
style: [styles.animatedWrapper, animatedCardWrapperStyle, style]
|
|
62
66
|
}, /*#__PURE__*/React.createElement(View, {
|
|
63
67
|
style: [styles.cardWrapper, cardWrapperStyle]
|
|
64
68
|
}, /*#__PURE__*/React.createElement(CredentialDetailsCard, _extends({
|
|
65
69
|
animate: false,
|
|
66
|
-
expanded:
|
|
70
|
+
expanded: true,
|
|
67
71
|
onLayout: onContentLayout,
|
|
68
72
|
style: detailsCardStyle
|
|
69
73
|
}, props))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useState","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","CredentialCardRatio","CredentialCardShadow","CredentialDetailsCard","CredentialDetailsCardListItem","detailsCardStyle","expanded","lastItem","style","props","cardWidth","setCardWidth","minHeight","setMinHeight","detailsCardHeight","setDetailsCardHeight","cardListItemHeight","undefined","newValue","value","duration","animatedCardWrapperStyle","height","cardWrapperStyle","onContentLayout","event","_StyleSheet$flatten$b","_StyleSheet$flatten","width","nativeEvent","layout","borderWidth","flatten","createElement","styles","animatedWrapper","cardWrapper","_extends","animate","onLayout","create","borderRadius","overflow"],"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","useCallback","useEffect","useState","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","CredentialCardRatio","CredentialCardShadow","CredentialDetailsCard","CredentialDetailsCardListItem","detailsCardStyle","expanded","lastItem","style","props","cardWidth","setCardWidth","minHeight","setMinHeight","detailsCardHeight","setDetailsCardHeight","cardListItemHeight","undefined","newValue","value","duration","animatedCardWrapperStyle","height","cardWrapperStyle","Math","ceil","onContentLayout","event","_StyleSheet$flatten$b","_StyleSheet$flatten","width","nativeEvent","layout","borderWidth","flatten","cardHeight","round","createElement","styles","animatedWrapper","cardWrapper","_extends","animate","onLayout","create","borderRadius","overflow"],"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,OAAOA,KAAK,IAAQC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACnE,SAAuCC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACxF,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,QAAQ,yBAAyB;AAEhG,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,mBAAmB;AAC7E,OAAOC,qBAAqB,MAAsC,2BAA2B;AAO7F,MAAMC,6BAAqE,GAAGA,CAAC;EAC7EC,gBAAgB;EAChBC,QAAQ;EACRC,QAAQ;EACRC,KAAK;EACL,GAAGC;AACL,CAAC,KAAK;EACJ,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGjB,QAAQ,CAAS,CAAC;EACpD,MAA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AAE;IACf,GAAGrC;EACL,CAAC;EACDsC,WAAW,EAAE;IACXK,YAAY,EAAE,EAAE;IAChBvB,MAAM,EAAE,MAAM;IACdwB,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,eAAe1C,6BAA6B","ignoreList":[]}
|
|
@@ -20,7 +20,7 @@ const backButtonHitSlop = {
|
|
|
20
20
|
*/
|
|
21
21
|
const Header = ({
|
|
22
22
|
onBack,
|
|
23
|
-
|
|
23
|
+
rightButtons,
|
|
24
24
|
style,
|
|
25
25
|
titleRowStyle,
|
|
26
26
|
testID,
|
|
@@ -37,8 +37,8 @@ const Header = ({
|
|
|
37
37
|
hitSlop: backButtonHitSlop,
|
|
38
38
|
onPress: onBack,
|
|
39
39
|
testID: concatTestID(testID, 'back')
|
|
40
|
-
}), /*#__PURE__*/React.createElement(View, null),
|
|
41
|
-
style: [styles.titleRow, onBack ? styles.titleRow2nd : styles.titleRowNoBackButton, (onBack || !
|
|
40
|
+
}), /*#__PURE__*/React.createElement(View, null), rightButtons), /*#__PURE__*/React.createElement(View, {
|
|
41
|
+
style: [styles.titleRow, onBack ? styles.titleRow2nd : styles.titleRowNoBackButton, (onBack || !rightButtons) && styles.titleRowNoRightButton, titleRowStyle]
|
|
42
42
|
}, typeof title === 'string' ? /*#__PURE__*/React.createElement(Typography, {
|
|
43
43
|
accessibilityRole: "header",
|
|
44
44
|
color: colorScheme.text,
|
|
@@ -47,9 +47,9 @@ const Header = ({
|
|
|
47
47
|
testID: concatTestID(testID, 'title')
|
|
48
48
|
}, title) : /*#__PURE__*/React.createElement(View, {
|
|
49
49
|
style: styles.title
|
|
50
|
-
}, title), !onBack &&
|
|
50
|
+
}, title), !onBack && rightButtons && /*#__PURE__*/React.createElement(View, {
|
|
51
51
|
style: styles.rightButtonWrapper
|
|
52
|
-
},
|
|
52
|
+
}, rightButtons)));
|
|
53
53
|
};
|
|
54
54
|
const styles = StyleSheet.create({
|
|
55
55
|
backButtonRow: {
|
|
@@ -65,6 +65,8 @@ const styles = StyleSheet.create({
|
|
|
65
65
|
},
|
|
66
66
|
rightButtonWrapper: {
|
|
67
67
|
alignItems: 'center',
|
|
68
|
+
flexDirection: 'row',
|
|
69
|
+
gap: '16',
|
|
68
70
|
height: 48,
|
|
69
71
|
justifyContent: 'center',
|
|
70
72
|
paddingHorizontal: 12,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","View","concatTestID","BackButton","Typography","useAppColorScheme","backButtonHitSlop","top","bottom","left","right","Header","onBack","
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","concatTestID","BackButton","Typography","useAppColorScheme","backButtonHitSlop","top","bottom","left","right","Header","onBack","rightButtons","style","titleRowStyle","testID","title","viewProps","colorScheme","createElement","_extends","styles","container","backButtonRow","hitSlop","onPress","titleRow","titleRow2nd","titleRowNoBackButton","titleRowNoRightButton","accessibilityRole","color","text","preset","rightButtonWrapper","create","alignItems","flexDirection","justifyContent","minHeight","paddingHorizontal","width","gap","height","paddingTop","flex","paddingBottom","paddingLeft","paddingRight","marginBottom","marginTop"],"sources":["header.tsx"],"sourcesContent":["import React, { FC, ReactNode } from 'react';\nimport { Insets, StyleProp, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { BackButton } from '../buttons';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\nexport interface HeaderProps extends ViewProps {\n onBack?: () => void;\n rightButtons?: ReactNode[];\n style?: StyleProp<ViewStyle>;\n titleRowStyle?: StyleProp<ViewStyle>;\n title: ReactNode;\n}\n\nconst backButtonHitSlop: Insets = { top: 12, bottom: 12, left: 20, right: 20 };\n\n/**\n * Unified screen header\n *\n * Following the design: https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=425-18624\n * states (Default + Dashboard)\n */\nconst Header: FC<HeaderProps> = ({ 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,OAAOA,KAAK,MAAyB,OAAO;AAC5C,SAA4BC,UAAU,EAAEC,IAAI,QAA8B,cAAc;AAExF,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,UAAU,QAAQ,YAAY;AACvC,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,iBAAiB,QAAQ,UAAU;AA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B,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAetC,MAAM","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { useEffect, useMemo } from 'react';
|
|
3
|
-
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Dimensions, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { CredentialDetails, EntityDetails } from '../../components';
|
|
5
5
|
import { HeaderInfoButton } from '../../components/navigation/header-buttons';
|
|
6
6
|
import { concatTestID, useCredentialListExpandedCard } from '../../utils';
|
|
@@ -29,6 +29,7 @@ export const HistoryDetailsView = ({
|
|
|
29
29
|
onHeaderPress,
|
|
30
30
|
setInitialCredential
|
|
31
31
|
} = useCredentialListExpandedCard();
|
|
32
|
+
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
32
33
|
|
|
33
34
|
// Expand the first credential
|
|
34
35
|
useEffect(() => {
|
|
@@ -123,7 +124,8 @@ export const HistoryDetailsView = ({
|
|
|
123
124
|
...props.credentialCard,
|
|
124
125
|
card: {
|
|
125
126
|
...props.credentialCard.card,
|
|
126
|
-
onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress
|
|
127
|
+
onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress,
|
|
128
|
+
width: cardWidth
|
|
127
129
|
}
|
|
128
130
|
};
|
|
129
131
|
return /*#__PURE__*/React.createElement(View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useMemo","StyleSheet","View","CredentialDetails","EntityDetails","HeaderInfoButton","concatTestID","useCredentialListExpandedCard","TouchableOpacity","BackButton","CredentialDetailsCardListItem","CredentialHeader","NextIcon","ScrollViewScreen","Typography","useAppColorScheme","DataItem","HistoryDetailsView","assets","data","headerButton","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_assets$cards","_assets$cards2","colorScheme","expandedCredential","onHeaderPress","setInitialCredential","cards","length","id","credentialDetails","credentialId","credentialCard","card","moreInfoHeaderButton","_labels$infoButtonAcc","undefined","createElement","onPress","accessibilityLabel","infoButtonAccessibility","hasAssets","header","leftItem","rightItem","static","title","scrollView","style","styles","content","section","backgroundColor","white","_extends","entity","borderColor","background","credentialHeader","blur","attribute","date","value","action","last","label","valueColor","color","valueIcon","icon","text","preset","sectionHeader","relatedAssets","disabled","onPressed","accessory","assetsHeader","map","props","index","key","credential","expanded","lastItem","itemProps","headerPressable","toString","create","borderRadius","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,OAAOA,KAAK,IAAqCC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAClF,SAA0CC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEhF,SAASC,iBAAiB,EAA0BC,aAAa,QAA4B,kBAAkB;AAC/G,SAASC,gBAAgB,QAAQ,4CAA4C;AAC7E,SAAqBC,YAAY,EAAEC,6BAA6B,QAAQ,aAAa;AACrF,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,UAAU,QAAQ,YAAY;AACvC,SACEC,6BAA6B,EAE7BC,gBAAgB,QAEX,eAAe;AACtB,SAASC,QAAQ,QAAQ,UAAU;AACnC,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,OAAOC,QAAQ,MAAM,aAAa;AAgElC,OAAO,MAAMC,kBAA+C,GAAGA,CAAC;EAC9DC,MAAM;EACNC,IAAI;EACJC,YAAY;EACZC,MAAM;EACNC,aAAa;EACbC,aAAa;EACbC,cAAc;EACdC;AACF,CAAC,KAAK;EAAA,IAAAC,aAAA,EAAAC,cAAA;EACJ,MAAMC,WAAW,GAAGb,iBAAiB,CAAC,CAAC;EACvC,MAAM;IAAEc,kBAAkB;IAAEC,aAAa;IAAEC;EAAqB,CAAC,GAAGxB,6BAA6B,CAAC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A4C,aAAA,CAAChC,6BAA6B,EAAAiD,QAAA,KACxB+B,SAAS;QACbF,QAAQ,EAAE3D,kBAAkB,KAAKuD,KAAK,CAAC/C,cAAc,CAACC,IAAI,CAACF,YAAa;QACxEqD,QAAQ,EAAEJ,KAAK,KAAKpD,MAAM,GAAG,CAAE;QAC/BT,cAAc,EAAEA;MAAe,EAChC,CACG,CAAC;IAEX;EACF,CAAC,CACe,CAAC;AAEvB,CAAC;AAED,MAAM8B,MAAM,GAAGrD,UAAU,CAAC4F,MAAM,CAAC;EAC/BX,YAAY,EAAE;IACZY,YAAY,EAAE;EAChB,CAAC;EACDvC,OAAO,EAAE;IACPwC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE;EACd,CAAC;EACDT,UAAU,EAAE;IACVU,YAAY,EAAE;EAChB,CAAC;EACDrC,MAAM,EAAE;IACNsC,iBAAiB,EAAE,CAAC;IACpBC,aAAa,EAAE;EACjB,CAAC;EACDpD,MAAM,EAAE;IACNmD,iBAAiB,EAAE,CAAC;IACpBE,SAAS,EAAE,CAAC,CAAC;IACbD,aAAa,EAAE,EAAE;IACjBJ,iBAAiB,EAAE;EACrB,CAAC;EACDvC,OAAO,EAAE;IACPsC,YAAY,EAAE,CAAC;IACfG,YAAY,EAAE,EAAE;IAChBI,OAAO,EAAE;EACX,CAAC;EACDxB,aAAa,EAAE;IACbyB,gBAAgB,EAAE,CAAC;IACnBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","Dimensions","StyleSheet","View","CredentialDetails","EntityDetails","HeaderInfoButton","concatTestID","useCredentialListExpandedCard","TouchableOpacity","BackButton","CredentialDetailsCardListItem","CredentialHeader","NextIcon","ScrollViewScreen","Typography","useAppColorScheme","DataItem","HistoryDetailsView","assets","data","headerButton","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_assets$cards","_assets$cards2","colorScheme","expandedCredential","onHeaderPress","setInitialCredential","cardWidth","get","width","cards","length","id","credentialDetails","credentialId","credentialCard","card","moreInfoHeaderButton","_labels$infoButtonAcc","undefined","createElement","onPress","accessibilityLabel","infoButtonAccessibility","hasAssets","header","leftItem","rightItem","static","title","scrollView","style","styles","content","section","backgroundColor","white","_extends","entity","borderColor","background","credentialHeader","blur","attribute","date","value","action","last","label","valueColor","color","valueIcon","icon","text","preset","sectionHeader","relatedAssets","disabled","onPressed","accessory","assetsHeader","map","props","index","key","credential","expanded","lastItem","itemProps","headerPressable","toString","create","borderRadius","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,OAAOA,KAAK,IAAqCC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAClF,SAAqBC,UAAU,EAAuBC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE5F,SAASC,iBAAiB,EAA0BC,aAAa,QAA4B,kBAAkB;AAC/G,SAASC,gBAAgB,QAAQ,4CAA4C;AAC7E,SAAqBC,YAAY,EAAEC,6BAA6B,QAAQ,aAAa;AACrF,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,UAAU,QAAQ,YAAY;AACvC,SACEC,6BAA6B,EAE7BC,gBAAgB,QAEX,eAAe;AACtB,SAASC,QAAQ,QAAQ,UAAU;AACnC,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,OAAOC,QAAQ,MAAM,aAAa;AAgElC,OAAO,MAAMC,kBAA+C,GAAGA,CAAC;EAC9DC,MAAM;EACNC,IAAI;EACJC,YAAY;EACZC,MAAM;EACNC,aAAa;EACbC,aAAa;EACbC,cAAc;EACdC;AACF,CAAC,KAAK;EAAA,IAAAC,aAAA,EAAAC,cAAA;EACJ,MAAMC,WAAW,GAAGb,iBAAiB,CAAC,CAAC;EACvC,MAAM;IAAEc,kBAAkB;IAAEC,aAAa;IAAEC;EAAqB,CAAC,GAAGxB,6BAA6B,CAAC,CAAC;EACnG,MAAMyB,SAAS,GAAGjC,OAAO,CAAC,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QAACuF,GAAG,EAAED,KAAK,CAACO,QAAQ,CAAC,CAAE;QAACvC,KAAK,EAAEC,MAAM,CAACiC;MAAW,gBACpD7F,KAAA,CAAAgD,aAAA,CAACnC,6BAA6B,EAAAoD,QAAA,KACxB+B,SAAS;QACbF,QAAQ,EAAE9D,kBAAkB,KAAK0D,KAAK,CAAC/C,cAAc,CAACC,IAAI,CAACF,YAAa;QACxEqD,QAAQ,EAAEJ,KAAK,KAAKpD,MAAM,GAAG,CAAE;QAC/BZ,cAAc,EAAEA;MAAe,EAChC,CACG,CAAC;IAEX;EACF,CAAC,CACe,CAAC;AAEvB,CAAC;AAED,MAAMiC,MAAM,GAAGxD,UAAU,CAAC+F,MAAM,CAAC;EAC/BX,YAAY,EAAE;IACZY,YAAY,EAAE;EAChB,CAAC;EACDvC,OAAO,EAAE;IACPwC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE;EACd,CAAC;EACDT,UAAU,EAAE;IACVU,YAAY,EAAE;EAChB,CAAC;EACDrC,MAAM,EAAE;IACNsC,iBAAiB,EAAE,CAAC;IACpBC,aAAa,EAAE;EACjB,CAAC;EACDpD,MAAM,EAAE;IACNmD,iBAAiB,EAAE,CAAC;IACpBE,SAAS,EAAE,CAAC,CAAC;IACbD,aAAa,EAAE,EAAE;IACjBJ,iBAAiB,EAAE;EACrB,CAAC;EACDvC,OAAO,EAAE;IACPsC,YAAY,EAAE,CAAC;IACfG,YAAY,EAAE,EAAE;IAChBI,OAAO,EAAE;EACX,CAAC;EACDxB,aAAa,EAAE;IACbyB,gBAAgB,EAAE,CAAC;IACnBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -241,4 +241,99 @@ export const PlusIcon = ({
|
|
|
241
241
|
y: 5
|
|
242
242
|
}));
|
|
243
243
|
};
|
|
244
|
+
|
|
245
|
+
// https://www.figma.com/design/S3WwgTMHuqxAsfu5zElCzq/App-Icon-Library--Design-?node-id=660-148&t=vEKCP9Mq209PFHFX-0
|
|
246
|
+
export const WalletUnitAttestationIcon = ({
|
|
247
|
+
color,
|
|
248
|
+
...props
|
|
249
|
+
}) => {
|
|
250
|
+
const colorScheme = useAppColorScheme();
|
|
251
|
+
const iconColor = color !== null && color !== void 0 ? color : colorScheme.text;
|
|
252
|
+
return /*#__PURE__*/React.createElement(Svg, _extends({
|
|
253
|
+
width: 24,
|
|
254
|
+
height: 24,
|
|
255
|
+
viewBox: "0 0 24 24",
|
|
256
|
+
fill: "none"
|
|
257
|
+
}, props), /*#__PURE__*/React.createElement(Rect, {
|
|
258
|
+
x: 7.5,
|
|
259
|
+
y: 7.5,
|
|
260
|
+
width: 8,
|
|
261
|
+
height: 11,
|
|
262
|
+
rx: 1.5,
|
|
263
|
+
stroke: iconColor
|
|
264
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
265
|
+
fillRule: "evenodd",
|
|
266
|
+
clipRule: "evenodd",
|
|
267
|
+
d: "M12.176 4.882h5.295c.487 0 .882.395.882.883v8.823a.882.882 0 01-.882.883v.882c.974 0 1.764-.79 1.764-1.765V5.765c0-.975-.79-1.765-1.764-1.765h-5.295c-.974 0-1.764.79-1.764 1.765h.882c0-.488.395-.883.882-.883z",
|
|
268
|
+
fill: iconColor
|
|
269
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
270
|
+
d: "M10 17h3",
|
|
271
|
+
stroke: iconColor
|
|
272
|
+
}));
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=426-27862
|
|
276
|
+
export const StatusErrorIcon = props => {
|
|
277
|
+
const colorScheme = useAppColorScheme();
|
|
278
|
+
return /*#__PURE__*/React.createElement(Svg, _extends({
|
|
279
|
+
fill: "none",
|
|
280
|
+
height: "22",
|
|
281
|
+
viewBox: "0 0 22 22",
|
|
282
|
+
width: "22"
|
|
283
|
+
}, props), /*#__PURE__*/React.createElement(Path, {
|
|
284
|
+
d: "M10.5747 20C9.40153 20 8.29753 19.7759 7.2627 19.3276C6.22786 18.8849 5.31478 18.2679 4.52344 17.4766C3.73763 16.6852 3.12061 15.7721 2.67236 14.7373C2.22412 13.7025 2 12.5985 2 11.4253C2 10.2521 2.22412 9.14811 2.67236 8.11328C3.12061 7.07845 3.73763 6.16813 4.52344 5.38232C5.31478 4.59098 6.2251 3.97119 7.25439 3.52295C8.28923 3.07471 9.39323 2.85059 10.5664 2.85059C11.7451 2.85059 12.8519 3.07471 13.8867 3.52295C14.9215 3.97119 15.8346 4.59098 16.626 5.38232C17.4173 6.16813 18.0371 7.07845 18.4854 8.11328C18.9336 9.14811 19.1577 10.2521 19.1577 11.4253C19.1577 12.5985 18.9336 13.7025 18.4854 14.7373C18.0371 15.7721 17.4173 16.6852 16.626 17.4766C15.8346 18.2679 14.9215 18.8849 13.8867 19.3276C12.8519 19.7759 11.7479 20 10.5747 20Z",
|
|
285
|
+
fill: colorScheme.error
|
|
286
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
287
|
+
d: "M3.81385 18.1812L3.81633 18.1837C4.69776 19.0651 5.71679 19.7536 6.86722 20.2461C8.032 20.7503 9.27117 21 10.5747 21C11.8782 21 13.1174 20.7503 14.2821 20.2461C15.4326 19.7537 16.4516 19.0651 17.3331 18.1837C18.2142 17.3026 18.9051 16.2842 19.403 15.1348C19.9077 13.9694 20.1577 12.7296 20.1577 11.4253C20.1577 10.121 19.9077 8.88117 19.403 7.71581C18.905 6.56624 18.2138 5.55009 17.3318 4.67398C16.451 3.79349 15.4331 3.103 14.2842 2.60533C13.1182 2.10029 11.8755 1.85059 10.5664 1.85059C9.26213 1.85059 8.02228 2.10055 6.85692 2.60533L6.85513 2.60611C5.71136 3.10421 4.69653 3.79502 3.81633 4.67522C2.94015 5.5514 2.25228 6.56718 1.75475 7.71581C1.24997 8.88117 1 10.121 1 11.4253C1 12.7296 1.24997 13.9694 1.75475 15.1348C2.252 16.2828 2.93915 17.3003 3.81385 18.1812Z",
|
|
288
|
+
stroke: colorScheme.white,
|
|
289
|
+
strokeOpacity: "0.2",
|
|
290
|
+
strokeWidth: "2"
|
|
291
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
292
|
+
d: "M8.43311 14.7124C8.27262 14.8618 8.07894 14.9365 7.85205 14.9365C7.63623 14.9365 7.45085 14.8618 7.2959 14.7124C7.14648 14.5575 7.07178 14.3721 7.07178 14.1562C7.07178 13.9404 7.14925 13.7578 7.3042 13.6084L9.4707 11.4336L7.3042 9.27539C7.14925 9.11491 7.07178 8.93229 7.07178 8.72754C7.07178 8.50065 7.14648 8.31527 7.2959 8.17139C7.45085 8.02197 7.63623 7.94727 7.85205 7.94727C8.06787 7.94727 8.25326 8.01921 8.4082 8.16309L10.583 10.3296L12.7661 8.16309C12.9211 8.00814 13.1064 7.93066 13.3223 7.93066C13.5381 7.93066 13.7207 8.00814 13.8701 8.16309C14.0251 8.3125 14.1025 8.49512 14.1025 8.71094C14.1025 8.92122 14.0251 9.10661 13.8701 9.26709L11.6953 11.4336L13.8618 13.6001C14.0168 13.744 14.0942 13.9294 14.0942 14.1562C14.0942 14.3721 14.0168 14.5575 13.8618 14.7124C13.7124 14.8618 13.527 14.9365 13.3057 14.9365C13.0788 14.9365 12.8906 14.8618 12.7412 14.7124L10.583 12.5459L8.43311 14.7124Z",
|
|
293
|
+
fill: colorScheme.white
|
|
294
|
+
}));
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=454-100241
|
|
298
|
+
export const StatusSuccessIcon = props => {
|
|
299
|
+
const colorScheme = useAppColorScheme();
|
|
300
|
+
return /*#__PURE__*/React.createElement(Svg, _extends({
|
|
301
|
+
fill: "none",
|
|
302
|
+
height: "22",
|
|
303
|
+
viewBox: "0 0 22 22",
|
|
304
|
+
width: "22"
|
|
305
|
+
}, props), /*#__PURE__*/React.createElement(Path, {
|
|
306
|
+
d: "M10.5747 20C9.40153 20 8.29753 19.7759 7.2627 19.3276C6.22786 18.8849 5.31478 18.2679 4.52344 17.4766C3.73763 16.6852 3.12061 15.7721 2.67236 14.7373C2.22412 13.7025 2 12.5985 2 11.4253C2 10.2521 2.22412 9.14811 2.67236 8.11328C3.12061 7.07845 3.73763 6.16813 4.52344 5.38232C5.31478 4.59098 6.2251 3.97119 7.25439 3.52295C8.28923 3.07471 9.39323 2.85059 10.5664 2.85059C11.7451 2.85059 12.8519 3.07471 13.8867 3.52295C14.9215 3.97119 15.8346 4.59098 16.626 5.38232C17.4173 6.16813 18.0371 7.07845 18.4854 8.11328C18.9336 9.14811 19.1577 10.2521 19.1577 11.4253C19.1577 12.5985 18.9336 13.7025 18.4854 14.7373C18.0371 15.7721 17.4173 16.6852 16.626 17.4766C15.8346 18.2679 14.9215 18.8849 13.8867 19.3276C12.8519 19.7759 11.7479 20 10.5747 20Z",
|
|
307
|
+
fill: colorScheme.success
|
|
308
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
309
|
+
d: "M3.81385 18.1812L3.81633 18.1837C4.69776 19.0651 5.71679 19.7536 6.86722 20.2461C8.032 20.7503 9.27117 21 10.5747 21C11.8782 21 13.1174 20.7503 14.2821 20.2461C15.4326 19.7537 16.4516 19.0651 17.3331 18.1837C18.2142 17.3026 18.9051 16.2842 19.403 15.1348C19.9077 13.9694 20.1577 12.7296 20.1577 11.4253C20.1577 10.121 19.9077 8.88117 19.403 7.71581C18.905 6.56624 18.2138 5.55009 17.3318 4.67398C16.451 3.79349 15.4331 3.103 14.2842 2.60533C13.1182 2.10029 11.8755 1.85059 10.5664 1.85059C9.26213 1.85059 8.02228 2.10055 6.85692 2.60533L6.85513 2.60611C5.71136 3.10421 4.69653 3.79502 3.81633 4.67522C2.94015 5.5514 2.25228 6.56718 1.75475 7.71581C1.24997 8.88117 1 10.121 1 11.4253C1 12.7296 1.24997 13.9694 1.75475 15.1348C2.252 16.2828 2.93915 17.3003 3.81385 18.1812Z",
|
|
310
|
+
stroke: "white",
|
|
311
|
+
strokeOpacity: "0.2",
|
|
312
|
+
strokeWidth: "2"
|
|
313
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
314
|
+
d: "M9.91406 15.3828C10.0703 15.3828 10.2135 15.3464 10.3438 15.2734C10.4792 15.1953 10.5938 15.0885 10.6875 14.9531L14.3359 9.3125C14.3932 9.22396 14.4401 9.13021 14.4766 9.03125C14.5182 8.93229 14.5391 8.83333 14.5391 8.73438C14.5391 8.51562 14.4557 8.33854 14.2891 8.20312C14.1276 8.06771 13.9427 8 13.7344 8C13.4583 8 13.2266 8.14844 13.0391 8.44531L9.89062 13.4766L8.44531 11.6641C8.34115 11.5339 8.23698 11.4427 8.13281 11.3906C8.02865 11.3333 7.91146 11.3047 7.78125 11.3047C7.5625 11.3047 7.3776 11.3828 7.22656 11.5391C7.07552 11.6901 7 11.875 7 12.0938C7 12.1979 7.01823 12.2995 7.05469 12.3984C7.09635 12.4922 7.15365 12.5885 7.22656 12.6875L9.10938 14.9531C9.22396 15.099 9.34635 15.2083 9.47656 15.2812C9.60677 15.349 9.7526 15.3828 9.91406 15.3828Z",
|
|
315
|
+
fill: "white"
|
|
316
|
+
}));
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=415-5641&m=dev
|
|
320
|
+
export const StatusWarningIcon = ({
|
|
321
|
+
...props
|
|
322
|
+
}) => /*#__PURE__*/React.createElement(Svg, _extends({
|
|
323
|
+
fill: "none",
|
|
324
|
+
height: 20,
|
|
325
|
+
viewBox: "0 0 22 20",
|
|
326
|
+
width: 22
|
|
327
|
+
}, props), /*#__PURE__*/React.createElement(Path, {
|
|
328
|
+
d: "M4.357 17.967c-.481 0-.899-.105-1.253-.315a2.196 2.196 0 01-.822-.847A2.473 2.473 0 012 15.627c0-.421.11-.822.332-1.204L8.757 3.225c.216-.393.506-.689.871-.888a2.36 2.36 0 011.146-.299c.398 0 .777.1 1.137.299.36.194.653.49.88.888l6.425 11.198a2.384 2.384 0 01.332 1.204c0 .431-.097.824-.29 1.178a2.196 2.196 0 01-.822.847c-.35.21-.764.315-1.246.315H4.357z",
|
|
329
|
+
fill: "#F7BF0B"
|
|
330
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
331
|
+
d: "M1.4 17.274h-.001l.006.011c.281.515.683.927 1.188 1.227.534.316 1.134.455 1.764.455H17.19c.63 0 1.229-.138 1.759-.457.504-.3.905-.711 1.186-1.225.28-.512.413-1.071.413-1.659a3.345 3.345 0 00-.467-1.705L13.66 2.73v-.002a3.226 3.226 0 00-1.27-1.27 3.312 3.312 0 00-1.616-.42 3.36 3.36 0 00-1.624.42 3.172 3.172 0 00-1.265 1.276L1.467 13.92l-.001.002A3.364 3.364 0 001 15.627c0 .582.128 1.138.4 1.647z",
|
|
332
|
+
stroke: "#fff",
|
|
333
|
+
strokeOpacity: 0.2,
|
|
334
|
+
strokeWidth: 2
|
|
335
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
336
|
+
d: "M11.538 11.51c-.011.514-.263.771-.756.771-.503 0-.763-.254-.78-.763l-.116-4.184a.766.766 0 01.232-.614c.166-.166.385-.25.656-.25.266 0 .484.084.656.25.171.16.252.368.24.622l-.132 4.167zM11.496 14.871c-.2.177-.437.266-.714.266-.277 0-.517-.089-.722-.266a.87.87 0 01-.299-.68c0-.272.1-.499.3-.681.198-.183.439-.274.721-.274.277 0 .515.091.714.274.2.182.299.41.299.68a.87.87 0 01-.299.681z",
|
|
337
|
+
fill: "#000"
|
|
338
|
+
}));
|
|
244
339
|
//# sourceMappingURL=icons.js.map
|