@towsila/expo-ui-library 3.5.4 → 3.6.0

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.4",
3
+ "version": "3.6.0",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -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();
@@ -103,7 +105,7 @@ export default function Input({
103
105
  ? colors.semantic.error
104
106
  : focused
105
107
  ? colors.primary
106
- : colors.text.primary,
108
+ : borderColor ?? colors.text.primary,
107
109
  borderWidth: error ? 1.5 : focused ? 1.5 : 1,
108
110
  }}
109
111
  {...rest}
@@ -1,6 +1,7 @@
1
1
  import { useRef, useEffect } from "react";
2
- import { Pressable, Animated, StyleSheet, I18nManager } from "react-native";
2
+ import { Pressable, Animated, StyleSheet } from "react-native";
3
3
  import { useAppTheme } from "../../context/ThemeContext";
4
+ import { useLanguage } from "../../context/LanguageContext";
4
5
 
5
6
  interface ToggleCardProps {
6
7
  value: boolean;
@@ -24,7 +25,7 @@ export default function Toggle({
24
25
  }: ToggleCardProps) {
25
26
  const { colors } = useAppTheme();
26
27
  const tint = value ? (activeColor ?? colors.semantic.success) : (inactiveColor ?? colors.semantic.border);
27
-
28
+ const {isRTL} = useLanguage();
28
29
  const anim = useRef(new Animated.Value(value ? 1 : 0)).current;
29
30
 
30
31
  useEffect(() => {
@@ -47,13 +48,13 @@ export default function Toggle({
47
48
  onPress={() => !disabled && onValueChange(!value)}
48
49
  disabled={disabled}
49
50
  hitSlop={8}
50
- style={[I18nManager.isRTL && {transform:[{scale: -1}]} ]}
51
+ style={[isRTL && {transform:[{scale: -1}]} ]}
51
52
  >
52
53
  <Animated.View
53
54
  style={[
54
55
  styles.track,
55
56
  {
56
- backgroundColor: colors.background.main,
57
+ backgroundColor: tint,
57
58
  opacity: disabled ? 0.5 : 1,
58
59
  },
59
60
  ]}
@@ -63,7 +64,7 @@ export default function Toggle({
63
64
  styles.thumb,
64
65
  {
65
66
  left: thumbLeft,
66
- backgroundColor: tint,
67
+ backgroundColor: colors.text.primary,
67
68
  },
68
69
  ]}
69
70
  />