@lookiero/checkout 8.14.0-beta.3 → 8.15.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 (194) hide show
  1. package/.eslintrc.js +1 -1
  2. package/cypress/integration/checkout.spec.ts +259 -0
  3. package/cypress/support/e2e.ts +3 -0
  4. package/cypress/support/index.d.ts +8 -0
  5. package/cypress/support/interceptBlockCheckoutBooking.ts +4 -0
  6. package/cypress/support/interceptGiveCheckoutFeedback.ts +4 -0
  7. package/cypress/support/interceptKeepCheckoutItem.ts +4 -0
  8. package/cypress/support/interceptListCheckoutQuestionsByCheckoutId.ts +9 -0
  9. package/cypress/support/interceptListReturnQuestionsByCheckoutItemId.ts +9 -0
  10. package/cypress/support/interceptPayment.ts +23 -0
  11. package/cypress/support/interceptReplaceCheckoutItem.ts +4 -0
  12. package/cypress/support/interceptReturnCheckoutItem.ts +4 -0
  13. package/cypress/support/interceptSubmitCheckout.ts +4 -0
  14. package/cypress/support/interceptViewBookedProductsVariantsForCheckoutItem.ts +9 -0
  15. package/cypress/support/interceptViewCheckoutById.ts +6 -0
  16. package/cypress/support/interceptViewFirstAvailableCheckoutByCustomerId.ts +9 -0
  17. package/cypress/support/interceptViewFiveItemsDiscountByCustomerId.ts +6 -0
  18. package/cypress/support/interceptViewIsSizeChangeEnabledByCheckoutId.ts +6 -0
  19. package/cypress/support/interceptViewPaymentFlowPayloadByCheckoutId.ts +9 -0
  20. package/cypress/support/interceptViewPricingByCheckoutId.ts +6 -0
  21. package/cypress/tsconfig.json +8 -0
  22. package/cypress.config.ts +50 -0
  23. package/dist/src/ExpoRoot.js +2 -2
  24. package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
  25. package/dist/src/infrastructure/ui/Root.d.ts +1 -2
  26. package/dist/src/infrastructure/ui/Root.js +2 -4
  27. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -3
  28. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -1
  29. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -1
  30. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +2 -3
  31. package/dist/src/infrastructure/ui/test/render.js +1 -3
  32. package/dist/src/infrastructure/ui/views/App.js +7 -12
  33. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -3
  34. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +1 -1
  35. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +1 -1
  36. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +9 -2
  37. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +5 -6
  38. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +1 -1
  39. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +1 -1
  40. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -3
  41. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +3 -2
  42. package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -2
  43. package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +1 -1
  44. package/dist/src/version.d.ts +1 -1
  45. package/dist/src/version.js +1 -1
  46. package/jest.setup.js +0 -20
  47. package/package.json +10 -9
  48. package/src/ExpoRoot.tsx +2 -2
  49. package/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.test.ts +1 -1
  50. package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
  51. package/src/infrastructure/ui/Root.tsx +17 -21
  52. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
  53. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +2 -3
  54. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +2 -3
  55. package/src/infrastructure/ui/test/render.tsx +1 -4
  56. package/src/infrastructure/ui/views/App.tsx +16 -23
  57. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
  58. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +2 -3
  59. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +10 -6
  60. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +0 -1
  61. package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +26 -24
  62. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
  63. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +21 -10
  64. package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +15 -5
  65. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +2 -4
  66. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +10 -6
  67. package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +2 -2
  68. package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +78 -72
  69. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +9 -3
  70. package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +4 -4
  71. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -2
  72. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +2 -2
  73. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +2 -2
  74. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +30 -28
  75. package/dist/pact.config.d.ts +0 -13
  76. package/dist/pact.config.js +0 -9
  77. package/dist/public/public/assets/adaptive-icon.png +0 -0
  78. package/dist/public/public/assets/favicon.png +0 -0
  79. package/dist/public/public/assets/icon.png +0 -0
  80. package/dist/public/public/assets/splash.png +0 -0
  81. package/dist/public/public/images/not-found.png +0 -0
  82. package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.d.ts +0 -3
  83. package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.js +0 -27
  84. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
  85. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -48
  86. package/dist/src/infrastructure/projection/checkout/checkout.mock.d.ts +0 -19
  87. package/dist/src/infrastructure/projection/checkout/checkout.mock.js +0 -21
  88. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
  89. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -109
  90. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
  91. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -49
  92. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
  93. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -44
  94. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
  95. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -44
  96. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
  97. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -44
  98. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -10
  99. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -17
  100. package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.d.ts +0 -3
  101. package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.js +0 -6
  102. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
  103. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -49
  104. package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +0 -15
  105. package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.js +0 -43
  106. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
  107. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -50
  108. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +0 -3
  109. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +0 -103
  110. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
  111. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -48
  112. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
  113. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -109
  114. package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.d.ts +0 -6
  115. package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.js +0 -183
  116. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
  117. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -48
  118. package/dist/src/infrastructure/projection/pricing/pricing.mock.d.ts +0 -9
  119. package/dist/src/infrastructure/projection/pricing/pricing.mock.js +0 -42
  120. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
  121. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -48
  122. package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.d.ts +0 -3
  123. package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.js +0 -400
  124. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -21
  125. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
  126. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -6
  127. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -4
  128. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -6
  129. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -5
  130. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
  131. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -19
  132. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -3
  133. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -18
  134. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
  135. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -13
  136. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -6
  137. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -11
  138. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
  139. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -11
  140. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -11
  141. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -49
  142. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -9
  143. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -9
  144. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -19
  145. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -21
  146. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -9
  147. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -21
  148. package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
  149. package/dist/src/infrastructure/ui/views/App.style.js +0 -7
  150. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
  151. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -10
  152. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -11
  153. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -40
  154. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
  155. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -15
  156. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
  157. package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -43
  158. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -13
  159. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -9
  160. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
  161. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -10
  162. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -17
  163. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -13
  164. package/dist/src/projection/shared/country.d.ts +0 -14
  165. package/dist/src/projection/shared/country.js +0 -15
  166. package/dist/src/projection/shared/customer.d.ts +0 -8
  167. package/dist/src/projection/shared/customer.js +0 -1
  168. package/dist/src/projection/shared/locale.d.ts +0 -12
  169. package/dist/src/projection/shared/locale.js +0 -13
  170. package/dist/src/projection/shared/order.d.ts +0 -6
  171. package/dist/src/projection/shared/order.js +0 -1
  172. package/dist/src/projection/shared/price.d.ts +0 -10
  173. package/dist/src/projection/shared/price.js +0 -1
  174. package/dist/src/projection/shared/size.d.ts +0 -20
  175. package/dist/src/projection/shared/size.js +0 -3
  176. package/dist/src/projection/shared/subscription.d.ts +0 -2
  177. package/dist/src/projection/shared/subscription.js +0 -1
  178. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -10
  179. package/dist/src/shared/ui/components/atoms/error/Error.js +0 -4
  180. package/pact.config.ts +0 -31
  181. package/pact.publish.js +0 -32
  182. package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +0 -62
  183. package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +0 -128
  184. package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +0 -63
  185. package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +0 -57
  186. package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +0 -57
  187. package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +0 -57
  188. package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +0 -63
  189. package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +0 -64
  190. package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +0 -62
  191. package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +0 -136
  192. package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +0 -62
  193. package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +0 -62
  194. package/src/infrastructure/ui/views/App.style.ts +0 -9
@@ -77,7 +77,8 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
77
77
  style={{}}
78
78
  >
79
79
  <View
80
- animatedStyle={
80
+ collapsable={false}
81
+ jestAnimatedStyle={
81
82
  {
82
83
  "value": {
83
84
  "transform": [
@@ -88,7 +89,6 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
88
89
  },
89
90
  }
90
91
  }
91
- collapsable={false}
92
92
  style={
93
93
  {
94
94
  "flex": 1,
@@ -105,16 +105,17 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
105
105
  testID="carousel-track"
106
106
  >
107
107
  <View
108
+ collapsable={false}
109
+ jestAnimatedStyle={
110
+ {
111
+ "value": {},
112
+ }
113
+ }
108
114
  style={
109
- [
110
- {
111
- "flex": 1,
112
- },
113
- undefined,
114
- {
115
- "width": 300,
116
- },
117
- ]
115
+ {
116
+ "flex": 1,
117
+ "width": 300,
118
+ }
118
119
  }
119
120
  testID="carousel-item"
120
121
  >
@@ -231,14 +232,14 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
231
232
  </View>
232
233
  </View>
233
234
  <Image
234
- animatedStyle={
235
+ collapsable={false}
236
+ jestAnimatedStyle={
235
237
  {
236
238
  "value": {
237
239
  "opacity": 0,
238
240
  },
239
241
  }
240
242
  }
241
- collapsable={false}
242
243
  onLoad={[Function]}
243
244
  resizeMode="stretch"
244
245
  source={
@@ -263,16 +264,17 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
263
264
  </View>
264
265
  </View>
265
266
  <View
267
+ collapsable={false}
268
+ jestAnimatedStyle={
269
+ {
270
+ "value": {},
271
+ }
272
+ }
266
273
  style={
267
- [
268
- {
269
- "flex": 1,
270
- },
271
- undefined,
272
- {
273
- "width": 300,
274
- },
275
- ]
274
+ {
275
+ "flex": 1,
276
+ "width": 300,
277
+ }
276
278
  }
277
279
  testID="carousel-item"
278
280
  >
@@ -389,14 +391,14 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
389
391
  </View>
390
392
  </View>
391
393
  <Image
392
- animatedStyle={
394
+ collapsable={false}
395
+ jestAnimatedStyle={
393
396
  {
394
397
  "value": {
395
398
  "opacity": 0,
396
399
  },
397
400
  }
398
401
  }
399
- collapsable={false}
400
402
  onLoad={[Function]}
401
403
  resizeMode="stretch"
402
404
  source={
@@ -4,7 +4,7 @@ import { theme } from "@lookiero/sty-psp-ui";
4
4
  const { borderWidth1, colorBorderInteractive, space1, space5, space6 } = theme();
5
5
 
6
6
  const style = StyleSheet.create({
7
- modal: {
7
+ modalContent: {
8
8
  paddingBottom: space6,
9
9
  paddingHorizontal: space6,
10
10
  },
@@ -1,11 +1,17 @@
1
1
  import React, { FC, useCallback } from "react";
2
- import { TouchableHighlight, View } from "react-native";
2
+ import { StyleProp, TextStyle, TouchableHighlight, View, ViewStyle } from "react-native";
3
3
  import { COLOR, Text } from "@lookiero/aurora";
4
- import { Modal, theme, useEnvironmentStyle } from "@lookiero/sty-psp-ui";
4
+ import { Modal, theme } from "@lookiero/sty-psp-ui";
5
5
  import { style } from "./SelectModal.style";
6
6
 
7
7
  const { colorBgPrimaryLight } = theme();
8
8
 
9
+ interface SelectModalStyle {
10
+ readonly modalContent: StyleProp<ViewStyle>;
11
+ readonly option: StyleProp<ViewStyle>;
12
+ readonly optionText: StyleProp<TextStyle>;
13
+ }
14
+
9
15
  interface Option {
10
16
  readonly label: string;
11
17
  readonly value: string;
@@ -15,22 +21,23 @@ interface SelectModalProps {
15
21
  readonly title?: string;
16
22
  readonly value: string | undefined;
17
23
  readonly options: Option[];
18
- readonly modalVisible: boolean;
19
- readonly testID?: string;
24
+ readonly style?: Partial<SelectModalStyle>;
20
25
  readonly onChange?: (value: string) => void;
21
26
  readonly onClose?: () => void;
27
+ readonly modalVisible: boolean;
28
+ readonly testID?: string;
22
29
  }
23
30
 
24
31
  const SelectModal: FC<SelectModalProps> = ({
25
32
  modalVisible,
33
+ onChange = () => void 0,
34
+ onClose = () => void 0,
26
35
  options,
36
+ style: customStyle,
27
37
  testID,
28
38
  title,
29
39
  value,
30
- onChange = () => void 0,
31
- onClose = () => void 0,
32
40
  }) => {
33
- const { modal } = useEnvironmentStyle();
34
41
  const handleOnPressOption = useCallback(
35
42
  (value: string) => {
36
43
  onChange(value);
@@ -41,7 +48,7 @@ const SelectModal: FC<SelectModalProps> = ({
41
48
 
42
49
  return (
43
50
  <Modal testID={testID} visible={modalVisible} scroll showCloseButton onClose={onClose}>
44
- <View style={[style.modal, modal?.content]}>
51
+ <View style={[style.modalContent, customStyle?.modalContent]}>
45
52
  {title && (
46
53
  <Text level={3} style={style.modalTitle} heading>
47
54
  {title}
@@ -52,13 +59,17 @@ const SelectModal: FC<SelectModalProps> = ({
52
59
  key={optionValue}
53
60
  accessibilityLabel={optionValue}
54
61
  disabled={value === optionValue}
55
- style={style.option}
62
+ style={[style.option, customStyle?.option]}
56
63
  testID={optionValue}
57
64
  underlayColor={colorBgPrimaryLight}
58
65
  accessible
59
66
  onPress={value !== optionValue ? () => handleOnPressOption(optionValue) : undefined}
60
67
  >
61
- <Text color={value === optionValue ? COLOR.TEXT_MEDIUM : COLOR.TEXT} level={3} style={style.optionText}>
68
+ <Text
69
+ color={value === optionValue ? COLOR.TEXT_MEDIUM : COLOR.TEXT}
70
+ level={3}
71
+ style={[style.optionText as ViewStyle, customStyle?.optionText]}
72
+ >
62
73
  {label}
63
74
  </Text>
64
75
  </TouchableHighlight>
@@ -76,6 +76,7 @@ exports[`SelectField component matches the snapshot 1`] = `
76
76
  "zIndex": 1,
77
77
  }
78
78
  }
79
+ testID="modal-close-button"
79
80
  />
80
81
  <View
81
82
  pointerEvents="box-none"
@@ -206,6 +207,12 @@ exports[`SelectField component matches the snapshot 1`] = `
206
207
  </View>
207
208
  </View>
208
209
  <RCTScrollView
210
+ contentInset={
211
+ {
212
+ "bottom": 0,
213
+ "top": 0,
214
+ }
215
+ }
209
216
  keyboardShouldPersistTaps="handled"
210
217
  showsVerticalScrollIndicator={false}
211
218
  >
@@ -253,11 +260,14 @@ exports[`SelectField component matches the snapshot 1`] = `
253
260
  onResponderTerminationRequest={[Function]}
254
261
  onStartShouldSetResponder={[Function]}
255
262
  style={
256
- {
257
- "borderBottomColor": "#DAD8D8",
258
- "borderBottomWidth": 1,
259
- "paddingVertical": 20,
260
- }
263
+ [
264
+ {
265
+ "borderBottomColor": "#DAD8D8",
266
+ "borderBottomWidth": 1,
267
+ "paddingVertical": 20,
268
+ },
269
+ undefined,
270
+ ]
261
271
  }
262
272
  testID="optionValue"
263
273
  >
@@ -2,7 +2,7 @@ import React, { FC } from "react";
2
2
  import { View } from "react-native";
3
3
  import { Button, Text } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { Modal, useEnvironmentStyle } from "@lookiero/sty-psp-ui";
5
+ import { Modal } from "@lookiero/sty-psp-ui";
6
6
  import { I18nMessages } from "../../../../i18n/i18n";
7
7
  import { style } from "./SizeWithoutStockModal.style";
8
8
 
@@ -10,16 +10,14 @@ interface SizeWithoutStockModalProps {
10
10
  readonly visible: boolean;
11
11
  readonly onDismiss: () => void;
12
12
  }
13
-
14
13
  const SizeWithoutStockModal: FC<SizeWithoutStockModalProps> = ({ visible, onDismiss }) => {
15
- const { modal } = useEnvironmentStyle();
16
14
  const titleText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_TITLE });
17
15
  const descriptionText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION });
18
16
  const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
19
17
 
20
18
  return (
21
19
  <Modal visible={visible} showCloseButton onClose={onDismiss}>
22
- <View style={[style.modalContent, modal?.content]}>
20
+ <View style={style.modalContent}>
23
21
  <Text level={3} style={style.title} heading>
24
22
  {titleText}
25
23
  </Text>
@@ -76,6 +76,7 @@ exports[`SizeWithoutStockModal component matches the snapshot 1`] = `
76
76
  "zIndex": 1,
77
77
  }
78
78
  }
79
+ testID="modal-close-button"
79
80
  />
80
81
  <View
81
82
  pointerEvents="box-none"
@@ -206,6 +207,12 @@ exports[`SizeWithoutStockModal component matches the snapshot 1`] = `
206
207
  </View>
207
208
  </View>
208
209
  <View
210
+ contentInset={
211
+ {
212
+ "bottom": 0,
213
+ "top": 0,
214
+ }
215
+ }
209
216
  keyboardShouldPersistTaps="handled"
210
217
  showsVerticalScrollIndicator={false}
211
218
  >
@@ -218,12 +225,9 @@ exports[`SizeWithoutStockModal component matches the snapshot 1`] = `
218
225
  >
219
226
  <View
220
227
  style={
221
- [
222
- {
223
- "paddingHorizontal": 24,
224
- },
225
- undefined,
226
- ]
228
+ {
229
+ "paddingHorizontal": 24,
230
+ }
227
231
  }
228
232
  >
229
233
  <Text
@@ -23,8 +23,6 @@ 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
26
  interface CheckoutItemWithoutCustomerDecission extends CheckoutItemProjection {
29
27
  readonly status: CheckoutItemStatus.INITIAL;
30
28
  }
@@ -37,6 +35,8 @@ interface ItemWithoutCustomerDecissionProps {
37
35
  readonly onReturn: () => void;
38
36
  }
39
37
 
38
+ const { space6 } = theme();
39
+
40
40
  const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps> = ({
41
41
  checkoutId,
42
42
  checkoutItem,
@@ -88,7 +88,8 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
88
88
  style={{}}
89
89
  >
90
90
  <View
91
- animatedStyle={
91
+ collapsable={false}
92
+ jestAnimatedStyle={
92
93
  {
93
94
  "value": {
94
95
  "transform": [
@@ -99,7 +100,6 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
99
100
  },
100
101
  }
101
102
  }
102
- collapsable={false}
103
103
  style={
104
104
  {
105
105
  "flex": 1,
@@ -116,16 +116,17 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
116
116
  testID="carousel-track"
117
117
  >
118
118
  <View
119
+ collapsable={false}
120
+ jestAnimatedStyle={
121
+ {
122
+ "value": {},
123
+ }
124
+ }
119
125
  style={
120
- [
121
- {
122
- "flex": 1,
123
- },
124
- undefined,
125
- {
126
- "width": 300,
127
- },
128
- ]
126
+ {
127
+ "flex": 1,
128
+ "width": 300,
129
+ }
129
130
  }
130
131
  testID="carousel-item"
131
132
  >
@@ -242,14 +243,14 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
242
243
  </View>
243
244
  </View>
244
245
  <Image
245
- animatedStyle={
246
+ collapsable={false}
247
+ jestAnimatedStyle={
246
248
  {
247
249
  "value": {
248
250
  "opacity": 0,
249
251
  },
250
252
  }
251
253
  }
252
- collapsable={false}
253
254
  onLoad={[Function]}
254
255
  resizeMode="stretch"
255
256
  source={
@@ -274,16 +275,17 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
274
275
  </View>
275
276
  </View>
276
277
  <View
278
+ collapsable={false}
279
+ jestAnimatedStyle={
280
+ {
281
+ "value": {},
282
+ }
283
+ }
277
284
  style={
278
- [
279
- {
280
- "flex": 1,
281
- },
282
- undefined,
283
- {
284
- "width": 300,
285
- },
286
- ]
285
+ {
286
+ "flex": 1,
287
+ "width": 300,
288
+ }
287
289
  }
288
290
  testID="carousel-item"
289
291
  >
@@ -400,14 +402,14 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
400
402
  </View>
401
403
  </View>
402
404
  <Image
403
- animatedStyle={
405
+ collapsable={false}
406
+ jestAnimatedStyle={
404
407
  {
405
408
  "value": {
406
409
  "opacity": 0,
407
410
  },
408
411
  }
409
412
  }
410
- collapsable={false}
411
413
  onLoad={[Function]}
412
414
  resizeMode="stretch"
413
415
  source={
@@ -789,7 +791,8 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
789
791
  style={{}}
790
792
  >
791
793
  <View
792
- animatedStyle={
794
+ collapsable={false}
795
+ jestAnimatedStyle={
793
796
  {
794
797
  "value": {
795
798
  "transform": [
@@ -800,7 +803,6 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
800
803
  },
801
804
  }
802
805
  }
803
- collapsable={false}
804
806
  style={
805
807
  {
806
808
  "flex": 1,
@@ -817,16 +819,17 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
817
819
  testID="carousel-track"
818
820
  >
819
821
  <View
822
+ collapsable={false}
823
+ jestAnimatedStyle={
824
+ {
825
+ "value": {},
826
+ }
827
+ }
820
828
  style={
821
- [
822
- {
823
- "flex": 1,
824
- },
825
- undefined,
826
- {
827
- "width": 300,
828
- },
829
- ]
829
+ {
830
+ "flex": 1,
831
+ "width": 300,
832
+ }
830
833
  }
831
834
  testID="carousel-item"
832
835
  >
@@ -943,14 +946,14 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
943
946
  </View>
944
947
  </View>
945
948
  <Image
946
- animatedStyle={
949
+ collapsable={false}
950
+ jestAnimatedStyle={
947
951
  {
948
952
  "value": {
949
953
  "opacity": 0,
950
954
  },
951
955
  }
952
956
  }
953
- collapsable={false}
954
957
  onLoad={[Function]}
955
958
  resizeMode="stretch"
956
959
  source={
@@ -975,16 +978,17 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
975
978
  </View>
976
979
  </View>
977
980
  <View
981
+ collapsable={false}
982
+ jestAnimatedStyle={
983
+ {
984
+ "value": {},
985
+ }
986
+ }
978
987
  style={
979
- [
980
- {
981
- "flex": 1,
982
- },
983
- undefined,
984
- {
985
- "width": 300,
986
- },
987
- ]
988
+ {
989
+ "flex": 1,
990
+ "width": 300,
991
+ }
988
992
  }
989
993
  testID="carousel-item"
990
994
  >
@@ -1101,14 +1105,14 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
1101
1105
  </View>
1102
1106
  </View>
1103
1107
  <Image
1104
- animatedStyle={
1108
+ collapsable={false}
1109
+ jestAnimatedStyle={
1105
1110
  {
1106
1111
  "value": {
1107
1112
  "opacity": 0,
1108
1113
  },
1109
1114
  }
1110
1115
  }
1111
- collapsable={false}
1112
1116
  onLoad={[Function]}
1113
1117
  resizeMode="stretch"
1114
1118
  source={
@@ -1490,7 +1494,8 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
1490
1494
  style={{}}
1491
1495
  >
1492
1496
  <View
1493
- animatedStyle={
1497
+ collapsable={false}
1498
+ jestAnimatedStyle={
1494
1499
  {
1495
1500
  "value": {
1496
1501
  "transform": [
@@ -1501,7 +1506,6 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
1501
1506
  },
1502
1507
  }
1503
1508
  }
1504
- collapsable={false}
1505
1509
  style={
1506
1510
  {
1507
1511
  "flex": 1,
@@ -1518,16 +1522,17 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
1518
1522
  testID="carousel-track"
1519
1523
  >
1520
1524
  <View
1525
+ collapsable={false}
1526
+ jestAnimatedStyle={
1527
+ {
1528
+ "value": {},
1529
+ }
1530
+ }
1521
1531
  style={
1522
- [
1523
- {
1524
- "flex": 1,
1525
- },
1526
- undefined,
1527
- {
1528
- "width": 300,
1529
- },
1530
- ]
1532
+ {
1533
+ "flex": 1,
1534
+ "width": 300,
1535
+ }
1531
1536
  }
1532
1537
  testID="carousel-item"
1533
1538
  >
@@ -1644,14 +1649,14 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
1644
1649
  </View>
1645
1650
  </View>
1646
1651
  <Image
1647
- animatedStyle={
1652
+ collapsable={false}
1653
+ jestAnimatedStyle={
1648
1654
  {
1649
1655
  "value": {
1650
1656
  "opacity": 0,
1651
1657
  },
1652
1658
  }
1653
1659
  }
1654
- collapsable={false}
1655
1660
  onLoad={[Function]}
1656
1661
  resizeMode="stretch"
1657
1662
  source={
@@ -1676,16 +1681,17 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
1676
1681
  </View>
1677
1682
  </View>
1678
1683
  <View
1684
+ collapsable={false}
1685
+ jestAnimatedStyle={
1686
+ {
1687
+ "value": {},
1688
+ }
1689
+ }
1679
1690
  style={
1680
- [
1681
- {
1682
- "flex": 1,
1683
- },
1684
- undefined,
1685
- {
1686
- "width": 300,
1687
- },
1688
- ]
1691
+ {
1692
+ "flex": 1,
1693
+ "width": 300,
1694
+ }
1689
1695
  }
1690
1696
  testID="carousel-item"
1691
1697
  >
@@ -1802,14 +1808,14 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
1802
1808
  </View>
1803
1809
  </View>
1804
1810
  <Image
1805
- animatedStyle={
1811
+ collapsable={false}
1812
+ jestAnimatedStyle={
1806
1813
  {
1807
1814
  "value": {
1808
1815
  "opacity": 0,
1809
1816
  },
1810
1817
  }
1811
1818
  }
1812
- collapsable={false}
1813
1819
  onLoad={[Function]}
1814
1820
  resizeMode="stretch"
1815
1821
  source={
@@ -1,6 +1,7 @@
1
1
  import { PortalHost } from "@gorhom/portal";
2
2
  import React, { FC, useCallback, useMemo } from "react";
3
- import { ScrollView } from "react-native";
3
+ import { Platform } from "react-native";
4
+ import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
4
5
  import { generatePath, useNavigate } from "react-router-native";
5
6
  import { Box, Button, Layout as AuroraLayout, Spinner, Text, View, useDevice } from "@lookiero/aurora";
6
7
  import { useI18nMessage } from "@lookiero/i18n-react";
@@ -153,7 +154,12 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
153
154
  >
154
155
  <ProductVariantPreview country={country} item={checkoutItem} />
155
156
 
156
- <ScrollView showsVerticalScrollIndicator={false} testID="return-questions-form">
157
+ <KeyboardAwareScrollView
158
+ extraScrollHeight={Platform.OS === "android" ? 10 : 120}
159
+ keyboardShouldPersistTaps="handled"
160
+ showsVerticalScrollIndicator={false}
161
+ testID="return-questions-form"
162
+ >
157
163
  <View style={style.background}>
158
164
  <AuroraLayout
159
165
  fullWidth={!screen.L}
@@ -182,7 +188,7 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
182
188
  </Box>
183
189
  </AuroraLayout>
184
190
  </View>
185
- </ScrollView>
191
+ </KeyboardAwareScrollView>
186
192
  </Layout>
187
193
  </ReturnQuestionItemProvider>
188
194
  );