@lookiero/checkout 5.0.0-update-aurora-version-2024.2.29.112652 → 5.0.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 (54) hide show
  1. package/dist/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.js +2 -2
  2. package/dist/infrastructure/ui/components/layouts/layout/Layout.d.ts +1 -0
  3. package/dist/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +1 -2
  4. package/dist/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +2 -4
  5. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.js +1 -2
  6. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.d.ts +1 -0
  7. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.js +1 -0
  8. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +3 -1
  9. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.style.d.ts +3 -0
  10. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.style.js +3 -0
  11. package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +4 -2
  12. package/dist/infrastructure/ui/components/templates/header/Header.js +1 -2
  13. package/dist/infrastructure/ui/components/templates/header/Header.style.d.ts +1 -0
  14. package/dist/infrastructure/ui/components/templates/header/Header.style.js +2 -1
  15. package/dist/infrastructure/ui/components/templates/header/buttonIconPlaceholder/ButtonIconPlaceholder.style.d.ts +1 -2
  16. package/dist/infrastructure/ui/components/templates/header/buttonIconPlaceholder/ButtonIconPlaceholder.style.js +2 -3
  17. package/dist/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.js +7 -5
  18. package/dist/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.style.d.ts +7 -0
  19. package/dist/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.style.js +10 -0
  20. package/dist/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.js +3 -2
  21. package/dist/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.style.d.ts +7 -0
  22. package/dist/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.style.js +10 -0
  23. package/dist/infrastructure/ui/i18n/i18n.d.ts +1 -0
  24. package/dist/infrastructure/ui/i18n/i18n.js +1 -0
  25. package/dist/infrastructure/ui/views/checkout/Checkout.d.ts +2 -2
  26. package/dist/infrastructure/ui/views/checkout/Checkout.js +20 -15
  27. package/dist/infrastructure/ui/views/checkout/Checkout.style.d.ts +32 -4
  28. package/dist/infrastructure/ui/views/checkout/Checkout.style.js +46 -6
  29. package/dist/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.js +3 -3
  30. package/dist/infrastructure/ui/views/feedback/Feedback.js +1 -1
  31. package/dist/infrastructure/ui/views/feedback/Feedback.style.d.ts +5 -1
  32. package/dist/infrastructure/ui/views/feedback/Feedback.style.js +6 -1
  33. package/dist/infrastructure/ui/views/item/Item.js +4 -5
  34. package/dist/infrastructure/ui/views/item/Item.style.d.ts +6 -0
  35. package/dist/infrastructure/ui/views/item/Item.style.js +7 -0
  36. package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +1 -1
  37. package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +16 -7
  38. package/dist/infrastructure/ui/views/item/components/selectModal/SelectModal.js +1 -1
  39. package/dist/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +4 -1
  40. package/dist/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.style.d.ts +3 -0
  41. package/dist/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.style.js +3 -0
  42. package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.js +3 -1
  43. package/dist/infrastructure/ui/views/summary/Summary.d.ts +2 -2
  44. package/dist/infrastructure/ui/views/summary/Summary.js +32 -27
  45. package/dist/infrastructure/ui/views/summary/Summary.style.d.ts +34 -3
  46. package/dist/infrastructure/ui/views/summary/Summary.style.js +59 -5
  47. package/dist/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +3 -0
  48. package/dist/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +4 -4
  49. package/dist/shared/ui/components/atoms/error/Error.js +1 -1
  50. package/dist/shared/ui/components/layouts/carousel/Carousel.d.ts +1 -0
  51. package/dist/shared/ui/components/layouts/carousel/Carousel.js +1 -1
  52. package/dist/shared/ui/components/layouts/sticky/Sticky.style.js +5 -5
  53. package/dist/shared/ui/components/molecules/inputField/InputField.js +4 -3
  54. package/package.json +7 -7
@@ -1,4 +1,4 @@
1
- import { InfoBox, INFOBOX_TYPE, Text, DISPLAY } from "@lookiero/aurora";
1
+ import { ALIGN, DISPLAY, InfoBox, INFOBOX_TYPE, Text } from "@lookiero/aurora";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import React from "react";
4
4
  import { I18nMessages } from "../../../i18n/i18n";
@@ -11,6 +11,6 @@ const FiveItemsDiscountBanner = ({ fiveItemsDiscount }) => {
11
11
  b: (chunks) => (React.createElement(Text, { as: "span", display: DISPLAY.INLINE, level: 2, style: style.textBold }, chunks)),
12
12
  },
13
13
  });
14
- return React.createElement(InfoBox, { icon: "info", testID: "five-items-discount-banner", text: bannerText, type: INFOBOX_TYPE.SQUARED });
14
+ return (React.createElement(InfoBox, { contentAlign: ALIGN.CENTER, icon: "info", testID: "five-items-discount-banner", text: bannerText, type: INFOBOX_TYPE.SQUARED }));
15
15
  };
16
16
  export { FiveItemsDiscountBanner };
@@ -3,6 +3,7 @@ import { LayoutChangeEvent, ScrollView, StyleProp, ViewStyle } from "react-nativ
3
3
  interface LayoutStyle {
4
4
  readonly safeAreaView: StyleProp<ViewStyle>;
5
5
  readonly scrollView: StyleProp<ViewStyle>;
6
+ readonly header: StyleProp<ViewStyle>;
6
7
  }
7
8
  interface LayoutProps {
8
9
  readonly children: ReactNode;
@@ -1,5 +1,4 @@
1
- declare const HEADER_HEIGHT: number;
2
1
  declare const style: {
3
2
  header: {};
4
3
  };
5
- export { style, HEADER_HEIGHT };
4
+ export { style };
@@ -1,7 +1,5 @@
1
- import { Theme } from "@lookiero/aurora";
2
1
  import { Platform, StyleSheet } from "react-native";
3
- const { space12 } = Theme.get();
4
- const HEADER_HEIGHT = space12;
2
+ import { HEADER_HEIGHT } from "../../../../templates/header/Header.style";
5
3
  const style = StyleSheet.create({
6
4
  header: {
7
5
  ...Platform.select({
@@ -18,4 +16,4 @@ const style = StyleSheet.create({
18
16
  }),
19
17
  },
20
18
  });
21
- export { style, HEADER_HEIGHT };
19
+ export { style };
@@ -2,7 +2,6 @@ import React, { memo } from "react";
2
2
  import { useCheckoutQuestionItem } from "./behaviors/useCheckoutQuestionItem";
3
3
  const CheckoutQuestion = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
4
4
  const Item = useCheckoutQuestionItem({ type: checkoutQuestion.type });
5
- return (React.createElement(Item, { checkoutQuestion: checkoutQuestion, checkoutQuestionParentId: checkoutQuestionParentId, testID: checkoutQuestion.id },
6
- React.createElement(React.Fragment, null, checkoutQuestion.children?.map((childCheckoutQuestion) => (React.createElement(CheckoutQuestion, { key: childCheckoutQuestion.id, checkoutQuestion: childCheckoutQuestion, checkoutQuestionParentId: checkoutQuestion.id }))))));
5
+ return (React.createElement(Item, { checkoutQuestion: checkoutQuestion, checkoutQuestionParentId: checkoutQuestionParentId, testID: checkoutQuestion.id }, checkoutQuestion.children?.map((childCheckoutQuestion) => (React.createElement(CheckoutQuestion, { key: childCheckoutQuestion.id, checkoutQuestion: childCheckoutQuestion, checkoutQuestionParentId: checkoutQuestion.id })))));
7
6
  };
8
7
  export default memo(CheckoutQuestion);
@@ -1,5 +1,6 @@
1
1
  declare const style: {
2
2
  button: {
3
+ flex: number;
3
4
  marginHorizontal: number;
4
5
  };
5
6
  };
@@ -1,6 +1,7 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  const style = StyleSheet.create({
3
3
  button: {
4
+ flex: 1,
4
5
  marginHorizontal: 12,
5
6
  },
6
7
  });
@@ -1,11 +1,13 @@
1
1
  import { Text } from "@lookiero/aurora";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import React from "react";
4
+ import { I18nMessages } from "../../../../../i18n/i18n";
4
5
  import { style } from "./HostDefaultReturnQuestionItem.style";
5
6
  const HostDefaultReturnQuestionItem = ({ returnQuestion, children }) => {
6
7
  const titleText = useI18nMessage({ id: returnQuestion.name });
8
+ const isAllOptions = returnQuestion.name === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
7
9
  return (React.createElement(React.Fragment, null,
8
- React.createElement(Text, { level: 3, style: style.title }, titleText),
10
+ titleText && titleText !== " " ? (React.createElement(Text, { level: 3, style: [style.title, isAllOptions ? style.allOptionsTitle : undefined] }, titleText)) : null,
9
11
  children));
10
12
  };
11
13
  export { HostDefaultReturnQuestionItem };
@@ -1,4 +1,7 @@
1
1
  declare const style: {
2
+ allOptionsTitle: {
3
+ display: "none";
4
+ };
2
5
  title: {
3
6
  marginBottom: number;
4
7
  };
@@ -2,6 +2,9 @@ import { Theme } from "@lookiero/aurora";
2
2
  import { StyleSheet } from "react-native";
3
3
  const { space4 } = Theme.get();
4
4
  const style = StyleSheet.create({
5
+ allOptionsTitle: {
6
+ display: "none",
7
+ },
5
8
  title: {
6
9
  marginBottom: space4,
7
10
  },
@@ -1,5 +1,7 @@
1
- import { validate } from "uuid";
2
- const isUuid = (value) => validate(value);
1
+ const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
2
+ const isUuid = (value) => {
3
+ return typeof value === "string" && REGEX.test(value);
4
+ };
3
5
  const feedbackForReturnQuestion = ({ feedback, returnQuestion, translate, acc = [], }) => {
4
6
  const returnQuestionId = Object.keys(feedback).find((id) => id === returnQuestion.id);
5
7
  if (returnQuestionId) {
@@ -1,6 +1,5 @@
1
1
  import React, { useMemo } from "react";
2
- import { Platform, View } from "react-native";
3
- import { SafeAreaView } from "react-native-safe-area-context";
2
+ import { Platform, SafeAreaView, View } from "react-native";
4
3
  import { style } from "./Header.style";
5
4
  const Header = ({ children, style: customStyle, ...props }) => {
6
5
  const Component = useMemo(() => (Platform.OS === "android" ? SafeAreaView : View), []);
@@ -1,3 +1,4 @@
1
+ export declare const HEADER_HEIGHT: number;
1
2
  declare const style: {
2
3
  header: {
3
4
  alignItems: "center";
@@ -1,6 +1,7 @@
1
1
  import { Theme } from "@lookiero/aurora";
2
2
  import { StyleSheet } from "react-native";
3
- const { colorBgBase, space2 } = Theme.get();
3
+ const { colorBgBase, space2, space12 } = Theme.get();
4
+ export const HEADER_HEIGHT = space12;
4
5
  const style = StyleSheet.create({
5
6
  header: {
6
7
  alignItems: "center",
@@ -1,4 +1,3 @@
1
- declare const HEADER_HEIGHT: number;
2
1
  declare const style: {
3
2
  buttonIconPlaceholder: {
4
3
  flexGrow: number;
@@ -6,4 +5,4 @@ declare const style: {
6
5
  width: number;
7
6
  };
8
7
  };
9
- export { style, HEADER_HEIGHT };
8
+ export { style };
@@ -1,7 +1,6 @@
1
1
  import { Theme } from "@lookiero/aurora";
2
2
  import { StyleSheet } from "react-native";
3
- const { space10, space12 } = Theme.get();
4
- const HEADER_HEIGHT = space12;
3
+ const { space10 } = Theme.get();
5
4
  const style = StyleSheet.create({
6
5
  buttonIconPlaceholder: {
7
6
  flexGrow: 0,
@@ -9,4 +8,4 @@ const style = StyleSheet.create({
9
8
  width: space10,
10
9
  },
11
10
  });
12
- export { style, HEADER_HEIGHT };
11
+ export { style };
@@ -1,14 +1,16 @@
1
- import { ButtonIcon, Text } from "@lookiero/aurora";
1
+ import { Box, ButtonIcon, Text } from "@lookiero/aurora";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import React from "react";
4
4
  import { I18nMessages } from "../../../../i18n/i18n";
5
5
  import { Header } from "../Header";
6
6
  import { ButtonIconPlaceholder } from "../buttonIconPlaceholder/ButtonIconPlaceholder";
7
+ import style from "./CheckoutHeader.style";
7
8
  const CheckoutHeader = ({ onBack }) => {
8
9
  const title = useI18nMessage({ id: I18nMessages.HEADER_COMPLETE_CHECKOUT_TITLE });
9
- return (React.createElement(Header, { testID: "checkout-header" },
10
- React.createElement(ButtonIcon, { name: "arrow_left", testID: "arrow-left-button-icon", onPress: onBack }),
11
- React.createElement(Text, { level: 3, action: true }, title),
12
- React.createElement(ButtonIconPlaceholder, null)));
10
+ return (React.createElement(Box, null,
11
+ React.createElement(Header, { testID: "checkout-header" },
12
+ React.createElement(ButtonIcon, { name: "arrow_left", style: style.button, testID: "arrow-left-button-icon", onPress: onBack }),
13
+ React.createElement(Text, { level: 3, action: true }, title),
14
+ React.createElement(ButtonIconPlaceholder, null))));
13
15
  };
14
16
  export { CheckoutHeader };
@@ -0,0 +1,7 @@
1
+ declare const style: {
2
+ button: {
3
+ height: number;
4
+ width: number;
5
+ };
6
+ };
7
+ export default style;
@@ -0,0 +1,10 @@
1
+ import { Theme } from "@lookiero/aurora";
2
+ import { StyleSheet } from "react-native";
3
+ const { space10 } = Theme.get();
4
+ const style = StyleSheet.create({
5
+ button: {
6
+ height: space10,
7
+ width: space10,
8
+ },
9
+ });
10
+ export default style;
@@ -7,6 +7,7 @@ import { Routes } from "../../../../routing/routes";
7
7
  import { useBasePath } from "../../../../routing/useBasePath";
8
8
  import { Header } from "../Header";
9
9
  import { ButtonIconPlaceholder } from "../buttonIconPlaceholder/ButtonIconPlaceholder";
10
+ import style from "./ItemHeader.style";
10
11
  const ItemHeader = ({ items, item, onNext, onPrevious }) => {
11
12
  const title = useI18nMessage({ id: I18nMessages.HEADER_CHECKOUT_TITLE });
12
13
  const itemIndex = items.indexOf(item);
@@ -27,8 +28,8 @@ const ItemHeader = ({ items, item, onNext, onPrevious }) => {
27
28
  navigate(generatePath(`${basePath}/${Routes.ITEM}`, { id: nextItem.id }));
28
29
  }, [basePath, item.id, itemIndex, items, navigate, onNext]);
29
30
  return (React.createElement(Header, { testID: "item-header" },
30
- !isFirstItem ? (React.createElement(ButtonIcon, { name: "arrow_left", testID: "arrow-left-button-icon", onPress: navigateToPreviousItem })) : (React.createElement(ButtonIconPlaceholder, null)),
31
+ !isFirstItem ? (React.createElement(ButtonIcon, { name: "arrow_left", style: style.button, testID: "arrow-left-button-icon", onPress: navigateToPreviousItem })) : (React.createElement(ButtonIconPlaceholder, null)),
31
32
  React.createElement(Text, { level: 3, action: true }, title),
32
- !isLastItem ? (React.createElement(ButtonIcon, { name: "arrow_right", testID: "arrow-right-button-icon", onPress: navigateToNextItem })) : (React.createElement(ButtonIconPlaceholder, null))));
33
+ !isLastItem ? (React.createElement(ButtonIcon, { name: "arrow_right", style: style.button, testID: "arrow-right-button-icon", onPress: navigateToNextItem })) : (React.createElement(ButtonIconPlaceholder, null))));
33
34
  };
34
35
  export { ItemHeader };
@@ -0,0 +1,7 @@
1
+ declare const style: {
2
+ button: {
3
+ height: number;
4
+ width: number;
5
+ };
6
+ };
7
+ export default style;
@@ -0,0 +1,10 @@
1
+ import { Theme } from "@lookiero/aurora";
2
+ import { StyleSheet } from "react-native";
3
+ const { space10 } = Theme.get();
4
+ const style = StyleSheet.create({
5
+ button: {
6
+ height: space10,
7
+ width: space10,
8
+ },
9
+ });
10
+ export default style;
@@ -24,6 +24,7 @@ declare enum I18nMessages {
24
24
  FEEDBACK_UNANSWERED = "return_questions_feedback.feedback.unanswered",
25
25
  RETURN_QUESTIONS_TITLE = "return_questions.title",
26
26
  RETURN_QUESTIONS_SUBMIT_BUTTON = "return_questions.submit_button",
27
+ RETURN_QUESTION_MAIN_ALL_OPINION = "return_question.main.all.opinion",
27
28
  SUMMARY_TITLE = "summary.title",
28
29
  SUMMARY_DESCRIPTION = "summary.description",
29
30
  BANNER_DISCOUNT_TEXT = "summary.banner.text",
@@ -26,6 +26,7 @@ var I18nMessages;
26
26
  I18nMessages["FEEDBACK_UNANSWERED"] = "return_questions_feedback.feedback.unanswered";
27
27
  I18nMessages["RETURN_QUESTIONS_TITLE"] = "return_questions.title";
28
28
  I18nMessages["RETURN_QUESTIONS_SUBMIT_BUTTON"] = "return_questions.submit_button";
29
+ I18nMessages["RETURN_QUESTION_MAIN_ALL_OPINION"] = "return_question.main.all.opinion";
29
30
  I18nMessages["SUMMARY_TITLE"] = "summary.title";
30
31
  I18nMessages["SUMMARY_DESCRIPTION"] = "summary.description";
31
32
  I18nMessages["BANNER_DISCOUNT_TEXT"] = "summary.banner.text";
@@ -1,11 +1,11 @@
1
1
  import { FC, ReactNode } from "react";
2
2
  import { Country } from "../../../../projection/shared/country";
3
- import { Layout } from "../../components/layouts/layout/Layout";
3
+ import { Layout as LocalLayout } from "../../components/layouts/layout/Layout";
4
4
  interface CheckoutProps {
5
5
  readonly children?: ReactNode;
6
6
  readonly customerId: string;
7
7
  readonly country: Country;
8
- readonly layout: Layout;
8
+ readonly layout: LocalLayout;
9
9
  readonly useRedirect: () => Record<string, string>;
10
10
  }
11
11
  declare const Checkout: FC<CheckoutProps>;
@@ -1,4 +1,4 @@
1
- import { Text } from "@lookiero/aurora";
1
+ import { Box, Layout, Text, useDevice } from "@lookiero/aurora";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import { QueryStatus } from "@lookiero/messaging-react";
4
4
  import React, { useCallback, useMemo } from "react";
@@ -12,7 +12,6 @@ import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner"
12
12
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
13
13
  import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
14
14
  import { TrackingPage } from "../../../tracking/tracking";
15
- import { Body } from "../../components/layouts/body/Body";
16
15
  import { CheckoutHeader } from "../../components/templates/header/checkoutHeader/CheckoutHeader";
17
16
  import { I18nMessages } from "../../i18n/i18n";
18
17
  import { Routes } from "../../routing/routes";
@@ -22,8 +21,9 @@ import { Pricing } from "../summary/components/pricing/Pricing";
22
21
  import { style } from "./Checkout.style";
23
22
  import { DeliveryBanner } from "./components/deliveryBanner/DeliveryBanner";
24
23
  import { PaymentInstrument } from "./components/paymentInstrument/PaymentInstrument";
25
- const Checkout = ({ children, customerId, country, layout: Layout, useRedirect }) => {
24
+ const Checkout = ({ children, customerId, country, layout: LocalLayout, useRedirect }) => {
26
25
  const titleText = useI18nMessage({ id: I18nMessages.CHECKOUT_TITLE });
26
+ const { screen } = useDevice();
27
27
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
28
28
  const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
29
29
  useTrackPageView({
@@ -58,18 +58,23 @@ const Checkout = ({ children, customerId, country, layout: Layout, useRedirect }
58
58
  dependenciesLoadedStatuses.includes(pricingStatus);
59
59
  if (!dependenciesLoaded)
60
60
  return React.createElement(Spinner, null);
61
- return (React.createElement(Layout, { header: React.createElement(CheckoutHeader, { onBack: handleOnBack }) },
62
- React.createElement(Body, null,
63
- hasReplacedCheckoutItem && React.createElement(DeliveryBanner, null),
64
- React.createElement(View, { style: style.paymentSelector },
65
- React.createElement(PaymentInstrument, { useRedirect: useRedirect })),
66
- React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
67
- checkoutItemsKept?.map((checkoutItem) => (React.createElement(View, { key: checkoutItem.id, style: style.itemsContainer, testID: "checkout-items-kept" },
68
- React.createElement(ProductVariant, { brand: checkoutItem.productVariant.brand, color: checkoutItem.productVariant.color, country: country, media: checkoutItem.productVariant.media, name: checkoutItem.productVariant.name, price: checkoutItem.price, status: checkoutItem.status, size: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
69
- ? checkoutItem.replacedFor.size
70
- : checkoutItem.productVariant.size })))),
71
- pricing && (React.createElement(View, { style: style.pricingContainer },
72
- React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsible: false, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onSubmit: handleOnSubmit })))),
61
+ return (React.createElement(LocalLayout, { header: React.createElement(CheckoutHeader, { onBack: handleOnBack }), style: {
62
+ header: style.header,
63
+ scrollView: style.scrollView,
64
+ } },
65
+ hasReplacedCheckoutItem && React.createElement(DeliveryBanner, null),
66
+ React.createElement(Layout, { fullWidth: !screen.L, style: screen.L && style.desktopLayoutSpacing },
67
+ React.createElement(Box, { size: { L: "2/3" }, style: screen.L ? style.desktopListSpacing : undefined },
68
+ React.createElement(View, { style: [style.contentWrapper, screen.L ? style.contentWrapper : undefined] },
69
+ React.createElement(View, { style: style.paymentSelector },
70
+ React.createElement(PaymentInstrument, { useRedirect: useRedirect })),
71
+ React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
72
+ checkoutItemsKept?.map((checkoutItem) => (React.createElement(View, { key: checkoutItem.id, testID: "checkout-items-kept" },
73
+ React.createElement(ProductVariant, { brand: checkoutItem.productVariant.brand, color: checkoutItem.productVariant.color, country: country, media: checkoutItem.productVariant.media, name: checkoutItem.productVariant.name, price: checkoutItem.price, status: checkoutItem.status, size: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
74
+ ? checkoutItem.replacedFor.size
75
+ : checkoutItem.productVariant.size })))))),
76
+ React.createElement(Box, { size: { L: "1/3" }, style: [style.resume, screen.L ? style.desktopResume : undefined] }, pricing ? (React.createElement(View, { style: style.princingWrapper },
77
+ React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsible: false, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onSubmit: handleOnSubmit }))) : null)),
73
78
  children));
74
79
  };
75
80
  export { Checkout };
@@ -1,20 +1,48 @@
1
1
  declare const style: {
2
+ contentWrapper: {
3
+ backgroundColor: string;
4
+ flexGrow: number;
5
+ padding: number;
6
+ };
2
7
  deliveryBannerContainer: {
3
8
  marginBottom: number;
4
9
  };
5
- itemsContainer: {
10
+ desktopContentWrapper: {
11
+ borderRadius: number;
12
+ };
13
+ desktopLayoutSpacing: {
14
+ paddingVertical: number;
15
+ };
16
+ desktopListSpacing: {
17
+ paddingRight: number;
18
+ };
19
+ desktopResume: {
20
+ borderRadius: number;
21
+ };
22
+ header: {
23
+ backgroundColor: string;
24
+ height: number;
25
+ };
26
+ mobileInfo: {
6
27
  paddingHorizontal: number;
28
+ paddingTop: number;
7
29
  };
8
30
  paymentSelector: {
9
- margin: number;
31
+ marginBottom: number;
10
32
  };
11
33
  pricingContainer: {
12
34
  paddingHorizontal: number;
13
35
  paddingVertical: number;
14
36
  };
37
+ princingWrapper: {
38
+ padding: number;
39
+ };
40
+ resume: any;
41
+ scrollView: {
42
+ backgroundColor: string;
43
+ };
15
44
  title: {
16
- marginBottom: number;
17
- marginHorizontal: number;
45
+ marginVertical: number;
18
46
  };
19
47
  };
20
48
  export { style };
@@ -1,23 +1,63 @@
1
1
  import { Theme } from "@lookiero/aurora";
2
- import { StyleSheet } from "react-native";
3
- const { space2, space6, space8 } = Theme.get();
2
+ import { StyleSheet, Platform } from "react-native";
3
+ import { HEADER_HEIGHT } from "../../components/templates/header/Header.style";
4
+ const { borderRadius4, colorBgPrimaryLight, colorBgBase, space4, space6, space8, space12, space16 } = Theme.get();
4
5
  const style = StyleSheet.create({
6
+ contentWrapper: {
7
+ backgroundColor: colorBgBase,
8
+ flexGrow: 0,
9
+ padding: space6,
10
+ },
5
11
  deliveryBannerContainer: {
6
12
  marginBottom: space6,
7
13
  },
8
- itemsContainer: {
14
+ desktopContentWrapper: {
15
+ borderRadius: borderRadius4,
16
+ },
17
+ desktopLayoutSpacing: {
18
+ paddingVertical: space12,
19
+ },
20
+ desktopListSpacing: {
21
+ paddingRight: space16,
22
+ },
23
+ desktopResume: {
24
+ borderRadius: borderRadius4,
25
+ },
26
+ header: {
27
+ backgroundColor: colorBgBase,
28
+ height: HEADER_HEIGHT,
29
+ },
30
+ mobileInfo: {
9
31
  paddingHorizontal: space6,
32
+ paddingTop: space6,
10
33
  },
11
34
  paymentSelector: {
12
- margin: space6,
35
+ marginBottom: space4,
13
36
  },
14
37
  pricingContainer: {
15
38
  paddingHorizontal: space6,
16
39
  paddingVertical: space8,
17
40
  },
41
+ princingWrapper: {
42
+ padding: space6,
43
+ },
44
+ resume: {
45
+ overflow: "hidden",
46
+ backgroundColor: colorBgBase,
47
+ ...Platform.select({
48
+ web: {
49
+ position: "sticky",
50
+ top: space12,
51
+ alignSelf: "flex-start",
52
+ },
53
+ }),
54
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
+ },
56
+ scrollView: {
57
+ backgroundColor: colorBgPrimaryLight,
58
+ },
18
59
  title: {
19
- marginBottom: space2,
20
- marginHorizontal: space6,
60
+ marginVertical: space4,
21
61
  },
22
62
  });
23
63
  export { style };
@@ -1,9 +1,9 @@
1
- import { InfoBox, INFOBOX_TYPE } from "@lookiero/aurora";
1
+ import { ALIGN, InfoBox, INFOBOX_TYPE, useDevice } from "@lookiero/aurora";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import React from "react";
4
4
  import { I18nMessages } from "../../../../i18n/i18n";
5
5
  const DeliveryBanner = () => {
6
- const deliveryBannerText = useI18nMessage({ id: I18nMessages.CHECKOUT_DELIVERY_BANNER });
7
- return React.createElement(InfoBox, { testID: "delivery-banner", text: deliveryBannerText, type: INFOBOX_TYPE.SQUARED });
6
+ const { screen } = useDevice();
7
+ return (React.createElement(InfoBox, { contentAlign: screen.L ? ALIGN.CENTER : undefined, testID: "delivery-banner", text: useI18nMessage({ id: I18nMessages.CHECKOUT_DELIVERY_BANNER }), type: INFOBOX_TYPE.SQUARED }));
8
8
  };
9
9
  export { DeliveryBanner };
@@ -73,7 +73,7 @@ const Feedback = ({ customerId, country, layout: Layout }) => {
73
73
  if (!dependenciesLoaded)
74
74
  return React.createElement(Spinner, null);
75
75
  return (React.createElement(CheckoutQuestionFeedbackProvider, { feedback: {}, onChanged: handleOnChangedFeedback },
76
- React.createElement(Layout, { style: { scrollView: style.container } },
76
+ React.createElement(Layout, { style: { header: style.header, scrollView: style.container } },
77
77
  React.createElement(Body, { style: { column: style.bodyColumn } },
78
78
  React.createElement(CheckoutQuestionsForm, { checkoutQuestions: checkoutQuestions || [], submitButtonDisabled: giveCheckoutFeedbackStatus === CommandStatus.LOADING, onSubmit: handleOnSubmit })))));
79
79
  };
@@ -1,9 +1,13 @@
1
1
  declare const style: {
2
2
  bodyColumn: {
3
- padding: number;
3
+ paddingBottom: number;
4
+ paddingHorizontal: number;
4
5
  };
5
6
  container: {
6
7
  paddingBottom: number;
7
8
  };
9
+ header: {
10
+ height: number;
11
+ };
8
12
  };
9
13
  export { style };
@@ -1,12 +1,17 @@
1
1
  import { Theme } from "@lookiero/aurora";
2
2
  import { StyleSheet } from "react-native";
3
+ import { HEADER_HEIGHT } from "../../components/templates/header/Header.style";
3
4
  const { space8, space10 } = Theme.get();
4
5
  const style = StyleSheet.create({
5
6
  bodyColumn: {
6
- padding: space8,
7
+ paddingBottom: space8,
8
+ paddingHorizontal: space8,
7
9
  },
8
10
  container: {
9
11
  paddingBottom: space10,
10
12
  },
13
+ header: {
14
+ height: HEADER_HEIGHT,
15
+ },
11
16
  });
12
17
  export { style };
@@ -133,7 +133,7 @@ const Item = ({ customerId, country, layout: Layout }) => {
133
133
  }, [checkout?.id, country, navigate, trackPressBack]);
134
134
  const basePath = useBasePath();
135
135
  const itemDetailRouteMatch = useMatch(`${basePath}/${Routes.ITEM_DETAIL}`);
136
- const header = useMemo(() => (React.createElement(Box, { style: style.header },
136
+ const header = useMemo(() => (React.createElement(Box, { style: style.headerWrapper },
137
137
  itemDetailRouteMatch ? (React.createElement(ItemDetailHeader, { onBack: handleOnBack })) : (React.createElement(ItemHeader, { item: checkoutItem, items: checkout?.items, onNext: handleOnNext, onPrevious: handleOnPrevious })),
138
138
  fiveItemsDiscount !== 0 ? React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }) : null)), [
139
139
  checkout?.items,
@@ -144,8 +144,6 @@ const Item = ({ customerId, country, layout: Layout }) => {
144
144
  handleOnPrevious,
145
145
  itemDetailRouteMatch,
146
146
  ]);
147
- const [height, setHeight] = useState(0);
148
- const handleOnLayout = useCallback((event) => setHeight(event.nativeEvent.layout.height), []);
149
147
  const itemWithoutCustomerDecission = checkoutItem.status === CheckoutItemStatus.INITIAL;
150
148
  const dependenciesLoaded = checkoutStatus !== QueryStatus.LOADING &&
151
149
  checkout &&
@@ -162,9 +160,10 @@ const Item = ({ customerId, country, layout: Layout }) => {
162
160
  }
163
161
  return (React.createElement(ReturnQuestionFeedbackProvider, { key: checkoutItem.id, feedback: checkoutItem.feedbacks || {} },
164
162
  React.createElement(Layout, { header: header, scrollEnabled: !itemWithoutCustomerDecission, style: {
165
- scrollView: { height: itemWithoutCustomerDecission ? height : "auto" },
163
+ header: fiveItemsDiscount !== 0 ? style.headerWithDoubleHeight : style.header,
164
+ scrollView: { height: itemWithoutCustomerDecission ? "100%" : "auto" },
166
165
  safeAreaView: isDesktopScreen ? style.safeAreaView : null,
167
- }, onLayout: handleOnLayout }, itemWithoutCustomerDecission ? (React.createElement(ItemWithoutCustomerDecission, { bookedProductsVariants: bookedProductsVariants, checkoutId: checkout.id, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, onReturn: showReturnQuestions })) : (React.createElement(ItemWithCustomerDecission, { checkoutId: checkout.id, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, returnQuestions: returnQuestions, onEditFeedback: showReturnQuestions }))),
166
+ } }, itemWithoutCustomerDecission ? (React.createElement(ItemWithoutCustomerDecission, { bookedProductsVariants: bookedProductsVariants, checkoutId: checkout.id, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, onReturn: showReturnQuestions })) : (React.createElement(ItemWithCustomerDecission, { checkoutId: checkout.id, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, returnQuestions: returnQuestions, onEditFeedback: showReturnQuestions }))),
168
167
  React.createElement(ReturnQuestionsForm, { returnQuestions: returnQuestions, visible: returnQuestionsVisible, onClose: hideReturnQuestions, onSubmit: returnItem })));
169
168
  };
170
169
  export { Item };
@@ -1,5 +1,11 @@
1
1
  declare const style: {
2
2
  header: {
3
+ height: number;
4
+ };
5
+ headerWithDoubleHeight: {
6
+ height: number;
7
+ };
8
+ headerWrapper: {
3
9
  display: "flex";
4
10
  flexDirection: "column";
5
11
  };
@@ -1,8 +1,15 @@
1
1
  import { Theme } from "@lookiero/aurora";
2
2
  import { StyleSheet } from "react-native";
3
+ import { HEADER_HEIGHT } from "../../components/templates/header/Header.style";
3
4
  const { colorBgPrimaryLight } = Theme.get();
4
5
  const style = StyleSheet.create({
5
6
  header: {
7
+ height: HEADER_HEIGHT,
8
+ },
9
+ headerWithDoubleHeight: {
10
+ height: HEADER_HEIGHT * 2,
11
+ },
12
+ headerWrapper: {
6
13
  display: "flex",
7
14
  flexDirection: "column",
8
15
  },
@@ -15,7 +15,7 @@ const ProductVariantDescription = ({ brand, name, price, size: sizeProjection, c
15
15
  return (React.createElement(View, { style: [style.container, isDesktopScreen ? null : style.smallContainer] },
16
16
  React.createElement(View, { style: style.info },
17
17
  React.createElement(View, { style: style.brand },
18
- React.createElement(Text, { color: COLOR.GRAYSCALE_L, level: 1, detail: true }, brand),
18
+ React.createElement(Text, { color: COLOR.TEXT_MEDIUM, level: 1, detail: true }, brand),
19
19
  React.createElement(Text, { level: 1, detailBold: true }, name)),
20
20
  React.createElement(Price, { price: price, withPercentage: true })),
21
21
  React.createElement(Text, { level: 1, detail: true }, `${sizeText} ${sizeProjection.unique ? uniqueText : size({ size: sizeProjection, country })}`)));
@@ -1,11 +1,14 @@
1
+ import { Theme } from "@lookiero/aurora";
1
2
  import React, { useCallback, useState } from "react";
2
3
  import { Image } from "react-native";
4
+ import { MediaPerspective } from "../../../../../../projection/checkoutItem/checkoutItem";
3
5
  import { AspectRatioView } from "../../../../../../shared/ui/components/atoms/aspectRatioView/AspectRatioView";
4
6
  import { Bullets } from "../../../../../../shared/ui/components/layouts/carousel/Bullets";
5
7
  import { Carousel, } from "../../../../../../shared/ui/components/layouts/carousel/Carousel";
6
8
  import { useScreenSize } from "../../../../../../shared/ui/hooks/useScreenSize";
7
9
  import { useMediaImage } from "../../../../hooks/useMediaImage";
8
10
  import { style } from "./ProductVariantSlider.style";
11
+ const { space16 } = Theme.get();
9
12
  const ProductVariantSlider = ({ producVariantMedia, onChanged }) => {
10
13
  const cdnImageUrl = useMediaImage();
11
14
  const screenSize = useScreenSize();
@@ -15,13 +18,19 @@ const ProductVariantSlider = ({ producVariantMedia, onChanged }) => {
15
18
  setActiveIndex(activeIndex);
16
19
  onChanged?.(activeIndex);
17
20
  }, [onChanged]);
18
- const renderItem = useCallback(({ item }) => (React.createElement(AspectRatioView, { aspectRatio: 4 / 3 },
19
- React.createElement(Image, { resizeMode: "cover", style: [style.image, isDesktopScreen ? style.largeImage : null], testID: "product-variant-image", source: {
20
- uri: cdnImageUrl({
21
- url: item.url,
22
- width: 600,
23
- }),
24
- } }))), [cdnImageUrl, isDesktopScreen]);
21
+ const renderItem = useCallback(({ item, isLastItem }) => {
22
+ const isCollageImage = item.perspective === MediaPerspective.COLLAGE;
23
+ return (React.createElement(AspectRatioView, { aspectRatio: 4 / 3, multiplier: isCollageImage && isLastItem ? 2 : 1, style: {
24
+ marginTop: isCollageImage && !isDesktopScreen ? space16 : 0,
25
+ alignSelf: isCollageImage ? (isLastItem ? "flex-end" : "flex-start") : undefined,
26
+ } },
27
+ React.createElement(Image, { resizeMode: "stretch", style: [style.image, isDesktopScreen ? style.largeImage : null], testID: "product-variant-image", source: {
28
+ uri: cdnImageUrl({
29
+ url: item.url,
30
+ width: 600,
31
+ }),
32
+ } })));
33
+ }, [cdnImageUrl, isDesktopScreen]);
25
34
  const renderBullets = useCallback(({ activeIndex, count, onChange }) => React.createElement(Bullets, { activeIndex: activeIndex, count: count, onChange: onChange }), []);
26
35
  return (React.createElement(Carousel, { activeIndex: activeIndex, bullets: renderBullets, data: producVariantMedia, onActiveIndexChanged: handleOnActiveChanged }, renderItem));
27
36
  };
@@ -13,6 +13,6 @@ const SelectModal = ({ modalVisible, onChange = () => void 0, onClose = () => vo
13
13
  React.createElement(View, { style: [style.modalContent, customStyle?.modalContent] },
14
14
  title && (React.createElement(Text, { level: 3, style: style.modalTitle, heading: true }, title)),
15
15
  options.map(({ label, value: optionValue }) => (React.createElement(TouchableHighlight, { key: optionValue, accessibilityLabel: optionValue, disabled: value === optionValue, style: [style.option, customStyle?.option], testID: optionValue, underlayColor: colorBgPrimaryLight, accessible: true, onPress: value !== optionValue ? () => handleOnPressOption(optionValue) : undefined },
16
- React.createElement(Text, { color: value === optionValue ? COLOR.GRAYSCALE_M : COLOR.CONTENT, level: 3, style: [style.optionText, customStyle?.optionText] }, label)))))));
16
+ React.createElement(Text, { color: value === optionValue ? COLOR.TEXT_MEDIUM : COLOR.TEXT, level: 3, style: [style.optionText, customStyle?.optionText] }, label)))))));
17
17
  };
18
18
  export { SelectModal };
@@ -5,6 +5,7 @@ import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/
5
5
  import { useLogger } from "../../../../../../shared/logging/useLogger";
6
6
  import { useTrackResetItem } from "../../../../../../shared/tracking/infrastructure/useTrackResetItem";
7
7
  import { Spinner } from "../../../../../../shared/ui/components/atoms/spinner/Spinner";
8
+ import { useScreenSize } from "../../../../../../shared/ui/hooks/useScreenSize";
8
9
  import { useResetCheckoutItem } from "../../../../../domain/checkoutItem/react/useResetCheckoutItem";
9
10
  import { TrackingPage } from "../../../../../tracking/tracking";
10
11
  import { Body } from "../../../../components/layouts/body/Body";
@@ -13,6 +14,8 @@ import { ReturnQuestionsFeedback } from "../../components/returnQuestionsFeedbac
13
14
  import { ProductVariant } from "../../views/productVariant/ProductVariant";
14
15
  import { style } from "./ItemWithCustomerDecission.style";
15
16
  const ItemWithCustomerDecission = ({ country, checkoutId, checkoutItem, returnQuestions, currentProductVariant, onEditFeedback, }) => {
17
+ const screenSize = useScreenSize();
18
+ const isMobile = screenSize === "S";
16
19
  const logger = useLogger();
17
20
  /* ResetCheckoutItem */
18
21
  const [resetCheckoutItem, resetCheckoutItemStatus] = useResetCheckoutItem({
@@ -35,7 +38,7 @@ const ItemWithCustomerDecission = ({ country, checkoutId, checkoutItem, returnQu
35
38
  return React.createElement(Spinner, null);
36
39
  }
37
40
  return (React.createElement(Body, { style: { row: style.container } },
38
- React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, customerDecissionBanner: React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: resetItem }) }, checkoutItem.status === CheckoutItemStatus.RETURNED && (React.createElement(View, { style: style.feedbackContainer },
41
+ React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, customerDecissionBanner: React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: resetItem }) }, checkoutItem.status === CheckoutItemStatus.RETURNED && (React.createElement(View, { style: [style.feedbackContainer, isMobile ? style.feedbackContainerMobile : undefined] },
39
42
  React.createElement(ReturnQuestionsFeedback, { returnQuestions: returnQuestions, onEditFeedback: onEditFeedback }))))));
40
43
  };
41
44
  export { ItemWithCustomerDecission };
@@ -8,5 +8,8 @@ declare const style: {
8
8
  marginTop: number;
9
9
  paddingTop: number;
10
10
  };
11
+ feedbackContainerMobile: {
12
+ paddingHorizontal: number;
13
+ };
11
14
  };
12
15
  export { style };
@@ -11,5 +11,8 @@ const style = StyleSheet.create({
11
11
  marginTop: space6,
12
12
  paddingTop: space6,
13
13
  },
14
+ feedbackContainerMobile: {
15
+ paddingHorizontal: space6,
16
+ },
14
17
  });
15
18
  export { style };
@@ -1,5 +1,6 @@
1
1
  import React, { useCallback, useEffect } from "react";
2
2
  import { View } from "react-native";
3
+ import { MediaPerspective, } from "../../../../../../projection/checkoutItem/checkoutItem";
3
4
  import { useTrackImageView } from "../../../../../../shared/tracking/infrastructure/useTrackImageView";
4
5
  import { useScreenSize } from "../../../../../../shared/ui/hooks/useScreenSize";
5
6
  import { TrackingPage } from "../../../../../tracking/tracking";
@@ -22,8 +23,9 @@ const ProductVariant = ({ country, checkoutId, checkoutItem, currentProductVaria
22
23
  const handleOnChangedProductVariantSlider = useCallback((active) => trackImageView({ perspective: checkoutItem.productVariant.media[active]?.perspective }), [checkoutItem.productVariant.media, trackImageView]);
23
24
  const { price } = checkoutItem;
24
25
  const { media, brand, name } = checkoutItem.productVariant;
26
+ const collage = media.find((m) => m.perspective === MediaPerspective.COLLAGE);
25
27
  return (React.createElement(View, { style: [style.container, isDesktopScreen ? style.largeContainer : null], testID: "product-variant" },
26
- React.createElement(ProductVariantSlider, { producVariantMedia: media, onChanged: handleOnChangedProductVariantSlider }),
28
+ React.createElement(ProductVariantSlider, { producVariantMedia: collage ? [...media, collage] : media, onChanged: handleOnChangedProductVariantSlider }),
27
29
  React.createElement(View, { style: [style.content, customStyle?.content] },
28
30
  customerDecissionBanner,
29
31
  React.createElement(ProductVariantDescription, { brand: brand, country: country, name: name, price: price, size: currentProductVariant.size }),
@@ -1,10 +1,10 @@
1
1
  import { FC, ReactNode } from "react";
2
2
  import { Country } from "../../../../projection/shared/country";
3
- import { Layout } from "../../components/layouts/layout/Layout";
3
+ import { Layout as LocalLayout } from "../../components/layouts/layout/Layout";
4
4
  interface SummaryProps {
5
5
  readonly customerId: string;
6
6
  readonly country: Country;
7
- readonly layout: Layout;
7
+ readonly layout: LocalLayout;
8
8
  readonly children: ReactNode;
9
9
  }
10
10
  declare const Summary: FC<SummaryProps>;
@@ -1,4 +1,4 @@
1
- import { Text, Theme } from "@lookiero/aurora";
1
+ import { Box, Text, Layout, useDevice } from "@lookiero/aurora";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import { QueryStatus } from "@lookiero/messaging-react";
4
4
  import React, { useCallback, useEffect, useMemo, useState } from "react";
@@ -14,18 +14,18 @@ import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checko
14
14
  import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
15
15
  import { TrackingPage } from "../../../tracking/tracking";
16
16
  import { FiveItemsDiscountBanner } from "../../components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner";
17
- import { Body } from "../../components/layouts/body/Body";
18
17
  import { I18nMessages } from "../../i18n/i18n";
19
18
  import { Routes } from "../../routing/routes";
20
19
  import { useBasePath } from "../../routing/useBasePath";
21
20
  import { style } from "./Summary.style";
21
+ import { Pricing } from "./components/pricing/Pricing";
22
22
  import { StickyPricing } from "./components/stickyPricing/StickyPricing";
23
- const { space10 } = Theme.get();
24
- const Summary = ({ customerId, country, layout: Layout, children }) => {
23
+ const Summary = ({ customerId, country, layout: LocalLayout, children }) => {
24
+ const [pricingCollapsed, setPricingCollapsed] = useState(true);
25
+ const [pricingHeight, setPricingHeight] = useState(0);
25
26
  const titleText = useI18nMessage({ id: I18nMessages.SUMMARY_TITLE });
26
27
  const descriptionText = useI18nMessage({ id: I18nMessages.SUMMARY_DESCRIPTION });
27
- const [pricingHeight, setPricingHeight] = useState(0);
28
- const handleOnPricingLayout = useCallback(({ height }) => setPricingHeight(height), []);
28
+ const { screen } = useDevice();
29
29
  const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
30
30
  const [pricing, pricingStatus] = useViewPricingByCheckoutId({ checkoutId: checkout?.id });
31
31
  const [fiveItemsDiscount = 0, fiveItemsDiscountStatus] = useViewFiveItemsDiscountByCustomerId({ customerId });
@@ -33,6 +33,17 @@ const Summary = ({ customerId, country, layout: Layout, children }) => {
33
33
  const basePath = useBasePath();
34
34
  const match = useMatch(`${basePath}/${Routes.SUMMARY}/${Routes.SUMMARY_TABS}`);
35
35
  const tab = match?.params.tab;
36
+ const trackPressPricing = useTrackPressPricing({
37
+ page: TrackingPage.SUMMARY,
38
+ country,
39
+ checkoutId: checkout?.id,
40
+ });
41
+ const handleOnPricingLayout = useCallback(({ height }) => setPricingHeight(height), []);
42
+ const handleOnPressPricing = useCallback(() => {
43
+ const collapsed = !pricingCollapsed;
44
+ setPricingCollapsed(collapsed);
45
+ trackPressPricing({ collapse: collapsed });
46
+ }, [pricingCollapsed, trackPressPricing]);
36
47
  useEffect(() => {
37
48
  if (!tab) {
38
49
  navigate(generatePath(Routes.SUMMARY_TABS, {
@@ -47,17 +58,6 @@ const Summary = ({ customerId, country, layout: Layout, children }) => {
47
58
  country,
48
59
  checkoutId: checkout?.id,
49
60
  });
50
- const trackPressPricing = useTrackPressPricing({
51
- page: TrackingPage.SUMMARY,
52
- country,
53
- checkoutId: checkout?.id,
54
- });
55
- const [pricingCollapsed, setPricingCollapsed] = useState(true);
56
- const handleOnPressPricing = useCallback(() => {
57
- const collapsed = !pricingCollapsed;
58
- setPricingCollapsed(collapsed);
59
- trackPressPricing({ collapse: collapsed });
60
- }, [pricingCollapsed, trackPressPricing]);
61
61
  const trackPressContinue = useTrackPressContinue({
62
62
  page: TrackingPage.SUMMARY,
63
63
  country,
@@ -68,21 +68,26 @@ const Summary = ({ customerId, country, layout: Layout, children }) => {
68
68
  navigate(`${basePath}/${Routes.CHECKOUT}`);
69
69
  }, [basePath, navigate, trackPressContinue]);
70
70
  const totalCheckoutItemsKept = useMemo(() => checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED).length || 0, [checkout?.items]);
71
- const [height, setHeight] = useState(0);
72
- const handleOnLayout = useCallback((event) => Platform.OS !== "web" && setHeight(event.nativeEvent.layout.height), []);
73
- const layoutProps = useMemo(() => (Platform.OS === "web" ? {} : { scrollEnabled: false, style: { scrollView: { height } } }), [height]);
74
71
  const dependenciesLoadedStatuses = [QueryStatus.ERROR, QueryStatus.SUCCESS];
75
72
  const dependenciesLoaded = dependenciesLoadedStatuses.includes(pricingStatus) && dependenciesLoadedStatuses.includes(fiveItemsDiscountStatus);
76
73
  if (!dependenciesLoaded)
77
74
  return React.createElement(Spinner, null);
78
- return (React.createElement(Layout, { ...layoutProps, onLayout: handleOnLayout },
75
+ return (React.createElement(LocalLayout, { scrollEnabled: false, style: {
76
+ header: style.header,
77
+ scrollView: style.scrollView,
78
+ } },
79
79
  React.createElement(ScrollView, { showsVerticalScrollIndicator: false },
80
80
  fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
81
- React.createElement(Body, { style: { row: { paddingBottom: pricingHeight + space10 } } },
82
- React.createElement(View, { style: style.content },
83
- React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
84
- React.createElement(Text, { level: 3, style: style.description }, descriptionText)),
85
- children)),
86
- pricing && (React.createElement(StickyPricing, { collapsed: pricingCollapsed, pricing: pricing, totalCheckoutItemsKept: totalCheckoutItemsKept, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined, onPress: handleOnPressPricing, onSubmit: handleOnSubmit }))));
81
+ React.createElement(Layout, { fullWidth: !screen.L, style: [screen.L ? style.desktopLayoutSpacing : undefined, { paddingBottom: pricingHeight }] },
82
+ React.createElement(Box, { size: { L: "2/3" }, style: screen.L ? style.desktopListSpacing : undefined },
83
+ React.createElement(View, { style: [style.contentWrapper, screen.L ? style.desktopContentWrapper : undefined] },
84
+ React.createElement(View, { style: !screen.L ? style.mobileInfo : undefined },
85
+ React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
86
+ React.createElement(Text, { level: 3, style: style.description }, descriptionText)),
87
+ children)),
88
+ pricing && screen.L ? (React.createElement(Box, { size: { L: "1/3" }, style: [style.resume, screen.L ? style.desktopResume : style.mobileResume] },
89
+ React.createElement(View, { style: style.princingWrapper },
90
+ React.createElement(Pricing, { balanceDiscount: pricing.balanceDiscount, collapsed: false, collapsible: false, discount: pricing.discount, discountPercentage: pricing.discountPercentage, pendingToPay: pricing.pendingToPay, service: pricing.service, subtotal: pricing.subtotal, totalCheckoutItemsKept: totalCheckoutItemsKept, onSubmit: handleOnSubmit })))) : null)),
91
+ pricing && !screen.L ? (React.createElement(StickyPricing, { collapsed: pricingCollapsed, pricing: pricing, totalCheckoutItemsKept: totalCheckoutItemsKept, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined, onPress: handleOnPressPricing, onSubmit: handleOnSubmit })) : null));
87
92
  };
88
93
  export { Summary };
@@ -1,10 +1,41 @@
1
1
  declare const style: {
2
- content: {
3
- padding: number;
2
+ contentWrapper: {
3
+ backgroundColor: string;
4
+ flexGrow: number;
4
5
  };
5
6
  description: {
6
7
  color: string;
7
- marginTop: number;
8
+ marginBottom: number;
9
+ };
10
+ desktopContentWrapper: {
11
+ borderRadius: number;
12
+ paddingHorizontal: number;
13
+ paddingVertical: number;
14
+ };
15
+ desktopLayoutSpacing: {
16
+ paddingVertical: number;
17
+ };
18
+ desktopListSpacing: {
19
+ paddingRight: number;
20
+ };
21
+ desktopResume: {
22
+ borderRadius: number;
23
+ };
24
+ header: {
25
+ height: number;
26
+ };
27
+ mobileInfo: {
28
+ paddingHorizontal: number;
29
+ paddingTop: number;
30
+ };
31
+ mobileResume: any;
32
+ princingWrapper: {
33
+ padding: number;
34
+ };
35
+ resume: any;
36
+ scrollView: {
37
+ backgroundColor: string;
38
+ flex: number;
8
39
  };
9
40
  title: {
10
41
  marginBottom: number;
@@ -1,13 +1,67 @@
1
1
  import { Theme } from "@lookiero/aurora";
2
- import { StyleSheet } from "react-native";
3
- const { colorTextMedium, space2, space4, space6 } = Theme.get();
2
+ import { Platform, StyleSheet } from "react-native";
3
+ import { HEADER_HEIGHT } from "../../components/templates/header/Header.style";
4
+ const { colorTextMedium, colorText, colorBgPrimaryLight, space2, space4, space6, space12, space16, borderRadius4, colorBgBase, } = Theme.get();
4
5
  const style = StyleSheet.create({
5
- content: {
6
- padding: space6,
6
+ contentWrapper: {
7
+ backgroundColor: colorBgBase,
8
+ flexGrow: 0,
7
9
  },
8
10
  description: {
9
11
  color: colorTextMedium,
10
- marginTop: space4,
12
+ marginBottom: space4,
13
+ },
14
+ desktopContentWrapper: {
15
+ borderRadius: borderRadius4,
16
+ paddingHorizontal: space6,
17
+ paddingVertical: space12,
18
+ },
19
+ desktopLayoutSpacing: {
20
+ paddingVertical: space12,
21
+ },
22
+ desktopListSpacing: {
23
+ paddingRight: space16,
24
+ },
25
+ desktopResume: {
26
+ borderRadius: borderRadius4,
27
+ },
28
+ header: {
29
+ height: HEADER_HEIGHT,
30
+ },
31
+ mobileInfo: {
32
+ paddingHorizontal: space6,
33
+ paddingTop: space6,
34
+ },
35
+ mobileResume: {
36
+ shadowColor: colorText,
37
+ shadowOpacity: 0.15,
38
+ ...Platform.select({
39
+ web: {
40
+ shadowOffset: { width: 0, height: 8 },
41
+ shadowRadius: 18,
42
+ elevation: 0.5,
43
+ },
44
+ }),
45
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
+ },
47
+ princingWrapper: {
48
+ padding: space6,
49
+ },
50
+ resume: {
51
+ overflow: "hidden",
52
+ backgroundColor: colorBgBase,
53
+ ...Platform.select({
54
+ web: {
55
+ position: "sticky",
56
+ top: space12,
57
+ alignSelf: "flex-start",
58
+ },
59
+ }),
60
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
+ },
62
+ scrollView: {
63
+ backgroundColor: colorBgPrimaryLight,
64
+ flex: 1,
11
65
  },
12
66
  title: {
13
67
  marginBottom: space2,
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode } from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
2
3
  declare enum AspectRatioViewResizeDirection {
3
4
  VERTICAL = "VERTICAL",
4
5
  HORIZONTAL = "HORIZONTAL"
@@ -6,7 +7,9 @@ declare enum AspectRatioViewResizeDirection {
6
7
  interface AspectRatioViewProps {
7
8
  readonly aspectRatio?: number;
8
9
  readonly resizeDirection?: AspectRatioViewResizeDirection;
10
+ readonly multiplier?: number;
9
11
  readonly children: ReactNode;
12
+ readonly style?: StyleProp<ViewStyle>;
10
13
  }
11
14
  declare const AspectRatioView: FC<AspectRatioViewProps>;
12
15
  export { AspectRatioView, AspectRatioViewResizeDirection };
@@ -5,12 +5,12 @@ var AspectRatioViewResizeDirection;
5
5
  AspectRatioViewResizeDirection["VERTICAL"] = "VERTICAL";
6
6
  AspectRatioViewResizeDirection["HORIZONTAL"] = "HORIZONTAL";
7
7
  })(AspectRatioViewResizeDirection || (AspectRatioViewResizeDirection = {}));
8
- const AspectRatioView = ({ aspectRatio = 1, resizeDirection = AspectRatioViewResizeDirection.HORIZONTAL, children, }) => {
8
+ const AspectRatioView = ({ aspectRatio = 1, resizeDirection = AspectRatioViewResizeDirection.HORIZONTAL, multiplier = 1, style: customStyle = {}, children, }) => {
9
9
  const [{ width, height }, setDimension] = useState({});
10
10
  const handleOnLayout = useCallback(({ nativeEvent: { layout } }) => setDimension(resizeDirection === AspectRatioViewResizeDirection.HORIZONTAL
11
- ? { width: layout.width, height: layout.width * aspectRatio }
12
- : { width: layout.height * aspectRatio, height: layout.height }), [aspectRatio, resizeDirection]);
11
+ ? { width: layout.width * multiplier, height: layout.width * aspectRatio }
12
+ : { width: layout.height * aspectRatio, height: layout.height }), [aspectRatio, multiplier, resizeDirection]);
13
13
  return (React.createElement(View, { onLayout: handleOnLayout },
14
- React.createElement(View, { style: { width, height } }, children)));
14
+ React.createElement(View, { style: [{ width, height }, customStyle] }, children)));
15
15
  };
16
16
  export { AspectRatioView, AspectRatioViewResizeDirection };
@@ -1,4 +1,4 @@
1
1
  import { COLOR, Text } from "@lookiero/aurora";
2
2
  import React from "react";
3
- const Error = ({ error, style: customStyle }) => (React.createElement(Text, { color: COLOR.PRIMARY, level: 2, style: customStyle, detail: true }, error));
3
+ const Error = ({ error, style: customStyle }) => (React.createElement(Text, { color: COLOR.TEXT_ERROR, level: 2, style: customStyle, detail: true }, error));
4
4
  export { Error };
@@ -3,6 +3,7 @@ import { StyleProp, ViewStyle } from "react-native";
3
3
  interface RenderItemFunctionArgs<T> {
4
4
  readonly item: T;
5
5
  readonly index: number;
6
+ readonly isLastItem: boolean;
6
7
  }
7
8
  interface RenderItemFunction<T> {
8
9
  (args: RenderItemFunctionArgs<T>): JSX.Element;
@@ -81,7 +81,7 @@ const Carousel = ({ activeIndex = 0, data, enabled = true, children, bullets, on
81
81
  return (React.createElement(View, { style: [style.container, customStyle?.container], testID: "carousel" },
82
82
  React.createElement(View, { style: style.carousel, testID: "carousel-layout", onLayout: handleOnLayout }, carouselWidth && (React.createElement(GestureHandlerRootView, { style: { flex: 1 } },
83
83
  React.createElement(GestureDetector, { gesture: panGesture },
84
- React.createElement(Animated.View, { style: [style.carouselTrack, { width: carouselWidth * data.length }, animatedStyle], testID: "carousel-track" }, data.map((item, index) => (React.createElement(View, { key: index, style: [style.carouselItem, { width: carouselWidth }], testID: "carousel-item" }, children({ index, item }))))))))),
84
+ React.createElement(Animated.View, { style: [style.carouselTrack, { width: carouselWidth * data.length }, animatedStyle], testID: "carousel-track" }, data.map((item, index) => (React.createElement(View, { key: index, style: [style.carouselItem, { width: carouselWidth }], testID: "carousel-item" }, children({ index, item, isLastItem: index === data.length - 1 }))))))))),
85
85
  bullets && (React.createElement(View, { style: style.bullets, testID: "carousel-bullets" }, bullets({ activeIndex, count: data.length, onChange: handleOnActiveIndexChanged })))));
86
86
  };
87
87
  export { Carousel };
@@ -1,6 +1,6 @@
1
1
  import { Theme } from "@lookiero/aurora";
2
2
  import { Platform, StyleSheet } from "react-native";
3
- const { colorBgBase, elevationColor, elevationLayerL, elevationOffset, elevationOpacityM, elevationRadius, space3, space6, } = Theme.get();
3
+ const { colorBgBase, shadowColor, elevationLayerL, shadowOffset, shadowOpacityM, shadowRadius, space3, space6 } = Theme.get();
4
4
  const style = StyleSheet.create({
5
5
  sticky: {
6
6
  backgroundColor: colorBgBase,
@@ -8,10 +8,10 @@ const style = StyleSheet.create({
8
8
  elevation: elevationLayerL,
9
9
  paddingHorizontal: space6,
10
10
  paddingVertical: space3,
11
- shadowColor: elevationColor,
12
- shadowOffset: elevationOffset,
13
- shadowOpacity: elevationOpacityM,
14
- shadowRadius: elevationRadius,
11
+ shadowColor: shadowColor,
12
+ shadowOffset: shadowOffset,
13
+ shadowOpacity: shadowOpacityM,
14
+ shadowRadius: shadowRadius,
15
15
  width: "100%",
16
16
  ...Platform.select({
17
17
  web: { position: "sticky" },
@@ -5,20 +5,21 @@ import { Error } from "../../atoms/error/Error";
5
5
  import { Field } from "../../atoms/field/Field";
6
6
  import { Input } from "../../atoms/input/Input";
7
7
  import { style } from "./InputField.style";
8
- const { colorBgBase, colorBorderInput, colorBorderInputError, colorBorderInputFocus, colorTextMedium, iconSize, space6, } = Theme.get();
8
+ const { colorBgBase, colorBorderInput, colorBorderInputError, colorBorderInputFocus, colorText, colorTextError, colorTextMedium, iconSize, space6, } = Theme.get();
9
9
  const inputPaddingRightWithIcon = iconSize + space6;
10
10
  const InputField = ({ label, placeholder, value, multiline = false, minHeight, error, style: customStyle, onChange = () => void 0, icon, ...inputRestProps }) => {
11
11
  const [isFocused, setIsFocused] = useState(false);
12
12
  const handleOnChange = useCallback((text) => onChange(text), [onChange]);
13
13
  const handleOnBlur = useCallback(() => setIsFocused(false), []);
14
14
  const handleOnFocus = useCallback(() => setIsFocused(true), []);
15
- const color = error ? colorBorderInputError : isFocused ? colorBorderInputFocus : colorBorderInput;
15
+ const borderColor = error ? colorBorderInputError : isFocused ? colorBorderInputFocus : colorBorderInput;
16
+ const color = error ? colorTextError : isFocused ? colorText : colorTextMedium;
16
17
  return (React.createElement(View, { style: customStyle?.inputField, testID: "input-field" },
17
18
  React.createElement(Field, { isFocused: isFocused || !!value, label: label, style: {
18
19
  field: [style.field, customStyle?.field],
19
20
  fieldText: [{ color }, customStyle?.fieldText],
20
21
  } }),
21
- React.createElement(Input, { minHeight: minHeight, multiline: multiline, placeholder: placeholder, placeholderTextColor: isFocused ? colorTextMedium : colorBgBase, style: [!!icon && { paddingRight: inputPaddingRightWithIcon }, { borderColor: color }, customStyle?.input], value: value, onBlur: handleOnBlur, onChangeText: handleOnChange, onFocus: handleOnFocus, ...inputRestProps }),
22
+ React.createElement(Input, { minHeight: minHeight, multiline: multiline, placeholder: placeholder, placeholderTextColor: isFocused ? colorTextMedium : colorBgBase, style: [!!icon && { paddingRight: inputPaddingRightWithIcon }, { borderColor, color }, customStyle?.input], value: value, onBlur: handleOnBlur, onChangeText: handleOnChange, onFocus: handleOnFocus, ...inputRestProps }),
22
23
  !!icon && React.createElement(Icon, { color: COLOR.GRAYSCALE_L, name: icon, style: [style.icon, customStyle?.icon], testID: "icon" }),
23
24
  !!error && React.createElement(Error, { error: error, style: [style.error, customStyle?.error] })));
24
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "5.0.0-update-aurora-version-2024.2.29.112652",
3
+ "version": "5.0.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -20,7 +20,7 @@
20
20
  "lint": "eslint --fix --cache --cache-location ./node_modules/.cache/.eslintcache --ext ts,tsx .",
21
21
  "format": "prettier --write \"**/*.+(json|css|ts|tsx|md)\"",
22
22
  "test": "tsc -p ./tsconfig.test.json --noemit && jest --passWithNoTests --colors --verbose --runInBand --detectOpenHandles --forceExit",
23
- "test:coverage": "jest --coverage --coverageReporters=text --detectOpenHandles --forceExit --silent",
23
+ "report": "jest --coverage --coverageReporters=text --detectOpenHandles --forceExit --silent",
24
24
  "test:contract": "TEST_ENV=CONTRACT jest --coverage false --detectOpenHandles --testMatch \"**/?(*.)+(pact).ts\" --testTimeout=3000 --watchAll=false --forceExit",
25
25
  "publish:contract": "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) node pact.publish.js",
26
26
  "prepare": "husky install"
@@ -49,7 +49,7 @@
49
49
  "@lookiero/data-sources": "^0.3",
50
50
  "@lookiero/event": "^0.3",
51
51
  "@lookiero/locale": "^0.3",
52
- "@lookiero/payments-front": "5.0.0-rebrand-2024.01.30.153213",
52
+ "@lookiero/payments-front": "5.0.0",
53
53
  "@lookiero/user-tracking-front": "0.0.37",
54
54
  "apollo-boost": "0.4.4",
55
55
  "graphql": "16.6.0",
@@ -67,13 +67,13 @@
67
67
  "devDependencies": {
68
68
  "@babel/core": "^7.20.0",
69
69
  "@expo/webpack-config": "^0.17.4",
70
- "@lookiero/aurora": "4.0.0-rebrand-2024.02.26.121638",
71
- "@lookiero/aurora-fonts": "2.0.0-rebrand-2024.1.31.145401",
72
- "@lookiero/aurora-iconfont": "3.0.0-rebrand-2024.2.8.133217",
70
+ "@lookiero/aurora": "^4.0.1",
71
+ "@lookiero/aurora-fonts": "2.0.0",
72
+ "@lookiero/aurora-iconfont": "3.0.0",
73
73
  "@lookiero/data-sources": "^0.3",
74
74
  "@lookiero/event": "^0.3",
75
75
  "@lookiero/locale": "^0.3",
76
- "@lookiero/payments-front": "5.0.0-rebrand-2024.01.30.153213",
76
+ "@lookiero/payments-front": "5.0.0",
77
77
  "@lookiero/user-tracking-front": "0.0.37",
78
78
  "@pact-foundation/pact": "^10.1.4",
79
79
  "@pact-foundation/pact-node": "^10.17.6",