@gravity-ui/navigation 3.4.1 → 3.6.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 (25) hide show
  1. package/build/cjs/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +1 -0
  2. package/build/cjs/components/AsideHeader/__stories__/moc.d.ts +7 -0
  3. package/build/cjs/components/AsideHeader/components/CollapseButton/CollapseButton.d.ts +1 -1
  4. package/build/cjs/components/AsideHeader/types.d.ts +4 -0
  5. package/build/cjs/components/HotkeysPanel/HotkeysPanel.d.ts +2 -1
  6. package/build/cjs/components/HotkeysPanel/types.d.ts +2 -0
  7. package/build/cjs/{index-CLs1L-sq.js → index-Cycm1qkC.js} +20 -12
  8. package/build/cjs/index-Cycm1qkC.js.map +1 -0
  9. package/build/cjs/{index-ClUpN5oD.js → index-DQNATx6t.js} +2 -2
  10. package/build/cjs/{index-ClUpN5oD.js.map → index-DQNATx6t.js.map} +1 -1
  11. package/build/cjs/index.js +1 -1
  12. package/build/esm/components/AsideHeader/__stories__/AsideHeader.stories.d.ts +1 -0
  13. package/build/esm/components/AsideHeader/__stories__/moc.d.ts +7 -0
  14. package/build/esm/components/AsideHeader/components/CollapseButton/CollapseButton.d.ts +1 -1
  15. package/build/esm/components/AsideHeader/types.d.ts +4 -0
  16. package/build/esm/components/HotkeysPanel/HotkeysPanel.d.ts +2 -1
  17. package/build/esm/components/HotkeysPanel/types.d.ts +2 -0
  18. package/build/esm/{index-CoM0LT-x.js → index-BR3lwtrQ.js} +21 -13
  19. package/build/esm/index-BR3lwtrQ.js.map +1 -0
  20. package/build/esm/{index-AHJjBN3a.js → index-DM3j7oy5.js} +2 -2
  21. package/build/esm/{index-AHJjBN3a.js.map → index-DM3j7oy5.js.map} +1 -1
  22. package/build/esm/index.js +1 -1
  23. package/package.json +1 -1
  24. package/build/cjs/index-CLs1L-sq.js.map +0 -1
  25. package/build/esm/index-CoM0LT-x.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  var React = require('react');
4
4
  var uikit = require('@gravity-ui/uikit');
5
- var index = require('./index-CLs1L-sq.js');
5
+ var index = require('./index-Cycm1qkC.js');
6
6
  require('@bem-react/classname');
7
7
  require('@gravity-ui/icons');
8
8
  require('@gravity-ui/uikit/i18n');
@@ -67,4 +67,4 @@ const TopAlert = ({ alert, className, mobileView = false }) => {
67
67
  };
68
68
 
69
69
  exports.TopAlert = TopAlert;
70
- //# sourceMappingURL=index-ClUpN5oD.js.map
70
+ //# sourceMappingURL=index-DQNATx6t.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-ClUpN5oD.js","sources":["../../../src/components/TopAlert/useTopAlertHeight.ts","../../../src/components/TopAlert/TopAlert.tsx"],"sourcesContent":["import React from 'react';\n\nimport debounceFn from 'lodash/debounce';\n\nimport {TopAlertProps} from '../types';\n\ntype TopAlertHeightControls = {\n alertRef: React.RefObject<HTMLDivElement>;\n updateTopSize: () => void;\n};\n\nconst G_ROOT_CLASS_NAME = 'g-root';\n\nexport const useTopAlertHeight = ({alert}: {alert?: TopAlertProps}): TopAlertHeightControls => {\n const alertRef = React.useRef<HTMLDivElement>(null);\n\n const setAsideTopPanelHeight = React.useCallback((clientHeight: number) => {\n const gRootElement = document\n .getElementsByClassName(G_ROOT_CLASS_NAME)\n .item(0) as HTMLElement | null;\n gRootElement?.style.setProperty('--gn-top-alert-height', clientHeight + 'px');\n }, []);\n\n const updateTopSize = React.useCallback(() => {\n setAsideTopPanelHeight(alertRef.current?.clientHeight || 0);\n }, [setAsideTopPanelHeight]);\n\n React.useLayoutEffect(() => {\n const updateTopSizeDebounce = debounceFn(updateTopSize, 200, {leading: true});\n\n if (alert) {\n window.addEventListener('resize', updateTopSizeDebounce);\n updateTopSizeDebounce();\n }\n return () => {\n window.removeEventListener('resize', updateTopSizeDebounce);\n setAsideTopPanelHeight(0);\n };\n }, [alert, alertRef, updateTopSize, setAsideTopPanelHeight]);\n\n return {\n alertRef,\n updateTopSize,\n };\n};\n","import React from 'react';\n\nimport {Alert, Text} from '@gravity-ui/uikit';\n\nimport {TopAlertProps} from '../types';\nimport {block} from '../utils/cn';\n\nimport {useTopAlertHeight} from './useTopAlertHeight';\n\nimport './TopAlert.scss';\n\nconst b = block('top-alert');\n\ntype Props = {\n alert?: TopAlertProps;\n className?: string;\n mobileView?: boolean;\n};\n\nexport const TopAlert = ({alert, className, mobileView = false}: Props) => {\n const {alertRef, updateTopSize} = useTopAlertHeight({alert});\n\n const [opened, setOpened] = React.useState(true);\n\n const handleClose = React.useCallback(() => {\n setOpened(false);\n alert?.onCloseTopAlert?.();\n }, [alert]);\n\n React.useEffect(() => {\n if (!opened) {\n updateTopSize();\n }\n }, [opened, updateTopSize]);\n\n if (!alert || !alert.message) {\n return null;\n }\n\n return (\n <div\n ref={alertRef}\n className={b('wrapper', {'with-bottom-border': !mobileView && opened}, className)}\n >\n {opened && (\n <Alert\n className={b('', {\n centered: alert.centered,\n dense: alert.dense,\n })}\n corners=\"square\"\n layout=\"horizontal\"\n align={alert.align}\n theme={alert.theme || 'warning'}\n view={alert.view}\n icon={alert.icon}\n title={alert.title}\n message={\n mobileView ? (\n <Text ellipsisLines={5} variant=\"body-2\">\n {alert.message}\n </Text>\n ) : (\n alert.message\n )\n }\n actions={alert.actions}\n onClose={alert.closable ? handleClose : undefined}\n />\n )}\n </div>\n );\n};\n"],"names":["debounceFn","block","Alert","Text"],"mappings":";;;;;;;;;;;;AAWA,MAAM,iBAAiB,GAAG,QAAQ;AAE3B,MAAM,iBAAiB,GAAG,CAAC,EAAC,KAAK,EAA0B,KAA4B;IAC1F,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC;IAEnD,MAAM,sBAAsB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,YAAoB,KAAI;QACtE,MAAM,YAAY,GAAG;aAChB,sBAAsB,CAAC,iBAAiB;aACxC,IAAI,CAAC,CAAC,CAAuB;AAClC,QAAA,YAAY,K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EACnC,EAAA,KAAK,CAAC,OAAO,CACX,KAEP,KAAK,CAAC,OAAO,CAChB,EAEL,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,CAAC,QAAQ,GAAG,WAAW,GAAG,SAAS,EACnD,CAAA,CACL,CACC;AAEd;;;;"}
1
+ {"version":3,"file":"index-DQNATx6t.js","sources":["../../../src/components/TopAlert/useTopAlertHeight.ts","../../../src/components/TopAlert/TopAlert.tsx"],"sourcesContent":["import React from 'react';\n\nimport debounceFn from 'lodash/debounce';\n\nimport {TopAlertProps} from '../types';\n\ntype TopAlertHeightControls = {\n alertRef: React.RefObject<HTMLDivElement>;\n updateTopSize: () => void;\n};\n\nconst G_ROOT_CLASS_NAME = 'g-root';\n\nexport const useTopAlertHeight = ({alert}: {alert?: TopAlertProps}): TopAlertHeightControls => {\n const alertRef = React.useRef<HTMLDivElement>(null);\n\n const setAsideTopPanelHeight = React.useCallback((clientHeight: number) => {\n const gRootElement = document\n .getElementsByClassName(G_ROOT_CLASS_NAME)\n .item(0) as HTMLElement | null;\n gRootElement?.style.setProperty('--gn-top-alert-height', clientHeight + 'px');\n }, []);\n\n const updateTopSize = React.useCallback(() => {\n setAsideTopPanelHeight(alertRef.current?.clientHeight || 0);\n }, [setAsideTopPanelHeight]);\n\n React.useLayoutEffect(() => {\n const updateTopSizeDebounce = debounceFn(updateTopSize, 200, {leading: true});\n\n if (alert) {\n window.addEventListener('resize', updateTopSizeDebounce);\n updateTopSizeDebounce();\n }\n return () => {\n window.removeEventListener('resize', updateTopSizeDebounce);\n setAsideTopPanelHeight(0);\n };\n }, [alert, alertRef, updateTopSize, setAsideTopPanelHeight]);\n\n return {\n alertRef,\n updateTopSize,\n };\n};\n","import React from 'react';\n\nimport {Alert, Text} from '@gravity-ui/uikit';\n\nimport {TopAlertProps} from '../types';\nimport {block} from '../utils/cn';\n\nimport {useTopAlertHeight} from './useTopAlertHeight';\n\nimport './TopAlert.scss';\n\nconst b = block('top-alert');\n\ntype Props = {\n alert?: TopAlertProps;\n className?: string;\n mobileView?: boolean;\n};\n\nexport const TopAlert = ({alert, className, mobileView = false}: Props) => {\n const {alertRef, updateTopSize} = useTopAlertHeight({alert});\n\n const [opened, setOpened] = React.useState(true);\n\n const handleClose = React.useCallback(() => {\n setOpened(false);\n alert?.onCloseTopAlert?.();\n }, [alert]);\n\n React.useEffect(() => {\n if (!opened) {\n updateTopSize();\n }\n }, [opened, updateTopSize]);\n\n if (!alert || !alert.message) {\n return null;\n }\n\n return (\n <div\n ref={alertRef}\n className={b('wrapper', {'with-bottom-border': !mobileView && opened}, className)}\n >\n {opened && (\n <Alert\n className={b('', {\n centered: alert.centered,\n dense: alert.dense,\n })}\n corners=\"square\"\n layout=\"horizontal\"\n align={alert.align}\n theme={alert.theme || 'warning'}\n view={alert.view}\n icon={alert.icon}\n title={alert.title}\n message={\n mobileView ? (\n <Text ellipsisLines={5} variant=\"body-2\">\n {alert.message}\n </Text>\n ) : (\n alert.message\n )\n }\n actions={alert.actions}\n onClose={alert.closable ? handleClose : undefined}\n />\n )}\n </div>\n );\n};\n"],"names":["debounceFn","block","Alert","Text"],"mappings":";;;;;;;;;;;;AAWA,MAAM,iBAAiB,GAAG,QAAQ;AAE3B,MAAM,iBAAiB,GAAG,CAAC,EAAC,KAAK,EAA0B,KAA4B;IAC1F,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC;IAEnD,MAAM,sBAAsB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,YAAoB,KAAI;QACtE,MAAM,YAAY,GAAG;aAChB,sBAAsB,CAAC,iBAAiB;aACxC,IAAI,CAAC,CAAC,CAAuB;AAClC,QAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,SAAA,GAAA,SAAA,GAAA,YAAY,CAAE,KAAK,CAAC,WAAW,CAAC,uBAAuB,EAAE,YAAY,GAAG,IAAI,CAAC;KAChF,EAAE,EAAE,CAAC;AAEN,IAAA,MAA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AAA,CACL,CACC;AAEd;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CLs1L-sq.js');
3
+ var index = require('./index-Cycm1qkC.js');
4
4
  require('react');
5
5
  require('@bem-react/classname');
6
6
  require('@gravity-ui/uikit');
@@ -16,3 +16,4 @@ export declare const Fallback: import("@storybook/csf").AnnotatedStoryFn<import(
16
16
  }>;
17
17
  /** @type {StoryFn} */
18
18
  export declare function LineClamp(): React.JSX.Element;
19
+ export declare const CollapseButtonWrapper: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/csf").Args>;
@@ -3,4 +3,11 @@ import { AsideHeaderProps } from '../types';
3
3
  export declare const EMPTY_CONTEXT_VALUE: AsideHeaderContextType;
4
4
  export declare const menuItemsShowcase: AsideHeaderProps['menuItems'];
5
5
  export declare const text = "\nDid you attend? He sang by grove ripe -\nThe bard of love, the singer of his mourning.\nWhen fields were silent by the early morning,\nTo sad and simple sounds of a pipe\nDid you attend?\n\nDid you behold in dark of forest leaf\nThe bard of love, the singer of his sadness?\nThe trace of tears, the smile, the utter paleness,\nThe quiet look, full of eternal grief,\nDid you behold?\n\nThen did you sigh when hearing how cries\nThe bard of love, the singer of his dole?\nWhen in the woods you saw the young man, sole,\nAnd met the look of his extinguished eyes,\nThen did you sigh?\n";
6
+ export declare const DEFAULT_LOGO: {
7
+ text: string;
8
+ icon: import("node_modules/@gravity-ui/uikit/build/esm/components/Icon/types").SVGIconData;
9
+ href: string;
10
+ onClick: () => void;
11
+ 'aria-label': string;
12
+ };
6
13
  export declare const menuItemsClamped: import("../..").MenuItem[];
@@ -3,4 +3,4 @@ import './CollapseButton.scss';
3
3
  export interface CollapseButtonProps {
4
4
  className?: string;
5
5
  }
6
- export declare const CollapseButton: ({ className }: CollapseButtonProps) => React.JSX.Element;
6
+ export declare const CollapseButton: ({ className }: CollapseButtonProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
@@ -32,6 +32,10 @@ export interface AsideHeaderGeneralProps extends QAProps {
32
32
  compact: boolean;
33
33
  asideRef: React.RefObject<HTMLDivElement>;
34
34
  }) => React.ReactNode;
35
+ collapseButtonWrapper?: (defaultButton: React.ReactNode, data: {
36
+ compact: boolean;
37
+ onChangeCompact?: (compact: boolean) => void;
38
+ }) => React.ReactNode;
35
39
  editMenuProps?: EditMenuProps;
36
40
  onClosePanel?: () => void;
37
41
  onChangeCompact?: (compact: boolean) => void;
@@ -6,6 +6,7 @@ import './HotkeysPanel.scss';
6
6
  export type HotkeysPanelProps<T> = {
7
7
  hotkeys: HotkeysGroup<T>[];
8
8
  title?: ReactNode;
9
+ hotkey?: string;
9
10
  filterable?: boolean;
10
11
  filterPlaceholder?: string;
11
12
  emptyState?: ReactNode;
@@ -20,4 +21,4 @@ export type HotkeysPanelProps<T> = {
20
21
  leftOffset?: number | string;
21
22
  topOffset?: number | string;
22
23
  } & Omit<ListProps<HotkeysListItem>, 'items' | 'emptyPlaceholder' | 'className' | 'size' | 'renderItem' | 'filterable' | 'autoFocus' | 'filterPlaceholder' | 'filterClassName' | 'filter' | 'filterItem' | 'onFilterEnd' | 'onFilterUpdate'>;
23
- export declare function HotkeysPanel<T = {}>({ visible, onClose, leftOffset, topOffset, className, drawerItemClassName, filterClassName, titleClassName, listClassName, itemContentClassName, hotkeys, itemClassName, filterable, filterPlaceholder, title, emptyState, ...listProps }: HotkeysPanelProps<T>): React.JSX.Element;
24
+ export declare function HotkeysPanel<T = {}>({ visible, onClose, leftOffset, topOffset, className, drawerItemClassName, filterClassName, titleClassName, listClassName, itemContentClassName, hotkeys, itemClassName, filterable, filterPlaceholder, title, hotkey, emptyState, ...listProps }: HotkeysPanelProps<T>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  export type HotkeysItem = {
2
2
  title: string;
3
3
  value: string;
4
+ hint?: string;
4
5
  };
5
6
  export type HotkeysGroup<T = {}> = {
6
7
  title: string;
@@ -10,4 +11,5 @@ export type HotkeysListItem = {
10
11
  title: string;
11
12
  group?: boolean;
12
13
  value?: string;
14
+ hint?: string;
13
15
  };
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useMemo, Suspense, useCallback, useRef, useState, useEffect, Component, createElement, useContext, useLayoutEffect } from 'react';
3
3
  import { withNaming } from '@bem-react/classname';
4
- import { Icon, Button, Flex, Text, Tooltip, List, Portal, Popup, ActionTooltip, useForkRef, setRef, Hotkey, TextInput, Loader, Sheet, eventBroker, Menu, DropdownMenu } from '@gravity-ui/uikit';
4
+ import { Icon, Button, Flex, Text, Tooltip, List, Portal, Popup, ActionTooltip, useForkRef, setRef, HelpMark, Hotkey, TextInput, Loader, Sheet, eventBroker, Menu, DropdownMenu } from '@gravity-ui/uikit';
5
5
  import { Pin, PinFill, Ellipsis, Gear, Xmark, ListUl, ArrowLeft } from '@gravity-ui/icons';
6
6
  import { addComponentKeysets } from '@gravity-ui/uikit/i18n';
7
7
  import { jsx } from 'react/jsx-runtime';
@@ -121,7 +121,7 @@ function styleInject(css, ref) {
121
121
  var css_248z$u = ".g-root{--gn-aside-top-panel-height:0px}.gn-aside-header{--gn-aside-header-min-width:56px;--_--item-icon-background-size:38px;--_--background-color:var(--g-color-base-background);--_--decoration-collapsed-background-color:var(--g-color-base-warning-light);--_--decoration-expanded-background-color:var(--g-color-base-warning-light);--_--vertical-divider-line-color:var(--g-color-line-generic);--_--horizontal-divider-line-color:var(--g-color-line-generic);background-color:var(--g-color-base-background);height:100%;position:relative;width:100%}.gn-aside-header__aside{background-color:var(--gn-aside-header-expanded-background-color,var(--gn-aside-header-background-color,var(--_--background-color)));box-sizing:border-box;display:flex;flex-direction:column;height:100vh;left:0;margin-top:var(--gn-top-alert-height,0);max-height:calc(100vh - var(--gn-top-alert-height, 0));position:sticky;top:var(--gn-top-alert-height,0);width:inherit;z-index:var(--gn-aside-header-z-index,100)}.gn-aside-header__aside:after{background-color:var(--gn-aside-header-divider-vertical-color,var(--_--vertical-divider-line-color));content:\"\";height:100%;position:absolute;right:0;top:0;width:1px;z-index:2}.gn-aside-header__aside-popup-anchor{inset:0;position:absolute;z-index:1}.gn-aside-header__aside-content{--gradient-height:334px;display:flex;flex-direction:column;height:inherit;overflow-x:hidden;padding-top:var(--gn-aside-header-padding-top);position:relative;user-select:none;width:inherit;z-index:2}.gn-aside-header__aside-content>.gn-aside-header-logo{margin:8px 0}.gn-aside-header__aside-content_with-decoration{background:linear-gradient(180deg,var(--gn-aside-header-decoration-expanded-background-color,var(--_--decoration-expanded-background-color)) calc(var(--gradient-height)*.33),transparent calc(var(--gradient-height)*.88))}.gn-aside-header__aside-custom-background{bottom:0;display:flex;position:absolute;top:0;width:var(--gn-aside-header-size);z-index:-1}.gn-aside-header_compact .gn-aside-header__aside{background-color:var(--gn-aside-header-collapsed-background-color,var(--gn-aside-header-background-color,var(--_--background-color)))}.gn-aside-header_compact .gn-aside-header__aside-content{background:transparent}.gn-aside-header__header{--gn-aside-header-header-divider-height:29px;box-sizing:border-box;flex:none;padding-bottom:22px;padding-top:8px;position:relative;width:100%;z-index:1}.gn-aside-header__header .gn-aside-header__header-divider{bottom:0;color:var(--gn-aside-header-decoration-collapsed-background-color,var(--_--decoration-collapsed-background-color));display:none;left:0;position:absolute;z-index:-2}.gn-aside-header__header_with-decoration:before{background-color:var(--gn-aside-header-decoration-collapsed-background-color,var(--_--decoration-collapsed-background-color));content:\"\";display:none;height:calc(100% - var(--gn-aside-header-header-divider-height));left:0;position:absolute;top:0;width:100%;z-index:-2}.gn-aside-header__header:after{background-color:var(--gn-aside-header-divider-horizontal-color,var(--_--horizontal-divider-line-color));bottom:12px;content:\"\";height:1px;left:0;position:absolute;width:100%;z-index:-2}.gn-aside-header_compact .gn-aside-header__header:before,.gn-aside-header_compact .gn-aside-header__header_with-decoration .gn-aside-header__header-divider{display:block}.gn-aside-header_compact .gn-aside-header__header_with-decoration:after{display:none}.gn-aside-header__logo-button .gn-aside-header__logo-icon-place{height:var(--gn-aside-header-item-icon-background-size,var(--_--item-icon-background-size));width:var(--gn-aside-header-min-width)}.gn-aside-header__menu-items{flex-grow:1}.gn-aside-header__footer{display:flex;flex-direction:column;flex-shrink:0;margin:8px 0;width:100%}.gn-aside-header__panels{inset:var(--gn-top-alert-height,0) 0 0;max-height:calc(100vh - var(--gn-top-alert-height, 0));overflow:auto;position:fixed;z-index:var(--gn-aside-header-panel-z-index,98)}.gn-aside-header__panel{height:100%}.gn-aside-header__pane-container{display:flex;flex-direction:row;outline:none;overflow:visible;user-select:text}.gn-aside-header__top-alert{background:var(--g-color-base-background);position:fixed;top:0;width:100%;z-index:var(--gn-aside-header-pane-top-z-index,98)}.gn-aside-header__content{margin-top:var(--gn-top-alert-height,0);width:calc(100% - var(--gn-aside-header-size));z-index:var(--gn-aside-header-content-z-index,95)}";
122
122
  styleInject(css_248z$u);
123
123
 
124
- const TopAlert$1 = React__default.lazy(() => import('./index-AHJjBN3a.js').then((module) => ({ default: module.TopAlert })));
124
+ const TopAlert$1 = React__default.lazy(() => import('./index-DM3j7oy5.js').then((module) => ({ default: module.TopAlert })));
125
125
  const Layout = ({ compact, className, children, topAlert }) => {
126
126
  const size = compact ? ASIDE_HEADER_COMPACT_WIDTH : ASIDE_HEADER_EXPANDED_WIDTH;
127
127
  const asideHeaderContextValue = useMemo(() => ({ size, compact }), [compact, size]);
@@ -1878,15 +1878,19 @@ styleInject(css_248z$n);
1878
1878
 
1879
1879
  const b$o = block('collapse-button');
1880
1880
  const CollapseButton = ({ className }) => {
1881
- const { onChangeCompact, compact, expandTitle, collapseTitle } = useAsideHeaderInnerContext();
1881
+ const { onChangeCompact, compact, expandTitle, collapseTitle, collapseButtonWrapper } = useAsideHeaderInnerContext();
1882
1882
  const onCollapseButtonClick = useCallback(() => {
1883
1883
  onChangeCompact === null || onChangeCompact === undefined ? undefined : onChangeCompact(!compact);
1884
1884
  }, [compact, onChangeCompact]);
1885
1885
  const buttonTitle = compact
1886
1886
  ? expandTitle || i18n$3('button_expand')
1887
1887
  : collapseTitle || i18n$3('button_collapse');
1888
- return (React__default.createElement("button", { className: b$o({ compact }, className), onClick: onCollapseButtonClick, title: buttonTitle },
1888
+ const defaultButton = (React__default.createElement("button", { className: b$o({ compact }, className), onClick: onCollapseButtonClick, title: buttonTitle },
1889
1889
  React__default.createElement(Icon, { data: SvgControlMenuButton, className: b$o('icon'), width: "16", height: "10" })));
1890
+ if (collapseButtonWrapper) {
1891
+ return collapseButtonWrapper(defaultButton, { compact, onChangeCompact });
1892
+ }
1893
+ return defaultButton;
1890
1894
  };
1891
1895
 
1892
1896
  var css_248z$m = ".gn-logo{height:40px}.gn-logo,.gn-logo__btn-logo{align-items:center;display:flex}.gn-logo__btn-logo{cursor:pointer;flex-shrink:0;justify-content:center}.gn-logo__btn-logo,.gn-logo__btn-logo:active,.gn-logo__btn-logo:focus,.gn-logo__btn-logo:hover,.gn-logo__btn-logo:visited{color:inherit;outline:none;text-decoration:none}.gn-logo__btn-logo:focus-visible{outline:solid var(--g-color-line-misc);outline-offset:-2px}.gn-logo__logo-icon-place{align-items:center;display:flex;justify-content:center;width:36px}";
@@ -4788,29 +4792,33 @@ function flattenHotkeyGroups(hotkeys) {
4788
4792
  return result;
4789
4793
  }
4790
4794
 
4791
- var css_248z$d = ".gn-hotkeys-panel{--hotkeys-panel-width:400px;--hotkeys-panel-vertical-padding:18px;--hotkeys-panel-horizontal-padding:24px;inset:0;position:fixed}.gn-hotkeys-panel__drawer-item{box-sizing:border-box;display:flex;flex-direction:column;padding:var(--hotkeys-panel-vertical-padding) 0;width:var(--hotkeys-panel-width)}.gn-hotkeys-panel__title{margin:0 var(--hotkeys-panel-horizontal-padding) 16px var(--hotkeys-panel-horizontal-padding)}.gn-hotkeys-panel__search{box-sizing:border-box;margin-bottom:14px;padding:0 var(--hotkeys-panel-horizontal-padding)}.gn-hotkeys-panel__list{flex:1;overflow-y:auto}.gn-hotkeys-panel__item{height:auto;padding:8px var(--hotkeys-panel-horizontal-padding)}.gn-hotkeys-panel__item.g-list__item_active{background:inherit}.gn-hotkeys-panel__item-content{align-items:baseline;color:var(--g-color-text-primary);display:flex;font-size:var(--g-text-body-1-font-size);justify-content:space-between;line-height:var(--g-text-body-1-line-height);width:100%}.gn-hotkeys-panel__item-content_group{font-size:var(--g-text-body-2-font-size);font-weight:500;line-height:var(--g-text-body-2-line-height)}.gn-hotkeys-panel__hotkey{color:var(--g-color-text-complementary)}";
4795
+ var css_248z$d = ".gn-hotkeys-panel{--hotkeys-panel-width:400px;--hotkeys-panel-vertical-padding:18px;--hotkeys-panel-horizontal-padding:var(--g-spacing-6);inset:0;position:fixed}.gn-hotkeys-panel__drawer-item{box-sizing:border-box;display:flex;flex-direction:column;padding:var(--hotkeys-panel-vertical-padding) 0;width:var(--hotkeys-panel-width)}.gn-hotkeys-panel__title{align-items:baseline;display:flex;gap:var(--g-spacing-2);justify-content:space-between;margin:0 var(--hotkeys-panel-horizontal-padding) var(--g-spacing-4) var(--hotkeys-panel-horizontal-padding)}.gn-hotkeys-panel__search{box-sizing:border-box;margin-bottom:var(--g-spacing-4);padding:0 var(--hotkeys-panel-horizontal-padding)}.gn-hotkeys-panel__list{flex:1;overflow-y:auto}.gn-hotkeys-panel__item{height:auto;margin:0 var(--hotkeys-panel-horizontal-padding);padding:var(--g-spacing-2) 0}.gn-hotkeys-panel__item.g-list__item_active{background:inherit}.gn-hotkeys-panel__item:not(:first-child):has(.gn-hotkeys-panel__item-content_type_group){border-top:1px solid var(--g-color-line-generic);margin-top:var(--g-spacing-3);padding-top:var(--g-spacing-4)}.gn-hotkeys-panel__item-content{align-items:baseline;color:var(--g-color-text-primary);display:flex;justify-content:space-between;margin:0;width:100%}.gn-hotkeys-panel__item-hint{margin-left:var(--g-spacing-1)}.gn-hotkeys-panel__item-hint-tooltip{max-width:217px}.gn-hotkeys-panel__hotkey{color:var(--g-color-text-complementary)}";
4792
4796
  styleInject(css_248z$d);
4793
4797
 
4794
4798
  const b$e = block('hotkeys-panel');
4795
4799
  function HotkeysPanel(_a) {
4796
- var { visible, onClose, leftOffset, topOffset, className, drawerItemClassName, filterClassName, titleClassName, listClassName, itemContentClassName, hotkeys, itemClassName, filterable = true, filterPlaceholder, title, emptyState } = _a, listProps = __rest(_a, ["visible", "onClose", "leftOffset", "topOffset", "className", "drawerItemClassName", "filterClassName", "titleClassName", "listClassName", "itemContentClassName", "hotkeys", "itemClassName", "filterable", "filterPlaceholder", "title", "emptyState"]);
4800
+ var { visible, onClose, leftOffset, topOffset, className, drawerItemClassName, filterClassName, titleClassName, listClassName, itemContentClassName, hotkeys, itemClassName, filterable = true, filterPlaceholder, title, hotkey, emptyState } = _a, listProps = __rest(_a, ["visible", "onClose", "leftOffset", "topOffset", "className", "drawerItemClassName", "filterClassName", "titleClassName", "listClassName", "itemContentClassName", "hotkeys", "itemClassName", "filterable", "filterPlaceholder", "title", "hotkey", "emptyState"]);
4797
4801
  const [filter, setFilter] = useState('');
4798
4802
  const hotkeysList = useMemo(() => {
4799
4803
  const filteredHotkeys = filterHotkeys(hotkeys, filter);
4800
4804
  return flattenHotkeyGroups(filteredHotkeys);
4801
4805
  }, [hotkeys, filter]);
4802
- const renderItem = useCallback((item) => (React__default.createElement("div", { className: b$e('item-content', { group: item.group }, itemContentClassName), key: item.title },
4803
- item.title,
4804
- item.value && React__default.createElement(Hotkey, { className: b$e('hotkey'), value: item.value }))), []);
4806
+ const renderItem = useCallback((item) => (React__default.createElement(Text, { as: item.group ? 'h3' : 'p', variant: item.group ? 'subheader-2' : 'body-1', className: b$e('item-content', { type: item.group ? 'group' : 'item' }, itemContentClassName), key: item.title },
4807
+ React__default.createElement("span", null,
4808
+ item.title,
4809
+ item.hint && (React__default.createElement(HelpMark, { "aria-hidden": true, popoverProps: { className: b$e('item-hint-tooltip') }, className: b$e('item-hint') }, item.hint))),
4810
+ item.value && React__default.createElement(Hotkey, { className: b$e('hotkey'), value: item.value }))), [itemContentClassName]);
4805
4811
  const drawerItemContent = (React__default.createElement(React__default.Fragment, null,
4806
- React__default.createElement("h2", { className: b$e('title', titleClassName) }, title),
4812
+ React__default.createElement(Text, { variant: "subheader-3", as: 'h2', className: b$e('title', titleClassName) },
4813
+ title,
4814
+ hotkey && React__default.createElement(Hotkey, { value: hotkey })),
4807
4815
  filterable && (React__default.createElement(TextInput, { value: filter, onUpdate: setFilter, placeholder: filterPlaceholder, autoFocus: true, className: b$e('search', filterClassName), hasClear: true })),
4808
4816
  React__default.createElement(List, Object.assign({ className: b$e('list', listClassName), virtualized: false, filterable: false, items: hotkeysList, renderItem: renderItem, itemClassName: b$e('item', itemClassName), emptyPlaceholder: emptyState }, listProps))));
4809
4817
  return (React__default.createElement(Drawer, { className: b$e(null, className), onVeilClick: onClose, onEscape: onClose, style: {
4810
4818
  left: leftOffset,
4811
4819
  top: topOffset,
4812
4820
  } },
4813
- React__default.createElement(DrawerItem, { id: "hotkeys", visible: visible, className: b$e('drawer-item', drawerItemClassName), content: drawerItemContent })));
4821
+ React__default.createElement(DrawerItem, { id: "hotkeys", visible: visible, className: b$e('drawer-item', drawerItemClassName) }, drawerItemContent)));
4814
4822
  }
4815
4823
 
4816
4824
  /**
@@ -5659,7 +5667,7 @@ const OverlapPanel = ({ title, renderContent, className, onClose, action, closeT
5659
5667
  var css_248z$4 = ".gn-mobile-header{--mobile-header-min-heigth:50px;--mobile-header-icon-size:20px;background-color:var(--g-color-base-background)}.gn-mobile-header__header-container{background-color:var(--g-color-base-background);position:sticky;top:0;z-index:var(--gn-mobile-header-z-index,100)}.gn-mobile-header__header{align-items:center;border-bottom:1px solid var(--g-color-line-generic);box-sizing:border-box;display:flex;justify-content:space-between;padding:0 10px}.gn-mobile-header__burger{padding:12px}.gn-mobile-header__panel-item{--gn-drawer-item-position:var(--gn-mobile-header-panel-position,absolute)}.gn-mobile-header__burger-menu,.gn-mobile-header__panel-item{background-color:var(--g-color-base-background);max-height:100%;max-width:90vw;width:320px}.gn-mobile-header__user-menu{overflow-y:auto}.gn-mobile-header__overlap-panel,.gn-mobile-header__panels{z-index:var(--gn-mobile-header-panel-z-index,98)}.gn-mobile-header__panels{inset:var(--mobile-header-min-heigth) 0 0;overflow:hidden;position:fixed}.gn-mobile-header__panel-item{top:unset}.gn-mobile-header__content{overflow:auto}";
5660
5668
  styleInject(css_248z$4);
5661
5669
 
5662
- const TopAlert = React__default.lazy(() => import('./index-AHJjBN3a.js').then((module) => ({ default: module.TopAlert })));
5670
+ const TopAlert = React__default.lazy(() => import('./index-DM3j7oy5.js').then((module) => ({ default: module.TopAlert })));
5663
5671
  const b$4 = block('mobile-header');
5664
5672
  const MobileHeader = React__default.forwardRef(({ logo, burgerMenu, burgerCloseTitle = i18n('burger_button_close'), burgerOpenTitle = i18n('burger_button_open'), panelItems = [], renderContent, sideItemRenderContent, onClosePanel, onEvent, className, contentClassName, overlapPanel, topAlert, }, ref) => {
5665
5673
  const targetRef = useForwardRef(ref);
@@ -5950,4 +5958,4 @@ const MobileFooter = ({ className, menuItems: providedMenuItems, withDivider, mo
5950
5958
  };
5951
5959
 
5952
5960
  export { AsideHeader as A, DrawerItem as D, FooterItem$1 as F, HotkeysPanel as H, Logo as L, MOBILE_HEADER_EVENT_NAMES as M, PageLayout as P, Settings as S, Title as T, AsideHeaderContextProvider as a, block as b, PageLayoutAside as c, debounceFn as d, AsideFallback as e, Drawer as f, PublicActionBar as g, useSettingsSelectionContext as h, useSettingsContext as i, FooterItem as j, getMobileHeaderCustomEvent as k, MobileHeader as l, MobileLogo as m, Footer as n, MobileFooter as o, styleInject as s, useAsideHeaderContext as u };
5953
- //# sourceMappingURL=index-CoM0LT-x.js.map
5961
+ //# sourceMappingURL=index-BR3lwtrQ.js.map