@megafon/ui-core 3.3.0 → 3.5.0

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 (54) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +13 -5
  3. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.js +4 -2
  4. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +4 -1
  5. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.d.ts +1 -0
  6. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.js +1 -0
  7. package/dist/es/components/Badges/components/TimerBadge/Timer/Timer.d.ts +13 -0
  8. package/dist/es/components/Badges/components/TimerBadge/Timer/Timer.js +96 -0
  9. package/dist/es/components/Badges/components/TimerBadge/TimerBadge.css +60 -0
  10. package/dist/es/components/Badges/components/TimerBadge/TimerBadge.d.ts +24 -0
  11. package/dist/es/components/Badges/components/TimerBadge/TimerBadge.js +110 -0
  12. package/dist/es/components/Button/Button.d.ts +1 -1
  13. package/dist/es/components/Checkbox/Checkbox.d.ts +1 -1
  14. package/dist/es/components/Collapse/Collapse.js +1 -0
  15. package/dist/es/components/Counter/Counter.d.ts +1 -1
  16. package/dist/es/components/Logo/Logo.css +5 -0
  17. package/dist/es/components/Notification/Notification.css +15 -21
  18. package/dist/es/components/RadioButton/RadioButton.d.ts +1 -1
  19. package/dist/es/components/Search/Search.d.ts +3 -1
  20. package/dist/es/components/Search/Search.js +7 -4
  21. package/dist/es/components/Select/Select.d.ts +1 -1
  22. package/dist/es/components/Switcher/Switcher.css +101 -28
  23. package/dist/es/components/Switcher/Switcher.d.ts +9 -2
  24. package/dist/es/components/Switcher/Switcher.js +39 -10
  25. package/dist/es/components/TextField/TextField.d.ts +1 -1
  26. package/dist/es/index.d.ts +2 -0
  27. package/dist/es/index.js +2 -0
  28. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +13 -5
  29. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.js +4 -2
  30. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +4 -1
  31. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.d.ts +1 -0
  32. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.js +1 -0
  33. package/dist/lib/components/Badges/components/TimerBadge/Timer/Timer.d.ts +13 -0
  34. package/dist/lib/components/Badges/components/TimerBadge/Timer/Timer.js +123 -0
  35. package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.css +60 -0
  36. package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.d.ts +24 -0
  37. package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.js +133 -0
  38. package/dist/lib/components/Button/Button.d.ts +1 -1
  39. package/dist/lib/components/Checkbox/Checkbox.d.ts +1 -1
  40. package/dist/lib/components/Collapse/Collapse.js +1 -0
  41. package/dist/lib/components/Counter/Counter.d.ts +1 -1
  42. package/dist/lib/components/Logo/Logo.css +5 -0
  43. package/dist/lib/components/Notification/Notification.css +15 -21
  44. package/dist/lib/components/RadioButton/RadioButton.d.ts +1 -1
  45. package/dist/lib/components/Search/Search.d.ts +3 -1
  46. package/dist/lib/components/Search/Search.js +7 -4
  47. package/dist/lib/components/Select/Select.d.ts +1 -1
  48. package/dist/lib/components/Switcher/Switcher.css +101 -28
  49. package/dist/lib/components/Switcher/Switcher.d.ts +9 -2
  50. package/dist/lib/components/Switcher/Switcher.js +38 -9
  51. package/dist/lib/components/TextField/TextField.d.ts +1 -1
  52. package/dist/lib/index.d.ts +2 -0
  53. package/dist/lib/index.js +16 -0
  54. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,54 @@
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.5.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.4.0...@megafon/ui-core@3.5.0) (2022-04-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **logo:** fix img align ([51c81d9](https://github.com/MegafonWebLab/megafon-ui/commit/51c81d9e2edb9cf6b5d245ebb60d8a74f1e8bc1d))
12
+ * **promobadge:** fixed font color for dark theme ([88781d8](https://github.com/MegafonWebLab/megafon-ui/commit/88781d843e25028a5836b030861939cdf019760d))
13
+
14
+
15
+ ### Features
16
+
17
+ * **switcher:** new props and colors ([adb5f34](https://github.com/MegafonWebLab/megafon-ui/commit/adb5f34e3e0949109445c75dc188d37171637af9))
18
+
19
+
20
+
21
+
22
+
23
+ # [3.4.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.3.1...@megafon/ui-core@3.4.0) (2022-03-21)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **notification:** fix link styles ([9d7e67e](https://github.com/MegafonWebLab/megafon-ui/commit/9d7e67e1f21c9ddb1dc911502a114924c8896a6a))
29
+ * **pricebadge:** fix icon styles ([f5502a0](https://github.com/MegafonWebLab/megafon-ui/commit/f5502a0e28d067694cee4165fe224a38ecf3a15f))
30
+ * **storebutton:** fixed test for Select and update type for StoreButton ([8996754](https://github.com/MegafonWebLab/megafon-ui/commit/8996754482e9cf899fdcb0f488c8a9fa1afddd11))
31
+
32
+
33
+ ### Features
34
+
35
+ * **badges:** add new component TimerBadge ([82a900b](https://github.com/MegafonWebLab/megafon-ui/commit/82a900b362ca15db30dfdbffbfe299b637cae5b3))
36
+ * **promobadge:** add vip type (purple background color) ([51ea858](https://github.com/MegafonWebLab/megafon-ui/commit/51ea8582ff750199166c64681fecae636d30ca18))
37
+ * **search:** add onFocus callback ([b6dfdad](https://github.com/MegafonWebLab/megafon-ui/commit/b6dfdadd8dc695d7622bb95443ef6556b4e5d1c6))
38
+
39
+
40
+
41
+
42
+
43
+ ## [3.3.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.3.0...@megafon/ui-core@3.3.1) (2022-03-15)
44
+
45
+
46
+ ### Bug Fixes
47
+
48
+ * **collapse:** made collapse height 0 or auto on animation end ([c898d1e](https://github.com/MegafonWebLab/megafon-ui/commit/c898d1e84d3c92defa204c24125508655466d5cd))
49
+
50
+
51
+
52
+
53
+
6
54
  # [3.3.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.2.0...@megafon/ui-core@3.3.0) (2022-03-14)
7
55
 
8
56
 
@@ -7,20 +7,23 @@
7
7
  -webkit-box-align: center;
8
8
  -ms-flex-align: center;
9
9
  align-items: center;
10
- padding: 4px;
10
+ padding: 2px;
11
11
  padding-right: 8px;
12
12
  width: -webkit-fit-content;
13
13
  width: -moz-fit-content;
14
14
  width: fit-content;
15
- height: 24px;
15
+ height: -webkit-fit-content;
16
+ height: -moz-fit-content;
17
+ height: fit-content;
16
18
  border-radius: 8px;
17
19
  }
18
20
  @media screen and (min-width: 1024px) {
19
21
  .mfui-price-badge_adaptive {
20
22
  font-size: 15px;
21
23
  line-height: 24px;
22
- padding: 4px 8px;
23
- height: 32px;
24
+ padding: 4px;
25
+ padding-right: 8px;
26
+ min-height: 32px;
24
27
  border-radius: 12px;
25
28
  }
26
29
  }
@@ -62,7 +65,12 @@
62
65
  }
63
66
  .mfui-price-badge__text {
64
67
  font-family: inherit;
65
- margin-left: 4px;
68
+ margin-left: 2px;
69
+ }
70
+ .mfui-price-badge__icon-container {
71
+ display: -webkit-box;
72
+ display: -ms-flexbox;
73
+ display: flex;
66
74
  }
67
75
  .mfui-price-badge__icon {
68
76
  height: 20px;
@@ -93,9 +93,11 @@ var PriceBadge = function PriceBadge(_ref) {
93
93
  theme: theme,
94
94
  adaptive: isAdaptive
95
95
  }, className)
96
- }), /*#__PURE__*/React.createElement(Icon, {
96
+ }), /*#__PURE__*/React.createElement("div", {
97
+ className: cn('icon-container')
98
+ }, /*#__PURE__*/React.createElement(Icon, {
97
99
  className: cn('icon')
98
- }), /*#__PURE__*/React.createElement("span", {
100
+ })), /*#__PURE__*/React.createElement("span", {
99
101
  className: cn('text')
100
102
  }, children));
101
103
  };
@@ -10,7 +10,7 @@
10
10
  width: -moz-fit-content;
11
11
  width: fit-content;
12
12
  border-radius: 8px;
13
- color: var(--base);
13
+ color: var(--stcWhite);
14
14
  }
15
15
  .mfui-promo-badge_type_hit {
16
16
  background-color: var(--warmRedC);
@@ -18,6 +18,9 @@
18
18
  .mfui-promo-badge_type_new {
19
19
  background-color: var(--systemBlue);
20
20
  }
21
+ .mfui-promo-badge_type_vip {
22
+ background-color: var(--brandPurple);
23
+ }
21
24
  .mfui-promo-badge_type_popular {
22
25
  background-color: var(--137C);
23
26
  }
@@ -3,6 +3,7 @@ import './PromoBadge.less';
3
3
  export declare const PromoBadgeTypes: {
4
4
  readonly HIT: "hit";
5
5
  readonly NEW: "new";
6
+ readonly VIP: "vip";
6
7
  readonly POPULAR: "popular";
7
8
  readonly USER_CHOICE: "user-choice";
8
9
  };
@@ -7,6 +7,7 @@ import "./PromoBadge.css";
7
7
  export var PromoBadgeTypes = {
8
8
  HIT: 'hit',
9
9
  NEW: 'new',
10
+ VIP: 'vip',
10
11
  POPULAR: 'popular',
11
12
  USER_CHOICE: 'user-choice'
12
13
  };
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ export declare const getCountdownText: (remainingTime?: number) => string;
3
+ interface ITimerProps {
4
+ actualRemainingTime: number;
5
+ expirationDate: Date;
6
+ showCountdown: boolean;
7
+ additionalText?: string;
8
+ dataAttrs?: {
9
+ root?: Record<string, string>;
10
+ };
11
+ }
12
+ declare const Timer: React.FC<ITimerProps>;
13
+ export default Timer;
@@ -0,0 +1,96 @@
1
+ import "core-js/modules/es.array.concat";
2
+ import "core-js/modules/es.date.to-string";
3
+ import "core-js/modules/es.math.trunc";
4
+ import _extends from "@babel/runtime/helpers/extends";
5
+ import * as React from 'react';
6
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
7
+ import format from 'date-fns/format';
8
+ import ruLocale from 'date-fns/locale/ru';
9
+ import * as PropTypes from 'prop-types';
10
+ var SECONDS_IN_DAY = 86400;
11
+ var SECONDS_IN_HOUR = 3600;
12
+ var SECONDS_IN_MINUTE = 60;
13
+
14
+ var formatDate = function formatDate(date, pattern) {
15
+ return format(date, pattern, {
16
+ locale: ruLocale
17
+ });
18
+ };
19
+
20
+ export var getCountdownText = function getCountdownText() {
21
+ var remainingTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
22
+ var isMoreHourAndLessDay = remainingTime >= SECONDS_IN_HOUR && remainingTime < SECONDS_IN_DAY;
23
+
24
+ var truncTime = function truncTime() {
25
+ var divider = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
26
+ return Math.trunc(remainingTime / divider);
27
+ };
28
+
29
+ switch (true) {
30
+ case remainingTime <= 0:
31
+ {
32
+ return '';
33
+ }
34
+
35
+ case remainingTime < SECONDS_IN_MINUTE:
36
+ {
37
+ var seconds = truncTime();
38
+ return "".concat(seconds, " \u0441\u0435\u043A");
39
+ }
40
+
41
+ case remainingTime < SECONDS_IN_HOUR:
42
+ {
43
+ var minutes = truncTime(SECONDS_IN_MINUTE);
44
+ return "".concat(minutes, " \u043C\u0438\u043D");
45
+ }
46
+
47
+ case isMoreHourAndLessDay:
48
+ {
49
+ var hours = truncTime(SECONDS_IN_HOUR);
50
+ var secondsLeft = remainingTime - hours * SECONDS_IN_HOUR;
51
+
52
+ var _minutes = Math.trunc(secondsLeft / SECONDS_IN_MINUTE);
53
+
54
+ return _minutes ? "".concat(hours, " \u0447 ").concat(_minutes, " \u043C\u0438\u043D") : "".concat(hours, " \u0447");
55
+ }
56
+
57
+ case remainingTime >= SECONDS_IN_DAY:
58
+ {
59
+ var days = truncTime(SECONDS_IN_DAY);
60
+
61
+ var _secondsLeft = remainingTime - days * SECONDS_IN_DAY;
62
+
63
+ var _hours = Math.trunc(_secondsLeft / SECONDS_IN_HOUR);
64
+
65
+ return _hours ? "".concat(days, " \u0434\u043D ").concat(_hours, " \u0447") : "".concat(days, " \u0434\u043D");
66
+ }
67
+
68
+ default:
69
+ {
70
+ return '';
71
+ }
72
+ }
73
+ };
74
+ var cn = cnCreate('mfui-timer');
75
+
76
+ var Timer = function Timer(_ref) {
77
+ var actualRemainingTime = _ref.actualRemainingTime,
78
+ expirationDate = _ref.expirationDate,
79
+ showCountdown = _ref.showCountdown,
80
+ additionalText = _ref.additionalText,
81
+ dataAttrs = _ref.dataAttrs;
82
+ return /*#__PURE__*/React.createElement("div", _extends({
83
+ className: cn()
84
+ }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), additionalText && /*#__PURE__*/React.createElement("span", null, additionalText, " "), /*#__PURE__*/React.createElement("span", null, showCountdown ? getCountdownText(actualRemainingTime) : formatDate(expirationDate, 'dd MMMM yyyy')));
85
+ };
86
+
87
+ Timer.propTypes = {
88
+ expirationDate: PropTypes.instanceOf(Date).isRequired,
89
+ actualRemainingTime: PropTypes.number.isRequired,
90
+ showCountdown: PropTypes.bool.isRequired,
91
+ additionalText: PropTypes.string,
92
+ dataAttrs: PropTypes.shape({
93
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
94
+ })
95
+ };
96
+ export default Timer;
@@ -0,0 +1,60 @@
1
+ .mfui-timer-badge {
2
+ display: -webkit-box;
3
+ display: -ms-flexbox;
4
+ display: flex;
5
+ -webkit-box-align: center;
6
+ -ms-flex-align: center;
7
+ align-items: center;
8
+ padding: 1px 2px;
9
+ padding-right: 8px;
10
+ width: -webkit-fit-content;
11
+ width: -moz-fit-content;
12
+ width: fit-content;
13
+ height: -webkit-fit-content;
14
+ height: -moz-fit-content;
15
+ height: fit-content;
16
+ border: 1px solid var(--spbSky1);
17
+ border-radius: 12px;
18
+ background: var(--base);
19
+ overflow: hidden;
20
+ }
21
+ .mfui-timer-badge_theme_grey .mfui-timer-badge__text {
22
+ color: var(--spbSky3);
23
+ }
24
+ .mfui-timer-badge_theme_grey .mfui-timer-badge__icon {
25
+ fill: var(--spbSky3);
26
+ }
27
+ .mfui-timer-badge_theme_red .mfui-timer-badge__text {
28
+ color: var(--fury);
29
+ }
30
+ .mfui-timer-badge_theme_red .mfui-timer-badge__icon {
31
+ fill: var(--fury);
32
+ }
33
+ .mfui-timer-badge__text {
34
+ font-size: 12px;
35
+ line-height: 16px;
36
+ font-family: inherit;
37
+ margin-left: 2px;
38
+ font-weight: 500;
39
+ }
40
+ .mfui-timer-badge__icon {
41
+ height: 20px;
42
+ width: 20px;
43
+ }
44
+ .mfui-timer-badge__icon-container {
45
+ position: relative;
46
+ display: -webkit-box;
47
+ display: -ms-flexbox;
48
+ display: flex;
49
+ }
50
+ .mfui-timer-badge__icon-container_shadow:before {
51
+ content: '';
52
+ position: absolute;
53
+ top: 2px;
54
+ left: 2px;
55
+ height: 16px;
56
+ width: 16px;
57
+ border-radius: 50%;
58
+ -webkit-box-shadow: 0px 0px 6px var(--fury);
59
+ box-shadow: 0px 0px 6px var(--fury);
60
+ }
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import './TimerBadge.less';
3
+ export interface ITimerBadgeProps {
4
+ /** Дата окончания таймера */
5
+ expirationDate: Date;
6
+ /** Граница переключения в режим обратного отсчёта, в секундах */
7
+ countdownStart?: number;
8
+ /** Отображение дополнительного текста */
9
+ hasPrefix?: boolean;
10
+ /** Текст перед таймером в режиме обратного отсчета. Появляется при hasPrefix=true. */
11
+ countdownText?: string;
12
+ /** Текст перед таймером в режиме даты. Появляется при hasPrefix=true. */
13
+ expirationDateText?: string;
14
+ /** Дополнительный класс корневого элемента */
15
+ className?: string;
16
+ /** Дополнительные data-атрибуты к внутренним элементам */
17
+ dataAttrs?: {
18
+ root?: Record<string, string>;
19
+ text?: Record<string, string>;
20
+ timer?: Record<string, string>;
21
+ };
22
+ }
23
+ declare const TimerBadge: React.FC<ITimerBadgeProps>;
24
+ export default TimerBadge;
@@ -0,0 +1,110 @@
1
+ import "core-js/modules/es.date.now";
2
+ import "core-js/modules/es.date.to-string";
3
+ import "core-js/modules/web.timers";
4
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
+ import _extends from "@babel/runtime/helpers/extends";
6
+ import React, { useEffect, useState } from 'react';
7
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
8
+ import * as PropTypes from 'prop-types';
9
+ import Timer from "./Timer/Timer";
10
+ import "./TimerBadge.css";
11
+
12
+ var TimerIcon = function TimerIcon(props) {
13
+ return /*#__PURE__*/React.createElement("svg", _extends({
14
+ viewBox: "0 0 20 20"
15
+ }, props), /*#__PURE__*/React.createElement("path", {
16
+ fillRule: "evenodd",
17
+ clipRule: "evenodd",
18
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm1-8.414V5H9v5.414l3 3L13.414 12 11 9.586z"
19
+ }));
20
+ };
21
+
22
+ var SECONDS_IN_HOUR = 3600;
23
+ var MS_IN_SECOND = 1000;
24
+ var TIMEOUT = 1000;
25
+ var TimerBadgeTheme = {
26
+ RED: 'red',
27
+ GREY: 'grey'
28
+ };
29
+ var cn = cnCreate('mfui-timer-badge');
30
+
31
+ var TimerBadge = function TimerBadge(_ref) {
32
+ var expirationDate = _ref.expirationDate,
33
+ _ref$countdownStart = _ref.countdownStart,
34
+ countdownStart = _ref$countdownStart === void 0 ? 86400 : _ref$countdownStart,
35
+ _ref$hasPrefix = _ref.hasPrefix,
36
+ hasPrefix = _ref$hasPrefix === void 0 ? false : _ref$hasPrefix,
37
+ _ref$countdownText = _ref.countdownText,
38
+ countdownText = _ref$countdownText === void 0 ? 'Закончится через' : _ref$countdownText,
39
+ _ref$expirationDateTe = _ref.expirationDateText,
40
+ expirationDateText = _ref$expirationDateTe === void 0 ? 'Воспользуйтесь до' : _ref$expirationDateTe,
41
+ className = _ref.className,
42
+ dataAttrs = _ref.dataAttrs;
43
+ var remainingTime = (expirationDate.getTime() - Date.now()) / MS_IN_SECOND;
44
+
45
+ var _useState = useState(remainingTime),
46
+ _useState2 = _slicedToArray(_useState, 2),
47
+ actualRemainingTime = _useState2[0],
48
+ setActualRemainingTime = _useState2[1];
49
+
50
+ var _useState3 = useState(false),
51
+ _useState4 = _slicedToArray(_useState3, 2),
52
+ showCountdown = _useState4[0],
53
+ setShowCountdown = _useState4[1];
54
+
55
+ var isLastHour = actualRemainingTime < SECONDS_IN_HOUR;
56
+ var isTimeExpired = actualRemainingTime < 1;
57
+ var theme = showCountdown ? TimerBadgeTheme.RED : TimerBadgeTheme.GREY;
58
+ var additionalText = showCountdown ? countdownText : expirationDateText;
59
+ useEffect(function () {
60
+ setShowCountdown(actualRemainingTime < countdownStart);
61
+ }, [actualRemainingTime, countdownStart]);
62
+ useEffect(function () {
63
+ if (isTimeExpired) {
64
+ return undefined;
65
+ }
66
+
67
+ var timeoutId = window.setTimeout(function () {
68
+ return setActualRemainingTime(actualRemainingTime - 1);
69
+ }, TIMEOUT);
70
+ return function () {
71
+ return clearTimeout(timeoutId);
72
+ };
73
+ }, [isTimeExpired, showCountdown, actualRemainingTime]);
74
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
75
+ className: cn({
76
+ theme: theme
77
+ }, className)
78
+ }), /*#__PURE__*/React.createElement("div", {
79
+ className: cn('icon-container', {
80
+ shadow: isLastHour && showCountdown
81
+ })
82
+ }, /*#__PURE__*/React.createElement(TimerIcon, {
83
+ className: cn('icon')
84
+ })), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.text), {
85
+ className: cn('text')
86
+ }), isTimeExpired ? 'Время действия истекло' : /*#__PURE__*/React.createElement(Timer, {
87
+ additionalText: hasPrefix ? additionalText : undefined,
88
+ showCountdown: showCountdown,
89
+ expirationDate: expirationDate,
90
+ actualRemainingTime: actualRemainingTime,
91
+ dataAttrs: {
92
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.timer
93
+ }
94
+ })));
95
+ };
96
+
97
+ TimerBadge.propTypes = {
98
+ expirationDate: PropTypes.instanceOf(Date).isRequired,
99
+ countdownStart: PropTypes.number,
100
+ hasPrefix: PropTypes.bool,
101
+ countdownText: PropTypes.string,
102
+ expirationDateText: PropTypes.string,
103
+ className: PropTypes.string,
104
+ dataAttrs: PropTypes.shape({
105
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
106
+ text: PropTypes.objectOf(PropTypes.string.isRequired),
107
+ timer: PropTypes.objectOf(PropTypes.string.isRequired)
108
+ })
109
+ };
110
+ export default TimerBadge;
@@ -69,7 +69,7 @@ export interface IButtonProps {
69
69
  showArrow?: boolean;
70
70
  /** Иконка */
71
71
  icon?: JSX.Element;
72
- /** Управление возможностью взаимодействия с компонентом */
72
+ /** Отключение кнопки */
73
73
  disabled?: boolean;
74
74
  /** Ссылка на элемент */
75
75
  buttonRef?: Ref<HTMLButtonElement | HTMLAnchorElement>;
@@ -25,7 +25,7 @@ export interface ICheckboxProps {
25
25
  value?: string;
26
26
  /** Управление состоянием вкл/выкл компонента */
27
27
  checked?: boolean;
28
- /** Управление возможностью взаимодействия с компонентом */
28
+ /** Отключение чекбокса */
29
29
  disabled?: boolean;
30
30
  /** Отобразить компонент в состоянии ошибки */
31
31
  error?: boolean;
@@ -58,6 +58,7 @@ var Collapse = function Collapse(props) {
58
58
  } else {
59
59
  animationStart.current = null;
60
60
  animationId.current = null;
61
+ rootNode.current.style.height = isOpenAction ? 'auto' : '0px';
61
62
  }
62
63
  }, []);
63
64
  useEffect(function () {
@@ -18,7 +18,7 @@ export interface ICounterProps {
18
18
  min?: number;
19
19
  /** Максимальное доступное значение */
20
20
  max?: number;
21
- /** Запретить взаимодействие с компонентом */
21
+ /** Отключение счетчика */
22
22
  disabled?: boolean;
23
23
  /** Обработчик изменения значения 'value' */
24
24
  onChange?: (value: number) => void;
@@ -23,6 +23,11 @@
23
23
  display: block;
24
24
  width: 100%;
25
25
  }
26
+ .mfui-logo__img {
27
+ display: -webkit-box;
28
+ display: -ms-flexbox;
29
+ display: flex;
30
+ }
26
31
  .mfui-logo_view_horizontal .mfui-logo__img {
27
32
  min-height: 23px;
28
33
  }
@@ -189,19 +189,27 @@ h5 {
189
189
  .mfui-notification_colored .mfui-notification__icon-container {
190
190
  background-color: var(--stcWhite);
191
191
  }
192
+ .mfui-notification_colored.mfui-notification_type_info {
193
+ background-color: var(--311C20);
194
+ }
195
+ .mfui-notification_colored.mfui-notification_type_warning {
196
+ background-color: var(--137C20);
197
+ }
192
198
  .mfui-notification_colored.mfui-notification_type_success {
193
199
  background-color: var(--brandGreen20);
194
200
  }
201
+ .mfui-notification_colored.mfui-notification_type_info .mfui-notification__title,
202
+ .mfui-notification_colored.mfui-notification_type_warning .mfui-notification__title,
195
203
  .mfui-notification_colored.mfui-notification_type_success .mfui-notification__title,
196
- .mfui-notification_colored.mfui-notification_type_success .mfui-notification__text,
197
- .mfui-notification_colored.mfui-notification_type_success .mfui-notification__link {
204
+ .mfui-notification_colored.mfui-notification_type_info .mfui-notification__text,
205
+ .mfui-notification_colored.mfui-notification_type_warning .mfui-notification__text,
206
+ .mfui-notification_colored.mfui-notification_type_success .mfui-notification__text {
198
207
  color: var(--stcBlack);
199
208
  }
200
- .mfui-notification_colored.mfui-notification_type_success .mfui-notification__right-arrow {
201
- fill: var(--stcBlack);
202
- }
203
- .mfui-notification_colored.mfui-notification_type_success .mfui-notification__icon-container {
204
- background-color: var(--stcWhite);
209
+ .mfui-notification_colored.mfui-notification_type_info .mfui-notification__link,
210
+ .mfui-notification_colored.mfui-notification_type_warning .mfui-notification__link,
211
+ .mfui-notification_colored.mfui-notification_type_success .mfui-notification__link {
212
+ color: var(--systemBlue);
205
213
  }
206
214
  .mfui-notification_colored.mfui-notification_type_error {
207
215
  background-color: var(--fury80);
@@ -221,17 +229,3 @@ h5 {
221
229
  /* stylelint-disable-line max-nesting-depth */
222
230
  fill: var(--stcWhite);
223
231
  }
224
- .mfui-notification_colored.mfui-notification_type_info .mfui-notification__title,
225
- .mfui-notification_colored.mfui-notification_type_warning .mfui-notification__title,
226
- .mfui-notification_colored.mfui-notification_type_info .mfui-notification__text,
227
- .mfui-notification_colored.mfui-notification_type_warning .mfui-notification__text,
228
- .mfui-notification_colored.mfui-notification_type_info .mfui-notification__link,
229
- .mfui-notification_colored.mfui-notification_type_warning .mfui-notification__link {
230
- color: var(--stcBlack);
231
- }
232
- .mfui-notification_colored.mfui-notification_type_info {
233
- background-color: var(--311C20);
234
- }
235
- .mfui-notification_colored.mfui-notification_type_warning {
236
- background-color: var(--137C20);
237
- }
@@ -7,7 +7,7 @@ export interface IRadioButtonProps {
7
7
  name?: string;
8
8
  /** Размер текста лейбла */
9
9
  textSize?: 'small' | 'medium';
10
- /** Управление возможностью взаимодействия с компонентом */
10
+ /** Отключение радио-кнопки */
11
11
  disabled?: boolean;
12
12
  /** Управление состоянием вкл/выкл компонента */
13
13
  isChecked?: boolean;
@@ -36,7 +36,7 @@ export interface ISearchProps {
36
36
  verification?: VerificationType;
37
37
  /** Дополнительный текст под полем. Свойство verification влияет на цвет текста. */
38
38
  noticeText?: string;
39
- /** Управление возможностью взаимодействия с компонентом */
39
+ /** Отключение поля ввода */
40
40
  disabled?: boolean;
41
41
  /** Делает поле обязательным */
42
42
  required?: boolean;
@@ -54,6 +54,8 @@ export interface ISearchProps {
54
54
  onSubmit?: (value: string) => void;
55
55
  /** Обработчик выхода из фокуса */
56
56
  onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
57
+ /** Обработчик входа в фокус */
58
+ onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
57
59
  }
58
60
  declare const Search: React.FC<ISearchProps>;
59
61
  export default Search;
@@ -46,7 +46,8 @@ var Search = function Search(_ref) {
46
46
  classes = _ref.classes,
47
47
  onChange = _ref.onChange,
48
48
  onSubmit = _ref.onSubmit,
49
- onBlur = _ref.onBlur;
49
+ onBlur = _ref.onBlur,
50
+ onFocus = _ref.onFocus;
50
51
 
51
52
  var _React$useState = React.useState(value),
52
53
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -101,9 +102,10 @@ var Search = function Search(_ref) {
101
102
  handleItemSubmit(activeIndex);
102
103
  };
103
104
  }, [handleItemSubmit, activeIndex]);
104
- var handleFocus = React.useCallback(function () {
105
+ var handleFocus = React.useCallback(function (e) {
105
106
  setFocus(true);
106
- }, []);
107
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
108
+ }, [onFocus]);
107
109
  var handleBlur = React.useCallback(function (e) {
108
110
  setFocus(false);
109
111
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
@@ -242,6 +244,7 @@ Search.propTypes = {
242
244
  }),
243
245
  onChange: PropTypes.func,
244
246
  onSubmit: PropTypes.func,
245
- onBlur: PropTypes.func
247
+ onBlur: PropTypes.func,
248
+ onFocus: PropTypes.func
246
249
  };
247
250
  export default Search;
@@ -40,7 +40,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
40
40
  verification?: VerificationType;
41
41
  /** Дополнительный текст под полем. Свойство verification влияет на цвет текста. */
42
42
  noticeText?: string;
43
- /** Управление возможностью взаимодействия с компонентом */
43
+ /** Отключение селекта */
44
44
  disabled?: boolean;
45
45
  /** Делает поле обязательным */
46
46
  required?: boolean;