@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.
- package/README.md +1 -0
- 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 +18 -11
- package/lib/commonjs/components/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +60 -28
- 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/checkbox/AnimatedMessageCheckbox.js +4 -3
- package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.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/ListItemInfoCopy.js +1 -0
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -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 +4 -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 +18 -11
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +60 -28
- 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/checkbox/AnimatedMessageCheckbox.js +4 -3
- package/lib/module/components/checkbox/AnimatedMessageCheckbox.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/ListItemInfoCopy.js +1 -0
- package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -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 +4 -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 +6 -2
- 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/checkbox/AnimatedMessageCheckbox.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/listitems/ListItemInfoCopy.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 +4 -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 +3 -1
- package/src/components/accordion/AccordionItem.tsx +1 -0
- package/src/components/alert/Alert.tsx +3 -2
- package/src/components/avatar/Avatar.tsx +33 -20
- package/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +60 -28
- 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/checkbox/AnimatedMessageCheckbox.tsx +4 -3
- 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/ListItemInfoCopy.tsx +1 -0
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -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 +6 -0
- package/src/core/IOThemeContextProvider.tsx +50 -0
- 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
|
-
|
|
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.
|
|
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.
|
|
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,
|
|
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 =
|
|
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
|
|
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<
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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 =
|
|
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 {
|
|
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",
|
|
@@ -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 {
|
|
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
|
@@ -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",
|