@momo-kits/step 0.89.5 → 0.92.1-tracking.2

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.
@@ -2,7 +2,7 @@ import React, {FC} from 'react';
2
2
  import {View} from 'react-native';
3
3
  import {Step, StepsProps} from './types';
4
4
  import StepIcon from './StepIcon';
5
- import {Spacing, Text} from '@momo-kits/foundation';
5
+ import {Spacing, Text, getAccessibilityID} from '@momo-kits/foundation';
6
6
  import {getStepColor, getStepTypo} from './utils';
7
7
  import styles from './styles';
8
8
 
@@ -10,9 +10,11 @@ const StepsHorizontal: FC<StepsProps> = ({steps, size, activeIndex}) => {
10
10
  const renderStepItem = (i: Step, ii: number) => {
11
11
  const {title, description, error, time} = steps[ii];
12
12
  let typoStyle = getStepTypo(activeIndex, ii, error, size);
13
+ const {status} = getStepColor(activeIndex, ii, error, steps.length)
14
+ const accessibilityID = getAccessibilityID(`ic_step_${ii}_${status}`)
13
15
 
14
16
  return (
15
- <View key={`Step ${ii}`} style={{flex: 1, alignItems: 'center'}}>
17
+ <View {...accessibilityID} key={`Step ${ii}`} style={{flex: 1, alignItems: 'center'}}>
16
18
  {!!time && (
17
19
  <Text
18
20
  style={styles.textCenter}
@@ -85,6 +87,7 @@ const StepsHorizontal: FC<StepsProps> = ({steps, size, activeIndex}) => {
85
87
  return (
86
88
  <View style={{flexDirection: 'row'}}>
87
89
  {steps.map((i, ii) => {
90
+
88
91
  return renderStepItem(i, ii);
89
92
  })}
90
93
  </View>
package/StepsVertical.tsx CHANGED
@@ -2,17 +2,20 @@ import React, {FC, useContext} from 'react';
2
2
  import {View} from 'react-native';
3
3
  import {Step, StepsProps} from './types';
4
4
  import {getStepColor, getStepTypo} from './utils';
5
- import {ApplicationContext, Spacing, Text} from '@momo-kits/foundation';
5
+ import {ApplicationContext, getAccessibilityID, Spacing, Text} from '@momo-kits/foundation';
6
6
  import styles from './styles';
7
7
  import StepIcon from './StepIcon';
8
8
 
9
9
  const StepsVertical: FC<StepsProps> = ({steps, activeIndex, size}) => {
10
10
  const {theme} = useContext(ApplicationContext);
11
+
11
12
  const renderStepItem = (i: Step, ii: number) => {
12
13
  const {error, description, title, time} = steps[ii];
13
14
 
14
15
  const stepStyle = getStepColor(activeIndex, ii, error, steps.length);
15
16
  let typoStyle = getStepTypo(activeIndex, ii, error, size);
17
+ const {status} = getStepColor(activeIndex, ii, error, steps.length)
18
+ const accessibilityID = getAccessibilityID(`ic_step_${ii}_${status}`)
16
19
 
17
20
  const {backgroundColor, borderColor} = stepStyle;
18
21
  const lineColor =
@@ -21,6 +24,7 @@ const StepsVertical: FC<StepsProps> = ({steps, activeIndex, size}) => {
21
24
  : theme.colors.background.default;
22
25
  return (
23
26
  <View
27
+ {...accessibilityID}
24
28
  key={`Step ${ii}`}
25
29
  style={{
26
30
  flexDirection: 'row',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/step",
3
- "version": "0.89.5",
3
+ "version": "0.92.1-tracking.2",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "dependencies": {},
package/utils.ts CHANGED
@@ -122,5 +122,5 @@ export const getStepColor = (
122
122
  }
123
123
  }
124
124
 
125
- return {backgroundColor, borderColor, lineColorLeft, lineColorRight};
125
+ return {backgroundColor, borderColor, lineColorLeft, lineColorRight, status};
126
126
  };