@lookiero/checkout 4.0.1-beta.1 → 4.0.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 (87) hide show
  1. package/dist/shared/tracking/infrastructure/useTrackCheckout.js +1 -1
  2. package/dist/shared/tracking/tracking.d.ts +1 -1
  3. package/package.json +1 -1
  4. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +0 -6
  5. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +0 -13
  6. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +0 -10
  7. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +0 -11
  8. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +0 -6
  9. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +0 -7
  10. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +0 -6
  11. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +0 -9
  12. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +0 -13
  13. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +0 -19
  14. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.d.ts +0 -6
  15. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.js +0 -7
  16. package/dist/infrastructure/ui/components/templates/header/header/Header.d.ts +0 -3
  17. package/dist/infrastructure/ui/components/templates/header/header/Header.js +0 -10
  18. package/dist/infrastructure/ui/components/templates/header/header/Header.style.d.ts +0 -9
  19. package/dist/infrastructure/ui/components/templates/header/header/Header.style.js +0 -12
  20. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.d.ts +0 -13
  21. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.js +0 -19
  22. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.style.ts.d.ts +0 -6
  23. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.style.ts.js +0 -7
  24. package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.d.ts +0 -2
  25. package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.js +0 -28
  26. package/dist/infrastructure/ui/hooks/useToast.d.ts +0 -11
  27. package/dist/infrastructure/ui/hooks/useToast.js +0 -49
  28. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +0 -7
  29. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +0 -25
  30. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +0 -16
  31. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +0 -19
  32. package/dist/infrastructure/ui/views/intro/Intro.d.ts +0 -6
  33. package/dist/infrastructure/ui/views/intro/Intro.js +0 -52
  34. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -52
  35. package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -55
  36. package/dist/infrastructure/ui/views/item/Item.style.d.ts +0 -15
  37. package/dist/infrastructure/ui/views/item/Item.style.js +0 -18
  38. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +0 -26
  39. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +0 -44
  40. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +0 -45
  41. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +0 -53
  42. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +0 -7
  43. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +0 -25
  44. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +0 -16
  45. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +0 -19
  46. package/dist/infrastructure/ui/views/navigation/Navigation.d.ts +0 -21
  47. package/dist/infrastructure/ui/views/navigation/Navigation.js +0 -45
  48. package/dist/infrastructure/ui/views/navigation/Navigation.style.d.ts +0 -5
  49. package/dist/infrastructure/ui/views/navigation/Navigation.style.js +0 -30
  50. package/dist/infrastructure/ui/views/navigation/components/header/Header.d.ts +0 -46
  51. package/dist/infrastructure/ui/views/navigation/components/header/Header.js +0 -120
  52. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.d.ts +0 -31
  53. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.js +0 -34
  54. package/dist/infrastructure/ui/views/navigation/components/header/Logo.d.ts +0 -7
  55. package/dist/infrastructure/ui/views/navigation/components/header/Logo.js +0 -11
  56. package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.d.ts +0 -7
  57. package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.js +0 -8
  58. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts +0 -12
  59. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +0 -24
  60. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.d.ts +0 -15
  61. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.js +0 -18
  62. package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +0 -17
  63. package/dist/shared/notifications/domain/notification/command/createNotification.js +0 -7
  64. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +0 -21
  65. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +0 -22
  66. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +0 -12
  67. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +0 -24
  68. package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +0 -9
  69. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +0 -20
  70. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +0 -36
  71. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +0 -31
  72. package/dist/shared/tracking/infrastructure/usePageView.d.ts +0 -13
  73. package/dist/shared/tracking/infrastructure/usePageView.js +0 -27
  74. package/dist/shared/ui/components/atoms/error/Error.style.d.ts +0 -6
  75. package/dist/shared/ui/components/atoms/error/Error.style.js +0 -9
  76. package/dist/shared/ui/components/layouts/slider/Bullets.d.ts +0 -10
  77. package/dist/shared/ui/components/layouts/slider/Bullets.js +0 -29
  78. package/dist/shared/ui/components/layouts/slider/Bullets.style.d.ts +0 -12
  79. package/dist/shared/ui/components/layouts/slider/Bullets.style.js +0 -15
  80. package/dist/shared/ui/components/layouts/slider/Pagination.d.ts +0 -14
  81. package/dist/shared/ui/components/layouts/slider/Pagination.js +0 -11
  82. package/dist/shared/ui/components/layouts/slider/Pagination.style.d.ts +0 -23
  83. package/dist/shared/ui/components/layouts/slider/Pagination.style.js +0 -27
  84. package/dist/shared/ui/components/layouts/slider/Slider.d.ts +0 -15
  85. package/dist/shared/ui/components/layouts/slider/Slider.js +0 -132
  86. package/dist/shared/ui/components/layouts/slider/Slider.style.d.ts +0 -11
  87. package/dist/shared/ui/components/layouts/slider/Slider.style.js +0 -12
@@ -1,8 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- const style = StyleSheet.create({
3
- logo: {
4
- height: 54,
5
- width: 217,
6
- },
7
- });
8
- export { style };
@@ -1,12 +0,0 @@
1
- import { FC } from "react";
2
- import { CheckoutItemProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
3
- import { Country } from "../../../../../../projection/shared/country";
4
- interface CheckoutItemsTabsProps {
5
- readonly checkoutItemsKept: CheckoutItemProjection[];
6
- readonly checkoutItemsReturned: CheckoutItemProjection[];
7
- readonly country: Country;
8
- readonly onPressItem: (checkoutItemId: string) => void;
9
- readonly onChanged?: (index: number) => void;
10
- }
11
- declare const CheckoutItemsTabs: FC<CheckoutItemsTabsProps>;
12
- export { CheckoutItemsTabs };
@@ -1,24 +0,0 @@
1
- import { Text } from "@lookiero/aurora";
2
- import { useI18nMessage } from "@lookiero/i18n-react";
3
- import React, { useCallback } from "react";
4
- import { View } from "react-native";
5
- import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
6
- import { Tabs } from "../../../../components/layouts/tabs/Tabs";
7
- import { I18nMessages } from "../../../../i18n/i18n";
8
- import { ProductVariant } from "../../../shared/components/productVariant/ProductVariant";
9
- import { style } from "./CheckoutItemsTabs.style";
10
- const CheckoutItem = ({ checkoutItemStatus, checkoutItemProductVariant, checkoutItemPrice, country, discarded = false, testID, style: customStyle, onPress, }) => (React.createElement(View, { style: style.checkoutItem, testID: testID },
11
- React.createElement(ProductVariant, { brand: checkoutItemProductVariant.brand, color: checkoutItemProductVariant.color, country: country, discarded: discarded, media: checkoutItemProductVariant.media, name: checkoutItemProductVariant.name, price: checkoutItemPrice, size: checkoutItemProductVariant.size, status: checkoutItemStatus, style: customStyle, onPress: onPress })));
12
- const CheckoutItemsTabs = ({ checkoutItemsKept, checkoutItemsReturned, country, onPressItem, onChanged, }) => {
13
- const keepTabText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_TAB });
14
- const returnTabText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_TAB });
15
- const keepEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_EMPTY });
16
- const returnEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_EMPTY });
17
- const handleOnPressItem = useCallback((checkoutItemId) => onPressItem(checkoutItemId), [onPressItem]);
18
- return (React.createElement(Tabs, { style: { sliderContainer: style.sliderContainer }, tabLabels: [`${keepTabText} (${checkoutItemsKept.length})`, `${returnTabText} (${checkoutItemsReturned.length})`], onChanged: onChanged },
19
- React.createElement(React.Fragment, null, checkoutItemsKept.length === 0 ? (React.createElement(Text, { style: style.emptyText }, keepEmptyText)) : (checkoutItemsKept.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemStatus: checkoutItem.status, country: country, testID: "keep-checkout-item", checkoutItemProductVariant: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
20
- ? checkoutItem.replacedFor
21
- : checkoutItem.productVariant, onPress: () => handleOnPressItem(checkoutItem.id) }))))),
22
- React.createElement(React.Fragment, null, checkoutItemsReturned.length === 0 ? (React.createElement(Text, { style: style.emptyText }, returnEmptyText)) : (checkoutItemsReturned.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemProductVariant: checkoutItem.productVariant, checkoutItemStatus: checkoutItem.status, country: country, style: { image: style.returnCheckoutItem }, testID: "return-checkout-item", discarded: true, onPress: () => handleOnPressItem(checkoutItem.id) })))))));
23
- };
24
- export { CheckoutItemsTabs };
@@ -1,15 +0,0 @@
1
- declare const style: {
2
- checkoutItem: {
3
- paddingVertical: number;
4
- };
5
- emptyText: {
6
- paddingTop: number;
7
- };
8
- returnCheckoutItem: {
9
- borderColor: string;
10
- };
11
- sliderContainer: {
12
- paddingHorizontal: number;
13
- };
14
- };
15
- export { style };
@@ -1,18 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "../../../../theme/theme";
3
- const { colorContent, spaceM, spaceXL } = theme();
4
- const style = StyleSheet.create({
5
- checkoutItem: {
6
- paddingVertical: spaceM,
7
- },
8
- emptyText: {
9
- paddingTop: spaceM,
10
- },
11
- returnCheckoutItem: {
12
- borderColor: colorContent,
13
- },
14
- sliderContainer: {
15
- paddingHorizontal: spaceXL,
16
- },
17
- });
18
- export { style };
@@ -1,17 +0,0 @@
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 };
@@ -1,7 +0,0 @@
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 };
@@ -1,21 +0,0 @@
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 };
@@ -1,22 +0,0 @@
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 };
@@ -1,12 +0,0 @@
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 };
@@ -1,24 +0,0 @@
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 };
@@ -1,9 +0,0 @@
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 };
@@ -1,20 +0,0 @@
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 };
@@ -1,36 +0,0 @@
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 };
@@ -1,31 +0,0 @@
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,13 +0,0 @@
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 };
@@ -1,27 +0,0 @@
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,6 +0,0 @@
1
- declare const style: {
2
- error: {
3
- color: string;
4
- };
5
- };
6
- export { style };
@@ -1,9 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
- const { colorPrimary } = theme();
4
- const style = StyleSheet.create({
5
- error: {
6
- color: colorPrimary,
7
- },
8
- });
9
- export { style };
@@ -1,10 +0,0 @@
1
- import { FC } from "react";
2
- interface BulletsProps {
3
- readonly activeIndex: number;
4
- readonly onChange: (index: number) => void;
5
- readonly count: number;
6
- readonly maxBullets?: number;
7
- readonly testID?: string;
8
- }
9
- declare const Bullets: FC<BulletsProps>;
10
- export { Bullets };
@@ -1,29 +0,0 @@
1
- import { animated, useSpring } from "@react-spring/native";
2
- import React from "react";
3
- import { TouchableHighlight, View } from "react-native";
4
- import { theme } from "../../../../../infrastructure/ui/theme/theme";
5
- import { style } from "./Bullets.style";
6
- const { colorContent, colorGrayscaleM } = theme();
7
- const colorTransparent = "rgba(0,0,0,0)";
8
- const MAX = 7;
9
- const DIAMETER_MAX = 8;
10
- const DIAMETER_MIN = 2;
11
- const Bullet = ({ index, activeIndex, maxBullets, onChange }) => {
12
- const pivot = Math.floor(maxBullets / 2) + 1;
13
- const delta = Math.abs(index - activeIndex);
14
- const diameter = delta > 1 ? DIAMETER_MAX - delta * DIAMETER_MIN : DIAMETER_MAX;
15
- const color = delta === 0 ? colorContent : colorGrayscaleM;
16
- const springs = useSpring({ diameter, color });
17
- return delta >= pivot ? null : (React.createElement(TouchableHighlight, { underlayColor: colorTransparent, onPress: () => onChange(index) },
18
- React.createElement(animated.View, { accessibilityState: { selected: delta === 0 }, testID: "bullet", style: [
19
- style.bullet,
20
- {
21
- width: springs.diameter,
22
- height: springs.diameter,
23
- backgroundColor: springs.color,
24
- borderRadius: springs.diameter,
25
- },
26
- ] })));
27
- };
28
- const Bullets = ({ activeIndex, count, maxBullets = MAX, onChange, testID = "bullets" }) => (React.createElement(View, { style: style.bullets, testID: testID }, [...Array(count).keys()].map((index) => (React.createElement(Bullet, { key: index, activeIndex: activeIndex, index: index, maxBullets: maxBullets, onChange: onChange })))));
29
- export { Bullets };
@@ -1,12 +0,0 @@
1
- declare const style: {
2
- bullet: {
3
- marginHorizontal: number;
4
- };
5
- bullets: {
6
- alignItems: "center";
7
- flexDirection: "row";
8
- justifyContent: "center";
9
- paddingVertical: number;
10
- };
11
- };
12
- export { style };
@@ -1,15 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
- const { spaceM } = theme();
4
- const style = StyleSheet.create({
5
- bullet: {
6
- marginHorizontal: 3,
7
- },
8
- bullets: {
9
- alignItems: "center",
10
- flexDirection: "row",
11
- justifyContent: "center",
12
- paddingVertical: spaceM,
13
- },
14
- });
15
- export { style };
@@ -1,14 +0,0 @@
1
- import { FC, ReactNode } from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
3
- interface PaginationProps {
4
- readonly touchable?: boolean;
5
- readonly paginationStyle?: StyleProp<ViewStyle>;
6
- readonly paginationItemStyle?: StyleProp<ViewStyle>;
7
- readonly paginationActiveItemStyle?: StyleProp<ViewStyle>;
8
- readonly count?: number;
9
- readonly activeIndex?: number;
10
- readonly onChange: (index: number) => void;
11
- readonly renderItem?: (index: number) => ReactNode;
12
- }
13
- declare const Pagination: FC<PaginationProps>;
14
- export { Pagination };
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- import { Pressable, View } from "react-native";
3
- import { style } from "./Pagination.style";
4
- const Pagination = ({ touchable = true, paginationStyle, paginationItemStyle, paginationActiveItemStyle, count = 0, activeIndex = 0, renderItem, onChange, }) => (React.createElement(View, { style: [style.paginationWrapper, paginationStyle], testID: "slider-pagination" }, Array.from(Array(count).keys()).map((index) => (React.createElement(View, { key: index, style: style.paginationContainer },
5
- React.createElement(Pressable, { testID: "slider-pagination-item", style: [
6
- style.paginationItem,
7
- activeIndex === index && style.active,
8
- paginationItemStyle,
9
- activeIndex === index && paginationActiveItemStyle,
10
- ], onPress: !touchable ? undefined : () => onChange(index) }, renderItem?.(index)))))));
11
- export { Pagination };
@@ -1,23 +0,0 @@
1
- declare const style: {
2
- active: {
3
- backgroundColor: string;
4
- };
5
- paginationContainer: {
6
- margin: number;
7
- };
8
- paginationItem: {
9
- backgroundColor: string;
10
- borderRadius: number;
11
- height: number;
12
- width: number;
13
- };
14
- paginationWrapper: {
15
- alignItems: "center";
16
- bottom: number;
17
- flexDirection: "row";
18
- justifyContent: "center";
19
- position: "absolute";
20
- width: string;
21
- };
22
- };
23
- export { style };
@@ -1,27 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
- const { colorGrayscaleS, colorGrayscaleXL } = theme();
4
- const DOT_SIZE = 8;
5
- const style = StyleSheet.create({
6
- active: {
7
- backgroundColor: colorGrayscaleXL,
8
- },
9
- paginationContainer: {
10
- margin: 3,
11
- },
12
- paginationItem: {
13
- backgroundColor: colorGrayscaleS,
14
- borderRadius: DOT_SIZE / 2,
15
- height: DOT_SIZE,
16
- width: DOT_SIZE,
17
- },
18
- paginationWrapper: {
19
- alignItems: "center",
20
- bottom: 10,
21
- flexDirection: "row",
22
- justifyContent: "center",
23
- position: "absolute",
24
- width: "100%",
25
- },
26
- });
27
- export { style };
@@ -1,15 +0,0 @@
1
- import { FC, ReactNode } from "react";
2
- interface SliderProps {
3
- readonly children: ReactNode[];
4
- readonly active?: number;
5
- readonly loop?: boolean;
6
- readonly minDistanceToCapture?: number;
7
- readonly minDistanceForAction?: number;
8
- readonly gesturesEnabled?: boolean;
9
- readonly paginationEnabled?: boolean;
10
- readonly onSliderStart?: () => void;
11
- readonly onSliderEnd?: () => void;
12
- readonly onChanged?: (index: number) => void;
13
- }
14
- declare const Slider: FC<SliderProps>;
15
- export { Slider };