@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
@@ -1,6 +1,8 @@
1
1
  import "core-js/modules/web.timers";
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
4
  import * as React from 'react';
5
+ import { filterDataAttrs } from '@megafon/ui-helpers';
4
6
  import * as PropTypes from 'prop-types';
5
7
  var BROWSER_DELAY = 100;
6
8
 
@@ -12,7 +14,8 @@ var Collapse = function Collapse(props) {
12
14
  _props$animationDurat = props.animationDuration,
13
15
  animationDuration = _props$animationDurat === void 0 ? 300 : _props$animationDurat,
14
16
  children = props.children,
15
- isOpened = props.isOpened;
17
+ isOpened = props.isOpened,
18
+ dataAttrs = props.dataAttrs;
16
19
  var canUpdate = React.useRef(false);
17
20
  var timer = React.useRef(undefined);
18
21
  var rootNode = React.useRef(null);
@@ -59,7 +62,7 @@ var Collapse = function Collapse(props) {
59
62
  return clearTimeout(timer.current);
60
63
  };
61
64
  }, [isOpened, duration]);
62
- return /*#__PURE__*/React.createElement("div", {
65
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
63
66
  className: className,
64
67
  style: {
65
68
  overflow: 'hidden',
@@ -67,9 +70,9 @@ var Collapse = function Collapse(props) {
67
70
  transition: transition
68
71
  },
69
72
  ref: rootNode
70
- }, /*#__PURE__*/React.createElement("div", {
73
+ }), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner), {
71
74
  className: classNameContainer
72
- }, children));
75
+ }), children));
73
76
  };
74
77
 
75
78
  Collapse.propTypes = {
@@ -78,6 +81,10 @@ Collapse.propTypes = {
78
81
  isOpened: PropTypes.bool.isRequired,
79
82
  animationDuration: PropTypes.number,
80
83
  animation: PropTypes.bool,
84
+ dataAttrs: PropTypes.shape({
85
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
86
+ inner: PropTypes.objectOf(PropTypes.string.isRequired)
87
+ }),
81
88
  children: PropTypes.node.isRequired
82
89
  };
83
90
  export default Collapse;
@@ -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,
@@ -52,9 +5,11 @@ h4,
52
5
  h5 {
53
6
  margin: 0;
54
7
  }
55
- .mfui-content-area_color_base,
8
+ .mfui-content-area_color_default {
9
+ background-color: var(--content);
10
+ }
56
11
  .mfui-content-area_color_white {
57
- background-color: var(--base);
12
+ background-color: var(--stcWhite);
58
13
  }
59
14
  .mfui-content-area_color_transparent {
60
15
  background-color: transparent;
@@ -74,10 +29,6 @@ h5 {
74
29
  .mfui-content-area_color_spbSky2 {
75
30
  background-color: var(--spbSky2);
76
31
  }
77
- .mfui-content-area_color_content,
78
- .mfui-content-area_color_freshAsphalt {
79
- background-color: var(--content);
80
- }
81
32
  .mfui-content-area__inner {
82
33
  -webkit-box-sizing: content-box;
83
34
  box-sizing: content-box;
@@ -126,9 +77,11 @@ h5 {
126
77
  padding-right: 0;
127
78
  padding-left: 0;
128
79
  }
129
- .mfui-content-area__inner_color_base,
80
+ .mfui-content-area__inner_color_default {
81
+ background-color: var(--content);
82
+ }
130
83
  .mfui-content-area__inner_color_white {
131
- background-color: var(--base);
84
+ background-color: var(--stcWhite);
132
85
  }
133
86
  .mfui-content-area__inner_color_transparent {
134
87
  background-color: transparent;
@@ -148,7 +101,3 @@ h5 {
148
101
  .mfui-content-area__inner_color_spbSky2 {
149
102
  background-color: var(--spbSky2);
150
103
  }
151
- .mfui-content-area__inner_color_content,
152
- .mfui-content-area__inner_color_freshAsphalt {
153
- background-color: var(--content);
154
- }
@@ -1,18 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import './ContentArea.less';
3
3
  declare const BACKGROUND_COLORS: {
4
- readonly BASE: "base";
4
+ readonly DEFAULT: "default";
5
+ readonly WHITE: "white";
5
6
  readonly TRANSPARENT: "transparent";
6
7
  readonly GREEN: "green";
7
8
  readonly PURPLE: "purple";
8
9
  readonly SPB_SKY_0: "spbSky0";
9
10
  readonly SPB_SKY_1: "spbSky1";
10
11
  readonly SPB_SKY_2: "spbSky2";
11
- readonly CONTENT: "content";
12
- /** @deprecated */
13
- readonly WHITE: "white";
14
- /** @deprecated */
15
- readonly FRESH_ASPHALT: "freshAsphalt";
16
12
  };
17
13
  export declare type BackgroundColorType = typeof BACKGROUND_COLORS[keyof typeof BACKGROUND_COLORS];
18
14
  declare const DisableIndents: {
@@ -1,26 +1,17 @@
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";
5
2
  import * as React from 'react';
6
3
  import { cnCreate } from '@megafon/ui-helpers';
7
4
  import * as PropTypes from 'prop-types';
8
5
  import "./ContentArea.css";
9
6
  var BACKGROUND_COLORS = {
10
- BASE: 'base',
7
+ DEFAULT: 'default',
8
+ WHITE: 'white',
11
9
  TRANSPARENT: 'transparent',
12
10
  GREEN: 'green',
13
11
  PURPLE: 'purple',
14
12
  SPB_SKY_0: 'spbSky0',
15
13
  SPB_SKY_1: 'spbSky1',
16
- SPB_SKY_2: 'spbSky2',
17
- CONTENT: 'content',
18
-
19
- /** @deprecated */
20
- WHITE: 'white',
21
-
22
- /** @deprecated */
23
- FRESH_ASPHALT: 'freshAsphalt'
14
+ SPB_SKY_2: 'spbSky2'
24
15
  };
25
16
  var DisableIndents = {
26
17
  MOBILE: 'mobile',
@@ -49,26 +40,6 @@ var ContentArea = function ContentArea(_ref) {
49
40
  }, children));
50
41
  };
51
42
 
52
- var colorsCustomPropTypes = function colorsCustomPropTypes(props, propName, componentName) {
53
- var deprecatedBlackValue = BACKGROUND_COLORS.FRESH_ASPHALT;
54
- var deprecatedWhiteValue = BACKGROUND_COLORS.WHITE;
55
- var propValue = props[propName];
56
-
57
- if (propValue && !Object.values(BACKGROUND_COLORS).includes(propValue)) {
58
- return new Error("Failed prop type: Invalid prop '".concat(propName, "' of value '").concat(propValue, "' supplied to '").concat(componentName, "',\n expected one of [").concat(Object.values(BACKGROUND_COLORS), "]"));
59
- }
60
-
61
- if (propValue && propValue === deprecatedBlackValue) {
62
- 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(BACKGROUND_COLORS.CONTENT, "'"));
63
- }
64
-
65
- if (propValue && propValue === deprecatedWhiteValue) {
66
- 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(BACKGROUND_COLORS.BASE, "'"));
67
- }
68
-
69
- return null;
70
- };
71
-
72
43
  ContentArea.propTypes = {
73
44
  disableIndents: PropTypes.oneOf(Object.values(DisableIndents)),
74
45
  className: PropTypes.string,
@@ -76,12 +47,8 @@ ContentArea.propTypes = {
76
47
  root: PropTypes.string,
77
48
  inner: PropTypes.string
78
49
  }),
79
- outerBackgroundColor: function outerBackgroundColor(props, propName, componentName) {
80
- return colorsCustomPropTypes(props, propName, componentName);
81
- },
82
- innerBackgroundColor: function innerBackgroundColor(props, propName, componentName) {
83
- return colorsCustomPropTypes(props, propName, componentName);
84
- }
50
+ outerBackgroundColor: PropTypes.oneOf(Object.values(BACKGROUND_COLORS)),
51
+ innerBackgroundColor: PropTypes.oneOf(Object.values(BACKGROUND_COLORS))
85
52
  };
86
53
  ContentArea.defaultProps = {
87
54
  outerBackgroundColor: 'transparent',
@@ -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,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,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 './Header.less';
5
- interface IHeaderProps extends IFilterDataAttrs {
3
+ interface IHeaderProps {
6
4
  /** Тег */
7
5
  as?: 'h1' | 'h2' | 'h3' | 'h5';
8
6
  /** Цвет */
@@ -13,26 +11,14 @@ interface IHeaderProps extends IFilterDataAttrs {
13
11
  addition?: JSX.Element;
14
12
  /** Дополнительный класс корневого элемента */
15
13
  className?: string | string[];
14
+ /** Дополнительные data атрибуты к внутренним элементам */
15
+ dataAttrs?: {
16
+ root?: Record<string, string>;
17
+ };
16
18
  /** Горизонтальное выравнивание */
17
19
  hAlign?: 'inherit' | 'left' | 'center' | 'right';
18
20
  /** Обработчик клика */
19
21
  onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
20
22
  }
21
- declare class Header extends React.Component<IHeaderProps, {}> {
22
- static propTypes: {
23
- as: PropTypes.Requireable<string>;
24
- color: PropTypes.Requireable<string>;
25
- margin: PropTypes.Requireable<boolean>;
26
- addition: PropTypes.Requireable<PropTypes.ReactElementLike>;
27
- hAlign: PropTypes.Requireable<string>;
28
- dataAttrs: PropTypes.Requireable<{
29
- [x: string]: string | null | undefined;
30
- }>;
31
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
32
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
33
- };
34
- static defaultProps: Partial<IHeaderProps>;
35
- renderAddition(): JSX.Element;
36
- render(): JSX.Element;
37
- }
23
+ declare const Header: React.FC<IHeaderProps>;
38
24
  export default Header;
@@ -1,68 +1,36 @@
1
- import "core-js/modules/es.date.to-string";
2
- import "core-js/modules/es.object.to-string";
3
- import "core-js/modules/es.reflect.construct";
4
- import "core-js/modules/es.regexp.to-string";
5
1
  import _extends from "@babel/runtime/helpers/extends";
6
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
7
- import _createClass from "@babel/runtime/helpers/createClass";
8
- import _inherits from "@babel/runtime/helpers/inherits";
9
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
10
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
11
-
12
- function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
-
14
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
15
-
16
2
  import * as React from 'react';
17
3
  import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
18
4
  import * as PropTypes from 'prop-types';
19
5
  import "./Header.css";
20
6
  var cn = cnCreate('mfui-header');
21
7
 
22
- var Header = /*#__PURE__*/function (_React$Component) {
23
- _inherits(Header, _React$Component);
24
-
25
- var _super = _createSuper(Header);
26
-
27
- function Header() {
28
- _classCallCheck(this, Header);
29
-
30
- return _super.apply(this, arguments);
31
- }
32
-
33
- _createClass(Header, [{
34
- key: "renderAddition",
35
- value: function renderAddition() {
36
- return /*#__PURE__*/React.createElement("div", {
37
- className: cn('addition')
38
- }, this.props.addition);
39
- }
40
- }, {
41
- key: "render",
42
- value: function render() {
43
- var _this$props = this.props,
44
- color = _this$props.color,
45
- margin = _this$props.margin,
46
- level = _this$props.as,
47
- hAlign = _this$props.hAlign,
48
- onClick = _this$props.onClick,
49
- dataAttrs = _this$props.dataAttrs,
50
- className = _this$props.className;
51
- var ElementType = level;
52
- return /*#__PURE__*/React.createElement(ElementType, _extends({}, filterDataAttrs(dataAttrs), {
53
- className: cn({
54
- color: color,
55
- margin: margin,
56
- level: level,
57
- 'h-align': hAlign
58
- }, className),
59
- onClick: onClick
60
- }), this.props.children, this.props.addition && this.renderAddition());
61
- }
62
- }]);
63
-
64
- return Header;
65
- }(React.Component);
8
+ var Header = function Header(_ref) {
9
+ var addition = _ref.addition,
10
+ _ref$as = _ref.as,
11
+ level = _ref$as === void 0 ? 'h1' : _ref$as,
12
+ children = _ref.children,
13
+ className = _ref.className,
14
+ _ref$color = _ref.color,
15
+ color = _ref$color === void 0 ? 'default' : _ref$color,
16
+ dataAttrs = _ref.dataAttrs,
17
+ _ref$hAlign = _ref.hAlign,
18
+ hAlign = _ref$hAlign === void 0 ? 'inherit' : _ref$hAlign,
19
+ margin = _ref.margin,
20
+ onClick = _ref.onClick;
21
+ var ElementType = level;
22
+ return /*#__PURE__*/React.createElement(ElementType, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
23
+ className: cn({
24
+ color: color,
25
+ margin: margin,
26
+ level: level,
27
+ 'h-align': hAlign
28
+ }, className),
29
+ onClick: onClick
30
+ }), children, addition && /*#__PURE__*/React.createElement("div", {
31
+ className: cn('addition')
32
+ }, addition));
33
+ };
66
34
 
67
35
  Header.propTypes = {
68
36
  as: PropTypes.oneOf(['h1', 'h2', 'h3', 'h5']),
@@ -70,13 +38,9 @@ Header.propTypes = {
70
38
  margin: PropTypes.bool,
71
39
  addition: PropTypes.element,
72
40
  hAlign: PropTypes.oneOf(['inherit', 'left', 'center', 'right']),
73
- dataAttrs: PropTypes.objectOf(PropTypes.string),
74
- onClick: PropTypes.func,
75
- children: PropTypes.node
76
- };
77
- Header.defaultProps = {
78
- as: 'h1',
79
- color: 'default',
80
- hAlign: 'inherit'
41
+ dataAttrs: PropTypes.shape({
42
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
43
+ }),
44
+ onClick: PropTypes.func
81
45
  };
82
46
  export default Header;
@@ -2,6 +2,9 @@ import * as React from 'react';
2
2
  import './InputLabel.less';
3
3
  export interface IInputLabelProps {
4
4
  htmlFor?: string;
5
+ dataAttrs?: {
6
+ root?: Record<string, string>;
7
+ };
5
8
  }
6
9
  declare const InputLabel: React.FC<IInputLabelProps>;
7
10
  export default InputLabel;
@@ -1,19 +1,24 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import * as React from 'react';
2
- import { cnCreate } from '@megafon/ui-helpers';
3
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
3
4
  import * as PropTypes from 'prop-types';
4
5
  import "./InputLabel.css";
5
6
  var cn = cnCreate('mfui-input-label');
6
7
 
7
8
  var InputLabel = function InputLabel(_ref) {
8
9
  var htmlFor = _ref.htmlFor,
10
+ dataAttrs = _ref.dataAttrs,
9
11
  children = _ref.children;
10
- return /*#__PURE__*/React.createElement("label", {
12
+ return /*#__PURE__*/React.createElement("label", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
11
13
  htmlFor: htmlFor,
12
14
  className: cn()
13
- }, children);
15
+ }), children);
14
16
  };
15
17
 
16
18
  InputLabel.propTypes = {
17
- htmlFor: PropTypes.string
19
+ htmlFor: PropTypes.string,
20
+ dataAttrs: PropTypes.shape({
21
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
22
+ })
18
23
  };
19
24
  export default InputLabel;
@@ -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;
@@ -1,11 +1,32 @@
1
+ import "core-js/modules/es.symbol";
2
+ import "core-js/modules/es.array.index-of";
3
+ import _extends from "@babel/runtime/helpers/extends";
4
+
5
+ var __rest = this && this.__rest || function (s, e) {
6
+ var t = {};
7
+
8
+ for (var p in s) {
9
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
10
+ }
11
+
12
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
13
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
14
+ }
15
+ return t;
16
+ };
17
+
1
18
  import * as React from 'react';
19
+ import { filterDataAttrs } from '@megafon/ui-helpers';
2
20
  import * as PropTypes from 'prop-types';
3
21
 
4
- var Link = function Link(props) {
22
+ var Link = function Link(_a) {
23
+ var dataAttrs = _a.dataAttrs,
24
+ props = __rest(_a, ["dataAttrs"]);
25
+
5
26
  return (
6
27
  /*#__PURE__*/
7
28
  // eslint-disable-next-line jsx-a11y/anchor-has-content
8
- React.createElement("a", props)
29
+ React.createElement("a", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), props))
9
30
  );
10
31
  };
11
32
 
@@ -14,8 +35,11 @@ Link.propTypes = {
14
35
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element, PropTypes.string, PropTypes.node]),
15
36
  target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
16
37
  className: PropTypes.string,
38
+ dataAttrs: PropTypes.shape({
39
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
40
+ }),
17
41
  rel: PropTypes.string,
18
- onClick: PropTypes.func,
19
- download: PropTypes.bool
42
+ download: PropTypes.bool,
43
+ onClick: PropTypes.func
20
44
  };
21
45
  export default Link;
@@ -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
  /** Обработчик клика по ссылке */