@lookiero/checkout 0.3.13 → 0.3.15

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 (20) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestionItem.d.ts +10 -0
  3. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestionItem.js +1 -0
  4. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.d.ts +3 -0
  5. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +18 -0
  6. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.d.ts +6 -0
  7. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.js +9 -0
  8. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.d.ts +5 -0
  9. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.js +19 -0
  10. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/icons/Happy.d.ts +3 -0
  11. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/icons/Happy.js +8 -0
  12. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/icons/Normal.d.ts +3 -0
  13. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/icons/Normal.js +8 -0
  14. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/icons/Sad.d.ts +3 -0
  15. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/icons/Sad.js +8 -0
  16. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/icons/icon.d.ts +4 -0
  17. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/icons/icon.js +1 -0
  18. package/dist/src/infrastructure/ui/i18n/i18n.d.ts +2 -1
  19. package/dist/src/infrastructure/ui/i18n/i18n.js +2 -1
  20. package/package.json +1 -1
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -0,0 +1,10 @@
1
+ import { FC, ReactNode } from "react";
2
+ import { CheckoutQuestionProjection } from "../../../../../projection/checkoutQuestion/checkoutQuestion";
3
+ interface CheckoutQuestionItemProps {
4
+ readonly checkoutQuestion: CheckoutQuestionProjection;
5
+ readonly checkoutQuestionParentId: string;
6
+ readonly children?: ReactNode;
7
+ readonly portalHostName?: string;
8
+ }
9
+ type CheckoutQuestionItem = FC<CheckoutQuestionItemProps>;
10
+ export type { CheckoutQuestionItem, CheckoutQuestionItemProps };
@@ -0,0 +1,3 @@
1
+ import { CheckoutQuestionItem } from "../../CheckoutQuestionItem";
2
+ declare const ButtonCheckoutQuestionItem: CheckoutQuestionItem;
3
+ export { ButtonCheckoutQuestionItem };
@@ -0,0 +1,18 @@
1
+ import { Button } from "@lookiero/aurora-next/build/components/atoms/Button/Button";
2
+ import { BUTTON_VARIANT } from "@lookiero/aurora-next/build/components/atoms/Button/Button.definition";
3
+ import { useI18nMessage } from "@lookiero/i18n-react";
4
+ import React, { useCallback } from "react";
5
+ import { CHECKOUT_QUESTIONS_PREFIX } from "../../../../../i18n/i18n";
6
+ import { style } from "./ButtonCheckoutQuestionItem.style";
7
+ const ButtonCheckoutQuestionItem = ({ checkoutQuestion }) => {
8
+ const optionText = useI18nMessage({ id: checkoutQuestion.name, prefix: CHECKOUT_QUESTIONS_PREFIX });
9
+ const handleOnPress = useCallback(() => void 0, []);
10
+ return (React.createElement(Button
11
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
12
+ // @ts-ignore
13
+ , {
14
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
15
+ // @ts-ignore
16
+ style: style.button, variant: BUTTON_VARIANT.SECONDARY, onPress: handleOnPress }, optionText));
17
+ };
18
+ export { ButtonCheckoutQuestionItem };
@@ -0,0 +1,6 @@
1
+ declare const style: {
2
+ button: {
3
+ borderRadius: number;
4
+ };
5
+ };
6
+ export { style };
@@ -0,0 +1,9 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "../../../../../theme/theme";
3
+ const { inputSize } = theme();
4
+ const style = StyleSheet.create({
5
+ button: {
6
+ borderRadius: inputSize / 2,
7
+ },
8
+ });
9
+ export { style };
@@ -0,0 +1,5 @@
1
+ import { CheckoutQuestionItem } from "../../CheckoutQuestionItem";
2
+ type IconName = "icon_bad" | "icon_regular" | "icon_good";
3
+ declare const IconCheckoutQuestionItem: CheckoutQuestionItem;
4
+ export type { IconName };
5
+ export { IconCheckoutQuestionItem };
@@ -0,0 +1,19 @@
1
+ import React, { useCallback } from "react";
2
+ import { Pressable } from "react-native";
3
+ import invariant from "tiny-invariant";
4
+ import { Happy } from "./icons/Happy";
5
+ import { Normal } from "./icons/Normal";
6
+ import { Sad } from "./icons/Sad";
7
+ const ICON = {
8
+ icon_bad: Sad,
9
+ icon_regular: Normal,
10
+ icon_good: Happy,
11
+ };
12
+ const IconCheckoutQuestionItem = ({ checkoutQuestion }) => {
13
+ const Icon = ICON[checkoutQuestion.name];
14
+ const handleOnPress = useCallback(() => void 0, []);
15
+ invariant(Icon, "CheckoutQuestion icon does not exist");
16
+ return (React.createElement(Pressable, { onPress: handleOnPress },
17
+ React.createElement(Icon, { testID: checkoutQuestion.name })));
18
+ };
19
+ export { IconCheckoutQuestionItem };
@@ -0,0 +1,3 @@
1
+ import { Icon } from "./icon";
2
+ declare const Happy: Icon;
3
+ export { Happy };
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import Svg, { Circle, Path } from "react-native-svg";
3
+ const Happy = (props) => (React.createElement(Svg, { fill: "none", height: 48, width: 48, ...props },
4
+ React.createElement(Circle, { cx: 24, cy: 24, r: 23.5, stroke: "#000" }),
5
+ React.createElement(Circle, { cx: 16, cy: 17, fill: "#000", r: 2 }),
6
+ React.createElement(Circle, { cx: 32, cy: 17, fill: "#000", r: 2 }),
7
+ React.createElement(Path, { d: "M14 28.5s3 6 10 6 10-6 10-6", stroke: "#000" })));
8
+ export { Happy };
@@ -0,0 +1,3 @@
1
+ import { Icon } from "./icon";
2
+ declare const Normal: Icon;
3
+ export { Normal };
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import Svg, { Circle, Path } from "react-native-svg";
3
+ const Normal = (props) => (React.createElement(Svg, { fill: "none", height: 48, width: 48, ...props },
4
+ React.createElement(Circle, { cx: 24, cy: 24, r: 23.5, stroke: "#000" }),
5
+ React.createElement(Circle, { cx: 16, cy: 17, fill: "#000", r: 2 }),
6
+ React.createElement(Circle, { cx: 32, cy: 17, fill: "#000", r: 2 }),
7
+ React.createElement(Path, { d: "M15 31h19v1H15z", fill: "#000" })));
8
+ export { Normal };
@@ -0,0 +1,3 @@
1
+ import { Icon } from "./icon";
2
+ declare const Sad: Icon;
3
+ export { Sad };
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import Svg, { Circle, Path } from "react-native-svg";
3
+ const Sad = (props) => (React.createElement(Svg, { fill: "none", height: 48, width: 48, ...props },
4
+ React.createElement(Circle, { cx: 24, cy: 24, r: 23.5, stroke: "#000" }),
5
+ React.createElement(Circle, { cx: 16, cy: 17, fill: "#000", r: 2 }),
6
+ React.createElement(Circle, { cx: 32, cy: 17, fill: "#000", r: 2 }),
7
+ React.createElement(Path, { d: "M14 33.5s3-6 10-6 10 6 10 6", stroke: "#000" })));
8
+ export { Sad };
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { SvgProps } from "react-native-svg";
3
+ type Icon = FC<SvgProps>;
4
+ export type { Icon };
@@ -1,6 +1,7 @@
1
1
  declare const COLOR_I18N_PREFIX = "color.";
2
2
  declare const RETURN_QUESTIONS_PREFIX = "return_questions.";
3
3
  declare const RETURN_QUESTIONS_FEEDBACK_PREFIX = "return_questions_feedback.";
4
+ declare const CHECKOUT_QUESTIONS_PREFIX = "checkout_questions.";
4
5
  declare enum I18nMessages {
5
6
  INTRO_TITLE = "intro.title",
6
7
  INTRO_SUBTITLE = "intro.subtitle",
@@ -58,4 +59,4 @@ declare enum I18nMessages {
58
59
  CHECKOUT_SUCCESS_MODAL_BUTTON = "checkout.success_modal_button",
59
60
  CHECKOUT_DELIVERY_BANNER = "checkout.delivery_banner"
60
61
  }
61
- export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX, RETURN_QUESTIONS_FEEDBACK_PREFIX };
62
+ export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX, RETURN_QUESTIONS_FEEDBACK_PREFIX, CHECKOUT_QUESTIONS_PREFIX, };
@@ -1,6 +1,7 @@
1
1
  const COLOR_I18N_PREFIX = "color.";
2
2
  const RETURN_QUESTIONS_PREFIX = "return_questions.";
3
3
  const RETURN_QUESTIONS_FEEDBACK_PREFIX = "return_questions_feedback.";
4
+ const CHECKOUT_QUESTIONS_PREFIX = "checkout_questions.";
4
5
  var I18nMessages;
5
6
  (function (I18nMessages) {
6
7
  I18nMessages["INTRO_TITLE"] = "intro.title";
@@ -59,4 +60,4 @@ var I18nMessages;
59
60
  I18nMessages["CHECKOUT_SUCCESS_MODAL_BUTTON"] = "checkout.success_modal_button";
60
61
  I18nMessages["CHECKOUT_DELIVERY_BANNER"] = "checkout.delivery_banner";
61
62
  })(I18nMessages || (I18nMessages = {}));
62
- export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX, RETURN_QUESTIONS_FEEDBACK_PREFIX };
63
+ export { I18nMessages, COLOR_I18N_PREFIX, RETURN_QUESTIONS_PREFIX, RETURN_QUESTIONS_FEEDBACK_PREFIX, CHECKOUT_QUESTIONS_PREFIX, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [