fln-espranza 0.0.25 → 0.0.26
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/components/ETextArea.tsx +53 -0
- package/index.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { View, Text, TextInput, TextInputProps } from "react-native";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import EText from "./EText";
|
|
4
|
+
import tw from "../lib/tailwind";
|
|
5
|
+
|
|
6
|
+
interface EInputProps extends TextInputProps {
|
|
7
|
+
label?: string;
|
|
8
|
+
size?: "lg";
|
|
9
|
+
hasBackground?: boolean;
|
|
10
|
+
icon?: JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function ETextArea({
|
|
14
|
+
label,
|
|
15
|
+
size,
|
|
16
|
+
hasBackground,
|
|
17
|
+
icon,
|
|
18
|
+
...props
|
|
19
|
+
}: EInputProps) {
|
|
20
|
+
const [hasFocus, setHasFocus] = useState(false);
|
|
21
|
+
return (
|
|
22
|
+
<View style={[tw`mb-4`, {}]}>
|
|
23
|
+
{label ? (
|
|
24
|
+
<EText size="sm" style={[tw`font-semibold text-slate-800`, {
|
|
25
|
+
// color: Colors["text-primary"]
|
|
26
|
+
}]}>
|
|
27
|
+
{label}
|
|
28
|
+
</EText>
|
|
29
|
+
) : null}
|
|
30
|
+
|
|
31
|
+
<View
|
|
32
|
+
style={tw` mt-2 `}
|
|
33
|
+
>
|
|
34
|
+
<TextInput
|
|
35
|
+
style={[tw`h-48 rounded-lg p-4 border border-slate-300 ${
|
|
36
|
+
hasFocus ? "border-black " : ""
|
|
37
|
+
}`, {
|
|
38
|
+
textAlignVertical: 'top'
|
|
39
|
+
}]}
|
|
40
|
+
{...props}
|
|
41
|
+
multiline = {true}
|
|
42
|
+
onFocus={() => setHasFocus(!hasFocus)}
|
|
43
|
+
onBlur={() => setHasFocus(!hasFocus)}
|
|
44
|
+
/>
|
|
45
|
+
{
|
|
46
|
+
icon ?
|
|
47
|
+
<>{icon}</>
|
|
48
|
+
: null
|
|
49
|
+
}
|
|
50
|
+
</View>
|
|
51
|
+
</View>
|
|
52
|
+
);
|
|
53
|
+
}
|
package/index.ts
CHANGED
|
@@ -34,6 +34,7 @@ import EDateInput from "./components/EDateInput";
|
|
|
34
34
|
import EErrorText from "./components/EErrorText";
|
|
35
35
|
import EListPerson from "./components/EListPerson";
|
|
36
36
|
import EListSchool from "./components/EListSchool";
|
|
37
|
+
import ETextArea from "./components/ETextArea";
|
|
37
38
|
|
|
38
39
|
// ICONS
|
|
39
40
|
import EIconAdd from "./components/icons/EIconAdd";
|
|
@@ -126,6 +127,7 @@ export {
|
|
|
126
127
|
EQuestionText,
|
|
127
128
|
EEmptyPlaceholder,
|
|
128
129
|
EProfileScreenLayout,
|
|
130
|
+
ETextArea,
|
|
129
131
|
|
|
130
132
|
// ICONS
|
|
131
133
|
EIconAdd,
|