fln-espranza 0.0.51 → 0.0.53

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.
@@ -1,24 +1,82 @@
1
- import React from 'react'
2
- import { View } from 'react-native'
1
+ // import React from 'react'
2
+ // import { View } from 'react-native'
3
+ // import tw from '../lib/tailwind';
4
+ // import EText from './EText';
5
+ // import { CheckCircleIcon } from 'react-native-heroicons/solid';
6
+
7
+
8
+ // interface IProps {
9
+ // text: string;
10
+ // bgColor: string;
11
+ // textColor: string
12
+ // completed?: boolean;
13
+ // }
14
+
15
+ // export default function EBadge({ text, completed, bgColor, textColor }: IProps) {
16
+ // return (
17
+ // <View style={[tw`flex-row p-1 px-2 bg-[${bgColor}] rounded-full`,]}>
18
+ // {completed ? <CheckCircleIcon style={tw`text-white -ml-1 mr-1`} size={16} /> : null}
19
+ // <EText size='xs' style={tw`font-semibold text-[${textColor}]`}>
20
+ // {text}
21
+ // </EText>
22
+ // </View>
23
+ // )
24
+ // }
25
+
26
+ import React from 'react';
3
27
  import tw from '../lib/tailwind';
28
+ import {View} from 'react-native';
4
29
  import EText from './EText';
5
- import { CheckCircleIcon } from 'react-native-heroicons/solid';
6
30
 
7
31
 
8
- interface IProps {
9
- text: string;
10
- bgColor: string;
11
- textColor: string
12
- completed?: boolean;
13
- }
32
+ // Badge Sizes
33
+ export const BADGE_SIZES = {
34
+ sm: 'p-0.75 px-2',
35
+ md: 'p-0.75 px-3',
36
+ };
37
+ export type BadgeSize = keyof typeof BADGE_SIZES;
38
+
39
+ // Badge Text Sizes
40
+ export const BADGE_TEXT_SIZES = {
41
+ sm: 'text-sm',
42
+ md: 'text-base',
43
+ };
14
44
 
15
- export default function EBadge({ text, completed, bgColor, textColor }: IProps) {
16
- return (
17
- <View style={[tw`flex-row p-1 px-2 bg-[${bgColor}] rounded-full`,]}>
18
- {completed ? <CheckCircleIcon style={tw`text-white -ml-1 mr-1`} size={16} /> : null}
19
- <EText size='xs' style={tw`font-semibold text-[${textColor}]`}>
20
- {text}
21
- </EText>
22
- </View>
23
- )
45
+ interface EBadgeProps {
46
+ color?: string;
47
+ variant?: 'solid' | 'light';
48
+ size?: BadgeSize;
49
+ iconLeft?: JSX.Element;
50
+ iconRight?: JSX.Element;
51
+ children: string;
24
52
  }
53
+
54
+ const EBadge: React.FC<EBadgeProps> = ({
55
+ color = 'blue-600',
56
+ variant = 'solid',
57
+ size = 'md',
58
+ iconLeft,
59
+ iconRight,
60
+ children,
61
+ }) => {
62
+ const baseStyle = tw`flex-row self-start items-center rounded-full overflow-hidden bg-${color}
63
+ ${variant === 'light' && 'bg-opacity-10'}
64
+ ${BADGE_SIZES[size]}`;
65
+
66
+ const textStyle = tw`font-semibold capitalize
67
+ ${variant === 'light' ? `text-${color}` : 'text-white'}
68
+ ${BADGE_TEXT_SIZES[size]}
69
+ `;
70
+
71
+ return (
72
+ <View style={baseStyle}>
73
+ {iconLeft}
74
+ <EText style={textStyle}>{children}</EText>
75
+ {iconRight}
76
+ </View>
77
+ );
78
+ };
79
+
80
+ export default EBadge;
81
+
82
+
@@ -13,7 +13,7 @@ interface EButtonProps extends TouchableOpacityProps {
13
13
  iconR?: JSX.Element;
14
14
  inline?: boolean;
15
15
  small?: boolean;
16
- type?: "secondary" | "clear" | "primary";
16
+ type?: "secondary" | "clear" | "primary" | "white";
17
17
  disabled?: boolean;
18
18
  children: any;
19
19
  }
@@ -38,8 +38,9 @@ export default function EButton({
38
38
  >
39
39
  <View
40
40
  style={[
41
- tw`flex-row justify-center items-center rounded-full border-2 border-black/5 ${small ? 'h-11 px-6' : 'h-14 px-8'} ${disabled ? "opacity-40" : ""} ${type === "clear"
42
- ? "bg-transparent "
41
+ tw`flex-row justify-center items-center rounded-full border-2 border-black/5 ${small ? 'h-10 px-4' : 'h-14 px-8'} ${disabled ? "opacity-40" : ""} ${type === "clear"
42
+ ? "bg-transparent "
43
+ : type === 'white' ? "bg-white"
43
44
  : type === "secondary"
44
45
  ? `bg-[${Colors["secondary-base"]}] self-start px-6 h-11`
45
46
  : `bg-[${Colors["primary-base"]}] shadow shadow-[${Colors["primary-base"]}]`
@@ -51,7 +52,7 @@ export default function EButton({
51
52
  {/* LABEL */}
52
53
  <EText
53
54
  style={[
54
- tw`font-semibold ${small ? `text-sm` : ''} ${type === "clear" ? `text-[${Colors["primary-base"]}]` : "text-white"
55
+ tw`font-semibold ${small ? `text-sm` : ''} ${type === "clear" || type === "white" ? `text-[${Colors["primary-base"]}]` : "text-white"
55
56
  }`,
56
57
  ]}
57
58
  >
@@ -18,7 +18,7 @@ export default function EListSchool({
18
18
  }: IProps) {
19
19
  return (
20
20
  <View style={tw`border-b border-slate-200 py-3`}>
21
- <EText style={tw`font-bold text-slate-800 mb-0.5 flex-1`} numberOfLines={2}>
21
+ <EText size="base" style={tw`font-bold text-slate-800 mb-0.5 h-5`} numberOfLines={2}>
22
22
  {name}
23
23
  </EText>
24
24
  <View style={tw`flex-row items-center`}>
@@ -10,8 +10,7 @@ interface IProps{
10
10
  export default function EPageDescription({text}: IProps) {
11
11
  return (
12
12
  <EText
13
- size='sm'
14
- style={[tw`font-normal`, {color: Colors['text-body']}]}
13
+ style={[tw`pr-4`, {color: Colors['text-body']}]}
15
14
  >
16
15
  {text}
17
16
  </EText>
@@ -10,6 +10,7 @@ interface IProps {
10
10
  subjectName?: string;
11
11
  border?: boolean;
12
12
  children?: JSX.Element;
13
+ showAvatar?: boolean;
13
14
  }
14
15
 
15
16
  export default function EProfile({
@@ -17,27 +18,27 @@ export default function EProfile({
17
18
  subjectName,
18
19
  border,
19
20
  children,
21
+ showAvatar = true
20
22
  }: IProps) {
21
23
  return (
22
24
  <View
23
25
  style={[
24
- tw`flex-row items-center justify-between py-3 ${
25
- border ? "border-b" : ""
26
- }`,
26
+ tw`flex-row items-center justify-between py-3 ${border ? "border-b" : ""
27
+ }`,
27
28
  { borderBottomColor: Colors.border },
28
29
  ]}
29
30
  >
30
31
  <View style={tw`flex-row items-center`}>
31
- <Avatar
32
+ {showAvatar ? <Avatar
32
33
  size="sm"
33
34
  source={""}
34
35
  nameFirstLetter={name.split(" ")[0].charAt(0)}
35
- />
36
+ /> : <></>}
36
37
  <View style={tw`ml-3`}>
37
38
  <EText
38
39
  size={"lg"}
39
40
  style={[
40
- tw`font-bold text-slate-800 mb-0.5 capitalize`,
41
+ tw`font-bold text-slate-800 mb-0 capitalize`,
41
42
  { color: Colors["text-primary"] },
42
43
  ]}
43
44
  >
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+ import { ImageBackground, TouchableOpacity, View } from "react-native";
3
+ import tw from "../../../lib/tailwind";
4
+ import EText from "./EText";
5
+ import { Colors } from "fln-espranza/utils/Color";
6
+
7
+ interface IProps {
8
+ stat: string;
9
+ target: string;
10
+ label: string;
11
+ statColor?: string;
12
+ iconR?: JSX.Element;
13
+ }
14
+
15
+ export default function EStatReport({
16
+ stat,
17
+ target,
18
+ label,
19
+ iconR,
20
+ statColor
21
+ }: IProps) {
22
+
23
+ const percentage = Math.round((parseFloat(stat) / parseFloat(target)) * 100);
24
+ const pending = Number(stat) <= Number(target) ? parseFloat(target) - parseFloat(stat) : 0;
25
+
26
+ return (
27
+ <TouchableOpacity
28
+ style={[tw`bg-slate-00 flex-1 overflow-hidden items-center py-3`, {
29
+ // shadowColor: '#155e75',
30
+ // shadowOffset: { width: 0, height: 8 },
31
+ // shadowOpacity: .1,
32
+ // shadowRadius: 16,
33
+ }]}
34
+ activeOpacity={0.8}
35
+ >
36
+ <View style={tw` mb-2 flex-row flex-1 justify-center`}>
37
+ <EText style={tw`text-3xl font-bold ${statColor} -tracking-0.25 `}>
38
+ {stat}
39
+ </EText>
40
+ <EText style={tw`ml-0.5 pt-1 text-slate-800 opacity-50 font-semibold -tracking-0.25`}>
41
+ / {target}
42
+ </EText>
43
+ {iconR}
44
+ </View>
45
+ <EText size="lg" style={tw`font-bold text-slate-700 mb-0.5`}>{label}</EText>
46
+ <EText size="sm" style={tw` text-slate-800 opacity-60`}>{pending} remaining</EText>
47
+ </TouchableOpacity>
48
+ );
49
+ }
@@ -5,6 +5,7 @@ import { Colors } from '../utils/Color';
5
5
  import EBadge from './EBadge'
6
6
  import EText from './EText';
7
7
  import EIconChevronRight from './icons/EIconChevronRight';
8
+ import { CheckCircleIcon } from 'react-native-heroicons/solid';
8
9
 
9
10
  interface IProps {
10
11
  title: string;
@@ -40,13 +41,14 @@ export default function ETimeLineCard({ title, description, completed, disabled,
40
41
  </EText>
41
42
  </View>
42
43
  <View style={tw`ml-4`}>
44
+
43
45
  <EBadge
44
- completed={completed}
45
- text={
46
+ color={completed ? `[${Colors['primary-base']}]` : `[${Colors.warning}]`}
47
+ size='sm'
48
+ >
49
+ {
46
50
  badgeText ? badgeText : completed ? "Complete" : "Pending"}
47
- bgColor={completed ? Colors['primary-base'] : Colors.warning}
48
- textColor={"#ffff"}
49
- />
51
+ </EBadge>
50
52
  </View>
51
53
  </View>
52
54
 
@@ -78,7 +78,9 @@ export default function PageHeader({
78
78
 
79
79
  :
80
80
  <TouchableOpacity activeOpacity={0.6}
81
- onPress={() => navigation.goBack()}>
81
+ onPress={() => navigation.goBack()}
82
+ style={tw`p-1`}
83
+ >
82
84
  <EIconArrowLeft
83
85
  iconColor={curved ? "white" : "tint-slate-900"}
84
86
  size={24}
package/index.ts CHANGED
@@ -88,6 +88,9 @@ import EProfileScreenLayout from "./components/EProfileScreenLayout";
88
88
  import { EIconMale } from "./components/icons/EIconMale";
89
89
  import { EIconFemale } from "./components/icons/EIconFemale";
90
90
  import EIconDocumentCheck from "./components/icons/EIconDocumentCheck";
91
+ import EStatReport from "./components/icons/EIconDocumentCheck";
92
+
93
+
91
94
 
92
95
  export {
93
96
  Avatar,
@@ -133,6 +136,7 @@ export {
133
136
  EProfileScreenLayout,
134
137
  ETextArea,
135
138
  ENotFoundPlaceholder,
139
+ EStatReport
136
140
 
137
141
  // ICONS
138
142
  EIconAdd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fln-espranza",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "description": "All components used inside FLN Project of Espranza Innovations",
5
5
  "main": "index.ts",
6
6
  "scripts": {