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.js
CHANGED
|
@@ -36,41 +36,44 @@ __export(index_exports, {
|
|
|
36
36
|
Icon: () => Icon_default,
|
|
37
37
|
Image: () => Image_default,
|
|
38
38
|
InputField: () => InputField_default,
|
|
39
|
+
ListItem: () => ListItem_default,
|
|
39
40
|
Loader: () => Loader_default,
|
|
40
41
|
ScreenHolder: () => ScreenHolder_default,
|
|
41
42
|
StatusBar: () => StatusBar_default,
|
|
43
|
+
Switch: () => Switch_default,
|
|
42
44
|
Text: () => Text_default,
|
|
43
45
|
View: () => View_default,
|
|
44
46
|
asyncStoragePlugin: () => asyncStoragePlugin,
|
|
45
|
-
colorThemeControls: () =>
|
|
46
|
-
countries: () =>
|
|
47
|
-
darkenColor: () =>
|
|
47
|
+
colorThemeControls: () => import_react_better_core14.colorThemeControls,
|
|
48
|
+
countries: () => import_react_better_core14.countries,
|
|
49
|
+
darkenColor: () => import_react_better_core14.darkenColor,
|
|
48
50
|
defaultAsyncStoragePluginOptions: () => defaultAsyncStoragePluginOptions,
|
|
49
|
-
desaturateColor: () =>
|
|
50
|
-
eventPreventDefault: () =>
|
|
51
|
-
eventPreventStop: () =>
|
|
52
|
-
eventStopPropagation: () =>
|
|
53
|
-
formatPhoneNumber: () =>
|
|
51
|
+
desaturateColor: () => import_react_better_core14.desaturateColor,
|
|
52
|
+
eventPreventDefault: () => import_react_better_core14.eventPreventDefault,
|
|
53
|
+
eventPreventStop: () => import_react_better_core14.eventPreventStop,
|
|
54
|
+
eventStopPropagation: () => import_react_better_core14.eventStopPropagation,
|
|
55
|
+
formatPhoneNumber: () => import_react_better_core14.formatPhoneNumber,
|
|
54
56
|
generateAsyncStorage: () => generateAsyncStorage,
|
|
55
|
-
generateRandomString: () =>
|
|
57
|
+
generateRandomString: () => import_react_better_core14.generateRandomString,
|
|
56
58
|
getFormErrorObject: () => getFormErrorObject,
|
|
57
|
-
getPluralWord: () =>
|
|
58
|
-
lightenColor: () =>
|
|
59
|
-
loaderControls: () =>
|
|
59
|
+
getPluralWord: () => import_react_better_core14.getPluralWord,
|
|
60
|
+
lightenColor: () => import_react_better_core14.lightenColor,
|
|
61
|
+
loaderControls: () => import_react_better_core14.loaderControls,
|
|
60
62
|
pressStrength: () => pressStrength,
|
|
61
|
-
saturateColor: () =>
|
|
63
|
+
saturateColor: () => import_react_better_core14.saturateColor,
|
|
62
64
|
useBetterComponentsContext: () => useBetterComponentsContext,
|
|
63
|
-
useBooleanState: () =>
|
|
64
|
-
useDebounceState: () =>
|
|
65
|
+
useBooleanState: () => import_react_better_core14.useBooleanState,
|
|
66
|
+
useDebounceState: () => import_react_better_core14.useDebounceState,
|
|
65
67
|
useDevice: () => useDevice,
|
|
68
|
+
useEventEmitter: () => useEventEmitter,
|
|
66
69
|
useForm: () => useForm,
|
|
67
70
|
useKeyboard: () => useKeyboard,
|
|
68
|
-
useLoader: () =>
|
|
69
|
-
useLoaderControls: () =>
|
|
70
|
-
useTheme: () =>
|
|
71
|
+
useLoader: () => import_react_better_core14.useLoader,
|
|
72
|
+
useLoaderControls: () => import_react_better_core14.useLoaderControls,
|
|
73
|
+
useTheme: () => import_react_better_core14.useTheme
|
|
71
74
|
});
|
|
72
75
|
module.exports = __toCommonJS(index_exports);
|
|
73
|
-
var
|
|
76
|
+
var import_react_better_core14 = require("react-better-core");
|
|
74
77
|
|
|
75
78
|
// src/components/BetterComponentsProvider.tsx
|
|
76
79
|
var import_react = require("react");
|
|
@@ -84,6 +87,26 @@ var theme = {};
|
|
|
84
87
|
|
|
85
88
|
// src/constants/icons.ts
|
|
86
89
|
var icons = {
|
|
90
|
+
eye: {
|
|
91
|
+
width: 576,
|
|
92
|
+
height: 512,
|
|
93
|
+
paths: [
|
|
94
|
+
{
|
|
95
|
+
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",
|
|
96
|
+
type: "fill"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
eyeDashed: {
|
|
101
|
+
width: 640,
|
|
102
|
+
height: 512,
|
|
103
|
+
paths: [
|
|
104
|
+
{
|
|
105
|
+
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",
|
|
106
|
+
type: "fill"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
87
110
|
magnifyingGlass: {
|
|
88
111
|
width: 512,
|
|
89
112
|
height: 512,
|
|
@@ -563,6 +586,22 @@ function useForm(options) {
|
|
|
563
586
|
},
|
|
564
587
|
[values, setFieldValue, errors, requiredFields, additional, onSubmitFunction]
|
|
565
588
|
);
|
|
589
|
+
const getSwitchProps = (0, import_react2.useCallback)(
|
|
590
|
+
(field, insideListItem) => {
|
|
591
|
+
return insideListItem ? {
|
|
592
|
+
switchIsEnabled: values[field],
|
|
593
|
+
switchOnChange: (value) => {
|
|
594
|
+
setFieldValue(field, value);
|
|
595
|
+
}
|
|
596
|
+
} : {
|
|
597
|
+
isEnabled: values[field],
|
|
598
|
+
onChange: (value) => {
|
|
599
|
+
setFieldValue(field, value);
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
},
|
|
603
|
+
[values, setFieldValue]
|
|
604
|
+
);
|
|
566
605
|
const reset = (0, import_react2.useCallback)(() => {
|
|
567
606
|
setValues(defaultValues);
|
|
568
607
|
setErrors({});
|
|
@@ -586,6 +625,7 @@ function useForm(options) {
|
|
|
586
625
|
setFieldValue,
|
|
587
626
|
setFieldsValue,
|
|
588
627
|
getInputFieldProps,
|
|
628
|
+
getSwitchProps,
|
|
589
629
|
focusField,
|
|
590
630
|
inputFieldRefs: inputFieldRefs.current,
|
|
591
631
|
validate: validateForm,
|
|
@@ -597,6 +637,17 @@ function useForm(options) {
|
|
|
597
637
|
canSubmit
|
|
598
638
|
};
|
|
599
639
|
}
|
|
640
|
+
function useEventEmitter() {
|
|
641
|
+
return {
|
|
642
|
+
emit: (eventName, params) => {
|
|
643
|
+
import_react_native.DeviceEventEmitter.emit(eventName, params);
|
|
644
|
+
},
|
|
645
|
+
listen: (eventName, callback = () => {
|
|
646
|
+
}) => {
|
|
647
|
+
return import_react_native.DeviceEventEmitter.addListener(eventName, callback);
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
}
|
|
600
651
|
|
|
601
652
|
// src/utils/functions.ts
|
|
602
653
|
var getFormErrorObject = (formValues) => {
|
|
@@ -1281,7 +1332,13 @@ var ImageComponent = function Image({ name, source, withDevFittingMode, ...props
|
|
|
1281
1332
|
}, [assets2, name]);
|
|
1282
1333
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Image, { source: name ? assets2[name.toString()] : source, style, ...props });
|
|
1283
1334
|
};
|
|
1284
|
-
ImageComponent.profileImage = function ProfileImage({
|
|
1335
|
+
ImageComponent.profileImage = function ProfileImage({
|
|
1336
|
+
size = 50,
|
|
1337
|
+
letters,
|
|
1338
|
+
color,
|
|
1339
|
+
backgroundColor,
|
|
1340
|
+
...props
|
|
1341
|
+
}) {
|
|
1285
1342
|
const theme2 = (0, import_react_better_core8.useTheme)();
|
|
1286
1343
|
return letters ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1287
1344
|
View_default,
|
|
@@ -1295,7 +1352,7 @@ ImageComponent.profileImage = function ProfileImage({ size = 50, letters, backgr
|
|
|
1295
1352
|
alignItems: "center",
|
|
1296
1353
|
justifyContent: "center",
|
|
1297
1354
|
...props,
|
|
1298
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text_default, { fontSize: size / 2.5, fontWeight: 700, marginTop: 1, children: letters.toUpperCase().slice(0, 2) })
|
|
1355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text_default, { fontSize: size / 2.5, fontWeight: 700, color: color ?? theme2.colors.textPrimary, marginTop: 1, children: letters.toUpperCase().slice(0, 2) })
|
|
1299
1356
|
}
|
|
1300
1357
|
) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1301
1358
|
ImageComponent,
|
|
@@ -1332,26 +1389,38 @@ function Icon({ name, nameIOS, size = 16, color, ...props }) {
|
|
|
1332
1389
|
`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.`
|
|
1333
1390
|
);
|
|
1334
1391
|
}, [icons2, name]);
|
|
1335
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1336
|
-
|
|
1392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1393
|
+
View_default,
|
|
1337
1394
|
{
|
|
1338
|
-
width: size,
|
|
1339
|
-
height: size,
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1395
|
+
width: size + (parseFloat(props.padding?.toString() ?? "0") ?? 0) + (parseFloat(props.paddingHorizontal?.toString() ?? "0") ?? 0),
|
|
1396
|
+
height: size + (parseFloat(props.padding?.toString() ?? "0") ?? 0) + (parseFloat(props.paddingVertical?.toString() ?? "0") ?? 0),
|
|
1397
|
+
alignItems: "center",
|
|
1398
|
+
justifyContent: "center",
|
|
1399
|
+
pressType: "opacity",
|
|
1400
|
+
pressStrength: pressStrength().p2,
|
|
1401
|
+
...props,
|
|
1402
|
+
children: import_react_native8.Platform.OS === "ios" && nameIOS ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_expo_symbols.SymbolView, { name: nameIOS, tintColor: svgColor, size }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1403
|
+
import_react_native_svg.Svg,
|
|
1344
1404
|
{
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1405
|
+
width: size,
|
|
1406
|
+
height: size,
|
|
1407
|
+
viewBox: `0 0 ${icons2[name.toString()]?.width ?? 0} ${icons2[name.toString()]?.height ?? 0}`,
|
|
1408
|
+
fill: "none",
|
|
1409
|
+
children: icons2[name.toString()]?.paths.map(({ type, ...path }) => /* @__PURE__ */ (0, import_react11.createElement)(
|
|
1410
|
+
import_react_native_svg.Path,
|
|
1411
|
+
{
|
|
1412
|
+
...path,
|
|
1413
|
+
fill: type === "fill" ? svgColor : void 0,
|
|
1414
|
+
stroke: type === "stroke" ? svgColor : void 0,
|
|
1415
|
+
key: path.d
|
|
1416
|
+
}
|
|
1417
|
+
))
|
|
1349
1418
|
}
|
|
1350
|
-
)
|
|
1419
|
+
)
|
|
1351
1420
|
}
|
|
1352
|
-
)
|
|
1421
|
+
);
|
|
1353
1422
|
}
|
|
1354
|
-
var Icon_default = Icon;
|
|
1423
|
+
var Icon_default = (0, import_react10.memo)(Icon);
|
|
1355
1424
|
|
|
1356
1425
|
// src/components/InputField.tsx
|
|
1357
1426
|
var import_react12 = require("react");
|
|
@@ -1378,7 +1447,7 @@ var InputFieldComponent = (0, import_react12.forwardRef)(
|
|
|
1378
1447
|
autoCapitalize,
|
|
1379
1448
|
autoComplete,
|
|
1380
1449
|
autoCorrect,
|
|
1381
|
-
keyboardAppearance
|
|
1450
|
+
keyboardAppearance,
|
|
1382
1451
|
keyboardType,
|
|
1383
1452
|
secureTextEntry,
|
|
1384
1453
|
returnKeyLabel,
|
|
@@ -1395,8 +1464,10 @@ var InputFieldComponent = (0, import_react12.forwardRef)(
|
|
|
1395
1464
|
numberOfLines = 2,
|
|
1396
1465
|
leftIcon,
|
|
1397
1466
|
leftIconIOS,
|
|
1467
|
+
onPressLeftIcon,
|
|
1398
1468
|
rightIcon,
|
|
1399
1469
|
rightIconIOS,
|
|
1470
|
+
onPressRightIcon,
|
|
1400
1471
|
paddingHorizontal,
|
|
1401
1472
|
paddingVertical,
|
|
1402
1473
|
onFocus,
|
|
@@ -1416,6 +1487,7 @@ var InputFieldComponent = (0, import_react12.forwardRef)(
|
|
|
1416
1487
|
const [isFocused, setIsFocused] = (0, import_react_better_core10.useBooleanState)();
|
|
1417
1488
|
const isIOSDateTime = import_react_native9.Platform.OS === "ios" && (type === "date" || type === "time");
|
|
1418
1489
|
const iconSize = 16;
|
|
1490
|
+
const iconPadding = onPressRightIcon ? theme2.styles.gap : 0;
|
|
1419
1491
|
const iconSideSpace = theme2.styles.space;
|
|
1420
1492
|
const borderWidth = 1;
|
|
1421
1493
|
const readyPaddingHorizontal = paddingHorizontal ?? theme2.styles.space;
|
|
@@ -1579,6 +1651,7 @@ var InputFieldComponent = (0, import_react12.forwardRef)(
|
|
|
1579
1651
|
mode: type,
|
|
1580
1652
|
display: iOSDateTimeFullSize ? type === "date" ? "inline" : "spinner" : "default",
|
|
1581
1653
|
accentColor: theme2.colors.primary,
|
|
1654
|
+
themeVariant: colorTheme === "dark" ? "dark" : "light",
|
|
1582
1655
|
style: rnDateTimePickerStyle,
|
|
1583
1656
|
onChange: onChangeRNDateTimePicker
|
|
1584
1657
|
}
|
|
@@ -1614,11 +1687,13 @@ var InputFieldComponent = (0, import_react12.forwardRef)(
|
|
|
1614
1687
|
Icon_default,
|
|
1615
1688
|
{
|
|
1616
1689
|
position: "absolute",
|
|
1617
|
-
left: iconSideSpace,
|
|
1690
|
+
left: iconSideSpace - iconPadding,
|
|
1618
1691
|
name: leftIcon,
|
|
1619
1692
|
nameIOS: leftIconIOS,
|
|
1620
1693
|
size: iconSize,
|
|
1621
|
-
pointerEvents: "box-none"
|
|
1694
|
+
pointerEvents: !onPressLeftIcon ? "box-none" : void 0,
|
|
1695
|
+
padding: iconPadding,
|
|
1696
|
+
onPress: onPressLeftIcon
|
|
1622
1697
|
}
|
|
1623
1698
|
),
|
|
1624
1699
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
@@ -1639,7 +1714,7 @@ var InputFieldComponent = (0, import_react12.forwardRef)(
|
|
|
1639
1714
|
readOnly: !editable || disabled || type === "date" || type === "time",
|
|
1640
1715
|
textAlign,
|
|
1641
1716
|
editable: !disabled,
|
|
1642
|
-
keyboardAppearance,
|
|
1717
|
+
keyboardAppearance: keyboardAppearance ?? colorTheme === "dark" ? "dark" : "light",
|
|
1643
1718
|
keyboardType,
|
|
1644
1719
|
cursorColor: theme2.colors.primary,
|
|
1645
1720
|
selectionColor: theme2.colors.primary,
|
|
@@ -1658,11 +1733,13 @@ var InputFieldComponent = (0, import_react12.forwardRef)(
|
|
|
1658
1733
|
Icon_default,
|
|
1659
1734
|
{
|
|
1660
1735
|
position: "absolute",
|
|
1661
|
-
right: iconSideSpace,
|
|
1736
|
+
right: iconSideSpace - iconPadding,
|
|
1662
1737
|
name: rightIcon,
|
|
1663
1738
|
nameIOS: rightIconIOS,
|
|
1664
1739
|
size: iconSize,
|
|
1665
|
-
pointerEvents: "box-none"
|
|
1740
|
+
pointerEvents: !onPressRightIcon ? "box-none" : void 0,
|
|
1741
|
+
padding: iconPadding,
|
|
1742
|
+
onPress: onPressRightIcon
|
|
1666
1743
|
}
|
|
1667
1744
|
)
|
|
1668
1745
|
]
|
|
@@ -1740,16 +1817,31 @@ InputFieldComponent.email = (0, import_react12.forwardRef)(function Email(props,
|
|
|
1740
1817
|
);
|
|
1741
1818
|
});
|
|
1742
1819
|
InputFieldComponent.password = (0, import_react12.forwardRef)(function Password(props, ref) {
|
|
1820
|
+
const inputFieldRef = (0, import_react12.useRef)(null);
|
|
1821
|
+
const [showPassword, setShowPassword] = (0, import_react_better_core10.useBooleanState)();
|
|
1822
|
+
const onPressEye = (0, import_react12.useCallback)(() => {
|
|
1823
|
+
setShowPassword.toggle();
|
|
1824
|
+
inputFieldRef.current?.focus();
|
|
1825
|
+
}, []);
|
|
1826
|
+
(0, import_react12.useImperativeHandle)(
|
|
1827
|
+
ref,
|
|
1828
|
+
() => {
|
|
1829
|
+
return inputFieldRef.current;
|
|
1830
|
+
},
|
|
1831
|
+
[]
|
|
1832
|
+
);
|
|
1743
1833
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1744
1834
|
InputFieldComponent,
|
|
1745
1835
|
{
|
|
1746
|
-
secureTextEntry:
|
|
1836
|
+
secureTextEntry: !showPassword,
|
|
1747
1837
|
placeholder: "******",
|
|
1748
1838
|
autoCapitalize: "none",
|
|
1749
1839
|
autoComplete: "password",
|
|
1750
1840
|
autoCorrect: false,
|
|
1841
|
+
rightIcon: showPassword ? "eyeDashed" : "eye",
|
|
1842
|
+
onPressRightIcon: onPressEye,
|
|
1751
1843
|
...props,
|
|
1752
|
-
ref
|
|
1844
|
+
ref: inputFieldRef
|
|
1753
1845
|
}
|
|
1754
1846
|
);
|
|
1755
1847
|
});
|
|
@@ -1780,23 +1872,148 @@ InputField.search = InputFieldComponent.search;
|
|
|
1780
1872
|
InputField.code = InputFieldComponent.code;
|
|
1781
1873
|
var InputField_default = InputField;
|
|
1782
1874
|
|
|
1783
|
-
// src/components/
|
|
1875
|
+
// src/components/Switch.tsx
|
|
1784
1876
|
var import_react13 = require("react");
|
|
1785
|
-
var import_react_better_core11 = require("react-better-core");
|
|
1786
1877
|
var import_react_native10 = require("react-native");
|
|
1878
|
+
var import_react_better_core11 = require("react-better-core");
|
|
1787
1879
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1788
|
-
function
|
|
1880
|
+
function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
1789
1881
|
const theme2 = (0, import_react_better_core11.useTheme)();
|
|
1790
|
-
|
|
1791
|
-
|
|
1882
|
+
const [enabled, setEnabled] = (0, import_react_better_core11.useBooleanState)(isEnabled ?? defaultIsEnabled);
|
|
1883
|
+
const onPressElement = (0, import_react13.useCallback)(() => {
|
|
1884
|
+
onChange?.(!enabled);
|
|
1885
|
+
setEnabled.toggle();
|
|
1886
|
+
}, [onChange, enabled]);
|
|
1887
|
+
const trackColor = (0, import_react13.useMemo)(
|
|
1888
|
+
() => ({
|
|
1889
|
+
false: theme2.colors.border,
|
|
1890
|
+
true: theme2.colors.primary
|
|
1891
|
+
}),
|
|
1892
|
+
[theme2.colors]
|
|
1893
|
+
);
|
|
1894
|
+
(0, import_react13.useEffect)(() => {
|
|
1895
|
+
if (isEnabled === void 0) return;
|
|
1896
|
+
setEnabled.setState(isEnabled);
|
|
1897
|
+
}, [isEnabled]);
|
|
1898
|
+
const ballSize = 26;
|
|
1899
|
+
const ballGap = 3;
|
|
1900
|
+
const holderWidth = ballSize * 2.1;
|
|
1901
|
+
return import_react_native10.Platform.OS === "ios" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1902
|
+
import_react_native10.Switch,
|
|
1903
|
+
{
|
|
1904
|
+
trackColor,
|
|
1905
|
+
ios_backgroundColor: theme2.colors.border,
|
|
1906
|
+
onValueChange: onPressElement,
|
|
1907
|
+
value: enabled,
|
|
1908
|
+
disabled
|
|
1909
|
+
}
|
|
1910
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1911
|
+
View_default,
|
|
1912
|
+
{
|
|
1913
|
+
width: holderWidth,
|
|
1914
|
+
borderRadius: 999,
|
|
1915
|
+
pressStrength: pressStrength().p05,
|
|
1916
|
+
disabled,
|
|
1917
|
+
onPress: !disabled ? onPressElement : void 0,
|
|
1918
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1919
|
+
Animate_default.View,
|
|
1920
|
+
{
|
|
1921
|
+
width: "100%",
|
|
1922
|
+
height: ballGap + ballSize + ballGap,
|
|
1923
|
+
borderRadius: 999,
|
|
1924
|
+
initialOpacity: 1,
|
|
1925
|
+
animateOpacity: disabled ? 0.6 : 1,
|
|
1926
|
+
initialBackgroundColor: theme2.colors.border,
|
|
1927
|
+
animateBackgroundColor: enabled ? theme2.colors.primary : theme2.colors.border,
|
|
1928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1929
|
+
Animate_default.View,
|
|
1930
|
+
{
|
|
1931
|
+
width: ballSize,
|
|
1932
|
+
height: ballSize,
|
|
1933
|
+
top: ballGap,
|
|
1934
|
+
borderRadius: 999,
|
|
1935
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
1936
|
+
initialX: ballGap,
|
|
1937
|
+
animateX: enabled ? holderWidth - ballGap - ballSize : ballGap
|
|
1938
|
+
}
|
|
1939
|
+
)
|
|
1940
|
+
}
|
|
1941
|
+
)
|
|
1942
|
+
}
|
|
1943
|
+
);
|
|
1944
|
+
}
|
|
1945
|
+
var Switch_default = (0, import_react13.memo)(Switch);
|
|
1946
|
+
|
|
1947
|
+
// src/components/StatusBar.tsx
|
|
1948
|
+
var import_react14 = require("react");
|
|
1949
|
+
var import_react_better_core12 = require("react-better-core");
|
|
1950
|
+
var import_react_native11 = require("react-native");
|
|
1951
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1952
|
+
function StatusBar({ darkStatusBar, hidden, barStyle, androidBarStyle, iOSBarStyle }) {
|
|
1953
|
+
const theme2 = (0, import_react_better_core12.useTheme)();
|
|
1954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1955
|
+
import_react_native11.StatusBar,
|
|
1792
1956
|
{
|
|
1793
1957
|
backgroundColor: darkStatusBar ? theme2.colors.backgroundSecondary : void 0,
|
|
1794
|
-
barStyle: barStyle ?? (
|
|
1958
|
+
barStyle: barStyle ?? (import_react_native11.Platform.OS === "android" ? androidBarStyle : iOSBarStyle),
|
|
1795
1959
|
hidden
|
|
1796
1960
|
}
|
|
1797
1961
|
);
|
|
1798
1962
|
}
|
|
1799
|
-
var StatusBar_default = (0,
|
|
1963
|
+
var StatusBar_default = (0, import_react14.memo)(StatusBar);
|
|
1964
|
+
|
|
1965
|
+
// src/components/ListItem.tsx
|
|
1966
|
+
var import_react15 = require("react");
|
|
1967
|
+
var import_react_better_core13 = require("react-better-core");
|
|
1968
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1969
|
+
function ListItem({
|
|
1970
|
+
icon,
|
|
1971
|
+
iconIOS,
|
|
1972
|
+
title,
|
|
1973
|
+
description,
|
|
1974
|
+
rightElement,
|
|
1975
|
+
backgroundColor,
|
|
1976
|
+
insideScreenHolder,
|
|
1977
|
+
onPress,
|
|
1978
|
+
rightArrowValue,
|
|
1979
|
+
switchIsEnabled,
|
|
1980
|
+
switchOnChange
|
|
1981
|
+
}) {
|
|
1982
|
+
const theme2 = (0, import_react_better_core13.useTheme)();
|
|
1983
|
+
const device = useDevice();
|
|
1984
|
+
const sideSpace = theme2.styles.space;
|
|
1985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1986
|
+
View_default,
|
|
1987
|
+
{
|
|
1988
|
+
width: insideScreenHolder ? device.windowDimensions.width : "100%",
|
|
1989
|
+
backgroundColor: backgroundColor ?? theme2.colors.backgroundBase,
|
|
1990
|
+
marginHorizontal: insideScreenHolder ? -sideSpace : void 0,
|
|
1991
|
+
paddingVertical: theme2.styles.gap,
|
|
1992
|
+
paddingHorizontal: sideSpace,
|
|
1993
|
+
pressStrength: pressStrength().p05,
|
|
1994
|
+
onPress,
|
|
1995
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(View_default, { isRow: true, alignItems: "center", gap: theme2.styles.space, children: [
|
|
1996
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon_default, { name: icon, nameIOS: iconIOS, size: 22, color: theme2.colors.primary }),
|
|
1997
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(View_default, { flex: 1, flexDirection: "row", alignItems: "center", gap: theme2.styles.gap, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(View_default, { flex: 1, children: [
|
|
1998
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { fontSize: 20, fontWeight: 700, children: title }),
|
|
1999
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default.body, { children: description })
|
|
2000
|
+
] }) }),
|
|
2001
|
+
rightElement ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: rightElement === "arrow" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(View_default, { isRow: true, alignItems: "center", gap: theme2.styles.gap / 2, children: [
|
|
2002
|
+
rightArrowValue !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { fontSize: 14, fontWeight: 700, children: rightArrowValue }),
|
|
2003
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2004
|
+
Icon_default,
|
|
2005
|
+
{
|
|
2006
|
+
name: "chevronRight",
|
|
2007
|
+
nameIOS: "chevron.right",
|
|
2008
|
+
color: rightArrowValue !== void 0 ? theme2.colors.textPrimary : theme2.colors.textSecondary
|
|
2009
|
+
}
|
|
2010
|
+
)
|
|
2011
|
+
] }) : rightElement === "switch" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Switch_default, { isEnabled: switchIsEnabled, onChange: switchOnChange }) : void 0 }) : void 0
|
|
2012
|
+
] })
|
|
2013
|
+
}
|
|
2014
|
+
);
|
|
2015
|
+
}
|
|
2016
|
+
var ListItem_default = (0, import_react15.memo)(ListItem);
|
|
1800
2017
|
|
|
1801
2018
|
// src/plugins/asyncStorage.ts
|
|
1802
2019
|
var defaultAsyncStoragePluginOptions = {};
|
|
@@ -1818,9 +2035,11 @@ var asyncStoragePlugin = (options) => ({
|
|
|
1818
2035
|
Icon,
|
|
1819
2036
|
Image,
|
|
1820
2037
|
InputField,
|
|
2038
|
+
ListItem,
|
|
1821
2039
|
Loader,
|
|
1822
2040
|
ScreenHolder,
|
|
1823
2041
|
StatusBar,
|
|
2042
|
+
Switch,
|
|
1824
2043
|
Text,
|
|
1825
2044
|
View,
|
|
1826
2045
|
asyncStoragePlugin,
|
|
@@ -1845,6 +2064,7 @@ var asyncStoragePlugin = (options) => ({
|
|
|
1845
2064
|
useBooleanState,
|
|
1846
2065
|
useDebounceState,
|
|
1847
2066
|
useDevice,
|
|
2067
|
+
useEventEmitter,
|
|
1848
2068
|
useForm,
|
|
1849
2069
|
useKeyboard,
|
|
1850
2070
|
useLoader,
|