create-better-t-stack 2.14.4 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +18 -14
- package/package.json +1 -1
- package/templates/examples/ai/native/nativewind/app/(drawer)/ai.tsx.hbs +155 -0
- package/templates/examples/ai/native/nativewind/polyfills.js +25 -0
- package/templates/examples/ai/native/unistyles/app/(drawer)/ai.tsx.hbs +279 -0
- package/templates/examples/ai/native/unistyles/polyfills.js +25 -0
- package/templates/examples/todo/native/unistyles/app/(drawer)/todos.tsx.hbs +340 -0
- package/templates/frontend/native/nativewind/app/(drawer)/(tabs)/_layout.tsx +24 -7
- package/templates/frontend/native/nativewind/app/(drawer)/(tabs)/index.tsx +15 -13
- package/templates/frontend/native/nativewind/app/(drawer)/(tabs)/two.tsx +15 -13
- package/templates/frontend/native/nativewind/app/(drawer)/_layout.tsx.hbs +25 -9
- package/templates/frontend/native/nativewind/app/(drawer)/index.tsx.hbs +43 -30
- package/templates/frontend/native/nativewind/app/+not-found.tsx +20 -9
- package/templates/frontend/native/nativewind/app/_layout.tsx.hbs +3 -0
- package/templates/frontend/native/nativewind/app/modal.tsx +9 -7
- package/templates/frontend/native/nativewind/components/container.tsx +2 -3
- package/templates/frontend/native/nativewind/components/header-button.tsx +24 -29
- package/templates/frontend/native/nativewind/components/tabbar-icon.tsx +3 -10
- package/templates/frontend/native/nativewind/global.css +36 -11
- package/templates/frontend/native/nativewind/lib/constants.ts +8 -8
- package/templates/frontend/native/nativewind/{package.json → package.json.hbs} +4 -0
- package/templates/frontend/native/nativewind/tailwind.config.js +27 -0
- package/templates/frontend/native/unistyles/app/(drawer)/(tabs)/_layout.tsx +9 -4
- package/templates/frontend/native/unistyles/app/(drawer)/(tabs)/index.tsx +25 -17
- package/templates/frontend/native/unistyles/app/(drawer)/(tabs)/two.tsx +26 -18
- package/templates/frontend/native/unistyles/app/(drawer)/{_layout.tsx → _layout.tsx.hbs} +35 -7
- package/templates/frontend/native/unistyles/app/(drawer)/index.tsx.hbs +121 -58
- package/templates/frontend/native/unistyles/app/+not-found.tsx +45 -14
- package/templates/frontend/native/unistyles/app/_layout.tsx.hbs +9 -6
- package/templates/frontend/native/unistyles/app/modal.tsx +18 -14
- package/templates/frontend/native/unistyles/components/container.tsx +3 -8
- package/templates/frontend/native/unistyles/components/header-button.tsx +33 -28
- package/templates/frontend/native/unistyles/components/tabbar-icon.tsx +3 -10
- package/templates/frontend/native/unistyles/{package.json → package.json.hbs} +5 -1
- package/templates/frontend/native/unistyles/theme.ts +82 -19
- package/templates/frontend/native/unistyles/unistyles.ts +4 -4
- /package/templates/examples/todo/native/nativewind/app/{todo.tsx.hbs → (drawer)/todos.tsx.hbs} +0 -0
|
@@ -28,56 +28,79 @@ export default function Home() {
|
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<Container>
|
|
31
|
-
<ScrollView
|
|
32
|
-
|
|
31
|
+
<ScrollView
|
|
32
|
+
contentContainerStyle={styles.container}
|
|
33
|
+
showsVerticalScrollIndicator={false}
|
|
34
|
+
>
|
|
35
|
+
<Text className="font-mono text-foreground text-3xl font-bold mb-4">
|
|
36
|
+
BETTER T STACK
|
|
37
|
+
</Text>
|
|
38
|
+
<View style={styles.statusCard}>
|
|
39
|
+
<View style={styles.statusHeader}>
|
|
40
|
+
<Text style={styles.statusTitle}>System Status</Text>
|
|
41
|
+
<View style={styles.statusBadge}>
|
|
42
|
+
<Text style={styles.statusBadgeText}>LIVE</Text>
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
33
45
|
|
|
34
|
-
<View style={styles.apiStatusCard}>
|
|
35
|
-
<Text style={styles.cardTitle}>API Status</Text>
|
|
36
46
|
{{#if (eq backend "convex")}}
|
|
37
|
-
<View style={styles.
|
|
47
|
+
<View style={styles.statusRow}>
|
|
38
48
|
<View
|
|
39
49
|
style={[
|
|
40
|
-
styles.
|
|
50
|
+
styles.statusDot,
|
|
41
51
|
healthCheck === "OK"
|
|
42
|
-
? styles.
|
|
43
|
-
: styles.
|
|
52
|
+
? styles.statusDotSuccess
|
|
53
|
+
: styles.statusDotWarning,
|
|
44
54
|
]}
|
|
45
55
|
/>
|
|
46
|
-
<
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
? "
|
|
51
|
-
: "
|
|
52
|
-
|
|
56
|
+
<View style={styles.statusContent}>
|
|
57
|
+
<Text style={styles.statusLabel}>Convex</Text>
|
|
58
|
+
<Text style={styles.statusDescription}>
|
|
59
|
+
{healthCheck === undefined
|
|
60
|
+
? "Checking connection..."
|
|
61
|
+
: healthCheck === "OK"
|
|
62
|
+
? "All systems operational"
|
|
63
|
+
: "Service unavailable"}
|
|
64
|
+
</Text>
|
|
65
|
+
</View>
|
|
53
66
|
</View>
|
|
54
67
|
{{else}}
|
|
55
68
|
{{#unless (eq api "none")}}
|
|
56
|
-
<View style={styles.
|
|
69
|
+
<View style={styles.statusRow}>
|
|
57
70
|
<View
|
|
58
71
|
style={[
|
|
59
|
-
styles.
|
|
72
|
+
styles.statusDot,
|
|
60
73
|
healthCheck.data
|
|
61
|
-
? styles.
|
|
62
|
-
: styles.
|
|
74
|
+
? styles.statusDotSuccess
|
|
75
|
+
: styles.statusDotWarning,
|
|
63
76
|
]}
|
|
64
77
|
/>
|
|
65
|
-
<
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
? "
|
|
78
|
-
:
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
<View style={styles.statusContent}>
|
|
79
|
+
<Text style={styles.statusLabel}>
|
|
80
|
+
{{#if (eq api "orpc")}}
|
|
81
|
+
ORPC
|
|
82
|
+
{{/if}}
|
|
83
|
+
{{#if (eq api "trpc")}}
|
|
84
|
+
TRPC
|
|
85
|
+
{{/if}}
|
|
86
|
+
</Text>
|
|
87
|
+
<Text style={styles.statusDescription}>
|
|
88
|
+
{{#if (eq api "orpc")}}
|
|
89
|
+
{healthCheck.isLoading
|
|
90
|
+
? "Checking connection..."
|
|
91
|
+
: healthCheck.data
|
|
92
|
+
? "All systems operational"
|
|
93
|
+
: "Service unavailable"}
|
|
94
|
+
{{/if}}
|
|
95
|
+
{{#if (eq api "trpc")}}
|
|
96
|
+
{healthCheck.isLoading
|
|
97
|
+
? "Checking connection..."
|
|
98
|
+
: healthCheck.data
|
|
99
|
+
? "All systems operational"
|
|
100
|
+
: "Service unavailable"}
|
|
101
|
+
{{/if}}
|
|
102
|
+
</Text>
|
|
103
|
+
</View>
|
|
81
104
|
</View>
|
|
82
105
|
{{/unless}}
|
|
83
106
|
{{/if}}
|
|
@@ -88,44 +111,84 @@ export default function Home() {
|
|
|
88
111
|
}
|
|
89
112
|
|
|
90
113
|
const styles = StyleSheet.create((theme) => ({
|
|
91
|
-
|
|
92
|
-
paddingHorizontal:
|
|
114
|
+
container: {
|
|
115
|
+
paddingHorizontal: theme.spacing.md,
|
|
116
|
+
},
|
|
117
|
+
heroSection: {
|
|
118
|
+
paddingVertical: theme.spacing.xl,
|
|
93
119
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
fontSize: 30,
|
|
120
|
+
heroTitle: {
|
|
121
|
+
fontSize: theme.fontSize["4xl"],
|
|
97
122
|
fontWeight: "bold",
|
|
98
|
-
|
|
123
|
+
color: theme.colors.foreground,
|
|
124
|
+
marginBottom: theme.spacing.sm,
|
|
99
125
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
126
|
+
heroSubtitle: {
|
|
127
|
+
fontSize: theme.fontSize.lg,
|
|
128
|
+
color: theme.colors.mutedForeground,
|
|
129
|
+
lineHeight: 28,
|
|
130
|
+
},
|
|
131
|
+
statusCard: {
|
|
132
|
+
backgroundColor: theme.colors.card,
|
|
103
133
|
borderWidth: 1,
|
|
104
|
-
borderColor: theme
|
|
105
|
-
|
|
134
|
+
borderColor: theme.colors.border,
|
|
135
|
+
borderRadius: theme.borderRadius.xl,
|
|
136
|
+
padding: theme.spacing.lg,
|
|
137
|
+
marginBottom: theme.spacing.lg,
|
|
138
|
+
shadowColor: "#000",
|
|
139
|
+
shadowOffset: { width: 0, height: 1 },
|
|
140
|
+
shadowOpacity: 0.05,
|
|
141
|
+
shadowRadius: 3,
|
|
142
|
+
elevation: 2,
|
|
143
|
+
},
|
|
144
|
+
statusHeader: {
|
|
145
|
+
flexDirection: "row",
|
|
146
|
+
alignItems: "center",
|
|
147
|
+
justifyContent: "space-between",
|
|
148
|
+
marginBottom: theme.spacing.md,
|
|
149
|
+
},
|
|
150
|
+
statusTitle: {
|
|
151
|
+
fontSize: theme.fontSize.lg,
|
|
152
|
+
fontWeight: "600",
|
|
153
|
+
color: theme.colors.cardForeground,
|
|
154
|
+
},
|
|
155
|
+
statusBadge: {
|
|
156
|
+
backgroundColor: theme.colors.secondary,
|
|
157
|
+
paddingHorizontal: theme.spacing.sm + 4,
|
|
158
|
+
paddingVertical: theme.spacing.xs,
|
|
159
|
+
borderRadius: 9999,
|
|
106
160
|
},
|
|
107
|
-
|
|
108
|
-
|
|
161
|
+
statusBadgeText: {
|
|
162
|
+
fontSize: theme.fontSize.xs,
|
|
109
163
|
fontWeight: "500",
|
|
110
|
-
color: theme
|
|
164
|
+
color: theme.colors.secondaryForeground,
|
|
111
165
|
},
|
|
112
|
-
|
|
166
|
+
statusRow: {
|
|
113
167
|
flexDirection: "row",
|
|
114
168
|
alignItems: "center",
|
|
115
|
-
gap:
|
|
169
|
+
gap: theme.spacing.sm + 4,
|
|
116
170
|
},
|
|
117
|
-
|
|
171
|
+
statusDot: {
|
|
118
172
|
height: 12,
|
|
119
173
|
width: 12,
|
|
120
|
-
borderRadius:
|
|
174
|
+
borderRadius: 6,
|
|
121
175
|
},
|
|
122
|
-
|
|
176
|
+
statusDotSuccess: {
|
|
123
177
|
backgroundColor: theme.colors.success,
|
|
124
178
|
},
|
|
125
|
-
|
|
126
|
-
backgroundColor:
|
|
179
|
+
statusDotWarning: {
|
|
180
|
+
backgroundColor: "#F59E0B",
|
|
127
181
|
},
|
|
128
|
-
|
|
129
|
-
|
|
182
|
+
statusContent: {
|
|
183
|
+
flex: 1,
|
|
184
|
+
},
|
|
185
|
+
statusLabel: {
|
|
186
|
+
fontSize: theme.fontSize.sm,
|
|
187
|
+
fontWeight: "500",
|
|
188
|
+
color: theme.colors.cardForeground,
|
|
130
189
|
},
|
|
190
|
+
statusDescription: {
|
|
191
|
+
fontSize: theme.fontSize.xs,
|
|
192
|
+
color: theme.colors.mutedForeground,
|
|
193
|
+
}
|
|
131
194
|
}));
|
|
@@ -1,34 +1,65 @@
|
|
|
1
|
+
import { Container } from "@/components/container";
|
|
1
2
|
import { Link, Stack } from "expo-router";
|
|
2
|
-
import { Text } from "react-native";
|
|
3
|
+
import { Text, View } from "react-native";
|
|
3
4
|
import { StyleSheet } from "react-native-unistyles";
|
|
4
5
|
|
|
5
|
-
import { Container } from "@/components/container";
|
|
6
|
-
|
|
7
6
|
export default function NotFoundScreen() {
|
|
8
7
|
return (
|
|
9
8
|
<>
|
|
10
9
|
<Stack.Screen options={{ title: "Oops!" }} />
|
|
11
10
|
<Container>
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
<View style={styles.container}>
|
|
12
|
+
<View style={styles.content}>
|
|
13
|
+
<Text style={styles.emoji}>🤔</Text>
|
|
14
|
+
<Text style={styles.title}>Page Not Found</Text>
|
|
15
|
+
<Text style={styles.description}>
|
|
16
|
+
Sorry, the page you're looking for doesn't exist.
|
|
17
|
+
</Text>
|
|
18
|
+
<Link href="/" style={styles.button}>
|
|
19
|
+
<Text style={styles.buttonText}>Go to Home</Text>
|
|
20
|
+
</Link>
|
|
21
|
+
</View>
|
|
22
|
+
</View>
|
|
16
23
|
</Container>
|
|
17
24
|
</>
|
|
18
25
|
);
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
const styles = StyleSheet.create((theme) => ({
|
|
29
|
+
container: {
|
|
30
|
+
flex: 1,
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
padding: theme.spacing.lg,
|
|
34
|
+
},
|
|
35
|
+
content: {
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
},
|
|
38
|
+
emoji: {
|
|
39
|
+
fontSize: 64,
|
|
40
|
+
marginBottom: theme.spacing.md,
|
|
41
|
+
},
|
|
22
42
|
title: {
|
|
23
|
-
fontSize:
|
|
43
|
+
fontSize: theme.fontSize["2xl"],
|
|
24
44
|
fontWeight: "bold",
|
|
25
|
-
color: theme.colors.
|
|
45
|
+
color: theme.colors.foreground,
|
|
46
|
+
marginBottom: theme.spacing.sm,
|
|
47
|
+
textAlign: "center",
|
|
48
|
+
},
|
|
49
|
+
description: {
|
|
50
|
+
color: theme.colors.mutedForeground,
|
|
51
|
+
textAlign: "center",
|
|
52
|
+
marginBottom: theme.spacing.xl,
|
|
53
|
+
maxWidth: 280,
|
|
26
54
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
55
|
+
button: {
|
|
56
|
+
backgroundColor: `${theme.colors.primary}1A`, // 10% opacity
|
|
57
|
+
paddingHorizontal: theme.spacing.lg,
|
|
58
|
+
paddingVertical: theme.spacing.sm + 4,
|
|
59
|
+
borderRadius: theme.borderRadius.lg,
|
|
30
60
|
},
|
|
31
|
-
|
|
32
|
-
|
|
61
|
+
buttonText: {
|
|
62
|
+
color: theme.colors.primary,
|
|
63
|
+
fontWeight: "500",
|
|
33
64
|
},
|
|
34
65
|
}));
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
{{#if (includes examples "ai")}}
|
|
2
|
+
import "@/polyfills";
|
|
3
|
+
{{/if}}
|
|
1
4
|
{{#if (eq api "trpc")}}
|
|
2
5
|
import { queryClient } from "@/utils/trpc";
|
|
3
6
|
{{/if}}
|
|
@@ -39,9 +42,9 @@ export default function RootLayout() {
|
|
|
39
42
|
backgroundColor: theme.colors.background,
|
|
40
43
|
},
|
|
41
44
|
headerTitleStyle: {
|
|
42
|
-
color: theme.colors.
|
|
45
|
+
color: theme.colors.foreground,
|
|
43
46
|
},
|
|
44
|
-
headerTintColor: theme.colors.
|
|
47
|
+
headerTintColor: theme.colors.foreground,
|
|
45
48
|
}}
|
|
46
49
|
>
|
|
47
50
|
<Stack.Screen name="(drawer)" options=\{{ headerShown: false }} />
|
|
@@ -62,9 +65,9 @@ export default function RootLayout() {
|
|
|
62
65
|
backgroundColor: theme.colors.background,
|
|
63
66
|
},
|
|
64
67
|
headerTitleStyle: {
|
|
65
|
-
color: theme.colors.
|
|
68
|
+
color: theme.colors.foreground,
|
|
66
69
|
},
|
|
67
|
-
headerTintColor: theme.colors.
|
|
70
|
+
headerTintColor: theme.colors.foreground,
|
|
68
71
|
}}
|
|
69
72
|
>
|
|
70
73
|
<Stack.Screen name="(drawer)" options=\{{ headerShown: false }} />
|
|
@@ -83,9 +86,9 @@ export default function RootLayout() {
|
|
|
83
86
|
backgroundColor: theme.colors.background,
|
|
84
87
|
},
|
|
85
88
|
headerTitleStyle: {
|
|
86
|
-
color: theme.colors.
|
|
89
|
+
color: theme.colors.foreground,
|
|
87
90
|
},
|
|
88
|
-
headerTintColor: theme.colors.
|
|
91
|
+
headerTintColor: theme.colors.foreground,
|
|
89
92
|
}}
|
|
90
93
|
>
|
|
91
94
|
<Stack.Screen name="(drawer)" options=\{{ headerShown: false }} />
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
import { Container } from "@/components/container";
|
|
2
|
-
import {
|
|
3
|
-
import { Platform, Text, View } from "react-native";
|
|
2
|
+
import { Text, View } from "react-native";
|
|
4
3
|
import { StyleSheet } from "react-native-unistyles";
|
|
5
4
|
|
|
6
5
|
export default function Modal() {
|
|
7
6
|
return (
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<Text style={styles.text}>Model</Text>
|
|
7
|
+
<Container>
|
|
8
|
+
<View style={styles.container}>
|
|
9
|
+
<View style={styles.header}>
|
|
10
|
+
<Text style={styles.title}>Modal</Text>
|
|
13
11
|
</View>
|
|
14
|
-
</
|
|
15
|
-
|
|
12
|
+
</View>
|
|
13
|
+
</Container>
|
|
16
14
|
);
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
const styles = StyleSheet.create((theme) => ({
|
|
20
|
-
text: {
|
|
21
|
-
color: theme.colors.typography,
|
|
22
|
-
},
|
|
23
18
|
container: {
|
|
24
19
|
flex: 1,
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
padding: theme.spacing.lg,
|
|
21
|
+
},
|
|
22
|
+
header: {
|
|
23
|
+
flexDirection: "row",
|
|
27
24
|
alignItems: "center",
|
|
25
|
+
justifyContent: "space-between",
|
|
26
|
+
marginBottom: theme.spacing.xl,
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
fontSize: theme.fontSize["2xl"],
|
|
30
|
+
fontWeight: "bold",
|
|
31
|
+
color: theme.colors.foreground,
|
|
28
32
|
},
|
|
29
33
|
}));
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { SafeAreaView } from "react-native";
|
|
3
3
|
import { StyleSheet } from "react-native-unistyles";
|
|
4
4
|
|
|
5
5
|
export const Container = ({ children }: { children: React.ReactNode }) => {
|
|
6
|
-
return <
|
|
6
|
+
return <SafeAreaView style={styles.container}>{children}</SafeAreaView>;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
const styles = StyleSheet.create((theme, rt) => ({
|
|
10
10
|
container: {
|
|
11
11
|
flex: 1,
|
|
12
|
-
paddingBottom: rt.insets.bottom,
|
|
13
12
|
backgroundColor: theme.colors.background,
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
translateY: rt.insets.ime * -1,
|
|
17
|
-
},
|
|
18
|
-
],
|
|
13
|
+
paddingBottom: rt.insets.bottom,
|
|
19
14
|
},
|
|
20
15
|
}));
|
|
@@ -1,31 +1,36 @@
|
|
|
1
|
-
import FontAwesome from
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import { Pressable
|
|
1
|
+
import FontAwesome from "@expo/vector-icons/FontAwesome";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Pressable } from "react-native";
|
|
4
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
4
5
|
|
|
5
|
-
export const HeaderButton = forwardRef<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
);
|
|
6
|
+
export const HeaderButton = forwardRef<
|
|
7
|
+
typeof Pressable,
|
|
8
|
+
{ onPress?: () => void }
|
|
9
|
+
>(({ onPress }, ref) => {
|
|
10
|
+
return (
|
|
11
|
+
<Pressable onPress={onPress} style={styles.button}>
|
|
12
|
+
{({ pressed }) => (
|
|
13
|
+
<FontAwesome
|
|
14
|
+
name="info-circle"
|
|
15
|
+
size={20}
|
|
16
|
+
color={styles.icon.color}
|
|
17
|
+
style={{
|
|
18
|
+
opacity: pressed ? 0.7 : 1,
|
|
19
|
+
}}
|
|
20
|
+
/>
|
|
21
|
+
)}
|
|
22
|
+
</Pressable>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const styles = StyleSheet.create((theme) => ({
|
|
27
|
+
button: {
|
|
28
|
+
padding: theme.spacing.sm,
|
|
29
|
+
marginRight: theme.spacing.sm,
|
|
30
|
+
borderRadius: theme.borderRadius.lg,
|
|
31
|
+
backgroundColor: `${theme.colors.secondary}80`, // 50% opacity
|
|
30
32
|
},
|
|
31
|
-
|
|
33
|
+
icon: {
|
|
34
|
+
color: theme.colors.secondaryForeground,
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import FontAwesome from
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
1
|
+
import FontAwesome from "@expo/vector-icons/FontAwesome";
|
|
3
2
|
|
|
4
3
|
export const TabBarIcon = (props: {
|
|
5
|
-
name: React.ComponentProps<typeof FontAwesome>[
|
|
4
|
+
name: React.ComponentProps<typeof FontAwesome>["name"];
|
|
6
5
|
color: string;
|
|
7
6
|
}) => {
|
|
8
|
-
return <FontAwesome size={
|
|
7
|
+
return <FontAwesome size={24} style={{ marginBottom: -3 }} {...props} />;
|
|
9
8
|
};
|
|
10
|
-
|
|
11
|
-
export const styles = StyleSheet.create({
|
|
12
|
-
tabBarIcon: {
|
|
13
|
-
marginBottom: -3,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"@react-navigation/bottom-tabs": "^7.0.5",
|
|
15
15
|
"@react-navigation/drawer": "^7.0.0",
|
|
16
16
|
"@react-navigation/native": "^7.0.3",
|
|
17
|
+
{{#if (includes examples "ai")}}
|
|
18
|
+
"@stardazed/streams-text-encoding": "^1.0.2",
|
|
19
|
+
"@ungap/structured-clone": "^1.3.0",
|
|
20
|
+
{{/if}}
|
|
17
21
|
"@tanstack/react-form": "^1.0.5",
|
|
18
22
|
"babel-plugin-react-compiler": "^19.0.0-beta-af1b7da-20250417",
|
|
19
23
|
"expo": "^53.0.8",
|
|
@@ -34,7 +38,7 @@
|
|
|
34
38
|
"react-native-reanimated": "~3.17.4",
|
|
35
39
|
"react-native-safe-area-context": "5.4.0",
|
|
36
40
|
"react-native-screens": "~4.10.0",
|
|
37
|
-
"react-native-unistyles": "3.0.0-rc.
|
|
41
|
+
"react-native-unistyles": "^3.0.0-rc.4",
|
|
38
42
|
"react-native-web": "^0.20.0"
|
|
39
43
|
},
|
|
40
44
|
"devDependencies": {
|
|
@@ -1,35 +1,98 @@
|
|
|
1
1
|
const sharedColors = {
|
|
2
2
|
success: "#22C55E",
|
|
3
|
-
destructive: "#
|
|
4
|
-
|
|
3
|
+
destructive: "#EF4444",
|
|
4
|
+
warning: "#F59E0B",
|
|
5
|
+
info: "#3B82F6",
|
|
5
6
|
} as const;
|
|
6
7
|
|
|
7
8
|
export const lightTheme = {
|
|
8
9
|
colors: {
|
|
9
10
|
...sharedColors,
|
|
10
|
-
typography: "
|
|
11
|
-
background: "
|
|
12
|
-
|
|
11
|
+
typography: "hsl(222.2 84% 4.9%)",
|
|
12
|
+
background: "hsl(0 0% 100%)",
|
|
13
|
+
foreground: "hsl(222.2 84% 4.9%)",
|
|
14
|
+
card: "hsl(0 0% 100%)",
|
|
15
|
+
cardForeground: "hsl(222.2 84% 4.9%)",
|
|
16
|
+
primary: "hsl(221.2 83.2% 53.3%)",
|
|
17
|
+
primaryForeground: "hsl(210 40% 98%)",
|
|
18
|
+
secondary: "hsl(210 40% 96%)",
|
|
19
|
+
secondaryForeground: "hsl(222.2 84% 4.9%)",
|
|
20
|
+
muted: "hsl(210 40% 96%)",
|
|
21
|
+
mutedForeground: "hsl(215.4 16.3% 46.9%)",
|
|
22
|
+
accent: "hsl(210 40% 96%)",
|
|
23
|
+
accentForeground: "hsl(222.2 84% 4.9%)",
|
|
24
|
+
border: "hsl(214.3 31.8% 91.4%)",
|
|
25
|
+
input: "hsl(214.3 31.8% 91.4%)",
|
|
26
|
+
ring: "hsl(221.2 83.2% 53.3%)",
|
|
13
27
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
spacing: {
|
|
29
|
+
xs: 4,
|
|
30
|
+
sm: 8,
|
|
31
|
+
md: 16,
|
|
32
|
+
lg: 24,
|
|
33
|
+
xl: 32,
|
|
34
|
+
xxl: 48,
|
|
35
|
+
},
|
|
36
|
+
borderRadius: {
|
|
37
|
+
sm: 6,
|
|
38
|
+
md: 8,
|
|
39
|
+
lg: 12,
|
|
40
|
+
xl: 16,
|
|
41
|
+
},
|
|
42
|
+
fontSize: {
|
|
43
|
+
xs: 12,
|
|
44
|
+
sm: 14,
|
|
45
|
+
base: 16,
|
|
46
|
+
lg: 18,
|
|
47
|
+
xl: 20,
|
|
48
|
+
"2xl": 24,
|
|
49
|
+
"3xl": 30,
|
|
50
|
+
"4xl": 36,
|
|
19
51
|
},
|
|
20
52
|
} as const;
|
|
21
53
|
|
|
22
54
|
export const darkTheme = {
|
|
23
55
|
colors: {
|
|
24
56
|
...sharedColors,
|
|
25
|
-
typography: "
|
|
26
|
-
background: "
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
57
|
+
typography: "hsl(210 40% 98%)",
|
|
58
|
+
background: "hsl(222.2 84% 4.9%)",
|
|
59
|
+
foreground: "hsl(210 40% 98%)",
|
|
60
|
+
card: "hsl(222.2 84% 4.9%)",
|
|
61
|
+
cardForeground: "hsl(210 40% 98%)",
|
|
62
|
+
primary: "hsl(217.2 91.2% 59.8%)",
|
|
63
|
+
primaryForeground: "hsl(222.2 84% 4.9%)",
|
|
64
|
+
secondary: "hsl(217.2 32.6% 17.5%)",
|
|
65
|
+
secondaryForeground: "hsl(210 40% 98%)",
|
|
66
|
+
muted: "hsl(217.2 32.6% 17.5%)",
|
|
67
|
+
mutedForeground: "hsl(215 20.2% 65.1%)",
|
|
68
|
+
accent: "hsl(217.2 32.6% 17.5%)",
|
|
69
|
+
accentForeground: "hsl(210 40% 98%)",
|
|
70
|
+
border: "hsl(217.2 32.6% 17.5%)",
|
|
71
|
+
input: "hsl(217.2 32.6% 17.5%)",
|
|
72
|
+
ring: "hsl(224.3 76.3% 94.1%)",
|
|
73
|
+
},
|
|
74
|
+
spacing: {
|
|
75
|
+
xs: 4,
|
|
76
|
+
sm: 8,
|
|
77
|
+
md: 16,
|
|
78
|
+
lg: 24,
|
|
79
|
+
xl: 32,
|
|
80
|
+
xxl: 48,
|
|
81
|
+
},
|
|
82
|
+
borderRadius: {
|
|
83
|
+
sm: 6,
|
|
84
|
+
md: 8,
|
|
85
|
+
lg: 12,
|
|
86
|
+
xl: 16,
|
|
87
|
+
},
|
|
88
|
+
fontSize: {
|
|
89
|
+
xs: 12,
|
|
90
|
+
sm: 14,
|
|
91
|
+
base: 16,
|
|
92
|
+
lg: 18,
|
|
93
|
+
xl: 20,
|
|
94
|
+
"2xl": 24,
|
|
95
|
+
"3xl": 30,
|
|
96
|
+
"4xl": 36,
|
|
34
97
|
},
|
|
35
98
|
} as const;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StyleSheet } from
|
|
1
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
2
2
|
|
|
3
|
-
import { breakpoints } from
|
|
4
|
-
import {
|
|
3
|
+
import { breakpoints } from "./breakpoints";
|
|
4
|
+
import { darkTheme, lightTheme } from "./theme";
|
|
5
5
|
|
|
6
6
|
type AppBreakpoints = typeof breakpoints;
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@ type AppThemes = {
|
|
|
10
10
|
dark: typeof darkTheme;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
declare module
|
|
13
|
+
declare module "react-native-unistyles" {
|
|
14
14
|
export interface UnistylesBreakpoints extends AppBreakpoints {}
|
|
15
15
|
export interface UnistylesThemes extends AppThemes {}
|
|
16
16
|
}
|
/package/templates/examples/todo/native/nativewind/app/{todo.tsx.hbs → (drawer)/todos.tsx.hbs}
RENAMED
|
File without changes
|