@gravity-ui/navigation 0.16.0 → 0.17.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.
package/README.md CHANGED
@@ -13,7 +13,7 @@ npm install @gravity-ui/navigation
13
13
  Ensure that peer dependencies are installed in your project
14
14
 
15
15
  ```bash
16
- npm install --dev @gravity-ui/uikit@^3.0.2 bem-cn-lite@4.0.0 react@^16.0.0
16
+ npm install --dev @gravity-ui/uikit@^3.0.2 @bem-react/classname@1.6.0 react@^16.0.0
17
17
  ```
18
18
 
19
19
  ## Components
@@ -30,3 +30,19 @@ npm install --dev @gravity-ui/uikit@^3.0.2 bem-cn-lite@4.0.0 react@^16.0.0
30
30
  ```ts
31
31
  import {AsideHeader} from '@gravity-ui/navigation';
32
32
  ```
33
+
34
+ ## CSS variables
35
+
36
+ Used for themization Navigation's components
37
+
38
+ ### AsideHeader vars
39
+
40
+ | Name | Description | Default |
41
+ | :----------------------------------------------------- | :--------------------------------------------------------------- | :--------------------------------------------------------------------- |
42
+ | `--gn-aside-header-background-color` | Сolor of decorations and selected items | `--g-color-base-warning-light` |
43
+ | `--gn-aside-header-subheader-divider-line-color` | Divider line color for withDecoration and expanded `AsideHeader` | `--g-color-base-warning-light` |
44
+ | `--gn-aside-header-collapse-button-divider-line-color` | | `--gn-aside-header-subheader-divider-line-color` |
45
+ | `--gn-aside-header-footer-item-icon-color` | | `--g-color-text-primary` |
46
+ | `--gn-aside-header-subheader-item-icon-color` | | `--g-color-text-primary` |
47
+ | `--gn-aside-header-item-icon-background-size` | Background size used when `AsideHeader` is compact | `38px` |
48
+ | `--gn-aside-header-divider-line-color` | Vertical color divider between `AsideHeader` and content | Light theme: `transparent`, Dark theme: `--g-color-line-generic-solid` |
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import './HighlightedItem.scss';
3
+ export type OpenModalSubscriber = (open: boolean) => void;
4
+ interface ItemInnerProps {
5
+ iconRef: React.RefObject<HTMLDivElement>;
6
+ iconNode: React.ReactNode;
7
+ onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
8
+ onClickCapture?: (event: React.SyntheticEvent) => void;
9
+ openModalSubscriber?: (subscriber: OpenModalSubscriber) => void;
10
+ }
11
+ export declare const HighlightedItem: React.FC<ItemInnerProps>;
12
+ export {};
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { PopupPlacement, PopupProps } from '@gravity-ui/uikit';
3
3
  import { MenuItem } from '../../types';
4
+ import { OpenModalSubscriber } from '../HighlightedItem/HighlightedItem';
4
5
  import './Item.scss';
5
6
  interface ItemPopup {
6
7
  popupVisible?: boolean;
@@ -10,12 +11,14 @@ interface ItemPopup {
10
11
  popupKeepMounted?: boolean;
11
12
  renderPopupContent?: () => React.ReactNode;
12
13
  onClosePopup?: () => void;
14
+ openModalSubscriber?: (subscriber: OpenModalSubscriber) => void;
13
15
  }
14
16
  export interface ItemProps extends ItemPopup {
15
17
  item: MenuItem;
16
18
  enableTooltip?: boolean;
17
19
  onItemClick?: (item: MenuItem, collapsed: boolean, event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
18
20
  onItemClickCapture?: (event: React.SyntheticEvent) => void;
21
+ bringForward?: boolean;
19
22
  }
20
23
  interface ItemInnerProps extends ItemProps {
21
24
  className?: string;
@@ -1,5 +1,4 @@
1
1
  import { PopupPlacement } from '@gravity-ui/uikit';
2
- export declare const ICON_SIZE = 24;
3
2
  export declare const ITEM_HEIGHT = 40;
4
3
  export declare const ITEM_TYPE_REGULAR = "regular";
5
4
  export declare const COLLAPSE_ITEM_ID = "collapse-item-id";
@@ -1,3 +1,3 @@
1
- export declare const ASIDE_HEADER_FOOTER_ICON_SIZE = 20;
1
+ export declare const ASIDE_HEADER_ICON_SIZE = 18;
2
2
  export declare const ASIDE_HEADER_COMPACT_WIDTH = 56;
3
3
  export declare const ASIDE_HEADER_EXPANDED_WIDTH = 236;
@@ -1,5 +1,5 @@
1
- import bemBlock from 'bem-cn-lite';
2
- export type CnBlock = ReturnType<typeof bemBlock>;
3
1
  export type CnMods = Record<string, string | boolean | undefined>;
4
2
  export declare const NAMESPACE = "gn-";
5
- export declare function block(name: string): CnBlock;
3
+ export declare const cn: import("@bem-react/classname").ClassNameInitilizer;
4
+ export declare const block: import("@bem-react/classname").ClassNameInitilizer;
5
+ export type CnBlock = ReturnType<typeof cn>;