@teamnhz/rn-ui-toolkit 1.4.7 → 1.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.
@@ -38,6 +38,9 @@ interface InputProps extends TextInputProps {
38
38
  isError?: boolean;
39
39
  downArrowIcon?: ImageSourcePropType;
40
40
  downArrowStyle?: object;
41
+ flagIcon?: string;
42
+ flagIconStyle?: object;
43
+ flagContainerStyle?: object;
41
44
  }
42
45
  declare const Input: React.FC<InputProps>;
43
46
  export default Input;
@@ -4,7 +4,7 @@ import { useTranslation } from "react-i18next";
4
4
  import { Colors, Typography, Scale, Images } from "../../styles";
5
5
  import { defaultRegex } from "../../utils/regex";
6
6
  import { messages } from "../../constants/messages";
7
- const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, leftIcon, rightIcon, onLeftIconPress, onRightIconPress, style, containerStyle, inputStyle, errorTextStyle, leftIconStyle, rightIconStyle, leftIconWrapperStyle, rightIconWrapperStyle, type = "text", editable = true, error, value = "", customRegex, customErrorMessage, onChangeText, onValidation, onBlur: restOnBlur, onFocus: restOnFocus, multiline = false, maxLength, returnKeyType, countryCode, onPressCountryCode, countryCodeTextStyle, countryCodeWrapperStyle, isError = true, downArrowIcon, downArrowStyle, ...rest }) => {
7
+ const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, leftIcon, rightIcon, onLeftIconPress, onRightIconPress, style, containerStyle, inputStyle, errorTextStyle, leftIconStyle, rightIconStyle, leftIconWrapperStyle, rightIconWrapperStyle, type = "text", editable = true, error, value = "", customRegex, customErrorMessage, onChangeText, onValidation, onBlur: restOnBlur, onFocus: restOnFocus, multiline = false, maxLength, returnKeyType, countryCode, onPressCountryCode, countryCodeTextStyle, countryCodeWrapperStyle, isError = true, downArrowIcon, downArrowStyle, flagIcon, flagIconStyle, flagContainerStyle, ...rest }) => {
8
8
  const { t } = useTranslation();
9
9
  const [secureText, setSecureText] = useState(type === "password");
10
10
  const [internalError, setInternalError] = useState(null);
@@ -84,6 +84,22 @@ const Input = ({ intlType, textKey, placeholder, inputPlaceholderTextColor, left
84
84
  ] },
85
85
  leftIcon && (React.createElement(TouchableOpacity, { onPress: onLeftIconPress, disabled: !onLeftIconPress, style: [styles.iconWrapper, leftIconWrapperStyle] },
86
86
  React.createElement(Image, { source: leftIcon, style: [styles.icon, leftIconStyle], resizeMode: "contain" }))),
87
+ flagIcon && countryCode && (React.createElement(TouchableOpacity, { onPress: onLeftIconPress, disabled: !onLeftIconPress, style: [
88
+ styles.iconWrapper,
89
+ {
90
+ width: "auto", // Remove fixed width
91
+ height: "auto", // Remove fixed height
92
+ padding: Scale.moderateScale(6),
93
+ },
94
+ leftIconWrapperStyle,
95
+ ] },
96
+ React.createElement(Text, { style: [
97
+ {
98
+ fontSize: 25,
99
+ lineHeight: 25,
100
+ },
101
+ flagIconStyle,
102
+ ] }, flagIcon))),
87
103
  countryCode && (React.createElement(TouchableOpacity, { onPress: onPressCountryCode, disabled: !onPressCountryCode, style: [styles.countryCodeWrapper, countryCodeWrapperStyle] },
88
104
  React.createElement(View, { style: styles.rowCenter },
89
105
  React.createElement(Image, { source: downArrowIcon || Images.down_arrow // <-- Your default arrow
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamnhz/rn-ui-toolkit",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [