Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/src/components/BannerExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
Avatar,
Button,
FAB,
MD3DarkTheme as DarkTheme,
MD3LightTheme as DefaultTheme,
DarkTheme,
LightTheme,
ProgressBar,
PaperProvider,
RadioButton,
Expand Down Expand Up @@ -167,7 +167,7 @@ const Shimmer = () => {
const ThemedBannerExample = () => {
const isDarkTheme = useColorMode().colorMode === 'dark';
return (
<PaperProvider theme={isDarkTheme ? DarkTheme : DefaultTheme}>
<PaperProvider theme={isDarkTheme ? DarkTheme : LightTheme}>
<BannerExample />
</PaperProvider>
);
Expand Down
6 changes: 3 additions & 3 deletions docs/src/components/GetStartedButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import Link from '@docusaurus/Link';
import { useColorMode } from '@docusaurus/theme-common';
import {
Button,
MD3DarkTheme as DarkTheme,
MD3LightTheme as DefaultTheme,
DarkTheme,
LightTheme,
PaperProvider,
} from 'react-native-paper';

Expand Down Expand Up @@ -95,7 +95,7 @@ const Shimmer = () => {
const ThemedGetStarted = () => {
const isDarkTheme = useColorMode().colorMode === 'dark';
return (
<PaperProvider theme={isDarkTheme ? DarkTheme : DefaultTheme}>
<PaperProvider theme={isDarkTheme ? DarkTheme : LightTheme}>
<GetStartedButton />
</PaperProvider>
);
Expand Down
19 changes: 7 additions & 12 deletions example/src/DrawerItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Button,
Dialog,
Drawer,
MD3Colors,
Colors,
Switch,
Text,
TouchableRipple,
Expand Down Expand Up @@ -136,8 +136,8 @@ function DrawerItems() {

const coloredLabelTheme = {
colors: {
secondaryContainer: MD3Colors.tertiary80,
onSecondaryContainer: MD3Colors.tertiary20,
secondaryContainer: Colors.tertiary80,
onSecondaryContainer: Colors.tertiary20,
},
};

Expand Down Expand Up @@ -184,7 +184,7 @@ function DrawerItems() {
{deviceColorsSupported ? (
<TouchableRipple onPress={toggleShouldUseDeviceColors}>
<View style={styles.preference}>
<Text variant="labelLarge">Use device colors *</Text>
<Text variant="labelLarge">Use device colors</Text>
<View pointerEvents="none">
<Switch value={shouldUseDeviceColors} />
</View>
Expand Down Expand Up @@ -213,7 +213,7 @@ function DrawerItems() {

<TouchableRipple onPress={toggleCollapsed}>
<View style={styles.preference}>
<Text variant="labelLarge">Collapsed drawer *</Text>
<Text variant="labelLarge">Collapsed drawer</Text>
<View pointerEvents="none">
<Switch value={collapsed} />
</View>
Expand All @@ -222,7 +222,7 @@ function DrawerItems() {

<TouchableRipple onPress={toggleCustomFont}>
<View style={styles.preference}>
<Text variant="labelLarge">Custom font *</Text>
<Text variant="labelLarge">Custom font</Text>
<View pointerEvents="none">
<Switch value={customFontLoaded} />
</View>
Expand All @@ -232,19 +232,14 @@ function DrawerItems() {
<TouchableRipple onPress={toggleRippleEffect}>
<View style={styles.preference}>
<Text variant="labelLarge">
{isIOS ? 'Highlight' : 'Ripple'} effect *
{isIOS ? 'Highlight' : 'Ripple'} effect
</Text>
<View pointerEvents="none">
<Switch value={rippleEffectEnabled} />
</View>
</View>
</TouchableRipple>
</Drawer.Section>
{!collapsed && (
<Text variant="bodySmall" style={styles.annotation}>
* - available only for MD3
</Text>
)}
<Text variant="bodySmall" style={styles.annotation}>
React Native Paper Version{' '}
{require('react-native-paper/package.json').version}
Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/ActivityIndicatorExample.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { StyleSheet, View } from 'react-native';

import { ActivityIndicator, FAB, List, MD3Colors } from 'react-native-paper';
import { ActivityIndicator, FAB, List, Colors } from 'react-native-paper';

import ScreenWrapper from '../ScreenWrapper';

Expand Down Expand Up @@ -41,7 +41,7 @@ const ActivityIndicatorExample = () => {
<List.Section title="Custom color">
<ActivityIndicator
animating={animating}
color={MD3Colors.error20}
color={Colors.error20}
hidesWhenStopped={false}
/>
</List.Section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NativeScrollEvent, NativeSyntheticEvent } from 'react-native';
import { Animated, FlatList, Platform, StyleSheet, View } from 'react-native';

import Icon from '@expo/vector-icons/MaterialCommunityIcons';
import { Avatar, MD3Colors, Text, useTheme } from 'react-native-paper';
import { Avatar, Colors, Text, useTheme } from 'react-native-paper';

import CustomFAB from './CustomFAB';
import CustomFABControls, {
Expand Down Expand Up @@ -44,7 +44,7 @@ const AnimatedFABExample = () => {
<Avatar.Text
style={[styles.avatar, { backgroundColor: item.bgColor }]}
label={item.initials}
color={MD3Colors.primary100}
color={Colors.primary100}
size={40}
/>
<View style={styles.itemTextContentContainer}>
Expand Down Expand Up @@ -86,9 +86,7 @@ const AnimatedFABExample = () => {

<Icon
name={item.favorite ? 'star' : 'star-outline'}
color={
item.favorite ? MD3Colors.error70 : MD3Colors.neutralVariant70
}
color={item.favorite ? Colors.error70 : Colors.neutralVariant70}
size={20}
onPress={() => setVisible(!visible)}
style={styles.icon}
Expand Down
10 changes: 5 additions & 5 deletions example/src/Examples/AvatarExample.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { StyleSheet, View } from 'react-native';

import { Avatar, List, MD3Colors } from 'react-native-paper';
import { Avatar, List, Colors } from 'react-native-paper';

import ScreenWrapper from '../ScreenWrapper';

Expand All @@ -14,11 +14,11 @@ const AvatarExample = () => {
style={[
styles.avatar,
{
backgroundColor: MD3Colors.error70,
backgroundColor: Colors.error70,
},
]}
label="XD"
color={MD3Colors.primary0}
color={Colors.primary0}
/>
<Avatar.Text style={styles.avatar} label="XD" />
<Avatar.Text style={styles.avatar} label="XD" size={80} />
Expand All @@ -30,11 +30,11 @@ const AvatarExample = () => {
style={[
styles.avatar,
{
backgroundColor: MD3Colors.error70,
backgroundColor: Colors.error70,
},
]}
icon="folder"
color={MD3Colors.primary0}
color={Colors.primary0}
/>
<Avatar.Icon style={styles.avatar} icon="folder" />
<Avatar.Icon style={styles.avatar} icon="folder" size={80} />
Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/BadgeExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Badge,
IconButton,
List,
MD3Colors,
Colors,
Text,
Switch,
} from 'react-native-paper';
Expand Down Expand Up @@ -41,7 +41,7 @@ const BadgeExample = () => {
style={[
styles.badge,
{
backgroundColor: MD3Colors.primary80,
backgroundColor: Colors.primary80,
},
]}
>
Expand Down
8 changes: 4 additions & 4 deletions example/src/Examples/BannerExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
View,
} from 'react-native';

import { Banner, FAB, MD3Colors, useTheme } from 'react-native-paper';
import { Banner, FAB, Colors, useTheme } from 'react-native-paper';

import ScreenWrapper from '../ScreenWrapper';

Expand All @@ -31,11 +31,11 @@ const BannerExample = () => {
const customTheme = {
...theme,
colors: {
onSurface: MD3Colors.tertiary100,
onSurface: Colors.tertiary100,
elevation: {
level1: MD3Colors.tertiary50,
level1: Colors.tertiary50,
},
primary: MD3Colors.tertiary10,
primary: Colors.tertiary10,
},
};

Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/CheckboxExample.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { StyleSheet, View } from 'react-native';

import { Checkbox, MD3Colors, Text, TouchableRipple } from 'react-native-paper';
import { Checkbox, Colors, Text, TouchableRipple } from 'react-native-paper';

import ScreenWrapper from '../ScreenWrapper';

Expand All @@ -26,7 +26,7 @@ const CheckboxExample = () => {
<Text>Custom</Text>
<View pointerEvents="none">
<Checkbox
color={MD3Colors.error70}
color={Colors.error70}
status={checkedCustom ? 'checked' : 'unchecked'}
/>
</View>
Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/ChipExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import * as React from 'react';
import { Image, StyleSheet, View } from 'react-native';

import color from 'color';
import { Chip, List, MD3Colors, Snackbar, Text } from 'react-native-paper';
import { Chip, List, Colors, Snackbar, Text } from 'react-native-paper';

import ScreenWrapper from '../ScreenWrapper';

const customColor = MD3Colors.error50;
const customColor = Colors.error50;

const ChipExample = () => {
const [snackbarProperties, setSnackbarProperties] = React.useState({
Expand Down
12 changes: 5 additions & 7 deletions example/src/Examples/Dialogs/DialogWithCustomColors.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { Button, Portal, Dialog, MD3Colors } from 'react-native-paper';
import { Button, Portal, Dialog, Colors } from 'react-native-paper';

import { TextComponent } from './DialogTextComponent';

Expand All @@ -16,20 +16,18 @@ const DialogWithCustomColors = ({
<Dialog
onDismiss={close}
style={{
backgroundColor: MD3Colors.primary10,
backgroundColor: Colors.primary10,
}}
visible={visible}
>
<Dialog.Title style={{ color: MD3Colors.primary95 }}>
Alert
</Dialog.Title>
<Dialog.Title style={{ color: Colors.primary95 }}>Alert</Dialog.Title>
<Dialog.Content>
<TextComponent style={{ color: MD3Colors.primary95 }}>
<TextComponent style={{ color: Colors.primary95 }}>
This is a dialog with custom colors
</TextComponent>
</Dialog.Content>
<Dialog.Actions>
<Button textColor={MD3Colors.primary95} onPress={close}>
<Button textColor={Colors.primary95} onPress={close}>
Ok
</Button>
</Dialog.Actions>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { Button, Portal, Dialog, MD3Colors } from 'react-native-paper';
import { Button, Portal, Dialog, Colors } from 'react-native-paper';

import { TextComponent } from './DialogTextComponent';

Expand All @@ -26,7 +26,7 @@ const DialogWithDismissableBackButton = ({
</TextComponent>
</Dialog.Content>
<Dialog.Actions>
<Button textColor={MD3Colors.tertiary50} disabled>
<Button textColor={Colors.tertiary50} disabled>
Disagree
</Button>
<Button onPress={close}>Agree</Button>
Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/Dialogs/DialogWithIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { StyleSheet } from 'react-native';

import { Button, Portal, Dialog, MD3Colors } from 'react-native-paper';
import { Button, Portal, Dialog, Colors } from 'react-native-paper';

import { TextComponent } from './DialogTextComponent';

Expand All @@ -24,7 +24,7 @@ const DialogWithIcon = ({
</TextComponent>
</Dialog.Content>
<Dialog.Actions>
<Button onPress={close} color={MD3Colors.error50}>
<Button onPress={close} color={Colors.error50}>
Disagree
</Button>
<Button onPress={close}>Agree</Button>
Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/Dialogs/DialogWithLoadingIndicator.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { ActivityIndicator, Platform, StyleSheet, View } from 'react-native';

import { Dialog, MD3Colors, Portal } from 'react-native-paper';
import { Dialog, Colors, Portal } from 'react-native-paper';

import { TextComponent } from './DialogTextComponent';

Expand All @@ -21,7 +21,7 @@ const DialogWithLoadingIndicator = ({
<Dialog.Content>
<View style={styles.flexing}>
<ActivityIndicator
color={MD3Colors.tertiary30}
color={Colors.tertiary30}
size={isIOS ? 'large' : 48}
style={styles.marginRight}
/>
Expand Down
4 changes: 2 additions & 2 deletions example/src/Examples/Dialogs/UndismissableDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { Button, Portal, Dialog, MD3Colors } from 'react-native-paper';
import { Button, Portal, Dialog, Colors } from 'react-native-paper';

import { TextComponent } from './DialogTextComponent';

Expand All @@ -18,7 +18,7 @@ const UndismissableDialog = ({
<TextComponent>This is an undismissable dialog!!</TextComponent>
</Dialog.Content>
<Dialog.Actions>
<Button textColor={MD3Colors.tertiary50} disabled>
<Button textColor={Colors.tertiary50} disabled>
Disagree
</Button>
<Button onPress={close}>Agree</Button>
Expand Down
Loading
Loading