@momo-kits/step 0.167.2-beta.1 → 0.168.1-beta.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.
package/StepsVertical.tsx CHANGED
@@ -29,10 +29,8 @@ const StepsVertical: FC<StepsProps> = ({
29
29
  const typoStyle = GetStepTypo(activeIndex, index, error, size, 'vertical');
30
30
 
31
31
  const { backgroundColor, borderColor } = stepStyle;
32
- const lineColor =
33
- activeIndex > index
34
- ? theme.colors.primary + '33'
35
- : theme.colors.border.default;
32
+ const { primary, border } = theme.colors;
33
+ const lineColor = activeIndex > index ? primary + '33' : border.default;
36
34
 
37
35
  /**
38
36
  * build description
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/step",
3
- "version": "0.167.2-beta.1",
3
+ "version": "0.168.1-beta.2",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "peerDependencies": {
package/utils.ts CHANGED
@@ -34,23 +34,20 @@ const getTypoTitle = (
34
34
  size?: 'small' | 'large',
35
35
  stepType?: 'vertical' | 'horizontal'
36
36
  ): Typography => {
37
- const defaultTypo =
38
- !!size && stepType === 'vertical'
39
- ? 'body_default_regular'
40
- : 'description_default_regular';
37
+ let defaultTypo: Typography = 'description_default_regular';
38
+ if (size && stepType === 'vertical') {
39
+ defaultTypo = 'body_default_regular';
40
+ }
41
+ const isCompact = checkSizeAndStepType(stepType, size);
41
42
 
42
43
  switch (status) {
43
44
  case 'current':
44
45
  case 'error': {
45
- return checkSizeAndStepType(stepType, size)
46
- ? 'header_xs_semibold'
47
- : 'header_s_semibold';
46
+ return isCompact ? 'header_xs_semibold' : 'header_s_semibold';
48
47
  }
49
48
  case 'incomplete':
50
49
  case 'completed': {
51
- return checkSizeAndStepType(stepType, size)
52
- ? 'description_default_regular'
53
- : 'body_default_regular';
50
+ return isCompact ? 'description_default_regular' : 'body_default_regular';
54
51
  }
55
52
  default: {
56
53
  return defaultTypo;
@@ -74,9 +71,7 @@ export const GetStepTypo = (
74
71
  };
75
72
  let description: StepTypo = {
76
73
  color: theme.colors.text.hint,
77
- typography: !!size
78
- ? 'description_xs_regular'
79
- : 'description_default_regular',
74
+ typography: size ? 'description_xs_regular' : 'description_default_regular',
80
75
  };
81
76
  let time: StepTypo = {
82
77
  color: theme.colors.text.hint,