vpt-sebraeds 0.0.11 → 0.0.12
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 +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,EAAa,MAAM,cAAc,CAAC;AAIxF,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,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;IAClB,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,MAAM,CAAC;IACjC,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;AA0QF,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,8 +27,8 @@ 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
|
|
35
|
-
];
|
|
30
|
+
textColor ? { color: textColor } : {},
|
|
31
|
+
].filter(Boolean);
|
|
36
32
|
const getIconColor = () => {
|
|
37
33
|
if (iconColor)
|
|
38
34
|
return 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="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="xs-body" color="#6B7280" style={styles.description} numberOfLines={2}>
|
|
136
132
|
{description}
|
|
137
|
-
</
|
|
133
|
+
</SEText>
|
|
138
134
|
</View>
|
|
139
|
-
</View>) : (layout === 'list' ? (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
{label}
|
|
143
|
-
</SEText>);
|
|
144
|
-
})()) : (<Text style={labelStyle} numberOfLines={1}>
|
|
135
|
+
</View>) : (layout === 'list' ? (<SEText type="heading-4" color={textColor || '#1B244B'} style={{ flex: 1 }} numberOfLines={1}>
|
|
136
|
+
{label}
|
|
137
|
+
</SEText>) : (<SEText type="sm-body-semibold" color={variant === 'disabled' ? '#9CA3AF' : variant === 'selected' ? '#1B244B' : textColor || '#1B244B'} style={labelStyle} numberOfLines={1}>
|
|
145
138
|
{label}
|
|
146
|
-
</
|
|
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="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
|
},
|