@lookiero/checkout 9.9.0-beta.1 → 9.9.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 (144) hide show
  1. package/dist/index.js +2 -2
  2. package/dist/src/ExpoRoot.js +5 -7
  3. package/dist/src/infrastructure/ui/Root.d.ts +2 -0
  4. package/dist/src/infrastructure/ui/Root.js +4 -2
  5. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +1 -1
  6. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +0 -1
  7. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +0 -1
  8. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -1
  9. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +0 -1
  10. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +0 -1
  11. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +2 -3
  12. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +26 -17
  13. package/dist/src/infrastructure/ui/hooks/useQueryBus.d.ts +9 -0
  14. package/dist/src/infrastructure/ui/hooks/useQueryBus.js +10 -0
  15. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
  16. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +55 -22
  17. package/dist/src/infrastructure/ui/i18n/i18n.d.ts +0 -1
  18. package/dist/src/infrastructure/ui/i18n/i18n.js +0 -1
  19. package/dist/src/infrastructure/ui/views/checkout/Checkout.js +2 -5
  20. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +0 -3
  21. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +0 -3
  22. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +2 -2
  23. package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +7 -7
  24. package/dist/src/projection/customer/customer.d.ts +0 -2
  25. package/dist/src/version.d.ts +1 -1
  26. package/dist/src/version.js +1 -1
  27. package/index.ts +2 -2
  28. package/package.json +7 -7
  29. package/src/ExpoRoot.tsx +5 -7
  30. package/src/infrastructure/ui/Root.tsx +30 -17
  31. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +0 -1
  32. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +1 -0
  33. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +0 -1
  34. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +1 -0
  35. package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +60 -18
  36. package/src/infrastructure/ui/hooks/useQueryBus.test.tsx +23 -0
  37. package/src/infrastructure/ui/hooks/useQueryBus.tsx +27 -0
  38. package/src/infrastructure/ui/hooks/useSubmitCheckout.test.ts +58 -0
  39. package/src/infrastructure/ui/hooks/useSubmitCheckout.ts +77 -33
  40. package/src/infrastructure/ui/i18n/i18n.ts +0 -1
  41. package/src/infrastructure/ui/views/checkout/Checkout.style.ts +0 -3
  42. package/src/infrastructure/ui/views/checkout/Checkout.tsx +3 -12
  43. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +2 -2
  44. package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +8 -8
  45. package/src/projection/customer/customer.ts +0 -2
  46. package/dist/pact.config.d.ts +0 -21
  47. package/dist/pact.config.js +0 -16
  48. package/dist/public/public/assets/adaptive-icon.png +0 -0
  49. package/dist/public/public/assets/favicon.png +0 -0
  50. package/dist/public/public/assets/icon.png +0 -0
  51. package/dist/public/public/assets/splash.png +0 -0
  52. package/dist/public/public/images/not-found.png +0 -0
  53. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
  54. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -55
  55. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
  56. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -116
  57. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
  58. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -56
  59. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
  60. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -51
  61. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
  62. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -51
  63. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
  64. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -51
  65. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -13
  66. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -19
  67. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
  68. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -56
  69. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
  70. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -57
  71. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
  72. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -55
  73. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
  74. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -120
  75. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
  76. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -55
  77. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
  78. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -55
  79. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -22
  80. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
  81. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -7
  82. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -5
  83. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -7
  84. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -6
  85. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
  86. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -20
  87. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -4
  88. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -43
  89. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
  90. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -14
  91. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -7
  92. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -21
  93. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
  94. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -12
  95. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -12
  96. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -64
  97. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -10
  98. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -17
  99. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -20
  100. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -27
  101. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -10
  102. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -27
  103. package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
  104. package/dist/src/infrastructure/ui/views/App.style.js +0 -8
  105. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
  106. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -11
  107. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -12
  108. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -64
  109. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
  110. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -16
  111. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
  112. package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -44
  113. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -14
  114. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -28
  115. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
  116. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -11
  117. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -26
  118. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -21
  119. package/dist/src/projection/shared/country.d.ts +0 -14
  120. package/dist/src/projection/shared/country.js +0 -15
  121. package/dist/src/projection/shared/customer.d.ts +0 -9
  122. package/dist/src/projection/shared/customer.js +0 -1
  123. package/dist/src/projection/shared/locale.d.ts +0 -12
  124. package/dist/src/projection/shared/locale.js +0 -13
  125. package/dist/src/projection/shared/order.d.ts +0 -6
  126. package/dist/src/projection/shared/order.js +0 -1
  127. package/dist/src/projection/shared/price.d.ts +0 -11
  128. package/dist/src/projection/shared/price.js +0 -1
  129. package/dist/src/projection/shared/size.d.ts +0 -21
  130. package/dist/src/projection/shared/size.js +0 -4
  131. package/dist/src/projection/shared/subscription.d.ts +0 -2
  132. package/dist/src/projection/shared/subscription.js +0 -1
  133. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +0 -15
  134. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +0 -16
  135. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -11
  136. package/dist/src/shared/ui/components/atoms/error/Error.js +0 -6
  137. package/dist/src/shared/ui/components/atoms/field/Field.d.ts +0 -14
  138. package/dist/src/shared/ui/components/atoms/field/Field.js +0 -29
  139. package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +0 -16
  140. package/dist/src/shared/ui/components/atoms/field/Field.style.js +0 -19
  141. package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +0 -24
  142. package/dist/src/shared/ui/components/molecules/inputField/InputField.js +0 -28
  143. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +0 -29
  144. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +0 -37
@@ -1,29 +0,0 @@
1
- import React, { useCallback, useState } from "react";
2
- import { View } from "react-native";
3
- import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
4
- import { Text } from "@lookiero/aurora";
5
- import { theme } from "@lookiero/sty-psp-ui";
6
- import { style } from "./Field.style";
7
- const SCALE = 0.75;
8
- const { space1, space4 } = theme();
9
- const Field = ({ label, isFocused = false, style: customStyle }) => {
10
- const [width, setWidth] = useState(0);
11
- const handleOnLayout = useCallback(({ nativeEvent: { layout } }) => setWidth(layout.width), []);
12
- const scale = useSharedValue(isFocused ? SCALE : 1);
13
- scale.value = isFocused ? SCALE : 1;
14
- const translateY = useSharedValue(isFocused ? -14 : space4);
15
- translateY.value = isFocused ? -14 : space4;
16
- const translateX = useSharedValue(isFocused ? -(((1 - SCALE) * width) / 2 + space1) : 0);
17
- translateX.value = isFocused ? -(((1 - SCALE) * width) / 2 + space1) : 0;
18
- const animatedStyle = useAnimatedStyle(() => ({
19
- transform: [
20
- { scale: withTiming(scale.value) },
21
- { translateY: withTiming(translateY.value) },
22
- { translateX: withTiming(translateX.value) },
23
- ],
24
- }), [scale.value, translateX.value, translateY.value]);
25
- return (React.createElement(Animated.View, { pointerEvents: "none", style: [customStyle?.field, animatedStyle], onLayout: handleOnLayout },
26
- React.createElement(Text, { level: 1, numberOfLines: 1, style: [style.fieldText, customStyle?.fieldText], detail: true }, label),
27
- React.createElement(View, { style: [style.fieldBackground, { opacity: isFocused ? 1 : 0 }] })));
28
- };
29
- export { Field };
@@ -1,16 +0,0 @@
1
- declare const style: {
2
- fieldBackground: {
3
- backgroundColor: string;
4
- height: "100%";
5
- position: "absolute";
6
- width: "100%";
7
- zIndex: number;
8
- };
9
- fieldText: {
10
- flexWrap: "nowrap";
11
- overflow: "hidden";
12
- paddingHorizontal: number;
13
- zIndex: number;
14
- };
15
- };
16
- export { style };
@@ -1,19 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "@lookiero/sty-psp-ui";
3
- const { colorBgBase, space1 } = theme();
4
- const style = StyleSheet.create({
5
- fieldBackground: {
6
- backgroundColor: colorBgBase,
7
- height: "100%",
8
- position: "absolute",
9
- width: "100%",
10
- zIndex: 0,
11
- },
12
- fieldText: {
13
- flexWrap: "nowrap",
14
- overflow: "hidden",
15
- paddingHorizontal: space1,
16
- zIndex: 1,
17
- },
18
- });
19
- export { style };
@@ -1,24 +0,0 @@
1
- import { FC } from "react";
2
- import { StyleProp, TextStyle, ViewStyle } from "react-native";
3
- import { IconName, InputProperties } from "@lookiero/aurora";
4
- import { ErrorStyle } from "@lookiero/sty-psp-ui";
5
- import { FieldStyle } from "../../atoms/field/Field";
6
- type IconStyle = StyleProp<TextStyle>;
7
- type InputFieldStyle = FieldStyle & {
8
- readonly inputField: StyleProp<ViewStyle>;
9
- readonly error: ErrorStyle;
10
- readonly icon: IconStyle;
11
- };
12
- interface InputFieldBaseProps {
13
- readonly label: string;
14
- readonly multiline?: boolean;
15
- readonly error?: string | null;
16
- readonly style?: Partial<InputFieldStyle>;
17
- readonly onChange?: (value: string) => void;
18
- readonly icon?: IconName;
19
- }
20
- interface InputFieldProps extends Omit<InputProperties, keyof InputFieldBaseProps>, InputFieldBaseProps {
21
- }
22
- declare const InputField: FC<InputFieldProps>;
23
- export type { InputFieldStyle };
24
- export { InputField };
@@ -1,28 +0,0 @@
1
- import React, { useCallback, useState } from "react";
2
- import { View } from "react-native";
3
- import { COLOR, Icon, Input } from "@lookiero/aurora";
4
- import { Error, theme } from "@lookiero/sty-psp-ui";
5
- import { Field } from "../../atoms/field/Field";
6
- import { style } from "./InputField.style";
7
- const { colorBgBase, colorBorderInput, colorBorderInputError, colorBorderInputFocus, colorText, colorTextError, colorTextMedium, iconSize, space6, } = theme();
8
- const inputPaddingRightWithIcon = iconSize + space6;
9
- const InputField = ({ label, placeholder, value, multiline = false, error, style: customStyle, onChange = () => void 0, icon, testID = "input", ...inputRestProps }) => {
10
- const [isFocused, setIsFocused] = useState(false);
11
- const handleOnChange = useCallback((text) => onChange(text), [onChange]);
12
- const handleOnBlur = useCallback(() => setIsFocused(false), []);
13
- const handleOnFocus = useCallback(() => setIsFocused(true), []);
14
- const borderColor = error ? colorBorderInputError : isFocused ? colorBorderInputFocus : colorBorderInput;
15
- const color = error ? colorTextError : isFocused ? colorText : colorTextMedium;
16
- return (React.createElement(View, { style: [style.inputField, { borderColor }, customStyle?.inputField], testID: "input-field" },
17
- React.createElement(Field, { isFocused: isFocused || !!value, label: label, style: {
18
- field: [style.field, customStyle?.field],
19
- fieldText: [{ color }, customStyle?.fieldText],
20
- } }),
21
- React.createElement(Input, { autoCapitalize: "sentences", multiline: multiline, multilineMaxHeight: 242, placeholder: placeholder, placeholderTextColor: isFocused ? colorTextMedium : colorBgBase, style: [!!icon && { paddingRight: inputPaddingRightWithIcon }, style.input, { color }], testID: testID, value: value, onBlur: handleOnBlur,
22
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23
- // @ts-ignore
24
- onChange: handleOnChange, onFocus: handleOnFocus, ...inputRestProps }),
25
- !!icon && React.createElement(Icon, { color: COLOR.GRAYSCALE_L, name: icon, style: [style.icon, customStyle?.icon], testID: "icon" }),
26
- !!error && React.createElement(Error, { error: error, style: [style.error, customStyle?.error] })));
27
- };
28
- export { InputField };
@@ -1,29 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
3
- error: {
4
- marginLeft: number;
5
- marginTop: number;
6
- };
7
- field: {
8
- left: number;
9
- maxWidth: "100%";
10
- position: "absolute";
11
- zIndex: number;
12
- };
13
- icon: {
14
- height: number;
15
- position: "absolute";
16
- right: number;
17
- top: number;
18
- width: number;
19
- zIndex: number;
20
- };
21
- input: {
22
- textOverflow?: string | undefined;
23
- };
24
- inputField: {
25
- borderRadius: number;
26
- borderWidth: number;
27
- };
28
- }>;
29
- export { style };
@@ -1,37 +0,0 @@
1
- import { StyleSheet, Platform } from "react-native";
2
- import { theme } from "@lookiero/sty-psp-ui";
3
- const { space1, space4, space6, borderRadius2, borderWidth1 } = theme();
4
- const style = StyleSheet.create({
5
- error: {
6
- marginLeft: space6,
7
- marginTop: space1,
8
- },
9
- field: {
10
- left: space4,
11
- maxWidth: "100%",
12
- position: "absolute",
13
- zIndex: 4,
14
- },
15
- icon: {
16
- height: 16,
17
- position: "absolute",
18
- right: space4,
19
- top: space4,
20
- width: 16,
21
- zIndex: 4,
22
- },
23
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
24
- // @ts-ignore
25
- input: {
26
- ...Platform.select({
27
- web: {
28
- textOverflow: "ellipsis",
29
- },
30
- }),
31
- },
32
- inputField: {
33
- borderRadius: borderRadius2,
34
- borderWidth: borderWidth1,
35
- },
36
- });
37
- export { style };