@megafon/ui-core 4.0.0-beta.9 → 4.0.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/CHANGELOG.md +74 -16
- package/dist/es/components/Accordion/Accordion.css +6 -4
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +4 -0
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.d.ts +1 -0
- package/dist/es/components/Badges/components/PromoBadge/PromoBadge.js +2 -1
- package/dist/es/components/Banner/Banner.css +3 -0
- package/dist/es/components/Banner/Banner.d.ts +2 -0
- package/dist/es/components/Banner/Banner.js +5 -1
- package/dist/es/components/Carousel/Carousel.d.ts +2 -0
- package/dist/es/components/Carousel/Carousel.js +7 -2
- package/dist/es/components/ContentArea/ContentArea.css +0 -10
- package/dist/es/components/ContentArea/ContentArea.d.ts +0 -1
- package/dist/es/components/ContentArea/ContentArea.js +1 -3
- package/dist/es/components/Header/Header.d.ts +1 -1
- package/dist/es/components/Header/Header.js +4 -4
- package/dist/es/components/List/List.d.ts +1 -1
- package/dist/es/components/List/List.js +3 -3
- package/dist/es/components/Notification/Notification.css +20 -7
- package/dist/es/components/Search/Search.css +19 -1
- package/dist/es/components/Search/Search.d.ts +6 -0
- package/dist/es/components/Search/Search.js +12 -3
- package/dist/es/components/Select/Select.css +41 -26
- package/dist/es/components/Select/Select.d.ts +7 -0
- package/dist/es/components/Select/Select.js +14 -5
- package/dist/es/components/Tabs/Tabs.css +12 -1
- package/dist/es/components/Tabs/Tabs.d.ts +3 -3
- package/dist/es/components/Tabs/Tabs.js +8 -6
- package/dist/es/components/TextField/TextField.css +33 -20
- package/dist/es/components/TextField/TextField.d.ts +2 -0
- package/dist/es/components/TextField/TextField.js +14 -9
- package/dist/lib/components/Accordion/Accordion.css +6 -4
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +4 -0
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.d.ts +1 -0
- package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.js +2 -1
- package/dist/lib/components/Banner/Banner.css +3 -0
- package/dist/lib/components/Banner/Banner.d.ts +2 -0
- package/dist/lib/components/Banner/Banner.js +5 -1
- package/dist/lib/components/Carousel/Carousel.d.ts +2 -0
- package/dist/lib/components/Carousel/Carousel.js +7 -2
- package/dist/lib/components/ContentArea/ContentArea.css +0 -10
- package/dist/lib/components/ContentArea/ContentArea.d.ts +0 -1
- package/dist/lib/components/ContentArea/ContentArea.js +1 -3
- package/dist/lib/components/Header/Header.d.ts +1 -1
- package/dist/lib/components/Header/Header.js +4 -4
- package/dist/lib/components/List/List.d.ts +1 -1
- package/dist/lib/components/List/List.js +3 -3
- package/dist/lib/components/Notification/Notification.css +20 -7
- package/dist/lib/components/Search/Search.css +19 -1
- package/dist/lib/components/Search/Search.d.ts +6 -0
- package/dist/lib/components/Search/Search.js +15 -4
- package/dist/lib/components/Select/Select.css +41 -26
- package/dist/lib/components/Select/Select.d.ts +7 -0
- package/dist/lib/components/Select/Select.js +16 -6
- package/dist/lib/components/Tabs/Tabs.css +12 -1
- package/dist/lib/components/Tabs/Tabs.d.ts +3 -3
- package/dist/lib/components/Tabs/Tabs.js +10 -8
- package/dist/lib/components/TextField/TextField.css +33 -20
- package/dist/lib/components/TextField/TextField.d.ts +2 -0
- package/dist/lib/components/TextField/TextField.js +14 -9
- package/package.json +4 -4
|
@@ -50,21 +50,26 @@
|
|
|
50
50
|
background-color: var(--base);
|
|
51
51
|
outline: none;
|
|
52
52
|
cursor: pointer;
|
|
53
|
+
-webkit-transition: border-color 0.3s;
|
|
54
|
+
transition: border-color 0.3s;
|
|
53
55
|
}
|
|
54
56
|
.mfui-select__control:after {
|
|
55
57
|
content: '';
|
|
56
58
|
position: absolute;
|
|
57
|
-
top:
|
|
59
|
+
top: 50%;
|
|
58
60
|
right: 27px;
|
|
61
|
+
z-index: 1;
|
|
59
62
|
display: block;
|
|
60
63
|
border-top: 6px solid;
|
|
61
64
|
border-right: 5px solid transparent;
|
|
62
65
|
border-bottom: none;
|
|
63
66
|
border-left: 5px solid transparent;
|
|
64
67
|
color: var(--brandGreen);
|
|
65
|
-
-webkit-transform: translateY(-50%);
|
|
66
|
-
transform: translateY(-50%);
|
|
67
68
|
cursor: pointer;
|
|
69
|
+
-webkit-transition: -webkit-transform 0.6s;
|
|
70
|
+
transition: -webkit-transform 0.6s;
|
|
71
|
+
transition: transform 0.6s;
|
|
72
|
+
transition: transform 0.6s, -webkit-transform 0.6s;
|
|
68
73
|
}
|
|
69
74
|
.mfui-select__combobox {
|
|
70
75
|
font-size: 15px;
|
|
@@ -91,7 +96,8 @@
|
|
|
91
96
|
-moz-appearance: none;
|
|
92
97
|
appearance: none;
|
|
93
98
|
}
|
|
94
|
-
.mfui-select_no-touch .mfui-select__control:hover
|
|
99
|
+
.mfui-select_no-touch .mfui-select__control:hover,
|
|
100
|
+
.mfui-select_no-touch .mfui-select__control:focus-within {
|
|
95
101
|
border-color: var(--content);
|
|
96
102
|
}
|
|
97
103
|
.mfui-select__title {
|
|
@@ -114,8 +120,9 @@
|
|
|
114
120
|
-webkit-box-align: center;
|
|
115
121
|
-ms-flex-align: center;
|
|
116
122
|
align-items: center;
|
|
123
|
+
overflow: hidden;
|
|
117
124
|
}
|
|
118
|
-
.mfui-select__title-
|
|
125
|
+
.mfui-select__title-inner_hide-value .mfui-select__title-value {
|
|
119
126
|
color: var(--spbSky3);
|
|
120
127
|
}
|
|
121
128
|
.mfui-select__title-inner {
|
|
@@ -129,6 +136,8 @@
|
|
|
129
136
|
-webkit-box-align: center;
|
|
130
137
|
-ms-flex-align: center;
|
|
131
138
|
align-items: center;
|
|
139
|
+
-webkit-box-sizing: border-box;
|
|
140
|
+
box-sizing: border-box;
|
|
132
141
|
height: 100%;
|
|
133
142
|
padding: 0 45px 0 16px;
|
|
134
143
|
overflow: hidden;
|
|
@@ -138,7 +147,7 @@
|
|
|
138
147
|
content: '';
|
|
139
148
|
position: absolute;
|
|
140
149
|
top: 0;
|
|
141
|
-
right:
|
|
150
|
+
right: 40px;
|
|
142
151
|
bottom: 0;
|
|
143
152
|
width: 40px;
|
|
144
153
|
background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(var(--base)));
|
|
@@ -155,7 +164,7 @@
|
|
|
155
164
|
top: 100%;
|
|
156
165
|
right: 0;
|
|
157
166
|
left: 0;
|
|
158
|
-
z-index:
|
|
167
|
+
z-index: 11;
|
|
159
168
|
display: none;
|
|
160
169
|
border-radius: 12px;
|
|
161
170
|
background-color: var(--base);
|
|
@@ -183,7 +192,8 @@
|
|
|
183
192
|
}
|
|
184
193
|
.mfui-select__list-item {
|
|
185
194
|
font-family: inherit;
|
|
186
|
-
padding:
|
|
195
|
+
padding-top: 12px;
|
|
196
|
+
padding-bottom: 12px;
|
|
187
197
|
border-radius: 16px;
|
|
188
198
|
background-color: var(--base);
|
|
189
199
|
cursor: pointer;
|
|
@@ -191,6 +201,14 @@
|
|
|
191
201
|
.mfui-select__list-item_hovered {
|
|
192
202
|
background-color: var(--spbSky0);
|
|
193
203
|
}
|
|
204
|
+
.mfui-select__list-item_paddings_large {
|
|
205
|
+
padding-right: 32px;
|
|
206
|
+
padding-left: 32px;
|
|
207
|
+
}
|
|
208
|
+
.mfui-select__list-item_paddings_small {
|
|
209
|
+
padding-right: 12px;
|
|
210
|
+
padding-left: 12px;
|
|
211
|
+
}
|
|
194
212
|
.mfui-select__item-title {
|
|
195
213
|
position: relative;
|
|
196
214
|
display: -webkit-box;
|
|
@@ -202,18 +220,6 @@
|
|
|
202
220
|
-webkit-box-align: center;
|
|
203
221
|
-ms-flex-align: center;
|
|
204
222
|
align-items: center;
|
|
205
|
-
overflow: hidden;
|
|
206
|
-
white-space: nowrap;
|
|
207
|
-
}
|
|
208
|
-
.mfui-select__item-title:after {
|
|
209
|
-
content: '';
|
|
210
|
-
position: absolute;
|
|
211
|
-
top: 0;
|
|
212
|
-
right: 0;
|
|
213
|
-
bottom: 0;
|
|
214
|
-
width: 40px;
|
|
215
|
-
background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(var(--base)));
|
|
216
|
-
background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--base));
|
|
217
223
|
}
|
|
218
224
|
.mfui-select__item-title_active {
|
|
219
225
|
font-weight: 600;
|
|
@@ -291,19 +297,19 @@
|
|
|
291
297
|
transition: opacity 0.2s;
|
|
292
298
|
}
|
|
293
299
|
.mfui-select_open .mfui-select__label,
|
|
294
|
-
.mfui-select__title-inner:not(.mfui-select__title-
|
|
300
|
+
.mfui-select__title-inner:not(.mfui-select__title-inner_hide-value) .mfui-select__label {
|
|
295
301
|
-webkit-transform: scale(0.8) translate(-12%, -75%);
|
|
296
302
|
transform: scale(0.8) translate(-12%, -75%);
|
|
297
303
|
-webkit-transition-duration: 0.2s, 0.01s;
|
|
298
304
|
transition-duration: 0.2s, 0.01s;
|
|
299
305
|
}
|
|
300
|
-
.mfui-select__combobox:not(.mfui-
|
|
306
|
+
.mfui-select__combobox:not(.mfui-select__combobox_hide-value) + .mfui-select__label {
|
|
301
307
|
-webkit-transform: scale(0.8) translate(-12.5%, -75%);
|
|
302
308
|
transform: scale(0.8) translate(-12.5%, -75%);
|
|
303
309
|
-webkit-transition-duration: 0.2s, 0.01s;
|
|
304
310
|
transition-duration: 0.2s, 0.01s;
|
|
305
311
|
}
|
|
306
|
-
.mfui-select__control_labeled .mfui-select__title-
|
|
312
|
+
.mfui-select__control_labeled .mfui-select__title-inner_hide-value .mfui-select__title-value {
|
|
307
313
|
color: var(--spbSky3);
|
|
308
314
|
-webkit-transition: opacity 0.2s;
|
|
309
315
|
transition: opacity 0.2s;
|
|
@@ -322,12 +328,21 @@
|
|
|
322
328
|
.mfui-select__control_labeled .mfui-select__combobox:focus:-ms-input-placeholder {
|
|
323
329
|
opacity: 1;
|
|
324
330
|
}
|
|
331
|
+
.mfui-select__control_labeled .mfui-select__combobox:focus::-moz-placeholder {
|
|
332
|
+
opacity: 1;
|
|
333
|
+
}
|
|
334
|
+
.mfui-select__control_labeled .mfui-select__combobox:focus::-ms-input-placeholder {
|
|
335
|
+
opacity: 1;
|
|
336
|
+
}
|
|
337
|
+
.mfui-select__control_labeled .mfui-select__combobox:focus::placeholder {
|
|
338
|
+
opacity: 1;
|
|
339
|
+
}
|
|
325
340
|
.mfui-select_open {
|
|
326
341
|
z-index: 100;
|
|
327
342
|
}
|
|
328
343
|
.mfui-select_open .mfui-select__control:after {
|
|
329
|
-
|
|
330
|
-
|
|
344
|
+
-webkit-transform: rotate(-180deg);
|
|
345
|
+
transform: rotate(-180deg);
|
|
331
346
|
}
|
|
332
347
|
.mfui-select_open .mfui-select__list {
|
|
333
348
|
display: block;
|
|
@@ -341,7 +356,7 @@
|
|
|
341
356
|
.mfui-select_open .mfui-select__control {
|
|
342
357
|
border-color: var(--content);
|
|
343
358
|
}
|
|
344
|
-
.mfui-select_open .mfui-select__title-
|
|
359
|
+
.mfui-select_open .mfui-select__title-inner_hide-value .mfui-select__title-value {
|
|
345
360
|
opacity: 1;
|
|
346
361
|
}
|
|
347
362
|
.mfui-select_valid .mfui-select__control {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
3
|
import './Select.less';
|
|
4
|
+
export declare const SelectItemsPaddings: {
|
|
5
|
+
readonly SMALL: "small";
|
|
6
|
+
readonly LARGE: "large";
|
|
7
|
+
};
|
|
4
8
|
export declare const Verification: {
|
|
5
9
|
readonly VALID: "valid";
|
|
6
10
|
readonly ERROR: "error";
|
|
@@ -26,6 +30,8 @@ export interface ISelectItem<T extends SelectItemValueType> {
|
|
|
26
30
|
view?: ElementOrString | ((data: ViewCallbackArguments) => ElementOrString);
|
|
27
31
|
/** Настраиваемое отображение выбранного элемента в поле селекта */
|
|
28
32
|
selectedView?: JSX.Element | Element | React.ReactElement;
|
|
33
|
+
/** Размер горизонтальных отступов элемента */
|
|
34
|
+
paddings?: typeof SelectItemsPaddings[keyof typeof SelectItemsPaddings];
|
|
29
35
|
}
|
|
30
36
|
export interface ISelectProps<T extends SelectItemValueType> {
|
|
31
37
|
/** Тип компонента */
|
|
@@ -134,6 +140,7 @@ declare const Select: {
|
|
|
134
140
|
selectedView: PropTypes.Requireable<string | PropTypes.ReactElementLike | ((...args: any[]) => any)>;
|
|
135
141
|
title: PropTypes.Validator<string>;
|
|
136
142
|
value: PropTypes.Validator<string | number>;
|
|
143
|
+
paddings: PropTypes.Requireable<"small" | "large">;
|
|
137
144
|
}>> | null | undefined)[]>;
|
|
138
145
|
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
139
146
|
onOpened: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -26,6 +26,10 @@ var UPDATE_ITEMS_LIST = SelectActions.UPDATE_ITEMS_LIST,
|
|
|
26
26
|
TOGGLE_DROPDOWN = SelectActions.TOGGLE_DROPDOWN,
|
|
27
27
|
UPDATE_SELECT_VALUE = SelectActions.UPDATE_SELECT_VALUE,
|
|
28
28
|
SET_HOVERED_ITEM_INDEX = SelectActions.SET_HOVERED_ITEM_INDEX;
|
|
29
|
+
export var SelectItemsPaddings = {
|
|
30
|
+
SMALL: 'small',
|
|
31
|
+
LARGE: 'large'
|
|
32
|
+
};
|
|
29
33
|
export var Verification = {
|
|
30
34
|
VALID: 'valid',
|
|
31
35
|
ERROR: 'error'
|
|
@@ -44,6 +48,7 @@ export var SelectTypes = {
|
|
|
44
48
|
// - Opened dropdown could be closed only via value choose, click outside of select and on TAB press.
|
|
45
49
|
// - Should add event listener for outside of dropdown click on list open and remove it on list close.
|
|
46
50
|
// - onClose callback shouldn't fire multiple times on outside click if dropdown was opened multiple times.
|
|
51
|
+
// - If item with currentValue is not found in items, input value will not be displayed
|
|
47
52
|
|
|
48
53
|
var cn = cnCreate('mfui-select');
|
|
49
54
|
|
|
@@ -350,7 +355,7 @@ var Select = function Select(_ref) {
|
|
|
350
355
|
onClick: handleSelectClick
|
|
351
356
|
}), /*#__PURE__*/React.createElement("div", {
|
|
352
357
|
className: cn('title-inner', {
|
|
353
|
-
|
|
358
|
+
'hide-value': !item
|
|
354
359
|
}, [classes === null || classes === void 0 ? void 0 : classes.titleInner])
|
|
355
360
|
}, /*#__PURE__*/React.createElement("div", {
|
|
356
361
|
className: cn('title-value')
|
|
@@ -360,7 +365,7 @@ var Select = function Select(_ref) {
|
|
|
360
365
|
var renderCombobox = function renderCombobox() {
|
|
361
366
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.input), {
|
|
362
367
|
className: cn('combobox', {
|
|
363
|
-
|
|
368
|
+
'hide-value': !inputValue
|
|
364
369
|
}),
|
|
365
370
|
onFocus: handleComboboxFocus,
|
|
366
371
|
onChange: handleChangeCombobox,
|
|
@@ -380,11 +385,14 @@ var Select = function Select(_ref) {
|
|
|
380
385
|
}, currentItems.map(function (_ref3, i) {
|
|
381
386
|
var title = _ref3.title,
|
|
382
387
|
value = _ref3.value,
|
|
383
|
-
view = _ref3.view
|
|
388
|
+
view = _ref3.view,
|
|
389
|
+
_ref3$paddings = _ref3.paddings,
|
|
390
|
+
paddings = _ref3$paddings === void 0 ? SelectItemsPaddings.LARGE : _ref3$paddings;
|
|
384
391
|
var isItemActive = currentValue === value;
|
|
385
392
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.listItem, i + 1), {
|
|
386
393
|
className: cn('list-item', {
|
|
387
|
-
hovered: hoveredItemIndex === i
|
|
394
|
+
hovered: hoveredItemIndex === i,
|
|
395
|
+
paddings: paddings
|
|
388
396
|
}, [classes.listItem]),
|
|
389
397
|
key: "".concat(i, "_").concat(value),
|
|
390
398
|
onClick: handleSelectItem,
|
|
@@ -459,7 +467,8 @@ Select.propTypes = {
|
|
|
459
467
|
view: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
|
|
460
468
|
selectedView: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
|
|
461
469
|
title: PropTypes.string.isRequired,
|
|
462
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
|
470
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
471
|
+
paddings: PropTypes.oneOf(Object.values(SelectItemsPaddings))
|
|
463
472
|
})).isRequired,
|
|
464
473
|
onSelect: PropTypes.func,
|
|
465
474
|
onOpened: PropTypes.func,
|
|
@@ -6,10 +6,19 @@
|
|
|
6
6
|
display: flex;
|
|
7
7
|
width: 100%;
|
|
8
8
|
}
|
|
9
|
+
.mfui-tabs__wrapper {
|
|
10
|
+
display: -webkit-box;
|
|
11
|
+
display: -ms-flexbox;
|
|
12
|
+
display: flex;
|
|
13
|
+
-webkit-box-pack: center;
|
|
14
|
+
-ms-flex-pack: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
9
17
|
.mfui-tabs__swiper-wrapper {
|
|
10
18
|
display: -webkit-box;
|
|
11
19
|
display: -ms-flexbox;
|
|
12
20
|
display: flex;
|
|
21
|
+
width: 100%;
|
|
13
22
|
}
|
|
14
23
|
.mfui-tabs__swiper {
|
|
15
24
|
font-family: inherit;
|
|
@@ -83,7 +92,7 @@
|
|
|
83
92
|
width: 16px;
|
|
84
93
|
height: 16px;
|
|
85
94
|
border-radius: 50%;
|
|
86
|
-
background-color: var(--
|
|
95
|
+
background-color: var(--content);
|
|
87
96
|
-webkit-transform: translateY(-50%);
|
|
88
97
|
transform: translateY(-50%);
|
|
89
98
|
cursor: pointer;
|
|
@@ -131,6 +140,8 @@
|
|
|
131
140
|
-webkit-box-pack: center;
|
|
132
141
|
-ms-flex-pack: center;
|
|
133
142
|
justify-content: center;
|
|
143
|
+
-webkit-box-sizing: border-box;
|
|
144
|
+
box-sizing: border-box;
|
|
134
145
|
height: 36px;
|
|
135
146
|
padding: 2px 12px;
|
|
136
147
|
color: var(--spbSky3);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import './Tabs.less';
|
|
3
3
|
import { ITabProps } from './Tab';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const TabAlign: {
|
|
5
5
|
readonly LEFT: "left";
|
|
6
6
|
readonly CENTER: "center";
|
|
7
7
|
};
|
|
@@ -15,7 +15,7 @@ export declare const TabColorTheme: {
|
|
|
15
15
|
};
|
|
16
16
|
declare type TabSizeType = typeof TabSize[keyof typeof TabSize];
|
|
17
17
|
declare type TabColorThemeType = typeof TabColorTheme[keyof typeof TabColorTheme];
|
|
18
|
-
declare type
|
|
18
|
+
declare type TabAlignType = typeof TabAlign[keyof typeof TabAlign];
|
|
19
19
|
export interface ITabsProps {
|
|
20
20
|
/** Дополнительный класс для корневого элемента */
|
|
21
21
|
className?: string;
|
|
@@ -41,7 +41,7 @@ export interface ITabsProps {
|
|
|
41
41
|
/** Ширина табов по размеру содержимого */
|
|
42
42
|
autoWidth?: boolean;
|
|
43
43
|
/** Горизонтальное выравнивание (только для autoWidth = true) */
|
|
44
|
-
|
|
44
|
+
align?: TabAlignType;
|
|
45
45
|
/** Фиксация табов у верхней границы окна */
|
|
46
46
|
sticky?: boolean;
|
|
47
47
|
/** Индекс активного таба (включает режим управления табами снаружи) */
|
|
@@ -22,7 +22,7 @@ var ArrowLeft = function ArrowLeft(props) {
|
|
|
22
22
|
}));
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
export var
|
|
25
|
+
export var TabAlign = {
|
|
26
26
|
LEFT: 'left',
|
|
27
27
|
CENTER: 'center'
|
|
28
28
|
};
|
|
@@ -50,8 +50,8 @@ var Tabs = function Tabs(_ref) {
|
|
|
50
50
|
tabColorTheme = _ref$tabColorTheme === void 0 ? 'white' : _ref$tabColorTheme,
|
|
51
51
|
_ref$sticky = _ref.sticky,
|
|
52
52
|
sticky = _ref$sticky === void 0 ? false : _ref$sticky,
|
|
53
|
-
_ref$
|
|
54
|
-
|
|
53
|
+
_ref$align = _ref.align,
|
|
54
|
+
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
55
55
|
_ref$defaultIndex = _ref.defaultIndex,
|
|
56
56
|
defaultIndex = _ref$defaultIndex === void 0 ? 0 : _ref$defaultIndex,
|
|
57
57
|
outerIndex = _ref.currentIndex,
|
|
@@ -78,7 +78,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
78
78
|
isBeginning = _React$useState4[0],
|
|
79
79
|
setBeginning = _React$useState4[1];
|
|
80
80
|
|
|
81
|
-
var _React$useState5 = React.useState(
|
|
81
|
+
var _React$useState5 = React.useState(true),
|
|
82
82
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
83
83
|
isEnd = _React$useState6[0],
|
|
84
84
|
setEnd = _React$useState6[1];
|
|
@@ -363,13 +363,14 @@ var Tabs = function Tabs(_ref) {
|
|
|
363
363
|
className: cn({
|
|
364
364
|
size: size,
|
|
365
365
|
'tab-color': tabColorTheme,
|
|
366
|
-
'h-align':
|
|
366
|
+
'h-align': align,
|
|
367
367
|
indents: !innerIndentsClass,
|
|
368
368
|
sticky: isSticky,
|
|
369
369
|
'auto-width': autoWidth
|
|
370
370
|
}, [className, rootClass]),
|
|
371
371
|
ref: rootRef
|
|
372
372
|
}), /*#__PURE__*/React.createElement("div", {
|
|
373
|
+
className: cn('wrapper'),
|
|
373
374
|
ref: tabListRef,
|
|
374
375
|
style: {
|
|
375
376
|
height: tabListHeight
|
|
@@ -386,6 +387,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
386
387
|
beginning: isBeginning,
|
|
387
388
|
end: isEnd
|
|
388
389
|
}, [innerIndentsClass]),
|
|
390
|
+
watchOverflow: true,
|
|
389
391
|
slidesPerView: "auto",
|
|
390
392
|
initialSlide: currentIndex,
|
|
391
393
|
onSwiper: handleSwiper,
|
|
@@ -431,7 +433,7 @@ Tabs.propTypes = {
|
|
|
431
433
|
next: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
432
434
|
}),
|
|
433
435
|
size: PropTypes.oneOf(Object.values(TabSize)),
|
|
434
|
-
|
|
436
|
+
align: PropTypes.oneOf(Object.values(TabAlign)),
|
|
435
437
|
autoWidth: PropTypes.bool,
|
|
436
438
|
tabColorTheme: PropTypes.oneOf(Object.values(TabColorTheme)),
|
|
437
439
|
sticky: PropTypes.bool,
|
|
@@ -113,6 +113,21 @@
|
|
|
113
113
|
.mfui-text-field__field:focus::-webkit-input-placeholder {
|
|
114
114
|
opacity: 1;
|
|
115
115
|
}
|
|
116
|
+
.mfui-text-field__field:focus:-moz-placeholder {
|
|
117
|
+
opacity: 1;
|
|
118
|
+
}
|
|
119
|
+
.mfui-text-field__field:focus:-ms-input-placeholder {
|
|
120
|
+
opacity: 1;
|
|
121
|
+
}
|
|
122
|
+
.mfui-text-field__field:focus::-moz-placeholder {
|
|
123
|
+
opacity: 1;
|
|
124
|
+
}
|
|
125
|
+
.mfui-text-field__field:focus::-ms-input-placeholder {
|
|
126
|
+
opacity: 1;
|
|
127
|
+
}
|
|
128
|
+
.mfui-text-field__field:focus::placeholder {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
}
|
|
116
131
|
.mfui-text-field__field::-webkit-scrollbar {
|
|
117
132
|
width: 16px;
|
|
118
133
|
}
|
|
@@ -125,12 +140,6 @@
|
|
|
125
140
|
.mfui-text-field__field::-webkit-scrollbar-thumb:hover {
|
|
126
141
|
background-color: #999999;
|
|
127
142
|
}
|
|
128
|
-
.mfui-text-field__field:focus:-moz-placeholder {
|
|
129
|
-
opacity: 1;
|
|
130
|
-
}
|
|
131
|
-
.mfui-text-field__field:focus:-ms-input-placeholder {
|
|
132
|
-
opacity: 1;
|
|
133
|
-
}
|
|
134
143
|
.mfui-text-field__label {
|
|
135
144
|
position: absolute;
|
|
136
145
|
top: 18px;
|
|
@@ -152,7 +161,8 @@
|
|
|
152
161
|
top: 16px;
|
|
153
162
|
}
|
|
154
163
|
.mfui-text-field__field:focus ~ .mfui-text-field__label,
|
|
155
|
-
.mfui-text-field__field:not(:placeholder-shown) ~ .mfui-text-field__label
|
|
164
|
+
.mfui-text-field__field:not(:placeholder-shown) ~ .mfui-text-field__label,
|
|
165
|
+
.mfui-text-field__field:-webkit-autofill ~ .mfui-text-field__label {
|
|
156
166
|
-webkit-transform: scale(0.8) translate(-11%, -75%);
|
|
157
167
|
transform: scale(0.8) translate(-11%, -75%);
|
|
158
168
|
-webkit-transition-duration: 0.2s, 0.01s;
|
|
@@ -170,6 +180,19 @@
|
|
|
170
180
|
display: flex;
|
|
171
181
|
overflow: hidden;
|
|
172
182
|
}
|
|
183
|
+
.mfui-text-field__field-bottom-wrapper {
|
|
184
|
+
display: -webkit-box;
|
|
185
|
+
display: -ms-flexbox;
|
|
186
|
+
display: flex;
|
|
187
|
+
margin-top: 0;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
color: var(--spbSky3);
|
|
190
|
+
font-size: 12px;
|
|
191
|
+
line-height: 18px;
|
|
192
|
+
}
|
|
193
|
+
.mfui-text-field__field-bottom-wrapper_filled {
|
|
194
|
+
margin-top: 8px;
|
|
195
|
+
}
|
|
173
196
|
.mfui-text-field__notice-text {
|
|
174
197
|
height: 0;
|
|
175
198
|
opacity: 0;
|
|
@@ -179,7 +202,7 @@
|
|
|
179
202
|
transition-duration: 0.3s;
|
|
180
203
|
}
|
|
181
204
|
.mfui-text-field__notice-text_active {
|
|
182
|
-
height:
|
|
205
|
+
height: 100%;
|
|
183
206
|
opacity: 1;
|
|
184
207
|
}
|
|
185
208
|
.mfui-text-field__icon-box {
|
|
@@ -230,16 +253,6 @@
|
|
|
230
253
|
.mfui-text-field__require-mark {
|
|
231
254
|
color: var(--fury);
|
|
232
255
|
}
|
|
233
|
-
.mfui-text-field__wrap {
|
|
234
|
-
display: -webkit-box;
|
|
235
|
-
display: -ms-flexbox;
|
|
236
|
-
display: flex;
|
|
237
|
-
margin-top: 8px;
|
|
238
|
-
overflow: hidden;
|
|
239
|
-
color: var(--spbSky3);
|
|
240
|
-
font-size: 12px;
|
|
241
|
-
line-height: 18px;
|
|
242
|
-
}
|
|
243
256
|
.mfui-text-field__counter {
|
|
244
257
|
margin-left: auto;
|
|
245
258
|
}
|
|
@@ -268,13 +281,13 @@
|
|
|
268
281
|
cursor: default !important;
|
|
269
282
|
}
|
|
270
283
|
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__counter_error,
|
|
271
|
-
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-
|
|
284
|
+
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__field-bottom-wrapper {
|
|
272
285
|
color: var(--fury);
|
|
273
286
|
}
|
|
274
287
|
.mfui-text-field_theme_white .mfui-text-field__icon {
|
|
275
288
|
fill: var(--stcWhite);
|
|
276
289
|
}
|
|
277
|
-
.mfui-text-field_theme_white .mfui-text-
|
|
290
|
+
.mfui-text-field_theme_white .mfui-text-field__field-bottom-wrapper,
|
|
278
291
|
.mfui-text-field_theme_white .mfui-text-field__counter {
|
|
279
292
|
color: var(--stcWhite);
|
|
280
293
|
}
|
|
@@ -39,6 +39,8 @@ export declare type TextFieldProps = {
|
|
|
39
39
|
inputRef?: (node: HTMLInputElement | HTMLTextAreaElement) => void;
|
|
40
40
|
/** Имя поля */
|
|
41
41
|
name?: string;
|
|
42
|
+
/** Запрещает отображение плейсхолдера */
|
|
43
|
+
hidePlaceholder?: boolean;
|
|
42
44
|
/** Отображаемый текст при отсутствии значения */
|
|
43
45
|
placeholder?: string;
|
|
44
46
|
/** Атрибут корневого DOM элемента компонента */
|
|
@@ -95,6 +95,8 @@ var TextField = function TextField(_ref) {
|
|
|
95
95
|
_ref$textarea = _ref.textarea,
|
|
96
96
|
textarea = _ref$textarea === void 0 ? false : _ref$textarea,
|
|
97
97
|
name = _ref.name,
|
|
98
|
+
_ref$hidePlaceholder = _ref.hidePlaceholder,
|
|
99
|
+
hidePlaceholder = _ref$hidePlaceholder === void 0 ? false : _ref$hidePlaceholder,
|
|
98
100
|
placeholder = _ref.placeholder,
|
|
99
101
|
required = _ref.required,
|
|
100
102
|
_ref$isControlled = _ref.isControlled,
|
|
@@ -144,8 +146,8 @@ var TextField = function TextField(_ref) {
|
|
|
144
146
|
|
|
145
147
|
var _useState9 = useState(noticeText),
|
|
146
148
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
currentNoticeText = _useState10[0],
|
|
150
|
+
setCurrentNoticeText = _useState10[1];
|
|
149
151
|
|
|
150
152
|
var _useState11 = useState(false),
|
|
151
153
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
@@ -167,8 +169,8 @@ var TextField = function TextField(_ref) {
|
|
|
167
169
|
return isPasswordType && !isPasswordHidden;
|
|
168
170
|
}, [isPasswordHidden, isPasswordType]);
|
|
169
171
|
var hasValue = isControlled ? !!value : !!inputValue;
|
|
170
|
-
var isValidVerification = verification === Verification.VALID;
|
|
171
|
-
var isErrorVerification = verification === Verification.ERROR;
|
|
172
|
+
var isValidVerification = verification === Verification.VALID && !disabled;
|
|
173
|
+
var isErrorVerification = verification === Verification.ERROR && !disabled;
|
|
172
174
|
var hasValueForClear = hasValue && !isPasswordType && !customIcon && !isValidVerification;
|
|
173
175
|
var hasClearIcon = !disabled && (hasValueForClear || isErrorVerification);
|
|
174
176
|
var actualPlaceholder = placeholder || DEFAULT_PLACEHOLDERS[type];
|
|
@@ -186,7 +188,7 @@ var TextField = function TextField(_ref) {
|
|
|
186
188
|
checkSymbolMaxLimit(value);
|
|
187
189
|
}, [value, checkSymbolMaxLimit, isControlled]);
|
|
188
190
|
useEffect(function () {
|
|
189
|
-
noticeText &&
|
|
191
|
+
noticeText && setCurrentNoticeText(noticeText);
|
|
190
192
|
}, [noticeText]);
|
|
191
193
|
useEffect(function () {
|
|
192
194
|
if (!resizerRef.current || textarea !== TextareaTypes.FLEXIBLE) {
|
|
@@ -255,7 +257,7 @@ var TextField = function TextField(_ref) {
|
|
|
255
257
|
};
|
|
256
258
|
|
|
257
259
|
var handleNoticeTransitionEnd = useCallback(function () {
|
|
258
|
-
!noticeText &&
|
|
260
|
+
!noticeText && setCurrentNoticeText(noticeText);
|
|
259
261
|
}, [noticeText]);
|
|
260
262
|
|
|
261
263
|
var handleTextareaScroll = function handleTextareaScroll() {
|
|
@@ -305,7 +307,7 @@ var TextField = function TextField(_ref) {
|
|
|
305
307
|
onFocus: handleFocus,
|
|
306
308
|
onKeyUp: onKeyUp,
|
|
307
309
|
maxLength: maxLength,
|
|
308
|
-
placeholder: actualPlaceholder,
|
|
310
|
+
placeholder: hidePlaceholder ? ' ' : actualPlaceholder,
|
|
309
311
|
required: required,
|
|
310
312
|
inputMode: inputMode
|
|
311
313
|
});
|
|
@@ -445,13 +447,15 @@ var TextField = function TextField(_ref) {
|
|
|
445
447
|
className: cn('resizer'),
|
|
446
448
|
ref: resizerRef
|
|
447
449
|
}, /*#__PURE__*/React.createElement(ResizeIcon, null))), /*#__PURE__*/React.createElement("div", {
|
|
448
|
-
className: cn('
|
|
450
|
+
className: cn('field-bottom-wrapper', {
|
|
451
|
+
filled: !!currentNoticeText || !!symbolCounter
|
|
452
|
+
})
|
|
449
453
|
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
450
454
|
className: cn('notice-text', {
|
|
451
455
|
active: !!noticeText
|
|
452
456
|
}),
|
|
453
457
|
onTransitionEnd: handleNoticeTransitionEnd
|
|
454
|
-
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.notice)),
|
|
458
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.notice)), currentNoticeText), symbolCounter && /*#__PURE__*/React.createElement("span", {
|
|
455
459
|
className: cn('counter', {
|
|
456
460
|
error: isMaxLimitExceeded
|
|
457
461
|
})
|
|
@@ -470,6 +474,7 @@ TextField.propTypes = {
|
|
|
470
474
|
inputMode: PropTypes.oneOf(['numeric', 'tel', 'decimal', 'email', 'url', 'search', 'none']),
|
|
471
475
|
autoComplete: PropTypes.string,
|
|
472
476
|
name: PropTypes.string,
|
|
477
|
+
hidePlaceholder: PropTypes.bool,
|
|
473
478
|
placeholder: PropTypes.string,
|
|
474
479
|
id: PropTypes.string,
|
|
475
480
|
isControlled: PropTypes.bool,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
}
|
|
13
13
|
.mfui-accordion__title-wrap {
|
|
14
14
|
position: relative;
|
|
15
|
-
padding:
|
|
15
|
+
padding: 24px 44px 24px 16px;
|
|
16
16
|
border-radius: 12px;
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
-webkit-transition: background-color 0.3s;
|
|
@@ -20,14 +20,16 @@
|
|
|
20
20
|
}
|
|
21
21
|
@media screen and (min-width: 768px) {
|
|
22
22
|
.mfui-accordion__title-wrap {
|
|
23
|
-
padding:
|
|
23
|
+
padding: 24px 56px 24px 24px;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
.mfui-accordion__title-wrap:hover {
|
|
27
27
|
background-color: var(--spbSky1);
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
@media screen and (max-width: 1023px) {
|
|
30
|
+
.mfui-accordion__title-wrap:focus {
|
|
31
|
+
background-color: inherit;
|
|
32
|
+
}
|
|
31
33
|
}
|
|
32
34
|
.mfui-accordion__icon-box {
|
|
33
35
|
position: absolute;
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
.mfui-promo-badge_type_user-choice {
|
|
28
28
|
background-color: var(--reflexBlue);
|
|
29
29
|
}
|
|
30
|
+
.mfui-promo-badge_type_interests {
|
|
31
|
+
background-color: var(--brandPurple20);
|
|
32
|
+
color: var(--brandPurple);
|
|
33
|
+
}
|
|
30
34
|
.mfui-promo-badge__text {
|
|
31
35
|
font-family: inherit;
|
|
32
36
|
font-size: 12px;
|
|
@@ -6,6 +6,7 @@ export declare const PromoBadgeTypes: {
|
|
|
6
6
|
readonly VIP: "vip";
|
|
7
7
|
readonly POPULAR: "popular";
|
|
8
8
|
readonly USER_CHOICE: "user-choice";
|
|
9
|
+
readonly INTERESTS: "interests";
|
|
9
10
|
};
|
|
10
11
|
declare type PromoBadgeTypesType = typeof PromoBadgeTypes[keyof typeof PromoBadgeTypes];
|
|
11
12
|
export interface IPromoBadgeProps {
|
|
@@ -28,7 +28,8 @@ var PromoBadgeTypes = {
|
|
|
28
28
|
NEW: 'new',
|
|
29
29
|
VIP: 'vip',
|
|
30
30
|
POPULAR: 'popular',
|
|
31
|
-
USER_CHOICE: 'user-choice'
|
|
31
|
+
USER_CHOICE: 'user-choice',
|
|
32
|
+
INTERESTS: 'interests'
|
|
32
33
|
};
|
|
33
34
|
exports.PromoBadgeTypes = PromoBadgeTypes;
|
|
34
35
|
var cn = (0, _uiHelpers.cnCreate)('mfui-promo-badge');
|
|
@@ -36,6 +36,8 @@ export interface IBannerProps {
|
|
|
36
36
|
pauseOnHover?: boolean;
|
|
37
37
|
/** Цветовая тема навигации */
|
|
38
38
|
navTheme?: NavThemeType;
|
|
39
|
+
/** Автоматическая высота слайдов */
|
|
40
|
+
autoHeight?: boolean;
|
|
39
41
|
/** Обработчик клика по стрелке "вперед" (должен быть обернут в useCallback) */
|
|
40
42
|
onNextClick?: (index: number) => void;
|
|
41
43
|
/** Обработчик клика по стрелке "назад" (должен быть обернут в useCallback) */
|