@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.
- package/out/blocks/formik-wrapper/input.js +3 -3
- package/out/blocks/formik-wrapper/privacy-checkbox.js +17 -21
- package/out/blocks/formik-wrapper/privacy-notice.js +19 -28
- package/out/blocks/formik-wrapper/submit-button.js +3 -3
- package/out/components/cta-block/cta-block.js +17 -33
- package/out/components/footer/footer.js +30 -48
- package/out/components/footer/logo/logo.js +3 -5
- package/out/components/footer/nav/nav-item.js +11 -15
- package/out/components/footer/nav/nav-list.js +8 -11
- package/out/components/footer/social-list/social-item/social-item.js +3 -5
- package/out/components/footer/social-list/social-list.js +6 -7
- package/out/components/header/header.js +27 -32
- package/out/components/header/horizontal-menu/horizontal-menu.js +43 -53
- package/out/components/header/logo-large/logo-large.js +11 -17
- package/out/components/header/logo-small/logo-small.js +11 -17
- package/out/components/header/menu-popup/menu-button/menu-button.js +3 -5
- package/out/components/header/menu-popup/menu-popup.js +28 -37
- package/out/components/header/search-button/search-button.js +6 -6
- package/out/components/popup/popup.js +34 -40
- package/out/components/quotes-slider/quites-slider.js +33 -63
- package/out/components/top-menu/dropdown-menu/dropdown-menu.js +30 -40
- package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +1 -0
- package/out/components/top-menu/horizontal-menu/horizontal-menu.js +13 -17
- package/out/components/top-menu/index.css +11 -0
- package/out/components/top-menu/top-menu.js +19 -23
- package/out/components/youtube-player/youtube-player.js +24 -31
- package/package.json +6 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
|
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
|
-
})
|
|
35
|
+
}));
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
export { FormikInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
|
29
|
+
return React.createElement("div", {
|
|
30
30
|
className: className
|
|
31
|
-
}, {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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 {
|
|
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
|
|
19
|
+
return React.createElement("span", {
|
|
21
20
|
className: styles.privacyNotice
|
|
22
|
-
}, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
|
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
|
|
14
|
+
return React.createElement(Button, Object.assign({}, restProps, {
|
|
15
15
|
disabled: !isValid || disabled,
|
|
16
16
|
busy: isSubmitting || busy,
|
|
17
17
|
type: 'submit'
|
|
18
|
-
})
|
|
18
|
+
}));
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export { FormikSubmitButton };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
|
10
|
+
return React.createElement("div", {
|
|
11
11
|
className: styles.wrapper
|
|
12
|
-
}, {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
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 =>
|
|
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
|
|
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
|
|
12
|
+
return React__default.createElement("li", {
|
|
13
13
|
className: classNames(styles.navItem, {
|
|
14
14
|
[styles.navItemDarkTheme]: theme == 'dark'
|
|
15
15
|
})
|
|
16
|
-
}, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
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 =>
|
|
6
|
+
const NavList = props => React__default.createElement("nav", {
|
|
7
7
|
className: props.className
|
|
8
|
-
}, {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
|
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
|
|
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
|
|
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 = () =>
|
|
6
|
+
const SocialList = () => React__default.createElement("div", {
|
|
7
7
|
className: styles.socialList
|
|
8
|
-
}, {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 {
|
|
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
|
|
35
|
+
return React__default.createElement(ThemeProvider, {
|
|
37
36
|
theme: 'dark'
|
|
38
|
-
}, {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
46
|
+
return React__default.createElement("li", {
|
|
52
47
|
className: styles.menuItemWrap,
|
|
53
48
|
onMouseEnter: handleEnter,
|
|
54
49
|
onMouseLeave: onMouseLeave
|
|
55
|
-
}, {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
|
83
|
+
return React__default.createElement("nav", {
|
|
91
84
|
className: classNames(styles.nav, {
|
|
92
85
|
[styles.darkTheme]: theme === 'dark'
|
|
93
86
|
})
|
|
94
|
-
}, {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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 };
|