react-native-better-html 1.0.25 → 1.0.26
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 +17 -6
- package/dist/index.d.ts +17 -6
- package/dist/index.js +173 -136
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +121 -85
- 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 useTheme17,
|
|
4
4
|
useLoader as useLoader2,
|
|
5
5
|
useLoaderControls,
|
|
6
6
|
countries,
|
|
@@ -1602,11 +1602,24 @@ function generateAsyncStorage() {
|
|
|
1602
1602
|
};
|
|
1603
1603
|
}
|
|
1604
1604
|
|
|
1605
|
+
// src/components/Label.tsx
|
|
1606
|
+
import { memo as memo11 } from "react";
|
|
1607
|
+
import { useTheme as useTheme10 } from "react-better-core";
|
|
1608
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1609
|
+
function Label({ text, required, isError }) {
|
|
1610
|
+
const theme2 = useTheme10();
|
|
1611
|
+
return /* @__PURE__ */ jsxs5(View_default, { isRow: true, alignItems: "center", gap: 2, children: [
|
|
1612
|
+
text && /* @__PURE__ */ jsx11(Text_default, { fontSize: 14, color: isError ? theme2.colors.error : theme2.colors.textSecondary, children: text }),
|
|
1613
|
+
required && /* @__PURE__ */ jsx11(Text_default, { color: theme2.colors.error, children: "*" })
|
|
1614
|
+
] });
|
|
1615
|
+
}
|
|
1616
|
+
var Label_default = memo11(Label);
|
|
1617
|
+
|
|
1605
1618
|
// src/components/ScreenHolder.tsx
|
|
1606
|
-
import { memo as
|
|
1619
|
+
import { memo as memo12, useCallback as useCallback5, useMemo as useMemo8 } from "react";
|
|
1607
1620
|
import { KeyboardAvoidingView, Platform as Platform4, RefreshControl, ScrollView } from "react-native";
|
|
1608
|
-
import { useBooleanState as useBooleanState3, useTheme as
|
|
1609
|
-
import { jsx as
|
|
1621
|
+
import { useBooleanState as useBooleanState3, useTheme as useTheme11 } from "react-better-core";
|
|
1622
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1610
1623
|
var ScreenHolderComponent = ({
|
|
1611
1624
|
noScroll,
|
|
1612
1625
|
noSideSpace,
|
|
@@ -1624,7 +1637,7 @@ var ScreenHolderComponent = ({
|
|
|
1624
1637
|
withNoHeader,
|
|
1625
1638
|
children
|
|
1626
1639
|
}) => {
|
|
1627
|
-
const theme2 =
|
|
1640
|
+
const theme2 = useTheme11();
|
|
1628
1641
|
const device = useDevice();
|
|
1629
1642
|
const keyboard = useKeyboard();
|
|
1630
1643
|
const [isRefreshing, setIsRefreshing] = useBooleanState3();
|
|
@@ -1642,7 +1655,7 @@ var ScreenHolderComponent = ({
|
|
|
1642
1655
|
onRefreshEnd?.();
|
|
1643
1656
|
}, refreshTimeout * 1e3);
|
|
1644
1657
|
}, [onRefresh, onRefreshEnd, refreshTimeout]);
|
|
1645
|
-
const content = /* @__PURE__ */
|
|
1658
|
+
const content = /* @__PURE__ */ jsx12(
|
|
1646
1659
|
View_default,
|
|
1647
1660
|
{
|
|
1648
1661
|
flex: 1,
|
|
@@ -1653,21 +1666,21 @@ var ScreenHolderComponent = ({
|
|
|
1653
1666
|
}
|
|
1654
1667
|
);
|
|
1655
1668
|
const withRefresh = onRefresh || onRefreshEnd;
|
|
1656
|
-
return /* @__PURE__ */
|
|
1669
|
+
return /* @__PURE__ */ jsx12(View_default, { flex: 1, backgroundColor: backgroundColor ?? theme2.colors.backgroundBase, children: /* @__PURE__ */ jsxs6(
|
|
1657
1670
|
KeyboardAvoidingView,
|
|
1658
1671
|
{
|
|
1659
1672
|
style: keyboardAvoidingViewStyle,
|
|
1660
1673
|
keyboardVerticalOffset: keyboardVerticalOffset ?? (withNoHeader ? Platform4.OS === "ios" ? 0 : theme2.styles.gap : keepFooterOnKeyboardOpened ? Platform4.OS === "ios" ? device.safeArea.afterCalculations.bottom : theme2.styles.gap : void 0),
|
|
1661
1674
|
behavior: Platform4.OS === "ios" ? "padding" : "height",
|
|
1662
1675
|
children: [
|
|
1663
|
-
/* @__PURE__ */
|
|
1676
|
+
/* @__PURE__ */ jsx12(View_default, { flex: 1, children: noScroll ? content : /* @__PURE__ */ jsx12(
|
|
1664
1677
|
ScrollView,
|
|
1665
1678
|
{
|
|
1666
|
-
refreshControl: withRefresh ? /* @__PURE__ */
|
|
1679
|
+
refreshControl: withRefresh ? /* @__PURE__ */ jsx12(RefreshControl, { refreshing: isRefreshing, onRefresh: onRefreshElement }) : void 0,
|
|
1667
1680
|
children: content
|
|
1668
1681
|
}
|
|
1669
1682
|
) }),
|
|
1670
|
-
keepFooterOnKeyboardOpened || (Platform4.OS === "ios" ? !keyboard.willOpen : !keyboard.isOpened) ? footer && /* @__PURE__ */
|
|
1683
|
+
keepFooterOnKeyboardOpened || (Platform4.OS === "ios" ? !keyboard.willOpen : !keyboard.isOpened) ? footer && /* @__PURE__ */ jsx12(View_default, { children: footer }) : !withNoHeader && /* @__PURE__ */ jsx12(
|
|
1671
1684
|
View_default,
|
|
1672
1685
|
{
|
|
1673
1686
|
width: "100%",
|
|
@@ -1685,10 +1698,10 @@ ScreenHolderComponent.footer = function Footer({
|
|
|
1685
1698
|
withNoHeader,
|
|
1686
1699
|
children
|
|
1687
1700
|
}) {
|
|
1688
|
-
const theme2 =
|
|
1701
|
+
const theme2 = useTheme11();
|
|
1689
1702
|
const device = useDevice();
|
|
1690
1703
|
const keyboard = useKeyboard();
|
|
1691
|
-
return /* @__PURE__ */
|
|
1704
|
+
return /* @__PURE__ */ jsx12(
|
|
1692
1705
|
View_default,
|
|
1693
1706
|
{
|
|
1694
1707
|
backgroundColor: backgroundColor ?? theme2.colors.backgroundBase,
|
|
@@ -1699,14 +1712,14 @@ ScreenHolderComponent.footer = function Footer({
|
|
|
1699
1712
|
}
|
|
1700
1713
|
);
|
|
1701
1714
|
};
|
|
1702
|
-
var ScreenHolder =
|
|
1715
|
+
var ScreenHolder = memo12(ScreenHolderComponent);
|
|
1703
1716
|
ScreenHolder.footer = ScreenHolderComponent.footer;
|
|
1704
1717
|
var ScreenHolder_default = ScreenHolder;
|
|
1705
1718
|
|
|
1706
1719
|
// src/components/InputField.tsx
|
|
1707
1720
|
import {
|
|
1708
1721
|
forwardRef,
|
|
1709
|
-
memo as
|
|
1722
|
+
memo as memo13,
|
|
1710
1723
|
useCallback as useCallback6,
|
|
1711
1724
|
useEffect as useEffect6,
|
|
1712
1725
|
useImperativeHandle,
|
|
@@ -1726,9 +1739,9 @@ import {
|
|
|
1726
1739
|
lightenColor,
|
|
1727
1740
|
useBetterCoreContext as useBetterCoreContext4,
|
|
1728
1741
|
useBooleanState as useBooleanState4,
|
|
1729
|
-
useTheme as
|
|
1742
|
+
useTheme as useTheme12
|
|
1730
1743
|
} from "react-better-core";
|
|
1731
|
-
import { Fragment as Fragment4, jsx as
|
|
1744
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1732
1745
|
var InputFieldComponent = forwardRef(
|
|
1733
1746
|
({
|
|
1734
1747
|
flex,
|
|
@@ -1780,7 +1793,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1780
1793
|
onPressEnter,
|
|
1781
1794
|
...props
|
|
1782
1795
|
}, ref) => {
|
|
1783
|
-
const theme2 =
|
|
1796
|
+
const theme2 = useTheme12();
|
|
1784
1797
|
const { colorTheme } = useBetterCoreContext4();
|
|
1785
1798
|
const textInputRef = useRef3(null);
|
|
1786
1799
|
const [internalValue, setInternalValue] = useState3(value?.toString() || defaultValue || "");
|
|
@@ -1898,12 +1911,9 @@ var InputFieldComponent = forwardRef(
|
|
|
1898
1911
|
}, []);
|
|
1899
1912
|
const withPressInputField = !!onPress || type === "date" || type === "time";
|
|
1900
1913
|
const prefixSuffixBackgroundColor = colorTheme === "light" ? darkenColor(theme2.colors.backgroundContent, 0.03) : lightenColor(theme2.colors.backgroundContent, 0.1);
|
|
1901
|
-
const labelComponent = label
|
|
1902
|
-
/* @__PURE__ */ jsx12(Text_default, { fontSize: 14, color: isError ? theme2.colors.error : theme2.colors.textSecondary, children: label }),
|
|
1903
|
-
required && /* @__PURE__ */ jsx12(Text_default, { color: theme2.colors.error, children: "*" })
|
|
1904
|
-
] });
|
|
1914
|
+
const labelComponent = label ? /* @__PURE__ */ jsx13(Label_default, { text: label, isError, required }) : void 0;
|
|
1905
1915
|
const borderColor = isFocused ? theme2.colors.primary : isError ? theme2.colors.error : theme2.colors.border;
|
|
1906
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ jsxs7(
|
|
1907
1917
|
Animate_default.View,
|
|
1908
1918
|
{
|
|
1909
1919
|
flex,
|
|
@@ -1913,8 +1923,8 @@ var InputFieldComponent = forwardRef(
|
|
|
1913
1923
|
...props,
|
|
1914
1924
|
children: [
|
|
1915
1925
|
isIOSDateTime && !iOSDateTimeFullSize ? void 0 : labelComponent,
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
prefix && /* @__PURE__ */
|
|
1926
|
+
/* @__PURE__ */ jsxs7(View_default, { isRow: true, position: "relative", alignItems: "center", height: readyHeight, children: [
|
|
1927
|
+
prefix && /* @__PURE__ */ jsxs7(
|
|
1918
1928
|
View_default,
|
|
1919
1929
|
{
|
|
1920
1930
|
isRow: true,
|
|
@@ -1932,8 +1942,8 @@ var InputFieldComponent = forwardRef(
|
|
|
1932
1942
|
zIndex: 1,
|
|
1933
1943
|
onPress: onPressPrefix,
|
|
1934
1944
|
children: [
|
|
1935
|
-
typeof prefix === "string" ? /* @__PURE__ */
|
|
1936
|
-
/* @__PURE__ */
|
|
1945
|
+
typeof prefix === "string" ? /* @__PURE__ */ jsx13(Text_default, { fontWeight: 700, lineHeight, children: prefix }) : prefix,
|
|
1946
|
+
/* @__PURE__ */ jsx13(
|
|
1937
1947
|
Animate_default.View,
|
|
1938
1948
|
{
|
|
1939
1949
|
position: "absolute",
|
|
@@ -1948,9 +1958,9 @@ var InputFieldComponent = forwardRef(
|
|
|
1948
1958
|
]
|
|
1949
1959
|
}
|
|
1950
1960
|
),
|
|
1951
|
-
isIOSDateTime ? /* @__PURE__ */
|
|
1961
|
+
isIOSDateTime ? /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
1952
1962
|
!iOSDateTimeFullSize ? labelComponent : void 0,
|
|
1953
|
-
/* @__PURE__ */
|
|
1963
|
+
/* @__PURE__ */ jsx13(
|
|
1954
1964
|
RNDateTimePicker,
|
|
1955
1965
|
{
|
|
1956
1966
|
value: internalDateValue ?? /* @__PURE__ */ new Date(),
|
|
@@ -1962,7 +1972,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1962
1972
|
onValueChange: onValueChangeRNDateTimePicker
|
|
1963
1973
|
}
|
|
1964
1974
|
)
|
|
1965
|
-
] }) : /* @__PURE__ */
|
|
1975
|
+
] }) : /* @__PURE__ */ jsx13(
|
|
1966
1976
|
View_default,
|
|
1967
1977
|
{
|
|
1968
1978
|
flex: 1,
|
|
@@ -1973,7 +1983,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1973
1983
|
borderBottomRightRadius: suffix ? 0 : theme2.styles.borderRadius,
|
|
1974
1984
|
pressStrength: 1,
|
|
1975
1985
|
onPress: Platform5.OS === "android" ? editable === false || withPressInputField ? onPressInputField : void 0 : void 0,
|
|
1976
|
-
children: /* @__PURE__ */
|
|
1986
|
+
children: /* @__PURE__ */ jsxs7(
|
|
1977
1987
|
Animate_default.View,
|
|
1978
1988
|
{
|
|
1979
1989
|
position: "relative",
|
|
@@ -1991,7 +2001,7 @@ var InputFieldComponent = forwardRef(
|
|
|
1991
2001
|
animateBorderColor: borderColor,
|
|
1992
2002
|
overflow: "hidden",
|
|
1993
2003
|
children: [
|
|
1994
|
-
leftIcon && /* @__PURE__ */
|
|
2004
|
+
leftIcon && /* @__PURE__ */ jsx13(
|
|
1995
2005
|
Icon_default,
|
|
1996
2006
|
{
|
|
1997
2007
|
position: "absolute",
|
|
@@ -2004,7 +2014,7 @@ var InputFieldComponent = forwardRef(
|
|
|
2004
2014
|
onPress: onPressLeftIcon
|
|
2005
2015
|
}
|
|
2006
2016
|
),
|
|
2007
|
-
/* @__PURE__ */
|
|
2017
|
+
/* @__PURE__ */ jsx13(
|
|
2008
2018
|
TextInput2,
|
|
2009
2019
|
{
|
|
2010
2020
|
style: textInputStyle,
|
|
@@ -2037,7 +2047,7 @@ var InputFieldComponent = forwardRef(
|
|
|
2037
2047
|
ref: textInputRef
|
|
2038
2048
|
}
|
|
2039
2049
|
),
|
|
2040
|
-
rightIcon && /* @__PURE__ */
|
|
2050
|
+
rightIcon && /* @__PURE__ */ jsx13(
|
|
2041
2051
|
Icon_default,
|
|
2042
2052
|
{
|
|
2043
2053
|
position: "absolute",
|
|
@@ -2055,7 +2065,7 @@ var InputFieldComponent = forwardRef(
|
|
|
2055
2065
|
)
|
|
2056
2066
|
}
|
|
2057
2067
|
),
|
|
2058
|
-
suffix && /* @__PURE__ */
|
|
2068
|
+
suffix && /* @__PURE__ */ jsxs7(
|
|
2059
2069
|
View_default,
|
|
2060
2070
|
{
|
|
2061
2071
|
isRow: true,
|
|
@@ -2073,8 +2083,8 @@ var InputFieldComponent = forwardRef(
|
|
|
2073
2083
|
zIndex: 1,
|
|
2074
2084
|
onPress: onPressSuffix,
|
|
2075
2085
|
children: [
|
|
2076
|
-
typeof suffix === "string" ? /* @__PURE__ */
|
|
2077
|
-
/* @__PURE__ */
|
|
2086
|
+
typeof suffix === "string" ? /* @__PURE__ */ jsx13(Text_default, { fontWeight: 700, lineHeight, children: suffix }) : suffix,
|
|
2087
|
+
/* @__PURE__ */ jsx13(
|
|
2078
2088
|
Animate_default.View,
|
|
2079
2089
|
{
|
|
2080
2090
|
position: "absolute",
|
|
@@ -2090,7 +2100,7 @@ var InputFieldComponent = forwardRef(
|
|
|
2090
2100
|
}
|
|
2091
2101
|
)
|
|
2092
2102
|
] }),
|
|
2093
|
-
infoMessage && /* @__PURE__ */
|
|
2103
|
+
infoMessage && /* @__PURE__ */ jsx13(
|
|
2094
2104
|
Animate_default.Text,
|
|
2095
2105
|
{
|
|
2096
2106
|
fontSize: 14,
|
|
@@ -2102,7 +2112,7 @@ var InputFieldComponent = forwardRef(
|
|
|
2102
2112
|
children: infoMessage
|
|
2103
2113
|
}
|
|
2104
2114
|
),
|
|
2105
|
-
errorMessage && /* @__PURE__ */
|
|
2115
|
+
errorMessage && /* @__PURE__ */ jsx13(
|
|
2106
2116
|
Animate_default.Text,
|
|
2107
2117
|
{
|
|
2108
2118
|
fontSize: 14,
|
|
@@ -2120,7 +2130,7 @@ var InputFieldComponent = forwardRef(
|
|
|
2120
2130
|
}
|
|
2121
2131
|
);
|
|
2122
2132
|
InputFieldComponent.email = forwardRef(function Email(props, ref) {
|
|
2123
|
-
return /* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ jsx13(
|
|
2124
2134
|
InputFieldComponent,
|
|
2125
2135
|
{
|
|
2126
2136
|
placeholder: "your@email.here",
|
|
@@ -2143,7 +2153,7 @@ InputFieldComponent.password = forwardRef(function Password(props, ref) {
|
|
|
2143
2153
|
useImperativeHandle(ref, () => {
|
|
2144
2154
|
return inputFieldRef.current;
|
|
2145
2155
|
}, []);
|
|
2146
|
-
return /* @__PURE__ */
|
|
2156
|
+
return /* @__PURE__ */ jsx13(
|
|
2147
2157
|
InputFieldComponent,
|
|
2148
2158
|
{
|
|
2149
2159
|
secureTextEntry: !showPassword,
|
|
@@ -2159,11 +2169,11 @@ InputFieldComponent.password = forwardRef(function Password(props, ref) {
|
|
|
2159
2169
|
);
|
|
2160
2170
|
});
|
|
2161
2171
|
InputFieldComponent.search = forwardRef(function Search(props, ref) {
|
|
2162
|
-
return /* @__PURE__ */
|
|
2172
|
+
return /* @__PURE__ */ jsx13(InputFieldComponent, { placeholder: "Search...", leftIcon: "magnifyingGlass", ...props, ref });
|
|
2163
2173
|
});
|
|
2164
2174
|
InputFieldComponent.code = forwardRef(function Password2({ isSmall, ...props }, ref) {
|
|
2165
|
-
const theme2 =
|
|
2166
|
-
return /* @__PURE__ */
|
|
2175
|
+
const theme2 = useTheme12();
|
|
2176
|
+
return /* @__PURE__ */ jsx13(
|
|
2167
2177
|
InputFieldComponent,
|
|
2168
2178
|
{
|
|
2169
2179
|
flex: 1,
|
|
@@ -2178,7 +2188,7 @@ InputFieldComponent.code = forwardRef(function Password2({ isSmall, ...props },
|
|
|
2178
2188
|
}
|
|
2179
2189
|
);
|
|
2180
2190
|
});
|
|
2181
|
-
var InputField =
|
|
2191
|
+
var InputField = memo13(InputFieldComponent);
|
|
2182
2192
|
InputField.email = InputFieldComponent.email;
|
|
2183
2193
|
InputField.password = InputFieldComponent.password;
|
|
2184
2194
|
InputField.search = InputFieldComponent.search;
|
|
@@ -2186,12 +2196,12 @@ InputField.code = InputFieldComponent.code;
|
|
|
2186
2196
|
var InputField_default = InputField;
|
|
2187
2197
|
|
|
2188
2198
|
// src/components/Switch.tsx
|
|
2189
|
-
import { memo as
|
|
2199
|
+
import { memo as memo14, useCallback as useCallback7, useEffect as useEffect7, useMemo as useMemo10 } from "react";
|
|
2190
2200
|
import { Switch as NativeSwitch, Platform as Platform6 } from "react-native";
|
|
2191
|
-
import { useBooleanState as useBooleanState5, useTheme as
|
|
2192
|
-
import { jsx as
|
|
2201
|
+
import { useBooleanState as useBooleanState5, useTheme as useTheme13 } from "react-better-core";
|
|
2202
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2193
2203
|
function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
2194
|
-
const theme2 =
|
|
2204
|
+
const theme2 = useTheme13();
|
|
2195
2205
|
const [enabled, setEnabled] = useBooleanState5(isEnabled ?? defaultIsEnabled);
|
|
2196
2206
|
const onPressElement = useCallback7(() => {
|
|
2197
2207
|
onChange?.(!enabled);
|
|
@@ -2211,7 +2221,7 @@ function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
|
2211
2221
|
const ballSize = 26;
|
|
2212
2222
|
const ballGap = 3;
|
|
2213
2223
|
const holderWidth = ballSize * 2.1;
|
|
2214
|
-
return Platform6.OS === "ios" ? /* @__PURE__ */
|
|
2224
|
+
return Platform6.OS === "ios" ? /* @__PURE__ */ jsx14(
|
|
2215
2225
|
NativeSwitch,
|
|
2216
2226
|
{
|
|
2217
2227
|
trackColor,
|
|
@@ -2220,7 +2230,7 @@ function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
|
2220
2230
|
value: enabled,
|
|
2221
2231
|
disabled
|
|
2222
2232
|
}
|
|
2223
|
-
) : /* @__PURE__ */
|
|
2233
|
+
) : /* @__PURE__ */ jsx14(
|
|
2224
2234
|
View_default,
|
|
2225
2235
|
{
|
|
2226
2236
|
width: holderWidth,
|
|
@@ -2228,7 +2238,7 @@ function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
|
2228
2238
|
pressStrength: pressStrength().p05,
|
|
2229
2239
|
disabled,
|
|
2230
2240
|
onPress: !disabled ? onPressElement : void 0,
|
|
2231
|
-
children: /* @__PURE__ */
|
|
2241
|
+
children: /* @__PURE__ */ jsx14(
|
|
2232
2242
|
Animate_default.View,
|
|
2233
2243
|
{
|
|
2234
2244
|
width: "100%",
|
|
@@ -2238,7 +2248,7 @@ function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
|
2238
2248
|
animateBackgroundColor: enabled ? theme2.colors.primary : theme2.colors.border,
|
|
2239
2249
|
initialOpacity: 1,
|
|
2240
2250
|
animateOpacity: disabled ? 0.6 : 1,
|
|
2241
|
-
children: /* @__PURE__ */
|
|
2251
|
+
children: /* @__PURE__ */ jsx14(
|
|
2242
2252
|
Animate_default.View,
|
|
2243
2253
|
{
|
|
2244
2254
|
width: ballSize,
|
|
@@ -2258,15 +2268,23 @@ function Switch({ isEnabled, defaultIsEnabled, disabled, onChange }) {
|
|
|
2258
2268
|
}
|
|
2259
2269
|
);
|
|
2260
2270
|
}
|
|
2261
|
-
var Switch_default =
|
|
2271
|
+
var Switch_default = memo14(Switch);
|
|
2262
2272
|
|
|
2263
2273
|
// src/components/CheckBox.tsx
|
|
2264
|
-
import { memo as
|
|
2274
|
+
import { memo as memo15, useCallback as useCallback8, useEffect as useEffect8 } from "react";
|
|
2265
2275
|
import { Platform as Platform7 } from "react-native";
|
|
2266
|
-
import { useBooleanState as useBooleanState6, useTheme as
|
|
2267
|
-
import { jsx as
|
|
2268
|
-
function CheckBox({
|
|
2269
|
-
|
|
2276
|
+
import { useBooleanState as useBooleanState6, useTheme as useTheme14 } from "react-better-core";
|
|
2277
|
+
import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2278
|
+
function CheckBox({
|
|
2279
|
+
isChecked,
|
|
2280
|
+
defaultIsChecked,
|
|
2281
|
+
size = 36,
|
|
2282
|
+
text,
|
|
2283
|
+
required,
|
|
2284
|
+
disabled,
|
|
2285
|
+
onChange
|
|
2286
|
+
}) {
|
|
2287
|
+
const theme2 = useTheme14();
|
|
2270
2288
|
const [checked, setChecked] = useBooleanState6(isChecked ?? defaultIsChecked);
|
|
2271
2289
|
const onPressElement = useCallback8(() => {
|
|
2272
2290
|
onChange?.(!checked);
|
|
@@ -2276,7 +2294,7 @@ function CheckBox({ isChecked, defaultIsChecked, size = 36, disabled, onChange }
|
|
|
2276
2294
|
if (isChecked === void 0) return;
|
|
2277
2295
|
setChecked.setState(isChecked);
|
|
2278
2296
|
}, [isChecked]);
|
|
2279
|
-
|
|
2297
|
+
const checkBox = /* @__PURE__ */ jsx15(
|
|
2280
2298
|
View_default,
|
|
2281
2299
|
{
|
|
2282
2300
|
width: size,
|
|
@@ -2284,7 +2302,7 @@ function CheckBox({ isChecked, defaultIsChecked, size = 36, disabled, onChange }
|
|
|
2284
2302
|
pressStrength: pressStrength().p05,
|
|
2285
2303
|
disabled,
|
|
2286
2304
|
onPress: !disabled ? onPressElement : void 0,
|
|
2287
|
-
children: /* @__PURE__ */
|
|
2305
|
+
children: /* @__PURE__ */ jsx15(
|
|
2288
2306
|
Animate_default.View,
|
|
2289
2307
|
{
|
|
2290
2308
|
width: "100%",
|
|
@@ -2297,7 +2315,7 @@ function CheckBox({ isChecked, defaultIsChecked, size = 36, disabled, onChange }
|
|
|
2297
2315
|
animateBorderColor: checked ? theme2.colors.primary : theme2.colors.border,
|
|
2298
2316
|
initialOpacity: 1,
|
|
2299
2317
|
animateOpacity: disabled ? 0.6 : 1,
|
|
2300
|
-
children: /* @__PURE__ */
|
|
2318
|
+
children: /* @__PURE__ */ jsx15(
|
|
2301
2319
|
Animate_default.View,
|
|
2302
2320
|
{
|
|
2303
2321
|
width: "100%",
|
|
@@ -2309,7 +2327,7 @@ function CheckBox({ isChecked, defaultIsChecked, size = 36, disabled, onChange }
|
|
|
2309
2327
|
transitionStiffness: 230,
|
|
2310
2328
|
initialScale: 0,
|
|
2311
2329
|
animateScale: checked ? 1 : 0,
|
|
2312
|
-
children: /* @__PURE__ */
|
|
2330
|
+
children: /* @__PURE__ */ jsx15(
|
|
2313
2331
|
Icon_default,
|
|
2314
2332
|
{
|
|
2315
2333
|
name: "check",
|
|
@@ -2324,17 +2342,34 @@ function CheckBox({ isChecked, defaultIsChecked, size = 36, disabled, onChange }
|
|
|
2324
2342
|
)
|
|
2325
2343
|
}
|
|
2326
2344
|
);
|
|
2345
|
+
return text ? /* @__PURE__ */ jsx15(Fragment5, { children: /* @__PURE__ */ jsxs8(View_default, { isRow: true, alignItems: "center", gap: theme2.styles.gap, children: [
|
|
2346
|
+
checkBox,
|
|
2347
|
+
/* @__PURE__ */ jsx15(
|
|
2348
|
+
View_default,
|
|
2349
|
+
{
|
|
2350
|
+
width: "100%",
|
|
2351
|
+
flexShrink: 1,
|
|
2352
|
+
pressType: "opacity",
|
|
2353
|
+
pressStrength: pressStrength().p3,
|
|
2354
|
+
onPress: onPressElement,
|
|
2355
|
+
children: /* @__PURE__ */ jsxs8(View_default, { isRow: true, alignItems: "flex-start", gap: 2, children: [
|
|
2356
|
+
/* @__PURE__ */ jsx15(View_default, { flexShrink: 1, children: typeof text === "string" ? /* @__PURE__ */ jsx15(Text_default, { children: text }) : text }),
|
|
2357
|
+
required && /* @__PURE__ */ jsx15(Label_default, { required: true })
|
|
2358
|
+
] })
|
|
2359
|
+
}
|
|
2360
|
+
)
|
|
2361
|
+
] }) }) : checkBox;
|
|
2327
2362
|
}
|
|
2328
|
-
var CheckBox_default =
|
|
2363
|
+
var CheckBox_default = memo15(CheckBox);
|
|
2329
2364
|
|
|
2330
2365
|
// src/components/StatusBar.tsx
|
|
2331
|
-
import { memo as
|
|
2332
|
-
import { useTheme as
|
|
2366
|
+
import { memo as memo16 } from "react";
|
|
2367
|
+
import { useTheme as useTheme15 } from "react-better-core";
|
|
2333
2368
|
import { StatusBar as NativeStatusBar, Platform as Platform8 } from "react-native";
|
|
2334
|
-
import { jsx as
|
|
2369
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2335
2370
|
function StatusBar({ darkStatusBar, hidden, barStyle, androidBarStyle, iOSBarStyle }) {
|
|
2336
|
-
const theme2 =
|
|
2337
|
-
return /* @__PURE__ */
|
|
2371
|
+
const theme2 = useTheme15();
|
|
2372
|
+
return /* @__PURE__ */ jsx16(
|
|
2338
2373
|
NativeStatusBar,
|
|
2339
2374
|
{
|
|
2340
2375
|
backgroundColor: darkStatusBar ? theme2.colors.backgroundSecondary : void 0,
|
|
@@ -2343,12 +2378,12 @@ function StatusBar({ darkStatusBar, hidden, barStyle, androidBarStyle, iOSBarSty
|
|
|
2343
2378
|
}
|
|
2344
2379
|
);
|
|
2345
2380
|
}
|
|
2346
|
-
var StatusBar_default =
|
|
2381
|
+
var StatusBar_default = memo16(StatusBar);
|
|
2347
2382
|
|
|
2348
2383
|
// src/components/ListItem.tsx
|
|
2349
|
-
import { memo as
|
|
2350
|
-
import { useTheme as
|
|
2351
|
-
import { Fragment as
|
|
2384
|
+
import { memo as memo17 } from "react";
|
|
2385
|
+
import { useTheme as useTheme16 } from "react-better-core";
|
|
2386
|
+
import { Fragment as Fragment6, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2352
2387
|
function ListItem({
|
|
2353
2388
|
icon,
|
|
2354
2389
|
iconIOS,
|
|
@@ -2366,10 +2401,10 @@ function ListItem({
|
|
|
2366
2401
|
checkBoxIsChecked,
|
|
2367
2402
|
checkBoxOnChange
|
|
2368
2403
|
}) {
|
|
2369
|
-
const theme2 =
|
|
2404
|
+
const theme2 = useTheme16();
|
|
2370
2405
|
const device = useDevice();
|
|
2371
2406
|
const sideSpace = theme2.styles.space;
|
|
2372
|
-
return /* @__PURE__ */
|
|
2407
|
+
return /* @__PURE__ */ jsx17(
|
|
2373
2408
|
View_default,
|
|
2374
2409
|
{
|
|
2375
2410
|
width: insideScreenHolder ? device.windowDimensions.width : "100%",
|
|
@@ -2379,15 +2414,15 @@ function ListItem({
|
|
|
2379
2414
|
paddingHorizontal: sideSpace,
|
|
2380
2415
|
pressStrength: pressStrength().p05,
|
|
2381
2416
|
onPress,
|
|
2382
|
-
children: /* @__PURE__ */
|
|
2383
|
-
icon && /* @__PURE__ */
|
|
2384
|
-
/* @__PURE__ */
|
|
2385
|
-
title && /* @__PURE__ */
|
|
2386
|
-
description && /* @__PURE__ */
|
|
2417
|
+
children: /* @__PURE__ */ jsxs9(View_default, { isRow: true, alignItems: "center", gap: theme2.styles.space, children: [
|
|
2418
|
+
icon && /* @__PURE__ */ jsx17(Icon_default, { name: icon, nameIOS: iconIOS, size: 22, color: theme2.colors.primary }),
|
|
2419
|
+
/* @__PURE__ */ jsx17(View_default, { flex: 1, flexDirection: "row", alignItems: "center", gap: theme2.styles.gap, children: /* @__PURE__ */ jsxs9(View_default, { flex: 1, children: [
|
|
2420
|
+
title && /* @__PURE__ */ jsx17(Text_default, { fontSize: 20, fontWeight: 700, children: title }),
|
|
2421
|
+
description && /* @__PURE__ */ jsx17(Text_default.body, { selectable: descriptionSelectable, children: description })
|
|
2387
2422
|
] }) }),
|
|
2388
|
-
rightElement ? /* @__PURE__ */
|
|
2389
|
-
rightValue !== void 0 && /* @__PURE__ */
|
|
2390
|
-
rightElement === "arrow" && /* @__PURE__ */
|
|
2423
|
+
rightElement ? /* @__PURE__ */ jsx17(Fragment6, { children: rightValue !== void 0 || rightElement === "arrow" ? /* @__PURE__ */ jsxs9(View_default, { isRow: true, alignItems: "center", gap: theme2.styles.gap / 2, children: [
|
|
2424
|
+
rightValue !== void 0 && /* @__PURE__ */ jsx17(Text_default, { fontSize: 14, fontWeight: 700, selectable: rightValueSelectable, children: rightValue }),
|
|
2425
|
+
rightElement === "arrow" && /* @__PURE__ */ jsx17(
|
|
2391
2426
|
Icon_default,
|
|
2392
2427
|
{
|
|
2393
2428
|
name: "chevronRight",
|
|
@@ -2395,12 +2430,12 @@ function ListItem({
|
|
|
2395
2430
|
color: rightValue !== void 0 ? theme2.colors.textPrimary : theme2.colors.textSecondary
|
|
2396
2431
|
}
|
|
2397
2432
|
)
|
|
2398
|
-
] }) : rightElement === "switch" ? /* @__PURE__ */
|
|
2433
|
+
] }) : rightElement === "switch" ? /* @__PURE__ */ jsx17(Switch_default, { isEnabled: switchIsEnabled, onChange: switchOnChange }) : rightElement === "checkBox" ? /* @__PURE__ */ jsx17(CheckBox_default, { isChecked: checkBoxIsChecked, onChange: checkBoxOnChange }) : void 0 }) : void 0
|
|
2399
2434
|
] })
|
|
2400
2435
|
}
|
|
2401
2436
|
);
|
|
2402
2437
|
}
|
|
2403
|
-
var ListItem_default =
|
|
2438
|
+
var ListItem_default = memo17(ListItem);
|
|
2404
2439
|
export {
|
|
2405
2440
|
Animate_default as Animate,
|
|
2406
2441
|
BetterComponentsProvider_default as BetterComponentsProvider,
|
|
@@ -2409,6 +2444,7 @@ export {
|
|
|
2409
2444
|
Icon_default as Icon,
|
|
2410
2445
|
Image_default as Image,
|
|
2411
2446
|
InputField_default as InputField,
|
|
2447
|
+
Label_default as Label,
|
|
2412
2448
|
ListItem_default as ListItem,
|
|
2413
2449
|
Loader_default as Loader,
|
|
2414
2450
|
ScreenHolder_default as ScreenHolder,
|
|
@@ -2447,6 +2483,6 @@ export {
|
|
|
2447
2483
|
useKeyboard,
|
|
2448
2484
|
useLoader2 as useLoader,
|
|
2449
2485
|
useLoaderControls,
|
|
2450
|
-
|
|
2486
|
+
useTheme17 as useTheme
|
|
2451
2487
|
};
|
|
2452
2488
|
//# sourceMappingURL=index.mjs.map
|