vpt-sebraeds 0.0.92 → 0.0.94
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/README.md +5 -5
- package/assets/fonts/Figtree-Black.ttf +0 -0
- package/assets/fonts/Figtree-BlackItalic.ttf +0 -0
- package/assets/fonts/Figtree-Bold.ttf +0 -0
- package/assets/fonts/Figtree-BoldItalic.ttf +0 -0
- package/assets/fonts/Figtree-ExtraBold.ttf +0 -0
- package/assets/fonts/Figtree-ExtraBoldItalic.ttf +0 -0
- package/assets/fonts/Figtree-Italic.ttf +0 -0
- package/assets/fonts/Figtree-Light.ttf +0 -0
- package/assets/fonts/Figtree-LightItalic.ttf +0 -0
- package/assets/fonts/Figtree-Medium.ttf +0 -0
- package/assets/fonts/Figtree-MediumItalic.ttf +0 -0
- package/assets/fonts/Figtree-Regular.ttf +0 -0
- package/assets/fonts/Figtree-SemiBold.ttf +0 -0
- package/assets/fonts/Figtree-SemiBoldItalic.ttf +0 -0
- package/components/Accordion/README.md +1 -1
- package/components/CNAESelectItem/padrao.js +1 -1
- package/components/Card/index.jsx +190 -190
- package/components/Checkbox/index.jsx +1 -1
- package/components/FilterableMultiSelect/index.jsx +2 -2
- package/components/FilterableUniSelect/index.jsx +2 -2
- package/components/Header/v2/README.md +5 -5
- package/components/ListItem/index.jsx +12 -12
- package/components/NumberDisplay/index.jsx +8 -8
- package/components/Spacer/index.jsx +10 -0
- package/components/TaggedInputText/index.jsx +1 -1
- package/components/TaskCard/index.jsx +1 -1
- package/components/Templates/Loading/Icons/index.jsx +115 -2
- package/components/Templates/StatusFeedback/Icons/index.jsx +6 -4
- package/components/Templates/StatusFeedback/assets/not-found.svg +3 -2
- package/components/Templates/StatusFeedback/index.jsx +9 -5
- package/components/Typography/SEText/index.js +1 -1
- package/components/styles/tokens/colors.ts +2 -0
- package/components/styles/tokens/palette.ts +4 -4
- package/components/styles/tokens/typography.ts +18 -13
- package/dist/assets/fonts/Figtree-Black.ttf +0 -0
- package/dist/assets/fonts/Figtree-BlackItalic.ttf +0 -0
- package/dist/assets/fonts/Figtree-Bold.ttf +0 -0
- package/dist/assets/fonts/Figtree-BoldItalic.ttf +0 -0
- package/dist/assets/fonts/Figtree-ExtraBold.ttf +0 -0
- package/dist/assets/fonts/Figtree-ExtraBoldItalic.ttf +0 -0
- package/dist/assets/fonts/Figtree-Italic.ttf +0 -0
- package/dist/assets/fonts/Figtree-Light.ttf +0 -0
- package/dist/assets/fonts/Figtree-LightItalic.ttf +0 -0
- package/dist/assets/fonts/Figtree-Medium.ttf +0 -0
- package/dist/assets/fonts/Figtree-MediumItalic.ttf +0 -0
- package/dist/assets/fonts/Figtree-Regular.ttf +0 -0
- package/dist/assets/fonts/Figtree-SemiBold.ttf +0 -0
- package/dist/assets/fonts/Figtree-SemiBoldItalic.ttf +0 -0
- package/dist/components/CNAESelectItem/padrao.js +1 -1
- package/dist/components/Card/index.js +16 -16
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/FilterableMultiSelect/index.js +2 -2
- package/dist/components/FilterableUniSelect/index.js +2 -2
- package/dist/components/ListItem/index.js +12 -12
- package/dist/components/NumberDisplay/index.js +8 -8
- package/dist/components/SEText/index.js +114 -114
- package/dist/components/Search/Search.js +7 -7
- package/dist/components/Spacer/index.d.ts +3 -0
- package/dist/components/Spacer/index.d.ts.map +1 -0
- package/dist/components/Spacer/index.js +9 -0
- package/dist/components/TaggedInputText/index.js +1 -1
- package/dist/components/TaskCard/index.js +1 -1
- package/dist/components/Templates/Loading/Icons/index.d.ts.map +1 -1
- package/dist/components/Templates/Loading/Icons/index.js +115 -2
- package/dist/components/Templates/StatusFeedback/Icons/index.d.ts.map +1 -1
- package/dist/components/Templates/StatusFeedback/Icons/index.js +6 -4
- package/dist/components/Templates/StatusFeedback/assets/not-found.svg +3 -2
- package/dist/components/Templates/StatusFeedback/index.d.ts.map +1 -1
- package/dist/components/Templates/StatusFeedback/index.js +9 -5
- package/dist/components/Typography/SEText/index.js +1 -1
- package/dist/components/styles/tokens/colors.d.ts +5 -3
- package/dist/components/styles/tokens/colors.d.ts.map +1 -1
- package/dist/components/styles/tokens/colors.js +2 -0
- package/dist/components/styles/tokens/index.d.ts +9 -7
- package/dist/components/styles/tokens/index.d.ts.map +1 -1
- package/dist/components/styles/tokens/palette.d.ts +4 -4
- package/dist/components/styles/tokens/palette.js +4 -4
- package/dist/components/styles/tokens/typography.d.ts.map +1 -1
- package/dist/components/styles/tokens/typography.js +18 -13
- package/package.json +1 -1
- package/assets/fonts/Campuni-Bold.ttf +0 -0
- package/assets/fonts/Campuni-Regular.ttf +0 -0
- package/assets/fonts/Campuni.ttf +0 -0
- package/assets/fonts/Mulish-Bold.ttf +0 -0
- package/assets/fonts/Mulish-Light.ttf +0 -0
- package/assets/fonts/Mulish-Regular.ttf +0 -0
- package/assets/fonts/Mulish-SemiBold.ttf +0 -0
- package/assets/fonts/Mulish.ttf +0 -0
- package/assets/fonts/NunitoSans_10pt-Black.ttf +0 -0
- package/assets/fonts/NunitoSans_10pt-Bold.ttf +0 -0
- package/assets/fonts/NunitoSans_10pt-Light.ttf +0 -0
- package/assets/fonts/NunitoSans_10pt-Medium.ttf +0 -0
- package/assets/fonts/NunitoSans_10pt-Regular.ttf +0 -0
- package/dist/assets/fonts/Campuni-Bold.ttf +0 -0
- package/dist/assets/fonts/Campuni-Regular.ttf +0 -0
- package/dist/assets/fonts/Campuni.ttf +0 -0
- package/dist/assets/fonts/Mulish-Bold.ttf +0 -0
- package/dist/assets/fonts/Mulish-Light.ttf +0 -0
- package/dist/assets/fonts/Mulish-Regular.ttf +0 -0
- package/dist/assets/fonts/Mulish-SemiBold.ttf +0 -0
- package/dist/assets/fonts/Mulish.ttf +0 -0
- package/dist/assets/fonts/NunitoSans_10pt-Black.ttf +0 -0
- package/dist/assets/fonts/NunitoSans_10pt-Bold.ttf +0 -0
- package/dist/assets/fonts/NunitoSans_10pt-Light.ttf +0 -0
- package/dist/assets/fonts/NunitoSans_10pt-Medium.ttf +0 -0
- package/dist/assets/fonts/NunitoSans_10pt-Regular.ttf +0 -0
package/README.md
CHANGED
|
@@ -19,15 +19,15 @@ Este é o repositório do Design System em React Native desenvolvido para o proj
|
|
|
19
19
|
- **Composition Pattern**: componentes devem priorizar composição sobre herança, com subcomponentes acessados via `Parent.Child` quando fizer sentido.
|
|
20
20
|
- **Tokenização obrigatória**: cores, tipografia, surfaces, bordas, elevações e demais aspectos visuais devem nascer em `components/styles/tokens/`.
|
|
21
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 é
|
|
22
|
+
- **Tipografia centralizada**: a família atual é Figtree, com adaptação entre iOS e Android encapsulada no domínio de tipografia do Design System.
|
|
23
23
|
|
|
24
24
|
Referências diretas:
|
|
25
25
|
|
|
26
26
|
- Tokens por aspecto: [components/styles/tokens/](file:///Users/tegra/sebrae/storybook/dev/components/styles/tokens)
|
|
27
27
|
- Entry point compatível: [components/styles/tokens.ts](file:///Users/tegra/sebrae/storybook/dev/components/styles/tokens.ts)
|
|
28
28
|
- Tipografia centralizada: [typography.ts](file:///Users/tegra/sebrae/storybook/dev/components/styles/tokens/typography.ts)
|
|
29
|
-
- Texto padronizado: [RichText/index.js](file:///Users/tegra/sebrae/storybook/dev/components/RichText/index.js)
|
|
30
|
-
- Base compatível de tipografia: [SEText/index.js](file:///Users/tegra/sebrae/storybook/dev/components/SEText/index.js)
|
|
29
|
+
- Texto padronizado: [Typography/RichText/index.js](file:///Users/tegra/sebrae/storybook/dev/components/Typography/RichText/index.js)
|
|
30
|
+
- Base compatível de tipografia: [Typography/SEText/index.js](file:///Users/tegra/sebrae/storybook/dev/components/Typography/SEText/index.js)
|
|
31
31
|
- Regras do projeto: [AGENTS.md](file:///Users/tegra/sebrae/storybook/dev/AGENTS.md)
|
|
32
32
|
|
|
33
33
|
## ✅ Requisitos
|
|
@@ -130,7 +130,7 @@ Uso recomendado em componentes:
|
|
|
130
130
|
|
|
131
131
|
```tsx
|
|
132
132
|
import { StyleSheet, View } from 'react-native'
|
|
133
|
-
import RichText from 'vpt-sebraeds/components/RichText'
|
|
133
|
+
import RichText from 'vpt-sebraeds/components/Typography/RichText'
|
|
134
134
|
import tokens from 'vpt-sebraeds/components/styles/tokens'
|
|
135
135
|
|
|
136
136
|
const styles = StyleSheet.create({
|
|
@@ -244,7 +244,7 @@ Observação: nesta biblioteca, o campo "name" é `vpt-sebraeds`.
|
|
|
244
244
|
|
|
245
245
|
Dependências e pós-instalação:
|
|
246
246
|
- Instale todos os peerDependencies declarados pelo Design System (ex.: react, react-dom, bibliotecas de estilo/animação se aplicável). Verifique o `package.json` do repositório.
|
|
247
|
-
- Configure a fonte
|
|
247
|
+
- Configure a fonte Figtree no app consumidor. Veja [FONTES_CONFIGURACAO.md](file:///Users/tegra/sebrae/storybook/dev/FONTES_CONFIGURACAO.md).
|
|
248
248
|
|
|
249
249
|
Exemplo de uso:
|
|
250
250
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -15,7 +15,7 @@ Referências diretas no código:
|
|
|
15
15
|
**Novidades:**
|
|
16
16
|
- **Padrão de Composição (Recomendado)**: Maior flexibilidade para personalizar cabeçalho e conteúdo.
|
|
17
17
|
- **Variantes de Estado**: Suporte visual nativo para estados de `success`, `alert` e `error`.
|
|
18
|
-
- **Tipografia Atualizada**: Uso de tokens `ns-*` (
|
|
18
|
+
- **Tipografia Atualizada**: Uso de tokens `ns-*` (Figtree) via `SEText`.
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -1126,7 +1126,7 @@ const styles = StyleSheet.create({
|
|
|
1126
1126
|
|
|
1127
1127
|
bottomSearchInputText: {
|
|
1128
1128
|
fontSize: 16,
|
|
1129
|
-
fontFamily: Platform.OS === 'ios' ? '
|
|
1129
|
+
fontFamily: Platform.OS === 'ios' ? 'Figtree-Regular' : 'Figtree-Regular',
|
|
1130
1130
|
},
|
|
1131
1131
|
|
|
1132
1132
|
loadingContainer: {
|
|
@@ -1,190 +1,190 @@
|
|
|
1
|
-
import React, { createContext, useContext, useMemo } from 'react';
|
|
2
|
-
import { View, Text, Platform } from 'react-native';
|
|
3
|
-
import RemixIcon from 'react-native-remix-icon';
|
|
4
|
-
|
|
5
|
-
// ==================== CONTEXT ====================
|
|
6
|
-
|
|
7
|
-
const CardContext = createContext(null);
|
|
8
|
-
|
|
9
|
-
const useCardContext = () => {
|
|
10
|
-
const context = useContext(CardContext);
|
|
11
|
-
if (!context) {
|
|
12
|
-
throw new Error('Card compound components must be used within Card');
|
|
13
|
-
}
|
|
14
|
-
return context;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// ==================== SUB-COMPONENTS ====================
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Card.IconBadge - Sub-componente para o ícone com container
|
|
21
|
-
*
|
|
22
|
-
* @param {string} name - Nome do ícone RemixIcon (default: 'file-edit-line')
|
|
23
|
-
* @param {number} iconSize - Tamanho do ícone (default: 17)
|
|
24
|
-
* @param {string} iconColor - Cor do ícone (default: '#96A1C1')
|
|
25
|
-
* @param {number} containerSize - Tamanho do container (default: 32)
|
|
26
|
-
* @param {string} backgroundColor - Cor de fundo do container (default: '#F1F4FF')
|
|
27
|
-
* @param {number} borderRadius - Raio da borda do container (default: 6)
|
|
28
|
-
* @param {object} style - Estilo customizado do wrapper
|
|
29
|
-
* @param {object} containerStyle - Estilo customizado do container
|
|
30
|
-
*/
|
|
31
|
-
const IconBadge = ({
|
|
32
|
-
name = 'file-edit-line',
|
|
33
|
-
iconSize = 17,
|
|
34
|
-
iconColor = '#96A1C1',
|
|
35
|
-
containerSize = 32,
|
|
36
|
-
backgroundColor = '#F1F4FF',
|
|
37
|
-
borderRadius = 6,
|
|
38
|
-
style,
|
|
39
|
-
containerStyle,
|
|
40
|
-
}) => {
|
|
41
|
-
const { iconStyle: contextIconStyle } = useCardContext();
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<View style={[{ marginBottom: 24 }, contextIconStyle, style]}>
|
|
45
|
-
<View
|
|
46
|
-
style={[
|
|
47
|
-
{
|
|
48
|
-
width: containerSize,
|
|
49
|
-
height: containerSize,
|
|
50
|
-
backgroundColor,
|
|
51
|
-
borderRadius,
|
|
52
|
-
alignItems: 'center',
|
|
53
|
-
justifyContent: 'center',
|
|
54
|
-
},
|
|
55
|
-
containerStyle,
|
|
56
|
-
]}
|
|
57
|
-
>
|
|
58
|
-
<RemixIcon name={name} size={iconSize} color={iconColor} />
|
|
59
|
-
</View>
|
|
60
|
-
</View>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Card.Title - Sub-componente para o título
|
|
66
|
-
*/
|
|
67
|
-
const Title = ({ children, style }) => {
|
|
68
|
-
const { titleStyle: contextTitleStyle } = useCardContext();
|
|
69
|
-
|
|
70
|
-
const baseStyle = {
|
|
71
|
-
fontSize: 18,
|
|
72
|
-
lineHeight: 28,
|
|
73
|
-
letterSpacing: 0,
|
|
74
|
-
color: '#1B244B',
|
|
75
|
-
...Platform.select({
|
|
76
|
-
ios: { fontFamily: '
|
|
77
|
-
android: { fontFamily: '
|
|
78
|
-
}),
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<Text style={[baseStyle, contextTitleStyle, style]}>
|
|
83
|
-
{children}
|
|
84
|
-
</Text>
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Card.Description - Sub-componente para a descrição
|
|
90
|
-
*/
|
|
91
|
-
const Description = ({ children, style }) => {
|
|
92
|
-
const { descriptionStyle: contextDescriptionStyle } = useCardContext();
|
|
93
|
-
|
|
94
|
-
const baseStyle = {
|
|
95
|
-
fontSize: 14,
|
|
96
|
-
lineHeight: 20,
|
|
97
|
-
letterSpacing: 0,
|
|
98
|
-
color: '#485274',
|
|
99
|
-
marginTop: 8,
|
|
100
|
-
...Platform.select({
|
|
101
|
-
ios: { fontFamily: '
|
|
102
|
-
android: { fontFamily: '
|
|
103
|
-
}),
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<Text style={[baseStyle, contextDescriptionStyle, style]}>
|
|
108
|
-
{children}
|
|
109
|
-
</Text>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
// ==================== MAIN COMPONENT ====================
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Card
|
|
117
|
-
*
|
|
118
|
-
* Componente de card com Composition Pattern.
|
|
119
|
-
*
|
|
120
|
-
* Uso:
|
|
121
|
-
* <Card>
|
|
122
|
-
* <Card.IconBadge name="file-edit-line" />
|
|
123
|
-
* <Card.Title>Lorem ipsum dolor sit amet</Card.Title>
|
|
124
|
-
* <Card.Description>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Card.Description>
|
|
125
|
-
* </Card>
|
|
126
|
-
*
|
|
127
|
-
* IconBadge Props:
|
|
128
|
-
* - name: Nome do ícone RemixIcon (default: 'file-edit-line')
|
|
129
|
-
* - iconSize: Tamanho do ícone (default: 17)
|
|
130
|
-
* - iconColor: Cor do ícone (default: '#96A1C1')
|
|
131
|
-
* - containerSize: Tamanho do container (default: 32)
|
|
132
|
-
* - backgroundColor: Cor de fundo do container (default: '#F1F4FF')
|
|
133
|
-
* - borderRadius: Raio da borda do container (default: 6)
|
|
134
|
-
*
|
|
135
|
-
* Card Props:
|
|
136
|
-
* @param {object} style - Estilo customizado do container
|
|
137
|
-
* @param {object} iconStyle - Estilo customizado para o wrapper do ícone
|
|
138
|
-
* @param {object} titleStyle - Estilo customizado para o título
|
|
139
|
-
* @param {object} descriptionStyle - Estilo customizado para a descrição
|
|
140
|
-
* @param {number} minHeight - Altura mínima do card (default: 144)
|
|
141
|
-
* @param {string} borderColor - Cor da borda (default: #E2E9FC)
|
|
142
|
-
* @param {number} borderWidth - Largura da borda (default: 1.5)
|
|
143
|
-
* @param {number} borderRadius - Raio da borda (default: 8)
|
|
144
|
-
* @param {string} backgroundColor - Cor de fundo (default: #FFFFFF)
|
|
145
|
-
*/
|
|
146
|
-
const Card = ({
|
|
147
|
-
children,
|
|
148
|
-
style,
|
|
149
|
-
iconStyle,
|
|
150
|
-
titleStyle,
|
|
151
|
-
descriptionStyle,
|
|
152
|
-
minHeight = 144,
|
|
153
|
-
borderColor = '#E2E9FC',
|
|
154
|
-
borderWidth = 1.5,
|
|
155
|
-
borderRadius = 8,
|
|
156
|
-
backgroundColor = '#FFFFFF',
|
|
157
|
-
}) => {
|
|
158
|
-
// Contexto para sub-componentes
|
|
159
|
-
const contextValue = useMemo(() => ({
|
|
160
|
-
iconStyle,
|
|
161
|
-
titleStyle,
|
|
162
|
-
descriptionStyle,
|
|
163
|
-
}), [iconStyle, titleStyle, descriptionStyle]);
|
|
164
|
-
|
|
165
|
-
// Container style
|
|
166
|
-
const containerStyle = {
|
|
167
|
-
width: '100%',
|
|
168
|
-
minHeight,
|
|
169
|
-
borderRadius,
|
|
170
|
-
borderWidth,
|
|
171
|
-
borderColor,
|
|
172
|
-
backgroundColor,
|
|
173
|
-
padding: 16,
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
return (
|
|
177
|
-
<CardContext.Provider value={contextValue}>
|
|
178
|
-
<View style={[containerStyle, style]}>
|
|
179
|
-
{children}
|
|
180
|
-
</View>
|
|
181
|
-
</CardContext.Provider>
|
|
182
|
-
);
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
// Anexa sub-componentes
|
|
186
|
-
Card.IconBadge = IconBadge;
|
|
187
|
-
Card.Title = Title;
|
|
188
|
-
Card.Description = Description;
|
|
189
|
-
|
|
190
|
-
export default Card;
|
|
1
|
+
import React, { createContext, useContext, useMemo } from 'react';
|
|
2
|
+
import { View, Text, Platform } from 'react-native';
|
|
3
|
+
import RemixIcon from 'react-native-remix-icon';
|
|
4
|
+
|
|
5
|
+
// ==================== CONTEXT ====================
|
|
6
|
+
|
|
7
|
+
const CardContext = createContext(null);
|
|
8
|
+
|
|
9
|
+
const useCardContext = () => {
|
|
10
|
+
const context = useContext(CardContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error('Card compound components must be used within Card');
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// ==================== SUB-COMPONENTS ====================
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Card.IconBadge - Sub-componente para o ícone com container
|
|
21
|
+
*
|
|
22
|
+
* @param {string} name - Nome do ícone RemixIcon (default: 'file-edit-line')
|
|
23
|
+
* @param {number} iconSize - Tamanho do ícone (default: 17)
|
|
24
|
+
* @param {string} iconColor - Cor do ícone (default: '#96A1C1')
|
|
25
|
+
* @param {number} containerSize - Tamanho do container (default: 32)
|
|
26
|
+
* @param {string} backgroundColor - Cor de fundo do container (default: '#F1F4FF')
|
|
27
|
+
* @param {number} borderRadius - Raio da borda do container (default: 6)
|
|
28
|
+
* @param {object} style - Estilo customizado do wrapper
|
|
29
|
+
* @param {object} containerStyle - Estilo customizado do container
|
|
30
|
+
*/
|
|
31
|
+
const IconBadge = ({
|
|
32
|
+
name = 'file-edit-line',
|
|
33
|
+
iconSize = 17,
|
|
34
|
+
iconColor = '#96A1C1',
|
|
35
|
+
containerSize = 32,
|
|
36
|
+
backgroundColor = '#F1F4FF',
|
|
37
|
+
borderRadius = 6,
|
|
38
|
+
style,
|
|
39
|
+
containerStyle,
|
|
40
|
+
}) => {
|
|
41
|
+
const { iconStyle: contextIconStyle } = useCardContext();
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<View style={[{ marginBottom: 24 }, contextIconStyle, style]}>
|
|
45
|
+
<View
|
|
46
|
+
style={[
|
|
47
|
+
{
|
|
48
|
+
width: containerSize,
|
|
49
|
+
height: containerSize,
|
|
50
|
+
backgroundColor,
|
|
51
|
+
borderRadius,
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
justifyContent: 'center',
|
|
54
|
+
},
|
|
55
|
+
containerStyle,
|
|
56
|
+
]}
|
|
57
|
+
>
|
|
58
|
+
<RemixIcon name={name} size={iconSize} color={iconColor} />
|
|
59
|
+
</View>
|
|
60
|
+
</View>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Card.Title - Sub-componente para o título
|
|
66
|
+
*/
|
|
67
|
+
const Title = ({ children, style }) => {
|
|
68
|
+
const { titleStyle: contextTitleStyle } = useCardContext();
|
|
69
|
+
|
|
70
|
+
const baseStyle = {
|
|
71
|
+
fontSize: 18,
|
|
72
|
+
lineHeight: 28,
|
|
73
|
+
letterSpacing: 0,
|
|
74
|
+
color: '#1B244B',
|
|
75
|
+
...Platform.select({
|
|
76
|
+
ios: { fontFamily: 'Figtree-Bold', fontWeight: '700' },
|
|
77
|
+
android: { fontFamily: 'Figtree-Bold' },
|
|
78
|
+
}),
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<Text style={[baseStyle, contextTitleStyle, style]}>
|
|
83
|
+
{children}
|
|
84
|
+
</Text>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Card.Description - Sub-componente para a descrição
|
|
90
|
+
*/
|
|
91
|
+
const Description = ({ children, style }) => {
|
|
92
|
+
const { descriptionStyle: contextDescriptionStyle } = useCardContext();
|
|
93
|
+
|
|
94
|
+
const baseStyle = {
|
|
95
|
+
fontSize: 14,
|
|
96
|
+
lineHeight: 20,
|
|
97
|
+
letterSpacing: 0,
|
|
98
|
+
color: '#485274',
|
|
99
|
+
marginTop: 8,
|
|
100
|
+
...Platform.select({
|
|
101
|
+
ios: { fontFamily: 'Figtree-Regular' },
|
|
102
|
+
android: { fontFamily: 'Figtree-Regular' },
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<Text style={[baseStyle, contextDescriptionStyle, style]}>
|
|
108
|
+
{children}
|
|
109
|
+
</Text>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// ==================== MAIN COMPONENT ====================
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Card
|
|
117
|
+
*
|
|
118
|
+
* Componente de card com Composition Pattern.
|
|
119
|
+
*
|
|
120
|
+
* Uso:
|
|
121
|
+
* <Card>
|
|
122
|
+
* <Card.IconBadge name="file-edit-line" />
|
|
123
|
+
* <Card.Title>Lorem ipsum dolor sit amet</Card.Title>
|
|
124
|
+
* <Card.Description>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Card.Description>
|
|
125
|
+
* </Card>
|
|
126
|
+
*
|
|
127
|
+
* IconBadge Props:
|
|
128
|
+
* - name: Nome do ícone RemixIcon (default: 'file-edit-line')
|
|
129
|
+
* - iconSize: Tamanho do ícone (default: 17)
|
|
130
|
+
* - iconColor: Cor do ícone (default: '#96A1C1')
|
|
131
|
+
* - containerSize: Tamanho do container (default: 32)
|
|
132
|
+
* - backgroundColor: Cor de fundo do container (default: '#F1F4FF')
|
|
133
|
+
* - borderRadius: Raio da borda do container (default: 6)
|
|
134
|
+
*
|
|
135
|
+
* Card Props:
|
|
136
|
+
* @param {object} style - Estilo customizado do container
|
|
137
|
+
* @param {object} iconStyle - Estilo customizado para o wrapper do ícone
|
|
138
|
+
* @param {object} titleStyle - Estilo customizado para o título
|
|
139
|
+
* @param {object} descriptionStyle - Estilo customizado para a descrição
|
|
140
|
+
* @param {number} minHeight - Altura mínima do card (default: 144)
|
|
141
|
+
* @param {string} borderColor - Cor da borda (default: #E2E9FC)
|
|
142
|
+
* @param {number} borderWidth - Largura da borda (default: 1.5)
|
|
143
|
+
* @param {number} borderRadius - Raio da borda (default: 8)
|
|
144
|
+
* @param {string} backgroundColor - Cor de fundo (default: #FFFFFF)
|
|
145
|
+
*/
|
|
146
|
+
const Card = ({
|
|
147
|
+
children,
|
|
148
|
+
style,
|
|
149
|
+
iconStyle,
|
|
150
|
+
titleStyle,
|
|
151
|
+
descriptionStyle,
|
|
152
|
+
minHeight = 144,
|
|
153
|
+
borderColor = '#E2E9FC',
|
|
154
|
+
borderWidth = 1.5,
|
|
155
|
+
borderRadius = 8,
|
|
156
|
+
backgroundColor = '#FFFFFF',
|
|
157
|
+
}) => {
|
|
158
|
+
// Contexto para sub-componentes
|
|
159
|
+
const contextValue = useMemo(() => ({
|
|
160
|
+
iconStyle,
|
|
161
|
+
titleStyle,
|
|
162
|
+
descriptionStyle,
|
|
163
|
+
}), [iconStyle, titleStyle, descriptionStyle]);
|
|
164
|
+
|
|
165
|
+
// Container style
|
|
166
|
+
const containerStyle = {
|
|
167
|
+
width: '100%',
|
|
168
|
+
minHeight,
|
|
169
|
+
borderRadius,
|
|
170
|
+
borderWidth,
|
|
171
|
+
borderColor,
|
|
172
|
+
backgroundColor,
|
|
173
|
+
padding: 16,
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<CardContext.Provider value={contextValue}>
|
|
178
|
+
<View style={[containerStyle, style]}>
|
|
179
|
+
{children}
|
|
180
|
+
</View>
|
|
181
|
+
</CardContext.Provider>
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// Anexa sub-componentes
|
|
186
|
+
Card.IconBadge = IconBadge;
|
|
187
|
+
Card.Title = Title;
|
|
188
|
+
Card.Description = Description;
|
|
189
|
+
|
|
190
|
+
export default Card;
|
|
@@ -194,8 +194,8 @@ const styles = StyleSheet.create({
|
|
|
194
194
|
fontSize: 16,
|
|
195
195
|
color: '#687499',
|
|
196
196
|
...Platform.select({
|
|
197
|
-
ios: { fontFamily: '
|
|
198
|
-
android: { fontFamily: '
|
|
197
|
+
ios: { fontFamily: 'Figtree-Regular' },
|
|
198
|
+
android: { fontFamily: 'Figtree-Regular' },
|
|
199
199
|
}),
|
|
200
200
|
},
|
|
201
201
|
inputActive: { color: '#1B244B' },
|
|
@@ -213,8 +213,8 @@ const styles = StyleSheet.create({
|
|
|
213
213
|
paddingHorizontal: 12,
|
|
214
214
|
paddingRight: 40,
|
|
215
215
|
...Platform.select({
|
|
216
|
-
ios: { fontFamily: '
|
|
217
|
-
android: { fontFamily: '
|
|
216
|
+
ios: { fontFamily: 'Figtree-Regular' },
|
|
217
|
+
android: { fontFamily: 'Figtree-Regular' },
|
|
218
218
|
}),
|
|
219
219
|
fontSize: 16,
|
|
220
220
|
lineHeight: 24,
|
|
@@ -64,12 +64,12 @@ Verifique as versões mínimas em [package.json](file:///Users/tegra/sebrae/stor
|
|
|
64
64
|
|
|
65
65
|
### Assets (fontes)
|
|
66
66
|
|
|
67
|
-
O `HeaderV2` usa `SEText`, e `SEText` depende de fontes
|
|
67
|
+
O `HeaderV2` usa `SEText`, e `SEText` depende de fontes Figtree (por nome de família). Se o app não tiver as fontes, o texto cai em fallback do sistema, alterando layout/medidas.
|
|
68
68
|
|
|
69
|
-
- Implementação: [SEText/index.js](file:///Users/tegra/sebrae/storybook/
|
|
69
|
+
- Implementação: [Typography/SEText/index.js](file:///Users/tegra/sebrae/storybook/dev/components/Typography/SEText/index.js)
|
|
70
70
|
- Fontes disponíveis na lib: [assets/fonts](file:///Users/tegra/sebrae/storybook/header-v2/assets/fonts)
|
|
71
71
|
|
|
72
|
-
Recomendação: **garanta que as fontes `
|
|
72
|
+
Recomendação: **garanta que as fontes `Figtree-*` estejam linkadas** no app.
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
@@ -110,7 +110,7 @@ Caso contrário, a configuração típica inclui:
|
|
|
110
110
|
- plugin no `babel.config.js` (normalmente `react-native-reanimated/plugin`)
|
|
111
111
|
- rebuild do app
|
|
112
112
|
|
|
113
|
-
### 3.4 Linkar fontes (
|
|
113
|
+
### 3.4 Linkar fontes (Figtree)
|
|
114
114
|
|
|
115
115
|
O modo mais comum no RN CLI é declarar as fontes no `react-native.config.js` do app consumidor.
|
|
116
116
|
|
|
@@ -740,7 +740,7 @@ import { HeaderV2 } from 'vpt-sebraeds/components/Header'
|
|
|
740
740
|
|
|
741
741
|
### Fonte “estranha” / layout quebrado
|
|
742
742
|
|
|
743
|
-
**Causa**: fontes
|
|
743
|
+
**Causa**: fontes Figtree não linkadas.
|
|
744
744
|
|
|
745
745
|
**Solução**: linkar `./node_modules/vpt-sebraeds/assets/fonts` no app.
|
|
746
746
|
|
|
@@ -353,8 +353,8 @@ const styles = StyleSheet.create({
|
|
|
353
353
|
color: '#1B244B',
|
|
354
354
|
marginBottom: 4,
|
|
355
355
|
...Platform.select({
|
|
356
|
-
ios: { fontFamily: '
|
|
357
|
-
android: { fontFamily: '
|
|
356
|
+
ios: { fontFamily: 'Figtree-Bold', fontWeight: '700' },
|
|
357
|
+
android: { fontFamily: 'Figtree-Bold' },
|
|
358
358
|
default: { fontFamily: fontFamily.bold, fontWeight: '700' },
|
|
359
359
|
}),
|
|
360
360
|
},
|
|
@@ -363,8 +363,8 @@ const styles = StyleSheet.create({
|
|
|
363
363
|
lineHeight: 20,
|
|
364
364
|
color: '#687499',
|
|
365
365
|
...Platform.select({
|
|
366
|
-
ios: { fontFamily: '
|
|
367
|
-
android: { fontFamily: '
|
|
366
|
+
ios: { fontFamily: 'Figtree-Regular' },
|
|
367
|
+
android: { fontFamily: 'Figtree-Regular' },
|
|
368
368
|
default: { fontFamily: fontFamily.regular, fontWeight: '400' },
|
|
369
369
|
}),
|
|
370
370
|
},
|
|
@@ -404,8 +404,8 @@ const styles = StyleSheet.create({
|
|
|
404
404
|
fontSize: 12,
|
|
405
405
|
color: '#1B244B',
|
|
406
406
|
...Platform.select({
|
|
407
|
-
ios: { fontFamily: '
|
|
408
|
-
android: { fontFamily: '
|
|
407
|
+
ios: { fontFamily: 'Figtree-Bold', fontWeight: '700' },
|
|
408
|
+
android: { fontFamily: 'Figtree-Bold' },
|
|
409
409
|
default: { fontFamily: fontFamily.bold, fontWeight: '700' },
|
|
410
410
|
}),
|
|
411
411
|
},
|
|
@@ -431,8 +431,8 @@ const styles = StyleSheet.create({
|
|
|
431
431
|
fontSize: 14,
|
|
432
432
|
color: '#1B244B',
|
|
433
433
|
...Platform.select({
|
|
434
|
-
ios: { fontFamily: '
|
|
435
|
-
android: { fontFamily: '
|
|
434
|
+
ios: { fontFamily: 'Figtree-Bold', fontWeight: '700' },
|
|
435
|
+
android: { fontFamily: 'Figtree-Bold' },
|
|
436
436
|
default: { fontFamily: fontFamily.bold, fontWeight: '700' },
|
|
437
437
|
}),
|
|
438
438
|
},
|
|
@@ -504,8 +504,8 @@ const styles = StyleSheet.create({
|
|
|
504
504
|
color: '#1B244B',
|
|
505
505
|
marginBottom: 4,
|
|
506
506
|
...Platform.select({
|
|
507
|
-
ios: { fontFamily: '
|
|
508
|
-
android: { fontFamily: '
|
|
507
|
+
ios: { fontFamily: 'Figtree-Bold', fontWeight: '700' },
|
|
508
|
+
android: { fontFamily: 'Figtree-Bold' },
|
|
509
509
|
default: { fontFamily: fontFamily.bold, fontWeight: '700' },
|
|
510
510
|
}),
|
|
511
511
|
},
|
|
@@ -514,8 +514,8 @@ const styles = StyleSheet.create({
|
|
|
514
514
|
lineHeight: 18,
|
|
515
515
|
color: '#687499',
|
|
516
516
|
...Platform.select({
|
|
517
|
-
ios: { fontFamily: '
|
|
518
|
-
android: { fontFamily: '
|
|
517
|
+
ios: { fontFamily: 'Figtree-Regular' },
|
|
518
|
+
android: { fontFamily: 'Figtree-Regular' },
|
|
519
519
|
default: { fontFamily: fontFamily.regular, fontWeight: '400' },
|
|
520
520
|
}),
|
|
521
521
|
},
|
|
@@ -227,8 +227,8 @@ const Value = ({ children, style, currency = false }) => {
|
|
|
227
227
|
const baseStyle = {
|
|
228
228
|
letterSpacing: 0,
|
|
229
229
|
...Platform.select({
|
|
230
|
-
ios: { fontFamily: '
|
|
231
|
-
android: { fontFamily: '
|
|
230
|
+
ios: { fontFamily: 'Figtree-Bold', fontWeight: '700' },
|
|
231
|
+
android: { fontFamily: 'Figtree-Bold' },
|
|
232
232
|
}),
|
|
233
233
|
};
|
|
234
234
|
|
|
@@ -254,11 +254,11 @@ const Label = ({ children, style }) => {
|
|
|
254
254
|
letterSpacing: 0,
|
|
255
255
|
...Platform.select({
|
|
256
256
|
ios: {
|
|
257
|
-
fontFamily: isMetricLayout ? '
|
|
257
|
+
fontFamily: isMetricLayout ? 'Figtree-Medium' : 'Figtree-Regular',
|
|
258
258
|
fontWeight: isMetricLayout ? '500' : undefined,
|
|
259
259
|
},
|
|
260
260
|
android: {
|
|
261
|
-
fontFamily: isMetricLayout ? '
|
|
261
|
+
fontFamily: isMetricLayout ? 'Figtree-Medium' : 'Figtree-Regular',
|
|
262
262
|
},
|
|
263
263
|
}),
|
|
264
264
|
};
|
|
@@ -444,8 +444,8 @@ const NumberDisplay = ({
|
|
|
444
444
|
const baseValueStyle = {
|
|
445
445
|
letterSpacing: 0,
|
|
446
446
|
...Platform.select({
|
|
447
|
-
ios: { fontFamily: '
|
|
448
|
-
android: { fontFamily: '
|
|
447
|
+
ios: { fontFamily: 'Figtree-Bold', fontWeight: '700' },
|
|
448
|
+
android: { fontFamily: 'Figtree-Bold' },
|
|
449
449
|
}),
|
|
450
450
|
...layoutConfig?.value,
|
|
451
451
|
};
|
|
@@ -454,11 +454,11 @@ const NumberDisplay = ({
|
|
|
454
454
|
letterSpacing: 0,
|
|
455
455
|
...Platform.select({
|
|
456
456
|
ios: {
|
|
457
|
-
fontFamily: isMetricLayout ? '
|
|
457
|
+
fontFamily: isMetricLayout ? 'Figtree-Medium' : 'Figtree-Regular',
|
|
458
458
|
fontWeight: isMetricLayout ? '500' : undefined,
|
|
459
459
|
},
|
|
460
460
|
android: {
|
|
461
|
-
fontFamily: isMetricLayout ? '
|
|
461
|
+
fontFamily: isMetricLayout ? 'Figtree-Medium' : 'Figtree-Regular',
|
|
462
462
|
},
|
|
463
463
|
}),
|
|
464
464
|
...layoutConfig?.label,
|