@megafon/ui-core 4.7.0 → 4.8.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 (34) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/es/components/Accordion/Accordion.css +1 -0
  3. package/dist/es/components/Button/Button.d.ts +2 -0
  4. package/dist/es/components/Button/Button.js +7 -5
  5. package/dist/es/components/Notification/Notification.d.ts +4 -0
  6. package/dist/es/components/Notification/Notification.js +7 -1
  7. package/dist/es/components/Search/Search.css +27 -9
  8. package/dist/es/components/Search/Search.js +2 -1
  9. package/dist/es/components/Select/Select.css +2 -0
  10. package/dist/es/components/Tabs/Tabs.js +2 -1
  11. package/dist/es/components/TextField/TextField.css +4 -0
  12. package/dist/es/components/Tile/Tile.css +22 -6
  13. package/dist/es/components/Tile/Tile.d.ts +9 -5
  14. package/dist/es/components/Tile/Tile.js +11 -4
  15. package/dist/es/components/Tooltip/Tooltip.css +242 -71
  16. package/dist/es/components/Tooltip/Tooltip.d.ts +38 -0
  17. package/dist/es/components/Tooltip/Tooltip.js +162 -49
  18. package/dist/lib/components/Accordion/Accordion.css +1 -0
  19. package/dist/lib/components/Button/Button.d.ts +2 -0
  20. package/dist/lib/components/Button/Button.js +7 -5
  21. package/dist/lib/components/Notification/Notification.d.ts +4 -0
  22. package/dist/lib/components/Notification/Notification.js +7 -1
  23. package/dist/lib/components/Search/Search.css +27 -9
  24. package/dist/lib/components/Search/Search.js +2 -1
  25. package/dist/lib/components/Select/Select.css +2 -0
  26. package/dist/lib/components/Tabs/Tabs.js +2 -1
  27. package/dist/lib/components/TextField/TextField.css +4 -0
  28. package/dist/lib/components/Tile/Tile.css +22 -6
  29. package/dist/lib/components/Tile/Tile.d.ts +9 -5
  30. package/dist/lib/components/Tile/Tile.js +13 -6
  31. package/dist/lib/components/Tooltip/Tooltip.css +242 -71
  32. package/dist/lib/components/Tooltip/Tooltip.d.ts +38 -0
  33. package/dist/lib/components/Tooltip/Tooltip.js +168 -52
  34. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
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.8.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.8.0...@megafon/ui-core@4.8.1) (2022-11-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **search:** show placeholder without label ([b059216](https://github.com/MegafonWebLab/megafon-ui/commit/b05921619514787698e82d27644702d231829c50))
12
+
13
+
14
+
15
+
16
+
17
+ # [4.8.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.7.0...@megafon/ui-core@4.8.0) (2022-11-14)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **search:** fix scrollbar styles ([c8df5df](https://github.com/MegafonWebLab/megafon-ui/commit/c8df5df9787984a5eb9556b786ab8a6bee75dcb7))
23
+ * **select:** fix scrollbar styles ([15fdd41](https://github.com/MegafonWebLab/megafon-ui/commit/15fdd4170b600b8dad5f6144dadb86ae1d1e7cc0))
24
+ * **tabs:** update resize ([710895f](https://github.com/MegafonWebLab/megafon-ui/commit/710895f4c2f0899fb41ac08e7dde7b1636c24ed9))
25
+ * **textfield:** fix scrollbar styles ([8205a34](https://github.com/MegafonWebLab/megafon-ui/commit/8205a345dfe254a8f46fe4b1023f18761a5a9d29))
26
+
27
+
28
+ ### Features
29
+
30
+ * **tooltip:** add props and update design ([3bb935a](https://github.com/MegafonWebLab/megafon-ui/commit/3bb935ae0b8f302f4dd9a9ef58496e9f19e3cd2f))
31
+
32
+
33
+
34
+
35
+
6
36
  # [4.7.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.6.0...@megafon/ui-core@4.7.0) (2022-11-07)
7
37
 
8
38
 
@@ -14,6 +14,7 @@
14
14
  position: relative;
15
15
  padding: 24px 44px 24px 16px;
16
16
  border-radius: 12px;
17
+ outline: none;
17
18
  cursor: pointer;
18
19
  -webkit-transition: background-color 0.3s;
19
20
  transition: background-color 0.3s;
@@ -37,6 +37,8 @@ export interface IButtonProps {
37
37
  content?: Record<string, string>;
38
38
  inner?: Record<string, string>;
39
39
  loader?: Record<string, string>;
40
+ text?: Record<string, string>;
41
+ arrow?: Record<string, string>;
40
42
  };
41
43
  /** Тема компонента */
42
44
  theme?: ButtonThemesType;
@@ -130,14 +130,14 @@ var Button = function Button(_ref) {
130
130
  }, contentClassName)
131
131
  }), icon && /*#__PURE__*/React.createElement("div", {
132
132
  className: cn('icon')
133
- }, icon), children && /*#__PURE__*/React.createElement("span", {
133
+ }, icon), children && /*#__PURE__*/React.createElement("span", _extends({
134
134
  className: cn('text', {
135
135
  ellipsis: ellipsis
136
136
  })
137
- }, children), !icon && showArrow && /*#__PURE__*/React.createElement(Arrow, {
137
+ }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.text)), children), !icon && showArrow && /*#__PURE__*/React.createElement(Arrow, _extends({
138
138
  className: cn('icon-arrow')
139
- }));
140
- }, [children, icon, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.content, contentClassName, showArrow, ellipsis]);
139
+ }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrow))));
140
+ }, [children, icon, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.content, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.text, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrow, ellipsis, contentClassName, showArrow]);
141
141
  var contentType = React.useMemo(function () {
142
142
  switch (true) {
143
143
  case icon && !children:
@@ -222,7 +222,9 @@ Button.propTypes = {
222
222
  root: PropTypes.objectOf(PropTypes.string.isRequired),
223
223
  content: PropTypes.objectOf(PropTypes.string.isRequired),
224
224
  inner: PropTypes.objectOf(PropTypes.string.isRequired),
225
- loader: PropTypes.objectOf(PropTypes.string.isRequired)
225
+ loader: PropTypes.objectOf(PropTypes.string.isRequired),
226
+ text: PropTypes.objectOf(PropTypes.string.isRequired),
227
+ arrow: PropTypes.objectOf(PropTypes.string.isRequired)
226
228
  }),
227
229
  theme: PropTypes.oneOf(Object.values(ButtonThemes)),
228
230
  type: PropTypes.oneOf(Object.values(ButtonTypes)),
@@ -9,9 +9,13 @@ export declare const NotificationTypes: {
9
9
  declare type NotificationType = typeof NotificationTypes[keyof typeof NotificationTypes];
10
10
  export declare const ShadowTypes: {
11
11
  readonly ZERO: "zero";
12
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
12
13
  readonly LOW: "low";
14
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
13
15
  readonly HIGH: "high";
14
16
  readonly HOVER: "hover";
17
+ readonly PRESSED: "pressed";
18
+ readonly DEFAULT: "default";
15
19
  };
16
20
  declare type ShadowType = typeof ShadowTypes[keyof typeof ShadowTypes];
17
21
  export interface INotificationProps {
@@ -92,9 +92,15 @@ export var NotificationTypes = {
92
92
  };
93
93
  export var ShadowTypes = {
94
94
  ZERO: 'zero',
95
+
96
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
95
97
  LOW: 'low',
98
+
99
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
96
100
  HIGH: 'high',
97
- HOVER: 'hover'
101
+ HOVER: 'hover',
102
+ PRESSED: 'pressed',
103
+ DEFAULT: 'default'
98
104
  };
99
105
  var cn = cnCreate('mfui-notification');
100
106
 
@@ -102,19 +102,19 @@
102
102
  -webkit-transition: opacity 0.2s;
103
103
  transition: opacity 0.2s;
104
104
  }
105
- .mfui-search__search-field:-moz-placeholder {
105
+ .mfui-search__search-field::-moz-placeholder {
106
106
  color: var(--spbSky3);
107
107
  opacity: 0;
108
108
  -webkit-transition: opacity 0.2s;
109
109
  transition: opacity 0.2s;
110
110
  }
111
- .mfui-search__search-field:-ms-input-placeholder {
111
+ .mfui-search__search-field:-moz-placeholder {
112
112
  color: var(--spbSky3);
113
113
  opacity: 0;
114
114
  -webkit-transition: opacity 0.2s;
115
115
  transition: opacity 0.2s;
116
116
  }
117
- .mfui-search__search-field::-moz-placeholder {
117
+ .mfui-search__search-field:-ms-input-placeholder {
118
118
  color: var(--spbSky3);
119
119
  opacity: 0;
120
120
  -webkit-transition: opacity 0.2s;
@@ -132,22 +132,40 @@
132
132
  -webkit-transition: opacity 0.2s;
133
133
  transition: opacity 0.2s;
134
134
  }
135
- .mfui-search__search-wrapper_labeled .mfui-search__search-field:focus::-webkit-input-placeholder {
135
+ .mfui-search__search-field:focus::-webkit-input-placeholder {
136
+ opacity: 1;
137
+ }
138
+ .mfui-search__search-field:focus::-moz-placeholder {
139
+ opacity: 1;
140
+ }
141
+ .mfui-search__search-field:focus:-moz-placeholder {
142
+ opacity: 1;
143
+ }
144
+ .mfui-search__search-field:focus:-ms-input-placeholder {
145
+ opacity: 1;
146
+ }
147
+ .mfui-search__search-field:focus::-ms-input-placeholder {
148
+ opacity: 1;
149
+ }
150
+ .mfui-search__search-field:focus::placeholder {
151
+ opacity: 1;
152
+ }
153
+ .mfui-search__search-wrapper_no-label .mfui-search__search-field::-webkit-input-placeholder {
136
154
  opacity: 1;
137
155
  }
138
- .mfui-search__search-wrapper_labeled .mfui-search__search-field:focus:-moz-placeholder {
156
+ .mfui-search__search-wrapper_no-label .mfui-search__search-field::-moz-placeholder {
139
157
  opacity: 1;
140
158
  }
141
- .mfui-search__search-wrapper_labeled .mfui-search__search-field:focus:-ms-input-placeholder {
159
+ .mfui-search__search-wrapper_no-label .mfui-search__search-field:-moz-placeholder {
142
160
  opacity: 1;
143
161
  }
144
- .mfui-search__search-wrapper_labeled .mfui-search__search-field:focus::-moz-placeholder {
162
+ .mfui-search__search-wrapper_no-label .mfui-search__search-field:-ms-input-placeholder {
145
163
  opacity: 1;
146
164
  }
147
- .mfui-search__search-wrapper_labeled .mfui-search__search-field:focus::-ms-input-placeholder {
165
+ .mfui-search__search-wrapper_no-label .mfui-search__search-field::-ms-input-placeholder {
148
166
  opacity: 1;
149
167
  }
150
- .mfui-search__search-wrapper_labeled .mfui-search__search-field:focus::placeholder {
168
+ .mfui-search__search-wrapper_no-label .mfui-search__search-field::placeholder {
151
169
  opacity: 1;
152
170
  }
153
171
  .mfui-search__search-field_filled + .mfui-search__label,
@@ -192,7 +192,8 @@ var Search = function Search(_ref) {
192
192
  }, [classes === null || classes === void 0 ? void 0 : classes.control])
193
193
  }, /*#__PURE__*/React.createElement("label", {
194
194
  className: cn('search-wrapper', {
195
- labeled: !!label
195
+ labeled: !!label,
196
+ 'no-label': !label
196
197
  }),
197
198
  htmlFor: searchId
198
199
  }, /*#__PURE__*/React.createElement("input", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.searchField), {
@@ -177,6 +177,8 @@
177
177
  max-height: 368px;
178
178
  padding: 16px;
179
179
  overflow-y: auto;
180
+ scrollbar-width: thin;
181
+ scrollbar-color: var(--spbSky2) transparent;
180
182
  }
181
183
  .mfui-select__list-inner_short {
182
184
  max-height: 235px;
@@ -396,7 +396,8 @@ var Tabs = function Tabs(_ref) {
396
396
  onSwiper: handleSwiper,
397
397
  onReachBeginning: handleReachBeginning,
398
398
  onReachEnd: handleReachEnd,
399
- onFromEdge: handleFromEdge
399
+ onFromEdge: handleFromEdge,
400
+ observer: true
400
401
  }), renderTabs(), /*#__PURE__*/React.createElement("div", {
401
402
  className: cn('underline'),
402
403
  slot: "wrapper-start",
@@ -161,6 +161,10 @@
161
161
  font-size: 15px;
162
162
  line-height: 24px;
163
163
  }
164
+ .mfui-text-field__field_textarea {
165
+ scrollbar-width: thin;
166
+ scrollbar-color: var(--spbSky2) transparent;
167
+ }
164
168
  .mfui-text-field__field_textarea ~ .mfui-text-field__label {
165
169
  top: 16px;
166
170
  }
@@ -3,7 +3,7 @@
3
3
  background-color: var(--base);
4
4
  }
5
5
  .mfui-tile_radius_rounded {
6
- border-radius: 8px;
6
+ border-radius: 12px;
7
7
  }
8
8
  .mfui-tile_pointer {
9
9
  cursor: pointer;
@@ -16,11 +16,6 @@
16
16
  -webkit-box-shadow: 0 2px 9px rgba(0, 0, 0, 0.15);
17
17
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.15);
18
18
  }
19
- .mfui-tile_theme_light.mfui-tile_shadow_hover,
20
- .mfui-tile_theme_light.mfui-tile_interactive:hover {
21
- -webkit-box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
22
- box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
23
- }
24
19
  .mfui-tile_theme_dark.mfui-tile_shadow_low {
25
20
  -webkit-box-shadow: 0 0.25px 3px rgba(0, 0, 0, 0.45);
26
21
  box-shadow: 0 0.25px 3px rgba(0, 0, 0, 0.45);
@@ -29,6 +24,27 @@
29
24
  -webkit-box-shadow: 0 2px 9px rgba(0, 0, 0, 0.25);
30
25
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.25);
31
26
  }
27
+ .mfui-tile_theme_light.mfui-tile_shadow_default {
28
+ -webkit-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
29
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
30
+ }
31
+ .mfui-tile_theme_light.mfui-tile_shadow_pressed {
32
+ -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
33
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
34
+ }
35
+ .mfui-tile_theme_light.mfui-tile_shadow_hover,
36
+ .mfui-tile_theme_light.mfui-tile_interactive:hover {
37
+ -webkit-box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
38
+ box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
39
+ }
40
+ .mfui-tile_theme_dark.mfui-tile_shadow_default {
41
+ -webkit-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
42
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
43
+ }
44
+ .mfui-tile_theme_dark.mfui-tile_shadow_pressed {
45
+ -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
46
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
47
+ }
32
48
  .mfui-tile_theme_dark.mfui-tile_shadow_hover,
33
49
  .mfui-tile_theme_dark.mfui-tile_interactive:hover {
34
50
  -webkit-box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
@@ -10,13 +10,17 @@ export declare const Radius: {
10
10
  readonly ROUNDED: "rounded";
11
11
  };
12
12
  declare type RadiusType = typeof Radius[keyof typeof Radius];
13
- export declare const Shadow: {
13
+ export declare const ShadowLevel: {
14
14
  readonly ZERO: "zero";
15
- readonly LOW: "low";
16
- readonly HIGH: "high";
15
+ readonly DEFAULT: "default";
17
16
  readonly HOVER: "hover";
17
+ readonly PRESSED: "pressed";
18
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
19
+ readonly HIGH: "high";
20
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
21
+ readonly LOW: "low";
18
22
  };
19
- declare type ShadowType = typeof Shadow[keyof typeof Shadow];
23
+ declare type ShadowLevelType = typeof ShadowLevel[keyof typeof ShadowLevel];
20
24
  export interface ITileProps {
21
25
  /** Ссылка */
22
26
  href?: string;
@@ -27,7 +31,7 @@ export interface ITileProps {
27
31
  /** Радиус границы */
28
32
  radius?: RadiusType;
29
33
  /** Уровень тени */
30
- shadowLevel?: ShadowType;
34
+ shadowLevel?: ShadowLevelType;
31
35
  /** Включить тень при наведении */
32
36
  isInteractive?: boolean;
33
37
  /** Дополнительный класс корневого элемента */
@@ -12,11 +12,17 @@ export var Radius = {
12
12
  DEFAULT: 'default',
13
13
  ROUNDED: 'rounded'
14
14
  };
15
- export var Shadow = {
15
+ export var ShadowLevel = {
16
16
  ZERO: 'zero',
17
- LOW: 'low',
17
+ DEFAULT: 'default',
18
+ HOVER: 'hover',
19
+ PRESSED: 'pressed',
20
+
21
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
18
22
  HIGH: 'high',
19
- HOVER: 'hover'
23
+
24
+ /** @deprecated TODO: нужно удалить значение при выпуске мажорной версии */
25
+ LOW: 'low'
20
26
  };
21
27
  var cn = cnCreate('mfui-tile');
22
28
 
@@ -44,6 +50,7 @@ var Tile = function Tile(_ref) {
44
50
  var isPointer = !!href || isInteractive;
45
51
  return /*#__PURE__*/React.createElement("div", _extends({
46
52
  className: cn({
53
+ // TODO: переименовать в shadowColor
47
54
  theme: theme,
48
55
  radius: radius,
49
56
  shadow: shadowLevel,
@@ -62,7 +69,7 @@ Tile.propTypes = {
62
69
  href: PropTypes.string,
63
70
  theme: PropTypes.oneOf(Object.values(Theme)),
64
71
  radius: PropTypes.oneOf(Object.values(Radius)),
65
- shadowLevel: PropTypes.oneOf(Object.values(Shadow)),
72
+ shadowLevel: PropTypes.oneOf(Object.values(ShadowLevel)),
66
73
  className: PropTypes.string,
67
74
  isInteractive: PropTypes.bool,
68
75
  onClick: PropTypes.func,