@gravity-ui/navigation 0.6.1 → 0.8.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 (40) 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/Settings/Settings.d.ts +1 -0
  13. package/build/cjs/components/Settings/__stories__/SettingsDemo.d.ts +2 -1
  14. package/build/cjs/components/Settings/__stories__/SettingsMobileDemo.d.ts +2 -2
  15. package/build/cjs/components/Settings/collect-settings.d.ts +1 -1
  16. package/build/cjs/components/Title/Title.d.ts +12 -0
  17. package/build/cjs/components/Title/index.d.ts +1 -0
  18. package/build/cjs/components/index.d.ts +2 -0
  19. package/build/cjs/index.js +185 -123
  20. package/build/cjs/index.js.map +1 -1
  21. package/build/esm/components/CompositeBar/Item/Item.d.ts +1 -0
  22. package/build/esm/components/HotkeysPanel/HotkeysPanel.d.ts +18 -0
  23. package/build/esm/components/HotkeysPanel/__stories__/HotkeysPanel.stories.d.ts +4 -0
  24. package/build/esm/components/HotkeysPanel/__stories__/HotkeysPanelShowcase.d.ts +3 -0
  25. package/build/esm/components/HotkeysPanel/__stories__/moc.d.ts +2 -0
  26. package/build/esm/components/HotkeysPanel/index.d.ts +2 -0
  27. package/build/esm/components/HotkeysPanel/types.d.ts +13 -0
  28. package/build/esm/components/HotkeysPanel/utils/filterHotkeys.d.ts +2 -0
  29. package/build/esm/components/HotkeysPanel/utils/flattenHotkeyGroups.d.ts +2 -0
  30. package/build/esm/components/MobileHeader/BurgerMenu/BurgerMenu.d.ts +1 -1
  31. package/build/esm/components/Settings/Settings.d.ts +1 -0
  32. package/build/esm/components/Settings/__stories__/SettingsDemo.d.ts +2 -1
  33. package/build/esm/components/Settings/__stories__/SettingsMobileDemo.d.ts +2 -2
  34. package/build/esm/components/Settings/collect-settings.d.ts +1 -1
  35. package/build/esm/components/Title/Title.d.ts +12 -0
  36. package/build/esm/components/Title/index.d.ts +1 -0
  37. package/build/esm/components/index.d.ts +2 -0
  38. package/build/esm/index.js +186 -126
  39. package/build/esm/index.js.map +1 -1
  40. package/package.json +3 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.0](https://github.com/gravity-ui/navigation/compare/v0.7.0...v0.8.0) (2023-06-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * **Title:** add component ([#58](https://github.com/gravity-ui/navigation/issues/58)) ([17cfa36](https://github.com/gravity-ui/navigation/commit/17cfa362c4394aa8e72c67f1e9abea92c5102fe8))
9
+
10
+ ## [0.7.0](https://github.com/gravity-ui/navigation/compare/v0.6.1...v0.7.0) (2023-06-08)
11
+
12
+
13
+ ### Features
14
+
15
+ * **CompositeBar/Item:** add popupKeepMounted prop ([#55](https://github.com/gravity-ui/navigation/issues/55)) ([88140e8](https://github.com/gravity-ui/navigation/commit/88140e8bcfa9c86aeb0c6d45770eb545fb23a589))
16
+ * **HotkeysPanel:** add component ([#53](https://github.com/gravity-ui/navigation/issues/53)) ([86c59bd](https://github.com/gravity-ui/navigation/commit/86c59bdb09bde48ba3588abfdb14e8219c9a902c))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **Logo:** disable hover animation on button ([#54](https://github.com/gravity-ui/navigation/issues/54)) ([99f2787](https://github.com/gravity-ui/navigation/commit/99f2787dfa39b04e160a0517e5555408f584971d))
22
+
3
23
  ## [0.6.1](https://github.com/gravity-ui/navigation/compare/v0.6.0...v0.6.1) (2023-06-07)
4
24
 
5
25
 
@@ -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>;
@@ -10,6 +10,7 @@ interface SettingsProps {
10
10
  loading?: boolean;
11
11
  dict?: SettingsDict;
12
12
  view?: 'normal' | 'mobile';
13
+ onClose?: () => void;
13
14
  }
14
15
  declare type SettingsDict = Record<SettingsDictKeys, string>;
15
16
  declare type SettingsDictKeys = 'heading_settings' | 'placeholder_search' | 'not_found';
@@ -6,8 +6,9 @@ export interface DemoProps {
6
6
  export interface DemoRowProps {
7
7
  title: string;
8
8
  }
9
- export declare const SettingsComponent: React.MemoExoticComponent<({ initialPage, withBadge }: {
9
+ export declare const SettingsComponent: React.MemoExoticComponent<({ initialPage, withBadge, onClose, }: {
10
10
  initialPage?: string | undefined;
11
11
  withBadge?: boolean | undefined;
12
+ onClose: () => void;
12
13
  }) => JSX.Element>;
13
14
  export declare function SettingsDemo(): JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import './SettingsMobileDemo.scss';
3
- export declare const SettingsMobileComponent: React.MemoExoticComponent<({ initialPage, withBadge, closeSettings, }: {
3
+ export declare const SettingsMobileComponent: React.MemoExoticComponent<({ initialPage, withBadge, onClose, }: {
4
4
  initialPage?: string | undefined;
5
5
  withBadge?: boolean | undefined;
6
- closeSettings?: (() => void) | undefined;
6
+ onClose?: (() => void) | undefined;
7
7
  }) => JSX.Element>;
8
8
  export declare function SettingsMobileDemo(): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { IconProps } from '@gravity-ui/uikit';
3
- declare type SettingsMenu = (SettingsMenuGroup | SettingsMenuItem)[];
3
+ export declare type SettingsMenu = (SettingsMenuGroup | SettingsMenuItem)[];
4
4
  interface SettingsMenuGroup {
5
5
  groupTitle: string;
6
6
  items: SettingsMenuItem[];
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import './Title.scss';
3
+ declare type TitleDictKeys = 'close';
4
+ declare type TitleDict = Record<TitleDictKeys, string>;
5
+ interface TitleProps {
6
+ hasSeparator?: boolean;
7
+ dict?: TitleDict;
8
+ closeIconSize?: number;
9
+ onClose?: () => void;
10
+ }
11
+ export declare const Title: React.FC<React.PropsWithChildren<TitleProps>>;
12
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Title';
@@ -2,5 +2,7 @@ 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 './Title';
6
+ export * from './HotkeysPanel';
5
7
  export * from './Settings';
6
8
  export * from './types';