@mr.dj2u/create-expo-stack 2.21.3-mrdj.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 (191) hide show
  1. package/README.md +435 -0
  2. package/bin/create-expo-stack.js +2 -0
  3. package/build/cli.js +49 -0
  4. package/build/commands/create-expo-stack.js +471 -0
  5. package/build/constants.js +39 -0
  6. package/build/templates/base/.gitignore.ejs +26 -0
  7. package/build/templates/base/.npmrc.ejs +1 -0
  8. package/build/templates/base/App.tsx.ejs +66 -0
  9. package/build/templates/base/app.json.ejs +69 -0
  10. package/build/templates/base/assets/adaptive-icon.png +0 -0
  11. package/build/templates/base/assets/favicon.png +0 -0
  12. package/build/templates/base/assets/icon.png +0 -0
  13. package/build/templates/base/assets/splash.png +0 -0
  14. package/build/templates/base/babel.config.js.ejs +38 -0
  15. package/build/templates/base/components/BackButton.tsx.ejs +23 -0
  16. package/build/templates/base/components/Button.tsx.ejs +42 -0
  17. package/build/templates/base/components/Container.tsx.ejs +14 -0
  18. package/build/templates/base/components/EditScreenInfo.tsx.ejs +44 -0
  19. package/build/templates/base/components/HeaderButton.tsx.ejs +31 -0
  20. package/build/templates/base/components/ScreenContent.tsx.ejs +40 -0
  21. package/build/templates/base/components/TabBarIcon.tsx.ejs +15 -0
  22. package/build/templates/base/eslint.config.js.ejs +15 -0
  23. package/build/templates/base/package.json.ejs +191 -0
  24. package/build/templates/base/prettier.config.js.ejs +11 -0
  25. package/build/templates/base/tsconfig.json.ejs +39 -0
  26. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +40 -0
  27. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +15 -0
  28. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +15 -0
  29. package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +65 -0
  30. package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +15 -0
  31. package/build/templates/packages/expo-router/drawer/app/+html.tsx.ejs +49 -0
  32. package/build/templates/packages/expo-router/drawer/app/+not-found.tsx.ejs +100 -0
  33. package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +91 -0
  34. package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +21 -0
  35. package/build/templates/packages/expo-router/expo-env.d.ts +4 -0
  36. package/build/templates/packages/expo-router/index.js.ejs +4 -0
  37. package/build/templates/packages/expo-router/metro.config.js.ejs +24 -0
  38. package/build/templates/packages/expo-router/stack/app/+html.tsx.ejs +49 -0
  39. package/build/templates/packages/expo-router/stack/app/+not-found.tsx.ejs +113 -0
  40. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +63 -0
  41. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +56 -0
  42. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +73 -0
  43. package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +52 -0
  44. package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +37 -0
  45. package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +37 -0
  46. package/build/templates/packages/expo-router/tabs/app/+html.tsx.ejs +49 -0
  47. package/build/templates/packages/expo-router/tabs/app/+not-found.tsx.ejs +110 -0
  48. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +84 -0
  49. package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +21 -0
  50. package/build/templates/packages/firebase/.env.ejs +8 -0
  51. package/build/templates/packages/firebase/metro.config.js.ejs +14 -0
  52. package/build/templates/packages/firebase/utils/firebase.ts.ejs +26 -0
  53. package/build/templates/packages/i18next/components/InternalizationExample.tsx.ejs +23 -0
  54. package/build/templates/packages/i18next/core/i18n/fallbackChecker.ts.ejs +13 -0
  55. package/build/templates/packages/i18next/core/i18n/init.ts.ejs +24 -0
  56. package/build/templates/packages/i18next/core/i18n/languageDetector.ts.ejs +13 -0
  57. package/build/templates/packages/i18next/translation/en.json.ejs +8 -0
  58. package/build/templates/packages/i18next/translation/fr.json.ejs +8 -0
  59. package/build/templates/packages/i18next/translation/index.ts.ejs +20 -0
  60. package/build/templates/packages/nativewind/components/BackButton.tsx.ejs +22 -0
  61. package/build/templates/packages/nativewind/components/Button.tsx.ejs +21 -0
  62. package/build/templates/packages/nativewind/components/Container.tsx.ejs +13 -0
  63. package/build/templates/packages/nativewind/components/EditScreenInfo.tsx.ejs +40 -0
  64. package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +27 -0
  65. package/build/templates/packages/nativewind/global.css +3 -0
  66. package/build/templates/packages/nativewind/metro.config.js +7 -0
  67. package/build/templates/packages/nativewind/nativewind-env.d.ts +2 -0
  68. package/build/templates/packages/nativewind/tailwind.config.js.ejs +15 -0
  69. package/build/templates/packages/nativewindui/components/Container.tsx.ejs +14 -0
  70. package/build/templates/packages/nativewindui/components/EditScreenInfo.tsx.ejs +45 -0
  71. package/build/templates/packages/nativewindui/components/HeaderButton.tsx.ejs +31 -0
  72. package/build/templates/packages/nativewindui/components/ScreenContent.tsx.ejs +40 -0
  73. package/build/templates/packages/nativewindui/components/TabBarIcon.tsx.ejs +15 -0
  74. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.ios.tsx.ejs +52 -0
  75. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.tsx.ejs +58 -0
  76. package/build/templates/packages/nativewindui/components/nativewindui/Icon/index.ts.ejs +16 -0
  77. package/build/templates/packages/nativewindui/components/nativewindui/Icon/types.ts.ejs +18 -0
  78. package/build/templates/packages/nativewindui/components/nativewindui/ThemeToggle.tsx.ejs +33 -0
  79. package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +28 -0
  80. package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/index.tsx.ejs +15 -0
  81. package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/two.tsx.ejs +15 -0
  82. package/build/templates/packages/nativewindui/drawer/app/(drawer)/_layout.tsx.ejs +35 -0
  83. package/build/templates/packages/nativewindui/drawer/app/(drawer)/index.tsx.ejs +535 -0
  84. package/build/templates/packages/nativewindui/drawer/app/+html.tsx.ejs +46 -0
  85. package/build/templates/packages/nativewindui/drawer/app/+not-found.tsx.ejs +83 -0
  86. package/build/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs +75 -0
  87. package/build/templates/packages/nativewindui/drawer/app/modal.tsx.ejs +33 -0
  88. package/build/templates/packages/nativewindui/global.css.ejs +91 -0
  89. package/build/templates/packages/nativewindui/lib/cn.ts.ejs +6 -0
  90. package/build/templates/packages/nativewindui/lib/useColorScheme.tsx.ejs +21 -0
  91. package/build/templates/packages/nativewindui/nativewind-env.d.ts.ejs +1 -0
  92. package/build/templates/packages/nativewindui/stack/app/+html.tsx.ejs +46 -0
  93. package/build/templates/packages/nativewindui/stack/app/+not-found.tsx.ejs +18 -0
  94. package/build/templates/packages/nativewindui/stack/app/_layout.tsx.ejs +78 -0
  95. package/build/templates/packages/nativewindui/stack/app/index.tsx.ejs +487 -0
  96. package/build/templates/packages/nativewindui/stack/app/modal.tsx.ejs +33 -0
  97. package/build/templates/packages/nativewindui/tabs/app/(tabs)/_layout.tsx.ejs +35 -0
  98. package/build/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs +537 -0
  99. package/build/templates/packages/nativewindui/tabs/app/(tabs)/two.tsx.ejs +22 -0
  100. package/build/templates/packages/nativewindui/tabs/app/+html.tsx.ejs +46 -0
  101. package/build/templates/packages/nativewindui/tabs/app/+not-found.tsx.ejs +90 -0
  102. package/build/templates/packages/nativewindui/tabs/app/_layout.tsx.ejs +78 -0
  103. package/build/templates/packages/nativewindui/tabs/app/modal.tsx.ejs +21 -0
  104. package/build/templates/packages/nativewindui/tailwind.config.js.ejs +67 -0
  105. package/build/templates/packages/nativewindui/theme/colors.ts.ejs +123 -0
  106. package/build/templates/packages/nativewindui/theme/index.ts.ejs +32 -0
  107. package/build/templates/packages/nativewindui/theme/with-opacity.ts.ejs +155 -0
  108. package/build/templates/packages/react-navigation/App.tsx.ejs +73 -0
  109. package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +31 -0
  110. package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +108 -0
  111. package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +38 -0
  112. package/build/templates/packages/react-navigation/screens/details.tsx.ejs +41 -0
  113. package/build/templates/packages/react-navigation/screens/home.tsx.ejs +5 -0
  114. package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +20 -0
  115. package/build/templates/packages/react-navigation/screens/one.tsx.ejs +5 -0
  116. package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +54 -0
  117. package/build/templates/packages/react-navigation/screens/two.tsx.ejs +5 -0
  118. package/build/templates/packages/restyle/components/BackButton.tsx.ejs +19 -0
  119. package/build/templates/packages/restyle/components/Button.tsx.ejs +32 -0
  120. package/build/templates/packages/restyle/components/Container.tsx.ejs +16 -0
  121. package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +38 -0
  122. package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +30 -0
  123. package/build/templates/packages/restyle/theme.ts.ejs +51 -0
  124. package/build/templates/packages/supabase/.env.ejs +2 -0
  125. package/build/templates/packages/supabase/utils/supabase.ts.ejs +14 -0
  126. package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +12 -0
  127. package/build/templates/packages/tamagui/components/Button.tsx.ejs +17 -0
  128. package/build/templates/packages/tamagui/components/Container.tsx.ejs +12 -0
  129. package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +27 -0
  130. package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +23 -0
  131. package/build/templates/packages/tamagui/tamagui.config.ts.ejs +14 -0
  132. package/build/templates/packages/unistyles/breakpoints.ts.ejs +9 -0
  133. package/build/templates/packages/unistyles/components/BackButton.tsx.ejs +28 -0
  134. package/build/templates/packages/unistyles/components/Button.tsx.ejs +42 -0
  135. package/build/templates/packages/unistyles/components/Container.tsx.ejs +17 -0
  136. package/build/templates/packages/unistyles/components/EditScreenInfo.tsx.ejs +53 -0
  137. package/build/templates/packages/unistyles/components/ScreenContent.tsx.ejs +43 -0
  138. package/build/templates/packages/unistyles/theme.ts.ejs +34 -0
  139. package/build/templates/packages/unistyles/unistyles.ts.ejs +27 -0
  140. package/build/templates/packages/uniwind/global.css +2 -0
  141. package/build/templates/packages/uniwind/metro.config.js.ejs +10 -0
  142. package/build/templates/packages/vexo-analytics/.env.ejs +7 -0
  143. package/build/templates/packages/zustand/store/store.ts.ejs +15 -0
  144. package/build/types/cli.d.ts +4 -0
  145. package/build/types/commands/create-expo-stack.d.ts +3 -0
  146. package/build/types/constants.d.ts +10 -0
  147. package/build/types/types.d.ts +33 -0
  148. package/build/types/utilities/bumpVersion.d.ts +1 -0
  149. package/build/types/utilities/clearNavigationPackages.d.ts +2 -0
  150. package/build/types/utilities/clearStylingPackages.d.ts +2 -0
  151. package/build/types/utilities/configAnalytics.d.ts +18 -0
  152. package/build/types/utilities/configStorage.d.ts +8 -0
  153. package/build/types/utilities/configureProjectFiles.d.ts +3 -0
  154. package/build/types/utilities/copyBaseAssets.d.ts +2 -0
  155. package/build/types/utilities/generateNWUI.d.ts +3 -0
  156. package/build/types/utilities/generateProjectFiles.d.ts +5 -0
  157. package/build/types/utilities/getPackageManager.d.ts +8 -0
  158. package/build/types/utilities/index.d.ts +10 -0
  159. package/build/types/utilities/printOutput.d.ts +3 -0
  160. package/build/types/utilities/publishToGitHub.d.ts +2 -0
  161. package/build/types/utilities/renderTitle.d.ts +2 -0
  162. package/build/types/utilities/runCLI.d.ts +3 -0
  163. package/build/types/utilities/runEasConfigure.d.ts +3 -0
  164. package/build/types/utilities/runIgnite.d.ts +3 -0
  165. package/build/types/utilities/showHelp.d.ts +1 -0
  166. package/build/types/utilities/systemCommand.d.ts +14 -0
  167. package/build/types/utilities/usePackage.d.ts +2 -0
  168. package/build/types/utilities/validateProjectName.d.ts +4 -0
  169. package/build/types.js +39 -0
  170. package/build/utilities/bumpVersion.js +21 -0
  171. package/build/utilities/clearNavigationPackages.js +11 -0
  172. package/build/utilities/clearStylingPackages.js +11 -0
  173. package/build/utilities/configAnalytics.js +70 -0
  174. package/build/utilities/configStorage.js +50 -0
  175. package/build/utilities/configureProjectFiles.js +380 -0
  176. package/build/utilities/copyBaseAssets.js +21 -0
  177. package/build/utilities/generateNWUI.js +54 -0
  178. package/build/utilities/generateProjectFiles.js +106 -0
  179. package/build/utilities/getPackageManager.js +103 -0
  180. package/build/utilities/index.js +27 -0
  181. package/build/utilities/printOutput.js +251 -0
  182. package/build/utilities/publishToGitHub.js +173 -0
  183. package/build/utilities/renderTitle.js +55 -0
  184. package/build/utilities/runCLI.js +437 -0
  185. package/build/utilities/runEasConfigure.js +83 -0
  186. package/build/utilities/runIgnite.js +26 -0
  187. package/build/utilities/showHelp.js +85 -0
  188. package/build/utilities/systemCommand.js +40 -0
  189. package/build/utilities/usePackage.js +8 -0
  190. package/build/utilities/validateProjectName.js +42 -0
  191. package/package.json +77 -0
@@ -0,0 +1,78 @@
1
+ import '../global.css';
2
+ import 'expo-dev-client';
3
+ import { ThemeProvider as NavThemeProvider } from '@react-navigation/native';
4
+ import { Icon } from '@roninoss/icons';
5
+ <% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
6
+ import { ActionSheetProvider } from '@expo/react-native-action-sheet';
7
+ <% } %>
8
+ <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
9
+ import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
10
+ <% } %>
11
+ import { Link, Stack } from 'expo-router';
12
+ import { StatusBar } from 'expo-status-bar';
13
+ import { Pressable, View } from 'react-native';
14
+ <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
15
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
16
+ <% } %>
17
+
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';
22
+
23
+ export {
24
+ // Catch any errors thrown by the Layout component.
25
+ ErrorBoundary,
26
+ } from 'expo-router';
27
+
28
+ export default function RootLayout() {
29
+ useInitialAndroidBarSync();
30
+ const { colorScheme, isDarkColorScheme } = useColorScheme();
31
+
32
+ return (
33
+ <>
34
+ <StatusBar
35
+ key={`root-status-bar-${isDarkColorScheme ? 'light' : 'dark'}`}
36
+ style={isDarkColorScheme ? 'light' : 'dark'}
37
+ />
38
+ {/* WRAP YOUR APP WITH ANY ADDITIONAL PROVIDERS HERE */}
39
+ {/* <ExampleProvider> */}
40
+ <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
41
+ <GestureHandlerRootView style={{ flex: 1 }}>
42
+ <BottomSheetModalProvider>
43
+ <% } %>
44
+ <% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
45
+ <ActionSheetProvider>
46
+ <% } %>
47
+ <NavThemeProvider value={NAV_THEME[colorScheme]}>
48
+ <Stack screenOptions={SCREEN_OPTIONS}>
49
+ <Stack.Screen name="(tabs)" options={TABS_OPTIONS} />
50
+ <Stack.Screen name="modal" options={MODAL_OPTIONS} />
51
+ </Stack>
52
+ </NavThemeProvider>
53
+ <% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
54
+ </ActionSheetProvider>
55
+ <% } %>
56
+ <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
57
+ </BottomSheetModalProvider>
58
+ </GestureHandlerRootView>
59
+ <% } %>
60
+ {/* </ExampleProvider> */}
61
+ </>
62
+ );
63
+ }
64
+
65
+ const SCREEN_OPTIONS = {
66
+ animation: 'ios_from_right', // for android
67
+ } as const;
68
+
69
+ const TABS_OPTIONS = {
70
+ headerShown: false,
71
+ } as const;
72
+
73
+ const MODAL_OPTIONS = {
74
+ presentation: 'modal',
75
+ animation: 'fade_from_bottom', // for android
76
+ title: 'Settings',
77
+ headerRight: () => <ThemeToggle />,
78
+ } as const;
@@ -0,0 +1,21 @@
1
+ import { StatusBar } from 'expo-status-bar';
2
+ import { Platform } from 'react-native';
3
+
4
+ import { ScreenContent } from '@/components/ScreenContent';
5
+
6
+ <% if (props.internalizationPackage?.name === "i18next") { %>
7
+ import { InternalizationExample } from 'components/InternalizationExample';
8
+ <% } %>
9
+
10
+ export default function Modal() {
11
+ return (
12
+ <>
13
+ <ScreenContent path="app/modal.tsx" title="Modal">
14
+ <% if (props.internalizationPackage?.name === "i18next") { %>
15
+ <InternalizationExample />
16
+ <% } %>
17
+ </ScreenContent>
18
+ <StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
19
+ </>
20
+ );
21
+ }
@@ -0,0 +1,67 @@
1
+ const { hairlineWidth, platformSelect } = require('nativewind/theme');
2
+
3
+ /** @type {import('tailwindcss').Config} */
4
+ module.exports = {
5
+ // NOTE: Update this to include the paths to all of your component files.
6
+ darkMode: 'class', // Enable manual toggling of dark mode
7
+ content: ['./app/**/*.{js,jsx,ts,tsx}', './components/**/*.{js,jsx,ts,tsx}'],
8
+ presets: [require('nativewind/preset')],
9
+ theme: {
10
+ extend: {
11
+ colors: {
12
+ border: withOpacity('border'),
13
+ input: withOpacity('input'),
14
+ ring: withOpacity('ring'),
15
+ background: withOpacity('background'),
16
+ foreground: withOpacity('foreground'),
17
+ primary: {
18
+ DEFAULT: withOpacity('primary'),
19
+ foreground: withOpacity('primary-foreground'),
20
+ },
21
+ secondary: {
22
+ DEFAULT: withOpacity('secondary'),
23
+ foreground: withOpacity('secondary-foreground'),
24
+ },
25
+ destructive: {
26
+ DEFAULT: withOpacity('destructive'),
27
+ foreground: withOpacity('destructive-foreground'),
28
+ },
29
+ muted: {
30
+ DEFAULT: withOpacity('muted'),
31
+ foreground: withOpacity('muted-foreground'),
32
+ },
33
+ accent: {
34
+ DEFAULT: withOpacity('accent'),
35
+ foreground: withOpacity('accent-foreground'),
36
+ },
37
+ popover: {
38
+ DEFAULT: withOpacity('popover'),
39
+ foreground: withOpacity('popover-foreground'),
40
+ },
41
+ card: {
42
+ DEFAULT: withOpacity('card'),
43
+ foreground: withOpacity('card-foreground'),
44
+ },
45
+ },
46
+ borderWidth: {
47
+ hairline: hairlineWidth(),
48
+ },
49
+ },
50
+ },
51
+ plugins: [],
52
+ };
53
+
54
+ function withOpacity(variableName) {
55
+ return ({ opacityValue }) => {
56
+ if (opacityValue !== undefined) {
57
+ return platformSelect({
58
+ ios: `rgb(var(--${variableName}) / ${opacityValue})`,
59
+ android: `rgb(var(--android-${variableName}) / ${opacityValue})`,
60
+ });
61
+ }
62
+ return platformSelect({
63
+ ios: `rgb(var(--${variableName}))`,
64
+ android: `rgb(var(--android-${variableName}))`,
65
+ });
66
+ };
67
+ }
@@ -0,0 +1,123 @@
1
+ import { Platform } from 'react-native';
2
+
3
+ const IOS_SYSTEM_COLORS = {
4
+ white: 'rgb(255, 255, 255)',
5
+ black: 'rgb(0, 0, 0)',
6
+ light: {
7
+ grey6: 'rgb(242, 242, 247)',
8
+ grey5: 'rgb(230, 230, 235)',
9
+ grey4: 'rgb(210, 210, 215)',
10
+ grey3: 'rgb(199, 199, 204)',
11
+ grey2: 'rgb(175, 176, 180)',
12
+ grey: 'rgb(142, 142, 147)',
13
+ background: 'rgb(242, 242, 247)',
14
+ foreground: 'rgb(0, 0, 0)',
15
+ root: 'rgb(255, 255, 255)',
16
+ card: 'rgb(255, 255, 255)',
17
+ cardForeground: 'rgb(8, 28, 30)',
18
+ popover: 'rgb(230, 230, 235)',
19
+ popoverForeground: 'rgb(0, 0, 0)',
20
+ destructive: 'rgb(255, 56, 43)',
21
+ primary: 'rgb(0, 123, 254)',
22
+ primaryForeground: 'rgb(255, 255, 255)',
23
+ secondary: 'rgb(45, 175, 231)',
24
+ secondaryForeground: 'rgb(255, 255, 255)',
25
+ muted: 'rgb(175, 176, 180)',
26
+ mutedForeground: 'rgb(142, 142, 147)',
27
+ accent: 'rgb(255, 40, 84)',
28
+ accentForeground: 'rgb(255, 255, 255)',
29
+ border: 'rgb(230, 230, 235)',
30
+ input: 'rgb(210, 210, 215)',
31
+ ring: 'rgb(230, 230, 235)',
32
+ },
33
+ dark: {
34
+ grey6: 'rgb(21, 21, 24)',
35
+ grey5: 'rgb(40, 40, 42)',
36
+ grey4: 'rgb(55, 55, 57)',
37
+ grey3: 'rgb(70, 70, 73)',
38
+ grey2: 'rgb(99, 99, 102)',
39
+ grey: 'rgb(142, 142, 147)',
40
+ background: 'rgb(0, 0, 0)',
41
+ foreground: 'rgb(255, 255, 255)',
42
+ root: 'rgb(0, 0, 0)',
43
+ card: 'rgb(28, 28, 30)',
44
+ cardForeground: 'rgb(255, 255, 255)',
45
+ popover: 'rgb(40, 40, 42)',
46
+ popoverForeground: 'rgb(255, 255, 255)',
47
+ destructive: 'rgb(254, 67, 54)',
48
+ primary: 'rgb(3, 133, 255)',
49
+ primaryForeground: 'rgb(255, 255, 255)',
50
+ secondary: 'rgb(100, 211, 254)',
51
+ secondaryForeground: 'rgb(255, 255, 255)',
52
+ muted: 'rgb(70, 70, 73)',
53
+ mutedForeground: 'rgb(142, 142, 147)',
54
+ accent: 'rgb(255, 52, 95)',
55
+ accentForeground: 'rgb(255, 255, 255)',
56
+ border: 'rgb(40, 40, 42)',
57
+ input: 'rgb(55, 55, 57)',
58
+ ring: 'rgb(40, 40, 42)',
59
+ },
60
+ } as const;
61
+
62
+ const ANDROID_COLORS = {
63
+ white: 'rgb(255, 255, 255)',
64
+ black: 'rgb(0, 0, 0)',
65
+ light: {
66
+ grey6: 'rgb(249, 249, 255)',
67
+ grey5: 'rgb(215, 217, 228)',
68
+ grey4: 'rgb(193, 198, 215)',
69
+ grey3: 'rgb(113, 119, 134)',
70
+ grey2: 'rgb(65, 71, 84)',
71
+ grey: 'rgb(24, 28, 35)',
72
+ background: 'rgb(249, 249, 255)',
73
+ foreground: 'rgb(0, 0, 0)',
74
+ root: 'rgb(255, 255, 255)',
75
+ card: 'rgb(255, 255, 255)',
76
+ cardForeground: 'rgb(24, 28, 35)',
77
+ popover: 'rgb(215, 217, 228)',
78
+ popoverForeground: 'rgb(0, 0, 0)',
79
+ destructive: 'rgb(186, 26, 26)',
80
+ primary: 'rgb(0, 112, 233)',
81
+ primaryForeground: 'rgb(255, 255, 255)',
82
+ secondary: 'rgb(176, 201, 255)',
83
+ secondaryForeground: 'rgb(20, 55, 108)',
84
+ muted: 'rgb(193, 198, 215)',
85
+ mutedForeground: 'rgb(65, 71, 84)',
86
+ accent: 'rgb(169, 73, 204)',
87
+ accentForeground: 'rgb(255, 255, 255)',
88
+ border: 'rgb(215, 217, 228)',
89
+ input: 'rgb(210, 210, 215)',
90
+ ring: 'rgb(215, 217, 228)',
91
+ },
92
+ dark: {
93
+ grey6: 'rgb(16, 19, 27)',
94
+ grey5: 'rgb(39, 42, 50)',
95
+ grey4: 'rgb(49, 53, 61)',
96
+ grey3: 'rgb(54, 57, 66)',
97
+ grey2: 'rgb(139, 144, 160)',
98
+ grey: 'rgb(193, 198, 215)',
99
+ background: 'rgb(0, 0, 0)',
100
+ foreground: 'rgb(255, 255, 255)',
101
+ root: 'rgb(0, 0, 0)',
102
+ card: 'rgb(16, 19, 27)',
103
+ cardForeground: 'rgb(224, 226, 237)',
104
+ popover: 'rgb(39, 42, 50)',
105
+ popoverForeground: 'rgb(224, 226, 237)',
106
+ destructive: 'rgb(147, 0, 10)',
107
+ primary: 'rgb(3, 133, 255)',
108
+ primaryForeground: 'rgb(255, 255, 255)',
109
+ secondary: 'rgb(28, 60, 114)',
110
+ secondaryForeground: 'rgb(189, 209, 255)',
111
+ muted: 'rgb(216, 226, 255)',
112
+ mutedForeground: 'rgb(139, 144, 160)',
113
+ accent: 'rgb(83, 0, 111)',
114
+ accentForeground: 'rgb(238, 177, 255)',
115
+ border: 'rgb(39, 42, 50)',
116
+ input: 'rgb(55, 55, 57)',
117
+ ring: 'rgb(39, 42, 50)',
118
+ },
119
+ } as const;
120
+
121
+ const COLORS = Platform.OS === 'ios' ? IOS_SYSTEM_COLORS : ANDROID_COLORS;
122
+
123
+ export { COLORS };
@@ -0,0 +1,32 @@
1
+ import { Theme, DefaultTheme, DarkTheme } from '@react-navigation/native';
2
+
3
+ import { COLORS } from './colors';
4
+
5
+ const NAV_THEME: { light: Theme; dark: Theme } = {
6
+ light: {
7
+ dark: false,
8
+ colors: {
9
+ background: COLORS.light.background,
10
+ border: COLORS.light.grey5,
11
+ card: COLORS.light.card,
12
+ notification: COLORS.light.destructive,
13
+ primary: COLORS.light.primary,
14
+ text: COLORS.black,
15
+ },
16
+ fonts: DefaultTheme.fonts,
17
+ },
18
+ dark: {
19
+ dark: true,
20
+ colors: {
21
+ background: COLORS.dark.background,
22
+ border: COLORS.dark.grey5,
23
+ card: COLORS.dark.grey6,
24
+ notification: COLORS.dark.destructive,
25
+ primary: COLORS.dark.primary,
26
+ text: COLORS.white,
27
+ },
28
+ fonts: DarkTheme.fonts,
29
+ },
30
+ };
31
+
32
+ export { NAV_THEME };
@@ -0,0 +1,155 @@
1
+ export function withOpacity(color: string, opacity: number): string {
2
+ if (opacity < 0 || opacity > 1) {
3
+ throw new Error('Opacity should be between 0 and 1.');
4
+ }
5
+
6
+ // Detect the color format and delegate to the appropriate function
7
+ if (isNamedColor(color)) {
8
+ return withOpacityNamedColor(color, opacity);
9
+ } else if (color.startsWith('#')) {
10
+ return withOpacityHex(color, opacity);
11
+ } else if (color.startsWith('rgba')) {
12
+ return withOpacityRgba(color, opacity);
13
+ } else if (color.startsWith('rgb')) {
14
+ return withOpacityRgb(color, opacity);
15
+ } else if (color.startsWith('hsla')) {
16
+ return withOpacityHsla(color, opacity);
17
+ } else if (color.startsWith('hsl')) {
18
+ return withOpacityHsl(color, opacity);
19
+ } else {
20
+ throw new Error('Unsupported color format');
21
+ }
22
+ }
23
+
24
+ // Helper function for HEX colors
25
+ function withOpacityHex(hex: string, opacity: number): string {
26
+ const hexCode = hex.replace('#', '');
27
+ const expandedHex =
28
+ hexCode.length === 3
29
+ ? hexCode
30
+ .split('')
31
+ .map((x) => x + x)
32
+ .join('')
33
+ : hexCode;
34
+
35
+ const r = parseInt(expandedHex.substr(0, 2), 16);
36
+ const g = parseInt(expandedHex.substr(2, 2), 16);
37
+ const b = parseInt(expandedHex.substr(4, 2), 16);
38
+
39
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
40
+ }
41
+
42
+ // Helper function for RGB colors
43
+ function withOpacityRgb(rgb: string, opacity: number): string {
44
+ const match = rgb.match(/^rgb\((\d+), (\d+), (\d+)\)$/);
45
+ if (!match) {
46
+ throw new Error('Invalid RGB color format');
47
+ }
48
+
49
+ const r = parseInt(match[1], 10);
50
+ const g = parseInt(match[2], 10);
51
+ const b = parseInt(match[3], 10);
52
+
53
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
54
+ }
55
+
56
+ // Helper function for RGBA colors
57
+ function withOpacityRgba(rgba: string, opacity: number): string {
58
+ const match = rgba.match(/^rgba\((\d+), (\d+), (\d+), ([0-1]?(?:\.\d+)?)\)$/);
59
+ if (!match) {
60
+ throw new Error('Invalid RGBA color format');
61
+ }
62
+
63
+ const r = parseInt(match[1], 10);
64
+ const g = parseInt(match[2], 10);
65
+ const b = parseInt(match[3], 10);
66
+
67
+ return `rgba(${r}, ${g}, ${b}, ${opacity})`;
68
+ }
69
+
70
+ // Helper function for HSL colors with opacity
71
+ function withOpacityHsl(hsl: string, opacity: number): string {
72
+ // Updated regex to handle space-separated HSL format with optional decimals
73
+ const match = hsl.match(/^hsl\((\d+(\.\d+)?)(?:\s+)(\d+(\.\d+)?)%\s+(\d+(\.\d+)?)%\)$/);
74
+
75
+ if (!match) {
76
+ throw new Error('Invalid HSL color format');
77
+ }
78
+
79
+ const h = match[1]; // Hue (can be an integer or decimal)
80
+ const s = match[3]; // Saturation (can be an integer or decimal)
81
+ const l = match[5]; // Lightness (can be an integer or decimal)
82
+
83
+ return `hsla(${h}, ${s}%, ${l}%, ${opacity})`;
84
+ }
85
+
86
+ // Helper function for HSLA colors
87
+ function withOpacityHsla(hsla: string, opacity: number): string {
88
+ const match = hsla.match(/^hsla\((\d+), (\d+)%?, (\d+)%?, ([0-1]?(?:\.\d+)?)\)$/);
89
+ if (!match) {
90
+ throw new Error('Invalid HSLA color format');
91
+ }
92
+
93
+ const h = match[1];
94
+ const s = match[2];
95
+ const l = match[3];
96
+
97
+ return `hsla(${h}, ${s}%, ${l}%, ${opacity})`;
98
+ }
99
+
100
+ // Helper function for named colors (basic implementation)
101
+ function isNamedColor(color: string): boolean {
102
+ const namedColors = new Set([
103
+ 'red',
104
+ 'green',
105
+ 'blue',
106
+ 'yellow',
107
+ 'black',
108
+ 'white',
109
+ 'gray',
110
+ 'orange',
111
+ 'purple',
112
+ 'brown',
113
+ 'pink',
114
+ 'cyan',
115
+ 'magenta',
116
+ 'lime',
117
+ 'teal',
118
+ 'indigo',
119
+ 'violet',
120
+ 'gold',
121
+ 'silver',
122
+ ]);
123
+ return namedColors.has(color.toLowerCase());
124
+ }
125
+
126
+ // Helper function for named color opacity
127
+ function withOpacityNamedColor(color: string, opacity: number): string {
128
+ return `rgba(${namedColorToRgb(color)}, ${opacity})`;
129
+ }
130
+
131
+ // Converts a named color to RGB (simplified, basic colors only)
132
+ function namedColorToRgb(color: string): string {
133
+ const colors: { [key: string]: string } = {
134
+ red: '255, 0, 0',
135
+ green: '0, 255, 0',
136
+ blue: '0, 0, 255',
137
+ yellow: '255, 255, 0',
138
+ black: '0, 0, 0',
139
+ white: '255, 255, 255',
140
+ gray: '128, 128, 128',
141
+ orange: '255, 165, 0',
142
+ purple: '128, 0, 128',
143
+ brown: '165, 42, 42',
144
+ pink: '255, 192, 203',
145
+ cyan: '0, 255, 255',
146
+ magenta: '255, 0, 255',
147
+ lime: '0, 255, 0',
148
+ teal: '0, 128, 128',
149
+ indigo: '75, 0, 130',
150
+ violet: '238, 130, 238',
151
+ gold: '255, 215, 0',
152
+ silver: '192, 192, 192',
153
+ };
154
+ return colors[color.toLowerCase()] || '0, 0, 0'; // default to black if color is unknown
155
+ }
@@ -0,0 +1,73 @@
1
+ <% if (props.stylingPackage?.name === "nativewind") { %>
2
+ import './global.css';
3
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
4
+ <% } else if (props.stylingPackage?.name === "nativewinui") { %>
5
+ import './global.css';
6
+ import 'expo-dev-client';
7
+ <% } %>
8
+ <% if (props.stylingPackage?.name === "unistyles") { %>
9
+ import './unistyles';
10
+ import { DefaultTheme, DarkTheme } from '@react-navigation/native';
11
+ import { useUnistyles } from 'react-native-unistyles';
12
+ import { useMemo } from 'react';
13
+ <% } else if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "stylesheet") { %>
14
+ import { DefaultTheme, DarkTheme } from '@react-navigation/native';
15
+ import { useColorScheme } from 'react-native';
16
+ import { useMemo } from 'react';
17
+ <% } %>
18
+ <% if (props.internalizationPackage?.name === "i18next") { %>
19
+ import './translation';
20
+ <% } %>
21
+ import "react-native-gesture-handler";
22
+
23
+ <% if (props.analyticsPackage?.name === "vexo-analytics") { %>
24
+ import { vexo } from 'vexo-analytics';
25
+
26
+ const vexoApiKey = process.env.EXPO_PUBLIC_VEXO_API_KEY || process.env.VEXO_API_KEY;
27
+ if (vexoApiKey) {
28
+ vexo(vexoApiKey); // eslint-disable-line
29
+ }
30
+
31
+ import Navigation from "./navigation"; // eslint-disable-line
32
+ <% } else { %>
33
+ import Navigation from "./navigation";
34
+ <% } %>
35
+
36
+ export default function App() {
37
+ <% if (props.stylingPackage?.name === "unistyles") { %>
38
+ const { theme, rt } = useUnistyles();
39
+
40
+ const baseTheme = rt.colorScheme === 'dark' ? DarkTheme : DefaultTheme;
41
+ const mergedTheme = useMemo(() => ({
42
+ ...baseTheme,
43
+ colors: {
44
+ ...baseTheme.colors,
45
+ background: theme.colors.background,
46
+ text: theme.colors.typography,
47
+ primary: theme.colors.astral,
48
+ secondary: theme.colors.cornflowerBlue,
49
+ border: theme.colors.limedSpruce,
50
+ card: theme.colors.background,
51
+ notification: theme.colors.astral,
52
+ },
53
+ }), [baseTheme, theme.colors.background, theme.colors.typography, theme.colors.astral, theme.colors.cornflowerBlue, theme.colors.limedSpruce]);
54
+
55
+ return <Navigation theme={mergedTheme} />;
56
+ <% } else if (props.stylingPackage?.name === "nativewind") { %>
57
+ const colorScheme = useColorScheme();
58
+ const theme = useMemo(() => colorScheme === 'dark' ? DarkTheme : DefaultTheme, [colorScheme]);
59
+
60
+ return (
61
+ <SafeAreaProvider>
62
+ <Navigation theme={theme} />
63
+ </SafeAreaProvider>
64
+ );
65
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
66
+ const colorScheme = useColorScheme();
67
+ const theme = useMemo(() => colorScheme === 'dark' ? DarkTheme : DefaultTheme, [colorScheme]);
68
+
69
+ return <Navigation theme={theme} />;
70
+ <% } else { %>
71
+ return <Navigation />;
72
+ <% } %>
73
+ }
@@ -0,0 +1,31 @@
1
+ import { Ionicons, MaterialIcons } from '@expo/vector-icons';
2
+ import { createDrawerNavigator } from '@react-navigation/drawer';
3
+ import { HeaderButton } from 'components/HeaderButton';
4
+ import TabNavigator from './tab-navigator';
5
+ import Home from '../screens/home';
6
+
7
+
8
+ const Drawer = createDrawerNavigator({
9
+ screens: {
10
+ Home: {
11
+ screen: Home,
12
+ options: {
13
+ drawerIcon: ({ size, color }) => (
14
+ <Ionicons name="home-outline" size={size} color={color} />
15
+ ),
16
+ }
17
+ },
18
+ Tabs: {
19
+ screen: TabNavigator,
20
+ options: ({ navigation })=> ({
21
+ headerRight: () => <HeaderButton onPress={() => navigation.navigate('Modal')} />,
22
+ drawerIcon: ({ size, color }) => (
23
+ <MaterialIcons name="border-bottom" size={size} color={color} />
24
+ ),
25
+ })
26
+ },
27
+ }
28
+ });
29
+
30
+ export default Drawer;
31
+
@@ -0,0 +1,108 @@
1
+ <% if (props.navigationPackage?.options.type === 'stack') { %>
2
+ import { createStaticNavigation, StaticParamList } from '@react-navigation/native';
3
+ import { createStackNavigator } from '@react-navigation/stack';
4
+ import Overview from "../screens/overview";
5
+ import Details from "../screens/details";
6
+ import { BackButton } from '../components/BackButton';
7
+
8
+ const Stack = createStackNavigator({
9
+ screens: {
10
+ Overview: {
11
+ screen: Overview,
12
+ },
13
+ Details: {
14
+ screen: Details,
15
+ options: ({ navigation }) => ({
16
+ headerLeft: () => <BackButton onPress={navigation.goBack} />,
17
+ })
18
+ },
19
+ }
20
+ });
21
+
22
+ type RootNavigatorParamList = StaticParamList<typeof Stack>;
23
+
24
+ declare global {
25
+ namespace ReactNavigation {
26
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
27
+ interface RootParamList extends RootNavigatorParamList {}
28
+ }
29
+ }
30
+
31
+ const Navigation = createStaticNavigation(Stack);
32
+ export default Navigation;
33
+
34
+ <% } else if (props.navigationPackage?.options.type === 'tabs') { %>
35
+ import { createStaticNavigation, StaticParamList } from '@react-navigation/native';
36
+ import { createStackNavigator } from "@react-navigation/stack";
37
+ import Modal from "../screens/modal";
38
+ import TabNavigator from "./tab-navigator";
39
+
40
+
41
+ const Stack = createStackNavigator({
42
+ screens: {
43
+ TabNavigator: {
44
+ screen: TabNavigator,
45
+ options: {
46
+ headerShown: false,
47
+ },
48
+ },
49
+ Modal: {
50
+ screen: Modal,
51
+ options: {
52
+ presentation: "modal",
53
+ headerLeft: () => null,
54
+ },
55
+ },
56
+ }
57
+ });
58
+
59
+ type RootNavigatorParamList = StaticParamList<typeof Stack>;
60
+
61
+ declare global {
62
+ namespace ReactNavigation {
63
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
64
+ interface RootParamList extends RootNavigatorParamList {}
65
+ }
66
+ }
67
+
68
+ const Navigation = createStaticNavigation(Stack);
69
+ export default Navigation;
70
+
71
+ <% } else if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
72
+ import { createStaticNavigation, StaticParamList } from '@react-navigation/native';
73
+ import { createStackNavigator } from '@react-navigation/stack';
74
+ import Modal from "../screens/modal";
75
+ import DrawerNavigator from "./drawer-navigator";
76
+
77
+
78
+ const Stack = createStackNavigator({
79
+ screens: {
80
+ DrawerNavigator: {
81
+ screen: DrawerNavigator,
82
+ options: {
83
+ headerShown: false,
84
+ },
85
+ },
86
+ Modal: {
87
+ screen: Modal,
88
+ options: {
89
+ presentation: "modal",
90
+ headerLeft: () => null,
91
+ },
92
+ },
93
+ }
94
+ });
95
+
96
+ type RootNavigatorParamList = StaticParamList<typeof Stack>;
97
+
98
+ declare global {
99
+ namespace ReactNavigation {
100
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
101
+ interface RootParamList extends RootNavigatorParamList {}
102
+ }
103
+ }
104
+
105
+ const Navigation = createStaticNavigation(Stack);
106
+ export default Navigation;
107
+
108
+ <% } %>