@pagopa/io-app-design-system 1.2.0 → 1.3.1

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.
Files changed (161) hide show
  1. package/lib/commonjs/components/accordion/RawAccordion.js.map +1 -1
  2. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  3. package/lib/commonjs/components/avatar/__test__/avatar.test.js.map +1 -1
  4. package/lib/commonjs/components/badge/Badge.js.map +1 -1
  5. package/lib/commonjs/components/banner/Banner.js +1 -1
  6. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  7. package/lib/commonjs/components/banner/__test__/banner.test.js.map +1 -1
  8. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
  9. package/lib/commonjs/components/buttons/ButtonOutline.js +3 -3
  10. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  11. package/lib/commonjs/components/buttons/ButtonSolid.js +3 -3
  12. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  13. package/lib/commonjs/components/contentWrapper/ContentWrapper.js.map +1 -1
  14. package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
  15. package/lib/commonjs/components/listitems/ListItemIDP.js.map +1 -1
  16. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  17. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  18. package/lib/commonjs/components/listitems/PressableListItemsBase.js.map +1 -1
  19. package/lib/commonjs/components/listitems/__test__/listitem.test.js.map +1 -1
  20. package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
  21. package/lib/commonjs/components/pictograms/Pictogram.js +7 -3
  22. package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
  23. package/lib/commonjs/components/pictograms/svg/PictogramFocusOn.js +56 -0
  24. package/lib/commonjs/components/pictograms/svg/PictogramFocusOn.js.map +1 -0
  25. package/lib/commonjs/components/pictograms/svg/originals/PictogramFocusOn.svg +19 -0
  26. package/lib/commonjs/components/spacer/Spacer.js.map +1 -1
  27. package/lib/commonjs/components/typography/Body.js.map +1 -1
  28. package/lib/commonjs/components/typography/Factory.js.map +1 -1
  29. package/lib/commonjs/components/typography/H1.js.map +1 -1
  30. package/lib/commonjs/components/typography/H2.js.map +1 -1
  31. package/lib/commonjs/components/typography/H4.js.map +1 -1
  32. package/lib/commonjs/components/typography/H5.js.map +1 -1
  33. package/lib/commonjs/components/typography/H6.js.map +1 -1
  34. package/lib/commonjs/components/typography/Label.js.map +1 -1
  35. package/lib/commonjs/components/typography/LabelSmall.js.map +1 -1
  36. package/lib/commonjs/components/typography/Monospace.js.map +1 -1
  37. package/lib/commonjs/components/typography/common.js +2 -2
  38. package/lib/commonjs/components/typography/common.js.map +1 -1
  39. package/lib/commonjs/utils/image.js.map +1 -1
  40. package/lib/module/components/accordion/RawAccordion.js.map +1 -1
  41. package/lib/module/components/alert/Alert.js.map +1 -1
  42. package/lib/module/components/avatar/__test__/avatar.test.js.map +1 -1
  43. package/lib/module/components/badge/Badge.js.map +1 -1
  44. package/lib/module/components/banner/Banner.js +1 -1
  45. package/lib/module/components/banner/Banner.js.map +1 -1
  46. package/lib/module/components/banner/__test__/banner.test.js.map +1 -1
  47. package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
  48. package/lib/module/components/buttons/ButtonOutline.js +3 -3
  49. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  50. package/lib/module/components/buttons/ButtonSolid.js +3 -3
  51. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  52. package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
  53. package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
  54. package/lib/module/components/contentWrapper/ContentWrapper.js.map +1 -1
  55. package/lib/module/components/listitems/ListItemAction.js.map +1 -1
  56. package/lib/module/components/listitems/ListItemIDP.js.map +1 -1
  57. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  58. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  59. package/lib/module/components/listitems/PressableListItemsBase.js.map +1 -1
  60. package/lib/module/components/listitems/__test__/listitem.test.js.map +1 -1
  61. package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
  62. package/lib/module/components/pictograms/Pictogram.js +7 -3
  63. package/lib/module/components/pictograms/Pictogram.js.map +1 -1
  64. package/lib/module/components/pictograms/svg/PictogramFocusOn.js +48 -0
  65. package/lib/module/components/pictograms/svg/PictogramFocusOn.js.map +1 -0
  66. package/lib/module/components/pictograms/svg/originals/PictogramFocusOn.svg +19 -0
  67. package/lib/module/components/spacer/Spacer.js.map +1 -1
  68. package/lib/module/components/typography/Body.js.map +1 -1
  69. package/lib/module/components/typography/Factory.js.map +1 -1
  70. package/lib/module/components/typography/H1.js.map +1 -1
  71. package/lib/module/components/typography/H2.js.map +1 -1
  72. package/lib/module/components/typography/H4.js.map +1 -1
  73. package/lib/module/components/typography/H5.js.map +1 -1
  74. package/lib/module/components/typography/H6.js.map +1 -1
  75. package/lib/module/components/typography/Label.js.map +1 -1
  76. package/lib/module/components/typography/LabelSmall.js.map +1 -1
  77. package/lib/module/components/typography/Monospace.js.map +1 -1
  78. package/lib/module/components/typography/common.js +2 -2
  79. package/lib/module/components/typography/common.js.map +1 -1
  80. package/lib/module/utils/image.js.map +1 -1
  81. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  82. package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
  83. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  84. package/lib/typescript/components/buttons/ButtonExtendedOutline.d.ts.map +1 -1
  85. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  86. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  87. package/lib/typescript/components/buttons/IconButtonContained.d.ts.map +1 -1
  88. package/lib/typescript/components/contentWrapper/ContentWrapper.d.ts.map +1 -1
  89. package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
  90. package/lib/typescript/components/listitems/ListItemIDP.d.ts +1 -1
  91. package/lib/typescript/components/listitems/ListItemIDP.d.ts.map +1 -1
  92. package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
  93. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  94. package/lib/typescript/components/listitems/PressableListItemsBase.d.ts.map +1 -1
  95. package/lib/typescript/components/listitems/hooks/useListItemSpringAnimation.d.ts.map +1 -1
  96. package/lib/typescript/components/pictograms/Pictogram.d.ts +2 -0
  97. package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
  98. package/lib/typescript/components/pictograms/svg/PictogramFocusOn.d.ts +5 -0
  99. package/lib/typescript/components/pictograms/svg/PictogramFocusOn.d.ts.map +1 -0
  100. package/lib/typescript/components/spacer/Spacer.d.ts.map +1 -1
  101. package/lib/typescript/components/typography/Body.d.ts.map +1 -1
  102. package/lib/typescript/components/typography/Factory.d.ts.map +1 -1
  103. package/lib/typescript/components/typography/H1.d.ts.map +1 -1
  104. package/lib/typescript/components/typography/H2.d.ts.map +1 -1
  105. package/lib/typescript/components/typography/H4.d.ts.map +1 -1
  106. package/lib/typescript/components/typography/H5.d.ts.map +1 -1
  107. package/lib/typescript/components/typography/H6.d.ts.map +1 -1
  108. package/lib/typescript/components/typography/Label.d.ts.map +1 -1
  109. package/lib/typescript/components/typography/LabelSmall.d.ts.map +1 -1
  110. package/lib/typescript/components/typography/Monospace.d.ts.map +1 -1
  111. package/lib/typescript/components/typography/common.d.ts +2 -2
  112. package/lib/typescript/components/typography/common.d.ts.map +1 -1
  113. package/lib/typescript/utils/image.d.ts.map +1 -1
  114. package/package.json +3 -2
  115. package/src/components/Advice/index.tsx +1 -1
  116. package/src/components/accordion/RawAccordion.tsx +3 -3
  117. package/src/components/alert/Alert.tsx +4 -1
  118. package/src/components/avatar/Avatar.tsx +1 -1
  119. package/src/components/avatar/__test__/avatar.test.tsx +7 -4
  120. package/src/components/avatar/index.tsx +1 -1
  121. package/src/components/badge/Badge.tsx +16 -11
  122. package/src/components/banner/Banner.tsx +206 -195
  123. package/src/components/banner/__test__/banner.test.tsx +11 -9
  124. package/src/components/banner/index.tsx +1 -1
  125. package/src/components/buttons/ButtonExtendedOutline.tsx +80 -80
  126. package/src/components/buttons/ButtonOutline.tsx +278 -280
  127. package/src/components/buttons/ButtonSolid.tsx +142 -141
  128. package/src/components/buttons/IconButtonContained.tsx +17 -17
  129. package/src/components/buttons/IconButtonSolid.tsx +11 -11
  130. package/src/components/contentWrapper/ContentWrapper.tsx +12 -12
  131. package/src/components/contentWrapper/index.tsx +1 -1
  132. package/src/components/divider/index.tsx +1 -1
  133. package/src/components/icons/index.tsx +1 -1
  134. package/src/components/listitems/ListItemAction.tsx +120 -119
  135. package/src/components/listitems/ListItemIDP.tsx +115 -115
  136. package/src/components/listitems/ListItemNavAlert.tsx +114 -110
  137. package/src/components/listitems/ListItemTransaction.tsx +2 -6
  138. package/src/components/listitems/PressableListItemsBase.tsx +29 -29
  139. package/src/components/listitems/__test__/listitem.test.tsx +53 -15
  140. package/src/components/listitems/hooks/useListItemSpringAnimation.ts +54 -52
  141. package/src/components/pictograms/Pictogram.tsx +6 -3
  142. package/src/components/pictograms/svg/PictogramFocusOn.tsx +39 -0
  143. package/src/components/pictograms/svg/originals/PictogramFocusOn.svg +19 -0
  144. package/src/components/spacer/Spacer.tsx +21 -18
  145. package/src/components/spacer/index.tsx +1 -1
  146. package/src/components/typography/Body.tsx +10 -10
  147. package/src/components/typography/Factory.tsx +38 -38
  148. package/src/components/typography/H1.tsx +19 -19
  149. package/src/components/typography/H2.tsx +19 -19
  150. package/src/components/typography/H4.tsx +12 -12
  151. package/src/components/typography/H5.tsx +24 -24
  152. package/src/components/typography/H6.tsx +10 -10
  153. package/src/components/typography/Label.tsx +16 -16
  154. package/src/components/typography/LabelSmall.tsx +27 -28
  155. package/src/components/typography/Monospace.tsx +14 -14
  156. package/src/components/typography/common.tsx +20 -20
  157. package/src/components/typography/index.tsx +0 -1
  158. package/src/index.tsx +0 -1
  159. package/src/json-import.d.ts +3 -4
  160. package/src/utils/dates.ts +1 -1
  161. package/src/utils/image.ts +22 -22
@@ -1,136 +1,140 @@
1
1
  import React, { useCallback } from "react";
2
- import {
3
- GestureResponderEvent,
4
- Pressable,
5
- View
6
- } from "react-native";
2
+ import { GestureResponderEvent, Pressable, View } from "react-native";
7
3
  import Animated, {
8
- Extrapolate,
9
- interpolate,
10
- interpolateColor,
11
- useAnimatedStyle,
12
- useDerivedValue,
13
- useSharedValue,
14
- withSpring
4
+ Extrapolate,
5
+ interpolate,
6
+ interpolateColor,
7
+ useAnimatedStyle,
8
+ useDerivedValue,
9
+ useSharedValue,
10
+ withSpring
15
11
  } from "react-native-reanimated";
16
- import { IOColors, IOListItemStyles, IOListItemVisualParams, IOScaleValues, IOSpringValues, IOStyles, hexToRgba, useIOTheme } from "../../core";
12
+ import {
13
+ IOColors,
14
+ IOListItemStyles,
15
+ IOListItemVisualParams,
16
+ IOScaleValues,
17
+ IOSpringValues,
18
+ IOStyles,
19
+ hexToRgba,
20
+ useIOTheme
21
+ } from "../../core";
17
22
  import { WithTestID } from "../../utils/types";
18
23
  import { Icon } from "../icons";
19
24
  import { H6, LabelSmall } from "../typography";
20
25
 
21
26
  export type ListItemNavAlert = WithTestID<{
22
- value: string;
23
- description?: string;
24
- withoutIcon?: boolean;
25
- onPress: (event: GestureResponderEvent) => void;
26
- // Accessibility
27
- accessibilityLabel: string;
27
+ value: string;
28
+ description?: string;
29
+ withoutIcon?: boolean;
30
+ onPress: (event: GestureResponderEvent) => void;
31
+ // Accessibility
32
+ accessibilityLabel: string;
28
33
  }>;
29
34
 
30
35
  export const ListItemNavAlert = ({
31
- value,
32
- description,
33
- withoutIcon = false,
34
- onPress,
35
- accessibilityLabel,
36
- testID
36
+ value,
37
+ description,
38
+ withoutIcon = false,
39
+ onPress,
40
+ accessibilityLabel,
41
+ testID
37
42
  }: ListItemNavAlert) => {
38
- const isPressed: Animated.SharedValue<number> = useSharedValue(0);
43
+ const isPressed: Animated.SharedValue<number> = useSharedValue(0);
39
44
 
40
- const theme = useIOTheme();
45
+ const theme = useIOTheme();
41
46
 
42
- const mapBackgroundStates: Record<string, string> = {
43
- default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
44
- pressed: IOColors[theme["listItem-pressed"]]
45
- };
47
+ const mapBackgroundStates: Record<string, string> = {
48
+ default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
49
+ pressed: IOColors[theme["listItem-pressed"]]
50
+ };
46
51
 
47
- // Scaling transformation applied when the button is pressed
48
- const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
49
-
50
- const progressPressed = useDerivedValue(() =>
51
- withSpring(isPressed.value, IOSpringValues.button)
52
- );
52
+ // Scaling transformation applied when the button is pressed
53
+ const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
53
54
 
54
- // Interpolate animation values from `isPressed` values
55
- const animatedScaleStyle = useAnimatedStyle(() => {
56
- const scale = interpolate(
57
- progressPressed.value,
58
- [0, 1],
59
- [1, animationScaleValue],
60
- Extrapolate.CLAMP
61
- );
55
+ const progressPressed = useDerivedValue(() =>
56
+ withSpring(isPressed.value, IOSpringValues.button)
57
+ );
62
58
 
63
- return {
64
- transform: [{ scale }]
65
- };
66
- });
59
+ // Interpolate animation values from `isPressed` values
60
+ const animatedScaleStyle = useAnimatedStyle(() => {
61
+ const scale = interpolate(
62
+ progressPressed.value,
63
+ [0, 1],
64
+ [1, animationScaleValue],
65
+ Extrapolate.CLAMP
66
+ );
67
67
 
68
- const animatedBackgroundStyle = useAnimatedStyle(() => {
69
- const backgroundColor = interpolateColor(
70
- progressPressed.value,
71
- [0, 1],
72
- [mapBackgroundStates.default, mapBackgroundStates.pressed]
73
- );
68
+ return {
69
+ transform: [{ scale }]
70
+ };
71
+ });
74
72
 
75
- return {
76
- backgroundColor
77
- };
78
- });
73
+ const animatedBackgroundStyle = useAnimatedStyle(() => {
74
+ const backgroundColor = interpolateColor(
75
+ progressPressed.value,
76
+ [0, 1],
77
+ [mapBackgroundStates.default, mapBackgroundStates.pressed]
78
+ );
79
79
 
80
- const handlePressIn = useCallback(() => {
81
- // eslint-disable-next-line functional/immutable-data
82
- isPressed.value = 1;
83
- }, [isPressed]);
84
- const handlePressOut = useCallback(() => {
85
- // eslint-disable-next-line functional/immutable-data
86
- isPressed.value = 0;
87
- }, [isPressed]);
80
+ return {
81
+ backgroundColor
82
+ };
83
+ });
88
84
 
85
+ const handlePressIn = useCallback(() => {
86
+ // eslint-disable-next-line functional/immutable-data
87
+ isPressed.value = 1;
88
+ }, [isPressed]);
89
+ const handlePressOut = useCallback(() => {
90
+ // eslint-disable-next-line functional/immutable-data
91
+ isPressed.value = 0;
92
+ }, [isPressed]);
89
93
 
90
- return (
91
- <Pressable
92
- onPress={onPress}
93
- onPressIn={handlePressIn}
94
- onPressOut={handlePressOut}
95
- accessible={true}
96
- accessibilityLabel={accessibilityLabel}
97
- accessibilityRole="button"
98
- testID={testID}
94
+ return (
95
+ <Pressable
96
+ onPress={onPress}
97
+ onPressIn={handlePressIn}
98
+ onPressOut={handlePressOut}
99
+ accessible={true}
100
+ accessibilityLabel={accessibilityLabel}
101
+ accessibilityRole="button"
102
+ testID={testID}
103
+ >
104
+ <Animated.View
105
+ style={[IOListItemStyles.listItem, animatedBackgroundStyle]}
106
+ >
107
+ <Animated.View
108
+ style={[IOListItemStyles.listItemInner, animatedScaleStyle]}
99
109
  >
100
- <Animated.View
101
- style={[IOListItemStyles.listItem, animatedBackgroundStyle]}
102
- >
103
- <Animated.View
104
- style={[IOListItemStyles.listItemInner, animatedScaleStyle]}
105
- >
106
- {!withoutIcon && (
107
- <View style={{ marginRight: IOListItemVisualParams.iconMargin }}>
108
- <Icon
109
- name="errorFilled"
110
- color={theme.errorIcon}
111
- size={IOListItemVisualParams.iconSize}
112
- />
113
- </View>
114
- )}
115
- <View style={IOStyles.flex}>
116
- <H6 color={theme["textBody-default"]}>{value}</H6>
117
- {description && (
118
- <LabelSmall weight="SemiBold" color={theme.errorText}>
119
- {description}
120
- </LabelSmall>
121
- )}
122
- </View>
123
- <View style={{ marginLeft: IOListItemVisualParams.iconMargin }}>
124
- <Icon
125
- name="chevronRightListItem"
126
- color={theme["interactiveElem-default"]}
127
- size={IOListItemVisualParams.chevronSize}
128
- />
129
- </View>
130
- </Animated.View>
131
- </Animated.View>
132
- </Pressable>
133
- );
110
+ {!withoutIcon && (
111
+ <View style={{ marginRight: IOListItemVisualParams.iconMargin }}>
112
+ <Icon
113
+ name="errorFilled"
114
+ color={theme.errorIcon}
115
+ size={IOListItemVisualParams.iconSize}
116
+ />
117
+ </View>
118
+ )}
119
+ <View style={IOStyles.flex}>
120
+ <H6 color={theme["textBody-default"]}>{value}</H6>
121
+ {description && (
122
+ <LabelSmall weight="SemiBold" color={theme.errorText}>
123
+ {description}
124
+ </LabelSmall>
125
+ )}
126
+ </View>
127
+ <View style={{ marginLeft: IOListItemVisualParams.iconMargin }}>
128
+ <Icon
129
+ name="chevronRightListItem"
130
+ color={theme["interactiveElem-default"]}
131
+ size={IOListItemVisualParams.chevronSize}
132
+ />
133
+ </View>
134
+ </Animated.View>
135
+ </Animated.View>
136
+ </Pressable>
137
+ );
134
138
  };
135
139
 
136
140
  export default ListItemNavAlert;
@@ -101,13 +101,9 @@ export const ListItemTransaction = ({
101
101
  );
102
102
 
103
103
  case "failure":
104
- return (
105
- <Badge variant="error" text={"Failed"} />
106
- );
104
+ return <Badge variant="error" text={"Failed"} />;
107
105
  case "pending":
108
- return (
109
- <Badge variant="info" text={"Cancelled"} />
110
- );
106
+ return <Badge variant="info" text={"Cancelled"} />;
111
107
  }
112
108
  };
113
109
 
@@ -6,37 +6,37 @@ import { WithTestID } from "../../utils/types";
6
6
  import { useListItemSpringAnimation } from "./hooks/useListItemSpringAnimation";
7
7
 
8
8
  export type PressableBaseProps = WithTestID<{
9
- accessibilityLabel?: string;
10
- onPress?: () => void;
9
+ accessibilityLabel?: string;
10
+ onPress?: () => void;
11
11
  }>;
12
12
  export const PressableListItemBase = ({
13
- onPress,
14
- testID,
15
- accessibilityLabel,
16
- children
13
+ onPress,
14
+ testID,
15
+ accessibilityLabel,
16
+ children
17
17
  }: React.PropsWithChildren<PressableBaseProps>) => {
18
- const { onPressIn, onPressOut, animatedScaleStyle, animatedBackgroundStyle } =
19
- useListItemSpringAnimation();
20
- return (
21
- <Pressable
22
- onPress={onPress}
23
- testID={testID}
24
- accessible={true}
25
- accessibilityLabel={accessibilityLabel}
26
- onPressIn={onPressIn}
27
- onPressOut={onPressOut}
28
- onTouchEnd={onPressOut}
29
- accessibilityRole="button"
18
+ const { onPressIn, onPressOut, animatedScaleStyle, animatedBackgroundStyle } =
19
+ useListItemSpringAnimation();
20
+ return (
21
+ <Pressable
22
+ onPress={onPress}
23
+ testID={testID}
24
+ accessible={true}
25
+ accessibilityLabel={accessibilityLabel}
26
+ onPressIn={onPressIn}
27
+ onPressOut={onPressOut}
28
+ onTouchEnd={onPressOut}
29
+ accessibilityRole="button"
30
+ >
31
+ <Animated.View
32
+ style={[IOListItemStyles.listItem, animatedBackgroundStyle]}
33
+ >
34
+ <Animated.View
35
+ style={[IOListItemStyles.listItemInner, animatedScaleStyle]}
30
36
  >
31
- <Animated.View
32
- style={[IOListItemStyles.listItem, animatedBackgroundStyle]}
33
- >
34
- <Animated.View
35
- style={[IOListItemStyles.listItemInner, animatedScaleStyle]}
36
- >
37
- {children}
38
- </Animated.View>
39
- </Animated.View>
40
- </Pressable>
41
- );
37
+ {children}
38
+ </Animated.View>
39
+ </Animated.View>
40
+ </Pressable>
41
+ );
42
42
  };
@@ -16,42 +16,80 @@ const onButtonPress = () => {
16
16
 
17
17
  describe("Test List Item Components", () => {
18
18
  it("ListItemInfo Snapshot", () => {
19
- const listItemInfo = TestRenderer.create(<ListItemInfo label={"label"} value={"testValue"} accessibilityLabel={"accessibilityLabel"}></ListItemInfo>).toJSON();
19
+ const listItemInfo = TestRenderer.create(
20
+ <ListItemInfo
21
+ label={"label"}
22
+ value={"testValue"}
23
+ accessibilityLabel={"accessibilityLabel"}
24
+ ></ListItemInfo>
25
+ ).toJSON();
20
26
  expect(listItemInfo).toMatchSnapshot();
21
27
  });
22
28
  it("ListItemInfoCopy Snapshot", () => {
23
- const listItemInfoCopy = TestRenderer.create(<ListItemInfoCopy label={"label"} value={"testValue"} onPress={onButtonPress} accessibilityLabel={"accessibilityLabel"}></ListItemInfoCopy>).toJSON();
29
+ const listItemInfoCopy = TestRenderer.create(
30
+ <ListItemInfoCopy
31
+ label={"label"}
32
+ value={"testValue"}
33
+ onPress={onButtonPress}
34
+ accessibilityLabel={"accessibilityLabel"}
35
+ ></ListItemInfoCopy>
36
+ ).toJSON();
24
37
  expect(listItemInfoCopy).toMatchSnapshot();
25
38
  });
26
39
  it("ListItemNav Snapshot", () => {
27
- const listItemNav = TestRenderer.create(<ListItemNav value={"testValue"} onPress={onButtonPress} accessibilityLabel={"accessibilityLabel"} ></ListItemNav>).toJSON();
40
+ const listItemNav = TestRenderer.create(
41
+ <ListItemNav
42
+ value={"testValue"}
43
+ onPress={onButtonPress}
44
+ accessibilityLabel={"accessibilityLabel"}
45
+ ></ListItemNav>
46
+ ).toJSON();
28
47
  expect(listItemNav).toMatchSnapshot();
29
48
  });
30
49
  it("ListItemNavAlert Snapshot", () => {
31
- const listItemNavAlert = TestRenderer.create(<ListItemNavAlert value={"testValue"} onPress={onButtonPress} accessibilityLabel={"accessibilityLabel"} ></ListItemNavAlert>).toJSON();
50
+ const listItemNavAlert = TestRenderer.create(
51
+ <ListItemNavAlert
52
+ value={"testValue"}
53
+ onPress={onButtonPress}
54
+ accessibilityLabel={"accessibilityLabel"}
55
+ ></ListItemNavAlert>
56
+ ).toJSON();
32
57
  expect(listItemNavAlert).toMatchSnapshot();
33
58
  });
34
59
  it("ListItemAction Snapshot", () => {
35
- const listItemAction = TestRenderer.create(<ListItemAction label={"label"} variant={"primary"} onPress={onButtonPress} accessibilityLabel={"accessibilityLabel"}></ListItemAction>).toJSON();
60
+ const listItemAction = TestRenderer.create(
61
+ <ListItemAction
62
+ label={"label"}
63
+ variant={"primary"}
64
+ onPress={onButtonPress}
65
+ accessibilityLabel={"accessibilityLabel"}
66
+ ></ListItemAction>
67
+ ).toJSON();
36
68
  expect(listItemAction).toMatchSnapshot();
37
69
  });
38
70
  it("ListItemIDP Snapshot", () => {
39
- const listItemIDP = TestRenderer.create(<ListItemIDP></ListItemIDP>).toJSON();
71
+ const listItemIDP = TestRenderer.create(
72
+ <ListItemIDP></ListItemIDP>
73
+ ).toJSON();
40
74
  expect(listItemIDP).toMatchSnapshot();
41
75
  });
42
76
  it("ListItemTransaction Snapshot", () => {
43
- const listItemIDP = TestRenderer.create(<ListItemTransaction
44
- title="TITLE"
45
- subtitle="subtitle"
46
- transactionStatus="success"
47
- transactionAmount="€ 1.000,00"
48
- isLoading={true}
49
- onPress={onButtonPress}
50
- />).toJSON();
77
+ const listItemIDP = TestRenderer.create(
78
+ <ListItemTransaction
79
+ title="TITLE"
80
+ subtitle="subtitle"
81
+ transactionStatus="success"
82
+ transactionAmount="€ 1.000,00"
83
+ isLoading={true}
84
+ onPress={onButtonPress}
85
+ />
86
+ ).toJSON();
51
87
  expect(listItemIDP).toMatchSnapshot();
52
88
  });
53
89
  it("PressableListItemsBase Snapshot", () => {
54
- const listItemIDP = TestRenderer.create(<PressableListItemBase></PressableListItemBase>).toJSON();
90
+ const listItemIDP = TestRenderer.create(
91
+ <PressableListItemBase></PressableListItemBase>
92
+ ).toJSON();
55
93
  expect(listItemIDP).toMatchSnapshot();
56
94
  });
57
95
  });
@@ -1,70 +1,72 @@
1
1
  import * as React from "react";
2
2
  import Animated, {
3
- Extrapolate,
4
- interpolate,
5
- interpolateColor,
6
- useAnimatedStyle,
7
- useDerivedValue,
8
- useSharedValue,
9
- withSpring
3
+ Extrapolate,
4
+ interpolate,
5
+ interpolateColor,
6
+ useAnimatedStyle,
7
+ useDerivedValue,
8
+ useSharedValue,
9
+ withSpring
10
10
  } from "react-native-reanimated";
11
11
  import {
12
- IOColors,
13
- IOScaleValues, IOSpringValues,
14
- hexToRgba, useIOTheme
12
+ IOColors,
13
+ IOScaleValues,
14
+ IOSpringValues,
15
+ hexToRgba,
16
+ useIOTheme
15
17
  } from "../../../core";
16
18
 
17
19
  export const useListItemSpringAnimation = () => {
18
- const theme = useIOTheme();
20
+ const theme = useIOTheme();
19
21
 
20
- const isPressed: Animated.SharedValue<number> = useSharedValue(0);
22
+ const isPressed: Animated.SharedValue<number> = useSharedValue(0);
21
23
 
22
- const mapBackgroundStates: Record<string, string> = {
23
- default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
24
- pressed: IOColors[theme["listItem-pressed"]]
25
- };
24
+ const mapBackgroundStates: Record<string, string> = {
25
+ default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
26
+ pressed: IOColors[theme["listItem-pressed"]]
27
+ };
26
28
 
27
- // Scaling transformation applied when the button is pressed
28
- const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
29
+ // Scaling transformation applied when the button is pressed
30
+ const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
29
31
 
30
- const progressPressed = useDerivedValue(() =>
31
- withSpring(isPressed.value, IOSpringValues.button)
32
- );
32
+ const progressPressed = useDerivedValue(() =>
33
+ withSpring(isPressed.value, IOSpringValues.button)
34
+ );
33
35
 
34
- // Interpolate animation values from `isPressed` values
35
- const animatedScaleStyle = useAnimatedStyle(() => {
36
- const scale = interpolate(
37
- progressPressed.value,
38
- [0, 1],
39
- [1, animationScaleValue],
40
- Extrapolate.CLAMP
41
- );
36
+ // Interpolate animation values from `isPressed` values
37
+ const animatedScaleStyle = useAnimatedStyle(() => {
38
+ const scale = interpolate(
39
+ progressPressed.value,
40
+ [0, 1],
41
+ [1, animationScaleValue],
42
+ Extrapolate.CLAMP
43
+ );
42
44
 
43
- return {
44
- transform: [{ scale }]
45
- };
46
- });
45
+ return {
46
+ transform: [{ scale }]
47
+ };
48
+ });
47
49
 
48
- const animatedBackgroundStyle = useAnimatedStyle(() => {
49
- const backgroundColor = interpolateColor(
50
- progressPressed.value,
51
- [0, 1],
52
- [mapBackgroundStates.default, mapBackgroundStates.pressed]
53
- );
50
+ const animatedBackgroundStyle = useAnimatedStyle(() => {
51
+ const backgroundColor = interpolateColor(
52
+ progressPressed.value,
53
+ [0, 1],
54
+ [mapBackgroundStates.default, mapBackgroundStates.pressed]
55
+ );
54
56
 
55
- return {
56
- backgroundColor
57
- };
58
- });
57
+ return {
58
+ backgroundColor
59
+ };
60
+ });
59
61
 
60
- const onPressIn = React.useCallback(() => {
61
- // eslint-disable-next-line functional/immutable-data
62
- isPressed.value = 1;
63
- }, [isPressed]);
64
- const onPressOut = React.useCallback(() => {
65
- // eslint-disable-next-line functional/immutable-data
66
- isPressed.value = 0;
67
- }, [isPressed]);
62
+ const onPressIn = React.useCallback(() => {
63
+ // eslint-disable-next-line functional/immutable-data
64
+ isPressed.value = 1;
65
+ }, [isPressed]);
66
+ const onPressOut = React.useCallback(() => {
67
+ // eslint-disable-next-line functional/immutable-data
68
+ isPressed.value = 0;
69
+ }, [isPressed]);
68
70
 
69
- return { onPressIn, onPressOut, animatedScaleStyle, animatedBackgroundStyle };
71
+ return { onPressIn, onPressOut, animatedScaleStyle, animatedBackgroundStyle };
70
72
  };
@@ -41,6 +41,7 @@ import PictogramUmbrellaNew from "./svg/PictogramUmbrellaNew";
41
41
  import PictogramUnrecognized from "./svg/PictogramUnrecognized";
42
42
  import PictogramUploadFile from "./svg/PictogramUploadFile";
43
43
  import PictogramSuccess from "./svg/PictogramSuccess";
44
+ import PictogramFocusOn from "./svg/PictogramFocusOn";
44
45
 
45
46
  export const IOPictograms = {
46
47
  airBaloon: PictogramAirBaloon,
@@ -81,7 +82,8 @@ export const IOPictograms = {
81
82
  umbrellaNew: PictogramUmbrellaNew,
82
83
  feedback: PictogramFeedback,
83
84
  cameraRequest: PictogramCameraRequest,
84
- success: PictogramSuccess
85
+ success: PictogramSuccess,
86
+ focusOn: PictogramFocusOn
85
87
  };
86
88
 
87
89
  export type IOPictograms = keyof typeof IOPictograms;
@@ -115,11 +117,12 @@ export const Pictogram = ({
115
117
  /* Bleed pictograms
116
118
  Used in the <Banner /> component
117
119
  */
118
- const { donation, feedback } = IOPictograms;
120
+ const { donation, feedback, focusOn } = IOPictograms;
119
121
 
120
122
  const IOPictogramsBleed = {
121
123
  donation,
122
- feedback
124
+ feedback,
125
+ focusOn
123
126
  } as const;
124
127
 
125
128
  export type IOPictogramsBleed = keyof typeof IOPictogramsBleed;
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { Svg, Path, G, Defs } from "react-native-svg";
3
+ import { SVGPictogramProps } from "../Pictogram";
4
+
5
+ const PictogramFocusOn = ({ size, color, ...props }: SVGPictogramProps) => (
6
+ <Svg fill="none" width={size} height={size} viewBox="0 0 80 80" {...props}>
7
+ <G clip-path="url(#a)">
8
+ <Path
9
+ fill="#AAEEEF"
10
+ fill-rule="evenodd"
11
+ d="M37.0385 36.6024c2.6444-3.4677 4.2148-7.7986 4.2148-12.4963 0-11.3918-9.2348-20.62667-20.6266-20.62667C9.23488 3.47943 0 12.7143 0 24.1061s9.23488 20.6267 20.6267 20.6267c4.4277 0 8.5295-1.3951 11.89-3.7697l-1.5767-.6757-.7113-1.4226V37.798l1.6004-.8891 5.2094-.3065Z"
12
+ clip-rule="evenodd"
13
+ />
14
+ <Path
15
+ fill="#00C5CA"
16
+ d="M20.5295 29.5c-.3443 0-.6293-.2724-.651-.6222l-.1207-1.9419c-.0817-1.313.7858-2.4577 1.9653-2.995.1316-.0599.2599-.1217.3849-.1853.7403-.3871 1.3506-.825 1.8308-1.3139.4801-.4889.8303-1.0389 1.0504-1.65.2401-.6111.3601-1.263.3601-1.9556 0-.7741-.1801-1.487-.5402-2.1389-.3601-.6518-.8904-1.1815-1.5906-1.5889-.6803-.4074-1.4906-.6111-2.431-.6111-.7203 0-1.4105.1426-2.0708.4278-.6403.2648-1.2305.6824-1.7707 1.2528-.3548.389-.6724.8538-.9527 1.3945-.2058.3968-.7123.5401-1.0638.2693-.244-.188-.3347-.5216-.2013-.802.3663-.7697.8154-1.4338 1.3475-1.9924.6402-.6722 1.3605-1.1815 2.1608-1.5278.8203-.3463 1.6907-.5194 2.611-.5194 1.2005 0 2.2609.2648 3.1813.7944.9404.5093 1.6706 1.2019 2.1909 2.0778.5202.8759.7803 1.8537.7803 2.9334 0 1.0388-.2401 2.0064-.7203 2.9027-.4602.876-1.1105 1.65-1.9508 2.3223-.4332.336-.9062.6314-1.4191.8862-.8979.4461-1.5879 1.2888-1.6416 2.3045l-.0873 1.6503c-.0186.3524-.3048.6284-.6514.6284Zm-1.1826 4.125c0-.4278.1101-.7741.3302-1.0389.2201-.2648.5202-.3972.9003-.3972.4002 0 .7003.1222.9004.3667.2201.2444.3301.6009.3301 1.0694 0 .387-.11.713-.3301.9778-.2201.2648-.5202.3972-.9004.3972-.4001 0-.7103-.1222-.9303-.3667-.2001-.2444-.3002-.5805-.3002-1.0083Z"
17
+ />
18
+ <G fill="#0B3EE3" clip-path="url(#b)">
19
+ <Path d="M57.8921 36.9438c.0571.1885.4071.7038.5898.7809 2.0276 2.5853 9.2849 6.7823 22.9454 4.3214v-1.6532c-9.4293 2.1222-15.7294.5002-19.2706-1.5552-2.2284-1.2935-3.3109-3.7543-4.2552-6.1516-1.3778-3.4978-3.5629-7.8791-5.8681-8.0139-.5196-.0371-1.5274.1142-2.1613 1.459-1.1106 2.3441-.6024 7.4292.8109 10.2245-3.7688-.2599-14.2127-.8937-18.4212-.2713-2.581.3798-2.6324 1.8559-2.5867 2.2984.3112 3.0265 6.2584 4.6512 11.015 4.6826-.4796.9907-.9308 2.4925-.2455 3.903.9878 2.0301 3.9743 3.0751 8.8765 3.1036h.0342c1.3591 0 2.5754-.4483 3.4376-1.262 1.0535-.9993 1.1934-2.2356.3826-3.392-.8908-1.2705-2.4554-2.0014-4.1342-1.9615-1.3105.0314-2.6124.3398-3.8715.9108l.5567 1.2249c1.0907-.4968 2.2184-.7623 3.3462-.7909 1.2648-.0342 2.3669.4883 2.9979 1.3876.4282.6082.3654 1.0993-.2056 1.6418-.6082.5739-1.4989.8908-2.5097.8908h-.0285c-5.4076-.0314-7.1549-1.2905-7.6688-2.3413-.768-1.5732.7566-3.5889.7737-3.6089.1599-.2085.1827-.4911.06-.7252-.1228-.2313-.3712-.3712-.6339-.3569-6.8779.3911-10.718-2.2328-10.8436-3.4406-.0457-.4482.7166-.7223 1.4446-.8308 4.9194-.7252 19.3377.3683 19.4833.3797.294.0286.5367-.1285.6566-.3769.12-.2512.0771-.5482-.1113-.7509-1.6246-1.7588-2.4611-7.7176-1.399-9.9617.336-.7117.7084-.6971.8601-.6912l.005.0002c1.8672.1085 4.5967 6.4556 5.9386 10.9268Z" />
20
+ <Path d="M48.1249 55.006c-.7652 0-1.5875-.0343-2.4697-.0999-2.1556-.1656-3.5146-.8623-4.0457-2.0758-.8993-2.0614 1.0593-4.6197 1.2848-4.9052l1.0536.8366c-.474.5996-1.5989 2.4041-1.1078 3.5319.394.8965 1.8015 1.1849 2.9122 1.2705 3.98.3055 6.6381-.1028 7.9229-1.2049.5425-.4654.8337-1.0621.8908-1.8216l1.3419.0999c-.0828 1.1164-.5396 2.0387-1.3562 2.741-1.2677 1.0907-3.3833 1.6275-6.4325 1.6275h.0057Z" />
21
+ <Path d="M80.8936 54.09c-11.9529 4.5537-21.8188.2965-26.3249-1.6009l-.8894 1.0673c10.6723 5.5142 21.2853 4.1505 27.2143 2.1345V54.09Z" />
22
+ </G>
23
+ </G>
24
+ <Defs>
25
+ <clipPath id="a">
26
+ <Path fill="#fff" d="M0 0h80v80H0z" />
27
+ </clipPath>
28
+ <clipPath id="b">
29
+ <Path
30
+ fill="#fff"
31
+ d="M0 0h52v44.6667H0z"
32
+ transform="translate(29.6666 24.6667)"
33
+ />
34
+ </clipPath>
35
+ </Defs>
36
+ </Svg>
37
+ );
38
+
39
+ export default PictogramFocusOn;
@@ -0,0 +1,19 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 80 80">
2
+ <g clip-path="url(#a)">
3
+ <path fill="#AAEEEF" fill-rule="evenodd" d="M37.0385 36.6024c2.6444-3.4677 4.2148-7.7986 4.2148-12.4963 0-11.3918-9.2348-20.62667-20.6266-20.62667C9.23488 3.47943 0 12.7143 0 24.1061s9.23488 20.6267 20.6267 20.6267c4.4277 0 8.5295-1.3951 11.89-3.7697l-1.5767-.6757-.7113-1.4226V37.798l1.6004-.8891 5.2094-.3065Z" clip-rule="evenodd"/>
4
+ <path fill="#00C5CA" d="M20.5295 29.5c-.3443 0-.6293-.2724-.651-.6222l-.1207-1.9419c-.0817-1.313.7858-2.4577 1.9653-2.995.1316-.0599.2599-.1217.3849-.1853.7403-.3871 1.3506-.825 1.8308-1.3139.4801-.4889.8303-1.0389 1.0504-1.65.2401-.6111.3601-1.263.3601-1.9556 0-.7741-.1801-1.487-.5402-2.1389-.3601-.6518-.8904-1.1815-1.5906-1.5889-.6803-.4074-1.4906-.6111-2.431-.6111-.7203 0-1.4105.1426-2.0708.4278-.6403.2648-1.2305.6824-1.7707 1.2528-.3548.389-.6724.8538-.9527 1.3945-.2058.3968-.7123.5401-1.0638.2693-.244-.188-.3347-.5216-.2013-.802.3663-.7697.8154-1.4338 1.3475-1.9924.6402-.6722 1.3605-1.1815 2.1608-1.5278.8203-.3463 1.6907-.5194 2.611-.5194 1.2005 0 2.2609.2648 3.1813.7944.9404.5093 1.6706 1.2019 2.1909 2.0778.5202.8759.7803 1.8537.7803 2.9334 0 1.0388-.2401 2.0064-.7203 2.9027-.4602.876-1.1105 1.65-1.9508 2.3223-.4332.336-.9062.6314-1.4191.8862-.8979.4461-1.5879 1.2888-1.6416 2.3045l-.0873 1.6503c-.0186.3524-.3048.6284-.6514.6284Zm-1.1826 4.125c0-.4278.1101-.7741.3302-1.0389.2201-.2648.5202-.3972.9003-.3972.4002 0 .7003.1222.9004.3667.2201.2444.3301.6009.3301 1.0694 0 .387-.11.713-.3301.9778-.2201.2648-.5202.3972-.9004.3972-.4001 0-.7103-.1222-.9303-.3667-.2001-.2444-.3002-.5805-.3002-1.0083Z"/>
5
+ <g fill="#0B3EE3" clip-path="url(#b)">
6
+ <path d="M57.8921 36.9438c.0571.1885.4071.7038.5898.7809 2.0276 2.5853 9.2849 6.7823 22.9454 4.3214v-1.6532c-9.4293 2.1222-15.7294.5002-19.2706-1.5552-2.2284-1.2935-3.3109-3.7543-4.2552-6.1516-1.3778-3.4978-3.5629-7.8791-5.8681-8.0139-.5196-.0371-1.5274.1142-2.1613 1.459-1.1106 2.3441-.6024 7.4292.8109 10.2245-3.7688-.2599-14.2127-.8937-18.4212-.2713-2.581.3798-2.6324 1.8559-2.5867 2.2984.3112 3.0265 6.2584 4.6512 11.015 4.6826-.4796.9907-.9308 2.4925-.2455 3.903.9878 2.0301 3.9743 3.0751 8.8765 3.1036h.0342c1.3591 0 2.5754-.4483 3.4376-1.262 1.0535-.9993 1.1934-2.2356.3826-3.392-.8908-1.2705-2.4554-2.0014-4.1342-1.9615-1.3105.0314-2.6124.3398-3.8715.9108l.5567 1.2249c1.0907-.4968 2.2184-.7623 3.3462-.7909 1.2648-.0342 2.3669.4883 2.9979 1.3876.4282.6082.3654 1.0993-.2056 1.6418-.6082.5739-1.4989.8908-2.5097.8908h-.0285c-5.4076-.0314-7.1549-1.2905-7.6688-2.3413-.768-1.5732.7566-3.5889.7737-3.6089.1599-.2085.1827-.4911.06-.7252-.1228-.2313-.3712-.3712-.6339-.3569-6.8779.3911-10.718-2.2328-10.8436-3.4406-.0457-.4482.7166-.7223 1.4446-.8308 4.9194-.7252 19.3377.3683 19.4833.3797.294.0286.5367-.1285.6566-.3769.12-.2512.0771-.5482-.1113-.7509-1.6246-1.7588-2.4611-7.7176-1.399-9.9617.336-.7117.7084-.6971.8601-.6912l.005.0002c1.8672.1085 4.5967 6.4556 5.9386 10.9268Z"/>
7
+ <path d="M48.1249 55.006c-.7652 0-1.5875-.0343-2.4697-.0999-2.1556-.1656-3.5146-.8623-4.0457-2.0758-.8993-2.0614 1.0593-4.6197 1.2848-4.9052l1.0536.8366c-.474.5996-1.5989 2.4041-1.1078 3.5319.394.8965 1.8015 1.1849 2.9122 1.2705 3.98.3055 6.6381-.1028 7.9229-1.2049.5425-.4654.8337-1.0621.8908-1.8216l1.3419.0999c-.0828 1.1164-.5396 2.0387-1.3562 2.741-1.2677 1.0907-3.3833 1.6275-6.4325 1.6275h.0057Z"/>
8
+ <path d="M80.8936 54.09c-11.9529 4.5537-21.8188.2965-26.3249-1.6009l-.8894 1.0673c10.6723 5.5142 21.2853 4.1505 27.2143 2.1345V54.09Z"/>
9
+ </g>
10
+ </g>
11
+ <defs>
12
+ <clipPath id="a">
13
+ <path fill="#fff" d="M0 0h80v80H0z"/>
14
+ </clipPath>
15
+ <clipPath id="b">
16
+ <path fill="#fff" d="M0 0h52v44.6667H0z" transform="translate(29.6666 24.6667)"/>
17
+ </clipPath>
18
+ </defs>
19
+ </svg>