@hoddy-ui/core 1.1.4 → 2.0.35
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/README.md +155 -28
- package/next/dist/index.d.mts +113 -41
- package/next/dist/index.d.ts +113 -41
- package/next/dist/index.js +444 -297
- package/next/dist/index.js.map +1 -1
- package/next/dist/index.mjs +460 -307
- package/next/dist/index.mjs.map +1 -1
- package/next/package.json +7 -6
- package/package.json +7 -5
- package/src/Components/AlertX.tsx +4 -4
- package/src/Components/Animators/Animator.tsx +1 -1
- package/src/Components/Animators/hooks/useAppState.ts +4 -11
- package/src/Components/Animators/hooks/useBlinkAnimation.ts +31 -24
- package/src/Components/Animators/hooks/useFadeAnimation.ts +28 -26
- package/src/Components/Animators/hooks/useFloatAnimation.ts +67 -57
- package/src/Components/Animators/hooks/useGrowAnimation.ts +41 -28
- package/src/Components/Animators/hooks/useRollAnimation.ts +77 -57
- package/src/Components/Animators/hooks/useSlideAnimation.ts +44 -35
- package/src/Components/Animators/hooks/useThrownUpAnimation.ts +43 -50
- package/src/Components/Avatar.tsx +13 -7
- package/src/Components/Button.tsx +13 -12
- package/src/Components/FlashMessage.tsx +119 -42
- package/src/Components/FormWrapper.tsx +7 -2
- package/src/Components/Grid.tsx +5 -5
- package/src/Components/Locator.tsx +10 -2
- package/src/Components/OTPInput.tsx +0 -4
- package/src/Components/Popup.tsx +161 -83
- package/src/Components/SafeAreaView.tsx +11 -11
- package/src/Components/SelectMenu.tsx +34 -52
- package/src/Components/TextField.tsx +16 -6
- package/src/Components/Typography.tsx +19 -16
- package/src/config/KeyManager.ts +6 -1
- package/src/config/index.ts +37 -2
- package/src/hooks.ts +21 -14
- package/src/theme/index.tsx +14 -6
- package/src/types.ts +12 -3
- package/src/utility.ts +11 -0
- package/src/Components/Animators/README.md +0 -137
package/next/dist/index.mjs
CHANGED
|
@@ -161,7 +161,7 @@ function initialize(config2) {
|
|
|
161
161
|
try {
|
|
162
162
|
setConfig({
|
|
163
163
|
GOOGLE_MAP_API_KEY: config2.googleMapApiKey,
|
|
164
|
-
|
|
164
|
+
TYPOGRAPHY: config2.typography,
|
|
165
165
|
EDGE_TO_EDGE: config2.edgeToEdge ?? false
|
|
166
166
|
});
|
|
167
167
|
if (config2.colors)
|
|
@@ -178,8 +178,7 @@ import { Platform as Platform3, StatusBar } from "react-native";
|
|
|
178
178
|
|
|
179
179
|
// ../src/hooks.ts
|
|
180
180
|
import { useContext } from "react";
|
|
181
|
-
import {
|
|
182
|
-
import { vs } from "react-native-size-matters";
|
|
181
|
+
import { Platform as Platform2, useColorScheme as useColorScheme2 } from "react-native";
|
|
183
182
|
|
|
184
183
|
// ../src/theme/index.tsx
|
|
185
184
|
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
@@ -190,25 +189,34 @@ import { Platform, useColorScheme } from "react-native";
|
|
|
190
189
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
191
190
|
|
|
192
191
|
// ../src/Components/FlashMessage.tsx
|
|
193
|
-
import React3, { useEffect, useState } from "react";
|
|
194
|
-
import {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
192
|
+
import React3, { useEffect, useRef, useState } from "react";
|
|
193
|
+
import { TouchableOpacity, View } from "react-native";
|
|
194
|
+
import Animated, {
|
|
195
|
+
runOnJS,
|
|
196
|
+
useAnimatedStyle,
|
|
197
|
+
useSharedValue,
|
|
198
|
+
withTiming
|
|
199
|
+
} from "react-native-reanimated";
|
|
199
200
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
200
201
|
import { ScaledSheet } from "react-native-size-matters";
|
|
201
202
|
|
|
202
203
|
// ../src/Components/Typography.tsx
|
|
203
204
|
import React2, { forwardRef } from "react";
|
|
204
205
|
import { StyleSheet, Text } from "react-native";
|
|
205
|
-
import {
|
|
206
|
+
import { ms } from "react-native-size-matters";
|
|
207
|
+
|
|
208
|
+
// ../src/utility.ts
|
|
209
|
+
var getFontFamily = (fontWeight) => {
|
|
210
|
+
return getConfig().TYPOGRAPHY?.fontWeights?.[fontWeight] || getConfig().TYPOGRAPHY?.fontFamily || void 0;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// ../src/Components/Typography.tsx
|
|
206
214
|
var Typography = forwardRef(
|
|
207
215
|
({
|
|
208
216
|
children,
|
|
209
217
|
color = "dark",
|
|
210
218
|
style = {},
|
|
211
|
-
textCase
|
|
219
|
+
textCase,
|
|
212
220
|
variant = "body1",
|
|
213
221
|
align = "left",
|
|
214
222
|
gutterBottom = 0,
|
|
@@ -216,31 +224,33 @@ var Typography = forwardRef(
|
|
|
216
224
|
fontWeight = 400,
|
|
217
225
|
fontFamily,
|
|
218
226
|
// NEW PROP ADDED
|
|
227
|
+
fontSize,
|
|
219
228
|
...props
|
|
220
229
|
}, ref) => {
|
|
221
230
|
const colors2 = useColors();
|
|
222
|
-
const
|
|
223
|
-
h1:
|
|
224
|
-
h2:
|
|
225
|
-
h3:
|
|
226
|
-
h4:
|
|
227
|
-
h5:
|
|
228
|
-
h6:
|
|
229
|
-
body1:
|
|
230
|
-
body2:
|
|
231
|
-
caption:
|
|
231
|
+
const _fontSize = {
|
|
232
|
+
h1: ms(42),
|
|
233
|
+
h2: ms(37),
|
|
234
|
+
h3: ms(32),
|
|
235
|
+
h4: ms(27),
|
|
236
|
+
h5: ms(22),
|
|
237
|
+
h6: ms(17),
|
|
238
|
+
body1: ms(15),
|
|
239
|
+
body2: ms(12),
|
|
240
|
+
caption: ms(10)
|
|
232
241
|
};
|
|
233
|
-
const
|
|
242
|
+
const f = fontSize || _fontSize[variant];
|
|
243
|
+
const styles = StyleSheet.create({
|
|
234
244
|
text: {
|
|
235
|
-
|
|
236
|
-
|
|
245
|
+
lineHeight: f * 1.2,
|
|
246
|
+
fontSize: f,
|
|
247
|
+
marginBottom: ms(gutterBottom) || 0,
|
|
237
248
|
color: colors2[color]?.main || color,
|
|
238
249
|
textTransform: textCase,
|
|
239
250
|
alignItems: "center",
|
|
240
251
|
textAlign: align,
|
|
241
252
|
fontWeight,
|
|
242
|
-
fontFamily: fontFamily ||
|
|
243
|
-
// Use custom font if provided, else default
|
|
253
|
+
fontFamily: fontFamily || getFontFamily(fontWeight)
|
|
244
254
|
}
|
|
245
255
|
});
|
|
246
256
|
return /* @__PURE__ */ React2.createElement(
|
|
@@ -248,7 +258,7 @@ var Typography = forwardRef(
|
|
|
248
258
|
{
|
|
249
259
|
ref,
|
|
250
260
|
adjustsFontSizeToFit,
|
|
251
|
-
style: [
|
|
261
|
+
style: [styles.text, style],
|
|
252
262
|
...props
|
|
253
263
|
},
|
|
254
264
|
children
|
|
@@ -258,33 +268,76 @@ var Typography = forwardRef(
|
|
|
258
268
|
var Typography_default = Typography;
|
|
259
269
|
|
|
260
270
|
// ../src/Components/FlashMessage.tsx
|
|
261
|
-
var
|
|
271
|
+
var flashListeners = /* @__PURE__ */ new Set();
|
|
272
|
+
var showFlashMessage = (msg) => {
|
|
273
|
+
flashListeners.forEach((listener) => listener(msg));
|
|
274
|
+
};
|
|
275
|
+
var subscribeToFlashMessages = (listener) => {
|
|
276
|
+
flashListeners.add(listener);
|
|
277
|
+
return () => {
|
|
278
|
+
flashListeners.delete(listener);
|
|
279
|
+
};
|
|
262
280
|
};
|
|
263
281
|
var FlashMessage = () => {
|
|
264
282
|
const { top } = useSafeAreaInsets();
|
|
265
283
|
const [message, setMessage] = useState(null);
|
|
266
|
-
const [show, setShow] = useState(false);
|
|
267
284
|
const colors2 = useColors();
|
|
268
285
|
const type = message?.type || "success";
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
286
|
+
const timeoutRef = useRef(null);
|
|
287
|
+
const translateY = useSharedValue(-200);
|
|
288
|
+
const opacity = useSharedValue(0);
|
|
289
|
+
const hideMessage = () => {
|
|
290
|
+
setMessage(null);
|
|
291
|
+
};
|
|
292
|
+
const closeMessage = () => {
|
|
293
|
+
if (timeoutRef.current) {
|
|
294
|
+
clearTimeout(timeoutRef.current);
|
|
295
|
+
timeoutRef.current = null;
|
|
296
|
+
}
|
|
297
|
+
translateY.value = withTiming(-200, { duration: 300 });
|
|
298
|
+
opacity.value = withTiming(0, { duration: 300 }, () => {
|
|
299
|
+
runOnJS(hideMessage)();
|
|
300
|
+
});
|
|
280
301
|
};
|
|
281
302
|
useEffect(() => {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
303
|
+
const listener = (msg) => {
|
|
304
|
+
if (timeoutRef.current) {
|
|
305
|
+
clearTimeout(timeoutRef.current);
|
|
306
|
+
timeoutRef.current = null;
|
|
307
|
+
}
|
|
308
|
+
translateY.value = -200;
|
|
309
|
+
opacity.value = 0;
|
|
310
|
+
setMessage(msg);
|
|
311
|
+
translateY.value = withTiming(0, { duration: 300 });
|
|
312
|
+
opacity.value = withTiming(1, { duration: 300 });
|
|
313
|
+
const duration = msg.duration || 3e3;
|
|
314
|
+
timeoutRef.current = setTimeout(() => {
|
|
315
|
+
translateY.value = withTiming(-200, { duration: 300 });
|
|
316
|
+
opacity.value = withTiming(0, { duration: 300 }, () => {
|
|
317
|
+
runOnJS(hideMessage)();
|
|
318
|
+
});
|
|
319
|
+
timeoutRef.current = null;
|
|
320
|
+
}, duration);
|
|
321
|
+
};
|
|
322
|
+
const unsubscribe = subscribeToFlashMessages(listener);
|
|
323
|
+
return () => {
|
|
324
|
+
if (timeoutRef.current) {
|
|
325
|
+
clearTimeout(timeoutRef.current);
|
|
326
|
+
timeoutRef.current = null;
|
|
327
|
+
}
|
|
328
|
+
unsubscribe();
|
|
329
|
+
};
|
|
330
|
+
}, []);
|
|
331
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
332
|
+
return {
|
|
333
|
+
transform: [{ translateY: translateY.value }],
|
|
334
|
+
opacity: opacity.value
|
|
335
|
+
};
|
|
336
|
+
});
|
|
337
|
+
const styles = ScaledSheet.create({
|
|
285
338
|
root: {
|
|
286
339
|
position: "absolute",
|
|
287
|
-
top:
|
|
340
|
+
top: 0,
|
|
288
341
|
zIndex: 1e3,
|
|
289
342
|
left: 0,
|
|
290
343
|
paddingTop: top + 10,
|
|
@@ -305,7 +358,9 @@ var FlashMessage = () => {
|
|
|
305
358
|
backgroundColor: "#fff3"
|
|
306
359
|
}
|
|
307
360
|
});
|
|
308
|
-
|
|
361
|
+
if (!message)
|
|
362
|
+
return null;
|
|
363
|
+
return /* @__PURE__ */ React3.createElement(Animated.View, { style: [styles.root, animatedStyle] }, /* @__PURE__ */ React3.createElement(TouchableOpacity, { onPress: closeMessage, activeOpacity: 0.9 }, /* @__PURE__ */ React3.createElement(View, { style: { flexDirection: "row" } }, /* @__PURE__ */ React3.createElement(View, { style: { flex: 1, marginRight: 10 } }, message?.title && /* @__PURE__ */ React3.createElement(
|
|
309
364
|
Typography_default,
|
|
310
365
|
{
|
|
311
366
|
variant: "h6",
|
|
@@ -314,7 +369,18 @@ var FlashMessage = () => {
|
|
|
314
369
|
style: { color: "#fff" }
|
|
315
370
|
},
|
|
316
371
|
message?.title
|
|
317
|
-
), /* @__PURE__ */ React3.createElement(Typography_default, { style: { color: "#fff" } }, message?.message))), message?.actions?.map((cur, i) => /* @__PURE__ */ React3.createElement(
|
|
372
|
+
), /* @__PURE__ */ React3.createElement(Typography_default, { style: { color: "#fff" } }, message?.message)))), message?.actions?.map((cur, i) => /* @__PURE__ */ React3.createElement(
|
|
373
|
+
TouchableOpacity,
|
|
374
|
+
{
|
|
375
|
+
key: i,
|
|
376
|
+
style: styles.action,
|
|
377
|
+
onPress: () => {
|
|
378
|
+
cur.onPress?.();
|
|
379
|
+
closeMessage();
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
/* @__PURE__ */ React3.createElement(Typography_default, { fontWeight: 700, style: { color: "#fff" } }, cur.title)
|
|
383
|
+
)));
|
|
318
384
|
};
|
|
319
385
|
var FlashMessage_default = FlashMessage;
|
|
320
386
|
|
|
@@ -323,6 +389,7 @@ var UIThemeContext = createContext({
|
|
|
323
389
|
themeState: { mode: "default", value: "light" }
|
|
324
390
|
});
|
|
325
391
|
function themeReducer(state, { type, payload }) {
|
|
392
|
+
AsyncStorage.setItem("theme", type);
|
|
326
393
|
switch (type) {
|
|
327
394
|
case "dark":
|
|
328
395
|
return { mode: "dark", value: "dark" };
|
|
@@ -341,12 +408,20 @@ var ConfigureSystemUI = () => {
|
|
|
341
408
|
const config2 = getConfig();
|
|
342
409
|
if (colors2) {
|
|
343
410
|
SystemUI.setBackgroundColorAsync(colors2.white[1]);
|
|
344
|
-
if (Platform.OS === "android"
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
411
|
+
if (Platform.OS === "android") {
|
|
412
|
+
if (config2.EDGE_TO_EDGE) {
|
|
413
|
+
if (theme === "dark") {
|
|
414
|
+
NavigationBar.setStyle("light");
|
|
415
|
+
} else {
|
|
416
|
+
NavigationBar.setStyle("dark");
|
|
417
|
+
}
|
|
348
418
|
} else {
|
|
349
|
-
NavigationBar.
|
|
419
|
+
NavigationBar.setBackgroundColorAsync(colors2.white[1]);
|
|
420
|
+
if (theme === "dark") {
|
|
421
|
+
NavigationBar.setButtonStyleAsync("light");
|
|
422
|
+
} else {
|
|
423
|
+
NavigationBar.setButtonStyleAsync("dark");
|
|
424
|
+
}
|
|
350
425
|
}
|
|
351
426
|
}
|
|
352
427
|
}
|
|
@@ -402,9 +477,20 @@ var useTheme = () => {
|
|
|
402
477
|
const { themeState } = useContext(UIThemeContext);
|
|
403
478
|
return themeState.value;
|
|
404
479
|
};
|
|
480
|
+
var useThemeContext = () => {
|
|
481
|
+
const { themeState: theme, themeDispatch } = useContext(UIThemeContext);
|
|
482
|
+
const colorScheme = useColorScheme2();
|
|
483
|
+
const setTheme = (theme2) => {
|
|
484
|
+
if (theme2 === "default") {
|
|
485
|
+
themeDispatch?.({ type: "default", payload: colorScheme });
|
|
486
|
+
} else {
|
|
487
|
+
themeDispatch?.({ type: theme2 });
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
return { theme, setTheme };
|
|
491
|
+
};
|
|
405
492
|
var useNavScreenOptions = (type) => {
|
|
406
493
|
const colors2 = useColors();
|
|
407
|
-
const theme = useTheme();
|
|
408
494
|
const options = {
|
|
409
495
|
stack: {
|
|
410
496
|
headerShown: false,
|
|
@@ -424,15 +510,12 @@ var useNavScreenOptions = (type) => {
|
|
|
424
510
|
headerShown: false,
|
|
425
511
|
headerTintColor: colors2.dark.main,
|
|
426
512
|
tabBarStyle: {
|
|
427
|
-
borderTopColor:
|
|
513
|
+
borderTopColor: colors2.white[2],
|
|
514
|
+
borderColor: colors2.white[2],
|
|
428
515
|
borderTopWidth: 1,
|
|
429
|
-
// shadowColor: "#000",
|
|
430
|
-
// shadowOffset: { height: -3, width: 0 },
|
|
431
|
-
// shadowRadius: 7,
|
|
432
|
-
// shadowOpacity: 0.1,
|
|
433
516
|
backgroundColor: colors2.white[1]
|
|
434
517
|
},
|
|
435
|
-
tabBarActiveTintColor: colors2.
|
|
518
|
+
tabBarActiveTintColor: colors2.primary.main,
|
|
436
519
|
tabBarInactiveTintColor: colors2.textSecondary.main,
|
|
437
520
|
tabBarLabelStyle: {
|
|
438
521
|
// fontSize: ms(12),
|
|
@@ -456,10 +539,6 @@ var useNavScreenOptions = (type) => {
|
|
|
456
539
|
}
|
|
457
540
|
}
|
|
458
541
|
};
|
|
459
|
-
if (Platform2.OS === "android") {
|
|
460
|
-
options.tab.tabBarStyle.height = Dimensions.get("screen").height * 0.08;
|
|
461
|
-
options.tab.tabBarStyle.paddingBottom = vs(15);
|
|
462
|
-
}
|
|
463
542
|
return options[type];
|
|
464
543
|
};
|
|
465
544
|
|
|
@@ -493,7 +572,7 @@ var AdaptiveStatusBarNext_default = AdaptiveStatusBar;
|
|
|
493
572
|
import { MaterialIcons } from "@expo/vector-icons";
|
|
494
573
|
import React6 from "react";
|
|
495
574
|
import { View as View2 } from "react-native";
|
|
496
|
-
import { ScaledSheet as ScaledSheet2 } from "react-native-size-matters";
|
|
575
|
+
import { ms as ms2, ScaledSheet as ScaledSheet2 } from "react-native-size-matters";
|
|
497
576
|
var AlertX = ({
|
|
498
577
|
type = "info",
|
|
499
578
|
variant = "contained",
|
|
@@ -503,7 +582,7 @@ var AlertX = ({
|
|
|
503
582
|
style = {}
|
|
504
583
|
}) => {
|
|
505
584
|
const colors2 = useColors();
|
|
506
|
-
const
|
|
585
|
+
const styles = ScaledSheet2.create({
|
|
507
586
|
container: {
|
|
508
587
|
padding: 20,
|
|
509
588
|
paddingTop: 10,
|
|
@@ -511,7 +590,7 @@ var AlertX = ({
|
|
|
511
590
|
borderRadius: 8,
|
|
512
591
|
alignItems: "center",
|
|
513
592
|
flexDirection: "row",
|
|
514
|
-
marginBottom: gutterBottom
|
|
593
|
+
marginBottom: ms2(gutterBottom),
|
|
515
594
|
backgroundColor: colors2[type].main + (variant === "contained" ? "" : "3")
|
|
516
595
|
},
|
|
517
596
|
title: {
|
|
@@ -521,7 +600,7 @@ var AlertX = ({
|
|
|
521
600
|
color: variant === "contained" ? "#fff" : colors2[type].main
|
|
522
601
|
}
|
|
523
602
|
});
|
|
524
|
-
return /* @__PURE__ */ React6.createElement(View2, { style:
|
|
603
|
+
return /* @__PURE__ */ React6.createElement(View2, { style: [styles.container, style] }, /* @__PURE__ */ React6.createElement(View2, { style: { width: "80%" } }, /* @__PURE__ */ React6.createElement(Typography_default, { style: styles.title, gutterBottom: 3, fontWeight: 700 }, title), body && /* @__PURE__ */ React6.createElement(Typography_default, { fontWeight: 700, variant: "body2", style: styles.body }, body)), /* @__PURE__ */ React6.createElement(View2, { style: { marginLeft: "auto" } }, /* @__PURE__ */ React6.createElement(
|
|
525
604
|
MaterialIcons,
|
|
526
605
|
{
|
|
527
606
|
color: variant === "contained" ? "#fff" : colors2[type].main,
|
|
@@ -534,9 +613,9 @@ var AlertX_default = AlertX;
|
|
|
534
613
|
|
|
535
614
|
// ../src/Components/Avatar.tsx
|
|
536
615
|
import { AntDesign } from "@expo/vector-icons";
|
|
537
|
-
import React7 from "react";
|
|
616
|
+
import React7, { useState as useState3 } from "react";
|
|
538
617
|
import { Image, View as View3 } from "react-native";
|
|
539
|
-
import { ScaledSheet as ScaledSheet3 } from "react-native-size-matters";
|
|
618
|
+
import { ms as ms3, ScaledSheet as ScaledSheet3 } from "react-native-size-matters";
|
|
540
619
|
var Avatar = ({
|
|
541
620
|
color = "dark",
|
|
542
621
|
label,
|
|
@@ -546,17 +625,18 @@ var Avatar = ({
|
|
|
546
625
|
style = {}
|
|
547
626
|
}) => {
|
|
548
627
|
const colors2 = useColors();
|
|
549
|
-
const
|
|
628
|
+
const [imageError, setImageError] = useState3(false);
|
|
629
|
+
const styles = ScaledSheet3.create({
|
|
550
630
|
root: {
|
|
551
631
|
borderRadius: 150,
|
|
552
|
-
height: size
|
|
553
|
-
width: size
|
|
632
|
+
height: ms3(size),
|
|
633
|
+
width: ms3(size),
|
|
554
634
|
alignItems: "center",
|
|
555
635
|
justifyContent: "center",
|
|
556
636
|
overflow: "hidden",
|
|
557
637
|
borderWidth: variant === "outlined" ? 5 : 0,
|
|
558
638
|
borderColor: variant === "outlined" ? "#fff" : "#0000",
|
|
559
|
-
backgroundColor: variant === "outlined" ?
|
|
639
|
+
backgroundColor: variant === "outlined" ? void 0 : label ? colors2[color].main : colors2.white[4],
|
|
560
640
|
...style
|
|
561
641
|
},
|
|
562
642
|
image: {
|
|
@@ -564,7 +644,15 @@ var Avatar = ({
|
|
|
564
644
|
width: "110%"
|
|
565
645
|
}
|
|
566
646
|
});
|
|
567
|
-
return /* @__PURE__ */ React7.createElement(View3, { style:
|
|
647
|
+
return /* @__PURE__ */ React7.createElement(View3, { style: styles.root }, source && !imageError ? /* @__PURE__ */ React7.createElement(
|
|
648
|
+
Image,
|
|
649
|
+
{
|
|
650
|
+
resizeMode: "cover",
|
|
651
|
+
style: styles.image,
|
|
652
|
+
source,
|
|
653
|
+
onError: () => setImageError(true)
|
|
654
|
+
}
|
|
655
|
+
) : 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) }));
|
|
568
656
|
};
|
|
569
657
|
var Avatar_default = Avatar;
|
|
570
658
|
|
|
@@ -572,27 +660,27 @@ var Avatar_default = Avatar;
|
|
|
572
660
|
import { Ionicons, MaterialIcons as MaterialIcons2 } from "@expo/vector-icons";
|
|
573
661
|
import React8, { forwardRef as forwardRef2 } from "react";
|
|
574
662
|
import { ActivityIndicator, Text as Text2, TouchableOpacity as TouchableOpacity2 } from "react-native";
|
|
575
|
-
import { ScaledSheet as ScaledSheet4, moderateScale as moderateScale2 } from "react-native-size-matters";
|
|
663
|
+
import { ScaledSheet as ScaledSheet4, moderateScale as moderateScale2, ms as ms4 } from "react-native-size-matters";
|
|
576
664
|
var LinkButton = ({
|
|
577
665
|
title,
|
|
578
666
|
style = {},
|
|
579
667
|
color = "blue",
|
|
580
668
|
fontSize = 12,
|
|
581
|
-
fontWeight =
|
|
669
|
+
fontWeight = 400,
|
|
582
670
|
disabled,
|
|
583
671
|
onPress = () => {
|
|
584
672
|
}
|
|
585
673
|
}) => {
|
|
586
674
|
const colors2 = useColors();
|
|
587
|
-
const
|
|
675
|
+
const styles = ScaledSheet4.create({
|
|
588
676
|
text: {
|
|
589
677
|
fontSize: moderateScale2(fontSize),
|
|
590
|
-
fontWeight,
|
|
591
|
-
fontFamily:
|
|
678
|
+
fontWeight: fontWeight.toString(),
|
|
679
|
+
fontFamily: getFontFamily(fontWeight),
|
|
592
680
|
color: disabled ? "#777" : colors2[color].main
|
|
593
681
|
}
|
|
594
682
|
});
|
|
595
|
-
return /* @__PURE__ */ React8.createElement(TouchableOpacity2, { onPress, disabled }, /* @__PURE__ */ React8.createElement(Text2, { style: { ...
|
|
683
|
+
return /* @__PURE__ */ React8.createElement(TouchableOpacity2, { onPress, disabled }, /* @__PURE__ */ React8.createElement(Text2, { style: { ...styles.text, ...style } }, title));
|
|
596
684
|
};
|
|
597
685
|
var IconButton = ({
|
|
598
686
|
style = {},
|
|
@@ -610,11 +698,11 @@ var IconButton = ({
|
|
|
610
698
|
const colors2 = useColors();
|
|
611
699
|
const theme = useTheme();
|
|
612
700
|
const bgColor = theme === "light" ? "#fff" : "#222";
|
|
613
|
-
const
|
|
701
|
+
const styles = ScaledSheet4.create({
|
|
614
702
|
container: {
|
|
615
703
|
alignSelf: "flex-start",
|
|
616
704
|
flexGrow: 0,
|
|
617
|
-
backgroundColor: bg ? bgColor : elevation > 0 ? bgColor :
|
|
705
|
+
backgroundColor: bg ? bgColor : elevation > 0 ? bgColor : void 0,
|
|
618
706
|
padding: "5@ms",
|
|
619
707
|
shadowColor: "#000",
|
|
620
708
|
shadowOpacity: 0.1,
|
|
@@ -622,8 +710,8 @@ var IconButton = ({
|
|
|
622
710
|
height: 1,
|
|
623
711
|
width: 0
|
|
624
712
|
},
|
|
625
|
-
height: bg ? size + 20
|
|
626
|
-
width: bg ? size + 20
|
|
713
|
+
height: bg ? ms4(size + 20) : void 0,
|
|
714
|
+
width: bg ? ms4(size + 20) : void 0,
|
|
627
715
|
alignItems: "center",
|
|
628
716
|
justifyContent: "center",
|
|
629
717
|
shadowRadius: elevation,
|
|
@@ -643,9 +731,9 @@ var IconButton = ({
|
|
|
643
731
|
{
|
|
644
732
|
onPress,
|
|
645
733
|
activeOpacity: 0.3,
|
|
646
|
-
style: { ...
|
|
734
|
+
style: { ...styles.container, ...containerStyles }
|
|
647
735
|
},
|
|
648
|
-
/* @__PURE__ */ React8.createElement(IconComp, { style: { ...
|
|
736
|
+
/* @__PURE__ */ React8.createElement(IconComp, { style: { ...styles.text, ...style }, name: icon, size })
|
|
649
737
|
);
|
|
650
738
|
};
|
|
651
739
|
var Button = forwardRef2(
|
|
@@ -668,16 +756,16 @@ var Button = forwardRef2(
|
|
|
668
756
|
end
|
|
669
757
|
}, ref) => {
|
|
670
758
|
const colors2 = useColors();
|
|
671
|
-
const
|
|
759
|
+
const styles = ScaledSheet4.create({
|
|
672
760
|
con: {
|
|
673
761
|
flexDirection: "row",
|
|
674
762
|
alignItems: "center",
|
|
675
763
|
alignSelf: "flex-start",
|
|
676
764
|
justifyContent: "center",
|
|
677
|
-
backgroundColor: variant === "text" || variant === "outlined" ?
|
|
765
|
+
backgroundColor: variant === "text" || variant === "outlined" ? void 0 : translucent ? translucent === "dark" ? colors2.white[3] + "22" : colors2.black[3] + "22" : loading ? colors2[color].light : disabled ? colors2.white[4] : colors2[color].main,
|
|
678
766
|
borderRadius: rounded ? 30 : 10,
|
|
679
767
|
elevation: variant === "text" ? 0 : elevation,
|
|
680
|
-
paddingVertical: size === "small" ? 8 : size === "large" ? "15@
|
|
768
|
+
paddingVertical: size === "small" ? 8 : size === "large" ? "15@mvs" : "13@mvs",
|
|
681
769
|
paddingHorizontal: size === "small" ? "10@ms" : "18@ms",
|
|
682
770
|
borderColor: colors2[color].main,
|
|
683
771
|
borderWidth: variant === "outlined" ? 1 : 0,
|
|
@@ -689,14 +777,14 @@ var Button = forwardRef2(
|
|
|
689
777
|
width: 0
|
|
690
778
|
},
|
|
691
779
|
shadowOpacity: variant === "text" ? 0 : 0.3,
|
|
692
|
-
width: fullWidth ? "100%" :
|
|
780
|
+
width: fullWidth ? "100%" : void 0,
|
|
693
781
|
...style
|
|
694
782
|
},
|
|
695
783
|
text: {
|
|
696
784
|
color: disabled ? variant === "text" || variant === "outlined" ? colors2.black[1] : colors2[color].text : colors2[color][variant === "text" || variant === "outlined" ? "main" : "text"],
|
|
697
785
|
fontWeight: variant === "outlined" ? "700" : "500",
|
|
698
|
-
fontSize: size === "small" ? "12@ms" : "
|
|
699
|
-
fontFamily:
|
|
786
|
+
fontSize: size === "small" ? "12@ms" : "13@ms",
|
|
787
|
+
fontFamily: getFontFamily(variant === "outlined" ? 700 : 500)
|
|
700
788
|
}
|
|
701
789
|
});
|
|
702
790
|
return /* @__PURE__ */ React8.createElement(
|
|
@@ -705,7 +793,7 @@ var Button = forwardRef2(
|
|
|
705
793
|
ref,
|
|
706
794
|
onPress,
|
|
707
795
|
disabled,
|
|
708
|
-
style:
|
|
796
|
+
style: styles.con
|
|
709
797
|
},
|
|
710
798
|
start,
|
|
711
799
|
loading && /* @__PURE__ */ React8.createElement(
|
|
@@ -716,7 +804,7 @@ var Button = forwardRef2(
|
|
|
716
804
|
style: { marginRight: 10 }
|
|
717
805
|
}
|
|
718
806
|
),
|
|
719
|
-
/* @__PURE__ */ React8.createElement(Text2, { style:
|
|
807
|
+
/* @__PURE__ */ React8.createElement(Text2, { style: styles.text }, title),
|
|
720
808
|
end
|
|
721
809
|
);
|
|
722
810
|
}
|
|
@@ -738,14 +826,14 @@ var CheckBox = ({
|
|
|
738
826
|
}) => {
|
|
739
827
|
const iconName = checked ? "checkbox-marked" : "checkbox-blank-outline";
|
|
740
828
|
const colors2 = useColors();
|
|
741
|
-
const
|
|
829
|
+
const styles = ScaledSheet5.create({
|
|
742
830
|
container: {
|
|
743
831
|
alignItems: "center",
|
|
744
832
|
flexDirection: "row",
|
|
745
833
|
...style
|
|
746
834
|
}
|
|
747
835
|
});
|
|
748
|
-
return /* @__PURE__ */ React9.createElement(View4, { style:
|
|
836
|
+
return /* @__PURE__ */ React9.createElement(View4, { style: styles.container }, /* @__PURE__ */ React9.createElement(TouchableOpacity3, { onPress: onChange }, /* @__PURE__ */ React9.createElement(
|
|
749
837
|
MaterialCommunityIcons,
|
|
750
838
|
{
|
|
751
839
|
name: iconName,
|
|
@@ -765,6 +853,7 @@ import {
|
|
|
765
853
|
TouchableWithoutFeedback
|
|
766
854
|
} from "react-native";
|
|
767
855
|
import { ScaledSheet as ScaledSheet6 } from "react-native-size-matters";
|
|
856
|
+
import { useSafeAreaInsets as useSafeAreaInsets2 } from "react-native-safe-area-context";
|
|
768
857
|
var FormWrapper = ({
|
|
769
858
|
children,
|
|
770
859
|
behavior = Platform4.OS === "ios" ? "padding" : "height",
|
|
@@ -774,7 +863,9 @@ var FormWrapper = ({
|
|
|
774
863
|
style = {},
|
|
775
864
|
onScroll
|
|
776
865
|
}) => {
|
|
777
|
-
const
|
|
866
|
+
const { bottom } = useSafeAreaInsets2();
|
|
867
|
+
const defaultOffset = Platform4.OS === "ios" ? -bottom : -bottom * 2;
|
|
868
|
+
const styles = ScaledSheet6.create({
|
|
778
869
|
root: {
|
|
779
870
|
width: "100%",
|
|
780
871
|
flex: 1,
|
|
@@ -784,18 +875,18 @@ var FormWrapper = ({
|
|
|
784
875
|
return mode === "static" ? /* @__PURE__ */ React10.createElement(TouchableWithoutFeedback, { onPress: Keyboard.dismiss, accessible: false }, /* @__PURE__ */ React10.createElement(
|
|
785
876
|
KeyboardAvoidingView,
|
|
786
877
|
{
|
|
787
|
-
style:
|
|
878
|
+
style: styles.root,
|
|
788
879
|
behavior,
|
|
789
|
-
contentContainerStyle:
|
|
790
|
-
keyboardVerticalOffset
|
|
880
|
+
contentContainerStyle: styles.root,
|
|
881
|
+
keyboardVerticalOffset: keyboardVerticalOffset || defaultOffset
|
|
791
882
|
},
|
|
792
883
|
children
|
|
793
884
|
)) : /* @__PURE__ */ React10.createElement(
|
|
794
885
|
KeyboardAvoidingView,
|
|
795
886
|
{
|
|
796
887
|
behavior,
|
|
797
|
-
style:
|
|
798
|
-
keyboardVerticalOffset
|
|
888
|
+
style: styles.root,
|
|
889
|
+
keyboardVerticalOffset: keyboardVerticalOffset || defaultOffset
|
|
799
890
|
},
|
|
800
891
|
/* @__PURE__ */ React10.createElement(
|
|
801
892
|
ScrollView,
|
|
@@ -815,7 +906,7 @@ var FormWrapper = ({
|
|
|
815
906
|
// ../src/Components/StarRating.tsx
|
|
816
907
|
import { Ionicons as Ionicons2 } from "@expo/vector-icons";
|
|
817
908
|
import * as Haptics from "expo-haptics";
|
|
818
|
-
import { useEffect as
|
|
909
|
+
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
819
910
|
import {
|
|
820
911
|
ActivityIndicator as ActivityIndicator2,
|
|
821
912
|
TextInput,
|
|
@@ -835,50 +926,118 @@ import {
|
|
|
835
926
|
TouchableWithoutFeedback as TouchableWithoutFeedback2,
|
|
836
927
|
View as View5
|
|
837
928
|
} from "react-native";
|
|
838
|
-
import React11, { useState as
|
|
839
|
-
import {
|
|
929
|
+
import React11, { useEffect as useEffect3, useState as useState4 } from "react";
|
|
930
|
+
import Animated2, {
|
|
931
|
+
LinearTransition,
|
|
932
|
+
runOnJS as runOnJS2,
|
|
933
|
+
useAnimatedStyle as useAnimatedStyle2,
|
|
934
|
+
useSharedValue as useSharedValue2,
|
|
935
|
+
withTiming as withTiming2
|
|
936
|
+
} from "react-native-reanimated";
|
|
937
|
+
import { useSafeAreaInsets as useSafeAreaInsets3 } from "react-native-safe-area-context";
|
|
938
|
+
import { ms as ms5, ScaledSheet as ScaledSheet7 } from "react-native-size-matters";
|
|
840
939
|
var Popup = ({
|
|
841
940
|
title,
|
|
842
|
-
sheet,
|
|
941
|
+
sheet = true,
|
|
843
942
|
bare = false,
|
|
844
943
|
keyboardVerticalOffset,
|
|
845
944
|
children,
|
|
846
945
|
open,
|
|
847
946
|
onClose = () => {
|
|
848
947
|
},
|
|
849
|
-
style
|
|
948
|
+
style,
|
|
949
|
+
onModalShow,
|
|
950
|
+
onModalHide,
|
|
951
|
+
disableAutoKeyboardManagement = false
|
|
850
952
|
}) => {
|
|
851
953
|
const theme = useTheme();
|
|
852
954
|
const colors2 = useColors();
|
|
853
|
-
const [
|
|
854
|
-
const [
|
|
855
|
-
const
|
|
955
|
+
const [modalVisible, setModalVisible] = useState4(false);
|
|
956
|
+
const [modalOpen, setModalOpen] = useState4(false);
|
|
957
|
+
const [keyboardVisible, setKeyboardVisible] = useState4(false);
|
|
958
|
+
const { bottom } = useSafeAreaInsets3();
|
|
959
|
+
const backdropOpacity = useSharedValue2(0);
|
|
960
|
+
const contentTranslateY = useSharedValue2(1e3);
|
|
961
|
+
const keyboardVerticalOffsetValue = Platform5.OS === "ios" ? -bottom : -bottom * 2;
|
|
962
|
+
useEffect3(() => {
|
|
963
|
+
const keyboardDidShowListener = Keyboard2.addListener(
|
|
964
|
+
"keyboardDidShow",
|
|
965
|
+
() => {
|
|
966
|
+
setKeyboardVisible(true);
|
|
967
|
+
}
|
|
968
|
+
);
|
|
969
|
+
const keyboardDidHideListener = Keyboard2.addListener(
|
|
970
|
+
"keyboardDidHide",
|
|
971
|
+
() => {
|
|
972
|
+
setKeyboardVisible(false);
|
|
973
|
+
}
|
|
974
|
+
);
|
|
975
|
+
return () => {
|
|
976
|
+
keyboardDidHideListener?.remove();
|
|
977
|
+
keyboardDidShowListener?.remove();
|
|
978
|
+
};
|
|
979
|
+
}, []);
|
|
980
|
+
const _onModalShow = () => {
|
|
981
|
+
setModalVisible(true);
|
|
982
|
+
onModalShow?.();
|
|
983
|
+
};
|
|
984
|
+
const _onModalHide = () => {
|
|
985
|
+
onModalHide?.();
|
|
986
|
+
setModalOpen(false);
|
|
987
|
+
};
|
|
988
|
+
useEffect3(() => {
|
|
989
|
+
if (open) {
|
|
990
|
+
setModalOpen(true);
|
|
991
|
+
backdropOpacity.value = withTiming2(1, { duration: 300 });
|
|
992
|
+
contentTranslateY.value = withTiming2(0, { duration: 300 }, () => {
|
|
993
|
+
runOnJS2(_onModalShow)();
|
|
994
|
+
});
|
|
995
|
+
} else {
|
|
996
|
+
setModalVisible(false);
|
|
997
|
+
backdropOpacity.value = withTiming2(0, { duration: 200 });
|
|
998
|
+
contentTranslateY.value = withTiming2(1e3, { duration: 200 }, () => {
|
|
999
|
+
runOnJS2(_onModalHide)();
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
}, [open]);
|
|
1003
|
+
const backdropAnimatedStyle = useAnimatedStyle2(() => ({
|
|
1004
|
+
opacity: backdropOpacity.value
|
|
1005
|
+
}));
|
|
1006
|
+
const contentAnimatedStyle = useAnimatedStyle2(() => ({
|
|
1007
|
+
transform: [{ translateY: contentTranslateY.value }]
|
|
1008
|
+
}));
|
|
1009
|
+
const styles = ScaledSheet7.create({
|
|
856
1010
|
root: {
|
|
857
1011
|
height: "100%",
|
|
858
1012
|
width: "100%",
|
|
859
1013
|
justifyContent: sheet ? "flex-end" : "center"
|
|
860
1014
|
},
|
|
1015
|
+
keyboardView: {
|
|
1016
|
+
flex: 1,
|
|
1017
|
+
zIndex: 1e3
|
|
1018
|
+
},
|
|
861
1019
|
avoidingView: {
|
|
1020
|
+
zIndex: 2,
|
|
862
1021
|
minHeight: typeof sheet === "number" ? sheet : void 0,
|
|
863
|
-
maxHeight: "
|
|
864
|
-
zIndex: 1e3,
|
|
1022
|
+
maxHeight: "90%",
|
|
865
1023
|
alignSelf: "center",
|
|
866
1024
|
maxWidth: sheet ? void 0 : "90%",
|
|
867
|
-
width: sheet ? "100%" : void 0
|
|
1025
|
+
width: sheet ? "100%" : void 0,
|
|
1026
|
+
marginBottom: Platform5.OS === "android" && keyboardVisible ? bottom : 0
|
|
868
1027
|
},
|
|
869
1028
|
container: {
|
|
870
|
-
paddingBottom: sheet ?
|
|
871
|
-
backgroundColor: theme === "dark" ? "#111" : colors2.white[
|
|
1029
|
+
paddingBottom: sheet && !bare ? bottom + ms5(10) : void 0,
|
|
1030
|
+
backgroundColor: theme === "dark" ? "#111" : colors2.white[1],
|
|
872
1031
|
borderTopLeftRadius: 20,
|
|
873
1032
|
borderTopRightRadius: 20,
|
|
874
1033
|
borderBottomRightRadius: sheet ? 0 : 20,
|
|
875
1034
|
borderBottomLeftRadius: sheet ? 0 : 20,
|
|
876
1035
|
width: "100%",
|
|
1036
|
+
overflow: "hidden",
|
|
877
1037
|
...style
|
|
878
1038
|
},
|
|
879
1039
|
content: {
|
|
880
1040
|
paddingHorizontal: bare ? void 0 : "15@ms"
|
|
881
|
-
// flex: 1,
|
|
882
1041
|
},
|
|
883
1042
|
title: {
|
|
884
1043
|
flexDirection: "row",
|
|
@@ -893,71 +1052,60 @@ var Popup = ({
|
|
|
893
1052
|
backdrop: {
|
|
894
1053
|
position: "absolute",
|
|
895
1054
|
height: "100%",
|
|
896
|
-
zIndex:
|
|
1055
|
+
zIndex: 1,
|
|
897
1056
|
width: "100%",
|
|
898
1057
|
backgroundColor: "#000b"
|
|
899
1058
|
}
|
|
900
1059
|
});
|
|
901
|
-
React11.useEffect(() => {
|
|
902
|
-
if (open) {
|
|
903
|
-
setShow(open);
|
|
904
|
-
setTimeout(() => {
|
|
905
|
-
setShowSecondary(open);
|
|
906
|
-
}, 500);
|
|
907
|
-
} else {
|
|
908
|
-
closeAction();
|
|
909
|
-
}
|
|
910
|
-
}, [open]);
|
|
911
1060
|
const closeAction = () => {
|
|
912
|
-
|
|
913
|
-
setTimeout(() => {
|
|
914
|
-
setShow(false);
|
|
915
|
-
onClose();
|
|
916
|
-
}, 300);
|
|
1061
|
+
onClose();
|
|
917
1062
|
};
|
|
918
|
-
return /* @__PURE__ */ React11.createElement(
|
|
1063
|
+
return /* @__PURE__ */ React11.createElement(
|
|
919
1064
|
Modal,
|
|
920
1065
|
{
|
|
921
1066
|
transparent: true,
|
|
922
|
-
animationType: "
|
|
1067
|
+
animationType: "none",
|
|
923
1068
|
statusBarTranslucent: true,
|
|
924
|
-
visible:
|
|
1069
|
+
visible: modalOpen,
|
|
925
1070
|
onRequestClose: closeAction
|
|
926
1071
|
},
|
|
927
|
-
/* @__PURE__ */ React11.createElement(
|
|
928
|
-
|
|
929
|
-
Modal,
|
|
1072
|
+
/* @__PURE__ */ React11.createElement(UIThemeProvider, null, /* @__PURE__ */ React11.createElement(Animated2.View, { style: [styles.backdrop, backdropAnimatedStyle] }), /* @__PURE__ */ React11.createElement(
|
|
1073
|
+
KeyboardAvoidingView2,
|
|
930
1074
|
{
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
visible: showSecondary,
|
|
935
|
-
onRequestClose: closeAction
|
|
1075
|
+
style: styles.keyboardView,
|
|
1076
|
+
behavior: Platform5.OS === "ios" ? "padding" : "height",
|
|
1077
|
+
keyboardVerticalOffset: keyboardVerticalOffset || keyboardVerticalOffsetValue
|
|
936
1078
|
},
|
|
937
|
-
/* @__PURE__ */ React11.createElement(
|
|
938
|
-
|
|
1079
|
+
/* @__PURE__ */ React11.createElement(
|
|
1080
|
+
TouchableWithoutFeedback2,
|
|
939
1081
|
{
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
}
|
|
943
|
-
), /* @__PURE__ */ React11.createElement(
|
|
944
|
-
KeyboardAvoidingView2,
|
|
945
|
-
{
|
|
946
|
-
style: styles2.avoidingView,
|
|
947
|
-
keyboardVerticalOffset,
|
|
948
|
-
behavior: Platform5.OS === "ios" ? "position" : "padding"
|
|
1082
|
+
onPress: Keyboard2.dismiss,
|
|
1083
|
+
disabled: disableAutoKeyboardManagement
|
|
949
1084
|
},
|
|
950
|
-
/* @__PURE__ */ React11.createElement(View5, { style:
|
|
951
|
-
|
|
1085
|
+
/* @__PURE__ */ React11.createElement(View5, { style: styles.root }, modalOpen && /* @__PURE__ */ React11.createElement(
|
|
1086
|
+
Pressable,
|
|
952
1087
|
{
|
|
953
|
-
|
|
954
|
-
icon: "close",
|
|
1088
|
+
style: [StyleSheet2.absoluteFill, { zIndex: 1 }],
|
|
955
1089
|
onPress: closeAction
|
|
956
1090
|
}
|
|
957
|
-
)
|
|
958
|
-
|
|
1091
|
+
), /* @__PURE__ */ React11.createElement(
|
|
1092
|
+
Animated2.View,
|
|
1093
|
+
{
|
|
1094
|
+
style: [styles.avoidingView, contentAnimatedStyle],
|
|
1095
|
+
layout: modalVisible ? LinearTransition.springify().stiffness(200).mass(0.5).damping(100) : void 0
|
|
1096
|
+
},
|
|
1097
|
+
/* @__PURE__ */ React11.createElement(View5, { style: styles.container }, !bare && /* @__PURE__ */ React11.createElement(View5, { style: styles.title }, /* @__PURE__ */ React11.createElement(View5, { style: styles.titleIcon }, /* @__PURE__ */ React11.createElement(
|
|
1098
|
+
IconButton,
|
|
1099
|
+
{
|
|
1100
|
+
size: 20,
|
|
1101
|
+
icon: "close",
|
|
1102
|
+
onPress: closeAction
|
|
1103
|
+
}
|
|
1104
|
+
)), /* @__PURE__ */ React11.createElement(Typography_default, { align: "center", fontWeight: 500 }, title)), /* @__PURE__ */ React11.createElement(View5, { style: styles.content }, children))
|
|
1105
|
+
))
|
|
1106
|
+
)
|
|
959
1107
|
))
|
|
960
|
-
)
|
|
1108
|
+
);
|
|
961
1109
|
};
|
|
962
1110
|
|
|
963
1111
|
// ../src/Components/StarRating.tsx
|
|
@@ -966,13 +1114,13 @@ var RatingStars = ({
|
|
|
966
1114
|
size = 16
|
|
967
1115
|
}) => {
|
|
968
1116
|
const colors2 = useColors();
|
|
969
|
-
const
|
|
1117
|
+
const styles = ScaledSheet8.create({
|
|
970
1118
|
root: {
|
|
971
1119
|
flexDirection: "row",
|
|
972
1120
|
alignItems: "center"
|
|
973
1121
|
}
|
|
974
1122
|
});
|
|
975
|
-
return /* @__PURE__ */ React.createElement(View6, { style:
|
|
1123
|
+
return /* @__PURE__ */ React.createElement(View6, { style: styles.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(
|
|
976
1124
|
Ionicons2,
|
|
977
1125
|
{
|
|
978
1126
|
key: index,
|
|
@@ -987,12 +1135,12 @@ var RatingInput = ({
|
|
|
987
1135
|
rating = 0,
|
|
988
1136
|
size = 16
|
|
989
1137
|
}) => {
|
|
990
|
-
const [showReviewsModal, setShowReviewsModal] =
|
|
991
|
-
const [rate, setRate] =
|
|
1138
|
+
const [showReviewsModal, setShowReviewsModal] = useState5(false);
|
|
1139
|
+
const [rate, setRate] = useState5(0);
|
|
992
1140
|
const colors2 = useColors();
|
|
993
|
-
const [loading, setLoading] =
|
|
994
|
-
const [review, setReview] =
|
|
995
|
-
const
|
|
1141
|
+
const [loading, setLoading] = useState5(false);
|
|
1142
|
+
const [review, setReview] = useState5("");
|
|
1143
|
+
const styles = ScaledSheet8.create({
|
|
996
1144
|
root: {
|
|
997
1145
|
flexDirection: "row",
|
|
998
1146
|
alignItems: "center"
|
|
@@ -1009,7 +1157,7 @@ var RatingInput = ({
|
|
|
1009
1157
|
height: "100@vs"
|
|
1010
1158
|
}
|
|
1011
1159
|
});
|
|
1012
|
-
|
|
1160
|
+
useEffect4(() => {
|
|
1013
1161
|
setRate(rating);
|
|
1014
1162
|
}, [rating]);
|
|
1015
1163
|
const onRate = (index) => {
|
|
@@ -1025,7 +1173,7 @@ var RatingInput = ({
|
|
|
1025
1173
|
_onSubmit && await _onSubmit({ rating: rate, review });
|
|
1026
1174
|
setLoading(false);
|
|
1027
1175
|
};
|
|
1028
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(View6, { style:
|
|
1176
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(View6, { style: styles.root }, loading ? /* @__PURE__ */ React.createElement(ActivityIndicator2, null) : [...Array(5)].map((_, index) => /* @__PURE__ */ React.createElement(
|
|
1029
1177
|
TouchableOpacity4,
|
|
1030
1178
|
{
|
|
1031
1179
|
key: index,
|
|
@@ -1072,10 +1220,10 @@ var RatingInput = ({
|
|
|
1072
1220
|
},
|
|
1073
1221
|
"Add to your review"
|
|
1074
1222
|
),
|
|
1075
|
-
/* @__PURE__ */ React.createElement(View6, { style:
|
|
1223
|
+
/* @__PURE__ */ React.createElement(View6, { style: styles.inputCon }, /* @__PURE__ */ React.createElement(
|
|
1076
1224
|
TextInput,
|
|
1077
1225
|
{
|
|
1078
|
-
style:
|
|
1226
|
+
style: styles.input,
|
|
1079
1227
|
multiline: true,
|
|
1080
1228
|
value: review,
|
|
1081
1229
|
onChangeText: (text) => setReview(text),
|
|
@@ -1098,9 +1246,9 @@ var RatingInput = ({
|
|
|
1098
1246
|
};
|
|
1099
1247
|
|
|
1100
1248
|
// ../src/Components/Grid.tsx
|
|
1101
|
-
import { View as View7 } from "react-native";
|
|
1102
1249
|
import React12 from "react";
|
|
1103
|
-
import {
|
|
1250
|
+
import { View as View7 } from "react-native";
|
|
1251
|
+
import { ms as ms6, ScaledSheet as ScaledSheet9 } from "react-native-size-matters";
|
|
1104
1252
|
var GridItem = ({
|
|
1105
1253
|
children,
|
|
1106
1254
|
col = 2,
|
|
@@ -1108,33 +1256,33 @@ var GridItem = ({
|
|
|
1108
1256
|
spacing = 1,
|
|
1109
1257
|
style = {}
|
|
1110
1258
|
}) => {
|
|
1111
|
-
const
|
|
1259
|
+
const styles = ScaledSheet9.create({
|
|
1112
1260
|
gridItem: {
|
|
1113
|
-
width: 100 / col
|
|
1114
|
-
padding: spacing * 10
|
|
1261
|
+
width: `${100 / col}%`,
|
|
1262
|
+
padding: ms6(spacing * 10),
|
|
1115
1263
|
alignItems
|
|
1116
1264
|
}
|
|
1117
1265
|
});
|
|
1118
|
-
return /* @__PURE__ */ React12.createElement(View7, { children, style: [
|
|
1266
|
+
return /* @__PURE__ */ React12.createElement(View7, { children, style: [styles.gridItem, style] });
|
|
1119
1267
|
};
|
|
1120
1268
|
var Grid = ({
|
|
1121
1269
|
children,
|
|
1122
1270
|
spacing = 1,
|
|
1123
1271
|
style = {}
|
|
1124
1272
|
}) => {
|
|
1125
|
-
const
|
|
1273
|
+
const styles = ScaledSheet9.create({
|
|
1126
1274
|
grid: {
|
|
1127
1275
|
flexWrap: "wrap",
|
|
1128
|
-
margin: -spacing * 10
|
|
1276
|
+
margin: `${-spacing * 10}@ms`,
|
|
1129
1277
|
flexDirection: "row"
|
|
1130
1278
|
}
|
|
1131
1279
|
});
|
|
1132
|
-
return /* @__PURE__ */ React12.createElement(View7, { children, style: [
|
|
1280
|
+
return /* @__PURE__ */ React12.createElement(View7, { children, style: [styles.grid, style] });
|
|
1133
1281
|
};
|
|
1134
1282
|
|
|
1135
1283
|
// ../src/Components/Locator.tsx
|
|
1136
1284
|
import { Ionicons as Ionicons4 } from "@expo/vector-icons";
|
|
1137
|
-
import React16, { useEffect as
|
|
1285
|
+
import React16, { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1138
1286
|
import { Alert, TouchableOpacity as TouchableOpacity8, View as View11 } from "react-native";
|
|
1139
1287
|
|
|
1140
1288
|
// ../src/Components/List.tsx
|
|
@@ -1151,7 +1299,7 @@ var ListItem = ({
|
|
|
1151
1299
|
children
|
|
1152
1300
|
}) => {
|
|
1153
1301
|
const colors2 = useColors();
|
|
1154
|
-
const
|
|
1302
|
+
const styles = ScaledSheet10.create({
|
|
1155
1303
|
root: {
|
|
1156
1304
|
flexDirection: "row",
|
|
1157
1305
|
alignItems: "center",
|
|
@@ -1164,7 +1312,7 @@ var ListItem = ({
|
|
|
1164
1312
|
return /* @__PURE__ */ React13.createElement(
|
|
1165
1313
|
View8,
|
|
1166
1314
|
null,
|
|
1167
|
-
/* @__PURE__ */ React13.createElement(TouchableOpacity5, { disabled: Boolean(!onPress), onPress }, /* @__PURE__ */ React13.createElement(View8, { style: { ...
|
|
1315
|
+
/* @__PURE__ */ React13.createElement(TouchableOpacity5, { disabled: Boolean(!onPress), onPress }, /* @__PURE__ */ React13.createElement(View8, { style: { ...styles.root, ...style } }, children, link && /* @__PURE__ */ React13.createElement(
|
|
1168
1316
|
MaterialIcons3,
|
|
1169
1317
|
{
|
|
1170
1318
|
color: colors2.white[5],
|
|
@@ -1178,20 +1326,20 @@ var ListItem = ({
|
|
|
1178
1326
|
|
|
1179
1327
|
// ../src/Components/TextField.tsx
|
|
1180
1328
|
import { Ionicons as Ionicons3, MaterialIcons as MaterialIcons5 } from "@expo/vector-icons";
|
|
1181
|
-
import React15, { useRef, useState as
|
|
1182
|
-
import { Animated, TextInput as TextInput2, TouchableOpacity as TouchableOpacity7, View as View10 } from "react-native";
|
|
1329
|
+
import React15, { useRef as useRef2, useState as useState7 } from "react";
|
|
1330
|
+
import { Animated as Animated3, TextInput as TextInput2, TouchableOpacity as TouchableOpacity7, View as View10 } from "react-native";
|
|
1183
1331
|
import {
|
|
1184
1332
|
ScaledSheet as ScaledSheet12,
|
|
1185
1333
|
moderateScale as moderateScale3,
|
|
1186
|
-
ms,
|
|
1334
|
+
ms as ms7,
|
|
1187
1335
|
verticalScale as verticalScale2
|
|
1188
1336
|
} from "react-native-size-matters";
|
|
1189
1337
|
|
|
1190
1338
|
// ../src/Components/SelectMenu.tsx
|
|
1191
1339
|
import { MaterialIcons as MaterialIcons4 } from "@expo/vector-icons";
|
|
1192
|
-
import React14, { useCallback, useState as
|
|
1193
|
-
import { FlatList,
|
|
1194
|
-
import { useSafeAreaInsets as
|
|
1340
|
+
import React14, { useCallback, useState as useState6 } from "react";
|
|
1341
|
+
import { FlatList, TouchableOpacity as TouchableOpacity6, View as View9 } from "react-native";
|
|
1342
|
+
import { useSafeAreaInsets as useSafeAreaInsets4 } from "react-native-safe-area-context";
|
|
1195
1343
|
import { ScaledSheet as ScaledSheet11 } from "react-native-size-matters";
|
|
1196
1344
|
var SelectMenu = ({
|
|
1197
1345
|
open = false,
|
|
@@ -1202,22 +1350,15 @@ var SelectMenu = ({
|
|
|
1202
1350
|
disableAutoClose = false,
|
|
1203
1351
|
label,
|
|
1204
1352
|
secondary,
|
|
1205
|
-
helperText
|
|
1353
|
+
helperText,
|
|
1354
|
+
searchEnabled = false,
|
|
1355
|
+
searchPlaceholder = "Search"
|
|
1206
1356
|
}) => {
|
|
1207
1357
|
const colors2 = useColors();
|
|
1208
|
-
const { bottom } =
|
|
1209
|
-
const [search, setSearch] =
|
|
1210
|
-
const
|
|
1211
|
-
root: {
|
|
1212
|
-
backgroundColor: colors2.white[1],
|
|
1213
|
-
flex: 1
|
|
1214
|
-
},
|
|
1215
|
-
content: {
|
|
1216
|
-
flex: 1,
|
|
1217
|
-
paddingHorizontal: "10@ms"
|
|
1218
|
-
},
|
|
1358
|
+
const { bottom } = useSafeAreaInsets4();
|
|
1359
|
+
const [search, setSearch] = useState6("");
|
|
1360
|
+
const styles = ScaledSheet11.create({
|
|
1219
1361
|
header: {
|
|
1220
|
-
paddingTop: "80@ms",
|
|
1221
1362
|
marginBottom: "20@vs"
|
|
1222
1363
|
},
|
|
1223
1364
|
option: {
|
|
@@ -1227,11 +1368,6 @@ var SelectMenu = ({
|
|
|
1227
1368
|
flexDirection: "row",
|
|
1228
1369
|
alignItems: "center",
|
|
1229
1370
|
marginBottom: "10@vs"
|
|
1230
|
-
},
|
|
1231
|
-
footer: {
|
|
1232
|
-
paddingBottom: bottom,
|
|
1233
|
-
paddingHorizontal: "15@ms",
|
|
1234
|
-
paddingTop: "15@ms"
|
|
1235
1371
|
}
|
|
1236
1372
|
});
|
|
1237
1373
|
const renderItem = useCallback(
|
|
@@ -1239,7 +1375,7 @@ var SelectMenu = ({
|
|
|
1239
1375
|
TouchableOpacity6,
|
|
1240
1376
|
{
|
|
1241
1377
|
style: {
|
|
1242
|
-
...
|
|
1378
|
+
...styles.option,
|
|
1243
1379
|
backgroundColor: item.value === value ? colors2.blue.light + "22" : colors2.white[2]
|
|
1244
1380
|
},
|
|
1245
1381
|
onPress: () => {
|
|
@@ -1253,6 +1389,7 @@ var SelectMenu = ({
|
|
|
1253
1389
|
/* @__PURE__ */ React14.createElement(View9, { style: { flex: 1 } }, /* @__PURE__ */ React14.createElement(
|
|
1254
1390
|
Typography_default,
|
|
1255
1391
|
{
|
|
1392
|
+
variant: "body2",
|
|
1256
1393
|
style: {
|
|
1257
1394
|
color: item.value === value ? colors2.blue.light : colors2.black[2]
|
|
1258
1395
|
}
|
|
@@ -1281,35 +1418,36 @@ var SelectMenu = ({
|
|
|
1281
1418
|
),
|
|
1282
1419
|
[value, colors2]
|
|
1283
1420
|
);
|
|
1284
|
-
return /* @__PURE__ */ React14.createElement(
|
|
1285
|
-
|
|
1286
|
-
{
|
|
1287
|
-
label: "Search",
|
|
1288
|
-
value: search,
|
|
1289
|
-
type: "search",
|
|
1290
|
-
onChangeText: setSearch,
|
|
1291
|
-
variant: "outlined"
|
|
1292
|
-
}
|
|
1293
|
-
)), /* @__PURE__ */ React14.createElement(
|
|
1294
|
-
FlatList,
|
|
1295
|
-
{
|
|
1296
|
-
removeClippedSubviews: true,
|
|
1297
|
-
keyExtractor: (item) => item.value,
|
|
1298
|
-
renderItem,
|
|
1299
|
-
data: options.filter(
|
|
1300
|
-
(item) => search.length > 1 ? item.label.toLowerCase().indexOf(search.toLowerCase()) > -1 : item
|
|
1301
|
-
).sort((a, b) => a.label.localeCompare(b.label))
|
|
1302
|
-
}
|
|
1303
|
-
)), /* @__PURE__ */ React14.createElement(View9, { style: styles2.footer }, /* @__PURE__ */ React14.createElement(
|
|
1304
|
-
Button_default,
|
|
1421
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1422
|
+
Popup,
|
|
1305
1423
|
{
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1424
|
+
open,
|
|
1425
|
+
onClose,
|
|
1426
|
+
title: label,
|
|
1427
|
+
disableAutoKeyboardManagement: true
|
|
1428
|
+
},
|
|
1429
|
+
/* @__PURE__ */ React14.createElement(View9, { style: styles.content }, /* @__PURE__ */ React14.createElement(View9, { style: styles.header }, helperText && /* @__PURE__ */ React14.createElement(Typography_default, { variant: "body2", color: "textSecondary", gutterBottom: 5 }, helperText), searchEnabled && /* @__PURE__ */ React14.createElement(
|
|
1430
|
+
TextField_default,
|
|
1431
|
+
{
|
|
1432
|
+
label: searchPlaceholder,
|
|
1433
|
+
value: search,
|
|
1434
|
+
type: "search",
|
|
1435
|
+
onChangeText: setSearch,
|
|
1436
|
+
variant: "outlined"
|
|
1437
|
+
}
|
|
1438
|
+
)), /* @__PURE__ */ React14.createElement(
|
|
1439
|
+
FlatList,
|
|
1440
|
+
{
|
|
1441
|
+
removeClippedSubviews: true,
|
|
1442
|
+
keyExtractor: (item) => item.value,
|
|
1443
|
+
bounces: false,
|
|
1444
|
+
renderItem,
|
|
1445
|
+
data: options.filter(
|
|
1446
|
+
(item) => search.length > 1 ? item.label.toLowerCase().indexOf(search.toLowerCase()) > -1 : item
|
|
1447
|
+
).sort((a, b) => a.label.localeCompare(b.label))
|
|
1448
|
+
}
|
|
1449
|
+
))
|
|
1450
|
+
);
|
|
1313
1451
|
};
|
|
1314
1452
|
var SelectMenu_default = SelectMenu;
|
|
1315
1453
|
|
|
@@ -1339,32 +1477,33 @@ var TextField = ({
|
|
|
1339
1477
|
gutterBottom = 0,
|
|
1340
1478
|
end,
|
|
1341
1479
|
options,
|
|
1480
|
+
selectMenuProps,
|
|
1342
1481
|
...props
|
|
1343
1482
|
}) => {
|
|
1344
1483
|
const colors2 = useColors();
|
|
1345
|
-
const [focused, setFocused] =
|
|
1484
|
+
const [focused, setFocused] = useState7(false);
|
|
1346
1485
|
const height = moderateScale3(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1);
|
|
1347
|
-
const labelAnim =
|
|
1348
|
-
new
|
|
1486
|
+
const labelAnim = useRef2(
|
|
1487
|
+
new Animated3.Value(height / moderateScale3(variant === "text" ? 2.5 : 3.2))
|
|
1349
1488
|
).current;
|
|
1350
1489
|
React15.useEffect(() => {
|
|
1351
1490
|
if (focused || value) {
|
|
1352
|
-
|
|
1491
|
+
Animated3.timing(labelAnim, {
|
|
1353
1492
|
toValue: verticalScale2(variant === "text" ? 2 : 4),
|
|
1354
1493
|
duration: 300,
|
|
1355
1494
|
useNativeDriver: false
|
|
1356
1495
|
}).start();
|
|
1357
1496
|
} else {
|
|
1358
|
-
|
|
1497
|
+
Animated3.timing(labelAnim, {
|
|
1359
1498
|
toValue: height / moderateScale3(variant === "text" ? 2.5 : 3.2),
|
|
1360
1499
|
duration: 300,
|
|
1361
1500
|
useNativeDriver: false
|
|
1362
1501
|
}).start();
|
|
1363
1502
|
}
|
|
1364
1503
|
}, [focused, value]);
|
|
1365
|
-
const
|
|
1504
|
+
const styles = ScaledSheet12.create({
|
|
1366
1505
|
root: {
|
|
1367
|
-
marginBottom: gutterBottom
|
|
1506
|
+
marginBottom: ms7(gutterBottom),
|
|
1368
1507
|
width: "100%",
|
|
1369
1508
|
...style
|
|
1370
1509
|
},
|
|
@@ -1388,7 +1527,7 @@ var TextField = ({
|
|
|
1388
1527
|
paddingLeft: variant === "text" ? 0 : moderateScale3(15),
|
|
1389
1528
|
paddingRight: moderateScale3(10),
|
|
1390
1529
|
paddingTop: "11@vs",
|
|
1391
|
-
fontFamily:
|
|
1530
|
+
fontFamily: getFontFamily(400),
|
|
1392
1531
|
color: colors2.black[1],
|
|
1393
1532
|
zIndex: 10
|
|
1394
1533
|
// backgroundColor: "#284",
|
|
@@ -1400,7 +1539,7 @@ var TextField = ({
|
|
|
1400
1539
|
paddingTop: "13@ms"
|
|
1401
1540
|
},
|
|
1402
1541
|
label: {
|
|
1403
|
-
fontFamily:
|
|
1542
|
+
fontFamily: getFontFamily(400),
|
|
1404
1543
|
position: "absolute",
|
|
1405
1544
|
left: variant === "text" ? 0 : moderateScale3(15),
|
|
1406
1545
|
fontSize: focused || value ? "10@s" : "13@s",
|
|
@@ -1444,13 +1583,13 @@ var TextField = ({
|
|
|
1444
1583
|
autoCapitalize: "none",
|
|
1445
1584
|
textContentType: "password"
|
|
1446
1585
|
} : {};
|
|
1447
|
-
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style:
|
|
1586
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style: styles.root }, /* @__PURE__ */ React15.createElement(
|
|
1448
1587
|
TouchableOpacity7,
|
|
1449
1588
|
{
|
|
1450
1589
|
onPress: () => setFocused(true),
|
|
1451
|
-
style:
|
|
1590
|
+
style: styles.container
|
|
1452
1591
|
},
|
|
1453
|
-
/* @__PURE__ */ React15.createElement(
|
|
1592
|
+
/* @__PURE__ */ React15.createElement(Animated3.Text, { style: { ...styles.label, top: labelAnim } }, label),
|
|
1454
1593
|
start,
|
|
1455
1594
|
options ? /* @__PURE__ */ React15.createElement(
|
|
1456
1595
|
View10,
|
|
@@ -1461,13 +1600,13 @@ var TextField = ({
|
|
|
1461
1600
|
View10,
|
|
1462
1601
|
{
|
|
1463
1602
|
style: {
|
|
1464
|
-
paddingTop: variant !== "outlined" ?
|
|
1603
|
+
paddingTop: variant !== "outlined" ? ms7(13) : 0,
|
|
1465
1604
|
paddingRight: 10
|
|
1466
1605
|
}
|
|
1467
1606
|
},
|
|
1468
1607
|
options.find((cur) => cur.value === value)?.start
|
|
1469
1608
|
),
|
|
1470
|
-
/* @__PURE__ */ React15.createElement(Typography_default, { style:
|
|
1609
|
+
/* @__PURE__ */ React15.createElement(Typography_default, { style: styles.inputText }, options.find((cur) => cur.value === value)?.label)
|
|
1471
1610
|
) : /* @__PURE__ */ React15.createElement(
|
|
1472
1611
|
TextInput2,
|
|
1473
1612
|
{
|
|
@@ -1488,7 +1627,7 @@ var TextField = ({
|
|
|
1488
1627
|
placeholderTextColor: colors2.textSecondary.main,
|
|
1489
1628
|
...formProps,
|
|
1490
1629
|
...props,
|
|
1491
|
-
style:
|
|
1630
|
+
style: styles.input
|
|
1492
1631
|
}
|
|
1493
1632
|
),
|
|
1494
1633
|
end && /* @__PURE__ */ React15.createElement(
|
|
@@ -1496,7 +1635,7 @@ var TextField = ({
|
|
|
1496
1635
|
{
|
|
1497
1636
|
style: {
|
|
1498
1637
|
marginRight: 20,
|
|
1499
|
-
paddingTop: variant === "text" ?
|
|
1638
|
+
paddingTop: variant === "text" ? ms7(13) : 0
|
|
1500
1639
|
}
|
|
1501
1640
|
},
|
|
1502
1641
|
end
|
|
@@ -1506,7 +1645,7 @@ var TextField = ({
|
|
|
1506
1645
|
{
|
|
1507
1646
|
style: {
|
|
1508
1647
|
marginRight: variant === "text" ? 0 : 20,
|
|
1509
|
-
paddingTop: variant === "text" ?
|
|
1648
|
+
paddingTop: variant === "text" ? ms7(13) : 0
|
|
1510
1649
|
}
|
|
1511
1650
|
},
|
|
1512
1651
|
/* @__PURE__ */ React15.createElement(
|
|
@@ -1522,11 +1661,11 @@ var TextField = ({
|
|
|
1522
1661
|
Typography_default,
|
|
1523
1662
|
{
|
|
1524
1663
|
color: "textSecondary",
|
|
1525
|
-
style:
|
|
1664
|
+
style: styles.helperText,
|
|
1526
1665
|
variant: "caption"
|
|
1527
1666
|
},
|
|
1528
1667
|
helperText
|
|
1529
|
-
), error && /* @__PURE__ */ React15.createElement(View10, { style:
|
|
1668
|
+
), error && /* @__PURE__ */ React15.createElement(View10, { style: styles.error }, /* @__PURE__ */ React15.createElement(MaterialIcons5, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.errorText, color: "error" }, error))), options && /* @__PURE__ */ React15.createElement(
|
|
1530
1669
|
SelectMenu_default,
|
|
1531
1670
|
{
|
|
1532
1671
|
options,
|
|
@@ -1535,13 +1674,15 @@ var TextField = ({
|
|
|
1535
1674
|
onClose: () => setFocused(false),
|
|
1536
1675
|
label,
|
|
1537
1676
|
helperText,
|
|
1538
|
-
onChange: onChangeText
|
|
1677
|
+
onChange: onChangeText,
|
|
1678
|
+
...selectMenuProps
|
|
1539
1679
|
}
|
|
1540
1680
|
));
|
|
1541
1681
|
};
|
|
1542
1682
|
var TextField2 = React15.forwardRef(
|
|
1543
1683
|
({
|
|
1544
1684
|
label,
|
|
1685
|
+
labelProps,
|
|
1545
1686
|
keyboardType,
|
|
1546
1687
|
color = "primary",
|
|
1547
1688
|
value,
|
|
@@ -1565,20 +1706,21 @@ var TextField2 = React15.forwardRef(
|
|
|
1565
1706
|
end,
|
|
1566
1707
|
options,
|
|
1567
1708
|
multiline,
|
|
1709
|
+
selectMenuProps,
|
|
1568
1710
|
...props
|
|
1569
1711
|
}, ref) => {
|
|
1570
1712
|
const colors2 = useColors();
|
|
1571
|
-
const [focused, _setFocused] =
|
|
1572
|
-
const [showPassword, setShowPassword] =
|
|
1713
|
+
const [focused, _setFocused] = useState7(false);
|
|
1714
|
+
const [showPassword, setShowPassword] = useState7(false);
|
|
1573
1715
|
const height = moderateScale3(
|
|
1574
1716
|
multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1575
1717
|
);
|
|
1576
1718
|
const setFocused = (value2) => {
|
|
1577
1719
|
_setFocused(value2);
|
|
1578
1720
|
};
|
|
1579
|
-
const
|
|
1721
|
+
const styles = ScaledSheet12.create({
|
|
1580
1722
|
root: {
|
|
1581
|
-
marginBottom: gutterBottom
|
|
1723
|
+
marginBottom: ms7(gutterBottom),
|
|
1582
1724
|
...style
|
|
1583
1725
|
},
|
|
1584
1726
|
container: {
|
|
@@ -1651,14 +1793,23 @@ var TextField2 = React15.forwardRef(
|
|
|
1651
1793
|
autoCapitalize: "none",
|
|
1652
1794
|
textContentType: "password"
|
|
1653
1795
|
} : {};
|
|
1654
|
-
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style:
|
|
1796
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style: styles.root }, label && /* @__PURE__ */ React15.createElement(
|
|
1797
|
+
Typography_default,
|
|
1798
|
+
{
|
|
1799
|
+
variant: "body2",
|
|
1800
|
+
color: "textSecondary",
|
|
1801
|
+
gutterBottom: 7,
|
|
1802
|
+
...labelProps
|
|
1803
|
+
},
|
|
1804
|
+
label
|
|
1805
|
+
), /* @__PURE__ */ React15.createElement(
|
|
1655
1806
|
TouchableOpacity7,
|
|
1656
1807
|
{
|
|
1657
1808
|
onPress: () => setFocused(true),
|
|
1658
|
-
style:
|
|
1809
|
+
style: styles.container
|
|
1659
1810
|
},
|
|
1660
1811
|
/* @__PURE__ */ React15.createElement(View10, { style: { marginTop: multiline ? 5 : 0 } }, start),
|
|
1661
|
-
options ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, value ? /* @__PURE__ */ React15.createElement(Typography_default, { style:
|
|
1812
|
+
options ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, value ? /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.inputText }, options.find((cur) => cur.value === value)?.label) : /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.placeholder }, placeholder), /* @__PURE__ */ React15.createElement(
|
|
1662
1813
|
Ionicons3,
|
|
1663
1814
|
{
|
|
1664
1815
|
name: "chevron-down",
|
|
@@ -1688,10 +1839,10 @@ var TextField2 = React15.forwardRef(
|
|
|
1688
1839
|
selectTextOnFocus: !disabled,
|
|
1689
1840
|
onSubmitEditing,
|
|
1690
1841
|
multiline,
|
|
1691
|
-
|
|
1842
|
+
extAlignVertical: multiline ? "top" : "center",
|
|
1692
1843
|
...formProps,
|
|
1693
1844
|
...props,
|
|
1694
|
-
style:
|
|
1845
|
+
style: styles.input
|
|
1695
1846
|
}
|
|
1696
1847
|
),
|
|
1697
1848
|
end ? /* @__PURE__ */ React15.createElement(View10, { style: { marginRight: 20 } }, end) : type === "password" && /* @__PURE__ */ React15.createElement(
|
|
@@ -1713,11 +1864,11 @@ var TextField2 = React15.forwardRef(
|
|
|
1713
1864
|
Typography_default,
|
|
1714
1865
|
{
|
|
1715
1866
|
color: "textSecondary",
|
|
1716
|
-
style:
|
|
1867
|
+
style: styles.helperText,
|
|
1717
1868
|
variant: "caption"
|
|
1718
1869
|
},
|
|
1719
1870
|
helperText
|
|
1720
|
-
), error && /* @__PURE__ */ React15.createElement(View10, { style:
|
|
1871
|
+
), error && /* @__PURE__ */ React15.createElement(View10, { style: styles.error }, /* @__PURE__ */ React15.createElement(MaterialIcons5, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.errorText, color: "error" }, error))), options && /* @__PURE__ */ React15.createElement(
|
|
1721
1872
|
SelectMenu_default,
|
|
1722
1873
|
{
|
|
1723
1874
|
options,
|
|
@@ -1726,7 +1877,8 @@ var TextField2 = React15.forwardRef(
|
|
|
1726
1877
|
onClose: () => setFocused(false),
|
|
1727
1878
|
label,
|
|
1728
1879
|
helperText,
|
|
1729
|
-
onChange: onChangeText
|
|
1880
|
+
onChange: onChangeText,
|
|
1881
|
+
...selectMenuProps
|
|
1730
1882
|
}
|
|
1731
1883
|
));
|
|
1732
1884
|
}
|
|
@@ -1794,11 +1946,11 @@ var Locator = ({
|
|
|
1794
1946
|
country = "ng"
|
|
1795
1947
|
}) => {
|
|
1796
1948
|
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1797
|
-
const [changed, setChanged] =
|
|
1798
|
-
const [value, setValue] =
|
|
1799
|
-
const [prediction, setPrediction] =
|
|
1949
|
+
const [changed, setChanged] = useState8(false);
|
|
1950
|
+
const [value, setValue] = useState8("");
|
|
1951
|
+
const [prediction, setPrediction] = useState8([]);
|
|
1800
1952
|
const colors2 = useColors();
|
|
1801
|
-
const
|
|
1953
|
+
const styles = ScaledSheet13.create({
|
|
1802
1954
|
list: {
|
|
1803
1955
|
backgroundColor: colors2.white[2],
|
|
1804
1956
|
elevation: 10,
|
|
@@ -1806,7 +1958,8 @@ var Locator = ({
|
|
|
1806
1958
|
shadowOpacity: 0.1,
|
|
1807
1959
|
shadowRadius: float ? 15 : 0,
|
|
1808
1960
|
shadowOffset: {
|
|
1809
|
-
height: 10
|
|
1961
|
+
height: 10,
|
|
1962
|
+
width: 0
|
|
1810
1963
|
},
|
|
1811
1964
|
borderRadius: 10,
|
|
1812
1965
|
marginBottom: 10,
|
|
@@ -1865,7 +2018,7 @@ var Locator = ({
|
|
|
1865
2018
|
setChanged(false);
|
|
1866
2019
|
setPrediction([]);
|
|
1867
2020
|
};
|
|
1868
|
-
|
|
2021
|
+
useEffect5(() => {
|
|
1869
2022
|
if (!GOOGLE_MAP_API_KEY)
|
|
1870
2023
|
console.error(
|
|
1871
2024
|
"Google map api key needs to be set to use this component \nMake sure to run initialize() with a valid google map api key"
|
|
@@ -1911,7 +2064,7 @@ var Locator = ({
|
|
|
1911
2064
|
}
|
|
1912
2065
|
)), /* @__PURE__ */ React16.createElement(TouchableOpacity8, { onPress: clear }, /* @__PURE__ */ React16.createElement(Ionicons4, { color: colors2.dark.main, size: 18, name: "close" })))
|
|
1913
2066
|
}
|
|
1914
|
-
), prediction.length > 0 && /* @__PURE__ */ React16.createElement(View11, { style:
|
|
2067
|
+
), prediction.length > 0 && /* @__PURE__ */ React16.createElement(View11, { style: styles.list }, prediction.map(
|
|
1915
2068
|
(cur, i) => i < 5 && /* @__PURE__ */ React16.createElement(
|
|
1916
2069
|
ListItem,
|
|
1917
2070
|
{
|
|
@@ -1935,26 +2088,27 @@ var Locator = ({
|
|
|
1935
2088
|
};
|
|
1936
2089
|
|
|
1937
2090
|
// ../src/Components/SafeAreaView.tsx
|
|
1938
|
-
import { SafeAreaView as Safe } from "react-native";
|
|
1939
2091
|
import React17 from "react";
|
|
1940
|
-
import {
|
|
1941
|
-
import {
|
|
1942
|
-
var styles = StyleSheet3.create({
|
|
1943
|
-
droidSafeArea: {
|
|
1944
|
-
flex: 1,
|
|
1945
|
-
paddingTop: Platform6.OS === "android" ? moderateScale4(35) : 0
|
|
1946
|
-
}
|
|
1947
|
-
});
|
|
2092
|
+
import { useSafeAreaInsets as useSafeAreaInsets5 } from "react-native-safe-area-context";
|
|
2093
|
+
import { StyleSheet as StyleSheet3, View as View12 } from "react-native";
|
|
1948
2094
|
var SafeAreaView = ({
|
|
1949
2095
|
children,
|
|
1950
2096
|
style
|
|
1951
2097
|
}) => {
|
|
1952
|
-
|
|
2098
|
+
const { top, bottom } = useSafeAreaInsets5();
|
|
2099
|
+
const styles = StyleSheet3.create({
|
|
2100
|
+
root: {
|
|
2101
|
+
paddingTop: top,
|
|
2102
|
+
paddingBottom: bottom,
|
|
2103
|
+
flex: 1
|
|
2104
|
+
}
|
|
2105
|
+
});
|
|
2106
|
+
return /* @__PURE__ */ React17.createElement(View12, { style: [styles.root, style] }, children);
|
|
1953
2107
|
};
|
|
1954
2108
|
|
|
1955
2109
|
// ../src/Components/Divider.tsx
|
|
1956
|
-
import { View as
|
|
1957
|
-
import { ScaledSheet as ScaledSheet14, ms as
|
|
2110
|
+
import { View as View13 } from "react-native";
|
|
2111
|
+
import { ScaledSheet as ScaledSheet14, ms as ms8 } from "react-native-size-matters";
|
|
1958
2112
|
var Divider = ({
|
|
1959
2113
|
height = 1,
|
|
1960
2114
|
color = "textSecondary",
|
|
@@ -1962,20 +2116,20 @@ var Divider = ({
|
|
|
1962
2116
|
style
|
|
1963
2117
|
}) => {
|
|
1964
2118
|
const colors2 = useColors();
|
|
1965
|
-
const
|
|
2119
|
+
const styles = ScaledSheet14.create({
|
|
1966
2120
|
root: {
|
|
1967
2121
|
height,
|
|
1968
2122
|
backgroundColor: colors2[color].main,
|
|
1969
|
-
marginBottom:
|
|
2123
|
+
marginBottom: ms8(gutterBottom),
|
|
1970
2124
|
...style
|
|
1971
2125
|
}
|
|
1972
2126
|
});
|
|
1973
|
-
return /* @__PURE__ */ React.createElement(
|
|
2127
|
+
return /* @__PURE__ */ React.createElement(View13, { style: styles.root });
|
|
1974
2128
|
};
|
|
1975
2129
|
|
|
1976
2130
|
// ../src/Components/Spinner.tsx
|
|
1977
2131
|
import React18 from "react";
|
|
1978
|
-
import { ActivityIndicator as ActivityIndicator3, Dimensions
|
|
2132
|
+
import { ActivityIndicator as ActivityIndicator3, Dimensions, View as View14 } from "react-native";
|
|
1979
2133
|
import { ScaledSheet as ScaledSheet15 } from "react-native-size-matters";
|
|
1980
2134
|
var Spinner = ({
|
|
1981
2135
|
label,
|
|
@@ -1985,10 +2139,10 @@ var Spinner = ({
|
|
|
1985
2139
|
style = {}
|
|
1986
2140
|
}) => {
|
|
1987
2141
|
const colors2 = useColors();
|
|
1988
|
-
const
|
|
2142
|
+
const styles = ScaledSheet15.create({
|
|
1989
2143
|
root: {
|
|
1990
|
-
width: fullscreen ?
|
|
1991
|
-
height: fullscreen ?
|
|
2144
|
+
width: fullscreen ? Dimensions.get("screen").width : "100%",
|
|
2145
|
+
height: fullscreen ? Dimensions.get("screen").height : "100%",
|
|
1992
2146
|
left: 0,
|
|
1993
2147
|
bottom: 0,
|
|
1994
2148
|
zIndex: 100,
|
|
@@ -2011,7 +2165,7 @@ var Spinner = ({
|
|
|
2011
2165
|
color: color === "light" ? colors2.white[2] : colors2.black[4]
|
|
2012
2166
|
}
|
|
2013
2167
|
});
|
|
2014
|
-
return /* @__PURE__ */ React18.createElement(
|
|
2168
|
+
return /* @__PURE__ */ React18.createElement(View14, { style: styles.root }, /* @__PURE__ */ React18.createElement(View14, { style: styles.content }, /* @__PURE__ */ React18.createElement(ActivityIndicator3, { color: colors2[color].dark, size }), label && /* @__PURE__ */ React18.createElement(Typography_default, { style: styles.label }, label)));
|
|
2015
2169
|
};
|
|
2016
2170
|
var Spinner_default = Spinner;
|
|
2017
2171
|
|
|
@@ -2019,9 +2173,9 @@ var Spinner_default = Spinner;
|
|
|
2019
2173
|
import React19, { useMemo } from "react";
|
|
2020
2174
|
import {
|
|
2021
2175
|
TextInput as TextInput3,
|
|
2022
|
-
View as
|
|
2176
|
+
View as View15
|
|
2023
2177
|
} from "react-native";
|
|
2024
|
-
import { ScaledSheet as ScaledSheet16, ms as
|
|
2178
|
+
import { ScaledSheet as ScaledSheet16, ms as ms9 } from "react-native-size-matters";
|
|
2025
2179
|
var OTPInput = ({
|
|
2026
2180
|
length = 6,
|
|
2027
2181
|
onChange = () => {
|
|
@@ -2035,12 +2189,10 @@ var OTPInput = ({
|
|
|
2035
2189
|
() => Array(length).fill(0).map((_) => React19.createRef()),
|
|
2036
2190
|
[length]
|
|
2037
2191
|
);
|
|
2038
|
-
console.log("v", value);
|
|
2039
2192
|
const onChangeHandler = (val, index) => {
|
|
2040
2193
|
if (value.length >= length && val.length > 0)
|
|
2041
2194
|
return;
|
|
2042
2195
|
if (val.length > 1) {
|
|
2043
|
-
console.log("reached", val);
|
|
2044
2196
|
const digits = val.replace(/\D/g, "").slice(0, length);
|
|
2045
2197
|
onChange(digits);
|
|
2046
2198
|
if (digits.length === length) {
|
|
@@ -2066,24 +2218,24 @@ var OTPInput = ({
|
|
|
2066
2218
|
}
|
|
2067
2219
|
};
|
|
2068
2220
|
const colors2 = useColors();
|
|
2069
|
-
const
|
|
2221
|
+
const styles = ScaledSheet16.create({
|
|
2070
2222
|
root: {},
|
|
2071
2223
|
container: { flexDirection: "row" },
|
|
2072
2224
|
input: {
|
|
2073
|
-
height:
|
|
2074
|
-
width:
|
|
2225
|
+
height: ms9(size),
|
|
2226
|
+
width: ms9(size),
|
|
2075
2227
|
borderColor: colors2.white[5],
|
|
2076
2228
|
backgroundColor: variant === "contained" ? colors2.white[3] : void 0,
|
|
2077
2229
|
borderWidth: variant === "outlined" ? 1 : 0,
|
|
2078
2230
|
borderBottomWidth: variant === "contained" ? 0 : 1,
|
|
2079
|
-
marginHorizontal:
|
|
2231
|
+
marginHorizontal: ms9(spacing * 5),
|
|
2080
2232
|
textAlign: "center",
|
|
2081
2233
|
borderRadius: variant === "text" ? 0 : 10,
|
|
2082
2234
|
color: colors2.dark.main,
|
|
2083
|
-
fontSize:
|
|
2235
|
+
fontSize: ms9(size * 0.5)
|
|
2084
2236
|
}
|
|
2085
2237
|
});
|
|
2086
|
-
return /* @__PURE__ */ React19.createElement(
|
|
2238
|
+
return /* @__PURE__ */ React19.createElement(View15, { style: styles.root }, /* @__PURE__ */ React19.createElement(View15, { style: styles.container }, [...Array(length)].map((_, index) => /* @__PURE__ */ React19.createElement(
|
|
2087
2239
|
TextInput3,
|
|
2088
2240
|
{
|
|
2089
2241
|
ref: inputRefs[index],
|
|
@@ -2092,7 +2244,7 @@ var OTPInput = ({
|
|
|
2092
2244
|
blurOnSubmit: false,
|
|
2093
2245
|
keyboardType: "number-pad",
|
|
2094
2246
|
key: index,
|
|
2095
|
-
style: [
|
|
2247
|
+
style: [styles.input]
|
|
2096
2248
|
}
|
|
2097
2249
|
))));
|
|
2098
2250
|
};
|
|
@@ -2134,6 +2286,7 @@ export {
|
|
|
2134
2286
|
showFlashMessage,
|
|
2135
2287
|
useColors,
|
|
2136
2288
|
useNavScreenOptions,
|
|
2137
|
-
useTheme
|
|
2289
|
+
useTheme,
|
|
2290
|
+
useThemeContext
|
|
2138
2291
|
};
|
|
2139
2292
|
//# sourceMappingURL=index.mjs.map
|