/** * Design tokens for Gitea Native. * * Single source of truth for colors, spacing, radii, and typography. * Never hardcode hex values in components — always read from the active theme. */ import { Platform } from 'react-native'; /** Gitea's recognizable green, used for accents and primary actions. */ export const BRAND_PRIMARY = '#609926'; export const palette = { light: { background: '#F7F9F6', surface: '#FFFFFF', surfaceSecondary: '#EDF1EA', surfacePressed: '#E2E8DF', overlay: 'rgba(23, 32, 25, 0.45)', text: '#172019', textSecondary: '#55624F', textTertiary: '#7C877A', textDisabled: '#A9B2A6', border: '#DCE3D9', borderStrong: '#C3CDBF', primary: BRAND_PRIMARY, primaryPressed: '#4E7D1F', primaryMuted: '#E8F1DC', onPrimary: '#FFFFFF', link: '#0969DA', success: '#1A7F37', successMuted: '#DCF2E3', warning: '#9A6700', warningMuted: '#FBF0D9', error: '#D1242F', errorMuted: '#FBE3E3', info: '#0969DA', infoMuted: '#DFEAF9', neutral: '#6A7568', neutralMuted: '#E8EBE6', merged: '#8250DF', mergedMuted: '#EFE4FC', diffAdd: '#E6FFEC', diffAddText: '#116329', diffDel: '#FFEBE9', diffDelText: '#82071E', diffGutter: '#F2F4F1', codeBackground: '#F1F4EF', scrim: '#FFFFFFCC', }, dark: { background: '#111713', surface: '#1B241D', surfaceSecondary: '#243027', surfacePressed: '#2C3A30', overlay: 'rgba(3, 6, 4, 0.6)', text: '#F1F5F0', textSecondary: '#A7B3A5', textTertiary: '#7E8B7C', textDisabled: '#5C675B', border: '#2E3B31', borderStrong: '#3E4E41', primary: '#74B339', primaryPressed: '#8BC44E', primaryMuted: '#22301A', onPrimary: '#0C1207', link: '#6CB6FF', success: '#3FB950', successMuted: '#132A19', warning: '#D29922', warningMuted: '#2E2413', error: '#F85149', errorMuted: '#33191A', info: '#58A6FF', infoMuted: '#14283D', neutral: '#8B988A', neutralMuted: '#232B24', merged: '#A371F7', mergedMuted: '#241C36', diffAdd: '#12261A', diffAddText: '#7EE787', diffDel: '#2A1517', diffDelText: '#FF7B72', diffGutter: '#161D18', codeBackground: '#151C17', scrim: '#0B100DCC', }, } as const; export type ColorToken = keyof typeof palette.light; export type ThemeColors = { [K in ColorToken]: string }; /** Which color families are identical across schemes (for semantic aliases). */ export const spacing = { none: 0, xs: 4, sm: 8, md: 12, lg: 16, xl: 24, xxl: 32, xxxl: 48, } as const; export type SpacingToken = keyof typeof spacing; export const radius = { sm: 6, md: 10, lg: 14, xl: 20, pill: 999, } as const; export type RadiusToken = keyof typeof radius; export const fontSize = { xs: 12, sm: 13, md: 15, lg: 17, xl: 20, xxl: 24, xxxl: 30, } as const; export const fontWeight = { regular: '400', medium: '500', semibold: '600', bold: '700', } as const; export const fontFamily = { sans: Platform.select({ ios: 'System', android: 'sans-serif', default: 'System' }), sansMedium: Platform.select({ ios: 'System', android: 'sans-serif-medium', default: 'System', }), mono: Platform.select({ ios: 'ui-monospace', android: 'monospace', default: 'monospace', }), } as const; /** Minimum touch target per platform HIG. */ export const HIT_TARGET = 44; export const shadows = { card: Platform.select({ ios: { shadowColor: '#000000', shadowOpacity: 0.08, shadowRadius: 8, shadowOffset: { width: 0, height: 2 }, }, android: { elevation: 2 }, default: {}, }), floating: Platform.select({ ios: { shadowColor: '#000000', shadowOpacity: 0.16, shadowRadius: 16, shadowOffset: { width: 0, height: 6 }, }, android: { elevation: 6 }, default: {}, }), } as const;