@lookiero/checkout 0.4.7 → 0.4.8

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 (27) hide show
  1. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +1 -0
  2. package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +7 -5
  3. package/dist/infrastructure/ui/views/checkout/Checkout.js +1 -1
  4. package/dist/infrastructure/ui/views/feedback/Feedback.js +1 -1
  5. package/dist/infrastructure/ui/views/header/Header.d.ts +1 -1
  6. package/dist/infrastructure/ui/views/header/Header.js +6 -6
  7. package/dist/infrastructure/ui/views/item/Item.js +1 -2
  8. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +3 -1
  9. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +0 -1
  10. package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +1 -2
  11. package/dist/infrastructure/ui/views/summary/Summary.js +7 -9
  12. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +3 -1
  13. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.d.ts +0 -1
  14. package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.style.js +1 -2
  15. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +4 -1
  16. package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +2 -1
  17. package/dist/shared/ui/components/atoms/field/Field.js +1 -1
  18. package/dist/shared/ui/components/atoms/field/Field.style.d.ts +2 -0
  19. package/dist/shared/ui/components/atoms/field/Field.style.js +2 -0
  20. package/dist/shared/ui/components/atoms/input/Input.js +1 -1
  21. package/dist/shared/ui/components/atoms/input/Input.style.d.ts +0 -3
  22. package/dist/shared/ui/components/atoms/input/Input.style.js +0 -3
  23. package/dist/shared/ui/components/layouts/stack/Stack.js +4 -5
  24. package/dist/shared/ui/components/layouts/sticky/Sticky.style.d.ts +3 -0
  25. package/dist/shared/ui/components/layouts/sticky/Sticky.style.js +4 -9
  26. package/dist/shared/ui/components/molecules/inputField/InputField.js +6 -1
  27. package/package.json +2 -1
@@ -4,6 +4,7 @@ import { Edge } from "react-native-safe-area-context";
4
4
  type SafeAreaScrollViewStyle = "safeAreaView" | "scrollView";
5
5
  interface SafeAreaScrollViewProps {
6
6
  readonly children: ReactNode;
7
+ readonly footer?: ReactNode;
7
8
  readonly scrollerPaddingTop?: number;
8
9
  readonly edges?: Edge[];
9
10
  readonly style?: Partial<Record<SafeAreaScrollViewStyle, StyleProp<ViewStyle>>>;
@@ -1,16 +1,18 @@
1
1
  import React from "react";
2
- import { ScrollView } from "react-native";
2
+ import { Platform, ScrollView } from "react-native";
3
3
  import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
4
- const SafeAreaScrollView = ({ children, edges = ["top", "bottom", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
4
+ import { theme } from "../../theme/theme";
5
+ const { spaceXXXL } = theme();
6
+ const SafeAreaScrollView = ({ children, footer, edges = ["top", "bottom", "left", "right"], style: customStyle, scrollerPaddingTop = 0, }) => {
5
7
  const { top: safeAreaInsetTop, bottom: safeAreaInsetBottom } = useSafeAreaInsets();
6
8
  return (React.createElement(SafeAreaView, { edges: edges, style: customStyle?.safeAreaView },
7
9
  React.createElement(ScrollView, { contentContainerStyle: [
8
10
  {
9
- // Why did we set this??
10
11
  paddingTop: safeAreaInsetTop + scrollerPaddingTop,
11
- paddingBottom: safeAreaInsetBottom,
12
+ paddingBottom: safeAreaInsetBottom + (Platform.OS === "android" ? spaceXXXL : 0),
12
13
  },
13
14
  customStyle?.scrollView,
14
- ] }, children)));
15
+ ] }, children),
16
+ footer));
15
17
  };
16
18
  export { SafeAreaScrollView };
@@ -38,7 +38,7 @@ const Checkout = ({ children, customerId, useRedirect }) => {
38
38
  if (!dependenciesLoaded)
39
39
  return React.createElement(Spinner, null);
40
40
  return (React.createElement(React.Fragment, null,
41
- React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" ? HEADER_HEIGHT : 0 },
41
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0 },
42
42
  React.createElement(Body, { style: { column: style.bodyColumn } },
43
43
  hasReplacedCheckoutItem && (React.createElement(View, { style: style.deliveryBannerContainer },
44
44
  React.createElement(DeliveryBanner, null))),
@@ -30,7 +30,7 @@ const Feedback = ({ customerId }) => {
30
30
  if (!dependenciesLoaded)
31
31
  return React.createElement(Spinner, null);
32
32
  return (React.createElement(CheckoutQuestionFeedbackProvider, { feedback: {} },
33
- React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" ? HEADER_HEIGHT : 0 },
33
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0 },
34
34
  React.createElement(Body, { style: { column: style.bodyColumn } },
35
35
  React.createElement(CheckoutQuestionsForm, { checkoutQuestions: checkoutQuestions || [], submitButtonDisabled: giveCheckoutFeedbackStatus === CommandStatus.LOADING, onSubmit: handleOnSubmit })))));
36
36
  };
@@ -1,7 +1,7 @@
1
1
  import { FC } from "react";
2
2
  import { StyleProp, ViewStyle } from "react-native";
3
3
  interface MenuProps {
4
- readonly visible: boolean;
4
+ readonly isVisible: boolean;
5
5
  readonly onClose: () => void;
6
6
  }
7
7
  type Menu = FC<MenuProps>;
@@ -2,8 +2,7 @@ import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Tex
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import React, { useCallback, useState } from "react";
4
4
  import { View } from "react-native";
5
- import { SafeAreaView, // useSafeAreaInsets
6
- } from "react-native-safe-area-context";
5
+ import { SafeAreaView } from "react-native-safe-area-context";
7
6
  import { generatePath, useMatch, useNavigate, useParams } from "react-router-native";
8
7
  import { ButtonIcon } from "../../../../shared/ui/components/molecules/buttonIcon/ButtonIcon";
9
8
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
@@ -66,6 +65,7 @@ const Header = ({ customerId, menu: Menu, style: customStyle }) => {
66
65
  const itemRouteMatch = useMatch(`${basePath}/${Routes.ITEM}`);
67
66
  const itemDetailRouteMatch = useMatch(`${basePath}/${Routes.ITEM_DETAIL}`);
68
67
  const checkoutRouteMatch = useMatch(`${basePath}/${Routes.CHECKOUT}`);
68
+ const checkoutPaymentRouteMatch = useMatch(`${basePath}/${Routes.CHECKOUT}/${Routes.CHECKOUT_PAYMENT}`);
69
69
  const [menuVisible, setMenuVisible] = useState(false);
70
70
  const handleOnOpenMenu = useCallback(() => setMenuVisible(true), []);
71
71
  const handleOnCloseMenu = useCallback(() => setMenuVisible(false), []);
@@ -78,14 +78,14 @@ const Header = ({ customerId, menu: Menu, style: customStyle }) => {
78
78
  header = React.createElement(ItemDetailHeader, null);
79
79
  }
80
80
  }
81
- else if (checkoutRouteMatch) {
81
+ else if (checkoutRouteMatch || checkoutPaymentRouteMatch) {
82
82
  header = React.createElement(CheckoutHeader, null);
83
83
  }
84
84
  else {
85
85
  header = React.createElement(DefaultHeader, { onOpenMenu: handleOnOpenMenu });
86
86
  }
87
- return (React.createElement(SafeAreaView, { edges: ["top"], style: [style.container, customStyle] },
88
- header,
89
- React.createElement(Menu, { visible: menuVisible, onClose: handleOnCloseMenu })));
87
+ return (React.createElement(React.Fragment, null,
88
+ React.createElement(SafeAreaView, { edges: ["top"], style: [style.container, customStyle] }, header),
89
+ React.createElement(Menu, { isVisible: menuVisible, onClose: handleOnCloseMenu })));
90
90
  };
91
91
  export { Header };
@@ -136,7 +136,7 @@ const Item = ({ customerId }) => {
136
136
  return (React.createElement(ReturnQuestionFeedbackProvider, { feedback: checkoutItem.feedbacks || {} },
137
137
  React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
138
138
  React.createElement(SizeChangeModal, { visible: sizeChangeModalVisible, onDismiss: handleOnHideSizeChangeModal }),
139
- React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" ? HEADER_HEIGHT : 0 },
139
+ React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, footer: !customerDecissionMade && (React.createElement(ItemActions, { keepButtonLoading: keepCheckoutItemStatus === CommandStatus.LOADING, productVariantSelected: productVariantSelected, productVariants: bookedProductsVariants?.productVariants || [], returnButtonLoading: returnCheckoutItemStatus === CommandStatus.LOADING, sizeSelectorDisabled: replaceCheckoutItemStatus === CommandStatus.LOADING, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal })) },
140
140
  React.createElement(Body, null,
141
141
  customerDecissionMade && (React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: handleOnBannerPress })),
142
142
  React.createElement(View, { style: [style.container, { paddingBottom: Platform.OS === "web" ? spaceXL : stickyHeight }] },
@@ -145,7 +145,6 @@ const Item = ({ customerId }) => {
145
145
  React.createElement(ProductVariantDescription, { brand: brand, color: color, name: name, price: price, size: productVariantSelected.size }),
146
146
  checkoutItem.status === CheckoutItemStatus.RETURNED && (React.createElement(View, { style: style.feedbackContainer },
147
147
  React.createElement(ReturnQuestionsFeedback, { returnQuestions: returnQuestions || [], onEditFeedback: handleOnEditFeedback })))))),
148
- !customerDecissionMade && (React.createElement(ItemActions, { keepButtonLoading: keepCheckoutItemStatus === CommandStatus.LOADING, productVariantSelected: productVariantSelected, productVariants: bookedProductsVariants?.productVariants || [], returnButtonLoading: returnCheckoutItemStatus === CommandStatus.LOADING, sizeSelectorDisabled: replaceCheckoutItemStatus === CommandStatus.LOADING, onKeep: handleOnKeep, onLayout: handleOnStickyLayout, onReplace: handleOnReplace, onReturn: handleOnReturn, onSizeSelectorPress: handleOnShowSizeWithoutStockModal })),
149
148
  React.createElement(ReturnQuestionsForm, { checkoutItemPrice: checkoutItem.price, productVariant: checkoutItem.productVariant, returnQuestions: returnQuestions || [], visible: returnQuestionsVisible, onClose: handleOnHideReturnQuestions, onSubmit: handleOnSubmit })));
150
149
  };
151
150
  export { Item };
@@ -8,7 +8,9 @@ import { ButtonIcon } from "../../../../../../shared/ui/components/molecules/but
8
8
  import { Price } from "../../../../components/atoms/price/Price";
9
9
  import { useMediaImage } from "../../../../hooks/useMediaImage";
10
10
  import { COLOR_I18N_PREFIX, I18nMessages } from "../../../../i18n/i18n";
11
+ import { theme } from "../../../../theme/theme";
11
12
  import { IMAGE_WIDTH, style } from "./ProductVariant.style";
13
+ const { colorContent } = theme();
12
14
  const ProductVariant = ({ media, brand, name, price, size, color, status, discarded, style: customStyle, onPress, }) => {
13
15
  const uniqueText = useI18nMessage({ id: I18nMessages.ITEM_UNIQUE });
14
16
  const colorLabel = useI18nMessage({ id: color.label, prefix: COLOR_I18N_PREFIX });
@@ -23,7 +25,7 @@ const ProductVariant = ({ media, brand, name, price, size, color, status, discar
23
25
  width: IMAGE_WIDTH,
24
26
  }),
25
27
  } }),
26
- discarded && (React.createElement(Svg, { preserveAspectRatio: "none", style: style.discarded, testID: "discarded", viewBox: "0 0 100 100" },
28
+ discarded && (React.createElement(Svg, { preserveAspectRatio: "none", stroke: colorContent, style: style.discarded, testID: "discarded", viewBox: "0 0 100 100" },
27
29
  React.createElement(Line, { vectorEffect: "non-scaling-stroke", x1: "100", x2: "0", y1: "0", y2: "100" })))),
28
30
  React.createElement(View, { style: style.descriptionContainer },
29
31
  React.createElement(View, null,
@@ -15,7 +15,6 @@ declare const style: {
15
15
  height: string;
16
16
  left: number;
17
17
  position: "absolute";
18
- stroke: string;
19
18
  top: number;
20
19
  width: string;
21
20
  zIndex: number;
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../theme/theme";
3
- const { borderSize, colorContent, colorGrayscaleL, colorInfo, spaceXS, spaceS, spaceM } = theme();
3
+ const { borderSize, colorGrayscaleL, colorInfo, spaceXS, spaceS, spaceM } = theme();
4
4
  const IMAGE_WIDTH = 96;
5
5
  const IMAGE_HEIGHT = 120;
6
6
  const style = StyleSheet.create({
@@ -19,7 +19,6 @@ const style = StyleSheet.create({
19
19
  height: "100%",
20
20
  left: 0,
21
21
  position: "absolute",
22
- stroke: colorContent,
23
22
  top: 0,
24
23
  width: "100%",
25
24
  zIndex: 10,
@@ -43,14 +43,12 @@ const Summary = ({ customerId }) => {
43
43
  dependenciesLoadedStatuses.includes(fiveItemsDiscountStatus);
44
44
  if (!dependenciesLoaded)
45
45
  return React.createElement(Spinner, null);
46
- return (React.createElement(React.Fragment, null,
47
- React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" ? HEADER_HEIGHT : 0, style: { safeAreaView: style.container } },
48
- React.createElement(Body, { style: { row: { paddingBottom: pricingHeight || spaceXL } } },
49
- fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
50
- React.createElement(View, { style: style.content },
51
- React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
52
- React.createElement(Text, { level: 3, style: style.description, body: true }, descriptionText)),
53
- React.createElement(CheckoutItemsTabs, { checkoutItemsKept: checkoutItemsKept || [], checkoutItemsReturned: checkoutItemsReturned || [], onPressItem: handleOnPressItem }))),
54
- pricing && (React.createElement(StickyPricing, { collapsed: pricingCollapsed, pricing: pricing, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined, onPress: handleOnPressPricing, onSubmit: handleOnSubmit }))));
46
+ return (React.createElement(SafeAreaScrollView, { scrollerPaddingTop: Platform.OS === "web" || Platform.OS === "android" ? HEADER_HEIGHT : 0, style: { safeAreaView: style.container }, footer: pricing && (React.createElement(StickyPricing, { collapsed: pricingCollapsed, pricing: pricing, totalCheckoutItemsKept: checkoutItemsKept?.length || 0, onLayout: Platform.OS !== "web" ? handleOnPricingLayout : undefined, onPress: handleOnPressPricing, onSubmit: handleOnSubmit })) },
47
+ React.createElement(Body, { style: { row: { paddingBottom: pricingHeight || spaceXL } } },
48
+ fiveItemsDiscount !== 0 && React.createElement(FiveItemsDiscountBanner, { fiveItemsDiscount: fiveItemsDiscount }),
49
+ React.createElement(View, { style: style.content },
50
+ React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
51
+ React.createElement(Text, { level: 3, style: style.description, body: true }, descriptionText)),
52
+ React.createElement(CheckoutItemsTabs, { checkoutItemsKept: checkoutItemsKept || [], checkoutItemsReturned: checkoutItemsReturned || [], onPressItem: handleOnPressItem }))));
55
53
  };
56
54
  export { Summary };
@@ -6,9 +6,11 @@ import React from "react";
6
6
  import { Pressable, View } from "react-native";
7
7
  import { Price } from "../../../../components/atoms/price/Price";
8
8
  import { I18nMessages } from "../../../../i18n/i18n";
9
+ import { theme } from "../../../../theme/theme";
9
10
  import { style } from "./Pricing.style";
10
11
  import { ArrowDown } from "./icons/ArrowDown";
11
12
  import { ArrowUp } from "./icons/ArrowUp";
13
+ const { colorGrayscaleS } = theme();
12
14
  const PS_SERVICE_FREE_INDICATOR = 100;
13
15
  const Row = ({ text, level = 3, children }) => (React.createElement(View, { style: style.row },
14
16
  React.createElement(Text, { level: level, style: style.uppercase, action: true }, text),
@@ -32,7 +34,7 @@ const Pricing = ({ orderTotal, subtotal, balanceDiscount, discount, discountPerc
32
34
  const collapsedStyle = useSpring({ opacitiy: collapsed ? 1 : 0 });
33
35
  const notCollapsedStyle = useSpring({ opacitiy: collapsed ? 0 : 1 });
34
36
  return (React.createElement(Pressable, { testID: "pricing", onPress: collapsible ? onPress : null },
35
- collapsible && (React.createElement(View, { style: style.iconContainer }, collapsed ? (React.createElement(ArrowUp, { style: style.icon, testID: "arrow-up" })) : (React.createElement(ArrowDown, { style: style.icon, testID: "arrow-down" })))),
37
+ 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" })))),
36
38
  collapsed && collapsible ? (React.createElement(animated.View, { style: [style.collapsed, { opacity: collapsedStyle.opacitiy }] },
37
39
  React.createElement(View, null,
38
40
  React.createElement(Text, { level: 1, style: style.totalCollapsed, detail: true },
@@ -10,7 +10,6 @@ declare const style: {
10
10
  };
11
11
  icon: {
12
12
  height: number;
13
- stroke: string;
14
13
  width: number;
15
14
  };
16
15
  iconContainer: {
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { theme } from "../../../../theme/theme";
3
- const { colorContent, colorGrayscaleS, spaceXS, spaceL } = theme();
3
+ const { colorContent, spaceXS, spaceL } = theme();
4
4
  const style = StyleSheet.create({
5
5
  collapsed: {
6
6
  flexDirection: "row",
@@ -13,7 +13,6 @@ const style = StyleSheet.create({
13
13
  },
14
14
  icon: {
15
15
  height: 10,
16
- stroke: colorGrayscaleS,
17
16
  width: 58,
18
17
  },
19
18
  iconContainer: {
@@ -1,17 +1,20 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
3
3
  notifications: {
4
+ flexDirection: "column";
4
5
  top: number;
5
6
  width: string;
6
7
  zIndex: number;
7
8
  left: number;
8
9
  } | {
10
+ flexDirection: "column";
9
11
  top: number;
10
12
  width: string;
11
13
  zIndex: number;
12
- position: "sticky";
14
+ position: "fixed";
13
15
  left: number;
14
16
  } | {
17
+ flexDirection: "column";
15
18
  top: number;
16
19
  width: string;
17
20
  zIndex: number;
@@ -7,10 +7,11 @@ const style = StyleSheet.create({
7
7
  notifications: {
8
8
  left: 0,
9
9
  ...Platform.select({
10
- web: { position: "sticky" },
10
+ web: { position: "fixed" },
11
11
  ios: { position: "absolute" },
12
12
  android: { position: "absolute" },
13
13
  }),
14
+ flexDirection: "column",
14
15
  top: 0,
15
16
  width: "100%",
16
17
  zIndex: 20,
@@ -23,7 +23,7 @@ const Field = ({ label, isFocused = false, style: customStyle }) => {
23
23
  },
24
24
  customStyle?.field,
25
25
  ] },
26
- React.createElement(Text, { level: 1, style: [style.fieldText, customStyle?.fieldText], detail: true }, label),
26
+ React.createElement(Text, { level: 1, numberOfLines: 1, style: [style.fieldText, customStyle?.fieldText], detail: true }, label),
27
27
  React.createElement(View, { style: [style.fieldBackground, { opacity: isFocused ? 1 : 0 }] })));
28
28
  };
29
29
  export { Field };
@@ -7,6 +7,8 @@ declare const style: {
7
7
  zIndex: number;
8
8
  };
9
9
  fieldText: {
10
+ flexWrap: "nowrap";
11
+ overflow: "hidden";
10
12
  paddingHorizontal: number;
11
13
  zIndex: number;
12
14
  };
@@ -10,6 +10,8 @@ const style = StyleSheet.create({
10
10
  zIndex: 0,
11
11
  },
12
12
  fieldText: {
13
+ flexWrap: "nowrap",
14
+ overflow: "hidden",
13
15
  paddingHorizontal: spaceS,
14
16
  zIndex: 1,
15
17
  },
@@ -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, { ...restOfProps, ref: textInputRef, multiline: multiline, placeholderTextColor: placeholderTextColor, style: [style.input, customStyle, { height }], testID: "input", textAlignVertical: "top", value: value, onChange: onChange, onContentSizeChange: handleOnContentSizeChange }));
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 };
@@ -8,12 +8,9 @@ declare const style: {
8
8
  fontFamily: string;
9
9
  fontSize: number;
10
10
  letterSpacing: number;
11
- outlineStyle: string;
12
11
  paddingBottom: number;
13
12
  paddingHorizontal: number;
14
13
  paddingTop: number;
15
- textOverflow: string;
16
- whiteSpace: string;
17
14
  };
18
15
  };
19
16
  export { style, borderSize, paddingVertical };
@@ -10,12 +10,9 @@ const style = StyleSheet.create({
10
10
  fontFamily: fontMap.Body,
11
11
  fontSize: fontBodySize3,
12
12
  letterSpacing: fontBodyLetterSpacing3,
13
- outlineStyle: "none",
14
13
  paddingBottom: paddingVertical,
15
14
  paddingHorizontal: spaceM,
16
15
  paddingTop: paddingVertical,
17
- textOverflow: "ellipsis",
18
- whiteSpace: "nowrap",
19
16
  ...Platform.select({
20
17
  web: {
21
18
  lineHeight: fontBodyHeight3,
@@ -1,19 +1,18 @@
1
1
  import { animated, useTransition } from "@react-spring/native";
2
- import React, { useCallback, useState, useMemo } from "react";
2
+ import React, { useCallback, useState } from "react";
3
3
  import { View } from "react-native";
4
4
  import { style } from "./Stack.style";
5
5
  const Stack = ({ children, style: customStyle }) => {
6
6
  const [heights, setHeights] = useState({});
7
7
  const handleOnLayout = useCallback((itemKey) => ({ nativeEvent: { layout } }) => setHeights((heights) => ({ ...heights, [itemKey]: layout.height })), []);
8
- const outState = useMemo(() => ({ opacity: 0, height: 0, translateY: -50 }), []);
9
- const inState = useCallback((height = 0) => ({ opacity: 1, height, translateY: 0 }), []);
8
+ const inState = useCallback((height) => ({ opacity: 1, height, translateY: 0 }), []);
10
9
  const transitions = useTransition(children, {
11
10
  keys: (item) => `${item.key}`,
12
11
  native: true,
13
- from: outState,
12
+ from: { opacity: 0, height: undefined, translateY: -50 },
14
13
  enter: (item) => inState(heights[item.key]),
15
14
  update: (item) => inState(heights[item.key]),
16
- leave: outState,
15
+ leave: { opacity: 0, height: 0, translateY: -50 },
17
16
  });
18
17
  return (React.createElement(View, { pointerEvents: "box-none", style: [style.stack, customStyle] }, transitions(({ opacity, height, translateY }, item, { phase }) => (React.createElement(animated.View, { key: item.key, testID: "stack-item", style: [
19
18
  {
@@ -1,6 +1,7 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
3
3
  sticky: {
4
+ zIndex: number;
4
5
  backgroundColor: string;
5
6
  bottom: number;
6
7
  elevation: number;
@@ -14,6 +15,7 @@ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
14
15
  shadowRadius: number;
15
16
  width: string;
16
17
  } | {
18
+ zIndex: number;
17
19
  position: "sticky";
18
20
  backgroundColor: string;
19
21
  bottom: number;
@@ -28,6 +30,7 @@ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
28
30
  shadowRadius: number;
29
31
  width: string;
30
32
  } | {
33
+ zIndex: number;
31
34
  position: "absolute";
32
35
  backgroundColor: string;
33
36
  bottom: number;
@@ -18,16 +18,11 @@ const style = StyleSheet.create({
18
18
  shadowRadius: elevationRadius,
19
19
  width: "100%",
20
20
  ...Platform.select({
21
- web: {
22
- position: "sticky",
23
- },
24
- ios: {
25
- position: "absolute",
26
- },
27
- android: {
28
- position: "absolute",
29
- },
21
+ web: { position: "sticky" },
22
+ ios: { position: "absolute" },
23
+ android: { position: "absolute" },
30
24
  }),
25
+ zIndex: 0,
31
26
  },
32
27
  });
33
28
  export { style };
@@ -8,6 +8,7 @@ import { Input } from "../../atoms/input/Input";
8
8
  import { style } from "./InputField.style";
9
9
  const { colorBase, colorContent, colorGrayscaleL, colorPrimary, spaceM, iconSize } = theme();
10
10
  const inputPaddingRightWithIcon = iconSize + spaceM * 2;
11
+ const inputPaddingRightWithoutIcon = spaceM * 2;
11
12
  const InputField = ({ label, placeholder, value, multiline = false, minHeight, error, style: customStyle, onChange = () => void 0, icon, ...inputRestProps }) => {
12
13
  const [isFocused, setIsFocused] = useState(false);
13
14
  const handleOnChange = useCallback((text) => onChange(text), [onChange]);
@@ -17,7 +18,11 @@ const InputField = ({ label, placeholder, value, multiline = false, minHeight, e
17
18
  return (React.createElement(View, { style: customStyle?.inputField, testID: "input-field" },
18
19
  React.createElement(Field, { isFocused: isFocused || !!value, label: label, style: {
19
20
  field: [style.field, customStyle?.field],
20
- fieldText: [{ color }, customStyle?.fieldText],
21
+ fieldText: [
22
+ { color },
23
+ { paddingRight: !!icon ? inputPaddingRightWithIcon : inputPaddingRightWithoutIcon },
24
+ customStyle?.fieldText,
25
+ ],
21
26
  } }),
22
27
  React.createElement(Input, { minHeight: minHeight, multiline: multiline, placeholder: placeholder, placeholderTextColor: isFocused ? colorGrayscaleL : colorBase, style: [!!icon && { paddingRight: inputPaddingRightWithIcon }, { borderColor: color }, customStyle?.input], value: value, onBlur: handleOnBlur, onChangeText: handleOnChange, onFocus: handleOnFocus, ...inputRestProps }),
23
28
  !!icon && React.createElement(Icon, { name: icon, style: [style.icon, { color }, customStyle?.icon] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -53,6 +53,7 @@
53
53
  "react": "^18.0.0",
54
54
  "react-dom": "^18.0.0",
55
55
  "react-native": "^0.70.6",
56
+ "react-native-get-random-values": "^1.8.0",
56
57
  "react-native-web": "^0.18.9",
57
58
  "react-router-dom": "^6.4.5",
58
59
  "react-router-native": "^6.4.5"