@momo-kits/step 0.167.2-beta.1 → 0.168.1-beta.10
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 +2 -4
- package/package.json +1 -1
- package/utils.ts +8 -13
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
|
|
33
|
-
|
|
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
package/utils.ts
CHANGED
|
@@ -34,23 +34,20 @@ const getTypoTitle = (
|
|
|
34
34
|
size?: 'small' | 'large',
|
|
35
35
|
stepType?: 'vertical' | 'horizontal'
|
|
36
36
|
): Typography => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
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
|
|
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:
|
|
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,
|