@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.
Files changed (124) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/dist/es/colors/Colors.js +13 -0
  3. package/dist/es/components/Accordion/Accordion.d.ts +11 -3
  4. package/dist/es/components/Accordion/Accordion.js +14 -7
  5. package/dist/es/components/Banner/Banner.d.ts +10 -0
  6. package/dist/es/components/Banner/Banner.js +25 -11
  7. package/dist/es/components/Banner/BannerDot.d.ts +3 -0
  8. package/dist/es/components/Banner/BannerDot.js +8 -3
  9. package/dist/es/components/Button/Button.d.ts +8 -2
  10. package/dist/es/components/Button/Button.js +14 -6
  11. package/dist/es/components/Carousel/Carousel.d.ts +9 -2
  12. package/dist/es/components/Carousel/Carousel.js +14 -8
  13. package/dist/es/components/Checkbox/Checkbox.d.ts +8 -2
  14. package/dist/es/components/Checkbox/Checkbox.js +12 -7
  15. package/dist/es/components/Collapse/Collapse.d.ts +15 -3
  16. package/dist/es/components/Collapse/Collapse.js +11 -4
  17. package/dist/es/components/ContentArea/ContentArea.css +8 -59
  18. package/dist/es/components/ContentArea/ContentArea.d.ts +2 -6
  19. package/dist/es/components/ContentArea/ContentArea.js +5 -38
  20. package/dist/es/components/Counter/Counter.css +0 -47
  21. package/dist/es/components/Grid/Grid.css +0 -47
  22. package/dist/es/components/Header/Header.d.ts +6 -20
  23. package/dist/es/components/Header/Header.js +30 -66
  24. package/dist/es/components/InputLabel/InputLabel.d.ts +3 -0
  25. package/dist/es/components/InputLabel/InputLabel.js +9 -4
  26. package/dist/es/components/Link/Link.d.ts +6 -2
  27. package/dist/es/components/Link/Link.js +28 -4
  28. package/dist/es/components/Notification/Notification.css +0 -47
  29. package/dist/es/components/Notification/Notification.d.ts +8 -0
  30. package/dist/es/components/Notification/Notification.js +21 -4
  31. package/dist/es/components/Pagination/Pagination.d.ts +9 -2
  32. package/dist/es/components/Pagination/Pagination.js +20 -3
  33. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +0 -47
  34. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
  35. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +11 -6
  36. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
  37. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +10 -2
  38. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +0 -47
  39. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
  40. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
  41. package/dist/es/components/Paragraph/Paragraph.css +9 -11
  42. package/dist/es/components/Paragraph/Paragraph.d.ts +12 -12
  43. package/dist/es/components/Paragraph/Paragraph.js +14 -36
  44. package/dist/es/components/Preloader/Preloader.d.ts +4 -0
  45. package/dist/es/components/Preloader/Preloader.js +10 -5
  46. package/dist/es/components/RadioButton/RadioButton.d.ts +8 -28
  47. package/dist/es/components/RadioButton/RadioButton.js +50 -85
  48. package/dist/es/components/Select/Select.d.ts +38 -5
  49. package/dist/es/components/Select/Select.js +50 -34
  50. package/dist/es/components/Tabs/Tab.d.ts +5 -2
  51. package/dist/es/components/Tabs/Tab.js +4 -2
  52. package/dist/es/components/Tabs/Tabs.d.ts +8 -0
  53. package/dist/es/components/Tabs/Tabs.js +29 -21
  54. package/dist/es/components/TextField/TextField.d.ts +8 -0
  55. package/dist/es/components/TextField/TextField.js +22 -10
  56. package/dist/es/components/TextLink/TextLink.js +7 -2
  57. package/dist/es/components/Tile/Tile.d.ts +5 -2
  58. package/dist/es/components/Tile/Tile.js +1 -1
  59. package/dist/es/components/Tooltip/Tooltip.d.ts +5 -0
  60. package/dist/es/components/Tooltip/Tooltip.js +10 -2
  61. package/dist/lib/colors/Colors.js +10 -0
  62. package/dist/lib/components/Accordion/Accordion.d.ts +11 -3
  63. package/dist/lib/components/Accordion/Accordion.js +14 -7
  64. package/dist/lib/components/Banner/Banner.d.ts +10 -0
  65. package/dist/lib/components/Banner/Banner.js +25 -10
  66. package/dist/lib/components/Banner/BannerDot.d.ts +3 -0
  67. package/dist/lib/components/Banner/BannerDot.js +10 -2
  68. package/dist/lib/components/Button/Button.d.ts +8 -2
  69. package/dist/lib/components/Button/Button.js +14 -6
  70. package/dist/lib/components/Carousel/Carousel.d.ts +9 -2
  71. package/dist/lib/components/Carousel/Carousel.js +14 -8
  72. package/dist/lib/components/Checkbox/Checkbox.d.ts +8 -2
  73. package/dist/lib/components/Checkbox/Checkbox.js +12 -7
  74. package/dist/lib/components/Collapse/Collapse.d.ts +15 -3
  75. package/dist/lib/components/Collapse/Collapse.js +13 -4
  76. package/dist/lib/components/ContentArea/ContentArea.css +8 -59
  77. package/dist/lib/components/ContentArea/ContentArea.d.ts +2 -6
  78. package/dist/lib/components/ContentArea/ContentArea.js +5 -41
  79. package/dist/lib/components/Counter/Counter.css +0 -47
  80. package/dist/lib/components/Grid/Grid.css +0 -47
  81. package/dist/lib/components/Header/Header.d.ts +6 -20
  82. package/dist/lib/components/Header/Header.js +30 -97
  83. package/dist/lib/components/InputLabel/InputLabel.d.ts +3 -0
  84. package/dist/lib/components/InputLabel/InputLabel.js +11 -3
  85. package/dist/lib/components/Link/Link.d.ts +6 -2
  86. package/dist/lib/components/Link/Link.js +33 -4
  87. package/dist/lib/components/Notification/Notification.css +0 -47
  88. package/dist/lib/components/Notification/Notification.d.ts +8 -0
  89. package/dist/lib/components/Notification/Notification.js +20 -3
  90. package/dist/lib/components/Pagination/Pagination.d.ts +9 -2
  91. package/dist/lib/components/Pagination/Pagination.js +20 -2
  92. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +0 -47
  93. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
  94. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +11 -5
  95. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
  96. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +9 -1
  97. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +0 -47
  98. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
  99. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
  100. package/dist/lib/components/Paragraph/Paragraph.css +9 -11
  101. package/dist/lib/components/Paragraph/Paragraph.d.ts +12 -12
  102. package/dist/lib/components/Paragraph/Paragraph.js +15 -37
  103. package/dist/lib/components/Preloader/Preloader.d.ts +4 -0
  104. package/dist/lib/components/Preloader/Preloader.js +10 -4
  105. package/dist/lib/components/RadioButton/RadioButton.d.ts +8 -28
  106. package/dist/lib/components/RadioButton/RadioButton.js +51 -117
  107. package/dist/lib/components/Select/Select.d.ts +38 -5
  108. package/dist/lib/components/Select/Select.js +50 -34
  109. package/dist/lib/components/Tabs/Tab.d.ts +5 -2
  110. package/dist/lib/components/Tabs/Tab.js +4 -2
  111. package/dist/lib/components/Tabs/Tabs.d.ts +8 -0
  112. package/dist/lib/components/Tabs/Tabs.js +29 -21
  113. package/dist/lib/components/TextField/TextField.d.ts +8 -0
  114. package/dist/lib/components/TextField/TextField.js +20 -9
  115. package/dist/lib/components/TextLink/TextLink.js +7 -2
  116. package/dist/lib/components/Tile/Tile.d.ts +5 -2
  117. package/dist/lib/components/Tile/Tile.js +1 -1
  118. package/dist/lib/components/Tooltip/Tooltip.d.ts +5 -0
  119. package/dist/lib/components/Tooltip/Tooltip.js +9 -1
  120. package/package.json +5 -4
  121. package/styles/base.less +1 -60
  122. package/styles/colors.css +60 -0
  123. package/styles/colorsDark.css +62 -0
  124. package/styles/base.css +0 -54
@@ -2,7 +2,7 @@ import "core-js/modules/es.object.values";
2
2
  import "core-js/modules/es.string.link";
3
3
  import _extends from "@babel/runtime/helpers/extends";
4
4
  import React from 'react';
5
- import { cnCreate } from '@megafon/ui-helpers';
5
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
6
6
  import * as PropTypes from 'prop-types';
7
7
  import Header from "../Header/Header";
8
8
  import TextLink from "../TextLink/TextLink";
@@ -89,11 +89,15 @@ var Notification = function Notification(_ref) {
89
89
  href = _ref.href,
90
90
  target = _ref.target,
91
91
  icon = _ref.icon,
92
+ dataAttrs = _ref.dataAttrs,
92
93
  onClose = _ref.onClose,
93
94
  onLinkClick = _ref.onLinkClick;
94
95
 
95
96
  var renderLink = function renderLink() {
96
97
  return /*#__PURE__*/React.createElement(TextLink, {
98
+ dataAttrs: {
99
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link
100
+ },
97
101
  className: cn('link'),
98
102
  onClick: onLinkClick,
99
103
  rel: rel,
@@ -129,6 +133,9 @@ var Notification = function Notification(_ref) {
129
133
  };
130
134
 
131
135
  return /*#__PURE__*/React.createElement(Tile, {
136
+ dataAttrs: {
137
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root
138
+ },
132
139
  radius: "rounded",
133
140
  shadowLevel: shadowLevel,
134
141
  className: cn({
@@ -142,19 +149,22 @@ var Notification = function Notification(_ref) {
142
149
  }, renderIcon()), /*#__PURE__*/React.createElement("div", {
143
150
  className: cn('content')
144
151
  }, title && /*#__PURE__*/React.createElement(Header, {
152
+ dataAttrs: {
153
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.title
154
+ },
145
155
  as: "h5",
146
156
  className: cn('title', {
147
157
  'close-padding': hasCloseButton
148
158
  })
149
- }, title), /*#__PURE__*/React.createElement("p", {
159
+ }, title), /*#__PURE__*/React.createElement("p", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.text), {
150
160
  className: cn('text', {
151
161
  'close-padding': hasCloseButton && !title
152
162
  })
153
- }, children), link && renderLink())), hasCloseButton && /*#__PURE__*/React.createElement("button", {
163
+ }), children), link && renderLink())), hasCloseButton && /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.close), {
154
164
  className: cn('close'),
155
165
  type: "button",
156
166
  onClick: onClose
157
- }, /*#__PURE__*/React.createElement(CancelIcon, {
167
+ }), /*#__PURE__*/React.createElement(CancelIcon, {
158
168
  className: cn('close-icon')
159
169
  })));
160
170
  };
@@ -171,6 +181,13 @@ Notification.propTypes = {
171
181
  href: PropTypes.string,
172
182
  target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
173
183
  icon: PropTypes.element,
184
+ dataAttrs: PropTypes.shape({
185
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
186
+ title: PropTypes.objectOf(PropTypes.string.isRequired),
187
+ text: PropTypes.objectOf(PropTypes.string.isRequired),
188
+ link: PropTypes.objectOf(PropTypes.string.isRequired),
189
+ close: PropTypes.objectOf(PropTypes.string.isRequired)
190
+ }),
174
191
  onClose: PropTypes.func,
175
192
  onLinkClick: PropTypes.func
176
193
  };
@@ -1,6 +1,13 @@
1
1
  import React from 'react';
2
2
  import './Pagination.less';
3
- interface IPagination {
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<IPagination>;
20
+ declare const Pagination: React.FC<IPaginationProps>;
14
21
  export default Pagination;
@@ -1,5 +1,6 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React from 'react';
2
- import { cnCreate } from '@megafon/ui-helpers';
3
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
3
4
  import PropTypes from 'prop-types';
4
5
  import "./Pagination.css";
5
6
  import PaginationButtons from "./components/PaginationButtons/PaginationButtons";
@@ -10,6 +11,7 @@ var cn = cnCreate('mfui-pagination');
10
11
  var Pagination = function Pagination(_ref) {
11
12
  var totalPages = _ref.totalPages,
12
13
  activePage = _ref.activePage,
14
+ dataAttrs = _ref.dataAttrs,
13
15
  _ref$theme = _ref.theme,
14
16
  theme = _ref$theme === void 0 ? 'default' : _ref$theme,
15
17
  onChange = _ref.onChange;
@@ -23,21 +25,30 @@ var Pagination = function Pagination(_ref) {
23
25
  var handlePageButtonClick = React.useCallback(function (value) {
24
26
  onChange(value);
25
27
  }, [onChange]);
26
- return /*#__PURE__*/React.createElement("div", {
28
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
27
29
  className: cn()
28
- }, /*#__PURE__*/React.createElement(PaginationNavigation, {
30
+ }), /*#__PURE__*/React.createElement(PaginationNavigation, {
31
+ dataAttrs: {
32
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.prev
33
+ },
29
34
  direction: "left",
30
35
  disabled: activePage === Button.FIRST,
31
36
  onClick: handleBackClick,
32
37
  className: cn('button'),
33
38
  theme: theme
34
39
  }), /*#__PURE__*/React.createElement(PaginationButtons, {
40
+ dataAttrs: {
41
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
42
+ },
35
43
  items: paginationItems,
36
44
  activeButton: activePage,
37
45
  hiddenButton: Button.HIDDEN,
38
46
  theme: theme,
39
47
  onClick: handlePageButtonClick
40
48
  }), /*#__PURE__*/React.createElement(PaginationNavigation, {
49
+ dataAttrs: {
50
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.next
51
+ },
41
52
  disabled: activePage === totalPages,
42
53
  onClick: handleNextClick,
43
54
  className: cn('button'),
@@ -49,6 +60,12 @@ Pagination.propTypes = {
49
60
  totalPages: PropTypes.number.isRequired,
50
61
  activePage: PropTypes.number.isRequired,
51
62
  theme: PropTypes.oneOf(['default', 'light']),
63
+ dataAttrs: PropTypes.shape({
64
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
65
+ prev: PropTypes.objectOf(PropTypes.string.isRequired),
66
+ next: PropTypes.objectOf(PropTypes.string.isRequired),
67
+ button: PropTypes.objectOf(PropTypes.string.isRequired)
68
+ }),
52
69
  onChange: PropTypes.func.isRequired
53
70
  };
54
71
  export 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 IPaginationButton {
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<IPaginationButton>;
15
+ declare const PaginationButton: React.FC<IPaginationButtonProps>;
13
16
  export default PaginationButton;
@@ -1,5 +1,6 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React from 'react';
2
- import { cnCreate } from '@megafon/ui-helpers';
3
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
3
4
  import PropTypes from 'prop-types';
4
5
  import "./PaginationButton.css";
5
6
  var cn = cnCreate('mfui-pagination-button');
@@ -14,13 +15,14 @@ var PaginationButton = function PaginationButton(_ref) {
14
15
  className = _ref.className,
15
16
  children = _ref.children,
16
17
  onClick = _ref.onClick,
17
- value = _ref.value;
18
+ value = _ref.value,
19
+ dataAttrs = _ref.dataAttrs;
18
20
 
19
21
  var handleClick = function handleClick() {
20
22
  onClick && onClick(value);
21
23
  };
22
24
 
23
- return /*#__PURE__*/React.createElement("button", {
25
+ return /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
24
26
  className: cn({
25
27
  active: isActive,
26
28
  theme: theme
@@ -28,7 +30,7 @@ var PaginationButton = function PaginationButton(_ref) {
28
30
  disabled: disabled,
29
31
  onClick: handleClick,
30
32
  type: "button"
31
- }, children);
33
+ }), children);
32
34
  };
33
35
 
34
36
  PaginationButton.propTypes = {
@@ -36,7 +38,10 @@ PaginationButton.propTypes = {
36
38
  isActive: PropTypes.bool,
37
39
  theme: PropTypes.oneOf(['default', 'light']),
38
40
  className: PropTypes.string,
39
- onClick: PropTypes.func,
40
- value: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
41
+ value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
42
+ dataAttrs: PropTypes.shape({
43
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
44
+ }),
45
+ onClick: PropTypes.func
41
46
  };
42
47
  export default PaginationButton;
@@ -1,11 +1,14 @@
1
1
  import React from 'react';
2
2
  import './PaginationButtons.less';
3
- interface IPaginationButtons {
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<IPaginationButtons>;
13
+ declare const PaginationButtons: React.FC<IPaginationButtonsProps>;
11
14
  export default PaginationButtons;
@@ -1,7 +1,7 @@
1
1
  import "core-js/modules/es.array.map";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import React from 'react';
4
- import { cnCreate } from '@megafon/ui-helpers';
4
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
5
5
  import PropTypes from 'prop-types';
6
6
  import PaginationButton from "../PaginationButton/PaginationButton";
7
7
  import "./PaginationButtons.css";
@@ -21,11 +21,13 @@ var PaginationButtons = function PaginationButtons(_ref) {
21
21
  theme = _ref.theme,
22
22
  onClick = _ref.onClick,
23
23
  activeButton = _ref.activeButton,
24
- hiddenButton = _ref.hiddenButton;
24
+ hiddenButton = _ref.hiddenButton,
25
+ dataAttrs = _ref.dataAttrs;
25
26
  return /*#__PURE__*/React.createElement("div", {
26
27
  className: cn()
27
28
  }, items.map(function (pageNumber, index) {
28
29
  var isHiddenButton = hiddenButton === pageNumber;
30
+ var dataIndex = typeof pageNumber === 'number' ? pageNumber : undefined;
29
31
 
30
32
  if (isHiddenButton) {
31
33
  return /*#__PURE__*/React.createElement(PaginationButton, {
@@ -38,6 +40,9 @@ var PaginationButtons = function PaginationButtons(_ref) {
38
40
 
39
41
  var isActive = pageNumber === activeButton;
40
42
  return /*#__PURE__*/React.createElement(PaginationButton, {
43
+ dataAttrs: {
44
+ root: filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root, dataIndex)
45
+ },
41
46
  isActive: isActive,
42
47
  key: index,
43
48
  className: cn('button'),
@@ -53,6 +58,9 @@ PaginationButtons.propTypes = {
53
58
  theme: PropTypes.oneOf(['default', 'light']),
54
59
  activeButton: PropTypes.number.isRequired,
55
60
  hiddenButton: PropTypes.string.isRequired,
61
+ dataAttrs: PropTypes.shape({
62
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
63
+ }),
56
64
  onClick: PropTypes.func.isRequired
57
65
  };
58
66
  export default PaginationButtons;
@@ -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,12 +1,15 @@
1
1
  import React from 'react';
2
2
  import './PaginationNavigation.less';
3
- interface IPaginationNavigation {
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<IPaginationNavigation>;
14
+ declare const PaginationNavigation: React.FC<IPaginationNavigationProps>;
12
15
  export default PaginationNavigation;
@@ -22,8 +22,10 @@ var PaginationNavigation = function PaginationNavigation(_ref) {
22
22
  disabled = _ref.disabled,
23
23
  isActive = _ref.isActive,
24
24
  onClick = _ref.onClick,
25
- className = _ref.className;
25
+ className = _ref.className,
26
+ dataAttrs = _ref.dataAttrs;
26
27
  return /*#__PURE__*/React.createElement(PaginationButton, {
28
+ dataAttrs: dataAttrs,
27
29
  className: cn({
28
30
  direction: direction
29
31
  }, className),
@@ -42,6 +44,9 @@ PaginationNavigation.propTypes = {
42
44
  disabled: PropTypes.bool,
43
45
  isActive: PropTypes.bool,
44
46
  className: PropTypes.string,
47
+ dataAttrs: PropTypes.shape({
48
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
49
+ }),
45
50
  onClick: PropTypes.func
46
51
  };
47
52
  export default PaginationNavigation;
@@ -23,16 +23,21 @@
23
23
  .mfui-paragraph_has-margin {
24
24
  margin: 0 0 16px;
25
25
  }
26
+ .mfui-paragraph_color_inherit {
27
+ color: inherit;
28
+ }
29
+ .mfui-paragraph_color_default {
30
+ color: var(--content);
31
+ }
32
+ .mfui-paragraph_color_white {
33
+ color: var(--stcWhite);
34
+ }
26
35
  .mfui-paragraph_color_green {
27
36
  color: var(--brandGreen);
28
37
  }
29
38
  .mfui-paragraph_color_purple {
30
39
  color: var(--brandPurple);
31
40
  }
32
- .mfui-paragraph_color_base,
33
- .mfui-paragraph_color_clearWhite {
34
- color: var(--stcWhite);
35
- }
36
41
  .mfui-paragraph_color_spbSky0 {
37
42
  color: var(--spbSky0);
38
43
  }
@@ -42,10 +47,3 @@
42
47
  .mfui-paragraph_color_spbSky2 {
43
48
  color: var(--spbSky2);
44
49
  }
45
- .mfui-paragraph_color_content,
46
- .mfui-paragraph_color_freshAsphalt {
47
- color: var(--content);
48
- }
49
- .mfui-paragraph_color_inherit {
50
- color: inherit;
51
- }
@@ -1,18 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import './Paragraph.less';
3
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
- INHERIT: string;
12
- /** @deprecated */
13
- CLEAR_WHITE: string;
14
- /** @deprecated */
15
- FRESH_ASPHALT: string;
4
+ readonly INHERIT: "inherit";
5
+ readonly DEFAULT: "default";
6
+ readonly WHITE: "white";
7
+ readonly GREEN: "green";
8
+ readonly PURPLE: "purple";
9
+ readonly SPB_SKY_0: "spbSky0";
10
+ readonly SPB_SKY_1: "spbSky1";
11
+ readonly SPB_SKY_2: "spbSky2";
16
12
  };
17
13
  declare type ColorType = typeof COLORS[keyof typeof COLORS];
18
14
  export interface IParagraphProps {
@@ -26,6 +22,10 @@ export interface IParagraphProps {
26
22
  color?: ColorType;
27
23
  /** Дополнительный класс корневого элемента */
28
24
  className?: string;
25
+ /** Дополнительные data атрибуты к внутренним элементам */
26
+ dataAttrs?: {
27
+ root?: Record<string, string>;
28
+ };
29
29
  }
30
30
  declare const Paragraph: React.FC<IParagraphProps>;
31
31
  export default Paragraph;
@@ -1,26 +1,18 @@
1
- import "core-js/modules/es.array.concat";
2
- import "core-js/modules/es.array.includes";
3
1
  import "core-js/modules/es.object.values";
4
- import "core-js/modules/es.string.includes";
2
+ import _extends from "@babel/runtime/helpers/extends";
5
3
  import * as React from 'react';
6
- import { cnCreate } from '@megafon/ui-helpers';
4
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
7
5
  import * as PropTypes from 'prop-types';
8
6
  import "./Paragraph.css";
9
7
  var COLORS = {
8
+ INHERIT: 'inherit',
9
+ DEFAULT: 'default',
10
+ WHITE: 'white',
10
11
  GREEN: 'green',
11
12
  PURPLE: 'purple',
12
- BASE: 'base',
13
13
  SPB_SKY_0: 'spbSky0',
14
14
  SPB_SKY_1: 'spbSky1',
15
- SPB_SKY_2: 'spbSky2',
16
- CONTENT: 'content',
17
- INHERIT: 'inherit',
18
-
19
- /** @deprecated */
20
- CLEAR_WHITE: 'clearWhite',
21
-
22
- /** @deprecated */
23
- FRESH_ASPHALT: 'freshAsphalt'
15
+ SPB_SKY_2: 'spbSky2'
24
16
  };
25
17
  var cn = cnCreate('mfui-paragraph');
26
18
 
@@ -29,43 +21,29 @@ var Paragraph = function Paragraph(_ref) {
29
21
  size = _ref$size === void 0 ? 'regular' : _ref$size,
30
22
  align = _ref.align,
31
23
  _ref$color = _ref.color,
32
- color = _ref$color === void 0 ? 'freshAsphalt' : _ref$color,
24
+ color = _ref$color === void 0 ? COLORS.DEFAULT : _ref$color,
33
25
  className = _ref.className,
34
26
  _ref$hasMargin = _ref.hasMargin,
35
27
  hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
28
+ dataAttrs = _ref.dataAttrs,
36
29
  children = _ref.children;
37
- return /*#__PURE__*/React.createElement("p", {
30
+ return /*#__PURE__*/React.createElement("p", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
38
31
  className: cn({
39
32
  size: size,
40
33
  align: align,
41
34
  color: color,
42
35
  'has-margin': hasMargin
43
36
  }, className)
44
- }, children);
37
+ }), children);
45
38
  };
46
39
 
47
40
  Paragraph.propTypes = {
41
+ dataAttrs: PropTypes.shape({
42
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
43
+ }),
48
44
  align: PropTypes.oneOf(['left', 'center', 'right']),
49
45
  size: PropTypes.oneOf(['regular', 'small']),
50
46
  hasMargin: PropTypes.bool,
51
- color: function color(props, propName, componentName) {
52
- var deprecatedBlackValue = COLORS.FRESH_ASPHALT;
53
- var deprecatedWhiteValue = COLORS.CLEAR_WHITE;
54
- var propValue = props[propName];
55
-
56
- if (propValue && !Object.values(COLORS).includes(propValue)) {
57
- 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), "]"));
58
- }
59
-
60
- if (propValue && props[propName] === deprecatedBlackValue) {
61
- 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, "'"));
62
- }
63
-
64
- if (propValue && props[propName] === deprecatedWhiteValue) {
65
- 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, "'"));
66
- }
67
-
68
- return null;
69
- }
47
+ color: PropTypes.oneOf(Object.values(COLORS))
70
48
  };
71
49
  export default Paragraph;
@@ -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;
@@ -1,8 +1,9 @@
1
1
  import "core-js/modules/es.object.values";
2
2
  import "core-js/modules/web.timers";
3
+ import _extends from "@babel/runtime/helpers/extends";
3
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
5
  import * as React from 'react';
5
- import { cnCreate } from '@megafon/ui-helpers';
6
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
6
7
  import * as PropTypes from 'prop-types';
7
8
  import "./Preloader.css";
8
9
  export var PreloaderColors = {
@@ -25,7 +26,8 @@ var Preloader = function Preloader(_ref) {
25
26
  sizeDesktop = _ref.sizeDesktop,
26
27
  sizeTablet = _ref.sizeTablet,
27
28
  sizeMobile = _ref.sizeMobile,
28
- className = _ref.className;
29
+ className = _ref.className,
30
+ dataAttrs = _ref.dataAttrs;
29
31
 
30
32
  var _React$useState = React.useState(false),
31
33
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -40,7 +42,7 @@ var Preloader = function Preloader(_ref) {
40
42
  clearTimeout(timerId);
41
43
  };
42
44
  }, []);
43
- return isShowed ? /*#__PURE__*/React.createElement("div", {
45
+ return isShowed ? /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
44
46
  className: cn({
45
47
  color: color,
46
48
  'size-all': sizeAll,
@@ -49,7 +51,7 @@ var Preloader = function Preloader(_ref) {
49
51
  'size-tablet': sizeTablet,
50
52
  'size-mobile': sizeMobile
51
53
  }, className)
52
- }, /*#__PURE__*/React.createElement("div", {
54
+ }), /*#__PURE__*/React.createElement("div", {
53
55
  className: cn('item', {
54
56
  first: true
55
57
  })
@@ -71,6 +73,9 @@ Preloader.propTypes = {
71
73
  sizeDesktop: PropTypes.oneOf(Object.values(PreloaderSizes)),
72
74
  sizeTablet: PropTypes.oneOf(Object.values(PreloaderSizes)),
73
75
  sizeMobile: PropTypes.oneOf(Object.values(PreloaderSizes)),
74
- className: PropTypes.string
76
+ className: PropTypes.string,
77
+ dataAttrs: PropTypes.shape({
78
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
79
+ })
75
80
  };
76
81
  export default Preloader;