@pagopa/io-app-design-system 1.25.1 → 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.
- package/lib/commonjs/components/accordion/AccordionItem.js +1 -0
- package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/alert/Alert.js +3 -2
- package/lib/commonjs/components/alert/Alert.js.map +1 -1
- package/lib/commonjs/components/avatar/Avatar.js +2 -1
- package/lib/commonjs/components/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -0
- package/lib/commonjs/components/badge/Badge.js +1 -0
- package/lib/commonjs/components/badge/Badge.js.map +1 -1
- package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
- package/lib/commonjs/components/banner/Banner.js +2 -2
- package/lib/commonjs/components/banner/Banner.js.map +1 -1
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
- package/lib/commonjs/components/buttons/ButtonExtendedOutline.js +3 -2
- package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonLink.js +5 -1
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +6 -3
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +4 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +4 -2
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/commonjs/components/divider/Divider.js +1 -1
- package/lib/commonjs/components/divider/Divider.js.map +1 -1
- package/lib/commonjs/components/layout/GradientBottomActions.js +25 -5
- package/lib/commonjs/components/layout/GradientBottomActions.js.map +1 -1
- package/lib/commonjs/components/layout/GradientScrollView.js +1 -1
- package/lib/commonjs/components/layout/HeaderFirstLevel.js +12 -1
- package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +21 -6
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/layout/ModalBSHeader.js +73 -0
- package/lib/commonjs/components/layout/ModalBSHeader.js.map +1 -0
- package/lib/commonjs/components/layout/index.js +11 -0
- package/lib/commonjs/components/layout/index.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemAction.js +2 -1
- package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -0
- package/lib/commonjs/components/otpInput/BoxedInput.js +2 -1
- package/lib/commonjs/components/otpInput/BoxedInput.js.map +1 -1
- package/lib/commonjs/components/pictograms/Pictogram.js +15 -15
- package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
- package/lib/commonjs/components/switch/NativeSwitch.js +5 -0
- package/lib/commonjs/components/switch/NativeSwitch.js.map +1 -1
- package/lib/commonjs/components/tabs/TabItem.js +4 -3
- package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
- package/lib/commonjs/components/tag/Tag.js +6 -5
- package/lib/commonjs/components/tag/Tag.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +1 -0
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/toast/ToastNotification.js +1 -0
- package/lib/commonjs/components/toast/ToastNotification.js.map +1 -1
- package/lib/commonjs/core/IOColors.js +1 -18
- package/lib/commonjs/core/IOColors.js.map +1 -1
- package/lib/commonjs/core/IOSpacing.js.map +1 -1
- package/lib/commonjs/core/IOStyles.js +2 -0
- package/lib/commonjs/core/IOStyles.js.map +1 -1
- package/lib/commonjs/core/IOThemeContextProvider.js +42 -0
- package/lib/commonjs/core/IOThemeContextProvider.js.map +1 -0
- package/lib/commonjs/core/index.js +11 -0
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/module/components/accordion/AccordionItem.js +1 -0
- package/lib/module/components/accordion/AccordionItem.js.map +1 -1
- package/lib/module/components/alert/Alert.js +3 -2
- package/lib/module/components/alert/Alert.js.map +1 -1
- package/lib/module/components/avatar/Avatar.js +2 -1
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -0
- package/lib/module/components/badge/Badge.js +1 -0
- package/lib/module/components/badge/Badge.js.map +1 -1
- package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
- package/lib/module/components/banner/Banner.js +2 -2
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
- package/lib/module/components/buttons/ButtonExtendedOutline.js +3 -2
- package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonLink.js +5 -1
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +6 -3
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +4 -1
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
- package/lib/module/components/checkbox/AnimatedCheckbox.js +4 -2
- package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/module/components/divider/Divider.js +2 -2
- package/lib/module/components/divider/Divider.js.map +1 -1
- package/lib/module/components/layout/BlockButtons.js.map +1 -1
- package/lib/module/components/layout/GradientBottomActions.js +26 -6
- package/lib/module/components/layout/GradientBottomActions.js.map +1 -1
- package/lib/module/components/layout/GradientScrollView.js +1 -1
- package/lib/module/components/layout/HeaderFirstLevel.js +13 -2
- package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +22 -7
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/layout/ModalBSHeader.js +65 -0
- package/lib/module/components/layout/ModalBSHeader.js.map +1 -0
- package/lib/module/components/layout/index.js +1 -0
- package/lib/module/components/layout/index.js.map +1 -1
- package/lib/module/components/listitems/ListItemAction.js +2 -1
- package/lib/module/components/listitems/ListItemAction.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -0
- package/lib/module/components/otpInput/BoxedInput.js +3 -2
- package/lib/module/components/otpInput/BoxedInput.js.map +1 -1
- package/lib/module/components/pictograms/Pictogram.js +1 -1
- package/lib/module/components/pictograms/Pictogram.js.map +1 -1
- package/lib/module/components/switch/NativeSwitch.js +5 -0
- package/lib/module/components/switch/NativeSwitch.js.map +1 -1
- package/lib/module/components/tabs/TabItem.js +4 -3
- package/lib/module/components/tabs/TabItem.js.map +1 -1
- package/lib/module/components/tag/Tag.js +6 -5
- package/lib/module/components/tag/Tag.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +1 -0
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/toast/ToastNotification.js +1 -0
- package/lib/module/components/toast/ToastNotification.js.map +1 -1
- package/lib/module/core/IOColors.js +0 -12
- package/lib/module/core/IOColors.js.map +1 -1
- package/lib/module/core/IOSpacing.js.map +1 -1
- package/lib/module/core/IOStyles.js +2 -0
- package/lib/module/core/IOStyles.js.map +1 -1
- package/lib/module/core/IOThemeContextProvider.js +30 -0
- package/lib/module/core/IOThemeContextProvider.js.map +1 -0
- package/lib/module/core/index.js +1 -0
- package/lib/module/core/index.js.map +1 -1
- package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
- package/lib/typescript/components/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
- package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonExtendedOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts +11 -2
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts +12 -2
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts +28 -2
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/layout/BlockButtons.d.ts +2 -2
- package/lib/typescript/components/layout/BlockButtons.d.ts.map +1 -1
- package/lib/typescript/components/layout/GradientBottomActions.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/ModalBSHeader.d.ts +16 -0
- package/lib/typescript/components/layout/ModalBSHeader.d.ts.map +1 -0
- package/lib/typescript/components/layout/index.d.ts +1 -0
- package/lib/typescript/components/layout/index.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
- package/lib/typescript/components/otpInput/BoxedInput.d.ts.map +1 -1
- package/lib/typescript/components/pictograms/Pictogram.d.ts +1 -1
- package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
- package/lib/typescript/components/switch/NativeSwitch.d.ts.map +1 -1
- package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
- package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts +3 -3
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/lib/typescript/components/toast/ToastNotification.d.ts.map +1 -1
- package/lib/typescript/core/IOColors.d.ts +0 -7
- package/lib/typescript/core/IOColors.d.ts.map +1 -1
- package/lib/typescript/core/IOSpacing.d.ts +1 -1
- package/lib/typescript/core/IOSpacing.d.ts.map +1 -1
- package/lib/typescript/core/IOStyles.d.ts +2 -0
- package/lib/typescript/core/IOStyles.d.ts.map +1 -1
- package/lib/typescript/core/IOThemeContextProvider.d.ts +21 -0
- package/lib/typescript/core/IOThemeContextProvider.d.ts.map +1 -0
- package/lib/typescript/core/index.d.ts +1 -0
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/components/accordion/AccordionItem.tsx +1 -0
- package/src/components/alert/Alert.tsx +3 -2
- package/src/components/avatar/Avatar.tsx +2 -1
- package/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -0
- package/src/components/badge/Badge.tsx +1 -0
- package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
- package/src/components/banner/Banner.tsx +4 -4
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
- package/src/components/buttons/ButtonExtendedOutline.tsx +3 -2
- package/src/components/buttons/ButtonLink.tsx +25 -13
- package/src/components/buttons/ButtonOutline.tsx +172 -159
- package/src/components/buttons/ButtonSolid.tsx +26 -15
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
- package/src/components/checkbox/AnimatedCheckbox.tsx +4 -2
- package/src/components/divider/Divider.tsx +2 -2
- package/src/components/layout/BlockButtons.tsx +2 -2
- package/src/components/layout/GradientBottomActions.tsx +22 -8
- package/src/components/layout/GradientScrollView.tsx +1 -1
- package/src/components/layout/HeaderFirstLevel.tsx +23 -8
- package/src/components/layout/HeaderSecondLevel.tsx +40 -15
- package/src/components/layout/ModalBSHeader.tsx +92 -0
- package/src/components/layout/index.tsx +1 -0
- package/src/components/listitems/ListItemAction.tsx +1 -0
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -0
- package/src/components/otpInput/BoxedInput.tsx +3 -2
- package/src/components/pictograms/Pictogram.tsx +1 -6
- package/src/components/switch/NativeSwitch.tsx +2 -0
- package/src/components/tabs/TabItem.tsx +4 -3
- package/src/components/tag/Tag.tsx +7 -6
- package/src/components/textInput/TextInputBase.tsx +4 -3
- package/src/components/toast/ToastNotification.tsx +1 -0
- package/src/core/IOColors.ts +1 -11
- package/src/core/IOSpacing.ts +2 -1
- package/src/core/IOStyles.ts +2 -0
- package/src/core/IOThemeContextProvider.tsx +50 -0
- package/src/core/index.ts +1 -0
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
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
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
-
<
|
|
186
|
-
|
|
202
|
+
<View
|
|
203
|
+
ref={titleRef}
|
|
187
204
|
accessible={isTitleAccessible}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
? styles.headerTitleFont
|
|
192
|
-
: styles.headerTitleLegacyFont,
|
|
193
|
-
titleAnimatedStyle
|
|
194
|
-
]}
|
|
205
|
+
accessibilityLabel={title}
|
|
206
|
+
accessibilityRole="header"
|
|
207
|
+
style={styles.titleContainer}
|
|
195
208
|
>
|
|
196
|
-
|
|
197
|
-
|
|
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
|
+
};
|
|
@@ -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]}
|
|
@@ -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 {
|
|
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:
|
|
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
|
|
5
|
-
import {
|
|
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: {
|
package/src/core/IOColors.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ComponentProps } from "react";
|
|
2
|
-
import
|
|
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
|
*/
|
package/src/core/IOSpacing.ts
CHANGED
package/src/core/IOStyles.ts
CHANGED
|
@@ -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