@gaozh1024/rn-kit 0.3.3 → 0.3.4
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 +106 -11
- package/TAILWIND_SETUP.md +1 -0
- package/dist/index.d.mts +23 -5
- package/dist/index.d.ts +23 -5
- package/dist/index.js +388 -363
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +350 -326
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -989,6 +989,7 @@ import { jsx as jsx2 } from "nativewind/jsx-runtime";
|
|
|
989
989
|
function AppView({
|
|
990
990
|
flex,
|
|
991
991
|
row,
|
|
992
|
+
wrap,
|
|
992
993
|
center,
|
|
993
994
|
between,
|
|
994
995
|
items,
|
|
@@ -1015,6 +1016,7 @@ function AppView({
|
|
|
1015
1016
|
flex === true && "flex-1",
|
|
1016
1017
|
typeof flex === "number" && `flex-${flex}`,
|
|
1017
1018
|
row ? "flex-row" : "flex-col",
|
|
1019
|
+
wrap && "flex-wrap",
|
|
1018
1020
|
center && "items-center justify-center",
|
|
1019
1021
|
between && "justify-between",
|
|
1020
1022
|
items && `items-${items}`,
|
|
@@ -1208,6 +1210,7 @@ function SafeScreen({
|
|
|
1208
1210
|
left = false,
|
|
1209
1211
|
right = false,
|
|
1210
1212
|
bg,
|
|
1213
|
+
surface,
|
|
1211
1214
|
flex = true,
|
|
1212
1215
|
className,
|
|
1213
1216
|
children,
|
|
@@ -1216,7 +1219,7 @@ function SafeScreen({
|
|
|
1216
1219
|
}) {
|
|
1217
1220
|
const insets = useSafeAreaInsets();
|
|
1218
1221
|
const { theme, isDark } = useOptionalTheme();
|
|
1219
|
-
const resolvedBgColor = resolveNamedColor(bg, theme, isDark);
|
|
1222
|
+
const resolvedBgColor = resolveSurfaceColor(surface, theme, isDark) ?? resolveNamedColor(bg, theme, isDark);
|
|
1220
1223
|
const shouldUseClassBg = !!bg && !resolvedBgColor;
|
|
1221
1224
|
return /* @__PURE__ */ jsx9(
|
|
1222
1225
|
View2,
|
|
@@ -1248,7 +1251,7 @@ function AppScreen({
|
|
|
1248
1251
|
className,
|
|
1249
1252
|
...props
|
|
1250
1253
|
}) {
|
|
1251
|
-
return /* @__PURE__ */ jsx9(SafeScreen, { flex: true,
|
|
1254
|
+
return /* @__PURE__ */ jsx9(SafeScreen, { flex: true, surface: "background", ...props, className, children });
|
|
1252
1255
|
}
|
|
1253
1256
|
function SafeBottom({
|
|
1254
1257
|
children,
|
|
@@ -1277,7 +1280,12 @@ function AppButton({
|
|
|
1277
1280
|
const buttonColors = {
|
|
1278
1281
|
primary: theme.colors.primary?.[500] || "#f38b32",
|
|
1279
1282
|
secondary: theme.colors.secondary?.[500] || "#3b82f6",
|
|
1280
|
-
|
|
1283
|
+
success: theme.colors.success?.[500] || "#22c55e",
|
|
1284
|
+
warning: theme.colors.warning?.[500] || "#f59e0b",
|
|
1285
|
+
info: theme.colors.info?.[500] || theme.colors.secondary?.[500] || "#3b82f6",
|
|
1286
|
+
error: theme.colors.error?.[500] || "#ef4444",
|
|
1287
|
+
danger: theme.colors.error?.[500] || "#ef4444",
|
|
1288
|
+
muted: isDark ? "#6b7280" : "#9ca3af"
|
|
1281
1289
|
};
|
|
1282
1290
|
const ghostTextColor = isDark ? "#ffffff" : theme.colors.text?.[500] || "#1f2937";
|
|
1283
1291
|
const ghostBackgroundColor = isDark ? "rgba(255,255,255,0.04)" : "transparent";
|
|
@@ -1538,6 +1546,10 @@ import { View as View3 } from "react-native";
|
|
|
1538
1546
|
import { jsx as jsx15 } from "nativewind/jsx-runtime";
|
|
1539
1547
|
function Card({
|
|
1540
1548
|
children,
|
|
1549
|
+
p,
|
|
1550
|
+
px,
|
|
1551
|
+
py,
|
|
1552
|
+
gap,
|
|
1541
1553
|
className,
|
|
1542
1554
|
style,
|
|
1543
1555
|
noShadow = false,
|
|
@@ -1553,6 +1565,10 @@ function Card({
|
|
|
1553
1565
|
!noRadius && "rounded-lg",
|
|
1554
1566
|
!noShadow && "shadow-sm",
|
|
1555
1567
|
"overflow-hidden",
|
|
1568
|
+
p !== void 0 && `p-${p}`,
|
|
1569
|
+
px !== void 0 && `px-${px}`,
|
|
1570
|
+
py !== void 0 && `py-${py}`,
|
|
1571
|
+
gap !== void 0 && `gap-${gap}`,
|
|
1556
1572
|
className
|
|
1557
1573
|
),
|
|
1558
1574
|
style: [
|
|
@@ -2280,6 +2296,8 @@ var AppInput = forwardRef(
|
|
|
2280
2296
|
}
|
|
2281
2297
|
);
|
|
2282
2298
|
AppInput.displayName = "AppInput";
|
|
2299
|
+
var AppTextInput = AppInput;
|
|
2300
|
+
AppTextInput.displayName = "AppTextInput";
|
|
2283
2301
|
var styles5 = StyleSheet6.create({
|
|
2284
2302
|
inputContainer: {
|
|
2285
2303
|
borderWidth: 0.5,
|
|
@@ -4043,292 +4061,16 @@ function createDrawerScreens(routes) {
|
|
|
4043
4061
|
}
|
|
4044
4062
|
|
|
4045
4063
|
// src/navigation/components/AppHeader.tsx
|
|
4046
|
-
import { StyleSheet as
|
|
4064
|
+
import { StyleSheet as StyleSheet17 } from "react-native";
|
|
4047
4065
|
import { useSafeAreaInsets as useSafeAreaInsets3 } from "react-native-safe-area-context";
|
|
4048
|
-
import { jsx as jsx36, jsxs as jsxs14 } from "nativewind/jsx-runtime";
|
|
4049
|
-
function AppHeader({
|
|
4050
|
-
title,
|
|
4051
|
-
subtitle,
|
|
4052
|
-
leftIcon = "chevron-left",
|
|
4053
|
-
onLeftPress,
|
|
4054
|
-
rightIcons = [],
|
|
4055
|
-
transparent = false,
|
|
4056
|
-
safeArea = true,
|
|
4057
|
-
style
|
|
4058
|
-
}) {
|
|
4059
|
-
const colors = useThemeColors();
|
|
4060
|
-
const insets = useSafeAreaInsets3();
|
|
4061
|
-
const backgroundColor = transparent ? "transparent" : colors.card;
|
|
4062
|
-
return /* @__PURE__ */ jsx36(
|
|
4063
|
-
AppView,
|
|
4064
|
-
{
|
|
4065
|
-
style: [
|
|
4066
|
-
{
|
|
4067
|
-
backgroundColor,
|
|
4068
|
-
paddingTop: safeArea ? insets.top : 0
|
|
4069
|
-
},
|
|
4070
|
-
style
|
|
4071
|
-
],
|
|
4072
|
-
children: /* @__PURE__ */ jsxs14(AppView, { row: true, items: "center", px: 4, style: styles13.container, children: [
|
|
4073
|
-
/* @__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 }) }) }),
|
|
4074
|
-
/* @__PURE__ */ jsxs14(AppView, { style: styles13.centerContainer, children: [
|
|
4075
|
-
title && /* @__PURE__ */ jsx36(
|
|
4076
|
-
AppText,
|
|
4077
|
-
{
|
|
4078
|
-
size: "lg",
|
|
4079
|
-
weight: "semibold",
|
|
4080
|
-
style: [styles13.title, { color: colors.text }],
|
|
4081
|
-
numberOfLines: 1,
|
|
4082
|
-
children: title
|
|
4083
|
-
}
|
|
4084
|
-
),
|
|
4085
|
-
subtitle && /* @__PURE__ */ jsx36(
|
|
4086
|
-
AppText,
|
|
4087
|
-
{
|
|
4088
|
-
size: "xs",
|
|
4089
|
-
style: [styles13.subtitle, { color: colors.textMuted }],
|
|
4090
|
-
numberOfLines: 1,
|
|
4091
|
-
children: subtitle
|
|
4092
|
-
}
|
|
4093
|
-
)
|
|
4094
|
-
] }),
|
|
4095
|
-
/* @__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: [
|
|
4096
|
-
/* @__PURE__ */ jsx36(Icon, { name: icon.icon, size: 24, color: colors.text }),
|
|
4097
|
-
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
|
|
4098
|
-
] }) }, index)) })
|
|
4099
|
-
] })
|
|
4100
|
-
}
|
|
4101
|
-
);
|
|
4102
|
-
}
|
|
4103
|
-
var styles13 = StyleSheet14.create({
|
|
4104
|
-
container: {
|
|
4105
|
-
height: 44
|
|
4106
|
-
// iOS 标准导航栏高度
|
|
4107
|
-
},
|
|
4108
|
-
sideContainer: {
|
|
4109
|
-
width: 70,
|
|
4110
|
-
// 固定宽度,确保标题居中
|
|
4111
|
-
flexDirection: "row",
|
|
4112
|
-
alignItems: "center"
|
|
4113
|
-
},
|
|
4114
|
-
leftContainer: {
|
|
4115
|
-
justifyContent: "flex-start"
|
|
4116
|
-
},
|
|
4117
|
-
rightContainer: {
|
|
4118
|
-
justifyContent: "flex-end"
|
|
4119
|
-
},
|
|
4120
|
-
centerContainer: {
|
|
4121
|
-
flex: 1,
|
|
4122
|
-
alignItems: "center",
|
|
4123
|
-
justifyContent: "center"
|
|
4124
|
-
},
|
|
4125
|
-
title: {
|
|
4126
|
-
textAlign: "center"
|
|
4127
|
-
},
|
|
4128
|
-
subtitle: {
|
|
4129
|
-
textAlign: "center",
|
|
4130
|
-
marginTop: 2
|
|
4131
|
-
},
|
|
4132
|
-
iconButton: {
|
|
4133
|
-
padding: 8
|
|
4134
|
-
},
|
|
4135
|
-
badge: {
|
|
4136
|
-
position: "absolute",
|
|
4137
|
-
top: -4,
|
|
4138
|
-
right: -4,
|
|
4139
|
-
minWidth: 16,
|
|
4140
|
-
height: 16,
|
|
4141
|
-
borderRadius: 8,
|
|
4142
|
-
backgroundColor: "#ef4444",
|
|
4143
|
-
alignItems: "center",
|
|
4144
|
-
justifyContent: "center",
|
|
4145
|
-
paddingHorizontal: 4
|
|
4146
|
-
},
|
|
4147
|
-
badgeText: {
|
|
4148
|
-
fontSize: 10,
|
|
4149
|
-
fontWeight: "bold"
|
|
4150
|
-
}
|
|
4151
|
-
});
|
|
4152
|
-
|
|
4153
|
-
// src/navigation/components/DrawerContent.tsx
|
|
4154
|
-
import { View as View9, TouchableOpacity as TouchableOpacity8, StyleSheet as StyleSheet15 } from "react-native";
|
|
4155
|
-
import { DrawerContentScrollView } from "@react-navigation/drawer";
|
|
4156
|
-
import { jsx as jsx37, jsxs as jsxs15 } from "nativewind/jsx-runtime";
|
|
4157
|
-
function DrawerContent({
|
|
4158
|
-
state,
|
|
4159
|
-
descriptors,
|
|
4160
|
-
navigation,
|
|
4161
|
-
header,
|
|
4162
|
-
footer,
|
|
4163
|
-
items,
|
|
4164
|
-
activeBackgroundColor,
|
|
4165
|
-
activeTintColor,
|
|
4166
|
-
inactiveTintColor
|
|
4167
|
-
}) {
|
|
4168
|
-
const { theme, isDark } = useTheme();
|
|
4169
|
-
const colors = useThemeColors();
|
|
4170
|
-
const activeBgColor = activeBackgroundColor || (isDark ? colors.primarySurface : theme.colors.primary?.[50] || "#fff7ed");
|
|
4171
|
-
const activeColor = activeTintColor || colors.primary;
|
|
4172
|
-
const inactiveColor = inactiveTintColor || (isDark ? "#d1d5db" : "#4b5563");
|
|
4173
|
-
const backgroundColor = colors.card;
|
|
4174
|
-
const dividerColor = colors.divider;
|
|
4175
|
-
const drawerItems = items || state.routes.map((route) => {
|
|
4176
|
-
const descriptor = descriptors[route.key];
|
|
4177
|
-
const options = descriptor.options;
|
|
4178
|
-
return {
|
|
4179
|
-
name: route.name,
|
|
4180
|
-
label: options.drawerLabel || options.title || route.name,
|
|
4181
|
-
icon: options.drawerIcon?.({ size: 24, color: inactiveColor })?.props?.name,
|
|
4182
|
-
badge: options.tabBarBadge
|
|
4183
|
-
};
|
|
4184
|
-
});
|
|
4185
|
-
return /* @__PURE__ */ jsxs15(DrawerContentScrollView, { style: [styles14.container, { backgroundColor }], children: [
|
|
4186
|
-
header && /* @__PURE__ */ jsx37(View9, { style: [styles14.header, { borderBottomColor: dividerColor }], children: header }),
|
|
4187
|
-
/* @__PURE__ */ jsx37(AppView, { className: "py-2", children: drawerItems.map((item) => {
|
|
4188
|
-
const isFocused = state.routes[state.index].name === item.name;
|
|
4189
|
-
const onPress = () => {
|
|
4190
|
-
navigation.navigate(item.name);
|
|
4191
|
-
};
|
|
4192
|
-
return /* @__PURE__ */ jsxs15(
|
|
4193
|
-
TouchableOpacity8,
|
|
4194
|
-
{
|
|
4195
|
-
onPress,
|
|
4196
|
-
style: [styles14.item, isFocused && { backgroundColor: activeBgColor }],
|
|
4197
|
-
children: [
|
|
4198
|
-
item.icon && /* @__PURE__ */ jsx37(View9, { style: styles14.iconContainer, children: /* @__PURE__ */ jsx37(
|
|
4199
|
-
Icon,
|
|
4200
|
-
{
|
|
4201
|
-
name: item.icon,
|
|
4202
|
-
size: "md",
|
|
4203
|
-
color: isFocused ? activeColor : inactiveColor
|
|
4204
|
-
}
|
|
4205
|
-
) }),
|
|
4206
|
-
/* @__PURE__ */ jsx37(
|
|
4207
|
-
AppText,
|
|
4208
|
-
{
|
|
4209
|
-
style: [
|
|
4210
|
-
styles14.label,
|
|
4211
|
-
{ color: isFocused ? activeColor : inactiveColor },
|
|
4212
|
-
isFocused && styles14.activeLabel
|
|
4213
|
-
],
|
|
4214
|
-
numberOfLines: 1,
|
|
4215
|
-
children: item.label
|
|
4216
|
-
}
|
|
4217
|
-
),
|
|
4218
|
-
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 }) })
|
|
4219
|
-
]
|
|
4220
|
-
},
|
|
4221
|
-
item.name
|
|
4222
|
-
);
|
|
4223
|
-
}) }),
|
|
4224
|
-
footer && /* @__PURE__ */ jsx37(View9, { style: [styles14.footer, { borderTopColor: dividerColor }], children: footer })
|
|
4225
|
-
] });
|
|
4226
|
-
}
|
|
4227
|
-
var styles14 = StyleSheet15.create({
|
|
4228
|
-
container: {
|
|
4229
|
-
flex: 1
|
|
4230
|
-
},
|
|
4231
|
-
header: {
|
|
4232
|
-
padding: 16,
|
|
4233
|
-
borderBottomWidth: 0.5
|
|
4234
|
-
},
|
|
4235
|
-
item: {
|
|
4236
|
-
flexDirection: "row",
|
|
4237
|
-
alignItems: "center",
|
|
4238
|
-
paddingHorizontal: 16,
|
|
4239
|
-
paddingVertical: 12,
|
|
4240
|
-
marginHorizontal: 8,
|
|
4241
|
-
marginVertical: 2,
|
|
4242
|
-
borderRadius: 8
|
|
4243
|
-
},
|
|
4244
|
-
iconContainer: {
|
|
4245
|
-
width: 32,
|
|
4246
|
-
alignItems: "center",
|
|
4247
|
-
marginRight: 8
|
|
4248
|
-
},
|
|
4249
|
-
label: {
|
|
4250
|
-
flex: 1,
|
|
4251
|
-
fontSize: 16
|
|
4252
|
-
},
|
|
4253
|
-
activeLabel: {
|
|
4254
|
-
fontWeight: "600"
|
|
4255
|
-
},
|
|
4256
|
-
badge: {
|
|
4257
|
-
minWidth: 20,
|
|
4258
|
-
height: 20,
|
|
4259
|
-
borderRadius: 10,
|
|
4260
|
-
justifyContent: "center",
|
|
4261
|
-
alignItems: "center",
|
|
4262
|
-
paddingHorizontal: 6
|
|
4263
|
-
},
|
|
4264
|
-
badgeText: {
|
|
4265
|
-
color: "#fff",
|
|
4266
|
-
fontSize: 12,
|
|
4267
|
-
fontWeight: "bold"
|
|
4268
|
-
},
|
|
4269
|
-
footer: {
|
|
4270
|
-
marginTop: "auto",
|
|
4271
|
-
padding: 16,
|
|
4272
|
-
borderTopWidth: 0.5
|
|
4273
|
-
}
|
|
4274
|
-
});
|
|
4275
|
-
|
|
4276
|
-
// src/navigation/hooks/useNavigation.ts
|
|
4277
|
-
import { useEffect as useEffect10 } from "react";
|
|
4278
|
-
import { useNavigation as useRNNavigation } from "@react-navigation/native";
|
|
4279
|
-
function useNavigation() {
|
|
4280
|
-
return useRNNavigation();
|
|
4281
|
-
}
|
|
4282
|
-
function useStackNavigation() {
|
|
4283
|
-
return useRNNavigation();
|
|
4284
|
-
}
|
|
4285
|
-
function useTabNavigation() {
|
|
4286
|
-
return useRNNavigation();
|
|
4287
|
-
}
|
|
4288
|
-
function useDrawerNavigation() {
|
|
4289
|
-
return useRNNavigation();
|
|
4290
|
-
}
|
|
4291
|
-
function useBackHandler(handler) {
|
|
4292
|
-
const navigation = useRNNavigation();
|
|
4293
|
-
useEffect10(() => {
|
|
4294
|
-
const unsubscribe = navigation.addListener("beforeRemove", (e) => {
|
|
4295
|
-
if (!handler()) {
|
|
4296
|
-
e.preventDefault();
|
|
4297
|
-
}
|
|
4298
|
-
});
|
|
4299
|
-
return unsubscribe;
|
|
4300
|
-
}, [navigation, handler]);
|
|
4301
|
-
}
|
|
4302
|
-
|
|
4303
|
-
// src/navigation/hooks/useRoute.ts
|
|
4304
|
-
import { useRoute as useRNRoute } from "@react-navigation/native";
|
|
4305
|
-
function useRoute() {
|
|
4306
|
-
return useRNRoute();
|
|
4307
|
-
}
|
|
4308
|
-
|
|
4309
|
-
// src/navigation/hooks/useNavigationState.ts
|
|
4310
|
-
import {
|
|
4311
|
-
useNavigationState as useRNNavigationState,
|
|
4312
|
-
useIsFocused,
|
|
4313
|
-
useFocusEffect,
|
|
4314
|
-
useScrollToTop
|
|
4315
|
-
} from "@react-navigation/native";
|
|
4316
|
-
function useNavigationState(selector) {
|
|
4317
|
-
return useRNNavigationState(selector);
|
|
4318
|
-
}
|
|
4319
|
-
|
|
4320
|
-
// src/navigation/index.ts
|
|
4321
|
-
import {
|
|
4322
|
-
NavigationContainer as NavigationContainer2
|
|
4323
|
-
} from "@react-navigation/native";
|
|
4324
4066
|
|
|
4325
4067
|
// src/overlay/AppProvider.tsx
|
|
4326
4068
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
4327
4069
|
|
|
4328
4070
|
// src/overlay/AppStatusBar.tsx
|
|
4329
4071
|
import { StatusBar } from "react-native";
|
|
4330
|
-
import { useIsFocused
|
|
4331
|
-
import { jsx as
|
|
4072
|
+
import { useIsFocused } from "@react-navigation/native";
|
|
4073
|
+
import { jsx as jsx36 } from "nativewind/jsx-runtime";
|
|
4332
4074
|
function AppStatusBar({
|
|
4333
4075
|
barStyle = "auto",
|
|
4334
4076
|
backgroundColor,
|
|
@@ -4338,7 +4080,7 @@ function AppStatusBar({
|
|
|
4338
4080
|
const { theme, isDark } = useTheme();
|
|
4339
4081
|
const resolvedBarStyle = barStyle === "auto" ? isDark ? "light-content" : "dark-content" : barStyle;
|
|
4340
4082
|
const resolvedBackgroundColor = backgroundColor ?? (translucent ? "transparent" : theme.colors.background?.[500] || "#ffffff");
|
|
4341
|
-
return /* @__PURE__ */
|
|
4083
|
+
return /* @__PURE__ */ jsx36(
|
|
4342
4084
|
StatusBar,
|
|
4343
4085
|
{
|
|
4344
4086
|
barStyle: resolvedBarStyle,
|
|
@@ -4349,9 +4091,9 @@ function AppStatusBar({
|
|
|
4349
4091
|
);
|
|
4350
4092
|
}
|
|
4351
4093
|
function AppFocusedStatusBar(props) {
|
|
4352
|
-
const isFocused =
|
|
4094
|
+
const isFocused = useIsFocused();
|
|
4353
4095
|
if (!isFocused) return null;
|
|
4354
|
-
return /* @__PURE__ */
|
|
4096
|
+
return /* @__PURE__ */ jsx36(AppStatusBar, { ...props });
|
|
4355
4097
|
}
|
|
4356
4098
|
|
|
4357
4099
|
// src/overlay/loading/provider.tsx
|
|
@@ -4367,15 +4109,15 @@ function useLoadingContext() {
|
|
|
4367
4109
|
}
|
|
4368
4110
|
|
|
4369
4111
|
// src/overlay/loading/component.tsx
|
|
4370
|
-
import { View as
|
|
4371
|
-
import { jsx as
|
|
4112
|
+
import { View as View9, Modal as Modal5, ActivityIndicator as ActivityIndicator5, StyleSheet as StyleSheet14 } from "react-native";
|
|
4113
|
+
import { jsx as jsx37, jsxs as jsxs14 } from "nativewind/jsx-runtime";
|
|
4372
4114
|
function LoadingModal({ visible, text }) {
|
|
4373
|
-
return /* @__PURE__ */
|
|
4374
|
-
/* @__PURE__ */
|
|
4375
|
-
text && /* @__PURE__ */
|
|
4115
|
+
return /* @__PURE__ */ jsx37(Modal5, { transparent: true, visible, animationType: "fade", children: /* @__PURE__ */ jsx37(View9, { style: styles13.overlay, children: /* @__PURE__ */ jsxs14(View9, { style: [styles13.loadingBox, { backgroundColor: "rgba(0,0,0,0.8)" }], children: [
|
|
4116
|
+
/* @__PURE__ */ jsx37(ActivityIndicator5, { size: "large", color: "#fff" }),
|
|
4117
|
+
text && /* @__PURE__ */ jsx37(AppText, { className: "text-white mt-3 text-sm", children: text })
|
|
4376
4118
|
] }) }) });
|
|
4377
4119
|
}
|
|
4378
|
-
var
|
|
4120
|
+
var styles13 = StyleSheet14.create({
|
|
4379
4121
|
overlay: {
|
|
4380
4122
|
flex: 1,
|
|
4381
4123
|
backgroundColor: "rgba(0,0,0,0.5)",
|
|
@@ -4391,7 +4133,7 @@ var styles15 = StyleSheet16.create({
|
|
|
4391
4133
|
});
|
|
4392
4134
|
|
|
4393
4135
|
// src/overlay/loading/provider.tsx
|
|
4394
|
-
import { jsx as
|
|
4136
|
+
import { jsx as jsx38, jsxs as jsxs15 } from "nativewind/jsx-runtime";
|
|
4395
4137
|
function LoadingProvider({ children }) {
|
|
4396
4138
|
const [state, setState] = useState27({ visible: false });
|
|
4397
4139
|
const show = useCallback19((text) => {
|
|
@@ -4400,15 +4142,15 @@ function LoadingProvider({ children }) {
|
|
|
4400
4142
|
const hide = useCallback19(() => {
|
|
4401
4143
|
setState({ visible: false });
|
|
4402
4144
|
}, []);
|
|
4403
|
-
return /* @__PURE__ */
|
|
4145
|
+
return /* @__PURE__ */ jsxs15(LoadingContext.Provider, { value: { show, hide }, children: [
|
|
4404
4146
|
children,
|
|
4405
|
-
/* @__PURE__ */
|
|
4147
|
+
/* @__PURE__ */ jsx38(LoadingModal, { ...state })
|
|
4406
4148
|
] });
|
|
4407
4149
|
}
|
|
4408
4150
|
|
|
4409
4151
|
// src/overlay/toast/provider.tsx
|
|
4410
4152
|
import { useState as useState28, useCallback as useCallback20, useRef as useRef9 } from "react";
|
|
4411
|
-
import { View as
|
|
4153
|
+
import { View as View10, StyleSheet as StyleSheet15 } from "react-native";
|
|
4412
4154
|
|
|
4413
4155
|
// src/overlay/toast/context.ts
|
|
4414
4156
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
@@ -4420,12 +4162,12 @@ function useToastContext() {
|
|
|
4420
4162
|
}
|
|
4421
4163
|
|
|
4422
4164
|
// src/overlay/toast/component.tsx
|
|
4423
|
-
import { useRef as useRef8, useEffect as
|
|
4165
|
+
import { useRef as useRef8, useEffect as useEffect10 } from "react";
|
|
4424
4166
|
import { Animated } from "react-native";
|
|
4425
|
-
import { jsx as
|
|
4167
|
+
import { jsx as jsx39 } from "nativewind/jsx-runtime";
|
|
4426
4168
|
function ToastItemView({ message, type, onHide }) {
|
|
4427
4169
|
const fadeAnim = useRef8(new Animated.Value(0)).current;
|
|
4428
|
-
|
|
4170
|
+
useEffect10(() => {
|
|
4429
4171
|
Animated.sequence([
|
|
4430
4172
|
Animated.timing(fadeAnim, { toValue: 1, duration: 200, useNativeDriver: true }),
|
|
4431
4173
|
Animated.delay(2500),
|
|
@@ -4438,7 +4180,7 @@ function ToastItemView({ message, type, onHide }) {
|
|
|
4438
4180
|
warning: "bg-warning-500",
|
|
4439
4181
|
info: "bg-primary-500"
|
|
4440
4182
|
};
|
|
4441
|
-
return /* @__PURE__ */
|
|
4183
|
+
return /* @__PURE__ */ jsx39(
|
|
4442
4184
|
Animated.View,
|
|
4443
4185
|
{
|
|
4444
4186
|
style: {
|
|
@@ -4452,13 +4194,13 @@ function ToastItemView({ message, type, onHide }) {
|
|
|
4452
4194
|
}
|
|
4453
4195
|
]
|
|
4454
4196
|
},
|
|
4455
|
-
children: /* @__PURE__ */
|
|
4197
|
+
children: /* @__PURE__ */ jsx39(AppView, { className: `${bgColors[type]} px-4 py-3 rounded-lg mb-2 mx-4 shadow-lg`, children: /* @__PURE__ */ jsx39(AppText, { className: "text-white text-center", children: message }) })
|
|
4456
4198
|
}
|
|
4457
4199
|
);
|
|
4458
4200
|
}
|
|
4459
4201
|
|
|
4460
4202
|
// src/overlay/toast/provider.tsx
|
|
4461
|
-
import { jsx as
|
|
4203
|
+
import { jsx as jsx40, jsxs as jsxs16 } from "nativewind/jsx-runtime";
|
|
4462
4204
|
function ToastProvider({ children }) {
|
|
4463
4205
|
const [toasts, setToasts] = useState28([]);
|
|
4464
4206
|
const timersRef = useRef9(/* @__PURE__ */ new Map());
|
|
@@ -4496,12 +4238,12 @@ function ToastProvider({ children }) {
|
|
|
4496
4238
|
(message, duration) => show(message, "warning", duration),
|
|
4497
4239
|
[show]
|
|
4498
4240
|
);
|
|
4499
|
-
return /* @__PURE__ */
|
|
4241
|
+
return /* @__PURE__ */ jsxs16(ToastContext.Provider, { value: { show, success, error, info, warning }, children: [
|
|
4500
4242
|
children,
|
|
4501
|
-
/* @__PURE__ */
|
|
4243
|
+
/* @__PURE__ */ jsx40(View10, { style: styles14.toastContainer, pointerEvents: "none", children: toasts.map((toast) => /* @__PURE__ */ jsx40(ToastItemView, { ...toast, onHide: () => remove(toast.id) }, toast.id)) })
|
|
4502
4244
|
] });
|
|
4503
4245
|
}
|
|
4504
|
-
var
|
|
4246
|
+
var styles14 = StyleSheet15.create({
|
|
4505
4247
|
toastContainer: {
|
|
4506
4248
|
position: "absolute",
|
|
4507
4249
|
top: 60,
|
|
@@ -4524,8 +4266,8 @@ function useAlertContext() {
|
|
|
4524
4266
|
}
|
|
4525
4267
|
|
|
4526
4268
|
// src/overlay/alert/component.tsx
|
|
4527
|
-
import { View as
|
|
4528
|
-
import { jsx as
|
|
4269
|
+
import { View as View11, Modal as Modal6, StyleSheet as StyleSheet16 } from "react-native";
|
|
4270
|
+
import { jsx as jsx41, jsxs as jsxs17 } from "nativewind/jsx-runtime";
|
|
4529
4271
|
function AlertModal({
|
|
4530
4272
|
visible,
|
|
4531
4273
|
title,
|
|
@@ -4537,16 +4279,16 @@ function AlertModal({
|
|
|
4537
4279
|
onCancel
|
|
4538
4280
|
}) {
|
|
4539
4281
|
if (!visible) return null;
|
|
4540
|
-
return /* @__PURE__ */
|
|
4541
|
-
title && /* @__PURE__ */
|
|
4542
|
-
message && /* @__PURE__ */
|
|
4543
|
-
/* @__PURE__ */
|
|
4544
|
-
showCancel && /* @__PURE__ */
|
|
4545
|
-
/* @__PURE__ */
|
|
4282
|
+
return /* @__PURE__ */ jsx41(Modal6, { transparent: true, visible: true, animationType: "fade", children: /* @__PURE__ */ jsx41(View11, { style: styles15.overlay, children: /* @__PURE__ */ jsxs17(View11, { style: styles15.alertBox, children: [
|
|
4283
|
+
title && /* @__PURE__ */ jsx41(AppText, { className: "text-lg font-semibold text-center mb-2", children: title }),
|
|
4284
|
+
message && /* @__PURE__ */ jsx41(AppText, { className: "text-gray-600 text-center mb-4", children: message }),
|
|
4285
|
+
/* @__PURE__ */ jsxs17(AppView, { row: true, gap: 3, className: "mt-2", children: [
|
|
4286
|
+
showCancel && /* @__PURE__ */ jsx41(AppPressable, { onPress: onCancel, className: "flex-1 py-3 bg-gray-100 rounded-lg", children: /* @__PURE__ */ jsx41(AppText, { className: "text-center text-gray-700", children: cancelText || "\u53D6\u6D88" }) }),
|
|
4287
|
+
/* @__PURE__ */ jsx41(AppPressable, { onPress: onConfirm, className: "flex-1 py-3 bg-primary-500 rounded-lg", children: /* @__PURE__ */ jsx41(AppText, { className: "text-center text-white", children: confirmText || "\u786E\u5B9A" }) })
|
|
4546
4288
|
] })
|
|
4547
4289
|
] }) }) });
|
|
4548
4290
|
}
|
|
4549
|
-
var
|
|
4291
|
+
var styles15 = StyleSheet16.create({
|
|
4550
4292
|
overlay: {
|
|
4551
4293
|
flex: 1,
|
|
4552
4294
|
backgroundColor: "rgba(0,0,0,0.5)",
|
|
@@ -4568,7 +4310,7 @@ var styles17 = StyleSheet18.create({
|
|
|
4568
4310
|
});
|
|
4569
4311
|
|
|
4570
4312
|
// src/overlay/alert/provider.tsx
|
|
4571
|
-
import { jsx as
|
|
4313
|
+
import { jsx as jsx42, jsxs as jsxs18 } from "nativewind/jsx-runtime";
|
|
4572
4314
|
function AlertProvider({ children }) {
|
|
4573
4315
|
const [alert, setAlert] = useState29(null);
|
|
4574
4316
|
const showAlert = useCallback21((options) => {
|
|
@@ -4591,9 +4333,9 @@ function AlertProvider({ children }) {
|
|
|
4591
4333
|
alert?.onCancel?.();
|
|
4592
4334
|
hide();
|
|
4593
4335
|
}, [alert, hide]);
|
|
4594
|
-
return /* @__PURE__ */
|
|
4336
|
+
return /* @__PURE__ */ jsxs18(AlertContext.Provider, { value: { alert: showAlert, confirm }, children: [
|
|
4595
4337
|
children,
|
|
4596
|
-
/* @__PURE__ */
|
|
4338
|
+
/* @__PURE__ */ jsx42(
|
|
4597
4339
|
AlertModal,
|
|
4598
4340
|
{
|
|
4599
4341
|
visible: alert?.visible ?? false,
|
|
@@ -4610,13 +4352,13 @@ function AlertProvider({ children }) {
|
|
|
4610
4352
|
}
|
|
4611
4353
|
|
|
4612
4354
|
// src/overlay/provider.tsx
|
|
4613
|
-
import { jsx as
|
|
4355
|
+
import { jsx as jsx43 } from "nativewind/jsx-runtime";
|
|
4614
4356
|
function OverlayProvider({ children }) {
|
|
4615
|
-
return /* @__PURE__ */
|
|
4357
|
+
return /* @__PURE__ */ jsx43(LoadingProvider, { children: /* @__PURE__ */ jsx43(ToastProvider, { children: /* @__PURE__ */ jsx43(AlertProvider, { children }) }) });
|
|
4616
4358
|
}
|
|
4617
4359
|
|
|
4618
4360
|
// src/overlay/AppProvider.tsx
|
|
4619
|
-
import { Fragment as Fragment4, jsx as
|
|
4361
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs19 } from "nativewind/jsx-runtime";
|
|
4620
4362
|
var defaultLightTheme = {
|
|
4621
4363
|
colors: {
|
|
4622
4364
|
primary: "#f38b32",
|
|
@@ -4653,21 +4395,21 @@ function AppProvider({
|
|
|
4653
4395
|
}) {
|
|
4654
4396
|
let content = children;
|
|
4655
4397
|
if (enableOverlay) {
|
|
4656
|
-
content = /* @__PURE__ */
|
|
4398
|
+
content = /* @__PURE__ */ jsx44(OverlayProvider, { children: content });
|
|
4657
4399
|
}
|
|
4658
4400
|
if (enableNavigation) {
|
|
4659
|
-
content = /* @__PURE__ */
|
|
4401
|
+
content = /* @__PURE__ */ jsx44(NavigationProvider, { ...navigationProps, children: content });
|
|
4660
4402
|
}
|
|
4661
4403
|
if (enableTheme) {
|
|
4662
|
-
content = /* @__PURE__ */
|
|
4663
|
-
enableStatusBar && /* @__PURE__ */
|
|
4404
|
+
content = /* @__PURE__ */ jsx44(ThemeProvider, { light: lightTheme, dark: darkTheme, defaultDark, isDark, children: /* @__PURE__ */ jsxs19(Fragment4, { children: [
|
|
4405
|
+
enableStatusBar && /* @__PURE__ */ jsx44(AppStatusBar, { testID: "status-bar", ...statusBarProps }),
|
|
4664
4406
|
content
|
|
4665
4407
|
] }) });
|
|
4666
4408
|
}
|
|
4667
4409
|
if (enableSafeArea) {
|
|
4668
|
-
content = /* @__PURE__ */
|
|
4410
|
+
content = /* @__PURE__ */ jsx44(SafeAreaProvider, { children: content });
|
|
4669
4411
|
}
|
|
4670
|
-
return /* @__PURE__ */
|
|
4412
|
+
return /* @__PURE__ */ jsx44(Fragment4, { children: content });
|
|
4671
4413
|
}
|
|
4672
4414
|
|
|
4673
4415
|
// src/overlay/loading/hooks.ts
|
|
@@ -4685,6 +4427,287 @@ function useAlert() {
|
|
|
4685
4427
|
return useAlertContext();
|
|
4686
4428
|
}
|
|
4687
4429
|
|
|
4430
|
+
// src/navigation/components/AppHeader.tsx
|
|
4431
|
+
import { Fragment as Fragment5, jsx as jsx45, jsxs as jsxs20 } from "nativewind/jsx-runtime";
|
|
4432
|
+
function AppHeader({
|
|
4433
|
+
title,
|
|
4434
|
+
subtitle,
|
|
4435
|
+
leftIcon = "chevron-left",
|
|
4436
|
+
onLeftPress,
|
|
4437
|
+
rightIcons = [],
|
|
4438
|
+
transparent = false,
|
|
4439
|
+
safeArea = true,
|
|
4440
|
+
style
|
|
4441
|
+
}) {
|
|
4442
|
+
const colors = useThemeColors();
|
|
4443
|
+
const insets = useSafeAreaInsets3();
|
|
4444
|
+
const backgroundColor = transparent ? "transparent" : colors.card;
|
|
4445
|
+
return /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
4446
|
+
/* @__PURE__ */ jsx45(AppFocusedStatusBar, { translucent: true, backgroundColor: "transparent" }),
|
|
4447
|
+
/* @__PURE__ */ jsx45(
|
|
4448
|
+
AppView,
|
|
4449
|
+
{
|
|
4450
|
+
style: [
|
|
4451
|
+
{
|
|
4452
|
+
backgroundColor,
|
|
4453
|
+
paddingTop: safeArea ? insets.top : 0
|
|
4454
|
+
},
|
|
4455
|
+
style
|
|
4456
|
+
],
|
|
4457
|
+
children: /* @__PURE__ */ jsxs20(AppView, { row: true, items: "center", px: 4, style: styles16.container, children: [
|
|
4458
|
+
/* @__PURE__ */ jsx45(AppView, { style: [styles16.sideContainer, styles16.leftContainer], children: leftIcon && /* @__PURE__ */ jsx45(AppPressable, { onPress: onLeftPress, style: styles16.iconButton, children: /* @__PURE__ */ jsx45(Icon, { name: leftIcon, size: 24, color: colors.text }) }) }),
|
|
4459
|
+
/* @__PURE__ */ jsxs20(AppView, { style: styles16.centerContainer, children: [
|
|
4460
|
+
title && /* @__PURE__ */ jsx45(
|
|
4461
|
+
AppText,
|
|
4462
|
+
{
|
|
4463
|
+
size: "lg",
|
|
4464
|
+
weight: "semibold",
|
|
4465
|
+
style: [styles16.title, { color: colors.text }],
|
|
4466
|
+
numberOfLines: 1,
|
|
4467
|
+
children: title
|
|
4468
|
+
}
|
|
4469
|
+
),
|
|
4470
|
+
subtitle && /* @__PURE__ */ jsx45(
|
|
4471
|
+
AppText,
|
|
4472
|
+
{
|
|
4473
|
+
size: "xs",
|
|
4474
|
+
style: [styles16.subtitle, { color: colors.textMuted }],
|
|
4475
|
+
numberOfLines: 1,
|
|
4476
|
+
children: subtitle
|
|
4477
|
+
}
|
|
4478
|
+
)
|
|
4479
|
+
] }),
|
|
4480
|
+
/* @__PURE__ */ jsx45(AppView, { row: true, items: "center", style: [styles16.sideContainer, styles16.rightContainer], children: rightIcons.map((icon, index) => /* @__PURE__ */ jsx45(AppPressable, { onPress: icon.onPress, style: styles16.iconButton, children: /* @__PURE__ */ jsxs20(AppView, { children: [
|
|
4481
|
+
/* @__PURE__ */ jsx45(Icon, { name: icon.icon, size: 24, color: colors.text }),
|
|
4482
|
+
icon.badge ? /* @__PURE__ */ jsx45(AppView, { style: styles16.badge, children: /* @__PURE__ */ jsx45(AppText, { size: "xs", color: "white", style: styles16.badgeText, children: icon.badge > 99 ? "99+" : icon.badge }) }) : null
|
|
4483
|
+
] }) }, index)) })
|
|
4484
|
+
] })
|
|
4485
|
+
}
|
|
4486
|
+
)
|
|
4487
|
+
] });
|
|
4488
|
+
}
|
|
4489
|
+
var styles16 = StyleSheet17.create({
|
|
4490
|
+
container: {
|
|
4491
|
+
height: 44
|
|
4492
|
+
// iOS 标准导航栏高度
|
|
4493
|
+
},
|
|
4494
|
+
sideContainer: {
|
|
4495
|
+
width: 70,
|
|
4496
|
+
// 固定宽度,确保标题居中
|
|
4497
|
+
flexDirection: "row",
|
|
4498
|
+
alignItems: "center"
|
|
4499
|
+
},
|
|
4500
|
+
leftContainer: {
|
|
4501
|
+
justifyContent: "flex-start"
|
|
4502
|
+
},
|
|
4503
|
+
rightContainer: {
|
|
4504
|
+
justifyContent: "flex-end"
|
|
4505
|
+
},
|
|
4506
|
+
centerContainer: {
|
|
4507
|
+
flex: 1,
|
|
4508
|
+
alignItems: "center",
|
|
4509
|
+
justifyContent: "center"
|
|
4510
|
+
},
|
|
4511
|
+
title: {
|
|
4512
|
+
textAlign: "center"
|
|
4513
|
+
},
|
|
4514
|
+
subtitle: {
|
|
4515
|
+
textAlign: "center",
|
|
4516
|
+
marginTop: 2
|
|
4517
|
+
},
|
|
4518
|
+
iconButton: {
|
|
4519
|
+
padding: 8
|
|
4520
|
+
},
|
|
4521
|
+
badge: {
|
|
4522
|
+
position: "absolute",
|
|
4523
|
+
top: -4,
|
|
4524
|
+
right: -4,
|
|
4525
|
+
minWidth: 16,
|
|
4526
|
+
height: 16,
|
|
4527
|
+
borderRadius: 8,
|
|
4528
|
+
backgroundColor: "#ef4444",
|
|
4529
|
+
alignItems: "center",
|
|
4530
|
+
justifyContent: "center",
|
|
4531
|
+
paddingHorizontal: 4
|
|
4532
|
+
},
|
|
4533
|
+
badgeText: {
|
|
4534
|
+
fontSize: 10,
|
|
4535
|
+
fontWeight: "bold"
|
|
4536
|
+
}
|
|
4537
|
+
});
|
|
4538
|
+
|
|
4539
|
+
// src/navigation/components/DrawerContent.tsx
|
|
4540
|
+
import { View as View12, TouchableOpacity as TouchableOpacity8, StyleSheet as StyleSheet18 } from "react-native";
|
|
4541
|
+
import { DrawerContentScrollView } from "@react-navigation/drawer";
|
|
4542
|
+
import { jsx as jsx46, jsxs as jsxs21 } from "nativewind/jsx-runtime";
|
|
4543
|
+
function DrawerContent({
|
|
4544
|
+
state,
|
|
4545
|
+
descriptors,
|
|
4546
|
+
navigation,
|
|
4547
|
+
header,
|
|
4548
|
+
footer,
|
|
4549
|
+
items,
|
|
4550
|
+
activeBackgroundColor,
|
|
4551
|
+
activeTintColor,
|
|
4552
|
+
inactiveTintColor
|
|
4553
|
+
}) {
|
|
4554
|
+
const { theme, isDark } = useTheme();
|
|
4555
|
+
const colors = useThemeColors();
|
|
4556
|
+
const activeBgColor = activeBackgroundColor || (isDark ? colors.primarySurface : theme.colors.primary?.[50] || "#fff7ed");
|
|
4557
|
+
const activeColor = activeTintColor || colors.primary;
|
|
4558
|
+
const inactiveColor = inactiveTintColor || (isDark ? "#d1d5db" : "#4b5563");
|
|
4559
|
+
const backgroundColor = colors.card;
|
|
4560
|
+
const dividerColor = colors.divider;
|
|
4561
|
+
const drawerItems = items || state.routes.map((route) => {
|
|
4562
|
+
const descriptor = descriptors[route.key];
|
|
4563
|
+
const options = descriptor.options;
|
|
4564
|
+
return {
|
|
4565
|
+
name: route.name,
|
|
4566
|
+
label: options.drawerLabel || options.title || route.name,
|
|
4567
|
+
icon: options.drawerIcon?.({ size: 24, color: inactiveColor })?.props?.name,
|
|
4568
|
+
badge: options.tabBarBadge
|
|
4569
|
+
};
|
|
4570
|
+
});
|
|
4571
|
+
return /* @__PURE__ */ jsxs21(DrawerContentScrollView, { style: [styles17.container, { backgroundColor }], children: [
|
|
4572
|
+
header && /* @__PURE__ */ jsx46(View12, { style: [styles17.header, { borderBottomColor: dividerColor }], children: header }),
|
|
4573
|
+
/* @__PURE__ */ jsx46(AppView, { className: "py-2", children: drawerItems.map((item) => {
|
|
4574
|
+
const isFocused = state.routes[state.index].name === item.name;
|
|
4575
|
+
const onPress = () => {
|
|
4576
|
+
navigation.navigate(item.name);
|
|
4577
|
+
};
|
|
4578
|
+
return /* @__PURE__ */ jsxs21(
|
|
4579
|
+
TouchableOpacity8,
|
|
4580
|
+
{
|
|
4581
|
+
onPress,
|
|
4582
|
+
style: [styles17.item, isFocused && { backgroundColor: activeBgColor }],
|
|
4583
|
+
children: [
|
|
4584
|
+
item.icon && /* @__PURE__ */ jsx46(View12, { style: styles17.iconContainer, children: /* @__PURE__ */ jsx46(
|
|
4585
|
+
Icon,
|
|
4586
|
+
{
|
|
4587
|
+
name: item.icon,
|
|
4588
|
+
size: "md",
|
|
4589
|
+
color: isFocused ? activeColor : inactiveColor
|
|
4590
|
+
}
|
|
4591
|
+
) }),
|
|
4592
|
+
/* @__PURE__ */ jsx46(
|
|
4593
|
+
AppText,
|
|
4594
|
+
{
|
|
4595
|
+
style: [
|
|
4596
|
+
styles17.label,
|
|
4597
|
+
{ color: isFocused ? activeColor : inactiveColor },
|
|
4598
|
+
isFocused && styles17.activeLabel
|
|
4599
|
+
],
|
|
4600
|
+
numberOfLines: 1,
|
|
4601
|
+
children: item.label
|
|
4602
|
+
}
|
|
4603
|
+
),
|
|
4604
|
+
item.badge != null && /* @__PURE__ */ jsx46(View12, { style: [styles17.badge, { backgroundColor: activeColor }], children: /* @__PURE__ */ jsx46(AppText, { style: styles17.badgeText, children: typeof item.badge === "number" && item.badge > 99 ? "99+" : item.badge }) })
|
|
4605
|
+
]
|
|
4606
|
+
},
|
|
4607
|
+
item.name
|
|
4608
|
+
);
|
|
4609
|
+
}) }),
|
|
4610
|
+
footer && /* @__PURE__ */ jsx46(View12, { style: [styles17.footer, { borderTopColor: dividerColor }], children: footer })
|
|
4611
|
+
] });
|
|
4612
|
+
}
|
|
4613
|
+
var styles17 = StyleSheet18.create({
|
|
4614
|
+
container: {
|
|
4615
|
+
flex: 1
|
|
4616
|
+
},
|
|
4617
|
+
header: {
|
|
4618
|
+
padding: 16,
|
|
4619
|
+
borderBottomWidth: 0.5
|
|
4620
|
+
},
|
|
4621
|
+
item: {
|
|
4622
|
+
flexDirection: "row",
|
|
4623
|
+
alignItems: "center",
|
|
4624
|
+
paddingHorizontal: 16,
|
|
4625
|
+
paddingVertical: 12,
|
|
4626
|
+
marginHorizontal: 8,
|
|
4627
|
+
marginVertical: 2,
|
|
4628
|
+
borderRadius: 8
|
|
4629
|
+
},
|
|
4630
|
+
iconContainer: {
|
|
4631
|
+
width: 32,
|
|
4632
|
+
alignItems: "center",
|
|
4633
|
+
marginRight: 8
|
|
4634
|
+
},
|
|
4635
|
+
label: {
|
|
4636
|
+
flex: 1,
|
|
4637
|
+
fontSize: 16
|
|
4638
|
+
},
|
|
4639
|
+
activeLabel: {
|
|
4640
|
+
fontWeight: "600"
|
|
4641
|
+
},
|
|
4642
|
+
badge: {
|
|
4643
|
+
minWidth: 20,
|
|
4644
|
+
height: 20,
|
|
4645
|
+
borderRadius: 10,
|
|
4646
|
+
justifyContent: "center",
|
|
4647
|
+
alignItems: "center",
|
|
4648
|
+
paddingHorizontal: 6
|
|
4649
|
+
},
|
|
4650
|
+
badgeText: {
|
|
4651
|
+
color: "#fff",
|
|
4652
|
+
fontSize: 12,
|
|
4653
|
+
fontWeight: "bold"
|
|
4654
|
+
},
|
|
4655
|
+
footer: {
|
|
4656
|
+
marginTop: "auto",
|
|
4657
|
+
padding: 16,
|
|
4658
|
+
borderTopWidth: 0.5
|
|
4659
|
+
}
|
|
4660
|
+
});
|
|
4661
|
+
|
|
4662
|
+
// src/navigation/hooks/useNavigation.ts
|
|
4663
|
+
import { useEffect as useEffect11 } from "react";
|
|
4664
|
+
import { useNavigation as useRNNavigation } from "@react-navigation/native";
|
|
4665
|
+
function useNavigation() {
|
|
4666
|
+
return useRNNavigation();
|
|
4667
|
+
}
|
|
4668
|
+
function useStackNavigation() {
|
|
4669
|
+
return useRNNavigation();
|
|
4670
|
+
}
|
|
4671
|
+
function useTabNavigation() {
|
|
4672
|
+
return useRNNavigation();
|
|
4673
|
+
}
|
|
4674
|
+
function useDrawerNavigation() {
|
|
4675
|
+
return useRNNavigation();
|
|
4676
|
+
}
|
|
4677
|
+
function useBackHandler(handler) {
|
|
4678
|
+
const navigation = useRNNavigation();
|
|
4679
|
+
useEffect11(() => {
|
|
4680
|
+
const unsubscribe = navigation.addListener("beforeRemove", (e) => {
|
|
4681
|
+
if (!handler()) {
|
|
4682
|
+
e.preventDefault();
|
|
4683
|
+
}
|
|
4684
|
+
});
|
|
4685
|
+
return unsubscribe;
|
|
4686
|
+
}, [navigation, handler]);
|
|
4687
|
+
}
|
|
4688
|
+
|
|
4689
|
+
// src/navigation/hooks/useRoute.ts
|
|
4690
|
+
import { useRoute as useRNRoute } from "@react-navigation/native";
|
|
4691
|
+
function useRoute() {
|
|
4692
|
+
return useRNRoute();
|
|
4693
|
+
}
|
|
4694
|
+
|
|
4695
|
+
// src/navigation/hooks/useNavigationState.ts
|
|
4696
|
+
import {
|
|
4697
|
+
useNavigationState as useRNNavigationState,
|
|
4698
|
+
useIsFocused as useIsFocused2,
|
|
4699
|
+
useFocusEffect,
|
|
4700
|
+
useScrollToTop
|
|
4701
|
+
} from "@react-navigation/native";
|
|
4702
|
+
function useNavigationState(selector) {
|
|
4703
|
+
return useRNNavigationState(selector);
|
|
4704
|
+
}
|
|
4705
|
+
|
|
4706
|
+
// src/navigation/index.ts
|
|
4707
|
+
import {
|
|
4708
|
+
NavigationContainer as NavigationContainer2
|
|
4709
|
+
} from "@react-navigation/native";
|
|
4710
|
+
|
|
4688
4711
|
// src/index.ts
|
|
4689
4712
|
import { SafeAreaProvider as SafeAreaProvider2 } from "react-native-safe-area-context";
|
|
4690
4713
|
export {
|
|
@@ -4702,6 +4725,7 @@ export {
|
|
|
4702
4725
|
AppScrollView,
|
|
4703
4726
|
AppStatusBar,
|
|
4704
4727
|
AppText,
|
|
4728
|
+
AppTextInput,
|
|
4705
4729
|
AppView,
|
|
4706
4730
|
BottomTabBar,
|
|
4707
4731
|
Card,
|
|
@@ -4781,7 +4805,7 @@ export {
|
|
|
4781
4805
|
useFocusEffect,
|
|
4782
4806
|
useForm,
|
|
4783
4807
|
useInfinite,
|
|
4784
|
-
useIsFocused,
|
|
4808
|
+
useIsFocused2 as useIsFocused,
|
|
4785
4809
|
useKeyboard,
|
|
4786
4810
|
useLoading,
|
|
4787
4811
|
useMemoizedFn,
|