@jetbrains/kotlin-web-site-ui 4.10.0-alpha.0 → 4.10.0-alpha.2

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.
@@ -41,6 +41,14 @@
41
41
  --ktl-header-height-mobile: 52px;
42
42
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
43
43
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
44
+
45
+ }
46
+
47
+ :root {
48
+ --website-ui-text-color: #19191c;
49
+ --website-ui-text-color-dark: #fff;
50
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
51
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
44
52
  }
45
53
 
46
54
  :root {
@@ -106,6 +114,14 @@
106
114
  --ktl-header-height-mobile: 52px;
107
115
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
108
116
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
117
+
118
+ }
119
+
120
+ :root {
121
+ --website-ui-text-color: #19191c;
122
+ --website-ui-text-color-dark: #fff;
123
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
124
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
109
125
  }
110
126
 
111
127
  :root {
@@ -190,6 +206,14 @@
190
206
  --ktl-header-height-mobile: 52px;
191
207
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
192
208
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
209
+
210
+ }
211
+
212
+ :root {
213
+ --website-ui-text-color: #19191c;
214
+ --website-ui-text-color-dark: #fff;
215
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
216
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
193
217
  }
194
218
 
195
219
  :root {
@@ -34,6 +34,14 @@
34
34
  --ktl-header-height-mobile: 52px;
35
35
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
36
36
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
37
+
38
+ }
39
+
40
+ :root {
41
+ --website-ui-text-color: #19191c;
42
+ --website-ui-text-color-dark: #fff;
43
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
44
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
37
45
  }
38
46
 
39
47
  :root {
@@ -106,6 +114,14 @@
106
114
  --ktl-header-height-mobile: 52px;
107
115
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
108
116
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
117
+
118
+ }
119
+
120
+ :root {
121
+ --website-ui-text-color: #19191c;
122
+ --website-ui-text-color-dark: #fff;
123
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
124
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
109
125
  }
110
126
 
111
127
  :root {
@@ -178,6 +194,14 @@
178
194
  --ktl-header-height-mobile: 52px;
179
195
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
180
196
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
197
+
198
+ }
199
+
200
+ :root {
201
+ --website-ui-text-color: #19191c;
202
+ --website-ui-text-color-dark: #fff;
203
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
204
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
181
205
  }
182
206
 
183
207
  :root {
@@ -42,6 +42,14 @@
42
42
  --ktl-header-height-mobile: 52px;
43
43
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
44
44
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
45
+
46
+ }
47
+
48
+ :root {
49
+ --website-ui-text-color: #19191c;
50
+ --website-ui-text-color-dark: #fff;
51
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
52
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
45
53
  }
46
54
 
47
55
  :root {
@@ -107,6 +115,14 @@
107
115
  --ktl-header-height-mobile: 52px;
108
116
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
109
117
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
118
+
119
+ }
120
+
121
+ :root {
122
+ --website-ui-text-color: #19191c;
123
+ --website-ui-text-color-dark: #fff;
124
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
125
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
110
126
  }
111
127
 
112
128
  :root {
@@ -271,6 +287,14 @@
271
287
  --ktl-header-height-mobile: 52px;
272
288
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
273
289
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
290
+
291
+ }
292
+
293
+ :root {
294
+ --website-ui-text-color: #19191c;
295
+ --website-ui-text-color-dark: #fff;
296
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
297
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
274
298
  }
275
299
 
276
300
  :root {
@@ -749,6 +773,14 @@
749
773
  --ktl-header-height-mobile: 52px;
750
774
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
751
775
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
776
+
777
+ }
778
+
779
+ :root {
780
+ --website-ui-text-color: #19191c;
781
+ --website-ui-text-color-dark: #fff;
782
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
783
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
752
784
  }
753
785
 
754
786
  :root {
@@ -827,6 +859,14 @@
827
859
  --ktl-header-height-mobile: 52px;
828
860
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
829
861
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
862
+
863
+ }
864
+
865
+ :root {
866
+ --website-ui-text-color: #19191c;
867
+ --website-ui-text-color-dark: #fff;
868
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
869
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
830
870
  }
831
871
 
832
872
  :root {
@@ -900,6 +940,14 @@
900
940
  --ktl-header-height-mobile: 52px;
901
941
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
902
942
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
943
+
944
+ }
945
+
946
+ :root {
947
+ --website-ui-text-color: #19191c;
948
+ --website-ui-text-color-dark: #fff;
949
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
950
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
903
951
  }
904
952
 
905
953
  :root {
@@ -926,6 +974,13 @@
926
974
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
927
975
  }
928
976
 
977
+ .ktl-menu-list-module_menu-item-group_mFvUE + .ktl-menu-list-module_menu-item-group_mFvUE {
978
+ margin-top: 0;
979
+ padding-top: 0;
980
+
981
+ border-top: none;
982
+ }
983
+
929
984
  .ktl-logo-small-module_logo-small_iGY12 {
930
985
  flex-grow: 1;
931
986
  display: flex;
@@ -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, HOME_TITLE, HOME_URL, KMM_DOCS_TITLE, KMM_DOCS_URL, KOTLIN_DOCS_TITLE, KOTLIN_DOCS_URL, MULTIPLATFORM_LIBRARIES_TITLE, MULTIPLATFORM_LIBRARIES_URL, MULTIPLATFORM_MOBILE_TITLE, MULTIPLATFORM_MOBILE_URL, PLAY_EXAMPLES_TITLE, PLAY_EXAMPLES_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, getNavScheme } from './nav-scheme.js';
4
+ export { ANDROID_TITLE, ANDROID_URL, API_OVERVIEW_TITLE, API_OVERVIEW_URL, API_TITLE, COMMUNITY_TITLE, COMMUNITY_URL, CORE_API_TITLE, CORE_API_URL, COROUTINES_API_TITLE, COROUTINES_API_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DATETIME_API_TITLE, DATETIME_API_URL, DOCS_NAVIGATION_ITEMS, DOCS_TITLE, DOCS_URL, HOME_TITLE, HOME_URL, IO_API_TITLE, IO_API_URL, KGP_TITLE, KGP_URL, KMM_DOCS_TITLE, KMM_DOCS_URL, KOTLIN_DOCS_TITLE, KOTLIN_DOCS_URL, KTOR_TITLE, KTOR_URL, METADATA_JVM_TITLE, METADATA_JVM_URL, MULTIPLATFORM_LIBRARIES_TITLE, MULTIPLATFORM_LIBRARIES_URL, MULTIPLATFORM_MOBILE_TITLE, MULTIPLATFORM_MOBILE_URL, PLAY_EXAMPLES_TITLE, PLAY_EXAMPLES_URL, PLAY_KOANS_TITLE, PLAY_KOANS_URL, PLAY_TITLE, PLAY_TITLE_FULL, PLAY_URL, SERIALIZATION_API_TITLE, SERIALIZATION_API_URL, SERVER_SIDE_TITLE, SERVER_SIDE_URL, SOLUTIONS_TITLE, TEACH_TITLE, TEACH_URL, TEST_API_TITLE, TEST_API_URL, getNavScheme } from './nav-scheme.js';
@@ -29,6 +29,34 @@ const KOTLIN_DOCS_TITLE = 'Kotlin';
29
29
  const KOTLIN_DOCS_URL = `/docs/home.html`;
30
30
  const KMM_DOCS_TITLE = 'KMM';
31
31
  const KMM_DOCS_URL = `/docs/mobile/home.html`;
32
+ const API_TITLE = 'API';
33
+ const API_OVERVIEW_TITLE = 'APIs overview';
34
+ const API_OVERVIEW_URL = '/docs/api-references.html';
35
+ const CORE_API_TITLE = 'Standard library (stdlib)';
36
+ const CORE_API_URL = '/api/core/kotlin-stdlib/';
37
+ const TEST_API_TITLE = 'Test library (kotlin.test)';
38
+ const TEST_API_URL = '/api/core/kotlin-test/';
39
+ const COROUTINES_API_TITLE = 'Coroutines (kotlinx.coroutines)';
40
+ const COROUTINES_API_URL = '/api/kotlinx.coroutines/kotlinx-coroutines-core/';
41
+ const SERIALIZATION_API_TITLE = 'Serialization (kotlinx.serialization)';
42
+ const SERIALIZATION_API_URL = '/api/kotlinx.serialization/kotlinx-serialization-core/';
43
+ const IO_API_TITLE = 'Kotlin I/O library (kotlinx-io)';
44
+ const IO_API_URL = '/api/kotlinx-io/';
45
+ const DATETIME_API_TITLE = 'Date and time (kotlinx-datetime)';
46
+ const DATETIME_API_URL = '/api/kotlinx-datetime/';
47
+ const METADATA_JVM_TITLE = 'JVM Metadata (kotlin-metadata-jvm)';
48
+ const METADATA_JVM_URL = '/api/kotlinx-metadata-jvm/';
49
+ const KGP_TITLE = 'Kotlin Gradle plugins';
50
+ const KGP_URL = '/api/kotlin-gradle-plugin/';
51
+ const KTOR_TITLE = 'Ktor';
52
+ const KTOR_URL = 'https://api.ktor.io/';
53
+ const DOCS_NAVIGATION_ITEMS = [{
54
+ url: '/docs/home.html',
55
+ title: 'Language guide'
56
+ }, {
57
+ url: '/docs/multiplatform/get-started.html',
58
+ title: 'Multiplatform development'
59
+ }];
32
60
  const navScheme = [{
33
61
  title: HOME_TITLE,
34
62
  url: HOME_URL
@@ -50,7 +78,42 @@ const navScheme = [{
50
78
  }]
51
79
  }, {
52
80
  title: DOCS_TITLE,
53
- url: KOTLIN_DOCS_URL
81
+ url: KOTLIN_DOCS_URL,
82
+ items: DOCS_NAVIGATION_ITEMS
83
+ }, {
84
+ title: API_TITLE,
85
+ url: null,
86
+ items: [{
87
+ title: API_OVERVIEW_TITLE,
88
+ url: API_OVERVIEW_URL
89
+ }, {
90
+ title: CORE_API_TITLE,
91
+ url: CORE_API_URL
92
+ }, {
93
+ title: TEST_API_TITLE,
94
+ url: TEST_API_URL
95
+ }, {
96
+ title: COROUTINES_API_TITLE,
97
+ url: COROUTINES_API_URL
98
+ }, {
99
+ title: SERIALIZATION_API_TITLE,
100
+ url: SERIALIZATION_API_URL
101
+ }, {
102
+ title: IO_API_TITLE,
103
+ url: IO_API_URL
104
+ }, {
105
+ title: DATETIME_API_TITLE,
106
+ url: DATETIME_API_URL
107
+ }, {
108
+ title: METADATA_JVM_TITLE,
109
+ url: METADATA_JVM_URL
110
+ }, {
111
+ title: KGP_TITLE,
112
+ url: KGP_URL
113
+ }, {
114
+ title: KTOR_TITLE,
115
+ url: KTOR_URL
116
+ }]
54
117
  }, {
55
118
  title: COMMUNITY_TITLE,
56
119
  url: COMMUNITY_URL
@@ -63,9 +126,6 @@ const navScheme = [{
63
126
  items: [{
64
127
  title: PLAY_TITLE_FULL,
65
128
  url: PLAY_URL
66
- }, {
67
- title: PLAY_EXAMPLES_TITLE,
68
- url: PLAY_EXAMPLES_URL
69
129
  }, {
70
130
  title: PLAY_KOANS_TITLE,
71
131
  url: PLAY_KOANS_URL
@@ -117,6 +177,10 @@ function makeExternalUrl(url, currentUrl, isPlayground) {
117
177
  if (isPlayground) {
118
178
  if (url.startsWith(PLAY_URL)) {
119
179
  return url.replace(PLAY_URL, '/');
180
+ }
181
+
182
+ if (url.startsWith('https://')) {
183
+ return url;
120
184
  } else {
121
185
  return `${KOTLINLANG_URL}${url}`;
122
186
  }
@@ -125,4 +189,4 @@ function makeExternalUrl(url, currentUrl, isPlayground) {
125
189
  return url;
126
190
  }
127
191
 
128
- 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_LIBRARIES_TITLE, MULTIPLATFORM_LIBRARIES_URL, MULTIPLATFORM_MOBILE_TITLE, MULTIPLATFORM_MOBILE_URL, PLAY_EXAMPLES_TITLE, PLAY_EXAMPLES_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, getNavScheme };
192
+ export { ANDROID_TITLE, ANDROID_URL, API_OVERVIEW_TITLE, API_OVERVIEW_URL, API_TITLE, COMMUNITY_TITLE, COMMUNITY_URL, CORE_API_TITLE, CORE_API_URL, COROUTINES_API_TITLE, COROUTINES_API_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DATETIME_API_TITLE, DATETIME_API_URL, DOCS_NAVIGATION_ITEMS, DOCS_TITLE, DOCS_URL, HOME_TITLE, HOME_URL, IO_API_TITLE, IO_API_URL, KGP_TITLE, KGP_URL, KMM_DOCS_TITLE, KMM_DOCS_URL, KOTLIN_DOCS_TITLE, KOTLIN_DOCS_URL, KTOR_TITLE, KTOR_URL, METADATA_JVM_TITLE, METADATA_JVM_URL, MULTIPLATFORM_LIBRARIES_TITLE, MULTIPLATFORM_LIBRARIES_URL, MULTIPLATFORM_MOBILE_TITLE, MULTIPLATFORM_MOBILE_URL, PLAY_EXAMPLES_TITLE, PLAY_EXAMPLES_URL, PLAY_KOANS_TITLE, PLAY_KOANS_URL, PLAY_TITLE, PLAY_TITLE_FULL, PLAY_URL, SERIALIZATION_API_TITLE, SERIALIZATION_API_URL, SERVER_SIDE_TITLE, SERVER_SIDE_URL, SOLUTIONS_TITLE, TEACH_TITLE, TEACH_URL, TEST_API_TITLE, TEST_API_URL, getNavScheme };
@@ -0,0 +1,42 @@
1
+ import React, { useCallback } from 'react';
2
+ import classNames from 'classnames';
3
+ import styles from './horizontal-menu.module.pcss.js';
4
+ import { useTextStyles } from '@rescui/typography';
5
+
6
+ const HorizontalMenuItem = ({
7
+ item,
8
+ isActive,
9
+ linkHandler
10
+ }) => {
11
+ useTextStyles();
12
+ const handleLink = useCallback(event => linkHandler(event, item.url), [item]);
13
+ return isActive ? React.createElement("span", {
14
+ key: item.url,
15
+ className: styles.itemActive
16
+ }, item.title) : React.createElement("a", {
17
+ href: item.url,
18
+ key: item.url,
19
+ className: styles.item,
20
+ onClick: handleLink,
21
+ target: item.isExternal ? '_blank' : undefined,
22
+ rel: "noreferrer"
23
+ }, item.title);
24
+ };
25
+
26
+ const HorizontalMenu = ({
27
+ items,
28
+ activeIndex,
29
+ linkHandler
30
+ }) => {
31
+ const textCn = useTextStyles();
32
+ return React.createElement("nav", {
33
+ className: classNames(styles.horizontalMenu, textCn('rs-text-2'))
34
+ }, items.map((item, index) => React.createElement(HorizontalMenuItem, {
35
+ key: item.url,
36
+ isActive: index === activeIndex,
37
+ item: item,
38
+ linkHandler: linkHandler
39
+ })));
40
+ };
41
+
42
+ export { HorizontalMenu };
@@ -0,0 +1,6 @@
1
+ var styles = {
2
+ "horizontalMenu": "ktl-horizontal-menu-module_horizontal-menu_bRQN9",
3
+ "item": "ktl-horizontal-menu-module_item_vmotC",
4
+ "itemActive": "ktl-horizontal-menu-module_item-active_gSpD6"
5
+ };
6
+ export { styles as default };
@@ -0,0 +1,146 @@
1
+ :root {
2
+ --ktl-light-grey: #f4f4f4;
3
+ --ktl-dark-100: rgba(39, 40, 44, 1);
4
+ --ktl-dark-bg-hard: rgba(27, 27, 27, 1);
5
+ --ktl-icon-color-dark: rgba(39, 40, 44, 0.75);
6
+ --ktl-color-white-light: rgba(255, 255, 255, 0.75);
7
+ --ktl-transition-xfast: 100ms;
8
+ --ktl-transition-fast: 300ms;
9
+ --ktl-color-primary-light-theme: #7f52ff;
10
+ --ktl-color-dark-40: rgba(39, 40, 44, 0.4);
11
+ --ktl-light-text-hard: rgba(39, 40, 44, 1);
12
+ --ktl-light-dark-20: rgba(39, 40, 44, 0.2);
13
+ --ktl-divider-color: rgba(25, 25, 28, .2);
14
+ --ktl-overlay-z-index: 900;
15
+ --ktl-top-menu-z-index: 905;
16
+ --ktl-header-z-index: 906;
17
+ --ktl-mobile-dropdown-list-z-index: 907;
18
+ --ktl-header-height-mobile: 52px;
19
+ --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
20
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
21
+
22
+ }
23
+
24
+ :root {
25
+ --website-ui-text-color: #19191c;
26
+ --website-ui-text-color-dark: #fff;
27
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
28
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
29
+ }
30
+
31
+ :root {
32
+ --ktl-box-block-s: 4px;
33
+ --ktl-box-block-m: 8px;
34
+ --ktl-box-block-l: 16px;
35
+
36
+ --ktl-box-section-s: 24px;
37
+ --ktl-box-section-m: 32px;
38
+ --ktl-box-section-l: 48px;
39
+
40
+ --ktl-box-page-s: 64px;
41
+ --ktl-box-page-m: 72px;
42
+ --ktl-box-page-l: 96px;
43
+ }
44
+
45
+ .ktl-sub-navigation-module_sub-navigation_dGfIT {
46
+ --sub-navigation-text-color: var(--website-ui-text-color);
47
+ --sub-navigation-background-color: #fff;
48
+
49
+ position: relative;
50
+ display: flex;
51
+ align-items: center;
52
+ gap: 32px;
53
+ height: 64px;
54
+ background-color: var(--sub-navigation-background-color);
55
+ padding: 0 32px;
56
+ overflow: auto;
57
+ }
58
+
59
+ @media (max-width: 640px) {
60
+
61
+ .ktl-sub-navigation-module_sub-navigation_dGfIT {
62
+ height: var(--ktl-header-height-mobile);
63
+ padding: 0 6px 0 4px;
64
+ gap: 16px
65
+ }
66
+ }
67
+
68
+ .ktl-sub-navigation-module_sub-navigation-dark-theme_s4fQ7 {
69
+ --sub-navigation-background-color: rgba(16, 16, 16, 1);
70
+ --sub-navigation-text-color: var(--website-ui-text-color-dark);
71
+ color: var(--sub-navigation-text-color);
72
+ }
73
+
74
+ .ktl-sub-navigation-module_logo_Jm6Jd {
75
+ flex-shrink: 1;
76
+ overflow: hidden;
77
+ text-overflow: ellipsis;
78
+ white-space: nowrap;
79
+ color: var(--sub-navigation-text-color) !important;
80
+ text-decoration: none;
81
+ }
82
+
83
+ .ktl-sub-navigation-module_logo_Jm6Jd:focus-visible {
84
+ outline: var(--website-ui-focus-outline);
85
+ }
86
+
87
+ @media (max-width: 640px) {
88
+
89
+ .ktl-sub-navigation-module_logo_Jm6Jd {
90
+ display: none
91
+ }
92
+ }
93
+
94
+ :root {
95
+ --horizontal-menu-item-padding: 12px;
96
+ }
97
+
98
+ .ktl-horizontal-menu-module_horizontal-menu_bRQN9 {
99
+ display: flex;
100
+ flex-grow: 1;
101
+ justify-content: flex-end;
102
+ align-items: center;
103
+ height: 100%;
104
+ margin-right: calc(-1 * var(--horizontal-menu-item-padding));
105
+ }
106
+
107
+ .ktl-horizontal-menu-module_item_vmotC, .ktl-horizontal-menu-module_item-active_gSpD6 {
108
+ position: relative;
109
+ display: flex;
110
+ align-items: center;
111
+ height: 100%;
112
+ box-sizing: border-box;
113
+ text-align: center;
114
+ white-space: nowrap;
115
+ padding: var(--horizontal-menu-item-padding);
116
+ text-decoration: none;
117
+ color: var(--sub-navigation-text-color) !important;
118
+ }
119
+
120
+ .ktl-horizontal-menu-module_item_vmotC:focus-visible, .ktl-horizontal-menu-module_item-active_gSpD6:focus-visible {
121
+ outline: var(--website-ui-focus-outline);
122
+ outline-offset: -4px;
123
+ }
124
+
125
+ .ktl-horizontal-menu-module_item_vmotC:after, .ktl-horizontal-menu-module_item-active_gSpD6:after {
126
+ content: '';
127
+ display: none;
128
+ height: 2px;
129
+ position: absolute;
130
+ bottom: 4px;
131
+ left: var(--horizontal-menu-item-padding);
132
+ right: var(--horizontal-menu-item-padding);
133
+ background-color: var(--sub-navigation-text-color);
134
+ }
135
+
136
+ .ktl-horizontal-menu-module_item_vmotC:hover {
137
+ background-color: rgba(255, 255, 255, 0.10);
138
+ }
139
+
140
+ .ktl-horizontal-menu-module_item-active_gSpD6 {
141
+ cursor: default;
142
+ }
143
+
144
+ .ktl-horizontal-menu-module_item-active_gSpD6:after {
145
+ display: block;
146
+ }
@@ -0,0 +1,3 @@
1
+ import './index.css';
2
+ import { SubNavigation } from './sub-navigation.js';
3
+ export { SubNavigation as default } from './sub-navigation.js';
@@ -0,0 +1,32 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { useTheme } from '@rescui/ui-contexts';
3
+ import classNames from 'classnames';
4
+ import styles from './sub-navigation.module.pcss.js';
5
+ import { useTextStyles } from '@rescui/typography';
6
+ import { HorizontalMenu } from './horizontal-menu/horizontal-menu.js';
7
+ const SubNavigation = forwardRef(({
8
+ homeUrl,
9
+ title,
10
+ activeIndex,
11
+ items,
12
+ linkHandler = () => null,
13
+ className,
14
+ children
15
+ }) => {
16
+ const theme = useTheme();
17
+ const textCn = useTextStyles();
18
+ return React.createElement("div", {
19
+ className: classNames(styles.subNavigation, className, {
20
+ [styles.subNavigationDarkTheme]: theme === 'dark'
21
+ })
22
+ }, title && React.createElement("a", {
23
+ href: homeUrl,
24
+ className: classNames(styles.logo, textCn('rs-text-2')),
25
+ onClick: event => linkHandler(event, homeUrl)
26
+ }, title), React.createElement(HorizontalMenu, {
27
+ items: items,
28
+ activeIndex: activeIndex,
29
+ linkHandler: linkHandler
30
+ }), children);
31
+ });
32
+ export { SubNavigation };
@@ -0,0 +1,6 @@
1
+ var styles = {
2
+ "subNavigation": "ktl-sub-navigation-module_sub-navigation_dGfIT",
3
+ "subNavigationDarkTheme": "ktl-sub-navigation-module_sub-navigation-dark-theme_s4fQ7",
4
+ "logo": "ktl-sub-navigation-module_logo_Jm6Jd"
5
+ };
6
+ export { styles as default };
@@ -18,6 +18,14 @@
18
18
  --ktl-header-height-mobile: 52px;
19
19
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
20
20
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
21
+
22
+ }
23
+
24
+ :root {
25
+ --website-ui-text-color: #19191c;
26
+ --website-ui-text-color-dark: #fff;
27
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
28
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
21
29
  }
22
30
 
23
31
  :root {
@@ -110,6 +118,14 @@
110
118
  --ktl-header-height-mobile: 52px;
111
119
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
112
120
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
121
+
122
+ }
123
+
124
+ :root {
125
+ --website-ui-text-color: #19191c;
126
+ --website-ui-text-color-dark: #fff;
127
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
128
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
113
129
  }
114
130
 
115
131
  :root {
@@ -18,6 +18,14 @@
18
18
  --ktl-header-height-mobile: 52px;
19
19
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
20
20
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
21
+
22
+ }
23
+
24
+ :root {
25
+ --website-ui-text-color: #19191c;
26
+ --website-ui-text-color-dark: #fff;
27
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
28
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
21
29
  }
22
30
 
23
31
  :root {
@@ -18,6 +18,14 @@
18
18
  --ktl-header-height-mobile: 52px;
19
19
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
20
20
  --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
21
+
22
+ }
23
+
24
+ :root {
25
+ --website-ui-text-color: #19191c;
26
+ --website-ui-text-color-dark: #fff;
27
+ --website-ui-focus-outline-color: rgba(48, 127, 255, 0.5);
28
+ --website-ui-focus-outline: 4px solid var(--website-ui-focus-outline-color);
21
29
  }
22
30
 
23
31
  :root {
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.10.0-alpha.0",
4
+ "version": "4.10.0-alpha.2",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
7
7
  "files": [
@@ -32,8 +32,8 @@
32
32
  "@rescui/ui-contexts": "0.x",
33
33
  "algoliasearch": "4.x",
34
34
  "formik": "2.x",
35
- "react": ">= 16.8.6",
36
- "react-dom": ">= 16.8.6",
35
+ "react": ">= 16.8.6 < 18",
36
+ "react-dom": ">= 16.8.6 < 18",
37
37
  "react-outside-click-handler": "1.x",
38
38
  "react-remove-scroll-bar": "2.x",
39
39
  "react-scrollbar-size": "5.x",