@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
|
@@ -7,6 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
require("core-js/modules/es.array.concat");
|
|
11
|
+
|
|
12
|
+
require("core-js/modules/es.array.includes");
|
|
13
|
+
|
|
14
|
+
require("core-js/modules/es.object.values");
|
|
15
|
+
|
|
16
|
+
require("core-js/modules/es.string.includes");
|
|
17
|
+
|
|
10
18
|
var React = _interopRequireWildcard(require("react"));
|
|
11
19
|
|
|
12
20
|
var _uiHelpers = require("@megafon/ui-helpers");
|
|
@@ -17,6 +25,20 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
17
25
|
|
|
18
26
|
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; }
|
|
19
27
|
|
|
28
|
+
var COLORS = {
|
|
29
|
+
GREEN: 'green',
|
|
30
|
+
PURPLE: 'purple',
|
|
31
|
+
BASE: 'base',
|
|
32
|
+
SPB_SKY_0: 'spbSky0',
|
|
33
|
+
SPB_SKY_1: 'spbSky1',
|
|
34
|
+
SPB_SKY_2: 'spbSky2',
|
|
35
|
+
CONTENT: 'content',
|
|
36
|
+
FULL_BLACK: 'fullBlack',
|
|
37
|
+
INHERIT: 'inherit',
|
|
38
|
+
|
|
39
|
+
/** @deprecated */
|
|
40
|
+
FRESH_ASPHALT: 'freshAsphalt'
|
|
41
|
+
};
|
|
20
42
|
var cn = (0, _uiHelpers.cnCreate)('mfui-paragraph');
|
|
21
43
|
|
|
22
44
|
var Paragraph = function Paragraph(_ref) {
|
|
@@ -24,7 +46,7 @@ var Paragraph = function Paragraph(_ref) {
|
|
|
24
46
|
size = _ref$size === void 0 ? 'regular' : _ref$size,
|
|
25
47
|
align = _ref.align,
|
|
26
48
|
_ref$color = _ref.color,
|
|
27
|
-
color = _ref$color === void 0 ? '
|
|
49
|
+
color = _ref$color === void 0 ? 'content' : _ref$color,
|
|
28
50
|
className = _ref.className,
|
|
29
51
|
_ref$hasMargin = _ref.hasMargin,
|
|
30
52
|
hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
|
|
@@ -43,7 +65,20 @@ Paragraph.propTypes = {
|
|
|
43
65
|
align: PropTypes.oneOf(['left', 'center', 'right']),
|
|
44
66
|
size: PropTypes.oneOf(['regular', 'small']),
|
|
45
67
|
hasMargin: PropTypes.bool,
|
|
46
|
-
color:
|
|
68
|
+
color: function color(props, propName, componentName) {
|
|
69
|
+
var deprecatedValue = COLORS.FRESH_ASPHALT;
|
|
70
|
+
var propValue = props[propName];
|
|
71
|
+
|
|
72
|
+
if (propValue && !Object.values(COLORS).includes(propValue)) {
|
|
73
|
+
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), "]"));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (propValue && props[propName] === COLORS.FRESH_ASPHALT) {
|
|
77
|
+
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, "'"));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
47
82
|
};
|
|
48
83
|
var _default = Paragraph;
|
|
49
84
|
exports["default"] = _default;
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"styles"
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"lint": "yarn lint:ts && yarn lint:less",
|
|
29
29
|
"lint:ts": "eslint --ext .js,.jsx,.ts,.tsx src --max-warnings=0",
|
|
30
30
|
"lint:less": "stylelint --syntax less src/**/*.less src/**/**/*.less",
|
|
31
|
+
"lint:less:fix": "yarn lint:less --fix",
|
|
31
32
|
"test": "yarn test:unit",
|
|
32
33
|
"test:unit": "jest",
|
|
33
34
|
"test:update": "jest --updateSnapshot"
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
"@babel/preset-env": "^7.8.6",
|
|
53
54
|
"@babel/preset-react": "^7.8.3",
|
|
54
55
|
"@babel/preset-typescript": "^7.8.3",
|
|
55
|
-
"@megafon/ui-icons": "^0.1.
|
|
56
|
+
"@megafon/ui-icons": "^0.1.1",
|
|
56
57
|
"@svgr/core": "^2.4.1",
|
|
57
58
|
"@testing-library/react-hooks": "^7.0.1",
|
|
58
59
|
"@types/enzyme": "^3.10.5",
|
|
@@ -95,5 +96,5 @@
|
|
|
95
96
|
"react-popper": "^2.2.3",
|
|
96
97
|
"swiper": "^6.5.6"
|
|
97
98
|
},
|
|
98
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "31bd33b5e87106ea511fbbdc8ad266f70457e3d3"
|
|
99
100
|
}
|
package/styles/base.less
CHANGED
|
@@ -1,47 +1,77 @@
|
|
|
1
1
|
// Basic Colors
|
|
2
2
|
@green: #00B956;
|
|
3
3
|
@purple: #731982;
|
|
4
|
-
@
|
|
4
|
+
@base: #FFFFFF;
|
|
5
5
|
@spbSky0: #F6F6F6;
|
|
6
6
|
@spbSky1: #EDEDED;
|
|
7
7
|
@spbSky2: #D8D8D8;
|
|
8
|
-
@
|
|
8
|
+
@spbSky3: #999999;
|
|
9
|
+
@content: #333333;
|
|
9
10
|
@fullBlack: #000000;
|
|
10
11
|
|
|
11
12
|
// Secondary Colors
|
|
12
13
|
@warmRedC: #EB5A40;
|
|
13
|
-
@
|
|
14
|
+
@Pantone137C: #FFA717;
|
|
14
15
|
@Pantone311C: #5BD9E5;
|
|
15
16
|
@reflexBlue: #444189;
|
|
16
17
|
|
|
17
18
|
// System Colors
|
|
18
19
|
@fury: #F62434;
|
|
19
|
-
@
|
|
20
|
+
@systemBlue: #34AAF2;
|
|
21
|
+
@background: #FFFFFF;
|
|
22
|
+
|
|
23
|
+
// Gradients
|
|
24
|
+
@basic: linear-gradient(90deg, #01873F 0%, #00B956 74%, #14CD6A 100%);
|
|
25
|
+
@vip: linear-gradient(90deg, #5B1168 0%, #731982 74%, #821E93 100%);
|
|
26
|
+
@exclusive: linear-gradient(90deg, #2A2674 0%, #444189 74%, #504D93 100%);
|
|
27
|
+
|
|
28
|
+
// Static
|
|
29
|
+
@STCBlack: #333333;
|
|
30
|
+
@STCWhite: #FFFFFF;
|
|
31
|
+
|
|
32
|
+
// Static Opacity
|
|
33
|
+
|
|
34
|
+
@STCWhite5: #FFFFFF0D;
|
|
35
|
+
@STCWhite10: #FFFFFF1A;
|
|
36
|
+
@STCWhite20: #FFFFFF33;
|
|
37
|
+
@STCWhite50: #FFFFFF80;
|
|
38
|
+
@STCBlack5: #3333330D;
|
|
39
|
+
@STCBlack10: #3333331A;
|
|
40
|
+
@STCBlack20: #33333333;
|
|
41
|
+
@STCBlack50: #33333380;
|
|
42
|
+
|
|
43
|
+
// Soft (new)
|
|
44
|
+
@green80: #0CDC78;
|
|
45
|
+
@green20: #DDFFEC;
|
|
46
|
+
@purple80: #AA67C1;
|
|
47
|
+
@purple20: #FFEEFF;
|
|
48
|
+
@warmRedC80: #FF765D;
|
|
49
|
+
@warmRedC20: #FFCFC7;
|
|
50
|
+
@Pantone137C80: #FFB945;
|
|
51
|
+
@Pantone137C20: #FFEDD1;
|
|
52
|
+
@Pantone311C80: #62E3FF;
|
|
53
|
+
@Pantone311C20: #E1FAFF;
|
|
54
|
+
@reflexBlue80: #554FC9;
|
|
55
|
+
@reflexBlue20: #EBEAFF;
|
|
56
|
+
@fury80: #F8505D;
|
|
57
|
+
@fury20: #FFC5C9;
|
|
58
|
+
|
|
59
|
+
// old colors
|
|
20
60
|
@buttonHoverGreen: #10E272;
|
|
21
|
-
@buttonhoverPurple: #
|
|
61
|
+
@buttonhoverPurple: #534455;
|
|
22
62
|
@buttonDown: #404D46;
|
|
23
63
|
|
|
24
64
|
// Notification Colors
|
|
25
|
-
// TODO: будут отрефакторены после
|
|
26
|
-
@error: #
|
|
27
|
-
@success: rgba(0, 185, 86, 0.1);
|
|
28
|
-
@info: #DEF7FA;
|
|
29
|
-
@warning: #FFEDD1;
|
|
30
|
-
@green20: fade(@green, 20);
|
|
31
|
-
@warmRedC20: fade(@warmRedC, 20);
|
|
32
|
-
@mandarin20: fade(@mandarin, 20);
|
|
33
|
-
@Pantone311C20: fade(@Pantone311C, 20);
|
|
65
|
+
// TODO: будут отрефакторены после обновления дизайном Notification по новой палитре
|
|
66
|
+
@error: #FFC4C9;
|
|
34
67
|
@spbSky160: fade(@spbSky1, 60);
|
|
35
|
-
@
|
|
36
|
-
@clearWhite20: fade(@clearWhite, 20);
|
|
68
|
+
@base30: fade(@base, 30);
|
|
37
69
|
|
|
38
70
|
// Additional Colors Variants
|
|
39
|
-
@
|
|
40
|
-
@freshAsphalt25: fade(@freshAsphalt, 25);
|
|
41
|
-
@freshAsphalt50: fade(@freshAsphalt, 50);
|
|
71
|
+
@content25: fade(@content, 25);
|
|
42
72
|
@fullBlack25: fade(@fullBlack, 25);
|
|
43
73
|
@fullBlack50: fade(@fullBlack, 50);
|
|
44
|
-
@
|
|
74
|
+
@contentLighten50: lighten(@content, 50);
|
|
45
75
|
|
|
46
76
|
// BREAKPOINTS
|
|
47
77
|
@mobileSmallEnd: 479px;
|
|
@@ -199,7 +229,7 @@ h5 {
|
|
|
199
229
|
}
|
|
200
230
|
|
|
201
231
|
.link() {
|
|
202
|
-
color: @
|
|
232
|
+
color: @systemBlue;
|
|
203
233
|
text-decoration: none;
|
|
204
234
|
|
|
205
235
|
&:hover {
|