@jetbrains/kotlin-web-site-ui 4.3.0-alpha.1 → 4.3.0-next-layout.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.
Files changed (39) hide show
  1. package/out/components/breakpoints/constants.js +19 -0
  2. package/out/components/breakpoints/hooks.js +32 -0
  3. package/out/components/breakpoints/index.js +2 -0
  4. package/out/components/cta-block/index.css +2 -2
  5. package/out/components/footer/index.css +3 -6
  6. package/out/components/grid/index.css +65 -65
  7. package/out/components/header/full-search/full-search.js +1 -8
  8. package/out/components/header/header.js +16 -7
  9. package/out/components/header/header.module.pcss.js +2 -1
  10. package/out/components/header/index.css +72 -118
  11. package/out/components/header/index.js +1 -1
  12. package/out/components/header/logo-small/kotlin-logo-small.svg.js +16 -18
  13. package/out/components/header/logo-small/logo-small.js +1 -1
  14. package/out/components/header/menu-popup/menu-button/close-icon.svg.js +35 -0
  15. package/out/components/header/menu-popup/menu-button/hamburger-icon.svg.js +35 -0
  16. package/out/components/header/menu-popup/menu-button/menu-button.js +5 -8
  17. package/out/components/header/menu-popup/menu-popup.js +42 -2
  18. package/out/components/header/menu-popup/menu-popup.module.pcss.js +4 -0
  19. package/out/components/header/nav-scheme.js +3 -9
  20. package/out/components/header/search-button/search-button.js +2 -13
  21. package/out/components/header/search-button/search-button.module.pcss.js +1 -2
  22. package/out/components/layout/index.css +46 -0
  23. package/out/components/layout/index.js +1 -0
  24. package/out/components/popup/index.css +1 -1
  25. package/out/components/quotes-slider/index.css +4 -4
  26. package/out/components/top-menu/{vertical-menu → dropdown-menu}/arrow-dropdown-icon.svg.js +0 -0
  27. package/out/components/top-menu/dropdown-menu/dropdown-menu.js +71 -0
  28. package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +15 -0
  29. package/out/components/top-menu/index.css +124 -91
  30. package/out/components/top-menu/top-menu.js +13 -20
  31. package/out/components/typography/index.css +5 -6
  32. package/out/components/youtube-player/index.css +1 -2
  33. package/package.json +4 -2
  34. package/out/components/header/menu-popup/menu-list/menu-list.js +0 -33
  35. package/out/components/header/menu-popup/menu-list/menu-list.module.pcss.js +0 -4
  36. package/out/components/header/menu-popup/menu-list-item/menu-list-item.js +0 -28
  37. package/out/components/header/menu-popup/menu-list-item/menu-list-item.module.pcss.js +0 -7
  38. package/out/components/top-menu/vertical-menu/vertical-menu.js +0 -123
  39. 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,123 +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),
51
- "aria-haspopup": "true",
52
- onClick: handleOpen
53
- }, React__default.createElement("span", {
54
- className: textCn('rs-text-2', {
55
- hardness: 'hard'
56
- })
57
- }, activeItem.title), React__default.createElement(SvgArrowDropdownIcon, {
58
- className: styles.icon
59
- })), !!portalRoot && isExpanded && createPortal(React__default.createElement(VerticalMenuDropDown, {
60
- title: title,
61
- activeIndex: _activeIndex,
62
- items: _items,
63
- onClose: handleClose,
64
- linkHandler: linkHandler,
65
- topMenuRef: topMenuRef
66
- }), portalRoot)));
67
- };
68
-
69
- const VerticalMenuDropDown = ({
70
- title,
71
- onClose,
72
- items,
73
- linkHandler,
74
- activeIndex,
75
- topMenuRef
76
- }) => {
77
- const textCn = useTextStyles();
78
- const theme = useTheme();
79
- const navRef = useRef(null);
80
- const [navStyle, setNavStyle] = useState({});
81
- useEffect(() => {
82
- if (navRef.current) {
83
- disableBodyScroll(navRef.current);
84
- }
85
-
86
- return clearAllBodyScrollLocks;
87
- }, []);
88
- useLayoutEffect(() => {
89
- if (topMenuRef.current) {
90
- setNavStyle({
91
- top: topMenuRef.current.getBoundingClientRect().top
92
- });
93
- }
94
- }, [topMenuRef]);
95
- return React__default.createElement("nav", {
96
- ref: navRef,
97
- style: navStyle,
98
- className: classNames(styles.dropdownList, {
99
- [styles.dropdownListDarkTheme]: theme === 'dark'
100
- })
101
- }, React__default.createElement("div", {
102
- className: styles.dropdownHeader
103
- }, React__default.createElement("div", {
104
- className: textCn('rs-text-2')
105
- }, title), React__default.createElement(Button, {
106
- mode: 'clear',
107
- size: 'l',
108
- icon: React__default.createElement(CloseIcon, null),
109
- onClick: onClose
110
- })), items.map((item, index) => React__default.createElement("a", {
111
- key: item.url,
112
- href: item.url,
113
- className: classNames(styles.dropdownItem, textCn('rs-text-1', {
114
- hardness: 'hard'
115
- }), {
116
- [styles.dropdownItemActive]: index === activeIndex
117
- }),
118
- onClick: event => linkHandler?.(event, item.url),
119
- target: item.isExternal ? '_blank' : undefined
120
- }, item.title)));
121
- };
122
-
123
- 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 };