@towsila/expo-ui-library 3.5.5 → 3.6.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@towsila/expo-ui-library",
3
- "version": "3.5.5",
3
+ "version": "3.6.1",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,5 +1,5 @@
1
1
  import React, { useState, ComponentProps } from "react";
2
- import { StyleProp, Text, TextInput, TextInputProps, View, ViewProps } from "react-native";
2
+ import { StyleProp, StyleSheet, Text, TextInput, TextInputProps, View, ViewProps } from "react-native";
3
3
  import { Ionicons } from "@expo/vector-icons";
4
4
  import { Fonts, textSize } from "../../tokens/typography";
5
5
  import { useAppTheme } from "../../context/ThemeContext";
@@ -20,6 +20,7 @@ interface InputProps extends TextInputProps {
20
20
  textFontFamily?: string;
21
21
  prefix?: React.ReactNode;
22
22
  bgColor?:string;
23
+ borderColor?:string;
23
24
  }
24
25
 
25
26
  export default function Input({
@@ -37,6 +38,7 @@ export default function Input({
37
38
  textFontFamily = Fonts.montserrat.regular,
38
39
  prefix,
39
40
  bgColor,
41
+ borderColor,
40
42
  ...rest
41
43
  }: InputProps) {
42
44
  const { colors } = useAppTheme();
@@ -71,6 +73,11 @@ export default function Input({
71
73
  }}
72
74
  />
73
75
  )}
76
+ {prefix && (
77
+ <View style={styles.prefix}>
78
+ {prefix}
79
+ </View>
80
+ )}
74
81
  {/* input */}
75
82
  <TextInput
76
83
  value={value}
@@ -103,7 +110,7 @@ export default function Input({
103
110
  ? colors.semantic.error
104
111
  : focused
105
112
  ? colors.primary
106
- : colors.text.primary,
113
+ : borderColor ?? colors.text.primary,
107
114
  borderWidth: error ? 1.5 : focused ? 1.5 : 1,
108
115
  }}
109
116
  {...rest}
@@ -131,3 +138,12 @@ export default function Input({
131
138
  </View>
132
139
  );
133
140
  }
141
+
142
+ const styles = StyleSheet.create({
143
+ prefix:{
144
+ flexDirection: "row",
145
+ gap: 4,
146
+ alignItems:"center",
147
+ paddingStart: 14,
148
+ }
149
+ });