diff --git a/example/.eslintrc b/example/.eslintrc index 32373b5..948d834 100644 --- a/example/.eslintrc +++ b/example/.eslintrc @@ -2,7 +2,7 @@ "extends": "../.eslintrc", "settings": { - "import/core-modules": [ "react-native-paper", "react-native-paper/types" ] + "import/core-modules": [ "react-native-paper" ] }, "rules": { diff --git a/example/App.js b/example/App.js index 3bd01ee..7f4eaf7 100644 --- a/example/App.js +++ b/example/App.js @@ -7,12 +7,12 @@ import { Provider as PaperProvider, DarkTheme, DefaultTheme, + type Theme, } from 'react-native-paper'; import createReactContext from 'create-react-context'; import { createDrawerNavigator } from 'react-navigation'; import RootNavigator from './src/RootNavigator'; import DrawerItems from './DrawerItems'; -import type { Theme } from 'react-native-paper/types'; type State = { theme: Theme, diff --git a/example/DrawerItems.js b/example/DrawerItems.js index 97cf679..fb7b9d4 100644 --- a/example/DrawerItems.js +++ b/example/DrawerItems.js @@ -9,8 +9,8 @@ import { TouchableRipple, Text, Colors, + type Theme, } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, diff --git a/example/babel.config.js b/example/babel.config.js index b02a4af..007c335 100644 --- a/example/babel.config.js +++ b/example/babel.config.js @@ -6,7 +6,6 @@ module.exports = { { alias: { 'react-native-paper': '../src/index', - 'react-native-paper/types': '../types', 'react-native-vector-icons': '@expo/vector-icons', }, }, diff --git a/example/src/AppbarExample.js b/example/src/AppbarExample.js index 47d7552..0b5dcec 100644 --- a/example/src/AppbarExample.js +++ b/example/src/AppbarExample.js @@ -9,8 +9,8 @@ import { Switch, Paragraph, withTheme, + type Theme, } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; type Props = { navigation: any, diff --git a/example/src/BannerExample.js b/example/src/BannerExample.js index 5bf868a..dd25c2d 100644 --- a/example/src/BannerExample.js +++ b/example/src/BannerExample.js @@ -8,9 +8,9 @@ import { ScrollView, SafeAreaView, Dimensions, + type Theme, } from 'react-native'; import { Banner, withTheme, FAB } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, diff --git a/example/src/ButtonExample.js b/example/src/ButtonExample.js index 699c2bc..3e4052a 100644 --- a/example/src/ButtonExample.js +++ b/example/src/ButtonExample.js @@ -2,8 +2,7 @@ import * as React from 'react'; import { View, ScrollView, StyleSheet, Image } from 'react-native'; -import { Button, List, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { Button, List, withTheme, type Theme } from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/CardExample.js b/example/src/CardExample.js index d857814..9ca1f81 100644 --- a/example/src/CardExample.js +++ b/example/src/CardExample.js @@ -9,8 +9,8 @@ import { Card, Button, withTheme, + type Theme, } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, diff --git a/example/src/CheckboxExample.js b/example/src/CheckboxExample.js index 312d4bd..846c7c4 100644 --- a/example/src/CheckboxExample.js +++ b/example/src/CheckboxExample.js @@ -8,8 +8,8 @@ import { Colors, TouchableRipple, withTheme, + type Theme, } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, diff --git a/example/src/ChipExample.js b/example/src/ChipExample.js index b1be708..a4bf3bd 100644 --- a/example/src/ChipExample.js +++ b/example/src/ChipExample.js @@ -2,8 +2,7 @@ import * as React from 'react'; import { View, ScrollView, StyleSheet, Image } from 'react-native'; -import { Chip, List, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { Chip, List, withTheme, type Theme } from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/DialogExample.js b/example/src/DialogExample.js index a8cc7cc..c5b91ba 100644 --- a/example/src/DialogExample.js +++ b/example/src/DialogExample.js @@ -2,7 +2,7 @@ import * as React from 'react'; import { View, StyleSheet } from 'react-native'; -import { Colors, Button, withTheme } from 'react-native-paper'; +import { Colors, Button, withTheme, type Theme } from 'react-native-paper'; import { DialogWithCustomColors, DialogWithLoadingIndicator, @@ -10,7 +10,6 @@ import { DialogWithRadioBtns, UndismissableDialog, } from './Dialogs'; -import type { Theme } from 'react-native-paper/types'; type State = { visible1: boolean, diff --git a/example/src/DividerExample.js b/example/src/DividerExample.js index 3430902..9d79e24 100644 --- a/example/src/DividerExample.js +++ b/example/src/DividerExample.js @@ -2,8 +2,7 @@ import * as React from 'react'; import { FlatList } from 'react-native'; -import { Divider, List, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { Divider, List, withTheme, type Theme } from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/ExampleList.js b/example/src/ExampleList.js index e292311..b1c101c 100644 --- a/example/src/ExampleList.js +++ b/example/src/ExampleList.js @@ -2,7 +2,7 @@ import * as React from 'react'; import { FlatList } from 'react-native'; -import { List, Divider, withTheme } from 'react-native-paper'; +import { List, Divider, withTheme, type Theme } from 'react-native-paper'; import AppbarExample from './AppbarExample'; import BannerExample from './BannerExample'; import BottomNavigationExample from './BottomNavigationExample'; @@ -26,7 +26,6 @@ import SwitchExample from './SwitchExample'; import TextExample from './TextExample'; import TextInputExample from './TextInputExample'; import TouchableRippleExample from './TouchableRippleExample'; -import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, diff --git a/example/src/FABExample.js b/example/src/FABExample.js index e3950a9..eccb195 100644 --- a/example/src/FABExample.js +++ b/example/src/FABExample.js @@ -2,8 +2,7 @@ import * as React from 'react'; import { View, StyleSheet } from 'react-native'; -import { Colors, FAB, Portal, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { Colors, FAB, Portal, withTheme, type Theme } from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/IconButtonExample.js b/example/src/IconButtonExample.js index 1ff5346..559e416 100644 --- a/example/src/IconButtonExample.js +++ b/example/src/IconButtonExample.js @@ -2,8 +2,7 @@ import * as React from 'react'; import { View, StyleSheet } from 'react-native'; -import { IconButton, Colors, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { IconButton, Colors, withTheme, type Theme } from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/ListAccordionExample.js b/example/src/ListAccordionExample.js index 73e8a01..3268cdf 100644 --- a/example/src/ListAccordionExample.js +++ b/example/src/ListAccordionExample.js @@ -2,8 +2,7 @@ import * as React from 'react'; import { ScrollView, StyleSheet } from 'react-native'; -import { List, Divider, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { List, Divider, withTheme, type Theme } from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/ListSectionExample.js b/example/src/ListSectionExample.js index 1239a21..cb66a78 100644 --- a/example/src/ListSectionExample.js +++ b/example/src/ListSectionExample.js @@ -2,8 +2,7 @@ import * as React from 'react'; import { ScrollView, StyleSheet, Image } from 'react-native'; -import { List, Divider, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { List, Divider, withTheme, type Theme } from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/ProgressBarExample.js b/example/src/ProgressBarExample.js index 5fd12e8..860c7eb 100644 --- a/example/src/ProgressBarExample.js +++ b/example/src/ProgressBarExample.js @@ -2,8 +2,13 @@ import * as React from 'react'; import { View, StyleSheet } from 'react-native'; -import { ProgressBar, Paragraph, Colors, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { + ProgressBar, + Paragraph, + Colors, + withTheme, + type Theme, +} from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/RadioButtonExample.js b/example/src/RadioButtonExample.js index b8e79bd..f394225 100644 --- a/example/src/RadioButtonExample.js +++ b/example/src/RadioButtonExample.js @@ -8,8 +8,8 @@ import { Colors, TouchableRipple, withTheme, + type Theme, } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, diff --git a/example/src/RadioButtonGroupExample.js b/example/src/RadioButtonGroupExample.js index 52f9c26..e87877d 100644 --- a/example/src/RadioButtonGroupExample.js +++ b/example/src/RadioButtonGroupExample.js @@ -2,8 +2,13 @@ import * as React from 'react'; import { View, StyleSheet } from 'react-native'; -import { Colors, withTheme, RadioButton, Paragraph } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { + Colors, + withTheme, + RadioButton, + Paragraph, + type Theme, +} from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/SearchbarExample.js b/example/src/SearchbarExample.js index 9332ae4..3a8dfce 100644 --- a/example/src/SearchbarExample.js +++ b/example/src/SearchbarExample.js @@ -2,8 +2,13 @@ import * as React from 'react'; import { StyleSheet, View } from 'react-native'; -import { Colors, Caption, Searchbar, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { + Colors, + Caption, + Searchbar, + withTheme, + type Theme, +} from 'react-native-paper'; type Props = { navigation: any, diff --git a/example/src/SnackbarExample.js b/example/src/SnackbarExample.js index 6495762..3e89d81 100644 --- a/example/src/SnackbarExample.js +++ b/example/src/SnackbarExample.js @@ -2,8 +2,13 @@ import * as React from 'react'; import { StyleSheet, View } from 'react-native'; -import { Snackbar, Colors, withTheme, Button } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { + Snackbar, + Colors, + withTheme, + Button, + type Theme, +} from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/SurfaceExample.js b/example/src/SurfaceExample.js index 072da39..65d1cf8 100644 --- a/example/src/SurfaceExample.js +++ b/example/src/SurfaceExample.js @@ -2,8 +2,7 @@ import * as React from 'react'; import { ScrollView, StyleSheet } from 'react-native'; -import { Text, Surface, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { Text, Surface, withTheme, type Theme } from 'react-native-paper'; type Props = { theme: Theme, diff --git a/example/src/SwitchExample.js b/example/src/SwitchExample.js index 64aab0e..40fa4f8 100644 --- a/example/src/SwitchExample.js +++ b/example/src/SwitchExample.js @@ -8,8 +8,8 @@ import { Colors, TouchableRipple, withTheme, + type Theme, } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, diff --git a/example/src/TextExample.js b/example/src/TextExample.js index 0e1dbd3..e33e20c 100644 --- a/example/src/TextExample.js +++ b/example/src/TextExample.js @@ -9,8 +9,8 @@ import { Subheading, Title, withTheme, + type Theme, } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, diff --git a/example/src/TextInputExample.js b/example/src/TextInputExample.js index e463e97..084addf 100644 --- a/example/src/TextInputExample.js +++ b/example/src/TextInputExample.js @@ -6,9 +6,9 @@ import { View, ScrollView, KeyboardAvoidingView, + type Theme, } from 'react-native'; import { TextInput, HelperText, withTheme } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, diff --git a/example/src/TouchableRippleExample.js b/example/src/TouchableRippleExample.js index c2cb609..79068c2 100644 --- a/example/src/TouchableRippleExample.js +++ b/example/src/TouchableRippleExample.js @@ -1,8 +1,12 @@ /* @flow */ import * as React from 'react'; import { View, StyleSheet } from 'react-native'; -import { TouchableRipple, withTheme, Paragraph } from 'react-native-paper'; -import type { Theme } from 'react-native-paper/types'; +import { + TouchableRipple, + withTheme, + Paragraph, + type Theme, +} from 'react-native-paper'; type Props = { theme: Theme, diff --git a/src/index.js b/src/index.js index bb7a3a3..785a43c 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,9 @@ /* @flow */ import * as Colors from './styles/colors'; +import type { Theme as _Theme } from './types'; + +export type Theme = _Theme; export { Colors }; diff --git a/types.js b/types.js index 860279e..94e0574 100644 --- a/types.js +++ b/types.js @@ -1,4 +1,9 @@ -/* @flow */ +/** + * This file is only for backwards compatibility + * Import the Theme type from the main entry point instead + * + * @flow + */ import type { Theme as _Theme } from './src/types';