react-native-better-html 1.0.2 → 1.0.4
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 +348 -0
- package/dist/index.d.ts +348 -0
- package/dist/index.js +1374 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1343 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +1 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1,1374 @@
|
|
|
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
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
Animate: () => Animate_default,
|
|
34
|
+
BetterComponentsProvider: () => BetterComponentsProvider_default,
|
|
35
|
+
Button: () => Button_default,
|
|
36
|
+
Image: () => Image_default,
|
|
37
|
+
InputField: () => InputField_default,
|
|
38
|
+
Loader: () => Loader_default,
|
|
39
|
+
ScreenHolder: () => ScreenHolder_default,
|
|
40
|
+
Text: () => Text_default,
|
|
41
|
+
View: () => View_default,
|
|
42
|
+
asyncStoragePlugin: () => asyncStoragePlugin,
|
|
43
|
+
colorThemeControls: () => import_react_better_core10.colorThemeControls,
|
|
44
|
+
countries: () => import_react_better_core10.countries,
|
|
45
|
+
darkenColor: () => import_react_better_core10.darkenColor,
|
|
46
|
+
defaultAsyncStoragePluginOptions: () => defaultAsyncStoragePluginOptions,
|
|
47
|
+
desaturateColor: () => import_react_better_core10.desaturateColor,
|
|
48
|
+
eventPreventDefault: () => import_react_better_core10.eventPreventDefault,
|
|
49
|
+
eventPreventStop: () => import_react_better_core10.eventPreventStop,
|
|
50
|
+
eventStopPropagation: () => import_react_better_core10.eventStopPropagation,
|
|
51
|
+
formatPhoneNumber: () => import_react_better_core10.formatPhoneNumber,
|
|
52
|
+
generateAsyncStorage: () => generateAsyncStorage,
|
|
53
|
+
generateRandomString: () => import_react_better_core10.generateRandomString,
|
|
54
|
+
getPluralWord: () => import_react_better_core10.getPluralWord,
|
|
55
|
+
lightenColor: () => import_react_better_core10.lightenColor,
|
|
56
|
+
loaderControls: () => import_react_better_core10.loaderControls,
|
|
57
|
+
pressStrength: () => pressStrength,
|
|
58
|
+
saturateColor: () => import_react_better_core10.saturateColor,
|
|
59
|
+
useBetterComponentsContext: () => useBetterComponentsContext,
|
|
60
|
+
useBooleanState: () => import_react_better_core10.useBooleanState,
|
|
61
|
+
useDebounceState: () => import_react_better_core10.useDebounceState,
|
|
62
|
+
useDevice: () => useDevice,
|
|
63
|
+
useKeyboard: () => useKeyboard,
|
|
64
|
+
useLoader: () => import_react_better_core10.useLoader,
|
|
65
|
+
useLoaderControls: () => import_react_better_core10.useLoaderControls,
|
|
66
|
+
useTheme: () => import_react_better_core10.useTheme
|
|
67
|
+
});
|
|
68
|
+
module.exports = __toCommonJS(index_exports);
|
|
69
|
+
var import_react_better_core10 = require("react-better-core");
|
|
70
|
+
|
|
71
|
+
// src/components/BetterComponentsProvider.tsx
|
|
72
|
+
var import_react = require("react");
|
|
73
|
+
var import_react_better_core = require("react-better-core");
|
|
74
|
+
|
|
75
|
+
// src/constants/app.ts
|
|
76
|
+
var appConfig = {};
|
|
77
|
+
|
|
78
|
+
// src/constants/theme.ts
|
|
79
|
+
var theme = {};
|
|
80
|
+
|
|
81
|
+
// src/constants/icons.ts
|
|
82
|
+
var icons = {};
|
|
83
|
+
|
|
84
|
+
// src/constants/assets.ts
|
|
85
|
+
var assets = {};
|
|
86
|
+
|
|
87
|
+
// src/components/BetterComponentsProvider.tsx
|
|
88
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
89
|
+
var betterComponentsContext = (0, import_react.createContext)(void 0);
|
|
90
|
+
var externalBetterCoreContextValue;
|
|
91
|
+
var externalBetterComponentsContextValue;
|
|
92
|
+
var useBetterComponentsContext = () => {
|
|
93
|
+
const coreContext = (0, import_react_better_core.useBetterCoreContext)();
|
|
94
|
+
const context = (0, import_react.useContext)(betterComponentsContext);
|
|
95
|
+
if (context === void 0)
|
|
96
|
+
throw new Error(
|
|
97
|
+
"`useBetterComponentsContext()` must be used within a `<BetterComponentsProvider>`. Make sure to add one at the root of your component tree."
|
|
98
|
+
);
|
|
99
|
+
const { plugins, componentsState, ...rest } = context;
|
|
100
|
+
return {
|
|
101
|
+
...coreContext,
|
|
102
|
+
...rest
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
function BetterComponentsProviderInternalContent({ children }) {
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
|
107
|
+
}
|
|
108
|
+
function BetterComponentsProviderInternal({
|
|
109
|
+
config,
|
|
110
|
+
plugins,
|
|
111
|
+
children
|
|
112
|
+
}) {
|
|
113
|
+
const betterCoreContext = (0, import_react_better_core.useBetterCoreContext)();
|
|
114
|
+
const [sideMenuIsCollapsed, setSideMenuIsCollapsed] = (0, import_react_better_core.useBooleanState)();
|
|
115
|
+
const [sideMenuIsOpenMobile, setSideMenuIsOpenMobile] = (0, import_react_better_core.useBooleanState)();
|
|
116
|
+
const readyConfig = (0, import_react.useMemo)(
|
|
117
|
+
() => ({
|
|
118
|
+
app: {
|
|
119
|
+
...appConfig,
|
|
120
|
+
...config?.app
|
|
121
|
+
},
|
|
122
|
+
sideMenuIsCollapsed,
|
|
123
|
+
setSideMenuIsCollapsed,
|
|
124
|
+
sideMenuIsOpenMobile,
|
|
125
|
+
setSideMenuIsOpenMobile,
|
|
126
|
+
plugins: plugins ?? [],
|
|
127
|
+
componentsState: {}
|
|
128
|
+
}),
|
|
129
|
+
[config, sideMenuIsCollapsed, sideMenuIsOpenMobile, plugins]
|
|
130
|
+
);
|
|
131
|
+
(0, import_react.useEffect)(() => {
|
|
132
|
+
if (!plugins) return;
|
|
133
|
+
plugins.forEach((plugin) => {
|
|
134
|
+
plugin.initialize?.();
|
|
135
|
+
});
|
|
136
|
+
}, []);
|
|
137
|
+
externalBetterCoreContextValue = betterCoreContext;
|
|
138
|
+
externalBetterComponentsContextValue = readyConfig;
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(betterComponentsContext.Provider, { value: readyConfig, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BetterComponentsProviderInternalContent, { children }) });
|
|
140
|
+
}
|
|
141
|
+
function BetterComponentsProvider({ config, ...props }) {
|
|
142
|
+
const coreConfig = (0, import_react.useMemo)(
|
|
143
|
+
() => ({
|
|
144
|
+
theme: {
|
|
145
|
+
...theme,
|
|
146
|
+
...config?.theme
|
|
147
|
+
},
|
|
148
|
+
// colorTheme: config?.colorTheme ?? (localStorage.getItem("theme") === "dark" ? "dark" : "light"),
|
|
149
|
+
colorTheme: config?.colorTheme ?? "light",
|
|
150
|
+
icons: {
|
|
151
|
+
...icons,
|
|
152
|
+
...config?.icons
|
|
153
|
+
},
|
|
154
|
+
assets: {
|
|
155
|
+
...assets,
|
|
156
|
+
...config?.assets
|
|
157
|
+
},
|
|
158
|
+
loaders: config?.loaders
|
|
159
|
+
}),
|
|
160
|
+
[config]
|
|
161
|
+
);
|
|
162
|
+
const componentsConfig = (0, import_react.useMemo)(
|
|
163
|
+
() => ({
|
|
164
|
+
app: config?.app
|
|
165
|
+
}),
|
|
166
|
+
[config]
|
|
167
|
+
);
|
|
168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_better_core.BetterCoreProvider, { config: coreConfig, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BetterComponentsProviderInternal, { config: componentsConfig, ...props }) });
|
|
169
|
+
}
|
|
170
|
+
var BetterComponentsProvider_default = (0, import_react.memo)(BetterComponentsProvider);
|
|
171
|
+
|
|
172
|
+
// src/utils/variableFunctions.ts
|
|
173
|
+
var checkBetterCoreContextValue = (value, functionsName) => {
|
|
174
|
+
if (value === void 0) {
|
|
175
|
+
throw new Error(
|
|
176
|
+
`\`${functionsName}()\` must be used within a \`<BetterCoreProvider>\`. Make sure to add one at the root of your component tree.`
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
return value !== void 0;
|
|
180
|
+
};
|
|
181
|
+
var pressStrength = () => {
|
|
182
|
+
if (!checkBetterCoreContextValue(externalBetterCoreContextValue, "pressStrength")) return void 0;
|
|
183
|
+
return {
|
|
184
|
+
z05: externalBetterCoreContextValue.colorTheme === "dark" ? 0.85 : 0.95,
|
|
185
|
+
z1: externalBetterCoreContextValue.colorTheme === "dark" ? 0.6 : 0.8,
|
|
186
|
+
z2: externalBetterCoreContextValue.colorTheme === "dark" ? 0.5 : 0.7,
|
|
187
|
+
z3: externalBetterCoreContextValue.colorTheme === "dark" ? 0.4 : 0.6
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// src/utils/hooks.ts
|
|
192
|
+
var import_react2 = require("react");
|
|
193
|
+
var import_react_native = require("react-native");
|
|
194
|
+
var import_react_native_safe_area_context = require("react-native-safe-area-context");
|
|
195
|
+
var import_react_better_core2 = require("react-better-core");
|
|
196
|
+
|
|
197
|
+
// src/constants/css.ts
|
|
198
|
+
var cssProps = /* @__PURE__ */ new Set([
|
|
199
|
+
"aligncontent",
|
|
200
|
+
"alignitems",
|
|
201
|
+
"alignself",
|
|
202
|
+
"aspectratio",
|
|
203
|
+
"borderbottomwidth",
|
|
204
|
+
"borderendwidth",
|
|
205
|
+
"borderleftwidth",
|
|
206
|
+
"borderrightwidth",
|
|
207
|
+
"borderstartwidth",
|
|
208
|
+
"bordertopwidth",
|
|
209
|
+
"borderwidth",
|
|
210
|
+
"bottom",
|
|
211
|
+
"boxsizing",
|
|
212
|
+
"display",
|
|
213
|
+
"end",
|
|
214
|
+
"flex",
|
|
215
|
+
"flexbasis",
|
|
216
|
+
"flexdirection",
|
|
217
|
+
"rowgap",
|
|
218
|
+
"gap",
|
|
219
|
+
"columngap",
|
|
220
|
+
"flexgrow",
|
|
221
|
+
"flexshrink",
|
|
222
|
+
"flexwrap",
|
|
223
|
+
"height",
|
|
224
|
+
"justifycontent",
|
|
225
|
+
"left",
|
|
226
|
+
"margin",
|
|
227
|
+
"marginbottom",
|
|
228
|
+
"marginend",
|
|
229
|
+
"marginhorizontal",
|
|
230
|
+
"marginleft",
|
|
231
|
+
"marginright",
|
|
232
|
+
"marginstart",
|
|
233
|
+
"margintop",
|
|
234
|
+
"marginvertical",
|
|
235
|
+
"maxheight",
|
|
236
|
+
"maxwidth",
|
|
237
|
+
"minheight",
|
|
238
|
+
"minwidth",
|
|
239
|
+
"overflow",
|
|
240
|
+
"padding",
|
|
241
|
+
"paddingbottom",
|
|
242
|
+
"paddingend",
|
|
243
|
+
"paddinghorizontal",
|
|
244
|
+
"paddingleft",
|
|
245
|
+
"paddingright",
|
|
246
|
+
"paddingstart",
|
|
247
|
+
"paddingtop",
|
|
248
|
+
"paddingvertical",
|
|
249
|
+
"position",
|
|
250
|
+
"right",
|
|
251
|
+
"start",
|
|
252
|
+
"top",
|
|
253
|
+
"width",
|
|
254
|
+
"zindex",
|
|
255
|
+
"direction",
|
|
256
|
+
"inset",
|
|
257
|
+
"insetblock",
|
|
258
|
+
"insetblockend",
|
|
259
|
+
"insetblockstart",
|
|
260
|
+
"insetinline",
|
|
261
|
+
"insetinlineend",
|
|
262
|
+
"insetinlinestart",
|
|
263
|
+
"marginblock",
|
|
264
|
+
"marginblockend",
|
|
265
|
+
"marginblockstart",
|
|
266
|
+
"margininline",
|
|
267
|
+
"margininlineend",
|
|
268
|
+
"margininlinestart",
|
|
269
|
+
"paddingblock",
|
|
270
|
+
"paddingblockend",
|
|
271
|
+
"paddingblockstart",
|
|
272
|
+
"paddinginline",
|
|
273
|
+
"paddinginlineend",
|
|
274
|
+
"paddinginlinestart",
|
|
275
|
+
"shadowcolor",
|
|
276
|
+
"shadowoffset",
|
|
277
|
+
"shadowopacity",
|
|
278
|
+
"shadowradius",
|
|
279
|
+
"transform",
|
|
280
|
+
"transformorigin",
|
|
281
|
+
"transformmatrix",
|
|
282
|
+
"rotation",
|
|
283
|
+
"scalex",
|
|
284
|
+
"scaley",
|
|
285
|
+
"translatex",
|
|
286
|
+
"translatey",
|
|
287
|
+
"backfacevisibility",
|
|
288
|
+
"backgroundcolor",
|
|
289
|
+
"borderblockcolor",
|
|
290
|
+
"borderblockendcolor",
|
|
291
|
+
"borderblockstartcolor",
|
|
292
|
+
"borderbottomcolor",
|
|
293
|
+
"borderbottomendradius",
|
|
294
|
+
"borderbottomleftradius",
|
|
295
|
+
"borderbottomrightradius",
|
|
296
|
+
"borderbottomstartradius",
|
|
297
|
+
"bordercolor",
|
|
298
|
+
"bordercurve",
|
|
299
|
+
"borderendcolor",
|
|
300
|
+
"borderendendradius",
|
|
301
|
+
"borderendstartradius",
|
|
302
|
+
"borderleftcolor",
|
|
303
|
+
"borderradius",
|
|
304
|
+
"borderrightcolor",
|
|
305
|
+
"borderstartcolor",
|
|
306
|
+
"borderstartendradius",
|
|
307
|
+
"borderstartstartradius",
|
|
308
|
+
"borderstyle",
|
|
309
|
+
"bordertopcolor",
|
|
310
|
+
"bordertopendradius",
|
|
311
|
+
"bordertopleftradius",
|
|
312
|
+
"bordertoprightradius",
|
|
313
|
+
"bordertopstartradius",
|
|
314
|
+
"outlinecolor",
|
|
315
|
+
"outlineoffset",
|
|
316
|
+
"outlinestyle",
|
|
317
|
+
"outlinewidth",
|
|
318
|
+
"opacity",
|
|
319
|
+
"elevation",
|
|
320
|
+
"pointerevents",
|
|
321
|
+
"isolation",
|
|
322
|
+
"cursor",
|
|
323
|
+
"boxshadow",
|
|
324
|
+
"filter",
|
|
325
|
+
"mixblendmode",
|
|
326
|
+
"fontvariant",
|
|
327
|
+
"textdecorationcolor",
|
|
328
|
+
"textdecorationstyle",
|
|
329
|
+
"writingdirection",
|
|
330
|
+
"textalignvertical",
|
|
331
|
+
"verticalalign",
|
|
332
|
+
"includefontpadding",
|
|
333
|
+
"color",
|
|
334
|
+
"fontfamily",
|
|
335
|
+
"fontsize",
|
|
336
|
+
"fontstyle",
|
|
337
|
+
"fontweight",
|
|
338
|
+
"letterspacing",
|
|
339
|
+
"lineheight",
|
|
340
|
+
"textalign",
|
|
341
|
+
"textdecorationline",
|
|
342
|
+
"textdecorationstyle",
|
|
343
|
+
"textdecorationcolor",
|
|
344
|
+
"textshadowcolor",
|
|
345
|
+
"textshadowoffset",
|
|
346
|
+
"textshadowradius",
|
|
347
|
+
"texttransform",
|
|
348
|
+
"userselect"
|
|
349
|
+
]);
|
|
350
|
+
var animateProps = /* @__PURE__ */ new Set([
|
|
351
|
+
"x",
|
|
352
|
+
"y",
|
|
353
|
+
"scale",
|
|
354
|
+
"scaleX",
|
|
355
|
+
"scaleY",
|
|
356
|
+
"skewX",
|
|
357
|
+
"skewY",
|
|
358
|
+
"perspective",
|
|
359
|
+
"rotate",
|
|
360
|
+
"rotateX",
|
|
361
|
+
"rotateY",
|
|
362
|
+
"rotateZ",
|
|
363
|
+
"matrix"
|
|
364
|
+
]);
|
|
365
|
+
var animateTransitionProps = /* @__PURE__ */ new Set([
|
|
366
|
+
"type",
|
|
367
|
+
"ease",
|
|
368
|
+
"easing",
|
|
369
|
+
"duration",
|
|
370
|
+
"delay",
|
|
371
|
+
"type",
|
|
372
|
+
"friction",
|
|
373
|
+
"tension",
|
|
374
|
+
"speed",
|
|
375
|
+
"bounciness",
|
|
376
|
+
"stiffness",
|
|
377
|
+
"damping",
|
|
378
|
+
"mass",
|
|
379
|
+
"overshootClamping",
|
|
380
|
+
"restDisplacementThreshold",
|
|
381
|
+
"restSpeedThreshold",
|
|
382
|
+
"velocity",
|
|
383
|
+
"loop"
|
|
384
|
+
]);
|
|
385
|
+
|
|
386
|
+
// src/utils/hooks.ts
|
|
387
|
+
function useDevice() {
|
|
388
|
+
const theme2 = (0, import_react_better_core2.useTheme)();
|
|
389
|
+
const safeAreaInsets = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
|
|
390
|
+
const screenDimensions = import_react_native.Dimensions.get("screen");
|
|
391
|
+
const windowDimensions = import_react_native.Dimensions.get("window");
|
|
392
|
+
const isSmallDevice = windowDimensions.height <= 700;
|
|
393
|
+
return {
|
|
394
|
+
safeArea: {
|
|
395
|
+
...safeAreaInsets,
|
|
396
|
+
/** @description The safe area insets after calculations. Recommended to use this instead of the raw insets. */
|
|
397
|
+
afterCalculations: {
|
|
398
|
+
top: safeAreaInsets.top < 25 ? 32 : safeAreaInsets.top < 40 ? 40 : safeAreaInsets.top,
|
|
399
|
+
bottom: (safeAreaInsets.bottom === 0 ? theme2.styles.space : safeAreaInsets.bottom) + (isSmallDevice ? 0 : theme2.styles.space * 2),
|
|
400
|
+
left: safeAreaInsets.left,
|
|
401
|
+
right: safeAreaInsets.right
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
/** @description The dimensions of the device screen. */
|
|
405
|
+
screenDimensions,
|
|
406
|
+
/** @description The dimensions of the app window. */
|
|
407
|
+
windowDimensions,
|
|
408
|
+
/** @description Whether the device is small. */
|
|
409
|
+
isSmallDevice
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
function useKeyboard() {
|
|
413
|
+
const [keyboardOpened, setKeyboardOpened] = (0, import_react_better_core2.useBooleanState)();
|
|
414
|
+
const [keyboardWillOpen, setKeyboardWillOpen] = (0, import_react_better_core2.useBooleanState)();
|
|
415
|
+
const [keyboardHeight, setKeyboardHeight] = (0, import_react2.useState)(0);
|
|
416
|
+
(0, import_react2.useEffect)(() => {
|
|
417
|
+
const keyboardDidShow = (event) => {
|
|
418
|
+
setKeyboardOpened.setTrue();
|
|
419
|
+
setKeyboardHeight(event.endCoordinates.height);
|
|
420
|
+
};
|
|
421
|
+
const keyboardDidHide = () => {
|
|
422
|
+
setKeyboardOpened.setFalse();
|
|
423
|
+
setKeyboardHeight(0);
|
|
424
|
+
};
|
|
425
|
+
const willShowSubscription = import_react_native.Keyboard.addListener("keyboardWillShow", setKeyboardWillOpen.setTrue);
|
|
426
|
+
const willHideSubscription = import_react_native.Keyboard.addListener("keyboardWillHide", setKeyboardWillOpen.setFalse);
|
|
427
|
+
const didShowSubscription = import_react_native.Keyboard.addListener("keyboardDidShow", keyboardDidShow);
|
|
428
|
+
const didHideSubscription = import_react_native.Keyboard.addListener("keyboardDidHide", keyboardDidHide);
|
|
429
|
+
return () => {
|
|
430
|
+
willShowSubscription.remove();
|
|
431
|
+
willHideSubscription.remove();
|
|
432
|
+
didShowSubscription.remove();
|
|
433
|
+
didHideSubscription.remove();
|
|
434
|
+
};
|
|
435
|
+
}, []);
|
|
436
|
+
return {
|
|
437
|
+
isOpened: keyboardOpened,
|
|
438
|
+
willOpen: keyboardWillOpen,
|
|
439
|
+
height: keyboardHeight
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
function useComponentPropsGrouper(props, prefix) {
|
|
443
|
+
return (0, import_react2.useMemo)(() => {
|
|
444
|
+
const style = {};
|
|
445
|
+
const withPrefixStyle = {};
|
|
446
|
+
const restProps = {};
|
|
447
|
+
for (const key in props) {
|
|
448
|
+
const keyName = key;
|
|
449
|
+
if (cssProps.has(keyName.toLowerCase())) {
|
|
450
|
+
style[keyName] = props[keyName];
|
|
451
|
+
} else if (keyName.startsWith(prefix) && (cssProps.has(keyName.slice(prefix.length).toLowerCase()) || animateProps.has(keyName.slice(prefix.length).toLowerCase()) || animateTransitionProps.has(keyName.slice(prefix.length).toLowerCase()))) {
|
|
452
|
+
const realKey = `${keyName.slice(prefix.length, prefix.length + 1).toLowerCase()}${keyName.slice(
|
|
453
|
+
prefix.length + 1
|
|
454
|
+
)}`;
|
|
455
|
+
withPrefixStyle[realKey] = props[keyName];
|
|
456
|
+
} else {
|
|
457
|
+
restProps[keyName] = props[keyName];
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return {
|
|
461
|
+
style,
|
|
462
|
+
withPrefixStyle,
|
|
463
|
+
restProps
|
|
464
|
+
};
|
|
465
|
+
}, [props, prefix]);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// src/utils/asyncStorage.ts
|
|
469
|
+
var import_async_storage = __toESM(require("@react-native-async-storage/async-storage"));
|
|
470
|
+
function generateAsyncStorage() {
|
|
471
|
+
return {
|
|
472
|
+
setItem: async (name, value) => {
|
|
473
|
+
if (value) await import_async_storage.default.setItem(name.toString(), JSON.stringify(value));
|
|
474
|
+
else await import_async_storage.default.removeItem(name.toString());
|
|
475
|
+
},
|
|
476
|
+
getItem: async (name) => {
|
|
477
|
+
const item = await import_async_storage.default.getItem(name.toString());
|
|
478
|
+
if (item === null) return void 0;
|
|
479
|
+
try {
|
|
480
|
+
return JSON.parse(item);
|
|
481
|
+
} catch (error) {
|
|
482
|
+
return void 0;
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
removeItem: async (name) => {
|
|
486
|
+
await import_async_storage.default.removeItem(name.toString());
|
|
487
|
+
},
|
|
488
|
+
removeAllItems: () => {
|
|
489
|
+
import_async_storage.default.clear();
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// src/components/View.tsx
|
|
495
|
+
var import_react3 = require("react");
|
|
496
|
+
var import_react_native2 = require("react-native");
|
|
497
|
+
var import_react_better_core3 = require("react-better-core");
|
|
498
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
499
|
+
var touchableHighlightStyleMoveToContent = [
|
|
500
|
+
"backgroundColor",
|
|
501
|
+
"padding",
|
|
502
|
+
"paddingTop",
|
|
503
|
+
"paddingBottom",
|
|
504
|
+
"paddingLeft",
|
|
505
|
+
"paddingRight",
|
|
506
|
+
"paddingHorizontal",
|
|
507
|
+
"paddingVertical",
|
|
508
|
+
"borderWidth",
|
|
509
|
+
"borderTopWidth",
|
|
510
|
+
"borderBottomWidth",
|
|
511
|
+
"borderLeftWidth",
|
|
512
|
+
"borderRightWidth",
|
|
513
|
+
"borderColor",
|
|
514
|
+
"borderTopColor",
|
|
515
|
+
"borderBottomColor",
|
|
516
|
+
"borderLeftColor",
|
|
517
|
+
"borderRightColor"
|
|
518
|
+
];
|
|
519
|
+
var touchableNativeFeedbackStyleMoveToHolder = [
|
|
520
|
+
"width",
|
|
521
|
+
"height",
|
|
522
|
+
"margin",
|
|
523
|
+
"marginTop",
|
|
524
|
+
"marginBottom",
|
|
525
|
+
"marginLeft",
|
|
526
|
+
"marginRight",
|
|
527
|
+
"marginHorizontal",
|
|
528
|
+
"marginVertical"
|
|
529
|
+
];
|
|
530
|
+
function alphaToHex(alpha) {
|
|
531
|
+
const clamped = Math.min(1, Math.max(0, alpha));
|
|
532
|
+
const value = Math.round(clamped * 255);
|
|
533
|
+
return value.toString(16).padStart(2, "0");
|
|
534
|
+
}
|
|
535
|
+
var ViewComponent = function View({
|
|
536
|
+
isRow,
|
|
537
|
+
value,
|
|
538
|
+
disabled,
|
|
539
|
+
pressType = "highlight",
|
|
540
|
+
pressStrength: pressStrength2 = 0.8,
|
|
541
|
+
onPress,
|
|
542
|
+
onPressIn,
|
|
543
|
+
onPressOut,
|
|
544
|
+
onLongPress,
|
|
545
|
+
onPressWithValue,
|
|
546
|
+
children,
|
|
547
|
+
...props
|
|
548
|
+
}) {
|
|
549
|
+
const theme2 = (0, import_react_better_core3.useTheme)();
|
|
550
|
+
const style = (0, import_react3.useMemo)(
|
|
551
|
+
() => ({
|
|
552
|
+
flexDirection: isRow ? "row" : "column",
|
|
553
|
+
...props,
|
|
554
|
+
...props.shadowOffsetWidth !== void 0 || props.shadowOffsetHeight !== void 0 ? {
|
|
555
|
+
shadowOffset: {
|
|
556
|
+
width: props.shadowOffsetWidth ?? 0,
|
|
557
|
+
height: props.shadowOffsetHeight ?? 0
|
|
558
|
+
}
|
|
559
|
+
} : {}
|
|
560
|
+
}),
|
|
561
|
+
[isRow, props]
|
|
562
|
+
);
|
|
563
|
+
const touchableHighlightStyle = (0, import_react3.useMemo)(
|
|
564
|
+
() => ({
|
|
565
|
+
...style,
|
|
566
|
+
...touchableHighlightStyleMoveToContent.reduce((previousValue, currentValue) => {
|
|
567
|
+
if (currentValue === "shadowOffsetWidth" || currentValue === "shadowOffsetHeight")
|
|
568
|
+
previousValue.shadowOffset = void 0;
|
|
569
|
+
else previousValue[currentValue] = void 0;
|
|
570
|
+
return previousValue;
|
|
571
|
+
}, {})
|
|
572
|
+
}),
|
|
573
|
+
[style]
|
|
574
|
+
);
|
|
575
|
+
const touchableHighlightContentProps = (0, import_react3.useMemo)(
|
|
576
|
+
() => touchableHighlightStyleMoveToContent.reduce((previousValue, currentValue) => {
|
|
577
|
+
previousValue[currentValue] = props[currentValue];
|
|
578
|
+
return previousValue;
|
|
579
|
+
}, {}),
|
|
580
|
+
[props]
|
|
581
|
+
);
|
|
582
|
+
const touchableNativeFeedbackHolderStyle = (0, import_react3.useMemo)(
|
|
583
|
+
() => touchableNativeFeedbackStyleMoveToHolder.reduce((previousValue, currentValue) => {
|
|
584
|
+
previousValue[currentValue] = props[currentValue];
|
|
585
|
+
return previousValue;
|
|
586
|
+
}, {}),
|
|
587
|
+
[props]
|
|
588
|
+
);
|
|
589
|
+
const touchableNativeFeedbackContentStyle = (0, import_react3.useMemo)(
|
|
590
|
+
() => ({
|
|
591
|
+
...style,
|
|
592
|
+
...touchableNativeFeedbackStyleMoveToHolder.reduce(
|
|
593
|
+
(previousValue, currentValue) => {
|
|
594
|
+
if (currentValue === "shadowOffsetWidth" || currentValue === "shadowOffsetHeight")
|
|
595
|
+
previousValue.shadowOffset = void 0;
|
|
596
|
+
else previousValue[currentValue] = void 0;
|
|
597
|
+
return previousValue;
|
|
598
|
+
},
|
|
599
|
+
{}
|
|
600
|
+
)
|
|
601
|
+
}),
|
|
602
|
+
[style]
|
|
603
|
+
);
|
|
604
|
+
const pressEvents = (0, import_react3.useMemo)(
|
|
605
|
+
() => !disabled ? {
|
|
606
|
+
onPress: (event) => {
|
|
607
|
+
onPress?.(event);
|
|
608
|
+
if (value !== void 0) onPressWithValue?.(value);
|
|
609
|
+
},
|
|
610
|
+
onPressIn,
|
|
611
|
+
onPressOut,
|
|
612
|
+
onLongPress
|
|
613
|
+
} : {},
|
|
614
|
+
[disabled, onPress, onPressIn, onPressOut, onLongPress, onPressWithValue, value]
|
|
615
|
+
);
|
|
616
|
+
const androidBoxShadow = import_react_native2.Platform.OS === "android" ? props.shadowOffsetWidth !== void 0 || props.shadowOffsetHeight !== void 0 ? `${props.shadowOffsetWidth ?? 0}px ${props.shadowOffsetHeight ?? 0}px ${props.shadowRadius}px ${props.shadowColor?.toString() ?? "#000000"}` : void 0 : void 0;
|
|
617
|
+
const isPressable = onPress || onPressIn || onPressOut || onLongPress || onPressWithValue;
|
|
618
|
+
return isPressable ? pressType === "opacity" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
619
|
+
import_react_native2.TouchableOpacity,
|
|
620
|
+
{
|
|
621
|
+
style,
|
|
622
|
+
activeOpacity: pressStrength2,
|
|
623
|
+
boxShadow: androidBoxShadow,
|
|
624
|
+
...pressEvents,
|
|
625
|
+
...props,
|
|
626
|
+
children
|
|
627
|
+
}
|
|
628
|
+
) : pressType === "highlight" ? import_react_native2.Platform.OS === "ios" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
629
|
+
import_react_native2.TouchableHighlight,
|
|
630
|
+
{
|
|
631
|
+
activeOpacity: pressStrength2,
|
|
632
|
+
underlayColor: theme2.colors.textPrimary,
|
|
633
|
+
style: touchableHighlightStyle,
|
|
634
|
+
...pressEvents,
|
|
635
|
+
...props,
|
|
636
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
637
|
+
ViewComponent,
|
|
638
|
+
{
|
|
639
|
+
width: "100%",
|
|
640
|
+
borderRadius: props.borderRadius,
|
|
641
|
+
borderTopLeftRadius: props.borderTopLeftRadius,
|
|
642
|
+
borderTopRightRadius: props.borderTopRightRadius,
|
|
643
|
+
borderBottomLeftRadius: props.borderBottomLeftRadius,
|
|
644
|
+
borderBottomRightRadius: props.borderBottomRightRadius,
|
|
645
|
+
...touchableHighlightContentProps,
|
|
646
|
+
children
|
|
647
|
+
}
|
|
648
|
+
)
|
|
649
|
+
}
|
|
650
|
+
) : import_react_native2.Platform.OS === "android" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
651
|
+
ViewComponent,
|
|
652
|
+
{
|
|
653
|
+
...touchableNativeFeedbackHolderStyle,
|
|
654
|
+
borderRadius: props.borderRadius,
|
|
655
|
+
borderTopLeftRadius: props.borderTopLeftRadius,
|
|
656
|
+
borderTopRightRadius: props.borderTopRightRadius,
|
|
657
|
+
borderBottomLeftRadius: props.borderBottomLeftRadius,
|
|
658
|
+
borderBottomRightRadius: props.borderBottomRightRadius,
|
|
659
|
+
boxShadow: androidBoxShadow,
|
|
660
|
+
overflow: "hidden",
|
|
661
|
+
pointerEvents: "box-none",
|
|
662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
663
|
+
import_react_native2.TouchableNativeFeedback,
|
|
664
|
+
{
|
|
665
|
+
...pressEvents,
|
|
666
|
+
...props,
|
|
667
|
+
background: import_react_native2.TouchableNativeFeedback.Ripple(
|
|
668
|
+
`${theme2.colors.textPrimary}${alphaToHex(1 - pressStrength2)}`,
|
|
669
|
+
false
|
|
670
|
+
),
|
|
671
|
+
useForeground: true,
|
|
672
|
+
touchSoundDisabled: true,
|
|
673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ViewComponent, { flex: 1, ...touchableNativeFeedbackContentStyle, children })
|
|
674
|
+
}
|
|
675
|
+
)
|
|
676
|
+
}
|
|
677
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.View, { boxShadow: androidBoxShadow, style, ...props, children });
|
|
678
|
+
};
|
|
679
|
+
ViewComponent.box = function Box({ withShadow, ...props }) {
|
|
680
|
+
const theme2 = (0, import_react_better_core3.useTheme)();
|
|
681
|
+
const shadowProps = (0, import_react3.useMemo)(
|
|
682
|
+
() => withShadow ? {
|
|
683
|
+
shadowOpacity: 0.2,
|
|
684
|
+
shadowOffsetHeight: 10,
|
|
685
|
+
shadowRadius: 10,
|
|
686
|
+
shadowColor: import_react_native2.Platform.OS === "android" ? "#00000020" : void 0
|
|
687
|
+
} : {},
|
|
688
|
+
[]
|
|
689
|
+
);
|
|
690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
691
|
+
ViewComponent,
|
|
692
|
+
{
|
|
693
|
+
width: "100%",
|
|
694
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
695
|
+
borderWidth: 1,
|
|
696
|
+
borderColor: theme2.colors.border,
|
|
697
|
+
borderRadius: theme2.styles.borderRadius,
|
|
698
|
+
paddingHorizontal: theme2.styles.space,
|
|
699
|
+
paddingVertical: theme2.styles.gap,
|
|
700
|
+
...shadowProps,
|
|
701
|
+
...props
|
|
702
|
+
}
|
|
703
|
+
);
|
|
704
|
+
};
|
|
705
|
+
var View2 = (0, import_react3.memo)(ViewComponent);
|
|
706
|
+
View2.box = ViewComponent.box;
|
|
707
|
+
var View_default = View2;
|
|
708
|
+
|
|
709
|
+
// src/components/Text.tsx
|
|
710
|
+
var import_react4 = require("react");
|
|
711
|
+
var import_react_native3 = require("react-native");
|
|
712
|
+
var import_react_better_core4 = require("react-better-core");
|
|
713
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
714
|
+
var TextComponent = function Text({ selectionColor, children, ...props }) {
|
|
715
|
+
const theme2 = (0, import_react_better_core4.useTheme)();
|
|
716
|
+
const style = (0, import_react4.useMemo)(
|
|
717
|
+
() => ({
|
|
718
|
+
fontSize: 16,
|
|
719
|
+
color: theme2.colors.textPrimary,
|
|
720
|
+
...props
|
|
721
|
+
}),
|
|
722
|
+
[theme2, props]
|
|
723
|
+
);
|
|
724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { selectionColor: selectionColor ?? theme2.colors.primary, style, ...props, children });
|
|
725
|
+
};
|
|
726
|
+
TextComponent.title = function Title(props) {
|
|
727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TextComponent, { fontSize: 32, fontWeight: 700, ...props });
|
|
728
|
+
};
|
|
729
|
+
TextComponent.subtitle = function Subtitle(props) {
|
|
730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TextComponent, { fontSize: 24, fontWeight: 700, ...props });
|
|
731
|
+
};
|
|
732
|
+
TextComponent.body = function Body(props) {
|
|
733
|
+
const theme2 = (0, import_react_better_core4.useTheme)();
|
|
734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TextComponent, { color: theme2.colors.textSecondary, ...props });
|
|
735
|
+
};
|
|
736
|
+
TextComponent.caption = function Caption(props) {
|
|
737
|
+
const theme2 = (0, import_react_better_core4.useTheme)();
|
|
738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TextComponent, { fontSize: 14, color: theme2.colors.textSecondary, ...props });
|
|
739
|
+
};
|
|
740
|
+
TextComponent.unknown = function Unknown(props) {
|
|
741
|
+
const theme2 = (0, import_react_better_core4.useTheme)();
|
|
742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TextComponent, { fontStyle: "italic", textAlign: "center", color: theme2.colors.textSecondary, ...props });
|
|
743
|
+
};
|
|
744
|
+
var Text2 = (0, import_react4.memo)(TextComponent);
|
|
745
|
+
Text2.title = TextComponent.title;
|
|
746
|
+
Text2.subtitle = TextComponent.subtitle;
|
|
747
|
+
Text2.body = TextComponent.body;
|
|
748
|
+
Text2.caption = TextComponent.caption;
|
|
749
|
+
Text2.unknown = TextComponent.unknown;
|
|
750
|
+
var Text_default = Text2;
|
|
751
|
+
|
|
752
|
+
// src/components/Button.tsx
|
|
753
|
+
var import_react7 = require("react");
|
|
754
|
+
var import_react_native5 = require("react-native");
|
|
755
|
+
var import_react_better_core6 = require("react-better-core");
|
|
756
|
+
|
|
757
|
+
// src/components/Animate.tsx
|
|
758
|
+
var import_react5 = require("react");
|
|
759
|
+
var import_motion = require("@legendapp/motion");
|
|
760
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
761
|
+
var defaultTransitionDuration = 0.15 * 1e3;
|
|
762
|
+
var Animate = {
|
|
763
|
+
View: (0, import_react5.memo)(function View3({ transformOriginX, transformOriginY, children, ...props }) {
|
|
764
|
+
const initialProps = useComponentPropsGrouper(props, "initial");
|
|
765
|
+
const animateProps2 = useComponentPropsGrouper(props, "animate");
|
|
766
|
+
const whileTapProps = useComponentPropsGrouper(props, "whileTap");
|
|
767
|
+
const transitionProps = useComponentPropsGrouper(props, "transition");
|
|
768
|
+
const transition = (0, import_react5.useMemo)(
|
|
769
|
+
() => ({
|
|
770
|
+
type: "timing",
|
|
771
|
+
duration: defaultTransitionDuration,
|
|
772
|
+
...transitionProps.withPrefixStyle
|
|
773
|
+
}),
|
|
774
|
+
[transitionProps.withPrefixStyle]
|
|
775
|
+
);
|
|
776
|
+
const transformOrigin = (0, import_react5.useMemo)(
|
|
777
|
+
() => transformOriginX !== void 0 || transformOriginY !== void 0 ? {
|
|
778
|
+
x: transformOriginX ?? 0,
|
|
779
|
+
y: transformOriginY ?? 0
|
|
780
|
+
} : void 0,
|
|
781
|
+
[transformOriginX, transformOriginY]
|
|
782
|
+
);
|
|
783
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
784
|
+
import_motion.Motion.View,
|
|
785
|
+
{
|
|
786
|
+
style: initialProps.style,
|
|
787
|
+
initial: initialProps.withPrefixStyle,
|
|
788
|
+
animate: animateProps2.withPrefixStyle,
|
|
789
|
+
transition,
|
|
790
|
+
whileTap: whileTapProps.withPrefixStyle,
|
|
791
|
+
transformOrigin,
|
|
792
|
+
children
|
|
793
|
+
}
|
|
794
|
+
);
|
|
795
|
+
return Object.keys(whileTapProps.withPrefixStyle).length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_motion.Motion.Pressable, { children: content }) : content;
|
|
796
|
+
}),
|
|
797
|
+
Text: (0, import_react5.memo)(function Text3({ transformOriginX, transformOriginY, children, ...props }) {
|
|
798
|
+
const initialProps = useComponentPropsGrouper(props, "initial");
|
|
799
|
+
const animateProps2 = useComponentPropsGrouper(props, "animate");
|
|
800
|
+
const whileTapProps = useComponentPropsGrouper(props, "whileTap");
|
|
801
|
+
const transitionProps = useComponentPropsGrouper(props, "transition");
|
|
802
|
+
const transition = (0, import_react5.useMemo)(
|
|
803
|
+
() => ({
|
|
804
|
+
type: "timing",
|
|
805
|
+
duration: defaultTransitionDuration,
|
|
806
|
+
...transitionProps.withPrefixStyle
|
|
807
|
+
}),
|
|
808
|
+
[transitionProps.withPrefixStyle]
|
|
809
|
+
);
|
|
810
|
+
const transformOrigin = (0, import_react5.useMemo)(
|
|
811
|
+
() => transformOriginX !== void 0 || transformOriginY !== void 0 ? {
|
|
812
|
+
x: transformOriginX ?? 0,
|
|
813
|
+
y: transformOriginY ?? 0
|
|
814
|
+
} : void 0,
|
|
815
|
+
[transformOriginX, transformOriginY]
|
|
816
|
+
);
|
|
817
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
818
|
+
import_motion.Motion.Text,
|
|
819
|
+
{
|
|
820
|
+
style: initialProps.style,
|
|
821
|
+
initial: initialProps.withPrefixStyle,
|
|
822
|
+
animate: animateProps2.withPrefixStyle,
|
|
823
|
+
transition,
|
|
824
|
+
whileTap: whileTapProps.withPrefixStyle,
|
|
825
|
+
transformOrigin,
|
|
826
|
+
children
|
|
827
|
+
}
|
|
828
|
+
);
|
|
829
|
+
return Object.keys(whileTapProps.withPrefixStyle).length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_motion.Motion.Pressable, { children: content }) : content;
|
|
830
|
+
})
|
|
831
|
+
};
|
|
832
|
+
var Animate_default = Animate;
|
|
833
|
+
|
|
834
|
+
// src/components/Loader.tsx
|
|
835
|
+
var import_react6 = require("react");
|
|
836
|
+
var import_react_native4 = require("react-native");
|
|
837
|
+
var import_react_better_core5 = require("react-better-core");
|
|
838
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
839
|
+
var LoaderComponent = function Loader({ size = "small", color, ...props }) {
|
|
840
|
+
const theme2 = (0, import_react_better_core5.useTheme)();
|
|
841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(View_default, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.ActivityIndicator, { size, color: color ?? theme2.colors.textPrimary }) });
|
|
842
|
+
};
|
|
843
|
+
LoaderComponent.box = function Box2({ text = "Loading...", size = "large", color, ...props }) {
|
|
844
|
+
const theme2 = (0, import_react_better_core5.useTheme)();
|
|
845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
846
|
+
View_default,
|
|
847
|
+
{
|
|
848
|
+
width: "100%",
|
|
849
|
+
alignItems: "center",
|
|
850
|
+
gap: theme2.styles.gap,
|
|
851
|
+
marginVertical: theme2.styles.space,
|
|
852
|
+
...props,
|
|
853
|
+
children: [
|
|
854
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Loader2, { size, color }),
|
|
855
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text_default, { textAlign: "center", color: color ?? theme2.colors.textSecondary, children: text })
|
|
856
|
+
]
|
|
857
|
+
}
|
|
858
|
+
);
|
|
859
|
+
};
|
|
860
|
+
LoaderComponent.text = function LoaderText({ text = "Loading...", size, color, ...props }) {
|
|
861
|
+
const theme2 = (0, import_react_better_core5.useTheme)();
|
|
862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
863
|
+
View_default,
|
|
864
|
+
{
|
|
865
|
+
isRow: true,
|
|
866
|
+
alignItems: "center",
|
|
867
|
+
justifyContent: "center",
|
|
868
|
+
gap: theme2.styles.gap,
|
|
869
|
+
marginVertical: theme2.styles.space,
|
|
870
|
+
...props,
|
|
871
|
+
children: [
|
|
872
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Loader2, { size, color }),
|
|
873
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text_default, { textAlign: "center", color: color ?? theme2.colors.textSecondary, children: text })
|
|
874
|
+
]
|
|
875
|
+
}
|
|
876
|
+
);
|
|
877
|
+
};
|
|
878
|
+
var Loader2 = (0, import_react6.memo)(LoaderComponent);
|
|
879
|
+
Loader2.box = LoaderComponent.box;
|
|
880
|
+
Loader2.text = LoaderComponent.text;
|
|
881
|
+
var Loader_default = Loader2;
|
|
882
|
+
|
|
883
|
+
// src/components/Button.tsx
|
|
884
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
885
|
+
var ButtonComponent = function Button({
|
|
886
|
+
text,
|
|
887
|
+
textFontSize = 16,
|
|
888
|
+
textFontWeight = 700,
|
|
889
|
+
textDecorationLine,
|
|
890
|
+
textColor,
|
|
891
|
+
icon,
|
|
892
|
+
iconPosition = "left",
|
|
893
|
+
iconColor,
|
|
894
|
+
iconSize,
|
|
895
|
+
image,
|
|
896
|
+
imagePosition = "left",
|
|
897
|
+
imageWidth,
|
|
898
|
+
imageHeight,
|
|
899
|
+
loaderName,
|
|
900
|
+
isLoading,
|
|
901
|
+
isSmall,
|
|
902
|
+
animateOpacity,
|
|
903
|
+
flex,
|
|
904
|
+
alignSelf,
|
|
905
|
+
disabled,
|
|
906
|
+
...props
|
|
907
|
+
}) {
|
|
908
|
+
const theme2 = (0, import_react_better_core6.useTheme)();
|
|
909
|
+
const isLoadingLoader = (0, import_react_better_core6.useLoader)(loaderName);
|
|
910
|
+
const isLoadingElement = isLoading || isLoadingLoader;
|
|
911
|
+
const isDisabled = disabled || isLoadingElement;
|
|
912
|
+
const lineHeight = 20;
|
|
913
|
+
const color = textColor ?? theme2.colors.base;
|
|
914
|
+
const paddingVertical = props.paddingVertical ? parseFloat(props.paddingVertical.toString()) : theme2.styles.space;
|
|
915
|
+
const paddingHorizontal = props.paddingHorizontal ? parseFloat(props.paddingHorizontal.toString()) : theme2.styles.space + theme2.styles.gap;
|
|
916
|
+
const buttonHeight = paddingVertical + lineHeight + paddingVertical;
|
|
917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
918
|
+
Animate_default.View,
|
|
919
|
+
{
|
|
920
|
+
position: "relative",
|
|
921
|
+
flex,
|
|
922
|
+
alignSelf: alignSelf ?? (isSmall === "left" ? "flex-start" : isSmall === "right" ? "flex-end" : isSmall === "center" ? "center" : isSmall ? "baseline" : void 0),
|
|
923
|
+
initialOpacity: 1,
|
|
924
|
+
animateOpacity: animateOpacity ?? (disabled ? 0.6 : 1),
|
|
925
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
926
|
+
View_default,
|
|
927
|
+
{
|
|
928
|
+
position: "relative",
|
|
929
|
+
width: !isSmall ? "100%" : void 0,
|
|
930
|
+
height: import_react_native5.Platform.OS === "android" ? buttonHeight : void 0,
|
|
931
|
+
alignItems: "center",
|
|
932
|
+
justifyContent: "center",
|
|
933
|
+
backgroundColor: theme2.colors.primary,
|
|
934
|
+
borderRadius: theme2.styles.borderRadius,
|
|
935
|
+
paddingVertical,
|
|
936
|
+
paddingHorizontal,
|
|
937
|
+
disabled: isDisabled,
|
|
938
|
+
...props,
|
|
939
|
+
children: [
|
|
940
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Animate_default.View, { initialOpacity: 1, animateOpacity: isLoadingElement ? 0 : 1, children: text && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
941
|
+
Text_default,
|
|
942
|
+
{
|
|
943
|
+
fontSize: textFontSize,
|
|
944
|
+
fontWeight: textFontWeight,
|
|
945
|
+
textDecorationLine,
|
|
946
|
+
textDecorationColor: color,
|
|
947
|
+
textAlign: "center",
|
|
948
|
+
lineHeight,
|
|
949
|
+
color,
|
|
950
|
+
children: text
|
|
951
|
+
}
|
|
952
|
+
) }),
|
|
953
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
954
|
+
Animate_default.View,
|
|
955
|
+
{
|
|
956
|
+
position: "absolute",
|
|
957
|
+
width: "100%",
|
|
958
|
+
height: buttonHeight,
|
|
959
|
+
left: paddingHorizontal,
|
|
960
|
+
alignItems: "center",
|
|
961
|
+
justifyContent: "center",
|
|
962
|
+
initialOpacity: 0,
|
|
963
|
+
animateOpacity: isLoadingElement ? 1 : 0,
|
|
964
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Loader_default, { color })
|
|
965
|
+
}
|
|
966
|
+
)
|
|
967
|
+
]
|
|
968
|
+
}
|
|
969
|
+
)
|
|
970
|
+
}
|
|
971
|
+
);
|
|
972
|
+
};
|
|
973
|
+
ButtonComponent.secondary = function Secondary(props) {
|
|
974
|
+
const theme2 = (0, import_react_better_core6.useTheme)();
|
|
975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
976
|
+
ButtonComponent,
|
|
977
|
+
{
|
|
978
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
979
|
+
borderWidth: 1,
|
|
980
|
+
borderColor: theme2.colors.border,
|
|
981
|
+
textColor: theme2.colors.textPrimary,
|
|
982
|
+
pressStrength: pressStrength().z05,
|
|
983
|
+
animateOpacity: props.disabled ? 0.4 : 1,
|
|
984
|
+
...props
|
|
985
|
+
}
|
|
986
|
+
);
|
|
987
|
+
};
|
|
988
|
+
ButtonComponent.destructive = function Destructive(props) {
|
|
989
|
+
const theme2 = (0, import_react_better_core6.useTheme)();
|
|
990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonComponent, { backgroundColor: theme2.colors.error, ...props });
|
|
991
|
+
};
|
|
992
|
+
ButtonComponent.text = function ButtonText(props) {
|
|
993
|
+
const theme2 = (0, import_react_better_core6.useTheme)();
|
|
994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
995
|
+
ButtonComponent,
|
|
996
|
+
{
|
|
997
|
+
width: "auto",
|
|
998
|
+
textColor: theme2.colors.textPrimary,
|
|
999
|
+
textDecorationLine: "underline",
|
|
1000
|
+
backgroundColor: "transparent",
|
|
1001
|
+
paddingHorizontal: theme2.styles.space,
|
|
1002
|
+
paddingVertical: theme2.styles.gap,
|
|
1003
|
+
isSmall: true,
|
|
1004
|
+
pressType: "opacity",
|
|
1005
|
+
...props
|
|
1006
|
+
}
|
|
1007
|
+
);
|
|
1008
|
+
};
|
|
1009
|
+
var Button2 = (0, import_react7.memo)(ButtonComponent);
|
|
1010
|
+
Button2.secondary = ButtonComponent.secondary;
|
|
1011
|
+
Button2.destructive = ButtonComponent.destructive;
|
|
1012
|
+
Button2.text = ButtonComponent.text;
|
|
1013
|
+
var Button_default = Button2;
|
|
1014
|
+
|
|
1015
|
+
// src/components/ScreenHolder.tsx
|
|
1016
|
+
var import_react8 = require("react");
|
|
1017
|
+
var import_react_native6 = require("react-native");
|
|
1018
|
+
var import_react_better_core7 = require("react-better-core");
|
|
1019
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1020
|
+
var ScreenHolderComponent = ({
|
|
1021
|
+
noScroll,
|
|
1022
|
+
noSideSpace,
|
|
1023
|
+
refreshTimeout = 1,
|
|
1024
|
+
onRefresh,
|
|
1025
|
+
onRefreshEnd,
|
|
1026
|
+
backgroundColor,
|
|
1027
|
+
insideTopSafeArea,
|
|
1028
|
+
insideBottomSafeArea,
|
|
1029
|
+
bottomSpace = 0,
|
|
1030
|
+
footer,
|
|
1031
|
+
keepFooterOnKeyboardOpened,
|
|
1032
|
+
children
|
|
1033
|
+
}) => {
|
|
1034
|
+
const theme2 = (0, import_react_better_core7.useTheme)();
|
|
1035
|
+
const device = useDevice();
|
|
1036
|
+
const keyboard = useKeyboard();
|
|
1037
|
+
const [isRefreshing, setIsRefreshing] = (0, import_react_better_core7.useBooleanState)();
|
|
1038
|
+
const keyboardAvoidingViewStyle = (0, import_react8.useMemo)(
|
|
1039
|
+
() => ({
|
|
1040
|
+
flex: 1
|
|
1041
|
+
}),
|
|
1042
|
+
[]
|
|
1043
|
+
);
|
|
1044
|
+
const onRefreshElement = (0, import_react8.useCallback)(() => {
|
|
1045
|
+
setIsRefreshing.setTrue();
|
|
1046
|
+
onRefresh?.();
|
|
1047
|
+
setTimeout(() => {
|
|
1048
|
+
setIsRefreshing.setFalse();
|
|
1049
|
+
onRefreshEnd?.();
|
|
1050
|
+
}, refreshTimeout * 1e3);
|
|
1051
|
+
}, [onRefresh, onRefreshEnd, refreshTimeout]);
|
|
1052
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1053
|
+
View_default,
|
|
1054
|
+
{
|
|
1055
|
+
flex: 1,
|
|
1056
|
+
paddingHorizontal: !noSideSpace ? theme2.styles.space : void 0,
|
|
1057
|
+
paddingTop: theme2.styles.gap + (insideTopSafeArea ? device.safeArea.afterCalculations.top : 0),
|
|
1058
|
+
paddingBottom: import_react_native6.Platform.OS === "ios" && keyboard.isOpened ? device.safeArea.afterCalculations.top : bottomSpace + (insideBottomSafeArea ? device.safeArea.afterCalculations.bottom : 0),
|
|
1059
|
+
children
|
|
1060
|
+
}
|
|
1061
|
+
);
|
|
1062
|
+
const withRefresh = onRefresh || onRefreshEnd;
|
|
1063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(View_default, { flex: 1, backgroundColor: backgroundColor ?? theme2.colors.backgroundBase, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1064
|
+
import_react_native6.KeyboardAvoidingView,
|
|
1065
|
+
{
|
|
1066
|
+
style: keyboardAvoidingViewStyle,
|
|
1067
|
+
keyboardVerticalOffset: keepFooterOnKeyboardOpened ? import_react_native6.Platform.OS === "ios" ? device.safeArea.afterCalculations.bottom : theme2.styles.gap : void 0,
|
|
1068
|
+
behavior: import_react_native6.Platform.OS === "ios" ? "padding" : "height",
|
|
1069
|
+
children: [
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(View_default, { flex: 1, children: noScroll ? content : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1071
|
+
import_react_native6.ScrollView,
|
|
1072
|
+
{
|
|
1073
|
+
refreshControl: withRefresh ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native6.RefreshControl, { refreshing: isRefreshing, onRefresh: onRefreshElement }) : void 0,
|
|
1074
|
+
children: content
|
|
1075
|
+
}
|
|
1076
|
+
) }),
|
|
1077
|
+
keepFooterOnKeyboardOpened || (import_react_native6.Platform.OS === "ios" ? !keyboard.willOpen : !keyboard.isOpened) ? footer && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(View_default, { children: footer }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(View_default, { width: "100%", height: device.safeArea.afterCalculations.bottom })
|
|
1078
|
+
]
|
|
1079
|
+
}
|
|
1080
|
+
) });
|
|
1081
|
+
};
|
|
1082
|
+
ScreenHolderComponent.footer = function Footer({
|
|
1083
|
+
noSideSpace,
|
|
1084
|
+
backgroundColor,
|
|
1085
|
+
insideBottomSafeArea,
|
|
1086
|
+
children
|
|
1087
|
+
}) {
|
|
1088
|
+
const theme2 = (0, import_react_better_core7.useTheme)();
|
|
1089
|
+
const device = useDevice();
|
|
1090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1091
|
+
View_default,
|
|
1092
|
+
{
|
|
1093
|
+
backgroundColor: backgroundColor ?? theme2.colors.backgroundBase,
|
|
1094
|
+
paddingHorizontal: !noSideSpace ? theme2.styles.space : void 0,
|
|
1095
|
+
paddingTop: theme2.styles.gap,
|
|
1096
|
+
paddingBottom: insideBottomSafeArea ? device.safeArea.afterCalculations.bottom : void 0,
|
|
1097
|
+
children
|
|
1098
|
+
}
|
|
1099
|
+
);
|
|
1100
|
+
};
|
|
1101
|
+
var ScreenHolder = (0, import_react8.memo)(ScreenHolderComponent);
|
|
1102
|
+
ScreenHolder.footer = ScreenHolderComponent.footer;
|
|
1103
|
+
var ScreenHolder_default = ScreenHolder;
|
|
1104
|
+
|
|
1105
|
+
// src/components/Image.tsx
|
|
1106
|
+
var import_react9 = require("react");
|
|
1107
|
+
var import_react_better_core8 = require("react-better-core");
|
|
1108
|
+
var import_react_native7 = require("react-native");
|
|
1109
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1110
|
+
var ImageComponent = function Image({ name, source, withDevFittingMode, ...props }) {
|
|
1111
|
+
const { assets: assets2 } = (0, import_react_better_core8.useBetterCoreContext)();
|
|
1112
|
+
const style = (0, import_react9.useMemo)(
|
|
1113
|
+
() => ({
|
|
1114
|
+
width: 100,
|
|
1115
|
+
height: 100,
|
|
1116
|
+
...withDevFittingMode ? {
|
|
1117
|
+
borderWidth: 1,
|
|
1118
|
+
borderColor: "#eb39f7"
|
|
1119
|
+
} : {},
|
|
1120
|
+
...props
|
|
1121
|
+
}),
|
|
1122
|
+
[withDevFittingMode, props]
|
|
1123
|
+
);
|
|
1124
|
+
(0, import_react9.useEffect)(() => {
|
|
1125
|
+
if (!name) return;
|
|
1126
|
+
if (!assets2[name.toString()])
|
|
1127
|
+
console.warn(
|
|
1128
|
+
`The asset \`${name}\` you are trying to use does not exist. Make sure to add it to the \`assets\` object in \`<BetterComponentsProvider>\` config value prop.`
|
|
1129
|
+
);
|
|
1130
|
+
}, [assets2, name]);
|
|
1131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Image, { source: name ? assets2[name.toString()] : source, style, ...props });
|
|
1132
|
+
};
|
|
1133
|
+
ImageComponent.profileImage = function ProfileImage({ size = 50, letters, backgroundColor, ...props }) {
|
|
1134
|
+
const theme2 = (0, import_react_better_core8.useTheme)();
|
|
1135
|
+
return letters ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1136
|
+
View_default,
|
|
1137
|
+
{
|
|
1138
|
+
width: size,
|
|
1139
|
+
height: size,
|
|
1140
|
+
backgroundColor: backgroundColor ?? theme2.colors.backgroundSecondary,
|
|
1141
|
+
borderWidth: 1,
|
|
1142
|
+
borderColor: theme2.colors.border,
|
|
1143
|
+
borderRadius: 999,
|
|
1144
|
+
alignItems: "center",
|
|
1145
|
+
justifyContent: "center",
|
|
1146
|
+
...props,
|
|
1147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text_default, { fontSize: size / 2.5, fontWeight: 700, marginTop: 1, children: letters.toUpperCase().slice(0, 2) })
|
|
1148
|
+
}
|
|
1149
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1150
|
+
ImageComponent,
|
|
1151
|
+
{
|
|
1152
|
+
width: size,
|
|
1153
|
+
height: size,
|
|
1154
|
+
borderWidth: 1,
|
|
1155
|
+
borderColor: theme2.colors.border,
|
|
1156
|
+
borderRadius: 999,
|
|
1157
|
+
objectFit: "cover",
|
|
1158
|
+
...props
|
|
1159
|
+
}
|
|
1160
|
+
);
|
|
1161
|
+
};
|
|
1162
|
+
var Image2 = (0, import_react9.memo)(ImageComponent);
|
|
1163
|
+
Image2.profileImage = ImageComponent.profileImage;
|
|
1164
|
+
var Image_default = Image2;
|
|
1165
|
+
|
|
1166
|
+
// src/components/InputField.tsx
|
|
1167
|
+
var import_react10 = require("react");
|
|
1168
|
+
var import_react_native8 = require("react-native");
|
|
1169
|
+
var import_react_better_core9 = require("react-better-core");
|
|
1170
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1171
|
+
var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
1172
|
+
({
|
|
1173
|
+
placeholder,
|
|
1174
|
+
prefix,
|
|
1175
|
+
suffix,
|
|
1176
|
+
defaultValue,
|
|
1177
|
+
editable = true,
|
|
1178
|
+
autoFocus,
|
|
1179
|
+
autoCapitalize,
|
|
1180
|
+
autoComplete,
|
|
1181
|
+
autoCorrect,
|
|
1182
|
+
keyboardAppearance = "default",
|
|
1183
|
+
keyboardType,
|
|
1184
|
+
secureTextEntry,
|
|
1185
|
+
onFocus,
|
|
1186
|
+
onBlur
|
|
1187
|
+
}, ref) => {
|
|
1188
|
+
const theme2 = (0, import_react_better_core9.useTheme)();
|
|
1189
|
+
const { colorTheme } = (0, import_react_better_core9.useBetterCoreContext)();
|
|
1190
|
+
const [isFocused, setIsFocused] = (0, import_react_better_core9.useBooleanState)();
|
|
1191
|
+
const paddingHorizontal = theme2.styles.space;
|
|
1192
|
+
const paddingVertical = (theme2.styles.space + theme2.styles.gap) / 2;
|
|
1193
|
+
const onFocusElement = (0, import_react10.useCallback)((event) => {
|
|
1194
|
+
setIsFocused.setTrue();
|
|
1195
|
+
onFocus?.(event);
|
|
1196
|
+
}, []);
|
|
1197
|
+
const onBlurElement = (0, import_react10.useCallback)((event) => {
|
|
1198
|
+
setIsFocused.setFalse();
|
|
1199
|
+
onBlur?.(event);
|
|
1200
|
+
}, []);
|
|
1201
|
+
const textInputStyle = (0, import_react10.useMemo)(
|
|
1202
|
+
() => ({
|
|
1203
|
+
flex: 1,
|
|
1204
|
+
fontSize: 16,
|
|
1205
|
+
lineHeight: 20,
|
|
1206
|
+
color: theme2.colors.textPrimary,
|
|
1207
|
+
paddingHorizontal,
|
|
1208
|
+
paddingVertical
|
|
1209
|
+
}),
|
|
1210
|
+
[theme2.colors, paddingHorizontal, paddingVertical]
|
|
1211
|
+
);
|
|
1212
|
+
(0, import_react10.useImperativeHandle)(
|
|
1213
|
+
ref,
|
|
1214
|
+
() => {
|
|
1215
|
+
return {};
|
|
1216
|
+
},
|
|
1217
|
+
[]
|
|
1218
|
+
);
|
|
1219
|
+
const prefixSuffixBackgroundColor = colorTheme === "light" ? (0, import_react_better_core9.darkenColor)(theme2.colors.backgroundContent, 0.03) : (0, import_react_better_core9.lightenColor)(theme2.colors.backgroundContent, 0.1);
|
|
1220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(View_default, { isRow: true, position: "relative", alignItems: "center", children: [
|
|
1221
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1222
|
+
View_default,
|
|
1223
|
+
{
|
|
1224
|
+
isRow: true,
|
|
1225
|
+
height: "100%",
|
|
1226
|
+
backgroundColor: prefixSuffixBackgroundColor,
|
|
1227
|
+
alignItems: "center",
|
|
1228
|
+
borderWidth: 1,
|
|
1229
|
+
borderRightWidth: 0,
|
|
1230
|
+
borderTopLeftRadius: theme2.styles.borderRadius,
|
|
1231
|
+
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
1232
|
+
borderColor: theme2.colors.border,
|
|
1233
|
+
paddingHorizontal,
|
|
1234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { fontWeight: 700, children: prefix })
|
|
1235
|
+
}
|
|
1236
|
+
),
|
|
1237
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1238
|
+
Animate_default.View,
|
|
1239
|
+
{
|
|
1240
|
+
flex: 1,
|
|
1241
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
1242
|
+
borderTopLeftRadius: prefix ? 0 : theme2.styles.borderRadius,
|
|
1243
|
+
borderBottomLeftRadius: prefix ? 0 : theme2.styles.borderRadius,
|
|
1244
|
+
borderTopRightRadius: suffix ? 0 : theme2.styles.borderRadius,
|
|
1245
|
+
borderBottomRightRadius: suffix ? 0 : theme2.styles.borderRadius,
|
|
1246
|
+
borderWidth: 1,
|
|
1247
|
+
initialBorderColor: theme2.colors.border,
|
|
1248
|
+
animateBorderColor: isFocused ? theme2.colors.primary : theme2.colors.border,
|
|
1249
|
+
overflow: "hidden",
|
|
1250
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1251
|
+
import_react_native8.TextInput,
|
|
1252
|
+
{
|
|
1253
|
+
style: textInputStyle,
|
|
1254
|
+
defaultValue,
|
|
1255
|
+
autoCapitalize,
|
|
1256
|
+
autoComplete,
|
|
1257
|
+
autoCorrect,
|
|
1258
|
+
autoFocus,
|
|
1259
|
+
placeholder,
|
|
1260
|
+
placeholderTextColor: theme2.colors.textSecondary + "80",
|
|
1261
|
+
readOnly: !editable,
|
|
1262
|
+
keyboardAppearance,
|
|
1263
|
+
keyboardType,
|
|
1264
|
+
cursorColor: theme2.colors.primary,
|
|
1265
|
+
selectionColor: theme2.colors.primary,
|
|
1266
|
+
secureTextEntry,
|
|
1267
|
+
onFocus: onFocusElement,
|
|
1268
|
+
onBlur: onBlurElement
|
|
1269
|
+
}
|
|
1270
|
+
)
|
|
1271
|
+
}
|
|
1272
|
+
),
|
|
1273
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1274
|
+
View_default,
|
|
1275
|
+
{
|
|
1276
|
+
isRow: true,
|
|
1277
|
+
height: "100%",
|
|
1278
|
+
backgroundColor: prefixSuffixBackgroundColor,
|
|
1279
|
+
alignItems: "center",
|
|
1280
|
+
borderWidth: 1,
|
|
1281
|
+
borderLeftWidth: 0,
|
|
1282
|
+
borderTopRightRadius: theme2.styles.borderRadius,
|
|
1283
|
+
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
1284
|
+
borderColor: theme2.colors.border,
|
|
1285
|
+
paddingHorizontal,
|
|
1286
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { fontWeight: 700, children: suffix })
|
|
1287
|
+
}
|
|
1288
|
+
)
|
|
1289
|
+
] });
|
|
1290
|
+
}
|
|
1291
|
+
);
|
|
1292
|
+
InputFieldComponent.email = (0, import_react10.forwardRef)(function Email(props, ref) {
|
|
1293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1294
|
+
InputFieldComponent,
|
|
1295
|
+
{
|
|
1296
|
+
placeholder: "your@email.here",
|
|
1297
|
+
autoComplete: "email",
|
|
1298
|
+
keyboardType: "email-address",
|
|
1299
|
+
autoCapitalize: "none",
|
|
1300
|
+
autoCorrect: false,
|
|
1301
|
+
...props,
|
|
1302
|
+
ref
|
|
1303
|
+
}
|
|
1304
|
+
);
|
|
1305
|
+
});
|
|
1306
|
+
InputFieldComponent.password = (0, import_react10.forwardRef)(function Password(props, ref) {
|
|
1307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1308
|
+
InputFieldComponent,
|
|
1309
|
+
{
|
|
1310
|
+
secureTextEntry: true,
|
|
1311
|
+
placeholder: "******",
|
|
1312
|
+
autoCapitalize: "none",
|
|
1313
|
+
autoComplete: "password",
|
|
1314
|
+
autoCorrect: false,
|
|
1315
|
+
...props,
|
|
1316
|
+
ref
|
|
1317
|
+
}
|
|
1318
|
+
);
|
|
1319
|
+
});
|
|
1320
|
+
var InputField = (0, import_react10.memo)(InputFieldComponent);
|
|
1321
|
+
InputField.email = InputFieldComponent.email;
|
|
1322
|
+
InputField.password = InputFieldComponent.password;
|
|
1323
|
+
var InputField_default = InputField;
|
|
1324
|
+
|
|
1325
|
+
// src/plugins/asyncStorage.ts
|
|
1326
|
+
var defaultAsyncStoragePluginOptions = {};
|
|
1327
|
+
var asyncStoragePlugin = (options) => ({
|
|
1328
|
+
name: "asyncStorage",
|
|
1329
|
+
initialize: () => {
|
|
1330
|
+
console.log("asyncStorage plugin initialized");
|
|
1331
|
+
},
|
|
1332
|
+
getConfig: () => ({
|
|
1333
|
+
...defaultAsyncStoragePluginOptions,
|
|
1334
|
+
...options
|
|
1335
|
+
})
|
|
1336
|
+
});
|
|
1337
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1338
|
+
0 && (module.exports = {
|
|
1339
|
+
Animate,
|
|
1340
|
+
BetterComponentsProvider,
|
|
1341
|
+
Button,
|
|
1342
|
+
Image,
|
|
1343
|
+
InputField,
|
|
1344
|
+
Loader,
|
|
1345
|
+
ScreenHolder,
|
|
1346
|
+
Text,
|
|
1347
|
+
View,
|
|
1348
|
+
asyncStoragePlugin,
|
|
1349
|
+
colorThemeControls,
|
|
1350
|
+
countries,
|
|
1351
|
+
darkenColor,
|
|
1352
|
+
defaultAsyncStoragePluginOptions,
|
|
1353
|
+
desaturateColor,
|
|
1354
|
+
eventPreventDefault,
|
|
1355
|
+
eventPreventStop,
|
|
1356
|
+
eventStopPropagation,
|
|
1357
|
+
formatPhoneNumber,
|
|
1358
|
+
generateAsyncStorage,
|
|
1359
|
+
generateRandomString,
|
|
1360
|
+
getPluralWord,
|
|
1361
|
+
lightenColor,
|
|
1362
|
+
loaderControls,
|
|
1363
|
+
pressStrength,
|
|
1364
|
+
saturateColor,
|
|
1365
|
+
useBetterComponentsContext,
|
|
1366
|
+
useBooleanState,
|
|
1367
|
+
useDebounceState,
|
|
1368
|
+
useDevice,
|
|
1369
|
+
useKeyboard,
|
|
1370
|
+
useLoader,
|
|
1371
|
+
useLoaderControls,
|
|
1372
|
+
useTheme
|
|
1373
|
+
});
|
|
1374
|
+
//# sourceMappingURL=index.js.map
|