@lookiero/checkout 3.6.0-beta.9 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/infrastructure/projection/checkout/checkout.js +12 -0
  2. package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.js +2 -2
  3. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +1 -1
  4. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -1
  5. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -1
  6. package/dist/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +1 -1
  7. package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +4 -6
  8. package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +3 -10
  9. package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +3 -10
  10. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.js +3 -4
  11. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.d.ts +0 -3
  12. package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.js +0 -3
  13. package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +1 -6
  14. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.d.ts +0 -1
  15. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.js +0 -1
  16. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +2 -3
  17. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -3
  18. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -3
  19. package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +3 -4
  20. package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.d.ts +3 -10
  21. package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.js +3 -10
  22. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +5 -6
  23. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.d.ts +0 -6
  24. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.js +0 -6
  25. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.js +3 -4
  26. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.d.ts +3 -10
  27. package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.style.js +3 -10
  28. package/dist/shared/ui/components/atoms/input/Input.js +1 -1
  29. package/dist/shared/ui/components/layouts/slider/Bullets.d.ts +10 -0
  30. package/dist/shared/ui/components/layouts/slider/Bullets.js +29 -0
  31. package/dist/shared/ui/components/layouts/slider/Bullets.style.d.ts +12 -0
  32. package/dist/shared/ui/components/layouts/slider/Bullets.style.js +15 -0
  33. package/dist/shared/ui/components/layouts/slider/Slider.d.ts +0 -5
  34. package/dist/shared/ui/components/layouts/slider/Slider.js +4 -4
  35. package/dist/shared/ui/components/molecules/selectField/SelectField.js +1 -1
  36. package/package.json +2 -1
  37. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +0 -6
  38. package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +0 -13
  39. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +0 -10
  40. package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +0 -11
  41. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +0 -6
  42. package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +0 -7
  43. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +0 -6
  44. package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +0 -9
  45. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +0 -13
  46. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +0 -19
  47. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.d.ts +0 -6
  48. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.js +0 -7
  49. package/dist/infrastructure/ui/components/templates/header/header/Header.d.ts +0 -3
  50. package/dist/infrastructure/ui/components/templates/header/header/Header.js +0 -10
  51. package/dist/infrastructure/ui/components/templates/header/header/Header.style.d.ts +0 -9
  52. package/dist/infrastructure/ui/components/templates/header/header/Header.style.js +0 -12
  53. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.d.ts +0 -13
  54. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.js +0 -19
  55. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.style.ts.d.ts +0 -6
  56. package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.style.ts.js +0 -7
  57. package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.d.ts +0 -2
  58. package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.js +0 -28
  59. package/dist/infrastructure/ui/hooks/useToast.d.ts +0 -11
  60. package/dist/infrastructure/ui/hooks/useToast.js +0 -49
  61. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +0 -7
  62. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +0 -25
  63. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +0 -16
  64. package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +0 -19
  65. package/dist/infrastructure/ui/views/intro/Intro.d.ts +0 -6
  66. package/dist/infrastructure/ui/views/intro/Intro.js +0 -52
  67. package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -52
  68. package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -55
  69. package/dist/infrastructure/ui/views/item/Item.style.d.ts +0 -15
  70. package/dist/infrastructure/ui/views/item/Item.style.js +0 -18
  71. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +0 -26
  72. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +0 -44
  73. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +0 -45
  74. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +0 -53
  75. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +0 -7
  76. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +0 -25
  77. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +0 -16
  78. package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +0 -19
  79. package/dist/infrastructure/ui/views/navigation/Navigation.d.ts +0 -21
  80. package/dist/infrastructure/ui/views/navigation/Navigation.js +0 -45
  81. package/dist/infrastructure/ui/views/navigation/Navigation.style.d.ts +0 -5
  82. package/dist/infrastructure/ui/views/navigation/Navigation.style.js +0 -30
  83. package/dist/infrastructure/ui/views/navigation/components/header/Header.d.ts +0 -46
  84. package/dist/infrastructure/ui/views/navigation/components/header/Header.js +0 -120
  85. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.d.ts +0 -31
  86. package/dist/infrastructure/ui/views/navigation/components/header/Header.style.js +0 -34
  87. package/dist/infrastructure/ui/views/navigation/components/header/Logo.d.ts +0 -7
  88. package/dist/infrastructure/ui/views/navigation/components/header/Logo.js +0 -11
  89. package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.d.ts +0 -7
  90. package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.js +0 -8
  91. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts +0 -12
  92. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +0 -24
  93. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.d.ts +0 -15
  94. package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.js +0 -18
  95. package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +0 -17
  96. package/dist/shared/notifications/domain/notification/command/createNotification.js +0 -7
  97. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +0 -21
  98. package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +0 -22
  99. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +0 -12
  100. package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +0 -24
  101. package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +0 -9
  102. package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +0 -20
  103. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +0 -36
  104. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +0 -31
  105. package/dist/shared/tracking/infrastructure/usePageView.d.ts +0 -13
  106. package/dist/shared/tracking/infrastructure/usePageView.js +0 -27
  107. package/dist/shared/ui/components/atoms/error/Error.style.d.ts +0 -6
  108. package/dist/shared/ui/components/atoms/error/Error.style.js +0 -9
  109. package/dist/shared/ui/components/layouts/slider/Pagination.d.ts +0 -14
  110. package/dist/shared/ui/components/layouts/slider/Pagination.js +0 -11
  111. package/dist/shared/ui/components/layouts/slider/Pagination.style.d.ts +0 -23
  112. package/dist/shared/ui/components/layouts/slider/Pagination.style.js +0 -27
@@ -1,5 +1,17 @@
1
1
  const toCheckoutProjection = (checkoutDto) => ({
2
2
  ...checkoutDto,
3
+ items: checkoutDto.items.map((item) => ({
4
+ ...item,
5
+ productVariant: {
6
+ ...item.productVariant,
7
+ media: [
8
+ ...item.productVariant.media,
9
+ ...item.productVariant.media,
10
+ ...item.productVariant.media,
11
+ ...item.productVariant.media,
12
+ ],
13
+ },
14
+ })),
3
15
  expiresOn: new Date(checkoutDto.expiresOn),
4
16
  });
5
17
  export { toCheckoutProjection };
@@ -21,7 +21,7 @@ const IconCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId,
21
21
  const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
22
22
  const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
23
23
  invariant(Icon, "CheckoutQuestion icon does not exist");
24
- return (React.createElement(Pressable, { testID: checkoutQuestion.name, onPress: handleOnPress },
25
- React.createElement(Icon, { fill: feedback === checkoutQuestion.id ? colorAccent : "none", style: style.icon })));
24
+ return (React.createElement(Pressable, { onPress: handleOnPress },
25
+ React.createElement(Icon, { fill: feedback === checkoutQuestion.id ? colorAccent : "none", style: style.icon, testID: checkoutQuestion.name })));
26
26
  };
27
27
  export { IconCheckoutQuestionItem };
@@ -31,7 +31,7 @@ const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName
31
31
  // deepestReturnQuestionWithFeedback needs to be as a dependency in order to be re-evaluated whenever it changes
32
32
  }, [handleOnModalClose, deepestReturnQuestionWithFeedback, isLeaf]);
33
33
  return (React.createElement(React.Fragment, null,
34
- React.createElement(TouchableHighlight, { style: style.container, testID: returnQuestion.name, underlayColor: containerUnderlayColor, onPress: handleOnPress },
34
+ React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, onPress: handleOnPress },
35
35
  React.createElement(View, { pointerEvents: "none" },
36
36
  React.createElement(InputField, { editable: false, icon: "arrow-down", label: placeholderText, value: inputValue }))),
37
37
  React.createElement(Modal, { portalHostName: portalHostName, visible: modalVisible, header: deepestReturnQuestionWithFeedback && (React.createElement(ButtonIcon, { name: "arrow-left", testID: "modal-back-button", onPress: handleOnBackButtonPress })), scroll: true, showCloseButton: true, onClose: handleOnModalClose },
@@ -8,7 +8,7 @@ const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) =
8
8
  const { onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
9
9
  const optionText = useI18nMessage({ id: returnQuestion.name });
10
10
  const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParentId]);
11
- return (React.createElement(TouchableHighlight, { style: style.container, testID: returnQuestion.name, underlayColor: containerUnderlayColor, onPress: handleOnPress },
11
+ return (React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, onPress: handleOnPress },
12
12
  React.createElement(Text, { level: 3, style: style.text }, optionText)));
13
13
  };
14
14
  export { OptionReturnQuestionItem };
@@ -8,6 +8,6 @@ const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, })
8
8
  const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
9
9
  const { feedback, onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
10
10
  const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: value }), [onChange, returnQuestionParentId]);
11
- return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, testID: returnQuestion.name, value: feedback, multiline: true, onChange: handleOnChange }));
11
+ return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, value: feedback, multiline: true, onChange: handleOnChange }));
12
12
  };
13
13
  export { TextareaReturnQuestionItem };
@@ -32,6 +32,6 @@ const CheckoutQuestionsForm = ({ checkoutQuestions, submitButtonDisabled, onSubm
32
32
  return (React.createElement(React.Fragment, null,
33
33
  React.createElement(CheckoutQuestionItemProvider, { checkoutQuestionItems: checkoutQuestionItems },
34
34
  React.createElement(CheckoutQuestions, { checkoutQuestions: filteredCheckoutQuestions })),
35
- React.createElement(Button, { busy: submitButtonDisabled, style: style.button, testID: "checkout-feedback-button", onPress: handlePress }, buttonText)));
35
+ React.createElement(Button, { busy: submitButtonDisabled, style: style.button, onPress: handlePress }, buttonText)));
36
36
  };
37
37
  export { CheckoutQuestionsForm };
@@ -12,11 +12,9 @@ const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
12
12
  const confirmButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON });
13
13
  return (React.createElement(Modal, { visible: visible, onClose: onDismiss },
14
14
  React.createElement(View, { style: style.modal },
15
- React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
16
- React.createElement(Text, { level: 3, style: style.description }, descriptionText),
17
- React.createElement(Button, { style: style.button, onPress: onDismiss },
18
- React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, dismissButtonText)),
19
- React.createElement(Button, { style: [style.button, style.confirmButton], variant: BUTTON_VARIANT.SECONDARY, onPress: onConfirm },
20
- React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, confirmButtonText)))));
15
+ React.createElement(Text, { align: ALIGN.CENTER, level: 1 }, titleText),
16
+ React.createElement(Text, { level: 3, style: style.modalDescription }, descriptionText),
17
+ React.createElement(Button, { style: style.button, onPress: onDismiss }, dismissButtonText),
18
+ React.createElement(Button, { style: [style.button, style.confirmButton], variant: BUTTON_VARIANT.SECONDARY, onPress: onConfirm }, confirmButtonText))));
21
19
  };
22
20
  export { GetOutOfCheckoutModal };
@@ -2,22 +2,15 @@ declare const style: {
2
2
  button: {
3
3
  flex: number;
4
4
  };
5
- buttonText: {
6
- width: string;
7
- };
8
5
  confirmButton: {
9
6
  marginTop: number;
10
7
  };
11
- description: {
12
- marginVertical: number;
13
- textAlign: "center";
14
- width: string;
15
- };
16
8
  modal: {
17
9
  padding: number;
18
10
  };
19
- title: {
20
- width: string;
11
+ modalDescription: {
12
+ marginVertical: number;
13
+ textAlign: "center";
21
14
  };
22
15
  };
23
16
  export { style };
@@ -5,22 +5,15 @@ const style = StyleSheet.create({
5
5
  button: {
6
6
  flex: 0,
7
7
  },
8
- buttonText: {
9
- width: "100%",
10
- },
11
8
  confirmButton: {
12
9
  marginTop: spaceXL,
13
10
  },
14
- description: {
15
- marginVertical: spaceXL,
16
- textAlign: "center",
17
- width: "100%",
18
- },
19
11
  modal: {
20
12
  padding: spaceXL,
21
13
  },
22
- title: {
23
- width: "100%",
14
+ modalDescription: {
15
+ marginVertical: spaceXL,
16
+ textAlign: "center",
24
17
  },
25
18
  });
26
19
  export { style };
@@ -1,4 +1,4 @@
1
- import { ALIGN, Button, BUTTON_VARIANT, Text } from "@lookiero/aurora";
1
+ import { Button, BUTTON_VARIANT } from "@lookiero/aurora";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import React, { useMemo } from "react";
4
4
  import { View } from "react-native";
@@ -20,7 +20,7 @@ const ItemActions = ({ productVariants, currentProductVariant, country, onSizeSe
20
20
  (sizeSelectorOptions.length === 1 && sizeSelectorOptions[0]?.value === currentProductVariant.id), [sizeSelectorOptions, currentProductVariant.id]);
21
21
  return (React.createElement(Sticky, { onLayout: onLayout },
22
22
  React.createElement(Body, { style: { column: style.container } },
23
- React.createElement(Button, { testID: "keep-button", onPress: onKeep }, keepButtonText),
23
+ React.createElement(Button, { onPress: onKeep }, keepButtonText),
24
24
  React.createElement(View, { style: style.row },
25
25
  !currentProductVariant.size.unique && productVariants && (React.createElement(SelectField, { ...(disabledSizeSelector && {
26
26
  onPress: onSizeSelectorPress,
@@ -29,7 +29,6 @@ const ItemActions = ({ productVariants, currentProductVariant, country, onSizeSe
29
29
  inputField: { input: disabledSizeSelector && style.inputDisabled },
30
30
  }, onChange: onReplace })),
31
31
  React.createElement(View, { style: style.returnButtonContainer },
32
- React.createElement(Button, { testID: "return-button", variant: BUTTON_VARIANT.SECONDARY, onPress: onReturn },
33
- React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, returnButtonText)))))));
32
+ React.createElement(Button, { variant: BUTTON_VARIANT.SECONDARY, onPress: onReturn }, returnButtonText))))));
34
33
  };
35
34
  export { ItemActions };
@@ -1,7 +1,4 @@
1
1
  declare const style: {
2
- buttonText: {
3
- width: string;
4
- };
5
2
  container: {
6
3
  paddingHorizontal: number;
7
4
  };
@@ -2,9 +2,6 @@ import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../theme/theme";
3
3
  const { colorGrayscaleL, spaceL, spaceXL } = theme();
4
4
  const style = StyleSheet.create({
5
- buttonText: {
6
- width: "100%",
7
- },
8
5
  container: {
9
6
  paddingHorizontal: spaceXL,
10
7
  },
@@ -10,12 +10,7 @@ const ProductVariantSlider = ({ producVariantMedia, onChanged }) => {
10
10
  setActive(activeIndex);
11
11
  onChanged?.(activeIndex);
12
12
  }, [onChanged]);
13
- return (React.createElement(Slider, { active: active, paginationActiveItemStyle: style.paginationActiveItemStyle, paginationItemStyle: style.paginationItemStyle, paginationStyle: style.paginationStyle, paginationRenderItem: (index) => (React.createElement(Image, { key: producVariantMedia[index]?.perspective, resizeMode: "contain", style: style.paginationImage, testID: "product-variant-pagination-image", source: {
14
- uri: cdnImageUrl({
15
- url: producVariantMedia[index]?.url,
16
- width: 80,
17
- }),
18
- } })), onChanged: handleOnActiveChanged }, producVariantMedia.map((media) => (React.createElement(Image, { key: media.perspective, resizeMode: "contain", style: style.image, testID: "product-variant-image", source: {
13
+ return (React.createElement(Slider, { active: active, onChanged: handleOnActiveChanged }, producVariantMedia.map((media) => (React.createElement(Image, { key: media.perspective, resizeMode: "contain", style: style.image, testID: "product-variant-image", source: {
19
14
  uri: cdnImageUrl({
20
15
  url: media.url,
21
16
  width: 600,
@@ -2,7 +2,6 @@ declare const style: {
2
2
  title: {
3
3
  marginBottom: number;
4
4
  marginTop: number;
5
- width: string;
6
5
  };
7
6
  titleContainer: {
8
7
  alignItems: "center";
@@ -5,7 +5,6 @@ const style = StyleSheet.create({
5
5
  title: {
6
6
  marginBottom: spaceL,
7
7
  marginTop: spaceXL,
8
- width: "100%",
9
8
  },
10
9
  titleContainer: {
11
10
  alignItems: "center",
@@ -1,5 +1,5 @@
1
1
  import { PortalHost } from "@gorhom/portal";
2
- import { ALIGN, Button, Text } from "@lookiero/aurora";
2
+ import { Button, Text } from "@lookiero/aurora";
3
3
  import { useI18nMessage } from "@lookiero/i18n-react";
4
4
  import React, { useCallback } from "react";
5
5
  import { View } from "react-native";
@@ -35,7 +35,6 @@ const ReturnQuestionsForm = ({ returnQuestions, visible, onSubmit, onClose }) =>
35
35
  React.createElement(View, { style: style.returnQuestionsContainer },
36
36
  React.createElement(Text, { level: 2, style: style.title }, titleText),
37
37
  React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
38
- React.createElement(Button, { style: style.submit, testID: "return-questions-submit-button", onPress: handleOnSubmit },
39
- React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, submitButtonText))))));
38
+ React.createElement(Button, { style: style.submit, onPress: handleOnSubmit }, submitButtonText)))));
40
39
  };
41
40
  export { ReturnQuestionsForm };
@@ -1,7 +1,4 @@
1
1
  declare const style: {
2
- buttonText: {
3
- width: string;
4
- };
5
2
  returnQuestionsContainer: {
6
3
  paddingHorizontal: number;
7
4
  };
@@ -2,9 +2,6 @@ import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../theme/theme";
3
3
  const { spaceS, spaceXL } = theme();
4
4
  const style = StyleSheet.create({
5
- buttonText: {
6
- width: "100%",
7
- },
8
5
  returnQuestionsContainer: {
9
6
  paddingHorizontal: spaceXL,
10
7
  },
@@ -11,9 +11,8 @@ const SizeWithoutStockModal = ({ visible, onDismiss }) => {
11
11
  const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
12
12
  return (React.createElement(Modal, { visible: visible, onClose: onDismiss },
13
13
  React.createElement(View, { style: style.modal },
14
- React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
15
- React.createElement(Text, { level: 3, style: style.description }, descriptionText),
16
- React.createElement(Button, { style: style.button, onPress: onDismiss },
17
- React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, buttonText)))));
14
+ React.createElement(Text, { align: ALIGN.CENTER, level: 1 }, titleText),
15
+ React.createElement(Text, { level: 3, style: style.modalDescription }, descriptionText),
16
+ React.createElement(Button, { style: style.button, onPress: onDismiss }, buttonText))));
18
17
  };
19
18
  export { SizeWithoutStockModal };
@@ -2,19 +2,12 @@ declare const style: {
2
2
  button: {
3
3
  flex: number;
4
4
  };
5
- buttonText: {
6
- width: string;
7
- };
8
- description: {
9
- marginVertical: number;
10
- textAlign: "center";
11
- width: string;
12
- };
13
5
  modal: {
14
6
  padding: number;
15
7
  };
16
- title: {
17
- width: string;
8
+ modalDescription: {
9
+ marginVertical: number;
10
+ textAlign: "center";
18
11
  };
19
12
  };
20
13
  export { style };
@@ -5,19 +5,12 @@ const style = StyleSheet.create({
5
5
  button: {
6
6
  flex: 0,
7
7
  },
8
- buttonText: {
9
- width: "100%",
10
- },
11
- description: {
12
- marginVertical: spaceXL,
13
- textAlign: "center",
14
- width: "100%",
15
- },
16
8
  modal: {
17
9
  padding: spaceXL,
18
10
  },
19
- title: {
20
- width: "100%",
11
+ modalDescription: {
12
+ marginVertical: spaceXL,
13
+ textAlign: "center",
21
14
  },
22
15
  });
23
16
  export { style };
@@ -1,4 +1,4 @@
1
- import { ALIGN, Button, Text } from "@lookiero/aurora";
1
+ import { Button, Text } from "@lookiero/aurora";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import { animated, useSpring } from "@react-spring/native";
4
4
  import React from "react";
@@ -33,15 +33,14 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
33
33
  return (React.createElement(Pressable, { testID: "pricing", onPress: collapsible ? onPress : null },
34
34
  collapsible && (React.createElement(View, { style: style.iconContainer }, collapsed ? (React.createElement(ArrowUp, { stroke: colorGrayscaleS, style: style.icon, testID: "arrow-up" })) : (React.createElement(ArrowDown, { stroke: colorGrayscaleS, style: style.icon, testID: "arrow-down" })))),
35
35
  collapsed && collapsible ? (React.createElement(animated.View, { style: [style.collapsed, { opacity: collapsedStyle.opacitiy }] },
36
- React.createElement(View, { style: style.collapsedContent },
36
+ React.createElement(View, null,
37
37
  React.createElement(Text, { level: 1, style: style.totalCollapsed, detail: true },
38
38
  totalText,
39
39
  " ",
40
40
  totalCheckoutItemsKeptText),
41
41
  React.createElement(Price, { price: pendingToPay, variant: "detail" })),
42
- React.createElement(View, { style: style.collapsedContent },
43
- React.createElement(Button, { busy: busy, testID: "cta-confirm-checkout", small: true, onPress: onSubmit },
44
- React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, submitButtonText))))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
42
+ React.createElement(View, null,
43
+ React.createElement(Button, { busy: busy, small: true, onPress: onSubmit }, submitButtonText)))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
45
44
  React.createElement(Row, { text: `${subtotalText} ${totalCheckoutItemsKeptText}` },
46
45
  React.createElement(Price, { price: subtotal, variant: "subtotal" })),
47
46
  discount && discount.amount !== 0 && (React.createElement(Row, { text: discountText },
@@ -52,6 +51,6 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
52
51
  React.createElement(View, { style: style.divider }),
53
52
  React.createElement(Row, { level: 2, text: totalText },
54
53
  React.createElement(Price, { price: pendingToPay, variant: "total" })),
55
- React.createElement(Button, { busy: busy, testID: "cta-confirm-checkout", onPress: onSubmit }, submitButtonText)))));
54
+ React.createElement(Button, { busy: busy, onPress: onSubmit }, submitButtonText)))));
56
55
  };
57
56
  export { Pricing };
@@ -1,14 +1,8 @@
1
1
  declare const style: {
2
- buttonText: {
3
- width: string;
4
- };
5
2
  collapsed: {
6
3
  flexDirection: "row";
7
4
  justifyContent: "space-between";
8
5
  };
9
- collapsedContent: {
10
- flex: number;
11
- };
12
6
  divider: {
13
7
  backgroundColor: string;
14
8
  height: number;
@@ -2,16 +2,10 @@ import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../theme/theme";
3
3
  const { colorContent, spaceXS, spaceL } = theme();
4
4
  const style = StyleSheet.create({
5
- buttonText: {
6
- width: "100%",
7
- },
8
5
  collapsed: {
9
6
  flexDirection: "row",
10
7
  justifyContent: "space-between",
11
8
  },
12
- collapsedContent: {
13
- flex: 1,
14
- },
15
9
  divider: {
16
10
  backgroundColor: colorContent,
17
11
  height: 1,
@@ -24,9 +24,8 @@ const ModalNotificationItem = ({ visible, notification, onRemove, testID = "moda
24
24
  }, [notification.id, onRemove]);
25
25
  return (React.createElement(Modal, { testID: testID, visible: visible, onClose: handleOnClose },
26
26
  React.createElement(View, { style: style.modal },
27
- React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
28
- React.createElement(Text, { level: 3, style: style.description }, bodyText),
29
- React.createElement(Button, { style: style.button, testID: "modal-notification-button", onPress: handleOnClose },
30
- React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, acceptText)))));
27
+ React.createElement(Text, { align: ALIGN.CENTER, level: 1 }, titleText),
28
+ React.createElement(Text, { level: 3, style: style.modalDescription }, bodyText),
29
+ React.createElement(Button, { style: style.button, onPress: handleOnClose }, acceptText))));
31
30
  };
32
31
  export { ModalNotificationItem };
@@ -2,19 +2,12 @@ declare const style: {
2
2
  button: {
3
3
  flex: number;
4
4
  };
5
- buttonText: {
6
- width: string;
7
- };
8
- description: {
9
- marginVertical: number;
10
- textAlign: "center";
11
- width: string;
12
- };
13
5
  modal: {
14
6
  padding: number;
15
7
  };
16
- title: {
17
- width: string;
8
+ modalDescription: {
9
+ marginVertical: number;
10
+ textAlign: "center";
18
11
  };
19
12
  };
20
13
  export { style };
@@ -5,19 +5,12 @@ const style = StyleSheet.create({
5
5
  button: {
6
6
  flex: 0,
7
7
  },
8
- buttonText: {
9
- width: "100%",
10
- },
11
- description: {
12
- marginVertical: spaceXL,
13
- textAlign: "center",
14
- width: "100%",
15
- },
16
8
  modal: {
17
9
  padding: spaceXL,
18
10
  },
19
- title: {
20
- width: "100%",
11
+ modalDescription: {
12
+ marginVertical: spaceXL,
13
+ textAlign: "center",
21
14
  },
22
15
  });
23
16
  export { style };
@@ -32,6 +32,6 @@ const Input = ({ minHeight = MIN_HEIGHT, maxHeight = MAX_HEIGHT, style: customSt
32
32
  }, [maxHeight, minHeight, multiline]);
33
33
  useLayoutEffect(handleOnContentSizeChangeWeb, [handleOnContentSizeChangeWeb, value]);
34
34
  const textInputRef = useRef(null);
35
- return (React.createElement(TextInput, { ref: textInputRef, multiline: multiline, numberOfLines: !!multiline ? undefined : 1, placeholderTextColor: placeholderTextColor, style: [style.input, customStyle, { height }], testID: "input", textAlignVertical: "top", value: value, onChange: onChange, onContentSizeChange: handleOnContentSizeChange, ...restOfProps }));
35
+ return (React.createElement(TextInput, { ...restOfProps, ref: textInputRef, multiline: multiline, numberOfLines: !!multiline ? undefined : 1, placeholderTextColor: placeholderTextColor, style: [style.input, customStyle, { height }], testID: "input", textAlignVertical: "top", value: value, onChange: onChange, onContentSizeChange: handleOnContentSizeChange }));
36
36
  };
37
37
  export { Input };
@@ -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,29 @@
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 = 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 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 };
@@ -0,0 +1,12 @@
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 };
@@ -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
+ 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,5 +1,4 @@
1
1
  import { FC, ReactNode } from "react";
2
- import { StyleProp, ViewStyle } from "react-native";
3
2
  interface SliderProps {
4
3
  readonly children: ReactNode[];
5
4
  readonly active?: number;
@@ -8,13 +7,9 @@ interface SliderProps {
8
7
  readonly minDistanceForAction?: number;
9
8
  readonly gesturesEnabled?: boolean;
10
9
  readonly paginationEnabled?: boolean;
11
- readonly paginationStyle?: StyleProp<ViewStyle>;
12
- readonly paginationItemStyle?: StyleProp<ViewStyle>;
13
- readonly paginationActiveItemStyle?: StyleProp<ViewStyle>;
14
10
  readonly onSliderStart?: () => void;
15
11
  readonly onSliderEnd?: () => void;
16
12
  readonly onChanged?: (index: number) => void;
17
- readonly paginationRenderItem?: (index: number) => ReactNode;
18
13
  }
19
14
  declare const Slider: FC<SliderProps>;
20
15
  export { Slider };
@@ -1,9 +1,9 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from "react";
2
- import { Animated, I18nManager, PanResponder, StyleSheet, View, } from "react-native";
3
- import { Pagination } from "./Pagination";
2
+ import { Animated, I18nManager, PanResponder, StyleSheet, View } from "react-native";
3
+ import { Bullets } from "./Bullets";
4
4
  import { style } from "./Slider.style";
5
5
  const DEFAULT_WIDTH = 200;
6
- const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5, minDistanceForAction = 0.2, gesturesEnabled = true, paginationEnabled = true, paginationStyle, paginationItemStyle, paginationActiveItemStyle, onSliderStart, onSliderEnd, onChanged, paginationRenderItem, }) => {
6
+ const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5, minDistanceForAction = 0.2, gesturesEnabled = true, paginationEnabled = true, onSliderStart, onSliderEnd, onChanged, }) => {
7
7
  const flatennedChildren = children.flat();
8
8
  const count = flatennedChildren.length;
9
9
  const [width, setWidth] = useState(0);
@@ -127,6 +127,6 @@ const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5,
127
127
  },
128
128
  style.sliderAreaStyle,
129
129
  ]), ...panResponder.panHandlers }, flatennedChildren.map((child, index) => (React.createElement(View, { key: index, style: { width }, testID: "slider-child" }, child)))),
130
- paginationEnabled && (React.createElement(Pagination, { activeIndex: getActiveIndex(), count: count, paginationActiveItemStyle: paginationActiveItemStyle, paginationItemStyle: paginationItemStyle, paginationStyle: paginationStyle, renderItem: paginationRenderItem, onChange: (index) => goTo(index) }))));
130
+ paginationEnabled && (React.createElement(Bullets, { activeIndex: getActiveIndex(), count: count, testID: "slider-bullets", onChange: (index) => goTo(index) }))));
131
131
  };
132
132
  export { Slider };
@@ -22,7 +22,7 @@ const SelectField = ({ title, placeholder, value, options, style: customStyle, o
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, disabled: value === optionValue, style: [style.option, customStyle?.option], testID: "select-field-option", underlayColor: colorGrayscaleS, 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.6.0-beta.9",
3
+ "version": "3.6.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -77,6 +77,7 @@
77
77
  "@pact-foundation/pact-node": "^10.17.6",
78
78
  "@react-native-firebase/analytics": "10.5.1",
79
79
  "@react-native-firebase/app": "10.5.0",
80
+ "@testing-library/jest-native": "^5.4.2",
80
81
  "@testing-library/react-native": "^11.5.0",
81
82
  "@trivago/prettier-plugin-sort-imports": "^3.3.0",
82
83
  "@types/jest": "^29.2.4",
@@ -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 };