@pagopa/io-app-design-system 1.25.0 → 1.26.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 (213) hide show
  1. package/lib/commonjs/components/accordion/AccordionItem.js +1 -0
  2. package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
  3. package/lib/commonjs/components/alert/Alert.js +3 -2
  4. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  5. package/lib/commonjs/components/avatar/Avatar.js +2 -1
  6. package/lib/commonjs/components/avatar/Avatar.js.map +1 -1
  7. package/lib/commonjs/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -0
  8. package/lib/commonjs/components/badge/Badge.js +1 -0
  9. package/lib/commonjs/components/badge/Badge.js.map +1 -1
  10. package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
  11. package/lib/commonjs/components/banner/Banner.js +2 -2
  12. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  13. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
  14. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js +3 -2
  15. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
  16. package/lib/commonjs/components/buttons/ButtonLink.js +5 -1
  17. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  18. package/lib/commonjs/components/buttons/ButtonOutline.js +6 -3
  19. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  20. package/lib/commonjs/components/buttons/ButtonSolid.js +4 -1
  21. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  22. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
  23. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +4 -2
  24. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
  25. package/lib/commonjs/components/divider/Divider.js +1 -1
  26. package/lib/commonjs/components/divider/Divider.js.map +1 -1
  27. package/lib/commonjs/components/layout/GradientBottomActions.js +25 -5
  28. package/lib/commonjs/components/layout/GradientBottomActions.js.map +1 -1
  29. package/lib/commonjs/components/layout/GradientScrollView.js +1 -1
  30. package/lib/commonjs/components/layout/HeaderFirstLevel.js +12 -1
  31. package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
  32. package/lib/commonjs/components/layout/HeaderSecondLevel.js +21 -6
  33. package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
  34. package/lib/commonjs/components/layout/ModalBSHeader.js +73 -0
  35. package/lib/commonjs/components/layout/ModalBSHeader.js.map +1 -0
  36. package/lib/commonjs/components/layout/index.js +11 -0
  37. package/lib/commonjs/components/layout/index.js.map +1 -1
  38. package/lib/commonjs/components/listitems/ListItemAction.js +2 -1
  39. package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
  40. package/lib/commonjs/components/listitems/ListItemCheckbox.js +8 -0
  41. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  42. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -0
  43. package/lib/commonjs/components/otpInput/BoxedInput.js +2 -1
  44. package/lib/commonjs/components/otpInput/BoxedInput.js.map +1 -1
  45. package/lib/commonjs/components/pictograms/Pictogram.js +15 -15
  46. package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
  47. package/lib/commonjs/components/switch/NativeSwitch.js +5 -0
  48. package/lib/commonjs/components/switch/NativeSwitch.js.map +1 -1
  49. package/lib/commonjs/components/tabs/TabItem.js +4 -3
  50. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  51. package/lib/commonjs/components/tag/Tag.js +6 -5
  52. package/lib/commonjs/components/tag/Tag.js.map +1 -1
  53. package/lib/commonjs/components/textInput/TextInputBase.js +1 -0
  54. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  55. package/lib/commonjs/components/toast/ToastNotification.js +1 -0
  56. package/lib/commonjs/components/toast/ToastNotification.js.map +1 -1
  57. package/lib/commonjs/core/IOColors.js +1 -18
  58. package/lib/commonjs/core/IOColors.js.map +1 -1
  59. package/lib/commonjs/core/IOSpacing.js.map +1 -1
  60. package/lib/commonjs/core/IOStyles.js +2 -0
  61. package/lib/commonjs/core/IOStyles.js.map +1 -1
  62. package/lib/commonjs/core/IOThemeContextProvider.js +42 -0
  63. package/lib/commonjs/core/IOThemeContextProvider.js.map +1 -0
  64. package/lib/commonjs/core/index.js +11 -0
  65. package/lib/commonjs/core/index.js.map +1 -1
  66. package/lib/module/components/accordion/AccordionItem.js +1 -0
  67. package/lib/module/components/accordion/AccordionItem.js.map +1 -1
  68. package/lib/module/components/alert/Alert.js +3 -2
  69. package/lib/module/components/alert/Alert.js.map +1 -1
  70. package/lib/module/components/avatar/Avatar.js +2 -1
  71. package/lib/module/components/avatar/Avatar.js.map +1 -1
  72. package/lib/module/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -0
  73. package/lib/module/components/badge/Badge.js +1 -0
  74. package/lib/module/components/badge/Badge.js.map +1 -1
  75. package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
  76. package/lib/module/components/banner/Banner.js +2 -2
  77. package/lib/module/components/banner/Banner.js.map +1 -1
  78. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
  79. package/lib/module/components/buttons/ButtonExtendedOutline.js +3 -2
  80. package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
  81. package/lib/module/components/buttons/ButtonLink.js +5 -1
  82. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  83. package/lib/module/components/buttons/ButtonOutline.js +6 -3
  84. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  85. package/lib/module/components/buttons/ButtonSolid.js +4 -1
  86. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  87. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
  88. package/lib/module/components/checkbox/AnimatedCheckbox.js +4 -2
  89. package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
  90. package/lib/module/components/divider/Divider.js +2 -2
  91. package/lib/module/components/divider/Divider.js.map +1 -1
  92. package/lib/module/components/layout/BlockButtons.js.map +1 -1
  93. package/lib/module/components/layout/GradientBottomActions.js +26 -6
  94. package/lib/module/components/layout/GradientBottomActions.js.map +1 -1
  95. package/lib/module/components/layout/GradientScrollView.js +1 -1
  96. package/lib/module/components/layout/HeaderFirstLevel.js +13 -2
  97. package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
  98. package/lib/module/components/layout/HeaderSecondLevel.js +22 -7
  99. package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
  100. package/lib/module/components/layout/ModalBSHeader.js +65 -0
  101. package/lib/module/components/layout/ModalBSHeader.js.map +1 -0
  102. package/lib/module/components/layout/index.js +1 -0
  103. package/lib/module/components/layout/index.js.map +1 -1
  104. package/lib/module/components/listitems/ListItemAction.js +2 -1
  105. package/lib/module/components/listitems/ListItemAction.js.map +1 -1
  106. package/lib/module/components/listitems/ListItemCheckbox.js +8 -0
  107. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  108. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -0
  109. package/lib/module/components/otpInput/BoxedInput.js +3 -2
  110. package/lib/module/components/otpInput/BoxedInput.js.map +1 -1
  111. package/lib/module/components/pictograms/Pictogram.js +1 -1
  112. package/lib/module/components/pictograms/Pictogram.js.map +1 -1
  113. package/lib/module/components/switch/NativeSwitch.js +5 -0
  114. package/lib/module/components/switch/NativeSwitch.js.map +1 -1
  115. package/lib/module/components/tabs/TabItem.js +4 -3
  116. package/lib/module/components/tabs/TabItem.js.map +1 -1
  117. package/lib/module/components/tag/Tag.js +6 -5
  118. package/lib/module/components/tag/Tag.js.map +1 -1
  119. package/lib/module/components/textInput/TextInputBase.js +1 -0
  120. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  121. package/lib/module/components/toast/ToastNotification.js +1 -0
  122. package/lib/module/components/toast/ToastNotification.js.map +1 -1
  123. package/lib/module/core/IOColors.js +0 -12
  124. package/lib/module/core/IOColors.js.map +1 -1
  125. package/lib/module/core/IOSpacing.js.map +1 -1
  126. package/lib/module/core/IOStyles.js +2 -0
  127. package/lib/module/core/IOStyles.js.map +1 -1
  128. package/lib/module/core/IOThemeContextProvider.js +30 -0
  129. package/lib/module/core/IOThemeContextProvider.js.map +1 -0
  130. package/lib/module/core/index.js +1 -0
  131. package/lib/module/core/index.js.map +1 -1
  132. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  133. package/lib/typescript/components/avatar/Avatar.d.ts.map +1 -1
  134. package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
  135. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  136. package/lib/typescript/components/buttons/ButtonExtendedOutline.d.ts.map +1 -1
  137. package/lib/typescript/components/buttons/ButtonLink.d.ts +11 -2
  138. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  139. package/lib/typescript/components/buttons/ButtonOutline.d.ts +12 -2
  140. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  141. package/lib/typescript/components/buttons/ButtonSolid.d.ts +28 -2
  142. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  143. package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts.map +1 -1
  144. package/lib/typescript/components/layout/BlockButtons.d.ts +2 -2
  145. package/lib/typescript/components/layout/BlockButtons.d.ts.map +1 -1
  146. package/lib/typescript/components/layout/GradientBottomActions.d.ts.map +1 -1
  147. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
  148. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
  149. package/lib/typescript/components/layout/ModalBSHeader.d.ts +16 -0
  150. package/lib/typescript/components/layout/ModalBSHeader.d.ts.map +1 -0
  151. package/lib/typescript/components/layout/index.d.ts +1 -0
  152. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  153. package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
  154. package/lib/typescript/components/listitems/ListItemCheckbox.d.ts +1 -1
  155. package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
  156. package/lib/typescript/components/otpInput/BoxedInput.d.ts.map +1 -1
  157. package/lib/typescript/components/pictograms/Pictogram.d.ts +1 -1
  158. package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
  159. package/lib/typescript/components/switch/NativeSwitch.d.ts +1 -1
  160. package/lib/typescript/components/switch/NativeSwitch.d.ts.map +1 -1
  161. package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
  162. package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
  163. package/lib/typescript/components/textInput/TextInputBase.d.ts +3 -3
  164. package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
  165. package/lib/typescript/components/toast/ToastNotification.d.ts.map +1 -1
  166. package/lib/typescript/core/IOColors.d.ts +0 -7
  167. package/lib/typescript/core/IOColors.d.ts.map +1 -1
  168. package/lib/typescript/core/IOSpacing.d.ts +1 -1
  169. package/lib/typescript/core/IOSpacing.d.ts.map +1 -1
  170. package/lib/typescript/core/IOStyles.d.ts +2 -0
  171. package/lib/typescript/core/IOStyles.d.ts.map +1 -1
  172. package/lib/typescript/core/IOThemeContextProvider.d.ts +21 -0
  173. package/lib/typescript/core/IOThemeContextProvider.d.ts.map +1 -0
  174. package/lib/typescript/core/index.d.ts +1 -0
  175. package/lib/typescript/core/index.d.ts.map +1 -1
  176. package/package.json +2 -1
  177. package/src/components/accordion/AccordionItem.tsx +1 -0
  178. package/src/components/alert/Alert.tsx +3 -2
  179. package/src/components/avatar/Avatar.tsx +2 -1
  180. package/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -0
  181. package/src/components/badge/Badge.tsx +1 -0
  182. package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
  183. package/src/components/banner/Banner.tsx +4 -4
  184. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
  185. package/src/components/buttons/ButtonExtendedOutline.tsx +3 -2
  186. package/src/components/buttons/ButtonLink.tsx +25 -13
  187. package/src/components/buttons/ButtonOutline.tsx +172 -159
  188. package/src/components/buttons/ButtonSolid.tsx +26 -15
  189. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
  190. package/src/components/checkbox/AnimatedCheckbox.tsx +4 -2
  191. package/src/components/divider/Divider.tsx +2 -2
  192. package/src/components/layout/BlockButtons.tsx +2 -2
  193. package/src/components/layout/GradientBottomActions.tsx +22 -8
  194. package/src/components/layout/GradientScrollView.tsx +1 -1
  195. package/src/components/layout/HeaderFirstLevel.tsx +23 -8
  196. package/src/components/layout/HeaderSecondLevel.tsx +40 -15
  197. package/src/components/layout/ModalBSHeader.tsx +92 -0
  198. package/src/components/layout/index.tsx +1 -0
  199. package/src/components/listitems/ListItemAction.tsx +1 -0
  200. package/src/components/listitems/ListItemCheckbox.tsx +8 -0
  201. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -0
  202. package/src/components/otpInput/BoxedInput.tsx +3 -2
  203. package/src/components/pictograms/Pictogram.tsx +1 -6
  204. package/src/components/switch/NativeSwitch.tsx +10 -1
  205. package/src/components/tabs/TabItem.tsx +4 -3
  206. package/src/components/tag/Tag.tsx +7 -6
  207. package/src/components/textInput/TextInputBase.tsx +4 -3
  208. package/src/components/toast/ToastNotification.tsx +1 -0
  209. package/src/core/IOColors.ts +1 -11
  210. package/src/core/IOSpacing.ts +2 -1
  211. package/src/core/IOStyles.ts +2 -0
  212. package/src/core/IOThemeContextProvider.tsx +50 -0
  213. package/src/core/index.ts +1 -0
@@ -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]}
@@ -56,6 +56,7 @@ export const ListItemCheckbox = ({
56
56
  description,
57
57
  icon,
58
58
  selected,
59
+ accessibilityLabel,
59
60
  disabled,
60
61
  onValueChange
61
62
  }: OwnProps) => {
@@ -128,6 +129,13 @@ export const ListItemCheckbox = ({
128
129
  onPressOut={handlePressOut}
129
130
  onTouchEnd={handlePressOut}
130
131
  testID="ListItemCheckbox"
132
+ accessible={true}
133
+ accessibilityLabel={accessibilityLabel}
134
+ accessibilityRole="checkbox"
135
+ accessibilityState={{
136
+ checked: selected ?? toggleValue,
137
+ disabled: !!disabled
138
+ }}
131
139
  disabled={disabled}
132
140
  >
133
141
  <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",
@@ -1765,6 +1767,7 @@ exports[`Test List Item Components ListItemAction Snapshot 1`] = `
1765
1767
  onTouchEnd={[Function]}
1766
1768
  >
1767
1769
  <View
1770
+ importantForAccessibility="no-hide-descendants"
1768
1771
  style={
1769
1772
  [
1770
1773
  {
@@ -1868,6 +1871,7 @@ exports[`Test List Item Components ListItemIDP Snapshot 1`] = `
1868
1871
  "alignItems": "center",
1869
1872
  "backgroundColor": "#FFFFFF",
1870
1873
  "borderColor": "#E8EBF1",
1874
+ "borderCurve": "continuous",
1871
1875
  "borderRadius": 8,
1872
1876
  "borderWidth": 1,
1873
1877
  "flexDirection": "row",
@@ -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";
@@ -6,7 +6,14 @@ import { IOSwitchVisualParams } from "../../core/IOStyles";
6
6
 
7
7
  type OwnProps = Pick<
8
8
  SwitchProps,
9
- "onValueChange" | "value" | "accessible" | "accessibilityLabel"
9
+ | "onValueChange"
10
+ | "value"
11
+ | "accessible"
12
+ | "accessibilityLabel"
13
+ | "testID"
14
+ | "disabled"
15
+ | "accessibilityElementsHidden"
16
+ | "importantForAccessibility"
10
17
  >;
11
18
 
12
19
  // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
@@ -35,6 +42,8 @@ export const NativeSwitch = ({
35
42
  return (
36
43
  <Switch
37
44
  {...accessibility}
45
+ accessibilityRole="switch"
46
+ accessibilityState={{ checked: value, disabled: accessibility.disabled }}
38
47
  trackColor={trackColorComponent}
39
48
  thumbColor={IOColors[IOSwitchVisualParams.bgCircle]}
40
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>;
@@ -162,6 +162,7 @@ export const IOButtonStyles = StyleSheet.create({
162
162
  /* Legacy visual properties. They will be replaced with
163
163
  dynamic ones once NativeBase is gone */
164
164
  borderRadius: btnBorderRadius,
165
+ borderCurve: "continuous",
165
166
  paddingHorizontal: 24,
166
167
  // Reset default visual parameters
167
168
  elevation: 0
@@ -288,6 +289,7 @@ export const IOModuleStyles = StyleSheet.create({
288
289
  borderWidth: 1,
289
290
  borderColor: IOColors["grey-100"],
290
291
  borderRadius: IOModuleIDPRadius,
292
+ borderCurve: "continuous",
291
293
  backgroundColor: IOColors.white,
292
294
  flexDirection: "row",
293
295
  justifyContent: "space-between",
@@ -0,0 +1,50 @@
1
+ import { constVoid } from "fp-ts/function";
2
+ import React from "react";
3
+ import { Appearance } from "react-native";
4
+ import { IOTheme, IOThemeDark, IOThemeLight } from "./IOColors";
5
+
6
+ export const IOThemes = { light: IOThemeLight, dark: IOThemeDark };
7
+ type IOThemeType = keyof typeof IOThemes;
8
+
9
+ type IOThemeContextType = {
10
+ themeType: IOThemeType;
11
+ theme: IOTheme;
12
+ setTheme: (theme: IOThemeType) => void;
13
+ };
14
+
15
+ export const IOThemeContext: React.Context<IOThemeContextType> =
16
+ React.createContext<IOThemeContextType>({
17
+ themeType: Appearance.getColorScheme() === "dark" ? "dark" : "light",
18
+ theme:
19
+ Appearance.getColorScheme() === "dark" ? IOThemes.dark : IOThemes.light,
20
+ setTheme: constVoid
21
+ });
22
+
23
+ export const useIOThemeContext = () => React.useContext(IOThemeContext);
24
+
25
+ export const useIOTheme = () => useIOThemeContext().theme;
26
+
27
+ type IOThemeContextProviderProps = {
28
+ theme?: IOThemeType;
29
+ };
30
+
31
+ export const IOThemeContextProvider = ({
32
+ children,
33
+ theme
34
+ }: React.PropsWithChildren<IOThemeContextProviderProps>) => {
35
+ const [currentTheme, setCurrentTheme] = React.useState<IOThemeType>(
36
+ theme ?? "light"
37
+ );
38
+
39
+ return (
40
+ <IOThemeContext.Provider
41
+ value={{
42
+ themeType: currentTheme,
43
+ theme: IOThemes[currentTheme],
44
+ setTheme: setCurrentTheme
45
+ }}
46
+ >
47
+ {children}
48
+ </IOThemeContext.Provider>
49
+ );
50
+ };
package/src/core/index.ts CHANGED
@@ -6,3 +6,4 @@ export * from "./IOShapes";
6
6
  export * from "./IOSpacing";
7
7
  export * from "./IOStyleVariables";
8
8
  export * from "./IODSExperimentalContextProvider";
9
+ export * from "./IOThemeContextProvider";