vpt-sebraeds 0.0.95 → 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.
@@ -28,6 +28,7 @@ const BottomSheet = ({
28
28
  headerAlignment = 'left',
29
29
  showsVerticalScrollIndicator = true,
30
30
  footer,
31
+ closeButtonTestID,
31
32
  }) => {
32
33
  const insets = useSafeAreaInsets();
33
34
 
@@ -96,7 +97,7 @@ const BottomSheet = ({
96
97
  <View style={bottomSheetListStyle}>
97
98
  {showHeader && (
98
99
  <View style={[styles.modalHeader, fullScreen && { paddingTop: insets.top }]}>
99
- <TouchableOpacity onPress={() => setIsOpen(false)} style={styles.closeButton}>
100
+ <TouchableOpacity onPress={() => setIsOpen(false)} style={styles.closeButton} testID={closeButtonTestID}>
100
101
  <Icon name="close-line" size={20} color="#666666" />
101
102
  </TouchableOpacity>
102
103
  </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
- {getDisplayName(selectedList[0])}
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
- {getDisplayName(selectedList[0])}
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
- {selectedEnterprise ? getDisplayName(selectedEnterprise) : 'Empresa'}
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, showsVerticalScrollIndicator, footer, }: {
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;
@@ -12,6 +12,7 @@ declare function BottomSheet({ isOpen, setIsOpen, children, title, subtitle, sho
12
12
  headerAlignment?: string | undefined;
13
13
  showsVerticalScrollIndicator?: boolean | undefined;
14
14
  footer: any;
15
+ closeButtonTestID: any;
15
16
  }): React.JSX.Element;
16
17
  import React from 'react';
17
18
  //# sourceMappingURL=BottomSheet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../components/BottomSheet/BottomSheet.jsx"],"names":[],"mappings":";AAiBA;;;;;;;;;;;;;sBAiIC;kBAlJiB,OAAO"}
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', showsVerticalScrollIndicator = true, footer, }) => {
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>)}
@@ -1 +1 @@
1
- {"version":3,"file":"BackButton.d.ts","sourceRoot":"","sources":["../../../../../components/Header/v2/parts/BackButton.jsx"],"names":[],"mappings":"AAKA;;;;;sBAoBC;kBAzBiB,OAAO"}
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;;;;;;;sBAkSC;kBA1S2D,OAAO"}
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
- {getDisplayName(selectedList[0])}
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
- {getDisplayName(selectedList[0])}
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
- {selectedEnterprise ? getDisplayName(selectedEnterprise) : 'Empresa'}
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;;;;;sBAwCC;;;;;;;;;;;;;;;QAaW,mCAAS;;;;kBAhEH,OAAO"}
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;;;;;;;;;;;;;;;;;;;6BAsJC;;;;;;;;;;;;;;;;;;;;;;;kBA5JiB,OAAO"}
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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpt-sebraeds",
3
- "version": "0.0.95",
3
+ "version": "0.0.96",
4
4
  "description": "Biblioteca de componentes React Native do Sebrae",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",