@jetbrains/kotlin-web-site-ui 4.8.0-alpha.1 → 4.8.0-alpha.12

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.
@@ -0,0 +1,8 @@
1
+ :focus-visible, :focus[data-focus-method=key] {
2
+ outline: none;
3
+ box-shadow: var(--ktl-focus-outline);
4
+ }
5
+ :root {
6
+ --rs-h2-font-size-mobile: var(--rs-h2-font-size, 35px);
7
+ --rs-h2-line-height-mobile: var(--rs-h2-line-height, 42px);
8
+ }
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -1,5 +1,4 @@
1
1
  import React__default from 'react';
2
- import { useTheme } from '@rescui/ui-contexts';
3
2
  import { SocialList } from './social-list/social-list.js';
4
3
  import { NavList } from './nav/nav-list.js';
5
4
  import { Logo } from './logo/logo.js';
@@ -12,15 +11,11 @@ const Footer = ({
12
11
  className
13
12
  }) => {
14
13
  const textCn = useTextStyles();
15
- const theme = useTheme();
16
14
  const linkClass = textCn('rs-link', {
17
- hardness: 'hard',
18
- mode: 'clear'
15
+ hardness: 'hard'
19
16
  });
20
17
  return React__default.createElement("footer", {
21
- className: classNames(styles.footer, className, {
22
- [styles.footerDarkTheme]: theme === 'dark'
23
- }),
18
+ className: classNames(styles.footer, className),
24
19
  ref: forwardedRef
25
20
  }, React__default.createElement("div", {
26
21
  className: 'ktl-layout ktl-layout--center'
@@ -37,18 +32,18 @@ const Footer = ({
37
32
  }, React__default.createElement("div", {
38
33
  className: styles.motto
39
34
  }, "Supported and developed by\u00A0", React__default.createElement("a", {
40
- className: classNames(linkClass, styles.underlinedLink),
35
+ className: classNames(linkClass),
41
36
  href: "https://www.jetbrains.com/",
42
37
  target: "_blank"
43
38
  }, "JetBrains"), "."), React__default.createElement("div", {
44
39
  className: styles.copyright
45
40
  }, "Kotlin\u2122 is\u00A0protected under the", ' ', React__default.createElement("a", {
46
- className: classNames(linkClass, styles.underlinedLink),
41
+ className: classNames(linkClass),
47
42
  href: "https://kotlinlang.org/foundation/kotlin-foundation.html"
48
43
  }, "Kotlin\u00A0Foundation"), ' ', React__default.createElement("br", {
49
44
  className: styles.copyrightBreakLine
50
- }), "and licensed under the", ' ', React__default.createElement("a", {
51
- className: classNames(linkClass, styles.underlinedLink),
45
+ }), "and\u00A0licensed under the", ' ', React__default.createElement("a", {
46
+ className: classNames(linkClass),
52
47
  target: "_blank",
53
48
  href: "https://github.com/JetBrains/kotlin-web-site/blob/master/LICENSE"
54
49
  }, "Apache 2\u00A0license"), "."))));
@@ -1,7 +1,5 @@
1
1
  var styles = {
2
2
  "footer": "ktl-footer-module_footer_m67Up",
3
- "footerDarkTheme": "ktl-footer-module_footer-dark-theme_YUAFI",
4
- "underlinedLink": "ktl-footer-module_underlined-link_G0wkq",
5
3
  "socialListArea": "ktl-footer-module_social-list-area_bS3eE",
6
4
  "socialListTitle": "ktl-footer-module_social-list-title_HPzIP",
7
5
  "textArea": "ktl-footer-module_text-area_flccc",
@@ -5,14 +5,14 @@
5
5
  }
6
6
 
7
7
  @media (max-width: 616px) {.ktl-social-list-module_social-list_K2Nqu {
8
- -moz-column-gap: 16px;
9
- column-gap: 16px
8
+ -moz-column-gap: var(--ktl-box-block-l);
9
+ column-gap: var(--ktl-box-block-l)
10
10
  }
11
11
  }
12
12
 
13
13
  @media (max-width: 472px) {.ktl-social-list-module_social-list_K2Nqu {
14
- -moz-column-gap: 16px;
15
- column-gap: 16px;
14
+ -moz-column-gap: var(--ktl-box-block-l);
15
+ column-gap: var(--ktl-box-block-l);
16
16
  grid-template-columns: repeat(3, -webkit-min-content);
17
17
  grid-template-columns: repeat(3, min-content);
18
18
  grid-auto-flow: row
@@ -40,7 +40,7 @@
40
40
  --ktl-mobile-dropdown-list-z-index: 907;
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
- --rs-font-family-ui: var(--ktl-font-family-inter);
43
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
44
44
  }
45
45
 
46
46
  :root {
@@ -71,13 +71,13 @@
71
71
  }
72
72
 
73
73
  @media (max-width: 616px) {.ktl-nav-list-module_nav-list_-k4np {
74
- padding: 24px 0;
75
- margin: 24px 0 0;
74
+ padding: var(--ktl-box-section-s) 0;
75
+ margin: var(--ktl-box-section-s) 0 0;
76
76
  border-top: 1px solid rgba(255, 255, 255, 0.2);
77
77
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
78
78
  display: grid;
79
79
  grid-template-columns: 1fr 1fr;
80
- gap: 24px
80
+ gap: var(--ktl-box-section-s)
81
81
  }
82
82
  }
83
83
 
@@ -105,7 +105,7 @@
105
105
  --ktl-mobile-dropdown-list-z-index: 907;
106
106
  --ktl-header-height-mobile: 52px;
107
107
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
108
- --rs-font-family-ui: var(--ktl-font-family-inter);
108
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
109
109
  }
110
110
 
111
111
  :root {
@@ -126,7 +126,7 @@
126
126
  padding-right: 12px;
127
127
  margin-right: 12px;
128
128
  margin-top: 12px;
129
- line-height: 32px;
129
+ line-height: var(--ktl-box-section-s);
130
130
  position: relative;
131
131
  }
132
132
 
@@ -136,9 +136,9 @@
136
136
  right: 0;
137
137
  top: 50%;
138
138
  width: 1px;
139
- height: 12px;
139
+ height: var(--ktl-box-section-s);
140
140
  transform: translateY(-50%);
141
- background-color: rgba(39, 40, 44, 0.2);
141
+ background-color: rgba(255, 255, 255, 0.2);
142
142
  }
143
143
 
144
144
  .ktl-nav-item-module_nav-item_isoyN:last-child {
@@ -190,7 +190,7 @@
190
190
  --ktl-mobile-dropdown-list-z-index: 907;
191
191
  --ktl-header-height-mobile: 52px;
192
192
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
193
- --rs-font-family-ui: var(--ktl-font-family-inter);
193
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
194
194
  }
195
195
 
196
196
  :root {
@@ -208,56 +208,43 @@
208
208
  }
209
209
 
210
210
  .ktl-footer-module_footer_m67Up {
211
- background: var(--ktl-light-grey);
212
- padding: 72px 0;
211
+ background: var(--ktl-dark-100);
212
+ padding: var(--ktl-box-page-m) 0;
213
213
  min-width: 320px;
214
214
  box-sizing: border-box;
215
- font-family: var(--ktl-font-family-inter);
216
215
  text-rendering:optimizeLegibility;
217
216
  -webkit-font-smoothing:antialiased;
218
217
  -moz-osx-font-smoothing:grayscale;
219
218
  }
220
219
 
221
- .ktl-footer-module_footer-dark-theme_YUAFI {
222
- background: var(--ktl-dark-100);
223
- }
224
-
225
- .ktl-footer-module_footer-dark-theme_YUAFI .ktl-footer-module_underlined-link_G0wkq {
226
- border-color: inherit;
227
- }
228
-
229
220
  .ktl-footer-module_social-list-area_bS3eE {
230
221
  display: flex;
231
222
  align-items: center;
232
223
  }
233
224
 
234
225
  .ktl-footer-module_social-list-title_HPzIP {
235
- margin-right: 8px;
226
+ margin-right: var(--ktl-box-block-m);
236
227
  }
237
228
 
238
229
  .ktl-footer-module_text-area_flccc {
239
- margin-top: 8px;
230
+ margin-top: var(--ktl-box-block-m);
240
231
  }
241
232
 
242
233
  .ktl-footer-module_logo-area_SsNTa {
243
- margin-top: 72px;
234
+ margin-top: var(--ktl-box-page-m);
244
235
  }
245
236
 
246
237
  .ktl-footer-module_copyright_XjtgY {
247
238
  display: inline;
248
239
  }
249
240
 
250
- .ktl-footer-module_underlined-link_G0wkq {
251
- border-color: var(--ktl-light-dark-20);
252
- }
253
-
254
241
  .ktl-footer-module_copyrightBreakLine_0hI7E {
255
242
  display: none;
256
243
  }
257
244
 
258
245
  @media (max-width: 808px) {
259
246
  .ktl-footer-module_footer_m67Up {
260
- padding: 48px 0;
247
+ padding: var(--ktl-box-section-l) 0;
261
248
  }
262
249
  }
263
250
 
@@ -267,7 +254,7 @@
267
254
  }
268
255
 
269
256
  .ktl-footer-module_logo-area_SsNTa {
270
- margin-top: 24px;
257
+ margin-top: var(--ktl-box-section-s);
271
258
  }
272
259
 
273
260
  .ktl-footer-module_copyrightBreakLine_0hI7E {
@@ -277,7 +264,11 @@
277
264
 
278
265
  @media (max-width: 472px) {
279
266
  .ktl-footer-module_footer_m67Up {
280
- padding: 24px 0;
267
+ padding: var(--ktl-box-section-s) 0 var(--ktl-box-section-l);
268
+ }
269
+
270
+ .ktl-footer-module_copyrightBreakLine_0hI7E {
271
+ display: none;
281
272
  }
282
273
  }
283
274
  .ktl-layout {
@@ -2,7 +2,7 @@ import React__default from 'react';
2
2
  import { useTheme } from '@rescui/ui-contexts';
3
3
  import classNames from 'classnames';
4
4
  import styles from './social-item.module.pcss.js';
5
- import { Button } from '@rescui/button';
5
+ import Button from '@rescui/button';
6
6
 
7
7
  const SocialItem = ({
8
8
  socialNetwork
@@ -41,7 +41,7 @@
41
41
  --ktl-mobile-dropdown-list-z-index: 907;
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
- --rs-font-family-ui: var(--ktl-font-family-inter);
44
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
45
45
  }
46
46
 
47
47
  :root {
@@ -106,7 +106,7 @@
106
106
  --ktl-mobile-dropdown-list-z-index: 907;
107
107
  --ktl-header-height-mobile: 52px;
108
108
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
109
- --rs-font-family-ui: var(--ktl-font-family-inter);
109
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
110
110
  }
111
111
 
112
112
  :root {
@@ -270,7 +270,7 @@
270
270
  --ktl-mobile-dropdown-list-z-index: 907;
271
271
  --ktl-header-height-mobile: 52px;
272
272
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
273
- --rs-font-family-ui: var(--ktl-font-family-inter);
273
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
274
274
  }
275
275
 
276
276
  :root {
@@ -748,7 +748,7 @@
748
748
  --ktl-mobile-dropdown-list-z-index: 907;
749
749
  --ktl-header-height-mobile: 52px;
750
750
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
751
- --rs-font-family-ui: var(--ktl-font-family-inter);
751
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
752
752
  }
753
753
 
754
754
  :root {
@@ -826,7 +826,7 @@
826
826
  --ktl-mobile-dropdown-list-z-index: 907;
827
827
  --ktl-header-height-mobile: 52px;
828
828
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
829
- --rs-font-family-ui: var(--ktl-font-family-inter);
829
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
830
830
  }
831
831
 
832
832
  :root {
@@ -899,7 +899,7 @@
899
899
  --ktl-mobile-dropdown-list-z-index: 907;
900
900
  --ktl-header-height-mobile: 52px;
901
901
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
902
- --rs-font-family-ui: var(--ktl-font-family-inter);
902
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
903
903
  }
904
904
 
905
905
  :root {
@@ -0,0 +1,52 @@
1
+ .ktl-nav-item-module_navItem_gRy22 {
2
+ padding: 0 12px;
3
+ height: 52px;
4
+ cursor: pointer;
5
+ display: inline-flex;
6
+ align-items: center;
7
+ position: relative;
8
+ box-sizing: border-box;
9
+ border: 0;
10
+ background: none;
11
+ color: #ffffff;
12
+ }
13
+
14
+ .ktl-nav-item-module_navItem_gRy22:hover {
15
+ background: rgba(255, 255, 255, 0.10);
16
+ }
17
+
18
+ .ktl-nav-item-module_navItem_gRy22:active {
19
+ box-shadow: #8979ff 0 0 0 4px;
20
+ outline: none
21
+ }
22
+
23
+ .ktl-nav-item-module_rightIcon_XlxMF {
24
+ flex-direction: row-reverse;
25
+ }
26
+
27
+ .ktl-nav-item-module_navItemActive_gI8Nv::after {
28
+ content: '';
29
+ width: 100%;
30
+ height: 2px;
31
+ background: #ffffff;
32
+ position: absolute;
33
+ bottom: 0;
34
+ left: 0;
35
+ }
36
+
37
+ .ktl-nav-item-module_title_9VXwr {
38
+ display: block;
39
+ }
40
+
41
+ .ktl-nav-item-module_titleWithIcon_CVqpS {
42
+ margin-left: 8px;
43
+ }
44
+
45
+ .ktl-nav-item-module_titleWithIconRight_FwEnm {
46
+ margin-left: 0;
47
+ margin-right: 8px;
48
+ }
49
+
50
+ .ktl-nav-item-module_titleWithoutIcon_XgnMl {
51
+ margin: 0;
52
+ }
@@ -0,0 +1,34 @@
1
+ import './index.css';
2
+ import React from 'react';
3
+ import cn from 'classnames';
4
+ import styles from './nav-item.module.pcss.js';
5
+ import { useTextStyles } from '@rescui/typography';
6
+
7
+ const NavItem = ({
8
+ children,
9
+ icon,
10
+ active,
11
+ iconPosition,
12
+ onClick
13
+ }) => {
14
+ const textCn = useTextStyles();
15
+ const navItemClass = cn(styles.navItem, {
16
+ [styles.navItemActive]: active,
17
+ [styles.rightIcon]: iconPosition === 'right'
18
+ });
19
+ const textStyles = cn(styles.title, {
20
+ [styles.titleWithIcon]: icon,
21
+ [styles.titleWithIconRight]: iconPosition === 'right',
22
+ [styles.titleWithoutIcon]: !children
23
+ });
24
+ return React.createElement("button", {
25
+ className: navItemClass,
26
+ onClick: onClick
27
+ }, icon ? icon : null, React.createElement("div", {
28
+ className: cn(textCn('rs-text-2', {
29
+ hardness: 'hard'
30
+ }), textStyles)
31
+ }, children));
32
+ };
33
+
34
+ export { NavItem, NavItem as default };
@@ -0,0 +1,10 @@
1
+ var styles = {
2
+ "navItem": "ktl-nav-item-module_navItem_gRy22",
3
+ "rightIcon": "ktl-nav-item-module_rightIcon_XlxMF",
4
+ "navItemActive": "ktl-nav-item-module_navItemActive_gI8Nv",
5
+ "title": "ktl-nav-item-module_title_9VXwr",
6
+ "titleWithIcon": "ktl-nav-item-module_titleWithIcon_CVqpS",
7
+ "titleWithIconRight": "ktl-nav-item-module_titleWithIconRight_FwEnm",
8
+ "titleWithoutIcon": "ktl-nav-item-module_titleWithoutIcon_XgnMl"
9
+ };
10
+ export { styles as default };
@@ -0,0 +1,108 @@
1
+ .ktl-sidebar-module_popup_bidR1 {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ z-index: 910;
8
+
9
+ --ktf-header-animation-timing: 250ms;
10
+ --ktf-header-animation-function: cubic-bezier(0.4, 0, 0.2, 1);
11
+ }
12
+
13
+ .ktl-sidebar-module_popup_bidR1::before {
14
+ display: block;
15
+ content: '';
16
+
17
+ position: absolute;
18
+ top: 0;
19
+ bottom: 0;
20
+ right: 0;
21
+ left: 0;
22
+
23
+ visibility: visible;
24
+ -webkit-backdrop-filter: blur(4px);
25
+ backdrop-filter: blur(4px);
26
+
27
+ transition: background-color var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
28
+ visibility var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
29
+ -webkit-backdrop-filter var(--ktf-header-animation-function) var(--ktf-header-animation-timing);
30
+
31
+ transition: background-color var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
32
+ visibility var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
33
+ backdrop-filter var(--ktf-header-animation-function) var(--ktf-header-animation-timing);
34
+
35
+ transition: background-color var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
36
+ visibility var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
37
+ backdrop-filter var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
38
+ -webkit-backdrop-filter var(--ktf-header-animation-function) var(--ktf-header-animation-timing);
39
+ will-change: background-color, visible;
40
+ }
41
+
42
+ .ktl-sidebar-module_popup_bidR1.ktl-sidebar-module_tabletMode_vcf0T {
43
+ --ktl-sidebar-width: 320px;
44
+ }
45
+
46
+ .ktl-sidebar-module_popup_bidR1.ktl-sidebar-module_mobileMode_yCmFY {
47
+ --ktl-sidebar-width: 100%;
48
+ }
49
+
50
+ @media (min-width: 473px) {
51
+
52
+ .ktl-sidebar-module_popup_bidR1:not(:is(.ktl-sidebar-module_tabletMode_vcf0T, .ktl-sidebar-module_mobileMode_yCmFY)) {
53
+ --ktl-sidebar-width: 320px
54
+ }
55
+ }
56
+
57
+ @media (max-width: 472px) {
58
+
59
+ .ktl-sidebar-module_popup_bidR1:not(:is(.ktl-sidebar-module_tabletMode_vcf0T, .ktl-sidebar-module_mobileMode_yCmFY)) {
60
+ --ktl-sidebar-width: 100%
61
+ }
62
+ }
63
+
64
+ .ktl-sidebar-module_content_SzdiT {
65
+ margin-left: auto;
66
+ height: 100%;
67
+ max-width: 100%;
68
+ width: var(--ktl-sidebar-width, auto);
69
+ }
70
+
71
+ .ktl-sidebar-module_dark_GNaUl::before {
72
+ background-color: rgba(0, 0, 0, 0.5);
73
+ }
74
+
75
+ .ktl-sidebar-module_dark_GNaUl > .ktl-sidebar-module_content_SzdiT {
76
+ background-color: var(--ktl-dark-100);
77
+ }
78
+
79
+ .ktl-sidebar-module_light_OnGcf::before {
80
+ background-color: rgba(0, 0, 0, 0.62);
81
+ }
82
+
83
+ .ktl-sidebar-module_light_OnGcf > .ktl-sidebar-module_content_SzdiT {
84
+ background-color: #fff;
85
+ }
86
+
87
+ .ktl-sidebar-module_popup_bidR1 > .ktl-sidebar-module_content_SzdiT {
88
+ transform: translateX(0);
89
+
90
+ transition: transform var(--ktf-header-animation-function) var(--ktf-header-animation-timing),
91
+ visibility var(--ktf-header-animation-function) var(--ktf-header-animation-timing);
92
+ will-change: transform;
93
+ }
94
+
95
+ .ktl-sidebar-module_close_lN33m {
96
+ --ktf-header-animation-timing: 300ms;
97
+ pointer-events: none;
98
+ }
99
+
100
+ .ktl-sidebar-module_close_lN33m::before {
101
+ background: rgba(0, 0, 0, 0);
102
+ visibility: hidden;
103
+ }
104
+
105
+ .ktl-sidebar-module_close_lN33m > .ktl-sidebar-module_content_SzdiT {
106
+ transform: translateX(100%);
107
+ visibility: hidden;
108
+ }
@@ -0,0 +1,2 @@
1
+ import './index.css';
2
+ export { Sidebar, SidebarContext, useSidebarContext } from './sidebar.js';
@@ -0,0 +1,50 @@
1
+ import React, { createContext, useContext, useRef, useCallback } from 'react';
2
+ import cn from 'classnames';
3
+ import { RemoveScrollBar } from 'react-remove-scroll-bar';
4
+ import { useTheme } from '@rescui/ui-contexts';
5
+ import styles from './sidebar.module.css.js';
6
+ const SidebarContext = createContext({});
7
+
8
+ function useSidebarContext() {
9
+ return useContext(SidebarContext);
10
+ }
11
+
12
+ function Sidebar({
13
+ className,
14
+ classNameContent,
15
+ mode,
16
+ children,
17
+ isOpen,
18
+ onClose
19
+ }) {
20
+ const ref = useRef(null);
21
+ const theme = useTheme();
22
+ const onToggleClick = useCallback(e => {
23
+ if (e.currentTarget == e.target) onClose();
24
+ }, [onClose]);
25
+ const classes = cn(className, styles.popup, styles[theme || 'light'], {
26
+ [styles.close]: !isOpen,
27
+ [styles[`${mode}Mode`]]: Boolean(mode && styles[`${mode}Mode`])
28
+ });
29
+ const disableProps = {};
30
+
31
+ if (!isOpen) {
32
+ disableProps.tabIndex = -1;
33
+ disableProps.role = 'none';
34
+ }
35
+
36
+ return React.createElement(SidebarContext.Provider, {
37
+ value: {
38
+ onClose
39
+ }
40
+ }, React.createElement("div", {
41
+ className: classes,
42
+ onClick: onToggleClick,
43
+ ...disableProps
44
+ }, isOpen && React.createElement(RemoveScrollBar, null), React.createElement("div", {
45
+ ref: ref,
46
+ className: cn(classNameContent, styles.content)
47
+ }, children)));
48
+ }
49
+
50
+ export { Sidebar, SidebarContext, useSidebarContext };
@@ -0,0 +1,10 @@
1
+ var styles = {
2
+ "popup": "ktl-sidebar-module_popup_bidR1",
3
+ "tabletMode": "ktl-sidebar-module_tabletMode_vcf0T",
4
+ "mobileMode": "ktl-sidebar-module_mobileMode_yCmFY",
5
+ "content": "ktl-sidebar-module_content_SzdiT",
6
+ "dark": "ktl-sidebar-module_dark_GNaUl",
7
+ "light": "ktl-sidebar-module_light_OnGcf",
8
+ "close": "ktl-sidebar-module_close_lN33m"
9
+ };
10
+ export { styles as default };
@@ -0,0 +1,36 @@
1
+ .ktl-popup-module_popup_b34tS {
2
+ display: flex;
3
+ flex-direction: column;
4
+ }
5
+
6
+ .ktl-popup-module_menu_wZMEB {
7
+ padding: 0;
8
+ margin: 0;
9
+ }
10
+
11
+ .ktl-menu-header-module_header_nm8jO {
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: space-between;
15
+ padding-left: var(--ktl-box-block-l);
16
+ border-bottom: 1px solid transparent;
17
+ margin-bottom: var(--ktl-box-block-m);
18
+ }
19
+
20
+ .ktl-menu-header-module_light_3UtZR {
21
+ border-bottom-color: var(--ktl-divider-color);
22
+ }
23
+
24
+ .ktl-menu-header-module_dark_jdymL {
25
+ border-bottom-color: rgba(255, 255, 255, 0.30);
26
+ }
27
+
28
+ .ktl-menu-header-module_header_nm8jO > .ktl-menu-header-module_trigger_FbJ59 {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ cursor: pointer;
33
+ border-radius: 50%;
34
+ width: 52px;
35
+ height: 52px;
36
+ }
@@ -0,0 +1,3 @@
1
+ import './index.css';
2
+ export { SidebarMenu } from './sidebar-menu.js';
3
+ export { SidebarMenuHeader } from './menu-header.js';
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import cn from 'classnames';
3
+ import { useTheme } from '@rescui/ui-contexts';
4
+ import { CloseIcon } from '@rescui/icons';
5
+ import { Button } from '@rescui/button';
6
+ import { useSidebarContext } from '@jetbrains/kotlin-web-site-ui/out/components/sidebar';
7
+ import styles from './menu-header.module.css.js';
8
+
9
+ function SidebarMenuHeader({
10
+ className,
11
+ children,
12
+ onClose
13
+ }) {
14
+ const theme = useTheme();
15
+ const {
16
+ onClose: onCloseContext
17
+ } = useSidebarContext();
18
+ const close = onClose || onCloseContext;
19
+ return React.createElement("div", {
20
+ className: cn(styles[theme || 'light'], className, styles.header)
21
+ }, children, React.createElement(Button, {
22
+ "aria-label": "close menu",
23
+ mode: "clear",
24
+ className: styles.trigger,
25
+ onClick: close,
26
+ icon: React.createElement(CloseIcon, null)
27
+ }));
28
+ }
29
+
30
+ export { SidebarMenuHeader };
@@ -0,0 +1,7 @@
1
+ var styles = {
2
+ "header": "ktl-menu-header-module_header_nm8jO",
3
+ "light": "ktl-menu-header-module_light_3UtZR",
4
+ "dark": "ktl-menu-header-module_dark_jdymL",
5
+ "trigger": "ktl-menu-header-module_trigger_FbJ59"
6
+ };
7
+ export { styles as default };
@@ -0,0 +1,20 @@
1
+ import React, { useCallback } from 'react';
2
+ import { MenuItem } from '@rescui/menu';
3
+
4
+ function SidebarMenuItem({
5
+ index,
6
+ isActive,
7
+ onClick,
8
+ ...props
9
+ }) {
10
+ const handleClick = useCallback(e => {
11
+ if (onClick) onClick(e, index);
12
+ }, [onClick, index]);
13
+ return React.createElement(MenuItem, {
14
+ selected: isActive,
15
+ ...props,
16
+ onClick: handleClick
17
+ });
18
+ }
19
+
20
+ export { SidebarMenuItem };
@@ -0,0 +1,5 @@
1
+ var styles = {
2
+ "popup": "ktl-popup-module_popup_b34tS",
3
+ "menu": "ktl-popup-module_menu_wZMEB"
4
+ };
5
+ export { styles as default };
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import cn from 'classnames';
3
+ import { Menu } from '@rescui/menu';
4
+ import { Sidebar } from '@jetbrains/kotlin-web-site-ui/out/components/sidebar';
5
+ import { SidebarMenuItem } from './menu-item.js';
6
+ import styles from './popup.module.css.js';
7
+ import '@rescui/ui-contexts';
8
+ import '@rescui/icons';
9
+ import '@rescui/button';
10
+
11
+ function SidebarMenu({
12
+ className,
13
+ before,
14
+ activeIndex,
15
+ items,
16
+ onItemClick,
17
+ ...props
18
+ }) {
19
+ return React.createElement(Sidebar, { ...props,
20
+ className: cn(className, styles.popup)
21
+ }, before, React.createElement(Menu, {
22
+ className: styles.menu
23
+ }, items.map((item, i) => React.createElement(SidebarMenuItem, {
24
+ key: i,
25
+ isActive: i === activeIndex,
26
+ index: i,
27
+ ...item,
28
+ onClick: onItemClick
29
+ }))));
30
+ }
31
+
32
+ export { SidebarMenu };
@@ -17,7 +17,7 @@
17
17
  --ktl-mobile-dropdown-list-z-index: 907;
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
- --rs-font-family-ui: var(--ktl-font-family-inter);
20
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
21
21
  }
22
22
 
23
23
  :root {
@@ -109,7 +109,7 @@
109
109
  --ktl-mobile-dropdown-list-z-index: 907;
110
110
  --ktl-header-height-mobile: 52px;
111
111
  --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
112
- --rs-font-family-ui: var(--ktl-font-family-inter);
112
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
113
113
  }
114
114
 
115
115
  :root {
@@ -17,7 +17,7 @@
17
17
  --ktl-mobile-dropdown-list-z-index: 907;
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
- --rs-font-family-ui: var(--ktl-font-family-inter);
20
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
21
21
  }
22
22
 
23
23
  :root {
@@ -17,7 +17,7 @@
17
17
  --ktl-mobile-dropdown-list-z-index: 907;
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
- --rs-font-family-ui: var(--ktl-font-family-inter);
20
+ --ktl-focus-outline: rgba(107,87,255,.8) 0 0 0 4px;
21
21
  }
22
22
 
23
23
  :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.8.0-alpha.1",
4
+ "version": "4.8.0-alpha.12",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
7
7
  "files": [
@@ -48,15 +48,16 @@
48
48
  "@babel/preset-typescript": "^7.13.0",
49
49
  "@babel/register": "^7.11.5",
50
50
  "@react-hook/resize-observer": "^1.2.5",
51
- "@rescui/button": "^0.9.4",
51
+ "@rescui/button": "^0.10.0",
52
52
  "@rescui/checkbox": "^0.1.0",
53
53
  "@rescui/focus-manager": "^0.1.1",
54
54
  "@rescui/icons": "^0.12.0",
55
55
  "@rescui/input": "^0.4.6",
56
+ "@rescui/menu": "^0.9.4",
56
57
  "@rescui/switcher": "^0.2.2",
57
58
  "@rescui/tooltip": "^0.1.2",
58
- "@rescui/typography": "^0.7.3",
59
- "@rescui/ui-contexts": "^0.1.3",
59
+ "@rescui/typography": "^0.11.0",
60
+ "@rescui/ui-contexts": "^0.4.3",
60
61
  "@rollup/plugin-babel": "^5.3.1",
61
62
  "@rollup/plugin-json": "^4.1.0",
62
63
  "@rollup/plugin-node-resolve": "^13.1.3",