@megafon/ui-core 4.0.0-beta.4 → 4.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 (62) hide show
  1. package/CHANGELOG.md +110 -28
  2. package/dist/es/components/Accordion/Accordion.js +2 -2
  3. package/dist/es/components/Banner/Banner.d.ts +2 -0
  4. package/dist/es/components/Banner/Banner.js +46 -20
  5. package/dist/es/components/Button/Button.css +77 -0
  6. package/dist/es/components/Button/Button.d.ts +3 -0
  7. package/dist/es/components/Button/Button.js +12 -4
  8. package/dist/es/components/Calendar/Calendar.js +18 -2
  9. package/dist/es/components/Calendar/components/Month/Month.js +4 -4
  10. package/dist/es/components/Logo/Logo.js +22 -6
  11. package/dist/es/components/Notification/Notification.css +131 -33
  12. package/dist/es/components/Notification/Notification.d.ts +26 -0
  13. package/dist/es/components/Notification/Notification.js +189 -13
  14. package/dist/es/components/Search/Search.css +124 -6
  15. package/dist/es/components/Search/Search.d.ts +2 -0
  16. package/dist/es/components/Search/Search.js +20 -7
  17. package/dist/es/components/Select/Select.css +159 -26
  18. package/dist/es/components/Select/Select.js +25 -18
  19. package/dist/es/components/Switcher/Switcher.css +3 -0
  20. package/dist/es/components/Switcher/Switcher.d.ts +1 -0
  21. package/dist/es/components/Switcher/Switcher.js +4 -3
  22. package/dist/es/components/Tabs/Tab.d.ts +1 -0
  23. package/dist/es/components/Tabs/Tab.js +2 -1
  24. package/dist/es/components/Tabs/Tabs.js +4 -4
  25. package/dist/es/components/Tooltip/Tooltip.d.ts +4 -0
  26. package/dist/es/components/Tooltip/Tooltip.js +32 -1
  27. package/dist/es/index.d.ts +0 -1
  28. package/dist/es/index.js +0 -1
  29. package/dist/lib/components/Accordion/Accordion.js +2 -2
  30. package/dist/lib/components/Banner/Banner.d.ts +2 -0
  31. package/dist/lib/components/Banner/Banner.js +46 -20
  32. package/dist/lib/components/Button/Button.css +77 -0
  33. package/dist/lib/components/Button/Button.d.ts +3 -0
  34. package/dist/lib/components/Button/Button.js +12 -4
  35. package/dist/lib/components/Calendar/Calendar.js +17 -1
  36. package/dist/lib/components/Calendar/components/Month/Month.js +4 -4
  37. package/dist/lib/components/Logo/Logo.js +22 -6
  38. package/dist/lib/components/Notification/Notification.css +131 -33
  39. package/dist/lib/components/Notification/Notification.d.ts +26 -0
  40. package/dist/lib/components/Notification/Notification.js +192 -13
  41. package/dist/lib/components/Search/Search.css +124 -6
  42. package/dist/lib/components/Search/Search.d.ts +2 -0
  43. package/dist/lib/components/Search/Search.js +20 -8
  44. package/dist/lib/components/Select/Select.css +159 -26
  45. package/dist/lib/components/Select/Select.js +25 -19
  46. package/dist/lib/components/Switcher/Switcher.css +3 -0
  47. package/dist/lib/components/Switcher/Switcher.d.ts +1 -0
  48. package/dist/lib/components/Switcher/Switcher.js +4 -3
  49. package/dist/lib/components/Tabs/Tab.d.ts +1 -0
  50. package/dist/lib/components/Tabs/Tab.js +2 -1
  51. package/dist/lib/components/Tabs/Tabs.js +4 -4
  52. package/dist/lib/components/Tooltip/Tooltip.d.ts +4 -0
  53. package/dist/lib/components/Tooltip/Tooltip.js +36 -1
  54. package/dist/lib/index.d.ts +0 -1
  55. package/dist/lib/index.js +0 -8
  56. package/package.json +3 -3
  57. package/dist/es/components/InputLabel/InputLabel.css +0 -5
  58. package/dist/es/components/InputLabel/InputLabel.d.ts +0 -10
  59. package/dist/es/components/InputLabel/InputLabel.js +0 -24
  60. package/dist/lib/components/InputLabel/InputLabel.css +0 -5
  61. package/dist/lib/components/InputLabel/InputLabel.d.ts +0 -10
  62. package/dist/lib/components/InputLabel/InputLabel.js +0 -43
package/CHANGELOG.md CHANGED
@@ -3,106 +3,188 @@
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
- # [4.0.0-beta.4](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.3...@megafon/ui-core@4.0.0-beta.4) (2022-06-23)
6
+ # [4.0.0-beta.7](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.6...@megafon/ui-core@4.0.0-beta.7) (2022-07-13)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
- * **textfield:** fix textarea design bugs ([50cd9c6](https://github.com/MegafonWebLab/megafon-ui/commit/50cd9c6f402318c9e1a45d7da6abd6753aec875f))
12
- * **textfield:** update textarea scroll and resize ([a789d00](https://github.com/MegafonWebLab/megafon-ui/commit/a789d007cbee6e666c6d9e6148aeb267d0f4e5e1))
11
+ * **select:** fix styles ([3e79c68](https://github.com/MegafonWebLab/megafon-ui/commit/3e79c68fecde72e515b7ef52d38d9188e51680f6))
12
+
13
+
14
+
15
+
16
+
17
+ # [4.0.0-beta.6](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.5...@megafon/ui-core@4.0.0-beta.6) (2022-07-05)
18
+
19
+
20
+ ### Features
21
+
22
+ * **inputlabel:** component removed ([1f236ac](https://github.com/MegafonWebLab/megafon-ui/commit/1f236ace90acfd7ea1917422677fa24c1c5abdf4))
23
+ * **search:** component redesign ([d6f11eb](https://github.com/MegafonWebLab/megafon-ui/commit/d6f11eb7ee810b835879c7a31e5e01c426060ea1))
24
+ * **select:** component redesign ([aeeda00](https://github.com/MegafonWebLab/megafon-ui/commit/aeeda00dfc1db70421a495a686954e19eecf815d))
13
25
 
14
26
 
15
27
  ### BREAKING CHANGES
16
28
 
17
- * **textfield:** add defaultTransitionTiming in less global variables
29
+ * **inputlabel:** inputLabel component removed due to non-use
30
+
18
31
 
19
32
 
20
33
 
21
34
 
35
+ # [4.0.0-beta.5](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.12.0...@megafon/ui-core@4.0.0-beta.5) (2022-06-29)
22
36
 
23
- # [4.0.0-beta.3](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.2...@megafon/ui-core@4.0.0-beta.3) (2022-06-08)
37
+
38
+ ### Bug Fixes
39
+
40
+ * **textfield:** fix textarea design bugs ([287d426](https://github.com/MegafonWebLab/megafon-ui/commit/287d42644b24ca0e1a3824d5907d8af78293d0e3))
41
+ * **textfield:** update textarea scroll and resize ([9dbce52](https://github.com/MegafonWebLab/megafon-ui/commit/9dbce52d6bc3a71076ffdf2365715204231da774))
24
42
 
25
43
 
26
44
  ### Features
27
45
 
28
- * **tabs:** update by new design ([0a8a175](https://github.com/MegafonWebLab/megafon-ui/commit/0a8a175aa5e30758742c1c663da8a406e30dc3dd))
46
+ * **accordion:** update by new design ([92dab3a](https://github.com/MegafonWebLab/megafon-ui/commit/92dab3a367544d8507526e7a57a0a9a4015e3acf))
47
+ * **caption:** add new Caption component; update .smallFont() less mixin ([b02a3f7](https://github.com/MegafonWebLab/megafon-ui/commit/b02a3f73ed8d5390d8427ab0a6bc62210710ba40))
48
+ * **paragraph:** remove prop size; add new prop; add 'pale' option to colors ([ffb6bc7](https://github.com/MegafonWebLab/megafon-ui/commit/ffb6bc709a4ef91536e359d5f9edc5501caf0c2c))
49
+ * **tabs:** update by new design ([20ae2cc](https://github.com/MegafonWebLab/megafon-ui/commit/20ae2cc695e1245b9cd06fe37a9e4e3bb0c7eaae))
50
+ * **textfield:** update by new design ([24ec769](https://github.com/MegafonWebLab/megafon-ui/commit/24ec769aeddac9a198941727aaca02ad0fb816f1))
29
51
 
30
52
 
31
53
  ### BREAKING CHANGES
32
54
 
55
+ * **textfield:** add defaultTransitionTiming in less global variables
33
56
  * **tabs:** new prop autoWidth added
34
57
  size prop small vallue removed
35
58
  new sizes
59
+ * **textfield:** add placeholders text by default
60
+ label element positon changed
61
+ if label prop not setted, label element has text from placeholder (default or in props)
62
+ * **accordion:** change next-sibling accordion styles
63
+ * **caption:** .smallFont() less mixin line-height rule now set to 18px instead of 16px
64
+ either accept new rules or manually add line-height: 16px in your components
65
+ * **paragraph:** prop 'size' is no longer exists.
66
+ use component Caption instead of Paragraph size="small"
36
67
 
37
68
 
38
69
 
39
70
 
40
71
 
41
- # [4.0.0-beta.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.1...@megafon/ui-core@4.0.0-beta.2) (2022-06-01)
72
+ # [3.12.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.11.0...@megafon/ui-core@3.12.0) (2022-06-28)
42
73
 
43
74
 
44
75
  ### Features
45
76
 
46
- * **textfield:** update by new design ([8d11972](https://github.com/MegafonWebLab/megafon-ui/commit/8d11972c73374df0d0a66d4607eb87bb4190e92e))
77
+ * **tab:** add data-attribute for inner element ([43e58e1](https://github.com/MegafonWebLab/megafon-ui/commit/43e58e12b8da661020f4b48f55245492c21ad376))
47
78
 
48
79
 
49
- ### BREAKING CHANGES
50
80
 
51
- * **textfield:** add placeholders text by default
52
- label element positon changed
53
- if label prop not setted, label element has text from placeholder (default or in props)
54
81
 
55
82
 
83
+ # [3.11.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.10.1...@megafon/ui-core@3.11.0) (2022-06-21)
56
84
 
57
85
 
86
+ ### Bug Fixes
58
87
 
59
- # [4.0.0-beta.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.0...@megafon/ui-core@4.0.0-beta.1) (2022-05-27)
88
+ * **button:** fix font styles for extra small size ([f475b05](https://github.com/MegafonWebLab/megafon-ui/commit/f475b05ab9d62aa56645fb90ccdef88996e72a70))
60
89
 
61
90
 
62
91
  ### Features
63
92
 
64
- * **accordion:** update by new design ([331f8dc](https://github.com/MegafonWebLab/megafon-ui/commit/331f8dcb55d3577c086eb0e6beb00fd82f064943))
93
+ * **button:** add prop ellipsis ([1978277](https://github.com/MegafonWebLab/megafon-ui/commit/1978277a918cb680e32259042c1a7e3c58056b1b))
94
+ * **notification:** add ability to display button and collapse ([a5fe2f0](https://github.com/MegafonWebLab/megafon-ui/commit/a5fe2f0730b71469c2fb06a148b0e4574adb2d7b))
95
+
65
96
 
66
97
 
67
- ### BREAKING CHANGES
68
98
 
69
- * **accordion:** change next-sibling accordion styles
70
99
 
100
+ ## [3.10.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.10.0...@megafon/ui-core@3.10.1) (2022-06-07)
71
101
 
72
102
 
103
+ ### Bug Fixes
104
+
105
+ * **banner:** fix bug with hover on autoplay ([93271d8](https://github.com/MegafonWebLab/megafon-ui/commit/93271d8c8f9dd900c031d41f89207f61c41db063))
73
106
 
74
107
 
75
- # [4.0.0-beta.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.5.3-beta.1...@megafon/ui-core@4.0.0-beta.0) (2022-05-24)
108
+
109
+
110
+
111
+ # [3.10.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.9.0...@megafon/ui-core@3.10.0) (2022-05-30)
76
112
 
77
113
 
78
114
  ### Features
79
115
 
80
- * **caption:** add new Caption component; update .smallFont() less mixin ([603bed3](https://github.com/MegafonWebLab/megafon-ui/commit/603bed3ce782676b22381e3d4df5dae141fb015c))
81
- * **paragraph:** remove prop size; add new prop; add 'pale' option to colors ([ef15841](https://github.com/MegafonWebLab/megafon-ui/commit/ef15841474473739d3ac88da7a8737e183ff288a))
116
+ * **banner:** add new prop 'pauseOnHover' ([ac654c3](https://github.com/MegafonWebLab/megafon-ui/commit/ac654c3c23821a5d29ffd5cd91ff7337b3d087c1))
82
117
 
83
118
 
84
- ### BREAKING CHANGES
85
119
 
86
- * **caption:** .smallFont() less mixin line-height rule now set to 18px instead of 16px
87
- either accept new rules or manually add line-height: 16px in your components
88
- * **paragraph:** prop 'size' is no longer exists.
89
- use component Caption instead of Paragraph size="small"
90
120
 
91
121
 
122
+ # [3.9.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.8.0...@megafon/ui-core@3.9.0) (2022-05-27)
92
123
 
93
124
 
125
+ ### Bug Fixes
94
126
 
95
- ## [3.5.3-beta.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.5.3-beta.0...@megafon/ui-core@3.5.3-beta.1) (2022-05-06)
127
+ * **select:** fix selected item color when value is zero ([9847095](https://github.com/MegafonWebLab/megafon-ui/commit/98470955ef813504d4bfa4cd4d3aba77b5458446))
96
128
 
97
- **Note:** Version bump only for package @megafon/ui-core
98
129
 
130
+ ### Features
99
131
 
132
+ * **switcher:** add data-attribute for inner element ([793a022](https://github.com/MegafonWebLab/megafon-ui/commit/793a0224ab957b938e67dd1b4d16c2389a9fb6f8))
133
+ * **tooltip:** add portal selector props ([6188832](https://github.com/MegafonWebLab/megafon-ui/commit/6188832e9ba212e7a8182333aba06d77c3e979d6))
100
134
 
101
135
 
102
136
 
103
- ## [3.5.3-beta.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.5.2...@megafon/ui-core@3.5.3-beta.0) (2022-04-13)
104
137
 
105
- **Note:** Version bump only for package @megafon/ui-core
138
+
139
+ # [3.8.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.7.0...@megafon/ui-core@3.8.0) (2022-05-17)
140
+
141
+
142
+ ### Features
143
+
144
+ * **notification:** add props classes to notification component ([608a424](https://github.com/MegafonWebLab/megafon-ui/commit/608a4246eb99af354fb7cf8ab98c2ed513d87b66))
145
+
146
+
147
+
148
+
149
+
150
+ # [3.7.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.6.0...@megafon/ui-core@3.7.0) (2022-05-05)
151
+
152
+
153
+ ### Bug Fixes
154
+
155
+ * **logo:** fix horizontal logo svg ([76655eb](https://github.com/MegafonWebLab/megafon-ui/commit/76655ebb82650cc2617750af0b2b2726d3ebcbf3))
156
+
157
+
158
+ ### Features
159
+
160
+ * **button:** added extra small size ([a26da46](https://github.com/MegafonWebLab/megafon-ui/commit/a26da4601de7e7c81c40eabf9a87ccdbf18cb790))
161
+
162
+
163
+
164
+
165
+
166
+ # [3.6.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.5.3...@megafon/ui-core@3.6.0) (2022-04-25)
167
+
168
+
169
+ ### Bug Fixes
170
+
171
+ * **calendar:** fix go to start day after user choice ([8bbce10](https://github.com/MegafonWebLab/megafon-ui/commit/8bbce102d204f7ea7706158f3e6540c86ed3aada))
172
+
173
+
174
+ ### Features
175
+
176
+ * **tooltip:** added prop isPortal for tooltip ([e6f6d17](https://github.com/MegafonWebLab/megafon-ui/commit/e6f6d1749cd99f065c50bac4eb6a9b3592653f8d))
177
+
178
+
179
+
180
+
181
+
182
+ ## [3.5.3](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.5.2...@megafon/ui-core@3.5.3) (2022-04-18)
183
+
184
+
185
+ ### Bug Fixes
186
+
187
+ * **switcher:** fix safari bugs ([65274bc](https://github.com/MegafonWebLab/megafon-ui/commit/65274bc3c5e7385109afff94a8ff3f712c9af097))
106
188
 
107
189
 
108
190
 
@@ -11,9 +11,9 @@ var ArrowDown = function ArrowDown(props) {
11
11
  return /*#__PURE__*/React.createElement("svg", _extends({
12
12
  viewBox: "0 0 32 32"
13
13
  }, props), /*#__PURE__*/React.createElement("path", {
14
+ d: "M11 14h10l-5 6z",
14
15
  fillRule: "evenodd",
15
- clipRule: "evenodd",
16
- d: "M11 14h10l-5 6z"
16
+ clipRule: "evenodd"
17
17
  }));
18
18
  };
19
19
 
@@ -32,6 +32,8 @@ export interface IBannerProps {
32
32
  autoPlay?: boolean;
33
33
  /** Задержка автоматической прокрутки */
34
34
  autoPlayDelay?: number;
35
+ /** Пауза автоматической прокрутки при наведении курсора на компонент */
36
+ pauseOnHover?: boolean;
35
37
  /** Цветовая тема навигации */
36
38
  navTheme?: NavThemeType;
37
39
  /** Обработчик клика по стрелке "вперед" (должен быть обернут в useCallback) */
@@ -49,7 +49,9 @@ var Banner = function Banner(_ref) {
49
49
  onPrevClick = _ref.onPrevClick,
50
50
  onDotClick = _ref.onDotClick,
51
51
  onChange = _ref.onChange,
52
- dataAttrs = _ref.dataAttrs;
52
+ dataAttrs = _ref.dataAttrs,
53
+ _ref$pauseOnHover = _ref.pauseOnHover,
54
+ pauseOnHover = _ref$pauseOnHover === void 0 ? false : _ref$pauseOnHover;
53
55
 
54
56
  var _React$useState = React.useState(),
55
57
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -69,29 +71,42 @@ var Banner = function Banner(_ref) {
69
71
  var _React$useState7 = React.useState(autoPlay),
70
72
  _React$useState8 = _slicedToArray(_React$useState7, 2),
71
73
  isAutoPlaying = _React$useState8[0],
72
- setAutoPlayning = _React$useState8[1];
74
+ setAutoPlaying = _React$useState8[1];
73
75
 
74
76
  var _React$useState9 = React.useState(0),
75
77
  _React$useState10 = _slicedToArray(_React$useState9, 2),
76
78
  activeIndex = _React$useState10[0],
77
79
  setActiveIndex = _React$useState10[1];
78
80
 
81
+ var _React$useState11 = React.useState(autoPlayDelay),
82
+ _React$useState12 = _slicedToArray(_React$useState11, 2),
83
+ delay = _React$useState12[0],
84
+ setDelay = _React$useState12[1];
85
+
86
+ var _React$useState13 = React.useState(false),
87
+ _React$useState14 = _slicedToArray(_React$useState13, 2),
88
+ isIncreasedDelay = _React$useState14[0],
89
+ setIsIncreasedDelay = _React$useState14[1];
90
+
79
91
  var showDotTimer = loop ? isAutoPlaying : isAutoPlaying && !isEnd;
80
- var dotTimerDelay = autoPlayDelay / 1000;
92
+ var dotTimerDelay = delay / 1000;
81
93
  var navArrowTheme = navTheme === NavTheme.DARK ? ArrowTheme.DARK : ArrowTheme.PURPLE;
94
+ var rootRef = React.useRef(null);
82
95
  var increaseAutoplayDelay = React.useCallback(function (_ref2) {
83
96
  var params = _ref2.params,
84
97
  autoplay = _ref2.autoplay;
85
98
 
86
- if (_typeof(params.autoplay) !== 'object' || !autoplay.running) {
99
+ if (_typeof(params.autoplay) !== 'object' || !autoPlay) {
87
100
  return;
88
101
  }
89
102
 
90
103
  autoplay.stop(); // eslint-disable-next-line no-param-reassign
91
104
 
92
105
  params.autoplay.delay = autoPlayDelay * 3;
106
+ setDelay(autoPlayDelay * 3);
107
+ setIsIncreasedDelay(true);
93
108
  autoplay.start();
94
- }, [autoPlayDelay]);
109
+ }, [autoPlay, autoPlayDelay]);
95
110
  var handlePrevClick = React.useCallback(function () {
96
111
  if (!swiperInstance) {
97
112
  return;
@@ -99,8 +114,8 @@ var Banner = function Banner(_ref) {
99
114
 
100
115
  swiperInstance.slidePrev();
101
116
  onPrevClick === null || onPrevClick === void 0 ? void 0 : onPrevClick(swiperInstance.realIndex);
102
- increaseAutoplayDelay(swiperInstance);
103
- }, [swiperInstance, onPrevClick, increaseAutoplayDelay]);
117
+ !isIncreasedDelay && increaseAutoplayDelay(swiperInstance);
118
+ }, [swiperInstance, onPrevClick, isIncreasedDelay, increaseAutoplayDelay]);
104
119
  var handleNextClick = React.useCallback(function () {
105
120
  if (!swiperInstance) {
106
121
  return;
@@ -108,8 +123,8 @@ var Banner = function Banner(_ref) {
108
123
 
109
124
  swiperInstance.slideNext();
110
125
  onNextClick === null || onNextClick === void 0 ? void 0 : onNextClick(swiperInstance.realIndex);
111
- increaseAutoplayDelay(swiperInstance);
112
- }, [swiperInstance, onNextClick, increaseAutoplayDelay]);
126
+ !isIncreasedDelay && increaseAutoplayDelay(swiperInstance);
127
+ }, [swiperInstance, onNextClick, isIncreasedDelay, increaseAutoplayDelay]);
113
128
  var handleDotClick = React.useCallback(function (index) {
114
129
  if (!swiperInstance) {
115
130
  return;
@@ -122,11 +137,8 @@ var Banner = function Banner(_ref) {
122
137
  }
123
138
 
124
139
  onDotClick === null || onDotClick === void 0 ? void 0 : onDotClick(swiperInstance.realIndex);
125
- increaseAutoplayDelay(swiperInstance);
126
- }, [swiperInstance, loop, onDotClick, increaseAutoplayDelay]);
127
- var handleSwiper = React.useCallback(function (swiper) {
128
- setSwiperInstance(swiper);
129
- }, []);
140
+ !isIncreasedDelay && increaseAutoplayDelay(swiperInstance);
141
+ }, [swiperInstance, loop, onDotClick, isIncreasedDelay, increaseAutoplayDelay]);
130
142
  var handleReachBeginning = React.useCallback(function () {
131
143
  setBeginning(true);
132
144
  }, []);
@@ -148,24 +160,37 @@ var Banner = function Banner(_ref) {
148
160
  setActiveIndex(realIndex);
149
161
  onChange === null || onChange === void 0 ? void 0 : onChange(realIndex);
150
162
  }, [onChange]);
151
- var handleAutoplayStop = React.useCallback(function () {
152
- setAutoPlayning(false);
153
- }, []);
163
+ React.useEffect(function () {
164
+ var rootElement = rootRef.current;
165
+
166
+ if (!pauseOnHover || !autoPlay) {
167
+ return;
168
+ }
169
+
170
+ rootElement === null || rootElement === void 0 ? void 0 : rootElement.addEventListener('mouseenter', function () {
171
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay.stop();
172
+ setAutoPlaying(false);
173
+ });
174
+ rootElement === null || rootElement === void 0 ? void 0 : rootElement.addEventListener('mouseleave', function () {
175
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay.start();
176
+ setAutoPlaying(true);
177
+ });
178
+ }, [autoPlay, pauseOnHover, swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.autoplay]);
154
179
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
155
180
  className: cn({
156
181
  'nav-theme': navTheme
157
- }, className)
182
+ }, className),
183
+ ref: rootRef
158
184
  }), /*#__PURE__*/React.createElement(Swiper, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
159
185
  className: cn('swiper'),
160
186
  loop: loop,
161
187
  autoplay: autoPlay ? getAutoPlayConfig(autoPlayDelay) : false,
162
188
  watchSlidesVisibility: true,
163
- onSwiper: handleSwiper,
189
+ onSwiper: setSwiperInstance,
164
190
  onReachBeginning: handleReachBeginning,
165
191
  onReachEnd: handleReachEnd,
166
192
  onFromEdge: handleFromEdge,
167
193
  onSlideChange: handleSlideChange,
168
- onAutoplayStop: handleAutoplayStop,
169
194
  onTouchEnd: increaseAutoplayDelay
170
195
  }), React.Children.map(children, function (child, i) {
171
196
  return /*#__PURE__*/React.createElement(SwiperSlide, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slide, i + 1), {
@@ -232,6 +257,7 @@ Banner.propTypes = {
232
257
  }),
233
258
  autoPlay: PropTypes.bool,
234
259
  autoPlayDelay: PropTypes.number,
260
+ pauseOnHover: PropTypes.bool,
235
261
  navTheme: PropTypes.oneOf(Object.values(NavTheme)),
236
262
  onNextClick: PropTypes.func,
237
263
  onPrevClick: PropTypes.func,
@@ -8,6 +8,7 @@
8
8
  padding: 0 32px;
9
9
  border: none;
10
10
  border-radius: 30px;
11
+ overflow: hidden;
11
12
  color: var(--stcWhite);
12
13
  font-weight: 500;
13
14
  text-align: center;
@@ -21,6 +22,15 @@
21
22
  appearance: none;
22
23
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
23
24
  }
25
+ .mfui-button_size-all_extra-small {
26
+ padding: 0 16px;
27
+ }
28
+ .mfui-button_size-all_extra-small .mfui-button__inner {
29
+ font-size: 12px;
30
+ line-height: 18px;
31
+ min-width: 26px;
32
+ height: 26px;
33
+ }
24
34
  .mfui-button_size-all_small .mfui-button__inner {
25
35
  min-width: 32px;
26
36
  height: 32px;
@@ -33,6 +43,10 @@
33
43
  min-width: 60px;
34
44
  height: 60px;
35
45
  }
46
+ .mfui-button_size-all_extra-small .mfui-button__icon {
47
+ width: 18px;
48
+ height: 18px;
49
+ }
36
50
  .mfui-button_size-all_small .mfui-button__icon {
37
51
  width: 24px;
38
52
  height: 24px;
@@ -46,6 +60,15 @@
46
60
  height: 40px;
47
61
  }
48
62
  @media screen and (min-width: 1280px) {
63
+ .mfui-button_size-wide_extra-small {
64
+ padding: 0 16px;
65
+ }
66
+ .mfui-button_size-wide_extra-small .mfui-button__inner {
67
+ font-size: 12px;
68
+ line-height: 18px;
69
+ min-width: 26px;
70
+ height: 26px;
71
+ }
49
72
  .mfui-button_size-wide_small .mfui-button__inner {
50
73
  min-width: 32px;
51
74
  height: 32px;
@@ -58,6 +81,10 @@
58
81
  min-width: 60px;
59
82
  height: 60px;
60
83
  }
84
+ .mfui-button_size-wide_extra-small .mfui-button__icon {
85
+ width: 18px;
86
+ height: 18px;
87
+ }
61
88
  .mfui-button_size-wide_small .mfui-button__icon {
62
89
  width: 24px;
63
90
  height: 24px;
@@ -72,6 +99,15 @@
72
99
  }
73
100
  }
74
101
  @media screen and (min-width: 1024px) {
102
+ .mfui-button_size-desktop_extra-small {
103
+ padding: 0 16px;
104
+ }
105
+ .mfui-button_size-desktop_extra-small .mfui-button__inner {
106
+ font-size: 12px;
107
+ line-height: 18px;
108
+ min-width: 26px;
109
+ height: 26px;
110
+ }
75
111
  .mfui-button_size-desktop_small .mfui-button__inner {
76
112
  min-width: 32px;
77
113
  height: 32px;
@@ -84,6 +120,10 @@
84
120
  min-width: 60px;
85
121
  height: 60px;
86
122
  }
123
+ .mfui-button_size-desktop_extra-small .mfui-button__icon {
124
+ width: 18px;
125
+ height: 18px;
126
+ }
87
127
  .mfui-button_size-desktop_small .mfui-button__icon {
88
128
  width: 24px;
89
129
  height: 24px;
@@ -98,6 +138,15 @@
98
138
  }
99
139
  }
100
140
  @media screen and (min-width: 768px) and (max-width: 1023px) {
141
+ .mfui-button_size-tablet_extra-small {
142
+ padding: 0 16px;
143
+ }
144
+ .mfui-button_size-tablet_extra-small .mfui-button__inner {
145
+ font-size: 12px;
146
+ line-height: 18px;
147
+ min-width: 26px;
148
+ height: 26px;
149
+ }
101
150
  .mfui-button_size-tablet_small .mfui-button__inner {
102
151
  min-width: 32px;
103
152
  height: 32px;
@@ -110,6 +159,10 @@
110
159
  min-width: 60px;
111
160
  height: 60px;
112
161
  }
162
+ .mfui-button_size-tablet_extra-small .mfui-button__icon {
163
+ width: 18px;
164
+ height: 18px;
165
+ }
113
166
  .mfui-button_size-tablet_small .mfui-button__icon {
114
167
  width: 24px;
115
168
  height: 24px;
@@ -124,6 +177,15 @@
124
177
  }
125
178
  }
126
179
  @media screen and (max-width: 767px) {
180
+ .mfui-button_size-mobile_extra-small {
181
+ padding: 0 16px;
182
+ }
183
+ .mfui-button_size-mobile_extra-small .mfui-button__inner {
184
+ font-size: 12px;
185
+ line-height: 18px;
186
+ min-width: 26px;
187
+ height: 26px;
188
+ }
127
189
  .mfui-button_size-mobile_small .mfui-button__inner {
128
190
  min-width: 32px;
129
191
  height: 32px;
@@ -136,6 +198,10 @@
136
198
  min-width: 60px;
137
199
  height: 60px;
138
200
  }
201
+ .mfui-button_size-mobile_extra-small .mfui-button__icon {
202
+ width: 18px;
203
+ height: 18px;
204
+ }
139
205
  .mfui-button_size-mobile_small .mfui-button__icon {
140
206
  width: 24px;
141
207
  height: 24px;
@@ -173,6 +239,11 @@
173
239
  .mfui-button__text {
174
240
  margin-bottom: 2px;
175
241
  }
242
+ .mfui-button__text_ellipsis {
243
+ overflow: hidden;
244
+ white-space: nowrap;
245
+ text-overflow: ellipsis;
246
+ }
176
247
  .mfui-button__content {
177
248
  display: -webkit-box;
178
249
  display: -ms-flexbox;
@@ -181,6 +252,12 @@
181
252
  -ms-flex-align: center;
182
253
  align-items: center;
183
254
  }
255
+ .mfui-button__content_ellipsis {
256
+ width: inherit;
257
+ max-width: -webkit-fit-content;
258
+ max-width: -moz-fit-content;
259
+ max-width: fit-content;
260
+ }
184
261
  .mfui-button__icon-arrow {
185
262
  width: 32px;
186
263
  height: 32px;
@@ -13,6 +13,7 @@ export declare const ButtonThemes: {
13
13
  };
14
14
  declare type ButtonThemesType = typeof ButtonThemes[keyof typeof ButtonThemes];
15
15
  export declare const ButtonSizes: {
16
+ readonly EXTRA_SMALL: "extra-small";
16
17
  readonly SMALL: "small";
17
18
  readonly MEDIUM: "medium";
18
19
  readonly LARGE: "large";
@@ -73,6 +74,8 @@ export interface IButtonProps {
73
74
  disabled?: boolean;
74
75
  /** Ссылка на элемент */
75
76
  buttonRef?: Ref<HTMLButtonElement | HTMLAnchorElement>;
77
+ /** Обрезать текст при недостаточной ширине и добавлять многоточие */
78
+ ellipsis?: boolean;
76
79
  /** Обработчик клика по кнопке */
77
80
  onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
78
81
  }
@@ -29,6 +29,7 @@ export var ButtonThemes = {
29
29
  BLACK: 'black'
30
30
  };
31
31
  export var ButtonSizes = {
32
+ EXTRA_SMALL: 'extra-small',
32
33
  SMALL: 'small',
33
34
  MEDIUM: 'medium',
34
35
  LARGE: 'large'
@@ -42,7 +43,7 @@ var Content;
42
43
  })(Content || (Content = {}));
43
44
 
44
45
  var getLoaderSize = function getLoaderSize(size) {
45
- return size === ButtonSizes.SMALL ? ButtonSizes.SMALL : ButtonSizes.MEDIUM;
46
+ return size === ButtonSizes.SMALL || size === ButtonSizes.EXTRA_SMALL ? ButtonSizes.SMALL : ButtonSizes.MEDIUM;
46
47
  };
47
48
 
48
49
  var cn = cnCreate('mfui-button');
@@ -80,6 +81,8 @@ var Button = function Button(_ref) {
80
81
  icon = _ref.icon,
81
82
  disabled = _ref.disabled,
82
83
  children = _ref.children,
84
+ _ref$ellipsis = _ref.ellipsis,
85
+ ellipsis = _ref$ellipsis === void 0 ? false : _ref$ellipsis,
83
86
  onClick = _ref.onClick,
84
87
  dataAttrs = _ref.dataAttrs,
85
88
  buttonRef = _ref.buttonRef;
@@ -122,15 +125,19 @@ var Button = function Button(_ref) {
122
125
  }
123
126
 
124
127
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.content), {
125
- className: cn('content', contentClassName)
128
+ className: cn('content', {
129
+ ellipsis: ellipsis
130
+ }, contentClassName)
126
131
  }), icon && /*#__PURE__*/React.createElement("div", {
127
132
  className: cn('icon')
128
133
  }, icon), children && /*#__PURE__*/React.createElement("span", {
129
- className: cn('text')
134
+ className: cn('text', {
135
+ ellipsis: ellipsis
136
+ })
130
137
  }, children), !icon && showArrow && /*#__PURE__*/React.createElement(Arrow, {
131
138
  className: cn('icon-arrow')
132
139
  }));
133
- }, [children, icon, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.content, contentClassName, showArrow]);
140
+ }, [children, icon, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.content, contentClassName, showArrow, ellipsis]);
134
141
  var contentType = React.useMemo(function () {
135
142
  switch (true) {
136
143
  case icon && !children:
@@ -237,6 +244,7 @@ Button.propTypes = {
237
244
  buttonRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
238
245
  current: PropTypes.elementType
239
246
  }), PropTypes.any])]),
247
+ ellipsis: PropTypes.bool,
240
248
  onClick: PropTypes.func
241
249
  };
242
250
  export default Button;
@@ -20,7 +20,7 @@ var __rest = this && this.__rest || function (s, e) {
20
20
  return t;
21
21
  };
22
22
 
23
- import React, { useState, useEffect, useMemo } from 'react';
23
+ import React, { useState, useEffect, useMemo, useRef } from 'react';
24
24
  import { START_DATE, END_DATE, useDatepicker, useMonth } from '@datepicker-react/hooks';
25
25
  import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
26
26
  import differenceInDays from 'date-fns/differenceInDays';
@@ -53,6 +53,17 @@ var dayLabelFormat = function dayLabelFormat(date) {
53
53
  var monthLabelFormat = function monthLabelFormat(date) {
54
54
  return formatDate(date, 'LLLL');
55
55
  };
56
+ /* List of cases to check on component change:
57
+
58
+ - Should correctly choose value and trigger callbacks with correct arguments on dates choose.
59
+ - Should set 1 day period if start and end date is equal
60
+ - Should correctly increase period if choose earlier start date
61
+ - Should correctly change start date of selected period if chosen date in period closer to current start date
62
+ - Should correctly change end date of selected period if chosen date in period closer to current end date
63
+ - Should correctly highlights period if start date chosen and hover on possible end date
64
+
65
+ */
66
+
56
67
 
57
68
  var cn = cnCreate('mfui-calendar');
58
69
 
@@ -91,6 +102,7 @@ var Calendar = function Calendar(_ref) {
91
102
  hoveredDate = _useState4[0],
92
103
  setHoveredDate = _useState4[1];
93
104
 
105
+ var isUserChoice = useRef(false);
94
106
  var stateStartDate = calendarState.startDate,
95
107
  stateEndDate = calendarState.endDate,
96
108
  stateFocusedInput = calendarState.focusedInput;
@@ -111,10 +123,13 @@ var Calendar = function Calendar(_ref) {
111
123
  goToDate = _a.goToDate,
112
124
  pickerProps = __rest(_a, ["firstDayOfWeek", "activeMonths", "goToPreviousMonths", "goToNextMonths", "goToDate"]);
113
125
 
126
+ useEffect(function () {
127
+ isUserChoice.current = false;
128
+ }, [startDate]);
114
129
  useEffect(function () {
115
130
  var propsStartDate = calendarStateFromProps.startDate;
116
131
  setCalendarState(calendarStateFromProps);
117
- propsStartDate && goToDate(propsStartDate); // eslint-disable-next-line react-hooks/exhaustive-deps
132
+ !isUserChoice.current && propsStartDate && goToDate(propsStartDate); // eslint-disable-next-line react-hooks/exhaustive-deps
118
133
  }, [calendarStateFromProps]);
119
134
 
120
135
  var getCalendarState = function getCalendarState(date) {
@@ -179,6 +194,7 @@ var Calendar = function Calendar(_ref) {
179
194
  var nextStartDate = nextState.startDate,
180
195
  nextEndDate = nextState.endDate;
181
196
  setCalendarState(nextState);
197
+ isUserChoice.current = true;
182
198
  onChange === null || onChange === void 0 ? void 0 : onChange(nextStartDate, nextEndDate);
183
199
  };
184
200