@jetbrains/kotlin-web-site-ui 4.2.0-alpha.4 → 4.2.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 (33) hide show
  1. package/out/components/footer/index.css +3 -6
  2. package/out/components/header/full-search/full-search.js +1 -8
  3. package/out/components/header/header.js +31 -13
  4. package/out/components/header/index.css +84 -120
  5. package/out/components/header/index.js +1 -1
  6. package/out/components/header/logo-small/logo-small.js +1 -1
  7. package/out/components/header/menu-popup/menu-button/close-icon.svg.js +35 -0
  8. package/out/components/header/menu-popup/menu-button/hamburger-icon.svg.js +35 -0
  9. package/out/components/header/menu-popup/menu-button/menu-button.js +5 -8
  10. package/out/components/header/menu-popup/menu-popup.js +42 -2
  11. package/out/components/header/menu-popup/menu-popup.module.pcss.js +4 -0
  12. package/out/components/header/nav-scheme.js +3 -9
  13. package/out/components/header/quick-search/list/list.js +5 -3
  14. package/out/components/header/quick-search/quick-search.js +12 -5
  15. package/out/components/header/quick-search/quick-search.module.pcss.js +2 -1
  16. package/out/components/header/quick-search/result/result.js +1 -1
  17. package/out/components/header/search-box/search-box.js +5 -3
  18. package/out/components/header/search-button/search-button.js +2 -13
  19. package/out/components/header/search-button/search-button.module.pcss.js +1 -2
  20. package/out/components/top-menu/{vertical-menu → dropdown-menu}/arrow-dropdown-icon.svg.js +0 -0
  21. package/out/components/top-menu/dropdown-menu/dropdown-menu.js +71 -0
  22. package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +15 -0
  23. package/out/components/top-menu/index.css +122 -87
  24. package/out/components/top-menu/top-menu.js +13 -20
  25. package/out/components/typography/index.css +1 -2
  26. package/out/components/youtube-player/index.css +1 -2
  27. package/package.json +2 -2
  28. package/out/components/header/menu-popup/menu-list/menu-list.js +0 -33
  29. package/out/components/header/menu-popup/menu-list/menu-list.module.pcss.js +0 -4
  30. package/out/components/header/menu-popup/menu-list-item/menu-list-item.js +0 -28
  31. package/out/components/header/menu-popup/menu-list-item/menu-list-item.module.pcss.js +0 -7
  32. package/out/components/top-menu/vertical-menu/vertical-menu.js +0 -119
  33. package/out/components/top-menu/vertical-menu/vertical-menu.module.pcss.js +0 -13
@@ -1,28 +0,0 @@
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 };
@@ -1,7 +0,0 @@
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,119 +0,0 @@
1
- import React__default, { useState, useCallback, useEffect, useRef, useLayoutEffect } from 'react';
2
- import classNames from 'classnames';
3
- import styles from './vertical-menu.module.pcss.js';
4
- import { useTextStyles } from '@rescui/typography';
5
- import SvgArrowDropdownIcon from './arrow-dropdown-icon.svg.js';
6
- import { useTheme } from '@rescui/ui-contexts';
7
- import Button from '@rescui/button';
8
- import { CloseIcon } from '@rescui/icons';
9
- import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock';
10
- import { createPortal } from 'react-dom';
11
-
12
- const VerticalMenu = ({
13
- homeUrl,
14
- title,
15
- mobileTitle = 'Overview',
16
- items,
17
- activeIndex,
18
- linkHandler,
19
- mobileOverview = true,
20
- topMenuRef
21
- }) => {
22
- const textCn = useTextStyles();
23
-
24
- let _items = (mobileOverview ? [{
25
- title: mobileTitle,
26
- url: homeUrl
27
- }] : []).concat(items);
28
-
29
- const _activeIndex = mobileOverview ? activeIndex + 1 : activeIndex;
30
-
31
- const activeItem = _items[_activeIndex];
32
- const [isExpanded, setIsExpanded] = useState(false);
33
- const [portalRoot, setPortalRoot] = useState(null);
34
- const handleOpen = useCallback(() => {
35
- setIsExpanded(true);
36
- }, []);
37
- const handleClose = useCallback(() => {
38
- setIsExpanded(false);
39
- }, []);
40
- useEffect(() => {
41
- if (typeof document !== `undefined`) {
42
- setPortalRoot(document.body);
43
- }
44
- }, []);
45
- return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
46
- className: classNames(styles.dropdownMenu, {
47
- [styles.dropdownMenuExpanded]: isExpanded
48
- })
49
- }, React__default.createElement("button", {
50
- className: classNames(styles.button, textCn('rs-text-2')),
51
- "aria-haspopup": "true",
52
- onClick: handleOpen
53
- }, React__default.createElement("span", {
54
- className: styles.buttonText
55
- }, activeItem.title), React__default.createElement(SvgArrowDropdownIcon, {
56
- className: styles.icon
57
- })), !!portalRoot && isExpanded && createPortal(React__default.createElement(VerticalMenuDropDown, {
58
- title: title,
59
- activeIndex: _activeIndex,
60
- items: _items,
61
- onClose: handleClose,
62
- linkHandler: linkHandler,
63
- topMenuRef: topMenuRef
64
- }), portalRoot)));
65
- };
66
-
67
- const VerticalMenuDropDown = ({
68
- title,
69
- onClose,
70
- items,
71
- linkHandler,
72
- activeIndex,
73
- topMenuRef
74
- }) => {
75
- const textCn = useTextStyles();
76
- const theme = useTheme();
77
- const navRef = useRef(null);
78
- const [navStyle, setNavStyle] = useState({});
79
- useEffect(() => {
80
- if (navRef.current) {
81
- disableBodyScroll(navRef.current);
82
- }
83
-
84
- return clearAllBodyScrollLocks;
85
- }, []);
86
- useLayoutEffect(() => {
87
- if (topMenuRef.current) {
88
- setNavStyle({
89
- top: topMenuRef.current.getBoundingClientRect().top
90
- });
91
- }
92
- }, [topMenuRef]);
93
- return React__default.createElement("nav", {
94
- ref: navRef,
95
- style: navStyle,
96
- className: classNames(styles.dropdownList, {
97
- [styles.dropdownListDarkTheme]: theme === 'dark'
98
- })
99
- }, React__default.createElement("div", {
100
- className: styles.dropdownHeader
101
- }, React__default.createElement("div", {
102
- className: textCn('rs-text-2')
103
- }, title), React__default.createElement(Button, {
104
- mode: 'clear',
105
- size: 'l',
106
- icon: React__default.createElement(CloseIcon, null),
107
- onClick: onClose
108
- })), items.map((item, index) => React__default.createElement("a", {
109
- key: item.url,
110
- href: item.url,
111
- className: classNames(styles.dropdownItem, textCn('rs-text-1'), {
112
- [styles.dropdownItemActive]: index === activeIndex
113
- }),
114
- onClick: event => linkHandler?.(event, item.url),
115
- target: item.isExternal ? '_blank' : undefined
116
- }, item.title)));
117
- };
118
-
119
- export { VerticalMenu };
@@ -1,13 +0,0 @@
1
- var styles = {
2
- "verticalMenu": "ktl-vertical-menu-module_vertical-menu_aLIbw",
3
- "button": "ktl-vertical-menu-module_button_zqr20",
4
- "buttonText": "ktl-vertical-menu-module_button-text_aXith",
5
- "icon": "ktl-vertical-menu-module_icon_-Ieat",
6
- "dropdownHeader": "ktl-vertical-menu-module_dropdown-header_77lTy",
7
- "dropdownList": "ktl-vertical-menu-module_dropdown-list_N3KWV",
8
- "dropdownItem": "ktl-vertical-menu-module_dropdown-item_XLfp4",
9
- "dropdownItemActive": "ktl-vertical-menu-module_dropdown-item-active_iBUbj",
10
- "verticalMenuExpanded": "ktl-vertical-menu-module_vertical-menu-expanded_kFaaI",
11
- "dropdownListDarkTheme": "ktl-vertical-menu-module_dropdown-list-dark-theme_A1-Bw"
12
- };
13
- export { styles as default };