@megafon/ui-core 3.12.0 → 4.0.0-beta.10

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 (80) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/dist/es/colors/Colors.css +4 -0
  3. package/dist/es/components/Accordion/Accordion.css +59 -22
  4. package/dist/es/components/Accordion/Accordion.js +12 -17
  5. package/dist/es/components/Badges/components/PriceBadge/PriceBadge.css +1 -1
  6. package/dist/es/components/Badges/components/PromoBadge/PromoBadge.css +1 -1
  7. package/dist/es/components/Badges/components/TimerBadge/TimerBadge.css +1 -1
  8. package/dist/es/components/Button/Button.css +5 -5
  9. package/dist/es/components/Calendar/components/Day/Day.css +1 -1
  10. package/dist/es/components/Calendar/components/Month/Month.css +1 -1
  11. package/dist/es/components/Caption/Caption.css +48 -0
  12. package/dist/es/components/Caption/Caption.d.ts +31 -0
  13. package/dist/es/components/Caption/Caption.js +51 -0
  14. package/dist/es/components/Header/Header.css +3 -0
  15. package/dist/es/components/Header/Header.d.ts +2 -0
  16. package/dist/es/components/Header/Header.js +7 -1
  17. package/dist/es/components/Notification/Notification.css +9 -5
  18. package/dist/es/components/Notification/Notification.js +2 -7
  19. package/dist/es/components/Paragraph/Paragraph.css +8 -5
  20. package/dist/es/components/Paragraph/Paragraph.d.ts +4 -3
  21. package/dist/es/components/Paragraph/Paragraph.js +6 -5
  22. package/dist/es/components/RadioButton/RadioButton.css +1 -1
  23. package/dist/es/components/Search/Search.css +129 -9
  24. package/dist/es/components/Search/Search.d.ts +2 -0
  25. package/dist/es/components/Search/Search.js +20 -7
  26. package/dist/es/components/Select/Select.css +165 -30
  27. package/dist/es/components/Select/Select.js +25 -18
  28. package/dist/es/components/Switcher/Switcher.css +1 -1
  29. package/dist/es/components/Tabs/Tabs.css +140 -143
  30. package/dist/es/components/Tabs/Tabs.d.ts +9 -8
  31. package/dist/es/components/Tabs/Tabs.js +14 -18
  32. package/dist/es/components/TextField/TextField.css +221 -92
  33. package/dist/es/components/TextField/TextField.js +161 -71
  34. package/dist/es/constants/throttleTime.d.ts +1 -0
  35. package/dist/es/constants/throttleTime.js +2 -1
  36. package/dist/es/index.d.ts +1 -1
  37. package/dist/es/index.js +1 -1
  38. package/dist/lib/colors/Colors.css +4 -0
  39. package/dist/lib/components/Accordion/Accordion.css +59 -22
  40. package/dist/lib/components/Accordion/Accordion.js +12 -17
  41. package/dist/lib/components/Badges/components/PriceBadge/PriceBadge.css +1 -1
  42. package/dist/lib/components/Badges/components/PromoBadge/PromoBadge.css +1 -1
  43. package/dist/lib/components/Badges/components/TimerBadge/TimerBadge.css +1 -1
  44. package/dist/lib/components/Button/Button.css +5 -5
  45. package/dist/lib/components/Calendar/components/Day/Day.css +1 -1
  46. package/dist/lib/components/Calendar/components/Month/Month.css +1 -1
  47. package/dist/lib/components/Caption/Caption.css +48 -0
  48. package/dist/lib/components/Caption/Caption.d.ts +31 -0
  49. package/dist/lib/components/{InputLabel/InputLabel.js → Caption/Caption.js} +38 -10
  50. package/dist/lib/components/Header/Header.css +3 -0
  51. package/dist/lib/components/Header/Header.d.ts +2 -0
  52. package/dist/lib/components/Header/Header.js +7 -1
  53. package/dist/lib/components/Notification/Notification.css +9 -5
  54. package/dist/lib/components/Notification/Notification.js +2 -8
  55. package/dist/lib/components/Paragraph/Paragraph.css +8 -5
  56. package/dist/lib/components/Paragraph/Paragraph.d.ts +4 -3
  57. package/dist/lib/components/Paragraph/Paragraph.js +6 -5
  58. package/dist/lib/components/RadioButton/RadioButton.css +1 -1
  59. package/dist/lib/components/Search/Search.css +129 -9
  60. package/dist/lib/components/Search/Search.d.ts +2 -0
  61. package/dist/lib/components/Search/Search.js +20 -8
  62. package/dist/lib/components/Select/Select.css +165 -30
  63. package/dist/lib/components/Select/Select.js +25 -19
  64. package/dist/lib/components/Switcher/Switcher.css +1 -1
  65. package/dist/lib/components/Tabs/Tabs.css +140 -143
  66. package/dist/lib/components/Tabs/Tabs.d.ts +9 -8
  67. package/dist/lib/components/Tabs/Tabs.js +16 -20
  68. package/dist/lib/components/TextField/TextField.css +221 -92
  69. package/dist/lib/components/TextField/TextField.js +164 -71
  70. package/dist/lib/constants/throttleTime.d.ts +1 -0
  71. package/dist/lib/constants/throttleTime.js +2 -1
  72. package/dist/lib/index.d.ts +1 -1
  73. package/dist/lib/index.js +8 -8
  74. package/package.json +3 -3
  75. package/styles/base.less +4 -1
  76. package/dist/es/components/InputLabel/InputLabel.css +0 -5
  77. package/dist/es/components/InputLabel/InputLabel.d.ts +0 -10
  78. package/dist/es/components/InputLabel/InputLabel.js +0 -24
  79. package/dist/lib/components/InputLabel/InputLabel.css +0 -5
  80. package/dist/lib/components/InputLabel/InputLabel.d.ts +0 -10
package/CHANGELOG.md CHANGED
@@ -3,6 +3,112 @@
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.0.0-beta.10](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.9...@megafon/ui-core@4.0.0-beta.10) (2022-07-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **accordion:** update mobile styles ([910b1c8](https://github.com/MegafonWebLab/megafon-ui/commit/910b1c8f987f1043e362b089a3ff4cfe9638070d))
12
+
13
+
14
+
15
+
16
+
17
+ # [4.0.0-beta.9](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.8...@megafon/ui-core@4.0.0-beta.9) (2022-07-15)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **select:** update styles ([b863c8c](https://github.com/MegafonWebLab/megafon-ui/commit/b863c8c94af251d6b3c9ee39124486d7d5db9a58))
23
+
24
+
25
+
26
+
27
+
28
+ # [4.0.0-beta.8](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.7...@megafon/ui-core@4.0.0-beta.8) (2022-07-14)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **accordion:** change focus and dark theme styles ([d3e07ea](https://github.com/MegafonWebLab/megafon-ui/commit/d3e07ea6fee0c131e25db1bb558d8b205d201e0c))
34
+ * **notification:** change title typography ([f91a60e](https://github.com/MegafonWebLab/megafon-ui/commit/f91a60ee1562626494358ef529321f072ba70890))
35
+ * **tabs:** change dark theme and indents styles ([272dfcb](https://github.com/MegafonWebLab/megafon-ui/commit/272dfcbeef750f2f7ae097b46f7d98405cf53a88))
36
+
37
+
38
+ ### Features
39
+
40
+ * **header:** add new prop space ([e5bef7c](https://github.com/MegafonWebLab/megafon-ui/commit/e5bef7c8e13c57e477a4c25f07a4a4a6dbb8b6bd))
41
+
42
+
43
+
44
+
45
+
46
+ # [4.0.0-beta.7](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.6...@megafon/ui-core@4.0.0-beta.7) (2022-07-13)
47
+
48
+
49
+ ### Bug Fixes
50
+
51
+ * **select:** fix styles ([3e79c68](https://github.com/MegafonWebLab/megafon-ui/commit/3e79c68fecde72e515b7ef52d38d9188e51680f6))
52
+
53
+
54
+
55
+
56
+
57
+ # [4.0.0-beta.6](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.0.0-beta.5...@megafon/ui-core@4.0.0-beta.6) (2022-07-05)
58
+
59
+
60
+ ### Features
61
+
62
+ * **inputlabel:** component removed ([1f236ac](https://github.com/MegafonWebLab/megafon-ui/commit/1f236ace90acfd7ea1917422677fa24c1c5abdf4))
63
+ * **search:** component redesign ([d6f11eb](https://github.com/MegafonWebLab/megafon-ui/commit/d6f11eb7ee810b835879c7a31e5e01c426060ea1))
64
+ * **select:** component redesign ([aeeda00](https://github.com/MegafonWebLab/megafon-ui/commit/aeeda00dfc1db70421a495a686954e19eecf815d))
65
+
66
+
67
+ ### BREAKING CHANGES
68
+
69
+ * **inputlabel:** inputLabel component removed due to non-use
70
+
71
+
72
+
73
+
74
+
75
+ # [4.0.0-beta.5](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.12.0...@megafon/ui-core@4.0.0-beta.5) (2022-06-29)
76
+
77
+
78
+ ### Bug Fixes
79
+
80
+ * **textfield:** fix textarea design bugs ([287d426](https://github.com/MegafonWebLab/megafon-ui/commit/287d42644b24ca0e1a3824d5907d8af78293d0e3))
81
+ * **textfield:** update textarea scroll and resize ([9dbce52](https://github.com/MegafonWebLab/megafon-ui/commit/9dbce52d6bc3a71076ffdf2365715204231da774))
82
+
83
+
84
+ ### Features
85
+
86
+ * **accordion:** update by new design ([92dab3a](https://github.com/MegafonWebLab/megafon-ui/commit/92dab3a367544d8507526e7a57a0a9a4015e3acf))
87
+ * **caption:** add new Caption component; update .smallFont() less mixin ([b02a3f7](https://github.com/MegafonWebLab/megafon-ui/commit/b02a3f73ed8d5390d8427ab0a6bc62210710ba40))
88
+ * **paragraph:** remove prop size; add new prop; add 'pale' option to colors ([ffb6bc7](https://github.com/MegafonWebLab/megafon-ui/commit/ffb6bc709a4ef91536e359d5f9edc5501caf0c2c))
89
+ * **tabs:** update by new design ([20ae2cc](https://github.com/MegafonWebLab/megafon-ui/commit/20ae2cc695e1245b9cd06fe37a9e4e3bb0c7eaae))
90
+ * **textfield:** update by new design ([24ec769](https://github.com/MegafonWebLab/megafon-ui/commit/24ec769aeddac9a198941727aaca02ad0fb816f1))
91
+
92
+
93
+ ### BREAKING CHANGES
94
+
95
+ * **textfield:** add defaultTransitionTiming in less global variables
96
+ * **tabs:** new prop autoWidth added
97
+ size prop small vallue removed
98
+ new sizes
99
+ * **textfield:** add placeholders text by default
100
+ label element positon changed
101
+ if label prop not setted, label element has text from placeholder (default or in props)
102
+ * **accordion:** change next-sibling accordion styles
103
+ * **caption:** .smallFont() less mixin line-height rule now set to 18px instead of 16px
104
+ either accept new rules or manually add line-height: 16px in your components
105
+ * **paragraph:** prop 'size' is no longer exists.
106
+ use component Caption instead of Paragraph size="small"
107
+
108
+
109
+
110
+
111
+
6
112
  # [3.12.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.11.0...@megafon/ui-core@3.12.0) (2022-06-28)
7
113
 
8
114
 
@@ -2,6 +2,8 @@
2
2
  margin: 0 -80px;
3
3
  padding: 56px 80px 40px;
4
4
  background-color: var(--spbSky0);
5
+ -webkit-transition: background-color 0.3s;
6
+ transition: background-color 0.3s;
5
7
  }
6
8
  @media screen and (max-width: 1120px) {
7
9
  .colors__inner {
@@ -90,6 +92,8 @@
90
92
  font-size: 12px;
91
93
  line-height: 18px;
92
94
  text-align: center;
95
+ -webkit-transition: color 0.3s;
96
+ transition: color 0.3s;
93
97
  }
94
98
  @media screen and (max-width: 1023px) {
95
99
  .colors__description {
@@ -1,51 +1,88 @@
1
1
  .mfui-accordion {
2
- border-top: 1px solid var(--spbSky2);
3
- border-bottom: 1px solid var(--spbSky2);
2
+ border-radius: 12px;
3
+ background: var(--spbSky0);
4
4
  }
5
5
  .mfui-accordion + .mfui-accordion {
6
- border-top: none;
7
- }
8
- .mfui-accordion:not(.mfui-accordion_open) .mfui-accordion__title-wrap:hover {
9
- background: var(--spbSky0);
6
+ margin-top: 8px;
10
7
  }
11
- .mfui-accordion.mfui-accordion_open .mfui-accordion__title-wrap {
12
- background: var(--spbSky1);
8
+ @media screen and (min-width: 768px) {
9
+ .mfui-accordion + .mfui-accordion {
10
+ margin-top: 12px;
11
+ }
13
12
  }
14
13
  .mfui-accordion__title-wrap {
15
14
  position: relative;
16
- padding: 24px 52px 24px 16px;
15
+ padding: 20px 44px 20px 16px;
16
+ border-radius: 12px;
17
17
  cursor: pointer;
18
+ -webkit-transition: background-color 0.3s;
19
+ transition: background-color 0.3s;
18
20
  }
19
21
  @media screen and (min-width: 768px) {
20
22
  .mfui-accordion__title-wrap {
21
- padding: 24px 68px 24px 24px;
23
+ padding: 20px 56px 20px 24px;
22
24
  }
23
25
  }
24
- @media screen and (min-width: 1280px) {
25
- .mfui-accordion__title-wrap {
26
- padding: 24px 72px 24px 24px;
26
+ .mfui-accordion__title-wrap:hover {
27
+ background-color: var(--spbSky1);
28
+ }
29
+ @media screen and (max-width: 1023px) {
30
+ .mfui-accordion__title-wrap:focus {
31
+ background-color: inherit;
27
32
  }
28
33
  }
29
34
  .mfui-accordion__icon-box {
30
35
  position: absolute;
31
36
  top: 50%;
32
37
  right: 20px;
33
- width: 32px;
34
- height: 32px;
35
- outline: none;
38
+ display: -webkit-box;
39
+ display: -ms-flexbox;
40
+ display: flex;
41
+ -webkit-box-align: center;
42
+ -ms-flex-align: center;
43
+ align-items: center;
44
+ -webkit-box-pack: center;
45
+ -ms-flex-pack: center;
46
+ justify-content: center;
47
+ width: 24px;
48
+ height: 24px;
49
+ border-radius: 50%;
50
+ background-color: var(--stcWhite);
51
+ -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
52
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
36
53
  -webkit-transform: translateY(-50%);
37
54
  transform: translateY(-50%);
38
- opacity: 1;
39
- fill: var(--content);
55
+ }
56
+ @media screen and (min-width: 768px) {
57
+ .mfui-accordion__icon-box {
58
+ right: 24px;
59
+ width: 32px;
60
+ height: 32px;
61
+ }
62
+ }
63
+ .mfui-accordion__icon {
64
+ width: 20px;
65
+ height: 20px;
66
+ -webkit-transition: -webkit-transform 0.6s;
67
+ transition: -webkit-transform 0.6s;
68
+ transition: transform 0.6s;
69
+ transition: transform 0.6s, -webkit-transform 0.6s;
70
+ }
71
+ @media screen and (min-width: 768px) {
72
+ .mfui-accordion__icon {
73
+ width: 32px;
74
+ height: 32px;
75
+ }
40
76
  }
41
77
  .mfui-accordion__content-inner {
42
- padding: 24px 16px;
78
+ padding: 4px 20px 20px 16px;
43
79
  }
44
80
  @media screen and (min-width: 768px) {
45
81
  .mfui-accordion__content-inner {
46
- padding: 24px;
82
+ padding: 4px 24px 20px;
47
83
  }
48
84
  }
49
- .mfui-accordion__icon {
50
- fill: var(--content);
85
+ .mfui-accordion_opened .mfui-accordion__icon {
86
+ -webkit-transform: rotate(180deg);
87
+ transform: rotate(180deg);
51
88
  }
@@ -11,15 +11,9 @@ var ArrowDown = function ArrowDown(props) {
11
11
  return /*#__PURE__*/React.createElement("svg", _extends({
12
12
  viewBox: "0 0 32 32"
13
13
  }, props), /*#__PURE__*/React.createElement("path", {
14
- d: "M11.2 12l4.8 4.8 4.8-4.8 1.7 1.6L16 20l-6.5-6.4z"
15
- }));
16
- };
17
-
18
- var ArrowUp = function ArrowUp(props) {
19
- return /*#__PURE__*/React.createElement("svg", _extends({
20
- viewBox: "0 0 32 32"
21
- }, props), /*#__PURE__*/React.createElement("path", {
22
- d: "M20.8 20L16 15.2 11.2 20l-1.7-1.6L16 12l6.5 6.4z"
14
+ d: "M11 14h10l-5 6z",
15
+ fillRule: "evenodd",
16
+ clipRule: "evenodd"
23
17
  }));
24
18
  };
25
19
 
@@ -58,24 +52,25 @@ var Accordion = function Accordion(_ref) {
58
52
  };
59
53
 
60
54
  var openedClassName = isOpenedState ? openedClass : undefined;
55
+ var arrowDataAttrs = isOpenedState ? dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowUp : dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowDown;
61
56
  return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
62
57
  ref: rootRef,
63
58
  className: cn({
64
- open: isOpenedState
59
+ opened: isOpenedState
65
60
  }, [className, rootPropsClasses, openedClassName])
66
61
  }), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.titleWrap), {
67
62
  className: cn('title-wrap', [titleWrapPropsClasses]),
68
63
  onClick: handleClickTitle,
69
- onKeyDown: handleClickTitle
64
+ onKeyDown: handleClickTitle,
65
+ tabIndex: 0,
66
+ role: "button"
70
67
  }), /*#__PURE__*/React.createElement(Header, _extends({
71
68
  as: "h5"
72
69
  }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.header)), title), /*#__PURE__*/React.createElement("div", {
73
- tabIndex: 0,
74
- role: "button",
75
- className: cn('icon-box', {
76
- open: isOpenedState
77
- })
78
- }, isOpenedState ? /*#__PURE__*/React.createElement(ArrowUp, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowUp)) : /*#__PURE__*/React.createElement(ArrowDown, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowDown)))), /*#__PURE__*/React.createElement(Collapse, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.collapse), {
70
+ className: cn('icon-box')
71
+ }, /*#__PURE__*/React.createElement(ArrowDown, _extends({
72
+ className: cn('icon')
73
+ }, filterDataAttrs(arrowDataAttrs))))), /*#__PURE__*/React.createElement(Collapse, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.collapse), {
79
74
  className: cn('content', collapsePropsClasses),
80
75
  classNameContainer: cn('content-inner'),
81
76
  isOpened: isOpenedState
@@ -1,6 +1,6 @@
1
1
  .mfui-price-badge {
2
2
  font-size: 12px;
3
- line-height: 16px;
3
+ line-height: 18px;
4
4
  display: -webkit-box;
5
5
  display: -ms-flexbox;
6
6
  display: flex;
@@ -30,6 +30,6 @@
30
30
  .mfui-promo-badge__text {
31
31
  font-family: inherit;
32
32
  font-size: 12px;
33
- line-height: 16px;
33
+ line-height: 18px;
34
34
  font-weight: 500;
35
35
  }
@@ -32,7 +32,7 @@
32
32
  }
33
33
  .mfui-timer-badge__text {
34
34
  font-size: 12px;
35
- line-height: 16px;
35
+ line-height: 18px;
36
36
  font-family: inherit;
37
37
  margin-left: 2px;
38
38
  font-weight: 500;
@@ -27,7 +27,7 @@
27
27
  }
28
28
  .mfui-button_size-all_extra-small .mfui-button__inner {
29
29
  font-size: 12px;
30
- line-height: 16px;
30
+ line-height: 18px;
31
31
  min-width: 26px;
32
32
  height: 26px;
33
33
  }
@@ -65,7 +65,7 @@
65
65
  }
66
66
  .mfui-button_size-wide_extra-small .mfui-button__inner {
67
67
  font-size: 12px;
68
- line-height: 16px;
68
+ line-height: 18px;
69
69
  min-width: 26px;
70
70
  height: 26px;
71
71
  }
@@ -104,7 +104,7 @@
104
104
  }
105
105
  .mfui-button_size-desktop_extra-small .mfui-button__inner {
106
106
  font-size: 12px;
107
- line-height: 16px;
107
+ line-height: 18px;
108
108
  min-width: 26px;
109
109
  height: 26px;
110
110
  }
@@ -143,7 +143,7 @@
143
143
  }
144
144
  .mfui-button_size-tablet_extra-small .mfui-button__inner {
145
145
  font-size: 12px;
146
- line-height: 16px;
146
+ line-height: 18px;
147
147
  min-width: 26px;
148
148
  height: 26px;
149
149
  }
@@ -182,7 +182,7 @@
182
182
  }
183
183
  .mfui-button_size-mobile_extra-small .mfui-button__inner {
184
184
  font-size: 12px;
185
- line-height: 16px;
185
+ line-height: 18px;
186
186
  min-width: 26px;
187
187
  height: 26px;
188
188
  }
@@ -21,7 +21,7 @@
21
21
  user-select: none;
22
22
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
23
23
  font-size: 12px;
24
- line-height: 16px;
24
+ line-height: 18px;
25
25
  }
26
26
  .mfui-day:last-child {
27
27
  padding-right: 0;
@@ -56,7 +56,7 @@
56
56
  }
57
57
  .mfui-month__weekday {
58
58
  font-size: 12px;
59
- line-height: 16px;
59
+ line-height: 18px;
60
60
  width: 20px;
61
61
  height: 16px;
62
62
  color: var(--content);
@@ -0,0 +1,48 @@
1
+ .mfui-caption {
2
+ font-family: inherit;
3
+ font-size: 12px;
4
+ line-height: 18px;
5
+ margin: 0;
6
+ }
7
+ .mfui-caption_variant_normal {
8
+ font-weight: 400;
9
+ }
10
+ .mfui-caption_variant_medium {
11
+ font-weight: 600;
12
+ }
13
+ .mfui-caption_space_wide {
14
+ line-height: 18px;
15
+ }
16
+ .mfui-caption_space_tight {
17
+ line-height: 14px;
18
+ }
19
+ .mfui-caption_align_left {
20
+ text-align: left;
21
+ }
22
+ .mfui-caption_align_center {
23
+ text-align: center;
24
+ }
25
+ .mfui-caption_align_right {
26
+ text-align: right;
27
+ }
28
+ .mfui-caption_has-margin {
29
+ margin: 0 0 16px;
30
+ }
31
+ .mfui-caption_color_inherit {
32
+ color: inherit;
33
+ }
34
+ .mfui-caption_color_default {
35
+ color: var(--content);
36
+ }
37
+ .mfui-caption_color_gray {
38
+ color: var(--spbSky3);
39
+ }
40
+ .mfui-caption_color_white {
41
+ color: var(--stcWhite);
42
+ }
43
+ .mfui-caption_color_green {
44
+ color: var(--brandGreen);
45
+ }
46
+ .mfui-caption_color_purple {
47
+ color: var(--brandPurple);
48
+ }
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+ import './Caption.less';
3
+ declare const COLORS: {
4
+ readonly INHERIT: "inherit";
5
+ readonly DEFAULT: "default";
6
+ readonly GRAY: "gray";
7
+ readonly WHITE: "white";
8
+ readonly GREEN: "green";
9
+ readonly PURPLE: "purple";
10
+ };
11
+ declare type ColorType = typeof COLORS[keyof typeof COLORS];
12
+ export interface ICaptionProps {
13
+ /** Выравнивание по горизонтали */
14
+ align?: 'left' | 'center' | 'right';
15
+ /** Поведение текста при встраивании в широкий или узкий контейнер */
16
+ space?: 'wide' | 'tight';
17
+ /** Начертание шрифта: обычный или полужирный */
18
+ variant?: 'normal' | 'medium';
19
+ /** Вертикальный отступ */
20
+ hasMargin?: boolean;
21
+ /** Цвет текста */
22
+ color?: ColorType;
23
+ /** Дополнительный класс корневого элемента */
24
+ className?: string;
25
+ /** Дополнительные data атрибуты к внутренним элементам */
26
+ dataAttrs?: {
27
+ root?: Record<string, string>;
28
+ };
29
+ }
30
+ declare const Caption: React.FC<ICaptionProps>;
31
+ export default Caption;
@@ -0,0 +1,51 @@
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 "./Caption.css";
7
+ var COLORS = {
8
+ INHERIT: 'inherit',
9
+ DEFAULT: 'default',
10
+ GRAY: 'gray',
11
+ WHITE: 'white',
12
+ GREEN: 'green',
13
+ PURPLE: 'purple'
14
+ };
15
+ var cn = cnCreate('mfui-caption');
16
+
17
+ var Caption = function Caption(_ref) {
18
+ var align = _ref.align,
19
+ _ref$color = _ref.color,
20
+ color = _ref$color === void 0 ? 'default' : _ref$color,
21
+ _ref$space = _ref.space,
22
+ space = _ref$space === void 0 ? 'wide' : _ref$space,
23
+ _ref$variant = _ref.variant,
24
+ variant = _ref$variant === void 0 ? 'normal' : _ref$variant,
25
+ className = _ref.className,
26
+ _ref$hasMargin = _ref.hasMargin,
27
+ hasMargin = _ref$hasMargin === void 0 ? true : _ref$hasMargin,
28
+ dataAttrs = _ref.dataAttrs,
29
+ children = _ref.children;
30
+ return /*#__PURE__*/React.createElement("p", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
31
+ className: cn({
32
+ align: align,
33
+ color: color,
34
+ space: space,
35
+ variant: variant,
36
+ 'has-margin': hasMargin
37
+ }, className)
38
+ }), children);
39
+ };
40
+
41
+ Caption.propTypes = {
42
+ dataAttrs: PropTypes.shape({
43
+ root: PropTypes.objectOf(PropTypes.string.isRequired)
44
+ }),
45
+ align: PropTypes.oneOf(['left', 'center', 'right']),
46
+ space: PropTypes.oneOf(['wide', 'tight']),
47
+ variant: PropTypes.oneOf(['normal', 'medium']),
48
+ hasMargin: PropTypes.bool,
49
+ color: PropTypes.oneOf(Object.values(COLORS))
50
+ };
51
+ export default Caption;
@@ -84,6 +84,9 @@
84
84
  line-height: 24px;
85
85
  font-weight: 500;
86
86
  }
87
+ .mfui-header_space_tight.mfui-header_level_h5 {
88
+ line-height: 18px;
89
+ }
87
90
  .mfui-header_margin.mfui-header_level_h5 {
88
91
  margin: 24px 0 16px 0;
89
92
  }
@@ -3,6 +3,8 @@ import './Header.less';
3
3
  interface IHeaderProps {
4
4
  /** Тег */
5
5
  as?: 'h1' | 'h2' | 'h3' | 'h5';
6
+ /** Поведение текста при встраивании в широкий или узкий контейнер (только для h5) */
7
+ space?: 'wide' | 'tight';
6
8
  /** Цвет */
7
9
  color?: 'default' | 'black' | 'white' | 'green' | 'purple' | 'blue' | 'inherit';
8
10
  /** Включить отступ */
@@ -9,6 +9,8 @@ var Header = function Header(_ref) {
9
9
  var addition = _ref.addition,
10
10
  _ref$as = _ref.as,
11
11
  level = _ref$as === void 0 ? 'h1' : _ref$as,
12
+ _ref$space = _ref.space,
13
+ space = _ref$space === void 0 ? 'wide' : _ref$space,
12
14
  children = _ref.children,
13
15
  className = _ref.className,
14
16
  _ref$color = _ref.color,
@@ -19,12 +21,15 @@ var Header = function Header(_ref) {
19
21
  margin = _ref.margin,
20
22
  onClick = _ref.onClick;
21
23
  var ElementType = level;
24
+ var hasVariousSpaces = level === 'h5';
25
+ var spaceLevel = hasVariousSpaces && space;
22
26
  return /*#__PURE__*/React.createElement(ElementType, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
23
27
  className: cn({
24
28
  color: color,
25
29
  margin: margin,
26
30
  level: level,
27
- 'h-align': hAlign
31
+ 'h-align': hAlign,
32
+ space: spaceLevel
28
33
  }, className),
29
34
  onClick: onClick
30
35
  }), children, addition && /*#__PURE__*/React.createElement("div", {
@@ -35,6 +40,7 @@ var Header = function Header(_ref) {
35
40
  Header.propTypes = {
36
41
  as: PropTypes.oneOf(['h1', 'h2', 'h3', 'h5']),
37
42
  color: PropTypes.oneOf(['default', 'black', 'white', 'green', 'purple', 'blue', 'inherit']),
43
+ space: PropTypes.oneOf(['wide', 'tight']),
38
44
  margin: PropTypes.bool,
39
45
  addition: PropTypes.element,
40
46
  hAlign: PropTypes.oneOf(['inherit', 'left', 'center', 'right']),
@@ -22,12 +22,16 @@ h5 {
22
22
  display: flex;
23
23
  }
24
24
  .mfui-notification__title {
25
- margin-bottom: 8px;
25
+ display: block;
26
+ margin-bottom: 4px;
26
27
  color: var(--content);
28
+ font-weight: 500;
29
+ font-size: 15px;
30
+ line-height: 18px;
27
31
  }
28
32
  @media screen and (min-width: 1280px) {
29
33
  .mfui-notification__title {
30
- margin-bottom: 4px;
34
+ line-height: 24px;
31
35
  }
32
36
  }
33
37
  .mfui-notification__title_close-padding {
@@ -35,7 +39,7 @@ h5 {
35
39
  }
36
40
  .mfui-notification__text {
37
41
  font-size: 12px;
38
- line-height: 16px;
42
+ line-height: 18px;
39
43
  position: relative;
40
44
  max-width: 100%;
41
45
  margin: 0;
@@ -168,7 +172,7 @@ h5 {
168
172
  @media screen and (max-width: 767px) {
169
173
  .mfui-notification__link {
170
174
  font-size: 12px;
171
- line-height: 16px;
175
+ line-height: 18px;
172
176
  }
173
177
  }
174
178
  .mfui-notification__link-arrow,
@@ -209,7 +213,7 @@ h5 {
209
213
  @media screen and (max-width: 767px) {
210
214
  .mfui-notification__collapse-button {
211
215
  font-size: 12px;
212
- line-height: 16px;
216
+ line-height: 18px;
213
217
  }
214
218
  }
215
219
  .mfui-notification__collapse_hidden {
@@ -7,7 +7,6 @@ import React, { useEffect, useRef, useState } from 'react';
7
7
  import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
8
8
  import * as PropTypes from 'prop-types';
9
9
  import Button from "../Button/Button";
10
- import Header from "../Header/Header";
11
10
  import TextLink from "../TextLink/TextLink";
12
11
  import Tile from "../Tile/Tile";
13
12
  import "./Notification.css";
@@ -298,13 +297,9 @@ var Notification = function Notification(_ref) {
298
297
  className: cn('content', [contentClass])
299
298
  }, /*#__PURE__*/React.createElement("div", {
300
299
  className: cn('text-container')
301
- }, title && /*#__PURE__*/React.createElement(Header, {
302
- dataAttrs: {
303
- root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.title
304
- },
305
- as: "h5",
300
+ }, title && /*#__PURE__*/React.createElement("span", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.title), {
306
301
  className: cn('title')
307
- }, title), /*#__PURE__*/React.createElement("div", _extends({
302
+ }), title), /*#__PURE__*/React.createElement("div", _extends({
308
303
  ref: wrapTextRef
309
304
  }, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.text), {
310
305
  className: cn('text', {