@jetbrains/kotlin-web-site-ui 4.2.0 → 4.3.0-alpha.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 (29) hide show
  1. package/out/components/footer/index.css +6 -3
  2. package/out/components/header/full-search/full-search.js +8 -1
  3. package/out/components/header/header.js +7 -16
  4. package/out/components/header/index.css +117 -67
  5. package/out/components/header/index.js +1 -1
  6. package/out/components/header/logo-small/kotlin-logo-small.svg.js +18 -16
  7. package/out/components/header/logo-small/logo-small.js +1 -1
  8. package/out/components/header/menu-popup/menu-button/menu-button.js +8 -5
  9. package/out/components/header/menu-popup/menu-list/menu-list.js +33 -0
  10. package/out/components/header/menu-popup/menu-list/menu-list.module.pcss.js +4 -0
  11. package/out/components/header/menu-popup/menu-list-item/menu-list-item.js +28 -0
  12. package/out/components/header/menu-popup/menu-list-item/menu-list-item.module.pcss.js +7 -0
  13. package/out/components/header/menu-popup/menu-popup.js +2 -42
  14. package/out/components/header/menu-popup/menu-popup.module.pcss.js +0 -4
  15. package/out/components/header/nav-scheme.js +9 -3
  16. package/out/components/header/search-button/search-button.js +13 -2
  17. package/out/components/header/search-button/search-button.module.pcss.js +2 -1
  18. package/out/components/top-menu/index.css +91 -124
  19. package/out/components/top-menu/top-menu.js +20 -13
  20. package/out/components/top-menu/{dropdown-menu → vertical-menu}/arrow-dropdown-icon.svg.js +0 -0
  21. package/out/components/top-menu/vertical-menu/vertical-menu.js +123 -0
  22. package/out/components/top-menu/vertical-menu/vertical-menu.module.pcss.js +13 -0
  23. package/out/components/typography/index.css +2 -1
  24. package/out/components/youtube-player/index.css +2 -1
  25. package/package.json +1 -1
  26. package/out/components/header/menu-popup/menu-button/close-icon.svg.js +0 -35
  27. package/out/components/header/menu-popup/menu-button/hamburger-icon.svg.js +0 -35
  28. package/out/components/top-menu/dropdown-menu/dropdown-menu.js +0 -71
  29. package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +0 -15
@@ -29,7 +29,8 @@
29
29
  --ktl-overlay-z-index: 900;
30
30
  --ktl-top-menu-z-index: 905;
31
31
  --ktl-header-z-index: 906;
32
- --ktl-header-height-mobile: 48px;
32
+ --ktl-mobile-dropdown-list-z-index: 907;
33
+ --ktl-header-height-mobile: 52px;
33
34
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
34
35
  --rs-font-family-ui: var(--ktl-font-family-inter);
35
36
  }
@@ -85,7 +86,8 @@
85
86
  --ktl-overlay-z-index: 900;
86
87
  --ktl-top-menu-z-index: 905;
87
88
  --ktl-header-z-index: 906;
88
- --ktl-header-height-mobile: 48px;
89
+ --ktl-mobile-dropdown-list-z-index: 907;
90
+ --ktl-header-height-mobile: 52px;
89
91
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
90
92
  --rs-font-family-ui: var(--ktl-font-family-inter);
91
93
  }
@@ -141,7 +143,8 @@
141
143
  --ktl-overlay-z-index: 900;
142
144
  --ktl-top-menu-z-index: 905;
143
145
  --ktl-header-z-index: 906;
144
- --ktl-header-height-mobile: 48px;
146
+ --ktl-mobile-dropdown-list-z-index: 907;
147
+ --ktl-header-height-mobile: 52px;
145
148
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
146
149
  --rs-font-family-ui: var(--ktl-font-family-inter);
147
150
  }
@@ -1,4 +1,5 @@
1
- import React__default, { useState, useContext, useRef, useCallback, useLayoutEffect } from 'react';
1
+ import React__default, { useState, useContext, useRef, useCallback, useLayoutEffect, useEffect } from 'react';
2
+ import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock';
2
3
  import useScrollbarSize from 'react-scrollbar-size';
3
4
  import { ThemeProvider } from '@rescui/ui-contexts';
4
5
  import Input from '@rescui/input';
@@ -53,6 +54,12 @@ const FullSearch = ({
53
54
  }
54
55
  }
55
56
  }, [hits, inputValue]);
57
+ useLayoutEffect(() => {
58
+ if (ref.current) disableBodyScroll(ref.current);
59
+ }, [ref]);
60
+ useEffect(() => {
61
+ return clearAllBodyScrollLocks;
62
+ }, []);
56
63
  return React__default.createElement(ThemeProvider, {
57
64
  theme: 'light'
58
65
  }, React__default.createElement("div", {
@@ -35,20 +35,20 @@ const Header = forwardRef(({
35
35
  isPlayground,
36
36
  isUrlActive,
37
37
  searchConfig,
38
- noScrollClassName,
39
38
  resultViewType = SearchResultView.Narrow
40
39
  }, forwardedRef) => {
41
40
  const [menuPopupExpanded, setMenuPopupExpanded] = useState(false);
42
- const [isMenuPopupVisible, setIsMenuPopupVisible] = useState(false);
43
41
  const [isSearchBoxVisible, setSearchBoxVisible] = useState(false);
44
42
  const [fullSearchActive, setFullSearchActive] = useState(false);
45
43
  const items = useMemo(() => getNavScheme(isUrlActive, currentUrl, isPlayground), [isUrlActive, currentUrl, isPlayground]);
44
+ const itemsWithoutHomeSection = useMemo(() => items.slice(1), [items]);
46
45
  const headerRef = useRef(null);
47
46
  useImperativeHandle(forwardedRef, () => headerRef.current);
47
+ const [isMenuPopupVisible, setMenuPopupVisible] = useState(false);
48
48
  useLayoutEffect(() => {
49
- setIsMenuPopupVisible((headerRef.current?.getBoundingClientRect?.().width ?? 0) <= MENU_POPUP_BREAKPOINT);
49
+ setMenuPopupVisible((headerRef.current?.getBoundingClientRect?.().width ?? 0) <= MENU_POPUP_BREAKPOINT);
50
50
  }, [headerRef]);
51
- useResizeObserver(headerRef, entry => setIsMenuPopupVisible(entry.contentRect.width <= MENU_POPUP_BREAKPOINT));
51
+ useResizeObserver(headerRef, entry => setMenuPopupVisible(entry.contentRect.width <= MENU_POPUP_BREAKPOINT));
52
52
  const handleSearchButtonClick = useCallback(() => {
53
53
  setSearchBoxVisible(!isSearchBoxVisible);
54
54
  }, []);
@@ -77,15 +77,6 @@ const Header = forwardRef(({
77
77
  };
78
78
  }
79
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]);
89
80
  return React__default.createElement(ThemeProvider, {
90
81
  theme: 'dark'
91
82
  }, React__default.createElement(SearchWrapper, {
@@ -94,7 +85,7 @@ const Header = forwardRef(({
94
85
  ref: headerRef,
95
86
  className: classNames(styles.headerMenu, className, {
96
87
  [styles.withMenuPopup]: menuPopupExpanded,
97
- [styles.border]: hasBorder
88
+ [styles.border]: hasBorder || menuPopupExpanded
98
89
  }),
99
90
  "data-test": 'header'
100
91
  }, isMenuPopupVisible && currentTitle && currentUrl && !menuPopupExpanded ? React__default.createElement(LogoSmall, {
@@ -111,10 +102,10 @@ const Header = forwardRef(({
111
102
  setFullSearchActive: setFullSearchActive,
112
103
  searchBoxViewType: resultViewType
113
104
  })) : React__default.createElement(React__default.Fragment, null, !isMenuPopupVisible && React__default.createElement(HorizontalMenu, {
114
- items: items,
105
+ items: itemsWithoutHomeSection,
115
106
  theme: dropdownTheme,
116
107
  linkHandler: linkHandler
117
- }), React__default.createElement(SearchButton, {
108
+ }), !menuPopupExpanded && React__default.createElement(SearchButton, {
118
109
  onClick: handleSearchButtonClick,
119
110
  isActive: hasSearch
120
111
  }), isMenuPopupVisible && React__default.createElement(MenuPopup, {
@@ -38,7 +38,8 @@
38
38
  --ktl-overlay-z-index: 900;
39
39
  --ktl-top-menu-z-index: 905;
40
40
  --ktl-header-z-index: 906;
41
- --ktl-header-height-mobile: 48px;
41
+ --ktl-mobile-dropdown-list-z-index: 907;
42
+ --ktl-header-height-mobile: 52px;
42
43
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
43
44
  --rs-font-family-ui: var(--ktl-font-family-inter);
44
45
  }
@@ -55,12 +56,12 @@
55
56
  }
56
57
 
57
58
  .ktl-header-module_border_paN11 {
58
- box-shadow: inset 0 -1px rgba(255, 255, 255, 0.2);
59
+ box-shadow: inset 0 -1px rgba(255, 255, 255, 0.3);
59
60
  }
60
61
 
61
62
  @media (max-width: 640px) {
62
63
  .ktl-header-module_header-menu_wh71L {
63
- padding: 0 16px;
64
+ padding: 0 0 0 16px;
64
65
  height: var(--ktl-header-height-mobile);
65
66
  }
66
67
 
@@ -84,7 +85,8 @@
84
85
  --ktl-overlay-z-index: 900;
85
86
  --ktl-top-menu-z-index: 905;
86
87
  --ktl-header-z-index: 906;
87
- --ktl-header-height-mobile: 48px;
88
+ --ktl-mobile-dropdown-list-z-index: 907;
89
+ --ktl-header-height-mobile: 52px;
88
90
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
89
91
  --rs-font-family-ui: var(--ktl-font-family-inter);
90
92
  }
@@ -226,7 +228,8 @@
226
228
  --ktl-overlay-z-index: 900;
227
229
  --ktl-top-menu-z-index: 905;
228
230
  --ktl-header-z-index: 906;
229
- --ktl-header-height-mobile: 48px;
231
+ --ktl-mobile-dropdown-list-z-index: 907;
232
+ --ktl-header-height-mobile: 52px;
230
233
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
231
234
  --rs-font-family-ui: var(--ktl-font-family-inter);
232
235
  }
@@ -264,12 +267,13 @@
264
267
  @media (max-width: 640px) {
265
268
  .ktl-search-button-module_button_YHJPv {
266
269
  display: none;
267
- margin: 0 16px 0 0;
268
270
  }
271
+ }
269
272
 
270
- .ktl-search-button-module_button_YHJPv.ktl-search-button-module_active_lUmdh {
271
- display: flex;
272
- }
273
+ @media (min-width: 641px) {
274
+ .ktl-search-button-module_mobileButton_KT2YP {
275
+ display: none;
276
+ }
273
277
  }
274
278
 
275
279
  .ktl-result-module_result_EKhUw {
@@ -692,64 +696,27 @@
692
696
  --ktl-overlay-z-index: 900;
693
697
  --ktl-top-menu-z-index: 905;
694
698
  --ktl-header-z-index: 906;
695
- --ktl-header-height-mobile: 48px;
699
+ --ktl-mobile-dropdown-list-z-index: 907;
700
+ --ktl-header-height-mobile: 52px;
696
701
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
697
702
  --rs-font-family-ui: var(--ktl-font-family-inter);
698
703
  }
699
704
 
700
705
  .ktl-menu-popup-module_menu-popup_Q68IE {
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;
706
+ display: none;
707
+ padding: 8px 0 56px 0;
708
+ background: var(--ktl-dark-100);
709
+ position: fixed;
710
+ top: var(--ktl-header-height-mobile);
711
+ bottom: 0;
712
+ left: 0;
713
+ right: 0;
714
+ overflow: auto;
715
+ z-index: var(--ktl-top-menu-z-index);
749
716
  }
750
717
 
751
718
  .ktl-menu-popup-module_menu-popup-expanded_ggrp9 {
752
- display: block;
719
+ display: block;
753
720
  }
754
721
 
755
722
  .ktl-menu-button-module_button_wB9Mx {
@@ -763,8 +730,8 @@
763
730
  background: none;
764
731
  padding: 0;
765
732
  margin: 0;
766
- width: 24px;
767
- height: 24px;
733
+ width: var(--ktl-header-height-mobile);
734
+ height: var(--ktl-header-height-mobile);
768
735
  align-items: center;
769
736
  justify-content: center;
770
737
  transition: color var(--ktl-transition-xfast),
@@ -777,6 +744,91 @@
777
744
  color: #ffffff;
778
745
  }
779
746
 
747
+ :root {
748
+ --ktl-light-grey: #f4f4f4;
749
+ --ktl-dark-100: rgba(39, 40, 44, 1);
750
+ --ktl-dark-bg-hard: rgba(27, 27, 27, 1);
751
+ --ktl-icon-color-dark: rgba(39, 40, 44, 0.75);
752
+ --ktl-color-white-light: rgba(255, 255, 255, 0.75);
753
+ --ktl-transition-xfast: 100ms;
754
+ --ktl-transition-fast: 300ms;
755
+ --ktl-color-primary-light-theme: #7f52ff;
756
+ --ktl-color-dark-40: rgba(39, 40, 44, 0.4);
757
+ --ktl-light-text-hard: rgba(39, 40, 44, 1);
758
+ --ktl-light-dark-20: rgba(39, 40, 44, 0.2);
759
+ --ktl-overlay-z-index: 900;
760
+ --ktl-top-menu-z-index: 905;
761
+ --ktl-header-z-index: 906;
762
+ --ktl-mobile-dropdown-list-z-index: 907;
763
+ --ktl-header-height-mobile: 52px;
764
+ --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
765
+ --rs-font-family-ui: var(--ktl-font-family-inter);
766
+ }
767
+
768
+ .ktl-menu-list-item-module_menu-item_Aruue {
769
+ --level: 0;
770
+ display: flex;
771
+ align-items: center;
772
+ font-size: 19px;
773
+ line-height: 28px;
774
+ font-weight: 400;
775
+ color: #ffffff;
776
+ text-decoration: none;
777
+ padding: 12px 7px 12px 16px;
778
+ transition: color var(--ktl-transition-xfast),
779
+ background-color var(--ktl-transition-xfast);
780
+ }
781
+
782
+ .ktl-menu-list-item-module_menu-item_Aruue.ktl-menu-list-item-module_active_jHfJR {
783
+ color: var(--ktl-light-text-hard);
784
+ background: rgba(255, 255, 255, 1);
785
+ cursor: default;
786
+ text-decoration: none;
787
+ }
788
+
789
+ .ktl-menu-list-item-module_menu-item_Aruue.ktl-menu-list-item-module_active-with-child_ier2a {
790
+ background: none;
791
+ color: rgba(255, 255, 255, 0.7);
792
+ }
793
+
794
+ .ktl-menu-list-item-module_menu-item-root_Rzcqb:not(a) {
795
+ font-size: 13px;
796
+ text-transform: uppercase;
797
+ line-height: 20px;
798
+ color: rgba(255, 255, 255, 0.7);
799
+ }
800
+
801
+ :root {
802
+ --ktl-light-grey: #f4f4f4;
803
+ --ktl-dark-100: rgba(39, 40, 44, 1);
804
+ --ktl-dark-bg-hard: rgba(27, 27, 27, 1);
805
+ --ktl-icon-color-dark: rgba(39, 40, 44, 0.75);
806
+ --ktl-color-white-light: rgba(255, 255, 255, 0.75);
807
+ --ktl-transition-xfast: 100ms;
808
+ --ktl-transition-fast: 300ms;
809
+ --ktl-color-primary-light-theme: #7f52ff;
810
+ --ktl-color-dark-40: rgba(39, 40, 44, 0.4);
811
+ --ktl-light-text-hard: rgba(39, 40, 44, 1);
812
+ --ktl-light-dark-20: rgba(39, 40, 44, 0.2);
813
+ --ktl-overlay-z-index: 900;
814
+ --ktl-top-menu-z-index: 905;
815
+ --ktl-header-z-index: 906;
816
+ --ktl-mobile-dropdown-list-z-index: 907;
817
+ --ktl-header-height-mobile: 52px;
818
+ --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
819
+ --rs-font-family-ui: var(--ktl-font-family-inter);
820
+ }
821
+
822
+ .ktl-menu-list-module_menu-item-group_mFvUE {
823
+ margin: 8px 0 8px 0;
824
+ padding: 4px 0 8px 0;
825
+ border-top: 1px solid rgba(255, 255, 255, 0.3);
826
+ }
827
+
828
+ .ktl-menu-list-module_menu-item-group_mFvUE:not(:last-child) {
829
+ border-bottom: 1px solid rgba(255, 255, 255, 0.3);
830
+ }
831
+
780
832
  .ktl-logo-small-module_logo-small_iGY12 {
781
833
  flex-grow: 1;
782
834
  display: flex;
@@ -787,6 +839,7 @@
787
839
  .ktl-logo-small-module_link_SKXAa {
788
840
  color: rgba(255, 255, 255, 1);
789
841
  text-decoration: none;
842
+ font-size: 16px;
790
843
  }
791
844
 
792
845
  .ktl-logo-small-module_icon-wrap_6hRnO {
@@ -795,13 +848,10 @@
795
848
  align-items: center;
796
849
  justify-items: center;
797
850
  height: 100%;
798
- margin-right: 16px;
799
- padding-right: 16px;
800
- border-right: 1px solid rgba(255, 255, 255, 0.2);
851
+ margin-right: 12px;
801
852
  }
802
853
 
803
854
  .ktl-logo-small-module_icon_NyEog {
804
- width: 24px;
805
- height: 24px;
806
- margin-left: -4px;
855
+ width: 20px;
856
+ height: 20px;
807
857
  }
@@ -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, 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';
4
+ export { ANDROID_TITLE, ANDROID_URL, COMMUNITY_TITLE, COMMUNITY_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DOCS_TITLE, DOCS_URL, HOME_TITLE, HOME_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';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
 
3
- var _radialGradient, _path;
3
+ var _path, _defs;
4
4
 
5
5
  function _extends() {
6
6
  _extends = Object.assign || function (target) {
@@ -21,27 +21,29 @@ function _extends() {
21
21
  }
22
22
 
23
23
  const SvgKotlinLogoSmall = props => /*#__PURE__*/React.createElement("svg", _extends({
24
- xmlns: "http://www.w3.org/2000/svg",
25
- viewBox: "0 0 24 24"
26
- }, props), _radialGradient || (_radialGradient = /*#__PURE__*/React.createElement("radialGradient", {
24
+ width: 20,
25
+ height: 20,
26
+ fill: "none",
27
+ xmlns: "http://www.w3.org/2000/svg"
28
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
29
+ d: "M20 20H0V0h20L9.793 9.855 20 20Z",
30
+ fill: "url(#kotlin-logo-small_svg__a)"
31
+ })), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("radialGradient", {
27
32
  id: "kotlin-logo-small_svg__a",
28
- cx: 22.432,
29
- cy: 3.493,
30
- r: 21.679,
31
- gradientTransform: "translate(-.19 .042) scale(.9998)",
32
- gradientUnits: "userSpaceOnUse"
33
+ cx: 0,
34
+ cy: 0,
35
+ r: 1,
36
+ gradientUnits: "userSpaceOnUse",
37
+ gradientTransform: "translate(19.335 .822) scale(22.9097)"
33
38
  }, /*#__PURE__*/React.createElement("stop", {
34
39
  offset: 0.003,
35
- stopColor: "#e44857"
40
+ stopColor: "#EF4857"
36
41
  }), /*#__PURE__*/React.createElement("stop", {
37
42
  offset: 0.469,
38
- stopColor: "#c711e1"
43
+ stopColor: "#D211EC"
39
44
  }), /*#__PURE__*/React.createElement("stop", {
40
45
  offset: 1,
41
- stopColor: "#7f52ff"
42
- }))), _path || (_path = /*#__PURE__*/React.createElement("path", {
43
- fill: "url(#kotlin-logo-small_svg__a)",
44
- d: "M22.87 21.68H3.94V2.76h18.93l-9.66 9.32z"
45
- })));
46
+ stopColor: "#7F52FF"
47
+ })))));
46
48
 
47
49
  export { SvgKotlinLogoSmall as default };
@@ -20,7 +20,7 @@ const LogoSmall = ({
20
20
  className: styles.icon
21
21
  })), React__default.createElement("a", {
22
22
  href: homeUrl,
23
- className: classNames(styles.link, textCn('rs-h3'))
23
+ className: classNames(styles.link, textCn('rs-h4'))
24
24
  }, homeTitle));
25
25
  };
26
26
 
@@ -1,20 +1,23 @@
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 SvgHamburgerIcon from './hamburger-icon.svg.js';
5
- import SvgCloseIcon from './close-icon.svg.js';
4
+ import Button from '@rescui/button';
5
+ import { CloseIcon, HamburgerIcon } from '@rescui/icons';
6
6
 
7
7
  const MenuButton = ({
8
8
  onClick,
9
9
  isExpanded
10
10
  }) => {
11
- return React__default.createElement("button", {
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
- }, isExpanded ? React__default.createElement(SvgCloseIcon, null) : React__default.createElement(SvgHamburgerIcon, null));
16
+ onClick: onClick,
17
+ size: 'l',
18
+ mode: 'clear',
19
+ icon: isExpanded ? React__default.createElement(CloseIcon, null) : React__default.createElement(HamburgerIcon, null)
20
+ });
18
21
  };
19
22
 
20
23
  export { MenuButton };
@@ -0,0 +1,33 @@
1
+ import React__default, { Fragment } from 'react';
2
+ import { MenuListItem } from '../menu-list-item/menu-list-item.js';
3
+ import styles from './menu-list.module.pcss.js';
4
+
5
+ const MenuList = ({
6
+ items,
7
+ level,
8
+ linkHandler
9
+ }) => {
10
+ return React__default.createElement(React__default.Fragment, null, items.map((item, i) => React__default.createElement(Fragment, {
11
+ key: i
12
+ }, item.items && item.items.length > 0 ? React__default.createElement("div", {
13
+ className: styles.menuItemGroup
14
+ }, React__default.createElement(MenuListItem, {
15
+ item: item,
16
+ level: level,
17
+ linkHandler: linkHandler
18
+ }), item.items && item.items.length > 0 && React__default.createElement(MenuList, {
19
+ items: item.items,
20
+ level: level + 1,
21
+ linkHandler: linkHandler
22
+ })) : React__default.createElement(React__default.Fragment, null, React__default.createElement(MenuListItem, {
23
+ item: item,
24
+ level: level,
25
+ linkHandler: linkHandler
26
+ }), item.items && React__default.createElement(MenuList, {
27
+ items: item.items,
28
+ level: level + 1,
29
+ linkHandler: linkHandler
30
+ })))));
31
+ };
32
+
33
+ export { MenuList };
@@ -0,0 +1,4 @@
1
+ var styles = {
2
+ "menuItemGroup": "ktl-menu-list-module_menu-item-group_mFvUE"
3
+ };
4
+ export { styles as default };
@@ -0,0 +1,28 @@
1
+ import React__default, { useCallback } from 'react';
2
+ import classNames from 'classnames';
3
+ import styles from './menu-list-item.module.pcss.js';
4
+
5
+ const MenuListItem = ({
6
+ item,
7
+ level,
8
+ linkHandler
9
+ }) => {
10
+ const Tag = item.url ? 'a' : 'span';
11
+ const style = {
12
+ '--level': level
13
+ };
14
+ const handleClick = useCallback(event => linkHandler && item.url && linkHandler(event, item.url), []);
15
+ return React__default.createElement(Tag, Object.assign({}, item.url ? {
16
+ href: item.url,
17
+ onClick: handleClick
18
+ } : {}, {
19
+ className: classNames(styles.menuItem, {
20
+ [styles.menuItemRoot]: level === 0,
21
+ [styles.active]: item.isActive,
22
+ [styles.activeWithChild]: item.items && item.items.length
23
+ }),
24
+ style: style
25
+ }), item.title);
26
+ };
27
+
28
+ export { MenuListItem };
@@ -0,0 +1,7 @@
1
+ var styles = {
2
+ "menuItem": "ktl-menu-list-item-module_menu-item_Aruue",
3
+ "active": "ktl-menu-list-item-module_active_jHfJR",
4
+ "activeWithChild": "ktl-menu-list-item-module_active-with-child_ier2a",
5
+ "menuItemRoot": "ktl-menu-list-item-module_menu-item-root_Rzcqb"
6
+ };
7
+ export { styles as default };
@@ -1,51 +1,11 @@
1
- import React__default, { useRef, useState, useEffect, useLayoutEffect, useCallback, Fragment } from 'react';
1
+ import React__default, { useRef, useState, useEffect, useLayoutEffect, useCallback } 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';
5
6
  import { useTextStyles } from '@rescui/typography';
6
7
  import { clearAllBodyScrollLocks, enableBodyScroll, disableBodyScroll } from 'body-scroll-lock';
7
8
 
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
-
49
9
  const MenuPopup = ({
50
10
  items,
51
11
  isExpanded,
@@ -1,9 +1,5 @@
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",
7
3
  "menuPopupExpanded": "ktl-menu-popup-module_menu-popup-expanded_ggrp9"
8
4
  };
9
5
  export { styles as default };
@@ -1,4 +1,6 @@
1
1
  import { PLAYGROUND_URL, KOTLINLANG_URL } from './consts.js';
2
+ const HOME_TITLE = 'Home';
3
+ const HOME_URL = '/';
2
4
  const SOLUTIONS_TITLE = 'Solutions';
3
5
  const MULTIPLATFORM_MOBILE_TITLE = 'Multiplatform Mobile';
4
6
  const MULTIPLATFORM_MOBILE_URL = `/lp/mobile/`;
@@ -32,6 +34,9 @@ const KOTLIN_DOCS_URL = `/docs/home.html`;
32
34
  const KMM_DOCS_TITLE = 'KMM';
33
35
  const KMM_DOCS_URL = `/docs/mobile/home.html`;
34
36
  const navScheme = [{
37
+ title: HOME_TITLE,
38
+ url: HOME_URL
39
+ }, {
35
40
  title: SOLUTIONS_TITLE,
36
41
  url: null,
37
42
  items: [{
@@ -80,8 +85,9 @@ const navScheme = [{
80
85
  }]
81
86
  }];
82
87
 
83
- function getNavScheme(isUrlActive = (url, currentUrl) => url === currentUrl, currentUrl, isPlayground) {
84
- return navScheme.map(({
88
+ function getNavScheme(isUrlActive = (url, currentUrl) => url === currentUrl, currentUrl, isPlayground, withoutHomeSection) {
89
+ const controlledNavScheme = withoutHomeSection ? navScheme.slice(1) : navScheme;
90
+ return controlledNavScheme.map(({
85
91
  title,
86
92
  url,
87
93
  items
@@ -132,4 +138,4 @@ function makeExternalUrl(url, currentUrl, isPlayground) {
132
138
  return url;
133
139
  }
134
140
 
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 };
141
+ export { ANDROID_TITLE, ANDROID_URL, COMMUNITY_TITLE, COMMUNITY_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DOCS_TITLE, DOCS_URL, HOME_TITLE, HOME_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 };