import { View, Text, StyleSheet } from 'react-native';
interface CardProps {
title: string;
content: string;
}
const Card = ({ title, content }: CardProps) => (
<View style={styles.card}>
<Text style={styles.title}>{title}</Text>
<Text style={styles.content}>{content}</Text>
</View>
);
const meta = {
component: Card,
parameters: {
backgrounds: {
options: {
light: { name: 'Light Gray', value: '#F3F4F6' },
medium: { name: 'Medium Gray', value: '#9CA3AF' },
dark: { name: 'Dark Gray', value: '#1F2937' },
brand: { name: 'Brand Blue', value: '#3B82F6' },
},
},
},
} satisfies Meta<typeof Card>;
export default meta;
type Story = StoryObj<typeof meta>;
export const OnLight: Story = {
args: {
title: 'Card Title',
content: 'This card looks great on light backgrounds',
},
globals: {
backgrounds: { value: 'light' },
},
};
export const OnDark: Story = {
args: {
title: 'Card Title',
content: 'This card also works on dark backgrounds',
},
globals: {
backgrounds: { value: 'dark' },
},
};
const styles = StyleSheet.create({
card: {
backgroundColor: 'white',
padding: 20,
borderRadius: 12,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.1,
shadowRadius: 4,
elevation: 3,
},
title: {
fontSize: 20,
fontWeight: 'bold',
marginBottom: 8,
},
content: {
fontSize: 14,
color: '#666',
},
});