@megafon/ui-core 3.6.0 → 3.9.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,50 @@
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.9.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.8.0...@megafon/ui-core@3.9.0) (2022-05-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **select:** fix selected item color when value is zero ([9847095](https://github.com/MegafonWebLab/megafon-ui/commit/98470955ef813504d4bfa4cd4d3aba77b5458446))
12
+
13
+
14
+ ### Features
15
+
16
+ * **switcher:** add data-attribute for inner element ([793a022](https://github.com/MegafonWebLab/megafon-ui/commit/793a0224ab957b938e67dd1b4d16c2389a9fb6f8))
17
+ * **tooltip:** add portal selector props ([6188832](https://github.com/MegafonWebLab/megafon-ui/commit/6188832e9ba212e7a8182333aba06d77c3e979d6))
18
+
19
+
20
+
21
+
22
+
23
+ # [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)
24
+
25
+
26
+ ### Features
27
+
28
+ * **notification:** add props classes to notification component ([608a424](https://github.com/MegafonWebLab/megafon-ui/commit/608a4246eb99af354fb7cf8ab98c2ed513d87b66))
29
+
30
+
31
+
32
+
33
+
34
+ # [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)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * **logo:** fix horizontal logo svg ([76655eb](https://github.com/MegafonWebLab/megafon-ui/commit/76655ebb82650cc2617750af0b2b2726d3ebcbf3))
40
+
41
+
42
+ ### Features
43
+
44
+ * **button:** added extra small size ([a26da46](https://github.com/MegafonWebLab/megafon-ui/commit/a26da4601de7e7c81c40eabf9a87ccdbf18cb790))
45
+
46
+
47
+
48
+
49
+
6
50
  # [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)
7
51
 
8
52
 
@@ -21,6 +21,10 @@
21
21
  appearance: none;
22
22
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
23
23
  }
24
+ .mfui-button_size-all_extra-small .mfui-button__inner {
25
+ min-width: 26px;
26
+ height: 26px;
27
+ }
24
28
  .mfui-button_size-all_small .mfui-button__inner {
25
29
  min-width: 32px;
26
30
  height: 32px;
@@ -33,6 +37,10 @@
33
37
  min-width: 60px;
34
38
  height: 60px;
35
39
  }
40
+ .mfui-button_size-all_extra-small .mfui-button__icon {
41
+ width: 18px;
42
+ height: 18px;
43
+ }
36
44
  .mfui-button_size-all_small .mfui-button__icon {
37
45
  width: 24px;
38
46
  height: 24px;
@@ -46,6 +54,10 @@
46
54
  height: 40px;
47
55
  }
48
56
  @media screen and (min-width: 1280px) {
57
+ .mfui-button_size-wide_extra-small .mfui-button__inner {
58
+ min-width: 26px;
59
+ height: 26px;
60
+ }
49
61
  .mfui-button_size-wide_small .mfui-button__inner {
50
62
  min-width: 32px;
51
63
  height: 32px;
@@ -58,6 +70,10 @@
58
70
  min-width: 60px;
59
71
  height: 60px;
60
72
  }
73
+ .mfui-button_size-wide_extra-small .mfui-button__icon {
74
+ width: 18px;
75
+ height: 18px;
76
+ }
61
77
  .mfui-button_size-wide_small .mfui-button__icon {
62
78
  width: 24px;
63
79
  height: 24px;
@@ -72,6 +88,10 @@
72
88
  }
73
89
  }
74
90
  @media screen and (min-width: 1024px) {
91
+ .mfui-button_size-desktop_extra-small .mfui-button__inner {
92
+ min-width: 26px;
93
+ height: 26px;
94
+ }
75
95
  .mfui-button_size-desktop_small .mfui-button__inner {
76
96
  min-width: 32px;
77
97
  height: 32px;
@@ -84,6 +104,10 @@
84
104
  min-width: 60px;
85
105
  height: 60px;
86
106
  }
107
+ .mfui-button_size-desktop_extra-small .mfui-button__icon {
108
+ width: 18px;
109
+ height: 18px;
110
+ }
87
111
  .mfui-button_size-desktop_small .mfui-button__icon {
88
112
  width: 24px;
89
113
  height: 24px;
@@ -98,6 +122,10 @@
98
122
  }
99
123
  }
100
124
  @media screen and (min-width: 768px) and (max-width: 1023px) {
125
+ .mfui-button_size-tablet_extra-small .mfui-button__inner {
126
+ min-width: 26px;
127
+ height: 26px;
128
+ }
101
129
  .mfui-button_size-tablet_small .mfui-button__inner {
102
130
  min-width: 32px;
103
131
  height: 32px;
@@ -110,6 +138,10 @@
110
138
  min-width: 60px;
111
139
  height: 60px;
112
140
  }
141
+ .mfui-button_size-tablet_extra-small .mfui-button__icon {
142
+ width: 18px;
143
+ height: 18px;
144
+ }
113
145
  .mfui-button_size-tablet_small .mfui-button__icon {
114
146
  width: 24px;
115
147
  height: 24px;
@@ -124,6 +156,10 @@
124
156
  }
125
157
  }
126
158
  @media screen and (max-width: 767px) {
159
+ .mfui-button_size-mobile_extra-small .mfui-button__inner {
160
+ min-width: 26px;
161
+ height: 26px;
162
+ }
127
163
  .mfui-button_size-mobile_small .mfui-button__inner {
128
164
  min-width: 32px;
129
165
  height: 32px;
@@ -136,6 +172,10 @@
136
172
  min-width: 60px;
137
173
  height: 60px;
138
174
  }
175
+ .mfui-button_size-mobile_extra-small .mfui-button__icon {
176
+ width: 18px;
177
+ height: 18px;
178
+ }
139
179
  .mfui-button_size-mobile_small .mfui-button__icon {
140
180
  width: 24px;
141
181
  height: 24px;
@@ -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";
@@ -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');
@@ -10,9 +10,9 @@ var ArrowLeft = function ArrowLeft(props) {
10
10
  return /*#__PURE__*/React.createElement("svg", _extends({
11
11
  viewBox: "0 0 20 20"
12
12
  }, props), /*#__PURE__*/React.createElement("path", {
13
+ d: "M12 6v8l-5-4z",
13
14
  fillRule: "evenodd",
14
- clipRule: "evenodd",
15
- d: "M12 6v8l-5-4z"
15
+ clipRule: "evenodd"
16
16
  }));
17
17
  };
18
18
 
@@ -20,9 +20,9 @@ var ArrowRight = function ArrowRight(props) {
20
20
  return /*#__PURE__*/React.createElement("svg", _extends({
21
21
  viewBox: "0 0 20 20"
22
22
  }, props), /*#__PURE__*/React.createElement("path", {
23
+ d: "M8 14V6l5 4z",
23
24
  fillRule: "evenodd",
24
- clipRule: "evenodd",
25
- d: "M8 14V6l5 4z"
25
+ clipRule: "evenodd"
26
26
  }));
27
27
  };
28
28
 
@@ -8,14 +8,30 @@ import "./Logo.css";
8
8
 
9
9
  var greenHorizontalImg = function greenHorizontalImg(props) {
10
10
  return /*#__PURE__*/React.createElement("svg", _extends({
11
- viewBox: "0 0 304 55"
12
- }, props), /*#__PURE__*/React.createElement("g", {
11
+ viewBox: "0 0 623 112",
12
+ fill: "none"
13
+ }, props), /*#__PURE__*/React.createElement("path", {
14
+ d: "M608.292 31.117V51.95h-27.978V31.117h-13.769v55.067h13.769V63.951h27.978v22.233h13.842V31.117h-13.842z",
13
15
  fill: "#00B956"
14
- }, /*#__PURE__*/React.createElement("path", {
15
- d: "M30.3.7v27.8c0 1.3-1 2.2-2.2 2.2h-3.3c-.2 0-.3.2-.3.3v23.3c.8 0 1.6.2 2.5.2 14.9 0 27-12.1 27-27C54 13.8 43.7 2.3 30.3.7zm-.6 41.6c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3.2 1.8-1.4 3.3-3.3 3.3zm7.9 0c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3s-1.3 3.3-3.3 3.3zm8 0c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3s-1.4 3.3-3.3 3.3z"
16
16
  }), /*#__PURE__*/React.createElement("path", {
17
- d: "M27 .6C12.1.6 0 12.7 0 27.6c0 13.1 9.1 23.8 21.3 26.3V29.6c0-1.1 1-2 2-2.2h3.3c.2 0 .3-.2.3-.3L27 .6zm-5.2 22.2c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3s-1.5 3.3-3.3 3.3zm275.5-7.5v10.2h-13.6V15.3h-6.9v27h6.9V31.4h13.6v10.9h6.7v-27zm-112.4 3.1c-1.1-2.4-3.3-3.7-5.5-3.7s-4.5 1.3-5.5 3.7l-10.9 24h7.2l2.4-5.7h14l2.4 5.7h7.2l-11.3-24zm-10.4 12.9l4.1-9.9c.2-.3.3-.3.5-.3s.5 0 .5.3l4.1 9.9h-9.2zm-70-20.8c-3.2 0-5.2 1.7-6.7 5.1l-8.7 20.3-8.8-20.4c-1.4-3.3-3.5-5.1-6.7-5.1-3 0-6 2-6 6.7v25.1h6.7V18l8.9 20.1c1.1 2.9 3.2 4.6 5.9 4.6 2.9 0 4.8-1.7 5.9-4.6l8.9-20.1v24.5h6.7V17.4c-.1-4.7-3.1-6.9-6.1-6.9zm17.9 26.1c-.3 0-.7-.3-.7-.7v-4.8h16.8v-5.5h-16.8v-4.1c0-.3.3-.7.7-.7h16.7v-5.7h-20c-2.4 0-4 1.9-4 4V38c0 2 1.7 4 4 4h20v-5.7h-16.7v.3zm28 5.7V21.7c0-.3.3-.7.7-.7h16.7v-5.7h-20c-2.4 0-4 1.9-4 4v22.9l6.6.1zm122-13.4c0-9.4-4.1-13.8-14.3-13.8h-2.4c-10.2 0-14.3 4.5-14.3 13.8 0 9.2 4.1 13.8 14.3 13.8h2.2c10.4-.2 14.5-4.6 14.5-13.8zM257.9 37h-2.2c-5.5 0-7.8-2.5-7.8-8.1 0-5.4 1.9-8.1 7.8-8.1h2.2c5.7 0 7.8 2.7 7.8 8.1 0 5.5-2.1 8.1-7.8 8.1zm-35.2-25.9h-13.4c-10 0-14 5.1-14 13.8 0 1.4.2 2.7.3 3.8 1.1 6.2 4.8 10 14.1 10h3v3.5h6.7v-3.5h2.9c9.4 0 13.1-3.8 14.1-10 .2-1.1.3-2.4.3-3.8-.1-8.7-4.2-13.8-14-13.8zm-10.2 22h-3c-4.6 0-6.2-1.7-7.2-4.5-.3-1-.3-2.4-.3-3.8 0-5.7 2.7-8.1 6.5-8.1h4.1v16.4h-.1zm17.2-4.2c-1 2.7-2.7 4.5-7.2 4.5h-3V16.9h4.1c3.8 0 6.5 2.4 6.5 8.1-.1 1.5-.1 2.7-.4 3.9z"
18
- })));
17
+ fillRule: "evenodd",
18
+ clipRule: "evenodd",
19
+ d: "M367.31 29.865c4.417 0 9.056 2.43 11.338 7.436l22.53 48.883h-14.652l-4.933-11.632h-28.567l-4.933 11.632h-14.652l22.53-48.883c2.282-5.007 6.921-7.436 11.339-7.436zm-1.105 13.693l-8.467 19.951h19.143l-8.467-19.95c-.221-.663-.736-.81-1.104-.81-.369 0-.81.22-1.105.81z",
20
+ fill: "#00B956"
21
+ }), /*#__PURE__*/React.createElement("path", {
22
+ d: "M214.533 21.178c-6.48 0-10.603 3.46-13.622 10.38l-17.965 41.374-17.965-41.374c-3.018-6.92-7.142-10.38-13.621-10.38-6.037 0-12.296 4.343-12.296 13.693v51.313h13.769v-49.84l18.112 41.08c2.43 5.742 6.332 9.349 12.001 9.349 5.67 0 9.572-3.607 12.002-9.35l18.112-41.08v49.841h13.768v-51.24c0-9.423-6.258-13.766-12.295-13.766zm36.445 53.227a1.163 1.163 0 01-1.178-1.178v-9.644h34.384V52.319H249.8v-8.393c0-.662.515-1.178 1.178-1.178h34.016V31.117h-40.79c-4.785 0-8.172 3.975-8.172 8.171v38.577c0 4.196 3.46 8.172 8.172 8.172h40.79V74.405h-34.016zm57.429 11.779V44c0-.663.516-1.178 1.179-1.178h34.015V31.19h-40.789c-4.786 0-8.173 3.976-8.173 8.172v46.822h13.768z",
23
+ fill: "#00B956"
24
+ }), /*#__PURE__*/React.createElement("path", {
25
+ fillRule: "evenodd",
26
+ clipRule: "evenodd",
27
+ d: "M528.259 30.307c20.837 0 29.157 8.981 29.157 28.27 0 18.994-8.468 28.122-29.304 28.122h-4.565c-20.837 0-29.304-9.128-29.304-28.122 0-19.289 8.246-28.27 29.157-28.27h4.859zm-4.638 44.981h4.417c11.412 0 15.977-5.153 15.977-16.711v-.074c0-11.19-4.27-16.712-15.977-16.712h-4.417c-12.075 0-15.978 5.522-15.978 16.712v.074c0 11.558 4.492 16.711 15.978 16.711zm-95.127-52.785h27.316c20.321 0 28.493 10.307 28.567 28.27 0 2.797-.221 5.374-.589 7.804-2.135 12.736-9.645 20.54-28.715 20.54h-5.963v7.067h-13.769v-7.067h-6.037c-19.07 0-26.58-7.804-28.715-20.54-.442-2.43-.589-5.006-.589-7.804 0-17.963 8.099-28.27 28.494-28.27zm6.774 44.982h-6.332c-9.351 0-12.664-3.46-14.726-8.908-.81-2.135-.81-4.786-.81-7.804 0-11.706 5.449-16.712 13.4-16.712h8.468v33.424zm34.825-8.908c-2.061 5.448-5.448 8.908-14.725 8.908h-6.332V34.06h8.467c7.952 0 13.4 4.933 13.4 16.712 0 3.018 0 5.669-.81 7.804zM62.86 58.135V1.227c27.242 3.313 48.373 26.577 48.447 54.7 0 30.478-24.74 55.214-55.22 55.214a58.32 58.32 0 01-5.081-.221V63.215a.58.58 0 01.589-.59h6.774c2.43 0 4.49-1.987 4.49-4.49zM61.682 86.11a6.913 6.913 0 01-6.921-6.92 6.913 6.913 0 016.92-6.92 6.913 6.913 0 016.922 6.92 6.913 6.913 0 01-6.921 6.92zm9.277-6.92a6.913 6.913 0 006.92 6.92 6.913 6.913 0 006.922-6.92 6.913 6.913 0 00-6.921-6.92 6.913 6.913 0 00-6.921 6.92zm16.198 0a6.913 6.913 0 006.92 6.92A6.913 6.913 0 00101 79.19a6.913 6.913 0 00-6.921-6.92 6.913 6.913 0 00-6.921 6.92z",
28
+ fill: "#00B956"
29
+ }), /*#__PURE__*/React.createElement("path", {
30
+ fillRule: "evenodd",
31
+ clipRule: "evenodd",
32
+ d: "M.792 56C.792 25.521 25.531.785 56.012.785h.148v54.626a.58.58 0 01-.59.589h-6.92c-2.356.074-4.27 2.061-4.344 4.417v49.546C19.42 104.589.792 82.503.792 56zm37.697-16.638a6.913 6.913 0 006.921 6.92 6.913 6.913 0 006.921-6.92 6.913 6.913 0 00-6.92-6.92 6.913 6.913 0 00-6.922 6.92z",
33
+ fill: "#00B956"
34
+ }));
19
35
  };
20
36
 
21
37
  var greenVerticalImg = function greenVerticalImg(props) {
@@ -17,6 +17,12 @@ declare type ShadowType = typeof ShadowTypes[keyof typeof ShadowTypes];
17
17
  export interface INotificationProps {
18
18
  /** Дополнительный класс корневого элемента */
19
19
  className?: string;
20
+ /** Дополнительные классы для корневого и внутренних элементов */
21
+ classes?: {
22
+ root?: string;
23
+ container?: string;
24
+ content?: string;
25
+ };
20
26
  /** Тип отображения */
21
27
  type?: NotificationType;
22
28
  /** Уровень тени */
@@ -77,6 +77,11 @@ var cn = cnCreate('mfui-notification');
77
77
 
78
78
  var Notification = function Notification(_ref) {
79
79
  var className = _ref.className,
80
+ _ref$classes = _ref.classes;
81
+ _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
82
+ var rootClass = _ref$classes.root,
83
+ containerClass = _ref$classes.container,
84
+ contentClass = _ref$classes.content,
80
85
  children = _ref.children,
81
86
  _ref$type = _ref.type,
82
87
  type = _ref$type === void 0 ? 'info' : _ref$type,
@@ -143,13 +148,13 @@ var Notification = function Notification(_ref) {
143
148
  className: cn({
144
149
  type: type,
145
150
  colored: isColored
146
- }, className)
151
+ }, [className, rootClass])
147
152
  }, /*#__PURE__*/React.createElement("div", {
148
- className: cn('container')
153
+ className: cn('container', [containerClass])
149
154
  }, /*#__PURE__*/React.createElement("div", {
150
155
  className: cn('icon-container')
151
156
  }, renderIcon()), /*#__PURE__*/React.createElement("div", {
152
- className: cn('content')
157
+ className: cn('content', [contentClass])
153
158
  }, title && /*#__PURE__*/React.createElement(Header, {
154
159
  dataAttrs: {
155
160
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.title
@@ -174,6 +179,11 @@ var Notification = function Notification(_ref) {
174
179
  Notification.propTypes = {
175
180
  type: PropTypes.oneOf(Object.values(NotificationTypes)),
176
181
  className: PropTypes.string,
182
+ classes: PropTypes.shape({
183
+ root: PropTypes.string,
184
+ container: PropTypes.string,
185
+ content: PropTypes.string
186
+ }),
177
187
  shadowLevel: PropTypes.oneOf(Object.values(ShadowTypes)),
178
188
  isColored: PropTypes.bool,
179
189
  hasCloseButton: PropTypes.bool,
@@ -337,7 +337,7 @@ var Select = function Select(_ref) {
337
337
 
338
338
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.title), {
339
339
  className: cn('title', {
340
- placeholder: !!placeholder && !currentValue
340
+ placeholder: !!placeholder && currentValue === undefined
341
341
  }, [classes === null || classes === void 0 ? void 0 : classes.title]),
342
342
  role: "button",
343
343
  tabIndex: 0,
@@ -5,6 +5,7 @@ export interface ISwitcherProps {
5
5
  /** Дополнительные data атрибуты к внутренним элементам */
6
6
  dataAttrs?: {
7
7
  root?: Record<string, string>;
8
+ input?: Record<string, string>;
8
9
  };
9
10
  /** Дополнительный класс корневого элемента */
10
11
  className?: string;
@@ -40,7 +40,7 @@ var Switcher = function Switcher(_ref) {
40
40
  size: textSize,
41
41
  left: true
42
42
  })
43
- }, children), /*#__PURE__*/React.createElement("div", {
43
+ }, children), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.input), {
44
44
  className: cn('input', {
45
45
  checked: checked,
46
46
  disabled: disabled,
@@ -50,7 +50,7 @@ var Switcher = function Switcher(_ref) {
50
50
  onClick: handleChange,
51
51
  onKeyDown: handleChange,
52
52
  tabIndex: isInteractiveDisabled ? undefined : 0
53
- }, showLoader && !disabled && /*#__PURE__*/React.createElement("div", {
53
+ }), showLoader && !disabled && /*#__PURE__*/React.createElement("div", {
54
54
  className: cn('loader')
55
55
  }), /*#__PURE__*/React.createElement("div", {
56
56
  className: cn('pointer')
@@ -63,7 +63,8 @@ var Switcher = function Switcher(_ref) {
63
63
 
64
64
  Switcher.propTypes = {
65
65
  dataAttrs: PropTypes.shape({
66
- root: PropTypes.objectOf(PropTypes.string.isRequired)
66
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
67
+ input: PropTypes.objectOf(PropTypes.string.isRequired)
67
68
  }),
68
69
  className: PropTypes.string,
69
70
  textSize: PropTypes.oneOf(['small', 'medium']),
@@ -39,6 +39,8 @@ export interface ITooltipProps {
39
39
  isOpened?: boolean;
40
40
  /** Отрендерить компонент в корневой элементе страницы body */
41
41
  isPortal?: boolean;
42
+ /** Рендеринг компонента в указанном селекторе */
43
+ portalSelector?: string;
42
44
  /** Дополнительный класс корневого элемента */
43
45
  className?: string;
44
46
  /** Дополнительные классы для внутренних элементов */
@@ -48,6 +48,7 @@ var Tooltip = function Tooltip(_ref) {
48
48
  isOpened = _ref$isOpened === void 0 ? false : _ref$isOpened,
49
49
  _ref$isPortal = _ref.isPortal,
50
50
  isPortal = _ref$isPortal === void 0 ? false : _ref$isPortal,
51
+ portalSelector = _ref.portalSelector,
51
52
  children = _ref.children,
52
53
  _ref$classes = _ref.classes;
53
54
  _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
@@ -222,12 +223,14 @@ var Tooltip = function Tooltip(_ref) {
222
223
  useEffect(function () {
223
224
  return function () {
224
225
  if (portalElem.current) {
225
- document.body.removeChild(portalElem.current);
226
+ var parent = portalSelector ? document.querySelector(portalSelector) : document.body;
227
+ parent === null || parent === void 0 ? void 0 : parent.removeChild(portalElem.current);
226
228
  }
227
229
 
228
230
  portalElem.current = null;
229
231
  };
230
- }, []);
232
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
233
+ []);
231
234
  var template = /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
232
235
  className: cn({
233
236
  paddings: paddings,
@@ -255,7 +258,8 @@ var Tooltip = function Tooltip(_ref) {
255
258
 
256
259
  if (isPortal && !portalElem.current && typeof window !== 'undefined') {
257
260
  portalElem.current = document.createElement('div');
258
- document.body.appendChild(portalElem.current);
261
+ var parent = portalSelector ? document.querySelector(portalSelector) : document.body;
262
+ parent === null || parent === void 0 ? void 0 : parent.appendChild(portalElem.current);
259
263
  }
260
264
 
261
265
  if (isPortal && portalElem.current) {
@@ -294,6 +298,7 @@ Tooltip.propTypes = {
294
298
  }), PropTypes.any])]),
295
299
  isOpened: PropTypes.bool,
296
300
  isPortal: PropTypes.bool,
301
+ portalSelector: PropTypes.string,
297
302
  className: PropTypes.string,
298
303
  classes: PropTypes.shape({
299
304
  root: PropTypes.string,
@@ -21,6 +21,10 @@
21
21
  appearance: none;
22
22
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
23
23
  }
24
+ .mfui-button_size-all_extra-small .mfui-button__inner {
25
+ min-width: 26px;
26
+ height: 26px;
27
+ }
24
28
  .mfui-button_size-all_small .mfui-button__inner {
25
29
  min-width: 32px;
26
30
  height: 32px;
@@ -33,6 +37,10 @@
33
37
  min-width: 60px;
34
38
  height: 60px;
35
39
  }
40
+ .mfui-button_size-all_extra-small .mfui-button__icon {
41
+ width: 18px;
42
+ height: 18px;
43
+ }
36
44
  .mfui-button_size-all_small .mfui-button__icon {
37
45
  width: 24px;
38
46
  height: 24px;
@@ -46,6 +54,10 @@
46
54
  height: 40px;
47
55
  }
48
56
  @media screen and (min-width: 1280px) {
57
+ .mfui-button_size-wide_extra-small .mfui-button__inner {
58
+ min-width: 26px;
59
+ height: 26px;
60
+ }
49
61
  .mfui-button_size-wide_small .mfui-button__inner {
50
62
  min-width: 32px;
51
63
  height: 32px;
@@ -58,6 +70,10 @@
58
70
  min-width: 60px;
59
71
  height: 60px;
60
72
  }
73
+ .mfui-button_size-wide_extra-small .mfui-button__icon {
74
+ width: 18px;
75
+ height: 18px;
76
+ }
61
77
  .mfui-button_size-wide_small .mfui-button__icon {
62
78
  width: 24px;
63
79
  height: 24px;
@@ -72,6 +88,10 @@
72
88
  }
73
89
  }
74
90
  @media screen and (min-width: 1024px) {
91
+ .mfui-button_size-desktop_extra-small .mfui-button__inner {
92
+ min-width: 26px;
93
+ height: 26px;
94
+ }
75
95
  .mfui-button_size-desktop_small .mfui-button__inner {
76
96
  min-width: 32px;
77
97
  height: 32px;
@@ -84,6 +104,10 @@
84
104
  min-width: 60px;
85
105
  height: 60px;
86
106
  }
107
+ .mfui-button_size-desktop_extra-small .mfui-button__icon {
108
+ width: 18px;
109
+ height: 18px;
110
+ }
87
111
  .mfui-button_size-desktop_small .mfui-button__icon {
88
112
  width: 24px;
89
113
  height: 24px;
@@ -98,6 +122,10 @@
98
122
  }
99
123
  }
100
124
  @media screen and (min-width: 768px) and (max-width: 1023px) {
125
+ .mfui-button_size-tablet_extra-small .mfui-button__inner {
126
+ min-width: 26px;
127
+ height: 26px;
128
+ }
101
129
  .mfui-button_size-tablet_small .mfui-button__inner {
102
130
  min-width: 32px;
103
131
  height: 32px;
@@ -110,6 +138,10 @@
110
138
  min-width: 60px;
111
139
  height: 60px;
112
140
  }
141
+ .mfui-button_size-tablet_extra-small .mfui-button__icon {
142
+ width: 18px;
143
+ height: 18px;
144
+ }
113
145
  .mfui-button_size-tablet_small .mfui-button__icon {
114
146
  width: 24px;
115
147
  height: 24px;
@@ -124,6 +156,10 @@
124
156
  }
125
157
  }
126
158
  @media screen and (max-width: 767px) {
159
+ .mfui-button_size-mobile_extra-small .mfui-button__inner {
160
+ min-width: 26px;
161
+ height: 26px;
162
+ }
127
163
  .mfui-button_size-mobile_small .mfui-button__inner {
128
164
  min-width: 32px;
129
165
  height: 32px;
@@ -136,6 +172,10 @@
136
172
  min-width: 60px;
137
173
  height: 60px;
138
174
  }
175
+ .mfui-button_size-mobile_extra-small .mfui-button__icon {
176
+ width: 18px;
177
+ height: 18px;
178
+ }
139
179
  .mfui-button_size-mobile_small .mfui-button__icon {
140
180
  width: 24px;
141
181
  height: 24px;
@@ -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";
@@ -54,6 +54,7 @@ var ButtonThemes = {
54
54
  };
55
55
  exports.ButtonThemes = ButtonThemes;
56
56
  var ButtonSizes = {
57
+ EXTRA_SMALL: 'extra-small',
57
58
  SMALL: 'small',
58
59
  MEDIUM: 'medium',
59
60
  LARGE: 'large'
@@ -68,7 +69,7 @@ var Content;
68
69
  })(Content || (Content = {}));
69
70
 
70
71
  var getLoaderSize = function getLoaderSize(size) {
71
- return size === ButtonSizes.SMALL ? ButtonSizes.SMALL : ButtonSizes.MEDIUM;
72
+ return size === ButtonSizes.SMALL || size === ButtonSizes.EXTRA_SMALL ? ButtonSizes.SMALL : ButtonSizes.MEDIUM;
72
73
  };
73
74
 
74
75
  var cn = (0, _uiHelpers.cnCreate)('mfui-button');
@@ -23,9 +23,9 @@ var ArrowLeft = function ArrowLeft(props) {
23
23
  return /*#__PURE__*/_react["default"].createElement("svg", (0, _extends2["default"])({
24
24
  viewBox: "0 0 20 20"
25
25
  }, props), /*#__PURE__*/_react["default"].createElement("path", {
26
+ d: "M12 6v8l-5-4z",
26
27
  fillRule: "evenodd",
27
- clipRule: "evenodd",
28
- d: "M12 6v8l-5-4z"
28
+ clipRule: "evenodd"
29
29
  }));
30
30
  };
31
31
 
@@ -33,9 +33,9 @@ var ArrowRight = function ArrowRight(props) {
33
33
  return /*#__PURE__*/_react["default"].createElement("svg", (0, _extends2["default"])({
34
34
  viewBox: "0 0 20 20"
35
35
  }, props), /*#__PURE__*/_react["default"].createElement("path", {
36
+ d: "M8 14V6l5 4z",
36
37
  fillRule: "evenodd",
37
- clipRule: "evenodd",
38
- d: "M8 14V6l5 4z"
38
+ clipRule: "evenodd"
39
39
  }));
40
40
  };
41
41
 
@@ -27,14 +27,30 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
27
27
 
28
28
  var greenHorizontalImg = function greenHorizontalImg(props) {
29
29
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
30
- viewBox: "0 0 304 55"
31
- }, props), /*#__PURE__*/React.createElement("g", {
30
+ viewBox: "0 0 623 112",
31
+ fill: "none"
32
+ }, props), /*#__PURE__*/React.createElement("path", {
33
+ d: "M608.292 31.117V51.95h-27.978V31.117h-13.769v55.067h13.769V63.951h27.978v22.233h13.842V31.117h-13.842z",
32
34
  fill: "#00B956"
33
- }, /*#__PURE__*/React.createElement("path", {
34
- d: "M30.3.7v27.8c0 1.3-1 2.2-2.2 2.2h-3.3c-.2 0-.3.2-.3.3v23.3c.8 0 1.6.2 2.5.2 14.9 0 27-12.1 27-27C54 13.8 43.7 2.3 30.3.7zm-.6 41.6c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3.2 1.8-1.4 3.3-3.3 3.3zm7.9 0c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3s-1.3 3.3-3.3 3.3zm8 0c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3s-1.4 3.3-3.3 3.3z"
35
35
  }), /*#__PURE__*/React.createElement("path", {
36
- d: "M27 .6C12.1.6 0 12.7 0 27.6c0 13.1 9.1 23.8 21.3 26.3V29.6c0-1.1 1-2 2-2.2h3.3c.2 0 .3-.2.3-.3L27 .6zm-5.2 22.2c-1.9 0-3.3-1.6-3.3-3.3 0-1.9 1.6-3.3 3.3-3.3 1.9 0 3.3 1.6 3.3 3.3s-1.5 3.3-3.3 3.3zm275.5-7.5v10.2h-13.6V15.3h-6.9v27h6.9V31.4h13.6v10.9h6.7v-27zm-112.4 3.1c-1.1-2.4-3.3-3.7-5.5-3.7s-4.5 1.3-5.5 3.7l-10.9 24h7.2l2.4-5.7h14l2.4 5.7h7.2l-11.3-24zm-10.4 12.9l4.1-9.9c.2-.3.3-.3.5-.3s.5 0 .5.3l4.1 9.9h-9.2zm-70-20.8c-3.2 0-5.2 1.7-6.7 5.1l-8.7 20.3-8.8-20.4c-1.4-3.3-3.5-5.1-6.7-5.1-3 0-6 2-6 6.7v25.1h6.7V18l8.9 20.1c1.1 2.9 3.2 4.6 5.9 4.6 2.9 0 4.8-1.7 5.9-4.6l8.9-20.1v24.5h6.7V17.4c-.1-4.7-3.1-6.9-6.1-6.9zm17.9 26.1c-.3 0-.7-.3-.7-.7v-4.8h16.8v-5.5h-16.8v-4.1c0-.3.3-.7.7-.7h16.7v-5.7h-20c-2.4 0-4 1.9-4 4V38c0 2 1.7 4 4 4h20v-5.7h-16.7v.3zm28 5.7V21.7c0-.3.3-.7.7-.7h16.7v-5.7h-20c-2.4 0-4 1.9-4 4v22.9l6.6.1zm122-13.4c0-9.4-4.1-13.8-14.3-13.8h-2.4c-10.2 0-14.3 4.5-14.3 13.8 0 9.2 4.1 13.8 14.3 13.8h2.2c10.4-.2 14.5-4.6 14.5-13.8zM257.9 37h-2.2c-5.5 0-7.8-2.5-7.8-8.1 0-5.4 1.9-8.1 7.8-8.1h2.2c5.7 0 7.8 2.7 7.8 8.1 0 5.5-2.1 8.1-7.8 8.1zm-35.2-25.9h-13.4c-10 0-14 5.1-14 13.8 0 1.4.2 2.7.3 3.8 1.1 6.2 4.8 10 14.1 10h3v3.5h6.7v-3.5h2.9c9.4 0 13.1-3.8 14.1-10 .2-1.1.3-2.4.3-3.8-.1-8.7-4.2-13.8-14-13.8zm-10.2 22h-3c-4.6 0-6.2-1.7-7.2-4.5-.3-1-.3-2.4-.3-3.8 0-5.7 2.7-8.1 6.5-8.1h4.1v16.4h-.1zm17.2-4.2c-1 2.7-2.7 4.5-7.2 4.5h-3V16.9h4.1c3.8 0 6.5 2.4 6.5 8.1-.1 1.5-.1 2.7-.4 3.9z"
37
- })));
36
+ fillRule: "evenodd",
37
+ clipRule: "evenodd",
38
+ d: "M367.31 29.865c4.417 0 9.056 2.43 11.338 7.436l22.53 48.883h-14.652l-4.933-11.632h-28.567l-4.933 11.632h-14.652l22.53-48.883c2.282-5.007 6.921-7.436 11.339-7.436zm-1.105 13.693l-8.467 19.951h19.143l-8.467-19.95c-.221-.663-.736-.81-1.104-.81-.369 0-.81.22-1.105.81z",
39
+ fill: "#00B956"
40
+ }), /*#__PURE__*/React.createElement("path", {
41
+ d: "M214.533 21.178c-6.48 0-10.603 3.46-13.622 10.38l-17.965 41.374-17.965-41.374c-3.018-6.92-7.142-10.38-13.621-10.38-6.037 0-12.296 4.343-12.296 13.693v51.313h13.769v-49.84l18.112 41.08c2.43 5.742 6.332 9.349 12.001 9.349 5.67 0 9.572-3.607 12.002-9.35l18.112-41.08v49.841h13.768v-51.24c0-9.423-6.258-13.766-12.295-13.766zm36.445 53.227a1.163 1.163 0 01-1.178-1.178v-9.644h34.384V52.319H249.8v-8.393c0-.662.515-1.178 1.178-1.178h34.016V31.117h-40.79c-4.785 0-8.172 3.975-8.172 8.171v38.577c0 4.196 3.46 8.172 8.172 8.172h40.79V74.405h-34.016zm57.429 11.779V44c0-.663.516-1.178 1.179-1.178h34.015V31.19h-40.789c-4.786 0-8.173 3.976-8.173 8.172v46.822h13.768z",
42
+ fill: "#00B956"
43
+ }), /*#__PURE__*/React.createElement("path", {
44
+ fillRule: "evenodd",
45
+ clipRule: "evenodd",
46
+ d: "M528.259 30.307c20.837 0 29.157 8.981 29.157 28.27 0 18.994-8.468 28.122-29.304 28.122h-4.565c-20.837 0-29.304-9.128-29.304-28.122 0-19.289 8.246-28.27 29.157-28.27h4.859zm-4.638 44.981h4.417c11.412 0 15.977-5.153 15.977-16.711v-.074c0-11.19-4.27-16.712-15.977-16.712h-4.417c-12.075 0-15.978 5.522-15.978 16.712v.074c0 11.558 4.492 16.711 15.978 16.711zm-95.127-52.785h27.316c20.321 0 28.493 10.307 28.567 28.27 0 2.797-.221 5.374-.589 7.804-2.135 12.736-9.645 20.54-28.715 20.54h-5.963v7.067h-13.769v-7.067h-6.037c-19.07 0-26.58-7.804-28.715-20.54-.442-2.43-.589-5.006-.589-7.804 0-17.963 8.099-28.27 28.494-28.27zm6.774 44.982h-6.332c-9.351 0-12.664-3.46-14.726-8.908-.81-2.135-.81-4.786-.81-7.804 0-11.706 5.449-16.712 13.4-16.712h8.468v33.424zm34.825-8.908c-2.061 5.448-5.448 8.908-14.725 8.908h-6.332V34.06h8.467c7.952 0 13.4 4.933 13.4 16.712 0 3.018 0 5.669-.81 7.804zM62.86 58.135V1.227c27.242 3.313 48.373 26.577 48.447 54.7 0 30.478-24.74 55.214-55.22 55.214a58.32 58.32 0 01-5.081-.221V63.215a.58.58 0 01.589-.59h6.774c2.43 0 4.49-1.987 4.49-4.49zM61.682 86.11a6.913 6.913 0 01-6.921-6.92 6.913 6.913 0 016.92-6.92 6.913 6.913 0 016.922 6.92 6.913 6.913 0 01-6.921 6.92zm9.277-6.92a6.913 6.913 0 006.92 6.92 6.913 6.913 0 006.922-6.92 6.913 6.913 0 00-6.921-6.92 6.913 6.913 0 00-6.921 6.92zm16.198 0a6.913 6.913 0 006.92 6.92A6.913 6.913 0 00101 79.19a6.913 6.913 0 00-6.921-6.92 6.913 6.913 0 00-6.921 6.92z",
47
+ fill: "#00B956"
48
+ }), /*#__PURE__*/React.createElement("path", {
49
+ fillRule: "evenodd",
50
+ clipRule: "evenodd",
51
+ d: "M.792 56C.792 25.521 25.531.785 56.012.785h.148v54.626a.58.58 0 01-.59.589h-6.92c-2.356.074-4.27 2.061-4.344 4.417v49.546C19.42 104.589.792 82.503.792 56zm37.697-16.638a6.913 6.913 0 006.921 6.92 6.913 6.913 0 006.921-6.92 6.913 6.913 0 00-6.92-6.92 6.913 6.913 0 00-6.922 6.92z",
52
+ fill: "#00B956"
53
+ }));
38
54
  };
39
55
 
40
56
  var greenVerticalImg = function greenVerticalImg(props) {
@@ -17,6 +17,12 @@ declare type ShadowType = typeof ShadowTypes[keyof typeof ShadowTypes];
17
17
  export interface INotificationProps {
18
18
  /** Дополнительный класс корневого элемента */
19
19
  className?: string;
20
+ /** Дополнительные классы для корневого и внутренних элементов */
21
+ classes?: {
22
+ root?: string;
23
+ container?: string;
24
+ content?: string;
25
+ };
20
26
  /** Тип отображения */
21
27
  type?: NotificationType;
22
28
  /** Уровень тени */
@@ -101,6 +101,11 @@ var cn = (0, _uiHelpers.cnCreate)('mfui-notification');
101
101
 
102
102
  var Notification = function Notification(_ref) {
103
103
  var className = _ref.className,
104
+ _ref$classes = _ref.classes;
105
+ _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
106
+ var rootClass = _ref$classes.root,
107
+ containerClass = _ref$classes.container,
108
+ contentClass = _ref$classes.content,
104
109
  children = _ref.children,
105
110
  _ref$type = _ref.type,
106
111
  type = _ref$type === void 0 ? 'info' : _ref$type,
@@ -167,13 +172,13 @@ var Notification = function Notification(_ref) {
167
172
  className: cn({
168
173
  type: type,
169
174
  colored: isColored
170
- }, className)
175
+ }, [className, rootClass])
171
176
  }, /*#__PURE__*/_react["default"].createElement("div", {
172
- className: cn('container')
177
+ className: cn('container', [containerClass])
173
178
  }, /*#__PURE__*/_react["default"].createElement("div", {
174
179
  className: cn('icon-container')
175
180
  }, renderIcon()), /*#__PURE__*/_react["default"].createElement("div", {
176
- className: cn('content')
181
+ className: cn('content', [contentClass])
177
182
  }, title && /*#__PURE__*/_react["default"].createElement(_Header["default"], {
178
183
  dataAttrs: {
179
184
  root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.title
@@ -198,6 +203,11 @@ var Notification = function Notification(_ref) {
198
203
  Notification.propTypes = {
199
204
  type: PropTypes.oneOf(Object.values(NotificationTypes)),
200
205
  className: PropTypes.string,
206
+ classes: PropTypes.shape({
207
+ root: PropTypes.string,
208
+ container: PropTypes.string,
209
+ content: PropTypes.string
210
+ }),
201
211
  shadowLevel: PropTypes.oneOf(Object.values(ShadowTypes)),
202
212
  isColored: PropTypes.bool,
203
213
  hasCloseButton: PropTypes.bool,
@@ -372,7 +372,7 @@ var Select = function Select(_ref) {
372
372
 
373
373
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.title), {
374
374
  className: cn('title', {
375
- placeholder: !!placeholder && !currentValue
375
+ placeholder: !!placeholder && currentValue === undefined
376
376
  }, [classes === null || classes === void 0 ? void 0 : classes.title]),
377
377
  role: "button",
378
378
  tabIndex: 0,
@@ -5,6 +5,7 @@ export interface ISwitcherProps {
5
5
  /** Дополнительные data атрибуты к внутренним элементам */
6
6
  dataAttrs?: {
7
7
  root?: Record<string, string>;
8
+ input?: Record<string, string>;
8
9
  };
9
10
  /** Дополнительный класс корневого элемента */
10
11
  className?: string;
@@ -58,7 +58,7 @@ var Switcher = function Switcher(_ref) {
58
58
  size: textSize,
59
59
  left: true
60
60
  })
61
- }, children), /*#__PURE__*/React.createElement("div", {
61
+ }, children), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.input), {
62
62
  className: cn('input', {
63
63
  checked: checked,
64
64
  disabled: disabled,
@@ -68,7 +68,7 @@ var Switcher = function Switcher(_ref) {
68
68
  onClick: handleChange,
69
69
  onKeyDown: handleChange,
70
70
  tabIndex: isInteractiveDisabled ? undefined : 0
71
- }, showLoader && !disabled && /*#__PURE__*/React.createElement("div", {
71
+ }), showLoader && !disabled && /*#__PURE__*/React.createElement("div", {
72
72
  className: cn('loader')
73
73
  }), /*#__PURE__*/React.createElement("div", {
74
74
  className: cn('pointer')
@@ -81,7 +81,8 @@ var Switcher = function Switcher(_ref) {
81
81
 
82
82
  Switcher.propTypes = {
83
83
  dataAttrs: PropTypes.shape({
84
- root: PropTypes.objectOf(PropTypes.string.isRequired)
84
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
85
+ input: PropTypes.objectOf(PropTypes.string.isRequired)
85
86
  }),
86
87
  className: PropTypes.string,
87
88
  textSize: PropTypes.oneOf(['small', 'medium']),
@@ -39,6 +39,8 @@ export interface ITooltipProps {
39
39
  isOpened?: boolean;
40
40
  /** Отрендерить компонент в корневой элементе страницы body */
41
41
  isPortal?: boolean;
42
+ /** Рендеринг компонента в указанном селекторе */
43
+ portalSelector?: string;
42
44
  /** Дополнительный класс корневого элемента */
43
45
  className?: string;
44
46
  /** Дополнительные классы для внутренних элементов */
@@ -76,6 +76,7 @@ var Tooltip = function Tooltip(_ref) {
76
76
  isOpened = _ref$isOpened === void 0 ? false : _ref$isOpened,
77
77
  _ref$isPortal = _ref.isPortal,
78
78
  isPortal = _ref$isPortal === void 0 ? false : _ref$isPortal,
79
+ portalSelector = _ref.portalSelector,
79
80
  children = _ref.children,
80
81
  _ref$classes = _ref.classes;
81
82
  _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
@@ -251,12 +252,14 @@ var Tooltip = function Tooltip(_ref) {
251
252
  (0, _react.useEffect)(function () {
252
253
  return function () {
253
254
  if (portalElem.current) {
254
- document.body.removeChild(portalElem.current);
255
+ var parent = portalSelector ? document.querySelector(portalSelector) : document.body;
256
+ parent === null || parent === void 0 ? void 0 : parent.removeChild(portalElem.current);
255
257
  }
256
258
 
257
259
  portalElem.current = null;
258
260
  };
259
- }, []);
261
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
262
+ []);
260
263
 
261
264
  var template = /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
262
265
  className: cn({
@@ -286,7 +289,8 @@ var Tooltip = function Tooltip(_ref) {
286
289
 
287
290
  if (isPortal && !portalElem.current && typeof window !== 'undefined') {
288
291
  portalElem.current = document.createElement('div');
289
- document.body.appendChild(portalElem.current);
292
+ var parent = portalSelector ? document.querySelector(portalSelector) : document.body;
293
+ parent === null || parent === void 0 ? void 0 : parent.appendChild(portalElem.current);
290
294
  }
291
295
 
292
296
  if (isPortal && portalElem.current) {
@@ -325,6 +329,7 @@ Tooltip.propTypes = {
325
329
  }), _propTypes["default"].any])]),
326
330
  isOpened: _propTypes["default"].bool,
327
331
  isPortal: _propTypes["default"].bool,
332
+ portalSelector: _propTypes["default"].string,
328
333
  className: _propTypes["default"].string,
329
334
  classes: _propTypes["default"].shape({
330
335
  root: _propTypes["default"].string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "3.6.0",
3
+ "version": "3.9.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "styles"
@@ -54,7 +54,7 @@
54
54
  "@babel/preset-env": "^7.8.6",
55
55
  "@babel/preset-react": "^7.8.3",
56
56
  "@babel/preset-typescript": "^7.8.3",
57
- "@megafon/ui-icons": "^1.2.1",
57
+ "@megafon/ui-icons": "^1.2.2",
58
58
  "@svgr/core": "^2.4.1",
59
59
  "@testing-library/react-hooks": "^7.0.1",
60
60
  "@types/enzyme": "^3.10.5",
@@ -97,5 +97,5 @@
97
97
  "react-popper": "^2.2.3",
98
98
  "swiper": "^6.5.6"
99
99
  },
100
- "gitHead": "87e4483070e37f017a90358648860a5f4139bae1"
100
+ "gitHead": "d73d4c12fe5847d60e6274f16e7b7b6af4d861fd"
101
101
  }