@hoddy-ui/core 2.5.31 → 2.5.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/next/dist/index.d.mts +1 -0
- package/next/dist/index.d.ts +1 -0
- package/next/dist/index.js +78 -46
- package/next/dist/index.js.map +1 -1
- package/next/dist/index.mjs +98 -66
- package/next/dist/index.mjs.map +1 -1
- package/next/package.json +1 -1
- package/package.json +1 -1
- package/src/Components/Avatar.tsx +9 -3
- package/src/Components/Locator.tsx +2 -1
- package/src/theme/index.tsx +13 -5
package/next/dist/index.mjs
CHANGED
|
@@ -389,6 +389,7 @@ var UIThemeContext = createContext({
|
|
|
389
389
|
themeState: { mode: "default", value: "light" }
|
|
390
390
|
});
|
|
391
391
|
function themeReducer(state, { type, payload }) {
|
|
392
|
+
AsyncStorage.setItem("theme", type);
|
|
392
393
|
switch (type) {
|
|
393
394
|
case "dark":
|
|
394
395
|
return { mode: "dark", value: "dark" };
|
|
@@ -407,12 +408,20 @@ var ConfigureSystemUI = () => {
|
|
|
407
408
|
const config2 = getConfig();
|
|
408
409
|
if (colors2) {
|
|
409
410
|
SystemUI.setBackgroundColorAsync(colors2.white[1]);
|
|
410
|
-
if (Platform.OS === "android"
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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
|
+
}
|
|
414
418
|
} else {
|
|
415
|
-
NavigationBar.
|
|
419
|
+
NavigationBar.setBackgroundColorAsync(colors2.white[1]);
|
|
420
|
+
if (theme === "dark") {
|
|
421
|
+
NavigationBar.setButtonStyleAsync("light");
|
|
422
|
+
} else {
|
|
423
|
+
NavigationBar.setButtonStyleAsync("dark");
|
|
424
|
+
}
|
|
416
425
|
}
|
|
417
426
|
}
|
|
418
427
|
}
|
|
@@ -460,7 +469,6 @@ var UIThemeProvider = ({ children }) => {
|
|
|
460
469
|
};
|
|
461
470
|
|
|
462
471
|
// ../src/hooks.ts
|
|
463
|
-
import AsyncStorage2 from "@react-native-async-storage/async-storage";
|
|
464
472
|
var useColors = () => {
|
|
465
473
|
const { themeState } = useContext(UIThemeContext);
|
|
466
474
|
return colors(themeState.value);
|
|
@@ -475,10 +483,8 @@ var useThemeContext = () => {
|
|
|
475
483
|
const setTheme = (theme2) => {
|
|
476
484
|
if (theme2 === "default") {
|
|
477
485
|
themeDispatch?.({ type: "default", payload: colorScheme });
|
|
478
|
-
AsyncStorage2.setItem("theme", "default");
|
|
479
486
|
} else {
|
|
480
487
|
themeDispatch?.({ type: theme2 });
|
|
481
|
-
AsyncStorage2.setItem("theme", theme2);
|
|
482
488
|
}
|
|
483
489
|
};
|
|
484
490
|
return { theme, setTheme };
|
|
@@ -607,7 +613,7 @@ var AlertX_default = AlertX;
|
|
|
607
613
|
|
|
608
614
|
// ../src/Components/Avatar.tsx
|
|
609
615
|
import { AntDesign } from "@expo/vector-icons";
|
|
610
|
-
import React7 from "react";
|
|
616
|
+
import React7, { useState as useState3 } from "react";
|
|
611
617
|
import { Image, View as View3 } from "react-native";
|
|
612
618
|
import { ms as ms3, ScaledSheet as ScaledSheet3 } from "react-native-size-matters";
|
|
613
619
|
var Avatar = ({
|
|
@@ -619,6 +625,7 @@ var Avatar = ({
|
|
|
619
625
|
style = {}
|
|
620
626
|
}) => {
|
|
621
627
|
const colors2 = useColors();
|
|
628
|
+
const [imageError, setImageError] = useState3(false);
|
|
622
629
|
const styles = ScaledSheet3.create({
|
|
623
630
|
root: {
|
|
624
631
|
borderRadius: 150,
|
|
@@ -637,7 +644,15 @@ var Avatar = ({
|
|
|
637
644
|
width: "110%"
|
|
638
645
|
}
|
|
639
646
|
});
|
|
640
|
-
return /* @__PURE__ */ React7.createElement(View3, { style: styles.root }, source
|
|
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) }));
|
|
641
656
|
};
|
|
642
657
|
var Avatar_default = Avatar;
|
|
643
658
|
|
|
@@ -891,7 +906,7 @@ var FormWrapper = ({
|
|
|
891
906
|
// ../src/Components/StarRating.tsx
|
|
892
907
|
import { Ionicons as Ionicons2 } from "@expo/vector-icons";
|
|
893
908
|
import * as Haptics from "expo-haptics";
|
|
894
|
-
import { useEffect as useEffect4, useState as
|
|
909
|
+
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
895
910
|
import {
|
|
896
911
|
ActivityIndicator as ActivityIndicator2,
|
|
897
912
|
TextInput,
|
|
@@ -911,7 +926,7 @@ import {
|
|
|
911
926
|
TouchableWithoutFeedback as TouchableWithoutFeedback2,
|
|
912
927
|
View as View5
|
|
913
928
|
} from "react-native";
|
|
914
|
-
import React11, { useEffect as useEffect3, useState as
|
|
929
|
+
import React11, { useEffect as useEffect3, useState as useState4 } from "react";
|
|
915
930
|
import Animated2, {
|
|
916
931
|
LinearTransition,
|
|
917
932
|
runOnJS as runOnJS2,
|
|
@@ -932,13 +947,14 @@ var Popup = ({
|
|
|
932
947
|
},
|
|
933
948
|
style,
|
|
934
949
|
onModalShow,
|
|
935
|
-
onModalHide
|
|
950
|
+
onModalHide,
|
|
951
|
+
disableAutoKeyboardManagement = false
|
|
936
952
|
}) => {
|
|
937
953
|
const theme = useTheme();
|
|
938
954
|
const colors2 = useColors();
|
|
939
|
-
const [modalVisible, setModalVisible] =
|
|
940
|
-
const [modalOpen, setModalOpen] =
|
|
941
|
-
const [keyboardVisible, setKeyboardVisible] =
|
|
955
|
+
const [modalVisible, setModalVisible] = useState4(false);
|
|
956
|
+
const [modalOpen, setModalOpen] = useState4(false);
|
|
957
|
+
const [keyboardVisible, setKeyboardVisible] = useState4(false);
|
|
942
958
|
const { bottom } = useSafeAreaInsets3();
|
|
943
959
|
const backdropOpacity = useSharedValue2(0);
|
|
944
960
|
const contentTranslateY = useSharedValue2(1e3);
|
|
@@ -1060,27 +1076,34 @@ var Popup = ({
|
|
|
1060
1076
|
behavior: Platform5.OS === "ios" ? "padding" : "height",
|
|
1061
1077
|
keyboardVerticalOffset: keyboardVerticalOffset || keyboardVerticalOffsetValue
|
|
1062
1078
|
},
|
|
1063
|
-
/* @__PURE__ */ React11.createElement(
|
|
1064
|
-
|
|
1065
|
-
{
|
|
1066
|
-
style: [StyleSheet2.absoluteFill, { zIndex: 1 }],
|
|
1067
|
-
onPress: closeAction
|
|
1068
|
-
}
|
|
1069
|
-
), /* @__PURE__ */ React11.createElement(
|
|
1070
|
-
Animated2.View,
|
|
1079
|
+
/* @__PURE__ */ React11.createElement(
|
|
1080
|
+
TouchableWithoutFeedback2,
|
|
1071
1081
|
{
|
|
1072
|
-
|
|
1073
|
-
|
|
1082
|
+
onPress: Keyboard2.dismiss,
|
|
1083
|
+
disabled: disableAutoKeyboardManagement
|
|
1074
1084
|
},
|
|
1075
|
-
/* @__PURE__ */ React11.createElement(View5, { style: styles.
|
|
1076
|
-
|
|
1085
|
+
/* @__PURE__ */ React11.createElement(View5, { style: styles.root }, modalOpen && /* @__PURE__ */ React11.createElement(
|
|
1086
|
+
Pressable,
|
|
1077
1087
|
{
|
|
1078
|
-
|
|
1079
|
-
icon: "close",
|
|
1088
|
+
style: [StyleSheet2.absoluteFill, { zIndex: 1 }],
|
|
1080
1089
|
onPress: closeAction
|
|
1081
1090
|
}
|
|
1082
|
-
)
|
|
1083
|
-
|
|
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
|
+
)
|
|
1084
1107
|
))
|
|
1085
1108
|
);
|
|
1086
1109
|
};
|
|
@@ -1112,11 +1135,11 @@ var RatingInput = ({
|
|
|
1112
1135
|
rating = 0,
|
|
1113
1136
|
size = 16
|
|
1114
1137
|
}) => {
|
|
1115
|
-
const [showReviewsModal, setShowReviewsModal] =
|
|
1116
|
-
const [rate, setRate] =
|
|
1138
|
+
const [showReviewsModal, setShowReviewsModal] = useState5(false);
|
|
1139
|
+
const [rate, setRate] = useState5(0);
|
|
1117
1140
|
const colors2 = useColors();
|
|
1118
|
-
const [loading, setLoading] =
|
|
1119
|
-
const [review, setReview] =
|
|
1141
|
+
const [loading, setLoading] = useState5(false);
|
|
1142
|
+
const [review, setReview] = useState5("");
|
|
1120
1143
|
const styles = ScaledSheet8.create({
|
|
1121
1144
|
root: {
|
|
1122
1145
|
flexDirection: "row",
|
|
@@ -1259,7 +1282,7 @@ var Grid = ({
|
|
|
1259
1282
|
|
|
1260
1283
|
// ../src/Components/Locator.tsx
|
|
1261
1284
|
import { Ionicons as Ionicons4 } from "@expo/vector-icons";
|
|
1262
|
-
import React16, { useEffect as useEffect5, useState as
|
|
1285
|
+
import React16, { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1263
1286
|
import { Alert, TouchableOpacity as TouchableOpacity8, View as View11 } from "react-native";
|
|
1264
1287
|
|
|
1265
1288
|
// ../src/Components/List.tsx
|
|
@@ -1303,7 +1326,7 @@ var ListItem = ({
|
|
|
1303
1326
|
|
|
1304
1327
|
// ../src/Components/TextField.tsx
|
|
1305
1328
|
import { Ionicons as Ionicons3, MaterialIcons as MaterialIcons5 } from "@expo/vector-icons";
|
|
1306
|
-
import React15, { useRef as useRef2, useState as
|
|
1329
|
+
import React15, { useRef as useRef2, useState as useState7 } from "react";
|
|
1307
1330
|
import { Animated as Animated3, TextInput as TextInput2, TouchableOpacity as TouchableOpacity7, View as View10 } from "react-native";
|
|
1308
1331
|
import {
|
|
1309
1332
|
ScaledSheet as ScaledSheet12,
|
|
@@ -1314,7 +1337,7 @@ import {
|
|
|
1314
1337
|
|
|
1315
1338
|
// ../src/Components/SelectMenu.tsx
|
|
1316
1339
|
import { MaterialIcons as MaterialIcons4 } from "@expo/vector-icons";
|
|
1317
|
-
import React14, { useCallback, useState as
|
|
1340
|
+
import React14, { useCallback, useState as useState6 } from "react";
|
|
1318
1341
|
import { FlatList, TouchableOpacity as TouchableOpacity6, View as View9 } from "react-native";
|
|
1319
1342
|
import { useSafeAreaInsets as useSafeAreaInsets4 } from "react-native-safe-area-context";
|
|
1320
1343
|
import { ScaledSheet as ScaledSheet11 } from "react-native-size-matters";
|
|
@@ -1333,7 +1356,7 @@ var SelectMenu = ({
|
|
|
1333
1356
|
}) => {
|
|
1334
1357
|
const colors2 = useColors();
|
|
1335
1358
|
const { bottom } = useSafeAreaInsets4();
|
|
1336
|
-
const [search, setSearch] =
|
|
1359
|
+
const [search, setSearch] = useState6("");
|
|
1337
1360
|
const styles = ScaledSheet11.create({
|
|
1338
1361
|
header: {
|
|
1339
1362
|
marginBottom: "20@vs"
|
|
@@ -1395,27 +1418,36 @@ var SelectMenu = ({
|
|
|
1395
1418
|
),
|
|
1396
1419
|
[value, colors2]
|
|
1397
1420
|
);
|
|
1398
|
-
return /* @__PURE__ */ React14.createElement(
|
|
1399
|
-
|
|
1400
|
-
{
|
|
1401
|
-
label: searchPlaceholder,
|
|
1402
|
-
value: search,
|
|
1403
|
-
type: "search",
|
|
1404
|
-
onChangeText: setSearch,
|
|
1405
|
-
variant: "outlined"
|
|
1406
|
-
}
|
|
1407
|
-
)), /* @__PURE__ */ React14.createElement(
|
|
1408
|
-
FlatList,
|
|
1421
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1422
|
+
Popup,
|
|
1409
1423
|
{
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
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
|
+
);
|
|
1419
1451
|
};
|
|
1420
1452
|
var SelectMenu_default = SelectMenu;
|
|
1421
1453
|
|
|
@@ -1449,7 +1481,7 @@ var TextField = ({
|
|
|
1449
1481
|
...props
|
|
1450
1482
|
}) => {
|
|
1451
1483
|
const colors2 = useColors();
|
|
1452
|
-
const [focused, setFocused] =
|
|
1484
|
+
const [focused, setFocused] = useState7(false);
|
|
1453
1485
|
const height = moderateScale3(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1);
|
|
1454
1486
|
const labelAnim = useRef2(
|
|
1455
1487
|
new Animated3.Value(height / moderateScale3(variant === "text" ? 2.5 : 3.2))
|
|
@@ -1678,8 +1710,8 @@ var TextField2 = React15.forwardRef(
|
|
|
1678
1710
|
...props
|
|
1679
1711
|
}, ref) => {
|
|
1680
1712
|
const colors2 = useColors();
|
|
1681
|
-
const [focused, _setFocused] =
|
|
1682
|
-
const [showPassword, setShowPassword] =
|
|
1713
|
+
const [focused, _setFocused] = useState7(false);
|
|
1714
|
+
const [showPassword, setShowPassword] = useState7(false);
|
|
1683
1715
|
const height = moderateScale3(
|
|
1684
1716
|
multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1685
1717
|
);
|
|
@@ -1914,9 +1946,9 @@ var Locator = ({
|
|
|
1914
1946
|
country = "ng"
|
|
1915
1947
|
}) => {
|
|
1916
1948
|
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1917
|
-
const [changed, setChanged] =
|
|
1918
|
-
const [value, setValue] =
|
|
1919
|
-
const [prediction, setPrediction] =
|
|
1949
|
+
const [changed, setChanged] = useState8(false);
|
|
1950
|
+
const [value, setValue] = useState8("");
|
|
1951
|
+
const [prediction, setPrediction] = useState8([]);
|
|
1920
1952
|
const colors2 = useColors();
|
|
1921
1953
|
const styles = ScaledSheet13.create({
|
|
1922
1954
|
list: {
|