@gravity-ui/navigation 0.0.7 → 0.2.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/CHANGELOG.md +24 -0
- package/build/cjs/components/ActionBar/ActionBar.d.ts +28 -0
- package/build/cjs/components/ActionBar/Group/ActionBarGroup.d.ts +10 -0
- package/build/cjs/components/ActionBar/Item/ActionBarItem.d.ts +11 -0
- package/build/cjs/components/ActionBar/Section/ActionBarSection.d.ts +9 -0
- package/build/cjs/components/ActionBar/Separator/ActionBarSeparator.d.ts +5 -0
- package/build/cjs/components/ActionBar/__stories__/ActionBar.stories.d.ts +44 -0
- package/build/cjs/components/ActionBar/__stories__/ActionBarShowcase.d.ts +2 -0
- package/build/cjs/components/ActionBar/index.d.ts +5 -0
- package/build/cjs/components/ActionBar/types.d.ts +3 -0
- package/build/cjs/{types/components → 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/components/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts +3 -0
- package/build/cjs/{types/components → components}/AsideHeader/__stories__/moc.d.ts +0 -0
- package/build/cjs/{types/components → components}/CompositeBar/CompositeBar.d.ts +3 -2
- 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/components/CompositeBar/utils.d.ts +6 -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/cjs/{types/components → 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 +2 -0
- package/build/cjs/{types/components → components}/types.d.ts +1 -1
- 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 +1187 -191
- package/build/cjs/index.js.map +1 -1
- package/build/esm/components/ActionBar/ActionBar.d.ts +28 -0
- package/build/esm/components/ActionBar/Group/ActionBarGroup.d.ts +10 -0
- package/build/esm/components/ActionBar/Item/ActionBarItem.d.ts +11 -0
- package/build/esm/components/ActionBar/Section/ActionBarSection.d.ts +9 -0
- package/build/esm/components/ActionBar/Separator/ActionBarSeparator.d.ts +5 -0
- package/build/esm/components/ActionBar/__stories__/ActionBar.stories.d.ts +44 -0
- package/build/esm/components/ActionBar/__stories__/ActionBarShowcase.d.ts +2 -0
- package/build/esm/components/ActionBar/index.d.ts +5 -0
- package/build/esm/components/ActionBar/types.d.ts +3 -0
- package/build/esm/{types/components → 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/components/AsideHeader/__stories__/getAsideHeaderWrapper.d.ts +3 -0
- package/build/esm/{types/components → components}/AsideHeader/__stories__/moc.d.ts +0 -0
- package/build/esm/{types/components → components}/CompositeBar/CompositeBar.d.ts +3 -2
- 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/components/CompositeBar/utils.d.ts +6 -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/esm/{types/components → 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 +2 -0
- package/build/esm/{types/components → components}/types.d.ts +1 -1
- 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 +1187 -193
- package/build/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/build/cjs/types/components/CompositeBar/utils.d.ts +0 -4
- package/build/esm/types/components/CompositeBar/utils.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.0](https://github.com/gravity-ui/navigation/compare/v0.1.0...v0.2.0) (2022-10-31)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add Settings component ([b7ad550](https://github.com/gravity-ui/navigation/commit/b7ad550825d5cc0ac416b57d0c35f6ccd459793d))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* component AsideHeader should be stateless ([e2cbd15](https://github.com/gravity-ui/navigation/commit/e2cbd15921d051aada9246f27f34c60ca8169ec9))
|
|
14
|
+
* onClosePanel should be called before onItemClick ([8d0acb5](https://github.com/gravity-ui/navigation/commit/8d0acb5603129817aea929f881f85a264b074fe7))
|
|
15
|
+
* package-lock.json ([#26](https://github.com/gravity-ui/navigation/issues/26)) ([14f012e](https://github.com/gravity-ui/navigation/commit/14f012eeda4f97bbd0e4e48e7b83bf195cb3c0ab))
|
|
16
|
+
* set z-index for .ycn-aside-header__content ([b793bc6](https://github.com/gravity-ui/navigation/commit/b793bc63ca760f608a4f5f2961af1947b0972fc2))
|
|
17
|
+
* sticky-element should not be restrict by an extra parent element ([5ecfac3](https://github.com/gravity-ui/navigation/commit/5ecfac3da2b390255485aef63718b6a2c4c4a8c0))
|
|
18
|
+
|
|
19
|
+
## [0.1.0](https://github.com/gravity-ui/navigation/compare/v0.0.7...v0.1.0) (2022-10-17)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* add ActionBar component ([#19](https://github.com/gravity-ui/navigation/issues/19)) ([595d418](https://github.com/gravity-ui/navigation/commit/595d4189f005615e4ba504cef4689d48fb6a798a))
|
|
25
|
+
* **CompositeBar:** divider item type ([#11](https://github.com/gravity-ui/navigation/issues/11)) ([89f3b85](https://github.com/gravity-ui/navigation/commit/89f3b854ac9348837352809101502a876def8940))
|
|
26
|
+
|
|
3
27
|
## [0.0.7](https://github.com/gravity-ui/navigation/compare/v0.0.6...v0.0.7) (2022-10-11)
|
|
4
28
|
|
|
5
29
|
|
|
@@ -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,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,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';
|
|
@@ -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
|
package/build/cjs/{types/components → components}/AsideHeader/__stories__/AsideHeader.stories.d.ts
RENAMED
|
File without changes
|
package/build/cjs/{types/components → components}/AsideHeader/__stories__/AsideHeaderShowcase.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;
|
|
@@ -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 {};
|
package/build/cjs/{types/components → components}/CompositeBar/__stories__/CompositeBar.stories.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MenuItem } from './../types';
|
|
2
|
+
export declare function getItemHeight(item: MenuItem): 15 | 40 | 50;
|
|
3
|
+
export declare function getItemsHeight(items: MenuItem[]): number;
|
|
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;
|
|
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/cjs/{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 {};
|
|
File without changes
|
|
@@ -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
|
|
@@ -1,4 +1,6 @@
|
|
|
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';
|
|
5
|
+
export * from './Settings';
|
|
4
6
|
export * from './types';
|
|
@@ -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;
|
|
File without changes
|
|
File without changes
|