@pagopa/io-app-design-system 1.25.1 → 1.27.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 (219) hide show
  1. package/README.md +1 -0
  2. package/lib/commonjs/components/accordion/AccordionItem.js +1 -0
  3. package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
  4. package/lib/commonjs/components/alert/Alert.js +3 -2
  5. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  6. package/lib/commonjs/components/avatar/Avatar.js +18 -11
  7. package/lib/commonjs/components/avatar/Avatar.js.map +1 -1
  8. package/lib/commonjs/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +60 -28
  9. package/lib/commonjs/components/badge/Badge.js +1 -0
  10. package/lib/commonjs/components/badge/Badge.js.map +1 -1
  11. package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
  12. package/lib/commonjs/components/banner/Banner.js +2 -2
  13. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  14. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
  15. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js +3 -2
  16. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
  17. package/lib/commonjs/components/buttons/ButtonLink.js +5 -1
  18. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  19. package/lib/commonjs/components/buttons/ButtonOutline.js +6 -3
  20. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  21. package/lib/commonjs/components/buttons/ButtonSolid.js +4 -1
  22. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  23. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
  24. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +4 -2
  25. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
  26. package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js +4 -3
  27. package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
  28. package/lib/commonjs/components/divider/Divider.js +1 -1
  29. package/lib/commonjs/components/divider/Divider.js.map +1 -1
  30. package/lib/commonjs/components/layout/GradientBottomActions.js +25 -5
  31. package/lib/commonjs/components/layout/GradientBottomActions.js.map +1 -1
  32. package/lib/commonjs/components/layout/GradientScrollView.js +1 -1
  33. package/lib/commonjs/components/layout/HeaderFirstLevel.js +12 -1
  34. package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
  35. package/lib/commonjs/components/layout/HeaderSecondLevel.js +21 -6
  36. package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
  37. package/lib/commonjs/components/layout/ModalBSHeader.js +73 -0
  38. package/lib/commonjs/components/layout/ModalBSHeader.js.map +1 -0
  39. package/lib/commonjs/components/layout/index.js +11 -0
  40. package/lib/commonjs/components/layout/index.js.map +1 -1
  41. package/lib/commonjs/components/listitems/ListItemAction.js +2 -1
  42. package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
  43. package/lib/commonjs/components/listitems/ListItemInfoCopy.js +1 -0
  44. package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
  45. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -0
  46. package/lib/commonjs/components/otpInput/BoxedInput.js +2 -1
  47. package/lib/commonjs/components/otpInput/BoxedInput.js.map +1 -1
  48. package/lib/commonjs/components/pictograms/Pictogram.js +15 -15
  49. package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
  50. package/lib/commonjs/components/switch/NativeSwitch.js +5 -0
  51. package/lib/commonjs/components/switch/NativeSwitch.js.map +1 -1
  52. package/lib/commonjs/components/tabs/TabItem.js +4 -3
  53. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  54. package/lib/commonjs/components/tag/Tag.js +6 -5
  55. package/lib/commonjs/components/tag/Tag.js.map +1 -1
  56. package/lib/commonjs/components/textInput/TextInputBase.js +1 -0
  57. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  58. package/lib/commonjs/components/toast/ToastNotification.js +1 -0
  59. package/lib/commonjs/components/toast/ToastNotification.js.map +1 -1
  60. package/lib/commonjs/core/IOColors.js +1 -18
  61. package/lib/commonjs/core/IOColors.js.map +1 -1
  62. package/lib/commonjs/core/IOSpacing.js.map +1 -1
  63. package/lib/commonjs/core/IOStyles.js +4 -0
  64. package/lib/commonjs/core/IOStyles.js.map +1 -1
  65. package/lib/commonjs/core/IOThemeContextProvider.js +42 -0
  66. package/lib/commonjs/core/IOThemeContextProvider.js.map +1 -0
  67. package/lib/commonjs/core/index.js +11 -0
  68. package/lib/commonjs/core/index.js.map +1 -1
  69. package/lib/module/components/accordion/AccordionItem.js +1 -0
  70. package/lib/module/components/accordion/AccordionItem.js.map +1 -1
  71. package/lib/module/components/alert/Alert.js +3 -2
  72. package/lib/module/components/alert/Alert.js.map +1 -1
  73. package/lib/module/components/avatar/Avatar.js +18 -11
  74. package/lib/module/components/avatar/Avatar.js.map +1 -1
  75. package/lib/module/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +60 -28
  76. package/lib/module/components/badge/Badge.js +1 -0
  77. package/lib/module/components/badge/Badge.js.map +1 -1
  78. package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
  79. package/lib/module/components/banner/Banner.js +2 -2
  80. package/lib/module/components/banner/Banner.js.map +1 -1
  81. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
  82. package/lib/module/components/buttons/ButtonExtendedOutline.js +3 -2
  83. package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
  84. package/lib/module/components/buttons/ButtonLink.js +5 -1
  85. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  86. package/lib/module/components/buttons/ButtonOutline.js +6 -3
  87. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  88. package/lib/module/components/buttons/ButtonSolid.js +4 -1
  89. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  90. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
  91. package/lib/module/components/checkbox/AnimatedCheckbox.js +4 -2
  92. package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
  93. package/lib/module/components/checkbox/AnimatedMessageCheckbox.js +4 -3
  94. package/lib/module/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
  95. package/lib/module/components/divider/Divider.js +2 -2
  96. package/lib/module/components/divider/Divider.js.map +1 -1
  97. package/lib/module/components/layout/BlockButtons.js.map +1 -1
  98. package/lib/module/components/layout/GradientBottomActions.js +26 -6
  99. package/lib/module/components/layout/GradientBottomActions.js.map +1 -1
  100. package/lib/module/components/layout/GradientScrollView.js +1 -1
  101. package/lib/module/components/layout/HeaderFirstLevel.js +13 -2
  102. package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
  103. package/lib/module/components/layout/HeaderSecondLevel.js +22 -7
  104. package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
  105. package/lib/module/components/layout/ModalBSHeader.js +65 -0
  106. package/lib/module/components/layout/ModalBSHeader.js.map +1 -0
  107. package/lib/module/components/layout/index.js +1 -0
  108. package/lib/module/components/layout/index.js.map +1 -1
  109. package/lib/module/components/listitems/ListItemAction.js +2 -1
  110. package/lib/module/components/listitems/ListItemAction.js.map +1 -1
  111. package/lib/module/components/listitems/ListItemInfoCopy.js +1 -0
  112. package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
  113. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -0
  114. package/lib/module/components/otpInput/BoxedInput.js +3 -2
  115. package/lib/module/components/otpInput/BoxedInput.js.map +1 -1
  116. package/lib/module/components/pictograms/Pictogram.js +1 -1
  117. package/lib/module/components/pictograms/Pictogram.js.map +1 -1
  118. package/lib/module/components/switch/NativeSwitch.js +5 -0
  119. package/lib/module/components/switch/NativeSwitch.js.map +1 -1
  120. package/lib/module/components/tabs/TabItem.js +4 -3
  121. package/lib/module/components/tabs/TabItem.js.map +1 -1
  122. package/lib/module/components/tag/Tag.js +6 -5
  123. package/lib/module/components/tag/Tag.js.map +1 -1
  124. package/lib/module/components/textInput/TextInputBase.js +1 -0
  125. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  126. package/lib/module/components/toast/ToastNotification.js +1 -0
  127. package/lib/module/components/toast/ToastNotification.js.map +1 -1
  128. package/lib/module/core/IOColors.js +0 -12
  129. package/lib/module/core/IOColors.js.map +1 -1
  130. package/lib/module/core/IOSpacing.js.map +1 -1
  131. package/lib/module/core/IOStyles.js +4 -0
  132. package/lib/module/core/IOStyles.js.map +1 -1
  133. package/lib/module/core/IOThemeContextProvider.js +30 -0
  134. package/lib/module/core/IOThemeContextProvider.js.map +1 -0
  135. package/lib/module/core/index.js +1 -0
  136. package/lib/module/core/index.js.map +1 -1
  137. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  138. package/lib/typescript/components/avatar/Avatar.d.ts +6 -2
  139. package/lib/typescript/components/avatar/Avatar.d.ts.map +1 -1
  140. package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
  141. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  142. package/lib/typescript/components/buttons/ButtonExtendedOutline.d.ts.map +1 -1
  143. package/lib/typescript/components/buttons/ButtonLink.d.ts +11 -2
  144. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  145. package/lib/typescript/components/buttons/ButtonOutline.d.ts +12 -2
  146. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  147. package/lib/typescript/components/buttons/ButtonSolid.d.ts +28 -2
  148. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  149. package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts.map +1 -1
  150. package/lib/typescript/components/checkbox/AnimatedMessageCheckbox.d.ts.map +1 -1
  151. package/lib/typescript/components/layout/BlockButtons.d.ts +2 -2
  152. package/lib/typescript/components/layout/BlockButtons.d.ts.map +1 -1
  153. package/lib/typescript/components/layout/GradientBottomActions.d.ts.map +1 -1
  154. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
  155. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
  156. package/lib/typescript/components/layout/ModalBSHeader.d.ts +16 -0
  157. package/lib/typescript/components/layout/ModalBSHeader.d.ts.map +1 -0
  158. package/lib/typescript/components/layout/index.d.ts +1 -0
  159. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  160. package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
  161. package/lib/typescript/components/listitems/ListItemInfoCopy.d.ts.map +1 -1
  162. package/lib/typescript/components/otpInput/BoxedInput.d.ts.map +1 -1
  163. package/lib/typescript/components/pictograms/Pictogram.d.ts +1 -1
  164. package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
  165. package/lib/typescript/components/switch/NativeSwitch.d.ts.map +1 -1
  166. package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
  167. package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
  168. package/lib/typescript/components/textInput/TextInputBase.d.ts +3 -3
  169. package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
  170. package/lib/typescript/components/toast/ToastNotification.d.ts.map +1 -1
  171. package/lib/typescript/core/IOColors.d.ts +0 -7
  172. package/lib/typescript/core/IOColors.d.ts.map +1 -1
  173. package/lib/typescript/core/IOSpacing.d.ts +1 -1
  174. package/lib/typescript/core/IOSpacing.d.ts.map +1 -1
  175. package/lib/typescript/core/IOStyles.d.ts +4 -0
  176. package/lib/typescript/core/IOStyles.d.ts.map +1 -1
  177. package/lib/typescript/core/IOThemeContextProvider.d.ts +21 -0
  178. package/lib/typescript/core/IOThemeContextProvider.d.ts.map +1 -0
  179. package/lib/typescript/core/index.d.ts +1 -0
  180. package/lib/typescript/core/index.d.ts.map +1 -1
  181. package/package.json +3 -1
  182. package/src/components/accordion/AccordionItem.tsx +1 -0
  183. package/src/components/alert/Alert.tsx +3 -2
  184. package/src/components/avatar/Avatar.tsx +33 -20
  185. package/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +60 -28
  186. package/src/components/badge/Badge.tsx +1 -0
  187. package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
  188. package/src/components/banner/Banner.tsx +4 -4
  189. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
  190. package/src/components/buttons/ButtonExtendedOutline.tsx +3 -2
  191. package/src/components/buttons/ButtonLink.tsx +25 -13
  192. package/src/components/buttons/ButtonOutline.tsx +172 -159
  193. package/src/components/buttons/ButtonSolid.tsx +26 -15
  194. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
  195. package/src/components/checkbox/AnimatedCheckbox.tsx +4 -2
  196. package/src/components/checkbox/AnimatedMessageCheckbox.tsx +4 -3
  197. package/src/components/divider/Divider.tsx +2 -2
  198. package/src/components/layout/BlockButtons.tsx +2 -2
  199. package/src/components/layout/GradientBottomActions.tsx +22 -8
  200. package/src/components/layout/GradientScrollView.tsx +1 -1
  201. package/src/components/layout/HeaderFirstLevel.tsx +23 -8
  202. package/src/components/layout/HeaderSecondLevel.tsx +40 -15
  203. package/src/components/layout/ModalBSHeader.tsx +92 -0
  204. package/src/components/layout/index.tsx +1 -0
  205. package/src/components/listitems/ListItemAction.tsx +1 -0
  206. package/src/components/listitems/ListItemInfoCopy.tsx +1 -0
  207. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -0
  208. package/src/components/otpInput/BoxedInput.tsx +3 -2
  209. package/src/components/pictograms/Pictogram.tsx +1 -6
  210. package/src/components/switch/NativeSwitch.tsx +2 -0
  211. package/src/components/tabs/TabItem.tsx +4 -3
  212. package/src/components/tag/Tag.tsx +7 -6
  213. package/src/components/textInput/TextInputBase.tsx +4 -3
  214. package/src/components/toast/ToastNotification.tsx +1 -0
  215. package/src/core/IOColors.ts +1 -11
  216. package/src/core/IOSpacing.ts +2 -1
  217. package/src/core/IOStyles.ts +6 -0
  218. package/src/core/IOThemeContextProvider.tsx +50 -0
  219. package/src/core/index.ts +1 -0
@@ -33,13 +33,14 @@ const styles = StyleSheet.create({
33
33
  height: IOVisualCostants.avatarSizeSmall,
34
34
  padding: internalSpacing
35
35
  },
36
- checkBoxCircle: {
36
+ checkBoxShape: {
37
37
  position: "absolute",
38
38
  left: 0,
39
39
  top: 0,
40
40
  width: IOVisualCostants.avatarSizeSmall,
41
41
  height: IOVisualCostants.avatarSizeSmall,
42
- borderRadius: IOVisualCostants.avatarSizeSmall
42
+ borderRadius: IOVisualCostants.avatarRadiusSizeSmall,
43
+ borderCurve: "continuous"
43
44
  }
44
45
  });
45
46
 
@@ -96,7 +97,7 @@ export const AnimatedMessageCheckbox = ({
96
97
  >
97
98
  <Animated.View
98
99
  style={[
99
- styles.checkBoxCircle,
100
+ styles.checkBoxShape,
100
101
  {
101
102
  backgroundColor: backgroundColorProp
102
103
  },
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { View, StyleSheet } from "react-native";
3
- import { IOColors, IOThemeContext } from "../../core";
3
+ import { IOColors, useIOTheme } from "../../core";
4
4
 
5
5
  type DividerOrientation = "vertical" | "horizontal";
6
6
 
@@ -15,7 +15,7 @@ Native `Divider` component
15
15
  @param {DividerOrientation} orientation
16
16
  */
17
17
  const BaseDivider = React.memo(({ orientation }: DividerProps) => {
18
- const theme = React.useContext(IOThemeContext);
18
+ const theme = useIOTheme();
19
19
  const baseStyle = {
20
20
  backgroundColor: IOColors[theme["divider-default"]],
21
21
  ...(orientation === "vertical"
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { View, StyleSheet } from "react-native";
3
3
  import { HSpacer } from "../spacer/Spacer";
4
- import { ButtonOutline, ButtonSolid, ButtonSolidProps } from "../buttons";
4
+ import { ButtonOutline, ButtonSolid } from "../buttons";
5
5
  import { IOStyles } from "../../core";
6
6
 
7
7
  const styles = StyleSheet.create({
@@ -23,7 +23,7 @@ type CommonProps = Readonly<{
23
23
 
24
24
  export type BlockButtonProps = {
25
25
  type: "Solid" | "Outline";
26
- buttonProps: Omit<ButtonSolidProps, "fullWidth">;
26
+ buttonProps: Omit<React.ComponentProps<typeof ButtonSolid>, "fullWidth">;
27
27
  };
28
28
 
29
29
  /**
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
- import { StyleProp, StyleSheet, View, ViewStyle } from "react-native";
2
+ import { Easing, StyleProp, StyleSheet, View, ViewStyle } from "react-native";
3
+ import { easeGradient } from "react-native-easing-gradient";
3
4
  import LinearGradient from "react-native-linear-gradient";
4
5
  import Animated from "react-native-reanimated";
5
6
  import { IOColors, IOSpacer, IOVisualCostants, hexToRgba } from "../../core";
@@ -33,6 +34,15 @@ type GradientBottomActionsDimensions = {
33
34
  // Background color should be app main background (both light and dark themes)
34
35
  const HEADER_BG_COLOR: IOColors = "white";
35
36
 
37
+ const { colors, locations } = easeGradient({
38
+ colorStops: {
39
+ 0: { color: hexToRgba(IOColors[HEADER_BG_COLOR], 0) },
40
+ 1: { color: IOColors[HEADER_BG_COLOR] }
41
+ },
42
+ easing: Easing.ease,
43
+ extraColorStopsPerTransition: 20
44
+ });
45
+
36
46
  const styles = StyleSheet.create({
37
47
  buttonContainer: {
38
48
  paddingHorizontal: IOVisualCostants.appMarginDefault,
@@ -84,14 +94,18 @@ export const GradientBottomActions = ({
84
94
  ]}
85
95
  pointerEvents="none"
86
96
  >
97
+ {/* 100% opacity bg color fills at least 45% of the area */}
87
98
  <LinearGradient
88
- style={{ height: dimensions.gradientAreaHeight }}
89
- // 100% opacity bg color fills at least 50% of the area
90
- locations={[0, 0.5]}
91
- colors={[
92
- hexToRgba(IOColors[HEADER_BG_COLOR], 0),
93
- IOColors[HEADER_BG_COLOR]
94
- ]}
99
+ style={{ height: dimensions.gradientAreaHeight * 0.55 }}
100
+ locations={locations}
101
+ colors={colors}
102
+ />
103
+ <View
104
+ style={{
105
+ bottom: 0,
106
+ height: dimensions.gradientAreaHeight * 0.45,
107
+ backgroundColor: IOColors[HEADER_BG_COLOR]
108
+ }}
95
109
  />
96
110
  </Animated.View>
97
111
 
@@ -28,7 +28,7 @@ export type GradientScrollView = WithTestID<{
28
28
  }>;
29
29
 
30
30
  // Extended gradient area above the actions
31
- export const gradientSafeArea: IOSpacingScale = 80;
31
+ export const gradientSafeArea: IOSpacingScale = 96;
32
32
  // End content margin before the actions
33
33
  const contentEndMargin: IOSpacingScale = 32;
34
34
  // Margin between primary action and secondary one
@@ -1,5 +1,10 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet } from "react-native";
2
+ import {
3
+ View,
4
+ StyleSheet,
5
+ AccessibilityInfo,
6
+ findNodeHandle
7
+ } from "react-native";
3
8
  import { useSafeAreaInsets } from "react-native-safe-area-context";
4
9
  import { WithTestID } from "../../utils/types";
5
10
  import { IOStyles, IOVisualCostants, IOColors } from "../../core";
@@ -67,6 +72,14 @@ export const HeaderFirstLevel = ({
67
72
  secondAction,
68
73
  thirdAction
69
74
  }: HeaderFirstLevel) => {
75
+ const titleRef = React.createRef<View>();
76
+
77
+ React.useLayoutEffect(() => {
78
+ const reactNode = findNodeHandle(titleRef.current);
79
+ if (reactNode !== null) {
80
+ AccessibilityInfo.setAccessibilityFocus(reactNode);
81
+ }
82
+ });
70
83
  const insets = useSafeAreaInsets();
71
84
 
72
85
  return (
@@ -82,13 +95,15 @@ export const HeaderFirstLevel = ({
82
95
  testID={testID}
83
96
  >
84
97
  <View style={styles.headerInner}>
85
- <H3
86
- style={{ flexShrink: 1 }}
87
- numberOfLines={1}
88
- color={backgroundColor === "dark" ? "white" : "black"}
89
- >
90
- {title}
91
- </H3>
98
+ <View ref={titleRef} accessible accessibilityRole="header">
99
+ <H3
100
+ style={{ flexShrink: 1 }}
101
+ numberOfLines={1}
102
+ color={backgroundColor === "dark" ? "white" : "black"}
103
+ >
104
+ {title}
105
+ </H3>
106
+ </View>
92
107
  <View style={[IOStyles.row, { flexShrink: 0 }]}>
93
108
  {type === "threeActions" && (
94
109
  <>
@@ -1,5 +1,11 @@
1
1
  import * as React from "react";
2
- import { View, StyleSheet, Platform } from "react-native";
2
+ import {
3
+ View,
4
+ StyleSheet,
5
+ Platform,
6
+ findNodeHandle,
7
+ AccessibilityInfo
8
+ } from "react-native";
3
9
  import { useSafeAreaInsets } from "react-native-safe-area-context";
4
10
  import Animated, {
5
11
  interpolate,
@@ -89,13 +95,15 @@ const styles = StyleSheet.create({
89
95
  alignItems: "center",
90
96
  justifyContent: "space-between"
91
97
  },
92
- headerTitle: {
93
- fontSize: 14,
94
- textAlign: "center",
98
+ titleContainer: {
95
99
  flexGrow: 1,
96
100
  flexShrink: 1,
97
101
  marginHorizontal: titleHorizontalMargin
98
102
  },
103
+ headerTitle: {
104
+ fontSize: 14,
105
+ textAlign: "center"
106
+ },
99
107
  headerTitleFont: {
100
108
  ...makeFontStyleObject("Regular", false, "ReadexPro")
101
109
  },
@@ -122,9 +130,18 @@ export const HeaderSecondLevel = ({
122
130
  secondAction,
123
131
  thirdAction
124
132
  }: HeaderSecondLevel) => {
133
+ const titleRef = React.createRef<View>();
134
+
125
135
  const { isExperimental } = useIOExperimentalDesign();
126
136
  const insets = useSafeAreaInsets();
127
137
 
138
+ React.useLayoutEffect(() => {
139
+ const reactNode = findNodeHandle(titleRef.current);
140
+ if (reactNode !== null) {
141
+ AccessibilityInfo.setAccessibilityFocus(reactNode);
142
+ }
143
+ });
144
+
128
145
  const headerWrapperAnimatedStyle = useAnimatedStyle(() => ({
129
146
  backgroundColor:
130
147
  transparent && scrollValues
@@ -182,19 +199,27 @@ export const HeaderSecondLevel = ({
182
199
  ) : (
183
200
  <HSpacer size={32} />
184
201
  )}
185
- <Animated.Text
186
- numberOfLines={1}
202
+ <View
203
+ ref={titleRef}
187
204
  accessible={isTitleAccessible}
188
- style={[
189
- styles.headerTitle,
190
- isExperimental
191
- ? styles.headerTitleFont
192
- : styles.headerTitleLegacyFont,
193
- titleAnimatedStyle
194
- ]}
205
+ accessibilityLabel={title}
206
+ accessibilityRole="header"
207
+ style={styles.titleContainer}
195
208
  >
196
- {title}
197
- </Animated.Text>
209
+ <Animated.Text
210
+ numberOfLines={1}
211
+ accessible={false}
212
+ style={[
213
+ styles.headerTitle,
214
+ isExperimental
215
+ ? styles.headerTitleFont
216
+ : styles.headerTitleLegacyFont,
217
+ titleAnimatedStyle
218
+ ]}
219
+ >
220
+ {title}
221
+ </Animated.Text>
222
+ </View>
198
223
  <View style={[IOStyles.row, { flexShrink: 0 }]}>
199
224
  {type === "threeActions" && (
200
225
  <>
@@ -0,0 +1,92 @@
1
+ import * as React from "react";
2
+ import { useLayoutEffect } from "react";
3
+ import {
4
+ View,
5
+ StyleSheet,
6
+ findNodeHandle,
7
+ AccessibilityInfo
8
+ } from "react-native";
9
+ import {
10
+ IOColors,
11
+ IOVisualCostants,
12
+ useIOExperimentalDesign,
13
+ IOStyles
14
+ } from "../../core";
15
+ import { H4 } from "../typography";
16
+ import { IconButton } from "../buttons";
17
+
18
+ const styles = StyleSheet.create({
19
+ container: {
20
+ flexDirection: "row",
21
+ alignItems: "center",
22
+ justifyContent: "space-between",
23
+ paddingHorizontal: IOVisualCostants.appMarginDefault,
24
+ paddingTop: IOVisualCostants.appMarginDefault,
25
+ paddingBottom: IOVisualCostants.appMarginDefault,
26
+ backgroundColor: IOColors.white
27
+ }
28
+ });
29
+
30
+ type Props = {
31
+ title: string | React.ReactNode;
32
+ onClose: () => void;
33
+ closeAccessibilityLabel: string;
34
+ };
35
+
36
+ /**
37
+ * A header for a modals and bottom sheet.
38
+ * @param title - The title of the modal.
39
+ * @param onClose - The function to call when the close button is pressed.
40
+ * @param closeAccessibilityLabel - The accessibility label for the close button.
41
+ *
42
+ */
43
+ export const ModalBSHeader = ({
44
+ title,
45
+ onClose,
46
+ closeAccessibilityLabel
47
+ }: Props) => {
48
+ const { isExperimental } = useIOExperimentalDesign();
49
+ const headerRef = React.createRef<View>();
50
+
51
+ useLayoutEffect(() => {
52
+ const reactNode = findNodeHandle(headerRef.current);
53
+ if (reactNode !== null) {
54
+ AccessibilityInfo.setAccessibilityFocus(reactNode);
55
+ }
56
+ });
57
+
58
+ return (
59
+ <View style={styles.container} ref={headerRef}>
60
+ {React.isValidElement(title) ? (
61
+ title
62
+ ) : (
63
+ <View
64
+ style={IOStyles.flex}
65
+ accessible={true}
66
+ accessibilityRole={"header"}
67
+ accessibilityLabel={typeof title === "string" ? title : undefined}
68
+ >
69
+ <H4>{title}</H4>
70
+ </View>
71
+ )}
72
+ {/* ◀ REMOVE_LEGACY_COMPONENT: Remove the following condition */}
73
+ {isExperimental ? (
74
+ <IconButton
75
+ color="neutral"
76
+ onPress={onClose}
77
+ icon="closeMedium"
78
+ accessibilityLabel={closeAccessibilityLabel}
79
+ />
80
+ ) : (
81
+ <View style={{ opacity: 0.5 }}>
82
+ <IconButton
83
+ color="neutral"
84
+ onPress={onClose}
85
+ icon="closeMedium"
86
+ accessibilityLabel={closeAccessibilityLabel}
87
+ />
88
+ </View>
89
+ )}
90
+ </View>
91
+ );
92
+ };
@@ -6,3 +6,4 @@ export * from "./HeaderSecondLevel";
6
6
  export * from "./ForceScrollDownView";
7
7
  export * from "./FooterWithButtons";
8
8
  export * from "./BlockButtons";
9
+ export * from "./ModalBSHeader";
@@ -177,6 +177,7 @@ export const ListItemAction = ({
177
177
  >
178
178
  <Animated.View
179
179
  style={[IOListItemStyles.listItem, animatedBackgroundStyle]}
180
+ importantForAccessibility="no-hide-descendants"
180
181
  >
181
182
  <Animated.View
182
183
  style={[IOListItemStyles.listItemInner, animatedScaleStyle]}
@@ -125,6 +125,7 @@ export const ListItemInfoCopy = ({
125
125
  testID={testID}
126
126
  >
127
127
  <Animated.View
128
+ importantForAccessibility="no-hide-descendants"
128
129
  style={[IOListItemStyles.listItem, animatedBackgroundStyle]}
129
130
  >
130
131
  <Animated.View
@@ -36,6 +36,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemAction Snapsh
36
36
  onTouchEnd={[Function]}
37
37
  >
38
38
  <View
39
+ importantForAccessibility="no-hide-descendants"
39
40
  style={
40
41
  [
41
42
  {
@@ -139,6 +140,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemIDP Snapshot
139
140
  "alignItems": "center",
140
141
  "backgroundColor": "#FFFFFF",
141
142
  "borderColor": "#E8EBF1",
143
+ "borderCurve": "continuous",
142
144
  "borderRadius": 8,
143
145
  "borderWidth": 1,
144
146
  "flexDirection": "row",
@@ -330,6 +332,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemInfoCopy Snap
330
332
  onStartShouldSetResponder={[Function]}
331
333
  >
332
334
  <View
335
+ importantForAccessibility="no-hide-descendants"
333
336
  style={
334
337
  [
335
338
  {
@@ -1765,6 +1768,7 @@ exports[`Test List Item Components ListItemAction Snapshot 1`] = `
1765
1768
  onTouchEnd={[Function]}
1766
1769
  >
1767
1770
  <View
1771
+ importantForAccessibility="no-hide-descendants"
1768
1772
  style={
1769
1773
  [
1770
1774
  {
@@ -1868,6 +1872,7 @@ exports[`Test List Item Components ListItemIDP Snapshot 1`] = `
1868
1872
  "alignItems": "center",
1869
1873
  "backgroundColor": "#FFFFFF",
1870
1874
  "borderColor": "#E8EBF1",
1875
+ "borderCurve": "continuous",
1871
1876
  "borderRadius": 8,
1872
1877
  "borderWidth": 1,
1873
1878
  "flexDirection": "row",
@@ -2059,6 +2064,7 @@ exports[`Test List Item Components ListItemInfoCopy Snapshot 1`] = `
2059
2064
  onStartShouldSetResponder={[Function]}
2060
2065
  >
2061
2066
  <View
2067
+ importantForAccessibility="no-hide-descendants"
2062
2068
  style={
2063
2069
  [
2064
2070
  {
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useMemo } from "react";
3
- import { View, StyleSheet } from "react-native";
3
+ import { StyleSheet, View } from "react-native";
4
4
  import { IOColors } from "../../core";
5
5
  import { BaseTypography, H6 } from "../typography";
6
6
 
@@ -16,7 +16,8 @@ const styles = StyleSheet.create({
16
16
  justifyContent: "center",
17
17
  width: 35,
18
18
  height: 60,
19
- borderRadius: 8
19
+ borderRadius: 8,
20
+ borderCurve: "continuous"
20
21
  },
21
22
  defaultBox: {
22
23
  borderWidth: 1,
@@ -1,11 +1,6 @@
1
1
  import React, { useMemo } from "react";
2
2
  import { ColorValue } from "react-native";
3
- import {
4
- IOColors,
5
- IOThemeDark,
6
- IOThemeLight,
7
- useIOTheme
8
- } from "../../core/IOColors";
3
+ import { IOColors, IOThemeDark, IOThemeLight, useIOTheme } from "../../core";
9
4
 
10
5
  import PictogramAbacus from "./svg/PictogramAbacus";
11
6
  import PictogramAccessDenied from "./svg/PictogramAccessDenied";
@@ -42,6 +42,8 @@ export const NativeSwitch = ({
42
42
  return (
43
43
  <Switch
44
44
  {...accessibility}
45
+ accessibilityRole="switch"
46
+ accessibilityState={{ checked: value, disabled: accessibility.disabled }}
45
47
  trackColor={trackColorComponent}
46
48
  thumbColor={IOColors[IOSwitchVisualParams.bgCircle]}
47
49
  ios_backgroundColor={
@@ -9,12 +9,12 @@ import Animated, {
9
9
  useSharedValue,
10
10
  withSpring
11
11
  } from "react-native-reanimated";
12
+ import { IOColors, IOScaleValues, IOSpringValues, hexToRgba } from "../../core";
13
+ import { useSpringPressProgressValue } from "../../utils/hooks/useSpringPressProgressValue";
12
14
  import { WithTestID } from "../../utils/types";
13
15
  import { IOIcons, Icon } from "../icons";
14
16
  import { HSpacer } from "../spacer";
15
17
  import { LabelHeader } from "../typography/LabelHeader";
16
- import { IOSpringValues, IOColors, hexToRgba, IOScaleValues } from "../../core";
17
- import { useSpringPressProgressValue } from "../../utils/hooks/useSpringPressProgressValue";
18
18
 
19
19
  type ColorMode = "light" | "dark";
20
20
 
@@ -186,7 +186,8 @@ const styles = StyleSheet.create({
186
186
  alignItems: "center",
187
187
  paddingHorizontal: 16,
188
188
  paddingVertical: 8,
189
- borderRadius: 65,
189
+ borderRadius: 64,
190
+ borderCurve: "continuous",
190
191
  justifyContent: "center",
191
192
  alignSelf: "flex-start"
192
193
  },
@@ -1,16 +1,16 @@
1
- import React from "react";
2
1
  import * as O from "fp-ts/lib/Option";
3
2
  import { pipe } from "fp-ts/lib/function";
4
- import { View, Text, StyleSheet, Platform } from "react-native";
5
- import { WithTestID } from "../../utils/types";
6
- import { makeFontStyleObject } from "../../utils/fonts";
7
- import { IOIconSizeScale, IOIcons, Icon } from "../icons";
3
+ import React from "react";
4
+ import { Platform, StyleSheet, Text, View } from "react-native";
8
5
  import { IOColors, IOTagRadius, useIOExperimentalDesign } from "../../core";
9
6
  import {
10
7
  IOSpacingScale,
11
8
  IOTagHSpacing,
12
9
  IOTagVSpacing
13
10
  } from "../../core/IOSpacing";
11
+ import { makeFontStyleObject } from "../../utils/fonts";
12
+ import { WithTestID } from "../../utils/types";
13
+ import { IOIconSizeScale, IOIcons, Icon } from "../icons";
14
14
 
15
15
  export type Tag = WithTestID<{
16
16
  text?: string;
@@ -80,10 +80,11 @@ const styles = StyleSheet.create({
80
80
  textAlignVertical: "center"
81
81
  }
82
82
  }),
83
- borderWidth: 1,
84
83
  backgroundColor: IOColors.white,
84
+ borderWidth: 1,
85
85
  borderColor: IOColors["grey-100"],
86
86
  borderRadius: IOTagRadius,
87
+ borderCurve: "continuous",
87
88
  paddingHorizontal: IOTagHSpacing,
88
89
  paddingVertical: IOTagVSpacing
89
90
  },
@@ -21,14 +21,14 @@ import {
21
21
  } from "../../core";
22
22
  import { makeFontStyleObject } from "../../utils/fonts";
23
23
  import { RNTextInputProps, getInputPropsByType } from "../../utils/textInput";
24
- import { InputType } from "../../utils/types";
24
+ import { InputType, WithTestID } from "../../utils/types";
25
25
  import { IOIcons, Icon } from "../icons";
26
26
  import { HSpacer } from "../spacer";
27
27
  import { LabelSmall } from "../typography";
28
28
 
29
29
  type InputStatus = "initial" | "focused" | "disabled" | "error";
30
30
 
31
- type InputTextProps = {
31
+ type InputTextProps = WithTestID<{
32
32
  placeholder: string;
33
33
  value: string;
34
34
  onChangeText: (value: string) => void;
@@ -45,7 +45,7 @@ type InputTextProps = {
45
45
  isPassword?: boolean;
46
46
  onBlur?: () => void;
47
47
  onFocus?: () => void;
48
- };
48
+ }>;
49
49
 
50
50
  const inputMarginTop: IOSpacingScale = 8;
51
51
 
@@ -56,6 +56,7 @@ const styles = StyleSheet.create({
56
56
  paddingVertical: 8,
57
57
  height: 60,
58
58
  borderRadius: 8,
59
+ borderCurve: "continuous",
59
60
  paddingHorizontal: 12
60
61
  },
61
62
  textInputStyle: {
@@ -69,6 +69,7 @@ const styles = StyleSheet.create({
69
69
  toast: {
70
70
  borderRadius: IOAlertRadius,
71
71
  borderWidth: 1,
72
+ borderCurve: "continuous",
72
73
  padding: 16,
73
74
  flexDirection: "row",
74
75
  alignItems: "center",
@@ -1,6 +1,5 @@
1
1
  import type { ComponentProps } from "react";
2
- import * as React from "react";
3
- import { Appearance, ColorValue } from "react-native";
2
+ import { ColorValue } from "react-native";
4
3
  import type LinearGradient from "react-native-linear-gradient"; // Used by `getGradientColorValues` function
5
4
 
6
5
  /*
@@ -400,15 +399,6 @@ export const themeStatusColorsDarkMode: Record<
400
399
 
401
400
  export type themeStatusColorsDarkMode = keyof typeof themeStatusColorsDarkMode;
402
401
 
403
- /*
404
- THEME CONTEXT
405
- */
406
- export const IOThemes = { light: IOThemeLight, dark: IOThemeDark };
407
- export const IOThemeContext: React.Context<IOTheme> = React.createContext(
408
- Appearance.getColorScheme() === "dark" ? IOThemes.dark : IOThemes.light
409
- );
410
- export const useIOTheme = () => React.useContext(IOThemeContext);
411
-
412
402
  /*
413
403
  UTILS
414
404
  */
@@ -19,7 +19,8 @@ export type IOSpacingScale =
19
19
  | 56
20
20
  | 64
21
21
  | 72
22
- | 80;
22
+ | 80
23
+ | 96;
23
24
 
24
25
  // Values used in the new `<Spacer>` component
25
26
  export type IOSpacer = Extract<IOSpacingScale, 4 | 8 | 16 | 24 | 32 | 40 | 48>;
@@ -21,6 +21,8 @@ interface IOVisualCostants {
21
21
  // Dimensions
22
22
  avatarSizeSmall: number;
23
23
  avatarSizeMedium: number;
24
+ avatarRadiusSizeSmall: number;
25
+ avatarRadiusSizeMedium: number;
24
26
  iconContainedSizeDefault: number;
25
27
  scrollDownButtonRight: number;
26
28
  scrollDownButtonBottom: number;
@@ -31,6 +33,8 @@ export const IOVisualCostants: IOVisualCostants = {
31
33
  headerHeight: 56,
32
34
  avatarSizeSmall: 44,
33
35
  avatarSizeMedium: 66,
36
+ avatarRadiusSizeSmall: 8,
37
+ avatarRadiusSizeMedium: 12,
34
38
  iconContainedSizeDefault: 44,
35
39
  scrollDownButtonRight: 24,
36
40
  scrollDownButtonBottom: 24
@@ -162,6 +166,7 @@ export const IOButtonStyles = StyleSheet.create({
162
166
  /* Legacy visual properties. They will be replaced with
163
167
  dynamic ones once NativeBase is gone */
164
168
  borderRadius: btnBorderRadius,
169
+ borderCurve: "continuous",
165
170
  paddingHorizontal: 24,
166
171
  // Reset default visual parameters
167
172
  elevation: 0
@@ -288,6 +293,7 @@ export const IOModuleStyles = StyleSheet.create({
288
293
  borderWidth: 1,
289
294
  borderColor: IOColors["grey-100"],
290
295
  borderRadius: IOModuleIDPRadius,
296
+ borderCurve: "continuous",
291
297
  backgroundColor: IOColors.white,
292
298
  flexDirection: "row",
293
299
  justifyContent: "space-between",