@jetbrains/kotlin-web-site-ui 4.0.0-alpha.2 → 4.0.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/blocks/formik-wrapper/input.js +3 -3
- package/out/blocks/formik-wrapper/privacy-checkbox.js +17 -21
- package/out/blocks/formik-wrapper/privacy-notice.js +19 -28
- package/out/blocks/formik-wrapper/submit-button.js +3 -3
- package/out/components/cta-block/cta-block.js +17 -33
- package/out/components/footer/footer.js +30 -48
- package/out/components/footer/logo/logo.js +3 -5
- package/out/components/footer/nav/nav-item.js +11 -15
- package/out/components/footer/nav/nav-list.js +8 -11
- package/out/components/footer/social-list/social-item/social-item.js +3 -5
- package/out/components/footer/social-list/social-list.js +6 -7
- package/out/components/header/header.js +27 -32
- package/out/components/header/horizontal-menu/horizontal-menu.js +43 -53
- package/out/components/header/logo-large/logo-large.js +11 -17
- package/out/components/header/logo-small/logo-small.js +11 -17
- package/out/components/header/menu-popup/menu-button/menu-button.js +3 -5
- package/out/components/header/menu-popup/menu-popup.js +28 -37
- package/out/components/header/search-button/search-button.js +6 -6
- package/out/components/popup/popup.js +34 -40
- package/out/components/quotes-slider/quites-slider.js +33 -63
- package/out/components/top-menu/dropdown-menu/dropdown-menu.js +30 -40
- package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +1 -0
- package/out/components/top-menu/horizontal-menu/horizontal-menu.js +13 -17
- package/out/components/top-menu/index.css +11 -0
- package/out/components/top-menu/top-menu.js +19 -23
- package/out/components/youtube-player/youtube-player.js +24 -31
- package/package.json +6 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import styles from './logo-large.module.pcss.js';
|
|
3
3
|
import SvgKotlinLogoLarge from './kotlin-logo-large.svg.js';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -11,25 +11,19 @@ const LogoLarge = ({
|
|
|
11
11
|
}) => {
|
|
12
12
|
const version = productWebUrl ? getProductVersion(productWebUrl) : null;
|
|
13
13
|
const textCn = useTextStyles();
|
|
14
|
-
return
|
|
14
|
+
return React__default.createElement("div", {
|
|
15
15
|
className: classNames(styles.container, className, textCn('rs-text-3', {
|
|
16
16
|
hardness: 'average'
|
|
17
17
|
}))
|
|
18
|
-
}, {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
href: productWebUrl,
|
|
28
|
-
target: "_blank"
|
|
29
|
-
}, {
|
|
30
|
-
children: version
|
|
31
|
-
}), void 0)]
|
|
32
|
-
}), void 0);
|
|
18
|
+
}, React__default.createElement("a", {
|
|
19
|
+
className: styles.link,
|
|
20
|
+
href: KOTLINLANG_URL,
|
|
21
|
+
"aria-label": "Kotlin Home Page"
|
|
22
|
+
}, React__default.createElement(SvgKotlinLogoLarge, null)), version && React__default.createElement("a", {
|
|
23
|
+
className: classNames(styles.versionTag),
|
|
24
|
+
href: productWebUrl,
|
|
25
|
+
target: "_blank"
|
|
26
|
+
}, version));
|
|
33
27
|
};
|
|
34
28
|
|
|
35
29
|
function getProductVersion(productWebUrl) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import SvgKotlinLogoSmall from './kotlin-logo-small.svg.js';
|
|
3
3
|
import styles from './logo-small.module.pcss.js';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -11,23 +11,17 @@ const LogoSmall = ({
|
|
|
11
11
|
className
|
|
12
12
|
}) => {
|
|
13
13
|
const textCn = useTextStyles();
|
|
14
|
-
return
|
|
14
|
+
return React__default.createElement("div", {
|
|
15
15
|
className: classNames(styles.logoSmall, className)
|
|
16
|
-
}, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
href: homeUrl,
|
|
26
|
-
className: classNames(styles.link, textCn('rs-h3'))
|
|
27
|
-
}, {
|
|
28
|
-
children: homeTitle
|
|
29
|
-
}), void 0)]
|
|
30
|
-
}), void 0);
|
|
16
|
+
}, React__default.createElement("a", {
|
|
17
|
+
href: KOTLINLANG_URL,
|
|
18
|
+
className: styles.iconWrap
|
|
19
|
+
}, React__default.createElement(SvgKotlinLogoSmall, {
|
|
20
|
+
className: styles.icon
|
|
21
|
+
})), React__default.createElement("a", {
|
|
22
|
+
href: homeUrl,
|
|
23
|
+
className: classNames(styles.link, textCn('rs-h3'))
|
|
24
|
+
}, homeTitle));
|
|
31
25
|
};
|
|
32
26
|
|
|
33
27
|
export { LogoSmall };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import styles from './menu-button.module.pcss.js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import SvgHamburgerIcon from './hamburger-icon.svg.js';
|
|
@@ -8,15 +8,13 @@ const MenuButton = ({
|
|
|
8
8
|
onClick,
|
|
9
9
|
isExpanded
|
|
10
10
|
}) => {
|
|
11
|
-
return
|
|
11
|
+
return React__default.createElement("button", {
|
|
12
12
|
type: "button",
|
|
13
13
|
className: classNames(styles.button),
|
|
14
14
|
"aria-haspopup": "true",
|
|
15
15
|
"aria-label": "Open the navigation",
|
|
16
16
|
onClick: onClick
|
|
17
|
-
},
|
|
18
|
-
children: isExpanded ? jsx(SvgCloseIcon, {}, void 0) : jsx(SvgHamburgerIcon, {}, void 0)
|
|
19
|
-
}), void 0);
|
|
17
|
+
}, isExpanded ? React__default.createElement(SvgCloseIcon, null) : React__default.createElement(SvgHamburgerIcon, null));
|
|
20
18
|
};
|
|
21
19
|
|
|
22
20
|
export { MenuButton };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef, useState, useEffect, useLayoutEffect, useCallback, Fragment as Fragment$1 } from 'react';
|
|
1
|
+
import React__default, { useRef, useState, useEffect, useLayoutEffect, useCallback, Fragment } from 'react';
|
|
3
2
|
import styles from './menu-popup.module.pcss.js';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import { MenuButton } from './menu-button/menu-button.js';
|
|
@@ -16,7 +15,7 @@ const MenuListItem = ({
|
|
|
16
15
|
'--level': level
|
|
17
16
|
};
|
|
18
17
|
const handleClick = useCallback(event => linkHandler && item.url && linkHandler(event, item.url), []);
|
|
19
|
-
return
|
|
18
|
+
return React__default.createElement(Tag, Object.assign({}, item.url ? {
|
|
20
19
|
href: item.url,
|
|
21
20
|
onClick: handleClick
|
|
22
21
|
} : {}, {
|
|
@@ -26,9 +25,7 @@ const MenuListItem = ({
|
|
|
26
25
|
[styles.activeWithChild]: item.items && item.items.length
|
|
27
26
|
}),
|
|
28
27
|
style: style
|
|
29
|
-
},
|
|
30
|
-
children: item.title
|
|
31
|
-
}), void 0);
|
|
28
|
+
}), item.title);
|
|
32
29
|
};
|
|
33
30
|
|
|
34
31
|
const MenuList = ({
|
|
@@ -36,19 +33,17 @@ const MenuList = ({
|
|
|
36
33
|
level,
|
|
37
34
|
linkHandler
|
|
38
35
|
}) => {
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, i))
|
|
51
|
-
}, void 0);
|
|
36
|
+
return React__default.createElement(React__default.Fragment, null, items.map((item, i) => React__default.createElement(Fragment, {
|
|
37
|
+
key: i
|
|
38
|
+
}, React__default.createElement(MenuListItem, {
|
|
39
|
+
item: item,
|
|
40
|
+
level: level,
|
|
41
|
+
linkHandler: linkHandler
|
|
42
|
+
}), item.items && item.items.length > 0 && React__default.createElement(MenuList, {
|
|
43
|
+
items: item.items,
|
|
44
|
+
level: level + 1,
|
|
45
|
+
linkHandler: linkHandler
|
|
46
|
+
}))));
|
|
52
47
|
};
|
|
53
48
|
|
|
54
49
|
const MenuPopup = ({
|
|
@@ -81,24 +76,20 @@ const MenuPopup = ({
|
|
|
81
76
|
|
|
82
77
|
setExpand(!isExpanded);
|
|
83
78
|
}, [isExpanded, navRef]);
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
linkHandler: linkHandler
|
|
99
|
-
}, void 0)
|
|
100
|
-
}), void 0)]
|
|
101
|
-
}, void 0);
|
|
79
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(MenuButton, {
|
|
80
|
+
onClick: handleClick,
|
|
81
|
+
isExpanded: isExpanded
|
|
82
|
+
}), React__default.createElement("nav", {
|
|
83
|
+
style: navStyle,
|
|
84
|
+
ref: navRef,
|
|
85
|
+
className: classNames(styles.menuPopup, textCn('rs-text-2'), {
|
|
86
|
+
[styles.menuPopupExpanded]: isExpanded
|
|
87
|
+
})
|
|
88
|
+
}, React__default.createElement(MenuList, {
|
|
89
|
+
items: items,
|
|
90
|
+
level: 0,
|
|
91
|
+
linkHandler: linkHandler
|
|
92
|
+
})));
|
|
102
93
|
};
|
|
103
94
|
|
|
104
95
|
export { MenuPopup };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
import styles from './search-button.module.pcss.js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import SvgSearch from './search.svg.js';
|
|
5
|
+
const DATA_TEST_HEADER_SEARCH_BUTTON = 'header-search-button';
|
|
5
6
|
|
|
6
7
|
const SearchButton = ({
|
|
7
8
|
onClick,
|
|
8
9
|
isActive
|
|
9
10
|
}) => {
|
|
10
|
-
return
|
|
11
|
+
return React__default.createElement("button", {
|
|
11
12
|
type: "button",
|
|
12
13
|
className: classNames(styles.button, {
|
|
13
14
|
[styles.active]: isActive
|
|
14
15
|
}),
|
|
16
|
+
"data-test": DATA_TEST_HEADER_SEARCH_BUTTON,
|
|
15
17
|
"aria-label": "Search",
|
|
16
18
|
onClick: onClick
|
|
17
|
-
},
|
|
18
|
-
children: jsx(SvgSearch, {}, void 0)
|
|
19
|
-
}), void 0);
|
|
19
|
+
}, React__default.createElement(SvgSearch, null));
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export { SearchButton };
|
|
22
|
+
export { DATA_TEST_HEADER_SEARCH_BUTTON, SearchButton };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import ReactModal from 'react-modal';
|
|
3
3
|
import { LayeringConsumer, LayeringProvider } from '@rescui/ui-contexts';
|
|
4
4
|
import { CloseIcon, LoadingIcon } from '@rescui/icons';
|
|
@@ -17,45 +17,39 @@ const Popup = ({
|
|
|
17
17
|
ariaHideApp = false,
|
|
18
18
|
...restProps
|
|
19
19
|
}) => {
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, void 0) : children, jsx(RemoveScrollBar, {
|
|
54
|
-
gapMode: "margin"
|
|
55
|
-
}, void 0)]
|
|
56
|
-
}), void 0)
|
|
57
|
-
}), void 0)
|
|
58
|
-
}, void 0);
|
|
20
|
+
return React.createElement(LayeringConsumer, null, ({
|
|
21
|
+
popupZIndex
|
|
22
|
+
}) => React.createElement(LayeringProvider, {
|
|
23
|
+
baseLayer: "popup"
|
|
24
|
+
}, React.createElement(ReactModal, Object.assign({
|
|
25
|
+
isOpen: isOpen,
|
|
26
|
+
className: styles.popup,
|
|
27
|
+
overlayClassName: styles.overlay,
|
|
28
|
+
onRequestClose: onRequestClose,
|
|
29
|
+
shouldCloseOnOverlayClick: shouldCloseOnOverlayClick,
|
|
30
|
+
shouldCloseOnEsc: shouldCloseOnEsc
|
|
31
|
+
}, restProps, {
|
|
32
|
+
ariaHideApp: ariaHideApp,
|
|
33
|
+
style: {
|
|
34
|
+
overlay: {
|
|
35
|
+
zIndex: popupZIndex
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}), !busy && showOuterCloseButton && React.createElement(Button, {
|
|
39
|
+
mode: 'rock',
|
|
40
|
+
theme: 'light',
|
|
41
|
+
icon: React.createElement(CloseIcon, null),
|
|
42
|
+
className: styles.close,
|
|
43
|
+
onClick: onRequestClose,
|
|
44
|
+
"data-test": "close-button"
|
|
45
|
+
}), busy ? React.createElement(LoadingIcon, {
|
|
46
|
+
size: "l",
|
|
47
|
+
theme: "dark",
|
|
48
|
+
mode: "rock",
|
|
49
|
+
"data-test": "loading-icon"
|
|
50
|
+
}) : children, React.createElement(RemoveScrollBar, {
|
|
51
|
+
gapMode: "margin"
|
|
52
|
+
}))));
|
|
59
53
|
};
|
|
60
54
|
|
|
61
55
|
export { Popup };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState, useCallback } from 'react';
|
|
1
|
+
import React__default, { useState, useCallback } from 'react';
|
|
3
2
|
import SwipeableViews from 'react-swipeable-views';
|
|
4
3
|
import cn from 'classnames';
|
|
5
4
|
import SvgQuote from './quote.svg.js';
|
|
@@ -33,68 +32,39 @@ const QuotesSlider = ({
|
|
|
33
32
|
[styles.controlActive]: index + 1 < totalSlides
|
|
34
33
|
});
|
|
35
34
|
const quoteTextClass = large ? 'ktl-subtitle' : 'ktl-text-1';
|
|
36
|
-
return
|
|
35
|
+
return React__default.createElement("div", {
|
|
37
36
|
className: styles.quotesSlider
|
|
38
|
-
}, {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
children: slideTitle
|
|
70
|
-
}), void 0)
|
|
71
|
-
}), void 0), quotes.length > 1 && jsxs("div", Object.assign({
|
|
72
|
-
className: styles.controls
|
|
73
|
-
}, {
|
|
74
|
-
children: [jsx("div", Object.assign({
|
|
75
|
-
className: prevButtonClass,
|
|
76
|
-
onClick: handlePrevSlide
|
|
77
|
-
}, {
|
|
78
|
-
children: jsx(SvgSliderArrow, {}, void 0)
|
|
79
|
-
}), void 0), jsx("div", Object.assign({
|
|
80
|
-
className: styles.slidesCount
|
|
81
|
-
}, {
|
|
82
|
-
children: jsxs("p", Object.assign({
|
|
83
|
-
className: "ktl-text-2"
|
|
84
|
-
}, {
|
|
85
|
-
children: [index + 1, "/", totalSlides]
|
|
86
|
-
}), void 0)
|
|
87
|
-
}), void 0), jsx("div", Object.assign({
|
|
88
|
-
className: nextButtonClass,
|
|
89
|
-
onClick: handleNextSlide
|
|
90
|
-
}, {
|
|
91
|
-
children: jsx(SvgSliderArrow, {}, void 0)
|
|
92
|
-
}), void 0)]
|
|
93
|
-
}), void 0)]
|
|
94
|
-
}), void 0)]
|
|
95
|
-
}, void 0)]
|
|
96
|
-
}), void 0)
|
|
97
|
-
}), void 0);
|
|
37
|
+
}, React__default.createElement("div", {
|
|
38
|
+
className: styles.content
|
|
39
|
+
}, React__default.createElement("div", {
|
|
40
|
+
className: styles.iconContainer
|
|
41
|
+
}, React__default.createElement(SvgQuote, null)), React__default.createElement("div", null, quotes.length > 1 ? React__default.createElement(SwipeableViews, {
|
|
42
|
+
index: index,
|
|
43
|
+
onChangeIndex: handleChangeIndex
|
|
44
|
+
}, quotes.map((quote, i) => React__default.createElement("p", {
|
|
45
|
+
className: quoteTextClass,
|
|
46
|
+
key: i
|
|
47
|
+
}, quote.text))) : React__default.createElement("p", {
|
|
48
|
+
className: quoteTextClass
|
|
49
|
+
}, quotes[0].text), React__default.createElement("div", {
|
|
50
|
+
className: styles.nav
|
|
51
|
+
}, React__default.createElement("div", {
|
|
52
|
+
className: styles.title
|
|
53
|
+
}, React__default.createElement("p", {
|
|
54
|
+
className: "ktl-text-2"
|
|
55
|
+
}, slideTitle)), quotes.length > 1 && React__default.createElement("div", {
|
|
56
|
+
className: styles.controls
|
|
57
|
+
}, React__default.createElement("div", {
|
|
58
|
+
className: prevButtonClass,
|
|
59
|
+
onClick: handlePrevSlide
|
|
60
|
+
}, React__default.createElement(SvgSliderArrow, null)), React__default.createElement("div", {
|
|
61
|
+
className: styles.slidesCount
|
|
62
|
+
}, React__default.createElement("p", {
|
|
63
|
+
className: "ktl-text-2"
|
|
64
|
+
}, index + 1, "/", totalSlides)), React__default.createElement("div", {
|
|
65
|
+
className: nextButtonClass,
|
|
66
|
+
onClick: handleNextSlide
|
|
67
|
+
}, React__default.createElement(SvgSliderArrow, null)))))));
|
|
98
68
|
};
|
|
99
69
|
|
|
100
70
|
export { QuotesSlider };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
1
|
import React__default, { useState } from 'react';
|
|
3
2
|
import ReactDOM from 'react-dom';
|
|
4
3
|
import classNames from 'classnames';
|
|
@@ -37,45 +36,36 @@ const DropdownMenu = ({
|
|
|
37
36
|
|
|
38
37
|
const handleClick = () => setIsExpanded(!isExpanded);
|
|
39
38
|
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}), item.url))
|
|
71
|
-
}), void 0)]
|
|
72
|
-
}), void 0), !!portalRoot && ReactDOM.createPortal(jsx("div", {
|
|
73
|
-
className: classNames(styles.overlay, {
|
|
74
|
-
[styles.overlayVisible]: isExpanded
|
|
75
|
-
}),
|
|
76
|
-
onClick: handleClick
|
|
77
|
-
}, void 0), portalRoot)]
|
|
78
|
-
}, void 0);
|
|
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));
|
|
79
69
|
};
|
|
80
70
|
|
|
81
71
|
export { DropdownMenu };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var styles = {
|
|
2
2
|
"dropdownMenu": "ktl-dropdown-menu-module_dropdown-menu_tq2uU",
|
|
3
3
|
"button": "ktl-dropdown-menu-module_button_OYsuv",
|
|
4
|
+
"buttonText": "ktl-dropdown-menu-module_button-text_SJmh-",
|
|
4
5
|
"icon": "ktl-dropdown-menu-module_icon_GGhMI",
|
|
5
6
|
"dropdownList": "ktl-dropdown-menu-module_dropdown-list_Ylkvt",
|
|
6
7
|
"fadein": "ktl-dropdown-menu-module_fadein_MySnq",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCallback } from 'react';
|
|
1
|
+
import React__default, { useCallback } from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import styles from './horizontal-menu.module.pcss.js';
|
|
5
4
|
import { useTextStyles } from '@rescui/typography';
|
|
@@ -11,21 +10,19 @@ const HorizontalMenuItem = ({
|
|
|
11
10
|
}) => {
|
|
12
11
|
const textCn = useTextStyles();
|
|
13
12
|
const handleLink = useCallback(event => linkHandler(event, item.url), [item]);
|
|
14
|
-
return isActive ?
|
|
13
|
+
return isActive ? React__default.createElement("span", {
|
|
14
|
+
key: item.url,
|
|
15
15
|
className: styles.itemActive
|
|
16
|
-
}, {
|
|
17
|
-
children: item.title
|
|
18
|
-
}), item.url) : jsx("a", Object.assign({
|
|
16
|
+
}, item.title) : React__default.createElement("a", {
|
|
19
17
|
href: item.url,
|
|
18
|
+
key: item.url,
|
|
20
19
|
className: classNames(styles.item, textCn('rs-link', {
|
|
21
20
|
hardness: 'average',
|
|
22
21
|
mode: 'clear'
|
|
23
22
|
})),
|
|
24
23
|
onClick: handleLink,
|
|
25
24
|
target: item.isExternal ? '_blank' : undefined
|
|
26
|
-
},
|
|
27
|
-
children: item.title
|
|
28
|
-
}), item.url);
|
|
25
|
+
}, item.title);
|
|
29
26
|
};
|
|
30
27
|
|
|
31
28
|
const HorizontalMenu = ({
|
|
@@ -34,15 +31,14 @@ const HorizontalMenu = ({
|
|
|
34
31
|
linkHandler
|
|
35
32
|
}) => {
|
|
36
33
|
const textCn = useTextStyles();
|
|
37
|
-
return
|
|
34
|
+
return React__default.createElement("nav", {
|
|
38
35
|
className: classNames(styles.horizontalMenu, textCn('rs-text-2'))
|
|
39
|
-
}, {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}), void 0);
|
|
36
|
+
}, items.map((item, index) => React__default.createElement(HorizontalMenuItem, {
|
|
37
|
+
key: item.url,
|
|
38
|
+
isActive: index === activeIndex,
|
|
39
|
+
item: item,
|
|
40
|
+
linkHandler: linkHandler
|
|
41
|
+
})));
|
|
46
42
|
};
|
|
47
43
|
|
|
48
44
|
export { HorizontalMenu };
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
height: 48px;
|
|
52
52
|
padding: 0 16px;
|
|
53
53
|
grid-gap: 16px;
|
|
54
|
+
grid-template-columns: 1fr auto;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
.ktl-top-menu-module_logo_CNH2W {
|
|
@@ -105,12 +106,15 @@
|
|
|
105
106
|
height: 100%;
|
|
106
107
|
justify-self: flex-start;
|
|
107
108
|
white-space: nowrap;
|
|
109
|
+
min-width: 0;
|
|
110
|
+
max-width: 100%;
|
|
108
111
|
}
|
|
109
112
|
|
|
110
113
|
.ktl-dropdown-menu-module_button_OYsuv {
|
|
111
114
|
border: none;
|
|
112
115
|
background: none;
|
|
113
116
|
height: 100%;
|
|
117
|
+
max-width: 100%;
|
|
114
118
|
padding: 0;
|
|
115
119
|
margin: 0;
|
|
116
120
|
display: flex;
|
|
@@ -119,11 +123,18 @@
|
|
|
119
123
|
cursor: pointer;
|
|
120
124
|
}
|
|
121
125
|
|
|
126
|
+
.ktl-dropdown-menu-module_button-text_SJmh- {
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
text-overflow: ellipsis;
|
|
129
|
+
flex: 0 1 auto;
|
|
130
|
+
}
|
|
131
|
+
|
|
122
132
|
.ktl-dropdown-menu-module_icon_GGhMI {
|
|
123
133
|
width: 12px;
|
|
124
134
|
height: 6px;
|
|
125
135
|
margin-left: 6px;
|
|
126
136
|
transition: transform ease-in-out var(--ktl-transition-xfast);
|
|
137
|
+
flex: 0 0 auto;
|
|
127
138
|
}
|
|
128
139
|
|
|
129
140
|
.ktl-dropdown-menu-module_dropdown-list_Ylkvt {
|