@pagopa/io-app-design-system 1.34.0 → 1.35.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/buttons/ButtonSolid.js +2 -2
- package/lib/commonjs/components/listitems/ListItemAction.js +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -4
- package/lib/commonjs/components/modules/ModuleCheckout.js +34 -33
- package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/commonjs/core/IOColors.js +7 -7
- package/lib/module/components/buttons/ButtonSolid.js +2 -2
- package/lib/module/components/listitems/ListItemAction.js +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -4
- package/lib/module/components/modules/ModuleCheckout.js +36 -37
- package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/module/core/IOColors.js +7 -7
- package/lib/typescript/components/modules/ModuleCheckout.d.ts +19 -11
- package/lib/typescript/components/modules/ModuleCheckout.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/buttons/ButtonSolid.tsx +2 -2
- package/src/components/listitems/ListItemAction.tsx +1 -1
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -4
- package/src/components/modules/ModuleCheckout.tsx +65 -50
- package/src/core/IOColors.ts +7 -7
|
@@ -47,8 +47,8 @@ const mapColorStates = {
|
|
|
47
47
|
},
|
|
48
48
|
// Danger button
|
|
49
49
|
danger: {
|
|
50
|
-
default: _core.IOColors["error-
|
|
51
|
-
pressed: _core.IOColors["error-
|
|
50
|
+
default: _core.IOColors["error-600"],
|
|
51
|
+
pressed: _core.IOColors["error-500"],
|
|
52
52
|
label: {
|
|
53
53
|
default: "white",
|
|
54
54
|
disabled: "grey-700"
|
|
@@ -777,7 +777,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
|
|
|
777
777
|
"borderWidth": 0,
|
|
778
778
|
},
|
|
779
779
|
{
|
|
780
|
-
"color": "#
|
|
780
|
+
"color": "#D13333",
|
|
781
781
|
},
|
|
782
782
|
{
|
|
783
783
|
"flex": 0,
|
|
@@ -786,7 +786,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
|
|
|
786
786
|
},
|
|
787
787
|
]
|
|
788
788
|
}
|
|
789
|
-
tintColor="#
|
|
789
|
+
tintColor="#D13333"
|
|
790
790
|
vbHeight={24}
|
|
791
791
|
vbWidth={24}
|
|
792
792
|
width={24}
|
|
@@ -2582,7 +2582,7 @@ exports[`Test List Item Components ListItemNavAlert Snapshot 1`] = `
|
|
|
2582
2582
|
"borderWidth": 0,
|
|
2583
2583
|
},
|
|
2584
2584
|
{
|
|
2585
|
-
"color": "#
|
|
2585
|
+
"color": "#D13333",
|
|
2586
2586
|
},
|
|
2587
2587
|
{
|
|
2588
2588
|
"flex": 0,
|
|
@@ -2591,7 +2591,7 @@ exports[`Test List Item Components ListItemNavAlert Snapshot 1`] = `
|
|
|
2591
2591
|
},
|
|
2592
2592
|
]
|
|
2593
2593
|
}
|
|
2594
|
-
tintColor="#
|
|
2594
|
+
tintColor="#D13333"
|
|
2595
2595
|
vbHeight={24}
|
|
2596
2596
|
vbWidth={24}
|
|
2597
2597
|
width={24}
|
|
@@ -16,28 +16,26 @@ var _PressableModuleBase = require("./PressableModuleBase");
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
// ---------------- types ----------------
|
|
20
|
-
|
|
21
|
-
// ---------------- component ----------------
|
|
22
|
-
|
|
23
19
|
const ModuleCheckout = props => {
|
|
24
20
|
const theme = (0, _core.useIOTheme)();
|
|
25
21
|
if (props.isLoading) {
|
|
26
|
-
return /*#__PURE__*/React.createElement(LoadingVersion,
|
|
27
|
-
text: props.ctaText
|
|
28
|
-
});
|
|
22
|
+
return /*#__PURE__*/React.createElement(LoadingVersion, props);
|
|
29
23
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
24
|
+
const {
|
|
25
|
+
paymentLogo,
|
|
26
|
+
image
|
|
27
|
+
} = props;
|
|
28
|
+
const imageComponent = /*#__PURE__*/React.createElement(React.Fragment, null, paymentLogo && /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
29
|
+
style: styles.imageWrapper
|
|
37
30
|
}, /*#__PURE__*/React.createElement(_logos.LogoPayment, {
|
|
38
|
-
name:
|
|
39
|
-
})), /*#__PURE__*/React.createElement(_reactNative.
|
|
40
|
-
|
|
31
|
+
name: paymentLogo
|
|
32
|
+
})), image && /*#__PURE__*/React.createElement(_reactNative.Image, {
|
|
33
|
+
source: image,
|
|
34
|
+
style: [styles.imageWrapper, styles.image],
|
|
35
|
+
accessibilityIgnoresInvertColors: true
|
|
36
|
+
}));
|
|
37
|
+
const ModuleBaseContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, imageComponent, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
38
|
+
style: styles.content
|
|
41
39
|
}, /*#__PURE__*/React.createElement(_typography.H6, null, props.title), props.subtitle && /*#__PURE__*/React.createElement(_typography.LabelSmall, {
|
|
42
40
|
weight: "Regular",
|
|
43
41
|
color: theme["textBody-tertiary"]
|
|
@@ -46,36 +44,34 @@ const ModuleCheckout = props => {
|
|
|
46
44
|
return /*#__PURE__*/React.createElement(_PressableModuleBase.PressableModuleBase, {
|
|
47
45
|
onPress: props.onPress
|
|
48
46
|
}, /*#__PURE__*/React.createElement(ModuleBaseContent, null), props.ctaText && /*#__PURE__*/React.createElement(ModuleAction, {
|
|
49
|
-
|
|
47
|
+
ctaText: props.ctaText
|
|
50
48
|
}));
|
|
51
49
|
}
|
|
52
50
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
53
51
|
style: _core.IOModuleStyles.button
|
|
54
52
|
}, /*#__PURE__*/React.createElement(ModuleBaseContent, null));
|
|
55
53
|
};
|
|
56
|
-
|
|
57
|
-
// ---------------- sub-components----------------
|
|
58
54
|
exports.ModuleCheckout = ModuleCheckout;
|
|
59
55
|
const ModuleAction = _ref => {
|
|
60
56
|
let {
|
|
61
|
-
|
|
57
|
+
ctaText
|
|
62
58
|
} = _ref;
|
|
63
59
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
64
60
|
pointerEvents: "none"
|
|
65
61
|
}, /*#__PURE__*/React.createElement(_buttons.ButtonLink, {
|
|
66
|
-
label:
|
|
67
|
-
accessibilityLabel:
|
|
62
|
+
label: ctaText ?? "",
|
|
63
|
+
accessibilityLabel: ctaText,
|
|
68
64
|
onPress: () => null
|
|
69
65
|
}));
|
|
70
66
|
};
|
|
71
67
|
const LoadingVersion = _ref2 => {
|
|
72
68
|
let {
|
|
73
|
-
|
|
69
|
+
ctaText
|
|
74
70
|
} = _ref2;
|
|
75
71
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
76
72
|
style: _core.IOModuleStyles.button
|
|
77
73
|
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
78
|
-
style:
|
|
74
|
+
style: [_core.IOStyles.row, _core.IOStyles.alignCenter]
|
|
79
75
|
}, /*#__PURE__*/React.createElement(_rnPlaceholder.default.Box, {
|
|
80
76
|
animate: "fade",
|
|
81
77
|
radius: 8,
|
|
@@ -96,17 +92,22 @@ const LoadingVersion = _ref2 => {
|
|
|
96
92
|
height: 16,
|
|
97
93
|
width: 116
|
|
98
94
|
}))), /*#__PURE__*/React.createElement(ModuleAction, {
|
|
99
|
-
|
|
95
|
+
ctaText: ctaText
|
|
100
96
|
}));
|
|
101
97
|
};
|
|
102
|
-
|
|
103
|
-
// ---------------- styles ----------------
|
|
104
|
-
|
|
98
|
+
const imageMarginRight = 12;
|
|
105
99
|
const styles = _reactNative.StyleSheet.create({
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
imageWrapper: {
|
|
101
|
+
marginRight: imageMarginRight
|
|
102
|
+
},
|
|
103
|
+
image: {
|
|
104
|
+
width: _core.IOSelectionListItemVisualParams.iconSize,
|
|
105
|
+
height: _core.IOSelectionListItemVisualParams.iconSize,
|
|
106
|
+
resizeMode: "contain"
|
|
107
|
+
},
|
|
108
|
+
content: {
|
|
109
|
+
flexGrow: 1,
|
|
110
|
+
flexShrink: 1
|
|
110
111
|
}
|
|
111
112
|
});
|
|
112
113
|
//# sourceMappingURL=ModuleCheckout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_rnPlaceholder","_interopRequireDefault","_core","_buttons","_logos","_spacer","_typography","_PressableModuleBase","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ModuleCheckout","props","theme","useIOTheme","isLoading","createElement","LoadingVersion","
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_rnPlaceholder","_interopRequireDefault","_core","_buttons","_logos","_spacer","_typography","_PressableModuleBase","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ModuleCheckout","props","theme","useIOTheme","isLoading","createElement","LoadingVersion","paymentLogo","image","imageComponent","Fragment","View","style","styles","imageWrapper","LogoPayment","name","Image","source","accessibilityIgnoresInvertColors","ModuleBaseContent","content","H6","title","subtitle","LabelSmall","weight","color","ctaText","PressableModuleBase","onPress","ModuleAction","IOModuleStyles","button","exports","_ref","pointerEvents","ButtonLink","label","accessibilityLabel","_ref2","IOStyles","row","alignCenter","Box","animate","radius","height","width","HSpacer","size","VSpacer","imageMarginRight","StyleSheet","create","marginRight","IOSelectionListItemVisualParams","iconSize","resizeMode","flexGrow","flexShrink"],"sourceRoot":"../../../../src","sources":["components/modules/ModuleCheckout.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAOA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,oBAAA,GAAAT,OAAA;AAA4D,SAAAG,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,Y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
"error-600": "#
|
|
59
|
-
"error-500": "#
|
|
60
|
-
"error-400": "#
|
|
61
|
-
"error-100": "#
|
|
57
|
+
"error-850": "#5D1313",
|
|
58
|
+
"error-600": "#D13333",
|
|
59
|
+
"error-500": "#FF4040",
|
|
60
|
+
"error-400": "#FF6666" /* Dark mode */,
|
|
61
|
+
"error-100": "#FFD9D9",
|
|
62
62
|
"warning-850": "#614C15",
|
|
63
63
|
"warning-700": "#A5822A",
|
|
64
64
|
"warning-500": "#FFCB46",
|
|
@@ -267,8 +267,8 @@ const IOThemeLight = {
|
|
|
267
267
|
// Layout
|
|
268
268
|
"divider-default": "grey-200",
|
|
269
269
|
// Status
|
|
270
|
-
errorIcon: "error-
|
|
271
|
-
errorText: "error-
|
|
270
|
+
errorIcon: "error-600",
|
|
271
|
+
errorText: "error-600",
|
|
272
272
|
// Pictograms
|
|
273
273
|
"pictogram-hands": "blueIO-500",
|
|
274
274
|
"pictogram-tint-main": "turquoise-150",
|
|
@@ -38,8 +38,8 @@ const mapColorStates = {
|
|
|
38
38
|
},
|
|
39
39
|
// Danger button
|
|
40
40
|
danger: {
|
|
41
|
-
default: IOColors["error-
|
|
42
|
-
pressed: IOColors["error-
|
|
41
|
+
default: IOColors["error-600"],
|
|
42
|
+
pressed: IOColors["error-500"],
|
|
43
43
|
label: {
|
|
44
44
|
default: "white",
|
|
45
45
|
disabled: "grey-700"
|
|
@@ -777,7 +777,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
|
|
|
777
777
|
"borderWidth": 0,
|
|
778
778
|
},
|
|
779
779
|
{
|
|
780
|
-
"color": "#
|
|
780
|
+
"color": "#D13333",
|
|
781
781
|
},
|
|
782
782
|
{
|
|
783
783
|
"flex": 0,
|
|
@@ -786,7 +786,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
|
|
|
786
786
|
},
|
|
787
787
|
]
|
|
788
788
|
}
|
|
789
|
-
tintColor="#
|
|
789
|
+
tintColor="#D13333"
|
|
790
790
|
vbHeight={24}
|
|
791
791
|
vbWidth={24}
|
|
792
792
|
width={24}
|
|
@@ -2582,7 +2582,7 @@ exports[`Test List Item Components ListItemNavAlert Snapshot 1`] = `
|
|
|
2582
2582
|
"borderWidth": 0,
|
|
2583
2583
|
},
|
|
2584
2584
|
{
|
|
2585
|
-
"color": "#
|
|
2585
|
+
"color": "#D13333",
|
|
2586
2586
|
},
|
|
2587
2587
|
{
|
|
2588
2588
|
"flex": 0,
|
|
@@ -2591,7 +2591,7 @@ exports[`Test List Item Components ListItemNavAlert Snapshot 1`] = `
|
|
|
2591
2591
|
},
|
|
2592
2592
|
]
|
|
2593
2593
|
}
|
|
2594
|
-
tintColor="#
|
|
2594
|
+
tintColor="#D13333"
|
|
2595
2595
|
vbHeight={24}
|
|
2596
2596
|
vbWidth={24}
|
|
2597
2597
|
width={24}
|
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleSheet, View } from "react-native";
|
|
2
|
+
import { Image, StyleSheet, View } from "react-native";
|
|
3
3
|
import Placeholder from "rn-placeholder";
|
|
4
|
-
import { IOModuleStyles, IOStyles, useIOTheme } from "../../core";
|
|
4
|
+
import { IOModuleStyles, IOSelectionListItemVisualParams, IOStyles, useIOTheme } from "../../core";
|
|
5
5
|
import { ButtonLink } from "../buttons";
|
|
6
6
|
import { LogoPayment } from "../logos";
|
|
7
7
|
import { HSpacer, VSpacer } from "../spacer";
|
|
8
8
|
import { H6, LabelSmall } from "../typography";
|
|
9
9
|
import { PressableModuleBase } from "./PressableModuleBase";
|
|
10
|
-
|
|
11
|
-
// ---------------- types ----------------
|
|
12
|
-
|
|
13
|
-
// ---------------- component ----------------
|
|
14
|
-
|
|
15
10
|
export const ModuleCheckout = props => {
|
|
16
11
|
const theme = useIOTheme();
|
|
17
12
|
if (props.isLoading) {
|
|
18
|
-
return /*#__PURE__*/React.createElement(LoadingVersion,
|
|
19
|
-
text: props.ctaText
|
|
20
|
-
});
|
|
13
|
+
return /*#__PURE__*/React.createElement(LoadingVersion, props);
|
|
21
14
|
}
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
15
|
+
const {
|
|
16
|
+
paymentLogo,
|
|
17
|
+
image
|
|
18
|
+
} = props;
|
|
19
|
+
const imageComponent = /*#__PURE__*/React.createElement(React.Fragment, null, paymentLogo && /*#__PURE__*/React.createElement(View, {
|
|
20
|
+
style: styles.imageWrapper
|
|
29
21
|
}, /*#__PURE__*/React.createElement(LogoPayment, {
|
|
30
|
-
name:
|
|
31
|
-
})), /*#__PURE__*/React.createElement(
|
|
32
|
-
|
|
22
|
+
name: paymentLogo
|
|
23
|
+
})), image && /*#__PURE__*/React.createElement(Image, {
|
|
24
|
+
source: image,
|
|
25
|
+
style: [styles.imageWrapper, styles.image],
|
|
26
|
+
accessibilityIgnoresInvertColors: true
|
|
27
|
+
}));
|
|
28
|
+
const ModuleBaseContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, imageComponent, /*#__PURE__*/React.createElement(View, {
|
|
29
|
+
style: styles.content
|
|
33
30
|
}, /*#__PURE__*/React.createElement(H6, null, props.title), props.subtitle && /*#__PURE__*/React.createElement(LabelSmall, {
|
|
34
31
|
weight: "Regular",
|
|
35
32
|
color: theme["textBody-tertiary"]
|
|
@@ -38,36 +35,33 @@ export const ModuleCheckout = props => {
|
|
|
38
35
|
return /*#__PURE__*/React.createElement(PressableModuleBase, {
|
|
39
36
|
onPress: props.onPress
|
|
40
37
|
}, /*#__PURE__*/React.createElement(ModuleBaseContent, null), props.ctaText && /*#__PURE__*/React.createElement(ModuleAction, {
|
|
41
|
-
|
|
38
|
+
ctaText: props.ctaText
|
|
42
39
|
}));
|
|
43
40
|
}
|
|
44
41
|
return /*#__PURE__*/React.createElement(View, {
|
|
45
42
|
style: IOModuleStyles.button
|
|
46
43
|
}, /*#__PURE__*/React.createElement(ModuleBaseContent, null));
|
|
47
44
|
};
|
|
48
|
-
|
|
49
|
-
// ---------------- sub-components----------------
|
|
50
|
-
|
|
51
45
|
const ModuleAction = _ref => {
|
|
52
46
|
let {
|
|
53
|
-
|
|
47
|
+
ctaText
|
|
54
48
|
} = _ref;
|
|
55
49
|
return /*#__PURE__*/React.createElement(View, {
|
|
56
50
|
pointerEvents: "none"
|
|
57
51
|
}, /*#__PURE__*/React.createElement(ButtonLink, {
|
|
58
|
-
label:
|
|
59
|
-
accessibilityLabel:
|
|
52
|
+
label: ctaText ?? "",
|
|
53
|
+
accessibilityLabel: ctaText,
|
|
60
54
|
onPress: () => null
|
|
61
55
|
}));
|
|
62
56
|
};
|
|
63
57
|
const LoadingVersion = _ref2 => {
|
|
64
58
|
let {
|
|
65
|
-
|
|
59
|
+
ctaText
|
|
66
60
|
} = _ref2;
|
|
67
61
|
return /*#__PURE__*/React.createElement(View, {
|
|
68
62
|
style: IOModuleStyles.button
|
|
69
63
|
}, /*#__PURE__*/React.createElement(View, {
|
|
70
|
-
style:
|
|
64
|
+
style: [IOStyles.row, IOStyles.alignCenter]
|
|
71
65
|
}, /*#__PURE__*/React.createElement(Placeholder.Box, {
|
|
72
66
|
animate: "fade",
|
|
73
67
|
radius: 8,
|
|
@@ -88,17 +82,22 @@ const LoadingVersion = _ref2 => {
|
|
|
88
82
|
height: 16,
|
|
89
83
|
width: 116
|
|
90
84
|
}))), /*#__PURE__*/React.createElement(ModuleAction, {
|
|
91
|
-
|
|
85
|
+
ctaText: ctaText
|
|
92
86
|
}));
|
|
93
87
|
};
|
|
94
|
-
|
|
95
|
-
// ---------------- styles ----------------
|
|
96
|
-
|
|
88
|
+
const imageMarginRight = 12;
|
|
97
89
|
const styles = StyleSheet.create({
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
imageWrapper: {
|
|
91
|
+
marginRight: imageMarginRight
|
|
92
|
+
},
|
|
93
|
+
image: {
|
|
94
|
+
width: IOSelectionListItemVisualParams.iconSize,
|
|
95
|
+
height: IOSelectionListItemVisualParams.iconSize,
|
|
96
|
+
resizeMode: "contain"
|
|
97
|
+
},
|
|
98
|
+
content: {
|
|
99
|
+
flexGrow: 1,
|
|
100
|
+
flexShrink: 1
|
|
102
101
|
}
|
|
103
102
|
});
|
|
104
103
|
//# sourceMappingURL=ModuleCheckout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","View","Placeholder","IOModuleStyles","IOStyles","useIOTheme","ButtonLink","LogoPayment","HSpacer","VSpacer","H6","LabelSmall","PressableModuleBase","ModuleCheckout","props","theme","isLoading","createElement","LoadingVersion","
|
|
1
|
+
{"version":3,"names":["React","Image","StyleSheet","View","Placeholder","IOModuleStyles","IOSelectionListItemVisualParams","IOStyles","useIOTheme","ButtonLink","LogoPayment","HSpacer","VSpacer","H6","LabelSmall","PressableModuleBase","ModuleCheckout","props","theme","isLoading","createElement","LoadingVersion","paymentLogo","image","imageComponent","Fragment","style","styles","imageWrapper","name","source","accessibilityIgnoresInvertColors","ModuleBaseContent","content","title","subtitle","weight","color","ctaText","onPress","ModuleAction","button","_ref","pointerEvents","label","accessibilityLabel","_ref2","row","alignCenter","Box","animate","radius","height","width","size","imageMarginRight","create","marginRight","iconSize","resizeMode","flexGrow","flexShrink"],"sourceRoot":"../../../../src","sources":["components/modules/ModuleCheckout.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,KAAK,EAGLC,UAAU,EACVC,IAAI,QACC,cAAc;AACrB,OAAOC,WAAW,MAAM,gBAAgB;AACxC,SACEC,cAAc,EACdC,+BAA+B,EAE/BC,QAAQ,EACRC,UAAU,QACL,YAAY;AACnB,SAASC,UAAU,QAAQ,YAAY;AACvC,SAA4BC,WAAW,QAAQ,UAAU;AACzD,SAASC,OAAO,EAAEC,OAAO,QAAQ,WAAW;AAC5C,SAASC,EAAE,EAAEC,UAAU,QAAQ,eAAe;AAC9C,SAASC,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CAAC,eACpErD,KAAA,CAAAoB,aAAA,CAACT,OAAO;IAAC2C,IAAI,EAAE;EAAE,CAAE,CAAC,eACpBtD,KAAA,CAAAoB,aAAA,CAACjB,IAAI,qBACHH,KAAA,CAAAoB,aAAA,CAAChB,WAAW,CAAC6C,GAAG;IAACC,OAAO,EAAC,MAAM;IAACC,MAAM,EAAE,CAAE;IAACC,MAAM,EAAE,EAAG;IAACC,KAAK,EAAE;EAAI,CAAE,CAAC,eACrErD,KAAA,CAAAoB,aAAA,CAACR,OAAO;IAAC0C,IAAI,EAAE;EAAE,CAAE,CAAC,eACpBtD,KAAA,CAAAoB,aAAA,CAAChB,WAAW,CAAC6C,GAAG;IAACC,OAAO,EAAC,MAAM;IAACC,MAAM,EAAE,CAAE;IAACC,MAAM,EAAE,EAAG;IAACC,KAAK,EAAE;EAAI,CAAE,CAChE,CACF,CAAC,eACPrD,KAAA,CAAAoB,aAAA,CAACoB,YAAY;IAACF,OAAO,EAAEA;EAAQ,CAAE,CAC7B,CAAC;AAAA,CACR;AAED,MAAMiB,gBAAgC,GAAG,EAAE;AAE3C,MAAM5B,MAAM,GAAGzB,UAAU,CAACsD,MAAM,CAAC;EAC/B5B,YAAY,EAAE;IACZ6B,WAAW,EAAEF;EACf,CAAC;EACDhC,KAAK,EAAE;IACL8B,KAAK,EAAE/C,+BAA+B,CAACoD,QAAQ;IAC/CN,MAAM,EAAE9C,+BAA+B,CAACoD,QAAQ;IAChDC,UAAU,EAAE;EACd,CAAC;EACD1B,OAAO,EAAE;IACP2B,QAAQ,EAAE,CAAC;IACXC,UAAU,EAAE;EACd;AACF,CAAC,CAAC"}
|
|
@@ -48,11 +48,11 @@ export const IOColors = asIOColors({
|
|
|
48
48
|
"turquoise-150": "#AAEEEF",
|
|
49
49
|
"turquoise-100": "#C2F3F4",
|
|
50
50
|
"turquoise-50": "#DBF9FA",
|
|
51
|
-
"error-850": "#
|
|
52
|
-
"error-600": "#
|
|
53
|
-
"error-500": "#
|
|
54
|
-
"error-400": "#
|
|
55
|
-
"error-100": "#
|
|
51
|
+
"error-850": "#5D1313",
|
|
52
|
+
"error-600": "#D13333",
|
|
53
|
+
"error-500": "#FF4040",
|
|
54
|
+
"error-400": "#FF6666" /* Dark mode */,
|
|
55
|
+
"error-100": "#FFD9D9",
|
|
56
56
|
"warning-850": "#614C15",
|
|
57
57
|
"warning-700": "#A5822A",
|
|
58
58
|
"warning-500": "#FFCB46",
|
|
@@ -255,8 +255,8 @@ export const IOThemeLight = {
|
|
|
255
255
|
// Layout
|
|
256
256
|
"divider-default": "grey-200",
|
|
257
257
|
// Status
|
|
258
|
-
errorIcon: "error-
|
|
259
|
-
errorText: "error-
|
|
258
|
+
errorIcon: "error-600",
|
|
259
|
+
errorText: "error-600",
|
|
260
260
|
// Pictograms
|
|
261
261
|
"pictogram-hands": "blueIO-500",
|
|
262
262
|
"pictogram-tint-main": "turquoise-150",
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ImageSourcePropType, ImageURISource } from "react-native";
|
|
2
3
|
import { IOLogoPaymentType } from "../logos";
|
|
3
|
-
type
|
|
4
|
+
type LoadingProps = {
|
|
5
|
+
isLoading: true;
|
|
6
|
+
ctaText?: string;
|
|
7
|
+
};
|
|
8
|
+
type ImageProps = {
|
|
9
|
+
paymentLogo: IOLogoPaymentType;
|
|
10
|
+
image?: never;
|
|
11
|
+
} | {
|
|
12
|
+
paymentLogo?: never;
|
|
13
|
+
image: ImageURISource | ImageSourcePropType;
|
|
14
|
+
} | {
|
|
15
|
+
paymentLogo?: never;
|
|
16
|
+
image?: never;
|
|
17
|
+
};
|
|
18
|
+
type BaseProps = {
|
|
4
19
|
isLoading?: false;
|
|
5
20
|
paymentLogo?: IOLogoPaymentType;
|
|
6
21
|
title: string;
|
|
7
22
|
subtitle?: string;
|
|
8
|
-
onPress: () => void;
|
|
9
|
-
} | {
|
|
10
|
-
isLoading: true;
|
|
11
|
-
paymentLogo?: never;
|
|
12
|
-
title?: never;
|
|
13
|
-
subtitle?: never;
|
|
14
|
-
onPress?: never;
|
|
15
|
-
};
|
|
16
|
-
export type ModuleCheckoutProps = ModuleCheckoutPartialProps & {
|
|
17
23
|
ctaText?: string;
|
|
18
|
-
|
|
24
|
+
onPress: () => void;
|
|
25
|
+
} & ImageProps;
|
|
26
|
+
export type ModuleCheckoutProps = LoadingProps | BaseProps;
|
|
19
27
|
export declare const ModuleCheckout: (props: ModuleCheckoutProps) => React.JSX.Element;
|
|
20
28
|
export {};
|
|
21
29
|
//# sourceMappingURL=ModuleCheckout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleCheckout.d.ts","sourceRoot":"","sources":["../../../../src/components/modules/ModuleCheckout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ModuleCheckout.d.ts","sourceRoot":"","sources":["../../../../src/components/modules/ModuleCheckout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,mBAAmB,EACnB,cAAc,EAGf,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,iBAAiB,EAAe,MAAM,UAAU,CAAC;AAK1D,KAAK,YAAY,GAAG;IAClB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,UAAU,GACX;IAAE,WAAW,EAAE,iBAAiB,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GACjD;IAAE,WAAW,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,cAAc,GAAG,mBAAmB,CAAA;CAAE,GACpE;IAAE,WAAW,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE3C,KAAK,SAAS,GAAG;IACf,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,GAAG,UAAU,CAAC;AAEf,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,SAAS,CAAC;AAE3D,eAAO,MAAM,cAAc,UAAW,mBAAmB,sBAsDxD,CAAC"}
|
package/package.json
CHANGED
|
@@ -107,8 +107,8 @@ const mapColorStates: Record<
|
|
|
107
107
|
},
|
|
108
108
|
// Danger button
|
|
109
109
|
danger: {
|
|
110
|
-
default: IOColors["error-
|
|
111
|
-
pressed: IOColors["error-
|
|
110
|
+
default: IOColors["error-600"],
|
|
111
|
+
pressed: IOColors["error-500"],
|
|
112
112
|
label: {
|
|
113
113
|
default: "white",
|
|
114
114
|
disabled: "grey-700"
|
|
@@ -777,7 +777,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
|
|
|
777
777
|
"borderWidth": 0,
|
|
778
778
|
},
|
|
779
779
|
{
|
|
780
|
-
"color": "#
|
|
780
|
+
"color": "#D13333",
|
|
781
781
|
},
|
|
782
782
|
{
|
|
783
783
|
"flex": 0,
|
|
@@ -786,7 +786,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
|
|
|
786
786
|
},
|
|
787
787
|
]
|
|
788
788
|
}
|
|
789
|
-
tintColor="#
|
|
789
|
+
tintColor="#D13333"
|
|
790
790
|
vbHeight={24}
|
|
791
791
|
vbWidth={24}
|
|
792
792
|
width={24}
|
|
@@ -2582,7 +2582,7 @@ exports[`Test List Item Components ListItemNavAlert Snapshot 1`] = `
|
|
|
2582
2582
|
"borderWidth": 0,
|
|
2583
2583
|
},
|
|
2584
2584
|
{
|
|
2585
|
-
"color": "#
|
|
2585
|
+
"color": "#D13333",
|
|
2586
2586
|
},
|
|
2587
2587
|
{
|
|
2588
2588
|
"flex": 0,
|
|
@@ -2591,7 +2591,7 @@ exports[`Test List Item Components ListItemNavAlert Snapshot 1`] = `
|
|
|
2591
2591
|
},
|
|
2592
2592
|
]
|
|
2593
2593
|
}
|
|
2594
|
-
tintColor="#
|
|
2594
|
+
tintColor="#D13333"
|
|
2595
2595
|
vbHeight={24}
|
|
2596
2596
|
vbWidth={24}
|
|
2597
2597
|
width={24}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Image,
|
|
4
|
+
ImageSourcePropType,
|
|
5
|
+
ImageURISource,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
View
|
|
8
|
+
} from "react-native";
|
|
3
9
|
import Placeholder from "rn-placeholder";
|
|
4
10
|
import {
|
|
5
11
|
IOModuleStyles,
|
|
12
|
+
IOSelectionListItemVisualParams,
|
|
6
13
|
IOSpacingScale,
|
|
7
14
|
IOStyles,
|
|
8
15
|
useIOTheme
|
|
@@ -13,54 +20,57 @@ import { HSpacer, VSpacer } from "../spacer";
|
|
|
13
20
|
import { H6, LabelSmall } from "../typography";
|
|
14
21
|
import { PressableModuleBase } from "./PressableModuleBase";
|
|
15
22
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
type ModuleCheckoutPartialProps =
|
|
19
|
-
| {
|
|
20
|
-
isLoading?: false;
|
|
21
|
-
paymentLogo?: IOLogoPaymentType;
|
|
22
|
-
title: string;
|
|
23
|
-
subtitle?: string;
|
|
24
|
-
onPress: () => void;
|
|
25
|
-
}
|
|
26
|
-
| {
|
|
27
|
-
isLoading: true;
|
|
28
|
-
paymentLogo?: never;
|
|
29
|
-
title?: never;
|
|
30
|
-
subtitle?: never;
|
|
31
|
-
onPress?: never;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type ModuleCheckoutProps = ModuleCheckoutPartialProps & {
|
|
23
|
+
type LoadingProps = {
|
|
24
|
+
isLoading: true;
|
|
35
25
|
ctaText?: string;
|
|
36
26
|
};
|
|
37
27
|
|
|
38
|
-
type
|
|
28
|
+
type ImageProps =
|
|
29
|
+
| { paymentLogo: IOLogoPaymentType; image?: never }
|
|
30
|
+
| { paymentLogo?: never; image: ImageURISource | ImageSourcePropType }
|
|
31
|
+
| { paymentLogo?: never; image?: never };
|
|
39
32
|
|
|
40
|
-
|
|
33
|
+
type BaseProps = {
|
|
34
|
+
isLoading?: false;
|
|
35
|
+
paymentLogo?: IOLogoPaymentType;
|
|
36
|
+
title: string;
|
|
37
|
+
subtitle?: string;
|
|
38
|
+
ctaText?: string;
|
|
39
|
+
onPress: () => void;
|
|
40
|
+
} & ImageProps;
|
|
41
|
+
|
|
42
|
+
export type ModuleCheckoutProps = LoadingProps | BaseProps;
|
|
41
43
|
|
|
42
44
|
export const ModuleCheckout = (props: ModuleCheckoutProps) => {
|
|
43
45
|
const theme = useIOTheme();
|
|
44
46
|
|
|
45
47
|
if (props.isLoading) {
|
|
46
|
-
return <LoadingVersion
|
|
48
|
+
return <LoadingVersion {...props} />;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
const
|
|
51
|
+
const { paymentLogo, image } = props;
|
|
50
52
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
so we use a row and a marginEnd on the logo
|
|
57
|
-
*/}
|
|
58
|
-
{props.paymentLogo && (
|
|
59
|
-
<View style={{ marginEnd: paymentLogoEndMargin }}>
|
|
60
|
-
<LogoPayment name={props.paymentLogo} />
|
|
53
|
+
const imageComponent = (
|
|
54
|
+
<>
|
|
55
|
+
{paymentLogo && (
|
|
56
|
+
<View style={styles.imageWrapper}>
|
|
57
|
+
<LogoPayment name={paymentLogo} />
|
|
61
58
|
</View>
|
|
62
59
|
)}
|
|
63
|
-
|
|
60
|
+
{image && (
|
|
61
|
+
<Image
|
|
62
|
+
source={image}
|
|
63
|
+
style={[styles.imageWrapper, styles.image]}
|
|
64
|
+
accessibilityIgnoresInvertColors={true}
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
67
|
+
</>
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const ModuleBaseContent = () => (
|
|
71
|
+
<>
|
|
72
|
+
{imageComponent}
|
|
73
|
+
<View style={styles.content}>
|
|
64
74
|
<H6>{props.title}</H6>
|
|
65
75
|
{props.subtitle && (
|
|
66
76
|
<LabelSmall weight="Regular" color={theme["textBody-tertiary"]}>
|
|
@@ -68,14 +78,14 @@ export const ModuleCheckout = (props: ModuleCheckoutProps) => {
|
|
|
68
78
|
</LabelSmall>
|
|
69
79
|
)}
|
|
70
80
|
</View>
|
|
71
|
-
|
|
81
|
+
</>
|
|
72
82
|
);
|
|
73
83
|
|
|
74
84
|
if (props.ctaText) {
|
|
75
85
|
return (
|
|
76
86
|
<PressableModuleBase onPress={props.onPress}>
|
|
77
87
|
<ModuleBaseContent />
|
|
78
|
-
{props.ctaText && <ModuleAction
|
|
88
|
+
{props.ctaText && <ModuleAction ctaText={props.ctaText} />}
|
|
79
89
|
</PressableModuleBase>
|
|
80
90
|
);
|
|
81
91
|
}
|
|
@@ -87,21 +97,19 @@ export const ModuleCheckout = (props: ModuleCheckoutProps) => {
|
|
|
87
97
|
);
|
|
88
98
|
};
|
|
89
99
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const ModuleAction = ({ text }: ActionOnlyProps) => (
|
|
100
|
+
const ModuleAction = ({ ctaText }: Pick<ModuleCheckoutProps, "ctaText">) => (
|
|
93
101
|
<View pointerEvents="none">
|
|
94
102
|
<ButtonLink
|
|
95
|
-
label={
|
|
96
|
-
accessibilityLabel={
|
|
103
|
+
label={ctaText ?? ""}
|
|
104
|
+
accessibilityLabel={ctaText}
|
|
97
105
|
onPress={() => null}
|
|
98
106
|
/>
|
|
99
107
|
</View>
|
|
100
108
|
);
|
|
101
109
|
|
|
102
|
-
const LoadingVersion = ({
|
|
110
|
+
const LoadingVersion = ({ ctaText }: LoadingProps) => (
|
|
103
111
|
<View style={IOModuleStyles.button}>
|
|
104
|
-
<View style={
|
|
112
|
+
<View style={[IOStyles.row, IOStyles.alignCenter]}>
|
|
105
113
|
<Placeholder.Box animate="fade" radius={8} height={24} width={24} />
|
|
106
114
|
<HSpacer size={8} />
|
|
107
115
|
<View>
|
|
@@ -110,16 +118,23 @@ const LoadingVersion = ({ text }: ActionOnlyProps) => (
|
|
|
110
118
|
<Placeholder.Box animate="fade" radius={8} height={16} width={116} />
|
|
111
119
|
</View>
|
|
112
120
|
</View>
|
|
113
|
-
<ModuleAction
|
|
121
|
+
<ModuleAction ctaText={ctaText} />
|
|
114
122
|
</View>
|
|
115
123
|
);
|
|
116
124
|
|
|
117
|
-
|
|
125
|
+
const imageMarginRight: IOSpacingScale = 12;
|
|
118
126
|
|
|
119
127
|
const styles = StyleSheet.create({
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
128
|
+
imageWrapper: {
|
|
129
|
+
marginRight: imageMarginRight
|
|
130
|
+
},
|
|
131
|
+
image: {
|
|
132
|
+
width: IOSelectionListItemVisualParams.iconSize,
|
|
133
|
+
height: IOSelectionListItemVisualParams.iconSize,
|
|
134
|
+
resizeMode: "contain"
|
|
135
|
+
},
|
|
136
|
+
content: {
|
|
137
|
+
flexGrow: 1,
|
|
138
|
+
flexShrink: 1
|
|
124
139
|
}
|
|
125
140
|
});
|
package/src/core/IOColors.ts
CHANGED
|
@@ -56,11 +56,11 @@ export const IOColors = asIOColors({
|
|
|
56
56
|
"turquoise-150": "#AAEEEF",
|
|
57
57
|
"turquoise-100": "#C2F3F4",
|
|
58
58
|
"turquoise-50": "#DBF9FA",
|
|
59
|
-
"error-850": "#
|
|
60
|
-
"error-600": "#
|
|
61
|
-
"error-500": "#
|
|
62
|
-
"error-400": "#
|
|
63
|
-
"error-100": "#
|
|
59
|
+
"error-850": "#5D1313",
|
|
60
|
+
"error-600": "#D13333",
|
|
61
|
+
"error-500": "#FF4040",
|
|
62
|
+
"error-400": "#FF6666" /* Dark mode */,
|
|
63
|
+
"error-100": "#FFD9D9",
|
|
64
64
|
"warning-850": "#614C15",
|
|
65
65
|
"warning-700": "#A5822A",
|
|
66
66
|
"warning-500": "#FFCB46",
|
|
@@ -319,8 +319,8 @@ export const IOThemeLight: IOTheme = {
|
|
|
319
319
|
// Layout
|
|
320
320
|
"divider-default": "grey-200",
|
|
321
321
|
// Status
|
|
322
|
-
errorIcon: "error-
|
|
323
|
-
errorText: "error-
|
|
322
|
+
errorIcon: "error-600",
|
|
323
|
+
errorText: "error-600",
|
|
324
324
|
// Pictograms
|
|
325
325
|
"pictogram-hands": "blueIO-500",
|
|
326
326
|
"pictogram-tint-main": "turquoise-150",
|