@megafon/ui-core 2.5.0 → 3.0.0-beta.11

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 (213) hide show
  1. package/CHANGELOG.md +156 -9
  2. package/dist/es/colors/ColorItem/ColorItem.css +1 -8
  3. package/dist/es/colors/ColorItem/ColorItem.js +1 -1
  4. package/dist/es/colors/Colors.css +3 -11
  5. package/dist/es/colors/Colors.d.ts +2 -2
  6. package/dist/es/colors/Colors.js +64 -4
  7. package/dist/es/colors/colorsData.js +78 -71
  8. package/dist/es/components/Accordion/Accordion.css +7 -27
  9. package/dist/es/components/Accordion/Accordion.d.ts +12 -7
  10. package/dist/es/components/Accordion/Accordion.js +25 -20
  11. package/dist/es/components/Banner/Banner.css +2 -37
  12. package/dist/es/components/Banner/Banner.d.ts +10 -2
  13. package/dist/es/components/Banner/Banner.js +35 -26
  14. package/dist/es/components/Banner/BannerDot.css +4 -11
  15. package/dist/es/components/Banner/BannerDot.d.ts +3 -0
  16. package/dist/es/components/Banner/BannerDot.js +8 -3
  17. package/dist/es/components/Button/Button.css +83 -74
  18. package/dist/es/components/Button/Button.d.ts +8 -2
  19. package/dist/es/components/Button/Button.js +16 -8
  20. package/dist/es/components/Calendar/Calendar.css +0 -7
  21. package/dist/es/components/Calendar/Calendar.js +2 -3
  22. package/dist/es/components/Calendar/components/Day/Day.css +10 -17
  23. package/dist/es/components/Calendar/components/Day/Day.js +1 -1
  24. package/dist/es/components/Calendar/components/Month/Month.css +3 -10
  25. package/dist/es/components/Calendar/components/Month/Month.js +21 -5
  26. package/dist/es/components/Carousel/Carousel.css +4 -11
  27. package/dist/es/components/Carousel/Carousel.d.ts +9 -2
  28. package/dist/es/components/Carousel/Carousel.js +28 -25
  29. package/dist/es/components/Checkbox/Checkbox.css +18 -25
  30. package/dist/es/components/Checkbox/Checkbox.d.ts +11 -27
  31. package/dist/es/components/Checkbox/Checkbox.js +77 -90
  32. package/dist/es/components/Collapse/Collapse.d.ts +15 -3
  33. package/dist/es/components/Collapse/Collapse.js +11 -4
  34. package/dist/es/components/ContentArea/ContentArea.css +18 -28
  35. package/dist/es/components/ContentArea/ContentArea.d.ts +2 -7
  36. package/dist/es/components/ContentArea/ContentArea.js +5 -39
  37. package/dist/es/components/Counter/Counter.css +14 -11
  38. package/dist/es/components/Counter/Counter.js +3 -3
  39. package/dist/es/components/Grid/GridColumn.css +0 -7
  40. package/dist/es/components/Header/Header.css +8 -12
  41. package/dist/es/components/Header/Header.d.ts +7 -21
  42. package/dist/es/components/Header/Header.js +31 -67
  43. package/dist/es/components/InputLabel/InputLabel.css +0 -7
  44. package/dist/es/components/InputLabel/InputLabel.d.ts +3 -0
  45. package/dist/es/components/InputLabel/InputLabel.js +9 -4
  46. package/dist/es/components/Link/Link.d.ts +3 -3
  47. package/dist/es/components/Link/Link.js +32 -21
  48. package/dist/es/components/List/List.css +9 -13
  49. package/dist/es/components/List/List.d.ts +1 -1
  50. package/dist/es/components/List/List.js +2 -2
  51. package/dist/es/components/List/ListItem.css +0 -7
  52. package/dist/es/components/Logo/Logo.css +0 -7
  53. package/dist/es/components/Logo/Logo.js +4 -8
  54. package/dist/es/components/NavArrow/NavArrow.css +5 -12
  55. package/dist/es/components/Notification/Notification.css +41 -24
  56. package/dist/es/components/Notification/Notification.d.ts +8 -0
  57. package/dist/es/components/Notification/Notification.js +21 -4
  58. package/dist/es/components/Pagination/Pagination.css +0 -7
  59. package/dist/es/components/Pagination/Pagination.d.ts +9 -2
  60. package/dist/es/components/Pagination/Pagination.js +20 -3
  61. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
  62. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
  63. package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +12 -7
  64. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
  65. package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +10 -2
  66. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
  67. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
  68. package/dist/es/components/Pagination/helpers.d.ts +1 -1
  69. package/dist/es/components/Paragraph/Paragraph.css +10 -31
  70. package/dist/es/components/Paragraph/Paragraph.d.ts +9 -13
  71. package/dist/es/components/Paragraph/Paragraph.js +14 -40
  72. package/dist/es/components/Preloader/Preloader.css +5 -12
  73. package/dist/es/components/Preloader/Preloader.d.ts +4 -0
  74. package/dist/es/components/Preloader/Preloader.js +10 -5
  75. package/dist/es/components/RadioButton/RadioButton.css +7 -14
  76. package/dist/es/components/RadioButton/RadioButton.d.ts +8 -28
  77. package/dist/es/components/RadioButton/RadioButton.js +50 -85
  78. package/dist/es/components/Search/Search.css +20 -25
  79. package/dist/es/components/Search/Search.js +3 -4
  80. package/dist/es/components/Select/Select.css +34 -37
  81. package/dist/es/components/Select/Select.d.ts +43 -50
  82. package/dist/es/components/Select/Select.js +382 -461
  83. package/dist/es/components/Select/reducer/selectReducer.d.ts +34 -0
  84. package/dist/es/components/Select/reducer/selectReducer.js +123 -0
  85. package/dist/es/components/Switcher/Switcher.css +19 -25
  86. package/dist/es/components/Switcher/Switcher.js +1 -1
  87. package/dist/es/components/Tabs/Tab.d.ts +5 -2
  88. package/dist/es/components/Tabs/Tab.js +4 -2
  89. package/dist/es/components/Tabs/Tabs.css +30 -37
  90. package/dist/es/components/Tabs/Tabs.d.ts +8 -2
  91. package/dist/es/components/Tabs/Tabs.js +68 -105
  92. package/dist/es/components/TextField/TextField.css +27 -33
  93. package/dist/es/components/TextField/TextField.d.ts +9 -3
  94. package/dist/es/components/TextField/TextField.js +32 -24
  95. package/dist/es/components/TextLink/TextLink.css +10 -14
  96. package/dist/es/components/TextLink/TextLink.d.ts +1 -1
  97. package/dist/es/components/TextLink/TextLink.js +7 -2
  98. package/dist/es/components/Tile/Tile.css +2 -8
  99. package/dist/es/components/Tile/Tile.d.ts +5 -2
  100. package/dist/es/components/Tile/Tile.js +2 -2
  101. package/dist/es/components/Tooltip/Tooltip.css +1 -8
  102. package/dist/es/components/Tooltip/Tooltip.d.ts +8 -2
  103. package/dist/es/components/Tooltip/Tooltip.js +28 -27
  104. package/dist/es/index.d.ts +1 -0
  105. package/dist/es/index.js +1 -0
  106. package/dist/lib/colors/ColorItem/ColorItem.css +1 -8
  107. package/dist/lib/colors/ColorItem/ColorItem.js +1 -1
  108. package/dist/lib/colors/Colors.css +3 -11
  109. package/dist/lib/colors/Colors.d.ts +2 -2
  110. package/dist/lib/colors/Colors.js +63 -4
  111. package/dist/lib/colors/colorsData.js +78 -71
  112. package/dist/lib/components/Accordion/Accordion.css +7 -27
  113. package/dist/lib/components/Accordion/Accordion.d.ts +12 -7
  114. package/dist/lib/components/Accordion/Accordion.js +24 -19
  115. package/dist/lib/components/Banner/Banner.css +2 -37
  116. package/dist/lib/components/Banner/Banner.d.ts +10 -2
  117. package/dist/lib/components/Banner/Banner.js +35 -25
  118. package/dist/lib/components/Banner/BannerDot.css +4 -11
  119. package/dist/lib/components/Banner/BannerDot.d.ts +3 -0
  120. package/dist/lib/components/Banner/BannerDot.js +10 -2
  121. package/dist/lib/components/Button/Button.css +83 -74
  122. package/dist/lib/components/Button/Button.d.ts +8 -2
  123. package/dist/lib/components/Button/Button.js +16 -8
  124. package/dist/lib/components/Calendar/Calendar.css +0 -7
  125. package/dist/lib/components/Calendar/Calendar.js +3 -3
  126. package/dist/lib/components/Calendar/components/Day/Day.css +10 -17
  127. package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
  128. package/dist/lib/components/Calendar/components/Month/Month.css +3 -10
  129. package/dist/lib/components/Calendar/components/Month/Month.js +20 -4
  130. package/dist/lib/components/Carousel/Carousel.css +4 -11
  131. package/dist/lib/components/Carousel/Carousel.d.ts +9 -2
  132. package/dist/lib/components/Carousel/Carousel.js +26 -23
  133. package/dist/lib/components/Checkbox/Checkbox.css +18 -25
  134. package/dist/lib/components/Checkbox/Checkbox.d.ts +11 -27
  135. package/dist/lib/components/Checkbox/Checkbox.js +82 -125
  136. package/dist/lib/components/Collapse/Collapse.d.ts +15 -3
  137. package/dist/lib/components/Collapse/Collapse.js +13 -4
  138. package/dist/lib/components/ContentArea/ContentArea.css +18 -28
  139. package/dist/lib/components/ContentArea/ContentArea.d.ts +2 -7
  140. package/dist/lib/components/ContentArea/ContentArea.js +5 -42
  141. package/dist/lib/components/Counter/Counter.css +14 -11
  142. package/dist/lib/components/Counter/Counter.js +3 -3
  143. package/dist/lib/components/Grid/GridColumn.css +0 -7
  144. package/dist/lib/components/Header/Header.css +8 -12
  145. package/dist/lib/components/Header/Header.d.ts +7 -21
  146. package/dist/lib/components/Header/Header.js +31 -98
  147. package/dist/lib/components/InputLabel/InputLabel.css +0 -7
  148. package/dist/lib/components/InputLabel/InputLabel.d.ts +3 -0
  149. package/dist/lib/components/InputLabel/InputLabel.js +11 -3
  150. package/dist/lib/components/Link/Link.d.ts +3 -3
  151. package/dist/lib/components/Link/Link.js +44 -26
  152. package/dist/lib/components/List/List.css +9 -13
  153. package/dist/lib/components/List/List.d.ts +1 -1
  154. package/dist/lib/components/List/List.js +2 -2
  155. package/dist/lib/components/List/ListItem.css +0 -7
  156. package/dist/lib/components/Logo/Logo.css +0 -7
  157. package/dist/lib/components/Logo/Logo.js +4 -8
  158. package/dist/lib/components/NavArrow/NavArrow.css +5 -12
  159. package/dist/lib/components/Notification/Notification.css +41 -24
  160. package/dist/lib/components/Notification/Notification.d.ts +8 -0
  161. package/dist/lib/components/Notification/Notification.js +20 -3
  162. package/dist/lib/components/Pagination/Pagination.css +0 -7
  163. package/dist/lib/components/Pagination/Pagination.d.ts +9 -2
  164. package/dist/lib/components/Pagination/Pagination.js +20 -2
  165. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
  166. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
  167. package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +12 -6
  168. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
  169. package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +9 -1
  170. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
  171. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
  172. package/dist/lib/components/Pagination/helpers.d.ts +1 -1
  173. package/dist/lib/components/Paragraph/Paragraph.css +10 -31
  174. package/dist/lib/components/Paragraph/Paragraph.d.ts +9 -13
  175. package/dist/lib/components/Paragraph/Paragraph.js +15 -41
  176. package/dist/lib/components/Preloader/Preloader.css +5 -12
  177. package/dist/lib/components/Preloader/Preloader.d.ts +4 -0
  178. package/dist/lib/components/Preloader/Preloader.js +10 -4
  179. package/dist/lib/components/RadioButton/RadioButton.css +7 -14
  180. package/dist/lib/components/RadioButton/RadioButton.d.ts +8 -28
  181. package/dist/lib/components/RadioButton/RadioButton.js +51 -117
  182. package/dist/lib/components/Search/Search.css +20 -25
  183. package/dist/lib/components/Search/Search.js +3 -4
  184. package/dist/lib/components/Select/Select.css +34 -37
  185. package/dist/lib/components/Select/Select.d.ts +43 -50
  186. package/dist/lib/components/Select/Select.js +375 -483
  187. package/dist/lib/components/Select/reducer/selectReducer.d.ts +34 -0
  188. package/dist/lib/components/Select/reducer/selectReducer.js +136 -0
  189. package/dist/lib/components/Switcher/Switcher.css +19 -25
  190. package/dist/lib/components/Switcher/Switcher.js +1 -1
  191. package/dist/lib/components/Tabs/Tab.d.ts +5 -2
  192. package/dist/lib/components/Tabs/Tab.js +4 -2
  193. package/dist/lib/components/Tabs/Tabs.css +30 -37
  194. package/dist/lib/components/Tabs/Tabs.d.ts +8 -2
  195. package/dist/lib/components/Tabs/Tabs.js +68 -105
  196. package/dist/lib/components/TextField/TextField.css +27 -33
  197. package/dist/lib/components/TextField/TextField.d.ts +9 -3
  198. package/dist/lib/components/TextField/TextField.js +30 -23
  199. package/dist/lib/components/TextLink/TextLink.css +10 -14
  200. package/dist/lib/components/TextLink/TextLink.d.ts +1 -1
  201. package/dist/lib/components/TextLink/TextLink.js +7 -2
  202. package/dist/lib/components/Tile/Tile.css +2 -8
  203. package/dist/lib/components/Tile/Tile.d.ts +5 -2
  204. package/dist/lib/components/Tile/Tile.js +2 -2
  205. package/dist/lib/components/Tooltip/Tooltip.css +1 -8
  206. package/dist/lib/components/Tooltip/Tooltip.d.ts +8 -2
  207. package/dist/lib/components/Tooltip/Tooltip.js +27 -26
  208. package/dist/lib/index.d.ts +1 -0
  209. package/dist/lib/index.js +8 -0
  210. package/package.json +5 -4
  211. package/styles/base.less +2 -73
  212. package/styles/colors.css +60 -0
  213. package/styles/colorsDark.css +62 -0
package/CHANGELOG.md CHANGED
@@ -3,45 +3,192 @@
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
- # [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)
6
+ # [3.0.0-beta.11](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.10...@megafon/ui-core@3.0.0-beta.11) (2022-02-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **switcher:** fix switcher design ([ea3a6dd](https://github.com/MegafonWebLab/megafon-ui/commit/ea3a6dd602de011e1e5f19e118b9cb565f846fbf))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.0.0-beta.10](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.9...@megafon/ui-core@3.0.0-beta.10) (2022-02-08)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **paragraph:** remove spbSky... values from color prop ([4dfc14e](https://github.com/MegafonWebLab/megafon-ui/commit/4dfc14ec86d446e71a64724f201e1de720690728))
23
+
24
+
25
+ ### BREAKING CHANGES
26
+
27
+ * **paragraph:** remove from color prop values: spbSky0, spbSky1, spbSky2
28
+
29
+
30
+
31
+
32
+
33
+ # [3.0.0-beta.9](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.8...@megafon/ui-core@3.0.0-beta.9) (2022-02-08)
7
34
 
8
35
 
9
36
  ### Features
10
37
 
11
- * **tabs:** add prop outerObserveContainer for observing sticky mode from outside ([bc20c76](https://github.com/MegafonWebLab/megafon-ui/commit/bc20c76f497d88da19ea03cfc66a0c38a7559698))
38
+ * **select:** made select as a functional component ([b45e697](https://github.com/MegafonWebLab/megafon-ui/commit/b45e697de696f892a42a8fa5756289183624fed6))
39
+
12
40
 
13
41
 
14
42
 
15
43
 
44
+ # [3.0.0-beta.8](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.7...@megafon/ui-core@3.0.0-beta.8) (2022-02-08)
45
+
46
+
47
+ ### Features
16
48
 
17
- # [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)
49
+ * **accordion:** remove prop hasVerticalPaddings ([4da8d8e](https://github.com/MegafonWebLab/megafon-ui/commit/4da8d8e7ee843be266749c4e4a8e35c678b9dc2e))
50
+
51
+
52
+ ### BREAKING CHANGES
53
+
54
+ * **accordion:** remove prop hasVerticalPaddings
55
+
56
+
57
+
58
+
59
+
60
+ # [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)
18
61
 
19
62
 
20
63
  ### Bug Fixes
21
64
 
22
- * **link:** new prop dataAttrs ([bde2253](https://github.com/MegafonWebLab/megafon-ui/commit/bde22539ff0db11777be9193adceb6de0f984234))
65
+ * **components:** change tests for dataAttrs prop ([2a8f306](https://github.com/MegafonWebLab/megafon-ui/commit/2a8f3061a4e89f6877894e5947db7bae2827f86a))
23
66
 
24
67
 
25
68
  ### Features
26
69
 
27
- * **banner:** add props withPaginationBottomOffset ([c1485a0](https://github.com/MegafonWebLab/megafon-ui/commit/c1485a083d63b886419109b03bb31230c5fed890))
70
+ * **components:** add dataAttrs props in new format ([026d868](https://github.com/MegafonWebLab/megafon-ui/commit/026d8681743d55ea8c93d17000a64959093f7a05))
28
71
 
29
72
 
30
73
 
31
74
 
32
75
 
33
- # [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)
76
+ # [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)
34
77
 
35
78
 
36
79
  ### Bug Fixes
37
80
 
38
- * **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))
81
+ * color props values changes ([b279f2b](https://github.com/MegafonWebLab/megafon-ui/commit/b279f2b5af0edae92fe9825bbfa90a207cb8009a))
82
+ * remove deprecated props values ([add76f3](https://github.com/MegafonWebLab/megafon-ui/commit/add76f38a9ebad8b5b6504dfe6aae862746f0dfc))
83
+ * **colors:** rename green and purple to brandGreen and brandPurple ([2266734](https://github.com/MegafonWebLab/megafon-ui/commit/2266734336be1a0faa5f1736fdf39070442837b3))
84
+ * **core:** fix build ui-core ([458c824](https://github.com/MegafonWebLab/megafon-ui/commit/458c824aab639e4802db261d0416b3cee58ac274))
85
+ * **core:** separated colors.css file ([f0a4d72](https://github.com/MegafonWebLab/megafon-ui/commit/f0a4d728e0b30c5caeae5c8d9607e624fb4ea288))
86
+ * **textlink:** fix color prop type ([6edcea0](https://github.com/MegafonWebLab/megafon-ui/commit/6edcea06ce26d137611aaf022d3ee6f7da295366))
87
+
88
+
89
+ ### BREAKING CHANGES
90
+
91
+ * ContentArea: prop color change values from 'base' to 'white' and from 'content' to 'default';
92
+ remove depreacted value 'freshAsphalt'
93
+ Paragraph: prop color change values from 'base' to 'white' and from 'contend' to 'default';
94
+ remove deprecared values 'freshAsphalt' and 'clearWhite'
95
+ StoreBanner: prop theme change value from 'black' to 'default'; remove deprecated value 'clearWhite'
96
+ * ContentArea, Paragraph, StoreBanner and Breadcrumbs components from no don't have
97
+ freshAsphalt and clearWhite as values for colorize props
98
+
99
+
100
+
101
+
102
+
103
+ # [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)
39
104
 
40
105
 
41
106
  ### Features
42
107
 
43
- * **accordion:** props hasVerticalPaddings marked as deprecated ([4d6d4cc](https://github.com/MegafonWebLab/megafon-ui/commit/4d6d4cca2cf45a86441827f0bef625a88a2c44f8))
44
- * **textfield:** add autocomplete prop ([f2cff94](https://github.com/MegafonWebLab/megafon-ui/commit/f2cff9403503de174b785ea02365ce470811369e))
108
+ * **header:** made header as a functional component ([81701ad](https://github.com/MegafonWebLab/megafon-ui/commit/81701ad87b6e9df2fe630bf4e183383264c0bb01))
109
+ * **radiobutton:** made radiobutton as a functional component ([65406af](https://github.com/MegafonWebLab/megafon-ui/commit/65406afc90fd82f7eb0fdcbbe78569fc98164e78))
110
+
111
+
112
+
113
+
114
+
115
+ # [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)
116
+
117
+ **Note:** Version bump only for package @megafon/ui-core
118
+
119
+
120
+
121
+
122
+
123
+ # [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)
124
+
125
+
126
+ ### Bug Fixes
127
+
128
+ * **accordion:** add focus on arrow after tab press, add open/close accordion after enter press ([9bfa0ac](https://github.com/MegafonWebLab/megafon-ui/commit/9bfa0ac5348ac25c0e37a4df51e26e2dabde02ba))
129
+ * **accordion:** change type of onClickAccordion prop ([9a150c5](https://github.com/MegafonWebLab/megafon-ui/commit/9a150c5de309547763a714b0eb630dfb386a8107))
130
+ * **calendar/month:** add focus on month arrows, add enter press handlers ([63f1e47](https://github.com/MegafonWebLab/megafon-ui/commit/63f1e4761e57ed6d56464b632dce9fd5e77655e1))
131
+ * **checkbox:** add focus on custom checkbox, add enter press handler ([83d111d](https://github.com/MegafonWebLab/megafon-ui/commit/83d111d0e4b41d3915bdd079bed4a7f9715ce7a5))
132
+ * **checkbox:** add isChecked state, change type of onChange prop ([f535caf](https://github.com/MegafonWebLab/megafon-ui/commit/f535caf39a02ab6793d3c63b654a1f1f3e9b2b93))
133
+ * **tooltip:** add check event function from ui-helpers ([a784ab4](https://github.com/MegafonWebLab/megafon-ui/commit/a784ab4f288124eb941fe8f52e46b2efc9aa2f82))
134
+
135
+
136
+ ### BREAKING CHANGES
137
+
138
+ * **checkbox:** change type of onChange prop on (checked: boolean) => void
139
+ * **accordion:** remove parameter 'title' in onClickAccordion prop
140
+ * **tooltip:** change onOpen, onClose types; AccessibilityEventTypeNative from @megafon/ui-helpers
141
+
142
+
143
+
144
+
145
+
146
+ # [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)
147
+
148
+ **Note:** Version bump only for package @megafon/ui-core
149
+
150
+
151
+
152
+
153
+
154
+ # [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)
155
+
156
+
157
+ ### Bug Fixes
158
+
159
+ * **colors:** fix colors component ([3061f7c](https://github.com/MegafonWebLab/megafon-ui/commit/3061f7c7b56d5baa32f109d7ce941bcc7e70c5b9))
160
+ * **colors:** remove unused classname modifiers ([d919cdc](https://github.com/MegafonWebLab/megafon-ui/commit/d919cdcf1fa79d60230fc85811518ded1c0537ad))
161
+ * **colors:** remove unused method ([2970295](https://github.com/MegafonWebLab/megafon-ui/commit/2970295df9053a4f54ed19d3d46deb07994844e0))
162
+ * **colors:** renabe green and purple to brandGreen and brandPurple to avoid postcss-colormin bug ([563d97c](https://github.com/MegafonWebLab/megafon-ui/commit/563d97c42900099415a6872f57b500b87aeed647))
163
+ * **colors:** update color values on colors page when user switches theme ([8552ff6](https://github.com/MegafonWebLab/megafon-ui/commit/8552ff69a66153ef890437ffc4dd2e50c31d6f2e))
164
+ * **less:** import base.less file through reference ([5a13aae](https://github.com/MegafonWebLab/megafon-ui/commit/5a13aaedec3a7fd09f77dcddfe437fda604f60a5))
165
+
166
+
167
+ ### Features
168
+
169
+ * **styles:** export css version for base.less ([14aff17](https://github.com/MegafonWebLab/megafon-ui/commit/14aff17f8d3f77ec7beb2e3cb5c8a489ecd77e74))
170
+
171
+
172
+ ### BREAKING CHANGES
173
+
174
+ * **colors:** green, green20, green80, purple, purple20 and purple80 colors now have 'brand'
175
+ prefix (e.g. brandGreen)
176
+
177
+
178
+
179
+
180
+
181
+ # [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)
182
+
183
+
184
+ ### Features
185
+
186
+ * **colors:** css custom properties and color themes support ([b19a9a5](https://github.com/MegafonWebLab/megafon-ui/commit/b19a9a5112ebc7427d60f6514d606dd9d71ca444))
187
+
188
+
189
+ ### BREAKING CHANGES
190
+
191
+ * **colors:** read commit description
45
192
 
46
193
 
47
194
 
@@ -1,10 +1,3 @@
1
- h1,
2
- h2,
3
- h3,
4
- h4,
5
- h5 {
6
- margin: 0;
7
- }
8
1
  .color-item {
9
2
  display: -webkit-box;
10
3
  display: -ms-flexbox;
@@ -46,7 +39,7 @@ h5 {
46
39
  line-height: 20px;
47
40
  }
48
41
  .color-item__code {
49
- color: #33333380;
42
+ color: var(--spbSky3);
50
43
  font-size: 12px;
51
44
  line-height: 18px;
52
45
  }
@@ -23,7 +23,7 @@ var ColorItem = function ColorItem(_ref) {
23
23
  }), !!parentColorCode && /*#__PURE__*/React.createElement("div", {
24
24
  className: cn('parent-color'),
25
25
  style: {
26
- background: parentColorCode
26
+ background: "var(--".concat(parentColorCode, ")")
27
27
  }
28
28
  })), /*#__PURE__*/React.createElement("span", {
29
29
  className: cn('name')
@@ -1,14 +1,7 @@
1
- h1,
2
- h2,
3
- h3,
4
- h4,
5
- h5 {
6
- margin: 0;
7
- }
8
1
  .colors__inner {
9
2
  margin: 0 -80px;
10
3
  padding: 56px 80px 40px;
11
- background-color: #F6F6F6;
4
+ background-color: var(--spbSky0);
12
5
  }
13
6
  @media screen and (max-width: 1120px) {
14
7
  .colors__inner {
@@ -90,7 +83,6 @@ h5 {
90
83
  .colors__description {
91
84
  position: relative;
92
85
  padding-top: 15px;
93
- color: #33333380;
94
86
  font-size: 12px;
95
87
  line-height: 18px;
96
88
  text-align: center;
@@ -198,7 +190,7 @@ h5 {
198
190
  display: block;
199
191
  width: 100%;
200
192
  height: 1px;
201
- background-color: #D8D8D8;
193
+ background-color: var(--spbSky2);
202
194
  -webkit-transform: translateY(-50%);
203
195
  transform: translateY(-50%);
204
196
  }
@@ -209,7 +201,7 @@ h5 {
209
201
  position: absolute;
210
202
  width: 1px;
211
203
  height: 4px;
212
- background-color: #D8D8D8;
204
+ background-color: var(--spbSky2);
213
205
  }
214
206
  .colors__underline:after,
215
207
  .colors__underline:before {
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ /// <reference types="react" />
2
2
  import './Colors.less';
3
- declare const Colors: React.FC;
3
+ declare const Colors: () => JSX.Element;
4
4
  export default Colors;
@@ -1,7 +1,9 @@
1
1
  import "core-js/modules/es.symbol";
2
2
  import "core-js/modules/es.symbol.description";
3
+ import "core-js/modules/es.array.includes";
3
4
  import "core-js/modules/es.array.map";
4
5
  import "core-js/modules/es.function.name";
6
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
7
  import _extends from "@babel/runtime/helpers/extends";
6
8
  import * as React from 'react';
7
9
  import { cnCreate } from '@megafon/ui-helpers';
@@ -103,10 +105,68 @@ var basic = colorsData.basic,
103
105
  gradientColors = colorsData.gradientColors,
104
106
  staticColors = colorsData.staticColors,
105
107
  staticOpacity = colorsData.staticOpacity,
106
- soft = colorsData.soft;
108
+ soft = colorsData.soft; // TODO: refactor this
109
+
110
+ var getThemeFromLocalStorage = function getThemeFromLocalStorage() {
111
+ var theme = 'light';
112
+
113
+ if (typeof window !== 'undefined') {
114
+ var localStorageTheme = String(window.localStorage.getItem('theme'));
115
+
116
+ if (['light', 'dark'].includes(localStorageTheme)) {
117
+ theme = localStorageTheme;
118
+ }
119
+ }
120
+
121
+ return theme;
122
+ };
123
+
107
124
  var cn = cnCreate('colors');
108
125
 
109
126
  var Colors = function Colors() {
127
+ var _React$useState = React.useState(getThemeFromLocalStorage()),
128
+ _React$useState2 = _slicedToArray(_React$useState, 2),
129
+ setCurrentTheme = _React$useState2[1];
130
+
131
+ var _React$useState3 = React.useState(false),
132
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
133
+ setLoad = _React$useState4[1];
134
+
135
+ React.useEffect(function () {
136
+ function load() {
137
+ setLoad(true);
138
+ document.removeEventListener('css-var-load', load);
139
+ }
140
+
141
+ document.addEventListener('css-var-load', load);
142
+ }, []);
143
+
144
+ var getCurrentColorValue = function getCurrentColorValue(code) {
145
+ return typeof document !== 'undefined' ? document.documentElement.style.getPropertyValue("--".concat(code)) : '';
146
+ };
147
+
148
+ React.useEffect(function () {
149
+ // theme switcher from src/gatsby-theme-docz/components/SideBar/index.tsx
150
+ var themeSwitcher = document.querySelector('[data-current-theme]');
151
+
152
+ if (themeSwitcher) {
153
+ var themeSwitcherObserver = new MutationObserver(function (mutationsList) {
154
+ var data = mutationsList[0];
155
+ setCurrentTheme(data.oldValue === 'light' ? 'dark' : 'light');
156
+ });
157
+ var config = {
158
+ attributeOldValue: true,
159
+ attributeFilter: ['data-current-theme']
160
+ };
161
+ themeSwitcherObserver.observe(themeSwitcher, config);
162
+ return function () {
163
+ return themeSwitcherObserver.disconnect();
164
+ };
165
+ }
166
+
167
+ return undefined;
168
+ }, []);
169
+
110
170
  var renderUnderline = function renderUnderline() {
111
171
  return /*#__PURE__*/React.createElement("div", {
112
172
  className: cn('underline')
@@ -142,7 +202,7 @@ var Colors = function Colors() {
142
202
  return /*#__PURE__*/React.createElement(ColorItem, {
143
203
  className: cn('item'),
144
204
  colorName: name,
145
- colorCode: code,
205
+ colorCode: getCurrentColorValue(code),
146
206
  key: name,
147
207
  border: border
148
208
  });
@@ -172,7 +232,7 @@ var Colors = function Colors() {
172
232
  return /*#__PURE__*/React.createElement(ColorItem, {
173
233
  className: cn('item'),
174
234
  colorName: name,
175
- colorCode: code,
235
+ colorCode: getCurrentColorValue(code),
176
236
  gradient: gradient,
177
237
  key: name,
178
238
  border: border
@@ -204,7 +264,7 @@ var Colors = function Colors() {
204
264
  soft: true
205
265
  }),
206
266
  colorName: name,
207
- colorCode: code,
267
+ colorCode: getCurrentColorValue(code),
208
268
  parentColorCode: parentColor,
209
269
  key: name
210
270
  });
@@ -4,34 +4,35 @@ var colors = {
4
4
  colorsGroup: [{
5
5
  description: 'Основные цвета бренда',
6
6
  colors: [{
7
- name: 'Green',
8
- code: '#00B956'
7
+ name: 'Brand Green',
8
+ code: 'brandGreen'
9
9
  }, {
10
- name: 'Purple',
11
- code: '#731982'
10
+ name: 'Brand Purple',
11
+ code: 'brandPurple'
12
12
  }]
13
13
  }, {
14
14
  description: 'Градация оттенков серого',
15
15
  colors: [{
16
16
  name: 'Base',
17
- code: '#FFFFFF',
18
- border: '1px solid #EDEDED'
17
+ code: 'base',
18
+ border: '1px solid var(--spbSky1)'
19
19
  }, {
20
20
  name: 'Content',
21
- code: '#333333'
21
+ code: 'content',
22
+ border: '1px solid var(--spbSky1)'
22
23
  }, {
23
24
  name: 'Spb Sky 0',
24
- code: '#F6F6F6',
25
- border: '2px solid #EDEDED'
25
+ code: 'spbSky0',
26
+ border: '2px solid var(--spbSky1)'
26
27
  }, {
27
28
  name: 'Spb Sky 1',
28
- code: '#EDEDED'
29
+ code: 'spbSky1'
29
30
  }, {
30
31
  name: 'Spb Sky 2',
31
- code: '#D8D8D8'
32
+ code: 'spbSky2'
32
33
  }, {
33
34
  name: 'Spb Sky 3',
34
- code: '#999999'
35
+ code: 'spbSky3'
35
36
  }]
36
37
  }]
37
38
  },
@@ -41,16 +42,16 @@ var colors = {
41
42
  description: 'Акцентные цвета',
42
43
  colors: [{
43
44
  name: 'Warm Red C',
44
- code: '#EB5A40'
45
+ code: 'warmRedC'
45
46
  }, {
46
47
  name: '137C',
47
- code: '#FFA717'
48
+ code: '137C'
48
49
  }, {
49
50
  name: '311C',
50
- code: '#5BD9E5'
51
+ code: '311C'
51
52
  }, {
52
53
  name: 'Reflex Blue',
53
- code: '#444189'
54
+ code: 'reflexBlue'
54
55
  }]
55
56
  }
56
57
  },
@@ -60,22 +61,22 @@ var colors = {
60
61
  description: 'Системные цвета, используемые для отображения состояний интерфейсов и ссылок',
61
62
  colors: [{
62
63
  name: 'Fury',
63
- code: '#F62434'
64
+ code: 'fury'
64
65
  }, {
65
66
  name: 'System Blue',
66
- code: '#34AAF2'
67
+ code: 'systemBlue'
67
68
  }, {
68
69
  name: 'Background',
69
- code: '#FFFFFF'
70
+ code: 'background'
70
71
  }, {
71
72
  name: 'Button Hov. G.',
72
- code: '#10E272'
73
+ code: 'buttonHoverGreen'
73
74
  }, {
74
75
  name: 'Button Hov. P.',
75
- code: '#A500BF'
76
+ code: 'buttonhoverPurple'
76
77
  }, {
77
78
  name: 'Button Down',
78
- code: '#404D46'
79
+ code: 'buttonDown'
79
80
  }]
80
81
  }
81
82
  },
@@ -85,15 +86,15 @@ var colors = {
85
86
  description: 'Градиентные заливки ',
86
87
  colors: [{
87
88
  name: 'Basic',
88
- code: '#01873F #00B956 #14CD6A',
89
+ code: 'gradientBasic',
89
90
  gradient: 'linear-gradient(90deg, #01873F 0%, #00B956 74%, #14CD6A 100%)'
90
91
  }, {
91
92
  name: 'VIP',
92
- code: '#5B1168 #731982 #821E93',
93
+ code: 'gradientVIP',
93
94
  gradient: 'linear-gradient(90deg, #5B1168 0%, #731982 74%, #821E93 100%)'
94
95
  }, {
95
96
  name: 'Exclusive',
96
- code: '#2A2674 #444189 #504D93',
97
+ code: 'gradientExclusive',
97
98
  gradient: 'linear-gradient(90deg, #2A2674 0%, #444189 74%, #504D93 100%)'
98
99
  }]
99
100
  }
@@ -104,11 +105,12 @@ var colors = {
104
105
  description: 'Цвета не зависящие от темы',
105
106
  colors: [{
106
107
  name: 'STC White',
107
- code: '#FFFFFFF',
108
- border: '1px solid #EDEDED'
108
+ code: 'stcWhite',
109
+ border: '1px solid var(--spbSky1)'
109
110
  }, {
110
111
  name: 'STC Black',
111
- code: '#333333'
112
+ code: 'stcBlack',
113
+ border: '1px solid var(--spbSky1)'
112
114
  }]
113
115
  }
114
116
  },
@@ -118,31 +120,36 @@ var colors = {
118
120
  description: 'Цвета c прозрачностью не зависящие от темы',
119
121
  colors: [{
120
122
  name: 'STC White 5%',
121
- code: '#FFFFFF0D',
122
- border: '1px solid #EDEDED'
123
+ code: 'stcWhite5',
124
+ border: '1px solid var(--spbSky1)'
123
125
  }, {
124
126
  name: 'STC White 10%',
125
- code: '#FFFFFF1A',
126
- border: '1px solid #EDEDED'
127
+ code: 'stcWhite10',
128
+ border: '1px solid var(--spbSky1)'
127
129
  }, {
128
130
  name: 'STC White 20%',
129
- code: '#FFFFFF33',
130
- border: '1px solid #EDEDED'
131
+ code: 'stcWhite20',
132
+ border: '1px solid var(--spbSky1)'
131
133
  }, {
132
134
  name: 'STC White 50%',
133
- code: '#FFFFFF80'
135
+ code: 'stcWhite50',
136
+ border: '1px solid var(--spbSky1)'
134
137
  }, {
135
138
  name: 'STC Black 5%',
136
- code: '#3333330D'
139
+ code: 'stcBlack5',
140
+ border: '1px solid var(--spbSky1)'
137
141
  }, {
138
142
  name: 'STC Black 10%',
139
- code: '#3333331A'
143
+ code: 'stcBlack10',
144
+ border: '1px solid var(--spbSky1)'
140
145
  }, {
141
146
  name: 'STC Black 20%',
142
- code: '#33333333'
147
+ code: 'stcBlack20',
148
+ border: '1px solid var(--spbSky1)'
143
149
  }, {
144
150
  name: 'STC Black 50%',
145
- code: '#33333380'
151
+ code: 'stcBlack50',
152
+ border: '1px solid var(--spbSky1)'
146
153
  }]
147
154
  }
148
155
  },
@@ -151,61 +158,61 @@ var colors = {
151
158
  colorsList: {
152
159
  description: 'Дополнительная (вспомогательная) палитра, образованная от Basic, Secondary и System цветов. Каждый цвет из Soft палитры работает в паре с его родительским цветом.',
153
160
  colors: [{
154
- name: 'Green 80',
155
- code: '#0CDC78',
156
- parentColor: '#00B956'
161
+ name: 'Brand Green 80',
162
+ code: 'brandGreen80',
163
+ parentColor: 'green'
157
164
  }, {
158
- name: 'Purple 80',
159
- code: '#AA67C1',
160
- parentColor: '#731982'
165
+ name: 'Brand Purple 80',
166
+ code: 'brandPurple80',
167
+ parentColor: 'purple'
161
168
  }, {
162
169
  name: 'Warm Red C 80',
163
- code: '#FF765D',
164
- parentColor: '#EB5A40'
170
+ code: 'warmRedC80',
171
+ parentColor: 'warmRedC'
165
172
  }, {
166
173
  name: '137C 80',
167
- code: '#FFB945',
168
- parentColor: '#FFB945'
174
+ code: '137C80',
175
+ parentColor: '137C'
169
176
  }, {
170
177
  name: '311C 80',
171
- code: '#62E3FF',
172
- parentColor: '#5BD9E5'
178
+ code: '311C80',
179
+ parentColor: '311C'
173
180
  }, {
174
181
  name: 'Reflex Blue 80',
175
- code: '#554FC9',
176
- parentColor: '#444189'
182
+ code: 'reflexBlue80',
183
+ parentColor: 'reflexBlue'
177
184
  }, {
178
185
  name: 'Fury 80',
179
- code: '#F8505D',
180
- parentColor: '#F62434'
186
+ code: 'fury80',
187
+ parentColor: 'fury'
181
188
  }, {
182
- name: 'Green 20',
183
- code: '#DDFFEC',
184
- parentColor: '#00B956'
189
+ name: 'Brand Green 20',
190
+ code: 'brandGreen20',
191
+ parentColor: 'green'
185
192
  }, {
186
- name: 'Purple 20',
187
- code: '#FFEEFF',
188
- parentColor: '#731982'
193
+ name: 'Brand Purple 20',
194
+ code: 'brandPurple20',
195
+ parentColor: 'purple'
189
196
  }, {
190
197
  name: 'Warm Red C 20',
191
- code: '#FFCFC7',
192
- parentColor: '#EB5A40'
198
+ code: 'warmRedC20',
199
+ parentColor: 'warmRedC'
193
200
  }, {
194
201
  name: '137C 20',
195
- code: '#FFEDD1',
196
- parentColor: '#FFB945'
202
+ code: '137C20',
203
+ parentColor: '137C'
197
204
  }, {
198
205
  name: '311C 20',
199
- code: '#E1FAFF',
200
- parentColor: '#5BD9E5'
206
+ code: '311C20',
207
+ parentColor: '311C'
201
208
  }, {
202
209
  name: 'Reflex Blue 20',
203
- code: '#EBEAFF',
204
- parentColor: '#444189'
210
+ code: 'reflexBlue20',
211
+ parentColor: 'reflexBlue'
205
212
  }, {
206
213
  name: 'Fury 20',
207
- code: '#FFC5C9',
208
- parentColor: '#F62434'
214
+ code: 'fury20',
215
+ parentColor: 'fury'
209
216
  }]
210
217
  }
211
218
  }