@gravity-ui/navigation 3.7.2 → 3.7.3

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 (39) hide show
  1. package/build/cjs/components/Settings/Selection/context.d.ts +4 -5
  2. package/build/cjs/components/Settings/Settings.d.ts +1 -55
  3. package/build/cjs/components/Settings/SettingsContext/SettingsContext.d.ts +3 -0
  4. package/build/cjs/components/Settings/SettingsContext/types.d.ts +3 -0
  5. package/build/cjs/components/Settings/SettingsContext/useSettingsContext.d.ts +1 -0
  6. package/build/cjs/components/Settings/SettingsPage/SettingsPageComponent.d.ts +14 -0
  7. package/build/cjs/components/Settings/SettingsPage/getPageTitleById.d.ts +2 -0
  8. package/build/cjs/components/Settings/SettingsRow/SettingsRow.d.ts +8 -0
  9. package/build/cjs/components/Settings/SettingsRow/prepareTitle.d.ts +2 -0
  10. package/build/cjs/components/Settings/SettingsSection.d.ts +7 -0
  11. package/build/cjs/components/Settings/b.d.ts +1 -0
  12. package/build/cjs/components/Settings/index.d.ts +3 -0
  13. package/build/cjs/components/Settings/types.d.ts +54 -1
  14. package/build/cjs/{index-DmbAkuY3.js → index-CP_uL7BD.js} +2 -2
  15. package/build/cjs/{index-DmbAkuY3.js.map → index-CP_uL7BD.js.map} +1 -1
  16. package/build/cjs/{index-CwssjteA.js → index-DXB2_bQS.js} +114 -100
  17. package/build/cjs/index-DXB2_bQS.js.map +1 -0
  18. package/build/cjs/index.js +1 -1
  19. package/build/esm/components/Settings/Selection/context.d.ts +4 -5
  20. package/build/esm/components/Settings/Settings.d.ts +1 -55
  21. package/build/esm/components/Settings/SettingsContext/SettingsContext.d.ts +3 -0
  22. package/build/esm/components/Settings/SettingsContext/types.d.ts +3 -0
  23. package/build/esm/components/Settings/SettingsContext/useSettingsContext.d.ts +1 -0
  24. package/build/esm/components/Settings/SettingsPage/SettingsPageComponent.d.ts +14 -0
  25. package/build/esm/components/Settings/SettingsPage/getPageTitleById.d.ts +2 -0
  26. package/build/esm/components/Settings/SettingsRow/SettingsRow.d.ts +8 -0
  27. package/build/esm/components/Settings/SettingsRow/prepareTitle.d.ts +2 -0
  28. package/build/esm/components/Settings/SettingsSection.d.ts +7 -0
  29. package/build/esm/components/Settings/b.d.ts +1 -0
  30. package/build/esm/components/Settings/index.d.ts +3 -0
  31. package/build/esm/components/Settings/types.d.ts +54 -1
  32. package/build/esm/{index-DLKE2e2V.js → index-BwxN_FEJ.js} +2 -2
  33. package/build/esm/{index-DLKE2e2V.js.map → index-BwxN_FEJ.js.map} +1 -1
  34. package/build/esm/{index-CD_HaUpp.js → index-f1GutIB3.js} +115 -101
  35. package/build/esm/index-f1GutIB3.js.map +1 -0
  36. package/build/esm/index.js +1 -1
  37. package/package.json +1 -1
  38. package/build/cjs/index-CwssjteA.js.map +0 -1
  39. package/build/esm/index-CD_HaUpp.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CwssjteA.js');
3
+ var index = require('./index-DXB2_bQS.js');
4
4
  require('react');
5
5
  require('@bem-react/classname');
6
6
  require('@gravity-ui/uikit');
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import { SelectedSettingsPart, SettingsPage } from '../collect-settings';
3
3
  import { SettingsSelection } from './types';
4
- interface ContextValue extends SelectedSettingsPart {
4
+ export interface SettingsSelectionProviderContextValue extends SelectedSettingsPart {
5
5
  selectedRef?: React.RefObject<HTMLDivElement>;
6
6
  }
7
- export declare function useSettingsSelectionProviderValue(pages: Record<string, SettingsPage>, selection: SettingsSelection | undefined): ContextValue;
8
- export declare const SettingsSelectionContextProvider: React.Provider<ContextValue>;
9
- export declare function useSettingsSelectionContext(): ContextValue;
10
- export {};
7
+ export declare function useSettingsSelectionProviderValue(pages: Record<string, SettingsPage>, selection: SettingsSelection | undefined): SettingsSelectionProviderContextValue;
8
+ export declare const SettingsSelectionContextProvider: React.Provider<SettingsSelectionProviderContextValue>;
9
+ export declare function useSettingsSelectionContext(): SettingsSelectionProviderContextValue;
@@ -1,60 +1,6 @@
1
1
  import React from 'react';
2
- import { IconProps } from '@gravity-ui/uikit';
3
- import { SettingsSelection } from './Selection';
4
- import type { SettingsPageSection } from './collect-settings';
2
+ import type { SettingsGroupProps, SettingsItemProps, SettingsPageProps, SettingsProps, SettingsSectionProps } from './types';
5
3
  import './Settings.scss';
6
- export interface SettingsProps {
7
- children: React.ReactNode;
8
- title?: string;
9
- filterPlaceholder?: string;
10
- emptyPlaceholder?: string;
11
- initialPage?: string;
12
- initialSearch?: string;
13
- selection?: SettingsSelection;
14
- onPageChange?: (page: string | undefined) => void;
15
- renderNotFound?: () => React.ReactNode;
16
- renderLoading?: () => React.ReactNode;
17
- loading?: boolean;
18
- view?: 'normal' | 'mobile';
19
- onClose?: () => void;
20
- renderRightAdornment?: (item: SettingsItemProps) => React.ReactNode;
21
- renderSectionRightAdornment?: (section: SettingsPageSection) => React.ReactNode;
22
- showRightAdornmentOnHover?: boolean;
23
- }
24
- export interface SettingsGroupProps {
25
- id?: string;
26
- groupTitle: string;
27
- children: React.ReactNode;
28
- }
29
- export interface SettingsPageProps {
30
- id?: string;
31
- title?: string;
32
- icon?: IconProps;
33
- children: React.ReactNode;
34
- }
35
- export interface SettingsSectionProps {
36
- id?: string;
37
- title: string;
38
- header?: React.ReactNode;
39
- children: React.ReactNode;
40
- withBadge?: boolean;
41
- hideTitle?: boolean;
42
- }
43
- export interface SettingsItemProps {
44
- id?: string;
45
- labelId?: string;
46
- title: string;
47
- highlightedTitle?: React.ReactNode | null;
48
- renderTitleComponent?: (highlightedTitle: React.ReactNode | null) => React.ReactNode;
49
- align?: 'top' | 'center';
50
- children: React.ReactNode;
51
- withBadge?: boolean;
52
- mode?: 'row';
53
- description?: React.ReactNode;
54
- }
55
- export interface SettingsContextType extends Pick<SettingsProps, 'renderRightAdornment' | 'renderSectionRightAdornment' | 'showRightAdornmentOnHover'> {
56
- }
57
- export declare const useSettingsContext: () => SettingsContextType;
58
4
  export declare function Settings({ loading, renderLoading, children, view, renderRightAdornment, renderSectionRightAdornment, showRightAdornmentOnHover, ...props }: SettingsProps): React.JSX.Element;
59
5
  export declare namespace Settings {
60
6
  var Group: ({ children }: SettingsGroupProps) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { SettingsContextType } from './types';
3
+ export declare const SettingsContext: React.Context<SettingsContextType>;
@@ -0,0 +1,3 @@
1
+ import type { SettingsProps } from '../types';
2
+ export interface SettingsContextType extends Pick<SettingsProps, 'renderRightAdornment' | 'renderSectionRightAdornment' | 'showRightAdornmentOnHover'> {
3
+ }
@@ -0,0 +1 @@
1
+ export declare const useSettingsContext: () => import("./types").SettingsContextType;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { SettingsSelectionProviderContextValue } from '../Selection/context';
3
+ import { SettingsMenu as CollectSettingsSettingsMenu, SettingsPage } from '../collect-settings';
4
+ import { SettingsContentProps } from '../types';
5
+ type Props = {
6
+ menu: CollectSettingsSettingsMenu;
7
+ pages: Record<string, SettingsPage>;
8
+ page: string | undefined;
9
+ isMobile: boolean;
10
+ search: string;
11
+ selected: SettingsSelectionProviderContextValue;
12
+ } & Pick<SettingsContentProps, 'renderNotFound' | 'emptyPlaceholder' | 'onClose'>;
13
+ export declare const SettingsPageComponent: ({ menu, pages, selected, isMobile, search, page, renderNotFound, emptyPlaceholder, onClose, }: Props) => React.ReactElement;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { SettingsMenu as SettingsMenuType } from '../collect-settings';
2
+ export declare const getPageTitleById: (menu: SettingsMenuType, activePage: string) => string;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { SettingsItem } from '../collect-settings';
3
+ export declare const SettingRow: {
4
+ ({ title: settingTitle, element, search, }: SettingsItem & {
5
+ search: string;
6
+ }): React.ReactElement;
7
+ displayName: string;
8
+ };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function prepareTitle(string: string, search: string): React.ReactNode[];
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { SettingsPageSection } from './collect-settings';
3
+ export declare const SettingsSection: React.ForwardRefExoticComponent<SettingsPageSection & {
4
+ search: string;
5
+ isMobile: boolean;
6
+ isSelected: boolean;
7
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export declare const b: import("@bem-react/classname").ClassNameFormatter;
@@ -1,2 +1,5 @@
1
1
  export * from './Selection';
2
2
  export * from './Settings';
3
+ export type { SettingsContextType } from './SettingsContext/types';
4
+ export { useSettingsContext } from './SettingsContext/useSettingsContext';
5
+ export type { SettingsProps, SettingsGroupProps, SettingsPageProps, SettingsSectionProps, SettingsItemProps, } from './types';
@@ -1,4 +1,7 @@
1
- import { IconProps } from '@gravity-ui/uikit';
1
+ import type React from 'react';
2
+ import type { IconProps } from '@gravity-ui/uikit';
3
+ import type { SettingsSelection } from './Selection';
4
+ import type { SettingsPageSection } from './collect-settings';
2
5
  export interface GroupItem {
3
6
  groupTitle: string;
4
7
  items: Item[];
@@ -18,4 +21,54 @@ export interface SettingsMenuProps {
18
21
  focusItemId?: string;
19
22
  className?: string;
20
23
  }
24
+ export interface SettingsProps {
25
+ children: React.ReactNode;
26
+ title?: string;
27
+ filterPlaceholder?: string;
28
+ emptyPlaceholder?: string;
29
+ initialPage?: string;
30
+ initialSearch?: string;
31
+ selection?: SettingsSelection;
32
+ onPageChange?: (page: string | undefined) => void;
33
+ renderNotFound?: () => React.ReactNode;
34
+ renderLoading?: () => React.ReactNode;
35
+ loading?: boolean;
36
+ view?: 'normal' | 'mobile';
37
+ onClose?: () => void;
38
+ renderRightAdornment?: (item: SettingsItemProps) => React.ReactNode;
39
+ renderSectionRightAdornment?: (section: SettingsPageSection) => React.ReactNode;
40
+ showRightAdornmentOnHover?: boolean;
41
+ }
42
+ export interface SettingsGroupProps {
43
+ id?: string;
44
+ groupTitle: string;
45
+ children: React.ReactNode;
46
+ }
47
+ export interface SettingsPageProps {
48
+ id?: string;
49
+ title?: string;
50
+ icon?: IconProps;
51
+ children: React.ReactNode;
52
+ }
53
+ export interface SettingsSectionProps {
54
+ id?: string;
55
+ title: string;
56
+ header?: React.ReactNode;
57
+ children: React.ReactNode;
58
+ withBadge?: boolean;
59
+ hideTitle?: boolean;
60
+ }
61
+ export interface SettingsItemProps {
62
+ id?: string;
63
+ labelId?: string;
64
+ title: string;
65
+ highlightedTitle?: React.ReactNode | null;
66
+ renderTitleComponent?: (highlightedTitle: React.ReactNode | null) => React.ReactNode;
67
+ align?: 'top' | 'center';
68
+ children: React.ReactNode;
69
+ withBadge?: boolean;
70
+ mode?: 'row';
71
+ description?: React.ReactNode;
72
+ }
73
+ export type SettingsContentProps = Omit<SettingsProps, 'loading' | 'renderLoading'>;
21
74
  export {};
@@ -1,6 +1,6 @@
1
1
  import React__default from 'react';
2
2
  import { Alert, Text } from '@gravity-ui/uikit';
3
- import { d as debounceFn, s as styleInject, b as block } from './index-CD_HaUpp.js';
3
+ import { d as debounceFn, s as styleInject, b as block } from './index-f1GutIB3.js';
4
4
  import '@bem-react/classname';
5
5
  import '@gravity-ui/icons';
6
6
  import '@gravity-ui/uikit/i18n';
@@ -65,4 +65,4 @@ const TopAlert = ({ alert, className, mobileView = false }) => {
65
65
  };
66
66
 
67
67
  export { TopAlert };
68
- //# sourceMappingURL=index-DLKE2e2V.js.map
68
+ //# sourceMappingURL=index-BwxN_FEJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-DLKE2e2V.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":["React"],"mappings":";;;;;;;;;;AAWA,MAAM,iBAAiB,GAAG,QAAQ;AAE3B,MAAM,iBAAiB,GAAG,CAAC,EAAC,KAAK,EAA0B,KAA4B;IAC1F,MAAM,QAAQ,GAAGA,cAAK,CAAC,MAAM,CAAiB,IAAI,CAAC;IAEnD,MAAM,sBAAsB,GAAGA,cAAK,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,MAAM,aAAa,GAAGA,cAAK,CAAC,WAAW,CAAC,MAAK;;QACzC,sBAAsB,CAAC,CAAA,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAE,YAAY,KAAI,CAAC,CAAC;AAC/D,KAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC;AAE5B,IAAAA,cAAK,CAAC,eAAe,CAAC,MAAK;AACvB,QAAA,MAAM,qBAAqB,GAAG,UAAU,CAAC,aAAa,EAAE,GAAG,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;QAE7E,IAAI,KAAK,EAAE;AACP,YAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,qBAAqB,CAAC;AACxD,YAAA,qBAAqB,EAAE;;AAE3B,QAAA,OAAO,MAAK;AACR,YA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EAAA,EAEhF,MAAM,KACHA,cAAC,CAAA,aAAA,CAAA,KAAK,IACF,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE,KAAK,CAAC,KAAK;SACrB,CAAC,EACF,OAAO,EAAC,QAAQ,EAChB,MAAM,EAAC,YAAY,EACnB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,SAAS,EAC/B,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,OAAO,EACH,UAAU,IACNA,6BAAC,IAAI,EAAA,EAAC,aAAa,EAAE,CAAC,EAAE,OAAO,EAAC,QAAQ,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-BwxN_FEJ.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":["React"],"mappings":";;;;;;;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AC,EACF,OAAO,EAAC,QAAQ,EAChB,MAAM,EAAC,YAAY,EACnB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,SAAS,EAC/B,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,OAAO,EACH,UAAU,IACNA,6BAAC,IAAI,EAAA,EAAC,aAAa,EAAE,CAAC,EAAE,OAAO,EAAC,QAAQ,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;;;;"}
@@ -118,10 +118,10 @@ function styleInject(css, ref) {
118
118
  }
119
119
  }
120
120
 
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)}";
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{--gn-drawer-z-index:var(--gn-aside-header-panel-z-index,98);display:flex;flex-direction:column;inset:var(--gn-top-alert-height,0) 0 0;max-height:calc(100vh - var(--gn-top-alert-height, 0));overflow:auto;position:fixed}.gn-aside-header__panel{flex-grow:1;height:auto}.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-DLKE2e2V.js').then((module) => ({ default: module.TopAlert })));
124
+ const TopAlert$1 = React__default.lazy(() => import('./index-BwxN_FEJ.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]);
@@ -4569,7 +4569,7 @@ const Drawer = ({ className, veilClassName, children, style, onVeilClick, onEsca
4569
4569
 
4570
4570
  const Panels = () => {
4571
4571
  const { panelItems, onClosePanel, size } = useAsideHeaderInnerContext();
4572
- return panelItems ? (React__default.createElement(Drawer, { className: b$v('panels'), onVeilClick: onClosePanel, onEscape: onClosePanel, style: { left: size } }, panelItems.map((item) => (React__default.createElement(DrawerItem, Object.assign({ key: item.id }, item)))))) : null;
4572
+ return panelItems ? (React__default.createElement(Drawer, { className: b$v('panels'), onVeilClick: onClosePanel, onEscape: onClosePanel, style: { left: size } }, panelItems.map((item) => (React__default.createElement(DrawerItem, Object.assign({ key: item.id, className: b$v('panel') }, item)))))) : null;
4573
4573
  };
4574
4574
 
4575
4575
  const MENU_ITEMS_COMPOSITE_ID = 'gravity-ui/navigation-menu-items-composite-bar';
@@ -5168,23 +5168,9 @@ function requireIdentity () {
5168
5168
  var identityExports = requireIdentity();
5169
5169
  var identity = /*@__PURE__*/getDefaultExportFromCjs(identityExports);
5170
5170
 
5171
- function isSectionSelected(selected, pageId, section) {
5172
- var _a;
5173
- if (!selected.section || selected.setting) {
5174
- return false;
5175
- }
5176
- else if (selected.section.id && selected.section.id === section.id) {
5177
- return true;
5178
- }
5179
- else if (((_a = selected.page) === null || _a === undefined ? undefined : _a.id) === pageId &&
5180
- selected.section.title &&
5181
- selected.section.title === section.title) {
5182
- return true;
5183
- }
5184
- else {
5185
- return false;
5186
- }
5187
- }
5171
+ const SettingsContext = React__default.createContext({});
5172
+
5173
+ const useSettingsContext = () => React__default.useContext(SettingsContext);
5188
5174
 
5189
5175
  var css_248z$c = ".gn-settings-menu__group-heading{display:inline-block;font-weight:var(--g-text-accent-font-weight);line-height:18px;margin-bottom:12px;padding:0 20px}.gn-settings-menu__group+.gn-settings-menu__group{margin-top:24px}.gn-settings-menu__item+.gn-settings-menu__group{margin-top:8px}.gn-settings-menu__item{align-items:center;color:var(--g-color-text-primary);cursor:pointer;display:flex;height:40px;padding:0 20px}.gn-settings-menu__item-icon{color:var(--g-color-text-misc);margin-right:5px}.gn-settings-menu__item:hover,.gn-settings-menu__item_focused{background:var(--g-color-base-simple-hover)}.gn-settings-menu__item_selected{background:var(--g-color-base-selection)}.gn-settings-menu__item_selected.gn-settings-menu__item_focused,.gn-settings-menu__item_selected:hover{background:var(--g-color-base-selection-hover)}.gn-settings-menu__item_disabled{color:var(--g-color-text-secondary);cursor:auto}.gn-settings-menu__item_disabled:hover{background:none}.gn-settings-menu__item_disabled .gn-settings-menu__item-icon{color:var(--g-color-base-misc-heavy)}.gn-settings-menu__item_badge{position:relative}.gn-settings-menu__item_badge:after{background-color:var(--g-color-text-danger);border-radius:50%;content:\"\";display:block;height:6px;position:absolute;right:9px;top:calc(50% - 3px);width:6px}";
5190
5176
  styleInject(css_248z$c);
@@ -5291,7 +5277,97 @@ const SettingsMenuMobile = ({ items, onChange, activeItemId, className, }) => {
5291
5277
  React__default.createElement(Tabs, { items: tabItems, className: b$c(null, className), size: "l", activeTab: activeItemId, onSelectTab: onChange })));
5292
5278
  };
5293
5279
 
5294
- const b$b = block('settings-search');
5280
+ function isSectionSelected(selected, pageId, section) {
5281
+ var _a;
5282
+ if (!selected.section || selected.setting) {
5283
+ return false;
5284
+ }
5285
+ else if (selected.section.id && selected.section.id === section.id) {
5286
+ return true;
5287
+ }
5288
+ else if (((_a = selected.page) === null || _a === undefined ? undefined : _a.id) === pageId &&
5289
+ selected.section.title &&
5290
+ selected.section.title === section.title) {
5291
+ return true;
5292
+ }
5293
+ else {
5294
+ return false;
5295
+ }
5296
+ }
5297
+
5298
+ const b$b = block('settings');
5299
+
5300
+ function prepareTitle(string, search) {
5301
+ let temp = string.slice(0);
5302
+ const title = [];
5303
+ const parts = escapeStringForRegExp(search).split(' ').filter(Boolean);
5304
+ let key = 0;
5305
+ for (const part of parts) {
5306
+ const regex = new RegExp(part, 'ig');
5307
+ const match = regex.exec(temp);
5308
+ if (match) {
5309
+ const m = match[0];
5310
+ const i = match.index;
5311
+ if (i > 0) {
5312
+ title.push(temp.slice(0, i));
5313
+ }
5314
+ title.push(React__default.createElement("strong", { key: key++, className: b$b('found') }, m));
5315
+ temp = temp.slice(i + m.length);
5316
+ }
5317
+ }
5318
+ if (temp) {
5319
+ title.push(temp);
5320
+ }
5321
+ return title;
5322
+ }
5323
+
5324
+ const SettingRow = ({ title: settingTitle, element, search, }) => {
5325
+ return (React__default.createElement("div", { className: b$b('section-item') }, React__default.cloneElement(element, Object.assign(Object.assign({}, element.props), { highlightedTitle: search && settingTitle ? prepareTitle(settingTitle, search) : settingTitle }))));
5326
+ };
5327
+ SettingRow.displayName = 'SettingRow';
5328
+
5329
+ const SettingsSection = React__default.forwardRef((_a, ref) => {
5330
+ var { search, isMobile, isSelected } = _a, section = __rest(_a, ["search", "isMobile", "isSelected"]);
5331
+ const { renderSectionRightAdornment, showRightAdornmentOnHover } = useSettingsContext();
5332
+ return (React__default.createElement("div", { className: b$b('section', { selected: isSelected }), ref: isSelected ? ref : undefined },
5333
+ section.title && !section.hideTitle && (React__default.createElement("h3", { className: b$b('section-heading') }, renderSectionRightAdornment ? (React__default.createElement(Flex, { gap: 2, alignItems: 'center' },
5334
+ section.title,
5335
+ React__default.createElement("div", { className: b$b('section-right-adornment', {
5336
+ hidden: showRightAdornmentOnHover,
5337
+ }) }, renderSectionRightAdornment(section)))) : (section.title))),
5338
+ section.header &&
5339
+ (isMobile ? (React__default.createElement("div", { className: b$b('section-subheader') }, section.header)) : (section.header)),
5340
+ section.items.map((setting) => setting.hidden ? null : (React__default.createElement(SettingRow, Object.assign({}, setting, { key: setting.title, search: search }))))));
5341
+ });
5342
+ SettingsSection.displayName = 'SettingsSection';
5343
+
5344
+ const getPageTitleById = (menu, activePage) => {
5345
+ for (const firstLevel of menu) {
5346
+ if ('groupTitle' in firstLevel) {
5347
+ for (const secondLevel of firstLevel.items)
5348
+ if (secondLevel.id === activePage)
5349
+ return secondLevel.title;
5350
+ }
5351
+ else if (firstLevel.id === activePage)
5352
+ return firstLevel.title;
5353
+ }
5354
+ return '';
5355
+ };
5356
+
5357
+ const SettingsPageComponent = ({ menu, pages, selected, isMobile, search, page, renderNotFound, emptyPlaceholder, onClose, }) => {
5358
+ if (!page) {
5359
+ return typeof renderNotFound === 'function' ? (React__default.createElement(React__default.Fragment, null, renderNotFound())) : (React__default.createElement("div", { className: b$b('not-found') }, emptyPlaceholder));
5360
+ }
5361
+ const filteredSections = pages[page].sections.filter((section) => !section.hidden);
5362
+ return (React__default.createElement(React__default.Fragment, null,
5363
+ !isMobile && (React__default.createElement(Title, { hasSeparator: true, onClose: onClose }, getPageTitleById(menu, page))),
5364
+ React__default.createElement("div", { className: b$b('content') }, filteredSections.map((section) => {
5365
+ const isSelected = isSectionSelected(selected, page, section);
5366
+ return (React__default.createElement(SettingsSection, Object.assign({ isSelected: isSelected, isMobile: isMobile, search: search }, section, { key: section.title })));
5367
+ }))));
5368
+ };
5369
+
5370
+ const b$a = block('settings-search');
5295
5371
  function SettingsSearch({ className, initialValue, onChange, debounce = 200, inputRef, inputSize, placeholder, autoFocus = true, selection, }) {
5296
5372
  const [value, setValue] = React__default.useState(initialValue !== null && initialValue !== undefined ? initialValue : '');
5297
5373
  const onChangeDebounced = debounceFn(onChange, debounce);
@@ -5308,7 +5384,7 @@ function SettingsSearch({ className, initialValue, onChange, debounce = 200, inp
5308
5384
  // Remove any search, if selection is passed
5309
5385
  // eslint-disable-next-line react-hooks/exhaustive-deps
5310
5386
  }, [selection]);
5311
- return (React__default.createElement("div", { className: b$b(null, className) },
5387
+ return (React__default.createElement("div", { className: b$a(null, className) },
5312
5388
  React__default.createElement(TextInput, { value: value, controlRef: inputRef, hasClear: true, autoFocus: autoFocus, size: inputSize, placeholder: placeholder, onUpdate: handleUpdate, controlProps: {
5313
5389
  'aria-label': i18n$1('label_search'),
5314
5390
  } })));
@@ -5317,32 +5393,16 @@ function SettingsSearch({ className, initialValue, onChange, debounce = 200, inp
5317
5393
  var css_248z$a = ".gn-settings{display:grid;grid-template-columns:216px 1fr;height:100%;width:834px}.gn-settings_view_mobile{display:block;height:calc(80vh - 56px);overflow-x:hidden;width:auto}@supports (height:90dvh){.gn-settings_view_mobile{height:calc(90dvh - 56px)}}.gn-settings_view_mobile.gn-settings_loading{text-align:center}.gn-settings_view_mobile .gn-settings__loader{margin-top:20px}.gn-settings_view_mobile .gn-settings__search{margin:4px 0 16px;padding:0 20px}.gn-settings_view_mobile .gn-settings__page{overflow-y:visible}.gn-settings_view_mobile .gn-settings__tabs .g-tabs__item:first-child{margin-left:20px}.gn-settings_view_mobile .gn-settings__tabs .g-tabs__item:last-child{margin-right:20px}.gn-settings_view_mobile .gn-settings__section-heading{font-family:var(--g-text-subheader-font-family);font-size:var(--g-text-subheader-3-font-size);font-weight:var(--g-text-subheader-font-weight);line-height:var(--g-text-subheader-3-line-height)}.gn-settings_view_mobile .gn-settings__section-subheader{color:var(--g-color-text-secondary)}.gn-settings_view_mobile .gn-settings__section-heading+.gn-settings-subheader{margin-top:8px}.gn-settings_view_mobile .gn-settings__section-item{margin-top:0}.gn-settings_view_mobile .gn-settings__section-heading+.gn-settings__section-item,.gn-settings_view_mobile .gn-settings__section-subheader+.gn-settings__section-item{margin-top:30px}.gn-settings_view_mobile .gn-settings__section-item+.gn-settings__section-item{margin-top:22px}.gn-settings_view_mobile .gn-settings__item:not(.gn-settings_view_mobile .gn-settings__item_mode_row){gap:8px;grid-template-columns:1fr}.gn-settings_view_mobile .gn-settings__item-heading{font-family:var(--g-text-body-font-family);font-size:var(--g-text-body-2-font-size);font-weight:var(--g-text-body-font-weight);line-height:var(--g-text-body-2-line-height)}.gn-settings_view_mobile .gn-settings__item-description{font-family:var(--g-text-body-font-family);font-size:var(--g-text-body-1-font-size);font-weight:var(--g-text-body-font-weight);line-height:var(--g-text-body-1-line-height)}.gn-settings_view_mobile .gn-settings__item_mode_row{grid-template-columns:1fr auto}.gn-settings_view_mobile .gn-settings__item_mode_row .gn-settings__item-heading{padding-right:20px}.gn-settings_view_mobile .gn-settings__item-content{width:100%}.gn-settings_view_mobile .gn-settings__not-found{color:var(--g-color-text-hint);font-family:var(--g-text-body-font-family);font-size:var(--g-text-body-2-font-size);font-weight:var(--g-text-body-font-weight);justify-items:start;line-height:var(--g-text-body-2-line-height);margin:20px 0 0 20px}.gn-settings_loading{grid-template-columns:auto}.gn-settings__loader{place-self:center}.gn-settings__not-found{display:grid;height:100%;place-items:center}.gn-settings__menu{border-right:1px solid var(--g-color-line-generic)}.gn-settings__heading{font-family:var(--g-text-subheader-font-family);font-size:var(--g-text-subheader-2-font-size);font-weight:var(--g-text-subheader-font-weight);line-height:var(--g-text-subheader-2-line-height);margin:20px 20px 0}.gn-settings__search{margin:0 20px 16px}.gn-settings__page{overflow-y:auto}.gn-settings__content{padding:20px}.gn-settings__section-right-adornment_hidden{opacity:0;transition:opacity .2s}.gn-settings__section-heading:hover .gn-settings__section-right-adornment_hidden{opacity:1}.gn-settings__section-heading{font-family:var(--g-text-subheader-font-family);font-size:var(--g-text-subheader-2-font-size);font-weight:var(--g-text-subheader-font-weight);line-height:var(--g-text-subheader-2-line-height);margin:0}.gn-settings__section-item{margin-top:24px}.gn-settings__section+.gn-settings__section{margin-top:32px}.gn-settings__section:only-child .gn-settings__section-item:first-of-type{margin-top:0}.gn-settings__section:only-child .gn-settings__section-heading{display:none}.gn-settings__item{display:grid;grid-template-columns:216px 1fr;justify-items:start}.gn-settings__item_align_top{align-items:start}.gn-settings__item_align_center{align-items:center}.gn-settings__item-title_badge{position:relative}.gn-settings__item-title_badge:after{background-color:var(--g-color-text-danger);border-radius:50%;content:\"\";display:block;height:6px;position:absolute;right:-8px;top:1px;width:6px}.gn-settings__item-description{color:var(--g-color-text-secondary);display:block;font-family:var(--g-text-caption-font-family);font-size:var(--g-text-caption-2-font-size);font-weight:var(--g-text-caption-font-weight);line-height:var(--g-text-caption-2-line-height);margin-top:2px;padding-right:20px}.gn-settings__item-right-adornment_hidden{opacity:0;transition:opacity .2s}.gn-settings__item:hover .gn-settings__item-right-adornment_hidden{opacity:1}.gn-settings__item_selected,.gn-settings__section_selected{background:var(--g-color-base-selection);border-radius:8px;margin-left:-8px;padding:8px}.gn-settings__found{background:var(--g-color-base-selection);font-weight:var(--g-text-accent-font-weight)}";
5318
5394
  styleInject(css_248z$a);
5319
5395
 
5320
- const b$a = block('settings');
5321
- const SettingsContext = React__default.createContext({});
5322
- const useSettingsContext = () => React__default.useContext(SettingsContext);
5323
5396
  function Settings(_a) {
5324
5397
  var { loading, renderLoading, children, view = 'normal', renderRightAdornment, renderSectionRightAdornment, showRightAdornmentOnHover = true } = _a, props = __rest(_a, ["loading", "renderLoading", "children", "view", "renderRightAdornment", "renderSectionRightAdornment", "showRightAdornmentOnHover"]);
5325
5398
  if (loading) {
5326
- return (React__default.createElement("div", { className: b$a({ loading: true, view }) }, typeof renderLoading === 'function' ? (renderLoading()) : (React__default.createElement(Loader, { className: b$a('loader'), size: "m" }))));
5399
+ return (React__default.createElement("div", { className: b$b({ loading: true, view }) }, typeof renderLoading === 'function' ? (renderLoading()) : (React__default.createElement(Loader, { className: b$b('loader'), size: "m" }))));
5327
5400
  }
5328
5401
  return (React__default.createElement(SettingsContext.Provider, { value: { renderRightAdornment, renderSectionRightAdornment, showRightAdornmentOnHover } },
5329
5402
  React__default.createElement(SettingsContent, Object.assign({ view: view }, props), children)));
5330
5403
  }
5331
- const getPageTitleById = (menu, activePage) => {
5332
- for (const firstLevel of menu) {
5333
- if ('groupTitle' in firstLevel) {
5334
- for (const secondLevel of firstLevel.items)
5335
- if (secondLevel.id === activePage)
5336
- return secondLevel.title;
5337
- }
5338
- else if (firstLevel.id === activePage)
5339
- return firstLevel.title;
5340
- }
5341
- return '';
5342
- };
5343
5404
  function SettingsContent({ initialPage, initialSearch, selection, children, renderNotFound, title = i18n$1('label_title'), filterPlaceholder = i18n$1('label_filter-placeholder'), emptyPlaceholder = i18n$1('label_empty-placeholder'), view, onPageChange, onClose, }) {
5344
5405
  var _a;
5345
- const { renderSectionRightAdornment, showRightAdornmentOnHover } = useSettingsContext();
5346
5406
  const [search, setSearch] = React__default.useState(initialSearch !== null && initialSearch !== undefined ? initialSearch : '');
5347
5407
  const { menu, pages } = getSettingsFromChildren(children, search);
5348
5408
  const selected = useSettingsSelectionProviderValue(pages, selection);
@@ -5399,35 +5459,11 @@ function SettingsContent({ initialPage, initialSearch, selection, children, rend
5399
5459
  selected.selectedRef.current.scrollIntoView();
5400
5460
  }
5401
5461
  }, [selected.selectedRef]);
5402
- const renderSetting = ({ title: settingTitle, element }) => {
5403
- return (React__default.createElement("div", { key: settingTitle, className: b$a('section-item') }, React__default.cloneElement(element, Object.assign(Object.assign({}, element.props), { highlightedTitle: search && settingTitle ? prepareTitle(settingTitle, search) : settingTitle }))));
5404
- };
5405
- const renderSection = (page, section) => {
5406
- const isSelected = isSectionSelected(selected, page, section);
5407
- return (React__default.createElement("div", { key: section.title, className: b$a('section', { selected: isSelected }), ref: isSelected ? selected.selectedRef : undefined },
5408
- section.title && !section.hideTitle && (React__default.createElement("h3", { className: b$a('section-heading') }, renderSectionRightAdornment ? (React__default.createElement(Flex, { gap: 2, alignItems: 'center' },
5409
- section.title,
5410
- React__default.createElement("div", { className: b$a('section-right-adornment', {
5411
- hidden: showRightAdornmentOnHover,
5412
- }) }, renderSectionRightAdornment(section)))) : (section.title))),
5413
- section.header &&
5414
- (isMobile ? (React__default.createElement("div", { className: b$a('section-subheader') }, section.header)) : (section.header)),
5415
- section.items.map((setting) => (setting.hidden ? null : renderSetting(setting)))));
5416
- };
5417
- const renderPageContent = (page) => {
5418
- if (!page) {
5419
- return typeof renderNotFound === 'function' ? (renderNotFound()) : (React__default.createElement("div", { className: b$a('not-found') }, emptyPlaceholder));
5420
- }
5421
- const filteredSections = pages[page].sections.filter((section) => !section.hidden);
5422
- return (React__default.createElement(React__default.Fragment, null,
5423
- !isMobile && (React__default.createElement(Title, { hasSeparator: true, onClose: onClose }, getPageTitleById(menu, page))),
5424
- React__default.createElement("div", { className: b$a('content') }, filteredSections.map((section) => renderSection(page, section)))));
5425
- };
5426
5462
  return (React__default.createElement(SettingsSelectionContextProvider, { value: selected },
5427
- React__default.createElement("div", { className: b$a({ view }) },
5463
+ React__default.createElement("div", { className: b$b({ view }) },
5428
5464
  isMobile ? (React__default.createElement(React__default.Fragment, null,
5429
- React__default.createElement(SettingsSearch, { inputRef: searchInputRef, className: b$a('search'), initialValue: initialSearch, selection: selection, onChange: setSearch, autoFocus: false, inputSize: 'xl' }),
5430
- React__default.createElement(SettingsMenuMobile, { items: menu, onChange: handlePageChange, activeItemId: activePage, className: b$a('tabs') }))) : (React__default.createElement("div", { className: b$a('menu'), onClick: () => {
5465
+ React__default.createElement(SettingsSearch, { inputRef: searchInputRef, className: b$b('search'), initialValue: initialSearch, selection: selection, onChange: setSearch, autoFocus: false, inputSize: 'xl' }),
5466
+ React__default.createElement(SettingsMenuMobile, { items: menu, onChange: handlePageChange, activeItemId: activePage, className: b$b('tabs') }))) : (React__default.createElement("div", { className: b$b('menu'), onClick: () => {
5431
5467
  if (searchInputRef.current) {
5432
5468
  searchInputRef.current.focus();
5433
5469
  }
@@ -5439,9 +5475,10 @@ function SettingsContent({ initialPage, initialSearch, selection, children, rend
5439
5475
  }
5440
5476
  } },
5441
5477
  React__default.createElement(Title, null, title),
5442
- React__default.createElement(SettingsSearch, { inputRef: searchInputRef, className: b$a('search'), initialValue: initialSearch, selection: selection, onChange: setSearch, placeholder: filterPlaceholder, autoFocus: true }),
5478
+ React__default.createElement(SettingsSearch, { inputRef: searchInputRef, className: b$b('search'), initialValue: initialSearch, selection: selection, onChange: setSearch, placeholder: filterPlaceholder, autoFocus: true }),
5443
5479
  React__default.createElement(SettingsMenu, { ref: menuRef, items: menu, onChange: handlePageChange, activeItemId: activePage }))),
5444
- React__default.createElement("div", { className: b$a('page') }, renderPageContent(activePage)))));
5480
+ React__default.createElement("div", { className: b$b('page') },
5481
+ React__default.createElement(SettingsPageComponent, { menu: menu, pages: pages, selected: selected, search: search, isMobile: isMobile, page: activePage, emptyPlaceholder: emptyPlaceholder, renderNotFound: renderNotFound, onClose: onClose })))));
5445
5482
  }
5446
5483
  Settings.Group = function SettingsGroup({ children }) {
5447
5484
  return React__default.createElement(React__default.Fragment, null, children);
@@ -5457,40 +5494,17 @@ Settings.Item = function SettingsItem(setting) {
5457
5494
  const selected = useSettingsSelectionContext();
5458
5495
  const isSettingSelected = selected.setting && selected.setting.id === id;
5459
5496
  const { renderRightAdornment, showRightAdornmentOnHover } = useSettingsContext();
5460
- const titleNode = (React__default.createElement("span", { className: b$a('item-title', { badge: withBadge }) }, renderTitleComponent(highlightedTitle)));
5461
- return (React__default.createElement("div", { className: b$a('item', { align, mode, selected: isSettingSelected }), ref: isSettingSelected ? selected.selectedRef : undefined },
5462
- React__default.createElement("label", { className: b$a('item-heading'), id: labelId },
5463
- renderRightAdornment ? (React__default.createElement(Flex, { className: b$a('item-title-wrapper'), gap: 3 },
5497
+ const titleNode = (React__default.createElement("span", { className: b$b('item-title', { badge: withBadge }) }, renderTitleComponent(highlightedTitle)));
5498
+ return (React__default.createElement("div", { className: b$b('item', { align, mode, selected: isSettingSelected }), ref: isSettingSelected ? selected.selectedRef : undefined },
5499
+ React__default.createElement("label", { className: b$b('item-heading'), id: labelId },
5500
+ renderRightAdornment ? (React__default.createElement(Flex, { className: b$b('item-title-wrapper'), gap: 3 },
5464
5501
  titleNode,
5465
- React__default.createElement("div", { className: b$a('item-right-adornment', {
5502
+ React__default.createElement("div", { className: b$b('item-right-adornment', {
5466
5503
  hidden: showRightAdornmentOnHover,
5467
5504
  }) }, renderRightAdornment(setting)))) : (titleNode),
5468
- description ? React__default.createElement("span", { className: b$a('item-description') }, description) : null),
5469
- React__default.createElement("div", { className: b$a('item-content') }, children)));
5505
+ description ? React__default.createElement("span", { className: b$b('item-description') }, description) : null),
5506
+ React__default.createElement("div", { className: b$b('item-content') }, children)));
5470
5507
  };
5471
- function prepareTitle(string, search) {
5472
- let temp = string.slice(0);
5473
- const title = [];
5474
- const parts = escapeStringForRegExp(search).split(' ').filter(Boolean);
5475
- let key = 0;
5476
- for (const part of parts) {
5477
- const regex = new RegExp(part, 'ig');
5478
- const match = regex.exec(temp);
5479
- if (match) {
5480
- const m = match[0];
5481
- const i = match.index;
5482
- if (i > 0) {
5483
- title.push(temp.slice(0, i));
5484
- }
5485
- title.push(React__default.createElement("strong", { key: key++, className: b$a('found') }, m));
5486
- temp = temp.slice(i + m.length);
5487
- }
5488
- }
5489
- if (temp) {
5490
- title.push(temp);
5491
- }
5492
- return title;
5493
- }
5494
5508
 
5495
5509
  const useForwardRef = (ref, initialValue = null) => {
5496
5510
  const targetRef = React__default.useRef(initialValue);
@@ -5669,7 +5683,7 @@ const OverlapPanel = ({ title, renderContent, className, onClose, action, closeT
5669
5683
  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}";
5670
5684
  styleInject(css_248z$4);
5671
5685
 
5672
- const TopAlert = React__default.lazy(() => import('./index-DLKE2e2V.js').then((module) => ({ default: module.TopAlert })));
5686
+ const TopAlert = React__default.lazy(() => import('./index-BwxN_FEJ.js').then((module) => ({ default: module.TopAlert })));
5673
5687
  const b$4 = block('mobile-header');
5674
5688
  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) => {
5675
5689
  const targetRef = useForwardRef(ref);
@@ -5962,5 +5976,5 @@ const MobileFooter = ({ className, menuItems: providedMenuItems, withDivider, mo
5962
5976
  React__default.createElement(Logo, Object.assign({}, logo)))))));
5963
5977
  };
5964
5978
 
5965
- 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 };
5966
- //# sourceMappingURL=index-CD_HaUpp.js.map
5979
+ 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, useSettingsContext as h, useSettingsSelectionContext 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 };
5980
+ //# sourceMappingURL=index-f1GutIB3.js.map