create-expo-stack 2.20.0-next.7f9c8bc → 2.20.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 (87) hide show
  1. package/README.md +1 -3
  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 +13 -16
  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 +34 -67
  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/stack/app/+not-found.tsx.ejs +34 -66
  15. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +15 -51
  16. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +37 -5
  17. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +34 -11
  18. package/build/templates/packages/expo-router/tabs/app/+not-found.tsx.ejs +21 -60
  19. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +8 -48
  20. package/build/templates/packages/nativewind/global.css +3 -2
  21. package/build/templates/packages/nativewind/metro.config.js +3 -4
  22. package/build/templates/packages/nativewind/nativewind-env.d.ts +1 -3
  23. package/build/templates/packages/nativewind/tailwind.config.js.ejs +15 -0
  24. package/build/templates/packages/nativewindui/components/Container.tsx.ejs +1 -0
  25. package/build/templates/packages/nativewindui/components/EditScreenInfo.tsx.ejs +1 -1
  26. package/build/templates/packages/nativewindui/components/ScreenContent.tsx.ejs +1 -1
  27. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.ios.tsx.ejs +52 -0
  28. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.tsx.ejs +58 -0
  29. package/build/templates/packages/nativewindui/components/nativewindui/Icon/index.ts.ejs +16 -0
  30. package/build/templates/packages/nativewindui/components/nativewindui/Icon/types.ts.ejs +18 -0
  31. package/build/templates/packages/nativewindui/components/{ThemeToggle.tsx.ejs → nativewindui/ThemeToggle.tsx.ejs} +8 -10
  32. package/build/templates/packages/nativewindui/drawer/app/(drawer)/index.tsx.ejs +17 -19
  33. package/build/templates/packages/nativewindui/drawer/app/+not-found.tsx.ejs +4 -44
  34. package/build/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs +2 -2
  35. package/build/templates/packages/nativewindui/drawer/app/modal.tsx.ejs +4 -4
  36. package/build/templates/packages/nativewindui/lib/useColorScheme.tsx.ejs +3 -37
  37. package/build/templates/packages/nativewindui/stack/app/+not-found.tsx.ejs +1 -1
  38. package/build/templates/packages/nativewindui/stack/app/_layout.tsx.ejs +17 -34
  39. package/build/templates/packages/nativewindui/stack/app/index.tsx.ejs +230 -275
  40. package/build/templates/packages/nativewindui/stack/app/modal.tsx.ejs +7 -7
  41. package/build/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs +6 -7
  42. package/build/templates/packages/nativewindui/tabs/app/+not-found.tsx.ejs +0 -40
  43. package/build/templates/packages/nativewindui/theme/colors.ts.ejs +52 -0
  44. package/build/templates/packages/nativewindui/theme/index.ts.ejs +2 -2
  45. package/build/templates/packages/nativewindui/theme/with-opacity.ts.ejs +155 -0
  46. package/build/templates/packages/react-navigation/App.tsx.ejs +2 -42
  47. package/build/types/constants.d.ts +1 -1
  48. package/build/types/types.d.ts +3 -3
  49. package/build/types/utilities/configAnalytics.d.ts +2 -2
  50. package/build/types.js +1 -3
  51. package/build/utilities/clearNavigationPackages.js +2 -2
  52. package/build/utilities/clearStylingPackages.js +2 -2
  53. package/build/utilities/configAnalytics.js +5 -4
  54. package/build/utilities/configureProjectFiles.js +31 -68
  55. package/build/utilities/copyBaseAssets.js +3 -2
  56. package/build/utilities/generateNWUI.js +8 -7
  57. package/build/utilities/generateProjectFiles.js +4 -9
  58. package/build/utilities/getPackageManager.js +6 -5
  59. package/build/utilities/printOutput.js +5 -16
  60. package/build/utilities/renderTitle.js +3 -2
  61. package/build/utilities/runCLI.js +15 -17
  62. package/build/utilities/runEasConfigure.js +3 -2
  63. package/build/utilities/runIgnite.js +3 -2
  64. package/build/utilities/showHelp.js +3 -4
  65. package/build/utilities/systemCommand.js +3 -3
  66. package/build/utilities/usePackage.js +3 -2
  67. package/build/utilities/validateProjectName.js +3 -2
  68. package/package.json +73 -71
  69. package/build/templates/packages/nativewind/postcss.config.mjs +0 -5
  70. package/build/templates/packages/nativewindui/components/BackButton.tsx.ejs +0 -23
  71. package/build/templates/packages/nativewindui/components/Button.tsx.ejs +0 -41
  72. package/build/templates/packages/nativewindui/lib/useHeaderSearchBar.tsx.ejs +0 -31
  73. package/build/templates/packages/restyle/components/BackButton.tsx.ejs +0 -15
  74. package/build/templates/packages/restyle/components/Button.tsx.ejs +0 -40
  75. package/build/templates/packages/restyle/components/Container.tsx.ejs +0 -6
  76. package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +0 -29
  77. package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +0 -21
  78. package/build/templates/packages/restyle/theme/Box.tsx.ejs +0 -6
  79. package/build/templates/packages/restyle/theme/Text.tsx.ejs +0 -6
  80. package/build/templates/packages/restyle/theme/index.ts.ejs +0 -6
  81. package/build/templates/packages/restyle/theme/theme.ts.ejs +0 -67
  82. package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +0 -19
  83. package/build/templates/packages/tamagui/components/Button.tsx.ejs +0 -18
  84. package/build/templates/packages/tamagui/components/Container.tsx.ejs +0 -6
  85. package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +0 -29
  86. package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +0 -23
  87. package/build/templates/packages/tamagui/tamagui.config.ts.ejs +0 -130
@@ -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
  );