eletrotupi / tcc/ frontend/constants/theme.ts5516404f2c5d456b4ccfc63657dd2c7c62b6f76b
4.7 KB | 215 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
    smallAddButtonIcon: BORDER_SUBTLE_LIGHT_GRAY,
50

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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