@pagopa/io-app-design-system 1.11.2 → 1.12.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/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -0
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -0
- package/lib/commonjs/components/buttons/ButtonLink.js +3 -5
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +6 -6
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +6 -6
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +9 -0
- package/lib/commonjs/components/icons/Icon.js +6 -0
- package/lib/commonjs/components/icons/Icon.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconDocPaymentCode.js +31 -0
- package/lib/commonjs/components/icons/svg/IconDocPaymentCode.js.map +1 -0
- package/lib/commonjs/components/icons/svg/IconEntityCode.js +31 -0
- package/lib/commonjs/components/icons/svg/IconEntityCode.js.map +1 -0
- package/lib/commonjs/components/icons/svg/IconNotes.js +31 -0
- package/lib/commonjs/components/icons/svg/IconNotes.js.map +1 -0
- package/lib/commonjs/components/icons/svg/originals/IconDocPaymentCode.svg +3 -0
- package/lib/commonjs/components/icons/svg/originals/IconEntityCode.svg +3 -0
- package/lib/commonjs/components/icons/svg/originals/IconNotes.svg +3 -0
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/layout/Dismissable.js +60 -0
- package/lib/commonjs/components/layout/Dismissable.js.map +1 -0
- package/lib/commonjs/components/layout/HeaderFirstLevel.js +14 -5
- package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +10 -7
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/layout/common.js +6 -0
- package/lib/commonjs/components/layout/common.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/ListItemTransaction.js +5 -4
- package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +2 -0
- package/lib/commonjs/components/logos/LogoPaymentCard.js +50 -0
- package/lib/commonjs/components/logos/LogoPaymentCard.js.map +1 -0
- package/lib/commonjs/components/logos/LogoPaymentExt.js +1 -1
- package/lib/commonjs/components/logos/LogoPaymentExt.js.map +1 -1
- package/lib/commonjs/components/logos/README.md +2 -1
- package/lib/commonjs/components/logos/index.js +20 -1
- package/lib/commonjs/components/logos/index.js.map +1 -1
- package/lib/commonjs/components/logos/svg/LogoPaymentCardBancomatPay.js +33 -0
- package/lib/commonjs/components/logos/svg/LogoPaymentCardBancomatPay.js.map +1 -0
- package/lib/commonjs/components/logos/svg/LogoPaymentCardPayPal.js +42 -0
- package/lib/commonjs/components/logos/svg/LogoPaymentCardPayPal.js.map +1 -0
- package/lib/commonjs/components/logos/svg/originals/LogoPaymentCardBancomatPay.svg +18 -0
- package/lib/commonjs/components/logos/svg/originals/LogoPaymentCardPayPal.svg +30 -0
- package/lib/commonjs/components/toast/ToastNotification.js +73 -0
- package/lib/commonjs/components/toast/ToastNotification.js.map +1 -0
- package/lib/commonjs/components/toast/ToastProvider.js +135 -0
- package/lib/commonjs/components/toast/ToastProvider.js.map +1 -0
- package/lib/commonjs/components/toast/context.js +14 -0
- package/lib/commonjs/components/toast/context.js.map +1 -0
- package/lib/commonjs/components/toast/index.js +39 -0
- package/lib/commonjs/components/toast/index.js.map +1 -0
- package/lib/commonjs/components/toast/types.js +6 -0
- package/lib/commonjs/components/toast/types.js.map +1 -0
- package/lib/commonjs/components/toast/useIOToast.js +94 -0
- package/lib/commonjs/components/toast/useIOToast.js.map +1 -0
- package/lib/commonjs/components/typography/BaseTypography.js +3 -1
- package/lib/commonjs/components/typography/BaseTypography.js.map +1 -1
- package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +31 -0
- package/lib/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -0
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -0
- package/lib/module/components/buttons/ButtonLink.js +3 -5
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +6 -6
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +6 -6
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +9 -0
- package/lib/module/components/icons/Icon.js +6 -0
- package/lib/module/components/icons/Icon.js.map +1 -1
- package/lib/module/components/icons/svg/IconDocPaymentCode.js +23 -0
- package/lib/module/components/icons/svg/IconDocPaymentCode.js.map +1 -0
- package/lib/module/components/icons/svg/IconEntityCode.js +23 -0
- package/lib/module/components/icons/svg/IconEntityCode.js.map +1 -0
- package/lib/module/components/icons/svg/IconNotes.js +23 -0
- package/lib/module/components/icons/svg/IconNotes.js.map +1 -0
- package/lib/module/components/icons/svg/originals/IconDocPaymentCode.svg +3 -0
- package/lib/module/components/icons/svg/originals/IconEntityCode.svg +3 -0
- package/lib/module/components/icons/svg/originals/IconNotes.svg +3 -0
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/layout/Dismissable.js +51 -0
- package/lib/module/components/layout/Dismissable.js.map +1 -0
- package/lib/module/components/layout/HeaderFirstLevel.js +14 -5
- package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +10 -7
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/layout/common.js +2 -0
- package/lib/module/components/layout/common.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/ListItemTransaction.js +5 -4
- package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +2 -0
- package/lib/module/components/logos/LogoPaymentCard.js +43 -0
- package/lib/module/components/logos/LogoPaymentCard.js.map +1 -0
- package/lib/module/components/logos/LogoPaymentExt.js +1 -1
- package/lib/module/components/logos/LogoPaymentExt.js.map +1 -1
- package/lib/module/components/logos/README.md +2 -1
- package/lib/module/components/logos/index.js +2 -0
- package/lib/module/components/logos/index.js.map +1 -1
- package/lib/module/components/logos/svg/LogoPaymentCardBancomatPay.js +25 -0
- package/lib/module/components/logos/svg/LogoPaymentCardBancomatPay.js.map +1 -0
- package/lib/module/components/logos/svg/LogoPaymentCardPayPal.js +34 -0
- package/lib/module/components/logos/svg/LogoPaymentCardPayPal.js.map +1 -0
- package/lib/module/components/logos/svg/originals/LogoPaymentCardBancomatPay.svg +18 -0
- package/lib/module/components/logos/svg/originals/LogoPaymentCardPayPal.svg +30 -0
- package/lib/module/components/toast/ToastNotification.js +66 -0
- package/lib/module/components/toast/ToastNotification.js.map +1 -0
- package/lib/module/components/toast/ToastProvider.js +123 -0
- package/lib/module/components/toast/ToastProvider.js.map +1 -0
- package/lib/module/components/toast/context.js +7 -0
- package/lib/module/components/toast/context.js.map +1 -0
- package/lib/module/components/toast/index.js +4 -0
- package/lib/module/components/toast/index.js.map +1 -0
- package/lib/module/components/toast/types.js +2 -0
- package/lib/module/components/toast/types.js.map +1 -0
- package/lib/module/components/toast/useIOToast.js +84 -0
- package/lib/module/components/toast/useIOToast.js.map +1 -0
- package/lib/module/components/typography/BaseTypography.js +3 -1
- package/lib/module/components/typography/BaseTypography.js.map +1 -1
- package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +31 -0
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/icons/Icon.d.ts +3 -0
- package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconDocPaymentCode.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconDocPaymentCode.d.ts.map +1 -0
- package/lib/typescript/components/icons/svg/IconEntityCode.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconEntityCode.d.ts.map +1 -0
- package/lib/typescript/components/icons/svg/IconNotes.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconNotes.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/layout/Dismissable.d.ts +18 -0
- package/lib/typescript/components/layout/Dismissable.d.ts.map +1 -0
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts +28 -5
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts +8 -3
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/common.d.ts +4 -0
- package/lib/typescript/components/layout/common.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/ListItemTransaction.d.ts +8 -6
- package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
- package/lib/typescript/components/logos/LogoPaymentCard.d.ts +19 -0
- package/lib/typescript/components/logos/LogoPaymentCard.d.ts.map +1 -0
- package/lib/typescript/components/logos/index.d.ts +2 -0
- package/lib/typescript/components/logos/index.d.ts.map +1 -1
- package/lib/typescript/components/logos/svg/LogoPaymentCardBancomatPay.d.ts +5 -0
- package/lib/typescript/components/logos/svg/LogoPaymentCardBancomatPay.d.ts.map +1 -0
- package/lib/typescript/components/logos/svg/LogoPaymentCardPayPal.d.ts +5 -0
- package/lib/typescript/components/logos/svg/LogoPaymentCardPayPal.d.ts.map +1 -0
- package/lib/typescript/components/radio/RadioGroup.d.ts +2 -2
- package/lib/typescript/components/radio/RadioGroup.d.ts.map +1 -1
- package/lib/typescript/components/toast/ToastNotification.d.ts +6 -0
- package/lib/typescript/components/toast/ToastNotification.d.ts.map +1 -0
- package/lib/typescript/components/toast/ToastProvider.d.ts +22 -0
- package/lib/typescript/components/toast/ToastProvider.d.ts.map +1 -0
- package/lib/typescript/components/toast/context.d.ts +9 -0
- package/lib/typescript/components/toast/context.d.ts.map +1 -0
- package/lib/typescript/components/toast/index.d.ts +4 -0
- package/lib/typescript/components/toast/index.d.ts.map +1 -0
- package/lib/typescript/components/toast/types.d.ts +11 -0
- package/lib/typescript/components/toast/types.d.ts.map +1 -0
- package/lib/typescript/components/toast/useIOToast.d.ts +23 -0
- package/lib/typescript/components/toast/useIOToast.d.ts.map +1 -0
- package/package.json +3 -1
- package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -0
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -0
- package/src/components/buttons/ButtonLink.tsx +2 -4
- package/src/components/buttons/ButtonOutline.tsx +3 -4
- package/src/components/buttons/ButtonSolid.tsx +3 -4
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +9 -0
- package/src/components/icons/Icon.tsx +6 -0
- package/src/components/icons/svg/IconDocPaymentCode.tsx +16 -0
- package/src/components/icons/svg/IconEntityCode.tsx +16 -0
- package/src/components/icons/svg/IconNotes.tsx +16 -0
- package/src/components/icons/svg/originals/IconDocPaymentCode.svg +3 -0
- package/src/components/icons/svg/originals/IconEntityCode.svg +3 -0
- package/src/components/icons/svg/originals/IconNotes.svg +3 -0
- package/src/components/index.tsx +1 -0
- package/src/components/layout/Dismissable.tsx +76 -0
- package/src/components/layout/HeaderFirstLevel.tsx +42 -13
- package/src/components/layout/HeaderSecondLevel.tsx +22 -18
- package/src/components/layout/common.ts +7 -0
- package/src/components/layout/index.tsx +1 -0
- package/src/components/listitems/ListItemTransaction.tsx +25 -10
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +2 -0
- package/src/components/logos/LogoPaymentCard.tsx +62 -0
- package/src/components/logos/LogoPaymentExt.tsx +1 -1
- package/src/components/logos/README.md +2 -1
- package/src/components/logos/index.tsx +2 -0
- package/src/components/logos/svg/LogoPaymentCardBancomatPay.tsx +28 -0
- package/src/components/logos/svg/LogoPaymentCardPayPal.tsx +38 -0
- package/src/components/logos/svg/originals/LogoPaymentCardBancomatPay.svg +18 -0
- package/src/components/logos/svg/originals/LogoPaymentCardPayPal.svg +30 -0
- package/src/components/radio/RadioGroup.tsx +2 -2
- package/src/components/toast/ToastNotification.tsx +76 -0
- package/src/components/toast/ToastProvider.tsx +153 -0
- package/src/components/toast/context.ts +14 -0
- package/src/components/toast/index.ts +3 -0
- package/src/components/toast/types.ts +13 -0
- package/src/components/toast/useIOToast.ts +88 -0
- package/src/components/typography/BaseTypography.tsx +1 -1
- package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +31 -0
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
useIOTheme
|
|
15
15
|
} from "../../core";
|
|
16
16
|
|
|
17
|
-
import { LogoPaymentWithFallback } from "../common/LogoPaymentWithFallback";
|
|
18
|
-
import { isImageUri } from "../../utils/url";
|
|
19
|
-
import { WithTestID } from "../../utils/types";
|
|
20
17
|
import { getAccessibleAmountText } from "../../utils/accessibility";
|
|
18
|
+
import { WithTestID } from "../../utils/types";
|
|
19
|
+
import { isImageUri } from "../../utils/url";
|
|
21
20
|
import { Avatar } from "../avatar/Avatar";
|
|
22
21
|
import { Badge } from "../badge/Badge";
|
|
22
|
+
import { LogoPaymentWithFallback } from "../common/LogoPaymentWithFallback";
|
|
23
23
|
import { IOIconSizeScale, Icon } from "../icons";
|
|
24
24
|
import { IOLogoPaymentType } from "../logos";
|
|
25
25
|
import { VSpacer } from "../spacer";
|
|
@@ -37,7 +37,20 @@ export type ListItemTransactionStatus =
|
|
|
37
37
|
| "refunded"
|
|
38
38
|
| "reversal";
|
|
39
39
|
|
|
40
|
-
type
|
|
40
|
+
export type ListItemTransactionStatusWithoutBadge = Extract<
|
|
41
|
+
ListItemTransactionStatus,
|
|
42
|
+
"success" | "refunded"
|
|
43
|
+
>;
|
|
44
|
+
|
|
45
|
+
export type ListItemTransactionStatusWithBadge = Exclude<
|
|
46
|
+
ListItemTransactionStatus,
|
|
47
|
+
"success" | "refunded"
|
|
48
|
+
>;
|
|
49
|
+
|
|
50
|
+
export type ListItemTransactionLogo =
|
|
51
|
+
| IOLogoPaymentType
|
|
52
|
+
| ImageURISource
|
|
53
|
+
| React.ReactNode;
|
|
41
54
|
|
|
42
55
|
export type ListItemTransaction = WithTestID<
|
|
43
56
|
PressableBaseProps & {
|
|
@@ -48,17 +61,18 @@ export type ListItemTransaction = WithTestID<
|
|
|
48
61
|
*
|
|
49
62
|
* Must be a {@link IOLogoPaymentType} or an {@link ImageURISource} or an {@link Icon}.
|
|
50
63
|
*/
|
|
51
|
-
paymentLogoIcon?:
|
|
64
|
+
paymentLogoIcon?: ListItemTransactionLogo;
|
|
52
65
|
subtitle: string;
|
|
53
66
|
title: string;
|
|
67
|
+
accessible?: boolean;
|
|
54
68
|
} & (
|
|
55
69
|
| {
|
|
56
|
-
transactionStatus:
|
|
70
|
+
transactionStatus: ListItemTransactionStatusWithoutBadge;
|
|
57
71
|
badgeText?: string;
|
|
58
72
|
transactionAmount: string;
|
|
59
73
|
}
|
|
60
74
|
| {
|
|
61
|
-
transactionStatus:
|
|
75
|
+
transactionStatus: ListItemTransactionStatusWithBadge;
|
|
62
76
|
badgeText: string;
|
|
63
77
|
transactionAmount?: string;
|
|
64
78
|
}
|
|
@@ -66,7 +80,7 @@ export type ListItemTransaction = WithTestID<
|
|
|
66
80
|
>;
|
|
67
81
|
|
|
68
82
|
type LeftComponentProps = {
|
|
69
|
-
logoIcon:
|
|
83
|
+
logoIcon: ListItemTransactionLogo;
|
|
70
84
|
};
|
|
71
85
|
|
|
72
86
|
const CARD_LOGO_SIZE: IOIconSizeScale = 24;
|
|
@@ -101,7 +115,8 @@ export const ListItemTransaction = ({
|
|
|
101
115
|
title,
|
|
102
116
|
transactionAmount,
|
|
103
117
|
badgeText,
|
|
104
|
-
transactionStatus = "success"
|
|
118
|
+
transactionStatus = "success",
|
|
119
|
+
accessible
|
|
105
120
|
}: ListItemTransaction) => {
|
|
106
121
|
const theme = useIOTheme();
|
|
107
122
|
|
|
@@ -190,7 +205,7 @@ export const ListItemTransaction = ({
|
|
|
190
205
|
<View
|
|
191
206
|
style={IOListItemStyles.listItem}
|
|
192
207
|
testID={testID}
|
|
193
|
-
accessible={
|
|
208
|
+
accessible={accessible}
|
|
194
209
|
accessibilityLabel={accessibilityLabel}
|
|
195
210
|
>
|
|
196
211
|
<View style={IOListItemStyles.listItemInner}>
|
|
@@ -224,6 +224,7 @@ exports[`Test List Item Components ListItemInfo Snapshot 1`] = `
|
|
|
224
224
|
}
|
|
225
225
|
>
|
|
226
226
|
<Text
|
|
227
|
+
allowFontScaling={false}
|
|
227
228
|
color="bluegrey"
|
|
228
229
|
defaultColor="bluegrey"
|
|
229
230
|
defaultWeight="Regular"
|
|
@@ -350,6 +351,7 @@ exports[`Test List Item Components ListItemInfoCopy Snapshot 1`] = `
|
|
|
350
351
|
}
|
|
351
352
|
>
|
|
352
353
|
<Text
|
|
354
|
+
allowFontScaling={false}
|
|
353
355
|
color="bluegrey"
|
|
354
356
|
defaultColor="bluegrey"
|
|
355
357
|
defaultWeight="Regular"
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, StyleSheet } from "react-native";
|
|
3
|
+
import { hexToRgba, IOColors } from "../../core";
|
|
4
|
+
|
|
5
|
+
/* Logos */
|
|
6
|
+
import LogoPaymentCardPayPal from "./svg/LogoPaymentCardPayPal";
|
|
7
|
+
import LogoPaymentCardBancomatPay from "./svg/LogoPaymentCardBancomatPay";
|
|
8
|
+
|
|
9
|
+
export const IOPaymentCardLogos = {
|
|
10
|
+
payPal: LogoPaymentCardPayPal,
|
|
11
|
+
bancomatPay: LogoPaymentCardBancomatPay
|
|
12
|
+
} as const;
|
|
13
|
+
|
|
14
|
+
export type IOLogoPaymentCardType = keyof typeof IOPaymentCardLogos;
|
|
15
|
+
|
|
16
|
+
type IOPaymentLogos = {
|
|
17
|
+
name: IOLogoPaymentCardType;
|
|
18
|
+
align: "start" | "center" | "end";
|
|
19
|
+
width?: "100%" | number;
|
|
20
|
+
height?: number;
|
|
21
|
+
debugMode?: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type SVGCardLogoProps = {
|
|
25
|
+
preserveAspectRatio: "xMinYMin meet" | "xMidYMid meet" | "xMaxYMax meet";
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const preserveAspectRatioValues: Record<
|
|
29
|
+
IOPaymentLogos["align"],
|
|
30
|
+
SVGCardLogoProps["preserveAspectRatio"]
|
|
31
|
+
> = {
|
|
32
|
+
start: "xMinYMin meet",
|
|
33
|
+
center: "xMidYMid meet",
|
|
34
|
+
end: "xMaxYMax meet"
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const styles = StyleSheet.create({
|
|
38
|
+
debugMode: {
|
|
39
|
+
backgroundColor: hexToRgba(IOColors["error-500"], 0.2)
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const LogoPaymentCard = ({
|
|
44
|
+
name,
|
|
45
|
+
width = "100%",
|
|
46
|
+
height = 32,
|
|
47
|
+
align = "center",
|
|
48
|
+
debugMode = false,
|
|
49
|
+
...props
|
|
50
|
+
}: IOPaymentLogos) => {
|
|
51
|
+
const LogoElement = IOPaymentCardLogos[name];
|
|
52
|
+
return (
|
|
53
|
+
<View style={[{ width, height }, debugMode && styles.debugMode]}>
|
|
54
|
+
<LogoElement
|
|
55
|
+
preserveAspectRatio={preserveAspectRatioValues[align]}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
</View>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default LogoPaymentCard;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import LogoPaymentExtAmex from "./svg/LogoPaymentExtAmex";
|
|
3
2
|
|
|
4
3
|
/* Logos */
|
|
5
4
|
import LogoPaymentExtMaestro from "./svg/LogoPaymentExtMaestro";
|
|
@@ -15,6 +14,7 @@ import LogoPaymentExtBancomatPay from "./svg/LogoPaymentExtBancomatPay";
|
|
|
15
14
|
import LogoPaymentExtPostepay from "./svg/LogoPaymentExtPostepay";
|
|
16
15
|
import LogoPaymentExtPagoBancomat from "./svg/LogoPaymentExtPagoBancomat";
|
|
17
16
|
import LogoPaymentExtApplePay from "./svg/LogoPaymentExtApplePay";
|
|
17
|
+
import LogoPaymentExtAmex from "./svg/LogoPaymentExtAmex";
|
|
18
18
|
|
|
19
19
|
export const IOPaymentExtLogos = {
|
|
20
20
|
maestro: LogoPaymentExtMaestro,
|
|
@@ -5,7 +5,8 @@ There are different sets:
|
|
|
5
5
|
|
|
6
6
|
## Prefixes
|
|
7
7
|
- **Payment Logos**: `LogoPayment…`
|
|
8
|
-
- **Payment Logos
|
|
8
|
+
- **Payment Logos**: `LogoPaymentExt…`
|
|
9
|
+
- **Payment Card Logos**: `LogoPaymentCard…`
|
|
9
10
|
|
|
10
11
|
## Add a new logo
|
|
11
12
|
First of all, follow the instructions stated in the main README (`Vector graphics` section).
|
|
@@ -2,3 +2,5 @@ export { default as LogoPayment } from "./LogoPayment";
|
|
|
2
2
|
export * from "./LogoPayment";
|
|
3
3
|
export { default as LogoPaymentExt } from "./LogoPaymentExt";
|
|
4
4
|
export * from "./LogoPaymentExt";
|
|
5
|
+
export { default as LogoPaymentCard } from "./LogoPaymentCard";
|
|
6
|
+
export * from "./LogoPaymentCard";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Svg, Path } from "react-native-svg";
|
|
3
|
+
import { SVGCardLogoProps } from "../LogoPaymentCard";
|
|
4
|
+
|
|
5
|
+
const LogoPaymentCardBancomatPay = ({
|
|
6
|
+
preserveAspectRatio
|
|
7
|
+
}: SVGCardLogoProps) => (
|
|
8
|
+
<Svg viewBox="0 0 137 24" preserveAspectRatio={preserveAspectRatio}>
|
|
9
|
+
<Path
|
|
10
|
+
fill="#3FBDEE"
|
|
11
|
+
d="M104.986 10.8594 94.6035.4745c-.6327-.63267-1.6562-.63267-2.2889 0L81.9323 10.8568c-.6327.6327-.6327 1.6563 0 2.2864l10.3823 10.3823c.6327.6327 1.6562.6327 2.2889 0l10.3825-10.3823c.632-.6327.632-1.6563 0-2.2864v.0026Zm-7.0932 3.634c-.2674 2.1757-1.8465 3.225-4.4209 3.225H88.246l.3035-2.4226h5.1873c.6635 0 1.021-.4012 1.1085-1.1111.0102-.0771.0128-.1466.0128-.216h3.0733c-.0051.1646-.0154.3369-.0386.5247Zm2.0806-1.376H88.817l.27-2.186h5.0381c.7381 0 .9696-.5092 1.0442-1.12643.0746-.61723-.0309-1.003-.787-1.003h-5.033l.3035-2.51521h5.1487c2.9319 0 3.7188 1.24989 3.508 2.9627-.0849.69953-.2855 1.25764-.571 1.68194h.3009c1.1728 0 2.0806 1.0236 1.9366 2.1886l-.0026-.0026Z"
|
|
12
|
+
/>
|
|
13
|
+
<Path
|
|
14
|
+
fill="#223264"
|
|
15
|
+
d="M1.4042 6.28671h4.56494c2.93184 0 3.71881 1.2499 3.50793 2.96271-.16203 1.32708-.72525 2.14488-1.54051 2.49978 1.00043.4012 1.31676 1.219 1.12902 2.7467-.26747 2.1757-1.84655 3.225-4.42092 3.225H0L1.4042 6.28671Zm3.88856 4.64209c.74067 0 .97213-.5092 1.04929-1.12644.07458-.61723-.03086-1.003-.78697-1.003H4.10459l-.26233 2.12944h1.4505Zm-.38063 4.3643c.66352 0 1.021-.4012 1.10844-1.111.08745-.7098-.16202-1.0647-.8564-1.0647H3.5748l-.26747 2.1757h1.6048ZM61.772 6.28672 60.3678 17.7158H57.436l.7844-6.3858.0257-.2186-.0849.2032-2.7029 6.4012H53.55l-1.1625-6.3961-.036-.198-.0257.2006-.7844 6.3935h-2.6515l1.4042-11.42908h2.1706c.9927 0 1.8363.70982 2.006 1.68967l.7638 4.44151.018.1029.0412-.0978 2.5949-6.13885h3.8834M67.4454 6.28672c.9695 0 1.8054.69181 1.9854 1.64338l1.8543 9.7857h-3.0939l-.2572-1.6022-.0051-.0258h-3.3742l-.0077.018-.6533 1.6074H60.895l4.9739-11.42905h1.5765v.00257ZM65.55 13.5289h1.9983l-.0052-.036-.5632-3.1633-.018-.1003-.0412.0951-1.3527 3.1634-.018.0437M30.3394 6.28671 28.9352 17.7158h-2.775l-2.8264-5.9512-.0463-.0951-.0128.1054-.7304 5.9434h-2.8522l1.4042-11.42902h1.8852c.7844 0 1.5096.46036 1.8414 1.17017l1.9365 4.13035.0463.0977.0129-.1055.6506-5.29272h2.8702M36.3806 6.14787c1.2653 0 2.3634.30348 3.1813.87442l-1.9212 2.51007c-.4526-.29833-1.0518-.45521-1.7359-.45521-1.3116 0-1.9906.45264-2.3069 3.01925-.1723 1.4094-.0798 2.2272.3009 2.6593.2571.2906.6455.414 1.2962.414.7072 0 1.2576-.162 1.9519-.576l1.1985 2.3326c-.967.5581-1.9623.9284-3.6571.9284-1.5354 0-2.6181-.3806-3.3125-1.1676-.8229-.931-1.093-2.4612-.8204-4.6781.2392-1.9546.7253-3.29962 1.5277-4.23318.9438-1.09816 2.3506-1.63309 4.2975-1.63309"
|
|
16
|
+
/>
|
|
17
|
+
<Path
|
|
18
|
+
fill="#223264"
|
|
19
|
+
d="M44.3918 6.14786c1.6228 0 2.7595.39348 3.4745 1.2036.8307.9387 1.075 2.37377.7947 4.65494-.2263 1.8491-.6738 3.1453-1.4094 4.0763-.9438 1.1959-2.3506 1.7745-4.3077 1.7745-1.6254 0-2.7673-.396-3.4874-1.2087-.8204-.9284-1.075-2.3995-.8024-4.6344.2289-1.8568.6764-3.15557 1.4119-4.08913.9439-1.19589 2.3584-1.77711 4.3207-1.77711h.0051Zm-1.1161 9.05784c1.7925 0 2.0985-1.3347 2.3146-3.081.1543-1.2499.1594-2.1243-.2855-2.62836-.2649-.3009-.6841-.4475-1.2782-.4475-.8152 0-1.3605.2649-1.7205.83069-.3601.56577-.5041 1.40937-.6044 2.23747-.1543 1.255-.1594 2.1346.2855 2.6412.2674.3035.6918.4501 1.2936.4501M80.7261 6.28671l-.337 2.74668h-3.423l-1.0622 8.68491h-3.0398l1.0621-8.68491h-3.0038l.3369-2.74668h9.4668ZM8.76221 17.7158h2.99869l.6533-1.6073.0077-.018h3.3742l.0051.0257.2572 1.6022h3.0939L17.298 7.93271c-.18-.95413-1.0159-1.64337-1.9854-1.64337h-1.5765L8.76221 17.7184v-.0026Zm6.61719-4.1843h-1.9622l.018-.0437 1.3527-3.1633.0412-.0952.018.1003.5632 3.1633.0051.036h-.036v.0026Z"
|
|
20
|
+
/>
|
|
21
|
+
<Path
|
|
22
|
+
fill="#3EBEEF"
|
|
23
|
+
d="M121.736 6.28672c.969 0 1.805.69181 1.985 1.64338l1.855 9.7857h-3.094l-.257-1.6022-.006-.0258h-3.374l-.008.018-.653 1.6074h-2.998l4.973-11.42905h1.577v.00257Zm-1.895 7.24218h1.998l-.005-.036-.564-3.1633-.018-.1003-.041.0951-1.353 3.1634-.017.0437M116.279 7.26657c-.577-.65067-1.556-.97986-2.917-.97986h-4.765l-1.405 11.42909h2.963l.414-3.3691v-.0283h1.736c1.433 0 2.554-.4089 3.333-1.2164.671-.697 1.091-1.6871 1.245-2.9422.159-1.30643-.039-2.25286-.604-2.89323Zm-2.367 3.08873c-.123 1.0107-.511 1.4222-1.334 1.4222h-1.695l.005-.0334.347-2.8213v-.02829h1.69c.378 0 .64.09002.802.27261.198.22375.257.6018.185 1.18818ZM136.014 6.28671l-4.685 7.78479v.0052l-.005.0077-.445 3.6339h-3.009l.452-3.6879v-.0129l-2.754-7.72822h3.207l1.486 4.49292.021.0643.033-.0591 2.608-4.49812h3.091M135.66 17.3609c-.237.2366-.522.3549-.857.3549-.334 0-.619-.1183-.856-.3549-.234-.2366-.35-.5221-.35-.859s.118-.6172.355-.8538c.234-.2341.52-.3524.851-.3524.332 0 .62.1183.857.3524.236.2366.355.5195.355.8538 0 .3344-.119.6224-.355.859Zm-1.592-1.5945c-.203.2032-.304.45-.304.7381 0 .288.101.5375.301.7432.203.2058.448.3061.738.3061.291 0 .535-.1029.736-.3061.203-.2057.303-.4526.303-.7432 0-.2906-.1-.5324-.303-.7381-.203-.2058-.45-.3061-.736-.3061-.285 0-.532.1029-.735.3061Zm.712.0669c.165 0 .286.0154.363.0488.136.0566.206.1698.206.3369 0 .1183-.044.2058-.129.2623-.046.0309-.111.0515-.193.0643.103.0155.18.0592.229.1286.049.0695.072.1389.072.2058v.0977c0 .0309 0 .0643.003.1003 0 .036.005.0566.01.0694l.008.0155h-.219V17.15s-.005-.0103-.005-.0154l-.005-.0437v-.1055c0-.1543-.041-.2546-.126-.3035-.049-.0282-.137-.0437-.26-.0437h-.185v.5221h-.234v-1.3296h.465v.0026Zm.252.2083c-.059-.0335-.154-.0489-.283-.0489h-.2v.4809h.211c.1 0 .175-.0103.223-.0308.09-.036.137-.1055.137-.2083 0-.0978-.029-.1621-.088-.1955v.0026Z"
|
|
24
|
+
/>
|
|
25
|
+
</Svg>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default LogoPaymentCardBancomatPay;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Svg, Path } from "react-native-svg";
|
|
3
|
+
import { SVGCardLogoProps } from "../LogoPaymentCard";
|
|
4
|
+
|
|
5
|
+
const LogoPaymentCardPayPal = ({ preserveAspectRatio }: SVGCardLogoProps) => (
|
|
6
|
+
<Svg viewBox="0 0 170 48" preserveAspectRatio={preserveAspectRatio}>
|
|
7
|
+
<Path
|
|
8
|
+
fill="#003087"
|
|
9
|
+
d="M62.56 28.672a10.111 10.111 0 0 0 9.983-8.56c.78-4.967-3.101-9.303-8.6-9.303H55.08a.689.689 0 0 0-.69.585l-3.95 25.072a.643.643 0 0 0 .634.742h4.69a.689.689 0 0 0 .688-.585l1.162-7.365a.689.689 0 0 1 .689-.586h4.257Zm3.925-8.786c-.29 1.836-1.709 3.189-4.425 3.189h-3.474l1.053-6.68h3.411c2.81.006 3.723 1.663 3.435 3.496v-.005Zm26.378-1.18H88.41a.69.69 0 0 0-.69.585l-.144.924s-3.457-3.775-9.575-1.225c-3.51 1.461-5.194 4.48-5.91 6.69 0 0-2.277 6.718 2.87 10.417 0 0 4.771 3.556 10.145-.22l-.093.589a.642.642 0 0 0 .634.742h4.451a.689.689 0 0 0 .69-.585l2.708-17.175a.643.643 0 0 0-.634-.742Zm-6.547 9.492a4.996 4.996 0 0 1-4.996 4.276 4.513 4.513 0 0 1-1.397-.205c-1.92-.616-3.015-2.462-2.7-4.462a4.996 4.996 0 0 1 5.014-4.277c.474-.005.946.065 1.398.206 1.913.614 3.001 2.46 2.686 4.462h-.005Z"
|
|
10
|
+
/>
|
|
11
|
+
<Path
|
|
12
|
+
fill="#0070E0"
|
|
13
|
+
d="M126.672 28.672a10.115 10.115 0 0 0 9.992-8.56c.779-4.967-3.101-9.303-8.602-9.303h-8.86a.69.69 0 0 0-.689.585l-3.962 25.079a.637.637 0 0 0 .365.683.64.64 0 0 0 .269.06h4.691a.69.69 0 0 0 .689-.586l1.163-7.365a.688.688 0 0 1 .689-.586l4.255-.007Zm3.925-8.786c-.29 1.836-1.709 3.189-4.426 3.189h-3.473l1.054-6.68h3.411c2.808.006 3.723 1.663 3.434 3.496v-.005Zm26.377-1.18h-4.448a.69.69 0 0 0-.689.585l-.146.924s-3.456-3.775-9.574-1.225c-3.509 1.461-5.194 4.48-5.911 6.69 0 0-2.276 6.718 2.87 10.417 0 0 4.772 3.556 10.146-.22l-.093.589a.637.637 0 0 0 .365.683c.084.04.176.06.269.06h4.451a.686.686 0 0 0 .689-.586l2.709-17.175a.657.657 0 0 0-.148-.518.632.632 0 0 0-.49-.224Zm-6.546 9.492a4.986 4.986 0 0 1-4.996 4.276 4.513 4.513 0 0 1-1.399-.205c-1.921-.616-3.017-2.462-2.702-4.462a4.996 4.996 0 0 1 4.996-4.277c.475-.005.947.064 1.399.206 1.933.614 3.024 2.46 2.707 4.462h-.005Z"
|
|
14
|
+
/>
|
|
15
|
+
<Path
|
|
16
|
+
fill="#003087"
|
|
17
|
+
d="m109.205 19.131-5.367 9.059-2.723-8.992a.69.69 0 0 0-.664-.492h-4.842a.516.516 0 0 0-.496.689l4.88 15.146-4.413 7.138a.517.517 0 0 0 .442.794h5.217a.858.858 0 0 0 .741-.418l13.632-22.552a.516.516 0 0 0-.446-.789h-5.215a.858.858 0 0 0-.746.417Z"
|
|
18
|
+
/>
|
|
19
|
+
<Path
|
|
20
|
+
fill="#0070E0"
|
|
21
|
+
d="m161.982 11.387-3.962 25.079a.637.637 0 0 0 .365.683c.084.04.176.06.269.06h4.689a.688.688 0 0 0 .689-.586l3.963-25.079a.637.637 0 0 0-.146-.517.645.645 0 0 0-.488-.225h-4.69a.69.69 0 0 0-.689.585Z"
|
|
22
|
+
/>
|
|
23
|
+
<Path
|
|
24
|
+
fill="#001C64"
|
|
25
|
+
d="M37.146 22.26c-1.006 5.735-5.685 10.07-11.825 10.07h-3.898c-.795 0-1.596.736-1.723 1.55l-1.707 10.835c-.099.617-.388.822-1.013.822h-6.27c-.634 0-.784-.212-.689-.837l.72-7.493-7.526-.389c-.633 0-.862-.345-.772-.977l5.135-32.56c.099-.617.483-.882 1.106-.882h13.023c6.269 0 10.235 4.22 10.72 9.692 3.73 2.52 5.474 5.873 4.72 10.168Z"
|
|
26
|
+
/>
|
|
27
|
+
<Path
|
|
28
|
+
fill="#0070E0"
|
|
29
|
+
d="m12.649 25.075-1.907 12.133-1.206 7.612a1.034 1.034 0 0 0 1.016 1.19h6.622a1.27 1.27 0 0 0 1.253-1.072l1.743-11.06a1.27 1.27 0 0 1 1.253-1.071h3.898A12.46 12.46 0 0 0 37.617 22.26c.675-4.307-1.492-8.228-5.201-10.165a9.96 9.96 0 0 1-.12 1.37 12.461 12.461 0 0 1-12.295 10.54h-6.1a1.268 1.268 0 0 0-1.252 1.07Z"
|
|
30
|
+
/>
|
|
31
|
+
<Path
|
|
32
|
+
fill="#003087"
|
|
33
|
+
d="M10.741 37.208H3.03a1.035 1.035 0 0 1-1.018-1.192L7.208 3.072A1.268 1.268 0 0 1 8.46 2H21.7c6.269 0 10.827 4.562 10.72 10.089a11.567 11.567 0 0 0-5.399-1.287H15.983a1.27 1.27 0 0 0-1.254 1.071l-2.08 13.202-1.908 12.133Z"
|
|
34
|
+
/>
|
|
35
|
+
</Svg>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export default LogoPaymentCardPayPal;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 137 24">
|
|
2
|
+
<path
|
|
3
|
+
fill="#3FBDEE"
|
|
4
|
+
d="M104.986 10.8594 94.6035.4745c-.6327-.63267-1.6562-.63267-2.2889 0L81.9323 10.8568c-.6327.6327-.6327 1.6563 0 2.2864l10.3823 10.3823c.6327.6327 1.6562.6327 2.2889 0l10.3825-10.3823c.632-.6327.632-1.6563 0-2.2864v.0026Zm-7.0932 3.634c-.2674 2.1757-1.8465 3.225-4.4209 3.225H88.246l.3035-2.4226h5.1873c.6635 0 1.021-.4012 1.1085-1.1111.0102-.0771.0128-.1466.0128-.216h3.0733c-.0051.1646-.0154.3369-.0386.5247Zm2.0806-1.376H88.817l.27-2.186h5.0381c.7381 0 .9696-.5092 1.0442-1.12643.0746-.61723-.0309-1.003-.787-1.003h-5.033l.3035-2.51521h5.1487c2.9319 0 3.7188 1.24989 3.508 2.9627-.0849.69953-.2855 1.25764-.571 1.68194h.3009c1.1728 0 2.0806 1.0236 1.9366 2.1886l-.0026-.0026Z"
|
|
5
|
+
/>
|
|
6
|
+
<path
|
|
7
|
+
fill="#223264"
|
|
8
|
+
d="M1.4042 6.28671h4.56494c2.93184 0 3.71881 1.2499 3.50793 2.96271-.16203 1.32708-.72525 2.14488-1.54051 2.49978 1.00043.4012 1.31676 1.219 1.12902 2.7467-.26747 2.1757-1.84655 3.225-4.42092 3.225H0L1.4042 6.28671Zm3.88856 4.64209c.74067 0 .97213-.5092 1.04929-1.12644.07458-.61723-.03086-1.003-.78697-1.003H4.10459l-.26233 2.12944h1.4505Zm-.38063 4.3643c.66352 0 1.021-.4012 1.10844-1.111.08745-.7098-.16202-1.0647-.8564-1.0647H3.5748l-.26747 2.1757h1.6048ZM61.772 6.28672 60.3678 17.7158H57.436l.7844-6.3858.0257-.2186-.0849.2032-2.7029 6.4012H53.55l-1.1625-6.3961-.036-.198-.0257.2006-.7844 6.3935h-2.6515l1.4042-11.42908h2.1706c.9927 0 1.8363.70982 2.006 1.68967l.7638 4.44151.018.1029.0412-.0978 2.5949-6.13885h3.8834M67.4454 6.28672c.9695 0 1.8054.69181 1.9854 1.64338l1.8543 9.7857h-3.0939l-.2572-1.6022-.0051-.0258h-3.3742l-.0077.018-.6533 1.6074H60.895l4.9739-11.42905h1.5765v.00257ZM65.55 13.5289h1.9983l-.0052-.036-.5632-3.1633-.018-.1003-.0412.0951-1.3527 3.1634-.018.0437M30.3394 6.28671 28.9352 17.7158h-2.775l-2.8264-5.9512-.0463-.0951-.0128.1054-.7304 5.9434h-2.8522l1.4042-11.42902h1.8852c.7844 0 1.5096.46036 1.8414 1.17017l1.9365 4.13035.0463.0977.0129-.1055.6506-5.29272h2.8702M36.3806 6.14787c1.2653 0 2.3634.30348 3.1813.87442l-1.9212 2.51007c-.4526-.29833-1.0518-.45521-1.7359-.45521-1.3116 0-1.9906.45264-2.3069 3.01925-.1723 1.4094-.0798 2.2272.3009 2.6593.2571.2906.6455.414 1.2962.414.7072 0 1.2576-.162 1.9519-.576l1.1985 2.3326c-.967.5581-1.9623.9284-3.6571.9284-1.5354 0-2.6181-.3806-3.3125-1.1676-.8229-.931-1.093-2.4612-.8204-4.6781.2392-1.9546.7253-3.29962 1.5277-4.23318.9438-1.09816 2.3506-1.63309 4.2975-1.63309"
|
|
9
|
+
/>
|
|
10
|
+
<path
|
|
11
|
+
fill="#223264"
|
|
12
|
+
d="M44.3918 6.14786c1.6228 0 2.7595.39348 3.4745 1.2036.8307.9387 1.075 2.37377.7947 4.65494-.2263 1.8491-.6738 3.1453-1.4094 4.0763-.9438 1.1959-2.3506 1.7745-4.3077 1.7745-1.6254 0-2.7673-.396-3.4874-1.2087-.8204-.9284-1.075-2.3995-.8024-4.6344.2289-1.8568.6764-3.15557 1.4119-4.08913.9439-1.19589 2.3584-1.77711 4.3207-1.77711h.0051Zm-1.1161 9.05784c1.7925 0 2.0985-1.3347 2.3146-3.081.1543-1.2499.1594-2.1243-.2855-2.62836-.2649-.3009-.6841-.4475-1.2782-.4475-.8152 0-1.3605.2649-1.7205.83069-.3601.56577-.5041 1.40937-.6044 2.23747-.1543 1.255-.1594 2.1346.2855 2.6412.2674.3035.6918.4501 1.2936.4501M80.7261 6.28671l-.337 2.74668h-3.423l-1.0622 8.68491h-3.0398l1.0621-8.68491h-3.0038l.3369-2.74668h9.4668ZM8.76221 17.7158h2.99869l.6533-1.6073.0077-.018h3.3742l.0051.0257.2572 1.6022h3.0939L17.298 7.93271c-.18-.95413-1.0159-1.64337-1.9854-1.64337h-1.5765L8.76221 17.7184v-.0026Zm6.61719-4.1843h-1.9622l.018-.0437 1.3527-3.1633.0412-.0952.018.1003.5632 3.1633.0051.036h-.036v.0026Z"
|
|
13
|
+
/>
|
|
14
|
+
<path
|
|
15
|
+
fill="#3EBEEF"
|
|
16
|
+
d="M121.736 6.28672c.969 0 1.805.69181 1.985 1.64338l1.855 9.7857h-3.094l-.257-1.6022-.006-.0258h-3.374l-.008.018-.653 1.6074h-2.998l4.973-11.42905h1.577v.00257Zm-1.895 7.24218h1.998l-.005-.036-.564-3.1633-.018-.1003-.041.0951-1.353 3.1634-.017.0437M116.279 7.26657c-.577-.65067-1.556-.97986-2.917-.97986h-4.765l-1.405 11.42909h2.963l.414-3.3691v-.0283h1.736c1.433 0 2.554-.4089 3.333-1.2164.671-.697 1.091-1.6871 1.245-2.9422.159-1.30643-.039-2.25286-.604-2.89323Zm-2.367 3.08873c-.123 1.0107-.511 1.4222-1.334 1.4222h-1.695l.005-.0334.347-2.8213v-.02829h1.69c.378 0 .64.09002.802.27261.198.22375.257.6018.185 1.18818ZM136.014 6.28671l-4.685 7.78479v.0052l-.005.0077-.445 3.6339h-3.009l.452-3.6879v-.0129l-2.754-7.72822h3.207l1.486 4.49292.021.0643.033-.0591 2.608-4.49812h3.091M135.66 17.3609c-.237.2366-.522.3549-.857.3549-.334 0-.619-.1183-.856-.3549-.234-.2366-.35-.5221-.35-.859s.118-.6172.355-.8538c.234-.2341.52-.3524.851-.3524.332 0 .62.1183.857.3524.236.2366.355.5195.355.8538 0 .3344-.119.6224-.355.859Zm-1.592-1.5945c-.203.2032-.304.45-.304.7381 0 .288.101.5375.301.7432.203.2058.448.3061.738.3061.291 0 .535-.1029.736-.3061.203-.2057.303-.4526.303-.7432 0-.2906-.1-.5324-.303-.7381-.203-.2058-.45-.3061-.736-.3061-.285 0-.532.1029-.735.3061Zm.712.0669c.165 0 .286.0154.363.0488.136.0566.206.1698.206.3369 0 .1183-.044.2058-.129.2623-.046.0309-.111.0515-.193.0643.103.0155.18.0592.229.1286.049.0695.072.1389.072.2058v.0977c0 .0309 0 .0643.003.1003 0 .036.005.0566.01.0694l.008.0155h-.219V17.15s-.005-.0103-.005-.0154l-.005-.0437v-.1055c0-.1543-.041-.2546-.126-.3035-.049-.0282-.137-.0437-.26-.0437h-.185v.5221h-.234v-1.3296h.465v.0026Zm.252.2083c-.059-.0335-.154-.0489-.283-.0489h-.2v.4809h.211c.1 0 .175-.0103.223-.0308.09-.036.137-.1055.137-.2083 0-.0978-.029-.1621-.088-.1955v.0026Z"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 170 48">
|
|
2
|
+
<path
|
|
3
|
+
fill="#003087"
|
|
4
|
+
d="M62.56 28.672a10.111 10.111 0 0 0 9.983-8.56c.78-4.967-3.101-9.303-8.6-9.303H55.08a.689.689 0 0 0-.69.585l-3.95 25.072a.643.643 0 0 0 .634.742h4.69a.689.689 0 0 0 .688-.585l1.162-7.365a.689.689 0 0 1 .689-.586h4.257Zm3.925-8.786c-.29 1.836-1.709 3.189-4.425 3.189h-3.474l1.053-6.68h3.411c2.81.006 3.723 1.663 3.435 3.496v-.005Zm26.378-1.18H88.41a.69.69 0 0 0-.69.585l-.144.924s-3.457-3.775-9.575-1.225c-3.51 1.461-5.194 4.48-5.91 6.69 0 0-2.277 6.718 2.87 10.417 0 0 4.771 3.556 10.145-.22l-.093.589a.642.642 0 0 0 .634.742h4.451a.689.689 0 0 0 .69-.585l2.708-17.175a.643.643 0 0 0-.634-.742Zm-6.547 9.492a4.996 4.996 0 0 1-4.996 4.276 4.513 4.513 0 0 1-1.397-.205c-1.92-.616-3.015-2.462-2.7-4.462a4.996 4.996 0 0 1 5.014-4.277c.474-.005.946.065 1.398.206 1.913.614 3.001 2.46 2.686 4.462h-.005Z"
|
|
5
|
+
/>
|
|
6
|
+
<path
|
|
7
|
+
fill="#0070E0"
|
|
8
|
+
d="M126.672 28.672a10.115 10.115 0 0 0 9.992-8.56c.779-4.967-3.101-9.303-8.602-9.303h-8.86a.69.69 0 0 0-.689.585l-3.962 25.079a.637.637 0 0 0 .365.683.64.64 0 0 0 .269.06h4.691a.69.69 0 0 0 .689-.586l1.163-7.365a.688.688 0 0 1 .689-.586l4.255-.007Zm3.925-8.786c-.29 1.836-1.709 3.189-4.426 3.189h-3.473l1.054-6.68h3.411c2.808.006 3.723 1.663 3.434 3.496v-.005Zm26.377-1.18h-4.448a.69.69 0 0 0-.689.585l-.146.924s-3.456-3.775-9.574-1.225c-3.509 1.461-5.194 4.48-5.911 6.69 0 0-2.276 6.718 2.87 10.417 0 0 4.772 3.556 10.146-.22l-.093.589a.637.637 0 0 0 .365.683c.084.04.176.06.269.06h4.451a.686.686 0 0 0 .689-.586l2.709-17.175a.657.657 0 0 0-.148-.518.632.632 0 0 0-.49-.224Zm-6.546 9.492a4.986 4.986 0 0 1-4.996 4.276 4.513 4.513 0 0 1-1.399-.205c-1.921-.616-3.017-2.462-2.702-4.462a4.996 4.996 0 0 1 4.996-4.277c.475-.005.947.064 1.399.206 1.933.614 3.024 2.46 2.707 4.462h-.005Z"
|
|
9
|
+
/>
|
|
10
|
+
<path
|
|
11
|
+
fill="#003087"
|
|
12
|
+
d="m109.205 19.131-5.367 9.059-2.723-8.992a.69.69 0 0 0-.664-.492h-4.842a.516.516 0 0 0-.496.689l4.88 15.146-4.413 7.138a.517.517 0 0 0 .442.794h5.217a.858.858 0 0 0 .741-.418l13.632-22.552a.516.516 0 0 0-.446-.789h-5.215a.858.858 0 0 0-.746.417Z"
|
|
13
|
+
/>
|
|
14
|
+
<path
|
|
15
|
+
fill="#0070E0"
|
|
16
|
+
d="m161.982 11.387-3.962 25.079a.637.637 0 0 0 .365.683c.084.04.176.06.269.06h4.689a.688.688 0 0 0 .689-.586l3.963-25.079a.637.637 0 0 0-.146-.517.645.645 0 0 0-.488-.225h-4.69a.69.69 0 0 0-.689.585Z"
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
fill="#001C64"
|
|
20
|
+
d="M37.146 22.26c-1.006 5.735-5.685 10.07-11.825 10.07h-3.898c-.795 0-1.596.736-1.723 1.55l-1.707 10.835c-.099.617-.388.822-1.013.822h-6.27c-.634 0-.784-.212-.689-.837l.72-7.493-7.526-.389c-.633 0-.862-.345-.772-.977l5.135-32.56c.099-.617.483-.882 1.106-.882h13.023c6.269 0 10.235 4.22 10.72 9.692 3.73 2.52 5.474 5.873 4.72 10.168Z"
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
fill="#0070E0"
|
|
24
|
+
d="m12.649 25.075-1.907 12.133-1.206 7.612a1.034 1.034 0 0 0 1.016 1.19h6.622a1.27 1.27 0 0 0 1.253-1.072l1.743-11.06a1.27 1.27 0 0 1 1.253-1.071h3.898A12.46 12.46 0 0 0 37.617 22.26c.675-4.307-1.492-8.228-5.201-10.165a9.96 9.96 0 0 1-.12 1.37 12.461 12.461 0 0 1-12.295 10.54h-6.1a1.268 1.268 0 0 0-1.252 1.07Z"
|
|
25
|
+
/>
|
|
26
|
+
<path
|
|
27
|
+
fill="#003087"
|
|
28
|
+
d="M10.741 37.208H3.03a1.035 1.035 0 0 1-1.018-1.192L7.208 3.072A1.268 1.268 0 0 1 8.46 2H21.7c6.269 0 10.827 4.562 10.72 10.089a11.567 11.567 0 0 0-5.399-1.287H15.983a1.27 1.27 0 0 0-1.254 1.071l-2.08 13.202-1.908 12.133Z"
|
|
29
|
+
/>
|
|
30
|
+
</svg>
|
|
@@ -4,7 +4,7 @@ import { Divider } from "../divider";
|
|
|
4
4
|
import { IOIcons } from "../icons";
|
|
5
5
|
import { ListItemRadio } from "../listitems/ListItemRadio";
|
|
6
6
|
|
|
7
|
-
export type
|
|
7
|
+
export type RadioItem<T> = {
|
|
8
8
|
id: T;
|
|
9
9
|
value: string;
|
|
10
10
|
description?: string;
|
|
@@ -13,7 +13,7 @@ export type NewRadioItem<T> = {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
type Props<T> = {
|
|
16
|
-
items: ReadonlyArray<
|
|
16
|
+
items: ReadonlyArray<RadioItem<T>>;
|
|
17
17
|
selectedItem?: T;
|
|
18
18
|
onPress: (selected: T) => void;
|
|
19
19
|
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { Icon } from "../icons";
|
|
4
|
+
import { IOColors, IOAlertRadius } from "../../core";
|
|
5
|
+
import { ButtonText } from "../typography";
|
|
6
|
+
import { Toast, ToastVariant } from "./types";
|
|
7
|
+
|
|
8
|
+
type ColorVariant = {
|
|
9
|
+
background: IOColors;
|
|
10
|
+
stroke: IOColors;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const toastColorVariants: Record<ToastVariant, ColorVariant> = {
|
|
14
|
+
neutral: {
|
|
15
|
+
background: "turquoise-150",
|
|
16
|
+
stroke: "turquoise-850"
|
|
17
|
+
},
|
|
18
|
+
error: {
|
|
19
|
+
background: "error-100",
|
|
20
|
+
stroke: "error-850"
|
|
21
|
+
},
|
|
22
|
+
info: {
|
|
23
|
+
background: "info-100",
|
|
24
|
+
stroke: "info-850"
|
|
25
|
+
},
|
|
26
|
+
success: {
|
|
27
|
+
background: "success-100",
|
|
28
|
+
stroke: "success-850"
|
|
29
|
+
},
|
|
30
|
+
warning: {
|
|
31
|
+
background: "warning-100",
|
|
32
|
+
stroke: "warning-850"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type Props = Pick<Toast, "message" | "variant" | "icon">;
|
|
37
|
+
|
|
38
|
+
const ToastNotification = ({ message, variant = "neutral", icon }: Props) => {
|
|
39
|
+
const colors = toastColorVariants[variant];
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<View
|
|
43
|
+
style={[
|
|
44
|
+
styles.toast,
|
|
45
|
+
{
|
|
46
|
+
backgroundColor: IOColors[colors.background],
|
|
47
|
+
borderColor: IOColors[colors.stroke]
|
|
48
|
+
}
|
|
49
|
+
]}
|
|
50
|
+
accessible={true}
|
|
51
|
+
accessibilityRole={"alert"}
|
|
52
|
+
accessibilityLabel={message}
|
|
53
|
+
>
|
|
54
|
+
<ButtonText color={colors.stroke} style={styles.content}>
|
|
55
|
+
{message}
|
|
56
|
+
</ButtonText>
|
|
57
|
+
{icon && <Icon name={icon} size={24} color={colors.stroke} />}
|
|
58
|
+
</View>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const styles = StyleSheet.create({
|
|
63
|
+
toast: {
|
|
64
|
+
borderRadius: IOAlertRadius,
|
|
65
|
+
borderWidth: 1,
|
|
66
|
+
padding: 16,
|
|
67
|
+
flexDirection: "row",
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
justifyContent: "space-between"
|
|
70
|
+
},
|
|
71
|
+
content: {
|
|
72
|
+
paddingVertical: 2
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export { ToastNotification };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { throttle } from "lodash";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { SafeAreaView, StyleSheet, View } from "react-native";
|
|
4
|
+
import Animated, {
|
|
5
|
+
Easing,
|
|
6
|
+
SequencedTransition,
|
|
7
|
+
SlideInUp,
|
|
8
|
+
SlideOutUp
|
|
9
|
+
} from "react-native-reanimated";
|
|
10
|
+
import { Dismissable } from "../layout/Dismissable";
|
|
11
|
+
import { triggerHaptic } from "../../functions";
|
|
12
|
+
import { ToastNotification } from "./ToastNotification";
|
|
13
|
+
import { Toast } from "./types";
|
|
14
|
+
import { IOToastRef, useIOToast } from "./useIOToast";
|
|
15
|
+
import { ToastContext } from "./context";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The maximum number of toasts that can be displayed at the same time
|
|
19
|
+
* If the number of the toasts exceeds this number, the oldest one will be removed
|
|
20
|
+
*/
|
|
21
|
+
export const MAX_TOAST_STACK_SIZE = 3;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The time in milliseconds that a toast notification will be displayed
|
|
25
|
+
*/
|
|
26
|
+
export const TOAST_DURATION_TIME = 5000;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This is the time in milliseconds between two toast notifications.
|
|
30
|
+
* This will throttle the toast notifications to avoid displaying too many of them at the same time
|
|
31
|
+
* and causing visual glitches.
|
|
32
|
+
*/
|
|
33
|
+
export const TOAST_THROTTLE_TIME = 500;
|
|
34
|
+
|
|
35
|
+
type ToastNotificationStackItem = Toast & { id: number };
|
|
36
|
+
type ToastNotificationStackItemProps = ToastNotificationStackItem &
|
|
37
|
+
Pick<Dismissable, "onDismiss">;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A toast notification item that can be swiped to the right to dismiss it, with enter and exit animations
|
|
41
|
+
*/
|
|
42
|
+
const ToastNotificationStackItem = ({
|
|
43
|
+
onDismiss,
|
|
44
|
+
...toast
|
|
45
|
+
}: ToastNotificationStackItemProps) => (
|
|
46
|
+
<Animated.View
|
|
47
|
+
entering={SlideInUp.duration(300).easing(Easing.inOut(Easing.exp))}
|
|
48
|
+
exiting={SlideOutUp.duration(300).easing(Easing.inOut(Easing.exp))}
|
|
49
|
+
layout={SequencedTransition.duration(300)}
|
|
50
|
+
style={{ paddingBottom: 8 }}
|
|
51
|
+
>
|
|
52
|
+
<Dismissable onDismiss={onDismiss}>
|
|
53
|
+
<ToastNotification {...toast} />
|
|
54
|
+
</Dismissable>
|
|
55
|
+
</Animated.View>
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
type ToastProviderProps = {
|
|
59
|
+
children: React.ReactNode;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const ToastProvider = ({ children }: ToastProviderProps) => {
|
|
63
|
+
const toastId = React.useRef(1);
|
|
64
|
+
const [toasts, setToasts] = React.useState<
|
|
65
|
+
ReadonlyArray<ToastNotificationStackItem>
|
|
66
|
+
>([]);
|
|
67
|
+
|
|
68
|
+
const addToast = React.useCallback((toast: Toast): number => {
|
|
69
|
+
const id = (toastId.current ?? 0) + 1;
|
|
70
|
+
setToasts(prevToasts => [{ id, ...toast }, ...prevToasts]);
|
|
71
|
+
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
setToasts(prevToasts => prevToasts.filter(t => t.id !== id));
|
|
74
|
+
}, TOAST_DURATION_TIME);
|
|
75
|
+
|
|
76
|
+
if (toast.hapticFeedback) {
|
|
77
|
+
triggerHaptic(toast.hapticFeedback);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return id;
|
|
81
|
+
}, []);
|
|
82
|
+
|
|
83
|
+
const removeToast = React.useCallback((id: number) => {
|
|
84
|
+
setToasts(prevToasts => prevToasts.filter(t => t.id !== id));
|
|
85
|
+
}, []);
|
|
86
|
+
|
|
87
|
+
const removeToastAtIndex = (index: number) => {
|
|
88
|
+
setToasts(prevToasts => [
|
|
89
|
+
...prevToasts.slice(0, index),
|
|
90
|
+
...prevToasts.slice(index + 1)
|
|
91
|
+
]);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// If stack size exceed the maximum, remove the oldest toast
|
|
95
|
+
React.useEffect(() => {
|
|
96
|
+
if (toasts.length > MAX_TOAST_STACK_SIZE) {
|
|
97
|
+
removeToastAtIndex(MAX_TOAST_STACK_SIZE);
|
|
98
|
+
}
|
|
99
|
+
}, [toasts]);
|
|
100
|
+
|
|
101
|
+
const removeAllToasts = React.useCallback(() => {
|
|
102
|
+
setToasts([]);
|
|
103
|
+
}, []);
|
|
104
|
+
|
|
105
|
+
const contextValue = React.useMemo(
|
|
106
|
+
() => ({
|
|
107
|
+
addToast: throttle(addToast, TOAST_THROTTLE_TIME),
|
|
108
|
+
removeToast: throttle(removeToast, TOAST_THROTTLE_TIME),
|
|
109
|
+
removeAllToasts
|
|
110
|
+
}),
|
|
111
|
+
[addToast, removeToast, removeAllToasts]
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<ToastContext.Provider value={contextValue as ToastContext}>
|
|
116
|
+
<InitializeToastRef />
|
|
117
|
+
<SafeAreaView style={styles.container} pointerEvents="box-none">
|
|
118
|
+
<View style={styles.list} pointerEvents="box-none">
|
|
119
|
+
{toasts.map(toast => (
|
|
120
|
+
<ToastNotificationStackItem
|
|
121
|
+
key={toast.id}
|
|
122
|
+
{...toast}
|
|
123
|
+
onDismiss={() => removeToast(toast.id)}
|
|
124
|
+
/>
|
|
125
|
+
))}
|
|
126
|
+
</View>
|
|
127
|
+
</SafeAreaView>
|
|
128
|
+
{children}
|
|
129
|
+
</ToastContext.Provider>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const InitializeToastRef = () => {
|
|
134
|
+
const toast = useIOToast();
|
|
135
|
+
// eslint-disable-next-line functional/immutable-data
|
|
136
|
+
IOToastRef.current = toast;
|
|
137
|
+
return null;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const styles = StyleSheet.create({
|
|
141
|
+
container: {
|
|
142
|
+
zIndex: 1000,
|
|
143
|
+
position: "absolute",
|
|
144
|
+
bottom: 0,
|
|
145
|
+
left: 0,
|
|
146
|
+
right: 0,
|
|
147
|
+
top: 0,
|
|
148
|
+
overflow: "visible"
|
|
149
|
+
},
|
|
150
|
+
list: {
|
|
151
|
+
padding: 24
|
|
152
|
+
}
|
|
153
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
import { Toast } from "./types";
|
|
3
|
+
|
|
4
|
+
export type ToastContext = {
|
|
5
|
+
addToast: (props: Toast) => number;
|
|
6
|
+
removeToast: (id: number) => void;
|
|
7
|
+
removeAllToasts: () => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const ToastContext = createContext<ToastContext>({
|
|
11
|
+
addToast: () => 0,
|
|
12
|
+
removeToast: () => undefined,
|
|
13
|
+
removeAllToasts: () => undefined
|
|
14
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HapticFeedbackTypes } from "react-native-haptic-feedback";
|
|
2
|
+
import { IOIcons } from "@pagopa/io-app-design-system";
|
|
3
|
+
|
|
4
|
+
export type ToastVariant = "neutral" | "error" | "info" | "success" | "warning";
|
|
5
|
+
|
|
6
|
+
export type Toast = {
|
|
7
|
+
message: string;
|
|
8
|
+
variant?: ToastVariant;
|
|
9
|
+
icon?: IOIcons;
|
|
10
|
+
hapticFeedback?: keyof typeof HapticFeedbackTypes;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type ToastOptions = Omit<Toast, "message">;
|