Skip to content

Commit 9eb56da

Browse files
Artur Bienarturbien
authored andcommitted
feat(panel): add cutout variant
1 parent e8f96d2 commit 9eb56da

34 files changed

+174
-236
lines changed

example/src/ExamplesScreen.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
Panel,
66
AppBar,
77
Button,
8-
Cutout,
98
List,
109
Text,
1110
ScrollView,
@@ -131,7 +130,7 @@ const ExamplesScreen = () => {
131130
</View>
132131
<Button
133132
square
134-
variant='outside'
133+
variant='raised'
135134
size='lg'
136135
style={styles.aboutButton}
137136
onPress={() => setShowAboutModal(true)}
@@ -156,11 +155,9 @@ const ExamplesScreen = () => {
156155
/>
157156
))}
158157
</ScrollPanel>
159-
<Panel variant='outside' style={styles.panel}>
158+
<Panel variant='raised' style={styles.panel}>
160159
<Divider />
161-
<Cutout
162-
style={[styles.cutout, { backgroundColor: currentTheme.canvas }]}
163-
>
160+
<Panel variant='cutout' background='canvas' style={styles.cutout}>
164161
<ScrollView
165162
style={styles.scrollView}
166163
scrollViewProps={{
@@ -189,7 +186,7 @@ const ExamplesScreen = () => {
189186
))}
190187
</List.Accordion>
191188
</ScrollView>
192-
</Cutout>
189+
</Panel>
193190
<View style={[styles.statusBar]}>
194191
<Panel
195192
variant='well'
@@ -251,14 +248,6 @@ const styles = StyleSheet.create({
251248
justifyContent: 'center',
252249
marginBottom: -4,
253250
zIndex: 10,
254-
shadowColor: '#000',
255-
shadowOffset: {
256-
width: 0,
257-
height: 1,
258-
},
259-
shadowOpacity: 0.2,
260-
shadowRadius: 1.4,
261-
elevation: 2,
262251
},
263252
logo: {
264253
flexDirection: 'row',

example/src/examples/ButtonExample.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,30 @@ const ButtonExample = () => {
4646
<View style={styles.buttonWrapper}>
4747
<Button
4848
primary
49-
variant='outside'
49+
variant='raised'
5050
onPress={() => console.warn('Pressed')}
5151
>
5252
Primary
5353
</Button>
54-
<Button variant='outside' onPress={() => console.warn('Pressed')}>
54+
<Button variant='raised' onPress={() => console.warn('Pressed')}>
5555
Default
5656
</Button>
5757
<Button
5858
active
59-
variant='outside'
59+
variant='raised'
6060
onPress={() => console.warn('Pressed')}
6161
>
6262
Active
6363
</Button>
6464
<Button
65-
variant='outside'
65+
variant='raised'
6666
disabled
6767
onPress={() => console.warn('Pressed')}
6868
>
6969
Disabled
7070
</Button>
7171
<Button
72-
variant='outside'
72+
variant='raised'
7373
onPress={() => console.warn('Pressed')}
7474
square
7575
>

example/src/examples/CheckboxExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-console */
22
import React, { useState } from 'react';
33
import { View } from 'react-native';
4-
import { Checkbox, Fieldset, Cutout } from 'react95-native';
4+
import { Checkbox, Fieldset, Panel } from 'react95-native';
55

66
import ExamplePanel from '../util/ExamplePanel';
77

@@ -39,7 +39,7 @@ const CheckboxExample = () => {
3939
disabled
4040
/>
4141
</Fieldset>
42-
<Cutout>
42+
<Panel variant='cutout' background='canvas'>
4343
<View style={{ padding: 20 }}>
4444
<Fieldset variant='flat' label='Default'>
4545
<Checkbox
@@ -72,7 +72,7 @@ const CheckboxExample = () => {
7272
/>
7373
</Fieldset>
7474
</View>
75-
</Cutout>
75+
</Panel>
7676
</ExamplePanel>
7777
);
7878
};

example/src/examples/CutoutExample.tsx

Lines changed: 0 additions & 40 deletions
This file was deleted.

example/src/examples/FieldsetExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { View } from 'react-native';
3-
import { Fieldset, Text, Cutout } from 'react95-native';
3+
import { Fieldset, Text, Panel } from 'react95-native';
44

55
import ExamplePanel from '../util/ExamplePanel';
66

@@ -17,7 +17,7 @@ const FieldsetExample = () => {
1717
<Text>No label here</Text>
1818
</Fieldset>
1919

20-
<Cutout>
20+
<Panel variant='cutout' background='canvas'>
2121
<View style={{ padding: 20 }}>
2222
<Fieldset variant='flat' label='Name:'>
2323
<Text>Some text here</Text>
@@ -29,7 +29,7 @@ const FieldsetExample = () => {
2929
<Text>No label here</Text>
3030
</Fieldset>
3131
</View>
32-
</Cutout>
32+
</Panel>
3333
</ExamplePanel>
3434
);
3535
};

example/src/examples/ListExample.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-console */
22
import React from 'react';
33
import { View } from 'react-native';
4-
import { List, Hourglass, Cutout, ScrollView } from 'react95-native';
4+
import { List, Hourglass, Panel, ScrollView } from 'react95-native';
55

66
import ExamplePanel from '../util/ExamplePanel';
77

@@ -22,7 +22,11 @@ const HourglassExample = () => {
2222

2323
return (
2424
<ExamplePanel style={{ padding: 8, paddingTop: 10 }}>
25-
<Cutout style={[{ flex: 1, backgroundColor: 'white' }]}>
25+
<Panel
26+
variant='cutout'
27+
background='canvas'
28+
style={[{ flex: 1, backgroundColor: 'white' }]}
29+
>
2630
<ScrollView>
2731
<View style={[{ paddingHorizontal: 16, marginTop: 16 }]}>
2832
<List.Accordion
@@ -62,7 +66,7 @@ const HourglassExample = () => {
6266
</List.Accordion>
6367
</View>
6468
</ScrollView>
65-
</Cutout>
69+
</Panel>
6670
</ExamplePanel>
6771
);
6872
};

example/src/examples/NumberInputExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState } from 'react';
22
import { StyleSheet } from 'react-native';
3-
import { NumberInput, Fieldset, Cutout } from 'react95-native';
3+
import { NumberInput, Fieldset, Panel } from 'react95-native';
44

55
import ExamplePanel from '../util/ExamplePanel';
66

@@ -29,7 +29,7 @@ const NumberInputExample = () => {
2929
/>
3030
</Fieldset>
3131

32-
<Cutout style={{ padding: 20 }}>
32+
<Panel variant='cutout' background='canvas' style={{ padding: 20 }}>
3333
<Fieldset variant='flat' label='Flat' style={[styles.fieldset]}>
3434
<NumberInput
3535
variant='flat'
@@ -47,7 +47,7 @@ const NumberInputExample = () => {
4747
inputWidth={80}
4848
/>
4949
</Fieldset>
50-
</Cutout>
50+
</Panel>
5151
</ExamplePanel>
5252
);
5353
};

example/src/examples/PanelExample.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@ import Container from '../util/Container';
77
const PanelExample = () => {
88
return (
99
<Container>
10-
<Panel variant='outside' style={[styles.panel, { padding }]}>
10+
<Panel variant='raised' style={[styles.panel, { padding }]}>
1111
<Text>
1212
Notice the subtle difference in borders. The lightest border is not on
1313
the edge of this panel.
1414
</Text>
1515
<Panel variant='default' style={{ padding, margin }}>
1616
<Text>
1717
This panel on the other hand has the lightest border on the edge.
18-
Use this panel inside &apos;outside&apos; panels.
18+
Use this panel inside &apos;raised&apos; panels.
1919
</Text>
20-
<Panel variant='well' style={{ padding, marginTop: margin }}>
20+
<Panel
21+
variant='cutout'
22+
background='canvas'
23+
style={{ padding, marginTop: margin, height: 100 }}
24+
>
2125
<Text>Put some content here</Text>
2226
</Panel>
2327
</Panel>
@@ -29,6 +33,8 @@ const PanelExample = () => {
2933
);
3034
};
3135

36+
// TODO: fox paddings
37+
3238
const defaultSpacing = 12;
3339
const margin = defaultSpacing;
3440
const padding = defaultSpacing;

example/src/examples/ProgressExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const DividerExample = () => {
2323
return (
2424
<ExamplePanel>
2525
<Fieldset label='Default' style={[{ padding: 20 }]}>
26-
<Progress percent={percent} />
26+
<Progress percent={percent} background='canvas' />
2727
</Fieldset>
2828
<Fieldset label='Tile' style={[{ padding: 20 }]}>
2929
<Progress variant='tile' percent={percent} />

example/src/examples/RadioExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-console */
22
import React, { useState } from 'react';
33
import { View } from 'react-native';
4-
import { Radio, Fieldset, Cutout } from 'react95-native';
4+
import { Radio, Fieldset, Panel } from 'react95-native';
55

66
import ExamplePanel from '../util/ExamplePanel';
77

@@ -37,7 +37,7 @@ const RadioExample = () => {
3737
disabled
3838
/>
3939
</Fieldset>
40-
<Cutout>
40+
<Panel variant='cutout' background='canvas'>
4141
<View style={{ padding: 16 }}>
4242
<Fieldset variant='flat' label='Default'>
4343
<Radio
@@ -70,7 +70,7 @@ const RadioExample = () => {
7070
/>
7171
</Fieldset>
7272
</View>
73-
</Cutout>
73+
</Panel>
7474
</ExamplePanel>
7575
);
7676
};

0 commit comments

Comments
 (0)