import React from 'react';
import { View, Text, ScrollView, StyleSheet, Image } from 'react-native';
import { Ux4gCard } from '../components/card/Card';
import { useUx4gTheme } from '../theme/Ux4gThemeContext';
import { UX4GColors } from '../foundation/colors';
import { Ux4gTag } from '../components/tag/Tag';
import { Ux4gAvatar } from '../components/avatar/Avatar';
import { Ux4gIconButton } from '../components/button/IconButton';
import { Ux4gButton } from '../components/button/Button';
export const CardShowcase: React.FC = () => {
const theme = useUx4gTheme();
const colors = theme.colors;
const cardContainerStyle = [
styles.card,
{
backgroundColor: theme.isDark ? '#1F1F1F' : '#FFFFFF',
borderColor: theme.isDark ? '#333333' : '#E4E4E7',
},
];
const titleStyle = [
styles.sectionTitle,
{ color: theme.isDark ? '#F4F4F5' : '#18181B' },
];
const subtitleStyle = [
styles.subText,
{ color: theme.isDark ? '#A1A1AA' : '#71717A' },
];
// Dummy shapes icon used in the Figma mockup
const StatusTag = ({ withSeparator = false }: { withSeparator?: boolean }) => (
⁂}
/>
{withSeparator && (
|
)}
);
const BottomTag = () => (
⁂}
/>
);
return (
💳 Card Component
All possible variants based on Widgetbook and Figma designs.
{/* 1. Basic Content */}
1. Basic Content
A surface container with optional title, subtitle, and body text.
{/* 2. With Footer Buttons */}
2. With Footer Buttons
Attach primary and/or secondary action buttons to the card footer.
{/* 3. With Media */}
3. With Media
Provide a mediaImageUrl to display a hero image at the top.
{/* 4. Horizontal Layout */}
4. Horizontal Layout
Media thumbnail appears on the left side.
{/* 5. Complex Rich Card (Vertical) */}
5. Complex Rich Card
Replicating complex UI layouts matching the Figma designs.
⏏}
variant="ghost"
backgroundColor="rgba(0,0,0,0.3)"
size={32}
/>
}
avatar={}
title="Title"
subtitle="Subtitle"
headerTrailingAction={
⁂}
variant="ghost"
/>
}
statusChips={[, , ]}
body="Lorem ipsum is a dummy or placeholder text commonly used in graphic design, publishing, and web development."
bottomChips={[, , , ]}
footerType="primaryAndSecondary"
primaryButtonText="Button"
primaryButtonLeadingIcon={+}
primaryButtonTrailingIcon={▼}
secondaryButtonText="Button"
secondaryButtonLeadingIcon={+}
secondaryButtonTrailingIcon={▼}
elevation={2}
/>
{/* 6. Complex Rich Card (Horizontal) */}
6. Complex Rich Card (Horizontal)
Rich card layout in a horizontal orientation.
⏏}
variant="ghost"
backgroundColor="rgba(0,0,0,0.3)"
size={32}
/>
}
avatar={}
title="Title"
subtitle="Subtitle"
headerTrailingAction={
⁂}
variant="ghost"
/>
}
statusChips={[, , ]}
body="Lorem ipsum is a dummy or placeholder text commonly used in graphic design, publishing, and web development."
bottomChips={[, , , ]}
footerType="primaryAndSecondary"
primaryButtonText="Button"
secondaryButtonText="Button"
elevation={2}
/>
{/* 7. Custom Rich Card (Children) */}
7. Custom Rich Card (Children)
Replicating highly custom layouts using the 'children' prop.
{/* Custom Media Stack */}
⁂} customBackgroundColor="black" customContentColor="white" />
⏏} variant="ghost" backgroundColor="rgba(0,0,0,0.3)" size={32} />
{/* Content Body */}
{/* Special Tag Row from Image 2 */}
⁂} />
⁂
Label
{/* Header */}
Title
Subtitle
⁂} variant="ghost" />
{/* Status Chips */}
{/* Body */}
Lorem ipsum is a dummy or placeholder text commonly used in graphic design, publishing, and web development.
{/* Bottom Chips */}
{/* Custom Footer */}
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
},
contentContainer: {
padding: 16,
paddingBottom: 40,
},
header: {
marginBottom: 16,
},
title: {
fontSize: 22,
fontWeight: '800',
marginBottom: 6,
},
subText: {
fontSize: 14,
lineHeight: 20,
},
card: {
borderWidth: 1,
borderRadius: 16,
padding: 16,
marginBottom: 16,
},
sectionTitle: {
fontSize: 16,
fontWeight: '700',
marginBottom: 4,
},
demoContainer: {
marginTop: 12,
},
});