vpt-sebraeds 0.0.52 → 0.0.54
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/components/Shortcut/index.jsx +10 -10
- package/components/Tools/NavigationButton/NavigationButton.stories.jsx +3 -1
- package/components/Tools/NavigationButton/index.jsx +20 -5
- package/dist/components/Shortcut/index.js +10 -10
- package/dist/components/Tools/NavigationButton/index.d.ts +2 -1
- package/dist/components/Tools/NavigationButton/index.d.ts.map +1 -1
- package/dist/components/Tools/NavigationButton/index.js +12 -6
- package/package.json +1 -1
|
@@ -12,8 +12,8 @@ const variants = {
|
|
|
12
12
|
icon: { color: '#fff' },
|
|
13
13
|
label: { color: '#fff' },
|
|
14
14
|
badge: {
|
|
15
|
-
backgroundColor: '#
|
|
16
|
-
color: '#
|
|
15
|
+
backgroundColor: '#F7F9FF',
|
|
16
|
+
color: '#2A4FDA',
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
light: {
|
|
@@ -22,8 +22,8 @@ const variants = {
|
|
|
22
22
|
borderColor: '#E6ECFF',
|
|
23
23
|
borderWidth: 2,
|
|
24
24
|
},
|
|
25
|
-
icon: { color: '#
|
|
26
|
-
label: { color: '#
|
|
25
|
+
icon: { color: '#081032' },
|
|
26
|
+
label: { color: '#081032' },
|
|
27
27
|
badge: {
|
|
28
28
|
backgroundColor: '#111C44',
|
|
29
29
|
color: '#E2FF66',
|
|
@@ -74,7 +74,7 @@ const variants = {
|
|
|
74
74
|
borderColor: '#E2E9FC',
|
|
75
75
|
borderWidth: 2,
|
|
76
76
|
},
|
|
77
|
-
icon: { color: '#
|
|
77
|
+
icon: { color: '#081032' },
|
|
78
78
|
label: { color: '#081032' },
|
|
79
79
|
badge: {
|
|
80
80
|
backgroundColor: '#111C44',
|
|
@@ -86,7 +86,7 @@ const variants = {
|
|
|
86
86
|
backgroundColor: '#DDE6FC',
|
|
87
87
|
borderColor: '#DDE6FC',
|
|
88
88
|
},
|
|
89
|
-
icon: { color: '#
|
|
89
|
+
icon: { color: '#081032' },
|
|
90
90
|
label: { color: '#081032' },
|
|
91
91
|
badge: {
|
|
92
92
|
backgroundColor: '#111C44',
|
|
@@ -242,7 +242,7 @@ const styles = StyleSheet.create({
|
|
|
242
242
|
padding: 16,
|
|
243
243
|
position: 'relative',
|
|
244
244
|
backgroundColor: '#001A70',
|
|
245
|
-
overflow: '
|
|
245
|
+
overflow: 'visible',
|
|
246
246
|
},
|
|
247
247
|
containerWide: {
|
|
248
248
|
width: 156, // Mantém a mesma altura e ajusta largura para aspect ratio 39/34
|
|
@@ -259,11 +259,11 @@ const styles = StyleSheet.create({
|
|
|
259
259
|
},
|
|
260
260
|
badge: {
|
|
261
261
|
position: 'absolute',
|
|
262
|
-
top:
|
|
263
|
-
right:
|
|
262
|
+
top: -2,
|
|
263
|
+
right: -2,
|
|
264
264
|
paddingHorizontal: 12,
|
|
265
265
|
paddingVertical: 4,
|
|
266
|
-
borderTopRightRadius:
|
|
266
|
+
borderTopRightRadius: 10,
|
|
267
267
|
borderBottomLeftRadius: 8,
|
|
268
268
|
zIndex: 2,
|
|
269
269
|
minWidth: 40,
|
|
@@ -91,9 +91,10 @@ export const Default = {
|
|
|
91
91
|
style={{ marginBottom: 12 }}
|
|
92
92
|
/>
|
|
93
93
|
|
|
94
|
-
{/* hidden content (masked) */}
|
|
94
|
+
{/* hidden content (masked) - press the eye icon to toggle */}
|
|
95
95
|
<NavigationButton
|
|
96
96
|
title="Tool's Name"
|
|
97
|
+
description="R$ 5.021,01"
|
|
97
98
|
maskedContent={true}
|
|
98
99
|
labels={[
|
|
99
100
|
{ text: 'Label', leftIcon: 'home-4-line', rightIcon: 'home-4-line' },
|
|
@@ -114,6 +115,7 @@ export const Default = {
|
|
|
114
115
|
|
|
115
116
|
<NavigationButton
|
|
116
117
|
title="Tool's Name"
|
|
118
|
+
description="R$ 5.021,01"
|
|
117
119
|
maskedContent={true}
|
|
118
120
|
labels={[]}
|
|
119
121
|
/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { View, StyleSheet, Pressable } from 'react-native';
|
|
3
3
|
import SEText from '../../SEText';
|
|
4
4
|
import Icon from '../../Icon';
|
|
@@ -39,6 +39,7 @@ const NavigationButton = ({
|
|
|
39
39
|
|
|
40
40
|
// Valor com ícone
|
|
41
41
|
valueIconName = 'eye-line',
|
|
42
|
+
maskedValueIconName = 'eye-off-line',
|
|
42
43
|
valueIconSize = 16,
|
|
43
44
|
valueIconColor = '#485274',
|
|
44
45
|
|
|
@@ -87,6 +88,7 @@ const NavigationButton = ({
|
|
|
87
88
|
};
|
|
88
89
|
|
|
89
90
|
const isCustomIcon = iconType && iconType !== 'Remix';
|
|
91
|
+
const [masked, setMasked] = useState(maskedContent);
|
|
90
92
|
|
|
91
93
|
const renderDescription = () => {
|
|
92
94
|
if (hideContent) {
|
|
@@ -94,15 +96,22 @@ const NavigationButton = ({
|
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
if (maskedContent) {
|
|
99
|
+
const isCurrentlyMasked = masked;
|
|
97
100
|
return (
|
|
98
101
|
<View style={styles.valueContainer}>
|
|
99
|
-
<
|
|
102
|
+
<Pressable onPress={() => setMasked((prev) => !prev)} hitSlop={8}>
|
|
103
|
+
<Icon
|
|
104
|
+
name={isCurrentlyMasked ? maskedValueIconName : valueIconName}
|
|
105
|
+
size={valueIconSize}
|
|
106
|
+
color={valueIconColor}
|
|
107
|
+
/>
|
|
108
|
+
</Pressable>
|
|
100
109
|
<SEText
|
|
101
110
|
type={descriptionType}
|
|
102
111
|
color={descriptionColor}
|
|
103
112
|
style={styles.valueText}
|
|
104
113
|
>
|
|
105
|
-
••••••
|
|
114
|
+
{isCurrentlyMasked ? '••••••' : description}
|
|
106
115
|
</SEText>
|
|
107
116
|
</View>
|
|
108
117
|
);
|
|
@@ -126,13 +135,19 @@ const NavigationButton = ({
|
|
|
126
135
|
if (showValueIcon) {
|
|
127
136
|
return (
|
|
128
137
|
<View style={styles.valueContainer}>
|
|
129
|
-
<
|
|
138
|
+
<Pressable onPress={() => setMasked((prev) => !prev)} hitSlop={8}>
|
|
139
|
+
<Icon
|
|
140
|
+
name={masked ? maskedValueIconName : valueIconName}
|
|
141
|
+
size={valueIconSize}
|
|
142
|
+
color={valueIconColor}
|
|
143
|
+
/>
|
|
144
|
+
</Pressable>
|
|
130
145
|
<SEText
|
|
131
146
|
type={descriptionType}
|
|
132
147
|
color={descriptionColor}
|
|
133
148
|
style={styles.valueText}
|
|
134
149
|
>
|
|
135
|
-
{description}
|
|
150
|
+
{masked ? '••••••' : description}
|
|
136
151
|
</SEText>
|
|
137
152
|
</View>
|
|
138
153
|
);
|
|
@@ -11,8 +11,8 @@ const variants = {
|
|
|
11
11
|
icon: { color: '#fff' },
|
|
12
12
|
label: { color: '#fff' },
|
|
13
13
|
badge: {
|
|
14
|
-
backgroundColor: '#
|
|
15
|
-
color: '#
|
|
14
|
+
backgroundColor: '#F7F9FF',
|
|
15
|
+
color: '#2A4FDA',
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
light: {
|
|
@@ -21,8 +21,8 @@ const variants = {
|
|
|
21
21
|
borderColor: '#E6ECFF',
|
|
22
22
|
borderWidth: 2,
|
|
23
23
|
},
|
|
24
|
-
icon: { color: '#
|
|
25
|
-
label: { color: '#
|
|
24
|
+
icon: { color: '#081032' },
|
|
25
|
+
label: { color: '#081032' },
|
|
26
26
|
badge: {
|
|
27
27
|
backgroundColor: '#111C44',
|
|
28
28
|
color: '#E2FF66',
|
|
@@ -73,7 +73,7 @@ const variants = {
|
|
|
73
73
|
borderColor: '#E2E9FC',
|
|
74
74
|
borderWidth: 2,
|
|
75
75
|
},
|
|
76
|
-
icon: { color: '#
|
|
76
|
+
icon: { color: '#081032' },
|
|
77
77
|
label: { color: '#081032' },
|
|
78
78
|
badge: {
|
|
79
79
|
backgroundColor: '#111C44',
|
|
@@ -85,7 +85,7 @@ const variants = {
|
|
|
85
85
|
backgroundColor: '#DDE6FC',
|
|
86
86
|
borderColor: '#DDE6FC',
|
|
87
87
|
},
|
|
88
|
-
icon: { color: '#
|
|
88
|
+
icon: { color: '#081032' },
|
|
89
89
|
label: { color: '#081032' },
|
|
90
90
|
badge: {
|
|
91
91
|
backgroundColor: '#111C44',
|
|
@@ -207,7 +207,7 @@ const styles = StyleSheet.create({
|
|
|
207
207
|
padding: 16,
|
|
208
208
|
position: 'relative',
|
|
209
209
|
backgroundColor: '#001A70',
|
|
210
|
-
overflow: '
|
|
210
|
+
overflow: 'visible',
|
|
211
211
|
},
|
|
212
212
|
containerWide: {
|
|
213
213
|
width: 156, // Mantém a mesma altura e ajusta largura para aspect ratio 39/34
|
|
@@ -224,11 +224,11 @@ const styles = StyleSheet.create({
|
|
|
224
224
|
},
|
|
225
225
|
badge: {
|
|
226
226
|
position: 'absolute',
|
|
227
|
-
top:
|
|
228
|
-
right:
|
|
227
|
+
top: -2,
|
|
228
|
+
right: -2,
|
|
229
229
|
paddingHorizontal: 12,
|
|
230
230
|
paddingVertical: 4,
|
|
231
|
-
borderTopRightRadius:
|
|
231
|
+
borderTopRightRadius: 10,
|
|
232
232
|
borderBottomLeftRadius: 8,
|
|
233
233
|
zIndex: 2,
|
|
234
234
|
minWidth: 40,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default NavigationButton;
|
|
2
|
-
declare function NavigationButton({ title, description, alertMessage, hideContent, maskedContent, showValueIcon, iconType, iconName, iconSize, iconColor, iconContainerSize, iconContainerRadius, iconContainerColor, titleType, titleColor, titleLineHeight, descriptionType, descriptionColor, descriptionLineHeight, alertIconName, alertIconSize, alertColor, valueIconName, valueIconSize, valueIconColor, showArrow, arrowIconName, arrowIconSize, arrowIconColor, labels, labelTextType, labelTextColor, labelIconSize, labelIconColor, dividerColor, variant, backgroundColor, filledBackgroundColor, borderColor, borderWidth, borderRadius, paddingHorizontal, paddingVertical, minHeight, onPress, style, }: {
|
|
2
|
+
declare function NavigationButton({ title, description, alertMessage, hideContent, maskedContent, showValueIcon, iconType, iconName, iconSize, iconColor, iconContainerSize, iconContainerRadius, iconContainerColor, titleType, titleColor, titleLineHeight, descriptionType, descriptionColor, descriptionLineHeight, alertIconName, alertIconSize, alertColor, valueIconName, maskedValueIconName, valueIconSize, valueIconColor, showArrow, arrowIconName, arrowIconSize, arrowIconColor, labels, labelTextType, labelTextColor, labelIconSize, labelIconColor, dividerColor, variant, backgroundColor, filledBackgroundColor, borderColor, borderWidth, borderRadius, paddingHorizontal, paddingVertical, minHeight, onPress, style, }: {
|
|
3
3
|
title?: string | undefined;
|
|
4
4
|
description?: string | undefined;
|
|
5
5
|
alertMessage?: null | undefined;
|
|
@@ -23,6 +23,7 @@ declare function NavigationButton({ title, description, alertMessage, hideConten
|
|
|
23
23
|
alertIconSize?: number | undefined;
|
|
24
24
|
alertColor?: string | undefined;
|
|
25
25
|
valueIconName?: string | undefined;
|
|
26
|
+
maskedValueIconName?: string | undefined;
|
|
26
27
|
valueIconSize?: number | undefined;
|
|
27
28
|
valueIconColor?: string | undefined;
|
|
28
29
|
showArrow?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/Tools/NavigationButton/index.jsx"],"names":[],"mappings":";AAMA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/Tools/NavigationButton/index.jsx"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAsSC;kBA5S+B,OAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { View, StyleSheet, Pressable } from 'react-native';
|
|
3
3
|
import SEText from '../../SEText';
|
|
4
4
|
import Icon from '../../Icon';
|
|
@@ -15,7 +15,7 @@ descriptionType = 'ns-xxs-body', descriptionColor = '#485274', descriptionLineHe
|
|
|
15
15
|
// Alerta
|
|
16
16
|
alertIconName = 'alert-line', alertIconSize = 16, alertColor = '#E53935',
|
|
17
17
|
// Valor com ícone
|
|
18
|
-
valueIconName = 'eye-line', valueIconSize = 16, valueIconColor = '#485274',
|
|
18
|
+
valueIconName = 'eye-line', maskedValueIconName = 'eye-off-line', valueIconSize = 16, valueIconColor = '#485274',
|
|
19
19
|
// Seta
|
|
20
20
|
showArrow = true, arrowIconName = 'arrow-right-line', arrowIconSize = 20, arrowIconColor = '#1B244B',
|
|
21
21
|
// Labels
|
|
@@ -39,15 +39,19 @@ onPress, style, }) => {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
const isCustomIcon = iconType && iconType !== 'Remix';
|
|
42
|
+
const [masked, setMasked] = useState(maskedContent);
|
|
42
43
|
const renderDescription = () => {
|
|
43
44
|
if (hideContent) {
|
|
44
45
|
return null;
|
|
45
46
|
}
|
|
46
47
|
if (maskedContent) {
|
|
48
|
+
const isCurrentlyMasked = masked;
|
|
47
49
|
return (<View style={styles.valueContainer}>
|
|
48
|
-
<
|
|
50
|
+
<Pressable onPress={() => setMasked((prev) => !prev)} hitSlop={8}>
|
|
51
|
+
<Icon name={isCurrentlyMasked ? maskedValueIconName : valueIconName} size={valueIconSize} color={valueIconColor}/>
|
|
52
|
+
</Pressable>
|
|
49
53
|
<SEText type={descriptionType} color={descriptionColor} style={styles.valueText}>
|
|
50
|
-
••••••
|
|
54
|
+
{isCurrentlyMasked ? '••••••' : description}
|
|
51
55
|
</SEText>
|
|
52
56
|
</View>);
|
|
53
57
|
}
|
|
@@ -61,9 +65,11 @@ onPress, style, }) => {
|
|
|
61
65
|
}
|
|
62
66
|
if (showValueIcon) {
|
|
63
67
|
return (<View style={styles.valueContainer}>
|
|
64
|
-
<
|
|
68
|
+
<Pressable onPress={() => setMasked((prev) => !prev)} hitSlop={8}>
|
|
69
|
+
<Icon name={masked ? maskedValueIconName : valueIconName} size={valueIconSize} color={valueIconColor}/>
|
|
70
|
+
</Pressable>
|
|
65
71
|
<SEText type={descriptionType} color={descriptionColor} style={styles.valueText}>
|
|
66
|
-
{description}
|
|
72
|
+
{masked ? '••••••' : description}
|
|
67
73
|
</SEText>
|
|
68
74
|
</View>);
|
|
69
75
|
}
|