@towsila/expo-ui-library 3.1.3 → 3.2.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.1.3",
3
+ "version": "3.2.0",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -5,6 +5,7 @@ import { Fonts, textSize } from "../../tokens/typography";
5
5
  import PageIndicator from "../ui/pageIndicator";
6
6
  import SharpButton from "../ui/sharpButton";
7
7
  import { useLanguage } from "../../context/LanguageContext";
8
+ import BackIcon from "../ui/backIcon";
8
9
 
9
10
  interface OnBoardingProps {
10
11
  onSkip: () => void;
@@ -45,24 +46,7 @@ export default function OnBoarding({
45
46
  {/* ---------- Header ---------- */}
46
47
  <View style={{minHeight: 40,}}>
47
48
  <View style={{ height: 44, flexDirection: isRTL? "row-reverse": "row", alignItems: "center", gap: 15}}>
48
- <TouchableOpacity onPress={onBack} disabled={!onBack}
49
- style={{
50
- borderWidth: 1,
51
- borderColor: colors.text.primary,
52
- borderRadius: 100,
53
- paddingVertical: 11,
54
- paddingHorizontal: 11,
55
- opacity: onBack ? 1: 0.5
56
- }}
57
- >
58
- <ArrowBack
59
- width={19}
60
- height={19}
61
- color={colors.text.primary}
62
- style={isRTL && { transform: [{ scaleX: -1 }] }}
63
- />
64
- </TouchableOpacity>
65
-
49
+ <BackIcon onBack={onBack}/>
66
50
  <Text
67
51
  style={{
68
52
  fontSize: textSize.xl,
@@ -2,6 +2,8 @@ import { Fonts, textSize } from "../../tokens/typography";
2
2
  import { useAppTheme } from "../../context/ThemeContext";
3
3
  import { I18nManager, Text, TouchableOpacity, View } from "react-native";
4
4
  import {ArrowBack} from "@towsila/icons";
5
+ import BackIcon from "./backIcon";
6
+ import { useLanguage } from "../../context/LanguageContext";
5
7
 
6
8
  interface PageProps{
7
9
  title: string,
@@ -9,29 +11,26 @@ interface PageProps{
9
11
  onBack: ()=>void;
10
12
  }
11
13
 
12
- export default function PageTopBar({title, description, onBack}:PageProps){
13
- const {colors, isDark} = useAppTheme();
14
-
14
+ export default function ScreenHeader({title, description, onBack}:PageProps){
15
+ const {colors} = useAppTheme();
16
+ const {isRTL} = useLanguage();
15
17
  return (
16
- <View>
17
- <View style={{
18
- flexDirection: "row",
19
- alignItems: "center", marginBottom: 10 }}>
20
- <TouchableOpacity onPress={onBack}>
21
- <ArrowBack width={24} height={24} color={colors.text.primary} style={[I18nManager.isRTL && { transform: [{ scaleX: -1 }] },]}/>
22
- </TouchableOpacity>
23
- <Text style={{ flex: 1, textAlign: "center", color: colors.text.primary, fontSize: textSize.xxl, fontFamily: Fonts.montserrat.bold }}>
18
+ <View style={{minHeight: 40,}}>
19
+ <View style={{ height: 44, flexDirection: isRTL? "row-reverse": "row", alignItems: "center", gap: 15}}>
20
+ <BackIcon onBack={onBack}/>
21
+ <Text
22
+ style={{
23
+ fontSize: textSize.xl,
24
+ fontFamily: Fonts.montserrat.bold,
25
+ color: colors.text.primary,
26
+ }}
27
+ >
24
28
  {title}
25
29
  </Text>
26
- <View style={{ width: 24 }} />
27
30
  </View>
28
- <Text style={{
29
- fontSize: textSize.sm,
30
- fontFamily: Fonts.montserrat.regular,
31
- textAlign: 'center',
32
- marginBottom: 15,
33
- color: colors.text.primary,
34
- }}>
31
+ <Text
32
+ style={{fontSize: textSize.md, fontFamily: Fonts.montserrat.regular, color: colors.text.secondary, textAlign: isRTL ? "left" : "right" }}
33
+ >
35
34
  {description}
36
35
  </Text>
37
36
  </View>
@@ -0,0 +1,28 @@
1
+ import { TouchableOpacity } from "react-native";
2
+ import { useAppTheme } from "../../context/ThemeContext";
3
+ import { ArrowBack } from "@towsila/icons";
4
+ import { useLanguage } from "../..";
5
+
6
+ export default function BackIcon({onBack}:{onBack?: ()=>void}){
7
+ const {colors} = useAppTheme();
8
+ const {isRTL} = useLanguage();
9
+ return(
10
+ <TouchableOpacity onPress={onBack} disabled={!onBack}
11
+ style={{
12
+ borderWidth: 1,
13
+ borderColor: colors.text.primary,
14
+ borderRadius: 100,
15
+ paddingVertical: 11,
16
+ paddingHorizontal: 11,
17
+ opacity: onBack ? 1: 0.5
18
+ }}
19
+ >
20
+ <ArrowBack
21
+ width={19}
22
+ height={19}
23
+ color={colors.text.primary}
24
+ style={isRTL && { transform: [{ scaleX: -1 }] }}
25
+ />
26
+ </TouchableOpacity>
27
+ )
28
+ }
package/src/index.ts CHANGED
@@ -12,7 +12,7 @@ export { default as LoginScreen } from "./components/screens/loginScreen";
12
12
  export { useLoginForm } from "./hooks/useLoginForm";
13
13
  export {default as Input} from "./components/ui/input";
14
14
  export {default as ErrorMessage} from "./components/ui/error";
15
- export {default as PageTopBar} from "./components/ui/PageTopBar";
15
+ export {default as ScreenHeader} from "./components/ui/PageTopBar";
16
16
  export {default as ForgotPwScreen} from "./components/screens/forgotPasswordScreen";
17
17
  export {useForgotPasswordForm} from "./hooks/useForgotPasswordForm";
18
18
  export {default as TemplateSubPage} from "./components/reusable/templateSubPage";
@@ -64,4 +64,5 @@ export {useToast} from "./hooks/useToast";
64
64
  export {default as RatingStars} from "./components/ui/rating";
65
65
  export { getFcmToken } from "./hooks/useFcmToken";
66
66
  export {useArrivalDetection} from "./hooks/useArrivalDetection";
67
- export {default as Toggle} from "./components/ui/toggle";
67
+ export {default as Toggle} from "./components/ui/toggle";
68
+ export {default as BackIcon} from "./components/ui/backIcon";