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
@@ -2,8 +2,8 @@ import { Icon } from '@roninoss/icons';
2
2
  import { StatusBar } from 'expo-status-bar';
3
3
  import { Linking, Platform, View } from 'react-native';
4
4
 
5
- import { Text } from '~/components/nativewindui/Text';
6
- import { useColorScheme } from '~/lib/useColorScheme';
5
+ import { Text } from '@/components/nativewindui/Text';
6
+ import { useColorScheme } from '@/lib/useColorScheme';
7
7
 
8
8
  export default function ModalScreen() {
9
9
  const { colors, colorScheme } = useColorScheme();
@@ -15,7 +15,7 @@ export default function ModalScreen() {
15
15
  <View className="flex-1 items-center justify-center gap-1 px-12">
16
16
  <Icon name="file-plus-outline" size={42} color={colors.grey} />
17
17
  <Text variant="title3" className="pb-1 text-center font-semibold">
18
- NativeWindUI
18
+ NativewindUI
19
19
  </Text>
20
20
  <Text color="tertiary" variant="subhead" className="pb-4 text-center">
21
21
  You can install any of the free components from the{' '}
@@ -23,7 +23,7 @@ export default function ModalScreen() {
23
23
  onPress={() => Linking.openURL('https://nativewindui.com')}
24
24
  variant="subhead"
25
25
  className="text-primary">
26
- NativeWindUI
26
+ NativewindUI
27
27
  </Text>
28
28
  {' website.'}
29
29
  </Text>
@@ -1,22 +1,9 @@
1
- import * as NavigationBar from 'expo-navigation-bar';
2
1
  import { useColorScheme as useNativewindColorScheme } from 'nativewind';
3
- import * as React from 'react';
4
- import { Platform } from 'react-native';
5
2
 
6
- import { COLORS } from '~/theme/colors';
3
+ import { COLORS } from '@/theme/colors';
7
4
 
8
5
  function useColorScheme() {
9
- const { colorScheme, setColorScheme: setNativeWindColorScheme } = useNativewindColorScheme();
10
-
11
- async function setColorScheme(colorScheme: 'light' | 'dark') {
12
- setNativeWindColorScheme(colorScheme);
13
- if (Platform.OS !== 'android') return;
14
- try {
15
- await setNavigationBar(colorScheme);
16
- } catch (error) {
17
- console.error('useColorScheme.tsx", "setColorScheme', error);
18
- }
19
- }
6
+ const { colorScheme, setColorScheme } = useNativewindColorScheme();
20
7
 
21
8
  function toggleColorScheme() {
22
9
  return setColorScheme(colorScheme === 'light' ? 'dark' : 'light');
@@ -31,25 +18,4 @@ function useColorScheme() {
31
18
  };
32
19
  }
33
20
 
34
- /**
35
- * Set the Android navigation bar color based on the color scheme.
36
- */
37
- function useInitialAndroidBarSync() {
38
- const { colorScheme } = useColorScheme();
39
- React.useEffect(() => {
40
- if (Platform.OS !== 'android') return;
41
- setNavigationBar(colorScheme).catch((error) => {
42
- console.error('useColorScheme.tsx", "useInitialColorScheme', error);
43
- });
44
- }, [colorScheme]);
45
- }
46
-
47
- export { useColorScheme, useInitialAndroidBarSync };
48
-
49
- function setNavigationBar(colorScheme: 'light' | 'dark') {
50
- return Promise.all([
51
- NavigationBar.setButtonStyleAsync(colorScheme === 'dark' ? 'light' : 'dark'),
52
- NavigationBar.setPositionAsync('absolute'),
53
- NavigationBar.setBackgroundColorAsync(colorScheme === 'dark' ? '#00000030' : '#ffffff80'),
54
- ]);
55
- }
21
+ export { useColorScheme };
@@ -1,6 +1,6 @@
1
1
  import { Link, Stack } from 'expo-router';
2
2
  import { View } from 'react-native';
3
- import { Text } from '~/components/nativewindui/Text';
3
+ import { Text } from '@/components/nativewindui/Text';
4
4
 
5
5
  export default function NotFoundScreen() {
6
6
  return (
@@ -1,32 +1,29 @@
1
- import '../global.css';
2
- import 'expo-dev-client';
3
- import { ThemeProvider as NavThemeProvider } from '@react-navigation/native';
4
- import { Icon } from '@roninoss/icons';
1
+ import '@/global.css';
2
+
5
3
  <% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
6
4
  import { ActionSheetProvider } from '@expo/react-native-action-sheet';
7
5
  <% } %>
8
- <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
9
- import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
10
- <% } %>
6
+ import { ThemeProvider as NavThemeProvider } from '@react-navigation/native';
7
+ import * as Device from 'expo-device';
11
8
  import { Link, Stack } from 'expo-router';
12
9
  import { StatusBar } from 'expo-status-bar';
13
- import { Pressable, View } from 'react-native';
14
- <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
10
+ import { Platform, Pressable } from 'react-native';
15
11
  import { GestureHandlerRootView } from 'react-native-gesture-handler';
16
- <% } %>
17
12
 
18
- import { ThemeToggle } from '~/components/ThemeToggle';
19
- import { cn } from '~/lib/cn';
20
- import { useColorScheme, useInitialAndroidBarSync } from '~/lib/useColorScheme';
21
- import { NAV_THEME } from '~/theme';
13
+ import { Icon } from '@/components/nativewindui/Icon';
14
+ import { ThemeToggle } from '@/components/nativewindui/ThemeToggle';
15
+ import { cn } from '@/lib/cn';
16
+ import { useColorScheme } from '@/lib/useColorScheme';
17
+ import { NAV_THEME } from '@/theme';
22
18
 
23
19
  export {
24
20
  // Catch any errors thrown by the Layout component.
25
21
  ErrorBoundary,
26
22
  } from 'expo-router';
27
23
 
24
+ const isIos26 = Platform.select({ default: false, ios: Device.osVersion?.startsWith('26.' )});
25
+
28
26
  export default function RootLayout() {
29
- useInitialAndroidBarSync();
30
27
  const { colorScheme, isDarkColorScheme } = useColorScheme();
31
28
 
32
29
  return (
@@ -37,15 +34,12 @@ export default function RootLayout() {
37
34
  />
38
35
  {/* WRAP YOUR APP WITH ANY ADDITIONAL PROVIDERS HERE */}
39
36
  {/* <ExampleProvider> */}
40
- <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
41
37
  <GestureHandlerRootView style={{ flex: 1 }}>
42
- <BottomSheetModalProvider>
43
- <% } %>
44
38
  <% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
45
39
  <ActionSheetProvider>
46
40
  <% } %>
47
41
  <NavThemeProvider value={NAV_THEME[colorScheme]}>
48
- <Stack screenOptions={SCREEN_OPTIONS}>
42
+ <Stack>
49
43
  <Stack.Screen name="index" options={INDEX_OPTIONS} />
50
44
  <Stack.Screen name="modal" options={MODAL_OPTIONS} />
51
45
  </Stack>
@@ -53,35 +47,24 @@ export default function RootLayout() {
53
47
  <% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
54
48
  </ActionSheetProvider>
55
49
  <% } %>
56
- <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
57
- </BottomSheetModalProvider>
58
50
  </GestureHandlerRootView>
59
- <% } %>
60
51
  {/* </ExampleProvider> */}
61
52
  </>
62
53
  );
63
54
  }
64
55
 
65
- const SCREEN_OPTIONS = {
66
- animation: 'ios_from_right', // for android
67
- } as const;
68
-
69
56
  const INDEX_OPTIONS = {
70
57
  headerLargeTitle: true,
71
- title: 'NativeWindUI',
58
+ headerTransparent: isIos26,
59
+ title: 'NativewindUI',
72
60
  headerRight: () => <SettingsIcon />,
73
61
  } as const;
74
62
 
75
63
  function SettingsIcon() {
76
- const { colors } = useColorScheme();
77
64
  return (
78
65
  <Link href="/modal" asChild>
79
- <Pressable className="opacity-80">
80
- {({ pressed }) => (
81
- <View className={cn(pressed ? 'opacity-50' : 'opacity-90')}>
82
- <Icon name="cog-outline" color={colors.foreground} />
83
- </View>
84
- )}
66
+ <Pressable className={cn('opacity-80 active:opacity-50', isIos26 && 'px-1.5')}>
67
+ <Icon name='gearshape' className='text-foreground' />
85
68
  </Pressable>
86
69
  </Link>
87
70
  );