@digilogiclabs/create-saas-app 1.14.0 → 1.17.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.
Files changed (84) hide show
  1. package/README.md +134 -29
  2. package/bin/index.js +1 -1
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cli/prompts/project-setup.d.ts.map +1 -1
  5. package/dist/cli/prompts/project-setup.js +45 -12
  6. package/dist/cli/prompts/project-setup.js.map +1 -1
  7. package/dist/generators/template-generator.d.ts.map +1 -1
  8. package/dist/generators/template-generator.js +27 -4
  9. package/dist/generators/template-generator.js.map +1 -1
  10. package/dist/templates/mobile/ui-auth-payments/template/.env.example +20 -0
  11. package/dist/templates/mobile/ui-auth-payments/template/README.md +218 -0
  12. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/_layout.tsx +153 -0
  13. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/analytics.tsx +668 -0
  14. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/billing.tsx +743 -0
  15. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +676 -0
  16. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/orders.tsx +402 -0
  17. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/profile.tsx +580 -0
  18. package/dist/templates/mobile/ui-auth-payments/template/app/_layout.tsx +125 -0
  19. package/dist/templates/mobile/ui-auth-payments/template/app/auth/login.tsx +246 -0
  20. package/dist/templates/mobile/ui-auth-payments/template/app/auth/signup.tsx +362 -0
  21. package/dist/templates/mobile/ui-auth-payments/template/app/onboarding/index.tsx +193 -0
  22. package/dist/templates/mobile/ui-auth-payments/template/app/tour/index.tsx +272 -0
  23. package/dist/templates/mobile/ui-auth-payments/template/app.json +93 -0
  24. package/dist/templates/mobile/ui-auth-payments/template/babel.config.js +23 -0
  25. package/dist/templates/mobile/ui-auth-payments/template/eas.json +45 -0
  26. package/dist/templates/mobile/ui-auth-payments/template/expo-env.d.ts +3 -0
  27. package/dist/templates/mobile/ui-auth-payments/template/jest-setup.ts +74 -0
  28. package/dist/templates/mobile/ui-auth-payments/template/metro.config.js +11 -0
  29. package/dist/templates/mobile/ui-auth-payments/template/package.json +106 -0
  30. package/dist/templates/mobile/ui-auth-payments/template/tsconfig.json +31 -0
  31. package/dist/templates/web/base/template/src/app/dashboard/page.tsx +62 -20
  32. package/dist/templates/web/ui-auth/template/package.json +1 -1
  33. package/dist/templates/web/ui-auth-payments/template/package.json +1 -1
  34. package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +69 -17
  35. package/dist/templates/web/ui-auth-payments-ai/template/package.json +1 -1
  36. package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +218 -7
  37. package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +62 -9
  38. package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +364 -0
  39. package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +532 -0
  40. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +70 -51
  41. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +76 -60
  42. package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +1 -1
  43. package/dist/templates/web/ui-auth-payments-audio/template/package.json +1 -1
  44. package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +71 -17
  45. package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +1 -1
  46. package/dist/templates/web/ui-auth-payments-video/template/package.json +1 -1
  47. package/package.json +1 -1
  48. package/src/templates/mobile/ui-auth-payments/template/.env.example +20 -0
  49. package/src/templates/mobile/ui-auth-payments/template/README.md +218 -0
  50. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/_layout.tsx +153 -0
  51. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/analytics.tsx +668 -0
  52. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/billing.tsx +743 -0
  53. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +676 -0
  54. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/orders.tsx +402 -0
  55. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/profile.tsx +580 -0
  56. package/src/templates/mobile/ui-auth-payments/template/app/_layout.tsx +125 -0
  57. package/src/templates/mobile/ui-auth-payments/template/app/auth/login.tsx +246 -0
  58. package/src/templates/mobile/ui-auth-payments/template/app/auth/signup.tsx +362 -0
  59. package/src/templates/mobile/ui-auth-payments/template/app/onboarding/index.tsx +193 -0
  60. package/src/templates/mobile/ui-auth-payments/template/app/tour/index.tsx +272 -0
  61. package/src/templates/mobile/ui-auth-payments/template/app.json +93 -0
  62. package/src/templates/mobile/ui-auth-payments/template/babel.config.js +23 -0
  63. package/src/templates/mobile/ui-auth-payments/template/eas.json +45 -0
  64. package/src/templates/mobile/ui-auth-payments/template/expo-env.d.ts +3 -0
  65. package/src/templates/mobile/ui-auth-payments/template/jest-setup.ts +74 -0
  66. package/src/templates/mobile/ui-auth-payments/template/metro.config.js +11 -0
  67. package/src/templates/mobile/ui-auth-payments/template/package.json +106 -0
  68. package/src/templates/mobile/ui-auth-payments/template/tsconfig.json +31 -0
  69. package/src/templates/web/base/template/src/app/dashboard/page.tsx +62 -20
  70. package/src/templates/web/ui-auth/template/package.json +1 -1
  71. package/src/templates/web/ui-auth-payments/template/package.json +1 -1
  72. package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +69 -17
  73. package/src/templates/web/ui-auth-payments-ai/template/package.json +1 -1
  74. package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +218 -7
  75. package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +62 -9
  76. package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +364 -0
  77. package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +532 -0
  78. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +70 -51
  79. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +76 -60
  80. package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +1 -1
  81. package/src/templates/web/ui-auth-payments-audio/template/package.json +1 -1
  82. package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +71 -17
  83. package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +1 -1
  84. package/src/templates/web/ui-auth-payments-video/template/package.json +1 -1
@@ -0,0 +1,402 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { View, Text, StyleSheet, FlatList, RefreshControl, Animated } from 'react-native';
3
+ import { LinearGradient } from 'expo-linear-gradient';
4
+ import { BlurView } from 'expo-blur';
5
+ import * as Haptics from 'expo-haptics';
6
+
7
+ // UI Components - Updated for v0.22.0
8
+ import {
9
+ NativeCard as Card,
10
+ NativeMobileContainer as MobileContainer,
11
+ NativeButton as Button,
12
+ NativeBadge as Badge,
13
+ NativeSearchBar as SearchBar,
14
+ NativeFilterChips as FilterChips,
15
+ PageTransition,
16
+ VirtualScrollList,
17
+ SwipeableCard,
18
+ PullToRefresh,
19
+ LazyImage,
20
+ useTheme
21
+ } from '@digilogiclabs/saas-factory-ui/native';
22
+
23
+ // Icons
24
+ import {
25
+ ShoppingBag,
26
+ Calendar,
27
+ DollarSign,
28
+ Truck,
29
+ Package,
30
+ Eye
31
+ } from 'react-native-heroicons/outline';
32
+
33
+ interface Order {
34
+ id: string;
35
+ number: string;
36
+ customerName: string;
37
+ customerEmail: string;
38
+ status: 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled';
39
+ total: number;
40
+ items: number;
41
+ date: string;
42
+ shippingAddress: string;
43
+ }
44
+
45
+ const mockOrders: Order[] = [
46
+ {
47
+ id: '1',
48
+ number: 'ORD-001234',
49
+ customerName: 'John Doe',
50
+ customerEmail: 'john@example.com',
51
+ status: 'processing',
52
+ total: 299.99,
53
+ items: 3,
54
+ date: '2024-01-15',
55
+ shippingAddress: '123 Main St, City, State'
56
+ },
57
+ {
58
+ id: '2',
59
+ number: 'ORD-001233',
60
+ customerName: 'Jane Smith',
61
+ customerEmail: 'jane@example.com',
62
+ status: 'shipped',
63
+ total: 159.50,
64
+ items: 2,
65
+ date: '2024-01-14',
66
+ shippingAddress: '456 Oak Ave, City, State'
67
+ },
68
+ {
69
+ id: '3',
70
+ number: 'ORD-001232',
71
+ customerName: 'Mike Johnson',
72
+ customerEmail: 'mike@example.com',
73
+ status: 'delivered',
74
+ total: 89.99,
75
+ items: 1,
76
+ date: '2024-01-13',
77
+ shippingAddress: '789 Pine St, City, State'
78
+ },
79
+ {
80
+ id: '4',
81
+ number: 'ORD-001231',
82
+ customerName: 'Sarah Wilson',
83
+ customerEmail: 'sarah@example.com',
84
+ status: 'pending',
85
+ total: 449.99,
86
+ items: 4,
87
+ date: '2024-01-12',
88
+ shippingAddress: '321 Elm St, City, State'
89
+ },
90
+ ];
91
+
92
+ const statusConfig = {
93
+ pending: { color: '#f59e0b', bg: '#fef3c7', icon: Package },
94
+ processing: { color: '#3b82f6', bg: '#dbeafe', icon: ShoppingBag },
95
+ shipped: { color: '#8b5cf6', bg: '#ede9fe', icon: Truck },
96
+ delivered: { color: '#10b981', bg: '#dcfce7', icon: Package },
97
+ cancelled: { color: '#ef4444', bg: '#fee2e2', icon: Package }
98
+ };
99
+
100
+ export default function OrdersScreen() {
101
+ const [orders, setOrders] = useState<Order[]>(mockOrders);
102
+ const [filteredOrders, setFilteredOrders] = useState<Order[]>(mockOrders);
103
+ const [loading, setLoading] = useState(false);
104
+ const [refreshing, setRefreshing] = useState(false);
105
+ const [searchQuery, setSearchQuery] = useState('');
106
+ const [activeFilter, setActiveFilter] = useState<string>('all');
107
+
108
+ const filters = [
109
+ { id: 'all', label: 'All Orders' },
110
+ { id: 'pending', label: 'Pending' },
111
+ { id: 'processing', label: 'Processing' },
112
+ { id: 'shipped', label: 'Shipped' },
113
+ { id: 'delivered', label: 'Delivered' }
114
+ ];
115
+
116
+ useEffect(() => {
117
+ filterOrders();
118
+ }, [searchQuery, activeFilter, orders]);
119
+
120
+ const filterOrders = () => {
121
+ let filtered = orders;
122
+
123
+ // Filter by status
124
+ if (activeFilter !== 'all') {
125
+ filtered = filtered.filter(order => order.status === activeFilter);
126
+ }
127
+
128
+ // Filter by search query
129
+ if (searchQuery) {
130
+ filtered = filtered.filter(order =>
131
+ order.number.toLowerCase().includes(searchQuery.toLowerCase()) ||
132
+ order.customerName.toLowerCase().includes(searchQuery.toLowerCase()) ||
133
+ order.customerEmail.toLowerCase().includes(searchQuery.toLowerCase())
134
+ );
135
+ }
136
+
137
+ setFilteredOrders(filtered);
138
+ };
139
+
140
+ const onRefresh = async () => {
141
+ setRefreshing(true);
142
+ // Simulate API call
143
+ await new Promise(resolve => setTimeout(resolve, 1000));
144
+ setRefreshing(false);
145
+ };
146
+
147
+ const handleOrderPress = (order: Order) => {
148
+ // Navigate to order details
149
+ console.log('Order pressed:', order.id);
150
+ };
151
+
152
+ const renderOrderItem = ({ item: order }: { item: Order }) => {
153
+ const config = statusConfig[order.status];
154
+ const StatusIcon = config.icon;
155
+
156
+ return (
157
+ <Card style={styles.orderCard}>
158
+ <View style={styles.orderHeader}>
159
+ <View style={styles.orderInfo}>
160
+ <Text style={styles.orderNumber}>{order.number}</Text>
161
+ <Text style={styles.customerName}>{order.customerName}</Text>
162
+ </View>
163
+ <Badge
164
+ variant="outline"
165
+ style={[styles.statusBadge, { borderColor: config.color, backgroundColor: config.bg }]}
166
+ >
167
+ <StatusIcon width={12} height={12} color={config.color} />
168
+ <Text style={[styles.statusText, { color: config.color }]}>
169
+ {order.status.charAt(0).toUpperCase() + order.status.slice(1)}
170
+ </Text>
171
+ </Badge>
172
+ </View>
173
+
174
+ <View style={styles.orderDetails}>
175
+ <View style={styles.orderMeta}>
176
+ <View style={styles.metaItem}>
177
+ <Calendar width={16} height={16} color="#64748b" />
178
+ <Text style={styles.metaText}>{order.date}</Text>
179
+ </View>
180
+ <View style={styles.metaItem}>
181
+ <Package width={16} height={16} color="#64748b" />
182
+ <Text style={styles.metaText}>{order.items} items</Text>
183
+ </View>
184
+ <View style={styles.metaItem}>
185
+ <DollarSign width={16} height={16} color="#64748b" />
186
+ <Text style={styles.metaText}>${order.total.toFixed(2)}</Text>
187
+ </View>
188
+ </View>
189
+
190
+ <Button
191
+ variant="outline"
192
+ size="sm"
193
+ style={styles.viewButton}
194
+ onPress={() => handleOrderPress(order)}
195
+ >
196
+ <Eye width={16} height={16} />
197
+ <Text>View</Text>
198
+ </Button>
199
+ </View>
200
+
201
+ <Text style={styles.shippingAddress} numberOfLines={1}>
202
+ Ship to: {order.shippingAddress}
203
+ </Text>
204
+ </Card>
205
+ );
206
+ };
207
+
208
+ const renderEmptyState = () => (
209
+ <View style={styles.emptyState}>
210
+ <ShoppingBag width={64} height={64} color="#94a3b8" />
211
+ <Text style={styles.emptyTitle}>No orders found</Text>
212
+ <Text style={styles.emptySubtitle}>
213
+ {searchQuery || activeFilter !== 'all'
214
+ ? 'Try adjusting your filters'
215
+ : 'Orders will appear here when customers make purchases'
216
+ }
217
+ </Text>
218
+ </View>
219
+ );
220
+
221
+ return (
222
+ <PageTransition type="fade">
223
+ <MobileContainer style={styles.container}>
224
+ {/* Search and Filters */}
225
+ <View style={styles.searchSection}>
226
+ <SearchBar
227
+ placeholder="Search orders..."
228
+ value={searchQuery}
229
+ onChangeText={setSearchQuery}
230
+ style={styles.searchBar}
231
+ />
232
+ <FilterChips
233
+ filters={filters}
234
+ activeFilter={activeFilter}
235
+ onFilterChange={setActiveFilter}
236
+ style={styles.filterChips}
237
+ />
238
+ </View>
239
+
240
+ {/* Enhanced Orders List with VirtualScrollList for Performance */}
241
+ <VirtualScrollList
242
+ data={filteredOrders}
243
+ renderItem={({ item, index }) => (
244
+ <SwipeableCard
245
+ key={item.id}
246
+ leftActions={[
247
+ {
248
+ label: 'Archive',
249
+ color: '#6b7280',
250
+ onPress: () => console.log('Archive order:', item.id)
251
+ }
252
+ ]}
253
+ rightActions={[
254
+ {
255
+ label: 'Edit',
256
+ color: '#3b82f6',
257
+ onPress: () => console.log('Edit order:', item.id)
258
+ },
259
+ {
260
+ label: 'Delete',
261
+ color: '#ef4444',
262
+ onPress: () => console.log('Delete order:', item.id)
263
+ }
264
+ ]}
265
+ hapticFeedback={true}
266
+ >
267
+ {renderOrderItem({ item, index })}
268
+ </SwipeableCard>
269
+ )}
270
+ keyExtractor={(item) => item.id}
271
+ itemHeight={120} // Approximate height for performance optimization
272
+ onRefresh={onRefresh}
273
+ refreshing={refreshing}
274
+ ListEmptyComponent={renderEmptyState}
275
+ showsVerticalScrollIndicator={false}
276
+ contentContainerStyle={styles.listContent}
277
+ estimatedItemSize={120}
278
+ windowSize={10}
279
+ maxToRenderPerBatch={5}
280
+ updateCellsBatchingPeriod={50}
281
+ removeClippedSubviews={true}
282
+ />
283
+ </MobileContainer>
284
+ </PageTransition>
285
+ );
286
+ }
287
+
288
+ const styles = StyleSheet.create({
289
+ container: {
290
+ flex: 1,
291
+ backgroundColor: '#f8fafc',
292
+ },
293
+ searchSection: {
294
+ paddingHorizontal: 16,
295
+ paddingVertical: 16,
296
+ backgroundColor: 'white',
297
+ borderBottomWidth: 1,
298
+ borderBottomColor: '#e2e8f0',
299
+ },
300
+ searchBar: {
301
+ marginBottom: 16,
302
+ },
303
+ filterChips: {
304
+ marginBottom: 8,
305
+ },
306
+ listContent: {
307
+ padding: 16,
308
+ paddingBottom: 32,
309
+ },
310
+ orderCard: {
311
+ padding: 16,
312
+ marginBottom: 12,
313
+ backgroundColor: 'white',
314
+ borderRadius: 12,
315
+ shadowColor: '#000',
316
+ shadowOffset: { width: 0, height: 1 },
317
+ shadowOpacity: 0.05,
318
+ shadowRadius: 2,
319
+ elevation: 1,
320
+ },
321
+ orderHeader: {
322
+ flexDirection: 'row',
323
+ justifyContent: 'space-between',
324
+ alignItems: 'flex-start',
325
+ marginBottom: 12,
326
+ },
327
+ orderInfo: {
328
+ flex: 1,
329
+ },
330
+ orderNumber: {
331
+ fontSize: 16,
332
+ fontWeight: '600',
333
+ color: '#1e293b',
334
+ marginBottom: 4,
335
+ },
336
+ customerName: {
337
+ fontSize: 14,
338
+ color: '#64748b',
339
+ },
340
+ statusBadge: {
341
+ flexDirection: 'row',
342
+ alignItems: 'center',
343
+ gap: 4,
344
+ paddingHorizontal: 8,
345
+ paddingVertical: 4,
346
+ borderRadius: 12,
347
+ },
348
+ statusText: {
349
+ fontSize: 12,
350
+ fontWeight: '500',
351
+ },
352
+ orderDetails: {
353
+ flexDirection: 'row',
354
+ justifyContent: 'space-between',
355
+ alignItems: 'center',
356
+ marginBottom: 12,
357
+ },
358
+ orderMeta: {
359
+ flexDirection: 'row',
360
+ gap: 16,
361
+ },
362
+ metaItem: {
363
+ flexDirection: 'row',
364
+ alignItems: 'center',
365
+ gap: 4,
366
+ },
367
+ metaText: {
368
+ fontSize: 12,
369
+ color: '#64748b',
370
+ },
371
+ viewButton: {
372
+ flexDirection: 'row',
373
+ alignItems: 'center',
374
+ gap: 4,
375
+ paddingHorizontal: 12,
376
+ paddingVertical: 6,
377
+ },
378
+ shippingAddress: {
379
+ fontSize: 12,
380
+ color: '#94a3b8',
381
+ fontStyle: 'italic',
382
+ },
383
+ emptyState: {
384
+ alignItems: 'center',
385
+ justifyContent: 'center',
386
+ paddingVertical: 64,
387
+ paddingHorizontal: 32,
388
+ },
389
+ emptyTitle: {
390
+ fontSize: 18,
391
+ fontWeight: '600',
392
+ color: '#64748b',
393
+ marginTop: 16,
394
+ marginBottom: 8,
395
+ },
396
+ emptySubtitle: {
397
+ fontSize: 14,
398
+ color: '#94a3b8',
399
+ textAlign: 'center',
400
+ lineHeight: 20,
401
+ },
402
+ });