eletrotupi / tcc/ frontend/constants/theme.ts4afa6690e7fdf56346236182ffc75bb984eb9441
5.3 KB | 243 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 BACKGROUND_DARK_GHOST = "#F8FAFC";
15

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

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

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

32
const tintColorLight = "#12ED5C";
33
const tintColorSecondary = "#618A70";
34
const GRAY = "#475569";
35
const LIGHT_GRAY = "#64748B";
36
const LIGHT_SLATE_GRAY = "#94A3B8";
37
const PURE_WHITE = "#FFFFFF";
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: PURE_WHITE,
46
    tint: NEON_GREEN,
47
    backgroundDarkGhost: BACKGROUND_DARK_GHOST,
48
    borderDashed: BORDER_SUBTLE_LIGHT_GRAY,
49
    smallAddButtonIcon: BORDER_SUBTLE_LIGHT_GRAY,
50

51
    // Secondary
52
    neutral: '#6F7A6D',
53
    //secondaryBackground: '#E0EBDB',
54
    secondaryBackground: '#0EB545',
55

56
    // Interactive States
57
    icon: TEXT_SECONDARY,
58
    tabIconDefault: TEXT_SECONDARY,
59
    tabIconSelected: NEON_GREEN,
60

61
    // Form Inputs
62
    inputBackgroundColor: PURE_WHITE,
63
    inputBackgroundDarkGhostColor: BACKGROUND_DARK_GHOST,
64
    inputBorderColor: BORDER_SUBTLE_GRAY,
65
    inputFocusBorderColor: NEON_GREEN,
66
    inputPlaceholderColor: TEXT_PLACEHOLDER,
67

68
    // Cards & Containers
69
    cardBackground: PURE_WHITE,
70
    cardBorder: BORDER_SUBTLE,
71
    cardShadow: "rgba(0, 0, 0, 0.05)",
72

73
    // Active / Inactive States
74
    activeBackground: STATUS_ACTIVE_BG,
75
    inactiveOpacity: 0.7,
76
    moodIntensityLabel: "#94a3b8",
77

78
    // Semantic Accents (for categorization)
79
    accentBlue: PILL_BLUE,
80
    accentIndigo: PILL_INDIGO,
81
    accentPurple: PILL_PURPLE,
82
    accentDarkPurple: "#7F77DD",
83

84
    // Some grays
85
    white: PURE_WHITE,
86
    gray: GRAY,
87
    lightGray: LIGHT_GRAY,
88
    lightSlateGray: LIGHT_SLATE_GRAY,
89
    black: PRIMARY_DARK,
90

91
    // Disabled / Secondary
92
    disabled: "#cbd5e1",
93
    divider: BORDER_SUBTLE,
94
    sliderTracking: "#E2E8F0",
95
    sliderLabels: "#94a3b8",
96
    warning: "orange",
97
    success: "#22c55e",
98
    danger: "#EF4444",
99
    textBlack: PRIMARY_DARK,
100
  },
101
};
102

103
export const Typography = {
104
  // Headlines
105
  headlineXg: {
106
    fontFamily: Platform.select({
107
      android: "Inter_900Black",
108
      default: "Inter",
109
    }),
110
    fontSize: 36,
111
    fontWeight: "900" as const,
112
    lineHeight: 40,
113
  },
114
  headlineLg: {
115
    fontFamily: Platform.select({
116
      android: "Inter_900Black",
117
      default: "Inter",
118
    }),
119
    fontSize: 20,
120
    fontWeight: "900" as const,
121
    lineHeight: 28,
122
    letterSpacing: -0.02,
123
  },
124
  headlineMd: {
125
    fontFamily: Platform.select({
126
      android: "Inter",
127
      default: "Inter",
128
    }),
129
    fontSize: 18,
130
    fontWeight: "700" as const,
131
    lineHeight: 24,
132
  },
133

134
  // Body
135
  bodyLg: {
136
    fontFamily: Platform.select({
137
      android: "Inter",
138
      default: "Inter",
139
    }),
140
    fontSize: 16,
141
    fontWeight: "700" as const,
142
    lineHeight: 20,
143
  },
144
  bodyMd: {
145
    fontFamily: Platform.select({
146
      android: "Inter",
147
      default: "Inter",
148
    }),
149
    fontSize: 14,
150
    fontWeight: "500" as const,
151
    lineHeight: 20,
152
  },
153

154
  // Labels
155
  labelSm: {
156
    fontFamily: Platform.select({
157
      android: "Inter",
158
      default: "Inter",
159
    }),
160
    fontSize: 12,
161
    fontWeight: "600" as const,
162
    lineHeight: 16,
163
    letterSpacing: 0.05,
164
  },
165

166
  // Used for the Slider labels
167
  labelXs: {
168
    fontFamily: Platform.select({
169
      android: "Inter",
170
      default: "Inter",
171
    }),
172
    fontSize: 10,
173
    lineHeight: 15,
174
    letterSpacing: 0.25,
175
  },
176

177
  cardHint: {
178
    fontFamily: Platform.select({
179
      android: "Inter",
180
      default: "Inter",
181
    }),
182
    fontSize: 11,
183
    lineHeight: 13.8,
184
    fontStyle: "italic",
185
  },
186
};
187

188
export const Spacing = {
189
  containerPadding: 16, // 1rem
190
  sectionGap: 32, // 2rem
191
  inlineGapSm: 8, // 0.5rem
192
  cardGap: 12, // 0.75rem
193
};
194

195
export const BorderRadius = {
196
  sm: 4, // 0.25rem
197
  default: 8, // 0.5rem
198
  md: 12, // 0.75rem
199
  lg: 16, // 1rem
200
  xl: 24, // 1.5rem
201
  full: 9999, // pill-shaped
202
};
203

204
export const Shadows = {
205
  sm: {
206
    shadowColor: "#000000",
207
    shadowOffset: { width: 0, height: 1 },
208
    shadowOpacity: 0.05,
209
    shadowRadius: 2,
210
    elevation: 2,
211
  },
212
  md: {
213
    shadowColor: "#000000",
214
    shadowOffset: { width: 0, height: 4 },
215
    shadowOpacity: 0.1,
216
    shadowRadius: 8,
217
    elevation: 4,
218
  },
219
  lg: {
220
    shadowColor: NEON_GREEN,
221
    shadowOffset: { width: 0, height: 8 },
222
    shadowOpacity: 0.15,
223
    shadowRadius: 16,
224
    elevation: 8,
225
  },
226
};
227

228
export const Fonts = Platform.select({
229
  default: {
230
    sans: "Inter",
231
    serif: "serif",
232
    rounded: "Inter",
233
    mono: "monospace",
234
  },
235
});
236

237
export const Theme = {
238
  colors: Colors,
239
  typography: Typography,
240
  spacing: Spacing,
241
  shadows: Shadows,
242
  borderRadius: BorderRadius,
243
};