@megafon/ui-core 3.12.0 → 4.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/dist/es/colors/Colors.css +4 -0
  3. package/dist/es/components/Accordion/Accordion.css +59 -22
  4. package/dist/es/components/Accordion/Accordion.js +12 -17
  5. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +1 -1
  6. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +1 -1
  7. package/dist/es/components/Badges/components/TimerBadge/TimerBadge.css +1 -1
  8. package/dist/es/components/Button/Button.css +5 -5
  9. package/dist/es/components/Calendar/components/Day/Day.css +1 -1
  10. package/dist/es/components/Calendar/components/Month/Month.css +1 -1
  11. package/dist/es/components/Caption/Caption.css +48 -0
  12. package/dist/es/components/Caption/Caption.d.ts +31 -0
  13. package/dist/es/components/Caption/Caption.js +51 -0
  14. package/dist/es/components/Header/Header.css +3 -0
  15. package/dist/es/components/Header/Header.d.ts +2 -0
  16. package/dist/es/components/Header/Header.js +7 -1
  17. package/dist/es/components/Notification/Notification.css +9 -5
  18. package/dist/es/components/Notification/Notification.js +2 -7
  19. package/dist/es/components/Paragraph/Paragraph.css +8 -5
  20. package/dist/es/components/Paragraph/Paragraph.d.ts +4 -3
  21. package/dist/es/components/Paragraph/Paragraph.js +6 -5
  22. package/dist/es/components/RadioButton/RadioButton.css +1 -1
  23. package/dist/es/components/Search/Search.css +129 -9
  24. package/dist/es/components/Search/Search.d.ts +2 -0
  25. package/dist/es/components/Search/Search.js +20 -7
  26. package/dist/es/components/Select/Select.css +165 -30
  27. package/dist/es/components/Select/Select.js +25 -18
  28. package/dist/es/components/Switcher/Switcher.css +1 -1
  29. package/dist/es/components/Tabs/Tabs.css +140 -143
  30. package/dist/es/components/Tabs/Tabs.d.ts +9 -8
  31. package/dist/es/components/Tabs/Tabs.js +14 -18
  32. package/dist/es/components/TextField/TextField.css +221 -92
  33. package/dist/es/components/TextField/TextField.js +161 -71
  34. package/dist/es/constants/throttleTime.d.ts +1 -0
  35. package/dist/es/constants/throttleTime.js +2 -1
  36. package/dist/es/index.d.ts +1 -1
  37. package/dist/es/index.js +1 -1
  38. package/dist/lib/colors/Colors.css +4 -0
  39. package/dist/lib/components/Accordion/Accordion.css +59 -22
  40. package/dist/lib/components/Accordion/Accordion.js +12 -17
  41. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +1 -1
  42. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +1 -1
  43. package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.css +1 -1
  44. package/dist/lib/components/Button/Button.css +5 -5
  45. package/dist/lib/components/Calendar/components/Day/Day.css +1 -1
  46. package/dist/lib/components/Calendar/components/Month/Month.css +1 -1
  47. package/dist/lib/components/Caption/Caption.css +48 -0
  48. package/dist/lib/components/Caption/Caption.d.ts +31 -0
  49. package/dist/lib/components/{InputLabel/InputLabel.js → Caption/Caption.js} +38 -10
  50. package/dist/lib/components/Header/Header.css +3 -0
  51. package/dist/lib/components/Header/Header.d.ts +2 -0
  52. package/dist/lib/components/Header/Header.js +7 -1
  53. package/dist/lib/components/Notification/Notification.css +9 -5
  54. package/dist/lib/components/Notification/Notification.js +2 -8
  55. package/dist/lib/components/Paragraph/Paragraph.css +8 -5
  56. package/dist/lib/components/Paragraph/Paragraph.d.ts +4 -3
  57. package/dist/lib/components/Paragraph/Paragraph.js +6 -5
  58. package/dist/lib/components/RadioButton/RadioButton.css +1 -1
  59. package/dist/lib/components/Search/Search.css +129 -9
  60. package/dist/lib/components/Search/Search.d.ts +2 -0
  61. package/dist/lib/components/Search/Search.js +20 -8
  62. package/dist/lib/components/Select/Select.css +165 -30
  63. package/dist/lib/components/Select/Select.js +25 -19
  64. package/dist/lib/components/Switcher/Switcher.css +1 -1
  65. package/dist/lib/components/Tabs/Tabs.css +140 -143
  66. package/dist/lib/components/Tabs/Tabs.d.ts +9 -8
  67. package/dist/lib/components/Tabs/Tabs.js +16 -20
  68. package/dist/lib/components/TextField/TextField.css +221 -92
  69. package/dist/lib/components/TextField/TextField.js +164 -71
  70. package/dist/lib/constants/throttleTime.d.ts +1 -0
  71. package/dist/lib/constants/throttleTime.js +2 -1
  72. package/dist/lib/index.d.ts +1 -1
  73. package/dist/lib/index.js +8 -8
  74. package/package.json +3 -3
  75. package/styles/base.less +4 -1
  76. package/dist/es/components/InputLabel/InputLabel.css +0 -5
  77. package/dist/es/components/InputLabel/InputLabel.d.ts +0 -10
  78. package/dist/es/components/InputLabel/InputLabel.js +0 -24
  79. package/dist/lib/components/InputLabel/InputLabel.css +0 -5
  80. package/dist/lib/components/InputLabel/InputLabel.d.ts +0 -10
@@ -1,61 +1,186 @@
1
1
  .mfui-text-field {
2
+ color: var(--content);
2
3
  font-family: inherit;
3
4
  font-size: 15px;
4
5
  line-height: 24px;
5
- color: var(--content);
6
+ }
7
+ .mfui-text-field:not(.mfui-text-field_disabled):not(.mfui-text-field_error):not(.mfui-text-field_valid) .mfui-text-field__field:hover,
8
+ .mfui-text-field:not(.mfui-text-field_disabled):not(.mfui-text-field_error):not(.mfui-text-field_valid) .mfui-text-field__field_resized,
9
+ .mfui-text-field:not(.mfui-text-field_disabled):not(.mfui-text-field_error):not(.mfui-text-field_valid) .mfui-text-field__field:focus {
10
+ border-color: var(--content);
6
11
  }
7
12
  .mfui-text-field__field {
8
- font-family: inherit;
9
- font-size: 15px;
10
- line-height: 24px;
11
- position: relative;
12
- z-index: 1;
13
13
  display: block;
14
- -webkit-box-sizing: border-box;
15
- box-sizing: border-box;
16
14
  width: 100%;
17
- min-height: 48px;
18
- margin: 0;
19
- padding: 11px 19px;
20
- border-radius: 0;
21
- background-color: transparent;
15
+ padding: 25px 56px 9px 16px;
16
+ border: 1px solid var(--spbSky2);
17
+ border-radius: 12px;
18
+ color: var(--content);
19
+ background-color: var(--base);
22
20
  outline: none;
23
21
  -webkit-box-shadow: none;
24
22
  box-shadow: none;
25
23
  opacity: 1;
24
+ -webkit-transition: border-color 0.3s;
25
+ transition: border-color 0.3s;
26
26
  -webkit-appearance: none;
27
27
  -moz-appearance: none;
28
28
  appearance: none;
29
+ caret-color: var(--brandGreen);
30
+ font-family: inherit;
31
+ font-size: 15px;
32
+ line-height: 24px;
29
33
  }
30
- .mfui-text-field__field_type_fixed {
34
+ .mfui-text-field__field_textarea,
35
+ .mfui-text-field__field_type_flexible {
36
+ -webkit-box-sizing: content-box;
37
+ box-sizing: content-box;
38
+ padding-top: 28px;
39
+ overflow-x: hidden;
40
+ overflow-y: auto;
31
41
  resize: none;
32
42
  }
33
- .mfui-text-field__field_type_flexible {
34
- overflow: hidden;
35
- resize: vertical;
43
+ .mfui-text-field__field_resized {
44
+ -webkit-transition: height 0.1s;
45
+ transition: height 0.1s;
46
+ will-change: height;
36
47
  }
37
- .mfui-text-field__field_scrolling {
38
- overflow: auto;
48
+ .mfui-text-field__resizer {
49
+ position: absolute;
50
+ right: 0;
51
+ bottom: 0;
52
+ display: -webkit-box;
53
+ display: -ms-flexbox;
54
+ display: flex;
55
+ -webkit-box-align: center;
56
+ -ms-flex-align: center;
57
+ align-items: center;
58
+ -webkit-box-pack: center;
59
+ -ms-flex-pack: center;
60
+ justify-content: center;
61
+ -webkit-box-sizing: content-box;
62
+ box-sizing: content-box;
63
+ width: 12px;
64
+ height: 12px;
65
+ padding: 4px;
66
+ cursor: ns-resize;
67
+ }
68
+ .mfui-text-field__resizer svg {
69
+ -webkit-transition: stroke 0.3s;
70
+ transition: stroke 0.3s;
71
+ stroke: var(--spbSky2);
72
+ }
73
+ .mfui-text-field__resizer:hover svg,
74
+ .mfui-text-field__resizer:active svg {
75
+ stroke: var(--spbSky3);
76
+ }
77
+ .mfui-text-field__field::-webkit-input-placeholder {
78
+ color: var(--spbSky3);
79
+ opacity: 0;
80
+ -webkit-transition: opacity 0.2s;
81
+ transition: opacity 0.2s;
39
82
  }
40
- .mfui-text-field input::-webkit-input-placeholder {
83
+ .mfui-text-field__field:-moz-placeholder {
41
84
  color: var(--spbSky3);
85
+ opacity: 0;
86
+ -webkit-transition: opacity 0.2s;
87
+ transition: opacity 0.2s;
42
88
  }
43
- .mfui-text-field input:-moz-placeholder {
89
+ .mfui-text-field__field:-ms-input-placeholder {
44
90
  color: var(--spbSky3);
91
+ opacity: 0;
92
+ -webkit-transition: opacity 0.2s;
93
+ transition: opacity 0.2s;
45
94
  }
46
- .mfui-text-field input:-ms-input-placeholder {
95
+ .mfui-text-field__field::-moz-placeholder {
47
96
  color: var(--spbSky3);
97
+ opacity: 0;
98
+ -webkit-transition: opacity 0.2s;
99
+ transition: opacity 0.2s;
48
100
  }
49
- .mfui-text-field input::-ms-clear,
50
- .mfui-text-field input::-ms-reveal {
51
- display: none;
101
+ .mfui-text-field__field::-ms-input-placeholder {
102
+ color: var(--spbSky3);
103
+ opacity: 0;
104
+ -webkit-transition: opacity 0.2s;
105
+ transition: opacity 0.2s;
106
+ }
107
+ .mfui-text-field__field::placeholder {
108
+ color: var(--spbSky3);
109
+ opacity: 0;
110
+ -webkit-transition: opacity 0.2s;
111
+ transition: opacity 0.2s;
112
+ }
113
+ .mfui-text-field__field:focus::-webkit-input-placeholder {
114
+ opacity: 1;
115
+ }
116
+ .mfui-text-field__field::-webkit-scrollbar {
117
+ width: 16px;
118
+ }
119
+ .mfui-text-field__field::-webkit-scrollbar-thumb {
120
+ border: 6px solid transparent;
121
+ border-radius: 16px;
122
+ background-color: #D8D8D8;
123
+ background-clip: padding-box;
124
+ }
125
+ .mfui-text-field__field::-webkit-scrollbar-thumb:hover {
126
+ background-color: #999999;
127
+ }
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
+ .mfui-text-field__label {
135
+ position: absolute;
136
+ top: 18px;
137
+ left: 16px;
138
+ z-index: 1;
139
+ display: block;
140
+ overflow: auto;
141
+ color: var(--spbSky3);
142
+ -webkit-transition: top 0.5s, -webkit-transform 0.5s;
143
+ transition: top 0.5s, -webkit-transform 0.5s;
144
+ transition: transform 0.5s, top 0.5s;
145
+ transition: transform 0.5s, top 0.5s, -webkit-transform 0.5s;
146
+ pointer-events: none;
147
+ font-family: inherit;
148
+ font-size: 15px;
149
+ line-height: 24px;
150
+ }
151
+ .mfui-text-field__field_textarea ~ .mfui-text-field__label {
152
+ top: 16px;
153
+ }
154
+ .mfui-text-field__field:focus ~ .mfui-text-field__label,
155
+ .mfui-text-field__field:not(:placeholder-shown) ~ .mfui-text-field__label {
156
+ -webkit-transform: scale(0.8) translate(-11%, -75%);
157
+ transform: scale(0.8) translate(-11%, -75%);
158
+ -webkit-transition-duration: 0.2s, 0.01s;
159
+ transition-duration: 0.2s, 0.01s;
160
+ }
161
+ .mfui-text-field__field_textarea:focus ~ .mfui-text-field__label,
162
+ .mfui-text-field__field_textarea:not(:placeholder-shown) ~ .mfui-text-field__label {
163
+ -webkit-transform: scale(0.8) translate(-11%, -50%);
164
+ transform: scale(0.8) translate(-11%, -50%);
52
165
  }
53
166
  .mfui-text-field__field-wrapper {
54
167
  position: relative;
55
- -webkit-box-flex: 1;
56
- -ms-flex: 1 0 100px;
57
- flex: 1 0 100px;
58
- background: var(--base);
168
+ display: -webkit-box;
169
+ display: -ms-flexbox;
170
+ display: flex;
171
+ overflow: hidden;
172
+ }
173
+ .mfui-text-field__notice-text {
174
+ height: 0;
175
+ opacity: 0;
176
+ -webkit-transition: height, opacity;
177
+ transition: height, opacity;
178
+ -webkit-transition-duration: 0.3s;
179
+ transition-duration: 0.3s;
180
+ }
181
+ .mfui-text-field__notice-text_active {
182
+ height: 18px;
183
+ opacity: 1;
59
184
  }
60
185
  .mfui-text-field__icon-box {
61
186
  position: absolute;
@@ -80,10 +205,12 @@
80
205
  }
81
206
  .mfui-text-field__icon-box_error,
82
207
  .mfui-text-field__icon-box_password,
83
- .mfui-text-field__icon-box_custom-handler {
208
+ .mfui-text-field__icon-box_custom-handler,
209
+ .mfui-text-field__icon_clear {
84
210
  cursor: pointer;
85
211
  }
86
- .mfui-text-field__icon {
212
+ .mfui-text-field__icon,
213
+ .mfui-text-field__icon-box svg {
87
214
  display: block;
88
215
  width: 32px;
89
216
  height: 32px;
@@ -92,102 +219,104 @@
92
219
  -ms-user-select: none;
93
220
  user-select: none;
94
221
  }
95
- .mfui-text-field__text {
96
- margin-top: 4px;
97
- font-size: 12px;
98
- line-height: 16px;
222
+ .mfui-text-field__icon_clear {
223
+ -webkit-transition: fill 0.3s;
224
+ transition: fill 0.3s;
225
+ fill: var(--spbSky3);
226
+ }
227
+ .mfui-text-field__icon_clear:hover {
228
+ fill: var(--stcBlack);
99
229
  }
100
230
  .mfui-text-field__require-mark {
101
- margin-left: 1px;
102
231
  color: var(--fury);
103
- font-size: 20px;
104
- line-height: 0;
105
232
  }
106
233
  .mfui-text-field__wrap {
107
234
  display: -webkit-box;
108
235
  display: -ms-flexbox;
109
236
  display: flex;
110
- -webkit-box-pack: justify;
111
- -ms-flex-pack: justify;
112
- justify-content: space-between;
237
+ margin-top: 8px;
238
+ overflow: hidden;
239
+ color: var(--spbSky3);
240
+ font-size: 12px;
241
+ line-height: 18px;
113
242
  }
114
243
  .mfui-text-field__counter {
115
- margin-top: 4px;
116
244
  margin-left: auto;
117
- opacity: 0.5;
118
- }
119
- .mfui-text-field__counter_error {
120
- color: var(--fury);
121
- opacity: 1;
122
- }
123
- .mfui-text-field_theme_default .mfui-text-field__field {
124
- border: 1px solid var(--spbSky2);
125
- color: var(--content);
126
- background-color: transparent;
127
245
  }
128
- .mfui-text-field_theme_default .mfui-text-field__field-wrapper_no-touch:hover .mfui-text-field__field,
129
- .mfui-text-field_theme_default .mfui-text-field__field:focus {
130
- border-color: var(--content);
131
- }
132
- .mfui-text-field_theme_default.mfui-text-field_valid .mfui-text-field__field-wrapper_no-touch:hover .mfui-text-field__field,
133
- .mfui-text-field_theme_default.mfui-text-field_valid .mfui-text-field__field {
246
+ .mfui-text-field_valid:not(.mfui-text-field_disabled) .mfui-text-field__field {
134
247
  border-color: var(--brandGreen);
135
248
  }
136
- .mfui-text-field_theme_default.mfui-text-field_valid .mfui-text-field__icon {
249
+ .mfui-text-field_valid:not(.mfui-text-field_disabled) .mfui-text-field__icon {
137
250
  fill: var(--brandGreen);
138
251
  }
139
- .mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__field-wrapper:hover .mfui-text-field__field,
140
- .mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__field {
252
+ .mfui-text-field_error:not(.mfui-text-field_disabled) .mfui-text-field__field {
141
253
  border-color: var(--fury);
142
254
  }
143
- .mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__icon {
255
+ .mfui-text-field_error:not(.mfui-text-field_disabled) .mfui-text-field__icon {
144
256
  fill: var(--fury);
145
257
  }
146
- .mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__text_error {
147
- color: var(--fury);
258
+ .mfui-text-field_error:not(.mfui-text-field_disabled) .mfui-text-field__icon_clear:hover {
259
+ fill: var(--fury80);
148
260
  }
149
- .mfui-text-field_theme_white .mfui-text-field__field {
150
- border: 1px solid var(--base);
261
+ .mfui-text-field_disabled .mfui-text-field__field {
262
+ border-color: var(--spbSky0);
151
263
  color: var(--content);
264
+ background-color: var(--spbSky0);
265
+ cursor: default;
152
266
  }
153
- .mfui-text-field_theme_white .mfui-text-field__field-wrapper:hover .mfui-text-field__field,
154
- .mfui-text-field_theme_white .mfui-text-field__field:focus {
155
- border-color: var(--content);
267
+ .mfui-text-field_disabled .mfui-text-field__icon-box {
268
+ cursor: default !important;
156
269
  }
157
- .mfui-text-field_theme_white.mfui-text-field_error .mfui-text-field__field-wrapper:hover .mfui-text-field__field,
158
- .mfui-text-field_theme_white.mfui-text-field_error .mfui-text-field__field {
159
- border-color: var(--fury);
270
+ .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-field__wrap {
272
+ color: var(--fury);
160
273
  }
161
- .mfui-text-field_theme_white.mfui-text-field_error .mfui-text-field__icon {
162
- fill: var(--fury);
274
+ .mfui-text-field_theme_white .mfui-text-field__icon {
275
+ fill: var(--stcWhite);
163
276
  }
164
- .mfui-text-field_theme_white.mfui-text-field_error .mfui-text-field__text_error {
165
- color: var(--fury);
277
+ .mfui-text-field_theme_white .mfui-text-field__wrap,
278
+ .mfui-text-field_theme_white .mfui-text-field__counter {
279
+ color: var(--stcWhite);
166
280
  }
167
- .mfui-text-field__text_success {
168
- color: var(--brandGreen);
281
+ .mfui-text-field_theme_white .mfui-text-field__field::-webkit-scrollbar-thumb {
282
+ background-color: rgba(51, 51, 51, 0.2);
169
283
  }
170
- .mfui-text-field_disabled .mfui-text-field__field-wrapper {
171
- background-color: var(--spbSky1) !important;
284
+ .mfui-text-field_theme_white .mfui-text-field__field::-webkit-scrollbar-thumb:hover {
285
+ background-color: rgba(51, 51, 51, 0.5);
172
286
  }
173
- .mfui-text-field_disabled .mfui-text-field__field {
174
- border-color: var(--spbSky1) !important;
175
- color: var(--content) !important;
176
- cursor: default !important;
177
- -webkit-text-fill-color: var(--content) !important;
287
+ .mfui-text-field_theme_white .mfui-text-field__resizer svg {
288
+ stroke: var(--stcWhite20);
178
289
  }
179
- .mfui-text-field_disabled .mfui-text-field__icon-box {
180
- cursor: default !important;
290
+ .mfui-text-field_theme_white .mfui-text-field__resizer:hover svg,
291
+ .mfui-text-field_theme_white .mfui-text-field__resizer:active svg {
292
+ stroke: var(--stcWhite50);
293
+ }
294
+ .mfui-text-field_theme_white:not(.mfui-text-field_disabled):not(.mfui-text-field_error):not(.mfui-text-field_valid) .mfui-text-field__field {
295
+ border-color: var(--base);
296
+ }
297
+ .mfui-text-field_theme_white:not(.mfui-text-field_disabled):not(.mfui-text-field_error):not(.mfui-text-field_valid) .mfui-text-field__field:not(:focus):not(:placeholder-shown) {
298
+ border-color: var(--spbSky2);
299
+ }
300
+ .mfui-text-field_theme_white:not(.mfui-text-field_disabled):not(.mfui-text-field_error):not(.mfui-text-field_valid) .mfui-text-field__field:not(:focus):hover {
301
+ border-color: var(--stcBlack);
302
+ }
303
+ .mfui-text-field_theme_white.mfui-text-field_disabled .mfui-text-field__field {
304
+ border-color: var(--stcWhite20);
305
+ color: var(--stcWhite);
306
+ background-color: var(--stcWhite20);
307
+ }
308
+ .mfui-text-field_theme_white.mfui-text-field_disabled .mfui-text-field__label {
309
+ color: var(--stcWhite50);
181
310
  }
182
311
  .mfui-text-field_icon .mfui-text-field__field {
183
312
  padding-right: 55px;
184
313
  }
185
- @media screen and (min-width: 1024px) {
186
- .mfui-text-field_icon.mfui-text-field_size_large .mfui-text-field__field {
187
- padding-right: 65px;
188
- }
189
- }
190
314
  .mfui-text-field_password .mfui-text-field__field {
191
315
  font: small-caption;
192
316
  font-size: 19px;
317
+ line-height: 24px;
318
+ }
319
+ .mfui-text-field input::-ms-clear,
320
+ .mfui-text-field input::-ms-reveal {
321
+ display: none;
193
322
  }