@hoddy-ui/next 1.0.3 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +32 -3
- package/dist/index.d.ts +32 -3
- package/dist/index.js +327 -272
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +357 -299
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -69,61 +69,65 @@ var setExtraColors = (c) => extraColors = c;
|
|
|
69
69
|
function colors(theme) {
|
|
70
70
|
const lightColors = {
|
|
71
71
|
white: {
|
|
72
|
-
1: "#
|
|
72
|
+
1: "#ffffff",
|
|
73
73
|
2: "#f7f7f7",
|
|
74
|
-
3: "#
|
|
75
|
-
4: "#
|
|
76
|
-
5: "#
|
|
74
|
+
3: "#eeeeee",
|
|
75
|
+
4: "#dddddd",
|
|
76
|
+
5: "#bbbbbb",
|
|
77
|
+
...extraColors?.light?.white
|
|
77
78
|
},
|
|
78
79
|
black: {
|
|
79
|
-
1: "#
|
|
80
|
-
2: "#
|
|
81
|
-
3: "#
|
|
82
|
-
4: "#
|
|
83
|
-
5: "#
|
|
80
|
+
1: "#888888",
|
|
81
|
+
2: "#777777",
|
|
82
|
+
3: "#555555",
|
|
83
|
+
4: "#333333",
|
|
84
|
+
5: "#000000",
|
|
85
|
+
...extraColors?.light?.black
|
|
84
86
|
}
|
|
85
87
|
};
|
|
86
88
|
const darkColors = {
|
|
87
89
|
black: {
|
|
88
|
-
1: "#
|
|
90
|
+
1: "#ffffff",
|
|
89
91
|
2: "#f7f7f7",
|
|
90
|
-
3: "#
|
|
91
|
-
4: "#
|
|
92
|
-
5: "#
|
|
92
|
+
3: "#eeeeee",
|
|
93
|
+
4: "#dddddd",
|
|
94
|
+
5: "#aaaaaa",
|
|
95
|
+
...extraColors?.dark?.black
|
|
93
96
|
},
|
|
94
97
|
white: {
|
|
95
|
-
1: "#
|
|
96
|
-
2: "#
|
|
97
|
-
3: "#
|
|
98
|
-
4: "#
|
|
99
|
-
5: "#
|
|
98
|
+
1: "#060606",
|
|
99
|
+
2: "#222222",
|
|
100
|
+
3: "#333333",
|
|
101
|
+
4: "#444444",
|
|
102
|
+
5: "#555555",
|
|
103
|
+
...extraColors?.dark?.white
|
|
100
104
|
},
|
|
101
105
|
dark: {
|
|
102
106
|
main: "#f2f3f4",
|
|
103
|
-
light: "#
|
|
104
|
-
dark: "#
|
|
105
|
-
text: "#
|
|
107
|
+
light: "#ffffff",
|
|
108
|
+
dark: "#dddddd",
|
|
109
|
+
text: "#000000",
|
|
106
110
|
...extraColors?.dark?.dark
|
|
107
111
|
},
|
|
108
112
|
light: {
|
|
109
|
-
main: "#
|
|
110
|
-
light: "#
|
|
111
|
-
dark: "#
|
|
112
|
-
text: "#
|
|
113
|
+
main: "#111111",
|
|
114
|
+
light: "#555555",
|
|
115
|
+
dark: "#333333",
|
|
116
|
+
text: "#ffffff",
|
|
113
117
|
...extraColors?.dark?.light
|
|
114
118
|
},
|
|
115
119
|
textSecondary: {
|
|
116
|
-
main: "#
|
|
117
|
-
light: "#
|
|
118
|
-
dark: "#
|
|
119
|
-
text: "#
|
|
120
|
+
main: "#666666",
|
|
121
|
+
light: "#777777",
|
|
122
|
+
dark: "#444444",
|
|
123
|
+
text: "#ffffff",
|
|
120
124
|
...extraColors?.dark?.textSecondary
|
|
121
125
|
},
|
|
122
126
|
primary: {
|
|
123
|
-
main: "#
|
|
124
|
-
light: "#
|
|
125
|
-
dark: "#
|
|
126
|
-
text: "#
|
|
127
|
+
main: "#ff8800",
|
|
128
|
+
light: "#feffd3",
|
|
129
|
+
dark: "#ffaa00",
|
|
130
|
+
text: "#ffffff",
|
|
127
131
|
...extraColors?.light?.primary,
|
|
128
132
|
...extraColors?.dark?.primary
|
|
129
133
|
}
|
|
@@ -132,73 +136,73 @@ function colors(theme) {
|
|
|
132
136
|
return {
|
|
133
137
|
...extraColors[theme],
|
|
134
138
|
primary: {
|
|
135
|
-
main: "#
|
|
136
|
-
light: "#
|
|
137
|
-
dark: "#
|
|
138
|
-
text: "#
|
|
139
|
+
main: "#ff8800",
|
|
140
|
+
light: "#feffd3",
|
|
141
|
+
dark: "#ffaa00",
|
|
142
|
+
text: "#ffffff",
|
|
139
143
|
...extraColors?.light?.primary
|
|
140
144
|
},
|
|
141
145
|
secondary: {
|
|
142
|
-
main: "#
|
|
143
|
-
light: "#
|
|
144
|
-
dark: "#
|
|
145
|
-
text: "#
|
|
146
|
+
main: "#ff1111",
|
|
147
|
+
light: "#ff4433",
|
|
148
|
+
dark: "#dd0000",
|
|
149
|
+
text: "#ffffff",
|
|
146
150
|
...extraColors?.light?.secondary
|
|
147
151
|
},
|
|
148
152
|
light: {
|
|
149
|
-
main: "#
|
|
150
|
-
light: "#
|
|
151
|
-
dark: "#
|
|
152
|
-
text: "#
|
|
153
|
+
main: "#ffffff",
|
|
154
|
+
light: "#ffffff",
|
|
155
|
+
dark: "#dddddd",
|
|
156
|
+
text: "#000000",
|
|
153
157
|
...extraColors?.light?.light
|
|
154
158
|
},
|
|
155
159
|
dark: {
|
|
156
|
-
main: "#
|
|
157
|
-
light: "#
|
|
158
|
-
dark: "#
|
|
159
|
-
text: "#
|
|
160
|
+
main: "#000000",
|
|
161
|
+
light: "#777777",
|
|
162
|
+
dark: "#111111",
|
|
163
|
+
text: "#ffffff",
|
|
160
164
|
...extraColors?.light?.dark
|
|
161
165
|
},
|
|
162
166
|
textSecondary: {
|
|
163
|
-
main: "#
|
|
164
|
-
light: "#
|
|
165
|
-
dark: "#
|
|
166
|
-
text: "#
|
|
167
|
+
main: "#aaaaaa",
|
|
168
|
+
light: "#bbbbbb",
|
|
169
|
+
dark: "#777777",
|
|
170
|
+
text: "#112233",
|
|
167
171
|
...extraColors?.light?.textSecondary
|
|
168
172
|
},
|
|
169
173
|
blue: {
|
|
170
|
-
main: "#
|
|
171
|
-
light: "#
|
|
172
|
-
dark: "#
|
|
173
|
-
text: "#
|
|
174
|
+
main: "#0099ff",
|
|
175
|
+
light: "#3399ff",
|
|
176
|
+
dark: "#002288",
|
|
177
|
+
text: "#ffffff",
|
|
174
178
|
...extraColors?.light?.blue
|
|
175
179
|
},
|
|
176
180
|
info: {
|
|
177
|
-
main: "#
|
|
178
|
-
light: "#
|
|
179
|
-
dark: "#
|
|
180
|
-
text: "#
|
|
181
|
+
main: "#0099ff",
|
|
182
|
+
light: "#33aaff",
|
|
183
|
+
dark: "#0088aa",
|
|
184
|
+
text: "#ffffff",
|
|
181
185
|
...extraColors?.light?.info
|
|
182
186
|
},
|
|
183
187
|
success: {
|
|
184
|
-
main: "#
|
|
185
|
-
text: "#
|
|
186
|
-
light: "#
|
|
187
|
-
dark: "#
|
|
188
|
+
main: "#00aa44",
|
|
189
|
+
text: "#ffffff",
|
|
190
|
+
light: "#55cc33",
|
|
191
|
+
dark: "#006622",
|
|
188
192
|
...extraColors?.light?.success
|
|
189
193
|
},
|
|
190
194
|
warning: {
|
|
191
|
-
main: "#
|
|
192
|
-
light: "#
|
|
193
|
-
dark: "#
|
|
194
|
-
text: "#
|
|
195
|
+
main: "#ffaa22",
|
|
196
|
+
light: "#ffcc77",
|
|
197
|
+
dark: "#ff9900",
|
|
198
|
+
text: "#ffffff",
|
|
195
199
|
...extraColors?.light?.warning
|
|
196
200
|
},
|
|
197
201
|
error: {
|
|
198
|
-
main: "#
|
|
199
|
-
text: "#
|
|
200
|
-
light: "#
|
|
201
|
-
dark: "#
|
|
202
|
+
main: "#dd2222",
|
|
203
|
+
text: "#ffffff",
|
|
204
|
+
light: "#ff4433",
|
|
205
|
+
dark: "#aa2200",
|
|
202
206
|
...extraColors?.light?.error
|
|
203
207
|
},
|
|
204
208
|
...dynamicColors
|
|
@@ -206,24 +210,25 @@ function colors(theme) {
|
|
|
206
210
|
}
|
|
207
211
|
|
|
208
212
|
// ../src/config/KeyManager.ts
|
|
209
|
-
var
|
|
213
|
+
var config = {
|
|
210
214
|
GOOGLE_MAP_API_KEY: ""
|
|
211
215
|
};
|
|
212
|
-
function
|
|
213
|
-
|
|
216
|
+
function setConfig(key) {
|
|
217
|
+
config = key;
|
|
214
218
|
}
|
|
215
|
-
function
|
|
216
|
-
return
|
|
219
|
+
function getConfig() {
|
|
220
|
+
return config;
|
|
217
221
|
}
|
|
218
222
|
|
|
219
223
|
// ../src/config/index.ts
|
|
220
|
-
function initialize(
|
|
224
|
+
function initialize(config2) {
|
|
221
225
|
try {
|
|
222
|
-
|
|
223
|
-
GOOGLE_MAP_API_KEY:
|
|
226
|
+
setConfig({
|
|
227
|
+
GOOGLE_MAP_API_KEY: config2.googleMapApiKey,
|
|
228
|
+
DEFAULT_FONT_FAMILY: config2.fontFamily
|
|
224
229
|
});
|
|
225
|
-
if (
|
|
226
|
-
setExtraColors(
|
|
230
|
+
if (config2.colors)
|
|
231
|
+
setExtraColors(config2.colors);
|
|
227
232
|
} catch (error) {
|
|
228
233
|
console.error("Error reading the config file:", error);
|
|
229
234
|
}
|
|
@@ -245,6 +250,7 @@ var NavigationBar = __toESM(require("expo-navigation-bar"));
|
|
|
245
250
|
var SystemUI = __toESM(require("expo-system-ui"));
|
|
246
251
|
var import_react3 = __toESM(require("react"));
|
|
247
252
|
var import_react_native3 = require("react-native");
|
|
253
|
+
var import_react_native_safe_area_context2 = require("react-native-safe-area-context");
|
|
248
254
|
|
|
249
255
|
// ../src/Components/FlashMessage.tsx
|
|
250
256
|
var import_react2 = __toESM(require("react"));
|
|
@@ -256,51 +262,60 @@ var import_react_native_size_matters2 = require("react-native-size-matters");
|
|
|
256
262
|
var import_react = __toESM(require("react"));
|
|
257
263
|
var import_react_native = require("react-native");
|
|
258
264
|
var import_react_native_size_matters = require("react-native-size-matters");
|
|
259
|
-
var Typography = (
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
265
|
+
var Typography = (0, import_react.forwardRef)(
|
|
266
|
+
({
|
|
267
|
+
children,
|
|
268
|
+
color = "dark",
|
|
269
|
+
style = {},
|
|
270
|
+
textCase = null,
|
|
271
|
+
variant = "body1",
|
|
272
|
+
align = "left",
|
|
273
|
+
gutterBottom = 0,
|
|
274
|
+
numberOfLines,
|
|
275
|
+
adjustsFontSizeToFit,
|
|
276
|
+
fontWeight = 400,
|
|
277
|
+
fontFamily,
|
|
278
|
+
// NEW PROP ADDED
|
|
279
|
+
...props
|
|
280
|
+
}, ref) => {
|
|
281
|
+
const colors2 = useColors();
|
|
282
|
+
const fontSize = {
|
|
283
|
+
h1: (0, import_react_native_size_matters.moderateScale)(42),
|
|
284
|
+
h2: (0, import_react_native_size_matters.moderateScale)(37),
|
|
285
|
+
h3: (0, import_react_native_size_matters.moderateScale)(32),
|
|
286
|
+
h4: (0, import_react_native_size_matters.moderateScale)(27),
|
|
287
|
+
h5: (0, import_react_native_size_matters.moderateScale)(22),
|
|
288
|
+
h6: (0, import_react_native_size_matters.moderateScale)(17),
|
|
289
|
+
body1: (0, import_react_native_size_matters.moderateScale)(15),
|
|
290
|
+
body2: (0, import_react_native_size_matters.moderateScale)(12),
|
|
291
|
+
caption: (0, import_react_native_size_matters.moderateScale)(10)
|
|
292
|
+
};
|
|
293
|
+
const styles2 = import_react_native.StyleSheet.create({
|
|
294
|
+
text: {
|
|
295
|
+
fontSize: fontSize[variant],
|
|
296
|
+
marginBottom: (0, import_react_native_size_matters.verticalScale)(gutterBottom) || 0,
|
|
297
|
+
color: colors2[color]?.main || color,
|
|
298
|
+
textTransform: textCase,
|
|
299
|
+
alignItems: "center",
|
|
300
|
+
textAlign: align,
|
|
301
|
+
fontWeight,
|
|
302
|
+
fontFamily: fontFamily || getConfig().DEFAULT_FONT_FAMILY || void 0
|
|
303
|
+
// Use custom font if provided, else default
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
307
|
+
import_react_native.Text,
|
|
308
|
+
{
|
|
309
|
+
ref,
|
|
310
|
+
numberOfLines,
|
|
311
|
+
adjustsFontSizeToFit,
|
|
312
|
+
style: [styles2.text, style],
|
|
313
|
+
...props
|
|
314
|
+
},
|
|
315
|
+
children
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
);
|
|
304
319
|
var Typography_default = Typography;
|
|
305
320
|
|
|
306
321
|
// ../src/Components/FlashMessage.tsx
|
|
@@ -365,24 +380,10 @@ var FlashMessage = () => {
|
|
|
365
380
|
var FlashMessage_default = FlashMessage;
|
|
366
381
|
|
|
367
382
|
// ../src/theme/index.tsx
|
|
368
|
-
var import_react_native_safe_area_context2 = require("react-native-safe-area-context");
|
|
369
383
|
var UIThemeContext = (0, import_react3.createContext)({
|
|
370
384
|
themeState: { mode: "default", value: "light" }
|
|
371
385
|
});
|
|
372
386
|
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
387
|
switch (type) {
|
|
387
388
|
case "dark":
|
|
388
389
|
return { mode: "dark", value: "dark" };
|
|
@@ -394,6 +395,24 @@ function themeReducer(state, { type, payload }) {
|
|
|
394
395
|
return state;
|
|
395
396
|
}
|
|
396
397
|
}
|
|
398
|
+
var ConfigureSystemUI = () => {
|
|
399
|
+
const theme = useTheme();
|
|
400
|
+
const colors2 = useColors();
|
|
401
|
+
(0, import_react3.useEffect)(() => {
|
|
402
|
+
if (colors2) {
|
|
403
|
+
SystemUI.setBackgroundColorAsync(colors2.white[1]);
|
|
404
|
+
if (import_react_native3.Platform.OS === "android") {
|
|
405
|
+
NavigationBar.setBackgroundColorAsync(colors2.white[1]);
|
|
406
|
+
if (theme === "dark") {
|
|
407
|
+
NavigationBar.setButtonStyleAsync("light");
|
|
408
|
+
} else {
|
|
409
|
+
NavigationBar.setButtonStyleAsync("dark");
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}, [colors2, theme]);
|
|
414
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null);
|
|
415
|
+
};
|
|
397
416
|
var UIThemeProvider = ({ children }) => {
|
|
398
417
|
const [themeState, themeDispatch] = (0, import_react3.useReducer)(themeReducer, {
|
|
399
418
|
mode: "default",
|
|
@@ -429,7 +448,8 @@ var UIThemeProvider = ({ children }) => {
|
|
|
429
448
|
}
|
|
430
449
|
},
|
|
431
450
|
children,
|
|
432
|
-
/* @__PURE__ */ import_react3.default.createElement(FlashMessage_default, null)
|
|
451
|
+
/* @__PURE__ */ import_react3.default.createElement(FlashMessage_default, null),
|
|
452
|
+
/* @__PURE__ */ import_react3.default.createElement(ConfigureSystemUI, null)
|
|
433
453
|
));
|
|
434
454
|
};
|
|
435
455
|
|
|
@@ -444,6 +464,7 @@ var useTheme = () => {
|
|
|
444
464
|
};
|
|
445
465
|
var useNavScreenOptions = (type) => {
|
|
446
466
|
const colors2 = useColors();
|
|
467
|
+
const theme = useTheme();
|
|
447
468
|
const options = {
|
|
448
469
|
stack: {
|
|
449
470
|
headerShown: false,
|
|
@@ -463,7 +484,7 @@ var useNavScreenOptions = (type) => {
|
|
|
463
484
|
headerShown: false,
|
|
464
485
|
headerTintColor: colors2.dark.main,
|
|
465
486
|
tabBarStyle: {
|
|
466
|
-
borderTopColor: colors2.white[
|
|
487
|
+
borderTopColor: theme === "dark" ? colors2.light.main : colors2.white[2],
|
|
467
488
|
borderTopWidth: 1,
|
|
468
489
|
// shadowColor: "#000",
|
|
469
490
|
// shadowOffset: { height: -3, width: 0 },
|
|
@@ -630,6 +651,7 @@ var LinkButton = ({
|
|
|
630
651
|
text: {
|
|
631
652
|
fontSize: (0, import_react_native_size_matters6.moderateScale)(fontSize),
|
|
632
653
|
fontWeight,
|
|
654
|
+
fontFamily: getConfig().DEFAULT_FONT_FAMILY || "System",
|
|
633
655
|
color: disabled ? "#777" : colors2[color].main
|
|
634
656
|
}
|
|
635
657
|
});
|
|
@@ -689,64 +711,79 @@ var IconButton = ({
|
|
|
689
711
|
/* @__PURE__ */ import_react8.default.createElement(IconComp, { style: { ...styles2.text, ...style }, name: icon, size })
|
|
690
712
|
);
|
|
691
713
|
};
|
|
692
|
-
var Button = (
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
714
|
+
var Button = (0, import_react8.forwardRef)(
|
|
715
|
+
({
|
|
716
|
+
elevation = 0,
|
|
717
|
+
onPress = () => {
|
|
718
|
+
},
|
|
719
|
+
disabled = false,
|
|
720
|
+
title,
|
|
721
|
+
loading,
|
|
722
|
+
size = "normal",
|
|
723
|
+
rounded = false,
|
|
724
|
+
gutterBottom,
|
|
725
|
+
style = {},
|
|
726
|
+
fullWidth = false,
|
|
727
|
+
translucent = false,
|
|
728
|
+
color = "primary",
|
|
729
|
+
variant = "contained",
|
|
730
|
+
start,
|
|
731
|
+
end
|
|
732
|
+
}, ref) => {
|
|
733
|
+
const colors2 = useColors();
|
|
734
|
+
const styles2 = import_react_native_size_matters6.ScaledSheet.create({
|
|
735
|
+
con: {
|
|
736
|
+
flexDirection: "row",
|
|
737
|
+
alignItems: "center",
|
|
738
|
+
alignSelf: "flex-start",
|
|
739
|
+
justifyContent: "center",
|
|
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,
|
|
741
|
+
borderRadius: rounded ? 30 : 10,
|
|
742
|
+
elevation: variant === "text" ? 0 : elevation,
|
|
743
|
+
paddingVertical: size === "small" ? 8 : size === "large" ? "15@ms" : "13@ms",
|
|
744
|
+
paddingHorizontal: size === "small" ? "10@ms" : "18@ms",
|
|
745
|
+
borderColor: colors2[color].main,
|
|
746
|
+
borderWidth: variant === "outlined" ? 1 : 0,
|
|
747
|
+
shadowColor: "#000",
|
|
748
|
+
shadowRadius: elevation,
|
|
749
|
+
marginBottom: gutterBottom,
|
|
750
|
+
shadowOffset: {
|
|
751
|
+
height: elevation / 2,
|
|
752
|
+
width: 0
|
|
753
|
+
},
|
|
754
|
+
shadowOpacity: variant === "text" ? 0 : 0.3,
|
|
755
|
+
width: fullWidth ? "100%" : null,
|
|
756
|
+
...style
|
|
730
757
|
},
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
758
|
+
text: {
|
|
759
|
+
color: disabled ? variant === "text" || variant === "outlined" ? colors2.black[1] : colors2[color].text : colors2[color][variant === "text" || variant === "outlined" ? "main" : "text"],
|
|
760
|
+
fontWeight: variant === "outlined" ? "700" : "500",
|
|
761
|
+
fontSize: size === "small" ? "12@ms" : "16@ms",
|
|
762
|
+
fontFamily: getConfig().DEFAULT_FONT_FAMILY || "System"
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
766
|
+
import_react_native8.TouchableOpacity,
|
|
767
|
+
{
|
|
768
|
+
ref,
|
|
769
|
+
onPress,
|
|
770
|
+
disabled,
|
|
771
|
+
style: styles2.con
|
|
772
|
+
},
|
|
773
|
+
start,
|
|
774
|
+
loading && /* @__PURE__ */ import_react8.default.createElement(
|
|
775
|
+
import_react_native8.ActivityIndicator,
|
|
776
|
+
{
|
|
777
|
+
size: "small",
|
|
778
|
+
color: colors2[color].text,
|
|
779
|
+
style: { marginRight: 10 }
|
|
780
|
+
}
|
|
781
|
+
),
|
|
782
|
+
/* @__PURE__ */ import_react8.default.createElement(import_react_native8.Text, { style: styles2.text }, title),
|
|
783
|
+
end
|
|
784
|
+
);
|
|
785
|
+
}
|
|
786
|
+
);
|
|
750
787
|
var Button_default = Button;
|
|
751
788
|
|
|
752
789
|
// ../src/Components/Checkbox.tsx
|
|
@@ -851,8 +888,10 @@ var Popup = ({
|
|
|
851
888
|
children,
|
|
852
889
|
open,
|
|
853
890
|
onClose = () => {
|
|
854
|
-
}
|
|
891
|
+
},
|
|
892
|
+
style
|
|
855
893
|
}) => {
|
|
894
|
+
const theme = useTheme();
|
|
856
895
|
const colors2 = useColors();
|
|
857
896
|
const [show, setShow] = (0, import_react11.useState)(open);
|
|
858
897
|
const [showSecondary, setShowSecondary] = (0, import_react11.useState)(false);
|
|
@@ -872,12 +911,13 @@ var Popup = ({
|
|
|
872
911
|
},
|
|
873
912
|
container: {
|
|
874
913
|
paddingBottom: sheet ? "30@ms" : 0,
|
|
875
|
-
backgroundColor: colors2.white[2],
|
|
914
|
+
backgroundColor: theme === "dark" ? "#111" : colors2.white[2],
|
|
876
915
|
borderTopLeftRadius: 20,
|
|
877
916
|
borderTopRightRadius: 20,
|
|
878
917
|
borderBottomRightRadius: sheet ? 0 : 20,
|
|
879
918
|
borderBottomLeftRadius: sheet ? 0 : 20,
|
|
880
|
-
width: "100%"
|
|
919
|
+
width: "100%",
|
|
920
|
+
...style
|
|
881
921
|
},
|
|
882
922
|
content: {
|
|
883
923
|
paddingHorizontal: bare ? void 0 : "10@ms"
|
|
@@ -899,14 +939,21 @@ var Popup = ({
|
|
|
899
939
|
}
|
|
900
940
|
});
|
|
901
941
|
import_react11.default.useEffect(() => {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
942
|
+
if (open) {
|
|
943
|
+
setShow(open);
|
|
944
|
+
setTimeout(() => {
|
|
945
|
+
setShowSecondary(open);
|
|
946
|
+
}, 500);
|
|
947
|
+
} else {
|
|
948
|
+
closeAction();
|
|
949
|
+
}
|
|
906
950
|
}, [open]);
|
|
907
951
|
const closeAction = () => {
|
|
908
|
-
|
|
909
|
-
|
|
952
|
+
setShowSecondary(false);
|
|
953
|
+
setTimeout(() => {
|
|
954
|
+
setShow(false);
|
|
955
|
+
onClose();
|
|
956
|
+
}, 300);
|
|
910
957
|
};
|
|
911
958
|
return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
912
959
|
import_react_native11.Modal,
|
|
@@ -1149,7 +1196,7 @@ var ListItem = ({
|
|
|
1149
1196
|
flexDirection: "row",
|
|
1150
1197
|
alignItems: "center",
|
|
1151
1198
|
paddingHorizontal: "10@s",
|
|
1152
|
-
borderBottomColor: colors2.white[
|
|
1199
|
+
borderBottomColor: colors2.white[2],
|
|
1153
1200
|
borderBottomWidth: divider ? 1 : 0,
|
|
1154
1201
|
paddingVertical: "10@vs"
|
|
1155
1202
|
}
|
|
@@ -1228,7 +1275,7 @@ var SelectMenu = ({
|
|
|
1228
1275
|
{
|
|
1229
1276
|
style: {
|
|
1230
1277
|
...styles2.option,
|
|
1231
|
-
backgroundColor: item.value === value ? colors2.blue.light + "
|
|
1278
|
+
backgroundColor: item.value === value ? colors2.blue.light + "22" : colors2.white[2]
|
|
1232
1279
|
},
|
|
1233
1280
|
onPress: () => {
|
|
1234
1281
|
onChange(item.value);
|
|
@@ -1331,8 +1378,10 @@ var TextField = ({
|
|
|
1331
1378
|
}) => {
|
|
1332
1379
|
const colors2 = useColors();
|
|
1333
1380
|
const [focused, setFocused] = (0, import_react16.useState)(false);
|
|
1334
|
-
const labelAnim = (0, import_react16.useRef)(new import_react_native16.Animated.Value(0)).current;
|
|
1335
1381
|
const height = (0, import_react_native_size_matters14.moderateScale)(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1);
|
|
1382
|
+
const labelAnim = (0, import_react16.useRef)(
|
|
1383
|
+
new import_react_native16.Animated.Value(height / (0, import_react_native_size_matters14.moderateScale)(variant === "text" ? 2.5 : 3.2))
|
|
1384
|
+
).current;
|
|
1336
1385
|
import_react16.default.useEffect(() => {
|
|
1337
1386
|
if (focused || value) {
|
|
1338
1387
|
import_react_native16.Animated.timing(labelAnim, {
|
|
@@ -1374,6 +1423,7 @@ var TextField = ({
|
|
|
1374
1423
|
paddingLeft: variant === "text" ? 0 : (0, import_react_native_size_matters14.moderateScale)(15),
|
|
1375
1424
|
paddingRight: (0, import_react_native_size_matters14.moderateScale)(10),
|
|
1376
1425
|
paddingTop: "11@vs",
|
|
1426
|
+
fontFamily: getConfig().DEFAULT_FONT_FAMILY || "System",
|
|
1377
1427
|
color: colors2.black[1],
|
|
1378
1428
|
zIndex: 10
|
|
1379
1429
|
// backgroundColor: "#284",
|
|
@@ -1385,6 +1435,7 @@ var TextField = ({
|
|
|
1385
1435
|
paddingTop: "13@ms"
|
|
1386
1436
|
},
|
|
1387
1437
|
label: {
|
|
1438
|
+
fontFamily: getConfig().DEFAULT_FONT_FAMILY || "System",
|
|
1388
1439
|
position: "absolute",
|
|
1389
1440
|
left: variant === "text" ? 0 : (0, import_react_native_size_matters14.moderateScale)(15),
|
|
1390
1441
|
fontSize: focused || value ? "10@s" : "13@s",
|
|
@@ -1475,15 +1526,33 @@ var TextField = ({
|
|
|
1475
1526
|
style: styles2.input
|
|
1476
1527
|
}
|
|
1477
1528
|
),
|
|
1478
|
-
end && /* @__PURE__ */ import_react16.default.createElement(
|
|
1479
|
-
|
|
1480
|
-
import_vector_icons8.Ionicons,
|
|
1529
|
+
end && /* @__PURE__ */ import_react16.default.createElement(
|
|
1530
|
+
import_react_native16.View,
|
|
1481
1531
|
{
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1532
|
+
style: {
|
|
1533
|
+
marginRight: 20,
|
|
1534
|
+
paddingTop: variant === "text" ? (0, import_react_native_size_matters14.ms)(13) : 0
|
|
1535
|
+
}
|
|
1536
|
+
},
|
|
1537
|
+
end
|
|
1538
|
+
),
|
|
1539
|
+
options && /* @__PURE__ */ import_react16.default.createElement(
|
|
1540
|
+
import_react_native16.View,
|
|
1541
|
+
{
|
|
1542
|
+
style: {
|
|
1543
|
+
marginRight: variant === "text" ? 0 : 20,
|
|
1544
|
+
paddingTop: variant === "text" ? (0, import_react_native_size_matters14.ms)(13) : 0
|
|
1545
|
+
}
|
|
1546
|
+
},
|
|
1547
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
1548
|
+
import_vector_icons8.Ionicons,
|
|
1549
|
+
{
|
|
1550
|
+
name: "chevron-down",
|
|
1551
|
+
color: colors2.textSecondary.main,
|
|
1552
|
+
size: 24
|
|
1553
|
+
}
|
|
1554
|
+
)
|
|
1555
|
+
)
|
|
1487
1556
|
), helperText && /* @__PURE__ */ import_react16.default.createElement(
|
|
1488
1557
|
Typography_default,
|
|
1489
1558
|
{
|
|
@@ -1508,7 +1577,6 @@ var TextField = ({
|
|
|
1508
1577
|
var TextField2 = ({
|
|
1509
1578
|
label,
|
|
1510
1579
|
keyboardType,
|
|
1511
|
-
variant,
|
|
1512
1580
|
color = "primary",
|
|
1513
1581
|
value,
|
|
1514
1582
|
type,
|
|
@@ -1535,30 +1603,12 @@ var TextField2 = ({
|
|
|
1535
1603
|
const colors2 = useColors();
|
|
1536
1604
|
const [focused, _setFocused] = (0, import_react16.useState)(false);
|
|
1537
1605
|
const [showPassword, setShowPassword] = (0, import_react16.useState)(false);
|
|
1538
|
-
const labelAnim = (0, import_react16.useRef)(new import_react_native16.Animated.Value(0)).current;
|
|
1539
1606
|
const height = (0, import_react_native_size_matters14.moderateScale)(
|
|
1540
1607
|
props.multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1541
1608
|
);
|
|
1542
1609
|
const setFocused = (value2) => {
|
|
1543
|
-
(
|
|
1544
|
-
_setFocused(value2);
|
|
1545
|
-
});
|
|
1610
|
+
_setFocused(value2);
|
|
1546
1611
|
};
|
|
1547
|
-
import_react16.default.useEffect(() => {
|
|
1548
|
-
if (focused || value) {
|
|
1549
|
-
import_react_native16.Animated.timing(labelAnim, {
|
|
1550
|
-
toValue: (0, import_react_native_size_matters14.verticalScale)(5),
|
|
1551
|
-
duration: 300,
|
|
1552
|
-
useNativeDriver: false
|
|
1553
|
-
}).start();
|
|
1554
|
-
} else {
|
|
1555
|
-
import_react_native16.Animated.timing(labelAnim, {
|
|
1556
|
-
toValue: height / (0, import_react_native_size_matters14.moderateScale)(3),
|
|
1557
|
-
duration: 300,
|
|
1558
|
-
useNativeDriver: false
|
|
1559
|
-
}).start();
|
|
1560
|
-
}
|
|
1561
|
-
}, [focused, value]);
|
|
1562
1612
|
const styles2 = import_react_native_size_matters14.ScaledSheet.create({
|
|
1563
1613
|
root: {
|
|
1564
1614
|
marginBottom: gutterBottom + "@vs",
|
|
@@ -1581,13 +1631,13 @@ var TextField2 = ({
|
|
|
1581
1631
|
alignSelf: "stretch",
|
|
1582
1632
|
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10),
|
|
1583
1633
|
paddingRight: (0, import_react_native_size_matters14.moderateScale)(10),
|
|
1584
|
-
color: colors2.dark.
|
|
1634
|
+
color: colors2.dark.main,
|
|
1585
1635
|
zIndex: 10
|
|
1586
1636
|
// backgroundColor: "#284",
|
|
1587
1637
|
},
|
|
1588
1638
|
inputText: {
|
|
1589
1639
|
fontSize: "14@ms",
|
|
1590
|
-
color: colors2.dark.
|
|
1640
|
+
color: colors2.dark.main,
|
|
1591
1641
|
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
|
|
1592
1642
|
},
|
|
1593
1643
|
placeholder: {
|
|
@@ -1714,13 +1764,8 @@ var TextField_default = TextField;
|
|
|
1714
1764
|
// ../src/Components/Locator.tsx
|
|
1715
1765
|
var Location = __toESM(require("expo-location"));
|
|
1716
1766
|
var import_react_native_size_matters15 = require("react-native-size-matters");
|
|
1717
|
-
setTimeout(() => {
|
|
1718
|
-
const { GOOGLE_MAP_API_KEY } = getApiKey();
|
|
1719
|
-
if (GOOGLE_MAP_API_KEY)
|
|
1720
|
-
Location.setGoogleApiKey(GOOGLE_MAP_API_KEY);
|
|
1721
|
-
}, 500);
|
|
1722
1767
|
var getPredictionsFromCoords = async (coords) => {
|
|
1723
|
-
const { GOOGLE_MAP_API_KEY } =
|
|
1768
|
+
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1724
1769
|
if (!GOOGLE_MAP_API_KEY)
|
|
1725
1770
|
console.error(
|
|
1726
1771
|
"Google map api key needs to be set to use this component \nMake sure to run initialize() with a valid google map api key"
|
|
@@ -1755,7 +1800,7 @@ var Locator = ({
|
|
|
1755
1800
|
float = true,
|
|
1756
1801
|
country = "ng"
|
|
1757
1802
|
}) => {
|
|
1758
|
-
const { GOOGLE_MAP_API_KEY } =
|
|
1803
|
+
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1759
1804
|
const [changed, setChanged] = (0, import_react17.useState)(false);
|
|
1760
1805
|
const [value, setValue] = (0, import_react17.useState)("");
|
|
1761
1806
|
const [prediction, setPrediction] = (0, import_react17.useState)([]);
|
|
@@ -1968,7 +2013,7 @@ var Spinner = ({
|
|
|
1968
2013
|
alignItems: "center",
|
|
1969
2014
|
justifyContent: "center",
|
|
1970
2015
|
position: fullscreen ? "absolute" : "relative",
|
|
1971
|
-
backgroundColor: fullscreen ? colors2.white[1] + "
|
|
2016
|
+
backgroundColor: fullscreen ? colors2.white[1] + "dd" : void 0,
|
|
1972
2017
|
...style
|
|
1973
2018
|
},
|
|
1974
2019
|
content: {
|
|
@@ -2005,6 +2050,36 @@ var OTPInput = ({
|
|
|
2005
2050
|
() => Array(length).fill(0).map((_) => import_react20.default.createRef()),
|
|
2006
2051
|
[length]
|
|
2007
2052
|
);
|
|
2053
|
+
console.log("v", value);
|
|
2054
|
+
const onChangeHandler = (val, index) => {
|
|
2055
|
+
if (value.length >= length && val.length > 0)
|
|
2056
|
+
return;
|
|
2057
|
+
if (val.length > 1) {
|
|
2058
|
+
console.log("reached", val);
|
|
2059
|
+
const digits = val.replace(/\D/g, "").slice(0, length);
|
|
2060
|
+
onChange(digits);
|
|
2061
|
+
if (digits.length === length) {
|
|
2062
|
+
inputRefs[length - 1].current?.focus();
|
|
2063
|
+
}
|
|
2064
|
+
return;
|
|
2065
|
+
}
|
|
2066
|
+
if (val.length === 0) {
|
|
2067
|
+
const newValue2 = value.slice(0, index) + value.slice(index + 1);
|
|
2068
|
+
onChange(newValue2);
|
|
2069
|
+
if (index > 0) {
|
|
2070
|
+
inputRefs[index - 1].current?.focus();
|
|
2071
|
+
}
|
|
2072
|
+
return;
|
|
2073
|
+
}
|
|
2074
|
+
const digit = val.replace(/\D/g, "").slice(0, 1);
|
|
2075
|
+
if (!digit)
|
|
2076
|
+
return;
|
|
2077
|
+
const newValue = value.slice(0, index) + digit + value.slice(index + 1);
|
|
2078
|
+
onChange(newValue);
|
|
2079
|
+
if (index < length - 1) {
|
|
2080
|
+
inputRefs[index + 1].current?.focus();
|
|
2081
|
+
}
|
|
2082
|
+
};
|
|
2008
2083
|
const colors2 = useColors();
|
|
2009
2084
|
const styles2 = import_react_native_size_matters19.ScaledSheet.create({
|
|
2010
2085
|
root: {},
|
|
@@ -2027,27 +2102,7 @@ var OTPInput = ({
|
|
|
2027
2102
|
import_react_native22.TextInput,
|
|
2028
2103
|
{
|
|
2029
2104
|
ref: inputRefs[index],
|
|
2030
|
-
onChangeText: (val) =>
|
|
2031
|
-
if (val.length === 1) {
|
|
2032
|
-
if (index !== length - 1)
|
|
2033
|
-
inputRefs[index + 1].current?.focus();
|
|
2034
|
-
let text = value;
|
|
2035
|
-
text = text.slice(0, index) + val + text.slice(index + 1);
|
|
2036
|
-
onChange(text);
|
|
2037
|
-
} else if (val.length === 0) {
|
|
2038
|
-
if (index !== 0) {
|
|
2039
|
-
inputRefs[index - 1].current?.focus();
|
|
2040
|
-
let text = value;
|
|
2041
|
-
text = text.slice(0, index);
|
|
2042
|
-
onChange(text);
|
|
2043
|
-
} else
|
|
2044
|
-
onChange("");
|
|
2045
|
-
} else {
|
|
2046
|
-
let text = val.replace(/\D/g, "").slice(0, length);
|
|
2047
|
-
onChange(text);
|
|
2048
|
-
inputRefs[text.length < length - 1 ? text.length : length - 1]?.current?.focus();
|
|
2049
|
-
}
|
|
2050
|
-
},
|
|
2105
|
+
onChangeText: (val) => onChangeHandler(val, index),
|
|
2051
2106
|
value: value[index] || "",
|
|
2052
2107
|
blurOnSubmit: false,
|
|
2053
2108
|
keyboardType: "number-pad",
|