@megafon/ui-core 4.9.1 → 4.10.1

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 (46) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/es/colors/colorsData.js +3 -0
  3. package/dist/es/components/Accordion/Accordion.d.ts +2 -0
  4. package/dist/es/components/Accordion/Accordion.js +25 -1
  5. package/dist/es/components/Carousel/Carousel.js +1 -1
  6. package/dist/es/components/Checkbox/Checkbox.css +41 -25
  7. package/dist/es/components/Link/Link.d.ts +2 -0
  8. package/dist/es/components/Link/Link.js +3 -0
  9. package/dist/es/components/Notification/Notification.css +42 -38
  10. package/dist/es/components/Notification/Notification.js +2 -12
  11. package/dist/es/components/RadioButton/RadioButton.css +18 -12
  12. package/dist/es/components/Tabs/Tabs.js +12 -3
  13. package/dist/es/components/TextField/TextField.css +0 -9
  14. package/dist/es/components/TextField/TextField.js +18 -27
  15. package/dist/es/components/TextLink/TextLink.d.ts +2 -0
  16. package/dist/es/components/TextLink/TextLink.js +4 -1
  17. package/dist/es/components/Tile/Tile.d.ts +2 -0
  18. package/dist/es/components/Tile/Tile.js +6 -3
  19. package/dist/es/{components/Carousel → hooks}/usePrevious.d.ts +0 -0
  20. package/dist/es/{components/Carousel → hooks}/usePrevious.js +0 -0
  21. package/dist/es/index.d.ts +0 -1
  22. package/dist/es/index.js +1 -2
  23. package/dist/lib/colors/colorsData.js +3 -0
  24. package/dist/lib/components/Accordion/Accordion.d.ts +2 -0
  25. package/dist/lib/components/Accordion/Accordion.js +25 -1
  26. package/dist/lib/components/Carousel/Carousel.js +2 -2
  27. package/dist/lib/components/Checkbox/Checkbox.css +41 -25
  28. package/dist/lib/components/Link/Link.d.ts +2 -0
  29. package/dist/lib/components/Link/Link.js +3 -0
  30. package/dist/lib/components/Notification/Notification.css +42 -38
  31. package/dist/lib/components/Notification/Notification.js +2 -12
  32. package/dist/lib/components/RadioButton/RadioButton.css +18 -12
  33. package/dist/lib/components/Tabs/Tabs.js +14 -3
  34. package/dist/lib/components/TextField/TextField.css +0 -9
  35. package/dist/lib/components/TextField/TextField.js +17 -29
  36. package/dist/lib/components/TextLink/TextLink.d.ts +2 -0
  37. package/dist/lib/components/TextLink/TextLink.js +4 -1
  38. package/dist/lib/components/Tile/Tile.d.ts +2 -0
  39. package/dist/lib/components/Tile/Tile.js +6 -3
  40. package/dist/lib/{components/Carousel → hooks}/usePrevious.d.ts +0 -0
  41. package/dist/lib/{components/Carousel → hooks}/usePrevious.js +0 -0
  42. package/dist/lib/index.d.ts +0 -1
  43. package/dist/lib/index.js +0 -8
  44. package/package.json +4 -4
  45. package/styles/colors.css +1 -0
  46. package/styles/colorsDark.css +1 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,42 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.10.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.10.0...@megafon/ui-core@4.10.1) (2022-12-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **checkbox:** light checked bg-color ([5190a07](https://github.com/MegafonWebLab/megafon-ui/commit/5190a07b532b7b306a5c9de9f3586a3afaa230df))
12
+ * **notification:** fix link color ([7302230](https://github.com/MegafonWebLab/megafon-ui/commit/73022303201d94a814097a59d9facca5576dfa5e))
13
+ * **notification:** fix link font ([96b6134](https://github.com/MegafonWebLab/megafon-ui/commit/96b61340bb7a404affc045ac4081d093016038fa))
14
+ * **radiobutton:** update design ([2072f43](https://github.com/MegafonWebLab/megafon-ui/commit/2072f431efedfbacb679d7b39b378181cb038b83))
15
+ * **textfield:** fix dynamic height of textarea ([730b594](https://github.com/MegafonWebLab/megafon-ui/commit/730b5947358ada3c7d99e4849dc1563d2b752b32))
16
+
17
+
18
+
19
+
20
+
21
+ # [4.10.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.9.1...@megafon/ui-core@4.10.0) (2022-12-12)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * **checkbox:** update styles ([91c2c01](https://github.com/MegafonWebLab/megafon-ui/commit/91c2c01871ca3bae54f4c7204f5953341a7e80cc))
27
+ * **colors:** add overlay color ([168671b](https://github.com/MegafonWebLab/megafon-ui/commit/168671bea17784e9e3f448138e8dab27bfc46a50))
28
+ * **tabs:** change navigation view after change slides count ([67109aa](https://github.com/MegafonWebLab/megafon-ui/commit/67109aafe2c87a8ed7e95f506e892487ad597a8e))
29
+
30
+
31
+ ### Features
32
+
33
+ * **accordion:** add optional microdata attributes ([a67df13](https://github.com/MegafonWebLab/megafon-ui/commit/a67df131fe8a47ac4b8574784135765e4e3659bc))
34
+ * **link:** add itemprop attribute ([1243b6a](https://github.com/MegafonWebLab/megafon-ui/commit/1243b6a2b65dc157dff82d9943ee08f8f148c688))
35
+ * **textlink:** add itemprop attribute ([77a5294](https://github.com/MegafonWebLab/megafon-ui/commit/77a529437cb73cb927381d62f88f48b2b4cc5f0c))
36
+ * **tile:** added rel property ([8b2c8bf](https://github.com/MegafonWebLab/megafon-ui/commit/8b2c8bf8a3ddcba83b085f028460fdc1d14559d3))
37
+
38
+
39
+
40
+
41
+
6
42
  ## [4.9.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.9.0...@megafon/ui-core@4.9.1) (2022-12-06)
7
43
 
8
44
  **Note:** Version bump only for package @megafon/ui-core
@@ -82,6 +82,9 @@ var colors = {
82
82
  }, {
83
83
  name: 'Button Down',
84
84
  code: 'buttonDown'
85
+ }, {
86
+ name: 'Overlay',
87
+ code: 'overlay'
85
88
  }]
86
89
  }
87
90
  },
@@ -7,6 +7,8 @@ export interface IAccordionProps {
7
7
  title: string | React.ReactNode | React.ReactNode[];
8
8
  /** Состояние открытости */
9
9
  isOpened?: boolean;
10
+ /** Включить микроразметку */
11
+ hasMicrodata?: boolean;
10
12
  /** Дополнительный класс для корневого элемента */
11
13
  className?: string;
12
14
  /** Дополнительные классы для корневого и внутренних элементов */
@@ -24,6 +24,8 @@ var Accordion = function Accordion(_ref) {
24
24
  title = _ref.title,
25
25
  _ref$isOpened = _ref.isOpened,
26
26
  isOpened = _ref$isOpened === void 0 ? false : _ref$isOpened,
27
+ _ref$hasMicrodata = _ref.hasMicrodata,
28
+ hasMicrodata = _ref$hasMicrodata === void 0 ? false : _ref$hasMicrodata,
27
29
  className = _ref.className,
28
30
  _ref$classes = _ref.classes;
29
31
  _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
@@ -53,17 +55,38 @@ var Accordion = function Accordion(_ref) {
53
55
 
54
56
  var openedClassName = isOpenedState ? openedClass : undefined;
55
57
  var arrowDataAttrs = isOpenedState ? dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowUp : dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowDown;
58
+
59
+ var renderContent = function renderContent() {
60
+ if (hasMicrodata) {
61
+ return /*#__PURE__*/React.createElement("div", {
62
+ itemScope: true,
63
+ itemProp: "acceptedAnswer",
64
+ itemType: "https://schema.org/Answer"
65
+ }, /*#__PURE__*/React.createElement("div", {
66
+ itemProp: "text"
67
+ }, children));
68
+ }
69
+
70
+ return children;
71
+ };
72
+
56
73
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
57
74
  ref: rootRef,
58
75
  className: cn({
59
76
  opened: isOpenedState
60
77
  }, [className, rootPropsClasses, openedClassName])
78
+ }, hasMicrodata && {
79
+ itemScope: true,
80
+ itemProp: 'mainEntity',
81
+ itemType: 'https://schema.org/Question'
61
82
  }), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.titleWrap), {
62
83
  className: cn('title-wrap', [titleWrapPropsClasses]),
63
84
  onClick: handleClickTitle,
64
85
  onKeyDown: handleClickTitle,
65
86
  tabIndex: 0,
66
87
  role: "button"
88
+ }, hasMicrodata && {
89
+ itemProp: 'name'
67
90
  }), /*#__PURE__*/React.createElement(Header, {
68
91
  as: "h5",
69
92
  dataAttrs: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.header
@@ -76,7 +99,7 @@ var Accordion = function Accordion(_ref) {
76
99
  className: cn('content', collapsePropsClasses),
77
100
  classNameContainer: cn('content-inner'),
78
101
  isOpened: isOpenedState
79
- }, children));
102
+ }, renderContent()));
80
103
  };
81
104
 
82
105
  Accordion.propTypes = {
@@ -85,6 +108,7 @@ Accordion.propTypes = {
85
108
  }), PropTypes.any])]),
86
109
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
87
110
  isOpened: PropTypes.bool,
111
+ hasMicrodata: PropTypes.bool,
88
112
  className: PropTypes.string,
89
113
  classes: PropTypes.shape({
90
114
  openedClass: PropTypes.string,
@@ -17,9 +17,9 @@ import SwiperCore, { Autoplay, Pagination, EffectFade } from 'swiper';
17
17
  import { Swiper, SwiperSlide } from 'swiper/react';
18
18
  import NavArrow, { Theme as ArrowTheme } from "../NavArrow/NavArrow";
19
19
  import throttleTime from "../../constants/throttleTime";
20
+ import usePrevious from "../../hooks/usePrevious";
20
21
  import checkBreakpointsPropTypes from "./checkBreakpointsPropTypes";
21
22
  import "./Carousel.css";
22
- import usePrevious from "./usePrevious";
23
23
  SwiperCore.use([Autoplay, Pagination, EffectFade]);
24
24
  export var NavTheme = {
25
25
  LIGHT: 'light',
@@ -35,7 +35,11 @@
35
35
  width: 20px;
36
36
  height: 20px;
37
37
  border: 2px solid;
38
- border-radius: 2px;
38
+ border-radius: 4px;
39
+ -webkit-transition: border-color, background-color;
40
+ transition: border-color, background-color;
41
+ -webkit-transition-duration: 0.3s;
42
+ transition-duration: 0.3s;
39
43
  }
40
44
  .mfui-checkbox__custom-input:focus {
41
45
  outline: none;
@@ -69,7 +73,7 @@
69
73
  line-height: 24px;
70
74
  }
71
75
  .mfui-checkbox_font-size_regular .mfui-checkbox__inner {
72
- padding: 4px 15px 4px 35px;
76
+ padding: 4px 15px 4px 33px;
73
77
  }
74
78
  .mfui-checkbox_font-size_regular .mfui-checkbox__custom-input {
75
79
  top: 6px;
@@ -79,7 +83,7 @@
79
83
  line-height: 16px;
80
84
  }
81
85
  .mfui-checkbox_font-size_small .mfui-checkbox__inner {
82
- padding: 1px 15px 4px 35px;
86
+ padding: 1px 15px 4px 33px;
83
87
  }
84
88
  .mfui-checkbox_font-size_small .mfui-checkbox__custom-input {
85
89
  top: 0;
@@ -90,45 +94,57 @@
90
94
  .mfui-checkbox_color_dark .mfui-checkbox__label_no-touch:hover .mfui-checkbox__custom-input {
91
95
  border-color: var(--buttonHoverGreen);
92
96
  }
93
- .mfui-checkbox_color_dark .mfui-checkbox__label:active .mfui-checkbox__custom-input {
94
- border-color: var(--buttonDown) !important;
95
- background-color: var(--buttonDown);
96
- }
97
97
  .mfui-checkbox_color_dark .mfui-checkbox__icon {
98
98
  fill: var(--stcWhite);
99
99
  }
100
100
  .mfui-checkbox_color_dark.mfui-checkbox_checked .mfui-checkbox__custom-input {
101
101
  border-color: var(--brandGreen);
102
- color: var(--stcWhite);
103
102
  background-color: var(--brandGreen);
104
103
  }
105
104
  .mfui-checkbox_color_dark.mfui-checkbox_checked .mfui-checkbox__label_no-touch:hover .mfui-checkbox__custom-input {
106
105
  background-color: var(--buttonHoverGreen);
107
106
  }
108
- .mfui-checkbox_color_dark.mfui-checkbox_checked .mfui-checkbox__label:active .mfui-checkbox__custom-input {
109
- background-color: var(--buttonDown) !important;
107
+ .mfui-checkbox_color_light {
108
+ color: var(--stcWhite);
110
109
  }
111
- .mfui-checkbox_color_dark.mfui-checkbox_checked.mfui-checkbox_disabled .mfui-checkbox__custom-input,
112
- .mfui-checkbox_color_dark.mfui-checkbox_checked.mfui-checkbox_disabled .mfui-checkbox__label:active .mfui-checkbox__custom-input {
113
- background-color: var(--spbSky2);
110
+ .mfui-checkbox_color_light .mfui-checkbox__custom-input {
111
+ border-color: var(--stcWhite);
112
+ background-color: var(--stcWhite);
113
+ }
114
+ .mfui-checkbox_color_light .mfui-checkbox__label_no-touch:hover .mfui-checkbox__custom-input {
115
+ border-color: var(--buttonHoverGrey);
116
+ background-color: var(--buttonHoverGrey);
117
+ }
118
+ .mfui-checkbox_color_light.mfui-checkbox_checked .mfui-checkbox__custom-input {
119
+ border-color: var(--brandGreen);
120
+ color: var(--stcWhite);
121
+ background-color: var(--stcWhite);
114
122
  }
115
- .mfui-checkbox_color_dark.mfui-checkbox_disabled .mfui-checkbox__label {
123
+ .mfui-checkbox_disabled .mfui-checkbox__label {
124
+ color: var(--spbSky3);
116
125
  cursor: default;
117
126
  pointer-events: none;
118
127
  }
119
- .mfui-checkbox_color_dark.mfui-checkbox_disabled .mfui-checkbox__custom-input,
120
- .mfui-checkbox_color_dark.mfui-checkbox_disabled .mfui-checkbox__label:active .mfui-checkbox__custom-input {
121
- border-color: var(--spbSky2) !important;
128
+ .mfui-checkbox_disabled .mfui-checkbox__custom-input {
129
+ border-color: var(--spbSky2);
122
130
  background-color: var(--spbSky1);
123
131
  }
124
- .mfui-checkbox_color_dark.mfui-checkbox_error .mfui-checkbox__custom-input {
125
- border-color: var(--fury);
132
+ .mfui-checkbox_disabled .mfui-checkbox__icon {
133
+ fill: var(--stcWhite);
126
134
  }
127
- .mfui-checkbox_color_light {
128
- color: var(--stcWhite);
135
+ .mfui-checkbox_disabled.mfui-checkbox_color_light .mfui-checkbox__label {
136
+ color: var(--stcWhite50);
129
137
  }
130
- .mfui-checkbox_color_light .mfui-checkbox__custom-input {
131
- border-color: var(--stcWhite);
132
- color: var(--brandGreen);
133
- background-color: var(--stcWhite);
138
+ .mfui-checkbox_checked.mfui-checkbox_disabled .mfui-checkbox__custom-input {
139
+ background-color: var(--spbSky2);
140
+ }
141
+ .mfui-checkbox_error .mfui-checkbox__custom-input {
142
+ border-color: var(--fury);
143
+ }
144
+ .mfui-checkbox_color_dark .mfui-checkbox__label:active .mfui-checkbox__custom-input,
145
+ .mfui-checkbox_color_dark.mfui-checkbox_checked .mfui-checkbox__label:active .mfui-checkbox__custom-input,
146
+ .mfui-checkbox_color_light .mfui-checkbox__label:active .mfui-checkbox__custom-input,
147
+ .mfui-checkbox_color_light.mfui-checkbox_checked .mfui-checkbox__label:active .mfui-checkbox__custom-input {
148
+ border-color: var(--buttonDown);
149
+ background-color: var(--buttonDown);
134
150
  }
@@ -14,6 +14,8 @@ export interface ILinkProps {
14
14
  dataAttrs?: {
15
15
  root?: Record<string, string>;
16
16
  };
17
+ /** Атрибут itemprop для микроразметки */
18
+ itemProp?: string;
17
19
  children?: JSX.Element[] | Element[] | JSX.Element | string | Element | React.ReactNode;
18
20
  /** Обработчик клика */
19
21
  onClick?: (e: React.MouseEvent<EventTarget>) => void;
@@ -10,6 +10,7 @@ var Link = function Link(_ref) {
10
10
  onClick = _ref.onClick,
11
11
  className = _ref.className,
12
12
  download = _ref.download,
13
+ itemProp = _ref.itemProp,
13
14
  children = _ref.children,
14
15
  dataAttrs = _ref.dataAttrs;
15
16
  return /*#__PURE__*/React.createElement("a", _extends({
@@ -18,6 +19,7 @@ var Link = function Link(_ref) {
18
19
  target: target,
19
20
  rel: rel,
20
21
  download: download,
22
+ itemProp: itemProp,
21
23
  onClick: onClick
22
24
  }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), children);
23
25
  };
@@ -32,6 +34,7 @@ Link.propTypes = {
32
34
  }),
33
35
  rel: PropTypes.string,
34
36
  download: PropTypes.bool,
37
+ itemProp: PropTypes.string,
35
38
  onClick: PropTypes.func
36
39
  };
37
40
  export default Link;
@@ -151,66 +151,73 @@ h5 {
151
151
  margin-top: 12px;
152
152
  }
153
153
  .mfui-notification__link {
154
- font-size: 15px;
155
- line-height: 24px;
156
- font-weight: 500;
157
154
  display: -webkit-inline-box;
158
155
  display: -ms-inline-flexbox;
159
156
  display: inline-flex;
160
157
  -webkit-box-align: center;
161
158
  -ms-flex-align: center;
162
159
  align-items: center;
160
+ color: var(--brandGreen);
163
161
  cursor: pointer;
164
162
  }
165
- @media screen and (max-width: 767px) {
166
- .mfui-notification__link {
167
- font-size: 12px;
168
- line-height: 18px;
169
- }
170
- }
171
163
  .mfui-notification__button + .mfui-notification__link {
172
164
  margin-left: 16px;
173
165
  }
174
- .mfui-notification__link-arrow,
175
- .mfui-notification__collapse-arrow {
176
- width: 20px;
177
- min-width: 20px;
178
- height: 20px;
179
- fill: var(--systemBlue);
180
- }
181
- .mfui-notification__link-arrow {
182
- margin-bottom: -2px;
166
+ .mfui-notification__link,
167
+ .mfui-notification__collapse-button {
168
+ font-weight: 500;
169
+ font-size: 15px;
170
+ font-family: inherit;
171
+ line-height: 18px;
183
172
  }
184
- @media screen and (min-width: 768px) {
185
- .mfui-notification__link-arrow {
186
- margin-bottom: -4px;
173
+ @media screen and (max-width: 767px) {
174
+ .mfui-notification__link,
175
+ .mfui-notification__collapse-button {
176
+ font-size: 12px;
177
+ line-height: 14px;
187
178
  }
188
179
  }
189
180
  .mfui-notification__collapse-button {
190
- font-size: 15px;
191
- line-height: 24px;
192
- font-weight: 500;
193
181
  display: -webkit-box;
194
182
  display: -ms-flexbox;
195
183
  display: flex;
196
- -webkit-box-align: center;
197
- -ms-flex-align: center;
198
- align-items: center;
184
+ -webkit-box-align: start;
185
+ -ms-flex-align: start;
186
+ align-items: flex-start;
199
187
  height: -webkit-fit-content;
200
188
  height: -moz-fit-content;
201
189
  height: fit-content;
202
190
  padding: 0;
203
191
  border: none;
204
- color: var(--systemBlue);
192
+ color: var(--brandGreen);
205
193
  text-align: right;
206
194
  background-color: transparent;
207
195
  cursor: pointer;
208
196
  }
209
197
  @media screen and (max-width: 767px) {
210
198
  .mfui-notification__collapse-button {
211
- font-size: 12px;
212
- line-height: 18px;
213
- margin-left: 16px;
199
+ -webkit-box-align: center;
200
+ -ms-flex-align: center;
201
+ align-items: center;
202
+ }
203
+ }
204
+ .mfui-notification__link-arrow,
205
+ .mfui-notification__collapse-arrow {
206
+ width: 20px;
207
+ min-width: 20px;
208
+ height: 20px;
209
+ fill: var(--brandGreen);
210
+ }
211
+ .mfui-notification__collapse-arrow_close {
212
+ -webkit-transform: rotate(180deg);
213
+ transform: rotate(180deg);
214
+ }
215
+ .mfui-notification__link-arrow {
216
+ margin-bottom: -2px;
217
+ }
218
+ @media screen and (min-width: 768px) {
219
+ .mfui-notification__link-arrow {
220
+ margin-bottom: -4px;
214
221
  }
215
222
  }
216
223
  .mfui-notification__bottom-block + .mfui-notification__collapse-button {
@@ -313,20 +320,17 @@ h5 {
313
320
  .mfui-notification_colored.mfui-notification_type_success .mfui-notification__text {
314
321
  color: var(--content);
315
322
  }
316
- .mfui-notification_colored.mfui-notification_type_info .mfui-notification__link,
317
- .mfui-notification_colored.mfui-notification_type_warning .mfui-notification__link,
318
- .mfui-notification_colored.mfui-notification_type_success .mfui-notification__link {
319
- color: var(--systemBlue);
320
- }
321
323
  .mfui-notification_colored.mfui-notification_type_error {
322
324
  background-color: var(--fury80);
323
325
  }
324
326
  .mfui-notification_colored.mfui-notification_type_error .mfui-notification__title,
325
327
  .mfui-notification_colored.mfui-notification_type_error .mfui-notification__text,
326
- .mfui-notification_colored.mfui-notification_type_error .mfui-notification__link {
328
+ .mfui-notification_colored.mfui-notification_type_error .mfui-notification__link,
329
+ .mfui-notification_colored.mfui-notification_type_error .mfui-notification__collapse-button {
327
330
  color: var(--stcWhite);
328
331
  }
329
- .mfui-notification_colored.mfui-notification_type_error .mfui-notification__link-arrow {
332
+ .mfui-notification_colored.mfui-notification_type_error .mfui-notification__link-arrow,
333
+ .mfui-notification_colored.mfui-notification_type_error .mfui-notification__collapse-arrow {
330
334
  fill: var(--stcWhite);
331
335
  }
332
336
  .mfui-notification_colored.mfui-notification_type_error .mfui-notification__icon-container {
@@ -31,16 +31,6 @@ var ArrowDown = function ArrowDown(props) {
31
31
  }));
32
32
  };
33
33
 
34
- var ArrowUp = function ArrowUp(props) {
35
- return /*#__PURE__*/React.createElement("svg", _extends({
36
- viewBox: "0 0 20 20"
37
- }, props), /*#__PURE__*/React.createElement("path", {
38
- d: "M14 12H6l4-5z",
39
- fillRule: "evenodd",
40
- clipRule: "evenodd"
41
- }));
42
- };
43
-
44
34
  var RightArrow = function RightArrow(props) {
45
35
  return /*#__PURE__*/React.createElement("svg", _extends({
46
36
  viewBox: "0 0 20 20"
@@ -254,11 +244,11 @@ var Notification = function Notification(_ref) {
254
244
  type: "button",
255
245
  className: cn('collapse-button'),
256
246
  onClick: handleCollapseButtonClick
257
- }), showFullText ? openCollapseTitle : closeCollapseTitle, /*#__PURE__*/React.createElement("div", {
247
+ }), showFullText ? openCollapseTitle : closeCollapseTitle, /*#__PURE__*/React.createElement(ArrowDown, {
258
248
  className: cn('collapse-arrow', {
259
249
  close: showFullText
260
250
  })
261
- }, showFullText ? /*#__PURE__*/React.createElement(ArrowUp, null) : /*#__PURE__*/React.createElement(ArrowDown, null)));
251
+ }));
262
252
  };
263
253
 
264
254
  var renderIcon = function renderIcon() {
@@ -15,9 +15,6 @@
15
15
  outline: none;
16
16
  cursor: pointer;
17
17
  }
18
- .mfui-radio-button__label_disabled {
19
- cursor: default;
20
- }
21
18
  .mfui-radio-button__custom-input {
22
19
  display: -webkit-box;
23
20
  display: -ms-flexbox;
@@ -32,31 +29,40 @@
32
29
  justify-content: center;
33
30
  width: 32px;
34
31
  height: 32px;
35
- margin-right: 8px;
32
+ margin-right: 6px;
36
33
  }
37
34
  .mfui-radio-button__custom-input:before {
38
35
  content: '';
39
36
  display: block;
40
37
  -webkit-box-sizing: border-box;
41
38
  box-sizing: border-box;
42
- width: 20px;
43
- height: 20px;
39
+ width: 22px;
40
+ height: 22px;
44
41
  border: 2px solid var(--spbSky2);
45
42
  border-radius: 50%;
46
43
  background-color: var(--base);
44
+ -webkit-transition: background-color, border-color;
45
+ transition: background-color, border-color;
46
+ -webkit-transition-duration: 0.3s;
47
+ transition-duration: 0.3s;
47
48
  }
48
49
  .mfui-radio-button__input:checked + .mfui-radio-button__custom-input:before {
49
- border: 6px solid var(--brandGreen);
50
+ border: 7px solid var(--brandGreen);
50
51
  }
51
- .mfui-radio-button__label:hover .mfui-radio-button__custom-input:before {
52
+ .mfui-radio-button__label:not(.mfui-radio-button__label_disabled):hover .mfui-radio-button__custom-input:before {
52
53
  border-color: var(--buttonHoverGreen);
53
54
  }
54
- .mfui-radio-button__label:active .mfui-radio-button__custom-input:before {
55
+ .mfui-radio-button__label:not(.mfui-radio-button__label_disabled):active .mfui-radio-button__custom-input:before {
55
56
  border-color: var(--buttonDown);
56
57
  }
57
- .mfui-radio-button__label_disabled .mfui-radio-button__custom-input:before {
58
- border-color: var(--spbSky2) !important;
59
- background-color: var(--spbSky1) !important;
58
+ .mfui-radio-button__label_disabled {
59
+ color: var(--spbSky3);
60
+ cursor: default;
61
+ }
62
+ .mfui-radio-button__label_disabled .mfui-radio-button__custom-input:before,
63
+ .mfui-radio-button__label_disabled .mfui-radio-button__input:checked + .mfui-radio-button__custom-input:before {
64
+ border-color: var(--spbSky2);
65
+ background-color: var(--spbSky1);
60
66
  }
61
67
  .mfui-radio-button__text_size_small {
62
68
  font-size: 12px;
@@ -1,4 +1,5 @@
1
1
  import "core-js/modules/es.array.for-each";
2
+ import "core-js/modules/es.array.is-array";
2
3
  import "core-js/modules/es.array.map";
3
4
  import "core-js/modules/es.array.reduce";
4
5
  import "core-js/modules/es.array.splice";
@@ -12,6 +13,7 @@ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
12
13
  import throttle from 'lodash.throttle';
13
14
  import PropTypes from 'prop-types';
14
15
  import { Swiper, SwiperSlide } from 'swiper/react';
16
+ import usePrevious from "../../hooks/usePrevious";
15
17
  import "./Tabs.css";
16
18
 
17
19
  var ArrowLeft = function ArrowLeft(props) {
@@ -64,6 +66,9 @@ var Tabs = function Tabs(_ref) {
64
66
  var rootRef = React.useRef(null);
65
67
  var tabListRef = React.useRef(null);
66
68
  var intersectionObserverRef = React.useRef();
69
+ var childrenLength = Array.isArray(children) ? children.length : 0;
70
+ var prevChildrenLength = usePrevious(childrenLength) || 0;
71
+ var isChildrenLengthDiff = childrenLength !== prevChildrenLength;
67
72
 
68
73
  var _React$useState = React.useState(),
69
74
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -359,9 +364,13 @@ var Tabs = function Tabs(_ref) {
359
364
  return;
360
365
  }
361
366
 
362
- setBeginning(swiperInstance.isBeginning);
363
- setEnd(swiperInstance.isEnd);
364
- }, [swiperInstance]);
367
+ if (isChildrenLengthDiff) {
368
+ handleFromEdge(swiperInstance);
369
+ return;
370
+ }
371
+
372
+ handleFromEdge(swiperInstance);
373
+ }, [swiperInstance, isChildrenLengthDiff, handleFromEdge]);
365
374
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
366
375
  className: cn({
367
376
  size: size,
@@ -41,15 +41,6 @@
41
41
  overflow-y: auto;
42
42
  resize: none;
43
43
  }
44
- .mfui-text-field__hidden-textarea {
45
- position: absolute;
46
- height: -webkit-min-content;
47
- height: -moz-min-content;
48
- height: min-content;
49
- padding: 0 56px 0 16px;
50
- word-break: break-all;
51
- visibility: hidden;
52
- }
53
44
  .mfui-text-field__field_resized {
54
45
  -webkit-transition: height 0.1s;
55
46
  transition: height 0.1s;
@@ -1,11 +1,8 @@
1
1
  import "core-js/modules/es.array.concat";
2
- import "core-js/modules/es.date.to-string";
3
2
  import "core-js/modules/es.function.name";
4
- import "core-js/modules/es.object.to-string";
5
3
  import "core-js/modules/es.object.values";
6
4
  import "core-js/modules/es.parse-float";
7
5
  import "core-js/modules/es.regexp.exec";
8
- import "core-js/modules/es.regexp.to-string";
9
6
  import "core-js/modules/es.string.replace";
10
7
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
11
8
  import _extends from "@babel/runtime/helpers/extends";
@@ -13,7 +10,7 @@ import _extends from "@babel/runtime/helpers/extends";
13
10
  /* eslint-disable react/no-multi-comp */
14
11
  import * as React from 'react';
15
12
  import { useCallback, useEffect, useState, useRef, useMemo } from 'react';
16
- import { checkEventIsClickOrEnterPress, cnCreate, filterDataAttrs, convert } from '@megafon/ui-helpers';
13
+ import { checkEventIsClickOrEnterPress, cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
17
14
  import throttle from 'lodash.throttle';
18
15
  import * as PropTypes from 'prop-types';
19
16
  import InputMask from 'react-input-mask';
@@ -74,13 +71,6 @@ var DEFAULT_PLACEHOLDERS = {
74
71
  password: 'Пароль',
75
72
  text: 'Текст'
76
73
  };
77
- var converConfig = {
78
- br: {
79
- component: function component() {
80
- return React.createElement('br');
81
- }
82
- }
83
- };
84
74
  export var Verification = {
85
75
  VALID: 'valid',
86
76
  ERROR: 'error'
@@ -180,7 +170,6 @@ var TextField = function TextField(_ref) {
180
170
  setIsTextareaResized = _useState14[1];
181
171
 
182
172
  var fieldNode = useRef();
183
- var hiddenElement = useRef(null);
184
173
  var labelRef = useRef(null);
185
174
  var resizerRef = useRef(null);
186
175
  var isPasswordType = useMemo(function () {
@@ -205,14 +194,25 @@ var TextField = function TextField(_ref) {
205
194
  setIsMaxLimitExceeded(symbolCounter < String(textareaValue).length);
206
195
  }, [symbolCounter]);
207
196
  useEffect(function () {
208
- if (!hiddenElement.current) {
197
+ if (!textarea || !fieldNode.current || isTextareaResized) {
209
198
  return;
210
199
  }
211
200
 
212
- var hiddenElementHeight = hiddenElement.current.scrollHeight;
213
- var isHiddenHeightCorrect = hiddenElementHeight >= minTextareaHeight && hiddenElementHeight <= TEXTAREA_MAX_HEIGHT;
214
- !isTextareaResized && setTextareaHeight(isHiddenHeightCorrect ? hiddenElementHeight : minTextareaHeight);
215
- }, [hiddenElement, isTextareaResized, minTextareaHeight, inputValue]);
201
+ fieldNode.current.style.height = "".concat(minTextareaHeight, "px");
202
+ var scrollHeight = fieldNode.current.scrollHeight;
203
+
204
+ var _window$getComputedSt = window.getComputedStyle(fieldNode.current),
205
+ paddingTop = _window$getComputedSt.paddingTop,
206
+ paddingBottom = _window$getComputedSt.paddingBottom;
207
+
208
+ var innerHeight = scrollHeight - parseFloat(paddingTop) - parseFloat(paddingBottom);
209
+
210
+ if (innerHeight >= TEXTAREA_MAX_HEIGHT) {
211
+ fieldNode.current.style.height = "".concat(TEXTAREA_MAX_HEIGHT, "px");
212
+ } else {
213
+ fieldNode.current.style.height = "".concat(innerHeight, "px");
214
+ }
215
+ }, [isTextareaResized, minTextareaHeight, inputValue, textarea]);
216
216
  useEffect(function () {
217
217
  !isControlled && setInputValue(value);
218
218
  checkSymbolMaxLimit(value);
@@ -406,9 +406,6 @@ var TextField = function TextField(_ref) {
406
406
  };
407
407
 
408
408
  var renderTextarea = function renderTextarea() {
409
- var _a;
410
-
411
- var hiddenValue = inputValue === null || inputValue === void 0 ? void 0 : inputValue.toString().replace(/[\r\n]/g, '<br/>');
412
409
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("textarea", _extends({}, textareaParams, {
413
410
  style: {
414
411
  height: "".concat(textareaHeight, "px")
@@ -416,13 +413,7 @@ var TextField = function TextField(_ref) {
416
413
  ref: getFieldNode,
417
414
  onKeyDown: disableEnterLineBreak ? handleTextareaKeyDown : undefined,
418
415
  onScroll: handleTextareaScroll
419
- })), !!hiddenValue && /*#__PURE__*/React.createElement("div", {
420
- className: cn('hidden-textarea'),
421
- ref: hiddenElement,
422
- style: {
423
- width: (_a = fieldNode.current) === null || _a === void 0 ? void 0 : _a.scrollWidth
424
- }
425
- }, convert(hiddenValue, converConfig), "."), renderLabel());
416
+ })), renderLabel());
426
417
  };
427
418
 
428
419
  var renderIconBlock = function renderIconBlock() {
@@ -8,6 +8,8 @@ export interface ITextLinkProps extends ILinkProps {
8
8
  underlineVisibility?: 'hover' | 'always';
9
9
  /** Стиль подчеркивания */
10
10
  underlineStyle?: 'solid' | 'dashed' | 'border' | 'none';
11
+ /** Атрибут itemprop для микроразметки */
12
+ itemProp?: string;
11
13
  children?: JSX.Element[] | Element[] | JSX.Element | string | Element | React.ReactNode;
12
14
  }
13
15
  declare const TextLink: React.FC<ITextLinkProps>;