eletrotupi / tcc/ frontend/constants/theme.tsd5dbfbd54d2fb3166d9d8ccdd14000bdcfb0dfdb
4.7 KB | 214 lines Raw
1
/**
2
 * Below are the colors that are used in the app. The colors are defined in the light and dark mode.
3
 * There are many other ways to style your app. For example, [Nativewind](https://www.nativewind.dev/), [Tamagui](https://tamagui.dev/), [unistyles](https://reactnativeunistyles.vercel.app), etc.
4
 */
5

6
import { Platform } from 'react-native';
7

8
// Primary Colors
9
const NEON_GREEN = '#13ec5b';
10
const PRIMARY_DARK = '#0f172a';
11

12
// Surface & Background
13
const BACKGROUND_LIGHT = '#f6f8f6';
14
const SURFACE_LIGHT = '#ffffff';
15
const BACKGROUND_DARK_GHOST = '#F8FAFC';
16

17
// Text Colors
18
const TEXT_PRIMARY = '#0f172a';
19
const TEXT_SECONDARY = '#64748b';
20
const TEXT_PLACEHOLDER = '#94A3B8';
21

22
// Borders & Accents
23
const BORDER_SUBTLE = '#f1f5f9';
24
const BORDER_SUBTLE_GRAY = '#E5E7EB';
25
const BORDER_SUBTLE_LIGHT_GRAY = '#CBD5E1';
26
const STATUS_ACTIVE_BG = 'rgba(19, 236, 91, 0.1)';
27

28
// Semantic Color Pills and stuff
29
const PILL_BLUE = '#dbeafe';
30
const PILL_INDIGO = '#e0e7ff';
31
const PILL_PURPLE = '#f3e8ff';
32

33
const tintColorLight = '#12ED5C';
34
const tintColorSecondary = '#618A70';
35
const black = '#0F172A';
36
const gray = '#475569';
37
const lightGray = '#64748B'
38

39
export const Colors = {
40
  light: {
41
    // Primary Actions & Focus
42
    text: TEXT_PRIMARY,
43
    textSecondary: TEXT_SECONDARY,
44
    background: BACKGROUND_LIGHT,
45
    surface: SURFACE_LIGHT,
46
    tint: NEON_GREEN,
47
    backgroundDarkGhost: BACKGROUND_DARK_GHOST,
48
    borderDashed: BORDER_SUBTLE_LIGHT_GRAY,
49

50
    // Interactive States
51
    icon: TEXT_SECONDARY,
52
    tabIconDefault: TEXT_SECONDARY,
53
    tabIconSelected: NEON_GREEN,
54

55
    // Form Inputs
56
    inputBackgroundColor: SURFACE_LIGHT,
57
    inputBackgroundDarkGhostColor: BACKGROUND_DARK_GHOST,
58
    inputBorderColor: BORDER_SUBTLE_GRAY,
59
    inputFocusBorderColor: NEON_GREEN,
60
    inputPlaceholderColor: TEXT_PLACEHOLDER,
61

62
    // Cards & Containers
63
    cardBackground: SURFACE_LIGHT,
64
    cardBorder: BORDER_SUBTLE,
65
    cardShadow: 'rgba(0, 0, 0, 0.05)',
66

67
    // Active / Inactive States
68
    activeBackground: STATUS_ACTIVE_BG,
69
    inactiveOpacity: 0.7,
70

71
    // Semantic Accents (for categorization)
72
    accentBlue: PILL_BLUE,
73
    accentIndigo: PILL_INDIGO,
74
    accentPurple: PILL_PURPLE,
75

76
    // Disabled / Secondary
77
    disabled: '#cbd5e1',
78
    divider: BORDER_SUBTLE,
79
    sliderTracking: '#E2E8F0',
80
    sliderLabels: '#94a3b8'
81
  },
82
};
83

84
export const Typography = {
85
  // Headlines
86
  headlineXg: {
87
    fontFamily: Platform.select({
88
      android: 'Inter_900Black',
89
      default: 'Inter',
90
    }),
91
    fontSize: 36,
92
    fontWeight: '900' as const,
93
    lineHeight: 40,
94
  },
95
  headlineLg: {
96
    fontFamily: Platform.select({
97
      android: 'Inter_900Black',
98
      default: 'Inter',
99
    }),
100
    fontSize: 20,
101
    fontWeight: '900' as const,
102
    lineHeight: 28,
103
    letterSpacing: -0.02,
104
  },
105
  headlineMd: {
106
    fontFamily: Platform.select({
107
      android: 'Inter',
108
      default: 'Inter',
109
    }),
110
    fontSize: 18,
111
    fontWeight: '700' as const,
112
    lineHeight: 24,
113
  },
114

115
  // Body
116
  bodyLg: {
117
    fontFamily: Platform.select({
118
      android: 'Inter',
119
      default: 'Inter',
120
    }),
121
    fontSize: 16,
122
    fontWeight: '700' as const,
123
    lineHeight: 20,
124
  },
125
  bodyMd: {
126
    fontFamily: Platform.select({
127
      android: 'Inter',
128
      default: 'Inter',
129
    }),
130
    fontSize: 14,
131
    fontWeight: '500' as const,
132
    lineHeight: 20,
133
  },
134

135
  // Labels
136
  labelSm: {
137
    fontFamily: Platform.select({
138
      android: 'Inter',
139
      default: 'Inter',
140
    }),
141
    fontSize: 12,
142
    fontWeight: '600' as const,
143
    lineHeight: 16,
144
    letterSpacing: 0.05,
145
  },
146

147
  // Used for the Slider labels
148
  labelXs: {
149
    fontFamily: Platform.select({
150
      android: 'Inter',
151
      default: 'Inter',
152
    }),
153
    fontSize: 10,
154
    lineHeight: 15,
155
    letterSpacing: 0.25
156
  }
157
};
158

159
export const Spacing = {
160
  containerPadding: 16, // 1rem
161
  sectionGap: 32, // 2rem
162
  inlineGapSm: 8, // 0.5rem
163
  cardGap: 12 // 0.75rem
164
};
165

166
export const BorderRadius = {
167
  sm: 4, // 0.25rem
168
  default: 8, // 0.5rem
169
  md: 12, // 0.75rem
170
  lg: 16, // 1rem
171
  xl: 24, // 1.5rem
172
  full: 9999, // pill-shaped
173
};
174

175
export const Shadows = {
176
  sm: {
177
    shadowColor: '#000000',
178
    shadowOffset: { width: 0, height: 1 },
179
    shadowOpacity: 0.05,
180
    shadowRadius: 2,
181
    elevation: 2,
182
  },
183
  md: {
184
    shadowColor: '#000000',
185
    shadowOffset: { width: 0, height: 4 },
186
    shadowOpacity: 0.1,
187
    shadowRadius: 8,
188
    elevation: 4,
189
  },
190
  lg: {
191
    shadowColor: NEON_GREEN,
192
    shadowOffset: { width: 0, height: 8 },
193
    shadowOpacity: 0.15,
194
    shadowRadius: 16,
195
    elevation: 8,
196
  },
197
};
198

199
export const Fonts = Platform.select({
200
  default: {
201
    sans: 'Inter',
202
    serif: 'serif',
203
    rounded: 'Inter',
204
    mono: 'monospace',
205
  },
206
});
207

208
export const Theme = {
209
  colors: Colors,
210
  typography: Typography,
211
  spacing: Spacing,
212
  shadows: Shadows,
213
  borderRadius: BorderRadius
214
};