vpt-sebraeds 0.0.14 → 0.0.15
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.
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View,
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity, ViewStyle, StyleProp, TextStyle } from 'react-native';
|
|
3
3
|
import Icon from '../Icon';
|
|
4
4
|
import SEText from '../SEText';
|
|
5
5
|
|
|
6
6
|
interface NavigationItemProps {
|
|
7
|
-
iconName
|
|
7
|
+
iconName?: string;
|
|
8
8
|
label: string;
|
|
9
9
|
variant?: 'default' | 'selected' | 'disabled';
|
|
10
10
|
size?: 'small' | 'medium' | 'large';
|
|
11
11
|
onPress?: () => void;
|
|
12
|
-
style?: ViewStyle
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
13
|
iconColor?: string;
|
|
14
14
|
textColor?: string;
|
|
15
15
|
backgroundColor?: string;
|
|
16
16
|
borderColor?: string;
|
|
17
17
|
showArrow?: boolean;
|
|
18
18
|
badge?: string;
|
|
19
|
-
badgeStyle?: 'standard' |
|
|
19
|
+
badgeStyle?: 'standard' | 'rounded';
|
|
20
20
|
description?: string;
|
|
21
21
|
layout?: 'standard' | 'expanded' | 'list';
|
|
22
22
|
iconBackgroundColor?: string;
|
|
@@ -35,10 +35,10 @@ const NavigationItem: React.FC<NavigationItemProps> = ({
|
|
|
35
35
|
borderColor,
|
|
36
36
|
showArrow = true,
|
|
37
37
|
badge,
|
|
38
|
-
badgeStyle = 'standard',
|
|
39
|
-
description,
|
|
40
|
-
layout = 'standard',
|
|
41
|
-
iconBackgroundColor,
|
|
38
|
+
badgeStyle = 'standard',
|
|
39
|
+
description,
|
|
40
|
+
layout = 'standard',
|
|
41
|
+
iconBackgroundColor,
|
|
42
42
|
}) => {
|
|
43
43
|
// Estilos dinâmicos baseados nas props
|
|
44
44
|
const containerStyle = [
|
|
@@ -62,11 +62,11 @@ const NavigationItem: React.FC<NavigationItemProps> = ({
|
|
|
62
62
|
iconBackgroundColor && { backgroundColor: iconBackgroundColor },
|
|
63
63
|
];
|
|
64
64
|
|
|
65
|
-
const labelStyle = [
|
|
65
|
+
const labelStyle: TextStyle[] = [
|
|
66
66
|
styles.label,
|
|
67
67
|
size === 'small' ? styles.labelSmall : size === 'large' ? styles.labelLarge : styles.labelMedium,
|
|
68
68
|
variant === 'selected' ? styles.labelSelected : variant === 'disabled' ? styles.labelDisabled : styles.labelDefault,
|
|
69
|
-
textColor && { color: textColor },
|
|
69
|
+
...(textColor != null && textColor !== '' ? [{ color: textColor } as TextStyle] : []),
|
|
70
70
|
];
|
|
71
71
|
|
|
72
72
|
const getIconColor = () => {
|
|
@@ -173,36 +173,40 @@ const NavigationItem: React.FC<NavigationItemProps> = ({
|
|
|
173
173
|
name={iconName}
|
|
174
174
|
size={getIconSize()}
|
|
175
175
|
color={getIconColor()}
|
|
176
|
-
style={{}}
|
|
177
176
|
/>
|
|
178
177
|
</View>
|
|
179
178
|
)}
|
|
180
179
|
|
|
181
180
|
{layout === 'expanded' && description ? (
|
|
182
181
|
<View style={styles.textContainer}>
|
|
183
|
-
<
|
|
182
|
+
<SEText
|
|
183
|
+
type="ns-sm-body-semibold"
|
|
184
|
+
color={variant === 'disabled' ? '#9CA3AF' : textColor || '#1B244B'}
|
|
185
|
+
style={styles.labelExpanded}
|
|
186
|
+
numberOfLines={1}
|
|
187
|
+
>
|
|
184
188
|
{label}
|
|
185
|
-
</
|
|
189
|
+
</SEText>
|
|
186
190
|
<View style={styles.descriptionContainer}>
|
|
187
|
-
<
|
|
191
|
+
<SEText type="ns-xs-body" color="#6B7280" style={styles.description} numberOfLines={2}>
|
|
188
192
|
{description}
|
|
189
|
-
</
|
|
193
|
+
</SEText>
|
|
190
194
|
</View>
|
|
191
195
|
</View>
|
|
192
196
|
) : (
|
|
193
197
|
layout === 'list' ? (
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
<SEText type={'ns-heading-4' as any} style={seTextStyle} numberOfLines={1}>
|
|
198
|
-
{label}
|
|
199
|
-
</SEText>
|
|
200
|
-
);
|
|
201
|
-
})()
|
|
198
|
+
<SEText type="ns-heading-4" color={textColor || '#1B244B'} style={{ flex: 1 }} numberOfLines={1}>
|
|
199
|
+
{label}
|
|
200
|
+
</SEText>
|
|
202
201
|
) : (
|
|
203
|
-
<
|
|
202
|
+
<SEText
|
|
203
|
+
type="ns-sm-body-semibold"
|
|
204
|
+
color={variant === 'disabled' ? '#9CA3AF' : variant === 'selected' ? '#1B244B' : textColor || '#1B244B'}
|
|
205
|
+
style={labelStyle}
|
|
206
|
+
numberOfLines={1}
|
|
207
|
+
>
|
|
204
208
|
{label}
|
|
205
|
-
</
|
|
209
|
+
</SEText>
|
|
206
210
|
)
|
|
207
211
|
)}
|
|
208
212
|
|
|
@@ -212,7 +216,6 @@ const NavigationItem: React.FC<NavigationItemProps> = ({
|
|
|
212
216
|
name={layout === 'list' ? 'arrow-right-s-line' : 'arrow-right-line'}
|
|
213
217
|
size={getArrowSize()}
|
|
214
218
|
color={getArrowColor()}
|
|
215
|
-
style={{}}
|
|
216
219
|
/>
|
|
217
220
|
</View>
|
|
218
221
|
)}
|
|
@@ -220,7 +223,7 @@ const NavigationItem: React.FC<NavigationItemProps> = ({
|
|
|
220
223
|
{/* Badge "Novo" posicionado no canto direito, interno ao container */}
|
|
221
224
|
{badge && (
|
|
222
225
|
<View style={getBadgeStyle()}>
|
|
223
|
-
<
|
|
226
|
+
<SEText type="ns-xxxs-body" color="#FFFFFF" style={[styles.figmaBadgeText, getBadgeTextSize()]}>{badge}</SEText>
|
|
224
227
|
</View>
|
|
225
228
|
)}
|
|
226
229
|
</>
|
|
@@ -369,12 +372,10 @@ const styles = StyleSheet.create({
|
|
|
369
372
|
// Label Base
|
|
370
373
|
label: {
|
|
371
374
|
flex: 1,
|
|
372
|
-
|
|
373
|
-
fontWeight: '600',
|
|
374
375
|
flexShrink: 1, // Permite que o texto se compresse se necessário
|
|
375
376
|
},
|
|
376
377
|
|
|
377
|
-
// Label Sizes
|
|
378
|
+
// Label Sizes (mantidos para compatibilidade, mas não mais necessários com SEText)
|
|
378
379
|
labelSmall: {
|
|
379
380
|
fontSize: 12,
|
|
380
381
|
lineHeight: 16,
|
|
@@ -398,9 +399,6 @@ const styles = StyleSheet.create({
|
|
|
398
399
|
labelExpanded: {
|
|
399
400
|
fontSize: 16,
|
|
400
401
|
lineHeight: 22,
|
|
401
|
-
// fontWeight: '600',
|
|
402
|
-
|
|
403
|
-
// Removido marginBottom pois agora usamos descriptionContainer para espaçamento
|
|
404
402
|
},
|
|
405
403
|
descriptionContainer: {
|
|
406
404
|
marginTop: 6, // Espaçamento entre o título e a descrição
|
|
@@ -408,12 +406,9 @@ const styles = StyleSheet.create({
|
|
|
408
406
|
description: {
|
|
409
407
|
fontSize: 12,
|
|
410
408
|
lineHeight: 18, // Aumentado para melhor legibilidade
|
|
411
|
-
color: '#6B7280',
|
|
412
|
-
|
|
413
|
-
// fontWeight: '400',
|
|
414
409
|
},
|
|
415
410
|
|
|
416
|
-
// Label Variants
|
|
411
|
+
// Label Variants (não mais necessários com SEText gerenciando cores)
|
|
417
412
|
labelDefault: {
|
|
418
413
|
color: '#1B244B',
|
|
419
414
|
},
|
|
@@ -478,9 +473,7 @@ const styles = StyleSheet.create({
|
|
|
478
473
|
borderBottomRightRadius: 10,
|
|
479
474
|
},
|
|
480
475
|
figmaBadgeText: {
|
|
481
|
-
color: '#FFFFFF',
|
|
482
476
|
fontWeight: '700',
|
|
483
|
-
|
|
484
477
|
textAlign: 'center',
|
|
485
478
|
},
|
|
486
479
|
|
|
@@ -496,10 +489,8 @@ const styles = StyleSheet.create({
|
|
|
496
489
|
zIndex: 10,
|
|
497
490
|
},
|
|
498
491
|
topBadgeText: {
|
|
499
|
-
color: '#FFFFFF',
|
|
500
492
|
fontSize: 10,
|
|
501
493
|
fontWeight: '600',
|
|
502
|
-
|
|
503
494
|
},
|
|
504
495
|
|
|
505
496
|
// Badge antigo (mantido para compatibilidade)
|
|
@@ -516,11 +507,9 @@ const styles = StyleSheet.create({
|
|
|
516
507
|
paddingHorizontal: 6,
|
|
517
508
|
},
|
|
518
509
|
badgeText: {
|
|
519
|
-
color: '#FFFFFF',
|
|
520
510
|
fontSize: 10,
|
|
521
511
|
fontWeight: '600',
|
|
522
|
-
|
|
523
512
|
},
|
|
524
513
|
});
|
|
525
514
|
|
|
526
|
-
export default NavigationItem;
|
|
515
|
+
export default NavigationItem;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TextStyle, TextProps } from 'react-native';
|
|
1
|
+
import { TextStyle, TextProps, StyleProp } from 'react-native';
|
|
2
2
|
|
|
3
3
|
export interface SETextProps extends TextProps {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
style?: TextStyle
|
|
5
|
+
style?: StyleProp<TextStyle>;
|
|
6
6
|
bold?: boolean;
|
|
7
7
|
semiBold?: boolean;
|
|
8
8
|
center?: boolean;
|
|
@@ -42,6 +42,19 @@ export interface SETextProps extends TextProps {
|
|
|
42
42
|
| 'ns-heading-4'
|
|
43
43
|
| 'ns-heading-5'
|
|
44
44
|
| 'ns-heading-6'
|
|
45
|
+
| 'ns-subtitle'
|
|
46
|
+
| 'ns-sm-body'
|
|
47
|
+
| 'ns-sm-body-semibold'
|
|
48
|
+
| 'ns-sm-body-bold'
|
|
49
|
+
| 'ns-xs-body'
|
|
50
|
+
| 'ns-xs-body-semibold'
|
|
51
|
+
| 'ns-xs-body-bold'
|
|
52
|
+
| 'ns-xxs-body'
|
|
53
|
+
| 'ns-xxs-body-semibold'
|
|
54
|
+
| 'ns-xxs-body-bold'
|
|
55
|
+
| 'ns-xxxs-body'
|
|
56
|
+
| 'ns-xxxs-body-semibold'
|
|
57
|
+
| 'ns-xxxs-body-bold'
|
|
45
58
|
| null;
|
|
46
59
|
mt?: number | null;
|
|
47
60
|
mb?: number | null;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
2
|
+
import { ViewStyle, StyleProp } from 'react-native';
|
|
3
3
|
interface NavigationItemProps {
|
|
4
|
-
iconName
|
|
4
|
+
iconName?: string;
|
|
5
5
|
label: string;
|
|
6
6
|
variant?: 'default' | 'selected' | 'disabled';
|
|
7
7
|
size?: 'small' | 'medium' | 'large';
|
|
8
8
|
onPress?: () => void;
|
|
9
|
-
style?: ViewStyle
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
10
|
iconColor?: string;
|
|
11
11
|
textColor?: string;
|
|
12
12
|
backgroundColor?: string;
|
|
13
13
|
borderColor?: string;
|
|
14
14
|
showArrow?: boolean;
|
|
15
15
|
badge?: string;
|
|
16
|
-
badgeStyle?: 'standard' |
|
|
16
|
+
badgeStyle?: 'standard' | 'rounded';
|
|
17
17
|
description?: string;
|
|
18
18
|
layout?: 'standard' | 'expanded' | 'list';
|
|
19
19
|
iconBackgroundColor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/NavigationItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/NavigationItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsC,SAAS,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAInG,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC9C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiOjD,CAAC;AAyQF,eAAe,cAAc,CAAC"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View,
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
3
|
import Icon from '../Icon';
|
|
4
4
|
import SEText from '../SEText';
|
|
5
|
-
const NavigationItem = ({ iconName, label, variant = 'default', size = 'medium', onPress, style, iconColor, textColor, backgroundColor, borderColor, showArrow = true, badge, badgeStyle = 'standard',
|
|
6
|
-
description, // Texto descritivo adicional
|
|
7
|
-
layout = 'standard', // 'standard' | 'expanded' | 'list'
|
|
8
|
-
iconBackgroundColor, // Cor de fundo personalizada para o ícone
|
|
9
|
-
}) => {
|
|
5
|
+
const NavigationItem = ({ iconName, label, variant = 'default', size = 'medium', onPress, style, iconColor, textColor, backgroundColor, borderColor, showArrow = true, badge, badgeStyle = 'standard', description, layout = 'standard', iconBackgroundColor, }) => {
|
|
10
6
|
// Estilos dinâmicos baseados nas props
|
|
11
7
|
const containerStyle = [
|
|
12
8
|
styles.container,
|
|
@@ -31,7 +27,7 @@ iconBackgroundColor, // Cor de fundo personalizada para o ícone
|
|
|
31
27
|
styles.label,
|
|
32
28
|
size === 'small' ? styles.labelSmall : size === 'large' ? styles.labelLarge : styles.labelMedium,
|
|
33
29
|
variant === 'selected' ? styles.labelSelected : variant === 'disabled' ? styles.labelDisabled : styles.labelDefault,
|
|
34
|
-
textColor && { color: textColor },
|
|
30
|
+
...(textColor != null && textColor !== '' ? [{ color: textColor }] : []),
|
|
35
31
|
];
|
|
36
32
|
const getIconColor = () => {
|
|
37
33
|
if (iconColor)
|
|
@@ -124,34 +120,31 @@ iconBackgroundColor, // Cor de fundo personalizada para o ícone
|
|
|
124
120
|
};
|
|
125
121
|
const Content = (<>
|
|
126
122
|
{layout !== 'list' && iconName && (<View style={iconContainerStyle}>
|
|
127
|
-
<Icon name={iconName} size={getIconSize()} color={getIconColor()}
|
|
123
|
+
<Icon name={iconName} size={getIconSize()} color={getIconColor()}/>
|
|
128
124
|
</View>)}
|
|
129
125
|
|
|
130
126
|
{layout === 'expanded' && description ? (<View style={styles.textContainer}>
|
|
131
|
-
<
|
|
127
|
+
<SEText type="ns-sm-body-semibold" color={variant === 'disabled' ? '#9CA3AF' : textColor || '#1B244B'} style={styles.labelExpanded} numberOfLines={1}>
|
|
132
128
|
{label}
|
|
133
|
-
</
|
|
129
|
+
</SEText>
|
|
134
130
|
<View style={styles.descriptionContainer}>
|
|
135
|
-
<
|
|
131
|
+
<SEText type="ns-xs-body" color="#6B7280" style={styles.description} numberOfLines={2}>
|
|
136
132
|
{description}
|
|
137
|
-
</
|
|
133
|
+
</SEText>
|
|
138
134
|
</View>
|
|
139
|
-
</View>) : (layout === 'list' ? (
|
|
140
|
-
const seTextStyle = [{ flex: 1 }, ...(textColor ? [{ color: textColor }] : [])];
|
|
141
|
-
return (<SEText type={'ns-heading-4'} style={seTextStyle} numberOfLines={1}>
|
|
142
|
-
{label}
|
|
143
|
-
</SEText>);
|
|
144
|
-
})()) : (<Text style={labelStyle} numberOfLines={1}>
|
|
135
|
+
</View>) : (layout === 'list' ? (<SEText type="ns-heading-4" color={textColor || '#1B244B'} style={{ flex: 1 }} numberOfLines={1}>
|
|
145
136
|
{label}
|
|
146
|
-
</
|
|
137
|
+
</SEText>) : (<SEText type="ns-sm-body-semibold" color={variant === 'disabled' ? '#9CA3AF' : variant === 'selected' ? '#1B244B' : textColor || '#1B244B'} style={labelStyle} numberOfLines={1}>
|
|
138
|
+
{label}
|
|
139
|
+
</SEText>))}
|
|
147
140
|
|
|
148
141
|
{showArrow && variant !== 'disabled' && (<View style={styles.arrowContainer}>
|
|
149
|
-
<Icon name={layout === 'list' ? 'arrow-right-s-line' : 'arrow-right-line'} size={getArrowSize()} color={getArrowColor()}
|
|
142
|
+
<Icon name={layout === 'list' ? 'arrow-right-s-line' : 'arrow-right-line'} size={getArrowSize()} color={getArrowColor()}/>
|
|
150
143
|
</View>)}
|
|
151
144
|
|
|
152
145
|
{/* Badge "Novo" posicionado no canto direito, interno ao container */}
|
|
153
146
|
{badge && (<View style={getBadgeStyle()}>
|
|
154
|
-
<
|
|
147
|
+
<SEText type="ns-xxxs-body" color="#FFFFFF" style={[styles.figmaBadgeText, getBadgeTextSize()]}>{badge}</SEText>
|
|
155
148
|
</View>)}
|
|
156
149
|
</>);
|
|
157
150
|
if (onPress && variant !== 'disabled') {
|
|
@@ -279,10 +272,9 @@ const styles = StyleSheet.create({
|
|
|
279
272
|
// Label Base
|
|
280
273
|
label: {
|
|
281
274
|
flex: 1,
|
|
282
|
-
fontWeight: '600',
|
|
283
275
|
flexShrink: 1, // Permite que o texto se compresse se necessário
|
|
284
276
|
},
|
|
285
|
-
// Label Sizes
|
|
277
|
+
// Label Sizes (mantidos para compatibilidade, mas não mais necessários com SEText)
|
|
286
278
|
labelSmall: {
|
|
287
279
|
fontSize: 12,
|
|
288
280
|
lineHeight: 16,
|
|
@@ -305,8 +297,6 @@ const styles = StyleSheet.create({
|
|
|
305
297
|
labelExpanded: {
|
|
306
298
|
fontSize: 16,
|
|
307
299
|
lineHeight: 22,
|
|
308
|
-
// fontWeight: '600',
|
|
309
|
-
// Removido marginBottom pois agora usamos descriptionContainer para espaçamento
|
|
310
300
|
},
|
|
311
301
|
descriptionContainer: {
|
|
312
302
|
marginTop: 6, // Espaçamento entre o título e a descrição
|
|
@@ -314,10 +304,8 @@ const styles = StyleSheet.create({
|
|
|
314
304
|
description: {
|
|
315
305
|
fontSize: 12,
|
|
316
306
|
lineHeight: 18, // Aumentado para melhor legibilidade
|
|
317
|
-
color: '#6B7280',
|
|
318
|
-
// fontWeight: '400',
|
|
319
307
|
},
|
|
320
|
-
// Label Variants
|
|
308
|
+
// Label Variants (não mais necessários com SEText gerenciando cores)
|
|
321
309
|
labelDefault: {
|
|
322
310
|
color: '#1B244B',
|
|
323
311
|
},
|
|
@@ -380,7 +368,6 @@ const styles = StyleSheet.create({
|
|
|
380
368
|
borderBottomRightRadius: 10,
|
|
381
369
|
},
|
|
382
370
|
figmaBadgeText: {
|
|
383
|
-
color: '#FFFFFF',
|
|
384
371
|
fontWeight: '700',
|
|
385
372
|
textAlign: 'center',
|
|
386
373
|
},
|
|
@@ -396,7 +383,6 @@ const styles = StyleSheet.create({
|
|
|
396
383
|
zIndex: 10,
|
|
397
384
|
},
|
|
398
385
|
topBadgeText: {
|
|
399
|
-
color: '#FFFFFF',
|
|
400
386
|
fontSize: 10,
|
|
401
387
|
fontWeight: '600',
|
|
402
388
|
},
|
|
@@ -414,7 +400,6 @@ const styles = StyleSheet.create({
|
|
|
414
400
|
paddingHorizontal: 6,
|
|
415
401
|
},
|
|
416
402
|
badgeText: {
|
|
417
|
-
color: '#FFFFFF',
|
|
418
403
|
fontSize: 10,
|
|
419
404
|
fontWeight: '600',
|
|
420
405
|
},
|