@popp0102/nova 0.4.0 → 0.5.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.
@@ -0,0 +1,33 @@
1
+ import { View, Pressable, StyleSheet } from "react-native";
2
+
3
+ export default function Card({ children, onPress, style }) {
4
+ const cardContent = (
5
+ <View style={[styles.card, style]}>
6
+ {children}
7
+ </View>
8
+ );
9
+
10
+ if (onPress) {
11
+ return (
12
+ <Pressable
13
+ style={({ pressed }) => [pressed && styles.cardPressed]}
14
+ onPress={onPress}
15
+ >
16
+ {cardContent}
17
+ </Pressable>
18
+ );
19
+ }
20
+
21
+ return cardContent;
22
+ }
23
+
24
+ const styles = StyleSheet.create({
25
+ card: {
26
+ backgroundColor: 'white',
27
+ borderRadius: 16,
28
+ padding: 16,
29
+ },
30
+ cardPressed: {
31
+ opacity: 0.5,
32
+ },
33
+ });
@@ -0,0 +1,23 @@
1
+ import { Text, StyleSheet } from "react-native";
2
+
3
+ const SIZES = {
4
+ small: 12,
5
+ medium: 14,
6
+ large: 16,
7
+ };
8
+
9
+ export default function Subtitle({ children, color = '#777', size = 'medium' }) {
10
+ const fontSize = SIZES[size] || SIZES.medium;
11
+
12
+ return (
13
+ <Text style={[styles.subtitle, { color, fontSize }]}>
14
+ {children}
15
+ </Text>
16
+ );
17
+ }
18
+
19
+ const styles = StyleSheet.create({
20
+ subtitle: {
21
+ fontStyle: 'italic',
22
+ },
23
+ });
package/lib/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  export { default as Button } from './components/Button';
2
2
  export { default as Modal } from './components/Modal';
3
3
  export { default as Badge } from './components/Badge';
4
+ export { default as Card } from './components/Card';
5
+ export { default as Subtitle } from './components/Subtitle';
4
6
  export { default as FadeView } from './components/animations/FadeView';
5
7
  export { default as SlideView } from './components/animations/SlideView';
6
8
  export { default as ShakeView } from './components/animations/ShakeView';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popp0102/nova",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "React Native component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",