@lookiero/checkout 3.8.0-beta.1 → 3.8.0-beta.11

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 (127) hide show
  1. package/dist/infrastructure/projection/checkout/checkout.js +14 -0
  2. package/dist/infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef.d.ts +15 -0
  3. package/dist/infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef.js +14 -0
  4. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.js +1 -1
  5. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/CheckoutQuestionItem.d.ts +0 -1
  6. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +2 -2
  7. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.js +3 -3
  8. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +2 -2
  9. package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +1 -1
  10. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +0 -1
  11. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -2
  12. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -2
  13. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +2 -2
  14. package/dist/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +1 -1
  15. package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +4 -6
  16. package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +3 -10
  17. package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +3 -10
  18. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.js +3 -4
  19. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.d.ts +0 -3
  20. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.js +0 -3
  21. package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +9 -10
  22. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.d.ts +0 -1
  23. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.js +0 -1
  24. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +2 -3
  25. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -3
  26. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -3
  27. package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +3 -4
  28. package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.d.ts +3 -10
  29. package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.js +3 -10
  30. package/dist/infrastructure/ui/views/item/views/productVariant/ProductVariant.style.js +1 -1
  31. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +5 -6
  32. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.d.ts +0 -6
  33. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.js +0 -6
  34. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.js +3 -4
  35. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.d.ts +3 -10
  36. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.js +3 -10
  37. package/dist/shared/ui/components/atoms/input/Input.js +2 -2
  38. package/dist/shared/ui/components/layouts/carousel/Carousel.d.ts +11 -0
  39. package/dist/shared/ui/components/layouts/carousel/Carousel.js +31 -0
  40. package/dist/shared/ui/components/layouts/carousel/Carousel.style.d.ts +15 -0
  41. package/dist/shared/ui/components/layouts/carousel/Carousel.style.js +7 -0
  42. package/dist/shared/ui/components/layouts/carousel/Carousel2.d.ts +25 -0
  43. package/dist/shared/ui/components/layouts/carousel/Carousel2.js +67 -0
  44. package/dist/shared/ui/components/layouts/carousel/DragComponent.d.ts +3 -0
  45. package/dist/shared/ui/components/layouts/carousel/DragComponent.js +48 -0
  46. package/dist/shared/ui/components/layouts/modal/Modal.js +1 -1
  47. package/dist/shared/ui/components/layouts/slider/Bullets.js +3 -4
  48. package/dist/shared/ui/components/layouts/slider/Bullets2.d.ts +10 -0
  49. package/dist/shared/ui/components/layouts/slider/Bullets2.js +30 -0
  50. package/dist/shared/ui/components/layouts/slider/SliderDots.d.ts +8 -0
  51. package/dist/shared/ui/components/layouts/slider/SliderDots.js +16 -0
  52. package/dist/shared/ui/components/layouts/slider/SliderDots.style.d.ts +12 -0
  53. package/dist/shared/ui/components/layouts/slider/SliderDots.style.js +15 -0
  54. package/dist/shared/ui/components/molecules/selectField/SelectField.js +3 -3
  55. package/package.json +7 -1
  56. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +0 -6
  57. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +0 -13
  58. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +0 -10
  59. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +0 -11
  60. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +0 -6
  61. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +0 -7
  62. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +0 -6
  63. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +0 -9
  64. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +0 -13
  65. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +0 -19
  66. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.d.ts +0 -6
  67. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.js +0 -7
  68. package/dist/infrastructure/ui/components/templates/header/header/Header.d.ts +0 -3
  69. package/dist/infrastructure/ui/components/templates/header/header/Header.js +0 -10
  70. package/dist/infrastructure/ui/components/templates/header/header/Header.style.d.ts +0 -9
  71. package/dist/infrastructure/ui/components/templates/header/header/Header.style.js +0 -12
  72. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.d.ts +0 -13
  73. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.js +0 -19
  74. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.style.ts.d.ts +0 -6
  75. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.style.ts.js +0 -7
  76. package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.d.ts +0 -2
  77. package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.js +0 -28
  78. package/dist/infrastructure/ui/hooks/useToast.d.ts +0 -11
  79. package/dist/infrastructure/ui/hooks/useToast.js +0 -49
  80. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +0 -7
  81. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +0 -25
  82. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +0 -16
  83. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +0 -19
  84. package/dist/infrastructure/ui/views/intro/Intro.d.ts +0 -6
  85. package/dist/infrastructure/ui/views/intro/Intro.js +0 -52
  86. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -52
  87. package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -55
  88. package/dist/infrastructure/ui/views/item/Item.style.d.ts +0 -15
  89. package/dist/infrastructure/ui/views/item/Item.style.js +0 -18
  90. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +0 -26
  91. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +0 -44
  92. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +0 -45
  93. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +0 -53
  94. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +0 -7
  95. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +0 -25
  96. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +0 -16
  97. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +0 -19
  98. package/dist/infrastructure/ui/views/navigation/Navigation.d.ts +0 -21
  99. package/dist/infrastructure/ui/views/navigation/Navigation.js +0 -45
  100. package/dist/infrastructure/ui/views/navigation/Navigation.style.d.ts +0 -5
  101. package/dist/infrastructure/ui/views/navigation/Navigation.style.js +0 -30
  102. package/dist/infrastructure/ui/views/navigation/components/header/Header.d.ts +0 -46
  103. package/dist/infrastructure/ui/views/navigation/components/header/Header.js +0 -120
  104. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.d.ts +0 -31
  105. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.js +0 -34
  106. package/dist/infrastructure/ui/views/navigation/components/header/Logo.d.ts +0 -7
  107. package/dist/infrastructure/ui/views/navigation/components/header/Logo.js +0 -11
  108. package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.d.ts +0 -7
  109. package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.js +0 -8
  110. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts +0 -12
  111. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +0 -24
  112. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.d.ts +0 -15
  113. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.js +0 -18
  114. package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +0 -17
  115. package/dist/shared/notifications/domain/notification/command/createNotification.js +0 -7
  116. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +0 -21
  117. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +0 -22
  118. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +0 -12
  119. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +0 -24
  120. package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +0 -9
  121. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +0 -20
  122. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +0 -36
  123. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +0 -31
  124. package/dist/shared/tracking/infrastructure/usePageView.d.ts +0 -13
  125. package/dist/shared/tracking/infrastructure/usePageView.js +0 -27
  126. package/dist/shared/ui/components/atoms/error/Error.style.d.ts +0 -6
  127. package/dist/shared/ui/components/atoms/error/Error.style.js +0 -9
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { TCarouselProps } from "react-native-reanimated-carousel";
3
+ type CarouselRenderItem<T> = TCarouselProps<T>["renderItem"];
4
+ interface CarouselProps<T> {
5
+ readonly data: T[];
6
+ readonly children: CarouselRenderItem<T>;
7
+ readonly onActiveIndexChanged?: (index: number) => void;
8
+ }
9
+ declare const Carousel: <T>({ data, children, onActiveIndexChanged }: CarouselProps<T>) => JSX.Element;
10
+ export type { CarouselRenderItem };
11
+ export { Carousel };
@@ -0,0 +1,31 @@
1
+ import React, { useCallback, useRef, useState } from "react";
2
+ import { View } from "react-native";
3
+ import { GestureHandlerRootView } from "react-native-gesture-handler";
4
+ import RNRCarousel from "react-native-reanimated-carousel";
5
+ import { Bullets } from "../slider/Bullets";
6
+ const Carousel = ({ data, children, onActiveIndexChanged }) => {
7
+ const [carouselDimensions, setCarouselDimensions] = useState();
8
+ const handleOnLayout = useCallback(({ nativeEvent: { layout: { width, height }, }, }) => setCarouselDimensions({ width, height }), []);
9
+ const ref = React.useRef(null);
10
+ const [activeIndex, setActiveIndex] = useState(0);
11
+ const activeIndexRef = useRef(activeIndex);
12
+ activeIndexRef.current = activeIndex;
13
+ const handleOnActiveChanged = useCallback((index) => ref.current?.scrollTo({ index, animated: true }), []);
14
+ const handleOnProgressChanged = useCallback(
15
+ // eslint-disable-next-line @typescript-eslint/naming-convention
16
+ (_offsetProgress, absoluteProgress) => {
17
+ const index = Math.round(absoluteProgress);
18
+ if (activeIndexRef.current === index) {
19
+ return;
20
+ }
21
+ setActiveIndex(index);
22
+ onActiveIndexChanged?.(index);
23
+ }, [onActiveIndexChanged]);
24
+ return (React.createElement(React.Fragment, null,
25
+ React.createElement(View, { style: { flex: 1 }, onLayout: handleOnLayout }, carouselDimensions && (React.createElement(GestureHandlerRootView, { style: { flex: 1 } },
26
+ React.createElement(RNRCarousel, { ref: ref, data: data, height: carouselDimensions.height, loop: false, renderItem: children, width: carouselDimensions.width, panGestureHandlerProps: {
27
+ activeOffsetX: [-10, 10],
28
+ }, onProgressChange: handleOnProgressChanged })))),
29
+ React.createElement(Bullets, { activeIndex: activeIndex, count: data.length, onChange: handleOnActiveChanged })));
30
+ };
31
+ export { Carousel };
@@ -0,0 +1,15 @@
1
+ declare const style: {
2
+ carousel: {
3
+ flex: number;
4
+ flexDirection: "row";
5
+ height: string;
6
+ };
7
+ carouselItem: {
8
+ flex: number;
9
+ };
10
+ container: {
11
+ flex: number;
12
+ overflow: "hidden";
13
+ };
14
+ };
15
+ export { style };
@@ -0,0 +1,7 @@
1
+ import { StyleSheet } from "react-native";
2
+ const style = StyleSheet.create({
3
+ carousel: { flex: 1, flexDirection: "row", height: "100%" },
4
+ carouselItem: { flex: 1 },
5
+ container: { flex: 1, overflow: "hidden" },
6
+ });
7
+ export { style };
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ interface RenderItemFunctionArgs<T> {
3
+ readonly item: T;
4
+ readonly index: number;
5
+ }
6
+ interface RenderItemFunction<T> {
7
+ (args: RenderItemFunctionArgs<T>): JSX.Element;
8
+ }
9
+ interface RenderBulletsFunctionArgs {
10
+ readonly activeIndex: number;
11
+ readonly count: number;
12
+ readonly onChange: (index: number) => void;
13
+ }
14
+ interface RenderBulletsFunction {
15
+ (args: RenderBulletsFunctionArgs): JSX.Element;
16
+ }
17
+ interface CarouselProps<T> {
18
+ readonly data: T[];
19
+ readonly children: RenderItemFunction<T>;
20
+ readonly bullets: RenderBulletsFunction;
21
+ readonly onActiveIndexChanged?: (index: number) => void;
22
+ }
23
+ declare const Carousel2: <T>({ data, children, bullets, onActiveIndexChanged }: CarouselProps<T>) => JSX.Element;
24
+ export type { RenderItemFunction, RenderBulletsFunction };
25
+ export { Carousel2 };
@@ -0,0 +1,67 @@
1
+ import { clamp } from "@react-spring/shared";
2
+ import React, { useCallback, useMemo, useRef, useState } from "react";
3
+ import { View } from "react-native";
4
+ import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
5
+ import Animated, { useSharedValue, withSpring, useAnimatedStyle, runOnJS } from "react-native-reanimated";
6
+ import { style } from "./Carousel.style";
7
+ const SPRING_CONFIG = {
8
+ damping: 25,
9
+ mass: 1,
10
+ stiffness: 300,
11
+ };
12
+ const Carousel2 = ({ data, children, bullets, onActiveIndexChanged }) => {
13
+ const [carouselDimensions, setCarouselDimensions] = useState({
14
+ width: 0,
15
+ height: 0,
16
+ });
17
+ const handleOnLayout = useCallback(({ nativeEvent: { layout: { width, height }, }, }) => setCarouselDimensions({ width, height }), []);
18
+ const [activeIndex, setActiveIndex] = useState(0);
19
+ const activeIndexRef = useRef(activeIndex);
20
+ activeIndexRef.current = activeIndex;
21
+ const updateActiveIndex = useCallback((index) => {
22
+ if (activeIndexRef.current === index) {
23
+ return;
24
+ }
25
+ setActiveIndex(index);
26
+ onActiveIndexChanged?.(index);
27
+ }, [onActiveIndexChanged]);
28
+ const panTranslationX = useSharedValue(0);
29
+ const panInitialTranslationX = useSharedValue(0);
30
+ const handleOnActiveIndexChanged = useCallback((index) => {
31
+ updateActiveIndex(index);
32
+ panTranslationX.value = withSpring(-index * carouselDimensions.width, SPRING_CONFIG);
33
+ }, [carouselDimensions.width, panTranslationX, updateActiveIndex]);
34
+ const panGesture = useMemo(() => Gesture.Pan()
35
+ .maxPointers(1)
36
+ .activeOffsetX([-20, 20])
37
+ .failOffsetY([-20, 20])
38
+ // This method does not work if legacy implementation is enabled
39
+ // Expo.tsx => enableLegacyWebImplementation(true)
40
+ // .onStart(() => {
41
+ // panInitialTranslationX.value = panTranslationX.value;
42
+ // })
43
+ // This method is defined as legacy implementation is enabled
44
+ .onBegin(() => {
45
+ panInitialTranslationX.value = panTranslationX.value;
46
+ })
47
+ .onUpdate(({ translationX }) => {
48
+ const tX = panInitialTranslationX.value + translationX;
49
+ const index = clamp(0, data.length - 1, Math.round(-tX / carouselDimensions.width));
50
+ panTranslationX.value = tX;
51
+ runOnJS(updateActiveIndex)(index);
52
+ })
53
+ .onEnd(({ translationX }) => {
54
+ const tX = panInitialTranslationX.value + translationX;
55
+ const index = clamp(0, data.length - 1, Math.round(-tX / carouselDimensions.width));
56
+ panTranslationX.value = withSpring(-index * carouselDimensions.width, SPRING_CONFIG);
57
+ }), [carouselDimensions.width, data.length, panInitialTranslationX, panTranslationX, updateActiveIndex]);
58
+ const animatedStyle = useAnimatedStyle(() => ({ transform: [{ translateX: panTranslationX.value }] }), [panTranslationX]);
59
+ return (React.createElement(React.Fragment, null,
60
+ React.createElement(View, { style: style.container, onLayout: handleOnLayout },
61
+ React.createElement(GestureHandlerRootView, { style: { flex: 1 } },
62
+ React.createElement(GestureDetector, { gesture: panGesture },
63
+ React.createElement(View, { style: { flex: 1 } },
64
+ React.createElement(Animated.View, { style: [style.carousel, { width: carouselDimensions.width * data.length }, animatedStyle] }, data.map((item, index) => (React.createElement(View, { key: index, style: [style.carouselItem, { width: carouselDimensions.width }] }, children({ index, item }))))))))),
65
+ bullets({ activeIndex, count: data.length, onChange: handleOnActiveIndexChanged })));
66
+ };
67
+ export { Carousel2 };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const DragComponent: (props: any) => JSX.Element;
3
+ export { DragComponent };
@@ -0,0 +1,48 @@
1
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
2
+ import React from "react";
3
+ import { View } from "react-native";
4
+ import { Gesture, GestureDetector } from "react-native-gesture-handler";
5
+ import { useSharedValue } from "react-native-reanimated";
6
+ import { useScrollViewRef } from "../../../../../infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef";
7
+ const TOUCH_SLOP = 5;
8
+ const TIME_TO_ACTIVATE_PAN = 400;
9
+ // @ts-ignore
10
+ const DragComponent = (props) => {
11
+ const { scrollViewRef, panGestureRef } = useScrollViewRef();
12
+ const touchStart = useSharedValue({ x: 0, y: 0, time: 0 });
13
+ const gesture = Gesture.Pan()
14
+ .manualActivation(true)
15
+ .onTouchesDown((e) => {
16
+ touchStart.value = {
17
+ // @ts-ignore
18
+ x: e.changedTouches[0].x,
19
+ // @ts-ignore
20
+ y: e.changedTouches[0].y,
21
+ time: Date.now(),
22
+ };
23
+ })
24
+ .onTouchesMove((e, state) => {
25
+ if (Date.now() - touchStart.value.time > TIME_TO_ACTIVATE_PAN) {
26
+ state.activate();
27
+ console.log("activate");
28
+ }
29
+ else if (
30
+ // @ts-ignore
31
+ Math.abs(touchStart.value.x - e.changedTouches[0].x) > TOUCH_SLOP ||
32
+ // @ts-ignore
33
+ Math.abs(touchStart.value.y - e.changedTouches[0].y) > TOUCH_SLOP) {
34
+ state.fail();
35
+ console.log("fail");
36
+ }
37
+ })
38
+ .onUpdate(() => {
39
+ console.log("pan update");
40
+ })
41
+ // @ts-ignore
42
+ .simultaneousWithExternalGesture(scrollViewRef)
43
+ // @ts-ignore
44
+ .withRef(panGestureRef);
45
+ return (React.createElement(GestureDetector, { gesture: gesture },
46
+ React.createElement(View, null, props.children)));
47
+ };
48
+ export { DragComponent };
@@ -75,7 +75,7 @@ const Modal = ({ children, visible, header, footer, portalHostName, onClose, sho
75
75
  (header || showCloseButton) && (React.createElement(View, { style: [style.header, customStyle?.header] },
76
76
  React.createElement(View, null, header),
77
77
  showCloseButton && (React.createElement(ButtonIcon, { name: "close", style: { button: customStyle?.closeButton }, onPress: onClose })))),
78
- React.createElement(ModalContentView, { keyboardShouldPersistTaps: "handled" },
78
+ React.createElement(ModalContentView, null,
79
79
  React.createElement(View, { style: {
80
80
  paddingBottom: safeAreaInsetBottom +
81
81
  (Platform.OS !== "ios" ? spaceXL : 0) +
@@ -1,11 +1,10 @@
1
1
  import { animated, useSpring } from "@react-spring/native";
2
2
  import React from "react";
3
- import { TouchableHighlight, View } from "react-native";
3
+ import { View, Pressable } from "react-native";
4
4
  import { theme } from "../../../../../infrastructure/ui/theme/theme";
5
5
  import { style } from "./Bullets.style";
6
6
  const { colorContent, colorGrayscaleM } = theme();
7
- const colorTransparent = "rgba(0,0,0,0)";
8
- const MAX = 7;
7
+ const MAX = 5;
9
8
  const DIAMETER_MAX = 8;
10
9
  const DIAMETER_MIN = 2;
11
10
  const Bullet = ({ index, activeIndex, maxBullets, onChange }) => {
@@ -14,7 +13,7 @@ const Bullet = ({ index, activeIndex, maxBullets, onChange }) => {
14
13
  const diameter = delta > 1 ? DIAMETER_MAX - delta * DIAMETER_MIN : DIAMETER_MAX;
15
14
  const color = delta === 0 ? colorContent : colorGrayscaleM;
16
15
  const springs = useSpring({ diameter, color });
17
- return delta >= pivot ? null : (React.createElement(TouchableHighlight, { underlayColor: colorTransparent, onPress: () => onChange(index) },
16
+ return delta >= pivot ? null : (React.createElement(Pressable, { onPress: () => onChange(index) },
18
17
  React.createElement(animated.View, { accessibilityState: { selected: delta === 0 }, testID: "bullet", style: [
19
18
  style.bullet,
20
19
  {
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,30 @@
1
+ import React, { useEffect } from "react";
2
+ import { View, Pressable } from "react-native";
3
+ import Animated, { useAnimatedStyle, useDerivedValue, useSharedValue } from "react-native-reanimated";
4
+ import { withSpring } from "react-native-reanimated";
5
+ import { theme } from "../../../../../infrastructure/ui/theme/theme";
6
+ import { style } from "./Bullets.style";
7
+ const { colorContent, colorGrayscaleM } = theme();
8
+ const MAX = 5;
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 delta = useSharedValue(0);
15
+ useEffect(() => {
16
+ delta.value = Math.abs(index - activeIndex);
17
+ }, [activeIndex, delta, index]);
18
+ const diameter = useDerivedValue(() => withSpring(delta.value > 1 ? DIAMETER_MAX - delta.value * DIAMETER_MIN : DIAMETER_MAX), [delta]);
19
+ const color = useDerivedValue(() => withSpring(delta.value === 0 ? colorContent : colorGrayscaleM), [delta]);
20
+ const animatedStyle = useAnimatedStyle(() => ({
21
+ width: diameter.value,
22
+ height: diameter.value,
23
+ backgroundColor: color.value,
24
+ borderRadius: diameter.value,
25
+ }), [diameter, color]);
26
+ return delta.value >= pivot ? null : (React.createElement(Pressable, { onPress: () => onChange(index) },
27
+ React.createElement(Animated.View, { accessibilityState: { selected: delta.value === 0 }, style: [style.bullet, animatedStyle], testID: "bullet" })));
28
+ };
29
+ 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 })))));
30
+ export { Bullets };
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ interface SliderDotsProps {
3
+ readonly count: number;
4
+ readonly index: number;
5
+ readonly onChange: (index: number) => void;
6
+ }
7
+ declare const SliderDots: FC<SliderDotsProps>;
8
+ export { SliderDots };
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { TouchableWithoutFeedback, View } from "react-native";
3
+ import { theme } from "../../../../../infrastructure/ui/theme/theme";
4
+ import { style } from "./SliderDots.style";
5
+ const { colorContent } = theme();
6
+ const SliderDot = ({ diameter, color }) => (React.createElement(View, { style: [style.sliderDot, { width: diameter, height: diameter, backgroundColor: color, borderRadius: diameter }] }));
7
+ const SliderDots = () => {
8
+ return (React.createElement(View, { style: style.sliderDots },
9
+ React.createElement(TouchableWithoutFeedback, null,
10
+ React.createElement(SliderDot, { color: colorContent, diameter: 8 })),
11
+ React.createElement(TouchableWithoutFeedback, null,
12
+ React.createElement(SliderDot, { color: colorContent, diameter: 8 })),
13
+ React.createElement(TouchableWithoutFeedback, null,
14
+ React.createElement(SliderDot, { color: colorContent, diameter: 8 }))));
15
+ };
16
+ export { SliderDots };
@@ -0,0 +1,12 @@
1
+ declare const style: {
2
+ sliderDot: {
3
+ marginHorizontal: number;
4
+ };
5
+ sliderDots: {
6
+ alignItems: "center";
7
+ flexDirection: "row";
8
+ justifyContent: "center";
9
+ paddingVertical: number;
10
+ };
11
+ };
12
+ export { style };
@@ -0,0 +1,15 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "../../../../../infrastructure/ui/theme/theme";
3
+ const { spaceM } = theme();
4
+ const style = StyleSheet.create({
5
+ sliderDot: {
6
+ marginHorizontal: 3,
7
+ },
8
+ sliderDots: {
9
+ alignItems: "center",
10
+ flexDirection: "row",
11
+ justifyContent: "center",
12
+ paddingVertical: spaceM,
13
+ },
14
+ });
15
+ export { style };
@@ -6,7 +6,7 @@ import { Modal } from "../../layouts/modal/Modal";
6
6
  import { InputField } from "../inputField/InputField";
7
7
  import { style } from "./SelectField.style";
8
8
  const { colorGrayscaleS } = theme();
9
- const SelectField = ({ title, placeholder, value, options, style: customStyle, onChange = () => void 0, testID, ...touchableRestProps }) => {
9
+ const SelectField = ({ title, placeholder, value, options, style: customStyle, onChange = () => void 0, ...touchableRestProps }) => {
10
10
  const [modalVisible, setModalVisible] = useState(false);
11
11
  const handleOnPressSelectField = useCallback(() => setModalVisible(true), []);
12
12
  const handleOnModalClose = useCallback(() => setModalVisible(false), []);
@@ -16,13 +16,13 @@ const SelectField = ({ title, placeholder, value, options, style: customStyle, o
16
16
  }, [handleOnModalClose, onChange]);
17
17
  const selectedValue = useMemo(() => options.find((option) => option.value === value), [options, value]);
18
18
  return (React.createElement(React.Fragment, null,
19
- React.createElement(TouchableHighlight, { accessibilityLabel: testID, style: customStyle?.selectField, testID: testID, underlayColor: colorGrayscaleS, accessible: true, onPress: handleOnPressSelectField, ...touchableRestProps },
19
+ React.createElement(TouchableHighlight, { style: customStyle?.selectField, underlayColor: colorGrayscaleS, onPress: handleOnPressSelectField, ...touchableRestProps },
20
20
  React.createElement(View, { pointerEvents: "none" },
21
21
  React.createElement(InputField, { editable: false, icon: "arrow-down", label: placeholder, style: customStyle?.inputField, value: selectedValue?.label }))),
22
22
  React.createElement(Modal, { testID: "select-field-modal", visible: modalVisible, scroll: true, showCloseButton: true, onClose: handleOnModalClose },
23
23
  React.createElement(View, { style: [style.modalContent, customStyle?.modalContent] },
24
24
  title && (React.createElement(Text, { level: 2, style: style.modalTitle }, title)),
25
- options.map(({ label, value: optionValue }) => (React.createElement(TouchableHighlight, { key: optionValue, accessibilityLabel: optionValue, disabled: value === optionValue, style: [style.option, customStyle?.option], testID: optionValue, underlayColor: colorGrayscaleS, accessible: true, onPress: value !== optionValue ? () => handleOnPressOption(optionValue) : undefined },
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
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "3.8.0-beta.1",
3
+ "version": "3.8.0-beta.11",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -57,8 +57,11 @@
57
57
  "react": "^18.2.0",
58
58
  "react-dom": "^18.2.0",
59
59
  "react-native": "^0.71.4",
60
+ "react-native-gesture-handler": "^2.12.0",
60
61
  "react-native-get-random-values": "^1.8.0",
61
62
  "react-native-web": "^0.18.11",
63
+ "react-native-reanimated": "^3.0.0",
64
+ "react-native-reanimated-carousel": "^3.4.0",
62
65
  "react-router-dom": "^6.8.1",
63
66
  "react-router-native": "^6.8.1"
64
67
  },
@@ -116,8 +119,11 @@
116
119
  "react-error-overlay": "^6.0.9",
117
120
  "react-native": "^0.71.3",
118
121
  "react-native-adjust": "^4.33.0",
122
+ "react-native-gesture-handler": "^2.12.0",
119
123
  "react-native-get-random-values": "^1.8.0",
120
124
  "react-native-web": "^0.18.11",
125
+ "react-native-reanimated": "^3.0.0",
126
+ "react-native-reanimated-carousel": "^3.4.0",
121
127
  "react-router-dom": "^6.8.1",
122
128
  "react-router-native": "^6.8.1",
123
129
  "react-test-renderer": "^18.0.0",
@@ -1,6 +0,0 @@
1
- import { ProcessManagerFunction } from "@lookiero/messaging";
2
- import { CheckoutBookingExpired } from "../model/checkoutBookingExpired";
3
- interface CreateNotificationWhenCheckoutBookingExpiredFunction extends ProcessManagerFunction<CheckoutBookingExpired> {
4
- }
5
- declare const createNotificationWhenCheckoutBookingExpired: CreateNotificationWhenCheckoutBookingExpiredFunction;
6
- export { createNotificationWhenCheckoutBookingExpired };
@@ -1,13 +0,0 @@
1
- import { v4 as uuid } from "uuid";
2
- import { I18nMessages } from "../../../infrastructure/ui/i18n/i18n";
3
- import { createNotification } from "../../../shared/notifications/domain/notification/command/createNotification";
4
- import { NotificationLevel } from "../../../shared/notifications/domain/notification/model/notification";
5
- const createNotificationWhenCheckoutBookingExpired = ({ commandBus }) => async () => {
6
- await commandBus(createNotification({
7
- aggregateId: uuid(),
8
- level: NotificationLevel.ERROR,
9
- titleI18nKey: undefined,
10
- bodyI18nKey: I18nMessages.CHECKOUT_TOAST_BOOKING_EXPIRED,
11
- }));
12
- };
13
- export { createNotificationWhenCheckoutBookingExpired };
@@ -1,10 +0,0 @@
1
- import { CommandStatus } from "@lookiero/messaging-react";
2
- interface IncrementIntroShownCountFunction {
3
- (): Promise<void>;
4
- }
5
- type UseIncrementIntroShownCount = [incrementIntroShownCount: IncrementIntroShownCountFunction, status: CommandStatus];
6
- interface UseIncrementIntroShownCountFunction {
7
- (): UseIncrementIntroShownCount;
8
- }
9
- declare const useIncrementIntroShownCount: UseIncrementIntroShownCountFunction;
10
- export { useIncrementIntroShownCount };
@@ -1,11 +0,0 @@
1
- import { useCallback } from "react";
2
- import { useViewIntroShownCount } from "../../../projection/uiSetting/react/useViewIntroShownCount";
3
- import { UISettings } from "../../../ui/settings/UISettings";
4
- import { useUpdateUiSetting } from "./useUpdateUiSetting";
5
- const useIncrementIntroShownCount = () => {
6
- const [update, status] = useUpdateUiSetting();
7
- const [introShownCount] = useViewIntroShownCount();
8
- const incrementIntroShownCount = useCallback(() => update({ key: UISettings.INTRO_SHOWN_COUNT, value: introShownCount + 1 }), [introShownCount, update]);
9
- return [incrementIntroShownCount, status];
10
- };
11
- export { useIncrementIntroShownCount };
@@ -1,6 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- interface UseShouldIntroBeShownFunction {
3
- (): [boolean, QueryStatus];
4
- }
5
- declare const useShouldIntroBeShown: UseShouldIntroBeShownFunction;
6
- export { useShouldIntroBeShown };
@@ -1,7 +0,0 @@
1
- import { useViewIntroShownCount } from "./useViewIntroShownCount";
2
- const MAX_INTRO_SHOWN_COUNT = 2;
3
- const useShouldIntroBeShown = () => {
4
- const [introShownCount, introShownCountStatus] = useViewIntroShownCount();
5
- return [introShownCount < MAX_INTRO_SHOWN_COUNT, introShownCountStatus];
6
- };
7
- export { useShouldIntroBeShown };
@@ -1,6 +0,0 @@
1
- import { QueryStatus } from "@lookiero/messaging-react";
2
- interface UseViewIntroShownCountFunction {
3
- (): [number, QueryStatus];
4
- }
5
- declare const useViewIntroShownCount: UseViewIntroShownCountFunction;
6
- export { useViewIntroShownCount };
@@ -1,9 +0,0 @@
1
- import { UISettings } from "../../../ui/settings/UISettings";
2
- import { useViewUiSettingByKey } from "./useViewUiSettingByKey";
3
- const useViewIntroShownCount = () => {
4
- const [introShownCount, introShownCountStatus] = useViewUiSettingByKey({
5
- key: UISettings.INTRO_SHOWN_COUNT,
6
- });
7
- return [introShownCount?.value || 0, introShownCountStatus];
8
- };
9
- export { useViewIntroShownCount };
@@ -1,13 +0,0 @@
1
- import { FC, ReactNode } from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
3
- import { Edge } from "react-native-safe-area-context";
4
- type SafeAreaScrollViewStyle = "safeAreaView" | "scrollView";
5
- interface SafeAreaScrollViewProps {
6
- readonly children: ReactNode;
7
- readonly footer?: ReactNode;
8
- readonly scrollerPaddingTop?: number;
9
- readonly edges?: Edge[];
10
- readonly style?: Partial<Record<SafeAreaScrollViewStyle, StyleProp<ViewStyle>>>;
11
- }
12
- declare const SafeAreaScrollView: FC<SafeAreaScrollViewProps>;
13
- export { SafeAreaScrollView };
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import { ScrollView } from "react-native";
3
- import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
4
- import { theme } from "../../theme/theme";
5
- import { style } from "./SafeAreaScrollView.style.ts";
6
- const { spaceXXL } = theme();
7
- const SafeAreaScrollView = ({ children, footer, edges = ["top", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
8
- const { bottom: safeAreaInsetBottom } = useSafeAreaInsets();
9
- return (React.createElement(SafeAreaView, { edges: edges, style: [style.safeAreaView, customStyle?.safeAreaView] },
10
- React.createElement(ScrollView, { contentContainerStyle: [
11
- {
12
- paddingTop: scrollerPaddingTop,
13
- paddingBottom: safeAreaInsetBottom + spaceXXL,
14
- },
15
- customStyle?.scrollView,
16
- ] }, children),
17
- footer));
18
- };
19
- export { SafeAreaScrollView };
@@ -1,6 +0,0 @@
1
- declare const style: {
2
- safeAreaView: {
3
- flex: number;
4
- };
5
- };
6
- export { style };
@@ -1,7 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- const style = StyleSheet.create({
3
- safeAreaView: {
4
- flex: 1,
5
- },
6
- });
7
- export { style };
@@ -1,3 +0,0 @@
1
- import { FC } from "react";
2
- declare const Header: FC;
3
- export { Header };
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { ButtonIcon } from "../../../../../../shared/ui/components/molecules/buttonIcon/ButtonIcon";
3
- import { ButtonIconPlaceholder } from "../buttonIconPlaceholder/ButtonIconPlaceholder";
4
- import { Logo } from "../logo/Logo";
5
- import { style } from "./Header.style";
6
- const Header = () => (React.createElement(React.Fragment, null,
7
- React.createElement(Logo, { style: style.logo }),
8
- React.createElement(ButtonIconPlaceholder, null),
9
- React.createElement(ButtonIcon, { name: "menu", testID: "menu-button-icon", onPress: () => void 0 })));
10
- export { Header };
@@ -1,9 +0,0 @@
1
- declare const HEADER_HEIGHT: number;
2
- declare const style: {
3
- logo: {
4
- left: number;
5
- position: "absolute";
6
- top: number;
7
- };
8
- };
9
- export { style, HEADER_HEIGHT };
@@ -1,12 +0,0 @@
1
- import { StyleSheet } from "react-native";
2
- import { theme } from "../../../../theme/theme";
3
- const { spaceXXXL } = theme();
4
- const HEADER_HEIGHT = spaceXXXL;
5
- const style = StyleSheet.create({
6
- logo: {
7
- left: 0,
8
- position: "absolute",
9
- top: 0,
10
- },
11
- });
12
- export { style, HEADER_HEIGHT };
@@ -1,13 +0,0 @@
1
- import { FC, ReactNode } from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
3
- import { Edge } from "react-native-safe-area-context";
4
- type SafeAreaScrollViewStyle = "safeAreaView" | "scrollView";
5
- interface SafeAreaScrollViewProps {
6
- readonly children: ReactNode;
7
- readonly footer?: ReactNode;
8
- readonly scrollerPaddingTop?: number;
9
- readonly edges?: Edge[];
10
- readonly style?: Partial<Record<SafeAreaScrollViewStyle, StyleProp<ViewStyle>>>;
11
- }
12
- declare const SafeAreaScrollView: FC<SafeAreaScrollViewProps>;
13
- export { SafeAreaScrollView };
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import { ScrollView } from "react-native";
3
- import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
4
- import { theme } from "../../../theme/theme.js";
5
- import { style } from "./SafeAreaScrollView.style.ts";
6
- const { spaceXXL } = theme();
7
- const SafeAreaScrollView = ({ children, footer, edges = ["top", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
8
- const { bottom: safeAreaInsetBottom } = useSafeAreaInsets();
9
- return (React.createElement(SafeAreaView, { edges: edges, style: [style.safeAreaView, customStyle?.safeAreaView] },
10
- React.createElement(ScrollView, { contentContainerStyle: [
11
- {
12
- paddingTop: scrollerPaddingTop,
13
- paddingBottom: safeAreaInsetBottom + spaceXXL,
14
- },
15
- customStyle?.scrollView,
16
- ] }, children),
17
- footer));
18
- };
19
- export { SafeAreaScrollView };
@@ -1,6 +0,0 @@
1
- declare const style: {
2
- safeAreaView: {
3
- flex: number;
4
- };
5
- };
6
- export { style };