@teardown/cli 2.0.65 → 2.0.67
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/package.json +2 -2
- package/src/templates/generator.ts +66 -42
- package/templates/{src/index.tsx → index.tsx} +5 -2
- package/templates/metro.config.js +7 -35
- package/templates/src/components/ui/accordion.tsx +23 -21
- package/templates/src/components/ui/card.tsx +28 -26
- package/templates/src/components/ui/checkbox.tsx +12 -10
- package/templates/src/components/ui/dialog.tsx +30 -28
- package/templates/src/components/ui/divider.tsx +6 -6
- package/templates/src/components/ui/form-field.tsx +2 -2
- package/templates/src/components/ui/pressable-feedback.tsx +2 -2
- package/templates/src/components/ui/radio-group.tsx +37 -35
- package/templates/src/components/ui/scroll-shadow.tsx +4 -4
- package/templates/src/components/ui/select.tsx +31 -29
- package/templates/src/components/ui/skeleton-group.tsx +2 -2
- package/templates/src/components/ui/skeleton.tsx +2 -2
- package/templates/src/components/ui/spinner.tsx +2 -2
- package/templates/src/components/ui/tabs.tsx +25 -23
- package/templates/src/global.css +86 -70
- package/templates/src/navigation/navigation-provider.tsx +8 -1
- package/templates/src/navigation/router.tsx +12 -95
- package/templates/src/providers/app.provider.tsx +8 -12
- package/templates/src/routes/_layout.tsx +2 -4
- package/templates/src/routes/home.tsx +112 -0
- package/templates/tsconfig.json +10 -12
- package/templates/index.ts +0 -11
- package/templates/src/components/ui/index.ts +0 -100
- package/templates/src/routes/(tabs)/_layout.tsx +0 -42
- package/templates/src/routes/(tabs)/explore.tsx +0 -161
- package/templates/src/routes/(tabs)/home.tsx +0 -138
- package/templates/src/routes/(tabs)/profile.tsx +0 -114
- package/templates/src/routes/settings.tsx +0 -184
- package/templates/src/screens/auth/index.ts +0 -6
- package/templates/src/screens/auth/login.tsx +0 -165
- package/templates/src/screens/auth/register.tsx +0 -203
- package/templates/src/screens/home.tsx +0 -204
- package/templates/src/screens/index.ts +0 -17
- package/templates/src/screens/profile.tsx +0 -210
- package/templates/src/screens/settings.tsx +0 -216
- package/templates/src/screens/welcome.tsx +0 -101
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Settings Screen
|
|
3
|
-
*
|
|
4
|
-
* App settings and preferences.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { useState } from "react";
|
|
8
|
-
import { View, ScrollView, Switch, Pressable } from "react-native";
|
|
9
|
-
import { Text, Card, CardContent, Separator, Badge } from "@/components/ui";
|
|
10
|
-
|
|
11
|
-
interface SettingsScreenProps {
|
|
12
|
-
onBack?: () => void;
|
|
13
|
-
version?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function SettingsScreen({
|
|
17
|
-
onBack,
|
|
18
|
-
version = "1.0.0",
|
|
19
|
-
}: SettingsScreenProps): React.JSX.Element {
|
|
20
|
-
const [notifications, setNotifications] = useState(true);
|
|
21
|
-
const [darkMode, setDarkMode] = useState(false);
|
|
22
|
-
const [haptics, setHaptics] = useState(true);
|
|
23
|
-
const [analytics, setAnalytics] = useState(true);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<ScrollView className="flex-1 bg-background">
|
|
27
|
-
{/* Header */}
|
|
28
|
-
<View className="flex-row items-center gap-4 px-6 py-4 border-b border-border">
|
|
29
|
-
<Pressable onPress={onBack} className="p-2 -ml-2">
|
|
30
|
-
<Text className="text-xl">←</Text>
|
|
31
|
-
</Pressable>
|
|
32
|
-
<Text variant="h3">Settings</Text>
|
|
33
|
-
</View>
|
|
34
|
-
|
|
35
|
-
<View className="p-6 gap-6">
|
|
36
|
-
{/* Preferences */}
|
|
37
|
-
<SettingsSection title="Preferences">
|
|
38
|
-
<ToggleRow
|
|
39
|
-
icon="🔔"
|
|
40
|
-
label="Push Notifications"
|
|
41
|
-
description="Receive push notifications"
|
|
42
|
-
value={notifications}
|
|
43
|
-
onValueChange={setNotifications}
|
|
44
|
-
/>
|
|
45
|
-
<Separator />
|
|
46
|
-
<ToggleRow
|
|
47
|
-
icon="🌙"
|
|
48
|
-
label="Dark Mode"
|
|
49
|
-
description="Use dark color theme"
|
|
50
|
-
value={darkMode}
|
|
51
|
-
onValueChange={setDarkMode}
|
|
52
|
-
/>
|
|
53
|
-
<Separator />
|
|
54
|
-
<ToggleRow
|
|
55
|
-
icon="📳"
|
|
56
|
-
label="Haptic Feedback"
|
|
57
|
-
description="Enable haptic feedback"
|
|
58
|
-
value={haptics}
|
|
59
|
-
onValueChange={setHaptics}
|
|
60
|
-
/>
|
|
61
|
-
</SettingsSection>
|
|
62
|
-
|
|
63
|
-
{/* Account */}
|
|
64
|
-
<SettingsSection title="Account">
|
|
65
|
-
<LinkRow icon="👤" label="Edit Profile" onPress={() => {}} />
|
|
66
|
-
<Separator />
|
|
67
|
-
<LinkRow icon="🔐" label="Change Password" onPress={() => {}} />
|
|
68
|
-
<Separator />
|
|
69
|
-
<LinkRow icon="📧" label="Email Preferences" onPress={() => {}} />
|
|
70
|
-
<Separator />
|
|
71
|
-
<LinkRow
|
|
72
|
-
icon="💳"
|
|
73
|
-
label="Subscription"
|
|
74
|
-
badge="PRO"
|
|
75
|
-
onPress={() => {}}
|
|
76
|
-
/>
|
|
77
|
-
</SettingsSection>
|
|
78
|
-
|
|
79
|
-
{/* Privacy */}
|
|
80
|
-
<SettingsSection title="Privacy & Data">
|
|
81
|
-
<ToggleRow
|
|
82
|
-
icon="📊"
|
|
83
|
-
label="Analytics"
|
|
84
|
-
description="Help improve the app"
|
|
85
|
-
value={analytics}
|
|
86
|
-
onValueChange={setAnalytics}
|
|
87
|
-
/>
|
|
88
|
-
<Separator />
|
|
89
|
-
<LinkRow icon="🛡️" label="Privacy Policy" onPress={() => {}} />
|
|
90
|
-
<Separator />
|
|
91
|
-
<LinkRow icon="📋" label="Terms of Service" onPress={() => {}} />
|
|
92
|
-
<Separator />
|
|
93
|
-
<LinkRow
|
|
94
|
-
icon="🗑️"
|
|
95
|
-
label="Delete Account"
|
|
96
|
-
destructive
|
|
97
|
-
onPress={() => {}}
|
|
98
|
-
/>
|
|
99
|
-
</SettingsSection>
|
|
100
|
-
|
|
101
|
-
{/* Support */}
|
|
102
|
-
<SettingsSection title="Support">
|
|
103
|
-
<LinkRow icon="❓" label="Help Center" onPress={() => {}} />
|
|
104
|
-
<Separator />
|
|
105
|
-
<LinkRow icon="💬" label="Contact Support" onPress={() => {}} />
|
|
106
|
-
<Separator />
|
|
107
|
-
<LinkRow icon="⭐" label="Rate the App" onPress={() => {}} />
|
|
108
|
-
</SettingsSection>
|
|
109
|
-
|
|
110
|
-
{/* About */}
|
|
111
|
-
<SettingsSection title="About">
|
|
112
|
-
<View className="flex-row items-center justify-between py-3">
|
|
113
|
-
<View className="flex-row items-center gap-3">
|
|
114
|
-
<Text className="text-lg">📱</Text>
|
|
115
|
-
<Text>Version</Text>
|
|
116
|
-
</View>
|
|
117
|
-
<Text variant="muted">{version}</Text>
|
|
118
|
-
</View>
|
|
119
|
-
<Separator />
|
|
120
|
-
<LinkRow icon="📜" label="Licenses" onPress={() => {}} />
|
|
121
|
-
</SettingsSection>
|
|
122
|
-
|
|
123
|
-
{/* Footer */}
|
|
124
|
-
<View className="items-center py-8">
|
|
125
|
-
<Text variant="muted">Made with ❤️ using Teardown CLI</Text>
|
|
126
|
-
<Text variant="muted" className="mt-1">
|
|
127
|
-
Powered by Uniwind + Tailwind CSS
|
|
128
|
-
</Text>
|
|
129
|
-
</View>
|
|
130
|
-
</View>
|
|
131
|
-
</ScrollView>
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function SettingsSection({
|
|
136
|
-
title,
|
|
137
|
-
children,
|
|
138
|
-
}: {
|
|
139
|
-
title: string;
|
|
140
|
-
children: React.ReactNode;
|
|
141
|
-
}): React.JSX.Element {
|
|
142
|
-
return (
|
|
143
|
-
<View className="gap-2">
|
|
144
|
-
<Text variant="label" className="text-muted-foreground px-1">
|
|
145
|
-
{title}
|
|
146
|
-
</Text>
|
|
147
|
-
<Card>
|
|
148
|
-
<CardContent className="py-2">{children}</CardContent>
|
|
149
|
-
</Card>
|
|
150
|
-
</View>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function ToggleRow({
|
|
155
|
-
icon,
|
|
156
|
-
label,
|
|
157
|
-
description,
|
|
158
|
-
value,
|
|
159
|
-
onValueChange,
|
|
160
|
-
}: {
|
|
161
|
-
icon: string;
|
|
162
|
-
label: string;
|
|
163
|
-
description?: string;
|
|
164
|
-
value: boolean;
|
|
165
|
-
onValueChange: (value: boolean) => void;
|
|
166
|
-
}): React.JSX.Element {
|
|
167
|
-
return (
|
|
168
|
-
<View className="flex-row items-center justify-between py-3">
|
|
169
|
-
<View className="flex-row items-center gap-3 flex-1">
|
|
170
|
-
<Text className="text-lg">{icon}</Text>
|
|
171
|
-
<View className="flex-1">
|
|
172
|
-
<Text>{label}</Text>
|
|
173
|
-
{description && <Text variant="muted">{description}</Text>}
|
|
174
|
-
</View>
|
|
175
|
-
</View>
|
|
176
|
-
<Switch
|
|
177
|
-
value={value}
|
|
178
|
-
onValueChange={onValueChange}
|
|
179
|
-
trackColor={{ false: "#e2e8f0", true: "#3b82f6" }}
|
|
180
|
-
thumbColor="#ffffff"
|
|
181
|
-
/>
|
|
182
|
-
</View>
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function LinkRow({
|
|
187
|
-
icon,
|
|
188
|
-
label,
|
|
189
|
-
badge,
|
|
190
|
-
destructive,
|
|
191
|
-
onPress,
|
|
192
|
-
}: {
|
|
193
|
-
icon: string;
|
|
194
|
-
label: string;
|
|
195
|
-
badge?: string;
|
|
196
|
-
destructive?: boolean;
|
|
197
|
-
onPress: () => void;
|
|
198
|
-
}): React.JSX.Element {
|
|
199
|
-
return (
|
|
200
|
-
<Pressable
|
|
201
|
-
className="flex-row items-center justify-between py-3 active:bg-muted rounded-lg px-2 -mx-2"
|
|
202
|
-
onPress={onPress}
|
|
203
|
-
>
|
|
204
|
-
<View className="flex-row items-center gap-3">
|
|
205
|
-
<Text className="text-lg">{icon}</Text>
|
|
206
|
-
<Text className={destructive ? "text-destructive" : ""}>{label}</Text>
|
|
207
|
-
</View>
|
|
208
|
-
<View className="flex-row items-center gap-2">
|
|
209
|
-
{badge && <Badge variant="default">{badge}</Badge>}
|
|
210
|
-
<Text className="text-muted-foreground">›</Text>
|
|
211
|
-
</View>
|
|
212
|
-
</Pressable>
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export default SettingsScreen;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Welcome Screen
|
|
3
|
-
*
|
|
4
|
-
* The landing/onboarding screen for the app.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { View, ScrollView, Image } from "react-native";
|
|
9
|
-
import { Text, Button, Card, CardContent } from "@/components/ui";
|
|
10
|
-
|
|
11
|
-
interface WelcomeScreenProps {
|
|
12
|
-
onGetStarted?: () => void;
|
|
13
|
-
onSignIn?: () => void;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function WelcomeScreen({ onGetStarted, onSignIn }: WelcomeScreenProps): React.JSX.Element {
|
|
17
|
-
return (
|
|
18
|
-
<ScrollView className="flex-1 bg-background" contentContainerClassName="flex-grow">
|
|
19
|
-
<View className="flex-1 px-6 py-12">
|
|
20
|
-
{/* Hero Section */}
|
|
21
|
-
<View className="flex-1 items-center justify-center gap-8">
|
|
22
|
-
{/* Logo/Icon Placeholder */}
|
|
23
|
-
<View className="h-24 w-24 items-center justify-center rounded-3xl bg-primary">
|
|
24
|
-
<Text className="text-4xl font-bold text-primary-foreground">T</Text>
|
|
25
|
-
</View>
|
|
26
|
-
|
|
27
|
-
{/* Welcome Text */}
|
|
28
|
-
<View className="items-center gap-4">
|
|
29
|
-
<Text variant="h1" className="text-center">
|
|
30
|
-
Welcome to <%= appName %>
|
|
31
|
-
</Text>
|
|
32
|
-
<Text variant="lead" className="text-center">
|
|
33
|
-
Build beautiful React Native apps with the power of Tailwind CSS
|
|
34
|
-
</Text>
|
|
35
|
-
</View>
|
|
36
|
-
|
|
37
|
-
{/* Feature Cards */}
|
|
38
|
-
<View className="w-full gap-4 mt-8">
|
|
39
|
-
<FeatureCard
|
|
40
|
-
icon="lightning"
|
|
41
|
-
title="Fast Development"
|
|
42
|
-
description="Build UIs rapidly with utility-first CSS classes"
|
|
43
|
-
/>
|
|
44
|
-
<FeatureCard
|
|
45
|
-
icon="palette"
|
|
46
|
-
title="Beautiful Design"
|
|
47
|
-
description="Pre-built components following modern design principles"
|
|
48
|
-
/>
|
|
49
|
-
<FeatureCard
|
|
50
|
-
icon="code"
|
|
51
|
-
title="Type-Safe"
|
|
52
|
-
description="Full TypeScript support for better DX"
|
|
53
|
-
/>
|
|
54
|
-
</View>
|
|
55
|
-
</View>
|
|
56
|
-
|
|
57
|
-
{/* Action Buttons */}
|
|
58
|
-
<View className="gap-4 mt-12">
|
|
59
|
-
<Button size="lg" fullWidth onPress={onGetStarted}>
|
|
60
|
-
Get Started
|
|
61
|
-
</Button>
|
|
62
|
-
<Button variant="outline" size="lg" fullWidth onPress={onSignIn}>
|
|
63
|
-
I already have an account
|
|
64
|
-
</Button>
|
|
65
|
-
</View>
|
|
66
|
-
</View>
|
|
67
|
-
</ScrollView>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
interface FeatureCardProps {
|
|
72
|
-
icon: "lightning" | "palette" | "code";
|
|
73
|
-
title: string;
|
|
74
|
-
description: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function FeatureCard({ icon, title, description }: FeatureCardProps): React.JSX.Element {
|
|
78
|
-
const iconMap = {
|
|
79
|
-
lightning: "bolt.fill",
|
|
80
|
-
palette: "paintpalette.fill",
|
|
81
|
-
code: "chevron.left.forwardslash.chevron.right",
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<Card>
|
|
86
|
-
<CardContent className="flex-row items-center gap-4 py-4">
|
|
87
|
-
<View className="h-12 w-12 items-center justify-center rounded-xl bg-primary/10">
|
|
88
|
-
<Text className="text-2xl text-primary">
|
|
89
|
-
{icon === "lightning" ? "⚡" : icon === "palette" ? "🎨" : "⌨️"}
|
|
90
|
-
</Text>
|
|
91
|
-
</View>
|
|
92
|
-
<View className="flex-1">
|
|
93
|
-
<Text variant="large">{title}</Text>
|
|
94
|
-
<Text variant="muted">{description}</Text>
|
|
95
|
-
</View>
|
|
96
|
-
</CardContent>
|
|
97
|
-
</Card>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export default WelcomeScreen;
|