@pagopa/io-app-design-system 1.1.3 → 1.3.0

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 (247) hide show
  1. package/README.md +1 -0
  2. package/lib/commonjs/components/accordion/RawAccordion.js.map +1 -1
  3. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  4. package/lib/commonjs/components/avatar/__test__/avatar.test.js.map +1 -1
  5. package/lib/commonjs/components/badge/Badge.js.map +1 -1
  6. package/lib/commonjs/components/banner/Banner.js +1 -1
  7. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  8. package/lib/commonjs/components/banner/__test__/banner.test.js.map +1 -1
  9. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
  10. package/lib/commonjs/components/buttons/ButtonOutline.js +3 -3
  11. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  12. package/lib/commonjs/components/buttons/ButtonSolid.js +3 -3
  13. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  14. package/lib/commonjs/components/common/AnimatedTick.js +2 -1
  15. package/lib/commonjs/components/common/AnimatedTick.js.map +1 -1
  16. package/lib/commonjs/components/contentWrapper/ContentWrapper.js.map +1 -1
  17. package/lib/commonjs/components/icons/Icon.js +124 -120
  18. package/lib/commonjs/components/icons/Icon.js.map +1 -1
  19. package/lib/commonjs/components/icons/svg/IconLight.js +31 -0
  20. package/lib/commonjs/components/icons/svg/IconLight.js.map +1 -0
  21. package/lib/commonjs/components/icons/svg/IconLightFilled.js +31 -0
  22. package/lib/commonjs/components/icons/svg/IconLightFilled.js.map +1 -0
  23. package/lib/commonjs/components/icons/svg/originals/IconLight.svg +3 -0
  24. package/lib/commonjs/components/icons/svg/originals/IconLightFilled.svg +3 -0
  25. package/lib/commonjs/components/index.js +11 -0
  26. package/lib/commonjs/components/index.js.map +1 -1
  27. package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
  28. package/lib/commonjs/components/listitems/ListItemIDP.js.map +1 -1
  29. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  30. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  31. package/lib/commonjs/components/listitems/PressableListItemsBase.js.map +1 -1
  32. package/lib/commonjs/components/listitems/__test__/listitem.test.js.map +1 -1
  33. package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
  34. package/lib/commonjs/components/pictograms/Pictogram.js +37 -31
  35. package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
  36. package/lib/commonjs/components/pictograms/svg/PictogramFocusOn.js +56 -0
  37. package/lib/commonjs/components/pictograms/svg/PictogramFocusOn.js.map +1 -0
  38. package/lib/commonjs/components/pictograms/svg/PictogramSuccess.js +61 -0
  39. package/lib/commonjs/components/pictograms/svg/PictogramSuccess.js.map +1 -0
  40. package/lib/commonjs/components/pictograms/svg/originals/PictogramFocusOn.svg +19 -0
  41. package/lib/commonjs/components/pictograms/svg/originals/PictogramSuccess.svg +35 -0
  42. package/lib/commonjs/components/spacer/Spacer.js.map +1 -1
  43. package/lib/commonjs/components/tabs/TabItem.js +123 -0
  44. package/lib/commonjs/components/tabs/TabItem.js.map +1 -0
  45. package/lib/commonjs/components/tabs/TabNavigation.js +80 -0
  46. package/lib/commonjs/components/tabs/TabNavigation.js.map +1 -0
  47. package/lib/commonjs/components/tabs/index.js +20 -0
  48. package/lib/commonjs/components/tabs/index.js.map +1 -0
  49. package/lib/commonjs/components/typography/Body.js.map +1 -1
  50. package/lib/commonjs/components/typography/Factory.js.map +1 -1
  51. package/lib/commonjs/components/typography/H1.js.map +1 -1
  52. package/lib/commonjs/components/typography/H2.js.map +1 -1
  53. package/lib/commonjs/components/typography/H4.js.map +1 -1
  54. package/lib/commonjs/components/typography/H5.js.map +1 -1
  55. package/lib/commonjs/components/typography/H6.js.map +1 -1
  56. package/lib/commonjs/components/typography/Label.js.map +1 -1
  57. package/lib/commonjs/components/typography/LabelHeader.js +37 -0
  58. package/lib/commonjs/components/typography/LabelHeader.js.map +1 -0
  59. package/lib/commonjs/components/typography/LabelSmall.js.map +1 -1
  60. package/lib/commonjs/components/typography/Monospace.js.map +1 -1
  61. package/lib/commonjs/components/typography/common.js +2 -2
  62. package/lib/commonjs/components/typography/common.js.map +1 -1
  63. package/lib/commonjs/utils/hooks/useSpringPressProgressValue.js +31 -0
  64. package/lib/commonjs/utils/hooks/useSpringPressProgressValue.js.map +1 -0
  65. package/lib/commonjs/utils/image.js.map +1 -1
  66. package/lib/module/components/accordion/RawAccordion.js.map +1 -1
  67. package/lib/module/components/alert/Alert.js.map +1 -1
  68. package/lib/module/components/avatar/__test__/avatar.test.js.map +1 -1
  69. package/lib/module/components/badge/Badge.js.map +1 -1
  70. package/lib/module/components/banner/Banner.js +1 -1
  71. package/lib/module/components/banner/Banner.js.map +1 -1
  72. package/lib/module/components/banner/__test__/banner.test.js.map +1 -1
  73. package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
  74. package/lib/module/components/buttons/ButtonOutline.js +3 -3
  75. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  76. package/lib/module/components/buttons/ButtonSolid.js +3 -3
  77. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  78. package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
  79. package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
  80. package/lib/module/components/common/AnimatedTick.js +2 -1
  81. package/lib/module/components/common/AnimatedTick.js.map +1 -1
  82. package/lib/module/components/contentWrapper/ContentWrapper.js.map +1 -1
  83. package/lib/module/components/icons/Icon.js +124 -120
  84. package/lib/module/components/icons/Icon.js.map +1 -1
  85. package/lib/module/components/icons/svg/IconLight.js +23 -0
  86. package/lib/module/components/icons/svg/IconLight.js.map +1 -0
  87. package/lib/module/components/icons/svg/IconLightFilled.js +23 -0
  88. package/lib/module/components/icons/svg/IconLightFilled.js.map +1 -0
  89. package/lib/module/components/icons/svg/originals/IconLight.svg +3 -0
  90. package/lib/module/components/icons/svg/originals/IconLightFilled.svg +3 -0
  91. package/lib/module/components/index.js +1 -0
  92. package/lib/module/components/index.js.map +1 -1
  93. package/lib/module/components/listitems/ListItemAction.js.map +1 -1
  94. package/lib/module/components/listitems/ListItemIDP.js.map +1 -1
  95. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  96. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  97. package/lib/module/components/listitems/PressableListItemsBase.js.map +1 -1
  98. package/lib/module/components/listitems/__test__/listitem.test.js.map +1 -1
  99. package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
  100. package/lib/module/components/pictograms/Pictogram.js +37 -31
  101. package/lib/module/components/pictograms/Pictogram.js.map +1 -1
  102. package/lib/module/components/pictograms/svg/PictogramFocusOn.js +48 -0
  103. package/lib/module/components/pictograms/svg/PictogramFocusOn.js.map +1 -0
  104. package/lib/module/components/pictograms/svg/PictogramSuccess.js +51 -0
  105. package/lib/module/components/pictograms/svg/PictogramSuccess.js.map +1 -0
  106. package/lib/module/components/pictograms/svg/originals/PictogramFocusOn.svg +19 -0
  107. package/lib/module/components/pictograms/svg/originals/PictogramSuccess.svg +35 -0
  108. package/lib/module/components/spacer/Spacer.js.map +1 -1
  109. package/lib/module/components/tabs/TabItem.js +114 -0
  110. package/lib/module/components/tabs/TabItem.js.map +1 -0
  111. package/lib/module/components/tabs/TabNavigation.js +73 -0
  112. package/lib/module/components/tabs/TabNavigation.js.map +1 -0
  113. package/lib/module/components/tabs/index.js +3 -0
  114. package/lib/module/components/tabs/index.js.map +1 -0
  115. package/lib/module/components/typography/Body.js.map +1 -1
  116. package/lib/module/components/typography/Factory.js.map +1 -1
  117. package/lib/module/components/typography/H1.js.map +1 -1
  118. package/lib/module/components/typography/H2.js.map +1 -1
  119. package/lib/module/components/typography/H4.js.map +1 -1
  120. package/lib/module/components/typography/H5.js.map +1 -1
  121. package/lib/module/components/typography/H6.js.map +1 -1
  122. package/lib/module/components/typography/Label.js.map +1 -1
  123. package/lib/module/components/typography/LabelHeader.js +27 -0
  124. package/lib/module/components/typography/LabelHeader.js.map +1 -0
  125. package/lib/module/components/typography/LabelSmall.js.map +1 -1
  126. package/lib/module/components/typography/Monospace.js.map +1 -1
  127. package/lib/module/components/typography/common.js +2 -2
  128. package/lib/module/components/typography/common.js.map +1 -1
  129. package/lib/module/utils/hooks/useSpringPressProgressValue.js +22 -0
  130. package/lib/module/utils/hooks/useSpringPressProgressValue.js.map +1 -0
  131. package/lib/module/utils/image.js.map +1 -1
  132. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  133. package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
  134. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  135. package/lib/typescript/components/buttons/ButtonExtendedOutline.d.ts.map +1 -1
  136. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  137. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  138. package/lib/typescript/components/buttons/IconButtonContained.d.ts.map +1 -1
  139. package/lib/typescript/components/common/AnimatedTick.d.ts.map +1 -1
  140. package/lib/typescript/components/contentWrapper/ContentWrapper.d.ts.map +1 -1
  141. package/lib/typescript/components/icons/Icon.d.ts +2 -0
  142. package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
  143. package/lib/typescript/components/icons/svg/IconLight.d.ts +5 -0
  144. package/lib/typescript/components/icons/svg/IconLight.d.ts.map +1 -0
  145. package/lib/typescript/components/icons/svg/IconLightFilled.d.ts +5 -0
  146. package/lib/typescript/components/icons/svg/IconLightFilled.d.ts.map +1 -0
  147. package/lib/typescript/components/index.d.ts +1 -0
  148. package/lib/typescript/components/index.d.ts.map +1 -1
  149. package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
  150. package/lib/typescript/components/listitems/ListItemIDP.d.ts +1 -1
  151. package/lib/typescript/components/listitems/ListItemIDP.d.ts.map +1 -1
  152. package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
  153. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  154. package/lib/typescript/components/listitems/PressableListItemsBase.d.ts.map +1 -1
  155. package/lib/typescript/components/listitems/hooks/useListItemSpringAnimation.d.ts.map +1 -1
  156. package/lib/typescript/components/pictograms/Pictogram.d.ts +3 -0
  157. package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
  158. package/lib/typescript/components/pictograms/svg/PictogramFocusOn.d.ts +5 -0
  159. package/lib/typescript/components/pictograms/svg/PictogramFocusOn.d.ts.map +1 -0
  160. package/lib/typescript/components/pictograms/svg/PictogramSuccess.d.ts +5 -0
  161. package/lib/typescript/components/pictograms/svg/PictogramSuccess.d.ts.map +1 -0
  162. package/lib/typescript/components/spacer/Spacer.d.ts.map +1 -1
  163. package/lib/typescript/components/tabs/TabItem.d.ts +19 -0
  164. package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -0
  165. package/lib/typescript/components/tabs/TabNavigation.d.ts +15 -0
  166. package/lib/typescript/components/tabs/TabNavigation.d.ts.map +1 -0
  167. package/lib/typescript/components/tabs/index.d.ts +3 -0
  168. package/lib/typescript/components/tabs/index.d.ts.map +1 -0
  169. package/lib/typescript/components/typography/Body.d.ts.map +1 -1
  170. package/lib/typescript/components/typography/Factory.d.ts.map +1 -1
  171. package/lib/typescript/components/typography/H1.d.ts.map +1 -1
  172. package/lib/typescript/components/typography/H2.d.ts.map +1 -1
  173. package/lib/typescript/components/typography/H4.d.ts.map +1 -1
  174. package/lib/typescript/components/typography/H5.d.ts.map +1 -1
  175. package/lib/typescript/components/typography/H6.d.ts.map +1 -1
  176. package/lib/typescript/components/typography/Label.d.ts.map +1 -1
  177. package/lib/typescript/components/typography/LabelHeader.d.ts +19 -0
  178. package/lib/typescript/components/typography/LabelHeader.d.ts.map +1 -0
  179. package/lib/typescript/components/typography/LabelSmall.d.ts.map +1 -1
  180. package/lib/typescript/components/typography/Monospace.d.ts.map +1 -1
  181. package/lib/typescript/components/typography/common.d.ts +2 -2
  182. package/lib/typescript/components/typography/common.d.ts.map +1 -1
  183. package/lib/typescript/utils/hooks/useSpringPressProgressValue.d.ts +11 -0
  184. package/lib/typescript/utils/hooks/useSpringPressProgressValue.d.ts.map +1 -0
  185. package/lib/typescript/utils/image.d.ts.map +1 -1
  186. package/package.json +6 -4
  187. package/src/components/Advice/index.tsx +1 -1
  188. package/src/components/accordion/RawAccordion.tsx +3 -3
  189. package/src/components/alert/Alert.tsx +4 -1
  190. package/src/components/avatar/Avatar.tsx +1 -1
  191. package/src/components/avatar/__test__/avatar.test.tsx +7 -4
  192. package/src/components/avatar/index.tsx +1 -1
  193. package/src/components/badge/Badge.tsx +16 -11
  194. package/src/components/banner/Banner.tsx +206 -195
  195. package/src/components/banner/__test__/banner.test.tsx +11 -9
  196. package/src/components/banner/index.tsx +1 -1
  197. package/src/components/buttons/ButtonExtendedOutline.tsx +80 -80
  198. package/src/components/buttons/ButtonOutline.tsx +278 -280
  199. package/src/components/buttons/ButtonSolid.tsx +142 -141
  200. package/src/components/buttons/IconButtonContained.tsx +17 -17
  201. package/src/components/buttons/IconButtonSolid.tsx +11 -11
  202. package/src/components/common/AnimatedTick.tsx +1 -0
  203. package/src/components/contentWrapper/ContentWrapper.tsx +12 -12
  204. package/src/components/contentWrapper/index.tsx +1 -1
  205. package/src/components/divider/index.tsx +1 -1
  206. package/src/components/icons/Icon.tsx +124 -120
  207. package/src/components/icons/index.tsx +1 -1
  208. package/src/components/icons/svg/IconLight.tsx +16 -0
  209. package/src/components/icons/svg/IconLightFilled.tsx +16 -0
  210. package/src/components/icons/svg/originals/IconLight.svg +3 -0
  211. package/src/components/icons/svg/originals/IconLightFilled.svg +3 -0
  212. package/src/components/index.tsx +1 -0
  213. package/src/components/listitems/ListItemAction.tsx +120 -119
  214. package/src/components/listitems/ListItemIDP.tsx +115 -115
  215. package/src/components/listitems/ListItemNavAlert.tsx +114 -110
  216. package/src/components/listitems/ListItemTransaction.tsx +2 -6
  217. package/src/components/listitems/PressableListItemsBase.tsx +29 -29
  218. package/src/components/listitems/__test__/listitem.test.tsx +53 -15
  219. package/src/components/listitems/hooks/useListItemSpringAnimation.ts +54 -52
  220. package/src/components/pictograms/Pictogram.tsx +36 -31
  221. package/src/components/pictograms/svg/PictogramFocusOn.tsx +39 -0
  222. package/src/components/pictograms/svg/PictogramSuccess.tsx +49 -0
  223. package/src/components/pictograms/svg/originals/PictogramFocusOn.svg +19 -0
  224. package/src/components/pictograms/svg/originals/PictogramSuccess.svg +35 -0
  225. package/src/components/spacer/Spacer.tsx +21 -18
  226. package/src/components/spacer/index.tsx +1 -1
  227. package/src/components/tabs/TabItem.tsx +183 -0
  228. package/src/components/tabs/TabNavigation.tsx +114 -0
  229. package/src/components/tabs/index.tsx +2 -0
  230. package/src/components/typography/Body.tsx +10 -10
  231. package/src/components/typography/Factory.tsx +38 -38
  232. package/src/components/typography/H1.tsx +19 -19
  233. package/src/components/typography/H2.tsx +19 -19
  234. package/src/components/typography/H4.tsx +12 -12
  235. package/src/components/typography/H5.tsx +24 -24
  236. package/src/components/typography/H6.tsx +10 -10
  237. package/src/components/typography/Label.tsx +16 -16
  238. package/src/components/typography/LabelHeader.tsx +44 -0
  239. package/src/components/typography/LabelSmall.tsx +27 -28
  240. package/src/components/typography/Monospace.tsx +14 -14
  241. package/src/components/typography/common.tsx +20 -20
  242. package/src/components/typography/index.tsx +0 -1
  243. package/src/index.tsx +0 -1
  244. package/src/json-import.d.ts +3 -4
  245. package/src/utils/dates.ts +1 -1
  246. package/src/utils/hooks/useSpringPressProgressValue.ts +28 -0
  247. package/src/utils/image.ts +22 -22
@@ -1,149 +1,149 @@
1
1
  import * as React from "react";
2
2
  import { useCallback } from "react";
3
3
  import {
4
- GestureResponderEvent,
5
- Image,
6
- ImageSourcePropType,
7
- Platform,
8
- Pressable,
9
- StyleSheet,
10
- Text
4
+ GestureResponderEvent,
5
+ Image,
6
+ ImageSourcePropType,
7
+ Platform,
8
+ Pressable,
9
+ StyleSheet,
10
+ Text
11
11
  } from "react-native";
12
12
  import Animated, {
13
- Extrapolate,
14
- interpolate,
15
- useAnimatedStyle,
16
- useDerivedValue,
17
- useSharedValue,
18
- withSpring
13
+ Extrapolate,
14
+ interpolate,
15
+ useAnimatedStyle,
16
+ useDerivedValue,
17
+ useSharedValue,
18
+ withSpring
19
19
  } from "react-native-reanimated";
20
20
  import {
21
- IOColors,
22
- IOListItemIDPHSpacing,
23
- IOListItemIDPRadius,
24
- IOListItemIDPSavedVSpacing,
25
- IOListItemIDPVSpacing,
26
- IOListItemLogoMargin,
27
- IOScaleValues,
28
- IOSpringValues
21
+ IOColors,
22
+ IOListItemIDPHSpacing,
23
+ IOListItemIDPRadius,
24
+ IOListItemIDPSavedVSpacing,
25
+ IOListItemIDPVSpacing,
26
+ IOListItemLogoMargin,
27
+ IOScaleValues,
28
+ IOSpringValues
29
29
  } from "../../core";
30
30
  import { toAndroidCacheTimestamp } from "../../utils/dates";
31
31
  import { makeFontStyleObject } from "../../utils/fonts";
32
32
  import { WithTestID } from "../../utils/types";
33
33
 
34
34
  type ListItemIDP = WithTestID<{
35
- name: string;
36
- localLogo: ImageSourcePropType;
37
- logo: ImageSourcePropType;
38
- saved?: boolean;
39
- onPress: (event: GestureResponderEvent) => void;
40
- urlLogoIDP: string;
35
+ name: string;
36
+ localLogo: ImageSourcePropType;
37
+ logo: ImageSourcePropType;
38
+ saved?: boolean;
39
+ onPress: (event: GestureResponderEvent) => void;
40
+ urlLogoIDP: string;
41
41
  }>;
42
42
 
43
43
  const styles = StyleSheet.create({
44
- button: {
45
- borderWidth: 1,
46
- borderColor: IOColors["grey-100"],
47
- borderRadius: IOListItemIDPRadius,
48
- backgroundColor: IOColors.white,
49
- flexDirection: "row",
50
- justifyContent: "space-between",
51
- alignItems: "center",
52
- paddingVertical: IOListItemIDPVSpacing,
53
- paddingHorizontal: IOListItemIDPHSpacing
54
- },
55
- idpName: {
56
- color: IOColors["grey-700"],
57
- fontSize: 12,
58
- lineHeight: 16,
59
- alignSelf: "center",
60
- textTransform: "uppercase",
61
- flexShrink: 1,
62
- ...makeFontStyleObject("Regular", false, "ReadexPro")
63
- },
64
- idpLogo: {
65
- marginStart: IOListItemLogoMargin,
66
- width: 120,
67
- height: 30,
68
- resizeMode: "contain"
69
- }
44
+ button: {
45
+ borderWidth: 1,
46
+ borderColor: IOColors["grey-100"],
47
+ borderRadius: IOListItemIDPRadius,
48
+ backgroundColor: IOColors.white,
49
+ flexDirection: "row",
50
+ justifyContent: "space-between",
51
+ alignItems: "center",
52
+ paddingVertical: IOListItemIDPVSpacing,
53
+ paddingHorizontal: IOListItemIDPHSpacing
54
+ },
55
+ idpName: {
56
+ color: IOColors["grey-700"],
57
+ fontSize: 12,
58
+ lineHeight: 16,
59
+ alignSelf: "center",
60
+ textTransform: "uppercase",
61
+ flexShrink: 1,
62
+ ...makeFontStyleObject("Regular", false, "ReadexPro")
63
+ },
64
+ idpLogo: {
65
+ marginStart: IOListItemLogoMargin,
66
+ width: 120,
67
+ height: 30,
68
+ resizeMode: "contain"
69
+ }
70
70
  });
71
71
 
72
72
  // https://github.com/facebook/react-native/issues/12606
73
73
  // Image cache forced refresh for Android by appending
74
74
  // the `ts` query parameter as DDMMYYYY to simulate a 24h TTL.
75
75
  const androidIdpLogoForcedRefreshed = () =>
76
- Platform.OS === "android" ? `?ts=${toAndroidCacheTimestamp()}` : "";
76
+ Platform.OS === "android" ? `?ts=${toAndroidCacheTimestamp()}` : "";
77
77
 
78
78
  export const ListItemIDP = ({
79
- name,
80
- localLogo,
81
- logo,
82
- saved,
83
- onPress,
84
- testID,
79
+ name,
80
+ localLogo,
81
+ logo,
82
+ saved,
83
+ onPress,
84
+ testID
85
85
  }: ListItemIDP) => {
86
- const isPressed = useSharedValue(0);
86
+ const isPressed = useSharedValue(0);
87
87
 
88
- // Scaling transformation applied when the button is pressed
89
- const animationScaleValue = IOScaleValues?.magnifiedButton?.pressedState;
88
+ // Scaling transformation applied when the button is pressed
89
+ const animationScaleValue = IOScaleValues?.magnifiedButton?.pressedState;
90
90
 
91
- const scaleTraversed = useDerivedValue(() =>
92
- withSpring(isPressed.value, IOSpringValues.button)
93
- );
91
+ const scaleTraversed = useDerivedValue(() =>
92
+ withSpring(isPressed.value, IOSpringValues.button)
93
+ );
94
94
 
95
- // Interpolate animation values from `isPressed` values
96
- const animatedStyle = useAnimatedStyle(() => {
97
- const scale = interpolate(
98
- scaleTraversed.value,
99
- [0, 1],
100
- [1, animationScaleValue],
101
- Extrapolate.CLAMP
102
- );
95
+ // Interpolate animation values from `isPressed` values
96
+ const animatedStyle = useAnimatedStyle(() => {
97
+ const scale = interpolate(
98
+ scaleTraversed.value,
99
+ [0, 1],
100
+ [1, animationScaleValue],
101
+ Extrapolate.CLAMP
102
+ );
103
103
 
104
- return {
105
- transform: [{ scale }]
106
- };
107
- });
104
+ return {
105
+ transform: [{ scale }]
106
+ };
107
+ });
108
108
 
109
- const handlePressIn = useCallback(() => {
110
- // eslint-disable-next-line functional/immutable-data
111
- isPressed.value = 1;
112
- }, [isPressed]);
113
- const handlePressOut = useCallback(() => {
114
- // eslint-disable-next-line functional/immutable-data
115
- isPressed.value = 0;
116
- }, [isPressed]);
109
+ const handlePressIn = useCallback(() => {
110
+ // eslint-disable-next-line functional/immutable-data
111
+ isPressed.value = 1;
112
+ }, [isPressed]);
113
+ const handlePressOut = useCallback(() => {
114
+ // eslint-disable-next-line functional/immutable-data
115
+ isPressed.value = 0;
116
+ }, [isPressed]);
117
117
 
118
- // eslint-disable-next-line no-console
119
- const urlLogoIDP = localLogo
120
- ? localLogo
121
- : {
122
- uri: `${logo}${androidIdpLogoForcedRefreshed()}`
123
- };
124
- return (
125
- <Pressable
126
- onPress={onPress}
127
- onPressIn={handlePressIn}
128
- onPressOut={handlePressOut}
129
- onTouchEnd={handlePressOut}
130
- accessible={true}
131
- accessibilityRole={"button"}
132
- accessibilityLabel={name}
133
- testID={testID}
134
- >
135
- <Animated.View
136
- style={[
137
- styles.button,
138
- saved && { paddingVertical: IOListItemIDPSavedVSpacing },
139
- animatedStyle
140
- ]}
141
- >
142
- <Text style={styles.idpName}>{name}</Text>
143
- <Image source={urlLogoIDP} style={styles.idpLogo} />
144
- </Animated.View>
145
- </Pressable>
146
- );
118
+ // eslint-disable-next-line no-console
119
+ const urlLogoIDP = localLogo
120
+ ? localLogo
121
+ : {
122
+ uri: `${logo}${androidIdpLogoForcedRefreshed()}`
123
+ };
124
+ return (
125
+ <Pressable
126
+ onPress={onPress}
127
+ onPressIn={handlePressIn}
128
+ onPressOut={handlePressOut}
129
+ onTouchEnd={handlePressOut}
130
+ accessible={true}
131
+ accessibilityRole={"button"}
132
+ accessibilityLabel={name}
133
+ testID={testID}
134
+ >
135
+ <Animated.View
136
+ style={[
137
+ styles.button,
138
+ saved && { paddingVertical: IOListItemIDPSavedVSpacing },
139
+ animatedStyle
140
+ ]}
141
+ >
142
+ <Text style={styles.idpName}>{name}</Text>
143
+ <Image source={urlLogoIDP} style={styles.idpLogo} />
144
+ </Animated.View>
145
+ </Pressable>
146
+ );
147
147
  };
148
148
 
149
149
  export default ListItemIDP;
@@ -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
  };