@popp0102/nova 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
2
|
|
|
3
3
|
export const sizes = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
h1: 64,
|
|
5
|
+
h2: 48,
|
|
6
|
+
h3: 28,
|
|
7
|
+
h4: 24,
|
|
8
|
+
h5: 20,
|
|
9
|
+
h6: 16,
|
|
8
10
|
};
|
|
9
11
|
|
|
10
12
|
export const styles = StyleSheet.create({
|
|
11
|
-
|
|
13
|
+
heading: {
|
|
12
14
|
fontWeight: 'bold',
|
|
13
15
|
},
|
|
14
16
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Text } from "react-native";
|
|
2
|
+
import { sizes, styles } from './config';
|
|
3
|
+
|
|
4
|
+
export default function Heading({ children, color = 'black', size = 'h4', fontFamily }) {
|
|
5
|
+
const fontSize = sizes[size] || sizes.h4;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<Text style={[styles.heading, { color, fontSize, fontFamily }]}>
|
|
9
|
+
{children}
|
|
10
|
+
</Text>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { StyleSheet, ImageBackground, View } from 'react-native';
|
|
2
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
3
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
4
|
+
|
|
5
|
+
export default function Screen({ style, children, gradientColors, backgroundImage }) {
|
|
6
|
+
const content = (
|
|
7
|
+
<SafeAreaView style={[styles.safeArea, style]}>
|
|
8
|
+
{children}
|
|
9
|
+
</SafeAreaView>
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
const withBackground = backgroundImage ? (
|
|
13
|
+
<ImageBackground
|
|
14
|
+
source={backgroundImage.source}
|
|
15
|
+
style={styles.backgroundImage}
|
|
16
|
+
imageStyle={{ opacity: backgroundImage.opacity ?? 0.1 }}
|
|
17
|
+
resizeMode="cover"
|
|
18
|
+
>
|
|
19
|
+
{content}
|
|
20
|
+
</ImageBackground>
|
|
21
|
+
) : content;
|
|
22
|
+
|
|
23
|
+
return gradientColors ? (
|
|
24
|
+
<LinearGradient
|
|
25
|
+
colors={gradientColors}
|
|
26
|
+
style={styles.gradient}
|
|
27
|
+
>
|
|
28
|
+
{withBackground}
|
|
29
|
+
</LinearGradient>
|
|
30
|
+
) : (
|
|
31
|
+
<View style={styles.gradient}>
|
|
32
|
+
{withBackground}
|
|
33
|
+
</View>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const styles = StyleSheet.create({
|
|
38
|
+
gradient: {
|
|
39
|
+
flex: 1,
|
|
40
|
+
},
|
|
41
|
+
backgroundImage: {
|
|
42
|
+
flex: 1,
|
|
43
|
+
},
|
|
44
|
+
safeArea: {
|
|
45
|
+
flex: 1,
|
|
46
|
+
},
|
|
47
|
+
});
|
package/lib/index.js
CHANGED
|
@@ -3,8 +3,9 @@ export { default as Modal } from './components/Modal';
|
|
|
3
3
|
export { default as Badge } from './components/Badge';
|
|
4
4
|
export { default as Card } from './components/Card';
|
|
5
5
|
export { default as IconButton } from './components/IconButton';
|
|
6
|
+
export { default as Screen } from './components/Screen';
|
|
6
7
|
export { default as Subtitle } from './components/Subtitle';
|
|
7
|
-
export { default as
|
|
8
|
+
export { default as Heading } from './components/Heading';
|
|
8
9
|
export { default as FadeView } from './components/animations/FadeView';
|
|
9
10
|
export { default as SlideView } from './components/animations/SlideView';
|
|
10
11
|
export { default as ShakeView } from './components/animations/ShakeView';
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Text } from "react-native";
|
|
2
|
-
import { sizes, styles } from './config';
|
|
3
|
-
|
|
4
|
-
export default function Title({ children, color = 'black', size = 'medium' }) {
|
|
5
|
-
const fontSize = sizes[size] || sizes.medium;
|
|
6
|
-
|
|
7
|
-
return (
|
|
8
|
-
<Text style={[styles.title, { color, fontSize }]}>
|
|
9
|
-
{children}
|
|
10
|
-
</Text>
|
|
11
|
-
);
|
|
12
|
-
}
|