create-expo-stack 2.6.5 → 2.7.0-next.2960d96

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 (43) hide show
  1. package/README.md +23 -9
  2. package/build/templates/base/App.tsx.ejs +3 -0
  3. package/build/templates/base/babel.config.js.ejs +1 -1
  4. package/build/templates/base/package.json.ejs +40 -3
  5. package/build/templates/base/prettier.config.js.ejs +1 -1
  6. package/build/templates/base/tsconfig.json.ejs +10 -6
  7. package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +4 -1
  8. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +4 -1
  9. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +4 -1
  10. package/build/templates/packages/nativewindui/app/+not-found.tsx.ejs +18 -0
  11. package/build/templates/packages/nativewindui/app/_layout.tsx.ejs +85 -0
  12. package/build/templates/packages/nativewindui/app/index.tsx.ejs +652 -0
  13. package/build/templates/packages/nativewindui/app/modal.tsx.ejs +32 -0
  14. package/build/templates/packages/nativewindui/components/nativewind-ui/ActivityIndicator.tsx.ejs +10 -0
  15. package/build/templates/packages/nativewindui/components/nativewind-ui/Avatar.tsx.ejs +139 -0
  16. package/build/templates/packages/nativewindui/components/nativewind-ui/DatePicker.android.tsx.ejs +66 -0
  17. package/build/templates/packages/nativewindui/components/nativewind-ui/DatePicker.tsx.ejs +10 -0
  18. package/build/templates/packages/nativewindui/components/nativewind-ui/Picker.tsx.ejs +39 -0
  19. package/build/templates/packages/nativewindui/components/nativewind-ui/ProgressIndicator.tsx.ejs +95 -0
  20. package/build/templates/packages/nativewindui/components/nativewind-ui/SegmentedControl.tsx.ejs +22 -0
  21. package/build/templates/packages/nativewindui/components/nativewind-ui/Sheet.tsx.ejs +59 -0
  22. package/build/templates/packages/nativewindui/components/nativewind-ui/Slider.tsx.ejs +28 -0
  23. package/build/templates/packages/nativewindui/components/nativewind-ui/Text.tsx.ejs +55 -0
  24. package/build/templates/packages/nativewindui/components/nativewind-ui/ThemeToggle.tsx.ejs +39 -0
  25. package/build/templates/packages/nativewindui/components/nativewind-ui/Toggle.tsx.ejs +17 -0
  26. package/build/templates/packages/nativewindui/expo-env.d.ts.ejs +3 -0
  27. package/build/templates/packages/nativewindui/global.css.ejs +91 -0
  28. package/build/templates/packages/nativewindui/lib/cn.ts.ejs +6 -0
  29. package/build/templates/packages/nativewindui/lib/useColorScheme.tsx.ejs +14 -0
  30. package/build/templates/packages/nativewindui/lib/useHeaderSearchBar.tsx.ejs +31 -0
  31. package/build/templates/packages/nativewindui/metro.config.js.ejs +10 -0
  32. package/build/templates/packages/nativewindui/nativewind-env.d.ts.ejs +1 -0
  33. package/build/templates/packages/nativewindui/tailwind.config.js.ejs +66 -0
  34. package/build/templates/packages/nativewindui/theme/colors.ts.ejs +71 -0
  35. package/build/templates/packages/nativewindui/theme/index.ts.ejs +29 -0
  36. package/build/templates/packages/react-navigation/App.tsx.ejs +4 -1
  37. package/build/types/types.d.ts +4 -2
  38. package/build/types.js +2 -1
  39. package/build/utilities/configureProjectFiles.js +265 -197
  40. package/build/utilities/generateProjectFiles.js +18 -13
  41. package/build/utilities/printOutput.js +5 -5
  42. package/build/utilities/runCLI.js +99 -22
  43. package/package.json +67 -67
@@ -0,0 +1,31 @@
1
+ import { COLORS } from '~/theme/colors';
2
+ import { useNavigation } from 'expo-router';
3
+ import * as React from 'react';
4
+ import { SearchBarProps } from 'react-native-screens';
5
+ import { useColorScheme } from './useColorScheme';
6
+
7
+ export function useHeaderSearchBar(props: SearchBarProps = {}) {
8
+ const { colorScheme, colors } = useColorScheme();
9
+ const navigation = useNavigation();
10
+ const [search, setSearch] = React.useState('');
11
+
12
+ React.useLayoutEffect(() => {
13
+ navigation.setOptions({
14
+ headerSearchBarOptions: {
15
+ placeholder: 'Search...',
16
+ barTintColor: colorScheme === 'dark' ? COLORS.black : COLORS.white,
17
+ textColor: colors.foreground,
18
+ tintColor: colors.primary,
19
+ headerIconColor: colors.foreground,
20
+ hintTextColor: colors.grey,
21
+ hideWhenScrolling: true,
22
+ onChangeText(ev) {
23
+ setSearch(ev.nativeEvent.text);
24
+ },
25
+ ...props,
26
+ } satisfies SearchBarProps,
27
+ });
28
+ }, [navigation, colorScheme]);
29
+
30
+ return search;
31
+ }
@@ -0,0 +1,10 @@
1
+ const { getDefaultConfig } = require('expo/metro-config');
2
+ const { withNativeWind } = require('nativewind/metro');
3
+
4
+ // eslint-disable-next-line no-undef
5
+ const config = getDefaultConfig(__dirname);
6
+
7
+ module.exports = withNativeWind(config, {
8
+ input: './global.css',
9
+ inlineRem: 16,
10
+ });
@@ -0,0 +1 @@
1
+ /// <reference types="nativewind/types" />
@@ -0,0 +1,66 @@
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
+ content: ['./app/**/*.{js,jsx,ts,tsx}', './components/**/*.{js,jsx,ts,tsx}'],
7
+ presets: [require('nativewind/preset')],
8
+ theme: {
9
+ extend: {
10
+ colors: {
11
+ border: withOpacity('border'),
12
+ input: withOpacity('input'),
13
+ ring: withOpacity('ring'),
14
+ background: withOpacity('background'),
15
+ foreground: withOpacity('foreground'),
16
+ primary: {
17
+ DEFAULT: withOpacity('primary'),
18
+ foreground: withOpacity('primary-foreground'),
19
+ },
20
+ secondary: {
21
+ DEFAULT: withOpacity('secondary'),
22
+ foreground: withOpacity('secondary-foreground'),
23
+ },
24
+ destructive: {
25
+ DEFAULT: withOpacity('destructive'),
26
+ foreground: withOpacity('destructive-foreground'),
27
+ },
28
+ muted: {
29
+ DEFAULT: withOpacity('muted'),
30
+ foreground: withOpacity('muted-foreground'),
31
+ },
32
+ accent: {
33
+ DEFAULT: withOpacity('accent'),
34
+ foreground: withOpacity('accent-foreground'),
35
+ },
36
+ popover: {
37
+ DEFAULT: withOpacity('popover'),
38
+ foreground: withOpacity('popover-foreground'),
39
+ },
40
+ card: {
41
+ DEFAULT: withOpacity('card'),
42
+ foreground: withOpacity('card-foreground'),
43
+ },
44
+ },
45
+ borderWidth: {
46
+ hairline: hairlineWidth(),
47
+ },
48
+ },
49
+ },
50
+ plugins: [],
51
+ };
52
+
53
+ function withOpacity(variableName) {
54
+ return ({ opacityValue }) => {
55
+ if (opacityValue !== undefined) {
56
+ return platformSelect({
57
+ ios: `rgb(var(--${variableName}) / ${opacityValue})`,
58
+ android: `rgb(var(--android-${variableName}) / ${opacityValue})`,
59
+ });
60
+ }
61
+ return platformSelect({
62
+ ios: `rgb(var(--${variableName}))`,
63
+ android: `rgb(var(--android-${variableName}))`,
64
+ });
65
+ };
66
+ }
@@ -0,0 +1,71 @@
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
+ destructive: 'rgb(255, 56, 43)',
18
+ primary: 'rgb(0, 123, 254)',
19
+ },
20
+ dark: {
21
+ grey6: 'rgb(21, 21, 24)',
22
+ grey5: 'rgb(40, 40, 42)',
23
+ grey4: 'rgb(55, 55, 57)',
24
+ grey3: 'rgb(70, 70, 73)',
25
+ grey2: 'rgb(99, 99, 102)',
26
+ grey: 'rgb(142, 142, 147)',
27
+ background: 'rgb(0, 0, 0)',
28
+ foreground: 'rgb(255, 255, 255)',
29
+ root: 'rgb(0, 0, 0)',
30
+ card: 'rgb(28, 28, 30)',
31
+ destructive: 'rgb(254, 67, 54)',
32
+ primary: 'rgb(3, 133, 255)',
33
+ },
34
+ } as const;
35
+
36
+ const ANDROID_COLORS = {
37
+ white: 'rgb(255, 255, 255)',
38
+ black: 'rgb(0, 0, 0)',
39
+ light: {
40
+ grey6: 'rgb(249, 249, 255)',
41
+ grey5: 'rgb(215, 217, 228)',
42
+ grey4: 'rgb(193, 198, 215)',
43
+ grey3: 'rgb(113, 119, 134)',
44
+ grey2: 'rgb(65, 71, 84)',
45
+ grey: 'rgb(24, 28, 35)',
46
+ background: 'rgb(249, 249, 255)',
47
+ foreground: 'rgb(0, 0, 0)',
48
+ root: 'rgb(255, 255, 255)',
49
+ card: 'rgb(255, 255, 255)',
50
+ destructive: 'rgb(186, 26, 26)',
51
+ primary: 'rgb(0, 112, 233)',
52
+ },
53
+ dark: {
54
+ grey6: 'rgb(16, 19, 27)',
55
+ grey5: 'rgb(39, 42, 50)',
56
+ grey4: 'rgb(49, 53, 61)',
57
+ grey3: 'rgb(54, 57, 66)',
58
+ grey2: 'rgb(139, 144, 160)',
59
+ grey: 'rgb(193, 198, 215)',
60
+ background: 'rgb(0, 0, 0)',
61
+ foreground: 'rgb(255, 255, 255)',
62
+ root: 'rgb(0, 0, 0)',
63
+ card: 'rgb(16, 19, 27)',
64
+ destructive: 'rgb(147, 0, 10)',
65
+ primary: 'rgb(3, 133, 255)',
66
+ },
67
+ } as const;
68
+
69
+ const COLORS = Platform.OS === 'ios' ? IOS_SYSTEM_COLORS : ANDROID_COLORS;
70
+
71
+ export { COLORS };
@@ -0,0 +1,29 @@
1
+ import { Theme } from '@react-navigation/native';
2
+ import { COLORS } from './colors';
3
+
4
+ const NAV_THEME: { light: Theme; dark: Theme } = {
5
+ light: {
6
+ dark: false,
7
+ colors: {
8
+ background: COLORS.light.background,
9
+ border: COLORS.light.grey5,
10
+ card: COLORS.light.card,
11
+ notification: COLORS.light.destructive,
12
+ primary: COLORS.light.primary,
13
+ text: COLORS.black,
14
+ },
15
+ },
16
+ dark: {
17
+ dark: true,
18
+ colors: {
19
+ background: COLORS.dark.background,
20
+ border: COLORS.dark.grey5,
21
+ card: COLORS.dark.grey6,
22
+ notification: COLORS.dark.destructive,
23
+ primary: COLORS.dark.primary,
24
+ text: COLORS.white,
25
+ },
26
+ },
27
+ };
28
+
29
+ export { NAV_THEME };
@@ -1,5 +1,8 @@
1
1
  <% if (props.stylingPackage?.name === "nativewind") { %>
2
- import './global.css';
2
+ import './global.css';
3
+ <% } else if (props.stylingPackage?.name === "nativewinui") { %>
4
+ import './global.css';
5
+ import 'expo-dev-client';
3
6
  <% } %>
4
7
  <% if (props.stylingPackage?.name === "unistyles") { %>
5
8
  import './unistyles';
@@ -5,17 +5,19 @@ export interface CliFlags {
5
5
  importAlias: string | boolean;
6
6
  packageManager: PackageManager;
7
7
  }
8
- export declare const availablePackages: readonly ["@react-navigation/drawer", "expo-router", "expoRouter", "firebase", "nativewind", "react-navigation", "reactNavigation", "react-native-gesture-handler", "react-native-reanimated", "reactnavigation", "stylesheet", "supabase", "tamagui", "restyle", "unistyles", "i18next"];
8
+ export declare const availablePackages: readonly ["@react-navigation/drawer", "expo-router", "expoRouter", "firebase", "nativewind", "nativewindui", "react-navigation", "reactNavigation", "react-native-gesture-handler", "react-native-reanimated", "reactnavigation", "stylesheet", "supabase", "tamagui", "restyle", "unistyles", "i18next"];
9
9
  export type AuthenticationSelect = 'supabase' | 'firebase' | undefined;
10
10
  export type NavigationSelect = 'react-navigation' | 'expo-router' | undefined;
11
11
  export type NavigationTypes = 'stack' | 'tabs' | 'drawer + tabs' | undefined;
12
- export type StylingSelect = 'nativewind' | 'restyle' | 'stylesheet' | 'tamagui' | 'unistyles';
12
+ export type StylingSelect = 'nativewind' | 'restyle' | 'stylesheet' | 'tamagui' | 'unistyles' | 'nativewindui';
13
13
  export type PackageManager = 'yarn' | 'npm' | 'pnpm' | 'bun';
14
14
  export type Internalization = 'i18next';
15
+ export type SelectedComponents = 'action-sheet' | 'actionable-text' | 'activity-indicator' | 'activity-view' | 'alert' | 'avatar' | 'bottom-sheet' | 'context-menu' | 'date-picker' | 'dropdown-menu' | 'picker' | 'progress-indicator' | 'ratings-indicator' | 'segmented-control' | 'slider' | 'text' | 'toggle';
15
16
  export type AvailablePackages = {
16
17
  name: (typeof availablePackages)[number];
17
18
  type: 'navigation' | 'styling' | 'authentication' | 'internationalization';
18
19
  options?: {
20
+ selectedComponents?: SelectedComponents[];
19
21
  type?: NavigationTypes;
20
22
  };
21
23
  };
package/build/types.js CHANGED
@@ -7,6 +7,7 @@ exports.availablePackages = [
7
7
  'expoRouter',
8
8
  'firebase',
9
9
  'nativewind',
10
+ 'nativewindui',
10
11
  'react-navigation',
11
12
  'reactNavigation',
12
13
  'react-native-gesture-handler',
@@ -19,4 +20,4 @@ exports.availablePackages = [
19
20
  'unistyles',
20
21
  'i18next'
21
22
  ];
22
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBU2EsUUFBQSxpQkFBaUIsR0FBRztJQUMvQiwwQkFBMEI7SUFDMUIsYUFBYTtJQUNiLFlBQVk7SUFDWixVQUFVO0lBQ1YsWUFBWTtJQUNaLGtCQUFrQjtJQUNsQixpQkFBaUI7SUFDakIsOEJBQThCO0lBQzlCLHlCQUF5QjtJQUN6QixpQkFBaUI7SUFDakIsWUFBWTtJQUNaLFVBQVU7SUFDVixTQUFTO0lBQ1QsU0FBUztJQUNULFdBQVc7SUFDWCxTQUFTO0NBQ0QsQ0FBQyJ9
23
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBU2EsUUFBQSxpQkFBaUIsR0FBRztJQUMvQiwwQkFBMEI7SUFDMUIsYUFBYTtJQUNiLFlBQVk7SUFDWixVQUFVO0lBQ1YsWUFBWTtJQUNaLGNBQWM7SUFDZCxrQkFBa0I7SUFDbEIsaUJBQWlCO0lBQ2pCLDhCQUE4QjtJQUM5Qix5QkFBeUI7SUFDekIsaUJBQWlCO0lBQ2pCLFlBQVk7SUFDWixVQUFVO0lBQ1YsU0FBUztJQUNULFNBQVM7SUFDVCxXQUFXO0lBQ1gsU0FBUztDQUNELENBQUMifQ==