@hoddy-ui/next 2.0.11 → 2.0.13

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