@servesall/atoms 1.0.51 → 1.0.57
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/dist/bundle.cjs.js +10237 -280
- package/dist/bundle.esm.js +10236 -281
- package/dist/bundle.umd.js +10237 -280
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/Buttons/AnimatedButton/FloatingButton.js +20 -8
- package/src/Buttons/AnimatedButton/index.js +14 -5
- package/src/Buttons/RoundButton/RoundButton.style.js +4 -4
- package/src/Buttons/RoundButton/index.js +3 -0
- package/src/Icons/.DS_Store +0 -0
- package/src/Icons/Assets/.DS_Store +0 -0
- package/src/Icons/Assets/arrowRight.json +1 -0
- package/src/Icons/Assets/back.json +125 -1
- package/src/Icons/Assets/boatResources.json +162 -0
- package/src/Icons/Assets/calendar.json +1 -0
- package/src/Icons/Assets/category.json +143 -0
- package/src/Icons/Assets/day.json +1 -0
- package/src/Icons/Assets/diningTable.json +293 -0
- package/src/Icons/Assets/fitnessResources.json +156 -0
- package/src/Icons/Assets/house.json +1 -0
- package/src/Icons/Assets/humanResources.json +129 -0
- package/src/Icons/Assets/index.js +44 -0
- package/src/Icons/Assets/lidoResources.json +189 -0
- package/src/Icons/Assets/location.json +1 -0
- package/src/Icons/Assets/media.json +251 -0
- package/src/Icons/Assets/minus.json +1 -0
- package/src/Icons/Assets/name.json +116 -0
- package/src/Icons/Assets/non-visible.json +1 -0
- package/src/Icons/Assets/plus.json +1 -0
- package/src/Icons/Assets/settings.json +207 -0
- package/src/Icons/Assets/spaResources.json +278 -0
- package/src/Icons/Assets/sportsResources.json +156 -0
- package/src/Icons/Assets/time.json +1 -0
- package/src/Icons/Assets/toursResources.json +228 -0
- package/src/Icons/Assets/visible.json +1 -0
- package/src/Inputs/Animated/Animated.style.js +4 -3
- package/src/Inputs/Animated/index.js +76 -72
- package/src/Layout/Layout.style.js +6 -0
- package/src/Layout/PaddingTop.js +12 -0
- package/src/Layout/index.js +2 -0
- package/src/Switch/index.js +79 -0
- package/src/Switch/switch.json +1 -0
- package/src/Theme/definitions/colors.js +15 -3
- package/src/Theme/definitions/fonts.js +1 -1
- package/src/Theme/definitions/layout.js +4 -4
- package/src/index.js +4 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ip": 0,
|
|
3
|
+
"fr": 60,
|
|
4
|
+
"v": "5.1.20",
|
|
5
|
+
"assets": [],
|
|
6
|
+
"layers": [
|
|
7
|
+
{
|
|
8
|
+
"ty": 4,
|
|
9
|
+
"nm": "toursResources",
|
|
10
|
+
"ip": 0,
|
|
11
|
+
"st": 0,
|
|
12
|
+
"ind": 1,
|
|
13
|
+
"hix": 1,
|
|
14
|
+
"ks": {
|
|
15
|
+
"o": { "a": 0, "k": 100 },
|
|
16
|
+
"or": { "a": 0, "k": [0, 0, 0] },
|
|
17
|
+
"a": { "a": 0, "k": [13, 9, 0] },
|
|
18
|
+
"p": {
|
|
19
|
+
"s": true,
|
|
20
|
+
"x": { "a": 0, "k": 13.621 },
|
|
21
|
+
"y": { "a": 0, "k": 12.04 }
|
|
22
|
+
},
|
|
23
|
+
"rx": { "a": 0, "k": 0 },
|
|
24
|
+
"ry": { "a": 0, "k": 0 },
|
|
25
|
+
"rz": { "a": 0, "k": 0 },
|
|
26
|
+
"s": { "a": 0, "k": [100, 100, 100] }
|
|
27
|
+
},
|
|
28
|
+
"shapes": [
|
|
29
|
+
{
|
|
30
|
+
"ty": "gr",
|
|
31
|
+
"nm": "toursResources shape group",
|
|
32
|
+
"it": [
|
|
33
|
+
{
|
|
34
|
+
"ty": "sh",
|
|
35
|
+
"ks": {
|
|
36
|
+
"a": 0,
|
|
37
|
+
"k": {
|
|
38
|
+
"c": false,
|
|
39
|
+
"v": [
|
|
40
|
+
[6.20812066, 22.4253184],
|
|
41
|
+
[9.14678701, 24.2866516],
|
|
42
|
+
[12.0907873, 22.4133174]
|
|
43
|
+
],
|
|
44
|
+
"i": [
|
|
45
|
+
[0, 0],
|
|
46
|
+
[-1.2986666400000004, 0],
|
|
47
|
+
[-0.5186667000000007, 1.1066666000000005]
|
|
48
|
+
],
|
|
49
|
+
"o": [
|
|
50
|
+
[0.5199999800000006, 1.1000000000000014],
|
|
51
|
+
[1.3026666899999988, 0],
|
|
52
|
+
[0, 0]
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"ty": "sh",
|
|
59
|
+
"ks": {
|
|
60
|
+
"a": 0,
|
|
61
|
+
"k": {
|
|
62
|
+
"c": true,
|
|
63
|
+
"v": [
|
|
64
|
+
[28.2907867, 21.0373179],
|
|
65
|
+
[25.041453, 17.7879842],
|
|
66
|
+
[21.7921206, 21.0373179],
|
|
67
|
+
[25.041453, 24.2866516]
|
|
68
|
+
],
|
|
69
|
+
"i": [
|
|
70
|
+
[0, 1.7945572999999975],
|
|
71
|
+
[1.794557300000001, 0],
|
|
72
|
+
[0, -1.7945571999999999],
|
|
73
|
+
[-1.7945571999999999, 0]
|
|
74
|
+
],
|
|
75
|
+
"o": [
|
|
76
|
+
[0, -1.7945571999999999],
|
|
77
|
+
[-1.7945571999999999, 0],
|
|
78
|
+
[0, 1.7945572999999975],
|
|
79
|
+
[1.794557300000001, 0]
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"ty": "sh",
|
|
86
|
+
"ks": {
|
|
87
|
+
"a": 0,
|
|
88
|
+
"k": {
|
|
89
|
+
"c": false,
|
|
90
|
+
"v": [
|
|
91
|
+
[22.2654533, 15.0493177],
|
|
92
|
+
[19.708121, 7.71331787],
|
|
93
|
+
[16.1534538, 7.71331787]
|
|
94
|
+
],
|
|
95
|
+
"i": [
|
|
96
|
+
[0, 0],
|
|
97
|
+
[0, 0],
|
|
98
|
+
[0, 0]
|
|
99
|
+
],
|
|
100
|
+
"o": [
|
|
101
|
+
[0, 0],
|
|
102
|
+
[0, 0],
|
|
103
|
+
[0, 0]
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"ty": "sh",
|
|
110
|
+
"ks": {
|
|
111
|
+
"a": 0,
|
|
112
|
+
"k": {
|
|
113
|
+
"c": false,
|
|
114
|
+
"v": [
|
|
115
|
+
[11.5601203, 10.597318],
|
|
116
|
+
[8.48812071, 10.597318],
|
|
117
|
+
[5.54412047, 9.3053182],
|
|
118
|
+
[4.90012042, 8.60531807]
|
|
119
|
+
],
|
|
120
|
+
"i": [
|
|
121
|
+
[0, 0],
|
|
122
|
+
[0, 0],
|
|
123
|
+
[0.7573333599999996, 0.8239999999999998],
|
|
124
|
+
[0, 0]
|
|
125
|
+
],
|
|
126
|
+
"o": [
|
|
127
|
+
[0, 0],
|
|
128
|
+
[-1.1186666400000007, 0],
|
|
129
|
+
[0, 0],
|
|
130
|
+
[0, 0]
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"ty": "sh",
|
|
137
|
+
"ks": {
|
|
138
|
+
"a": 0,
|
|
139
|
+
"k": {
|
|
140
|
+
"c": false,
|
|
141
|
+
"v": [
|
|
142
|
+
[25.041453, 14.4373182],
|
|
143
|
+
[18.5867869, 19.6506513],
|
|
144
|
+
[18.5894547, 19.6506513],
|
|
145
|
+
[14.5841204, 19.6506513],
|
|
146
|
+
[9.14545441, 14.2119853],
|
|
147
|
+
[3.70678711, 19.6506513],
|
|
148
|
+
[14.5841204, 19.6506513]
|
|
149
|
+
],
|
|
150
|
+
"i": [
|
|
151
|
+
[0, 0],
|
|
152
|
+
[0.6373333000000017, -2.9786666000000004],
|
|
153
|
+
[0, 0],
|
|
154
|
+
[0, 0],
|
|
155
|
+
[3.0039999900000005, 0],
|
|
156
|
+
[0, -3.0040000000000013],
|
|
157
|
+
[0, 0]
|
|
158
|
+
],
|
|
159
|
+
"o": [
|
|
160
|
+
[-3.1693333999999993, 0],
|
|
161
|
+
[0, 0],
|
|
162
|
+
[0, 0],
|
|
163
|
+
[0, -3.0040000000000013],
|
|
164
|
+
[-3.0040000299999994, 0],
|
|
165
|
+
[0, 0],
|
|
166
|
+
[0, 0]
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"ty": "sh",
|
|
173
|
+
"ks": {
|
|
174
|
+
"a": 0,
|
|
175
|
+
"k": {
|
|
176
|
+
"c": false,
|
|
177
|
+
"v": [
|
|
178
|
+
[24.296121, 10.597318],
|
|
179
|
+
[24.296121, 8.60531807]
|
|
180
|
+
],
|
|
181
|
+
"i": [
|
|
182
|
+
[0, 0],
|
|
183
|
+
[0, 0]
|
|
184
|
+
],
|
|
185
|
+
"o": [
|
|
186
|
+
[0, 0],
|
|
187
|
+
[0, 0]
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"ty": "st",
|
|
194
|
+
"o": { "a": 0, "k": 100 },
|
|
195
|
+
"c": { "a": 0, "k": [0, 0, 0, 1] },
|
|
196
|
+
"lc": 2,
|
|
197
|
+
"lj": 2,
|
|
198
|
+
"ml": 1,
|
|
199
|
+
"w": { "a": 0, "k": 1 },
|
|
200
|
+
"d": [
|
|
201
|
+
{ "n": "d", "v": { "a": 0, "k": 0 }, "nm": "0" },
|
|
202
|
+
{ "n": "g", "v": { "a": 0, "k": 0 }, "nm": "1" }
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"ty": "fl",
|
|
207
|
+
"o": { "a": 0, "k": 0 },
|
|
208
|
+
"c": { "a": 0, "k": [0, 0, 0, 0] },
|
|
209
|
+
"r": 1
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"ty": "tr",
|
|
213
|
+
"o": { "a": 0, "k": 100 },
|
|
214
|
+
"a": { "a": 0, "k": [0, 0] },
|
|
215
|
+
"s": { "a": 0, "k": [100, 100] },
|
|
216
|
+
"p": { "a": 0, "k": [-3, -7] },
|
|
217
|
+
"r": { "a": 0, "k": 0 }
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
"op": 1
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"op": 1,
|
|
226
|
+
"w": 28,
|
|
227
|
+
"h": 25
|
|
228
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ip":0,"fr":60,"v":"5.1.20","assets":[],"layers":[{"ty":4,"nm":"visible","ip":0,"st":0,"ind":1,"hix":1,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[9,6.5,0]},"p":{"s":true,"x":{"a":0,"k":49.999999524764874},"y":{"a":0,"k":50.00049965677462}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":0,"k":0},"s":{"a":0,"k":[499.09999999999997,499.09999999999997]}},"shapes":[{"ty":"gr","nm":"visible shape group","it":[{"ty":"sh","ks":{"a":0,"k":{"c":false,"v":[[11.6667023,5.9460001],[8.99970245,8.61299992],[6.33270264,5.9460001],[8.99970245,3.27900028]],"i":[[0,0],[1.4730000500000013,0],[0,1.4730000499999996],[-1.4730000499999996,0]],"o":[[0,1.4730000499999996],[-1.4730000499999996,0],[0,-1.4730000500000004],[0,0]]}}},{"ty":"sh","ks":{"a":0,"k":{"c":true,"v":[[8.99970245,0.61328125],[17.2494068,5.94653273],[8.99970245,11.2797823],[0.75,5.94653273]],"i":[[-3.6723422999999995,0],[-1.4162720999999987,-3.1443119100000003],[3.672342350000001,0],[1.41627145,3.14431142]],"o":[[3.672342350000001,0],[-1.4162720999999987,3.14431142],[-3.6723422999999995,0],[1.41627145,-3.1443119100000003]]}}},{"ty":"st","o":{"a":0,"k":100},"c":{"a":0,"k":[0,0,0,1]},"lc":2,"lj":2,"ml":1,"w":{"a":0,"k":1.5},"d":[{"n":"d","v":{"a":0,"k":0},"nm":"0"},{"n":"g","v":{"a":0,"k":0},"nm":"1"}]},{"ty":"fl","o":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"r":1},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[0,1]},"r":{"a":0,"k":0}}]}],"op":1}],"op":1,"w":100,"h":100}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled from
|
|
1
|
+
import styled from "styled-components/native";
|
|
2
2
|
|
|
3
3
|
export const InputWrapper = styled.Pressable`
|
|
4
4
|
min-height: 80px;
|
|
@@ -7,8 +7,9 @@ export const InputWrapper = styled.Pressable`
|
|
|
7
7
|
export const InputElement = styled.TextInput`
|
|
8
8
|
margin-top: 26px;
|
|
9
9
|
min-height: 50px;
|
|
10
|
-
font-family: ${props => props.theme.fontFamily2};
|
|
11
|
-
font-size: ${props => props.theme.small};
|
|
10
|
+
font-family: ${(props) => props.theme.fontFamily2};
|
|
11
|
+
font-size: ${(props) => props.theme.small};
|
|
12
|
+
color: ${(props) => props.theme.color2};
|
|
12
13
|
`;
|
|
13
14
|
export const BorderWrapper = styled.View`
|
|
14
15
|
height: 4px;
|
|
@@ -1,80 +1,84 @@
|
|
|
1
|
-
import React, {useEffect, useState, useRef} from
|
|
2
|
-
import {H3} from
|
|
3
|
-
import {KeyboardAvoidingView, Platform} from
|
|
4
|
-
import {InputWrapper, InputElement, BorderWrapper} from
|
|
5
|
-
import LineAnimation from
|
|
6
|
-
import Placeholder from
|
|
1
|
+
import React, { useEffect, useState, useRef } from "react";
|
|
2
|
+
import { H3 } from "../../Text";
|
|
3
|
+
import { KeyboardAvoidingView, Platform } from "react-native";
|
|
4
|
+
import { InputWrapper, InputElement, BorderWrapper } from "./Animated.style";
|
|
5
|
+
import LineAnimation from "./LineAnimation";
|
|
6
|
+
import Placeholder from "./Placeholder";
|
|
7
7
|
|
|
8
8
|
const Input = ({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
9
|
+
children,
|
|
10
|
+
style,
|
|
11
|
+
borderColorIdle,
|
|
12
|
+
borderColorActive,
|
|
13
|
+
borderColorError,
|
|
14
|
+
textChange = () => {},
|
|
15
|
+
value,
|
|
16
|
+
multiline = false,
|
|
17
|
+
numberOfLines = 1,
|
|
18
|
+
maxLength = 1000,
|
|
19
|
+
autoFocus = false,
|
|
20
|
+
keyboardType,
|
|
21
|
+
editable = true,
|
|
22
|
+
keyboardVerticalOffset = 0,
|
|
23
|
+
hasError = false,
|
|
24
|
+
error,
|
|
25
|
+
}) => {
|
|
26
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
27
|
+
const [textValue, setTextValue] = useState(value);
|
|
28
|
+
const inputRef = useRef();
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
textChange(textValue);
|
|
32
|
+
}, [textValue]);
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
autoFocus && inputRef.current?.focus();
|
|
36
|
+
}, [autoFocus]);
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
38
|
+
return (
|
|
39
|
+
<KeyboardAvoidingView
|
|
40
|
+
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
|
41
|
+
keyboardVerticalOffset={keyboardVerticalOffset}
|
|
42
|
+
>
|
|
43
|
+
<InputWrapper
|
|
44
|
+
onPress={() => {
|
|
45
|
+
setIsFocused(true);
|
|
46
|
+
inputRef.current?.focus();
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<Placeholder active={isFocused || (textValue && textValue.length > 0)}>
|
|
50
|
+
{!hasError ? (
|
|
51
|
+
children
|
|
52
|
+
) : (
|
|
53
|
+
<H3 color={borderColorError}>{error || hasError}</H3>
|
|
54
|
+
)}
|
|
55
|
+
</Placeholder>
|
|
56
|
+
<InputElement
|
|
57
|
+
ref={inputRef}
|
|
58
|
+
onFocus={() => setIsFocused(true)}
|
|
59
|
+
onBlur={() => setIsFocused(false)}
|
|
60
|
+
onChangeText={(text) => setTextValue(text)}
|
|
61
|
+
value={value}
|
|
62
|
+
multiline={multiline}
|
|
63
|
+
numberOfLines={numberOfLines}
|
|
64
|
+
maxLength={maxLength}
|
|
65
|
+
autoFocus={autoFocus}
|
|
66
|
+
keyboardType={keyboardType}
|
|
67
|
+
editable={editable}
|
|
68
|
+
style={style}
|
|
69
|
+
/>
|
|
70
|
+
<BorderWrapper>
|
|
71
|
+
<LineAnimation
|
|
72
|
+
active={isFocused}
|
|
73
|
+
borderColorActive={borderColorActive}
|
|
74
|
+
borderColorIdle={borderColorIdle}
|
|
75
|
+
borderColorError={borderColorError}
|
|
76
|
+
hasError={hasError}
|
|
77
|
+
/>
|
|
78
|
+
</BorderWrapper>
|
|
79
|
+
</InputWrapper>
|
|
80
|
+
</KeyboardAvoidingView>
|
|
81
|
+
);
|
|
78
82
|
};
|
|
79
83
|
|
|
80
84
|
export default Input;
|
|
@@ -87,6 +87,12 @@ export const PaddingVerticalElement = styled.View`
|
|
|
87
87
|
${(props) => props.style};
|
|
88
88
|
`;
|
|
89
89
|
|
|
90
|
+
export const PaddingTopElement = styled.View`
|
|
91
|
+
padding-top: ${(props) => props.theme.padding};
|
|
92
|
+
flex-direction: ${(props) => props.flexDirection || DEFAULT_FLEX_DIRECTION};
|
|
93
|
+
${(props) => props.style};
|
|
94
|
+
`;
|
|
95
|
+
|
|
90
96
|
export const RowElement = styled.View`
|
|
91
97
|
flex-direction: row;
|
|
92
98
|
${(props) => props.style};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PaddingTopElement } from "./Layout.style";
|
|
3
|
+
|
|
4
|
+
const PaddingTop = ({ children, style, direction = false }) => {
|
|
5
|
+
return (
|
|
6
|
+
<PaddingTopElement style={style} flexDirection={direction}>
|
|
7
|
+
{children}
|
|
8
|
+
</PaddingTopElement>
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default PaddingTop;
|
package/src/Layout/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import MarginTop from "./MarginTop";
|
|
|
9
9
|
import Padding from "./Padding";
|
|
10
10
|
import PaddingHorizontal from "./PaddingHorizontal";
|
|
11
11
|
import PaddingVertical from "./PaddingVertical";
|
|
12
|
+
import PaddingTop from "./PaddingTop";
|
|
12
13
|
import Row from "./Row";
|
|
13
14
|
import Stretch from "./Stretch";
|
|
14
15
|
import FullScreen from "./FullScreen";
|
|
@@ -26,6 +27,7 @@ export {
|
|
|
26
27
|
Padding,
|
|
27
28
|
PaddingHorizontal,
|
|
28
29
|
PaddingVertical,
|
|
30
|
+
PaddingTop,
|
|
29
31
|
Row,
|
|
30
32
|
Stretch,
|
|
31
33
|
FullScreen,
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import LottieView from "lottie-react-native";
|
|
4
|
+
import switchIcon from "./switch.json";
|
|
5
|
+
import { RoundedBtn } from "../Buttons";
|
|
6
|
+
import colors from "../Theme/definitions/colors";
|
|
7
|
+
import { Center } from "../Layout";
|
|
8
|
+
|
|
9
|
+
const CheckMark = ({ isEnabled, micro }) => {
|
|
10
|
+
const loadingRef = useRef();
|
|
11
|
+
return (
|
|
12
|
+
<View
|
|
13
|
+
style={{
|
|
14
|
+
position: "absolute",
|
|
15
|
+
top: micro ? -7 : 10,
|
|
16
|
+
right: micro ? -7 : 10,
|
|
17
|
+
width: 30,
|
|
18
|
+
height: 30,
|
|
19
|
+
borderRadius: 15,
|
|
20
|
+
borderWidth: 1,
|
|
21
|
+
borderColor: isEnabled ? colors.color1 : colors.color10,
|
|
22
|
+
backgroundColor: colors.color1,
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<Center>
|
|
26
|
+
{isEnabled && (
|
|
27
|
+
<LottieView
|
|
28
|
+
ref={loadingRef}
|
|
29
|
+
style={{
|
|
30
|
+
height: 30,
|
|
31
|
+
width: 30,
|
|
32
|
+
}}
|
|
33
|
+
autoPlay={true}
|
|
34
|
+
loop={false}
|
|
35
|
+
source={switchIcon}
|
|
36
|
+
/>
|
|
37
|
+
)}
|
|
38
|
+
</Center>
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default function Switch({
|
|
44
|
+
children,
|
|
45
|
+
enabled = true,
|
|
46
|
+
value = false,
|
|
47
|
+
onValueChange = () => {},
|
|
48
|
+
micro = false,
|
|
49
|
+
style,
|
|
50
|
+
}) {
|
|
51
|
+
const [isEnabled, setIsEnabled] = useState(value);
|
|
52
|
+
const toggleSwitch = () => {
|
|
53
|
+
enabled &&
|
|
54
|
+
setIsEnabled((previousState) => {
|
|
55
|
+
onValueChange(!previousState);
|
|
56
|
+
return !previousState;
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
setIsEnabled(value);
|
|
62
|
+
}, [value]);
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<RoundedBtn
|
|
66
|
+
style={{
|
|
67
|
+
borderWidth: 1,
|
|
68
|
+
borderColor: isEnabled ? colors.color15 : colors.color10,
|
|
69
|
+
opacity: enabled ? 1 : 0.6,
|
|
70
|
+
...style,
|
|
71
|
+
}}
|
|
72
|
+
color={colors.color1}
|
|
73
|
+
onClick={toggleSwitch}
|
|
74
|
+
>
|
|
75
|
+
<CheckMark isEnabled={isEnabled} micro={micro} />
|
|
76
|
+
{children}
|
|
77
|
+
</RoundedBtn>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ip":0,"fr":60,"v":"5.1.20","assets":[],"layers":[{"ty":4,"nm":"success","ip":0,"st":0,"ind":1,"hix":1,"ks":{"o":{"a":0,"k":100},"or":{"a":0,"k":[0,0,0]},"a":{"a":0,"k":[75,75,0]},"p":{"s":true,"x":{"a":1,"k":[{"t":0,"s":[50],"e":[50.05400195600987],"i":{"x":[0.515],"y":[0.955]},"o":{"x":[0.455],"y":[0.03]}},{"t":12}]},"y":{"a":1,"k":[{"t":0,"s":[50],"e":[49.946001956009866],"i":{"x":[0.515],"y":[0.955]},"o":{"x":[0.455],"y":[0.03]}},{"t":12}]}},"rx":{"a":0,"k":0},"ry":{"a":0,"k":0},"rz":{"a":0,"k":0},"s":{"a":1,"k":[{"t":0,"s":[11,11],"e":[66.7,66.7],"i":{"x":[0.515,0.515],"y":[0.955,0.955]},"o":{"x":[0.455,0.455],"y":[0.03,0.03]}},{"t":12}]}},"shapes":[{"ty":"gr","nm":"success shape group","it":[{"ty":"rc","s":{"a":0,"k":[69,15]},"r":{"a":0,"k":7},"p":{"a":0,"k":[85.2835427,75.5]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1,"ml":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[1,1,1,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-28.156,92.301]},"r":{"a":0,"k":310.02746294528845}}]},{"ty":"gr","nm":"success shape group","it":[{"ty":"rc","s":{"a":0,"k":[43,15]},"r":{"a":0,"k":7},"p":{"a":0,"k":[58.5,85.6007333]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1,"ml":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[1,1,1,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[85.687,-14.236]},"r":{"a":0,"k":50.019215514920866}}]},{"ty":"gr","nm":"success shape group","it":[{"ty":"el","p":{"a":0,"k":[75,75]},"s":{"a":0,"k":[150,150]}},{"ty":"st","o":{"a":0,"k":0},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0,0]},"lc":3,"lj":1,"ml":1},{"ty":"fl","o":{"a":0,"k":100},"r":2,"c":{"a":0,"k":[0.3333333333333333,0.9372549019607843,0.7686274509803922,1]}},{"ty":"tr","o":{"a":0,"k":100},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[-0.784,0]},"r":{"a":0,"k":0}}]}],"op":12}],"op":12,"w":100,"h":100}
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
const colors = {
|
|
2
2
|
color1: "#FFFFFF",
|
|
3
|
-
color2: "#
|
|
3
|
+
color2: "#000000",
|
|
4
4
|
color3: "#74b9ff",
|
|
5
|
+
color3light: "#E1F0FF",
|
|
5
6
|
color4: "#0984e3",
|
|
6
7
|
color5: "#ffeaa7",
|
|
8
|
+
color5light: "#FFF9E5",
|
|
9
|
+
color5border: "#E4E0D2",
|
|
7
10
|
color6: "#ff7675",
|
|
11
|
+
color6light: "#FFDCDB",
|
|
8
12
|
color7: "#dfe6e9",
|
|
9
|
-
color8: "#
|
|
13
|
+
color8: "#F8F9FB",
|
|
10
14
|
color9: "#FFA15F",
|
|
11
|
-
|
|
15
|
+
color9light: "#FFF0E6",
|
|
16
|
+
color9border: "#DDD1C9",
|
|
17
|
+
color10: "#F2F3F7",
|
|
12
18
|
color11: "#00b894",
|
|
19
|
+
color11light: "#EEFFFC",
|
|
20
|
+
color11border: "#D2E3E0",
|
|
13
21
|
color12: "#a29bfe",
|
|
22
|
+
color12light: "#F5F4FF",
|
|
23
|
+
color12border: "#DFDDEA",
|
|
14
24
|
color13: "#fab1a0",
|
|
15
25
|
color14: "#00b894",
|
|
16
26
|
color15: "#00cec9",
|
|
17
27
|
color16: "#636e72",
|
|
28
|
+
color17: "#6c5ce7",
|
|
29
|
+
color18: "#81ecec",
|
|
18
30
|
};
|
|
19
31
|
export default colors;
|
package/src/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Padding,
|
|
13
13
|
PaddingHorizontal,
|
|
14
14
|
PaddingVertical,
|
|
15
|
+
PaddingTop,
|
|
15
16
|
Row,
|
|
16
17
|
Stretch,
|
|
17
18
|
FullScreen,
|
|
@@ -32,6 +33,7 @@ import Icon from "./Icons";
|
|
|
32
33
|
import FlatList from "./FlatList";
|
|
33
34
|
import Header from "./Header";
|
|
34
35
|
import BottomNavBar from "./BottomNavBar";
|
|
36
|
+
import Switch from "./Switch";
|
|
35
37
|
|
|
36
38
|
export {
|
|
37
39
|
ThemeWrapper,
|
|
@@ -53,6 +55,7 @@ export {
|
|
|
53
55
|
Padding,
|
|
54
56
|
PaddingHorizontal,
|
|
55
57
|
PaddingVertical,
|
|
58
|
+
PaddingTop,
|
|
56
59
|
Row,
|
|
57
60
|
Stretch,
|
|
58
61
|
FullScreen,
|
|
@@ -72,4 +75,5 @@ export {
|
|
|
72
75
|
FlatList,
|
|
73
76
|
Header,
|
|
74
77
|
BottomNavBar,
|
|
78
|
+
Switch,
|
|
75
79
|
};
|