@gravity-ui/navigation 0.6.0 → 0.7.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 (30) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/build/cjs/components/CompositeBar/Item/Item.d.ts +1 -0
  3. package/build/cjs/components/HotkeysPanel/HotkeysPanel.d.ts +18 -0
  4. package/build/cjs/components/HotkeysPanel/__stories__/HotkeysPanel.stories.d.ts +4 -0
  5. package/build/cjs/components/HotkeysPanel/__stories__/HotkeysPanelShowcase.d.ts +3 -0
  6. package/build/cjs/components/HotkeysPanel/__stories__/moc.d.ts +2 -0
  7. package/build/cjs/components/HotkeysPanel/index.d.ts +2 -0
  8. package/build/cjs/components/HotkeysPanel/types.d.ts +13 -0
  9. package/build/cjs/components/HotkeysPanel/utils/filterHotkeys.d.ts +2 -0
  10. package/build/cjs/components/HotkeysPanel/utils/flattenHotkeyGroups.d.ts +2 -0
  11. package/build/cjs/components/MobileHeader/BurgerMenu/BurgerMenu.d.ts +1 -1
  12. package/build/cjs/components/MobileHeader/FooterItem/FooterItem.d.ts +1 -1
  13. package/build/cjs/components/index.d.ts +1 -0
  14. package/build/cjs/index.js +140 -113
  15. package/build/cjs/index.js.map +1 -1
  16. package/build/esm/components/CompositeBar/Item/Item.d.ts +1 -0
  17. package/build/esm/components/HotkeysPanel/HotkeysPanel.d.ts +18 -0
  18. package/build/esm/components/HotkeysPanel/__stories__/HotkeysPanel.stories.d.ts +4 -0
  19. package/build/esm/components/HotkeysPanel/__stories__/HotkeysPanelShowcase.d.ts +3 -0
  20. package/build/esm/components/HotkeysPanel/__stories__/moc.d.ts +2 -0
  21. package/build/esm/components/HotkeysPanel/index.d.ts +2 -0
  22. package/build/esm/components/HotkeysPanel/types.d.ts +13 -0
  23. package/build/esm/components/HotkeysPanel/utils/filterHotkeys.d.ts +2 -0
  24. package/build/esm/components/HotkeysPanel/utils/flattenHotkeyGroups.d.ts +2 -0
  25. package/build/esm/components/MobileHeader/BurgerMenu/BurgerMenu.d.ts +1 -1
  26. package/build/esm/components/MobileHeader/FooterItem/FooterItem.d.ts +1 -1
  27. package/build/esm/components/index.d.ts +1 -0
  28. package/build/esm/index.js +142 -116
  29. package/build/esm/index.js.map +1 -1
  30. package/package.json +1 -1
@@ -7,6 +7,7 @@ interface ItemPopup {
7
7
  popupAnchor?: React.RefObject<HTMLElement>;
8
8
  popupPlacement?: PopupPlacement;
9
9
  popupOffset?: PopupProps['offset'];
10
+ popupKeepMounted?: boolean;
10
11
  renderPopupContent?: () => React.ReactNode;
11
12
  onClosePopup?: () => void;
12
13
  }
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ListProps } from '@gravity-ui/uikit';
3
+ import type { DrawerProps } from '../Drawer/Drawer';
4
+ import type { HotkeysListItem, HotkeysGroup } from './types';
5
+ import './HotkeysPanel.scss';
6
+ export declare type HotkeysPanelProps<T> = {
7
+ hotkeys: HotkeysGroup<T>[];
8
+ title?: ReactNode;
9
+ filterPlaceholder?: string;
10
+ emptyState?: ReactNode;
11
+ visible: boolean;
12
+ onClose?: () => void;
13
+ className?: string;
14
+ leftOffset?: number | string;
15
+ topOffset?: number | string;
16
+ preventScrollBody?: DrawerProps['preventScrollBody'];
17
+ } & Omit<ListProps<HotkeysListItem>, 'items' | 'emptyPlaceholder'>;
18
+ export declare function HotkeysPanel<T = {}>({ visible, onClose, leftOffset, topOffset, className, preventScrollBody, hotkeys, itemClassName, filterPlaceholder, title, emptyState, ...listProps }: HotkeysPanelProps<T>): JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { Meta, Story } from '@storybook/react/types-6-0';
2
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
3
+ export default _default;
4
+ export declare const Showcase: Story<import("@storybook/react/types-6-0").Args>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import './HotkeysPanelShowcase.scss';
3
+ export declare function HotkeysPanelShowcase(): JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { HotkeysGroup } from '..';
2
+ export declare const hotkeys: HotkeysGroup[];
@@ -0,0 +1,2 @@
1
+ export * from './HotkeysPanel';
2
+ export type { HotkeysGroup, HotkeysItem } from './types';
@@ -0,0 +1,13 @@
1
+ export declare type HotkeysItem = {
2
+ title: string;
3
+ value: string;
4
+ };
5
+ export declare type HotkeysGroup<T = {}> = {
6
+ title: string;
7
+ items: HotkeysItem[];
8
+ } & T;
9
+ export declare type HotkeysListItem = {
10
+ title: string;
11
+ group?: boolean;
12
+ value?: string;
13
+ };
@@ -0,0 +1,2 @@
1
+ import type { HotkeysGroup } from '..';
2
+ export declare function filterHotkeys<T>(hotkeys: HotkeysGroup<T>[], filter: string): HotkeysGroup<T>[];
@@ -0,0 +1,2 @@
1
+ import type { HotkeysGroup, HotkeysListItem } from '../types';
2
+ export declare function flattenHotkeyGroups<T>(hotkeys: HotkeysGroup<T>[]): HotkeysListItem[];
@@ -8,4 +8,4 @@ export interface BurgerMenuInnerProps {
8
8
  onItemClick?: (item: MobileMenuItem) => void;
9
9
  className?: string;
10
10
  }
11
- export declare const BurgerMenu: React.MemoExoticComponent<({ items, renderFooter, modalItem, className }: BurgerMenuInnerProps) => JSX.Element>;
11
+ export declare const BurgerMenu: React.MemoExoticComponent<({ items, renderFooter, modalItem, className, onItemClick }: BurgerMenuInnerProps) => JSX.Element>;
@@ -7,6 +7,6 @@ export interface FooterItemProps {
7
7
  iconSize?: string | number;
8
8
  className?: string;
9
9
  modalItem: ModalItem;
10
- onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
10
+ onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
11
11
  }
12
12
  export declare const FooterItem: ({ icon, iconSize, className, modalItem, onClick, }: FooterItemProps) => JSX.Element;
@@ -2,5 +2,6 @@ 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 './HotkeysPanel';
5
6
  export * from './Settings';
6
7
  export * from './types';