@hoddy-ui/next 2.0.27 → 2.0.28

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 CHANGED
@@ -4,61 +4,65 @@ var setExtraColors = (c) => extraColors = c;
4
4
  function colors(theme) {
5
5
  const lightColors = {
6
6
  white: {
7
- 1: "#fff",
7
+ 1: "#ffffff",
8
8
  2: "#f7f7f7",
9
- 3: "#eee",
10
- 4: "#ddd",
11
- 5: "#bbb"
9
+ 3: "#eeeeee",
10
+ 4: "#dddddd",
11
+ 5: "#bbbbbb",
12
+ ...extraColors?.light?.white
12
13
  },
13
14
  black: {
14
- 1: "#888",
15
- 2: "#777",
16
- 3: "#555",
17
- 4: "#333",
18
- 5: "#000"
15
+ 1: "#888888",
16
+ 2: "#777777",
17
+ 3: "#555555",
18
+ 4: "#333333",
19
+ 5: "#000000",
20
+ ...extraColors?.light?.black
19
21
  }
20
22
  };
21
23
  const darkColors = {
22
24
  black: {
23
- 1: "#fff",
25
+ 1: "#ffffff",
24
26
  2: "#f7f7f7",
25
- 3: "#eee",
26
- 4: "#ddd",
27
- 5: "#aaa"
27
+ 3: "#eeeeee",
28
+ 4: "#dddddd",
29
+ 5: "#aaaaaa",
30
+ ...extraColors?.dark?.black
28
31
  },
29
32
  white: {
30
- 1: "#000",
31
- 2: "#222",
32
- 3: "#333",
33
- 4: "#444",
34
- 5: "#555"
33
+ 1: "#060606",
34
+ 2: "#222222",
35
+ 3: "#333333",
36
+ 4: "#444444",
37
+ 5: "#555555",
38
+ ...extraColors?.dark?.white
35
39
  },
36
40
  dark: {
37
41
  main: "#f2f3f4",
38
- light: "#fff",
39
- dark: "#ddd",
40
- text: "#000",
42
+ light: "#ffffff",
43
+ dark: "#dddddd",
44
+ text: "#000000",
41
45
  ...extraColors?.dark?.dark
42
46
  },
43
47
  light: {
44
- main: "#111",
45
- light: "#555",
46
- dark: "#333",
47
- text: "#fff",
48
+ main: "#111111",
49
+ light: "#555555",
50
+ dark: "#333333",
51
+ text: "#ffffff",
48
52
  ...extraColors?.dark?.light
49
53
  },
50
54
  textSecondary: {
51
- main: "#666",
52
- light: "#777",
53
- dark: "#444",
54
- text: "#fff",
55
+ main: "#666666",
56
+ light: "#777777",
57
+ dark: "#444444",
58
+ text: "#ffffff",
55
59
  ...extraColors?.dark?.textSecondary
56
60
  },
57
61
  primary: {
58
- main: "#f80",
59
- light: "#FEFFD3",
60
- dark: "#fa0",
61
- text: "#fff",
62
+ main: "#ff8800",
63
+ light: "#feffd3",
64
+ dark: "#ffaa00",
65
+ text: "#ffffff",
62
66
  ...extraColors?.light?.primary,
63
67
  ...extraColors?.dark?.primary
64
68
  }
@@ -67,73 +71,73 @@ function colors(theme) {
67
71
  return {
68
72
  ...extraColors[theme],
69
73
  primary: {
70
- main: "#f80",
71
- light: "#FEFFD3",
72
- dark: "#fa0",
73
- text: "#fff",
74
+ main: "#ff8800",
75
+ light: "#feffd3",
76
+ dark: "#ffaa00",
77
+ text: "#ffffff",
74
78
  ...extraColors?.light?.primary
75
79
  },
76
80
  secondary: {
77
- main: "#f11",
78
- light: "#f43",
79
- dark: "#d00",
80
- text: "#fff",
81
+ main: "#ff1111",
82
+ light: "#ff4433",
83
+ dark: "#dd0000",
84
+ text: "#ffffff",
81
85
  ...extraColors?.light?.secondary
82
86
  },
83
87
  light: {
84
- main: "#fff",
85
- light: "#fff",
86
- dark: "#ddd",
87
- text: "#000",
88
+ main: "#ffffff",
89
+ light: "#ffffff",
90
+ dark: "#dddddd",
91
+ text: "#000000",
88
92
  ...extraColors?.light?.light
89
93
  },
90
94
  dark: {
91
- main: "#000",
92
- light: "#777",
93
- dark: "#111",
94
- text: "#fff",
95
+ main: "#000000",
96
+ light: "#777777",
97
+ dark: "#111111",
98
+ text: "#ffffff",
95
99
  ...extraColors?.light?.dark
96
100
  },
97
101
  textSecondary: {
98
- main: "#aaa",
99
- light: "#bbb",
100
- dark: "#777",
101
- text: "#123",
102
+ main: "#aaaaaa",
103
+ light: "#bbbbbb",
104
+ dark: "#777777",
105
+ text: "#112233",
102
106
  ...extraColors?.light?.textSecondary
103
107
  },
104
108
  blue: {
105
- main: "#09F",
106
- light: "#39f",
107
- dark: "#028",
108
- text: "#fff",
109
+ main: "#0099ff",
110
+ light: "#3399ff",
111
+ dark: "#002288",
112
+ text: "#ffffff",
109
113
  ...extraColors?.light?.blue
110
114
  },
111
115
  info: {
112
- main: "#09f",
113
- light: "#3af",
114
- dark: "#08a",
115
- text: "#fff",
116
+ main: "#0099ff",
117
+ light: "#33aaff",
118
+ dark: "#0088aa",
119
+ text: "#ffffff",
116
120
  ...extraColors?.light?.info
117
121
  },
118
122
  success: {
119
- main: "#0a4",
120
- text: "#fff",
121
- light: "#5c3",
122
- dark: "#062",
123
+ main: "#00aa44",
124
+ text: "#ffffff",
125
+ light: "#55cc33",
126
+ dark: "#006622",
123
127
  ...extraColors?.light?.success
124
128
  },
125
129
  warning: {
126
- main: "#fa2",
127
- light: "#fc7",
128
- dark: "#f90",
129
- text: "#fff",
130
+ main: "#ffaa22",
131
+ light: "#ffcc77",
132
+ dark: "#ff9900",
133
+ text: "#ffffff",
130
134
  ...extraColors?.light?.warning
131
135
  },
132
136
  error: {
133
- main: "#D22",
134
- text: "#fff",
135
- light: "#f43",
136
- dark: "#a20",
137
+ main: "#dd2222",
138
+ text: "#ffffff",
139
+ light: "#ff4433",
140
+ dark: "#aa2200",
137
141
  ...extraColors?.light?.error
138
142
  },
139
143
  ...dynamicColors
@@ -167,7 +171,7 @@ function initialize(config2) {
167
171
 
168
172
  // components/AdaptiveStatusBarNext.tsx
169
173
  import { useFocusEffect } from "expo-router";
170
- import React5, { useState as useState3 } from "react";
174
+ import React5, { useState as useState2 } from "react";
171
175
  import { Platform as Platform3, StatusBar } from "react-native";
172
176
 
173
177
  // ../src/hooks.ts
@@ -179,8 +183,9 @@ import { vs } from "react-native-size-matters";
179
183
  import AsyncStorage from "@react-native-async-storage/async-storage";
180
184
  import * as NavigationBar from "expo-navigation-bar";
181
185
  import * as SystemUI from "expo-system-ui";
182
- import React4, { createContext, useReducer } from "react";
186
+ import React4, { createContext, useEffect as useEffect2, useReducer } from "react";
183
187
  import { Platform, useColorScheme } from "react-native";
188
+ import { SafeAreaProvider } from "react-native-safe-area-context";
184
189
 
185
190
  // ../src/Components/FlashMessage.tsx
186
191
  import React3, { useEffect, useState } from "react";
@@ -232,8 +237,8 @@ var Typography = forwardRef(
232
237
  textTransform: textCase,
233
238
  alignItems: "center",
234
239
  textAlign: align,
235
- fontWeight: fontWeight.toString(),
236
- fontFamily: fontFamily || getConfig().DEFAULT_FONT_FAMILY || "System"
240
+ fontWeight,
241
+ fontFamily: fontFamily || getConfig().DEFAULT_FONT_FAMILY || void 0
237
242
  // Use custom font if provided, else default
238
243
  }
239
244
  });
@@ -314,24 +319,10 @@ var FlashMessage = () => {
314
319
  var FlashMessage_default = FlashMessage;
315
320
 
316
321
  // ../src/theme/index.tsx
317
- import { SafeAreaProvider } from "react-native-safe-area-context";
318
322
  var UIThemeContext = createContext({
319
323
  themeState: { mode: "default", value: "light" }
320
324
  });
321
325
  function themeReducer(state, { type, payload }) {
322
- if (payload === "dark" || type === "dark") {
323
- SystemUI.setBackgroundColorAsync("#000000");
324
- if (Platform.OS === "android") {
325
- NavigationBar.setButtonStyleAsync("light");
326
- NavigationBar.setBackgroundColorAsync("#000000");
327
- }
328
- } else {
329
- SystemUI.setBackgroundColorAsync("#ffffff");
330
- if (Platform.OS === "android") {
331
- NavigationBar.setButtonStyleAsync("dark");
332
- NavigationBar.setBackgroundColorAsync("#fff");
333
- }
334
- }
335
326
  switch (type) {
336
327
  case "dark":
337
328
  return { mode: "dark", value: "dark" };
@@ -343,6 +334,24 @@ function themeReducer(state, { type, payload }) {
343
334
  return state;
344
335
  }
345
336
  }
337
+ var ConfigureSystemUI = () => {
338
+ const theme = useTheme();
339
+ const colors2 = useColors();
340
+ useEffect2(() => {
341
+ if (colors2) {
342
+ SystemUI.setBackgroundColorAsync(colors2.white[1]);
343
+ if (Platform.OS === "android") {
344
+ NavigationBar.setBackgroundColorAsync(colors2.white[1]);
345
+ if (theme === "dark") {
346
+ NavigationBar.setButtonStyleAsync("light");
347
+ } else {
348
+ NavigationBar.setButtonStyleAsync("dark");
349
+ }
350
+ }
351
+ }
352
+ }, [colors2, theme]);
353
+ return /* @__PURE__ */ React4.createElement(React4.Fragment, null);
354
+ };
346
355
  var UIThemeProvider = ({ children }) => {
347
356
  const [themeState, themeDispatch] = useReducer(themeReducer, {
348
357
  mode: "default",
@@ -378,7 +387,8 @@ var UIThemeProvider = ({ children }) => {
378
387
  }
379
388
  },
380
389
  children,
381
- /* @__PURE__ */ React4.createElement(FlashMessage_default, null)
390
+ /* @__PURE__ */ React4.createElement(FlashMessage_default, null),
391
+ /* @__PURE__ */ React4.createElement(ConfigureSystemUI, null)
382
392
  ));
383
393
  };
384
394
 
@@ -393,6 +403,7 @@ var useTheme = () => {
393
403
  };
394
404
  var useNavScreenOptions = (type) => {
395
405
  const colors2 = useColors();
406
+ const theme = useTheme();
396
407
  const options = {
397
408
  stack: {
398
409
  headerShown: false,
@@ -412,7 +423,7 @@ var useNavScreenOptions = (type) => {
412
423
  headerShown: false,
413
424
  headerTintColor: colors2.dark.main,
414
425
  tabBarStyle: {
415
- borderTopColor: colors2.white[3],
426
+ borderTopColor: theme === "dark" ? colors2.light.main : colors2.white[2],
416
427
  borderTopWidth: 1,
417
428
  // shadowColor: "#000",
418
429
  // shadowOffset: { height: -3, width: 0 },
@@ -453,7 +464,7 @@ var useNavScreenOptions = (type) => {
453
464
 
454
465
  // components/AdaptiveStatusBarNext.tsx
455
466
  var AdaptiveStatusBar = ({ translucent = false }) => {
456
- const [focused, setFocused] = useState3(false);
467
+ const [focused, setFocused] = useState2(false);
457
468
  const colors2 = useColors();
458
469
  const theme = useTheme();
459
470
  useFocusEffect(
@@ -665,7 +676,7 @@ var Button = forwardRef2(
665
676
  alignItems: "center",
666
677
  alignSelf: "flex-start",
667
678
  justifyContent: "center",
668
- backgroundColor: variant === "text" || variant === "outlined" ? null : translucent ? translucent === "dark" ? colors2.white[3] + "2" : colors2.black[3] + "2" : loading ? colors2[color].light : disabled ? colors2.white[4] : colors2[color].main,
679
+ backgroundColor: variant === "text" || variant === "outlined" ? null : translucent ? translucent === "dark" ? colors2.white[3] + "22" : colors2.black[3] + "22" : loading ? colors2[color].light : disabled ? colors2.white[4] : colors2[color].main,
669
680
  borderRadius: rounded ? 30 : 10,
670
681
  elevation: variant === "text" ? 0 : elevation,
671
682
  paddingVertical: size === "small" ? 8 : size === "large" ? "15@ms" : "13@ms",
@@ -806,7 +817,7 @@ var FormWrapper = ({
806
817
  // ../src/Components/StarRating.tsx
807
818
  import { Ionicons as Ionicons2 } from "@expo/vector-icons";
808
819
  import * as Haptics from "expo-haptics";
809
- import { useEffect as useEffect2, useState as useState5 } from "react";
820
+ import { useEffect as useEffect3, useState as useState4 } from "react";
810
821
  import {
811
822
  ActivityIndicator as ActivityIndicator2,
812
823
  TextInput,
@@ -826,7 +837,7 @@ import {
826
837
  TouchableWithoutFeedback as TouchableWithoutFeedback2,
827
838
  View as View5
828
839
  } from "react-native";
829
- import React11, { useState as useState4 } from "react";
840
+ import React11, { useState as useState3 } from "react";
830
841
  import { ScaledSheet as ScaledSheet7 } from "react-native-size-matters";
831
842
  var Popup = ({
832
843
  title,
@@ -836,11 +847,13 @@ var Popup = ({
836
847
  children,
837
848
  open,
838
849
  onClose = () => {
839
- }
850
+ },
851
+ style
840
852
  }) => {
853
+ const theme = useTheme();
841
854
  const colors2 = useColors();
842
- const [show, setShow] = useState4(open);
843
- const [showSecondary, setShowSecondary] = useState4(false);
855
+ const [show, setShow] = useState3(open);
856
+ const [showSecondary, setShowSecondary] = useState3(false);
844
857
  const styles2 = ScaledSheet7.create({
845
858
  root: {
846
859
  height: "100%",
@@ -857,12 +870,13 @@ var Popup = ({
857
870
  },
858
871
  container: {
859
872
  paddingBottom: sheet ? "30@ms" : 0,
860
- backgroundColor: colors2.white[2],
873
+ backgroundColor: theme === "dark" ? "#111" : colors2.white[2],
861
874
  borderTopLeftRadius: 20,
862
875
  borderTopRightRadius: 20,
863
876
  borderBottomRightRadius: sheet ? 0 : 20,
864
877
  borderBottomLeftRadius: sheet ? 0 : 20,
865
- width: "100%"
878
+ width: "100%",
879
+ ...style
866
880
  },
867
881
  content: {
868
882
  paddingHorizontal: bare ? void 0 : "10@ms"
@@ -972,11 +986,11 @@ var RatingInput = ({
972
986
  rating = 0,
973
987
  size = 16
974
988
  }) => {
975
- const [showReviewsModal, setShowReviewsModal] = useState5(false);
976
- const [rate, setRate] = useState5(0);
989
+ const [showReviewsModal, setShowReviewsModal] = useState4(false);
990
+ const [rate, setRate] = useState4(0);
977
991
  const colors2 = useColors();
978
- const [loading, setLoading] = useState5(false);
979
- const [review, setReview] = useState5("");
992
+ const [loading, setLoading] = useState4(false);
993
+ const [review, setReview] = useState4("");
980
994
  const styles2 = ScaledSheet8.create({
981
995
  root: {
982
996
  flexDirection: "row",
@@ -994,7 +1008,7 @@ var RatingInput = ({
994
1008
  height: "100@vs"
995
1009
  }
996
1010
  });
997
- useEffect2(() => {
1011
+ useEffect3(() => {
998
1012
  setRate(rating);
999
1013
  }, [rating]);
1000
1014
  const onRate = (index) => {
@@ -1119,7 +1133,7 @@ var Grid = ({
1119
1133
 
1120
1134
  // ../src/Components/Locator.tsx
1121
1135
  import { Ionicons as Ionicons4 } from "@expo/vector-icons";
1122
- import React16, { useEffect as useEffect3, useState as useState8 } from "react";
1136
+ import React16, { useEffect as useEffect4, useState as useState7 } from "react";
1123
1137
  import { Alert, TouchableOpacity as TouchableOpacity8, View as View11 } from "react-native";
1124
1138
 
1125
1139
  // ../src/Components/List.tsx
@@ -1141,7 +1155,7 @@ var ListItem = ({
1141
1155
  flexDirection: "row",
1142
1156
  alignItems: "center",
1143
1157
  paddingHorizontal: "10@s",
1144
- borderBottomColor: colors2.white[4],
1158
+ borderBottomColor: colors2.white[2],
1145
1159
  borderBottomWidth: divider ? 1 : 0,
1146
1160
  paddingVertical: "10@vs"
1147
1161
  }
@@ -1163,7 +1177,7 @@ var ListItem = ({
1163
1177
 
1164
1178
  // ../src/Components/TextField.tsx
1165
1179
  import { Ionicons as Ionicons3, MaterialIcons as MaterialIcons5 } from "@expo/vector-icons";
1166
- import React15, { useRef, useState as useState7 } from "react";
1180
+ import React15, { useRef, useState as useState6 } from "react";
1167
1181
  import { Animated, TextInput as TextInput2, TouchableOpacity as TouchableOpacity7, View as View10 } from "react-native";
1168
1182
  import {
1169
1183
  ScaledSheet as ScaledSheet12,
@@ -1174,7 +1188,7 @@ import {
1174
1188
 
1175
1189
  // ../src/Components/SelectMenu.tsx
1176
1190
  import { MaterialIcons as MaterialIcons4 } from "@expo/vector-icons";
1177
- import React14, { useCallback, useState as useState6 } from "react";
1191
+ import React14, { useCallback, useState as useState5 } from "react";
1178
1192
  import { FlatList, Modal as Modal2, TouchableOpacity as TouchableOpacity6, View as View9 } from "react-native";
1179
1193
  import { useSafeAreaInsets as useSafeAreaInsets2 } from "react-native-safe-area-context";
1180
1194
  import { ScaledSheet as ScaledSheet11 } from "react-native-size-matters";
@@ -1191,7 +1205,7 @@ var SelectMenu = ({
1191
1205
  }) => {
1192
1206
  const colors2 = useColors();
1193
1207
  const { bottom } = useSafeAreaInsets2();
1194
- const [search, setSearch] = useState6("");
1208
+ const [search, setSearch] = useState5("");
1195
1209
  const styles2 = ScaledSheet11.create({
1196
1210
  root: {
1197
1211
  backgroundColor: colors2.white[1],
@@ -1225,7 +1239,7 @@ var SelectMenu = ({
1225
1239
  {
1226
1240
  style: {
1227
1241
  ...styles2.option,
1228
- backgroundColor: item.value === value ? colors2.blue.light + "2" : colors2.white[2]
1242
+ backgroundColor: item.value === value ? colors2.blue.light + "22" : colors2.white[2]
1229
1243
  },
1230
1244
  onPress: () => {
1231
1245
  onChange(item.value);
@@ -1327,7 +1341,7 @@ var TextField = ({
1327
1341
  ...props
1328
1342
  }) => {
1329
1343
  const colors2 = useColors();
1330
- const [focused, setFocused] = useState7(false);
1344
+ const [focused, setFocused] = useState6(false);
1331
1345
  const height = moderateScale3(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1);
1332
1346
  const labelAnim = useRef(
1333
1347
  new Animated.Value(height / moderateScale3(variant === "text" ? 2.5 : 3.2))
@@ -1551,8 +1565,8 @@ var TextField2 = ({
1551
1565
  ...props
1552
1566
  }) => {
1553
1567
  const colors2 = useColors();
1554
- const [focused, _setFocused] = useState7(false);
1555
- const [showPassword, setShowPassword] = useState7(false);
1568
+ const [focused, _setFocused] = useState6(false);
1569
+ const [showPassword, setShowPassword] = useState6(false);
1556
1570
  const height = moderateScale3(
1557
1571
  props.multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
1558
1572
  );
@@ -1714,11 +1728,6 @@ var TextField_default = TextField;
1714
1728
  // ../src/Components/Locator.tsx
1715
1729
  import * as Location from "expo-location";
1716
1730
  import { ScaledSheet as ScaledSheet13 } from "react-native-size-matters";
1717
- setTimeout(() => {
1718
- const { GOOGLE_MAP_API_KEY } = getConfig();
1719
- if (GOOGLE_MAP_API_KEY)
1720
- Location.setGoogleApiKey(GOOGLE_MAP_API_KEY);
1721
- }, 500);
1722
1731
  var getPredictionsFromCoords = async (coords) => {
1723
1732
  const { GOOGLE_MAP_API_KEY } = getConfig();
1724
1733
  if (!GOOGLE_MAP_API_KEY)
@@ -1756,9 +1765,9 @@ var Locator = ({
1756
1765
  country = "ng"
1757
1766
  }) => {
1758
1767
  const { GOOGLE_MAP_API_KEY } = getConfig();
1759
- const [changed, setChanged] = useState8(false);
1760
- const [value, setValue] = useState8("");
1761
- const [prediction, setPrediction] = useState8([]);
1768
+ const [changed, setChanged] = useState7(false);
1769
+ const [value, setValue] = useState7("");
1770
+ const [prediction, setPrediction] = useState7([]);
1762
1771
  const colors2 = useColors();
1763
1772
  const styles2 = ScaledSheet13.create({
1764
1773
  list: {
@@ -1838,7 +1847,7 @@ var Locator = ({
1838
1847
  setChanged(false);
1839
1848
  setPrediction([]);
1840
1849
  };
1841
- useEffect3(() => {
1850
+ useEffect4(() => {
1842
1851
  if (!GOOGLE_MAP_API_KEY)
1843
1852
  console.error(
1844
1853
  "Google map api key needs to be set to use this component \nMake sure to run initialize() with a valid google map api key"
@@ -1968,7 +1977,7 @@ var Spinner = ({
1968
1977
  alignItems: "center",
1969
1978
  justifyContent: "center",
1970
1979
  position: fullscreen ? "absolute" : "relative",
1971
- backgroundColor: fullscreen ? colors2.white[1] + "d" : void 0,
1980
+ backgroundColor: fullscreen ? colors2.white[1] + "dd" : void 0,
1972
1981
  ...style
1973
1982
  },
1974
1983
  content: {