@jetbrains/kotlin-web-site-ui 4.0.0-alpha.2 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) 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/header.js +27 -32
  13. package/out/components/header/horizontal-menu/horizontal-menu.js +43 -53
  14. package/out/components/header/logo-large/logo-large.js +11 -17
  15. package/out/components/header/logo-small/logo-small.js +11 -17
  16. package/out/components/header/menu-popup/menu-button/menu-button.js +3 -5
  17. package/out/components/header/menu-popup/menu-popup.js +28 -37
  18. package/out/components/header/search-button/search-button.js +6 -6
  19. package/out/components/popup/popup.js +34 -40
  20. package/out/components/quotes-slider/quites-slider.js +33 -63
  21. package/out/components/top-menu/dropdown-menu/dropdown-menu.js +30 -40
  22. package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +1 -0
  23. package/out/components/top-menu/horizontal-menu/horizontal-menu.js +13 -17
  24. package/out/components/top-menu/index.css +11 -0
  25. package/out/components/top-menu/top-menu.js +19 -23
  26. package/out/components/youtube-player/youtube-player.js +24 -31
  27. package/package.json +6 -7
@@ -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 };
@@ -1,5 +1,4 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { forwardRef, useState, useMemo, useRef, useImperativeHandle, useLayoutEffect } from 'react';
1
+ import React__default, { forwardRef, useState, useMemo, useRef, useImperativeHandle, useLayoutEffect } from 'react';
3
2
  import { ThemeProvider } from '@rescui/ui-contexts';
4
3
  import useResizeObserver from '@react-hook/resize-observer';
5
4
  import { LogoLarge } from './logo-large/logo-large.js';
@@ -33,36 +32,32 @@ const Header = forwardRef(({
33
32
  setIsMenuPopupVisible((headerRef.current?.getBoundingClientRect?.().width ?? 0) <= MENU_POPUP_BREAKPOINT);
34
33
  }, [headerRef]);
35
34
  useResizeObserver(headerRef, entry => setIsMenuPopupVisible(entry.contentRect.width <= MENU_POPUP_BREAKPOINT));
36
- return jsx(ThemeProvider, Object.assign({
35
+ return React__default.createElement(ThemeProvider, {
37
36
  theme: 'dark'
38
- }, {
39
- children: jsxs("header", Object.assign({
40
- ref: headerRef,
41
- className: classNames(styles.headerMenu, className, {
42
- [styles.withMenuPopup]: menuPopupExpanded,
43
- [styles.border]: hasBorder
44
- })
45
- }, {
46
- children: [isMenuPopupVisible && currentTitle && currentUrl && !menuPopupExpanded ? jsx(LogoSmall, {
47
- homeTitle: currentTitle,
48
- homeUrl: currentUrl
49
- }, void 0) : jsx(LogoLarge, {
50
- productWebUrl: productWebUrl
51
- }, void 0), !isMenuPopupVisible && jsx(HorizontalMenu, {
52
- items: items,
53
- theme: dropdownTheme,
54
- linkHandler: linkHandler
55
- }, void 0), jsx(SearchButton, {
56
- onClick: onSearchClick,
57
- isActive: hasSearch && !!onSearchClick
58
- }, void 0), isMenuPopupVisible && jsx(MenuPopup, {
59
- items: items,
60
- setExpand: setMenuPopupExpanded,
61
- isExpanded: menuPopupExpanded,
62
- headerRef: headerRef,
63
- linkHandler: linkHandler
64
- }, void 0)]
65
- }), void 0)
66
- }), void 0);
37
+ }, React__default.createElement("header", {
38
+ ref: headerRef,
39
+ className: classNames(styles.headerMenu, className, {
40
+ [styles.withMenuPopup]: menuPopupExpanded,
41
+ [styles.border]: hasBorder
42
+ })
43
+ }, isMenuPopupVisible && currentTitle && currentUrl && !menuPopupExpanded ? React__default.createElement(LogoSmall, {
44
+ homeTitle: currentTitle,
45
+ homeUrl: currentUrl
46
+ }) : React__default.createElement(LogoLarge, {
47
+ productWebUrl: productWebUrl
48
+ }), !isMenuPopupVisible && React__default.createElement(HorizontalMenu, {
49
+ items: items,
50
+ theme: dropdownTheme,
51
+ linkHandler: linkHandler
52
+ }), React__default.createElement(SearchButton, {
53
+ onClick: onSearchClick,
54
+ isActive: hasSearch && !!onSearchClick
55
+ }), isMenuPopupVisible && React__default.createElement(MenuPopup, {
56
+ items: items,
57
+ setExpand: setMenuPopupExpanded,
58
+ isExpanded: menuPopupExpanded,
59
+ headerRef: headerRef,
60
+ linkHandler: linkHandler
61
+ })));
67
62
  });
68
63
  export { Header };
@@ -1,6 +1,5 @@
1
- import { useState, useEffect, createElement } from 'react';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
1
  import classNames from 'classnames';
2
+ import React__default, { useState, useEffect } from 'react';
4
3
  import styles from './horizontal-menu.module.pcss.js';
5
4
  import { useTextStyles } from '@rescui/typography';
6
5
 
@@ -11,28 +10,24 @@ const DropdownMenu = ({
11
10
  linkHandler
12
11
  }) => {
13
12
  const textCn = useTextStyles();
14
- return jsx("ul", Object.assign({
13
+ return React__default.createElement("ul", {
15
14
  className: classNames(styles.dropdownMenu, textCn('rs-text-2'), {
16
15
  [styles.dropdownMenuExpanded]: isExpanded,
17
16
  [styles.dropdownMenuAlignRight]: alignRight
18
17
  })
19
- }, {
20
- children: items.map((item, key) => {
21
- const Tag = !item.isActive && item.url ? 'a' : 'span';
22
- return jsx("li", {
23
- children: jsx(Tag, Object.assign({
24
- className: classNames(styles.dropdownMenuItem, {
25
- [styles.active]: item.isActive
26
- })
27
- }, item.url ? {
28
- href: item.url,
29
- onClick: linkHandler ? event => item.url && linkHandler(event, item.url) : undefined
30
- } : {}, {
31
- children: item.title
32
- }), void 0)
33
- }, key);
34
- })
35
- }), void 0);
18
+ }, items.map((item, key) => {
19
+ const Tag = !item.isActive && item.url ? 'a' : 'span';
20
+ return React__default.createElement("li", {
21
+ key: key
22
+ }, React__default.createElement(Tag, Object.assign({
23
+ className: classNames(styles.dropdownMenuItem, {
24
+ [styles.active]: item.isActive
25
+ })
26
+ }, item.url ? {
27
+ href: item.url,
28
+ onClick: linkHandler ? event => item.url && linkHandler(event, item.url) : undefined
29
+ } : {}), item.title));
30
+ }));
36
31
  };
37
32
 
38
33
  const HorizontalMenuItem = ({
@@ -48,27 +43,25 @@ const HorizontalMenuItem = ({
48
43
 
49
44
  const handleEnter = () => onMouseEnter(item);
50
45
 
51
- return jsxs("li", Object.assign({
46
+ return React__default.createElement("li", {
52
47
  className: styles.menuItemWrap,
53
48
  onMouseEnter: handleEnter,
54
49
  onMouseLeave: onMouseLeave
55
- }, {
56
- children: [createElement(Tag, Object.assign({}, item.url ? {
57
- href: item.url,
58
- onClick: linkHandler ? event => item.url && linkHandler(event, item.url) : undefined
59
- } : {}, {
60
- key: item.title,
61
- className: classNames(styles.menuItem, textCn('rs-text-2'), {
62
- [styles.itemActive]: item.isActive,
63
- [styles.expanded]: isExpanded && !!item.items?.length
64
- })
65
- }), item.title), !!item.items?.length && jsx(DropdownMenu, {
66
- items: item.items,
67
- isExpanded: isExpanded,
68
- alignRight: isLast,
69
- linkHandler: linkHandler
70
- }, void 0)]
71
- }), void 0);
50
+ }, React__default.createElement(Tag, Object.assign({}, item.url ? {
51
+ href: item.url,
52
+ onClick: linkHandler ? event => item.url && linkHandler(event, item.url) : undefined
53
+ } : {}, {
54
+ key: item.title,
55
+ className: classNames(styles.menuItem, textCn('rs-text-2'), {
56
+ [styles.itemActive]: item.isActive,
57
+ [styles.expanded]: isExpanded && !!item.items?.length
58
+ })
59
+ }), item.title), !!item.items?.length && React__default.createElement(DropdownMenu, {
60
+ items: item.items,
61
+ isExpanded: isExpanded,
62
+ alignRight: isLast,
63
+ linkHandler: linkHandler
64
+ }));
72
65
  };
73
66
 
74
67
  const HorizontalMenu = ({
@@ -87,24 +80,21 @@ const HorizontalMenu = ({
87
80
 
88
81
  const handleLeave = () => setActiveIndex(-1);
89
82
 
90
- return jsx("nav", Object.assign({
83
+ return React__default.createElement("nav", {
91
84
  className: classNames(styles.nav, {
92
85
  [styles.darkTheme]: theme === 'dark'
93
86
  })
94
- }, {
95
- children: jsx("ul", Object.assign({
96
- className: styles.menuList
97
- }, {
98
- children: items.map((item, index) => jsx(HorizontalMenuItem, {
99
- item: item,
100
- onMouseEnter: handleEnter,
101
- onMouseLeave: handleLeave,
102
- isExpanded: index === debouncedActiveIndex,
103
- isLast: index === items.length - 1,
104
- linkHandler: linkHandler
105
- }, index))
106
- }), void 0)
107
- }), void 0);
87
+ }, React__default.createElement("ul", {
88
+ className: styles.menuList
89
+ }, items.map((item, index) => React__default.createElement(HorizontalMenuItem, {
90
+ item: item,
91
+ onMouseEnter: handleEnter,
92
+ onMouseLeave: handleLeave,
93
+ isExpanded: index === debouncedActiveIndex,
94
+ isLast: index === items.length - 1,
95
+ key: index,
96
+ linkHandler: linkHandler
97
+ }))));
108
98
  };
109
99
 
110
100
  export { HorizontalMenu };