@megafon/ui-core 2.4.0 → 3.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.
- package/CHANGELOG.md +154 -7
- package/dist/es/colors/ColorItem/ColorItem.css +1 -8
- package/dist/es/colors/ColorItem/ColorItem.js +1 -1
- package/dist/es/colors/Colors.css +3 -11
- package/dist/es/colors/Colors.d.ts +2 -2
- package/dist/es/colors/Colors.js +64 -4
- package/dist/es/colors/colorsData.js +78 -71
- package/dist/es/components/Accordion/Accordion.css +7 -27
- package/dist/es/components/Accordion/Accordion.d.ts +12 -7
- package/dist/es/components/Accordion/Accordion.js +25 -20
- package/dist/es/components/Banner/Banner.css +2 -37
- package/dist/es/components/Banner/Banner.d.ts +10 -2
- package/dist/es/components/Banner/Banner.js +35 -26
- package/dist/es/components/Banner/BannerDot.css +4 -11
- package/dist/es/components/Banner/BannerDot.d.ts +3 -0
- package/dist/es/components/Banner/BannerDot.js +8 -3
- package/dist/es/components/Button/Button.css +83 -74
- package/dist/es/components/Button/Button.d.ts +8 -2
- package/dist/es/components/Button/Button.js +16 -8
- package/dist/es/components/Calendar/Calendar.css +0 -7
- package/dist/es/components/Calendar/Calendar.js +2 -3
- package/dist/es/components/Calendar/components/Day/Day.css +10 -17
- package/dist/es/components/Calendar/components/Day/Day.js +1 -1
- package/dist/es/components/Calendar/components/Month/Month.css +3 -10
- package/dist/es/components/Calendar/components/Month/Month.js +21 -5
- package/dist/es/components/Carousel/Carousel.css +4 -11
- package/dist/es/components/Carousel/Carousel.d.ts +9 -2
- package/dist/es/components/Carousel/Carousel.js +28 -25
- package/dist/es/components/Checkbox/Checkbox.css +18 -25
- package/dist/es/components/Checkbox/Checkbox.d.ts +11 -27
- package/dist/es/components/Checkbox/Checkbox.js +77 -90
- package/dist/es/components/Collapse/Collapse.d.ts +15 -3
- package/dist/es/components/Collapse/Collapse.js +11 -4
- package/dist/es/components/ContentArea/ContentArea.css +18 -28
- package/dist/es/components/ContentArea/ContentArea.d.ts +2 -7
- package/dist/es/components/ContentArea/ContentArea.js +5 -39
- package/dist/es/components/Counter/Counter.css +14 -11
- package/dist/es/components/Counter/Counter.js +3 -3
- package/dist/es/components/Grid/GridColumn.css +0 -7
- package/dist/es/components/Header/Header.css +8 -12
- package/dist/es/components/Header/Header.d.ts +7 -21
- package/dist/es/components/Header/Header.js +31 -67
- package/dist/es/components/InputLabel/InputLabel.css +0 -7
- package/dist/es/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/es/components/InputLabel/InputLabel.js +9 -4
- package/dist/es/components/Link/Link.d.ts +3 -3
- package/dist/es/components/Link/Link.js +32 -21
- package/dist/es/components/List/List.css +9 -13
- package/dist/es/components/List/List.d.ts +1 -1
- package/dist/es/components/List/List.js +2 -2
- package/dist/es/components/List/ListItem.css +0 -7
- package/dist/es/components/Logo/Logo.css +0 -7
- package/dist/es/components/Logo/Logo.js +4 -8
- package/dist/es/components/NavArrow/NavArrow.css +5 -12
- package/dist/es/components/Notification/Notification.css +41 -24
- package/dist/es/components/Notification/Notification.d.ts +8 -0
- package/dist/es/components/Notification/Notification.js +21 -4
- package/dist/es/components/Pagination/Pagination.css +0 -7
- package/dist/es/components/Pagination/Pagination.d.ts +9 -2
- package/dist/es/components/Pagination/Pagination.js +20 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +12 -7
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +10 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/es/components/Pagination/helpers.d.ts +1 -1
- package/dist/es/components/Paragraph/Paragraph.css +10 -31
- package/dist/es/components/Paragraph/Paragraph.d.ts +9 -13
- package/dist/es/components/Paragraph/Paragraph.js +14 -40
- package/dist/es/components/Preloader/Preloader.css +5 -12
- package/dist/es/components/Preloader/Preloader.d.ts +4 -0
- package/dist/es/components/Preloader/Preloader.js +10 -5
- package/dist/es/components/RadioButton/RadioButton.css +7 -14
- package/dist/es/components/RadioButton/RadioButton.d.ts +8 -28
- package/dist/es/components/RadioButton/RadioButton.js +50 -85
- package/dist/es/components/Search/Search.css +20 -25
- package/dist/es/components/Search/Search.js +3 -4
- package/dist/es/components/Select/Select.css +34 -37
- package/dist/es/components/Select/Select.d.ts +43 -50
- package/dist/es/components/Select/Select.js +382 -461
- package/dist/es/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/es/components/Select/reducer/selectReducer.js +123 -0
- package/dist/es/components/Switcher/Switcher.css +18 -28
- package/dist/es/components/Switcher/Switcher.js +1 -1
- package/dist/es/components/Tabs/Tab.d.ts +5 -2
- package/dist/es/components/Tabs/Tab.js +4 -2
- package/dist/es/components/Tabs/Tabs.css +30 -37
- package/dist/es/components/Tabs/Tabs.d.ts +8 -0
- package/dist/es/components/Tabs/Tabs.js +38 -31
- package/dist/es/components/TextField/TextField.css +27 -33
- package/dist/es/components/TextField/TextField.d.ts +9 -3
- package/dist/es/components/TextField/TextField.js +32 -24
- package/dist/es/components/TextLink/TextLink.css +10 -14
- package/dist/es/components/TextLink/TextLink.d.ts +1 -1
- package/dist/es/components/TextLink/TextLink.js +7 -2
- package/dist/es/components/Tile/Tile.css +2 -8
- package/dist/es/components/Tile/Tile.d.ts +5 -2
- package/dist/es/components/Tile/Tile.js +2 -2
- package/dist/es/components/Tooltip/Tooltip.css +1 -8
- package/dist/es/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/es/components/Tooltip/Tooltip.js +28 -27
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -0
- package/dist/lib/colors/ColorItem/ColorItem.css +1 -8
- package/dist/lib/colors/ColorItem/ColorItem.js +1 -1
- package/dist/lib/colors/Colors.css +3 -11
- package/dist/lib/colors/Colors.d.ts +2 -2
- package/dist/lib/colors/Colors.js +63 -4
- package/dist/lib/colors/colorsData.js +78 -71
- package/dist/lib/components/Accordion/Accordion.css +7 -27
- package/dist/lib/components/Accordion/Accordion.d.ts +12 -7
- package/dist/lib/components/Accordion/Accordion.js +24 -19
- package/dist/lib/components/Banner/Banner.css +2 -37
- package/dist/lib/components/Banner/Banner.d.ts +10 -2
- package/dist/lib/components/Banner/Banner.js +35 -25
- package/dist/lib/components/Banner/BannerDot.css +4 -11
- package/dist/lib/components/Banner/BannerDot.d.ts +3 -0
- package/dist/lib/components/Banner/BannerDot.js +10 -2
- package/dist/lib/components/Button/Button.css +83 -74
- package/dist/lib/components/Button/Button.d.ts +8 -2
- package/dist/lib/components/Button/Button.js +16 -8
- package/dist/lib/components/Calendar/Calendar.css +0 -7
- package/dist/lib/components/Calendar/Calendar.js +3 -3
- package/dist/lib/components/Calendar/components/Day/Day.css +10 -17
- package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
- package/dist/lib/components/Calendar/components/Month/Month.css +3 -10
- package/dist/lib/components/Calendar/components/Month/Month.js +20 -4
- package/dist/lib/components/Carousel/Carousel.css +4 -11
- package/dist/lib/components/Carousel/Carousel.d.ts +9 -2
- package/dist/lib/components/Carousel/Carousel.js +26 -23
- package/dist/lib/components/Checkbox/Checkbox.css +18 -25
- package/dist/lib/components/Checkbox/Checkbox.d.ts +11 -27
- package/dist/lib/components/Checkbox/Checkbox.js +82 -125
- package/dist/lib/components/Collapse/Collapse.d.ts +15 -3
- package/dist/lib/components/Collapse/Collapse.js +13 -4
- package/dist/lib/components/ContentArea/ContentArea.css +18 -28
- package/dist/lib/components/ContentArea/ContentArea.d.ts +2 -7
- package/dist/lib/components/ContentArea/ContentArea.js +5 -42
- package/dist/lib/components/Counter/Counter.css +14 -11
- package/dist/lib/components/Counter/Counter.js +3 -3
- package/dist/lib/components/Grid/GridColumn.css +0 -7
- package/dist/lib/components/Header/Header.css +8 -12
- package/dist/lib/components/Header/Header.d.ts +7 -21
- package/dist/lib/components/Header/Header.js +31 -98
- package/dist/lib/components/InputLabel/InputLabel.css +0 -7
- package/dist/lib/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/lib/components/InputLabel/InputLabel.js +11 -3
- package/dist/lib/components/Link/Link.d.ts +3 -3
- package/dist/lib/components/Link/Link.js +44 -26
- package/dist/lib/components/List/List.css +9 -13
- package/dist/lib/components/List/List.d.ts +1 -1
- package/dist/lib/components/List/List.js +2 -2
- package/dist/lib/components/List/ListItem.css +0 -7
- package/dist/lib/components/Logo/Logo.css +0 -7
- package/dist/lib/components/Logo/Logo.js +4 -8
- package/dist/lib/components/NavArrow/NavArrow.css +5 -12
- package/dist/lib/components/Notification/Notification.css +41 -24
- package/dist/lib/components/Notification/Notification.d.ts +8 -0
- package/dist/lib/components/Notification/Notification.js +20 -3
- package/dist/lib/components/Pagination/Pagination.css +0 -7
- package/dist/lib/components/Pagination/Pagination.d.ts +9 -2
- package/dist/lib/components/Pagination/Pagination.js +20 -2
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +12 -6
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +9 -1
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/lib/components/Pagination/helpers.d.ts +1 -1
- package/dist/lib/components/Paragraph/Paragraph.css +10 -31
- package/dist/lib/components/Paragraph/Paragraph.d.ts +9 -13
- package/dist/lib/components/Paragraph/Paragraph.js +15 -41
- package/dist/lib/components/Preloader/Preloader.css +5 -12
- package/dist/lib/components/Preloader/Preloader.d.ts +4 -0
- package/dist/lib/components/Preloader/Preloader.js +10 -4
- package/dist/lib/components/RadioButton/RadioButton.css +7 -14
- package/dist/lib/components/RadioButton/RadioButton.d.ts +8 -28
- package/dist/lib/components/RadioButton/RadioButton.js +51 -117
- package/dist/lib/components/Search/Search.css +20 -25
- package/dist/lib/components/Search/Search.js +3 -4
- package/dist/lib/components/Select/Select.css +34 -37
- package/dist/lib/components/Select/Select.d.ts +43 -50
- package/dist/lib/components/Select/Select.js +375 -483
- package/dist/lib/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/lib/components/Select/reducer/selectReducer.js +136 -0
- package/dist/lib/components/Switcher/Switcher.css +18 -28
- package/dist/lib/components/Switcher/Switcher.js +1 -1
- package/dist/lib/components/Tabs/Tab.d.ts +5 -2
- package/dist/lib/components/Tabs/Tab.js +4 -2
- package/dist/lib/components/Tabs/Tabs.css +30 -37
- package/dist/lib/components/Tabs/Tabs.d.ts +8 -0
- package/dist/lib/components/Tabs/Tabs.js +38 -31
- package/dist/lib/components/TextField/TextField.css +27 -33
- package/dist/lib/components/TextField/TextField.d.ts +9 -3
- package/dist/lib/components/TextField/TextField.js +30 -23
- package/dist/lib/components/TextLink/TextLink.css +10 -14
- package/dist/lib/components/TextLink/TextLink.d.ts +1 -1
- package/dist/lib/components/TextLink/TextLink.js +7 -2
- package/dist/lib/components/Tile/Tile.css +2 -8
- package/dist/lib/components/Tile/Tile.d.ts +5 -2
- package/dist/lib/components/Tile/Tile.js +2 -2
- package/dist/lib/components/Tooltip/Tooltip.css +1 -8
- package/dist/lib/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/lib/components/Tooltip/Tooltip.js +27 -26
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +8 -0
- package/package.json +5 -4
- package/styles/base.less +2 -73
- package/styles/colors.css +60 -0
- package/styles/colorsDark.css +62 -0
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
9
11
|
|
|
10
12
|
var _uiHelpers = require("@megafon/ui-helpers");
|
|
@@ -25,13 +27,14 @@ var PaginationButton = function PaginationButton(_ref) {
|
|
|
25
27
|
className = _ref.className,
|
|
26
28
|
children = _ref.children,
|
|
27
29
|
onClick = _ref.onClick,
|
|
28
|
-
value = _ref.value
|
|
30
|
+
value = _ref.value,
|
|
31
|
+
dataAttrs = _ref.dataAttrs;
|
|
29
32
|
|
|
30
33
|
var handleClick = function handleClick() {
|
|
31
|
-
onClick
|
|
34
|
+
onClick && onClick(value);
|
|
32
35
|
};
|
|
33
36
|
|
|
34
|
-
return /*#__PURE__*/_react["default"].createElement("button", {
|
|
37
|
+
return /*#__PURE__*/_react["default"].createElement("button", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
35
38
|
className: cn({
|
|
36
39
|
active: isActive,
|
|
37
40
|
theme: theme
|
|
@@ -39,7 +42,7 @@ var PaginationButton = function PaginationButton(_ref) {
|
|
|
39
42
|
disabled: disabled,
|
|
40
43
|
onClick: handleClick,
|
|
41
44
|
type: "button"
|
|
42
|
-
}, children);
|
|
45
|
+
}), children);
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
PaginationButton.propTypes = {
|
|
@@ -47,8 +50,11 @@ PaginationButton.propTypes = {
|
|
|
47
50
|
isActive: _propTypes["default"].bool,
|
|
48
51
|
theme: _propTypes["default"].oneOf(['default', 'light']),
|
|
49
52
|
className: _propTypes["default"].string,
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
value: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),
|
|
54
|
+
dataAttrs: _propTypes["default"].shape({
|
|
55
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
|
56
|
+
}),
|
|
57
|
+
onClick: _propTypes["default"].func
|
|
52
58
|
};
|
|
53
59
|
var _default = PaginationButton;
|
|
54
60
|
exports["default"] = _default;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './PaginationButtons.less';
|
|
3
|
-
interface
|
|
3
|
+
interface IPaginationButtonsProps {
|
|
4
4
|
items: Array<string | number>;
|
|
5
5
|
theme?: 'default' | 'light';
|
|
6
6
|
activeButton: number;
|
|
7
7
|
hiddenButton: string;
|
|
8
|
+
dataAttrs?: {
|
|
9
|
+
root?: Record<string, string>;
|
|
10
|
+
};
|
|
8
11
|
onClick: (value?: number | string) => void;
|
|
9
12
|
}
|
|
10
|
-
declare const PaginationButtons: React.FC<
|
|
13
|
+
declare const PaginationButtons: React.FC<IPaginationButtonsProps>;
|
|
11
14
|
export default PaginationButtons;
|
|
@@ -34,11 +34,13 @@ var PaginationButtons = function PaginationButtons(_ref) {
|
|
|
34
34
|
theme = _ref.theme,
|
|
35
35
|
onClick = _ref.onClick,
|
|
36
36
|
activeButton = _ref.activeButton,
|
|
37
|
-
hiddenButton = _ref.hiddenButton
|
|
37
|
+
hiddenButton = _ref.hiddenButton,
|
|
38
|
+
dataAttrs = _ref.dataAttrs;
|
|
38
39
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
39
40
|
className: cn()
|
|
40
41
|
}, items.map(function (pageNumber, index) {
|
|
41
42
|
var isHiddenButton = hiddenButton === pageNumber;
|
|
43
|
+
var dataIndex = typeof pageNumber === 'number' ? pageNumber : undefined;
|
|
42
44
|
|
|
43
45
|
if (isHiddenButton) {
|
|
44
46
|
return /*#__PURE__*/_react["default"].createElement(_PaginationButton["default"], {
|
|
@@ -51,6 +53,9 @@ var PaginationButtons = function PaginationButtons(_ref) {
|
|
|
51
53
|
|
|
52
54
|
var isActive = pageNumber === activeButton;
|
|
53
55
|
return /*#__PURE__*/_react["default"].createElement(_PaginationButton["default"], {
|
|
56
|
+
dataAttrs: {
|
|
57
|
+
root: (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, dataIndex)
|
|
58
|
+
},
|
|
54
59
|
isActive: isActive,
|
|
55
60
|
key: index,
|
|
56
61
|
className: cn('button'),
|
|
@@ -66,6 +71,9 @@ PaginationButtons.propTypes = {
|
|
|
66
71
|
theme: _propTypes["default"].oneOf(['default', 'light']),
|
|
67
72
|
activeButton: _propTypes["default"].number.isRequired,
|
|
68
73
|
hiddenButton: _propTypes["default"].string.isRequired,
|
|
74
|
+
dataAttrs: _propTypes["default"].shape({
|
|
75
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
|
76
|
+
}),
|
|
69
77
|
onClick: _propTypes["default"].func.isRequired
|
|
70
78
|
};
|
|
71
79
|
var _default = PaginationButtons;
|
package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './PaginationNavigation.less';
|
|
3
|
-
interface
|
|
3
|
+
interface IPaginationNavigationProps {
|
|
4
4
|
direction?: 'left' | 'right';
|
|
5
5
|
theme?: 'default' | 'light';
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
isActive?: boolean;
|
|
8
8
|
className?: string;
|
|
9
|
+
dataAttrs?: {
|
|
10
|
+
root?: Record<string, string>;
|
|
11
|
+
};
|
|
9
12
|
onClick?: (value?: number | string) => void;
|
|
10
13
|
}
|
|
11
|
-
declare const PaginationNavigation: React.FC<
|
|
14
|
+
declare const PaginationNavigation: React.FC<IPaginationNavigationProps>;
|
|
12
15
|
export default PaginationNavigation;
|
package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js
CHANGED
|
@@ -34,8 +34,10 @@ var PaginationNavigation = function PaginationNavigation(_ref) {
|
|
|
34
34
|
disabled = _ref.disabled,
|
|
35
35
|
isActive = _ref.isActive,
|
|
36
36
|
onClick = _ref.onClick,
|
|
37
|
-
className = _ref.className
|
|
37
|
+
className = _ref.className,
|
|
38
|
+
dataAttrs = _ref.dataAttrs;
|
|
38
39
|
return /*#__PURE__*/_react["default"].createElement(_PaginationButton["default"], {
|
|
40
|
+
dataAttrs: dataAttrs,
|
|
39
41
|
className: cn({
|
|
40
42
|
direction: direction
|
|
41
43
|
}, className),
|
|
@@ -54,6 +56,9 @@ PaginationNavigation.propTypes = {
|
|
|
54
56
|
disabled: _propTypes["default"].bool,
|
|
55
57
|
isActive: _propTypes["default"].bool,
|
|
56
58
|
className: _propTypes["default"].string,
|
|
59
|
+
dataAttrs: _propTypes["default"].shape({
|
|
60
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
|
61
|
+
}),
|
|
57
62
|
onClick: _propTypes["default"].func
|
|
58
63
|
};
|
|
59
64
|
var _default = PaginationNavigation;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const getRange: (from:
|
|
1
|
+
declare const getRange: (from: any, to: any, step?: number) => number[];
|
|
2
2
|
export default getRange;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-paragraph {
|
|
9
2
|
font-family: inherit;
|
|
10
3
|
margin: 0;
|
|
@@ -30,32 +23,18 @@ h5 {
|
|
|
30
23
|
.mfui-paragraph_has-margin {
|
|
31
24
|
margin: 0 0 16px;
|
|
32
25
|
}
|
|
33
|
-
.mfui-
|
|
34
|
-
color:
|
|
35
|
-
}
|
|
36
|
-
.mfui-paragraph_color_purple {
|
|
37
|
-
color: #731982;
|
|
38
|
-
}
|
|
39
|
-
.mfui-paragraph_color_base,
|
|
40
|
-
.mfui-paragraph_color_clearWhite {
|
|
41
|
-
color: #FFFFFF;
|
|
42
|
-
}
|
|
43
|
-
.mfui-paragraph_color_spbSky0 {
|
|
44
|
-
color: #F6F6F6;
|
|
45
|
-
}
|
|
46
|
-
.mfui-paragraph_color_spbSky1 {
|
|
47
|
-
color: #EDEDED;
|
|
26
|
+
.mfui-paragraph_color_inherit {
|
|
27
|
+
color: inherit;
|
|
48
28
|
}
|
|
49
|
-
.mfui-
|
|
50
|
-
color:
|
|
29
|
+
.mfui-paragraph_color_default {
|
|
30
|
+
color: var(--content);
|
|
51
31
|
}
|
|
52
|
-
.mfui-
|
|
53
|
-
|
|
54
|
-
color: #333333;
|
|
32
|
+
.mfui-paragraph_color_white {
|
|
33
|
+
color: var(--stcWhite);
|
|
55
34
|
}
|
|
56
|
-
.mfui-
|
|
57
|
-
color:
|
|
35
|
+
.mfui-paragraph_color_green {
|
|
36
|
+
color: var(--brandGreen);
|
|
58
37
|
}
|
|
59
|
-
.mfui-
|
|
60
|
-
color:
|
|
38
|
+
.mfui-paragraph_color_purple {
|
|
39
|
+
color: var(--brandPurple);
|
|
61
40
|
}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import './Paragraph.less';
|
|
3
3
|
declare const COLORS: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
SPB_SKY_2: string;
|
|
10
|
-
CONTENT: string;
|
|
11
|
-
FULL_BLACK: string;
|
|
12
|
-
INHERIT: string;
|
|
13
|
-
/** @deprecated */
|
|
14
|
-
CLEAR_WHITE: string;
|
|
15
|
-
/** @deprecated */
|
|
16
|
-
FRESH_ASPHALT: string;
|
|
4
|
+
readonly INHERIT: "inherit";
|
|
5
|
+
readonly DEFAULT: "default";
|
|
6
|
+
readonly WHITE: "white";
|
|
7
|
+
readonly GREEN: "green";
|
|
8
|
+
readonly PURPLE: "purple";
|
|
17
9
|
};
|
|
18
10
|
declare type ColorType = typeof COLORS[keyof typeof COLORS];
|
|
19
11
|
export interface IParagraphProps {
|
|
@@ -27,6 +19,10 @@ export interface IParagraphProps {
|
|
|
27
19
|
color?: ColorType;
|
|
28
20
|
/** Дополнительный класс корневого элемента */
|
|
29
21
|
className?: string;
|
|
22
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
23
|
+
dataAttrs?: {
|
|
24
|
+
root?: Record<string, string>;
|
|
25
|
+
};
|
|
30
26
|
}
|
|
31
27
|
declare const Paragraph: React.FC<IParagraphProps>;
|
|
32
28
|
export default Paragraph;
|
|
@@ -7,13 +7,9 @@ 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
10
|
require("core-js/modules/es.object.values");
|
|
15
11
|
|
|
16
|
-
require("
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
13
|
|
|
18
14
|
var React = _interopRequireWildcard(require("react"));
|
|
19
15
|
|
|
@@ -25,22 +21,14 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
25
21
|
|
|
26
22
|
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; }
|
|
27
23
|
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
28
26
|
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
27
|
INHERIT: 'inherit',
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/** @deprecated */
|
|
43
|
-
FRESH_ASPHALT: 'freshAsphalt'
|
|
28
|
+
DEFAULT: 'default',
|
|
29
|
+
WHITE: 'white',
|
|
30
|
+
GREEN: 'green',
|
|
31
|
+
PURPLE: 'purple'
|
|
44
32
|
};
|
|
45
33
|
var cn = (0, _uiHelpers.cnCreate)('mfui-paragraph');
|
|
46
34
|
|
|
@@ -49,44 +37,30 @@ var Paragraph = function Paragraph(_ref) {
|
|
|
49
37
|
size = _ref$size === void 0 ? 'regular' : _ref$size,
|
|
50
38
|
align = _ref.align,
|
|
51
39
|
_ref$color = _ref.color,
|
|
52
|
-
color = _ref$color === void 0 ?
|
|
40
|
+
color = _ref$color === void 0 ? COLORS.DEFAULT : _ref$color,
|
|
53
41
|
className = _ref.className,
|
|
54
42
|
_ref$hasMargin = _ref.hasMargin,
|
|
55
43
|
hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
|
|
44
|
+
dataAttrs = _ref.dataAttrs,
|
|
56
45
|
children = _ref.children;
|
|
57
|
-
return /*#__PURE__*/React.createElement("p", {
|
|
46
|
+
return /*#__PURE__*/React.createElement("p", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
58
47
|
className: cn({
|
|
59
48
|
size: size,
|
|
60
49
|
align: align,
|
|
61
50
|
color: color,
|
|
62
51
|
'has-margin': hasMargin
|
|
63
52
|
}, className)
|
|
64
|
-
}, children);
|
|
53
|
+
}), children);
|
|
65
54
|
};
|
|
66
55
|
|
|
67
56
|
Paragraph.propTypes = {
|
|
57
|
+
dataAttrs: PropTypes.shape({
|
|
58
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
59
|
+
}),
|
|
68
60
|
align: PropTypes.oneOf(['left', 'center', 'right']),
|
|
69
61
|
size: PropTypes.oneOf(['regular', 'small']),
|
|
70
62
|
hasMargin: PropTypes.bool,
|
|
71
|
-
color:
|
|
72
|
-
var deprecatedBlackValue = COLORS.FRESH_ASPHALT;
|
|
73
|
-
var deprecatedWhiteValue = COLORS.CLEAR_WHITE;
|
|
74
|
-
var propValue = props[propName];
|
|
75
|
-
|
|
76
|
-
if (propValue && !Object.values(COLORS).includes(propValue)) {
|
|
77
|
-
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), "]"));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (propValue && props[propName] === deprecatedBlackValue) {
|
|
81
|
-
return new Error("Failed prop type: Invalid prop '".concat(propName, "' of value '").concat(propValue, "' supplied to '").concat(componentName, "',\n value '").concat(deprecatedBlackValue, "' is deprecated, please use value '").concat(COLORS.CONTENT, "'"));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (propValue && props[propName] === deprecatedWhiteValue) {
|
|
85
|
-
return new Error("Failed prop type: Invalid prop '".concat(propName, "' of value '").concat(propValue, "' supplied to '").concat(componentName, "',\n value '").concat(deprecatedWhiteValue, "' is deprecated, please use value '").concat(COLORS.BASE, "'"));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
63
|
+
color: PropTypes.oneOf(Object.values(COLORS))
|
|
90
64
|
};
|
|
91
65
|
var _default = Paragraph;
|
|
92
66
|
exports["default"] = _default;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-preloader {
|
|
9
2
|
display: -webkit-box;
|
|
10
3
|
display: -ms-flexbox;
|
|
@@ -106,20 +99,20 @@ h5 {
|
|
|
106
99
|
animation: scaling 1s linear infinite;
|
|
107
100
|
}
|
|
108
101
|
.mfui-preloader_color_default .mfui-preloader__item_first:before {
|
|
109
|
-
background-color:
|
|
102
|
+
background-color: var(--brandGreen);
|
|
110
103
|
}
|
|
111
104
|
.mfui-preloader_color_default .mfui-preloader__item_second:before {
|
|
112
|
-
background-color:
|
|
105
|
+
background-color: var(--brandGreen);
|
|
113
106
|
-webkit-animation-delay: 0.166s;
|
|
114
107
|
animation-delay: 0.166s;
|
|
115
108
|
}
|
|
116
109
|
.mfui-preloader_color_default .mfui-preloader__item_third:before {
|
|
117
|
-
background-color:
|
|
110
|
+
background-color: var(--brandPurple);
|
|
118
111
|
-webkit-animation-delay: 0.33s;
|
|
119
112
|
animation-delay: 0.33s;
|
|
120
113
|
}
|
|
121
114
|
.mfui-preloader_color_black .mfui-preloader__item:before {
|
|
122
|
-
background-color:
|
|
115
|
+
background-color: var(--stcBlack);
|
|
123
116
|
opacity: 0.35;
|
|
124
117
|
-webkit-animation: opacityScaling 1s linear infinite;
|
|
125
118
|
animation: opacityScaling 1s linear infinite;
|
|
@@ -133,7 +126,7 @@ h5 {
|
|
|
133
126
|
animation-delay: 0.33s;
|
|
134
127
|
}
|
|
135
128
|
.mfui-preloader_color_white .mfui-preloader__item:before {
|
|
136
|
-
background-color:
|
|
129
|
+
background-color: var(--stcWhite);
|
|
137
130
|
-webkit-animation: scaling 1s linear infinite;
|
|
138
131
|
animation: scaling 1s linear infinite;
|
|
139
132
|
}
|
|
@@ -26,6 +26,10 @@ export interface IPreloaderProps {
|
|
|
26
26
|
sizeMobile?: PreloaderSizesType;
|
|
27
27
|
/** Дополнительный класс корневого элемента */
|
|
28
28
|
className?: string;
|
|
29
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
30
|
+
dataAttrs?: {
|
|
31
|
+
root?: Record<string, string>;
|
|
32
|
+
};
|
|
29
33
|
}
|
|
30
34
|
declare const Preloader: React.FC<IPreloaderProps>;
|
|
31
35
|
export default Preloader;
|
|
@@ -11,6 +11,8 @@ require("core-js/modules/es.object.values");
|
|
|
11
11
|
|
|
12
12
|
require("core-js/modules/web.timers");
|
|
13
13
|
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
|
|
14
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
17
|
|
|
16
18
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -47,7 +49,8 @@ var Preloader = function Preloader(_ref) {
|
|
|
47
49
|
sizeDesktop = _ref.sizeDesktop,
|
|
48
50
|
sizeTablet = _ref.sizeTablet,
|
|
49
51
|
sizeMobile = _ref.sizeMobile,
|
|
50
|
-
className = _ref.className
|
|
52
|
+
className = _ref.className,
|
|
53
|
+
dataAttrs = _ref.dataAttrs;
|
|
51
54
|
|
|
52
55
|
var _React$useState = React.useState(false),
|
|
53
56
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
@@ -62,7 +65,7 @@ var Preloader = function Preloader(_ref) {
|
|
|
62
65
|
clearTimeout(timerId);
|
|
63
66
|
};
|
|
64
67
|
}, []);
|
|
65
|
-
return isShowed ? /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
return isShowed ? /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
66
69
|
className: cn({
|
|
67
70
|
color: color,
|
|
68
71
|
'size-all': sizeAll,
|
|
@@ -71,7 +74,7 @@ var Preloader = function Preloader(_ref) {
|
|
|
71
74
|
'size-tablet': sizeTablet,
|
|
72
75
|
'size-mobile': sizeMobile
|
|
73
76
|
}, className)
|
|
74
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
75
78
|
className: cn('item', {
|
|
76
79
|
first: true
|
|
77
80
|
})
|
|
@@ -93,7 +96,10 @@ Preloader.propTypes = {
|
|
|
93
96
|
sizeDesktop: PropTypes.oneOf(Object.values(PreloaderSizes)),
|
|
94
97
|
sizeTablet: PropTypes.oneOf(Object.values(PreloaderSizes)),
|
|
95
98
|
sizeMobile: PropTypes.oneOf(Object.values(PreloaderSizes)),
|
|
96
|
-
className: PropTypes.string
|
|
99
|
+
className: PropTypes.string,
|
|
100
|
+
dataAttrs: PropTypes.shape({
|
|
101
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
102
|
+
})
|
|
97
103
|
};
|
|
98
104
|
var _default = Preloader;
|
|
99
105
|
exports["default"] = _default;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-radio-button__input {
|
|
9
2
|
position: absolute;
|
|
10
3
|
top: 0;
|
|
@@ -48,22 +41,22 @@ h5 {
|
|
|
48
41
|
box-sizing: border-box;
|
|
49
42
|
width: 20px;
|
|
50
43
|
height: 20px;
|
|
51
|
-
border: 2px solid
|
|
44
|
+
border: 2px solid var(--spbSky2);
|
|
52
45
|
border-radius: 50%;
|
|
53
|
-
background-color:
|
|
46
|
+
background-color: var(--base);
|
|
54
47
|
}
|
|
55
48
|
.mfui-radio-button__input:checked + .mfui-radio-button__custom-input:before {
|
|
56
|
-
border: 6px solid
|
|
49
|
+
border: 6px solid var(--brandGreen);
|
|
57
50
|
}
|
|
58
51
|
.mfui-radio-button__label:hover .mfui-radio-button__custom-input:before {
|
|
59
|
-
border-color:
|
|
52
|
+
border-color: var(--buttonHoverGreen);
|
|
60
53
|
}
|
|
61
54
|
.mfui-radio-button__label:active .mfui-radio-button__custom-input:before {
|
|
62
|
-
border-color:
|
|
55
|
+
border-color: var(--buttonDown);
|
|
63
56
|
}
|
|
64
57
|
.mfui-radio-button__label_disabled .mfui-radio-button__custom-input:before {
|
|
65
|
-
border-color:
|
|
66
|
-
background-color:
|
|
58
|
+
border-color: var(--spbSky2) !important;
|
|
59
|
+
background-color: var(--spbSky1) !important;
|
|
67
60
|
}
|
|
68
61
|
.mfui-radio-button__text_size_small {
|
|
69
62
|
font-size: 12px;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { IFilterDataAttrs } from '@megafon/ui-helpers';
|
|
3
|
-
import * as PropTypes from 'prop-types';
|
|
4
2
|
import './RadioButton.less';
|
|
5
|
-
export interface IRadioButtonProps
|
|
3
|
+
export interface IRadioButtonProps {
|
|
6
4
|
/** Значение */
|
|
7
5
|
value: string;
|
|
8
6
|
/** Имя для тега form */
|
|
@@ -22,35 +20,17 @@ export interface IRadioButtonProps extends IFilterDataAttrs {
|
|
|
22
20
|
customInput?: string;
|
|
23
21
|
labelText?: string;
|
|
24
22
|
};
|
|
23
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
24
|
+
dataAttrs?: {
|
|
25
|
+
root?: Record<string, string>;
|
|
26
|
+
input?: Record<string, string>;
|
|
27
|
+
text?: Record<string, string>;
|
|
28
|
+
};
|
|
25
29
|
children?: React.ReactNode;
|
|
26
30
|
/** Обработчик изменения значения 'value' */
|
|
27
31
|
onChange?: (value: string) => void;
|
|
28
32
|
/** Ссылка на input */
|
|
29
33
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
30
34
|
}
|
|
31
|
-
declare
|
|
32
|
-
static propTypes: {
|
|
33
|
-
value: PropTypes.Validator<string>;
|
|
34
|
-
name: PropTypes.Requireable<string>;
|
|
35
|
-
textSize: PropTypes.Requireable<string>;
|
|
36
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
37
|
-
isChecked: PropTypes.Requireable<boolean>;
|
|
38
|
-
className: PropTypes.Requireable<string>;
|
|
39
|
-
classes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
40
|
-
root: PropTypes.Requireable<string>;
|
|
41
|
-
label: PropTypes.Requireable<string>;
|
|
42
|
-
customInput: PropTypes.Requireable<string>;
|
|
43
|
-
labelText: PropTypes.Requireable<string>;
|
|
44
|
-
}>>;
|
|
45
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
46
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
-
inputRef: PropTypes.Requireable<any>;
|
|
48
|
-
dataAttrs: PropTypes.Requireable<{
|
|
49
|
-
[x: string]: string;
|
|
50
|
-
}>;
|
|
51
|
-
};
|
|
52
|
-
static defaultProps: Partial<IRadioButtonProps>;
|
|
53
|
-
handleChange: () => void;
|
|
54
|
-
render(): JSX.Element;
|
|
55
|
-
}
|
|
35
|
+
declare const RadioButton: React.FC<IRadioButtonProps>;
|
|
56
36
|
export default RadioButton;
|