@hoddy-ui/core 1.0.88 → 1.0.90

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