@jetbrains/kotlin-web-site-ui 0.0.0-foundation-changes.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/CHANGELOG.md +61 -0
- package/LICENSE.txt +202 -0
- package/README.md +16 -0
- 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 +39 -0
- package/out/blocks/formik-wrapper/privacy-checkbox.js +48 -0
- package/out/blocks/formik-wrapper/privacy-notice.js +40 -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/breakpoints/constants.js +20 -0
- package/out/components/breakpoints/hooks.js +32 -0
- package/out/components/breakpoints/index.js +2 -0
- package/out/components/breakpoints/media.pcss +14 -0
- package/out/components/cta-block/index.css +254 -0
- package/out/components/cta-block/index.js +7 -0
- package/out/components/cta-block/v1/cta-block.js +29 -0
- package/out/components/cta-block/v1/cta-block.module.pcss.js +8 -0
- package/out/components/footer/footer.js +55 -0
- package/out/components/footer/footer.module.pcss.js +13 -0
- package/out/components/footer/index.css +290 -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 +12 -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 +27 -0
- package/out/components/footer/nav/nav-item.module.pcss.js +5 -0
- package/out/components/footer/nav/nav-list.js +15 -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 +21 -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 +13 -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/full-search/chapters/chapters.js +59 -0
- package/out/components/header/full-search/chapters/chapters.module.pcss.js +12 -0
- package/out/components/header/full-search/empty/empty.js +22 -0
- package/out/components/header/full-search/empty/empty.module.pcss.js +6 -0
- package/out/components/header/full-search/empty/full-search-empty.svg.js +1539 -0
- package/out/components/header/full-search/full-search.js +115 -0
- package/out/components/header/full-search/full-search.module.pcss.js +10 -0
- package/out/components/header/full-search/hit-list/get-extended-hits.js +55 -0
- package/out/components/header/full-search/hit-list/hit-list.js +49 -0
- package/out/components/header/full-search/hit-list/hit-list.module.pcss.js +6 -0
- package/out/components/header/full-search/loading/loading.js +13 -0
- package/out/components/header/full-search/loading/loading.module.pcss.js +4 -0
- package/out/components/header/full-search/results-list/results-list.js +25 -0
- package/out/components/header/header.js +121 -0
- package/out/components/header/header.module.pcss.js +5 -0
- package/out/components/header/horizontal-menu/horizontal-menu.js +101 -0
- package/out/components/header/horizontal-menu/horizontal-menu.module.pcss.js +16 -0
- package/out/components/header/index.css +949 -0
- package/out/components/header/index.js +4 -0
- package/out/components/header/is-macos.js +5 -0
- package/out/components/header/key-codes.js +3 -0
- package/out/components/header/logo-large/kotlin-logo-large.svg.js +55 -0
- package/out/components/header/logo-large/logo-large.js +34 -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 +49 -0
- package/out/components/header/logo-small/logo-small.js +27 -0
- package/out/components/header/logo-small/logo-small.module.pcss.js +7 -0
- package/out/components/header/menu-popup/menu-button/menu-button.js +23 -0
- package/out/components/header/menu-popup/menu-button/menu-button.module.pcss.js +4 -0
- 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 +55 -0
- package/out/components/header/menu-popup/menu-popup.module.pcss.js +5 -0
- package/out/components/header/nav-scheme.js +133 -0
- package/out/components/header/quick-search/empty/empty.js +17 -0
- package/out/components/header/quick-search/empty/empty.module.pcss.js +5 -0
- package/out/components/header/quick-search/list/list.js +37 -0
- package/out/components/header/quick-search/list/list.module.pcss.js +7 -0
- package/out/components/header/quick-search/loading/loading.js +14 -0
- package/out/components/header/quick-search/loading/loading.module.pcss.js +4 -0
- package/out/components/header/quick-search/quick-search.js +48 -0
- package/out/components/header/quick-search/quick-search.module.pcss.js +5 -0
- package/out/components/header/quick-search/result/result.js +30 -0
- package/out/components/header/quick-search/result/result.module.pcss.js +6 -0
- package/out/components/header/search-box/search-box.js +76 -0
- package/out/components/header/search-box/search-box.module.pcss.js +7 -0
- package/out/components/header/search-button/search-button.js +32 -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/header/search-wrapper/init-search.js +60 -0
- package/out/components/header/search-wrapper/search-const.js +13 -0
- package/out/components/header/search-wrapper/search-context.js +18 -0
- package/out/components/header/search-wrapper/search-with-algolia.js +58 -0
- package/out/components/header/search-wrapper/search-wrapper.js +40 -0
- package/out/components/header/search-wrapper/use-search.js +85 -0
- package/out/components/layout/index.css +52 -0
- package/out/components/layout/index.js +1 -0
- package/out/components/popup/index.css +35 -0
- package/out/components/popup/index.js +3 -0
- package/out/components/popup/popup.js +55 -0
- package/out/components/popup/popup.module.pcss.js +6 -0
- package/out/components/quotes-slider/index.css +83 -0
- package/out/components/quotes-slider/index.js +3 -0
- package/out/components/quotes-slider/quote.svg.js +33 -0
- package/out/components/quotes-slider/quotes-slider.js +85 -0
- package/out/components/quotes-slider/quotes-slider.module.pcss.js +13 -0
- package/out/components/top-menu/horizontal-menu/horizontal-menu.js +44 -0
- package/out/components/top-menu/horizontal-menu/horizontal-menu.module.pcss.js +6 -0
- package/out/components/top-menu/index.css +232 -0
- package/out/components/top-menu/index.js +3 -0
- package/out/components/top-menu/top-menu.js +54 -0
- package/out/components/top-menu/top-menu.module.pcss.js +6 -0
- package/out/components/top-menu/vertical-menu/arrow-dropdown-icon.svg.js +34 -0
- package/out/components/top-menu/vertical-menu/vertical-menu.js +129 -0
- package/out/components/top-menu/vertical-menu/vertical-menu.module.pcss.js +14 -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 +192 -0
- package/out/components/typography/index.js +3 -0
- package/out/components/youtube-player/index.css +135 -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 +145 -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/out/svg/kotlin_64.svg +10 -0
- package/package.json +141 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import { Header } from './header.js';
|
|
3
|
+
export { Header as default } from './header.js';
|
|
4
|
+
export { ANDROID_TITLE, ANDROID_URL, COMMUNITY_TITLE, COMMUNITY_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DOCS_TITLE, DOCS_URL, HOME_TITLE, HOME_URL, KMM_DOCS_TITLE, KMM_DOCS_URL, KOTLIN_DOCS_TITLE, KOTLIN_DOCS_URL, MULTIPLATFORM_LIBRARIES_TITLE, MULTIPLATFORM_LIBRARIES_URL, MULTIPLATFORM_MOBILE_TITLE, MULTIPLATFORM_MOBILE_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, getNavScheme } from './nav-scheme.js';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path, _path2, _path3, _defs;
|
|
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 SvgKotlinLogoLarge = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
24
|
+
width: 98,
|
|
25
|
+
height: 22,
|
|
26
|
+
fill: "none",
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
28
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
d: "M43.314 1.067h-4.031L30.5 10.422V1.098H27.27v20.273H30.5v-9.82l8.814 9.82h4.177l-9.397-10.484 9.22-9.82Z",
|
|
30
|
+
fill: "#fff"
|
|
31
|
+
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
32
|
+
d: "M54.303 7.186c-1.153-.66-2.45-.994-3.901-.994-1.478 0-2.803.33-3.973.994a7.042 7.042 0 0 0-2.735 2.758c-.65 1.179-.976 2.515-.976 4.01 0 1.494.325 2.835.972 4.01a6.967 6.967 0 0 0 2.716 2.758c1.166.659 2.486.993 3.964.993 1.46 0 2.766-.33 3.923-.993a6.941 6.941 0 0 0 2.694-2.759c.642-1.178.963-2.515.963-4.01 0-1.494-.32-2.83-.963-4.009a6.949 6.949 0 0 0-2.684-2.758Zm-.204 9.328c-.357.74-.859 1.314-1.505 1.73-.646.415-1.392.622-2.233.622-.85 0-1.604-.207-2.26-.623a4.184 4.184 0 0 1-1.528-1.73c-.361-.74-.542-1.589-.542-2.555 0-.966.185-1.815.551-2.555a4.177 4.177 0 0 1 1.537-1.73c.656-.415 1.415-.623 2.278-.623.832 0 1.573.208 2.22.623a4.125 4.125 0 0 1 1.5 1.73c.353.74.529 1.59.529 2.555-.009.962-.19 1.815-.547 2.556ZM64.555 2.836h-3.132v2.52c0 .397-.095.695-.29.889-.194.198-.492.298-.899.298h-1.537v2.664h2.667v7.978c0 .83.167 1.562.506 2.194a3.591 3.591 0 0 0 1.442 1.472c.624.348 1.36.52 2.21.52h2.391v-2.782h-1.798c-.466 0-.841-.163-1.13-.483-.29-.325-.434-.75-.434-1.282V9.207h3.448V6.543h-3.448V2.836h.004ZM73.68.286h-3.186V21.37h3.187V.286ZM80.498.312H77.28v3.273h3.218V.312ZM80.466 6.544H77.28V21.37h3.186V6.544ZM96.67 8.99a4.969 4.969 0 0 0-1.899-2.054c-.818-.492-1.772-.74-2.866-.74-1.161 0-2.178.284-3.05.848-.697.447-1.257 1.052-1.7 1.797l-.018-2.298H84.09V21.37h3.191v-8.298c0-.8.154-1.513.457-2.136a3.39 3.39 0 0 1 1.293-1.45c.556-.342 1.202-.514 1.948-.514.669 0 1.238.14 1.717.42.48.28.841.682 1.085 1.201.249.52.37 1.142.37 1.87v8.907h3.192v-9.355c0-1.138-.226-2.149-.674-3.025Z",
|
|
33
|
+
fill: "#fff"
|
|
34
|
+
})), _path3 || (_path3 = /*#__PURE__*/React.createElement("path", {
|
|
35
|
+
d: "M20 21H0V1h20L9.793 10.855 20 21Z",
|
|
36
|
+
fill: "url(#kotlin-logo-large_svg__a)"
|
|
37
|
+
})), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("radialGradient", {
|
|
38
|
+
id: "kotlin-logo-large_svg__a",
|
|
39
|
+
cx: 0,
|
|
40
|
+
cy: 0,
|
|
41
|
+
r: 1,
|
|
42
|
+
gradientUnits: "userSpaceOnUse",
|
|
43
|
+
gradientTransform: "translate(19.335 1.822) scale(22.9097)"
|
|
44
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
45
|
+
offset: 0.003,
|
|
46
|
+
stopColor: "#EF4857"
|
|
47
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
48
|
+
offset: 0.469,
|
|
49
|
+
stopColor: "#D211EC"
|
|
50
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
51
|
+
offset: 1,
|
|
52
|
+
stopColor: "#7F52FF"
|
|
53
|
+
})))));
|
|
54
|
+
|
|
55
|
+
export { SvgKotlinLogoLarge as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
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 React__default.createElement("div", {
|
|
15
|
+
className: classNames(styles.container, className, textCn('rs-text-3', {
|
|
16
|
+
hardness: 'average'
|
|
17
|
+
}))
|
|
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));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function getProductVersion(productWebUrl) {
|
|
30
|
+
const match = /v?\d+\.\d+\.\d+$/.exec(productWebUrl);
|
|
31
|
+
return match ? match[0] : null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { LogoLarge };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path, _defs;
|
|
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
|
+
width: 20,
|
|
25
|
+
height: 20,
|
|
26
|
+
fill: "none",
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
28
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
d: "M20 20H0V0h20L9.793 9.855 20 20Z",
|
|
30
|
+
fill: "url(#kotlin-logo-small_svg__a)"
|
|
31
|
+
})), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("radialGradient", {
|
|
32
|
+
id: "kotlin-logo-small_svg__a",
|
|
33
|
+
cx: 0,
|
|
34
|
+
cy: 0,
|
|
35
|
+
r: 1,
|
|
36
|
+
gradientUnits: "userSpaceOnUse",
|
|
37
|
+
gradientTransform: "translate(19.335 .822) scale(22.9097)"
|
|
38
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
39
|
+
offset: 0.003,
|
|
40
|
+
stopColor: "#EF4857"
|
|
41
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
42
|
+
offset: 0.469,
|
|
43
|
+
stopColor: "#D211EC"
|
|
44
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
45
|
+
offset: 1,
|
|
46
|
+
stopColor: "#7F52FF"
|
|
47
|
+
})))));
|
|
48
|
+
|
|
49
|
+
export { SvgKotlinLogoSmall as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
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 React__default.createElement("div", {
|
|
15
|
+
className: classNames(styles.logoSmall, className)
|
|
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-h4'))
|
|
24
|
+
}, homeTitle));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { LogoSmall };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import styles from './menu-button.module.pcss.js';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import Button from '@rescui/button';
|
|
5
|
+
import { CloseIcon, HamburgerIcon } from '@rescui/icons';
|
|
6
|
+
|
|
7
|
+
const MenuButton = ({
|
|
8
|
+
onClick,
|
|
9
|
+
isExpanded
|
|
10
|
+
}) => {
|
|
11
|
+
return React__default.createElement(Button, {
|
|
12
|
+
type: "button",
|
|
13
|
+
className: classNames(styles.button),
|
|
14
|
+
"aria-haspopup": "true",
|
|
15
|
+
"aria-label": "Open the navigation",
|
|
16
|
+
onClick: onClick,
|
|
17
|
+
size: 'l',
|
|
18
|
+
mode: 'clear',
|
|
19
|
+
icon: isExpanded ? React__default.createElement(CloseIcon, null) : React__default.createElement(HamburgerIcon, null)
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { MenuButton };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React__default, { Fragment } from 'react';
|
|
2
|
+
import { MenuListItem } from '../menu-list-item/menu-list-item.js';
|
|
3
|
+
import styles from './menu-list.module.pcss.js';
|
|
4
|
+
|
|
5
|
+
const MenuList = ({
|
|
6
|
+
items,
|
|
7
|
+
level,
|
|
8
|
+
linkHandler
|
|
9
|
+
}) => {
|
|
10
|
+
return React__default.createElement(React__default.Fragment, null, items.map((item, i) => React__default.createElement(Fragment, {
|
|
11
|
+
key: i
|
|
12
|
+
}, item.items && item.items.length > 0 ? React__default.createElement("div", {
|
|
13
|
+
className: styles.menuItemGroup
|
|
14
|
+
}, React__default.createElement(MenuListItem, {
|
|
15
|
+
item: item,
|
|
16
|
+
level: level,
|
|
17
|
+
linkHandler: linkHandler
|
|
18
|
+
}), item.items && item.items.length > 0 && React__default.createElement(MenuList, {
|
|
19
|
+
items: item.items,
|
|
20
|
+
level: level + 1,
|
|
21
|
+
linkHandler: linkHandler
|
|
22
|
+
})) : React__default.createElement(React__default.Fragment, null, React__default.createElement(MenuListItem, {
|
|
23
|
+
item: item,
|
|
24
|
+
level: level,
|
|
25
|
+
linkHandler: linkHandler
|
|
26
|
+
}), item.items && React__default.createElement(MenuList, {
|
|
27
|
+
items: item.items,
|
|
28
|
+
level: level + 1,
|
|
29
|
+
linkHandler: linkHandler
|
|
30
|
+
})))));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { MenuList };
|
|
@@ -0,0 +1,28 @@
|
|
|
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, { ...(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 };
|
|
@@ -0,0 +1,7 @@
|
|
|
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 };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React__default, { useRef, useState, useEffect, useLayoutEffect, useCallback } from 'react';
|
|
2
|
+
import styles from './menu-popup.module.pcss.js';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { MenuButton } from './menu-button/menu-button.js';
|
|
5
|
+
import { MenuList } from './menu-list/menu-list.js';
|
|
6
|
+
import { useTextStyles } from '@rescui/typography';
|
|
7
|
+
import { clearAllBodyScrollLocks, enableBodyScroll, disableBodyScroll } from 'body-scroll-lock';
|
|
8
|
+
|
|
9
|
+
const MenuPopup = ({
|
|
10
|
+
items,
|
|
11
|
+
isExpanded,
|
|
12
|
+
setExpand,
|
|
13
|
+
headerRef,
|
|
14
|
+
linkHandler
|
|
15
|
+
}) => {
|
|
16
|
+
const navRef = useRef(null);
|
|
17
|
+
const textCn = useTextStyles();
|
|
18
|
+
const [navStyle, setNavStyle] = useState({});
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
return () => {
|
|
21
|
+
setExpand(false);
|
|
22
|
+
clearAllBodyScrollLocks();
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
useLayoutEffect(() => {
|
|
26
|
+
if (headerRef.current) {
|
|
27
|
+
setNavStyle({
|
|
28
|
+
top: headerRef.current.getBoundingClientRect().bottom
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}, [isExpanded, headerRef]);
|
|
32
|
+
const handleClick = useCallback(() => {
|
|
33
|
+
if (navRef.current) {
|
|
34
|
+
isExpanded ? enableBodyScroll(navRef.current) : disableBodyScroll(navRef.current);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
setExpand(!isExpanded);
|
|
38
|
+
}, [isExpanded, navRef]);
|
|
39
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(MenuButton, {
|
|
40
|
+
onClick: handleClick,
|
|
41
|
+
isExpanded: isExpanded
|
|
42
|
+
}), React__default.createElement("nav", {
|
|
43
|
+
style: navStyle,
|
|
44
|
+
ref: navRef,
|
|
45
|
+
className: classNames(styles.menuPopup, textCn('rs-text-2'), {
|
|
46
|
+
[styles.menuPopupExpanded]: isExpanded
|
|
47
|
+
})
|
|
48
|
+
}, React__default.createElement(MenuList, {
|
|
49
|
+
items: items,
|
|
50
|
+
level: 0,
|
|
51
|
+
linkHandler: linkHandler
|
|
52
|
+
})));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { MenuPopup };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { PLAYGROUND_URL, KOTLINLANG_URL } from './consts.js';
|
|
2
|
+
const HOME_TITLE = 'Home';
|
|
3
|
+
const HOME_URL = '/';
|
|
4
|
+
const SOLUTIONS_TITLE = 'Solutions';
|
|
5
|
+
const MULTIPLATFORM_MOBILE_TITLE = 'Multiplatform';
|
|
6
|
+
const MULTIPLATFORM_MOBILE_URL = `/lp/mobile/`;
|
|
7
|
+
const SERVER_SIDE_TITLE = 'Server-side';
|
|
8
|
+
const SERVER_SIDE_URL = `/lp/server-side/`;
|
|
9
|
+
const MULTIPLATFORM_LIBRARIES_TITLE = 'Multiplatform libraries';
|
|
10
|
+
const MULTIPLATFORM_LIBRARIES_URL = '/docs/multiplatform-library.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: HOME_TITLE,
|
|
36
|
+
url: HOME_URL
|
|
37
|
+
}, {
|
|
38
|
+
title: SOLUTIONS_TITLE,
|
|
39
|
+
url: null,
|
|
40
|
+
items: [{
|
|
41
|
+
title: MULTIPLATFORM_MOBILE_TITLE,
|
|
42
|
+
url: MULTIPLATFORM_MOBILE_URL
|
|
43
|
+
}, {
|
|
44
|
+
title: SERVER_SIDE_TITLE,
|
|
45
|
+
url: SERVER_SIDE_URL
|
|
46
|
+
}, {
|
|
47
|
+
title: DATA_SCIENCE_TITLE,
|
|
48
|
+
url: DATA_SCIENCE_URL
|
|
49
|
+
}, {
|
|
50
|
+
title: ANDROID_TITLE,
|
|
51
|
+
url: ANDROID_URL
|
|
52
|
+
}]
|
|
53
|
+
}, {
|
|
54
|
+
title: DOCS_TITLE,
|
|
55
|
+
url: KOTLIN_DOCS_URL
|
|
56
|
+
}, {
|
|
57
|
+
title: COMMUNITY_TITLE,
|
|
58
|
+
url: COMMUNITY_URL
|
|
59
|
+
}, {
|
|
60
|
+
title: TEACH_TITLE,
|
|
61
|
+
url: TEACH_URL
|
|
62
|
+
}, {
|
|
63
|
+
title: PLAY_TITLE,
|
|
64
|
+
url: null,
|
|
65
|
+
items: [{
|
|
66
|
+
title: PLAY_TITLE_FULL,
|
|
67
|
+
url: PLAY_URL
|
|
68
|
+
}, {
|
|
69
|
+
title: PLAY_HANDSON_TITLE,
|
|
70
|
+
url: PLAY_HANDSON_URL
|
|
71
|
+
}, {
|
|
72
|
+
title: PLAY_EXAMPLES_TITLE,
|
|
73
|
+
url: PLAY_EXAMPLES_URL
|
|
74
|
+
}, {
|
|
75
|
+
title: PLAY_KOANS_TITLE,
|
|
76
|
+
url: PLAY_KOANS_URL
|
|
77
|
+
}]
|
|
78
|
+
}];
|
|
79
|
+
|
|
80
|
+
function getNavScheme(isUrlActive = (url, currentUrl) => url === currentUrl, currentUrl, isPlayground, withoutHomeSection) {
|
|
81
|
+
const controlledNavScheme = withoutHomeSection ? navScheme.slice(1) : navScheme;
|
|
82
|
+
return controlledNavScheme.map(({
|
|
83
|
+
title,
|
|
84
|
+
url,
|
|
85
|
+
items
|
|
86
|
+
}) => {
|
|
87
|
+
if (url && currentUrl) {
|
|
88
|
+
url = makeExternalUrl(url, currentUrl, !!isPlayground);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const item = {
|
|
92
|
+
title,
|
|
93
|
+
url
|
|
94
|
+
};
|
|
95
|
+
let isActive = isUrlActive(url, currentUrl);
|
|
96
|
+
item.items = items?.map(({
|
|
97
|
+
title,
|
|
98
|
+
url: childUrl
|
|
99
|
+
}) => {
|
|
100
|
+
if (childUrl && currentUrl) {
|
|
101
|
+
childUrl = makeExternalUrl(childUrl, currentUrl, !!isPlayground);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let childActive = isUrlActive(childUrl, currentUrl);
|
|
105
|
+
|
|
106
|
+
if (childActive) {
|
|
107
|
+
isActive = childActive;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
title,
|
|
112
|
+
url: childUrl,
|
|
113
|
+
isActive: childActive
|
|
114
|
+
};
|
|
115
|
+
}) ?? [];
|
|
116
|
+
item.isActive = isActive;
|
|
117
|
+
return item;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function makeExternalUrl(url, currentUrl, isPlayground) {
|
|
122
|
+
if (isPlayground) {
|
|
123
|
+
if (url.startsWith(PLAY_URL)) {
|
|
124
|
+
return url.replace(PLAY_URL, '/');
|
|
125
|
+
} else {
|
|
126
|
+
return `${KOTLINLANG_URL}${url}`;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return url;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export { ANDROID_TITLE, ANDROID_URL, COMMUNITY_TITLE, COMMUNITY_URL, DATA_SCIENCE_TITLE, DATA_SCIENCE_URL, DOCS_TITLE, DOCS_URL, HOME_TITLE, HOME_URL, KMM_DOCS_TITLE, KMM_DOCS_URL, KOTLIN_DOCS_TITLE, KOTLIN_DOCS_URL, MULTIPLATFORM_LIBRARIES_TITLE, MULTIPLATFORM_LIBRARIES_URL, MULTIPLATFORM_MOBILE_TITLE, MULTIPLATFORM_MOBILE_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, getNavScheme };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { useTextStyles } from '@rescui/typography';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import styles from './empty.module.pcss.js';
|
|
5
|
+
|
|
6
|
+
const EmptyResult = ({
|
|
7
|
+
placeholder
|
|
8
|
+
}) => {
|
|
9
|
+
const textCn = useTextStyles();
|
|
10
|
+
return React__default.createElement("div", {
|
|
11
|
+
className: styles.empty
|
|
12
|
+
}, React__default.createElement("div", {
|
|
13
|
+
className: classNames(textCn('rs-h4'), styles.resultString)
|
|
14
|
+
}, placeholder));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { EmptyResult };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { Result } from '../result/result.js';
|
|
3
|
+
import { useTextStyles } from '@rescui/typography';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { isMacOs } from '../../is-macos.js';
|
|
6
|
+
import styles from './list.module.pcss.js';
|
|
7
|
+
import { SearchResultView } from '../../header.js';
|
|
8
|
+
|
|
9
|
+
const ResultsList = ({
|
|
10
|
+
results,
|
|
11
|
+
searchString,
|
|
12
|
+
toggleFullSearch,
|
|
13
|
+
resultListViewType
|
|
14
|
+
}) => {
|
|
15
|
+
const textCn = useTextStyles();
|
|
16
|
+
return React__default.createElement("div", {
|
|
17
|
+
className: classNames(styles.results),
|
|
18
|
+
"data-test": 'quick-search-results'
|
|
19
|
+
}, results.length ? React__default.createElement(React__default.Fragment, null, resultListViewType === SearchResultView.Narrow && React__default.createElement("div", {
|
|
20
|
+
className: styles.topBar
|
|
21
|
+
}, React__default.createElement("div", {
|
|
22
|
+
className: classNames(textCn('rs-text-3'), styles.searchString)
|
|
23
|
+
}, "Showing results for \u00AB", searchString, "\u00BB"), React__default.createElement("button", {
|
|
24
|
+
className: styles.advancedSearch,
|
|
25
|
+
onClick: toggleFullSearch,
|
|
26
|
+
"data-test": 'advanced-search-button'
|
|
27
|
+
}, React__default.createElement("div", {
|
|
28
|
+
className: classNames(textCn('rs-text-3', {
|
|
29
|
+
hardness: 'hard'
|
|
30
|
+
}))
|
|
31
|
+
}, "Advanced search ", isMacOs() ? '⌘K' : 'Ctrl+K'))), results.map((searchResult, index) => React__default.createElement(Result, {
|
|
32
|
+
key: index,
|
|
33
|
+
hit: searchResult
|
|
34
|
+
}))) : null);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { ResultsList };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { LoadingIcon } from '@rescui/icons';
|
|
3
|
+
import styles from './loading.module.pcss.js';
|
|
4
|
+
|
|
5
|
+
const LoadingResults = () => {
|
|
6
|
+
return React__default.createElement("div", {
|
|
7
|
+
className: styles.loading
|
|
8
|
+
}, React__default.createElement(LoadingIcon, {
|
|
9
|
+
theme: 'dark',
|
|
10
|
+
size: 'l'
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { LoadingResults };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { ThemeProvider } from '@rescui/ui-contexts';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { ResultsList } from './list/list.js';
|
|
5
|
+
import { EmptyResult } from './empty/empty.js';
|
|
6
|
+
import { LoadingResults } from './loading/loading.js';
|
|
7
|
+
import styles from './quick-search.module.pcss.js';
|
|
8
|
+
|
|
9
|
+
const QuickSearch = ({
|
|
10
|
+
results,
|
|
11
|
+
searchString,
|
|
12
|
+
toggleFullSearch,
|
|
13
|
+
placeholder,
|
|
14
|
+
quickSearchBoxViewType
|
|
15
|
+
}) => {
|
|
16
|
+
const wrapperClassName = classNames(styles.wrapper, {
|
|
17
|
+
[styles.apiReferenceWrapper]: quickSearchBoxViewType
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (placeholder) {
|
|
21
|
+
return React__default.createElement(ThemeProvider, {
|
|
22
|
+
theme: 'dark'
|
|
23
|
+
}, React__default.createElement("div", {
|
|
24
|
+
className: wrapperClassName
|
|
25
|
+
}, React__default.createElement(EmptyResult, {
|
|
26
|
+
placeholder: placeholder
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (results.length > 0) {
|
|
31
|
+
return React__default.createElement(ThemeProvider, {
|
|
32
|
+
theme: 'dark'
|
|
33
|
+
}, React__default.createElement("div", {
|
|
34
|
+
className: wrapperClassName
|
|
35
|
+
}, React__default.createElement(ResultsList, {
|
|
36
|
+
results: results,
|
|
37
|
+
searchString: searchString,
|
|
38
|
+
toggleFullSearch: toggleFullSearch,
|
|
39
|
+
resultListViewType: quickSearchBoxViewType
|
|
40
|
+
})));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return React__default.createElement("div", {
|
|
44
|
+
className: wrapperClassName
|
|
45
|
+
}, React__default.createElement(LoadingResults, null));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { QuickSearch };
|