@jetbrains/kotlin-web-site-ui 4.2.0-alpha.3 → 4.2.0

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 (30) hide show
  1. package/out/components/footer/index.css +3 -6
  2. package/out/components/header/full-search/full-search.js +1 -8
  3. package/out/components/header/header.js +31 -13
  4. package/out/components/header/index.css +84 -120
  5. package/out/components/header/index.js +1 -1
  6. package/out/components/header/logo-small/logo-small.js +1 -1
  7. package/out/components/header/menu-popup/menu-button/close-icon.svg.js +35 -0
  8. package/out/components/header/menu-popup/menu-button/hamburger-icon.svg.js +35 -0
  9. package/out/components/header/menu-popup/menu-button/menu-button.js +5 -8
  10. package/out/components/header/menu-popup/menu-popup.js +42 -2
  11. package/out/components/header/menu-popup/menu-popup.module.pcss.js +4 -0
  12. package/out/components/header/nav-scheme.js +3 -9
  13. package/out/components/header/quick-search/list/list.js +5 -3
  14. package/out/components/header/quick-search/quick-search.js +12 -5
  15. package/out/components/header/quick-search/quick-search.module.pcss.js +2 -1
  16. package/out/components/header/quick-search/result/result.js +1 -1
  17. package/out/components/header/search-box/search-box.js +5 -3
  18. package/out/components/header/search-button/search-button.js +2 -13
  19. package/out/components/header/search-button/search-button.module.pcss.js +1 -2
  20. package/out/components/top-menu/dropdown-menu/dropdown-menu.js +10 -30
  21. package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +2 -3
  22. package/out/components/top-menu/index.css +100 -103
  23. package/out/components/top-menu/top-menu.js +11 -17
  24. package/out/components/typography/index.css +1 -2
  25. package/out/components/youtube-player/index.css +1 -2
  26. package/package.json +2 -2
  27. package/out/components/header/menu-popup/menu-list/menu-list.js +0 -33
  28. package/out/components/header/menu-popup/menu-list/menu-list.module.pcss.js +0 -4
  29. package/out/components/header/menu-popup/menu-list-item/menu-list-item.js +0 -28
  30. package/out/components/header/menu-popup/menu-list-item/menu-list-item.module.pcss.js +0 -7
@@ -4,17 +4,19 @@ import { useTextStyles } from '@rescui/typography';
4
4
  import classNames from 'classnames';
5
5
  import { isMacOs } from '../../is-macos.js';
6
6
  import styles from './list.module.pcss.js';
7
+ import { SearchResultView } from '../../header.js';
7
8
 
8
9
  const ResultsList = ({
9
10
  results,
10
11
  searchString,
11
- toggleFullSearch
12
+ toggleFullSearch,
13
+ resultListViewType
12
14
  }) => {
13
15
  const textCn = useTextStyles();
14
16
  return React__default.createElement("div", {
15
- className: styles.results,
17
+ className: classNames(styles.results),
16
18
  "data-test": 'quick-search-results'
17
- }, results.length ? React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
19
+ }, results.length ? React__default.createElement(React__default.Fragment, null, resultListViewType === SearchResultView.Narrow && React__default.createElement("div", {
18
20
  className: styles.topBar
19
21
  }, React__default.createElement("div", {
20
22
  className: classNames(textCn('rs-text-3'), styles.searchString)
@@ -1,5 +1,6 @@
1
1
  import React__default from 'react';
2
2
  import { ThemeProvider } from '@rescui/ui-contexts';
3
+ import classNames from 'classnames';
3
4
  import { ResultsList } from './list/list.js';
4
5
  import { EmptyResult } from './empty/empty.js';
5
6
  import { LoadingResults } from './loading/loading.js';
@@ -9,13 +10,18 @@ const QuickSearch = ({
9
10
  results,
10
11
  searchString,
11
12
  toggleFullSearch,
12
- placeholder
13
+ placeholder,
14
+ quickSearchBoxViewType
13
15
  }) => {
16
+ const wrapperClassName = classNames(styles.wrapper, {
17
+ [styles.apiReferenceWrapper]: quickSearchBoxViewType
18
+ });
19
+
14
20
  if (placeholder) {
15
21
  return React__default.createElement(ThemeProvider, {
16
22
  theme: 'dark'
17
23
  }, React__default.createElement("div", {
18
- className: styles.wrapper
24
+ className: wrapperClassName
19
25
  }, React__default.createElement(EmptyResult, {
20
26
  placeholder: placeholder
21
27
  })));
@@ -25,16 +31,17 @@ const QuickSearch = ({
25
31
  return React__default.createElement(ThemeProvider, {
26
32
  theme: 'dark'
27
33
  }, React__default.createElement("div", {
28
- className: styles.wrapper
34
+ className: wrapperClassName
29
35
  }, React__default.createElement(ResultsList, {
30
36
  results: results,
31
37
  searchString: searchString,
32
- toggleFullSearch: toggleFullSearch
38
+ toggleFullSearch: toggleFullSearch,
39
+ resultListViewType: quickSearchBoxViewType
33
40
  })));
34
41
  }
35
42
 
36
43
  return React__default.createElement("div", {
37
- className: styles.wrapper
44
+ className: wrapperClassName
38
45
  }, React__default.createElement(LoadingResults, null));
39
46
  };
40
47
 
@@ -1,4 +1,5 @@
1
1
  var styles = {
2
- "wrapper": "ktl-quick-search-module_wrapper_kkbQQ"
2
+ "wrapper": "ktl-quick-search-module_wrapper_kkbQQ",
3
+ "apiReferenceWrapper": "ktl-quick-search-module_apiReferenceWrapper_jv98t"
3
4
  };
4
5
  export { styles as default };
@@ -6,7 +6,7 @@ const Result = ({
6
6
  hit
7
7
  }) => {
8
8
  const textCn = useTextStyles();
9
- const hitTitle = hit.title === hit.mainTitle ? hit.highlightedTitle : `${hit.mainTitle}: ${hit.highlightedTitle}`;
9
+ const hitTitle = !hit.mainTitle || hit.title === hit.mainTitle ? hit.highlightedTitle : `${hit.mainTitle}: ${hit.highlightedTitle}`;
10
10
  return React__default.createElement("a", {
11
11
  className: styles.result,
12
12
  href: hit.url
@@ -11,13 +11,14 @@ const SearchBox = ({
11
11
  closeHandler,
12
12
  isMobile,
13
13
  fullSearchActive,
14
- setFullSearchActive
14
+ setFullSearchActive,
15
+ searchBoxViewType
15
16
  }) => {
16
17
  const [searchInput, setSearchInput] = useState('');
17
18
  const {
18
19
  hits,
19
20
  placeholder
20
- } = useSearch(searchInput, 25);
21
+ } = useSearch(searchInput, fullSearchActive ? 25 : 75);
21
22
  const escHandler = useCallback(event => {
22
23
  if (event.keyCode === ESC_CODE) {
23
24
  closeHandler();
@@ -62,7 +63,8 @@ const SearchBox = ({
62
63
  results: hits,
63
64
  searchString: searchInput,
64
65
  toggleFullSearch: toggleFullSearch,
65
- placeholder: placeholder
66
+ placeholder: placeholder,
67
+ quickSearchBoxViewType: searchBoxViewType
66
68
  }), fullSearchActive && React__default.createElement(FullSearch, {
67
69
  toggleFullSearch: toggleFullSearch,
68
70
  searchString: searchInput,
@@ -2,15 +2,13 @@ import React__default from 'react';
2
2
  import styles from './search-button.module.pcss.js';
3
3
  import classNames from 'classnames';
4
4
  import SvgSearch from './search.svg.js';
5
- import { SearchIcon } from '@rescui/icons';
6
- import Button from '@rescui/button';
7
5
  const DATA_TEST_HEADER_SEARCH_BUTTON = 'header-search-button';
8
6
 
9
7
  const SearchButton = ({
10
8
  onClick,
11
9
  isActive
12
10
  }) => {
13
- return React__default.createElement(React__default.Fragment, null, React__default.createElement("button", {
11
+ return React__default.createElement("button", {
14
12
  type: "button",
15
13
  className: classNames(styles.button, {
16
14
  [styles.active]: isActive
@@ -18,16 +16,7 @@ const SearchButton = ({
18
16
  "data-test": DATA_TEST_HEADER_SEARCH_BUTTON,
19
17
  "aria-label": "Search",
20
18
  onClick: onClick
21
- }, React__default.createElement(SvgSearch, null)), React__default.createElement("div", {
22
- className: styles.mobileButton
23
- }, React__default.createElement(Button, {
24
- "data-test": DATA_TEST_HEADER_SEARCH_BUTTON,
25
- "aria-label": "Search",
26
- onClick: onClick,
27
- mode: 'clear',
28
- size: 'l',
29
- icon: React__default.createElement(SearchIcon, null)
30
- })));
19
+ }, React__default.createElement(SvgSearch, null));
31
20
  };
32
21
 
33
22
  export { DATA_TEST_HEADER_SEARCH_BUTTON, SearchButton };
@@ -1,6 +1,5 @@
1
1
  var styles = {
2
2
  "button": "ktl-search-button-module_button_YHJPv",
3
- "active": "ktl-search-button-module_active_lUmdh",
4
- "mobileButton": "ktl-search-button-module_mobileButton_KT2YP"
3
+ "active": "ktl-search-button-module_active_lUmdh"
5
4
  };
6
5
  export { styles as default };
@@ -1,13 +1,10 @@
1
- import React__default, { useState, useRef, useEffect, useCallback } from 'react';
1
+ import React__default, { useState } from 'react';
2
2
  import ReactDOM from 'react-dom';
3
3
  import classNames from 'classnames';
4
4
  import styles from './dropdown-menu.module.pcss.js';
5
5
  import { useTextStyles } from '@rescui/typography';
6
6
  import SvgArrowDropdownIcon from './arrow-dropdown-icon.svg.js';
7
7
  import { useTheme } from '@rescui/ui-contexts';
8
- import Button from '@rescui/button';
9
- import { CloseIcon } from '@rescui/icons';
10
- import { clearAllBodyScrollLocks, enableBodyScroll, disableBodyScroll } from 'body-scroll-lock';
11
8
 
12
9
  const DropdownMenu = ({
13
10
  homeUrl,
@@ -20,14 +17,11 @@ const DropdownMenu = ({
20
17
  }) => {
21
18
  const theme = useTheme();
22
19
  const textCn = useTextStyles();
23
- const [portalRoot, setPortalRoot] = useState(null);
24
- const navRef = useRef(null);
25
- useEffect(() => {
20
+ const [portalRoot, setPortalRoot] = React__default.useState(null);
21
+ React__default.useEffect(() => {
26
22
  if (typeof document !== `undefined`) {
27
23
  setPortalRoot(document.body);
28
24
  }
29
-
30
- return clearAllBodyScrollLocks;
31
25
  }, []);
32
26
 
33
27
  let _items = (mobileOverview ? [{
@@ -39,43 +33,29 @@ const DropdownMenu = ({
39
33
 
40
34
  const activeItem = _items[_activeIndex];
41
35
  const [isExpanded, setIsExpanded] = useState(false);
42
- const handleClick = useCallback(() => {
43
- if (navRef.current) {
44
- isExpanded ? enableBodyScroll(navRef.current) : disableBodyScroll(navRef.current);
45
- }
46
36
 
47
- setIsExpanded(!isExpanded);
48
- }, [isExpanded, navRef]);
37
+ const handleClick = () => setIsExpanded(!isExpanded);
38
+
49
39
  return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
50
40
  className: classNames(styles.dropdownMenu, {
51
41
  [styles.dropdownMenuExpanded]: isExpanded
52
- })
42
+ }),
43
+ onClick: handleClick
53
44
  }, React__default.createElement("button", {
54
45
  className: classNames(styles.button, textCn('rs-text-2')),
55
- "aria-haspopup": "true",
56
- onClick: handleClick
46
+ "aria-haspopup": "true"
57
47
  }, React__default.createElement("span", {
58
48
  className: styles.buttonText
59
49
  }, activeItem.title), React__default.createElement(SvgArrowDropdownIcon, {
60
50
  className: styles.icon
61
51
  })), React__default.createElement("nav", {
62
- ref: navRef,
63
52
  className: classNames(styles.dropdownList, {
64
53
  [styles.dropdownListDarkTheme]: theme === 'dark'
65
54
  })
66
- }, React__default.createElement("div", {
67
- className: styles.dropdownHeader
68
- }, React__default.createElement("div", {
69
- className: textCn('rs-text-2')
70
- }, title), React__default.createElement(Button, {
71
- mode: 'clear',
72
- size: 'l',
73
- icon: React__default.createElement(CloseIcon, null),
74
- onClick: handleClick
75
- })), _items.map((item, index) => React__default.createElement("a", {
55
+ }, _items.map((item, index) => React__default.createElement("a", {
76
56
  key: item.url,
77
57
  href: item.url,
78
- className: classNames(styles.dropdownItem, textCn('rs-text-1'), {
58
+ className: classNames(styles.dropdownItem, textCn('rs-text-2'), {
79
59
  [styles.dropdownItemActive]: index === _activeIndex
80
60
  }),
81
61
  onClick: event => linkHandler?.(event, item.url),
@@ -1,14 +1,13 @@
1
1
  var styles = {
2
- "overlay": "ktl-dropdown-menu-module_overlay_segRo",
3
- "fadein": "ktl-dropdown-menu-module_fadein_MySnq",
4
2
  "dropdownMenu": "ktl-dropdown-menu-module_dropdown-menu_tq2uU",
5
3
  "button": "ktl-dropdown-menu-module_button_OYsuv",
6
4
  "buttonText": "ktl-dropdown-menu-module_button-text_SJmh-",
7
5
  "icon": "ktl-dropdown-menu-module_icon_GGhMI",
8
- "dropdownHeader": "ktl-dropdown-menu-module_dropdown-header_fa92T",
9
6
  "dropdownList": "ktl-dropdown-menu-module_dropdown-list_Ylkvt",
7
+ "fadein": "ktl-dropdown-menu-module_fadein_MySnq",
10
8
  "dropdownItem": "ktl-dropdown-menu-module_dropdown-item_X3tZ-",
11
9
  "dropdownItemActive": "ktl-dropdown-menu-module_dropdown-item-active_99q9X",
10
+ "overlay": "ktl-dropdown-menu-module_overlay_segRo",
12
11
  "overlayVisible": "ktl-dropdown-menu-module_overlay-visible_MjwEF",
13
12
  "dropdownMenuExpanded": "ktl-dropdown-menu-module_dropdown-menu-expanded_EQefy",
14
13
  "dropdownListDarkTheme": "ktl-dropdown-menu-module_dropdown-list-dark-theme_P60ol"
@@ -13,8 +13,7 @@
13
13
  --ktl-overlay-z-index: 900;
14
14
  --ktl-top-menu-z-index: 905;
15
15
  --ktl-header-z-index: 906;
16
- --ktl-mobile-dropdown-list-z-index: 907;
17
- --ktl-header-height-mobile: 52px;
16
+ --ktl-header-height-mobile: 48px;
18
17
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
19
18
  --rs-font-family-ui: var(--ktl-font-family-inter);
20
19
  }
@@ -30,6 +29,7 @@
30
29
  height: 64px;
31
30
  background: #ffffff;
32
31
  padding: 0 32px;
32
+ z-index: var(--ktl-top-menu-z-index);
33
33
  box-shadow: inset 0 -1px 0 0 var(--ktl-light-dark-20);
34
34
  transition: color var(--ktl-transition-fast),
35
35
  background-color var(--ktl-transition-fast);
@@ -48,7 +48,7 @@
48
48
 
49
49
  @media (max-width: 640px) {
50
50
  .ktl-top-menu-module_top-menu_PRX9X {
51
- height: var(--ktl-header-height-mobile);
51
+ height: 48px;
52
52
  padding: 0 16px;
53
53
  grid-gap: 16px;
54
54
  grid-template-columns: 1fr auto;
@@ -75,6 +75,12 @@
75
75
  color: var(--ktl-color-primary-light-theme);
76
76
  }
77
77
 
78
+ @media (max-width: 640px) {
79
+ .ktl-horizontal-menu-module_horizontal-menu_pB2-S {
80
+ display: none;
81
+ }
82
+ }
83
+
78
84
  :root {
79
85
  --ktl-light-grey: #f4f4f4;
80
86
  --ktl-dark-100: rgba(39, 40, 44, 1);
@@ -90,149 +96,140 @@
90
96
  --ktl-overlay-z-index: 900;
91
97
  --ktl-top-menu-z-index: 905;
92
98
  --ktl-header-z-index: 906;
93
- --ktl-mobile-dropdown-list-z-index: 907;
94
- --ktl-header-height-mobile: 52px;
99
+ --ktl-header-height-mobile: 48px;
95
100
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
96
101
  --rs-font-family-ui: var(--ktl-font-family-inter);
97
102
  }
98
103
 
99
- .ktl-dropdown-menu-module_overlay_segRo {
100
- display: none;
101
- position: fixed;
102
- top: 0;
103
- right: 0;
104
- bottom: 0;
105
- left: 0;
106
- width: 100%;
107
- height: 100%;
108
- opacity: 0;
109
- background-color: var(--ktl-color-dark-40);
110
- z-index: var(--ktl-overlay-z-index);
111
- -webkit-animation: ktl-dropdown-menu-module_fadein_MySnq ease-out var(--ktl-transition-fast) forwards;
112
- animation: ktl-dropdown-menu-module_fadein_MySnq ease-out var(--ktl-transition-fast) forwards;
113
- }
114
-
115
104
  .ktl-dropdown-menu-module_dropdown-menu_tq2uU {
116
- display: block;
117
- height: 100%;
118
- justify-self: flex-start;
119
- white-space: nowrap;
120
- width: 100%;
121
- min-width: 0;
122
- max-width: 100%;
105
+ display: none;
106
+ height: 100%;
107
+ justify-self: flex-start;
108
+ white-space: nowrap;
109
+ min-width: 0;
110
+ max-width: 100%;
123
111
  }
124
112
 
125
113
  .ktl-dropdown-menu-module_button_OYsuv {
126
- border: none;
127
- background: none;
128
- height: 100%;
129
- width: 100%;
130
- max-width: 100%;
131
- padding: 0;
132
- margin: 0;
133
- display: flex;
134
- align-items: center;
135
- cursor: pointer;
114
+ border: none;
115
+ background: none;
116
+ height: 100%;
117
+ max-width: 100%;
118
+ padding: 0;
119
+ margin: 0;
120
+ display: flex;
121
+ align-items: center;
122
+ justify-content: space-between;
123
+ cursor: pointer;
136
124
  }
137
125
 
138
126
  .ktl-dropdown-menu-module_button-text_SJmh- {
139
- overflow: hidden;
140
- text-overflow: ellipsis;
141
- flex: 0 1 auto;
127
+ overflow: hidden;
128
+ text-overflow: ellipsis;
129
+ flex: 0 1 auto;
142
130
  }
143
131
 
144
132
  .ktl-dropdown-menu-module_icon_GGhMI {
145
- width: 12px;
146
- height: 6px;
147
- margin-left: 6px;
148
- transition: transform ease-in-out var(--ktl-transition-xfast);
149
- flex: 0 0 auto;
150
- }
151
-
152
- .ktl-dropdown-menu-module_dropdown-header_fa92T {
153
- display: flex;
154
- color: #ffffff;
155
- align-items: center;
156
- height: var(--ktl-header-height-mobile);
157
- padding: 0 0 0 16px;
158
- border-bottom: 1px solid rgba(255, 255, 255, 0.3);
159
- justify-content: space-between;
133
+ width: 12px;
134
+ height: 6px;
135
+ margin-left: 6px;
136
+ transition: transform ease-in-out var(--ktl-transition-xfast);
137
+ flex: 0 0 auto;
160
138
  }
161
139
 
162
140
  .ktl-dropdown-menu-module_dropdown-list_Ylkvt {
163
- display: none;
164
- position: fixed;
165
- top: 0;
166
- left: 0;
167
- right: 0;
168
- bottom: 0;
169
- background: #ffffff;
170
- opacity: 0;
171
- -webkit-animation: ktl-dropdown-menu-module_fadein_MySnq ease-out var(--ktl-transition-fast) forwards;
172
- animation: ktl-dropdown-menu-module_fadein_MySnq ease-out var(--ktl-transition-fast) forwards;
173
- z-index: var(--ktl-mobile-dropdown-list-z-index);
141
+ display: none;
142
+ position: absolute;
143
+ left: 0;
144
+ right: 0;
145
+ background: #ffffff;
146
+ opacity: 0;
147
+ -webkit-animation: ktl-dropdown-menu-module_fadein_MySnq ease-out var(--ktl-transition-fast) forwards;
148
+ animation: ktl-dropdown-menu-module_fadein_MySnq ease-out var(--ktl-transition-fast) forwards;
174
149
  }
175
150
 
176
151
  .ktl-dropdown-menu-module_dropdown-item_X3tZ- {
177
- padding: 12px 16px;
178
- text-decoration: none;
179
- transition: color var(--ktl-transition-xfast),
152
+ padding: 8px 16px;
153
+ text-decoration: none;
154
+ transition: color var(--ktl-transition-xfast),
180
155
  background-color var(--ktl-transition-xfast);
181
156
  }
182
157
 
183
158
  .ktl-dropdown-menu-module_dropdown-item_X3tZ-:hover {
184
- background: rgba(39, 40, 44, 0.1);
185
- color: #27282c;
186
- }
159
+ background: rgba(39, 40, 44, 0.1);
160
+ color: #27282c;
161
+ }
187
162
 
188
163
  .ktl-dropdown-menu-module_dropdown-item_X3tZ-.ktl-dropdown-menu-module_dropdown-item-active_99q9X {
189
- background: var(--ktl-dark-100);
190
- color: #ffffff;
191
- }
164
+ background: var(--ktl-dark-100);
165
+ color: #ffffff;
166
+ }
167
+
168
+ .ktl-dropdown-menu-module_overlay_segRo {
169
+ display: none;
170
+ position: fixed;
171
+ top: 0;
172
+ right: 0;
173
+ bottom: 0;
174
+ left: 0;
175
+ width: 100%;
176
+ height: 100%;
177
+ opacity: 0;
178
+ background-color: var(--ktl-color-dark-40);
179
+ z-index: var(--ktl-overlay-z-index);
180
+ -webkit-animation: ktl-dropdown-menu-module_fadein_MySnq ease-out var(--ktl-transition-fast) forwards;
181
+ animation: ktl-dropdown-menu-module_fadein_MySnq ease-out var(--ktl-transition-fast) forwards;
182
+ }
192
183
 
193
184
  .ktl-dropdown-menu-module_overlay-visible_MjwEF {
194
- display: block;
195
- opacity: 1;
185
+ display: block;
186
+ opacity: 1;
196
187
  }
197
188
 
198
189
  .ktl-dropdown-menu-module_dropdown-menu-expanded_EQefy .ktl-dropdown-menu-module_icon_GGhMI {
199
- transform: scale(1, -1);
200
- }
190
+ transform: scale(1, -1);
191
+ }
201
192
 
202
193
  .ktl-dropdown-menu-module_dropdown-menu-expanded_EQefy .ktl-dropdown-menu-module_dropdown-list_Ylkvt {
203
- display: flex;
204
- flex-direction: column;
205
- opacity: 1;
206
- }
194
+ display: flex;
195
+ flex-direction: column;
196
+ opacity: 1;
197
+ }
207
198
 
208
199
  .ktl-dropdown-menu-module_dropdown-list-dark-theme_P60ol {
209
- background: rgba(39, 40, 44, 1);
200
+ background: var(--ktl-dark-bg-hard);
210
201
  }
211
202
 
212
203
  .ktl-dropdown-menu-module_dropdown-list-dark-theme_P60ol .ktl-dropdown-menu-module_dropdown-item_X3tZ-:hover {
213
- background: rgba(255, 255, 255, 0.1);
214
- color: #ffffff;
215
- }
204
+ background: rgba(255, 255, 255, 0.1);
205
+ color: #ffffff;
206
+ }
216
207
 
217
208
  .ktl-dropdown-menu-module_dropdown-list-dark-theme_P60ol .ktl-dropdown-menu-module_dropdown-item_X3tZ-.ktl-dropdown-menu-module_dropdown-item-active_99q9X {
218
- color: var(--ktl-light-text-hard);
219
- background: #ffffff;
220
- }
209
+ color: var(--ktl-light-text-hard);
210
+ background: #ffffff;
211
+ }
212
+
213
+ @media (max-width: 640px) {
214
+ .ktl-dropdown-menu-module_dropdown-menu_tq2uU {
215
+ display: block;
216
+ }
217
+ }
221
218
 
222
219
  @-webkit-keyframes ktl-dropdown-menu-module_fadein_MySnq {
223
- 0% {
224
- opacity: 0;
225
- }
226
- 100% {
227
- opacity: 1;
228
- }
220
+ 0% {
221
+ opacity: 0;
222
+ }
223
+ 100% {
224
+ opacity: 1;
225
+ }
229
226
  }
230
227
 
231
228
  @keyframes ktl-dropdown-menu-module_fadein_MySnq {
232
- 0% {
233
- opacity: 0;
234
- }
235
- 100% {
236
- opacity: 1;
237
- }
229
+ 0% {
230
+ opacity: 0;
231
+ }
232
+ 100% {
233
+ opacity: 1;
234
+ }
238
235
  }
@@ -1,13 +1,12 @@
1
- import React__default, { forwardRef, useRef, useImperativeHandle, useState, useLayoutEffect } from 'react';
1
+ import React__default from 'react';
2
2
  import { useTheme } from '@rescui/ui-contexts';
3
3
  import classNames from 'classnames';
4
4
  import styles from './top-menu.module.pcss.js';
5
5
  import { useTextStyles } from '@rescui/typography';
6
6
  import { HorizontalMenu } from './horizontal-menu/horizontal-menu.js';
7
7
  import { DropdownMenu } from './dropdown-menu/dropdown-menu.js';
8
- import useResizeObserver from '@react-hook/resize-observer';
9
- const BREAKPOINT_XS = 640;
10
- const TopMenu = forwardRef(({
8
+
9
+ const TopMenu = ({
11
10
  homeUrl,
12
11
  title,
13
12
  mobileTitle,
@@ -16,27 +15,21 @@ const TopMenu = forwardRef(({
16
15
  linkHandler = () => {},
17
16
  className,
18
17
  children,
18
+ forwardedRef,
19
19
  mobileOverview
20
- }, forwardedRef) => {
20
+ }) => {
21
21
  const theme = useTheme();
22
22
  const textCn = useTextStyles();
23
- const menuRef = useRef(null);
24
- useImperativeHandle(forwardedRef, () => menuRef.current);
25
- const [isMobileMenuVisible, setMobileMenuVisible] = useState(false);
26
- useLayoutEffect(() => {
27
- setMobileMenuVisible((menuRef.current?.getBoundingClientRect?.().width ?? 0) <= BREAKPOINT_XS);
28
- }, [menuRef]);
29
- useResizeObserver(menuRef, entry => setMobileMenuVisible(entry.contentRect.width <= BREAKPOINT_XS));
30
23
  return React__default.createElement("div", {
31
- ref: menuRef,
32
24
  className: classNames(styles.topMenu, className, {
33
25
  [styles.topMenuDarkTheme]: theme === 'dark'
34
- })
26
+ }),
27
+ ref: forwardedRef
35
28
  }, React__default.createElement("a", {
36
29
  href: homeUrl,
37
30
  className: classNames(styles.logo, textCn('rs-h3')),
38
31
  onClick: event => linkHandler(event, homeUrl)
39
- }, title), isMobileMenuVisible ? React__default.createElement(DropdownMenu, {
32
+ }, title), React__default.createElement(DropdownMenu, {
40
33
  items: items,
41
34
  activeIndex: activeIndex,
42
35
  linkHandler: linkHandler,
@@ -44,10 +37,11 @@ const TopMenu = forwardRef(({
44
37
  mobileTitle: mobileTitle,
45
38
  homeUrl: homeUrl,
46
39
  mobileOverview: mobileOverview
47
- }) : React__default.createElement(HorizontalMenu, {
40
+ }), React__default.createElement(HorizontalMenu, {
48
41
  items: items,
49
42
  activeIndex: activeIndex,
50
43
  linkHandler: linkHandler
51
44
  }), children);
52
- });
45
+ };
46
+
53
47
  export { TopMenu };
@@ -13,8 +13,7 @@
13
13
  --ktl-overlay-z-index: 900;
14
14
  --ktl-top-menu-z-index: 905;
15
15
  --ktl-header-z-index: 906;
16
- --ktl-mobile-dropdown-list-z-index: 907;
17
- --ktl-header-height-mobile: 52px;
16
+ --ktl-header-height-mobile: 48px;
18
17
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
19
18
  --rs-font-family-ui: var(--ktl-font-family-inter);
20
19
  }
@@ -13,8 +13,7 @@
13
13
  --ktl-overlay-z-index: 900;
14
14
  --ktl-top-menu-z-index: 905;
15
15
  --ktl-header-z-index: 906;
16
- --ktl-mobile-dropdown-list-z-index: 907;
17
- --ktl-header-height-mobile: 52px;
16
+ --ktl-header-height-mobile: 48px;
18
17
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
19
18
  --rs-font-family-ui: var(--ktl-font-family-inter);
20
19
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jetbrains/kotlin-web-site-ui",
3
3
  "description": "UI components for Kotlin web sites development",
4
- "version": "4.2.0-alpha.3",
4
+ "version": "4.2.0",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
7
7
  "files": [
@@ -47,7 +47,7 @@
47
47
  "@babel/preset-typescript": "^7.13.0",
48
48
  "@babel/register": "^7.11.5",
49
49
  "@react-hook/resize-observer": "^1.2.5",
50
- "@rescui/button": "^0.6.9",
50
+ "@rescui/button": "^0.2.1",
51
51
  "@rescui/checkbox": "^0.1.0",
52
52
  "@rescui/focus-manager": "^0.1.1",
53
53
  "@rescui/icons": "^0.8.2",