@gravity-ui/navigation 0.0.6 → 0.1.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/build/cjs/index.js +3344 -63660
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/types/components/ActionBar/ActionBar.d.ts +28 -0
  5. package/build/cjs/types/components/ActionBar/Group/ActionBarGroup.d.ts +10 -0
  6. package/build/cjs/types/components/ActionBar/Item/ActionBarItem.d.ts +11 -0
  7. package/build/cjs/types/components/ActionBar/Section/ActionBarSection.d.ts +9 -0
  8. package/build/cjs/types/components/ActionBar/Separator/ActionBarSeparator.d.ts +5 -0
  9. package/build/cjs/types/components/ActionBar/__stories__/ActionBar.stories.d.ts +44 -0
  10. package/build/cjs/types/components/ActionBar/__stories__/ActionBarShowcase.d.ts +2 -0
  11. package/build/cjs/types/components/ActionBar/index.d.ts +5 -0
  12. package/build/cjs/types/components/ActionBar/types.d.ts +3 -0
  13. package/build/cjs/types/components/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts +3 -0
  14. package/build/cjs/types/components/CompositeBar/CompositeBar.d.ts +2 -1
  15. package/build/cjs/types/components/CompositeBar/utils.d.ts +4 -2
  16. package/build/cjs/types/components/index.d.ts +1 -0
  17. package/build/cjs/types/components/types.d.ts +1 -1
  18. package/build/esm/index.js +3320 -63660
  19. package/build/esm/index.js.map +1 -1
  20. package/build/esm/types/components/ActionBar/ActionBar.d.ts +28 -0
  21. package/build/esm/types/components/ActionBar/Group/ActionBarGroup.d.ts +10 -0
  22. package/build/esm/types/components/ActionBar/Item/ActionBarItem.d.ts +11 -0
  23. package/build/esm/types/components/ActionBar/Section/ActionBarSection.d.ts +9 -0
  24. package/build/esm/types/components/ActionBar/Separator/ActionBarSeparator.d.ts +5 -0
  25. package/build/esm/types/components/ActionBar/__stories__/ActionBar.stories.d.ts +44 -0
  26. package/build/esm/types/components/ActionBar/__stories__/ActionBarShowcase.d.ts +2 -0
  27. package/build/esm/types/components/ActionBar/index.d.ts +5 -0
  28. package/build/esm/types/components/ActionBar/types.d.ts +3 -0
  29. package/build/esm/types/components/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts +3 -0
  30. package/build/esm/types/components/CompositeBar/CompositeBar.d.ts +2 -1
  31. package/build/esm/types/components/CompositeBar/utils.d.ts +4 -2
  32. package/build/esm/types/components/index.d.ts +1 -0
  33. package/build/esm/types/components/types.d.ts +1 -1
  34. package/package.json +5 -4
  35. package/build/esm/index.css +0 -5288
@@ -0,0 +1,28 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import './ActionBar.scss';
3
+ export declare type Props = PropsWithChildren<{
4
+ 'aria-label'?: string;
5
+ className?: string;
6
+ }>;
7
+ declare const PublicActionBar: {
8
+ ({ children, className, "aria-label": ariaLabel }: Props): JSX.Element;
9
+ displayName: string;
10
+ } & {
11
+ Section: {
12
+ ({ children, type }: import("./Section/ActionBarSection").Props): JSX.Element;
13
+ displayName: string;
14
+ };
15
+ Group: {
16
+ ({ children, className, pull }: import("./Group/ActionBarGroup").Props): JSX.Element;
17
+ displayName: string;
18
+ };
19
+ Item: {
20
+ ({ children, className, pull, spacing }: import("./Item/ActionBarItem").Props): JSX.Element;
21
+ displayName: string;
22
+ };
23
+ Separator: {
24
+ (): JSX.Element;
25
+ displayName: string;
26
+ };
27
+ };
28
+ export { PublicActionBar as ActionBar };
@@ -0,0 +1,10 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { PropsWithPull } from '../types';
3
+ import './ActionBarGroup.scss';
4
+ export declare type Props = PropsWithChildren<PropsWithPull<{
5
+ className?: string;
6
+ }>>;
7
+ export declare const ActionBarGroup: {
8
+ ({ children, className, pull }: Props): JSX.Element;
9
+ displayName: string;
10
+ };
@@ -0,0 +1,11 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { PropsWithPull } from '../types';
3
+ import './ActionBarItem.scss';
4
+ export declare type Props = PropsWithChildren<PropsWithPull<{
5
+ spacing?: boolean;
6
+ className?: string;
7
+ }>>;
8
+ export declare const ActionBarItem: {
9
+ ({ children, className, pull, spacing }: Props): JSX.Element;
10
+ displayName: string;
11
+ };
@@ -0,0 +1,9 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import './ActionBarSection.scss';
3
+ export declare type Props = PropsWithChildren<{
4
+ type?: 'primary' | 'secondary';
5
+ }>;
6
+ export declare const ActionBarSection: {
7
+ ({ children, type }: Props): JSX.Element;
8
+ displayName: string;
9
+ };
@@ -0,0 +1,5 @@
1
+ import './ActionBarSeparator.scss';
2
+ export declare const ActionBarSeparator: {
3
+ (): JSX.Element;
4
+ displayName: string;
5
+ };
@@ -0,0 +1,44 @@
1
+ import { ComponentMeta, ComponentStory } from '@storybook/react';
2
+ declare const _default: ComponentMeta<{
3
+ ({ children, className, "aria-label": ariaLabel }: import("../ActionBar").Props): JSX.Element;
4
+ displayName: string;
5
+ } & {
6
+ Section: {
7
+ ({ children, type }: import("..").ActionBarSectionProps): JSX.Element;
8
+ displayName: string;
9
+ };
10
+ Group: {
11
+ ({ children, className, pull }: import("..").ActionBarGroupProps): JSX.Element;
12
+ displayName: string;
13
+ };
14
+ Item: {
15
+ ({ children, className, pull, spacing }: import("..").ActionBarItemProps): JSX.Element;
16
+ displayName: string;
17
+ };
18
+ Separator: {
19
+ (): JSX.Element;
20
+ displayName: string;
21
+ };
22
+ }>;
23
+ export default _default;
24
+ export declare const Showcase: ComponentStory<{
25
+ ({ children, className, "aria-label": ariaLabel }: import("../ActionBar").Props): JSX.Element;
26
+ displayName: string;
27
+ } & {
28
+ Section: {
29
+ ({ children, type }: import("..").ActionBarSectionProps): JSX.Element;
30
+ displayName: string;
31
+ };
32
+ Group: {
33
+ ({ children, className, pull }: import("..").ActionBarGroupProps): JSX.Element;
34
+ displayName: string;
35
+ };
36
+ Item: {
37
+ ({ children, className, pull, spacing }: import("..").ActionBarItemProps): JSX.Element;
38
+ displayName: string;
39
+ };
40
+ Separator: {
41
+ (): JSX.Element;
42
+ displayName: string;
43
+ };
44
+ }>;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function ActionBarShowcase(): JSX.Element;
@@ -0,0 +1,5 @@
1
+ export { ActionBar } from './ActionBar';
2
+ export type { Props as ActionBarProps } from './ActionBar';
3
+ export type { Props as ActionBarGroupProps } from './Group/ActionBarGroup';
4
+ export type { Props as ActionBarItemProps } from './Item/ActionBarItem';
5
+ export type { Props as ActionBarSectionProps } from './Section/ActionBarSection';
@@ -0,0 +1,3 @@
1
+ export declare type PropsWithPull<T> = T & {
2
+ pull?: 'left' | 'right' | 'center';
3
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { AsideHeaderProps } from '../AsideHeader';
3
+ export declare function getAsideHeaderWrapper(props?: AsideHeaderProps): (Story: FC) => JSX.Element;
@@ -14,9 +14,10 @@ interface CompositeBarState {
14
14
  export declare class CompositeBar extends React.Component<CompositeBarProps> {
15
15
  state: CompositeBarState;
16
16
  private listRef;
17
- render(): JSX.Element;
17
+ render(): JSX.Element | null;
18
18
  private renderAutosizeMenu;
19
19
  private renderMenu;
20
20
  private getMoreButtonItem;
21
+ private getAutosizeListItems;
21
22
  }
22
23
  export {};
@@ -1,4 +1,6 @@
1
1
  import { MenuItem } from './../types';
2
- export declare function getItemHeight(item: MenuItem): 40 | 50;
2
+ export declare function getItemHeight(item: MenuItem): 15 | 40 | 50;
3
3
  export declare function getItemsHeight(items: MenuItem[]): number;
4
- export declare const getSelectedItemIndex: (items: MenuItem[]) => number | undefined;
4
+ export declare function getSelectedItemIndex(items: MenuItem[]): number | undefined;
5
+ export declare function getPinnedItems(items: MenuItem[]): MenuItem[];
6
+ export declare function getItemsMinHeight(items: MenuItem[]): number;
@@ -1,3 +1,4 @@
1
+ export { ActionBar } from './ActionBar';
1
2
  export { AsideHeader, AsideHeaderProps } from './AsideHeader/AsideHeader';
2
3
  export { Drawer, DrawerProps, DrawerItemProps, DrawerItem } from './Drawer/Drawer';
3
4
  export { FooterItem, FooterItemProps } from './FooterItem/FooterItem';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { IconProps } from '@gravity-ui/uikit';
3
- export declare type MenuItemType = 'regular' | 'action';
3
+ export declare type MenuItemType = 'regular' | 'action' | 'divider';
4
4
  export interface MenuItem {
5
5
  id: string;
6
6
  title: React.ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/navigation",
3
- "version": "0.0.6",
3
+ "version": "0.1.0",
4
4
  "description": "Gravity UI Navigation components",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -72,7 +72,8 @@
72
72
  "rimraf": "^3.0.2",
73
73
  "rollup": "^2.75.7",
74
74
  "rollup-plugin-json": "^4.0.0",
75
- "rollup-plugin-scss": "^3.0.0",
75
+ "rollup-plugin-peer-deps-external": "^2.2.4",
76
+ "rollup-plugin-postcss": "^4.0.2",
76
77
  "sass": "^1.49.7",
77
78
  "sass-loader": "^10.2.1",
78
79
  "storybook-preset-inline-svg": "^1.0.1",
@@ -83,8 +84,8 @@
83
84
  },
84
85
  "peerDependencies": {
85
86
  "@gravity-ui/uikit": "^3.0.2",
86
- "bem-cn-lite": "^4.0.0",
87
- "react": "^16.0.0"
87
+ "react": "^16.0.0 || ^17.0.0",
88
+ "react-dom": "^16.0.0 || ^17.0.0"
88
89
  },
89
90
  "nano-staged": {
90
91
  "*.{scss}": [