@alfalab/core-components-steps 3.0.3 → 3.0.4
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/components/step/Component.d.ts +2 -2
- package/components/step/Component.js +8 -11
- package/components/step/Component.js.map +1 -1
- package/components/step/index.css +31 -32
- package/components/step/index.module.css.js +1 -1
- package/components/step/index.module.css.js.map +1 -1
- package/components/step-indicator/Component.d.ts +5 -1
- package/components/step-indicator/Component.js +3 -3
- package/components/step-indicator/Component.js.map +1 -1
- package/components/step-indicator/index.css +1 -1
- package/components/step-indicator/index.module.css.js +1 -1
- package/cssm/components/step/Component.d.ts +2 -2
- package/cssm/components/step/Component.js +8 -11
- package/cssm/components/step/Component.js.map +1 -1
- package/cssm/components/step/index.module.css +1 -2
- package/cssm/components/step-indicator/Component.d.ts +5 -1
- package/cssm/components/step-indicator/Component.js +3 -3
- package/cssm/components/step-indicator/Component.js.map +1 -1
- package/esm/components/step/Component.d.ts +2 -2
- package/esm/components/step/Component.js +8 -11
- package/esm/components/step/Component.js.map +1 -1
- package/esm/components/step/index.css +31 -32
- package/esm/components/step/index.module.css.js +1 -1
- package/esm/components/step/index.module.css.js.map +1 -1
- package/esm/components/step-indicator/Component.d.ts +5 -1
- package/esm/components/step-indicator/Component.js +3 -3
- package/esm/components/step-indicator/Component.js.map +1 -1
- package/esm/components/step-indicator/index.css +1 -1
- package/esm/components/step-indicator/index.module.css.js +1 -1
- package/esm/index.css +2 -2
- package/esm/index.module.css.js +1 -1
- package/index.css +2 -2
- package/index.module.css.js +1 -1
- package/modern/components/step/Component.d.ts +2 -2
- package/modern/components/step/Component.js +8 -11
- package/modern/components/step/Component.js.map +1 -1
- package/modern/components/step/index.css +31 -32
- package/modern/components/step/index.module.css.js +1 -1
- package/modern/components/step/index.module.css.js.map +1 -1
- package/modern/components/step-indicator/Component.d.ts +5 -1
- package/modern/components/step-indicator/Component.js +2 -2
- package/modern/components/step-indicator/Component.js.map +1 -1
- package/modern/components/step-indicator/index.css +1 -1
- package/modern/components/step-indicator/index.module.css.js +1 -1
- package/modern/index.css +2 -2
- package/modern/index.module.css.js +1 -1
- package/moderncssm/components/step/Component.d.ts +2 -2
- package/moderncssm/components/step/Component.js +8 -11
- package/moderncssm/components/step/Component.js.map +1 -1
- package/moderncssm/components/step/index.module.css +1 -2
- package/moderncssm/components/step-indicator/Component.d.ts +5 -1
- package/moderncssm/components/step-indicator/Component.js +2 -2
- package/moderncssm/components/step-indicator/Component.js.map +1 -1
- package/package.json +2 -2
- package/src/components/step/Component.tsx +10 -17
- package/src/components/step/index.module.css +1 -2
- package/src/components/step-indicator/Component.tsx +10 -7
|
@@ -33,40 +33,40 @@
|
|
|
33
33
|
--steps-option-svg-color: var(--color-light-status-positive);
|
|
34
34
|
--steps-dash-border: 2px solid var(--color-light-status-positive);
|
|
35
35
|
}
|
|
36
|
-
.
|
|
36
|
+
.steps__step_1fw7g {
|
|
37
37
|
display: flex;
|
|
38
38
|
outline: none;
|
|
39
39
|
}
|
|
40
|
-
.
|
|
40
|
+
.steps__step_1fw7g.steps__horizontal_1fw7g {
|
|
41
41
|
flex-grow: 1;
|
|
42
42
|
}
|
|
43
|
-
.
|
|
43
|
+
.steps__step_1fw7g:not(.steps__vertical_1fw7g) {
|
|
44
44
|
align-items: center;
|
|
45
45
|
}
|
|
46
|
-
.
|
|
46
|
+
.steps__step_1fw7g:last-of-type .steps__textWrapper_1fw7g.steps__vertical_1fw7g {
|
|
47
47
|
margin-bottom: var(--gap-0);
|
|
48
48
|
}
|
|
49
|
-
.
|
|
49
|
+
.steps__step_1fw7g.steps__interactive_1fw7g:not(.steps__disabled_1fw7g):hover {
|
|
50
50
|
cursor: pointer;
|
|
51
51
|
}
|
|
52
|
-
.
|
|
52
|
+
.steps__step_1fw7g.steps__disabled_1fw7g:hover .steps__text_1fw7g {
|
|
53
53
|
background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;
|
|
54
54
|
background: initial;
|
|
55
55
|
}
|
|
56
|
-
.
|
|
56
|
+
.steps__step_1fw7g.steps__disabled_1fw7g .steps__indicator_1fw7g {
|
|
57
57
|
cursor: inherit;
|
|
58
58
|
}
|
|
59
|
-
.
|
|
59
|
+
.steps__indicator_1fw7g {
|
|
60
60
|
cursor: pointer;
|
|
61
61
|
display: flex;
|
|
62
62
|
align-items: center;
|
|
63
63
|
margin-right: var(--gap-4);
|
|
64
64
|
}
|
|
65
|
-
.
|
|
65
|
+
.steps__indicator_1fw7g.steps__vertical_1fw7g {
|
|
66
66
|
flex-direction: column;
|
|
67
67
|
margin-right: var(--gap-8);
|
|
68
68
|
}
|
|
69
|
-
.
|
|
69
|
+
.steps__option_1fw7g {
|
|
70
70
|
font-size: 14px;
|
|
71
71
|
line-height: 20px;
|
|
72
72
|
font-weight: 700;
|
|
@@ -81,19 +81,19 @@
|
|
|
81
81
|
height: 24px;
|
|
82
82
|
border-radius: var(--border-radius-circle);
|
|
83
83
|
}
|
|
84
|
-
.
|
|
84
|
+
.steps__option_1fw7g.steps__vertical_1fw7g {
|
|
85
85
|
margin-top: var(--gap-8);
|
|
86
86
|
}
|
|
87
|
-
.
|
|
87
|
+
.steps__dash_1fw7g {
|
|
88
88
|
flex: 1 1 auto;
|
|
89
89
|
min-width: 24px;
|
|
90
90
|
border-top: 2px solid var(--color-light-neutral-translucent-300);
|
|
91
91
|
margin-right: var(--gap-8);
|
|
92
92
|
}
|
|
93
|
-
.
|
|
93
|
+
.steps__dash_1fw7g.steps__completed_1fw7g {
|
|
94
94
|
border-top: var(--steps-dash-border);
|
|
95
95
|
}
|
|
96
|
-
.
|
|
96
|
+
.steps__dash_1fw7g.steps__vertical_1fw7g {
|
|
97
97
|
min-width: 0;
|
|
98
98
|
min-width: initial;
|
|
99
99
|
min-height: 8px;
|
|
@@ -102,19 +102,19 @@
|
|
|
102
102
|
border-left: 2px solid var(--color-light-neutral-translucent-300);
|
|
103
103
|
border-top: none;
|
|
104
104
|
}
|
|
105
|
-
.
|
|
105
|
+
.steps__dash_1fw7g.steps__completed_1fw7g.steps__vertical_1fw7g {
|
|
106
106
|
border-left: var(--steps-dash-border);
|
|
107
107
|
}
|
|
108
|
-
.
|
|
108
|
+
.steps__textWrapper_1fw7g.steps__vertical_1fw7g {
|
|
109
109
|
min-height: 48px;
|
|
110
110
|
}
|
|
111
|
-
.
|
|
111
|
+
.steps__textWrapper_1fw7g.steps__vertical_1fw7g.steps__gap-24_1fw7g {
|
|
112
112
|
margin-bottom: var(--gap-8);
|
|
113
113
|
}
|
|
114
|
-
.
|
|
114
|
+
.steps__textWrapper_1fw7g.steps__vertical_1fw7g.steps__gap-32_1fw7g {
|
|
115
115
|
margin-bottom: var(--gap-16);
|
|
116
116
|
}
|
|
117
|
-
.
|
|
117
|
+
.steps__text_1fw7g {
|
|
118
118
|
font-size: 16px;
|
|
119
119
|
line-height: 24px;
|
|
120
120
|
font-weight: 400;
|
|
@@ -127,24 +127,24 @@
|
|
|
127
127
|
height: -moz-min-content;
|
|
128
128
|
height: min-content;
|
|
129
129
|
}
|
|
130
|
-
.
|
|
130
|
+
.steps__text_1fw7g.steps__interactive_1fw7g:not(.steps__disabled_1fw7g):hover {
|
|
131
131
|
background: var(--color-light-transparent-default-hover);
|
|
132
132
|
}
|
|
133
|
-
.
|
|
133
|
+
.steps__text_1fw7g.steps__interactive_1fw7g:not(.steps__disabled_1fw7g):active {
|
|
134
134
|
background: var(--color-light-transparent-default-press);
|
|
135
135
|
}
|
|
136
|
-
.
|
|
136
|
+
.steps__focused_1fw7g {
|
|
137
137
|
outline: var(--gap-2) solid var(--focus-color);
|
|
138
138
|
outline-offset: var(--gap-2);
|
|
139
139
|
}
|
|
140
|
-
.
|
|
140
|
+
.steps__selected_1fw7g .steps__text_1fw7g {
|
|
141
141
|
color: var(--color-light-text-primary);
|
|
142
142
|
}
|
|
143
|
-
.
|
|
143
|
+
.steps__selected_1fw7g .steps__option_1fw7g {
|
|
144
144
|
color: var(--color-light-text-primary-inverted);
|
|
145
145
|
background: var(--color-light-neutral-translucent-1300);
|
|
146
146
|
}
|
|
147
|
-
.
|
|
147
|
+
.steps__checkbox_1fw7g {
|
|
148
148
|
display: flex;
|
|
149
149
|
justify-content: center;
|
|
150
150
|
align-items: center;
|
|
@@ -153,26 +153,25 @@
|
|
|
153
153
|
height: 20px;
|
|
154
154
|
border: 2px solid var(--color-light-neutral-translucent-300);
|
|
155
155
|
}
|
|
156
|
-
.
|
|
156
|
+
.steps__dot_1fw7g {
|
|
157
157
|
width: 10px;
|
|
158
158
|
height: 10px;
|
|
159
159
|
border-radius: var(--border-radius-circle);
|
|
160
160
|
background: var(--color-light-neutral-translucent-300);
|
|
161
161
|
}
|
|
162
|
-
.
|
|
162
|
+
.steps__selected_1fw7g .steps__checkbox_1fw7g {
|
|
163
163
|
border: 2px solid var(--color-light-neutral-translucent-1300);
|
|
164
164
|
}
|
|
165
|
-
.
|
|
165
|
+
.steps__selected_1fw7g .steps__checkbox_1fw7g .steps__dot_1fw7g {
|
|
166
166
|
background: var(--color-light-neutral-translucent-1300);
|
|
167
167
|
}
|
|
168
|
-
.
|
|
168
|
+
.steps__option_1fw7g:not(.steps__error_1fw7g).steps__unordered_1fw7g {
|
|
169
169
|
background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;
|
|
170
170
|
background: initial;
|
|
171
171
|
}
|
|
172
|
-
.
|
|
173
|
-
color: var(--steps-option-svg-color);
|
|
172
|
+
.steps__completedIndicator_1fw7g[class*='positive-checkmark'] {
|
|
174
173
|
background-color: var(--steps-option-svg-color);
|
|
175
174
|
}
|
|
176
|
-
.
|
|
175
|
+
.steps__fullWidth_1fw7g {
|
|
177
176
|
width: 100%;
|
|
178
177
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"step":"
|
|
3
|
+
const styles = {"step":"steps__step_1fw7g","horizontal":"steps__horizontal_1fw7g","vertical":"steps__vertical_1fw7g","textWrapper":"steps__textWrapper_1fw7g","interactive":"steps__interactive_1fw7g","disabled":"steps__disabled_1fw7g","text":"steps__text_1fw7g","indicator":"steps__indicator_1fw7g","option":"steps__option_1fw7g","dash":"steps__dash_1fw7g","completed":"steps__completed_1fw7g","gap-24":"steps__gap-24_1fw7g","gap-32":"steps__gap-32_1fw7g","focused":"steps__focused_1fw7g","selected":"steps__selected_1fw7g","checkbox":"steps__checkbox_1fw7g","dot":"steps__dot_1fw7g","error":"steps__error_1fw7g","unordered":"steps__unordered_1fw7g","completedIndicator":"steps__completedIndicator_1fw7g","fullWidth":"steps__fullWidth_1fw7g"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/step/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --steps-option-svg-color: var(--color-light-status-positive);\n --steps-dash-border: 2px solid var(--color-light-status-positive);\n}\n\n.step {\n display: flex;\n outline: none;\n\n &.horizontal {\n flex-grow: 1;\n }\n\n &:not(.vertical) {\n align-items: center;\n }\n\n &:last-of-type .textWrapper.vertical {\n margin-bottom: var(--gap-0);\n }\n}\n\n.step.interactive:not(.disabled):hover {\n cursor: pointer;\n}\n\n.step.disabled:hover {\n & .text {\n background: unset;\n }\n}\n\n.step.disabled {\n & .indicator {\n cursor: unset;\n }\n}\n\n.indicator {\n cursor: pointer;\n display: flex;\n align-items: center;\n margin-right: var(--gap-4);\n\n &.vertical {\n flex-direction: column;\n margin-right: var(--gap-8);\n }\n}\n\n.option {\n @mixin accent_primary_small;\n\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-light-text-primary);\n background: var(--color-light-neutral-translucent-300);\n min-width: 24px;\n height: 24px;\n border-radius: var(--border-radius-circle);\n\n &.vertical {\n margin-top: var(--gap-8);\n }\n}\n\n.dash {\n flex: 1 1 auto;\n min-width: 24px;\n border-top: 2px solid var(--color-light-neutral-translucent-300);\n margin-right: var(--gap-8);\n\n &.completed {\n border-top: var(--steps-dash-border);\n }\n\n &.vertical {\n min-width: unset;\n min-height: 8px;\n margin-right: var(--gap-0);\n margin-top: var(--gap-8);\n border-left: 2px solid var(--color-light-neutral-translucent-300);\n border-top: none;\n }\n\n &.completed.vertical {\n border-left: var(--steps-dash-border);\n }\n}\n\n.textWrapper {\n &.vertical {\n min-height: 48px;\n\n &.gap-24 {\n margin-bottom: var(--gap-8);\n }\n\n &.gap-32 {\n margin-bottom: var(--gap-16);\n }\n }\n}\n\n.text {\n @mixin paragraph_primary_medium;\n\n transition: background 0.2s;\n padding: var(--gap-8);\n color: var(--color-light-text-primary);\n border-radius: var(--gap-8);\n height: min-content;\n\n &.interactive:not(.disabled) {\n &:hover {\n background: var(--color-light-transparent-default-hover);\n }\n\n &:active {\n background: var(--color-light-transparent-default-press);\n }\n }\n}\n\n.focused {\n outline: var(--gap-2) solid var(--focus-color);\n outline-offset: var(--gap-2);\n}\n\n.selected {\n & .text {\n color: var(--color-light-text-primary);\n }\n\n & .option {\n color: var(--color-light-text-primary-inverted);\n background: var(--color-light-neutral-translucent-1300);\n }\n}\n\n.checkbox {\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: var(--border-radius-circle);\n width: 20px;\n height: 20px;\n border: 2px solid var(--color-light-neutral-translucent-300);\n}\n\n.dot {\n width: 10px;\n height: 10px;\n border-radius: var(--border-radius-circle);\n background: var(--color-light-neutral-translucent-300);\n}\n\n.selected .checkbox {\n border: 2px solid var(--color-light-neutral-translucent-1300);\n\n & .dot {\n background: var(--color-light-neutral-translucent-1300);\n }\n}\n\n.option:not(.error).unordered {\n background: unset;\n}\n\n.completedIndicator
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/step/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --steps-option-svg-color: var(--color-light-status-positive);\n --steps-dash-border: 2px solid var(--color-light-status-positive);\n}\n\n.step {\n display: flex;\n outline: none;\n\n &.horizontal {\n flex-grow: 1;\n }\n\n &:not(.vertical) {\n align-items: center;\n }\n\n &:last-of-type .textWrapper.vertical {\n margin-bottom: var(--gap-0);\n }\n}\n\n.step.interactive:not(.disabled):hover {\n cursor: pointer;\n}\n\n.step.disabled:hover {\n & .text {\n background: unset;\n }\n}\n\n.step.disabled {\n & .indicator {\n cursor: unset;\n }\n}\n\n.indicator {\n cursor: pointer;\n display: flex;\n align-items: center;\n margin-right: var(--gap-4);\n\n &.vertical {\n flex-direction: column;\n margin-right: var(--gap-8);\n }\n}\n\n.option {\n @mixin accent_primary_small;\n\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color-light-text-primary);\n background: var(--color-light-neutral-translucent-300);\n min-width: 24px;\n height: 24px;\n border-radius: var(--border-radius-circle);\n\n &.vertical {\n margin-top: var(--gap-8);\n }\n}\n\n.dash {\n flex: 1 1 auto;\n min-width: 24px;\n border-top: 2px solid var(--color-light-neutral-translucent-300);\n margin-right: var(--gap-8);\n\n &.completed {\n border-top: var(--steps-dash-border);\n }\n\n &.vertical {\n min-width: unset;\n min-height: 8px;\n margin-right: var(--gap-0);\n margin-top: var(--gap-8);\n border-left: 2px solid var(--color-light-neutral-translucent-300);\n border-top: none;\n }\n\n &.completed.vertical {\n border-left: var(--steps-dash-border);\n }\n}\n\n.textWrapper {\n &.vertical {\n min-height: 48px;\n\n &.gap-24 {\n margin-bottom: var(--gap-8);\n }\n\n &.gap-32 {\n margin-bottom: var(--gap-16);\n }\n }\n}\n\n.text {\n @mixin paragraph_primary_medium;\n\n transition: background 0.2s;\n padding: var(--gap-8);\n color: var(--color-light-text-primary);\n border-radius: var(--gap-8);\n height: min-content;\n\n &.interactive:not(.disabled) {\n &:hover {\n background: var(--color-light-transparent-default-hover);\n }\n\n &:active {\n background: var(--color-light-transparent-default-press);\n }\n }\n}\n\n.focused {\n outline: var(--gap-2) solid var(--focus-color);\n outline-offset: var(--gap-2);\n}\n\n.selected {\n & .text {\n color: var(--color-light-text-primary);\n }\n\n & .option {\n color: var(--color-light-text-primary-inverted);\n background: var(--color-light-neutral-translucent-1300);\n }\n}\n\n.checkbox {\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: var(--border-radius-circle);\n width: 20px;\n height: 20px;\n border: 2px solid var(--color-light-neutral-translucent-300);\n}\n\n.dot {\n width: 10px;\n height: 10px;\n border-radius: var(--border-radius-circle);\n background: var(--color-light-neutral-translucent-300);\n}\n\n.selected .checkbox {\n border: 2px solid var(--color-light-neutral-translucent-1300);\n\n & .dot {\n background: var(--color-light-neutral-translucent-1300);\n }\n}\n\n.option:not(.error).unordered {\n background: unset;\n}\n\n.completedIndicator[class*='positive-checkmark'] {\n background-color: var(--steps-option-svg-color);\n}\n\n.fullWidth {\n width: 100%;\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,MAAM,CAAC,mBAAmB,CAAC,YAAY,CAAC,yBAAyB,CAAC,UAAU,CAAC,uBAAuB,CAAC,aAAa,CAAC,0BAA0B,CAAC,aAAa,CAAC,0BAA0B,CAAC,UAAU,CAAC,uBAAuB,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,wBAAwB,CAAC,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,wBAAwB,CAAC,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC,qBAAqB,CAAC,SAAS,CAAC,sBAAsB,CAAC,UAAU,CAAC,uBAAuB,CAAC,UAAU,CAAC,uBAAuB,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,oBAAoB,CAAC,WAAW,CAAC,wBAAwB,CAAC,oBAAoB,CAAC,iCAAiC,CAAC,WAAW,CAAC,wBAAwB,CAAC;;;;"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type BadgeProps } from '@alfalab/core-components-badge/modern';
|
|
3
|
+
import { type StatusBadgeProps } from '@alfalab/core-components-status-badge/modern';
|
|
4
|
+
/** @description В `@alfalab/core-components@51.0.0` тип будет изменен на Pick<StatusBadgeProps, 'view' | 'className' | 'colors'> */
|
|
3
5
|
export type StepIndicatorProps = Pick<BadgeProps, 'content' | 'iconColor' | 'className'>;
|
|
4
|
-
|
|
6
|
+
type StatusBadgeIndicatorProps = Pick<StatusBadgeProps, 'view' | 'className' | 'colors'>;
|
|
7
|
+
export declare const StepIndicator: React.FC<StatusBadgeIndicatorProps>;
|
|
8
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import {
|
|
3
|
+
import { StatusBadge } from '@alfalab/core-components-status-badge/modern';
|
|
4
4
|
import styles from './index.module.css.js';
|
|
5
5
|
|
|
6
|
-
const StepIndicator = ({
|
|
6
|
+
const StepIndicator = ({ view, className, colors }) => (React.createElement(StatusBadge, { size: 24, view: view, colors: colors, className: cn(styles.component, className) }));
|
|
7
7
|
|
|
8
8
|
export { StepIndicator };
|
|
9
9
|
//# sourceMappingURL=Component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/step-indicator/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport {
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/step-indicator/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type BadgeProps } from '@alfalab/core-components-badge';\nimport { StatusBadge, type StatusBadgeProps } from '@alfalab/core-components-status-badge';\n\nimport styles from './index.module.css';\n\n/** @description В `@alfalab/core-components@51.0.0` тип будет изменен на Pick<StatusBadgeProps, 'view' | 'className' | 'colors'> */\nexport type StepIndicatorProps = Pick<BadgeProps, 'content' | 'iconColor' | 'className'>;\n\ntype StatusBadgeIndicatorProps = Pick<StatusBadgeProps, 'view' | 'className' | 'colors'>;\n\nexport const StepIndicator: React.FC<StatusBadgeIndicatorProps> = ({ view, className, colors }) => (\n <StatusBadge\n size={24}\n view={view}\n colors={colors}\n className={cn(styles.component, className)}\n />\n);\n"],"names":[],"mappings":";;;;;AAaa,MAAA,aAAa,GAAwC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAC1F,KAAC,CAAA,aAAA,CAAA,WAAW,IACR,IAAI,EAAE,EAAE,EACR,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,EAAA,CAC5C;;;;"}
|
package/modern/index.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
.
|
|
1
|
+
.steps__component_671rj {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
flex-direction: row;
|
|
5
5
|
}
|
|
6
|
-
.
|
|
6
|
+
.steps__component_671rj.steps__vertical_671rj {
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
align-items: flex-start;
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"
|
|
3
|
+
const styles = {"component":"steps__component_671rj","vertical":"steps__vertical_671rj"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
2
|
import { type CommonProps } from '../../types/common-props';
|
|
3
3
|
import { type StepIndicatorProps } from '../step-indicator';
|
|
4
|
-
|
|
4
|
+
interface StepProps extends CommonProps {
|
|
5
5
|
/**
|
|
6
6
|
* Номер шага
|
|
7
7
|
*/
|
|
@@ -51,6 +51,6 @@ type StepProps = {
|
|
|
51
51
|
* @param stepNumber - номер шага
|
|
52
52
|
*/
|
|
53
53
|
onClick: (stepNumber: number) => void;
|
|
54
|
-
}
|
|
54
|
+
}
|
|
55
55
|
export declare const Step: FC<StepProps>;
|
|
56
56
|
export {};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
+
import { Badge } from '@alfalab/core-components-badge/moderncssm';
|
|
3
4
|
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
4
5
|
import { useFocus } from '@alfalab/hooks';
|
|
5
|
-
import { CheckmarkCircleMIcon } from '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
6
|
-
import { ClockMIcon } from '@alfalab/icons-glyph/ClockMIcon';
|
|
7
|
-
import { CrossCompactMIcon } from '@alfalab/icons-glyph/CrossCompactMIcon';
|
|
8
|
-
import { ExclamationCircleMIcon } from '@alfalab/icons-glyph/ExclamationCircleMIcon';
|
|
9
6
|
import { StepIndicator } from '../step-indicator/Component.js';
|
|
10
7
|
import styles from './index.module.css';
|
|
11
8
|
|
|
@@ -29,25 +26,25 @@ const Step = ({ children, stepNumber, isSelected, disabled, ordered, isPositive,
|
|
|
29
26
|
};
|
|
30
27
|
const getStepIndicator = () => {
|
|
31
28
|
if (customStepIndicator) {
|
|
32
|
-
return React.createElement(
|
|
29
|
+
return React.createElement(Badge, { view: 'icon', size: 'l', ...customStepIndicator });
|
|
33
30
|
}
|
|
34
31
|
if (isCriticalError) {
|
|
35
|
-
return React.createElement(StepIndicator, {
|
|
32
|
+
return React.createElement(StepIndicator, { view: 'negative-cross' });
|
|
36
33
|
}
|
|
37
34
|
if (isError) {
|
|
38
|
-
return React.createElement(StepIndicator, {
|
|
35
|
+
return React.createElement(StepIndicator, { view: 'negative-alert' });
|
|
39
36
|
}
|
|
40
37
|
if (isWarning) {
|
|
41
|
-
return React.createElement(StepIndicator, {
|
|
38
|
+
return React.createElement(StepIndicator, { view: 'attention-alert' });
|
|
42
39
|
}
|
|
43
40
|
if (isWaiting) {
|
|
44
|
-
return React.createElement(StepIndicator, {
|
|
41
|
+
return React.createElement(StepIndicator, { view: 'neutral-operation' });
|
|
45
42
|
}
|
|
46
43
|
if (isPositive) {
|
|
47
|
-
return React.createElement(StepIndicator, {
|
|
44
|
+
return React.createElement(StepIndicator, { view: 'positive-checkmark' });
|
|
48
45
|
}
|
|
49
46
|
if (isStepCompleted) {
|
|
50
|
-
return (React.createElement(StepIndicator, {
|
|
47
|
+
return (React.createElement(StepIndicator, { view: 'positive-checkmark', className: styles.completedIndicator }));
|
|
51
48
|
}
|
|
52
49
|
if (!ordered) {
|
|
53
50
|
return (React.createElement("div", { className: styles.checkbox },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/step/Component.tsx"],"sourcesContent":["import React, { type FC, useRef } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { useFocus } from '@alfalab/hooks';\nimport { CheckmarkCircleMIcon } from '@alfalab/icons-glyph/CheckmarkCircleMIcon';\nimport { ClockMIcon } from '@alfalab/icons-glyph/ClockMIcon';\nimport { CrossCompactMIcon } from '@alfalab/icons-glyph/CrossCompactMIcon';\nimport { ExclamationCircleMIcon } from '@alfalab/icons-glyph/ExclamationCircleMIcon';\n\nimport { type CommonProps } from '../../types/common-props';\nimport { StepIndicator, type StepIndicatorProps } from '../step-indicator';\n\nimport styles from './index.module.css';\n\ntype StepProps = {\n /**\n * Номер шага\n */\n stepNumber: number;\n\n /**\n * Маркер того, что текущий шаг выбран\n */\n isSelected: boolean;\n\n /**\n * Маркер того, что текущий шаг доступен для клика\n */\n disabled: boolean;\n\n /**\n * Маркер того, что текущий шаг находится в состоянии \"Positive\"\n */\n isPositive: boolean;\n\n /**\n * Маркер того, что текущий шаг находится в состоянии \"Error\"\n */\n isError: boolean;\n\n /**\n * Маркер того, что текущий шаг находится в состоянии \"isCriticalError\"\n */\n isCriticalError: boolean;\n\n /**\n * Маркер того, что текущий шаг находится в состоянии \"Warning\"\n */\n isWarning: boolean;\n\n /**\n * Маркер того, что текущий шаг находится в состоянии \"Waiting\"\n */\n isWaiting: boolean;\n\n /**\n * Маркер того, что текущий шаг нужно пометить как завершенный\n */\n isStepCompleted: boolean;\n\n /**\n * Свойства кастомного индикатора текущего шага\n */\n customStepIndicator?: StepIndicatorProps | null;\n\n /**\n * Указывает, является ли текущий шаг последним в списке\n */\n isNotLastStep?: boolean;\n\n /**\n * Обработчик нажатия на текущей шаг\n * @param stepNumber - номер шага\n */\n onClick: (stepNumber: number) => void;\n} & CommonProps;\n\nexport const Step: FC<StepProps> = ({\n children,\n stepNumber,\n isSelected,\n disabled,\n ordered,\n isPositive,\n isError,\n isCriticalError,\n isWarning,\n isWaiting,\n customStepIndicator,\n isStepCompleted,\n onClick,\n interactive,\n isVerticalAlign,\n isNotLastStep,\n fullWidth,\n minSpaceBetweenSteps = 24,\n completedDashColor,\n dataTestId,\n}) => {\n const stepRef = useRef<HTMLDivElement>(null);\n\n const [focused] = useFocus(stepRef, 'keyboard');\n\n const handleButtonClick = () => {\n if (!disabled && interactive && onClick) {\n onClick(stepNumber);\n }\n };\n\n const handleTextClick = (e: React.MouseEvent<HTMLElement>) => {\n if (!interactive) {\n e.stopPropagation();\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n handleButtonClick();\n }\n };\n\n const getStepIndicator = () => {\n if (customStepIndicator) {\n return <StepIndicator {...customStepIndicator} />;\n }\n if (isCriticalError) {\n return <StepIndicator iconColor='negative' content={<CrossCompactMIcon />} />;\n }\n if (isError) {\n return <StepIndicator iconColor='negative' content={<ExclamationCircleMIcon />} />;\n }\n if (isWarning) {\n return <StepIndicator iconColor='attention' content={<ExclamationCircleMIcon />} />;\n }\n if (isWaiting) {\n return <StepIndicator iconColor='secondary' content={<ClockMIcon />} />;\n }\n if (isPositive) {\n return <StepIndicator iconColor='positive' content={<CheckmarkCircleMIcon />} />;\n }\n if (isStepCompleted) {\n return (\n <StepIndicator\n iconColor='positive'\n content={<CheckmarkCircleMIcon />}\n className={styles.completedIndicator}\n />\n );\n }\n if (!ordered) {\n return (\n <div className={styles.checkbox}>\n <span className={styles.dot} />\n </div>\n );\n }\n\n return stepNumber;\n };\n\n const getCustomDashColor = () => {\n if (isStepCompleted && completedDashColor) {\n return {\n borderColor: completedDashColor,\n };\n }\n\n return {};\n };\n\n const renderDash = () => (\n <div\n className={cn(styles.dash, {\n [styles.vertical]: isVerticalAlign,\n [styles.completed]: isStepCompleted,\n })}\n style={{\n ...getCustomDashColor(),\n }}\n />\n );\n\n return (\n <div\n data-test-id={getDataTestId(dataTestId, 'step')}\n role='button'\n tabIndex={0}\n ref={stepRef}\n className={cn(styles.step, {\n [styles.completed]: isStepCompleted,\n [styles.error]: isError,\n [styles.selected]: isSelected,\n [styles.disabled]: disabled,\n [styles.focused]: focused,\n [styles.vertical]: isVerticalAlign,\n [styles.interactive]: interactive,\n [styles.fullWidth]: fullWidth && isVerticalAlign,\n [styles.horizontal]: !isVerticalAlign,\n })}\n onClick={handleButtonClick}\n onKeyDown={handleKeyDown}\n >\n <div\n className={cn(styles.indicator, {\n [styles.vertical]: isVerticalAlign,\n [styles.interactive]: interactive,\n })}\n >\n <div\n className={cn(styles.option, {\n [styles.unordered]: !ordered,\n [styles.vertical]: isVerticalAlign,\n [styles.error]: isError,\n })}\n >\n {getStepIndicator()}\n </div>\n {isNotLastStep && isVerticalAlign && renderDash()}\n </div>\n <div\n className={cn(styles.textWrapper, styles[`gap-${minSpaceBetweenSteps}`], {\n [styles.vertical]: isVerticalAlign,\n })}\n >\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={cn(styles.text, {\n [styles.interactive]: interactive,\n [styles.fullWidth]: fullWidth && isVerticalAlign,\n })}\n onClick={handleTextClick}\n >\n {children}\n </div>\n </div>\n {isNotLastStep && !isVerticalAlign && renderDash()}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;MA8Ea,IAAI,GAAkB,CAAC,EAChC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;aACpC,CAAC,EAAA;AAEF,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE;AACzB,oBAAA,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,OAAO;AAC5B,oBAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe;AAClC,oBAAA,CAAC,MAAM,CAAC,KAAK,GAAG,OAAO;iBAC1B,CAAC,EAAA,EAED,gBAAgB,EAAE,CACjB;AACL,YAAA,aAAa,IAAI,eAAe,IAAI,UAAU,EAAE,CAC/C;AACN,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA,IAAA,EAAO,oBAAoB,CAAA,CAAE,CAAC,EAAE;AACrE,gBAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe;aACrC,CAAC,EAAA;AAGF,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE;AACvB,oBAAA,CAAC,MAAM,CAAC,WAAW,GAAG,WAAW;AACjC,oBAAA,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,IAAI,eAAe;AACnD,iBAAA,CAAC,EACF,OAAO,EAAE,eAAe,EAEvB,EAAA,QAAQ,CACP,CACJ;QACL,aAAa,IAAI,CAAC,eAAe,IAAI,UAAU,EAAE,CAChD;AAEd;;;;"}
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/step/Component.tsx"],"sourcesContent":["import React, { type FC, useRef } from 'react';\nimport cn from 'classnames';\n\nimport { Badge } from '@alfalab/core-components-badge';\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { useFocus } from '@alfalab/hooks';\n\nimport { type CommonProps } from '../../types/common-props';\nimport { StepIndicator, type StepIndicatorProps } from '../step-indicator';\n\nimport styles from './index.module.css';\n\ninterface StepProps extends CommonProps {\n /**\n * Номер шага\n */\n stepNumber: number;\n\n /**\n * Маркер того, что текущий шаг выбран\n */\n isSelected: boolean;\n\n /**\n * Маркер того, что текущий шаг доступен для клика\n */\n disabled: boolean;\n\n /**\n * Маркер того, что текущий шаг находится в состоянии \"Positive\"\n */\n isPositive: boolean;\n\n /**\n * Маркер того, что текущий шаг находится в состоянии \"Error\"\n */\n isError: boolean;\n\n /**\n * Маркер того, что текущий шаг находится в состоянии \"isCriticalError\"\n */\n isCriticalError: boolean;\n\n /**\n * Маркер того, что текущий шаг находится в состоянии \"Warning\"\n */\n isWarning: boolean;\n\n /**\n * Маркер того, что текущий шаг находится в состоянии \"Waiting\"\n */\n isWaiting: boolean;\n\n /**\n * Маркер того, что текущий шаг нужно пометить как завершенный\n */\n isStepCompleted: boolean;\n\n /**\n * Свойства кастомного индикатора текущего шага\n */\n customStepIndicator?: StepIndicatorProps | null;\n\n /**\n * Указывает, является ли текущий шаг последним в списке\n */\n isNotLastStep?: boolean;\n\n /**\n * Обработчик нажатия на текущей шаг\n * @param stepNumber - номер шага\n */\n onClick: (stepNumber: number) => void;\n}\n\nexport const Step: FC<StepProps> = ({\n children,\n stepNumber,\n isSelected,\n disabled,\n ordered,\n isPositive,\n isError,\n isCriticalError,\n isWarning,\n isWaiting,\n customStepIndicator,\n isStepCompleted,\n onClick,\n interactive,\n isVerticalAlign,\n isNotLastStep,\n fullWidth,\n minSpaceBetweenSteps = 24,\n completedDashColor,\n dataTestId,\n}) => {\n const stepRef = useRef<HTMLDivElement>(null);\n\n const [focused] = useFocus(stepRef, 'keyboard');\n\n const handleButtonClick = () => {\n if (!disabled && interactive && onClick) {\n onClick(stepNumber);\n }\n };\n\n const handleTextClick = (e: React.MouseEvent<HTMLElement>) => {\n if (!interactive) {\n e.stopPropagation();\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n handleButtonClick();\n }\n };\n\n const getStepIndicator = () => {\n if (customStepIndicator) {\n return <Badge view='icon' size='l' {...customStepIndicator} />;\n }\n if (isCriticalError) {\n return <StepIndicator view='negative-cross' />;\n }\n if (isError) {\n return <StepIndicator view='negative-alert' />;\n }\n if (isWarning) {\n return <StepIndicator view='attention-alert' />;\n }\n if (isWaiting) {\n return <StepIndicator view='neutral-operation' />;\n }\n if (isPositive) {\n return <StepIndicator view='positive-checkmark' />;\n }\n if (isStepCompleted) {\n return (\n <StepIndicator view='positive-checkmark' className={styles.completedIndicator} />\n );\n }\n if (!ordered) {\n return (\n <div className={styles.checkbox}>\n <span className={styles.dot} />\n </div>\n );\n }\n\n return stepNumber;\n };\n\n const getCustomDashColor = () => {\n if (isStepCompleted && completedDashColor) {\n return {\n borderColor: completedDashColor,\n };\n }\n\n return {};\n };\n\n const renderDash = () => (\n <div\n className={cn(styles.dash, {\n [styles.vertical]: isVerticalAlign,\n [styles.completed]: isStepCompleted,\n })}\n style={{\n ...getCustomDashColor(),\n }}\n />\n );\n\n return (\n <div\n data-test-id={getDataTestId(dataTestId, 'step')}\n role='button'\n tabIndex={0}\n ref={stepRef}\n className={cn(styles.step, {\n [styles.completed]: isStepCompleted,\n [styles.error]: isError,\n [styles.selected]: isSelected,\n [styles.disabled]: disabled,\n [styles.focused]: focused,\n [styles.vertical]: isVerticalAlign,\n [styles.interactive]: interactive,\n [styles.fullWidth]: fullWidth && isVerticalAlign,\n [styles.horizontal]: !isVerticalAlign,\n })}\n onClick={handleButtonClick}\n onKeyDown={handleKeyDown}\n >\n <div\n className={cn(styles.indicator, {\n [styles.vertical]: isVerticalAlign,\n [styles.interactive]: interactive,\n })}\n >\n <div\n className={cn(styles.option, {\n [styles.unordered]: !ordered,\n [styles.vertical]: isVerticalAlign,\n [styles.error]: isError,\n })}\n >\n {getStepIndicator()}\n </div>\n {isNotLastStep && isVerticalAlign && renderDash()}\n </div>\n <div\n className={cn(styles.textWrapper, styles[`gap-${minSpaceBetweenSteps}`], {\n [styles.vertical]: isVerticalAlign,\n })}\n >\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n <div\n className={cn(styles.text, {\n [styles.interactive]: interactive,\n [styles.fullWidth]: fullWidth && isVerticalAlign,\n })}\n onClick={handleTextClick}\n >\n {children}\n </div>\n </div>\n {isNotLastStep && !isVerticalAlign && renderDash()}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;MA2Ea,IAAI,GAAkB,CAAC,EAChC,QAAQ,EACR,UAAU,EACV,UAAU,EACV,QAAQ,EACR,OAAO,EACP,UAAU,EACV,OAAO,EACP,eAAe,EACf,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,eAAe,EACf,OAAO,EACP,WAAW,EACX,eAAe,EACf,aAAa,EACb,SAAS,EACT,oBAAoB,GAAG,EAAE,EACzB,kBAAkB,EAClB,UAAU,GACb,KAAI;AACD,IAAA,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC;IAE5C,MAAM,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAE/C,MAAM,iBAAiB,GAAG,MAAK;AAC3B,QAAA,IAAI,CAAC,QAAQ,IAAI,WAAW,IAAI,OAAO,EAAE;YACrC,OAAO,CAAC,UAAU,CAAC;;AAE3B,KAAC;AAED,IAAA,MAAM,eAAe,GAAG,CAAC,CAAgC,KAAI;QACzD,IAAI,CAAC,WAAW,EAAE;YACd,CAAC,CAAC,eAAe,EAAE;;AAE3B,KAAC;AAED,IAAA,MAAM,aAAa,GAAG,CAAC,KAA0B,KAAI;AACjD,QAAA,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;AACvB,YAAA,iBAAiB,EAAE;;AAE3B,KAAC;IAED,MAAM,gBAAgB,GAAG,MAAK;QAC1B,IAAI,mBAAmB,EAAE;AACrB,YAAA,OAAO,KAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,GA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,CAAC,MAAM,EAAE;AACzB,oBAAA,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,OAAO;AAC5B,oBAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe;AAClC,oBAAA,CAAC,MAAM,CAAC,KAAK,GAAG,OAAO;iBAC1B,CAAC,EAAA,EAED,gBAAgB,EAAE,CACjB;AACL,YAAA,aAAa,IAAI,eAAe,IAAI,UAAU,EAAE,CAC/C;AACN,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA,IAAA,EAAO,oBAAoB,CAAA,CAAE,CAAC,EAAE;AACrE,gBAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe;aACrC,CAAC,EAAA;AAGF,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE;AACvB,oBAAA,CAAC,MAAM,CAAC,WAAW,GAAG,WAAW;AACjC,oBAAA,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,IAAI,eAAe;AACnD,iBAAA,CAAC,EACF,OAAO,EAAE,eAAe,EAEvB,EAAA,QAAQ,CACP,CACJ;QACL,aAAa,IAAI,CAAC,eAAe,IAAI,UAAU,EAAE,CAChD;AAEd;;;;"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type BadgeProps } from '@alfalab/core-components-badge/moderncssm';
|
|
3
|
+
import { type StatusBadgeProps } from '@alfalab/core-components-status-badge/moderncssm';
|
|
4
|
+
/** @description В `@alfalab/core-components@51.0.0` тип будет изменен на Pick<StatusBadgeProps, 'view' | 'className' | 'colors'> */
|
|
3
5
|
export type StepIndicatorProps = Pick<BadgeProps, 'content' | 'iconColor' | 'className'>;
|
|
4
|
-
|
|
6
|
+
type StatusBadgeIndicatorProps = Pick<StatusBadgeProps, 'view' | 'className' | 'colors'>;
|
|
7
|
+
export declare const StepIndicator: React.FC<StatusBadgeIndicatorProps>;
|
|
8
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import {
|
|
3
|
+
import { StatusBadge } from '@alfalab/core-components-status-badge/moderncssm';
|
|
4
4
|
import styles from './index.module.css';
|
|
5
5
|
|
|
6
|
-
const StepIndicator = ({
|
|
6
|
+
const StepIndicator = ({ view, className, colors }) => (React.createElement(StatusBadge, { size: 24, view: view, colors: colors, className: cn(styles.component, className) }));
|
|
7
7
|
|
|
8
8
|
export { StepIndicator };
|
|
9
9
|
//# sourceMappingURL=Component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/step-indicator/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport {
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/step-indicator/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type BadgeProps } from '@alfalab/core-components-badge';\nimport { StatusBadge, type StatusBadgeProps } from '@alfalab/core-components-status-badge';\n\nimport styles from './index.module.css';\n\n/** @description В `@alfalab/core-components@51.0.0` тип будет изменен на Pick<StatusBadgeProps, 'view' | 'className' | 'colors'> */\nexport type StepIndicatorProps = Pick<BadgeProps, 'content' | 'iconColor' | 'className'>;\n\ntype StatusBadgeIndicatorProps = Pick<StatusBadgeProps, 'view' | 'className' | 'colors'>;\n\nexport const StepIndicator: React.FC<StatusBadgeIndicatorProps> = ({ view, className, colors }) => (\n <StatusBadge\n size={24}\n view={view}\n colors={colors}\n className={cn(styles.component, className)}\n />\n);\n"],"names":[],"mappings":";;;;;AAaa,MAAA,aAAa,GAAwC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAC1F,KAAC,CAAA,aAAA,CAAA,WAAW,IACR,IAAI,EAAE,EAAE,EACR,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,EAAA,CAC5C;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-steps",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@alfalab/core-components-badge": "^7.0.2",
|
|
14
14
|
"@alfalab/core-components-shared": "^2.1.1",
|
|
15
|
+
"@alfalab/core-components-status-badge": "^3.0.2",
|
|
15
16
|
"@alfalab/hooks": "^1.13.1",
|
|
16
|
-
"@alfalab/icons-glyph": "^2.260.0",
|
|
17
17
|
"classnames": "^2.5.1",
|
|
18
18
|
"tslib": "^2.4.0"
|
|
19
19
|
},
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import React, { type FC, useRef } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
+
import { Badge } from '@alfalab/core-components-badge';
|
|
4
5
|
import { getDataTestId } from '@alfalab/core-components-shared';
|
|
5
6
|
import { useFocus } from '@alfalab/hooks';
|
|
6
|
-
import { CheckmarkCircleMIcon } from '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
7
|
-
import { ClockMIcon } from '@alfalab/icons-glyph/ClockMIcon';
|
|
8
|
-
import { CrossCompactMIcon } from '@alfalab/icons-glyph/CrossCompactMIcon';
|
|
9
|
-
import { ExclamationCircleMIcon } from '@alfalab/icons-glyph/ExclamationCircleMIcon';
|
|
10
7
|
|
|
11
8
|
import { type CommonProps } from '../../types/common-props';
|
|
12
9
|
import { StepIndicator, type StepIndicatorProps } from '../step-indicator';
|
|
13
10
|
|
|
14
11
|
import styles from './index.module.css';
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
interface StepProps extends CommonProps {
|
|
17
14
|
/**
|
|
18
15
|
* Номер шага
|
|
19
16
|
*/
|
|
@@ -74,7 +71,7 @@ type StepProps = {
|
|
|
74
71
|
* @param stepNumber - номер шага
|
|
75
72
|
*/
|
|
76
73
|
onClick: (stepNumber: number) => void;
|
|
77
|
-
}
|
|
74
|
+
}
|
|
78
75
|
|
|
79
76
|
export const Step: FC<StepProps> = ({
|
|
80
77
|
children,
|
|
@@ -122,30 +119,26 @@ export const Step: FC<StepProps> = ({
|
|
|
122
119
|
|
|
123
120
|
const getStepIndicator = () => {
|
|
124
121
|
if (customStepIndicator) {
|
|
125
|
-
return <
|
|
122
|
+
return <Badge view='icon' size='l' {...customStepIndicator} />;
|
|
126
123
|
}
|
|
127
124
|
if (isCriticalError) {
|
|
128
|
-
return <StepIndicator
|
|
125
|
+
return <StepIndicator view='negative-cross' />;
|
|
129
126
|
}
|
|
130
127
|
if (isError) {
|
|
131
|
-
return <StepIndicator
|
|
128
|
+
return <StepIndicator view='negative-alert' />;
|
|
132
129
|
}
|
|
133
130
|
if (isWarning) {
|
|
134
|
-
return <StepIndicator
|
|
131
|
+
return <StepIndicator view='attention-alert' />;
|
|
135
132
|
}
|
|
136
133
|
if (isWaiting) {
|
|
137
|
-
return <StepIndicator
|
|
134
|
+
return <StepIndicator view='neutral-operation' />;
|
|
138
135
|
}
|
|
139
136
|
if (isPositive) {
|
|
140
|
-
return <StepIndicator
|
|
137
|
+
return <StepIndicator view='positive-checkmark' />;
|
|
141
138
|
}
|
|
142
139
|
if (isStepCompleted) {
|
|
143
140
|
return (
|
|
144
|
-
<StepIndicator
|
|
145
|
-
iconColor='positive'
|
|
146
|
-
content={<CheckmarkCircleMIcon />}
|
|
147
|
-
className={styles.completedIndicator}
|
|
148
|
-
/>
|
|
141
|
+
<StepIndicator view='positive-checkmark' className={styles.completedIndicator} />
|
|
149
142
|
);
|
|
150
143
|
}
|
|
151
144
|
if (!ordered) {
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { type BadgeProps } from '@alfalab/core-components-badge';
|
|
5
|
+
import { StatusBadge, type StatusBadgeProps } from '@alfalab/core-components-status-badge';
|
|
5
6
|
|
|
6
7
|
import styles from './index.module.css';
|
|
7
8
|
|
|
9
|
+
/** @description В `@alfalab/core-components@51.0.0` тип будет изменен на Pick<StatusBadgeProps, 'view' | 'className' | 'colors'> */
|
|
8
10
|
export type StepIndicatorProps = Pick<BadgeProps, 'content' | 'iconColor' | 'className'>;
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
type StatusBadgeIndicatorProps = Pick<StatusBadgeProps, 'view' | 'className' | 'colors'>;
|
|
13
|
+
|
|
14
|
+
export const StepIndicator: React.FC<StatusBadgeIndicatorProps> = ({ view, className, colors }) => (
|
|
15
|
+
<StatusBadge
|
|
16
|
+
size={24}
|
|
17
|
+
view={view}
|
|
18
|
+
colors={colors}
|
|
15
19
|
className={cn(styles.component, className)}
|
|
16
|
-
content={content}
|
|
17
20
|
/>
|
|
18
21
|
);
|