@jetbrains/kotlin-web-site-ui 4.7.1 → 4.8.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.
@@ -35,7 +35,8 @@ const Header = forwardRef(({
35
35
  isPlayground,
36
36
  isUrlActive,
37
37
  searchConfig,
38
- resultViewType = SearchResultView.Narrow
38
+ resultViewType = SearchResultView.Narrow,
39
+ darkHeader
39
40
  }, forwardedRef) => {
40
41
  const [menuPopupExpanded, setMenuPopupExpanded] = useState(false);
41
42
  const [isSearchBoxVisible, setSearchBoxVisible] = useState(false);
@@ -86,7 +87,8 @@ const Header = forwardRef(({
86
87
  ref: headerRef,
87
88
  className: classNames(styles.headerMenu, className, {
88
89
  [styles.withMenuPopup]: menuPopupExpanded,
89
- [styles.border]: hasBorder || menuPopupExpanded
90
+ [styles.border]: hasBorder || menuPopupExpanded,
91
+ [styles.darkHeader]: darkHeader
90
92
  }),
91
93
  "data-test": 'header'
92
94
  }, isMenuPopupVisible && currentTitle && currentUrl && !menuPopupExpanded ? React__default.createElement(LogoSmall, {
@@ -1,5 +1,6 @@
1
1
  var styles = {
2
2
  "headerMenu": "ktl-header-module_header-menu_wh71L",
3
- "border": "ktl-header-module_border_paN11"
3
+ "border": "ktl-header-module_border_paN11",
4
+ "darkHeader": "ktl-header-module_darkHeader_YLF76"
4
5
  };
5
6
  export { styles as default };
@@ -75,6 +75,11 @@
75
75
  box-shadow: inset 0 -1px rgba(255, 255, 255, 0.3);
76
76
  }
77
77
 
78
+ .ktl-header-module_darkHeader_YLF76 {
79
+ background: #19191C;
80
+ box-shadow: none;
81
+ }
82
+
78
83
  @media (max-width: 640px) {
79
84
  .ktl-header-module_header-menu_wh71L {
80
85
  padding: 0 0 0 16px;
@@ -0,0 +1,46 @@
1
+ .ktl-nav-item-module_navItem_gRy22 {
2
+ padding: 0 12px;
3
+ height: 52px;
4
+ cursor: pointer;
5
+ display: inline-flex;
6
+ align-items: center;
7
+ position: relative;
8
+ box-sizing: border-box;
9
+ border: 0;
10
+ background: none;
11
+ color: #ffffff;
12
+ }
13
+ .ktl-nav-item-module_navItem_gRy22:hover {
14
+ background: rgba(255, 255, 255, 0.10);
15
+ }
16
+
17
+ .ktl-nav-item-module_rightIcon_XlxMF {
18
+ flex-direction: row-reverse;
19
+ }
20
+
21
+ .ktl-nav-item-module_navItemActive_gI8Nv::after {
22
+ content: '';
23
+ width: 100%;
24
+ height: 2px;
25
+ background: #ffffff;
26
+ position: absolute;
27
+ bottom: 0;
28
+ left: 0;
29
+ }
30
+
31
+ .ktl-nav-item-module_title_9VXwr {
32
+ display: block;
33
+ }
34
+
35
+ .ktl-nav-item-module_titleWithIcon_CVqpS {
36
+ margin-left: 8px;
37
+ }
38
+
39
+ .ktl-nav-item-module_titleWithIconRight_FwEnm {
40
+ margin-left: 0;
41
+ margin-right: 8px;
42
+ }
43
+
44
+ .ktl-nav-item-module_titleWithoutIcon_XgnMl {
45
+ margin: 0;
46
+ }
@@ -0,0 +1,34 @@
1
+ import './index.css';
2
+ import React from 'react';
3
+ import cn from 'classnames';
4
+ import styles from './nav-item.module.pcss.js';
5
+ import { useTextStyles } from '@rescui/typography';
6
+
7
+ const NavItem = ({
8
+ children,
9
+ icon,
10
+ active,
11
+ iconPosition,
12
+ onClick
13
+ }) => {
14
+ const textCn = useTextStyles();
15
+ const navItemClass = cn(styles.navItem, {
16
+ [styles.navItemActive]: active,
17
+ [styles.rightIcon]: iconPosition === 'right'
18
+ });
19
+ const textStyles = cn(styles.title, {
20
+ [styles.titleWithIcon]: icon,
21
+ [styles.titleWithIconRight]: iconPosition === 'right',
22
+ [styles.titleWithoutIcon]: !children
23
+ });
24
+ return React.createElement("div", {
25
+ className: navItemClass,
26
+ onClick: onClick
27
+ }, icon ? icon : null, React.createElement("div", {
28
+ className: cn(textCn('rs-text-2', {
29
+ hardness: 'hard'
30
+ }), textStyles)
31
+ }, children));
32
+ };
33
+
34
+ export { NavItem, NavItem as default };
@@ -0,0 +1,10 @@
1
+ var styles = {
2
+ "navItem": "ktl-nav-item-module_navItem_gRy22",
3
+ "rightIcon": "ktl-nav-item-module_rightIcon_XlxMF",
4
+ "navItemActive": "ktl-nav-item-module_navItemActive_gI8Nv",
5
+ "title": "ktl-nav-item-module_title_9VXwr",
6
+ "titleWithIcon": "ktl-nav-item-module_titleWithIcon_CVqpS",
7
+ "titleWithIconRight": "ktl-nav-item-module_titleWithIconRight_FwEnm",
8
+ "titleWithoutIcon": "ktl-nav-item-module_titleWithoutIcon_XgnMl"
9
+ };
10
+ export { styles as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jetbrains/kotlin-web-site-ui",
3
3
  "description": "UI components for Kotlin web sites development",
4
- "version": "4.7.1",
4
+ "version": "4.8.0-alpha.0",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
7
7
  "files": [