react-native-better-html 1.0.16 → 1.0.18
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 +44 -7
- package/dist/index.d.ts +44 -7
- package/dist/index.js +271 -51
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +258 -41
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import {
|
|
3
|
-
useTheme as
|
|
3
|
+
useTheme as useTheme13,
|
|
4
4
|
useLoader as useLoader2,
|
|
5
5
|
useLoaderControls,
|
|
6
6
|
countries,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
eventStopPropagation,
|
|
15
15
|
eventPreventStop,
|
|
16
16
|
getPluralWord,
|
|
17
|
-
useBooleanState as
|
|
17
|
+
useBooleanState as useBooleanState6,
|
|
18
18
|
useDebounceState,
|
|
19
19
|
loaderControls,
|
|
20
20
|
colorThemeControls
|
|
@@ -36,6 +36,26 @@ var theme = {};
|
|
|
36
36
|
|
|
37
37
|
// src/constants/icons.ts
|
|
38
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
|
+
},
|
|
39
59
|
magnifyingGlass: {
|
|
40
60
|
width: 512,
|
|
41
61
|
height: 512,
|
|
@@ -157,7 +177,7 @@ var pressStrength = () => {
|
|
|
157
177
|
|
|
158
178
|
// src/utils/hooks.ts
|
|
159
179
|
import { useCallback, useEffect as useEffect2, useMemo as useMemo2, useRef, useState } from "react";
|
|
160
|
-
import { Dimensions, Keyboard } from "react-native";
|
|
180
|
+
import { DeviceEventEmitter, Dimensions, Keyboard } from "react-native";
|
|
161
181
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
162
182
|
import { useBooleanState as useBooleanState2, useTheme } from "react-better-core";
|
|
163
183
|
|
|
@@ -515,6 +535,22 @@ function useForm(options) {
|
|
|
515
535
|
},
|
|
516
536
|
[values, setFieldValue, errors, requiredFields, additional, onSubmitFunction]
|
|
517
537
|
);
|
|
538
|
+
const getSwitchProps = useCallback(
|
|
539
|
+
(field, insideListItem) => {
|
|
540
|
+
return insideListItem ? {
|
|
541
|
+
switchIsEnabled: values[field],
|
|
542
|
+
switchOnChange: (value) => {
|
|
543
|
+
setFieldValue(field, value);
|
|
544
|
+
}
|
|
545
|
+
} : {
|
|
546
|
+
isEnabled: values[field],
|
|
547
|
+
onChange: (value) => {
|
|
548
|
+
setFieldValue(field, value);
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
},
|
|
552
|
+
[values, setFieldValue]
|
|
553
|
+
);
|
|
518
554
|
const reset = useCallback(() => {
|
|
519
555
|
setValues(defaultValues);
|
|
520
556
|
setErrors({});
|
|
@@ -538,6 +574,7 @@ function useForm(options) {
|
|
|
538
574
|
setFieldValue,
|
|
539
575
|
setFieldsValue,
|
|
540
576
|
getInputFieldProps,
|
|
577
|
+
getSwitchProps,
|
|
541
578
|
focusField,
|
|
542
579
|
inputFieldRefs: inputFieldRefs.current,
|
|
543
580
|
validate: validateForm,
|
|
@@ -549,6 +586,17 @@ function useForm(options) {
|
|
|
549
586
|
canSubmit
|
|
550
587
|
};
|
|
551
588
|
}
|
|
589
|
+
function useEventEmitter() {
|
|
590
|
+
return {
|
|
591
|
+
emit: (eventName, params) => {
|
|
592
|
+
DeviceEventEmitter.emit(eventName, params);
|
|
593
|
+
},
|
|
594
|
+
listen: (eventName, callback = () => {
|
|
595
|
+
}) => {
|
|
596
|
+
return DeviceEventEmitter.addListener(eventName, callback);
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
}
|
|
552
600
|
|
|
553
601
|
// src/utils/functions.ts
|
|
554
602
|
var getFormErrorObject = (formValues) => {
|
|
@@ -1241,7 +1289,13 @@ var ImageComponent = function Image({ name, source, withDevFittingMode, ...props
|
|
|
1241
1289
|
}, [assets2, name]);
|
|
1242
1290
|
return /* @__PURE__ */ jsx8(NativeImage, { source: name ? assets2[name.toString()] : source, style, ...props });
|
|
1243
1291
|
};
|
|
1244
|
-
ImageComponent.profileImage = function ProfileImage({
|
|
1292
|
+
ImageComponent.profileImage = function ProfileImage({
|
|
1293
|
+
size = 50,
|
|
1294
|
+
letters,
|
|
1295
|
+
color,
|
|
1296
|
+
backgroundColor,
|
|
1297
|
+
...props
|
|
1298
|
+
}) {
|
|
1245
1299
|
const theme2 = useTheme7();
|
|
1246
1300
|
return letters ? /* @__PURE__ */ jsx8(
|
|
1247
1301
|
View_default,
|
|
@@ -1255,7 +1309,7 @@ ImageComponent.profileImage = function ProfileImage({ size = 50, letters, backgr
|
|
|
1255
1309
|
alignItems: "center",
|
|
1256
1310
|
justifyContent: "center",
|
|
1257
1311
|
...props,
|
|
1258
|
-
children: /* @__PURE__ */ jsx8(Text_default, { fontSize: size / 2.5, fontWeight: 700, marginTop: 1, children: letters.toUpperCase().slice(0, 2) })
|
|
1312
|
+
children: /* @__PURE__ */ jsx8(Text_default, { fontSize: size / 2.5, fontWeight: 700, color: color ?? theme2.colors.textPrimary, marginTop: 1, children: letters.toUpperCase().slice(0, 2) })
|
|
1259
1313
|
}
|
|
1260
1314
|
) : /* @__PURE__ */ jsx8(
|
|
1261
1315
|
ImageComponent,
|
|
@@ -1275,7 +1329,7 @@ Image2.profileImage = ImageComponent.profileImage;
|
|
|
1275
1329
|
var Image_default = Image2;
|
|
1276
1330
|
|
|
1277
1331
|
// src/components/Icon.tsx
|
|
1278
|
-
import { useEffect as useEffect4 } from "react";
|
|
1332
|
+
import { memo as memo9, useEffect as useEffect4 } from "react";
|
|
1279
1333
|
import { Platform as Platform4 } from "react-native";
|
|
1280
1334
|
import { Path, Svg } from "react-native-svg";
|
|
1281
1335
|
import { useBetterCoreContext as useBetterCoreContext3, useTheme as useTheme8 } from "react-better-core";
|
|
@@ -1292,31 +1346,43 @@ function Icon({ name, nameIOS, size = 16, color, ...props }) {
|
|
|
1292
1346
|
`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.`
|
|
1293
1347
|
);
|
|
1294
1348
|
}, [icons2, name]);
|
|
1295
|
-
return /* @__PURE__ */ jsx9(
|
|
1296
|
-
|
|
1349
|
+
return /* @__PURE__ */ jsx9(
|
|
1350
|
+
View_default,
|
|
1297
1351
|
{
|
|
1298
|
-
width: size,
|
|
1299
|
-
height: size,
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1352
|
+
width: size + (parseFloat(props.padding?.toString() ?? "0") ?? 0) + (parseFloat(props.paddingHorizontal?.toString() ?? "0") ?? 0),
|
|
1353
|
+
height: size + (parseFloat(props.padding?.toString() ?? "0") ?? 0) + (parseFloat(props.paddingVertical?.toString() ?? "0") ?? 0),
|
|
1354
|
+
alignItems: "center",
|
|
1355
|
+
justifyContent: "center",
|
|
1356
|
+
pressType: "opacity",
|
|
1357
|
+
pressStrength: pressStrength().p2,
|
|
1358
|
+
...props,
|
|
1359
|
+
children: Platform4.OS === "ios" && nameIOS ? /* @__PURE__ */ jsx9(SymbolView, { name: nameIOS, tintColor: svgColor, size }) : /* @__PURE__ */ jsx9(
|
|
1360
|
+
Svg,
|
|
1304
1361
|
{
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1362
|
+
width: size,
|
|
1363
|
+
height: size,
|
|
1364
|
+
viewBox: `0 0 ${icons2[name.toString()]?.width ?? 0} ${icons2[name.toString()]?.height ?? 0}`,
|
|
1365
|
+
fill: "none",
|
|
1366
|
+
children: icons2[name.toString()]?.paths.map(({ type, ...path }) => /* @__PURE__ */ createElement(
|
|
1367
|
+
Path,
|
|
1368
|
+
{
|
|
1369
|
+
...path,
|
|
1370
|
+
fill: type === "fill" ? svgColor : void 0,
|
|
1371
|
+
stroke: type === "stroke" ? svgColor : void 0,
|
|
1372
|
+
key: path.d
|
|
1373
|
+
}
|
|
1374
|
+
))
|
|
1309
1375
|
}
|
|
1310
|
-
)
|
|
1376
|
+
)
|
|
1311
1377
|
}
|
|
1312
|
-
)
|
|
1378
|
+
);
|
|
1313
1379
|
}
|
|
1314
|
-
var Icon_default = Icon;
|
|
1380
|
+
var Icon_default = memo9(Icon);
|
|
1315
1381
|
|
|
1316
1382
|
// src/components/InputField.tsx
|
|
1317
1383
|
import {
|
|
1318
1384
|
forwardRef,
|
|
1319
|
-
memo as
|
|
1385
|
+
memo as memo10,
|
|
1320
1386
|
useCallback as useCallback3,
|
|
1321
1387
|
useEffect as useEffect5,
|
|
1322
1388
|
useImperativeHandle,
|
|
@@ -1358,7 +1424,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1358
1424
|
autoCapitalize,
|
|
1359
1425
|
autoComplete,
|
|
1360
1426
|
autoCorrect,
|
|
1361
|
-
keyboardAppearance
|
|
1427
|
+
keyboardAppearance,
|
|
1362
1428
|
keyboardType,
|
|
1363
1429
|
secureTextEntry,
|
|
1364
1430
|
returnKeyLabel,
|
|
@@ -1375,8 +1441,10 @@ var InputFieldComponent = forwardRef(
|
|
|
1375
1441
|
numberOfLines = 2,
|
|
1376
1442
|
leftIcon,
|
|
1377
1443
|
leftIconIOS,
|
|
1444
|
+
onPressLeftIcon,
|
|
1378
1445
|
rightIcon,
|
|
1379
1446
|
rightIconIOS,
|
|
1447
|
+
onPressRightIcon,
|
|
1380
1448
|
paddingHorizontal,
|
|
1381
1449
|
paddingVertical,
|
|
1382
1450
|
onFocus,
|
|
@@ -1396,6 +1464,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1396
1464
|
const [isFocused, setIsFocused] = useBooleanState4();
|
|
1397
1465
|
const isIOSDateTime = Platform5.OS === "ios" && (type === "date" || type === "time");
|
|
1398
1466
|
const iconSize = 16;
|
|
1467
|
+
const iconPadding = onPressRightIcon ? theme2.styles.gap : 0;
|
|
1399
1468
|
const iconSideSpace = theme2.styles.space;
|
|
1400
1469
|
const borderWidth = 1;
|
|
1401
1470
|
const readyPaddingHorizontal = paddingHorizontal ?? theme2.styles.space;
|
|
@@ -1559,6 +1628,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1559
1628
|
mode: type,
|
|
1560
1629
|
display: iOSDateTimeFullSize ? type === "date" ? "inline" : "spinner" : "default",
|
|
1561
1630
|
accentColor: theme2.colors.primary,
|
|
1631
|
+
themeVariant: colorTheme === "dark" ? "dark" : "light",
|
|
1562
1632
|
style: rnDateTimePickerStyle,
|
|
1563
1633
|
onChange: onChangeRNDateTimePicker
|
|
1564
1634
|
}
|
|
@@ -1594,11 +1664,13 @@ var InputFieldComponent = forwardRef(
|
|
|
1594
1664
|
Icon_default,
|
|
1595
1665
|
{
|
|
1596
1666
|
position: "absolute",
|
|
1597
|
-
left: iconSideSpace,
|
|
1667
|
+
left: iconSideSpace - iconPadding,
|
|
1598
1668
|
name: leftIcon,
|
|
1599
1669
|
nameIOS: leftIconIOS,
|
|
1600
1670
|
size: iconSize,
|
|
1601
|
-
pointerEvents: "box-none"
|
|
1671
|
+
pointerEvents: !onPressLeftIcon ? "box-none" : void 0,
|
|
1672
|
+
padding: iconPadding,
|
|
1673
|
+
onPress: onPressLeftIcon
|
|
1602
1674
|
}
|
|
1603
1675
|
),
|
|
1604
1676
|
/* @__PURE__ */ jsx10(
|
|
@@ -1619,7 +1691,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1619
1691
|
readOnly: !editable || disabled || type === "date" || type === "time",
|
|
1620
1692
|
textAlign,
|
|
1621
1693
|
editable: !disabled,
|
|
1622
|
-
keyboardAppearance,
|
|
1694
|
+
keyboardAppearance: keyboardAppearance ?? colorTheme === "dark" ? "dark" : "light",
|
|
1623
1695
|
keyboardType,
|
|
1624
1696
|
cursorColor: theme2.colors.primary,
|
|
1625
1697
|
selectionColor: theme2.colors.primary,
|
|
@@ -1638,11 +1710,13 @@ var InputFieldComponent = forwardRef(
|
|
|
1638
1710
|
Icon_default,
|
|
1639
1711
|
{
|
|
1640
1712
|
position: "absolute",
|
|
1641
|
-
right: iconSideSpace,
|
|
1713
|
+
right: iconSideSpace - iconPadding,
|
|
1642
1714
|
name: rightIcon,
|
|
1643
1715
|
nameIOS: rightIconIOS,
|
|
1644
1716
|
size: iconSize,
|
|
1645
|
-
pointerEvents: "box-none"
|
|
1717
|
+
pointerEvents: !onPressRightIcon ? "box-none" : void 0,
|
|
1718
|
+
padding: iconPadding,
|
|
1719
|
+
onPress: onPressRightIcon
|
|
1646
1720
|
}
|
|
1647
1721
|
)
|
|
1648
1722
|
]
|
|
@@ -1720,16 +1794,31 @@ InputFieldComponent.email = forwardRef(function Email(props, ref) {
|
|
|
1720
1794
|
);
|
|
1721
1795
|
});
|
|
1722
1796
|
InputFieldComponent.password = forwardRef(function Password(props, ref) {
|
|
1797
|
+
const inputFieldRef = useRef2(null);
|
|
1798
|
+
const [showPassword, setShowPassword] = useBooleanState4();
|
|
1799
|
+
const onPressEye = useCallback3(() => {
|
|
1800
|
+
setShowPassword.toggle();
|
|
1801
|
+
inputFieldRef.current?.focus();
|
|
1802
|
+
}, []);
|
|
1803
|
+
useImperativeHandle(
|
|
1804
|
+
ref,
|
|
1805
|
+
() => {
|
|
1806
|
+
return inputFieldRef.current;
|
|
1807
|
+
},
|
|
1808
|
+
[]
|
|
1809
|
+
);
|
|
1723
1810
|
return /* @__PURE__ */ jsx10(
|
|
1724
1811
|
InputFieldComponent,
|
|
1725
1812
|
{
|
|
1726
|
-
secureTextEntry:
|
|
1813
|
+
secureTextEntry: !showPassword,
|
|
1727
1814
|
placeholder: "******",
|
|
1728
1815
|
autoCapitalize: "none",
|
|
1729
1816
|
autoComplete: "password",
|
|
1730
1817
|
autoCorrect: false,
|
|
1818
|
+
rightIcon: showPassword ? "eyeDashed" : "eye",
|
|
1819
|
+
onPressRightIcon: onPressEye,
|
|
1731
1820
|
...props,
|
|
1732
|
-
ref
|
|
1821
|
+
ref: inputFieldRef
|
|
1733
1822
|
}
|
|
1734
1823
|
);
|
|
1735
1824
|
});
|
|
@@ -1753,30 +1842,155 @@ InputFieldComponent.code = forwardRef(function Password2({ isSmall, ...props },
|
|
|
1753
1842
|
}
|
|
1754
1843
|
);
|
|
1755
1844
|
});
|
|
1756
|
-
var InputField =
|
|
1845
|
+
var InputField = memo10(InputFieldComponent);
|
|
1757
1846
|
InputField.email = InputFieldComponent.email;
|
|
1758
1847
|
InputField.password = InputFieldComponent.password;
|
|
1759
1848
|
InputField.search = InputFieldComponent.search;
|
|
1760
1849
|
InputField.code = InputFieldComponent.code;
|
|
1761
1850
|
var InputField_default = InputField;
|
|
1762
1851
|
|
|
1763
|
-
// src/components/
|
|
1764
|
-
import { memo as
|
|
1765
|
-
import {
|
|
1766
|
-
import {
|
|
1852
|
+
// src/components/Switch.tsx
|
|
1853
|
+
import { memo as memo11, useCallback as useCallback4, useEffect as useEffect6, useMemo as useMemo9 } from "react";
|
|
1854
|
+
import { Switch as NativeSwitch, Platform as Platform6 } from "react-native";
|
|
1855
|
+
import { useBooleanState as useBooleanState5, useTheme as useTheme10 } from "react-better-core";
|
|
1767
1856
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1768
|
-
function
|
|
1857
|
+
function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
1769
1858
|
const theme2 = useTheme10();
|
|
1770
|
-
|
|
1859
|
+
const [enabled, setEnabled] = useBooleanState5(isEnabled ?? defaultIsEnabled);
|
|
1860
|
+
const onPressElement = useCallback4(() => {
|
|
1861
|
+
onChange?.(!enabled);
|
|
1862
|
+
setEnabled.toggle();
|
|
1863
|
+
}, [onChange, enabled]);
|
|
1864
|
+
const trackColor = useMemo9(
|
|
1865
|
+
() => ({
|
|
1866
|
+
false: theme2.colors.border,
|
|
1867
|
+
true: theme2.colors.primary
|
|
1868
|
+
}),
|
|
1869
|
+
[theme2.colors]
|
|
1870
|
+
);
|
|
1871
|
+
useEffect6(() => {
|
|
1872
|
+
if (isEnabled === void 0) return;
|
|
1873
|
+
setEnabled.setState(isEnabled);
|
|
1874
|
+
}, [isEnabled]);
|
|
1875
|
+
const ballSize = 26;
|
|
1876
|
+
const ballGap = 3;
|
|
1877
|
+
const holderWidth = ballSize * 2.1;
|
|
1878
|
+
return Platform6.OS === "ios" ? /* @__PURE__ */ jsx11(
|
|
1879
|
+
NativeSwitch,
|
|
1880
|
+
{
|
|
1881
|
+
trackColor,
|
|
1882
|
+
ios_backgroundColor: theme2.colors.border,
|
|
1883
|
+
onValueChange: onPressElement,
|
|
1884
|
+
value: enabled,
|
|
1885
|
+
disabled
|
|
1886
|
+
}
|
|
1887
|
+
) : /* @__PURE__ */ jsx11(
|
|
1888
|
+
View_default,
|
|
1889
|
+
{
|
|
1890
|
+
width: holderWidth,
|
|
1891
|
+
borderRadius: 999,
|
|
1892
|
+
pressStrength: pressStrength().p05,
|
|
1893
|
+
disabled,
|
|
1894
|
+
onPress: !disabled ? onPressElement : void 0,
|
|
1895
|
+
children: /* @__PURE__ */ jsx11(
|
|
1896
|
+
Animate_default.View,
|
|
1897
|
+
{
|
|
1898
|
+
width: "100%",
|
|
1899
|
+
height: ballGap + ballSize + ballGap,
|
|
1900
|
+
borderRadius: 999,
|
|
1901
|
+
initialOpacity: 1,
|
|
1902
|
+
animateOpacity: disabled ? 0.6 : 1,
|
|
1903
|
+
initialBackgroundColor: theme2.colors.border,
|
|
1904
|
+
animateBackgroundColor: enabled ? theme2.colors.primary : theme2.colors.border,
|
|
1905
|
+
children: /* @__PURE__ */ jsx11(
|
|
1906
|
+
Animate_default.View,
|
|
1907
|
+
{
|
|
1908
|
+
width: ballSize,
|
|
1909
|
+
height: ballSize,
|
|
1910
|
+
top: ballGap,
|
|
1911
|
+
borderRadius: 999,
|
|
1912
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
1913
|
+
initialX: ballGap,
|
|
1914
|
+
animateX: enabled ? holderWidth - ballGap - ballSize : ballGap
|
|
1915
|
+
}
|
|
1916
|
+
)
|
|
1917
|
+
}
|
|
1918
|
+
)
|
|
1919
|
+
}
|
|
1920
|
+
);
|
|
1921
|
+
}
|
|
1922
|
+
var Switch_default = memo11(Switch);
|
|
1923
|
+
|
|
1924
|
+
// src/components/StatusBar.tsx
|
|
1925
|
+
import { memo as memo12 } from "react";
|
|
1926
|
+
import { useTheme as useTheme11 } from "react-better-core";
|
|
1927
|
+
import { StatusBar as NativeStatusBar, Platform as Platform7 } from "react-native";
|
|
1928
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1929
|
+
function StatusBar({ darkStatusBar, hidden, barStyle, androidBarStyle, iOSBarStyle }) {
|
|
1930
|
+
const theme2 = useTheme11();
|
|
1931
|
+
return /* @__PURE__ */ jsx12(
|
|
1771
1932
|
NativeStatusBar,
|
|
1772
1933
|
{
|
|
1773
1934
|
backgroundColor: darkStatusBar ? theme2.colors.backgroundSecondary : void 0,
|
|
1774
|
-
barStyle: barStyle ?? (
|
|
1935
|
+
barStyle: barStyle ?? (Platform7.OS === "android" ? androidBarStyle : iOSBarStyle),
|
|
1775
1936
|
hidden
|
|
1776
1937
|
}
|
|
1777
1938
|
);
|
|
1778
1939
|
}
|
|
1779
|
-
var StatusBar_default =
|
|
1940
|
+
var StatusBar_default = memo12(StatusBar);
|
|
1941
|
+
|
|
1942
|
+
// src/components/ListItem.tsx
|
|
1943
|
+
import { memo as memo13 } from "react";
|
|
1944
|
+
import { useTheme as useTheme12 } from "react-better-core";
|
|
1945
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1946
|
+
function ListItem({
|
|
1947
|
+
icon,
|
|
1948
|
+
iconIOS,
|
|
1949
|
+
title,
|
|
1950
|
+
description,
|
|
1951
|
+
rightElement,
|
|
1952
|
+
backgroundColor,
|
|
1953
|
+
insideScreenHolder,
|
|
1954
|
+
onPress,
|
|
1955
|
+
rightArrowValue,
|
|
1956
|
+
switchIsEnabled,
|
|
1957
|
+
switchOnChange
|
|
1958
|
+
}) {
|
|
1959
|
+
const theme2 = useTheme12();
|
|
1960
|
+
const device = useDevice();
|
|
1961
|
+
const sideSpace = theme2.styles.space;
|
|
1962
|
+
return /* @__PURE__ */ jsx13(
|
|
1963
|
+
View_default,
|
|
1964
|
+
{
|
|
1965
|
+
width: insideScreenHolder ? device.windowDimensions.width : "100%",
|
|
1966
|
+
backgroundColor: backgroundColor ?? theme2.colors.backgroundBase,
|
|
1967
|
+
marginHorizontal: insideScreenHolder ? -sideSpace : void 0,
|
|
1968
|
+
paddingVertical: theme2.styles.gap,
|
|
1969
|
+
paddingHorizontal: sideSpace,
|
|
1970
|
+
pressStrength: pressStrength().p05,
|
|
1971
|
+
onPress,
|
|
1972
|
+
children: /* @__PURE__ */ jsxs5(View_default, { isRow: true, alignItems: "center", gap: theme2.styles.space, children: [
|
|
1973
|
+
icon && /* @__PURE__ */ jsx13(Icon_default, { name: icon, nameIOS: iconIOS, size: 22, color: theme2.colors.primary }),
|
|
1974
|
+
/* @__PURE__ */ jsx13(View_default, { flex: 1, flexDirection: "row", alignItems: "center", gap: theme2.styles.gap, children: /* @__PURE__ */ jsxs5(View_default, { flex: 1, children: [
|
|
1975
|
+
title && /* @__PURE__ */ jsx13(Text_default, { fontSize: 20, fontWeight: 700, children: title }),
|
|
1976
|
+
description && /* @__PURE__ */ jsx13(Text_default.body, { children: description })
|
|
1977
|
+
] }) }),
|
|
1978
|
+
rightElement ? /* @__PURE__ */ jsx13(Fragment4, { children: rightElement === "arrow" ? /* @__PURE__ */ jsxs5(View_default, { isRow: true, alignItems: "center", gap: theme2.styles.gap / 2, children: [
|
|
1979
|
+
rightArrowValue !== void 0 && /* @__PURE__ */ jsx13(Text_default, { fontSize: 14, fontWeight: 700, children: rightArrowValue }),
|
|
1980
|
+
/* @__PURE__ */ jsx13(
|
|
1981
|
+
Icon_default,
|
|
1982
|
+
{
|
|
1983
|
+
name: "chevronRight",
|
|
1984
|
+
nameIOS: "chevron.right",
|
|
1985
|
+
color: rightArrowValue !== void 0 ? theme2.colors.textPrimary : theme2.colors.textSecondary
|
|
1986
|
+
}
|
|
1987
|
+
)
|
|
1988
|
+
] }) : rightElement === "switch" ? /* @__PURE__ */ jsx13(Switch_default, { isEnabled: switchIsEnabled, onChange: switchOnChange }) : void 0 }) : void 0
|
|
1989
|
+
] })
|
|
1990
|
+
}
|
|
1991
|
+
);
|
|
1992
|
+
}
|
|
1993
|
+
var ListItem_default = memo13(ListItem);
|
|
1780
1994
|
|
|
1781
1995
|
// src/plugins/asyncStorage.ts
|
|
1782
1996
|
var defaultAsyncStoragePluginOptions = {};
|
|
@@ -1797,9 +2011,11 @@ export {
|
|
|
1797
2011
|
Icon_default as Icon,
|
|
1798
2012
|
Image_default as Image,
|
|
1799
2013
|
InputField_default as InputField,
|
|
2014
|
+
ListItem_default as ListItem,
|
|
1800
2015
|
Loader_default as Loader,
|
|
1801
2016
|
ScreenHolder_default as ScreenHolder,
|
|
1802
2017
|
StatusBar_default as StatusBar,
|
|
2018
|
+
Switch_default as Switch,
|
|
1803
2019
|
Text_default as Text,
|
|
1804
2020
|
View_default as View,
|
|
1805
2021
|
asyncStoragePlugin,
|
|
@@ -1821,13 +2037,14 @@ export {
|
|
|
1821
2037
|
pressStrength,
|
|
1822
2038
|
saturateColor,
|
|
1823
2039
|
useBetterComponentsContext,
|
|
1824
|
-
|
|
2040
|
+
useBooleanState6 as useBooleanState,
|
|
1825
2041
|
useDebounceState,
|
|
1826
2042
|
useDevice,
|
|
2043
|
+
useEventEmitter,
|
|
1827
2044
|
useForm,
|
|
1828
2045
|
useKeyboard,
|
|
1829
2046
|
useLoader2 as useLoader,
|
|
1830
2047
|
useLoaderControls,
|
|
1831
|
-
|
|
2048
|
+
useTheme13 as useTheme
|
|
1832
2049
|
};
|
|
1833
2050
|
//# sourceMappingURL=index.mjs.map
|