vpt-sebraeds 0.0.10 → 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,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react';
|
|
2
|
-
import { TouchableOpacity,
|
|
2
|
+
import { TouchableOpacity, StyleSheet, View } from 'react-native';
|
|
3
3
|
import SEIcon from '~/superApp/UI/SEIcon';
|
|
4
4
|
import { SEText } from '~/UI';
|
|
5
5
|
|
|
@@ -125,6 +125,19 @@ const Button = ({
|
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
+
const getSETextType = () => {
|
|
129
|
+
switch (size) {
|
|
130
|
+
case 'large':
|
|
131
|
+
return 'button-large';
|
|
132
|
+
case 'medium':
|
|
133
|
+
return 'button-medium';
|
|
134
|
+
case 'small':
|
|
135
|
+
return 'button-small';
|
|
136
|
+
default:
|
|
137
|
+
return 'button-medium';
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
|
|
128
141
|
const getIconColor = () => {
|
|
129
142
|
if (iconColor) return iconColor;
|
|
130
143
|
if (disabled) return styles.labelDisabled.color;
|
|
@@ -168,7 +181,7 @@ const Button = ({
|
|
|
168
181
|
iconPosition === 'both') &&
|
|
169
182
|
renderIcon()
|
|
170
183
|
}
|
|
171
|
-
<SEText bold campuni style={getLabelStyle()}>{label}</SEText>
|
|
184
|
+
<SEText type={getSETextType()} bold campuni style={getLabelStyle()}>{label}</SEText>
|
|
172
185
|
{(
|
|
173
186
|
iconPosition === 'right' ||
|
|
174
187
|
iconPosition === 'both') &&
|
|
@@ -260,7 +273,7 @@ const styles = StyleSheet.create({
|
|
|
260
273
|
},
|
|
261
274
|
label: {
|
|
262
275
|
|
|
263
|
-
fontSize:
|
|
276
|
+
fontSize: 16,
|
|
264
277
|
// fontWeight: '500',
|
|
265
278
|
color: '#E7F79E',
|
|
266
279
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Button/index.jsx"],"names":[],"mappings":";AAKA;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Button/index.jsx"],"names":[],"mappings":";AAKA;;;;;;;;;;;sBA6LC;kBAlMwC,OAAO"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react';
|
|
2
|
-
import { TouchableOpacity,
|
|
2
|
+
import { TouchableOpacity, StyleSheet, View } from 'react-native';
|
|
3
3
|
import SEIcon from '~/superApp/UI/SEIcon';
|
|
4
4
|
import { SEText } from '~/UI';
|
|
5
5
|
const Button = ({ label, size = 'medium', variant = 'filled', disabled = false, inverseStyle = false, onPress, iconName, iconPosition = 'both', expand = false, iconColor, }) => {
|
|
@@ -101,6 +101,18 @@ const Button = ({ label, size = 'medium', variant = 'filled', disabled = false,
|
|
|
101
101
|
return 20;
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
|
+
const getSETextType = () => {
|
|
105
|
+
switch (size) {
|
|
106
|
+
case 'large':
|
|
107
|
+
return 'button-large';
|
|
108
|
+
case 'medium':
|
|
109
|
+
return 'button-medium';
|
|
110
|
+
case 'small':
|
|
111
|
+
return 'button-small';
|
|
112
|
+
default:
|
|
113
|
+
return 'button-medium';
|
|
114
|
+
}
|
|
115
|
+
};
|
|
104
116
|
const getIconColor = () => {
|
|
105
117
|
if (iconColor)
|
|
106
118
|
return iconColor;
|
|
@@ -127,7 +139,7 @@ const Button = ({ label, size = 'medium', variant = 'filled', disabled = false,
|
|
|
127
139
|
{(iconPosition === 'left' ||
|
|
128
140
|
iconPosition === 'both') &&
|
|
129
141
|
renderIcon()}
|
|
130
|
-
<SEText bold campuni style={getLabelStyle()}>{label}</SEText>
|
|
142
|
+
<SEText type={getSETextType()} bold campuni style={getLabelStyle()}>{label}</SEText>
|
|
131
143
|
{(iconPosition === 'right' ||
|
|
132
144
|
iconPosition === 'both') &&
|
|
133
145
|
renderIcon()}
|
|
@@ -212,7 +224,7 @@ const styles = StyleSheet.create({
|
|
|
212
224
|
aspectRatio: 1,
|
|
213
225
|
},
|
|
214
226
|
label: {
|
|
215
|
-
fontSize:
|
|
227
|
+
fontSize: 16,
|
|
216
228
|
// fontWeight: '500',
|
|
217
229
|
color: '#E7F79E',
|
|
218
230
|
},
|
|
@@ -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
|
},
|