@pagopa/io-app-design-system 1.30.0 → 1.31.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 (106) hide show
  1. package/lib/commonjs/components/avatar/Avatar.js +2 -0
  2. package/lib/commonjs/components/avatar/Avatar.js.map +1 -1
  3. package/lib/commonjs/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +4 -0
  4. package/lib/commonjs/components/buttons/ButtonSolid.js +4 -2
  5. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  6. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +0 -2
  7. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +3 -2
  8. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
  9. package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js +11 -7
  10. package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
  11. package/lib/commonjs/components/checkbox/CheckboxLabel.js +5 -0
  12. package/lib/commonjs/components/checkbox/CheckboxLabel.js.map +1 -1
  13. package/lib/commonjs/components/image/Image.js +3 -1
  14. package/lib/commonjs/components/image/Image.js.map +1 -1
  15. package/lib/commonjs/components/listitems/ListItemNav.js +2 -1
  16. package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
  17. package/lib/commonjs/components/listitems/ListItemRadio.js +6 -0
  18. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  19. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -4
  20. package/lib/commonjs/components/logos/LogoPaymentCard.js +7 -2
  21. package/lib/commonjs/components/logos/LogoPaymentCard.js.map +1 -1
  22. package/lib/commonjs/components/modules/ModuleIDP.js +1 -0
  23. package/lib/commonjs/components/modules/ModuleIDP.js.map +1 -1
  24. package/lib/commonjs/components/radio/AnimatedRadio.js +1 -0
  25. package/lib/commonjs/components/radio/AnimatedRadio.js.map +1 -1
  26. package/lib/commonjs/components/radio/RadioButtonLabel.js +8 -3
  27. package/lib/commonjs/components/radio/RadioButtonLabel.js.map +1 -1
  28. package/lib/commonjs/components/switch/AnimatedSwitch.js +3 -2
  29. package/lib/commonjs/components/switch/AnimatedSwitch.js.map +1 -1
  30. package/lib/commonjs/components/switch/SwitchLabel.js +7 -2
  31. package/lib/commonjs/components/switch/SwitchLabel.js.map +1 -1
  32. package/lib/commonjs/components/textInput/TextInputBase.js +13 -10
  33. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  34. package/lib/commonjs/core/IOStyles.js +1 -1
  35. package/lib/commonjs/core/IOStyles.js.map +1 -1
  36. package/lib/module/components/avatar/Avatar.js +2 -0
  37. package/lib/module/components/avatar/Avatar.js.map +1 -1
  38. package/lib/module/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +4 -0
  39. package/lib/module/components/buttons/ButtonSolid.js +4 -2
  40. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  41. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +0 -2
  42. package/lib/module/components/checkbox/AnimatedCheckbox.js +3 -2
  43. package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
  44. package/lib/module/components/checkbox/AnimatedMessageCheckbox.js +11 -7
  45. package/lib/module/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
  46. package/lib/module/components/checkbox/CheckboxLabel.js +5 -0
  47. package/lib/module/components/checkbox/CheckboxLabel.js.map +1 -1
  48. package/lib/module/components/image/Image.js +3 -1
  49. package/lib/module/components/image/Image.js.map +1 -1
  50. package/lib/module/components/listitems/ListItemNav.js +2 -1
  51. package/lib/module/components/listitems/ListItemNav.js.map +1 -1
  52. package/lib/module/components/listitems/ListItemRadio.js +6 -0
  53. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  54. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -4
  55. package/lib/module/components/logos/LogoPaymentCard.js +9 -4
  56. package/lib/module/components/logos/LogoPaymentCard.js.map +1 -1
  57. package/lib/module/components/modules/ModuleIDP.js +1 -0
  58. package/lib/module/components/modules/ModuleIDP.js.map +1 -1
  59. package/lib/module/components/radio/AnimatedRadio.js +1 -0
  60. package/lib/module/components/radio/AnimatedRadio.js.map +1 -1
  61. package/lib/module/components/radio/RadioButtonLabel.js +8 -3
  62. package/lib/module/components/radio/RadioButtonLabel.js.map +1 -1
  63. package/lib/module/components/switch/AnimatedSwitch.js +5 -4
  64. package/lib/module/components/switch/AnimatedSwitch.js.map +1 -1
  65. package/lib/module/components/switch/SwitchLabel.js +7 -2
  66. package/lib/module/components/switch/SwitchLabel.js.map +1 -1
  67. package/lib/module/components/textInput/TextInputBase.js +14 -11
  68. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  69. package/lib/module/core/IOStyles.js +1 -1
  70. package/lib/module/core/IOStyles.js.map +1 -1
  71. package/lib/typescript/components/avatar/Avatar.d.ts.map +1 -1
  72. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  73. package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts.map +1 -1
  74. package/lib/typescript/components/checkbox/AnimatedMessageCheckbox.d.ts.map +1 -1
  75. package/lib/typescript/components/checkbox/CheckboxLabel.d.ts.map +1 -1
  76. package/lib/typescript/components/image/Image.d.ts.map +1 -1
  77. package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
  78. package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
  79. package/lib/typescript/components/logos/LogoPaymentCard.d.ts +5 -3
  80. package/lib/typescript/components/logos/LogoPaymentCard.d.ts.map +1 -1
  81. package/lib/typescript/components/modules/ModuleIDP.d.ts.map +1 -1
  82. package/lib/typescript/components/radio/AnimatedRadio.d.ts.map +1 -1
  83. package/lib/typescript/components/radio/RadioButtonLabel.d.ts.map +1 -1
  84. package/lib/typescript/components/switch/AnimatedSwitch.d.ts.map +1 -1
  85. package/lib/typescript/components/switch/SwitchLabel.d.ts.map +1 -1
  86. package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
  87. package/package.json +3 -2
  88. package/src/components/avatar/Avatar.tsx +2 -0
  89. package/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +4 -0
  90. package/src/components/buttons/ButtonSolid.tsx +3 -1
  91. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +0 -2
  92. package/src/components/checkbox/AnimatedCheckbox.tsx +2 -1
  93. package/src/components/checkbox/AnimatedMessageCheckbox.tsx +9 -7
  94. package/src/components/checkbox/CheckboxLabel.tsx +5 -0
  95. package/src/components/image/Image.tsx +6 -1
  96. package/src/components/listitems/ListItemNav.tsx +2 -1
  97. package/src/components/listitems/ListItemRadio.tsx +10 -1
  98. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -4
  99. package/src/components/logos/LogoPaymentCard.tsx +15 -6
  100. package/src/components/modules/ModuleIDP.tsx +5 -1
  101. package/src/components/radio/AnimatedRadio.tsx +1 -0
  102. package/src/components/radio/RadioButtonLabel.tsx +7 -2
  103. package/src/components/switch/AnimatedSwitch.tsx +9 -8
  104. package/src/components/switch/SwitchLabel.tsx +6 -1
  105. package/src/components/textInput/TextInputBase.tsx +16 -13
  106. package/src/core/IOStyles.ts +1 -1
@@ -49,13 +49,18 @@ export const RadioButtonLabel = ({
49
49
 
50
50
  return (
51
51
  <Pressable
52
- disabled={disabled}
52
+ accessibilityRole="radio"
53
+ accessibilityState={{
54
+ checked: checked ?? toggleValue,
55
+ disabled: !!disabled
56
+ }}
53
57
  onPress={toggleRadioButton}
54
- testID="AnimatedRadioButton"
55
58
  style={{
56
59
  alignSelf: "flex-start",
57
60
  opacity: disabled ? DISABLED_OPACITY : 1
58
61
  }}
62
+ disabled={disabled}
63
+ testID="AnimatedRadioButton"
59
64
  >
60
65
  <View
61
66
  style={[
@@ -1,18 +1,18 @@
1
1
  import React, { useEffect } from "react";
2
- import { StyleSheet, Pressable, PressableProps } from "react-native";
2
+ import { Pressable, PressableProps, StyleSheet } from "react-native";
3
3
  import Animated, {
4
- useSharedValue,
5
- useAnimatedStyle,
4
+ Easing,
6
5
  interpolate,
6
+ interpolateColor,
7
+ useAnimatedStyle,
8
+ useSharedValue,
7
9
  withSpring,
8
- withTiming,
9
- Easing,
10
- interpolateColor
10
+ withTiming
11
11
  } from "react-native-reanimated";
12
- import { IOColors } from "../../core/IOColors";
13
12
  import { IOSpringValues } from "../../core/IOAnimations";
14
- import { AnimatedTick } from "../common/AnimatedTick";
13
+ import { IOColors } from "../../core/IOColors";
15
14
  import { IOSwitchVisualParams } from "../../core/IOStyles";
15
+ import { AnimatedTick } from "../common/AnimatedTick";
16
16
 
17
17
  type Props = {
18
18
  checked?: boolean;
@@ -106,6 +106,7 @@ export const AnimatedSwitch = ({ checked, onPress, disabled }: OwnProps) => {
106
106
 
107
107
  return (
108
108
  <Pressable
109
+ accessibilityRole="switch"
109
110
  disabled={disabled}
110
111
  testID="AnimatedSwitch"
111
112
  onPress={onPress}
@@ -78,11 +78,16 @@ export const SwitchLabel = ({
78
78
  <Pressable
79
79
  disabled={disabled}
80
80
  onPress={toggleCheckbox}
81
- testID="AnimatedCheckbox"
81
+ accessibilityRole="switch"
82
+ accessibilityState={{
83
+ checked: checked ?? toggleValue,
84
+ disabled: !!disabled
85
+ }}
82
86
  style={{
83
87
  alignSelf: "flex-start",
84
88
  opacity: disabled ? DISABLED_OPACITY : 1
85
89
  }}
90
+ testID="SwitchLabel"
86
91
  >
87
92
  <View
88
93
  style={[
@@ -9,6 +9,7 @@ import {
9
9
  } from "react-native";
10
10
  import Animated, {
11
11
  Easing,
12
+ WithTimingConfig,
12
13
  useAnimatedStyle,
13
14
  useSharedValue,
14
15
  withTiming
@@ -17,7 +18,8 @@ import {
17
18
  IOColors,
18
19
  IOSpacingScale,
19
20
  IOStyles,
20
- useIOExperimentalDesign
21
+ useIOExperimentalDesign,
22
+ useIOTheme
21
23
  } from "../../core";
22
24
  import { makeFontStyleObject } from "../../utils/fonts";
23
25
  import { RNTextInputProps, getInputPropsByType } from "../../utils/textInput";
@@ -161,6 +163,8 @@ export const TextInputBase = ({
161
163
  isPassword,
162
164
  autoFocus
163
165
  }: InputTextProps) => {
166
+ const theme = useIOTheme();
167
+
164
168
  const labelSharedValue = useSharedValue<boolean>(false);
165
169
  const [inputStatus, setInputStatus] = React.useState<InputStatus>(
166
170
  disabled ? "disabled" : "initial"
@@ -177,7 +181,7 @@ export const TextInputBase = ({
177
181
  const boxStyle: ViewStyle = useMemo(() => {
178
182
  if (inputStatus === "focused") {
179
183
  return {
180
- borderColor: IOColors["blueIO-500"],
184
+ borderColor: IOColors[theme["interactiveElem-default"]],
181
185
  borderWidth: 2
182
186
  };
183
187
  }
@@ -191,20 +195,17 @@ export const TextInputBase = ({
191
195
  borderColor: IOColors["grey-200"],
192
196
  borderWidth: 1
193
197
  };
194
- }, [inputStatus]);
198
+ }, [inputStatus, theme]);
199
+
200
+ const easingConf: WithTimingConfig = {
201
+ duration: 300,
202
+ easing: Easing.elastic(0.85)
203
+ };
195
204
 
196
205
  const animatedLabelProps = useAnimatedStyle(() => ({
197
- fontSize: withTiming(labelSharedValue.value ? 12 : 16, {
198
- duration: 300,
199
- easing: Easing.elastic(0.85)
200
- }),
206
+ fontSize: withTiming(labelSharedValue.value ? 12 : 16, easingConf),
201
207
  transform: [
202
- {
203
- translateY: withTiming(labelSharedValue.value ? -14 : 0, {
204
- duration: 300,
205
- easing: Easing.elastic(0.85)
206
- })
207
- }
208
+ { translateY: withTiming(labelSharedValue.value ? -14 : 0, easingConf) }
208
209
  ]
209
210
  }));
210
211
 
@@ -294,6 +295,8 @@ export const TextInputBase = ({
294
295
  labelSharedValue.value = true;
295
296
  onFocus?.();
296
297
  }}
298
+ selectionColor={IOColors[theme["interactiveElem-default"]]} // Caret iOS
299
+ cursorColor={IOColors[theme["interactiveElem-default"]]} // Caret Android
297
300
  maxLength={counterLimit}
298
301
  onBlur={onBlurHandler}
299
302
  value={inputValue}
@@ -370,7 +370,7 @@ export const IOSelectionListItemVisualParams: IOSelectionListItemVisualParams =
370
370
  paddingHorizontal: IOVisualCostants.appMarginDefault,
371
371
  iconMargin: 8,
372
372
  iconSize: 24,
373
- actionMargin: 16,
373
+ actionMargin: 8,
374
374
  descriptionMargin: 4
375
375
  };
376
376