@pagopa/io-app-design-system 5.12.1 → 6.0.0-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 (74) hide show
  1. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +68 -2
  2. package/lib/commonjs/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +285 -9
  3. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +700 -33
  4. package/lib/commonjs/components/claimsSelector/ClaimsSelector.js +41 -23
  5. package/lib/commonjs/components/claimsSelector/ClaimsSelector.js.map +1 -1
  6. package/lib/commonjs/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +554 -188
  7. package/lib/commonjs/components/headers/HeaderFirstLevel.js +1 -1
  8. package/lib/commonjs/components/headers/HeaderFirstLevel.js.map +1 -1
  9. package/lib/commonjs/components/headers/HeaderSecondLevel.js +3 -2
  10. package/lib/commonjs/components/headers/HeaderSecondLevel.js.map +1 -1
  11. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +925 -41
  12. package/lib/commonjs/components/loadingSpinner/LoadingSpinner.js +14 -18
  13. package/lib/commonjs/components/loadingSpinner/LoadingSpinner.js.map +1 -1
  14. package/lib/commonjs/components/modules/__test__/__snapshots__/ModuleNavigationAlt.test.tsx.snap +304 -8
  15. package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +430 -32
  16. package/lib/commonjs/components/templates/Dismissable.js +6 -1
  17. package/lib/commonjs/components/templates/Dismissable.js.map +1 -1
  18. package/lib/commonjs/components/templates/ForceScrollDownView.js +5 -4
  19. package/lib/commonjs/components/templates/ForceScrollDownView.js.map +1 -1
  20. package/lib/commonjs/hooks/useAccordionAnimation.js +9 -1
  21. package/lib/commonjs/hooks/useAccordionAnimation.js.map +1 -1
  22. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +68 -2
  23. package/lib/module/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +285 -9
  24. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +700 -33
  25. package/lib/module/components/claimsSelector/ClaimsSelector.js +42 -24
  26. package/lib/module/components/claimsSelector/ClaimsSelector.js.map +1 -1
  27. package/lib/module/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +554 -188
  28. package/lib/module/components/headers/HeaderFirstLevel.js +2 -2
  29. package/lib/module/components/headers/HeaderFirstLevel.js.map +1 -1
  30. package/lib/module/components/headers/HeaderSecondLevel.js +4 -3
  31. package/lib/module/components/headers/HeaderSecondLevel.js.map +1 -1
  32. package/lib/module/components/layout/FooterActions.js.map +1 -1
  33. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +925 -41
  34. package/lib/module/components/loadingSpinner/LoadingSpinner.js +15 -19
  35. package/lib/module/components/loadingSpinner/LoadingSpinner.js.map +1 -1
  36. package/lib/module/components/modules/__test__/__snapshots__/ModuleNavigationAlt.test.tsx.snap +304 -8
  37. package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +430 -32
  38. package/lib/module/components/templates/Dismissable.js +7 -2
  39. package/lib/module/components/templates/Dismissable.js.map +1 -1
  40. package/lib/module/components/templates/ForceScrollDownView.js +6 -5
  41. package/lib/module/components/templates/ForceScrollDownView.js.map +1 -1
  42. package/lib/module/hooks/useAccordionAnimation.js +10 -2
  43. package/lib/module/hooks/useAccordionAnimation.js.map +1 -1
  44. package/lib/typescript/components/claimsSelector/ClaimsSelector.d.ts +7 -1
  45. package/lib/typescript/components/claimsSelector/ClaimsSelector.d.ts.map +1 -1
  46. package/lib/typescript/components/headers/HeaderSecondLevel.d.ts.map +1 -1
  47. package/lib/typescript/components/icons/Icon.d.ts +5 -1
  48. package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
  49. package/lib/typescript/components/layout/FooterActions.d.ts +3 -3
  50. package/lib/typescript/components/layout/FooterActions.d.ts.map +1 -1
  51. package/lib/typescript/components/loadingSpinner/LoadingSpinner.d.ts.map +1 -1
  52. package/lib/typescript/components/templates/Dismissable.d.ts.map +1 -1
  53. package/lib/typescript/components/templates/ForceScrollDownView.d.ts +1 -1
  54. package/lib/typescript/components/templates/ForceScrollDownView.d.ts.map +1 -1
  55. package/lib/typescript/components/typography/IOText.d.ts +1 -1
  56. package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
  57. package/lib/typescript/hooks/useAccordionAnimation.d.ts +4 -0
  58. package/lib/typescript/hooks/useAccordionAnimation.d.ts.map +1 -1
  59. package/package.json +7 -5
  60. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +68 -2
  61. package/src/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +285 -9
  62. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +700 -33
  63. package/src/components/claimsSelector/ClaimsSelector.tsx +56 -37
  64. package/src/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +554 -188
  65. package/src/components/headers/HeaderFirstLevel.tsx +2 -2
  66. package/src/components/headers/HeaderSecondLevel.tsx +4 -4
  67. package/src/components/layout/FooterActions.tsx +3 -3
  68. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +925 -41
  69. package/src/components/loadingSpinner/LoadingSpinner.tsx +20 -24
  70. package/src/components/modules/__test__/__snapshots__/ModuleNavigationAlt.test.tsx.snap +304 -8
  71. package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +430 -32
  72. package/src/components/templates/Dismissable.tsx +5 -2
  73. package/src/components/templates/ForceScrollDownView.tsx +7 -8
  74. package/src/hooks/useAccordionAnimation.tsx +13 -1
@@ -1,5 +1,12 @@
1
- import React, { useEffect, useRef } from "react";
2
- import { View, Animated, Easing, ColorValue } from "react-native";
1
+ import React, { useEffect } from "react";
2
+ import { View, ColorValue } from "react-native";
3
+ import Animated, {
4
+ useSharedValue,
5
+ useAnimatedStyle,
6
+ withRepeat,
7
+ withTiming,
8
+ Easing
9
+ } from "react-native-reanimated";
3
10
  import Svg, { Defs, G, LinearGradient, Path, Stop } from "react-native-svg";
4
11
  import { WithTestID } from "../../utils/types";
5
12
  import { useIOTheme } from "../../context";
@@ -34,25 +41,23 @@ export const LoadingSpinner = ({
34
41
  testID = "LoadingSpinnerTestID"
35
42
  }: LoadingSpinner): React.ReactElement => {
36
43
  const theme = useIOTheme();
37
- const rotationDegree = useRef(new Animated.Value(0)).current;
44
+ const rotation = useSharedValue(0);
38
45
  const stroke: number = strokeMap[size];
39
46
 
40
47
  const color = customColor ?? IOColors[theme["interactiveElem-default"]];
41
48
 
42
49
  useEffect(() => {
43
- const animation = Animated.loop(
44
- Animated.timing(rotationDegree, {
45
- toValue: 360,
46
- duration: durationMs,
47
- easing: Easing.linear,
48
- useNativeDriver: true
49
- })
50
+ // eslint-disable-next-line functional/immutable-data
51
+ rotation.value = withRepeat(
52
+ withTiming(360, { duration: durationMs, easing: Easing.linear }),
53
+ -1,
54
+ false
50
55
  );
56
+ }, [durationMs, rotation]);
51
57
 
52
- animation.start();
53
-
54
- return () => animation.stop();
55
- }, [durationMs, rotationDegree, theme]);
58
+ const animatedStyle = useAnimatedStyle(() => ({
59
+ transform: [{ rotateZ: `${rotation.value}deg` }]
60
+ }));
56
61
 
57
62
  return (
58
63
  <View
@@ -65,16 +70,7 @@ export const LoadingSpinner = ({
65
70
  >
66
71
  <Animated.View
67
72
  testID={"LoadingSpinnerAnimatedTestID"}
68
- style={{
69
- transform: [
70
- {
71
- rotateZ: rotationDegree.interpolate({
72
- inputRange: [0, 360],
73
- outputRange: ["0deg", "360deg"]
74
- })
75
- }
76
- ]
77
- }}
73
+ style={animatedStyle}
78
74
  >
79
75
  {/* Thanks to Ben Ilegbodu for the article on how to
80
76
  create a a SVG gradient loading spinner. Below is
@@ -174,6 +174,43 @@ exports[`ModuleNavigationAlt - Snapshot (Experimental Enabled) Title + Subtitle
174
174
  onTouchEnd={[Function]}
175
175
  >
176
176
  <View
177
+ collapsable={false}
178
+ jestAnimatedProps={
179
+ {
180
+ "value": {},
181
+ }
182
+ }
183
+ jestAnimatedStyle={
184
+ {
185
+ "value": {
186
+ "transform": [
187
+ {
188
+ "scale": 1,
189
+ },
190
+ ],
191
+ },
192
+ }
193
+ }
194
+ jestInlineStyle={
195
+ [
196
+ {
197
+ "alignItems": "center",
198
+ "borderColor": "#E8EBF1",
199
+ "borderCurve": "continuous",
200
+ "borderRadius": 8,
201
+ "borderWidth": 1,
202
+ "flexDirection": "row",
203
+ "justifyContent": "space-between",
204
+ "paddingHorizontal": 16,
205
+ "paddingVertical": 16,
206
+ },
207
+ {
208
+ "borderColor": "#E8EBF1",
209
+ },
210
+ false,
211
+ ]
212
+ }
213
+ nativeID="5"
177
214
  style={
178
215
  [
179
216
  {
@@ -194,7 +231,7 @@ exports[`ModuleNavigationAlt - Snapshot (Experimental Enabled) Title + Subtitle
194
231
  {
195
232
  "transform": [
196
233
  {
197
- "scale": undefined,
234
+ "scale": 1,
198
235
  },
199
236
  ],
200
237
  },
@@ -391,6 +428,43 @@ exports[`ModuleNavigationAlt - Snapshot (Experimental Enabled) Title only + chev
391
428
  onTouchEnd={[Function]}
392
429
  >
393
430
  <View
431
+ collapsable={false}
432
+ jestAnimatedProps={
433
+ {
434
+ "value": {},
435
+ }
436
+ }
437
+ jestAnimatedStyle={
438
+ {
439
+ "value": {
440
+ "transform": [
441
+ {
442
+ "scale": 1,
443
+ },
444
+ ],
445
+ },
446
+ }
447
+ }
448
+ jestInlineStyle={
449
+ [
450
+ {
451
+ "alignItems": "center",
452
+ "borderColor": "#E8EBF1",
453
+ "borderCurve": "continuous",
454
+ "borderRadius": 8,
455
+ "borderWidth": 1,
456
+ "flexDirection": "row",
457
+ "justifyContent": "space-between",
458
+ "paddingHorizontal": 16,
459
+ "paddingVertical": 16,
460
+ },
461
+ {
462
+ "borderColor": "#E8EBF1",
463
+ },
464
+ false,
465
+ ]
466
+ }
467
+ nativeID="4"
394
468
  style={
395
469
  [
396
470
  {
@@ -411,7 +485,7 @@ exports[`ModuleNavigationAlt - Snapshot (Experimental Enabled) Title only + chev
411
485
  {
412
486
  "transform": [
413
487
  {
414
- "scale": undefined,
488
+ "scale": 1,
415
489
  },
416
490
  ],
417
491
  },
@@ -645,6 +719,43 @@ exports[`ModuleNavigationAlt - Snapshot (Experimental Enabled) With Badge (badge
645
719
  onTouchEnd={[Function]}
646
720
  >
647
721
  <View
722
+ collapsable={false}
723
+ jestAnimatedProps={
724
+ {
725
+ "value": {},
726
+ }
727
+ }
728
+ jestAnimatedStyle={
729
+ {
730
+ "value": {
731
+ "transform": [
732
+ {
733
+ "scale": 1,
734
+ },
735
+ ],
736
+ },
737
+ }
738
+ }
739
+ jestInlineStyle={
740
+ [
741
+ {
742
+ "alignItems": "center",
743
+ "borderColor": "#E8EBF1",
744
+ "borderCurve": "continuous",
745
+ "borderRadius": 8,
746
+ "borderWidth": 1,
747
+ "flexDirection": "row",
748
+ "justifyContent": "space-between",
749
+ "paddingHorizontal": 16,
750
+ "paddingVertical": 16,
751
+ },
752
+ {
753
+ "borderColor": "#E8EBF1",
754
+ },
755
+ false,
756
+ ]
757
+ }
758
+ nativeID="6"
648
759
  style={
649
760
  [
650
761
  {
@@ -665,7 +776,7 @@ exports[`ModuleNavigationAlt - Snapshot (Experimental Enabled) With Badge (badge
665
776
  {
666
777
  "transform": [
667
778
  {
668
- "scale": undefined,
779
+ "scale": 1,
669
780
  },
670
781
  ],
671
782
  },
@@ -948,6 +1059,43 @@ exports[`ModuleNavigationAlt - Snapshot (Experimental Enabled) With Image (no ic
948
1059
  onTouchEnd={[Function]}
949
1060
  >
950
1061
  <View
1062
+ collapsable={false}
1063
+ jestAnimatedProps={
1064
+ {
1065
+ "value": {},
1066
+ }
1067
+ }
1068
+ jestAnimatedStyle={
1069
+ {
1070
+ "value": {
1071
+ "transform": [
1072
+ {
1073
+ "scale": 1,
1074
+ },
1075
+ ],
1076
+ },
1077
+ }
1078
+ }
1079
+ jestInlineStyle={
1080
+ [
1081
+ {
1082
+ "alignItems": "center",
1083
+ "borderColor": "#E8EBF1",
1084
+ "borderCurve": "continuous",
1085
+ "borderRadius": 8,
1086
+ "borderWidth": 1,
1087
+ "flexDirection": "row",
1088
+ "justifyContent": "space-between",
1089
+ "paddingHorizontal": 16,
1090
+ "paddingVertical": 16,
1091
+ },
1092
+ {
1093
+ "borderColor": "#E8EBF1",
1094
+ },
1095
+ false,
1096
+ ]
1097
+ }
1098
+ nativeID="7"
951
1099
  style={
952
1100
  [
953
1101
  {
@@ -968,7 +1116,7 @@ exports[`ModuleNavigationAlt - Snapshot (Experimental Enabled) With Image (no ic
968
1116
  {
969
1117
  "transform": [
970
1118
  {
971
- "scale": undefined,
1119
+ "scale": 1,
972
1120
  },
973
1121
  ],
974
1122
  },
@@ -1301,6 +1449,43 @@ exports[`ModuleNavigationAlt - Snapshot Title + Subtitle 1`] = `
1301
1449
  onTouchEnd={[Function]}
1302
1450
  >
1303
1451
  <View
1452
+ collapsable={false}
1453
+ jestAnimatedProps={
1454
+ {
1455
+ "value": {},
1456
+ }
1457
+ }
1458
+ jestAnimatedStyle={
1459
+ {
1460
+ "value": {
1461
+ "transform": [
1462
+ {
1463
+ "scale": 1,
1464
+ },
1465
+ ],
1466
+ },
1467
+ }
1468
+ }
1469
+ jestInlineStyle={
1470
+ [
1471
+ {
1472
+ "alignItems": "center",
1473
+ "borderColor": "#E8EBF1",
1474
+ "borderCurve": "continuous",
1475
+ "borderRadius": 8,
1476
+ "borderWidth": 1,
1477
+ "flexDirection": "row",
1478
+ "justifyContent": "space-between",
1479
+ "paddingHorizontal": 16,
1480
+ "paddingVertical": 16,
1481
+ },
1482
+ {
1483
+ "borderColor": "#E8EBF1",
1484
+ },
1485
+ false,
1486
+ ]
1487
+ }
1488
+ nativeID="1"
1304
1489
  style={
1305
1490
  [
1306
1491
  {
@@ -1321,7 +1506,7 @@ exports[`ModuleNavigationAlt - Snapshot Title + Subtitle 1`] = `
1321
1506
  {
1322
1507
  "transform": [
1323
1508
  {
1324
- "scale": undefined,
1509
+ "scale": 1,
1325
1510
  },
1326
1511
  ],
1327
1512
  },
@@ -1518,6 +1703,43 @@ exports[`ModuleNavigationAlt - Snapshot Title only + chevron (onPress) 1`] = `
1518
1703
  onTouchEnd={[Function]}
1519
1704
  >
1520
1705
  <View
1706
+ collapsable={false}
1707
+ jestAnimatedProps={
1708
+ {
1709
+ "value": {},
1710
+ }
1711
+ }
1712
+ jestAnimatedStyle={
1713
+ {
1714
+ "value": {
1715
+ "transform": [
1716
+ {
1717
+ "scale": 1,
1718
+ },
1719
+ ],
1720
+ },
1721
+ }
1722
+ }
1723
+ jestInlineStyle={
1724
+ [
1725
+ {
1726
+ "alignItems": "center",
1727
+ "borderColor": "#E8EBF1",
1728
+ "borderCurve": "continuous",
1729
+ "borderRadius": 8,
1730
+ "borderWidth": 1,
1731
+ "flexDirection": "row",
1732
+ "justifyContent": "space-between",
1733
+ "paddingHorizontal": 16,
1734
+ "paddingVertical": 16,
1735
+ },
1736
+ {
1737
+ "borderColor": "#E8EBF1",
1738
+ },
1739
+ false,
1740
+ ]
1741
+ }
1742
+ nativeID="0"
1521
1743
  style={
1522
1744
  [
1523
1745
  {
@@ -1538,7 +1760,7 @@ exports[`ModuleNavigationAlt - Snapshot Title only + chevron (onPress) 1`] = `
1538
1760
  {
1539
1761
  "transform": [
1540
1762
  {
1541
- "scale": undefined,
1763
+ "scale": 1,
1542
1764
  },
1543
1765
  ],
1544
1766
  },
@@ -1772,6 +1994,43 @@ exports[`ModuleNavigationAlt - Snapshot With Badge (badge + chevron) 1`] = `
1772
1994
  onTouchEnd={[Function]}
1773
1995
  >
1774
1996
  <View
1997
+ collapsable={false}
1998
+ jestAnimatedProps={
1999
+ {
2000
+ "value": {},
2001
+ }
2002
+ }
2003
+ jestAnimatedStyle={
2004
+ {
2005
+ "value": {
2006
+ "transform": [
2007
+ {
2008
+ "scale": 1,
2009
+ },
2010
+ ],
2011
+ },
2012
+ }
2013
+ }
2014
+ jestInlineStyle={
2015
+ [
2016
+ {
2017
+ "alignItems": "center",
2018
+ "borderColor": "#E8EBF1",
2019
+ "borderCurve": "continuous",
2020
+ "borderRadius": 8,
2021
+ "borderWidth": 1,
2022
+ "flexDirection": "row",
2023
+ "justifyContent": "space-between",
2024
+ "paddingHorizontal": 16,
2025
+ "paddingVertical": 16,
2026
+ },
2027
+ {
2028
+ "borderColor": "#E8EBF1",
2029
+ },
2030
+ false,
2031
+ ]
2032
+ }
2033
+ nativeID="2"
1775
2034
  style={
1776
2035
  [
1777
2036
  {
@@ -1792,7 +2051,7 @@ exports[`ModuleNavigationAlt - Snapshot With Badge (badge + chevron) 1`] = `
1792
2051
  {
1793
2052
  "transform": [
1794
2053
  {
1795
- "scale": undefined,
2054
+ "scale": 1,
1796
2055
  },
1797
2056
  ],
1798
2057
  },
@@ -2075,6 +2334,43 @@ exports[`ModuleNavigationAlt - Snapshot With Image (no icon) + chevron (onPress)
2075
2334
  onTouchEnd={[Function]}
2076
2335
  >
2077
2336
  <View
2337
+ collapsable={false}
2338
+ jestAnimatedProps={
2339
+ {
2340
+ "value": {},
2341
+ }
2342
+ }
2343
+ jestAnimatedStyle={
2344
+ {
2345
+ "value": {
2346
+ "transform": [
2347
+ {
2348
+ "scale": 1,
2349
+ },
2350
+ ],
2351
+ },
2352
+ }
2353
+ }
2354
+ jestInlineStyle={
2355
+ [
2356
+ {
2357
+ "alignItems": "center",
2358
+ "borderColor": "#E8EBF1",
2359
+ "borderCurve": "continuous",
2360
+ "borderRadius": 8,
2361
+ "borderWidth": 1,
2362
+ "flexDirection": "row",
2363
+ "justifyContent": "space-between",
2364
+ "paddingHorizontal": 16,
2365
+ "paddingVertical": 16,
2366
+ },
2367
+ {
2368
+ "borderColor": "#E8EBF1",
2369
+ },
2370
+ false,
2371
+ ]
2372
+ }
2373
+ nativeID="3"
2078
2374
  style={
2079
2375
  [
2080
2376
  {
@@ -2095,7 +2391,7 @@ exports[`ModuleNavigationAlt - Snapshot With Image (no icon) + chevron (onPress)
2095
2391
  {
2096
2392
  "transform": [
2097
2393
  {
2098
- "scale": undefined,
2394
+ "scale": 1,
2099
2395
  },
2100
2396
  ],
2101
2397
  },