vpt-sebraeds 0.0.90 → 0.0.91

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.
Files changed (82) hide show
  1. package/README.md +116 -2
  2. package/components/Accordion/index.jsx +33 -34
  3. package/components/Input/InputUnderline.tsx +30 -34
  4. package/components/Input/index.jsx +75 -51
  5. package/components/NotificationDialog/index.jsx +26 -26
  6. package/components/SEText/index.d.ts +3 -1
  7. package/components/SEText/index.js +26 -43
  8. package/components/SEText/styles.js +15 -343
  9. package/components/Table/index.jsx +1 -1
  10. package/components/Typography/index.jsx +53 -125
  11. package/components/styles/fonts.js +10 -8
  12. package/components/styles/index,js +32 -2
  13. package/components/styles/tokens/borders.ts +13 -0
  14. package/components/styles/tokens/colors.ts +81 -0
  15. package/components/styles/tokens/elevations.ts +49 -0
  16. package/components/styles/tokens/index.ts +47 -0
  17. package/components/styles/tokens/opacity.ts +11 -0
  18. package/components/styles/tokens/palette.ts +86 -0
  19. package/components/styles/tokens/radius.ts +12 -0
  20. package/components/styles/tokens/spacing.ts +25 -0
  21. package/components/styles/tokens/surfaces.ts +28 -0
  22. package/components/styles/tokens/typography.ts +282 -0
  23. package/components/styles/tokens.ts +13 -217
  24. package/components/utils/fontFamily.js +6 -3
  25. package/dist/components/Accordion/index.d.ts +1 -1
  26. package/dist/components/Accordion/index.js +33 -34
  27. package/dist/components/Input/InputUnderline.d.ts.map +1 -1
  28. package/dist/components/Input/InputUnderline.js +30 -34
  29. package/dist/components/Input/index.d.ts.map +1 -1
  30. package/dist/components/Input/index.js +72 -49
  31. package/dist/components/NotificationDialog/index.js +26 -26
  32. package/dist/components/SEText/index.d.ts +1 -1
  33. package/dist/components/SEText/index.d.ts.map +1 -1
  34. package/dist/components/SEText/index.js +24 -39
  35. package/dist/components/SEText/styles.d.ts +236 -266
  36. package/dist/components/SEText/styles.js +11 -329
  37. package/dist/components/Table/index.js +1 -1
  38. package/dist/components/Typography/index.d.ts +2 -2
  39. package/dist/components/Typography/index.d.ts.map +1 -1
  40. package/dist/components/Typography/index.js +26 -98
  41. package/dist/components/styles/fonts.d.ts +8 -8
  42. package/dist/components/styles/fonts.js +9 -8
  43. package/dist/components/styles/tokens/borders.d.ts +14 -0
  44. package/dist/components/styles/tokens/borders.d.ts.map +1 -0
  45. package/dist/components/styles/tokens/borders.js +13 -0
  46. package/dist/components/styles/tokens/colors.d.ts +78 -0
  47. package/dist/components/styles/tokens/colors.d.ts.map +1 -0
  48. package/dist/components/styles/tokens/colors.js +79 -0
  49. package/dist/components/styles/tokens/elevations.d.ts +127 -0
  50. package/dist/components/styles/tokens/elevations.d.ts.map +1 -0
  51. package/dist/components/styles/tokens/elevations.js +47 -0
  52. package/dist/components/styles/tokens/index.d.ts +842 -0
  53. package/dist/components/styles/tokens/index.d.ts.map +1 -0
  54. package/dist/components/styles/tokens/index.js +28 -0
  55. package/dist/components/styles/tokens/opacity.d.ts +12 -0
  56. package/dist/components/styles/tokens/opacity.d.ts.map +1 -0
  57. package/dist/components/styles/tokens/opacity.js +11 -0
  58. package/dist/components/styles/tokens/palette.d.ts +86 -0
  59. package/dist/components/styles/tokens/palette.d.ts.map +1 -0
  60. package/dist/components/styles/tokens/palette.js +85 -0
  61. package/dist/components/styles/tokens/radius.d.ts +21 -0
  62. package/dist/components/styles/tokens/radius.d.ts.map +1 -0
  63. package/dist/components/styles/tokens/radius.js +11 -0
  64. package/dist/components/styles/tokens/spacing.d.ts +25 -0
  65. package/dist/components/styles/tokens/spacing.d.ts.map +1 -0
  66. package/dist/components/styles/tokens/spacing.js +24 -0
  67. package/dist/components/styles/tokens/surfaces.d.ts +27 -0
  68. package/dist/components/styles/tokens/surfaces.d.ts.map +1 -0
  69. package/dist/components/styles/tokens/surfaces.js +27 -0
  70. package/dist/components/styles/tokens/typography.d.ts +456 -0
  71. package/dist/components/styles/tokens/typography.d.ts.map +1 -0
  72. package/dist/components/styles/tokens/typography.js +259 -0
  73. package/dist/components/styles/tokens.d.ts +1 -259
  74. package/dist/components/styles/tokens.d.ts.map +1 -1
  75. package/dist/components/styles/tokens.js +1 -213
  76. package/dist/components/utils/fontFamily.d.ts +3 -0
  77. package/dist/components/utils/fontFamily.js +6 -3
  78. package/dist/src/index.d.ts +1 -0
  79. package/dist/src/index.d.ts.map +1 -1
  80. package/dist/src/index.js +1 -0
  81. package/package.json +1 -1
  82. package/src/index.ts +15 -0
package/README.md CHANGED
@@ -14,6 +14,21 @@
14
14
 
15
15
  Este é o repositório do Design System em React Native desenvolvido para o projeto Sebrae Na Palma da Mão. O objetivo é fornecer uma biblioteca de componentes reutilizáveis que seguem os padrões visuais e de interação do Sebrae, garantindo consistência e eficiência no desenvolvimento do aplicativo principal.
16
16
 
17
+ ## 🧭 Princípios do Design System
18
+
19
+ - **Composition Pattern**: componentes devem priorizar composição sobre herança, com subcomponentes acessados via `Parent.Child` quando fizer sentido.
20
+ - **Tokenização obrigatória**: cores, tipografia, surfaces, bordas, elevações e demais aspectos visuais devem nascer em `components/styles/tokens/`.
21
+ - **Sem hardcodes visuais estruturais**: componentes não devem declarar diretamente `color`, `backgroundColor`, `borderColor`, `fontFamily`, `fontSize`, `fontWeight`, `shadow*` ou `elevation` fora do sistema de tokens.
22
+ - **Tipografia centralizada**: a família atual é Nunito, com adaptação entre iOS e Android encapsulada no domínio de tipografia do Design System.
23
+
24
+ Referências diretas:
25
+
26
+ - Tokens por aspecto: [components/styles/tokens/](file:///Users/tegra/sebrae/storybook/dev/components/styles/tokens)
27
+ - Entry point compatível: [components/styles/tokens.ts](file:///Users/tegra/sebrae/storybook/dev/components/styles/tokens.ts)
28
+ - Tipografia centralizada: [typography.ts](file:///Users/tegra/sebrae/storybook/dev/components/styles/tokens/typography.ts)
29
+ - Texto padronizado: [SEText/index.js](file:///Users/tegra/sebrae/storybook/dev/components/SEText/index.js)
30
+ - Regras do projeto: [AGENTS.md](file:///Users/tegra/sebrae/storybook/dev/AGENTS.md)
31
+
17
32
  ## ✅ Requisitos
18
33
 
19
34
  - Node.js >= 18 ([package.json](file:///Users/tegra/sebrae/storybook/dev/package.json#L107-L109))
@@ -35,6 +50,12 @@ npm install
35
50
  - Histórias em `*.stories.(jsx|tsx)` ao lado de cada componente
36
51
  - Veja a lista completa em [components/](file:///Users/tegra/sebrae/storybook/dev/components) ou rode o Storybook
37
52
 
53
+ Padrão de construção esperado:
54
+
55
+ - Componentes novos devem seguir composição e contexto quando houver partes acopladas semanticamente.
56
+ - Tipografia deve ser aplicada com `SEText` ou via `tokens.textStyles`/`tokens.typography`.
57
+ - Estilos estáticos devem usar `StyleSheet.create` e tokens semânticos.
58
+
38
59
  Exemplos de componentes:
39
60
 
40
61
  - Accordion, Button, Checkbox, FilterTag, Input, Modal, Navbar, Pagination,
@@ -74,6 +95,96 @@ Cada componente possui sua própria história no Storybook, permitindo visualiza
74
95
  - Nativo: `storybook:ios` e `storybook:android`
75
96
  - Web: `storybook:web` ([@storybook/react-native-web-vite](file:///Users/tegra/sebrae/storybook/dev/package.json#L80-L83))
76
97
 
98
+ As stories devem refletir o contrato real dos componentes e demonstrar:
99
+
100
+ - Uso básico
101
+ - Variações semânticas
102
+ - Estados visuais importantes
103
+ - Exemplos aderentes aos tokens do projeto
104
+
105
+ ## 🎯 Tokens e Estilo
106
+
107
+ O projeto adota um sistema central de design tokens por aspecto. A estrutura atual fica em `components/styles/tokens/` e está organizada em módulos como:
108
+
109
+ - `palette`
110
+ - `colors`
111
+ - `surfaces`
112
+ - `elevations`
113
+ - `spacing` e `space`
114
+ - `typography`
115
+ - `radius`
116
+ - `borders`
117
+ - `opacity`
118
+
119
+ ### Como consumir
120
+
121
+ Entrada principal compatível:
122
+
123
+ ```tsx
124
+ import tokens from 'vpt-sebraeds/components/styles/tokens'
125
+ ```
126
+
127
+ Uso recomendado em componentes:
128
+
129
+ ```tsx
130
+ import { StyleSheet, View } from 'react-native'
131
+ import SEText from 'vpt-sebraeds/components/SEText'
132
+ import tokens from 'vpt-sebraeds/components/styles/tokens'
133
+
134
+ const styles = StyleSheet.create({
135
+ card: {
136
+ backgroundColor: tokens.colors.surface.default,
137
+ borderColor: tokens.colors.border.default,
138
+ borderRadius: tokens.radius.sm,
139
+ borderWidth: tokens.borders.width.thin,
140
+ padding: tokens.space.md,
141
+ ...tokens.elevations[1],
142
+ },
143
+ })
144
+
145
+ export function ExemploTokenizado() {
146
+ return (
147
+ <View style={styles.card}>
148
+ <SEText type="ns-heading-5">Título</SEText>
149
+ <SEText type="ns-sm-body" color={tokens.colors.text.secondary}>
150
+ Conteúdo seguindo os tokens do projeto
151
+ </SEText>
152
+ </View>
153
+ )
154
+ }
155
+ ```
156
+
157
+ ### Regras importantes
158
+
159
+ - Componentes devem consumir tokens semânticos, não `palette`.
160
+ - Se um valor visual ainda não existir, ele deve ser adicionado primeiro em `components/styles/tokens/`.
161
+ - A diferença tipográfica entre iOS e Android já está encapsulada em `tokens/typography.ts`.
162
+ - `colors.js`, `fonts.js` e utilitários antigos existem apenas como camadas de compatibilidade durante a migração.
163
+
164
+ ## 🧩 Composition Pattern
165
+
166
+ O padrão preferencial para novos componentes é composição. Quando um componente possui partes relacionadas entre si, ele deve expor subcomponentes e, se necessário, compartilhar configuração via Context.
167
+
168
+ Exemplo conceitual:
169
+
170
+ ```tsx
171
+ <Card>
172
+ <Card.Header>
173
+ <SEText type="ns-heading-5">Título</SEText>
174
+ </Card.Header>
175
+ <Card.Body>
176
+ <SEText type="ns-sm-body">Conteúdo</SEText>
177
+ </Card.Body>
178
+ </Card>
179
+ ```
180
+
181
+ Boas práticas:
182
+
183
+ - Expor partes via `Parent.Child`, e não como exports avulsos.
184
+ - Compartilhar estilos/configuração por Context quando isso reduzir acoplamento.
185
+ - Compor estilos na ordem `[baseStyle, contextStyle, propStyle]`.
186
+ - Evitar sobrecarga de props quando a composição resolve melhor a API.
187
+
77
188
  ## 🔗 Integração com o Projeto Principal
78
189
 
79
190
  Este Design System é um artefato do projeto principal [Sebrae Na Palma da Mão], um aplicativo móvel que funciona como uma agência do Sebrae na palma da mão. O aplicativo principal inclui diversas funcionalidades como:
@@ -202,6 +313,8 @@ yarn publish
202
313
  ## 🗂️ Estrutura do Projeto
203
314
 
204
315
  - `components/` – componentes e histórias
316
+ - `components/styles/tokens/` – design tokens por aspecto
317
+ - `components/styles/tokens.ts` – porta de entrada compatível para tokens
205
318
  - `src/` – ponto de entrada e exports da biblioteca
206
319
  - `assets/` – imagens, ícones e fontes
207
320
  - `.rnstorybook/` e `.storybook/` – configs de Storybook nativo e web
@@ -218,8 +331,9 @@ Antes de adicionar novos componentes ou fazer modificações:
218
331
  2. Adicione a documentação apropriada no Storybook
219
332
  3. Teste o componente em diferentes dispositivos
220
333
  4. Certifique-se de que as alterações não quebram a compatibilidade com o projeto principal
221
-
222
- 5. Mantenha o estilo de código (ESLint/Prettier) e exports em [src/index.ts](file:///Users/tegra/sebrae/storybook/dev/src/index.ts)
334
+ 5. Use tokens semânticos em vez de hardcodes visuais
335
+ 6. Adote composição quando a estrutura do componente pedir subpartes reutilizáveis
336
+ 7. Mantenha o estilo de código (ESLint/Prettier) e exports em [src/index.ts](file:///Users/tegra/sebrae/storybook/dev/src/index.ts)
223
337
  ## 📝 Licença
224
338
 
225
339
  Este projeto está sob a licença MIT.
@@ -3,7 +3,7 @@ import { View, TouchableOpacity, StyleSheet, Animated, LayoutAnimation, Platform
3
3
  import PropTypes from 'prop-types';
4
4
  import Icon from '../Icon';
5
5
  import SEText from '../SEText';
6
- import colors from '../styles/colors';
6
+ import tokens from '../styles/tokens';
7
7
 
8
8
  if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
9
9
  UIManager.setLayoutAnimationEnabledExperimental(true);
@@ -77,7 +77,7 @@ const AccordionHeader = ({
77
77
  overline,
78
78
  label,
79
79
  icon,
80
- backgroundColor = '#F7F9FF',
80
+ backgroundColor = tokens.colors.surface.subtle,
81
81
  style,
82
82
  titleStyle: customTitleStyle,
83
83
  ...props
@@ -105,30 +105,30 @@ const AccordionHeader = ({
105
105
  const getIconColor = () => {
106
106
  switch (variant) {
107
107
  case 'success':
108
- return colors.GREEN_DARK; // #037A1C
108
+ return tokens.colors.feedback.success;
109
109
  case 'alert':
110
- return "#AB6005"
110
+ return tokens.palette.yellow[700];
111
111
  case 'error':
112
- return colors.RED; // #d62828
112
+ return tokens.colors.feedback.error;
113
113
  default:
114
- return colors.SE_TEXT_DARK;
114
+ return tokens.colors.text.default;
115
115
  }
116
116
  };
117
117
 
118
118
  const getIconContainerBackgroundColor = () => {
119
119
  switch (variant) {
120
120
  case 'success':
121
- return '#C2EFD1';
121
+ return tokens.palette.green[200];
122
122
  case 'alert':
123
- return '#FEEBC8';
123
+ return tokens.palette.yellow[200];
124
124
  case 'error':
125
- return '#FCD5D5';
125
+ return tokens.palette.red[200];
126
126
  default:
127
127
  return 'transparent';
128
128
  }
129
129
  };
130
130
 
131
- const getTextColor = () => "#485274";
131
+ const getTextColor = () => tokens.colors.text.secondary;
132
132
 
133
133
  const isTransparent = !backgroundColor || backgroundColor === 'transparent' ||
134
134
  backgroundColor.toLowerCase() === '#ffffff' || backgroundColor.toLowerCase() === '#fff' ||
@@ -156,7 +156,7 @@ const AccordionHeader = ({
156
156
  styles.header,
157
157
  getVariantStyles(),
158
158
  isOpen && styles.headerOpen,
159
- isTransparent && !isOpen && { borderBottomWidth: 1, borderBottomColor: '#E2E9FC', borderBottomLeftRadius: 0, borderBottomRightRadius: 0 },
159
+ isTransparent && !isOpen && { borderBottomWidth: 1, borderBottomColor: tokens.colors.border.default, borderBottomLeftRadius: 0, borderBottomRightRadius: 0 },
160
160
  style
161
161
  ]}
162
162
  onPress={toggle}
@@ -187,7 +187,7 @@ const AccordionHeader = ({
187
187
  </View>
188
188
 
189
189
  <Animated.View style={{ transform: [{ rotate: rotateArrow }] }}>
190
- <Icon name="arrow-down-s-line" size={24} color="#485274" />
190
+ <Icon name="arrow-down-s-line" size={24} color={tokens.colors.text.secondary} />
191
191
  </Animated.View>
192
192
  </TouchableOpacity>
193
193
  );
@@ -208,7 +208,7 @@ const AccordionContent = ({ children, style, backgroundColor, ...props }) => {
208
208
  styles.content,
209
209
  styles.contentOpen,
210
210
  backgroundColor && { backgroundColor },
211
- isTransparent && { borderBottomWidth: 1, borderBottomColor: '#E2E9FC', borderBottomLeftRadius: 0, borderBottomRightRadius: 0 },
211
+ isTransparent && { borderBottomWidth: 1, borderBottomColor: tokens.colors.border.default, borderBottomLeftRadius: 0, borderBottomRightRadius: 0 },
212
212
  style
213
213
  ]}
214
214
  {...props}
@@ -221,16 +221,16 @@ const AccordionContent = ({ children, style, backgroundColor, ...props }) => {
221
221
  const styles = StyleSheet.create({
222
222
  container: {
223
223
  overflow: 'hidden',
224
- marginBottom: 8,
224
+ marginBottom: tokens.space.xs,
225
225
  },
226
226
  header: {
227
227
  flexDirection: 'row',
228
228
  alignItems: 'center',
229
229
  justifyContent: 'space-between',
230
- paddingVertical: 16,
231
- paddingHorizontal: 16,
232
- borderRadius: 8,
233
- backgroundColor: '#F7F9FF', // Default
230
+ paddingVertical: tokens.space.md,
231
+ paddingHorizontal: tokens.space.md,
232
+ borderRadius: tokens.radius.sm,
233
+ backgroundColor: tokens.colors.surface.subtle,
234
234
  },
235
235
  headerOpen: {
236
236
  borderBottomLeftRadius: 0,
@@ -242,9 +242,9 @@ const styles = StyleSheet.create({
242
242
  flex: 1,
243
243
  },
244
244
  leadingIconContainer: {
245
- padding: 4,
246
- borderRadius: 20,
247
- marginRight: 12,
245
+ padding: tokens.space.xxs,
246
+ borderRadius: tokens.radius.pill,
247
+ marginRight: tokens.space.sm,
248
248
  },
249
249
  leadingIcon: {
250
250
  // marginRight: 12, // Removed
@@ -254,23 +254,22 @@ const styles = StyleSheet.create({
254
254
  justifyContent: 'center',
255
255
  },
256
256
  title: {
257
- fontFamily: 'Nunito Sans',
257
+ color: tokens.colors.text.default,
258
258
  },
259
259
  overline: {
260
- fontSize: 12,
261
- fontFamily: 'Nunito Sans',
262
- marginBottom: 4,
260
+ fontSize: tokens.typography.fontSize.xxs,
261
+ marginBottom: tokens.space.xxs,
263
262
  textTransform: 'uppercase',
264
- letterSpacing: 0.5,
263
+ letterSpacing: tokens.typography.letterSpacing.wide,
265
264
  },
266
265
  label: {
267
- fontFamily: 'Nunito Sans',
266
+ color: tokens.colors.text.default,
268
267
  },
269
268
  content: {
270
- padding: 16,
271
- backgroundColor: '#FFFFFF',
272
- borderBottomLeftRadius: 8,
273
- borderBottomRightRadius: 8,
269
+ padding: tokens.space.md,
270
+ backgroundColor: tokens.colors.surface.default,
271
+ borderBottomLeftRadius: tokens.radius.sm,
272
+ borderBottomRightRadius: tokens.radius.sm,
274
273
  },
275
274
  contentOpen: {
276
275
  borderTopLeftRadius: 0,
@@ -284,17 +283,17 @@ const styles = StyleSheet.create({
284
283
  // borderBottomColor: '#E2E9FC',
285
284
  // },
286
285
  headerSuccess: {
287
- backgroundColor: '#F7F9FF',
286
+ backgroundColor: tokens.colors.surface.subtle,
288
287
  height: 40,
289
288
  paddingVertical: 0,
290
289
  },
291
290
  headerAlert: {
292
- backgroundColor: '#F7F9FF',
291
+ backgroundColor: tokens.colors.surface.subtle,
293
292
  height: 40,
294
293
  paddingVertical: 0,
295
294
  },
296
295
  headerError: {
297
- backgroundColor: '#F7F9FF',
296
+ backgroundColor: tokens.colors.surface.subtle,
298
297
  height: 40,
299
298
  paddingVertical: 0,
300
299
  },
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from 'react';
2
- import { View, TextInput, StyleSheet, TextInputProps, Platform } from 'react-native';
2
+ import { View, TextInput, StyleSheet, TextInputProps } from 'react-native';
3
3
  import SEText from '../SEText';
4
+ import tokens from '../styles/tokens';
4
5
 
5
6
  export interface InputTextProps extends TextInputProps {
6
7
  /**
@@ -69,7 +70,7 @@ const InputUnderline: React.FC<InputTextProps> = ({
69
70
  onFocus={handleFocus}
70
71
  onBlur={handleBlur}
71
72
  placeholder={placeholder}
72
- placeholderTextColor="#687499"
73
+ placeholderTextColor={tokens.colors.text.secondary}
73
74
  editable={!disabled}
74
75
  textAlignVertical="center"
75
76
  {...textInputProps}
@@ -84,28 +85,27 @@ const styles = StyleSheet.create({
84
85
  width: '100%',
85
86
  },
86
87
  label: {
87
- color: '#1F2937',
88
- marginBottom: 8,
88
+ color: tokens.colors.text.default,
89
+ marginBottom: tokens.space.xs,
89
90
  },
90
91
  labelDisabled: {
91
- color: '#9CA3AF',
92
+ color: tokens.colors.text.disabled,
92
93
  },
93
94
  container: {
94
95
  flexDirection: 'row',
95
96
  alignItems: 'baseline',
96
- // backgroundColor: '#F3F4F6',
97
- borderBottomWidth: 2,
98
- borderBottomColor: '#96ACFF',
97
+ borderBottomWidth: tokens.borders.width.regular,
98
+ borderBottomColor: tokens.colors.border.default,
99
99
  paddingHorizontal: 0,
100
- paddingVertical: 12,
100
+ paddingVertical: tokens.space.sm,
101
101
  minHeight: 56,
102
102
  },
103
103
  containerFocused: {
104
104
  flexDirection: 'row',
105
105
  alignItems: 'baseline',
106
- backgroundColor: '#FFFFFF',
107
- borderBottomWidth: 2,
108
- borderBottomColor: '#96ACFF',
106
+ backgroundColor: tokens.colors.background.default,
107
+ borderBottomWidth: tokens.borders.width.regular,
108
+ borderBottomColor: tokens.colors.border.focus,
109
109
  paddingHorizontal: 0,
110
110
  paddingVertical: 11,
111
111
  minHeight: 56,
@@ -113,48 +113,44 @@ const styles = StyleSheet.create({
113
113
  containerDisabled: {
114
114
  flexDirection: 'row',
115
115
  alignItems: 'baseline',
116
- // backgroundColor: '#F3F4F6',
117
- borderBottomWidth: 2,
118
- borderBottomColor: '#E5E7EB',
116
+ borderBottomWidth: tokens.borders.width.regular,
117
+ borderBottomColor: tokens.colors.border.disabled,
119
118
  paddingHorizontal: 0,
120
- paddingVertical: 12,
119
+ paddingVertical: tokens.space.sm,
121
120
  minHeight: 56,
122
121
  },
123
122
  input: {
124
123
  flex: 1,
125
- fontSize: 24,
126
- color: '#687499',
124
+ fontSize: tokens.typography.fontSize['2xl'],
125
+ lineHeight: tokens.typography.lineHeight.xl,
126
+ color: tokens.colors.text.secondary,
127
127
  padding: 0,
128
128
  margin: 0,
129
129
  includeFontPadding: false,
130
- ...Platform.select({
131
- ios: { fontFamily: 'Nunito Sans 10pt Regular' },
132
- android: { fontFamily: 'NunitoSans_10pt-Regular' },
133
- }),
130
+ fontFamily: tokens.typography.fontFamily.regular,
131
+ fontWeight: tokens.typography.fontWeight.regular,
134
132
  },
135
133
  inputFilled: {
136
134
  flex: 1,
137
- fontSize: 24,
138
- color: '#1B244B',
135
+ fontSize: tokens.typography.fontSize['2xl'],
136
+ lineHeight: tokens.typography.lineHeight.xl,
137
+ color: tokens.colors.text.brand,
139
138
  padding: 0,
140
139
  margin: 0,
141
140
  includeFontPadding: false,
142
- ...Platform.select({
143
- ios: { fontFamily: 'Nunito Sans 10pt Regular' },
144
- android: { fontFamily: 'NunitoSans_10pt-Regular' },
145
- }),
141
+ fontFamily: tokens.typography.fontFamily.regular,
142
+ fontWeight: tokens.typography.fontWeight.regular,
146
143
  },
147
144
  inputDisabled: {
148
145
  flex: 1,
149
- fontSize: 16,
150
- color: '#9CA3AF',
146
+ fontSize: tokens.typography.fontSize.md,
147
+ lineHeight: tokens.typography.lineHeight.md,
148
+ color: tokens.colors.text.disabled,
151
149
  padding: 0,
152
150
  margin: 0,
153
151
  includeFontPadding: false,
154
- ...Platform.select({
155
- ios: { fontFamily: 'Nunito Sans 10pt Regular' },
156
- android: { fontFamily: 'NunitoSans_10pt-Regular' },
157
- }),
152
+ fontFamily: tokens.typography.fontFamily.regular,
153
+ fontWeight: tokens.typography.fontWeight.regular,
158
154
  },
159
155
  });
160
156
 
@@ -4,7 +4,23 @@ import Icon from '../Icon';
4
4
  import TooltipCard from '../TooltipCard';
5
5
  import SEText from '../SEText';
6
6
  import InputUnderline from './InputUnderline';
7
- import { fontFamily } from '../utils/fontFamily';
7
+ import tokens from '../styles/tokens';
8
+
9
+ const INPUT_COLORS = {
10
+ labelDefault: tokens.colors.text.default,
11
+ labelMuted: tokens.colors.text.disabled,
12
+ labelInfo: tokens.colors.text.secondary,
13
+ placeholder: tokens.colors.text.disabled,
14
+ borderDefault: tokens.colors.border.default,
15
+ borderFocus: tokens.colors.border.focus,
16
+ borderError: tokens.colors.border.error,
17
+ borderSuccess: tokens.colors.border.success,
18
+ borderDisabled: tokens.colors.border.subtle,
19
+ supportInfo: tokens.colors.state.focus,
20
+ supportSuccess: tokens.colors.feedback.success,
21
+ supportError: tokens.colors.feedback.error,
22
+ iconInfo: tokens.colors.text.secondary,
23
+ };
8
24
 
9
25
  /**
10
26
  * Componente de Input controlado e reutilizável com suporte a máscaras e estados de validação.
@@ -126,10 +142,10 @@ const Input = React.forwardRef((
126
142
  };
127
143
 
128
144
  const getLabelColor = () => {
129
- if (disabled) return '#96A1C1';
130
- if (error) return '#FF4D4F';
131
- if (success) return '#52C41A';
132
- return '#333333';
145
+ if (disabled) return INPUT_COLORS.labelMuted;
146
+ if (error) return INPUT_COLORS.supportError;
147
+ if (success) return INPUT_COLORS.supportSuccess;
148
+ return INPUT_COLORS.labelDefault;
133
149
  };
134
150
 
135
151
  const getInputStyle = () => {
@@ -140,10 +156,10 @@ const Input = React.forwardRef((
140
156
  };
141
157
 
142
158
  const getSupportTextColor = () => {
143
- if (error) return '#FF4D4F';
144
- if (success) return '#52C41A';
145
- if (disabled) return '#96A1C1';
146
- return '#4F7CFE';
159
+ if (error) return INPUT_COLORS.supportError;
160
+ if (success) return INPUT_COLORS.supportSuccess;
161
+ if (disabled) return INPUT_COLORS.labelMuted;
162
+ return INPUT_COLORS.supportInfo;
147
163
  };
148
164
 
149
165
  if (variant === 'underline') {
@@ -152,10 +168,10 @@ const Input = React.forwardRef((
152
168
 
153
169
  const getLabelIconColor = () => {
154
170
  if (labelIconColor) return labelIconColor;
155
- if (disabled) return '#96A1C1';
156
- if (error) return '#FF4D4F';
157
- if (success) return '#52C41A';
158
- return '#687499';
171
+ if (disabled) return INPUT_COLORS.labelMuted;
172
+ if (error) return INPUT_COLORS.supportError;
173
+ if (success) return INPUT_COLORS.supportSuccess;
174
+ return INPUT_COLORS.labelInfo;
159
175
  };
160
176
 
161
177
  const renderLabel = () => {
@@ -203,21 +219,21 @@ const Input = React.forwardRef((
203
219
  editable={!disabled}
204
220
  keyboardType={getKeyboardType()}
205
221
  maxLength={getMaxLength()}
206
- placeholderTextColor="#BFBFBF"
222
+ placeholderTextColor={INPUT_COLORS.placeholder}
207
223
  {...textInputProps}
208
224
  />
209
225
  {showInfoIcon && !disabled && tooltipProps ? (
210
226
  <TooltipCard
211
227
  {...tooltipProps}
212
228
  trigger={
213
- <Icon name="information-line" size={20} color="#687499" />
229
+ <Icon name="information-line" size={20} color={INPUT_COLORS.iconInfo} />
214
230
  }
215
231
  />
216
232
  ) : showInfoIcon && !disabled && (
217
- <Icon name="information-line" size={20} color="#687499" />
233
+ <Icon name="information-line" size={20} color={INPUT_COLORS.iconInfo} />
218
234
  )}
219
- {error && <Icon name="close-line" size={20} color="#FF4D4F" />}
220
- {success && <Icon name="check-line" size={20} color="#52C41A" />}
235
+ {error && <Icon name="close-line" size={20} color={INPUT_COLORS.supportError} />}
236
+ {success && <Icon name="check-line" size={20} color={INPUT_COLORS.supportSuccess} />}
221
237
  </View>
222
238
  {supportText && <SEText type="ns-xs-body" color={getSupportTextColor()}>{supportText}</SEText>}
223
239
  </View>
@@ -240,71 +256,79 @@ const styles = StyleSheet.create({
240
256
  container: {
241
257
  flexDirection: 'row',
242
258
  alignItems: 'center',
243
- borderWidth: 2,
244
- borderColor: '#96ACFF',
245
- borderRadius: 8,
246
- paddingHorizontal: 12,
259
+ borderWidth: tokens.borders.width.regular,
260
+ borderColor: INPUT_COLORS.borderDefault,
261
+ borderRadius: tokens.radius.sm,
262
+ paddingHorizontal: tokens.space.sm,
247
263
  },
248
264
  containerFocused: {
249
265
  flexDirection: 'row',
250
266
  alignItems: 'center',
251
- borderWidth: 2,
252
- borderColor: '#4F7CFE',
253
- borderRadius: 8,
254
- paddingHorizontal: 12,
267
+ borderWidth: tokens.borders.width.regular,
268
+ borderColor: INPUT_COLORS.borderFocus,
269
+ borderRadius: tokens.radius.sm,
270
+ paddingHorizontal: tokens.space.sm,
255
271
  },
256
272
  containerError: {
257
273
  flexDirection: 'row',
258
274
  alignItems: 'center',
259
- borderWidth: 2,
260
- borderColor: '#FF4D4F',
261
- borderRadius: 8,
262
- paddingHorizontal: 12,
275
+ borderWidth: tokens.borders.width.regular,
276
+ borderColor: INPUT_COLORS.borderError,
277
+ borderRadius: tokens.radius.sm,
278
+ paddingHorizontal: tokens.space.sm,
263
279
  },
264
280
  containerSuccess: {
265
281
  flexDirection: 'row',
266
282
  alignItems: 'center',
267
- borderWidth: 2,
268
- borderColor: '#52C41A',
269
- borderRadius: 8,
270
- paddingHorizontal: 12,
283
+ borderWidth: tokens.borders.width.regular,
284
+ borderColor: INPUT_COLORS.borderSuccess,
285
+ borderRadius: tokens.radius.sm,
286
+ paddingHorizontal: tokens.space.sm,
271
287
  },
272
288
  containerDisabled: {
273
289
  flexDirection: 'row',
274
290
  alignItems: 'center',
275
- borderWidth: 2,
276
- borderColor: '#E6EEFF',
277
- borderRadius: 8,
278
- paddingHorizontal: 12,
291
+ borderWidth: tokens.borders.width.regular,
292
+ borderColor: INPUT_COLORS.borderDisabled,
293
+ borderRadius: tokens.radius.sm,
294
+ paddingHorizontal: tokens.space.sm,
279
295
  },
280
296
  input: {
281
297
  flex: 1,
282
298
  height: 40,
283
- color: '#333333',
284
- fontSize: 14,
285
- fontFamily: fontFamily.regular,
299
+ color: INPUT_COLORS.labelDefault,
300
+ fontSize: tokens.typography.fontSize.sm,
301
+ lineHeight: tokens.typography.lineHeight.sm,
302
+ fontFamily: tokens.typography.fontFamily.regular,
303
+ fontWeight: tokens.typography.fontWeight.regular,
286
304
  },
287
305
  inputError: {
288
306
  flex: 1,
289
307
  height: 40,
290
- color: '#FF4D4F',
291
- fontSize: 14,
292
- fontFamily: fontFamily.regular,
308
+ color: INPUT_COLORS.supportError,
309
+ fontSize: tokens.typography.fontSize.sm,
310
+ lineHeight: tokens.typography.lineHeight.sm,
311
+ fontFamily: tokens.typography.fontFamily.regular,
312
+ fontWeight: tokens.typography.fontWeight.regular,
293
313
  },
294
314
  inputSuccess: {
295
315
  flex: 1,
296
316
  height: 40,
297
- color: '#52C41A',
298
- fontSize: 14,
299
- fontFamily: fontFamily.regular,
317
+ color: INPUT_COLORS.supportSuccess,
318
+ fontSize: tokens.typography.fontSize.sm,
319
+ lineHeight: tokens.typography.lineHeight.sm,
320
+ fontFamily: tokens.typography.fontFamily.regular,
321
+ fontWeight: tokens.typography.fontWeight.regular,
300
322
  },
301
323
  inputDisabled: {
302
324
  flex: 1,
303
325
  height: 40,
304
- color: '#687499',
305
- fontSize: 14,
306
- fontFamily: fontFamily.regular,
326
+ color: INPUT_COLORS.labelInfo,
327
+ fontSize: tokens.typography.fontSize.sm,
328
+ lineHeight: tokens.typography.lineHeight.sm,
329
+ fontFamily: tokens.typography.fontFamily.regular,
330
+ fontWeight: tokens.typography.fontWeight.regular,
307
331
  },
308
332
  });
309
333
 
310
- export default Input;
334
+ export default Input;