@alfalab/core-components-steps 1.6.0 → 1.6.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/Component.js +9 -10
- package/components/step/Component.js +1 -1
- package/components/step/index.css +37 -37
- package/components/step-indicator/Component.js +1 -1
- package/components/step-indicator/index.css +2 -2
- package/cssm/Component.js +8 -9
- package/cssm/components/step/index.module.css +6 -6
- package/esm/Component.js +10 -11
- package/esm/components/step/Component.js +1 -1
- package/esm/components/step/index.css +37 -37
- package/esm/components/step-indicator/Component.js +1 -1
- package/esm/components/step-indicator/index.css +2 -2
- package/esm/index.css +3 -3
- package/index.css +3 -3
- package/modern/Component.js +10 -11
- package/modern/components/step/Component.js +1 -1
- package/modern/components/step/index.css +37 -37
- package/modern/components/step-indicator/Component.js +1 -1
- package/modern/components/step-indicator/index.css +2 -2
- package/modern/index.css +3 -3
- package/package.json +2 -2
- package/src/Component.tsx +10 -11
- package/src/components/step/index.module.css +3 -3
package/Component.js
CHANGED
|
@@ -11,33 +11,32 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
12
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
13
13
|
|
|
14
|
-
var styles = {"component":"
|
|
14
|
+
var styles = {"component":"steps__component_7b4f4","vertical":"steps__vertical_7b4f4"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
var Steps = function (_a) {
|
|
18
18
|
var _b;
|
|
19
19
|
var className = _a.className, children = _a.children, _c = _a.defaultActiveStep, defaultActiveStep = _c === void 0 ? 1 : _c, activeStepProp = _a.activeStep, _d = _a.isMarkCompletedSteps, isMarkCompletedSteps = _d === void 0 ? true : _d, _e = _a.isVerticalAlign, isVerticalAlign = _e === void 0 ? false : _e, _f = _a.ordered, ordered = _f === void 0 ? true : _f, _g = _a.interactive, interactive = _g === void 0 ? true : _g, _h = _a.fullWidth, fullWidth = _h === void 0 ? false : _h, _j = _a.minSpaceBetweenSteps, minSpaceBetweenSteps = _j === void 0 ? 24 : _j, checkIsStepDisabled = _a.checkIsStepDisabled, checkIsStepError = _a.checkIsStepError, checkIsStepWarning = _a.checkIsStepWarning, checkIsStepWaiting = _a.checkIsStepWaiting, checkIsStepPositive = _a.checkIsStepPositive, checkIsStepCustom = _a.checkIsStepCustom, onChange = _a.onChange, dataTestId = _a.dataTestId;
|
|
20
|
-
var
|
|
20
|
+
var uncontrolled = activeStepProp === undefined;
|
|
21
|
+
var _k = React.useState(defaultActiveStep), activeStep = _k[0], setActiveStep = _k[1];
|
|
21
22
|
var stepsLength = React__default.default.Children.count(children);
|
|
22
|
-
React.useEffect(function () {
|
|
23
|
-
if (activeStepProp) {
|
|
24
|
-
setActiveStep(activeStepProp);
|
|
25
|
-
}
|
|
26
|
-
}, [activeStepProp]);
|
|
27
23
|
var handleStepClick = function (stepNumber) {
|
|
28
|
-
|
|
24
|
+
if (uncontrolled) {
|
|
25
|
+
setActiveStep(stepNumber);
|
|
26
|
+
}
|
|
29
27
|
if (onChange) {
|
|
30
28
|
onChange(stepNumber);
|
|
31
29
|
}
|
|
32
30
|
};
|
|
33
31
|
if (!stepsLength)
|
|
34
32
|
return null;
|
|
33
|
+
var visibleActiveStep = uncontrolled ? activeStep : activeStepProp;
|
|
35
34
|
return (React__default.default.createElement("div", { className: cn__default.default(className, styles.component, (_b = {},
|
|
36
35
|
_b[styles.vertical] = isVerticalAlign,
|
|
37
36
|
_b)), "data-test-id": dataTestId }, React__default.default.Children.map(children, function (step, index) {
|
|
38
37
|
var stepNumber = index + 1;
|
|
39
|
-
var isSelected = stepNumber ===
|
|
40
|
-
var isStepCompleted = isMarkCompletedSteps && stepNumber <
|
|
38
|
+
var isSelected = stepNumber === visibleActiveStep;
|
|
39
|
+
var isStepCompleted = isMarkCompletedSteps && stepNumber < visibleActiveStep;
|
|
41
40
|
var disabled = checkIsStepDisabled ? checkIsStepDisabled(stepNumber) : false;
|
|
42
41
|
var isPositive = checkIsStepPositive ? checkIsStepPositive(stepNumber) : false;
|
|
43
42
|
var isError = checkIsStepError ? checkIsStepError(stepNumber) : false;
|
|
@@ -16,7 +16,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
16
16
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
17
17
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
18
18
|
|
|
19
|
-
var styles = {"step":"
|
|
19
|
+
var styles = {"step":"steps__step_x2lwq","vertical":"steps__vertical_x2lwq","interactive":"steps__interactive_x2lwq","disabled":"steps__disabled_x2lwq","text":"steps__text_x2lwq","indicator":"steps__indicator_x2lwq","option":"steps__option_x2lwq","dash":"steps__dash_x2lwq","size-16":"steps__size-16_x2lwq","size-8":"steps__size-8_x2lwq","completed":"steps__completed_x2lwq","focused":"steps__focused_x2lwq","selected":"steps__selected_x2lwq","checkbox":"steps__checkbox_x2lwq","dot":"steps__dot_x2lwq","error":"steps__error_x2lwq","unordered":"steps__unordered_x2lwq","completedIndicator":"steps__completedIndicator_x2lwq","fullWidth":"steps__fullWidth_x2lwq"};
|
|
20
20
|
require('./index.css')
|
|
21
21
|
|
|
22
22
|
var SIZE_TO_CLASSNAME_MAP = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: hzyxv */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-link: #2288fa;
|
|
5
|
-
--color-light-neutral-
|
|
5
|
+
--color-light-neutral-translucent-1300: rgba(3, 3, 6, 0.88);
|
|
6
6
|
--color-light-neutral-translucent-300: rgba(15, 25, 55, 0.1);
|
|
7
7
|
--color-light-status-positive: #0cc44d;
|
|
8
|
-
--color-light-text-primary:
|
|
9
|
-
--color-light-text-primary-inverted:
|
|
8
|
+
--color-light-text-primary: rgba(3, 3, 6, 0.88);
|
|
9
|
+
--color-light-text-primary-inverted: rgba(255, 255, 255, 0.94);
|
|
10
10
|
--color-light-transparent-default-hover: rgba(38, 55, 88, 0.06);
|
|
11
11
|
--color-light-transparent-default-press: rgba(30, 43, 68, 0.08); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
12
12
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -30,26 +30,26 @@
|
|
|
30
30
|
} :root {
|
|
31
31
|
--steps-option-svg-color: var(--color-light-status-positive);
|
|
32
32
|
--steps-dash-border: 2px solid var(--color-light-status-positive);
|
|
33
|
-
} .
|
|
33
|
+
} .steps__step_x2lwq {
|
|
34
34
|
display: flex;
|
|
35
35
|
outline: none
|
|
36
|
-
} .
|
|
36
|
+
} .steps__step_x2lwq:not(.steps__vertical_x2lwq) {
|
|
37
37
|
align-items: center;
|
|
38
|
-
} .
|
|
38
|
+
} .steps__step_x2lwq.steps__interactive_x2lwq:not(.steps__disabled_x2lwq):hover {
|
|
39
39
|
cursor: pointer;
|
|
40
|
-
} .
|
|
40
|
+
} .steps__step_x2lwq.steps__disabled_x2lwq:hover .steps__text_x2lwq {
|
|
41
41
|
background: unset;
|
|
42
|
-
} .
|
|
42
|
+
} .steps__step_x2lwq.steps__disabled_x2lwq .steps__indicator_x2lwq {
|
|
43
43
|
cursor: unset;
|
|
44
|
-
} .
|
|
44
|
+
} .steps__indicator_x2lwq {
|
|
45
45
|
cursor: pointer;
|
|
46
46
|
display: flex;
|
|
47
47
|
align-items: center;
|
|
48
48
|
margin-right: var(--gap-2xs)
|
|
49
|
-
} .
|
|
49
|
+
} .steps__indicator_x2lwq.steps__vertical_x2lwq {
|
|
50
50
|
flex-direction: column;
|
|
51
51
|
margin-right: var(--gap-xs);
|
|
52
|
-
} .
|
|
52
|
+
} .steps__option_x2lwq {
|
|
53
53
|
font-size: 14px;
|
|
54
54
|
line-height: 20px;
|
|
55
55
|
font-weight: 700;
|
|
@@ -62,33 +62,33 @@
|
|
|
62
62
|
min-width: 24px;
|
|
63
63
|
height: 24px;
|
|
64
64
|
border-radius: var(--border-radius-circle)
|
|
65
|
-
} .
|
|
65
|
+
} .steps__option_x2lwq.steps__vertical_x2lwq {
|
|
66
66
|
margin-top: var(--gap-xs);
|
|
67
|
-
} .
|
|
67
|
+
} .steps__dash_x2lwq {
|
|
68
68
|
flex: 1 1 auto;
|
|
69
69
|
min-width: 24px;
|
|
70
70
|
border-top: 2px solid var(--color-light-neutral-translucent-300);
|
|
71
71
|
margin-right: var(--gap-xs)
|
|
72
|
-
} .
|
|
72
|
+
} .steps__dash_x2lwq.steps__size-16_x2lwq {
|
|
73
73
|
min-width: 16px;
|
|
74
|
-
} .
|
|
74
|
+
} .steps__dash_x2lwq.steps__size-8_x2lwq {
|
|
75
75
|
min-width: 8px;
|
|
76
|
-
} .
|
|
76
|
+
} .steps__dash_x2lwq.steps__completed_x2lwq {
|
|
77
77
|
border-top: var(--steps-dash-border);
|
|
78
|
-
} .
|
|
78
|
+
} .steps__dash_x2lwq.steps__vertical_x2lwq {
|
|
79
79
|
min-width: unset;
|
|
80
80
|
min-height: 24px;
|
|
81
81
|
margin-right: 0;
|
|
82
82
|
margin-top: var(--gap-xs);
|
|
83
83
|
border-left: 2px solid var(--color-light-neutral-translucent-300);
|
|
84
84
|
border-top: none
|
|
85
|
-
} .
|
|
85
|
+
} .steps__dash_x2lwq.steps__vertical_x2lwq.steps__size-16_x2lwq {
|
|
86
86
|
min-height: 16px;
|
|
87
|
-
} .
|
|
87
|
+
} .steps__dash_x2lwq.steps__vertical_x2lwq.steps__size-8_x2lwq {
|
|
88
88
|
min-height: 8px;
|
|
89
|
-
} .
|
|
89
|
+
} .steps__dash_x2lwq.steps__completed_x2lwq.steps__vertical_x2lwq {
|
|
90
90
|
border-left: var(--steps-dash-border);
|
|
91
|
-
} .
|
|
91
|
+
} .steps__text_x2lwq {
|
|
92
92
|
font-size: 16px;
|
|
93
93
|
line-height: 24px;
|
|
94
94
|
font-weight: 400;
|
|
@@ -98,19 +98,19 @@
|
|
|
98
98
|
color: var(--color-light-text-primary);
|
|
99
99
|
border-radius: var(--gap-xs);
|
|
100
100
|
height: min-content
|
|
101
|
-
} .
|
|
101
|
+
} .steps__text_x2lwq.steps__interactive_x2lwq:not(.steps__disabled_x2lwq):hover {
|
|
102
102
|
background: var(--color-light-transparent-default-hover);
|
|
103
|
-
} .
|
|
103
|
+
} .steps__text_x2lwq.steps__interactive_x2lwq:not(.steps__disabled_x2lwq):active {
|
|
104
104
|
background: var(--color-light-transparent-default-press);
|
|
105
|
-
} .
|
|
105
|
+
} .steps__focused_x2lwq {
|
|
106
106
|
outline: var(--gap-3xs) solid var(--focus-color);
|
|
107
107
|
outline-offset: var(--gap-3xs);
|
|
108
|
-
} .
|
|
108
|
+
} .steps__selected_x2lwq .steps__text_x2lwq {
|
|
109
109
|
color: var(--color-light-text-primary);
|
|
110
|
-
} .
|
|
110
|
+
} .steps__selected_x2lwq .steps__option_x2lwq {
|
|
111
111
|
color: var(--color-light-text-primary-inverted);
|
|
112
|
-
background: var(--color-light-neutral-
|
|
113
|
-
} .
|
|
112
|
+
background: var(--color-light-neutral-translucent-1300);
|
|
113
|
+
} .steps__checkbox_x2lwq {
|
|
114
114
|
display: flex;
|
|
115
115
|
justify-content: center;
|
|
116
116
|
align-items: center;
|
|
@@ -118,20 +118,20 @@
|
|
|
118
118
|
width: 20px;
|
|
119
119
|
height: 20px;
|
|
120
120
|
border: 2px solid var(--color-light-neutral-translucent-300);
|
|
121
|
-
} .
|
|
121
|
+
} .steps__dot_x2lwq {
|
|
122
122
|
width: 10px;
|
|
123
123
|
height: 10px;
|
|
124
124
|
border-radius: var(--border-radius-circle);
|
|
125
125
|
background: var(--color-light-neutral-translucent-300);
|
|
126
|
-
} .
|
|
127
|
-
border: 2px solid var(--color-light-neutral-
|
|
128
|
-
} .
|
|
129
|
-
background: var(--color-light-neutral-
|
|
130
|
-
} .
|
|
126
|
+
} .steps__selected_x2lwq .steps__checkbox_x2lwq {
|
|
127
|
+
border: 2px solid var(--color-light-neutral-translucent-1300)
|
|
128
|
+
} .steps__selected_x2lwq .steps__checkbox_x2lwq .steps__dot_x2lwq {
|
|
129
|
+
background: var(--color-light-neutral-translucent-1300);
|
|
130
|
+
} .steps__option_x2lwq:not(.steps__error_x2lwq).steps__unordered_x2lwq {
|
|
131
131
|
background: unset;
|
|
132
|
-
} .
|
|
132
|
+
} .steps__completedIndicator_x2lwq > [class*='positive'] {
|
|
133
133
|
color: var(--steps-option-svg-color);
|
|
134
134
|
background-color: var(--steps-option-svg-color);
|
|
135
|
-
} .
|
|
135
|
+
} .steps__fullWidth_x2lwq {
|
|
136
136
|
width: 100%;
|
|
137
137
|
}
|
|
@@ -11,7 +11,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
12
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
13
13
|
|
|
14
|
-
var styles = {"component":"
|
|
14
|
+
var styles = {"component":"steps__component_j5e09"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
var StepIndicator = function (_a) {
|
package/cssm/Component.js
CHANGED
|
@@ -16,27 +16,26 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
|
16
16
|
var Steps = function (_a) {
|
|
17
17
|
var _b;
|
|
18
18
|
var className = _a.className, children = _a.children, _c = _a.defaultActiveStep, defaultActiveStep = _c === void 0 ? 1 : _c, activeStepProp = _a.activeStep, _d = _a.isMarkCompletedSteps, isMarkCompletedSteps = _d === void 0 ? true : _d, _e = _a.isVerticalAlign, isVerticalAlign = _e === void 0 ? false : _e, _f = _a.ordered, ordered = _f === void 0 ? true : _f, _g = _a.interactive, interactive = _g === void 0 ? true : _g, _h = _a.fullWidth, fullWidth = _h === void 0 ? false : _h, _j = _a.minSpaceBetweenSteps, minSpaceBetweenSteps = _j === void 0 ? 24 : _j, checkIsStepDisabled = _a.checkIsStepDisabled, checkIsStepError = _a.checkIsStepError, checkIsStepWarning = _a.checkIsStepWarning, checkIsStepWaiting = _a.checkIsStepWaiting, checkIsStepPositive = _a.checkIsStepPositive, checkIsStepCustom = _a.checkIsStepCustom, onChange = _a.onChange, dataTestId = _a.dataTestId;
|
|
19
|
-
var
|
|
19
|
+
var uncontrolled = activeStepProp === undefined;
|
|
20
|
+
var _k = React.useState(defaultActiveStep), activeStep = _k[0], setActiveStep = _k[1];
|
|
20
21
|
var stepsLength = React__default.default.Children.count(children);
|
|
21
|
-
React.useEffect(function () {
|
|
22
|
-
if (activeStepProp) {
|
|
23
|
-
setActiveStep(activeStepProp);
|
|
24
|
-
}
|
|
25
|
-
}, [activeStepProp]);
|
|
26
22
|
var handleStepClick = function (stepNumber) {
|
|
27
|
-
|
|
23
|
+
if (uncontrolled) {
|
|
24
|
+
setActiveStep(stepNumber);
|
|
25
|
+
}
|
|
28
26
|
if (onChange) {
|
|
29
27
|
onChange(stepNumber);
|
|
30
28
|
}
|
|
31
29
|
};
|
|
32
30
|
if (!stepsLength)
|
|
33
31
|
return null;
|
|
32
|
+
var visibleActiveStep = uncontrolled ? activeStep : activeStepProp;
|
|
34
33
|
return (React__default.default.createElement("div", { className: cn__default.default(className, styles__default.default.component, (_b = {},
|
|
35
34
|
_b[styles__default.default.vertical] = isVerticalAlign,
|
|
36
35
|
_b)), "data-test-id": dataTestId }, React__default.default.Children.map(children, function (step, index) {
|
|
37
36
|
var stepNumber = index + 1;
|
|
38
|
-
var isSelected = stepNumber ===
|
|
39
|
-
var isStepCompleted = isMarkCompletedSteps && stepNumber <
|
|
37
|
+
var isSelected = stepNumber === visibleActiveStep;
|
|
38
|
+
var isStepCompleted = isMarkCompletedSteps && stepNumber < visibleActiveStep;
|
|
40
39
|
var disabled = checkIsStepDisabled ? checkIsStepDisabled(stepNumber) : false;
|
|
41
40
|
var isPositive = checkIsStepPositive ? checkIsStepPositive(stepNumber) : false;
|
|
42
41
|
var isError = checkIsStepError ? checkIsStepError(stepNumber) : false;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
2
2
|
} /* deprecated */ :root {
|
|
3
3
|
--color-light-border-link: #2288fa;
|
|
4
|
-
--color-light-neutral-
|
|
4
|
+
--color-light-neutral-translucent-1300: rgba(3, 3, 6, 0.88);
|
|
5
5
|
--color-light-neutral-translucent-300: rgba(15, 25, 55, 0.1);
|
|
6
6
|
--color-light-status-positive: #0cc44d;
|
|
7
|
-
--color-light-text-primary:
|
|
8
|
-
--color-light-text-primary-inverted:
|
|
7
|
+
--color-light-text-primary: rgba(3, 3, 6, 0.88);
|
|
8
|
+
--color-light-text-primary-inverted: rgba(255, 255, 255, 0.94);
|
|
9
9
|
--color-light-transparent-default-hover: rgba(38, 55, 88, 0.06);
|
|
10
10
|
--color-light-transparent-default-press: rgba(30, 43, 68, 0.08); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
11
11
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
color: var(--color-light-text-primary);
|
|
109
109
|
} .selected .option {
|
|
110
110
|
color: var(--color-light-text-primary-inverted);
|
|
111
|
-
background: var(--color-light-neutral-
|
|
111
|
+
background: var(--color-light-neutral-translucent-1300);
|
|
112
112
|
} .checkbox {
|
|
113
113
|
display: flex;
|
|
114
114
|
justify-content: center;
|
|
@@ -123,9 +123,9 @@
|
|
|
123
123
|
border-radius: var(--border-radius-circle);
|
|
124
124
|
background: var(--color-light-neutral-translucent-300);
|
|
125
125
|
} .selected .checkbox {
|
|
126
|
-
border: 2px solid var(--color-light-neutral-
|
|
126
|
+
border: 2px solid var(--color-light-neutral-translucent-1300)
|
|
127
127
|
} .selected .checkbox .dot {
|
|
128
|
-
background: var(--color-light-neutral-
|
|
128
|
+
background: var(--color-light-neutral-translucent-1300);
|
|
129
129
|
} .option:not(.error).unordered {
|
|
130
130
|
background: unset;
|
|
131
131
|
} .completedIndicator > [class*='positive'] {
|
package/esm/Component.js
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import React, { useState
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Step } from './components/step/Component.js';
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"
|
|
5
|
+
var styles = {"component":"steps__component_7b4f4","vertical":"steps__vertical_7b4f4"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var Steps = function (_a) {
|
|
9
9
|
var _b;
|
|
10
10
|
var className = _a.className, children = _a.children, _c = _a.defaultActiveStep, defaultActiveStep = _c === void 0 ? 1 : _c, activeStepProp = _a.activeStep, _d = _a.isMarkCompletedSteps, isMarkCompletedSteps = _d === void 0 ? true : _d, _e = _a.isVerticalAlign, isVerticalAlign = _e === void 0 ? false : _e, _f = _a.ordered, ordered = _f === void 0 ? true : _f, _g = _a.interactive, interactive = _g === void 0 ? true : _g, _h = _a.fullWidth, fullWidth = _h === void 0 ? false : _h, _j = _a.minSpaceBetweenSteps, minSpaceBetweenSteps = _j === void 0 ? 24 : _j, checkIsStepDisabled = _a.checkIsStepDisabled, checkIsStepError = _a.checkIsStepError, checkIsStepWarning = _a.checkIsStepWarning, checkIsStepWaiting = _a.checkIsStepWaiting, checkIsStepPositive = _a.checkIsStepPositive, checkIsStepCustom = _a.checkIsStepCustom, onChange = _a.onChange, dataTestId = _a.dataTestId;
|
|
11
|
-
var
|
|
11
|
+
var uncontrolled = activeStepProp === undefined;
|
|
12
|
+
var _k = useState(defaultActiveStep), activeStep = _k[0], setActiveStep = _k[1];
|
|
12
13
|
var stepsLength = React.Children.count(children);
|
|
13
|
-
useEffect(function () {
|
|
14
|
-
if (activeStepProp) {
|
|
15
|
-
setActiveStep(activeStepProp);
|
|
16
|
-
}
|
|
17
|
-
}, [activeStepProp]);
|
|
18
14
|
var handleStepClick = function (stepNumber) {
|
|
19
|
-
|
|
15
|
+
if (uncontrolled) {
|
|
16
|
+
setActiveStep(stepNumber);
|
|
17
|
+
}
|
|
20
18
|
if (onChange) {
|
|
21
19
|
onChange(stepNumber);
|
|
22
20
|
}
|
|
23
21
|
};
|
|
24
22
|
if (!stepsLength)
|
|
25
23
|
return null;
|
|
24
|
+
var visibleActiveStep = uncontrolled ? activeStep : activeStepProp;
|
|
26
25
|
return (React.createElement("div", { className: cn(className, styles.component, (_b = {},
|
|
27
26
|
_b[styles.vertical] = isVerticalAlign,
|
|
28
27
|
_b)), "data-test-id": dataTestId }, React.Children.map(children, function (step, index) {
|
|
29
28
|
var stepNumber = index + 1;
|
|
30
|
-
var isSelected = stepNumber ===
|
|
31
|
-
var isStepCompleted = isMarkCompletedSteps && stepNumber <
|
|
29
|
+
var isSelected = stepNumber === visibleActiveStep;
|
|
30
|
+
var isStepCompleted = isMarkCompletedSteps && stepNumber < visibleActiveStep;
|
|
32
31
|
var disabled = checkIsStepDisabled ? checkIsStepDisabled(stepNumber) : false;
|
|
33
32
|
var isPositive = checkIsStepPositive ? checkIsStepPositive(stepNumber) : false;
|
|
34
33
|
var isError = checkIsStepError ? checkIsStepError(stepNumber) : false;
|
|
@@ -7,7 +7,7 @@ import { ClockMIcon } from '@alfalab/icons-glyph/ClockMIcon';
|
|
|
7
7
|
import { ExclamationCircleMIcon } from '@alfalab/icons-glyph/ExclamationCircleMIcon';
|
|
8
8
|
import { StepIndicator } from '../step-indicator/Component.js';
|
|
9
9
|
|
|
10
|
-
var styles = {"step":"
|
|
10
|
+
var styles = {"step":"steps__step_x2lwq","vertical":"steps__vertical_x2lwq","interactive":"steps__interactive_x2lwq","disabled":"steps__disabled_x2lwq","text":"steps__text_x2lwq","indicator":"steps__indicator_x2lwq","option":"steps__option_x2lwq","dash":"steps__dash_x2lwq","size-16":"steps__size-16_x2lwq","size-8":"steps__size-8_x2lwq","completed":"steps__completed_x2lwq","focused":"steps__focused_x2lwq","selected":"steps__selected_x2lwq","checkbox":"steps__checkbox_x2lwq","dot":"steps__dot_x2lwq","error":"steps__error_x2lwq","unordered":"steps__unordered_x2lwq","completedIndicator":"steps__completedIndicator_x2lwq","fullWidth":"steps__fullWidth_x2lwq"};
|
|
11
11
|
require('./index.css')
|
|
12
12
|
|
|
13
13
|
var SIZE_TO_CLASSNAME_MAP = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: hzyxv */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-link: #2288fa;
|
|
5
|
-
--color-light-neutral-
|
|
5
|
+
--color-light-neutral-translucent-1300: rgba(3, 3, 6, 0.88);
|
|
6
6
|
--color-light-neutral-translucent-300: rgba(15, 25, 55, 0.1);
|
|
7
7
|
--color-light-status-positive: #0cc44d;
|
|
8
|
-
--color-light-text-primary:
|
|
9
|
-
--color-light-text-primary-inverted:
|
|
8
|
+
--color-light-text-primary: rgba(3, 3, 6, 0.88);
|
|
9
|
+
--color-light-text-primary-inverted: rgba(255, 255, 255, 0.94);
|
|
10
10
|
--color-light-transparent-default-hover: rgba(38, 55, 88, 0.06);
|
|
11
11
|
--color-light-transparent-default-press: rgba(30, 43, 68, 0.08); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
12
12
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -30,26 +30,26 @@
|
|
|
30
30
|
} :root {
|
|
31
31
|
--steps-option-svg-color: var(--color-light-status-positive);
|
|
32
32
|
--steps-dash-border: 2px solid var(--color-light-status-positive);
|
|
33
|
-
} .
|
|
33
|
+
} .steps__step_x2lwq {
|
|
34
34
|
display: flex;
|
|
35
35
|
outline: none
|
|
36
|
-
} .
|
|
36
|
+
} .steps__step_x2lwq:not(.steps__vertical_x2lwq) {
|
|
37
37
|
align-items: center;
|
|
38
|
-
} .
|
|
38
|
+
} .steps__step_x2lwq.steps__interactive_x2lwq:not(.steps__disabled_x2lwq):hover {
|
|
39
39
|
cursor: pointer;
|
|
40
|
-
} .
|
|
40
|
+
} .steps__step_x2lwq.steps__disabled_x2lwq:hover .steps__text_x2lwq {
|
|
41
41
|
background: unset;
|
|
42
|
-
} .
|
|
42
|
+
} .steps__step_x2lwq.steps__disabled_x2lwq .steps__indicator_x2lwq {
|
|
43
43
|
cursor: unset;
|
|
44
|
-
} .
|
|
44
|
+
} .steps__indicator_x2lwq {
|
|
45
45
|
cursor: pointer;
|
|
46
46
|
display: flex;
|
|
47
47
|
align-items: center;
|
|
48
48
|
margin-right: var(--gap-2xs)
|
|
49
|
-
} .
|
|
49
|
+
} .steps__indicator_x2lwq.steps__vertical_x2lwq {
|
|
50
50
|
flex-direction: column;
|
|
51
51
|
margin-right: var(--gap-xs);
|
|
52
|
-
} .
|
|
52
|
+
} .steps__option_x2lwq {
|
|
53
53
|
font-size: 14px;
|
|
54
54
|
line-height: 20px;
|
|
55
55
|
font-weight: 700;
|
|
@@ -62,33 +62,33 @@
|
|
|
62
62
|
min-width: 24px;
|
|
63
63
|
height: 24px;
|
|
64
64
|
border-radius: var(--border-radius-circle)
|
|
65
|
-
} .
|
|
65
|
+
} .steps__option_x2lwq.steps__vertical_x2lwq {
|
|
66
66
|
margin-top: var(--gap-xs);
|
|
67
|
-
} .
|
|
67
|
+
} .steps__dash_x2lwq {
|
|
68
68
|
flex: 1 1 auto;
|
|
69
69
|
min-width: 24px;
|
|
70
70
|
border-top: 2px solid var(--color-light-neutral-translucent-300);
|
|
71
71
|
margin-right: var(--gap-xs)
|
|
72
|
-
} .
|
|
72
|
+
} .steps__dash_x2lwq.steps__size-16_x2lwq {
|
|
73
73
|
min-width: 16px;
|
|
74
|
-
} .
|
|
74
|
+
} .steps__dash_x2lwq.steps__size-8_x2lwq {
|
|
75
75
|
min-width: 8px;
|
|
76
|
-
} .
|
|
76
|
+
} .steps__dash_x2lwq.steps__completed_x2lwq {
|
|
77
77
|
border-top: var(--steps-dash-border);
|
|
78
|
-
} .
|
|
78
|
+
} .steps__dash_x2lwq.steps__vertical_x2lwq {
|
|
79
79
|
min-width: unset;
|
|
80
80
|
min-height: 24px;
|
|
81
81
|
margin-right: 0;
|
|
82
82
|
margin-top: var(--gap-xs);
|
|
83
83
|
border-left: 2px solid var(--color-light-neutral-translucent-300);
|
|
84
84
|
border-top: none
|
|
85
|
-
} .
|
|
85
|
+
} .steps__dash_x2lwq.steps__vertical_x2lwq.steps__size-16_x2lwq {
|
|
86
86
|
min-height: 16px;
|
|
87
|
-
} .
|
|
87
|
+
} .steps__dash_x2lwq.steps__vertical_x2lwq.steps__size-8_x2lwq {
|
|
88
88
|
min-height: 8px;
|
|
89
|
-
} .
|
|
89
|
+
} .steps__dash_x2lwq.steps__completed_x2lwq.steps__vertical_x2lwq {
|
|
90
90
|
border-left: var(--steps-dash-border);
|
|
91
|
-
} .
|
|
91
|
+
} .steps__text_x2lwq {
|
|
92
92
|
font-size: 16px;
|
|
93
93
|
line-height: 24px;
|
|
94
94
|
font-weight: 400;
|
|
@@ -98,19 +98,19 @@
|
|
|
98
98
|
color: var(--color-light-text-primary);
|
|
99
99
|
border-radius: var(--gap-xs);
|
|
100
100
|
height: min-content
|
|
101
|
-
} .
|
|
101
|
+
} .steps__text_x2lwq.steps__interactive_x2lwq:not(.steps__disabled_x2lwq):hover {
|
|
102
102
|
background: var(--color-light-transparent-default-hover);
|
|
103
|
-
} .
|
|
103
|
+
} .steps__text_x2lwq.steps__interactive_x2lwq:not(.steps__disabled_x2lwq):active {
|
|
104
104
|
background: var(--color-light-transparent-default-press);
|
|
105
|
-
} .
|
|
105
|
+
} .steps__focused_x2lwq {
|
|
106
106
|
outline: var(--gap-3xs) solid var(--focus-color);
|
|
107
107
|
outline-offset: var(--gap-3xs);
|
|
108
|
-
} .
|
|
108
|
+
} .steps__selected_x2lwq .steps__text_x2lwq {
|
|
109
109
|
color: var(--color-light-text-primary);
|
|
110
|
-
} .
|
|
110
|
+
} .steps__selected_x2lwq .steps__option_x2lwq {
|
|
111
111
|
color: var(--color-light-text-primary-inverted);
|
|
112
|
-
background: var(--color-light-neutral-
|
|
113
|
-
} .
|
|
112
|
+
background: var(--color-light-neutral-translucent-1300);
|
|
113
|
+
} .steps__checkbox_x2lwq {
|
|
114
114
|
display: flex;
|
|
115
115
|
justify-content: center;
|
|
116
116
|
align-items: center;
|
|
@@ -118,20 +118,20 @@
|
|
|
118
118
|
width: 20px;
|
|
119
119
|
height: 20px;
|
|
120
120
|
border: 2px solid var(--color-light-neutral-translucent-300);
|
|
121
|
-
} .
|
|
121
|
+
} .steps__dot_x2lwq {
|
|
122
122
|
width: 10px;
|
|
123
123
|
height: 10px;
|
|
124
124
|
border-radius: var(--border-radius-circle);
|
|
125
125
|
background: var(--color-light-neutral-translucent-300);
|
|
126
|
-
} .
|
|
127
|
-
border: 2px solid var(--color-light-neutral-
|
|
128
|
-
} .
|
|
129
|
-
background: var(--color-light-neutral-
|
|
130
|
-
} .
|
|
126
|
+
} .steps__selected_x2lwq .steps__checkbox_x2lwq {
|
|
127
|
+
border: 2px solid var(--color-light-neutral-translucent-1300)
|
|
128
|
+
} .steps__selected_x2lwq .steps__checkbox_x2lwq .steps__dot_x2lwq {
|
|
129
|
+
background: var(--color-light-neutral-translucent-1300);
|
|
130
|
+
} .steps__option_x2lwq:not(.steps__error_x2lwq).steps__unordered_x2lwq {
|
|
131
131
|
background: unset;
|
|
132
|
-
} .
|
|
132
|
+
} .steps__completedIndicator_x2lwq > [class*='positive'] {
|
|
133
133
|
color: var(--steps-option-svg-color);
|
|
134
134
|
background-color: var(--steps-option-svg-color);
|
|
135
|
-
} .
|
|
135
|
+
} .steps__fullWidth_x2lwq {
|
|
136
136
|
width: 100%;
|
|
137
137
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Badge } from '@alfalab/core-components-badge/esm';
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"
|
|
5
|
+
var styles = {"component":"steps__component_j5e09"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var StepIndicator = function (_a) {
|
package/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 15d60 */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
} :root {
|
|
15
15
|
} :root {
|
|
16
16
|
} :root {
|
|
17
|
-
} .
|
|
17
|
+
} .steps__component_7b4f4 {
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
flex-direction: row
|
|
21
|
-
} .
|
|
21
|
+
} .steps__component_7b4f4.steps__vertical_7b4f4 {
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: flex-start;
|
|
24
24
|
}
|
package/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 15d60 */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
} :root {
|
|
15
15
|
} :root {
|
|
16
16
|
} :root {
|
|
17
|
-
} .
|
|
17
|
+
} .steps__component_7b4f4 {
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
flex-direction: row
|
|
21
|
-
} .
|
|
21
|
+
} .steps__component_7b4f4.steps__vertical_7b4f4 {
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: flex-start;
|
|
24
24
|
}
|
package/modern/Component.js
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import React, { useState
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Step } from './components/step/Component.js';
|
|
4
4
|
|
|
5
|
-
const styles = {"component":"
|
|
5
|
+
const styles = {"component":"steps__component_7b4f4","vertical":"steps__vertical_7b4f4"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const Steps = ({ className, children, defaultActiveStep = 1, activeStep: activeStepProp, isMarkCompletedSteps = true, isVerticalAlign = false, ordered = true, interactive = true, fullWidth = false, minSpaceBetweenSteps = 24, checkIsStepDisabled, checkIsStepError, checkIsStepWarning, checkIsStepWaiting, checkIsStepPositive, checkIsStepCustom, onChange, dataTestId, }) => {
|
|
9
|
-
const
|
|
9
|
+
const uncontrolled = activeStepProp === undefined;
|
|
10
|
+
const [activeStep, setActiveStep] = useState(defaultActiveStep);
|
|
10
11
|
const stepsLength = React.Children.count(children);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (activeStepProp) {
|
|
13
|
-
setActiveStep(activeStepProp);
|
|
14
|
-
}
|
|
15
|
-
}, [activeStepProp]);
|
|
16
12
|
const handleStepClick = (stepNumber) => {
|
|
17
|
-
|
|
13
|
+
if (uncontrolled) {
|
|
14
|
+
setActiveStep(stepNumber);
|
|
15
|
+
}
|
|
18
16
|
if (onChange) {
|
|
19
17
|
onChange(stepNumber);
|
|
20
18
|
}
|
|
21
19
|
};
|
|
22
20
|
if (!stepsLength)
|
|
23
21
|
return null;
|
|
22
|
+
const visibleActiveStep = uncontrolled ? activeStep : activeStepProp;
|
|
24
23
|
return (React.createElement("div", { className: cn(className, styles.component, {
|
|
25
24
|
[styles.vertical]: isVerticalAlign,
|
|
26
25
|
}), "data-test-id": dataTestId }, React.Children.map(children, (step, index) => {
|
|
27
26
|
const stepNumber = index + 1;
|
|
28
|
-
const isSelected = stepNumber ===
|
|
29
|
-
const isStepCompleted = isMarkCompletedSteps && stepNumber <
|
|
27
|
+
const isSelected = stepNumber === visibleActiveStep;
|
|
28
|
+
const isStepCompleted = isMarkCompletedSteps && stepNumber < visibleActiveStep;
|
|
30
29
|
const disabled = checkIsStepDisabled ? checkIsStepDisabled(stepNumber) : false;
|
|
31
30
|
const isPositive = checkIsStepPositive ? checkIsStepPositive(stepNumber) : false;
|
|
32
31
|
const isError = checkIsStepError ? checkIsStepError(stepNumber) : false;
|
|
@@ -6,7 +6,7 @@ import { ClockMIcon } from '@alfalab/icons-glyph/ClockMIcon';
|
|
|
6
6
|
import { ExclamationCircleMIcon } from '@alfalab/icons-glyph/ExclamationCircleMIcon';
|
|
7
7
|
import { StepIndicator } from '../step-indicator/Component.js';
|
|
8
8
|
|
|
9
|
-
const styles = {"step":"
|
|
9
|
+
const styles = {"step":"steps__step_x2lwq","vertical":"steps__vertical_x2lwq","interactive":"steps__interactive_x2lwq","disabled":"steps__disabled_x2lwq","text":"steps__text_x2lwq","indicator":"steps__indicator_x2lwq","option":"steps__option_x2lwq","dash":"steps__dash_x2lwq","size-16":"steps__size-16_x2lwq","size-8":"steps__size-8_x2lwq","completed":"steps__completed_x2lwq","focused":"steps__focused_x2lwq","selected":"steps__selected_x2lwq","checkbox":"steps__checkbox_x2lwq","dot":"steps__dot_x2lwq","error":"steps__error_x2lwq","unordered":"steps__unordered_x2lwq","completedIndicator":"steps__completedIndicator_x2lwq","fullWidth":"steps__fullWidth_x2lwq"};
|
|
10
10
|
require('./index.css')
|
|
11
11
|
|
|
12
12
|
const SIZE_TO_CLASSNAME_MAP = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: hzyxv */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-link: #2288fa;
|
|
5
|
-
--color-light-neutral-
|
|
5
|
+
--color-light-neutral-translucent-1300: rgba(3, 3, 6, 0.88);
|
|
6
6
|
--color-light-neutral-translucent-300: rgba(15, 25, 55, 0.1);
|
|
7
7
|
--color-light-status-positive: #0cc44d;
|
|
8
|
-
--color-light-text-primary:
|
|
9
|
-
--color-light-text-primary-inverted:
|
|
8
|
+
--color-light-text-primary: rgba(3, 3, 6, 0.88);
|
|
9
|
+
--color-light-text-primary-inverted: rgba(255, 255, 255, 0.94);
|
|
10
10
|
--color-light-transparent-default-hover: rgba(38, 55, 88, 0.06);
|
|
11
11
|
--color-light-transparent-default-press: rgba(30, 43, 68, 0.08); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
12
12
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -30,26 +30,26 @@
|
|
|
30
30
|
} :root {
|
|
31
31
|
--steps-option-svg-color: var(--color-light-status-positive);
|
|
32
32
|
--steps-dash-border: 2px solid var(--color-light-status-positive);
|
|
33
|
-
} .
|
|
33
|
+
} .steps__step_x2lwq {
|
|
34
34
|
display: flex;
|
|
35
35
|
outline: none
|
|
36
|
-
} .
|
|
36
|
+
} .steps__step_x2lwq:not(.steps__vertical_x2lwq) {
|
|
37
37
|
align-items: center;
|
|
38
|
-
} .
|
|
38
|
+
} .steps__step_x2lwq.steps__interactive_x2lwq:not(.steps__disabled_x2lwq):hover {
|
|
39
39
|
cursor: pointer;
|
|
40
|
-
} .
|
|
40
|
+
} .steps__step_x2lwq.steps__disabled_x2lwq:hover .steps__text_x2lwq {
|
|
41
41
|
background: unset;
|
|
42
|
-
} .
|
|
42
|
+
} .steps__step_x2lwq.steps__disabled_x2lwq .steps__indicator_x2lwq {
|
|
43
43
|
cursor: unset;
|
|
44
|
-
} .
|
|
44
|
+
} .steps__indicator_x2lwq {
|
|
45
45
|
cursor: pointer;
|
|
46
46
|
display: flex;
|
|
47
47
|
align-items: center;
|
|
48
48
|
margin-right: var(--gap-2xs)
|
|
49
|
-
} .
|
|
49
|
+
} .steps__indicator_x2lwq.steps__vertical_x2lwq {
|
|
50
50
|
flex-direction: column;
|
|
51
51
|
margin-right: var(--gap-xs);
|
|
52
|
-
} .
|
|
52
|
+
} .steps__option_x2lwq {
|
|
53
53
|
font-size: 14px;
|
|
54
54
|
line-height: 20px;
|
|
55
55
|
font-weight: 700;
|
|
@@ -62,33 +62,33 @@
|
|
|
62
62
|
min-width: 24px;
|
|
63
63
|
height: 24px;
|
|
64
64
|
border-radius: var(--border-radius-circle)
|
|
65
|
-
} .
|
|
65
|
+
} .steps__option_x2lwq.steps__vertical_x2lwq {
|
|
66
66
|
margin-top: var(--gap-xs);
|
|
67
|
-
} .
|
|
67
|
+
} .steps__dash_x2lwq {
|
|
68
68
|
flex: 1 1 auto;
|
|
69
69
|
min-width: 24px;
|
|
70
70
|
border-top: 2px solid var(--color-light-neutral-translucent-300);
|
|
71
71
|
margin-right: var(--gap-xs)
|
|
72
|
-
} .
|
|
72
|
+
} .steps__dash_x2lwq.steps__size-16_x2lwq {
|
|
73
73
|
min-width: 16px;
|
|
74
|
-
} .
|
|
74
|
+
} .steps__dash_x2lwq.steps__size-8_x2lwq {
|
|
75
75
|
min-width: 8px;
|
|
76
|
-
} .
|
|
76
|
+
} .steps__dash_x2lwq.steps__completed_x2lwq {
|
|
77
77
|
border-top: var(--steps-dash-border);
|
|
78
|
-
} .
|
|
78
|
+
} .steps__dash_x2lwq.steps__vertical_x2lwq {
|
|
79
79
|
min-width: unset;
|
|
80
80
|
min-height: 24px;
|
|
81
81
|
margin-right: 0;
|
|
82
82
|
margin-top: var(--gap-xs);
|
|
83
83
|
border-left: 2px solid var(--color-light-neutral-translucent-300);
|
|
84
84
|
border-top: none
|
|
85
|
-
} .
|
|
85
|
+
} .steps__dash_x2lwq.steps__vertical_x2lwq.steps__size-16_x2lwq {
|
|
86
86
|
min-height: 16px;
|
|
87
|
-
} .
|
|
87
|
+
} .steps__dash_x2lwq.steps__vertical_x2lwq.steps__size-8_x2lwq {
|
|
88
88
|
min-height: 8px;
|
|
89
|
-
} .
|
|
89
|
+
} .steps__dash_x2lwq.steps__completed_x2lwq.steps__vertical_x2lwq {
|
|
90
90
|
border-left: var(--steps-dash-border);
|
|
91
|
-
} .
|
|
91
|
+
} .steps__text_x2lwq {
|
|
92
92
|
font-size: 16px;
|
|
93
93
|
line-height: 24px;
|
|
94
94
|
font-weight: 400;
|
|
@@ -98,19 +98,19 @@
|
|
|
98
98
|
color: var(--color-light-text-primary);
|
|
99
99
|
border-radius: var(--gap-xs);
|
|
100
100
|
height: min-content
|
|
101
|
-
} .
|
|
101
|
+
} .steps__text_x2lwq.steps__interactive_x2lwq:not(.steps__disabled_x2lwq):hover {
|
|
102
102
|
background: var(--color-light-transparent-default-hover);
|
|
103
|
-
} .
|
|
103
|
+
} .steps__text_x2lwq.steps__interactive_x2lwq:not(.steps__disabled_x2lwq):active {
|
|
104
104
|
background: var(--color-light-transparent-default-press);
|
|
105
|
-
} .
|
|
105
|
+
} .steps__focused_x2lwq {
|
|
106
106
|
outline: var(--gap-3xs) solid var(--focus-color);
|
|
107
107
|
outline-offset: var(--gap-3xs);
|
|
108
|
-
} .
|
|
108
|
+
} .steps__selected_x2lwq .steps__text_x2lwq {
|
|
109
109
|
color: var(--color-light-text-primary);
|
|
110
|
-
} .
|
|
110
|
+
} .steps__selected_x2lwq .steps__option_x2lwq {
|
|
111
111
|
color: var(--color-light-text-primary-inverted);
|
|
112
|
-
background: var(--color-light-neutral-
|
|
113
|
-
} .
|
|
112
|
+
background: var(--color-light-neutral-translucent-1300);
|
|
113
|
+
} .steps__checkbox_x2lwq {
|
|
114
114
|
display: flex;
|
|
115
115
|
justify-content: center;
|
|
116
116
|
align-items: center;
|
|
@@ -118,20 +118,20 @@
|
|
|
118
118
|
width: 20px;
|
|
119
119
|
height: 20px;
|
|
120
120
|
border: 2px solid var(--color-light-neutral-translucent-300);
|
|
121
|
-
} .
|
|
121
|
+
} .steps__dot_x2lwq {
|
|
122
122
|
width: 10px;
|
|
123
123
|
height: 10px;
|
|
124
124
|
border-radius: var(--border-radius-circle);
|
|
125
125
|
background: var(--color-light-neutral-translucent-300);
|
|
126
|
-
} .
|
|
127
|
-
border: 2px solid var(--color-light-neutral-
|
|
128
|
-
} .
|
|
129
|
-
background: var(--color-light-neutral-
|
|
130
|
-
} .
|
|
126
|
+
} .steps__selected_x2lwq .steps__checkbox_x2lwq {
|
|
127
|
+
border: 2px solid var(--color-light-neutral-translucent-1300)
|
|
128
|
+
} .steps__selected_x2lwq .steps__checkbox_x2lwq .steps__dot_x2lwq {
|
|
129
|
+
background: var(--color-light-neutral-translucent-1300);
|
|
130
|
+
} .steps__option_x2lwq:not(.steps__error_x2lwq).steps__unordered_x2lwq {
|
|
131
131
|
background: unset;
|
|
132
|
-
} .
|
|
132
|
+
} .steps__completedIndicator_x2lwq > [class*='positive'] {
|
|
133
133
|
color: var(--steps-option-svg-color);
|
|
134
134
|
background-color: var(--steps-option-svg-color);
|
|
135
|
-
} .
|
|
135
|
+
} .steps__fullWidth_x2lwq {
|
|
136
136
|
width: 100%;
|
|
137
137
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Badge } from '@alfalab/core-components-badge/modern';
|
|
4
4
|
|
|
5
|
-
const styles = {"component":"
|
|
5
|
+
const styles = {"component":"steps__component_j5e09"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const StepIndicator = ({ content, iconColor, className }) => (React.createElement(Badge, { size: 'l', view: 'icon', iconColor: iconColor, className: cn(styles.component, className), content: content }));
|
package/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 15d60 */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
} :root {
|
|
15
15
|
} :root {
|
|
16
16
|
} :root {
|
|
17
|
-
} .
|
|
17
|
+
} .steps__component_7b4f4 {
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
flex-direction: row
|
|
21
|
-
} .
|
|
21
|
+
} .steps__component_7b4f4.steps__vertical_7b4f4 {
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: flex-start;
|
|
24
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-steps",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"react": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@alfalab/core-components-badge": "^5.5.
|
|
17
|
+
"@alfalab/core-components-badge": "^5.5.2",
|
|
18
18
|
"@alfalab/hooks": "^1.13.0",
|
|
19
19
|
"@alfalab/icons-glyph": "^2.139.0",
|
|
20
20
|
"classnames": "^2.3.1",
|
package/src/Component.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode,
|
|
1
|
+
import React, { ReactNode, useState } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
4
|
import { Step } from './components/step';
|
|
@@ -137,18 +137,15 @@ export const Steps: React.FC<StepsProps> = ({
|
|
|
137
137
|
onChange,
|
|
138
138
|
dataTestId,
|
|
139
139
|
}) => {
|
|
140
|
-
const
|
|
140
|
+
const uncontrolled = activeStepProp === undefined;
|
|
141
|
+
const [activeStep, setActiveStep] = useState(defaultActiveStep);
|
|
141
142
|
|
|
142
143
|
const stepsLength = React.Children.count(children);
|
|
143
144
|
|
|
144
|
-
useEffect(() => {
|
|
145
|
-
if (activeStepProp) {
|
|
146
|
-
setActiveStep(activeStepProp);
|
|
147
|
-
}
|
|
148
|
-
}, [activeStepProp]);
|
|
149
|
-
|
|
150
145
|
const handleStepClick = (stepNumber: number) => {
|
|
151
|
-
|
|
146
|
+
if (uncontrolled) {
|
|
147
|
+
setActiveStep(stepNumber);
|
|
148
|
+
}
|
|
152
149
|
|
|
153
150
|
if (onChange) {
|
|
154
151
|
onChange(stepNumber);
|
|
@@ -157,6 +154,8 @@ export const Steps: React.FC<StepsProps> = ({
|
|
|
157
154
|
|
|
158
155
|
if (!stepsLength) return null;
|
|
159
156
|
|
|
157
|
+
const visibleActiveStep = uncontrolled ? activeStep : activeStepProp;
|
|
158
|
+
|
|
160
159
|
return (
|
|
161
160
|
<div
|
|
162
161
|
className={cn(className, styles.component, {
|
|
@@ -166,8 +165,8 @@ export const Steps: React.FC<StepsProps> = ({
|
|
|
166
165
|
>
|
|
167
166
|
{React.Children.map(children, (step, index) => {
|
|
168
167
|
const stepNumber = index + 1;
|
|
169
|
-
const isSelected = stepNumber ===
|
|
170
|
-
const isStepCompleted = isMarkCompletedSteps && stepNumber <
|
|
168
|
+
const isSelected = stepNumber === visibleActiveStep;
|
|
169
|
+
const isStepCompleted = isMarkCompletedSteps && stepNumber < visibleActiveStep;
|
|
171
170
|
const disabled = checkIsStepDisabled ? checkIsStepDisabled(stepNumber) : false;
|
|
172
171
|
const isPositive = checkIsStepPositive ? checkIsStepPositive(stepNumber) : false;
|
|
173
172
|
const isError = checkIsStepError ? checkIsStepError(stepNumber) : false;
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
|
|
132
132
|
& .option {
|
|
133
133
|
color: var(--color-light-text-primary-inverted);
|
|
134
|
-
background: var(--color-light-neutral-
|
|
134
|
+
background: var(--color-light-neutral-translucent-1300);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -153,10 +153,10 @@
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
.selected .checkbox {
|
|
156
|
-
border: 2px solid var(--color-light-neutral-
|
|
156
|
+
border: 2px solid var(--color-light-neutral-translucent-1300);
|
|
157
157
|
|
|
158
158
|
& .dot {
|
|
159
|
-
background: var(--color-light-neutral-
|
|
159
|
+
background: var(--color-light-neutral-translucent-1300);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|