@megafon/ui-core 3.0.2 → 3.3.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 (78) hide show
  1. package/CHANGELOG.md +57 -1
  2. package/dist/es/components/Accordion/Accordion.css +1 -0
  3. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +70 -0
  4. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.d.ts +33 -0
  5. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.js +113 -0
  6. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +32 -0
  7. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.d.ts +22 -0
  8. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.js +38 -0
  9. package/dist/es/components/Banner/Banner.css +16 -0
  10. package/dist/es/components/Banner/Banner.js +10 -3
  11. package/dist/es/components/Button/Button.css +8 -8
  12. package/dist/es/components/Calendar/Calendar.d.ts +8 -0
  13. package/dist/es/components/Calendar/Calendar.js +20 -4
  14. package/dist/es/components/Calendar/components/Day/Day.d.ts +3 -0
  15. package/dist/es/components/Calendar/components/Day/Day.js +9 -5
  16. package/dist/es/components/Calendar/components/Month/Month.d.ts +5 -0
  17. package/dist/es/components/Calendar/components/Month/Month.js +14 -8
  18. package/dist/es/components/Carousel/Carousel.js +31 -6
  19. package/dist/es/components/Checkbox/Checkbox.css +3 -0
  20. package/dist/es/components/Collapse/Collapse.js +55 -28
  21. package/dist/es/components/ContentArea/ContentArea.css +32 -22
  22. package/dist/es/components/ContentArea/ContentArea.d.ts +3 -2
  23. package/dist/es/components/ContentArea/ContentArea.js +11 -11
  24. package/dist/es/components/Counter/Counter.d.ts +7 -0
  25. package/dist/es/components/Counter/Counter.js +15 -8
  26. package/dist/es/components/Logo/Logo.js +8 -10
  27. package/dist/es/components/NavArrow/NavArrow.d.ts +3 -0
  28. package/dist/es/components/NavArrow/NavArrow.js +8 -4
  29. package/dist/es/components/Paragraph/Paragraph.js +1 -1
  30. package/dist/es/components/Search/Search.d.ts +7 -0
  31. package/dist/es/components/Search/Search.js +16 -9
  32. package/dist/es/components/Switcher/Switcher.d.ts +4 -0
  33. package/dist/es/components/Switcher/Switcher.js +22 -10
  34. package/dist/es/components/Tabs/Tabs.css +1 -1
  35. package/dist/es/components/TextLink/TextLink.js +6 -8
  36. package/dist/es/components/Tile/Tile.d.ts +2 -0
  37. package/dist/es/components/Tile/Tile.js +7 -3
  38. package/dist/es/index.d.ts +2 -0
  39. package/dist/es/index.js +2 -0
  40. package/dist/lib/components/Accordion/Accordion.css +1 -0
  41. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +70 -0
  42. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.d.ts +33 -0
  43. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.js +134 -0
  44. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +32 -0
  45. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.d.ts +22 -0
  46. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.js +59 -0
  47. package/dist/lib/components/Banner/Banner.css +16 -0
  48. package/dist/lib/components/Banner/Banner.js +10 -3
  49. package/dist/lib/components/Button/Button.css +8 -8
  50. package/dist/lib/components/Calendar/Calendar.d.ts +8 -0
  51. package/dist/lib/components/Calendar/Calendar.js +19 -3
  52. package/dist/lib/components/Calendar/components/Day/Day.d.ts +3 -0
  53. package/dist/lib/components/Calendar/components/Day/Day.js +8 -4
  54. package/dist/lib/components/Calendar/components/Month/Month.d.ts +5 -0
  55. package/dist/lib/components/Calendar/components/Month/Month.js +13 -7
  56. package/dist/lib/components/Carousel/Carousel.js +31 -6
  57. package/dist/lib/components/Checkbox/Checkbox.css +3 -0
  58. package/dist/lib/components/Collapse/Collapse.js +54 -30
  59. package/dist/lib/components/ContentArea/ContentArea.css +32 -22
  60. package/dist/lib/components/ContentArea/ContentArea.d.ts +3 -2
  61. package/dist/lib/components/ContentArea/ContentArea.js +11 -11
  62. package/dist/lib/components/Counter/Counter.d.ts +7 -0
  63. package/dist/lib/components/Counter/Counter.js +14 -7
  64. package/dist/lib/components/Logo/Logo.js +8 -10
  65. package/dist/lib/components/NavArrow/NavArrow.d.ts +3 -0
  66. package/dist/lib/components/NavArrow/NavArrow.js +7 -3
  67. package/dist/lib/components/Paragraph/Paragraph.js +1 -1
  68. package/dist/lib/components/Search/Search.d.ts +7 -0
  69. package/dist/lib/components/Search/Search.js +15 -8
  70. package/dist/lib/components/Switcher/Switcher.d.ts +4 -0
  71. package/dist/lib/components/Switcher/Switcher.js +25 -9
  72. package/dist/lib/components/Tabs/Tabs.css +1 -1
  73. package/dist/lib/components/TextLink/TextLink.js +6 -8
  74. package/dist/lib/components/Tile/Tile.d.ts +2 -0
  75. package/dist/lib/components/Tile/Tile.js +7 -3
  76. package/dist/lib/index.d.ts +2 -0
  77. package/dist/lib/index.js +16 -0
  78. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,62 @@
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.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
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **accordion:** remove outline for safari ([787b572](https://github.com/MegafonWebLab/megafon-ui/commit/787b5725ef962637401a0a3a1a8ae7ba0cece031))
12
+
13
+
14
+ ### Features
15
+
16
+ * **badges:** add new component PriceBadge ([9214baa](https://github.com/MegafonWebLab/megafon-ui/commit/9214baab003f958b916b728cf07e6f9db15173dd))
17
+ * **badges:** add new component PromoBadge ([6e550a0](https://github.com/MegafonWebLab/megafon-ui/commit/6e550a06fd2d0fb7b3dba488702f4a34f4f6d101))
18
+
19
+
20
+
21
+
22
+
23
+ # [3.2.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.1.0...@megafon/ui-core@3.2.0) (2022-02-28)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **checkbox:** delete outline focus effect ([ecd98e7](https://github.com/MegafonWebLab/megafon-ui/commit/ecd98e7129ddd305ce6e21c1c98cdacc3670ff92))
29
+ * **tile:** delete unnecessary symbol ([1f0ed90](https://github.com/MegafonWebLab/megafon-ui/commit/1f0ed9009ef2cb9e5562f257640a623eceae225e))
30
+
31
+
32
+ ### Features
33
+
34
+ * **carousel:** fix data-attribute passing for NavArrow ([af0d26e](https://github.com/MegafonWebLab/megafon-ui/commit/af0d26ef85a19cdb4fd863a45b2c2b2365d9c086))
35
+ * **tile:** add target props for link ([e49d040](https://github.com/MegafonWebLab/megafon-ui/commit/e49d0402725e88b9fd7d80fd418acd81bea321ba))
36
+
37
+
38
+
39
+
40
+
41
+ # [3.1.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.2...@megafon/ui-core@3.1.0) (2022-02-22)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * **carousel:** add resize listener to nav display ([12abd93](https://github.com/MegafonWebLab/megafon-ui/commit/12abd93d226676d2c4f78968c9d5de032783ec8d))
47
+ * **colors:** fix colors usage ([f2f59a8](https://github.com/MegafonWebLab/megafon-ui/commit/f2f59a81644c157394817af1531dabb1c0b67b19))
48
+ * **components:** better view of default props values ([1817ed5](https://github.com/MegafonWebLab/megafon-ui/commit/1817ed5cd17fd78a0911a89020138f05d7af9833))
49
+ * **contentarea:** add 'black' color prop value; deprecate 'default' color prop value; more examples ([e0b0c72](https://github.com/MegafonWebLab/megafon-ui/commit/e0b0c723a37f0e42ccb1c0d30df8ae36e9c82920))
50
+
51
+
52
+ ### Features
53
+
54
+ * **banner:** add opacity for slides ([bb403a1](https://github.com/MegafonWebLab/megafon-ui/commit/bb403a1d38fd0c1efd3e1df3ed72ea4e5c772c40))
55
+ * **collapse:** changed collapse animation via setTimeout to requestAnimationFrame ([06d7b4f](https://github.com/MegafonWebLab/megafon-ui/commit/06d7b4ff0f3cdf3cc22fb1d45e8401e259636cf5))
56
+ * **ui-core:** add dataAttrs prop for interactive elements of components that did not have ([f495833](https://github.com/MegafonWebLab/megafon-ui/commit/f495833b33ac7823ae5992a3f7eb8b7cef82c036))
57
+
58
+
59
+
60
+
61
+
6
62
  ## [3.0.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.1...@megafon/ui-core@3.0.2) (2022-02-15)
7
63
 
8
64
 
@@ -76,7 +132,7 @@ remove depreacted value 'freshAsphalt'
76
132
  * **contentarea**, **paragraph**, **storebanner** and **breadcrumbs** components from no don't have
77
133
  'freshAsphalt' and 'clearWhite' as values for colorizing props
78
134
  * **paragraph:** remove from color prop values: 'spbSky0', 'spbSky1', 'spbSky2'
79
- * **paragraph**: prop color change values from 'base' to 'white' and from 'contend' to 'default';
135
+ * **paragraph**: prop color change values from 'base' to 'white' and from 'content' to 'default';
80
136
  remove deprecared values 'freshAsphalt' and 'clearWhite'
81
137
  * **storebanner**: prop theme change value from 'black' to 'default'; remove deprecated value 'clearWhite'
82
138
  * **tooltip:** change onOpen, onClose types; AccessibilityEventTypeNative from @megafon/ui-helpers
@@ -32,6 +32,7 @@
32
32
  right: 20px;
33
33
  width: 32px;
34
34
  height: 32px;
35
+ outline: none;
35
36
  -webkit-transform: translateY(-50%);
36
37
  transform: translateY(-50%);
37
38
  opacity: 1;
@@ -0,0 +1,70 @@
1
+ .mfui-price-badge {
2
+ font-size: 12px;
3
+ line-height: 16px;
4
+ display: -webkit-box;
5
+ display: -ms-flexbox;
6
+ display: flex;
7
+ -webkit-box-align: center;
8
+ -ms-flex-align: center;
9
+ align-items: center;
10
+ padding: 4px;
11
+ padding-right: 8px;
12
+ width: -webkit-fit-content;
13
+ width: -moz-fit-content;
14
+ width: fit-content;
15
+ height: 24px;
16
+ border-radius: 8px;
17
+ }
18
+ @media screen and (min-width: 1024px) {
19
+ .mfui-price-badge_adaptive {
20
+ font-size: 15px;
21
+ line-height: 24px;
22
+ padding: 4px 8px;
23
+ height: 32px;
24
+ border-radius: 12px;
25
+ }
26
+ }
27
+ .mfui-price-badge_theme_grey {
28
+ background-color: var(--spbSky0);
29
+ }
30
+ .mfui-price-badge_theme_grey .mfui-price-badge__text {
31
+ color: var(--spbSky3);
32
+ }
33
+ .mfui-price-badge_theme_grey .mfui-price-badge__icon {
34
+ fill: var(--spbSky3);
35
+ }
36
+ .mfui-price-badge_theme_orange {
37
+ background-color: var(--137C20);
38
+ }
39
+ .mfui-price-badge_theme_orange .mfui-price-badge__text {
40
+ color: var(--137C);
41
+ }
42
+ .mfui-price-badge_theme_orange .mfui-price-badge__icon {
43
+ fill: var(--137C);
44
+ }
45
+ .mfui-price-badge_theme_green {
46
+ background-color: var(--brandGreen20);
47
+ }
48
+ .mfui-price-badge_theme_green .mfui-price-badge__text {
49
+ color: var(--brandGreen);
50
+ }
51
+ .mfui-price-badge_theme_green .mfui-price-badge__icon {
52
+ fill: var(--brandGreen);
53
+ }
54
+ .mfui-price-badge_theme_red {
55
+ background-color: var(--fury20);
56
+ }
57
+ .mfui-price-badge_theme_red .mfui-price-badge__text {
58
+ color: var(--fury);
59
+ }
60
+ .mfui-price-badge_theme_red .mfui-price-badge__icon {
61
+ fill: var(--fury);
62
+ }
63
+ .mfui-price-badge__text {
64
+ font-family: inherit;
65
+ margin-left: 4px;
66
+ }
67
+ .mfui-price-badge__icon {
68
+ height: 20px;
69
+ width: 20px;
70
+ }
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import './PriceBadge.less';
3
+ export declare const PriceBadgeTheme: {
4
+ readonly RED: "red";
5
+ readonly GREY: "grey";
6
+ readonly GREEN: "green";
7
+ readonly ORANGE: "orange";
8
+ };
9
+ export declare const PriceBadgeIcon: {
10
+ readonly TIMER: "timer";
11
+ readonly PRICE: "price";
12
+ readonly CHECK: "check";
13
+ readonly ATTENTION: "attention";
14
+ };
15
+ declare type PriceBadgeThemeType = typeof PriceBadgeTheme[keyof typeof PriceBadgeTheme];
16
+ declare type PriceBadgeIconType = typeof PriceBadgeIcon[keyof typeof PriceBadgeIcon];
17
+ export interface IPriceBadgeProps {
18
+ /** Адаптивный режим */
19
+ isAdaptive?: boolean;
20
+ /** Тип иконки */
21
+ iconType?: PriceBadgeIconType;
22
+ /** Цветовая тема */
23
+ theme?: PriceBadgeThemeType;
24
+ /** Дополнительный класс корневого элемента */
25
+ className?: string;
26
+ /** Дополнительные data-атрибуты к внутренним элементам */
27
+ dataAttrs?: {
28
+ root?: Record<string, string>;
29
+ };
30
+ children: JSX.Element[] | Element[] | JSX.Element | Element | string;
31
+ }
32
+ declare const PriceBadge: React.FC<IPriceBadgeProps>;
33
+ export default PriceBadge;
@@ -0,0 +1,113 @@
1
+ import "core-js/modules/es.object.values";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import * as React from 'react';
4
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
5
+ import * as PropTypes from 'prop-types';
6
+ import "./PriceBadge.css";
7
+
8
+ var AttentionIcon = function AttentionIcon(props) {
9
+ return /*#__PURE__*/React.createElement("svg", _extends({
10
+ viewBox: "0 0 20 20"
11
+ }, props), /*#__PURE__*/React.createElement("path", {
12
+ d: "M10 2c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8zm0 13c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7s-.1-.5-.3-.7c-.2-.2-.5-.3-.7-.3s-.5.1-.7.3c-.2.2-.3.4-.3.7s.1.5.3.7.5.3.7.3zM9 5v6h2V5H9z"
13
+ }));
14
+ };
15
+
16
+ var CheckIcon = function CheckIcon(props) {
17
+ return /*#__PURE__*/React.createElement("svg", _extends({
18
+ viewBox: "0 0 20 20"
19
+ }, props), /*#__PURE__*/React.createElement("path", {
20
+ fillRule: "evenodd",
21
+ clipRule: "evenodd",
22
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zM7.295 9.467l1.77 1.77 3.66-5.22 1.31.918-4.745 6.79-3.126-3.127 1.131-1.13z"
23
+ }));
24
+ };
25
+
26
+ var PriceIcon = function PriceIcon(props) {
27
+ return /*#__PURE__*/React.createElement("svg", _extends({
28
+ viewBox: "0 0 20 20"
29
+ }, props), /*#__PURE__*/React.createElement("path", {
30
+ fillRule: "evenodd",
31
+ clipRule: "evenodd",
32
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zM7.75 5.75H11a2.75 2.75 0 010 5.5H9.25V12h3v1.5h-3v1.75h-1.5V13.5h-1V12h1v-.75h-1v-1.5h1v-4zM11 7.25H9.25v2.5H11a1.25 1.25 0 000-2.5z"
33
+ }));
34
+ };
35
+
36
+ var TimerIcon = function TimerIcon(props) {
37
+ return /*#__PURE__*/React.createElement("svg", _extends({
38
+ viewBox: "0 0 20 20"
39
+ }, props), /*#__PURE__*/React.createElement("path", {
40
+ fillRule: "evenodd",
41
+ clipRule: "evenodd",
42
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm1-8.414V5H9v5.414l3 3L13.414 12 11 9.586z"
43
+ }));
44
+ };
45
+
46
+ export var PriceBadgeTheme = {
47
+ RED: 'red',
48
+ GREY: 'grey',
49
+ GREEN: 'green',
50
+ ORANGE: 'orange'
51
+ };
52
+ export var PriceBadgeIcon = {
53
+ TIMER: 'timer',
54
+ PRICE: 'price',
55
+ CHECK: 'check',
56
+ ATTENTION: 'attention'
57
+ };
58
+
59
+ var getPriceBadgeIcon = function getPriceBadgeIcon(iconType) {
60
+ switch (iconType) {
61
+ case PriceBadgeIcon.TIMER:
62
+ return TimerIcon;
63
+
64
+ case PriceBadgeIcon.PRICE:
65
+ return PriceIcon;
66
+
67
+ case PriceBadgeIcon.CHECK:
68
+ return CheckIcon;
69
+
70
+ case PriceBadgeIcon.ATTENTION:
71
+ return AttentionIcon;
72
+
73
+ default:
74
+ return TimerIcon;
75
+ }
76
+ };
77
+
78
+ var cn = cnCreate('mfui-price-badge');
79
+
80
+ var PriceBadge = function PriceBadge(_ref) {
81
+ var _ref$iconType = _ref.iconType,
82
+ iconType = _ref$iconType === void 0 ? 'timer' : _ref$iconType,
83
+ _ref$isAdaptive = _ref.isAdaptive,
84
+ isAdaptive = _ref$isAdaptive === void 0 ? false : _ref$isAdaptive,
85
+ _ref$theme = _ref.theme,
86
+ theme = _ref$theme === void 0 ? 'grey' : _ref$theme,
87
+ className = _ref.className,
88
+ dataAttrs = _ref.dataAttrs,
89
+ children = _ref.children;
90
+ var Icon = getPriceBadgeIcon(iconType);
91
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
92
+ className: cn({
93
+ theme: theme,
94
+ adaptive: isAdaptive
95
+ }, className)
96
+ }), /*#__PURE__*/React.createElement(Icon, {
97
+ className: cn('icon')
98
+ }), /*#__PURE__*/React.createElement("span", {
99
+ className: cn('text')
100
+ }, children));
101
+ };
102
+
103
+ PriceBadge.propTypes = {
104
+ isAdaptive: PropTypes.bool,
105
+ iconType: PropTypes.oneOf(Object.values(PriceBadgeIcon)),
106
+ theme: PropTypes.oneOf(Object.values(PriceBadgeTheme)),
107
+ className: PropTypes.string,
108
+ dataAttrs: PropTypes.shape({
109
+ root: PropTypes.objectOf(PropTypes.string.isRequired).isRequired
110
+ }),
111
+ children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element, PropTypes.string]).isRequired
112
+ };
113
+ export default PriceBadge;
@@ -0,0 +1,32 @@
1
+ .mfui-promo-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: 4px 12px;
9
+ width: -webkit-fit-content;
10
+ width: -moz-fit-content;
11
+ width: fit-content;
12
+ border-radius: 8px;
13
+ color: var(--base);
14
+ }
15
+ .mfui-promo-badge_type_hit {
16
+ background-color: var(--warmRedC);
17
+ }
18
+ .mfui-promo-badge_type_new {
19
+ background-color: var(--systemBlue);
20
+ }
21
+ .mfui-promo-badge_type_popular {
22
+ background-color: var(--137C);
23
+ }
24
+ .mfui-promo-badge_type_user-choice {
25
+ background-color: var(--reflexBlue);
26
+ }
27
+ .mfui-promo-badge__text {
28
+ font-family: inherit;
29
+ font-size: 12px;
30
+ line-height: 16px;
31
+ font-weight: 500;
32
+ }
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import './PromoBadge.less';
3
+ export declare const PromoBadgeTypes: {
4
+ readonly HIT: "hit";
5
+ readonly NEW: "new";
6
+ readonly POPULAR: "popular";
7
+ readonly USER_CHOICE: "user-choice";
8
+ };
9
+ declare type PromoBadgeTypesType = typeof PromoBadgeTypes[keyof typeof PromoBadgeTypes];
10
+ export interface IPromoBadgeProps {
11
+ /** Тип промо-бэйджа */
12
+ type?: PromoBadgeTypesType;
13
+ /** Дополнительный класс корневого элемента */
14
+ className?: string;
15
+ /** Дополнительные data-атрибуты к внутренним элементам */
16
+ dataAttrs?: {
17
+ root?: Record<string, string>;
18
+ };
19
+ children: JSX.Element[] | Element[] | JSX.Element | Element | string;
20
+ }
21
+ declare const PromoBadge: React.FC<IPromoBadgeProps>;
22
+ export default PromoBadge;
@@ -0,0 +1,38 @@
1
+ import "core-js/modules/es.object.values";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import * as React from 'react';
4
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
5
+ import * as PropTypes from 'prop-types';
6
+ import "./PromoBadge.css";
7
+ export var PromoBadgeTypes = {
8
+ HIT: 'hit',
9
+ NEW: 'new',
10
+ POPULAR: 'popular',
11
+ USER_CHOICE: 'user-choice'
12
+ };
13
+ var cn = cnCreate('mfui-promo-badge');
14
+
15
+ var PromoBadge = function PromoBadge(_ref) {
16
+ var _ref$type = _ref.type,
17
+ type = _ref$type === void 0 ? 'hit' : _ref$type,
18
+ className = _ref.className,
19
+ children = _ref.children,
20
+ dataAttrs = _ref.dataAttrs;
21
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
22
+ className: cn({
23
+ type: type
24
+ }, className)
25
+ }), /*#__PURE__*/React.createElement("span", {
26
+ className: cn('text')
27
+ }, children));
28
+ };
29
+
30
+ PromoBadge.propTypes = {
31
+ type: PropTypes.oneOf(Object.values(PromoBadgeTypes)),
32
+ className: PropTypes.string,
33
+ dataAttrs: PropTypes.shape({
34
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
35
+ }),
36
+ children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element, PropTypes.string]).isRequired
37
+ };
38
+ export default PromoBadge;
@@ -17,6 +17,15 @@
17
17
  height: 540px;
18
18
  }
19
19
  }
20
+ @media screen and (min-width: 1024px) {
21
+ .mfui-banner__slide {
22
+ -webkit-backface-visibility: hidden;
23
+ backface-visibility: hidden;
24
+ opacity: 0;
25
+ -webkit-transition: opacity 0.2s;
26
+ transition: opacity 0.2s;
27
+ }
28
+ }
20
29
  @media screen and (min-width: 1024px) and (max-width: 1279px) {
21
30
  .mfui-banner__slide {
22
31
  height: 420px;
@@ -27,6 +36,13 @@
27
36
  height: 400px;
28
37
  }
29
38
  }
39
+ @media screen and (min-width: 1024px) {
40
+ .mfui-banner .swiper-slide-visible {
41
+ opacity: 1;
42
+ -webkit-transition: opacity 0.4s;
43
+ transition: opacity 0.4s;
44
+ }
45
+ }
30
46
  .mfui-banner__arrow {
31
47
  position: absolute;
32
48
  top: 50%;
@@ -159,6 +159,7 @@ var Banner = function Banner(_ref) {
159
159
  className: cn('swiper'),
160
160
  loop: loop,
161
161
  autoplay: autoPlay ? getAutoPlayConfig(autoPlayDelay) : false,
162
+ watchSlidesVisibility: true,
162
163
  onSwiper: handleSwiper,
163
164
  onReachBeginning: handleReachBeginning,
164
165
  onReachEnd: handleReachEnd,
@@ -171,14 +172,20 @@ var Banner = function Banner(_ref) {
171
172
  key: i,
172
173
  className: cn('slide', classes === null || classes === void 0 ? void 0 : classes.slide)
173
174
  }), child);
174
- })), /*#__PURE__*/React.createElement(NavArrow, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowPrev), {
175
+ })), /*#__PURE__*/React.createElement(NavArrow, {
176
+ dataAttrs: {
177
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowPrev
178
+ },
175
179
  className: cn('arrow', {
176
180
  prev: true
177
181
  }, [classes.arrow]),
178
182
  onClick: handlePrevClick,
179
183
  disabled: !loop && isBeginning,
180
184
  theme: navArrowTheme
181
- })), /*#__PURE__*/React.createElement(NavArrow, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowNext), {
185
+ }), /*#__PURE__*/React.createElement(NavArrow, {
186
+ dataAttrs: {
187
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowNext
188
+ },
182
189
  className: cn('arrow', {
183
190
  next: true
184
191
  }, [classes.arrow]),
@@ -186,7 +193,7 @@ var Banner = function Banner(_ref) {
186
193
  onClick: handleNextClick,
187
194
  disabled: !loop && isEnd,
188
195
  theme: navArrowTheme
189
- })), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
196
+ }), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
190
197
  className: cn('pagination', {
191
198
  theme: navTheme,
192
199
  'bottom-offset': withPaginationBottomOffset
@@ -302,14 +302,14 @@
302
302
  fill: var(--stcWhite);
303
303
  }
304
304
  .mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_white {
305
- --base7: rgba(255, 255, 255, 0.07);
306
- --base14: rgba(255, 255, 255, 0.14);
305
+ --stcWhite7: rgba(255, 255, 255, 0.07);
306
+ --stcWhite14: rgba(255, 255, 255, 0.14);
307
307
  }
308
308
  .mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_white:not(.mfui-button_loading):hover {
309
- background-color: var(--base7);
309
+ background-color: var(--stcWhite7);
310
310
  }
311
311
  .mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_white:not(.mfui-button_loading):active {
312
- background-color: var(--base14);
312
+ background-color: var(--stcWhite14);
313
313
  }
314
314
  .mfui-button_type_outline.mfui-button_theme_black {
315
315
  color: var(--stcBlack);
@@ -321,14 +321,14 @@
321
321
  fill: var(--stcBlack);
322
322
  }
323
323
  .mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_black {
324
- --content7: rgba(51, 51, 51, 0.07);
325
- --content14: rgba(51, 51, 51, 0.14);
324
+ --stcBlack7: rgba(51, 51, 51, 0.07);
325
+ --stcBlack14: rgba(51, 51, 51, 0.14);
326
326
  }
327
327
  .mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_black:not(.mfui-button_loading):hover {
328
- background-color: var(--content7);
328
+ background-color: var(--stcBlack7);
329
329
  }
330
330
  .mfui-button_no-touch.mfui-button_type_outline.mfui-button_theme_black:not(.mfui-button_loading):active {
331
- background-color: var(--content14);
331
+ background-color: var(--stcBlack14);
332
332
  }
333
333
  .mfui-button_full-width {
334
334
  display: block;
@@ -1,6 +1,14 @@
1
1
  import React from 'react';
2
2
  import './Calendar.less';
3
3
  export interface ICalendarProps {
4
+ /** Дополнительные data атрибуты к внутренним элементам */
5
+ dataAttrs?: {
6
+ root?: Record<string, string>;
7
+ day?: Record<string, string>;
8
+ month?: Record<string, string>;
9
+ arrowLeft?: Record<string, string>;
10
+ arrowRight?: Record<string, string>;
11
+ };
4
12
  /** Переключение календаря в режим выбора одной даты вместо периода */
5
13
  isSingleDate?: boolean;
6
14
  /** Классы для модификации компонента */
@@ -22,7 +22,7 @@ var __rest = this && this.__rest || function (s, e) {
22
22
 
23
23
  import React, { useState, useEffect, useMemo } from 'react';
24
24
  import { START_DATE, END_DATE, useDatepicker, useMonth } from '@datepicker-react/hooks';
25
- import { cnCreate } from '@megafon/ui-helpers';
25
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
26
26
  import differenceInDays from 'date-fns/differenceInDays';
27
27
  import format from 'date-fns/format';
28
28
  import isAfter from 'date-fns/isAfter';
@@ -57,7 +57,8 @@ var monthLabelFormat = function monthLabelFormat(date) {
57
57
  var cn = cnCreate('mfui-calendar');
58
58
 
59
59
  var Calendar = function Calendar(_ref) {
60
- var _ref$isSingleDate = _ref.isSingleDate,
60
+ var dataAttrs = _ref.dataAttrs,
61
+ _ref$isSingleDate = _ref.isSingleDate,
61
62
  isSingleDate = _ref$isSingleDate === void 0 ? false : _ref$isSingleDate,
62
63
  _ref$startDate = _ref.startDate,
63
64
  startDate = _ref$startDate === void 0 ? null : _ref$startDate,
@@ -202,6 +203,9 @@ var Calendar = function Calendar(_ref) {
202
203
  }
203
204
 
204
205
  return /*#__PURE__*/React.createElement(Day, _extends({
206
+ dataAttrs: {
207
+ root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.day, index + 1))
208
+ },
205
209
  date: date,
206
210
  key: formatDate(date, 'dd-MM-yyyy'),
207
211
  dayLabel: dayLabel
@@ -240,6 +244,11 @@ var Calendar = function Calendar(_ref) {
240
244
  var isPrevMonthDisabled = !!minBookingDate && isSameMonth(new Date(year, month, 1), minBookingDate);
241
245
  var isNextMonthDisabled = !!maxBookingDate && isSameMonth(new Date(year, month, 1), maxBookingDate);
242
246
  return /*#__PURE__*/React.createElement(Month, {
247
+ dataAttrs: {
248
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.month,
249
+ arrowLeft: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowLeft,
250
+ arrowRight: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowRight
251
+ },
243
252
  key: "".concat(year, "-").concat(month),
244
253
  year: year,
245
254
  weekdayLabels: weekdayLabels,
@@ -252,12 +261,19 @@ var Calendar = function Calendar(_ref) {
252
261
  });
253
262
  };
254
263
 
255
- return /*#__PURE__*/React.createElement("div", {
264
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
256
265
  className: cn([className])
257
- }, renderMonths());
266
+ }), renderMonths());
258
267
  };
259
268
 
260
269
  Calendar.propTypes = {
270
+ dataAttrs: PropTypes.shape({
271
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
272
+ day: PropTypes.objectOf(PropTypes.string.isRequired),
273
+ month: PropTypes.objectOf(PropTypes.string.isRequired),
274
+ arrowLeft: PropTypes.objectOf(PropTypes.string.isRequired),
275
+ arrowRight: PropTypes.objectOf(PropTypes.string.isRequired)
276
+ }),
261
277
  isSingleDate: PropTypes.bool,
262
278
  className: PropTypes.string,
263
279
  startDate: PropTypes.instanceOf(Date),
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  import './Day.less';
3
3
  export interface IDayPickerProps {
4
+ dataAttrs?: {
5
+ root?: Record<string, string>;
6
+ };
4
7
  isDateSelected: (date: Date) => boolean;
5
8
  isDateHovered: (date: Date) => boolean;
6
9
  isFirstOrLastSelectedDate: (date: Date) => boolean;
@@ -18,7 +18,7 @@ var __rest = this && this.__rest || function (s, e) {
18
18
 
19
19
  import React from 'react';
20
20
  import { useDay } from '@datepicker-react/hooks';
21
- import { cnCreate } from '@megafon/ui-helpers';
21
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
22
22
  import isFirstDayOfMonth from 'date-fns/isFirstDayOfMonth';
23
23
  import isLastDayOfMonth from 'date-fns/isLastDayOfMonth';
24
24
  import isMonday from 'date-fns/isMonday';
@@ -28,12 +28,13 @@ import "./Day.css";
28
28
  var cn = cnCreate('mfui-day');
29
29
 
30
30
  var Day = function Day(_a) {
31
- var _a$isBetween = _a.isBetween,
31
+ var dataAttrs = _a.dataAttrs,
32
+ _a$isBetween = _a.isBetween,
32
33
  isBetween = _a$isBetween === void 0 ? false : _a$isBetween,
33
34
  dayLabel = _a.dayLabel,
34
35
  date = _a.date,
35
36
  onMouseLeave = _a.onMouseLeave,
36
- pickerProps = __rest(_a, ["isBetween", "dayLabel", "date", "onMouseLeave"]);
37
+ pickerProps = __rest(_a, ["dataAttrs", "isBetween", "dayLabel", "date", "onMouseLeave"]);
37
38
 
38
39
  var dayRef = React.useRef(null);
39
40
 
@@ -63,7 +64,7 @@ var Day = function Day(_a) {
63
64
  onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
64
65
  };
65
66
 
66
- return /*#__PURE__*/React.createElement("button", {
67
+ return /*#__PURE__*/React.createElement("button", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
67
68
  onClick: onClick,
68
69
  onKeyDown: onKeyDown,
69
70
  onMouseEnter: onMouseEnter,
@@ -72,12 +73,15 @@ var Day = function Day(_a) {
72
73
  type: "button",
73
74
  ref: dayRef,
74
75
  className: cn(modClasses)
75
- }, /*#__PURE__*/React.createElement("span", {
76
+ }), /*#__PURE__*/React.createElement("span", {
76
77
  className: cn('label')
77
78
  }, dayLabel));
78
79
  };
79
80
 
80
81
  Day.propTypes = {
82
+ dataAttrs: PropTypes.shape({
83
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
84
+ }),
81
85
  dayLabel: PropTypes.string,
82
86
  date: PropTypes.instanceOf(Date).isRequired,
83
87
  focusedDate: PropTypes.instanceOf(Date),
@@ -8,6 +8,11 @@ export interface IMonthPickerProps {
8
8
  goToNextMonths: () => void;
9
9
  }
10
10
  export interface IMonthProps {
11
+ dataAttrs?: {
12
+ root?: Record<string, string>;
13
+ arrowLeft?: Record<string, string>;
14
+ arrowRight?: Record<string, string>;
15
+ };
11
16
  isPrevMonthDisabled: boolean;
12
17
  isNextMonthDisabled: boolean;
13
18
  year: number;