@gaozh1024/rn-kit 0.2.0 → 0.3.1
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/README.md +116 -1
- package/dist/index.d.mts +90 -2
- package/dist/index.d.ts +90 -2
- package/dist/index.js +657 -405
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +534 -285
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -3
package/dist/index.mjs
CHANGED
|
@@ -960,6 +960,29 @@ function resolveTextTone(tone, theme, isDark) {
|
|
|
960
960
|
return void 0;
|
|
961
961
|
}
|
|
962
962
|
}
|
|
963
|
+
var textUtilityTokens = /* @__PURE__ */ new Set([
|
|
964
|
+
"text-left",
|
|
965
|
+
"text-center",
|
|
966
|
+
"text-right",
|
|
967
|
+
"text-justify",
|
|
968
|
+
"text-auto",
|
|
969
|
+
"text-wrap",
|
|
970
|
+
"text-nowrap",
|
|
971
|
+
"text-balance",
|
|
972
|
+
"text-pretty",
|
|
973
|
+
"text-ellipsis",
|
|
974
|
+
"text-clip"
|
|
975
|
+
]);
|
|
976
|
+
var textSizePattern = /^text-(xs|sm|base|lg|xl|[2-9]xl)$/;
|
|
977
|
+
function hasExplicitTextColorClass(className) {
|
|
978
|
+
if (!className) return false;
|
|
979
|
+
return className.split(/\s+/).some((token) => {
|
|
980
|
+
if (!token.startsWith("text-")) return false;
|
|
981
|
+
if (textUtilityTokens.has(token)) return false;
|
|
982
|
+
if (textSizePattern.test(token)) return false;
|
|
983
|
+
return true;
|
|
984
|
+
});
|
|
985
|
+
}
|
|
963
986
|
|
|
964
987
|
// src/ui/primitives/AppView.tsx
|
|
965
988
|
import { jsx as jsx2 } from "nativewind/jsx-runtime";
|
|
@@ -1052,7 +1075,7 @@ function AppScrollView({
|
|
|
1052
1075
|
}
|
|
1053
1076
|
|
|
1054
1077
|
// src/ui/primitives/AppText.tsx
|
|
1055
|
-
import { Text } from "react-native";
|
|
1078
|
+
import { StyleSheet, Text } from "react-native";
|
|
1056
1079
|
import { jsx as jsx4 } from "nativewind/jsx-runtime";
|
|
1057
1080
|
function AppText({
|
|
1058
1081
|
size = "md",
|
|
@@ -1065,6 +1088,9 @@ function AppText({
|
|
|
1065
1088
|
...props
|
|
1066
1089
|
}) {
|
|
1067
1090
|
const { theme, isDark } = useOptionalTheme();
|
|
1091
|
+
const flattenedStyle = StyleSheet.flatten(style);
|
|
1092
|
+
const hasExplicitStyleColor = flattenedStyle?.color !== void 0;
|
|
1093
|
+
const hasExplicitClassColor = hasExplicitTextColorClass(className);
|
|
1068
1094
|
const sizeMap3 = {
|
|
1069
1095
|
xs: "text-xs",
|
|
1070
1096
|
sm: "text-sm",
|
|
@@ -1080,12 +1106,18 @@ function AppText({
|
|
|
1080
1106
|
semibold: "font-semibold",
|
|
1081
1107
|
bold: "font-bold"
|
|
1082
1108
|
};
|
|
1083
|
-
const
|
|
1109
|
+
const fallbackTone = tone ?? (color || hasExplicitStyleColor || hasExplicitClassColor ? void 0 : "default");
|
|
1110
|
+
const resolvedColor = resolveTextTone(fallbackTone, theme, isDark) ?? resolveNamedColor(color, theme, isDark);
|
|
1084
1111
|
const shouldUseClassColor = !!color && !resolvedColor;
|
|
1085
1112
|
return /* @__PURE__ */ jsx4(
|
|
1086
1113
|
Text,
|
|
1087
1114
|
{
|
|
1088
|
-
className: cn(
|
|
1115
|
+
className: cn(
|
|
1116
|
+
sizeMap3[size],
|
|
1117
|
+
weightMap[weight],
|
|
1118
|
+
shouldUseClassColor && `text-${color}`,
|
|
1119
|
+
className
|
|
1120
|
+
),
|
|
1089
1121
|
style: [resolvedColor ? { color: resolvedColor } : void 0, style],
|
|
1090
1122
|
...props,
|
|
1091
1123
|
children
|
|
@@ -1167,7 +1199,7 @@ function Center({ flex = true, ...props }) {
|
|
|
1167
1199
|
}
|
|
1168
1200
|
|
|
1169
1201
|
// src/ui/layout/SafeScreen.tsx
|
|
1170
|
-
import { View as View2, StyleSheet } from "react-native";
|
|
1202
|
+
import { View as View2, StyleSheet as StyleSheet2 } from "react-native";
|
|
1171
1203
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
1172
1204
|
import { jsx as jsx9 } from "nativewind/jsx-runtime";
|
|
1173
1205
|
function SafeScreen({
|
|
@@ -1206,7 +1238,7 @@ function SafeScreen({
|
|
|
1206
1238
|
}
|
|
1207
1239
|
);
|
|
1208
1240
|
}
|
|
1209
|
-
var styles =
|
|
1241
|
+
var styles = StyleSheet2.create({
|
|
1210
1242
|
flex: {
|
|
1211
1243
|
flex: 1
|
|
1212
1244
|
}
|
|
@@ -1284,7 +1316,7 @@ function Toast({ message, type = "info", visible = true }) {
|
|
|
1284
1316
|
|
|
1285
1317
|
// src/ui/feedback/Alert.tsx
|
|
1286
1318
|
import { useCallback as useCallback9 } from "react";
|
|
1287
|
-
import { Modal, TouchableOpacity, StyleSheet as
|
|
1319
|
+
import { Modal, TouchableOpacity, StyleSheet as StyleSheet3 } from "react-native";
|
|
1288
1320
|
import { jsx as jsx12, jsxs } from "nativewind/jsx-runtime";
|
|
1289
1321
|
function Alert({ visible, title, message, buttons, onClose }) {
|
|
1290
1322
|
const { theme, isDark } = useTheme();
|
|
@@ -1433,7 +1465,7 @@ function Alert({ visible, title, message, buttons, onClose }) {
|
|
|
1433
1465
|
}
|
|
1434
1466
|
);
|
|
1435
1467
|
}
|
|
1436
|
-
var styles2 =
|
|
1468
|
+
var styles2 = StyleSheet3.create({
|
|
1437
1469
|
singleButton: {
|
|
1438
1470
|
borderBottomLeftRadius: 12,
|
|
1439
1471
|
borderBottomRightRadius: 12
|
|
@@ -1450,13 +1482,7 @@ var styles2 = StyleSheet2.create({
|
|
|
1450
1482
|
// src/ui/feedback/Loading.tsx
|
|
1451
1483
|
import { ActivityIndicator as ActivityIndicator2 } from "react-native";
|
|
1452
1484
|
import { jsx as jsx13, jsxs as jsxs2 } from "nativewind/jsx-runtime";
|
|
1453
|
-
function Loading({
|
|
1454
|
-
text,
|
|
1455
|
-
color,
|
|
1456
|
-
overlay = false,
|
|
1457
|
-
visible = true,
|
|
1458
|
-
testID
|
|
1459
|
-
}) {
|
|
1485
|
+
function Loading({ text, color, overlay = false, visible = true, testID }) {
|
|
1460
1486
|
if (!visible) return null;
|
|
1461
1487
|
const content = /* @__PURE__ */ jsxs2(AppView, { center: true, gap: 3, testID, children: [
|
|
1462
1488
|
/* @__PURE__ */ jsx13(ActivityIndicator2, { size: "large", color }),
|
|
@@ -1543,7 +1569,8 @@ function Card({
|
|
|
1543
1569
|
}
|
|
1544
1570
|
|
|
1545
1571
|
// src/ui/display/Icon.tsx
|
|
1546
|
-
import
|
|
1572
|
+
import { Text as Text2 } from "react-native";
|
|
1573
|
+
import { MaterialIcons } from "@expo/vector-icons";
|
|
1547
1574
|
import { jsx as jsx16 } from "nativewind/jsx-runtime";
|
|
1548
1575
|
var sizeMap2 = {
|
|
1549
1576
|
xs: 16,
|
|
@@ -1552,6 +1579,12 @@ var sizeMap2 = {
|
|
|
1552
1579
|
lg: 32,
|
|
1553
1580
|
xl: 48
|
|
1554
1581
|
};
|
|
1582
|
+
function isComponentLike(value) {
|
|
1583
|
+
if (typeof value === "function") return true;
|
|
1584
|
+
if (typeof value !== "object" || value === null) return false;
|
|
1585
|
+
return "$$typeof" in value;
|
|
1586
|
+
}
|
|
1587
|
+
var MaterialIconComponent = isComponentLike(MaterialIcons) ? MaterialIcons : void 0;
|
|
1555
1588
|
function resolveSize(size = "md") {
|
|
1556
1589
|
if (typeof size === "number") return size;
|
|
1557
1590
|
return sizeMap2[size] || 24;
|
|
@@ -1560,11 +1593,29 @@ function Icon({ name, size = "md", color = "gray-600", style, onPress, testID })
|
|
|
1560
1593
|
const { theme, isDark } = useOptionalTheme();
|
|
1561
1594
|
const resolvedSize = resolveSize(size);
|
|
1562
1595
|
const resolvedColor = resolveNamedColor(color, theme, isDark) ?? color;
|
|
1596
|
+
const fallback = /* @__PURE__ */ jsx16(
|
|
1597
|
+
Text2,
|
|
1598
|
+
{
|
|
1599
|
+
style: [
|
|
1600
|
+
{
|
|
1601
|
+
color: resolvedColor,
|
|
1602
|
+
fontSize: resolvedSize,
|
|
1603
|
+
lineHeight: resolvedSize
|
|
1604
|
+
},
|
|
1605
|
+
style
|
|
1606
|
+
],
|
|
1607
|
+
testID,
|
|
1608
|
+
children: "\u25A1"
|
|
1609
|
+
}
|
|
1610
|
+
);
|
|
1611
|
+
if (!MaterialIconComponent) {
|
|
1612
|
+
return onPress ? /* @__PURE__ */ jsx16(AppPressable, { onPress, children: fallback }) : fallback;
|
|
1613
|
+
}
|
|
1563
1614
|
if (onPress) {
|
|
1564
|
-
return /* @__PURE__ */ jsx16(AppPressable, { onPress, testID, children: /* @__PURE__ */ jsx16(
|
|
1615
|
+
return /* @__PURE__ */ jsx16(AppPressable, { onPress, testID, children: /* @__PURE__ */ jsx16(MaterialIconComponent, { name, size: resolvedSize, color: resolvedColor, style }) });
|
|
1565
1616
|
}
|
|
1566
1617
|
return /* @__PURE__ */ jsx16(
|
|
1567
|
-
|
|
1618
|
+
MaterialIconComponent,
|
|
1568
1619
|
{
|
|
1569
1620
|
name,
|
|
1570
1621
|
size: resolvedSize,
|
|
@@ -1786,7 +1837,7 @@ import {
|
|
|
1786
1837
|
FlatList,
|
|
1787
1838
|
RefreshControl,
|
|
1788
1839
|
ActivityIndicator as ActivityIndicator4,
|
|
1789
|
-
StyleSheet as
|
|
1840
|
+
StyleSheet as StyleSheet4
|
|
1790
1841
|
} from "react-native";
|
|
1791
1842
|
import { Fragment, jsx as jsx18, jsxs as jsxs4 } from "nativewind/jsx-runtime";
|
|
1792
1843
|
function SkeletonItem2({ render }) {
|
|
@@ -1974,16 +2025,186 @@ function AppList({
|
|
|
1974
2025
|
}
|
|
1975
2026
|
);
|
|
1976
2027
|
}
|
|
1977
|
-
var styles3 =
|
|
2028
|
+
var styles3 = StyleSheet4.create({
|
|
1978
2029
|
retryButton: {
|
|
1979
2030
|
borderWidth: 0.5
|
|
1980
2031
|
}
|
|
1981
2032
|
});
|
|
1982
2033
|
|
|
2034
|
+
// src/ui/display/PageDrawer.tsx
|
|
2035
|
+
import React5 from "react";
|
|
2036
|
+
import { BackHandler, Modal as Modal2, PanResponder, StyleSheet as StyleSheet5 } from "react-native";
|
|
2037
|
+
import { jsx as jsx19, jsxs as jsxs5 } from "nativewind/jsx-runtime";
|
|
2038
|
+
function PageDrawer({
|
|
2039
|
+
visible,
|
|
2040
|
+
onClose,
|
|
2041
|
+
title,
|
|
2042
|
+
header,
|
|
2043
|
+
footer,
|
|
2044
|
+
placement = "right",
|
|
2045
|
+
width = 320,
|
|
2046
|
+
swipeEnabled = true,
|
|
2047
|
+
swipeThreshold = 80,
|
|
2048
|
+
closeOnBackdropPress = true,
|
|
2049
|
+
showCloseButton = true,
|
|
2050
|
+
children,
|
|
2051
|
+
testID,
|
|
2052
|
+
contentTestID = "page-drawer-content",
|
|
2053
|
+
backdropTestID = "page-drawer-backdrop"
|
|
2054
|
+
}) {
|
|
2055
|
+
const colors = useThemeColors();
|
|
2056
|
+
const [translateX, setTranslateX] = React5.useState(0);
|
|
2057
|
+
if (!visible) return null;
|
|
2058
|
+
const handleClose = React5.useCallback(() => {
|
|
2059
|
+
setTranslateX(0);
|
|
2060
|
+
onClose?.();
|
|
2061
|
+
}, [onClose]);
|
|
2062
|
+
React5.useEffect(() => {
|
|
2063
|
+
if (!visible) return;
|
|
2064
|
+
const subscription = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
2065
|
+
handleClose();
|
|
2066
|
+
return true;
|
|
2067
|
+
});
|
|
2068
|
+
return () => subscription.remove();
|
|
2069
|
+
}, [handleClose, visible]);
|
|
2070
|
+
const panResponder = React5.useMemo(
|
|
2071
|
+
() => PanResponder.create({
|
|
2072
|
+
onMoveShouldSetPanResponder: (_event, gestureState) => {
|
|
2073
|
+
if (!swipeEnabled) return false;
|
|
2074
|
+
const isHorizontal = Math.abs(gestureState.dx) > Math.abs(gestureState.dy);
|
|
2075
|
+
const reachesThreshold = Math.abs(gestureState.dx) > 8;
|
|
2076
|
+
return isHorizontal && reachesThreshold;
|
|
2077
|
+
},
|
|
2078
|
+
onPanResponderMove: (_event, gestureState) => {
|
|
2079
|
+
if (!swipeEnabled) return;
|
|
2080
|
+
const nextTranslateX = placement === "right" ? Math.min(0, Math.max(-width, gestureState.dx)) : Math.max(0, Math.min(width, gestureState.dx));
|
|
2081
|
+
setTranslateX(nextTranslateX);
|
|
2082
|
+
},
|
|
2083
|
+
onPanResponderRelease: (_event, gestureState) => {
|
|
2084
|
+
if (!swipeEnabled) {
|
|
2085
|
+
setTranslateX(0);
|
|
2086
|
+
return;
|
|
2087
|
+
}
|
|
2088
|
+
const reachedCloseThreshold = placement === "right" ? gestureState.dx <= -swipeThreshold : gestureState.dx >= swipeThreshold;
|
|
2089
|
+
if (reachedCloseThreshold) {
|
|
2090
|
+
handleClose();
|
|
2091
|
+
return;
|
|
2092
|
+
}
|
|
2093
|
+
setTranslateX(0);
|
|
2094
|
+
},
|
|
2095
|
+
onPanResponderTerminate: () => {
|
|
2096
|
+
setTranslateX(0);
|
|
2097
|
+
}
|
|
2098
|
+
}),
|
|
2099
|
+
[handleClose, placement, swipeEnabled, swipeThreshold, width]
|
|
2100
|
+
);
|
|
2101
|
+
const drawerContent = /* @__PURE__ */ jsxs5(
|
|
2102
|
+
AppView,
|
|
2103
|
+
{
|
|
2104
|
+
testID: contentTestID,
|
|
2105
|
+
className: "h-full",
|
|
2106
|
+
...panResponder.panHandlers,
|
|
2107
|
+
style: [
|
|
2108
|
+
styles4.drawer,
|
|
2109
|
+
{
|
|
2110
|
+
width,
|
|
2111
|
+
backgroundColor: colors.card,
|
|
2112
|
+
borderLeftWidth: placement === "right" ? 0.5 : 0,
|
|
2113
|
+
borderRightWidth: placement === "left" ? 0.5 : 0,
|
|
2114
|
+
borderLeftColor: colors.border,
|
|
2115
|
+
borderRightColor: colors.border,
|
|
2116
|
+
transform: [{ translateX }]
|
|
2117
|
+
}
|
|
2118
|
+
],
|
|
2119
|
+
children: [
|
|
2120
|
+
(header || title || showCloseButton) && /* @__PURE__ */ jsxs5(
|
|
2121
|
+
AppView,
|
|
2122
|
+
{
|
|
2123
|
+
row: true,
|
|
2124
|
+
items: "center",
|
|
2125
|
+
between: true,
|
|
2126
|
+
className: "px-4 py-4",
|
|
2127
|
+
style: [styles4.header, { borderBottomColor: colors.divider }],
|
|
2128
|
+
children: [
|
|
2129
|
+
/* @__PURE__ */ jsx19(AppView, { flex: true, children: header || (title ? /* @__PURE__ */ jsx19(AppText, { size: "lg", weight: "semibold", children: title }) : null) }),
|
|
2130
|
+
showCloseButton && /* @__PURE__ */ jsx19(
|
|
2131
|
+
AppPressable,
|
|
2132
|
+
{
|
|
2133
|
+
testID: "page-drawer-close",
|
|
2134
|
+
className: "p-1",
|
|
2135
|
+
pressedClassName: "opacity-70",
|
|
2136
|
+
onPress: handleClose,
|
|
2137
|
+
children: /* @__PURE__ */ jsx19(Icon, { name: "close", size: "md", color: colors.textSecondary })
|
|
2138
|
+
}
|
|
2139
|
+
)
|
|
2140
|
+
]
|
|
2141
|
+
}
|
|
2142
|
+
),
|
|
2143
|
+
/* @__PURE__ */ jsx19(AppScrollView, { flex: true, className: "px-4 py-4", children }),
|
|
2144
|
+
footer && /* @__PURE__ */ jsx19(
|
|
2145
|
+
AppView,
|
|
2146
|
+
{
|
|
2147
|
+
className: "px-4 py-4",
|
|
2148
|
+
style: [styles4.footer, { borderTopColor: colors.divider }],
|
|
2149
|
+
children: footer
|
|
2150
|
+
}
|
|
2151
|
+
)
|
|
2152
|
+
]
|
|
2153
|
+
}
|
|
2154
|
+
);
|
|
2155
|
+
return /* @__PURE__ */ jsx19(Modal2, { visible: true, transparent: true, animationType: "fade", onRequestClose: handleClose, children: /* @__PURE__ */ jsxs5(
|
|
2156
|
+
AppView,
|
|
2157
|
+
{
|
|
2158
|
+
testID,
|
|
2159
|
+
flex: true,
|
|
2160
|
+
row: true,
|
|
2161
|
+
style: { backgroundColor: "rgba(0,0,0,0.5)" },
|
|
2162
|
+
justify: placement === "right" ? "end" : "start",
|
|
2163
|
+
children: [
|
|
2164
|
+
placement === "left" && drawerContent,
|
|
2165
|
+
/* @__PURE__ */ jsx19(
|
|
2166
|
+
AppPressable,
|
|
2167
|
+
{
|
|
2168
|
+
testID: backdropTestID,
|
|
2169
|
+
className: "flex-1",
|
|
2170
|
+
onPress: closeOnBackdropPress ? handleClose : void 0
|
|
2171
|
+
}
|
|
2172
|
+
),
|
|
2173
|
+
placement === "right" && drawerContent
|
|
2174
|
+
]
|
|
2175
|
+
}
|
|
2176
|
+
) });
|
|
2177
|
+
}
|
|
2178
|
+
var styles4 = StyleSheet5.create({
|
|
2179
|
+
drawer: {
|
|
2180
|
+
height: "100%"
|
|
2181
|
+
},
|
|
2182
|
+
header: {
|
|
2183
|
+
borderBottomWidth: 0.5
|
|
2184
|
+
},
|
|
2185
|
+
footer: {
|
|
2186
|
+
borderTopWidth: 0.5
|
|
2187
|
+
}
|
|
2188
|
+
});
|
|
2189
|
+
|
|
2190
|
+
// src/ui/display/GradientView.tsx
|
|
2191
|
+
import { LinearGradient } from "expo-linear-gradient";
|
|
2192
|
+
import { jsx as jsx20 } from "nativewind/jsx-runtime";
|
|
2193
|
+
function GradientView({
|
|
2194
|
+
colors,
|
|
2195
|
+
start = { x: 0, y: 0 },
|
|
2196
|
+
end = { x: 1, y: 1 },
|
|
2197
|
+
children,
|
|
2198
|
+
style,
|
|
2199
|
+
...props
|
|
2200
|
+
}) {
|
|
2201
|
+
return /* @__PURE__ */ jsx20(LinearGradient, { colors: [...colors], start, end, style, ...props, children });
|
|
2202
|
+
}
|
|
2203
|
+
|
|
1983
2204
|
// src/ui/form/AppInput.tsx
|
|
1984
2205
|
import { forwardRef, useState as useState12 } from "react";
|
|
1985
|
-
import { TextInput, View as View5, StyleSheet as
|
|
1986
|
-
import { jsx as
|
|
2206
|
+
import { TextInput, View as View5, StyleSheet as StyleSheet6 } from "react-native";
|
|
2207
|
+
import { jsx as jsx21, jsxs as jsxs6 } from "nativewind/jsx-runtime";
|
|
1987
2208
|
var AppInput = forwardRef(
|
|
1988
2209
|
({ label, error, disabled = false, leftIcon, rightIcon, className, style, ...props }, ref) => {
|
|
1989
2210
|
const colors = useThemeColors();
|
|
@@ -1994,16 +2215,16 @@ var AppInput = forwardRef(
|
|
|
1994
2215
|
if (isFocused) return colors.primary;
|
|
1995
2216
|
return colors.border;
|
|
1996
2217
|
};
|
|
1997
|
-
return /* @__PURE__ */
|
|
1998
|
-
label && /* @__PURE__ */
|
|
1999
|
-
/* @__PURE__ */
|
|
2218
|
+
return /* @__PURE__ */ jsxs6(AppView, { className: cn("flex-col gap-1", className), children: [
|
|
2219
|
+
label && /* @__PURE__ */ jsx21(AppText, { size: "sm", weight: "medium", style: { color: colors.textSecondary }, children: label }),
|
|
2220
|
+
/* @__PURE__ */ jsxs6(
|
|
2000
2221
|
AppView,
|
|
2001
2222
|
{
|
|
2002
2223
|
row: true,
|
|
2003
2224
|
items: "center",
|
|
2004
2225
|
className: "rounded-lg px-3",
|
|
2005
2226
|
style: [
|
|
2006
|
-
|
|
2227
|
+
styles5.inputContainer,
|
|
2007
2228
|
{
|
|
2008
2229
|
backgroundColor: colors.card,
|
|
2009
2230
|
borderColor: getBorderColor(),
|
|
@@ -2011,13 +2232,13 @@ var AppInput = forwardRef(
|
|
|
2011
2232
|
}
|
|
2012
2233
|
],
|
|
2013
2234
|
children: [
|
|
2014
|
-
leftIcon && /* @__PURE__ */
|
|
2015
|
-
/* @__PURE__ */
|
|
2235
|
+
leftIcon && /* @__PURE__ */ jsx21(View5, { style: styles5.icon, children: leftIcon }),
|
|
2236
|
+
/* @__PURE__ */ jsx21(
|
|
2016
2237
|
TextInput,
|
|
2017
2238
|
{
|
|
2018
2239
|
ref,
|
|
2019
2240
|
className: "flex-1 py-3 text-base",
|
|
2020
|
-
style: [
|
|
2241
|
+
style: [styles5.input, { color: colors.text }, style],
|
|
2021
2242
|
placeholderTextColor: colors.textMuted,
|
|
2022
2243
|
editable: !disabled,
|
|
2023
2244
|
onFocus: (e) => {
|
|
@@ -2031,16 +2252,16 @@ var AppInput = forwardRef(
|
|
|
2031
2252
|
...props
|
|
2032
2253
|
}
|
|
2033
2254
|
),
|
|
2034
|
-
rightIcon && /* @__PURE__ */
|
|
2255
|
+
rightIcon && /* @__PURE__ */ jsx21(View5, { style: styles5.icon, children: rightIcon })
|
|
2035
2256
|
]
|
|
2036
2257
|
}
|
|
2037
2258
|
),
|
|
2038
|
-
error && /* @__PURE__ */
|
|
2259
|
+
error && /* @__PURE__ */ jsx21(AppText, { size: "xs", style: { color: errorColor }, children: error })
|
|
2039
2260
|
] });
|
|
2040
2261
|
}
|
|
2041
2262
|
);
|
|
2042
2263
|
AppInput.displayName = "AppInput";
|
|
2043
|
-
var
|
|
2264
|
+
var styles5 = StyleSheet6.create({
|
|
2044
2265
|
inputContainer: {
|
|
2045
2266
|
borderWidth: 0.5,
|
|
2046
2267
|
minHeight: 48
|
|
@@ -2056,8 +2277,8 @@ var styles4 = StyleSheet4.create({
|
|
|
2056
2277
|
|
|
2057
2278
|
// src/ui/form/Checkbox.tsx
|
|
2058
2279
|
import { useState as useState13 } from "react";
|
|
2059
|
-
import { TouchableOpacity as TouchableOpacity2, StyleSheet as
|
|
2060
|
-
import { jsx as
|
|
2280
|
+
import { TouchableOpacity as TouchableOpacity2, StyleSheet as StyleSheet7 } from "react-native";
|
|
2281
|
+
import { jsx as jsx22, jsxs as jsxs7 } from "nativewind/jsx-runtime";
|
|
2061
2282
|
function Checkbox({
|
|
2062
2283
|
checked,
|
|
2063
2284
|
defaultChecked,
|
|
@@ -2079,7 +2300,7 @@ function Checkbox({
|
|
|
2079
2300
|
onChange?.(newChecked);
|
|
2080
2301
|
};
|
|
2081
2302
|
const disabledOpacity = 0.4;
|
|
2082
|
-
return /* @__PURE__ */
|
|
2303
|
+
return /* @__PURE__ */ jsxs7(
|
|
2083
2304
|
TouchableOpacity2,
|
|
2084
2305
|
{
|
|
2085
2306
|
onPress: toggle,
|
|
@@ -2089,7 +2310,7 @@ function Checkbox({
|
|
|
2089
2310
|
testID,
|
|
2090
2311
|
activeOpacity: 0.7,
|
|
2091
2312
|
children: [
|
|
2092
|
-
/* @__PURE__ */
|
|
2313
|
+
/* @__PURE__ */ jsx22(
|
|
2093
2314
|
AppView,
|
|
2094
2315
|
{
|
|
2095
2316
|
className: cn(
|
|
@@ -2097,21 +2318,21 @@ function Checkbox({
|
|
|
2097
2318
|
isChecked ? "bg-primary-500" : "bg-white border"
|
|
2098
2319
|
),
|
|
2099
2320
|
style: [
|
|
2100
|
-
|
|
2321
|
+
styles6.checkbox,
|
|
2101
2322
|
{
|
|
2102
2323
|
backgroundColor: isChecked ? colors.primary : colors.cardElevated,
|
|
2103
2324
|
borderColor: isChecked ? colors.primary : colors.border
|
|
2104
2325
|
}
|
|
2105
2326
|
],
|
|
2106
|
-
children: isChecked && /* @__PURE__ */
|
|
2327
|
+
children: isChecked && /* @__PURE__ */ jsx22(AppView, { testID: `${testID}-icon`, children: /* @__PURE__ */ jsx22(Icon, { name: "check", size: "sm", color: "white" }) })
|
|
2107
2328
|
}
|
|
2108
2329
|
),
|
|
2109
|
-
children && /* @__PURE__ */
|
|
2330
|
+
children && /* @__PURE__ */ jsx22(AppText, { size: "sm", style: { color: colors.text }, children })
|
|
2110
2331
|
]
|
|
2111
2332
|
}
|
|
2112
2333
|
);
|
|
2113
2334
|
}
|
|
2114
|
-
var
|
|
2335
|
+
var styles6 = StyleSheet7.create({
|
|
2115
2336
|
checkbox: {
|
|
2116
2337
|
borderWidth: 0.5
|
|
2117
2338
|
}
|
|
@@ -2129,7 +2350,7 @@ var isGroupOptionDisabled = (groupDisabled, optionDisabled) => {
|
|
|
2129
2350
|
};
|
|
2130
2351
|
|
|
2131
2352
|
// src/ui/form/CheckboxGroup.tsx
|
|
2132
|
-
import { jsx as
|
|
2353
|
+
import { jsx as jsx23 } from "nativewind/jsx-runtime";
|
|
2133
2354
|
function CheckboxGroup({
|
|
2134
2355
|
value = [],
|
|
2135
2356
|
onChange,
|
|
@@ -2142,7 +2363,7 @@ function CheckboxGroup({
|
|
|
2142
2363
|
onChange(toggleGroupValue(value, optionValue, checked));
|
|
2143
2364
|
};
|
|
2144
2365
|
const isRow = direction === "row";
|
|
2145
|
-
return /* @__PURE__ */
|
|
2366
|
+
return /* @__PURE__ */ jsx23(AppView, { row: isRow, flex: isRow, gap: 4, children: options.map((option) => /* @__PURE__ */ jsx23(
|
|
2146
2367
|
Checkbox,
|
|
2147
2368
|
{
|
|
2148
2369
|
checked: value.includes(option.value),
|
|
@@ -2156,8 +2377,8 @@ function CheckboxGroup({
|
|
|
2156
2377
|
|
|
2157
2378
|
// src/ui/form/Radio.tsx
|
|
2158
2379
|
import { useState as useState14 } from "react";
|
|
2159
|
-
import { TouchableOpacity as TouchableOpacity3, StyleSheet as
|
|
2160
|
-
import { jsx as
|
|
2380
|
+
import { TouchableOpacity as TouchableOpacity3, StyleSheet as StyleSheet8 } from "react-native";
|
|
2381
|
+
import { jsx as jsx24, jsxs as jsxs8 } from "nativewind/jsx-runtime";
|
|
2161
2382
|
function Radio({
|
|
2162
2383
|
checked,
|
|
2163
2384
|
defaultChecked,
|
|
@@ -2179,7 +2400,7 @@ function Radio({
|
|
|
2179
2400
|
onChange?.(newChecked);
|
|
2180
2401
|
};
|
|
2181
2402
|
const disabledOpacity = 0.4;
|
|
2182
|
-
return /* @__PURE__ */
|
|
2403
|
+
return /* @__PURE__ */ jsxs8(
|
|
2183
2404
|
TouchableOpacity3,
|
|
2184
2405
|
{
|
|
2185
2406
|
onPress: toggle,
|
|
@@ -2189,33 +2410,33 @@ function Radio({
|
|
|
2189
2410
|
testID,
|
|
2190
2411
|
activeOpacity: 0.7,
|
|
2191
2412
|
children: [
|
|
2192
|
-
/* @__PURE__ */
|
|
2413
|
+
/* @__PURE__ */ jsx24(
|
|
2193
2414
|
AppView,
|
|
2194
2415
|
{
|
|
2195
2416
|
className: cn("w-5 h-5 rounded-full items-center justify-center", isChecked && "border-2"),
|
|
2196
2417
|
style: [
|
|
2197
|
-
|
|
2418
|
+
styles7.radio,
|
|
2198
2419
|
{
|
|
2199
2420
|
backgroundColor: colors.card,
|
|
2200
2421
|
borderColor: isChecked ? colors.primary : colors.border,
|
|
2201
2422
|
borderWidth: isChecked ? 0.5 : 0.5
|
|
2202
2423
|
}
|
|
2203
2424
|
],
|
|
2204
|
-
children: isChecked && /* @__PURE__ */
|
|
2425
|
+
children: isChecked && /* @__PURE__ */ jsx24(
|
|
2205
2426
|
AppView,
|
|
2206
2427
|
{
|
|
2207
2428
|
className: "rounded-full",
|
|
2208
|
-
style: [
|
|
2429
|
+
style: [styles7.inner, { backgroundColor: colors.primary }]
|
|
2209
2430
|
}
|
|
2210
2431
|
)
|
|
2211
2432
|
}
|
|
2212
2433
|
),
|
|
2213
|
-
children && /* @__PURE__ */
|
|
2434
|
+
children && /* @__PURE__ */ jsx24(AppText, { size: "sm", style: { color: colors.text }, children })
|
|
2214
2435
|
]
|
|
2215
2436
|
}
|
|
2216
2437
|
);
|
|
2217
2438
|
}
|
|
2218
|
-
var
|
|
2439
|
+
var styles7 = StyleSheet8.create({
|
|
2219
2440
|
radio: {
|
|
2220
2441
|
borderWidth: 0.5
|
|
2221
2442
|
},
|
|
@@ -2226,7 +2447,7 @@ var styles6 = StyleSheet6.create({
|
|
|
2226
2447
|
});
|
|
2227
2448
|
|
|
2228
2449
|
// src/ui/form/RadioGroup.tsx
|
|
2229
|
-
import { jsx as
|
|
2450
|
+
import { jsx as jsx25 } from "nativewind/jsx-runtime";
|
|
2230
2451
|
function RadioGroup({
|
|
2231
2452
|
value,
|
|
2232
2453
|
onChange,
|
|
@@ -2235,7 +2456,7 @@ function RadioGroup({
|
|
|
2235
2456
|
disabled = false
|
|
2236
2457
|
}) {
|
|
2237
2458
|
const isRow = direction === "row";
|
|
2238
|
-
return /* @__PURE__ */
|
|
2459
|
+
return /* @__PURE__ */ jsx25(AppView, { row: isRow, flex: isRow, gap: 4, children: options.map((option) => /* @__PURE__ */ jsx25(
|
|
2239
2460
|
Radio,
|
|
2240
2461
|
{
|
|
2241
2462
|
checked: value === option.value,
|
|
@@ -2249,8 +2470,8 @@ function RadioGroup({
|
|
|
2249
2470
|
|
|
2250
2471
|
// src/ui/form/Switch.tsx
|
|
2251
2472
|
import { useState as useState15 } from "react";
|
|
2252
|
-
import { TouchableOpacity as TouchableOpacity4, StyleSheet as
|
|
2253
|
-
import { jsx as
|
|
2473
|
+
import { TouchableOpacity as TouchableOpacity4, StyleSheet as StyleSheet9 } from "react-native";
|
|
2474
|
+
import { jsx as jsx26 } from "nativewind/jsx-runtime";
|
|
2254
2475
|
function Switch({
|
|
2255
2476
|
checked,
|
|
2256
2477
|
defaultChecked,
|
|
@@ -2282,7 +2503,7 @@ function Switch({
|
|
|
2282
2503
|
};
|
|
2283
2504
|
const config = sizes[size];
|
|
2284
2505
|
const thumbPosition = isChecked ? config.width - config.thumb - config.padding : config.padding;
|
|
2285
|
-
return /* @__PURE__ */
|
|
2506
|
+
return /* @__PURE__ */ jsx26(
|
|
2286
2507
|
TouchableOpacity4,
|
|
2287
2508
|
{
|
|
2288
2509
|
onPress: toggle,
|
|
@@ -2290,12 +2511,12 @@ function Switch({
|
|
|
2290
2511
|
className: cn(className),
|
|
2291
2512
|
testID,
|
|
2292
2513
|
activeOpacity: disabled ? 1 : 0.8,
|
|
2293
|
-
children: /* @__PURE__ */
|
|
2514
|
+
children: /* @__PURE__ */ jsx26(
|
|
2294
2515
|
AppView,
|
|
2295
2516
|
{
|
|
2296
2517
|
className: "rounded-full",
|
|
2297
2518
|
style: [
|
|
2298
|
-
|
|
2519
|
+
styles8.track,
|
|
2299
2520
|
{
|
|
2300
2521
|
width: config.width,
|
|
2301
2522
|
height: config.height,
|
|
@@ -2304,12 +2525,12 @@ function Switch({
|
|
|
2304
2525
|
},
|
|
2305
2526
|
style
|
|
2306
2527
|
],
|
|
2307
|
-
children: /* @__PURE__ */
|
|
2528
|
+
children: /* @__PURE__ */ jsx26(
|
|
2308
2529
|
AppView,
|
|
2309
2530
|
{
|
|
2310
2531
|
className: "rounded-full",
|
|
2311
2532
|
style: [
|
|
2312
|
-
|
|
2533
|
+
styles8.thumb,
|
|
2313
2534
|
{
|
|
2314
2535
|
width: config.thumb,
|
|
2315
2536
|
height: config.thumb,
|
|
@@ -2328,7 +2549,7 @@ function Switch({
|
|
|
2328
2549
|
}
|
|
2329
2550
|
);
|
|
2330
2551
|
}
|
|
2331
|
-
var
|
|
2552
|
+
var styles8 = StyleSheet9.create({
|
|
2332
2553
|
track: {
|
|
2333
2554
|
justifyContent: "center",
|
|
2334
2555
|
padding: 2
|
|
@@ -2346,8 +2567,8 @@ var styles7 = StyleSheet7.create({
|
|
|
2346
2567
|
import { useState as useState16, useCallback as useCallback12, useRef as useRef6 } from "react";
|
|
2347
2568
|
import {
|
|
2348
2569
|
View as View6,
|
|
2349
|
-
PanResponder,
|
|
2350
|
-
StyleSheet as
|
|
2570
|
+
PanResponder as PanResponder2,
|
|
2571
|
+
StyleSheet as StyleSheet10
|
|
2351
2572
|
} from "react-native";
|
|
2352
2573
|
|
|
2353
2574
|
// src/ui/form/useFormTheme.ts
|
|
@@ -2376,7 +2597,7 @@ function useFormThemeColors() {
|
|
|
2376
2597
|
}
|
|
2377
2598
|
|
|
2378
2599
|
// src/ui/form/Slider.tsx
|
|
2379
|
-
import { jsx as
|
|
2600
|
+
import { jsx as jsx27, jsxs as jsxs9 } from "nativewind/jsx-runtime";
|
|
2380
2601
|
function Slider({
|
|
2381
2602
|
value,
|
|
2382
2603
|
defaultValue = 0,
|
|
@@ -2416,7 +2637,7 @@ function Slider({
|
|
|
2416
2637
|
[value, min, max, onChange]
|
|
2417
2638
|
);
|
|
2418
2639
|
const panResponder = useRef6(
|
|
2419
|
-
|
|
2640
|
+
PanResponder2.create({
|
|
2420
2641
|
onStartShouldSetPanResponder: () => !disabled,
|
|
2421
2642
|
onMoveShouldSetPanResponder: () => !disabled,
|
|
2422
2643
|
onPanResponderGrant: () => {
|
|
@@ -2449,13 +2670,13 @@ function Slider({
|
|
|
2449
2670
|
const onLayout = useCallback12((event) => {
|
|
2450
2671
|
setTrackWidth(event.nativeEvent.layout.width);
|
|
2451
2672
|
}, []);
|
|
2452
|
-
return /* @__PURE__ */
|
|
2453
|
-
showTooltip && isDragging && /* @__PURE__ */
|
|
2673
|
+
return /* @__PURE__ */ jsxs9(AppView, { className: cn("py-2", className), children: [
|
|
2674
|
+
showTooltip && isDragging && /* @__PURE__ */ jsxs9(
|
|
2454
2675
|
AppView,
|
|
2455
2676
|
{
|
|
2456
2677
|
className: "absolute rounded px-2 py-1 -top-8",
|
|
2457
2678
|
style: [
|
|
2458
|
-
|
|
2679
|
+
styles9.tooltip,
|
|
2459
2680
|
{
|
|
2460
2681
|
backgroundColor: colors.surfaceMuted,
|
|
2461
2682
|
left: `${progress}%`,
|
|
@@ -2463,12 +2684,12 @@ function Slider({
|
|
|
2463
2684
|
}
|
|
2464
2685
|
],
|
|
2465
2686
|
children: [
|
|
2466
|
-
/* @__PURE__ */
|
|
2467
|
-
/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ jsx27(AppText, { size: "xs", style: { color: colors.text }, children: Math.round(currentValue) }),
|
|
2688
|
+
/* @__PURE__ */ jsx27(
|
|
2468
2689
|
AppView,
|
|
2469
2690
|
{
|
|
2470
2691
|
style: [
|
|
2471
|
-
|
|
2692
|
+
styles9.tooltipArrow,
|
|
2472
2693
|
{
|
|
2473
2694
|
borderTopColor: colors.surfaceMuted
|
|
2474
2695
|
}
|
|
@@ -2478,23 +2699,23 @@ function Slider({
|
|
|
2478
2699
|
]
|
|
2479
2700
|
}
|
|
2480
2701
|
),
|
|
2481
|
-
/* @__PURE__ */
|
|
2702
|
+
/* @__PURE__ */ jsxs9(
|
|
2482
2703
|
View6,
|
|
2483
2704
|
{
|
|
2484
2705
|
onLayout,
|
|
2485
2706
|
className: "rounded-full",
|
|
2486
2707
|
style: [
|
|
2487
|
-
|
|
2708
|
+
styles9.track,
|
|
2488
2709
|
{ backgroundColor: colors.divider, opacity: disabled ? disabledOpacity : 1 }
|
|
2489
2710
|
],
|
|
2490
2711
|
onTouchEnd: handleTrackPress,
|
|
2491
2712
|
children: [
|
|
2492
|
-
/* @__PURE__ */
|
|
2713
|
+
/* @__PURE__ */ jsx27(
|
|
2493
2714
|
AppView,
|
|
2494
2715
|
{
|
|
2495
2716
|
className: "rounded-full",
|
|
2496
2717
|
style: [
|
|
2497
|
-
|
|
2718
|
+
styles9.filledTrack,
|
|
2498
2719
|
{
|
|
2499
2720
|
backgroundColor: colors.primary,
|
|
2500
2721
|
width: `${progress}%`
|
|
@@ -2502,12 +2723,12 @@ function Slider({
|
|
|
2502
2723
|
]
|
|
2503
2724
|
}
|
|
2504
2725
|
),
|
|
2505
|
-
/* @__PURE__ */
|
|
2726
|
+
/* @__PURE__ */ jsx27(
|
|
2506
2727
|
AppView,
|
|
2507
2728
|
{
|
|
2508
2729
|
className: "absolute rounded-full items-center justify-center",
|
|
2509
2730
|
style: [
|
|
2510
|
-
|
|
2731
|
+
styles9.thumb,
|
|
2511
2732
|
{
|
|
2512
2733
|
backgroundColor: colors.textInverse,
|
|
2513
2734
|
left: `${progress}%`,
|
|
@@ -2519,12 +2740,12 @@ function Slider({
|
|
|
2519
2740
|
}
|
|
2520
2741
|
],
|
|
2521
2742
|
...panResponder.panHandlers,
|
|
2522
|
-
children: /* @__PURE__ */
|
|
2743
|
+
children: /* @__PURE__ */ jsx27(
|
|
2523
2744
|
AppView,
|
|
2524
2745
|
{
|
|
2525
2746
|
className: "rounded-full",
|
|
2526
2747
|
style: [
|
|
2527
|
-
|
|
2748
|
+
styles9.thumbDot,
|
|
2528
2749
|
{
|
|
2529
2750
|
backgroundColor: colors.primary
|
|
2530
2751
|
}
|
|
@@ -2538,7 +2759,7 @@ function Slider({
|
|
|
2538
2759
|
)
|
|
2539
2760
|
] });
|
|
2540
2761
|
}
|
|
2541
|
-
var
|
|
2762
|
+
var styles9 = StyleSheet10.create({
|
|
2542
2763
|
track: {
|
|
2543
2764
|
height: 6,
|
|
2544
2765
|
width: "100%"
|
|
@@ -2581,14 +2802,14 @@ var styles8 = StyleSheet8.create({
|
|
|
2581
2802
|
// src/ui/form/Select.tsx
|
|
2582
2803
|
import { useState as useState17, useCallback as useCallback13, useMemo as useMemo5 } from "react";
|
|
2583
2804
|
import {
|
|
2584
|
-
Modal as
|
|
2805
|
+
Modal as Modal3,
|
|
2585
2806
|
View as View7,
|
|
2586
2807
|
TouchableOpacity as TouchableOpacity5,
|
|
2587
2808
|
FlatList as FlatList2,
|
|
2588
2809
|
TextInput as TextInput2,
|
|
2589
|
-
StyleSheet as
|
|
2810
|
+
StyleSheet as StyleSheet11
|
|
2590
2811
|
} from "react-native";
|
|
2591
|
-
import { Fragment as Fragment2, jsx as
|
|
2812
|
+
import { Fragment as Fragment2, jsx as jsx28, jsxs as jsxs10 } from "nativewind/jsx-runtime";
|
|
2592
2813
|
function Select({
|
|
2593
2814
|
value,
|
|
2594
2815
|
onChange,
|
|
@@ -2649,7 +2870,7 @@ function Select({
|
|
|
2649
2870
|
const renderOption = useCallback13(
|
|
2650
2871
|
({ item }) => {
|
|
2651
2872
|
const isSelected = selectedValues.includes(item.value);
|
|
2652
|
-
return /* @__PURE__ */
|
|
2873
|
+
return /* @__PURE__ */ jsxs10(
|
|
2653
2874
|
AppPressable,
|
|
2654
2875
|
{
|
|
2655
2876
|
className: cn(
|
|
@@ -2657,22 +2878,22 @@ function Select({
|
|
|
2657
2878
|
isSelected && "bg-primary-50"
|
|
2658
2879
|
),
|
|
2659
2880
|
style: [
|
|
2660
|
-
|
|
2881
|
+
styles10.optionItem,
|
|
2661
2882
|
{ borderBottomColor: colors.divider },
|
|
2662
2883
|
isSelected && { backgroundColor: colors.primarySurface }
|
|
2663
2884
|
],
|
|
2664
2885
|
onPress: () => handleSelect(item.value),
|
|
2665
2886
|
children: [
|
|
2666
|
-
/* @__PURE__ */
|
|
2667
|
-
isSelected && /* @__PURE__ */
|
|
2887
|
+
/* @__PURE__ */ jsx28(AppText, { style: { color: isSelected ? colors.primary : colors.text }, children: item.label }),
|
|
2888
|
+
isSelected && /* @__PURE__ */ jsx28(Icon, { name: "check", size: "sm", color: "primary-500" })
|
|
2668
2889
|
]
|
|
2669
2890
|
}
|
|
2670
2891
|
);
|
|
2671
2892
|
},
|
|
2672
2893
|
[selectedValues, handleSelect, colors]
|
|
2673
2894
|
);
|
|
2674
|
-
return /* @__PURE__ */
|
|
2675
|
-
/* @__PURE__ */
|
|
2895
|
+
return /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
2896
|
+
/* @__PURE__ */ jsxs10(
|
|
2676
2897
|
AppPressable,
|
|
2677
2898
|
{
|
|
2678
2899
|
className: cn(
|
|
@@ -2680,11 +2901,11 @@ function Select({
|
|
|
2680
2901
|
disabled ? "opacity-60" : "",
|
|
2681
2902
|
className
|
|
2682
2903
|
),
|
|
2683
|
-
style: [
|
|
2904
|
+
style: [styles10.trigger, { backgroundColor: colors.surface, borderColor: colors.border }],
|
|
2684
2905
|
disabled,
|
|
2685
2906
|
onPress: () => setVisible(true),
|
|
2686
2907
|
children: [
|
|
2687
|
-
/* @__PURE__ */
|
|
2908
|
+
/* @__PURE__ */ jsx28(
|
|
2688
2909
|
AppText,
|
|
2689
2910
|
{
|
|
2690
2911
|
className: "flex-1",
|
|
@@ -2693,46 +2914,46 @@ function Select({
|
|
|
2693
2914
|
children: displayText
|
|
2694
2915
|
}
|
|
2695
2916
|
),
|
|
2696
|
-
/* @__PURE__ */
|
|
2697
|
-
clearable && selectedValues.length > 0 && !disabled && /* @__PURE__ */
|
|
2698
|
-
/* @__PURE__ */
|
|
2917
|
+
/* @__PURE__ */ jsxs10(View7, { className: "flex-row items-center", children: [
|
|
2918
|
+
clearable && selectedValues.length > 0 && !disabled && /* @__PURE__ */ jsx28(TouchableOpacity5, { onPress: handleClear, className: "mr-2 p-1", children: /* @__PURE__ */ jsx28(Icon, { name: "close", size: "sm", color: colors.icon }) }),
|
|
2919
|
+
/* @__PURE__ */ jsx28(Icon, { name: "keyboard-arrow-down", size: "md", color: colors.icon })
|
|
2699
2920
|
] })
|
|
2700
2921
|
]
|
|
2701
2922
|
}
|
|
2702
2923
|
),
|
|
2703
|
-
/* @__PURE__ */
|
|
2704
|
-
|
|
2924
|
+
/* @__PURE__ */ jsx28(
|
|
2925
|
+
Modal3,
|
|
2705
2926
|
{
|
|
2706
2927
|
visible,
|
|
2707
2928
|
transparent: true,
|
|
2708
2929
|
animationType: "slide",
|
|
2709
2930
|
onRequestClose: () => setVisible(false),
|
|
2710
|
-
children: /* @__PURE__ */
|
|
2931
|
+
children: /* @__PURE__ */ jsx28(AppView, { className: "flex-1", style: { backgroundColor: colors.overlay }, justify: "end", children: /* @__PURE__ */ jsxs10(
|
|
2711
2932
|
AppView,
|
|
2712
2933
|
{
|
|
2713
2934
|
className: "rounded-t-2xl max-h-[70%]",
|
|
2714
2935
|
style: { backgroundColor: colors.surface },
|
|
2715
2936
|
children: [
|
|
2716
|
-
/* @__PURE__ */
|
|
2937
|
+
/* @__PURE__ */ jsxs10(
|
|
2717
2938
|
AppView,
|
|
2718
2939
|
{
|
|
2719
2940
|
row: true,
|
|
2720
2941
|
between: true,
|
|
2721
2942
|
items: "center",
|
|
2722
2943
|
className: "px-4 py-3",
|
|
2723
|
-
style: [
|
|
2944
|
+
style: [styles10.header, { borderBottomColor: colors.divider }],
|
|
2724
2945
|
children: [
|
|
2725
|
-
/* @__PURE__ */
|
|
2726
|
-
/* @__PURE__ */
|
|
2946
|
+
/* @__PURE__ */ jsx28(AppText, { className: "text-lg font-semibold", style: { color: colors.text }, children: multiple ? "\u9009\u62E9\u9009\u9879" : "\u8BF7\u9009\u62E9" }),
|
|
2947
|
+
/* @__PURE__ */ jsx28(TouchableOpacity5, { onPress: () => setVisible(false), children: /* @__PURE__ */ jsx28(Icon, { name: "close", size: "md", color: colors.icon }) })
|
|
2727
2948
|
]
|
|
2728
2949
|
}
|
|
2729
2950
|
),
|
|
2730
|
-
searchable && /* @__PURE__ */
|
|
2951
|
+
searchable && /* @__PURE__ */ jsx28(
|
|
2731
2952
|
AppView,
|
|
2732
2953
|
{
|
|
2733
2954
|
className: "px-4 py-3",
|
|
2734
|
-
style: [
|
|
2735
|
-
children: /* @__PURE__ */
|
|
2955
|
+
style: [styles10.searchBox, { borderBottomColor: colors.divider }],
|
|
2956
|
+
children: /* @__PURE__ */ jsxs10(
|
|
2736
2957
|
AppView,
|
|
2737
2958
|
{
|
|
2738
2959
|
row: true,
|
|
@@ -2740,8 +2961,8 @@ function Select({
|
|
|
2740
2961
|
className: "px-3 py-2 rounded-lg",
|
|
2741
2962
|
style: { backgroundColor: colors.surfaceMuted },
|
|
2742
2963
|
children: [
|
|
2743
|
-
/* @__PURE__ */
|
|
2744
|
-
/* @__PURE__ */
|
|
2964
|
+
/* @__PURE__ */ jsx28(View7, { style: { marginRight: 8 }, children: /* @__PURE__ */ jsx28(Icon, { name: "search", size: "sm", color: colors.icon }) }),
|
|
2965
|
+
/* @__PURE__ */ jsx28(
|
|
2745
2966
|
TextInput2,
|
|
2746
2967
|
{
|
|
2747
2968
|
className: "flex-1 text-base",
|
|
@@ -2753,42 +2974,42 @@ function Select({
|
|
|
2753
2974
|
autoFocus: true
|
|
2754
2975
|
}
|
|
2755
2976
|
),
|
|
2756
|
-
searchKeyword.length > 0 && /* @__PURE__ */
|
|
2977
|
+
searchKeyword.length > 0 && /* @__PURE__ */ jsx28(TouchableOpacity5, { onPress: () => setSearchKeyword(""), children: /* @__PURE__ */ jsx28(Icon, { name: "close", size: "sm", color: colors.icon }) })
|
|
2757
2978
|
]
|
|
2758
2979
|
}
|
|
2759
2980
|
)
|
|
2760
2981
|
}
|
|
2761
2982
|
),
|
|
2762
|
-
/* @__PURE__ */
|
|
2983
|
+
/* @__PURE__ */ jsx28(
|
|
2763
2984
|
FlatList2,
|
|
2764
2985
|
{
|
|
2765
2986
|
data: filteredOptions,
|
|
2766
2987
|
keyExtractor: (item) => item.value,
|
|
2767
2988
|
renderItem: renderOption,
|
|
2768
|
-
ListEmptyComponent: /* @__PURE__ */
|
|
2989
|
+
ListEmptyComponent: /* @__PURE__ */ jsx28(AppView, { center: true, className: "py-8", children: /* @__PURE__ */ jsx28(AppText, { style: { color: colors.textMuted }, children: "\u6682\u65E0\u9009\u9879" }) })
|
|
2769
2990
|
}
|
|
2770
2991
|
),
|
|
2771
|
-
multiple && /* @__PURE__ */
|
|
2992
|
+
multiple && /* @__PURE__ */ jsxs10(
|
|
2772
2993
|
AppView,
|
|
2773
2994
|
{
|
|
2774
2995
|
row: true,
|
|
2775
2996
|
between: true,
|
|
2776
2997
|
items: "center",
|
|
2777
2998
|
className: "px-4 py-3",
|
|
2778
|
-
style: [
|
|
2999
|
+
style: [styles10.footer, { borderTopColor: colors.divider }],
|
|
2779
3000
|
children: [
|
|
2780
|
-
/* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ jsxs10(AppText, { style: { color: colors.textMuted }, children: [
|
|
2781
3002
|
"\u5DF2\u9009\u62E9 ",
|
|
2782
3003
|
selectedValues.length,
|
|
2783
3004
|
" \u9879"
|
|
2784
3005
|
] }),
|
|
2785
|
-
/* @__PURE__ */
|
|
3006
|
+
/* @__PURE__ */ jsx28(
|
|
2786
3007
|
TouchableOpacity5,
|
|
2787
3008
|
{
|
|
2788
3009
|
className: "px-4 py-2 rounded-lg",
|
|
2789
3010
|
style: { backgroundColor: colors.primary },
|
|
2790
3011
|
onPress: () => setVisible(false),
|
|
2791
|
-
children: /* @__PURE__ */
|
|
3012
|
+
children: /* @__PURE__ */ jsx28(AppText, { className: "font-medium", style: { color: colors.textInverse }, children: "\u786E\u5B9A" })
|
|
2792
3013
|
}
|
|
2793
3014
|
)
|
|
2794
3015
|
]
|
|
@@ -2801,7 +3022,7 @@ function Select({
|
|
|
2801
3022
|
)
|
|
2802
3023
|
] });
|
|
2803
3024
|
}
|
|
2804
|
-
var
|
|
3025
|
+
var styles10 = StyleSheet11.create({
|
|
2805
3026
|
trigger: {
|
|
2806
3027
|
borderWidth: 0.5
|
|
2807
3028
|
},
|
|
@@ -2821,8 +3042,8 @@ var styles9 = StyleSheet9.create({
|
|
|
2821
3042
|
|
|
2822
3043
|
// src/ui/form/DatePicker.tsx
|
|
2823
3044
|
import { useState as useState18, useCallback as useCallback14, useMemo as useMemo6 } from "react";
|
|
2824
|
-
import { Modal as
|
|
2825
|
-
import { Fragment as Fragment3, jsx as
|
|
3045
|
+
import { Modal as Modal4, TouchableOpacity as TouchableOpacity6, StyleSheet as StyleSheet12 } from "react-native";
|
|
3046
|
+
import { Fragment as Fragment3, jsx as jsx29, jsxs as jsxs11 } from "nativewind/jsx-runtime";
|
|
2826
3047
|
function PickerColumn({
|
|
2827
3048
|
title,
|
|
2828
3049
|
values,
|
|
@@ -2833,27 +3054,27 @@ function PickerColumn({
|
|
|
2833
3054
|
showDivider = false,
|
|
2834
3055
|
colors
|
|
2835
3056
|
}) {
|
|
2836
|
-
return /* @__PURE__ */
|
|
3057
|
+
return /* @__PURE__ */ jsxs11(
|
|
2837
3058
|
AppView,
|
|
2838
3059
|
{
|
|
2839
3060
|
flex: true,
|
|
2840
3061
|
style: [
|
|
2841
|
-
showDivider &&
|
|
3062
|
+
showDivider && styles11.column,
|
|
2842
3063
|
showDivider ? { borderRightColor: colors.divider } : void 0
|
|
2843
3064
|
],
|
|
2844
3065
|
children: [
|
|
2845
|
-
/* @__PURE__ */
|
|
2846
|
-
/* @__PURE__ */
|
|
3066
|
+
/* @__PURE__ */ jsx29(AppView, { center: true, className: "py-2", style: { backgroundColor: colors.headerSurface }, children: /* @__PURE__ */ jsx29(AppText, { className: "text-sm font-medium", style: { color: colors.textMuted }, children: title }) }),
|
|
3067
|
+
/* @__PURE__ */ jsx29(AppView, { className: "flex-1", children: values.map((value) => {
|
|
2847
3068
|
const selected = selectedValue === value;
|
|
2848
3069
|
const disabled = isDisabled(value);
|
|
2849
|
-
return /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ jsx29(
|
|
2850
3071
|
TouchableOpacity6,
|
|
2851
3072
|
{
|
|
2852
3073
|
className: cn("py-2 items-center", selected && "bg-primary-50"),
|
|
2853
3074
|
style: selected ? { backgroundColor: colors.primarySurface } : void 0,
|
|
2854
3075
|
disabled,
|
|
2855
3076
|
onPress: () => onSelect(value),
|
|
2856
|
-
children: /* @__PURE__ */
|
|
3077
|
+
children: /* @__PURE__ */ jsx29(
|
|
2857
3078
|
AppText,
|
|
2858
3079
|
{
|
|
2859
3080
|
className: cn(selected ? "font-semibold" : void 0, disabled && "opacity-30"),
|
|
@@ -2927,8 +3148,8 @@ function DatePicker({
|
|
|
2927
3148
|
},
|
|
2928
3149
|
[tempDate]
|
|
2929
3150
|
);
|
|
2930
|
-
return /* @__PURE__ */
|
|
2931
|
-
/* @__PURE__ */
|
|
3151
|
+
return /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
3152
|
+
/* @__PURE__ */ jsxs11(
|
|
2932
3153
|
AppPressable,
|
|
2933
3154
|
{
|
|
2934
3155
|
className: cn(
|
|
@@ -2936,14 +3157,14 @@ function DatePicker({
|
|
|
2936
3157
|
disabled ? "opacity-60" : "",
|
|
2937
3158
|
className
|
|
2938
3159
|
),
|
|
2939
|
-
style: [
|
|
3160
|
+
style: [styles11.trigger, { backgroundColor: colors.surface, borderColor: colors.border }],
|
|
2940
3161
|
disabled,
|
|
2941
3162
|
onPress: () => {
|
|
2942
3163
|
setTempDate(value || /* @__PURE__ */ new Date());
|
|
2943
3164
|
setVisible(true);
|
|
2944
3165
|
},
|
|
2945
3166
|
children: [
|
|
2946
|
-
/* @__PURE__ */
|
|
3167
|
+
/* @__PURE__ */ jsx29(
|
|
2947
3168
|
AppText,
|
|
2948
3169
|
{
|
|
2949
3170
|
className: "flex-1",
|
|
@@ -2952,36 +3173,36 @@ function DatePicker({
|
|
|
2952
3173
|
children: displayText
|
|
2953
3174
|
}
|
|
2954
3175
|
),
|
|
2955
|
-
/* @__PURE__ */
|
|
3176
|
+
/* @__PURE__ */ jsx29(Icon, { name: "calendar-today", size: "md", color: colors.icon })
|
|
2956
3177
|
]
|
|
2957
3178
|
}
|
|
2958
3179
|
),
|
|
2959
|
-
/* @__PURE__ */
|
|
2960
|
-
|
|
3180
|
+
/* @__PURE__ */ jsx29(
|
|
3181
|
+
Modal4,
|
|
2961
3182
|
{
|
|
2962
3183
|
visible,
|
|
2963
3184
|
transparent: true,
|
|
2964
3185
|
animationType: "slide",
|
|
2965
3186
|
onRequestClose: () => setVisible(false),
|
|
2966
|
-
children: /* @__PURE__ */
|
|
2967
|
-
/* @__PURE__ */
|
|
3187
|
+
children: /* @__PURE__ */ jsx29(AppView, { className: "flex-1", style: { backgroundColor: colors.overlay }, justify: "end", children: /* @__PURE__ */ jsxs11(AppView, { className: "rounded-t-2xl", style: { backgroundColor: colors.surface }, children: [
|
|
3188
|
+
/* @__PURE__ */ jsxs11(
|
|
2968
3189
|
AppView,
|
|
2969
3190
|
{
|
|
2970
3191
|
row: true,
|
|
2971
3192
|
between: true,
|
|
2972
3193
|
items: "center",
|
|
2973
3194
|
className: "px-4 py-3",
|
|
2974
|
-
style: [
|
|
3195
|
+
style: [styles11.header, { borderBottomColor: colors.divider }],
|
|
2975
3196
|
children: [
|
|
2976
|
-
/* @__PURE__ */
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
3197
|
+
/* @__PURE__ */ jsx29(TouchableOpacity6, { onPress: () => setVisible(false), children: /* @__PURE__ */ jsx29(AppText, { style: { color: colors.textMuted }, children: "\u53D6\u6D88" }) }),
|
|
3198
|
+
/* @__PURE__ */ jsx29(AppText, { className: "text-lg font-semibold", style: { color: colors.text }, children: "\u9009\u62E9\u65E5\u671F" }),
|
|
3199
|
+
/* @__PURE__ */ jsx29(TouchableOpacity6, { onPress: handleConfirm, children: /* @__PURE__ */ jsx29(AppText, { style: { color: colors.primary }, className: "font-medium", children: "\u786E\u5B9A" }) })
|
|
2979
3200
|
]
|
|
2980
3201
|
}
|
|
2981
3202
|
),
|
|
2982
|
-
/* @__PURE__ */
|
|
2983
|
-
/* @__PURE__ */
|
|
2984
|
-
/* @__PURE__ */
|
|
3203
|
+
/* @__PURE__ */ jsx29(AppView, { center: true, className: "py-4", style: { backgroundColor: colors.headerSurface }, children: /* @__PURE__ */ jsx29(AppText, { className: "text-2xl font-semibold", style: { color: colors.text }, children: formatDate(tempDate, "yyyy\u5E74MM\u6708dd\u65E5") }) }),
|
|
3204
|
+
/* @__PURE__ */ jsxs11(AppView, { row: true, className: "h-48", children: [
|
|
3205
|
+
/* @__PURE__ */ jsx29(
|
|
2985
3206
|
PickerColumn,
|
|
2986
3207
|
{
|
|
2987
3208
|
title: "\u5E74",
|
|
@@ -2993,7 +3214,7 @@ function DatePicker({
|
|
|
2993
3214
|
showDivider: true
|
|
2994
3215
|
}
|
|
2995
3216
|
),
|
|
2996
|
-
/* @__PURE__ */
|
|
3217
|
+
/* @__PURE__ */ jsx29(
|
|
2997
3218
|
PickerColumn,
|
|
2998
3219
|
{
|
|
2999
3220
|
title: "\u6708",
|
|
@@ -3006,7 +3227,7 @@ function DatePicker({
|
|
|
3006
3227
|
showDivider: true
|
|
3007
3228
|
}
|
|
3008
3229
|
),
|
|
3009
|
-
/* @__PURE__ */
|
|
3230
|
+
/* @__PURE__ */ jsx29(
|
|
3010
3231
|
PickerColumn,
|
|
3011
3232
|
{
|
|
3012
3233
|
title: "\u65E5",
|
|
@@ -3018,38 +3239,38 @@ function DatePicker({
|
|
|
3018
3239
|
}
|
|
3019
3240
|
)
|
|
3020
3241
|
] }),
|
|
3021
|
-
/* @__PURE__ */
|
|
3242
|
+
/* @__PURE__ */ jsxs11(
|
|
3022
3243
|
AppView,
|
|
3023
3244
|
{
|
|
3024
3245
|
row: true,
|
|
3025
3246
|
className: "px-4 py-3 gap-2",
|
|
3026
|
-
style: [
|
|
3247
|
+
style: [styles11.footer, { borderTopColor: colors.divider }],
|
|
3027
3248
|
children: [
|
|
3028
|
-
/* @__PURE__ */
|
|
3249
|
+
/* @__PURE__ */ jsx29(
|
|
3029
3250
|
TouchableOpacity6,
|
|
3030
3251
|
{
|
|
3031
3252
|
className: "flex-1 py-2 items-center rounded-lg",
|
|
3032
3253
|
style: { backgroundColor: colors.surfaceMuted },
|
|
3033
3254
|
onPress: () => setTempDate(/* @__PURE__ */ new Date()),
|
|
3034
|
-
children: /* @__PURE__ */
|
|
3255
|
+
children: /* @__PURE__ */ jsx29(AppText, { style: { color: colors.text }, children: "\u4ECA\u5929" })
|
|
3035
3256
|
}
|
|
3036
3257
|
),
|
|
3037
|
-
minDate && /* @__PURE__ */
|
|
3258
|
+
minDate && /* @__PURE__ */ jsx29(
|
|
3038
3259
|
TouchableOpacity6,
|
|
3039
3260
|
{
|
|
3040
3261
|
className: "flex-1 py-2 items-center rounded-lg",
|
|
3041
3262
|
style: { backgroundColor: colors.surfaceMuted },
|
|
3042
3263
|
onPress: () => setTempDate(minDate),
|
|
3043
|
-
children: /* @__PURE__ */
|
|
3264
|
+
children: /* @__PURE__ */ jsx29(AppText, { style: { color: colors.text }, children: "\u6700\u65E9" })
|
|
3044
3265
|
}
|
|
3045
3266
|
),
|
|
3046
|
-
maxDate && /* @__PURE__ */
|
|
3267
|
+
maxDate && /* @__PURE__ */ jsx29(
|
|
3047
3268
|
TouchableOpacity6,
|
|
3048
3269
|
{
|
|
3049
3270
|
className: "flex-1 py-2 items-center rounded-lg",
|
|
3050
3271
|
style: { backgroundColor: colors.surfaceMuted },
|
|
3051
3272
|
onPress: () => setTempDate(maxDate),
|
|
3052
|
-
children: /* @__PURE__ */
|
|
3273
|
+
children: /* @__PURE__ */ jsx29(AppText, { style: { color: colors.text }, children: "\u6700\u665A" })
|
|
3053
3274
|
}
|
|
3054
3275
|
)
|
|
3055
3276
|
]
|
|
@@ -3060,7 +3281,7 @@ function DatePicker({
|
|
|
3060
3281
|
)
|
|
3061
3282
|
] });
|
|
3062
3283
|
}
|
|
3063
|
-
var
|
|
3284
|
+
var styles11 = StyleSheet12.create({
|
|
3064
3285
|
trigger: {
|
|
3065
3286
|
borderWidth: 0.5
|
|
3066
3287
|
},
|
|
@@ -3076,7 +3297,7 @@ var styles10 = StyleSheet10.create({
|
|
|
3076
3297
|
});
|
|
3077
3298
|
|
|
3078
3299
|
// src/ui/form/FormItem.tsx
|
|
3079
|
-
import { jsx as
|
|
3300
|
+
import { jsx as jsx30, jsxs as jsxs12 } from "nativewind/jsx-runtime";
|
|
3080
3301
|
function FormItem({
|
|
3081
3302
|
name: _name,
|
|
3082
3303
|
label,
|
|
@@ -3088,14 +3309,14 @@ function FormItem({
|
|
|
3088
3309
|
labelClassName
|
|
3089
3310
|
}) {
|
|
3090
3311
|
const colors = useThemeColors();
|
|
3091
|
-
return /* @__PURE__ */
|
|
3092
|
-
label && /* @__PURE__ */
|
|
3093
|
-
/* @__PURE__ */
|
|
3094
|
-
required && /* @__PURE__ */
|
|
3312
|
+
return /* @__PURE__ */ jsxs12(AppView, { className: cn("mb-4", className), children: [
|
|
3313
|
+
label && /* @__PURE__ */ jsxs12(AppView, { row: true, items: "center", gap: 1, className: cn("mb-2", labelClassName), children: [
|
|
3314
|
+
/* @__PURE__ */ jsx30(AppText, { size: "sm", weight: "medium", style: { color: colors.textSecondary }, children: label }),
|
|
3315
|
+
required && /* @__PURE__ */ jsx30(AppText, { color: "error-500", children: "*" })
|
|
3095
3316
|
] }),
|
|
3096
3317
|
children,
|
|
3097
|
-
error && /* @__PURE__ */
|
|
3098
|
-
help && !error && /* @__PURE__ */
|
|
3318
|
+
error && /* @__PURE__ */ jsx30(AppText, { size: "sm", color: "error-500", className: "mt-1", children: error }),
|
|
3319
|
+
help && !error && /* @__PURE__ */ jsx30(AppText, { size: "sm", className: "mt-1", style: { color: colors.textMuted }, children: help })
|
|
3099
3320
|
] });
|
|
3100
3321
|
}
|
|
3101
3322
|
|
|
@@ -3228,10 +3449,35 @@ function useToggle(defaultValue = false) {
|
|
|
3228
3449
|
return [value, { toggle, set, setTrue, setFalse }];
|
|
3229
3450
|
}
|
|
3230
3451
|
|
|
3452
|
+
// src/ui/hooks/usePageDrawer.ts
|
|
3453
|
+
import { useCallback as useCallback17, useState as useState21 } from "react";
|
|
3454
|
+
function usePageDrawer(defaultVisible = false) {
|
|
3455
|
+
const [visible, setVisibleState] = useState21(defaultVisible);
|
|
3456
|
+
const open = useCallback17(() => {
|
|
3457
|
+
setVisibleState(true);
|
|
3458
|
+
}, []);
|
|
3459
|
+
const close = useCallback17(() => {
|
|
3460
|
+
setVisibleState(false);
|
|
3461
|
+
}, []);
|
|
3462
|
+
const toggle = useCallback17(() => {
|
|
3463
|
+
setVisibleState((current) => !current);
|
|
3464
|
+
}, []);
|
|
3465
|
+
const setVisible = useCallback17((nextVisible) => {
|
|
3466
|
+
setVisibleState(nextVisible);
|
|
3467
|
+
}, []);
|
|
3468
|
+
return {
|
|
3469
|
+
visible,
|
|
3470
|
+
open,
|
|
3471
|
+
close,
|
|
3472
|
+
toggle,
|
|
3473
|
+
setVisible
|
|
3474
|
+
};
|
|
3475
|
+
}
|
|
3476
|
+
|
|
3231
3477
|
// src/ui/hooks/useDebounce.ts
|
|
3232
|
-
import { useEffect as useEffect5, useState as
|
|
3478
|
+
import { useEffect as useEffect5, useState as useState22 } from "react";
|
|
3233
3479
|
function useDebounce(value, delay = 500) {
|
|
3234
|
-
const [debouncedValue, setDebouncedValue] =
|
|
3480
|
+
const [debouncedValue, setDebouncedValue] = useState22(value);
|
|
3235
3481
|
useEffect5(() => {
|
|
3236
3482
|
const timer = setTimeout(() => {
|
|
3237
3483
|
setDebouncedValue(value);
|
|
@@ -3244,9 +3490,9 @@ function useDebounce(value, delay = 500) {
|
|
|
3244
3490
|
}
|
|
3245
3491
|
|
|
3246
3492
|
// src/ui/hooks/useThrottle.ts
|
|
3247
|
-
import { useEffect as useEffect6, useRef as useRef7, useState as
|
|
3493
|
+
import { useEffect as useEffect6, useRef as useRef7, useState as useState23 } from "react";
|
|
3248
3494
|
function useThrottle(value, delay = 200) {
|
|
3249
|
-
const [throttledValue, setThrottledValue] =
|
|
3495
|
+
const [throttledValue, setThrottledValue] = useState23(value);
|
|
3250
3496
|
const lastUpdatedRef = useRef7(Date.now());
|
|
3251
3497
|
useEffect6(() => {
|
|
3252
3498
|
const now = Date.now();
|
|
@@ -3269,11 +3515,11 @@ function useThrottle(value, delay = 200) {
|
|
|
3269
3515
|
}
|
|
3270
3516
|
|
|
3271
3517
|
// src/ui/hooks/useKeyboard.ts
|
|
3272
|
-
import { useEffect as useEffect7, useState as
|
|
3518
|
+
import { useEffect as useEffect7, useState as useState24, useCallback as useCallback18 } from "react";
|
|
3273
3519
|
import { Keyboard, Platform } from "react-native";
|
|
3274
3520
|
function useKeyboard() {
|
|
3275
|
-
const [visible, setVisible] =
|
|
3276
|
-
const [height, setHeight] =
|
|
3521
|
+
const [visible, setVisible] = useState24(false);
|
|
3522
|
+
const [height, setHeight] = useState24(0);
|
|
3277
3523
|
useEffect7(() => {
|
|
3278
3524
|
const handleKeyboardWillShow = (event) => {
|
|
3279
3525
|
setVisible(true);
|
|
@@ -3304,17 +3550,17 @@ function useKeyboard() {
|
|
|
3304
3550
|
willHideSub.remove();
|
|
3305
3551
|
};
|
|
3306
3552
|
}, []);
|
|
3307
|
-
const dismiss =
|
|
3553
|
+
const dismiss = useCallback18(() => {
|
|
3308
3554
|
Keyboard.dismiss();
|
|
3309
3555
|
}, []);
|
|
3310
3556
|
return { visible, height, dismiss };
|
|
3311
3557
|
}
|
|
3312
3558
|
|
|
3313
3559
|
// src/ui/hooks/useDimensions.ts
|
|
3314
|
-
import { useEffect as useEffect8, useState as
|
|
3560
|
+
import { useEffect as useEffect8, useState as useState25 } from "react";
|
|
3315
3561
|
import { Dimensions } from "react-native";
|
|
3316
3562
|
function useDimensions() {
|
|
3317
|
-
const [dimensions, setDimensions] =
|
|
3563
|
+
const [dimensions, setDimensions] = useState25(() => {
|
|
3318
3564
|
const window = Dimensions.get("window");
|
|
3319
3565
|
return {
|
|
3320
3566
|
width: window.width,
|
|
@@ -3341,14 +3587,14 @@ function useDimensions() {
|
|
|
3341
3587
|
}
|
|
3342
3588
|
|
|
3343
3589
|
// src/ui/hooks/useOrientation.ts
|
|
3344
|
-
import { useEffect as useEffect9, useState as
|
|
3590
|
+
import { useEffect as useEffect9, useState as useState26 } from "react";
|
|
3345
3591
|
import { Dimensions as Dimensions2 } from "react-native";
|
|
3346
3592
|
function useOrientation() {
|
|
3347
3593
|
const getOrientation = () => {
|
|
3348
3594
|
const { width, height } = Dimensions2.get("window");
|
|
3349
3595
|
return width > height ? "landscape" : "portrait";
|
|
3350
3596
|
};
|
|
3351
|
-
const [orientation, setOrientation] =
|
|
3597
|
+
const [orientation, setOrientation] = useState26(getOrientation);
|
|
3352
3598
|
useEffect9(() => {
|
|
3353
3599
|
const handleChange = ({ window }) => {
|
|
3354
3600
|
const newOrientation = window.width > window.height ? "landscape" : "portrait";
|
|
@@ -3367,7 +3613,7 @@ function useOrientation() {
|
|
|
3367
3613
|
}
|
|
3368
3614
|
|
|
3369
3615
|
// src/navigation/provider.tsx
|
|
3370
|
-
import
|
|
3616
|
+
import React6 from "react";
|
|
3371
3617
|
import {
|
|
3372
3618
|
NavigationContainer
|
|
3373
3619
|
} from "@react-navigation/native";
|
|
@@ -3395,7 +3641,7 @@ function createNavigationTheme(pantherTheme, isDark) {
|
|
|
3395
3641
|
}
|
|
3396
3642
|
|
|
3397
3643
|
// src/navigation/provider.tsx
|
|
3398
|
-
import { jsx as
|
|
3644
|
+
import { jsx as jsx31 } from "nativewind/jsx-runtime";
|
|
3399
3645
|
function NavigationProvider({
|
|
3400
3646
|
children,
|
|
3401
3647
|
linking,
|
|
@@ -3406,11 +3652,11 @@ function NavigationProvider({
|
|
|
3406
3652
|
theme: customTheme
|
|
3407
3653
|
}) {
|
|
3408
3654
|
const { theme, isDark } = useTheme();
|
|
3409
|
-
const navigationTheme =
|
|
3655
|
+
const navigationTheme = React6.useMemo(
|
|
3410
3656
|
() => customTheme || createNavigationTheme(theme, isDark),
|
|
3411
3657
|
[customTheme, theme, isDark]
|
|
3412
3658
|
);
|
|
3413
|
-
return /* @__PURE__ */
|
|
3659
|
+
return /* @__PURE__ */ jsx31(
|
|
3414
3660
|
NavigationContainer,
|
|
3415
3661
|
{
|
|
3416
3662
|
theme: navigationTheme,
|
|
@@ -3428,14 +3674,14 @@ function NavigationProvider({
|
|
|
3428
3674
|
import { createStackNavigator, TransitionPresets } from "@react-navigation/stack";
|
|
3429
3675
|
|
|
3430
3676
|
// src/navigation/navigators/StackNavigator.tsx
|
|
3431
|
-
import { jsx as
|
|
3677
|
+
import { jsx as jsx32 } from "nativewind/jsx-runtime";
|
|
3432
3678
|
var NativeStack = createStackNavigator();
|
|
3433
3679
|
var defaultScreenOptions = {
|
|
3434
3680
|
headerShown: false,
|
|
3435
3681
|
...TransitionPresets.SlideFromRightIOS
|
|
3436
3682
|
};
|
|
3437
3683
|
function StackNavigator({ initialRouteName, screenOptions, children }) {
|
|
3438
|
-
return /* @__PURE__ */
|
|
3684
|
+
return /* @__PURE__ */ jsx32(
|
|
3439
3685
|
NativeStack.Navigator,
|
|
3440
3686
|
{
|
|
3441
3687
|
initialRouteName,
|
|
@@ -3447,7 +3693,7 @@ function StackNavigator({ initialRouteName, screenOptions, children }) {
|
|
|
3447
3693
|
StackNavigator.Screen = NativeStack.Screen;
|
|
3448
3694
|
StackNavigator.Group = NativeStack.Group;
|
|
3449
3695
|
function createStackScreens(routes) {
|
|
3450
|
-
return routes.map((route) => /* @__PURE__ */
|
|
3696
|
+
return routes.map((route) => /* @__PURE__ */ jsx32(
|
|
3451
3697
|
StackNavigator.Screen,
|
|
3452
3698
|
{
|
|
3453
3699
|
name: route.name,
|
|
@@ -3460,13 +3706,13 @@ function createStackScreens(routes) {
|
|
|
3460
3706
|
}
|
|
3461
3707
|
|
|
3462
3708
|
// src/navigation/navigators/TabNavigator.tsx
|
|
3463
|
-
import
|
|
3709
|
+
import React7 from "react";
|
|
3464
3710
|
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
|
|
3465
3711
|
|
|
3466
3712
|
// src/navigation/components/BottomTabBar.tsx
|
|
3467
|
-
import { View as View8, TouchableOpacity as TouchableOpacity7, StyleSheet as
|
|
3713
|
+
import { View as View8, TouchableOpacity as TouchableOpacity7, StyleSheet as StyleSheet13 } from "react-native";
|
|
3468
3714
|
import { useSafeAreaInsets as useSafeAreaInsets2 } from "react-native-safe-area-context";
|
|
3469
|
-
import { jsx as
|
|
3715
|
+
import { jsx as jsx33, jsxs as jsxs13 } from "nativewind/jsx-runtime";
|
|
3470
3716
|
var DEFAULT_TAB_BAR_HEIGHT = 65;
|
|
3471
3717
|
function BottomTabBar({
|
|
3472
3718
|
state,
|
|
@@ -3488,11 +3734,11 @@ function BottomTabBar({
|
|
|
3488
3734
|
const inactiveColor = inactiveTintColor || colors.textMuted;
|
|
3489
3735
|
const backgroundColor = style?.backgroundColor || colors.card;
|
|
3490
3736
|
const borderTopColor = colors.divider;
|
|
3491
|
-
return /* @__PURE__ */
|
|
3737
|
+
return /* @__PURE__ */ jsx33(
|
|
3492
3738
|
View8,
|
|
3493
3739
|
{
|
|
3494
3740
|
style: [
|
|
3495
|
-
|
|
3741
|
+
styles12.container,
|
|
3496
3742
|
{ borderTopColor },
|
|
3497
3743
|
{ backgroundColor, height: height + insets.bottom, paddingBottom: insets.bottom },
|
|
3498
3744
|
style
|
|
@@ -3523,7 +3769,7 @@ function BottomTabBar({
|
|
|
3523
3769
|
size: 24
|
|
3524
3770
|
}) : null;
|
|
3525
3771
|
const badge = options.tabBarBadge;
|
|
3526
|
-
return /* @__PURE__ */
|
|
3772
|
+
return /* @__PURE__ */ jsxs13(
|
|
3527
3773
|
TouchableOpacity7,
|
|
3528
3774
|
{
|
|
3529
3775
|
accessibilityRole: "button",
|
|
@@ -3533,21 +3779,21 @@ function BottomTabBar({
|
|
|
3533
3779
|
onPress,
|
|
3534
3780
|
onLongPress,
|
|
3535
3781
|
style: [
|
|
3536
|
-
|
|
3782
|
+
styles12.tab,
|
|
3537
3783
|
{
|
|
3538
3784
|
backgroundColor: isFocused ? activeBackgroundColor : inactiveBackgroundColor
|
|
3539
3785
|
}
|
|
3540
3786
|
],
|
|
3541
3787
|
children: [
|
|
3542
|
-
/* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ jsxs13(View8, { style: [styles12.iconContainer, iconStyle], children: [
|
|
3543
3789
|
iconName,
|
|
3544
|
-
badge != null && /* @__PURE__ */
|
|
3790
|
+
badge != null && /* @__PURE__ */ jsx33(View8, { style: [styles12.badge, { backgroundColor: activeColor }], children: /* @__PURE__ */ jsx33(AppText, { style: styles12.badgeText, children: typeof badge === "number" && badge > 99 ? "99+" : badge }) })
|
|
3545
3791
|
] }),
|
|
3546
|
-
showLabel && /* @__PURE__ */
|
|
3792
|
+
showLabel && /* @__PURE__ */ jsx33(
|
|
3547
3793
|
AppText,
|
|
3548
3794
|
{
|
|
3549
3795
|
style: [
|
|
3550
|
-
|
|
3796
|
+
styles12.label,
|
|
3551
3797
|
{ color: isFocused ? activeColor : inactiveColor },
|
|
3552
3798
|
labelStyle
|
|
3553
3799
|
],
|
|
@@ -3563,7 +3809,7 @@ function BottomTabBar({
|
|
|
3563
3809
|
}
|
|
3564
3810
|
);
|
|
3565
3811
|
}
|
|
3566
|
-
var
|
|
3812
|
+
var styles12 = StyleSheet13.create({
|
|
3567
3813
|
container: {
|
|
3568
3814
|
flexDirection: "row",
|
|
3569
3815
|
borderTopWidth: 0.5,
|
|
@@ -3606,7 +3852,7 @@ var styles11 = StyleSheet11.create({
|
|
|
3606
3852
|
});
|
|
3607
3853
|
|
|
3608
3854
|
// src/navigation/navigators/TabNavigator.tsx
|
|
3609
|
-
import { jsx as
|
|
3855
|
+
import { jsx as jsx34 } from "nativewind/jsx-runtime";
|
|
3610
3856
|
var NativeTab = createBottomTabNavigator();
|
|
3611
3857
|
var defaultScreenOptions2 = {
|
|
3612
3858
|
headerShown: false,
|
|
@@ -3619,7 +3865,7 @@ function TabNavigator({
|
|
|
3619
3865
|
screenOptions,
|
|
3620
3866
|
children
|
|
3621
3867
|
}) {
|
|
3622
|
-
const mergedScreenOptions =
|
|
3868
|
+
const mergedScreenOptions = React7.useMemo(() => {
|
|
3623
3869
|
const options = { ...defaultScreenOptions2, ...screenOptions };
|
|
3624
3870
|
if (tabBarOptions) {
|
|
3625
3871
|
if (tabBarOptions.showLabel !== void 0) {
|
|
@@ -3652,9 +3898,9 @@ function TabNavigator({
|
|
|
3652
3898
|
}
|
|
3653
3899
|
return options;
|
|
3654
3900
|
}, [tabBarOptions, screenOptions]);
|
|
3655
|
-
const resolvedTabBar =
|
|
3901
|
+
const resolvedTabBar = React7.useMemo(() => {
|
|
3656
3902
|
if (tabBar) return tabBar;
|
|
3657
|
-
return (props) => /* @__PURE__ */
|
|
3903
|
+
return (props) => /* @__PURE__ */ jsx34(
|
|
3658
3904
|
BottomTabBar,
|
|
3659
3905
|
{
|
|
3660
3906
|
...props,
|
|
@@ -3681,7 +3927,7 @@ function TabNavigator({
|
|
|
3681
3927
|
tabBarOptions?.style,
|
|
3682
3928
|
tabBarOptions?.height
|
|
3683
3929
|
]);
|
|
3684
|
-
return /* @__PURE__ */
|
|
3930
|
+
return /* @__PURE__ */ jsx34(
|
|
3685
3931
|
NativeTab.Navigator,
|
|
3686
3932
|
{
|
|
3687
3933
|
initialRouteName,
|
|
@@ -3693,7 +3939,7 @@ function TabNavigator({
|
|
|
3693
3939
|
}
|
|
3694
3940
|
TabNavigator.Screen = NativeTab.Screen;
|
|
3695
3941
|
function createTabScreens(routes) {
|
|
3696
|
-
return routes.map((route) => /* @__PURE__ */
|
|
3942
|
+
return routes.map((route) => /* @__PURE__ */ jsx34(
|
|
3697
3943
|
TabNavigator.Screen,
|
|
3698
3944
|
{
|
|
3699
3945
|
name: route.name,
|
|
@@ -3706,9 +3952,9 @@ function createTabScreens(routes) {
|
|
|
3706
3952
|
}
|
|
3707
3953
|
|
|
3708
3954
|
// src/navigation/navigators/DrawerNavigator.tsx
|
|
3709
|
-
import
|
|
3955
|
+
import React8 from "react";
|
|
3710
3956
|
import { createDrawerNavigator } from "@react-navigation/drawer";
|
|
3711
|
-
import { jsx as
|
|
3957
|
+
import { jsx as jsx35 } from "nativewind/jsx-runtime";
|
|
3712
3958
|
var NativeDrawer = createDrawerNavigator();
|
|
3713
3959
|
function DrawerNavigator({
|
|
3714
3960
|
initialRouteName,
|
|
@@ -3719,7 +3965,7 @@ function DrawerNavigator({
|
|
|
3719
3965
|
}) {
|
|
3720
3966
|
const { theme, isDark } = useTheme();
|
|
3721
3967
|
const navigationTheme = createNavigationTheme(theme, isDark);
|
|
3722
|
-
const mergedScreenOptions =
|
|
3968
|
+
const mergedScreenOptions = React8.useMemo(() => {
|
|
3723
3969
|
return {
|
|
3724
3970
|
headerShown: false,
|
|
3725
3971
|
drawerStyle: {
|
|
@@ -3738,7 +3984,7 @@ function DrawerNavigator({
|
|
|
3738
3984
|
...screenOptions
|
|
3739
3985
|
};
|
|
3740
3986
|
}, [screenOptions, drawerOptions, navigationTheme, theme]);
|
|
3741
|
-
return /* @__PURE__ */
|
|
3987
|
+
return /* @__PURE__ */ jsx35(
|
|
3742
3988
|
NativeDrawer.Navigator,
|
|
3743
3989
|
{
|
|
3744
3990
|
initialRouteName,
|
|
@@ -3750,7 +3996,7 @@ function DrawerNavigator({
|
|
|
3750
3996
|
}
|
|
3751
3997
|
DrawerNavigator.Screen = NativeDrawer.Screen;
|
|
3752
3998
|
function createDrawerScreens(routes) {
|
|
3753
|
-
return routes.map((route) => /* @__PURE__ */
|
|
3999
|
+
return routes.map((route) => /* @__PURE__ */ jsx35(
|
|
3754
4000
|
DrawerNavigator.Screen,
|
|
3755
4001
|
{
|
|
3756
4002
|
name: route.name,
|
|
@@ -3763,9 +4009,9 @@ function createDrawerScreens(routes) {
|
|
|
3763
4009
|
}
|
|
3764
4010
|
|
|
3765
4011
|
// src/navigation/components/AppHeader.tsx
|
|
3766
|
-
import { StyleSheet as
|
|
4012
|
+
import { StyleSheet as StyleSheet14 } from "react-native";
|
|
3767
4013
|
import { useSafeAreaInsets as useSafeAreaInsets3 } from "react-native-safe-area-context";
|
|
3768
|
-
import { jsx as
|
|
4014
|
+
import { jsx as jsx36, jsxs as jsxs14 } from "nativewind/jsx-runtime";
|
|
3769
4015
|
function AppHeader({
|
|
3770
4016
|
title,
|
|
3771
4017
|
subtitle,
|
|
@@ -3779,7 +4025,7 @@ function AppHeader({
|
|
|
3779
4025
|
const colors = useThemeColors();
|
|
3780
4026
|
const insets = useSafeAreaInsets3();
|
|
3781
4027
|
const backgroundColor = transparent ? "transparent" : colors.card;
|
|
3782
|
-
return /* @__PURE__ */
|
|
4028
|
+
return /* @__PURE__ */ jsx36(
|
|
3783
4029
|
AppView,
|
|
3784
4030
|
{
|
|
3785
4031
|
style: [
|
|
@@ -3789,38 +4035,38 @@ function AppHeader({
|
|
|
3789
4035
|
},
|
|
3790
4036
|
style
|
|
3791
4037
|
],
|
|
3792
|
-
children: /* @__PURE__ */
|
|
3793
|
-
/* @__PURE__ */
|
|
3794
|
-
/* @__PURE__ */
|
|
3795
|
-
title && /* @__PURE__ */
|
|
4038
|
+
children: /* @__PURE__ */ jsxs14(AppView, { row: true, items: "center", px: 4, style: styles13.container, children: [
|
|
4039
|
+
/* @__PURE__ */ jsx36(AppView, { style: [styles13.sideContainer, styles13.leftContainer], children: leftIcon && /* @__PURE__ */ jsx36(AppPressable, { onPress: onLeftPress, style: styles13.iconButton, children: /* @__PURE__ */ jsx36(Icon, { name: leftIcon, size: 24, color: colors.text }) }) }),
|
|
4040
|
+
/* @__PURE__ */ jsxs14(AppView, { style: styles13.centerContainer, children: [
|
|
4041
|
+
title && /* @__PURE__ */ jsx36(
|
|
3796
4042
|
AppText,
|
|
3797
4043
|
{
|
|
3798
4044
|
size: "lg",
|
|
3799
4045
|
weight: "semibold",
|
|
3800
|
-
style: [
|
|
4046
|
+
style: [styles13.title, { color: colors.text }],
|
|
3801
4047
|
numberOfLines: 1,
|
|
3802
4048
|
children: title
|
|
3803
4049
|
}
|
|
3804
4050
|
),
|
|
3805
|
-
subtitle && /* @__PURE__ */
|
|
4051
|
+
subtitle && /* @__PURE__ */ jsx36(
|
|
3806
4052
|
AppText,
|
|
3807
4053
|
{
|
|
3808
4054
|
size: "xs",
|
|
3809
|
-
style: [
|
|
4055
|
+
style: [styles13.subtitle, { color: colors.textMuted }],
|
|
3810
4056
|
numberOfLines: 1,
|
|
3811
4057
|
children: subtitle
|
|
3812
4058
|
}
|
|
3813
4059
|
)
|
|
3814
4060
|
] }),
|
|
3815
|
-
/* @__PURE__ */
|
|
3816
|
-
/* @__PURE__ */
|
|
3817
|
-
icon.badge ? /* @__PURE__ */
|
|
4061
|
+
/* @__PURE__ */ jsx36(AppView, { row: true, items: "center", style: [styles13.sideContainer, styles13.rightContainer], children: rightIcons.map((icon, index) => /* @__PURE__ */ jsx36(AppPressable, { onPress: icon.onPress, style: styles13.iconButton, children: /* @__PURE__ */ jsxs14(AppView, { children: [
|
|
4062
|
+
/* @__PURE__ */ jsx36(Icon, { name: icon.icon, size: 24, color: colors.text }),
|
|
4063
|
+
icon.badge ? /* @__PURE__ */ jsx36(AppView, { style: styles13.badge, children: /* @__PURE__ */ jsx36(AppText, { size: "xs", color: "white", style: styles13.badgeText, children: icon.badge > 99 ? "99+" : icon.badge }) }) : null
|
|
3818
4064
|
] }) }, index)) })
|
|
3819
4065
|
] })
|
|
3820
4066
|
}
|
|
3821
4067
|
);
|
|
3822
4068
|
}
|
|
3823
|
-
var
|
|
4069
|
+
var styles13 = StyleSheet14.create({
|
|
3824
4070
|
container: {
|
|
3825
4071
|
height: 44
|
|
3826
4072
|
// iOS 标准导航栏高度
|
|
@@ -3871,9 +4117,9 @@ var styles12 = StyleSheet12.create({
|
|
|
3871
4117
|
});
|
|
3872
4118
|
|
|
3873
4119
|
// src/navigation/components/DrawerContent.tsx
|
|
3874
|
-
import { View as View9, TouchableOpacity as TouchableOpacity8, StyleSheet as
|
|
4120
|
+
import { View as View9, TouchableOpacity as TouchableOpacity8, StyleSheet as StyleSheet15 } from "react-native";
|
|
3875
4121
|
import { DrawerContentScrollView } from "@react-navigation/drawer";
|
|
3876
|
-
import { jsx as
|
|
4122
|
+
import { jsx as jsx37, jsxs as jsxs15 } from "nativewind/jsx-runtime";
|
|
3877
4123
|
function DrawerContent({
|
|
3878
4124
|
state,
|
|
3879
4125
|
descriptors,
|
|
@@ -3902,20 +4148,20 @@ function DrawerContent({
|
|
|
3902
4148
|
badge: options.tabBarBadge
|
|
3903
4149
|
};
|
|
3904
4150
|
});
|
|
3905
|
-
return /* @__PURE__ */
|
|
3906
|
-
header && /* @__PURE__ */
|
|
3907
|
-
/* @__PURE__ */
|
|
4151
|
+
return /* @__PURE__ */ jsxs15(DrawerContentScrollView, { style: [styles14.container, { backgroundColor }], children: [
|
|
4152
|
+
header && /* @__PURE__ */ jsx37(View9, { style: [styles14.header, { borderBottomColor: dividerColor }], children: header }),
|
|
4153
|
+
/* @__PURE__ */ jsx37(AppView, { className: "py-2", children: drawerItems.map((item) => {
|
|
3908
4154
|
const isFocused = state.routes[state.index].name === item.name;
|
|
3909
4155
|
const onPress = () => {
|
|
3910
4156
|
navigation.navigate(item.name);
|
|
3911
4157
|
};
|
|
3912
|
-
return /* @__PURE__ */
|
|
4158
|
+
return /* @__PURE__ */ jsxs15(
|
|
3913
4159
|
TouchableOpacity8,
|
|
3914
4160
|
{
|
|
3915
4161
|
onPress,
|
|
3916
|
-
style: [
|
|
4162
|
+
style: [styles14.item, isFocused && { backgroundColor: activeBgColor }],
|
|
3917
4163
|
children: [
|
|
3918
|
-
item.icon && /* @__PURE__ */
|
|
4164
|
+
item.icon && /* @__PURE__ */ jsx37(View9, { style: styles14.iconContainer, children: /* @__PURE__ */ jsx37(
|
|
3919
4165
|
Icon,
|
|
3920
4166
|
{
|
|
3921
4167
|
name: item.icon,
|
|
@@ -3923,28 +4169,28 @@ function DrawerContent({
|
|
|
3923
4169
|
color: isFocused ? activeColor : inactiveColor
|
|
3924
4170
|
}
|
|
3925
4171
|
) }),
|
|
3926
|
-
/* @__PURE__ */
|
|
4172
|
+
/* @__PURE__ */ jsx37(
|
|
3927
4173
|
AppText,
|
|
3928
4174
|
{
|
|
3929
4175
|
style: [
|
|
3930
|
-
|
|
4176
|
+
styles14.label,
|
|
3931
4177
|
{ color: isFocused ? activeColor : inactiveColor },
|
|
3932
|
-
isFocused &&
|
|
4178
|
+
isFocused && styles14.activeLabel
|
|
3933
4179
|
],
|
|
3934
4180
|
numberOfLines: 1,
|
|
3935
4181
|
children: item.label
|
|
3936
4182
|
}
|
|
3937
4183
|
),
|
|
3938
|
-
item.badge != null && /* @__PURE__ */
|
|
4184
|
+
item.badge != null && /* @__PURE__ */ jsx37(View9, { style: [styles14.badge, { backgroundColor: activeColor }], children: /* @__PURE__ */ jsx37(AppText, { style: styles14.badgeText, children: typeof item.badge === "number" && item.badge > 99 ? "99+" : item.badge }) })
|
|
3939
4185
|
]
|
|
3940
4186
|
},
|
|
3941
4187
|
item.name
|
|
3942
4188
|
);
|
|
3943
4189
|
}) }),
|
|
3944
|
-
footer && /* @__PURE__ */
|
|
4190
|
+
footer && /* @__PURE__ */ jsx37(View9, { style: [styles14.footer, { borderTopColor: dividerColor }], children: footer })
|
|
3945
4191
|
] });
|
|
3946
4192
|
}
|
|
3947
|
-
var
|
|
4193
|
+
var styles14 = StyleSheet15.create({
|
|
3948
4194
|
container: {
|
|
3949
4195
|
flex: 1
|
|
3950
4196
|
},
|
|
@@ -4047,7 +4293,7 @@ import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
|
4047
4293
|
|
|
4048
4294
|
// src/overlay/AppStatusBar.tsx
|
|
4049
4295
|
import { StatusBar } from "react-native";
|
|
4050
|
-
import { jsx as
|
|
4296
|
+
import { jsx as jsx38 } from "nativewind/jsx-runtime";
|
|
4051
4297
|
function AppStatusBar({
|
|
4052
4298
|
barStyle = "auto",
|
|
4053
4299
|
backgroundColor,
|
|
@@ -4057,7 +4303,7 @@ function AppStatusBar({
|
|
|
4057
4303
|
const { theme, isDark } = useTheme();
|
|
4058
4304
|
const resolvedBarStyle = barStyle === "auto" ? isDark ? "light-content" : "dark-content" : barStyle;
|
|
4059
4305
|
const resolvedBackgroundColor = backgroundColor ?? (translucent ? "transparent" : theme.colors.background?.[500] || "#ffffff");
|
|
4060
|
-
return /* @__PURE__ */
|
|
4306
|
+
return /* @__PURE__ */ jsx38(
|
|
4061
4307
|
StatusBar,
|
|
4062
4308
|
{
|
|
4063
4309
|
barStyle: resolvedBarStyle,
|
|
@@ -4069,7 +4315,7 @@ function AppStatusBar({
|
|
|
4069
4315
|
}
|
|
4070
4316
|
|
|
4071
4317
|
// src/overlay/loading/provider.tsx
|
|
4072
|
-
import { useState as
|
|
4318
|
+
import { useState as useState27, useCallback as useCallback19 } from "react";
|
|
4073
4319
|
|
|
4074
4320
|
// src/overlay/loading/context.ts
|
|
4075
4321
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
@@ -4081,15 +4327,15 @@ function useLoadingContext() {
|
|
|
4081
4327
|
}
|
|
4082
4328
|
|
|
4083
4329
|
// src/overlay/loading/component.tsx
|
|
4084
|
-
import { View as View10, Modal as
|
|
4085
|
-
import { jsx as
|
|
4330
|
+
import { View as View10, Modal as Modal5, ActivityIndicator as ActivityIndicator5, StyleSheet as StyleSheet16 } from "react-native";
|
|
4331
|
+
import { jsx as jsx39, jsxs as jsxs16 } from "nativewind/jsx-runtime";
|
|
4086
4332
|
function LoadingModal({ visible, text }) {
|
|
4087
|
-
return /* @__PURE__ */
|
|
4088
|
-
/* @__PURE__ */
|
|
4089
|
-
text && /* @__PURE__ */
|
|
4333
|
+
return /* @__PURE__ */ jsx39(Modal5, { transparent: true, visible, animationType: "fade", children: /* @__PURE__ */ jsx39(View10, { style: styles15.overlay, children: /* @__PURE__ */ jsxs16(View10, { style: [styles15.loadingBox, { backgroundColor: "rgba(0,0,0,0.8)" }], children: [
|
|
4334
|
+
/* @__PURE__ */ jsx39(ActivityIndicator5, { size: "large", color: "#fff" }),
|
|
4335
|
+
text && /* @__PURE__ */ jsx39(AppText, { className: "text-white mt-3 text-sm", children: text })
|
|
4090
4336
|
] }) }) });
|
|
4091
4337
|
}
|
|
4092
|
-
var
|
|
4338
|
+
var styles15 = StyleSheet16.create({
|
|
4093
4339
|
overlay: {
|
|
4094
4340
|
flex: 1,
|
|
4095
4341
|
backgroundColor: "rgba(0,0,0,0.5)",
|
|
@@ -4105,24 +4351,24 @@ var styles14 = StyleSheet14.create({
|
|
|
4105
4351
|
});
|
|
4106
4352
|
|
|
4107
4353
|
// src/overlay/loading/provider.tsx
|
|
4108
|
-
import { jsx as
|
|
4354
|
+
import { jsx as jsx40, jsxs as jsxs17 } from "nativewind/jsx-runtime";
|
|
4109
4355
|
function LoadingProvider({ children }) {
|
|
4110
|
-
const [state, setState] =
|
|
4111
|
-
const show =
|
|
4356
|
+
const [state, setState] = useState27({ visible: false });
|
|
4357
|
+
const show = useCallback19((text) => {
|
|
4112
4358
|
setState({ visible: true, text });
|
|
4113
4359
|
}, []);
|
|
4114
|
-
const hide =
|
|
4360
|
+
const hide = useCallback19(() => {
|
|
4115
4361
|
setState({ visible: false });
|
|
4116
4362
|
}, []);
|
|
4117
|
-
return /* @__PURE__ */
|
|
4363
|
+
return /* @__PURE__ */ jsxs17(LoadingContext.Provider, { value: { show, hide }, children: [
|
|
4118
4364
|
children,
|
|
4119
|
-
/* @__PURE__ */
|
|
4365
|
+
/* @__PURE__ */ jsx40(LoadingModal, { ...state })
|
|
4120
4366
|
] });
|
|
4121
4367
|
}
|
|
4122
4368
|
|
|
4123
4369
|
// src/overlay/toast/provider.tsx
|
|
4124
|
-
import { useState as
|
|
4125
|
-
import { View as View11, StyleSheet as
|
|
4370
|
+
import { useState as useState28, useCallback as useCallback20, useRef as useRef9 } from "react";
|
|
4371
|
+
import { View as View11, StyleSheet as StyleSheet17 } from "react-native";
|
|
4126
4372
|
|
|
4127
4373
|
// src/overlay/toast/context.ts
|
|
4128
4374
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
@@ -4136,7 +4382,7 @@ function useToastContext() {
|
|
|
4136
4382
|
// src/overlay/toast/component.tsx
|
|
4137
4383
|
import { useRef as useRef8, useEffect as useEffect11 } from "react";
|
|
4138
4384
|
import { Animated } from "react-native";
|
|
4139
|
-
import { jsx as
|
|
4385
|
+
import { jsx as jsx41 } from "nativewind/jsx-runtime";
|
|
4140
4386
|
function ToastItemView({ message, type, onHide }) {
|
|
4141
4387
|
const fadeAnim = useRef8(new Animated.Value(0)).current;
|
|
4142
4388
|
useEffect11(() => {
|
|
@@ -4152,7 +4398,7 @@ function ToastItemView({ message, type, onHide }) {
|
|
|
4152
4398
|
warning: "bg-warning-500",
|
|
4153
4399
|
info: "bg-primary-500"
|
|
4154
4400
|
};
|
|
4155
|
-
return /* @__PURE__ */
|
|
4401
|
+
return /* @__PURE__ */ jsx41(
|
|
4156
4402
|
Animated.View,
|
|
4157
4403
|
{
|
|
4158
4404
|
style: {
|
|
@@ -4166,17 +4412,17 @@ function ToastItemView({ message, type, onHide }) {
|
|
|
4166
4412
|
}
|
|
4167
4413
|
]
|
|
4168
4414
|
},
|
|
4169
|
-
children: /* @__PURE__ */
|
|
4415
|
+
children: /* @__PURE__ */ jsx41(AppView, { className: `${bgColors[type]} px-4 py-3 rounded-lg mb-2 mx-4 shadow-lg`, children: /* @__PURE__ */ jsx41(AppText, { className: "text-white text-center", children: message }) })
|
|
4170
4416
|
}
|
|
4171
4417
|
);
|
|
4172
4418
|
}
|
|
4173
4419
|
|
|
4174
4420
|
// src/overlay/toast/provider.tsx
|
|
4175
|
-
import { jsx as
|
|
4421
|
+
import { jsx as jsx42, jsxs as jsxs18 } from "nativewind/jsx-runtime";
|
|
4176
4422
|
function ToastProvider({ children }) {
|
|
4177
|
-
const [toasts, setToasts] =
|
|
4423
|
+
const [toasts, setToasts] = useState28([]);
|
|
4178
4424
|
const timersRef = useRef9(/* @__PURE__ */ new Map());
|
|
4179
|
-
const remove =
|
|
4425
|
+
const remove = useCallback20((id) => {
|
|
4180
4426
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
4181
4427
|
const timer = timersRef.current.get(id);
|
|
4182
4428
|
if (timer) {
|
|
@@ -4184,7 +4430,7 @@ function ToastProvider({ children }) {
|
|
|
4184
4430
|
timersRef.current.delete(id);
|
|
4185
4431
|
}
|
|
4186
4432
|
}, []);
|
|
4187
|
-
const show =
|
|
4433
|
+
const show = useCallback20(
|
|
4188
4434
|
(message, type = "info", duration = 3e3) => {
|
|
4189
4435
|
const id = Math.random().toString(36).substring(7);
|
|
4190
4436
|
const toast = { id, message, type, duration };
|
|
@@ -4194,28 +4440,28 @@ function ToastProvider({ children }) {
|
|
|
4194
4440
|
},
|
|
4195
4441
|
[remove]
|
|
4196
4442
|
);
|
|
4197
|
-
const success =
|
|
4443
|
+
const success = useCallback20(
|
|
4198
4444
|
(message, duration) => show(message, "success", duration),
|
|
4199
4445
|
[show]
|
|
4200
4446
|
);
|
|
4201
|
-
const error =
|
|
4447
|
+
const error = useCallback20(
|
|
4202
4448
|
(message, duration) => show(message, "error", duration),
|
|
4203
4449
|
[show]
|
|
4204
4450
|
);
|
|
4205
|
-
const info =
|
|
4451
|
+
const info = useCallback20(
|
|
4206
4452
|
(message, duration) => show(message, "info", duration),
|
|
4207
4453
|
[show]
|
|
4208
4454
|
);
|
|
4209
|
-
const warning =
|
|
4455
|
+
const warning = useCallback20(
|
|
4210
4456
|
(message, duration) => show(message, "warning", duration),
|
|
4211
4457
|
[show]
|
|
4212
4458
|
);
|
|
4213
|
-
return /* @__PURE__ */
|
|
4459
|
+
return /* @__PURE__ */ jsxs18(ToastContext.Provider, { value: { show, success, error, info, warning }, children: [
|
|
4214
4460
|
children,
|
|
4215
|
-
/* @__PURE__ */
|
|
4461
|
+
/* @__PURE__ */ jsx42(View11, { style: styles16.toastContainer, pointerEvents: "none", children: toasts.map((toast) => /* @__PURE__ */ jsx42(ToastItemView, { ...toast, onHide: () => remove(toast.id) }, toast.id)) })
|
|
4216
4462
|
] });
|
|
4217
4463
|
}
|
|
4218
|
-
var
|
|
4464
|
+
var styles16 = StyleSheet17.create({
|
|
4219
4465
|
toastContainer: {
|
|
4220
4466
|
position: "absolute",
|
|
4221
4467
|
top: 60,
|
|
@@ -4226,7 +4472,7 @@ var styles15 = StyleSheet15.create({
|
|
|
4226
4472
|
});
|
|
4227
4473
|
|
|
4228
4474
|
// src/overlay/alert/provider.tsx
|
|
4229
|
-
import { useState as
|
|
4475
|
+
import { useState as useState29, useCallback as useCallback21 } from "react";
|
|
4230
4476
|
|
|
4231
4477
|
// src/overlay/alert/context.ts
|
|
4232
4478
|
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
@@ -4238,8 +4484,8 @@ function useAlertContext() {
|
|
|
4238
4484
|
}
|
|
4239
4485
|
|
|
4240
4486
|
// src/overlay/alert/component.tsx
|
|
4241
|
-
import { View as View12, Modal as
|
|
4242
|
-
import { jsx as
|
|
4487
|
+
import { View as View12, Modal as Modal6, StyleSheet as StyleSheet18 } from "react-native";
|
|
4488
|
+
import { jsx as jsx43, jsxs as jsxs19 } from "nativewind/jsx-runtime";
|
|
4243
4489
|
function AlertModal({
|
|
4244
4490
|
visible,
|
|
4245
4491
|
title,
|
|
@@ -4251,16 +4497,16 @@ function AlertModal({
|
|
|
4251
4497
|
onCancel
|
|
4252
4498
|
}) {
|
|
4253
4499
|
if (!visible) return null;
|
|
4254
|
-
return /* @__PURE__ */
|
|
4255
|
-
title && /* @__PURE__ */
|
|
4256
|
-
message && /* @__PURE__ */
|
|
4257
|
-
/* @__PURE__ */
|
|
4258
|
-
showCancel && /* @__PURE__ */
|
|
4259
|
-
/* @__PURE__ */
|
|
4500
|
+
return /* @__PURE__ */ jsx43(Modal6, { transparent: true, visible: true, animationType: "fade", children: /* @__PURE__ */ jsx43(View12, { style: styles17.overlay, children: /* @__PURE__ */ jsxs19(View12, { style: styles17.alertBox, children: [
|
|
4501
|
+
title && /* @__PURE__ */ jsx43(AppText, { className: "text-lg font-semibold text-center mb-2", children: title }),
|
|
4502
|
+
message && /* @__PURE__ */ jsx43(AppText, { className: "text-gray-600 text-center mb-4", children: message }),
|
|
4503
|
+
/* @__PURE__ */ jsxs19(AppView, { row: true, gap: 3, className: "mt-2", children: [
|
|
4504
|
+
showCancel && /* @__PURE__ */ jsx43(AppPressable, { onPress: onCancel, className: "flex-1 py-3 bg-gray-100 rounded-lg", children: /* @__PURE__ */ jsx43(AppText, { className: "text-center text-gray-700", children: cancelText || "\u53D6\u6D88" }) }),
|
|
4505
|
+
/* @__PURE__ */ jsx43(AppPressable, { onPress: onConfirm, className: "flex-1 py-3 bg-primary-500 rounded-lg", children: /* @__PURE__ */ jsx43(AppText, { className: "text-center text-white", children: confirmText || "\u786E\u5B9A" }) })
|
|
4260
4506
|
] })
|
|
4261
4507
|
] }) }) });
|
|
4262
4508
|
}
|
|
4263
|
-
var
|
|
4509
|
+
var styles17 = StyleSheet18.create({
|
|
4264
4510
|
overlay: {
|
|
4265
4511
|
flex: 1,
|
|
4266
4512
|
backgroundColor: "rgba(0,0,0,0.5)",
|
|
@@ -4282,32 +4528,32 @@ var styles16 = StyleSheet16.create({
|
|
|
4282
4528
|
});
|
|
4283
4529
|
|
|
4284
4530
|
// src/overlay/alert/provider.tsx
|
|
4285
|
-
import { jsx as
|
|
4531
|
+
import { jsx as jsx44, jsxs as jsxs20 } from "nativewind/jsx-runtime";
|
|
4286
4532
|
function AlertProvider({ children }) {
|
|
4287
|
-
const [alert, setAlert] =
|
|
4288
|
-
const showAlert =
|
|
4533
|
+
const [alert, setAlert] = useState29(null);
|
|
4534
|
+
const showAlert = useCallback21((options) => {
|
|
4289
4535
|
setAlert({ ...options, visible: true });
|
|
4290
4536
|
}, []);
|
|
4291
|
-
const confirm =
|
|
4537
|
+
const confirm = useCallback21(
|
|
4292
4538
|
(options) => {
|
|
4293
4539
|
showAlert({ ...options, showCancel: true });
|
|
4294
4540
|
},
|
|
4295
4541
|
[showAlert]
|
|
4296
4542
|
);
|
|
4297
|
-
const hide =
|
|
4543
|
+
const hide = useCallback21(() => {
|
|
4298
4544
|
setAlert(null);
|
|
4299
4545
|
}, []);
|
|
4300
|
-
const handleConfirm =
|
|
4546
|
+
const handleConfirm = useCallback21(() => {
|
|
4301
4547
|
alert?.onConfirm?.();
|
|
4302
4548
|
hide();
|
|
4303
4549
|
}, [alert, hide]);
|
|
4304
|
-
const handleCancel =
|
|
4550
|
+
const handleCancel = useCallback21(() => {
|
|
4305
4551
|
alert?.onCancel?.();
|
|
4306
4552
|
hide();
|
|
4307
4553
|
}, [alert, hide]);
|
|
4308
|
-
return /* @__PURE__ */
|
|
4554
|
+
return /* @__PURE__ */ jsxs20(AlertContext.Provider, { value: { alert: showAlert, confirm }, children: [
|
|
4309
4555
|
children,
|
|
4310
|
-
/* @__PURE__ */
|
|
4556
|
+
/* @__PURE__ */ jsx44(
|
|
4311
4557
|
AlertModal,
|
|
4312
4558
|
{
|
|
4313
4559
|
visible: alert?.visible ?? false,
|
|
@@ -4324,13 +4570,13 @@ function AlertProvider({ children }) {
|
|
|
4324
4570
|
}
|
|
4325
4571
|
|
|
4326
4572
|
// src/overlay/provider.tsx
|
|
4327
|
-
import { jsx as
|
|
4573
|
+
import { jsx as jsx45 } from "nativewind/jsx-runtime";
|
|
4328
4574
|
function OverlayProvider({ children }) {
|
|
4329
|
-
return /* @__PURE__ */
|
|
4575
|
+
return /* @__PURE__ */ jsx45(LoadingProvider, { children: /* @__PURE__ */ jsx45(ToastProvider, { children: /* @__PURE__ */ jsx45(AlertProvider, { children }) }) });
|
|
4330
4576
|
}
|
|
4331
4577
|
|
|
4332
4578
|
// src/overlay/AppProvider.tsx
|
|
4333
|
-
import { Fragment as Fragment4, jsx as
|
|
4579
|
+
import { Fragment as Fragment4, jsx as jsx46, jsxs as jsxs21 } from "nativewind/jsx-runtime";
|
|
4334
4580
|
var defaultLightTheme = {
|
|
4335
4581
|
colors: {
|
|
4336
4582
|
primary: "#f38b32",
|
|
@@ -4367,21 +4613,21 @@ function AppProvider({
|
|
|
4367
4613
|
}) {
|
|
4368
4614
|
let content = children;
|
|
4369
4615
|
if (enableOverlay) {
|
|
4370
|
-
content = /* @__PURE__ */
|
|
4616
|
+
content = /* @__PURE__ */ jsx46(OverlayProvider, { children: content });
|
|
4371
4617
|
}
|
|
4372
4618
|
if (enableNavigation) {
|
|
4373
|
-
content = /* @__PURE__ */
|
|
4619
|
+
content = /* @__PURE__ */ jsx46(NavigationProvider, { ...navigationProps, children: content });
|
|
4374
4620
|
}
|
|
4375
4621
|
if (enableTheme) {
|
|
4376
|
-
content = /* @__PURE__ */
|
|
4377
|
-
enableStatusBar && /* @__PURE__ */
|
|
4622
|
+
content = /* @__PURE__ */ jsx46(ThemeProvider, { light: lightTheme, dark: darkTheme, defaultDark, isDark, children: /* @__PURE__ */ jsxs21(Fragment4, { children: [
|
|
4623
|
+
enableStatusBar && /* @__PURE__ */ jsx46(AppStatusBar, { testID: "status-bar", ...statusBarProps }),
|
|
4378
4624
|
content
|
|
4379
4625
|
] }) });
|
|
4380
4626
|
}
|
|
4381
4627
|
if (enableSafeArea) {
|
|
4382
|
-
content = /* @__PURE__ */
|
|
4628
|
+
content = /* @__PURE__ */ jsx46(SafeAreaProvider, { children: content });
|
|
4383
4629
|
}
|
|
4384
|
-
return /* @__PURE__ */
|
|
4630
|
+
return /* @__PURE__ */ jsx46(Fragment4, { children: content });
|
|
4385
4631
|
}
|
|
4386
4632
|
|
|
4387
4633
|
// src/overlay/loading/hooks.ts
|
|
@@ -4427,6 +4673,7 @@ export {
|
|
|
4427
4673
|
ErrorCode,
|
|
4428
4674
|
FileIcons,
|
|
4429
4675
|
FormItem,
|
|
4676
|
+
GradientView,
|
|
4430
4677
|
Icon,
|
|
4431
4678
|
Loading,
|
|
4432
4679
|
MemoryStorage,
|
|
@@ -4435,6 +4682,7 @@ export {
|
|
|
4435
4682
|
NavigationProvider,
|
|
4436
4683
|
OverlayProvider,
|
|
4437
4684
|
Page,
|
|
4685
|
+
PageDrawer,
|
|
4438
4686
|
Progress,
|
|
4439
4687
|
Radio,
|
|
4440
4688
|
RadioGroup,
|
|
@@ -4500,6 +4748,7 @@ export {
|
|
|
4500
4748
|
useNavigation,
|
|
4501
4749
|
useNavigationState,
|
|
4502
4750
|
useOrientation,
|
|
4751
|
+
usePageDrawer,
|
|
4503
4752
|
usePagination,
|
|
4504
4753
|
usePrevious,
|
|
4505
4754
|
useQuery,
|