@jetbrains/kotlin-web-site-ui 3.1.0-multiplatform-title.0 → 4.0.0-alpha.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.
- package/out/blocks/formik-wrapper/index.css +8 -0
- package/out/blocks/formik-wrapper/index.js +4 -0
- package/out/blocks/formik-wrapper/input.js +38 -0
- package/out/blocks/formik-wrapper/privacy-checkbox.js +52 -0
- package/out/blocks/formik-wrapper/privacy-notice.js +49 -0
- package/out/blocks/formik-wrapper/privacy-notice.module.pcss.js +6 -0
- package/out/blocks/formik-wrapper/submit-button.js +21 -0
- package/out/components/cta-block/cta-block.js +45 -0
- package/out/components/cta-block/cta-block.module.pcss.js +8 -0
- package/out/components/cta-block/index.css +36 -0
- package/out/components/cta-block/index.js +3 -0
- package/out/components/footer/footer.js +73 -0
- package/out/components/footer/footer.module.pcss.js +13 -0
- package/out/components/footer/index.css +242 -0
- package/out/components/footer/index.js +3 -0
- package/out/components/footer/logo/jetbrains-logo.svg.js +38 -0
- package/out/components/footer/logo/logo.js +14 -0
- package/out/components/footer/logo/logo.module.pcss.js +4 -0
- package/out/components/footer/nav/nav-data.js +30 -0
- package/out/components/footer/nav/nav-item.js +31 -0
- package/out/components/footer/nav/nav-item.module.pcss.js +5 -0
- package/out/components/footer/nav/nav-list.js +18 -0
- package/out/components/footer/nav/nav-list.module.pcss.js +4 -0
- package/out/components/footer/social-list/social-data.js +38 -0
- package/out/components/footer/social-list/social-item/social-item.js +23 -0
- package/out/components/footer/social-list/social-item/social-item.module.pcss.js +5 -0
- package/out/components/footer/social-list/social-list.js +14 -0
- package/out/components/footer/social-list/social-list.module.pcss.js +4 -0
- package/out/components/footer/social-list/svg/github-logo.svg.js +35 -0
- package/out/components/footer/social-list/svg/reddit-logo.svg.js +33 -0
- package/out/components/footer/social-list/svg/slack-logo.svg.js +33 -0
- package/out/components/footer/social-list/svg/stackoverflow-logo.svg.js +36 -0
- package/out/components/footer/social-list/svg/twitter-logo.svg.js +33 -0
- package/out/components/footer/social-list/svg/youtube-logo.svg.js +35 -0
- package/out/components/grid/index.css +1081 -0
- package/out/components/grid/index.js +1 -0
- package/out/components/header/consts.js +3 -0
- package/out/components/header/header.js +68 -0
- package/out/components/header/header.module.pcss.js +6 -0
- package/out/components/header/horizontal-menu/horizontal-menu.js +110 -0
- package/out/components/header/horizontal-menu/horizontal-menu.module.pcss.js +16 -0
- package/out/components/header/index.css +402 -0
- package/out/components/header/index.js +4 -0
- package/out/components/header/logo-large/kotlin-logo-large.svg.js +53 -0
- package/out/components/header/logo-large/logo-large.js +40 -0
- package/out/components/header/logo-large/logo-large.module.pcss.js +6 -0
- package/out/components/header/logo-small/kotlin-logo-small.svg.js +47 -0
- package/out/components/header/logo-small/logo-small.js +33 -0
- package/out/components/header/logo-small/logo-small.module.pcss.js +7 -0
- package/out/components/header/menu-popup/menu-button/close-icon.svg.js +35 -0
- package/out/components/header/menu-popup/menu-button/hamburger-icon.svg.js +35 -0
- package/out/components/header/menu-popup/menu-button/menu-button.js +22 -0
- package/out/components/header/menu-popup/menu-button/menu-button.pcss.js +2 -0
- package/out/components/header/menu-popup/menu-popup.js +104 -0
- package/out/components/header/menu-popup/menu-popup.module.pcss.js +9 -0
- package/out/components/header/nav-scheme.js +135 -0
- package/out/components/header/search-button/search-button.js +22 -0
- package/out/components/header/search-button/search-button.module.pcss.js +5 -0
- package/out/components/header/search-button/search.svg.js +34 -0
- package/out/components/popup/index.css +35 -0
- package/out/components/popup/index.js +3 -0
- package/out/components/popup/popup.js +61 -0
- package/out/components/popup/popup.module.pcss.js +6 -0
- package/out/components/quotes-slider/index.css +86 -0
- package/out/components/quotes-slider/index.js +3 -0
- package/out/components/quotes-slider/quites-slider.js +100 -0
- package/out/components/quotes-slider/quote.svg.js +33 -0
- package/out/components/quotes-slider/quotes-slider.module.pcss.js +13 -0
- package/out/components/quotes-slider/slider-arrow.svg.js +33 -0
- package/out/components/top-menu/dropdown-menu/arrow-dropdown-icon.svg.js +34 -0
- package/out/components/top-menu/dropdown-menu/dropdown-menu.js +81 -0
- package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +14 -0
- package/out/components/top-menu/horizontal-menu/horizontal-menu.js +48 -0
- package/out/components/top-menu/horizontal-menu/horizontal-menu.module.pcss.js +6 -0
- package/out/components/top-menu/index.css +224 -0
- package/out/components/top-menu/index.js +3 -0
- package/out/components/top-menu/top-menu.js +51 -0
- package/out/components/top-menu/top-menu.module.pcss.js +6 -0
- package/out/components/typography/create-text-cn.js +26 -0
- package/out/components/typography/hooks.js +6 -0
- package/out/components/typography/index.css +176 -0
- package/out/components/typography/index.js +3 -0
- package/out/components/youtube-player/index.css +119 -0
- package/out/components/youtube-player/index.js +3 -0
- package/out/components/youtube-player/loading_24.svg.js +31 -0
- package/out/components/youtube-player/play_24.svg.js +31 -0
- package/out/components/youtube-player/utils.js +28 -0
- package/out/components/youtube-player/youtube-player.js +152 -0
- package/out/components/youtube-player/youtube-player.module.pcss.js +16 -0
- package/out/packages/data-services/index.js +9 -0
- package/out/packages/data-services/marketo-submiter.js +62 -0
- package/out/packages/data-services/privacy-consent-ids.json.js +5 -0
- package/out/packages/data-services/privacy-consent-service.js +44 -0
- package/out/packages/data-services/urls.js +4 -0
- package/{dist → out}/svg/kotlin_64.svg +0 -0
- package/package.json +18 -2
- package/dist/ctaBlock.css +0 -2
- package/dist/ctaBlock.css.map +0 -1
- package/dist/ctaBlock.js +0 -3
- package/dist/ctaBlock.js.LICENSE.txt +0 -8
- package/dist/ctaBlock.js.map +0 -1
- package/dist/dataServices.js +0 -3
- package/dist/dataServices.js.LICENSE.txt +0 -17
- package/dist/dataServices.js.map +0 -1
- package/dist/footer.css +0 -2
- package/dist/footer.css.map +0 -1
- package/dist/footer.js +0 -3
- package/dist/footer.js.LICENSE.txt +0 -14
- package/dist/footer.js.map +0 -1
- package/dist/formikWrappers.css +0 -2
- package/dist/formikWrappers.css.map +0 -1
- package/dist/formikWrappers.js +0 -3
- package/dist/formikWrappers.js.LICENSE.txt +0 -14
- package/dist/formikWrappers.js.map +0 -1
- package/dist/grid.css +0 -2
- package/dist/grid.css.map +0 -1
- package/dist/grid.js +0 -2
- package/dist/grid.js.map +0 -1
- package/dist/header.css +0 -2
- package/dist/header.css.map +0 -1
- package/dist/header.js +0 -3
- package/dist/header.js.LICENSE.txt +0 -14
- package/dist/header.js.map +0 -1
- package/dist/popup.css +0 -2
- package/dist/popup.css.map +0 -1
- package/dist/popup.js +0 -3
- package/dist/popup.js.LICENSE.txt +0 -26
- package/dist/popup.js.map +0 -1
- package/dist/quotesSlider.css +0 -2
- package/dist/quotesSlider.css.map +0 -1
- package/dist/quotesSlider.js +0 -3
- package/dist/quotesSlider.js.LICENSE.txt +0 -14
- package/dist/quotesSlider.js.map +0 -1
- package/dist/svg/loading_24.svg +0 -1
- package/dist/svg/play_24.svg +0 -1
- package/dist/svg/quote.svg +0 -3
- package/dist/svg/slider-arrow.svg +0 -3
- package/dist/topMenu.css +0 -2
- package/dist/topMenu.css.map +0 -1
- package/dist/topMenu.js +0 -3
- package/dist/topMenu.js.LICENSE.txt +0 -14
- package/dist/topMenu.js.map +0 -1
- package/dist/typography.css +0 -2
- package/dist/typography.css.map +0 -1
- package/dist/typography.js +0 -2
- package/dist/typography.js.map +0 -1
- package/dist/youtubePlayer.css +0 -2
- package/dist/youtubePlayer.css.map +0 -1
- package/dist/youtubePlayer.js +0 -3
- package/dist/youtubePlayer.js.LICENSE.txt +0 -14
- package/dist/youtubePlayer.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import styles from './logo-large.module.pcss.js';
|
|
3
|
+
import SvgKotlinLogoLarge from './kotlin-logo-large.svg.js';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { useTextStyles } from '@rescui/typography';
|
|
6
|
+
import { KOTLINLANG_URL } from '../consts.js';
|
|
7
|
+
|
|
8
|
+
const LogoLarge = ({
|
|
9
|
+
productWebUrl,
|
|
10
|
+
className
|
|
11
|
+
}) => {
|
|
12
|
+
const version = productWebUrl ? getProductVersion(productWebUrl) : null;
|
|
13
|
+
const textCn = useTextStyles();
|
|
14
|
+
return jsxs("div", Object.assign({
|
|
15
|
+
className: classNames(styles.container, className, textCn('rs-text-3', {
|
|
16
|
+
hardness: 'average'
|
|
17
|
+
}))
|
|
18
|
+
}, {
|
|
19
|
+
children: [jsx("a", Object.assign({
|
|
20
|
+
className: styles.link,
|
|
21
|
+
href: KOTLINLANG_URL,
|
|
22
|
+
"aria-label": "Kotlin Home Page"
|
|
23
|
+
}, {
|
|
24
|
+
children: jsx(SvgKotlinLogoLarge, {}, void 0)
|
|
25
|
+
}), void 0), version && jsx("a", Object.assign({
|
|
26
|
+
className: classNames(styles.versionTag),
|
|
27
|
+
href: productWebUrl,
|
|
28
|
+
target: "_blank"
|
|
29
|
+
}, {
|
|
30
|
+
children: version
|
|
31
|
+
}), void 0)]
|
|
32
|
+
}), void 0);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function getProductVersion(productWebUrl) {
|
|
36
|
+
const match = /v?\d+\.\d+\.\d+$/.exec(productWebUrl);
|
|
37
|
+
return match ? match[0] : null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { LogoLarge };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _radialGradient, _path;
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
_extends = Object.assign || function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
|
|
10
|
+
for (var key in source) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12
|
+
target[key] = source[key];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return _extends.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const SvgKotlinLogoSmall = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
24
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
+
viewBox: "0 0 24 24"
|
|
26
|
+
}, props), _radialGradient || (_radialGradient = /*#__PURE__*/React.createElement("radialGradient", {
|
|
27
|
+
id: "kotlin-logo-small_svg__a",
|
|
28
|
+
cx: 22.432,
|
|
29
|
+
cy: 3.493,
|
|
30
|
+
r: 21.679,
|
|
31
|
+
gradientTransform: "translate(-.19 .042) scale(.9998)",
|
|
32
|
+
gradientUnits: "userSpaceOnUse"
|
|
33
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
34
|
+
offset: 0.003,
|
|
35
|
+
stopColor: "#e44857"
|
|
36
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
37
|
+
offset: 0.469,
|
|
38
|
+
stopColor: "#c711e1"
|
|
39
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
40
|
+
offset: 1,
|
|
41
|
+
stopColor: "#7f52ff"
|
|
42
|
+
}))), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
43
|
+
fill: "url(#kotlin-logo-small_svg__a)",
|
|
44
|
+
d: "M22.87 21.68H3.94V2.76h18.93l-9.66 9.32z"
|
|
45
|
+
})));
|
|
46
|
+
|
|
47
|
+
export { SvgKotlinLogoSmall as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import SvgKotlinLogoSmall from './kotlin-logo-small.svg.js';
|
|
3
|
+
import styles from './logo-small.module.pcss.js';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { useTextStyles } from '@rescui/typography';
|
|
6
|
+
import { KOTLINLANG_URL } from '../consts.js';
|
|
7
|
+
|
|
8
|
+
const LogoSmall = ({
|
|
9
|
+
homeTitle,
|
|
10
|
+
homeUrl,
|
|
11
|
+
className
|
|
12
|
+
}) => {
|
|
13
|
+
const textCn = useTextStyles();
|
|
14
|
+
return jsxs("div", Object.assign({
|
|
15
|
+
className: classNames(styles.logoSmall, className)
|
|
16
|
+
}, {
|
|
17
|
+
children: [jsx("a", Object.assign({
|
|
18
|
+
href: KOTLINLANG_URL,
|
|
19
|
+
className: styles.iconWrap
|
|
20
|
+
}, {
|
|
21
|
+
children: jsx(SvgKotlinLogoSmall, {
|
|
22
|
+
className: styles.icon
|
|
23
|
+
}, void 0)
|
|
24
|
+
}), void 0), jsx("a", Object.assign({
|
|
25
|
+
href: homeUrl,
|
|
26
|
+
className: classNames(styles.link, textCn('rs-h3'))
|
|
27
|
+
}, {
|
|
28
|
+
children: homeTitle
|
|
29
|
+
}), void 0)]
|
|
30
|
+
}), void 0);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { LogoSmall };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
_extends = Object.assign || function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
|
|
10
|
+
for (var key in source) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12
|
+
target[key] = source[key];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return _extends.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const SvgCloseIcon = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
24
|
+
width: 16,
|
|
25
|
+
height: 16,
|
|
26
|
+
fill: "none",
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
28
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
fillRule: "evenodd",
|
|
30
|
+
clipRule: "evenodd",
|
|
31
|
+
d: "M15.707 1.707 14.293.293 8 6.586 1.707.293.293 1.707 6.586 8 .293 14.293l1.414 1.414L8 9.414l6.293 6.293 1.414-1.414L9.414 8l6.293-6.293Z",
|
|
32
|
+
fill: "currentColor"
|
|
33
|
+
})));
|
|
34
|
+
|
|
35
|
+
export { SvgCloseIcon as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
_extends = Object.assign || function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
|
|
10
|
+
for (var key in source) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12
|
+
target[key] = source[key];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return _extends.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const SvgHamburgerIcon = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
24
|
+
width: 24,
|
|
25
|
+
height: 24,
|
|
26
|
+
fill: "none",
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
28
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
fillRule: "evenodd",
|
|
30
|
+
clipRule: "evenodd",
|
|
31
|
+
d: "M4 5h16v2H4V5Zm0 6h16v2H4v-2Zm16 6H4v2h16v-2Z",
|
|
32
|
+
fill: "currentColor"
|
|
33
|
+
})));
|
|
34
|
+
|
|
35
|
+
export { SvgHamburgerIcon as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import styles from './menu-button.pcss.js';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import SvgHamburgerIcon from './hamburger-icon.svg.js';
|
|
5
|
+
import SvgCloseIcon from './close-icon.svg.js';
|
|
6
|
+
|
|
7
|
+
const MenuButton = ({
|
|
8
|
+
onClick,
|
|
9
|
+
isExpanded
|
|
10
|
+
}) => {
|
|
11
|
+
return jsx("button", Object.assign({
|
|
12
|
+
type: "button",
|
|
13
|
+
className: classNames(styles.button),
|
|
14
|
+
"aria-haspopup": "true",
|
|
15
|
+
"aria-label": "Open the navigation",
|
|
16
|
+
onClick: onClick
|
|
17
|
+
}, {
|
|
18
|
+
children: isExpanded ? jsx(SvgCloseIcon, {}, void 0) : jsx(SvgHamburgerIcon, {}, void 0)
|
|
19
|
+
}), void 0);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { MenuButton };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useState, useEffect, useLayoutEffect, useCallback, Fragment as Fragment$1 } from 'react';
|
|
3
|
+
import styles from './menu-popup.module.pcss.js';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { MenuButton } from './menu-button/menu-button.js';
|
|
6
|
+
import { useTextStyles } from '@rescui/typography';
|
|
7
|
+
import { clearAllBodyScrollLocks, enableBodyScroll, disableBodyScroll } from 'body-scroll-lock';
|
|
8
|
+
|
|
9
|
+
const MenuListItem = ({
|
|
10
|
+
item,
|
|
11
|
+
level,
|
|
12
|
+
linkHandler
|
|
13
|
+
}) => {
|
|
14
|
+
const Tag = item.url ? 'a' : 'span';
|
|
15
|
+
const style = {
|
|
16
|
+
'--level': level
|
|
17
|
+
};
|
|
18
|
+
const handleClick = useCallback(event => linkHandler && item.url && linkHandler(event, item.url), []);
|
|
19
|
+
return jsx(Tag, Object.assign({}, item.url ? {
|
|
20
|
+
href: item.url,
|
|
21
|
+
onClick: handleClick
|
|
22
|
+
} : {}, {
|
|
23
|
+
className: classNames(styles.menuItem, {
|
|
24
|
+
[styles.menuItemRoot]: level === 0,
|
|
25
|
+
[styles.active]: item.isActive,
|
|
26
|
+
[styles.activeWithChild]: item.items && item.items.length
|
|
27
|
+
}),
|
|
28
|
+
style: style
|
|
29
|
+
}, {
|
|
30
|
+
children: item.title
|
|
31
|
+
}), void 0);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const MenuList = ({
|
|
35
|
+
items,
|
|
36
|
+
level,
|
|
37
|
+
linkHandler
|
|
38
|
+
}) => {
|
|
39
|
+
return jsx(Fragment, {
|
|
40
|
+
children: items.map((item, i) => jsxs(Fragment$1, {
|
|
41
|
+
children: [jsx(MenuListItem, {
|
|
42
|
+
item: item,
|
|
43
|
+
level: level,
|
|
44
|
+
linkHandler: linkHandler
|
|
45
|
+
}, void 0), item.items && item.items.length > 0 && jsx(MenuList, {
|
|
46
|
+
items: item.items,
|
|
47
|
+
level: level + 1,
|
|
48
|
+
linkHandler: linkHandler
|
|
49
|
+
}, void 0)]
|
|
50
|
+
}, i))
|
|
51
|
+
}, void 0);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const MenuPopup = ({
|
|
55
|
+
items,
|
|
56
|
+
isExpanded,
|
|
57
|
+
setExpand,
|
|
58
|
+
headerRef,
|
|
59
|
+
linkHandler
|
|
60
|
+
}) => {
|
|
61
|
+
const navRef = useRef(null);
|
|
62
|
+
const textCn = useTextStyles();
|
|
63
|
+
const [navStyle, setNavStyle] = useState({});
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
return () => {
|
|
66
|
+
setExpand(false);
|
|
67
|
+
clearAllBodyScrollLocks();
|
|
68
|
+
};
|
|
69
|
+
}, []);
|
|
70
|
+
useLayoutEffect(() => {
|
|
71
|
+
if (headerRef.current) {
|
|
72
|
+
setNavStyle({
|
|
73
|
+
top: headerRef.current.getBoundingClientRect().bottom
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}, [isExpanded, headerRef]);
|
|
77
|
+
const handleClick = useCallback(() => {
|
|
78
|
+
if (navRef.current) {
|
|
79
|
+
isExpanded ? enableBodyScroll(navRef.current) : disableBodyScroll(navRef.current);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
setExpand(!isExpanded);
|
|
83
|
+
}, [isExpanded, navRef]);
|
|
84
|
+
return jsxs(Fragment, {
|
|
85
|
+
children: [jsx(MenuButton, {
|
|
86
|
+
onClick: handleClick,
|
|
87
|
+
isExpanded: isExpanded
|
|
88
|
+
}, void 0), jsx("nav", Object.assign({
|
|
89
|
+
style: navStyle,
|
|
90
|
+
ref: navRef,
|
|
91
|
+
className: classNames(styles.menuPopup, textCn('rs-text-2'), {
|
|
92
|
+
[styles.menuPopupExpanded]: isExpanded
|
|
93
|
+
})
|
|
94
|
+
}, {
|
|
95
|
+
children: jsx(MenuList, {
|
|
96
|
+
items: items,
|
|
97
|
+
level: 0,
|
|
98
|
+
linkHandler: linkHandler
|
|
99
|
+
}, void 0)
|
|
100
|
+
}), void 0)]
|
|
101
|
+
}, void 0);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { MenuPopup };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var styles = {
|
|
2
|
+
"menuPopup": "ktl-menu-popup-module_menu-popup_Q68IE",
|
|
3
|
+
"menuItem": "ktl-menu-popup-module_menu-item_fPvF-",
|
|
4
|
+
"active": "ktl-menu-popup-module_active_iqTAj",
|
|
5
|
+
"activeWithChild": "ktl-menu-popup-module_active-with-child_tAzCG",
|
|
6
|
+
"menuItemRoot": "ktl-menu-popup-module_menu-item-root_gA9d2",
|
|
7
|
+
"menuPopupExpanded": "ktl-menu-popup-module_menu-popup-expanded_ggrp9"
|
|
8
|
+
};
|
|
9
|
+
export { styles as default };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { PLAYGROUND_URL, KOTLINLANG_URL } from './consts.js';
|
|
2
|
+
const SOLUTIONS_TITLE = 'Solutions';
|
|
3
|
+
const MULTIPLATFORM_MOBILE_TITLE = 'Multiplatform Mobile';
|
|
4
|
+
const MULTIPLATFORM_MOBILE_URL = `/lp/mobile/`;
|
|
5
|
+
const SERVER_SIDE_TITLE = 'Server-side';
|
|
6
|
+
const SERVER_SIDE_URL = `/lp/server-side/`;
|
|
7
|
+
const WEB_FRONTEND_TITLE = 'Web frontend';
|
|
8
|
+
const WEB_FRONTEND_URL = `/docs/js-overview.html`;
|
|
9
|
+
const MULTIPLATFORM_OTHERS_TITLE = 'Multiplatform for other platforms';
|
|
10
|
+
const MULTIPLATFORM_OTHERS_URL = '/docs/multiplatform.html';
|
|
11
|
+
const DATA_SCIENCE_TITLE = 'Data science';
|
|
12
|
+
const DATA_SCIENCE_URL = `/docs/data-science-overview.html`;
|
|
13
|
+
const ANDROID_TITLE = 'Android';
|
|
14
|
+
const ANDROID_URL = `/docs/android-overview.html`;
|
|
15
|
+
const DOCS_TITLE = 'Docs';
|
|
16
|
+
const DOCS_URL = `/docs/home.html`;
|
|
17
|
+
const COMMUNITY_TITLE = 'Community';
|
|
18
|
+
const COMMUNITY_URL = `/community/`;
|
|
19
|
+
const TEACH_TITLE = 'Teach';
|
|
20
|
+
const TEACH_URL = `/education/`;
|
|
21
|
+
const PLAY_TITLE = 'Play';
|
|
22
|
+
const PLAY_TITLE_FULL = 'Playground';
|
|
23
|
+
const PLAY_URL = PLAYGROUND_URL;
|
|
24
|
+
const PLAY_HANDSON_URL = `${PLAY_URL}hands-on`;
|
|
25
|
+
const PLAY_HANDSON_TITLE = 'Hands-on';
|
|
26
|
+
const PLAY_EXAMPLES_URL = `${PLAY_URL}byExample`;
|
|
27
|
+
const PLAY_EXAMPLES_TITLE = 'Examples';
|
|
28
|
+
const PLAY_KOANS_URL = `${PLAY_URL}koans`;
|
|
29
|
+
const PLAY_KOANS_TITLE = 'Koans';
|
|
30
|
+
const KOTLIN_DOCS_TITLE = 'Kotlin';
|
|
31
|
+
const KOTLIN_DOCS_URL = `/docs/home.html`;
|
|
32
|
+
const KMM_DOCS_TITLE = 'KMM';
|
|
33
|
+
const KMM_DOCS_URL = `/docs/mobile/home.html`;
|
|
34
|
+
const navScheme = [{
|
|
35
|
+
title: SOLUTIONS_TITLE,
|
|
36
|
+
url: null,
|
|
37
|
+
items: [{
|
|
38
|
+
title: MULTIPLATFORM_MOBILE_TITLE,
|
|
39
|
+
url: MULTIPLATFORM_MOBILE_URL
|
|
40
|
+
}, {
|
|
41
|
+
title: MULTIPLATFORM_OTHERS_TITLE,
|
|
42
|
+
url: MULTIPLATFORM_OTHERS_URL
|
|
43
|
+
}, {
|
|
44
|
+
title: SERVER_SIDE_TITLE,
|
|
45
|
+
url: SERVER_SIDE_URL
|
|
46
|
+
}, {
|
|
47
|
+
title: WEB_FRONTEND_TITLE,
|
|
48
|
+
url: WEB_FRONTEND_URL
|
|
49
|
+
}, {
|
|
50
|
+
title: DATA_SCIENCE_TITLE,
|
|
51
|
+
url: DATA_SCIENCE_URL
|
|
52
|
+
}, {
|
|
53
|
+
title: ANDROID_TITLE,
|
|
54
|
+
url: ANDROID_URL
|
|
55
|
+
}]
|
|
56
|
+
}, {
|
|
57
|
+
title: DOCS_TITLE,
|
|
58
|
+
url: KOTLIN_DOCS_URL
|
|
59
|
+
}, {
|
|
60
|
+
title: COMMUNITY_TITLE,
|
|
61
|
+
url: COMMUNITY_URL
|
|
62
|
+
}, {
|
|
63
|
+
title: TEACH_TITLE,
|
|
64
|
+
url: TEACH_URL
|
|
65
|
+
}, {
|
|
66
|
+
title: PLAY_TITLE,
|
|
67
|
+
url: null,
|
|
68
|
+
items: [{
|
|
69
|
+
title: PLAY_TITLE_FULL,
|
|
70
|
+
url: PLAY_URL
|
|
71
|
+
}, {
|
|
72
|
+
title: PLAY_HANDSON_TITLE,
|
|
73
|
+
url: PLAY_HANDSON_URL
|
|
74
|
+
}, {
|
|
75
|
+
title: PLAY_EXAMPLES_TITLE,
|
|
76
|
+
url: PLAY_EXAMPLES_URL
|
|
77
|
+
}, {
|
|
78
|
+
title: PLAY_KOANS_TITLE,
|
|
79
|
+
url: PLAY_KOANS_URL
|
|
80
|
+
}]
|
|
81
|
+
}];
|
|
82
|
+
|
|
83
|
+
function getNavScheme(isUrlActive = (url, currentUrl) => url === currentUrl, currentUrl, isPlayground) {
|
|
84
|
+
return navScheme.map(({
|
|
85
|
+
title,
|
|
86
|
+
url,
|
|
87
|
+
items
|
|
88
|
+
}) => {
|
|
89
|
+
if (url && currentUrl) {
|
|
90
|
+
url = makeExternalUrl(url, currentUrl, !!isPlayground);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const item = {
|
|
94
|
+
title,
|
|
95
|
+
url
|
|
96
|
+
};
|
|
97
|
+
let isActive = isUrlActive(url, currentUrl);
|
|
98
|
+
item.items = items?.map(({
|
|
99
|
+
title,
|
|
100
|
+
url: childUrl
|
|
101
|
+
}) => {
|
|
102
|
+
if (childUrl && currentUrl) {
|
|
103
|
+
childUrl = makeExternalUrl(childUrl, currentUrl, !!isPlayground);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let childActive = isUrlActive(childUrl, currentUrl);
|
|
107
|
+
|
|
108
|
+
if (childActive) {
|
|
109
|
+
isActive = childActive;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
title,
|
|
114
|
+
url: childUrl,
|
|
115
|
+
isActive: childActive
|
|
116
|
+
};
|
|
117
|
+
}) ?? [];
|
|
118
|
+
item.isActive = isActive;
|
|
119
|
+
return item;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function makeExternalUrl(url, currentUrl, isPlayground) {
|
|
124
|
+
if (isPlayground) {
|
|
125
|
+
if (url.startsWith(PLAY_URL)) {
|
|
126
|
+
return url.replace(PLAY_URL, '/');
|
|
127
|
+
} else {
|
|
128
|
+
return `${KOTLINLANG_URL}${url}`;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return url;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { ANDROID_TITLE, ANDROID_URL, COMMUNITY_TITLE, COMMUNITY_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DOCS_TITLE, DOCS_URL, KMM_DOCS_TITLE, KMM_DOCS_URL, KOTLIN_DOCS_TITLE, KOTLIN_DOCS_URL, MULTIPLATFORM_MOBILE_TITLE, MULTIPLATFORM_MOBILE_URL, MULTIPLATFORM_OTHERS_TITLE, MULTIPLATFORM_OTHERS_URL, PLAY_EXAMPLES_TITLE, PLAY_EXAMPLES_URL, PLAY_HANDSON_TITLE, PLAY_HANDSON_URL, PLAY_KOANS_TITLE, PLAY_KOANS_URL, PLAY_TITLE, PLAY_TITLE_FULL, PLAY_URL, SERVER_SIDE_TITLE, SERVER_SIDE_URL, SOLUTIONS_TITLE, TEACH_TITLE, TEACH_URL, WEB_FRONTEND_TITLE, WEB_FRONTEND_URL, getNavScheme };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import styles from './search-button.module.pcss.js';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import SvgSearch from './search.svg.js';
|
|
5
|
+
|
|
6
|
+
const SearchButton = ({
|
|
7
|
+
onClick,
|
|
8
|
+
isActive
|
|
9
|
+
}) => {
|
|
10
|
+
return jsx("button", Object.assign({
|
|
11
|
+
type: "button",
|
|
12
|
+
className: classNames(styles.button, {
|
|
13
|
+
[styles.active]: isActive
|
|
14
|
+
}),
|
|
15
|
+
"aria-label": "Search",
|
|
16
|
+
onClick: onClick
|
|
17
|
+
}, {
|
|
18
|
+
children: jsx(SvgSearch, {}, void 0)
|
|
19
|
+
}), void 0);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { SearchButton };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
_extends = Object.assign || function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
|
|
10
|
+
for (var key in source) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12
|
+
target[key] = source[key];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return _extends.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const SvgSearch = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
24
|
+
width: 24,
|
|
25
|
+
height: 24,
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
27
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
28
|
+
fillRule: "evenodd",
|
|
29
|
+
clipRule: "evenodd",
|
|
30
|
+
d: "M15.847 6.861A6.99 6.99 0 0 0 9.587 3a6.997 6.997 0 1 0 4.186 12.601l6.106 6.106 1.414-1.414-6.107-6.106a6.99 6.99 0 0 0 .66-7.326ZM14.587 10a5 5 0 1 1-10.001 0 5 5 0 0 1 10 0Z",
|
|
31
|
+
fill: "currentColor"
|
|
32
|
+
})));
|
|
33
|
+
|
|
34
|
+
export { SvgSearch as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.ktl-popup-module_popup_kH56U {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 50%;
|
|
4
|
+
left: 50%;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
width: calc(100% - 32px);
|
|
9
|
+
min-height: calc(4 * 8px);
|
|
10
|
+
max-height: calc(100vh - 144px);
|
|
11
|
+
outline: none;
|
|
12
|
+
transform: translate(-50%, -50%);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (min-width: 1024px) {.ktl-popup-module_popup_kH56U {
|
|
16
|
+
width: auto;
|
|
17
|
+
min-width: 70%;
|
|
18
|
+
max-width: calc(100% - 32px)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ktl-popup-module_overlay_lHomr {
|
|
23
|
+
position: fixed;
|
|
24
|
+
top: 0;
|
|
25
|
+
right: 0;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
background-color: rgba(39, 40, 44, 0.7);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ktl-popup-module_close_Cvlga {
|
|
32
|
+
position: absolute !important;
|
|
33
|
+
top: -60px;
|
|
34
|
+
right: 0;
|
|
35
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import ReactModal from 'react-modal';
|
|
3
|
+
import { LayeringConsumer, LayeringProvider } from '@rescui/ui-contexts';
|
|
4
|
+
import { CloseIcon, LoadingIcon } from '@rescui/icons';
|
|
5
|
+
import { RemoveScrollBar } from 'react-remove-scroll-bar';
|
|
6
|
+
import Button from '@rescui/button';
|
|
7
|
+
import styles from './popup.module.pcss.js';
|
|
8
|
+
|
|
9
|
+
const Popup = ({
|
|
10
|
+
isOpen,
|
|
11
|
+
children,
|
|
12
|
+
onRequestClose,
|
|
13
|
+
shouldCloseOnEsc = true,
|
|
14
|
+
shouldCloseOnOverlayClick = true,
|
|
15
|
+
busy = false,
|
|
16
|
+
showOuterCloseButton = false,
|
|
17
|
+
ariaHideApp = false,
|
|
18
|
+
...restProps
|
|
19
|
+
}) => {
|
|
20
|
+
return jsx(LayeringConsumer, {
|
|
21
|
+
children: ({
|
|
22
|
+
popupZIndex
|
|
23
|
+
}) => jsx(LayeringProvider, Object.assign({
|
|
24
|
+
baseLayer: "popup"
|
|
25
|
+
}, {
|
|
26
|
+
children: jsxs(ReactModal, Object.assign({
|
|
27
|
+
isOpen: isOpen,
|
|
28
|
+
className: styles.popup,
|
|
29
|
+
overlayClassName: styles.overlay,
|
|
30
|
+
onRequestClose: onRequestClose,
|
|
31
|
+
shouldCloseOnOverlayClick: shouldCloseOnOverlayClick,
|
|
32
|
+
shouldCloseOnEsc: shouldCloseOnEsc
|
|
33
|
+
}, restProps, {
|
|
34
|
+
ariaHideApp: ariaHideApp,
|
|
35
|
+
style: {
|
|
36
|
+
overlay: {
|
|
37
|
+
zIndex: popupZIndex
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
children: [!busy && showOuterCloseButton && jsx(Button, {
|
|
42
|
+
mode: 'rock',
|
|
43
|
+
theme: 'light',
|
|
44
|
+
icon: jsx(CloseIcon, {}, void 0),
|
|
45
|
+
className: styles.close,
|
|
46
|
+
onClick: onRequestClose,
|
|
47
|
+
"data-test": "close-button"
|
|
48
|
+
}, void 0), busy ? jsx(LoadingIcon, {
|
|
49
|
+
size: "l",
|
|
50
|
+
theme: "dark",
|
|
51
|
+
mode: "rock",
|
|
52
|
+
"data-test": "loading-icon"
|
|
53
|
+
}, void 0) : children, jsx(RemoveScrollBar, {
|
|
54
|
+
gapMode: "margin"
|
|
55
|
+
}, void 0)]
|
|
56
|
+
}), void 0)
|
|
57
|
+
}), void 0)
|
|
58
|
+
}, void 0);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { Popup };
|