@lookiero/checkout 1.1.7 → 1.2.0-beta.1

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 (103) hide show
  1. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +6 -0
  2. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +13 -0
  3. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +10 -0
  4. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +11 -0
  5. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +6 -0
  6. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +7 -0
  7. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +6 -0
  8. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +9 -0
  9. package/dist/infrastructure/ui/components/atoms/price/Price.js +1 -1
  10. package/dist/infrastructure/ui/components/layouts/banner/Banner.js +2 -2
  11. package/dist/infrastructure/ui/components/layouts/banner/Banner.style.d.ts +0 -3
  12. package/dist/infrastructure/ui/components/layouts/banner/Banner.style.js +0 -3
  13. package/dist/infrastructure/ui/components/layouts/tabs/Tabs.js +2 -2
  14. package/dist/infrastructure/ui/components/layouts/tabs/Tabs.style.d.ts +0 -6
  15. package/dist/infrastructure/ui/components/layouts/tabs/Tabs.style.js +1 -7
  16. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +2 -9
  17. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +1 -1
  18. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +1 -1
  19. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +1 -1
  20. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.js +1 -1
  21. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -1
  22. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +1 -1
  23. package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.d.ts +2 -0
  24. package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.js +28 -0
  25. package/dist/infrastructure/ui/hooks/useToast.js +9 -4
  26. package/dist/infrastructure/ui/theme/theme.d.ts +1 -1
  27. package/dist/infrastructure/ui/theme/theme.js +1 -3
  28. package/dist/infrastructure/ui/views/checkout/Checkout.js +1 -1
  29. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +7 -0
  30. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +25 -0
  31. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +16 -0
  32. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +19 -0
  33. package/dist/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +2 -5
  34. package/dist/infrastructure/ui/views/intro/Intro.d.ts +6 -0
  35. package/dist/infrastructure/ui/views/intro/Intro.js +52 -0
  36. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +52 -0
  37. package/dist/infrastructure/ui/views/intro/Intro.style.js +55 -0
  38. package/dist/infrastructure/ui/views/item/Item.style.d.ts +15 -0
  39. package/dist/infrastructure/ui/views/item/Item.style.js +18 -0
  40. package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +1 -1
  41. package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +5 -19
  42. package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +0 -3
  43. package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +0 -3
  44. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.js +1 -2
  45. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +26 -0
  46. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +44 -0
  47. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +45 -0
  48. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +53 -0
  49. package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +5 -5
  50. package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +0 -7
  51. package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +1 -8
  52. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +1 -1
  53. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +1 -2
  54. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +7 -0
  55. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +25 -0
  56. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +16 -0
  57. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +19 -0
  58. package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +4 -11
  59. package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.d.ts +0 -3
  60. package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.js +0 -3
  61. package/dist/infrastructure/ui/views/navigation/Navigation.js +1 -1
  62. package/dist/infrastructure/ui/views/navigation/components/header/Header.js +4 -4
  63. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.d.ts +0 -3
  64. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.js +0 -3
  65. package/dist/infrastructure/ui/views/notFound/NotFound.js +2 -3
  66. package/dist/infrastructure/ui/views/shared/components/productVariant/ProductVariant.js +4 -4
  67. package/dist/infrastructure/ui/views/shared/components/productVariant/ProductVariant.style.d.ts +0 -9
  68. package/dist/infrastructure/ui/views/shared/components/productVariant/ProductVariant.style.js +0 -9
  69. package/dist/infrastructure/ui/views/summary/Summary.js +2 -2
  70. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +1 -1
  71. package/dist/infrastructure/ui/views/summary/components/fiveItemsDiscountBanner/FiveItemsDiscountBanner.js +2 -2
  72. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +3 -4
  73. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.d.ts +0 -3
  74. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.js +0 -3
  75. package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +17 -0
  76. package/dist/shared/notifications/domain/notification/command/createNotification.js +7 -0
  77. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +21 -0
  78. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +22 -0
  79. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +12 -0
  80. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +24 -0
  81. package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +9 -0
  82. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +20 -0
  83. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +36 -0
  84. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +31 -0
  85. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.js +4 -11
  86. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.d.ts +0 -3
  87. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.js +0 -3
  88. package/dist/shared/tracking/infrastructure/usePageView.d.ts +13 -0
  89. package/dist/shared/tracking/infrastructure/usePageView.js +27 -0
  90. package/dist/shared/ui/components/atoms/error/Error.js +2 -3
  91. package/dist/shared/ui/components/atoms/field/Field.js +1 -1
  92. package/dist/shared/ui/components/atoms/icon/Icon.js +2 -5
  93. package/dist/shared/ui/components/atoms/spinner/Spinner.js +1 -1
  94. package/dist/shared/ui/components/layouts/modal/Modal.js +1 -1
  95. package/dist/shared/ui/components/layouts/sticky/Sticky.style.d.ts +12 -3
  96. package/dist/shared/ui/components/molecules/selectField/SelectField.js +2 -2
  97. package/dist/shared/ui/components/molecules/selectField/SelectField.style.d.ts +0 -3
  98. package/dist/shared/ui/components/molecules/selectField/SelectField.style.js +1 -4
  99. package/dist/shared/ui/components/molecules/toast/Toast.js +3 -3
  100. package/dist/shared/ui/components/molecules/toast/Toast.style.d.ts +4 -4
  101. package/dist/shared/ui/components/molecules/toast/Toast.style.js +1 -4
  102. package/dist/shared/ui/hooks/useScreenSize.js +1 -1
  103. package/package.json +7 -7
@@ -1,5 +1,4 @@
1
- import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
2
- import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
1
+ import { Button, Text } from "@lookiero/aurora";
3
2
  import { useI18nMessage } from "@lookiero/i18n-react";
4
3
  import { animated, useSpring } from "@react-spring/native";
5
4
  import React from "react";
@@ -13,7 +12,7 @@ import { ArrowUp } from "./icons/ArrowUp";
13
12
  const { colorGrayscaleS } = theme();
14
13
  const PS_SERVICE_FREE_INDICATOR = 100;
15
14
  const Row = ({ text, level = 3, children }) => (React.createElement(View, { style: style.row },
16
- React.createElement(Text, { level: level, style: style.uppercase, action: true }, text),
15
+ React.createElement(Text, { level: level, action: true, upperCase: true }, text),
17
16
  children));
18
17
  const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPercentage = 0, totalCheckoutItemsKept, service, collapsible = true, collapsed = false, busy = false, onPress = () => void 0, onSubmit, }) => {
19
18
  const totalText = useI18nMessage({ id: I18nMessages.SUMMARY_TOTAL }) || "";
@@ -50,7 +49,7 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
50
49
  React.createElement(Price, { price: discount, variant: "subtotal" }))),
51
50
  balanceDiscount && balanceDiscount.amount !== 0 && (React.createElement(Row, { text: creditText },
52
51
  React.createElement(Price, { price: balanceDiscount, variant: "subtotal" }))),
53
- React.createElement(Row, { text: feeText }, isPSServiceFree ? (React.createElement(Text, { level: 3, style: style.uppercase, action: true }, freeText)) : (React.createElement(Price, { price: service.finalPrice, variant: "subtotal" }))),
52
+ React.createElement(Row, { text: feeText }, isPSServiceFree ? (React.createElement(Text, { level: 3, action: true, upperCase: true }, freeText)) : (React.createElement(Price, { price: service.finalPrice, variant: "subtotal" }))),
54
53
  React.createElement(View, { style: style.divider }),
55
54
  React.createElement(Row, { level: 2, text: totalText },
56
55
  React.createElement(Price, { price: pendingToPay, variant: "total" })),
@@ -24,8 +24,5 @@ declare const style: {
24
24
  totalCollapsed: {
25
25
  marginBottom: number;
26
26
  };
27
- uppercase: {
28
- textTransform: "uppercase";
29
- };
30
27
  };
31
28
  export { style };
@@ -27,8 +27,5 @@ const style = StyleSheet.create({
27
27
  totalCollapsed: {
28
28
  marginBottom: spaceXS,
29
29
  },
30
- uppercase: {
31
- textTransform: "uppercase",
32
- },
33
30
  });
34
31
  export { style };
@@ -0,0 +1,17 @@
1
+ import { Command } from "@lookiero/messaging";
2
+ import { NotificationLevel } from "../model/notification";
3
+ declare const CREATE_NOTIFICATION = "create_notification";
4
+ interface CreateNotificationPayload {
5
+ readonly aggregateId: string;
6
+ readonly level: NotificationLevel;
7
+ readonly bodyI18nKey: string;
8
+ readonly titleI18nKey: string | undefined;
9
+ }
10
+ interface CreateNotification extends Command<typeof CREATE_NOTIFICATION>, CreateNotificationPayload {
11
+ }
12
+ interface CreateNotificationFunction {
13
+ (payload: CreateNotificationPayload): CreateNotification;
14
+ }
15
+ declare const createNotification: CreateNotificationFunction;
16
+ export type { CreateNotification };
17
+ export { CREATE_NOTIFICATION, createNotification };
@@ -0,0 +1,7 @@
1
+ import { command } from "@lookiero/messaging";
2
+ const CREATE_NOTIFICATION = "create_notification";
3
+ const createNotification = ({ aggregateId, ...payload }) => ({
4
+ ...command({ aggregateId, name: CREATE_NOTIFICATION }),
5
+ ...payload,
6
+ });
7
+ export { CREATE_NOTIFICATION, createNotification };
@@ -0,0 +1,21 @@
1
+ import { CommandStatus } from "@lookiero/messaging-react";
2
+ import { Logger } from "../../../../../logging/Logger";
3
+ import { NotificationLevel } from "../../../../domain/notification/model/notification";
4
+ interface CreateNotificationFunctionArgs {
5
+ readonly aggregateId?: string;
6
+ readonly level: NotificationLevel;
7
+ readonly bodyI18nKey: string;
8
+ readonly titleI18nKey?: string;
9
+ }
10
+ interface CreateNotificationFunction {
11
+ (args: CreateNotificationFunctionArgs): Promise<void>;
12
+ }
13
+ interface UseCreateNotificationFunctionArgs {
14
+ readonly contextId: string;
15
+ readonly logger: Logger;
16
+ }
17
+ interface UseCreateNotificationFunction {
18
+ (args: UseCreateNotificationFunctionArgs): [create: CreateNotificationFunction, status: CommandStatus];
19
+ }
20
+ declare const useCreateNotification: UseCreateNotificationFunction;
21
+ export { useCreateNotification };
@@ -0,0 +1,22 @@
1
+ import { useCommand } from "@lookiero/messaging-react";
2
+ import { useCallback } from "react";
3
+ import { v4 as uuid } from "uuid";
4
+ import { createNotification } from "../../../../domain/notification/command/createNotification";
5
+ const useCreateNotification = ({ contextId, logger }) => {
6
+ const [commandBus, status] = useCommand({ contextId });
7
+ const create = useCallback(async ({ aggregateId, level, titleI18nKey, bodyI18nKey }) => {
8
+ try {
9
+ await commandBus(createNotification({
10
+ aggregateId: aggregateId || uuid(),
11
+ level,
12
+ titleI18nKey,
13
+ bodyI18nKey,
14
+ }));
15
+ }
16
+ catch (error) {
17
+ logger.captureException(error);
18
+ }
19
+ }, [commandBus, logger]);
20
+ return [create, status];
21
+ };
22
+ export { useCreateNotification };
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ import { ToastStyle } from "../../../../ui/components/molecules/toast/Toast";
3
+ import { NotificationProjection } from "../../../projection/notification/notification";
4
+ interface NotificationItemProps {
5
+ readonly notification: NotificationProjection;
6
+ readonly onRemove: (notificationId: string) => void;
7
+ readonly autoHideTimeout?: number;
8
+ readonly testID?: string;
9
+ readonly style?: ToastStyle;
10
+ }
11
+ declare const NotificationItem: FC<NotificationItemProps>;
12
+ export { NotificationItem };
@@ -0,0 +1,24 @@
1
+ import { useI18nMessage } from "@lookiero/i18n-react";
2
+ import React from "react";
3
+ import { useCallback, useEffect } from "react";
4
+ import { Toast, ToastVariant } from "../../../../ui/components/molecules/toast/Toast";
5
+ import { NotificationLevel } from "../../../domain/notification/model/notification";
6
+ const toastVariantForNotificationLevel = {
7
+ [NotificationLevel.INFO]: ToastVariant.INFO,
8
+ [NotificationLevel.ERROR]: ToastVariant.ERROR,
9
+ [NotificationLevel.SUCCESS]: ToastVariant.SUCCESS,
10
+ };
11
+ const NotificationItem = ({ notification, onRemove, autoHideTimeout, testID = "notification-item", style: customStyle, }) => {
12
+ const title = useI18nMessage({ id: notification.titleI18nKey }) || undefined;
13
+ const body = useI18nMessage({ id: notification.bodyI18nKey || "" });
14
+ const handleOnClose = useCallback(() => onRemove(notification.id), [notification.id, onRemove]);
15
+ useEffect(() => {
16
+ if (!autoHideTimeout) {
17
+ return;
18
+ }
19
+ const hideTimeout = setTimeout(handleOnClose, autoHideTimeout);
20
+ return () => clearTimeout(hideTimeout);
21
+ }, [autoHideTimeout, handleOnClose]);
22
+ return (React.createElement(Toast, { body: body, style: customStyle, testID: testID, title: title, variant: toastVariantForNotificationLevel[notification.level], onClose: handleOnClose }));
23
+ };
24
+ export { NotificationItem };
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { NotificationProjection } from "../../../projection/notification/notification";
3
+ interface NotificationsProps {
4
+ readonly notifications?: NotificationProjection[];
5
+ readonly onRemove: (notificationId: string) => void;
6
+ readonly autoHideTimeout?: number;
7
+ }
8
+ declare const Notifications: FC<NotificationsProps>;
9
+ export { Notifications };
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
4
+ import { Column } from "../../../../ui/components/layouts/column/Column";
5
+ import { Row } from "../../../../ui/components/layouts/row/Row";
6
+ import { Stack } from "../../../../ui/components/layouts/stack/Stack";
7
+ import { useScreenSize } from "../../../../ui/hooks/useScreenSize";
8
+ import { NotificationItem } from "./NotificationItem";
9
+ import { style } from "./Notifications.style";
10
+ const NOTIFICATIONS_AUTOHIDE_TIMEOUT = 10000;
11
+ const Notifications = ({ notifications = [], onRemove, autoHideTimeout = NOTIFICATIONS_AUTOHIDE_TIMEOUT, }) => {
12
+ const { top: safeAreaInsetTop } = useSafeAreaInsets();
13
+ const screenSize = useScreenSize();
14
+ const isSmallDevice = screenSize === "S";
15
+ return (React.createElement(View, { pointerEvents: "box-none", style: style.notifications, testID: "notifications" },
16
+ React.createElement(Row, { style: [style.row, isSmallDevice && style.rowSmall, { paddingTop: safeAreaInsetTop }] },
17
+ React.createElement(Column, null,
18
+ React.createElement(Stack, null, notifications.map((notification) => (React.createElement(NotificationItem, { key: notification.id, autoHideTimeout: autoHideTimeout, notification: notification, style: { toast: style.toast }, testID: notification.id, onRemove: onRemove }))))))));
19
+ };
20
+ export { Notifications };
@@ -0,0 +1,36 @@
1
+ import { StyleSheet } from "react-native";
2
+ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
3
+ notifications: {
4
+ flexDirection: "column";
5
+ top: number;
6
+ width: string;
7
+ zIndex: number;
8
+ left: number;
9
+ } | {
10
+ flexDirection: "column";
11
+ top: number;
12
+ width: string;
13
+ zIndex: number;
14
+ position: "fixed";
15
+ left: number;
16
+ } | {
17
+ flexDirection: "column";
18
+ top: number;
19
+ width: string;
20
+ zIndex: number;
21
+ position: "absolute";
22
+ left: number;
23
+ };
24
+ row: {
25
+ flex: number;
26
+ justifyContent: "center";
27
+ };
28
+ rowSmall: {
29
+ paddingLeft: number;
30
+ paddingRight: number;
31
+ };
32
+ toast: {
33
+ marginTop: number;
34
+ };
35
+ }>;
36
+ export { style };
@@ -0,0 +1,31 @@
1
+ import { Platform, StyleSheet } from "react-native";
2
+ import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
+ const { spaceM } = theme();
4
+ const style = StyleSheet.create({
5
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6
+ // @ts-ignore
7
+ notifications: {
8
+ left: 0,
9
+ ...Platform.select({
10
+ web: { position: "fixed" },
11
+ ios: { position: "absolute" },
12
+ android: { position: "absolute" },
13
+ }),
14
+ flexDirection: "column",
15
+ top: 0,
16
+ width: "100%",
17
+ zIndex: 20,
18
+ },
19
+ row: {
20
+ flex: 1,
21
+ justifyContent: "center",
22
+ },
23
+ rowSmall: {
24
+ paddingLeft: spaceM,
25
+ paddingRight: spaceM,
26
+ },
27
+ toast: {
28
+ marginTop: spaceM,
29
+ },
30
+ });
31
+ export { style };
@@ -1,5 +1,4 @@
1
- import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
2
- import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
1
+ import { ALIGN, Button, Text } from "@lookiero/aurora";
3
2
  import { useI18nMessage } from "@lookiero/i18n-react";
4
3
  import React from "react";
5
4
  import { useCallback } from "react";
@@ -13,14 +12,8 @@ const ModalNotificationItem = ({ visible, notification, onRemove, testID = "moda
13
12
  const handleOnClose = useCallback(() => onRemove(notification.id), [notification.id, onRemove]);
14
13
  return (React.createElement(Modal, { testID: testID, visible: visible, onClose: handleOnClose },
15
14
  React.createElement(View, { style: style.modal },
16
- React.createElement(Text, { level: 1, style: style.modalTitle, body: true }, titleText),
17
- React.createElement(Text, { level: 3, style: style.modalDescription, body: true }, bodyText),
18
- React.createElement(Button
19
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
20
- // @ts-ignore
21
- , {
22
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23
- // @ts-ignore
24
- style: style.button, onPress: handleOnClose }, acceptText))));
15
+ React.createElement(Text, { align: ALIGN.CENTER, level: 1 }, titleText),
16
+ React.createElement(Text, { level: 3, style: style.modalDescription }, bodyText),
17
+ React.createElement(Button, { style: style.button, onPress: handleOnClose }, acceptText))));
25
18
  };
26
19
  export { ModalNotificationItem };
@@ -9,8 +9,5 @@ declare const style: {
9
9
  marginVertical: number;
10
10
  textAlign: "center";
11
11
  };
12
- modalTitle: {
13
- textAlign: "center";
14
- };
15
12
  };
16
13
  export { style };
@@ -12,8 +12,5 @@ const style = StyleSheet.create({
12
12
  marginVertical: spaceXL,
13
13
  textAlign: "center",
14
14
  },
15
- modalTitle: {
16
- textAlign: "center",
17
- },
18
15
  });
19
16
  export { style };
@@ -0,0 +1,13 @@
1
+ import { TrackingPage } from "../../../infrastructure/tracking/tracking";
2
+ import { Country } from "../../../projection/shared/country";
3
+ interface UsePageViewFunctionArgs {
4
+ readonly page: TrackingPage;
5
+ readonly country: Country;
6
+ readonly checkoutId?: string;
7
+ readonly checkoutItemId?: string;
8
+ }
9
+ interface UsePageViewFunction {
10
+ (agrs: UsePageViewFunctionArgs): void;
11
+ }
12
+ declare const usePageView: UsePageViewFunction;
13
+ export { usePageView };
@@ -0,0 +1,27 @@
1
+ import { useLayoutEffect } from "react";
2
+ import { PROJECT } from "../../../infrastructure/tracking/tracking";
3
+ import { TrackingEvent, TrackingEventCategory } from "../tracking";
4
+ import { useEmitUserEvent } from "./useEmitUserEvent";
5
+ const usePageView = ({ page, country, checkoutId, checkoutItemId }) => {
6
+ const emitUserEvent = useEmitUserEvent();
7
+ useLayoutEffect(() => {
8
+ if (!checkoutId) {
9
+ return;
10
+ }
11
+ const baseTrackingEvent = {
12
+ event: TrackingEvent.PAGEVIEW,
13
+ eventCategory: TrackingEventCategory.NAVIGATION,
14
+ section: `${PROJECT}_${page}`,
15
+ store: country,
16
+ checkoutId,
17
+ };
18
+ const pageViewTrackingEvent = checkoutItemId
19
+ ? {
20
+ ...baseTrackingEvent,
21
+ checkoutItemId,
22
+ }
23
+ : baseTrackingEvent;
24
+ emitUserEvent(pageViewTrackingEvent);
25
+ }, [checkoutId, checkoutItemId, country, emitUserEvent, page]);
26
+ };
27
+ export { usePageView };
@@ -1,5 +1,4 @@
1
- import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
1
+ import { COLOR, Text } from "@lookiero/aurora";
2
2
  import React from "react";
3
- import { style } from "./Error.style";
4
- const Error = ({ error, style: customStyle }) => (React.createElement(Text, { level: 2, style: [style.error, customStyle], detail: true }, error));
3
+ const Error = ({ error, style: customStyle }) => (React.createElement(Text, { color: COLOR.PRIMARY, level: 2, style: customStyle, detail: true }, error));
5
4
  export { Error };
@@ -1,4 +1,4 @@
1
- import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
1
+ import { Text } from "@lookiero/aurora";
2
2
  import { animated, useSpring } from "@react-spring/native";
3
3
  import React, { useCallback, useState } from "react";
4
4
  import { View } from "react-native";
@@ -1,7 +1,4 @@
1
+ import { Icon as AuroraIcon } from "@lookiero/aurora";
1
2
  import React from "react";
2
- import { Text } from "react-native";
3
- import { theme } from "../../../../../infrastructure/ui/theme/theme";
4
- import { style } from "./Icon.style";
5
- const { iconGlyphs } = theme();
6
- const Icon = ({ name, style: customStyle }) => (React.createElement(Text, { accessibilityElementsHidden: true, allowFontScaling: false, importantForAccessibility: "no", selectable: false, style: [style.icon, customStyle], testID: "icon" }, String.fromCharCode(iconGlyphs[name])));
3
+ const Icon = ({ name, style: customStyle }) => (React.createElement(AuroraIcon, { name: name, style: customStyle, testID: "icon" }));
7
4
  export { Icon };
@@ -1,4 +1,4 @@
1
- import { Spinner as AuroraSpinner } from "@lookiero/aurora-next/build/components/atoms/Spinner/Spinner";
1
+ import { Spinner as AuroraSpinner } from "@lookiero/aurora";
2
2
  import React from "react";
3
3
  import { View } from "react-native";
4
4
  import { style } from "./Spinner.style";
@@ -1,5 +1,5 @@
1
1
  import { Portal } from "@gorhom/portal";
2
- import { useBack } from "@lookiero/aurora-next/build/hooks/useBack/useBack";
2
+ import { useBack } from "@lookiero/aurora";
3
3
  import { animated, useTransition } from "@react-spring/native";
4
4
  import React, { useCallback, useMemo, useState } from "react";
5
5
  import { Dimensions, Platform, TouchableWithoutFeedback, View, } from "react-native";
@@ -7,7 +7,10 @@ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
7
7
  elevation: number;
8
8
  paddingTop: number;
9
9
  shadowColor: string;
10
- shadowOffset: typeof import("@lookiero/aurora-next/build/theming/theme.default").DefaultTheme.$elevationOffset;
10
+ shadowOffset: {
11
+ width: number;
12
+ height: number;
13
+ };
11
14
  shadowOpacity: number;
12
15
  shadowRadius: number;
13
16
  width: string;
@@ -19,7 +22,10 @@ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
19
22
  elevation: number;
20
23
  paddingTop: number;
21
24
  shadowColor: string;
22
- shadowOffset: typeof import("@lookiero/aurora-next/build/theming/theme.default").DefaultTheme.$elevationOffset;
25
+ shadowOffset: {
26
+ width: number;
27
+ height: number;
28
+ };
23
29
  shadowOpacity: number;
24
30
  shadowRadius: number;
25
31
  width: string;
@@ -31,7 +37,10 @@ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
31
37
  elevation: number;
32
38
  paddingTop: number;
33
39
  shadowColor: string;
34
- shadowOffset: typeof import("@lookiero/aurora-next/build/theming/theme.default").DefaultTheme.$elevationOffset;
40
+ shadowOffset: {
41
+ width: number;
42
+ height: number;
43
+ };
35
44
  shadowOpacity: number;
36
45
  shadowRadius: number;
37
46
  width: string;
@@ -1,4 +1,4 @@
1
- import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
1
+ import { COLOR, Text } from "@lookiero/aurora";
2
2
  import React, { useCallback, useMemo, useState } from "react";
3
3
  import { TouchableHighlight, View } from "react-native";
4
4
  import { theme } from "../../../../../infrastructure/ui/theme/theme";
@@ -23,6 +23,6 @@ const SelectField = ({ title, placeholder, value, options, style: customStyle, o
23
23
  React.createElement(View, { style: [style.modalContent, customStyle?.modalContent] },
24
24
  title && (React.createElement(Text, { level: 2, style: style.modalTitle }, title)),
25
25
  options.map(({ label, value: optionValue }) => (React.createElement(TouchableHighlight, { key: optionValue, disabled: value === optionValue, style: [style.option, customStyle?.option], underlayColor: colorGrayscaleS, onPress: value !== optionValue ? () => handleOnPressOption(optionValue) : undefined },
26
- React.createElement(Text, { level: 3, style: [style.optionText, value === optionValue && style.selectedOptionText, customStyle?.optionText] }, label))))))));
26
+ React.createElement(Text, { color: value === optionValue ? COLOR.GRAYSCALE_M : COLOR.CONTENT, level: 3, style: [style.optionText, customStyle?.optionText] }, label))))))));
27
27
  };
28
28
  export { SelectField };
@@ -15,8 +15,5 @@ declare const style: {
15
15
  optionText: {
16
16
  lineHeight: number;
17
17
  };
18
- selectedOptionText: {
19
- color: string;
20
- };
21
18
  };
22
19
  export { style };
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
- const { borderSize, colorGrayscaleS, colorGrayscaleM, spaceM, spaceL, spaceXL } = theme();
3
+ const { borderSize, colorGrayscaleS, spaceM, spaceL, spaceXL } = theme();
4
4
  const style = StyleSheet.create({
5
5
  modalContent: {
6
6
  paddingBottom: spaceXL,
@@ -18,8 +18,5 @@ const style = StyleSheet.create({
18
18
  optionText: {
19
19
  lineHeight: 24,
20
20
  },
21
- selectedOptionText: {
22
- color: colorGrayscaleM,
23
- },
24
21
  });
25
22
  export { style };
@@ -1,4 +1,4 @@
1
- import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
1
+ import { COLOR, Text } from "@lookiero/aurora";
2
2
  import React from "react";
3
3
  import { View } from "react-native";
4
4
  import { useScreenSize } from "../../../hooks/useScreenSize";
@@ -15,8 +15,8 @@ const Toast = ({ body, title, onClose, testID, variant = ToastVariant.INFO, styl
15
15
  const screenSize = useScreenSize();
16
16
  return (React.createElement(View, { style: [style.toast, style[styleVariant(variant)], customStyle?.toast], testID: testID },
17
17
  React.createElement(View, { style: style.content },
18
- title && (React.createElement(Text, { level: screenSize === "S" ? 3 : 2, style: [style.title, customStyle?.title], testID: "toast-title", body: true }, title)),
19
- React.createElement(Text, { level: 2, style: [style.body, customStyle?.body], testID: "toast-body", detail: true }, body)),
18
+ title && (React.createElement(Text, { level: screenSize === "S" ? 3 : 2, style: [style.title, customStyle?.title], testID: "toast-title" }, title)),
19
+ React.createElement(Text, { color: COLOR.CONTENT, level: 2, style: customStyle?.body, testID: "toast-body", detail: true }, body)),
20
20
  onClose && (React.createElement(ButtonIcon, { name: "close", style: { button: [style.button, customStyle?.closeButton] }, testID: "toast-close-button", onPress: onClose }))));
21
21
  };
22
22
  export { Toast, ToastVariant };
@@ -1,7 +1,4 @@
1
1
  declare const style: {
2
- body: {
3
- color: string;
4
- };
5
2
  button: {
6
3
  marginLeft: number;
7
4
  padding: number;
@@ -26,7 +23,10 @@ declare const style: {
26
23
  alignItems: "flex-start";
27
24
  flexDirection: "row";
28
25
  shadowColor: string;
29
- shadowOffset: typeof import("@lookiero/aurora-next/build/theming/theme.default").DefaultTheme.$elevationOffset;
26
+ shadowOffset: {
27
+ width: number;
28
+ height: number;
29
+ };
30
30
  shadowOpacity: number;
31
31
  shadowRadius: number;
32
32
  };
@@ -1,10 +1,7 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
- const { colorAlert, colorInfo, colorAccent, colorContent, spaceS, spaceM, elevationColor, elevationOffset, elevationOpacityM, elevationRadius, } = theme();
3
+ const { colorAlert, colorInfo, colorAccent, spaceS, spaceM, elevationColor, elevationOffset, elevationOpacityM, elevationRadius, } = theme();
4
4
  const style = StyleSheet.create({
5
- body: {
6
- color: colorContent,
7
- },
8
5
  button: {
9
6
  marginLeft: spaceS,
10
7
  padding: spaceM,
@@ -1,4 +1,4 @@
1
- import { useDevice } from "@lookiero/aurora-next/build/hooks/useDevice/useDevice";
1
+ import { useDevice } from "@lookiero/aurora";
2
2
  const useScreenSize = () => {
3
3
  const { screen } = useDevice();
4
4
  const screenSize = Object.entries(screen)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "1.1.7",
3
+ "version": "1.2.0-beta.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -44,13 +44,13 @@
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@lookiero/aurora-fonts": "^1.0.6",
47
- "@lookiero/aurora-iconfont": "^2.0.37",
48
- "@lookiero/aurora-next": "^3.0.191",
47
+ "@lookiero/aurora-iconfont": "^2.0.41",
48
+ "@lookiero/aurora": "^3.1.0",
49
49
  "@lookiero/data-sources": "^0.3",
50
50
  "@lookiero/event": "^0.3",
51
51
  "@lookiero/locale": "^0.3",
52
- "@lookiero/payments-front": "^0.16.9",
53
- "@lookiero/user-tracking-front": "0.0.37",
52
+ "@lookiero/payments-front": "^1.0.2",
53
+ "@lookiero/user-tracking-front": "0.0.38",
54
54
  "apollo-boost": "0.4.4",
55
55
  "graphql": "16.6.0",
56
56
  "graphql-tag": "2.12.6",
@@ -67,11 +67,11 @@
67
67
  "@expo/webpack-config": "^0.17.2",
68
68
  "@lookiero/aurora-fonts": "^1.0.6",
69
69
  "@lookiero/aurora-iconfont": "^2.0.37",
70
- "@lookiero/aurora-next": "^3.0.191",
70
+ "@lookiero/aurora": "^3.1.0",
71
71
  "@lookiero/data-sources": "^0.3",
72
72
  "@lookiero/event": "^0.3",
73
73
  "@lookiero/locale": "^0.3",
74
- "@lookiero/payments-front": "^0.16.9",
74
+ "@lookiero/payments-front": "^1.0.2",
75
75
  "@lookiero/user-tracking-front": "0.0.37",
76
76
  "@pact-foundation/pact": "^10.1.4",
77
77
  "@pact-foundation/pact-node": "^10.17.6",