@xetwa/design-system 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xetwa/design-system",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -27,6 +27,8 @@ export interface MainButtonProps {
27
27
  bgColor?: string;
28
28
  /** Cor do texto customizada (sobrepõe a cor da variante) */
29
29
  textColor?: string;
30
+ /** Peso da fonte customizada (sobrepõe o padrão do botão) */
31
+ weight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
30
32
  /** Cor da sombra customizada (sobrepõe a cor da variante) */
31
33
  shadowColor?: string;
32
34
  /** Cor de fundo no hover (opcional) */
@@ -47,6 +49,7 @@ export const MainButton = React.forwardRef<React.ElementRef<typeof Pressable>, M
47
49
  onPress,
48
50
  bgColor,
49
51
  textColor,
52
+ weight,
50
53
  shadowColor,
51
54
  hoverColor,
52
55
  ...props
@@ -209,7 +212,7 @@ export const MainButton = React.forwardRef<React.ElementRef<typeof Pressable>, M
209
212
  />
210
213
  )}
211
214
 
212
- <Typography style={textStyles}>
215
+ <Typography style={textStyles} weight={weight}>
213
216
  {children}
214
217
  </Typography>
215
218
  </Pressable>
@@ -4,14 +4,14 @@ import { theme } from '../styles/theme';
4
4
 
5
5
  export function useTheme() {
6
6
  const [isDark, setIsDark] = useState(() => {
7
- if (typeof window !== 'undefined') {
7
+ if (typeof document !== 'undefined') {
8
8
  return document.documentElement.classList.contains('dark-theme');
9
9
  }
10
10
  return Appearance.getColorScheme() === 'dark';
11
11
  });
12
12
 
13
13
  useEffect(() => {
14
- if (typeof window !== 'undefined') {
14
+ if (typeof document !== 'undefined') {
15
15
  const observer = new MutationObserver(() => {
16
16
  setIsDark(document.documentElement.classList.contains('dark-theme'));
17
17
  });
@@ -4,8 +4,8 @@ export const theme = {
4
4
  primary: '#f2974b', // CTAs, botão primário, destaque, progresso
5
5
  primaryDark: '#cf7a30', // Sombra do botão primário, ícone selecionado, hover
6
6
  primaryLight: '#fef6ee', // Fundo de item selecionado, chip ativo
7
-
8
- // Escala de castanho (neutros)
7
+
8
+ // Escala de castanho (neutros) Trigger para App
9
9
  brown: {
10
10
  900: '#15100d', // Cor máxima de contraste, textos ou superfícies em modo escuro
11
11
  800: '#51332d', // Texto principal, cabeçalhos e botões na variante invertida
@@ -17,17 +17,17 @@ export const theme = {
17
17
  100: '#efe2d6', // Bordas, separadores e sombra do botão secundário
18
18
  50: '#fdf3ea', // Fundo de cards, chips neutros, áreas de destaque leve
19
19
  },
20
-
20
+
21
21
  cream: '#fbf6f0', // Fundo de ecrãs secundários
22
22
  canvas: '#e7e5df', // Fundo do arquivo de design no Figma (não usado na app)
23
-
23
+
24
24
  // Semânticas & Base
25
25
  success: '#16915a', // Sucesso, acertos, módulos concluídos
26
26
  error: '#cf5b48', // Erro, campo inválido
27
27
  info: '#2a6fc2', // Informação, link
28
28
  black: '#000000', // Preto Xetwa
29
29
  white: '#ffffff', // Fundo principal de ecrãs, cards
30
-
30
+
31
31
  // Light Theme
32
32
  light: {
33
33
  bgApp: '#fbf6f0', // cream
@@ -41,7 +41,7 @@ export const theme = {
41
41
  glassBorder: 'rgba(255, 255, 255, 0.4)',
42
42
  primaryLight: '#fef6ee', // primaryLight
43
43
  },
44
-
44
+
45
45
  // Dark Theme
46
46
  dark: {
47
47
  bgApp: '#15100d', // brown-900
@@ -56,7 +56,7 @@ export const theme = {
56
56
  primaryLight: 'rgba(242, 151, 75, 0.15)', // transparent primary
57
57
  }
58
58
  },
59
-
59
+
60
60
  spacing: {
61
61
  // Relatório de espaçamento base 4px
62
62
  space1: 4,
@@ -79,7 +79,7 @@ export const theme = {
79
79
  xxl: 24,
80
80
  xxxl: 32,
81
81
  },
82
-
82
+
83
83
  radius: {
84
84
  xs: 6,
85
85
  sm: 10,
@@ -91,7 +91,7 @@ export const theme = {
91
91
  phone: 42,
92
92
  full: 9999,
93
93
  },
94
-
94
+
95
95
  shadows: {
96
96
  xs: {
97
97
  shadowColor: '#51332d',
@@ -154,12 +154,12 @@ export const theme = {
154
154
  elevation: 3,
155
155
  }
156
156
  },
157
-
157
+
158
158
  fonts: {
159
159
  title: 'Fredoka', // Fredoka – títulos
160
160
  body: 'Nunito', // Nunito – corpo e botões
161
161
  },
162
-
162
+
163
163
  typography: {
164
164
  display1: {
165
165
  fontFamily: 'Fredoka',
@@ -244,7 +244,7 @@ export const theme = {
244
244
  letterSpacing: 0.48,
245
245
  },
246
246
  },
247
-
247
+
248
248
  breakpoints: {
249
249
  xs: 0,
250
250
  sm: 375,
@@ -254,7 +254,7 @@ export const theme = {
254
254
  xxl: 1280,
255
255
  xxxl: 1440,
256
256
  },
257
-
257
+
258
258
  animations: {
259
259
  easings: {
260
260
  bounce: [0.34, 1.56, 0.64, 1] as [number, number, number, number],
@@ -268,7 +268,7 @@ export const theme = {
268
268
  slow: 500,
269
269
  }
270
270
  },
271
-
271
+
272
272
  layout: {
273
273
  mobileHeaderHeight: 52,
274
274
  mobileTabHeight: 56,