@megafon/ui-core 3.0.0-beta.7 → 3.0.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 (91) hide show
  1. package/CHANGELOG.md +56 -77
  2. package/README.md +2 -2
  3. package/dist/es/colors/Colors.d.ts +2 -2
  4. package/dist/es/colors/colorsData.js +1 -1
  5. package/dist/es/components/Accordion/Accordion.css +1 -15
  6. package/dist/es/components/Accordion/Accordion.d.ts +0 -2
  7. package/dist/es/components/Accordion/Accordion.js +2 -7
  8. package/dist/es/components/Banner/Banner.css +28 -0
  9. package/dist/es/components/Banner/Banner.d.ts +2 -0
  10. package/dist/es/components/Banner/Banner.js +15 -10
  11. package/dist/es/components/Button/Button.css +3 -3
  12. package/dist/es/components/Button/Button.js +3 -3
  13. package/dist/es/components/Calendar/Calendar.js +3 -2
  14. package/dist/es/components/Calendar/components/Day/Day.js +1 -1
  15. package/dist/es/components/Carousel/Carousel.js +17 -14
  16. package/dist/es/components/Checkbox/Checkbox.js +1 -1
  17. package/dist/es/components/Counter/Counter.js +3 -3
  18. package/dist/es/components/Link/Link.d.ts +1 -1
  19. package/dist/es/components/Link/Link.js +19 -27
  20. package/dist/es/components/Logo/Logo.js +1 -1
  21. package/dist/es/components/NavArrow/NavArrow.css +1 -1
  22. package/dist/es/components/Notification/Notification.css +34 -25
  23. package/dist/es/components/Notification/Notification.js +4 -2
  24. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +1 -1
  25. package/dist/es/components/Pagination/helpers.d.ts +1 -1
  26. package/dist/es/components/Paragraph/Paragraph.css +0 -9
  27. package/dist/es/components/Paragraph/Paragraph.d.ts +0 -3
  28. package/dist/es/components/Paragraph/Paragraph.js +1 -4
  29. package/dist/es/components/RadioButton/RadioButton.js +1 -1
  30. package/dist/es/components/Search/Search.js +4 -3
  31. package/dist/es/components/Select/Select.css +5 -2
  32. package/dist/es/components/Select/Select.d.ts +5 -45
  33. package/dist/es/components/Select/Select.js +364 -467
  34. package/dist/es/components/Select/reducer/selectReducer.d.ts +34 -0
  35. package/dist/es/components/Select/reducer/selectReducer.js +123 -0
  36. package/dist/es/components/Switcher/Switcher.css +19 -15
  37. package/dist/es/components/Switcher/Switcher.js +1 -1
  38. package/dist/es/components/Tabs/Tabs.d.ts +2 -0
  39. package/dist/es/components/Tabs/Tabs.js +94 -49
  40. package/dist/es/components/TextField/TextField.d.ts +3 -1
  41. package/dist/es/components/TextField/TextField.js +14 -10
  42. package/dist/es/components/Tile/Tile.js +1 -1
  43. package/dist/es/components/Tooltip/Tooltip.js +17 -17
  44. package/dist/es/index.d.ts +1 -0
  45. package/dist/es/index.js +1 -0
  46. package/dist/lib/colors/Colors.d.ts +2 -2
  47. package/dist/lib/colors/colorsData.js +1 -1
  48. package/dist/lib/components/Accordion/Accordion.css +1 -15
  49. package/dist/lib/components/Accordion/Accordion.d.ts +0 -2
  50. package/dist/lib/components/Accordion/Accordion.js +2 -7
  51. package/dist/lib/components/Banner/Banner.css +28 -0
  52. package/dist/lib/components/Banner/Banner.d.ts +2 -0
  53. package/dist/lib/components/Banner/Banner.js +15 -10
  54. package/dist/lib/components/Button/Button.css +3 -3
  55. package/dist/lib/components/Button/Button.js +3 -3
  56. package/dist/lib/components/Calendar/Calendar.js +3 -3
  57. package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
  58. package/dist/lib/components/Carousel/Carousel.js +15 -12
  59. package/dist/lib/components/Checkbox/Checkbox.js +1 -1
  60. package/dist/lib/components/Counter/Counter.js +3 -3
  61. package/dist/lib/components/Link/Link.d.ts +1 -1
  62. package/dist/lib/components/Link/Link.js +28 -43
  63. package/dist/lib/components/Logo/Logo.js +1 -1
  64. package/dist/lib/components/NavArrow/NavArrow.css +1 -1
  65. package/dist/lib/components/Notification/Notification.css +34 -25
  66. package/dist/lib/components/Notification/Notification.js +4 -2
  67. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +1 -1
  68. package/dist/lib/components/Pagination/helpers.d.ts +1 -1
  69. package/dist/lib/components/Paragraph/Paragraph.css +0 -9
  70. package/dist/lib/components/Paragraph/Paragraph.d.ts +0 -3
  71. package/dist/lib/components/Paragraph/Paragraph.js +1 -4
  72. package/dist/lib/components/RadioButton/RadioButton.js +1 -1
  73. package/dist/lib/components/Search/Search.js +4 -3
  74. package/dist/lib/components/Select/Select.css +5 -2
  75. package/dist/lib/components/Select/Select.d.ts +5 -45
  76. package/dist/lib/components/Select/Select.js +358 -490
  77. package/dist/lib/components/Select/reducer/selectReducer.d.ts +34 -0
  78. package/dist/lib/components/Select/reducer/selectReducer.js +136 -0
  79. package/dist/lib/components/Switcher/Switcher.css +19 -15
  80. package/dist/lib/components/Switcher/Switcher.js +1 -1
  81. package/dist/lib/components/Tabs/Tabs.d.ts +2 -0
  82. package/dist/lib/components/Tabs/Tabs.js +94 -49
  83. package/dist/lib/components/TextField/TextField.d.ts +3 -1
  84. package/dist/lib/components/TextField/TextField.js +14 -10
  85. package/dist/lib/components/Tile/Tile.js +1 -1
  86. package/dist/lib/components/Tooltip/Tooltip.js +17 -17
  87. package/dist/lib/index.d.ts +1 -0
  88. package/dist/lib/index.js +8 -0
  89. package/package.json +4 -4
  90. package/styles/colors.css +2 -2
  91. package/styles/colorsDark.css +1 -1
package/CHANGELOG.md CHANGED
@@ -3,138 +3,117 @@
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.0.0-beta.7](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.6...@megafon/ui-core@3.0.0-beta.7) (2022-02-04)
6
+ ## [3.0.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0...@megafon/ui-core@3.0.1) (2022-02-11)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
- * **components:** change tests for dataAttrs prop ([2a8f306](https://github.com/MegafonWebLab/megafon-ui/commit/2a8f3061a4e89f6877894e5947db7bae2827f86a))
11
+ * **colors:** fix button hover purple color name and value ([c333348](https://github.com/MegafonWebLab/megafon-ui/commit/c3333489826338f49e4ecb1c1beb07ee9044167e))
12
+ * **colors:** fix typo in brandPurple color ([f7bdb49](https://github.com/MegafonWebLab/megafon-ui/commit/f7bdb4956247a4bf2112c130e960a98f8cea0696))
13
+ * **logo:** fix green color for vertical logo ([c9aed9d](https://github.com/MegafonWebLab/megafon-ui/commit/c9aed9db957cb9857cc20afa8dd824e241e12114))
14
+ * **notification:** fix styles ([7d93f3e](https://github.com/MegafonWebLab/megafon-ui/commit/7d93f3ea0e61af9647478af03f84e963d5d52e0f))
15
+ * revert mistake version ([cc8668a](https://github.com/MegafonWebLab/megafon-ui/commit/cc8668a9ff2bc5fde6bf93ca806d4406a5944107))
12
16
 
13
17
 
14
- ### Features
15
-
16
- * **components:** add dataAttrs props in new format ([026d868](https://github.com/MegafonWebLab/megafon-ui/commit/026d8681743d55ea8c93d17000a64959093f7a05))
17
-
18
18
 
19
19
 
20
20
 
21
-
22
- # [3.0.0-beta.6](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.5...@megafon/ui-core@3.0.0-beta.6) (2022-02-02)
21
+ # [3.0.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.5.0...@megafon/ui-core@3.0.0) (2022-02-09)
23
22
 
24
23
 
25
24
  ### Bug Fixes
26
25
 
27
- * color props values changes ([b279f2b](https://github.com/MegafonWebLab/megafon-ui/commit/b279f2b5af0edae92fe9825bbfa90a207cb8009a))
28
- * remove deprecated props values ([add76f3](https://github.com/MegafonWebLab/megafon-ui/commit/add76f38a9ebad8b5b6504dfe6aae862746f0dfc))
29
- * **colors:** rename green and purple to brandGreen and brandPurple ([2266734](https://github.com/MegafonWebLab/megafon-ui/commit/2266734336be1a0faa5f1736fdf39070442837b3))
30
- * **core:** fix build ui-core ([458c824](https://github.com/MegafonWebLab/megafon-ui/commit/458c824aab639e4802db261d0416b3cee58ac274))
31
- * **core:** separated colors.css file ([f0a4d72](https://github.com/MegafonWebLab/megafon-ui/commit/f0a4d728e0b30c5caeae5c8d9607e624fb4ea288))
32
- * **textlink:** fix color prop type ([6edcea0](https://github.com/MegafonWebLab/megafon-ui/commit/6edcea06ce26d137611aaf022d3ee6f7da295366))
33
-
34
-
35
- ### BREAKING CHANGES
36
-
37
- * ContentArea: prop color change values from 'base' to 'white' and from 'content' to 'default';
38
- remove depreacted value 'freshAsphalt'
39
- Paragraph: prop color change values from 'base' to 'white' and from 'contend' to 'default';
40
- remove deprecared values 'freshAsphalt' and 'clearWhite'
41
- StoreBanner: prop theme change value from 'black' to 'default'; remove deprecated value 'clearWhite'
42
- * ContentArea, Paragraph, StoreBanner and Breadcrumbs components from no don't have
43
- freshAsphalt and clearWhite as values for colorize props
44
-
45
-
46
-
47
-
48
-
49
- # [3.0.0-beta.5](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.4...@megafon/ui-core@3.0.0-beta.5) (2022-01-28)
26
+ * **accordion:** add focus on arrow after tab press, add open/close accordion after enter press ([5c49447](https://github.com/MegafonWebLab/megafon-ui/commit/5c494474dc319593283b339c63936fd2b862a33f))
27
+ * **accordion:** change type of onClickAccordion prop ([b74e196](https://github.com/MegafonWebLab/megafon-ui/commit/b74e1963587a140bb25b8e50e64490a1337dda78))
28
+ * **calendar/month:** add focus on month arrows, add enter press handlers ([caad017](https://github.com/MegafonWebLab/megafon-ui/commit/caad0176a9d272b19da11ddfac1830d863d090ae))
29
+ * **checkbox:** add focus on custom checkbox, add enter press handler ([136872c](https://github.com/MegafonWebLab/megafon-ui/commit/136872c84c058502a46d5b6db5088bebd71ebdb8))
30
+ * **checkbox:** add isChecked state, change type of onChange prop ([be62e30](https://github.com/MegafonWebLab/megafon-ui/commit/be62e30f43dcee4c43cab5425c4ddc0c6954f3f7))
31
+ * **components:** change tests for dataAttrs prop ([eae8ecb](https://github.com/MegafonWebLab/megafon-ui/commit/eae8ecb5104c050ec0e67357ed5edecdfb042838))
32
+ * **core:** fix build ui-core ([fa9522a](https://github.com/MegafonWebLab/megafon-ui/commit/fa9522ac0931edb7ec772ad040557997db080687))
33
+ * **core:** separated colors.css file ([3a0af6b](https://github.com/MegafonWebLab/megafon-ui/commit/3a0af6b31d711016faa92bc7402ce02c6d8710ae))
34
+ * **less:** import base.less file through reference ([20bd43d](https://github.com/MegafonWebLab/megafon-ui/commit/20bd43d60f9cfac102c55ccdf183578702d2eb96))
35
+ * **paragraph:** remove spbSky... values from color prop ([3a74e2b](https://github.com/MegafonWebLab/megafon-ui/commit/3a74e2ba23b41a1982f72cb1a869e0253c903180))
36
+ * **switcher:** fix switcher design ([642d679](https://github.com/MegafonWebLab/megafon-ui/commit/642d679d6c48c4a96093220415a68c9444d8cb53))
37
+ * **textlink:** fix color prop type ([4e93cce](https://github.com/MegafonWebLab/megafon-ui/commit/4e93ccef6bcbb1a5e670089dfafe308c23fcbe1e))
38
+ * **tooltip:** add check event function from ui-helpers ([18ef333](https://github.com/MegafonWebLab/megafon-ui/commit/18ef333ba78f7804731da2116b124cdc44a8dfcb))
50
39
 
51
40
 
52
41
  ### Features
53
42
 
54
- * **header:** made header as a functional component ([81701ad](https://github.com/MegafonWebLab/megafon-ui/commit/81701ad87b6e9df2fe630bf4e183383264c0bb01))
55
- * **radiobutton:** made radiobutton as a functional component ([65406af](https://github.com/MegafonWebLab/megafon-ui/commit/65406afc90fd82f7eb0fdcbbe78569fc98164e78))
56
-
57
-
58
-
59
-
60
-
61
- # [3.0.0-beta.4](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.3...@megafon/ui-core@3.0.0-beta.4) (2022-01-27)
62
-
63
- **Note:** Version bump only for package @megafon/ui-core
64
-
65
-
43
+ * **accordion:** remove prop hasVerticalPaddings ([c1f0139](https://github.com/MegafonWebLab/megafon-ui/commit/c1f01398154497ed69fb2bb725077e3cc3b5c47e))
44
+ * **colors:** css custom properties and color themes support ([16df5b7](https://github.com/MegafonWebLab/megafon-ui/commit/16df5b7b2644e15bb6c6e49e7347c0f8e4839e58))
45
+ * **colors:** rename green and purple to brandGreen and brandPurple to avoid postcss-colormin bug ([089dd42](https://github.com/MegafonWebLab/megafon-ui/commit/089dd42cd18db7fc83e690da45d09b88c636a6f7))
46
+ * **colors:** update color values on colors page when user switches theme ([8eb66de](https://github.com/MegafonWebLab/megafon-ui/commit/8eb66dec2ef9de5615ad8c921c422b6a9f00893a))
47
+ * **components:** add dataAttrs props in new format ([e9cf812](https://github.com/MegafonWebLab/megafon-ui/commit/e9cf8122ac47f83a8e744e0695351d60aa711dbd))
48
+ * **header:** made header as a functional component ([b983934](https://github.com/MegafonWebLab/megafon-ui/commit/b983934ced137ede35f64ce2dfe0c953c1690db0))
49
+ * **radiobutton:** made radiobutton as a functional component ([b225e1d](https://github.com/MegafonWebLab/megafon-ui/commit/b225e1d5e1964fd1e7010a9051586fb627cc90c3))
50
+ * **select:** made select as a functional component ([fc9cfc2](https://github.com/MegafonWebLab/megafon-ui/commit/fc9cfc25505952080bf90095ab183367915d27e6))
51
+ * **styles:** export css version for base.less ([acdea73](https://github.com/MegafonWebLab/megafon-ui/commit/acdea73462713156dee077fde4c223879e356b4d))
52
+ * remove deprecated props values ([d09c460](https://github.com/MegafonWebLab/megafon-ui/commit/d09c4606ce6e41f7144e18c2216d039d859288e2))
66
53
 
67
54
 
68
55
 
69
- # [3.0.0-beta.3](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.2...@megafon/ui-core@3.0.0-beta.3) (2022-01-24)
70
-
71
-
72
- ### Bug Fixes
73
-
74
- * **accordion:** add focus on arrow after tab press, add open/close accordion after enter press ([9bfa0ac](https://github.com/MegafonWebLab/megafon-ui/commit/9bfa0ac5348ac25c0e37a4df51e26e2dabde02ba))
75
- * **accordion:** change type of onClickAccordion prop ([9a150c5](https://github.com/MegafonWebLab/megafon-ui/commit/9a150c5de309547763a714b0eb630dfb386a8107))
76
- * **calendar/month:** add focus on month arrows, add enter press handlers ([63f1e47](https://github.com/MegafonWebLab/megafon-ui/commit/63f1e4761e57ed6d56464b632dce9fd5e77655e1))
77
- * **checkbox:** add focus on custom checkbox, add enter press handler ([83d111d](https://github.com/MegafonWebLab/megafon-ui/commit/83d111d0e4b41d3915bdd079bed4a7f9715ce7a5))
78
- * **checkbox:** add isChecked state, change type of onChange prop ([f535caf](https://github.com/MegafonWebLab/megafon-ui/commit/f535caf39a02ab6793d3c63b654a1f1f3e9b2b93))
79
- * **tooltip:** add check event function from ui-helpers ([a784ab4](https://github.com/MegafonWebLab/megafon-ui/commit/a784ab4f288124eb941fe8f52e46b2efc9aa2f82))
80
-
81
-
82
56
  ### BREAKING CHANGES
83
57
 
84
- * **checkbox:** change type of onChange prop on (checked: boolean) => void
58
+ * **accordion:** remove prop hasVerticalPaddings
85
59
  * **accordion:** remove parameter 'title' in onClickAccordion prop
60
+ * **checkbox:** change type of onChange prop on (checked: boolean) => void
61
+ * **colors:** green, green20, green80, purple, purple20 and purple80 colors now have 'brand'
62
+ prefix (e.g. brandGreen)
63
+ * **contentarea**: prop color change values from 'base' to 'white' and from 'content' to 'default';
64
+ remove depreacted value 'freshAsphalt'
65
+ * **contentarea**, **paragraph**, **storebanner** and **breadcrumbs** components from no don't have
66
+ 'freshAsphalt' and 'clearWhite' as values for colorizing props
67
+ * **paragraph:** remove from color prop values: 'spbSky0', 'spbSky1', 'spbSky2'
68
+ * **paragraph**: prop color change values from 'base' to 'white' and from 'contend' to 'default';
69
+ remove deprecared values 'freshAsphalt' and 'clearWhite'
70
+ * **storebanner**: prop theme change value from 'black' to 'default'; remove deprecated value 'clearWhite'
86
71
  * **tooltip:** change onOpen, onClose types; AccessibilityEventTypeNative from @megafon/ui-helpers
72
+ * **components:** for the components to work correctly, now it's needed to import colors.css file
87
73
 
88
74
 
89
75
 
90
76
 
91
77
 
92
- # [3.0.0-beta.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.1...@megafon/ui-core@3.0.0-beta.2) (2022-01-21)
78
+ # [2.5.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.4.0...@megafon/ui-core@2.5.0) (2022-02-07)
93
79
 
94
- **Note:** Version bump only for package @megafon/ui-core
95
80
 
81
+ ### Features
82
+
83
+ * **tabs:** add prop outerObserveContainer for observing sticky mode from outside ([bc20c76](https://github.com/MegafonWebLab/megafon-ui/commit/bc20c76f497d88da19ea03cfc66a0c38a7559698))
96
84
 
97
85
 
98
86
 
99
87
 
100
- # [3.0.0-beta.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.0...@megafon/ui-core@3.0.0-beta.1) (2022-01-20)
88
+
89
+ # [2.4.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.3.0...@megafon/ui-core@2.4.0) (2022-01-31)
101
90
 
102
91
 
103
92
  ### Bug Fixes
104
93
 
105
- * **colors:** fix colors component ([3061f7c](https://github.com/MegafonWebLab/megafon-ui/commit/3061f7c7b56d5baa32f109d7ce941bcc7e70c5b9))
106
- * **colors:** remove unused classname modifiers ([d919cdc](https://github.com/MegafonWebLab/megafon-ui/commit/d919cdcf1fa79d60230fc85811518ded1c0537ad))
107
- * **colors:** remove unused method ([2970295](https://github.com/MegafonWebLab/megafon-ui/commit/2970295df9053a4f54ed19d3d46deb07994844e0))
108
- * **colors:** renabe green and purple to brandGreen and brandPurple to avoid postcss-colormin bug ([563d97c](https://github.com/MegafonWebLab/megafon-ui/commit/563d97c42900099415a6872f57b500b87aeed647))
109
- * **colors:** update color values on colors page when user switches theme ([8552ff6](https://github.com/MegafonWebLab/megafon-ui/commit/8552ff69a66153ef890437ffc4dd2e50c31d6f2e))
110
- * **less:** import base.less file through reference ([5a13aae](https://github.com/MegafonWebLab/megafon-ui/commit/5a13aaedec3a7fd09f77dcddfe437fda604f60a5))
94
+ * **link:** new prop dataAttrs ([bde2253](https://github.com/MegafonWebLab/megafon-ui/commit/bde22539ff0db11777be9193adceb6de0f984234))
111
95
 
112
96
 
113
97
  ### Features
114
98
 
115
- * **styles:** export css version for base.less ([14aff17](https://github.com/MegafonWebLab/megafon-ui/commit/14aff17f8d3f77ec7beb2e3cb5c8a489ecd77e74))
99
+ * **banner:** add props withPaginationBottomOffset ([c1485a0](https://github.com/MegafonWebLab/megafon-ui/commit/c1485a083d63b886419109b03bb31230c5fed890))
116
100
 
117
101
 
118
- ### BREAKING CHANGES
119
102
 
120
- * **colors:** green, green20, green80, purple, purple20 and purple80 colors now have 'brand'
121
- prefix (e.g. brandGreen)
122
103
 
123
104
 
105
+ # [2.3.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.2.0...@megafon/ui-core@2.3.0) (2022-01-24)
124
106
 
125
107
 
108
+ ### Bug Fixes
126
109
 
127
- # [3.0.0-beta.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.2.0...@megafon/ui-core@3.0.0-beta.0) (2022-01-19)
110
+ * **search:** prevents default action when a menu item is selected and the enter button is pressed ([054cbcf](https://github.com/MegafonWebLab/megafon-ui/commit/054cbcf3457ff779443a82b5ae6383fda57f9cc7))
128
111
 
129
112
 
130
113
  ### Features
131
114
 
132
- * **colors:** css custom properties and color themes support ([b19a9a5](https://github.com/MegafonWebLab/megafon-ui/commit/b19a9a5112ebc7427d60f6514d606dd9d71ca444))
133
-
134
-
135
- ### BREAKING CHANGES
136
-
137
- * **colors:** read commit description
115
+ * **accordion:** props hasVerticalPaddings marked as deprecated ([4d6d4cc](https://github.com/MegafonWebLab/megafon-ui/commit/4d6d4cca2cf45a86441827f0bef625a88a2c44f8))
116
+ * **textfield:** add autocomplete prop ([f2cff94](https://github.com/MegafonWebLab/megafon-ui/commit/f2cff9403503de174b785ea02365ce470811369e))
138
117
 
139
118
 
140
119
 
package/README.md CHANGED
@@ -5,8 +5,8 @@ React UI components library.
5
5
  ## Getting started
6
6
 
7
7
  ```bash
8
- $ npm install --save @megafon/ui-core@beta
8
+ $ npm install --save @megafon/ui-core
9
9
  ```
10
10
  ```bash
11
- $ yarn add @megafon/ui-core@beta
11
+ $ yarn add @megafon/ui-core
12
12
  ```
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import './Colors.less';
3
- declare const Colors: () => JSX.Element;
3
+ declare const Colors: React.FC;
4
4
  export default Colors;
@@ -73,7 +73,7 @@ var colors = {
73
73
  code: 'buttonHoverGreen'
74
74
  }, {
75
75
  name: 'Button Hov. P.',
76
- code: 'buttonhoverPurple'
76
+ code: 'buttonHoverPurple'
77
77
  }, {
78
78
  name: 'Button Down',
79
79
  code: 'buttonDown'
@@ -40,25 +40,11 @@
40
40
  .mfui-accordion__content-inner {
41
41
  padding: 24px 16px;
42
42
  }
43
- @media screen and (min-width: 768px) and (max-width: 1023px) {
43
+ @media screen and (min-width: 768px) {
44
44
  .mfui-accordion__content-inner {
45
45
  padding: 24px;
46
46
  }
47
47
  }
48
- @media screen and (min-width: 1024px) and (max-width: 1279px) {
49
- .mfui-accordion__content-inner {
50
- padding: 24px 48px;
51
- }
52
- }
53
- @media screen and (min-width: 1280px) {
54
- .mfui-accordion__content-inner {
55
- padding: 24px 40px;
56
- }
57
- }
58
- .mfui-accordion__content-inner_v-padding {
59
- padding-top: 24px;
60
- padding-bottom: 24px;
61
- }
62
48
  .mfui-accordion__icon {
63
49
  fill: var(--content);
64
50
  }
@@ -7,8 +7,6 @@ export interface IAccordionProps {
7
7
  title: string | React.ReactNode | React.ReactNode[];
8
8
  /** Состояние открытости */
9
9
  isOpened?: boolean;
10
- /** Вертикальные отступы */
11
- hasVerticalPaddings?: boolean;
12
10
  /** Дополнительный класс для корневого элемента */
13
11
  className?: string;
14
12
  /** Дополнительные классы для корневого и внутренних элементов */
@@ -30,8 +30,6 @@ var Accordion = function Accordion(_ref) {
30
30
  title = _ref.title,
31
31
  _ref$isOpened = _ref.isOpened,
32
32
  isOpened = _ref$isOpened === void 0 ? false : _ref$isOpened,
33
- _ref$hasVerticalPaddi = _ref.hasVerticalPaddings,
34
- hasVerticalPaddings = _ref$hasVerticalPaddi === void 0 ? false : _ref$hasVerticalPaddi,
35
33
  className = _ref.className,
36
34
  _ref$classes = _ref.classes;
37
35
  _ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
@@ -54,7 +52,7 @@ var Accordion = function Accordion(_ref) {
54
52
 
55
53
  var handleClickTitle = function handleClickTitle(e) {
56
54
  if (checkEventIsClickOrEnterPress(e)) {
57
- onClickAccordion && onClickAccordion(!isOpenedState);
55
+ onClickAccordion === null || onClickAccordion === void 0 ? void 0 : onClickAccordion(!isOpenedState);
58
56
  setIsOpenedState(!isOpenedState);
59
57
  }
60
58
  };
@@ -79,9 +77,7 @@ var Accordion = function Accordion(_ref) {
79
77
  })
80
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), {
81
79
  className: cn('content', collapsePropsClasses),
82
- classNameContainer: cn('content-inner', {
83
- 'v-padding': hasVerticalPaddings
84
- }),
80
+ classNameContainer: cn('content-inner'),
85
81
  isOpened: isOpenedState
86
82
  }), children));
87
83
  };
@@ -92,7 +88,6 @@ Accordion.propTypes = {
92
88
  }), PropTypes.any])]),
93
89
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
94
90
  isOpened: PropTypes.bool,
95
- hasVerticalPaddings: PropTypes.bool,
96
91
  className: PropTypes.string,
97
92
  classes: PropTypes.shape({
98
93
  openedClass: PropTypes.string,
@@ -34,6 +34,11 @@
34
34
  -webkit-transform: translateY(-50%);
35
35
  transform: translateY(-50%);
36
36
  }
37
+ @media screen and (max-width: 767px) {
38
+ .mfui-banner__arrow {
39
+ display: none;
40
+ }
41
+ }
37
42
  .mfui-banner__arrow_prev {
38
43
  left: 12px;
39
44
  }
@@ -98,6 +103,29 @@
98
103
  .mfui-banner__pagination_theme_dark {
99
104
  background-color: var(--stcBlack20);
100
105
  }
106
+ .mfui-banner__pagination_bottom-offset {
107
+ bottom: 60px;
108
+ }
109
+ @media screen and (min-width: 768px) and (max-width: 1023px) {
110
+ .mfui-banner__pagination_bottom-offset {
111
+ bottom: 89px;
112
+ }
113
+ }
114
+ @media screen and (min-width: 1024px) and (max-width: 1279px) {
115
+ .mfui-banner__pagination_bottom-offset {
116
+ bottom: 90px;
117
+ }
118
+ }
119
+ @media screen and (min-width: 1280px) and (max-width: 1439px) {
120
+ .mfui-banner__pagination_bottom-offset {
121
+ bottom: 65px;
122
+ }
123
+ }
124
+ @media screen and (min-width: 1440px) {
125
+ .mfui-banner__pagination_bottom-offset {
126
+ bottom: 72px;
127
+ }
128
+ }
101
129
  .mfui-banner__dot {
102
130
  width: 12px;
103
131
  height: 12px;
@@ -26,6 +26,8 @@ export interface IBannerProps {
26
26
  pagination?: Record<string, string>;
27
27
  dot?: Record<string, string>;
28
28
  };
29
+ /** Предполагается использование с наезжанием на баннер следующего за баннером элемента */
30
+ withPaginationBottomOffset?: boolean;
29
31
  /** Автоматическая прокрутка */
30
32
  autoPlay?: boolean;
31
33
  /** Задержка автоматической прокрутки */
@@ -33,6 +33,8 @@ var Banner = function Banner(_ref) {
33
33
  var className = _ref.className,
34
34
  _ref$classes = _ref.classes,
35
35
  classes = _ref$classes === void 0 ? {} : _ref$classes,
36
+ _ref$withPaginationBo = _ref.withPaginationBottomOffset,
37
+ withPaginationBottomOffset = _ref$withPaginationBo === void 0 ? false : _ref$withPaginationBo,
36
38
  _ref$autoPlay = _ref.autoPlay,
37
39
  autoPlay = _ref$autoPlay === void 0 ? false : _ref$autoPlay,
38
40
  _ref$autoPlayDelay = _ref.autoPlayDelay,
@@ -85,7 +87,8 @@ var Banner = function Banner(_ref) {
85
87
  return;
86
88
  }
87
89
 
88
- autoplay.stop();
90
+ autoplay.stop(); // eslint-disable-next-line no-param-reassign
91
+
89
92
  params.autoplay.delay = autoPlayDelay * 3;
90
93
  autoplay.start();
91
94
  }, [autoPlayDelay]);
@@ -95,18 +98,18 @@ var Banner = function Banner(_ref) {
95
98
  }
96
99
 
97
100
  swiperInstance.slidePrev();
98
- onPrevClick && onPrevClick(swiperInstance.realIndex);
101
+ onPrevClick === null || onPrevClick === void 0 ? void 0 : onPrevClick(swiperInstance.realIndex);
99
102
  increaseAutoplayDelay(swiperInstance);
100
- }, [swiperInstance, onPrevClick]);
103
+ }, [swiperInstance, onPrevClick, increaseAutoplayDelay]);
101
104
  var handleNextClick = React.useCallback(function () {
102
105
  if (!swiperInstance) {
103
106
  return;
104
107
  }
105
108
 
106
109
  swiperInstance.slideNext();
107
- onNextClick && onNextClick(swiperInstance.realIndex);
110
+ onNextClick === null || onNextClick === void 0 ? void 0 : onNextClick(swiperInstance.realIndex);
108
111
  increaseAutoplayDelay(swiperInstance);
109
- }, [swiperInstance, onNextClick]);
112
+ }, [swiperInstance, onNextClick, increaseAutoplayDelay]);
110
113
  var handleDotClick = React.useCallback(function (index) {
111
114
  if (!swiperInstance) {
112
115
  return;
@@ -118,9 +121,9 @@ var Banner = function Banner(_ref) {
118
121
  swiperInstance.slideTo(index);
119
122
  }
120
123
 
121
- onDotClick && onDotClick(swiperInstance.realIndex);
124
+ onDotClick === null || onDotClick === void 0 ? void 0 : onDotClick(swiperInstance.realIndex);
122
125
  increaseAutoplayDelay(swiperInstance);
123
- }, [swiperInstance, loop, onDotClick]);
126
+ }, [swiperInstance, loop, onDotClick, increaseAutoplayDelay]);
124
127
  var handleSwiper = React.useCallback(function (swiper) {
125
128
  setSwiperInstance(swiper);
126
129
  }, []);
@@ -143,8 +146,8 @@ var Banner = function Banner(_ref) {
143
146
  var handleSlideChange = React.useCallback(function (_ref4) {
144
147
  var realIndex = _ref4.realIndex;
145
148
  setActiveIndex(realIndex);
146
- onChange && onChange(realIndex);
147
- }, []);
149
+ onChange === null || onChange === void 0 ? void 0 : onChange(realIndex);
150
+ }, [onChange]);
148
151
  var handleAutoplayStop = React.useCallback(function () {
149
152
  setAutoPlayning(false);
150
153
  }, []);
@@ -185,7 +188,8 @@ var Banner = function Banner(_ref) {
185
188
  theme: navArrowTheme
186
189
  })), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
187
190
  className: cn('pagination', {
188
- theme: navTheme
191
+ theme: navTheme,
192
+ 'bottom-offset': withPaginationBottomOffset
189
193
  })
190
194
  }), React.Children.map(children, function (_, i) {
191
195
  return /*#__PURE__*/React.createElement(BannerDot, {
@@ -209,6 +213,7 @@ Banner.propTypes = {
209
213
  classes: PropTypes.shape({
210
214
  slide: PropTypes.string
211
215
  }),
216
+ withPaginationBottomOffset: PropTypes.bool,
212
217
  dataAttrs: PropTypes.shape({
213
218
  root: PropTypes.objectOf(PropTypes.string.isRequired),
214
219
  swiper: PropTypes.objectOf(PropTypes.string.isRequired),
@@ -224,9 +224,9 @@
224
224
  fill: var(--stcWhite);
225
225
  }
226
226
  .mfui-button_no-touch.mfui-button_type_primary.mfui-button_theme_purple:not(.mfui-button_loading):hover {
227
- background-color: var(--buttonhoverPurple);
228
- -webkit-box-shadow: inset 0 0 0 1px var(--buttonhoverPurple);
229
- box-shadow: inset 0 0 0 1px var(--buttonhoverPurple);
227
+ background-color: var(--buttonHoverPurple);
228
+ -webkit-box-shadow: inset 0 0 0 1px var(--buttonHoverPurple);
229
+ box-shadow: inset 0 0 0 1px var(--buttonHoverPurple);
230
230
  }
231
231
  .mfui-button_no-touch.mfui-button_type_primary.mfui-button_theme_purple:not(.mfui-button_loading):active {
232
232
  background-color: var(--buttonDown);
@@ -96,7 +96,7 @@ var Button = function Button(_ref) {
96
96
  return;
97
97
  }
98
98
 
99
- onClick && onClick(e);
99
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
100
100
  }, [disabled, onClick]);
101
101
  var currentTheme = React.useMemo(function () {
102
102
  return type === ButtonTypes.PRIMARY && theme === ButtonThemes.BLACK ? ButtonThemes.GREEN : theme;
@@ -130,7 +130,7 @@ var Button = function Button(_ref) {
130
130
  }, children), !icon && showArrow && /*#__PURE__*/React.createElement(Arrow, {
131
131
  className: cn('icon-arrow')
132
132
  }));
133
- }, [contentClassName, showArrow, icon, children]);
133
+ }, [children, icon, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.content, contentClassName, showArrow]);
134
134
  var contentType = React.useMemo(function () {
135
135
  switch (true) {
136
136
  case icon && !children:
@@ -155,7 +155,7 @@ var Button = function Button(_ref) {
155
155
  sizeTablet: sizeTablet && getLoaderSize(sizeTablet),
156
156
  sizeMobile: sizeMobile && getLoaderSize(sizeMobile)
157
157
  });
158
- }, [sizeAll, sizeWide, sizeDesktop, sizeTablet, sizeMobile]);
158
+ }, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.loader, loaderColor, sizeAll, sizeWide, sizeDesktop, sizeTablet, sizeMobile]);
159
159
 
160
160
  var setRelAttribute = function setRelAttribute() {
161
161
  if (ElementType !== 'a') {
@@ -113,7 +113,7 @@ var Calendar = function Calendar(_ref) {
113
113
  useEffect(function () {
114
114
  var propsStartDate = calendarStateFromProps.startDate;
115
115
  setCalendarState(calendarStateFromProps);
116
- propsStartDate && goToDate(propsStartDate);
116
+ propsStartDate && goToDate(propsStartDate); // eslint-disable-next-line react-hooks/exhaustive-deps
117
117
  }, [calendarStateFromProps]);
118
118
 
119
119
  var getCalendarState = function getCalendarState(date) {
@@ -178,7 +178,7 @@ var Calendar = function Calendar(_ref) {
178
178
  var nextStartDate = nextState.startDate,
179
179
  nextEndDate = nextState.endDate;
180
180
  setCalendarState(nextState);
181
- onChange && onChange(nextStartDate, nextEndDate);
181
+ onChange === null || onChange === void 0 ? void 0 : onChange(nextStartDate, nextEndDate);
182
182
  };
183
183
 
184
184
  var handleDateHover = function handleDateHover(date) {
@@ -224,6 +224,7 @@ var Calendar = function Calendar(_ref) {
224
224
  var month = _ref2.month,
225
225
  year = _ref2.year;
226
226
 
227
+ // eslint-disable-next-line react-hooks/rules-of-hooks
227
228
  var _useMonth = useMonth({
228
229
  year: year,
229
230
  month: month,
@@ -60,7 +60,7 @@ var Day = function Day(_a) {
60
60
  };
61
61
 
62
62
  var handleMouseLeave = function handleMouseLeave() {
63
- onMouseLeave && onMouseLeave();
63
+ onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
64
64
  };
65
65
 
66
66
  return /*#__PURE__*/React.createElement("button", {
@@ -122,7 +122,8 @@ var Carousel = function Carousel(_ref) {
122
122
  return;
123
123
  }
124
124
 
125
- autoplay.stop();
125
+ autoplay.stop(); // eslint-disable-next-line no-param-reassign
126
+
126
127
  params.autoplay.delay = autoPlayDelay * 3;
127
128
  autoplay.start();
128
129
  }, [autoPlayDelay]);
@@ -132,7 +133,7 @@ var Carousel = function Carousel(_ref) {
132
133
  }
133
134
 
134
135
  swiperInstance.slidePrev();
135
- onPrevClick && onPrevClick(swiperInstance.realIndex);
136
+ onPrevClick === null || onPrevClick === void 0 ? void 0 : onPrevClick(swiperInstance.realIndex);
136
137
  increaseAutoplayDelay(swiperInstance);
137
138
  }, [swiperInstance, onPrevClick, increaseAutoplayDelay]);
138
139
  var handleNextClick = React.useCallback(function () {
@@ -141,14 +142,14 @@ var Carousel = function Carousel(_ref) {
141
142
  }
142
143
 
143
144
  swiperInstance.slideNext();
144
- onNextClick && onNextClick(swiperInstance.realIndex);
145
+ onNextClick === null || onNextClick === void 0 ? void 0 : onNextClick(swiperInstance.realIndex);
145
146
  increaseAutoplayDelay(swiperInstance);
146
147
  }, [swiperInstance, onNextClick, increaseAutoplayDelay]);
147
148
  var handleSwiper = React.useCallback(function (swiper) {
148
149
  setSwiperInstance(swiper);
149
150
  setLocked(swiper.isBeginning && swiper.isEnd);
150
- getSwiper && getSwiper(swiper);
151
- }, []);
151
+ getSwiper === null || getSwiper === void 0 ? void 0 : getSwiper(swiper);
152
+ }, [getSwiper]);
152
153
  var handleReachBeginnig = React.useCallback(function () {
153
154
  setBeginning(true);
154
155
  }, []);
@@ -169,7 +170,7 @@ var Carousel = function Carousel(_ref) {
169
170
  var realIndex = _ref4.realIndex,
170
171
  previousIndex = _ref4.previousIndex,
171
172
  params = _ref4.params;
172
- onChange && onChange(realIndex, previousIndex, params.slidesPerView);
173
+ onChange === null || onChange === void 0 ? void 0 : onChange(realIndex, previousIndex, params.slidesPerView);
173
174
  }, [onChange]);
174
175
 
175
176
  var handleRootClick = function handleRootClick(e) {
@@ -182,15 +183,17 @@ var Carousel = function Carousel(_ref) {
182
183
  }; // https://github.com/nolimits4web/Swiper/issues/2346
183
184
 
184
185
 
185
- var handleSwiperResize = React.useCallback(throttle(function (swiper) {
186
- setBeginning(swiper.isBeginning);
187
- setEnd(swiper.isEnd);
188
- setLocked(swiper.isBeginning && swiper.isEnd);
186
+ var handleSwiperResize = React.useCallback(function () {
187
+ throttle(function (swiper) {
188
+ setBeginning(swiper.isBeginning);
189
+ setEnd(swiper.isEnd);
190
+ setLocked(swiper.isBeginning && swiper.isEnd);
189
191
 
190
- if (swiper.params.slidesPerView === SlidesPerView.AUTO) {
191
- swiper.slides.css('width', '');
192
- }
193
- }, throttleTime.resize), []);
192
+ if (swiper.params.slidesPerView === SlidesPerView.AUTO) {
193
+ swiper.slides.css('width', '');
194
+ }
195
+ }, throttleTime.resize);
196
+ }, []);
194
197
 
195
198
  var handleSlideFocus = function handleSlideFocus(index) {
196
199
  return function (e) {
@@ -48,7 +48,7 @@ var Checkbox = function Checkbox(_ref) {
48
48
  var handleChange = function handleChange(e) {
49
49
  if (checkEventIsClickOrEnterPress(e) || e.type === CHANGE_KEY) {
50
50
  setIsChecked(!isChecked);
51
- onChange && onChange(!isChecked);
51
+ onChange === null || onChange === void 0 ? void 0 : onChange(!isChecked);
52
52
  }
53
53
  };
54
54
 
@@ -56,15 +56,15 @@ var Counter = function Counter(_ref) {
56
56
  }
57
57
 
58
58
  if (inputValue < min) {
59
- onChange && onChange(min);
59
+ onChange === null || onChange === void 0 ? void 0 : onChange(min);
60
60
  }
61
61
 
62
62
  if (inputValue > max) {
63
- onChange && onChange(max);
63
+ onChange === null || onChange === void 0 ? void 0 : onChange(max);
64
64
  }
65
65
 
66
66
  if (inputValue >= min && inputValue <= max) {
67
- onChange && onChange(inputValue);
67
+ onChange === null || onChange === void 0 ? void 0 : onChange(inputValue);
68
68
  }
69
69
  }, [min, max, onChange, isControlled]);
70
70
  var handleMinusClick = React.useCallback(function () {
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  export interface ILinkProps {
3
3
  /** Дополнительный класс корневого элемента */
4
4
  className?: string;