@towsila/expo-ui-library 3.0.0 → 3.0.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.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,9 +1,10 @@
1
- import { Text, TouchableOpacity, View, StyleSheet, I18nManager, Pressable } from "react-native";
1
+ import { Text, TouchableOpacity, View, StyleSheet } from "react-native";
2
2
  import { ArrowBack} from "@towsila/icons";
3
3
  import { useAppTheme } from "../../context/ThemeContext";
4
4
  import { Fonts, textSize } from "../../tokens/typography";
5
5
  import PageIndicator from "../ui/pageIndicator";
6
6
  import SharpButton from "../ui/sharpButton";
7
+ import { useLanguage } from "../../context/LanguageContext";
7
8
 
8
9
  interface OnBoardingProps {
9
10
  onSkip: () => void;
@@ -33,7 +34,7 @@ export default function OnBoarding({
33
34
  stepsLabel,
34
35
  }: OnBoardingProps) {
35
36
  const { colors } = useAppTheme();
36
-
37
+ const {isRTL} = useLanguage();
37
38
  return (
38
39
  <View
39
40
  style={[
@@ -46,15 +47,11 @@ export default function OnBoarding({
46
47
  <View style={{ height: 44, flexDirection: "row", alignItems: "center", gap: 15}}>
47
48
  <TouchableOpacity onPress={onBack} disabled={!onBack}
48
49
  style={{
49
- // position: "absolute",
50
- // left: I18nManager.isRTL ? undefined : 0,
51
- // right: I18nManager.isRTL ? 0 : undefined,
52
50
  borderWidth: 1,
53
51
  borderColor: colors.text.primary,
54
52
  borderRadius: 100,
55
53
  paddingVertical: 11,
56
54
  paddingHorizontal: 11,
57
- // zIndex: 1,
58
55
  opacity: onBack ? 1: 0.5
59
56
  }}
60
57
  >
@@ -62,7 +59,7 @@ export default function OnBoarding({
62
59
  width={19}
63
60
  height={19}
64
61
  color={colors.text.primary}
65
- style={I18nManager.isRTL && { transform: [{ scaleX: -1 }] }}
62
+ style={isRTL && { transform: [{ scaleX: -1 }] }}
66
63
  />
67
64
  </TouchableOpacity>
68
65
 
@@ -80,7 +77,7 @@ export default function OnBoarding({
80
77
  <Text
81
78
  style={[
82
79
  styles.skipLabel,
83
- { color: colors.text.primary, textAlign: I18nManager.isRTL ? "right" : "left" },
80
+ { color: colors.text.primary, textAlign: isRTL ? "right" : "left" },
84
81
  ]}
85
82
  >
86
83
  {skipLabel}
@@ -91,7 +88,7 @@ export default function OnBoarding({
91
88
  {/* ---------- Content ---------- */}
92
89
  <View style={styles.content}>
93
90
  {/* Image */}
94
- <View style={[styles.imageContainer, I18nManager.isRTL && { transform: [{ scaleX: -1 }] }]}>
91
+ <View style={[styles.imageContainer,isRTL && { transform: [{ scaleX: -1 }] }]}>
95
92
  {image}
96
93
  </View>
97
94
 
@@ -109,7 +106,7 @@ export default function OnBoarding({
109
106
  <Text
110
107
  style={[
111
108
  styles.description,
112
- { color: colors.text.secondary },
109
+ { color: colors.text.secondary,textAlign: isRTL ? "right" : "left", },
113
110
  ]}
114
111
  >
115
112
  {description}
@@ -153,7 +150,6 @@ const styles = StyleSheet.create({
153
150
  description: {
154
151
  fontSize: textSize.sm,
155
152
  fontFamily: Fonts.montserrat.regular,
156
- textAlign: I18nManager.isRTL ? "right" : "left",
157
153
  },
158
154
 
159
155
  indicatorContainer: {
@@ -1,6 +1,6 @@
1
- import { View, Text, I18nManager } from "react-native";
2
- import Svg, { Circle } from "react-native-svg";
1
+ import { View, Text } from "react-native";
3
2
  import { Fonts, textSize } from "../../tokens/typography";
3
+ import { useLanguage } from "../../context/LanguageContext";
4
4
 
5
5
  type Props = {
6
6
  stepsLabel?: string;
@@ -12,7 +12,7 @@ type Props = {
12
12
  };
13
13
 
14
14
  const BAR_HEIGHT = 6;
15
-
15
+ const {isRTL} = useLanguage();
16
16
  export default function PageIndicator({
17
17
  stepsLabel="Steps",
18
18
  total = 3,
@@ -22,12 +22,12 @@ export default function PageIndicator({
22
22
  defaultColor,
23
23
  }: Props) {
24
24
  return (
25
- <View style={{ alignItems: I18nManager.isRTL ? "flex-start" : "flex-end", gap: 15, width: "100%" }}>
25
+ <View style={{ alignItems: isRTL ? "flex-start" : "flex-end", gap: 15, width: "100%" }}>
26
26
  <Text style={{ color: textColor, fontSize: textSize.md, fontFamily: Fonts.montserrat.semiBold }}>
27
27
  {stepsLabel}
28
28
  </Text>
29
29
 
30
- <View style={{ flexDirection: I18nManager.isRTL ? "row" : "row-reverse", gap: 8, width: "100%" }}>
30
+ <View style={{ flexDirection: isRTL ? "row" : "row-reverse", gap: 8, width: "100%" }}>
31
31
  {Array.from({ length: total }).map((_, index) => (
32
32
  <View
33
33
  key={index}