@hoddy-ui/core 1.0.100 → 1.1.1

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.
@@ -55,7 +55,9 @@ __export(next_exports, {
55
55
  UIThemeContext: () => UIThemeContext,
56
56
  UIThemeProvider: () => UIThemeProvider,
57
57
  default: () => next_default,
58
+ getLocationFromPlaceId: () => getLocationFromPlaceId,
58
59
  getPredictionsFromCoords: () => getPredictionsFromCoords,
60
+ getPredictionsFromQuery: () => getPredictionsFromQuery,
59
61
  showFlashMessage: () => showFlashMessage,
60
62
  useColors: () => useColors,
61
63
  useNavScreenOptions: () => useNavScreenOptions,
@@ -69,61 +71,65 @@ var setExtraColors = (c) => extraColors = c;
69
71
  function colors(theme) {
70
72
  const lightColors = {
71
73
  white: {
72
- 1: "#fff",
74
+ 1: "#ffffff",
73
75
  2: "#f7f7f7",
74
- 3: "#eee",
75
- 4: "#ddd",
76
- 5: "#bbb"
76
+ 3: "#eeeeee",
77
+ 4: "#dddddd",
78
+ 5: "#bbbbbb",
79
+ ...extraColors?.light?.white
77
80
  },
78
81
  black: {
79
- 1: "#888",
80
- 2: "#777",
81
- 3: "#555",
82
- 4: "#333",
83
- 5: "#000"
82
+ 1: "#888888",
83
+ 2: "#777777",
84
+ 3: "#555555",
85
+ 4: "#333333",
86
+ 5: "#000000",
87
+ ...extraColors?.light?.black
84
88
  }
85
89
  };
86
90
  const darkColors = {
87
91
  black: {
88
- 1: "#fff",
92
+ 1: "#ffffff",
89
93
  2: "#f7f7f7",
90
- 3: "#eee",
91
- 4: "#ddd",
92
- 5: "#aaa"
94
+ 3: "#eeeeee",
95
+ 4: "#dddddd",
96
+ 5: "#aaaaaa",
97
+ ...extraColors?.dark?.black
93
98
  },
94
99
  white: {
95
- 1: "#000",
96
- 2: "#222",
97
- 3: "#333",
98
- 4: "#444",
99
- 5: "#555"
100
+ 1: "#060606",
101
+ 2: "#222222",
102
+ 3: "#333333",
103
+ 4: "#444444",
104
+ 5: "#555555",
105
+ ...extraColors?.dark?.white
100
106
  },
101
107
  dark: {
102
108
  main: "#f2f3f4",
103
- light: "#fff",
104
- dark: "#ddd",
105
- text: "#000",
109
+ light: "#ffffff",
110
+ dark: "#dddddd",
111
+ text: "#000000",
106
112
  ...extraColors?.dark?.dark
107
113
  },
108
114
  light: {
109
- main: "#111",
110
- light: "#555",
111
- dark: "#333",
112
- text: "#fff",
115
+ main: "#111111",
116
+ light: "#555555",
117
+ dark: "#333333",
118
+ text: "#ffffff",
113
119
  ...extraColors?.dark?.light
114
120
  },
115
121
  textSecondary: {
116
- main: "#666",
117
- light: "#777",
118
- dark: "#444",
119
- text: "#fff",
122
+ main: "#666666",
123
+ light: "#777777",
124
+ dark: "#444444",
125
+ text: "#ffffff",
120
126
  ...extraColors?.dark?.textSecondary
121
127
  },
122
128
  primary: {
123
- main: "#f80",
124
- light: "#FEFFD3",
125
- dark: "#fa0",
126
- text: "#fff",
129
+ main: "#ff8800",
130
+ light: "#feffd3",
131
+ dark: "#ffaa00",
132
+ text: "#ffffff",
127
133
  ...extraColors?.light?.primary,
128
134
  ...extraColors?.dark?.primary
129
135
  }
@@ -132,73 +138,73 @@ function colors(theme) {
132
138
  return {
133
139
  ...extraColors[theme],
134
140
  primary: {
135
- main: "#f80",
136
- light: "#FEFFD3",
137
- dark: "#fa0",
138
- text: "#fff",
141
+ main: "#ff8800",
142
+ light: "#feffd3",
143
+ dark: "#ffaa00",
144
+ text: "#ffffff",
139
145
  ...extraColors?.light?.primary
140
146
  },
141
147
  secondary: {
142
- main: "#f11",
143
- light: "#f43",
144
- dark: "#d00",
145
- text: "#fff",
148
+ main: "#ff1111",
149
+ light: "#ff4433",
150
+ dark: "#dd0000",
151
+ text: "#ffffff",
146
152
  ...extraColors?.light?.secondary
147
153
  },
148
154
  light: {
149
- main: "#fff",
150
- light: "#fff",
151
- dark: "#ddd",
152
- text: "#000",
155
+ main: "#ffffff",
156
+ light: "#ffffff",
157
+ dark: "#dddddd",
158
+ text: "#000000",
153
159
  ...extraColors?.light?.light
154
160
  },
155
161
  dark: {
156
- main: "#000",
157
- light: "#777",
158
- dark: "#111",
159
- text: "#fff",
162
+ main: "#000000",
163
+ light: "#777777",
164
+ dark: "#111111",
165
+ text: "#ffffff",
160
166
  ...extraColors?.light?.dark
161
167
  },
162
168
  textSecondary: {
163
- main: "#aaa",
164
- light: "#bbb",
165
- dark: "#777",
166
- text: "#123",
169
+ main: "#aaaaaa",
170
+ light: "#bbbbbb",
171
+ dark: "#777777",
172
+ text: "#112233",
167
173
  ...extraColors?.light?.textSecondary
168
174
  },
169
175
  blue: {
170
- main: "#09F",
171
- light: "#39f",
172
- dark: "#028",
173
- text: "#fff",
176
+ main: "#0099ff",
177
+ light: "#3399ff",
178
+ dark: "#002288",
179
+ text: "#ffffff",
174
180
  ...extraColors?.light?.blue
175
181
  },
176
182
  info: {
177
- main: "#09f",
178
- light: "#3af",
179
- dark: "#08a",
180
- text: "#fff",
183
+ main: "#0099ff",
184
+ light: "#33aaff",
185
+ dark: "#0088aa",
186
+ text: "#ffffff",
181
187
  ...extraColors?.light?.info
182
188
  },
183
189
  success: {
184
- main: "#0a4",
185
- text: "#fff",
186
- light: "#5c3",
187
- dark: "#062",
190
+ main: "#00aa44",
191
+ text: "#ffffff",
192
+ light: "#55cc33",
193
+ dark: "#006622",
188
194
  ...extraColors?.light?.success
189
195
  },
190
196
  warning: {
191
- main: "#fa2",
192
- light: "#fc7",
193
- dark: "#f90",
194
- text: "#fff",
197
+ main: "#ffaa22",
198
+ light: "#ffcc77",
199
+ dark: "#ff9900",
200
+ text: "#ffffff",
195
201
  ...extraColors?.light?.warning
196
202
  },
197
203
  error: {
198
- main: "#D22",
199
- text: "#fff",
200
- light: "#f43",
201
- dark: "#a20",
204
+ main: "#dd2222",
205
+ text: "#ffffff",
206
+ light: "#ff4433",
207
+ dark: "#aa2200",
202
208
  ...extraColors?.light?.error
203
209
  },
204
210
  ...dynamicColors
@@ -207,7 +213,8 @@ function colors(theme) {
207
213
 
208
214
  // ../src/config/KeyManager.ts
209
215
  var config = {
210
- GOOGLE_MAP_API_KEY: ""
216
+ GOOGLE_MAP_API_KEY: "",
217
+ EDGE_TO_EDGE: false
211
218
  };
212
219
  function setConfig(key) {
213
220
  config = key;
@@ -221,7 +228,8 @@ function initialize(config2) {
221
228
  try {
222
229
  setConfig({
223
230
  GOOGLE_MAP_API_KEY: config2.googleMapApiKey,
224
- DEFAULT_FONT_FAMILY: config2.fontFamily
231
+ DEFAULT_FONT_FAMILY: config2.fontFamily,
232
+ EDGE_TO_EDGE: config2.edgeToEdge ?? false
225
233
  });
226
234
  if (config2.colors)
227
235
  setExtraColors(config2.colors);
@@ -246,6 +254,7 @@ var NavigationBar = __toESM(require("expo-navigation-bar"));
246
254
  var SystemUI = __toESM(require("expo-system-ui"));
247
255
  var import_react3 = __toESM(require("react"));
248
256
  var import_react_native3 = require("react-native");
257
+ var import_react_native_safe_area_context2 = require("react-native-safe-area-context");
249
258
 
250
259
  // ../src/Components/FlashMessage.tsx
251
260
  var import_react2 = __toESM(require("react"));
@@ -266,7 +275,6 @@ var Typography = (0, import_react.forwardRef)(
266
275
  variant = "body1",
267
276
  align = "left",
268
277
  gutterBottom = 0,
269
- numberOfLines,
270
278
  adjustsFontSizeToFit,
271
279
  fontWeight = 400,
272
280
  fontFamily,
@@ -293,8 +301,8 @@ var Typography = (0, import_react.forwardRef)(
293
301
  textTransform: textCase,
294
302
  alignItems: "center",
295
303
  textAlign: align,
296
- fontWeight: fontWeight.toString(),
297
- fontFamily: fontFamily || getConfig().DEFAULT_FONT_FAMILY || "System"
304
+ fontWeight,
305
+ fontFamily: fontFamily || getConfig().DEFAULT_FONT_FAMILY || void 0
298
306
  // Use custom font if provided, else default
299
307
  }
300
308
  });
@@ -302,7 +310,6 @@ var Typography = (0, import_react.forwardRef)(
302
310
  import_react_native.Text,
303
311
  {
304
312
  ref,
305
- numberOfLines,
306
313
  adjustsFontSizeToFit,
307
314
  style: [styles2.text, style],
308
315
  ...props
@@ -375,24 +382,10 @@ var FlashMessage = () => {
375
382
  var FlashMessage_default = FlashMessage;
376
383
 
377
384
  // ../src/theme/index.tsx
378
- var import_react_native_safe_area_context2 = require("react-native-safe-area-context");
379
385
  var UIThemeContext = (0, import_react3.createContext)({
380
386
  themeState: { mode: "default", value: "light" }
381
387
  });
382
388
  function themeReducer(state, { type, payload }) {
383
- if (payload === "dark" || type === "dark") {
384
- SystemUI.setBackgroundColorAsync("#000000");
385
- if (import_react_native3.Platform.OS === "android") {
386
- NavigationBar.setButtonStyleAsync("light");
387
- NavigationBar.setBackgroundColorAsync("#000000");
388
- }
389
- } else {
390
- SystemUI.setBackgroundColorAsync("#ffffff");
391
- if (import_react_native3.Platform.OS === "android") {
392
- NavigationBar.setButtonStyleAsync("dark");
393
- NavigationBar.setBackgroundColorAsync("#fff");
394
- }
395
- }
396
389
  switch (type) {
397
390
  case "dark":
398
391
  return { mode: "dark", value: "dark" };
@@ -404,6 +397,25 @@ function themeReducer(state, { type, payload }) {
404
397
  return state;
405
398
  }
406
399
  }
400
+ var ConfigureSystemUI = () => {
401
+ const theme = useTheme();
402
+ const colors2 = useColors();
403
+ (0, import_react3.useEffect)(() => {
404
+ const config2 = getConfig();
405
+ if (colors2) {
406
+ SystemUI.setBackgroundColorAsync(colors2.white[1]);
407
+ if (import_react_native3.Platform.OS === "android" && !config2.EDGE_TO_EDGE) {
408
+ NavigationBar.setBackgroundColorAsync(colors2.white[1]);
409
+ if (theme === "dark") {
410
+ NavigationBar.setButtonStyleAsync("light");
411
+ } else {
412
+ NavigationBar.setButtonStyleAsync("dark");
413
+ }
414
+ }
415
+ }
416
+ }, [colors2, theme]);
417
+ return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null);
418
+ };
407
419
  var UIThemeProvider = ({ children }) => {
408
420
  const [themeState, themeDispatch] = (0, import_react3.useReducer)(themeReducer, {
409
421
  mode: "default",
@@ -439,7 +451,8 @@ var UIThemeProvider = ({ children }) => {
439
451
  }
440
452
  },
441
453
  children,
442
- /* @__PURE__ */ import_react3.default.createElement(FlashMessage_default, null)
454
+ /* @__PURE__ */ import_react3.default.createElement(FlashMessage_default, null),
455
+ /* @__PURE__ */ import_react3.default.createElement(ConfigureSystemUI, null)
443
456
  ));
444
457
  };
445
458
 
@@ -454,6 +467,7 @@ var useTheme = () => {
454
467
  };
455
468
  var useNavScreenOptions = (type) => {
456
469
  const colors2 = useColors();
470
+ const theme = useTheme();
457
471
  const options = {
458
472
  stack: {
459
473
  headerShown: false,
@@ -473,7 +487,7 @@ var useNavScreenOptions = (type) => {
473
487
  headerShown: false,
474
488
  headerTintColor: colors2.dark.main,
475
489
  tabBarStyle: {
476
- borderTopColor: colors2.white[3],
490
+ borderTopColor: theme === "dark" ? colors2.light.main : colors2.white[2],
477
491
  borderTopWidth: 1,
478
492
  // shadowColor: "#000",
479
493
  // shadowOffset: { height: -3, width: 0 },
@@ -517,25 +531,22 @@ var AdaptiveStatusBar = ({ translucent = false }) => {
517
531
  const [focused, setFocused] = (0, import_react5.useState)(false);
518
532
  const colors2 = useColors();
519
533
  const theme = useTheme();
534
+ const statusbarHandler = () => {
535
+ import_react_native5.StatusBar.setBarStyle(theme === "dark" ? "light-content" : "dark-content");
536
+ if (import_react_native5.Platform.OS === "android") {
537
+ import_react_native5.StatusBar.setBackgroundColor(
538
+ translucent ? "transparent" : colors2.white[1]
539
+ );
540
+ import_react_native5.StatusBar.setTranslucent(true);
541
+ }
542
+ };
520
543
  (0, import_expo_router.useFocusEffect)(
521
544
  import_react5.default.useCallback(() => {
522
- import_react_native5.StatusBar.setBarStyle(
523
- theme === "dark" ? "light-content" : "dark-content"
524
- );
525
- if (import_react_native5.Platform.OS === "android") {
526
- import_react_native5.StatusBar.setBackgroundColor(
527
- colors2.white[1] + (translucent ? "0" : "")
528
- );
529
- import_react_native5.StatusBar.setTranslucent(true);
530
- }
545
+ statusbarHandler();
531
546
  }, [theme])
532
547
  );
533
548
  import_react5.default.useEffect(() => {
534
- import_react_native5.StatusBar.setBarStyle(theme === "dark" ? "light-content" : "dark-content");
535
- if (import_react_native5.Platform.OS === "android") {
536
- import_react_native5.StatusBar.setBackgroundColor(colors2.white[1] + (translucent ? "0" : ""));
537
- import_react_native5.StatusBar.setTranslucent(true);
538
- }
549
+ statusbarHandler();
539
550
  }, [theme]);
540
551
  return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null);
541
552
  };
@@ -726,7 +737,7 @@ var Button = (0, import_react8.forwardRef)(
726
737
  alignItems: "center",
727
738
  alignSelf: "flex-start",
728
739
  justifyContent: "center",
729
- 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,
740
+ 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,
730
741
  borderRadius: rounded ? 30 : 10,
731
742
  elevation: variant === "text" ? 0 : elevation,
732
743
  paddingVertical: size === "small" ? 8 : size === "large" ? "15@ms" : "13@ms",
@@ -877,8 +888,10 @@ var Popup = ({
877
888
  children,
878
889
  open,
879
890
  onClose = () => {
880
- }
891
+ },
892
+ style
881
893
  }) => {
894
+ const theme = useTheme();
882
895
  const colors2 = useColors();
883
896
  const [show, setShow] = (0, import_react11.useState)(open);
884
897
  const [showSecondary, setShowSecondary] = (0, import_react11.useState)(false);
@@ -898,23 +911,27 @@ var Popup = ({
898
911
  },
899
912
  container: {
900
913
  paddingBottom: sheet ? "30@ms" : 0,
901
- backgroundColor: colors2.white[2],
914
+ backgroundColor: theme === "dark" ? "#111" : colors2.white[2],
902
915
  borderTopLeftRadius: 20,
903
916
  borderTopRightRadius: 20,
904
917
  borderBottomRightRadius: sheet ? 0 : 20,
905
918
  borderBottomLeftRadius: sheet ? 0 : 20,
906
- width: "100%"
919
+ width: "100%",
920
+ ...style
907
921
  },
908
922
  content: {
909
- paddingHorizontal: bare ? void 0 : "10@ms"
923
+ paddingHorizontal: bare ? void 0 : "15@ms"
910
924
  // flex: 1,
911
925
  },
912
926
  title: {
913
927
  flexDirection: "row",
914
928
  alignItems: "center",
915
- paddingVertical: "5@ms",
916
- paddingHorizontal: "10@ms",
917
- marginBottom: "10@ms"
929
+ justifyContent: "center",
930
+ height: "50@ms"
931
+ },
932
+ titleIcon: {
933
+ position: "absolute",
934
+ left: "15@ms"
918
935
  },
919
936
  backdrop: {
920
937
  position: "absolute",
@@ -973,14 +990,14 @@ var Popup = ({
973
990
  keyboardVerticalOffset,
974
991
  behavior: import_react_native11.Platform.OS === "ios" ? "position" : "padding"
975
992
  },
976
- /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.container }, !bare && /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.title }, /* @__PURE__ */ import_react11.default.createElement(
993
+ /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.container }, !bare && /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.title }, /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.titleIcon }, /* @__PURE__ */ import_react11.default.createElement(
977
994
  IconButton,
978
995
  {
979
996
  size: 20,
980
997
  icon: "close",
981
998
  onPress: closeAction
982
999
  }
983
- ), /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: { flex: 1 } }, /* @__PURE__ */ import_react11.default.createElement(Typography_default, { color: "textSecondary", align: "center" }, title))), /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.content }, children))
1000
+ )), /* @__PURE__ */ import_react11.default.createElement(Typography_default, { align: "center", fontWeight: 500 }, title)), /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.content }, children))
984
1001
  )))
985
1002
  ))
986
1003
  ));
@@ -1182,7 +1199,7 @@ var ListItem = ({
1182
1199
  flexDirection: "row",
1183
1200
  alignItems: "center",
1184
1201
  paddingHorizontal: "10@s",
1185
- borderBottomColor: colors2.white[4],
1202
+ borderBottomColor: colors2.white[2],
1186
1203
  borderBottomWidth: divider ? 1 : 0,
1187
1204
  paddingVertical: "10@vs"
1188
1205
  }
@@ -1261,7 +1278,7 @@ var SelectMenu = ({
1261
1278
  {
1262
1279
  style: {
1263
1280
  ...styles2.option,
1264
- backgroundColor: item.value === value ? colors2.blue.light + "2" : colors2.white[2]
1281
+ backgroundColor: item.value === value ? colors2.blue.light + "22" : colors2.white[2]
1265
1282
  },
1266
1283
  onPress: () => {
1267
1284
  onChange(item.value);
@@ -1560,201 +1577,203 @@ var TextField = ({
1560
1577
  }
1561
1578
  ));
1562
1579
  };
1563
- var TextField2 = ({
1564
- label,
1565
- keyboardType,
1566
- color = "primary",
1567
- value,
1568
- type,
1569
- helperText,
1570
- onChangeText,
1571
- onSubmitEditing = () => {
1572
- },
1573
- onFocus = () => {
1574
- },
1575
- onBlur = () => {
1576
- },
1577
- error,
1578
- start,
1579
- rounded,
1580
- disabled = false,
1581
- style = {},
1582
- inputStyles = {},
1583
- gutterBottom = 8,
1584
- placeholder,
1585
- end,
1586
- options,
1587
- ...props
1588
- }) => {
1589
- const colors2 = useColors();
1590
- const [focused, _setFocused] = (0, import_react16.useState)(false);
1591
- const [showPassword, setShowPassword] = (0, import_react16.useState)(false);
1592
- const height = (0, import_react_native_size_matters14.moderateScale)(
1593
- props.multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
1594
- );
1595
- const setFocused = (value2) => {
1596
- _setFocused(value2);
1597
- };
1598
- const styles2 = import_react_native_size_matters14.ScaledSheet.create({
1599
- root: {
1600
- marginBottom: gutterBottom + "@vs",
1601
- ...style
1602
- },
1603
- container: {
1604
- height,
1605
- overflow: "hidden",
1606
- flexDirection: "row",
1607
- borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[5],
1608
- borderWidth: error ? 1 : focused ? 2 : 1,
1609
- width: "100%",
1610
- borderRadius: rounded ? 30 : 10,
1611
- alignItems: "center",
1612
- ...inputStyles
1613
- },
1614
- input: {
1615
- fontSize: "14@s",
1616
- flex: 1,
1617
- alignSelf: "stretch",
1618
- paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10),
1619
- paddingRight: (0, import_react_native_size_matters14.moderateScale)(10),
1620
- color: colors2.dark.main,
1621
- zIndex: 10
1622
- // backgroundColor: "#284",
1623
- },
1624
- inputText: {
1625
- fontSize: "14@ms",
1626
- color: colors2.dark.main,
1627
- paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
1628
- },
1629
- placeholder: {
1630
- fontSize: "14@ms",
1631
- color: colors2.textSecondary.main,
1632
- paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
1633
- },
1634
- label: {},
1635
- helperText: {
1636
- paddingHorizontal: "15@s",
1637
- color: focused ? colors2[color].dark : "#fffa",
1638
- paddingTop: "4@ms"
1580
+ var TextField2 = import_react16.default.forwardRef(
1581
+ ({
1582
+ label,
1583
+ keyboardType,
1584
+ color = "primary",
1585
+ value,
1586
+ type,
1587
+ helperText,
1588
+ onChangeText,
1589
+ onSubmitEditing = () => {
1639
1590
  },
1640
- error: {
1641
- paddingLeft: 10,
1642
- paddingRight: 10,
1643
- paddingTop: 5,
1644
- flexDirection: "row",
1645
- alignItems: "center"
1591
+ onFocus = () => {
1646
1592
  },
1647
- errorText: {
1648
- fontSize: 12,
1649
- marginLeft: 10
1650
- }
1651
- });
1652
- const formProps = type === "email" ? {
1653
- textContentType: "emailAddress",
1654
- keyboardType: "email-address",
1655
- autoCapitalize: "none",
1656
- autoCompleteType: "email"
1657
- } : type === "number" ? {
1658
- keyboardType: "numeric"
1659
- } : type === "tel" ? {
1660
- textContentType: "telephoneNumber",
1661
- keyboardType: "phone-pad"
1662
- } : type === "search" ? {
1663
- keyboardType: "web-search",
1664
- returnKeyType: "search",
1665
- autoCapitalize: "none"
1666
- } : type === "password" ? {
1667
- secureTextEntry: !showPassword,
1668
- autoCompleteType: "password",
1669
- autoCapitalize: "none",
1670
- textContentType: "password"
1671
- } : {};
1672
- return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.root }, label && /* @__PURE__ */ import_react16.default.createElement(Typography_default, { variant: "body1", color: "textSecondary", gutterBottom: 7 }, label), /* @__PURE__ */ import_react16.default.createElement(
1673
- import_react_native16.TouchableOpacity,
1674
- {
1675
- onPress: () => setFocused(true),
1676
- style: styles2.container
1593
+ onBlur = () => {
1677
1594
  },
1595
+ error,
1678
1596
  start,
1679
- options ? /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, value ? /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.inputText }, options.find((cur) => cur.value === value)?.label) : /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.placeholder }, placeholder), /* @__PURE__ */ import_react16.default.createElement(
1680
- import_vector_icons8.Ionicons,
1681
- {
1682
- name: "chevron-down",
1683
- size: 24,
1684
- style: { marginLeft: "auto", marginRight: 15 },
1685
- color: colors2.dark.light
1686
- }
1687
- )) : /* @__PURE__ */ import_react16.default.createElement(
1688
- import_react_native16.TextInput,
1689
- {
1690
- onFocus: () => {
1691
- onFocus();
1692
- setFocused(true);
1693
- },
1694
- onBlur: () => {
1695
- onBlur();
1696
- setFocused(false);
1697
- },
1698
- value,
1699
- onChangeText,
1700
- key: showPassword ? "show" : "hide",
1701
- keyboardType,
1702
- placeholderTextColor: colors2.textSecondary.main,
1703
- editable: !disabled,
1704
- placeholder,
1705
- selectTextOnFocus: !disabled,
1706
- onSubmitEditing,
1707
- ...formProps,
1708
- ...props,
1709
- style: styles2.input
1597
+ rounded,
1598
+ disabled = false,
1599
+ style = {},
1600
+ inputStyles = {},
1601
+ gutterBottom = 8,
1602
+ placeholder,
1603
+ end,
1604
+ options,
1605
+ multiline,
1606
+ ...props
1607
+ }, ref) => {
1608
+ const colors2 = useColors();
1609
+ const [focused, _setFocused] = (0, import_react16.useState)(false);
1610
+ const [showPassword, setShowPassword] = (0, import_react16.useState)(false);
1611
+ const height = (0, import_react_native_size_matters14.moderateScale)(
1612
+ multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
1613
+ );
1614
+ const setFocused = (value2) => {
1615
+ _setFocused(value2);
1616
+ };
1617
+ const styles2 = import_react_native_size_matters14.ScaledSheet.create({
1618
+ root: {
1619
+ marginBottom: gutterBottom + "@vs",
1620
+ ...style
1621
+ },
1622
+ container: {
1623
+ height,
1624
+ overflow: "hidden",
1625
+ flexDirection: "row",
1626
+ borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[4],
1627
+ borderWidth: error ? 1 : focused ? 2 : 1,
1628
+ width: "100%",
1629
+ borderRadius: rounded ? 30 : 10,
1630
+ alignItems: multiline ? "flex-start" : "center",
1631
+ paddingVertical: multiline ? 10 : 0,
1632
+ ...inputStyles
1633
+ },
1634
+ input: {
1635
+ fontSize: "14@s",
1636
+ flex: 1,
1637
+ alignSelf: "stretch",
1638
+ paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10),
1639
+ paddingRight: (0, import_react_native_size_matters14.moderateScale)(10),
1640
+ color: colors2.dark.main,
1641
+ zIndex: 10
1642
+ // backgroundColor: "#284",
1643
+ },
1644
+ inputText: {
1645
+ fontSize: "14@ms",
1646
+ color: colors2.dark.main,
1647
+ paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
1648
+ },
1649
+ placeholder: {
1650
+ fontSize: "14@ms",
1651
+ color: colors2.textSecondary.light,
1652
+ paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
1653
+ },
1654
+ label: {},
1655
+ helperText: {
1656
+ paddingHorizontal: "15@s",
1657
+ color: focused ? colors2[color].dark : "#fffa",
1658
+ paddingTop: "4@ms"
1659
+ },
1660
+ error: {
1661
+ paddingLeft: 10,
1662
+ paddingRight: 10,
1663
+ paddingTop: 5,
1664
+ flexDirection: "row",
1665
+ alignItems: "center"
1666
+ },
1667
+ errorText: {
1668
+ fontSize: 12,
1669
+ marginLeft: 10
1710
1670
  }
1711
- ),
1712
- end ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginRight: 20 } }, end) : type === "password" && /* @__PURE__ */ import_react16.default.createElement(
1671
+ });
1672
+ const formProps = type === "email" ? {
1673
+ textContentType: "emailAddress",
1674
+ keyboardType: "email-address",
1675
+ autoCapitalize: "none",
1676
+ autoCompleteType: "email"
1677
+ } : type === "number" ? {
1678
+ keyboardType: "numeric"
1679
+ } : type === "tel" ? {
1680
+ textContentType: "telephoneNumber",
1681
+ keyboardType: "phone-pad"
1682
+ } : type === "search" ? {
1683
+ keyboardType: "web-search",
1684
+ returnKeyType: "search",
1685
+ autoCapitalize: "none"
1686
+ } : type === "password" ? {
1687
+ secureTextEntry: !showPassword,
1688
+ autoCompleteType: "password",
1689
+ autoCapitalize: "none",
1690
+ textContentType: "password"
1691
+ } : {};
1692
+ return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.root }, label && /* @__PURE__ */ import_react16.default.createElement(Typography_default, { variant: "body1", color: "textSecondary", gutterBottom: 7 }, label), /* @__PURE__ */ import_react16.default.createElement(
1713
1693
  import_react_native16.TouchableOpacity,
1714
1694
  {
1715
- style: { marginRight: 20 },
1716
- onPress: () => setShowPassword(!showPassword)
1695
+ onPress: () => setFocused(true),
1696
+ style: styles2.container
1717
1697
  },
1718
- /* @__PURE__ */ import_react16.default.createElement(
1698
+ /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginTop: multiline ? 5 : 0 } }, start),
1699
+ options ? /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, value ? /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.inputText }, options.find((cur) => cur.value === value)?.label) : /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.placeholder }, placeholder), /* @__PURE__ */ import_react16.default.createElement(
1719
1700
  import_vector_icons8.Ionicons,
1720
1701
  {
1721
- name: showPassword ? "eye-outline" : "eye-off-outline",
1702
+ name: "chevron-down",
1722
1703
  size: 24,
1723
- color: colors2.textSecondary.main
1704
+ style: { marginLeft: "auto", marginRight: 15 },
1705
+ color: colors2.dark.light
1706
+ }
1707
+ )) : /* @__PURE__ */ import_react16.default.createElement(
1708
+ import_react_native16.TextInput,
1709
+ {
1710
+ ref,
1711
+ onFocus: () => {
1712
+ onFocus();
1713
+ setFocused(true);
1714
+ },
1715
+ onBlur: () => {
1716
+ onBlur();
1717
+ setFocused(false);
1718
+ },
1719
+ value,
1720
+ onChangeText,
1721
+ key: showPassword ? "show" : "hide",
1722
+ keyboardType,
1723
+ placeholderTextColor: colors2.textSecondary.light,
1724
+ editable: !disabled,
1725
+ placeholder,
1726
+ selectTextOnFocus: !disabled,
1727
+ onSubmitEditing,
1728
+ multiline,
1729
+ textAlignVertical: multiline ? "top" : "center",
1730
+ ...formProps,
1731
+ ...props,
1732
+ style: styles2.input
1724
1733
  }
1734
+ ),
1735
+ end ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginRight: 20 } }, end) : type === "password" && /* @__PURE__ */ import_react16.default.createElement(
1736
+ import_react_native16.TouchableOpacity,
1737
+ {
1738
+ style: { marginRight: 20 },
1739
+ onPress: () => setShowPassword(!showPassword)
1740
+ },
1741
+ /* @__PURE__ */ import_react16.default.createElement(
1742
+ import_vector_icons8.Ionicons,
1743
+ {
1744
+ name: showPassword ? "eye-outline" : "eye-off-outline",
1745
+ size: 24,
1746
+ color: colors2.textSecondary.main
1747
+ }
1748
+ )
1725
1749
  )
1726
- )
1727
- ), helperText && /* @__PURE__ */ import_react16.default.createElement(
1728
- Typography_default,
1729
- {
1730
- color: "textSecondary",
1731
- style: styles2.helperText,
1732
- variant: "caption"
1733
- },
1734
- helperText
1735
- ), error && /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.error }, /* @__PURE__ */ import_react16.default.createElement(import_vector_icons8.MaterialIcons, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.errorText, color: "error" }, error))), options && /* @__PURE__ */ import_react16.default.createElement(
1736
- SelectMenu_default,
1737
- {
1738
- options,
1739
- value,
1740
- open: focused,
1741
- onClose: () => setFocused(false),
1742
- label,
1743
- helperText,
1744
- onChange: onChangeText
1745
- }
1746
- ));
1747
- };
1750
+ ), helperText && /* @__PURE__ */ import_react16.default.createElement(
1751
+ Typography_default,
1752
+ {
1753
+ color: "textSecondary",
1754
+ style: styles2.helperText,
1755
+ variant: "caption"
1756
+ },
1757
+ helperText
1758
+ ), error && /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.error }, /* @__PURE__ */ import_react16.default.createElement(import_vector_icons8.MaterialIcons, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.errorText, color: "error" }, error))), options && /* @__PURE__ */ import_react16.default.createElement(
1759
+ SelectMenu_default,
1760
+ {
1761
+ options,
1762
+ value,
1763
+ open: focused,
1764
+ onClose: () => setFocused(false),
1765
+ label,
1766
+ helperText,
1767
+ onChange: onChangeText
1768
+ }
1769
+ ));
1770
+ }
1771
+ );
1748
1772
  var TextField_default = TextField;
1749
1773
 
1750
1774
  // ../src/Components/Locator.tsx
1751
1775
  var Location = __toESM(require("expo-location"));
1752
1776
  var import_react_native_size_matters15 = require("react-native-size-matters");
1753
- setTimeout(() => {
1754
- const { GOOGLE_MAP_API_KEY } = getConfig();
1755
- if (GOOGLE_MAP_API_KEY)
1756
- Location.setGoogleApiKey(GOOGLE_MAP_API_KEY);
1757
- }, 500);
1758
1777
  var getPredictionsFromCoords = async (coords) => {
1759
1778
  const { GOOGLE_MAP_API_KEY } = getConfig();
1760
1779
  if (!GOOGLE_MAP_API_KEY)
@@ -1777,6 +1796,27 @@ var getPredictionsFromCoords = async (coords) => {
1777
1796
  }
1778
1797
  return p;
1779
1798
  };
1799
+ var getPredictionsFromQuery = async (query, country) => {
1800
+ const { GOOGLE_MAP_API_KEY } = getConfig();
1801
+ const endpoint = `https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${query}&components=country:${country}&radius=20000&key=${GOOGLE_MAP_API_KEY}`;
1802
+ const res = await (await fetch(endpoint)).json();
1803
+ const p = [];
1804
+ for (let key in res.predictions) {
1805
+ const { description, place_id } = res.predictions[key];
1806
+ p.push({
1807
+ description,
1808
+ id: place_id
1809
+ });
1810
+ }
1811
+ return p;
1812
+ };
1813
+ var getLocationFromPlaceId = async (place_id) => {
1814
+ const { GOOGLE_MAP_API_KEY } = getConfig();
1815
+ const res = await (await fetch(
1816
+ `https://maps.googleapis.com/maps/api/place/details/json?place_id=${place_id}&fields=formatted_address%2Cgeometry&key=${GOOGLE_MAP_API_KEY}`
1817
+ )).json();
1818
+ return res.result;
1819
+ };
1780
1820
  var Locator = ({
1781
1821
  variant = "contained",
1782
1822
  onLocationSelected,
@@ -1816,17 +1856,8 @@ var Locator = ({
1816
1856
  }
1817
1857
  });
1818
1858
  const search = async (query) => {
1819
- const endpoint = `https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${query}&components=country:${country}&radius=20000&key=${GOOGLE_MAP_API_KEY}`;
1820
- const res = await (await fetch(endpoint)).json();
1821
- const p = [];
1822
- for (let key in res.predictions) {
1823
- const { description, place_id } = res.predictions[key];
1824
- p.push({
1825
- description,
1826
- id: place_id
1827
- });
1828
- }
1829
- setPrediction(p);
1859
+ const predictions = await getPredictionsFromQuery(query, country);
1860
+ setPrediction(predictions);
1830
1861
  };
1831
1862
  const locateMe = () => {
1832
1863
  const getLoc = async () => {
@@ -1860,16 +1891,14 @@ var Locator = ({
1860
1891
  };
1861
1892
  const locationPressed = async (loc) => {
1862
1893
  setValue(loc.description);
1863
- const res = await (await fetch(
1864
- `https://maps.googleapis.com/maps/api/place/details/json?place_id=${loc.id}&fields=formatted_address%2Cgeometry&key=${GOOGLE_MAP_API_KEY}`
1865
- )).json();
1894
+ const res = await getLocationFromPlaceId(loc.id);
1866
1895
  onLocationSelected(
1867
1896
  {
1868
- latitude: res.result?.geometry.location.lat,
1869
- longitude: res.result?.geometry.location.lng,
1897
+ latitude: res.geometry.location.lat,
1898
+ longitude: res.geometry.location.lng,
1870
1899
  description: loc.description
1871
1900
  },
1872
- res.result?.formatted_address
1901
+ res?.formatted_address
1873
1902
  );
1874
1903
  setChanged(false);
1875
1904
  setPrediction([]);
@@ -2004,7 +2033,7 @@ var Spinner = ({
2004
2033
  alignItems: "center",
2005
2034
  justifyContent: "center",
2006
2035
  position: fullscreen ? "absolute" : "relative",
2007
- backgroundColor: fullscreen ? colors2.white[1] + "d" : void 0,
2036
+ backgroundColor: fullscreen ? colors2.white[1] + "dd" : void 0,
2008
2037
  ...style
2009
2038
  },
2010
2039
  content: {
@@ -2134,7 +2163,9 @@ var next_default = HoddyUI;
2134
2163
  Typography,
2135
2164
  UIThemeContext,
2136
2165
  UIThemeProvider,
2166
+ getLocationFromPlaceId,
2137
2167
  getPredictionsFromCoords,
2168
+ getPredictionsFromQuery,
2138
2169
  showFlashMessage,
2139
2170
  useColors,
2140
2171
  useNavScreenOptions,