@procivis/one-react-native-components 0.3.99 → 0.3.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/history/history-list-item-icon.js +5 -3
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/history/history-list-screen.js +1 -0
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js +2 -14
- package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +1 -0
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +1 -0
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/connectivity-button.js +1 -0
- package/lib/commonjs/ui-components/buttons/connectivity-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/filter-button.js +1 -0
- package/lib/commonjs/ui-components/buttons/filter-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/ghost-button.js +1 -0
- package/lib/commonjs/ui-components/buttons/ghost-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/hold-button.js +1 -0
- package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/scan-button.js +3 -0
- package/lib/commonjs/ui-components/buttons/scan-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/share-button.js +1 -0
- package/lib/commonjs/ui-components/buttons/share-button.js.map +1 -1
- package/lib/commonjs/ui-components/control/checkbox.js +1 -0
- package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-card.js +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +3 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-header.js +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-header.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js +2 -0
- package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js +1 -0
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js +2 -1
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/commonjs/ui-components/credential/selector.js +1 -0
- package/lib/commonjs/ui-components/credential/selector.js.map +1 -1
- package/lib/commonjs/ui-components/entity/avatar.js +1 -0
- package/lib/commonjs/ui-components/entity/avatar.js.map +1 -1
- package/lib/commonjs/ui-components/header/foldable-header.js +26 -16
- package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
- package/lib/commonjs/ui-components/header/navigation-header.js +1 -0
- package/lib/commonjs/ui-components/header/navigation-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/history.js +1 -0
- package/lib/commonjs/ui-components/icons/history.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/notice/index.js +14 -0
- package/lib/commonjs/ui-components/notice/index.js.map +1 -0
- package/lib/commonjs/ui-components/notice/wallet-notice.js +80 -0
- package/lib/commonjs/ui-components/notice/wallet-notice.js.map +1 -0
- package/lib/commonjs/ui-components/pin/keypad.js +1 -0
- package/lib/commonjs/ui-components/pin/keypad.js.map +1 -1
- package/lib/commonjs/ui-components/pin/pins.js +1 -0
- package/lib/commonjs/ui-components/pin/pins.js.map +1 -1
- package/lib/commonjs/ui-components/settings/setting-item.js +1 -0
- package/lib/commonjs/ui-components/settings/setting-item.js.map +1 -1
- package/lib/commonjs/ui-components/settings/settings-button.js +1 -0
- package/lib/commonjs/ui-components/settings/settings-button.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +12 -2
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +4 -10
- 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/history/history-list-item-icon.js +5 -3
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/history/history-list-screen.js +1 -0
- package/lib/module/components/history/history-list-screen.js.map +1 -1
- package/lib/module/components/proof-request/v1/share-credential.js +2 -14
- package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js +1 -0
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2.js +1 -0
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/module/ui-components/buttons/connectivity-button.js +1 -0
- package/lib/module/ui-components/buttons/connectivity-button.js.map +1 -1
- package/lib/module/ui-components/buttons/filter-button.js +1 -0
- package/lib/module/ui-components/buttons/filter-button.js.map +1 -1
- package/lib/module/ui-components/buttons/ghost-button.js +1 -0
- package/lib/module/ui-components/buttons/ghost-button.js.map +1 -1
- package/lib/module/ui-components/buttons/hold-button.js +1 -0
- package/lib/module/ui-components/buttons/hold-button.js.map +1 -1
- package/lib/module/ui-components/buttons/scan-button.js +3 -0
- package/lib/module/ui-components/buttons/scan-button.js.map +1 -1
- package/lib/module/ui-components/buttons/share-button.js +1 -0
- package/lib/module/ui-components/buttons/share-button.js.map +1 -1
- package/lib/module/ui-components/control/checkbox.js +1 -0
- package/lib/module/ui-components/control/checkbox.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-card.js +1 -0
- package/lib/module/ui-components/credential/card/credential-card.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +3 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-list-item.js +1 -0
- package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-header.js +1 -0
- package/lib/module/ui-components/credential/card/credential-header.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-image-carousel.js +2 -0
- package/lib/module/ui-components/credential/card/credential-image-carousel.js.map +1 -1
- package/lib/module/ui-components/credential/credential-attribute-item.js +1 -0
- package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/module/ui-components/credential/credential-carousel-images.js +2 -1
- package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/module/ui-components/credential/selector.js +1 -0
- package/lib/module/ui-components/credential/selector.js.map +1 -1
- package/lib/module/ui-components/entity/avatar.js +1 -0
- package/lib/module/ui-components/entity/avatar.js.map +1 -1
- package/lib/module/ui-components/header/foldable-header.js +26 -16
- package/lib/module/ui-components/header/foldable-header.js.map +1 -1
- package/lib/module/ui-components/header/navigation-header.js +1 -0
- package/lib/module/ui-components/header/navigation-header.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +3 -1
- package/lib/module/ui-components/history/history-details.js.map +1 -1
- package/lib/module/ui-components/icons/history.js +1 -0
- package/lib/module/ui-components/icons/history.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/notice/index.js +3 -0
- package/lib/module/ui-components/notice/index.js.map +1 -0
- package/lib/module/ui-components/notice/wallet-notice.js +72 -0
- package/lib/module/ui-components/notice/wallet-notice.js.map +1 -0
- package/lib/module/ui-components/pin/keypad.js +1 -0
- package/lib/module/ui-components/pin/keypad.js.map +1 -1
- package/lib/module/ui-components/pin/pins.js +1 -0
- package/lib/module/ui-components/pin/pins.js.map +1 -1
- package/lib/module/ui-components/settings/setting-item.js +1 -0
- package/lib/module/ui-components/settings/setting-item.js.map +1 -1
- package/lib/module/ui-components/settings/settings-button.js +1 -0
- package/lib/module/ui-components/settings/settings-button.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/parsers/credential-images.js +1 -1
- package/lib/module/utils/parsers/credential-images.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +4 -10
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/typescript/ui-components/index.d.ts +1 -0
- package/lib/typescript/ui-components/notice/index.d.ts +2 -0
- package/lib/typescript/ui-components/notice/wallet-notice.d.ts +11 -0
- package/lib/typescript/utils/hooks/core/proofs.d.ts +5 -3
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +2 -2
- package/lib/typescript/utils/parsers/credential.d.ts +2 -29
- package/package.json +3 -3
- package/src/components/history/history-list-item-icon.tsx +4 -2
- package/src/components/history/history-list-screen.tsx +1 -0
- package/src/components/proof-request/v1/share-credential.tsx +1 -18
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +1 -0
- package/src/components/proof-request/v2/share-credential-v2.tsx +1 -0
- package/src/ui-components/buttons/connectivity-button.tsx +1 -0
- package/src/ui-components/buttons/filter-button.tsx +1 -0
- package/src/ui-components/buttons/ghost-button.tsx +1 -0
- package/src/ui-components/buttons/hold-button.tsx +1 -0
- package/src/ui-components/buttons/scan-button.tsx +3 -0
- package/src/ui-components/buttons/share-button.tsx +1 -0
- package/src/ui-components/control/checkbox.tsx +1 -0
- package/src/ui-components/credential/card/credential-card.tsx +1 -0
- package/src/ui-components/credential/card/credential-details-card.tsx +2 -0
- package/src/ui-components/credential/card/credential-details-list-item.tsx +1 -0
- package/src/ui-components/credential/card/credential-header.tsx +1 -0
- package/src/ui-components/credential/card/credential-image-carousel.tsx +2 -2
- package/src/ui-components/credential/credential-attribute-item.tsx +1 -0
- package/src/ui-components/credential/credential-carousel-images.tsx +1 -0
- package/src/ui-components/credential/selector.tsx +1 -0
- package/src/ui-components/entity/avatar.tsx +1 -0
- package/src/ui-components/header/foldable-header.tsx +27 -20
- package/src/ui-components/header/navigation-header.tsx +1 -0
- package/src/ui-components/history/history-details.tsx +2 -0
- package/src/ui-components/icons/history.tsx +1 -0
- package/src/ui-components/index.ts +1 -0
- package/src/ui-components/notice/index.ts +3 -0
- package/src/ui-components/notice/wallet-notice.tsx +82 -0
- package/src/ui-components/pin/keypad.tsx +1 -0
- package/src/ui-components/pin/pins.tsx +1 -0
- package/src/ui-components/settings/setting-item.tsx +1 -0
- package/src/ui-components/settings/settings-button.tsx +1 -0
- package/src/utils/hooks/core/proofs.ts +10 -2
- package/src/utils/parsers/credential-images.tsx +1 -1
- package/src/utils/parsers/credential-sharing-v2.tsx +0 -1
- package/src/utils/parsers/credential-sharing.tsx +1 -10
- package/src/utils/parsers/credential.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","concatTestID","Button","ButtonType","DownIcon","UpIcon","useAppColorScheme","CredentialAttributeItem","CredentialCard","CredentialCardRatio","PREVIEW_ATTRIBUTES_COUNT","SEE_ALL_BUTTON_HEIGHT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","previewAttributesHeight","setPreviewAttributesHeight","fullAttributesHeight","setFullAttributesHeight","allAttributesRendered","setAllAttributesRendered","length","CaretIcon","cardHeight","Math","ceil","width","currentHeight","undefined","previewAttributes","slice","extraAttributes","viewStyle","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","buttonViewHeight","additionalAttributesHeight","additionalHeight","fullHeight","value","newHeight","duration","animatedStyle","height","onPreviewAttrContentLayout","event","nativeEvent","layout","onFullAttrContentLayout","footerView","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","ContainerComponent","_extends","detailsCard","backgroundColor","white","accessory","onHeaderPress","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","buttonWrapper","type","Secondary","title","index","create","paddingHorizontal","paddingTop","borderRadius","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,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CAAE;IAC1CV,MAAM,EAAErB,YAAY,CAACqB,MAAM,EAAE,WAAW,EAAEuE,KAAK,CAACN,QAAQ,CAAC,CAAC,CAAE;IAC5DrE,cAAc,EAAEA,cAAe;IAC/BsE,OAAO,EAAErE;EAAoB,GACzB+D,SAAS,CACd,CACF,CACG,CAEJ,CACF,CACP,EACAlB,UAAU,gBAAG1E,KAAA,CAAA6E,aAAA,CAACvE,IAAI;IAACwB,KAAK,EAAEyB,MAAM,CAAC5B;EAAO,GAAE+C,UAAiB,CAAC,GAAG,IAC9C,CAAC;AAEzB,CAAC;AAED,MAAMnB,MAAM,GAAGlD,UAAU,CAACmG,MAAM,CAAC;EAC/BhD,oBAAoB,EAAE;IACpBG,aAAa,EAAE,EAAE;IACjB8C,iBAAiB,EAAE,CAAC;IACpB1D,KAAK,EAAE;EACT,CAAC;EACDU,8BAA8B,EAAE;IAC9BE,aAAa,EAAE;EACjB,CAAC;EACD6B,iBAAiB,EAAE;IACjBkB,UAAU,EAAE,CAAC;IACb3D,KAAK,EAAE;EACT,CAAC;EACDoD,aAAa,EAAE;IACb/B,MAAM,EAAE/C,qBAAqB;IAC7BsC,aAAa,EAAE,EAAE;IACjB8C,iBAAiB,EAAE,CAAC;IACpB1D,KAAK,EAAE;EACT,CAAC;EACDtB,IAAI,EAAE;IACJkF,YAAY,EAAE;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":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","concatTestID","Button","ButtonType","DownIcon","UpIcon","useAppColorScheme","CredentialAttributeItem","CredentialCard","CredentialCardRatio","PREVIEW_ATTRIBUTES_COUNT","SEE_ALL_BUTTON_HEIGHT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","previewAttributesHeight","setPreviewAttributesHeight","fullAttributesHeight","setFullAttributesHeight","allAttributesRendered","setAllAttributesRendered","length","CaretIcon","cardHeight","Math","ceil","width","currentHeight","undefined","previewAttributes","slice","extraAttributes","viewStyle","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","buttonViewHeight","additionalAttributesHeight","additionalHeight","fullHeight","value","newHeight","duration","animatedStyle","height","onPreviewAttrContentLayout","event","nativeEvent","layout","onFullAttrContentLayout","footerView","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","ContainerComponent","_extends","detailsCard","backgroundColor","white","accessory","onHeaderPress","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","buttonWrapper","type","Secondary","title","index","create","paddingHorizontal","paddingTop","borderRadius","borderWidth","overflow","marginTop"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps, CredentialCardRatio } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\nconst SEE_ALL_BUTTON_HEIGHT = 78;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n\n const CaretIcon = expanded ? UpIcon : DownIcon;\n\n const cardHeight = Math.ceil(card.width / CredentialCardRatio);\n const currentHeight = useSharedValue<number | undefined>(undefined);\n\n const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];\n const extraAttributes = useMemo(() => (attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : []), [attributes]);\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const buttonViewHeight = !extraAttributes || allAttributesRendered ? 0 : SEE_ALL_BUTTON_HEIGHT;\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;\n const fullHeight = previewAttributesHeight + additionalHeight;\n\n if (!animate) {\n currentHeight.value = fullHeight;\n return;\n }\n\n const newHeight = expanded ? fullHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = fullHeight / 5;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n currentHeight,\n animate,\n expanded,\n extraAttributes,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n ]);\n\n const animatedStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: cardHeight,\n };\n }\n return {\n height: cardHeight + currentHeight.value,\n };\n }, [expanded, currentHeight]);\n\n const onPreviewAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setPreviewAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onFullAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setFullAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const footerView: ReactElement | undefined = useMemo(() => {\n if (!footer) {\n return undefined;\n }\n if (React.isValidElement(footer)) {\n return footer;\n } else {\n const FooterComponent = footer as React.ComponentType<any>;\n return <FooterComponent />;\n }\n }, [footer]);\n\n const { header, ...cardProps } = card;\n\n const renderExtraAttributes =\n allAttributesRendered || (previewAttributesHeight !== undefined && currentHeight.value !== undefined);\n\n const ContainerComponent = animate ? Animated.View : View;\n return (\n <ContainerComponent\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, animate ? animatedStyle : undefined, style]}\n {...viewProps}\n testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>\n <CredentialCard\n {...cardProps}\n header={{ ...header, accessory: header.accessory ?? (cardProps.onHeaderPress ? CaretIcon : undefined) }}\n style={[styles.card, cardProps.style]}\n />\n {previewAttributes.length > 0 && (\n <View>\n <View style={styles.attributesWrapper}>\n <View onLayout={onPreviewAttrContentLayout} style={styles.previewAttributesWrapper}>\n {previewAttributes.map((attribute, idx) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && !extraAttributes.length && idx === previewAttributes.length - 1}\n testID={concatTestID(testID, 'attribute', idx.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n {!allAttributesRendered && extraAttributes.length > 0 && (\n <View style={styles.buttonWrapper}>\n <Button\n onPress={() => setAllAttributesRendered(true)}\n type={ButtonType.Secondary}\n testID={concatTestID(testID, 'showAllAttributesButton')}\n title={showAllButtonLabel!}\n />\n </View>\n )}\n {renderExtraAttributes && (\n <View\n style={[styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter]}\n onLayout={onFullAttrContentLayout}>\n {extraAttributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && index === length - 1}\n testID={concatTestID(testID, 'attribute', index.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n )}\n </View>\n </View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </ContainerComponent>\n );\n};\n\nconst styles = StyleSheet.create({\n allAttributesWrapper: {\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n allAttributesWrapperWithFooter: {\n paddingBottom: 0,\n },\n attributesWrapper: {\n paddingTop: 7,\n width: '100%',\n },\n buttonWrapper: {\n height: SEE_ALL_BUTTON_HEIGHT,\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n card: {\n borderRadius: 0,\n borderWidth: 0,\n },\n detailsCard: {\n borderRadius: 10,\n borderWidth: 0,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAqCC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACzG,SAAiDC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAClG,OAAOC,QAAQ,IAAIC,gB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;IACpB1D,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAezB,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useState","StyleSheet","Animated","LinearTransition","CredentialCardRatio","CredentialCardShadow","CredentialDetailsCard","CredentialDetailsCardListItem","detailsCardStyle","expanded","lastItem","style","props","detailsCardHeight","setDetailsCardHeight","cardWidth","card","width","minHeight","Math","ceil","onContentLayout","event","_StyleSheet$flatten$b","_StyleSheet$flatten","height","nativeEvent","layout","borderWidth","flatten","cardHeight","round","createElement","View","styles","animatedWrapper","cardWrapper","_extends","animate","onLayout","create","borderRadius","overflow"],"sources":["credential-details-list-item.tsx"],"sourcesContent":["import React, { FC, useCallback, useState } from 'react';\nimport { LayoutChangeEvent, StyleProp, StyleSheet, ViewStyle } from 'react-native';\nimport Animated, { LinearTransition } 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 [detailsCardHeight, setDetailsCardHeight] = useState<number>();\n const cardWidth = props.card.width;\n const minHeight = lastItem ? Math.ceil(cardWidth / CredentialCardRatio) : 60;\n\n const onContentLayout = useCallback(\n (event: LayoutChangeEvent) => {\n const { 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 setDetailsCardHeight(cardHeight);\n },\n [style, detailsCardHeight],\n );\n\n return (\n <Animated.View\n layout={LinearTransition}\n style={[\n styles.animatedWrapper,\n // eslint-disable-next-line react-native/no-inline-styles\n {\n height: expanded ? 'auto' : minHeight,\n },\n style,\n ]}>\n <Animated.View\n layout={LinearTransition}\n style={[\n styles.cardWrapper,\n // eslint-disable-next-line react-native/no-inline-styles\n {\n height: expanded ? 'auto' : Math.ceil(cardWidth / CredentialCardRatio),\n },\n ]}>\n <CredentialDetailsCard\n animate={false}\n expanded={true}\n onLayout={onContentLayout}\n style={detailsCardStyle}\n {...props}\n />\n </Animated.View>\n </Animated.View>\n );\n};\n\nconst styles = StyleSheet.create({\n animatedWrapper: {\n ...CredentialCardShadow,\n },\n cardWrapper: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n});\n\nexport default CredentialDetailsCardListItem;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SAAuCC,UAAU,QAAmB,cAAc;AAClF,OAAOC,QAAQ,IAAIC,gBAAgB,QAAQ,yBAAyB;AAEpE,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,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGd,QAAQ,CAAS,CAAC;EACpE,MAAMe,SAAS,GAAGH,KAAK,CAACI,IAAI,CAACC,KAAK;EAClC,MAAMC,SAAS,GAAGR,QAAQ,GAAGS,IAAI,CAACC,IAAI,CAACL,SAAS,GAAGX,mBAAmB,CAAC,GAAG,EAAE;EAE5E,MAAMiB,eAAe,GAAGtB,WAAW,CAChCuB,KAAwB,IAAK;IAAA,IAAAC,qBAAA,EAAAC,mBAAA;IAC5B,MAAM;MAAEC;IAAO,CAAC,GAAGH,KAAK,CAACI,WAAW,CAACC,MAAM;IAC3C,MAAMC,WAAW,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
|
1
|
+
{"version":3,"names":["React","useCallback","useState","StyleSheet","Animated","LinearTransition","CredentialCardRatio","CredentialCardShadow","CredentialDetailsCard","CredentialDetailsCardListItem","detailsCardStyle","expanded","lastItem","style","props","detailsCardHeight","setDetailsCardHeight","cardWidth","card","width","minHeight","Math","ceil","onContentLayout","event","_StyleSheet$flatten$b","_StyleSheet$flatten","height","nativeEvent","layout","borderWidth","flatten","cardHeight","round","createElement","View","styles","animatedWrapper","cardWrapper","_extends","animate","onLayout","create","borderRadius","overflow"],"sources":["credential-details-list-item.tsx"],"sourcesContent":["import React, { FC, useCallback, useState } from 'react';\nimport { LayoutChangeEvent, StyleProp, StyleSheet, ViewStyle } from 'react-native';\nimport Animated, { LinearTransition } 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 [detailsCardHeight, setDetailsCardHeight] = useState<number>();\n const cardWidth = props.card.width;\n const minHeight = lastItem ? Math.ceil(cardWidth / CredentialCardRatio) : 60;\n\n const onContentLayout = useCallback(\n (event: LayoutChangeEvent) => {\n const { 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 setDetailsCardHeight(cardHeight);\n },\n [style, detailsCardHeight],\n );\n\n return (\n <Animated.View\n layout={LinearTransition}\n style={[\n styles.animatedWrapper,\n // eslint-disable-next-line react-native/no-inline-styles\n {\n height: expanded ? 'auto' : minHeight,\n },\n style,\n ]}>\n <Animated.View\n layout={LinearTransition}\n style={[\n styles.cardWrapper,\n // eslint-disable-next-line react-native/no-inline-styles\n {\n height: expanded ? 'auto' : Math.ceil(cardWidth / CredentialCardRatio),\n },\n ]}>\n <CredentialDetailsCard\n animate={false}\n expanded={true}\n onLayout={onContentLayout}\n style={detailsCardStyle}\n {...props}\n />\n </Animated.View>\n </Animated.View>\n );\n};\n\nconst styles = StyleSheet.create({\n animatedWrapper: {\n ...CredentialCardShadow,\n },\n cardWrapper: {\n borderRadius: 10,\n borderWidth: 0,\n overflow: 'hidden',\n },\n});\n\nexport default CredentialDetailsCardListItem;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SAAuCC,UAAU,QAAmB,cAAc;AAClF,OAAOC,QAAQ,IAAIC,gBAAgB,QAAQ,yBAAyB;AAEpE,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,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGd,QAAQ,CAAS,CAAC;EACpE,MAAMe,SAAS,GAAGH,KAAK,CAACI,IAAI,CAACC,KAAK;EAClC,MAAMC,SAAS,GAAGR,QAAQ,GAAGS,IAAI,CAACC,IAAI,CAACL,SAAS,GAAGX,mBAAmB,CAAC,GAAG,EAAE;EAE5E,MAAMiB,eAAe,GAAGtB,WAAW,CAChCuB,KAAwB,IAAK;IAAA,IAAAC,qBAAA,EAAAC,mBAAA;IAC5B,MAAM;MAAEC;IAAO,CAAC,GAAGH,KAAK,CAACI,WAAW,CAACC,MAAM;IAC3C,MAAMC,WAAW,IAAAL,qBAAA,IAAAC,mBAAA,GAAGvB,UAAU,CAAC4B,OAAO,CAAClB,KAAK,CAAC,cAAAa,mB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ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","StyleSheet","View","concatTestID","BlurView","ImageOrComponent","Typography","useAppColorScheme","CredentialHeader","accessory","blur","color","credentialDetailPrimary","credentialDetailSecondary","credentialDetailTestID","credentialDetailErrorColor","credentialName","icon","iconLabelColor","statusIcon","style","testID","colorScheme","statusIconView","undefined","isValidElement","StatusIconComponent","createElement","accessoryView","AccessoryComponent","DetailText","commonProps","error","text","ellipsizeMode","numberOfLines","preset","styles","detailText","detailTextContainer","_extends","Fragment","interpunct","container","backgroundColor","white","blurStyle","absoluteFill","imageContainer","source","image","String","imagePlaceholder","substring","statusIconWrapper","nameText","create","alignItems","height","justifyContent","width","flexDirection","padding","flex","opacity","marginTop","borderRadius","marginRight","overflow","paddingLeft","paddingTop","textTransform","marginHorizontal","bottom","left","position"],"sources":["credential-header.tsx"],"sourcesContent":["import React, { FC, useMemo } from 'react';\nimport { AccessibilityProps, ColorValue, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../../utils/testID';\nimport BlurView from '../../blur/blur-view';\nimport ImageOrComponent, { ImageOrComponentSource } from '../../image/image-or-component';\nimport Typography, { TypographyProps } from '../../text/typography';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\n\nexport interface CredentialHeaderProps extends AccessibilityProps {\n accessory?: React.ComponentType<any> | React.ReactElement;\n blur?: boolean;\n color?: ColorValue;\n credentialDetailPrimary?: string;\n credentialDetailSecondary?: string;\n credentialDetailTestID?: string;\n credentialDetailErrorColor?: boolean;\n credentialName: string;\n icon?: ImageOrComponentSource;\n iconLabelColor?: ColorValue;\n statusIcon?: React.ComponentType<any> | React.ReactElement;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\nconst CredentialHeader: FC<CredentialHeaderProps> = ({\n accessory,\n blur = true,\n color = '#5A69F3',\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailTestID,\n credentialDetailErrorColor,\n credentialName,\n icon,\n iconLabelColor = '#FFFFFF',\n statusIcon,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const statusIconView: React.ReactElement | undefined = useMemo(() => {\n if (!statusIcon) {\n return undefined;\n }\n if (React.isValidElement(statusIcon)) {\n return statusIcon;\n } else {\n const StatusIconComponent = statusIcon as React.ComponentType<any>;\n return <StatusIconComponent />;\n }\n }, [statusIcon]);\n\n const accessoryView: React.ReactElement | undefined = useMemo(() => {\n if (!accessory) {\n return undefined;\n }\n if (React.isValidElement(accessory)) {\n return accessory;\n } else {\n const AccessoryComponent = accessory as React.ComponentType<any>;\n return <AccessoryComponent />;\n }\n }, [accessory]);\n\n const DetailText = useMemo(() => {\n if (!credentialDetailPrimary) {\n return undefined;\n }\n const commonProps: TypographyProps = {\n color: credentialDetailErrorColor ? colorScheme.error : colorScheme.text,\n ellipsizeMode: 'tail',\n numberOfLines: 1,\n preset: 'xs',\n style: styles.detailText,\n };\n return (\n <View style={styles.detailTextContainer}>\n <Typography {...commonProps} testID={credentialDetailTestID ?? concatTestID(testID, 'primaryDetail')}>\n {credentialDetailPrimary}\n </Typography>\n {credentialDetailSecondary ? (\n <>\n <Typography {...commonProps} style={styles.interpunct}>\n {'·'}\n </Typography>\n <Typography {...commonProps} testID={concatTestID(testID, 'secondaryDetail')}>\n {credentialDetailSecondary}\n </Typography>\n </>\n ) : null}\n </View>\n );\n }, [\n credentialDetailPrimary,\n credentialDetailSecondary,\n colorScheme,\n testID,\n credentialDetailErrorColor,\n credentialDetailTestID,\n ]);\n\n return (\n <View style={[styles.container, { backgroundColor: blur ? undefined : colorScheme.white }, style]} testID={testID}>\n {blur && <BlurView blurStyle=\"strong\" style={StyleSheet.absoluteFill} />}\n <View style={[styles.imageContainer, { backgroundColor: color }]}>\n {icon ? (\n <ImageOrComponent testID={concatTestID(testID, 'logoIcon')} source={icon} style={styles.image} />\n ) : (\n <View testID={concatTestID(testID, 'logoBackgroundColor', String(color))}>\n <View testID={concatTestID(testID, 'logoTextColor', String(iconLabelColor))}>\n <Typography\n testID={concatTestID(testID, 'logoName')}\n color={iconLabelColor}\n preset=\"m\"\n style={styles.imagePlaceholder}>\n {credentialName.substring(0, 1)}\n </Typography>\n </View>\n </View>\n )}\n </View>\n {statusIconView && <View style={styles.statusIconWrapper}>{statusIconView}</View>}\n <View style={styles.text}>\n <Typography\n testID={concatTestID(testID, 'name')}\n color={colorScheme.text}\n ellipsizeMode={'tail'}\n numberOfLines={1}\n preset=\"regular\"\n style={styles.nameText}>\n {credentialName}\n </Typography>\n {DetailText}\n </View>\n {accessoryView && <View style={styles.accessory}>{accessoryView}</View>}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n accessory: {\n alignItems: 'center',\n height: 44,\n justifyContent: 'center',\n width: 44,\n },\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n height: 60,\n padding: 8,\n },\n detailText: {\n flex: 1,\n opacity: 0.7,\n },\n detailTextContainer: {\n flexDirection: 'row',\n marginTop: -1,\n },\n image: {\n height: 44,\n width: 44,\n },\n imageContainer: {\n alignItems: 'center',\n borderRadius: 5,\n height: 44,\n justifyContent: 'center',\n marginRight: 8,\n overflow: 'hidden',\n width: 44,\n },\n imagePlaceholder: {\n paddingLeft: 1,\n paddingTop: 3,\n textTransform: 'uppercase',\n },\n interpunct: {\n marginHorizontal: 12,\n opacity: 0.5,\n },\n nameText: {\n marginTop: 2,\n },\n statusIconWrapper: {\n bottom: 3,\n left: 36,\n position: 'absolute',\n },\n text: {\n flex: 1,\n justifyContent: 'center',\n },\n});\n\nexport default CredentialHeader;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAC1C,SAAoDC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErG,SAASC,YAAY,QAAQ,uBAAuB;AACpD,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,gBAAgB,MAAkC,gCAAgC;AACzF,OAAOC,UAAU,MAA2B,uBAAuB;AAC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,QAAQ,EAAE;IACRU,SAAS,EAAE;EACb,CAAC;EACDX,iBAAiB,EAAE;IACjBmB,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,EAAE;IACRC,QAAQ,EAAE;EACZ,CAAC;EACD1C,IAAI,EAAE;IACJ8B,IAAI,EAAE,CAAC;IACPJ,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,eAAenD,gBAAgB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useMemo","StyleSheet","View","concatTestID","BlurView","ImageOrComponent","Typography","useAppColorScheme","CredentialHeader","accessory","blur","color","credentialDetailPrimary","credentialDetailSecondary","credentialDetailTestID","credentialDetailErrorColor","credentialName","icon","iconLabelColor","statusIcon","style","testID","colorScheme","statusIconView","undefined","isValidElement","StatusIconComponent","createElement","accessoryView","AccessoryComponent","DetailText","commonProps","error","text","ellipsizeMode","numberOfLines","preset","styles","detailText","detailTextContainer","_extends","Fragment","interpunct","container","backgroundColor","white","blurStyle","absoluteFill","imageContainer","source","image","String","imagePlaceholder","substring","statusIconWrapper","nameText","create","alignItems","height","justifyContent","width","flexDirection","padding","flex","opacity","marginTop","borderRadius","borderWidth","marginRight","overflow","paddingLeft","paddingTop","textTransform","marginHorizontal","bottom","left","position"],"sources":["credential-header.tsx"],"sourcesContent":["import React, { FC, useMemo } from 'react';\nimport { AccessibilityProps, ColorValue, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../../utils/testID';\nimport BlurView from '../../blur/blur-view';\nimport ImageOrComponent, { ImageOrComponentSource } from '../../image/image-or-component';\nimport Typography, { TypographyProps } from '../../text/typography';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\n\nexport interface CredentialHeaderProps extends AccessibilityProps {\n accessory?: React.ComponentType<any> | React.ReactElement;\n blur?: boolean;\n color?: ColorValue;\n credentialDetailPrimary?: string;\n credentialDetailSecondary?: string;\n credentialDetailTestID?: string;\n credentialDetailErrorColor?: boolean;\n credentialName: string;\n icon?: ImageOrComponentSource;\n iconLabelColor?: ColorValue;\n statusIcon?: React.ComponentType<any> | React.ReactElement;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\nconst CredentialHeader: FC<CredentialHeaderProps> = ({\n accessory,\n blur = true,\n color = '#5A69F3',\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailTestID,\n credentialDetailErrorColor,\n credentialName,\n icon,\n iconLabelColor = '#FFFFFF',\n statusIcon,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const statusIconView: React.ReactElement | undefined = useMemo(() => {\n if (!statusIcon) {\n return undefined;\n }\n if (React.isValidElement(statusIcon)) {\n return statusIcon;\n } else {\n const StatusIconComponent = statusIcon as React.ComponentType<any>;\n return <StatusIconComponent />;\n }\n }, [statusIcon]);\n\n const accessoryView: React.ReactElement | undefined = useMemo(() => {\n if (!accessory) {\n return undefined;\n }\n if (React.isValidElement(accessory)) {\n return accessory;\n } else {\n const AccessoryComponent = accessory as React.ComponentType<any>;\n return <AccessoryComponent />;\n }\n }, [accessory]);\n\n const DetailText = useMemo(() => {\n if (!credentialDetailPrimary) {\n return undefined;\n }\n const commonProps: TypographyProps = {\n color: credentialDetailErrorColor ? colorScheme.error : colorScheme.text,\n ellipsizeMode: 'tail',\n numberOfLines: 1,\n preset: 'xs',\n style: styles.detailText,\n };\n return (\n <View style={styles.detailTextContainer}>\n <Typography {...commonProps} testID={credentialDetailTestID ?? concatTestID(testID, 'primaryDetail')}>\n {credentialDetailPrimary}\n </Typography>\n {credentialDetailSecondary ? (\n <>\n <Typography {...commonProps} style={styles.interpunct}>\n {'·'}\n </Typography>\n <Typography {...commonProps} testID={concatTestID(testID, 'secondaryDetail')}>\n {credentialDetailSecondary}\n </Typography>\n </>\n ) : null}\n </View>\n );\n }, [\n credentialDetailPrimary,\n credentialDetailSecondary,\n colorScheme,\n testID,\n credentialDetailErrorColor,\n credentialDetailTestID,\n ]);\n\n return (\n <View style={[styles.container, { backgroundColor: blur ? undefined : colorScheme.white }, style]} testID={testID}>\n {blur && <BlurView blurStyle=\"strong\" style={StyleSheet.absoluteFill} />}\n <View style={[styles.imageContainer, { backgroundColor: color }]}>\n {icon ? (\n <ImageOrComponent testID={concatTestID(testID, 'logoIcon')} source={icon} style={styles.image} />\n ) : (\n <View testID={concatTestID(testID, 'logoBackgroundColor', String(color))}>\n <View testID={concatTestID(testID, 'logoTextColor', String(iconLabelColor))}>\n <Typography\n testID={concatTestID(testID, 'logoName')}\n color={iconLabelColor}\n preset=\"m\"\n style={styles.imagePlaceholder}>\n {credentialName.substring(0, 1)}\n </Typography>\n </View>\n </View>\n )}\n </View>\n {statusIconView && <View style={styles.statusIconWrapper}>{statusIconView}</View>}\n <View style={styles.text}>\n <Typography\n testID={concatTestID(testID, 'name')}\n color={colorScheme.text}\n ellipsizeMode={'tail'}\n numberOfLines={1}\n preset=\"regular\"\n style={styles.nameText}>\n {credentialName}\n </Typography>\n {DetailText}\n </View>\n {accessoryView && <View style={styles.accessory}>{accessoryView}</View>}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n accessory: {\n alignItems: 'center',\n height: 44,\n justifyContent: 'center',\n width: 44,\n },\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n height: 60,\n padding: 8,\n },\n detailText: {\n flex: 1,\n opacity: 0.7,\n },\n detailTextContainer: {\n flexDirection: 'row',\n marginTop: -1,\n },\n image: {\n height: 44,\n width: 44,\n },\n imageContainer: {\n alignItems: 'center',\n borderRadius: 5,\n borderWidth: 0,\n height: 44,\n justifyContent: 'center',\n marginRight: 8,\n overflow: 'hidden',\n width: 44,\n },\n imagePlaceholder: {\n paddingLeft: 1,\n paddingTop: 3,\n textTransform: 'uppercase',\n },\n interpunct: {\n marginHorizontal: 12,\n opacity: 0.5,\n },\n nameText: {\n marginTop: 2,\n },\n statusIconWrapper: {\n bottom: 3,\n left: 36,\n position: 'absolute',\n },\n text: {\n flex: 1,\n justifyContent: 'center',\n },\n});\n\nexport default CredentialH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AAE,QAAQ;IACxBS,WAAW,EAAE,CAAC;IACdC,QAAQ,EAAE,QAAQ;IAClBT,KAAK,EAAE;EACT,CAAC;EACDR,gBAAgB,EAAE;IAChBkB,WAAW,EAAE,CAAC;IACdC,UAAU,EAAE,CAAC;IACbC,aAAa,EAAE;EACjB,CAAC;EACD9B,UAAU,EAAE;IACV+B,gBAAgB,EAAE,EAAE;IACpBT,OAAO,EAAE;EACX,CAAC;EACDT,QAAQ,EAAE;IACRU,SAAS,EAAE;EACb,CAAC;EACDX,iBAAiB,EAAE;IACjBoB,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,EAAE;IACRC,QAAQ,EAAE;EACZ,CAAC;EACD3C,IAAI,EAAE;IACJ8B,IAAI,EAAE,CAAC;IACPJ,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,eAAenD,gBAAgB","ignoreList":[]}
|
|
@@ -68,6 +68,7 @@ const styles = StyleSheet.create({
|
|
|
68
68
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
69
69
|
Barcode: {
|
|
70
70
|
borderRadius: 4,
|
|
71
|
+
borderWidth: 0,
|
|
71
72
|
height: '50%',
|
|
72
73
|
width: '80%'
|
|
73
74
|
},
|
|
@@ -89,6 +90,7 @@ const styles = StyleSheet.create({
|
|
|
89
90
|
QrCode: {
|
|
90
91
|
aspectRatio: 1,
|
|
91
92
|
borderRadius: 4,
|
|
93
|
+
borderWidth: 0,
|
|
92
94
|
height: '70%'
|
|
93
95
|
},
|
|
94
96
|
carouselItem: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","StyleSheet","View","Carousel","Svg","Circle","concatTestID","CarouselImageType","CarouselComponent","carouselSize","imagesToRender","style","testID","selectedDot","setSelectedDot","width","height","numberOfSlides","length","createElement","styles","container","onSnapToItem","enabled","data","panGestureHandlerProps","activeOffsetX","failOffsetY","renderItem","item","type","element","carouselItem","pageDotContainer","map","_","index","key","viewBox","fill","toString","cx","cy","r","fillOpacity","create","Barcode","borderRadius","MRZ","Photo","aspectRatio","borderColor","
|
|
1
|
+
{"version":3,"names":["React","useState","StyleSheet","View","Carousel","Svg","Circle","concatTestID","CarouselImageType","CarouselComponent","carouselSize","imagesToRender","style","testID","selectedDot","setSelectedDot","width","height","numberOfSlides","length","createElement","styles","container","onSnapToItem","enabled","data","panGestureHandlerProps","activeOffsetX","failOffsetY","renderItem","item","type","element","carouselItem","pageDotContainer","map","_","index","key","viewBox","fill","toString","cx","cy","r","fillOpacity","create","Barcode","borderRadius","borderWidth","MRZ","Photo","aspectRatio","borderColor","overflow","QrCode","alignItems","justifyContent","flex","position","bottom","columnGap","flexDirection"],"sources":["credential-image-carousel.tsx"],"sourcesContent":["import React, { FC, useState } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\nimport Carousel from 'react-native-reanimated-carousel';\nimport Svg, { Circle } from 'react-native-svg';\n\nimport { concatTestID } from '../../../utils';\n\nexport enum CarouselImageType {\n Barcode = 'Barcode',\n QrCode = 'QrCode',\n MRZ = 'MRZ',\n Photo = 'Photo',\n}\n\nexport type CarouselImage = {\n type: CarouselImageType;\n element: React.ReactElement;\n};\n\ntype CarouselProps = {\n carouselSize: { width: number; height: number };\n imagesToRender: CarouselImage[];\n style?: StyleProp<ViewStyle>;\n testID?: string;\n};\n\nconst CarouselComponent: FC<CarouselProps> = ({ carouselSize, imagesToRender, style, testID }) => {\n const [selectedDot, setSelectedDot] = useState(0);\n\n if (!carouselSize.width || !carouselSize.height) {\n return null;\n }\n\n const numberOfSlides = imagesToRender.length;\n\n if (!numberOfSlides) {\n return null;\n }\n\n return (\n <View style={[styles.container, style]}>\n <Carousel\n width={carouselSize.width}\n onSnapToItem={setSelectedDot}\n height={carouselSize.height}\n enabled={numberOfSlides >= 2}\n data={imagesToRender}\n testID={testID}\n panGestureHandlerProps={{\n activeOffsetX: [-10, 10],\n failOffsetY: [-10, 10],\n }}\n renderItem={({ item: { type, element } }) => (\n <View style={styles.carouselItem}>\n <View style={[styles[type]]}>{element}</View>\n </View>\n )}\n />\n {numberOfSlides >= 2 ? (\n <View style={styles.pageDotContainer}>\n {imagesToRender.map((_, index) => (\n <Svg key={index} width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" fill=\"none\">\n <Circle\n testID={concatTestID(testID, 'dot', index.toString())}\n cx=\"4.5\"\n cy=\"4\"\n r=\"4\"\n fill=\"white\"\n fillOpacity={selectedDot === index ? 0.8 : 0.2}\n />\n </Svg>\n ))}\n </View>\n ) : null}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n // eslint-disable-next-line react-native/no-unused-styles\n Barcode: { borderRadius: 4, borderWidth: 0, height: '50%', width: '80%' },\n // eslint-disable-next-line react-native/no-unused-styles\n MRZ: {\n height: '50%',\n width: '100%',\n },\n // eslint-disable-next-line react-native/no-unused-styles\n Photo: {\n aspectRatio: 1,\n borderColor: '#FFFFFF',\n borderRadius: 100,\n borderWidth: 2,\n height: '70%',\n overflow: 'hidden',\n },\n // eslint-disable-next-line react-native/no-unused-styles\n QrCode: { aspectRatio: 1, borderRadius: 4, borderWidth: 0, height: '70%' },\n carouselItem: {\n alignItems: 'center',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n },\n container: {\n flex: 1,\n position: 'absolute',\n width: '100%',\n },\n pageDotContainer: {\n bottom: 15,\n columnGap: 8,\n flexDirection: 'row',\n justifyContent: 'center',\n },\n});\n\nexport default CarouselComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,QAAQ,QAAQ,OAAO;AAC3C,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACrE,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,GAAG,IAAIC,MAAM,QAAQ,kBAAkB;AAE9C,SAASC,YAAY,QAAQ,gBAAgB;AAE7C,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAA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ACZuB,UAAU,EAAE,QAAQ;IACpBvC,MAAM,EAAE,MAAM;IACdwC,cAAc,EAAE,QAAQ;IACxBzC,KAAK,EAAE;EACT,CAAC;EACDM,SAAS,EAAE;IACToC,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,UAAU;IACpB3C,KAAK,EAAE;EACT,CAAC;EACDkB,gBAAgB,EAAE;IAChB0B,MAAM,EAAE,EAAE;IACVC,SAAS,EAAE,CAAC;IACZC,aAAa,EAAE,KAAK;IACpBL,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,eAAehD,iBAAiB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","Image","StyleSheet","View","colorWithAlphaComponent","concatTestID","TouchableHighlight","TouchableOpacity","Typography","useAppColorScheme","CredentialAttributeItemButton","children","disabled","id","onPress","selected","colorScheme","pressHandler","createElement","style","styles","touchableAttribute","activeOpacity","backgroundColor","background","underlayColor","IMAGE_SIZE","CredentialAttributeItem","attributes","image","last","name","onImagePreview","rightAccessory","nested","listValue","testID","value","values","valueErrorColor","imagePreviewHandler","rightAccessoryView","undefined","isValidElement","RightAccessoryComponent","isObject","length","isArray","attributeItemContainer","attributeItemRow","dataItemButtonChildren","decorator","decoratorCircle","listDecoratorCircle","listImageDecoratorCircle","text","decoratorCircleInner","borderColor","decoratorLine","listDecoratorLine","listStringValueDecoratorLine","listImageDecoratorLine","objectAttributeItem","attributeItem","nestedAttributeItem","color","preset","nestedObjectLabel","dataItemLabel","dataItemImageWrapper","resizeMode","source","dataItemImage","error","numberOfLines","map","attribute","index","_extends","key","arrayValue","objectAccessory","separator","create","flex","paddingLeft","marginTop","flexDirection","alignItems","height","width","borderRadius","borderWidth","overflow","marginBottom","opacity","justifyContent","left","position","top","bottom","marginLeft","paddingVertical","alignSelf","paddingHorizontal","right","marginHorizontal"],"sources":["credential-attribute-item.tsx"],"sourcesContent":["import React, { ComponentType, FC, PropsWithChildren, ReactElement, useCallback, useMemo } from 'react';\nimport { Image, ImageSourcePropType, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { colorWithAlphaComponent } from '../../utils/color';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableHighlight, TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\ntype CredentialAttributeItemButtonProps = {\n disabled?: boolean;\n id: string;\n onPress?: (id: string, selected: boolean) => void;\n selected?: boolean;\n};\n\nconst CredentialAttributeItemButton: FC<PropsWithChildren<CredentialAttributeItemButtonProps>> = ({\n children,\n disabled,\n id,\n onPress,\n selected,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const pressHandler = useCallback(() => {\n if (!onPress) {\n return;\n }\n onPress(id, !selected);\n }, [onPress, id, selected]);\n\n if (!onPress) {\n return <View style={styles.touchableAttribute}>{children}</View>;\n }\n\n if (selected) {\n return (\n <TouchableOpacity\n activeOpacity={0.8}\n disabled={disabled}\n onPress={pressHandler}\n style={[styles.touchableAttribute, { backgroundColor: colorScheme.background }]}>\n {children}\n </TouchableOpacity>\n );\n }\n\n return (\n <TouchableHighlight\n disabled={disabled}\n onPress={pressHandler}\n underlayColor={colorWithAlphaComponent(colorScheme.background, 0.5)}\n style={styles.touchableAttribute}>\n {children}\n </TouchableHighlight>\n );\n};\n\nconst IMAGE_SIZE = 64;\n\nexport type CredentialAttributeValue =\n | {\n attributes: CredentialAttribute[];\n image?: never;\n value?: never;\n values?: never;\n valueErrorColor?: never;\n testID?: string;\n }\n | {\n attributes?: never;\n image: ImageSourcePropType;\n value?: never;\n values?: never;\n valueErrorColor?: never;\n testID?: string;\n }\n | {\n attributes?: never;\n image?: never;\n value: string;\n values?: never;\n valueErrorColor?: boolean;\n testID?: string;\n }\n | {\n attributes?: never;\n image?: never;\n value?: never;\n values: CredentialAttribute[];\n valueErrorColor?: boolean;\n testID?: string;\n };\n\nexport type CredentialAttribute = CredentialAttributeValue & {\n disabled?: boolean;\n selected?: boolean;\n nested?: boolean;\n listValue?: boolean;\n id: string;\n name?: string;\n path: string;\n rightAccessory?: ComponentType<any> | ReactElement;\n};\n\nexport type CredentialAttributeItemProps = CredentialAttribute & {\n last: boolean | undefined;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onPress?: (id: string, selected: boolean) => void;\n style?: StyleProp<ViewStyle>;\n};\n\nconst CredentialAttributeItem: FC<CredentialAttributeItemProps> = ({\n attributes,\n disabled,\n id,\n image,\n last,\n name,\n onImagePreview,\n onPress,\n rightAccessory,\n nested = false,\n listValue = false,\n selected,\n style,\n testID,\n value,\n values,\n valueErrorColor,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const imagePreviewHandler = useCallback(() => {\n if (!onImagePreview || !image) {\n return;\n }\n onImagePreview(name ?? '', image);\n }, [image, name, onImagePreview]);\n\n const rightAccessoryView: React.ReactElement | undefined = useMemo(() => {\n if (!rightAccessory) {\n return undefined;\n }\n if (React.isValidElement(rightAccessory)) {\n return rightAccessory;\n } else {\n const RightAccessoryComponent = rightAccessory as React.ComponentType<any>;\n return <RightAccessoryComponent />;\n }\n }, [rightAccessory]);\n\n const isObject = attributes && attributes.length > 0;\n const isArray = values && values.length > 0;\n\n return (\n <View style={[!nested && styles.attributeItemContainer, style]} testID={testID}>\n <View style={styles.attributeItemRow}>\n <CredentialAttributeItemButton disabled={disabled} id={id} onPress={onPress} selected={selected}>\n <View style={[styles.dataItemButtonChildren]}>\n {(isObject || isArray || listValue) && (\n <View style={styles.decorator}>\n <View\n style={[\n styles.decoratorCircle,\n listValue ? styles.listDecoratorCircle : undefined,\n listValue && image ? styles.listImageDecoratorCircle : undefined,\n { backgroundColor: colorScheme.text },\n ]}>\n <View\n style={[\n styles.decoratorCircleInner,\n { backgroundColor: colorScheme.text, borderColor: colorScheme.background },\n ]}\n />\n </View>\n <View\n style={[\n styles.decoratorLine,\n listValue ? styles.listDecoratorLine : undefined,\n listValue && value ? styles.listStringValueDecoratorLine : undefined,\n listValue && image ? styles.listImageDecoratorLine : undefined,\n { backgroundColor: colorScheme.text },\n ]}\n />\n </View>\n )}\n <View\n style={[\n isObject || isArray || listValue ? styles.objectAttributeItem : styles.attributeItem,\n nested && styles.nestedAttributeItem,\n ]}>\n {name && (\n <Typography\n color={colorScheme.text}\n preset={image ? 'xs' : 'xs/line-height-small'}\n style={isObject || isArray ? styles.nestedObjectLabel : styles.dataItemLabel}\n testID={concatTestID(testID, 'title')}>\n {name}\n </Typography>\n )}\n {image && (\n <TouchableOpacity\n disabled={!onImagePreview}\n onPress={imagePreviewHandler}\n style={[styles.dataItemImageWrapper, listValue ? styles.listValue : undefined]}>\n <Image\n resizeMode=\"cover\"\n testID={concatTestID(testID, 'image')}\n source={image}\n style={styles.dataItemImage}\n />\n </TouchableOpacity>\n )}\n {value && (\n <Typography\n color={valueErrorColor ? colorScheme.error : colorScheme.text}\n numberOfLines={10}\n preset=\"s\"\n style={listValue ? styles.listValue : undefined}\n testID={concatTestID(testID, 'value')}>\n {value}\n </Typography>\n )}\n {isObject &&\n attributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n nested={true}\n key={attribute.id}\n onPress={onPress}\n last={index === length - 1}\n onImagePreview={onImagePreview}\n {...attribute}\n />\n ))}\n {isArray &&\n values.map((arrayValue, index, { length }) => (\n <CredentialAttributeItem\n key={arrayValue.id}\n onPress={onPress}\n last={index === length - 1}\n onImagePreview={onImagePreview}\n listValue={true}\n {...arrayValue}\n name={undefined}\n />\n ))}\n <View />\n </View>\n {rightAccessoryView && (\n <View style={[styles.rightAccessory, isObject && styles.objectAccessory]}>{rightAccessoryView}</View>\n )}\n </View>\n </CredentialAttributeItemButton>\n </View>\n {!last && !nested && <View style={[styles.separator, { backgroundColor: colorScheme.background }]} />}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n attributeItem: {\n flex: 1,\n paddingLeft: 8,\n },\n attributeItemContainer: {\n marginTop: 2,\n },\n attributeItemRow: {\n flexDirection: 'row',\n },\n dataItemButtonChildren: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n dataItemImage: {\n height: IMAGE_SIZE,\n width: IMAGE_SIZE,\n },\n dataItemImageWrapper: {\n borderColor: '#0004',\n borderRadius: 4,\n borderWidth: 0.5,\n height: IMAGE_SIZE,\n marginTop: 4,\n overflow: 'hidden',\n width: IMAGE_SIZE,\n },\n dataItemLabel: {\n marginBottom: 4,\n opacity: 0.7,\n },\n decorator: {\n height: '100%',\n justifyContent: 'center',\n left: 8,\n position: 'absolute',\n },\n decoratorCircle: {\n alignItems: 'center',\n borderRadius: 3.5,\n borderWidth: 1,\n height: 7,\n justifyContent: 'center',\n position: 'absolute',\n top: 6,\n width: 7,\n },\n decoratorCircleInner: {\n borderRadius: 2,\n borderWidth: 1,\n height: 4,\n width: 4,\n },\n decoratorLine: {\n bottom: 12,\n left: 3,\n position: 'absolute',\n top: 13,\n width: 1,\n },\n listDecoratorCircle: {\n top: 18,\n },\n listDecoratorLine: {\n top: 25,\n },\n listImageDecoratorCircle: {\n top: 32,\n },\n listImageDecoratorLine: {\n bottom: 40,\n top: 39,\n },\n listStringValueDecoratorLine: {\n bottom: 24,\n },\n listValue: {\n marginLeft: 13,\n paddingVertical: 10,\n },\n nestedAttributeItem: {\n paddingLeft: 12,\n },\n nestedObjectLabel: {\n opacity: 0.7,\n paddingLeft: 13,\n },\n objectAccessory: {\n alignSelf: 'flex-start',\n },\n objectAttributeItem: {\n alignItems: 'stretch',\n flex: 1,\n paddingLeft: 12,\n },\n rightAccessory: {\n paddingHorizontal: 8,\n position: 'absolute',\n right: 0,\n },\n separator: {\n height: 1,\n marginHorizontal: 8,\n marginTop: -1,\n },\n touchableAttribute: {\n borderRadius: 8,\n flex: 1,\n paddingVertical: 11,\n },\n});\n\nexport default CredentialAttributeItem;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAwDC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACvG,SAASC,KAAK,EAAkCC,UAAU,EA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PkB,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAEF,eAAe3E,uBAAuB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","Image","StyleSheet","View","colorWithAlphaComponent","concatTestID","TouchableHighlight","TouchableOpacity","Typography","useAppColorScheme","CredentialAttributeItemButton","children","disabled","id","onPress","selected","colorScheme","pressHandler","createElement","style","styles","touchableAttribute","activeOpacity","backgroundColor","background","underlayColor","IMAGE_SIZE","CredentialAttributeItem","attributes","image","last","name","onImagePreview","rightAccessory","nested","listValue","testID","value","values","valueErrorColor","imagePreviewHandler","rightAccessoryView","undefined","isValidElement","RightAccessoryComponent","isObject","length","isArray","attributeItemContainer","attributeItemRow","dataItemButtonChildren","decorator","decoratorCircle","listDecoratorCircle","listImageDecoratorCircle","text","decoratorCircleInner","borderColor","decoratorLine","listDecoratorLine","listStringValueDecoratorLine","listImageDecoratorLine","objectAttributeItem","attributeItem","nestedAttributeItem","color","preset","nestedObjectLabel","dataItemLabel","dataItemImageWrapper","resizeMode","source","dataItemImage","error","numberOfLines","map","attribute","index","_extends","key","arrayValue","objectAccessory","separator","create","flex","paddingLeft","marginTop","flexDirection","alignItems","height","width","borderRadius","borderWidth","overflow","marginBottom","opacity","justifyContent","left","position","top","bottom","marginLeft","paddingVertical","alignSelf","paddingHorizontal","right","marginHorizontal"],"sources":["credential-attribute-item.tsx"],"sourcesContent":["import React, { ComponentType, FC, PropsWithChildren, ReactElement, useCallback, useMemo } from 'react';\nimport { Image, ImageSourcePropType, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { colorWithAlphaComponent } from '../../utils/color';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableHighlight, TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\ntype CredentialAttributeItemButtonProps = {\n disabled?: boolean;\n id: string;\n onPress?: (id: string, selected: boolean) => void;\n selected?: boolean;\n};\n\nconst CredentialAttributeItemButton: FC<PropsWithChildren<CredentialAttributeItemButtonProps>> = ({\n children,\n disabled,\n id,\n onPress,\n selected,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const pressHandler = useCallback(() => {\n if (!onPress) {\n return;\n }\n onPress(id, !selected);\n }, [onPress, id, selected]);\n\n if (!onPress) {\n return <View style={styles.touchableAttribute}>{children}</View>;\n }\n\n if (selected) {\n return (\n <TouchableOpacity\n activeOpacity={0.8}\n disabled={disabled}\n onPress={pressHandler}\n style={[styles.touchableAttribute, { backgroundColor: colorScheme.background }]}>\n {children}\n </TouchableOpacity>\n );\n }\n\n return (\n <TouchableHighlight\n disabled={disabled}\n onPress={pressHandler}\n underlayColor={colorWithAlphaComponent(colorScheme.background, 0.5)}\n style={styles.touchableAttribute}>\n {children}\n </TouchableHighlight>\n );\n};\n\nconst IMAGE_SIZE = 64;\n\nexport type CredentialAttributeValue =\n | {\n attributes: CredentialAttribute[];\n image?: never;\n value?: never;\n values?: never;\n valueErrorColor?: never;\n testID?: string;\n }\n | {\n attributes?: never;\n image: ImageSourcePropType;\n value?: never;\n values?: never;\n valueErrorColor?: never;\n testID?: string;\n }\n | {\n attributes?: never;\n image?: never;\n value: string;\n values?: never;\n valueErrorColor?: boolean;\n testID?: string;\n }\n | {\n attributes?: never;\n image?: never;\n value?: never;\n values: CredentialAttribute[];\n valueErrorColor?: boolean;\n testID?: string;\n };\n\nexport type CredentialAttribute = CredentialAttributeValue & {\n disabled?: boolean;\n selected?: boolean;\n nested?: boolean;\n listValue?: boolean;\n id: string;\n name?: string;\n path: string;\n rightAccessory?: ComponentType<any> | ReactElement;\n};\n\nexport type CredentialAttributeItemProps = CredentialAttribute & {\n last: boolean | undefined;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onPress?: (id: string, selected: boolean) => void;\n style?: StyleProp<ViewStyle>;\n};\n\nconst CredentialAttributeItem: FC<CredentialAttributeItemProps> = ({\n attributes,\n disabled,\n id,\n image,\n last,\n name,\n onImagePreview,\n onPress,\n rightAccessory,\n nested = false,\n listValue = false,\n selected,\n style,\n testID,\n value,\n values,\n valueErrorColor,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const imagePreviewHandler = useCallback(() => {\n if (!onImagePreview || !image) {\n return;\n }\n onImagePreview(name ?? '', image);\n }, [image, name, onImagePreview]);\n\n const rightAccessoryView: React.ReactElement | undefined = useMemo(() => {\n if (!rightAccessory) {\n return undefined;\n }\n if (React.isValidElement(rightAccessory)) {\n return rightAccessory;\n } else {\n const RightAccessoryComponent = rightAccessory as React.ComponentType<any>;\n return <RightAccessoryComponent />;\n }\n }, [rightAccessory]);\n\n const isObject = attributes && attributes.length > 0;\n const isArray = values && values.length > 0;\n\n return (\n <View style={[!nested && styles.attributeItemContainer, style]} testID={testID}>\n <View style={styles.attributeItemRow}>\n <CredentialAttributeItemButton disabled={disabled} id={id} onPress={onPress} selected={selected}>\n <View style={[styles.dataItemButtonChildren]}>\n {(isObject || isArray || listValue) && (\n <View style={styles.decorator}>\n <View\n style={[\n styles.decoratorCircle,\n listValue ? styles.listDecoratorCircle : undefined,\n listValue && image ? styles.listImageDecoratorCircle : undefined,\n { backgroundColor: colorScheme.text },\n ]}>\n <View\n style={[\n styles.decoratorCircleInner,\n { backgroundColor: colorScheme.text, borderColor: colorScheme.background },\n ]}\n />\n </View>\n <View\n style={[\n styles.decoratorLine,\n listValue ? styles.listDecoratorLine : undefined,\n listValue && value ? styles.listStringValueDecoratorLine : undefined,\n listValue && image ? styles.listImageDecoratorLine : undefined,\n { backgroundColor: colorScheme.text },\n ]}\n />\n </View>\n )}\n <View\n style={[\n isObject || isArray || listValue ? styles.objectAttributeItem : styles.attributeItem,\n nested && styles.nestedAttributeItem,\n ]}>\n {name && (\n <Typography\n color={colorScheme.text}\n preset={image ? 'xs' : 'xs/line-height-small'}\n style={isObject || isArray ? styles.nestedObjectLabel : styles.dataItemLabel}\n testID={concatTestID(testID, 'title')}>\n {name}\n </Typography>\n )}\n {image && (\n <TouchableOpacity\n disabled={!onImagePreview}\n onPress={imagePreviewHandler}\n style={[styles.dataItemImageWrapper, listValue ? styles.listValue : undefined]}>\n <Image\n resizeMode=\"cover\"\n testID={concatTestID(testID, 'image')}\n source={image}\n style={styles.dataItemImage}\n />\n </TouchableOpacity>\n )}\n {value && (\n <Typography\n color={valueErrorColor ? colorScheme.error : colorScheme.text}\n numberOfLines={10}\n preset=\"s\"\n style={listValue ? styles.listValue : undefined}\n testID={concatTestID(testID, 'value')}>\n {value}\n </Typography>\n )}\n {isObject &&\n attributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n nested={true}\n key={attribute.id}\n onPress={onPress}\n last={index === length - 1}\n onImagePreview={onImagePreview}\n {...attribute}\n />\n ))}\n {isArray &&\n values.map((arrayValue, index, { length }) => (\n <CredentialAttributeItem\n key={arrayValue.id}\n onPress={onPress}\n last={index === length - 1}\n onImagePreview={onImagePreview}\n listValue={true}\n {...arrayValue}\n name={undefined}\n />\n ))}\n <View />\n </View>\n {rightAccessoryView && (\n <View style={[styles.rightAccessory, isObject && styles.objectAccessory]}>{rightAccessoryView}</View>\n )}\n </View>\n </CredentialAttributeItemButton>\n </View>\n {!last && !nested && <View style={[styles.separator, { backgroundColor: colorScheme.background }]} />}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n attributeItem: {\n flex: 1,\n paddingLeft: 8,\n },\n attributeItemContainer: {\n marginTop: 2,\n },\n attributeItemRow: {\n flexDirection: 'row',\n },\n dataItemButtonChildren: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n dataItemImage: {\n height: IMAGE_SIZE,\n width: IMAGE_SIZE,\n },\n dataItemImageWrapper: {\n borderColor: '#0004',\n borderRadius: 4,\n borderWidth: 0.5,\n height: IMAGE_SIZE,\n marginTop: 4,\n overflow: 'hidden',\n width: IMAGE_SIZE,\n },\n dataItemLabel: {\n marginBottom: 4,\n opacity: 0.7,\n },\n decorator: {\n height: '100%',\n justifyContent: 'center',\n left: 8,\n position: 'absolute',\n },\n decoratorCircle: {\n alignItems: 'center',\n borderRadius: 3.5,\n borderWidth: 1,\n height: 7,\n justifyContent: 'center',\n position: 'absolute',\n top: 6,\n width: 7,\n },\n decoratorCircleInner: {\n borderRadius: 2,\n borderWidth: 1,\n height: 4,\n width: 4,\n },\n decoratorLine: {\n bottom: 12,\n left: 3,\n position: 'absolute',\n top: 13,\n width: 1,\n },\n listDecoratorCircle: {\n top: 18,\n },\n listDecoratorLine: {\n top: 25,\n },\n listImageDecoratorCircle: {\n top: 32,\n },\n listImageDecoratorLine: {\n bottom: 40,\n top: 39,\n },\n listStringValueDecoratorLine: {\n bottom: 24,\n },\n listValue: {\n marginLeft: 13,\n paddingVertical: 10,\n },\n nestedAttributeItem: {\n paddingLeft: 12,\n },\n nestedObjectLabel: {\n opacity: 0.7,\n paddingLeft: 13,\n },\n objectAccessory: {\n alignSelf: 'flex-start',\n },\n objectAttributeItem: {\n alignItems: 'stretch',\n flex: 1,\n paddingLeft: 12,\n },\n rightAccessory: {\n paddingHorizontal: 8,\n position: 'absolute',\n right: 0,\n },\n separator: {\n height: 1,\n marginHorizontal: 8,\n marginTop: -1,\n },\n touchableAttribute: {\n borderRadius: 8,\n borderWidth: 0,\n flex: 1,\n paddingVertical: 11,\n },\n});\n\nexport default CredentialAttributeItem;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAwDC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACvG,SAASC,KAAK,EAAkCC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAEjG,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,kBAAkB,EAAEC,gBAAgB,QAAQ,+CAA+C;AACpG,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AASjE,MAAMC,6BAAwF,GAAGA,CAAC;EAChGC,QAAQ;EACRC,QAAQ;EACRC,EAAE;EACFC,OAAO;EACPC;AAC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,EAAE;IACnB8C,GAAG,EAAE;EACP,CAAC;EACDxC,iBAAiB,EAAE;IACjBwC,GAAG,EAAE;EACP,CAAC;EACD7C,wBAAwB,EAAE;IACxB6C,GAAG,EAAE;EACP,CAAC;EACDtC,sBAAsB,EAAE;IACtBuC,MAAM,EAAE,EAAE;IACVD,GAAG,EAAE;EACP,CAAC;EACDvC,4BAA4B,EAAE;IAC5BwC,MAAM,EAAE;EACV,CAAC;EACDjE,SAAS,EAAE;IACTkE,UAAU,EAAE,EAAE;IACdC,eAAe,EAAE;EACnB,CAAC;EACDtC,mBAAmB,EAAE;IACnBqB,WAAW,EAAE;EACf,CAAC;EACDlB,iBAAiB,EAAE;IACjB4B,OAAO,EAAE,GAAG;IACZV,WAAW,EAAE;EACf,CAAC;EACDJ,eAAe,EAAE;IACfsB,SAAS,EAAE;EACb,CAAC;EACDzC,mBAAmB,EAAE;IACnB0B,UAAU,EAAE,SAAS;IACrBJ,IAAI,EAAE,CAAC;IACPC,WAAW,EAAE;EACf,CAAC;EACDpD,cAAc,EAAE;IACduE,iBAAiB,EAAE,CAAC;IACpBN,QAAQ,EAAE,UAAU;IACpBO,KAAK,EAAE;EACT,CAAC;EACDvB,SAAS,EAAE;IACTO,MAAM,EAAE,CAAC;IACTiB,gBAAgB,EAAE,CAAC;IACnBpB,SAAS,EAAE,CAAC;EACd,CAAC;EACDjE,kBAAkB,EAAE;IAClBsE,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdR,IAAI,EAAE,CAAC;IACPkB,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAEF,eAAe3E,uBAAuB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["barcode","QRCode","React","useMemo","StyleSheet","View","SvgXml","Typography","useAppColorScheme","styles","create","barcodeBackground","alignSelf","backgroundColor","borderRadius","barcodeContent","margin","container","flex","justifyContent","mrzBackground","paddingHorizontal","Barcode","content","width","height","testID","colorScheme","barcodeXml","barHeight","bgColor","white","createElement","style","xml","QrCode","padding","onError","qrCodeXml","ecl","join","svg","err","Error","message","Mrz","color","text","preset"],"sources":["credential-carousel-images.tsx"],"sourcesContent":["import { barcode } from 'pure-svg-code';\nimport QRCode from 'qrcode-svg';\nimport React, { FC, useMemo } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { SvgXml } from 'react-native-svg';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nconst styles = StyleSheet.create({\n barcodeBackground: {\n alignSelf: 'center',\n backgroundColor: 'white',\n borderRadius: 5,\n },\n barcodeContent: {\n margin: 12,\n },\n container: {\n flex: 1,\n justifyContent: 'center',\n },\n mrzBackground: {\n backgroundColor: 'white',\n paddingHorizontal: 12,\n },\n});\n\ntype BarcodeProps = {\n content: string;\n height?: number;\n testID?: string;\n width?: number;\n};\n\nexport const Barcode: FC<BarcodeProps> = ({ content, width = 220, height = 80, testID }) => {\n const colorScheme = useAppColorScheme();\n const barcodeXml = useMemo(\n () =>\n barcode(content, 'code128', {\n barHeight: height,\n bgColor: colorScheme.white,\n width: width,\n }),\n [content, colorScheme, height, width],\n );\n\n return (\n <View style={styles.container}>\n <View style={styles.barcodeBackground}>\n <SvgXml\n height={height}\n style={[styles.barcodeBackground, styles.barcodeContent]}\n testID={testID}\n width={width}\n xml={barcodeXml}\n />\n </View>\n </View>\n );\n};\n\ntype QrCodeProps = {\n content: string;\n padding?: number;\n testID?: string;\n onError?: (err: string) => void;\n};\n\nexport const QrCode: FC<QrCodeProps> = ({ content, padding, testID, onError }) => {\n const qrCodeXml = useMemo(() => {\n try {\n return new QRCode({\n container: 'svg-viewbox',\n content,\n ecl: 'L',\n join: true,\n padding: padding ?? 1,\n }).svg();\n } catch (err) {\n onError && onError(err instanceof Error ? err.message : 'Unknown error occurred.');\n return null;\n }\n }, [content, onError, padding]);\n return <SvgXml height={'100%'} testID={testID} width={'100%'} xml={qrCodeXml} />;\n};\n\nexport const Mrz: FC<{ content: string; testID?: string }> = ({ content, testID }) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.container, styles.mrzBackground]}>\n <Typography color={colorScheme.text} preset={'s/code'} testID={testID}>\n {content}\n </Typography>\n </View>\n );\n};\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,eAAe;AACvC,OAAOC,MAAM,MAAM,YAAY;AAC/B,OAAOC,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAC1C,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AAEjE,MAAMC,MAAM,GAAGL,UAAU,CAACM,MAAM,CAAC;EAC/BC,iBAAiB,EAAE;IACjBC,SAAS,EAAE,QAAQ;IACnBC,eAAe,EAAE,OAAO;IACxBC,YAAY,EAAE;
|
|
1
|
+
{"version":3,"names":["barcode","QRCode","React","useMemo","StyleSheet","View","SvgXml","Typography","useAppColorScheme","styles","create","barcodeBackground","alignSelf","backgroundColor","borderRadius","borderWidth","barcodeContent","margin","container","flex","justifyContent","mrzBackground","paddingHorizontal","Barcode","content","width","height","testID","colorScheme","barcodeXml","barHeight","bgColor","white","createElement","style","xml","QrCode","padding","onError","qrCodeXml","ecl","join","svg","err","Error","message","Mrz","color","text","preset"],"sources":["credential-carousel-images.tsx"],"sourcesContent":["import { barcode } from 'pure-svg-code';\nimport QRCode from 'qrcode-svg';\nimport React, { FC, useMemo } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { SvgXml } from 'react-native-svg';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nconst styles = StyleSheet.create({\n barcodeBackground: {\n alignSelf: 'center',\n backgroundColor: 'white',\n borderRadius: 5,\n borderWidth: 0,\n },\n barcodeContent: {\n margin: 12,\n },\n container: {\n flex: 1,\n justifyContent: 'center',\n },\n mrzBackground: {\n backgroundColor: 'white',\n paddingHorizontal: 12,\n },\n});\n\ntype BarcodeProps = {\n content: string;\n height?: number;\n testID?: string;\n width?: number;\n};\n\nexport const Barcode: FC<BarcodeProps> = ({ content, width = 220, height = 80, testID }) => {\n const colorScheme = useAppColorScheme();\n const barcodeXml = useMemo(\n () =>\n barcode(content, 'code128', {\n barHeight: height,\n bgColor: colorScheme.white,\n width: width,\n }),\n [content, colorScheme, height, width],\n );\n\n return (\n <View style={styles.container}>\n <View style={styles.barcodeBackground}>\n <SvgXml\n height={height}\n style={[styles.barcodeBackground, styles.barcodeContent]}\n testID={testID}\n width={width}\n xml={barcodeXml}\n />\n </View>\n </View>\n );\n};\n\ntype QrCodeProps = {\n content: string;\n padding?: number;\n testID?: string;\n onError?: (err: string) => void;\n};\n\nexport const QrCode: FC<QrCodeProps> = ({ content, padding, testID, onError }) => {\n const qrCodeXml = useMemo(() => {\n try {\n return new QRCode({\n container: 'svg-viewbox',\n content,\n ecl: 'L',\n join: true,\n padding: padding ?? 1,\n }).svg();\n } catch (err) {\n onError && onError(err instanceof Error ? err.message : 'Unknown error occurred.');\n return null;\n }\n }, [content, onError, padding]);\n return <SvgXml height={'100%'} testID={testID} width={'100%'} xml={qrCodeXml} />;\n};\n\nexport const Mrz: FC<{ content: string; testID?: string }> = ({ content, testID }) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.container, styles.mrzBackground]}>\n <Typography color={colorScheme.text} preset={'s/code'} testID={testID}>\n {content}\n </Typography>\n </View>\n );\n};\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,eAAe;AACvC,OAAOC,MAAM,MAAM,YAAY;AAC/B,OAAOC,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAC1C,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AAEjE,MAAMC,MAAM,GAAGL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@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","StyleSheet","View","concatTestID","SelectorIcon","useAppColorScheme","SelectorStatus","Selector","status","style","testID","colorScheme","statusStyle","Empty","styles","bordered","backgroundColor","white","borderColor","grayDark","SelectedRadio","selectedRadio","accent","SelectedCheckmark","Disabled","background","undefined","checked","Required","rejected","Rejected","createElement","wrapper","create","borderWidth","alignItems","borderRadius","height","justifyContent","width"],"sources":["selector.tsx"],"sourcesContent":["import React, { FC, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils/testID';\nimport { SelectorIcon } from '../icons/selector';\nimport { useAppColorScheme } from '../theme';\nimport { SelectorStatus } from './selector-status';\n\ninterface SelectorProps {\n status: SelectorStatus;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * Generic selector display\n *\n * Following the design: https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=433-28352&mode=design&t=91K8am4RSNRB8qgZ-0\n */\nconst Selector: FC<SelectorProps> = ({ status, style, testID }) => {\n const colorScheme = useAppColorScheme();\n\n const statusStyle = useMemo<StyleProp<ViewStyle>>(() => {\n switch (status) {\n case SelectorStatus.Empty:\n return [styles.bordered, { backgroundColor: colorScheme.white, borderColor: colorScheme.grayDark }];\n case SelectorStatus.SelectedRadio:\n return [styles.selectedRadio, { backgroundColor: colorScheme.white, borderColor: colorScheme.accent }];\n case SelectorStatus.SelectedCheckmark:\n return { backgroundColor: colorScheme.accent };\n case SelectorStatus.Disabled:\n return [styles.bordered, { backgroundColor: colorScheme.background, borderColor: colorScheme.grayDark }];\n default:\n return undefined;\n }\n }, [colorScheme, status]);\n\n const checked = status === SelectorStatus.SelectedCheckmark || status === SelectorStatus.Required;\n const rejected = status === SelectorStatus.Rejected;\n\n return (\n <View testID={testID} style={[styles.wrapper, statusStyle, style]}>\n {(checked || rejected) && <SelectorIcon testID={concatTestID(testID, 'status', status)} status={status} />}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n bordered: {\n borderWidth: 1,\n },\n selectedRadio: {\n borderWidth: 8,\n },\n wrapper: {\n alignItems: 'center',\n borderRadius: 12,\n height: 24,\n justifyContent: 'center',\n width: 24,\n },\n});\n\nexport default Selector;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAC1C,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,SAASC,cAAc,QAAQ,mBAAmB;AAQlD;AACA;AACA;AACA;AACA;AACA,MAAMC,QAA2B,GAAGA,CAAC;EAAEC,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,KAAK;EACjE,MAAMC,WAAW,GAAGN,iBAAiB,CAAC,CAAC;EAEvC,MAAMO,WAAW,GAAGZ,OAAO,CAAuB,MAAM;IACtD,QAAQQ,MAAM;MACZ,KAAKF,cAAc,CAACO,KAAK;QACvB,OAAO,CAACC,MAAM,CAACC,QAAQ,EAAE;UAAEC,eAAe,EAAEL,WAAW,CAACM,KAAK;UAAEC,WAAW,EAAEP,WAAW,CAACQ;QAAS,CAAC,CAAC;MACrG,KAAKb,cAAc,CAACc,aAAa;QAC/B,OAAO,CAACN,MAAM,CAACO,aAAa,EAAE;UAAEL,eAAe,EAAEL,WAAW,CAACM,KAAK;UAAEC,WAAW,EAAEP,WAAW,CAACW;QAAO,CAAC,CAAC;MACxG,KAAKhB,cAAc,CAACiB,iBAAiB;QACnC,OAAO;UAAEP,eAAe,EAAEL,WAAW,CAACW;QAAO,CAAC;MAChD,KAAKhB,cAAc,CAACkB,QAAQ;QAC1B,OAAO,CAACV,MAAM,CAACC,QAAQ,EAAE;UAAEC,eAAe,EAAEL,WAAW,CAACc,UAAU;UAAEP,WAAW,EAAEP,WAAW,CAACQ;QAAS,CAAC,CAAC;MAC1G;QACE,OAAOO,SAAS;IACpB;EACF,CAAC,EAAE,CAACf,WAAW,EAAEH,MAAM,CAAC,CAAC;EAEzB,MAAMmB,OAAO,GAAGnB,MAAM,KAAKF,cAAc,CAACiB,iBAAiB,IAAIf,MAAM,KAAKF,cAAc,CAACsB,QAAQ;EACjG,MAAMC,QAAQ,GAAGrB,MAAM,KAAKF,cAAc,CAACwB,QAAQ;EAEnD,oBACE/B,KAAA,CAAAgC,aAAA,CAAC7B,IAAI;IAACQ,MAAM,EAAEA,MAAO;IAACD,KAAK,EAAE,CAACK,MAAM,CAACkB,OAAO,EAAEpB,WAAW,EAAEH,KAAK;EAAE,GAC/D,CAACkB,OAAO,IAAIE,QAAQ,kBAAK9B,KAAA,CAAAgC,aAAA,CAAC3B,YAAY;IAACM,MAAM,EAAEP,YAAY,CAACO,MAAM,EAAE,QAAQ,EAAEF,MAAM,CAAE;IAACA,MAAM,EAAEA;EAAO,CAAE,CACrG,CAAC;AAEX,CAAC;AAED,MAAMM,MAAM,GAAGb,UAAU,CAACgC,MAAM,CAAC;EAC/BlB,QAAQ,EAAE;IACRmB,WAAW,EAAE;EACf,CAAC;EACDb,aAAa,EAAE;IACba,WAAW,EAAE;EACf,CAAC;EACDF,OAAO,EAAE;IACPG,UAAU,EAAE,QAAQ;IACpBC,YAAY,EAAE,EAAE;
|
|
1
|
+
{"version":3,"names":["React","useMemo","StyleSheet","View","concatTestID","SelectorIcon","useAppColorScheme","SelectorStatus","Selector","status","style","testID","colorScheme","statusStyle","Empty","styles","bordered","backgroundColor","white","borderColor","grayDark","SelectedRadio","selectedRadio","accent","SelectedCheckmark","Disabled","background","undefined","checked","Required","rejected","Rejected","createElement","wrapper","create","borderWidth","alignItems","borderRadius","height","justifyContent","width"],"sources":["selector.tsx"],"sourcesContent":["import React, { FC, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils/testID';\nimport { SelectorIcon } from '../icons/selector';\nimport { useAppColorScheme } from '../theme';\nimport { SelectorStatus } from './selector-status';\n\ninterface SelectorProps {\n status: SelectorStatus;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/**\n * Generic selector display\n *\n * Following the design: https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=433-28352&mode=design&t=91K8am4RSNRB8qgZ-0\n */\nconst Selector: FC<SelectorProps> = ({ status, style, testID }) => {\n const colorScheme = useAppColorScheme();\n\n const statusStyle = useMemo<StyleProp<ViewStyle>>(() => {\n switch (status) {\n case SelectorStatus.Empty:\n return [styles.bordered, { backgroundColor: colorScheme.white, borderColor: colorScheme.grayDark }];\n case SelectorStatus.SelectedRadio:\n return [styles.selectedRadio, { backgroundColor: colorScheme.white, borderColor: colorScheme.accent }];\n case SelectorStatus.SelectedCheckmark:\n return { backgroundColor: colorScheme.accent };\n case SelectorStatus.Disabled:\n return [styles.bordered, { backgroundColor: colorScheme.background, borderColor: colorScheme.grayDark }];\n default:\n return undefined;\n }\n }, [colorScheme, status]);\n\n const checked = status === SelectorStatus.SelectedCheckmark || status === SelectorStatus.Required;\n const rejected = status === SelectorStatus.Rejected;\n\n return (\n <View testID={testID} style={[styles.wrapper, statusStyle, style]}>\n {(checked || rejected) && <SelectorIcon testID={concatTestID(testID, 'status', status)} status={status} />}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n bordered: {\n borderWidth: 1,\n },\n selectedRadio: {\n borderWidth: 8,\n },\n wrapper: {\n alignItems: 'center',\n borderRadius: 12,\n borderWidth: 0,\n height: 24,\n justifyContent: 'center',\n width: 24,\n },\n});\n\nexport default Selector;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAC1C,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,iBAAiB,QAA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AO,EAAEpB,WAAW,EAAEH,KAAK;EAAE,GAC/D,CAACkB,OAAO,IAAIE,QAAQ,kBAAK9B,KAAA,CAAAgC,aAAA,CAAC3B,YAAY;IAACM,MAAM,EAAEP,YAAY,CAACO,MAAM,EAAE,QAAQ,EAAEF,MAAM,CAAE;IAACA,MAAM,EAAEA;EAAO,CAAE,CACrG,CAAC;AAEX,CAAC;AAED,MAAMM,MAAM,GAAGb,UAAU,CAACgC,MAAM,CAAC;EAC/BlB,QAAQ,EAAE;IACRmB,WAAW,EAAE;EACf,CAAC;EACDb,aAAa,EAAE;IACba,WAAW,EAAE;EACf,CAAC;EACDF,OAAO,EAAE;IACPG,UAAU,EAAE,QAAQ;IACpBC,YAAY,EAAE,EAAE;IAChBF,WAAW,EAAE,CAAC;IACdG,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAehC,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","StyleSheet","View","concatTestID","ImageOrComponent","Typography","useAppColorScheme","Avatar","avatar","placeholderText","statusIcon","style","testID","viewProps","colorScheme","statusIconView","undefined","isValidElement","StatusIconComponent","createElement","imageSource","component","styles","avatarPlaceholder","backgroundColor","accent","color","accentText","avatarPlaceholderText","borderRadius","avatarStyle","flatten","_extends","accessibilityElementsHidden","imageWrapper","source","image","create","height","width","alignItems","flex","justifyContent","textTransform","overflow","bottom","position","right"],"sources":["avatar.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement, useMemo } from 'react';\nimport { StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport ImageOrComponent, { ImageOrComponentSource } from '../image/image-or-component';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type AvatarProps = ViewProps & {\n avatar?: ImageOrComponentSource;\n placeholderText?: string;\n statusIcon?: ComponentType<any> | ReactElement;\n testID?: string;\n};\n\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=426-25581&mode=design&t=YI1oD2BfBie5HcvJ-0\nconst Avatar: FunctionComponent<AvatarProps> = ({\n avatar,\n placeholderText,\n statusIcon,\n style,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n\n const statusIconView: React.ReactElement | undefined = useMemo(() => {\n if (!statusIcon) {\n return undefined;\n }\n if (React.isValidElement(statusIcon)) {\n return statusIcon;\n } else {\n const StatusIconComponent = statusIcon as React.ComponentType<any>;\n return <StatusIconComponent />;\n }\n }, [statusIcon]);\n\n const imageSource = useMemo<ImageOrComponentSource>(() => {\n if (avatar) {\n return avatar;\n }\n\n return {\n component: (\n <View style={[styles.avatarPlaceholder, { backgroundColor: colorScheme.accent }]}>\n <Typography color={colorScheme.accentText} style={styles.avatarPlaceholderText}>\n {placeholderText}\n </Typography>\n </View>\n ),\n };\n }, [colorScheme, avatar, placeholderText]);\n\n const { borderRadius, ...avatarStyle } = StyleSheet.flatten([styles.avatar, style]) as ViewStyle;\n return (\n <View accessibilityElementsHidden={true} style={avatarStyle} testID={testID} {...viewProps}>\n <View style={[styles.imageWrapper, borderRadius ? { borderRadius } : undefined]}>\n <ImageOrComponent source={imageSource} style={styles.image} testID={concatTestID(testID, 'logo')} />\n </View>\n {statusIconView && (\n <View style={styles.statusIcon} testID={concatTestID(testID, 'statusIcon')}>\n {statusIconView}\n </View>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n avatar: {\n height: 72,\n width: 72,\n },\n avatarPlaceholder: {\n alignItems: 'center',\n flex: 1,\n justifyContent: 'center',\n },\n avatarPlaceholderText: {\n textTransform: 'uppercase',\n },\n image: {\n height: '100%',\n width: '100%',\n },\n imageWrapper: {\n borderRadius: 36,\n height: '100%',\n overflow: 'hidden',\n width: '100%',\n },\n statusIcon: {\n bottom: 4,\n position: 'absolute',\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,EAAE,EAAE;
|
|
1
|
+
{"version":3,"names":["React","useMemo","StyleSheet","View","concatTestID","ImageOrComponent","Typography","useAppColorScheme","Avatar","avatar","placeholderText","statusIcon","style","testID","viewProps","colorScheme","statusIconView","undefined","isValidElement","StatusIconComponent","createElement","imageSource","component","styles","avatarPlaceholder","backgroundColor","accent","color","accentText","avatarPlaceholderText","borderRadius","avatarStyle","flatten","_extends","accessibilityElementsHidden","imageWrapper","source","image","create","height","width","alignItems","flex","justifyContent","textTransform","borderWidth","overflow","bottom","position","right"],"sources":["avatar.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement, useMemo } from 'react';\nimport { StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport ImageOrComponent, { ImageOrComponentSource } from '../image/image-or-component';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type AvatarProps = ViewProps & {\n avatar?: ImageOrComponentSource;\n placeholderText?: string;\n statusIcon?: ComponentType<any> | ReactElement;\n testID?: string;\n};\n\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=426-25581&mode=design&t=YI1oD2BfBie5HcvJ-0\nconst Avatar: FunctionComponent<AvatarProps> = ({\n avatar,\n placeholderText,\n statusIcon,\n style,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n\n const statusIconView: React.ReactElement | undefined = useMemo(() => {\n if (!statusIcon) {\n return undefined;\n }\n if (React.isValidElement(statusIcon)) {\n return statusIcon;\n } else {\n const StatusIconComponent = statusIcon as React.ComponentType<any>;\n return <StatusIconComponent />;\n }\n }, [statusIcon]);\n\n const imageSource = useMemo<ImageOrComponentSource>(() => {\n if (avatar) {\n return avatar;\n }\n\n return {\n component: (\n <View style={[styles.avatarPlaceholder, { backgroundColor: colorScheme.accent }]}>\n <Typography color={colorScheme.accentText} style={styles.avatarPlaceholderText}>\n {placeholderText}\n </Typography>\n </View>\n ),\n };\n }, [colorScheme, avatar, placeholderText]);\n\n const { borderRadius, ...avatarStyle } = StyleSheet.flatten([styles.avatar, style]) as ViewStyle;\n return (\n <View accessibilityElementsHidden={true} style={avatarStyle} testID={testID} {...viewProps}>\n <View style={[styles.imageWrapper, borderRadius ? { borderRadius } : undefined]}>\n <ImageOrComponent source={imageSource} style={styles.image} testID={concatTestID(testID, 'logo')} />\n </View>\n {statusIconView && (\n <View style={styles.statusIcon} testID={concatTestID(testID, 'statusIcon')}>\n {statusIconView}\n </View>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n avatar: {\n height: 72,\n width: 72,\n },\n avatarPlaceholder: {\n alignItems: 'center',\n flex: 1,\n justifyContent: 'center',\n },\n avatarPlaceholderText: {\n textTransform: 'uppercase',\n },\n image: {\n height: '100%',\n width: '100%',\n },\n imageWrapper: {\n borderRadius: 36,\n borderWidth: 0,\n height: '100%',\n overflow: 'hidden',\n width: '100%',\n },\n statusIcon: {\n bottom: 4,\n position: 'absolute',\n right: 4,\n },\n});\n\nexport default Avatar;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAoDC,OAAO,QAAQ,OAAO;AACtF,SAASC,UAAU,EAAEC,IAAI,QAA8B,cAAc;AAErE,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAOC,gBAAgB,MAAkC,6BAA6B;AACtF,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AASjE;AACA,MAAMC,MAAsC,GAAGA,CAAC;EAC9CC,MAAM;EACNC,eAAe;EACfC,UAAU;EACVC,KAAK;EACLC,MAAM;EACN,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGR,iBAAiB,CAAC,CAAC;EAEvC,MAAMS,cAA8C,GAAGf,OAAO,CAAC,MAAM;IACnE,IAAI,CAACU,UAAU,EAAE;MACf,OAAOM,SAAS;IAClB;IACA,iBAAIjB,KAAK,CAACkB,cAAc,CAACP,UAA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B,MAAM,EAAET,YAAY,CAACS,MAAM,EAAE,MAAM;EAAE,CAAE,CAC/F,CAAC,EACNG,cAAc,iBACbhB,KAAA,CAAAoB,aAAA,CAACjB,IAAI;IAACS,KAAK,EAAEW,MAAM,CAACZ,UAAW;IAACE,MAAM,EAAET,YAAY,CAACS,MAAM,EAAE,YAAY;EAAE,GACxEG,cACG,CAEJ,CAAC;AAEX,CAAC;AAED,MAAMO,MAAM,GAAGrB,UAAU,CAACoC,MAAM,CAAC;EAC/B7B,MAAM,EAAE;IACN8B,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE;EACT,CAAC;EACDhB,iBAAiB,EAAE;IACjBiB,UAAU,EAAE,QAAQ;IACpBC,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE;EAClB,CAAC;EACDd,qBAAqB,EAAE;IACrBe,aAAa,EAAE;EACjB,CAAC;EACDP,KAAK,EAAE;IACLE,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACT,CAAC;EACDL,YAAY,EAAE;IACZL,YAAY,EAAE,EAAE;IAChBe,WAAW,EAAE,CAAC;IACdN,MAAM,EAAE,MAAM;IACdO,QAAQ,EAAE,QAAQ;IAClBN,KAAK,EAAE;EACT,CAAC;EACD7B,UAAU,EAAE;IACVoC,MAAM,EAAE,CAAC;IACTC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAezC,MAAM","ignoreList":[]}
|
|
@@ -16,8 +16,9 @@ const FoldableSearchHeader = ({
|
|
|
16
16
|
const colorScheme = useAppColorScheme();
|
|
17
17
|
const [collapsed, setCollapsed] = useState(header ? false : true);
|
|
18
18
|
const [headerHeight, setHeaderHeight] = useState();
|
|
19
|
+
const containerPaddingTop = withNotice ? 15 : safeAreaInsets.top;
|
|
19
20
|
const containerPaddingStyle = {
|
|
20
|
-
paddingTop:
|
|
21
|
+
paddingTop: containerPaddingTop
|
|
21
22
|
};
|
|
22
23
|
useEffect(() => {
|
|
23
24
|
const id = scrollOffset.addListener(({
|
|
@@ -38,11 +39,13 @@ const FoldableSearchHeader = ({
|
|
|
38
39
|
}, [scrollOffset, searchBar, headerHeight]);
|
|
39
40
|
const playHeaderFoldAnimation = !staticHeader && headerHeight;
|
|
40
41
|
const scrollHeaderAnimatedStyle = playHeaderFoldAnimation ? {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
transform: [{
|
|
43
|
+
translateY: scrollOffset.interpolate({
|
|
44
|
+
extrapolate: 'clamp',
|
|
45
|
+
inputRange: [0, headerHeight],
|
|
46
|
+
outputRange: [0, -headerHeight]
|
|
47
|
+
})
|
|
48
|
+
}]
|
|
46
49
|
} : undefined;
|
|
47
50
|
const fadeHeaderOutAnimatedStyle = playHeaderFoldAnimation ? {
|
|
48
51
|
opacity: scrollOffset.interpolate({
|
|
@@ -56,26 +59,33 @@ const FoldableSearchHeader = ({
|
|
|
56
59
|
}, [setHeaderHeight]);
|
|
57
60
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
58
61
|
style: [styles.headerContainer, containerPaddingStyle, withNotice ? styles.noticeBorderRadius : undefined]
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
63
|
+
style: scrollHeaderAnimatedStyle
|
|
59
64
|
}, /*#__PURE__*/React.createElement(View, {
|
|
60
|
-
style: [styles.
|
|
65
|
+
style: [styles.blurFill, {
|
|
66
|
+
top: -containerPaddingTop
|
|
67
|
+
}]
|
|
61
68
|
}, /*#__PURE__*/React.createElement(BlurView, {
|
|
62
69
|
blurStyle: 'header',
|
|
63
70
|
color: colorScheme.background,
|
|
64
71
|
style: [StyleSheet.absoluteFill, withNotice ? styles.noticeBorderRadius : undefined]
|
|
65
|
-
})),
|
|
66
|
-
style: scrollHeaderAnimatedStyle
|
|
67
|
-
}, searchBar && /*#__PURE__*/React.createElement(AnimatedSearchBar, _extends({}, searchBar, {
|
|
68
|
-
collapsed: collapsed
|
|
69
|
-
}))), header && /*#__PURE__*/React.createElement(Animated.View, {
|
|
72
|
+
})), header && /*#__PURE__*/React.createElement(Animated.View, {
|
|
70
73
|
onLayout: onHeaderLayout,
|
|
71
|
-
style:
|
|
72
|
-
}, header)
|
|
74
|
+
style: fadeHeaderOutAnimatedStyle
|
|
75
|
+
}, header), searchBar && /*#__PURE__*/React.createElement(AnimatedSearchBar, _extends({}, searchBar, {
|
|
76
|
+
collapsed: collapsed
|
|
77
|
+
}))));
|
|
73
78
|
};
|
|
74
79
|
const styles = StyleSheet.create({
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
blurFill: {
|
|
81
|
+
bottom: 0,
|
|
82
|
+
left: 0,
|
|
83
|
+
overflow: 'hidden',
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
right: 0
|
|
77
86
|
},
|
|
78
87
|
headerContainer: {
|
|
88
|
+
overflow: 'hidden',
|
|
79
89
|
position: 'absolute',
|
|
80
90
|
width: '100%'
|
|
81
91
|
},
|