@jetbrains/kotlin-web-site-ui 4.2.0 → 4.3.0-alpha.1
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 +6 -3
- package/out/components/header/full-search/full-search.js +8 -1
- package/out/components/header/header.js +7 -16
- package/out/components/header/header.module.pcss.js +1 -2
- package/out/components/header/index.css +117 -71
- package/out/components/header/index.js +1 -1
- package/out/components/header/logo-small/kotlin-logo-small.svg.js +18 -16
- package/out/components/header/logo-small/logo-small.js +1 -1
- package/out/components/header/menu-popup/menu-button/menu-button.js +8 -5
- package/out/components/header/menu-popup/menu-list/menu-list.js +33 -0
- package/out/components/header/menu-popup/menu-list/menu-list.module.pcss.js +4 -0
- package/out/components/header/menu-popup/menu-list-item/menu-list-item.js +28 -0
- package/out/components/header/menu-popup/menu-list-item/menu-list-item.module.pcss.js +7 -0
- package/out/components/header/menu-popup/menu-popup.js +2 -42
- package/out/components/header/menu-popup/menu-popup.module.pcss.js +0 -4
- package/out/components/header/nav-scheme.js +9 -3
- package/out/components/header/search-button/search-button.js +13 -2
- package/out/components/header/search-button/search-button.module.pcss.js +2 -1
- package/out/components/top-menu/index.css +91 -124
- package/out/components/top-menu/top-menu.js +20 -13
- package/out/components/top-menu/{dropdown-menu → vertical-menu}/arrow-dropdown-icon.svg.js +0 -0
- package/out/components/top-menu/vertical-menu/vertical-menu.js +123 -0
- package/out/components/top-menu/vertical-menu/vertical-menu.module.pcss.js +13 -0
- package/out/components/typography/index.css +2 -1
- package/out/components/youtube-player/index.css +2 -1
- package/package.json +1 -1
- package/out/components/header/menu-popup/menu-button/close-icon.svg.js +0 -35
- package/out/components/header/menu-popup/menu-button/hamburger-icon.svg.js +0 -35
- package/out/components/top-menu/dropdown-menu/dropdown-menu.js +0 -71
- package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +0 -15
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React__default, { useState } from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import styles from './dropdown-menu.module.pcss.js';
|
|
5
|
-
import { useTextStyles } from '@rescui/typography';
|
|
6
|
-
import SvgArrowDropdownIcon from './arrow-dropdown-icon.svg.js';
|
|
7
|
-
import { useTheme } from '@rescui/ui-contexts';
|
|
8
|
-
|
|
9
|
-
const DropdownMenu = ({
|
|
10
|
-
homeUrl,
|
|
11
|
-
title,
|
|
12
|
-
mobileTitle = 'Overview',
|
|
13
|
-
items,
|
|
14
|
-
activeIndex,
|
|
15
|
-
linkHandler,
|
|
16
|
-
mobileOverview = true
|
|
17
|
-
}) => {
|
|
18
|
-
const theme = useTheme();
|
|
19
|
-
const textCn = useTextStyles();
|
|
20
|
-
const [portalRoot, setPortalRoot] = React__default.useState(null);
|
|
21
|
-
React__default.useEffect(() => {
|
|
22
|
-
if (typeof document !== `undefined`) {
|
|
23
|
-
setPortalRoot(document.body);
|
|
24
|
-
}
|
|
25
|
-
}, []);
|
|
26
|
-
|
|
27
|
-
let _items = (mobileOverview ? [{
|
|
28
|
-
title: mobileTitle,
|
|
29
|
-
url: homeUrl
|
|
30
|
-
}] : []).concat(items);
|
|
31
|
-
|
|
32
|
-
const _activeIndex = mobileOverview ? activeIndex + 1 : activeIndex;
|
|
33
|
-
|
|
34
|
-
const activeItem = _items[_activeIndex];
|
|
35
|
-
const [isExpanded, setIsExpanded] = useState(false);
|
|
36
|
-
|
|
37
|
-
const handleClick = () => setIsExpanded(!isExpanded);
|
|
38
|
-
|
|
39
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
40
|
-
className: classNames(styles.dropdownMenu, {
|
|
41
|
-
[styles.dropdownMenuExpanded]: isExpanded
|
|
42
|
-
}),
|
|
43
|
-
onClick: handleClick
|
|
44
|
-
}, React__default.createElement("button", {
|
|
45
|
-
className: classNames(styles.button, textCn('rs-text-2')),
|
|
46
|
-
"aria-haspopup": "true"
|
|
47
|
-
}, React__default.createElement("span", {
|
|
48
|
-
className: styles.buttonText
|
|
49
|
-
}, activeItem.title), React__default.createElement(SvgArrowDropdownIcon, {
|
|
50
|
-
className: styles.icon
|
|
51
|
-
})), React__default.createElement("nav", {
|
|
52
|
-
className: classNames(styles.dropdownList, {
|
|
53
|
-
[styles.dropdownListDarkTheme]: theme === 'dark'
|
|
54
|
-
})
|
|
55
|
-
}, _items.map((item, index) => React__default.createElement("a", {
|
|
56
|
-
key: item.url,
|
|
57
|
-
href: item.url,
|
|
58
|
-
className: classNames(styles.dropdownItem, textCn('rs-text-2'), {
|
|
59
|
-
[styles.dropdownItemActive]: index === _activeIndex
|
|
60
|
-
}),
|
|
61
|
-
onClick: event => linkHandler?.(event, item.url),
|
|
62
|
-
target: item.isExternal ? '_blank' : undefined
|
|
63
|
-
}, item.title)))), !!portalRoot && ReactDOM.createPortal(React__default.createElement("div", {
|
|
64
|
-
className: classNames(styles.overlay, {
|
|
65
|
-
[styles.overlayVisible]: isExpanded
|
|
66
|
-
}),
|
|
67
|
-
onClick: handleClick
|
|
68
|
-
}), portalRoot));
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export { DropdownMenu };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var styles = {
|
|
2
|
-
"dropdownMenu": "ktl-dropdown-menu-module_dropdown-menu_tq2uU",
|
|
3
|
-
"button": "ktl-dropdown-menu-module_button_OYsuv",
|
|
4
|
-
"buttonText": "ktl-dropdown-menu-module_button-text_SJmh-",
|
|
5
|
-
"icon": "ktl-dropdown-menu-module_icon_GGhMI",
|
|
6
|
-
"dropdownList": "ktl-dropdown-menu-module_dropdown-list_Ylkvt",
|
|
7
|
-
"fadein": "ktl-dropdown-menu-module_fadein_MySnq",
|
|
8
|
-
"dropdownItem": "ktl-dropdown-menu-module_dropdown-item_X3tZ-",
|
|
9
|
-
"dropdownItemActive": "ktl-dropdown-menu-module_dropdown-item-active_99q9X",
|
|
10
|
-
"overlay": "ktl-dropdown-menu-module_overlay_segRo",
|
|
11
|
-
"overlayVisible": "ktl-dropdown-menu-module_overlay-visible_MjwEF",
|
|
12
|
-
"dropdownMenuExpanded": "ktl-dropdown-menu-module_dropdown-menu-expanded_EQefy",
|
|
13
|
-
"dropdownListDarkTheme": "ktl-dropdown-menu-module_dropdown-list-dark-theme_P60ol"
|
|
14
|
-
};
|
|
15
|
-
export { styles as default };
|