import React, { useState } from 'react'; import { ScrollView, View, Text, StyleSheet, SafeAreaView, StatusBar, } from 'react-native'; import { Ux4gThemeProvider, useUx4gTheme, useUx4gStyleSheet, Ux4gButton, Ux4gOutlineButton, Ux4gTextButton, Ux4gIconButton, UX4GColors, } from '../index'; const ShowcaseContent: React.FC = () => { const theme = useUx4gTheme(); const [loadingState, setLoadingState] = useState(false); const styles = useUx4gStyleSheet((t) => ({ container: { flex: 1, backgroundColor: t.colors.background, }, scrollContent: { padding: t.space.space20, paddingBottom: t.space.space64, }, headerRow: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: t.space.space24, paddingBottom: t.space.space16, borderBottomWidth: 1, borderBottomColor: t.isDark ? UX4GColors.neutral800 : UX4GColors.neutral200, }, title: { fontSize: 24, fontWeight: '700', color: t.isDark ? UX4GColors.white : t.colors.primary, }, subtitle: { fontSize: 14, color: t.colors.secondary, marginTop: t.space.space4, }, section: { marginBottom: t.space.space32, }, sectionTitle: { fontSize: 18, fontWeight: '600', color: t.colors.primary, marginBottom: t.space.space12, }, sectionDescription: { fontSize: 13, color: t.isDark ? UX4GColors.neutral400 : UX4GColors.neutral600, marginBottom: t.space.space16, }, row: { flexDirection: 'row', flexWrap: 'wrap', gap: t.space.space12, alignItems: 'center', marginBottom: t.space.space12, }, column: { gap: t.space.space12, }, card: { padding: t.space.space16, borderRadius: t.radius.radius12, borderWidth: 1, borderColor: t.isDark ? UX4GColors.neutral800 : UX4GColors.neutral200, backgroundColor: t.isDark ? UX4GColors.neutral900 : UX4GColors.neutral50, marginBottom: t.space.space16, }, iconText: { fontSize: 18, fontWeight: '700', textAlignVertical: 'center', includeFontPadding: false, }, })); const renderIcon = (label: string) => ({ color, size }: { color: string; size?: number }) => ( {label} ); return ( {/* Header with Theme Switcher */} Ux4gButton Showcase {theme.isDark ? 'Dark Theme Active' : 'Light Theme Active'} {/* 1. Variants */} 1. Variants (`Ux4gButtonVariant`) All 4 standard visual variants ported from the Flutter design system (`buttons.dart`). {/* 2. Sizes */} 2. Sizes (`Ux4gButtonSize`) Consistent padding and height scaling across `small` (32pt), `medium` (40pt), and `large` (48pt). {/* 3. Interactive States (Loading & Disabled) */} 3. Interactive States Disabled opacity matching UX4G guidelines and loading indicator state. { setLoadingState(true); setTimeout(() => setLoadingState(false), 3000); }} /> { setLoadingState(true); setTimeout(() => setLoadingState(false), 3000); }} /> {/* 4. Icons Support */} 4. Icons & Asset Support Seamless integration with `leadingIcon`, `trailingIcon`, and dedicated `Ux4gIconButton`. {}} /> {}} /> {}} /> {/* 5. User Customization API (React Native Best Approach) */} 5. Complete Style Customization Demonstrating how developers can fully customize colors, radius, borders, and press animations. • Custom Pill Button (Green override + radius 999): • Custom Border + Letter Spacing Override: {'• Dynamic Scale on Press (({ pressed }) => style):'} ({ transform: [{ scale: pressed ? 0.95 : 1 }], shadowColor: UX4GColors.gold500, shadowOffset: { width: 0, height: 4 }, shadowOpacity: pressed ? 0.4 : 0.2, shadowRadius: 8, })} /> ); }; export const ButtonShowcase: React.FC = () => { return ( ); }; export default ButtonShowcase;