@towsila/expo-ui-library 1.0.12 → 1.0.14

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": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -48,6 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@expo/vector-icons": "^15.1.1",
51
+ "@towsila/icons": "^1.0.1",
51
52
  "expo-linear-gradient": "*",
52
53
  "expo-secure-store": "*",
53
54
  "react-native-svg": "*"
@@ -3,7 +3,7 @@ import Input from "../ui/input";
3
3
  import "../../utils/inputValidator/customValidator";
4
4
  import { useForgotPasswordForm } from "../../hooks/useForgotPasswordForm";
5
5
  import SharpInput from "../ui/sharpInput";
6
- import MailIcon from "../../assets/customIcons/email.svg";
6
+ import {Email} from "@towsila/icons";
7
7
 
8
8
 
9
9
 
@@ -47,7 +47,7 @@ export default function ForgotPwScreen({
47
47
  placeholder={inputPlaceholder}
48
48
  label={inputLabel}
49
49
  keyboardType="email-address"
50
- iconLeft={(color) => <MailIcon width={18} height={18} color={color}/>}
50
+ iconLeft={(color) => <Email width={18} height={18} color={color}/>}
51
51
  error={form.errors.input}
52
52
  autoCapitalize="none"
53
53
  autoComplete="email"
@@ -2,9 +2,7 @@ import ErrorMessage from "../ui/error";
2
2
  import { textSize, Fonts } from "../../tokens/typography";
3
3
  import { useAppTheme } from "../../context/ThemeContext";
4
4
  import { useLoginForm } from "../../hooks/useLoginForm";
5
- import { FontAwesome } from "@expo/vector-icons";
6
5
  import {
7
- Image,
8
6
  StyleSheet,
9
7
  Text, TouchableOpacity, View,
10
8
  } from "react-native";
@@ -13,10 +11,7 @@ import SharpButton from "../ui/sharpButton";
13
11
  import SharpInput from "../ui/sharpInput";
14
12
  import Google from "../../assets/icons/google.svg"
15
13
  import SharpContainer from "../ui/sharpContainer";
16
- import MailIcon from "../../assets/customIcons/email.svg";
17
- import EyeIcon from "../../assets/customIcons/eye.svg";
18
- import EyeOffIcon from "../../assets/customIcons/eye_off.svg";
19
- import LockIcon from "../../assets/customIcons/lock_closed.svg"
14
+ import {Email, Eye,EyeOff, LockClosed } from "@towsila/icons";
20
15
  interface LoginScreenProps {
21
16
  title?: string;
22
17
  subtitle?: string;
@@ -78,7 +73,7 @@ export default function LoginScreen({
78
73
  textContentType="emailAddress"
79
74
  returnKeyType="next"
80
75
  onClearError={() => form.clearError("email")}
81
- iconLeft={(color)=><MailIcon width={18} height={18} color={color}/>}
76
+ iconLeft={(color)=><Email width={18} height={18} color={color}/>}
82
77
  />
83
78
  </View>
84
79
 
@@ -88,14 +83,14 @@ export default function LoginScreen({
88
83
  value={form.values.password}
89
84
  onChangeText={(value) => form.setValue("password", value)}
90
85
  placeholder={passwordPlaceholder}
91
- iconRight={form.showPassword ? (color)=><EyeIcon width={18} height={18} color={color}/> : (color)=><EyeOffIcon width={18} height={18} color={color}/>}
86
+ iconRight={form.showPassword ? (color)=><Eye width={18} height={18} color={color}/> : (color)=><EyeOff width={18} height={18} color={color}/>}
92
87
  onPressIconRight={() => form.setShowPassword(!form.showPassword)}
93
88
  secureTextEntry={!form.showPassword}
94
89
  textContentType="password"
95
90
  returnKeyType="done"
96
91
  error={form.errors.password}
97
92
  onClearError={() => form.clearError("password")}
98
- iconLeft={(color)=><LockIcon width={18} height={18} color={color}/>}
93
+ iconLeft={(color)=><LockClosed width={18} height={18} color={color}/>}
99
94
  />
100
95
  </View>
101
96
 
@@ -3,8 +3,7 @@ import PageIndicator from "../ui/pageIndicator";
3
3
  import Button from "../ui/button";
4
4
  import { useAppTheme } from "../../context/ThemeContext";
5
5
  import { Fonts, textSize } from "../../tokens/typography";
6
- import Arrow from "../../assets/customIcons/arrow.svg";
7
- import ArrowDark from "../../assets/customIcons/arrow_dark.svg";
6
+ import {Arrow} from "@towsila/icons";
8
7
  import SharpButton from "../ui/sharpButton";
9
8
 
10
9
  interface OnBoardingProps {
@@ -1,11 +1,8 @@
1
1
  import TemplateSubPage from "../reusable/templateSubPage";
2
- import Input from "../ui/input";
3
2
  import { useResetPasswordForm } from "../../hooks/useResetPasswordForm";
4
3
  import PasswordRequirementsCard from "../ui/passwordRequirmentCard";
5
4
  import SharpInput from "../ui/sharpInput";
6
- import LockIcon from "../../assets/customIcons/lock_closed.svg";
7
- import EyeOffIcon from "../../assets/customIcons/eye_off.svg";
8
- import EyeIcon from "../../assets/customIcons/eye.svg";
5
+ import {LockClosed, EyeOff, Eye} from "@towsila/icons";
9
6
 
10
7
 
11
8
  interface ResetPasswordScreenProps {
@@ -61,10 +58,10 @@ export default function ResetPasswordScreen({
61
58
  value={form.oldPassword}
62
59
  onChangeText={form.setOldPassword}
63
60
  placeholder={oldPasswordPlaceholder}
64
- iconLeft={(color) => <LockIcon width={18} height={18} color={color} />}
61
+ iconLeft={(color) => <LockClosed width={18} height={18} color={color} />}
65
62
  iconRight={form.showOldPassword
66
- ? (color) => <EyeOffIcon width={18} height={18} color={color} />
67
- : (color) => <EyeIcon width={18} height={18} color={color} />
63
+ ? (color) => <EyeOff width={18} height={18} color={color} />
64
+ : (color) => <Eye width={18} height={18} color={color} />
68
65
  }
69
66
  onPressIconRight={() => form.setShowOldPassword(!form.showOldPassword)}
70
67
  secureTextEntry={!form.showOldPassword}
@@ -79,8 +76,8 @@ export default function ResetPasswordScreen({
79
76
  value={form.password}
80
77
  onChangeText={form.setPassword}
81
78
  placeholder={passwordPlaceholder}
82
- iconLeft={(color) => <LockIcon width={18} height={18} color={color}/>}
83
- iconRight={form.showPassword ? (color)=><EyeOffIcon width={18} height={18} color={color}/> : (color)=><EyeIcon width={18} height={18} color={color}/>}
79
+ iconLeft={(color) => <LockClosed width={18} height={18} color={color}/>}
80
+ iconRight={form.showPassword ? (color)=><EyeOff width={18} height={18} color={color}/> : (color)=><Eye width={18} height={18} color={color}/>}
84
81
  onPressIconRight={() => form.setShowPassword(!form.showPassword)}
85
82
  secureTextEntry={!form.showPassword}
86
83
  textContentType="password"
@@ -101,8 +98,8 @@ export default function ResetPasswordScreen({
101
98
  value={form.confirmPassword}
102
99
  onChangeText={form.setConfirmPassword}
103
100
  placeholder={confirmPasswordPlaceholder}
104
- iconLeft={(color) => <LockIcon width={18} height={18} color={color}/>}
105
- iconRight={form.showConfirmPassword ? (color)=><EyeOffIcon width={18} height={18} color={color}/> : (color)=><EyeIcon width={18} height={18} color={color}/>}
101
+ iconLeft={(color) => <LockClosed width={18} height={18} color={color}/>}
102
+ iconRight={form.showConfirmPassword ? (color)=><EyeOff width={18} height={18} color={color}/> : (color)=><Eye width={18} height={18} color={color}/>}
106
103
  onPressIconRight={() => form.setShowConfirmPassword(!form.showConfirmPassword)}
107
104
  secureTextEntry={!form.showConfirmPassword}
108
105
  textContentType="password"
@@ -5,7 +5,7 @@ import { textSize, Fonts } from "../../tokens/typography"
5
5
  import SharpButton from "../ui/sharpButton";
6
6
  import TemplatePage from "../reusable/templatePage";
7
7
  import { SharpContainer } from "../..";
8
- import Arrow from "../../assets/customIcons/arrow.svg";
8
+ import {Arrow} from "@towsila/icons";
9
9
 
10
10
  interface Props{
11
11
  title: string;
@@ -23,8 +23,7 @@ interface SplashScreenProps {
23
23
  onFinish: () => void; // called when animation ends, app decides where to go
24
24
  duration?: number; // total animation duration before onFinish, default 2800
25
25
  hookStartX?: number; // hook entry X offset, default -80
26
- hookStartY?: number;
27
- loading?:boolean; // hook entry Y offset, default -180
26
+ hookStartY?: number; // hook entry Y offset, default -180
28
27
  }
29
28
 
30
29
  export default function AnimatedSplashScreen({
@@ -36,7 +35,6 @@ export default function AnimatedSplashScreen({
36
35
  duration = 2800,
37
36
  hookStartX = -80,
38
37
  hookStartY = -180,
39
- loading
40
38
  }: SplashScreenProps) {
41
39
  const { colors } = useAppTheme();
42
40
 
@@ -84,13 +82,12 @@ export default function AnimatedSplashScreen({
84
82
  duration: 400,
85
83
  easing: Easing.out(Easing.quad),
86
84
  }));
87
- if(!loading){
85
+
88
86
  const timeout = setTimeout(() => {
89
87
  onFinish();
90
88
  }, duration);
91
89
 
92
90
  return () => clearTimeout(timeout);
93
- }
94
91
  }, []);
95
92
 
96
93
  const hookStyle = useAnimatedStyle(() => ({
@@ -1,9 +1,7 @@
1
1
  import { Fonts, textSize } from "../../tokens/typography";
2
2
  import { useAppTheme } from "../../context/ThemeContext";
3
- import { Ionicons } from "@expo/vector-icons";
4
3
  import { Text, TouchableOpacity, View } from "react-native";
5
- import ArrowBack from "../../assets/customIcons/arrow_back.svg";
6
- import ArrowBackDark from "../../assets/customIcons/arrow_back_dark.svg";
4
+ import {ArrowBack} from "@towsila/icons";
7
5
 
8
6
  interface PageProps{
9
7
  title: string,
@@ -6,7 +6,7 @@ import React, { useState, useEffect, useRef } from "react";
6
6
  import { Fonts, textSize } from "../../tokens/typography";
7
7
  import { useAppTheme } from "../../context/ThemeContext";
8
8
  import { Dimensions } from "react-native";
9
- import LogoutIcon from "../../assets/customIcons/logout.svg";
9
+ import {Logout} from "@towsila/icons";
10
10
  import ThemeToggle from "./themeToggle";
11
11
  const SIDEBAR_WIDTH = Dimensions.get("window").width * 0.7;
12
12
 
@@ -126,7 +126,7 @@ export default function AsideBar({logo, menu, onLogout, logoutLabel, onNavigate,
126
126
  {/* bottom container */}
127
127
  <View style={{ gap: 16, paddingHorizontal: 16, }}>
128
128
  <TouchableOpacity onPress={onLogout} style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
129
- <LogoutIcon width={22} height={22} color={colors.semantic.error}/>
129
+ <Logout width={22} height={22} color={colors.semantic.error}/>
130
130
  <Text style={{
131
131
  fontFamily: Fonts.montserrat.regular,
132
132
  fontSize: textSize.md,
@@ -1,14 +1,11 @@
1
1
  import { useState } from "react";
2
- import { ScrollView, Text, TouchableOpacity, View } from "react-native";
2
+ import { Text, TouchableOpacity, View } from "react-native";
3
3
  import Input from "./input";
4
4
  import { Field } from "../../types/formFields";
5
5
  import { useAppTheme } from "../../context/ThemeContext";
6
6
  import { validateForm } from "../../utils/inputValidator/registerValidator";
7
- import { Ionicons } from "@expo/vector-icons";
8
7
  import { Fonts, textSize } from "../../tokens/typography";
9
- import SharpInput from "./sharpInput";
10
- import Arrow from "../../assets/customIcons/arrow.svg";
11
- import ArrowBack from "../../assets/customIcons/arrow_back.svg"
8
+ import {Arrow, ArrowBack} from "@towsila/icons";
12
9
  interface Props {
13
10
  fields: Field[];
14
11
  formState: Record<string, string>;
@@ -7,10 +7,7 @@ import { validateForm } from "../../utils/inputValidator/registerValidator";
7
7
  import { Ionicons } from "@expo/vector-icons";
8
8
  import { Fonts, textSize } from "../../tokens/typography";
9
9
  import SharpInput from "./sharpInput";
10
- import Arrow from "../../assets/customIcons/arrow.svg";
11
- import ArrowBack from "../../assets/customIcons/arrow_back.svg";
12
- import EyeIcon from "../../assets/customIcons/eye.svg";
13
- import EyeOffIcon from "../../assets/customIcons/eye_off.svg"
10
+ import {Arrow, ArrowBack, Eye, EyeOff} from "@towsila/icons";
14
11
  interface Props {
15
12
  fields: Field[];
16
13
  formState: Record<string, string>;
@@ -74,8 +71,8 @@ export const SharpDynamicForm: React.FC<Props> = ({
74
71
  iconRight={
75
72
  field.secureTextEntry
76
73
  ? (color) => showPasswordField[field.name]
77
- ? <EyeOffIcon width={18} height={18} color={color} />
78
- : <EyeIcon width={18} height={18} color={color} />
74
+ ? <EyeOff width={18} height={18} color={color} />
75
+ : <Eye width={18} height={18} color={color} />
79
76
  : undefined
80
77
  }
81
78
  placeholder={field.placeholder}
@@ -1,8 +1,7 @@
1
1
  import { useRef, useEffect } from "react";
2
2
  import { Animated, TouchableOpacity, View, Text } from "react-native";
3
3
  import { useAppTheme } from "../../context/ThemeContext";
4
- import LightModeIcon from "../../assets/customIcons/light_mode.svg";
5
- import DarkModeIcon from "../../assets/customIcons/dark_mode.svg";
4
+ import {LightMode, DarkMode} from "@towsila/icons";
6
5
  import { Fonts, textSize } from "../../tokens/typography";
7
6
  import Svg, { Path } from "react-native-svg";
8
7
 
@@ -31,8 +30,8 @@ export default function ThemeToggle({ label }: TextTheme) {
31
30
  return (
32
31
  <View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
33
32
  {isDark
34
- ? <DarkModeIcon width={22} height={22} color={colors.text.primary} />
35
- : <LightModeIcon width={24} height={24} color={colors.text.primary} />
33
+ ? <DarkMode width={22} height={22} color={colors.text.primary} />
34
+ : <LightMode width={24} height={24} color={colors.text.primary} />
36
35
  }
37
36
 
38
37
  {label && (
@@ -87,8 +86,8 @@ export default function ThemeToggle({ label }: TextTheme) {
87
86
  elevation: 4,
88
87
  }}>
89
88
  {isDark
90
- ? <LightModeIcon width={20} height={20} color={colors.background.main} />
91
- : <DarkModeIcon width={16} height={16} color={colors.background.main} />
89
+ ? <LightMode width={20} height={20} color={colors.background.main} />
90
+ : <DarkMode width={16} height={16} color={colors.background.main} />
92
91
  }
93
92
  </Animated.View>
94
93
  </View>
@@ -8,10 +8,7 @@ import {
8
8
  } from "react-native";
9
9
  import { useAppTheme } from "../../context/ThemeContext";
10
10
  import { Fonts, textSize } from "../../tokens/typography";
11
- import CheckMarkIcon from "../../assets/customIcons/checkmark.svg";
12
- import WarningIcon from "../../assets/customIcons/warning.svg";
13
- import InformationIcon from "../../assets/customIcons/information.svg";
14
- import CloseIcon from "../../assets/customIcons/close.svg";
11
+ import {CheckMark, Warning, Information,Close } from "@towsila/icons";
15
12
  interface ToastProps {
16
13
  visible: boolean;
17
14
  message: string;
@@ -74,22 +71,22 @@ export default function Toast({
74
71
  success: {
75
72
  background: colors.semantic.success,
76
73
  text: contentColor,
77
- icon: <CheckMarkIcon width={20} height={20} color={contentColor} />,
74
+ icon: <CheckMark width={20} height={20} color={contentColor} />,
78
75
  },
79
76
  error: {
80
77
  background: colors.semantic.error,
81
78
  text:contentColor,
82
- icon: <CloseIcon width={20} height={20} color={contentColor}/>,
79
+ icon: <Close width={20} height={20} color={contentColor}/>,
83
80
  },
84
81
  warning: {
85
82
  background: colors.semantic.warning,
86
83
  text: contentColor,
87
- icon: <WarningIcon width={20} height={20} color={contentColor}/>,
84
+ icon: <Warning width={20} height={20} color={contentColor}/>,
88
85
  },
89
86
  info: {
90
87
  background: colors.semantic.border,
91
88
  text: contentColor,
92
- icon: <InformationIcon width={20} height={20} color={contentColor}/>,
89
+ icon: <Information width={20} height={20} color={contentColor}/>,
93
90
  },
94
91
  }[type];
95
92
  return (
@@ -1,36 +1,36 @@
1
- export { default as MailIcon } from "../assets/customIcons/email.svg";
2
- export { default as LockIcon } from "../assets/customIcons/lock_closed.svg";
3
- export { default as EyeIcon } from "../assets/customIcons/eye.svg";
4
- export { default as EyeOffIcon } from "../assets/customIcons/eye_off.svg";
5
- export { default as ArrowIcon } from "../assets/customIcons/arrow.svg";
6
- export { default as ArrowBackIcon } from "../assets/customIcons/arrow_back.svg";
7
- export { default as PhoneIcon } from "../assets/customIcons/phone.svg";
8
- export {default as PersonIcon} from "../assets/customIcons/person.svg";
9
- // export {default as HelpDarkIcon} from "../assets/customIcons/help_dark.svg";
10
- // export {default as HelpLightIcon} from "../assets/customIcons/help_light.svg";
11
- // export {default as HomeDarkIcon} from "../assets/customIcons/home_dark.svg";
12
- // export {default as HomeLightIcon} from "../assets/customIcons/home_light.svg";
13
- // export {default as SettingsDarkIcon} from "../assets/customIcons/settings_dark.svg";
14
- // export {default as SettingsLightIcon} from "../assets/customIcons/settings_light.svg";
15
- // export {default as ProfileLightIcon} from "../assets/customIcons/profile_light.svg";
16
- // export {default as ProfileDarkIcon} from "../assets/customIcons/profile_dark.svg";
17
- export {default as HomeIcon} from "../components/icons/homeIcon";
18
- export {default as ProfileIcon} from "../components/icons/profileIcon";
19
- export {default as SettingsIcon} from "../components/icons/settingsIcon";
20
- export {default as ChatIcon} from "../components/icons/chatIcon";
21
- export {default as LogoutIcon} from "../assets/customIcons/logout.svg";
22
- export {default as LightModeIcon} from "../assets/customIcons/light_mode.svg";
23
- export {default as DarkModeIcon} from "../assets/customIcons/dark_mode.svg";
24
- export {default as HumbergerIcon} from "../assets/customIcons/humberger.svg";
25
- export {default as ShieldIcon} from "../assets/customIcons/shield.svg";
26
- export {default as DocumentIcon} from "../assets/customIcons/document.svg";
27
- export {default as InformationIcon} from "../assets/customIcons/information.svg";
28
- export {default as WarningIcon} from "../assets/customIcons/warning.svg";
29
- export {default as SuccessDark} from "../assets/customIcons/phone_dark.svg";
30
- export {default as SuccessLight} from "../assets/customIcons/phone_light.svg";
31
- export {default as TrashIcon} from "../assets/customIcons/trash.svg";
32
- export {default as CheckMarkIcon} from "../assets/customIcons/checkmark.svg";
33
- export {default as BanIcon} from "../assets/customIcons/ban.svg";
34
- export {default as BanImage} from "../components/icons/ban";
35
- export {default as TruckForbiddenLight} from "../assets/customIcons/light_suspended.svg";
36
- export {default as TruckForbiddenDark} from "../assets/customIcons/dark_suspended.svg";
1
+ // export { default as MailIcon } from "../assets/customIcons/email.svg";
2
+ // export { default as LockIcon } from "../assets/customIcons/lock_closed.svg";
3
+ // export { default as EyeIcon } from "../assets/customIcons/eye.svg";
4
+ // export { default as EyeOffIcon } from "../assets/customIcons/eye_off.svg";
5
+ // export { default as ArrowIcon } from "../assets/customIcons/arrow.svg";
6
+ // export { default as ArrowBackIcon } from "../assets/customIcons/arrow_back.svg";
7
+ // export { default as PhoneIcon } from "../assets/customIcons/phone.svg";
8
+ // export {default as PersonIcon} from "../assets/customIcons/person.svg";
9
+ // // export {default as HelpDarkIcon} from "../assets/customIcons/help_dark.svg";
10
+ // // export {default as HelpLightIcon} from "../assets/customIcons/help_light.svg";
11
+ // // export {default as HomeDarkIcon} from "../assets/customIcons/home_dark.svg";
12
+ // // export {default as HomeLightIcon} from "../assets/customIcons/home_light.svg";
13
+ // // export {default as SettingsDarkIcon} from "../assets/customIcons/settings_dark.svg";
14
+ // // export {default as SettingsLightIcon} from "../assets/customIcons/settings_light.svg";
15
+ // // export {default as ProfileLightIcon} from "../assets/customIcons/profile_light.svg";
16
+ // // export {default as ProfileDarkIcon} from "../assets/customIcons/profile_dark.svg";
17
+ // export {default as HomeIcon} from "../components/icons/homeIcon";
18
+ // export {default as ProfileIcon} from "../components/icons/profileIcon";
19
+ // export {default as SettingsIcon} from "../components/icons/settingsIcon";
20
+ // export {default as ChatIcon} from "../components/icons/chatIcon";
21
+ // export {default as LogoutIcon} from "../assets/customIcons/logout.svg";
22
+ // export {default as LightModeIcon} from "../assets/customIcons/light_mode.svg";
23
+ // export {default as DarkModeIcon} from "../assets/customIcons/dark_mode.svg";
24
+ // export {default as HumbergerIcon} from "../assets/customIcons/humberger.svg";
25
+ // export {default as ShieldIcon} from "../assets/customIcons/shield.svg";
26
+ // export {default as DocumentIcon} from "../assets/customIcons/document.svg";
27
+ // export {default as InformationIcon} from "../assets/customIcons/information.svg";
28
+ // export {default as WarningIcon} from "../assets/customIcons/warning.svg";
29
+ // export {default as SuccessDark} from "../assets/customIcons/phone_dark.svg";
30
+ // export {default as SuccessLight} from "../assets/customIcons/phone_light.svg";
31
+ // export {default as TrashIcon} from "../assets/customIcons/trash.svg";
32
+ // export {default as CheckMarkIcon} from "../assets/customIcons/checkmark.svg";
33
+ // export {default as BanIcon} from "../assets/customIcons/ban.svg";
34
+ // export {default as BanImage} from "../components/icons/ban";
35
+ // export {default as TruckForbiddenLight} from "../assets/customIcons/light_suspended.svg";
36
+ // export {default as TruckForbiddenDark} from "../assets/customIcons/dark_suspended.svg";