@pagopa/io-app-design-system 1.17.1 → 1.18.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 (170) hide show
  1. package/lib/commonjs/components/buttons/ButtonLink.js +14 -0
  2. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  3. package/lib/commonjs/components/checkbox/CheckboxLabel.js +6 -29
  4. package/lib/commonjs/components/checkbox/CheckboxLabel.js.map +1 -1
  5. package/lib/commonjs/components/codeInput/CodeInput.js +10 -25
  6. package/lib/commonjs/components/codeInput/CodeInput.js.map +1 -1
  7. package/lib/commonjs/components/common/ScaleInOutAnimation.js +69 -0
  8. package/lib/commonjs/components/common/ScaleInOutAnimation.js.map +1 -0
  9. package/lib/commonjs/components/icons/Icon.js +52 -48
  10. package/lib/commonjs/components/icons/Icon.js.map +1 -1
  11. package/lib/commonjs/components/icons/svg/IconSystemPermissionsAndroid.js +34 -0
  12. package/lib/commonjs/components/icons/svg/IconSystemPermissionsAndroid.js.map +1 -0
  13. package/lib/commonjs/components/index.js +11 -0
  14. package/lib/commonjs/components/index.js.map +1 -1
  15. package/lib/commonjs/components/layout/ForceScrollDownView.js +161 -0
  16. package/lib/commonjs/components/layout/ForceScrollDownView.js.map +1 -0
  17. package/lib/commonjs/components/layout/HeaderFirstLevel.js +4 -4
  18. package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
  19. package/lib/commonjs/components/layout/__test__/ForceScrollDownView.test.js +94 -0
  20. package/lib/commonjs/components/layout/__test__/ForceScrollDownView.test.js.map +1 -0
  21. package/lib/commonjs/components/layout/__test__/__snapshots__/ForceScrollDownView.test.tsx.snap +23 -0
  22. package/lib/commonjs/components/layout/index.js +11 -0
  23. package/lib/commonjs/components/layout/index.js.map +1 -1
  24. package/lib/commonjs/components/listitems/ListItemTransaction.js +6 -3
  25. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  26. package/lib/commonjs/components/otpInput/BoxedInput.js +72 -0
  27. package/lib/commonjs/components/otpInput/BoxedInput.js.map +1 -0
  28. package/lib/commonjs/components/otpInput/OTPInput.js +131 -0
  29. package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -0
  30. package/lib/commonjs/components/otpInput/index.js +17 -0
  31. package/lib/commonjs/components/otpInput/index.js.map +1 -0
  32. package/lib/commonjs/components/pictograms/Pictogram.js +74 -68
  33. package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
  34. package/lib/commonjs/components/pictograms/svg/PictogramComunicationProblem.js +85 -0
  35. package/lib/commonjs/components/pictograms/svg/PictogramComunicationProblem.js.map +1 -0
  36. package/lib/commonjs/components/pictograms/svg/PictogramEventClose.js +40 -0
  37. package/lib/commonjs/components/pictograms/svg/PictogramEventClose.js.map +1 -0
  38. package/lib/commonjs/components/pictograms/svg/PictogramHello.js +61 -0
  39. package/lib/commonjs/components/pictograms/svg/PictogramHello.js.map +1 -0
  40. package/lib/commonjs/components/pictograms/svg/originals/PictogramComunicationProblem.svg +91 -0
  41. package/lib/commonjs/components/pictograms/svg/originals/PictogramEventClose.svg +34 -0
  42. package/lib/commonjs/components/pictograms/svg/originals/PictogramHello.svg +46 -0
  43. package/lib/commonjs/components/radio/RadioButtonLabel.js +70 -0
  44. package/lib/commonjs/components/radio/RadioButtonLabel.js.map +1 -0
  45. package/lib/commonjs/components/radio/index.js +11 -0
  46. package/lib/commonjs/components/radio/index.js.map +1 -1
  47. package/lib/commonjs/core/IOStyles.js +3 -1
  48. package/lib/commonjs/core/IOStyles.js.map +1 -1
  49. package/lib/commonjs/utils/hooks/useErrorShakeAnimation.js +44 -0
  50. package/lib/commonjs/utils/hooks/useErrorShakeAnimation.js.map +1 -0
  51. package/lib/module/components/buttons/ButtonLink.js +15 -1
  52. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  53. package/lib/module/components/checkbox/CheckboxLabel.js +7 -30
  54. package/lib/module/components/checkbox/CheckboxLabel.js.map +1 -1
  55. package/lib/module/components/codeInput/CodeInput.js +9 -25
  56. package/lib/module/components/codeInput/CodeInput.js.map +1 -1
  57. package/lib/module/components/common/ScaleInOutAnimation.js +59 -0
  58. package/lib/module/components/common/ScaleInOutAnimation.js.map +1 -0
  59. package/lib/module/components/icons/Icon.js +52 -48
  60. package/lib/module/components/icons/Icon.js.map +1 -1
  61. package/lib/module/components/icons/svg/IconSystemPermissionsAndroid.js +26 -0
  62. package/lib/module/components/icons/svg/IconSystemPermissionsAndroid.js.map +1 -0
  63. package/lib/module/components/index.js +1 -0
  64. package/lib/module/components/index.js.map +1 -1
  65. package/lib/module/components/layout/ForceScrollDownView.js +153 -0
  66. package/lib/module/components/layout/ForceScrollDownView.js.map +1 -0
  67. package/lib/module/components/layout/HeaderFirstLevel.js +4 -4
  68. package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
  69. package/lib/module/components/layout/__test__/ForceScrollDownView.test.js +90 -0
  70. package/lib/module/components/layout/__test__/ForceScrollDownView.test.js.map +1 -0
  71. package/lib/module/components/layout/__test__/__snapshots__/ForceScrollDownView.test.tsx.snap +23 -0
  72. package/lib/module/components/layout/index.js +1 -0
  73. package/lib/module/components/layout/index.js.map +1 -1
  74. package/lib/module/components/listitems/ListItemTransaction.js +6 -3
  75. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  76. package/lib/module/components/otpInput/BoxedInput.js +64 -0
  77. package/lib/module/components/otpInput/BoxedInput.js.map +1 -0
  78. package/lib/module/components/otpInput/OTPInput.js +121 -0
  79. package/lib/module/components/otpInput/OTPInput.js.map +1 -0
  80. package/lib/module/components/otpInput/index.js +2 -0
  81. package/lib/module/components/otpInput/index.js.map +1 -0
  82. package/lib/module/components/pictograms/Pictogram.js +74 -68
  83. package/lib/module/components/pictograms/Pictogram.js.map +1 -1
  84. package/lib/module/components/pictograms/svg/PictogramComunicationProblem.js +77 -0
  85. package/lib/module/components/pictograms/svg/PictogramComunicationProblem.js.map +1 -0
  86. package/lib/module/components/pictograms/svg/PictogramEventClose.js +32 -0
  87. package/lib/module/components/pictograms/svg/PictogramEventClose.js.map +1 -0
  88. package/lib/module/components/pictograms/svg/PictogramHello.js +53 -0
  89. package/lib/module/components/pictograms/svg/PictogramHello.js.map +1 -0
  90. package/lib/module/components/pictograms/svg/originals/PictogramComunicationProblem.svg +91 -0
  91. package/lib/module/components/pictograms/svg/originals/PictogramEventClose.svg +34 -0
  92. package/lib/module/components/pictograms/svg/originals/PictogramHello.svg +46 -0
  93. package/lib/module/components/radio/RadioButtonLabel.js +62 -0
  94. package/lib/module/components/radio/RadioButtonLabel.js.map +1 -0
  95. package/lib/module/components/radio/index.js +1 -0
  96. package/lib/module/components/radio/index.js.map +1 -1
  97. package/lib/module/core/IOStyles.js +3 -1
  98. package/lib/module/core/IOStyles.js.map +1 -1
  99. package/lib/module/utils/hooks/useErrorShakeAnimation.js +37 -0
  100. package/lib/module/utils/hooks/useErrorShakeAnimation.js.map +1 -0
  101. package/lib/typescript/components/buttons/ButtonLink.d.ts +1 -1
  102. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  103. package/lib/typescript/components/checkbox/CheckboxLabel.d.ts.map +1 -1
  104. package/lib/typescript/components/codeInput/CodeInput.d.ts.map +1 -1
  105. package/lib/typescript/components/common/ScaleInOutAnimation.d.ts +14 -0
  106. package/lib/typescript/components/common/ScaleInOutAnimation.d.ts.map +1 -0
  107. package/lib/typescript/components/icons/Icon.d.ts +2 -0
  108. package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
  109. package/lib/typescript/components/icons/svg/IconSystemPermissionsAndroid.d.ts +5 -0
  110. package/lib/typescript/components/icons/svg/IconSystemPermissionsAndroid.d.ts.map +1 -0
  111. package/lib/typescript/components/index.d.ts +1 -0
  112. package/lib/typescript/components/index.d.ts.map +1 -1
  113. package/lib/typescript/components/layout/ForceScrollDownView.d.ts +27 -0
  114. package/lib/typescript/components/layout/ForceScrollDownView.d.ts.map +1 -0
  115. package/lib/typescript/components/layout/__test__/ForceScrollDownView.test.d.ts +2 -0
  116. package/lib/typescript/components/layout/__test__/ForceScrollDownView.test.d.ts.map +1 -0
  117. package/lib/typescript/components/layout/index.d.ts +1 -0
  118. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  119. package/lib/typescript/components/listitems/ListItemTransaction.d.ts +6 -1
  120. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  121. package/lib/typescript/components/otpInput/BoxedInput.d.ts +9 -0
  122. package/lib/typescript/components/otpInput/BoxedInput.d.ts.map +1 -0
  123. package/lib/typescript/components/otpInput/OTPInput.d.ts +26 -0
  124. package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -0
  125. package/lib/typescript/components/otpInput/index.d.ts +2 -0
  126. package/lib/typescript/components/otpInput/index.d.ts.map +1 -0
  127. package/lib/typescript/components/pictograms/Pictogram.d.ts +3 -0
  128. package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
  129. package/lib/typescript/components/pictograms/svg/PictogramComunicationProblem.d.ts +5 -0
  130. package/lib/typescript/components/pictograms/svg/PictogramComunicationProblem.d.ts.map +1 -0
  131. package/lib/typescript/components/pictograms/svg/PictogramEventClose.d.ts +5 -0
  132. package/lib/typescript/components/pictograms/svg/PictogramEventClose.d.ts.map +1 -0
  133. package/lib/typescript/components/pictograms/svg/PictogramHello.d.ts +5 -0
  134. package/lib/typescript/components/pictograms/svg/PictogramHello.d.ts.map +1 -0
  135. package/lib/typescript/components/radio/RadioButtonLabel.d.ts +18 -0
  136. package/lib/typescript/components/radio/RadioButtonLabel.d.ts.map +1 -0
  137. package/lib/typescript/components/radio/index.d.ts +1 -0
  138. package/lib/typescript/components/radio/index.d.ts.map +1 -1
  139. package/lib/typescript/core/IOStyles.d.ts +2 -0
  140. package/lib/typescript/core/IOStyles.d.ts.map +1 -1
  141. package/lib/typescript/utils/hooks/useErrorShakeAnimation.d.ts +11 -0
  142. package/lib/typescript/utils/hooks/useErrorShakeAnimation.d.ts.map +1 -0
  143. package/package.json +5 -2
  144. package/src/components/buttons/ButtonLink.tsx +17 -1
  145. package/src/components/checkbox/CheckboxLabel.tsx +4 -31
  146. package/src/components/codeInput/CodeInput.tsx +5 -33
  147. package/src/components/common/ScaleInOutAnimation.tsx +68 -0
  148. package/src/components/icons/Icon.tsx +52 -48
  149. package/src/components/icons/svg/IconSystemPermissionsAndroid.tsx +19 -0
  150. package/src/components/index.tsx +1 -0
  151. package/src/components/layout/ForceScrollDownView.tsx +210 -0
  152. package/src/components/layout/HeaderFirstLevel.tsx +4 -4
  153. package/src/components/layout/__test__/ForceScrollDownView.test.tsx +106 -0
  154. package/src/components/layout/__test__/__snapshots__/ForceScrollDownView.test.tsx.snap +23 -0
  155. package/src/components/layout/index.tsx +1 -0
  156. package/src/components/listitems/ListItemTransaction.tsx +12 -1
  157. package/src/components/otpInput/BoxedInput.tsx +67 -0
  158. package/src/components/otpInput/OTPInput.tsx +135 -0
  159. package/src/components/otpInput/index.tsx +1 -0
  160. package/src/components/pictograms/Pictogram.tsx +74 -68
  161. package/src/components/pictograms/svg/PictogramComunicationProblem.tsx +94 -0
  162. package/src/components/pictograms/svg/PictogramEventClose.tsx +34 -0
  163. package/src/components/pictograms/svg/PictogramHello.tsx +54 -0
  164. package/src/components/pictograms/svg/originals/PictogramComunicationProblem.svg +91 -0
  165. package/src/components/pictograms/svg/originals/PictogramEventClose.svg +34 -0
  166. package/src/components/pictograms/svg/originals/PictogramHello.svg +46 -0
  167. package/src/components/radio/RadioButtonLabel.tsx +73 -0
  168. package/src/components/radio/index.tsx +1 -0
  169. package/src/core/IOStyles.ts +5 -1
  170. package/src/utils/hooks/useErrorShakeAnimation.ts +43 -0
@@ -1,15 +1,10 @@
1
1
  import React, { useEffect, useMemo } from "react";
2
2
  import { StyleSheet, View } from "react-native";
3
- import Animated, {
4
- Easing,
5
- useAnimatedStyle,
6
- useSharedValue,
7
- withSequence,
8
- withTiming
9
- } from "react-native-reanimated";
3
+ import Animated from "react-native-reanimated";
10
4
  import { IOColors, IOStyles } from "../../core";
11
5
  import { triggerHaptic } from "../../functions";
12
6
  import { HSpacer } from "../spacer";
7
+ import { useErrorShakeAnimation } from "../../utils/hooks/useErrorShakeAnimation";
13
8
 
14
9
  type CodeInputProps = {
15
10
  value: string;
@@ -56,12 +51,7 @@ export const CodeInput = ({
56
51
  }: CodeInputProps) => {
57
52
  const [status, setStatus] = React.useState<"default" | "error">("default");
58
53
 
59
- const translate = useSharedValue(0);
60
- const shakeOffset: number = 8;
61
-
62
- const animatedStyle = useAnimatedStyle(() => ({
63
- transform: [{ translateX: translate.value }]
64
- }));
54
+ const { translate, animatedStyle, shakeAnimation } = useErrorShakeAnimation();
65
55
 
66
56
  const fillColor = useMemo(
67
57
  () =>
@@ -82,25 +72,7 @@ export const CodeInput = ({
82
72
  triggerHaptic("notificationError");
83
73
 
84
74
  // eslint-disable-next-line functional/immutable-data
85
- translate.value = withSequence(
86
- withTiming(shakeOffset, {
87
- duration: 75,
88
- easing: Easing.inOut(Easing.cubic)
89
- }),
90
- withTiming(-shakeOffset, {
91
- duration: 75,
92
- easing: Easing.inOut(Easing.cubic)
93
- }),
94
- withTiming(shakeOffset / 2, {
95
- duration: 75,
96
- easing: Easing.inOut(Easing.cubic)
97
- }),
98
- withTiming(-shakeOffset / 2, {
99
- duration: 75,
100
- easing: Easing.inOut(Easing.cubic)
101
- }),
102
- withTiming(0, { duration: 75, easing: Easing.inOut(Easing.cubic) })
103
- );
75
+ translate.value = shakeAnimation();
104
76
 
105
77
  const timer = setTimeout(() => {
106
78
  setStatus("default");
@@ -110,7 +82,7 @@ export const CodeInput = ({
110
82
  }
111
83
  }
112
84
  return;
113
- }, [value, onValidate, length, onValueChange, translate]);
85
+ }, [value, onValidate, length, onValueChange, translate, shakeAnimation]);
114
86
 
115
87
  return (
116
88
  <Animated.View style={[IOStyles.row, styles.wrapper, animatedStyle]}>
@@ -0,0 +1,68 @@
1
+ /* eslint-disable functional/immutable-data */
2
+ import React from "react";
3
+ import { ViewStyle } from "react-native";
4
+ import Animated, {
5
+ LayoutAnimation,
6
+ WithSpringConfig,
7
+ withDelay,
8
+ withSpring,
9
+ withTiming
10
+ } from "react-native-reanimated";
11
+
12
+ type Props = {
13
+ visible?: boolean;
14
+ springConfig?: WithSpringConfig;
15
+ delayOut?: number;
16
+ delayIn?: number;
17
+ children: React.ReactNode;
18
+ style?: ViewStyle;
19
+ };
20
+
21
+ const ScaleInOutAnimation = ({
22
+ visible = true,
23
+ springConfig = { damping: 500, mass: 3, stiffness: 1000 },
24
+ delayOut = 0,
25
+ delayIn = 0,
26
+ children,
27
+ style
28
+ }: Props) => {
29
+ const enteringAnimation = (): LayoutAnimation => {
30
+ "worklet";
31
+ return {
32
+ initialValues: {
33
+ transform: [{ scale: 0 }]
34
+ },
35
+ animations: {
36
+ transform: [{ scale: withDelay(delayIn, withSpring(1, springConfig)) }]
37
+ }
38
+ };
39
+ };
40
+
41
+ const exitingAnimation = (): LayoutAnimation => {
42
+ "worklet";
43
+ return {
44
+ initialValues: {
45
+ transform: [{ scale: 1 }]
46
+ },
47
+ animations: {
48
+ transform: [{ scale: withDelay(delayOut, withTiming(0)) }]
49
+ }
50
+ };
51
+ };
52
+
53
+ if (!visible) {
54
+ return null;
55
+ }
56
+
57
+ return (
58
+ <Animated.View
59
+ style={style}
60
+ entering={enteringAnimation}
61
+ exiting={exitingAnimation}
62
+ >
63
+ {children}
64
+ </Animated.View>
65
+ );
66
+ };
67
+
68
+ export { ScaleInOutAnimation };
@@ -5,10 +5,12 @@ import { IOColors } from "../../core/IOColors";
5
5
  /* Icons */
6
6
  import IconAbacus from "./svg/IconAbacus";
7
7
  import IconAdd from "./svg/IconAdd";
8
+ import IconAddSmall from "./svg/IconAddSmall";
8
9
  import IconAgreement from "./svg/IconAgreement";
9
10
  import IconAmount from "./svg/IconAmount";
10
11
  import IconAnalytics from "./svg/IconAnalytics";
11
12
  import IconArchive from "./svg/IconArchive";
13
+ import IconArchiveFilled from "./svg/IconArchiveFilled";
12
14
  import IconArrowBottom from "./svg/IconArrowBottom";
13
15
  import IconArrowLeft from "./svg/IconArrowLeft";
14
16
  import IconArrowRight from "./svg/IconArrowRight";
@@ -37,6 +39,7 @@ import IconCategSustainability from "./svg/IconCategSustainability";
37
39
  import IconCategTelco from "./svg/IconCategTelco";
38
40
  import IconCategTravel from "./svg/IconCategTravel";
39
41
  import IconCategWellness from "./svg/IconCategWellness";
42
+ import IconChange from "./svg/IconChange";
40
43
  import IconChat from "./svg/IconChat";
41
44
  import IconCheckTick from "./svg/IconCheckTick";
42
45
  import IconCheckTickBig from "./svg/IconCheckTickBig";
@@ -49,35 +52,63 @@ import IconCie from "./svg/IconCie";
49
52
  import IconCloseLarge from "./svg/IconCloseLarge";
50
53
  import IconCloseMedium from "./svg/IconCloseMedium";
51
54
  import IconCloseSmall from "./svg/IconCloseSmall";
55
+ import IconCode from "./svg/IconCode";
52
56
  import IconCoggle from "./svg/IconCoggle";
57
+ import IconCompare from "./svg/IconCompare";
58
+ import IconContactless from "./svg/IconContactless";
53
59
  import IconCopy from "./svg/IconCopy";
54
60
  import IconCreditCard from "./svg/IconCreditCard";
61
+ import IconCreditCardOff from "./svg/IconCreditCardOff";
55
62
  import IconDevice from "./svg/IconDevice";
63
+ import IconDeviceVibration from "./svg/IconDeviceVibration";
64
+ import IconDisabilityCard from "./svg/IconDisabilityCard";
65
+ import IconDocGiacenza from "./svg/IconDocGiacenza";
66
+ import IconDocPaymentCode from "./svg/IconDocPaymentCode";
67
+ import IconDocPaymentTitle from "./svg/IconDocPaymentTitle";
56
68
  import IconDocument from "./svg/IconDocument";
57
69
  import IconDocumentAttachment from "./svg/IconDocumentAttachment";
58
70
  import IconDocumentAttachmentPDF from "./svg/IconDocumentAttachmentPDF";
59
71
  import IconDocumentSign from "./svg/IconDocumentSign";
60
72
  import IconDotMenu from "./svg/IconDotMenu";
73
+ import IconDriverLicense from "./svg/IconDriverLicense";
61
74
  import IconEdit from "./svg/IconEdit";
62
75
  import IconEmail from "./svg/IconEmail";
63
76
  import IconEmailFill from "./svg/IconEmailFill";
64
77
  import IconEmojiHappy from "./svg/IconEmojiHappy";
65
78
  import IconEmojiSad from "./svg/IconEmojiSad";
79
+ import IconEntityCode from "./svg/IconEntityCode";
66
80
  import IconErrorFilled from "./svg/IconErrorFilled";
67
81
  import IconExternalLink from "./svg/IconExternalLink";
82
+ import IconExternalLinkSmall from "./svg/IconExternalLinkSmall";
68
83
  import IconEyeHide from "./svg/IconEyeHide";
69
84
  import IconEyeShow from "./svg/IconEyeShow";
85
+ import IconFamilySharing from "./svg/IconFamilySharing";
86
+ import IconFilterAndroid from "./svg/IconFilterAndroid";
87
+ import IconFilterOffiOS from "./svg/IconFilterOffiOS";
88
+ import IconFilterOniOS from "./svg/IconFilterOniOS";
89
+ import IconFingerprint from "./svg/IconFingerprint";
70
90
  import IconFiscalCodeIndividual from "./svg/IconFiscalCodeIndividual";
91
+ import IconFolder from "./svg/IconFolder";
71
92
  import IconFornitori from "./svg/IconFornitori";
93
+ import IconForward from "./svg/IconForward";
72
94
  import IconGallery from "./svg/IconGallery";
95
+ import IconHealthCard from "./svg/IconHealthCard";
96
+ import IconHearthEmpty from "./svg/IconHearthEmpty";
97
+ import IconHearthFilled from "./svg/IconHearthFilled";
73
98
  import IconHistory from "./svg/IconHistory";
74
99
  import IconHome from "./svg/IconHome";
75
100
  import IconHomeFill from "./svg/IconHomeFill";
76
101
  import IconHourglass from "./svg/IconHourglass";
102
+ import IconInboxEmpty from "./svg/IconInboxEmpty";
103
+ import IconInboxFilled from "./svg/IconInboxFilled";
77
104
  import IconInfo from "./svg/IconInfo";
78
105
  import IconInfoFilled from "./svg/IconInfoFilled";
79
106
  import IconInitiatives from "./svg/IconInitiatives";
80
107
  import IconInstitution from "./svg/IconInstitution";
108
+ import IconInstruction from "./svg/IconInstruction";
109
+ import IconKey from "./svg/IconKey";
110
+ import IconKeyboard from "./svg/IconKeyboard";
111
+ import IconKeyboardDown from "./svg/IconKeyboardDown";
81
112
  import IconLadybug from "./svg/IconLadybug";
82
113
  import IconLegalValue from "./svg/IconLegalValue";
83
114
  import IconLight from "./svg/IconLight";
@@ -91,6 +122,7 @@ import IconLockOn from "./svg/IconLockOn";
91
122
  import IconLogin from "./svg/IconLogin";
92
123
  import IconLogout from "./svg/IconLogout";
93
124
  import IconMagicWand from "./svg/IconMagicWand";
125
+ import IconMapPin from "./svg/IconMapPin";
94
126
  import IconMerchant from "./svg/IconMerchant";
95
127
  import IconMessage from "./svg/IconMessage";
96
128
  import IconMessageLegal from "./svg/IconMessageLegal";
@@ -103,14 +135,19 @@ import IconNavServices from "./svg/IconNavServices";
103
135
  import IconNavServicesFocused from "./svg/IconNavServicesFocused";
104
136
  import IconNavWallet from "./svg/IconNavWallet";
105
137
  import IconNavWalletFocused from "./svg/IconNavWalletFocused";
138
+ import IconNotes from "./svg/IconNotes";
106
139
  import IconNotice from "./svg/IconNotice";
107
140
  import IconNoticeFilled from "./svg/IconNoticeFilled";
141
+ import IconNoticePlain from "./svg/IconNoticePlain";
142
+ import IconNotification from "./svg/IconNotification";
108
143
  import IconOk from "./svg/IconOk";
144
+ import IconOption from "./svg/IconOption";
109
145
  import IconPEC from "./svg/IconPEC";
110
146
  import IconPSP from "./svg/IconPSP";
111
147
  import IconPhone from "./svg/IconPhone";
112
148
  import IconPinOff from "./svg/IconPinOff";
113
149
  import IconPinOn from "./svg/IconPinOn";
150
+ import IconPrint from "./svg/IconPrint";
114
151
  import IconProductIOApp from "./svg/IconProductIOApp";
115
152
  import IconProductIOAppBlueBg from "./svg/IconProductIOAppBlueBg";
116
153
  import IconProductPagoPA from "./svg/IconProductPagoPA";
@@ -119,6 +156,9 @@ import IconProfileAlt from "./svg/IconProfileAlt";
119
156
  import IconProfileFilled from "./svg/IconProfileFilled";
120
157
  import IconQrCode from "./svg/IconQrCode";
121
158
  import IconQuestion from "./svg/IconQuestion";
159
+ import IconRead from "./svg/IconRead";
160
+ import IconReceiptOff from "./svg/IconReceiptOff";
161
+ import IconReceiptOn from "./svg/IconReceiptOn";
122
162
  import IconRefund from "./svg/IconRefund";
123
163
  import IconReload from "./svg/IconReload";
124
164
  import IconSave from "./svg/IconSave";
@@ -127,6 +167,8 @@ import IconSecurity from "./svg/IconSecurity";
127
167
  import IconSelfCertification from "./svg/IconSelfCertification";
128
168
  import IconShareAndroid from "./svg/IconShareAndroid";
129
169
  import IconShareiOs from "./svg/IconShareiOs";
170
+ import IconSignal from "./svg/IconSignal";
171
+ import IconSparkles from "./svg/IconSparkles";
130
172
  import IconSpid from "./svg/IconSpid";
131
173
  import IconStarEmpty from "./svg/IconStarEmpty";
132
174
  import IconStarFilled from "./svg/IconStarFilled";
@@ -134,63 +176,22 @@ import IconSuccess from "./svg/IconSuccess";
134
176
  import IconSwitchOff from "./svg/IconSwitchOff";
135
177
  import IconSystemAppsAndroid from "./svg/IconSystemAppsAndroid";
136
178
  import IconSystemNotificationsInstructions from "./svg/IconSystemNotificationsInstructions";
179
+ import IconSystemPermissionsAndroid from "./svg/IconSystemPermissionsAndroid";
137
180
  import IconSystemSettingsAndroid from "./svg/IconSystemSettingsAndroid";
138
181
  import IconSystemSettingsiOS from "./svg/IconSystemSettingsiOS";
139
182
  import IconSystemToggleInstructions from "./svg/IconSystemToggleInstructions";
140
183
  import IconTag from "./svg/IconTag";
141
- import IconTransactionsBoxed from "./svg/IconTransactionsBoxed";
184
+ import IconTerms from "./svg/IconTerms";
185
+ import IconTouch from "./svg/IconTouch";
142
186
  import IconTransactions from "./svg/IconTransactions";
187
+ import IconTransactionsBoxed from "./svg/IconTransactionsBoxed";
143
188
  import IconTrashcan from "./svg/IconTrashcan";
144
189
  import IconWarningFilled from "./svg/IconWarningFilled";
145
190
  import IconWebsite from "./svg/IconWebsite";
146
- import IconOption from "./svg/IconOption";
147
- import IconKey from "./svg/IconKey";
148
- import IconNotification from "./svg/IconNotification";
149
- import IconChange from "./svg/IconChange";
150
191
  import LegIconCheckOff from "./svg/LegIconCheckOff";
151
192
  import LegIconCheckOn from "./svg/LegIconCheckOn";
152
193
  import LegIconRadioOff from "./svg/LegIconRadioOff";
153
194
  import LegIconRadioOn from "./svg/LegIconRadioOn";
154
- import IconKeyboard from "./svg/IconKeyboard";
155
- import IconContactless from "./svg/IconContactless";
156
- import IconDisabilityCard from "./svg/IconDisabilityCard";
157
- import IconDriverLicense from "./svg/IconDriverLicense";
158
- import IconHealthCard from "./svg/IconHealthCard";
159
- import IconDocPaymentCode from "./svg/IconDocPaymentCode";
160
- import IconNotes from "./svg/IconNotes";
161
- import IconEntityCode from "./svg/IconEntityCode";
162
- import IconFolder from "./svg/IconFolder";
163
- import IconReceiptOn from "./svg/IconReceiptOn";
164
- import IconFingerprint from "./svg/IconFingerprint";
165
- import IconAddSmall from "./svg/IconAddSmall";
166
- import IconArchiveFilled from "./svg/IconArchiveFilled";
167
- import IconCode from "./svg/IconCode";
168
- import IconCompare from "./svg/IconCompare";
169
- import IconCreditCardOff from "./svg/IconCreditCardOff";
170
- import IconDeviceVibration from "./svg/IconDeviceVibration";
171
- import IconDocPaymentTitle from "./svg/IconDocPaymentTitle";
172
- import IconDocGiacenza from "./svg/IconDocGiacenza";
173
- import IconExternalLinkSmall from "./svg/IconExternalLinkSmall";
174
- import IconFamilySharing from "./svg/IconFamilySharing";
175
- import IconFilterOniOS from "./svg/IconFilterOniOS";
176
- import IconFilterOffiOS from "./svg/IconFilterOffiOS";
177
- import IconFilterAndroid from "./svg/IconFilterAndroid";
178
- import IconForward from "./svg/IconForward";
179
- import IconHearthEmpty from "./svg/IconHearthEmpty";
180
- import IconHearthFilled from "./svg/IconHearthFilled";
181
- import IconInboxEmpty from "./svg/IconInboxEmpty";
182
- import IconInboxFilled from "./svg/IconInboxFilled";
183
- import IconInstruction from "./svg/IconInstruction";
184
- import IconTerms from "./svg/IconTerms";
185
- import IconKeyboardDown from "./svg/IconKeyboardDown";
186
- import IconMapPin from "./svg/IconMapPin";
187
- import IconNoticePlain from "./svg/IconNoticePlain";
188
- import IconPrint from "./svg/IconPrint";
189
- import IconRead from "./svg/IconRead";
190
- import IconReceiptOff from "./svg/IconReceiptOff";
191
- import IconSignal from "./svg/IconSignal";
192
- import IconTouch from "./svg/IconTouch";
193
- import IconSparkles from "./svg/IconSparkles";
194
195
 
195
196
  export const IOIcons = {
196
197
  spid: IconSpid,
@@ -381,7 +382,8 @@ export const IOIcons = {
381
382
  systemSettingsiOS: IconSystemSettingsiOS,
382
383
  systemToggleInstructions: IconSystemToggleInstructions,
383
384
  systemAppsAndroid: IconSystemAppsAndroid,
384
- systemNotificationsInstructions: IconSystemNotificationsInstructions
385
+ systemNotificationsInstructions: IconSystemNotificationsInstructions,
386
+ systemPermissionsAndroid: IconSystemPermissionsAndroid
385
387
  } as const;
386
388
 
387
389
  export type IOIcons = keyof typeof IOIcons;
@@ -649,7 +651,8 @@ const {
649
651
  systemSettingsiOS,
650
652
  systemToggleInstructions,
651
653
  systemAppsAndroid,
652
- systemNotificationsInstructions
654
+ systemNotificationsInstructions,
655
+ systemPermissionsAndroid
653
656
  } = IOIcons;
654
657
 
655
658
  export const IOSystemIcons = {
@@ -657,7 +660,8 @@ export const IOSystemIcons = {
657
660
  systemSettingsiOS,
658
661
  systemToggleInstructions,
659
662
  systemAppsAndroid,
660
- systemNotificationsInstructions
663
+ systemNotificationsInstructions,
664
+ systemPermissionsAndroid
661
665
  } as const;
662
666
 
663
667
  export type IOSystemIcons = keyof typeof IOSystemIcons;
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { Path, Rect, Svg } from "react-native-svg";
3
+ import { SVGIconProps } from "../Icon";
4
+
5
+ const IconSystemPermissionsAndroid = ({
6
+ size,
7
+ style,
8
+ ...props
9
+ }: SVGIconProps) => (
10
+ <Svg width={size} height={size} viewBox="0 0 24 24" style={style} {...props}>
11
+ <Rect width={size} height={size} fill="#636B82" rx="8" />
12
+ <Path
13
+ d="M12 15.75C12.825 15.75 13.5 15.075 13.5 14.25C13.5 13.425 12.825 12.75 12 12.75C11.175 12.75 10.5 13.425 10.5 14.25C10.5 15.075 11.175 15.75 12 15.75ZM16.5 9H15.75V7.5C15.75 5.43 14.07 3.75 12 3.75C9.93 3.75 8.25 5.43 8.25 7.5H9.675C9.675 6.2175 10.7175 5.175 12 5.175C13.2825 5.175 14.325 6.2175 14.325 7.5V9H7.5C6.675 9 6 9.675 6 10.5V18C6 18.825 6.675 19.5 7.5 19.5H16.5C17.325 19.5 18 18.825 18 18V10.5C18 9.675 17.325 9 16.5 9ZM16.5 18H7.5V10.5H16.5V18Z"
14
+ fill="#FFFFFF"
15
+ />
16
+ </Svg>
17
+ );
18
+
19
+ export default IconSystemPermissionsAndroid;
@@ -16,6 +16,7 @@ export * from "./logos";
16
16
  export * from "./loadingSpinner";
17
17
  export * from "./modules";
18
18
  export * from "./numberpad";
19
+ export * from "./otpInput";
19
20
  export * from "./pictograms";
20
21
  export * from "./radio";
21
22
  export * from "./spacer";
@@ -0,0 +1,210 @@
1
+ import React, {
2
+ useCallback,
3
+ useEffect,
4
+ useMemo,
5
+ useRef,
6
+ useState
7
+ } from "react";
8
+ import {
9
+ LayoutChangeEvent,
10
+ NativeScrollEvent,
11
+ NativeSyntheticEvent,
12
+ ScrollView,
13
+ ScrollViewProps,
14
+ StyleSheet
15
+ } from "react-native";
16
+ import { ScaleInOutAnimation } from "../common/ScaleInOutAnimation";
17
+ import { IOSpringValues, IOVisualCostants } from "../../core";
18
+ import { IconButtonSolid } from "../buttons";
19
+
20
+ type ForceScrollDownViewProps = {
21
+ /**
22
+ * The content to display inside the scroll view.
23
+ */
24
+ children: React.ReactNode;
25
+ /**
26
+ * The distance from the bottom of the scrollable content at which the "scroll to bottom" button
27
+ * should become hidden. Defaults to 100.
28
+ */
29
+ threshold?: number;
30
+ /**
31
+ * A callback that will be called whenever the scroll view crosses the threshold. The callback
32
+ * is passed a boolean indicating whether the threshold has been crossed (`true`) or not (`false`).
33
+ */
34
+ onThresholdCrossed?: (crossed: boolean) => void;
35
+ } & Pick<
36
+ ScrollViewProps,
37
+ "style" | "contentContainerStyle" | "scrollEnabled" | "testID"
38
+ >;
39
+
40
+ /**
41
+ * A React Native component that displays a scroll view with a button that scrolls to the bottom of the content
42
+ * when pressed. The button is hidden when the scroll view reaches a certain threshold from the bottom, which is
43
+ * configurable by the `threshold` prop. The button, and the scrolling, can also be disabled by setting the
44
+ * `scrollEnabled` prop to `false`.
45
+ */
46
+ const ForceScrollDownView = ({
47
+ children,
48
+ threshold = 100,
49
+ style,
50
+ contentContainerStyle,
51
+ scrollEnabled = true,
52
+ onThresholdCrossed
53
+ }: ForceScrollDownViewProps) => {
54
+ const scrollViewRef = useRef<ScrollView>(null);
55
+
56
+ /**
57
+ * The height of the scroll view, used to determine whether or not the scrollable content fits inside
58
+ * the scroll view and whether the "scroll to bottom" button should be displayed.
59
+ */
60
+ const [scrollViewHeight, setScrollViewHeight] = useState<number>();
61
+
62
+ /**
63
+ * The height of the scrollable content, used to determine whether or not the "scroll to bottom" button
64
+ * should be displayed.
65
+ */
66
+ const [contentHeight, setContentHeight] = useState<number>();
67
+
68
+ /**
69
+ * Whether or not the scroll view has crossed the threshold from the bottom.
70
+ */
71
+ const [isThresholdCrossed, setThresholdCrossed] = useState(false);
72
+
73
+ /**
74
+ * Whether or not the "scroll to bottom" button should be visible. This is controlled by the threshold
75
+ * and the current scroll position.
76
+ */
77
+ const [isButtonVisible, setButtonVisible] = useState(true);
78
+
79
+ /**
80
+ * A callback that is called whenever the scroll view is scrolled. It checks whether or not the
81
+ * scroll view has crossed the threshold from the bottom and updates the state accordingly.
82
+ * The callback is designed to updatr button visibility only when crossing the threshold.
83
+ */
84
+ const handleScroll = useCallback(
85
+ (event: NativeSyntheticEvent<NativeScrollEvent>) => {
86
+ const { layoutMeasurement, contentOffset, contentSize } =
87
+ event.nativeEvent;
88
+
89
+ const thresholdCrossed =
90
+ layoutMeasurement.height + contentOffset.y >=
91
+ contentSize.height - threshold;
92
+
93
+ setThresholdCrossed(previousState => {
94
+ if (!previousState && thresholdCrossed) {
95
+ setButtonVisible(false);
96
+ }
97
+ if (previousState && !thresholdCrossed) {
98
+ setButtonVisible(true);
99
+ }
100
+ return thresholdCrossed;
101
+ });
102
+ },
103
+ [threshold]
104
+ );
105
+
106
+ /**
107
+ * A side effect that calls the `onThresholdCrossed` callback whenever the value of `isThresholdCrossed` changes.
108
+ */
109
+ useEffect(() => {
110
+ onThresholdCrossed?.(isThresholdCrossed);
111
+ }, [onThresholdCrossed, isThresholdCrossed]);
112
+
113
+ /**
114
+ * A callback that is called whenever the size of the scrollable content changes. It updates the
115
+ * state with the new content height.
116
+ */
117
+ const handleContentSizeChange = useCallback(
118
+ (_contentWidth: number, contentHeight: number) => {
119
+ setContentHeight(contentHeight);
120
+ },
121
+ []
122
+ );
123
+
124
+ /**
125
+ * A callback that is called whenever the size of the scroll view changes. It updates the state
126
+ * with the new scroll view height.
127
+ */
128
+ const handleLayout = useCallback((event: LayoutChangeEvent) => {
129
+ setScrollViewHeight(event.nativeEvent.layout.height);
130
+ }, []);
131
+
132
+ /**
133
+ * A callback that is called when the "scroll to bottom" button is pressed. It scrolls the
134
+ * scroll view to the bottom and hides the button.
135
+ */
136
+ const handleScrollDownPress = useCallback(() => {
137
+ setButtonVisible(false);
138
+ scrollViewRef.current?.scrollToEnd();
139
+ }, [scrollViewRef]);
140
+
141
+ /**
142
+ * Whether or not the "scroll to bottom" button needs to be displayed. It is only displayed
143
+ * when the scrollable content cannot fit inside the scroll view and the button is enabled
144
+ * (`scrollEnabled` is `true`).
145
+ */
146
+ const needsScroll = useMemo(
147
+ () =>
148
+ scrollViewHeight != null &&
149
+ contentHeight != null &&
150
+ scrollViewHeight < contentHeight,
151
+ [scrollViewHeight, contentHeight]
152
+ );
153
+
154
+ /**
155
+ * Whether or not to render the "scroll to bottom" button. It is only rendered when the scroll view
156
+ * is enabled, needs to be scrolled, and the button is visible (`isButtonVisible` is `true`).
157
+ */
158
+ const shouldRenderScrollButton =
159
+ scrollEnabled && needsScroll && isButtonVisible;
160
+
161
+ /**
162
+ * The "scroll to bottom" button component. It is wrapped in a reanimated view and has enter and exit
163
+ * animations applied to it.
164
+ */
165
+ const scrollDownButton = (
166
+ <ScaleInOutAnimation
167
+ springConfig={IOSpringValues.button}
168
+ style={styles.scrollDownButton}
169
+ visible={shouldRenderScrollButton}
170
+ >
171
+ <IconButtonSolid
172
+ testID={"ScrollDownButton"}
173
+ accessibilityLabel="Scroll to bottom"
174
+ icon="arrowBottom"
175
+ onPress={handleScrollDownPress}
176
+ />
177
+ </ScaleInOutAnimation>
178
+ );
179
+
180
+ return (
181
+ <>
182
+ <ScrollView
183
+ testID={"ScrollView"}
184
+ ref={scrollViewRef}
185
+ scrollIndicatorInsets={{ right: 1 }}
186
+ scrollEnabled={scrollEnabled}
187
+ onScroll={handleScroll}
188
+ scrollEventThrottle={400}
189
+ style={style}
190
+ onLayout={handleLayout}
191
+ onContentSizeChange={handleContentSizeChange}
192
+ contentContainerStyle={contentContainerStyle}
193
+ >
194
+ {children}
195
+ </ScrollView>
196
+ {scrollDownButton}
197
+ </>
198
+ );
199
+ };
200
+
201
+ const styles = StyleSheet.create({
202
+ scrollDownButton: {
203
+ position: "absolute",
204
+ zIndex: 10,
205
+ right: IOVisualCostants.scrollDownButtonRight,
206
+ bottom: IOVisualCostants.scrollDownButtonBottom
207
+ }
208
+ });
209
+
210
+ export { ForceScrollDownView };
@@ -85,7 +85,7 @@ export const HeaderFirstLevel = ({
85
85
  <H3
86
86
  style={{ flexShrink: 1 }}
87
87
  numberOfLines={1}
88
- color={backgroundColor === "dark" ? "white" : undefined}
88
+ color={backgroundColor === "dark" ? "white" : "black"}
89
89
  >
90
90
  {title}
91
91
  </H3>
@@ -94,7 +94,7 @@ export const HeaderFirstLevel = ({
94
94
  <>
95
95
  <IconButton
96
96
  {...thirdAction}
97
- color={backgroundColor === "dark" ? "contrast" : "neutral"}
97
+ color={backgroundColor === "dark" ? "contrast" : "primary"}
98
98
  />
99
99
  {/* Ideally, with the "gap" flex property,
100
100
  we can get rid of these ugly constructs */}
@@ -105,7 +105,7 @@ export const HeaderFirstLevel = ({
105
105
  <>
106
106
  <IconButton
107
107
  {...secondAction}
108
- color={backgroundColor === "dark" ? "contrast" : "neutral"}
108
+ color={backgroundColor === "dark" ? "contrast" : "primary"}
109
109
  />
110
110
  {/* Same as above */}
111
111
  <HSpacer size={16} />
@@ -114,7 +114,7 @@ export const HeaderFirstLevel = ({
114
114
  {type !== "base" && (
115
115
  <IconButton
116
116
  {...firstAction}
117
- color={backgroundColor === "dark" ? "contrast" : "neutral"}
117
+ color={backgroundColor === "dark" ? "contrast" : "primary"}
118
118
  />
119
119
  )}
120
120
  </View>