@towsila/expo-ui-library 1.0.13 → 1.0.15
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 +2 -1
- package/src/components/screens/forgotPasswordScreen.tsx +2 -2
- package/src/components/screens/loginScreen.tsx +4 -9
- package/src/components/screens/onBoarding.tsx +1 -2
- package/src/components/screens/resetPassword.tsx +8 -11
- package/src/components/screens/settingScreen.tsx +1 -1
- package/src/components/ui/PageTopBar.tsx +1 -3
- package/src/components/ui/asidebar.tsx +2 -2
- package/src/components/ui/dynamicForm.tsx +2 -5
- package/src/components/ui/sharpDynamicForm.tsx +3 -6
- package/src/components/ui/themeToggle.tsx +5 -6
- package/src/components/ui/toast.tsx +5 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@towsila/expo-ui-library",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
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
|
|
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) => <
|
|
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
|
|
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)=><
|
|
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)=><
|
|
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)=><
|
|
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 "
|
|
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
|
|
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) => <
|
|
61
|
+
iconLeft={(color) => <LockClosed width={18} height={18} color={color} />}
|
|
65
62
|
iconRight={form.showOldPassword
|
|
66
|
-
? (color) => <
|
|
67
|
-
: (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) => <
|
|
83
|
-
iconRight={form.showPassword ? (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) => <
|
|
105
|
-
iconRight={form.showConfirmPassword ? (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 "
|
|
8
|
+
import {Arrow} from "@towsila/icons";
|
|
9
9
|
|
|
10
10
|
interface Props{
|
|
11
11
|
title: string;
|
|
@@ -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 "
|
|
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
|
|
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
|
-
<
|
|
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 {
|
|
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
|
|
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 "
|
|
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
|
-
? <
|
|
78
|
-
: <
|
|
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
|
|
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
|
-
? <
|
|
35
|
-
: <
|
|
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
|
-
? <
|
|
91
|
-
: <
|
|
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
|
|
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: <
|
|
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: <
|
|
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: <
|
|
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: <
|
|
89
|
+
icon: <Information width={20} height={20} color={contentColor}/>,
|
|
93
90
|
},
|
|
94
91
|
}[type];
|
|
95
92
|
return (
|