@hoddy-ui/next 1.0.2

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