@megafon/ui-core 3.0.0-beta.3 → 3.0.0-beta.7
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 +63 -0
- package/dist/es/colors/Colors.js +13 -0
- package/dist/es/components/Accordion/Accordion.d.ts +11 -3
- package/dist/es/components/Accordion/Accordion.js +14 -7
- package/dist/es/components/Banner/Banner.d.ts +10 -0
- package/dist/es/components/Banner/Banner.js +25 -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.d.ts +8 -2
- package/dist/es/components/Button/Button.js +14 -6
- package/dist/es/components/Carousel/Carousel.d.ts +9 -2
- package/dist/es/components/Carousel/Carousel.js +14 -8
- package/dist/es/components/Checkbox/Checkbox.d.ts +8 -2
- package/dist/es/components/Checkbox/Checkbox.js +12 -7
- 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 +8 -59
- package/dist/es/components/ContentArea/ContentArea.d.ts +2 -6
- package/dist/es/components/ContentArea/ContentArea.js +5 -38
- package/dist/es/components/Counter/Counter.css +0 -47
- package/dist/es/components/Grid/Grid.css +0 -47
- package/dist/es/components/Header/Header.d.ts +6 -20
- package/dist/es/components/Header/Header.js +30 -66
- 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 +6 -2
- package/dist/es/components/Link/Link.js +28 -4
- package/dist/es/components/Notification/Notification.css +0 -47
- 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.d.ts +9 -2
- package/dist/es/components/Pagination/Pagination.js +20 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +0 -47
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +11 -6
- 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.css +0 -47
- 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/Paragraph/Paragraph.css +9 -11
- package/dist/es/components/Paragraph/Paragraph.d.ts +12 -12
- package/dist/es/components/Paragraph/Paragraph.js +14 -36
- 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.d.ts +8 -28
- package/dist/es/components/RadioButton/RadioButton.js +50 -85
- package/dist/es/components/Select/Select.d.ts +38 -5
- package/dist/es/components/Select/Select.js +50 -34
- 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.d.ts +8 -0
- package/dist/es/components/Tabs/Tabs.js +29 -21
- package/dist/es/components/TextField/TextField.d.ts +8 -0
- package/dist/es/components/TextField/TextField.js +22 -10
- package/dist/es/components/TextLink/TextLink.js +7 -2
- package/dist/es/components/Tile/Tile.d.ts +5 -2
- package/dist/es/components/Tile/Tile.js +1 -1
- package/dist/es/components/Tooltip/Tooltip.d.ts +5 -0
- package/dist/es/components/Tooltip/Tooltip.js +10 -2
- package/dist/lib/colors/Colors.js +10 -0
- package/dist/lib/components/Accordion/Accordion.d.ts +11 -3
- package/dist/lib/components/Accordion/Accordion.js +14 -7
- package/dist/lib/components/Banner/Banner.d.ts +10 -0
- package/dist/lib/components/Banner/Banner.js +25 -10
- 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.d.ts +8 -2
- package/dist/lib/components/Button/Button.js +14 -6
- package/dist/lib/components/Carousel/Carousel.d.ts +9 -2
- package/dist/lib/components/Carousel/Carousel.js +14 -8
- package/dist/lib/components/Checkbox/Checkbox.d.ts +8 -2
- package/dist/lib/components/Checkbox/Checkbox.js +12 -7
- 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 +8 -59
- package/dist/lib/components/ContentArea/ContentArea.d.ts +2 -6
- package/dist/lib/components/ContentArea/ContentArea.js +5 -41
- package/dist/lib/components/Counter/Counter.css +0 -47
- package/dist/lib/components/Grid/Grid.css +0 -47
- package/dist/lib/components/Header/Header.d.ts +6 -20
- package/dist/lib/components/Header/Header.js +30 -97
- 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 +6 -2
- package/dist/lib/components/Link/Link.js +33 -4
- package/dist/lib/components/Notification/Notification.css +0 -47
- 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.d.ts +9 -2
- package/dist/lib/components/Pagination/Pagination.js +20 -2
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +0 -47
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +11 -5
- 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.css +0 -47
- 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/Paragraph/Paragraph.css +9 -11
- package/dist/lib/components/Paragraph/Paragraph.d.ts +12 -12
- package/dist/lib/components/Paragraph/Paragraph.js +15 -37
- 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.d.ts +8 -28
- package/dist/lib/components/RadioButton/RadioButton.js +51 -117
- package/dist/lib/components/Select/Select.d.ts +38 -5
- package/dist/lib/components/Select/Select.js +50 -34
- 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.d.ts +8 -0
- package/dist/lib/components/Tabs/Tabs.js +29 -21
- package/dist/lib/components/TextField/TextField.d.ts +8 -0
- package/dist/lib/components/TextField/TextField.js +20 -9
- package/dist/lib/components/TextLink/TextLink.js +7 -2
- package/dist/lib/components/Tile/Tile.d.ts +5 -2
- package/dist/lib/components/Tile/Tile.js +1 -1
- package/dist/lib/components/Tooltip/Tooltip.d.ts +5 -0
- package/dist/lib/components/Tooltip/Tooltip.js +9 -1
- package/package.json +5 -4
- package/styles/base.less +1 -60
- package/styles/colors.css +60 -0
- package/styles/colorsDark.css +62 -0
- package/styles/base.css +0 -54
|
@@ -7,26 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
-
require("core-js/modules/es.date.to-string");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.object.to-string");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.reflect.construct");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/es.regexp.to-string");
|
|
17
|
-
|
|
18
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
19
11
|
|
|
20
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
-
|
|
22
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
|
-
|
|
24
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
25
|
-
|
|
26
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
27
|
-
|
|
28
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
|
-
|
|
30
12
|
var React = _interopRequireWildcard(require("react"));
|
|
31
13
|
|
|
32
14
|
var _uiHelpers = require("@megafon/ui-helpers");
|
|
@@ -39,79 +21,34 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
39
21
|
|
|
40
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
41
23
|
|
|
42
|
-
function _createSuper(Derived) {
|
|
43
|
-
return function () {
|
|
44
|
-
var Super = (0, _getPrototypeOf2["default"])(Derived),
|
|
45
|
-
result;
|
|
46
|
-
|
|
47
|
-
if (_isNativeReflectConstruct()) {
|
|
48
|
-
var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor;
|
|
49
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
50
|
-
} else {
|
|
51
|
-
result = Super.apply(this, arguments);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return (0, _possibleConstructorReturn2["default"])(this, result);
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _isNativeReflectConstruct() {
|
|
59
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
60
|
-
if (Reflect.construct.sham) return false;
|
|
61
|
-
if (typeof Proxy === "function") return true;
|
|
62
|
-
|
|
63
|
-
try {
|
|
64
|
-
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
|
65
|
-
return true;
|
|
66
|
-
} catch (e) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
24
|
var cn = (0, _uiHelpers.cnCreate)('mfui-header');
|
|
72
25
|
|
|
73
|
-
var Header =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
dataAttrs = _this$props.dataAttrs,
|
|
100
|
-
className = _this$props.className;
|
|
101
|
-
var ElementType = level;
|
|
102
|
-
return /*#__PURE__*/React.createElement(ElementType, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs), {
|
|
103
|
-
className: cn({
|
|
104
|
-
color: color,
|
|
105
|
-
margin: margin,
|
|
106
|
-
level: level,
|
|
107
|
-
'h-align': hAlign
|
|
108
|
-
}, className),
|
|
109
|
-
onClick: onClick
|
|
110
|
-
}), this.props.children, this.props.addition && this.renderAddition());
|
|
111
|
-
}
|
|
112
|
-
}]);
|
|
113
|
-
return Header;
|
|
114
|
-
}(React.Component);
|
|
26
|
+
var Header = function Header(_ref) {
|
|
27
|
+
var addition = _ref.addition,
|
|
28
|
+
_ref$as = _ref.as,
|
|
29
|
+
level = _ref$as === void 0 ? 'h1' : _ref$as,
|
|
30
|
+
children = _ref.children,
|
|
31
|
+
className = _ref.className,
|
|
32
|
+
_ref$color = _ref.color,
|
|
33
|
+
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
34
|
+
dataAttrs = _ref.dataAttrs,
|
|
35
|
+
_ref$hAlign = _ref.hAlign,
|
|
36
|
+
hAlign = _ref$hAlign === void 0 ? 'inherit' : _ref$hAlign,
|
|
37
|
+
margin = _ref.margin,
|
|
38
|
+
onClick = _ref.onClick;
|
|
39
|
+
var ElementType = level;
|
|
40
|
+
return /*#__PURE__*/React.createElement(ElementType, (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
41
|
+
className: cn({
|
|
42
|
+
color: color,
|
|
43
|
+
margin: margin,
|
|
44
|
+
level: level,
|
|
45
|
+
'h-align': hAlign
|
|
46
|
+
}, className),
|
|
47
|
+
onClick: onClick
|
|
48
|
+
}), children, addition && /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: cn('addition')
|
|
50
|
+
}, addition));
|
|
51
|
+
};
|
|
115
52
|
|
|
116
53
|
Header.propTypes = {
|
|
117
54
|
as: PropTypes.oneOf(['h1', 'h2', 'h3', 'h5']),
|
|
@@ -119,14 +56,10 @@ Header.propTypes = {
|
|
|
119
56
|
margin: PropTypes.bool,
|
|
120
57
|
addition: PropTypes.element,
|
|
121
58
|
hAlign: PropTypes.oneOf(['inherit', 'left', 'center', 'right']),
|
|
122
|
-
dataAttrs: PropTypes.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
Header.defaultProps = {
|
|
127
|
-
as: 'h1',
|
|
128
|
-
color: 'default',
|
|
129
|
-
hAlign: 'inherit'
|
|
59
|
+
dataAttrs: PropTypes.shape({
|
|
60
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
61
|
+
}),
|
|
62
|
+
onClick: PropTypes.func
|
|
130
63
|
};
|
|
131
64
|
var _default = Header;
|
|
132
65
|
exports["default"] = _default;
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
10
12
|
var React = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
12
14
|
var _uiHelpers = require("@megafon/ui-helpers");
|
|
@@ -17,19 +19,25 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
17
19
|
|
|
18
20
|
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
21
|
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
20
24
|
var cn = (0, _uiHelpers.cnCreate)('mfui-input-label');
|
|
21
25
|
|
|
22
26
|
var InputLabel = function InputLabel(_ref) {
|
|
23
27
|
var htmlFor = _ref.htmlFor,
|
|
28
|
+
dataAttrs = _ref.dataAttrs,
|
|
24
29
|
children = _ref.children;
|
|
25
|
-
return /*#__PURE__*/React.createElement("label", {
|
|
30
|
+
return /*#__PURE__*/React.createElement("label", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
26
31
|
htmlFor: htmlFor,
|
|
27
32
|
className: cn()
|
|
28
|
-
}, children);
|
|
33
|
+
}), children);
|
|
29
34
|
};
|
|
30
35
|
|
|
31
36
|
InputLabel.propTypes = {
|
|
32
|
-
htmlFor: PropTypes.string
|
|
37
|
+
htmlFor: PropTypes.string,
|
|
38
|
+
dataAttrs: PropTypes.shape({
|
|
39
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
40
|
+
})
|
|
33
41
|
};
|
|
34
42
|
var _default = InputLabel;
|
|
35
43
|
exports["default"] = _default;
|
|
@@ -8,11 +8,15 @@ export interface ILinkProps {
|
|
|
8
8
|
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
9
9
|
/** rel - аргумент тега <a> */
|
|
10
10
|
rel?: string;
|
|
11
|
-
/** Обработчик клика */
|
|
12
|
-
onClick?: (e: React.MouseEvent<EventTarget>) => void;
|
|
13
11
|
/** Добавление атрибута download */
|
|
14
12
|
download?: boolean;
|
|
13
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
14
|
+
dataAttrs?: {
|
|
15
|
+
root?: Record<string, string>;
|
|
16
|
+
};
|
|
15
17
|
children?: JSX.Element[] | Element[] | JSX.Element | string | Element | React.ReactNode;
|
|
18
|
+
/** Обработчик клика */
|
|
19
|
+
onClick?: (e: React.MouseEvent<EventTarget>) => void;
|
|
16
20
|
}
|
|
17
21
|
declare const Link: React.FC<ILinkProps>;
|
|
18
22
|
export default Link;
|
|
@@ -7,19 +7,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
require("core-js/modules/es.symbol");
|
|
11
|
+
|
|
12
|
+
require("core-js/modules/es.array.index-of");
|
|
13
|
+
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
|
|
10
16
|
var React = _interopRequireWildcard(require("react"));
|
|
11
17
|
|
|
18
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
|
19
|
+
|
|
12
20
|
var PropTypes = _interopRequireWildcard(require("prop-types"));
|
|
13
21
|
|
|
14
22
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
15
23
|
|
|
16
24
|
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
25
|
|
|
18
|
-
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
|
|
28
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
29
|
+
var t = {};
|
|
30
|
+
|
|
31
|
+
for (var p in s) {
|
|
32
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
36
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
37
|
+
}
|
|
38
|
+
return t;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var Link = function Link(_a) {
|
|
42
|
+
var dataAttrs = _a.dataAttrs,
|
|
43
|
+
props = __rest(_a, ["dataAttrs"]);
|
|
44
|
+
|
|
19
45
|
return (
|
|
20
46
|
/*#__PURE__*/
|
|
21
47
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
22
|
-
React.createElement("a", props)
|
|
48
|
+
React.createElement("a", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), props))
|
|
23
49
|
);
|
|
24
50
|
};
|
|
25
51
|
|
|
@@ -28,9 +54,12 @@ Link.propTypes = {
|
|
|
28
54
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element, PropTypes.string, PropTypes.node]),
|
|
29
55
|
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
30
56
|
className: PropTypes.string,
|
|
57
|
+
dataAttrs: PropTypes.shape({
|
|
58
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
59
|
+
}),
|
|
31
60
|
rel: PropTypes.string,
|
|
32
|
-
|
|
33
|
-
|
|
61
|
+
download: PropTypes.bool,
|
|
62
|
+
onClick: PropTypes.func
|
|
34
63
|
};
|
|
35
64
|
var _default = Link;
|
|
36
65
|
exports["default"] = _default;
|
|
@@ -1,50 +1,3 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--green: #00B956;
|
|
3
|
-
--purple: #731982;
|
|
4
|
-
--base: #FFFFFF;
|
|
5
|
-
--content: #333333;
|
|
6
|
-
--spbSky0: #F6F6F6;
|
|
7
|
-
--spbSky1: #EDEDED;
|
|
8
|
-
--spbSky2: #D8D8D8;
|
|
9
|
-
--spbSky3: #999999;
|
|
10
|
-
--warmRedC: #EB5A40;
|
|
11
|
-
--137C: #FFA717;
|
|
12
|
-
--311C: #5BD9E5;
|
|
13
|
-
--reflexBlue: #444189;
|
|
14
|
-
--fury: #F62434;
|
|
15
|
-
--systemBlue: #34AAF2;
|
|
16
|
-
--background: #FFFFFF;
|
|
17
|
-
--buttonHoverGreen: #10E272;
|
|
18
|
-
--buttonhoverPurple: #534455;
|
|
19
|
-
--buttonDown: #404D46;
|
|
20
|
-
--gradientBasic: linear-gradient(90deg, #01873F 0%, #00B956 74%, #14CD6A 100%);
|
|
21
|
-
--gradientVIP: linear-gradient(90deg, #5B1168 0%, #731982 74%, #821E93 100%);
|
|
22
|
-
--gradientExclusive: linear-gradient(90deg, #2A2674 0%, #444189 74%, #504D93 100%);
|
|
23
|
-
--STCWhite: #FFFFFF;
|
|
24
|
-
--STCBlack: #333333;
|
|
25
|
-
--STCWhite5: #FFFFFF0D;
|
|
26
|
-
--STCWhite10: #FFFFFF1A;
|
|
27
|
-
--STCWhite20: #FFFFFF33;
|
|
28
|
-
--STCWhite50: #FFFFFF80;
|
|
29
|
-
--STCBlack5: #3333330D;
|
|
30
|
-
--STCBlack10: #3333331A;
|
|
31
|
-
--STCBlack20: #33333333;
|
|
32
|
-
--STCBlack50: #33333380;
|
|
33
|
-
--green80: #0CDC78;
|
|
34
|
-
--green20: #DDFFEC;
|
|
35
|
-
--purple80: #AA67C1;
|
|
36
|
-
--purple20: #FFEEFF;
|
|
37
|
-
--warmRedC80: #FF765D;
|
|
38
|
-
--warmRedC20: #FFCFC7;
|
|
39
|
-
--137C80: #FFB945;
|
|
40
|
-
--137C20: #FFEDD1;
|
|
41
|
-
--311C80: #62E3FF;
|
|
42
|
-
--311C20: #E1FAFF;
|
|
43
|
-
--reflexBlue80: #554FC9;
|
|
44
|
-
--reflexBlue20: #EBEAFF;
|
|
45
|
-
--fury80: #F8505D;
|
|
46
|
-
--fury20: #FFC5C9;
|
|
47
|
-
}
|
|
48
1
|
h1,
|
|
49
2
|
h2,
|
|
50
3
|
h3,
|
|
@@ -37,6 +37,14 @@ export interface INotificationProps {
|
|
|
37
37
|
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
38
38
|
/** Иконка */
|
|
39
39
|
icon?: JSX.Element;
|
|
40
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
41
|
+
dataAttrs?: {
|
|
42
|
+
root?: Record<string, string>;
|
|
43
|
+
title?: Record<string, string>;
|
|
44
|
+
text?: Record<string, string>;
|
|
45
|
+
link?: Record<string, string>;
|
|
46
|
+
close?: Record<string, string>;
|
|
47
|
+
};
|
|
40
48
|
/** Обработчик на закрытие */
|
|
41
49
|
onClose?: () => void;
|
|
42
50
|
/** Обработчик клика по ссылке */
|
|
@@ -113,11 +113,15 @@ var Notification = function Notification(_ref) {
|
|
|
113
113
|
href = _ref.href,
|
|
114
114
|
target = _ref.target,
|
|
115
115
|
icon = _ref.icon,
|
|
116
|
+
dataAttrs = _ref.dataAttrs,
|
|
116
117
|
onClose = _ref.onClose,
|
|
117
118
|
onLinkClick = _ref.onLinkClick;
|
|
118
119
|
|
|
119
120
|
var renderLink = function renderLink() {
|
|
120
121
|
return /*#__PURE__*/_react["default"].createElement(_TextLink["default"], {
|
|
122
|
+
dataAttrs: {
|
|
123
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link
|
|
124
|
+
},
|
|
121
125
|
className: cn('link'),
|
|
122
126
|
onClick: onLinkClick,
|
|
123
127
|
rel: rel,
|
|
@@ -153,6 +157,9 @@ var Notification = function Notification(_ref) {
|
|
|
153
157
|
};
|
|
154
158
|
|
|
155
159
|
return /*#__PURE__*/_react["default"].createElement(_Tile["default"], {
|
|
160
|
+
dataAttrs: {
|
|
161
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root
|
|
162
|
+
},
|
|
156
163
|
radius: "rounded",
|
|
157
164
|
shadowLevel: shadowLevel,
|
|
158
165
|
className: cn({
|
|
@@ -166,19 +173,22 @@ var Notification = function Notification(_ref) {
|
|
|
166
173
|
}, renderIcon()), /*#__PURE__*/_react["default"].createElement("div", {
|
|
167
174
|
className: cn('content')
|
|
168
175
|
}, title && /*#__PURE__*/_react["default"].createElement(_Header["default"], {
|
|
176
|
+
dataAttrs: {
|
|
177
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.title
|
|
178
|
+
},
|
|
169
179
|
as: "h5",
|
|
170
180
|
className: cn('title', {
|
|
171
181
|
'close-padding': hasCloseButton
|
|
172
182
|
})
|
|
173
|
-
}, title), /*#__PURE__*/_react["default"].createElement("p", {
|
|
183
|
+
}, title), /*#__PURE__*/_react["default"].createElement("p", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.text), {
|
|
174
184
|
className: cn('text', {
|
|
175
185
|
'close-padding': hasCloseButton && !title
|
|
176
186
|
})
|
|
177
|
-
}, children), link && renderLink())), hasCloseButton && /*#__PURE__*/_react["default"].createElement("button", {
|
|
187
|
+
}), children), link && renderLink())), hasCloseButton && /*#__PURE__*/_react["default"].createElement("button", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.close), {
|
|
178
188
|
className: cn('close'),
|
|
179
189
|
type: "button",
|
|
180
190
|
onClick: onClose
|
|
181
|
-
}, /*#__PURE__*/_react["default"].createElement(CancelIcon, {
|
|
191
|
+
}), /*#__PURE__*/_react["default"].createElement(CancelIcon, {
|
|
182
192
|
className: cn('close-icon')
|
|
183
193
|
})));
|
|
184
194
|
};
|
|
@@ -195,6 +205,13 @@ Notification.propTypes = {
|
|
|
195
205
|
href: PropTypes.string,
|
|
196
206
|
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
197
207
|
icon: PropTypes.element,
|
|
208
|
+
dataAttrs: PropTypes.shape({
|
|
209
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
210
|
+
title: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
211
|
+
text: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
212
|
+
link: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
213
|
+
close: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
214
|
+
}),
|
|
198
215
|
onClose: PropTypes.func,
|
|
199
216
|
onLinkClick: PropTypes.func
|
|
200
217
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Pagination.less';
|
|
3
|
-
interface
|
|
3
|
+
interface IPaginationProps {
|
|
4
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
5
|
+
dataAttrs?: {
|
|
6
|
+
root?: Record<string, string>;
|
|
7
|
+
prev?: Record<string, string>;
|
|
8
|
+
next?: Record<string, string>;
|
|
9
|
+
button?: Record<string, string>;
|
|
10
|
+
};
|
|
4
11
|
/** Общее количество страниц */
|
|
5
12
|
totalPages: number;
|
|
6
13
|
/** Номер текущей страницы */
|
|
@@ -10,5 +17,5 @@ interface IPagination {
|
|
|
10
17
|
/** Обработчик изменения активной страницы */
|
|
11
18
|
onChange: (value: number) => void;
|
|
12
19
|
}
|
|
13
|
-
declare const Pagination: React.FC<
|
|
20
|
+
declare const Pagination: React.FC<IPaginationProps>;
|
|
14
21
|
export default Pagination;
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
10
12
|
var _react = _interopRequireDefault(require("react"));
|
|
11
13
|
|
|
12
14
|
var _uiHelpers = require("@megafon/ui-helpers");
|
|
@@ -30,6 +32,7 @@ var cn = (0, _uiHelpers.cnCreate)('mfui-pagination');
|
|
|
30
32
|
var Pagination = function Pagination(_ref) {
|
|
31
33
|
var totalPages = _ref.totalPages,
|
|
32
34
|
activePage = _ref.activePage,
|
|
35
|
+
dataAttrs = _ref.dataAttrs,
|
|
33
36
|
_ref$theme = _ref.theme,
|
|
34
37
|
theme = _ref$theme === void 0 ? 'default' : _ref$theme,
|
|
35
38
|
onChange = _ref.onChange;
|
|
@@ -47,21 +50,30 @@ var Pagination = function Pagination(_ref) {
|
|
|
47
50
|
onChange(value);
|
|
48
51
|
}, [onChange]);
|
|
49
52
|
|
|
50
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
53
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
51
54
|
className: cn()
|
|
52
|
-
}, /*#__PURE__*/_react["default"].createElement(_PaginationNavigation["default"], {
|
|
55
|
+
}), /*#__PURE__*/_react["default"].createElement(_PaginationNavigation["default"], {
|
|
56
|
+
dataAttrs: {
|
|
57
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.prev
|
|
58
|
+
},
|
|
53
59
|
direction: "left",
|
|
54
60
|
disabled: activePage === _usePagination.Button.FIRST,
|
|
55
61
|
onClick: handleBackClick,
|
|
56
62
|
className: cn('button'),
|
|
57
63
|
theme: theme
|
|
58
64
|
}), /*#__PURE__*/_react["default"].createElement(_PaginationButtons["default"], {
|
|
65
|
+
dataAttrs: {
|
|
66
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
|
|
67
|
+
},
|
|
59
68
|
items: paginationItems,
|
|
60
69
|
activeButton: activePage,
|
|
61
70
|
hiddenButton: _usePagination.Button.HIDDEN,
|
|
62
71
|
theme: theme,
|
|
63
72
|
onClick: handlePageButtonClick
|
|
64
73
|
}), /*#__PURE__*/_react["default"].createElement(_PaginationNavigation["default"], {
|
|
74
|
+
dataAttrs: {
|
|
75
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.next
|
|
76
|
+
},
|
|
65
77
|
disabled: activePage === totalPages,
|
|
66
78
|
onClick: handleNextClick,
|
|
67
79
|
className: cn('button'),
|
|
@@ -73,6 +85,12 @@ Pagination.propTypes = {
|
|
|
73
85
|
totalPages: _propTypes["default"].number.isRequired,
|
|
74
86
|
activePage: _propTypes["default"].number.isRequired,
|
|
75
87
|
theme: _propTypes["default"].oneOf(['default', 'light']),
|
|
88
|
+
dataAttrs: _propTypes["default"].shape({
|
|
89
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
|
90
|
+
prev: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
|
91
|
+
next: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
|
92
|
+
button: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
|
93
|
+
}),
|
|
76
94
|
onChange: _propTypes["default"].func.isRequired
|
|
77
95
|
};
|
|
78
96
|
var _default = Pagination;
|
|
@@ -1,50 +1,3 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--green: #00B956;
|
|
3
|
-
--purple: #731982;
|
|
4
|
-
--base: #FFFFFF;
|
|
5
|
-
--content: #333333;
|
|
6
|
-
--spbSky0: #F6F6F6;
|
|
7
|
-
--spbSky1: #EDEDED;
|
|
8
|
-
--spbSky2: #D8D8D8;
|
|
9
|
-
--spbSky3: #999999;
|
|
10
|
-
--warmRedC: #EB5A40;
|
|
11
|
-
--137C: #FFA717;
|
|
12
|
-
--311C: #5BD9E5;
|
|
13
|
-
--reflexBlue: #444189;
|
|
14
|
-
--fury: #F62434;
|
|
15
|
-
--systemBlue: #34AAF2;
|
|
16
|
-
--background: #FFFFFF;
|
|
17
|
-
--buttonHoverGreen: #10E272;
|
|
18
|
-
--buttonhoverPurple: #534455;
|
|
19
|
-
--buttonDown: #404D46;
|
|
20
|
-
--gradientBasic: linear-gradient(90deg, #01873F 0%, #00B956 74%, #14CD6A 100%);
|
|
21
|
-
--gradientVIP: linear-gradient(90deg, #5B1168 0%, #731982 74%, #821E93 100%);
|
|
22
|
-
--gradientExclusive: linear-gradient(90deg, #2A2674 0%, #444189 74%, #504D93 100%);
|
|
23
|
-
--STCWhite: #FFFFFF;
|
|
24
|
-
--STCBlack: #333333;
|
|
25
|
-
--STCWhite5: #FFFFFF0D;
|
|
26
|
-
--STCWhite10: #FFFFFF1A;
|
|
27
|
-
--STCWhite20: #FFFFFF33;
|
|
28
|
-
--STCWhite50: #FFFFFF80;
|
|
29
|
-
--STCBlack5: #3333330D;
|
|
30
|
-
--STCBlack10: #3333331A;
|
|
31
|
-
--STCBlack20: #33333333;
|
|
32
|
-
--STCBlack50: #33333380;
|
|
33
|
-
--green80: #0CDC78;
|
|
34
|
-
--green20: #DDFFEC;
|
|
35
|
-
--purple80: #AA67C1;
|
|
36
|
-
--purple20: #FFEEFF;
|
|
37
|
-
--warmRedC80: #FF765D;
|
|
38
|
-
--warmRedC20: #FFCFC7;
|
|
39
|
-
--137C80: #FFB945;
|
|
40
|
-
--137C20: #FFEDD1;
|
|
41
|
-
--311C80: #62E3FF;
|
|
42
|
-
--311C20: #E1FAFF;
|
|
43
|
-
--reflexBlue80: #554FC9;
|
|
44
|
-
--reflexBlue20: #EBEAFF;
|
|
45
|
-
--fury80: #F8505D;
|
|
46
|
-
--fury20: #FFC5C9;
|
|
47
|
-
}
|
|
48
1
|
h1,
|
|
49
2
|
h2,
|
|
50
3
|
h3,
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './PaginationButton.less';
|
|
3
3
|
declare type ValueType = string | number;
|
|
4
|
-
export interface
|
|
4
|
+
export interface IPaginationButtonProps {
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
isActive?: boolean;
|
|
7
7
|
theme?: 'default' | 'light';
|
|
8
|
+
value?: ValueType;
|
|
8
9
|
className?: string;
|
|
10
|
+
dataAttrs?: {
|
|
11
|
+
root?: Record<string, string>;
|
|
12
|
+
};
|
|
9
13
|
onClick?: (value?: ValueType) => void;
|
|
10
|
-
value?: ValueType;
|
|
11
14
|
}
|
|
12
|
-
declare const PaginationButton: React.FC<
|
|
15
|
+
declare const PaginationButton: React.FC<IPaginationButtonProps>;
|
|
13
16
|
export default PaginationButton;
|
|
@@ -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
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;
|