eletrotupi / tcc/ frontend/constants/theme.tsfe2deb48e4d91c97820de01dec6dd464c725329f
5.0 KB | 229 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
    success: "#22c55e",
84
    danger: "#EF4444",
85
    textBlack: PRIMARY_DARK,
86
  },
87
};
88

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

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

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

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

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

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

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

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

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

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