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.
- package/README.md +1 -3
- package/build/cli.js +3 -2
- package/build/commands/create-expo-stack.js +9 -30
- package/build/constants.js +4 -4
- package/build/templates/base/App.tsx.ejs +12 -51
- package/build/templates/base/app.json.ejs +1 -0
- package/build/templates/base/babel.config.js.ejs +13 -16
- package/build/templates/base/components/Button.tsx.ejs +1 -0
- package/build/templates/base/components/Container.tsx.ejs +1 -0
- package/build/templates/base/package.json.ejs +34 -67
- package/build/templates/base/tsconfig.json.ejs +12 -7
- package/build/templates/packages/expo-router/drawer/app/+not-found.tsx.ejs +19 -60
- package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +2 -41
- package/build/templates/packages/expo-router/stack/app/+not-found.tsx.ejs +34 -66
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +15 -51
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +37 -5
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +34 -11
- package/build/templates/packages/expo-router/tabs/app/+not-found.tsx.ejs +21 -60
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +8 -48
- package/build/templates/packages/nativewind/global.css +3 -2
- package/build/templates/packages/nativewind/metro.config.js +3 -4
- package/build/templates/packages/nativewind/nativewind-env.d.ts +1 -3
- package/build/templates/packages/nativewind/tailwind.config.js.ejs +15 -0
- package/build/templates/packages/nativewindui/components/Container.tsx.ejs +1 -0
- package/build/templates/packages/nativewindui/components/EditScreenInfo.tsx.ejs +1 -1
- package/build/templates/packages/nativewindui/components/ScreenContent.tsx.ejs +1 -1
- package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.ios.tsx.ejs +52 -0
- package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.tsx.ejs +58 -0
- package/build/templates/packages/nativewindui/components/nativewindui/Icon/index.ts.ejs +16 -0
- package/build/templates/packages/nativewindui/components/nativewindui/Icon/types.ts.ejs +18 -0
- package/build/templates/packages/nativewindui/components/{ThemeToggle.tsx.ejs → nativewindui/ThemeToggle.tsx.ejs} +8 -10
- package/build/templates/packages/nativewindui/drawer/app/(drawer)/index.tsx.ejs +17 -19
- package/build/templates/packages/nativewindui/drawer/app/+not-found.tsx.ejs +4 -44
- package/build/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs +2 -2
- package/build/templates/packages/nativewindui/drawer/app/modal.tsx.ejs +4 -4
- package/build/templates/packages/nativewindui/lib/useColorScheme.tsx.ejs +3 -37
- package/build/templates/packages/nativewindui/stack/app/+not-found.tsx.ejs +1 -1
- package/build/templates/packages/nativewindui/stack/app/_layout.tsx.ejs +17 -34
- package/build/templates/packages/nativewindui/stack/app/index.tsx.ejs +230 -275
- package/build/templates/packages/nativewindui/stack/app/modal.tsx.ejs +7 -7
- package/build/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs +6 -7
- package/build/templates/packages/nativewindui/tabs/app/+not-found.tsx.ejs +0 -40
- package/build/templates/packages/nativewindui/theme/colors.ts.ejs +52 -0
- package/build/templates/packages/nativewindui/theme/index.ts.ejs +2 -2
- package/build/templates/packages/nativewindui/theme/with-opacity.ts.ejs +155 -0
- package/build/templates/packages/react-navigation/App.tsx.ejs +2 -42
- package/build/types/constants.d.ts +1 -1
- package/build/types/types.d.ts +3 -3
- package/build/types/utilities/configAnalytics.d.ts +2 -2
- package/build/types.js +1 -3
- package/build/utilities/clearNavigationPackages.js +2 -2
- package/build/utilities/clearStylingPackages.js +2 -2
- package/build/utilities/configAnalytics.js +5 -4
- package/build/utilities/configureProjectFiles.js +31 -68
- package/build/utilities/copyBaseAssets.js +3 -2
- package/build/utilities/generateNWUI.js +8 -7
- package/build/utilities/generateProjectFiles.js +4 -9
- package/build/utilities/getPackageManager.js +6 -5
- package/build/utilities/printOutput.js +5 -16
- package/build/utilities/renderTitle.js +3 -2
- package/build/utilities/runCLI.js +15 -17
- package/build/utilities/runEasConfigure.js +3 -2
- package/build/utilities/runIgnite.js +3 -2
- package/build/utilities/showHelp.js +3 -4
- package/build/utilities/systemCommand.js +3 -3
- package/build/utilities/usePackage.js +3 -2
- package/build/utilities/validateProjectName.js +3 -2
- package/package.json +73 -71
- package/build/templates/packages/nativewind/postcss.config.mjs +0 -5
- package/build/templates/packages/nativewindui/components/BackButton.tsx.ejs +0 -23
- package/build/templates/packages/nativewindui/components/Button.tsx.ejs +0 -41
- package/build/templates/packages/nativewindui/lib/useHeaderSearchBar.tsx.ejs +0 -31
- package/build/templates/packages/restyle/components/BackButton.tsx.ejs +0 -15
- package/build/templates/packages/restyle/components/Button.tsx.ejs +0 -40
- package/build/templates/packages/restyle/components/Container.tsx.ejs +0 -6
- package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +0 -29
- package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +0 -21
- package/build/templates/packages/restyle/theme/Box.tsx.ejs +0 -6
- package/build/templates/packages/restyle/theme/Text.tsx.ejs +0 -6
- package/build/templates/packages/restyle/theme/index.ts.ejs +0 -6
- package/build/templates/packages/restyle/theme/theme.ts.ejs +0 -67
- package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +0 -19
- package/build/templates/packages/tamagui/components/Button.tsx.ejs +0 -18
- package/build/templates/packages/tamagui/components/Container.tsx.ejs +0 -6
- package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +0 -29
- package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +0 -23
- package/build/templates/packages/tamagui/tamagui.config.ts.ejs +0 -130
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
import '
|
|
2
|
-
|
|
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
|
-
|
|
9
|
-
import
|
|
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 {
|
|
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 {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
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
|
|
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
|
-
|
|
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=
|
|
80
|
-
|
|
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
|
);
|