@gravity-ui/navigation 0.1.0 → 0.2.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/CHANGELOG.md +23 -0
- package/build/cjs/{types/components → components}/ActionBar/ActionBar.d.ts +0 -0
- package/build/cjs/{types/components → components}/ActionBar/Group/ActionBarGroup.d.ts +0 -0
- package/build/cjs/{types/components → components}/ActionBar/Item/ActionBarItem.d.ts +0 -0
- package/build/cjs/{types/components → components}/ActionBar/Section/ActionBarSection.d.ts +0 -0
- package/build/cjs/{types/components → components}/ActionBar/Separator/ActionBarSeparator.d.ts +0 -0
- package/build/cjs/{types/components → components}/ActionBar/__stories__/ActionBar.stories.d.ts +0 -0
- package/build/cjs/{types/components → components}/ActionBar/__stories__/ActionBarShowcase.d.ts +0 -0
- package/build/cjs/{types/components → components}/ActionBar/index.d.ts +0 -0
- package/build/cjs/{types/components → components}/ActionBar/types.d.ts +0 -0
- package/build/{esm/types → cjs}/components/AsideHeader/AsideHeader.d.ts +2 -7
- package/build/cjs/{types/components → components}/AsideHeader/Content.d.ts +0 -0
- package/build/cjs/{types/components → components}/AsideHeader/__stories__/AsideHeader.stories.d.ts +0 -0
- package/build/cjs/{types/components → components}/AsideHeader/__stories__/AsideHeaderShowcase.d.ts +0 -0
- package/build/cjs/{types/components → components}/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts +0 -0
- package/build/cjs/{types/components → components}/AsideHeader/__stories__/moc.d.ts +0 -0
- package/build/cjs/{types/components → components}/CompositeBar/CompositeBar.d.ts +1 -1
- package/build/{esm/types → cjs}/components/CompositeBar/Item/Item.d.ts +1 -0
- package/build/cjs/{types/components → components}/CompositeBar/__stories__/CompositeBar.stories.d.ts +0 -0
- package/build/cjs/{types/components → components}/CompositeBar/__stories__/moc.d.ts +0 -0
- package/build/cjs/{types/components → components}/CompositeBar/constants.d.ts +0 -0
- package/build/cjs/{types/components → components}/CompositeBar/utils.d.ts +0 -0
- package/build/cjs/{types/components → components}/Drawer/Drawer.d.ts +0 -0
- package/build/cjs/{types/components → components}/Drawer/__stories__/Drawer.stories.d.ts +0 -0
- package/build/cjs/{types/components → components}/Drawer/__stories__/DrawerShowcase.d.ts +0 -0
- package/build/{esm/types → cjs}/components/FooterItem/FooterItem.d.ts +1 -1
- package/build/cjs/{types/components → components}/FooterItem/__stories__/FooterItem.stories.d.ts +0 -0
- package/build/cjs/{types/components → components}/ItemTooltip/ItemTooltip.d.ts +0 -0
- package/build/cjs/{types/components → components}/Logo/Logo.d.ts +0 -0
- package/build/cjs/components/Settings/Settings.d.ts +49 -0
- package/build/cjs/components/Settings/SettingsMenu/SettingsMenu.d.ts +27 -0
- package/build/cjs/components/Settings/SettingsSearch/SettingsSearch.d.ts +10 -0
- package/build/{esm/types/components/AsideHeader/__stories__/AsideHeader.stories.d.ts → cjs/components/Settings/__stories__/Settings.stories.d.ts} +0 -0
- package/build/cjs/components/Settings/__stories__/SettingsDemo.d.ts +13 -0
- package/build/cjs/components/Settings/collect-settings.d.ts +40 -0
- package/build/cjs/components/Settings/helpers.d.ts +6 -0
- package/build/cjs/components/Settings/index.d.ts +1 -0
- package/build/cjs/{types/components → components}/constants.d.ts +0 -0
- package/build/cjs/{types/components → components}/index.d.ts +1 -0
- package/build/cjs/{types/components → components}/types.d.ts +0 -0
- package/build/cjs/{types/components → components}/utils/cn.d.ts +0 -0
- package/build/cjs/{types/index.d.ts → index.d.ts} +0 -0
- package/build/cjs/index.js +1053 -141
- package/build/cjs/index.js.map +1 -1
- package/build/esm/{types/components → components}/ActionBar/ActionBar.d.ts +0 -0
- package/build/esm/{types/components → components}/ActionBar/Group/ActionBarGroup.d.ts +0 -0
- package/build/esm/{types/components → components}/ActionBar/Item/ActionBarItem.d.ts +0 -0
- package/build/esm/{types/components → components}/ActionBar/Section/ActionBarSection.d.ts +0 -0
- package/build/esm/{types/components → components}/ActionBar/Separator/ActionBarSeparator.d.ts +0 -0
- package/build/esm/{types/components → components}/ActionBar/__stories__/ActionBar.stories.d.ts +0 -0
- package/build/esm/{types/components → components}/ActionBar/__stories__/ActionBarShowcase.d.ts +0 -0
- package/build/esm/{types/components → components}/ActionBar/index.d.ts +0 -0
- package/build/esm/{types/components → components}/ActionBar/types.d.ts +0 -0
- package/build/{cjs/types → esm}/components/AsideHeader/AsideHeader.d.ts +2 -7
- package/build/esm/{types/components → components}/AsideHeader/Content.d.ts +0 -0
- package/build/esm/{types/components/Drawer/__stories__/Drawer.stories.d.ts → components/AsideHeader/__stories__/AsideHeader.stories.d.ts} +0 -0
- package/build/esm/{types/components → components}/AsideHeader/__stories__/AsideHeaderShowcase.d.ts +0 -0
- package/build/esm/{types/components → components}/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts +0 -0
- package/build/esm/{types/components → components}/AsideHeader/__stories__/moc.d.ts +0 -0
- package/build/esm/{types/components → components}/CompositeBar/CompositeBar.d.ts +1 -1
- package/build/{cjs/types → esm}/components/CompositeBar/Item/Item.d.ts +1 -0
- package/build/esm/{types/components → components}/CompositeBar/__stories__/CompositeBar.stories.d.ts +0 -0
- package/build/esm/{types/components → components}/CompositeBar/__stories__/moc.d.ts +0 -0
- package/build/esm/{types/components → components}/CompositeBar/constants.d.ts +0 -0
- package/build/esm/{types/components → components}/CompositeBar/utils.d.ts +0 -0
- package/build/esm/{types/components → components}/Drawer/Drawer.d.ts +0 -0
- package/build/esm/components/Drawer/__stories__/Drawer.stories.d.ts +4 -0
- package/build/esm/{types/components → components}/Drawer/__stories__/DrawerShowcase.d.ts +0 -0
- package/build/{cjs/types → esm}/components/FooterItem/FooterItem.d.ts +1 -1
- package/build/esm/{types/components → components}/FooterItem/__stories__/FooterItem.stories.d.ts +0 -0
- package/build/esm/{types/components → components}/ItemTooltip/ItemTooltip.d.ts +0 -0
- package/build/esm/{types/components → components}/Logo/Logo.d.ts +0 -0
- package/build/esm/components/Settings/Settings.d.ts +49 -0
- package/build/esm/components/Settings/SettingsMenu/SettingsMenu.d.ts +27 -0
- package/build/esm/components/Settings/SettingsSearch/SettingsSearch.d.ts +10 -0
- package/build/esm/components/Settings/__stories__/Settings.stories.d.ts +4 -0
- package/build/esm/components/Settings/__stories__/SettingsDemo.d.ts +13 -0
- package/build/esm/components/Settings/collect-settings.d.ts +40 -0
- package/build/esm/components/Settings/helpers.d.ts +6 -0
- package/build/esm/components/Settings/index.d.ts +1 -0
- package/build/esm/{types/components → components}/constants.d.ts +0 -0
- package/build/esm/{types/components → components}/index.d.ts +1 -0
- package/build/esm/{types/components → components}/types.d.ts +0 -0
- package/build/esm/{types/components → components}/utils/cn.d.ts +0 -0
- package/build/esm/{types/index.d.ts → index.d.ts} +0 -0
- package/build/esm/index.js +1054 -143
- package/build/esm/index.js.map +1 -1
- package/package.json +2 -2
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/build/esm/{types/components → components}/ActionBar/Separator/ActionBarSeparator.d.ts
RENAMED
|
File without changes
|
package/build/esm/{types/components → components}/ActionBar/__stories__/ActionBar.stories.d.ts
RENAMED
|
File without changes
|
package/build/esm/{types/components → components}/ActionBar/__stories__/ActionBarShowcase.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -27,14 +27,9 @@ interface AsideHeaderDefaultProps {
|
|
|
27
27
|
export interface AsideHeaderProps extends AsideHeaderGeneralProps, Partial<AsideHeaderDefaultProps> {
|
|
28
28
|
}
|
|
29
29
|
declare type AsideHeaderInnerProps = AsideHeaderGeneralProps & AsideHeaderDefaultProps;
|
|
30
|
-
|
|
31
|
-
compact: boolean;
|
|
32
|
-
}
|
|
33
|
-
export declare class AsideHeader extends React.Component<AsideHeaderInnerProps, AsideHeaderState> {
|
|
30
|
+
export declare class AsideHeader extends React.Component<AsideHeaderInnerProps> {
|
|
34
31
|
static defaultProps: AsideHeaderDefaultProps;
|
|
35
32
|
asideRef: React.RefObject<HTMLDivElement>;
|
|
36
|
-
constructor(props: AsideHeaderInnerProps);
|
|
37
|
-
componentDidUpdate(prevProps: AsideHeaderInnerProps): void;
|
|
38
33
|
render(): JSX.Element;
|
|
39
34
|
private renderFirstPane;
|
|
40
35
|
private renderSecondPane;
|
|
@@ -45,6 +40,6 @@ export declare class AsideHeader extends React.Component<AsideHeaderInnerProps,
|
|
|
45
40
|
private renderCollapseButton;
|
|
46
41
|
private onCollapseButtonClick;
|
|
47
42
|
private onCloseDrawer;
|
|
48
|
-
private
|
|
43
|
+
private onItemClick;
|
|
49
44
|
}
|
|
50
45
|
export {};
|
|
File without changes
|
|
File without changes
|
package/build/esm/{types/components → components}/AsideHeader/__stories__/AsideHeaderShowcase.d.ts
RENAMED
|
File without changes
|
package/build/esm/{types/components → components}/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -6,7 +6,7 @@ export interface CompositeBarProps {
|
|
|
6
6
|
compact: boolean;
|
|
7
7
|
enableCollapsing: boolean;
|
|
8
8
|
dict?: AsideHeaderDict;
|
|
9
|
-
onItemClick?: (item: MenuItem) => void;
|
|
9
|
+
onItemClick?: (item: MenuItem, collapsed: boolean) => void;
|
|
10
10
|
}
|
|
11
11
|
interface CompositeBarState {
|
|
12
12
|
activeItemIndex?: number;
|
package/build/esm/{types/components → components}/CompositeBar/__stories__/CompositeBar.stories.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ItemProps } from '../CompositeBar/Item/Item';
|
|
3
3
|
import './FooterItem.scss';
|
|
4
|
-
export interface FooterItemProps extends ItemProps {
|
|
4
|
+
export interface FooterItemProps extends Omit<ItemProps, 'onItemClick'> {
|
|
5
5
|
compact: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const FooterItem: React.FC<FooterItemProps>;
|
package/build/esm/{types/components → components}/FooterItem/__stories__/FooterItem.stories.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '@gravity-ui/uikit';
|
|
3
|
+
import './Settings.scss';
|
|
4
|
+
interface SettingsProps {
|
|
5
|
+
initialPage?: string;
|
|
6
|
+
onPageChange?: (page: string | undefined) => void;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
renderNotFound?: () => React.ReactNode;
|
|
9
|
+
renderLoading?: () => React.ReactNode;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
dict?: SettingsDict;
|
|
12
|
+
}
|
|
13
|
+
declare type SettingsDict = Record<SettingsDictKeys, string>;
|
|
14
|
+
declare type SettingsDictKeys = 'heading_settings' | 'placeholder_search' | 'not_found';
|
|
15
|
+
interface SettingsGroupProps {
|
|
16
|
+
id?: string;
|
|
17
|
+
groupTitle: string;
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
interface SettingsPageProps {
|
|
21
|
+
id?: string;
|
|
22
|
+
title: string;
|
|
23
|
+
icon: IconProps;
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
interface SettingsSectionProps {
|
|
27
|
+
title: string;
|
|
28
|
+
header?: React.ReactNode;
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
withBadge?: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface SettingsItemProps {
|
|
33
|
+
title: string;
|
|
34
|
+
renderTitleComponent?: (highlightedTitle: React.ReactNode | null) => React.ReactNode;
|
|
35
|
+
align?: 'top' | 'center';
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
withBadge?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare function Settings({ loading, renderLoading, children, ...props }: SettingsProps): JSX.Element;
|
|
40
|
+
export declare namespace Settings {
|
|
41
|
+
var defaultProps: {
|
|
42
|
+
dict: SettingsDict;
|
|
43
|
+
};
|
|
44
|
+
var Group: ({ children }: SettingsGroupProps) => JSX.Element;
|
|
45
|
+
var Page: ({ children }: SettingsPageProps) => JSX.Element;
|
|
46
|
+
var Section: ({ children }: SettingsSectionProps) => JSX.Element;
|
|
47
|
+
var Item: ({ title, children, align, withBadge, renderTitleComponent, }: SettingsItemProps) => JSX.Element;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '@gravity-ui/uikit';
|
|
3
|
+
import './SettingsMenu.scss';
|
|
4
|
+
interface GroupItem {
|
|
5
|
+
groupTitle: string;
|
|
6
|
+
items: Item[];
|
|
7
|
+
}
|
|
8
|
+
interface Item {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
icon?: IconProps;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
withBadge?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare type SettingsMenuItems = (GroupItem | Item)[];
|
|
16
|
+
interface SettingsMenuProps {
|
|
17
|
+
items: SettingsMenuItems;
|
|
18
|
+
onChange: (id: string) => void;
|
|
19
|
+
activeItem?: string;
|
|
20
|
+
focusItem?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SettingsMenuInstance {
|
|
23
|
+
handleKeyDown(event: React.KeyboardEvent): boolean;
|
|
24
|
+
clearFocus(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare const SettingsMenu: React.ForwardRefExoticComponent<SettingsMenuProps & React.RefAttributes<SettingsMenuInstance>>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface SettingsSearchProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
onChange: (search: string) => void;
|
|
5
|
+
debounce?: number;
|
|
6
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function SettingsSearch({ className, onChange, debounce, inputRef, placeholder, }: SettingsSearchProps): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './SettingsDemo.scss';
|
|
3
|
+
export interface DemoProps {
|
|
4
|
+
title: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DemoRowProps {
|
|
7
|
+
title: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const SettingsComponent: React.MemoExoticComponent<({ initialPage, withBadge }: {
|
|
10
|
+
initialPage?: string | undefined;
|
|
11
|
+
withBadge?: boolean | undefined;
|
|
12
|
+
}) => JSX.Element>;
|
|
13
|
+
export declare function SettingsDemo(): JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '@gravity-ui/uikit';
|
|
3
|
+
declare type SettingsMenu = (SettingsMenuGroup | SettingsMenuItem)[];
|
|
4
|
+
interface SettingsMenuGroup {
|
|
5
|
+
groupTitle: string;
|
|
6
|
+
items: SettingsMenuItem[];
|
|
7
|
+
}
|
|
8
|
+
interface SettingsMenuItem {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
icon?: IconProps;
|
|
12
|
+
withBadge?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface SettingsPage {
|
|
16
|
+
id: string;
|
|
17
|
+
sections: SettingsPageSection[];
|
|
18
|
+
hidden?: boolean;
|
|
19
|
+
withBadge?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface SettingsPageSection {
|
|
22
|
+
title: string;
|
|
23
|
+
header?: React.ReactNode;
|
|
24
|
+
items: SettingsItem[];
|
|
25
|
+
hidden?: boolean;
|
|
26
|
+
withBadge?: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface SettingsItem {
|
|
29
|
+
title: string;
|
|
30
|
+
element: React.ReactElement;
|
|
31
|
+
hidden: boolean;
|
|
32
|
+
titleComponent?: React.ReactNode;
|
|
33
|
+
renderTitleComponent?: (highlightedTitle: React.ReactNode | null) => React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
interface SettingsDescription {
|
|
36
|
+
menu: SettingsMenu;
|
|
37
|
+
pages: Record<string, SettingsPage>;
|
|
38
|
+
}
|
|
39
|
+
export declare function getSettingsFromChildren(children: React.ReactNode, searchText?: string): SettingsDescription;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare type AnyFunc = (...args: any[]) => any;
|
|
2
|
+
export declare function useStableCallback<T extends AnyFunc>(func: T): (...args: Parameters<T>) => ReturnType<T> | undefined;
|
|
3
|
+
export declare function useCurrent<T>(value: T): () => T;
|
|
4
|
+
export declare function invariant(cond: boolean, message: string): void;
|
|
5
|
+
export declare function escapeStringForRegExp(input: string): string;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Settings';
|
|
File without changes
|
|
@@ -2,4 +2,5 @@ export { ActionBar } from './ActionBar';
|
|
|
2
2
|
export { AsideHeader, AsideHeaderProps } from './AsideHeader/AsideHeader';
|
|
3
3
|
export { Drawer, DrawerProps, DrawerItemProps, DrawerItem } from './Drawer/Drawer';
|
|
4
4
|
export { FooterItem, FooterItemProps } from './FooterItem/FooterItem';
|
|
5
|
+
export * from './Settings';
|
|
5
6
|
export * from './types';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|