vpt-sebraeds 0.0.94 → 0.0.96
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/BottomSheet/BottomSheet.jsx +11 -2
- package/components/Header/v2/parts/BackButton.jsx +2 -1
- package/components/Header/v2/parts/Hero.jsx +3 -3
- package/components/Header/v2/parts/SwitchAccount.jsx +13 -3
- package/components/RadioButton/index.jsx +4 -1
- package/components/StackedBar/index.jsx +3 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts +4 -1
- package/dist/components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +7 -3
- package/dist/components/Header/v2/parts/BackButton.d.ts.map +1 -1
- package/dist/components/Header/v2/parts/BackButton.js +2 -2
- package/dist/components/Header/v2/parts/Hero.js +3 -3
- package/dist/components/Header/v2/parts/SwitchAccount.d.ts.map +1 -1
- package/dist/components/Header/v2/parts/SwitchAccount.js +10 -3
- package/dist/components/RadioButton/index.d.ts +5 -1
- package/dist/components/RadioButton/index.d.ts.map +1 -1
- package/dist/components/RadioButton/index.js +4 -2
- package/dist/components/StackedBar/index.d.ts +3 -1
- package/dist/components/StackedBar/index.d.ts.map +1 -1
- package/dist/components/StackedBar/index.js +3 -2
- package/package.json +1 -1
|
@@ -26,6 +26,9 @@ const BottomSheet = ({
|
|
|
26
26
|
tall = false,
|
|
27
27
|
headerIcon = null,
|
|
28
28
|
headerAlignment = 'left',
|
|
29
|
+
showsVerticalScrollIndicator = true,
|
|
30
|
+
footer,
|
|
31
|
+
closeButtonTestID,
|
|
29
32
|
}) => {
|
|
30
33
|
const insets = useSafeAreaInsets();
|
|
31
34
|
|
|
@@ -94,7 +97,7 @@ const BottomSheet = ({
|
|
|
94
97
|
<View style={bottomSheetListStyle}>
|
|
95
98
|
{showHeader && (
|
|
96
99
|
<View style={[styles.modalHeader, fullScreen && { paddingTop: insets.top }]}>
|
|
97
|
-
<TouchableOpacity onPress={() => setIsOpen(false)} style={styles.closeButton}>
|
|
100
|
+
<TouchableOpacity onPress={() => setIsOpen(false)} style={styles.closeButton} testID={closeButtonTestID}>
|
|
98
101
|
<Icon name="close-line" size={20} color="#666666" />
|
|
99
102
|
</TouchableOpacity>
|
|
100
103
|
</View>
|
|
@@ -119,7 +122,7 @@ const BottomSheet = ({
|
|
|
119
122
|
)}
|
|
120
123
|
|
|
121
124
|
<ScrollView
|
|
122
|
-
showsVerticalScrollIndicator={
|
|
125
|
+
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
|
|
123
126
|
contentContainerStyle={styles.scrollContent}
|
|
124
127
|
style={scrollViewStyle}
|
|
125
128
|
keyboardShouldPersistTaps="handled"
|
|
@@ -130,6 +133,12 @@ const BottomSheet = ({
|
|
|
130
133
|
>
|
|
131
134
|
<View style={styles.contentContainer}>{children}</View>
|
|
132
135
|
</ScrollView>
|
|
136
|
+
|
|
137
|
+
{footer != null && (
|
|
138
|
+
<View style={{ paddingBottom: insets.bottom }}>
|
|
139
|
+
{footer}
|
|
140
|
+
</View>
|
|
141
|
+
)}
|
|
133
142
|
</View>
|
|
134
143
|
</View>
|
|
135
144
|
</View>
|
|
@@ -9,7 +9,7 @@ export default function BackButton({
|
|
|
9
9
|
iconSize = 24,
|
|
10
10
|
style
|
|
11
11
|
}) {
|
|
12
|
-
const { onClickGoBack } = useHeaderV2()
|
|
12
|
+
const { onClickGoBack, testIDPrefix } = useHeaderV2()
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
15
|
<TouchableOpacity
|
|
@@ -19,6 +19,7 @@ export default function BackButton({
|
|
|
19
19
|
{ backgroundColor: containerColor },
|
|
20
20
|
style
|
|
21
21
|
]}
|
|
22
|
+
testID={testIDPrefix ? `${testIDPrefix}.BackButton` : undefined}
|
|
22
23
|
>
|
|
23
24
|
<Icon name='arrow-left-line' size={iconSize} color={iconColor} />
|
|
24
25
|
</TouchableOpacity>
|
|
@@ -26,13 +26,13 @@ export default function Hero({
|
|
|
26
26
|
<View style={styles.wrapper}>
|
|
27
27
|
{onUserRedirect ? (
|
|
28
28
|
<TouchableOpacity onPress={onUserRedirect} style={{ flexDirection: 'row', alignItems: 'center' }} testID={testIDPrefix ? `${testIDPrefix}.Greeting` : undefined}>
|
|
29
|
-
<SEText size={18} color={textColor}>{resolvedGreeting}</SEText>
|
|
29
|
+
<SEText size={18} color={textColor} testID={testIDPrefix ? `${testIDPrefix}.GreetingText` : undefined}>{resolvedGreeting}</SEText>
|
|
30
30
|
<Icon name="arrow-right-line" color={textColor} size={16} style={{ marginLeft: 8 }} />
|
|
31
31
|
</TouchableOpacity>
|
|
32
32
|
) : (
|
|
33
|
-
<SEText size={18} color={textColor}>{resolvedGreeting}</SEText>
|
|
33
|
+
<SEText size={18} color={textColor} testID={testIDPrefix ? `${testIDPrefix}.GreetingText` : undefined}>{resolvedGreeting}</SEText>
|
|
34
34
|
)}
|
|
35
|
-
<SEText size={28} color={textColor} bold>{resolvedTitle}</SEText>
|
|
35
|
+
<SEText size={28} color={textColor} bold testID={testIDPrefix ? `${testIDPrefix}.Title` : undefined}>{resolvedTitle}</SEText>
|
|
36
36
|
</View>
|
|
37
37
|
<Shortcut shortcutsList={shortcuts} testIDPrefix={testIDPrefix} />
|
|
38
38
|
</View>
|
|
@@ -50,6 +50,16 @@ export default function SwitchAccount({ accounts = [], forceAddEnterprise = fals
|
|
|
50
50
|
[accountsToUse]
|
|
51
51
|
)
|
|
52
52
|
|
|
53
|
+
const displayNameFor = (acc) => {
|
|
54
|
+
if (!acc) return 'Empresa'
|
|
55
|
+
const match = accountsWithDisplayName.find(
|
|
56
|
+
(a) =>
|
|
57
|
+
(a?.cnpj && acc?.cnpj && a.cnpj === acc.cnpj) ||
|
|
58
|
+
(a?.id !== undefined && acc?.id !== undefined && a.id === acc.id)
|
|
59
|
+
)
|
|
60
|
+
return getDisplayName(match || acc)
|
|
61
|
+
}
|
|
62
|
+
|
|
53
63
|
// Ordena as contas colocando a selecionada primeiro
|
|
54
64
|
const orderedAccounts = useMemo(() => {
|
|
55
65
|
if (!selectedEnterprise || accountsWithDisplayName.length === 0) {
|
|
@@ -202,7 +212,7 @@ export default function SwitchAccount({ accounts = [], forceAddEnterprise = fals
|
|
|
202
212
|
if (selectedList.length === 1) {
|
|
203
213
|
return (
|
|
204
214
|
<SEText type='ns-heading-5' color={isWhiteTheme ? whiteThemeTextColor : '#fff'} numberOfLines={1} style={{ flex: 1 }}>
|
|
205
|
-
{
|
|
215
|
+
{displayNameFor(selectedList[0])}
|
|
206
216
|
</SEText>
|
|
207
217
|
)
|
|
208
218
|
}
|
|
@@ -211,7 +221,7 @@ export default function SwitchAccount({ accounts = [], forceAddEnterprise = fals
|
|
|
211
221
|
<View style={{ flex: 1, flexDirection: 'row', alignItems: 'center', gap: 8, overflow: 'hidden' }}>
|
|
212
222
|
<View style={[styles.tag, { flexShrink: 1 }, isWhiteTheme && styles.tagWhite]}>
|
|
213
223
|
<SEText type='ns-sm-body' color={isWhiteTheme ? '#001152' : '#fff'} numberOfLines={1}>
|
|
214
|
-
{
|
|
224
|
+
{displayNameFor(selectedList[0])}
|
|
215
225
|
</SEText>
|
|
216
226
|
</View>
|
|
217
227
|
<View style={[styles.tag, isWhiteTheme && styles.tagWhite]}>
|
|
@@ -239,7 +249,7 @@ export default function SwitchAccount({ accounts = [], forceAddEnterprise = fals
|
|
|
239
249
|
renderTags()
|
|
240
250
|
) : (
|
|
241
251
|
<SEText type='ns-heading-5' color={isWhiteTheme ? whiteThemeTextColor : '#fff'} numberOfLines={1} style={{ flex: 1 }}>
|
|
242
|
-
{
|
|
252
|
+
{displayNameFor(selectedEnterprise)}
|
|
243
253
|
</SEText>
|
|
244
254
|
)}
|
|
245
255
|
<Icon name={visible ? 'arrow-up-s-line' : 'arrow-down-s-line'} size={20} color={isWhiteTheme ? whiteThemeTextColor : '#fff'} />
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import useFocus from '../../styles/useFocus';
|
|
10
10
|
import { fontFamily } from '../utils/fontFamily';
|
|
11
11
|
|
|
12
|
-
const RadioButton = ({ label, checked, disabled, onChange }) => {
|
|
12
|
+
const RadioButton = ({ label, checked, disabled, onChange, testID }) => {
|
|
13
13
|
const { focus, blur, focusedStyle } = useFocus();
|
|
14
14
|
|
|
15
15
|
return (
|
|
@@ -23,6 +23,7 @@ const RadioButton = ({ label, checked, disabled, onChange }) => {
|
|
|
23
23
|
onPressOut={blur}
|
|
24
24
|
disabled={disabled}
|
|
25
25
|
activeOpacity={0.8}
|
|
26
|
+
testID={testID}
|
|
26
27
|
>
|
|
27
28
|
<View
|
|
28
29
|
style={[
|
|
@@ -56,6 +57,7 @@ RadioButton.propTypes = {
|
|
|
56
57
|
checked: PropTypes.bool,
|
|
57
58
|
disabled: PropTypes.bool,
|
|
58
59
|
onChange: PropTypes.func,
|
|
60
|
+
testID: PropTypes.string,
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
RadioButton.defaultProps = {
|
|
@@ -63,6 +65,7 @@ RadioButton.defaultProps = {
|
|
|
63
65
|
checked: false,
|
|
64
66
|
disabled: false,
|
|
65
67
|
onChange: () => { },
|
|
68
|
+
testID: undefined,
|
|
66
69
|
};
|
|
67
70
|
|
|
68
71
|
const styles = StyleSheet.create({
|
|
@@ -23,6 +23,7 @@ const StackedBar = ({
|
|
|
23
23
|
valueStyle,
|
|
24
24
|
style,
|
|
25
25
|
testID,
|
|
26
|
+
testIDPrefix,
|
|
26
27
|
}) => {
|
|
27
28
|
if (!segments || segments.length === 0) return null;
|
|
28
29
|
|
|
@@ -88,6 +89,7 @@ const StackedBar = ({
|
|
|
88
89
|
return (
|
|
89
90
|
<View
|
|
90
91
|
key={`seg-${i}`}
|
|
92
|
+
testID={seg.testID ?? (testIDPrefix && seg.key != null ? `${testIDPrefix}.Bar.${seg.key}` : undefined)}
|
|
91
93
|
style={[
|
|
92
94
|
styles.segment,
|
|
93
95
|
{
|
|
@@ -187,6 +189,7 @@ StackedBar.propTypes = {
|
|
|
187
189
|
valueStyle: PropTypes.object,
|
|
188
190
|
style: PropTypes.object,
|
|
189
191
|
testID: PropTypes.string,
|
|
192
|
+
testIDPrefix: PropTypes.string,
|
|
190
193
|
};
|
|
191
194
|
|
|
192
195
|
const styles = StyleSheet.create({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default BottomSheet;
|
|
2
|
-
declare function BottomSheet({ isOpen, setIsOpen, children, title, subtitle, showHeader, fullScreen, tall, headerIcon, headerAlignment, }: {
|
|
2
|
+
declare function BottomSheet({ isOpen, setIsOpen, children, title, subtitle, showHeader, fullScreen, tall, headerIcon, headerAlignment, showsVerticalScrollIndicator, footer, closeButtonTestID, }: {
|
|
3
3
|
isOpen?: boolean | undefined;
|
|
4
4
|
setIsOpen?: (() => void) | undefined;
|
|
5
5
|
children: any;
|
|
@@ -10,6 +10,9 @@ declare function BottomSheet({ isOpen, setIsOpen, children, title, subtitle, sho
|
|
|
10
10
|
tall?: boolean | undefined;
|
|
11
11
|
headerIcon?: null | undefined;
|
|
12
12
|
headerAlignment?: string | undefined;
|
|
13
|
+
showsVerticalScrollIndicator?: boolean | undefined;
|
|
14
|
+
footer: any;
|
|
15
|
+
closeButtonTestID: any;
|
|
13
16
|
}): React.JSX.Element;
|
|
14
17
|
import React from 'react';
|
|
15
18
|
//# sourceMappingURL=BottomSheet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../components/BottomSheet/BottomSheet.jsx"],"names":[],"mappings":";AAiBA
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../components/BottomSheet/BottomSheet.jsx"],"names":[],"mappings":";AAiBA;;;;;;;;;;;;;;sBAkIC;kBAnJiB,OAAO"}
|
|
@@ -4,7 +4,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
4
4
|
import Icon from '../Icon';
|
|
5
5
|
import SEText from '../Typography/SEText';
|
|
6
6
|
const { height: screenHeight, width: screenWidth } = Dimensions.get('window');
|
|
7
|
-
const BottomSheet = ({ isOpen = false, setIsOpen = () => { }, children, title, subtitle, showHeader = true, fullScreen = false, tall = false, headerIcon = null, headerAlignment = 'left', }) => {
|
|
7
|
+
const BottomSheet = ({ isOpen = false, setIsOpen = () => { }, children, title, subtitle, showHeader = true, fullScreen = false, tall = false, headerIcon = null, headerAlignment = 'left', showsVerticalScrollIndicator = true, footer, closeButtonTestID, }) => {
|
|
8
8
|
const insets = useSafeAreaInsets();
|
|
9
9
|
const isHeaderCentered = headerAlignment === 'center';
|
|
10
10
|
const validTitle = title && typeof title === 'string' ? title : '';
|
|
@@ -56,7 +56,7 @@ const BottomSheet = ({ isOpen = false, setIsOpen = () => { }, children, title, s
|
|
|
56
56
|
<View style={[modalContainerStyle, { zIndex: 1 }]}>
|
|
57
57
|
<View style={bottomSheetListStyle}>
|
|
58
58
|
{showHeader && (<View style={[styles.modalHeader, fullScreen && { paddingTop: insets.top }]}>
|
|
59
|
-
<TouchableOpacity onPress={() => setIsOpen(false)} style={styles.closeButton}>
|
|
59
|
+
<TouchableOpacity onPress={() => setIsOpen(false)} style={styles.closeButton} testID={closeButtonTestID}>
|
|
60
60
|
<Icon name="close-line" size={20} color="#666666"/>
|
|
61
61
|
</TouchableOpacity>
|
|
62
62
|
</View>)}
|
|
@@ -73,9 +73,13 @@ const BottomSheet = ({ isOpen = false, setIsOpen = () => { }, children, title, s
|
|
|
73
73
|
</SEText>)}
|
|
74
74
|
</View>)}
|
|
75
75
|
|
|
76
|
-
<ScrollView showsVerticalScrollIndicator={
|
|
76
|
+
<ScrollView showsVerticalScrollIndicator={showsVerticalScrollIndicator} contentContainerStyle={styles.scrollContent} style={scrollViewStyle} keyboardShouldPersistTaps="handled" bounces={Platform.OS === 'ios'} nestedScrollEnabled scrollEventThrottle={16} keyboardDismissMode="on-drag">
|
|
77
77
|
<View style={styles.contentContainer}>{children}</View>
|
|
78
78
|
</ScrollView>
|
|
79
|
+
|
|
80
|
+
{footer != null && (<View style={{ paddingBottom: insets.bottom }}>
|
|
81
|
+
{footer}
|
|
82
|
+
</View>)}
|
|
79
83
|
</View>
|
|
80
84
|
</View>
|
|
81
85
|
</View>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackButton.d.ts","sourceRoot":"","sources":["../../../../../components/Header/v2/parts/BackButton.jsx"],"names":[],"mappings":"AAKA;;;;;
|
|
1
|
+
{"version":3,"file":"BackButton.d.ts","sourceRoot":"","sources":["../../../../../components/Header/v2/parts/BackButton.jsx"],"names":[],"mappings":"AAKA;;;;;sBAqBC;kBA1BiB,OAAO"}
|
|
@@ -3,12 +3,12 @@ import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
|
3
3
|
import Icon from '../../../Icon';
|
|
4
4
|
import { useHeaderV2 } from './Context';
|
|
5
5
|
export default function BackButton({ iconColor = '#485274', containerColor = '#F4F4F4', iconSize = 24, style }) {
|
|
6
|
-
const { onClickGoBack } = useHeaderV2();
|
|
6
|
+
const { onClickGoBack, testIDPrefix } = useHeaderV2();
|
|
7
7
|
return (<TouchableOpacity onPress={onClickGoBack} style={[
|
|
8
8
|
styles.container,
|
|
9
9
|
{ backgroundColor: containerColor },
|
|
10
10
|
style
|
|
11
|
-
]}>
|
|
11
|
+
]} testID={testIDPrefix ? `${testIDPrefix}.BackButton` : undefined}>
|
|
12
12
|
<Icon name='arrow-left-line' size={iconSize} color={iconColor}/>
|
|
13
13
|
</TouchableOpacity>);
|
|
14
14
|
}
|
|
@@ -12,10 +12,10 @@ export default function Hero({ userName, onUserRedirect, shortcuts = [], show =
|
|
|
12
12
|
return (<View style={[styles.container, { backgroundColor }]}>
|
|
13
13
|
<View style={styles.wrapper}>
|
|
14
14
|
{onUserRedirect ? (<TouchableOpacity onPress={onUserRedirect} style={{ flexDirection: 'row', alignItems: 'center' }} testID={testIDPrefix ? `${testIDPrefix}.Greeting` : undefined}>
|
|
15
|
-
<SEText size={18} color={textColor}>{resolvedGreeting}</SEText>
|
|
15
|
+
<SEText size={18} color={textColor} testID={testIDPrefix ? `${testIDPrefix}.GreetingText` : undefined}>{resolvedGreeting}</SEText>
|
|
16
16
|
<Icon name="arrow-right-line" color={textColor} size={16} style={{ marginLeft: 8 }}/>
|
|
17
|
-
</TouchableOpacity>) : (<SEText size={18} color={textColor}>{resolvedGreeting}</SEText>)}
|
|
18
|
-
<SEText size={28} color={textColor} bold>{resolvedTitle}</SEText>
|
|
17
|
+
</TouchableOpacity>) : (<SEText size={18} color={textColor} testID={testIDPrefix ? `${testIDPrefix}.GreetingText` : undefined}>{resolvedGreeting}</SEText>)}
|
|
18
|
+
<SEText size={28} color={textColor} bold testID={testIDPrefix ? `${testIDPrefix}.Title` : undefined}>{resolvedTitle}</SEText>
|
|
19
19
|
</View>
|
|
20
20
|
<Shortcut shortcutsList={shortcuts} testIDPrefix={testIDPrefix}/>
|
|
21
21
|
</View>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchAccount.d.ts","sourceRoot":"","sources":["../../../../../components/Header/v2/parts/SwitchAccount.jsx"],"names":[],"mappings":"AAQA;;;;;;;
|
|
1
|
+
{"version":3,"file":"SwitchAccount.d.ts","sourceRoot":"","sources":["../../../../../components/Header/v2/parts/SwitchAccount.jsx"],"names":[],"mappings":"AAQA;;;;;;;sBA4SC;kBApT2D,OAAO"}
|
|
@@ -36,6 +36,13 @@ export default function SwitchAccount({ accounts = [], forceAddEnterprise = fals
|
|
|
36
36
|
return getDisplayName(item) === getDisplayName(selectedEnterprise);
|
|
37
37
|
}, [selectedEnterprise, multiple]);
|
|
38
38
|
const accountsWithDisplayName = useMemo(() => accountsToUse.map((acc) => ({ ...acc, displayName: getDisplayName(acc) })), [accountsToUse]);
|
|
39
|
+
const displayNameFor = (acc) => {
|
|
40
|
+
if (!acc)
|
|
41
|
+
return 'Empresa';
|
|
42
|
+
const match = accountsWithDisplayName.find((a) => (a?.cnpj && acc?.cnpj && a.cnpj === acc.cnpj) ||
|
|
43
|
+
(a?.id !== undefined && acc?.id !== undefined && a.id === acc.id));
|
|
44
|
+
return getDisplayName(match || acc);
|
|
45
|
+
};
|
|
39
46
|
// Ordena as contas colocando a selecionada primeiro
|
|
40
47
|
const orderedAccounts = useMemo(() => {
|
|
41
48
|
if (!selectedEnterprise || accountsWithDisplayName.length === 0) {
|
|
@@ -165,13 +172,13 @@ export default function SwitchAccount({ accounts = [], forceAddEnterprise = fals
|
|
|
165
172
|
}
|
|
166
173
|
if (selectedList.length === 1) {
|
|
167
174
|
return (<SEText type='ns-heading-5' color={isWhiteTheme ? whiteThemeTextColor : '#fff'} numberOfLines={1} style={{ flex: 1 }}>
|
|
168
|
-
{
|
|
175
|
+
{displayNameFor(selectedList[0])}
|
|
169
176
|
</SEText>);
|
|
170
177
|
}
|
|
171
178
|
return (<View style={{ flex: 1, flexDirection: 'row', alignItems: 'center', gap: 8, overflow: 'hidden' }}>
|
|
172
179
|
<View style={[styles.tag, { flexShrink: 1 }, isWhiteTheme && styles.tagWhite]}>
|
|
173
180
|
<SEText type='ns-sm-body' color={isWhiteTheme ? '#001152' : '#fff'} numberOfLines={1}>
|
|
174
|
-
{
|
|
181
|
+
{displayNameFor(selectedList[0])}
|
|
175
182
|
</SEText>
|
|
176
183
|
</View>
|
|
177
184
|
<View style={[styles.tag, isWhiteTheme && styles.tagWhite]}>
|
|
@@ -188,7 +195,7 @@ export default function SwitchAccount({ accounts = [], forceAddEnterprise = fals
|
|
|
188
195
|
{ opacity: pressed ? 0.8 : 1 }
|
|
189
196
|
]} testID={testIDPrefix ? `${testIDPrefix}.SwitchAccount.Trigger` : undefined}>
|
|
190
197
|
{multiple ? (renderTags()) : (<SEText type='ns-heading-5' color={isWhiteTheme ? whiteThemeTextColor : '#fff'} numberOfLines={1} style={{ flex: 1 }}>
|
|
191
|
-
{
|
|
198
|
+
{displayNameFor(selectedEnterprise)}
|
|
192
199
|
</SEText>)}
|
|
193
200
|
<Icon name={visible ? 'arrow-up-s-line' : 'arrow-down-s-line'} size={20} color={isWhiteTheme ? whiteThemeTextColor : '#fff'}/>
|
|
194
201
|
</Pressable>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default RadioButton;
|
|
2
|
-
declare function RadioButton({ label, checked, disabled, onChange }: {
|
|
2
|
+
declare function RadioButton({ label, checked, disabled, onChange, testID }: {
|
|
3
3
|
label: any;
|
|
4
4
|
checked: any;
|
|
5
5
|
disabled: any;
|
|
6
6
|
onChange: any;
|
|
7
|
+
testID: any;
|
|
7
8
|
}): React.JSX.Element;
|
|
8
9
|
declare namespace RadioButton {
|
|
9
10
|
namespace propTypes {
|
|
@@ -11,6 +12,7 @@ declare namespace RadioButton {
|
|
|
11
12
|
let checked: any;
|
|
12
13
|
let disabled: any;
|
|
13
14
|
let onChange: any;
|
|
15
|
+
let testID: any;
|
|
14
16
|
}
|
|
15
17
|
namespace defaultProps {
|
|
16
18
|
let label_1: string;
|
|
@@ -21,6 +23,8 @@ declare namespace RadioButton {
|
|
|
21
23
|
export { disabled_1 as disabled };
|
|
22
24
|
export function onChange_1(): void;
|
|
23
25
|
export { onChange_1 as onChange };
|
|
26
|
+
let testID_1: undefined;
|
|
27
|
+
export { testID_1 as testID };
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
import React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/RadioButton/index.jsx"],"names":[],"mappings":";AAWA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/RadioButton/index.jsx"],"names":[],"mappings":";AAWA;;;;;;sBAyCC;;;;;;;;;;;;;;;;QAcW,mCAAS;;;;;;kBAlEH,OAAO"}
|
|
@@ -3,12 +3,12 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { View, Text, TouchableOpacity, StyleSheet, } from 'react-native';
|
|
4
4
|
import useFocus from '../../styles/useFocus';
|
|
5
5
|
import { fontFamily } from '../utils/fontFamily';
|
|
6
|
-
const RadioButton = ({ label, checked, disabled, onChange }) => {
|
|
6
|
+
const RadioButton = ({ label, checked, disabled, onChange, testID }) => {
|
|
7
7
|
const { focus, blur, focusedStyle } = useFocus();
|
|
8
8
|
return (<TouchableOpacity style={[
|
|
9
9
|
styles.container,
|
|
10
10
|
disabled && styles.containerDisabled,
|
|
11
|
-
]} onPress={onChange} onPressIn={focus} onPressOut={blur} disabled={disabled} activeOpacity={0.8}>
|
|
11
|
+
]} onPress={onChange} onPressIn={focus} onPressOut={blur} disabled={disabled} activeOpacity={0.8} testID={testID}>
|
|
12
12
|
<View style={[
|
|
13
13
|
styles.radioButton,
|
|
14
14
|
focusedStyle,
|
|
@@ -33,12 +33,14 @@ RadioButton.propTypes = {
|
|
|
33
33
|
checked: PropTypes.bool,
|
|
34
34
|
disabled: PropTypes.bool,
|
|
35
35
|
onChange: PropTypes.func,
|
|
36
|
+
testID: PropTypes.string,
|
|
36
37
|
};
|
|
37
38
|
RadioButton.defaultProps = {
|
|
38
39
|
label: '',
|
|
39
40
|
checked: false,
|
|
40
41
|
disabled: false,
|
|
41
42
|
onChange: () => { },
|
|
43
|
+
testID: undefined,
|
|
42
44
|
};
|
|
43
45
|
const styles = StyleSheet.create({
|
|
44
46
|
container: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default StackedBar;
|
|
2
|
-
declare function StackedBar({ segments, height, borderRadius, showLabels, showValues, showDividers, showStartDivider, maxSegmentsForDividers, dividerWidth, dividerHeight, dividerColor, dividerBorderWidth, dividerBorderColor, labelGap, labelStyle, valueStyle, style, testID, }: {
|
|
2
|
+
declare function StackedBar({ segments, height, borderRadius, showLabels, showValues, showDividers, showStartDivider, maxSegmentsForDividers, dividerWidth, dividerHeight, dividerColor, dividerBorderWidth, dividerBorderColor, labelGap, labelStyle, valueStyle, style, testID, testIDPrefix, }: {
|
|
3
3
|
segments?: never[] | undefined;
|
|
4
4
|
height?: number | undefined;
|
|
5
5
|
borderRadius?: number | undefined;
|
|
@@ -18,6 +18,7 @@ declare function StackedBar({ segments, height, borderRadius, showLabels, showVa
|
|
|
18
18
|
valueStyle: any;
|
|
19
19
|
style: any;
|
|
20
20
|
testID: any;
|
|
21
|
+
testIDPrefix: any;
|
|
21
22
|
}): React.JSX.Element | null;
|
|
22
23
|
declare namespace StackedBar {
|
|
23
24
|
namespace propTypes {
|
|
@@ -39,6 +40,7 @@ declare namespace StackedBar {
|
|
|
39
40
|
let valueStyle: any;
|
|
40
41
|
let style: any;
|
|
41
42
|
let testID: any;
|
|
43
|
+
let testIDPrefix: any;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
import React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/StackedBar/index.jsx"],"names":[],"mappings":";AAMA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/StackedBar/index.jsx"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;;;;;;;6BAwJC;;;;;;;;;;;;;;;;;;;;;;;;kBA9JiB,OAAO"}
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { View, StyleSheet } from 'react-native';
|
|
4
4
|
import SEText from '../Typography/SEText';
|
|
5
5
|
import { fontFamily } from '../utils/fontFamily';
|
|
6
|
-
const StackedBar = ({ segments = [], height = 16, borderRadius = 100, showLabels = true, showValues = true, showDividers, showStartDivider = false, maxSegmentsForDividers = 5, dividerWidth = 2, dividerHeight = 48, dividerColor = '#C0C9E5', dividerBorderWidth = 2, dividerBorderColor = '#FFFFFF', labelGap = 12, labelStyle, valueStyle, style, testID, }) => {
|
|
6
|
+
const StackedBar = ({ segments = [], height = 16, borderRadius = 100, showLabels = true, showValues = true, showDividers, showStartDivider = false, maxSegmentsForDividers = 5, dividerWidth = 2, dividerHeight = 48, dividerColor = '#C0C9E5', dividerBorderWidth = 2, dividerBorderColor = '#FFFFFF', labelGap = 12, labelStyle, valueStyle, style, testID, testIDPrefix, }) => {
|
|
7
7
|
if (!segments || segments.length === 0)
|
|
8
8
|
return null;
|
|
9
9
|
const totalPercentage = segments.reduce((sum, s) => sum + (s.percentage || 0), 0);
|
|
@@ -48,7 +48,7 @@ const StackedBar = ({ segments = [], height = 16, borderRadius = 100, showLabels
|
|
|
48
48
|
const pct = seg.percentage || 0;
|
|
49
49
|
const isLast = i === segments.length - 1 && totalPercentage >= 100;
|
|
50
50
|
const isEmpty = pct === 0;
|
|
51
|
-
return (<View key={`seg-${i}`} style={[
|
|
51
|
+
return (<View key={`seg-${i}`} testID={seg.testID ?? (testIDPrefix && seg.key != null ? `${testIDPrefix}.Bar.${seg.key}` : undefined)} style={[
|
|
52
52
|
styles.segment,
|
|
53
53
|
{
|
|
54
54
|
width: isEmpty ? '100%' : `${pct}%`,
|
|
@@ -127,6 +127,7 @@ StackedBar.propTypes = {
|
|
|
127
127
|
valueStyle: PropTypes.object,
|
|
128
128
|
style: PropTypes.object,
|
|
129
129
|
testID: PropTypes.string,
|
|
130
|
+
testIDPrefix: PropTypes.string,
|
|
130
131
|
};
|
|
131
132
|
const styles = StyleSheet.create({
|
|
132
133
|
container: {
|