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