@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 +17 -1
- package/build/cjs/components/CompositeBar/HighlightedItem/HighlightedItem.d.ts +12 -0
- package/build/cjs/components/CompositeBar/Item/Item.d.ts +3 -0
- package/build/cjs/components/CompositeBar/constants.d.ts +0 -1
- package/build/cjs/components/constants.d.ts +1 -1
- package/build/cjs/components/utils/cn.d.ts +3 -3
- package/build/cjs/index.js +1328 -1315
- package/build/cjs/index.js.map +1 -1
- package/build/esm/components/CompositeBar/HighlightedItem/HighlightedItem.d.ts +12 -0
- package/build/esm/components/CompositeBar/Item/Item.d.ts +3 -0
- package/build/esm/components/CompositeBar/constants.d.ts +0 -1
- package/build/esm/components/constants.d.ts +1 -1
- package/build/esm/components/utils/cn.d.ts +3 -3
- package/build/esm/index.js +1313 -1300
- package/build/esm/index.js.map +1 -1
- package/package.json +3 -1
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-
|
|
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,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
|
|
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>;
|