@hoddy-ui/core 1.0.87 → 1.0.89
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/next/components/AdaptiveStatusBarNext.tsx +38 -0
- package/next/dist/index.d.mts +548 -0
- package/next/dist/index.d.ts +548 -0
- package/next/dist/index.js +2097 -0
- package/next/dist/index.js.map +1 -0
- package/next/dist/index.mjs +2061 -0
- package/next/dist/index.mjs.map +1 -0
- package/next/index.ts +33 -0
- package/next/package.json +50 -0
- package/next/tsup.config.ts +11 -0
- package/package.json +1 -1
- package/src/Components/Button.tsx +91 -81
- package/src/Components/TextField.tsx +1 -20
- package/src/Components/Typography.tsx +55 -48
- package/src/theme/colors.ts +63 -63
|
@@ -0,0 +1,2061 @@
|
|
|
1
|
+
// ../src/theme/colors.ts
|
|
2
|
+
var extraColors = {};
|
|
3
|
+
var setExtraColors = (c) => extraColors = c;
|
|
4
|
+
function colors(theme) {
|
|
5
|
+
const lightColors = {
|
|
6
|
+
white: {
|
|
7
|
+
1: "#fff",
|
|
8
|
+
2: "#f7f7f7",
|
|
9
|
+
3: "#eee",
|
|
10
|
+
4: "#ddd",
|
|
11
|
+
5: "#bbb"
|
|
12
|
+
},
|
|
13
|
+
black: {
|
|
14
|
+
1: "#888",
|
|
15
|
+
2: "#777",
|
|
16
|
+
3: "#555",
|
|
17
|
+
4: "#333",
|
|
18
|
+
5: "#000"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const darkColors = {
|
|
22
|
+
black: {
|
|
23
|
+
1: "#fff",
|
|
24
|
+
2: "#f7f7f7",
|
|
25
|
+
3: "#eee",
|
|
26
|
+
4: "#ddd",
|
|
27
|
+
5: "#aaa"
|
|
28
|
+
},
|
|
29
|
+
white: {
|
|
30
|
+
1: "#000",
|
|
31
|
+
2: "#222",
|
|
32
|
+
3: "#333",
|
|
33
|
+
4: "#444",
|
|
34
|
+
5: "#555"
|
|
35
|
+
},
|
|
36
|
+
dark: {
|
|
37
|
+
main: "#f2f3f4",
|
|
38
|
+
light: "#fff",
|
|
39
|
+
dark: "#ddd",
|
|
40
|
+
text: "#000",
|
|
41
|
+
...extraColors?.dark?.dark
|
|
42
|
+
},
|
|
43
|
+
light: {
|
|
44
|
+
main: "#111",
|
|
45
|
+
light: "#555",
|
|
46
|
+
dark: "#333",
|
|
47
|
+
text: "#fff",
|
|
48
|
+
...extraColors?.dark?.light
|
|
49
|
+
},
|
|
50
|
+
textSecondary: {
|
|
51
|
+
main: "#666",
|
|
52
|
+
light: "#777",
|
|
53
|
+
dark: "#444",
|
|
54
|
+
text: "#fff",
|
|
55
|
+
...extraColors?.dark?.textSecondary
|
|
56
|
+
},
|
|
57
|
+
primary: {
|
|
58
|
+
main: "#f80",
|
|
59
|
+
light: "#FEFFD3",
|
|
60
|
+
dark: "#fa0",
|
|
61
|
+
text: "#fff",
|
|
62
|
+
...extraColors?.light?.primary,
|
|
63
|
+
...extraColors?.dark?.primary
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const dynamicColors = theme === "dark" ? darkColors : lightColors;
|
|
67
|
+
return {
|
|
68
|
+
...extraColors[theme],
|
|
69
|
+
primary: {
|
|
70
|
+
main: "#f80",
|
|
71
|
+
light: "#FEFFD3",
|
|
72
|
+
dark: "#fa0",
|
|
73
|
+
text: "#fff",
|
|
74
|
+
...extraColors?.light?.primary
|
|
75
|
+
},
|
|
76
|
+
secondary: {
|
|
77
|
+
main: "#f11",
|
|
78
|
+
light: "#f43",
|
|
79
|
+
dark: "#d00",
|
|
80
|
+
text: "#fff",
|
|
81
|
+
...extraColors?.light?.secondary
|
|
82
|
+
},
|
|
83
|
+
light: {
|
|
84
|
+
main: "#fff",
|
|
85
|
+
light: "#fff",
|
|
86
|
+
dark: "#ddd",
|
|
87
|
+
text: "#000",
|
|
88
|
+
...extraColors?.light?.light
|
|
89
|
+
},
|
|
90
|
+
dark: {
|
|
91
|
+
main: "#000",
|
|
92
|
+
light: "#777",
|
|
93
|
+
dark: "#111",
|
|
94
|
+
text: "#fff",
|
|
95
|
+
...extraColors?.light?.dark
|
|
96
|
+
},
|
|
97
|
+
textSecondary: {
|
|
98
|
+
main: "#aaa",
|
|
99
|
+
light: "#bbb",
|
|
100
|
+
dark: "#777",
|
|
101
|
+
text: "#123",
|
|
102
|
+
...extraColors?.light?.textSecondary
|
|
103
|
+
},
|
|
104
|
+
blue: {
|
|
105
|
+
main: "#09F",
|
|
106
|
+
light: "#39f",
|
|
107
|
+
dark: "#028",
|
|
108
|
+
text: "#fff",
|
|
109
|
+
...extraColors?.light?.blue
|
|
110
|
+
},
|
|
111
|
+
info: {
|
|
112
|
+
main: "#09f",
|
|
113
|
+
light: "#3af",
|
|
114
|
+
dark: "#08a",
|
|
115
|
+
text: "#fff",
|
|
116
|
+
...extraColors?.light?.info
|
|
117
|
+
},
|
|
118
|
+
success: {
|
|
119
|
+
main: "#0a4",
|
|
120
|
+
text: "#fff",
|
|
121
|
+
light: "#5c3",
|
|
122
|
+
dark: "#062",
|
|
123
|
+
...extraColors?.light?.success
|
|
124
|
+
},
|
|
125
|
+
warning: {
|
|
126
|
+
main: "#fa2",
|
|
127
|
+
light: "#fc7",
|
|
128
|
+
dark: "#f90",
|
|
129
|
+
text: "#fff",
|
|
130
|
+
...extraColors?.light?.warning
|
|
131
|
+
},
|
|
132
|
+
error: {
|
|
133
|
+
main: "#D22",
|
|
134
|
+
text: "#fff",
|
|
135
|
+
light: "#f43",
|
|
136
|
+
dark: "#a20",
|
|
137
|
+
...extraColors?.light?.error
|
|
138
|
+
},
|
|
139
|
+
...dynamicColors
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// ../src/config/KeyManager.ts
|
|
144
|
+
var apiKey = {
|
|
145
|
+
GOOGLE_MAP_API_KEY: ""
|
|
146
|
+
};
|
|
147
|
+
function setApiKey(key) {
|
|
148
|
+
apiKey = key;
|
|
149
|
+
}
|
|
150
|
+
function getApiKey() {
|
|
151
|
+
return apiKey;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// ../src/config/index.ts
|
|
155
|
+
function initialize(config) {
|
|
156
|
+
try {
|
|
157
|
+
setApiKey({
|
|
158
|
+
GOOGLE_MAP_API_KEY: config.googleMapApiKey
|
|
159
|
+
});
|
|
160
|
+
if (config.colors)
|
|
161
|
+
setExtraColors(config.colors);
|
|
162
|
+
} catch (error) {
|
|
163
|
+
console.error("Error reading the config file:", error);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// components/AdaptiveStatusBarNext.tsx
|
|
168
|
+
import { useFocusEffect } from "expo-router";
|
|
169
|
+
import React5, { useState as useState3 } from "react";
|
|
170
|
+
import { Platform as Platform3, StatusBar } from "react-native";
|
|
171
|
+
|
|
172
|
+
// ../src/hooks.ts
|
|
173
|
+
import { useContext } from "react";
|
|
174
|
+
import { Dimensions, Platform as Platform2 } from "react-native";
|
|
175
|
+
import { vs } from "react-native-size-matters";
|
|
176
|
+
|
|
177
|
+
// ../src/theme/index.tsx
|
|
178
|
+
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
179
|
+
import * as NavigationBar from "expo-navigation-bar";
|
|
180
|
+
import * as SystemUI from "expo-system-ui";
|
|
181
|
+
import React4, { createContext, useReducer } from "react";
|
|
182
|
+
import { Platform, useColorScheme } from "react-native";
|
|
183
|
+
|
|
184
|
+
// ../src/Components/FlashMessage.tsx
|
|
185
|
+
import React3, { useEffect, useState } from "react";
|
|
186
|
+
import {
|
|
187
|
+
LayoutAnimation,
|
|
188
|
+
TouchableOpacity,
|
|
189
|
+
View
|
|
190
|
+
} from "react-native";
|
|
191
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
192
|
+
import { ScaledSheet } from "react-native-size-matters";
|
|
193
|
+
|
|
194
|
+
// ../src/Components/Typography.tsx
|
|
195
|
+
import React2, { forwardRef } from "react";
|
|
196
|
+
import { StyleSheet, Text } from "react-native";
|
|
197
|
+
import { moderateScale, verticalScale } from "react-native-size-matters";
|
|
198
|
+
var Typography = forwardRef(
|
|
199
|
+
({
|
|
200
|
+
children,
|
|
201
|
+
color = "dark",
|
|
202
|
+
style = {},
|
|
203
|
+
textCase = null,
|
|
204
|
+
variant = "body1",
|
|
205
|
+
align = "left",
|
|
206
|
+
gutterBottom = 0,
|
|
207
|
+
numberOfLines,
|
|
208
|
+
adjustsFontSizeToFit,
|
|
209
|
+
fontWeight = 400,
|
|
210
|
+
...props
|
|
211
|
+
}, ref) => {
|
|
212
|
+
const colors2 = useColors();
|
|
213
|
+
const fontSize = {
|
|
214
|
+
h1: moderateScale(42),
|
|
215
|
+
h2: moderateScale(37),
|
|
216
|
+
h3: moderateScale(32),
|
|
217
|
+
h4: moderateScale(27),
|
|
218
|
+
h5: moderateScale(22),
|
|
219
|
+
h6: moderateScale(17),
|
|
220
|
+
body1: moderateScale(15),
|
|
221
|
+
body2: moderateScale(12),
|
|
222
|
+
caption: moderateScale(10)
|
|
223
|
+
};
|
|
224
|
+
const styles2 = StyleSheet.create({
|
|
225
|
+
text: {
|
|
226
|
+
fontSize: fontSize[variant],
|
|
227
|
+
marginBottom: verticalScale(gutterBottom) || 0,
|
|
228
|
+
color: colors2[color]?.main || color,
|
|
229
|
+
textTransform: textCase,
|
|
230
|
+
alignItems: "center",
|
|
231
|
+
textAlign: align,
|
|
232
|
+
fontWeight: fontWeight.toString()
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
return /* @__PURE__ */ React2.createElement(
|
|
236
|
+
Text,
|
|
237
|
+
{
|
|
238
|
+
ref,
|
|
239
|
+
numberOfLines,
|
|
240
|
+
adjustsFontSizeToFit,
|
|
241
|
+
style: { ...styles2.text, ...style },
|
|
242
|
+
...props
|
|
243
|
+
},
|
|
244
|
+
children
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
var Typography_default = Typography;
|
|
249
|
+
|
|
250
|
+
// ../src/Components/FlashMessage.tsx
|
|
251
|
+
var showFlashMessage = () => {
|
|
252
|
+
};
|
|
253
|
+
var FlashMessage = () => {
|
|
254
|
+
const { top } = useSafeAreaInsets();
|
|
255
|
+
const [message, setMessage] = useState(null);
|
|
256
|
+
const [show, setShow] = useState(false);
|
|
257
|
+
const colors2 = useColors();
|
|
258
|
+
const type = message?.type || "success";
|
|
259
|
+
showFlashMessage = (msg) => {
|
|
260
|
+
setMessage(msg);
|
|
261
|
+
setTimeout(() => {
|
|
262
|
+
setShow(true);
|
|
263
|
+
}, 50);
|
|
264
|
+
setTimeout(() => {
|
|
265
|
+
setShow(false);
|
|
266
|
+
setTimeout(() => {
|
|
267
|
+
setMessage(null);
|
|
268
|
+
}, 500);
|
|
269
|
+
}, msg.duration || 3e3);
|
|
270
|
+
};
|
|
271
|
+
useEffect(() => {
|
|
272
|
+
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
273
|
+
}, [show]);
|
|
274
|
+
const styles2 = ScaledSheet.create({
|
|
275
|
+
root: {
|
|
276
|
+
position: "absolute",
|
|
277
|
+
top: show ? 0 : -200,
|
|
278
|
+
zIndex: 1e3,
|
|
279
|
+
left: 0,
|
|
280
|
+
paddingTop: top + 10,
|
|
281
|
+
paddingHorizontal: "15@ms",
|
|
282
|
+
backgroundColor: colors2[type].main,
|
|
283
|
+
width: "100%",
|
|
284
|
+
borderBottomLeftRadius: 10,
|
|
285
|
+
borderBottomRightRadius: 10,
|
|
286
|
+
paddingBottom: "15@ms"
|
|
287
|
+
},
|
|
288
|
+
action: {
|
|
289
|
+
borderRadius: 20,
|
|
290
|
+
marginTop: "10@vs",
|
|
291
|
+
flexDirection: "row",
|
|
292
|
+
justifyContent: "center",
|
|
293
|
+
paddingHorizontal: "20@ms",
|
|
294
|
+
paddingVertical: "8@vs",
|
|
295
|
+
backgroundColor: "#fff3"
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
return /* @__PURE__ */ React3.createElement(View, { style: styles2.root }, /* @__PURE__ */ React3.createElement(View, { style: { flexDirection: "row" } }, /* @__PURE__ */ React3.createElement(View, { style: { flex: 1, marginRight: 10 } }, message?.title && /* @__PURE__ */ React3.createElement(
|
|
299
|
+
Typography_default,
|
|
300
|
+
{
|
|
301
|
+
variant: "h6",
|
|
302
|
+
fontWeight: 600,
|
|
303
|
+
gutterBottom: 3,
|
|
304
|
+
style: { color: "#fff" }
|
|
305
|
+
},
|
|
306
|
+
message?.title
|
|
307
|
+
), /* @__PURE__ */ React3.createElement(Typography_default, { style: { color: "#fff" } }, message?.message))), message?.actions?.map((cur, i) => /* @__PURE__ */ React3.createElement(TouchableOpacity, { key: i, style: styles2.action, onPress: cur.onPress }, /* @__PURE__ */ React3.createElement(Typography_default, { fontWeight: 700, style: { color: "#fff" } }, cur.title))));
|
|
308
|
+
};
|
|
309
|
+
var FlashMessage_default = FlashMessage;
|
|
310
|
+
|
|
311
|
+
// ../src/theme/index.tsx
|
|
312
|
+
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
313
|
+
var UIThemeContext = createContext({
|
|
314
|
+
themeState: { mode: "default", value: "light" }
|
|
315
|
+
});
|
|
316
|
+
function themeReducer(state, { type, payload }) {
|
|
317
|
+
if (payload === "dark" || type === "dark") {
|
|
318
|
+
SystemUI.setBackgroundColorAsync("#000000");
|
|
319
|
+
if (Platform.OS === "android") {
|
|
320
|
+
NavigationBar.setButtonStyleAsync("light");
|
|
321
|
+
NavigationBar.setBackgroundColorAsync("#000000");
|
|
322
|
+
}
|
|
323
|
+
} else {
|
|
324
|
+
SystemUI.setBackgroundColorAsync("#ffffff");
|
|
325
|
+
if (Platform.OS === "android") {
|
|
326
|
+
NavigationBar.setButtonStyleAsync("dark");
|
|
327
|
+
NavigationBar.setBackgroundColorAsync("#fff");
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
switch (type) {
|
|
331
|
+
case "dark":
|
|
332
|
+
return { mode: "dark", value: "dark" };
|
|
333
|
+
case "default":
|
|
334
|
+
return { mode: "default", value: payload };
|
|
335
|
+
case "light":
|
|
336
|
+
return { mode: "light", value: "light" };
|
|
337
|
+
default:
|
|
338
|
+
return state;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
var UIThemeProvider = ({ children }) => {
|
|
342
|
+
const [themeState, themeDispatch] = useReducer(themeReducer, {
|
|
343
|
+
mode: "default",
|
|
344
|
+
value: "light"
|
|
345
|
+
});
|
|
346
|
+
const colorScheme = useColorScheme();
|
|
347
|
+
React4.useEffect(() => {
|
|
348
|
+
AsyncStorage.getItem("theme").then((val) => {
|
|
349
|
+
if (val) {
|
|
350
|
+
if (val === "default") {
|
|
351
|
+
themeDispatch({
|
|
352
|
+
type: "default",
|
|
353
|
+
payload: colorScheme
|
|
354
|
+
});
|
|
355
|
+
} else
|
|
356
|
+
themeDispatch({
|
|
357
|
+
type: val
|
|
358
|
+
});
|
|
359
|
+
} else {
|
|
360
|
+
themeDispatch({
|
|
361
|
+
type: "default",
|
|
362
|
+
payload: colorScheme
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}, [colorScheme]);
|
|
367
|
+
return /* @__PURE__ */ React4.createElement(SafeAreaProvider, null, /* @__PURE__ */ React4.createElement(
|
|
368
|
+
UIThemeContext.Provider,
|
|
369
|
+
{
|
|
370
|
+
value: {
|
|
371
|
+
themeState,
|
|
372
|
+
themeDispatch
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
children,
|
|
376
|
+
/* @__PURE__ */ React4.createElement(FlashMessage_default, null)
|
|
377
|
+
));
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
// ../src/hooks.ts
|
|
381
|
+
var useColors = () => {
|
|
382
|
+
const { themeState } = useContext(UIThemeContext);
|
|
383
|
+
return colors(themeState.value);
|
|
384
|
+
};
|
|
385
|
+
var useTheme = () => {
|
|
386
|
+
const { themeState } = useContext(UIThemeContext);
|
|
387
|
+
return themeState.value;
|
|
388
|
+
};
|
|
389
|
+
var useNavScreenOptions = (type) => {
|
|
390
|
+
const colors2 = useColors();
|
|
391
|
+
const options = {
|
|
392
|
+
stack: {
|
|
393
|
+
headerShown: false,
|
|
394
|
+
headerStyle: {
|
|
395
|
+
backgroundColor: colors2.white[1]
|
|
396
|
+
},
|
|
397
|
+
headerShadowVisible: false,
|
|
398
|
+
contentStyle: {
|
|
399
|
+
backgroundColor: colors2.white[1]
|
|
400
|
+
},
|
|
401
|
+
headerTitleStyle: {
|
|
402
|
+
color: colors2.black[1]
|
|
403
|
+
},
|
|
404
|
+
headerTintColor: Platform2.OS === "android" ? colors2.black[1] : colors2.blue.light
|
|
405
|
+
},
|
|
406
|
+
tab: {
|
|
407
|
+
headerShown: false,
|
|
408
|
+
headerTintColor: colors2.dark.main,
|
|
409
|
+
tabBarStyle: {
|
|
410
|
+
borderTopColor: colors2.white[3],
|
|
411
|
+
borderTopWidth: 1,
|
|
412
|
+
// shadowColor: "#000",
|
|
413
|
+
// shadowOffset: { height: -3, width: 0 },
|
|
414
|
+
// shadowRadius: 7,
|
|
415
|
+
// shadowOpacity: 0.1,
|
|
416
|
+
backgroundColor: colors2.white[1]
|
|
417
|
+
},
|
|
418
|
+
tabBarActiveTintColor: colors2.blue.main,
|
|
419
|
+
tabBarInactiveTintColor: colors2.textSecondary.main,
|
|
420
|
+
tabBarLabelStyle: {
|
|
421
|
+
// fontSize: ms(12),
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
drawer: {
|
|
425
|
+
headerShown: false,
|
|
426
|
+
drawerActiveTintColor: colors2.primary.main,
|
|
427
|
+
drawerInactiveTintColor: colors2.textSecondary.main,
|
|
428
|
+
sceneContainerStyle: {
|
|
429
|
+
backgroundColor: colors2.white[2]
|
|
430
|
+
},
|
|
431
|
+
drawerStyle: {
|
|
432
|
+
backgroundColor: colors2.white[1]
|
|
433
|
+
},
|
|
434
|
+
headerStyle: {
|
|
435
|
+
backgroundColor: colors2.white[1]
|
|
436
|
+
},
|
|
437
|
+
headerTitleStyle: {
|
|
438
|
+
color: colors2.dark.main
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
if (Platform2.OS === "android") {
|
|
443
|
+
options.tab.tabBarStyle.height = Dimensions.get("screen").height * 0.08;
|
|
444
|
+
options.tab.tabBarStyle.paddingBottom = vs(15);
|
|
445
|
+
}
|
|
446
|
+
return options[type];
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
// components/AdaptiveStatusBarNext.tsx
|
|
450
|
+
var AdaptiveStatusBar = ({ translucent = false }) => {
|
|
451
|
+
const [focused, setFocused] = useState3(false);
|
|
452
|
+
const colors2 = useColors();
|
|
453
|
+
const theme = useTheme();
|
|
454
|
+
useFocusEffect(
|
|
455
|
+
React5.useCallback(() => {
|
|
456
|
+
StatusBar.setBarStyle(
|
|
457
|
+
theme === "dark" ? "light-content" : "dark-content"
|
|
458
|
+
);
|
|
459
|
+
if (Platform3.OS === "android") {
|
|
460
|
+
StatusBar.setBackgroundColor(
|
|
461
|
+
colors2.white[1] + (translucent ? "0" : "")
|
|
462
|
+
);
|
|
463
|
+
StatusBar.setTranslucent(true);
|
|
464
|
+
}
|
|
465
|
+
}, [theme])
|
|
466
|
+
);
|
|
467
|
+
React5.useEffect(() => {
|
|
468
|
+
StatusBar.setBarStyle(theme === "dark" ? "light-content" : "dark-content");
|
|
469
|
+
if (Platform3.OS === "android") {
|
|
470
|
+
StatusBar.setBackgroundColor(colors2.white[1] + (translucent ? "0" : ""));
|
|
471
|
+
StatusBar.setTranslucent(true);
|
|
472
|
+
}
|
|
473
|
+
}, [theme]);
|
|
474
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null);
|
|
475
|
+
};
|
|
476
|
+
var AdaptiveStatusBarNext_default = AdaptiveStatusBar;
|
|
477
|
+
|
|
478
|
+
// ../src/Components/AlertX.tsx
|
|
479
|
+
import { MaterialIcons } from "@expo/vector-icons";
|
|
480
|
+
import React6 from "react";
|
|
481
|
+
import { View as View2 } from "react-native";
|
|
482
|
+
import { ScaledSheet as ScaledSheet2 } from "react-native-size-matters";
|
|
483
|
+
var AlertX = ({
|
|
484
|
+
type = "info",
|
|
485
|
+
variant = "contained",
|
|
486
|
+
title,
|
|
487
|
+
gutterBottom = 0,
|
|
488
|
+
body,
|
|
489
|
+
style = {}
|
|
490
|
+
}) => {
|
|
491
|
+
const colors2 = useColors();
|
|
492
|
+
const styles2 = ScaledSheet2.create({
|
|
493
|
+
container: {
|
|
494
|
+
padding: 20,
|
|
495
|
+
paddingTop: 10,
|
|
496
|
+
paddingBottom: 10,
|
|
497
|
+
borderRadius: 8,
|
|
498
|
+
alignItems: "center",
|
|
499
|
+
flexDirection: "row",
|
|
500
|
+
marginBottom: gutterBottom + "@ms",
|
|
501
|
+
backgroundColor: colors2[type].main + (variant === "contained" ? "" : "3")
|
|
502
|
+
},
|
|
503
|
+
title: {
|
|
504
|
+
color: variant === "contained" ? "#fff" : colors2[type].main
|
|
505
|
+
},
|
|
506
|
+
body: {
|
|
507
|
+
color: variant === "contained" ? "#fff" : colors2[type].main
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
return /* @__PURE__ */ React6.createElement(View2, { style: { ...styles2.container, ...style } }, /* @__PURE__ */ React6.createElement(View2, { style: { width: "80%" } }, /* @__PURE__ */ React6.createElement(Typography_default, { style: styles2.title, gutterBottom: 3, fontWeight: 700 }, title), body && /* @__PURE__ */ React6.createElement(Typography_default, { fontWeight: 700, variant: "body2", style: styles2.body }, body)), /* @__PURE__ */ React6.createElement(View2, { style: { marginLeft: "auto" } }, /* @__PURE__ */ React6.createElement(
|
|
511
|
+
MaterialIcons,
|
|
512
|
+
{
|
|
513
|
+
color: variant === "contained" ? "#fff" : colors2[type].main,
|
|
514
|
+
size: 36,
|
|
515
|
+
name: type === "success" ? "check" : type
|
|
516
|
+
}
|
|
517
|
+
)));
|
|
518
|
+
};
|
|
519
|
+
var AlertX_default = AlertX;
|
|
520
|
+
|
|
521
|
+
// ../src/Components/Avatar.tsx
|
|
522
|
+
import { AntDesign } from "@expo/vector-icons";
|
|
523
|
+
import React7 from "react";
|
|
524
|
+
import { Image, View as View3 } from "react-native";
|
|
525
|
+
import { ScaledSheet as ScaledSheet3 } from "react-native-size-matters";
|
|
526
|
+
var Avatar = ({
|
|
527
|
+
color = "dark",
|
|
528
|
+
label,
|
|
529
|
+
variant = "contained",
|
|
530
|
+
source,
|
|
531
|
+
size = 48,
|
|
532
|
+
style = {}
|
|
533
|
+
}) => {
|
|
534
|
+
const colors2 = useColors();
|
|
535
|
+
const styles2 = ScaledSheet3.create({
|
|
536
|
+
root: {
|
|
537
|
+
borderRadius: 150,
|
|
538
|
+
height: size + "@ms",
|
|
539
|
+
width: size + "@ms",
|
|
540
|
+
alignItems: "center",
|
|
541
|
+
justifyContent: "center",
|
|
542
|
+
overflow: "hidden",
|
|
543
|
+
borderWidth: variant === "outlined" ? 5 : 0,
|
|
544
|
+
borderColor: variant === "outlined" ? "#fff" : "#0000",
|
|
545
|
+
backgroundColor: variant === "outlined" ? null : label ? colors2[color].main : colors2.white[4],
|
|
546
|
+
...style
|
|
547
|
+
},
|
|
548
|
+
image: {
|
|
549
|
+
height: "110%",
|
|
550
|
+
width: "110%"
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
return /* @__PURE__ */ React7.createElement(View3, { style: styles2.root }, source ? /* @__PURE__ */ React7.createElement(Image, { resizeMode: "cover", style: styles2.image, source }) : label ? /* @__PURE__ */ React7.createElement(Typography_default, { style: { color: colors2[color].text } }, label[0]) : /* @__PURE__ */ React7.createElement(AntDesign, { name: "user", color: "#fff", size: Math.round(size / 1.5) }));
|
|
554
|
+
};
|
|
555
|
+
var Avatar_default = Avatar;
|
|
556
|
+
|
|
557
|
+
// ../src/Components/Button.tsx
|
|
558
|
+
import { Ionicons, MaterialIcons as MaterialIcons2 } from "@expo/vector-icons";
|
|
559
|
+
import React8, { forwardRef as forwardRef2 } from "react";
|
|
560
|
+
import { ActivityIndicator, Text as Text2, TouchableOpacity as TouchableOpacity2 } from "react-native";
|
|
561
|
+
import { ScaledSheet as ScaledSheet4, moderateScale as moderateScale2 } from "react-native-size-matters";
|
|
562
|
+
var LinkButton = ({
|
|
563
|
+
title,
|
|
564
|
+
style = {},
|
|
565
|
+
color = "blue",
|
|
566
|
+
fontSize = 12,
|
|
567
|
+
fontWeight = "400",
|
|
568
|
+
disabled,
|
|
569
|
+
onPress = () => {
|
|
570
|
+
}
|
|
571
|
+
}) => {
|
|
572
|
+
const colors2 = useColors();
|
|
573
|
+
const styles2 = ScaledSheet4.create({
|
|
574
|
+
text: {
|
|
575
|
+
fontSize: moderateScale2(fontSize),
|
|
576
|
+
fontWeight,
|
|
577
|
+
color: disabled ? "#777" : colors2[color].main
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
return /* @__PURE__ */ React8.createElement(TouchableOpacity2, { onPress, disabled }, /* @__PURE__ */ React8.createElement(Text2, { style: { ...styles2.text, ...style } }, title));
|
|
581
|
+
};
|
|
582
|
+
var IconButton = ({
|
|
583
|
+
style = {},
|
|
584
|
+
color = "dark",
|
|
585
|
+
disabled,
|
|
586
|
+
icon,
|
|
587
|
+
elevation,
|
|
588
|
+
bg = false,
|
|
589
|
+
size = 24,
|
|
590
|
+
containerStyles = {},
|
|
591
|
+
onPress = () => {
|
|
592
|
+
},
|
|
593
|
+
iconType = "material"
|
|
594
|
+
}) => {
|
|
595
|
+
const colors2 = useColors();
|
|
596
|
+
const theme = useTheme();
|
|
597
|
+
const bgColor = theme === "light" ? "#fff" : "#222";
|
|
598
|
+
const styles2 = ScaledSheet4.create({
|
|
599
|
+
container: {
|
|
600
|
+
alignSelf: "flex-start",
|
|
601
|
+
flexGrow: 0,
|
|
602
|
+
backgroundColor: bg ? bgColor : elevation > 0 ? bgColor : null,
|
|
603
|
+
padding: "5@ms",
|
|
604
|
+
shadowColor: "#000",
|
|
605
|
+
shadowOpacity: 0.1,
|
|
606
|
+
shadowOffset: {
|
|
607
|
+
height: 1,
|
|
608
|
+
width: 0
|
|
609
|
+
},
|
|
610
|
+
height: bg ? size + 20 + "@ms" : void 0,
|
|
611
|
+
width: bg ? size + 20 + "@ms" : void 0,
|
|
612
|
+
alignItems: "center",
|
|
613
|
+
justifyContent: "center",
|
|
614
|
+
shadowRadius: elevation,
|
|
615
|
+
elevation,
|
|
616
|
+
borderRadius: size * 5
|
|
617
|
+
},
|
|
618
|
+
text: {
|
|
619
|
+
color: disabled ? "#777" : colors2[color].main
|
|
620
|
+
}
|
|
621
|
+
});
|
|
622
|
+
const IconComp = {
|
|
623
|
+
material: MaterialIcons2,
|
|
624
|
+
ion: Ionicons
|
|
625
|
+
}[iconType];
|
|
626
|
+
return /* @__PURE__ */ React8.createElement(
|
|
627
|
+
TouchableOpacity2,
|
|
628
|
+
{
|
|
629
|
+
onPress,
|
|
630
|
+
activeOpacity: 0.3,
|
|
631
|
+
style: { ...styles2.container, ...containerStyles }
|
|
632
|
+
},
|
|
633
|
+
/* @__PURE__ */ React8.createElement(IconComp, { style: { ...styles2.text, ...style }, name: icon, size })
|
|
634
|
+
);
|
|
635
|
+
};
|
|
636
|
+
var Button = forwardRef2(
|
|
637
|
+
({
|
|
638
|
+
elevation = 0,
|
|
639
|
+
onPress = () => {
|
|
640
|
+
},
|
|
641
|
+
disabled = false,
|
|
642
|
+
title,
|
|
643
|
+
loading,
|
|
644
|
+
size = "normal",
|
|
645
|
+
rounded = false,
|
|
646
|
+
gutterBottom,
|
|
647
|
+
style = {},
|
|
648
|
+
fullWidth = false,
|
|
649
|
+
translucent = false,
|
|
650
|
+
color = "primary",
|
|
651
|
+
variant = "contained",
|
|
652
|
+
start,
|
|
653
|
+
end
|
|
654
|
+
}, ref) => {
|
|
655
|
+
const colors2 = useColors();
|
|
656
|
+
const styles2 = ScaledSheet4.create({
|
|
657
|
+
con: {
|
|
658
|
+
flexDirection: "row",
|
|
659
|
+
alignItems: "center",
|
|
660
|
+
alignSelf: "flex-start",
|
|
661
|
+
justifyContent: "center",
|
|
662
|
+
backgroundColor: variant === "text" || variant === "outlined" ? null : translucent ? translucent === "dark" ? colors2.white[3] + "2" : colors2.black[3] + "2" : loading ? colors2[color].light : disabled ? colors2.white[4] : colors2[color].main,
|
|
663
|
+
borderRadius: rounded ? 30 : 10,
|
|
664
|
+
elevation: variant === "text" ? 0 : elevation,
|
|
665
|
+
paddingVertical: size === "small" ? 8 : size === "large" ? "15@ms" : "13@ms",
|
|
666
|
+
paddingHorizontal: size === "small" ? "10@ms" : "18@ms",
|
|
667
|
+
borderColor: colors2[color].main,
|
|
668
|
+
borderWidth: variant === "outlined" ? 1 : 0,
|
|
669
|
+
shadowColor: "#000",
|
|
670
|
+
shadowRadius: elevation,
|
|
671
|
+
marginBottom: gutterBottom,
|
|
672
|
+
shadowOffset: {
|
|
673
|
+
height: elevation / 2,
|
|
674
|
+
width: 0
|
|
675
|
+
},
|
|
676
|
+
shadowOpacity: variant === "text" ? 0 : 0.3,
|
|
677
|
+
width: fullWidth ? "100%" : null,
|
|
678
|
+
...style
|
|
679
|
+
},
|
|
680
|
+
text: {
|
|
681
|
+
color: disabled ? variant === "text" || variant === "outlined" ? colors2.black[1] : colors2[color].text : colors2[color][variant === "text" || variant === "outlined" ? "main" : "text"],
|
|
682
|
+
fontWeight: variant === "outlined" ? "700" : "500",
|
|
683
|
+
fontSize: size === "small" ? "12@ms" : "16@ms"
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
return /* @__PURE__ */ React8.createElement(
|
|
687
|
+
TouchableOpacity2,
|
|
688
|
+
{
|
|
689
|
+
ref,
|
|
690
|
+
onPress,
|
|
691
|
+
disabled,
|
|
692
|
+
style: styles2.con
|
|
693
|
+
},
|
|
694
|
+
start,
|
|
695
|
+
loading && /* @__PURE__ */ React8.createElement(
|
|
696
|
+
ActivityIndicator,
|
|
697
|
+
{
|
|
698
|
+
size: "small",
|
|
699
|
+
color: colors2[color].text,
|
|
700
|
+
style: { marginRight: 10 }
|
|
701
|
+
}
|
|
702
|
+
),
|
|
703
|
+
/* @__PURE__ */ React8.createElement(Text2, { style: styles2.text }, title),
|
|
704
|
+
end
|
|
705
|
+
);
|
|
706
|
+
}
|
|
707
|
+
);
|
|
708
|
+
var Button_default = Button;
|
|
709
|
+
|
|
710
|
+
// ../src/Components/Checkbox.tsx
|
|
711
|
+
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
|
712
|
+
import React9 from "react";
|
|
713
|
+
import { TouchableOpacity as TouchableOpacity3, View as View4 } from "react-native";
|
|
714
|
+
import { ScaledSheet as ScaledSheet5 } from "react-native-size-matters";
|
|
715
|
+
var CheckBox = ({
|
|
716
|
+
color = "primary",
|
|
717
|
+
checked,
|
|
718
|
+
size = 24,
|
|
719
|
+
label,
|
|
720
|
+
style = {},
|
|
721
|
+
onChange
|
|
722
|
+
}) => {
|
|
723
|
+
const iconName = checked ? "checkbox-marked" : "checkbox-blank-outline";
|
|
724
|
+
const colors2 = useColors();
|
|
725
|
+
const styles2 = ScaledSheet5.create({
|
|
726
|
+
container: {
|
|
727
|
+
alignItems: "center",
|
|
728
|
+
flexDirection: "row",
|
|
729
|
+
...style
|
|
730
|
+
}
|
|
731
|
+
});
|
|
732
|
+
return /* @__PURE__ */ React9.createElement(View4, { style: styles2.container }, /* @__PURE__ */ React9.createElement(TouchableOpacity3, { onPress: onChange }, /* @__PURE__ */ React9.createElement(
|
|
733
|
+
MaterialCommunityIcons,
|
|
734
|
+
{
|
|
735
|
+
name: iconName,
|
|
736
|
+
size,
|
|
737
|
+
color: colors2[color].main
|
|
738
|
+
}
|
|
739
|
+
)), label);
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
// ../src/Components/FormWrapper.tsx
|
|
743
|
+
import React10 from "react";
|
|
744
|
+
import {
|
|
745
|
+
Keyboard,
|
|
746
|
+
KeyboardAvoidingView,
|
|
747
|
+
Platform as Platform4,
|
|
748
|
+
ScrollView,
|
|
749
|
+
TouchableWithoutFeedback
|
|
750
|
+
} from "react-native";
|
|
751
|
+
import { ScaledSheet as ScaledSheet6 } from "react-native-size-matters";
|
|
752
|
+
var FormWrapper = ({
|
|
753
|
+
children,
|
|
754
|
+
behavior = Platform4.OS === "ios" ? "padding" : "height",
|
|
755
|
+
contentContainerStyle,
|
|
756
|
+
mode = "scroll",
|
|
757
|
+
keyboardVerticalOffset = 10,
|
|
758
|
+
style = {},
|
|
759
|
+
onScroll
|
|
760
|
+
}) => {
|
|
761
|
+
const styles2 = ScaledSheet6.create({
|
|
762
|
+
root: {
|
|
763
|
+
width: "100%",
|
|
764
|
+
flex: 1,
|
|
765
|
+
...style
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
return mode === "static" ? /* @__PURE__ */ React10.createElement(TouchableWithoutFeedback, { onPress: Keyboard.dismiss, accessible: false }, /* @__PURE__ */ React10.createElement(
|
|
769
|
+
KeyboardAvoidingView,
|
|
770
|
+
{
|
|
771
|
+
style: styles2.root,
|
|
772
|
+
behavior,
|
|
773
|
+
contentContainerStyle: styles2.root,
|
|
774
|
+
keyboardVerticalOffset
|
|
775
|
+
},
|
|
776
|
+
children
|
|
777
|
+
)) : /* @__PURE__ */ React10.createElement(
|
|
778
|
+
KeyboardAvoidingView,
|
|
779
|
+
{
|
|
780
|
+
behavior,
|
|
781
|
+
style: styles2.root,
|
|
782
|
+
keyboardVerticalOffset
|
|
783
|
+
},
|
|
784
|
+
/* @__PURE__ */ React10.createElement(
|
|
785
|
+
ScrollView,
|
|
786
|
+
{
|
|
787
|
+
onScroll,
|
|
788
|
+
showsVerticalScrollIndicator: false,
|
|
789
|
+
scrollEventThrottle: 40,
|
|
790
|
+
keyboardDismissMode: "interactive",
|
|
791
|
+
contentContainerStyle,
|
|
792
|
+
keyboardShouldPersistTaps: "handled"
|
|
793
|
+
},
|
|
794
|
+
children
|
|
795
|
+
)
|
|
796
|
+
);
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
// ../src/Components/StarRating.tsx
|
|
800
|
+
import { Ionicons as Ionicons2 } from "@expo/vector-icons";
|
|
801
|
+
import * as Haptics from "expo-haptics";
|
|
802
|
+
import { useEffect as useEffect2, useState as useState5 } from "react";
|
|
803
|
+
import {
|
|
804
|
+
ActivityIndicator as ActivityIndicator2,
|
|
805
|
+
TextInput,
|
|
806
|
+
TouchableOpacity as TouchableOpacity4,
|
|
807
|
+
View as View6
|
|
808
|
+
} from "react-native";
|
|
809
|
+
import { ScaledSheet as ScaledSheet8 } from "react-native-size-matters";
|
|
810
|
+
|
|
811
|
+
// ../src/Components/Popup.tsx
|
|
812
|
+
import {
|
|
813
|
+
Keyboard as Keyboard2,
|
|
814
|
+
KeyboardAvoidingView as KeyboardAvoidingView2,
|
|
815
|
+
Modal,
|
|
816
|
+
Platform as Platform5,
|
|
817
|
+
Pressable,
|
|
818
|
+
StyleSheet as StyleSheet2,
|
|
819
|
+
TouchableWithoutFeedback as TouchableWithoutFeedback2,
|
|
820
|
+
View as View5
|
|
821
|
+
} from "react-native";
|
|
822
|
+
import React11, { useState as useState4 } from "react";
|
|
823
|
+
import { ScaledSheet as ScaledSheet7 } from "react-native-size-matters";
|
|
824
|
+
var Popup = ({
|
|
825
|
+
title,
|
|
826
|
+
sheet,
|
|
827
|
+
bare = false,
|
|
828
|
+
keyboardVerticalOffset,
|
|
829
|
+
children,
|
|
830
|
+
open,
|
|
831
|
+
onClose = () => {
|
|
832
|
+
}
|
|
833
|
+
}) => {
|
|
834
|
+
const colors2 = useColors();
|
|
835
|
+
const [show, setShow] = useState4(open);
|
|
836
|
+
const [showSecondary, setShowSecondary] = useState4(false);
|
|
837
|
+
const styles2 = ScaledSheet7.create({
|
|
838
|
+
root: {
|
|
839
|
+
height: "100%",
|
|
840
|
+
width: "100%",
|
|
841
|
+
justifyContent: sheet ? "flex-end" : "center"
|
|
842
|
+
},
|
|
843
|
+
avoidingView: {
|
|
844
|
+
minHeight: typeof sheet === "number" ? sheet : void 0,
|
|
845
|
+
maxHeight: "80%",
|
|
846
|
+
zIndex: 1e3,
|
|
847
|
+
alignSelf: "center",
|
|
848
|
+
maxWidth: sheet ? void 0 : "90%",
|
|
849
|
+
width: sheet ? "100%" : void 0
|
|
850
|
+
},
|
|
851
|
+
container: {
|
|
852
|
+
paddingBottom: sheet ? "30@ms" : 0,
|
|
853
|
+
backgroundColor: colors2.white[2],
|
|
854
|
+
borderTopLeftRadius: 20,
|
|
855
|
+
borderTopRightRadius: 20,
|
|
856
|
+
borderBottomRightRadius: sheet ? 0 : 20,
|
|
857
|
+
borderBottomLeftRadius: sheet ? 0 : 20,
|
|
858
|
+
width: "100%"
|
|
859
|
+
},
|
|
860
|
+
content: {
|
|
861
|
+
paddingHorizontal: bare ? void 0 : "10@ms"
|
|
862
|
+
// flex: 1,
|
|
863
|
+
},
|
|
864
|
+
title: {
|
|
865
|
+
flexDirection: "row",
|
|
866
|
+
alignItems: "center",
|
|
867
|
+
paddingVertical: "5@ms",
|
|
868
|
+
paddingHorizontal: "10@ms",
|
|
869
|
+
marginBottom: "10@ms"
|
|
870
|
+
},
|
|
871
|
+
backdrop: {
|
|
872
|
+
position: "absolute",
|
|
873
|
+
height: "100%",
|
|
874
|
+
zIndex: -1,
|
|
875
|
+
width: "100%",
|
|
876
|
+
backgroundColor: "#000b"
|
|
877
|
+
}
|
|
878
|
+
});
|
|
879
|
+
React11.useEffect(() => {
|
|
880
|
+
setShow(open);
|
|
881
|
+
setTimeout(() => {
|
|
882
|
+
setShowSecondary(open);
|
|
883
|
+
}, 500);
|
|
884
|
+
}, [open]);
|
|
885
|
+
const closeAction = () => {
|
|
886
|
+
setShow(false);
|
|
887
|
+
onClose();
|
|
888
|
+
};
|
|
889
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
|
|
890
|
+
Modal,
|
|
891
|
+
{
|
|
892
|
+
transparent: true,
|
|
893
|
+
animationType: "fade",
|
|
894
|
+
statusBarTranslucent: true,
|
|
895
|
+
visible: show,
|
|
896
|
+
onRequestClose: closeAction
|
|
897
|
+
},
|
|
898
|
+
/* @__PURE__ */ React11.createElement(View5, { style: styles2.backdrop }),
|
|
899
|
+
/* @__PURE__ */ React11.createElement(UIThemeProvider, null, /* @__PURE__ */ React11.createElement(
|
|
900
|
+
Modal,
|
|
901
|
+
{
|
|
902
|
+
transparent: true,
|
|
903
|
+
animationType: "slide",
|
|
904
|
+
statusBarTranslucent: true,
|
|
905
|
+
visible: showSecondary,
|
|
906
|
+
onRequestClose: closeAction
|
|
907
|
+
},
|
|
908
|
+
/* @__PURE__ */ React11.createElement(TouchableWithoutFeedback2, { onPress: Keyboard2.dismiss }, /* @__PURE__ */ React11.createElement(View5, { style: styles2.root }, open && /* @__PURE__ */ React11.createElement(
|
|
909
|
+
Pressable,
|
|
910
|
+
{
|
|
911
|
+
style: StyleSheet2.absoluteFill,
|
|
912
|
+
onPress: closeAction
|
|
913
|
+
}
|
|
914
|
+
), /* @__PURE__ */ React11.createElement(
|
|
915
|
+
KeyboardAvoidingView2,
|
|
916
|
+
{
|
|
917
|
+
style: styles2.avoidingView,
|
|
918
|
+
keyboardVerticalOffset,
|
|
919
|
+
behavior: Platform5.OS === "ios" ? "position" : "padding"
|
|
920
|
+
},
|
|
921
|
+
/* @__PURE__ */ React11.createElement(View5, { style: styles2.container }, !bare && /* @__PURE__ */ React11.createElement(View5, { style: styles2.title }, /* @__PURE__ */ React11.createElement(
|
|
922
|
+
IconButton,
|
|
923
|
+
{
|
|
924
|
+
size: 20,
|
|
925
|
+
icon: "close",
|
|
926
|
+
onPress: closeAction
|
|
927
|
+
}
|
|
928
|
+
), /* @__PURE__ */ React11.createElement(View5, { style: { flex: 1 } }, /* @__PURE__ */ React11.createElement(Typography_default, { color: "textSecondary", align: "center" }, title))), /* @__PURE__ */ React11.createElement(View5, { style: styles2.content }, children))
|
|
929
|
+
)))
|
|
930
|
+
))
|
|
931
|
+
));
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
// ../src/Components/StarRating.tsx
|
|
935
|
+
var RatingStars = ({
|
|
936
|
+
rating = 0,
|
|
937
|
+
size = 16
|
|
938
|
+
}) => {
|
|
939
|
+
const colors2 = useColors();
|
|
940
|
+
const styles2 = ScaledSheet8.create({
|
|
941
|
+
root: {
|
|
942
|
+
flexDirection: "row",
|
|
943
|
+
alignItems: "center"
|
|
944
|
+
}
|
|
945
|
+
});
|
|
946
|
+
return /* @__PURE__ */ React.createElement(View6, { style: styles2.root }, [...Array(Math.floor(rating))].map((_, index) => /* @__PURE__ */ React.createElement(Ionicons2, { key: index, name: "star", size, color: "#FFD700" })), [...Array(5 - Math.floor(rating))].map((_, index) => /* @__PURE__ */ React.createElement(
|
|
947
|
+
Ionicons2,
|
|
948
|
+
{
|
|
949
|
+
key: index,
|
|
950
|
+
name: "star",
|
|
951
|
+
size,
|
|
952
|
+
color: colors2.textSecondary.light
|
|
953
|
+
}
|
|
954
|
+
)));
|
|
955
|
+
};
|
|
956
|
+
var RatingInput = ({
|
|
957
|
+
onSubmit: _onSubmit,
|
|
958
|
+
rating = 0,
|
|
959
|
+
size = 16
|
|
960
|
+
}) => {
|
|
961
|
+
const [showReviewsModal, setShowReviewsModal] = useState5(false);
|
|
962
|
+
const [rate, setRate] = useState5(0);
|
|
963
|
+
const colors2 = useColors();
|
|
964
|
+
const [loading, setLoading] = useState5(false);
|
|
965
|
+
const [review, setReview] = useState5("");
|
|
966
|
+
const styles2 = ScaledSheet8.create({
|
|
967
|
+
root: {
|
|
968
|
+
flexDirection: "row",
|
|
969
|
+
alignItems: "center"
|
|
970
|
+
},
|
|
971
|
+
inputCon: {
|
|
972
|
+
marginBottom: "20@vs",
|
|
973
|
+
backgroundColor: colors2.white[3],
|
|
974
|
+
padding: "15@ms",
|
|
975
|
+
borderRadius: 20
|
|
976
|
+
},
|
|
977
|
+
input: {
|
|
978
|
+
fontSize: "16@ms",
|
|
979
|
+
color: colors2.dark.main,
|
|
980
|
+
height: "100@vs"
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
useEffect2(() => {
|
|
984
|
+
setRate(rating);
|
|
985
|
+
}, [rating]);
|
|
986
|
+
const onRate = (index) => {
|
|
987
|
+
setRate(index + 1);
|
|
988
|
+
Haptics.selectionAsync();
|
|
989
|
+
setTimeout(() => {
|
|
990
|
+
setShowReviewsModal(true);
|
|
991
|
+
}, 500);
|
|
992
|
+
};
|
|
993
|
+
const onSubmit = async () => {
|
|
994
|
+
setLoading(true);
|
|
995
|
+
setShowReviewsModal(false);
|
|
996
|
+
_onSubmit && await _onSubmit({ rating: rate, review });
|
|
997
|
+
setLoading(false);
|
|
998
|
+
};
|
|
999
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(View6, { style: styles2.root }, loading ? /* @__PURE__ */ React.createElement(ActivityIndicator2, null) : [...Array(5)].map((_, index) => /* @__PURE__ */ React.createElement(
|
|
1000
|
+
TouchableOpacity4,
|
|
1001
|
+
{
|
|
1002
|
+
key: index,
|
|
1003
|
+
activeOpacity: 0.9,
|
|
1004
|
+
onPress: () => {
|
|
1005
|
+
onRate(index);
|
|
1006
|
+
}
|
|
1007
|
+
},
|
|
1008
|
+
/* @__PURE__ */ React.createElement(
|
|
1009
|
+
Ionicons2,
|
|
1010
|
+
{
|
|
1011
|
+
style: { marginLeft: 10 },
|
|
1012
|
+
name: index < rate ? "star" : "star-outline",
|
|
1013
|
+
size,
|
|
1014
|
+
color: colors2.primary.light
|
|
1015
|
+
}
|
|
1016
|
+
)
|
|
1017
|
+
))), /* @__PURE__ */ React.createElement(
|
|
1018
|
+
Popup,
|
|
1019
|
+
{
|
|
1020
|
+
sheet: true,
|
|
1021
|
+
open: showReviewsModal,
|
|
1022
|
+
onClose: () => {
|
|
1023
|
+
setShowReviewsModal(false);
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
/* @__PURE__ */ React.createElement(
|
|
1027
|
+
View6,
|
|
1028
|
+
{
|
|
1029
|
+
style: {
|
|
1030
|
+
alignItems: "center",
|
|
1031
|
+
marginBottom: 5
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
/* @__PURE__ */ React.createElement(RatingStars, { rating: rate, size: 24 })
|
|
1035
|
+
),
|
|
1036
|
+
/* @__PURE__ */ React.createElement(
|
|
1037
|
+
Typography_default,
|
|
1038
|
+
{
|
|
1039
|
+
align: "center",
|
|
1040
|
+
fontWeight: 700,
|
|
1041
|
+
variant: "h5",
|
|
1042
|
+
gutterBottom: 20
|
|
1043
|
+
},
|
|
1044
|
+
"Add to your review"
|
|
1045
|
+
),
|
|
1046
|
+
/* @__PURE__ */ React.createElement(View6, { style: styles2.inputCon }, /* @__PURE__ */ React.createElement(
|
|
1047
|
+
TextInput,
|
|
1048
|
+
{
|
|
1049
|
+
style: styles2.input,
|
|
1050
|
+
multiline: true,
|
|
1051
|
+
value: review,
|
|
1052
|
+
onChangeText: (text) => setReview(text),
|
|
1053
|
+
placeholder: "Type review here.."
|
|
1054
|
+
}
|
|
1055
|
+
)),
|
|
1056
|
+
/* @__PURE__ */ React.createElement(
|
|
1057
|
+
Button_default,
|
|
1058
|
+
{
|
|
1059
|
+
gutterBottom: 40,
|
|
1060
|
+
title: "Submit Review",
|
|
1061
|
+
loading,
|
|
1062
|
+
disabled: loading,
|
|
1063
|
+
onPress: () => {
|
|
1064
|
+
onSubmit();
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
)
|
|
1068
|
+
));
|
|
1069
|
+
};
|
|
1070
|
+
|
|
1071
|
+
// ../src/Components/Grid.tsx
|
|
1072
|
+
import { View as View7 } from "react-native";
|
|
1073
|
+
import React12 from "react";
|
|
1074
|
+
import { ScaledSheet as ScaledSheet9 } from "react-native-size-matters";
|
|
1075
|
+
var GridItem = ({
|
|
1076
|
+
children,
|
|
1077
|
+
col = 2,
|
|
1078
|
+
alignItems,
|
|
1079
|
+
spacing = 1,
|
|
1080
|
+
style = {}
|
|
1081
|
+
}) => {
|
|
1082
|
+
const styles2 = ScaledSheet9.create({
|
|
1083
|
+
gridItem: {
|
|
1084
|
+
width: 100 / col + "%",
|
|
1085
|
+
padding: spacing * 10 + "@ms",
|
|
1086
|
+
alignItems
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
return /* @__PURE__ */ React12.createElement(View7, { children, style: [styles2.gridItem, style] });
|
|
1090
|
+
};
|
|
1091
|
+
var Grid = ({
|
|
1092
|
+
children,
|
|
1093
|
+
spacing = 1,
|
|
1094
|
+
style = {}
|
|
1095
|
+
}) => {
|
|
1096
|
+
const styles2 = ScaledSheet9.create({
|
|
1097
|
+
grid: {
|
|
1098
|
+
flexWrap: "wrap",
|
|
1099
|
+
margin: -spacing * 10 + "@ms",
|
|
1100
|
+
flexDirection: "row"
|
|
1101
|
+
}
|
|
1102
|
+
});
|
|
1103
|
+
return /* @__PURE__ */ React12.createElement(View7, { children, style: [styles2.grid, style] });
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
// ../src/Components/Locator.tsx
|
|
1107
|
+
import { Ionicons as Ionicons4 } from "@expo/vector-icons";
|
|
1108
|
+
import React16, { useEffect as useEffect3, useState as useState8 } from "react";
|
|
1109
|
+
import { Alert, TouchableOpacity as TouchableOpacity8, View as View11 } from "react-native";
|
|
1110
|
+
|
|
1111
|
+
// ../src/Components/List.tsx
|
|
1112
|
+
import { MaterialIcons as MaterialIcons3 } from "@expo/vector-icons";
|
|
1113
|
+
import React13 from "react";
|
|
1114
|
+
import { TouchableOpacity as TouchableOpacity5, View as View8 } from "react-native";
|
|
1115
|
+
import { ScaledSheet as ScaledSheet10 } from "react-native-size-matters";
|
|
1116
|
+
var ListItem = ({
|
|
1117
|
+
link = false,
|
|
1118
|
+
divider = false,
|
|
1119
|
+
onPress,
|
|
1120
|
+
index = 1,
|
|
1121
|
+
style = {},
|
|
1122
|
+
children
|
|
1123
|
+
}) => {
|
|
1124
|
+
const colors2 = useColors();
|
|
1125
|
+
const styles2 = ScaledSheet10.create({
|
|
1126
|
+
root: {
|
|
1127
|
+
flexDirection: "row",
|
|
1128
|
+
alignItems: "center",
|
|
1129
|
+
paddingHorizontal: "10@s",
|
|
1130
|
+
borderBottomColor: colors2.white[4],
|
|
1131
|
+
borderBottomWidth: divider ? 1 : 0,
|
|
1132
|
+
paddingVertical: "10@vs"
|
|
1133
|
+
}
|
|
1134
|
+
});
|
|
1135
|
+
return /* @__PURE__ */ React13.createElement(
|
|
1136
|
+
View8,
|
|
1137
|
+
null,
|
|
1138
|
+
/* @__PURE__ */ React13.createElement(TouchableOpacity5, { disabled: Boolean(!onPress), onPress }, /* @__PURE__ */ React13.createElement(View8, { style: { ...styles2.root, ...style } }, children, link && /* @__PURE__ */ React13.createElement(
|
|
1139
|
+
MaterialIcons3,
|
|
1140
|
+
{
|
|
1141
|
+
color: colors2.white[5],
|
|
1142
|
+
style: { marginLeft: "auto" },
|
|
1143
|
+
name: "arrow-forward-ios",
|
|
1144
|
+
size: 15
|
|
1145
|
+
}
|
|
1146
|
+
)))
|
|
1147
|
+
);
|
|
1148
|
+
};
|
|
1149
|
+
|
|
1150
|
+
// ../src/Components/TextField.tsx
|
|
1151
|
+
import { Ionicons as Ionicons3, MaterialIcons as MaterialIcons5 } from "@expo/vector-icons";
|
|
1152
|
+
import React15, { useRef, useState as useState7 } from "react";
|
|
1153
|
+
import { Animated, TextInput as TextInput2, TouchableOpacity as TouchableOpacity7, View as View10 } from "react-native";
|
|
1154
|
+
import {
|
|
1155
|
+
ScaledSheet as ScaledSheet12,
|
|
1156
|
+
moderateScale as moderateScale3,
|
|
1157
|
+
ms,
|
|
1158
|
+
verticalScale as verticalScale2
|
|
1159
|
+
} from "react-native-size-matters";
|
|
1160
|
+
|
|
1161
|
+
// ../src/Components/SelectMenu.tsx
|
|
1162
|
+
import { MaterialIcons as MaterialIcons4 } from "@expo/vector-icons";
|
|
1163
|
+
import React14, { useCallback, useState as useState6 } from "react";
|
|
1164
|
+
import { FlatList, Modal as Modal2, TouchableOpacity as TouchableOpacity6, View as View9 } from "react-native";
|
|
1165
|
+
import { useSafeAreaInsets as useSafeAreaInsets2 } from "react-native-safe-area-context";
|
|
1166
|
+
import { ScaledSheet as ScaledSheet11 } from "react-native-size-matters";
|
|
1167
|
+
var SelectMenu = ({
|
|
1168
|
+
open = false,
|
|
1169
|
+
onClose,
|
|
1170
|
+
value,
|
|
1171
|
+
options = [],
|
|
1172
|
+
onChange,
|
|
1173
|
+
disableAutoClose = false,
|
|
1174
|
+
label,
|
|
1175
|
+
secondary,
|
|
1176
|
+
helperText
|
|
1177
|
+
}) => {
|
|
1178
|
+
const colors2 = useColors();
|
|
1179
|
+
const { bottom } = useSafeAreaInsets2();
|
|
1180
|
+
const [search, setSearch] = useState6("");
|
|
1181
|
+
const styles2 = ScaledSheet11.create({
|
|
1182
|
+
root: {
|
|
1183
|
+
backgroundColor: colors2.white[1],
|
|
1184
|
+
flex: 1
|
|
1185
|
+
},
|
|
1186
|
+
content: {
|
|
1187
|
+
flex: 1,
|
|
1188
|
+
paddingHorizontal: "10@ms"
|
|
1189
|
+
},
|
|
1190
|
+
header: {
|
|
1191
|
+
paddingTop: "80@ms",
|
|
1192
|
+
marginBottom: "20@vs"
|
|
1193
|
+
},
|
|
1194
|
+
option: {
|
|
1195
|
+
paddingHorizontal: "10@s",
|
|
1196
|
+
paddingVertical: "10@vs",
|
|
1197
|
+
borderRadius: 8,
|
|
1198
|
+
flexDirection: "row",
|
|
1199
|
+
alignItems: "center",
|
|
1200
|
+
marginBottom: "10@vs"
|
|
1201
|
+
},
|
|
1202
|
+
footer: {
|
|
1203
|
+
paddingBottom: bottom,
|
|
1204
|
+
paddingHorizontal: "15@ms",
|
|
1205
|
+
paddingTop: "15@ms"
|
|
1206
|
+
}
|
|
1207
|
+
});
|
|
1208
|
+
const renderItem = useCallback(
|
|
1209
|
+
({ item }) => /* @__PURE__ */ React14.createElement(
|
|
1210
|
+
TouchableOpacity6,
|
|
1211
|
+
{
|
|
1212
|
+
style: {
|
|
1213
|
+
...styles2.option,
|
|
1214
|
+
backgroundColor: item.value === value ? colors2.blue.light + "2" : colors2.white[2]
|
|
1215
|
+
},
|
|
1216
|
+
onPress: () => {
|
|
1217
|
+
onChange(item.value);
|
|
1218
|
+
if (!disableAutoClose)
|
|
1219
|
+
onClose();
|
|
1220
|
+
},
|
|
1221
|
+
key: item.label
|
|
1222
|
+
},
|
|
1223
|
+
item.start && /* @__PURE__ */ React14.createElement(View9, { style: { marginRight: 10 } }, item.start),
|
|
1224
|
+
/* @__PURE__ */ React14.createElement(View9, { style: { flex: 1 } }, /* @__PURE__ */ React14.createElement(
|
|
1225
|
+
Typography_default,
|
|
1226
|
+
{
|
|
1227
|
+
style: {
|
|
1228
|
+
color: item.value === value ? colors2.blue.light : colors2.black[2]
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1231
|
+
item.label
|
|
1232
|
+
), item.secondary ? /* @__PURE__ */ React14.createElement(
|
|
1233
|
+
Typography_default,
|
|
1234
|
+
{
|
|
1235
|
+
variant: "body2",
|
|
1236
|
+
style: {
|
|
1237
|
+
marginTop: 2,
|
|
1238
|
+
color: item.value === value ? colors2.blue.light : colors2.white[5]
|
|
1239
|
+
}
|
|
1240
|
+
},
|
|
1241
|
+
item.secondary
|
|
1242
|
+
) : null),
|
|
1243
|
+
value === item.value && /* @__PURE__ */ React14.createElement(
|
|
1244
|
+
MaterialIcons4,
|
|
1245
|
+
{
|
|
1246
|
+
name: "check",
|
|
1247
|
+
color: colors2.blue.light,
|
|
1248
|
+
size: 24,
|
|
1249
|
+
style: { marginLeft: "auto" }
|
|
1250
|
+
}
|
|
1251
|
+
)
|
|
1252
|
+
),
|
|
1253
|
+
[value, colors2]
|
|
1254
|
+
);
|
|
1255
|
+
return /* @__PURE__ */ React14.createElement(Modal2, { visible: open, animationType: "slide", onRequestClose: onClose }, /* @__PURE__ */ React14.createElement(View9, { style: styles2.root }, /* @__PURE__ */ React14.createElement(View9, { style: styles2.content }, /* @__PURE__ */ React14.createElement(View9, { style: styles2.header }, /* @__PURE__ */ React14.createElement(Typography_default, { variant: "h5", gutterBottom: 5, fontWeight: 700 }, label), helperText ? /* @__PURE__ */ React14.createElement(Typography_default, { variant: "body2", color: "textSecondary" }, helperText) : null, /* @__PURE__ */ React14.createElement(
|
|
1256
|
+
TextField_default,
|
|
1257
|
+
{
|
|
1258
|
+
label: "Search",
|
|
1259
|
+
value: search,
|
|
1260
|
+
type: "search",
|
|
1261
|
+
onChangeText: setSearch,
|
|
1262
|
+
variant: "outlined"
|
|
1263
|
+
}
|
|
1264
|
+
)), /* @__PURE__ */ React14.createElement(
|
|
1265
|
+
FlatList,
|
|
1266
|
+
{
|
|
1267
|
+
removeClippedSubviews: true,
|
|
1268
|
+
keyExtractor: (item) => item.value,
|
|
1269
|
+
renderItem,
|
|
1270
|
+
data: options.filter(
|
|
1271
|
+
(item) => search.length > 1 ? item.label.toLowerCase().indexOf(search.toLowerCase()) > -1 : item
|
|
1272
|
+
).sort((a, b) => a.label.localeCompare(b.label))
|
|
1273
|
+
}
|
|
1274
|
+
)), /* @__PURE__ */ React14.createElement(View9, { style: styles2.footer }, /* @__PURE__ */ React14.createElement(
|
|
1275
|
+
Button_default,
|
|
1276
|
+
{
|
|
1277
|
+
color: "error",
|
|
1278
|
+
variant: "outlined",
|
|
1279
|
+
fullWidth: true,
|
|
1280
|
+
title: "Close",
|
|
1281
|
+
onPress: onClose
|
|
1282
|
+
}
|
|
1283
|
+
))));
|
|
1284
|
+
};
|
|
1285
|
+
var SelectMenu_default = SelectMenu;
|
|
1286
|
+
|
|
1287
|
+
// ../src/Components/TextField.tsx
|
|
1288
|
+
var TextField = ({
|
|
1289
|
+
label,
|
|
1290
|
+
keyboardType,
|
|
1291
|
+
variant,
|
|
1292
|
+
color = "primary",
|
|
1293
|
+
value,
|
|
1294
|
+
type,
|
|
1295
|
+
helperText,
|
|
1296
|
+
onChangeText,
|
|
1297
|
+
onSubmitEditing = () => {
|
|
1298
|
+
},
|
|
1299
|
+
onFocus = () => {
|
|
1300
|
+
},
|
|
1301
|
+
onBlur = () => {
|
|
1302
|
+
},
|
|
1303
|
+
error,
|
|
1304
|
+
start,
|
|
1305
|
+
size = "normal",
|
|
1306
|
+
rounded,
|
|
1307
|
+
disabled = false,
|
|
1308
|
+
style = {},
|
|
1309
|
+
inputStyles = {},
|
|
1310
|
+
gutterBottom = 0,
|
|
1311
|
+
end,
|
|
1312
|
+
options,
|
|
1313
|
+
...props
|
|
1314
|
+
}) => {
|
|
1315
|
+
const colors2 = useColors();
|
|
1316
|
+
const [focused, setFocused] = useState7(false);
|
|
1317
|
+
const labelAnim = useRef(new Animated.Value(0)).current;
|
|
1318
|
+
const height = moderateScale3(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1);
|
|
1319
|
+
React15.useEffect(() => {
|
|
1320
|
+
if (focused || value) {
|
|
1321
|
+
Animated.timing(labelAnim, {
|
|
1322
|
+
toValue: verticalScale2(variant === "text" ? 2 : 4),
|
|
1323
|
+
duration: 300,
|
|
1324
|
+
useNativeDriver: false
|
|
1325
|
+
}).start();
|
|
1326
|
+
} else {
|
|
1327
|
+
Animated.timing(labelAnim, {
|
|
1328
|
+
toValue: height / moderateScale3(variant === "text" ? 2.5 : 3.2),
|
|
1329
|
+
duration: 300,
|
|
1330
|
+
useNativeDriver: false
|
|
1331
|
+
}).start();
|
|
1332
|
+
}
|
|
1333
|
+
}, [focused, value]);
|
|
1334
|
+
const styles2 = ScaledSheet12.create({
|
|
1335
|
+
root: {
|
|
1336
|
+
marginBottom: gutterBottom + "@vs",
|
|
1337
|
+
width: "100%",
|
|
1338
|
+
...style
|
|
1339
|
+
},
|
|
1340
|
+
container: {
|
|
1341
|
+
height,
|
|
1342
|
+
overflow: "hidden",
|
|
1343
|
+
backgroundColor: variant === "outlined" || variant === "text" ? "#fff0" : focused ? colors2.white[3] : colors2.white[4],
|
|
1344
|
+
flexDirection: "row",
|
|
1345
|
+
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.textSecondary.main,
|
|
1346
|
+
borderWidth: error ? 1 : variant === "outlined" ? focused ? 2 : 0.5 : 0,
|
|
1347
|
+
borderBottomWidth: variant === "text" ? 0.5 : void 0,
|
|
1348
|
+
width: "100%",
|
|
1349
|
+
borderRadius: variant === "text" ? 0 : rounded ? 30 : 7,
|
|
1350
|
+
alignItems: "center",
|
|
1351
|
+
...inputStyles
|
|
1352
|
+
},
|
|
1353
|
+
input: {
|
|
1354
|
+
fontSize: "14@s",
|
|
1355
|
+
flex: 1,
|
|
1356
|
+
alignSelf: "stretch",
|
|
1357
|
+
paddingLeft: variant === "text" ? 0 : moderateScale3(15),
|
|
1358
|
+
paddingRight: moderateScale3(10),
|
|
1359
|
+
paddingTop: "11@vs",
|
|
1360
|
+
color: colors2.black[1],
|
|
1361
|
+
zIndex: 10
|
|
1362
|
+
// backgroundColor: "#284",
|
|
1363
|
+
},
|
|
1364
|
+
inputText: {
|
|
1365
|
+
fontSize: "14@ms",
|
|
1366
|
+
flex: 1,
|
|
1367
|
+
paddingLeft: variant === "text" ? 0 : moderateScale3(15),
|
|
1368
|
+
paddingTop: "13@ms"
|
|
1369
|
+
},
|
|
1370
|
+
label: {
|
|
1371
|
+
position: "absolute",
|
|
1372
|
+
left: variant === "text" ? 0 : moderateScale3(15),
|
|
1373
|
+
fontSize: focused || value ? "10@s" : "13@s",
|
|
1374
|
+
color: focused ? colors2[color].main : colors2.textSecondary.main
|
|
1375
|
+
},
|
|
1376
|
+
helperText: {
|
|
1377
|
+
paddingHorizontal: "15@s",
|
|
1378
|
+
flex: 1,
|
|
1379
|
+
color: focused ? colors2[color].dark : colors2.textSecondary.main,
|
|
1380
|
+
paddingTop: "4@ms"
|
|
1381
|
+
},
|
|
1382
|
+
error: {
|
|
1383
|
+
paddingLeft: 10,
|
|
1384
|
+
paddingRight: 10,
|
|
1385
|
+
paddingTop: 5,
|
|
1386
|
+
flexDirection: "row",
|
|
1387
|
+
alignItems: "center"
|
|
1388
|
+
},
|
|
1389
|
+
errorText: {
|
|
1390
|
+
fontSize: 12,
|
|
1391
|
+
marginLeft: 10
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
const formProps = type === "email" ? {
|
|
1395
|
+
textContentType: "emailAddress",
|
|
1396
|
+
keyboardType: "email-address",
|
|
1397
|
+
autoCapitalize: "none",
|
|
1398
|
+
autoCompleteType: "email"
|
|
1399
|
+
} : type === "number" ? {
|
|
1400
|
+
keyboardType: "numeric"
|
|
1401
|
+
} : type === "tel" ? {
|
|
1402
|
+
textContentType: "telephoneNumber",
|
|
1403
|
+
keyboardType: "phone-pad"
|
|
1404
|
+
} : type === "search" ? {
|
|
1405
|
+
keyboardType: "web-search",
|
|
1406
|
+
returnKeyType: "search",
|
|
1407
|
+
autoCapitalize: "none"
|
|
1408
|
+
} : type === "password" ? {
|
|
1409
|
+
secureTextEntry: true,
|
|
1410
|
+
autoCompleteType: "password",
|
|
1411
|
+
autoCapitalize: "none",
|
|
1412
|
+
textContentType: "password"
|
|
1413
|
+
} : {};
|
|
1414
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style: styles2.root }, /* @__PURE__ */ React15.createElement(
|
|
1415
|
+
TouchableOpacity7,
|
|
1416
|
+
{
|
|
1417
|
+
onPress: () => setFocused(true),
|
|
1418
|
+
style: styles2.container
|
|
1419
|
+
},
|
|
1420
|
+
/* @__PURE__ */ React15.createElement(Animated.Text, { style: { ...styles2.label, top: labelAnim } }, label),
|
|
1421
|
+
start,
|
|
1422
|
+
options ? /* @__PURE__ */ React15.createElement(
|
|
1423
|
+
View10,
|
|
1424
|
+
{
|
|
1425
|
+
style: { flex: 1, alignItems: "center", flexDirection: "row" }
|
|
1426
|
+
},
|
|
1427
|
+
options.find((cur) => cur.value === value)?.start && /* @__PURE__ */ React15.createElement(
|
|
1428
|
+
View10,
|
|
1429
|
+
{
|
|
1430
|
+
style: {
|
|
1431
|
+
paddingTop: variant !== "outlined" ? ms(13) : 0,
|
|
1432
|
+
paddingRight: 10
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1435
|
+
options.find((cur) => cur.value === value)?.start
|
|
1436
|
+
),
|
|
1437
|
+
/* @__PURE__ */ React15.createElement(Typography_default, { style: styles2.inputText }, options.find((cur) => cur.value === value)?.label)
|
|
1438
|
+
) : /* @__PURE__ */ React15.createElement(
|
|
1439
|
+
TextInput2,
|
|
1440
|
+
{
|
|
1441
|
+
onFocus: () => {
|
|
1442
|
+
onFocus();
|
|
1443
|
+
setFocused(true);
|
|
1444
|
+
},
|
|
1445
|
+
onBlur: () => {
|
|
1446
|
+
onBlur();
|
|
1447
|
+
setFocused(false);
|
|
1448
|
+
},
|
|
1449
|
+
value,
|
|
1450
|
+
onChangeText,
|
|
1451
|
+
keyboardType,
|
|
1452
|
+
editable: !disabled,
|
|
1453
|
+
selectTextOnFocus: !disabled,
|
|
1454
|
+
onSubmitEditing,
|
|
1455
|
+
placeholderTextColor: colors2.textSecondary.main,
|
|
1456
|
+
...formProps,
|
|
1457
|
+
...props,
|
|
1458
|
+
style: styles2.input
|
|
1459
|
+
}
|
|
1460
|
+
),
|
|
1461
|
+
end && /* @__PURE__ */ React15.createElement(View10, { style: { marginRight: 20 } }, end),
|
|
1462
|
+
options && /* @__PURE__ */ React15.createElement(View10, { style: { marginRight: 20 } }, /* @__PURE__ */ React15.createElement(
|
|
1463
|
+
Ionicons3,
|
|
1464
|
+
{
|
|
1465
|
+
name: "chevron-down",
|
|
1466
|
+
color: colors2.textSecondary.main,
|
|
1467
|
+
size: 24
|
|
1468
|
+
}
|
|
1469
|
+
))
|
|
1470
|
+
), helperText && /* @__PURE__ */ React15.createElement(
|
|
1471
|
+
Typography_default,
|
|
1472
|
+
{
|
|
1473
|
+
color: "textSecondary",
|
|
1474
|
+
style: styles2.helperText,
|
|
1475
|
+
variant: "caption"
|
|
1476
|
+
},
|
|
1477
|
+
helperText
|
|
1478
|
+
), error && /* @__PURE__ */ React15.createElement(View10, { style: styles2.error }, /* @__PURE__ */ React15.createElement(MaterialIcons5, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ React15.createElement(Typography_default, { style: styles2.errorText, color: "error" }, error))), options && /* @__PURE__ */ React15.createElement(
|
|
1479
|
+
SelectMenu_default,
|
|
1480
|
+
{
|
|
1481
|
+
options,
|
|
1482
|
+
value,
|
|
1483
|
+
open: focused,
|
|
1484
|
+
onClose: () => setFocused(false),
|
|
1485
|
+
label,
|
|
1486
|
+
helperText,
|
|
1487
|
+
onChange: onChangeText
|
|
1488
|
+
}
|
|
1489
|
+
));
|
|
1490
|
+
};
|
|
1491
|
+
var TextField2 = ({
|
|
1492
|
+
label,
|
|
1493
|
+
keyboardType,
|
|
1494
|
+
color = "primary",
|
|
1495
|
+
value,
|
|
1496
|
+
type,
|
|
1497
|
+
helperText,
|
|
1498
|
+
onChangeText,
|
|
1499
|
+
onSubmitEditing = () => {
|
|
1500
|
+
},
|
|
1501
|
+
onFocus = () => {
|
|
1502
|
+
},
|
|
1503
|
+
onBlur = () => {
|
|
1504
|
+
},
|
|
1505
|
+
error,
|
|
1506
|
+
start,
|
|
1507
|
+
rounded,
|
|
1508
|
+
disabled = false,
|
|
1509
|
+
style = {},
|
|
1510
|
+
inputStyles = {},
|
|
1511
|
+
gutterBottom = 8,
|
|
1512
|
+
placeholder,
|
|
1513
|
+
end,
|
|
1514
|
+
options,
|
|
1515
|
+
...props
|
|
1516
|
+
}) => {
|
|
1517
|
+
const colors2 = useColors();
|
|
1518
|
+
const [focused, _setFocused] = useState7(false);
|
|
1519
|
+
const [showPassword, setShowPassword] = useState7(false);
|
|
1520
|
+
const height = moderateScale3(
|
|
1521
|
+
props.multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1522
|
+
);
|
|
1523
|
+
const setFocused = (value2) => {
|
|
1524
|
+
_setFocused(value2);
|
|
1525
|
+
};
|
|
1526
|
+
const styles2 = ScaledSheet12.create({
|
|
1527
|
+
root: {
|
|
1528
|
+
marginBottom: gutterBottom + "@vs",
|
|
1529
|
+
...style
|
|
1530
|
+
},
|
|
1531
|
+
container: {
|
|
1532
|
+
height,
|
|
1533
|
+
overflow: "hidden",
|
|
1534
|
+
flexDirection: "row",
|
|
1535
|
+
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[5],
|
|
1536
|
+
borderWidth: error ? 1 : focused ? 2 : 1,
|
|
1537
|
+
width: "100%",
|
|
1538
|
+
borderRadius: rounded ? 30 : 10,
|
|
1539
|
+
alignItems: "center",
|
|
1540
|
+
...inputStyles
|
|
1541
|
+
},
|
|
1542
|
+
input: {
|
|
1543
|
+
fontSize: "14@s",
|
|
1544
|
+
flex: 1,
|
|
1545
|
+
alignSelf: "stretch",
|
|
1546
|
+
paddingLeft: moderateScale3(10),
|
|
1547
|
+
paddingRight: moderateScale3(10),
|
|
1548
|
+
color: colors2.dark.light,
|
|
1549
|
+
zIndex: 10
|
|
1550
|
+
// backgroundColor: "#284",
|
|
1551
|
+
},
|
|
1552
|
+
inputText: {
|
|
1553
|
+
fontSize: "14@ms",
|
|
1554
|
+
color: colors2.dark.light,
|
|
1555
|
+
paddingLeft: moderateScale3(10)
|
|
1556
|
+
},
|
|
1557
|
+
placeholder: {
|
|
1558
|
+
fontSize: "14@ms",
|
|
1559
|
+
color: colors2.textSecondary.main,
|
|
1560
|
+
paddingLeft: moderateScale3(10)
|
|
1561
|
+
},
|
|
1562
|
+
label: {},
|
|
1563
|
+
helperText: {
|
|
1564
|
+
paddingHorizontal: "15@s",
|
|
1565
|
+
color: focused ? colors2[color].dark : "#fffa",
|
|
1566
|
+
paddingTop: "4@ms"
|
|
1567
|
+
},
|
|
1568
|
+
error: {
|
|
1569
|
+
paddingLeft: 10,
|
|
1570
|
+
paddingRight: 10,
|
|
1571
|
+
paddingTop: 5,
|
|
1572
|
+
flexDirection: "row",
|
|
1573
|
+
alignItems: "center"
|
|
1574
|
+
},
|
|
1575
|
+
errorText: {
|
|
1576
|
+
fontSize: 12,
|
|
1577
|
+
marginLeft: 10
|
|
1578
|
+
}
|
|
1579
|
+
});
|
|
1580
|
+
const formProps = type === "email" ? {
|
|
1581
|
+
textContentType: "emailAddress",
|
|
1582
|
+
keyboardType: "email-address",
|
|
1583
|
+
autoCapitalize: "none",
|
|
1584
|
+
autoCompleteType: "email"
|
|
1585
|
+
} : type === "number" ? {
|
|
1586
|
+
keyboardType: "numeric"
|
|
1587
|
+
} : type === "tel" ? {
|
|
1588
|
+
textContentType: "telephoneNumber",
|
|
1589
|
+
keyboardType: "phone-pad"
|
|
1590
|
+
} : type === "search" ? {
|
|
1591
|
+
keyboardType: "web-search",
|
|
1592
|
+
returnKeyType: "search",
|
|
1593
|
+
autoCapitalize: "none"
|
|
1594
|
+
} : type === "password" ? {
|
|
1595
|
+
secureTextEntry: !showPassword,
|
|
1596
|
+
autoCompleteType: "password",
|
|
1597
|
+
autoCapitalize: "none",
|
|
1598
|
+
textContentType: "password"
|
|
1599
|
+
} : {};
|
|
1600
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style: styles2.root }, label && /* @__PURE__ */ React15.createElement(Typography_default, { variant: "body1", color: "textSecondary", gutterBottom: 7 }, label), /* @__PURE__ */ React15.createElement(
|
|
1601
|
+
TouchableOpacity7,
|
|
1602
|
+
{
|
|
1603
|
+
onPress: () => setFocused(true),
|
|
1604
|
+
style: styles2.container
|
|
1605
|
+
},
|
|
1606
|
+
start,
|
|
1607
|
+
options ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, value ? /* @__PURE__ */ React15.createElement(Typography_default, { style: styles2.inputText }, options.find((cur) => cur.value === value)?.label) : /* @__PURE__ */ React15.createElement(Typography_default, { style: styles2.placeholder }, placeholder), /* @__PURE__ */ React15.createElement(
|
|
1608
|
+
Ionicons3,
|
|
1609
|
+
{
|
|
1610
|
+
name: "chevron-down",
|
|
1611
|
+
size: 24,
|
|
1612
|
+
style: { marginLeft: "auto", marginRight: 15 },
|
|
1613
|
+
color: colors2.dark.light
|
|
1614
|
+
}
|
|
1615
|
+
)) : /* @__PURE__ */ React15.createElement(
|
|
1616
|
+
TextInput2,
|
|
1617
|
+
{
|
|
1618
|
+
onFocus: () => {
|
|
1619
|
+
onFocus();
|
|
1620
|
+
setFocused(true);
|
|
1621
|
+
},
|
|
1622
|
+
onBlur: () => {
|
|
1623
|
+
onBlur();
|
|
1624
|
+
setFocused(false);
|
|
1625
|
+
},
|
|
1626
|
+
value,
|
|
1627
|
+
onChangeText,
|
|
1628
|
+
key: showPassword ? "show" : "hide",
|
|
1629
|
+
keyboardType,
|
|
1630
|
+
placeholderTextColor: colors2.textSecondary.main,
|
|
1631
|
+
editable: !disabled,
|
|
1632
|
+
placeholder,
|
|
1633
|
+
selectTextOnFocus: !disabled,
|
|
1634
|
+
onSubmitEditing,
|
|
1635
|
+
...formProps,
|
|
1636
|
+
...props,
|
|
1637
|
+
style: styles2.input
|
|
1638
|
+
}
|
|
1639
|
+
),
|
|
1640
|
+
end ? /* @__PURE__ */ React15.createElement(View10, { style: { marginRight: 20 } }, end) : type === "password" && /* @__PURE__ */ React15.createElement(
|
|
1641
|
+
TouchableOpacity7,
|
|
1642
|
+
{
|
|
1643
|
+
style: { marginRight: 20 },
|
|
1644
|
+
onPress: () => setShowPassword(!showPassword)
|
|
1645
|
+
},
|
|
1646
|
+
/* @__PURE__ */ React15.createElement(
|
|
1647
|
+
Ionicons3,
|
|
1648
|
+
{
|
|
1649
|
+
name: showPassword ? "eye-outline" : "eye-off-outline",
|
|
1650
|
+
size: 24,
|
|
1651
|
+
color: colors2.textSecondary.main
|
|
1652
|
+
}
|
|
1653
|
+
)
|
|
1654
|
+
)
|
|
1655
|
+
), helperText && /* @__PURE__ */ React15.createElement(
|
|
1656
|
+
Typography_default,
|
|
1657
|
+
{
|
|
1658
|
+
color: "textSecondary",
|
|
1659
|
+
style: styles2.helperText,
|
|
1660
|
+
variant: "caption"
|
|
1661
|
+
},
|
|
1662
|
+
helperText
|
|
1663
|
+
), error && /* @__PURE__ */ React15.createElement(View10, { style: styles2.error }, /* @__PURE__ */ React15.createElement(MaterialIcons5, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ React15.createElement(Typography_default, { style: styles2.errorText, color: "error" }, error))), options && /* @__PURE__ */ React15.createElement(
|
|
1664
|
+
SelectMenu_default,
|
|
1665
|
+
{
|
|
1666
|
+
options,
|
|
1667
|
+
value,
|
|
1668
|
+
open: focused,
|
|
1669
|
+
onClose: () => setFocused(false),
|
|
1670
|
+
label,
|
|
1671
|
+
helperText,
|
|
1672
|
+
onChange: onChangeText
|
|
1673
|
+
}
|
|
1674
|
+
));
|
|
1675
|
+
};
|
|
1676
|
+
var TextField_default = TextField;
|
|
1677
|
+
|
|
1678
|
+
// ../src/Components/Locator.tsx
|
|
1679
|
+
import * as Location from "expo-location";
|
|
1680
|
+
import { ScaledSheet as ScaledSheet13 } from "react-native-size-matters";
|
|
1681
|
+
setTimeout(() => {
|
|
1682
|
+
const { GOOGLE_MAP_API_KEY } = getApiKey();
|
|
1683
|
+
if (GOOGLE_MAP_API_KEY)
|
|
1684
|
+
Location.setGoogleApiKey(GOOGLE_MAP_API_KEY);
|
|
1685
|
+
}, 500);
|
|
1686
|
+
var getPredictionsFromCoords = async (coords) => {
|
|
1687
|
+
const { GOOGLE_MAP_API_KEY } = getApiKey();
|
|
1688
|
+
if (!GOOGLE_MAP_API_KEY)
|
|
1689
|
+
console.error(
|
|
1690
|
+
"Google map api key needs to be set to use this component \nMake sure to run initialize() with a valid google map api key"
|
|
1691
|
+
);
|
|
1692
|
+
if (!coords)
|
|
1693
|
+
return [];
|
|
1694
|
+
const res = await (await fetch(
|
|
1695
|
+
`https://maps.googleapis.com/maps/api/geocode/json?radius=200&latlng=${coords.latitude},${coords.longitude}&key=${GOOGLE_MAP_API_KEY}`
|
|
1696
|
+
)).json();
|
|
1697
|
+
const p = [];
|
|
1698
|
+
for (let key in res.results) {
|
|
1699
|
+
const { formatted_address: description, place_id } = res.results[key];
|
|
1700
|
+
p.push({
|
|
1701
|
+
description,
|
|
1702
|
+
id: place_id,
|
|
1703
|
+
latLng: { lst: coords.latitude, lng: coords.longitude }
|
|
1704
|
+
});
|
|
1705
|
+
}
|
|
1706
|
+
return p;
|
|
1707
|
+
};
|
|
1708
|
+
var Locator = ({
|
|
1709
|
+
variant = "contained",
|
|
1710
|
+
onLocationSelected,
|
|
1711
|
+
label,
|
|
1712
|
+
error,
|
|
1713
|
+
location = {
|
|
1714
|
+
description: null
|
|
1715
|
+
},
|
|
1716
|
+
renderInput,
|
|
1717
|
+
gutterBottom = 0,
|
|
1718
|
+
helperText,
|
|
1719
|
+
float = true,
|
|
1720
|
+
country = "ng"
|
|
1721
|
+
}) => {
|
|
1722
|
+
const { GOOGLE_MAP_API_KEY } = getApiKey();
|
|
1723
|
+
const [changed, setChanged] = useState8(false);
|
|
1724
|
+
const [value, setValue] = useState8("");
|
|
1725
|
+
const [prediction, setPrediction] = useState8([]);
|
|
1726
|
+
const colors2 = useColors();
|
|
1727
|
+
const styles2 = ScaledSheet13.create({
|
|
1728
|
+
list: {
|
|
1729
|
+
backgroundColor: colors2.white[2],
|
|
1730
|
+
elevation: 10,
|
|
1731
|
+
shadowColor: "#000",
|
|
1732
|
+
shadowOpacity: 0.1,
|
|
1733
|
+
shadowRadius: float ? 15 : 0,
|
|
1734
|
+
shadowOffset: {
|
|
1735
|
+
height: 10
|
|
1736
|
+
},
|
|
1737
|
+
borderRadius: 10,
|
|
1738
|
+
marginBottom: 10,
|
|
1739
|
+
width: "100%",
|
|
1740
|
+
zIndex: 20,
|
|
1741
|
+
marginTop: float ? 2 : "15@ms",
|
|
1742
|
+
top: float ? "100%" : void 0,
|
|
1743
|
+
position: float ? "absolute" : "relative"
|
|
1744
|
+
}
|
|
1745
|
+
});
|
|
1746
|
+
const search = async (query) => {
|
|
1747
|
+
const endpoint = `https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${query}&components=country:${country}&radius=20000&key=${GOOGLE_MAP_API_KEY}`;
|
|
1748
|
+
const res = await (await fetch(endpoint)).json();
|
|
1749
|
+
const p = [];
|
|
1750
|
+
for (let key in res.predictions) {
|
|
1751
|
+
const { description, place_id } = res.predictions[key];
|
|
1752
|
+
p.push({
|
|
1753
|
+
description,
|
|
1754
|
+
id: place_id
|
|
1755
|
+
});
|
|
1756
|
+
}
|
|
1757
|
+
setPrediction(p);
|
|
1758
|
+
};
|
|
1759
|
+
const locateMe = () => {
|
|
1760
|
+
const getLoc = async () => {
|
|
1761
|
+
const { status } = await Location.requestForegroundPermissionsAsync();
|
|
1762
|
+
if (status !== "granted")
|
|
1763
|
+
return Alert.alert(
|
|
1764
|
+
"Error",
|
|
1765
|
+
"Permission to access location was denied! "
|
|
1766
|
+
);
|
|
1767
|
+
try {
|
|
1768
|
+
let { coords } = await Location.getCurrentPositionAsync({
|
|
1769
|
+
accuracy: Location.LocationAccuracy.High
|
|
1770
|
+
});
|
|
1771
|
+
const p = await getPredictionsFromCoords(coords);
|
|
1772
|
+
setPrediction(p);
|
|
1773
|
+
} catch (err) {
|
|
1774
|
+
console.log(err);
|
|
1775
|
+
Alert.alert(
|
|
1776
|
+
"Can't access your location",
|
|
1777
|
+
"Make sure your location settings are turned on and you are connected to the internet. "
|
|
1778
|
+
);
|
|
1779
|
+
}
|
|
1780
|
+
};
|
|
1781
|
+
getLoc();
|
|
1782
|
+
};
|
|
1783
|
+
const clear = () => {
|
|
1784
|
+
setPrediction([]);
|
|
1785
|
+
setValue("");
|
|
1786
|
+
onLocationSelected(null);
|
|
1787
|
+
setChanged(false);
|
|
1788
|
+
};
|
|
1789
|
+
const locationPressed = async (loc) => {
|
|
1790
|
+
setValue(loc.description);
|
|
1791
|
+
const res = await (await fetch(
|
|
1792
|
+
`https://maps.googleapis.com/maps/api/place/details/json?place_id=${loc.id}&fields=formatted_address%2Cgeometry&key=${GOOGLE_MAP_API_KEY}`
|
|
1793
|
+
)).json();
|
|
1794
|
+
onLocationSelected(
|
|
1795
|
+
{
|
|
1796
|
+
latitude: res.result?.geometry.location.lat,
|
|
1797
|
+
longitude: res.result?.geometry.location.lng,
|
|
1798
|
+
description: loc.description
|
|
1799
|
+
},
|
|
1800
|
+
res.result?.formatted_address
|
|
1801
|
+
);
|
|
1802
|
+
setChanged(false);
|
|
1803
|
+
setPrediction([]);
|
|
1804
|
+
};
|
|
1805
|
+
useEffect3(() => {
|
|
1806
|
+
if (!GOOGLE_MAP_API_KEY)
|
|
1807
|
+
console.error(
|
|
1808
|
+
"Google map api key needs to be set to use this component \nMake sure to run initialize() with a valid google map api key"
|
|
1809
|
+
);
|
|
1810
|
+
}, [GOOGLE_MAP_API_KEY]);
|
|
1811
|
+
return /* @__PURE__ */ React16.createElement(View11, { style: { zIndex: 10 } }, renderInput ? renderInput({
|
|
1812
|
+
onFocus: () => search(value),
|
|
1813
|
+
onBlur: () => setPrediction([]),
|
|
1814
|
+
value: changed ? value : location?.description || value,
|
|
1815
|
+
onChangeText: (val) => {
|
|
1816
|
+
setChanged(true);
|
|
1817
|
+
setValue(val);
|
|
1818
|
+
search(val);
|
|
1819
|
+
},
|
|
1820
|
+
clear,
|
|
1821
|
+
locateMe
|
|
1822
|
+
}) : /* @__PURE__ */ React16.createElement(
|
|
1823
|
+
TextField_default,
|
|
1824
|
+
{
|
|
1825
|
+
label,
|
|
1826
|
+
onChangeText: (val) => {
|
|
1827
|
+
setChanged(true);
|
|
1828
|
+
setValue(val);
|
|
1829
|
+
search(val);
|
|
1830
|
+
},
|
|
1831
|
+
onBlur: () => {
|
|
1832
|
+
setPrediction([]);
|
|
1833
|
+
},
|
|
1834
|
+
onFocus: () => {
|
|
1835
|
+
search(value);
|
|
1836
|
+
},
|
|
1837
|
+
value: changed ? value : location?.description || value,
|
|
1838
|
+
gutterBottom,
|
|
1839
|
+
error,
|
|
1840
|
+
helperText,
|
|
1841
|
+
variant,
|
|
1842
|
+
end: /* @__PURE__ */ React16.createElement(View11, { style: { flexDirection: "row" } }, /* @__PURE__ */ React16.createElement(TouchableOpacity8, { onPress: locateMe, style: { marginRight: 10 } }, /* @__PURE__ */ React16.createElement(
|
|
1843
|
+
Ionicons4,
|
|
1844
|
+
{
|
|
1845
|
+
color: colors2.primary.main,
|
|
1846
|
+
size: 18,
|
|
1847
|
+
name: "location"
|
|
1848
|
+
}
|
|
1849
|
+
)), /* @__PURE__ */ React16.createElement(TouchableOpacity8, { onPress: clear }, /* @__PURE__ */ React16.createElement(Ionicons4, { color: colors2.dark.main, size: 18, name: "close" })))
|
|
1850
|
+
}
|
|
1851
|
+
), prediction.length > 0 && /* @__PURE__ */ React16.createElement(View11, { style: styles2.list }, prediction.map(
|
|
1852
|
+
(cur, i) => i < 5 && /* @__PURE__ */ React16.createElement(
|
|
1853
|
+
ListItem,
|
|
1854
|
+
{
|
|
1855
|
+
divider: i < prediction.length - 1,
|
|
1856
|
+
key: cur.id,
|
|
1857
|
+
link: true,
|
|
1858
|
+
onPress: () => locationPressed(cur)
|
|
1859
|
+
},
|
|
1860
|
+
/* @__PURE__ */ React16.createElement(
|
|
1861
|
+
Ionicons4,
|
|
1862
|
+
{
|
|
1863
|
+
name: "location-outline",
|
|
1864
|
+
style: { marginRight: 10 },
|
|
1865
|
+
size: 16,
|
|
1866
|
+
color: colors2.textSecondary.main
|
|
1867
|
+
}
|
|
1868
|
+
),
|
|
1869
|
+
/* @__PURE__ */ React16.createElement(Typography_default, { style: { flex: 1 } }, cur.description)
|
|
1870
|
+
)
|
|
1871
|
+
)));
|
|
1872
|
+
};
|
|
1873
|
+
|
|
1874
|
+
// ../src/Components/SafeAreaView.tsx
|
|
1875
|
+
import { SafeAreaView as Safe } from "react-native";
|
|
1876
|
+
import React17 from "react";
|
|
1877
|
+
import { Platform as Platform6, StyleSheet as StyleSheet3 } from "react-native";
|
|
1878
|
+
import { moderateScale as moderateScale4 } from "react-native-size-matters";
|
|
1879
|
+
var styles = StyleSheet3.create({
|
|
1880
|
+
droidSafeArea: {
|
|
1881
|
+
flex: 1,
|
|
1882
|
+
paddingTop: Platform6.OS === "android" ? moderateScale4(35) : 0
|
|
1883
|
+
}
|
|
1884
|
+
});
|
|
1885
|
+
var SafeAreaView = ({
|
|
1886
|
+
children,
|
|
1887
|
+
style
|
|
1888
|
+
}) => {
|
|
1889
|
+
return /* @__PURE__ */ React17.createElement(Safe, { style: { ...styles.droidSafeArea, ...style } }, children);
|
|
1890
|
+
};
|
|
1891
|
+
|
|
1892
|
+
// ../src/Components/Divider.tsx
|
|
1893
|
+
import { View as View12 } from "react-native";
|
|
1894
|
+
import { ScaledSheet as ScaledSheet14, ms as ms2 } from "react-native-size-matters";
|
|
1895
|
+
var Divider = ({
|
|
1896
|
+
height = 1,
|
|
1897
|
+
color = "textSecondary",
|
|
1898
|
+
gutterBottom = 0,
|
|
1899
|
+
style
|
|
1900
|
+
}) => {
|
|
1901
|
+
const colors2 = useColors();
|
|
1902
|
+
const styles2 = ScaledSheet14.create({
|
|
1903
|
+
root: {
|
|
1904
|
+
height,
|
|
1905
|
+
backgroundColor: colors2[color].main,
|
|
1906
|
+
marginBottom: ms2(gutterBottom),
|
|
1907
|
+
...style
|
|
1908
|
+
}
|
|
1909
|
+
});
|
|
1910
|
+
return /* @__PURE__ */ React.createElement(View12, { style: styles2.root });
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
// ../src/Components/Spinner.tsx
|
|
1914
|
+
import React18 from "react";
|
|
1915
|
+
import { ActivityIndicator as ActivityIndicator3, Dimensions as Dimensions2, View as View13 } from "react-native";
|
|
1916
|
+
import { ScaledSheet as ScaledSheet15 } from "react-native-size-matters";
|
|
1917
|
+
var Spinner = ({
|
|
1918
|
+
label,
|
|
1919
|
+
size = "large",
|
|
1920
|
+
color = "primary",
|
|
1921
|
+
fullscreen = false,
|
|
1922
|
+
style = {}
|
|
1923
|
+
}) => {
|
|
1924
|
+
const colors2 = useColors();
|
|
1925
|
+
const styles2 = ScaledSheet15.create({
|
|
1926
|
+
root: {
|
|
1927
|
+
width: fullscreen ? Dimensions2.get("screen").width : "100%",
|
|
1928
|
+
height: fullscreen ? Dimensions2.get("screen").height : "100%",
|
|
1929
|
+
left: 0,
|
|
1930
|
+
bottom: 0,
|
|
1931
|
+
zIndex: 100,
|
|
1932
|
+
alignItems: "center",
|
|
1933
|
+
justifyContent: "center",
|
|
1934
|
+
position: fullscreen ? "absolute" : "relative",
|
|
1935
|
+
backgroundColor: fullscreen ? colors2.white[1] + "d" : void 0,
|
|
1936
|
+
...style
|
|
1937
|
+
},
|
|
1938
|
+
content: {
|
|
1939
|
+
flexDirection: "row",
|
|
1940
|
+
alignItems: "center",
|
|
1941
|
+
paddingVertical: "15@vs",
|
|
1942
|
+
paddingHorizontal: "20@s",
|
|
1943
|
+
borderRadius: 10
|
|
1944
|
+
// backgroundColor: fullscreen ? colors.light.main : null,
|
|
1945
|
+
},
|
|
1946
|
+
label: {
|
|
1947
|
+
marginLeft: "10@s",
|
|
1948
|
+
color: color === "light" ? colors2.white[2] : colors2.black[4]
|
|
1949
|
+
}
|
|
1950
|
+
});
|
|
1951
|
+
return /* @__PURE__ */ React18.createElement(View13, { style: styles2.root }, /* @__PURE__ */ React18.createElement(View13, { style: styles2.content }, /* @__PURE__ */ React18.createElement(ActivityIndicator3, { color: colors2[color].dark, size }), label && /* @__PURE__ */ React18.createElement(Typography_default, { style: styles2.label }, label)));
|
|
1952
|
+
};
|
|
1953
|
+
var Spinner_default = Spinner;
|
|
1954
|
+
|
|
1955
|
+
// ../src/Components/OTPInput.tsx
|
|
1956
|
+
import React19, { useMemo } from "react";
|
|
1957
|
+
import { TextInput as TextInput3, View as View14 } from "react-native";
|
|
1958
|
+
import { ScaledSheet as ScaledSheet16, ms as ms3 } from "react-native-size-matters";
|
|
1959
|
+
var OTPInput = ({
|
|
1960
|
+
length = 6,
|
|
1961
|
+
onChange = () => {
|
|
1962
|
+
},
|
|
1963
|
+
value = "",
|
|
1964
|
+
variant = "outlined",
|
|
1965
|
+
spacing = 1,
|
|
1966
|
+
size = 45
|
|
1967
|
+
}) => {
|
|
1968
|
+
const inputRefs = useMemo(
|
|
1969
|
+
() => Array(length).fill(0).map((_) => React19.createRef()),
|
|
1970
|
+
[length]
|
|
1971
|
+
);
|
|
1972
|
+
const colors2 = useColors();
|
|
1973
|
+
const styles2 = ScaledSheet16.create({
|
|
1974
|
+
root: {},
|
|
1975
|
+
container: { flexDirection: "row" },
|
|
1976
|
+
input: {
|
|
1977
|
+
height: ms3(size),
|
|
1978
|
+
width: ms3(size),
|
|
1979
|
+
borderColor: colors2.white[5],
|
|
1980
|
+
backgroundColor: variant === "contained" ? colors2.white[3] : void 0,
|
|
1981
|
+
borderWidth: variant === "outlined" ? 1 : 0,
|
|
1982
|
+
borderBottomWidth: variant === "contained" ? 0 : 1,
|
|
1983
|
+
marginHorizontal: ms3(spacing * 5),
|
|
1984
|
+
textAlign: "center",
|
|
1985
|
+
borderRadius: variant === "text" ? 0 : 10,
|
|
1986
|
+
color: colors2.dark.main,
|
|
1987
|
+
fontSize: ms3(size * 0.5)
|
|
1988
|
+
}
|
|
1989
|
+
});
|
|
1990
|
+
return /* @__PURE__ */ React19.createElement(View14, { style: styles2.root }, /* @__PURE__ */ React19.createElement(View14, { style: styles2.container }, [...Array(length)].map((_, index) => /* @__PURE__ */ React19.createElement(
|
|
1991
|
+
TextInput3,
|
|
1992
|
+
{
|
|
1993
|
+
ref: inputRefs[index],
|
|
1994
|
+
onChangeText: (val) => {
|
|
1995
|
+
if (val.length === 1) {
|
|
1996
|
+
if (index !== length - 1)
|
|
1997
|
+
inputRefs[index + 1].current?.focus();
|
|
1998
|
+
let text = value;
|
|
1999
|
+
text = text.slice(0, index) + val + text.slice(index + 1);
|
|
2000
|
+
onChange(text);
|
|
2001
|
+
} else if (val.length === 0) {
|
|
2002
|
+
if (index !== 0) {
|
|
2003
|
+
inputRefs[index - 1].current?.focus();
|
|
2004
|
+
let text = value;
|
|
2005
|
+
text = text.slice(0, index);
|
|
2006
|
+
onChange(text);
|
|
2007
|
+
} else
|
|
2008
|
+
onChange("");
|
|
2009
|
+
} else {
|
|
2010
|
+
let text = val.replace(/\D/g, "").slice(0, length);
|
|
2011
|
+
onChange(text);
|
|
2012
|
+
inputRefs[text.length < length - 1 ? text.length : length - 1]?.current?.focus();
|
|
2013
|
+
}
|
|
2014
|
+
},
|
|
2015
|
+
value: value[index] || "",
|
|
2016
|
+
blurOnSubmit: false,
|
|
2017
|
+
keyboardType: "number-pad",
|
|
2018
|
+
key: index,
|
|
2019
|
+
style: [styles2.input]
|
|
2020
|
+
}
|
|
2021
|
+
))));
|
|
2022
|
+
};
|
|
2023
|
+
|
|
2024
|
+
// index.ts
|
|
2025
|
+
var HoddyUI = {
|
|
2026
|
+
initialize
|
|
2027
|
+
};
|
|
2028
|
+
var next_default = HoddyUI;
|
|
2029
|
+
export {
|
|
2030
|
+
AdaptiveStatusBarNext_default as AdaptiveStatusBar,
|
|
2031
|
+
AlertX_default as AlertX,
|
|
2032
|
+
Avatar_default as Avatar,
|
|
2033
|
+
Button_default as Button,
|
|
2034
|
+
CheckBox,
|
|
2035
|
+
Divider,
|
|
2036
|
+
FormWrapper,
|
|
2037
|
+
Grid,
|
|
2038
|
+
GridItem,
|
|
2039
|
+
IconButton,
|
|
2040
|
+
LinkButton,
|
|
2041
|
+
Locator,
|
|
2042
|
+
OTPInput,
|
|
2043
|
+
Popup,
|
|
2044
|
+
RatingInput,
|
|
2045
|
+
RatingStars,
|
|
2046
|
+
SafeAreaView,
|
|
2047
|
+
SelectMenu_default as SelectMenu,
|
|
2048
|
+
Spinner_default as Spinner,
|
|
2049
|
+
TextField_default as TextField,
|
|
2050
|
+
TextField2,
|
|
2051
|
+
Typography_default as Typography,
|
|
2052
|
+
UIThemeContext,
|
|
2053
|
+
UIThemeProvider,
|
|
2054
|
+
next_default as default,
|
|
2055
|
+
getPredictionsFromCoords,
|
|
2056
|
+
showFlashMessage,
|
|
2057
|
+
useColors,
|
|
2058
|
+
useNavScreenOptions,
|
|
2059
|
+
useTheme
|
|
2060
|
+
};
|
|
2061
|
+
//# sourceMappingURL=index.mjs.map
|