create-expo-stack 2.20.0-next.ff2bed4 → 2.21.0-next.0cb36d0

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 (90) hide show
  1. package/README.md +18 -20
  2. package/build/cli.js +3 -2
  3. package/build/commands/create-expo-stack.js +9 -30
  4. package/build/constants.js +4 -4
  5. package/build/templates/base/App.tsx.ejs +12 -51
  6. package/build/templates/base/app.json.ejs +1 -0
  7. package/build/templates/base/babel.config.js.ejs +5 -15
  8. package/build/templates/base/components/Button.tsx.ejs +1 -0
  9. package/build/templates/base/components/Container.tsx.ejs +1 -0
  10. package/build/templates/base/package.json.ejs +38 -63
  11. package/build/templates/base/tsconfig.json.ejs +12 -7
  12. package/build/templates/packages/expo-router/drawer/app/+not-found.tsx.ejs +19 -60
  13. package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +2 -41
  14. package/build/templates/packages/expo-router/metro.config.js.ejs +3 -3
  15. package/build/templates/packages/expo-router/stack/app/+not-found.tsx.ejs +42 -68
  16. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +20 -51
  17. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +39 -8
  18. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +69 -21
  19. package/build/templates/packages/expo-router/tabs/app/+not-found.tsx.ejs +21 -60
  20. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +8 -48
  21. package/build/templates/packages/firebase/metro.config.js.ejs +3 -3
  22. package/build/templates/packages/nativewind/components/Button.tsx.ejs +1 -1
  23. package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +3 -2
  24. package/build/templates/packages/nativewind/global.css +4 -1
  25. package/build/templates/packages/nativewind/postcss.config.mjs +2 -2
  26. package/build/templates/packages/nativewind/prettier.config.js +10 -0
  27. package/build/templates/packages/nativewindui/components/Container.tsx.ejs +1 -0
  28. package/build/templates/packages/nativewindui/components/EditScreenInfo.tsx.ejs +1 -1
  29. package/build/templates/packages/nativewindui/components/ScreenContent.tsx.ejs +1 -1
  30. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.ios.tsx.ejs +52 -0
  31. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.tsx.ejs +58 -0
  32. package/build/templates/packages/nativewindui/components/nativewindui/Icon/index.ts.ejs +16 -0
  33. package/build/templates/packages/nativewindui/components/nativewindui/Icon/types.ts.ejs +18 -0
  34. package/build/templates/packages/nativewindui/components/{ThemeToggle.tsx.ejs → nativewindui/ThemeToggle.tsx.ejs} +8 -10
  35. package/build/templates/packages/nativewindui/drawer/app/(drawer)/index.tsx.ejs +17 -19
  36. package/build/templates/packages/nativewindui/drawer/app/+not-found.tsx.ejs +4 -44
  37. package/build/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs +2 -2
  38. package/build/templates/packages/nativewindui/drawer/app/modal.tsx.ejs +4 -4
  39. package/build/templates/packages/nativewindui/lib/useColorScheme.tsx.ejs +3 -37
  40. package/build/templates/packages/nativewindui/stack/app/+not-found.tsx.ejs +1 -1
  41. package/build/templates/packages/nativewindui/stack/app/_layout.tsx.ejs +17 -34
  42. package/build/templates/packages/nativewindui/stack/app/index.tsx.ejs +230 -275
  43. package/build/templates/packages/nativewindui/stack/app/modal.tsx.ejs +7 -7
  44. package/build/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs +6 -7
  45. package/build/templates/packages/nativewindui/tabs/app/+not-found.tsx.ejs +0 -40
  46. package/build/templates/packages/nativewindui/theme/colors.ts.ejs +52 -0
  47. package/build/templates/packages/nativewindui/theme/index.ts.ejs +2 -2
  48. package/build/templates/packages/nativewindui/theme/with-opacity.ts.ejs +155 -0
  49. package/build/templates/packages/react-navigation/App.tsx.ejs +2 -42
  50. package/build/types/constants.d.ts +1 -1
  51. package/build/types/types.d.ts +3 -3
  52. package/build/types/utilities/configAnalytics.d.ts +2 -2
  53. package/build/types.js +1 -3
  54. package/build/utilities/clearNavigationPackages.js +2 -2
  55. package/build/utilities/clearStylingPackages.js +2 -2
  56. package/build/utilities/configAnalytics.js +5 -4
  57. package/build/utilities/configureProjectFiles.js +32 -69
  58. package/build/utilities/copyBaseAssets.js +3 -2
  59. package/build/utilities/generateNWUI.js +8 -7
  60. package/build/utilities/generateProjectFiles.js +4 -9
  61. package/build/utilities/getPackageManager.js +6 -5
  62. package/build/utilities/printOutput.js +5 -16
  63. package/build/utilities/renderTitle.js +3 -2
  64. package/build/utilities/runCLI.js +19 -27
  65. package/build/utilities/runEasConfigure.js +3 -2
  66. package/build/utilities/runIgnite.js +3 -2
  67. package/build/utilities/showHelp.js +4 -5
  68. package/build/utilities/systemCommand.js +3 -3
  69. package/build/utilities/usePackage.js +3 -2
  70. package/build/utilities/validateProjectName.js +3 -2
  71. package/package.json +6 -4
  72. package/build/templates/packages/nativewind/components/Container.tsx.ejs +0 -9
  73. package/build/templates/packages/nativewindui/components/BackButton.tsx.ejs +0 -23
  74. package/build/templates/packages/nativewindui/components/Button.tsx.ejs +0 -41
  75. package/build/templates/packages/nativewindui/lib/useHeaderSearchBar.tsx.ejs +0 -31
  76. package/build/templates/packages/restyle/components/BackButton.tsx.ejs +0 -15
  77. package/build/templates/packages/restyle/components/Button.tsx.ejs +0 -40
  78. package/build/templates/packages/restyle/components/Container.tsx.ejs +0 -6
  79. package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +0 -29
  80. package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +0 -21
  81. package/build/templates/packages/restyle/theme/Box.tsx.ejs +0 -6
  82. package/build/templates/packages/restyle/theme/Text.tsx.ejs +0 -6
  83. package/build/templates/packages/restyle/theme/index.ts.ejs +0 -6
  84. package/build/templates/packages/restyle/theme/theme.ts.ejs +0 -67
  85. package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +0 -19
  86. package/build/templates/packages/tamagui/components/Button.tsx.ejs +0 -18
  87. package/build/templates/packages/tamagui/components/Container.tsx.ejs +0 -6
  88. package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +0 -29
  89. package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +0 -23
  90. package/build/templates/packages/tamagui/tamagui.config.ts.ejs +0 -130
@@ -6,64 +6,32 @@ import { Link, Stack } from 'expo-router';
6
6
  import { Text, View } from 'react-native';
7
7
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
8
8
  import { StyleSheet, Text, View } from 'react-native';
9
- <% } else if (props.stylingPackage?.name === "tamagui") { %>
10
- import { YStack } from "tamagui";
11
- import { Container, Main, Subtitle, Title } from "../tamagui.config";
12
- <% } else if (props.stylingPackage?.name === "restyle") { %>
13
- import { Box, Text, makeStyles } from 'theme';
14
9
  <% } %>
15
10
 
16
11
  export default function NotFoundScreen() {
17
- <% if (props.stylingPackage?.name === "restyle") { %>
18
- const styles = useStyles();
19
- <% } %>
20
12
 
21
13
  return (
22
- <% if (props.stylingPackage?.name === "nativewind") {%>
23
- <>
24
- <Stack.Screen options={{ title: "Oops!" }} />
25
- <View className={styles.container}>
26
- <Text className={styles.title}>{"This screen doesn't exist."}</Text>
27
- <Link href="/" className={styles.link}>
28
- <Text className={styles.linkText}>Go to home screen!</Text>
29
- </Link>
30
- </View>
31
- </>
32
- <% } else if (props.stylingPackage?.name === "tamagui") {%>
33
- <Container>
34
- <Stack.Screen options={{ title: "Oops!" }} />
35
- <Main>
36
- <YStack>
37
- <Title>{"This screen doesn't exist."}</Title>
38
- <Link href="/">
39
- <Subtitle>Go to home screen!</Subtitle>
40
- </Link>
41
- </YStack>
42
- </Main>
43
- </Container>
44
- <% } else if (props.stylingPackage?.name === "restyle") {%>
45
- <>
46
- <Stack.Screen options={{ title: 'Oops!' }} />
47
- <Box flex={1} justifyContent="center" alignItems="center" padding="ml_24">
48
- <Text variant="title">{"This screen doesn't exist."}</Text>
49
- <Link href="/" style={styles.link}>
50
- <Text variant="body" color="blue">
51
- Go to home screen!
52
- </Text>
53
- </Link>
54
- </Box>
55
- </>
56
- <% } else { %>
57
- <>
58
- <Stack.Screen options={{ title: "Oops!" }} />
59
- <View style={styles.container}>
60
- <Text style={styles.title}>{"This screen doesn't exist."}</Text>
61
- <Link href="/" style={styles.link}>
62
- <Text style={styles.linkText}>Go to home screen!</Text>
63
- </Link>
64
- </View>
65
- </>
66
- <% } %>
14
+ <% if (props.stylingPackage?.name === "nativewind") {%>
15
+ <>
16
+ <Stack.Screen options={{ title: "Oops!" }} />
17
+ <View className={styles.container}>
18
+ <Text className={styles.title}>{"This screen doesn't exist."}</Text>
19
+ <Link href="/" className={styles.link}>
20
+ <Text className={styles.linkText}>Go to home screen!</Text>
21
+ </Link>
22
+ </View>
23
+ </>
24
+ <% } else { %>
25
+ <>
26
+ <Stack.Screen options={{ title: "Oops!" }} />
27
+ <View style={styles.container}>
28
+ <Text style={styles.title}>{"This screen doesn't exist."}</Text>
29
+ <Link href="/" style={styles.link}>
30
+ <Text style={styles.linkText}>Go to home screen!</Text>
31
+ </Link>
32
+ </View>
33
+ </>
34
+ <% } %>
67
35
  );
68
36
  }
69
37
 
@@ -116,11 +84,4 @@ export default function NotFoundScreen() {
116
84
  color: '#2e78b7',
117
85
  },
118
86
  });
119
- <% } else if (props.stylingPackage?.name === "restyle") { %>
120
- const useStyles = makeStyles((theme) => ({
121
- link: {
122
- marginTop: theme.spacing.m_16,
123
- paddingVertical: theme.spacing.m_16,
124
- },
125
- }));
126
87
  <% } %>
@@ -9,23 +9,7 @@
9
9
  <% if (props.internalizationPackage?.name === "i18next") { %>
10
10
  import '../translation';
11
11
  <% } %>
12
-
13
- <% if (props.stylingPackage?.name === "tamagui") { %>
14
- import React, { useEffect } from "react";
15
- import { TamaguiProvider } from 'tamagui'
16
- import { SplashScreen, Stack } from "expo-router";
17
- import { useFonts } from "expo-font";
18
-
19
- import config from '../tamagui.config'
20
-
21
- SplashScreen.preventAutoHideAsync();
22
- <% } else if (props.stylingPackage?.name === "restyle") { %>
23
- import { ThemeProvider } from '@shopify/restyle';
24
- import { Stack } from 'expo-router';
25
- import { theme } from 'theme';
26
- <% } else { %>
27
12
  import { Stack } from "expo-router";
28
- <% } %>
29
13
 
30
14
  <% if (props.analyticsPackage?.name === "vexo-analytics") { %>
31
15
  import { vexo } from 'vexo-analytics';
@@ -39,30 +23,11 @@ export const unstable_settings = {
39
23
  };
40
24
 
41
25
  export default function RootLayout() {
42
- <% if (props.stylingPackage?.name === "tamagui") { %>
43
- const [loaded] = useFonts({
44
- Inter: require("@tamagui/font-inter/otf/Inter-Medium.otf"),
45
- InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf")
46
- });
47
-
48
- useEffect(() => {
49
- if (loaded) {
50
- SplashScreen.hideAsync();
51
- }
52
- }, [loaded]);
53
-
54
- if (!loaded) return null;
55
- <% } %>
56
- <% if (props.stylingPackage?.name === "unistyles") { %>
57
- const { theme } = useUnistyles();
58
- <% } %>
26
+ <% if (props.stylingPackage?.name === "unistyles") { %>
27
+ const { theme } = useUnistyles();
28
+ <% } %>
59
29
 
60
- return (
61
- <% if (props.stylingPackage?.name === "tamagui") { %>
62
- <TamaguiProvider config={config}>
63
- <% } else if (props.stylingPackage?.name === "restyle") { %>
64
- <ThemeProvider theme={theme}>
65
- <% } %>
30
+ return (
66
31
  <% if (props.stylingPackage?.name === "unistyles") { %>
67
32
  <Stack
68
33
  screenOptions={{
@@ -78,13 +43,8 @@ export default function RootLayout() {
78
43
  <% } else { %>
79
44
  <Stack>
80
45
  <% } %>
81
- <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
82
- <Stack.Screen name="modal" options={{ presentation: "modal" }} />
83
- </Stack>
84
- <% if (props.stylingPackage?.name === "tamagui") { %>
85
- </TamaguiProvider>
86
- <% } else if (props.stylingPackage?.name === "restyle") { %>
87
- </ThemeProvider>
88
- <% } %>
89
- );
46
+ <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
47
+ <Stack.Screen name="modal" options={{ presentation: "modal" }} />
48
+ </Stack>
49
+ );
90
50
  }
@@ -1,14 +1,14 @@
1
+ // Learn more https://docs.expo.io/guides/customizing-metro
1
2
  const { getDefaultConfig } = require('expo/metro-config');
2
3
  <% if (props.stylingPackage?.name === "nativewind") { %>
3
- const { withNativeWind } = require("nativewind/metro");
4
+ const { withNativewind } = require("nativewind/metro");
4
5
  <% } %>
5
6
 
6
7
  /** @type {import('expo/metro-config').MetroConfig} */
7
- // eslint-disable-next-line no-undef
8
8
  const config = getDefaultConfig(__dirname);
9
9
 
10
10
  <% if (props.stylingPackage?.name === "nativewind") { %>
11
- module.exports = withNativeWind(config, { input: "./global.css" });
11
+ module.exports = withNativewind(config);
12
12
  <% } else { %>
13
13
  module.exports = config;
14
14
  <% } %>
@@ -16,6 +16,6 @@ export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps
16
16
  Button.displayName = 'Button';
17
17
 
18
18
  const styles = {
19
- button: 'items-center bg-indigo-500 rounded-[28px] shadow-md p-4',
19
+ button: 'items-center bg-indigo-500 rounded-[28px] shadow-md p-4 w-full',
20
20
  buttonText: 'text-white text-lg font-semibold text-center',
21
21
  };
@@ -19,8 +19,9 @@ export const ScreenContent = ({ title, path, children} : ScreenContentProps) =>
19
19
  </View>
20
20
  );
21
21
  };
22
+
22
23
  const styles = {
23
- container: `items-center flex-1 justify-center bg-white`,
24
- separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
24
+ container: `flex flex-1 px-4 bg-white items-center justify-center`,
25
+ separator: `h-px w-[300px] bg-gray-200 my-7`,
25
26
  title: `text-xl font-bold`,
26
27
  };
@@ -1,2 +1,5 @@
1
- @import 'tailwindcss';
1
+ @import 'tailwindcss/theme.css' layer(theme);
2
+ @import 'tailwindcss/preflight.css' layer(base);
3
+ @import 'tailwindcss/utilities.css';
4
+
2
5
  @import 'nativewind/theme';
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  plugins: {
3
- '@tailwindcss/postcss': {}
4
- }
3
+ '@tailwindcss/postcss': {},
4
+ },
5
5
  };
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ printWidth: 100,
3
+ tabWidth: 2,
4
+ singleQuote: true,
5
+ bracketSameLine: true,
6
+ trailingComma: 'es5',
7
+
8
+ plugins: [require.resolve('prettier-plugin-tailwindcss')],
9
+ tailwindAttributes: ['className'],
10
+ };
@@ -8,6 +8,7 @@ const styles = StyleSheet.create({
8
8
  container: {
9
9
  flex: 1,
10
10
  padding: 24,
11
+ backgroundColor: 'white',
11
12
  },
12
13
  });
13
14
 
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet, View } from 'react-native';
2
2
 
3
- import { Text } from '~/components/nativewindui/Text';
3
+ import { Text } from '@/components/nativewindui/Text';
4
4
 
5
5
  <% if (props.internalizationPackage?.name === "i18next") { %>
6
6
  import { useTranslation } from 'react-i18next';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
3
 
4
- import { Text } from '~/components/nativewindui/Text';
4
+ import { Text } from '@/components/nativewindui/Text';
5
5
 
6
6
  import EditScreenInfo from './EditScreenInfo';
7
7
 
@@ -0,0 +1,52 @@
1
+ import { SymbolView } from 'expo-symbols';
2
+
3
+ import type { IconProps } from './types';
4
+
5
+ import { useColorScheme } from '@/lib/useColorScheme';
6
+
7
+ function Icon({
8
+ materialCommunityIcon: _materialCommunityIcon,
9
+ materialIcon: _materialIcon,
10
+ sfSymbol,
11
+ name,
12
+ color,
13
+ size = 24,
14
+ ...props
15
+ }: IconProps) {
16
+ const { colors } = useColorScheme();
17
+ return (
18
+ <SymbolView
19
+ name={name ?? 'questionmark'}
20
+ tintColor={rgbaToHex(color ?? colors.foreground)}
21
+ size={size}
22
+ resizeMode="scaleAspectFit"
23
+ {...props}
24
+ {...sfSymbol}
25
+ />
26
+ );
27
+ }
28
+
29
+ export { Icon };
30
+
31
+ // TODO: seems like the need to convert rgba to hex color is a bug in expo-symbols, accordion to the docs, it should accept a hex color, but it doesn't.
32
+
33
+ function rgbaToHex(color: string): string {
34
+ if (!color) return 'black';
35
+ const rgbaRegex =
36
+ /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(\d*\.?\d+))?\s*\)$/i;
37
+ const match = color.match(rgbaRegex);
38
+
39
+ if (!match) {
40
+ return color;
41
+ }
42
+
43
+ const [, rStr, gStr, bStr, aStr] = match;
44
+ const r = Math.min(255, parseInt(rStr));
45
+ const g = Math.min(255, parseInt(gStr));
46
+ const b = Math.min(255, parseInt(bStr));
47
+ const a = aStr !== undefined ? Math.round(parseFloat(aStr) * 255) : 255;
48
+
49
+ const toHex = (n: number) => n.toString(16).padStart(2, '0');
50
+
51
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}${a < 255 ? toHex(a) : ''}`;
52
+ }
@@ -0,0 +1,58 @@
1
+ import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
2
+ import MaterialIcons from '@expo/vector-icons/MaterialIcons';
3
+ import {
4
+ SF_SYMBOLS_TO_MATERIAL_COMMUNITY_ICONS,
5
+ SF_SYMBOLS_TO_MATERIAL_ICONS,
6
+ } from 'rn-icon-mapper';
7
+
8
+ import type { IconProps } from './types';
9
+
10
+ import { useColorScheme } from '@/lib/useColorScheme';
11
+
12
+ function Icon({
13
+ name,
14
+ materialCommunityIcon,
15
+ materialIcon,
16
+ sfSymbol: _sfSymbol,
17
+ size = 24,
18
+ ...props
19
+ }: IconProps) {
20
+ const { colors } = useColorScheme();
21
+ const defaultColor = colors.foreground;
22
+
23
+ if (materialCommunityIcon) {
24
+ return (
25
+ <MaterialCommunityIcons
26
+ size={size}
27
+ color={defaultColor}
28
+ {...props}
29
+ {...materialCommunityIcon}
30
+ />
31
+ );
32
+ }
33
+ if (materialIcon) {
34
+ return <MaterialIcons size={size} color={defaultColor} {...props} {...materialIcon} />;
35
+ }
36
+ const materialCommunityIconName =
37
+ SF_SYMBOLS_TO_MATERIAL_COMMUNITY_ICONS[
38
+ name as keyof typeof SF_SYMBOLS_TO_MATERIAL_COMMUNITY_ICONS
39
+ ];
40
+ if (materialCommunityIconName) {
41
+ return (
42
+ <MaterialCommunityIcons
43
+ name={materialCommunityIconName}
44
+ size={size}
45
+ color={defaultColor}
46
+ {...props}
47
+ />
48
+ );
49
+ }
50
+ const materialIconName =
51
+ SF_SYMBOLS_TO_MATERIAL_ICONS[name as keyof typeof SF_SYMBOLS_TO_MATERIAL_ICONS];
52
+ if (materialIconName) {
53
+ return <MaterialIcons name={materialIconName} size={size} color={defaultColor} {...props} />;
54
+ }
55
+ return <MaterialCommunityIcons name="help" size={size} color={defaultColor} {...props} />;
56
+ }
57
+
58
+ export { Icon };
@@ -0,0 +1,16 @@
1
+ import { cssInterop } from 'nativewind';
2
+
3
+ import { Icon } from './Icon';
4
+
5
+ cssInterop(Icon, {
6
+ className: {
7
+ target: 'style',
8
+ nativeStyleToProp: {
9
+ color: 'color',
10
+ height: 'size',
11
+ width: 'size',
12
+ },
13
+ },
14
+ });
15
+
16
+ export { Icon };
@@ -0,0 +1,18 @@
1
+ import type MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
2
+ import type MaterialIcons from '@expo/vector-icons/MaterialIcons';
3
+ import type { SymbolViewProps } from 'expo-symbols';
4
+ import type { IconMapper } from 'rn-icon-mapper';
5
+
6
+ type MaterialCommunityIconsProps = React.ComponentProps<typeof MaterialCommunityIcons>;
7
+ type MaterialIconsProps = React.ComponentProps<typeof MaterialIcons>;
8
+
9
+ type Style = SymbolViewProps['style'] &
10
+ MaterialIconsProps['style'] &
11
+ MaterialCommunityIconsProps['style'];
12
+
13
+ type IconProps = IconMapper<SymbolViewProps, MaterialIconsProps, MaterialCommunityIconsProps> & {
14
+ style?: Style;
15
+ className?: string;
16
+ };
17
+
18
+ export type { IconProps };
@@ -1,10 +1,10 @@
1
- import { Icon } from '@roninoss/icons';
2
1
  import { Pressable, View } from 'react-native';
3
2
  import Animated, { LayoutAnimationConfig, ZoomInRotate } from 'react-native-reanimated';
4
3
 
5
- import { cn } from '~/lib/cn';
6
- import { useColorScheme } from '~/lib/useColorScheme';
7
- import { COLORS } from '~/theme/colors';
4
+ import { Icon } from '@/components/nativewindui/Icon';
5
+ import { cn } from '@/lib/cn';
6
+ import { useColorScheme } from '@/lib/useColorScheme';
7
+ import { COLORS } from '@/theme/colors';
8
8
 
9
9
  export function ThemeToggle() {
10
10
  const { colorScheme, toggleColorScheme } = useColorScheme();
@@ -14,22 +14,20 @@ export function ThemeToggle() {
14
14
  className="items-center justify-center"
15
15
  key={`toggle-${colorScheme}`}
16
16
  entering={ZoomInRotate}>
17
- <Pressable
18
- onPress={toggleColorScheme}
19
- className="opacity-80">
17
+ <Pressable onPress={toggleColorScheme} className="opacity-80">
20
18
  {colorScheme === 'dark'
21
19
  ? ({ pressed }) => (
22
20
  <View className={cn('px-0.5', pressed && 'opacity-50')}>
23
- <Icon namingScheme="sfSymbol" name="moon.stars" color={COLORS.white} />
21
+ <Icon name="moon.stars" color={COLORS.white} />
24
22
  </View>
25
23
  )
26
24
  : ({ pressed }) => (
27
25
  <View className={cn('px-0.5', pressed && 'opacity-50')}>
28
- <Icon namingScheme="sfSymbol" name="sun.min" color={COLORS.black} />
26
+ <Icon name="sun.min" color={COLORS.black} />
29
27
  </View>
30
28
  )}
31
29
  </Pressable>
32
30
  </Animated.View>
33
31
  </LayoutAnimationConfig>
34
32
  );
35
- }
33
+ }
@@ -1,6 +1,6 @@
1
1
  import { Stack } from 'expo-router';
2
2
  import { useHeaderHeight } from '@react-navigation/elements';
3
- import { LegendList } from '@legendapp/list';
3
+ import { FlashList } from '@shopify/flash-list';
4
4
  import { cssInterop } from 'nativewind';
5
5
  import * as React from 'react';
6
6
  import {
@@ -32,34 +32,33 @@ import { Icon } from '@roninoss/icons';
32
32
  import * as StoreReview from 'expo-store-review';
33
33
  <% } %>
34
34
 
35
- import { Container } from '~/components/Container';
35
+ import { Container } from '@/components/Container';
36
36
  <% if (props.stylingPackage?.options.selectedComponents.includes('activity-indicator')) { %>
37
- import { ActivityIndicator } from '~/components/nativewindui/ActivityIndicator';
37
+ import { ActivityIndicator } from '@/components/nativewindui/ActivityIndicator';
38
38
  <% } %>
39
39
  <% if (props.stylingPackage?.options.selectedComponents.includes('avatar')) { %>
40
- import { Avatar, AvatarFallback, AvatarImage } from '~/components/nativewindui/Avatar';
40
+ import { Avatar, AvatarFallback, AvatarImage } from '@/components/nativewindui/Avatar';
41
41
  <% } %>
42
42
  <% if (props.stylingPackage?.options.selectedComponents.includes('date-picker')) { %>
43
- import { DatePicker } from '~/components/nativewindui/DatePicker';
43
+ import { DatePicker } from '@/components/nativewindui/DatePicker';
44
44
  <% } %>
45
45
  <% if (props.stylingPackage?.options.selectedComponents.includes('picker')) { %>
46
- import { Picker, PickerItem } from '~/components/nativewindui/Picker';
46
+ import { Picker, PickerItem } from '@/components/nativewindui/Picker';
47
47
  <% } %>
48
48
  <% if (props.stylingPackage?.options.selectedComponents.includes('progress-indicator')) { %>
49
- import { ProgressIndicator } from '~/components/nativewindui/ProgressIndicator';
49
+ import { ProgressIndicator } from '@/components/nativewindui/ProgressIndicator';
50
50
  <% } %>
51
51
  <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
52
- import { Sheet, useSheetRef } from '~/components/nativewindui/Sheet';
52
+ import { Sheet, useSheetRef } from '@/components/nativewindui/Sheet';
53
53
  <% } %>
54
54
  <% if (props.stylingPackage?.options.selectedComponents.includes('slider')) { %>
55
- import { Slider } from '~/components/nativewindui/Slider';
55
+ import { Slider } from '@/components/nativewindui/Slider';
56
56
  <% } %>
57
- import { Text } from '~/components/nativewindui/Text';
57
+ import { Text } from '@/components/nativewindui/Text';
58
58
  <% if (props.stylingPackage?.options.selectedComponents.includes('toggle')) { %>
59
- import { Toggle } from '~/components/nativewindui/Toggle';
59
+ import { Toggle } from '@/components/nativewindui/Toggle';
60
60
  <% } %>
61
- import { useColorScheme } from '~/lib/useColorScheme';
62
- import { useHeaderSearchBar } from '~/lib/useHeaderSearchBar';
61
+ import { useColorScheme } from '@/lib/useColorScheme';
63
62
 
64
63
  export default function Home() {
65
64
  const searchValue = useHeaderSearchBar({ hideWhenScrolling: COMPONENTS.length === 0 });
@@ -72,7 +71,7 @@ export default function Home() {
72
71
  <>
73
72
  <Stack.Screen options={{ title: 'Home' }} />
74
73
  <Container>
75
- <LegendList
74
+ <FlashList
76
75
  contentInsetAdjustmentBehavior="automatic"
77
76
  keyboardShouldPersistTaps="handled"
78
77
  data={data}
@@ -83,14 +82,13 @@ export default function Home() {
83
82
  ItemSeparatorComponent={renderItemSeparator}
84
83
  renderItem={renderItem}
85
84
  ListEmptyComponent={COMPONENTS.length === 0 ? ListEmptyComponent : undefined}
86
- recycleItems
87
85
  />
88
86
  </Container>
89
87
  </>
90
88
  );
91
89
  }
92
90
 
93
- cssInterop(LegendList, {
91
+ cssInterop(FlashList, {
94
92
  className: 'style',
95
93
  contentContainerClassName: 'contentContainerStyle',
96
94
  });
@@ -125,7 +123,7 @@ function ListEmptyComponent() {
125
123
  variant='subhead'
126
124
  className='text-primary'
127
125
  >
128
- NativeWindUI
126
+ NativewindUI
129
127
  </Text>
130
128
  {' website.'}
131
129
  </Text>
@@ -466,7 +464,7 @@ const COMPONENTS: ComponentItem[] = [
466
464
  onPress={async () => {
467
465
  try {
468
466
  const result = await Share.share({
469
- message: 'NativeWindUI | Familiar interface, native feel.',
467
+ message: 'NativewindUI | Familiar interface, native feel.',
470
468
  });
471
469
  if (result.action === Share.sharedAction) {
472
470
  if (result.activityType) {
@@ -523,7 +521,7 @@ const COMPONENTS: ComponentItem[] = [
523
521
  const TWITTER_AVATAR_URI = 'https://pbs.twimg.com/profile_images/1782428433898708992/1voyv4_A_400x400.jpg';
524
522
  return (
525
523
  <View className='items-center'>
526
- <Avatar alt="NativeWindUI Avatar">
524
+ <Avatar alt="NativewindUI Avatar">
527
525
  <AvatarImage source={{ uri: TWITTER_AVATAR_URI }} />
528
526
  <AvatarFallback>
529
527
  <Text>NUI</Text>
@@ -2,29 +2,20 @@ import { Link, Stack } from 'expo-router';
2
2
  <% if (["nativewind", "nativewindui"].includes(props.stylingPackage?.name)) {%>
3
3
  import { Text } from 'react-native';
4
4
 
5
- import { Container } from '~/components/Container';
5
+ import { Container } from '@/components/Container';
6
6
  <% } else if (props.stylingPackage?.name === "unistyles") { %>
7
7
  import { createStyleSheet, useStyles } from 'react-native-unistyles'
8
8
  import { Text } from 'react-native';
9
9
 
10
- import { Container } from '~/components/Container';
10
+ import { Container } from '@/components/Container';
11
11
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
12
12
  import { StyleSheet, Text } from 'react-native';
13
13
 
14
- import { Container } from '~/components/Container';
15
- <% } else if (props.stylingPackage?.name === "tamagui") { %>
16
- import { YStack } from "tamagui";
17
- import { Container, Main, Subtitle, Title } from "../tamagui.config";
18
- <% } else if (props.stylingPackage?.name === "restyle") { %>
19
- import { Box, Text, makeStyles } from 'theme';
20
-
21
- import { Container } from '~/components/Container';
14
+ import { Container } from '@/components/Container';
22
15
  <% } %>
23
16
 
24
17
  export default function NotFoundScreen() {
25
- <% if (props.stylingPackage?.name === "restyle") { %>
26
- const styles = useStyles();
27
- <% } else if (props.stylingPackage?.name === "unistyles") {%>
18
+ <% if (props.stylingPackage?.name === "unistyles") {%>
28
19
  const { styles } = useStyles(stylesheet);
29
20
  <% } %>
30
21
 
@@ -39,30 +30,6 @@ export default function NotFoundScreen() {
39
30
  </Link>
40
31
  </Container>
41
32
  </>
42
- <% } else if (props.stylingPackage?.name === "tamagui") {%>
43
- <Container>
44
- <Stack.Screen options={{ title: "Oops!" }} />
45
- <Main>
46
- <YStack>
47
- <Title>{"This screen doesn't exist."}</Title>
48
- <Link href="/">
49
- <Subtitle>Go to home screen!</Subtitle>
50
- </Link>
51
- </YStack>
52
- </Main>
53
- </Container>
54
- <% } else if (props.stylingPackage?.name === "restyle") {%>
55
- <>
56
- <Stack.Screen options={{ title: 'Oops!' }} />
57
- <Container>
58
- <Text variant="title">{"This screen doesn't exist."}</Text>
59
- <Link href="/" style={styles.link}>
60
- <Text variant="body" color="blue">
61
- Go to home screen!
62
- </Text>
63
- </Link>
64
- </Container>
65
- </>
66
33
  <% } else { %>
67
34
  <>
68
35
  <Stack.Screen options={{ title: "Oops!" }} />
@@ -113,11 +80,4 @@ export default function NotFoundScreen() {
113
80
  color: '#2e78b7',
114
81
  },
115
82
  });
116
- <% } else if (props.stylingPackage?.name === "restyle") { %>
117
- const useStyles = makeStyles((theme) => ({
118
- link: {
119
- marginTop: theme.spacing.m_16,
120
- paddingVertical: theme.spacing.m_16,
121
- },
122
- }));
123
83
  <% } %>
@@ -13,8 +13,8 @@ import { StatusBar } from 'expo-status-bar';
13
13
  import { GestureHandlerRootView } from 'react-native-gesture-handler';
14
14
  <% } %>
15
15
 
16
- import { ThemeToggle } from '~/components/ThemeToggle';
17
- import { useColorScheme, useInitialAndroidBarSync } from '~/lib/useColorScheme';
16
+ import { ThemeToggle } from '@/components/ThemeToggle';
17
+ import { useColorScheme, useInitialAndroidBarSync } from '@/lib/useColorScheme';
18
18
  import { NAV_THEME } from '~/theme';
19
19
 
20
20
  export {