@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,106 +1,106 @@
1
1
  import React, { useCallback } from "react";
2
2
  import {
3
- GestureResponderEvent,
4
- Pressable,
5
- StyleSheet,
6
- View
3
+ GestureResponderEvent,
4
+ Pressable,
5
+ StyleSheet,
6
+ View
7
7
  } from "react-native";
8
8
  import Animated, {
9
- Extrapolate,
10
- interpolate,
11
- useAnimatedStyle,
12
- useDerivedValue,
13
- useSharedValue,
14
- withSpring
9
+ Extrapolate,
10
+ interpolate,
11
+ useAnimatedStyle,
12
+ useDerivedValue,
13
+ useSharedValue,
14
+ withSpring
15
15
  } from "react-native-reanimated";
16
16
  import { IOIcons, Icon } from "../icons";
17
17
  import { H4, LabelSmall } from "../typography";
18
18
  import { IOScaleValues, IOSpringValues, IOColors, IOStyles } from "../../core";
19
19
 
20
20
  type Props = {
21
- label: string;
22
- description?: string;
23
- onPress: (event: GestureResponderEvent) => void;
24
- icon?: IOIcons;
21
+ label: string;
22
+ description?: string;
23
+ onPress: (event: GestureResponderEvent) => void;
24
+ icon?: IOIcons;
25
25
  };
26
26
 
27
27
  const styles = StyleSheet.create({
28
- button: {
29
- flex: 1,
30
- flexDirection: "row",
31
- alignItems: "center",
32
- justifyContent: "space-between",
33
- paddingHorizontal: 16,
34
- paddingVertical: 16,
35
- borderRadius: 8,
36
- borderColor: IOColors.bluegreyLight,
37
- backgroundColor: IOColors.white,
38
- borderStyle: "solid",
39
- borderWidth: 1
40
- }
28
+ button: {
29
+ flex: 1,
30
+ flexDirection: "row",
31
+ alignItems: "center",
32
+ justifyContent: "space-between",
33
+ paddingHorizontal: 16,
34
+ paddingVertical: 16,
35
+ borderRadius: 8,
36
+ borderColor: IOColors.bluegreyLight,
37
+ backgroundColor: IOColors.white,
38
+ borderStyle: "solid",
39
+ borderWidth: 1
40
+ }
41
41
  });
42
42
 
43
43
  export const ButtonExtendedOutline = ({
44
- label,
45
- description,
46
- onPress,
47
- icon = "info"
44
+ label,
45
+ description,
46
+ onPress,
47
+ icon = "info"
48
48
  }: Props) => {
49
- const isPressed: Animated.SharedValue<number> = useSharedValue(0);
49
+ const isPressed: Animated.SharedValue<number> = useSharedValue(0);
50
50
 
51
- // Scaling transformation applied when the button is pressed
52
- const animationScaleValue = IOScaleValues?.magnifiedButton?.pressedState;
51
+ // Scaling transformation applied when the button is pressed
52
+ const animationScaleValue = IOScaleValues?.magnifiedButton?.pressedState;
53
53
 
54
- const scaleTraversed = useDerivedValue(() =>
55
- withSpring(isPressed.value, IOSpringValues.button)
56
- );
54
+ const scaleTraversed = useDerivedValue(() =>
55
+ withSpring(isPressed.value, IOSpringValues.button)
56
+ );
57
57
 
58
- // Interpolate animation values from `isPressed` values
59
- const animatedStyle = useAnimatedStyle(() => {
60
- const scale = interpolate(
61
- scaleTraversed.value,
62
- [0, 1],
63
- [1, animationScaleValue],
64
- Extrapolate.CLAMP
65
- );
58
+ // Interpolate animation values from `isPressed` values
59
+ const animatedStyle = useAnimatedStyle(() => {
60
+ const scale = interpolate(
61
+ scaleTraversed.value,
62
+ [0, 1],
63
+ [1, animationScaleValue],
64
+ Extrapolate.CLAMP
65
+ );
66
66
 
67
- return {
68
- transform: [{ scale }]
69
- };
70
- });
67
+ return {
68
+ transform: [{ scale }]
69
+ };
70
+ });
71
71
 
72
- const onPressIn = useCallback(() => {
73
- // eslint-disable-next-line functional/immutable-data
74
- isPressed.value = 1;
75
- }, [isPressed]);
76
- const onPressOut = useCallback(() => {
77
- // eslint-disable-next-line functional/immutable-data
78
- isPressed.value = 0;
79
- }, [isPressed]);
72
+ const onPressIn = useCallback(() => {
73
+ // eslint-disable-next-line functional/immutable-data
74
+ isPressed.value = 1;
75
+ }, [isPressed]);
76
+ const onPressOut = useCallback(() => {
77
+ // eslint-disable-next-line functional/immutable-data
78
+ isPressed.value = 0;
79
+ }, [isPressed]);
80
80
 
81
- return (
82
- <Pressable
83
- onPress={onPress}
84
- onPressIn={onPressIn}
85
- onPressOut={onPressOut}
86
- accessible={true}
87
- accessibilityRole={"button"}
88
- >
89
- <Animated.View style={[styles.button, animatedStyle]}>
90
- <View style={IOStyles.flex}>
91
- <H4>{label}</H4>
92
- {description && (
93
- <LabelSmall weight="Regular" color={"bluegreyDark"}>
94
- {description}
95
- </LabelSmall>
96
- )}
97
- </View>
98
- <View style={{ marginLeft: 8 }}>
99
- <Icon name={icon} color="blue" size={24} />
100
- </View>
101
- </Animated.View>
102
- </Pressable>
103
- );
81
+ return (
82
+ <Pressable
83
+ onPress={onPress}
84
+ onPressIn={onPressIn}
85
+ onPressOut={onPressOut}
86
+ accessible={true}
87
+ accessibilityRole={"button"}
88
+ >
89
+ <Animated.View style={[styles.button, animatedStyle]}>
90
+ <View style={IOStyles.flex}>
91
+ <H4>{label}</H4>
92
+ {description && (
93
+ <LabelSmall weight="Regular" color={"bluegreyDark"}>
94
+ {description}
95
+ </LabelSmall>
96
+ )}
97
+ </View>
98
+ <View style={{ marginLeft: 8 }}>
99
+ <Icon name={icon} color="blue" size={24} />
100
+ </View>
101
+ </Animated.View>
102
+ </Pressable>
103
+ );
104
104
  };
105
105
 
106
106
  export default ButtonExtendedOutline;