@lookiero/checkout 8.13.5-beta.0 → 8.14.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.
Files changed (93) hide show
  1. package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
  2. package/dist/src/infrastructure/ui/Root.d.ts +2 -0
  3. package/dist/src/infrastructure/ui/Root.js +2 -2
  4. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +5 -0
  5. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -3
  6. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +5 -0
  7. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
  8. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +5 -0
  9. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -2
  10. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -1
  11. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -1
  12. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +1 -1
  13. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +2 -2
  14. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.d.ts +3 -1
  15. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +3 -3
  16. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +4 -4
  17. package/dist/src/infrastructure/ui/routing/Routing.d.ts +7 -0
  18. package/dist/src/infrastructure/ui/routing/Routing.js +5 -5
  19. package/dist/src/infrastructure/ui/views/App.d.ts +8 -0
  20. package/dist/src/infrastructure/ui/views/App.js +8 -6
  21. package/dist/src/infrastructure/ui/views/App.style.d.ts +6 -0
  22. package/dist/src/infrastructure/ui/views/App.style.js +7 -0
  23. package/dist/src/infrastructure/ui/views/item/Item.d.ts +5 -0
  24. package/dist/src/infrastructure/ui/views/item/Item.js +3 -3
  25. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +2 -0
  26. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -2
  27. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +1 -1
  28. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +1 -1
  29. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +5 -1
  30. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +2 -2
  31. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +5 -0
  32. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
  33. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +3 -3
  34. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +2 -2
  35. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +1 -1
  36. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +1 -1
  37. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +2 -0
  38. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -2
  39. package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.d.ts +5 -0
  40. package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +2 -2
  41. package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.d.ts +5 -0
  42. package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +2 -2
  43. package/dist/src/infrastructure/ui/views/return/Return.d.ts +5 -0
  44. package/dist/src/infrastructure/ui/views/return/Return.js +2 -2
  45. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +5 -0
  46. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +12 -14
  47. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +2 -6
  48. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +2 -6
  49. package/dist/src/version.d.ts +1 -1
  50. package/dist/src/version.js +1 -1
  51. package/jest.setup.js +20 -0
  52. package/package.json +4 -3
  53. package/pact.config.ts +31 -0
  54. package/pact.publish.js +32 -0
  55. package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +62 -0
  56. package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +128 -0
  57. package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +63 -0
  58. package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +57 -0
  59. package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +57 -0
  60. package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +57 -0
  61. package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +63 -0
  62. package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +64 -0
  63. package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +62 -0
  64. package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +136 -0
  65. package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
  66. package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +62 -0
  67. package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +62 -0
  68. package/src/infrastructure/ui/Root.tsx +4 -1
  69. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +14 -1
  70. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.tsx +8 -1
  71. package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +6 -0
  72. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
  73. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +2 -1
  74. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +2 -0
  75. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +2 -0
  76. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +5 -2
  77. package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +3 -2
  78. package/src/infrastructure/ui/routing/Routing.tsx +13 -5
  79. package/src/infrastructure/ui/views/App.style.ts +9 -0
  80. package/src/infrastructure/ui/views/App.tsx +21 -11
  81. package/src/infrastructure/ui/views/item/Item.tsx +8 -2
  82. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
  83. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +9 -3
  84. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +8 -1
  85. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +12 -3
  86. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
  87. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +6 -6
  88. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -3
  89. package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +12 -2
  90. package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +14 -4
  91. package/src/infrastructure/ui/views/return/Return.tsx +8 -1
  92. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +2 -6
  93. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +33 -38
@@ -1,5 +1,5 @@
1
1
  import React, { FC, useCallback, useState } from "react";
2
- import { LayoutRectangle, Platform, ScrollView } from "react-native";
2
+ import { LayoutRectangle, Platform, ScrollView, StyleProp, ViewStyle } from "react-native";
3
3
  import { Spinner } from "@lookiero/aurora";
4
4
  import { CommandStatus } from "@lookiero/messaging-react";
5
5
  import { useLogger } from "@lookiero/sty-psp-logging";
@@ -23,6 +23,12 @@ import { SizeWithoutStockModal } from "../../components/sizeWithoutStockModal/Si
23
23
  import { ProductVariant } from "../productVariant/ProductVariant";
24
24
  import { style } from "./ItemWithoutCustomerDecission.style";
25
25
 
26
+ const { space6 } = theme();
27
+
28
+ interface ItemWithoutCustomerDecissionStyle {
29
+ readonly modal: StyleProp<ViewStyle>;
30
+ }
31
+
26
32
  interface CheckoutItemWithoutCustomerDecission extends CheckoutItemProjection {
27
33
  readonly status: CheckoutItemStatus.INITIAL;
28
34
  }
@@ -32,16 +38,16 @@ interface ItemWithoutCustomerDecissionProps {
32
38
  readonly checkoutItem: CheckoutItemWithoutCustomerDecission;
33
39
  readonly bookedProductsVariants: BookedProductsVariantsProjection;
34
40
  readonly currentProductVariant: ProductVariantProjection;
41
+ readonly style?: Partial<ItemWithoutCustomerDecissionStyle>;
35
42
  readonly onReturn: () => void;
36
43
  }
37
44
 
38
- const { space6 } = theme();
39
-
40
45
  const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps> = ({
41
46
  checkoutId,
42
47
  checkoutItem,
43
48
  bookedProductsVariants,
44
49
  currentProductVariant,
50
+ style: customStyle,
45
51
  onReturn,
46
52
  }) => {
47
53
  const logger = useLogger();
@@ -102,7 +108,11 @@ const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps> = ({
102
108
 
103
109
  return (
104
110
  <>
105
- <SizeWithoutStockModal visible={sizeWithoutStockModalVisible} onDismiss={handleOnHideSizeWithoutStockModal} />
111
+ <SizeWithoutStockModal
112
+ style={customStyle?.modal}
113
+ visible={sizeWithoutStockModalVisible}
114
+ onDismiss={handleOnHideSizeWithoutStockModal}
115
+ />
106
116
 
107
117
  <ScrollView showsVerticalScrollIndicator={false}>
108
118
  <Body style={{ row: style.container }}>
@@ -1,4 +1,5 @@
1
1
  import React, { FC } from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
2
3
  import { useParams } from "react-router-native";
3
4
  import { Spinner } from "@lookiero/aurora";
4
5
  import { QueryStatus } from "@lookiero/messaging-react";
@@ -9,11 +10,16 @@ import { ReturnQuestionFeedbackProvider } from "../../components/organisms/retur
9
10
  import { useStaticInfo } from "../../hooks/useStaticInfo";
10
11
  import { ReturnQuestionsForm } from "./components/returnQuestionsForm/ReturnQuestionsForm";
11
12
 
13
+ interface ReturnStyle {
14
+ readonly modal: StyleProp<ViewStyle>;
15
+ }
16
+
12
17
  interface ReturnProps {
13
18
  readonly layout: UiLayout;
19
+ readonly style?: Partial<ReturnStyle>;
14
20
  }
15
21
 
16
- const Return: FC<ReturnProps> = ({ layout }) => {
22
+ const Return: FC<ReturnProps> = ({ layout, style: customStyle }) => {
17
23
  const { id } = useParams();
18
24
  const {
19
25
  customer: { customerId, country, segment },
@@ -37,6 +43,7 @@ const Return: FC<ReturnProps> = ({ layout }) => {
37
43
  country={country}
38
44
  layout={layout}
39
45
  segment={segment}
46
+ style={customStyle}
40
47
  />
41
48
  </ReturnQuestionFeedbackProvider>
42
49
  );
@@ -5,9 +5,6 @@ import { HEADER_HEIGHT } from "../../../../components/templates/header/Header.st
5
5
  const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
6
6
 
7
7
  const style = StyleSheet.create({
8
- background: {
9
- backgroundColor: colorBgPrimaryLight,
10
- },
11
8
  description: {
12
9
  color: colorTextMedium,
13
10
  },
@@ -36,6 +33,7 @@ const style = StyleSheet.create({
36
33
  justifyContent: "center",
37
34
  },
38
35
  safeAreaView: {
36
+ backgroundColor: colorBgPrimaryLight,
39
37
  flex: 1,
40
38
  },
41
39
  scrollView: {
@@ -43,11 +41,9 @@ const style = StyleSheet.create({
43
41
  },
44
42
  submit: {
45
43
  backgroundColor: colorBgBase,
46
- padding: space6,
47
- },
48
- submitDesktop: {
49
44
  borderBottomLeftRadius: borderRadius5,
50
45
  borderBottomRightRadius: borderRadius5,
46
+ padding: space6,
51
47
  },
52
48
  });
53
49
 
@@ -1,7 +1,6 @@
1
1
  import { PortalHost } from "@gorhom/portal";
2
2
  import React, { FC, useCallback, useMemo } from "react";
3
- import { Platform } from "react-native";
4
- import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
3
+ import { ScrollView, StyleProp, ViewStyle } from "react-native";
5
4
  import { generatePath, useNavigate } from "react-router-native";
6
5
  import { Box, Button, Layout as AuroraLayout, Spinner, Text, View, useDevice } from "@lookiero/aurora";
7
6
  import { useI18nMessage } from "@lookiero/i18n-react";
@@ -49,12 +48,17 @@ const returnQuestionItems: ReturnQuestionItems = {
49
48
  [ReturnQuestionType.OPTION]: RadioReturnQuestionItem,
50
49
  };
51
50
 
51
+ interface ReturnQuestionsFormStyle {
52
+ readonly modal: StyleProp<ViewStyle>;
53
+ }
54
+
52
55
  interface ReturnQuestionsFormProps {
53
56
  readonly checkout: CheckoutProjection;
54
57
  readonly checkoutItem: CheckoutItemProjection;
55
58
  readonly country: Country;
56
59
  readonly layout: UiLayout;
57
60
  readonly segment: Segment;
61
+ readonly style?: Partial<ReturnQuestionsFormStyle>;
58
62
  }
59
63
 
60
64
  const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
@@ -63,6 +67,7 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
63
67
  country,
64
68
  layout: Layout,
65
69
  segment,
70
+ style: customStyle,
66
71
  }) => {
67
72
  const navigate = useNavigate();
68
73
  const basePath = useBasePath();
@@ -143,7 +148,6 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
143
148
  <PortalHost name={RETURN_QUESTION_FORM_PORTAL_HOST_NAME} />
144
149
 
145
150
  <Layout
146
- footer={null}
147
151
  header={header}
148
152
  scrollEnabled={false}
149
153
  style={{
@@ -154,41 +158,32 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
154
158
  >
155
159
  <ProductVariantPreview country={country} item={checkoutItem} />
156
160
 
157
- <KeyboardAwareScrollView
158
- extraScrollHeight={Platform.OS === "android" ? 10 : 120}
159
- keyboardShouldPersistTaps="handled"
160
- showsVerticalScrollIndicator={false}
161
- testID="return-questions-form"
162
- >
163
- <View style={style.background}>
164
- <AuroraLayout
165
- fullWidth={!screen.L}
166
- style={[style.layout, screen.L ? style.desktopLayoutSpacing : undefined]}
167
- >
168
- <Box size={{ L: "2/3" }}>
169
- <View style={[style.info, !screen.S && style.desktopInfo]}>
170
- <Text level={3} heading>
171
- {titleText}
172
- </Text>
173
- <Text level={1} style={style.description} detail>
174
- {descriptionText}
175
- </Text>
176
- </View>
177
-
178
- <ReturnQuestions
179
- portalHostName={RETURN_QUESTION_FORM_PORTAL_HOST_NAME}
180
- returnQuestions={returnQuestions}
181
- />
182
-
183
- <View style={[style.submit, !screen.S && style.submitDesktop]}>
184
- <Button testID="return-questions-button" onPress={handleOnSubmit}>
185
- {submitButtonText}
186
- </Button>
187
- </View>
188
- </Box>
189
- </AuroraLayout>
190
- </View>
191
- </KeyboardAwareScrollView>
161
+ <ScrollView showsVerticalScrollIndicator={false} testID="return-questions-form">
162
+ <AuroraLayout fullWidth={!screen.L} style={[style.layout, screen.L ? style.desktopLayoutSpacing : undefined]}>
163
+ <Box size={{ L: "2/3" }}>
164
+ <View style={[style.info, !screen.S && style.desktopInfo]}>
165
+ <Text level={3} heading>
166
+ {titleText}
167
+ </Text>
168
+ <Text level={1} style={style.description} detail>
169
+ {descriptionText}
170
+ </Text>
171
+ </View>
172
+
173
+ <ReturnQuestions
174
+ portalHostName={RETURN_QUESTION_FORM_PORTAL_HOST_NAME}
175
+ returnQuestions={returnQuestions}
176
+ style={customStyle}
177
+ />
178
+
179
+ <View style={style.submit}>
180
+ <Button testID="return-questions-button" onPress={handleOnSubmit}>
181
+ {submitButtonText}
182
+ </Button>
183
+ </View>
184
+ </Box>
185
+ </AuroraLayout>
186
+ </ScrollView>
192
187
  </Layout>
193
188
  </ReturnQuestionItemProvider>
194
189
  );