@jetbrains/kotlin-web-site-ui 4.8.0-alpha.3 → 4.8.0-alpha.4
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/social-list/social-item/social-item.js +1 -1
- package/out/components/sidebar/index.js +1 -50
- package/out/components/{sidebar-menu/sidebar/index.js → sidebar/sidebar.js} +6 -2
- package/out/components/sidebar-menu/index.css +36 -37
- package/out/components/sidebar-menu/sidebar/sidebar.js +11 -0
- package/out/components/sidebar-menu/sidebar-menu/index.js +1 -29
- package/out/components/sidebar-menu/sidebar-menu/menu-header.js +1 -1
- package/out/components/sidebar-menu/sidebar-menu/sidebar-menu.js +33 -0
- package/package.json +1 -1
- package/out/components/sidebar-menu/sidebar/sidebar.module.css.js +0 -10
|
@@ -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
|
|
5
|
+
import Button from '@rescui/button';
|
|
6
6
|
|
|
7
7
|
const SocialItem = ({
|
|
8
8
|
socialNetwork
|
|
@@ -1,51 +1,2 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
-
|
|
3
|
-
import cn from 'classnames';
|
|
4
|
-
import { RemoveScrollBar } from 'react-remove-scroll-bar';
|
|
5
|
-
import { useTheme } from '@rescui/ui-contexts';
|
|
6
|
-
import styles from './sidebar.module.css.js';
|
|
7
|
-
const SidebarContext = createContext({});
|
|
8
|
-
|
|
9
|
-
function useSidebarContext() {
|
|
10
|
-
return useContext(SidebarContext);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function Sidebar({
|
|
14
|
-
className,
|
|
15
|
-
classNameContent,
|
|
16
|
-
mode,
|
|
17
|
-
children,
|
|
18
|
-
isOpen,
|
|
19
|
-
onClose
|
|
20
|
-
}) {
|
|
21
|
-
const ref = useRef(null);
|
|
22
|
-
const theme = useTheme();
|
|
23
|
-
const onToggleClick = useCallback(e => {
|
|
24
|
-
if (e.currentTarget == e.target) onClose();
|
|
25
|
-
}, [onClose]);
|
|
26
|
-
const classes = cn(className, styles.popup, styles[theme || 'light'], {
|
|
27
|
-
[styles.close]: !isOpen,
|
|
28
|
-
[styles[`${mode}Mode`]]: Boolean(mode && styles[`${mode}Mode`])
|
|
29
|
-
});
|
|
30
|
-
const disableProps = {};
|
|
31
|
-
|
|
32
|
-
if (!isOpen) {
|
|
33
|
-
disableProps.tabIndex = -1;
|
|
34
|
-
disableProps.role = 'none';
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return React.createElement(SidebarContext.Provider, {
|
|
38
|
-
value: {
|
|
39
|
-
onClose
|
|
40
|
-
}
|
|
41
|
-
}, React.createElement("div", {
|
|
42
|
-
className: classes,
|
|
43
|
-
onClick: onToggleClick,
|
|
44
|
-
...disableProps
|
|
45
|
-
}, isOpen && React.createElement(RemoveScrollBar, null), React.createElement("div", {
|
|
46
|
-
ref: ref,
|
|
47
|
-
className: cn(classNameContent, styles.content)
|
|
48
|
-
}, children)));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { Sidebar, SidebarContext, useSidebarContext };
|
|
2
|
+
export { Sidebar, SidebarContext, useSidebarContext } from './sidebar.js';
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import React, { createContext, useRef, useCallback } from 'react';
|
|
1
|
+
import React, { createContext, useContext, useRef, useCallback } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { RemoveScrollBar } from 'react-remove-scroll-bar';
|
|
4
4
|
import { useTheme } from '@rescui/ui-contexts';
|
|
5
5
|
import styles from './sidebar.module.css.js';
|
|
6
6
|
const SidebarContext = createContext({});
|
|
7
7
|
|
|
8
|
+
function useSidebarContext() {
|
|
9
|
+
return useContext(SidebarContext);
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
function Sidebar({
|
|
9
13
|
className,
|
|
10
14
|
classNameContent,
|
|
@@ -43,4 +47,4 @@ function Sidebar({
|
|
|
43
47
|
}, children)));
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
export { Sidebar, SidebarContext };
|
|
50
|
+
export { Sidebar, SidebarContext, useSidebarContext };
|
|
@@ -1,3 +1,39 @@
|
|
|
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
|
+
}
|
|
1
37
|
.ktl-sidebar-module_popup_bidR1 {
|
|
2
38
|
position: fixed;
|
|
3
39
|
top: 0;
|
|
@@ -106,40 +142,3 @@
|
|
|
106
142
|
transform: translateX(100%);
|
|
107
143
|
visibility: hidden;
|
|
108
144
|
}
|
|
109
|
-
|
|
110
|
-
.ktl-popup-module_popup_b34tS {
|
|
111
|
-
display: flex;
|
|
112
|
-
flex-direction: column;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.ktl-popup-module_menu_wZMEB {
|
|
116
|
-
padding: 0;
|
|
117
|
-
margin: 0;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.ktl-menu-header-module_header_nm8jO {
|
|
121
|
-
display: flex;
|
|
122
|
-
align-items: center;
|
|
123
|
-
justify-content: space-between;
|
|
124
|
-
padding-left: var(--ktl-box-block-l);
|
|
125
|
-
border-bottom: 1px solid transparent;
|
|
126
|
-
margin-bottom: var(--ktl-box-block-m);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.ktl-menu-header-module_light_3UtZR {
|
|
130
|
-
border-bottom-color: var(--ktl-divider-color);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.ktl-menu-header-module_dark_jdymL {
|
|
134
|
-
border-bottom-color: rgba(255, 255, 255, 0.30);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.ktl-menu-header-module_header_nm8jO > .ktl-menu-header-module_trigger_FbJ59 {
|
|
138
|
-
display: flex;
|
|
139
|
-
align-items: center;
|
|
140
|
-
justify-content: center;
|
|
141
|
-
cursor: pointer;
|
|
142
|
-
border-radius: 50%;
|
|
143
|
-
width: 52px;
|
|
144
|
-
height: 52px;
|
|
145
|
-
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import 'classnames';
|
|
3
|
+
import 'react-remove-scroll-bar';
|
|
4
|
+
import '@rescui/ui-contexts';
|
|
5
|
+
const SidebarContext = createContext({});
|
|
6
|
+
|
|
7
|
+
function useSidebarContext() {
|
|
8
|
+
return useContext(SidebarContext);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { SidebarContext, useSidebarContext };
|
|
@@ -1,31 +1,3 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
-
|
|
3
|
-
import cn from 'classnames';
|
|
4
|
-
import { Menu } from '@rescui/menu';
|
|
5
|
-
import { Sidebar } from '../sidebar/index.js';
|
|
6
|
-
import { SidebarMenuItem } from './menu-item.js';
|
|
7
|
-
import styles from './popup.module.css.js';
|
|
2
|
+
export { SidebarMenu } from './sidebar-menu.js';
|
|
8
3
|
export { SidebarMenuHeader } from './menu-header.js';
|
|
9
|
-
|
|
10
|
-
function SidebarMenu({
|
|
11
|
-
className,
|
|
12
|
-
before,
|
|
13
|
-
activeIndex,
|
|
14
|
-
items,
|
|
15
|
-
onItemClick,
|
|
16
|
-
...props
|
|
17
|
-
}) {
|
|
18
|
-
return React.createElement(Sidebar, { ...props,
|
|
19
|
-
className: cn(className, styles.popup)
|
|
20
|
-
}, before, React.createElement(Menu, {
|
|
21
|
-
className: styles.menu
|
|
22
|
-
}, items.map((item, i) => React.createElement(SidebarMenuItem, {
|
|
23
|
-
key: i,
|
|
24
|
-
isActive: i === activeIndex,
|
|
25
|
-
index: i,
|
|
26
|
-
...item,
|
|
27
|
-
onClick: onItemClick
|
|
28
|
-
}))));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { SidebarMenu };
|
|
@@ -4,7 +4,7 @@ import { useTheme } from '@rescui/ui-contexts';
|
|
|
4
4
|
import { CloseIcon } from '@rescui/icons';
|
|
5
5
|
import Button from '@rescui/button';
|
|
6
6
|
import styles from './menu-header.module.css.js';
|
|
7
|
-
import { useSidebarContext } from '
|
|
7
|
+
import { useSidebarContext } from '../sidebar/sidebar.js';
|
|
8
8
|
|
|
9
9
|
function SidebarMenuHeader({
|
|
10
10
|
className,
|
|
@@ -0,0 +1,33 @@
|
|
|
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/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
|
+
import '../sidebar/sidebar.js';
|
|
11
|
+
|
|
12
|
+
function SidebarMenu({
|
|
13
|
+
className,
|
|
14
|
+
before,
|
|
15
|
+
activeIndex,
|
|
16
|
+
items,
|
|
17
|
+
onItemClick,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
return React.createElement(Sidebar, { ...props,
|
|
21
|
+
className: cn(className, styles.popup)
|
|
22
|
+
}, before, React.createElement(Menu, {
|
|
23
|
+
className: styles.menu
|
|
24
|
+
}, items.map((item, i) => React.createElement(SidebarMenuItem, {
|
|
25
|
+
key: i,
|
|
26
|
+
isActive: i === activeIndex,
|
|
27
|
+
index: i,
|
|
28
|
+
...item,
|
|
29
|
+
onClick: onItemClick
|
|
30
|
+
}))));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { SidebarMenu };
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
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 };
|