@procivis/one-react-native-components 0.3.27 → 0.3.47
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/entity/entity-attributes.js +14 -1
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +9 -42
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details.js +60 -32
- package/lib/commonjs/components/entity/entity-details.js.map +1 -1
- package/lib/commonjs/components/entity/index.js +2 -15
- package/lib/commonjs/components/entity/index.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item.js +14 -12
- package/lib/commonjs/components/history/history-list-item.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential.js +1 -2
- package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
- package/lib/commonjs/ui-components/blur/index.js +2 -9
- package/lib/commonjs/ui-components/blur/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/hold-button.js +3 -2
- package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -1
- package/lib/commonjs/ui-components/camera/index.js +2 -9
- package/lib/commonjs/ui-components/camera/index.js.map +1 -1
- package/lib/commonjs/ui-components/control/index.js +0 -12
- package/lib/commonjs/ui-components/control/index.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js +15 -8
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/commonjs/ui-components/entity/entity-cluster.js +50 -2
- package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/commonjs/ui-components/entity/index.js +3 -16
- package/lib/commonjs/ui-components/entity/index.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-details.js +1 -1
- package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
- package/lib/commonjs/ui-components/history/index.js +4 -27
- package/lib/commonjs/ui-components/history/index.js.map +1 -1
- package/lib/commonjs/ui-components/icons/entity.js +10 -13
- package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
- package/lib/commonjs/ui-components/input/index.js +3 -32
- package/lib/commonjs/ui-components/input/index.js.map +1 -1
- package/lib/commonjs/ui-components/list/index.js +4 -19
- package/lib/commonjs/ui-components/list/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/index.js +2 -13
- package/lib/commonjs/ui-components/loader/index.js.map +1 -1
- package/lib/commonjs/ui-components/pin/index.js +2 -21
- package/lib/commonjs/ui-components/pin/index.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/index.js +3 -16
- package/lib/commonjs/ui-components/searchbar/index.js.map +1 -1
- package/lib/commonjs/ui-components/settings/index.js +6 -37
- package/lib/commonjs/ui-components/settings/index.js.map +1 -1
- package/lib/commonjs/ui-components/state/index.js +2 -15
- package/lib/commonjs/ui-components/state/index.js.map +1 -1
- package/lib/commonjs/utils/date.js +1 -1
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js +4 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +22 -66
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +6 -2
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js +23 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +24 -14
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +55 -14
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +6 -15
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +21 -3
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js +15 -2
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +11 -44
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/entity/entity-details.js +60 -32
- package/lib/module/components/entity/entity-details.js.map +1 -1
- package/lib/module/components/entity/index.js +2 -2
- package/lib/module/components/entity/index.js.map +1 -1
- package/lib/module/components/history/history-list-item.js +15 -13
- package/lib/module/components/history/history-list-item.js.map +1 -1
- package/lib/module/components/proof-request/share-credential.js +1 -2
- package/lib/module/components/proof-request/share-credential.js.map +1 -1
- package/lib/module/ui-components/blur/index.js +2 -2
- package/lib/module/ui-components/blur/index.js.map +1 -1
- package/lib/module/ui-components/buttons/hold-button.js +4 -3
- package/lib/module/ui-components/buttons/hold-button.js.map +1 -1
- package/lib/module/ui-components/camera/index.js +2 -2
- package/lib/module/ui-components/camera/index.js.map +1 -1
- package/lib/module/ui-components/control/index.js +3 -3
- package/lib/module/ui-components/control/index.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/credential-carousel-images.js +15 -8
- package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/module/ui-components/entity/entity-cluster.js +51 -3
- package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/module/ui-components/entity/index.js +4 -4
- package/lib/module/ui-components/entity/index.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +1 -1
- package/lib/module/ui-components/history/history-details.js.map +1 -1
- package/lib/module/ui-components/history/index.js +6 -6
- package/lib/module/ui-components/history/index.js.map +1 -1
- package/lib/module/ui-components/icons/entity.js +10 -13
- package/lib/module/ui-components/icons/entity.js.map +1 -1
- package/lib/module/ui-components/input/index.js +6 -6
- package/lib/module/ui-components/input/index.js.map +1 -1
- package/lib/module/ui-components/list/index.js +4 -4
- package/lib/module/ui-components/list/index.js.map +1 -1
- package/lib/module/ui-components/loader/index.js +4 -4
- package/lib/module/ui-components/loader/index.js.map +1 -1
- package/lib/module/ui-components/pin/index.js +3 -3
- package/lib/module/ui-components/pin/index.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/searchbar/index.js +4 -4
- package/lib/module/ui-components/searchbar/index.js.map +1 -1
- package/lib/module/ui-components/settings/index.js +10 -10
- package/lib/module/ui-components/settings/index.js.map +1 -1
- package/lib/module/ui-components/state/index.js +2 -2
- package/lib/module/ui-components/state/index.js.map +1 -1
- package/lib/module/utils/date.js +1 -1
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/hooks/connectivity/connectivity.test.js +4 -0
- package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +24 -68
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +5 -3
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/identifiers.js +21 -0
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +24 -14
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +55 -14
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +6 -15
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/query.js +19 -2
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +1 -2
- package/lib/typescript/components/entity/entity-details.d.ts +3 -2
- package/lib/typescript/components/entity/index.d.ts +2 -1
- package/lib/typescript/ui-components/blur/index.d.ts +2 -1
- package/lib/typescript/ui-components/buttons/hold-button.d.ts +2 -2
- package/lib/typescript/ui-components/camera/index.d.ts +2 -1
- package/lib/typescript/ui-components/control/index.d.ts +4 -2
- package/lib/typescript/ui-components/credential/credential-carousel-images.d.ts +1 -0
- package/lib/typescript/ui-components/entity/entity-cluster.d.ts +1 -0
- package/lib/typescript/ui-components/entity/index.d.ts +4 -2
- package/lib/typescript/ui-components/history/history-details.d.ts +4 -1
- package/lib/typescript/ui-components/history/index.d.ts +6 -3
- package/lib/typescript/ui-components/input/index.d.ts +6 -3
- package/lib/typescript/ui-components/list/index.d.ts +4 -2
- package/lib/typescript/ui-components/loader/index.d.ts +4 -2
- package/lib/typescript/ui-components/pin/index.d.ts +4 -2
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +1 -1
- package/lib/typescript/ui-components/searchbar/index.d.ts +4 -2
- package/lib/typescript/ui-components/settings/index.d.ts +10 -5
- package/lib/typescript/ui-components/state/index.d.ts +2 -1
- package/lib/typescript/utils/hooks/core/backup.d.ts +5 -0
- package/lib/typescript/utils/hooks/core/core-init.d.ts +4 -1
- package/lib/typescript/utils/hooks/core/identifiers.d.ts +4 -1
- package/lib/typescript/utils/hooks/core/proofs.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +9 -3
- package/lib/typescript/utils/parsers/query.d.ts +3 -2
- package/package.json +10 -5
- package/src/components/entity/entity-attributes.tsx +16 -2
- package/src/components/entity/entity-details-with-buttons.tsx +11 -42
- package/src/components/entity/entity-details.tsx +60 -30
- package/src/components/entity/index.ts +2 -1
- package/src/components/history/history-list-item.tsx +17 -13
- package/src/components/proof-request/share-credential.tsx +0 -1
- package/src/ui-components/blur/index.ts +2 -1
- package/src/ui-components/buttons/hold-button.tsx +6 -5
- package/src/ui-components/camera/index.tsx +2 -1
- package/src/ui-components/control/index.ts +4 -2
- package/src/ui-components/credential/card/credential-details-card.tsx +1 -1
- package/src/ui-components/credential/credential-carousel-images.tsx +15 -8
- package/src/ui-components/entity/entity-cluster.tsx +63 -10
- package/src/ui-components/entity/index.ts +4 -2
- package/src/ui-components/history/history-details.tsx +5 -2
- package/src/ui-components/history/index.ts +6 -3
- package/src/ui-components/icons/entity.tsx +8 -12
- package/src/ui-components/input/index.ts +6 -3
- package/src/ui-components/list/index.ts +4 -2
- package/src/ui-components/loader/index.ts +4 -2
- package/src/ui-components/pin/index.ts +4 -2
- package/src/ui-components/screens/nerd-mode-screen.tsx +1 -1
- package/src/ui-components/searchbar/index.ts +4 -2
- package/src/ui-components/settings/index.ts +10 -5
- package/src/ui-components/state/index.ts +2 -1
- package/src/utils/date.ts +1 -1
- package/src/utils/hooks/connectivity/connectivity.test.ts +7 -2
- package/src/utils/hooks/core/backup.ts +30 -72
- package/src/utils/hooks/core/core-init.ts +5 -3
- package/src/utils/hooks/core/identifiers.ts +22 -1
- package/src/utils/hooks/core/proofs.ts +27 -16
- package/src/utils/hooks/core/trust-entity.ts +45 -11
- package/src/utils/parsers/credential-sharing.tsx +8 -14
- package/src/utils/parsers/query.tsx +12 -2
|
@@ -2,7 +2,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { StyleSheet, View } from 'react-native';
|
|
4
4
|
import Animated, { cancelAnimation, Easing, runOnJS, useAnimatedStyle, useDerivedValue, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
5
|
-
import {
|
|
5
|
+
import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';
|
|
6
6
|
import { Typography } from '../text';
|
|
7
7
|
import { useAppColorScheme } from '../theme';
|
|
8
8
|
const Content = ({
|
|
@@ -144,13 +144,14 @@ const HoldButtonLayouted = ({
|
|
|
144
144
|
textColor: colorScheme.accentText
|
|
145
145
|
}, contentProps)))), /*#__PURE__*/React.createElement(View, {
|
|
146
146
|
style: styles.pressableLayer
|
|
147
|
-
}, /*#__PURE__*/React.createElement(
|
|
147
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, _extends({
|
|
148
148
|
accessibilityRole: "button",
|
|
149
149
|
ref: ref,
|
|
150
150
|
disabled: isFinished || disabled,
|
|
151
151
|
onLongPress: onLongPress,
|
|
152
152
|
onPressIn: isFinished ? undefined : onPressIn,
|
|
153
|
-
onPressOut: isFinished ? undefined : onPressOut
|
|
153
|
+
onPressOut: isFinished ? undefined : onPressOut,
|
|
154
|
+
activeOpacity: 1
|
|
154
155
|
}, props), /*#__PURE__*/React.createElement(View, {
|
|
155
156
|
style: {
|
|
156
157
|
width,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","View","Animated","cancelAnimation","Easing","runOnJS","useAnimatedStyle","useDerivedValue","useSharedValue","withTiming","TouchableWithoutFeedback","Typography","useAppColorScheme","Content","title","subtitlePrefix","subtitleSuffix","width","height","textColor","progress","holdTimeoutSecs","disabled","nums","Array","from","length","map","_","index","subtitleHeight","setSubtitleHeight","onSubtitleLayout","nativeEvent","layout","translateY","value","movingUpStyle","transform","createElement","style","styles","contentWrapper","contentDisabled","pointerEvents","color","numberOfLines","subtitle","subtitleDisabled","onLayout","preset","subtitleSecsWrapper","subtitleSecs","val","key","HoldButtonLayouted","onFinished","ref","props","colorScheme","isFinished","setFinished","onLongPress","onPressIn","holdTimeout","duration","easing","linear","finished","onPressOut","translateX","movingRightStyle","movingLeftStyle","contentProps","Fragment","_extends","accent","movingLayer","backgroundColor","accentText","pressableLayer","accessibilityRole","undefined","HoldButton","forwardRef","setLayout","onContainerLayout","container","white","background","borderColor","displayName","create","borderRadius","overflow","opacity","alignItems","justifyContent","paddingBottom","paddingHorizontal","paddingTop","borderWidth","position","flexDirection"],"sources":["hold-button.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { ColorValue, LayoutChangeEvent, StyleSheet, TouchableWithoutFeedbackProps, View } from 'react-native';\nimport Animated, {\n cancelAnimation,\n Easing,\n runOnJS,\n SharedValue,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { TouchableWithoutFeedback, TouchableWithoutFeedbackRef } from '../accessibility/accessibilityHistoryWrappers';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\nexport interface HoldButtonProps\n extends Omit<\n TouchableWithoutFeedbackProps,\n 'children' | 'onLayout' | 'onPress' | 'onLongPress' | 'onPressIn' | 'onPressOut'\n > {\n title: string;\n subtitlePrefix: string;\n subtitleSuffix: string;\n holdTimeoutSecs?: number;\n onFinished: () => void;\n}\n\ninterface ContentProps {\n title: string;\n subtitlePrefix: string;\n subtitleSuffix: string;\n width: number;\n height: number;\n textColor: ColorValue;\n progress: SharedValue<number>;\n holdTimeoutSecs: number;\n disabled?: boolean;\n}\n\nconst Content = ({\n title,\n subtitlePrefix,\n subtitleSuffix,\n width,\n height,\n textColor,\n progress,\n holdTimeoutSecs,\n disabled,\n}: ContentProps) => {\n const nums = useMemo(\n () => Array.from({ length: holdTimeoutSecs + 1 }).map((_, index) => holdTimeoutSecs - index),\n [holdTimeoutSecs],\n );\n\n const [subtitleHeight, setSubtitleHeight] = useState<number>(0);\n const onSubtitleLayout = useCallback(({ nativeEvent }: LayoutChangeEvent) => {\n setSubtitleHeight(nativeEvent.layout.height);\n }, []);\n\n const translateY = useDerivedValue(\n () => progress.value * subtitleHeight * holdTimeoutSecs,\n [subtitleHeight, holdTimeoutSecs],\n );\n const movingUpStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: -translateY.value }],\n }), [translateY]);\n\n return (\n <View style={[styles.contentWrapper, disabled && styles.contentDisabled, { width, height }]} pointerEvents=\"none\">\n <Typography color={textColor} numberOfLines={1}>\n {title}\n </Typography>\n\n <View style={[styles.subtitle, disabled && styles.subtitleDisabled]}>\n <Typography onLayout={onSubtitleLayout} preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {subtitlePrefix}\n </Typography>\n <View style={[styles.subtitleSecsWrapper, { height: subtitleHeight }]}>\n <Animated.View style={[styles.subtitleSecs, movingUpStyle]}>\n {nums.map((val) => (\n <Typography key={val} preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {val}\n </Typography>\n ))}\n </Animated.View>\n </View>\n <Typography preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {subtitleSuffix}\n </Typography>\n </View>\n </View>\n );\n};\n\ninterface HoldButtonLayoutedProps extends Omit<HoldButtonProps, 'style'> {\n ref: React.ForwardedRef<TouchableWithoutFeedbackRef>;\n width: number;\n height: number;\n}\n\nconst HoldButtonLayouted = ({\n title,\n subtitlePrefix,\n subtitleSuffix,\n onFinished,\n holdTimeoutSecs = 3,\n width,\n height,\n disabled,\n ref,\n ...props\n}: HoldButtonLayoutedProps) => {\n const colorScheme = useAppColorScheme();\n\n const [isFinished, setFinished] = useState(false);\n useEffect(() => {\n if (isFinished) {\n onFinished();\n }\n }, [isFinished, onFinished]);\n\n const progress = useSharedValue(0);\n\n const onLongPress = useCallback(() => {\n // Fix for detox bug https://github.com/wix/Detox/issues/4754\n if (isFinished || progress.value !== 0) {\n return;\n }\n setFinished(true);\n }, [progress, isFinished]);\n\n const onPressIn = useCallback(() => {\n const holdTimeout = holdTimeoutSecs * 1000;\n\n // start moving forward\n progress.value = withTiming(\n 1,\n {\n duration: (1 - progress.value) * holdTimeout,\n easing: Easing.linear,\n },\n (finished) => {\n if (finished) {\n runOnJS(setFinished)(true);\n } else {\n // start moving back\n progress.value = withTiming(0, {\n duration: progress.value * holdTimeout,\n easing: Easing.linear,\n });\n }\n },\n );\n }, [holdTimeoutSecs, progress]);\n\n const onPressOut = useCallback(() => cancelAnimation(progress), [progress]);\n\n const translateX = useDerivedValue(() => progress.value * width, [width]);\n const movingRightStyle = useAnimatedStyle(() => ({\n transform: [{ translateX: translateX.value }],\n }), [translateX]);\n const movingLeftStyle = useAnimatedStyle(() => ({\n transform: [{ translateX: -translateX.value }],\n }), [translateX]);\n\n const contentProps = useMemo(\n () => ({ title, subtitlePrefix, subtitleSuffix, progress, holdTimeoutSecs, width, height }),\n [title, subtitlePrefix, subtitleSuffix, progress, holdTimeoutSecs, width, height],\n );\n\n return (\n <>\n <Content textColor={colorScheme.accent} disabled={disabled} {...contentProps} />\n {!disabled && (\n <Animated.View style={[styles.movingLayer, { backgroundColor: colorScheme.accent }, movingRightStyle]}>\n <Animated.View style={movingLeftStyle}>\n <Content textColor={colorScheme.accentText} {...contentProps} />\n </Animated.View>\n </Animated.View>\n )}\n <View style={styles.pressableLayer}>\n <TouchableWithoutFeedback\n accessibilityRole=\"button\"\n ref={ref}\n disabled={isFinished || disabled}\n onLongPress={onLongPress}\n onPressIn={isFinished ? undefined : onPressIn}\n onPressOut={isFinished ? undefined : onPressOut}\n {...props}>\n <View style={{ width, height }} />\n </TouchableWithoutFeedback>\n </View>\n </>\n );\n};\n\n/**\n * Press and hold button component\n *\n * follows design: https://www.figma.com/design/cCmAyBQrQWCQZuDi85pJfe/Procivis-One-Wallet-Developments-2025?node-id=1-871\n */\nconst HoldButton = React.forwardRef<TouchableWithoutFeedbackRef, HoldButtonProps>(\n ({ style, disabled, ...props }, ref) => {\n const colorScheme = useAppColorScheme();\n\n const [layout, setLayout] = useState<{ width: number; height: number }>();\n const onContainerLayout = useCallback(({ nativeEvent }: LayoutChangeEvent) => {\n setLayout({ width: nativeEvent.layout.width, height: nativeEvent.layout.height });\n }, []);\n\n return (\n <View\n onLayout={onContainerLayout}\n style={[\n styles.container,\n disabled && styles.disabled,\n {\n backgroundColor: disabled ? colorScheme.white : colorScheme.background,\n borderColor: colorScheme.background,\n },\n style,\n ]}>\n {layout && <HoldButtonLayouted ref={ref} disabled={disabled} {...props} {...layout} />}\n </View>\n );\n },\n);\n\nHoldButton.displayName = 'HoldButton';\n\nconst styles = StyleSheet.create({\n container: {\n borderRadius: 12,\n height: 68,\n overflow: 'hidden',\n },\n contentDisabled: {\n opacity: 0.4,\n },\n contentWrapper: {\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingBottom: 16,\n paddingHorizontal: 24,\n paddingTop: 12,\n },\n disabled: {\n borderWidth: 1,\n },\n movingLayer: {\n overflow: 'hidden',\n position: 'absolute',\n },\n pressableLayer: {\n position: 'absolute',\n },\n subtitle: {\n alignItems: 'flex-end',\n flexDirection: 'row',\n opacity: 0.8,\n },\n subtitleDisabled: {\n opacity: 1,\n },\n subtitleSecs: {\n alignItems: 'center',\n },\n subtitleSecsWrapper: {\n overflow: 'hidden',\n },\n});\n\nexport default HoldButton;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,SAAwCC,UAAU,EAAiCC,IAAI,QAAQ,cAAc;AAC7G,OAAOC,QAAQ,IACbC,eAAe,EACfC,MAAM,EACNC,OAAO,EAEPC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAEhC,SAASC,wBAAwB,QAAqC,+CAA+C;AACrH,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,iBAAiB,QAAQ,UAAU;AA0B5C,MAAMC,OAAO,GAAGA,CAAC;EACfC,KAAK;EACLC,cAAc;EACdC,cAAc;EACdC,KAAK;EACLC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,eAAe;EACfC;AACY,CAAC,KAAK;EAClB,MAAMC,IAAI,GAAGzB,OAAO,CAClB,MAAM0B,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEL,eAAe,GAAG;EAAE,CAAC,CAAC,CAACM,GAAG,CAAC,CAACC,CAAC,EAAEC,KAAK,KAAKR,eAAe,GAAGQ,KAAK,CAAC,EAC5F,CAACR,eAAe,CAClB,CAAC;EAED,MAAM,CAACS,cAAc,EAAEC,iBAAiB,CAAC,GA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,EAAEA;EAAS,GAAKoC,KAAK,EAAMxB,MAAM,CAAG,CACjF,CAAC;AAEX,CACF,CAAC;AAEDiD,UAAU,CAACQ,WAAW,GAAG,YAAY;AAErC,MAAMlD,MAAM,GAAGzC,UAAU,CAAC4F,MAAM,CAAC;EAC/BL,SAAS,EAAE;IACTM,YAAY,EAAE,EAAE;IAChB3E,MAAM,EAAE,EAAE;IACV4E,QAAQ,EAAE;EACZ,CAAC;EACDnD,eAAe,EAAE;IACfoD,OAAO,EAAE;EACX,CAAC;EACDrD,cAAc,EAAE;IACdsD,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BC,aAAa,EAAE,EAAE;IACjBC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE;EACd,CAAC;EACD9E,QAAQ,EAAE;IACR+E,WAAW,EAAE;EACf,CAAC;EACDxB,WAAW,EAAE;IACXiB,QAAQ,EAAE,QAAQ;IAClBQ,QAAQ,EAAE;EACZ,CAAC;EACDtB,cAAc,EAAE;IACdsB,QAAQ,EAAE;EACZ,CAAC;EACDvD,QAAQ,EAAE;IACRiD,UAAU,EAAE,UAAU;IACtBO,aAAa,EAAE,KAAK;IACpBR,OAAO,EAAE;EACX,CAAC;EACD/C,gBAAgB,EAAE;IAChB+C,OAAO,EAAE;EACX,CAAC;EACD3C,YAAY,EAAE;IACZ4C,UAAU,EAAE;EACd,CAAC;EACD7C,mBAAmB,EAAE;IACnB2C,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,eAAeX,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","View","Animated","cancelAnimation","Easing","runOnJS","useAnimatedStyle","useDerivedValue","useSharedValue","withTiming","TouchableOpacity","Typography","useAppColorScheme","Content","title","subtitlePrefix","subtitleSuffix","width","height","textColor","progress","holdTimeoutSecs","disabled","nums","Array","from","length","map","_","index","subtitleHeight","setSubtitleHeight","onSubtitleLayout","nativeEvent","layout","translateY","value","movingUpStyle","transform","createElement","style","styles","contentWrapper","contentDisabled","pointerEvents","color","numberOfLines","subtitle","subtitleDisabled","onLayout","preset","subtitleSecsWrapper","subtitleSecs","val","key","HoldButtonLayouted","onFinished","ref","props","colorScheme","isFinished","setFinished","onLongPress","onPressIn","holdTimeout","duration","easing","linear","finished","onPressOut","translateX","movingRightStyle","movingLeftStyle","contentProps","Fragment","_extends","accent","movingLayer","backgroundColor","accentText","pressableLayer","accessibilityRole","undefined","activeOpacity","HoldButton","forwardRef","setLayout","onContainerLayout","container","white","background","borderColor","displayName","create","borderRadius","overflow","opacity","alignItems","justifyContent","paddingBottom","paddingHorizontal","paddingTop","borderWidth","position","flexDirection"],"sources":["hold-button.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { ColorValue, LayoutChangeEvent, StyleSheet, TouchableWithoutFeedbackProps, View } from 'react-native';\nimport Animated, {\n cancelAnimation,\n Easing,\n runOnJS,\n SharedValue,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { TouchableOpacity, TouchableOpacityRef } from '../accessibility/accessibilityHistoryWrappers';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\nexport interface HoldButtonProps\n extends Omit<\n TouchableWithoutFeedbackProps,\n 'children' | 'onLayout' | 'onPress' | 'onLongPress' | 'onPressIn' | 'onPressOut'\n > {\n title: string;\n subtitlePrefix: string;\n subtitleSuffix: string;\n holdTimeoutSecs?: number;\n onFinished: () => void;\n}\n\ninterface ContentProps {\n title: string;\n subtitlePrefix: string;\n subtitleSuffix: string;\n width: number;\n height: number;\n textColor: ColorValue;\n progress: SharedValue<number>;\n holdTimeoutSecs: number;\n disabled?: boolean;\n}\n\nconst Content = ({\n title,\n subtitlePrefix,\n subtitleSuffix,\n width,\n height,\n textColor,\n progress,\n holdTimeoutSecs,\n disabled,\n}: ContentProps) => {\n const nums = useMemo(\n () => Array.from({ length: holdTimeoutSecs + 1 }).map((_, index) => holdTimeoutSecs - index),\n [holdTimeoutSecs],\n );\n\n const [subtitleHeight, setSubtitleHeight] = useState<number>(0);\n const onSubtitleLayout = useCallback(({ nativeEvent }: LayoutChangeEvent) => {\n setSubtitleHeight(nativeEvent.layout.height);\n }, []);\n\n const translateY = useDerivedValue(\n () => progress.value * subtitleHeight * holdTimeoutSecs,\n [subtitleHeight, holdTimeoutSecs],\n );\n const movingUpStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: -translateY.value }],\n }), [translateY]);\n\n return (\n <View style={[styles.contentWrapper, disabled && styles.contentDisabled, { width, height }]} pointerEvents=\"none\">\n <Typography color={textColor} numberOfLines={1}>\n {title}\n </Typography>\n\n <View style={[styles.subtitle, disabled && styles.subtitleDisabled]}>\n <Typography onLayout={onSubtitleLayout} preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {subtitlePrefix}\n </Typography>\n <View style={[styles.subtitleSecsWrapper, { height: subtitleHeight }]}>\n <Animated.View style={[styles.subtitleSecs, movingUpStyle]}>\n {nums.map((val) => (\n <Typography key={val} preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {val}\n </Typography>\n ))}\n </Animated.View>\n </View>\n <Typography preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {subtitleSuffix}\n </Typography>\n </View>\n </View>\n );\n};\n\ninterface HoldButtonLayoutedProps extends Omit<HoldButtonProps, 'style'> {\n ref: React.ForwardedRef<TouchableOpacityRef>;\n width: number;\n height: number;\n}\n\nconst HoldButtonLayouted = ({\n title,\n subtitlePrefix,\n subtitleSuffix,\n onFinished,\n holdTimeoutSecs = 3,\n width,\n height,\n disabled,\n ref,\n ...props\n}: HoldButtonLayoutedProps) => {\n const colorScheme = useAppColorScheme();\n\n const [isFinished, setFinished] = useState(false);\n useEffect(() => {\n if (isFinished) {\n onFinished();\n }\n }, [isFinished, onFinished]);\n\n const progress = useSharedValue(0);\n\n const onLongPress = useCallback(() => {\n // Fix for detox bug https://github.com/wix/Detox/issues/4754\n if (isFinished || progress.value !== 0) {\n return;\n }\n setFinished(true);\n }, [progress, isFinished]);\n\n const onPressIn = useCallback(() => {\n const holdTimeout = holdTimeoutSecs * 1000;\n\n // start moving forward\n progress.value = withTiming(\n 1,\n {\n duration: (1 - progress.value) * holdTimeout,\n easing: Easing.linear,\n },\n (finished) => {\n if (finished) {\n runOnJS(setFinished)(true);\n } else {\n // start moving back\n progress.value = withTiming(0, {\n duration: progress.value * holdTimeout,\n easing: Easing.linear,\n });\n }\n },\n );\n }, [holdTimeoutSecs, progress]);\n\n const onPressOut = useCallback(() => cancelAnimation(progress), [progress]);\n\n const translateX = useDerivedValue(() => progress.value * width, [width]);\n const movingRightStyle = useAnimatedStyle(() => ({\n transform: [{ translateX: translateX.value }],\n }), [translateX]);\n const movingLeftStyle = useAnimatedStyle(() => ({\n transform: [{ translateX: -translateX.value }],\n }), [translateX]);\n\n const contentProps = useMemo(\n () => ({ title, subtitlePrefix, subtitleSuffix, progress, holdTimeoutSecs, width, height }),\n [title, subtitlePrefix, subtitleSuffix, progress, holdTimeoutSecs, width, height],\n );\n\n return (\n <>\n <Content textColor={colorScheme.accent} disabled={disabled} {...contentProps} />\n {!disabled && (\n <Animated.View style={[styles.movingLayer, { backgroundColor: colorScheme.accent }, movingRightStyle]}>\n <Animated.View style={movingLeftStyle}>\n <Content textColor={colorScheme.accentText} {...contentProps} />\n </Animated.View>\n </Animated.View>\n )}\n <View style={styles.pressableLayer}>\n <TouchableOpacity\n accessibilityRole=\"button\"\n ref={ref}\n disabled={isFinished || disabled}\n onLongPress={onLongPress}\n onPressIn={isFinished ? undefined : onPressIn}\n onPressOut={isFinished ? undefined : onPressOut}\n activeOpacity={1}\n {...props}>\n <View style={{ width, height }} />\n </TouchableOpacity>\n </View>\n </>\n );\n};\n\n/**\n * Press and hold button component\n *\n * follows design: https://www.figma.com/design/cCmAyBQrQWCQZuDi85pJfe/Procivis-One-Wallet-Developments-2025?node-id=1-871\n */\nconst HoldButton = React.forwardRef<TouchableOpacityRef, HoldButtonProps>(\n ({ style, disabled, ...props }, ref) => {\n const colorScheme = useAppColorScheme();\n\n const [layout, setLayout] = useState<{ width: number; height: number }>();\n const onContainerLayout = useCallback(({ nativeEvent }: LayoutChangeEvent) => {\n setLayout({ width: nativeEvent.layout.width, height: nativeEvent.layout.height });\n }, []);\n\n return (\n <View\n onLayout={onContainerLayout}\n style={[\n styles.container,\n disabled && styles.disabled,\n {\n backgroundColor: disabled ? colorScheme.white : colorScheme.background,\n borderColor: colorScheme.background,\n },\n style,\n ]}>\n {layout && <HoldButtonLayouted ref={ref} disabled={disabled} {...props} {...layout} />}\n </View>\n );\n },\n);\n\nHoldButton.displayName = 'HoldButton';\n\nconst styles = StyleSheet.create({\n container: {\n borderRadius: 12,\n height: 68,\n overflow: 'hidden',\n },\n contentDisabled: {\n opacity: 0.4,\n },\n contentWrapper: {\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingBottom: 16,\n paddingHorizontal: 24,\n paddingTop: 12,\n },\n disabled: {\n borderWidth: 1,\n },\n movingLayer: {\n overflow: 'hidden',\n position: 'absolute',\n },\n pressableLayer: {\n position: 'absolute',\n },\n subtitle: {\n alignItems: 'flex-end',\n flexDirection: 'row',\n opacity: 0.8,\n },\n subtitleDisabled: {\n opacity: 1,\n },\n subtitleSecs: {\n alignItems: 'center',\n },\n subtitleSecsWrapper: {\n overflow: 'hidden',\n },\n});\n\nexport default HoldButton;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,SAAwCC,UAAU,EAAiCC,IAAI,QAAQ,cAAc;AAC7G,OAAOC,QAAQ,IACbC,eAAe,EACfC,MAAM,EACNC,OAAO,EAEPC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAEhC,SAASC,gBAAgB,QAA6B,+CAA+C;AACrG,SA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a,EAAE,KAAK;IACpBR,OAAO,EAAE;EACX,CAAC;EACDhD,gBAAgB,EAAE;IAChBgD,OAAO,EAAE;EACX,CAAC;EACD5C,YAAY,EAAE;IACZ6C,UAAU,EAAE;EACd,CAAC;EACD9C,mBAAmB,EAAE;IACnB4C,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,eAAeX,UAAU","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import QRCodeScanner
|
|
2
|
-
export { QRCodeScanner
|
|
1
|
+
import QRCodeScanner from './qr-code-scanner';
|
|
2
|
+
export { QRCodeScanner };
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["QRCodeScanner"
|
|
1
|
+
{"version":3,"names":["QRCodeScanner"],"sources":["index.tsx"],"sourcesContent":["import type { QRCodeScannerProps } from './qr-code-scanner';\nimport QRCodeScanner from './qr-code-scanner';\n\nexport { QRCodeScanner, QRCodeScannerProps };\n"],"mappings":"AACA,OAAOA,aAAa,MAAM,mBAAmB;AAE7C,SAASA,aAAa","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Checkbox
|
|
2
|
-
import { Switch
|
|
3
|
-
export { Checkbox,
|
|
1
|
+
import { Checkbox } from './checkbox';
|
|
2
|
+
import { Switch } from './switch';
|
|
3
|
+
export { Checkbox, Switch };
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Checkbox","
|
|
1
|
+
{"version":3,"names":["Checkbox","Switch"],"sources":["index.ts"],"sourcesContent":["import type { CheckboxProps } from './checkbox';\nimport { Checkbox } from './checkbox';\nimport type { SwitchProps } from './switch';\nimport { Switch } from './switch';\n\nexport { Checkbox, CheckboxProps, Switch, SwitchProps };\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,YAAY;AAErC,SAASC,MAAM,QAAQ,UAAU;AAEjC,SAASD,QAAQ,EAAiBC,MAAM","ignoreList":[]}
|
|
@@ -110,7 +110,7 @@ const CredentialDetailsCard = ({
|
|
|
110
110
|
}), /*#__PURE__*/React.createElement(CredentialCard, _extends({}, cardProps, {
|
|
111
111
|
header: {
|
|
112
112
|
...header,
|
|
113
|
-
accessory: (_header$accessory = header.accessory) !== null && _header$accessory !== void 0 ? _header$accessory : CaretIcon
|
|
113
|
+
accessory: (_header$accessory = header.accessory) !== null && _header$accessory !== void 0 ? _header$accessory : cardProps.onHeaderPress ? CaretIcon : undefined
|
|
114
114
|
},
|
|
115
115
|
style: [styles.card, cardProps.style]
|
|
116
116
|
})), previewAttributes.length > 0 && /*#__PURE__*/React.createElement(Animated.View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withTiming","concatTestID","Button","ButtonType","DownIcon","UpIcon","useAppColorScheme","CredentialAttributeItem","CredentialCard","PREVIEW_ATTRIBUTES_COUNT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","previewAttributesHeight","setPreviewAttributesHeight","fullAttributesHeight","setFullAttributesHeight","buttonViewHeight","setButtonViewHeight","allAttributesRendered","setAllAttributesRendered","length","CaretIcon","currentHeight","undefined","previewAttributes","slice","extraAttributes","viewStyle","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","additionalAttributesHeight","additionalHeight","newHeight","value","duration","credentialAttributesStyle","height","onPreviewAttrContentLayout","event","nativeEvent","layout","onFullAttrContentLayout","onButtonViewLayout","footerView","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","_extends","detailsCard","backgroundColor","white","accessory","attributesAnimatedWrapper","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","type","Secondary","title","index","create","paddingHorizontal","width","overflow","paddingTop","position","borderRadius","marginTop"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n const [buttonViewHeight, setButtonViewHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n\n const CaretIcon = expanded ? UpIcon : DownIcon;\n\n const currentHeight = useSharedValue<number | undefined>(undefined);\n\n const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];\n const extraAttributes = useMemo(() => (attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : []), [attributes]);\n\n useEffect(() => {\n if (!extraAttributes || allAttributesRendered) {\n setButtonViewHeight(0);\n }\n }, [extraAttributes, allAttributesRendered]);\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined || buttonViewHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;\n const newHeight = expanded || !animate ? previewAttributesHeight + additionalHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = !expanded\n ? 250\n : allAttributesRendered\n ? previewAttributes.length * 50\n : extraAttributes.length * 50;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n buttonViewHeight,\n currentHeight,\n animate,\n expanded,\n extraAttributes.length,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n ]);\n\n const credentialAttributesStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: 0,\n };\n }\n return {\n height: currentHeight.value,\n };\n }, [expanded, currentHeight]);\n\n const onPreviewAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setPreviewAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onFullAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setFullAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onButtonViewLayout = useCallback((event: LayoutChangeEvent) => {\n setButtonViewHeight(event.nativeEvent.layout.height);\n }, []);\n\n const footerView: ReactElement | undefined = useMemo(() => {\n if (!footer) {\n return undefined;\n }\n if (React.isValidElement(footer)) {\n return footer;\n } else {\n const FooterComponent = footer as React.ComponentType<any>;\n return <FooterComponent />;\n }\n }, [footer]);\n\n const { header, ...cardProps } = card;\n\n const renderExtraAttributes =\n allAttributesRendered || (previewAttributesHeight !== undefined && currentHeight.value !== undefined);\n return (\n <View\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, style]}\n {...viewProps}\n testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>\n <CredentialCard\n {...cardProps}\n header={{ ...header, accessory: header.accessory ?? CaretIcon }}\n style={[styles.card, cardProps.style]}\n />\n {previewAttributes.length > 0 && (\n <Animated.View style={[styles.attributesAnimatedWrapper, credentialAttributesStyle]}>\n <View style={styles.attributesWrapper}>\n <View onLayout={onPreviewAttrContentLayout} style={styles.previewAttributesWrapper}>\n {previewAttributes.map((attribute, idx) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && !extraAttributes.length && idx === previewAttributes.length - 1}\n testID={concatTestID(testID, 'attribute', idx.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n {!allAttributesRendered && extraAttributes.length > 0 && (\n <View style={styles.allAttributesWrapper} onLayout={onButtonViewLayout}>\n <Button\n onPress={() => setAllAttributesRendered(true)}\n type={ButtonType.Secondary}\n testID={concatTestID(testID, 'showAllAttributesButton')}\n title={showAllButtonLabel!}\n />\n </View>\n )}\n {renderExtraAttributes && (\n <View\n style={[styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter]}\n onLayout={onFullAttrContentLayout}>\n {extraAttributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && index === length - 1}\n testID={concatTestID(testID, 'attribute', index.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n )}\n </View>\n </Animated.View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n allAttributesWrapper: {\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n allAttributesWrapperWithFooter: {\n paddingBottom: 0,\n },\n attributesAnimatedWrapper: {\n overflow: 'hidden',\n },\n attributesWrapper: {\n paddingTop: 7,\n position: 'absolute',\n width: '100%',\n },\n card: {\n borderRadius: 0,\n },\n detailsCard: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAqCC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACzG,SAAiDC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAClG,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,QAAQ,yBAAyB;AAEhG,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,MAAM,EAAEC,UAAU,QAAQ,eAAe;AAClD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AACzD,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,OAAOC,uBAAuB,MAA+B,8BAA8B;AAC3F,OAAOC,cAAc,MAA+B,mBAAmB;AAavE,MAAMC,wBAAwB,GAAG,CAAC;AAElC,MAAMC,qBAAqD,GAAGA,CAAC;EAC7DC,OAAO,GAAG,IAAI;EACdC,UAAU;EACVC,IAAI;EACJC,QAAQ;EACRC,MAAM;EACNC,cAAc;EACdC,mBAAmB;EACnBC,KAAK;EACLC,kBAAkB;EAClBC,MAAM;EACN,GAAGC;AACL,CAAC,KAAK;EAAA,IAAAC,iBAAA;EACJ,MAAMC,WAAW,GAAGjB,iBAAiB,CAAC,CAAC;EACvC,MAAM,CAACkB,uBAAuB,EAAEC,0BAA0B,CAAC,GAAG/B,QAAQ,CAAS,CAAC;EAChF,MAAM,CAACg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D,CAAC;AAEX,CAAC;AAED,MAAMlB,MAAM,GAAG9C,UAAU,CAAC4F,MAAM,CAAC;EAC/B7C,oBAAoB,EAAE;IACpBG,aAAa,EAAE,EAAE;IACjB2C,iBAAiB,EAAE,CAAC;IACpBC,KAAK,EAAE;EACT,CAAC;EACD9C,8BAA8B,EAAE;IAC9BE,aAAa,EAAE;EACjB,CAAC;EACD0B,yBAAyB,EAAE;IACzBmB,QAAQ,EAAE;EACZ,CAAC;EACDlB,iBAAiB,EAAE;IACjBmB,UAAU,EAAE,CAAC;IACbC,QAAQ,EAAE,UAAU;IACpBH,KAAK,EAAE;EACT,CAAC;EACD5E,IAAI,EAAE;IACJgF,YAAY,EAAE;EAChB,CAAC;EACD1B,WAAW,EAAE;IACX0B,YAAY,EAAE,EAAE;IAChBH,QAAQ,EAAE;EACZ,CAAC;EACD3E,MAAM,EAAE;IACN+E,SAAS,EAAE;EACb,CAAC;EACDpB,wBAAwB,EAAE;IACxBc,iBAAiB,EAAE,CAAC;IACpBC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAe/E,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","PREVIEW_ATTRIBUTES_COUNT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","previewAttributesHeight","setPreviewAttributesHeight","fullAttributesHeight","setFullAttributesHeight","buttonViewHeight","setButtonViewHeight","allAttributesRendered","setAllAttributesRendered","length","CaretIcon","currentHeight","undefined","previewAttributes","slice","extraAttributes","viewStyle","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","additionalAttributesHeight","additionalHeight","newHeight","value","duration","credentialAttributesStyle","height","onPreviewAttrContentLayout","event","nativeEvent","layout","onFullAttrContentLayout","onButtonViewLayout","footerView","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","_extends","detailsCard","backgroundColor","white","accessory","onHeaderPress","attributesAnimatedWrapper","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","type","Secondary","title","index","create","paddingHorizontal","width","overflow","paddingTop","position","borderRadius","marginTop"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n const [buttonViewHeight, setButtonViewHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n\n const CaretIcon = expanded ? UpIcon : DownIcon;\n\n const currentHeight = useSharedValue<number | undefined>(undefined);\n\n const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];\n const extraAttributes = useMemo(() => (attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : []), [attributes]);\n\n useEffect(() => {\n if (!extraAttributes || allAttributesRendered) {\n setButtonViewHeight(0);\n }\n }, [extraAttributes, allAttributesRendered]);\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined || buttonViewHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;\n const newHeight = expanded || !animate ? previewAttributesHeight + additionalHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = !expanded\n ? 250\n : allAttributesRendered\n ? previewAttributes.length * 50\n : extraAttributes.length * 50;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n buttonViewHeight,\n currentHeight,\n animate,\n expanded,\n extraAttributes.length,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n ]);\n\n const credentialAttributesStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: 0,\n };\n }\n return {\n height: currentHeight.value,\n };\n }, [expanded, currentHeight]);\n\n const onPreviewAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setPreviewAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onFullAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setFullAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onButtonViewLayout = useCallback((event: LayoutChangeEvent) => {\n setButtonViewHeight(event.nativeEvent.layout.height);\n }, []);\n\n const footerView: ReactElement | undefined = useMemo(() => {\n if (!footer) {\n return undefined;\n }\n if (React.isValidElement(footer)) {\n return footer;\n } else {\n const FooterComponent = footer as React.ComponentType<any>;\n return <FooterComponent />;\n }\n }, [footer]);\n\n const { header, ...cardProps } = card;\n\n const renderExtraAttributes =\n allAttributesRendered || (previewAttributesHeight !== undefined && currentHeight.value !== undefined);\n return (\n <View\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, style]}\n {...viewProps}\n testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>\n <CredentialCard\n {...cardProps}\n header={{ ...header, accessory: header.accessory ?? (cardProps.onHeaderPress ? CaretIcon : undefined) }}\n style={[styles.card, cardProps.style]}\n />\n {previewAttributes.length > 0 && (\n <Animated.View style={[styles.attributesAnimatedWrapper, credentialAttributesStyle]}>\n <View style={styles.attributesWrapper}>\n <View onLayout={onPreviewAttrContentLayout} style={styles.previewAttributesWrapper}>\n {previewAttributes.map((attribute, idx) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && !extraAttributes.length && idx === previewAttributes.length - 1}\n testID={concatTestID(testID, 'attribute', idx.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n {!allAttributesRendered && extraAttributes.length > 0 && (\n <View style={styles.allAttributesWrapper} onLayout={onButtonViewLayout}>\n <Button\n onPress={() => setAllAttributesRendered(true)}\n type={ButtonType.Secondary}\n testID={concatTestID(testID, 'showAllAttributesButton')}\n title={showAllButtonLabel!}\n />\n </View>\n )}\n {renderExtraAttributes && (\n <View\n style={[styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter]}\n onLayout={onFullAttrContentLayout}>\n {extraAttributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && index === length - 1}\n testID={concatTestID(testID, 'attribute', index.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n )}\n </View>\n </Animated.View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n allAttributesWrapper: {\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n allAttributesWrapperWithFooter: {\n paddingBottom: 0,\n },\n attributesAnimatedWrapper: {\n overflow: 'hidden',\n },\n attributesWrapper: {\n paddingTop: 7,\n position: 'absolute',\n width: '100%',\n },\n card: {\n borderRadius: 0,\n },\n detailsCard: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAqCC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACzG,SAAiDC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAClG,OAAOC,QAAQ,IAAIC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,QAAQ,yBAAyB;AAEhG,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,MAAM,EAAEC,UAAU,QAAQ,eAAe;AAClD,SAASC,QAAQ,EAAEC,MAAM,QAAQ,wBAAwB;AACzD,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,OAAOC,uBAAuB,MAA+B,8BAA8B;AAC3F,OAAOC,cAAc,MAA+B,mBAAmB;AAavE,MAAMC,wBAAwB,GAAG,CAAC;AAElC,MAAMC,qBAAqD,GAAGA,CAAC;EAC7DC,OAAO,GAAG,IAAI;EACdC,UAAU;EACVC,IAAI;EACJC,QAAQ;EACR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ACmB,MAAM,EAAE,WAAW,EAAEmE,KAAK,CAACL,QAAQ,CAAC,CAAC,CAAE;IAC5DlE,cAAc,EAAEA,cAAe;IAC/BmE,OAAO,EAAElE;EAAoB,GACzB4D,SAAS,CACd,CACF,CACG,CAEJ,CACO,CAChB,EACAlB,UAAU,gBAAGrE,KAAA,CAAAwE,aAAA,CAAClE,IAAI;IAACsB,KAAK,EAAEuB,MAAM,CAAC1B;EAAO,GAAE4C,UAAiB,CAAC,GAAG,IAC5D,CAAC;AAEX,CAAC;AAED,MAAMlB,MAAM,GAAG9C,UAAU,CAAC6F,MAAM,CAAC;EAC/B9C,oBAAoB,EAAE;IACpBG,aAAa,EAAE,EAAE;IACjB4C,iBAAiB,EAAE,CAAC;IACpBC,KAAK,EAAE;EACT,CAAC;EACD/C,8BAA8B,EAAE;IAC9BE,aAAa,EAAE;EACjB,CAAC;EACD2B,yBAAyB,EAAE;IACzBmB,QAAQ,EAAE;EACZ,CAAC;EACDlB,iBAAiB,EAAE;IACjBmB,UAAU,EAAE,CAAC;IACbC,QAAQ,EAAE,UAAU;IACpBH,KAAK,EAAE;EACT,CAAC;EACD7E,IAAI,EAAE;IACJiF,YAAY,EAAE;EAChB,CAAC;EACD3B,WAAW,EAAE;IACX2B,YAAY,EAAE,EAAE;IAChBH,QAAQ,EAAE;EACZ,CAAC;EACD5E,MAAM,EAAE;IACNgF,SAAS,EAAE;EACb,CAAC;EACDpB,wBAAwB,EAAE;IACxBc,iBAAiB,EAAE,CAAC;IACpBC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAehF,qBAAqB","ignoreList":[]}
|
|
@@ -50,16 +50,23 @@ export const Barcode = ({
|
|
|
50
50
|
export const QrCode = ({
|
|
51
51
|
content,
|
|
52
52
|
padding,
|
|
53
|
-
testID
|
|
53
|
+
testID,
|
|
54
|
+
onError
|
|
54
55
|
}) => {
|
|
55
56
|
const qrCodeXml = useMemo(() => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
try {
|
|
58
|
+
return new QRCode({
|
|
59
|
+
container: 'svg-viewbox',
|
|
60
|
+
content,
|
|
61
|
+
ecl: 'L',
|
|
62
|
+
join: true,
|
|
63
|
+
padding: padding !== null && padding !== void 0 ? padding : 1
|
|
64
|
+
}).svg();
|
|
65
|
+
} catch (err) {
|
|
66
|
+
onError && onError(err instanceof Error ? err.message : 'Unknown error occurred.');
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}, [content, onError, padding]);
|
|
63
70
|
return /*#__PURE__*/React.createElement(SvgXml, {
|
|
64
71
|
height: '100%',
|
|
65
72
|
testID: testID,
|
|
@@ -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","qrCodeXml","join","svg","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};\n\nexport const QrCode: FC<QrCodeProps> = ({ content, padding, testID }) => {\n const qrCodeXml = useMemo(() => {\n return new QRCode({\n
|
|
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;EAChB,CAAC;EACDC,cAAc,EAAE;IACdC,MAAM,EAAE;EACV,CAAC;EACDC,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,EAAE,aAAa;QACxBM,OAAO;QACPgB,GAAG,EAAE,GAAG;QACRC,IAAI,EAAE,IAAI;QACVJ,OAAO,EAAEA,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI;MACtB,CAAC,CAAC,CAACK,GAAG,CAAC,CAAC;IACV,CAAC,CAAC,OAAOC,GAAG,EAAE;MACZL,OAAO,IAAIA,OAAO,CAACK,GAAG,YAAYC,KAAK,GAAGD,GAAG,CAACE,OAAO,GAAG,yBAAyB,CAAC;MAClF,OAAO,IAAI;IACb;EACF,CAAC,EAAE,CAACrB,OAAO,EAAEc,OAAO,EAAED,OAAO,CAAC,CAAC;EAC/B,oBAAOlC,KAAA,CAAA8B,aAAA,CAAC1B,MAAM;IAACmB,MAAM,EAAE,MAAO;IAACC,MAAM,EAAEA,MAAO;IAACF,KAAK,EAAE,MAAO;IAACU,GAAG,EAAEI;EAAU,CAAE,CAAC;AAClF,CAAC;AAED,OAAO,MAAMO,GAA6C,GAAGA,CAAC;EAAEtB,OAAO;EAAEG;AAAO,CAAC,KAAK;EACpF,MAAMC,WAAW,GAAGnB,iBAAiB,CAAC,CAAC;EACvC,oBACEN,KAAA,CAAA8B,aAAA,CAAC3B,IAAI;IAAC4B,KAAK,EAAE,CAACxB,MAAM,CAACQ,SAAS,EAAER,MAAM,CAACW,aAAa;EAAE,gBACpDlB,KAAA,CAAA8B,aAAA,CAACzB,UAAU;IAACuC,KAAK,EAAEnB,WAAW,CAACoB,IAAK;IAACC,MAAM,EAAE,QAAS;IAACtB,MAAM,EAAEA;EAAO,GACnEH,OACS,CACR,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
2
|
+
import React, { useEffect, useMemo } from 'react';
|
|
3
3
|
import { Platform, StyleSheet, View } from 'react-native';
|
|
4
|
+
import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
|
|
5
|
+
import { LoaderView, LoaderViewState } from '../../ui-components/loader';
|
|
4
6
|
import { concatTestID } from '../../utils';
|
|
5
7
|
import Typography from '../text/typography';
|
|
6
8
|
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
@@ -14,18 +16,47 @@ const EntityCluster = ({
|
|
|
14
16
|
style,
|
|
15
17
|
sublineColor,
|
|
16
18
|
testID,
|
|
19
|
+
isLoading,
|
|
17
20
|
...viewProps
|
|
18
21
|
}) => {
|
|
19
22
|
const colorScheme = useAppColorScheme();
|
|
23
|
+
const opacity = useSharedValue(1);
|
|
24
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
25
|
+
opacity: opacity.value
|
|
26
|
+
}));
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!isLoading) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
opacity.value = withRepeat(withTiming(0.3, {
|
|
32
|
+
duration: 1000
|
|
33
|
+
}), 0, true);
|
|
34
|
+
}, [opacity, isLoading]);
|
|
20
35
|
const avatarProps = useMemo(() => {
|
|
21
36
|
var _avatar$placeholderTe;
|
|
37
|
+
if (isLoading) {
|
|
38
|
+
return {
|
|
39
|
+
avatar: {
|
|
40
|
+
component: /*#__PURE__*/React.createElement(View, {
|
|
41
|
+
style: [styles.loaderWrapper, {
|
|
42
|
+
backgroundColor: colorScheme.grayDark
|
|
43
|
+
}]
|
|
44
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
45
|
+
style: styles.loader
|
|
46
|
+
}, /*#__PURE__*/React.createElement(LoaderView, {
|
|
47
|
+
animate: true,
|
|
48
|
+
state: LoaderViewState.InProgress
|
|
49
|
+
})))
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
22
53
|
const initials = entityName.split(' ', 3).map(word => word[0]);
|
|
23
54
|
const placeholderText = initials.length > 0 ? initials.join('') : '';
|
|
24
55
|
return {
|
|
25
56
|
...avatar,
|
|
26
57
|
placeholderText: (_avatar$placeholderTe = avatar === null || avatar === void 0 ? void 0 : avatar.placeholderText) !== null && _avatar$placeholderTe !== void 0 ? _avatar$placeholderTe : placeholderText
|
|
27
58
|
};
|
|
28
|
-
}, [avatar, entityName]);
|
|
59
|
+
}, [avatar, entityName, colorScheme.grayDark, isLoading]);
|
|
29
60
|
return /*#__PURE__*/React.createElement(View, _extends({
|
|
30
61
|
style: [styles.entity, style],
|
|
31
62
|
testID: testID
|
|
@@ -33,13 +64,19 @@ const EntityCluster = ({
|
|
|
33
64
|
testID: concatTestID(testID, 'avatar')
|
|
34
65
|
}, avatarProps)), /*#__PURE__*/React.createElement(View, {
|
|
35
66
|
style: styles.labels
|
|
67
|
+
}, isLoading ? /*#__PURE__*/React.createElement(Animated.View, {
|
|
68
|
+
style: [{
|
|
69
|
+
backgroundColor: colorScheme.grayDark
|
|
70
|
+
}, animatedStyle]
|
|
36
71
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
72
|
+
color: colorScheme.grayDark
|
|
73
|
+
})) : /*#__PURE__*/React.createElement(Typography, {
|
|
37
74
|
testID: concatTestID(testID, 'entityName'),
|
|
38
75
|
color: textColor !== null && textColor !== void 0 ? textColor : colorScheme.text,
|
|
39
76
|
numberOfLines: 1,
|
|
40
77
|
preset: "m",
|
|
41
78
|
style: styles.entityName
|
|
42
|
-
}, entityName), subline && /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Typography, {
|
|
79
|
+
}, !isLoading ? entityName : undefined), subline && /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Typography, {
|
|
43
80
|
testID: concatTestID(testID, 'subline'),
|
|
44
81
|
color: sublineColor !== null && sublineColor !== void 0 ? sublineColor : colorScheme.text,
|
|
45
82
|
numberOfLines: 1,
|
|
@@ -57,6 +94,17 @@ const styles = StyleSheet.create({
|
|
|
57
94
|
labels: {
|
|
58
95
|
flex: 1,
|
|
59
96
|
marginLeft: 12
|
|
97
|
+
},
|
|
98
|
+
loader: {
|
|
99
|
+
transform: [{
|
|
100
|
+
scale: 0.5
|
|
101
|
+
}]
|
|
102
|
+
},
|
|
103
|
+
loaderWrapper: {
|
|
104
|
+
height: 72,
|
|
105
|
+
paddingLeft: 3,
|
|
106
|
+
paddingTop: 4,
|
|
107
|
+
width: 72
|
|
60
108
|
}
|
|
61
109
|
});
|
|
62
110
|
export default EntityCluster;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Platform","StyleSheet","View","concatTestID","Typography","useAppColorScheme","Avatar","EntityCluster","avatar","entityName","subline","textColor","style","sublineColor","testID","viewProps","colorScheme","avatarProps","_avatar$placeholderTe","initials","split","map","word","placeholderText","length","join","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","Platform","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withRepeat","withTiming","LoaderView","LoaderViewState","concatTestID","Typography","useAppColorScheme","Avatar","EntityCluster","avatar","entityName","subline","textColor","style","sublineColor","testID","isLoading","viewProps","colorScheme","opacity","animatedStyle","value","duration","avatarProps","_avatar$placeholderTe","component","createElement","styles","loaderWrapper","backgroundColor","grayDark","loader","animate","state","InProgress","initials","split","map","word","placeholderText","length","join","_extends","entity","labels","color","text","numberOfLines","preset","undefined","create","alignItems","flexDirection","letterSpacing","OS","flex","marginLeft","transform","scale","height","paddingLeft","paddingTop","width"],"sources":["entity-cluster.tsx"],"sourcesContent":["import React, { FunctionComponent, useEffect, useMemo } from 'react';\nimport { Platform, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withRepeat,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { LoaderView, LoaderViewState } from '../../ui-components/loader';\nimport { concatTestID } from '../../utils';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport Avatar, { AvatarProps } from './avatar';\n\nexport type EntityClusterProps = ViewProps & {\n avatar?: AvatarProps;\n entityName: string;\n subline?: string;\n textColor?: string;\n sublineColor?: string;\n testID?: string;\n isLoading?: boolean;\n};\n\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=426-25595&mode=design&t=YI1oD2BfBie5HcvJ-0\nconst EntityCluster: FunctionComponent<EntityClusterProps> = ({\n avatar,\n entityName,\n subline,\n textColor,\n style,\n sublineColor,\n testID,\n isLoading,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n \n const opacity = useSharedValue<number>(1);\n\n const animatedStyle = useAnimatedStyle(() => ({\n opacity: opacity.value,\n }));\n\n useEffect(() => {\n if (!isLoading) {\n return;\n }\n opacity.value = withRepeat(\n withTiming(0.3, { duration: 1000 }),\n 0,\n true\n );\n }, [opacity, isLoading]);\n\n const avatarProps = useMemo<AvatarProps>(() => {\n if (isLoading) {\n return {\n avatar: {\n component: \n <View style={[styles.loaderWrapper, { backgroundColor: colorScheme.grayDark }]}>\n <View style={styles.loader}>\n <LoaderView animate={true} state={LoaderViewState.InProgress} />\n </View>\n </View>\n }\n }\n }\n const initials = entityName.split(' ', 3).map((word: string) => word[0]);\n const placeholderText = initials.length > 0 ? initials.join('') : '';\n return {\n ...avatar,\n placeholderText: avatar?.placeholderText ?? placeholderText,\n };\n }, [avatar, entityName, colorScheme.grayDark, isLoading]);\n\n return (\n <View style={[styles.entity, style]} testID={testID} {...viewProps}>\n <Avatar testID={concatTestID(testID, 'avatar')} {...avatarProps} />\n <View style={styles.labels}>\n {isLoading ? (\n <Animated.View style={[{ backgroundColor: colorScheme.grayDark }, animatedStyle]}>\n <Typography color={colorScheme.grayDark} />\n </Animated.View>\n ) : (\n <Typography\n testID={concatTestID(testID, 'entityName')}\n color={textColor ?? colorScheme.text}\n numberOfLines={1}\n preset=\"m\"\n style={styles.entityName}>\n {!isLoading ? entityName : undefined}\n </Typography>\n )}\n {subline && (\n <View>\n <Typography\n testID={concatTestID(testID, 'subline')}\n color={sublineColor ?? colorScheme.text}\n numberOfLines={1}\n preset=\"xs\">\n {subline}\n </Typography>\n </View>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n entity: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n entityName: {\n letterSpacing: Platform.OS === 'ios' ? -0.2 : -0.3, // -0.2 breaks layout on Android\n },\n labels: {\n flex: 1,\n marginLeft: 12,\n },\n loader: {\n transform: [{scale: 0.5}],\n },\n loaderWrapper: {\n height: 72,\n paddingLeft: 3,\n paddingTop: 4,\n width: 72,\n }\n});\n\nexport default EntityCluster;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAuBC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACpE,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACpE,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAEhC,SAASC,UAAU,EAAEC,eAAe,QAAQ,4BAA4B;AACxE,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,MAAM,MAAuB,UAAU;AAY9C;AACA,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC,SAAS;EACTC,KAAK;EACLC,YAAY;EACZC,MAAM;EACNC,SAAS;EACT,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGZ,iBAAiB,CAAC,CAAC;EAEvC,MAAMa,OAAO,GAAGpB,cAAc,CAAS,CAAC,CAAC;EAEzC,MAAMqB,aAAa,GAAGtB,gBAAgB,CAAC,OAAO;IAC5CqB,OAAO,EAAEA,OAAO,CAACE;EACnB,CAAC,CAAC,CAAC;EAEH7B,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Y,GAAII,WAAW,CAAC4B,IAAK;IACxCC,aAAa,EAAE,CAAE;IACjBC,MAAM,EAAC;EAAI,GACVrC,OACS,CACR,CAEJ,CACF,CAAC;AAEX,CAAC;AAED,MAAMgB,MAAM,GAAGhC,UAAU,CAACuD,MAAM,CAAC;EAC/BP,MAAM,EAAE;IACNQ,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE;EACjB,CAAC;EACD1C,UAAU,EAAE;IACV2C,aAAa,EAAE3D,QAAQ,CAAC4D,EAAE,KAAK,KAAK,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAE;EACtD,CAAC;EACDV,MAAM,EAAE;IACNW,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE;EACd,CAAC;EACDzB,MAAM,EAAE;IACN0B,SAAS,EAAE,CAAC;MAACC,KAAK,EAAE;IAAG,CAAC;EAC1B,CAAC;EACD9B,aAAa,EAAE;IACb+B,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE,CAAC;IACdC,UAAU,EAAE,CAAC;IACbC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAetD,aAAa","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Avatar
|
|
2
|
-
import EntityCluster
|
|
3
|
-
export { Avatar
|
|
4
|
-
export { EntityCluster
|
|
1
|
+
import Avatar from './avatar';
|
|
2
|
+
import EntityCluster from './entity-cluster';
|
|
3
|
+
export { Avatar };
|
|
4
|
+
export { EntityCluster };
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Avatar","
|
|
1
|
+
{"version":3,"names":["Avatar","EntityCluster"],"sources":["index.ts"],"sourcesContent":["import type { AvatarProps } from './avatar';\nimport Avatar from './avatar';\nimport type { EntityClusterProps } from './entity-cluster';\nimport EntityCluster from './entity-cluster';\n\nexport { Avatar, AvatarProps };\nexport { EntityCluster, EntityClusterProps };\n"],"mappings":"AACA,OAAOA,MAAM,MAAM,UAAU;AAE7B,OAAOC,aAAa,MAAM,kBAAkB;AAE5C,SAASD,MAAM;AACf,SAASC,aAAa","ignoreList":[]}
|
|
@@ -123,7 +123,7 @@ export const HistoryDetailsView = ({
|
|
|
123
123
|
...props.credentialCard,
|
|
124
124
|
card: {
|
|
125
125
|
...props.credentialCard.card,
|
|
126
|
-
onHeaderPress
|
|
126
|
+
onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
return /*#__PURE__*/React.createElement(View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useMemo","StyleSheet","View","CredentialDetails","EntityDetails","HeaderInfoButton","concatTestID","useCredentialListExpandedCard","TouchableOpacity","BackButton","CredentialDetailsCardListItem","CredentialHeader","NextIcon","ScrollViewScreen","Typography","useAppColorScheme","DataItem","HistoryDetailsView","assets","data","headerButton","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_assets$cards","_assets$cards2","colorScheme","expandedCredential","onHeaderPress","setInitialCredential","cards","length","id","credentialDetails","credentialId","credentialCard","card","moreInfoHeaderButton","_labels$infoButtonAcc","undefined","createElement","onPress","accessibilityLabel","infoButtonAccessibility","hasAssets","header","leftItem","rightItem","static","title","scrollView","style","styles","content","section","backgroundColor","white","_extends","entity","borderColor","background","credentialHeader","blur","attribute","date","value","action","last","label","valueColor","color","valueIcon","icon","text","preset","sectionHeader","relatedAssets","disabled","onPressed","accessory","assetsHeader","map","props","index","key","credential","expanded","lastItem","itemProps","toString","create","borderRadius","paddingHorizontal","paddingTop","marginBottom","borderBottomWidth","paddingBottom","marginTop","padding","marginHorizontal","marginVertical"],"sources":["history-details.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useEffect, useMemo } from 'react';\nimport { ColorValue, ImageSourcePropType, StyleSheet, View } from 'react-native';\n\nimport { CredentialDetails, CredentialDetailsProps, EntityDetails, EntityDetailsProps } from '../../components';\nimport { HeaderInfoButton } from '../../components/navigation/header-buttons';\nimport { CardLabels, concatTestID, useCredentialListExpandedCard } from '../../utils';\nimport { TouchableOpacity } from '../accessibility';\nimport { BackButton } from '../buttons';\nimport {\n CredentialDetailsCardListItem,\n CredentialDetailsCardListItemProps,\n CredentialHeader,\n CredentialHeaderProps,\n} from '../credential';\nimport { NextIcon } from '../icons';\nimport { ScrollViewScreen } from '../screens';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\nimport DataItem from './data-item';\n\nexport type HistoryDetailsLabels = {\n credentialCard: CardLabels;\n data: {\n date: string;\n action: string;\n };\n infoButtonAccessibility?: string;\n relatedAssets: string;\n title: string;\n};\n\ntype CredentialDetails = Omit<\n CredentialDetailsProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n>;\n\ntype CredentialCard = Omit<\n CredentialDetailsCardListItemProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n>;\n\nexport type HistoryDetailsViewProps = {\n assets?: {\n header?: CredentialHeaderProps & {\n onPressed?: () => void;\n };\n cards?: (\n | {\n credentialDetails: CredentialDetails;\n }\n | {\n credentialCard: CredentialCard;\n }\n )[];\n };\n data: {\n header?:\n | {\n entity: EntityDetailsProps;\n }\n | {\n credentialHeader: CredentialHeaderProps;\n };\n date: string;\n action: {\n icon: ComponentType<any> | ReactElement;\n label: string;\n color: ColorValue;\n testID?: string;\n };\n };\n headerButton?: ReactElement;\n labels: HistoryDetailsLabels;\n onBackPressed: () => void;\n onInfoPressed?: () => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n testID: string;\n};\n\nexport const HistoryDetailsView: FC<HistoryDetailsViewProps> = ({\n assets,\n data,\n headerButton,\n labels,\n onBackPressed,\n onInfoPressed,\n onImagePreview,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { expandedCredential, onHeaderPress, setInitialCredential } = useCredentialListExpandedCard();\n\n // Expand the first credential\n useEffect(() => {\n if (assets?.cards && assets.cards.length > 0) {\n let id =\n 'credentialDetails' in assets.cards[0]\n ? assets.cards[0].credentialDetails.credentialId\n : assets.cards[0].credentialCard.card.credentialId;\n if (id) {\n setInitialCredential(id);\n }\n }\n }, [assets?.cards, setInitialCredential]);\n\n const moreInfoHeaderButton = useMemo(() => {\n if (headerButton) {\n return headerButton;\n }\n\n if (!onInfoPressed) {\n return undefined;\n }\n\n return (\n <HeaderInfoButton\n onPress={onInfoPressed}\n testID={concatTestID(testID, 'header', 'info')}\n accessibilityLabel={labels.infoButtonAccessibility ?? ''}\n />\n );\n }, [headerButton, labels.infoButtonAccessibility, onInfoPressed, testID]);\n\n const hasAssets = assets && (assets.header || assets.cards?.length);\n\n return (\n <ScrollViewScreen\n header={{\n leftItem: <BackButton onPress={onBackPressed} testID={concatTestID(testID, 'header', 'back')} />,\n rightItem: moreInfoHeaderButton,\n static: true,\n title: labels.title,\n }}\n scrollView={{\n style: styles.content,\n }}\n testID={testID}>\n <View style={[styles.section, { backgroundColor: colorScheme.white }]}>\n {data.header && 'entity' in data.header && (\n <EntityDetails\n {...data.header.entity}\n style={[styles.entity, { borderColor: colorScheme.background }, data.header.entity.style]}\n />\n )}\n {data.header && 'credentialHeader' in data.header && (\n <CredentialHeader\n {...data.header.credentialHeader}\n blur={false}\n style={[styles.header, { borderColor: colorScheme.background }, data.header.credentialHeader.style]}\n />\n )}\n <DataItem attribute={labels.data.date} value={data.date} />\n <DataItem\n attribute={labels.data.action}\n last\n testID={data.action.testID}\n value={data.action.label}\n valueColor={data.action.color}\n valueIcon={data.action.icon}\n />\n </View>\n\n {hasAssets && (\n <Typography color={colorScheme.text} preset=\"m\" style={styles.sectionHeader}>\n {labels.relatedAssets}\n </Typography>\n )}\n\n {assets?.header && (\n <TouchableOpacity disabled={!assets.header.onPressed} onPress={assets.header.onPressed}>\n <CredentialHeader\n {...assets.header}\n accessory={assets.header.onPressed ? <NextIcon color={colorScheme.text} /> : undefined}\n blur={false}\n style={[styles.assetsHeader, assets.header.style]}\n />\n </TouchableOpacity>\n )}\n {assets?.cards?.map((props, index, { length }) => {\n if ('credentialDetails' in props) {\n return (\n <View key={props.credentialDetails.credentialId} style={styles.credential}>\n <CredentialDetails\n {...props.credentialDetails}\n expanded={expandedCredential === props.credentialDetails.credentialId}\n labels={labels.credentialCard}\n lastItem={index === length - 1}\n onHeaderPress={onHeaderPress}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n } else {\n const itemProps = {\n ...props.credentialCard,\n card: {\n ...props.credentialCard.card,\n onHeaderPress,\n },\n };\n return (\n <View key={index.toString()} style={styles.credential}>\n <CredentialDetailsCardListItem\n {...itemProps}\n expanded={expandedCredential === props.credentialCard.card.credentialId}\n lastItem={index === length - 1}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n }\n })}\n </ScrollViewScreen>\n );\n};\n\nconst styles = StyleSheet.create({\n assetsHeader: {\n borderRadius: 8,\n },\n content: {\n paddingHorizontal: 16,\n paddingTop: 12,\n },\n credential: {\n marginBottom: 4,\n },\n entity: {\n borderBottomWidth: 1,\n paddingBottom: 8,\n },\n header: {\n borderBottomWidth: 1,\n marginTop: -8,\n paddingBottom: 12,\n paddingHorizontal: 0,\n },\n section: {\n borderRadius: 8,\n marginBottom: 12,\n padding: 12,\n },\n sectionHeader: {\n marginHorizontal: 4,\n marginVertical: 16,\n },\n});\n"],"mappings":";AAAA,OAAOA,KAAK,IAAqCC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAClF,SAA0CC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEhF,SAASC,iBAAiB,EAA0BC,aAAa,QAA4B,kBAAkB;AAC/G,SAASC,gBAAgB,QAAQ,4CAA4C;AAC7E,SAAqBC,YAAY,EAAEC,6BAA6B,QAAQ,aAAa;AACrF,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,UAAU,QAAQ,YAAY;AACvC,SACEC,6BAA6B,EAE7BC,gBAAgB,QAEX,eAAe;AACtB,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E;IACbwB,gBAAgB,EAAE,CAAC;IACnBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","StyleSheet","View","CredentialDetails","EntityDetails","HeaderInfoButton","concatTestID","useCredentialListExpandedCard","TouchableOpacity","BackButton","CredentialDetailsCardListItem","CredentialHeader","NextIcon","ScrollViewScreen","Typography","useAppColorScheme","DataItem","HistoryDetailsView","assets","data","headerButton","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_assets$cards","_assets$cards2","colorScheme","expandedCredential","onHeaderPress","setInitialCredential","cards","length","id","credentialDetails","credentialId","credentialCard","card","moreInfoHeaderButton","_labels$infoButtonAcc","undefined","createElement","onPress","accessibilityLabel","infoButtonAccessibility","hasAssets","header","leftItem","rightItem","static","title","scrollView","style","styles","content","section","backgroundColor","white","_extends","entity","borderColor","background","credentialHeader","blur","attribute","date","value","action","last","label","valueColor","color","valueIcon","icon","text","preset","sectionHeader","relatedAssets","disabled","onPressed","accessory","assetsHeader","map","props","index","key","credential","expanded","lastItem","itemProps","headerPressable","toString","create","borderRadius","paddingHorizontal","paddingTop","marginBottom","borderBottomWidth","paddingBottom","marginTop","padding","marginHorizontal","marginVertical"],"sources":["history-details.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useEffect, useMemo } from 'react';\nimport { ColorValue, ImageSourcePropType, StyleSheet, View } from 'react-native';\n\nimport { CredentialDetails, CredentialDetailsProps, EntityDetails, EntityDetailsProps } from '../../components';\nimport { HeaderInfoButton } from '../../components/navigation/header-buttons';\nimport { CardLabels, concatTestID, useCredentialListExpandedCard } from '../../utils';\nimport { TouchableOpacity } from '../accessibility';\nimport { BackButton } from '../buttons';\nimport {\n CredentialDetailsCardListItem,\n CredentialDetailsCardListItemProps,\n CredentialHeader,\n CredentialHeaderProps,\n} from '../credential';\nimport { NextIcon } from '../icons';\nimport { ScrollViewScreen } from '../screens';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\nimport DataItem from './data-item';\n\nexport type HistoryDetailsLabels = {\n credentialCard: CardLabels;\n data: {\n date: string;\n action: string;\n };\n infoButtonAccessibility?: string;\n relatedAssets: string;\n title: string;\n};\n\ntype CredentialDetails = Omit<\n CredentialDetailsProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n>;\n\ntype CredentialCard = Omit<\n CredentialDetailsCardListItemProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n> & {\n /** default: true */\n headerPressable?: boolean;\n};\n\nexport type HistoryDetailsViewProps = {\n assets?: {\n header?: CredentialHeaderProps & {\n onPressed?: () => void;\n };\n cards?: (\n | {\n credentialDetails: CredentialDetails;\n }\n | {\n credentialCard: CredentialCard;\n }\n )[];\n };\n data: {\n header?:\n | {\n entity: EntityDetailsProps;\n }\n | {\n credentialHeader: CredentialHeaderProps;\n };\n date: string;\n action: {\n icon: ComponentType<any> | ReactElement;\n label: string;\n color: ColorValue;\n testID?: string;\n };\n };\n headerButton?: ReactElement;\n labels: HistoryDetailsLabels;\n onBackPressed: () => void;\n onInfoPressed?: () => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n testID: string;\n};\n\nexport const HistoryDetailsView: FC<HistoryDetailsViewProps> = ({\n assets,\n data,\n headerButton,\n labels,\n onBackPressed,\n onInfoPressed,\n onImagePreview,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { expandedCredential, onHeaderPress, setInitialCredential } = useCredentialListExpandedCard();\n\n // Expand the first credential\n useEffect(() => {\n if (assets?.cards && assets.cards.length > 0) {\n let id =\n 'credentialDetails' in assets.cards[0]\n ? assets.cards[0].credentialDetails.credentialId\n : assets.cards[0].credentialCard.card.credentialId;\n if (id) {\n setInitialCredential(id);\n }\n }\n }, [assets?.cards, setInitialCredential]);\n\n const moreInfoHeaderButton = useMemo(() => {\n if (headerButton) {\n return headerButton;\n }\n\n if (!onInfoPressed) {\n return undefined;\n }\n\n return (\n <HeaderInfoButton\n onPress={onInfoPressed}\n testID={concatTestID(testID, 'header', 'info')}\n accessibilityLabel={labels.infoButtonAccessibility ?? ''}\n />\n );\n }, [headerButton, labels.infoButtonAccessibility, onInfoPressed, testID]);\n\n const hasAssets = assets && (assets.header || assets.cards?.length);\n\n return (\n <ScrollViewScreen\n header={{\n leftItem: <BackButton onPress={onBackPressed} testID={concatTestID(testID, 'header', 'back')} />,\n rightItem: moreInfoHeaderButton,\n static: true,\n title: labels.title,\n }}\n scrollView={{\n style: styles.content,\n }}\n testID={testID}>\n <View style={[styles.section, { backgroundColor: colorScheme.white }]}>\n {data.header && 'entity' in data.header && (\n <EntityDetails\n {...data.header.entity}\n style={[styles.entity, { borderColor: colorScheme.background }, data.header.entity.style]}\n />\n )}\n {data.header && 'credentialHeader' in data.header && (\n <CredentialHeader\n {...data.header.credentialHeader}\n blur={false}\n style={[styles.header, { borderColor: colorScheme.background }, data.header.credentialHeader.style]}\n />\n )}\n <DataItem attribute={labels.data.date} value={data.date} />\n <DataItem\n attribute={labels.data.action}\n last\n testID={data.action.testID}\n value={data.action.label}\n valueColor={data.action.color}\n valueIcon={data.action.icon}\n />\n </View>\n\n {hasAssets && (\n <Typography color={colorScheme.text} preset=\"m\" style={styles.sectionHeader}>\n {labels.relatedAssets}\n </Typography>\n )}\n\n {assets?.header && (\n <TouchableOpacity disabled={!assets.header.onPressed} onPress={assets.header.onPressed}>\n <CredentialHeader\n {...assets.header}\n accessory={assets.header.onPressed ? <NextIcon color={colorScheme.text} /> : undefined}\n blur={false}\n style={[styles.assetsHeader, assets.header.style]}\n />\n </TouchableOpacity>\n )}\n {assets?.cards?.map((props, index, { length }) => {\n if ('credentialDetails' in props) {\n return (\n <View key={props.credentialDetails.credentialId} style={styles.credential}>\n <CredentialDetails\n {...props.credentialDetails}\n expanded={expandedCredential === props.credentialDetails.credentialId}\n labels={labels.credentialCard}\n lastItem={index === length - 1}\n onHeaderPress={onHeaderPress}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n } else {\n const itemProps = {\n ...props.credentialCard,\n card: {\n ...props.credentialCard.card,\n onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress,\n },\n };\n return (\n <View key={index.toString()} style={styles.credential}>\n <CredentialDetailsCardListItem\n {...itemProps}\n expanded={expandedCredential === props.credentialCard.card.credentialId}\n lastItem={index === length - 1}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n }\n })}\n </ScrollViewScreen>\n );\n};\n\nconst styles = StyleSheet.create({\n assetsHeader: {\n borderRadius: 8,\n },\n content: {\n paddingHorizontal: 16,\n paddingTop: 12,\n },\n credential: {\n marginBottom: 4,\n },\n entity: {\n borderBottomWidth: 1,\n paddingBottom: 8,\n },\n header: {\n borderBottomWidth: 1,\n marginTop: -8,\n paddingBottom: 12,\n paddingHorizontal: 0,\n },\n section: {\n borderRadius: 8,\n marginBottom: 12,\n padding: 12,\n },\n sectionHeader: {\n marginHorizontal: 4,\n marginVertical: 16,\n },\n});\n"],"mappings":";AAAA,OAAOA,KAAK,IAAqCC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAClF,SAA0CC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEhF,SAASC,iBAAiB,EAA0BC,aAAa,QAA4B,kBAAkB;AAC/G,SAASC,gBAAgB,QAAQ,4CAA4C;AAC7E,SAAqBC,YAAY,EAAEC,6BAA6B,QAAQ,aAAa;AACrF,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,UAAU,QAAQ,YAAY;AACvC,SACEC,6BAA6B,EAE7BC,gBAAgB,QAEX,eAAe;AACtB,SAASC,QAAQ,QAAQ,UAAU;AACnC,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,OAAOC,QAAQ,MAAM,aAAa;AAgElC,OAAO,MAAMC,kBAA+C,GAAGA,CAAC;EAC9DC,MAAM;EACNC,I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
import HistoryItemView
|
|
1
|
+
import DataItem from './data-item';
|
|
2
|
+
import HistoryItemView from './history-item';
|
|
3
3
|
import HistorySectionHeaderView from './history-section-header';
|
|
4
|
-
import HistorySectionListItem
|
|
4
|
+
import HistorySectionListItem from './history-section-list-item';
|
|
5
5
|
export * from './history-details';
|
|
6
|
-
export { DataItem
|
|
7
|
-
export { HistoryItemView
|
|
6
|
+
export { DataItem };
|
|
7
|
+
export { HistoryItemView };
|
|
8
8
|
export { HistorySectionHeaderView };
|
|
9
|
-
export { HistorySectionListItem
|
|
9
|
+
export { HistorySectionListItem };
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DataItem","
|
|
1
|
+
{"version":3,"names":["DataItem","HistoryItemView","HistorySectionHeaderView","HistorySectionListItem"],"sources":["index.ts"],"sourcesContent":["import type { DataItemProps } from './data-item';\nimport DataItem from './data-item';\nimport type { HistoryItemViewProps } from './history-item';\nimport HistoryItemView from './history-item';\nimport HistorySectionHeaderView from './history-section-header';\nimport type { HistorySectionListItemProps } from './history-section-list-item';\nimport HistorySectionListItem from './history-section-list-item';\n\nexport * from './history-details';\nexport { DataItem, DataItemProps };\nexport { HistoryItemView, HistoryItemViewProps };\nexport { HistorySectionHeaderView };\nexport { HistorySectionListItem, HistorySectionListItemProps };\n"],"mappings":"AACA,OAAOA,QAAQ,MAAM,aAAa;AAElC,OAAOC,eAAe,MAAM,gBAAgB;AAC5C,OAAOC,wBAAwB,MAAM,0BAA0B;AAE/D,OAAOC,sBAAsB,MAAM,6BAA6B;AAEhE,cAAc,mBAAmB;AACjC,SAASH,QAAQ;AACjB,SAASC,eAAe;AACxB,SAASC,wBAAwB;AACjC,SAASC,sBAAsB","ignoreList":[]}
|