@lookiero/checkout 0.2.27-beta.5 → 0.2.27-beta.6
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
3
|
declare type FieldStyle = {
|
|
4
|
-
readonly field: ViewStyle
|
|
5
|
-
readonly fieldText: TextStyle
|
|
4
|
+
readonly field: StyleProp<ViewStyle>;
|
|
5
|
+
readonly fieldText: StyleProp<TextStyle>;
|
|
6
6
|
};
|
|
7
7
|
interface FieldProps {
|
|
8
8
|
readonly label: string;
|
|
@@ -8,7 +8,6 @@ const { spaceM } = theme();
|
|
|
8
8
|
const Field = ({ label, isFocused = false, style: customStyle }) => {
|
|
9
9
|
const springs = useSpring(isFocused ? { scale: 0.75, translateY: -14, translateX: 0 } : { scale: 1, translateY: spaceM, translateX: spaceM });
|
|
10
10
|
return (React.createElement(animated.View, { pointerEvents: "none", style: [
|
|
11
|
-
customStyle?.field,
|
|
12
11
|
{
|
|
13
12
|
transform: [
|
|
14
13
|
{
|
|
@@ -22,6 +21,7 @@ const Field = ({ label, isFocused = false, style: customStyle }) => {
|
|
|
22
21
|
},
|
|
23
22
|
],
|
|
24
23
|
},
|
|
24
|
+
customStyle?.field,
|
|
25
25
|
] },
|
|
26
26
|
React.createElement(Text, { level: 1, style: [style.fieldText, customStyle?.fieldText], detail: true }, label),
|
|
27
27
|
React.createElement(View, { style: [style.fieldBackground, { opacity: isFocused ? 1 : 0 }] })));
|
|
@@ -16,11 +16,8 @@ const InputField = ({ label, placeholder, value, multiline = false, minHeight, e
|
|
|
16
16
|
const color = error ? colorPrimary : isFocused ? colorContent : colorGrayscaleL;
|
|
17
17
|
return (React.createElement(View, { style: customStyle?.inputField, testID: "input-field" },
|
|
18
18
|
React.createElement(Field, { isFocused: isFocused || !!value, label: label, style: {
|
|
19
|
-
field:
|
|
20
|
-
fieldText: {
|
|
21
|
-
color,
|
|
22
|
-
...customStyle?.fieldText,
|
|
23
|
-
},
|
|
19
|
+
field: [style.field, customStyle?.field],
|
|
20
|
+
fieldText: [{ color }, customStyle?.fieldText],
|
|
24
21
|
} }),
|
|
25
22
|
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 }),
|
|
26
23
|
!!icon && React.createElement(Icon, { name: icon, style: [style.icon, { color }, customStyle?.icon] }),
|