@hoddy-ui/next 2.0.7 → 2.0.9
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/package.json +1 -1
- package/dist/index.d.mts +0 -548
- package/dist/index.d.ts +0 -548
- package/dist/index.js +0 -2095
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2059
- package/dist/index.mjs.map +0 -1
package/dist/index.js
DELETED
|
@@ -1,2095 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// index.ts
|
|
31
|
-
var next_exports = {};
|
|
32
|
-
__export(next_exports, {
|
|
33
|
-
AdaptiveStatusBar: () => AdaptiveStatusBarNext_default,
|
|
34
|
-
AlertX: () => AlertX_default,
|
|
35
|
-
Avatar: () => Avatar_default,
|
|
36
|
-
Button: () => Button_default,
|
|
37
|
-
CheckBox: () => CheckBox,
|
|
38
|
-
Divider: () => Divider,
|
|
39
|
-
FormWrapper: () => FormWrapper,
|
|
40
|
-
Grid: () => Grid,
|
|
41
|
-
GridItem: () => GridItem,
|
|
42
|
-
IconButton: () => IconButton,
|
|
43
|
-
LinkButton: () => LinkButton,
|
|
44
|
-
Locator: () => Locator,
|
|
45
|
-
OTPInput: () => OTPInput,
|
|
46
|
-
Popup: () => Popup,
|
|
47
|
-
RatingInput: () => RatingInput,
|
|
48
|
-
RatingStars: () => RatingStars,
|
|
49
|
-
SafeAreaView: () => SafeAreaView,
|
|
50
|
-
SelectMenu: () => SelectMenu_default,
|
|
51
|
-
Spinner: () => Spinner_default,
|
|
52
|
-
TextField: () => TextField_default,
|
|
53
|
-
TextField2: () => TextField2,
|
|
54
|
-
Typography: () => Typography_default,
|
|
55
|
-
UIThemeContext: () => UIThemeContext,
|
|
56
|
-
UIThemeProvider: () => UIThemeProvider,
|
|
57
|
-
default: () => next_default,
|
|
58
|
-
getPredictionsFromCoords: () => getPredictionsFromCoords,
|
|
59
|
-
showFlashMessage: () => showFlashMessage,
|
|
60
|
-
useColors: () => useColors,
|
|
61
|
-
useNavScreenOptions: () => useNavScreenOptions,
|
|
62
|
-
useTheme: () => useTheme
|
|
63
|
-
});
|
|
64
|
-
module.exports = __toCommonJS(next_exports);
|
|
65
|
-
|
|
66
|
-
// ../src/theme/colors.ts
|
|
67
|
-
var extraColors = {};
|
|
68
|
-
var setExtraColors = (c) => extraColors = c;
|
|
69
|
-
function colors(theme) {
|
|
70
|
-
const lightColors = {
|
|
71
|
-
white: {
|
|
72
|
-
1: "#fff",
|
|
73
|
-
2: "#f7f7f7",
|
|
74
|
-
3: "#eee",
|
|
75
|
-
4: "#ddd",
|
|
76
|
-
5: "#bbb"
|
|
77
|
-
},
|
|
78
|
-
black: {
|
|
79
|
-
1: "#888",
|
|
80
|
-
2: "#777",
|
|
81
|
-
3: "#555",
|
|
82
|
-
4: "#333",
|
|
83
|
-
5: "#000"
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
const darkColors = {
|
|
87
|
-
black: {
|
|
88
|
-
1: "#fff",
|
|
89
|
-
2: "#f7f7f7",
|
|
90
|
-
3: "#eee",
|
|
91
|
-
4: "#ddd",
|
|
92
|
-
5: "#aaa"
|
|
93
|
-
},
|
|
94
|
-
white: {
|
|
95
|
-
1: "#000",
|
|
96
|
-
2: "#222",
|
|
97
|
-
3: "#333",
|
|
98
|
-
4: "#444",
|
|
99
|
-
5: "#555"
|
|
100
|
-
},
|
|
101
|
-
dark: {
|
|
102
|
-
main: "#f2f3f4",
|
|
103
|
-
light: "#fff",
|
|
104
|
-
dark: "#ddd",
|
|
105
|
-
text: "#000",
|
|
106
|
-
...extraColors?.dark?.dark
|
|
107
|
-
},
|
|
108
|
-
light: {
|
|
109
|
-
main: "#111",
|
|
110
|
-
light: "#555",
|
|
111
|
-
dark: "#333",
|
|
112
|
-
text: "#fff",
|
|
113
|
-
...extraColors?.dark?.light
|
|
114
|
-
},
|
|
115
|
-
textSecondary: {
|
|
116
|
-
main: "#666",
|
|
117
|
-
light: "#777",
|
|
118
|
-
dark: "#444",
|
|
119
|
-
text: "#fff",
|
|
120
|
-
...extraColors?.dark?.textSecondary
|
|
121
|
-
},
|
|
122
|
-
primary: {
|
|
123
|
-
main: "#f80",
|
|
124
|
-
light: "#FEFFD3",
|
|
125
|
-
dark: "#fa0",
|
|
126
|
-
text: "#fff",
|
|
127
|
-
...extraColors?.light?.primary,
|
|
128
|
-
...extraColors?.dark?.primary
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
const dynamicColors = theme === "dark" ? darkColors : lightColors;
|
|
132
|
-
return {
|
|
133
|
-
...extraColors[theme],
|
|
134
|
-
primary: {
|
|
135
|
-
main: "#f80",
|
|
136
|
-
light: "#FEFFD3",
|
|
137
|
-
dark: "#fa0",
|
|
138
|
-
text: "#fff",
|
|
139
|
-
...extraColors?.light?.primary
|
|
140
|
-
},
|
|
141
|
-
secondary: {
|
|
142
|
-
main: "#f11",
|
|
143
|
-
light: "#f43",
|
|
144
|
-
dark: "#d00",
|
|
145
|
-
text: "#fff",
|
|
146
|
-
...extraColors?.light?.secondary
|
|
147
|
-
},
|
|
148
|
-
light: {
|
|
149
|
-
main: "#fff",
|
|
150
|
-
light: "#fff",
|
|
151
|
-
dark: "#ddd",
|
|
152
|
-
text: "#000",
|
|
153
|
-
...extraColors?.light?.light
|
|
154
|
-
},
|
|
155
|
-
dark: {
|
|
156
|
-
main: "#000",
|
|
157
|
-
light: "#777",
|
|
158
|
-
dark: "#111",
|
|
159
|
-
text: "#fff",
|
|
160
|
-
...extraColors?.light?.dark
|
|
161
|
-
},
|
|
162
|
-
textSecondary: {
|
|
163
|
-
main: "#aaa",
|
|
164
|
-
light: "#bbb",
|
|
165
|
-
dark: "#777",
|
|
166
|
-
text: "#123",
|
|
167
|
-
...extraColors?.light?.textSecondary
|
|
168
|
-
},
|
|
169
|
-
blue: {
|
|
170
|
-
main: "#09F",
|
|
171
|
-
light: "#39f",
|
|
172
|
-
dark: "#028",
|
|
173
|
-
text: "#fff",
|
|
174
|
-
...extraColors?.light?.blue
|
|
175
|
-
},
|
|
176
|
-
info: {
|
|
177
|
-
main: "#09f",
|
|
178
|
-
light: "#3af",
|
|
179
|
-
dark: "#08a",
|
|
180
|
-
text: "#fff",
|
|
181
|
-
...extraColors?.light?.info
|
|
182
|
-
},
|
|
183
|
-
success: {
|
|
184
|
-
main: "#0a4",
|
|
185
|
-
text: "#fff",
|
|
186
|
-
light: "#5c3",
|
|
187
|
-
dark: "#062",
|
|
188
|
-
...extraColors?.light?.success
|
|
189
|
-
},
|
|
190
|
-
warning: {
|
|
191
|
-
main: "#fa2",
|
|
192
|
-
light: "#fc7",
|
|
193
|
-
dark: "#f90",
|
|
194
|
-
text: "#fff",
|
|
195
|
-
...extraColors?.light?.warning
|
|
196
|
-
},
|
|
197
|
-
error: {
|
|
198
|
-
main: "#D22",
|
|
199
|
-
text: "#fff",
|
|
200
|
-
light: "#f43",
|
|
201
|
-
dark: "#a20",
|
|
202
|
-
...extraColors?.light?.error
|
|
203
|
-
},
|
|
204
|
-
...dynamicColors
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// ../src/config/KeyManager.ts
|
|
209
|
-
var apiKey = {
|
|
210
|
-
GOOGLE_MAP_API_KEY: ""
|
|
211
|
-
};
|
|
212
|
-
function setApiKey(key) {
|
|
213
|
-
apiKey = key;
|
|
214
|
-
}
|
|
215
|
-
function getApiKey() {
|
|
216
|
-
return apiKey;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// ../src/config/index.ts
|
|
220
|
-
function initialize(config) {
|
|
221
|
-
try {
|
|
222
|
-
setApiKey({
|
|
223
|
-
GOOGLE_MAP_API_KEY: config.googleMapApiKey
|
|
224
|
-
});
|
|
225
|
-
if (config.colors)
|
|
226
|
-
setExtraColors(config.colors);
|
|
227
|
-
} catch (error) {
|
|
228
|
-
console.error("Error reading the config file:", error);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// components/AdaptiveStatusBarNext.tsx
|
|
233
|
-
var import_expo_router = require("expo-router");
|
|
234
|
-
var import_react5 = __toESM(require("react"));
|
|
235
|
-
var import_react_native5 = require("react-native");
|
|
236
|
-
|
|
237
|
-
// ../src/hooks.ts
|
|
238
|
-
var import_react4 = require("react");
|
|
239
|
-
var import_react_native4 = require("react-native");
|
|
240
|
-
var import_react_native_size_matters3 = require("react-native-size-matters");
|
|
241
|
-
|
|
242
|
-
// ../src/theme/index.tsx
|
|
243
|
-
var import_async_storage = __toESM(require("@react-native-async-storage/async-storage"));
|
|
244
|
-
var NavigationBar = __toESM(require("expo-navigation-bar"));
|
|
245
|
-
var SystemUI = __toESM(require("expo-system-ui"));
|
|
246
|
-
var import_react3 = __toESM(require("react"));
|
|
247
|
-
var import_react_native3 = require("react-native");
|
|
248
|
-
|
|
249
|
-
// ../src/Components/FlashMessage.tsx
|
|
250
|
-
var import_react2 = __toESM(require("react"));
|
|
251
|
-
var import_react_native2 = require("react-native");
|
|
252
|
-
var import_react_native_safe_area_context = require("react-native-safe-area-context");
|
|
253
|
-
var import_react_native_size_matters2 = require("react-native-size-matters");
|
|
254
|
-
|
|
255
|
-
// ../src/Components/Typography.tsx
|
|
256
|
-
var import_react = __toESM(require("react"));
|
|
257
|
-
var import_react_native = require("react-native");
|
|
258
|
-
var import_react_native_size_matters = require("react-native-size-matters");
|
|
259
|
-
var Typography = ({
|
|
260
|
-
children,
|
|
261
|
-
color = "dark",
|
|
262
|
-
style = {},
|
|
263
|
-
textCase = null,
|
|
264
|
-
variant = "body1",
|
|
265
|
-
align = "left",
|
|
266
|
-
gutterBottom = 0,
|
|
267
|
-
numberOfLines,
|
|
268
|
-
adjustsFontSizeToFit,
|
|
269
|
-
fontWeight = 400
|
|
270
|
-
}) => {
|
|
271
|
-
const colors2 = useColors();
|
|
272
|
-
const fontSize = {
|
|
273
|
-
h1: (0, import_react_native_size_matters.moderateScale)(42),
|
|
274
|
-
h2: (0, import_react_native_size_matters.moderateScale)(37),
|
|
275
|
-
h3: (0, import_react_native_size_matters.moderateScale)(32),
|
|
276
|
-
h4: (0, import_react_native_size_matters.moderateScale)(27),
|
|
277
|
-
h5: (0, import_react_native_size_matters.moderateScale)(22),
|
|
278
|
-
h6: (0, import_react_native_size_matters.moderateScale)(17),
|
|
279
|
-
body1: (0, import_react_native_size_matters.moderateScale)(15),
|
|
280
|
-
body2: (0, import_react_native_size_matters.moderateScale)(12),
|
|
281
|
-
caption: (0, import_react_native_size_matters.moderateScale)(10)
|
|
282
|
-
};
|
|
283
|
-
const styles2 = import_react_native.StyleSheet.create({
|
|
284
|
-
text: {
|
|
285
|
-
fontSize: fontSize[variant],
|
|
286
|
-
marginBottom: (0, import_react_native_size_matters.verticalScale)(gutterBottom) || 0,
|
|
287
|
-
color: colors2[color]?.main || color,
|
|
288
|
-
textTransform: textCase,
|
|
289
|
-
alignItems: "center",
|
|
290
|
-
textAlign: align,
|
|
291
|
-
fontWeight: fontWeight.toString()
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
295
|
-
import_react_native.Text,
|
|
296
|
-
{
|
|
297
|
-
numberOfLines,
|
|
298
|
-
adjustsFontSizeToFit,
|
|
299
|
-
style: { ...styles2.text, ...style }
|
|
300
|
-
},
|
|
301
|
-
children
|
|
302
|
-
);
|
|
303
|
-
};
|
|
304
|
-
var Typography_default = Typography;
|
|
305
|
-
|
|
306
|
-
// ../src/Components/FlashMessage.tsx
|
|
307
|
-
var showFlashMessage = () => {
|
|
308
|
-
};
|
|
309
|
-
var FlashMessage = () => {
|
|
310
|
-
const { top } = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
|
|
311
|
-
const [message, setMessage] = (0, import_react2.useState)(null);
|
|
312
|
-
const [show, setShow] = (0, import_react2.useState)(false);
|
|
313
|
-
const colors2 = useColors();
|
|
314
|
-
const type = message?.type || "success";
|
|
315
|
-
showFlashMessage = (msg) => {
|
|
316
|
-
setMessage(msg);
|
|
317
|
-
setTimeout(() => {
|
|
318
|
-
setShow(true);
|
|
319
|
-
}, 50);
|
|
320
|
-
setTimeout(() => {
|
|
321
|
-
setShow(false);
|
|
322
|
-
setTimeout(() => {
|
|
323
|
-
setMessage(null);
|
|
324
|
-
}, 500);
|
|
325
|
-
}, msg.duration || 3e3);
|
|
326
|
-
};
|
|
327
|
-
(0, import_react2.useEffect)(() => {
|
|
328
|
-
import_react_native2.LayoutAnimation.configureNext(import_react_native2.LayoutAnimation.Presets.easeInEaseOut);
|
|
329
|
-
}, [show]);
|
|
330
|
-
const styles2 = import_react_native_size_matters2.ScaledSheet.create({
|
|
331
|
-
root: {
|
|
332
|
-
position: "absolute",
|
|
333
|
-
top: show ? 0 : -200,
|
|
334
|
-
zIndex: 1e3,
|
|
335
|
-
left: 0,
|
|
336
|
-
paddingTop: top + 10,
|
|
337
|
-
paddingHorizontal: "15@ms",
|
|
338
|
-
backgroundColor: colors2[type].main,
|
|
339
|
-
width: "100%",
|
|
340
|
-
borderBottomLeftRadius: 10,
|
|
341
|
-
borderBottomRightRadius: 10,
|
|
342
|
-
paddingBottom: "15@ms"
|
|
343
|
-
},
|
|
344
|
-
action: {
|
|
345
|
-
borderRadius: 20,
|
|
346
|
-
marginTop: "10@vs",
|
|
347
|
-
flexDirection: "row",
|
|
348
|
-
justifyContent: "center",
|
|
349
|
-
paddingHorizontal: "20@ms",
|
|
350
|
-
paddingVertical: "8@vs",
|
|
351
|
-
backgroundColor: "#fff3"
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: styles2.root }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: { flexDirection: "row" } }, /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: { flex: 1, marginRight: 10 } }, message?.title && /* @__PURE__ */ import_react2.default.createElement(
|
|
355
|
-
Typography_default,
|
|
356
|
-
{
|
|
357
|
-
variant: "h6",
|
|
358
|
-
fontWeight: 600,
|
|
359
|
-
gutterBottom: 3,
|
|
360
|
-
style: { color: "#fff" }
|
|
361
|
-
},
|
|
362
|
-
message?.title
|
|
363
|
-
), /* @__PURE__ */ import_react2.default.createElement(Typography_default, { style: { color: "#fff" } }, message?.message))), message?.actions?.map((cur, i) => /* @__PURE__ */ import_react2.default.createElement(import_react_native2.TouchableOpacity, { key: i, style: styles2.action, onPress: cur.onPress }, /* @__PURE__ */ import_react2.default.createElement(Typography_default, { fontWeight: 700, style: { color: "#fff" } }, cur.title))));
|
|
364
|
-
};
|
|
365
|
-
var FlashMessage_default = FlashMessage;
|
|
366
|
-
|
|
367
|
-
// ../src/theme/index.tsx
|
|
368
|
-
var import_react_native_safe_area_context2 = require("react-native-safe-area-context");
|
|
369
|
-
var UIThemeContext = (0, import_react3.createContext)({
|
|
370
|
-
themeState: { mode: "default", value: "light" }
|
|
371
|
-
});
|
|
372
|
-
function themeReducer(state, { type, payload }) {
|
|
373
|
-
if (payload === "dark" || type === "dark") {
|
|
374
|
-
SystemUI.setBackgroundColorAsync("#000000");
|
|
375
|
-
if (import_react_native3.Platform.OS === "android") {
|
|
376
|
-
NavigationBar.setButtonStyleAsync("light");
|
|
377
|
-
NavigationBar.setBackgroundColorAsync("#000000");
|
|
378
|
-
}
|
|
379
|
-
} else {
|
|
380
|
-
SystemUI.setBackgroundColorAsync("#ffffff");
|
|
381
|
-
if (import_react_native3.Platform.OS === "android") {
|
|
382
|
-
NavigationBar.setButtonStyleAsync("dark");
|
|
383
|
-
NavigationBar.setBackgroundColorAsync("#fff");
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
switch (type) {
|
|
387
|
-
case "dark":
|
|
388
|
-
return { mode: "dark", value: "dark" };
|
|
389
|
-
case "default":
|
|
390
|
-
return { mode: "default", value: payload };
|
|
391
|
-
case "light":
|
|
392
|
-
return { mode: "light", value: "light" };
|
|
393
|
-
default:
|
|
394
|
-
return state;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
var UIThemeProvider = ({ children }) => {
|
|
398
|
-
const [themeState, themeDispatch] = (0, import_react3.useReducer)(themeReducer, {
|
|
399
|
-
mode: "default",
|
|
400
|
-
value: "light"
|
|
401
|
-
});
|
|
402
|
-
const colorScheme = (0, import_react_native3.useColorScheme)();
|
|
403
|
-
import_react3.default.useEffect(() => {
|
|
404
|
-
import_async_storage.default.getItem("theme").then((val) => {
|
|
405
|
-
if (val) {
|
|
406
|
-
if (val === "default") {
|
|
407
|
-
themeDispatch({
|
|
408
|
-
type: "default",
|
|
409
|
-
payload: colorScheme
|
|
410
|
-
});
|
|
411
|
-
} else
|
|
412
|
-
themeDispatch({
|
|
413
|
-
type: val
|
|
414
|
-
});
|
|
415
|
-
} else {
|
|
416
|
-
themeDispatch({
|
|
417
|
-
type: "default",
|
|
418
|
-
payload: colorScheme
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
}, [colorScheme]);
|
|
423
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_react_native_safe_area_context2.SafeAreaProvider, null, /* @__PURE__ */ import_react3.default.createElement(
|
|
424
|
-
UIThemeContext.Provider,
|
|
425
|
-
{
|
|
426
|
-
value: {
|
|
427
|
-
themeState,
|
|
428
|
-
themeDispatch
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
|
-
children,
|
|
432
|
-
/* @__PURE__ */ import_react3.default.createElement(FlashMessage_default, null)
|
|
433
|
-
));
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
// ../src/hooks.ts
|
|
437
|
-
var useColors = () => {
|
|
438
|
-
const { themeState } = (0, import_react4.useContext)(UIThemeContext);
|
|
439
|
-
return colors(themeState.value);
|
|
440
|
-
};
|
|
441
|
-
var useTheme = () => {
|
|
442
|
-
const { themeState } = (0, import_react4.useContext)(UIThemeContext);
|
|
443
|
-
return themeState.value;
|
|
444
|
-
};
|
|
445
|
-
var useNavScreenOptions = (type) => {
|
|
446
|
-
const colors2 = useColors();
|
|
447
|
-
const options = {
|
|
448
|
-
stack: {
|
|
449
|
-
headerShown: false,
|
|
450
|
-
headerStyle: {
|
|
451
|
-
backgroundColor: colors2.white[1]
|
|
452
|
-
},
|
|
453
|
-
headerShadowVisible: false,
|
|
454
|
-
contentStyle: {
|
|
455
|
-
backgroundColor: colors2.white[1]
|
|
456
|
-
},
|
|
457
|
-
headerTitleStyle: {
|
|
458
|
-
color: colors2.black[1]
|
|
459
|
-
},
|
|
460
|
-
headerTintColor: import_react_native4.Platform.OS === "android" ? colors2.black[1] : colors2.blue.light
|
|
461
|
-
},
|
|
462
|
-
tab: {
|
|
463
|
-
headerShown: false,
|
|
464
|
-
headerTintColor: colors2.dark.main,
|
|
465
|
-
tabBarStyle: {
|
|
466
|
-
borderTopColor: colors2.white[3],
|
|
467
|
-
borderTopWidth: 1,
|
|
468
|
-
// shadowColor: "#000",
|
|
469
|
-
// shadowOffset: { height: -3, width: 0 },
|
|
470
|
-
// shadowRadius: 7,
|
|
471
|
-
// shadowOpacity: 0.1,
|
|
472
|
-
backgroundColor: colors2.white[1]
|
|
473
|
-
},
|
|
474
|
-
tabBarActiveTintColor: colors2.blue.main,
|
|
475
|
-
tabBarInactiveTintColor: colors2.textSecondary.main,
|
|
476
|
-
tabBarLabelStyle: {
|
|
477
|
-
// fontSize: ms(12),
|
|
478
|
-
}
|
|
479
|
-
},
|
|
480
|
-
drawer: {
|
|
481
|
-
headerShown: false,
|
|
482
|
-
drawerActiveTintColor: colors2.primary.main,
|
|
483
|
-
drawerInactiveTintColor: colors2.textSecondary.main,
|
|
484
|
-
sceneContainerStyle: {
|
|
485
|
-
backgroundColor: colors2.white[2]
|
|
486
|
-
},
|
|
487
|
-
drawerStyle: {
|
|
488
|
-
backgroundColor: colors2.white[1]
|
|
489
|
-
},
|
|
490
|
-
headerStyle: {
|
|
491
|
-
backgroundColor: colors2.white[1]
|
|
492
|
-
},
|
|
493
|
-
headerTitleStyle: {
|
|
494
|
-
color: colors2.dark.main
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
};
|
|
498
|
-
if (import_react_native4.Platform.OS === "android") {
|
|
499
|
-
options.tab.tabBarStyle.height = import_react_native4.Dimensions.get("screen").height * 0.08;
|
|
500
|
-
options.tab.tabBarStyle.paddingBottom = (0, import_react_native_size_matters3.vs)(15);
|
|
501
|
-
}
|
|
502
|
-
return options[type];
|
|
503
|
-
};
|
|
504
|
-
|
|
505
|
-
// components/AdaptiveStatusBarNext.tsx
|
|
506
|
-
var AdaptiveStatusBar = ({ translucent = false }) => {
|
|
507
|
-
const [focused, setFocused] = (0, import_react5.useState)(false);
|
|
508
|
-
const colors2 = useColors();
|
|
509
|
-
const theme = useTheme();
|
|
510
|
-
(0, import_expo_router.useFocusEffect)(
|
|
511
|
-
import_react5.default.useCallback(() => {
|
|
512
|
-
import_react_native5.StatusBar.setBarStyle(
|
|
513
|
-
theme === "dark" ? "light-content" : "dark-content"
|
|
514
|
-
);
|
|
515
|
-
if (import_react_native5.Platform.OS === "android") {
|
|
516
|
-
import_react_native5.StatusBar.setBackgroundColor(
|
|
517
|
-
colors2.white[1] + (translucent ? "0" : "")
|
|
518
|
-
);
|
|
519
|
-
import_react_native5.StatusBar.setTranslucent(true);
|
|
520
|
-
}
|
|
521
|
-
}, [theme])
|
|
522
|
-
);
|
|
523
|
-
import_react5.default.useEffect(() => {
|
|
524
|
-
import_react_native5.StatusBar.setBarStyle(theme === "dark" ? "light-content" : "dark-content");
|
|
525
|
-
if (import_react_native5.Platform.OS === "android") {
|
|
526
|
-
import_react_native5.StatusBar.setBackgroundColor(colors2.white[1] + (translucent ? "0" : ""));
|
|
527
|
-
import_react_native5.StatusBar.setTranslucent(true);
|
|
528
|
-
}
|
|
529
|
-
}, [theme]);
|
|
530
|
-
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null);
|
|
531
|
-
};
|
|
532
|
-
var AdaptiveStatusBarNext_default = AdaptiveStatusBar;
|
|
533
|
-
|
|
534
|
-
// ../src/Components/AlertX.tsx
|
|
535
|
-
var import_vector_icons = require("@expo/vector-icons");
|
|
536
|
-
var import_react6 = __toESM(require("react"));
|
|
537
|
-
var import_react_native6 = require("react-native");
|
|
538
|
-
var import_react_native_size_matters4 = require("react-native-size-matters");
|
|
539
|
-
var AlertX = ({
|
|
540
|
-
type = "info",
|
|
541
|
-
variant = "contained",
|
|
542
|
-
title,
|
|
543
|
-
gutterBottom = 0,
|
|
544
|
-
body,
|
|
545
|
-
style = {}
|
|
546
|
-
}) => {
|
|
547
|
-
const colors2 = useColors();
|
|
548
|
-
const styles2 = import_react_native_size_matters4.ScaledSheet.create({
|
|
549
|
-
container: {
|
|
550
|
-
padding: 20,
|
|
551
|
-
paddingTop: 10,
|
|
552
|
-
paddingBottom: 10,
|
|
553
|
-
borderRadius: 8,
|
|
554
|
-
alignItems: "center",
|
|
555
|
-
flexDirection: "row",
|
|
556
|
-
marginBottom: gutterBottom + "@ms",
|
|
557
|
-
backgroundColor: colors2[type].main + (variant === "contained" ? "" : "3")
|
|
558
|
-
},
|
|
559
|
-
title: {
|
|
560
|
-
color: variant === "contained" ? "#fff" : colors2[type].main
|
|
561
|
-
},
|
|
562
|
-
body: {
|
|
563
|
-
color: variant === "contained" ? "#fff" : colors2[type].main
|
|
564
|
-
}
|
|
565
|
-
});
|
|
566
|
-
return /* @__PURE__ */ import_react6.default.createElement(import_react_native6.View, { style: { ...styles2.container, ...style } }, /* @__PURE__ */ import_react6.default.createElement(import_react_native6.View, { style: { width: "80%" } }, /* @__PURE__ */ import_react6.default.createElement(Typography_default, { style: styles2.title, gutterBottom: 3, fontWeight: 700 }, title), body && /* @__PURE__ */ import_react6.default.createElement(Typography_default, { fontWeight: 700, variant: "body2", style: styles2.body }, body)), /* @__PURE__ */ import_react6.default.createElement(import_react_native6.View, { style: { marginLeft: "auto" } }, /* @__PURE__ */ import_react6.default.createElement(
|
|
567
|
-
import_vector_icons.MaterialIcons,
|
|
568
|
-
{
|
|
569
|
-
color: variant === "contained" ? "#fff" : colors2[type].main,
|
|
570
|
-
size: 36,
|
|
571
|
-
name: type === "success" ? "check" : type
|
|
572
|
-
}
|
|
573
|
-
)));
|
|
574
|
-
};
|
|
575
|
-
var AlertX_default = AlertX;
|
|
576
|
-
|
|
577
|
-
// ../src/Components/Avatar.tsx
|
|
578
|
-
var import_vector_icons2 = require("@expo/vector-icons");
|
|
579
|
-
var import_react7 = __toESM(require("react"));
|
|
580
|
-
var import_react_native7 = require("react-native");
|
|
581
|
-
var import_react_native_size_matters5 = require("react-native-size-matters");
|
|
582
|
-
var Avatar = ({
|
|
583
|
-
color = "dark",
|
|
584
|
-
label,
|
|
585
|
-
variant = "contained",
|
|
586
|
-
source,
|
|
587
|
-
size = 48,
|
|
588
|
-
style = {}
|
|
589
|
-
}) => {
|
|
590
|
-
const colors2 = useColors();
|
|
591
|
-
const styles2 = import_react_native_size_matters5.ScaledSheet.create({
|
|
592
|
-
root: {
|
|
593
|
-
borderRadius: 150,
|
|
594
|
-
height: size + "@ms",
|
|
595
|
-
width: size + "@ms",
|
|
596
|
-
alignItems: "center",
|
|
597
|
-
justifyContent: "center",
|
|
598
|
-
overflow: "hidden",
|
|
599
|
-
borderWidth: variant === "outlined" ? 5 : 0,
|
|
600
|
-
borderColor: variant === "outlined" ? "#fff" : "#0000",
|
|
601
|
-
backgroundColor: variant === "outlined" ? null : label ? colors2[color].main : colors2.white[4],
|
|
602
|
-
...style
|
|
603
|
-
},
|
|
604
|
-
image: {
|
|
605
|
-
height: "110%",
|
|
606
|
-
width: "110%"
|
|
607
|
-
}
|
|
608
|
-
});
|
|
609
|
-
return /* @__PURE__ */ import_react7.default.createElement(import_react_native7.View, { style: styles2.root }, source ? /* @__PURE__ */ import_react7.default.createElement(import_react_native7.Image, { resizeMode: "cover", style: styles2.image, source }) : label ? /* @__PURE__ */ import_react7.default.createElement(Typography_default, { style: { color: colors2[color].text } }, label[0]) : /* @__PURE__ */ import_react7.default.createElement(import_vector_icons2.AntDesign, { name: "user", color: "#fff", size: Math.round(size / 1.5) }));
|
|
610
|
-
};
|
|
611
|
-
var Avatar_default = Avatar;
|
|
612
|
-
|
|
613
|
-
// ../src/Components/Button.tsx
|
|
614
|
-
var import_vector_icons3 = require("@expo/vector-icons");
|
|
615
|
-
var import_react8 = __toESM(require("react"));
|
|
616
|
-
var import_react_native8 = require("react-native");
|
|
617
|
-
var import_react_native_size_matters6 = require("react-native-size-matters");
|
|
618
|
-
var LinkButton = ({
|
|
619
|
-
title,
|
|
620
|
-
style = {},
|
|
621
|
-
color = "blue",
|
|
622
|
-
fontSize = 12,
|
|
623
|
-
fontWeight = "400",
|
|
624
|
-
disabled,
|
|
625
|
-
onPress = () => {
|
|
626
|
-
}
|
|
627
|
-
}) => {
|
|
628
|
-
const colors2 = useColors();
|
|
629
|
-
const styles2 = import_react_native_size_matters6.ScaledSheet.create({
|
|
630
|
-
text: {
|
|
631
|
-
fontSize: (0, import_react_native_size_matters6.moderateScale)(fontSize),
|
|
632
|
-
fontWeight,
|
|
633
|
-
color: disabled ? "#777" : colors2[color].main
|
|
634
|
-
}
|
|
635
|
-
});
|
|
636
|
-
return /* @__PURE__ */ import_react8.default.createElement(import_react_native8.TouchableOpacity, { onPress, disabled }, /* @__PURE__ */ import_react8.default.createElement(import_react_native8.Text, { style: { ...styles2.text, ...style } }, title));
|
|
637
|
-
};
|
|
638
|
-
var IconButton = ({
|
|
639
|
-
style = {},
|
|
640
|
-
color = "dark",
|
|
641
|
-
disabled,
|
|
642
|
-
icon,
|
|
643
|
-
elevation,
|
|
644
|
-
bg = false,
|
|
645
|
-
size = 24,
|
|
646
|
-
containerStyles = {},
|
|
647
|
-
onPress = () => {
|
|
648
|
-
},
|
|
649
|
-
iconType = "material"
|
|
650
|
-
}) => {
|
|
651
|
-
const colors2 = useColors();
|
|
652
|
-
const theme = useTheme();
|
|
653
|
-
const bgColor = theme === "light" ? "#fff" : "#222";
|
|
654
|
-
const styles2 = import_react_native_size_matters6.ScaledSheet.create({
|
|
655
|
-
container: {
|
|
656
|
-
alignSelf: "flex-start",
|
|
657
|
-
flexGrow: 0,
|
|
658
|
-
backgroundColor: bg ? bgColor : elevation > 0 ? bgColor : null,
|
|
659
|
-
padding: "5@ms",
|
|
660
|
-
shadowColor: "#000",
|
|
661
|
-
shadowOpacity: 0.1,
|
|
662
|
-
shadowOffset: {
|
|
663
|
-
height: 1,
|
|
664
|
-
width: 0
|
|
665
|
-
},
|
|
666
|
-
height: bg ? size + 20 + "@ms" : void 0,
|
|
667
|
-
width: bg ? size + 20 + "@ms" : void 0,
|
|
668
|
-
alignItems: "center",
|
|
669
|
-
justifyContent: "center",
|
|
670
|
-
shadowRadius: elevation,
|
|
671
|
-
elevation,
|
|
672
|
-
borderRadius: size * 5
|
|
673
|
-
},
|
|
674
|
-
text: {
|
|
675
|
-
color: disabled ? "#777" : colors2[color].main
|
|
676
|
-
}
|
|
677
|
-
});
|
|
678
|
-
const IconComp = {
|
|
679
|
-
material: import_vector_icons3.MaterialIcons,
|
|
680
|
-
ion: import_vector_icons3.Ionicons
|
|
681
|
-
}[iconType];
|
|
682
|
-
return /* @__PURE__ */ import_react8.default.createElement(
|
|
683
|
-
import_react_native8.TouchableOpacity,
|
|
684
|
-
{
|
|
685
|
-
onPress,
|
|
686
|
-
activeOpacity: 0.3,
|
|
687
|
-
style: { ...styles2.container, ...containerStyles }
|
|
688
|
-
},
|
|
689
|
-
/* @__PURE__ */ import_react8.default.createElement(IconComp, { style: { ...styles2.text, ...style }, name: icon, size })
|
|
690
|
-
);
|
|
691
|
-
};
|
|
692
|
-
var Button = (0, import_react8.forwardRef)(
|
|
693
|
-
({
|
|
694
|
-
elevation = 0,
|
|
695
|
-
onPress = () => {
|
|
696
|
-
},
|
|
697
|
-
disabled = false,
|
|
698
|
-
title,
|
|
699
|
-
loading,
|
|
700
|
-
size = "normal",
|
|
701
|
-
rounded = false,
|
|
702
|
-
gutterBottom,
|
|
703
|
-
style = {},
|
|
704
|
-
fullWidth = false,
|
|
705
|
-
translucent = false,
|
|
706
|
-
color = "primary",
|
|
707
|
-
variant = "contained",
|
|
708
|
-
start,
|
|
709
|
-
end
|
|
710
|
-
}, ref) => {
|
|
711
|
-
const colors2 = useColors();
|
|
712
|
-
const styles2 = import_react_native_size_matters6.ScaledSheet.create({
|
|
713
|
-
con: {
|
|
714
|
-
flexDirection: "row",
|
|
715
|
-
alignItems: "center",
|
|
716
|
-
alignSelf: "flex-start",
|
|
717
|
-
justifyContent: "center",
|
|
718
|
-
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,
|
|
719
|
-
borderRadius: rounded ? 30 : 10,
|
|
720
|
-
elevation: variant === "text" ? 0 : elevation,
|
|
721
|
-
paddingVertical: size === "small" ? 8 : size === "large" ? "15@ms" : "13@ms",
|
|
722
|
-
paddingHorizontal: size === "small" ? "10@ms" : "18@ms",
|
|
723
|
-
borderColor: colors2[color].main,
|
|
724
|
-
borderWidth: variant === "outlined" ? 1 : 0,
|
|
725
|
-
shadowColor: "#000",
|
|
726
|
-
shadowRadius: elevation,
|
|
727
|
-
marginBottom: gutterBottom,
|
|
728
|
-
shadowOffset: {
|
|
729
|
-
height: elevation / 2,
|
|
730
|
-
width: 0
|
|
731
|
-
},
|
|
732
|
-
shadowOpacity: variant === "text" ? 0 : 0.3,
|
|
733
|
-
width: fullWidth ? "100%" : null,
|
|
734
|
-
...style
|
|
735
|
-
},
|
|
736
|
-
text: {
|
|
737
|
-
color: disabled ? variant === "text" || variant === "outlined" ? colors2.black[1] : colors2[color].text : colors2[color][variant === "text" || variant === "outlined" ? "main" : "text"],
|
|
738
|
-
fontWeight: variant === "outlined" ? "700" : "500",
|
|
739
|
-
fontSize: size === "small" ? "12@ms" : "16@ms"
|
|
740
|
-
}
|
|
741
|
-
});
|
|
742
|
-
return /* @__PURE__ */ import_react8.default.createElement(
|
|
743
|
-
import_react_native8.TouchableOpacity,
|
|
744
|
-
{
|
|
745
|
-
ref,
|
|
746
|
-
onPress,
|
|
747
|
-
disabled,
|
|
748
|
-
style: styles2.con
|
|
749
|
-
},
|
|
750
|
-
start,
|
|
751
|
-
loading && /* @__PURE__ */ import_react8.default.createElement(
|
|
752
|
-
import_react_native8.ActivityIndicator,
|
|
753
|
-
{
|
|
754
|
-
size: "small",
|
|
755
|
-
color: colors2[color].text,
|
|
756
|
-
style: { marginRight: 10 }
|
|
757
|
-
}
|
|
758
|
-
),
|
|
759
|
-
/* @__PURE__ */ import_react8.default.createElement(import_react_native8.Text, { style: styles2.text }, title),
|
|
760
|
-
end
|
|
761
|
-
);
|
|
762
|
-
}
|
|
763
|
-
);
|
|
764
|
-
var Button_default = Button;
|
|
765
|
-
|
|
766
|
-
// ../src/Components/Checkbox.tsx
|
|
767
|
-
var import_vector_icons4 = require("@expo/vector-icons");
|
|
768
|
-
var import_react9 = __toESM(require("react"));
|
|
769
|
-
var import_react_native9 = require("react-native");
|
|
770
|
-
var import_react_native_size_matters7 = require("react-native-size-matters");
|
|
771
|
-
var CheckBox = ({
|
|
772
|
-
color = "primary",
|
|
773
|
-
checked,
|
|
774
|
-
size = 24,
|
|
775
|
-
label,
|
|
776
|
-
style = {},
|
|
777
|
-
onChange
|
|
778
|
-
}) => {
|
|
779
|
-
const iconName = checked ? "checkbox-marked" : "checkbox-blank-outline";
|
|
780
|
-
const colors2 = useColors();
|
|
781
|
-
const styles2 = import_react_native_size_matters7.ScaledSheet.create({
|
|
782
|
-
container: {
|
|
783
|
-
alignItems: "center",
|
|
784
|
-
flexDirection: "row",
|
|
785
|
-
...style
|
|
786
|
-
}
|
|
787
|
-
});
|
|
788
|
-
return /* @__PURE__ */ import_react9.default.createElement(import_react_native9.View, { style: styles2.container }, /* @__PURE__ */ import_react9.default.createElement(import_react_native9.TouchableOpacity, { onPress: onChange }, /* @__PURE__ */ import_react9.default.createElement(
|
|
789
|
-
import_vector_icons4.MaterialCommunityIcons,
|
|
790
|
-
{
|
|
791
|
-
name: iconName,
|
|
792
|
-
size,
|
|
793
|
-
color: colors2[color].main
|
|
794
|
-
}
|
|
795
|
-
)), label);
|
|
796
|
-
};
|
|
797
|
-
|
|
798
|
-
// ../src/Components/FormWrapper.tsx
|
|
799
|
-
var import_react10 = __toESM(require("react"));
|
|
800
|
-
var import_react_native10 = require("react-native");
|
|
801
|
-
var import_react_native_size_matters8 = require("react-native-size-matters");
|
|
802
|
-
var FormWrapper = ({
|
|
803
|
-
children,
|
|
804
|
-
behavior = import_react_native10.Platform.OS === "ios" ? "padding" : "height",
|
|
805
|
-
contentContainerStyle,
|
|
806
|
-
mode = "scroll",
|
|
807
|
-
keyboardVerticalOffset = 10,
|
|
808
|
-
style = {},
|
|
809
|
-
onScroll
|
|
810
|
-
}) => {
|
|
811
|
-
const styles2 = import_react_native_size_matters8.ScaledSheet.create({
|
|
812
|
-
root: {
|
|
813
|
-
width: "100%",
|
|
814
|
-
flex: 1,
|
|
815
|
-
...style
|
|
816
|
-
}
|
|
817
|
-
});
|
|
818
|
-
return mode === "static" ? /* @__PURE__ */ import_react10.default.createElement(import_react_native10.TouchableWithoutFeedback, { onPress: import_react_native10.Keyboard.dismiss, accessible: false }, /* @__PURE__ */ import_react10.default.createElement(
|
|
819
|
-
import_react_native10.KeyboardAvoidingView,
|
|
820
|
-
{
|
|
821
|
-
style: styles2.root,
|
|
822
|
-
behavior,
|
|
823
|
-
contentContainerStyle: styles2.root,
|
|
824
|
-
keyboardVerticalOffset
|
|
825
|
-
},
|
|
826
|
-
children
|
|
827
|
-
)) : /* @__PURE__ */ import_react10.default.createElement(
|
|
828
|
-
import_react_native10.KeyboardAvoidingView,
|
|
829
|
-
{
|
|
830
|
-
behavior,
|
|
831
|
-
style: styles2.root,
|
|
832
|
-
keyboardVerticalOffset
|
|
833
|
-
},
|
|
834
|
-
/* @__PURE__ */ import_react10.default.createElement(
|
|
835
|
-
import_react_native10.ScrollView,
|
|
836
|
-
{
|
|
837
|
-
onScroll,
|
|
838
|
-
showsVerticalScrollIndicator: false,
|
|
839
|
-
scrollEventThrottle: 40,
|
|
840
|
-
keyboardDismissMode: "interactive",
|
|
841
|
-
contentContainerStyle,
|
|
842
|
-
keyboardShouldPersistTaps: "handled"
|
|
843
|
-
},
|
|
844
|
-
children
|
|
845
|
-
)
|
|
846
|
-
);
|
|
847
|
-
};
|
|
848
|
-
|
|
849
|
-
// ../src/Components/StarRating.tsx
|
|
850
|
-
var import_vector_icons5 = require("@expo/vector-icons");
|
|
851
|
-
var Haptics = __toESM(require("expo-haptics"));
|
|
852
|
-
var import_react12 = require("react");
|
|
853
|
-
var import_react_native12 = require("react-native");
|
|
854
|
-
var import_react_native_size_matters10 = require("react-native-size-matters");
|
|
855
|
-
|
|
856
|
-
// ../src/Components/Popup.tsx
|
|
857
|
-
var import_react_native11 = require("react-native");
|
|
858
|
-
var import_react11 = __toESM(require("react"));
|
|
859
|
-
var import_react_native_size_matters9 = require("react-native-size-matters");
|
|
860
|
-
var Popup = ({
|
|
861
|
-
title,
|
|
862
|
-
sheet,
|
|
863
|
-
bare = false,
|
|
864
|
-
keyboardVerticalOffset,
|
|
865
|
-
children,
|
|
866
|
-
open,
|
|
867
|
-
onClose = () => {
|
|
868
|
-
}
|
|
869
|
-
}) => {
|
|
870
|
-
const colors2 = useColors();
|
|
871
|
-
const [show, setShow] = (0, import_react11.useState)(open);
|
|
872
|
-
const [showSecondary, setShowSecondary] = (0, import_react11.useState)(false);
|
|
873
|
-
const styles2 = import_react_native_size_matters9.ScaledSheet.create({
|
|
874
|
-
root: {
|
|
875
|
-
height: "100%",
|
|
876
|
-
width: "100%",
|
|
877
|
-
justifyContent: sheet ? "flex-end" : "center"
|
|
878
|
-
},
|
|
879
|
-
avoidingView: {
|
|
880
|
-
minHeight: typeof sheet === "number" ? sheet : void 0,
|
|
881
|
-
maxHeight: "80%",
|
|
882
|
-
zIndex: 1e3,
|
|
883
|
-
alignSelf: "center",
|
|
884
|
-
maxWidth: sheet ? void 0 : "90%",
|
|
885
|
-
width: sheet ? "100%" : void 0
|
|
886
|
-
},
|
|
887
|
-
container: {
|
|
888
|
-
paddingBottom: sheet ? "30@ms" : 0,
|
|
889
|
-
backgroundColor: colors2.white[2],
|
|
890
|
-
borderTopLeftRadius: 20,
|
|
891
|
-
borderTopRightRadius: 20,
|
|
892
|
-
borderBottomRightRadius: sheet ? 0 : 20,
|
|
893
|
-
borderBottomLeftRadius: sheet ? 0 : 20,
|
|
894
|
-
width: "100%"
|
|
895
|
-
},
|
|
896
|
-
content: {
|
|
897
|
-
paddingHorizontal: bare ? void 0 : "10@ms"
|
|
898
|
-
// flex: 1,
|
|
899
|
-
},
|
|
900
|
-
title: {
|
|
901
|
-
flexDirection: "row",
|
|
902
|
-
alignItems: "center",
|
|
903
|
-
paddingVertical: "5@ms",
|
|
904
|
-
paddingHorizontal: "10@ms",
|
|
905
|
-
marginBottom: "10@ms"
|
|
906
|
-
},
|
|
907
|
-
backdrop: {
|
|
908
|
-
position: "absolute",
|
|
909
|
-
height: "100%",
|
|
910
|
-
zIndex: -1,
|
|
911
|
-
width: "100%",
|
|
912
|
-
backgroundColor: "#000b"
|
|
913
|
-
}
|
|
914
|
-
});
|
|
915
|
-
import_react11.default.useEffect(() => {
|
|
916
|
-
setShow(open);
|
|
917
|
-
setTimeout(() => {
|
|
918
|
-
setShowSecondary(open);
|
|
919
|
-
}, 500);
|
|
920
|
-
}, [open]);
|
|
921
|
-
const closeAction = () => {
|
|
922
|
-
setShow(false);
|
|
923
|
-
onClose();
|
|
924
|
-
};
|
|
925
|
-
return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
926
|
-
import_react_native11.Modal,
|
|
927
|
-
{
|
|
928
|
-
transparent: true,
|
|
929
|
-
animationType: "fade",
|
|
930
|
-
statusBarTranslucent: true,
|
|
931
|
-
visible: show,
|
|
932
|
-
onRequestClose: closeAction
|
|
933
|
-
},
|
|
934
|
-
/* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.backdrop }),
|
|
935
|
-
/* @__PURE__ */ import_react11.default.createElement(UIThemeProvider, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
936
|
-
import_react_native11.Modal,
|
|
937
|
-
{
|
|
938
|
-
transparent: true,
|
|
939
|
-
animationType: "slide",
|
|
940
|
-
statusBarTranslucent: true,
|
|
941
|
-
visible: showSecondary,
|
|
942
|
-
onRequestClose: closeAction
|
|
943
|
-
},
|
|
944
|
-
/* @__PURE__ */ import_react11.default.createElement(import_react_native11.TouchableWithoutFeedback, { onPress: import_react_native11.Keyboard.dismiss }, /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.root }, open && /* @__PURE__ */ import_react11.default.createElement(
|
|
945
|
-
import_react_native11.Pressable,
|
|
946
|
-
{
|
|
947
|
-
style: import_react_native11.StyleSheet.absoluteFill,
|
|
948
|
-
onPress: closeAction
|
|
949
|
-
}
|
|
950
|
-
), /* @__PURE__ */ import_react11.default.createElement(
|
|
951
|
-
import_react_native11.KeyboardAvoidingView,
|
|
952
|
-
{
|
|
953
|
-
style: styles2.avoidingView,
|
|
954
|
-
keyboardVerticalOffset,
|
|
955
|
-
behavior: import_react_native11.Platform.OS === "ios" ? "position" : "padding"
|
|
956
|
-
},
|
|
957
|
-
/* @__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(
|
|
958
|
-
IconButton,
|
|
959
|
-
{
|
|
960
|
-
size: 20,
|
|
961
|
-
icon: "close",
|
|
962
|
-
onPress: closeAction
|
|
963
|
-
}
|
|
964
|
-
), /* @__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))
|
|
965
|
-
)))
|
|
966
|
-
))
|
|
967
|
-
));
|
|
968
|
-
};
|
|
969
|
-
|
|
970
|
-
// ../src/Components/StarRating.tsx
|
|
971
|
-
var RatingStars = ({
|
|
972
|
-
rating = 0,
|
|
973
|
-
size = 16
|
|
974
|
-
}) => {
|
|
975
|
-
const colors2 = useColors();
|
|
976
|
-
const styles2 = import_react_native_size_matters10.ScaledSheet.create({
|
|
977
|
-
root: {
|
|
978
|
-
flexDirection: "row",
|
|
979
|
-
alignItems: "center"
|
|
980
|
-
}
|
|
981
|
-
});
|
|
982
|
-
return /* @__PURE__ */ React.createElement(import_react_native12.View, { style: styles2.root }, [...Array(Math.floor(rating))].map((_, index) => /* @__PURE__ */ React.createElement(import_vector_icons5.Ionicons, { key: index, name: "star", size, color: "#FFD700" })), [...Array(5 - Math.floor(rating))].map((_, index) => /* @__PURE__ */ React.createElement(
|
|
983
|
-
import_vector_icons5.Ionicons,
|
|
984
|
-
{
|
|
985
|
-
key: index,
|
|
986
|
-
name: "star",
|
|
987
|
-
size,
|
|
988
|
-
color: colors2.textSecondary.light
|
|
989
|
-
}
|
|
990
|
-
)));
|
|
991
|
-
};
|
|
992
|
-
var RatingInput = ({
|
|
993
|
-
onSubmit: _onSubmit,
|
|
994
|
-
rating = 0,
|
|
995
|
-
size = 16
|
|
996
|
-
}) => {
|
|
997
|
-
const [showReviewsModal, setShowReviewsModal] = (0, import_react12.useState)(false);
|
|
998
|
-
const [rate, setRate] = (0, import_react12.useState)(0);
|
|
999
|
-
const colors2 = useColors();
|
|
1000
|
-
const [loading, setLoading] = (0, import_react12.useState)(false);
|
|
1001
|
-
const [review, setReview] = (0, import_react12.useState)("");
|
|
1002
|
-
const styles2 = import_react_native_size_matters10.ScaledSheet.create({
|
|
1003
|
-
root: {
|
|
1004
|
-
flexDirection: "row",
|
|
1005
|
-
alignItems: "center"
|
|
1006
|
-
},
|
|
1007
|
-
inputCon: {
|
|
1008
|
-
marginBottom: "20@vs",
|
|
1009
|
-
backgroundColor: colors2.white[3],
|
|
1010
|
-
padding: "15@ms",
|
|
1011
|
-
borderRadius: 20
|
|
1012
|
-
},
|
|
1013
|
-
input: {
|
|
1014
|
-
fontSize: "16@ms",
|
|
1015
|
-
color: colors2.dark.main,
|
|
1016
|
-
height: "100@vs"
|
|
1017
|
-
}
|
|
1018
|
-
});
|
|
1019
|
-
(0, import_react12.useEffect)(() => {
|
|
1020
|
-
setRate(rating);
|
|
1021
|
-
}, [rating]);
|
|
1022
|
-
const onRate = (index) => {
|
|
1023
|
-
setRate(index + 1);
|
|
1024
|
-
Haptics.selectionAsync();
|
|
1025
|
-
setTimeout(() => {
|
|
1026
|
-
setShowReviewsModal(true);
|
|
1027
|
-
}, 500);
|
|
1028
|
-
};
|
|
1029
|
-
const onSubmit = async () => {
|
|
1030
|
-
setLoading(true);
|
|
1031
|
-
setShowReviewsModal(false);
|
|
1032
|
-
_onSubmit && await _onSubmit({ rating: rate, review });
|
|
1033
|
-
setLoading(false);
|
|
1034
|
-
};
|
|
1035
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_react_native12.View, { style: styles2.root }, loading ? /* @__PURE__ */ React.createElement(import_react_native12.ActivityIndicator, null) : [...Array(5)].map((_, index) => /* @__PURE__ */ React.createElement(
|
|
1036
|
-
import_react_native12.TouchableOpacity,
|
|
1037
|
-
{
|
|
1038
|
-
key: index,
|
|
1039
|
-
activeOpacity: 0.9,
|
|
1040
|
-
onPress: () => {
|
|
1041
|
-
onRate(index);
|
|
1042
|
-
}
|
|
1043
|
-
},
|
|
1044
|
-
/* @__PURE__ */ React.createElement(
|
|
1045
|
-
import_vector_icons5.Ionicons,
|
|
1046
|
-
{
|
|
1047
|
-
style: { marginLeft: 10 },
|
|
1048
|
-
name: index < rate ? "star" : "star-outline",
|
|
1049
|
-
size,
|
|
1050
|
-
color: colors2.primary.light
|
|
1051
|
-
}
|
|
1052
|
-
)
|
|
1053
|
-
))), /* @__PURE__ */ React.createElement(
|
|
1054
|
-
Popup,
|
|
1055
|
-
{
|
|
1056
|
-
sheet: true,
|
|
1057
|
-
open: showReviewsModal,
|
|
1058
|
-
onClose: () => {
|
|
1059
|
-
setShowReviewsModal(false);
|
|
1060
|
-
}
|
|
1061
|
-
},
|
|
1062
|
-
/* @__PURE__ */ React.createElement(
|
|
1063
|
-
import_react_native12.View,
|
|
1064
|
-
{
|
|
1065
|
-
style: {
|
|
1066
|
-
alignItems: "center",
|
|
1067
|
-
marginBottom: 5
|
|
1068
|
-
}
|
|
1069
|
-
},
|
|
1070
|
-
/* @__PURE__ */ React.createElement(RatingStars, { rating: rate, size: 24 })
|
|
1071
|
-
),
|
|
1072
|
-
/* @__PURE__ */ React.createElement(
|
|
1073
|
-
Typography_default,
|
|
1074
|
-
{
|
|
1075
|
-
align: "center",
|
|
1076
|
-
fontWeight: 700,
|
|
1077
|
-
variant: "h5",
|
|
1078
|
-
gutterBottom: 20
|
|
1079
|
-
},
|
|
1080
|
-
"Add to your review"
|
|
1081
|
-
),
|
|
1082
|
-
/* @__PURE__ */ React.createElement(import_react_native12.View, { style: styles2.inputCon }, /* @__PURE__ */ React.createElement(
|
|
1083
|
-
import_react_native12.TextInput,
|
|
1084
|
-
{
|
|
1085
|
-
style: styles2.input,
|
|
1086
|
-
multiline: true,
|
|
1087
|
-
value: review,
|
|
1088
|
-
onChangeText: (text) => setReview(text),
|
|
1089
|
-
placeholder: "Type review here.."
|
|
1090
|
-
}
|
|
1091
|
-
)),
|
|
1092
|
-
/* @__PURE__ */ React.createElement(
|
|
1093
|
-
Button_default,
|
|
1094
|
-
{
|
|
1095
|
-
gutterBottom: 40,
|
|
1096
|
-
title: "Submit Review",
|
|
1097
|
-
loading,
|
|
1098
|
-
disabled: loading,
|
|
1099
|
-
onPress: () => {
|
|
1100
|
-
onSubmit();
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
)
|
|
1104
|
-
));
|
|
1105
|
-
};
|
|
1106
|
-
|
|
1107
|
-
// ../src/Components/Grid.tsx
|
|
1108
|
-
var import_react_native13 = require("react-native");
|
|
1109
|
-
var import_react13 = __toESM(require("react"));
|
|
1110
|
-
var import_react_native_size_matters11 = require("react-native-size-matters");
|
|
1111
|
-
var GridItem = ({
|
|
1112
|
-
children,
|
|
1113
|
-
col = 2,
|
|
1114
|
-
alignItems,
|
|
1115
|
-
spacing = 1,
|
|
1116
|
-
style = {}
|
|
1117
|
-
}) => {
|
|
1118
|
-
const styles2 = import_react_native_size_matters11.ScaledSheet.create({
|
|
1119
|
-
gridItem: {
|
|
1120
|
-
width: 100 / col + "%",
|
|
1121
|
-
padding: spacing * 10 + "@ms",
|
|
1122
|
-
alignItems
|
|
1123
|
-
}
|
|
1124
|
-
});
|
|
1125
|
-
return /* @__PURE__ */ import_react13.default.createElement(import_react_native13.View, { children, style: [styles2.gridItem, style] });
|
|
1126
|
-
};
|
|
1127
|
-
var Grid = ({
|
|
1128
|
-
children,
|
|
1129
|
-
spacing = 1,
|
|
1130
|
-
style = {}
|
|
1131
|
-
}) => {
|
|
1132
|
-
const styles2 = import_react_native_size_matters11.ScaledSheet.create({
|
|
1133
|
-
grid: {
|
|
1134
|
-
flexWrap: "wrap",
|
|
1135
|
-
margin: -spacing * 10 + "@ms",
|
|
1136
|
-
flexDirection: "row"
|
|
1137
|
-
}
|
|
1138
|
-
});
|
|
1139
|
-
return /* @__PURE__ */ import_react13.default.createElement(import_react_native13.View, { children, style: [styles2.grid, style] });
|
|
1140
|
-
};
|
|
1141
|
-
|
|
1142
|
-
// ../src/Components/Locator.tsx
|
|
1143
|
-
var import_vector_icons9 = require("@expo/vector-icons");
|
|
1144
|
-
var import_react17 = __toESM(require("react"));
|
|
1145
|
-
var import_react_native17 = require("react-native");
|
|
1146
|
-
|
|
1147
|
-
// ../src/Components/List.tsx
|
|
1148
|
-
var import_vector_icons6 = require("@expo/vector-icons");
|
|
1149
|
-
var import_react14 = __toESM(require("react"));
|
|
1150
|
-
var import_react_native14 = require("react-native");
|
|
1151
|
-
var import_react_native_size_matters12 = require("react-native-size-matters");
|
|
1152
|
-
var ListItem = ({
|
|
1153
|
-
link = false,
|
|
1154
|
-
divider = false,
|
|
1155
|
-
onPress,
|
|
1156
|
-
index = 1,
|
|
1157
|
-
style = {},
|
|
1158
|
-
children
|
|
1159
|
-
}) => {
|
|
1160
|
-
const colors2 = useColors();
|
|
1161
|
-
const styles2 = import_react_native_size_matters12.ScaledSheet.create({
|
|
1162
|
-
root: {
|
|
1163
|
-
flexDirection: "row",
|
|
1164
|
-
alignItems: "center",
|
|
1165
|
-
paddingHorizontal: "10@s",
|
|
1166
|
-
borderBottomColor: colors2.white[4],
|
|
1167
|
-
borderBottomWidth: divider ? 1 : 0,
|
|
1168
|
-
paddingVertical: "10@vs"
|
|
1169
|
-
}
|
|
1170
|
-
});
|
|
1171
|
-
return /* @__PURE__ */ import_react14.default.createElement(
|
|
1172
|
-
import_react_native14.View,
|
|
1173
|
-
null,
|
|
1174
|
-
/* @__PURE__ */ import_react14.default.createElement(import_react_native14.TouchableOpacity, { disabled: Boolean(!onPress), onPress }, /* @__PURE__ */ import_react14.default.createElement(import_react_native14.View, { style: { ...styles2.root, ...style } }, children, link && /* @__PURE__ */ import_react14.default.createElement(
|
|
1175
|
-
import_vector_icons6.MaterialIcons,
|
|
1176
|
-
{
|
|
1177
|
-
color: colors2.white[5],
|
|
1178
|
-
style: { marginLeft: "auto" },
|
|
1179
|
-
name: "arrow-forward-ios",
|
|
1180
|
-
size: 15
|
|
1181
|
-
}
|
|
1182
|
-
)))
|
|
1183
|
-
);
|
|
1184
|
-
};
|
|
1185
|
-
|
|
1186
|
-
// ../src/Components/TextField.tsx
|
|
1187
|
-
var import_vector_icons8 = require("@expo/vector-icons");
|
|
1188
|
-
var import_react16 = __toESM(require("react"));
|
|
1189
|
-
var import_react_native16 = require("react-native");
|
|
1190
|
-
var import_react_native_size_matters14 = require("react-native-size-matters");
|
|
1191
|
-
|
|
1192
|
-
// ../src/Components/SelectMenu.tsx
|
|
1193
|
-
var import_vector_icons7 = require("@expo/vector-icons");
|
|
1194
|
-
var import_react15 = __toESM(require("react"));
|
|
1195
|
-
var import_react_native15 = require("react-native");
|
|
1196
|
-
var import_react_native_safe_area_context3 = require("react-native-safe-area-context");
|
|
1197
|
-
var import_react_native_size_matters13 = require("react-native-size-matters");
|
|
1198
|
-
var SelectMenu = ({
|
|
1199
|
-
open = false,
|
|
1200
|
-
onClose,
|
|
1201
|
-
value,
|
|
1202
|
-
options = [],
|
|
1203
|
-
onChange,
|
|
1204
|
-
disableAutoClose = false,
|
|
1205
|
-
label,
|
|
1206
|
-
secondary,
|
|
1207
|
-
helperText
|
|
1208
|
-
}) => {
|
|
1209
|
-
const colors2 = useColors();
|
|
1210
|
-
const { bottom } = (0, import_react_native_safe_area_context3.useSafeAreaInsets)();
|
|
1211
|
-
const [search, setSearch] = (0, import_react15.useState)("");
|
|
1212
|
-
const styles2 = import_react_native_size_matters13.ScaledSheet.create({
|
|
1213
|
-
root: {
|
|
1214
|
-
backgroundColor: colors2.white[1],
|
|
1215
|
-
flex: 1
|
|
1216
|
-
},
|
|
1217
|
-
content: {
|
|
1218
|
-
flex: 1,
|
|
1219
|
-
paddingHorizontal: "10@ms"
|
|
1220
|
-
},
|
|
1221
|
-
header: {
|
|
1222
|
-
paddingTop: "80@ms",
|
|
1223
|
-
marginBottom: "20@vs"
|
|
1224
|
-
},
|
|
1225
|
-
option: {
|
|
1226
|
-
paddingHorizontal: "10@s",
|
|
1227
|
-
paddingVertical: "10@vs",
|
|
1228
|
-
borderRadius: 8,
|
|
1229
|
-
flexDirection: "row",
|
|
1230
|
-
alignItems: "center",
|
|
1231
|
-
marginBottom: "10@vs"
|
|
1232
|
-
},
|
|
1233
|
-
footer: {
|
|
1234
|
-
paddingBottom: bottom,
|
|
1235
|
-
paddingHorizontal: "15@ms",
|
|
1236
|
-
paddingTop: "15@ms"
|
|
1237
|
-
}
|
|
1238
|
-
});
|
|
1239
|
-
const renderItem = (0, import_react15.useCallback)(
|
|
1240
|
-
({ item }) => /* @__PURE__ */ import_react15.default.createElement(
|
|
1241
|
-
import_react_native15.TouchableOpacity,
|
|
1242
|
-
{
|
|
1243
|
-
style: {
|
|
1244
|
-
...styles2.option,
|
|
1245
|
-
backgroundColor: item.value === value ? colors2.blue.light + "2" : colors2.white[2]
|
|
1246
|
-
},
|
|
1247
|
-
onPress: () => {
|
|
1248
|
-
onChange(item.value);
|
|
1249
|
-
if (!disableAutoClose)
|
|
1250
|
-
onClose();
|
|
1251
|
-
},
|
|
1252
|
-
key: item.label
|
|
1253
|
-
},
|
|
1254
|
-
item.start && /* @__PURE__ */ import_react15.default.createElement(import_react_native15.View, { style: { marginRight: 10 } }, item.start),
|
|
1255
|
-
/* @__PURE__ */ import_react15.default.createElement(import_react_native15.View, { style: { flex: 1 } }, /* @__PURE__ */ import_react15.default.createElement(
|
|
1256
|
-
Typography_default,
|
|
1257
|
-
{
|
|
1258
|
-
style: {
|
|
1259
|
-
color: item.value === value ? colors2.blue.light : colors2.black[2]
|
|
1260
|
-
}
|
|
1261
|
-
},
|
|
1262
|
-
item.label
|
|
1263
|
-
), item.secondary ? /* @__PURE__ */ import_react15.default.createElement(
|
|
1264
|
-
Typography_default,
|
|
1265
|
-
{
|
|
1266
|
-
variant: "body2",
|
|
1267
|
-
style: {
|
|
1268
|
-
marginTop: 2,
|
|
1269
|
-
color: item.value === value ? colors2.blue.light : colors2.white[5]
|
|
1270
|
-
}
|
|
1271
|
-
},
|
|
1272
|
-
item.secondary
|
|
1273
|
-
) : null),
|
|
1274
|
-
value === item.value && /* @__PURE__ */ import_react15.default.createElement(
|
|
1275
|
-
import_vector_icons7.MaterialIcons,
|
|
1276
|
-
{
|
|
1277
|
-
name: "check",
|
|
1278
|
-
color: colors2.blue.light,
|
|
1279
|
-
size: 24,
|
|
1280
|
-
style: { marginLeft: "auto" }
|
|
1281
|
-
}
|
|
1282
|
-
)
|
|
1283
|
-
),
|
|
1284
|
-
[value, colors2]
|
|
1285
|
-
);
|
|
1286
|
-
return /* @__PURE__ */ import_react15.default.createElement(import_react_native15.Modal, { visible: open, animationType: "slide", onRequestClose: onClose }, /* @__PURE__ */ import_react15.default.createElement(import_react_native15.View, { style: styles2.root }, /* @__PURE__ */ import_react15.default.createElement(import_react_native15.View, { style: styles2.content }, /* @__PURE__ */ import_react15.default.createElement(import_react_native15.View, { style: styles2.header }, /* @__PURE__ */ import_react15.default.createElement(Typography_default, { variant: "h5", gutterBottom: 5, fontWeight: 700 }, label), helperText ? /* @__PURE__ */ import_react15.default.createElement(Typography_default, { variant: "body2", color: "textSecondary" }, helperText) : null, /* @__PURE__ */ import_react15.default.createElement(
|
|
1287
|
-
TextField_default,
|
|
1288
|
-
{
|
|
1289
|
-
label: "Search",
|
|
1290
|
-
value: search,
|
|
1291
|
-
type: "search",
|
|
1292
|
-
onChangeText: setSearch,
|
|
1293
|
-
variant: "outlined"
|
|
1294
|
-
}
|
|
1295
|
-
)), /* @__PURE__ */ import_react15.default.createElement(
|
|
1296
|
-
import_react_native15.FlatList,
|
|
1297
|
-
{
|
|
1298
|
-
removeClippedSubviews: true,
|
|
1299
|
-
keyExtractor: (item) => item.value,
|
|
1300
|
-
renderItem,
|
|
1301
|
-
data: options.filter(
|
|
1302
|
-
(item) => search.length > 1 ? item.label.toLowerCase().indexOf(search.toLowerCase()) > -1 : item
|
|
1303
|
-
).sort((a, b) => a.label.localeCompare(b.label))
|
|
1304
|
-
}
|
|
1305
|
-
)), /* @__PURE__ */ import_react15.default.createElement(import_react_native15.View, { style: styles2.footer }, /* @__PURE__ */ import_react15.default.createElement(
|
|
1306
|
-
Button_default,
|
|
1307
|
-
{
|
|
1308
|
-
color: "error",
|
|
1309
|
-
variant: "outlined",
|
|
1310
|
-
fullWidth: true,
|
|
1311
|
-
title: "Close",
|
|
1312
|
-
onPress: onClose
|
|
1313
|
-
}
|
|
1314
|
-
))));
|
|
1315
|
-
};
|
|
1316
|
-
var SelectMenu_default = SelectMenu;
|
|
1317
|
-
|
|
1318
|
-
// ../src/Components/TextField.tsx
|
|
1319
|
-
var TextField = ({
|
|
1320
|
-
label,
|
|
1321
|
-
keyboardType,
|
|
1322
|
-
variant,
|
|
1323
|
-
color = "primary",
|
|
1324
|
-
value,
|
|
1325
|
-
type,
|
|
1326
|
-
helperText,
|
|
1327
|
-
onChangeText,
|
|
1328
|
-
onSubmitEditing = () => {
|
|
1329
|
-
},
|
|
1330
|
-
onFocus = () => {
|
|
1331
|
-
},
|
|
1332
|
-
onBlur = () => {
|
|
1333
|
-
},
|
|
1334
|
-
error,
|
|
1335
|
-
start,
|
|
1336
|
-
size = "normal",
|
|
1337
|
-
rounded,
|
|
1338
|
-
disabled = false,
|
|
1339
|
-
style = {},
|
|
1340
|
-
inputStyles = {},
|
|
1341
|
-
gutterBottom = 0,
|
|
1342
|
-
end,
|
|
1343
|
-
options,
|
|
1344
|
-
...props
|
|
1345
|
-
}) => {
|
|
1346
|
-
const colors2 = useColors();
|
|
1347
|
-
const [focused, setFocused] = (0, import_react16.useState)(false);
|
|
1348
|
-
const labelAnim = (0, import_react16.useRef)(new import_react_native16.Animated.Value(0)).current;
|
|
1349
|
-
const height = (0, import_react_native_size_matters14.moderateScale)(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1);
|
|
1350
|
-
import_react16.default.useEffect(() => {
|
|
1351
|
-
if (focused || value) {
|
|
1352
|
-
import_react_native16.Animated.timing(labelAnim, {
|
|
1353
|
-
toValue: (0, import_react_native_size_matters14.verticalScale)(variant === "text" ? 2 : 4),
|
|
1354
|
-
duration: 300,
|
|
1355
|
-
useNativeDriver: false
|
|
1356
|
-
}).start();
|
|
1357
|
-
} else {
|
|
1358
|
-
import_react_native16.Animated.timing(labelAnim, {
|
|
1359
|
-
toValue: height / (0, import_react_native_size_matters14.moderateScale)(variant === "text" ? 2.5 : 3.2),
|
|
1360
|
-
duration: 300,
|
|
1361
|
-
useNativeDriver: false
|
|
1362
|
-
}).start();
|
|
1363
|
-
}
|
|
1364
|
-
}, [focused, value]);
|
|
1365
|
-
const styles2 = import_react_native_size_matters14.ScaledSheet.create({
|
|
1366
|
-
root: {
|
|
1367
|
-
marginBottom: gutterBottom + "@vs",
|
|
1368
|
-
width: "100%",
|
|
1369
|
-
...style
|
|
1370
|
-
},
|
|
1371
|
-
container: {
|
|
1372
|
-
height,
|
|
1373
|
-
overflow: "hidden",
|
|
1374
|
-
backgroundColor: variant === "outlined" || variant === "text" ? "#fff0" : focused ? colors2.white[3] : colors2.white[4],
|
|
1375
|
-
flexDirection: "row",
|
|
1376
|
-
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.textSecondary.main,
|
|
1377
|
-
borderWidth: error ? 1 : variant === "outlined" ? focused ? 2 : 0.5 : 0,
|
|
1378
|
-
borderBottomWidth: variant === "text" ? 0.5 : void 0,
|
|
1379
|
-
width: "100%",
|
|
1380
|
-
borderRadius: variant === "text" ? 0 : rounded ? 30 : 7,
|
|
1381
|
-
alignItems: "center",
|
|
1382
|
-
...inputStyles
|
|
1383
|
-
},
|
|
1384
|
-
input: {
|
|
1385
|
-
fontSize: "14@s",
|
|
1386
|
-
flex: 1,
|
|
1387
|
-
alignSelf: "stretch",
|
|
1388
|
-
paddingLeft: variant === "text" ? 0 : (0, import_react_native_size_matters14.moderateScale)(15),
|
|
1389
|
-
paddingRight: (0, import_react_native_size_matters14.moderateScale)(10),
|
|
1390
|
-
paddingTop: "11@vs",
|
|
1391
|
-
color: colors2.black[1],
|
|
1392
|
-
zIndex: 10
|
|
1393
|
-
// backgroundColor: "#284",
|
|
1394
|
-
},
|
|
1395
|
-
inputText: {
|
|
1396
|
-
fontSize: "14@ms",
|
|
1397
|
-
flex: 1,
|
|
1398
|
-
paddingLeft: variant === "text" ? 0 : (0, import_react_native_size_matters14.moderateScale)(15),
|
|
1399
|
-
paddingTop: "13@ms"
|
|
1400
|
-
},
|
|
1401
|
-
label: {
|
|
1402
|
-
position: "absolute",
|
|
1403
|
-
left: variant === "text" ? 0 : (0, import_react_native_size_matters14.moderateScale)(15),
|
|
1404
|
-
fontSize: focused || value ? "10@s" : "13@s",
|
|
1405
|
-
color: focused ? colors2[color].main : colors2.textSecondary.main
|
|
1406
|
-
},
|
|
1407
|
-
helperText: {
|
|
1408
|
-
paddingHorizontal: "15@s",
|
|
1409
|
-
flex: 1,
|
|
1410
|
-
color: focused ? colors2[color].dark : colors2.textSecondary.main,
|
|
1411
|
-
paddingTop: "4@ms"
|
|
1412
|
-
},
|
|
1413
|
-
error: {
|
|
1414
|
-
paddingLeft: 10,
|
|
1415
|
-
paddingRight: 10,
|
|
1416
|
-
paddingTop: 5,
|
|
1417
|
-
flexDirection: "row",
|
|
1418
|
-
alignItems: "center"
|
|
1419
|
-
},
|
|
1420
|
-
errorText: {
|
|
1421
|
-
fontSize: 12,
|
|
1422
|
-
marginLeft: 10
|
|
1423
|
-
}
|
|
1424
|
-
});
|
|
1425
|
-
const formProps = type === "email" ? {
|
|
1426
|
-
textContentType: "emailAddress",
|
|
1427
|
-
keyboardType: "email-address",
|
|
1428
|
-
autoCapitalize: "none",
|
|
1429
|
-
autoCompleteType: "email"
|
|
1430
|
-
} : type === "number" ? {
|
|
1431
|
-
keyboardType: "numeric"
|
|
1432
|
-
} : type === "tel" ? {
|
|
1433
|
-
textContentType: "telephoneNumber",
|
|
1434
|
-
keyboardType: "phone-pad"
|
|
1435
|
-
} : type === "search" ? {
|
|
1436
|
-
keyboardType: "web-search",
|
|
1437
|
-
returnKeyType: "search",
|
|
1438
|
-
autoCapitalize: "none"
|
|
1439
|
-
} : type === "password" ? {
|
|
1440
|
-
secureTextEntry: true,
|
|
1441
|
-
autoCompleteType: "password",
|
|
1442
|
-
autoCapitalize: "none",
|
|
1443
|
-
textContentType: "password"
|
|
1444
|
-
} : {};
|
|
1445
|
-
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.root }, /* @__PURE__ */ import_react16.default.createElement(
|
|
1446
|
-
import_react_native16.TouchableOpacity,
|
|
1447
|
-
{
|
|
1448
|
-
onPress: () => setFocused(true),
|
|
1449
|
-
style: styles2.container
|
|
1450
|
-
},
|
|
1451
|
-
/* @__PURE__ */ import_react16.default.createElement(import_react_native16.Animated.Text, { style: { ...styles2.label, top: labelAnim } }, label),
|
|
1452
|
-
start,
|
|
1453
|
-
options ? /* @__PURE__ */ import_react16.default.createElement(
|
|
1454
|
-
import_react_native16.View,
|
|
1455
|
-
{
|
|
1456
|
-
style: { flex: 1, alignItems: "center", flexDirection: "row" }
|
|
1457
|
-
},
|
|
1458
|
-
options.find((cur) => cur.value === value)?.start && /* @__PURE__ */ import_react16.default.createElement(
|
|
1459
|
-
import_react_native16.View,
|
|
1460
|
-
{
|
|
1461
|
-
style: {
|
|
1462
|
-
paddingTop: variant !== "outlined" ? (0, import_react_native_size_matters14.ms)(13) : 0,
|
|
1463
|
-
paddingRight: 10
|
|
1464
|
-
}
|
|
1465
|
-
},
|
|
1466
|
-
options.find((cur) => cur.value === value)?.start
|
|
1467
|
-
),
|
|
1468
|
-
/* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.inputText }, options.find((cur) => cur.value === value)?.label)
|
|
1469
|
-
) : /* @__PURE__ */ import_react16.default.createElement(
|
|
1470
|
-
import_react_native16.TextInput,
|
|
1471
|
-
{
|
|
1472
|
-
onFocus: () => {
|
|
1473
|
-
onFocus();
|
|
1474
|
-
setFocused(true);
|
|
1475
|
-
},
|
|
1476
|
-
onBlur: () => {
|
|
1477
|
-
onBlur();
|
|
1478
|
-
setFocused(false);
|
|
1479
|
-
},
|
|
1480
|
-
value,
|
|
1481
|
-
onChangeText,
|
|
1482
|
-
keyboardType,
|
|
1483
|
-
editable: !disabled,
|
|
1484
|
-
selectTextOnFocus: !disabled,
|
|
1485
|
-
onSubmitEditing,
|
|
1486
|
-
placeholderTextColor: colors2.textSecondary.main,
|
|
1487
|
-
...formProps,
|
|
1488
|
-
...props,
|
|
1489
|
-
style: styles2.input
|
|
1490
|
-
}
|
|
1491
|
-
),
|
|
1492
|
-
end && /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginRight: 20 } }, end),
|
|
1493
|
-
options && /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginRight: 20 } }, /* @__PURE__ */ import_react16.default.createElement(
|
|
1494
|
-
import_vector_icons8.Ionicons,
|
|
1495
|
-
{
|
|
1496
|
-
name: "chevron-down",
|
|
1497
|
-
color: colors2.textSecondary.main,
|
|
1498
|
-
size: 24
|
|
1499
|
-
}
|
|
1500
|
-
))
|
|
1501
|
-
), helperText && /* @__PURE__ */ import_react16.default.createElement(
|
|
1502
|
-
Typography_default,
|
|
1503
|
-
{
|
|
1504
|
-
color: "textSecondary",
|
|
1505
|
-
style: styles2.helperText,
|
|
1506
|
-
variant: "caption"
|
|
1507
|
-
},
|
|
1508
|
-
helperText
|
|
1509
|
-
), 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(
|
|
1510
|
-
SelectMenu_default,
|
|
1511
|
-
{
|
|
1512
|
-
options,
|
|
1513
|
-
value,
|
|
1514
|
-
open: focused,
|
|
1515
|
-
onClose: () => setFocused(false),
|
|
1516
|
-
label,
|
|
1517
|
-
helperText,
|
|
1518
|
-
onChange: onChangeText
|
|
1519
|
-
}
|
|
1520
|
-
));
|
|
1521
|
-
};
|
|
1522
|
-
var TextField2 = ({
|
|
1523
|
-
label,
|
|
1524
|
-
keyboardType,
|
|
1525
|
-
variant,
|
|
1526
|
-
color = "primary",
|
|
1527
|
-
value,
|
|
1528
|
-
type,
|
|
1529
|
-
helperText,
|
|
1530
|
-
onChangeText,
|
|
1531
|
-
onSubmitEditing = () => {
|
|
1532
|
-
},
|
|
1533
|
-
onFocus = () => {
|
|
1534
|
-
},
|
|
1535
|
-
onBlur = () => {
|
|
1536
|
-
},
|
|
1537
|
-
error,
|
|
1538
|
-
start,
|
|
1539
|
-
rounded,
|
|
1540
|
-
disabled = false,
|
|
1541
|
-
style = {},
|
|
1542
|
-
inputStyles = {},
|
|
1543
|
-
gutterBottom = 8,
|
|
1544
|
-
placeholder,
|
|
1545
|
-
end,
|
|
1546
|
-
options,
|
|
1547
|
-
...props
|
|
1548
|
-
}) => {
|
|
1549
|
-
const colors2 = useColors();
|
|
1550
|
-
const [focused, _setFocused] = (0, import_react16.useState)(false);
|
|
1551
|
-
const [showPassword, setShowPassword] = (0, import_react16.useState)(false);
|
|
1552
|
-
const height = (0, import_react_native_size_matters14.moderateScale)(
|
|
1553
|
-
props.multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1554
|
-
);
|
|
1555
|
-
const setFocused = (value2) => {
|
|
1556
|
-
(0, import_react16.startTransition)(() => {
|
|
1557
|
-
_setFocused(value2);
|
|
1558
|
-
});
|
|
1559
|
-
};
|
|
1560
|
-
const styles2 = import_react_native_size_matters14.ScaledSheet.create({
|
|
1561
|
-
root: {
|
|
1562
|
-
marginBottom: gutterBottom + "@vs",
|
|
1563
|
-
...style
|
|
1564
|
-
},
|
|
1565
|
-
container: {
|
|
1566
|
-
height,
|
|
1567
|
-
overflow: "hidden",
|
|
1568
|
-
flexDirection: "row",
|
|
1569
|
-
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[5],
|
|
1570
|
-
borderWidth: error ? 1 : focused ? 2 : 1,
|
|
1571
|
-
width: "100%",
|
|
1572
|
-
borderRadius: rounded ? 30 : 10,
|
|
1573
|
-
alignItems: "center",
|
|
1574
|
-
...inputStyles
|
|
1575
|
-
},
|
|
1576
|
-
input: {
|
|
1577
|
-
fontSize: "14@s",
|
|
1578
|
-
flex: 1,
|
|
1579
|
-
alignSelf: "stretch",
|
|
1580
|
-
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10),
|
|
1581
|
-
paddingRight: (0, import_react_native_size_matters14.moderateScale)(10),
|
|
1582
|
-
color: colors2.dark.light,
|
|
1583
|
-
zIndex: 10
|
|
1584
|
-
// backgroundColor: "#284",
|
|
1585
|
-
},
|
|
1586
|
-
inputText: {
|
|
1587
|
-
fontSize: "14@ms",
|
|
1588
|
-
color: colors2.dark.light,
|
|
1589
|
-
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
|
|
1590
|
-
},
|
|
1591
|
-
placeholder: {
|
|
1592
|
-
fontSize: "14@ms",
|
|
1593
|
-
color: colors2.textSecondary.main,
|
|
1594
|
-
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
|
|
1595
|
-
},
|
|
1596
|
-
label: {},
|
|
1597
|
-
helperText: {
|
|
1598
|
-
paddingHorizontal: "15@s",
|
|
1599
|
-
color: focused ? colors2[color].dark : "#fffa",
|
|
1600
|
-
paddingTop: "4@ms"
|
|
1601
|
-
},
|
|
1602
|
-
error: {
|
|
1603
|
-
paddingLeft: 10,
|
|
1604
|
-
paddingRight: 10,
|
|
1605
|
-
paddingTop: 5,
|
|
1606
|
-
flexDirection: "row",
|
|
1607
|
-
alignItems: "center"
|
|
1608
|
-
},
|
|
1609
|
-
errorText: {
|
|
1610
|
-
fontSize: 12,
|
|
1611
|
-
marginLeft: 10
|
|
1612
|
-
}
|
|
1613
|
-
});
|
|
1614
|
-
const formProps = type === "email" ? {
|
|
1615
|
-
textContentType: "emailAddress",
|
|
1616
|
-
keyboardType: "email-address",
|
|
1617
|
-
autoCapitalize: "none",
|
|
1618
|
-
autoCompleteType: "email"
|
|
1619
|
-
} : type === "number" ? {
|
|
1620
|
-
keyboardType: "numeric"
|
|
1621
|
-
} : type === "tel" ? {
|
|
1622
|
-
textContentType: "telephoneNumber",
|
|
1623
|
-
keyboardType: "phone-pad"
|
|
1624
|
-
} : type === "search" ? {
|
|
1625
|
-
keyboardType: "web-search",
|
|
1626
|
-
returnKeyType: "search",
|
|
1627
|
-
autoCapitalize: "none"
|
|
1628
|
-
} : type === "password" ? {
|
|
1629
|
-
secureTextEntry: !showPassword,
|
|
1630
|
-
autoCompleteType: "password",
|
|
1631
|
-
autoCapitalize: "none",
|
|
1632
|
-
textContentType: "password"
|
|
1633
|
-
} : {};
|
|
1634
|
-
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(
|
|
1635
|
-
import_react_native16.TouchableOpacity,
|
|
1636
|
-
{
|
|
1637
|
-
onPress: () => setFocused(true),
|
|
1638
|
-
style: styles2.container
|
|
1639
|
-
},
|
|
1640
|
-
start,
|
|
1641
|
-
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(
|
|
1642
|
-
import_vector_icons8.Ionicons,
|
|
1643
|
-
{
|
|
1644
|
-
name: "chevron-down",
|
|
1645
|
-
size: 24,
|
|
1646
|
-
style: { marginLeft: "auto", marginRight: 15 },
|
|
1647
|
-
color: colors2.dark.light
|
|
1648
|
-
}
|
|
1649
|
-
)) : /* @__PURE__ */ import_react16.default.createElement(
|
|
1650
|
-
import_react_native16.TextInput,
|
|
1651
|
-
{
|
|
1652
|
-
onFocus: () => {
|
|
1653
|
-
onFocus();
|
|
1654
|
-
setFocused(true);
|
|
1655
|
-
},
|
|
1656
|
-
onBlur: () => {
|
|
1657
|
-
onBlur();
|
|
1658
|
-
setFocused(false);
|
|
1659
|
-
},
|
|
1660
|
-
value,
|
|
1661
|
-
onChangeText,
|
|
1662
|
-
key: showPassword ? "show" : "hide",
|
|
1663
|
-
keyboardType,
|
|
1664
|
-
placeholderTextColor: colors2.textSecondary.main,
|
|
1665
|
-
editable: !disabled,
|
|
1666
|
-
placeholder,
|
|
1667
|
-
selectTextOnFocus: !disabled,
|
|
1668
|
-
onSubmitEditing,
|
|
1669
|
-
...formProps,
|
|
1670
|
-
...props,
|
|
1671
|
-
style: styles2.input
|
|
1672
|
-
}
|
|
1673
|
-
),
|
|
1674
|
-
end ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginRight: 20 } }, end) : type === "password" && /* @__PURE__ */ import_react16.default.createElement(
|
|
1675
|
-
import_react_native16.TouchableOpacity,
|
|
1676
|
-
{
|
|
1677
|
-
style: { marginRight: 20 },
|
|
1678
|
-
onPress: () => setShowPassword(!showPassword)
|
|
1679
|
-
},
|
|
1680
|
-
/* @__PURE__ */ import_react16.default.createElement(
|
|
1681
|
-
import_vector_icons8.Ionicons,
|
|
1682
|
-
{
|
|
1683
|
-
name: showPassword ? "eye-outline" : "eye-off-outline",
|
|
1684
|
-
size: 24,
|
|
1685
|
-
color: colors2.textSecondary.main
|
|
1686
|
-
}
|
|
1687
|
-
)
|
|
1688
|
-
)
|
|
1689
|
-
), helperText && /* @__PURE__ */ import_react16.default.createElement(
|
|
1690
|
-
Typography_default,
|
|
1691
|
-
{
|
|
1692
|
-
color: "textSecondary",
|
|
1693
|
-
style: styles2.helperText,
|
|
1694
|
-
variant: "caption"
|
|
1695
|
-
},
|
|
1696
|
-
helperText
|
|
1697
|
-
), 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(
|
|
1698
|
-
SelectMenu_default,
|
|
1699
|
-
{
|
|
1700
|
-
options,
|
|
1701
|
-
value,
|
|
1702
|
-
open: focused,
|
|
1703
|
-
onClose: () => setFocused(false),
|
|
1704
|
-
label,
|
|
1705
|
-
helperText,
|
|
1706
|
-
onChange: onChangeText
|
|
1707
|
-
}
|
|
1708
|
-
));
|
|
1709
|
-
};
|
|
1710
|
-
var TextField_default = TextField;
|
|
1711
|
-
|
|
1712
|
-
// ../src/Components/Locator.tsx
|
|
1713
|
-
var Location = __toESM(require("expo-location"));
|
|
1714
|
-
var import_react_native_size_matters15 = require("react-native-size-matters");
|
|
1715
|
-
setTimeout(() => {
|
|
1716
|
-
const { GOOGLE_MAP_API_KEY } = getApiKey();
|
|
1717
|
-
if (GOOGLE_MAP_API_KEY)
|
|
1718
|
-
Location.setGoogleApiKey(GOOGLE_MAP_API_KEY);
|
|
1719
|
-
}, 500);
|
|
1720
|
-
var getPredictionsFromCoords = async (coords) => {
|
|
1721
|
-
const { GOOGLE_MAP_API_KEY } = getApiKey();
|
|
1722
|
-
if (!GOOGLE_MAP_API_KEY)
|
|
1723
|
-
console.error(
|
|
1724
|
-
"Google map api key needs to be set to use this component \nMake sure to run initialize() with a valid google map api key"
|
|
1725
|
-
);
|
|
1726
|
-
if (!coords)
|
|
1727
|
-
return [];
|
|
1728
|
-
const res = await (await fetch(
|
|
1729
|
-
`https://maps.googleapis.com/maps/api/geocode/json?radius=200&latlng=${coords.latitude},${coords.longitude}&key=${GOOGLE_MAP_API_KEY}`
|
|
1730
|
-
)).json();
|
|
1731
|
-
const p = [];
|
|
1732
|
-
for (let key in res.results) {
|
|
1733
|
-
const { formatted_address: description, place_id } = res.results[key];
|
|
1734
|
-
p.push({
|
|
1735
|
-
description,
|
|
1736
|
-
id: place_id,
|
|
1737
|
-
latLng: { lst: coords.latitude, lng: coords.longitude }
|
|
1738
|
-
});
|
|
1739
|
-
}
|
|
1740
|
-
return p;
|
|
1741
|
-
};
|
|
1742
|
-
var Locator = ({
|
|
1743
|
-
variant = "contained",
|
|
1744
|
-
onLocationSelected,
|
|
1745
|
-
label,
|
|
1746
|
-
error,
|
|
1747
|
-
location = {
|
|
1748
|
-
description: null
|
|
1749
|
-
},
|
|
1750
|
-
renderInput,
|
|
1751
|
-
gutterBottom = 0,
|
|
1752
|
-
helperText,
|
|
1753
|
-
float = true,
|
|
1754
|
-
country = "ng"
|
|
1755
|
-
}) => {
|
|
1756
|
-
const { GOOGLE_MAP_API_KEY } = getApiKey();
|
|
1757
|
-
const [changed, setChanged] = (0, import_react17.useState)(false);
|
|
1758
|
-
const [value, setValue] = (0, import_react17.useState)("");
|
|
1759
|
-
const [prediction, setPrediction] = (0, import_react17.useState)([]);
|
|
1760
|
-
const colors2 = useColors();
|
|
1761
|
-
const styles2 = import_react_native_size_matters15.ScaledSheet.create({
|
|
1762
|
-
list: {
|
|
1763
|
-
backgroundColor: colors2.white[2],
|
|
1764
|
-
elevation: 10,
|
|
1765
|
-
shadowColor: "#000",
|
|
1766
|
-
shadowOpacity: 0.1,
|
|
1767
|
-
shadowRadius: float ? 15 : 0,
|
|
1768
|
-
shadowOffset: {
|
|
1769
|
-
height: 10
|
|
1770
|
-
},
|
|
1771
|
-
borderRadius: 10,
|
|
1772
|
-
marginBottom: 10,
|
|
1773
|
-
width: "100%",
|
|
1774
|
-
zIndex: 20,
|
|
1775
|
-
marginTop: float ? 2 : "15@ms",
|
|
1776
|
-
top: float ? "100%" : void 0,
|
|
1777
|
-
position: float ? "absolute" : "relative"
|
|
1778
|
-
}
|
|
1779
|
-
});
|
|
1780
|
-
const search = async (query) => {
|
|
1781
|
-
const endpoint = `https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${query}&components=country:${country}&radius=20000&key=${GOOGLE_MAP_API_KEY}`;
|
|
1782
|
-
const res = await (await fetch(endpoint)).json();
|
|
1783
|
-
const p = [];
|
|
1784
|
-
for (let key in res.predictions) {
|
|
1785
|
-
const { description, place_id } = res.predictions[key];
|
|
1786
|
-
p.push({
|
|
1787
|
-
description,
|
|
1788
|
-
id: place_id
|
|
1789
|
-
});
|
|
1790
|
-
}
|
|
1791
|
-
setPrediction(p);
|
|
1792
|
-
};
|
|
1793
|
-
const locateMe = () => {
|
|
1794
|
-
const getLoc = async () => {
|
|
1795
|
-
const { status } = await Location.requestForegroundPermissionsAsync();
|
|
1796
|
-
if (status !== "granted")
|
|
1797
|
-
return import_react_native17.Alert.alert(
|
|
1798
|
-
"Error",
|
|
1799
|
-
"Permission to access location was denied! "
|
|
1800
|
-
);
|
|
1801
|
-
try {
|
|
1802
|
-
let { coords } = await Location.getCurrentPositionAsync({
|
|
1803
|
-
accuracy: Location.LocationAccuracy.High
|
|
1804
|
-
});
|
|
1805
|
-
const p = await getPredictionsFromCoords(coords);
|
|
1806
|
-
setPrediction(p);
|
|
1807
|
-
} catch (err) {
|
|
1808
|
-
console.log(err);
|
|
1809
|
-
import_react_native17.Alert.alert(
|
|
1810
|
-
"Can't access your location",
|
|
1811
|
-
"Make sure your location settings are turned on and you are connected to the internet. "
|
|
1812
|
-
);
|
|
1813
|
-
}
|
|
1814
|
-
};
|
|
1815
|
-
getLoc();
|
|
1816
|
-
};
|
|
1817
|
-
const clear = () => {
|
|
1818
|
-
setPrediction([]);
|
|
1819
|
-
setValue("");
|
|
1820
|
-
onLocationSelected(null);
|
|
1821
|
-
setChanged(false);
|
|
1822
|
-
};
|
|
1823
|
-
const locationPressed = async (loc) => {
|
|
1824
|
-
setValue(loc.description);
|
|
1825
|
-
const res = await (await fetch(
|
|
1826
|
-
`https://maps.googleapis.com/maps/api/place/details/json?place_id=${loc.id}&fields=formatted_address%2Cgeometry&key=${GOOGLE_MAP_API_KEY}`
|
|
1827
|
-
)).json();
|
|
1828
|
-
onLocationSelected(
|
|
1829
|
-
{
|
|
1830
|
-
latitude: res.result?.geometry.location.lat,
|
|
1831
|
-
longitude: res.result?.geometry.location.lng,
|
|
1832
|
-
description: loc.description
|
|
1833
|
-
},
|
|
1834
|
-
res.result?.formatted_address
|
|
1835
|
-
);
|
|
1836
|
-
setChanged(false);
|
|
1837
|
-
setPrediction([]);
|
|
1838
|
-
};
|
|
1839
|
-
(0, import_react17.useEffect)(() => {
|
|
1840
|
-
if (!GOOGLE_MAP_API_KEY)
|
|
1841
|
-
console.error(
|
|
1842
|
-
"Google map api key needs to be set to use this component \nMake sure to run initialize() with a valid google map api key"
|
|
1843
|
-
);
|
|
1844
|
-
}, [GOOGLE_MAP_API_KEY]);
|
|
1845
|
-
return /* @__PURE__ */ import_react17.default.createElement(import_react_native17.View, { style: { zIndex: 10 } }, renderInput ? renderInput({
|
|
1846
|
-
onFocus: () => search(value),
|
|
1847
|
-
onBlur: () => setPrediction([]),
|
|
1848
|
-
value: changed ? value : location?.description || value,
|
|
1849
|
-
onChangeText: (val) => {
|
|
1850
|
-
setChanged(true);
|
|
1851
|
-
setValue(val);
|
|
1852
|
-
search(val);
|
|
1853
|
-
},
|
|
1854
|
-
clear,
|
|
1855
|
-
locateMe
|
|
1856
|
-
}) : /* @__PURE__ */ import_react17.default.createElement(
|
|
1857
|
-
TextField_default,
|
|
1858
|
-
{
|
|
1859
|
-
label,
|
|
1860
|
-
onChangeText: (val) => {
|
|
1861
|
-
setChanged(true);
|
|
1862
|
-
setValue(val);
|
|
1863
|
-
search(val);
|
|
1864
|
-
},
|
|
1865
|
-
onBlur: () => {
|
|
1866
|
-
setPrediction([]);
|
|
1867
|
-
},
|
|
1868
|
-
onFocus: () => {
|
|
1869
|
-
search(value);
|
|
1870
|
-
},
|
|
1871
|
-
value: changed ? value : location?.description || value,
|
|
1872
|
-
gutterBottom,
|
|
1873
|
-
error,
|
|
1874
|
-
helperText,
|
|
1875
|
-
variant,
|
|
1876
|
-
end: /* @__PURE__ */ import_react17.default.createElement(import_react_native17.View, { style: { flexDirection: "row" } }, /* @__PURE__ */ import_react17.default.createElement(import_react_native17.TouchableOpacity, { onPress: locateMe, style: { marginRight: 10 } }, /* @__PURE__ */ import_react17.default.createElement(
|
|
1877
|
-
import_vector_icons9.Ionicons,
|
|
1878
|
-
{
|
|
1879
|
-
color: colors2.primary.main,
|
|
1880
|
-
size: 18,
|
|
1881
|
-
name: "location"
|
|
1882
|
-
}
|
|
1883
|
-
)), /* @__PURE__ */ import_react17.default.createElement(import_react_native17.TouchableOpacity, { onPress: clear }, /* @__PURE__ */ import_react17.default.createElement(import_vector_icons9.Ionicons, { color: colors2.dark.main, size: 18, name: "close" })))
|
|
1884
|
-
}
|
|
1885
|
-
), prediction.length > 0 && /* @__PURE__ */ import_react17.default.createElement(import_react_native17.View, { style: styles2.list }, prediction.map(
|
|
1886
|
-
(cur, i) => i < 5 && /* @__PURE__ */ import_react17.default.createElement(
|
|
1887
|
-
ListItem,
|
|
1888
|
-
{
|
|
1889
|
-
divider: i < prediction.length - 1,
|
|
1890
|
-
key: cur.id,
|
|
1891
|
-
link: true,
|
|
1892
|
-
onPress: () => locationPressed(cur)
|
|
1893
|
-
},
|
|
1894
|
-
/* @__PURE__ */ import_react17.default.createElement(
|
|
1895
|
-
import_vector_icons9.Ionicons,
|
|
1896
|
-
{
|
|
1897
|
-
name: "location-outline",
|
|
1898
|
-
style: { marginRight: 10 },
|
|
1899
|
-
size: 16,
|
|
1900
|
-
color: colors2.textSecondary.main
|
|
1901
|
-
}
|
|
1902
|
-
),
|
|
1903
|
-
/* @__PURE__ */ import_react17.default.createElement(Typography_default, { style: { flex: 1 } }, cur.description)
|
|
1904
|
-
)
|
|
1905
|
-
)));
|
|
1906
|
-
};
|
|
1907
|
-
|
|
1908
|
-
// ../src/Components/SafeAreaView.tsx
|
|
1909
|
-
var import_react_native18 = require("react-native");
|
|
1910
|
-
var import_react18 = __toESM(require("react"));
|
|
1911
|
-
var import_react_native19 = require("react-native");
|
|
1912
|
-
var import_react_native_size_matters16 = require("react-native-size-matters");
|
|
1913
|
-
var styles = import_react_native19.StyleSheet.create({
|
|
1914
|
-
droidSafeArea: {
|
|
1915
|
-
flex: 1,
|
|
1916
|
-
paddingTop: import_react_native19.Platform.OS === "android" ? (0, import_react_native_size_matters16.moderateScale)(35) : 0
|
|
1917
|
-
}
|
|
1918
|
-
});
|
|
1919
|
-
var SafeAreaView = ({
|
|
1920
|
-
children,
|
|
1921
|
-
style
|
|
1922
|
-
}) => {
|
|
1923
|
-
return /* @__PURE__ */ import_react18.default.createElement(import_react_native18.SafeAreaView, { style: { ...styles.droidSafeArea, ...style } }, children);
|
|
1924
|
-
};
|
|
1925
|
-
|
|
1926
|
-
// ../src/Components/Divider.tsx
|
|
1927
|
-
var import_react_native20 = require("react-native");
|
|
1928
|
-
var import_react_native_size_matters17 = require("react-native-size-matters");
|
|
1929
|
-
var Divider = ({
|
|
1930
|
-
height = 1,
|
|
1931
|
-
color = "textSecondary",
|
|
1932
|
-
gutterBottom = 0,
|
|
1933
|
-
style
|
|
1934
|
-
}) => {
|
|
1935
|
-
const colors2 = useColors();
|
|
1936
|
-
const styles2 = import_react_native_size_matters17.ScaledSheet.create({
|
|
1937
|
-
root: {
|
|
1938
|
-
height,
|
|
1939
|
-
backgroundColor: colors2[color].main,
|
|
1940
|
-
marginBottom: (0, import_react_native_size_matters17.ms)(gutterBottom),
|
|
1941
|
-
...style
|
|
1942
|
-
}
|
|
1943
|
-
});
|
|
1944
|
-
return /* @__PURE__ */ React.createElement(import_react_native20.View, { style: styles2.root });
|
|
1945
|
-
};
|
|
1946
|
-
|
|
1947
|
-
// ../src/Components/Spinner.tsx
|
|
1948
|
-
var import_react19 = __toESM(require("react"));
|
|
1949
|
-
var import_react_native21 = require("react-native");
|
|
1950
|
-
var import_react_native_size_matters18 = require("react-native-size-matters");
|
|
1951
|
-
var Spinner = ({
|
|
1952
|
-
label,
|
|
1953
|
-
size = "large",
|
|
1954
|
-
color = "primary",
|
|
1955
|
-
fullscreen = false,
|
|
1956
|
-
style = {}
|
|
1957
|
-
}) => {
|
|
1958
|
-
const colors2 = useColors();
|
|
1959
|
-
const styles2 = import_react_native_size_matters18.ScaledSheet.create({
|
|
1960
|
-
root: {
|
|
1961
|
-
width: fullscreen ? import_react_native21.Dimensions.get("screen").width : "100%",
|
|
1962
|
-
height: fullscreen ? import_react_native21.Dimensions.get("screen").height : "100%",
|
|
1963
|
-
left: 0,
|
|
1964
|
-
bottom: 0,
|
|
1965
|
-
zIndex: 100,
|
|
1966
|
-
alignItems: "center",
|
|
1967
|
-
justifyContent: "center",
|
|
1968
|
-
position: fullscreen ? "absolute" : "relative",
|
|
1969
|
-
backgroundColor: fullscreen ? colors2.white[1] + "d" : void 0,
|
|
1970
|
-
...style
|
|
1971
|
-
},
|
|
1972
|
-
content: {
|
|
1973
|
-
flexDirection: "row",
|
|
1974
|
-
alignItems: "center",
|
|
1975
|
-
paddingVertical: "15@vs",
|
|
1976
|
-
paddingHorizontal: "20@s",
|
|
1977
|
-
borderRadius: 10
|
|
1978
|
-
// backgroundColor: fullscreen ? colors.light.main : null,
|
|
1979
|
-
},
|
|
1980
|
-
label: {
|
|
1981
|
-
marginLeft: "10@s",
|
|
1982
|
-
color: color === "light" ? colors2.white[2] : colors2.black[4]
|
|
1983
|
-
}
|
|
1984
|
-
});
|
|
1985
|
-
return /* @__PURE__ */ import_react19.default.createElement(import_react_native21.View, { style: styles2.root }, /* @__PURE__ */ import_react19.default.createElement(import_react_native21.View, { style: styles2.content }, /* @__PURE__ */ import_react19.default.createElement(import_react_native21.ActivityIndicator, { color: colors2[color].dark, size }), label && /* @__PURE__ */ import_react19.default.createElement(Typography_default, { style: styles2.label }, label)));
|
|
1986
|
-
};
|
|
1987
|
-
var Spinner_default = Spinner;
|
|
1988
|
-
|
|
1989
|
-
// ../src/Components/OTPInput.tsx
|
|
1990
|
-
var import_react20 = __toESM(require("react"));
|
|
1991
|
-
var import_react_native22 = require("react-native");
|
|
1992
|
-
var import_react_native_size_matters19 = require("react-native-size-matters");
|
|
1993
|
-
var OTPInput = ({
|
|
1994
|
-
length = 6,
|
|
1995
|
-
onChange = () => {
|
|
1996
|
-
},
|
|
1997
|
-
value = "",
|
|
1998
|
-
variant = "outlined",
|
|
1999
|
-
spacing = 1,
|
|
2000
|
-
size = 45
|
|
2001
|
-
}) => {
|
|
2002
|
-
const inputRefs = (0, import_react20.useMemo)(
|
|
2003
|
-
() => Array(length).fill(0).map((_) => import_react20.default.createRef()),
|
|
2004
|
-
[length]
|
|
2005
|
-
);
|
|
2006
|
-
const colors2 = useColors();
|
|
2007
|
-
const styles2 = import_react_native_size_matters19.ScaledSheet.create({
|
|
2008
|
-
root: {},
|
|
2009
|
-
container: { flexDirection: "row" },
|
|
2010
|
-
input: {
|
|
2011
|
-
height: (0, import_react_native_size_matters19.ms)(size),
|
|
2012
|
-
width: (0, import_react_native_size_matters19.ms)(size),
|
|
2013
|
-
borderColor: colors2.white[5],
|
|
2014
|
-
backgroundColor: variant === "contained" ? colors2.white[3] : void 0,
|
|
2015
|
-
borderWidth: variant === "outlined" ? 1 : 0,
|
|
2016
|
-
borderBottomWidth: variant === "contained" ? 0 : 1,
|
|
2017
|
-
marginHorizontal: (0, import_react_native_size_matters19.ms)(spacing * 5),
|
|
2018
|
-
textAlign: "center",
|
|
2019
|
-
borderRadius: variant === "text" ? 0 : 10,
|
|
2020
|
-
color: colors2.dark.main,
|
|
2021
|
-
fontSize: (0, import_react_native_size_matters19.ms)(size * 0.5)
|
|
2022
|
-
}
|
|
2023
|
-
});
|
|
2024
|
-
return /* @__PURE__ */ import_react20.default.createElement(import_react_native22.View, { style: styles2.root }, /* @__PURE__ */ import_react20.default.createElement(import_react_native22.View, { style: styles2.container }, [...Array(length)].map((_, index) => /* @__PURE__ */ import_react20.default.createElement(
|
|
2025
|
-
import_react_native22.TextInput,
|
|
2026
|
-
{
|
|
2027
|
-
ref: inputRefs[index],
|
|
2028
|
-
onChangeText: (val) => {
|
|
2029
|
-
if (val.length === 1) {
|
|
2030
|
-
if (index !== length - 1)
|
|
2031
|
-
inputRefs[index + 1].current?.focus();
|
|
2032
|
-
let text = value;
|
|
2033
|
-
text = text.slice(0, index) + val + text.slice(index + 1);
|
|
2034
|
-
onChange(text);
|
|
2035
|
-
} else if (val.length === 0) {
|
|
2036
|
-
if (index !== 0) {
|
|
2037
|
-
inputRefs[index - 1].current?.focus();
|
|
2038
|
-
let text = value;
|
|
2039
|
-
text = text.slice(0, index);
|
|
2040
|
-
onChange(text);
|
|
2041
|
-
} else
|
|
2042
|
-
onChange("");
|
|
2043
|
-
} else {
|
|
2044
|
-
let text = val.replace(/\D/g, "").slice(0, length);
|
|
2045
|
-
onChange(text);
|
|
2046
|
-
inputRefs[text.length < length - 1 ? text.length : length - 1]?.current?.focus();
|
|
2047
|
-
}
|
|
2048
|
-
},
|
|
2049
|
-
value: value[index] || "",
|
|
2050
|
-
blurOnSubmit: false,
|
|
2051
|
-
keyboardType: "number-pad",
|
|
2052
|
-
key: index,
|
|
2053
|
-
style: [styles2.input]
|
|
2054
|
-
}
|
|
2055
|
-
))));
|
|
2056
|
-
};
|
|
2057
|
-
|
|
2058
|
-
// index.ts
|
|
2059
|
-
var HoddyUI = {
|
|
2060
|
-
initialize
|
|
2061
|
-
};
|
|
2062
|
-
var next_default = HoddyUI;
|
|
2063
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
2064
|
-
0 && (module.exports = {
|
|
2065
|
-
AdaptiveStatusBar,
|
|
2066
|
-
AlertX,
|
|
2067
|
-
Avatar,
|
|
2068
|
-
Button,
|
|
2069
|
-
CheckBox,
|
|
2070
|
-
Divider,
|
|
2071
|
-
FormWrapper,
|
|
2072
|
-
Grid,
|
|
2073
|
-
GridItem,
|
|
2074
|
-
IconButton,
|
|
2075
|
-
LinkButton,
|
|
2076
|
-
Locator,
|
|
2077
|
-
OTPInput,
|
|
2078
|
-
Popup,
|
|
2079
|
-
RatingInput,
|
|
2080
|
-
RatingStars,
|
|
2081
|
-
SafeAreaView,
|
|
2082
|
-
SelectMenu,
|
|
2083
|
-
Spinner,
|
|
2084
|
-
TextField,
|
|
2085
|
-
TextField2,
|
|
2086
|
-
Typography,
|
|
2087
|
-
UIThemeContext,
|
|
2088
|
-
UIThemeProvider,
|
|
2089
|
-
getPredictionsFromCoords,
|
|
2090
|
-
showFlashMessage,
|
|
2091
|
-
useColors,
|
|
2092
|
-
useNavScreenOptions,
|
|
2093
|
-
useTheme
|
|
2094
|
-
});
|
|
2095
|
-
//# sourceMappingURL=index.js.map
|