@lookiero/checkout 9.11.0 → 9.12.0-beta.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.
@@ -24,7 +24,7 @@ const order = {
24
24
  coupon: "MYLOOKIERO",
25
25
  };
26
26
  const customer = {
27
- customerId: "74cb4f76-3f14-4983-81a6-2ee2a9a275d4",
27
+ customerId: "8107b5fe-8209-4b8f-86ef-85657cc496be",
28
28
  country: Country.ES,
29
29
  segment: Segment.WOMEN,
30
30
  };
@@ -1,12 +1,15 @@
1
1
  import React, { useCallback } from "react";
2
- import { Button, BUTTON_VARIANT } from "@lookiero/aurora";
2
+ import { TouchableOpacity } from "react-native";
3
+ import { ALIGN, Text } from "@lookiero/aurora";
3
4
  import { useI18nMessage } from "@lookiero/i18n-react";
4
5
  import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
5
6
  import { style } from "./ButtonCheckoutQuestionItem.style";
7
+ const ACTIVE_OPACITY = 0.6;
6
8
  const ButtonCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, testID, }) => {
7
9
  const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
8
10
  const optionText = useI18nMessage({ id: checkoutQuestion.name });
9
11
  const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
10
- return (React.createElement(Button, { accessibilityLabel: testID, style: style.button, testID: testID, variant: feedback === checkoutQuestion.id ? BUTTON_VARIANT.PRIMARY : BUTTON_VARIANT.SECONDARY, onPress: handleOnPress }, optionText));
12
+ return (React.createElement(TouchableOpacity, { accessibilityLabel: testID, activeOpacity: ACTIVE_OPACITY, style: [style.button, feedback === checkoutQuestion.id && style.buttonActive], testID: testID, onPress: handleOnPress },
13
+ React.createElement(Text, { align: ALIGN.CENTER, level: 3, style: feedback === checkoutQuestion.id && style.textActive, action: true }, optionText)));
11
14
  };
12
15
  export { ButtonCheckoutQuestionItem };
@@ -1,5 +1,21 @@
1
- import { ViewStyle } from "react-native";
2
1
  declare const style: {
3
- button: ViewStyle;
2
+ button: {
3
+ alignContent: "center";
4
+ borderColor: string;
5
+ borderRadius: number;
6
+ borderWidth: number;
7
+ flex: number;
8
+ height: number;
9
+ justifyContent: "center";
10
+ marginHorizontal: number;
11
+ paddingLeft: number;
12
+ paddingRight: number;
13
+ };
14
+ buttonActive: {
15
+ backgroundColor: string;
16
+ };
17
+ textActive: {
18
+ color: string;
19
+ };
4
20
  };
5
21
  export { style };
@@ -1,13 +1,25 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
- const { colorBorderActionSecondary, borderWidth2, borderStyle } = theme();
3
+ const { colorBorderActionSecondary, colorBgActionPrimaryActive, colorTextActionPrimary, borderWidth2, borderRadiusFull, space6, space16, } = theme();
4
+ const HEIGHT = space16;
4
5
  const style = StyleSheet.create({
5
6
  button: {
7
+ alignContent: "center",
6
8
  borderColor: colorBorderActionSecondary,
7
- borderStyle: borderStyle,
9
+ borderRadius: borderRadiusFull,
8
10
  borderWidth: borderWidth2,
9
11
  flex: 1,
12
+ height: HEIGHT,
13
+ justifyContent: "center",
10
14
  marginHorizontal: 12,
15
+ paddingLeft: space6,
16
+ paddingRight: space6,
17
+ },
18
+ buttonActive: {
19
+ backgroundColor: colorBgActionPrimaryActive,
20
+ },
21
+ textActive: {
22
+ color: colorTextActionPrimary,
11
23
  },
12
24
  });
13
25
  export { style };
@@ -1 +1 @@
1
- export declare const VERSION = "9.11.0";
1
+ export declare const VERSION = "9.12.0-beta.0";
@@ -1 +1 @@
1
- export const VERSION = "9.11.0";
1
+ export const VERSION = "9.12.0-beta.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "9.11.0",
3
+ "version": "9.12.0-beta.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
package/src/ExpoRoot.tsx CHANGED
@@ -32,7 +32,7 @@ const order: Order = {
32
32
  };
33
33
 
34
34
  const customer: Customer = {
35
- customerId: "74cb4f76-3f14-4983-81a6-2ee2a9a275d4",
35
+ customerId: "8107b5fe-8209-4b8f-86ef-85657cc496be",
36
36
  country: Country.ES,
37
37
  segment: Segment.WOMEN,
38
38
  };
@@ -1,16 +1,37 @@
1
- import { StyleSheet, ViewStyle } from "react-native";
1
+ import { StyleSheet } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
3
 
4
- const { colorBorderActionSecondary, borderWidth2, borderStyle } = theme();
4
+ const {
5
+ colorBorderActionSecondary,
6
+ colorBgActionPrimaryActive,
7
+ colorTextActionPrimary,
8
+ borderWidth2,
9
+ borderRadiusFull,
10
+ space6,
11
+ space16,
12
+ } = theme();
13
+
14
+ const HEIGHT = space16;
5
15
 
6
16
  const style = StyleSheet.create({
7
17
  button: {
18
+ alignContent: "center",
8
19
  borderColor: colorBorderActionSecondary,
9
- borderStyle: borderStyle,
20
+ borderRadius: borderRadiusFull,
10
21
  borderWidth: borderWidth2,
11
22
  flex: 1,
23
+ height: HEIGHT,
24
+ justifyContent: "center",
12
25
  marginHorizontal: 12,
13
- } as ViewStyle,
26
+ paddingLeft: space6,
27
+ paddingRight: space6,
28
+ },
29
+ buttonActive: {
30
+ backgroundColor: colorBgActionPrimaryActive,
31
+ },
32
+ textActive: {
33
+ color: colorTextActionPrimary,
34
+ },
14
35
  });
15
36
 
16
37
  export { style };
@@ -1,10 +1,13 @@
1
1
  import React, { useCallback } from "react";
2
- import { Button, BUTTON_VARIANT } from "@lookiero/aurora";
2
+ import { TouchableOpacity } from "react-native";
3
+ import { ALIGN, Text } from "@lookiero/aurora";
3
4
  import { useI18nMessage } from "@lookiero/i18n-react";
4
5
  import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
5
6
  import { CheckoutQuestionItem, CheckoutQuestionItemProps } from "../CheckoutQuestionItem";
6
7
  import { style } from "./ButtonCheckoutQuestionItem.style";
7
8
 
9
+ const ACTIVE_OPACITY = 0.6;
10
+
8
11
  const ButtonCheckoutQuestionItem: CheckoutQuestionItem = ({
9
12
  checkoutQuestion,
10
13
  checkoutQuestionParentId,
@@ -19,15 +22,17 @@ const ButtonCheckoutQuestionItem: CheckoutQuestionItem = ({
19
22
  );
20
23
 
21
24
  return (
22
- <Button
25
+ <TouchableOpacity
23
26
  accessibilityLabel={testID}
24
- style={style.button}
27
+ activeOpacity={ACTIVE_OPACITY}
28
+ style={[style.button, feedback === checkoutQuestion.id && style.buttonActive]}
25
29
  testID={testID}
26
- variant={feedback === checkoutQuestion.id ? BUTTON_VARIANT.PRIMARY : BUTTON_VARIANT.SECONDARY}
27
30
  onPress={handleOnPress}
28
31
  >
29
- {optionText}
30
- </Button>
32
+ <Text align={ALIGN.CENTER} level={3} style={feedback === checkoutQuestion.id && style.textActive} action>
33
+ {optionText}
34
+ </Text>
35
+ </TouchableOpacity>
31
36
  );
32
37
  };
33
38