Skip to content

Commit e1d8bee

Browse files
committed
refactor: rework Surface and elevation shadows
1 parent dfaecf0 commit e1d8bee

76 files changed

Lines changed: 16683 additions & 12976 deletions

File tree

Some content is hidden

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

‎docs/6.x/docs/components/Card/Card.mdx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ export default MyComponent;
159159

160160
<PropTable componentLink="Card/Card" prop="accessible" />
161161

162+
<div>
163+
164+
### ref
165+
166+
</div>
167+
168+
<PropTable componentLink="Card/Card" prop="ref" />
169+
162170

163171

164172
<span />

‎docs/6.x/docs/components/Chip/Chip.mdx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,14 @@ export default MyComponent;
268268

269269
<div>
270270

271+
### ref
272+
273+
</div>
274+
275+
<PropTable componentLink="Chip/Chip" prop="ref" />
276+
277+
<div>
278+
271279
### role
272280

273281
</div>

‎docs/6.x/docs/components/Modal.mdx‎

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,18 @@ const MyComponent = () => {
2828

2929
const showModal = () => setVisible(true);
3030
const hideModal = () => setVisible(false);
31-
const containerStyle = { backgroundColor: 'white', padding: 20 };
31+
32+
const containerStyle = { padding: 20 };
3233

3334
return (
3435
<PaperProvider>
3536
<Portal>
36-
<Modal visible={visible} onDismiss={hideModal} contentContainerStyle={containerStyle}>
37+
<Modal
38+
visible={visible}
39+
onDismiss={hideModal}
40+
contentBackgroundColor="white"
41+
contentContainerStyle={containerStyle}
42+
>
3743
<Text>Example Modal. Click outside this area to dismiss.</Text>
3844
</Modal>
3945
</Portal>
@@ -111,6 +117,30 @@ export default MyComponent;
111117

112118
<div>
113119

120+
### contentBackgroundColor
121+
122+
</div>
123+
124+
<PropTable componentLink="Modal" prop="contentBackgroundColor" />
125+
126+
<div>
127+
128+
### contentBorderRadius
129+
130+
</div>
131+
132+
<PropTable componentLink="Modal" prop="contentBorderRadius" />
133+
134+
<div>
135+
136+
### contentElevation
137+
138+
</div>
139+
140+
<PropTable componentLink="Modal" prop="contentElevation" />
141+
142+
<div>
143+
114144
### style
115145

116146
</div>

‎docs/6.x/docs/components/Surface.mdx‎

Lines changed: 135 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import ScreenshotTabs from '@docs/components/ScreenshotTabs.tsx';
99
import ExtendedExample from '@docs/components/ExtendedExample.tsx';
1010

1111
Surface is a basic container that can give depth to an element with elevation shadow.
12-
On dark theme with `adaptive` mode, surface is constructed by also placing a semi-transparent white overlay over a component surface.
13-
See [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more information.
14-
Overlay and shadow can be applied by specifying the `elevation` property both on Android and iOS.
12+
13+
On Android, Surface uses the native `elevation` style,
14+
and falls back to shadows that approximate the elevation on other platforms.
1515

1616

1717

@@ -26,7 +26,7 @@ import { Surface, Text } from 'react-native-paper';
2626
import { StyleSheet } from 'react-native';
2727

2828
const MyComponent = () => (
29-
<Surface style={styles.surface} elevation={4}>
29+
<Surface style={styles.surface} elevation={4} borderRadius={8}>
3030
<Text>Surface</Text>
3131
</Surface>
3232
);
@@ -35,9 +35,9 @@ export default MyComponent;
3535

3636
const styles = StyleSheet.create({
3737
surface: {
38-
padding: 8,
3938
height: 80,
4039
width: 80,
40+
padding: 8,
4141
alignItems: 'center',
4242
justifyContent: 'center',
4343
},
@@ -52,11 +52,131 @@ const styles = StyleSheet.create({
5252

5353
<div>
5454

55-
### children (required)
55+
### backgroundColor
5656

5757
</div>
5858

59-
<PropTable componentLink="Surface" prop="children" />
59+
<PropTable componentLink="Surface" prop="backgroundColor" />
60+
61+
<div>
62+
63+
### borderRadius
64+
65+
</div>
66+
67+
<PropTable componentLink="Surface" prop="borderRadius" />
68+
69+
<div>
70+
71+
### borderBottomEndRadius
72+
73+
</div>
74+
75+
<PropTable componentLink="Surface" prop="borderBottomEndRadius" />
76+
77+
<div>
78+
79+
### borderBottomLeftRadius
80+
81+
</div>
82+
83+
<PropTable componentLink="Surface" prop="borderBottomLeftRadius" />
84+
85+
<div>
86+
87+
### borderBottomRightRadius
88+
89+
</div>
90+
91+
<PropTable componentLink="Surface" prop="borderBottomRightRadius" />
92+
93+
<div>
94+
95+
### borderBottomStartRadius
96+
97+
</div>
98+
99+
<PropTable componentLink="Surface" prop="borderBottomStartRadius" />
100+
101+
<div>
102+
103+
### borderEndEndRadius
104+
105+
</div>
106+
107+
<PropTable componentLink="Surface" prop="borderEndEndRadius" />
108+
109+
<div>
110+
111+
### borderEndStartRadius
112+
113+
</div>
114+
115+
<PropTable componentLink="Surface" prop="borderEndStartRadius" />
116+
117+
<div>
118+
119+
### borderStartEndRadius
120+
121+
</div>
122+
123+
<PropTable componentLink="Surface" prop="borderStartEndRadius" />
124+
125+
<div>
126+
127+
### borderStartStartRadius
128+
129+
</div>
130+
131+
<PropTable componentLink="Surface" prop="borderStartStartRadius" />
132+
133+
<div>
134+
135+
### borderTopEndRadius
136+
137+
</div>
138+
139+
<PropTable componentLink="Surface" prop="borderTopEndRadius" />
140+
141+
<div>
142+
143+
### borderTopLeftRadius
144+
145+
</div>
146+
147+
<PropTable componentLink="Surface" prop="borderTopLeftRadius" />
148+
149+
<div>
150+
151+
### borderTopRightRadius
152+
153+
</div>
154+
155+
<PropTable componentLink="Surface" prop="borderTopRightRadius" />
156+
157+
<div>
158+
159+
### borderTopStartRadius
160+
161+
</div>
162+
163+
<PropTable componentLink="Surface" prop="borderTopStartRadius" />
164+
165+
<div>
166+
167+
### borderCurve
168+
169+
</div>
170+
171+
<PropTable componentLink="Surface" prop="borderCurve" />
172+
173+
<div>
174+
175+
### transitionDuration
176+
177+
</div>
178+
179+
<PropTable componentLink="Surface" prop="transitionDuration" />
60180

61181
<div>
62182

@@ -92,6 +212,14 @@ const styles = StyleSheet.create({
92212

93213
<div>
94214

215+
### children (required)
216+
217+
</div>
218+
219+
<PropTable componentLink="Surface" prop="children" />
220+
221+
<div>
222+
95223
### testID
96224

97225
</div>

0 commit comments

Comments
 (0)