@megafon/ui-core 2.2.0 → 3.0.0-beta.3

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 (120) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/dist/es/colors/ColorItem/ColorItem.css +1 -8
  3. package/dist/es/colors/ColorItem/ColorItem.js +1 -1
  4. package/dist/es/colors/Colors.css +3 -11
  5. package/dist/es/colors/Colors.js +51 -4
  6. package/dist/es/colors/colorsData.js +78 -71
  7. package/dist/es/components/Accordion/Accordion.css +6 -12
  8. package/dist/es/components/Accordion/Accordion.d.ts +1 -1
  9. package/dist/es/components/Accordion/Accordion.js +10 -5
  10. package/dist/es/components/Banner/Banner.css +2 -9
  11. package/dist/es/components/Banner/BannerDot.css +4 -11
  12. package/dist/es/components/Button/Button.css +83 -74
  13. package/dist/es/components/Calendar/Calendar.css +0 -7
  14. package/dist/es/components/Calendar/components/Day/Day.css +10 -17
  15. package/dist/es/components/Calendar/components/Month/Month.css +3 -10
  16. package/dist/es/components/Calendar/components/Month/Month.js +21 -5
  17. package/dist/es/components/Carousel/Carousel.css +4 -11
  18. package/dist/es/components/Checkbox/Checkbox.css +18 -25
  19. package/dist/es/components/Checkbox/Checkbox.d.ts +3 -25
  20. package/dist/es/components/Checkbox/Checkbox.js +71 -89
  21. package/dist/es/components/ContentArea/ContentArea.css +61 -20
  22. package/dist/es/components/ContentArea/ContentArea.d.ts +0 -1
  23. package/dist/es/components/ContentArea/ContentArea.js +0 -1
  24. package/dist/es/components/Counter/Counter.css +61 -11
  25. package/dist/es/components/Grid/Grid.css +47 -0
  26. package/dist/es/components/Grid/GridColumn.css +0 -7
  27. package/dist/es/components/Header/Header.css +8 -12
  28. package/dist/es/components/Header/Header.d.ts +1 -1
  29. package/dist/es/components/Header/Header.js +2 -2
  30. package/dist/es/components/InputLabel/InputLabel.css +0 -7
  31. package/dist/es/components/List/List.css +9 -13
  32. package/dist/es/components/List/List.d.ts +1 -1
  33. package/dist/es/components/List/List.js +2 -2
  34. package/dist/es/components/List/ListItem.css +0 -7
  35. package/dist/es/components/Logo/Logo.css +0 -7
  36. package/dist/es/components/Logo/Logo.js +4 -8
  37. package/dist/es/components/NavArrow/NavArrow.css +5 -12
  38. package/dist/es/components/Notification/Notification.css +88 -24
  39. package/dist/es/components/Pagination/Pagination.css +0 -7
  40. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +56 -9
  41. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +47 -0
  42. package/dist/es/components/Paragraph/Paragraph.css +7 -17
  43. package/dist/es/components/Paragraph/Paragraph.d.ts +0 -1
  44. package/dist/es/components/Paragraph/Paragraph.js +1 -2
  45. package/dist/es/components/Preloader/Preloader.css +5 -12
  46. package/dist/es/components/RadioButton/RadioButton.css +7 -14
  47. package/dist/es/components/Search/Search.css +20 -25
  48. package/dist/es/components/Select/Select.css +29 -35
  49. package/dist/es/components/Select/Select.d.ts +1 -1
  50. package/dist/es/components/Switcher/Switcher.css +18 -28
  51. package/dist/es/components/Tabs/Tabs.css +30 -37
  52. package/dist/es/components/TextField/TextField.css +27 -33
  53. package/dist/es/components/TextLink/TextLink.css +10 -14
  54. package/dist/es/components/TextLink/TextLink.d.ts +1 -1
  55. package/dist/es/components/TextLink/TextLink.js +1 -1
  56. package/dist/es/components/Tile/Tile.css +2 -8
  57. package/dist/es/components/Tooltip/Tooltip.css +1 -8
  58. package/dist/es/components/Tooltip/Tooltip.d.ts +3 -2
  59. package/dist/es/components/Tooltip/Tooltip.js +2 -9
  60. package/dist/lib/colors/ColorItem/ColorItem.css +1 -8
  61. package/dist/lib/colors/ColorItem/ColorItem.js +1 -1
  62. package/dist/lib/colors/Colors.css +3 -11
  63. package/dist/lib/colors/Colors.js +53 -4
  64. package/dist/lib/colors/colorsData.js +78 -71
  65. package/dist/lib/components/Accordion/Accordion.css +6 -12
  66. package/dist/lib/components/Accordion/Accordion.d.ts +1 -1
  67. package/dist/lib/components/Accordion/Accordion.js +9 -4
  68. package/dist/lib/components/Banner/Banner.css +2 -9
  69. package/dist/lib/components/Banner/BannerDot.css +4 -11
  70. package/dist/lib/components/Button/Button.css +83 -74
  71. package/dist/lib/components/Calendar/Calendar.css +0 -7
  72. package/dist/lib/components/Calendar/components/Day/Day.css +10 -17
  73. package/dist/lib/components/Calendar/components/Month/Month.css +3 -10
  74. package/dist/lib/components/Calendar/components/Month/Month.js +20 -4
  75. package/dist/lib/components/Carousel/Carousel.css +4 -11
  76. package/dist/lib/components/Checkbox/Checkbox.css +18 -25
  77. package/dist/lib/components/Checkbox/Checkbox.d.ts +3 -25
  78. package/dist/lib/components/Checkbox/Checkbox.js +76 -124
  79. package/dist/lib/components/ContentArea/ContentArea.css +61 -20
  80. package/dist/lib/components/ContentArea/ContentArea.d.ts +0 -1
  81. package/dist/lib/components/ContentArea/ContentArea.js +0 -1
  82. package/dist/lib/components/Counter/Counter.css +61 -11
  83. package/dist/lib/components/Grid/Grid.css +47 -0
  84. package/dist/lib/components/Grid/GridColumn.css +0 -7
  85. package/dist/lib/components/Header/Header.css +8 -12
  86. package/dist/lib/components/Header/Header.d.ts +1 -1
  87. package/dist/lib/components/Header/Header.js +2 -2
  88. package/dist/lib/components/InputLabel/InputLabel.css +0 -7
  89. package/dist/lib/components/List/List.css +9 -13
  90. package/dist/lib/components/List/List.d.ts +1 -1
  91. package/dist/lib/components/List/List.js +2 -2
  92. package/dist/lib/components/List/ListItem.css +0 -7
  93. package/dist/lib/components/Logo/Logo.css +0 -7
  94. package/dist/lib/components/Logo/Logo.js +4 -8
  95. package/dist/lib/components/NavArrow/NavArrow.css +5 -12
  96. package/dist/lib/components/Notification/Notification.css +88 -24
  97. package/dist/lib/components/Pagination/Pagination.css +0 -7
  98. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +56 -9
  99. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.css +47 -0
  100. package/dist/lib/components/Paragraph/Paragraph.css +7 -17
  101. package/dist/lib/components/Paragraph/Paragraph.d.ts +0 -1
  102. package/dist/lib/components/Paragraph/Paragraph.js +1 -2
  103. package/dist/lib/components/Preloader/Preloader.css +5 -12
  104. package/dist/lib/components/RadioButton/RadioButton.css +7 -14
  105. package/dist/lib/components/Search/Search.css +20 -25
  106. package/dist/lib/components/Select/Select.css +29 -35
  107. package/dist/lib/components/Select/Select.d.ts +1 -1
  108. package/dist/lib/components/Switcher/Switcher.css +18 -28
  109. package/dist/lib/components/Tabs/Tabs.css +30 -37
  110. package/dist/lib/components/TextField/TextField.css +27 -33
  111. package/dist/lib/components/TextLink/TextLink.css +10 -14
  112. package/dist/lib/components/TextLink/TextLink.d.ts +1 -1
  113. package/dist/lib/components/TextLink/TextLink.js +1 -1
  114. package/dist/lib/components/Tile/Tile.css +2 -8
  115. package/dist/lib/components/Tooltip/Tooltip.css +1 -8
  116. package/dist/lib/components/Tooltip/Tooltip.d.ts +3 -2
  117. package/dist/lib/components/Tooltip/Tooltip.js +1 -8
  118. package/package.json +4 -4
  119. package/styles/base.css +54 -0
  120. package/styles/base.less +61 -73
package/CHANGELOG.md CHANGED
@@ -3,6 +3,80 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.0.0-beta.3](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.2...@megafon/ui-core@3.0.0-beta.3) (2022-01-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **accordion:** add focus on arrow after tab press, add open/close accordion after enter press ([9bfa0ac](https://github.com/MegafonWebLab/megafon-ui/commit/9bfa0ac5348ac25c0e37a4df51e26e2dabde02ba))
12
+ * **accordion:** change type of onClickAccordion prop ([9a150c5](https://github.com/MegafonWebLab/megafon-ui/commit/9a150c5de309547763a714b0eb630dfb386a8107))
13
+ * **calendar/month:** add focus on month arrows, add enter press handlers ([63f1e47](https://github.com/MegafonWebLab/megafon-ui/commit/63f1e4761e57ed6d56464b632dce9fd5e77655e1))
14
+ * **checkbox:** add focus on custom checkbox, add enter press handler ([83d111d](https://github.com/MegafonWebLab/megafon-ui/commit/83d111d0e4b41d3915bdd079bed4a7f9715ce7a5))
15
+ * **checkbox:** add isChecked state, change type of onChange prop ([f535caf](https://github.com/MegafonWebLab/megafon-ui/commit/f535caf39a02ab6793d3c63b654a1f1f3e9b2b93))
16
+ * **tooltip:** add check event function from ui-helpers ([a784ab4](https://github.com/MegafonWebLab/megafon-ui/commit/a784ab4f288124eb941fe8f52e46b2efc9aa2f82))
17
+
18
+
19
+ ### BREAKING CHANGES
20
+
21
+ * **checkbox:** change type of onChange prop on (checked: boolean) => void
22
+ * **accordion:** remove parameter 'title' in onClickAccordion prop
23
+ * **tooltip:** change onOpen, onClose types; AccessibilityEventTypeNative from @megafon/ui-helpers
24
+
25
+
26
+
27
+
28
+
29
+ # [3.0.0-beta.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.1...@megafon/ui-core@3.0.0-beta.2) (2022-01-21)
30
+
31
+ **Note:** Version bump only for package @megafon/ui-core
32
+
33
+
34
+
35
+
36
+
37
+ # [3.0.0-beta.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.0...@megafon/ui-core@3.0.0-beta.1) (2022-01-20)
38
+
39
+
40
+ ### Bug Fixes
41
+
42
+ * **colors:** fix colors component ([3061f7c](https://github.com/MegafonWebLab/megafon-ui/commit/3061f7c7b56d5baa32f109d7ce941bcc7e70c5b9))
43
+ * **colors:** remove unused classname modifiers ([d919cdc](https://github.com/MegafonWebLab/megafon-ui/commit/d919cdcf1fa79d60230fc85811518ded1c0537ad))
44
+ * **colors:** remove unused method ([2970295](https://github.com/MegafonWebLab/megafon-ui/commit/2970295df9053a4f54ed19d3d46deb07994844e0))
45
+ * **colors:** renabe green and purple to brandGreen and brandPurple to avoid postcss-colormin bug ([563d97c](https://github.com/MegafonWebLab/megafon-ui/commit/563d97c42900099415a6872f57b500b87aeed647))
46
+ * **colors:** update color values on colors page when user switches theme ([8552ff6](https://github.com/MegafonWebLab/megafon-ui/commit/8552ff69a66153ef890437ffc4dd2e50c31d6f2e))
47
+ * **less:** import base.less file through reference ([5a13aae](https://github.com/MegafonWebLab/megafon-ui/commit/5a13aaedec3a7fd09f77dcddfe437fda604f60a5))
48
+
49
+
50
+ ### Features
51
+
52
+ * **styles:** export css version for base.less ([14aff17](https://github.com/MegafonWebLab/megafon-ui/commit/14aff17f8d3f77ec7beb2e3cb5c8a489ecd77e74))
53
+
54
+
55
+ ### BREAKING CHANGES
56
+
57
+ * **colors:** green, green20, green80, purple, purple20 and purple80 colors now have 'brand'
58
+ prefix (e.g. brandGreen)
59
+
60
+
61
+
62
+
63
+
64
+ # [3.0.0-beta.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.2.0...@megafon/ui-core@3.0.0-beta.0) (2022-01-19)
65
+
66
+
67
+ ### Features
68
+
69
+ * **colors:** css custom properties and color themes support ([b19a9a5](https://github.com/MegafonWebLab/megafon-ui/commit/b19a9a5112ebc7427d60f6514d606dd9d71ca444))
70
+
71
+
72
+ ### BREAKING CHANGES
73
+
74
+ * **colors:** read commit description
75
+
76
+
77
+
78
+
79
+
6
80
  # [2.2.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.1.4...@megafon/ui-core@2.2.0) (2021-12-29)
7
81
 
8
82
 
@@ -1,10 +1,3 @@
1
- h1,
2
- h2,
3
- h3,
4
- h4,
5
- h5 {
6
- margin: 0;
7
- }
8
1
  .color-item {
9
2
  display: -webkit-box;
10
3
  display: -ms-flexbox;
@@ -46,7 +39,7 @@ h5 {
46
39
  line-height: 20px;
47
40
  }
48
41
  .color-item__code {
49
- color: #33333380;
42
+ color: var(--spbSky3);
50
43
  font-size: 12px;
51
44
  line-height: 18px;
52
45
  }
@@ -23,7 +23,7 @@ var ColorItem = function ColorItem(_ref) {
23
23
  }), !!parentColorCode && /*#__PURE__*/React.createElement("div", {
24
24
  className: cn('parent-color'),
25
25
  style: {
26
- background: parentColorCode
26
+ background: "var(--".concat(parentColorCode, ")")
27
27
  }
28
28
  })), /*#__PURE__*/React.createElement("span", {
29
29
  className: cn('name')
@@ -1,14 +1,7 @@
1
- h1,
2
- h2,
3
- h3,
4
- h4,
5
- h5 {
6
- margin: 0;
7
- }
8
1
  .colors__inner {
9
2
  margin: 0 -80px;
10
3
  padding: 56px 80px 40px;
11
- background-color: #F6F6F6;
4
+ background-color: var(--spbSky0);
12
5
  }
13
6
  @media screen and (max-width: 1120px) {
14
7
  .colors__inner {
@@ -90,7 +83,6 @@ h5 {
90
83
  .colors__description {
91
84
  position: relative;
92
85
  padding-top: 15px;
93
- color: #33333380;
94
86
  font-size: 12px;
95
87
  line-height: 18px;
96
88
  text-align: center;
@@ -198,7 +190,7 @@ h5 {
198
190
  display: block;
199
191
  width: 100%;
200
192
  height: 1px;
201
- background-color: #D8D8D8;
193
+ background-color: var(--spbSky2);
202
194
  -webkit-transform: translateY(-50%);
203
195
  transform: translateY(-50%);
204
196
  }
@@ -209,7 +201,7 @@ h5 {
209
201
  position: absolute;
210
202
  width: 1px;
211
203
  height: 4px;
212
- background-color: #D8D8D8;
204
+ background-color: var(--spbSky2);
213
205
  }
214
206
  .colors__underline:after,
215
207
  .colors__underline:before {
@@ -1,7 +1,9 @@
1
1
  import "core-js/modules/es.symbol";
2
2
  import "core-js/modules/es.symbol.description";
3
+ import "core-js/modules/es.array.includes";
3
4
  import "core-js/modules/es.array.map";
4
5
  import "core-js/modules/es.function.name";
6
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
7
  import _extends from "@babel/runtime/helpers/extends";
6
8
  import * as React from 'react';
7
9
  import { cnCreate } from '@megafon/ui-helpers';
@@ -103,10 +105,55 @@ var basic = colorsData.basic,
103
105
  gradientColors = colorsData.gradientColors,
104
106
  staticColors = colorsData.staticColors,
105
107
  staticOpacity = colorsData.staticOpacity,
106
- soft = colorsData.soft;
108
+ soft = colorsData.soft; // TODO: refactor this
109
+
110
+ var getThemeFromLocalStorage = function getThemeFromLocalStorage() {
111
+ var theme = 'light';
112
+
113
+ if (typeof window !== 'undefined') {
114
+ var localStorageTheme = String(window.localStorage.getItem('theme'));
115
+
116
+ if (['light', 'dark'].includes(localStorageTheme)) {
117
+ theme = localStorageTheme;
118
+ }
119
+ }
120
+
121
+ return theme;
122
+ };
123
+
107
124
  var cn = cnCreate('colors');
108
125
 
109
126
  var Colors = function Colors() {
127
+ var _React$useState = React.useState(getThemeFromLocalStorage()),
128
+ _React$useState2 = _slicedToArray(_React$useState, 2),
129
+ setCurrentTheme = _React$useState2[1];
130
+
131
+ var getCurrentColorValue = function getCurrentColorValue(code) {
132
+ return typeof document !== 'undefined' ? document.documentElement.style.getPropertyValue("--".concat(code)) : '';
133
+ };
134
+
135
+ React.useEffect(function () {
136
+ // theme switcher from src/gatsby-theme-docz/components/SideBar/index.tsx
137
+ var themeSwitcher = document.querySelector('[data-current-theme]');
138
+
139
+ if (themeSwitcher) {
140
+ var themeSwitcherObserver = new MutationObserver(function (mutationsList) {
141
+ var data = mutationsList[0];
142
+ setCurrentTheme(data.oldValue === 'light' ? 'dark' : 'light');
143
+ });
144
+ var config = {
145
+ attributeOldValue: true,
146
+ attributeFilter: ['data-current-theme']
147
+ };
148
+ themeSwitcherObserver.observe(themeSwitcher, config);
149
+ return function () {
150
+ return themeSwitcherObserver.disconnect();
151
+ };
152
+ }
153
+
154
+ return undefined;
155
+ }, []);
156
+
110
157
  var renderUnderline = function renderUnderline() {
111
158
  return /*#__PURE__*/React.createElement("div", {
112
159
  className: cn('underline')
@@ -142,7 +189,7 @@ var Colors = function Colors() {
142
189
  return /*#__PURE__*/React.createElement(ColorItem, {
143
190
  className: cn('item'),
144
191
  colorName: name,
145
- colorCode: code,
192
+ colorCode: getCurrentColorValue(code),
146
193
  key: name,
147
194
  border: border
148
195
  });
@@ -172,7 +219,7 @@ var Colors = function Colors() {
172
219
  return /*#__PURE__*/React.createElement(ColorItem, {
173
220
  className: cn('item'),
174
221
  colorName: name,
175
- colorCode: code,
222
+ colorCode: getCurrentColorValue(code),
176
223
  gradient: gradient,
177
224
  key: name,
178
225
  border: border
@@ -204,7 +251,7 @@ var Colors = function Colors() {
204
251
  soft: true
205
252
  }),
206
253
  colorName: name,
207
- colorCode: code,
254
+ colorCode: getCurrentColorValue(code),
208
255
  parentColorCode: parentColor,
209
256
  key: name
210
257
  });
@@ -4,34 +4,35 @@ var colors = {
4
4
  colorsGroup: [{
5
5
  description: 'Основные цвета бренда',
6
6
  colors: [{
7
- name: 'Green',
8
- code: '#00B956'
7
+ name: 'Brand Green',
8
+ code: 'brandGreen'
9
9
  }, {
10
- name: 'Purple',
11
- code: '#731982'
10
+ name: 'Brand Purple',
11
+ code: 'brandPurple'
12
12
  }]
13
13
  }, {
14
14
  description: 'Градация оттенков серого',
15
15
  colors: [{
16
16
  name: 'Base',
17
- code: '#FFFFFF',
18
- border: '1px solid #EDEDED'
17
+ code: 'base',
18
+ border: '1px solid var(--spbSky1)'
19
19
  }, {
20
20
  name: 'Content',
21
- code: '#333333'
21
+ code: 'content',
22
+ border: '1px solid var(--spbSky1)'
22
23
  }, {
23
24
  name: 'Spb Sky 0',
24
- code: '#F6F6F6',
25
- border: '2px solid #EDEDED'
25
+ code: 'spbSky0',
26
+ border: '2px solid var(--spbSky1)'
26
27
  }, {
27
28
  name: 'Spb Sky 1',
28
- code: '#EDEDED'
29
+ code: 'spbSky1'
29
30
  }, {
30
31
  name: 'Spb Sky 2',
31
- code: '#D8D8D8'
32
+ code: 'spbSky2'
32
33
  }, {
33
34
  name: 'Spb Sky 3',
34
- code: '#999999'
35
+ code: 'spbSky3'
35
36
  }]
36
37
  }]
37
38
  },
@@ -41,16 +42,16 @@ var colors = {
41
42
  description: 'Акцентные цвета',
42
43
  colors: [{
43
44
  name: 'Warm Red C',
44
- code: '#EB5A40'
45
+ code: 'warmRedC'
45
46
  }, {
46
47
  name: '137C',
47
- code: '#FFA717'
48
+ code: '137C'
48
49
  }, {
49
50
  name: '311C',
50
- code: '#5BD9E5'
51
+ code: '311C'
51
52
  }, {
52
53
  name: 'Reflex Blue',
53
- code: '#444189'
54
+ code: 'reflexBlue'
54
55
  }]
55
56
  }
56
57
  },
@@ -60,22 +61,22 @@ var colors = {
60
61
  description: 'Системные цвета, используемые для отображения состояний интерфейсов и ссылок',
61
62
  colors: [{
62
63
  name: 'Fury',
63
- code: '#F62434'
64
+ code: 'fury'
64
65
  }, {
65
66
  name: 'System Blue',
66
- code: '#34AAF2'
67
+ code: 'systemBlue'
67
68
  }, {
68
69
  name: 'Background',
69
- code: '#FFFFFF'
70
+ code: 'background'
70
71
  }, {
71
72
  name: 'Button Hov. G.',
72
- code: '#10E272'
73
+ code: 'buttonHoverGreen'
73
74
  }, {
74
75
  name: 'Button Hov. P.',
75
- code: '#A500BF'
76
+ code: 'buttonhoverPurple'
76
77
  }, {
77
78
  name: 'Button Down',
78
- code: '#404D46'
79
+ code: 'buttonDown'
79
80
  }]
80
81
  }
81
82
  },
@@ -85,15 +86,15 @@ var colors = {
85
86
  description: 'Градиентные заливки ',
86
87
  colors: [{
87
88
  name: 'Basic',
88
- code: '#01873F #00B956 #14CD6A',
89
+ code: 'gradientBasic',
89
90
  gradient: 'linear-gradient(90deg, #01873F 0%, #00B956 74%, #14CD6A 100%)'
90
91
  }, {
91
92
  name: 'VIP',
92
- code: '#5B1168 #731982 #821E93',
93
+ code: 'gradientVIP',
93
94
  gradient: 'linear-gradient(90deg, #5B1168 0%, #731982 74%, #821E93 100%)'
94
95
  }, {
95
96
  name: 'Exclusive',
96
- code: '#2A2674 #444189 #504D93',
97
+ code: 'gradientExclusive',
97
98
  gradient: 'linear-gradient(90deg, #2A2674 0%, #444189 74%, #504D93 100%)'
98
99
  }]
99
100
  }
@@ -104,11 +105,12 @@ var colors = {
104
105
  description: 'Цвета не зависящие от темы',
105
106
  colors: [{
106
107
  name: 'STC White',
107
- code: '#FFFFFFF',
108
- border: '1px solid #EDEDED'
108
+ code: 'stcWhite',
109
+ border: '1px solid var(--spbSky1)'
109
110
  }, {
110
111
  name: 'STC Black',
111
- code: '#333333'
112
+ code: 'stcBlack',
113
+ border: '1px solid var(--spbSky1)'
112
114
  }]
113
115
  }
114
116
  },
@@ -118,31 +120,36 @@ var colors = {
118
120
  description: 'Цвета c прозрачностью не зависящие от темы',
119
121
  colors: [{
120
122
  name: 'STC White 5%',
121
- code: '#FFFFFF0D',
122
- border: '1px solid #EDEDED'
123
+ code: 'stcWhite5',
124
+ border: '1px solid var(--spbSky1)'
123
125
  }, {
124
126
  name: 'STC White 10%',
125
- code: '#FFFFFF1A',
126
- border: '1px solid #EDEDED'
127
+ code: 'stcWhite10',
128
+ border: '1px solid var(--spbSky1)'
127
129
  }, {
128
130
  name: 'STC White 20%',
129
- code: '#FFFFFF33',
130
- border: '1px solid #EDEDED'
131
+ code: 'stcWhite20',
132
+ border: '1px solid var(--spbSky1)'
131
133
  }, {
132
134
  name: 'STC White 50%',
133
- code: '#FFFFFF80'
135
+ code: 'stcWhite50',
136
+ border: '1px solid var(--spbSky1)'
134
137
  }, {
135
138
  name: 'STC Black 5%',
136
- code: '#3333330D'
139
+ code: 'stcBlack5',
140
+ border: '1px solid var(--spbSky1)'
137
141
  }, {
138
142
  name: 'STC Black 10%',
139
- code: '#3333331A'
143
+ code: 'stcBlack10',
144
+ border: '1px solid var(--spbSky1)'
140
145
  }, {
141
146
  name: 'STC Black 20%',
142
- code: '#33333333'
147
+ code: 'stcBlack20',
148
+ border: '1px solid var(--spbSky1)'
143
149
  }, {
144
150
  name: 'STC Black 50%',
145
- code: '#33333380'
151
+ code: 'stcBlack50',
152
+ border: '1px solid var(--spbSky1)'
146
153
  }]
147
154
  }
148
155
  },
@@ -151,61 +158,61 @@ var colors = {
151
158
  colorsList: {
152
159
  description: 'Дополнительная (вспомогательная) палитра, образованная от Basic, Secondary и System цветов. Каждый цвет из Soft палитры работает в паре с его родительским цветом.',
153
160
  colors: [{
154
- name: 'Green 80',
155
- code: '#0CDC78',
156
- parentColor: '#00B956'
161
+ name: 'Brand Green 80',
162
+ code: 'brandGreen80',
163
+ parentColor: 'green'
157
164
  }, {
158
- name: 'Purple 80',
159
- code: '#AA67C1',
160
- parentColor: '#731982'
165
+ name: 'Brand Purple 80',
166
+ code: 'brandPurple80',
167
+ parentColor: 'purple'
161
168
  }, {
162
169
  name: 'Warm Red C 80',
163
- code: '#FF765D',
164
- parentColor: '#EB5A40'
170
+ code: 'warmRedC80',
171
+ parentColor: 'warmRedC'
165
172
  }, {
166
173
  name: '137C 80',
167
- code: '#FFB945',
168
- parentColor: '#FFB945'
174
+ code: '137C80',
175
+ parentColor: '137C'
169
176
  }, {
170
177
  name: '311C 80',
171
- code: '#62E3FF',
172
- parentColor: '#5BD9E5'
178
+ code: '311C80',
179
+ parentColor: '311C'
173
180
  }, {
174
181
  name: 'Reflex Blue 80',
175
- code: '#554FC9',
176
- parentColor: '#444189'
182
+ code: 'reflexBlue80',
183
+ parentColor: 'reflexBlue'
177
184
  }, {
178
185
  name: 'Fury 80',
179
- code: '#F8505D',
180
- parentColor: '#F62434'
186
+ code: 'fury80',
187
+ parentColor: 'fury'
181
188
  }, {
182
- name: 'Green 20',
183
- code: '#DDFFEC',
184
- parentColor: '#00B956'
189
+ name: 'Brand Green 20',
190
+ code: 'brandGreen20',
191
+ parentColor: 'green'
185
192
  }, {
186
- name: 'Purple 20',
187
- code: '#FFEEFF',
188
- parentColor: '#731982'
193
+ name: 'Brand Purple 20',
194
+ code: 'brandPurple20',
195
+ parentColor: 'purple'
189
196
  }, {
190
197
  name: 'Warm Red C 20',
191
- code: '#FFCFC7',
192
- parentColor: '#EB5A40'
198
+ code: 'warmRedC20',
199
+ parentColor: 'warmRedC'
193
200
  }, {
194
201
  name: '137C 20',
195
- code: '#FFEDD1',
196
- parentColor: '#FFB945'
202
+ code: '137C20',
203
+ parentColor: '137C'
197
204
  }, {
198
205
  name: '311C 20',
199
- code: '#E1FAFF',
200
- parentColor: '#5BD9E5'
206
+ code: '311C20',
207
+ parentColor: '311C'
201
208
  }, {
202
209
  name: 'Reflex Blue 20',
203
- code: '#EBEAFF',
204
- parentColor: '#444189'
210
+ code: 'reflexBlue20',
211
+ parentColor: 'reflexBlue'
205
212
  }, {
206
213
  name: 'Fury 20',
207
- code: '#FFC5C9',
208
- parentColor: '#F62434'
214
+ code: 'fury20',
215
+ parentColor: 'fury'
209
216
  }]
210
217
  }
211
218
  }
@@ -1,22 +1,15 @@
1
- h1,
2
- h2,
3
- h3,
4
- h4,
5
- h5 {
6
- margin: 0;
7
- }
8
1
  .mfui-accordion {
9
- border-top: 1px solid #D8D8D8;
10
- border-bottom: 1px solid #D8D8D8;
2
+ border-top: 1px solid var(--spbSky2);
3
+ border-bottom: 1px solid var(--spbSky2);
11
4
  }
12
5
  .mfui-accordion + .mfui-accordion {
13
6
  border-top: none;
14
7
  }
15
8
  .mfui-accordion:not(.mfui-accordion_open) .mfui-accordion__title-wrap:hover {
16
- background: rgba(237, 237, 237, 0.5);
9
+ background: var(--spbSky0);
17
10
  }
18
11
  .mfui-accordion.mfui-accordion_open .mfui-accordion__title-wrap {
19
- background: #EDEDED;
12
+ background: var(--spbSky1);
20
13
  }
21
14
  .mfui-accordion__title-wrap {
22
15
  position: relative;
@@ -42,6 +35,7 @@ h5 {
42
35
  -webkit-transform: translateY(-50%);
43
36
  transform: translateY(-50%);
44
37
  opacity: 1;
38
+ fill: var(--content);
45
39
  }
46
40
  .mfui-accordion__content-inner {
47
41
  padding: 24px 16px;
@@ -66,5 +60,5 @@ h5 {
66
60
  padding-bottom: 24px;
67
61
  }
68
62
  .mfui-accordion__icon {
69
- fill: #000000;
63
+ fill: var(--content);
70
64
  }
@@ -20,7 +20,7 @@ export interface IAccordionProps extends IFilterDataAttrs {
20
20
  titleWrap?: string;
21
21
  };
22
22
  /** Обработчик клика */
23
- onClickAccordion?: (isOpened: boolean, title: string | React.ReactNode | React.ReactNode[]) => void;
23
+ onClickAccordion?: (isOpened: boolean) => void;
24
24
  }
25
25
  declare const Accordion: React.FC<IAccordionProps>;
26
26
  export default Accordion;
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import * as React from 'react';
4
- import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
4
+ import { cnCreate, filterDataAttrs, checkEventIsClickOrEnterPress } from '@megafon/ui-helpers';
5
5
  import * as PropTypes from 'prop-types';
6
6
  import Collapse from "../Collapse/Collapse";
7
7
  import Header from "../Header/Header";
@@ -52,9 +52,11 @@ var Accordion = function Accordion(_ref) {
52
52
  setIsOpenedState(isOpened);
53
53
  }, [isOpened]);
54
54
 
55
- var handleClickTitle = function handleClickTitle() {
56
- onClickAccordion && onClickAccordion(!isOpenedState, title);
57
- setIsOpenedState(!isOpenedState);
55
+ var handleClickTitle = function handleClickTitle(e) {
56
+ if (checkEventIsClickOrEnterPress(e)) {
57
+ onClickAccordion && onClickAccordion(!isOpenedState);
58
+ setIsOpenedState(!isOpenedState);
59
+ }
58
60
  };
59
61
 
60
62
  var openedClassName = isOpenedState ? openedClass : undefined;
@@ -65,10 +67,13 @@ var Accordion = function Accordion(_ref) {
65
67
  }, [className, rootPropsClasses, openedClassName])
66
68
  }), /*#__PURE__*/React.createElement("div", {
67
69
  className: cn('title-wrap', [titleWrapPropsClasses]),
68
- onClick: handleClickTitle
70
+ onClick: handleClickTitle,
71
+ onKeyDown: handleClickTitle
69
72
  }, /*#__PURE__*/React.createElement(Header, {
70
73
  as: "h5"
71
74
  }, title), /*#__PURE__*/React.createElement("div", {
75
+ tabIndex: 0,
76
+ role: "button",
72
77
  className: cn('icon-box', {
73
78
  open: isOpenedState
74
79
  })
@@ -1,10 +1,3 @@
1
- h1,
2
- h2,
3
- h3,
4
- h4,
5
- h5 {
6
- margin: 0;
7
- }
8
1
  .mfui-banner {
9
2
  position: relative;
10
3
  overflow: hidden;
@@ -100,10 +93,10 @@ h5 {
100
93
  background-color: transparent;
101
94
  }
102
95
  .mfui-banner__pagination_theme_green {
103
- background-color: #00B956;
96
+ background-color: var(--brandGreen);
104
97
  }
105
98
  .mfui-banner__pagination_theme_dark {
106
- background-color: rgba(0, 0, 0, 0.25);
99
+ background-color: var(--stcBlack20);
107
100
  }
108
101
  .mfui-banner__dot {
109
102
  width: 12px;
@@ -1,10 +1,3 @@
1
- h1,
2
- h2,
3
- h3,
4
- h4,
5
- h5 {
6
- margin: 0;
7
- }
8
1
  .mfui-banner-dot {
9
2
  display: -webkit-box;
10
3
  display: -ms-flexbox;
@@ -27,14 +20,14 @@ h5 {
27
20
  width: 100%;
28
21
  height: 100%;
29
22
  border-radius: 50%;
30
- background-color: #FFFFFF80;
23
+ background-color: var(--stcWhite50);
31
24
  }
32
25
  .mfui-banner-dot_active {
33
26
  padding: 0;
34
27
  cursor: default;
35
28
  }
36
29
  .mfui-banner-dot_active:before {
37
- background-color: #FFFFFF;
30
+ background-color: var(--stcWhite);
38
31
  }
39
32
  .mfui-banner-dot_active.mfui-banner-dot_timer:before {
40
33
  display: none;
@@ -54,8 +47,8 @@ h5 {
54
47
  transform-origin: center;
55
48
  -webkit-animation: timer linear;
56
49
  animation: timer linear;
57
- fill: #FFFFFF80;
58
- stroke: #FFFFFF;
50
+ fill: var(--stcWhite50);
51
+ stroke: var(--base);
59
52
  stroke-width: 100;
60
53
  stroke-dasharray: 1000;
61
54
  }