@lookiero/checkout 9.2.0 → 9.4.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 (123) hide show
  1. package/dist/pact.config.d.ts +21 -0
  2. package/dist/pact.config.js +16 -0
  3. package/dist/public/public/assets/adaptive-icon.png +0 -0
  4. package/dist/public/public/assets/favicon.png +0 -0
  5. package/dist/public/public/assets/icon.png +0 -0
  6. package/dist/public/public/assets/splash.png +0 -0
  7. package/dist/public/public/images/not-found.png +0 -0
  8. package/dist/src/ExpoRoot.js +2 -2
  9. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +1 -0
  10. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +55 -0
  11. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +1 -0
  12. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +116 -0
  13. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +1 -0
  14. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +56 -0
  15. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +1 -0
  16. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +51 -0
  17. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +1 -0
  18. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +51 -0
  19. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +1 -0
  20. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +51 -0
  21. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +13 -0
  22. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +19 -0
  23. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +1 -0
  24. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +56 -0
  25. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +1 -0
  26. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +57 -0
  27. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +1 -0
  28. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +55 -0
  29. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +1 -0
  30. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +120 -0
  31. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +1 -0
  32. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +55 -0
  33. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +1 -0
  34. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +55 -0
  35. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +22 -0
  36. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +1 -0
  37. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +7 -0
  38. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +5 -0
  39. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +7 -0
  40. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +6 -0
  41. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +4 -0
  42. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +20 -0
  43. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +4 -0
  44. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +43 -0
  45. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +12 -0
  46. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +14 -0
  47. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +8 -6
  48. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +7 -0
  49. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +21 -0
  50. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +8 -0
  51. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +12 -0
  52. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +12 -0
  53. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +64 -0
  54. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +10 -0
  55. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +17 -0
  56. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +20 -0
  57. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +27 -0
  58. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +10 -0
  59. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +27 -0
  60. package/dist/src/infrastructure/ui/views/App.js +2 -2
  61. package/dist/src/infrastructure/ui/views/App.style.d.ts +6 -0
  62. package/dist/src/infrastructure/ui/views/App.style.js +8 -0
  63. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +7 -0
  64. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +11 -0
  65. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +1 -1
  66. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +1 -1
  67. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +12 -0
  68. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +64 -0
  69. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +12 -0
  70. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +16 -0
  71. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +3 -2
  72. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +2 -2
  73. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +1 -1
  74. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +40 -0
  75. package/dist/src/infrastructure/ui/views/return/Return.style.js +44 -0
  76. package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +9 -5
  77. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +14 -0
  78. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +28 -0
  79. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +7 -0
  80. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +11 -0
  81. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +26 -0
  82. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +21 -0
  83. package/dist/src/projection/shared/country.d.ts +14 -0
  84. package/dist/src/projection/shared/country.js +15 -0
  85. package/dist/src/projection/shared/customer.d.ts +9 -0
  86. package/dist/src/projection/shared/customer.js +1 -0
  87. package/dist/src/projection/shared/locale.d.ts +12 -0
  88. package/dist/src/projection/shared/locale.js +13 -0
  89. package/dist/src/projection/shared/order.d.ts +6 -0
  90. package/dist/src/projection/shared/order.js +1 -0
  91. package/dist/src/projection/shared/price.d.ts +11 -0
  92. package/dist/src/projection/shared/price.js +1 -0
  93. package/dist/src/projection/shared/size.d.ts +21 -0
  94. package/dist/src/projection/shared/size.js +4 -0
  95. package/dist/src/projection/shared/subscription.d.ts +2 -0
  96. package/dist/src/projection/shared/subscription.js +1 -0
  97. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +11 -0
  98. package/dist/src/shared/ui/components/atoms/error/Error.js +6 -0
  99. package/dist/src/shared/ui/components/atoms/field/Field.js +15 -12
  100. package/dist/src/version.d.ts +1 -1
  101. package/dist/src/version.js +1 -1
  102. package/package.json +1 -2
  103. package/src/ExpoRoot.tsx +2 -2
  104. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.test.tsx +1 -1
  105. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +10 -8
  106. package/src/infrastructure/ui/views/App.tsx +2 -2
  107. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +1 -1
  108. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +26 -2
  109. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +1 -0
  110. package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +375 -0
  111. package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +20 -0
  112. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +14 -5
  113. package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +26 -2
  114. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.test.tsx +2 -2
  115. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +1 -1
  116. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +26 -2
  117. package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +60 -0
  118. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +17 -7
  119. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +16 -0
  120. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +15 -8
  121. package/src/shared/ui/components/atoms/field/Field.tsx +18 -18
  122. package/src/shared/ui/components/atoms/field/__snapshots__/Field.test.tsx.snap +36 -0
  123. package/src/shared/ui/components/molecules/inputField/__snapshots__/InputField.test.tsx.snap +18 -0
@@ -1,6 +1,6 @@
1
- import { animated, useSpring } from "@react-spring/native";
2
1
  import React, { FC } from "react";
3
2
  import { Pressable, View } from "react-native";
3
+ import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
4
4
  import { Button, Icon, Text } from "@lookiero/aurora";
5
5
  import { useI18nMessage } from "@lookiero/i18n-react";
6
6
  import { PricingProjection } from "../../../../../../projection/pricing/pricing";
@@ -35,8 +35,18 @@ const CollapsiblePricing: FC<CollapsiblePricingProps> = ({
35
35
  values: { items: totalCheckoutItemsKept.toString() },
36
36
  });
37
37
 
38
- const collapsedStyle = useSpring({ opacitiy: collapsed ? 1 : 0 });
39
- const notCollapsedStyle = useSpring({ opacitiy: collapsed ? 0 : 1 });
38
+ const collapsedOpacity = useSharedValue(collapsed ? 1 : 0);
39
+ collapsedOpacity.value = collapsed ? 1 : 0;
40
+ const collapsedAnimatedStyle = useAnimatedStyle(
41
+ () => ({ opacity: withTiming(collapsedOpacity.value) }),
42
+ [collapsedOpacity.value],
43
+ );
44
+ const notCollapsedOpacity = useSharedValue(collapsed ? 0 : 1);
45
+ notCollapsedOpacity.value = collapsed ? 0 : 1;
46
+ const notCollapsedAnimatedStyle = useAnimatedStyle(
47
+ () => ({ opacity: withTiming(notCollapsedOpacity.value) }),
48
+ [notCollapsedOpacity.value],
49
+ );
40
50
 
41
51
  return (
42
52
  <>
@@ -51,7 +61,7 @@ const CollapsiblePricing: FC<CollapsiblePricingProps> = ({
51
61
  )}
52
62
 
53
63
  {collapsed && collapsible ? (
54
- <animated.View style={[style.collapsed, { opacity: collapsedStyle.opacitiy }]}>
64
+ <Animated.View key="collapsed" style={[style.collapsed, collapsedAnimatedStyle]}>
55
65
  <View style={style.collapsedContent}>
56
66
  <Text level={1} style={style.totalCollapsed} detail>
57
67
  {totalText} {totalCheckoutItemsKeptText}
@@ -64,15 +74,15 @@ const CollapsiblePricing: FC<CollapsiblePricingProps> = ({
64
74
  {submitButtonText}
65
75
  </Button>
66
76
  </View>
67
- </animated.View>
77
+ </Animated.View>
68
78
  ) : (
69
- <animated.View style={{ opacity: notCollapsedStyle.opacitiy }}>
79
+ <Animated.View key="not-collapsed" style={notCollapsedAnimatedStyle}>
70
80
  <Pricing pricing={pricing} totalCheckoutItemsKept={totalCheckoutItemsKept} />
71
81
 
72
82
  <Button testID="submit-checkout-button" onPress={onSubmit}>
73
83
  {submitButtonText}
74
84
  </Button>
75
- </animated.View>
85
+ </Animated.View>
76
86
  )}
77
87
  </>
78
88
  );
@@ -91,6 +91,14 @@ exports[`Pricing component matches the snapshot for collaped pricing: collapsed
91
91
  </Text>
92
92
  </View>
93
93
  <View
94
+ collapsable={false}
95
+ jestAnimatedStyle={
96
+ {
97
+ "value": {
98
+ "opacity": 1,
99
+ },
100
+ }
101
+ }
94
102
  style={
95
103
  {
96
104
  "flexDirection": "row",
@@ -391,6 +399,14 @@ exports[`Pricing component matches the snapshot for non-collaped pricing: non-co
391
399
  </Text>
392
400
  </View>
393
401
  <View
402
+ collapsable={false}
403
+ jestAnimatedStyle={
404
+ {
405
+ "value": {
406
+ "opacity": 1,
407
+ },
408
+ }
409
+ }
394
410
  style={
395
411
  {
396
412
  "flexDirection": "row",
@@ -193,6 +193,12 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
193
193
  </Text>
194
194
  </View>
195
195
  <View
196
+ collapsable={false}
197
+ jestAnimatedStyle={
198
+ {
199
+ "value": {},
200
+ }
201
+ }
196
202
  style={
197
203
  {
198
204
  "backgroundColor": "#0C0A0A",
@@ -200,22 +206,23 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
200
206
  "display": "flex",
201
207
  "height": 2,
202
208
  "left": 0,
203
- "opacity": 0,
204
209
  "position": "absolute",
205
- "transform": [
206
- {
207
- "translateX": 0,
208
- },
209
- ],
210
- "width": 0,
211
210
  }
212
211
  }
213
212
  />
214
213
  </View>
215
214
  <View
215
+ collapsable={false}
216
+ jestAnimatedStyle={
217
+ {
218
+ "value": {
219
+ "opacity": 1,
220
+ },
221
+ }
222
+ }
216
223
  style={
217
224
  {
218
- "opacity": 0,
225
+ "opacity": 1,
219
226
  "paddingBottom": 24,
220
227
  "paddingHorizontal": 24,
221
228
  "paddingTop": 8,
@@ -1,6 +1,6 @@
1
- import { animated, useSpring } from "@react-spring/native";
2
1
  import React, { FC, useCallback, useState } from "react";
3
2
  import { LayoutChangeEvent, StyleProp, TextStyle, View, ViewStyle } from "react-native";
3
+ import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
4
4
  import { Text } from "@lookiero/aurora";
5
5
  import { theme } from "@lookiero/sty-psp-ui";
6
6
  import { style } from "./Field.style";
@@ -23,30 +23,30 @@ const Field: FC<FieldProps> = ({ label, isFocused = false, style: customStyle })
23
23
  const [width, setWidth] = useState<number>(0);
24
24
  const handleOnLayout = useCallback(({ nativeEvent: { layout } }: LayoutChangeEvent) => setWidth(layout.width), []);
25
25
 
26
- const springs = useSpring(
27
- isFocused
28
- ? { scale: SCALE, translateY: -14, translateX: -(((1 - SCALE) * width) / 2 + space1) }
29
- : { scale: 1, translateY: space4, translateX: 0 },
26
+ const scale = useSharedValue(isFocused ? SCALE : 1);
27
+ scale.value = isFocused ? SCALE : 1;
28
+ const translateY = useSharedValue(isFocused ? -14 : space4);
29
+ translateY.value = isFocused ? -14 : space4;
30
+ const translateX = useSharedValue(isFocused ? -(((1 - SCALE) * width) / 2 + space1) : 0);
31
+ translateX.value = isFocused ? -(((1 - SCALE) * width) / 2 + space1) : 0;
32
+ const animatedStyle = useAnimatedStyle(
33
+ () => ({
34
+ transform: [
35
+ { scale: withTiming(scale.value) },
36
+ { translateY: withTiming(translateY.value) },
37
+ { translateX: withTiming(translateX.value) },
38
+ ],
39
+ }),
40
+ [scale.value, translateX.value, translateY.value],
30
41
  );
31
42
 
32
43
  return (
33
- <animated.View
34
- pointerEvents="none"
35
- style={[
36
- {
37
- transform: [{ scale: springs.scale }, { translateY: springs.translateY }, { translateX: springs.translateX }],
38
- },
39
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
40
- // @ts-ignore
41
- customStyle?.field,
42
- ]}
43
- onLayout={handleOnLayout}
44
- >
44
+ <Animated.View pointerEvents="none" style={[customStyle?.field, animatedStyle]} onLayout={handleOnLayout}>
45
45
  <Text level={1} numberOfLines={1} style={[style.fieldText, customStyle?.fieldText]} detail>
46
46
  {label}
47
47
  </Text>
48
48
  <View style={[style.fieldBackground, { opacity: isFocused ? 1 : 0 }]} />
49
- </animated.View>
49
+ </Animated.View>
50
50
  );
51
51
  };
52
52
 
@@ -30,6 +30,24 @@ exports[`Field atom matches the snapshot for a non-focused: non-focused 1`] = `
30
30
  <RCTSafeAreaView />
31
31
  </View>
32
32
  <View
33
+ collapsable={false}
34
+ jestAnimatedStyle={
35
+ {
36
+ "value": {
37
+ "transform": [
38
+ {
39
+ "scale": 1,
40
+ },
41
+ {
42
+ "translateY": 16,
43
+ },
44
+ {
45
+ "translateX": 0,
46
+ },
47
+ ],
48
+ },
49
+ }
50
+ }
33
51
  onLayout={[Function]}
34
52
  pointerEvents="none"
35
53
  style={
@@ -124,6 +142,24 @@ exports[`Field atom matches the snapshot for focused: focused 1`] = `
124
142
  <RCTSafeAreaView />
125
143
  </View>
126
144
  <View
145
+ collapsable={false}
146
+ jestAnimatedStyle={
147
+ {
148
+ "value": {
149
+ "transform": [
150
+ {
151
+ "scale": 0.75,
152
+ },
153
+ {
154
+ "translateY": -14,
155
+ },
156
+ {
157
+ "translateX": -4,
158
+ },
159
+ ],
160
+ },
161
+ }
162
+ }
127
163
  onLayout={[Function]}
128
164
  pointerEvents="none"
129
165
  style={
@@ -45,6 +45,24 @@ exports[`InputField molecule matches the snapshot 1`] = `
45
45
  testID="input-field"
46
46
  >
47
47
  <View
48
+ collapsable={false}
49
+ jestAnimatedStyle={
50
+ {
51
+ "value": {
52
+ "transform": [
53
+ {
54
+ "scale": 0.75,
55
+ },
56
+ {
57
+ "translateY": -14,
58
+ },
59
+ {
60
+ "translateX": -4,
61
+ },
62
+ ],
63
+ },
64
+ }
65
+ }
48
66
  onLayout={[Function]}
49
67
  pointerEvents="none"
50
68
  style={