fln-espranza 0.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.
Files changed (44) hide show
  1. package/.expo/README.md +15 -0
  2. package/.expo/settings.json +8 -0
  3. package/Readme.md +1 -0
  4. package/assets/images/bg-header.jpg +0 -0
  5. package/components/Avatar.tsx +42 -0
  6. package/components/BaseLayout.tsx +174 -0
  7. package/components/Container.tsx +12 -0
  8. package/components/Drawer.tsx +97 -0
  9. package/components/EBadge.tsx +23 -0
  10. package/components/EButton.tsx +73 -0
  11. package/components/EButtonIcon.tsx +37 -0
  12. package/components/EDateAndTimeCard.tsx +50 -0
  13. package/components/EDateInput.tsx +55 -0
  14. package/components/EErrorText.tsx +19 -0
  15. package/components/EIcon.tsx +28 -0
  16. package/components/EInfoBox.tsx +41 -0
  17. package/components/EInput.tsx +52 -0
  18. package/components/ELabel.tsx +15 -0
  19. package/components/EListPerson.tsx +40 -0
  20. package/components/EListSchool.tsx +35 -0
  21. package/components/EOtpInputBox.tsx +49 -0
  22. package/components/EPageDescription.tsx +19 -0
  23. package/components/EPillButton.tsx +26 -0
  24. package/components/EProfile.tsx +43 -0
  25. package/components/ESegment.tsx +36 -0
  26. package/components/EText.tsx +41 -0
  27. package/components/ETimeInput.tsx +55 -0
  28. package/components/ETimeLineCard.tsx +68 -0
  29. package/components/ListFormView.tsx +37 -0
  30. package/components/Loader.tsx +31 -0
  31. package/components/MenuItems.tsx +46 -0
  32. package/components/ModalLayout.tsx +81 -0
  33. package/components/PageHeader.tsx +129 -0
  34. package/components/PageHeaderSecondary.tsx +44 -0
  35. package/components/ProgressBar.tsx +33 -0
  36. package/components/SecondaryBaseLayout.tsx +120 -0
  37. package/components/Spacer.tsx +14 -0
  38. package/components/Timer.tsx +57 -0
  39. package/components/index.tsx +65 -0
  40. package/index.ts +76 -0
  41. package/lib/tailwind.js +8 -0
  42. package/package.json +26 -0
  43. package/tailwind.config.js +33 -0
  44. package/utils/Color.ts +15 -0
@@ -0,0 +1,129 @@
1
+ import { View, Animated, Dimensions, Image } from "react-native";
2
+ import React, { useEffect, useRef } from "react";
3
+ import tw from "../lib/tailwind";
4
+ import { useNavigation } from "@react-navigation/native";
5
+ import EButtonIcon from "./EButtonIcon";
6
+ import EText from "./EText";
7
+ import Constants from "expo-constants";
8
+ import { MenuIcon } from "react-native-heroicons/outline";
9
+
10
+ const SCREEN_WIDTH = Dimensions.get("window").width;
11
+ const HEADER_HEIGHT = 90;
12
+
13
+ interface PageHeaderProps {
14
+ title: string;
15
+ subtitle?: string;
16
+ curved?: boolean;
17
+ children?: JSX.Element;
18
+ iconEnd?: JSX.Element;
19
+ border?: boolean;
20
+ menuButton?: boolean;
21
+ }
22
+
23
+ export default function PageHeader({
24
+ title,
25
+ subtitle,
26
+ curved,
27
+ children,
28
+ iconEnd,
29
+ border,
30
+ menuButton,
31
+ }: PageHeaderProps) {
32
+ const navigation = useNavigation();
33
+
34
+ const translateX = useRef(new Animated.Value(60)).current;
35
+ const opacity = useRef(new Animated.Value(0)).current;
36
+
37
+ useEffect(() => {
38
+ Animated.spring(translateX, {
39
+ toValue: 0,
40
+ stiffness: 40,
41
+ damping: 10,
42
+ useNativeDriver: true,
43
+ }).start();
44
+ Animated.spring(opacity, {
45
+ toValue: 1,
46
+ delay: 250,
47
+ useNativeDriver: true,
48
+ }).start();
49
+ });
50
+ return (
51
+ <View style={[tw`${curved ? "-mb-2" : ""} ${border ? "border-b border-slate-300" : ""} `, {}]}>
52
+ <View style={tw`overflow-hidden`}>
53
+ <Animated.View
54
+ style={[
55
+ tw`flex-row pr-4 pl-3 pb-3`,
56
+ {
57
+ paddingTop: Constants.statusBarHeight + 8,
58
+ transform: [{ translateX }],
59
+ opacity,
60
+ },
61
+ ]}
62
+ >
63
+ <Animated.View
64
+ style={[tw`-mt-2 left-3 absolute `, { transform: [{ translateX }], opacity, paddingTop: Constants.statusBarHeight + 8 }]}
65
+ >
66
+ {menuButton ?
67
+ <MenuIcon
68
+ onPress={() => navigation?.openDrawer()}
69
+ size={24}
70
+ // onPress={() => navigation.navigate("Dashboard")}
71
+ style={tw`text-slate-900 mt-2`}
72
+ />
73
+ :
74
+
75
+ <EButtonIcon
76
+ iconColor={curved ? "white" : "tint-slate-900"}
77
+ size={24}
78
+ // onPress={() => navigation.navigate("Dashboard")}
79
+ onPress={() => navigation.goBack()}
80
+ />
81
+ }
82
+ </Animated.View>
83
+ <View style={tw`flex-1 items-center`}>
84
+ <EText
85
+ size="base"
86
+ style={tw.style("text-black font-semibold ", curved && "text-white ")}
87
+ >
88
+ {title}
89
+ </EText>
90
+ {subtitle ? (
91
+ <EText
92
+ style={tw.style(
93
+ "text-slate-800 opacity-40 font-semibold mt-0.25",
94
+ curved && "text-white "
95
+ )}
96
+ >
97
+ {subtitle}
98
+ </EText>
99
+ ) : null}
100
+ </View>
101
+
102
+ {iconEnd ? (
103
+ <View style={[tw`mt-0.5 items-center justify-center`, {}]}>
104
+ {iconEnd}
105
+ </View>
106
+ ) : null}
107
+ </Animated.View>
108
+ {children ? <View style={tw.style("pb-6")}>{children}</View> : null}
109
+ </View>
110
+
111
+ {/* MASK */}
112
+ {curved ? (
113
+ <View
114
+ style={[
115
+ tw``,
116
+ { height: 32, width: SCREEN_WIDTH, backgroundColor: "#0547FA" },
117
+ ]}
118
+ >
119
+ <View
120
+ style={[
121
+ tw`bg-white -z-0`,
122
+ { height: 64, width: SCREEN_WIDTH, borderTopLeftRadius: 32 },
123
+ ]}
124
+ />
125
+ </View>
126
+ ) : null}
127
+ </View>
128
+ );
129
+ }
@@ -0,0 +1,44 @@
1
+ import { View, Text, Platform } from "react-native";
2
+ import React from "react";
3
+ import tw from "../lib/tailwind";
4
+ import EText from "./EText";
5
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
6
+
7
+ interface PageHeaderSecondaryProps {
8
+ title?: string;
9
+ subtitle?: string;
10
+ button?: JSX.Element;
11
+ }
12
+ export default function PageHeaderSecondary({
13
+ title,
14
+ subtitle,
15
+ button,
16
+ }: PageHeaderSecondaryProps) {
17
+ const insets = useSafeAreaInsets();
18
+ return (
19
+ <View
20
+ style={[
21
+ tw`flex-row justify-between items-center bg-white`,
22
+ {
23
+ paddingTop: Platform.OS === "android" ? insets.top + 8 : 8,
24
+ },
25
+ ]}
26
+ >
27
+ <View style={tw` flex-1 justify-center items-center`}>
28
+ {title ? (
29
+ <EText size="base" style={tw`font-semibold`}>
30
+ {title}
31
+ </EText>
32
+ ) : null}
33
+ {subtitle ? (
34
+ <EText muted style={tw`mt-0.25 font-semibold`}>
35
+ {subtitle}
36
+ </EText>
37
+ ) : null}
38
+ </View>
39
+ <View style={[tw`absolute right-3`, {
40
+ paddingTop: Platform.OS === "android" ? insets.top + 8 : 8,
41
+ }]}>{button}</View>
42
+ </View>
43
+ );
44
+ }
@@ -0,0 +1,33 @@
1
+ import React, { useEffect, useRef, useState } from 'react'
2
+ import { Animated,StyleSheet, View } from 'react-native';
3
+ import tw from "../lib/tailwind";
4
+ import { Colors } from "../utils/Color";
5
+
6
+ interface IProps{
7
+ progress: number;
8
+ }
9
+
10
+ export default function ProgressBar( {progress}: IProps) {
11
+
12
+
13
+ const barWidth = useRef(new Animated.Value(0)).current;
14
+
15
+ useEffect(() => {
16
+ Animated.spring(barWidth, {
17
+ toValue: progress,
18
+ bounciness: 0,
19
+ speed: 7,
20
+ useNativeDriver: false,
21
+ }).start();
22
+ }, [progress]);
23
+ return (
24
+ <View style={[tw`h-2 w-14 bg-[${Colors['primary-light']}] overflow-hidden mr-2`, {
25
+ borderRadius: 40,
26
+ }]}>
27
+ <Animated.View
28
+ style={[StyleSheet.absoluteFill, { backgroundColor: Colors['primary-base'], width: barWidth }]}
29
+
30
+ />
31
+ </View>
32
+ )
33
+ }
@@ -0,0 +1,120 @@
1
+ import {
2
+ View,
3
+ ImageBackground,
4
+ Dimensions,
5
+ Animated,
6
+ ScrollView,
7
+ Platform,
8
+ } from "react-native";
9
+ import React, { useEffect, useRef, useState } from "react";
10
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
11
+ import tw from "../lib/tailwind";
12
+ import EText from "./EText";
13
+ import { StatusBar } from "expo-status-bar";
14
+ import {
15
+ Container,
16
+ EButton,
17
+ EButtonIcon,
18
+ PageHeader,
19
+ PageHeaderSecondary,
20
+ } from ".";
21
+ import Constants from "expo-constants";
22
+ import { useNavigation } from "@react-navigation/native";
23
+
24
+ const SCREEN_WIDTH = Dimensions.get("window").width;
25
+ const SCREEN_HEIGHT = Dimensions.get("window").height;
26
+ const HEADER_HEIGHT = Constants.statusBarHeight + 60;
27
+ const SCROLL_PADDING_BOTTOM = 100;
28
+
29
+ interface BaseLayoutProps {
30
+ title: string;
31
+ subtitle?: string;
32
+ curved?: boolean;
33
+ headerContent?: JSX.Element;
34
+ children?: JSX.Element | JSX.Element[];
35
+ iconEnd?: JSX.Element;
36
+ noScroll?: boolean;
37
+ bottomButton?: JSX.Element;
38
+ border?: boolean;
39
+ menuButton?: boolean;
40
+ }
41
+
42
+ export default function SecondaryBaseLayout({
43
+ title,
44
+ subtitle,
45
+ curved,
46
+ headerContent,
47
+ children,
48
+ noScroll,
49
+ iconEnd,
50
+ bottomButton,
51
+ border,
52
+ menuButton,
53
+ }: BaseLayoutProps) {
54
+ const insets = useSafeAreaInsets();
55
+
56
+ const navigation = useNavigation();
57
+
58
+ return (
59
+ <View
60
+ style={[
61
+ tw`flex-1 bg-white`,
62
+ {
63
+ paddingBottom: Platform.OS === "ios" ? insets.bottom : 0,
64
+ paddingTop: Platform.OS === "ios" ? 20 : 0,
65
+ },
66
+ ]}
67
+ >
68
+ <StatusBar style="dark" animated />
69
+
70
+ {/* HEADER */}
71
+ <View
72
+ style={[
73
+ tw`absolute top-0 right-0 left-0 pt-2 z-10 w-full bg-white ${
74
+ title ? "mb-1" : "pb-0"
75
+ }`,
76
+ ]}
77
+ >
78
+ {/* <PageHeaderSecondary
79
+ title={title}
80
+ subtitle={subtitle}
81
+ button={
82
+ <EButtonIcon
83
+ type="close"
84
+ iconColor="slate-800"
85
+ onPress={() => navigation.goBack()}
86
+ />
87
+ }
88
+ /> */}
89
+ <PageHeader
90
+ border={border}
91
+ title={title}
92
+ subtitle={subtitle}
93
+ curved={curved}
94
+ iconEnd={iconEnd}
95
+ menuButton={menuButton}
96
+ >
97
+ {headerContent}
98
+ </PageHeader>
99
+ </View>
100
+ <ScrollView
101
+ style={[
102
+ tw`flex-1`,
103
+ { paddingBottom: insets.bottom, paddingTop: !title ? 80 : 80 },
104
+ ]}
105
+ showsVerticalScrollIndicator={false}
106
+ decelerationRate={"fast"}
107
+ contentContainerStyle={{
108
+ paddingBottom: SCROLL_PADDING_BOTTOM,
109
+ }}
110
+ >
111
+ {children}
112
+ </ScrollView>
113
+ {bottomButton ? (
114
+ <View style={tw` px-4 mb-6 `}>{bottomButton}</View>
115
+ ) : (
116
+ <></>
117
+ )}
118
+ </View>
119
+ );
120
+ }
@@ -0,0 +1,14 @@
1
+ import { View, Text } from "react-native";
2
+ import React from "react";
3
+ import tw from '../lib/tailwind'
4
+
5
+ export default function Spacer(props: any) {
6
+ const { sm, lg, xs, md } = props;
7
+ return <View style={tw.style(
8
+ "my-4",
9
+ xs && "my-1",
10
+ sm && "my-2",
11
+ md && "my-3",
12
+ lg && "my-6"
13
+ )} />;
14
+ }
@@ -0,0 +1,57 @@
1
+ import React from "react";
2
+ import { useState } from "react";
3
+ import { TouchableOpacity } from "react-native";
4
+ import tw from "../lib/tailwind";
5
+ import { Colors } from "../utils/Color";
6
+ import EText from "./EText";
7
+
8
+ interface IProps {
9
+ time: number;
10
+ text: string;
11
+ subtext: string;
12
+ handleGetOTP: () => void;
13
+ sendOtp: boolean;
14
+ email: string;
15
+ }
16
+
17
+ export default function Timer({ time, text, subtext, sendOtp, handleGetOTP,email }: IProps) {
18
+
19
+ const [timer, setTimer] = useState(time);
20
+ React.useEffect(() => {
21
+ setTimer(30);
22
+ return () => {
23
+ setTimer(0);
24
+ }
25
+ }, [sendOtp]);
26
+
27
+ React.useEffect(() => {
28
+ timer > 0 &&
29
+ setTimeout(() => {
30
+ setTimer(timer - 1);
31
+ }, 1000);
32
+
33
+ return () => {
34
+ clearTimeout();
35
+ }
36
+ }, [timer]);
37
+
38
+ return(
39
+
40
+ <>
41
+ {timer > 0 ? <TouchableOpacity style={[tw`mt-2`, {}]}>
42
+ <EText size="sm" style={[tw`font-bold text-[${Colors["text-primary"]}]`, {}]}>
43
+ {timer > 0 && `${text}${timer >= 10 ? timer : "0" + timer}`}
44
+ </EText>
45
+ </TouchableOpacity> :
46
+ <TouchableOpacity style={[tw`mt-2`, {}]}
47
+ onPress={() => handleGetOTP()}
48
+ >
49
+ <EText size="sm" style={[tw`font-bold text-[${Colors["text-primary"]}]`, {}]}>
50
+ {subtext}
51
+ </EText>
52
+ </TouchableOpacity>
53
+ }
54
+ </>
55
+
56
+ )
57
+ }
@@ -0,0 +1,65 @@
1
+ import Avatar from "./Avatar";
2
+ import BaseLayout from "./BaseLayout";
3
+ import Container from "./Container";
4
+ import Drawer from "./Drawer";
5
+ import EBadge from "./EBadge";
6
+ import EButton from "./EButton";
7
+ import EButtonIcon from "./EButtonIcon";
8
+ import EDateAndTimeCard from "./EDateAndTimeCard";
9
+ import EIcon from "./EIcon";
10
+ import EInfoBox from "./EInfoBox";
11
+ import EInput from "./EInput";
12
+ import ELabel from "./ELabel";
13
+ import EOtpInput from "./EOtpInputBox";
14
+ import EPageDescription from "./EPageDescription";
15
+ import EPillButton from "./EPillButton";
16
+ import EProfile from "./EProfile";
17
+ import ESegment from "./ESegment";
18
+ import { ESegmentItem } from "./ESegment";
19
+ import ETimeLineCard from "./ETimeLineCard";
20
+ import ListFormView from "./ListFormView";
21
+ import MenuItems from "./MenuItems";
22
+ import SecondaryBaseLayout from "./SecondaryBaseLayout";
23
+ import Timer from "./Timer";
24
+ import EText from "./EText";
25
+ import ModalLayout from "./ModalLayout";
26
+ import PageHeader from "./PageHeader";
27
+ import PageHeaderSecondary from "./PageHeaderSecondary";
28
+ import Spacer from "./Spacer";
29
+ import ProgressBar from "./ProgressBar";
30
+ import Loader from "./Loader";
31
+
32
+ export {
33
+ Avatar,
34
+ BaseLayout,
35
+ Container,
36
+ Drawer,
37
+ EButton,
38
+ EButtonIcon,
39
+ EIcon,
40
+ EInput,
41
+ EText,
42
+ ModalLayout,
43
+ PageHeader,
44
+ PageHeaderSecondary,
45
+ ESegment,
46
+ ESegmentItem,
47
+ Spacer,
48
+ EInfoBox,
49
+ EBadge,
50
+ EDateAndTimeCard,
51
+ ELabel,
52
+ EOtpInput,
53
+ EPageDescription,
54
+ ETimeLineCard,
55
+ ListFormView,
56
+ MenuItems,
57
+ EPillButton,
58
+ EProfile,
59
+ SecondaryBaseLayout,
60
+ Timer,
61
+ ProgressBar,
62
+ Loader
63
+
64
+
65
+ };
package/index.ts ADDED
@@ -0,0 +1,76 @@
1
+ import Avatar from "./components/Avatar";
2
+ import BaseLayout from "./components/BaseLayout";
3
+ import Container from "./components/Container";
4
+ import Drawer from "./components/Drawer";
5
+ import EBadge from "./components/EBadge";
6
+ import EButton from "./components/EButton";
7
+ import EButtonIcon from "./components/EButtonIcon";
8
+ import EDateAndTimeCard from "./components/EDateAndTimeCard";
9
+ import EIcon from "./components/EIcon";
10
+ import EInfoBox from "./components/EInfoBox";
11
+ import EInput from "./components/EInput";
12
+ import ELabel from "./components/ELabel";
13
+ import EOtpInput from "./components/EOtpInputBox";
14
+ import EPageDescription from "./components/EPageDescription";
15
+ import EPillButton from "./components/EPillButton";
16
+ import EProfile from "./components/EProfile";
17
+ import ESegment from "./components/ESegment";
18
+ import { ESegmentItem } from "./components/ESegment";
19
+ import ETimeLineCard from "./components/ETimeLineCard";
20
+ import ListFormView from "./components/ListFormView";
21
+ import MenuItems from "./components/MenuItems";
22
+ import SecondaryBaseLayout from "./components/SecondaryBaseLayout";
23
+ import Timer from "./components/Timer";
24
+ import EText from "./components/EText";
25
+ import ModalLayout from "./components/ModalLayout";
26
+ import PageHeader from "./components/PageHeader";
27
+ import PageHeaderSecondary from "./components/PageHeaderSecondary";
28
+ import Spacer from "./components/Spacer";
29
+ import { Colors } from "./utils/Color";
30
+ import ProgressBar from "./components/ProgressBar";
31
+ import Loader from "./components/Loader";
32
+ import ETimeInput from "./components/ETimeInput";
33
+ import EDateInput from "./components/EDateInput";
34
+ import EErrorText from "./components/EErrorText";
35
+ import EListPerson from "./components/EListPerson";
36
+ import EListSchool from "./components/EListSchool";
37
+
38
+ export {
39
+ Avatar,
40
+ BaseLayout,
41
+ Container,
42
+ Drawer,
43
+ EButton,
44
+ EButtonIcon,
45
+ EIcon,
46
+ EInput,
47
+ EText,
48
+ ModalLayout,
49
+ PageHeader,
50
+ PageHeaderSecondary,
51
+ ESegment,
52
+ ESegmentItem,
53
+ Spacer,
54
+ EInfoBox,
55
+ EBadge,
56
+ EDateAndTimeCard,
57
+ ELabel,
58
+ EOtpInput,
59
+ EPageDescription,
60
+ ETimeLineCard,
61
+ ListFormView,
62
+ MenuItems,
63
+ EPillButton,
64
+ EProfile,
65
+ SecondaryBaseLayout,
66
+ Timer,
67
+ ProgressBar,
68
+ Loader,
69
+ ETimeInput,
70
+ EDateInput,
71
+ EErrorText,
72
+ Colors,
73
+ EListPerson,
74
+ EListSchool
75
+
76
+ };
@@ -0,0 +1,8 @@
1
+ // lib/tailwind.js
2
+ import { create } from 'twrnc';
3
+
4
+ // create the customized version...
5
+ const tw = create(require(`../tailwind.config.js`)); // <- your path may differ
6
+
7
+ // ... and then this becomes the main function your app uses
8
+ export default tw;
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "fln-espranza",
3
+ "version": "0.0.1",
4
+ "description": "All components used inside FLN Project of Espranza Innovations",
5
+ "main": "index.ts",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC",
11
+ "peerDependencies": {
12
+ "expo": "~45.0.0",
13
+ "expo-status-bar": "~1.3.0",
14
+ "react": "17.0.2",
15
+ "react-native": "0.68.2",
16
+ "react-native-safe-area-context": "4.2.4",
17
+ "twrnc": "^3.3.2",
18
+ "@react-navigation/drawer": "^6.5.0",
19
+ "@react-navigation/native": "^6.0.10",
20
+ "@react-navigation/native-stack": "^6.6.2",
21
+ "react-native-heroicons": "^2.2.0",
22
+ "moment": "^2.29.4",
23
+ "@react-native-community/datetimepicker": "6.1.2",
24
+ "react-native-reanimated": "~2.8.0"
25
+ }
26
+ }
@@ -0,0 +1,33 @@
1
+ // tailwind.config.js
2
+ const {
3
+ plugin
4
+ } = require('twrnc');
5
+
6
+ // or, you can use tailwinds plugin function:
7
+ // const plugin = require('tailwindcss/plugin');
8
+
9
+ module.exports = {
10
+ plugins: [
11
+ plugin(({
12
+ addUtilities
13
+ }) => {
14
+ addUtilities({
15
+ 'list-title': 'font-bold',
16
+ 'list-body': 'opacity-60',
17
+ 'list-date': 'opacity-30'
18
+ })
19
+ })
20
+ ],
21
+ theme: {
22
+ fontFamily: {},
23
+ extend: {
24
+ spacing: {
25
+ '8xl': '96rem',
26
+ '9xl': '128rem',
27
+ },
28
+ borderRadius: {
29
+ '4xl': '2rem',
30
+ }
31
+ }
32
+ },
33
+ }
package/utils/Color.ts ADDED
@@ -0,0 +1,15 @@
1
+ export const Colors = {
2
+ "primary-base": '#218C74',
3
+ "primary-light": '#F4F9F8',
4
+ "secondary-base": '#3F3D84',
5
+ "secondary-light": '#F5F5F9',
6
+ "blue": '#0993BF',
7
+ "border": '#E0E6EC',
8
+ "warning": '#FFCB66',
9
+ "success": '#00BE9B',
10
+ "text-primary": '#2D3A5D',
11
+ "text-body": '#64748B',
12
+ "text-placeholder": '#CBD5E1',
13
+ "text-secondary": "#585F68",
14
+ "white": '#FFFFFF',
15
+ };