@lookiero/checkout 0.2.21 → 0.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/infrastructure/projection/feedback/feedback.mock.d.ts +3 -0
  2. package/dist/infrastructure/projection/feedback/feedback.mock.js +6 -0
  3. package/dist/infrastructure/projection/returnQuestion/returnQuestions.mock.js +1 -1
  4. package/dist/infrastructure/ui/components/layouts/body/Body.js +4 -7
  5. package/dist/infrastructure/ui/components/layouts/body/Body.style.d.ts +3 -7
  6. package/dist/infrastructure/ui/components/layouts/body/Body.style.js +4 -8
  7. package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +1 -0
  8. package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -3
  9. package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +1 -0
  10. package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
  11. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +3 -2
  12. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +3 -0
  13. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +3 -0
  14. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +10 -9
  15. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -10
  16. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -10
  17. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.js +4 -4
  18. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.d.ts +1 -0
  19. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.js +7 -3
  20. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -1
  21. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.d.ts +3 -0
  22. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.js +3 -0
  23. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +3 -0
  24. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +27 -0
  25. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.style.d.ts +10 -0
  26. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.style.js +13 -0
  27. package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +3 -2
  28. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +4 -2
  29. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +13 -4
  30. package/dist/infrastructure/ui/i18n/i18n.d.ts +5 -2
  31. package/dist/infrastructure/ui/i18n/i18n.js +4 -1
  32. package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +1 -1
  33. package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +1 -1
  34. package/dist/infrastructure/ui/routing/Routing.js +21 -14
  35. package/dist/infrastructure/ui/{components → shared/components}/atoms/error/Error.style.js +1 -1
  36. package/dist/infrastructure/ui/{components → shared/components}/atoms/field/Field.js +1 -1
  37. package/dist/infrastructure/ui/{components → shared/components}/atoms/field/Field.style.js +1 -1
  38. package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.d.ts +12 -0
  39. package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.js +7 -0
  40. package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.style.d.ts +13 -0
  41. package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.style.js +16 -0
  42. package/dist/infrastructure/ui/{components → shared/components}/atoms/input/Input.d.ts +1 -1
  43. package/dist/infrastructure/ui/{components → shared/components}/atoms/input/Input.js +1 -1
  44. package/dist/infrastructure/ui/{components → shared/components}/atoms/input/Input.style.d.ts +4 -1
  45. package/dist/infrastructure/ui/{components → shared/components}/atoms/input/Input.style.js +10 -3
  46. package/dist/infrastructure/ui/{components → shared/components}/atoms/spinner/Spinner.js +1 -1
  47. package/dist/infrastructure/ui/shared/components/layouts/column/Column.d.ts +10 -0
  48. package/dist/infrastructure/ui/shared/components/layouts/column/Column.js +10 -0
  49. package/dist/infrastructure/ui/shared/components/layouts/column/Column.style.d.ts +12 -0
  50. package/dist/infrastructure/ui/shared/components/layouts/column/Column.style.js +23 -0
  51. package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.d.ts +17 -0
  52. package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.js +60 -0
  53. package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.style.d.ts +49 -0
  54. package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.style.js +62 -0
  55. package/dist/infrastructure/ui/shared/components/layouts/row/Row.d.ts +6 -0
  56. package/dist/infrastructure/ui/shared/components/layouts/row/Row.js +10 -0
  57. package/dist/infrastructure/ui/shared/components/layouts/row/Row.style.d.ts +13 -0
  58. package/dist/infrastructure/ui/shared/components/layouts/row/Row.style.js +17 -0
  59. package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Pagination.d.ts +2 -2
  60. package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Pagination.style.js +1 -1
  61. package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Slider.d.ts +1 -1
  62. package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.d.ts +14 -0
  63. package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.js +7 -0
  64. package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.style.d.ts +7 -0
  65. package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.style.js +10 -0
  66. package/dist/infrastructure/ui/{components → shared/components}/molecules/inputField/InputField.d.ts +8 -6
  67. package/dist/infrastructure/ui/{components → shared/components}/molecules/inputField/InputField.js +8 -5
  68. package/dist/infrastructure/ui/{components → shared/components}/molecules/inputField/InputField.style.d.ts +6 -0
  69. package/dist/infrastructure/ui/{components → shared/components}/molecules/inputField/InputField.style.js +8 -2
  70. package/dist/infrastructure/ui/shared/hooks/useScreenSize.d.ts +4 -0
  71. package/dist/infrastructure/ui/shared/hooks/useScreenSize.js +9 -0
  72. package/dist/infrastructure/ui/views/App.d.ts +3 -0
  73. package/dist/infrastructure/ui/views/App.js +8 -0
  74. package/dist/infrastructure/ui/views/intro/Intro.js +1 -1
  75. package/dist/infrastructure/ui/views/item/Item.js +12 -9
  76. package/dist/infrastructure/ui/views/item/Item.style.d.ts +6 -1
  77. package/dist/infrastructure/ui/views/item/Item.style.js +7 -2
  78. package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +1 -1
  79. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +10 -0
  80. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +32 -0
  81. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.d.ts +12 -0
  82. package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.js +15 -0
  83. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +17 -9
  84. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +1 -13
  85. package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +2 -14
  86. package/dist/projection/returnQuestion/returnQuestion.d.ts +1 -0
  87. package/dist/projection/returnQuestion/returnQuestion.js +1 -0
  88. package/package.json +5 -2
  89. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.d.ts +0 -10
  90. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.js +0 -11
  91. /package/dist/infrastructure/ui/{components → shared/components}/atoms/error/Error.d.ts +0 -0
  92. /package/dist/infrastructure/ui/{components → shared/components}/atoms/error/Error.js +0 -0
  93. /package/dist/infrastructure/ui/{components → shared/components}/atoms/error/Error.style.d.ts +0 -0
  94. /package/dist/infrastructure/ui/{components → shared/components}/atoms/field/Field.d.ts +0 -0
  95. /package/dist/infrastructure/ui/{components → shared/components}/atoms/field/Field.style.d.ts +0 -0
  96. /package/dist/infrastructure/ui/{components → shared/components}/atoms/spinner/Spinner.d.ts +0 -0
  97. /package/dist/infrastructure/ui/{components → shared/components}/atoms/spinner/Spinner.style.d.ts +0 -0
  98. /package/dist/infrastructure/ui/{components → shared/components}/atoms/spinner/Spinner.style.js +0 -0
  99. /package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Pagination.js +0 -0
  100. /package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Pagination.style.d.ts +0 -0
  101. /package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Slider.js +0 -0
  102. /package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Slider.style.d.ts +0 -0
  103. /package/dist/infrastructure/ui/{components → shared/components}/layouts/slider/Slider.style.js +0 -0
@@ -0,0 +1,3 @@
1
+ import { FeedbackProjection } from "../../../projection/feedback/feedback";
2
+ declare const feedback: FeedbackProjection;
3
+ export { feedback };
@@ -0,0 +1,6 @@
1
+ const feedback = {
2
+ ["0ad1dba8-b02c-4121-a1e3-981f1c30800d"]: "9251dc2c-d76a-484d-9299-346929af932f",
3
+ ["542c4d24-e1da-484f-8c3a-7d89ee135adc"]: "68c0bb98-b00a-4b86-af43-528fe903cb69",
4
+ ["1123a37d-bc00-43a4-9d28-cee1dfaf356c"]: "Free text comment",
5
+ };
6
+ export { feedback };
@@ -334,7 +334,7 @@ const returnQuestions = [
334
334
  {
335
335
  id: "ce3e8d57-5eea-4dd3-bef4-2e811a143612",
336
336
  name: "comment_title",
337
- type: ReturnQuestionType.HOST_DEFAULT,
337
+ type: ReturnQuestionType.HOST_TEXTAREA,
338
338
  children: [
339
339
  {
340
340
  id: "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
@@ -1,10 +1,7 @@
1
- import { Box } from "@lookiero/aurora-next/build/components/atoms/Box/Box";
2
- import { Layout } from "@lookiero/aurora-next/build/components/atoms/Layout/Layout";
3
1
  import React from "react";
2
+ import { Column } from "../../../shared/components/layouts/column/Column";
3
+ import { Row } from "../../../shared/components/layouts/row/Row";
4
4
  import { style } from "./Body.style";
5
- const Body = ({ children }) => (
6
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7
- // @ts-ignore
8
- React.createElement(Layout, { style: style.layout },
9
- React.createElement(Box, { size: { M: "2/3", L: "1/3" }, style: style.box }, children)));
5
+ const Body = ({ children }) => (React.createElement(Row, { style: style.row },
6
+ React.createElement(Column, { style: style.column }, children)));
10
7
  export { Body };
@@ -1,14 +1,10 @@
1
1
  declare const style: {
2
- container: {
3
- flex: number;
4
- };
5
- layout: {
2
+ row: {
6
3
  flex: number;
7
4
  justifyContent: "center";
8
- paddingVertical: number;
9
5
  };
10
- box: {
11
- height: string;
6
+ column: {
7
+ paddingHorizontal: number;
12
8
  };
13
9
  };
14
10
  export { style };
@@ -1,17 +1,13 @@
1
- import { Platform, StyleSheet } from "react-native";
1
+ import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../theme/theme";
3
3
  const { spaceXL } = theme();
4
4
  const style = StyleSheet.create({
5
- container: {
6
- flex: 1,
7
- },
8
- layout: {
5
+ row: {
9
6
  flex: 1,
10
7
  justifyContent: "center",
11
- paddingVertical: Platform.OS === "web" ? spaceXL : 0,
12
8
  },
13
- box: {
14
- height: "100%",
9
+ column: {
10
+ paddingHorizontal: spaceXL,
15
11
  },
16
12
  });
17
13
  export { style };
@@ -3,6 +3,7 @@ import { ReturnQuestionProjection } from "../../../../../projection/returnQuesti
3
3
  interface ReturnQuestionProps {
4
4
  readonly returnQuestionParentId: string;
5
5
  readonly returnQuestion: ReturnQuestionProjection;
6
+ readonly portalHostName?: string;
6
7
  }
7
8
  declare const _default: React.NamedExoticComponent<ReturnQuestionProps>;
8
9
  export default _default;
@@ -1,8 +1,8 @@
1
1
  import React, { memo } from "react";
2
2
  import { useReturnQuestionItem } from "./behaviors/useReturnQuestionItem";
3
- const ReturnQuestion = ({ returnQuestion, returnQuestionParentId }) => {
3
+ const ReturnQuestion = ({ returnQuestion, returnQuestionParentId, portalHostName, }) => {
4
4
  const Item = useReturnQuestionItem({ type: returnQuestion.type });
5
- return (React.createElement(Item, { returnQuestion: returnQuestion, returnQuestionParentId: returnQuestionParentId },
6
- React.createElement(React.Fragment, null, returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, returnQuestion: childReturnQuestion, returnQuestionParentId: returnQuestion.id }))))));
5
+ return (React.createElement(Item, { returnQuestion: returnQuestion, returnQuestionParentId: returnQuestionParentId, portalHostName: portalHostName },
6
+ React.createElement(React.Fragment, null, returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, returnQuestion: childReturnQuestion, returnQuestionParentId: returnQuestion.id, portalHostName: portalHostName }))))));
7
7
  };
8
8
  export default memo(ReturnQuestion);
@@ -2,6 +2,7 @@ import { FC } from "react";
2
2
  import { ReturnQuestionProjection } from "../../../../../projection/returnQuestion/returnQuestion";
3
3
  interface ReturnQuestionsProps {
4
4
  readonly returnQuestions: ReturnQuestionProjection[];
5
+ readonly portalHostName?: string;
5
6
  }
6
7
  declare const ReturnQuestions: FC<ReturnQuestionsProps>;
7
8
  export { ReturnQuestions };
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import ReturnQuestion from "./ReturnQuestion";
3
- const ReturnQuestions = ({ returnQuestions }) => (React.createElement(React.Fragment, null, returnQuestions.map((returnQuestion) => (React.createElement(ReturnQuestion, { key: returnQuestion.id, returnQuestion: returnQuestion, returnQuestionParentId: "" })))));
3
+ const ReturnQuestions = ({ returnQuestions, portalHostName }) => (React.createElement(React.Fragment, null, returnQuestions.map((returnQuestion) => (React.createElement(ReturnQuestion, { key: returnQuestion.id, returnQuestion: returnQuestion, returnQuestionParentId: "", portalHostName: portalHostName })))));
4
4
  export { ReturnQuestions };
@@ -1,9 +1,10 @@
1
- import { FC } from "react";
1
+ import { FC, ReactNode } from "react";
2
2
  import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
3
3
  interface ReturnQuestionItemProps {
4
4
  readonly returnQuestion: ReturnQuestionProjection;
5
5
  readonly returnQuestionParentId: string;
6
- readonly children?: JSX.Element;
6
+ readonly children?: ReactNode;
7
+ readonly portalHostName?: string;
7
8
  }
8
9
  declare type ReturnQuestionItem = FC<ReturnQuestionItemProps>;
9
10
  export type { ReturnQuestionItem, ReturnQuestionItemProps };
@@ -0,0 +1,3 @@
1
+ import { ReturnQuestionItem } from "../ReturnQuestionItem";
2
+ declare const HostDefaultReturnQuestionFeedbackItem: ReturnQuestionItem;
3
+ export { HostDefaultReturnQuestionFeedbackItem };
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ const HostDefaultReturnQuestionFeedbackItem = ({ children }) => (React.createElement(React.Fragment, null, children));
3
+ export { HostDefaultReturnQuestionFeedbackItem };
@@ -1,15 +1,18 @@
1
- import { ButtonIcon } from "@lookiero/aurora-next/build/components/atoms/ButtonIcon/ButtonIcon";
2
- import { InputField } from "@lookiero/aurora-next/build/components/atoms/InputField/InputField";
3
- import { Modal } from "@lookiero/aurora-next/build/components/molecules/Modal/Modal";
4
1
  import { useI18nMessage } from "@lookiero/i18n-react";
5
2
  import React, { useCallback, useState } from "react";
6
3
  import { useIntl } from "react-intl";
7
4
  import { TouchableHighlight, View } from "react-native";
5
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
8
6
  import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
7
+ import { Modal } from "../../../../../shared/components/layouts/modal/Modal";
8
+ import { InputField } from "../../../../../shared/components/molecules/inputField/InputField";
9
+ import { theme } from "../../../../../theme/theme";
9
10
  import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
10
11
  import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
11
12
  import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
12
- const HostSelectReturnQuestionItem = ({ returnQuestion, children }) => {
13
+ const { spaceXL } = theme();
14
+ const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
15
+ const { bottom: safeAreaInsetBottom } = useSafeAreaInsets();
13
16
  const placeholderText = useI18nMessage({ id: returnQuestion.placeholder, prefix: RETURN_QUESTIONS_PREFIX });
14
17
  const [modalVisible, setModalVisible] = useState(false);
15
18
  const handleOnPress = useCallback(() => setModalVisible(true), []);
@@ -21,10 +24,8 @@ const HostSelectReturnQuestionItem = ({ returnQuestion, children }) => {
21
24
  return (React.createElement(React.Fragment, null,
22
25
  React.createElement(TouchableHighlight, { style: style.container, onPress: handleOnPress, underlayColor: containerUnderlayColor },
23
26
  React.createElement(View, { pointerEvents: "none" },
24
- React.createElement(InputField, { label: placeholderText, value: inputValue, name: returnQuestion.name, icon: "arrow-down", type: "text", testID: returnQuestion.name }))),
25
- React.createElement(Modal, { style: style.modal, size: "1/2", isVisible: modalVisible },
26
- React.createElement(View, { style: style.modalContent },
27
- React.createElement(ButtonIcon, { name: "close", style: style.backButton, onPress: handleOnModalClose }),
28
- children))));
27
+ React.createElement(InputField, { label: placeholderText || "", value: inputValue, icon: "arrow-down", editable: false }))),
28
+ React.createElement(Modal, { visible: modalVisible, onClose: handleOnModalClose, portalHostName: portalHostName },
29
+ React.createElement(View, { style: [style.modalContent, { paddingBottom: spaceXL + safeAreaInsetBottom }] }, children))));
29
30
  };
30
31
  export { HostSelectReturnQuestionItem };
@@ -3,18 +3,9 @@ declare const style: {
3
3
  container: {
4
4
  marginVertical: number;
5
5
  };
6
- modal: {
7
- zIndex: number;
8
- };
9
6
  modalContent: {
10
- marginTop: number;
11
7
  paddingBottom: number;
12
- };
13
- backButton: {
14
- top: number;
15
- right: number;
16
- alignSelf: "flex-end";
17
- zIndex: number;
8
+ paddingHorizontal: number;
18
9
  };
19
10
  };
20
11
  export { style, containerUnderlayColor };
@@ -6,18 +6,9 @@ const style = StyleSheet.create({
6
6
  container: {
7
7
  marginVertical: spaceM,
8
8
  },
9
- modal: {
10
- zIndex: 10,
11
- },
12
9
  modalContent: {
13
- marginTop: -spaceXL,
14
10
  paddingBottom: spaceXL,
15
- },
16
- backButton: {
17
- top: 0,
18
- right: -spaceM,
19
- alignSelf: "flex-end",
20
- zIndex: 20,
11
+ paddingHorizontal: spaceXL,
21
12
  },
22
13
  });
23
14
  export { style, containerUnderlayColor };
@@ -1,12 +1,12 @@
1
- import { ButtonIcon } from "@lookiero/aurora-next/build/components/atoms/ButtonIcon/ButtonIcon";
2
1
  import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
3
2
  import { useI18nMessage } from "@lookiero/i18n-react";
4
3
  import React, { useCallback } from "react";
5
4
  import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
5
+ import { ButtonIcon } from "../../../../../shared/components/molecules/buttonIcon/ButtonIcon";
6
6
  import ReturnQuestion from "../../ReturnQuestion";
7
7
  import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
8
8
  import { style } from "./HostStackReturnQuestionItem.style";
9
- const HostStackReturnQuestionItem = ({ returnQuestion, children }) => {
9
+ const HostStackReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
10
10
  const titleText = useI18nMessage({ id: returnQuestion.name, prefix: RETURN_QUESTIONS_PREFIX });
11
11
  const { feedback, onChange } = useReturnQuestionFeedbackForId({ id: returnQuestion.id });
12
12
  const feedbackReturnQuestion = feedback
@@ -19,10 +19,10 @@ const HostStackReturnQuestionItem = ({ returnQuestion, children }) => {
19
19
  const questionTitle = titleText && (React.createElement(Text, { level: 2, style: style.title }, titleText));
20
20
  if (feedbackReturnQuestion) {
21
21
  return (React.createElement(React.Fragment, null,
22
- React.createElement(ButtonIcon, { name: "arrow-left", style: style.backButton, onPress: handleOnBackButtonPress }),
22
+ React.createElement(ButtonIcon, { name: "arrow-left", style: { icon: style.backButton }, onPress: handleOnBackButtonPress }),
23
23
  questionTitle,
24
24
  React.createElement(Text, { level: 3, style: style.feedback }, feedbackText),
25
- feedbackReturnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, returnQuestion: childReturnQuestion, returnQuestionParentId: feedbackReturnQuestion.id })))));
25
+ feedbackReturnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, returnQuestion: childReturnQuestion, returnQuestionParentId: feedbackReturnQuestion.id, portalHostName: portalHostName })))));
26
26
  }
27
27
  else {
28
28
  return (React.createElement(React.Fragment, null,
@@ -12,6 +12,7 @@ declare const style: {
12
12
  feedback: {
13
13
  color: string;
14
14
  marginVertical: number;
15
+ lineHeight: number;
15
16
  };
16
17
  };
17
18
  export { style };
@@ -1,11 +1,14 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../../theme/theme";
3
- const { colorGrayscaleL, spaceM, spaceL } = theme();
3
+ const { colorGrayscaleL, spaceS, spaceM, spaceL, iconSize } = theme();
4
+ const headerPadding = spaceM;
5
+ const buttonIconPadding = spaceS;
6
+ const backButtonTop = (iconSize + headerPadding + buttonIconPadding * 2) * -1;
4
7
  const style = StyleSheet.create({
5
8
  backButton: {
6
9
  position: "absolute",
7
- top: 0,
8
- left: -spaceM,
10
+ top: backButtonTop,
11
+ left: spaceM,
9
12
  zIndex: 20,
10
13
  },
11
14
  title: {
@@ -15,6 +18,7 @@ const style = StyleSheet.create({
15
18
  feedback: {
16
19
  color: colorGrayscaleL,
17
20
  marginVertical: spaceM,
21
+ lineHeight: 24,
18
22
  },
19
23
  });
20
24
  export { style };
@@ -10,6 +10,6 @@ const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) =
10
10
  const optionText = useI18nMessage({ id: returnQuestion.name, prefix: RETURN_QUESTIONS_PREFIX });
11
11
  const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParentId]);
12
12
  return (React.createElement(TouchableHighlight, { style: style.container, onPress: handleOnPress, underlayColor: containerUnderlayColor },
13
- React.createElement(Text, { level: 3 }, optionText)));
13
+ React.createElement(Text, { level: 3, style: style.text }, optionText)));
14
14
  };
15
15
  export { OptionReturnQuestionItem };
@@ -5,5 +5,8 @@ declare const style: {
5
5
  borderBottomWidth: number;
6
6
  borderBottomColor: string;
7
7
  };
8
+ text: {
9
+ lineHeight: number;
10
+ };
8
11
  };
9
12
  export { style, containerUnderlayColor };
@@ -8,5 +8,8 @@ const style = StyleSheet.create({
8
8
  borderBottomWidth: 1,
9
9
  borderBottomColor: colorGrayscaleS,
10
10
  },
11
+ text: {
12
+ lineHeight: 24,
13
+ },
11
14
  });
12
15
  export { style, containerUnderlayColor };
@@ -0,0 +1,3 @@
1
+ import { ReturnQuestionItem } from "../ReturnQuestionItem";
2
+ declare const ReturnQuestionFeedbackItem: ReturnQuestionItem;
3
+ export { ReturnQuestionFeedbackItem };
@@ -0,0 +1,27 @@
1
+ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
2
+ import { useI18nMessage } from "@lookiero/i18n-react";
3
+ import React, { useCallback } from "react";
4
+ import { useIntl } from "react-intl";
5
+ import { View } from "react-native";
6
+ import { I18nMessages, RETURN_QUESTIONS_FEEDBACK_PREFIX, RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
7
+ import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
8
+ import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
9
+ import { style } from "./ReturnQuestionFeedbackItem.style";
10
+ const ReturnQuestionFeedbackItem = ({ returnQuestion }) => {
11
+ const titleText = useI18nMessage({ id: returnQuestion.name, prefix: RETURN_QUESTIONS_FEEDBACK_PREFIX });
12
+ const unansweredText = useI18nMessage({
13
+ id: I18nMessages.FEEDBACK_UNANSWERED,
14
+ prefix: RETURN_QUESTIONS_FEEDBACK_PREFIX,
15
+ });
16
+ const returnQuestionFeedback = useReturnQuestionFeedback();
17
+ const intl = useIntl();
18
+ const translate = useCallback((returnQuestionName) => intl.formatMessage({
19
+ id: `${RETURN_QUESTIONS_PREFIX}${returnQuestionName}`,
20
+ defaultMessage: returnQuestionName,
21
+ }), [intl]);
22
+ const feedback = feedbackForReturnQuestion({ feedback: returnQuestionFeedback, returnQuestion, translate }).join(" / ");
23
+ return (React.createElement(View, { style: style.container },
24
+ React.createElement(Text, { detail: true, level: 2, style: style.title }, titleText),
25
+ React.createElement(Text, { level: 3 }, feedback || unansweredText)));
26
+ };
27
+ export { ReturnQuestionFeedbackItem };
@@ -0,0 +1,10 @@
1
+ declare const style: {
2
+ container: {
3
+ marginBottom: number;
4
+ };
5
+ title: {
6
+ color: string;
7
+ marginBottom: number;
8
+ };
9
+ };
10
+ export { style };
@@ -0,0 +1,13 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "../../../../../theme/theme";
3
+ const { colorGrayscaleL, spaceM, spaceXL } = theme();
4
+ const style = StyleSheet.create({
5
+ container: {
6
+ marginBottom: spaceXL,
7
+ },
8
+ title: {
9
+ color: colorGrayscaleL,
10
+ marginBottom: spaceM,
11
+ },
12
+ });
13
+ export { style };
@@ -1,12 +1,13 @@
1
1
  import { useI18nMessage } from "@lookiero/i18n-react";
2
2
  import React, { useCallback } from "react";
3
3
  import { RETURN_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
4
- import { InputField } from "../../../../molecules/inputField/InputField";
4
+ import { InputField } from "../../../../../shared/components/molecules/inputField/InputField";
5
5
  import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
6
+ const TEXTAREA_MIN_HEIGHT = 96;
6
7
  const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) => {
7
8
  const placeholderText = useI18nMessage({ id: returnQuestion.placeholder, prefix: RETURN_QUESTIONS_PREFIX });
8
9
  const { feedback, onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
9
10
  const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: value }), [onChange, returnQuestionParentId]);
10
- return (React.createElement(InputField, { multiline: true, label: placeholderText, placeholder: placeholderText, minHeight: 96, value: feedback, onChange: handleOnChange }));
11
+ return (React.createElement(InputField, { multiline: true, label: placeholderText, placeholder: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, value: feedback, onChange: handleOnChange }));
11
12
  };
12
13
  export { TextareaReturnQuestionItem };
@@ -1,6 +1,8 @@
1
- import { FC } from "react";
1
+ import { FC, ReactNode } from "react";
2
+ import { Edge } from "react-native-safe-area-context";
2
3
  interface SafeAreaScrollViewProps {
3
- readonly children: JSX.Element;
4
+ readonly children: ReactNode;
5
+ readonly edges?: Edge[];
4
6
  }
5
7
  declare const SafeAreaScrollView: FC<SafeAreaScrollViewProps>;
6
8
  export { SafeAreaScrollView };
@@ -1,6 +1,15 @@
1
1
  import React from "react";
2
- import { SafeAreaView, ScrollView } from "react-native";
3
- import { style } from "./SafeAreaScrollView.style";
4
- const SafeAreaScrollView = ({ children }) => (React.createElement(SafeAreaView, { style: style.container },
5
- React.createElement(ScrollView, { contentContainerStyle: style.scrollContainer, showsVerticalScrollIndicator: false }, children)));
2
+ import { ScrollView, View } from "react-native";
3
+ import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
4
+ import { theme } from "../../theme/theme";
5
+ const { spaceXL } = theme();
6
+ const SafeAreaScrollView = ({ children, edges = ["top", "bottom", "left", "right"] }) => {
7
+ const { top: safeAreaInsetTop, bottom: safeAreaInsetBottom } = useSafeAreaInsets();
8
+ return (React.createElement(SafeAreaView, { edges: edges },
9
+ React.createElement(ScrollView, { showsVerticalScrollIndicator: false },
10
+ React.createElement(View, { style: {
11
+ paddingTop: !safeAreaInsetTop ? spaceXL : 0,
12
+ paddingBottom: !safeAreaInsetBottom ? spaceXL : 0,
13
+ } }, children))));
14
+ };
6
15
  export { SafeAreaScrollView };
@@ -1,5 +1,6 @@
1
1
  declare const COLOR_I18N_PREFIX = "color.";
2
2
  declare const RETURN_QUESTIONS_PREFIX = "return_questions.";
3
+ declare const RETURN_QUESTIONS_FEEDBACK_PREFIX = "return_questions_feedback.";
3
4
  declare enum I18nMessages {
4
5
  INTRO_TITLE = "intro.title",
5
6
  INTRO_SUBTITLE = "intro.subtitle",
@@ -27,6 +28,8 @@ declare enum I18nMessages {
27
28
  GET_OUT_OF_CHECKOUT_MODAL_TITLE = "get_out_of_checkout_modal.title",
28
29
  GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION = "get_out_of_checkout_modal.description",
29
30
  GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON = "get_out_of_checkout_modal.dismiss_button",
30
- GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON = "get_out_of_checkout_modal.confirm_button"
31
+ GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON = "get_out_of_checkout_modal.confirm_button",
32
+ FEEDBACK_TITLE = "feedback.title",
33
+ FEEDBACK_UNANSWERED = "feedback.unanswered"
31
34
  }
32
- export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX };
35
+ export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX, RETURN_QUESTIONS_FEEDBACK_PREFIX };
@@ -1,5 +1,6 @@
1
1
  const COLOR_I18N_PREFIX = "color.";
2
2
  const RETURN_QUESTIONS_PREFIX = "return_questions.";
3
+ const RETURN_QUESTIONS_FEEDBACK_PREFIX = "return_questions_feedback.";
3
4
  var I18nMessages;
4
5
  (function (I18nMessages) {
5
6
  I18nMessages["INTRO_TITLE"] = "intro.title";
@@ -29,5 +30,7 @@ var I18nMessages;
29
30
  I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION"] = "get_out_of_checkout_modal.description";
30
31
  I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON"] = "get_out_of_checkout_modal.dismiss_button";
31
32
  I18nMessages["GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON"] = "get_out_of_checkout_modal.confirm_button";
33
+ I18nMessages["FEEDBACK_TITLE"] = "feedback.title";
34
+ I18nMessages["FEEDBACK_UNANSWERED"] = "feedback.unanswered";
32
35
  })(I18nMessages || (I18nMessages = {}));
33
- export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX };
36
+ export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX, RETURN_QUESTIONS_FEEDBACK_PREFIX };
@@ -2,7 +2,7 @@ import { QueryStatus } from "@lookiero/messaging-react";
2
2
  import React, { useEffect, useRef } from "react";
3
3
  import { Outlet } from "react-router-native";
4
4
  import { useViewIsCheckoutAccessibleByCustomerId } from "../../projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId";
5
- import { Spinner } from "../components/atoms/spinner/Spinner";
5
+ import { Spinner } from "../shared/components/atoms/spinner/Spinner";
6
6
  const CheckoutAccessibilityMiddleware = ({ customerId, onNotAccessible, loader = React.createElement(Spinner, null), }) => {
7
7
  const [accessible, status] = useViewIsCheckoutAccessibleByCustomerId({ customerId });
8
8
  const onNotAccessibleRef = useRef(onNotAccessible);
@@ -4,7 +4,7 @@ import { generatePath, Navigate, Outlet, useMatch } from "react-router";
4
4
  import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
5
5
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
6
6
  import { useViewCheckoutIntroShown } from "../../projection/uiSetting/react/useViewCheckoutIntroShown";
7
- import { Spinner } from "../components/atoms/spinner/Spinner";
7
+ import { Spinner } from "../shared/components/atoms/spinner/Spinner";
8
8
  import { Routes } from "./routes";
9
9
  const CheckoutMiddleware = ({ customerId, loader = React.createElement(Spinner, null) }) => {
10
10
  const [checkoutIntroShown, checkoutIntroShownStatus] = useViewCheckoutIntroShown();
@@ -1,6 +1,7 @@
1
1
  import React, { lazy, Suspense } from "react";
2
2
  import { Navigate, Outlet, useRoutes } from "react-router-native";
3
- import { Spinner } from "../components/atoms/spinner/Spinner";
3
+ import { Spinner } from "../shared/components/atoms/spinner/Spinner";
4
+ import { App } from "../views/App";
4
5
  import { CheckoutAccessibilityMiddleware } from "./CheckoutAccessibilityMiddleware";
5
6
  import { CheckoutMiddleware } from "./CheckoutMiddleware";
6
7
  import { Routes } from "./routes";
@@ -23,19 +24,25 @@ const Routing = ({ onNotAccessible, customerId, locale, I18n, onI18nError }) =>
23
24
  element: React.createElement(CheckoutMiddleware, { customerId: customerId }),
24
25
  children: [
25
26
  {
26
- path: Routes.INTRO,
27
- element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
28
- React.createElement(Intro, { customerId: customerId }))),
29
- },
30
- {
31
- path: Routes.ITEM,
32
- element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
33
- React.createElement(Item, { customerId: customerId }))),
34
- },
35
- {
36
- path: Routes.SUMMARY,
37
- element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
38
- React.createElement(Summary, null))),
27
+ path: "",
28
+ element: React.createElement(App, null),
29
+ children: [
30
+ {
31
+ path: Routes.INTRO,
32
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
33
+ React.createElement(Intro, { customerId: customerId }))),
34
+ },
35
+ {
36
+ path: Routes.ITEM,
37
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
38
+ React.createElement(Item, { customerId: customerId }))),
39
+ },
40
+ {
41
+ path: Routes.SUMMARY,
42
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
43
+ React.createElement(Summary, null))),
44
+ },
45
+ ],
39
46
  },
40
47
  ],
41
48
  },
@@ -1,5 +1,5 @@
1
1
  import { StyleSheet } from "react-native";
2
- import { theme } from "../../../theme/theme";
2
+ import { theme } from "../../../../theme/theme";
3
3
  const { colorPrimary } = theme();
4
4
  const style = StyleSheet.create({
5
5
  error: {
@@ -1,7 +1,7 @@
1
1
  import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
2
2
  import { animated, useSpring } from "@react-spring/native";
3
3
  import React from "react";
4
- import { theme } from "../../../theme/theme";
4
+ import { theme } from "../../../../theme/theme";
5
5
  import { style } from "./Field.style";
6
6
  const { spaceM } = theme();
7
7
  const Field = ({ label, isFocused = false, style: customStyle }) => {
@@ -1,5 +1,5 @@
1
1
  import { StyleSheet } from "react-native";
2
- import { theme } from "../../../theme/theme";
2
+ import { theme } from "../../../../theme/theme";
3
3
  const { colorBase, spaceS } = theme();
4
4
  const style = StyleSheet.create({
5
5
  field: {
@@ -0,0 +1,12 @@
1
+ import glyphs from "@lookiero/aurora-iconfont/dist/glyphs.json";
2
+ import { FC } from "react";
3
+ import { StyleProp, TextStyle } from "react-native";
4
+ declare type IconStyle = StyleProp<TextStyle>;
5
+ declare type IconName = keyof typeof glyphs;
6
+ interface IconProps {
7
+ readonly name: IconName;
8
+ readonly style?: IconStyle;
9
+ }
10
+ declare const Icon: FC<IconProps>;
11
+ export type { IconName, IconStyle };
12
+ export { Icon };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { Text } from "react-native";
3
+ import { theme } from "../../../../theme/theme";
4
+ import { style } from "./Icon.style";
5
+ const { iconGlyphs } = theme();
6
+ const Icon = ({ name, style: customStyle }) => (React.createElement(Text, { accessibilityElementsHidden: true, allowFontScaling: false, importantForAccessibility: "no", selectable: false, style: [style.icon, customStyle], testID: "icon" }, String.fromCharCode(iconGlyphs[name])));
7
+ export { Icon };
@@ -0,0 +1,13 @@
1
+ declare const style: {
2
+ icon: {
3
+ fontFamily: string;
4
+ fontStyle: "normal";
5
+ fontWeight: "normal";
6
+ minWidth: number;
7
+ width: number;
8
+ minHeight: number;
9
+ height: number;
10
+ fontSize: number;
11
+ };
12
+ };
13
+ export { style };
@@ -0,0 +1,16 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "../../../../theme/theme";
3
+ const { iconFamily, iconSize } = theme();
4
+ const style = StyleSheet.create({
5
+ icon: {
6
+ fontFamily: iconFamily,
7
+ fontStyle: "normal",
8
+ fontWeight: "normal",
9
+ minWidth: iconSize,
10
+ width: iconSize,
11
+ minHeight: iconSize,
12
+ height: iconSize,
13
+ fontSize: iconSize,
14
+ },
15
+ });
16
+ export { style };