Skip to content

Commit 936e8f7

Browse files
authored
refactor: rename md3 to default (#4734)
1 parent e44bc5a commit 936e8f7

File tree

90 files changed

+375
-510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+375
-510
lines changed

docs/src/components/BannerExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99
Avatar,
1010
Button,
1111
FAB,
12-
MD3DarkTheme as DarkTheme,
13-
MD3LightTheme as DefaultTheme,
12+
DarkTheme,
13+
LightTheme,
1414
ProgressBar,
1515
PaperProvider,
1616
RadioButton,
@@ -167,7 +167,7 @@ const Shimmer = () => {
167167
const ThemedBannerExample = () => {
168168
const isDarkTheme = useColorMode().colorMode === 'dark';
169169
return (
170-
<PaperProvider theme={isDarkTheme ? DarkTheme : DefaultTheme}>
170+
<PaperProvider theme={isDarkTheme ? DarkTheme : LightTheme}>
171171
<BannerExample />
172172
</PaperProvider>
173173
);

docs/src/components/GetStartedButtons.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import Link from '@docusaurus/Link';
99
import { useColorMode } from '@docusaurus/theme-common';
1010
import {
1111
Button,
12-
MD3DarkTheme as DarkTheme,
13-
MD3LightTheme as DefaultTheme,
12+
DarkTheme,
13+
LightTheme,
1414
PaperProvider,
1515
} from 'react-native-paper';
1616

@@ -95,7 +95,7 @@ const Shimmer = () => {
9595
const ThemedGetStarted = () => {
9696
const isDarkTheme = useColorMode().colorMode === 'dark';
9797
return (
98-
<PaperProvider theme={isDarkTheme ? DarkTheme : DefaultTheme}>
98+
<PaperProvider theme={isDarkTheme ? DarkTheme : LightTheme}>
9999
<GetStartedButton />
100100
</PaperProvider>
101101
);

example/src/DrawerItems.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Button,
1010
Dialog,
1111
Drawer,
12-
MD3Colors,
12+
Colors,
1313
Switch,
1414
Text,
1515
TouchableRipple,
@@ -136,8 +136,8 @@ function DrawerItems() {
136136

137137
const coloredLabelTheme = {
138138
colors: {
139-
secondaryContainer: MD3Colors.tertiary80,
140-
onSecondaryContainer: MD3Colors.tertiary20,
139+
secondaryContainer: Colors.tertiary80,
140+
onSecondaryContainer: Colors.tertiary20,
141141
},
142142
};
143143

@@ -184,7 +184,7 @@ function DrawerItems() {
184184
{deviceColorsSupported ? (
185185
<TouchableRipple onPress={toggleShouldUseDeviceColors}>
186186
<View style={styles.preference}>
187-
<Text variant="labelLarge">Use device colors *</Text>
187+
<Text variant="labelLarge">Use device colors</Text>
188188
<View pointerEvents="none">
189189
<Switch value={shouldUseDeviceColors} />
190190
</View>
@@ -213,7 +213,7 @@ function DrawerItems() {
213213

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

223223
<TouchableRipple onPress={toggleCustomFont}>
224224
<View style={styles.preference}>
225-
<Text variant="labelLarge">Custom font *</Text>
225+
<Text variant="labelLarge">Custom font</Text>
226226
<View pointerEvents="none">
227227
<Switch value={customFontLoaded} />
228228
</View>
@@ -232,19 +232,14 @@ function DrawerItems() {
232232
<TouchableRipple onPress={toggleRippleEffect}>
233233
<View style={styles.preference}>
234234
<Text variant="labelLarge">
235-
{isIOS ? 'Highlight' : 'Ripple'} effect *
235+
{isIOS ? 'Highlight' : 'Ripple'} effect
236236
</Text>
237237
<View pointerEvents="none">
238238
<Switch value={rippleEffectEnabled} />
239239
</View>
240240
</View>
241241
</TouchableRipple>
242242
</Drawer.Section>
243-
{!collapsed && (
244-
<Text variant="bodySmall" style={styles.annotation}>
245-
* - available only for MD3
246-
</Text>
247-
)}
248243
<Text variant="bodySmall" style={styles.annotation}>
249244
React Native Paper Version{' '}
250245
{require('react-native-paper/package.json').version}

example/src/Examples/ActivityIndicatorExample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { StyleSheet, View } from 'react-native';
33

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

66
import ScreenWrapper from '../ScreenWrapper';
77

@@ -41,7 +41,7 @@ const ActivityIndicatorExample = () => {
4141
<List.Section title="Custom color">
4242
<ActivityIndicator
4343
animating={animating}
44-
color={MD3Colors.error20}
44+
color={Colors.error20}
4545
hidesWhenStopped={false}
4646
/>
4747
</List.Section>

example/src/Examples/AnimatedFABExample/AnimatedFABExample.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { NativeScrollEvent, NativeSyntheticEvent } from 'react-native';
33
import { Animated, FlatList, Platform, StyleSheet, View } from 'react-native';
44

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

88
import CustomFAB from './CustomFAB';
99
import CustomFABControls, {
@@ -44,7 +44,7 @@ const AnimatedFABExample = () => {
4444
<Avatar.Text
4545
style={[styles.avatar, { backgroundColor: item.bgColor }]}
4646
label={item.initials}
47-
color={MD3Colors.primary100}
47+
color={Colors.primary100}
4848
size={40}
4949
/>
5050
<View style={styles.itemTextContentContainer}>
@@ -86,9 +86,7 @@ const AnimatedFABExample = () => {
8686

8787
<Icon
8888
name={item.favorite ? 'star' : 'star-outline'}
89-
color={
90-
item.favorite ? MD3Colors.error70 : MD3Colors.neutralVariant70
91-
}
89+
color={item.favorite ? Colors.error70 : Colors.neutralVariant70}
9290
size={20}
9391
onPress={() => setVisible(!visible)}
9492
style={styles.icon}

example/src/Examples/AvatarExample.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { StyleSheet, View } from 'react-native';
33

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

66
import ScreenWrapper from '../ScreenWrapper';
77

@@ -14,11 +14,11 @@ const AvatarExample = () => {
1414
style={[
1515
styles.avatar,
1616
{
17-
backgroundColor: MD3Colors.error70,
17+
backgroundColor: Colors.error70,
1818
},
1919
]}
2020
label="XD"
21-
color={MD3Colors.primary0}
21+
color={Colors.primary0}
2222
/>
2323
<Avatar.Text style={styles.avatar} label="XD" />
2424
<Avatar.Text style={styles.avatar} label="XD" size={80} />
@@ -30,11 +30,11 @@ const AvatarExample = () => {
3030
style={[
3131
styles.avatar,
3232
{
33-
backgroundColor: MD3Colors.error70,
33+
backgroundColor: Colors.error70,
3434
},
3535
]}
3636
icon="folder"
37-
color={MD3Colors.primary0}
37+
color={Colors.primary0}
3838
/>
3939
<Avatar.Icon style={styles.avatar} icon="folder" />
4040
<Avatar.Icon style={styles.avatar} icon="folder" size={80} />

example/src/Examples/BadgeExample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
Badge,
66
IconButton,
77
List,
8-
MD3Colors,
8+
Colors,
99
Text,
1010
Switch,
1111
} from 'react-native-paper';
@@ -41,7 +41,7 @@ const BadgeExample = () => {
4141
style={[
4242
styles.badge,
4343
{
44-
backgroundColor: MD3Colors.primary80,
44+
backgroundColor: Colors.primary80,
4545
},
4646
]}
4747
>

example/src/Examples/BannerExample.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
View,
99
} from 'react-native';
1010

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

1313
import ScreenWrapper from '../ScreenWrapper';
1414

@@ -31,11 +31,11 @@ const BannerExample = () => {
3131
const customTheme = {
3232
...theme,
3333
colors: {
34-
onSurface: MD3Colors.tertiary100,
34+
onSurface: Colors.tertiary100,
3535
elevation: {
36-
level1: MD3Colors.tertiary50,
36+
level1: Colors.tertiary50,
3737
},
38-
primary: MD3Colors.tertiary10,
38+
primary: Colors.tertiary10,
3939
},
4040
};
4141

example/src/Examples/CheckboxExample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { StyleSheet, View } from 'react-native';
33

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

66
import ScreenWrapper from '../ScreenWrapper';
77

@@ -26,7 +26,7 @@ const CheckboxExample = () => {
2626
<Text>Custom</Text>
2727
<View pointerEvents="none">
2828
<Checkbox
29-
color={MD3Colors.error70}
29+
color={Colors.error70}
3030
status={checkedCustom ? 'checked' : 'unchecked'}
3131
/>
3232
</View>

example/src/Examples/ChipExample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import * as React from 'react';
22
import { Image, StyleSheet, View } from 'react-native';
33

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

77
import ScreenWrapper from '../ScreenWrapper';
88

9-
const customColor = MD3Colors.error50;
9+
const customColor = Colors.error50;
1010

1111
const ChipExample = () => {
1212
const [snackbarProperties, setSnackbarProperties] = React.useState({

0 commit comments

Comments
 (0)