@jetbrains/kotlin-web-site-ui 4.0.0-alpha.2 → 4.1.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.
Files changed (77) hide show
  1. package/out/blocks/formik-wrapper/input.js +3 -3
  2. package/out/blocks/formik-wrapper/privacy-checkbox.js +17 -21
  3. package/out/blocks/formik-wrapper/privacy-notice.js +19 -28
  4. package/out/blocks/formik-wrapper/submit-button.js +3 -3
  5. package/out/components/cta-block/cta-block.js +17 -33
  6. package/out/components/footer/footer.js +30 -48
  7. package/out/components/footer/logo/logo.js +3 -5
  8. package/out/components/footer/nav/nav-item.js +11 -15
  9. package/out/components/footer/nav/nav-list.js +8 -11
  10. package/out/components/footer/social-list/social-item/social-item.js +3 -5
  11. package/out/components/footer/social-list/social-list.js +6 -7
  12. package/out/components/header/{consts.js → components/header/consts.js} +0 -0
  13. package/out/components/header/components/header/full-search/chapters/chapters.js +56 -0
  14. package/out/components/header/components/header/full-search/chapters/chapters.module.pcss.js +11 -0
  15. package/out/components/header/components/header/full-search/empty/empty.js +22 -0
  16. package/out/components/header/components/header/full-search/empty/empty.module.pcss.js +6 -0
  17. package/out/components/header/components/header/full-search/empty/full-search-empty.svg.js +1539 -0
  18. package/out/components/header/components/header/full-search/full-search.js +70 -0
  19. package/out/components/header/components/header/full-search/full-search.module.pcss.js +9 -0
  20. package/out/components/header/components/header/full-search/hit-list/hit-list.js +44 -0
  21. package/out/components/header/components/header/full-search/hit-list/hit-list.module.pcss.js +5 -0
  22. package/out/components/header/components/header/full-search/loading/loading.js +11 -0
  23. package/out/components/header/components/header/full-search/loading/loading.module.pcss.js +4 -0
  24. package/out/components/header/components/header/full-search/result/get-extended-hits.js +55 -0
  25. package/out/components/header/components/header/full-search/results-list/results-list.js +25 -0
  26. package/out/components/header/components/header/header.js +105 -0
  27. package/out/components/header/{header.module.pcss.js → components/header/header.module.pcss.js} +0 -0
  28. package/out/components/header/components/header/horizontal-menu/horizontal-menu.js +100 -0
  29. package/out/components/header/{horizontal-menu → components/header/horizontal-menu}/horizontal-menu.module.pcss.js +0 -0
  30. package/out/components/header/{index.js → components/header/index.js} +0 -0
  31. package/out/components/header/{logo-large → components/header/logo-large}/kotlin-logo-large.svg.js +0 -0
  32. package/out/components/header/{logo-large → components/header/logo-large}/logo-large.js +11 -17
  33. package/out/components/header/{logo-large → components/header/logo-large}/logo-large.module.pcss.js +0 -0
  34. package/out/components/header/{logo-small → components/header/logo-small}/kotlin-logo-small.svg.js +0 -0
  35. package/out/components/header/components/header/logo-small/logo-small.js +27 -0
  36. package/out/components/header/{logo-small → components/header/logo-small}/logo-small.module.pcss.js +0 -0
  37. package/out/components/header/{menu-popup → components/header/menu-popup}/menu-button/close-icon.svg.js +0 -0
  38. package/out/components/header/{menu-popup → components/header/menu-popup}/menu-button/hamburger-icon.svg.js +0 -0
  39. package/out/components/header/{menu-popup → components/header/menu-popup}/menu-button/menu-button.js +3 -5
  40. package/out/components/header/{menu-popup → components/header/menu-popup}/menu-button/menu-button.module.pcss.js +0 -0
  41. package/out/components/header/{menu-popup → components/header/menu-popup}/menu-popup.js +28 -37
  42. package/out/components/header/{menu-popup → components/header/menu-popup}/menu-popup.module.pcss.js +0 -0
  43. package/out/components/header/{nav-scheme.js → components/header/nav-scheme.js} +0 -0
  44. package/out/components/header/components/header/quick-search/empty/empty.js +16 -0
  45. package/out/components/header/components/header/quick-search/empty/empty.module.pcss.js +4 -0
  46. package/out/components/header/components/header/quick-search/list/list.js +31 -0
  47. package/out/components/header/components/header/quick-search/list/list.module.pcss.js +6 -0
  48. package/out/components/header/components/header/quick-search/loading/loading.js +14 -0
  49. package/out/components/header/components/header/quick-search/loading/loading.module.pcss.js +4 -0
  50. package/out/components/header/components/header/quick-search/quick-search.js +41 -0
  51. package/out/components/header/components/header/quick-search/quick-search.module.pcss.js +4 -0
  52. package/out/components/header/components/header/quick-search/result/result.js +30 -0
  53. package/out/components/header/components/header/quick-search/result/result.module.pcss.js +6 -0
  54. package/out/components/header/components/header/search-box/search-box.js +69 -0
  55. package/out/components/header/components/header/search-box/search-box.module.pcss.js +4 -0
  56. package/out/components/header/{search-button → components/header/search-button}/search-button.js +6 -6
  57. package/out/components/header/{search-button → components/header/search-button}/search-button.module.pcss.js +0 -0
  58. package/out/components/header/{search-button → components/header/search-button}/search.svg.js +0 -0
  59. package/out/components/header/components/header/search-wrapper/init-search.js +60 -0
  60. package/out/components/header/components/header/search-wrapper/search-const.js +13 -0
  61. package/out/components/header/components/header/search-wrapper/search-context.js +18 -0
  62. package/out/components/header/components/header/search-wrapper/search-with-algolia.js +58 -0
  63. package/out/components/header/components/header/search-wrapper/search-wrapper.js +40 -0
  64. package/out/components/header/components/header/search-wrapper/use-search.js +85 -0
  65. package/out/components/header/helper/is-macos.js +5 -0
  66. package/out/components/header/helper/key-codes.js +3 -0
  67. package/out/components/header/index.css +253 -0
  68. package/out/components/popup/popup.js +34 -40
  69. package/out/components/quotes-slider/quites-slider.js +33 -63
  70. package/out/components/top-menu/dropdown-menu/dropdown-menu.js +28 -40
  71. package/out/components/top-menu/horizontal-menu/horizontal-menu.js +13 -17
  72. package/out/components/top-menu/top-menu.js +19 -23
  73. package/out/components/youtube-player/youtube-player.js +24 -31
  74. package/package.json +13 -8
  75. package/out/components/header/header.js +0 -68
  76. package/out/components/header/horizontal-menu/horizontal-menu.js +0 -110
  77. package/out/components/header/logo-small/logo-small.js +0 -33
@@ -1,4 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import React from 'react';
2
2
  import Input from '@rescui/input';
3
3
  import { useField, useFormikContext } from 'formik';
4
4
 
@@ -15,7 +15,7 @@ const FormikInput = ({
15
15
  isSubmitting,
16
16
  submitCount
17
17
  } = useFormikContext();
18
- return jsx(Input, Object.assign({}, restProps, formikProps, {
18
+ return React.createElement(Input, Object.assign({}, restProps, formikProps, {
19
19
  onBlur: e => {
20
20
  if (onBlur) {
21
21
  onBlur(e);
@@ -32,7 +32,7 @@ const FormikInput = ({
32
32
  },
33
33
  disabled: isSubmitting || status && (status.disabled || status.submitted) || disabled,
34
34
  error: (meta.touched || submitCount > 0) && meta.error
35
- }), void 0);
35
+ }));
36
36
  };
37
37
 
38
38
  export { FormikInput };
@@ -1,4 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import React from 'react';
2
2
  import { useField, useFormikContext } from 'formik';
3
3
  import { PrivacyNotice } from './privacy-notice.js';
4
4
  import { Checkbox } from '@rescui/checkbox';
@@ -26,27 +26,23 @@ const FormikPrivacyCheckbox = ({
26
26
  isSubmitting,
27
27
  status
28
28
  } = useFormikContext();
29
- return jsx("div", Object.assign({
29
+ return React.createElement("div", {
30
30
  className: className
31
- }, {
32
- children: jsx(Checkbox, Object.assign({
33
- name: name,
34
- onBlur: e => {
35
- onBlurFromFormik(e);
36
- },
37
- onChange: e => {
38
- setFieldValue(name, e.target.checked);
39
- },
40
- checked: Boolean(value) || false,
41
- disabled: isSubmitting || status && (status.disabled || status.submitted),
42
- error: (meta.touched || submitCount > 0) && meta.error
43
- }, {
44
- children: jsx(PrivacyNotice, {
45
- consentId: consentId,
46
- privacy: privacy
47
- }, void 0)
48
- }), void 0)
49
- }), void 0);
31
+ }, React.createElement(Checkbox, {
32
+ name: name,
33
+ onBlur: e => {
34
+ onBlurFromFormik(e);
35
+ },
36
+ onChange: e => {
37
+ setFieldValue(name, e.target.checked);
38
+ },
39
+ checked: Boolean(value) || false,
40
+ disabled: isSubmitting || status && (status.disabled || status.submitted),
41
+ error: (meta.touched || submitCount > 0) && meta.error
42
+ }, React.createElement(PrivacyNotice, {
43
+ consentId: consentId,
44
+ privacy: privacy
45
+ })));
50
46
  };
51
47
 
52
48
  export { FormikPrivacyCheckbox };
@@ -1,5 +1,4 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { useState, useEffect } from 'react';
1
+ import React, { useState, useEffect } from 'react';
3
2
  import Tooltip from '@rescui/tooltip';
4
3
  import { InfoIcon } from '@rescui/icons';
5
4
  import styles from './privacy-notice.module.pcss.js';
@@ -17,33 +16,25 @@ const PrivacyNotice = ({
17
16
  }) => setTextHtml(text));
18
17
  }
19
18
  }, [consentId]);
20
- return jsxs("span", Object.assign({
19
+ return React.createElement("span", {
21
20
  className: styles.privacyNotice
22
- }, {
23
- children: [jsxs("span", Object.assign({
24
- className: classNames(styles.message, 'ktl-text-3')
25
- }, {
26
- children: ["By submitting this form I agree to the", ' ', jsx("a", Object.assign({
27
- target: "_blank",
28
- rel: "noreferrer noopener",
29
- href: "https://www.jetbrains.com/company/privacy.html",
30
- className: "rs-link"
31
- }, {
32
- children: "JetBrains Privacy Policy"
33
- }), void 0)]
34
- }), void 0), textHtml && jsx(Tooltip, Object.assign({
35
- content: jsx("span", {
36
- dangerouslySetInnerHTML: {
37
- __html: textHtml
38
- }
39
- }, void 0)
40
- }, {
41
- children: jsx(InfoIcon, {
42
- size: "s",
43
- className: styles.icon
44
- }, void 0)
45
- }), void 0)]
46
- }), void 0);
21
+ }, React.createElement("span", {
22
+ className: classNames(styles.message, 'ktl-text-3')
23
+ }, "By submitting this form I agree to the", ' ', React.createElement("a", {
24
+ target: "_blank",
25
+ rel: "noreferrer noopener",
26
+ href: "https://www.jetbrains.com/company/privacy.html",
27
+ className: "rs-link"
28
+ }, "JetBrains Privacy Policy")), textHtml && React.createElement(Tooltip, {
29
+ content: React.createElement("span", {
30
+ dangerouslySetInnerHTML: {
31
+ __html: textHtml
32
+ }
33
+ })
34
+ }, React.createElement(InfoIcon, {
35
+ size: "s",
36
+ className: styles.icon
37
+ })));
47
38
  };
48
39
 
49
40
  export { PrivacyNotice };
@@ -1,4 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import React from 'react';
2
2
  import { useFormikContext } from 'formik';
3
3
  import Button from '@rescui/button';
4
4
 
@@ -11,11 +11,11 @@ const FormikSubmitButton = ({
11
11
  isValid,
12
12
  isSubmitting
13
13
  } = useFormikContext();
14
- return jsx(Button, Object.assign({}, restProps, {
14
+ return React.createElement(Button, Object.assign({}, restProps, {
15
15
  disabled: !isValid || disabled,
16
16
  busy: isSubmitting || busy,
17
17
  type: 'submit'
18
- }), void 0);
18
+ }));
19
19
  };
20
20
 
21
21
  export { FormikSubmitButton };
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import React from 'react';
2
2
  import styles from './cta-block.module.pcss.js';
3
3
 
4
4
  const CtaBlock = ({
@@ -7,39 +7,23 @@ const CtaBlock = ({
7
7
  children,
8
8
  buttons
9
9
  }) => {
10
- return jsx("div", Object.assign({
10
+ return React.createElement("div", {
11
11
  className: styles.wrapper
12
- }, {
13
- children: jsxs("div", Object.assign({
14
- className: 'ktl-container'
15
- }, {
16
- children: [topTitle && jsx("div", Object.assign({
17
- className: styles.topTitle
18
- }, {
19
- children: jsx("div", Object.assign({
20
- className: 'ktl-text-2 ktl-text-2_theme_dark'
21
- }, {
22
- children: topTitle
23
- }), void 0)
24
- }), void 0), jsx("div", Object.assign({
25
- className: styles.mainTitle
26
- }, {
27
- children: jsx("h2", Object.assign({
28
- className: 'ktl-hero ktl-hero_theme_dark'
29
- }, {
30
- children: mainTitle
31
- }), void 0)
32
- }), void 0), children && jsx("div", Object.assign({
33
- className: styles.content
34
- }, {
35
- children: children
36
- }), void 0), jsx("div", {}, void 0), buttons && jsx("div", Object.assign({
37
- className: styles.buttons
38
- }, {
39
- children: buttons
40
- }), void 0)]
41
- }), void 0)
42
- }), void 0);
12
+ }, React.createElement("div", {
13
+ className: 'ktl-container'
14
+ }, topTitle && React.createElement("div", {
15
+ className: styles.topTitle
16
+ }, React.createElement("div", {
17
+ className: 'ktl-text-2 ktl-text-2_theme_dark'
18
+ }, topTitle)), React.createElement("div", {
19
+ className: styles.mainTitle
20
+ }, React.createElement("h2", {
21
+ className: 'ktl-hero ktl-hero_theme_dark'
22
+ }, mainTitle)), children && React.createElement("div", {
23
+ className: styles.content
24
+ }, children), React.createElement("div", null), buttons && React.createElement("div", {
25
+ className: styles.buttons
26
+ }, buttons)));
43
27
  };
44
28
 
45
29
  export { CtaBlock };
@@ -1,4 +1,4 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
  import { useTheme } from '@rescui/ui-contexts';
3
3
  import { SocialList } from './social-list/social-list.js';
4
4
  import { NavList } from './nav/nav-list.js';
@@ -17,57 +17,39 @@ const Footer = ({
17
17
  hardness: 'pale',
18
18
  mode: 'clear'
19
19
  });
20
- return jsxs("footer", Object.assign({
20
+ return React__default.createElement("footer", {
21
21
  className: classNames(styles.footer, className, {
22
22
  [styles.footerDarkTheme]: theme === 'dark'
23
23
  }),
24
24
  ref: forwardedRef
25
- }, {
26
- children: [jsxs("div", Object.assign({
27
- className: styles.socialListArea
28
- }, {
29
- children: [jsx("div", Object.assign({
30
- className: classNames(textCn('rs-h4'), styles.socialListTitle)
31
- }, {
32
- children: "Stay in touch:"
33
- }), void 0), jsx(SocialList, {}, void 0)]
34
- }), void 0), jsx(NavList, {
35
- className: styles.navListArea
36
- }, void 0), jsxs("div", Object.assign({
37
- className: classNames(textCn('rs-text-3', {
38
- hardness: 'pale'
39
- }), styles.textArea)
40
- }, {
41
- children: [jsxs("div", Object.assign({
42
- className: styles.copyright
43
- }, {
44
- children: ["Kotlin\u2122 is\u00A0protected under the", ' ', jsx("a", Object.assign({
45
- className: classNames(linkClass, styles.underlinedLink),
46
- href: "https://kotlinlang.org/foundation/kotlin-foundation.html"
47
- }, {
48
- children: "Kotlin\u00A0Foundation"
49
- }), void 0), ' ', "and licensed under the", ' ', jsx("a", Object.assign({
50
- className: classNames(linkClass, styles.underlinedLink),
51
- target: "_blank",
52
- href: "https://github.com/JetBrains/kotlin-web-site/blob/master/LICENSE"
53
- }, {
54
- children: "Apache 2\u00A0license"
55
- }), void 0), "."]
56
- }), void 0), ' ', jsxs("div", Object.assign({
57
- className: styles.motto
58
- }, {
59
- children: ["Supported and developed by\u00A0", jsx("a", Object.assign({
60
- className: classNames(linkClass, styles.underlinedLink),
61
- href: "https://www.jetbrains.com/",
62
- target: "_blank"
63
- }, {
64
- children: "JetBrains"
65
- }), void 0)]
66
- }), void 0)]
67
- }), void 0), jsx(Logo, {
68
- className: styles.logoArea
69
- }, void 0)]
70
- }), void 0);
25
+ }, React__default.createElement("div", {
26
+ className: styles.socialListArea
27
+ }, React__default.createElement("div", {
28
+ className: classNames(textCn('rs-h4'), styles.socialListTitle)
29
+ }, "Stay in touch:"), React__default.createElement(SocialList, null)), React__default.createElement(NavList, {
30
+ className: styles.navListArea
31
+ }), React__default.createElement("div", {
32
+ className: classNames(textCn('rs-text-3', {
33
+ hardness: 'pale'
34
+ }), styles.textArea)
35
+ }, React__default.createElement("div", {
36
+ className: styles.copyright
37
+ }, "Kotlin\u2122 is\u00A0protected under the", ' ', React__default.createElement("a", {
38
+ className: classNames(linkClass, styles.underlinedLink),
39
+ href: "https://kotlinlang.org/foundation/kotlin-foundation.html"
40
+ }, "Kotlin\u00A0Foundation"), ' ', "and licensed under the", ' ', React__default.createElement("a", {
41
+ className: classNames(linkClass, styles.underlinedLink),
42
+ target: "_blank",
43
+ href: "https://github.com/JetBrains/kotlin-web-site/blob/master/LICENSE"
44
+ }, "Apache 2\u00A0license"), "."), ' ', React__default.createElement("div", {
45
+ className: styles.motto
46
+ }, "Supported and developed by\u00A0", React__default.createElement("a", {
47
+ className: classNames(linkClass, styles.underlinedLink),
48
+ href: "https://www.jetbrains.com/",
49
+ target: "_blank"
50
+ }, "JetBrains"))), React__default.createElement(Logo, {
51
+ className: styles.logoArea
52
+ }));
71
53
  };
72
54
 
73
55
  export { Footer };
@@ -1,14 +1,12 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
  import classNames from 'classnames';
3
3
  import SvgJetbrainsLogo from './jetbrains-logo.svg.js';
4
4
  import styles from './logo.module.pcss.js';
5
5
 
6
- const Logo = props => jsx("a", Object.assign({
6
+ const Logo = props => React__default.createElement("a", {
7
7
  href: "https://jetbrains.com",
8
8
  target: "_blank",
9
9
  className: classNames(props.className, styles.link)
10
- }, {
11
- children: jsx(SvgJetbrainsLogo, {}, void 0)
12
- }), void 0);
10
+ }, React__default.createElement(SvgJetbrainsLogo, null));
13
11
 
14
12
  export { Logo };
@@ -1,4 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
  import { useTheme } from '@rescui/ui-contexts';
3
3
  import classNames from 'classnames';
4
4
  import styles from './nav-item.module.pcss.js';
@@ -9,23 +9,19 @@ const NavItem = ({
9
9
  }) => {
10
10
  const textCn = useTextStyles();
11
11
  const theme = useTheme();
12
- return jsx("li", Object.assign({
12
+ return React__default.createElement("li", {
13
13
  className: classNames(styles.navItem, {
14
14
  [styles.navItemDarkTheme]: theme == 'dark'
15
15
  })
16
- }, {
17
- children: jsx("a", Object.assign({
18
- target: data.isTargetBlank ? '_blank' : undefined,
19
- href: data.url,
20
- title: data.title,
21
- className: classNames(textCn('rs-text-2'), textCn('rs-link', {
22
- hardness: 'average',
23
- mode: 'clear'
24
- }))
25
- }, {
26
- children: data.title
27
- }), void 0)
28
- }), void 0);
16
+ }, React__default.createElement("a", {
17
+ target: data.isTargetBlank ? '_blank' : undefined,
18
+ href: data.url,
19
+ title: data.title,
20
+ className: classNames(textCn('rs-text-2'), textCn('rs-link', {
21
+ hardness: 'average',
22
+ mode: 'clear'
23
+ }))
24
+ }, data.title));
29
25
  };
30
26
 
31
27
  export { NavItem };
@@ -1,18 +1,15 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
  import styles from './nav-list.module.pcss.js';
3
3
  import { navList } from './nav-data.js';
4
4
  import { NavItem } from './nav-item.js';
5
5
 
6
- const NavList = props => jsx("nav", Object.assign({
6
+ const NavList = props => React__default.createElement("nav", {
7
7
  className: props.className
8
- }, {
9
- children: jsx("ul", Object.assign({
10
- className: styles.navList
11
- }, {
12
- children: navList.map(value => jsx(NavItem, {
13
- data: value
14
- }, value.url))
15
- }), void 0)
16
- }), void 0);
8
+ }, React__default.createElement("ul", {
9
+ className: styles.navList
10
+ }, navList.map(value => React__default.createElement(NavItem, {
11
+ key: value.url,
12
+ data: value
13
+ }))));
17
14
 
18
15
  export { NavList };
@@ -1,4 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
  import { useTheme } from '@rescui/ui-contexts';
3
3
  import classNames from 'classnames';
4
4
  import styles from './social-item.module.pcss.js';
@@ -8,16 +8,14 @@ const SocialItem = ({
8
8
  }) => {
9
9
  const SocialIcon = socialNetwork.icon;
10
10
  const theme = useTheme();
11
- return jsx("a", Object.assign({
11
+ return React__default.createElement("a", {
12
12
  target: "_blank",
13
13
  className: classNames(styles.socialItem, {
14
14
  [styles.socialItemDarkTheme]: theme === 'dark'
15
15
  }),
16
16
  href: socialNetwork.url,
17
17
  title: socialNetwork.title
18
- }, {
19
- children: jsx(SocialIcon, {}, void 0)
20
- }), void 0);
18
+ }, React__default.createElement(SocialIcon, null));
21
19
  };
22
20
 
23
21
  export { SocialItem };
@@ -1,14 +1,13 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
  import styles from './social-list.module.pcss.js';
3
3
  import { socialList } from './social-data.js';
4
4
  import { SocialItem } from './social-item/social-item.js';
5
5
 
6
- const SocialList = () => jsx("div", Object.assign({
6
+ const SocialList = () => React__default.createElement("div", {
7
7
  className: styles.socialList
8
- }, {
9
- children: socialList.map(socialNetwork => jsx(SocialItem, {
10
- socialNetwork: socialNetwork
11
- }, socialNetwork.url))
12
- }), void 0);
8
+ }, socialList.map(socialNetwork => React__default.createElement(SocialItem, {
9
+ key: socialNetwork.url,
10
+ socialNetwork: socialNetwork
11
+ })));
13
12
 
14
13
  export { SocialList };
@@ -0,0 +1,56 @@
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
+ href: url,
37
+ id: chapterId,
38
+ dangerouslySetInnerHTML: {
39
+ __html: title
40
+ }
41
+ })), React__default.createElement("div", {
42
+ className: classNames(textCn('rs-text-2'), styles.snippet),
43
+ dangerouslySetInnerHTML: {
44
+ __html: snippet
45
+ }
46
+ })))), chapters.length > MAX_INIT_CHAPTERS_NUMBER && React__default.createElement("div", {
47
+ className: styles.moreButton
48
+ }, React__default.createElement(Button, {
49
+ mode: "outline",
50
+ size: "s",
51
+ onClick: toggleChaptersExpand,
52
+ "data-test": "show-more-button"
53
+ }, isExpanded ? 'Show less' : 'Show more')));
54
+ };
55
+
56
+ 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 };