react-native-better-html 1.0.15 → 1.0.17
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 +58 -34
- package/dist/index.d.ts +58 -34
- package/dist/index.js +298 -123
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +262 -89
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import {
|
|
3
|
-
useTheme as
|
|
3
|
+
useTheme as useTheme11,
|
|
4
4
|
useLoader as useLoader2,
|
|
5
5
|
useLoaderControls,
|
|
6
6
|
countries,
|
|
@@ -35,7 +35,38 @@ var appConfig = {};
|
|
|
35
35
|
var theme = {};
|
|
36
36
|
|
|
37
37
|
// src/constants/icons.ts
|
|
38
|
-
var icons = {
|
|
38
|
+
var icons = {
|
|
39
|
+
eye: {
|
|
40
|
+
width: 576,
|
|
41
|
+
height: 512,
|
|
42
|
+
paths: [
|
|
43
|
+
{
|
|
44
|
+
d: "M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z",
|
|
45
|
+
type: "fill"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
eyeDashed: {
|
|
50
|
+
width: 640,
|
|
51
|
+
height: 512,
|
|
52
|
+
paths: [
|
|
53
|
+
{
|
|
54
|
+
d: "M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z",
|
|
55
|
+
type: "fill"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
magnifyingGlass: {
|
|
60
|
+
width: 512,
|
|
61
|
+
height: 512,
|
|
62
|
+
paths: [
|
|
63
|
+
{
|
|
64
|
+
d: "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z",
|
|
65
|
+
type: "fill"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
};
|
|
39
70
|
|
|
40
71
|
// src/constants/assets.ts
|
|
41
72
|
var assets = {};
|
|
@@ -137,16 +168,16 @@ var checkBetterCoreContextValue = (value, functionsName) => {
|
|
|
137
168
|
var pressStrength = () => {
|
|
138
169
|
if (!checkBetterCoreContextValue(externalBetterCoreContextValue, "pressStrength")) return void 0;
|
|
139
170
|
return {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
171
|
+
p05: externalBetterCoreContextValue.colorTheme === "dark" ? 0.85 : 0.95,
|
|
172
|
+
p1: externalBetterCoreContextValue.colorTheme === "dark" ? 0.6 : 0.8,
|
|
173
|
+
p2: externalBetterCoreContextValue.colorTheme === "dark" ? 0.5 : 0.7,
|
|
174
|
+
p3: externalBetterCoreContextValue.colorTheme === "dark" ? 0.4 : 0.6
|
|
144
175
|
};
|
|
145
176
|
};
|
|
146
177
|
|
|
147
178
|
// src/utils/hooks.ts
|
|
148
179
|
import { useCallback, useEffect as useEffect2, useMemo as useMemo2, useRef, useState } from "react";
|
|
149
|
-
import { Dimensions, Keyboard } from "react-native";
|
|
180
|
+
import { DeviceEventEmitter, Dimensions, Keyboard } from "react-native";
|
|
150
181
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
151
182
|
import { useBooleanState as useBooleanState2, useTheme } from "react-better-core";
|
|
152
183
|
|
|
@@ -538,6 +569,17 @@ function useForm(options) {
|
|
|
538
569
|
canSubmit
|
|
539
570
|
};
|
|
540
571
|
}
|
|
572
|
+
function useEventEmitter() {
|
|
573
|
+
return {
|
|
574
|
+
emit: (eventName, params) => {
|
|
575
|
+
DeviceEventEmitter.emit(eventName, params);
|
|
576
|
+
},
|
|
577
|
+
listen: (eventName, callback = () => {
|
|
578
|
+
}) => {
|
|
579
|
+
return DeviceEventEmitter.addListener(eventName, callback);
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
}
|
|
541
583
|
|
|
542
584
|
// src/utils/functions.ts
|
|
543
585
|
var getFormErrorObject = (formValues) => {
|
|
@@ -654,7 +696,8 @@ var ViewComponent = function View({
|
|
|
654
696
|
previousValue.shadowOffset = void 0;
|
|
655
697
|
else previousValue[currentValue] = void 0;
|
|
656
698
|
return previousValue;
|
|
657
|
-
}, {})
|
|
699
|
+
}, {}),
|
|
700
|
+
width: props.width !== "100%" ? props.width : void 0
|
|
658
701
|
}),
|
|
659
702
|
[style]
|
|
660
703
|
);
|
|
@@ -1066,7 +1109,7 @@ ButtonComponent.secondary = function Secondary(props) {
|
|
|
1066
1109
|
borderWidth: 1,
|
|
1067
1110
|
borderColor: theme2.colors.border,
|
|
1068
1111
|
textColor: theme2.colors.textPrimary,
|
|
1069
|
-
pressStrength: pressStrength().
|
|
1112
|
+
pressStrength: pressStrength().p05,
|
|
1070
1113
|
animateOpacity: props.disabled ? 0.4 : 1,
|
|
1071
1114
|
...props
|
|
1072
1115
|
}
|
|
@@ -1229,7 +1272,13 @@ var ImageComponent = function Image({ name, source, withDevFittingMode, ...props
|
|
|
1229
1272
|
}, [assets2, name]);
|
|
1230
1273
|
return /* @__PURE__ */ jsx8(NativeImage, { source: name ? assets2[name.toString()] : source, style, ...props });
|
|
1231
1274
|
};
|
|
1232
|
-
ImageComponent.profileImage = function ProfileImage({
|
|
1275
|
+
ImageComponent.profileImage = function ProfileImage({
|
|
1276
|
+
size = 50,
|
|
1277
|
+
letters,
|
|
1278
|
+
color,
|
|
1279
|
+
backgroundColor,
|
|
1280
|
+
...props
|
|
1281
|
+
}) {
|
|
1233
1282
|
const theme2 = useTheme7();
|
|
1234
1283
|
return letters ? /* @__PURE__ */ jsx8(
|
|
1235
1284
|
View_default,
|
|
@@ -1243,7 +1292,7 @@ ImageComponent.profileImage = function ProfileImage({ size = 50, letters, backgr
|
|
|
1243
1292
|
alignItems: "center",
|
|
1244
1293
|
justifyContent: "center",
|
|
1245
1294
|
...props,
|
|
1246
|
-
children: /* @__PURE__ */ jsx8(Text_default, { fontSize: size / 2.5, fontWeight: 700, marginTop: 1, children: letters.toUpperCase().slice(0, 2) })
|
|
1295
|
+
children: /* @__PURE__ */ jsx8(Text_default, { fontSize: size / 2.5, fontWeight: 700, color: color ?? theme2.colors.textPrimary, marginTop: 1, children: letters.toUpperCase().slice(0, 2) })
|
|
1247
1296
|
}
|
|
1248
1297
|
) : /* @__PURE__ */ jsx8(
|
|
1249
1298
|
ImageComponent,
|
|
@@ -1262,19 +1311,70 @@ var Image2 = memo8(ImageComponent);
|
|
|
1262
1311
|
Image2.profileImage = ImageComponent.profileImage;
|
|
1263
1312
|
var Image_default = Image2;
|
|
1264
1313
|
|
|
1314
|
+
// src/components/Icon.tsx
|
|
1315
|
+
import { memo as memo9, useEffect as useEffect4 } from "react";
|
|
1316
|
+
import { Platform as Platform4 } from "react-native";
|
|
1317
|
+
import { Path, Svg } from "react-native-svg";
|
|
1318
|
+
import { useBetterCoreContext as useBetterCoreContext3, useTheme as useTheme8 } from "react-better-core";
|
|
1319
|
+
import { SymbolView } from "expo-symbols";
|
|
1320
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1321
|
+
import { createElement } from "react";
|
|
1322
|
+
function Icon({ name, nameIOS, size = 16, color, ...props }) {
|
|
1323
|
+
const theme2 = useTheme8();
|
|
1324
|
+
const { icons: icons2 } = useBetterCoreContext3();
|
|
1325
|
+
const svgColor = color ?? theme2.colors.textPrimary;
|
|
1326
|
+
useEffect4(() => {
|
|
1327
|
+
if (!icons2[name.toString()])
|
|
1328
|
+
console.warn(
|
|
1329
|
+
`The icon \`${name}\` you are trying to use does not exist. Make sure to add it to the \`icons\` object in \`<BetterComponentsProvider>\` config value prop.`
|
|
1330
|
+
);
|
|
1331
|
+
}, [icons2, name]);
|
|
1332
|
+
return /* @__PURE__ */ jsx9(
|
|
1333
|
+
View_default,
|
|
1334
|
+
{
|
|
1335
|
+
width: size + (parseFloat(props.padding?.toString() ?? "0") ?? 0) + (parseFloat(props.paddingHorizontal?.toString() ?? "0") ?? 0),
|
|
1336
|
+
height: size + (parseFloat(props.padding?.toString() ?? "0") ?? 0) + (parseFloat(props.paddingVertical?.toString() ?? "0") ?? 0),
|
|
1337
|
+
alignItems: "center",
|
|
1338
|
+
justifyContent: "center",
|
|
1339
|
+
pressType: "opacity",
|
|
1340
|
+
pressStrength: pressStrength().p2,
|
|
1341
|
+
...props,
|
|
1342
|
+
children: Platform4.OS === "ios" && nameIOS ? /* @__PURE__ */ jsx9(SymbolView, { name: nameIOS, tintColor: svgColor, size }) : /* @__PURE__ */ jsx9(
|
|
1343
|
+
Svg,
|
|
1344
|
+
{
|
|
1345
|
+
width: size,
|
|
1346
|
+
height: size,
|
|
1347
|
+
viewBox: `0 0 ${icons2[name.toString()]?.width ?? 0} ${icons2[name.toString()]?.height ?? 0}`,
|
|
1348
|
+
fill: "none",
|
|
1349
|
+
children: icons2[name.toString()]?.paths.map(({ type, ...path }) => /* @__PURE__ */ createElement(
|
|
1350
|
+
Path,
|
|
1351
|
+
{
|
|
1352
|
+
...path,
|
|
1353
|
+
fill: type === "fill" ? svgColor : void 0,
|
|
1354
|
+
stroke: type === "stroke" ? svgColor : void 0,
|
|
1355
|
+
key: path.d
|
|
1356
|
+
}
|
|
1357
|
+
))
|
|
1358
|
+
}
|
|
1359
|
+
)
|
|
1360
|
+
}
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1363
|
+
var Icon_default = memo9(Icon);
|
|
1364
|
+
|
|
1265
1365
|
// src/components/InputField.tsx
|
|
1266
1366
|
import {
|
|
1267
1367
|
forwardRef,
|
|
1268
|
-
memo as
|
|
1368
|
+
memo as memo10,
|
|
1269
1369
|
useCallback as useCallback3,
|
|
1270
|
-
useEffect as
|
|
1370
|
+
useEffect as useEffect5,
|
|
1271
1371
|
useImperativeHandle,
|
|
1272
1372
|
useMemo as useMemo8,
|
|
1273
1373
|
useRef as useRef2,
|
|
1274
1374
|
useState as useState2
|
|
1275
1375
|
} from "react";
|
|
1276
1376
|
import {
|
|
1277
|
-
Platform as
|
|
1377
|
+
Platform as Platform5,
|
|
1278
1378
|
TextInput as TextInput2
|
|
1279
1379
|
} from "react-native";
|
|
1280
1380
|
import RNDateTimePicker, {
|
|
@@ -1283,11 +1383,11 @@ import RNDateTimePicker, {
|
|
|
1283
1383
|
import {
|
|
1284
1384
|
darkenColor,
|
|
1285
1385
|
lightenColor,
|
|
1286
|
-
useBetterCoreContext as
|
|
1386
|
+
useBetterCoreContext as useBetterCoreContext4,
|
|
1287
1387
|
useBooleanState as useBooleanState4,
|
|
1288
|
-
useTheme as
|
|
1388
|
+
useTheme as useTheme9
|
|
1289
1389
|
} from "react-better-core";
|
|
1290
|
-
import { Fragment as Fragment3, jsx as
|
|
1390
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1291
1391
|
var InputFieldComponent = forwardRef(
|
|
1292
1392
|
({
|
|
1293
1393
|
flex,
|
|
@@ -1322,6 +1422,12 @@ var InputFieldComponent = forwardRef(
|
|
|
1322
1422
|
maxLength,
|
|
1323
1423
|
multiline,
|
|
1324
1424
|
numberOfLines = 2,
|
|
1425
|
+
leftIcon,
|
|
1426
|
+
leftIconIOS,
|
|
1427
|
+
onPressLeftIcon,
|
|
1428
|
+
rightIcon,
|
|
1429
|
+
rightIconIOS,
|
|
1430
|
+
onPressRightIcon,
|
|
1325
1431
|
paddingHorizontal,
|
|
1326
1432
|
paddingVertical,
|
|
1327
1433
|
onFocus,
|
|
@@ -1333,17 +1439,20 @@ var InputFieldComponent = forwardRef(
|
|
|
1333
1439
|
onPressEnter,
|
|
1334
1440
|
...props
|
|
1335
1441
|
}, ref) => {
|
|
1336
|
-
const theme2 =
|
|
1337
|
-
const { colorTheme } =
|
|
1442
|
+
const theme2 = useTheme9();
|
|
1443
|
+
const { colorTheme } = useBetterCoreContext4();
|
|
1338
1444
|
const textInputRef = useRef2(null);
|
|
1339
1445
|
const [internalValue, setInternalValue] = useState2(value?.toString() || defaultValue || "");
|
|
1340
1446
|
const [internalDateValue, setInternalDateValue] = useState2();
|
|
1341
1447
|
const [isFocused, setIsFocused] = useBooleanState4();
|
|
1342
|
-
const isIOSDateTime =
|
|
1448
|
+
const isIOSDateTime = Platform5.OS === "ios" && (type === "date" || type === "time");
|
|
1449
|
+
const iconSize = 16;
|
|
1450
|
+
const iconPadding = onPressRightIcon ? theme2.styles.gap : 0;
|
|
1451
|
+
const iconSideSpace = theme2.styles.space;
|
|
1343
1452
|
const borderWidth = 1;
|
|
1344
1453
|
const readyPaddingHorizontal = paddingHorizontal ?? theme2.styles.space;
|
|
1345
1454
|
const readyPaddingVertical = paddingVertical ? parseFloat(paddingVertical.toString()) : (theme2.styles.space + theme2.styles.gap) / 2;
|
|
1346
|
-
const readyHeight = height ?? isIOSDateTime ? void 0 : borderWidth + readyPaddingVertical + lineHeight + readyPaddingVertical + borderWidth + (
|
|
1455
|
+
const readyHeight = height ?? isIOSDateTime ? void 0 : borderWidth + readyPaddingVertical + lineHeight + readyPaddingVertical + borderWidth + (Platform5.OS === "android" ? 2 : 0);
|
|
1347
1456
|
const onChangeRNDateTimePicker = useCallback3(
|
|
1348
1457
|
(event, data) => {
|
|
1349
1458
|
setInternalDateValue(data);
|
|
@@ -1355,7 +1464,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1355
1464
|
(event) => {
|
|
1356
1465
|
onPress?.(event);
|
|
1357
1466
|
if (type === "date" || type === "time") {
|
|
1358
|
-
if (
|
|
1467
|
+
if (Platform5.OS === "android") {
|
|
1359
1468
|
DateTimePickerAndroid.open({
|
|
1360
1469
|
value: internalDateValue ?? /* @__PURE__ */ new Date(),
|
|
1361
1470
|
is24Hour: true,
|
|
@@ -1373,7 +1482,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1373
1482
|
},
|
|
1374
1483
|
onChange: onChangeRNDateTimePicker
|
|
1375
1484
|
});
|
|
1376
|
-
} else if (
|
|
1485
|
+
} else if (Platform5.OS === "ios") {
|
|
1377
1486
|
}
|
|
1378
1487
|
}
|
|
1379
1488
|
},
|
|
@@ -1401,10 +1510,23 @@ var InputFieldComponent = forwardRef(
|
|
|
1401
1510
|
fontWeight,
|
|
1402
1511
|
lineHeight,
|
|
1403
1512
|
color: theme2.colors.textPrimary,
|
|
1513
|
+
paddingLeft: leftIcon ? iconSideSpace + iconSize + iconSideSpace : void 0,
|
|
1514
|
+
paddingRight: rightIcon ? iconSideSpace + iconSize + iconSideSpace : void 0,
|
|
1404
1515
|
paddingHorizontal: readyPaddingHorizontal,
|
|
1405
1516
|
paddingVertical: readyPaddingVertical
|
|
1406
1517
|
}),
|
|
1407
|
-
[
|
|
1518
|
+
[
|
|
1519
|
+
theme2.colors,
|
|
1520
|
+
fontSize,
|
|
1521
|
+
fontWeight,
|
|
1522
|
+
lineHeight,
|
|
1523
|
+
readyPaddingHorizontal,
|
|
1524
|
+
readyPaddingVertical,
|
|
1525
|
+
iconSideSpace,
|
|
1526
|
+
iconSize,
|
|
1527
|
+
leftIcon,
|
|
1528
|
+
rightIcon
|
|
1529
|
+
]
|
|
1408
1530
|
);
|
|
1409
1531
|
const rnDateTimePickerStyle = useMemo8(
|
|
1410
1532
|
() => ({
|
|
@@ -1413,7 +1535,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1413
1535
|
}),
|
|
1414
1536
|
[iOSDateTimeFullSize]
|
|
1415
1537
|
);
|
|
1416
|
-
|
|
1538
|
+
useEffect5(() => {
|
|
1417
1539
|
if (value === void 0) return;
|
|
1418
1540
|
setInternalValue(value.toString());
|
|
1419
1541
|
try {
|
|
@@ -1421,7 +1543,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1421
1543
|
} catch (error) {
|
|
1422
1544
|
}
|
|
1423
1545
|
}, [value]);
|
|
1424
|
-
|
|
1546
|
+
useEffect5(() => {
|
|
1425
1547
|
if (type !== "date" && type !== "time") return;
|
|
1426
1548
|
const date = internalDateValue?.toISOString().split("T")[0] ?? "";
|
|
1427
1549
|
const hours = internalDateValue ? internalDateValue.getHours().toString() : "00";
|
|
@@ -1440,8 +1562,8 @@ var InputFieldComponent = forwardRef(
|
|
|
1440
1562
|
const withPressInputField = !!onPress || type === "date" || type === "time";
|
|
1441
1563
|
const prefixSuffixBackgroundColor = colorTheme === "light" ? darkenColor(theme2.colors.backgroundContent, 0.03) : lightenColor(theme2.colors.backgroundContent, 0.1);
|
|
1442
1564
|
const labelComponent = label && /* @__PURE__ */ jsxs4(View_default, { isRow: true, alignItems: "center", gap: 2, children: [
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
required && /* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ jsx10(Text_default, { fontSize: 14, color: isError ? theme2.colors.error : theme2.colors.textSecondary, children: label }),
|
|
1566
|
+
required && /* @__PURE__ */ jsx10(Text_default, { color: theme2.colors.error, children: "*" })
|
|
1445
1567
|
] });
|
|
1446
1568
|
return /* @__PURE__ */ jsxs4(
|
|
1447
1569
|
Animate_default.View,
|
|
@@ -1454,7 +1576,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1454
1576
|
children: [
|
|
1455
1577
|
isIOSDateTime && !iOSDateTimeFullSize ? void 0 : labelComponent,
|
|
1456
1578
|
/* @__PURE__ */ jsxs4(View_default, { isRow: true, position: "relative", alignItems: "center", height: readyHeight, children: [
|
|
1457
|
-
prefix && /* @__PURE__ */
|
|
1579
|
+
prefix && /* @__PURE__ */ jsx10(
|
|
1458
1580
|
View_default,
|
|
1459
1581
|
{
|
|
1460
1582
|
isRow: true,
|
|
@@ -1469,12 +1591,12 @@ var InputFieldComponent = forwardRef(
|
|
|
1469
1591
|
borderColor: theme2.colors.border,
|
|
1470
1592
|
paddingHorizontal: readyPaddingHorizontal,
|
|
1471
1593
|
onPress: onPressPrefix,
|
|
1472
|
-
children: typeof prefix === "string" ? /* @__PURE__ */
|
|
1594
|
+
children: typeof prefix === "string" ? /* @__PURE__ */ jsx10(
|
|
1473
1595
|
Text_default,
|
|
1474
1596
|
{
|
|
1475
1597
|
fontWeight: 700,
|
|
1476
1598
|
lineHeight,
|
|
1477
|
-
marginTop:
|
|
1599
|
+
marginTop: Platform5.OS === "ios" && onPressPrefix ? readyPaddingVertical : void 0,
|
|
1478
1600
|
children: prefix
|
|
1479
1601
|
}
|
|
1480
1602
|
) : prefix
|
|
@@ -1482,7 +1604,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1482
1604
|
),
|
|
1483
1605
|
isIOSDateTime ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
1484
1606
|
!iOSDateTimeFullSize ? labelComponent : void 0,
|
|
1485
|
-
/* @__PURE__ */
|
|
1607
|
+
/* @__PURE__ */ jsx10(
|
|
1486
1608
|
RNDateTimePicker,
|
|
1487
1609
|
{
|
|
1488
1610
|
value: internalDateValue ?? /* @__PURE__ */ new Date(),
|
|
@@ -1493,7 +1615,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1493
1615
|
onChange: onChangeRNDateTimePicker
|
|
1494
1616
|
}
|
|
1495
1617
|
)
|
|
1496
|
-
] }) : /* @__PURE__ */
|
|
1618
|
+
] }) : /* @__PURE__ */ jsx10(
|
|
1497
1619
|
View_default,
|
|
1498
1620
|
{
|
|
1499
1621
|
flex: 1,
|
|
@@ -1503,11 +1625,13 @@ var InputFieldComponent = forwardRef(
|
|
|
1503
1625
|
borderTopRightRadius: suffix ? 0 : theme2.styles.borderRadius,
|
|
1504
1626
|
borderBottomRightRadius: suffix ? 0 : theme2.styles.borderRadius,
|
|
1505
1627
|
pressStrength: 1,
|
|
1506
|
-
onPress:
|
|
1507
|
-
children: /* @__PURE__ */
|
|
1628
|
+
onPress: Platform5.OS === "android" ? editable === false || withPressInputField ? onPressInputField : void 0 : void 0,
|
|
1629
|
+
children: /* @__PURE__ */ jsxs4(
|
|
1508
1630
|
Animate_default.View,
|
|
1509
1631
|
{
|
|
1632
|
+
position: "relative",
|
|
1510
1633
|
flex: 1,
|
|
1634
|
+
justifyContent: "center",
|
|
1511
1635
|
backgroundColor: theme2.colors.backgroundContent,
|
|
1512
1636
|
borderTopLeftRadius: prefix ? 0 : theme2.styles.borderRadius,
|
|
1513
1637
|
borderBottomLeftRadius: prefix ? 0 : theme2.styles.borderRadius,
|
|
@@ -1517,44 +1641,72 @@ var InputFieldComponent = forwardRef(
|
|
|
1517
1641
|
initialBorderColor: theme2.colors.border,
|
|
1518
1642
|
animateBorderColor: isFocused ? theme2.colors.primary : isError ? theme2.colors.error : theme2.colors.border,
|
|
1519
1643
|
overflow: "hidden",
|
|
1520
|
-
children:
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1644
|
+
children: [
|
|
1645
|
+
leftIcon && /* @__PURE__ */ jsx10(
|
|
1646
|
+
Icon_default,
|
|
1647
|
+
{
|
|
1648
|
+
position: "absolute",
|
|
1649
|
+
left: iconSideSpace - iconPadding,
|
|
1650
|
+
name: leftIcon,
|
|
1651
|
+
nameIOS: leftIconIOS,
|
|
1652
|
+
size: iconSize,
|
|
1653
|
+
pointerEvents: !onPressLeftIcon ? "box-none" : void 0,
|
|
1654
|
+
padding: iconPadding,
|
|
1655
|
+
onPress: onPressLeftIcon
|
|
1656
|
+
}
|
|
1657
|
+
),
|
|
1658
|
+
/* @__PURE__ */ jsx10(
|
|
1659
|
+
TextInput2,
|
|
1660
|
+
{
|
|
1661
|
+
style: textInputStyle,
|
|
1662
|
+
value: internalValue,
|
|
1663
|
+
defaultValue,
|
|
1664
|
+
autoCapitalize,
|
|
1665
|
+
autoComplete,
|
|
1666
|
+
autoCorrect,
|
|
1667
|
+
autoFocus,
|
|
1668
|
+
placeholder: placeholder ?? label,
|
|
1669
|
+
placeholderTextColor: theme2.colors.textSecondary + "80",
|
|
1670
|
+
enterKeyHint: returnKeyLabel,
|
|
1671
|
+
returnKeyType,
|
|
1672
|
+
onSubmitEditing: onPressEnter,
|
|
1673
|
+
readOnly: !editable || disabled || type === "date" || type === "time",
|
|
1674
|
+
textAlign,
|
|
1675
|
+
editable: !disabled,
|
|
1676
|
+
keyboardAppearance,
|
|
1677
|
+
keyboardType,
|
|
1678
|
+
cursorColor: theme2.colors.primary,
|
|
1679
|
+
selectionColor: theme2.colors.primary,
|
|
1680
|
+
secureTextEntry,
|
|
1681
|
+
onFocus: onFocusElement,
|
|
1682
|
+
onBlur: onBlurElement,
|
|
1683
|
+
onChangeText,
|
|
1684
|
+
maxLength,
|
|
1685
|
+
multiline,
|
|
1686
|
+
numberOfLines,
|
|
1687
|
+
onPress: withPressInputField ? onPressInputField : void 0,
|
|
1688
|
+
ref: textInputRef
|
|
1689
|
+
}
|
|
1690
|
+
),
|
|
1691
|
+
rightIcon && /* @__PURE__ */ jsx10(
|
|
1692
|
+
Icon_default,
|
|
1693
|
+
{
|
|
1694
|
+
position: "absolute",
|
|
1695
|
+
right: iconSideSpace - iconPadding,
|
|
1696
|
+
name: rightIcon,
|
|
1697
|
+
nameIOS: rightIconIOS,
|
|
1698
|
+
size: iconSize,
|
|
1699
|
+
pointerEvents: !onPressRightIcon ? "box-none" : void 0,
|
|
1700
|
+
padding: iconPadding,
|
|
1701
|
+
onPress: onPressRightIcon
|
|
1702
|
+
}
|
|
1703
|
+
)
|
|
1704
|
+
]
|
|
1553
1705
|
}
|
|
1554
1706
|
)
|
|
1555
1707
|
}
|
|
1556
1708
|
),
|
|
1557
|
-
suffix && /* @__PURE__ */
|
|
1709
|
+
suffix && /* @__PURE__ */ jsx10(
|
|
1558
1710
|
View_default,
|
|
1559
1711
|
{
|
|
1560
1712
|
isRow: true,
|
|
@@ -1568,19 +1720,19 @@ var InputFieldComponent = forwardRef(
|
|
|
1568
1720
|
borderColor: theme2.colors.border,
|
|
1569
1721
|
paddingHorizontal: readyPaddingHorizontal,
|
|
1570
1722
|
onPress: onPressSuffix,
|
|
1571
|
-
children: typeof suffix === "string" ? /* @__PURE__ */
|
|
1723
|
+
children: typeof suffix === "string" ? /* @__PURE__ */ jsx10(
|
|
1572
1724
|
Text_default,
|
|
1573
1725
|
{
|
|
1574
1726
|
fontWeight: 700,
|
|
1575
1727
|
lineHeight,
|
|
1576
|
-
marginTop:
|
|
1728
|
+
marginTop: Platform5.OS === "ios" && onPressSuffix ? readyPaddingVertical : void 0,
|
|
1577
1729
|
children: suffix
|
|
1578
1730
|
}
|
|
1579
1731
|
) : suffix
|
|
1580
1732
|
}
|
|
1581
1733
|
)
|
|
1582
1734
|
] }),
|
|
1583
|
-
infoMessage && /* @__PURE__ */
|
|
1735
|
+
infoMessage && /* @__PURE__ */ jsx10(
|
|
1584
1736
|
Animate_default.Text,
|
|
1585
1737
|
{
|
|
1586
1738
|
fontSize: 14,
|
|
@@ -1592,7 +1744,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1592
1744
|
children: infoMessage
|
|
1593
1745
|
}
|
|
1594
1746
|
),
|
|
1595
|
-
errorMessage && /* @__PURE__ */
|
|
1747
|
+
errorMessage && /* @__PURE__ */ jsx10(
|
|
1596
1748
|
Animate_default.Text,
|
|
1597
1749
|
{
|
|
1598
1750
|
fontSize: 14,
|
|
@@ -1610,7 +1762,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1610
1762
|
}
|
|
1611
1763
|
);
|
|
1612
1764
|
InputFieldComponent.email = forwardRef(function Email(props, ref) {
|
|
1613
|
-
return /* @__PURE__ */
|
|
1765
|
+
return /* @__PURE__ */ jsx10(
|
|
1614
1766
|
InputFieldComponent,
|
|
1615
1767
|
{
|
|
1616
1768
|
placeholder: "your@email.here",
|
|
@@ -1624,22 +1776,40 @@ InputFieldComponent.email = forwardRef(function Email(props, ref) {
|
|
|
1624
1776
|
);
|
|
1625
1777
|
});
|
|
1626
1778
|
InputFieldComponent.password = forwardRef(function Password(props, ref) {
|
|
1627
|
-
|
|
1779
|
+
const inputFieldRef = useRef2(null);
|
|
1780
|
+
const [showPassword, setShowPassword] = useBooleanState4();
|
|
1781
|
+
const onPressEye = useCallback3(() => {
|
|
1782
|
+
setShowPassword.toggle();
|
|
1783
|
+
inputFieldRef.current?.focus();
|
|
1784
|
+
}, []);
|
|
1785
|
+
useImperativeHandle(
|
|
1786
|
+
ref,
|
|
1787
|
+
() => {
|
|
1788
|
+
return inputFieldRef.current;
|
|
1789
|
+
},
|
|
1790
|
+
[]
|
|
1791
|
+
);
|
|
1792
|
+
return /* @__PURE__ */ jsx10(
|
|
1628
1793
|
InputFieldComponent,
|
|
1629
1794
|
{
|
|
1630
|
-
secureTextEntry:
|
|
1795
|
+
secureTextEntry: !showPassword,
|
|
1631
1796
|
placeholder: "******",
|
|
1632
1797
|
autoCapitalize: "none",
|
|
1633
1798
|
autoComplete: "password",
|
|
1634
1799
|
autoCorrect: false,
|
|
1800
|
+
rightIcon: showPassword ? "eyeDashed" : "eye",
|
|
1801
|
+
onPressRightIcon: onPressEye,
|
|
1635
1802
|
...props,
|
|
1636
|
-
ref
|
|
1803
|
+
ref: inputFieldRef
|
|
1637
1804
|
}
|
|
1638
1805
|
);
|
|
1639
1806
|
});
|
|
1807
|
+
InputFieldComponent.search = forwardRef(function Search(props, ref) {
|
|
1808
|
+
return /* @__PURE__ */ jsx10(InputFieldComponent, { placeholder: "Search...", leftIcon: "magnifyingGlass", ...props, ref });
|
|
1809
|
+
});
|
|
1640
1810
|
InputFieldComponent.code = forwardRef(function Password2({ isSmall, ...props }, ref) {
|
|
1641
|
-
const theme2 =
|
|
1642
|
-
return /* @__PURE__ */
|
|
1811
|
+
const theme2 = useTheme9();
|
|
1812
|
+
return /* @__PURE__ */ jsx10(
|
|
1643
1813
|
InputFieldComponent,
|
|
1644
1814
|
{
|
|
1645
1815
|
flex: 1,
|
|
@@ -1654,29 +1824,30 @@ InputFieldComponent.code = forwardRef(function Password2({ isSmall, ...props },
|
|
|
1654
1824
|
}
|
|
1655
1825
|
);
|
|
1656
1826
|
});
|
|
1657
|
-
var InputField =
|
|
1827
|
+
var InputField = memo10(InputFieldComponent);
|
|
1658
1828
|
InputField.email = InputFieldComponent.email;
|
|
1659
1829
|
InputField.password = InputFieldComponent.password;
|
|
1830
|
+
InputField.search = InputFieldComponent.search;
|
|
1660
1831
|
InputField.code = InputFieldComponent.code;
|
|
1661
1832
|
var InputField_default = InputField;
|
|
1662
1833
|
|
|
1663
1834
|
// src/components/StatusBar.tsx
|
|
1664
|
-
import { memo as
|
|
1665
|
-
import { useTheme as
|
|
1666
|
-
import { StatusBar as NativeStatusBar, Platform as
|
|
1667
|
-
import { jsx as
|
|
1835
|
+
import { memo as memo11 } from "react";
|
|
1836
|
+
import { useTheme as useTheme10 } from "react-better-core";
|
|
1837
|
+
import { StatusBar as NativeStatusBar, Platform as Platform6 } from "react-native";
|
|
1838
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1668
1839
|
function StatusBar({ darkStatusBar, hidden, barStyle, androidBarStyle, iOSBarStyle }) {
|
|
1669
|
-
const theme2 =
|
|
1670
|
-
return /* @__PURE__ */
|
|
1840
|
+
const theme2 = useTheme10();
|
|
1841
|
+
return /* @__PURE__ */ jsx11(
|
|
1671
1842
|
NativeStatusBar,
|
|
1672
1843
|
{
|
|
1673
1844
|
backgroundColor: darkStatusBar ? theme2.colors.backgroundSecondary : void 0,
|
|
1674
|
-
barStyle: barStyle ?? (
|
|
1845
|
+
barStyle: barStyle ?? (Platform6.OS === "android" ? androidBarStyle : iOSBarStyle),
|
|
1675
1846
|
hidden
|
|
1676
1847
|
}
|
|
1677
1848
|
);
|
|
1678
1849
|
}
|
|
1679
|
-
var StatusBar_default =
|
|
1850
|
+
var StatusBar_default = memo11(StatusBar);
|
|
1680
1851
|
|
|
1681
1852
|
// src/plugins/asyncStorage.ts
|
|
1682
1853
|
var defaultAsyncStoragePluginOptions = {};
|
|
@@ -1694,6 +1865,7 @@ export {
|
|
|
1694
1865
|
Animate_default as Animate,
|
|
1695
1866
|
BetterComponentsProvider_default as BetterComponentsProvider,
|
|
1696
1867
|
Button_default as Button,
|
|
1868
|
+
Icon_default as Icon,
|
|
1697
1869
|
Image_default as Image,
|
|
1698
1870
|
InputField_default as InputField,
|
|
1699
1871
|
Loader_default as Loader,
|
|
@@ -1723,10 +1895,11 @@ export {
|
|
|
1723
1895
|
useBooleanState5 as useBooleanState,
|
|
1724
1896
|
useDebounceState,
|
|
1725
1897
|
useDevice,
|
|
1898
|
+
useEventEmitter,
|
|
1726
1899
|
useForm,
|
|
1727
1900
|
useKeyboard,
|
|
1728
1901
|
useLoader2 as useLoader,
|
|
1729
1902
|
useLoaderControls,
|
|
1730
|
-
|
|
1903
|
+
useTheme11 as useTheme
|
|
1731
1904
|
};
|
|
1732
1905
|
//# sourceMappingURL=index.mjs.map
|