create-expo-stack 2.1.19 → 2.1.21

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.
@@ -25,7 +25,7 @@
25
25
  <% if (props.navigationPackage?.type === "navigation") { %>
26
26
  "@react-navigation/native": "^6.1.7",
27
27
  "react-native-gesture-handler": "~2.12.0",
28
- "react-native-safe-area-context": "4.6.3",
28
+ "react-native-safe-area-context": "^4.6.3",
29
29
  "react-native-screens": "~3.22.0",
30
30
  <% } %>
31
31
 
@@ -87,5 +87,12 @@
87
87
  <% } else { %>
88
88
  "main": "node_modules/expo/AppEntry.js",
89
89
  <% } %>
90
+ <% if (props.navigationPackage?.type === "navigation") { %>
91
+ "expo": {
92
+ "install": {
93
+ "exclude": ["react-native-safe-area-context"]
94
+ }
95
+ },
96
+ <% } %>
90
97
  "private": true
91
98
  }
@@ -4,7 +4,7 @@ import { Feather } from "@expo/vector-icons";
4
4
  import { Text, TouchableOpacity, View } from "react-native";
5
5
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
6
6
  import React, { useEffect } from "react";
7
- import { TamaguiProvider, Button } from "tamagui";
7
+ import { TamaguiProvider, Button, Text } from "tamagui";
8
8
  import { useFonts } from "expo-font";
9
9
  import { Stack, useRouter, SplashScreen } from "expo-router";
10
10
 
@@ -42,7 +42,7 @@ export default function Layout() {
42
42
  if (!loaded) return null;
43
43
 
44
44
  const BackButton = () => (
45
- <Button onPress={router.back} icon={<Feather name="chevron-left" size={16} color="#007AFF" />}>Back</Button>
45
+ <Button unstyled flexDirection="row" backgroundColor="transparent" paddingLeft={0} pressStyle={{ opacity: 0.5 }} onPress={router.back} icon={<Feather name="chevron-left" size={16} color="#007AFF" />}><Text color="#007AFF">Back</Text></Button>
46
46
  )
47
47
  <% } else { %>
48
48
  const BackButton = () => (
@@ -58,7 +58,7 @@ export default function Layout() {
58
58
  return (
59
59
  <% if (props.stylingPackage?.name === "tamagui") { %>
60
60
  <TamaguiProvider config={config}>
61
- <% } %>
61
+ <% } %>
62
62
  <Stack>
63
63
  <Stack.Screen name="index" options={{ title: "Overview" }} />
64
64
  <Stack.Screen name="details"
@@ -1,7 +1,8 @@
1
1
  <% if (props.stylingPackage?.name === "nativewind") { %>
2
2
  import { View, Text } from "react-native";
3
3
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
4
- import { YStack, H2, Paragraph } from "tamagui";
4
+ import { YStack } from "tamagui";
5
+ import { Container, Main, Subtitle, Title } from "../tamagui.config";
5
6
  <% } else { %>
6
7
  import { StyleSheet, View, Text } from "react-native";
7
8
  <% } %>
@@ -9,34 +10,32 @@ import { useLocalSearchParams } from "expo-router";
9
10
 
10
11
  export default function Details() {
11
12
  const { name } = useLocalSearchParams();
13
+ return (
12
14
  <% if (props.stylingPackage?.name === "nativewind") { %>
13
- return (
14
- <View className={styles.container}>
15
- <View className={styles.main}>
16
- <Text className={styles.title}>Details</Text>
17
- <Text className={styles.subtitle}>Showing details for user {name}.</Text>
18
- </View>
15
+ <View className={styles.container}>
16
+ <View className={styles.main}>
17
+ <Text className={styles.title}>Details</Text>
18
+ <Text className={styles.subtitle}>Showing details for user {name}.</Text>
19
19
  </View>
20
- );
20
+ </View>
21
21
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
22
- return (
23
- <YStack flex={1} padding="$2">
24
- <YStack flex={1} maxWidth="100%">
25
- <H2>Details</H2>
26
- <Paragraph theme="alt1">Showing details for user {name}.</Paragraph>
22
+ <Container>
23
+ <Main>
24
+ <YStack>
25
+ <Title>Details</Title>
26
+ <Subtitle>Showing details for user {name}.</Subtitle>
27
27
  </YStack>
28
- </YStack>
29
- );
28
+ </Main>
29
+ </Container>
30
30
  <% } else { %>
31
- return (
32
- <View style={styles.container}>
33
- <View style={styles.main}>
34
- <Text style={styles.title}>Details</Text>
35
- <Text style={styles.subtitle}>Showing details for user {name}.</Text>
36
- </View>
31
+ <View style={styles.container}>
32
+ <View style={styles.main}>
33
+ <Text style={styles.title}>Details</Text>
34
+ <Text style={styles.subtitle}>Showing details for user {name}.</Text>
37
35
  </View>
38
- );
36
+ </View>
39
37
  <% } %>
38
+ );
40
39
  }
41
40
 
42
41
  <% if (props.stylingPackage?.name === "nativewind") { %>
@@ -1,60 +1,57 @@
1
1
  <% if (props.stylingPackage?.name === "nativewind") { %>
2
2
  import { Text, TouchableOpacity, View } from "react-native";
3
3
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
4
- import { YStack, H2, Paragraph, Button } from "tamagui"
4
+ import { YStack } from "tamagui";
5
+ import { Container, Main, Title, Subtitle, Button, ButtonText } from '../tamagui.config';
5
6
  <% } else { %>
6
7
  import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
7
8
  <% } %>
8
9
  import { Link } from "expo-router";
9
10
 
10
11
  export default function Page() {
12
+ return (
11
13
  <% if (props.stylingPackage?.name === "nativewind") { %>
12
- return (
13
- <View className={styles.container}>
14
- <View className={styles.main}>
15
- <View>
16
- <Text className={styles.title}>Hello World</Text>
17
- <Text className={styles.subtitle}>This is the first page of your app.</Text>
18
- </View>
19
- <Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
20
- <TouchableOpacity className={styles.button} >
21
- <Text className={styles.buttonText}>Show Details</Text>
22
- </TouchableOpacity>
23
- </Link>
14
+ <View className={styles.container}>
15
+ <View className={styles.main}>
16
+ <View>
17
+ <Text className={styles.title}>Hello World</Text>
18
+ <Text className={styles.subtitle}>This is the first page of your app.</Text>
24
19
  </View>
20
+ <Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
21
+ <TouchableOpacity className={styles.button} >
22
+ <Text className={styles.buttonText}>Show Details</Text>
23
+ </TouchableOpacity>
24
+ </Link>
25
25
  </View>
26
- );
26
+ </View>
27
27
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
28
- return (
29
- <YStack flex={1} padding="$3">
30
- <YStack flex={1} maxWidth="100%" justifyContent="space-between">
31
- <YStack>
32
- <H2>Hello World</H2>
33
- <Paragraph>This is the first page of your app.</Paragraph>
34
- </YStack>
35
- <Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
36
- <Button>Show Details</Button>
37
- </Link>
28
+ <Container>
29
+ <Main>
30
+ <YStack>
31
+ <Title>Hello World</Title>
32
+ <Subtitle>This is the first page of your app.</Subtitle>
38
33
  </YStack>
39
- </YStack>
40
- )
34
+ <Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
35
+ <Button><ButtonText>Show Details</ButtonText></Button>
36
+ </Link>
37
+ </Main>
38
+ </Container>
41
39
  <% } else { %>
42
- return (
43
- <View style={styles.container}>
44
- <View style={styles.main}>
45
- <View>
46
- <Text style={styles.title}>Hello World</Text>
47
- <Text style={styles.subtitle}>This is the first page of your app.</Text>
48
- </View>
49
- <Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
50
- <TouchableOpacity style={styles.button} >
51
- <Text style={styles.buttonText}>Show Details</Text>
52
- </TouchableOpacity>
53
- </Link>
40
+ <View style={styles.container}>
41
+ <View style={styles.main}>
42
+ <View>
43
+ <Text style={styles.title}>Hello World</Text>
44
+ <Text style={styles.subtitle}>This is the first page of your app.</Text>
54
45
  </View>
46
+ <Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
47
+ <TouchableOpacity style={styles.button} >
48
+ <Text style={styles.buttonText}>Show Details</Text>
49
+ </TouchableOpacity>
50
+ </Link>
55
51
  </View>
56
- );
52
+ </View>
57
53
  <% } %>
54
+ );
58
55
  }
59
56
 
60
57
  <% if (props.stylingPackage?.name === "nativewind") { %>
@@ -1,9 +1,9 @@
1
- import { createTamagui } from 'tamagui'
2
- import { createInterFont } from '@tamagui/font-inter'
3
- import { shorthands } from '@tamagui/shorthands'
4
- import { themes, tokens } from '@tamagui/themes'
5
- import { createMedia } from '@tamagui/react-native-media-driver'
6
- import { createAnimations } from '@tamagui/animations-react-native'
1
+ import { createAnimations } from "@tamagui/animations-react-native";
2
+ import { createInterFont } from "@tamagui/font-inter";
3
+ import { createMedia } from "@tamagui/react-native-media-driver";
4
+ import { shorthands } from "@tamagui/shorthands";
5
+ import { themes, tokens } from "@tamagui/themes";
6
+ import { createTamagui, styled, Text, YStack } from "tamagui";
7
7
 
8
8
  export const animations = createAnimations({
9
9
  bouncy: {
@@ -23,54 +23,60 @@ export const animations = createAnimations({
23
23
  mass: 1.2,
24
24
  stiffness: 250,
25
25
  },
26
- })
26
+ });
27
27
 
28
- const headingFont = createInterFont({
29
- size: {
30
- 6: 15,
31
- },
32
- transform: {
33
- 6: 'uppercase',
34
- 7: 'none',
35
- },
36
- weight: {
37
- 6: '400',
38
- 7: '700',
39
- },
40
- color: {
41
- 6: '$colorFocus',
42
- 7: '$color',
43
- },
44
- letterSpacing: {
45
- 5: 2,
46
- 6: 1,
47
- 7: 0,
48
- 8: -1,
49
- 9: -2,
50
- 10: -3,
51
- 12: -4,
52
- 14: -5,
53
- 15: -6,
28
+ const headingFont = createInterFont();
29
+
30
+ const bodyFont = createInterFont();
31
+
32
+ export const Container = styled(YStack, {
33
+ flex: 1,
34
+ padding: 24,
35
+ });
36
+
37
+ export const Main = styled(YStack, {
38
+ flex: 1,
39
+ maxWidth: 960,
40
+ justifyContent: 'space-between',
41
+ });
42
+
43
+ export const Title = styled(Text, {
44
+ fontSize: 64,
45
+ fontWeight: 'bold',
46
+ });
47
+
48
+ export const Subtitle = styled(Text, {
49
+ color: '#38434D',
50
+ fontSize: 36,
51
+ });
52
+
53
+ export const Button = styled(YStack, {
54
+ alignItems: 'center',
55
+ backgroundColor: '#6366F1',
56
+ borderRadius: 24,
57
+ justifyContent: 'center',
58
+ padding: 16,
59
+ shadowColor: '#000',
60
+ shadowOffset: {
61
+ height: 2,
62
+ width: 0,
54
63
  },
55
- face: {
56
- 700: { normal: 'InterBold' },
64
+ shadowOpacity: 0.25,
65
+ shadowRadius: 3.84,
66
+ hoverStyle: {
67
+ backgroundColor: '#5a5fcf',
57
68
  },
58
- })
69
+ });
59
70
 
60
- const bodyFont = createInterFont(
61
- {
62
- face: {
63
- 700: { normal: 'InterBold' },
64
- },
65
- },
66
- {
67
- sizeSize: (size) => Math.round(size * 1.1),
68
- sizeLineHeight: (size) => Math.round(size * 1.1 + (size > 20 ? 10 : 10)),
69
- }
70
- )
71
+ export const ButtonText = styled(Text, {
72
+ color: '#FFFFFF',
73
+ fontSize: 16,
74
+ fontWeight: '600',
75
+ textAlign: 'center',
76
+ });
71
77
 
72
78
  const config = createTamagui({
73
- defaultFont: 'body',
79
+ defaultFont: "body",
74
80
  animations,
75
81
  shouldAddPrefersColorThemes: true,
76
82
  themeClassNameOnRoot: true,
@@ -94,9 +100,9 @@ const config = createTamagui({
94
100
  gtLg: { minWidth: 1280 + 1 },
95
101
  short: { maxHeight: 820 },
96
102
  tall: { minHeight: 820 },
97
- hoverNone: { hover: 'none' },
98
- pointerCoarse: { pointer: 'coarse' },
103
+ hoverNone: { hover: "none" },
104
+ pointerCoarse: { pointer: "coarse" },
99
105
  }),
100
- })
106
+ });
101
107
 
102
108
  export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-expo-stack",
3
- "version": "2.1.19",
3
+ "version": "2.1.21",
4
4
  "description": "create-expo-stack CLI",
5
5
  "private": false,
6
6
  "types": "build/types/types.d.ts",