vpt-sebraeds 0.0.52 → 0.0.53
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/Tools/NavigationButton/NavigationButton.stories.jsx +3 -1
- package/components/Tools/NavigationButton/index.jsx +20 -5
- 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
|
@@ -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
|
);
|
|
@@ -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
|
}
|