eletrotupi / tcc/ frontend/constants/theme.ts5f5ade68f90eb715f221b0e781c76d423bfb5199
5.0 KB | 227 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
    moodIntensityLabel: '#94a3b8',
72

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

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

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

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

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

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

161
  cardHint: {
162
    fontFamily: Platform.select({
163
      android: 'Inter',
164
      default: 'Inter',
165
    }),
166
    fontSize: 11,
167
    lineHeight: 13.8,
168
    fontStyle: "italic"
169
  }
170
};
171

172
export const Spacing = {
173
  containerPadding: 16, // 1rem
174
  sectionGap: 32, // 2rem
175
  inlineGapSm: 8, // 0.5rem
176
  cardGap: 12 // 0.75rem
177
};
178

179
export const BorderRadius = {
180
  sm: 4, // 0.25rem
181
  default: 8, // 0.5rem
182
  md: 12, // 0.75rem
183
  lg: 16, // 1rem
184
  xl: 24, // 1.5rem
185
  full: 9999, // pill-shaped
186
};
187

188
export const Shadows = {
189
  sm: {
190
    shadowColor: '#000000',
191
    shadowOffset: { width: 0, height: 1 },
192
    shadowOpacity: 0.05,
193
    shadowRadius: 2,
194
    elevation: 2,
195
  },
196
  md: {
197
    shadowColor: '#000000',
198
    shadowOffset: { width: 0, height: 4 },
199
    shadowOpacity: 0.1,
200
    shadowRadius: 8,
201
    elevation: 4,
202
  },
203
  lg: {
204
    shadowColor: NEON_GREEN,
205
    shadowOffset: { width: 0, height: 8 },
206
    shadowOpacity: 0.15,
207
    shadowRadius: 16,
208
    elevation: 8,
209
  },
210
};
211

212
export const Fonts = Platform.select({
213
  default: {
214
    sans: 'Inter',
215
    serif: 'serif',
216
    rounded: 'Inter',
217
    mono: 'monospace',
218
  },
219
});
220

221
export const Theme = {
222
  colors: Colors,
223
  typography: Typography,
224
  spacing: Spacing,
225
  shadows: Shadows,
226
  borderRadius: BorderRadius
227
};