@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.
@@ -47,8 +47,8 @@ const mapColorStates = {
47
47
  },
48
48
  // Danger button
49
49
  danger: {
50
- default: _core.IOColors["error-850"],
51
- pressed: _core.IOColors["error-600"],
50
+ default: _core.IOColors["error-600"],
51
+ pressed: _core.IOColors["error-500"],
52
52
  label: {
53
53
  default: "white",
54
54
  disabled: "grey-700"
@@ -50,7 +50,7 @@ const ListItemAction = _ref => {
50
50
  };
51
51
  const mapLegacyForegroundColor = {
52
52
  primary: "blue",
53
- danger: "error-850"
53
+ danger: "error-600"
54
54
  };
55
55
  const mapForegroundColor = {
56
56
  primary: _core.IOColors[theme["interactiveElem-default"]],
@@ -777,7 +777,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
777
777
  "borderWidth": 0,
778
778
  },
779
779
  {
780
- "color": "#FE6666",
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="#FE6666"
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": "#FE6666",
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="#FE6666"
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 paymentLogoEndMargin = 12;
31
- const ModuleBaseContent = () => /*#__PURE__*/React.createElement(_reactNative.View, {
32
- style: styles.rowCenter
33
- }, props.paymentLogo && /*#__PURE__*/React.createElement(_reactNative.View, {
34
- style: {
35
- marginEnd: paymentLogoEndMargin
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: props.paymentLogo
39
- })), /*#__PURE__*/React.createElement(_reactNative.View, {
40
- style: _core.IOStyles.flex
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
- text: props.ctaText
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
- text
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: text ?? "",
67
- accessibilityLabel: text,
62
+ label: ctaText ?? "",
63
+ accessibilityLabel: ctaText,
68
64
  onPress: () => null
69
65
  }));
70
66
  };
71
67
  const LoadingVersion = _ref2 => {
72
68
  let {
73
- text
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: styles.rowCenter
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
- text: text
95
+ ctaText: ctaText
100
96
  }));
101
97
  };
102
-
103
- // ---------------- styles ----------------
104
-
98
+ const imageMarginRight = 12;
105
99
  const styles = _reactNative.StyleSheet.create({
106
- rowCenter: {
107
- flexDirection: "row",
108
- alignItems: "center",
109
- flex: 1
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","text","ctaText","paymentLogoEndMargin","ModuleBaseContent","View","style","styles","rowCenter","paymentLogo","marginEnd","LogoPayment","name","IOStyles","flex","H6","title","subtitle","LabelSmall","weight","color","PressableModuleBase","onPress","ModuleAction","IOModuleStyles","button","exports","_ref","pointerEvents","ButtonLink","label","accessibilityLabel","_ref2","Box","animate","radius","height","width","HSpacer","size","VSpacer","StyleSheet","create","flexDirection","alignItems"],"sourceRoot":"../../../../src","sources":["components/modules/ModuleCheckout.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAMA,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,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAf,wBAAAW,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAAgB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAA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,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpB9B,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
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,kC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- "error-850": "#761F1F",
58
- "error-600": "#D75252",
59
- "error-500": "#FE6666",
60
- "error-400": "#FE8585" /* Dark mode */,
61
- "error-100": "#FFE0E0",
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-500",
271
- errorText: "error-850",
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-850"],
42
- pressed: IOColors["error-600"],
41
+ default: IOColors["error-600"],
42
+ pressed: IOColors["error-500"],
43
43
  label: {
44
44
  default: "white",
45
45
  disabled: "grey-700"
@@ -42,7 +42,7 @@ export const ListItemAction = _ref => {
42
42
  };
43
43
  const mapLegacyForegroundColor = {
44
44
  primary: "blue",
45
- danger: "error-850"
45
+ danger: "error-600"
46
46
  };
47
47
  const mapForegroundColor = {
48
48
  primary: IOColors[theme["interactiveElem-default"]],
@@ -777,7 +777,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
777
777
  "borderWidth": 0,
778
778
  },
779
779
  {
780
- "color": "#FE6666",
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="#FE6666"
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": "#FE6666",
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="#FE6666"
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 paymentLogoEndMargin = 12;
23
- const ModuleBaseContent = () => /*#__PURE__*/React.createElement(View, {
24
- style: styles.rowCenter
25
- }, props.paymentLogo && /*#__PURE__*/React.createElement(View, {
26
- style: {
27
- marginEnd: paymentLogoEndMargin
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: props.paymentLogo
31
- })), /*#__PURE__*/React.createElement(View, {
32
- style: IOStyles.flex
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
- text: props.ctaText
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
- text
47
+ ctaText
54
48
  } = _ref;
55
49
  return /*#__PURE__*/React.createElement(View, {
56
50
  pointerEvents: "none"
57
51
  }, /*#__PURE__*/React.createElement(ButtonLink, {
58
- label: text ?? "",
59
- accessibilityLabel: text,
52
+ label: ctaText ?? "",
53
+ accessibilityLabel: ctaText,
60
54
  onPress: () => null
61
55
  }));
62
56
  };
63
57
  const LoadingVersion = _ref2 => {
64
58
  let {
65
- text
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: styles.rowCenter
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
- text: text
85
+ ctaText: ctaText
92
86
  }));
93
87
  };
94
-
95
- // ---------------- styles ----------------
96
-
88
+ const imageMarginRight = 12;
97
89
  const styles = StyleSheet.create({
98
- rowCenter: {
99
- flexDirection: "row",
100
- alignItems: "center",
101
- flex: 1
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","text","ctaText","paymentLogoEndMargin","ModuleBaseContent","style","styles","rowCenter","paymentLogo","marginEnd","name","flex","title","subtitle","weight","color","onPress","ModuleAction","button","_ref","pointerEvents","label","accessibilityLabel","_ref2","Box","animate","radius","height","width","size","create","flexDirection","alignItems"],"sourceRoot":"../../../../src","sources":["components/modules/ModuleCheckout.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,OAAOC,WAAW,MAAM,gBAAgB;AACxC,SACEC,cAAc,EAEdC,QAAQ,EACRC,UAAU,QACL,YAAY;AACnB,SAASC,UAAU,QAAQ,YAAY;AACvC,SAA4BC,WAAW,QAAQ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BACHF,KAAA,CAAAkB,aAAA,CAACf,WAAW,CAACwC,GAAG;IAACC,OAAO,EAAC,MAAM;IAACC,MAAM,EAAE,CAAE;IAACC,MAAM,EAAE,EAAG;IAACC,KAAK,EAAE;EAAI,CAAE,CAAC,eACrE/C,KAAA,CAAAkB,aAAA,CAACR,OAAO;IAACsC,IAAI,EAAE;EAAE,CAAE,CAAC,eACpBhD,KAAA,CAAAkB,aAAA,CAACf,WAAW,CAACwC,GAAG;IAACC,OAAO,EAAC,MAAM;IAACC,MAAM,EAAE,CAAE;IAACC,MAAM,EAAE,EAAG;IAACC,KAAK,EAAE;EAAI,CAAE,CAChE,CACF,CAAC,eACP/C,KAAA,CAAAkB,aAAA,CAACkB,YAAY;IAAChB,IAAI,EAAEA;EAAK,CAAE,CACvB,CAAC;AAAA,CACR;;AAED;;AAEA,MAAMK,MAAM,GAAGxB,UAAU,CAACgD,MAAM,CAAC;EAC/BvB,SAAS,EAAE;IACTwB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBrB,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
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;AACr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,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": "#761F1F",
52
- "error-600": "#D75252",
53
- "error-500": "#FE6666",
54
- "error-400": "#FE8585" /* Dark mode */,
55
- "error-100": "#FFE0E0",
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-500",
259
- errorText: "error-850",
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 ModuleCheckoutPartialProps = {
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;AAU/B,OAAO,EAAE,iBAAiB,EAAe,MAAM,UAAU,CAAC;AAO1D,KAAK,0BAA0B,GAC3B;IACE,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,GACD;IACE,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEN,MAAM,MAAM,mBAAmB,GAAG,0BAA0B,GAAG;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAMF,eAAO,MAAM,cAAc,UAAW,mBAAmB,sBA8CxD,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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/io-app-design-system",
3
- "version": "1.34.0",
3
+ "version": "1.35.0",
4
4
  "description": "The library defining the core components of the design system of @pagopa/io-app",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -107,8 +107,8 @@ const mapColorStates: Record<
107
107
  },
108
108
  // Danger button
109
109
  danger: {
110
- default: IOColors["error-850"],
111
- pressed: IOColors["error-600"],
110
+ default: IOColors["error-600"],
111
+ pressed: IOColors["error-500"],
112
112
  label: {
113
113
  default: "white",
114
114
  disabled: "grey-700"
@@ -80,7 +80,7 @@ export const ListItemAction = ({
80
80
  IOColors
81
81
  > = {
82
82
  primary: "blue",
83
- danger: "error-850"
83
+ danger: "error-600"
84
84
  };
85
85
 
86
86
  const mapForegroundColor: Record<
@@ -777,7 +777,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
777
777
  "borderWidth": 0,
778
778
  },
779
779
  {
780
- "color": "#FE6666",
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="#FE6666"
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": "#FE6666",
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="#FE6666"
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 { StyleSheet, View } from "react-native";
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
- // ---------------- types ----------------
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 ActionOnlyProps = { text?: string };
28
+ type ImageProps =
29
+ | { paymentLogo: IOLogoPaymentType; image?: never }
30
+ | { paymentLogo?: never; image: ImageURISource | ImageSourcePropType }
31
+ | { paymentLogo?: never; image?: never };
39
32
 
40
- // ---------------- component ----------------
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 text={props.ctaText} />;
48
+ return <LoadingVersion {...props} />;
47
49
  }
48
50
 
49
- const paymentLogoEndMargin: IOSpacingScale = 12;
51
+ const { paymentLogo, image } = props;
50
52
 
51
- const ModuleBaseContent = () => (
52
- <View style={styles.rowCenter}>
53
- {/*
54
- we don't want to let the `space-between`
55
- handle spacing for the logo/text section,
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
- <View style={IOStyles.flex}>
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
- </View>
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 text={props.ctaText} />}
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
- // ---------------- sub-components----------------
91
-
92
- const ModuleAction = ({ text }: ActionOnlyProps) => (
100
+ const ModuleAction = ({ ctaText }: Pick<ModuleCheckoutProps, "ctaText">) => (
93
101
  <View pointerEvents="none">
94
102
  <ButtonLink
95
- label={text ?? ""}
96
- accessibilityLabel={text}
103
+ label={ctaText ?? ""}
104
+ accessibilityLabel={ctaText}
97
105
  onPress={() => null}
98
106
  />
99
107
  </View>
100
108
  );
101
109
 
102
- const LoadingVersion = ({ text }: ActionOnlyProps) => (
110
+ const LoadingVersion = ({ ctaText }: LoadingProps) => (
103
111
  <View style={IOModuleStyles.button}>
104
- <View style={styles.rowCenter}>
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 text={text} />
121
+ <ModuleAction ctaText={ctaText} />
114
122
  </View>
115
123
  );
116
124
 
117
- // ---------------- styles ----------------
125
+ const imageMarginRight: IOSpacingScale = 12;
118
126
 
119
127
  const styles = StyleSheet.create({
120
- rowCenter: {
121
- flexDirection: "row",
122
- alignItems: "center",
123
- flex: 1
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
  });
@@ -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": "#761F1F",
60
- "error-600": "#D75252",
61
- "error-500": "#FE6666",
62
- "error-400": "#FE8585" /* Dark mode */,
63
- "error-100": "#FFE0E0",
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-500",
323
- errorText: "error-850",
322
+ errorIcon: "error-600",
323
+ errorText: "error-600",
324
324
  // Pictograms
325
325
  "pictogram-hands": "blueIO-500",
326
326
  "pictogram-tint-main": "turquoise-150",