@megafon/ui-core 2.1.0 → 2.1.1
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 +13 -0
- package/dist/es/colors/ColorItem/ColorItem.css +52 -0
- package/dist/es/colors/ColorItem/ColorItem.d.ts +12 -0
- package/dist/es/colors/ColorItem/ColorItem.js +35 -0
- package/dist/es/colors/Colors.css +203 -32
- package/dist/es/colors/Colors.js +243 -35
- package/dist/es/colors/colorsData.d.ts +20 -7
- package/dist/es/colors/colorsData.js +204 -61
- package/dist/es/components/Banner/BannerDot.css +2 -2
- package/dist/es/components/Button/Button.css +11 -11
- package/dist/es/components/Carousel/Carousel.css +1 -1
- package/dist/es/components/Carousel/Carousel.js +6 -1
- package/dist/es/components/ContentArea/ContentArea.css +2 -0
- package/dist/es/components/ContentArea/ContentArea.d.ts +3 -1
- package/dist/es/components/ContentArea/ContentArea.js +30 -5
- package/dist/es/components/Counter/Counter.css +3 -3
- package/dist/es/components/NavArrow/NavArrow.css +1 -1
- package/dist/es/components/Notification/Notification.css +10 -19
- package/dist/es/components/Paragraph/Paragraph.css +2 -1
- package/dist/es/components/Paragraph/Paragraph.d.ts +15 -1
- package/dist/es/components/Paragraph/Paragraph.js +33 -2
- package/dist/es/components/Tabs/Tabs.css +2 -2
- package/dist/lib/colors/ColorItem/ColorItem.css +52 -0
- package/dist/lib/colors/ColorItem/ColorItem.d.ts +12 -0
- package/dist/lib/colors/ColorItem/ColorItem.js +50 -0
- package/dist/lib/colors/Colors.css +203 -32
- package/dist/lib/colors/Colors.js +250 -36
- package/dist/lib/colors/colorsData.d.ts +20 -7
- package/dist/lib/colors/colorsData.js +204 -61
- package/dist/lib/components/Banner/BannerDot.css +2 -2
- package/dist/lib/components/Button/Button.css +11 -11
- package/dist/lib/components/Carousel/Carousel.css +1 -1
- package/dist/lib/components/Carousel/Carousel.js +6 -1
- package/dist/lib/components/ContentArea/ContentArea.css +2 -0
- package/dist/lib/components/ContentArea/ContentArea.d.ts +3 -1
- package/dist/lib/components/ContentArea/ContentArea.js +33 -5
- package/dist/lib/components/Counter/Counter.css +3 -3
- package/dist/lib/components/NavArrow/NavArrow.css +1 -1
- package/dist/lib/components/Notification/Notification.css +10 -19
- package/dist/lib/components/Paragraph/Paragraph.css +2 -1
- package/dist/lib/components/Paragraph/Paragraph.d.ts +15 -1
- package/dist/lib/components/Paragraph/Paragraph.js +37 -2
- package/dist/lib/components/Tabs/Tabs.css +2 -2
- package/package.json +4 -3
- package/styles/base.less +51 -21
|
@@ -231,9 +231,9 @@ h5 {
|
|
|
231
231
|
fill: #FFFFFF;
|
|
232
232
|
}
|
|
233
233
|
.mfui-button_no-touch.mfui-button_type_primary.mfui-button_theme_purple:not(.mfui-button_loading):hover {
|
|
234
|
-
background-color: #
|
|
235
|
-
-webkit-box-shadow: inset 0 0 0 1px #
|
|
236
|
-
box-shadow: inset 0 0 0 1px #
|
|
234
|
+
background-color: #534455;
|
|
235
|
+
-webkit-box-shadow: inset 0 0 0 1px #534455;
|
|
236
|
+
box-shadow: inset 0 0 0 1px #534455;
|
|
237
237
|
}
|
|
238
238
|
.mfui-button_no-touch.mfui-button_type_primary.mfui-button_theme_purple:not(.mfui-button_loading):active {
|
|
239
239
|
background-color: #404D46;
|
|
@@ -332,7 +332,7 @@ h5 {
|
|
|
332
332
|
.mfui-button.mfui-button_no-touch.mfui-button_type_primary.mfui-button_disabled,
|
|
333
333
|
.mfui-button.mfui-button_no-touch.mfui-button_type_primary.mfui-button_disabled:hover,
|
|
334
334
|
.mfui-button.mfui-button_no-touch.mfui-button_type_primary.mfui-button_disabled:active {
|
|
335
|
-
color:
|
|
335
|
+
color: #33333380;
|
|
336
336
|
background-color: #EDEDED;
|
|
337
337
|
-webkit-box-shadow: inset 0 0 0 1px #D8D8D8;
|
|
338
338
|
box-shadow: inset 0 0 0 1px #D8D8D8;
|
|
@@ -341,28 +341,28 @@ h5 {
|
|
|
341
341
|
.mfui-button.mfui-button_no-touch.mfui-button_type_primary.mfui-button_disabled svg,
|
|
342
342
|
.mfui-button.mfui-button_no-touch.mfui-button_type_primary.mfui-button_disabled:hover svg,
|
|
343
343
|
.mfui-button.mfui-button_no-touch.mfui-button_type_primary.mfui-button_disabled:active svg {
|
|
344
|
-
fill:
|
|
344
|
+
fill: #33333380;
|
|
345
345
|
}
|
|
346
346
|
.mfui-button.mfui-button_type_outline.mfui-button_theme_white.mfui-button_disabled,
|
|
347
347
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_white.mfui-button_disabled,
|
|
348
348
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_white.mfui-button_disabled:hover,
|
|
349
349
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_white.mfui-button_disabled:active {
|
|
350
|
-
color:
|
|
350
|
+
color: #FFFFFF80;
|
|
351
351
|
background-color: transparent;
|
|
352
|
-
-webkit-box-shadow: inset 0 0 0 1px
|
|
353
|
-
box-shadow: inset 0 0 0 1px
|
|
352
|
+
-webkit-box-shadow: inset 0 0 0 1px #FFFFFF80;
|
|
353
|
+
box-shadow: inset 0 0 0 1px #FFFFFF80;
|
|
354
354
|
}
|
|
355
355
|
.mfui-button.mfui-button_type_outline.mfui-button_theme_white.mfui-button_disabled svg,
|
|
356
356
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_white.mfui-button_disabled svg,
|
|
357
357
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_white.mfui-button_disabled:hover svg,
|
|
358
358
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_white.mfui-button_disabled:active svg {
|
|
359
|
-
fill:
|
|
359
|
+
fill: #FFFFFF80;
|
|
360
360
|
}
|
|
361
361
|
.mfui-button.mfui-button_type_outline.mfui-button_disabled,
|
|
362
362
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_disabled,
|
|
363
363
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_disabled:hover,
|
|
364
364
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_disabled:active {
|
|
365
|
-
color:
|
|
365
|
+
color: #33333380;
|
|
366
366
|
background-color: transparent;
|
|
367
367
|
-webkit-box-shadow: inset 0 0 0 1px #D8D8D8;
|
|
368
368
|
box-shadow: inset 0 0 0 1px #D8D8D8;
|
|
@@ -371,5 +371,5 @@ h5 {
|
|
|
371
371
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_disabled svg,
|
|
372
372
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_disabled:hover svg,
|
|
373
373
|
.mfui-button.mfui-button_no-touch.mfui-button_type_outline.mfui-button_disabled:active svg {
|
|
374
|
-
fill:
|
|
374
|
+
fill: #33333380;
|
|
375
375
|
}
|
|
@@ -158,7 +158,7 @@ h5 {
|
|
|
158
158
|
margin-right: 8px;
|
|
159
159
|
}
|
|
160
160
|
.mfui-carousel_nav-theme_green .swiper-pagination-bullet:before {
|
|
161
|
-
background-color:
|
|
161
|
+
background-color: #FFFFFF80;
|
|
162
162
|
}
|
|
163
163
|
.mfui-carousel_nav-theme_light .swiper-pagination-bullet:before {
|
|
164
164
|
background-color: rgba(51, 51, 51, 0.25);
|
|
@@ -211,6 +211,10 @@ var Carousel = function Carousel(_ref) {
|
|
|
211
211
|
};
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
+
var disableFocusOnSlideClick = function disableFocusOnSlideClick(e) {
|
|
215
|
+
e.nativeEvent.preventDefault();
|
|
216
|
+
};
|
|
217
|
+
|
|
214
218
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
|
|
215
219
|
ref: rootRef,
|
|
216
220
|
className: cn({
|
|
@@ -252,7 +256,8 @@ var Carousel = function Carousel(_ref) {
|
|
|
252
256
|
return /*#__PURE__*/React.createElement(SwiperSlide, {
|
|
253
257
|
key: i,
|
|
254
258
|
className: cn('slide', slideClass),
|
|
255
|
-
onFocus: handleSlideFocus(i)
|
|
259
|
+
onFocus: handleSlideFocus(i),
|
|
260
|
+
onMouseDown: disableFocusOnSlideClick
|
|
256
261
|
}, child);
|
|
257
262
|
})), /*#__PURE__*/React.createElement(NavArrow, {
|
|
258
263
|
className: cn('arrow', {
|
|
@@ -26,6 +26,7 @@ h5 {
|
|
|
26
26
|
.mfui-content-area_color_spbSky2 {
|
|
27
27
|
background-color: #D8D8D8;
|
|
28
28
|
}
|
|
29
|
+
.mfui-content-area_color_content,
|
|
29
30
|
.mfui-content-area_color_freshAsphalt {
|
|
30
31
|
background-color: #333333;
|
|
31
32
|
}
|
|
@@ -101,6 +102,7 @@ h5 {
|
|
|
101
102
|
.mfui-content-area__inner_color_spbSky2 {
|
|
102
103
|
background-color: #D8D8D8;
|
|
103
104
|
}
|
|
105
|
+
.mfui-content-area__inner_color_content,
|
|
104
106
|
.mfui-content-area__inner_color_freshAsphalt {
|
|
105
107
|
background-color: #333333;
|
|
106
108
|
}
|
|
@@ -8,8 +8,10 @@ declare const BACKGROUND_COLORS: {
|
|
|
8
8
|
readonly SPB_SKY_0: "spbSky0";
|
|
9
9
|
readonly SPB_SKY_1: "spbSky1";
|
|
10
10
|
readonly SPB_SKY_2: "spbSky2";
|
|
11
|
-
readonly
|
|
11
|
+
readonly CONTENT: "content";
|
|
12
12
|
readonly FULL_BLACK: "fullBlack";
|
|
13
|
+
/** @deprecated */
|
|
14
|
+
readonly FRESH_ASPHALT: "freshAsphalt";
|
|
13
15
|
};
|
|
14
16
|
export declare type BackgroundColorType = typeof BACKGROUND_COLORS[keyof typeof BACKGROUND_COLORS];
|
|
15
17
|
declare const DisableIndents: {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import "core-js/modules/es.array.concat";
|
|
2
|
+
import "core-js/modules/es.array.includes";
|
|
1
3
|
import "core-js/modules/es.object.values";
|
|
4
|
+
import "core-js/modules/es.string.includes";
|
|
2
5
|
import * as React from 'react';
|
|
3
6
|
import { cnCreate } from '@megafon/ui-helpers';
|
|
4
7
|
import * as PropTypes from 'prop-types';
|
|
@@ -11,8 +14,11 @@ var BACKGROUND_COLORS = {
|
|
|
11
14
|
SPB_SKY_0: 'spbSky0',
|
|
12
15
|
SPB_SKY_1: 'spbSky1',
|
|
13
16
|
SPB_SKY_2: 'spbSky2',
|
|
14
|
-
|
|
15
|
-
FULL_BLACK: 'fullBlack'
|
|
17
|
+
CONTENT: 'content',
|
|
18
|
+
FULL_BLACK: 'fullBlack',
|
|
19
|
+
|
|
20
|
+
/** @deprecated */
|
|
21
|
+
FRESH_ASPHALT: 'freshAsphalt'
|
|
16
22
|
};
|
|
17
23
|
var DisableIndents = {
|
|
18
24
|
MOBILE: 'mobile',
|
|
@@ -41,15 +47,34 @@ var ContentArea = function ContentArea(_ref) {
|
|
|
41
47
|
}, children));
|
|
42
48
|
};
|
|
43
49
|
|
|
50
|
+
var colorsCustomPropTypes = function colorsCustomPropTypes(props, propName, componentName) {
|
|
51
|
+
var deprecatedValue = BACKGROUND_COLORS.FRESH_ASPHALT;
|
|
52
|
+
var propValue = props[propName];
|
|
53
|
+
|
|
54
|
+
if (propValue && !Object.values(BACKGROUND_COLORS).includes(propValue)) {
|
|
55
|
+
return new Error("Failed prop type: Invalid prop '".concat(propName, "' of value '").concat(propValue, "' supplied to '").concat(componentName, "', \n expected one of [").concat(Object.values(BACKGROUND_COLORS), "]"));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (propValue && propValue === BACKGROUND_COLORS.FRESH_ASPHALT) {
|
|
59
|
+
return new Error("Failed prop type: Invalid prop '".concat(propName, "' of value '").concat(propValue, "' supplied to '").concat(componentName, "',\n value '").concat(deprecatedValue, "' is deprecated, please use value '").concat(BACKGROUND_COLORS.CONTENT, "'"));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return null;
|
|
63
|
+
};
|
|
64
|
+
|
|
44
65
|
ContentArea.propTypes = {
|
|
45
|
-
outerBackgroundColor: PropTypes.oneOf(Object.values(BACKGROUND_COLORS)),
|
|
46
|
-
innerBackgroundColor: PropTypes.oneOf(Object.values(BACKGROUND_COLORS)),
|
|
47
66
|
disableIndents: PropTypes.oneOf(Object.values(DisableIndents)),
|
|
48
67
|
className: PropTypes.string,
|
|
49
68
|
classes: PropTypes.shape({
|
|
50
69
|
root: PropTypes.string,
|
|
51
70
|
inner: PropTypes.string
|
|
52
|
-
})
|
|
71
|
+
}),
|
|
72
|
+
outerBackgroundColor: function outerBackgroundColor(props, propName, componentName) {
|
|
73
|
+
return colorsCustomPropTypes(props, propName, componentName);
|
|
74
|
+
},
|
|
75
|
+
innerBackgroundColor: function innerBackgroundColor(props, propName, componentName) {
|
|
76
|
+
return colorsCustomPropTypes(props, propName, componentName);
|
|
77
|
+
}
|
|
53
78
|
};
|
|
54
79
|
ContentArea.defaultProps = {
|
|
55
80
|
outerBackgroundColor: 'transparent',
|
|
@@ -59,7 +59,7 @@ h5 {
|
|
|
59
59
|
cursor: default;
|
|
60
60
|
}
|
|
61
61
|
.mfui-counter__btn:disabled .mfui-counter__icon {
|
|
62
|
-
fill:
|
|
62
|
+
fill: #33333380;
|
|
63
63
|
}
|
|
64
64
|
.mfui-counter__btn_left {
|
|
65
65
|
border-top-left-radius: 50px;
|
|
@@ -113,8 +113,8 @@ h5 {
|
|
|
113
113
|
.mfui-counter_disabled .mfui-counter__input {
|
|
114
114
|
background-color: #EDEDED;
|
|
115
115
|
cursor: default;
|
|
116
|
-
color:
|
|
116
|
+
color: #33333380;
|
|
117
117
|
}
|
|
118
118
|
.mfui-counter_disabled .mfui-counter__icon {
|
|
119
|
-
fill:
|
|
119
|
+
fill: #33333380;
|
|
120
120
|
}
|
|
@@ -149,28 +149,28 @@ h5 {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
.mfui-notification_type_error .mfui-notification__icon-container {
|
|
152
|
-
background-color:
|
|
152
|
+
background-color: #FFC4C9;
|
|
153
153
|
}
|
|
154
154
|
.mfui-notification_type_error .mfui-notification__icon-container svg {
|
|
155
155
|
/* stylelint-disable-line max-nesting-depth */
|
|
156
|
-
fill: #
|
|
156
|
+
fill: #F62434;
|
|
157
157
|
}
|
|
158
158
|
.mfui-notification_type_success .mfui-notification__icon-container {
|
|
159
|
-
background-color:
|
|
159
|
+
background-color: #DDFFEC;
|
|
160
160
|
}
|
|
161
161
|
.mfui-notification_type_success .mfui-notification__icon-container svg {
|
|
162
162
|
/* stylelint-disable-line max-nesting-depth */
|
|
163
163
|
fill: #00B956;
|
|
164
164
|
}
|
|
165
165
|
.mfui-notification_type_warning .mfui-notification__icon-container {
|
|
166
|
-
background-color:
|
|
166
|
+
background-color: #FFEDD1;
|
|
167
167
|
}
|
|
168
168
|
.mfui-notification_type_warning .mfui-notification__icon-container svg {
|
|
169
169
|
/* stylelint-disable-line max-nesting-depth */
|
|
170
170
|
fill: #FFA717;
|
|
171
171
|
}
|
|
172
172
|
.mfui-notification_type_info .mfui-notification__icon-container {
|
|
173
|
-
background-color:
|
|
173
|
+
background-color: #E1FAFF;
|
|
174
174
|
}
|
|
175
175
|
.mfui-notification_type_info .mfui-notification__icon-container svg {
|
|
176
176
|
/* stylelint-disable-line max-nesting-depth */
|
|
@@ -180,10 +180,10 @@ h5 {
|
|
|
180
180
|
background-color: #FFFFFF;
|
|
181
181
|
}
|
|
182
182
|
.mfui-notification_colored .mfui-notification__close:hover {
|
|
183
|
-
background-color: rgba(255, 255, 255, 0.
|
|
183
|
+
background-color: rgba(255, 255, 255, 0.3);
|
|
184
184
|
}
|
|
185
185
|
.mfui-notification_colored.mfui-notification_type_error {
|
|
186
|
-
background-color: #
|
|
186
|
+
background-color: #F8505D;
|
|
187
187
|
}
|
|
188
188
|
.mfui-notification_colored.mfui-notification_type_error .mfui-notification__title,
|
|
189
189
|
.mfui-notification_colored.mfui-notification_type_error .mfui-notification__text,
|
|
@@ -194,27 +194,18 @@ h5 {
|
|
|
194
194
|
fill: #FFFFFF;
|
|
195
195
|
}
|
|
196
196
|
.mfui-notification_colored.mfui-notification_type_error .mfui-notification__icon-container {
|
|
197
|
-
background-color:
|
|
197
|
+
background-color: #FFFFFF33;
|
|
198
198
|
}
|
|
199
199
|
.mfui-notification_colored.mfui-notification_type_error .mfui-notification__icon-container svg {
|
|
200
200
|
/* stylelint-disable-line max-nesting-depth */
|
|
201
201
|
fill: #FFFFFF;
|
|
202
202
|
}
|
|
203
203
|
.mfui-notification_colored.mfui-notification_type_success {
|
|
204
|
-
background-color:
|
|
205
|
-
}
|
|
206
|
-
.mfui-notification_colored.mfui-notification_type_success .mfui-notification__icon-container svg {
|
|
207
|
-
fill: #00B956;
|
|
204
|
+
background-color: #DDFFEC;
|
|
208
205
|
}
|
|
209
206
|
.mfui-notification_colored.mfui-notification_type_warning {
|
|
210
207
|
background-color: #FFEDD1;
|
|
211
208
|
}
|
|
212
|
-
.mfui-notification_colored.mfui-notification_type_warning .mfui-notification__icon-container svg {
|
|
213
|
-
fill: #FFA717;
|
|
214
|
-
}
|
|
215
209
|
.mfui-notification_colored.mfui-notification_type_info {
|
|
216
|
-
background-color: #
|
|
217
|
-
}
|
|
218
|
-
.mfui-notification_colored.mfui-notification_type_info .mfui-notification__icon-container svg {
|
|
219
|
-
fill: #5BD9E5;
|
|
210
|
+
background-color: #E1FAFF;
|
|
220
211
|
}
|
|
@@ -36,7 +36,7 @@ h5 {
|
|
|
36
36
|
.mfui-paragraph_color_purple {
|
|
37
37
|
color: #731982;
|
|
38
38
|
}
|
|
39
|
-
.mfui-
|
|
39
|
+
.mfui-paragraph_color_base {
|
|
40
40
|
color: #FFFFFF;
|
|
41
41
|
}
|
|
42
42
|
.mfui-paragraph_color_spbSky0 {
|
|
@@ -48,6 +48,7 @@ h5 {
|
|
|
48
48
|
.mfui-paragraph_color_spbSky2 {
|
|
49
49
|
color: #D8D8D8;
|
|
50
50
|
}
|
|
51
|
+
.mfui-paragraph_color_content,
|
|
51
52
|
.mfui-paragraph_color_freshAsphalt {
|
|
52
53
|
color: #333333;
|
|
53
54
|
}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import './Paragraph.less';
|
|
3
|
+
declare const COLORS: {
|
|
4
|
+
GREEN: string;
|
|
5
|
+
PURPLE: string;
|
|
6
|
+
BASE: string;
|
|
7
|
+
SPB_SKY_0: string;
|
|
8
|
+
SPB_SKY_1: string;
|
|
9
|
+
SPB_SKY_2: string;
|
|
10
|
+
CONTENT: string;
|
|
11
|
+
FULL_BLACK: string;
|
|
12
|
+
INHERIT: string;
|
|
13
|
+
/** @deprecated */
|
|
14
|
+
FRESH_ASPHALT: string;
|
|
15
|
+
};
|
|
16
|
+
declare type ColorType = typeof COLORS[keyof typeof COLORS];
|
|
3
17
|
export interface IParagraphProps {
|
|
4
18
|
/** Выравнивание по горизонтали */
|
|
5
19
|
align?: 'left' | 'center' | 'right';
|
|
@@ -8,7 +22,7 @@ export interface IParagraphProps {
|
|
|
8
22
|
/** Вертикальный отступ (включен по умолчанию) */
|
|
9
23
|
hasMargin?: boolean;
|
|
10
24
|
/** Цвет текста */
|
|
11
|
-
color?:
|
|
25
|
+
color?: ColorType;
|
|
12
26
|
/** Дополнительный класс корневого элемента */
|
|
13
27
|
className?: string;
|
|
14
28
|
}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
+
import "core-js/modules/es.array.concat";
|
|
2
|
+
import "core-js/modules/es.array.includes";
|
|
3
|
+
import "core-js/modules/es.object.values";
|
|
4
|
+
import "core-js/modules/es.string.includes";
|
|
1
5
|
import * as React from 'react';
|
|
2
6
|
import { cnCreate } from '@megafon/ui-helpers';
|
|
3
7
|
import * as PropTypes from 'prop-types';
|
|
4
8
|
import "./Paragraph.css";
|
|
9
|
+
var COLORS = {
|
|
10
|
+
GREEN: 'green',
|
|
11
|
+
PURPLE: 'purple',
|
|
12
|
+
BASE: 'base',
|
|
13
|
+
SPB_SKY_0: 'spbSky0',
|
|
14
|
+
SPB_SKY_1: 'spbSky1',
|
|
15
|
+
SPB_SKY_2: 'spbSky2',
|
|
16
|
+
CONTENT: 'content',
|
|
17
|
+
FULL_BLACK: 'fullBlack',
|
|
18
|
+
INHERIT: 'inherit',
|
|
19
|
+
|
|
20
|
+
/** @deprecated */
|
|
21
|
+
FRESH_ASPHALT: 'freshAsphalt'
|
|
22
|
+
};
|
|
5
23
|
var cn = cnCreate('mfui-paragraph');
|
|
6
24
|
|
|
7
25
|
var Paragraph = function Paragraph(_ref) {
|
|
@@ -9,7 +27,7 @@ var Paragraph = function Paragraph(_ref) {
|
|
|
9
27
|
size = _ref$size === void 0 ? 'regular' : _ref$size,
|
|
10
28
|
align = _ref.align,
|
|
11
29
|
_ref$color = _ref.color,
|
|
12
|
-
color = _ref$color === void 0 ? '
|
|
30
|
+
color = _ref$color === void 0 ? 'content' : _ref$color,
|
|
13
31
|
className = _ref.className,
|
|
14
32
|
_ref$hasMargin = _ref.hasMargin,
|
|
15
33
|
hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
|
|
@@ -28,6 +46,19 @@ Paragraph.propTypes = {
|
|
|
28
46
|
align: PropTypes.oneOf(['left', 'center', 'right']),
|
|
29
47
|
size: PropTypes.oneOf(['regular', 'small']),
|
|
30
48
|
hasMargin: PropTypes.bool,
|
|
31
|
-
color:
|
|
49
|
+
color: function color(props, propName, componentName) {
|
|
50
|
+
var deprecatedValue = COLORS.FRESH_ASPHALT;
|
|
51
|
+
var propValue = props[propName];
|
|
52
|
+
|
|
53
|
+
if (propValue && !Object.values(COLORS).includes(propValue)) {
|
|
54
|
+
return new Error("Failed prop type: Invalid prop '".concat(propName, "' of value '").concat(propValue, "' supplied to '").concat(componentName, "', \n expected one of [").concat(Object.values(COLORS), "]"));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (propValue && props[propName] === COLORS.FRESH_ASPHALT) {
|
|
58
|
+
return new Error("Failed prop type: Invalid prop '".concat(propName, "' of value '").concat(propValue, "' supplied to '").concat(componentName, "',\n value '").concat(deprecatedValue, "' is deprecated, please use value '").concat(COLORS.CONTENT, "'"));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
32
63
|
};
|
|
33
64
|
export default Paragraph;
|
|
@@ -254,8 +254,8 @@ h5 {
|
|
|
254
254
|
border-color: rgba(237, 237, 237, 0.5);
|
|
255
255
|
}
|
|
256
256
|
.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__tab-inner {
|
|
257
|
-
color:
|
|
258
|
-
fill:
|
|
257
|
+
color: #FFFFFF80;
|
|
258
|
+
fill: #FFFFFF80;
|
|
259
259
|
}
|
|
260
260
|
.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__tab-inner:hover {
|
|
261
261
|
color: #FFFFFF;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
h1,
|
|
2
|
+
h2,
|
|
3
|
+
h3,
|
|
4
|
+
h4,
|
|
5
|
+
h5 {
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
.color-item {
|
|
9
|
+
display: -webkit-box;
|
|
10
|
+
display: -ms-flexbox;
|
|
11
|
+
display: flex;
|
|
12
|
+
-webkit-box-orient: vertical;
|
|
13
|
+
-webkit-box-direction: normal;
|
|
14
|
+
-ms-flex-direction: column;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
-webkit-box-align: center;
|
|
17
|
+
-ms-flex-align: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
width: 120px;
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
22
|
+
.color-item__container {
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 48px;
|
|
25
|
+
height: 48px;
|
|
26
|
+
margin-bottom: 8px;
|
|
27
|
+
}
|
|
28
|
+
.color-item__color {
|
|
29
|
+
position: relative;
|
|
30
|
+
z-index: 0;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
border-radius: 50%;
|
|
34
|
+
}
|
|
35
|
+
.color-item__parent-color {
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 0;
|
|
38
|
+
right: 0;
|
|
39
|
+
z-index: 1;
|
|
40
|
+
width: 16px;
|
|
41
|
+
height: 16px;
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
}
|
|
44
|
+
.color-item__name {
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
line-height: 20px;
|
|
47
|
+
}
|
|
48
|
+
.color-item__code {
|
|
49
|
+
color: #33333380;
|
|
50
|
+
font-size: 12px;
|
|
51
|
+
line-height: 18px;
|
|
52
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './ColorItem.less';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
colorCode: string;
|
|
5
|
+
colorName: string;
|
|
6
|
+
parentColorCode?: string;
|
|
7
|
+
gradient?: string;
|
|
8
|
+
border?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const ColorItem: React.FC<Props>;
|
|
12
|
+
export default ColorItem;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
var cn = (0, _uiHelpers.cnCreate)('color-item');
|
|
19
|
+
|
|
20
|
+
var ColorItem = function ColorItem(_ref) {
|
|
21
|
+
var colorCode = _ref.colorCode,
|
|
22
|
+
colorName = _ref.colorName,
|
|
23
|
+
parentColorCode = _ref.parentColorCode,
|
|
24
|
+
gradient = _ref.gradient,
|
|
25
|
+
border = _ref.border,
|
|
26
|
+
className = _ref.className;
|
|
27
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: cn([className])
|
|
29
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: cn('container')
|
|
31
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: cn('color'),
|
|
33
|
+
style: {
|
|
34
|
+
background: !gradient ? colorCode : gradient,
|
|
35
|
+
border: border
|
|
36
|
+
}
|
|
37
|
+
}), !!parentColorCode && /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: cn('parent-color'),
|
|
39
|
+
style: {
|
|
40
|
+
background: parentColorCode
|
|
41
|
+
}
|
|
42
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: cn('name')
|
|
44
|
+
}, colorName), /*#__PURE__*/React.createElement("span", {
|
|
45
|
+
className: cn('code')
|
|
46
|
+
}, colorCode));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var _default = ColorItem;
|
|
50
|
+
exports["default"] = _default;
|