import React, { useState } from 'react'; import { ScrollView, View, Text, SafeAreaView, StatusBar, } from 'react-native'; import { Ux4gThemeProvider, useUx4gTheme, useUx4gStyleSheet, Ux4gSpinner, Ux4gButton, UX4GColors, } from '../index'; const ShowcaseContent: React.FC = () => { const theme = useUx4gTheme(); const [speed, setSpeed] = useState(1200); 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.space24, alignItems: 'center', marginBottom: t.space.space16, }, itemCol: { alignItems: 'center', gap: t.space.space8, }, label: { fontSize: 12, color: t.isDark ? UX4GColors.neutral300 : UX4GColors.neutral700, fontWeight: '500', }, 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, }, })); return ( {/* Header with Theme Switcher */} Ux4gSpinner Showcase Ported from Flutter `Ux4gLoader` (`loader.dart`) {/* 1. Sizes */} 1. Sizes (`size`) Consistent scaling across small (`24`), default (`40`), and large (`64`) diameters. Small (24pt) Default (40pt) Large (64pt) {/* 2. Colors */} 2. Color Overrides (`color`) Defaults to `theme.colors.primary`, but supports any hex, RGB, or theme color. Primary Secondary Success ({UX4GColors.green500}) Pink ({UX4GColors.pink500}) {/* 3. Stroke Thickness */} 3. Stroke Thickness (`strokeWidth`) Customizable ring thickness from delicate thin lines to bold prominent indicators. Thin (2pt) Default (4pt) Thick (8pt) {/* 4. Multi-Tone / Gradient Segments */} 4. Gradient / Multi-Tone Rings (`gradientColors`) Pass an array of colors (`gradientColors`) for multi-colored spinner segments. Primary / Pink / Gold Green / Blue {/* 5. Arc Percentages */} 5. Arc Percentages (`percentage`) Control the filled fraction of the rotating circle from `0` to `100`. 25% Arc 50% Arc 75% Arc 100% Arc {/* 6. Rotation Speeds */} 6. Rotation Speeds (`rotationDurationMillis`) Change the speed of the 360° loop animation (`fast: 600ms`, `default: 1200ms`, `slow: 2400ms`). setSpeed(600)} /> setSpeed(1200)} /> setSpeed(2400)} /> ); }; export const SpinnerShowcase: React.FC = () => { return ( ); }; export default SpinnerShowcase;