@jetbrains/kotlin-web-site-ui 4.0.0 → 4.1.0-alpha.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 (36) hide show
  1. package/out/components/header/full-search/chapters/chapters.js +59 -0
  2. package/out/components/header/full-search/chapters/chapters.module.pcss.js +11 -0
  3. package/out/components/header/full-search/empty/empty.js +22 -0
  4. package/out/components/header/full-search/empty/empty.module.pcss.js +6 -0
  5. package/out/components/header/full-search/empty/full-search-empty.svg.js +1539 -0
  6. package/out/components/header/full-search/full-search.js +70 -0
  7. package/out/components/header/full-search/full-search.module.pcss.js +9 -0
  8. package/out/components/header/full-search/hit-list/get-extended-hits.js +55 -0
  9. package/out/components/header/full-search/hit-list/hit-list.js +47 -0
  10. package/out/components/header/full-search/hit-list/hit-list.module.pcss.js +5 -0
  11. package/out/components/header/full-search/loading/loading.js +11 -0
  12. package/out/components/header/full-search/loading/loading.module.pcss.js +4 -0
  13. package/out/components/header/full-search/results-list/results-list.js +25 -0
  14. package/out/components/header/header.js +53 -7
  15. package/out/components/header/index.css +259 -0
  16. package/out/components/header/is-macos.js +5 -0
  17. package/out/components/header/key-codes.js +3 -0
  18. package/out/components/header/quick-search/empty/empty.js +16 -0
  19. package/out/components/header/quick-search/empty/empty.module.pcss.js +4 -0
  20. package/out/components/header/quick-search/list/list.js +32 -0
  21. package/out/components/header/quick-search/list/list.module.pcss.js +7 -0
  22. package/out/components/header/quick-search/loading/loading.js +14 -0
  23. package/out/components/header/quick-search/loading/loading.module.pcss.js +4 -0
  24. package/out/components/header/quick-search/quick-search.js +41 -0
  25. package/out/components/header/quick-search/quick-search.module.pcss.js +4 -0
  26. package/out/components/header/quick-search/result/result.js +30 -0
  27. package/out/components/header/quick-search/result/result.module.pcss.js +6 -0
  28. package/out/components/header/search-box/search-box.js +69 -0
  29. package/out/components/header/search-box/search-box.module.pcss.js +4 -0
  30. package/out/components/header/search-wrapper/init-search.js +60 -0
  31. package/out/components/header/search-wrapper/search-const.js +13 -0
  32. package/out/components/header/search-wrapper/search-context.js +18 -0
  33. package/out/components/header/search-wrapper/search-with-algolia.js +58 -0
  34. package/out/components/header/search-wrapper/search-wrapper.js +40 -0
  35. package/out/components/header/search-wrapper/use-search.js +85 -0
  36. package/package.json +10 -2
@@ -0,0 +1,59 @@
1
+ import React__default, { useState } from 'react';
2
+ import Button from '@rescui/button';
3
+ import { useTextStyles } from '@rescui/typography';
4
+ import classNames from 'classnames';
5
+ import styles from './chapters.module.pcss.js';
6
+ const MAX_INIT_CHAPTERS_NUMBER = 3;
7
+
8
+ const Chapters = ({
9
+ chapters,
10
+ hitIndex
11
+ }) => {
12
+ const [isExpanded, setIsExpanded] = useState(false);
13
+
14
+ const toggleChaptersExpand = () => setIsExpanded(!isExpanded);
15
+
16
+ const isExtraSection = index => index >= MAX_INIT_CHAPTERS_NUMBER;
17
+
18
+ const textCn = useTextStyles();
19
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
20
+ className: styles.chapters
21
+ }, chapters.map(({
22
+ url,
23
+ title,
24
+ snippet,
25
+ hitId: chapterId
26
+ }, index) => React__default.createElement("div", {
27
+ className: classNames(styles.singleChapter, {
28
+ [styles.extraSection]: isExtraSection(index),
29
+ [styles.visibleSection]: isExtraSection(index) && isExpanded
30
+ }),
31
+ key: chapterId
32
+ }, React__default.createElement("h4", {
33
+ className: classNames(textCn('rs-h4'), styles.headliner)
34
+ }, React__default.createElement("a", {
35
+ className: classNames(styles.chapterTitle, textCn('rs-link', {
36
+ mode: 'clear',
37
+ hardness: 'hard'
38
+ })),
39
+ href: url,
40
+ id: chapterId,
41
+ dangerouslySetInnerHTML: {
42
+ __html: title
43
+ }
44
+ })), React__default.createElement("div", {
45
+ className: classNames(textCn('rs-text-2'), styles.snippet),
46
+ dangerouslySetInnerHTML: {
47
+ __html: snippet
48
+ }
49
+ })))), chapters.length > MAX_INIT_CHAPTERS_NUMBER && React__default.createElement("div", {
50
+ className: styles.moreButton
51
+ }, React__default.createElement(Button, {
52
+ mode: "outline",
53
+ size: "s",
54
+ onClick: toggleChaptersExpand,
55
+ "data-test": "show-more-button"
56
+ }, isExpanded ? 'Show less' : 'Show more')));
57
+ };
58
+
59
+ export { Chapters };
@@ -0,0 +1,11 @@
1
+ var styles = {
2
+ "chapters": "ktl-chapters-module_chapters_J0wLB",
3
+ "chapterTitle": "ktl-chapters-module_chapterTitle_b6Rdz",
4
+ "singleChapter": "ktl-chapters-module_singleChapter_zSmx2",
5
+ "headliner": "ktl-chapters-module_headliner_ZBuf9",
6
+ "snippet": "ktl-chapters-module_snippet_yROJo",
7
+ "extraSection": "ktl-chapters-module_extraSection_lsZfw",
8
+ "visibleSection": "ktl-chapters-module_visibleSection_wQyvM",
9
+ "moreButton": "ktl-chapters-module_moreButton_98oqy"
10
+ };
11
+ export { styles as default };
@@ -0,0 +1,22 @@
1
+ import React__default from 'react';
2
+ import classNames from 'classnames';
3
+ import { useTextStyles } from '@rescui/typography';
4
+ import SvgFullSearchEmpty from './full-search-empty.svg.js';
5
+ import styles from './empty.module.pcss.js';
6
+
7
+ const FullSearchEmpty = ({
8
+ placeholder
9
+ }) => {
10
+ const textCn = useTextStyles();
11
+ return React__default.createElement("div", {
12
+ className: styles.wrapper
13
+ }, React__default.createElement("p", {
14
+ className: classNames(textCn('rs-text-1'), styles.title)
15
+ }, placeholder), React__default.createElement("p", {
16
+ className: textCn('rs-text-1')
17
+ }, "Please, try again!"), React__default.createElement("div", {
18
+ className: styles.image
19
+ }, React__default.createElement(SvgFullSearchEmpty, null)));
20
+ };
21
+
22
+ export { FullSearchEmpty };
@@ -0,0 +1,6 @@
1
+ var styles = {
2
+ "wrapper": "ktl-empty-module_wrapper_cNB8Y",
3
+ "title": "ktl-empty-module_title_p2FMj",
4
+ "image": "ktl-empty-module_image_6Xr6L"
5
+ };
6
+ export { styles as default };