import React from 'react'; import { View, StyleSheet } from 'react-native'; import { Text } from 'react-native-paper'; import { useDTTheme } from '@dangerousthings/react-native'; import { ScreenContainer } from '../components/ScreenContainer'; import { DemoSection } from '../components/DemoSection'; import { BrandSwitcher } from '../components/BrandSwitcher'; import { useBrand } from '../brand/BrandContext'; const typographyScale = [ { variant: 'displaySmall' as const, label: 'Display Small (36px)' }, { variant: 'headlineMedium' as const, label: 'Headline Medium (28px)' }, { variant: 'headlineSmall' as const, label: 'Headline Small (24px)' }, { variant: 'titleLarge' as const, label: 'Title Large (22px)' }, { variant: 'titleMedium' as const, label: 'Title Medium (16px)' }, { variant: 'bodyLarge' as const, label: 'Body Large (16px)' }, { variant: 'bodyMedium' as const, label: 'Body Medium (14px)' }, { variant: 'bodySmall' as const, label: 'Body Small (12px)' }, { variant: 'labelLarge' as const, label: 'Label Large (14px)' }, { variant: 'labelSmall' as const, label: 'Label Small (11px)' }, ]; export function ThemeScreen() { const theme = useDTTheme(); const { brand } = useBrand(); const colors = brand.dark; const colorSwatches = [ { name: 'primary', hex: colors.primary, label: 'Primary interactive' }, { name: 'secondary', hex: colors.secondary, label: 'Highlights, attention' }, { name: 'error', hex: colors.error, label: 'Errors, destructive' }, { name: 'success', hex: colors.success, label: 'Confirmations' }, { name: 'other', hex: colors.other, label: 'Secondary, misc' }, ]; const baseColors = [ { name: 'bg', hex: colors.bg, label: 'Background', textColor: colors.textPrimary }, { name: 'textPrimary', hex: colors.textPrimary, label: 'Text', textColor: colors.bg }, { name: 'surface', hex: colors.surface, label: 'Surface', textColor: colors.textPrimary }, { name: 'border', hex: colors.border, label: 'Border', textColor: colors.bg }, ]; return ( {/* Brand Switcher */} Current: {brand.name} — {brand.description} {/* Color Palette */} MODE COLORS: {colorSwatches.map((swatch) => ( {swatch.name} {swatch.hex} {swatch.label} ))} BASE COLORS: {baseColors.map((color) => ( {color.name} {color.hex} {color.label} ))} {/* Typography */} {typographyScale.map((item) => ( {item.label} ))} {/* Shape Tokens */} {`bevelSm: ${brand.shape.bevelSm}\nbevelMd: ${brand.shape.bevelMd}\nbevelLg: ${brand.shape.bevelLg}\nradiusSm: ${brand.shape.radiusSm}\nradius: ${brand.shape.radius}\nradiusLg: ${brand.shape.radiusLg}`} {/* Spacing */} {[4, 8, 12, 16, 24, 32, 48].map((size) => ( {size}px ))} ); } const styles = StyleSheet.create({ subLabel: { color: 'rgba(255,255,255,0.6)', marginBottom: 12, }, swatchRow: { flexDirection: 'row', alignItems: 'center', gap: 12, marginBottom: 12, }, swatch: { width: 40, height: 40, }, swatchInfo: { flex: 1, }, swatchName: { fontWeight: '600', fontSize: 14, }, swatchHex: { color: 'rgba(255,255,255,0.5)', fontSize: 11, fontFamily: 'monospace', }, swatchDesc: { color: 'rgba(255,255,255,0.35)', fontSize: 11, }, typeRow: { paddingVertical: 4, borderBottomWidth: 1, borderBottomColor: 'rgba(255,255,255,0.05)', }, codeBlock: { backgroundColor: '#0a0a0a', padding: 16, borderWidth: 1, borderColor: 'rgba(255,255,255,0.1)', }, codeText: { fontFamily: 'monospace', fontSize: 12, lineHeight: 20, }, spacingRow: { flexDirection: 'row', alignItems: 'center', gap: 12, marginBottom: 8, }, spacingBar: { height: 12, }, spacingLabel: { color: 'rgba(255,255,255,0.5)', fontSize: 11, fontFamily: 'monospace', }, });