@lookiero/checkout 9.7.0-beta.1 → 9.7.0-beta.2

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 (17) hide show
  1. package/cypress/integration/checkout.spec.ts +2 -2
  2. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +4 -1
  3. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +6 -2
  4. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +18 -6
  5. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +4 -1
  6. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +6 -2
  7. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +18 -6
  8. package/dist/src/version.d.ts +1 -1
  9. package/dist/src/version.js +1 -1
  10. package/package.json +1 -1
  11. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +18 -6
  12. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.test.tsx +1 -1
  13. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +4 -1
  14. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +18 -6
  15. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.test.tsx +1 -1
  16. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +4 -1
  17. package/src/infrastructure/ui/views/feedback/Feedback.test.tsx +2 -2
@@ -93,9 +93,9 @@ const checkoutFeedback = () => {
93
93
  checkoutQuestion.showCondition.some((condition) => answers.includes(condition))
94
94
  ) {
95
95
  if (checkoutQuestion.type === CheckoutQuestionType.HOST_TEXTAREA) {
96
- cy.getByTestId(`${randomCheckoutQuestionItem.id}-input`).type("Cypress E2E test");
96
+ cy.getByTestId(randomCheckoutQuestionItem.id).type("Cypress E2E test");
97
97
  } else {
98
- cy.getByTestId(`${randomCheckoutQuestionItem.id}`).click();
98
+ cy.getByTestId(randomCheckoutQuestionItem.id).click();
99
99
  }
100
100
  }
101
101
  }
@@ -8,6 +8,9 @@ const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParent
8
8
  const placeholderText = useMemo(() => (checkoutQuestion.placeholder ? formatMessage({ id: checkoutQuestion.placeholder }) : ""), [formatMessage, checkoutQuestion.placeholder]);
9
9
  const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
10
10
  const handleOnChange = useCallback((value) => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: value }), [onChange, checkoutQuestionParentId]);
11
- return (React.createElement(InputField, { label: placeholderText, style: { inputField: style.inputContainer, input: { container: style.inputContainer, input: style.input } }, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID, value: feedback, multiline: true, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus })) }));
11
+ return (React.createElement(InputField, { label: placeholderText, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID, value: feedback, multiline: true, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus })), style: {
12
+ inputField: style.inputField,
13
+ input: { container: style.inputContainer, input: style.input },
14
+ } }));
12
15
  };
13
16
  export { TextareaCheckoutQuestionItem };
@@ -1,10 +1,14 @@
1
1
  declare const style: {
2
2
  input: {
3
3
  paddingTop: number;
4
+ height?: "auto" | undefined;
4
5
  };
5
6
  inputContainer: {
6
- maxHeight: number;
7
- minHeight: number;
7
+ alignItems?: "flex-start" | undefined;
8
+ height: number;
9
+ };
10
+ inputField: {
11
+ height: number;
8
12
  };
9
13
  };
10
14
  export { style };
@@ -1,15 +1,27 @@
1
- import { StyleSheet } from "react-native";
1
+ import { Platform, StyleSheet } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
- const { space4 } = theme();
4
- const INPUT_MIN_HEIGHT = 96;
5
- const INPUT_MAX_HEIGHT = 242;
3
+ const { space2, space4 } = theme();
4
+ const INPUT_HEIGHT = 96;
6
5
  const style = StyleSheet.create({
7
6
  input: {
8
7
  paddingTop: space4,
8
+ ...Platform.select({
9
+ android: {
10
+ paddingTop: space2,
11
+ height: "auto",
12
+ },
13
+ }),
9
14
  },
10
15
  inputContainer: {
11
- maxHeight: INPUT_MAX_HEIGHT,
12
- minHeight: INPUT_MIN_HEIGHT,
16
+ height: INPUT_HEIGHT,
17
+ ...Platform.select({
18
+ android: {
19
+ alignItems: "flex-start",
20
+ },
21
+ }),
22
+ },
23
+ inputField: {
24
+ height: INPUT_HEIGHT,
13
25
  },
14
26
  });
15
27
  export { style };
@@ -11,6 +11,9 @@ const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParent, test
11
11
  const { feedback, onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
12
12
  const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: value }), [onChange, returnQuestionParent.id]);
13
13
  return (React.createElement(View, { style: style.wrapper, testID: "textarea-return-question-item" },
14
- React.createElement(InputField, { label: placeholderText, style: { inputField: style.inputContainer, input: { container: style.inputContainer, input: style.input } }, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID, value: feedback, multiline: true, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus })) })));
14
+ React.createElement(InputField, { label: placeholderText, value: feedback, input: ({ onBlur, onFocus, style }) => (React.createElement(TextInput, { placeholder: placeholderText, style: style, testID: testID, value: feedback, multiline: true, onBlur: onBlur, onChange: handleOnChange, onFocus: onFocus })), style: {
15
+ inputField: style.inputField,
16
+ input: { container: style.inputContainer, input: style.input },
17
+ } })));
15
18
  };
16
19
  export { TextareaReturnQuestionItem };
@@ -1,10 +1,14 @@
1
1
  declare const style: {
2
2
  input: {
3
3
  paddingTop: number;
4
+ height?: "auto" | undefined;
4
5
  };
5
6
  inputContainer: {
6
- maxHeight: number;
7
- minHeight: number;
7
+ alignItems?: "flex-start" | undefined;
8
+ height: number;
9
+ };
10
+ inputField: {
11
+ height: number;
8
12
  };
9
13
  wrapper: {
10
14
  backgroundColor: string;
@@ -1,15 +1,27 @@
1
- import { StyleSheet } from "react-native";
1
+ import { Platform, StyleSheet } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
- const { colorBgBase, space4, space6 } = theme();
4
- const INPUT_MIN_HEIGHT = 96;
5
- const INPUT_MAX_HEIGHT = 242;
3
+ const { colorBgBase, space2, space4, space6 } = theme();
4
+ const INPUT_HEIGHT = 96;
6
5
  const style = StyleSheet.create({
7
6
  input: {
8
7
  paddingTop: space4,
8
+ ...Platform.select({
9
+ android: {
10
+ paddingTop: space2,
11
+ height: "auto",
12
+ },
13
+ }),
9
14
  },
10
15
  inputContainer: {
11
- maxHeight: INPUT_MAX_HEIGHT,
12
- minHeight: INPUT_MIN_HEIGHT,
16
+ height: INPUT_HEIGHT,
17
+ ...Platform.select({
18
+ android: {
19
+ alignItems: "flex-start",
20
+ },
21
+ }),
22
+ },
23
+ inputField: {
24
+ height: INPUT_HEIGHT,
13
25
  },
14
26
  wrapper: {
15
27
  backgroundColor: colorBgBase,
@@ -1 +1 @@
1
- export declare const VERSION = "9.7.0-beta.1";
1
+ export declare const VERSION = "9.7.0-beta.2";
@@ -1 +1 @@
1
- export const VERSION = "9.7.0-beta.1";
1
+ export const VERSION = "9.7.0-beta.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "9.7.0-beta.1",
3
+ "version": "9.7.0-beta.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
@@ -1,18 +1,30 @@
1
- import { StyleSheet } from "react-native";
1
+ import { Platform, StyleSheet } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
3
 
4
- const { space4 } = theme();
4
+ const { space2, space4 } = theme();
5
5
 
6
- const INPUT_MIN_HEIGHT = 96;
7
- const INPUT_MAX_HEIGHT = 242;
6
+ const INPUT_HEIGHT = 96;
8
7
 
9
8
  const style = StyleSheet.create({
10
9
  input: {
11
10
  paddingTop: space4,
11
+ ...Platform.select({
12
+ android: {
13
+ paddingTop: space2,
14
+ height: "auto",
15
+ },
16
+ }),
12
17
  },
13
18
  inputContainer: {
14
- maxHeight: INPUT_MAX_HEIGHT,
15
- minHeight: INPUT_MIN_HEIGHT,
19
+ height: INPUT_HEIGHT,
20
+ ...Platform.select({
21
+ android: {
22
+ alignItems: "flex-start",
23
+ },
24
+ }),
25
+ },
26
+ inputField: {
27
+ height: INPUT_HEIGHT,
16
28
  },
17
29
  });
18
30
 
@@ -40,7 +40,7 @@ describe("TextareaCheckoutQuestionItem component (CheckoutQuestions organism)",
40
40
  );
41
41
 
42
42
  const newValue = "New input value";
43
- fireEvent.changeText(getByTestId("input-input"), newValue);
43
+ fireEvent.changeText(getByTestId("text-input"), newValue);
44
44
 
45
45
  expect(mockOnChange).toHaveBeenCalledWith({
46
46
  checkoutQuestionId: checkoutQuestionParentId,
@@ -26,7 +26,6 @@ const TextareaCheckoutQuestionItem: CheckoutQuestionItem = ({
26
26
  return (
27
27
  <InputField
28
28
  label={placeholderText}
29
- style={{ inputField: style.inputContainer, input: { container: style.inputContainer, input: style.input } }}
30
29
  value={feedback}
31
30
  input={({ onBlur, onFocus, style }) => (
32
31
  <TextInput
@@ -40,6 +39,10 @@ const TextareaCheckoutQuestionItem: CheckoutQuestionItem = ({
40
39
  onFocus={onFocus}
41
40
  />
42
41
  )}
42
+ style={{
43
+ inputField: style.inputField,
44
+ input: { container: style.inputContainer, input: style.input },
45
+ }}
43
46
  />
44
47
  );
45
48
  };
@@ -1,18 +1,30 @@
1
- import { StyleSheet } from "react-native";
1
+ import { Platform, StyleSheet } from "react-native";
2
2
  import { theme } from "@lookiero/sty-psp-ui";
3
3
 
4
- const { colorBgBase, space4, space6 } = theme();
4
+ const { colorBgBase, space2, space4, space6 } = theme();
5
5
 
6
- const INPUT_MIN_HEIGHT = 96;
7
- const INPUT_MAX_HEIGHT = 242;
6
+ const INPUT_HEIGHT = 96;
8
7
 
9
8
  const style = StyleSheet.create({
10
9
  input: {
11
10
  paddingTop: space4,
11
+ ...Platform.select({
12
+ android: {
13
+ paddingTop: space2,
14
+ height: "auto",
15
+ },
16
+ }),
12
17
  },
13
18
  inputContainer: {
14
- maxHeight: INPUT_MAX_HEIGHT,
15
- minHeight: INPUT_MIN_HEIGHT,
19
+ height: INPUT_HEIGHT,
20
+ ...Platform.select({
21
+ android: {
22
+ alignItems: "flex-start",
23
+ },
24
+ }),
25
+ },
26
+ inputField: {
27
+ height: INPUT_HEIGHT,
16
28
  },
17
29
  wrapper: {
18
30
  backgroundColor: colorBgBase,
@@ -29,7 +29,7 @@ describe("TextareaReturnQuestionItem component (ReturnQuestions organism)", () =
29
29
  );
30
30
 
31
31
  const newValue = "New input value";
32
- fireEvent.changeText(getByTestId("input-input"), newValue);
32
+ fireEvent.changeText(getByTestId("text-input"), newValue);
33
33
 
34
34
  expect(mockOnChange).toHaveBeenCalledWith({
35
35
  returnQuestionId: returnQuestionParent.id,
@@ -31,7 +31,6 @@ const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA
31
31
  <View style={style.wrapper} testID="textarea-return-question-item">
32
32
  <InputField
33
33
  label={placeholderText}
34
- style={{ inputField: style.inputContainer, input: { container: style.inputContainer, input: style.input } }}
35
34
  value={feedback}
36
35
  input={({ onBlur, onFocus, style }) => (
37
36
  <TextInput
@@ -45,6 +44,10 @@ const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA
45
44
  onFocus={onFocus}
46
45
  />
47
46
  )}
47
+ style={{
48
+ inputField: style.inputField,
49
+ input: { container: style.inputContainer, input: style.input },
50
+ }}
48
51
  />
49
52
  </View>
50
53
  );
@@ -85,14 +85,14 @@ describe("Feedback view", () => {
85
85
  feedback: "bab3d4f9-0227-4550-a53f-3c125d68429c",
86
86
  });
87
87
 
88
- fireEvent.changeText(getByTestId("1123a37d-bc00-43a4-9d28-cee1dfaf356c-input"), "Input value");
88
+ fireEvent.changeText(getByTestId("1123a37d-bc00-43a4-9d28-cee1dfaf356c"), "Input value");
89
89
  expect(mockTrackChangeFeedback).toHaveBeenLastCalledWith({
90
90
  questionId: "ce3e8d57-5eea-4dd3-bef4-2e811a143612",
91
91
  questionName: "checkout_question.comment.question",
92
92
  feedback: "Input value",
93
93
  });
94
94
 
95
- fireEvent.changeText(getByTestId("1123a37d-bc00-43a4-9d28-cee1dfaf356c-input"), "New input value");
95
+ fireEvent.changeText(getByTestId("1123a37d-bc00-43a4-9d28-cee1dfaf356c"), "New input value");
96
96
  expect(mockTrackChangeFeedback).toHaveBeenCalledTimes(3);
97
97
 
98
98
  fireEvent.press(getByText(I18nMessages.FEEDBACK_BUTTON));