@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.
- package/out/components/footer/index.css +3 -6
- package/out/components/header/full-search/full-search.js +1 -8
- package/out/components/header/header.js +31 -13
- package/out/components/header/index.css +84 -120
- package/out/components/header/index.js +1 -1
- package/out/components/header/logo-small/logo-small.js +1 -1
- package/out/components/header/menu-popup/menu-button/close-icon.svg.js +35 -0
- package/out/components/header/menu-popup/menu-button/hamburger-icon.svg.js +35 -0
- package/out/components/header/menu-popup/menu-button/menu-button.js +5 -8
- package/out/components/header/menu-popup/menu-popup.js +42 -2
- package/out/components/header/menu-popup/menu-popup.module.pcss.js +4 -0
- package/out/components/header/nav-scheme.js +3 -9
- package/out/components/header/quick-search/list/list.js +5 -3
- package/out/components/header/quick-search/quick-search.js +12 -5
- package/out/components/header/quick-search/quick-search.module.pcss.js +2 -1
- package/out/components/header/quick-search/result/result.js +1 -1
- package/out/components/header/search-box/search-box.js +5 -3
- package/out/components/header/search-button/search-button.js +2 -13
- package/out/components/header/search-button/search-button.module.pcss.js +1 -2
- package/out/components/top-menu/dropdown-menu/dropdown-menu.js +10 -30
- package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +2 -3
- package/out/components/top-menu/index.css +100 -103
- package/out/components/top-menu/top-menu.js +11 -17
- package/out/components/typography/index.css +1 -2
- package/out/components/youtube-player/index.css +1 -2
- package/package.json +2 -2
- package/out/components/header/menu-popup/menu-list/menu-list.js +0 -33
- package/out/components/header/menu-popup/menu-list/menu-list.module.pcss.js +0 -4
- package/out/components/header/menu-popup/menu-list-item/menu-list-item.js +0 -28
- package/out/components/header/menu-popup/menu-list-item/menu-list-item.module.pcss.js +0 -7
|
@@ -29,8 +29,7 @@
|
|
|
29
29
|
--ktl-overlay-z-index: 900;
|
|
30
30
|
--ktl-top-menu-z-index: 905;
|
|
31
31
|
--ktl-header-z-index: 906;
|
|
32
|
-
--ktl-
|
|
33
|
-
--ktl-header-height-mobile: 52px;
|
|
32
|
+
--ktl-header-height-mobile: 48px;
|
|
34
33
|
--ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
|
|
35
34
|
--rs-font-family-ui: var(--ktl-font-family-inter);
|
|
36
35
|
}
|
|
@@ -86,8 +85,7 @@
|
|
|
86
85
|
--ktl-overlay-z-index: 900;
|
|
87
86
|
--ktl-top-menu-z-index: 905;
|
|
88
87
|
--ktl-header-z-index: 906;
|
|
89
|
-
--ktl-
|
|
90
|
-
--ktl-header-height-mobile: 52px;
|
|
88
|
+
--ktl-header-height-mobile: 48px;
|
|
91
89
|
--ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
|
|
92
90
|
--rs-font-family-ui: var(--ktl-font-family-inter);
|
|
93
91
|
}
|
|
@@ -143,8 +141,7 @@
|
|
|
143
141
|
--ktl-overlay-z-index: 900;
|
|
144
142
|
--ktl-top-menu-z-index: 905;
|
|
145
143
|
--ktl-header-z-index: 906;
|
|
146
|
-
--ktl-
|
|
147
|
-
--ktl-header-height-mobile: 52px;
|
|
144
|
+
--ktl-header-height-mobile: 48px;
|
|
148
145
|
--ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
|
|
149
146
|
--rs-font-family-ui: var(--ktl-font-family-inter);
|
|
150
147
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React__default, { useState, useContext, useRef, useCallback, useLayoutEffect
|
|
2
|
-
import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock';
|
|
1
|
+
import React__default, { useState, useContext, useRef, useCallback, useLayoutEffect } from 'react';
|
|
3
2
|
import useScrollbarSize from 'react-scrollbar-size';
|
|
4
3
|
import { ThemeProvider } from '@rescui/ui-contexts';
|
|
5
4
|
import Input from '@rescui/input';
|
|
@@ -54,12 +53,6 @@ const FullSearch = ({
|
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
}, [hits, inputValue]);
|
|
57
|
-
useLayoutEffect(() => {
|
|
58
|
-
if (ref.current) disableBodyScroll(ref.current);
|
|
59
|
-
}, [ref]);
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
return clearAllBodyScrollLocks;
|
|
62
|
-
}, []);
|
|
63
56
|
return React__default.createElement(ThemeProvider, {
|
|
64
57
|
theme: 'light'
|
|
65
58
|
}, React__default.createElement("div", {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React__default, { forwardRef, useState, useMemo, useRef, useImperativeHandle, useLayoutEffect, useCallback, useEffect } from 'react';
|
|
2
2
|
import { ThemeProvider } from '@rescui/ui-contexts';
|
|
3
3
|
import FocusManager from '@rescui/focus-manager';
|
|
4
|
+
import useResizeObserver from '@react-hook/resize-observer';
|
|
4
5
|
import OutsideClickHandler from 'react-outside-click-handler';
|
|
5
6
|
import { LogoLarge } from './logo-large/logo-large.js';
|
|
6
7
|
import styles from './header.module.pcss.js';
|
|
@@ -14,8 +15,14 @@ import classNames from 'classnames';
|
|
|
14
15
|
import { SearchWrapper } from './search-wrapper/search-wrapper.js';
|
|
15
16
|
import { isMacOs } from './is-macos.js';
|
|
16
17
|
import { KEY_K_CODE } from './key-codes.js';
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
var SearchResultView;
|
|
19
|
+
|
|
20
|
+
(function (SearchResultView) {
|
|
21
|
+
SearchResultView[SearchResultView["Narrow"] = 0] = "Narrow";
|
|
22
|
+
SearchResultView[SearchResultView["Wide"] = 1] = "Wide";
|
|
23
|
+
})(SearchResultView || (SearchResultView = {}));
|
|
24
|
+
|
|
25
|
+
const MENU_POPUP_BREAKPOINT = 640;
|
|
19
26
|
const Header = forwardRef(({
|
|
20
27
|
productWebUrl,
|
|
21
28
|
hasSearch = false,
|
|
@@ -27,20 +34,21 @@ const Header = forwardRef(({
|
|
|
27
34
|
linkHandler,
|
|
28
35
|
isPlayground,
|
|
29
36
|
isUrlActive,
|
|
30
|
-
searchConfig
|
|
37
|
+
searchConfig,
|
|
38
|
+
noScrollClassName,
|
|
39
|
+
resultViewType = SearchResultView.Narrow
|
|
31
40
|
}, forwardedRef) => {
|
|
32
41
|
const [menuPopupExpanded, setMenuPopupExpanded] = useState(false);
|
|
42
|
+
const [isMenuPopupVisible, setIsMenuPopupVisible] = useState(false);
|
|
33
43
|
const [isSearchBoxVisible, setSearchBoxVisible] = useState(false);
|
|
34
44
|
const [fullSearchActive, setFullSearchActive] = useState(false);
|
|
35
45
|
const items = useMemo(() => getNavScheme(isUrlActive, currentUrl, isPlayground), [isUrlActive, currentUrl, isPlayground]);
|
|
36
|
-
const itemsWithoutHomeSection = useMemo(() => items.slice(1), [items]);
|
|
37
46
|
const headerRef = useRef(null);
|
|
38
47
|
useImperativeHandle(forwardedRef, () => headerRef.current);
|
|
39
|
-
const [isMenuPopupVisible, setMenuPopupVisible] = useState(false);
|
|
40
48
|
useLayoutEffect(() => {
|
|
41
|
-
|
|
49
|
+
setIsMenuPopupVisible((headerRef.current?.getBoundingClientRect?.().width ?? 0) <= MENU_POPUP_BREAKPOINT);
|
|
42
50
|
}, [headerRef]);
|
|
43
|
-
useResizeObserver(headerRef, entry =>
|
|
51
|
+
useResizeObserver(headerRef, entry => setIsMenuPopupVisible(entry.contentRect.width <= MENU_POPUP_BREAKPOINT));
|
|
44
52
|
const handleSearchButtonClick = useCallback(() => {
|
|
45
53
|
setSearchBoxVisible(!isSearchBoxVisible);
|
|
46
54
|
}, []);
|
|
@@ -60,7 +68,7 @@ const Header = forwardRef(({
|
|
|
60
68
|
}
|
|
61
69
|
}, []);
|
|
62
70
|
useEffect(() => {
|
|
63
|
-
if (typeof document !== `undefined`) {
|
|
71
|
+
if (typeof document !== `undefined` && resultViewType === SearchResultView.Narrow) {
|
|
64
72
|
document.addEventListener('keydown', fullSearchKeyHandler);
|
|
65
73
|
const focusManager = new FocusManager();
|
|
66
74
|
return () => {
|
|
@@ -69,6 +77,15 @@ const Header = forwardRef(({
|
|
|
69
77
|
};
|
|
70
78
|
}
|
|
71
79
|
}, [fullSearchKeyHandler]);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (typeof document !== `undefined` && noScrollClassName) {
|
|
82
|
+
if (fullSearchActive) {
|
|
83
|
+
document.body.classList.add(noScrollClassName);
|
|
84
|
+
} else {
|
|
85
|
+
document.body.classList.remove(noScrollClassName);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}, [fullSearchActive]);
|
|
72
89
|
return React__default.createElement(ThemeProvider, {
|
|
73
90
|
theme: 'dark'
|
|
74
91
|
}, React__default.createElement(SearchWrapper, {
|
|
@@ -77,7 +94,7 @@ const Header = forwardRef(({
|
|
|
77
94
|
ref: headerRef,
|
|
78
95
|
className: classNames(styles.headerMenu, className, {
|
|
79
96
|
[styles.withMenuPopup]: menuPopupExpanded,
|
|
80
|
-
[styles.border]: hasBorder
|
|
97
|
+
[styles.border]: hasBorder
|
|
81
98
|
}),
|
|
82
99
|
"data-test": 'header'
|
|
83
100
|
}, isMenuPopupVisible && currentTitle && currentUrl && !menuPopupExpanded ? React__default.createElement(LogoSmall, {
|
|
@@ -91,12 +108,13 @@ const Header = forwardRef(({
|
|
|
91
108
|
closeHandler: handleSearchClose,
|
|
92
109
|
isMobile: isMenuPopupVisible,
|
|
93
110
|
fullSearchActive: fullSearchActive,
|
|
94
|
-
setFullSearchActive: setFullSearchActive
|
|
111
|
+
setFullSearchActive: setFullSearchActive,
|
|
112
|
+
searchBoxViewType: resultViewType
|
|
95
113
|
})) : React__default.createElement(React__default.Fragment, null, !isMenuPopupVisible && React__default.createElement(HorizontalMenu, {
|
|
96
|
-
items:
|
|
114
|
+
items: items,
|
|
97
115
|
theme: dropdownTheme,
|
|
98
116
|
linkHandler: linkHandler
|
|
99
|
-
}),
|
|
117
|
+
}), React__default.createElement(SearchButton, {
|
|
100
118
|
onClick: handleSearchButtonClick,
|
|
101
119
|
isActive: hasSearch
|
|
102
120
|
}), isMenuPopupVisible && React__default.createElement(MenuPopup, {
|
|
@@ -107,4 +125,4 @@ const Header = forwardRef(({
|
|
|
107
125
|
linkHandler: linkHandler
|
|
108
126
|
})))));
|
|
109
127
|
});
|
|
110
|
-
export { Header };
|
|
128
|
+
export { Header, SearchResultView };
|
|
@@ -38,8 +38,7 @@
|
|
|
38
38
|
--ktl-overlay-z-index: 900;
|
|
39
39
|
--ktl-top-menu-z-index: 905;
|
|
40
40
|
--ktl-header-z-index: 906;
|
|
41
|
-
--ktl-
|
|
42
|
-
--ktl-header-height-mobile: 52px;
|
|
41
|
+
--ktl-header-height-mobile: 48px;
|
|
43
42
|
--ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
|
|
44
43
|
--rs-font-family-ui: var(--ktl-font-family-inter);
|
|
45
44
|
}
|
|
@@ -61,7 +60,7 @@
|
|
|
61
60
|
|
|
62
61
|
@media (max-width: 640px) {
|
|
63
62
|
.ktl-header-module_header-menu_wh71L {
|
|
64
|
-
padding: 0
|
|
63
|
+
padding: 0 16px;
|
|
65
64
|
height: var(--ktl-header-height-mobile);
|
|
66
65
|
}
|
|
67
66
|
|
|
@@ -85,8 +84,7 @@
|
|
|
85
84
|
--ktl-overlay-z-index: 900;
|
|
86
85
|
--ktl-top-menu-z-index: 905;
|
|
87
86
|
--ktl-header-z-index: 906;
|
|
88
|
-
--ktl-
|
|
89
|
-
--ktl-header-height-mobile: 52px;
|
|
87
|
+
--ktl-header-height-mobile: 48px;
|
|
90
88
|
--ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
|
|
91
89
|
--rs-font-family-ui: var(--ktl-font-family-inter);
|
|
92
90
|
}
|
|
@@ -228,8 +226,7 @@
|
|
|
228
226
|
--ktl-overlay-z-index: 900;
|
|
229
227
|
--ktl-top-menu-z-index: 905;
|
|
230
228
|
--ktl-header-z-index: 906;
|
|
231
|
-
--ktl-
|
|
232
|
-
--ktl-header-height-mobile: 52px;
|
|
229
|
+
--ktl-header-height-mobile: 48px;
|
|
233
230
|
--ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
|
|
234
231
|
--rs-font-family-ui: var(--ktl-font-family-inter);
|
|
235
232
|
}
|
|
@@ -267,13 +264,12 @@
|
|
|
267
264
|
@media (max-width: 640px) {
|
|
268
265
|
.ktl-search-button-module_button_YHJPv {
|
|
269
266
|
display: none;
|
|
267
|
+
margin: 0 16px 0 0;
|
|
270
268
|
}
|
|
271
|
-
}
|
|
272
269
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
270
|
+
.ktl-search-button-module_button_YHJPv.ktl-search-button-module_active_lUmdh {
|
|
271
|
+
display: flex;
|
|
272
|
+
}
|
|
277
273
|
}
|
|
278
274
|
|
|
279
275
|
.ktl-result-module_result_EKhUw {
|
|
@@ -411,18 +407,39 @@
|
|
|
411
407
|
transform: translateY(100%);
|
|
412
408
|
}
|
|
413
409
|
|
|
410
|
+
|
|
414
411
|
@media (min-width: 640px) and (max-width: 768px) {
|
|
415
412
|
.ktl-quick-search-module_wrapper_kkbQQ {
|
|
416
413
|
bottom: 12px;
|
|
417
414
|
}
|
|
418
415
|
}
|
|
419
416
|
|
|
417
|
+
|
|
420
418
|
@media (min-width: 768px) {
|
|
421
419
|
.ktl-quick-search-module_wrapper_kkbQQ {
|
|
422
420
|
left: 0;
|
|
423
421
|
right: 0;
|
|
424
422
|
}
|
|
425
423
|
}
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
@media (min-width: 640px) and (max-width: 1024px) {
|
|
427
|
+
.ktl-quick-search-module_apiReferenceWrapper_jv98t {
|
|
428
|
+
width: calc(100vw - 64px);
|
|
429
|
+
left: auto;
|
|
430
|
+
right: 0;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
@media (min-width: 1024px) {
|
|
436
|
+
.ktl-quick-search-module_apiReferenceWrapper_jv98t {
|
|
437
|
+
left: auto;
|
|
438
|
+
right: 0;
|
|
439
|
+
width: 1000px;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
426
443
|
.ktl-loading-module_loader_B2IQl {
|
|
427
444
|
margin-top: 4px;
|
|
428
445
|
}
|
|
@@ -675,27 +692,64 @@
|
|
|
675
692
|
--ktl-overlay-z-index: 900;
|
|
676
693
|
--ktl-top-menu-z-index: 905;
|
|
677
694
|
--ktl-header-z-index: 906;
|
|
678
|
-
--ktl-
|
|
679
|
-
--ktl-header-height-mobile: 52px;
|
|
695
|
+
--ktl-header-height-mobile: 48px;
|
|
680
696
|
--ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
|
|
681
697
|
--rs-font-family-ui: var(--ktl-font-family-inter);
|
|
682
698
|
}
|
|
683
699
|
|
|
684
700
|
.ktl-menu-popup-module_menu-popup_Q68IE {
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
701
|
+
display: none;
|
|
702
|
+
padding: 8px 0;
|
|
703
|
+
background: var(--ktl-dark-100);
|
|
704
|
+
position: fixed;
|
|
705
|
+
top: var(--ktl-header-height-mobile);
|
|
706
|
+
bottom: 0;
|
|
707
|
+
left: 0;
|
|
708
|
+
right: 0;
|
|
709
|
+
overflow: auto;
|
|
710
|
+
z-index: var(--ktl-top-menu-z-index);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.ktl-menu-popup-module_menu-item_fPvF- {
|
|
714
|
+
--level: 0;
|
|
715
|
+
display: flex;
|
|
716
|
+
align-items: center;
|
|
717
|
+
font-size: 16px;
|
|
718
|
+
line-height: 24px;
|
|
719
|
+
font-weight: 400;
|
|
720
|
+
color: rgba(255, 255, 255, 0.75);
|
|
721
|
+
text-decoration: none;
|
|
722
|
+
padding: 8px 16px 8px calc(16px + (var(--level) * 24px));
|
|
723
|
+
transition: color var(--ktl-transition-xfast),
|
|
724
|
+
background-color var(--ktl-transition-xfast);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.ktl-menu-popup-module_menu-item_fPvF-:hover {
|
|
728
|
+
color: rgba(255, 255, 255, 1);
|
|
729
|
+
background: rgba(255, 255, 255, 0.1);
|
|
730
|
+
text-decoration: none;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.ktl-menu-popup-module_menu-item_fPvF-.ktl-menu-popup-module_active_iqTAj {
|
|
734
|
+
color: var(--ktl-light-text-hard);
|
|
735
|
+
background: rgba(255, 255, 255, 1);
|
|
736
|
+
cursor: default;
|
|
737
|
+
text-decoration: none;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.ktl-menu-popup-module_menu-item_fPvF-.ktl-menu-popup-module_active-with-child_tAzCG {
|
|
741
|
+
background: none;
|
|
742
|
+
color: rgba(255, 255, 255, 1);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.ktl-menu-popup-module_menu-item-root_gA9d2 {
|
|
746
|
+
font-size: 20px;
|
|
747
|
+
line-height: 32px;
|
|
748
|
+
font-weight: 600;
|
|
695
749
|
}
|
|
696
750
|
|
|
697
751
|
.ktl-menu-popup-module_menu-popup-expanded_ggrp9 {
|
|
698
|
-
|
|
752
|
+
display: block;
|
|
699
753
|
}
|
|
700
754
|
|
|
701
755
|
.ktl-menu-button-module_button_wB9Mx {
|
|
@@ -709,8 +763,8 @@
|
|
|
709
763
|
background: none;
|
|
710
764
|
padding: 0;
|
|
711
765
|
margin: 0;
|
|
712
|
-
width:
|
|
713
|
-
height:
|
|
766
|
+
width: 24px;
|
|
767
|
+
height: 24px;
|
|
714
768
|
align-items: center;
|
|
715
769
|
justify-content: center;
|
|
716
770
|
transition: color var(--ktl-transition-xfast),
|
|
@@ -723,97 +777,6 @@
|
|
|
723
777
|
color: #ffffff;
|
|
724
778
|
}
|
|
725
779
|
|
|
726
|
-
:root {
|
|
727
|
-
--ktl-light-grey: #f4f4f4;
|
|
728
|
-
--ktl-dark-100: rgba(39, 40, 44, 1);
|
|
729
|
-
--ktl-dark-bg-hard: rgba(27, 27, 27, 1);
|
|
730
|
-
--ktl-icon-color-dark: rgba(39, 40, 44, 0.75);
|
|
731
|
-
--ktl-color-white-light: rgba(255, 255, 255, 0.75);
|
|
732
|
-
--ktl-transition-xfast: 100ms;
|
|
733
|
-
--ktl-transition-fast: 300ms;
|
|
734
|
-
--ktl-color-primary-light-theme: #7f52ff;
|
|
735
|
-
--ktl-color-dark-40: rgba(39, 40, 44, 0.4);
|
|
736
|
-
--ktl-light-text-hard: rgba(39, 40, 44, 1);
|
|
737
|
-
--ktl-light-dark-20: rgba(39, 40, 44, 0.2);
|
|
738
|
-
--ktl-overlay-z-index: 900;
|
|
739
|
-
--ktl-top-menu-z-index: 905;
|
|
740
|
-
--ktl-header-z-index: 906;
|
|
741
|
-
--ktl-mobile-dropdown-list-z-index: 907;
|
|
742
|
-
--ktl-header-height-mobile: 52px;
|
|
743
|
-
--ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
|
|
744
|
-
--rs-font-family-ui: var(--ktl-font-family-inter);
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
.ktl-menu-list-item-module_menu-item_Aruue {
|
|
748
|
-
--level: 0;
|
|
749
|
-
display: flex;
|
|
750
|
-
align-items: center;
|
|
751
|
-
font-size: 19px;
|
|
752
|
-
line-height: 28px;
|
|
753
|
-
font-weight: 400;
|
|
754
|
-
color: rgba(255, 255, 255, 0.75);
|
|
755
|
-
text-decoration: none;
|
|
756
|
-
padding: 12px 16px 12px 16px;
|
|
757
|
-
transition: color var(--ktl-transition-xfast),
|
|
758
|
-
background-color var(--ktl-transition-xfast);
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
.ktl-menu-list-item-module_menu-item_Aruue:hover {
|
|
762
|
-
color: rgba(255, 255, 255, 1);
|
|
763
|
-
background: rgba(255, 255, 255, 0.1);
|
|
764
|
-
text-decoration: none;
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
.ktl-menu-list-item-module_menu-item_Aruue.ktl-menu-list-item-module_active_jHfJR {
|
|
768
|
-
color: var(--ktl-light-text-hard);
|
|
769
|
-
background: rgba(255, 255, 255, 1);
|
|
770
|
-
cursor: default;
|
|
771
|
-
text-decoration: none;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
.ktl-menu-list-item-module_menu-item_Aruue.ktl-menu-list-item-module_active-with-child_ier2a {
|
|
775
|
-
background: none;
|
|
776
|
-
color: rgba(255, 255, 255, 0.7);
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
.ktl-menu-list-item-module_menu-item-root_Rzcqb:not(a) {
|
|
780
|
-
font-size: 13px;
|
|
781
|
-
text-transform: uppercase;
|
|
782
|
-
line-height: 20px;
|
|
783
|
-
color: rgba(255, 255, 255, 0.7);
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
:root {
|
|
787
|
-
--ktl-light-grey: #f4f4f4;
|
|
788
|
-
--ktl-dark-100: rgba(39, 40, 44, 1);
|
|
789
|
-
--ktl-dark-bg-hard: rgba(27, 27, 27, 1);
|
|
790
|
-
--ktl-icon-color-dark: rgba(39, 40, 44, 0.75);
|
|
791
|
-
--ktl-color-white-light: rgba(255, 255, 255, 0.75);
|
|
792
|
-
--ktl-transition-xfast: 100ms;
|
|
793
|
-
--ktl-transition-fast: 300ms;
|
|
794
|
-
--ktl-color-primary-light-theme: #7f52ff;
|
|
795
|
-
--ktl-color-dark-40: rgba(39, 40, 44, 0.4);
|
|
796
|
-
--ktl-light-text-hard: rgba(39, 40, 44, 1);
|
|
797
|
-
--ktl-light-dark-20: rgba(39, 40, 44, 0.2);
|
|
798
|
-
--ktl-overlay-z-index: 900;
|
|
799
|
-
--ktl-top-menu-z-index: 905;
|
|
800
|
-
--ktl-header-z-index: 906;
|
|
801
|
-
--ktl-mobile-dropdown-list-z-index: 907;
|
|
802
|
-
--ktl-header-height-mobile: 52px;
|
|
803
|
-
--ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
|
|
804
|
-
--rs-font-family-ui: var(--ktl-font-family-inter);
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
.ktl-menu-list-module_menu-item-group_mFvUE {
|
|
808
|
-
margin: 8px 0;
|
|
809
|
-
padding: 8px 0;
|
|
810
|
-
border-top: 1px solid rgba(255, 255, 255, 0.3);
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
.ktl-menu-list-module_menu-item-group_mFvUE:not(:last-child) {
|
|
814
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
|
|
815
|
-
}
|
|
816
|
-
|
|
817
780
|
.ktl-logo-small-module_logo-small_iGY12 {
|
|
818
781
|
flex-grow: 1;
|
|
819
782
|
display: flex;
|
|
@@ -824,7 +787,6 @@
|
|
|
824
787
|
.ktl-logo-small-module_link_SKXAa {
|
|
825
788
|
color: rgba(255, 255, 255, 1);
|
|
826
789
|
text-decoration: none;
|
|
827
|
-
font-size: 16px;
|
|
828
790
|
}
|
|
829
791
|
|
|
830
792
|
.ktl-logo-small-module_icon-wrap_6hRnO {
|
|
@@ -833,7 +795,9 @@
|
|
|
833
795
|
align-items: center;
|
|
834
796
|
justify-items: center;
|
|
835
797
|
height: 100%;
|
|
836
|
-
margin-right:
|
|
798
|
+
margin-right: 16px;
|
|
799
|
+
padding-right: 16px;
|
|
800
|
+
border-right: 1px solid rgba(255, 255, 255, 0.2);
|
|
837
801
|
}
|
|
838
802
|
|
|
839
803
|
.ktl-logo-small-module_icon_NyEog {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { Header } from './header.js';
|
|
3
3
|
export { Header as default } from './header.js';
|
|
4
|
-
export { ANDROID_TITLE, ANDROID_URL, COMMUNITY_TITLE, COMMUNITY_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DOCS_TITLE, DOCS_URL,
|
|
4
|
+
export { ANDROID_TITLE, ANDROID_URL, COMMUNITY_TITLE, COMMUNITY_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DOCS_TITLE, DOCS_URL, KMM_DOCS_TITLE, KMM_DOCS_URL, KOTLIN_DOCS_TITLE, KOTLIN_DOCS_URL, MULTIPLATFORM_MOBILE_TITLE, MULTIPLATFORM_MOBILE_URL, MULTIPLATFORM_OTHERS_TITLE, MULTIPLATFORM_OTHERS_URL, PLAY_EXAMPLES_TITLE, PLAY_EXAMPLES_URL, PLAY_HANDSON_TITLE, PLAY_HANDSON_URL, PLAY_KOANS_TITLE, PLAY_KOANS_URL, PLAY_TITLE, PLAY_TITLE_FULL, PLAY_URL, SERVER_SIDE_TITLE, SERVER_SIDE_URL, SOLUTIONS_TITLE, TEACH_TITLE, TEACH_URL, WEB_FRONTEND_TITLE, WEB_FRONTEND_URL, getNavScheme } from './nav-scheme.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
_extends = Object.assign || function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
|
|
10
|
+
for (var key in source) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12
|
+
target[key] = source[key];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return _extends.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const SvgCloseIcon = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
24
|
+
width: 16,
|
|
25
|
+
height: 16,
|
|
26
|
+
fill: "none",
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
28
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
fillRule: "evenodd",
|
|
30
|
+
clipRule: "evenodd",
|
|
31
|
+
d: "M15.707 1.707 14.293.293 8 6.586 1.707.293.293 1.707 6.586 8 .293 14.293l1.414 1.414L8 9.414l6.293 6.293 1.414-1.414L9.414 8l6.293-6.293Z",
|
|
32
|
+
fill: "currentColor"
|
|
33
|
+
})));
|
|
34
|
+
|
|
35
|
+
export { SvgCloseIcon as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
_extends = Object.assign || function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
|
|
10
|
+
for (var key in source) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12
|
+
target[key] = source[key];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return _extends.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const SvgHamburgerIcon = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
24
|
+
width: 24,
|
|
25
|
+
height: 24,
|
|
26
|
+
fill: "none",
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
28
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
fillRule: "evenodd",
|
|
30
|
+
clipRule: "evenodd",
|
|
31
|
+
d: "M4 5h16v2H4V5Zm0 6h16v2H4v-2Zm16 6H4v2h16v-2Z",
|
|
32
|
+
fill: "currentColor"
|
|
33
|
+
})));
|
|
34
|
+
|
|
35
|
+
export { SvgHamburgerIcon as default };
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import styles from './menu-button.module.pcss.js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import SvgHamburgerIcon from './hamburger-icon.svg.js';
|
|
5
|
+
import SvgCloseIcon from './close-icon.svg.js';
|
|
6
6
|
|
|
7
7
|
const MenuButton = ({
|
|
8
8
|
onClick,
|
|
9
9
|
isExpanded
|
|
10
10
|
}) => {
|
|
11
|
-
return React__default.createElement(
|
|
11
|
+
return React__default.createElement("button", {
|
|
12
12
|
type: "button",
|
|
13
13
|
className: classNames(styles.button),
|
|
14
14
|
"aria-haspopup": "true",
|
|
15
15
|
"aria-label": "Open the navigation",
|
|
16
|
-
onClick: onClick
|
|
17
|
-
|
|
18
|
-
mode: 'clear',
|
|
19
|
-
icon: isExpanded ? React__default.createElement(CloseIcon, null) : React__default.createElement(HamburgerIcon, null)
|
|
20
|
-
});
|
|
16
|
+
onClick: onClick
|
|
17
|
+
}, isExpanded ? React__default.createElement(SvgCloseIcon, null) : React__default.createElement(SvgHamburgerIcon, null));
|
|
21
18
|
};
|
|
22
19
|
|
|
23
20
|
export { MenuButton };
|
|
@@ -1,11 +1,51 @@
|
|
|
1
|
-
import React__default, { useRef, useState, useEffect, useLayoutEffect, useCallback } from 'react';
|
|
1
|
+
import React__default, { useRef, useState, useEffect, useLayoutEffect, useCallback, Fragment } from 'react';
|
|
2
2
|
import styles from './menu-popup.module.pcss.js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { MenuButton } from './menu-button/menu-button.js';
|
|
5
|
-
import { MenuList } from './menu-list/menu-list.js';
|
|
6
5
|
import { useTextStyles } from '@rescui/typography';
|
|
7
6
|
import { clearAllBodyScrollLocks, enableBodyScroll, disableBodyScroll } from 'body-scroll-lock';
|
|
8
7
|
|
|
8
|
+
const MenuListItem = ({
|
|
9
|
+
item,
|
|
10
|
+
level,
|
|
11
|
+
linkHandler
|
|
12
|
+
}) => {
|
|
13
|
+
const Tag = item.url ? 'a' : 'span';
|
|
14
|
+
const style = {
|
|
15
|
+
'--level': level
|
|
16
|
+
};
|
|
17
|
+
const handleClick = useCallback(event => linkHandler && item.url && linkHandler(event, item.url), []);
|
|
18
|
+
return React__default.createElement(Tag, Object.assign({}, item.url ? {
|
|
19
|
+
href: item.url,
|
|
20
|
+
onClick: handleClick
|
|
21
|
+
} : {}, {
|
|
22
|
+
className: classNames(styles.menuItem, {
|
|
23
|
+
[styles.menuItemRoot]: level === 0,
|
|
24
|
+
[styles.active]: item.isActive,
|
|
25
|
+
[styles.activeWithChild]: item.items && item.items.length
|
|
26
|
+
}),
|
|
27
|
+
style: style
|
|
28
|
+
}), item.title);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const MenuList = ({
|
|
32
|
+
items,
|
|
33
|
+
level,
|
|
34
|
+
linkHandler
|
|
35
|
+
}) => {
|
|
36
|
+
return React__default.createElement(React__default.Fragment, null, items.map((item, i) => React__default.createElement(Fragment, {
|
|
37
|
+
key: i
|
|
38
|
+
}, React__default.createElement(MenuListItem, {
|
|
39
|
+
item: item,
|
|
40
|
+
level: level,
|
|
41
|
+
linkHandler: linkHandler
|
|
42
|
+
}), item.items && item.items.length > 0 && React__default.createElement(MenuList, {
|
|
43
|
+
items: item.items,
|
|
44
|
+
level: level + 1,
|
|
45
|
+
linkHandler: linkHandler
|
|
46
|
+
}))));
|
|
47
|
+
};
|
|
48
|
+
|
|
9
49
|
const MenuPopup = ({
|
|
10
50
|
items,
|
|
11
51
|
isExpanded,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
var styles = {
|
|
2
2
|
"menuPopup": "ktl-menu-popup-module_menu-popup_Q68IE",
|
|
3
|
+
"menuItem": "ktl-menu-popup-module_menu-item_fPvF-",
|
|
4
|
+
"active": "ktl-menu-popup-module_active_iqTAj",
|
|
5
|
+
"activeWithChild": "ktl-menu-popup-module_active-with-child_tAzCG",
|
|
6
|
+
"menuItemRoot": "ktl-menu-popup-module_menu-item-root_gA9d2",
|
|
3
7
|
"menuPopupExpanded": "ktl-menu-popup-module_menu-popup-expanded_ggrp9"
|
|
4
8
|
};
|
|
5
9
|
export { styles as default };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { PLAYGROUND_URL, KOTLINLANG_URL } from './consts.js';
|
|
2
|
-
const HOME_TITLE = 'Home';
|
|
3
|
-
const HOME_URL = '/';
|
|
4
2
|
const SOLUTIONS_TITLE = 'Solutions';
|
|
5
3
|
const MULTIPLATFORM_MOBILE_TITLE = 'Multiplatform Mobile';
|
|
6
4
|
const MULTIPLATFORM_MOBILE_URL = `/lp/mobile/`;
|
|
@@ -34,9 +32,6 @@ const KOTLIN_DOCS_URL = `/docs/home.html`;
|
|
|
34
32
|
const KMM_DOCS_TITLE = 'KMM';
|
|
35
33
|
const KMM_DOCS_URL = `/docs/mobile/home.html`;
|
|
36
34
|
const navScheme = [{
|
|
37
|
-
title: HOME_TITLE,
|
|
38
|
-
url: HOME_URL
|
|
39
|
-
}, {
|
|
40
35
|
title: SOLUTIONS_TITLE,
|
|
41
36
|
url: null,
|
|
42
37
|
items: [{
|
|
@@ -85,9 +80,8 @@ const navScheme = [{
|
|
|
85
80
|
}]
|
|
86
81
|
}];
|
|
87
82
|
|
|
88
|
-
function getNavScheme(isUrlActive = (url, currentUrl) => url === currentUrl, currentUrl, isPlayground
|
|
89
|
-
|
|
90
|
-
return controlledNavScheme.map(({
|
|
83
|
+
function getNavScheme(isUrlActive = (url, currentUrl) => url === currentUrl, currentUrl, isPlayground) {
|
|
84
|
+
return navScheme.map(({
|
|
91
85
|
title,
|
|
92
86
|
url,
|
|
93
87
|
items
|
|
@@ -138,4 +132,4 @@ function makeExternalUrl(url, currentUrl, isPlayground) {
|
|
|
138
132
|
return url;
|
|
139
133
|
}
|
|
140
134
|
|
|
141
|
-
export { ANDROID_TITLE, ANDROID_URL, COMMUNITY_TITLE, COMMUNITY_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DOCS_TITLE, DOCS_URL,
|
|
135
|
+
export { ANDROID_TITLE, ANDROID_URL, COMMUNITY_TITLE, COMMUNITY_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DOCS_TITLE, DOCS_URL, KMM_DOCS_TITLE, KMM_DOCS_URL, KOTLIN_DOCS_TITLE, KOTLIN_DOCS_URL, MULTIPLATFORM_MOBILE_TITLE, MULTIPLATFORM_MOBILE_URL, MULTIPLATFORM_OTHERS_TITLE, MULTIPLATFORM_OTHERS_URL, PLAY_EXAMPLES_TITLE, PLAY_EXAMPLES_URL, PLAY_HANDSON_TITLE, PLAY_HANDSON_URL, PLAY_KOANS_TITLE, PLAY_KOANS_URL, PLAY_TITLE, PLAY_TITLE_FULL, PLAY_URL, SERVER_SIDE_TITLE, SERVER_SIDE_URL, SOLUTIONS_TITLE, TEACH_TITLE, TEACH_URL, WEB_FRONTEND_TITLE, WEB_FRONTEND_URL, getNavScheme };
|