@pagopa/io-app-design-system 1.43.0 → 1.45.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/badge/Badge.js +4 -0
- package/lib/commonjs/components/badge/Badge.js.map +1 -1
- package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +8 -0
- package/lib/commonjs/components/codeInput/CodeInput.js +6 -8
- package/lib/commonjs/components/codeInput/CodeInput.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +10 -6
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js +5 -7
- package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +0 -4
- package/lib/commonjs/components/modules/ModuleAttachment.js +17 -17
- package/lib/commonjs/components/modules/ModuleAttachment.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleCheckout.js +35 -28
- package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleCredential.js +28 -22
- package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleNavigation.js +30 -23
- package/lib/commonjs/components/modules/ModuleNavigation.js.map +1 -1
- package/lib/commonjs/components/modules/ModulePaymentNotice.js +17 -20
- package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleStatic.js +9 -2
- package/lib/commonjs/components/modules/ModuleStatic.js.map +1 -1
- package/lib/commonjs/components/numberpad/NumberPad.js +7 -8
- package/lib/commonjs/components/numberpad/NumberPad.js.map +1 -1
- package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +976 -987
- package/lib/commonjs/components/stack/Stack.js +4 -4
- package/lib/commonjs/components/stack/Stack.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +2 -1
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputValidation.js +20 -8
- package/lib/commonjs/components/textInput/TextInputValidation.js.map +1 -1
- package/lib/commonjs/components/toast/ToastProvider.js +7 -7
- package/lib/commonjs/components/toast/ToastProvider.js.map +1 -1
- package/lib/commonjs/core/IOAnimations.js +5 -0
- package/lib/commonjs/core/IOAnimations.js.map +1 -1
- package/lib/module/components/badge/Badge.js +4 -0
- package/lib/module/components/badge/Badge.js.map +1 -1
- package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +8 -0
- package/lib/module/components/codeInput/CodeInput.js +6 -8
- package/lib/module/components/codeInput/CodeInput.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +13 -8
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfo.js +6 -8
- package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +0 -4
- package/lib/module/components/modules/ModuleAttachment.js +17 -17
- package/lib/module/components/modules/ModuleAttachment.js.map +1 -1
- package/lib/module/components/modules/ModuleCheckout.js +35 -28
- package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/module/components/modules/ModuleCredential.js +28 -22
- package/lib/module/components/modules/ModuleCredential.js.map +1 -1
- package/lib/module/components/modules/ModuleNavigation.js +30 -23
- package/lib/module/components/modules/ModuleNavigation.js.map +1 -1
- package/lib/module/components/modules/ModulePaymentNotice.js +18 -21
- package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/module/components/modules/ModuleStatic.js +9 -2
- package/lib/module/components/modules/ModuleStatic.js.map +1 -1
- package/lib/module/components/numberpad/NumberPad.js +8 -9
- package/lib/module/components/numberpad/NumberPad.js.map +1 -1
- package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +976 -987
- package/lib/module/components/stack/Stack.js +4 -4
- package/lib/module/components/stack/Stack.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +2 -1
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/textInput/TextInputValidation.js +20 -8
- package/lib/module/components/textInput/TextInputValidation.js.map +1 -1
- package/lib/module/components/toast/ToastProvider.js +7 -7
- package/lib/module/components/toast/ToastProvider.js.map +1 -1
- package/lib/module/core/IOAnimations.js +5 -0
- package/lib/module/core/IOAnimations.js.map +1 -1
- package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
- package/lib/typescript/components/codeInput/CodeInput.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts +11 -4
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemInfo.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleAttachment.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleCredential.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleNavigation.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModulePaymentNotice.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleStatic.d.ts.map +1 -1
- package/lib/typescript/components/numberpad/NumberPad.d.ts.map +1 -1
- package/lib/typescript/components/stack/Stack.d.ts +4 -3
- package/lib/typescript/components/stack/Stack.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts +2 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputValidation.d.ts +13 -1
- package/lib/typescript/components/textInput/TextInputValidation.d.ts.map +1 -1
- package/lib/typescript/components/toast/ToastProvider.d.ts.map +1 -1
- package/lib/typescript/core/IOAnimations.d.ts +5 -0
- package/lib/typescript/core/IOAnimations.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/badge/Badge.tsx +4 -0
- package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +8 -0
- package/src/components/codeInput/CodeInput.tsx +8 -16
- package/src/components/layout/HeaderSecondLevel.tsx +51 -8
- package/src/components/listitems/ListItemInfo.tsx +8 -16
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +0 -4
- package/src/components/modules/ModuleAttachment.tsx +14 -15
- package/src/components/modules/ModuleCheckout.tsx +34 -46
- package/src/components/modules/ModuleCredential.tsx +36 -32
- package/src/components/modules/ModuleNavigation.tsx +45 -32
- package/src/components/modules/ModulePaymentNotice.tsx +14 -24
- package/src/components/modules/ModuleStatic.tsx +6 -3
- package/src/components/numberpad/NumberPad.tsx +20 -18
- package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +976 -987
- package/src/components/stack/Stack.tsx +10 -5
- package/src/components/textInput/TextInputBase.tsx +3 -1
- package/src/components/textInput/TextInputValidation.tsx +37 -11
- package/src/components/toast/ToastProvider.tsx +8 -7
- package/src/core/IOAnimations.ts +5 -0
|
@@ -10,13 +10,14 @@ import Placeholder from "rn-placeholder";
|
|
|
10
10
|
import {
|
|
11
11
|
IOListItemVisualParams,
|
|
12
12
|
IOSelectionListItemVisualParams,
|
|
13
|
+
IOSpacer,
|
|
13
14
|
IOVisualCostants,
|
|
14
15
|
useIOTheme
|
|
15
16
|
} from "../../core";
|
|
16
17
|
import { WithTestID } from "../../utils/types";
|
|
17
18
|
import { Badge } from "../badge";
|
|
18
19
|
import { IOIcons, Icon } from "../icons";
|
|
19
|
-
import {
|
|
20
|
+
import { HStack, VStack } from "../stack";
|
|
20
21
|
import { Chip, LabelSmallAlt } from "../typography";
|
|
21
22
|
import { ModuleStatic } from "./ModuleStatic";
|
|
22
23
|
import {
|
|
@@ -52,33 +53,45 @@ export const ModuleNavigation = (props: WithTestID<ModuleNavigationProps>) => {
|
|
|
52
53
|
const { icon, image, title, subtitle, onPress, badge, ...pressableProps } =
|
|
53
54
|
props;
|
|
54
55
|
|
|
55
|
-
const iconComponent = (
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
const iconComponent = icon && (
|
|
57
|
+
<Icon
|
|
58
|
+
name={icon}
|
|
59
|
+
size={IOSelectionListItemVisualParams.iconSize}
|
|
60
|
+
color="grey-300"
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const imageComponent = image && (
|
|
65
|
+
<Image
|
|
66
|
+
source={image}
|
|
67
|
+
style={styles.image}
|
|
68
|
+
accessibilityIgnoresInvertColors={true}
|
|
69
|
+
/>
|
|
66
70
|
);
|
|
67
71
|
|
|
68
72
|
return (
|
|
69
73
|
<PressableModuleBase {...pressableProps} onPress={onPress}>
|
|
70
|
-
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
numberOfLines={2}
|
|
75
|
-
lineBreakMode="middle"
|
|
74
|
+
<HStack space={8} style={{ alignItems: "center" }}>
|
|
75
|
+
<HStack
|
|
76
|
+
space={IOVisualCostants.iconMargin as IOSpacer}
|
|
77
|
+
style={{ alignItems: "center", flexGrow: 1, flexShrink: 1 }}
|
|
76
78
|
>
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
{iconComponent ?? imageComponent}
|
|
80
|
+
|
|
81
|
+
<View style={{ flexShrink: 1 }}>
|
|
82
|
+
<LabelSmallAlt
|
|
83
|
+
color={theme["interactiveElem-default"]}
|
|
84
|
+
numberOfLines={2}
|
|
85
|
+
lineBreakMode="middle"
|
|
86
|
+
style={{ flexShrink: 1 }}
|
|
87
|
+
>
|
|
88
|
+
{title}
|
|
89
|
+
</LabelSmallAlt>
|
|
90
|
+
{subtitle && (
|
|
91
|
+
<Chip color={theme["textBody-tertiary"]}>{subtitle}</Chip>
|
|
92
|
+
)}
|
|
93
|
+
</View>
|
|
94
|
+
</HStack>
|
|
82
95
|
{badge ? (
|
|
83
96
|
<Badge {...badge} />
|
|
84
97
|
) : onPress ? (
|
|
@@ -88,7 +101,7 @@ export const ModuleNavigation = (props: WithTestID<ModuleNavigationProps>) => {
|
|
|
88
101
|
size={IOListItemVisualParams.chevronSize}
|
|
89
102
|
/>
|
|
90
103
|
) : null}
|
|
91
|
-
</
|
|
104
|
+
</HStack>
|
|
92
105
|
</PressableModuleBase>
|
|
93
106
|
);
|
|
94
107
|
};
|
|
@@ -96,16 +109,16 @@ export const ModuleNavigation = (props: WithTestID<ModuleNavigationProps>) => {
|
|
|
96
109
|
const ModuleNavigationSkeleton = () => (
|
|
97
110
|
<ModuleStatic
|
|
98
111
|
startBlock={
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<
|
|
112
|
+
<HStack
|
|
113
|
+
style={{ alignItems: "center" }}
|
|
114
|
+
space={IOVisualCostants.iconMargin as IOSpacer}
|
|
115
|
+
>
|
|
116
|
+
<Placeholder.Box animate="fade" width={24} height={24} radius={8} />
|
|
117
|
+
<VStack space={4}>
|
|
104
118
|
<Placeholder.Box animate="fade" width={96} height={16} radius={8} />
|
|
105
|
-
<VSpacer size={4} />
|
|
106
119
|
<Placeholder.Box animate="fade" width={160} height={12} radius={8} />
|
|
107
|
-
</
|
|
108
|
-
|
|
120
|
+
</VStack>
|
|
121
|
+
</HStack>
|
|
109
122
|
}
|
|
110
123
|
endBlock={
|
|
111
124
|
<Placeholder.Box animate="fade" width={64} height={24} radius={16} />
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { GestureResponderEvent, StyleSheet, View } from "react-native";
|
|
3
3
|
import Placeholder from "rn-placeholder";
|
|
4
|
-
import {
|
|
5
|
-
IOListItemVisualParams,
|
|
6
|
-
useIOExperimentalDesign,
|
|
7
|
-
useIOTheme
|
|
8
|
-
} from "../../core";
|
|
4
|
+
import { IOListItemVisualParams, IOSpacer, useIOTheme } from "../../core";
|
|
9
5
|
import { getAccessibleAmountText } from "../../utils/accessibility";
|
|
10
6
|
import { WithTestID } from "../../utils/types";
|
|
11
7
|
import { Badge } from "../badge";
|
|
12
8
|
import { Icon } from "../icons";
|
|
13
|
-
import {
|
|
9
|
+
import { HStack, VStack } from "../stack";
|
|
14
10
|
import { H6, LabelSmall, LabelSmallAlt } from "../typography";
|
|
15
11
|
import { ModuleStatic } from "./ModuleStatic";
|
|
16
12
|
import { PressableModuleBase } from "./PressableModuleBase";
|
|
@@ -46,8 +42,7 @@ export type ModulePaymentNoticeProps = WithTestID<
|
|
|
46
42
|
>;
|
|
47
43
|
|
|
48
44
|
const styles = StyleSheet.create({
|
|
49
|
-
|
|
50
|
-
marginLeft: IOListItemVisualParams.iconMargin,
|
|
45
|
+
endBlock: {
|
|
51
46
|
flexDirection: "row",
|
|
52
47
|
alignItems: "center",
|
|
53
48
|
justifyContent: "flex-end"
|
|
@@ -62,7 +57,6 @@ const ModulePaymentNoticeContent = ({
|
|
|
62
57
|
badgeText = ""
|
|
63
58
|
}: Omit<ModulePaymentNoticeProps, "isLoading" | "onPress" | "testID">) => {
|
|
64
59
|
const theme = useIOTheme();
|
|
65
|
-
const { isExperimental } = useIOExperimentalDesign();
|
|
66
60
|
|
|
67
61
|
const AmountOrBadgeComponent = () => {
|
|
68
62
|
switch (paymentNoticeStatus) {
|
|
@@ -70,7 +64,7 @@ const ModulePaymentNoticeContent = ({
|
|
|
70
64
|
return (
|
|
71
65
|
<H6
|
|
72
66
|
accessibilityLabel={getAccessibleAmountText(paymentNoticeAmount)}
|
|
73
|
-
color={
|
|
67
|
+
color={theme["interactiveElem-default"]}
|
|
74
68
|
numberOfLines={1}
|
|
75
69
|
>
|
|
76
70
|
{paymentNoticeAmount}
|
|
@@ -92,8 +86,8 @@ const ModulePaymentNoticeContent = ({
|
|
|
92
86
|
};
|
|
93
87
|
|
|
94
88
|
return (
|
|
95
|
-
|
|
96
|
-
<View style={{ flexGrow: 1, flexShrink: 1
|
|
89
|
+
<HStack space={IOListItemVisualParams.iconMargin as IOSpacer}>
|
|
90
|
+
<View style={{ flexGrow: 1, flexShrink: 1 }}>
|
|
97
91
|
{title && (
|
|
98
92
|
<LabelSmall
|
|
99
93
|
numberOfLines={1}
|
|
@@ -112,15 +106,15 @@ const ModulePaymentNoticeContent = ({
|
|
|
112
106
|
</LabelSmallAlt>
|
|
113
107
|
)}
|
|
114
108
|
</View>
|
|
115
|
-
<View style={styles.
|
|
109
|
+
<View style={styles.endBlock}>
|
|
116
110
|
<AmountOrBadgeComponent />
|
|
117
111
|
<Icon
|
|
118
112
|
name="chevronRightListItem"
|
|
119
|
-
color={
|
|
113
|
+
color={theme["interactiveElem-default"]}
|
|
120
114
|
size={IOListItemVisualParams.chevronSize}
|
|
121
115
|
/>
|
|
122
116
|
</View>
|
|
123
|
-
|
|
117
|
+
</HStack>
|
|
124
118
|
);
|
|
125
119
|
};
|
|
126
120
|
|
|
@@ -161,17 +155,13 @@ export const ModulePaymentNotice = ({
|
|
|
161
155
|
const ModulePaymentNoticeSkeleton = () => (
|
|
162
156
|
<ModuleStatic
|
|
163
157
|
startBlock={
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
<VSpacer size={8} />
|
|
169
|
-
<Placeholder.Box animate="fade" radius={8} width={179} height={16} />
|
|
170
|
-
</View>
|
|
171
|
-
</React.Fragment>
|
|
158
|
+
<VStack space={4}>
|
|
159
|
+
<Placeholder.Box animate="fade" radius={8} width={120} height={12} />
|
|
160
|
+
<Placeholder.Box animate="fade" radius={8} width={180} height={16} />
|
|
161
|
+
</VStack>
|
|
172
162
|
}
|
|
173
163
|
endBlock={
|
|
174
|
-
<Placeholder.Box animate="fade" radius={16} width={
|
|
164
|
+
<Placeholder.Box animate="fade" radius={16} width={64} height={24} />
|
|
175
165
|
}
|
|
176
166
|
/>
|
|
177
167
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PressableProps, View } from "react-native";
|
|
3
3
|
import { IOColors, IOModuleStyles, useIOTheme } from "../../core";
|
|
4
|
+
import { HStack } from "../stack";
|
|
4
5
|
|
|
5
6
|
type ModuleStaticProps =
|
|
6
7
|
| ModuleStaticSingleBlockProps
|
|
@@ -42,12 +43,14 @@ export const ModuleStatic = ({
|
|
|
42
43
|
accessible={false}
|
|
43
44
|
>
|
|
44
45
|
{startBlock && (
|
|
45
|
-
<
|
|
46
|
-
<View
|
|
46
|
+
<HStack space={8} style={{ alignItems: "center" }}>
|
|
47
|
+
<View
|
|
48
|
+
style={{ flexDirection: "row", alignItems: "center", flexGrow: 1 }}
|
|
49
|
+
>
|
|
47
50
|
{startBlock}
|
|
48
51
|
</View>
|
|
49
52
|
{endBlock}
|
|
50
|
-
</
|
|
53
|
+
</HStack>
|
|
51
54
|
)}
|
|
52
55
|
|
|
53
56
|
{children}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { ComponentProps,
|
|
1
|
+
import React, { ComponentProps, useCallback, useMemo } from "react";
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
|
-
import { BiometricsValidType, Optional } from "../../utils/types";
|
|
4
3
|
import { IONumberPadButtonStyles, IOStyles } from "../../core";
|
|
5
|
-
import {
|
|
4
|
+
import { BiometricsValidType, Optional } from "../../utils/types";
|
|
6
5
|
import { IconButton } from "../buttons";
|
|
7
6
|
import { IOIconSizeScale, IOIcons } from "../icons";
|
|
7
|
+
import { VStack } from "../stack";
|
|
8
8
|
import { NumberButton } from "./NumberButton";
|
|
9
9
|
|
|
10
10
|
type BiometricAuthProps =
|
|
@@ -138,21 +138,23 @@ export const NumberPad = ({
|
|
|
138
138
|
);
|
|
139
139
|
|
|
140
140
|
// eslint-disable-next-line arrow-body-style
|
|
141
|
-
const numberPad = useMemo(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
141
|
+
const numberPad = useMemo(
|
|
142
|
+
() => (
|
|
143
|
+
<VStack space={16}>
|
|
144
|
+
{[
|
|
145
|
+
[1, 2, 3],
|
|
146
|
+
[4, 5, 6],
|
|
147
|
+
[7, 8, 9],
|
|
148
|
+
[biometricType, 0, "delete"]
|
|
149
|
+
].map((row, i) => (
|
|
150
|
+
<View key={i} style={[IOStyles.rowSpaceBetween, styles.numberPad]}>
|
|
151
|
+
{renderButtonsRow(row)}
|
|
152
|
+
</View>
|
|
153
|
+
))}
|
|
154
|
+
</VStack>
|
|
155
|
+
),
|
|
156
|
+
[biometricType, renderButtonsRow]
|
|
157
|
+
);
|
|
156
158
|
|
|
157
159
|
return <View style={IOStyles.horizontalContentPadding}>{numberPad}</View>;
|
|
158
160
|
};
|