import React, { useState } from 'react'; import { View, Text, ScrollView, StyleSheet, } from 'react-native'; import { Ux4gTag, Ux4gUnifiedPillTag } from '../components/tag/Tag'; import { Ux4gButton } from '../components/button/Button'; import { useUx4gTheme } from '../theme/Ux4gThemeContext'; export const TagShowcase: React.FC = () => { const theme = useUx4gTheme(); const colors = theme.colors; const [dismissedTags, setDismissedTags] = useState([]); const handleDismiss = (tagName: string) => { setDismissedTags((prev) => [...prev, tagName]); }; const handleResetDismissed = () => { setDismissedTags([]); }; const isVisible = (tagName: string) => !dismissedTags.includes(tagName); const cardStyle = [ 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' }, ]; return ( 🏷️ Tag Component (`Ux4gTag`) Ported from Flutter `tag.dart`. Supports sizes (`m`, `l`), shapes (`circular`, `rectangular`), styles (`tonal`, `filled`, `outline`, `text`), color palettes, leading content, and `onDismiss`. {/* 1. Color Schemes - Tonal Style */} 1. Color Schemes (`colorScheme`) - Tonal Style Default tonal style across all 6 foundational color schemes (`neutral`, `brand`, `success`, `warning`, `error`, `info`). {/* 2. Visual Styles */} 2. Visual Styles (`style`) Variations of `brand` tags across `tonal`, `filled`, `outline`, and `text` styles. {/* 3. Sizes and Shapes */} 3. Sizes (`size`) & Shapes (`shape`) Comparison of `m` (20px height) vs `l` (24px height) in both `circular` and `rectangular` shapes. {/* 4. Leading Indicators & Dismissable Tags */} 4. Leading Indicators & Interactive Dismiss (`onDismiss`) Tap the trailing ✕ icon to dismiss tags interactively! {isVisible('react') && ( } onDismiss={() => handleDismiss('react')} /> )} {isVisible('flutter') && ( ⚡} onDismiss={() => handleDismiss('flutter')} /> )} {isVisible('verified') && ( ✓} onDismiss={() => handleDismiss('verified')} /> )} {dismissedTags.length > 0 && ( )} {/* 5. Unified Pill Tags */} 5. Unified Pill Tags (`Ux4gUnifiedPillTag`) Multi-segment pills separated by vertical divider lines (`Ux4gUnifiedPillTagProps`). ); }; 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, }, gridRow: { flexDirection: 'row', flexWrap: 'wrap', gap: 10, marginTop: 12, alignItems: 'center', }, statusDot: { width: 6, height: 6, borderRadius: 3, }, });