@skbkontur/side-menu 5.0.0-alpha.4 → 5.0.0-beta.1

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 (55) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +2 -2
  3. package/internal/themes/SideMenuDarkTheme.js +7 -6
  4. package/internal/themes/SideMenuTheme.d.ts +16 -0
  5. package/internal/themes/SideMenuTheme.js +38 -8
  6. package/lib/theming/ThemeHelpers.js +4 -0
  7. package/package.json +7 -7
  8. package/src/SideMenu/SideMenu.d.ts +1 -0
  9. package/src/SideMenu/SideMenu.js +29 -34
  10. package/src/SideMenu/SideMenu.styles.d.ts +4 -5
  11. package/src/SideMenu/SideMenu.styles.js +26 -36
  12. package/src/SideMenuBody/SideMenuBody.js +2 -1
  13. package/src/SideMenuBody/SideMenuBody.styles.js +1 -2
  14. package/src/SideMenuContext.d.ts +1 -8
  15. package/src/SideMenuDivider/SideMenuDivider.js +4 -2
  16. package/src/SideMenuDivider/SideMenuDivider.styles.d.ts +1 -0
  17. package/src/SideMenuDivider/SideMenuDivider.styles.js +6 -3
  18. package/src/SideMenuDropdown/SideMenuDropdown.js +7 -7
  19. package/src/SideMenuDropdown/SideMenuDropdown.styles.d.ts +0 -1
  20. package/src/SideMenuDropdown/SideMenuDropdown.styles.js +4 -8
  21. package/src/SideMenuFooter/SideMenuFooter.js +6 -29
  22. package/src/SideMenuFooter/SideMenuFooter.styles.js +3 -4
  23. package/src/SideMenuHeader/SideMenuHeader.js +4 -1
  24. package/src/SideMenuHeader/SideMenuHeader.styles.d.ts +2 -0
  25. package/src/SideMenuHeader/SideMenuHeader.styles.js +12 -5
  26. package/src/SideMenuNotifications/BellWidget.js +13 -6
  27. package/src/SideMenuNotifications/BellWidgetError.js +6 -3
  28. package/src/SideMenuNotifications/BellWidgetView.styles.d.ts +7 -4
  29. package/src/SideMenuNotifications/BellWidgetView.styles.js +20 -9
  30. package/src/SideMenuNotifications/utils/getWrapperHeightClass.d.ts +11 -0
  31. package/src/SideMenuNotifications/utils/getWrapperHeightClass.js +10 -0
  32. package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.js +1 -0
  33. package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.styles.d.ts +1 -0
  34. package/src/SideMenuSubItemHeader/SideMenuSubItemHeader.styles.js +5 -2
  35. package/src/internal/ClickableElement.d.ts +3 -1
  36. package/src/internal/ClickableElement.js +35 -36
  37. package/src/internal/InnerSubMenu.js +4 -0
  38. package/src/internal/ItemContent/Caption.js +4 -4
  39. package/src/internal/ItemContent/Caption.styles.d.ts +2 -0
  40. package/src/internal/ItemContent/Caption.styles.js +14 -8
  41. package/src/internal/ItemContent/Icon.js +1 -0
  42. package/src/internal/ItemContent/Icon.styles.d.ts +1 -0
  43. package/src/internal/ItemContent/Icon.styles.js +13 -10
  44. package/src/internal/ItemContent/ItemContent.js +26 -5
  45. package/src/internal/ItemContent/ItemContent.styles.d.ts +0 -1
  46. package/src/internal/ItemContent/ItemContent.styles.js +2 -6
  47. package/src/internal/ItemContent/Marker.js +1 -1
  48. package/src/internal/NarrowAccordionDropdown.d.ts +1 -2
  49. package/src/internal/NarrowAccordionDropdown.js +9 -14
  50. package/src/internal/SideMenuLogotype.js +29 -3
  51. package/src/internal/SideMenuLogotype.styles.d.ts +2 -0
  52. package/src/internal/SideMenuLogotype.styles.js +13 -6
  53. package/src/internal/subMenuItems.d.ts +3 -0
  54. package/src/internal/subMenuItems.js +43 -0
  55. package/src/state/reducer.js +46 -26
@@ -14,8 +14,9 @@ var SideMenuBodyInner = forwardRef(function (_a, ref) {
14
14
  var sideMenuStyles = useStyles(getSideMenuStyles);
15
15
  var styles = useStyles(getStyles);
16
16
  var cx = useEmotion().cx;
17
+ var isTabletOrMobile = context.isTablet || context.isMobile;
17
18
  return (React.createElement("div", { ref: ref, className: cx(styles.root(theme), (_b = {},
18
- _b[sideMenuStyles.hidden()] = !context.isOpened && (context.isMobile || context.isTablet),
19
+ _b[sideMenuStyles.hidden()] = !context.isOpened && isTabletOrMobile,
19
20
  _b[sideMenuStyles.itemsContainerCollapsed(theme)] = !context.isOpened,
20
21
  _b[sideMenuStyles.itemsContainerCollapsedLarge(theme)] = !context.isOpened && context.size === 'large',
21
22
  _b)) },
@@ -1,11 +1,10 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
2
  import { memoizeGetStyles } from '../../lib/theming/ThemeHelpers.js';
3
- import { transitionDuration } from '../SideMenu/SideMenu.js';
4
3
  export var getStyles = memoizeGetStyles(function (_a) {
5
4
  var css = _a.css;
6
5
  return ({
7
6
  root: function (t) {
8
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n margin: 0 ", ";\n min-height: 100%;\n transition: margin ", "ms ease-out;\n "], ["\n flex-grow: 1;\n margin: 0 ", ";\n min-height: 100%;\n transition: margin ", "ms ease-out;\n "])), t.sideMenuItemsMarginX, transitionDuration);
7
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n margin: 0 ", ";\n min-height: 100%;\n "], ["\n flex-grow: 1;\n margin: 0 ", ";\n min-height: 100%;\n "])), t.sideMenuItemsMarginX);
9
8
  },
10
9
  wrapper: function (t) {
11
10
  return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-bottom: ", ";\n "], ["\n padding-bottom: ", ";\n "])), t.sideMenuBodyPaddingBottom);
@@ -1,5 +1,5 @@
1
1
  import type { ScrollContainerScrollStateY } from '@skbkontur/react-ui/components/ScrollContainer';
2
- import type { MutableRefObject, RefObject } from 'react';
2
+ import type { RefObject } from 'react';
3
3
  import type { showScrollBarType } from './SideMenu/SideMenu.js';
4
4
  import { type Action, type SideMenuState } from './state/types.js';
5
5
  export interface SideMenuContextType {
@@ -37,12 +37,5 @@ export interface SideMenuContextType {
37
37
  openDropdownCount?: number;
38
38
  currentItemNestingLevel?: number;
39
39
  closeParentDropdown?: () => void;
40
- /**
41
- * A mutable counter reset to 0 on each parent render and incremented by each child during
42
- * its `useState` initializer. Produces a stable, position-based index so generated ids
43
- * survive unmount → re-mount (e.g. narrow accordion dropdown closing → inline submenu
44
- * opening) without explicit `id` props.
45
- */
46
- childIdCounterRef?: MutableRefObject<number>;
47
40
  }
48
41
  export declare const SideMenuContext: import("react").Context<SideMenuContextType>;
@@ -14,11 +14,13 @@ var SideMenuDividerInner = forwardRef(function (_a, ref) {
14
14
  var context = useContext(SideMenuContext);
15
15
  var isLarge = context.size === 'large';
16
16
  var isSubItem = !!context.currentItemNestingLevel && !context.isSeparatedMenu;
17
+ var isInSeparatedSubMenu = !!context.currentItemNestingLevel && !!context.isSeparatedMenu;
17
18
  return (React.createElement("hr", __assign({ className: cx(styles.root(theme), (_b = {},
18
- _b[styles.rootOpened(theme)] = context.isOpened,
19
+ _b[styles.rootOpened(theme)] = context.isOpened && !isInSeparatedSubMenu,
19
20
  _b[styles.rootSubItem(theme)] = context.isOpened && isSubItem,
20
- _b[styles.rootWithoutItemIcons(theme)] = context.isOpened && !isSubItem && !context.hasItemIcons,
21
+ _b[styles.rootWithoutItemIcons(theme)] = context.isOpened && !context.currentItemNestingLevel && !context.hasItemIcons,
21
22
  _b[styles.rootSubItemWithoutItemIcons(theme)] = context.isOpened && isSubItem && !context.hasItemIcons,
23
+ _b[styles.rootInSeparatedSubMenu(theme)] = isInSeparatedSubMenu,
22
24
  _b[styles.rootLarge(theme)] = isLarge,
23
25
  _b), className), ref: ref }, rest)));
24
26
  });
@@ -5,5 +5,6 @@ export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").Styl
5
5
  rootSubItem(t: SideMenuTheme): string;
6
6
  rootWithoutItemIcons(t: SideMenuTheme): string;
7
7
  rootSubItemWithoutItemIcons(t: SideMenuTheme): string;
8
+ rootInSeparatedSubMenu(t: SideMenuTheme): string;
8
9
  rootLarge(t: SideMenuTheme): string;
9
10
  }>;
@@ -4,7 +4,7 @@ export var getStyles = memoizeGetStyles(function (_a) {
4
4
  var css = _a.css;
5
5
  return ({
6
6
  root: function (t) {
7
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 1px;\n border: none;\n background: ", ";\n margin: ", " ", " ", ";\n "], ["\n height: 1px;\n border: none;\n background: ", ";\n margin: ", " ", " ", ";\n "])), t.sideMenuDividerBg, t.sideMenuDividerMarginTop, t.sideMenuDividerMarginX, t.sideMenuDividerMarginBottom);
7
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 0;\n border: none;\n border-top: 1px solid ", ";\n margin: ", " ", " ", ";\n "], ["\n height: 0;\n border: none;\n border-top: 1px solid ", ";\n margin: ", " ", " ", ";\n "])), t.sideMenuDividerBg, t.sideMenuDividerMarginTop, t.sideMenuDividerMarginX, t.sideMenuDividerMarginBottom);
8
8
  },
9
9
  rootOpened: function (t) {
10
10
  return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-left: ", ";\n "], ["\n margin-left: ", ";\n "])), t.sideMenuDividerMarginLeft);
@@ -18,9 +18,12 @@ export var getStyles = memoizeGetStyles(function (_a) {
18
18
  rootSubItemWithoutItemIcons: function (t) {
19
19
  return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-left: ", ";\n "], ["\n margin-left: ", ";\n "])), t.sideMenuSubItemCaptionMarginLeftWithoutIcons);
20
20
  },
21
+ rootInSeparatedSubMenu: function (t) {
22
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-left: ", ";\n "], ["\n margin-left: ", ";\n "])), t.sideMenuDividerMarginLeftInSeparatedSubMenu);
23
+ },
21
24
  rootLarge: function (t) {
22
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), t.sideMenuDividerMarginTopLarge, t.sideMenuDividerMarginBottomLarge);
25
+ return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), t.sideMenuDividerMarginTopLarge, t.sideMenuDividerMarginBottomLarge);
23
26
  },
24
27
  });
25
28
  });
26
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
29
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -8,11 +8,11 @@ import { SideMenuContext } from '../SideMenuContext.js';
8
8
  import { SideMenuItem } from '../SideMenuItem/SideMenuItem.js';
9
9
  import { getStyles } from './SideMenuDropdown.styles.js';
10
10
  var SideMenuDropdownInner = forwardRef(function (_a, ref) {
11
- var _b, _c;
11
+ var _b;
12
12
  var icon = _a.icon, id = _a.id, children = _a.children, caption = _a.caption, marker = _a.marker, subCaption = _a.subCaption, className = _a.className, menuWidth = _a.menuWidth, _isAvatar = _a._isAvatar, onClose = _a.onClose, onOpen = _a.onOpen, ariaLabel = _a["aria-label"], rest = __rest(_a, ["icon", "id", "children", "caption", "marker", "subCaption", "className", "menuWidth", "_isAvatar", "onClose", "onOpen", 'aria-label']);
13
13
  var context = useContext(SideMenuContext);
14
14
  var theme = getSideMenuTheme(useContext(ThemeContext));
15
- var _d = __read(useState(false), 2), isMenuOpen = _d[0], setIsMenuOpen = _d[1];
15
+ var _c = __read(useState(false), 2), isMenuOpen = _c[0], setIsMenuOpen = _c[1];
16
16
  var cx = useEmotion().cx;
17
17
  var styles = useStyles(getStyles);
18
18
  var dropdownChildren = useMemo(function () {
@@ -32,11 +32,11 @@ var SideMenuDropdownInner = forwardRef(function (_a, ref) {
32
32
  return child;
33
33
  });
34
34
  }, [children, context.toggleIsOpened]);
35
- return (React.createElement("li", { className: cx(styles.wrapper(), (_b = {}, _b[styles.wrapperCollapsed()] = !context.isOpened, _b), className) },
36
- React.createElement(DropdownMenu, __assign({ ref: ref, caption: React.createElement("div", { className: cx(styles.label(theme), (_c = {},
37
- _c[styles.labelTouchScreen(theme)] = context.isTouchScreen,
38
- _c[styles.labelCollapsed()] = !context.isOpened,
39
- _c)) },
35
+ return (React.createElement("li", { className: cx(styles.wrapper(), className) },
36
+ React.createElement(DropdownMenu, __assign({ ref: ref, caption: React.createElement("div", { className: cx(styles.label(theme), (_b = {},
37
+ _b[styles.labelTouchScreen(theme)] = context.isTouchScreen,
38
+ _b[styles.labelCollapsed()] = !context.isOpened,
39
+ _b)) },
40
40
  React.createElement(SideMenuItem, { "aria-label": ariaLabel, icon: icon, caption: caption, subCaption: subCaption, marker: marker, id: id, _isDropdown: true, _isDropdownOpen: isMenuOpen, _isAvatar: _isAvatar })), positions: ['top left'], disableAnimations: true, menuWidth: menuWidth, onOpen: function () {
41
41
  setIsMenuOpen(true);
42
42
  onOpen === null || onOpen === void 0 ? void 0 : onOpen();
@@ -5,5 +5,4 @@ export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").Styl
5
5
  labelCollapsed(): string;
6
6
  wrapper(): string;
7
7
  collapsedDropdownList(t: SideMenuTheme): string;
8
- wrapperCollapsed(): string;
9
8
  }>;
@@ -1,12 +1,12 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
2
  import { memoizeGetStyles } from '../../lib/theming/ThemeHelpers.js';
3
- import { transitionDuration } from '../SideMenu/SideMenu.js';
3
+ import { compactDesktopMenu } from '../SideMenu/SideMenu.styles.js';
4
4
  export var getStyles = memoizeGetStyles(function (_a) {
5
5
  var css = _a.css, injectGlobal = _a.injectGlobal;
6
6
  var _unused = injectGlobal(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n [data-tid='MenuItem']:active {\n background: rgba(0, 0, 0, 0.1) !important;\n transition: background 80ms ease-out;\n }\n "], ["\n [data-tid='MenuItem']:active {\n background: rgba(0, 0, 0, 0.1) !important;\n transition: background 80ms ease-out;\n }\n "])));
7
7
  return {
8
8
  label: function (t) {
9
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: calc(\n ", " - 2 * ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n min-width: 0;\n transition: width ", "ms ease-out;\n "], ["\n width: calc(\n ", " - 2 * ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n min-width: 0;\n transition: width ", "ms ease-out;\n "])), t.sideMenuWidth, t.sideMenuItemsMarginX, transitionDuration);
9
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: calc(\n ", " - 2 * ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n min-width: 0;\n ", "\n "], ["\n width: calc(\n ", " - 2 * ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n min-width: 0;\n ", "\n "])), t.sideMenuWidth, t.sideMenuItemsMarginX, compactDesktopMenu(t, "max-width: max(0px, calc(100cqw - 2 * ".concat(t.sideMenuItemsMarginX, " - var(--side-menu-footer-trailing-reserved-width, 0px)));")));
10
10
  },
11
11
  labelTouchScreen: function (t) {
12
12
  return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: calc(\n ", " - 2 *\n ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n "], ["\n width: calc(\n ", " - 2 *\n ", " - var(--side-menu-footer-trailing-reserved-width, 0px)\n );\n "])), t.sideMenuWidthTouchScreen, t.sideMenuItemsMarginX);
@@ -15,15 +15,11 @@ export var getStyles = memoizeGetStyles(function (_a) {
15
15
  return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 100%;\n "], ["\n width: 100%;\n "])));
16
16
  },
17
17
  wrapper: function () {
18
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n overflow-x: hidden;\n min-width: 0;\n /* \u041E\u0431\u043B\u0430\u0441\u0442\u044C \u043E\u0431\u0440\u0435\u0437\u043A\u0438 \u043D\u0430 1px \u0448\u0438\u0440\u0435 \u043F\u0443\u043D\u043A\u0442\u0430, \u0447\u0442\u043E\u0431\u044B \u043D\u0435 \u0441\u0440\u0435\u0437\u0430\u0442\u044C \u0432\u044B\u0441\u0442\u0443\u043F\u0430\u044E\u0449\u0435\u0435 \u043A\u043E\u043B\u044C\u0446\u043E \u0444\u043E\u043A\u0443\u0441\u0430 */\n padding: 1px;\n margin: -1px;\n "], ["\n overflow-x: hidden;\n min-width: 0;\n /* \u041E\u0431\u043B\u0430\u0441\u0442\u044C \u043E\u0431\u0440\u0435\u0437\u043A\u0438 \u043D\u0430 1px \u0448\u0438\u0440\u0435 \u043F\u0443\u043D\u043A\u0442\u0430, \u0447\u0442\u043E\u0431\u044B \u043D\u0435 \u0441\u0440\u0435\u0437\u0430\u0442\u044C \u0432\u044B\u0441\u0442\u0443\u043F\u0430\u044E\u0449\u0435\u0435 \u043A\u043E\u043B\u044C\u0446\u043E \u0444\u043E\u043A\u0443\u0441\u0430 */\n padding: 1px;\n margin: -1px;\n "])));
18
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n min-width: 0;\n "], ["\n min-width: 0;\n "])));
19
19
  },
20
20
  collapsedDropdownList: function (t) {
21
21
  return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n min-width: calc(", " - 8px);\n max-width: calc(", " - 8px);\n "], ["\n min-width: calc(", " - 8px);\n max-width: calc(", " - 8px);\n "])), t.sideMenuCollapsedDropdownMinWidth, t.sideMenuCollapsedDropdownMaxWidth);
22
22
  },
23
- // В свёрнутом меню подпись скрыта, а бейдж выступает за границы пункта — не обрезаем его
24
- wrapperCollapsed: function () {
25
- return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n overflow: visible;\n "], ["\n overflow: visible;\n "])));
26
- },
27
23
  };
28
24
  });
29
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
25
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -3,11 +3,10 @@ import { getDOMRect } from '@skbkontur/react-ui/lib/dom/getDOMRect';
3
3
  import { mergeRefs } from '@skbkontur/react-ui/lib/mergeRefs';
4
4
  import { useEmotion, useStyles } from '@skbkontur/react-ui/lib/renderEnvironment';
5
5
  import { ThemeContext } from '@skbkontur/react-ui/lib/theming/ThemeContext';
6
- import React, { forwardRef, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
6
+ import React, { forwardRef, useContext, useEffect, useRef, useState } from 'react';
7
7
  import { getSideMenuTheme } from '../../lib/theming/ThemeHelpers.js';
8
8
  import { flattenChildren } from '../../lib/utils/scripts.js';
9
9
  import { SideMenuDataTids } from '../../SideMenuDataTids.js';
10
- import { transitionDuration } from '../SideMenu/SideMenu.js';
11
10
  import { getStyles as getSideMenuStyles } from '../SideMenu/SideMenu.styles.js';
12
11
  import { SideMenuContext } from '../SideMenuContext.js';
13
12
  import { getStyles } from './SideMenuFooter.styles.js';
@@ -27,35 +26,13 @@ var SideMenuFooterInner = forwardRef(function (_a, ref) {
27
26
  (_a = context.setFooterHeight) === null || _a === void 0 ? void 0 : _a.call(context, getDOMRect(footerRef.current).height);
28
27
  }
29
28
  }, [children, context.isOpened, context.setFooterHeight]);
30
- // При сворачивании кнопка сворачивания переезжает из строки аватара в отдельную строку
31
- // (и обратно), из-за чего высота футера меняется скачком, а пункты футера подпрыгивают.
32
- // Футер прижат к низу меню, поэтому плавно доводим его от прежнего положения к новому.
33
- var prevHeightRef = useRef(null);
34
- useLayoutEffect(function () {
35
- var _a;
36
- var node = footerRef.current;
37
- var prevHeight = prevHeightRef.current;
38
- if (!node || prevHeight === null || typeof node.animate !== 'function') {
39
- return;
40
- }
41
- var offset = getDOMRect(node).height - prevHeight;
42
- var prefersReducedMotion = (_a = globalThis.matchMedia) === null || _a === void 0 ? void 0 : _a.call(globalThis, '(prefers-reduced-motion: reduce)').matches;
43
- if (offset && !prefersReducedMotion) {
44
- node.animate([{ transform: "translateY(".concat(offset, "px)") }, { transform: 'translateY(0)' }], {
45
- duration: transitionDuration,
46
- easing: 'ease-out',
47
- });
48
- }
49
- }, [context.isOpened]);
50
- useLayoutEffect(function () {
51
- prevHeightRef.current = footerRef.current ? getDOMRect(footerRef.current).height : null;
52
- });
53
29
  var isTabletOrMobile = context.isTablet || context.isMobile;
54
30
  var isLarge = context.size === 'large';
55
31
  var showCollapseToggle = (context.isDesktop || context.isNarrowDesktop) && !context.disableCollapsing;
56
32
  var showTrailingItem = showCollapseToggle && context.isOpened;
57
33
  var footerItems = flattenChildren(children);
58
34
  var isEmpty = footerItems.length === 0;
35
+ var useCollapsedMargins = !context.isOpened || isEmpty;
59
36
  var trailingItem = showTrailingItem ? footerItems[footerItems.length - 1] : null;
60
37
  var leadingItems = trailingItem ? footerItems.slice(0, -1) : footerItems;
61
38
  useEffect(function () {
@@ -64,11 +41,11 @@ var SideMenuFooterInner = forwardRef(function (_a, ref) {
64
41
  if (!isTabletOrMobile || context.isOpened) {
65
42
  return (React.createElement("footer", __assign({ "data-tid": SideMenuDataTids.footer, "data-visual-state-fixed": isFixed, className: cx(styles.root(theme), (_b = {},
66
43
  _b[styles.rootLarge(theme)] = isLarge,
67
- _b[sideMenuStyles.itemsContainerCollapsed(theme)] = !context.isOpened || isEmpty,
68
- _b[sideMenuStyles.itemsContainerCollapsedLarge(theme)] = (!context.isOpened || isEmpty) && isLarge,
44
+ _b[sideMenuStyles.itemsContainerCollapsed(theme)] = useCollapsedMargins,
45
+ _b[sideMenuStyles.itemsContainerCollapsedLarge(theme)] = useCollapsedMargins && isLarge,
69
46
  _b[styles.rootFixed(theme)] = isFixed,
70
- _b[styles.rootFixedCollapsed(theme)] = isFixed && !context.isOpened,
71
- _b[styles.rootFixedCollapsedLarge(theme)] = isFixed && !context.isOpened && isLarge,
47
+ _b[styles.rootFixedCollapsed(theme)] = isFixed && useCollapsedMargins,
48
+ _b[styles.rootFixedCollapsedLarge(theme)] = isFixed && useCollapsedMargins && isLarge,
72
49
  _b[styles.rootTransitionedTabletAndMobile()] = context.isBeingTransitioned && isTabletOrMobile,
73
50
  _b), className), ref: mergeRefs(footerRef, ref) }, rest),
74
51
  leadingItems.length > 0 && React.createElement("ul", { className: cx(sideMenuStyles.list(), styles.list()) }, leadingItems),
@@ -1,11 +1,10 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
2
  import { memoizeGetStyles } from '../../lib/theming/ThemeHelpers.js';
3
- import { transitionDuration } from '../SideMenu/SideMenu.js';
4
3
  export var getStyles = memoizeGetStyles(function (_a) {
5
4
  var css = _a.css;
6
5
  return ({
7
6
  root: function (t) {
8
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex-grow: 0;\n position: sticky;\n bottom: 0;\n padding-bottom: ", ";\n padding-top: ", ";\n margin: 0 ", ";\n background-color: inherit;\n transition: margin ", "ms ease-out;\n "], ["\n display: flex;\n flex-direction: column;\n flex-grow: 0;\n position: sticky;\n bottom: 0;\n padding-bottom: ", ";\n padding-top: ", ";\n margin: 0 ", ";\n background-color: inherit;\n transition: margin ", "ms ease-out;\n "])), t.sideMenuFooterPaddingBottom, t.sideMenuFooterPaddingTop, t.sideMenuItemsMarginX, transitionDuration);
7
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex-grow: 0;\n position: sticky;\n bottom: 0;\n padding-bottom: ", ";\n padding-top: ", ";\n margin: 0 ", ";\n background-color: inherit;\n "], ["\n display: flex;\n flex-direction: column;\n flex-grow: 0;\n position: sticky;\n bottom: 0;\n padding-bottom: ", ";\n padding-top: ", ";\n margin: 0 ", ";\n background-color: inherit;\n "])), t.sideMenuFooterPaddingBottom, t.sideMenuFooterPaddingTop, t.sideMenuItemsMarginX);
9
8
  },
10
9
  rootLarge: function (t) {
11
10
  return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-bottom: ", ";\n "], ["\n padding-bottom: ", ";\n "])), t.sideMenuFooterPaddingBottomLarge);
@@ -14,7 +13,7 @@ export var getStyles = memoizeGetStyles(function (_a) {
14
13
  return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-width: 0;\n "], ["\n display: flex;\n flex-direction: column;\n min-width: 0;\n "])));
15
14
  },
16
15
  trailingRow: function () {
17
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n min-width: 0;\n "], ["\n display: flex;\n align-items: center;\n min-width: 0;\n "])));
16
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n min-width: 0;\n "], ["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n min-width: 0;\n "])));
18
17
  },
19
18
  trailingItem: function (t) {
20
19
  return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n flex: 1 1 auto;\n min-width: 0;\n --side-menu-footer-trailing-reserved-width: calc(\n ", " + ", "\n );\n "], ["\n flex: 1 1 auto;\n min-width: 0;\n --side-menu-footer-trailing-reserved-width: calc(\n ", " + ", "\n );\n "])), t.sideMenuCollapseToggleSize, t.sideMenuCollapseToggleOffsetRight);
@@ -36,7 +35,7 @@ export var getStyles = memoizeGetStyles(function (_a) {
36
35
  },
37
36
  // Разделитель выравнивается по разделителю шапки, а не по краям пунктов
38
37
  rootFixed: function (t) {
39
- return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n height: 1px;\n background: ", ";\n }\n "], ["\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n height: 1px;\n background: ", ";\n }\n "])), t.sideMenuMarginX, t.sideMenuItemsMarginX, t.sideMenuMarginX, t.sideMenuItemsMarginX, t.sideMenuFooterDividerColor);
38
+ return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n border-top: 1px solid ", ";\n }\n "], ["\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n border-top: 1px solid ", ";\n }\n "])), t.sideMenuMarginX, t.sideMenuItemsMarginX, t.sideMenuMarginX, t.sideMenuItemsMarginX, t.sideMenuFooterDividerColor);
40
39
  },
41
40
  rootFixedCollapsed: function (t) {
42
41
  return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n &::before {\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n }\n "], ["\n &::before {\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n }\n "])), t.sideMenuMarginX, t.sideMenuItemsMarginXCollapsed, t.sideMenuMarginX, t.sideMenuItemsMarginXCollapsed);
@@ -16,6 +16,7 @@ var SideMenuHeaderInner = forwardRef(function (_a, ref) {
16
16
  var theme = getSideMenuTheme(useContext(ThemeContext));
17
17
  var headerWrapperRef = useRef(null);
18
18
  var isTabletOrMobile = context.isTablet || context.isMobile;
19
+ var showDivider = !!context.hasScrollBar && context.scrollState !== 'top';
19
20
  var isSeparatedMenuShown = separatedShown(context.state);
20
21
  useEffect(function () {
21
22
  var _a;
@@ -26,8 +27,10 @@ var SideMenuHeaderInner = forwardRef(function (_a, ref) {
26
27
  var styles = useStyles(getStyles);
27
28
  var cx = useEmotion().cx;
28
29
  return (React.createElement("header", { className: cx(styles.root(theme), (_b = {},
29
- _b[styles.fixedRoot(theme)] = !!context.hasScrollBar && !(context.scrollState === 'top'),
30
+ _b[styles.fixedRoot(theme)] = showDivider,
31
+ _b[styles.fixedRootTabletAndMobile(theme)] = showDivider && isTabletOrMobile,
30
32
  _b[styles.rootCollapsedDesktop(theme)] = !context.isOpened && !isTabletOrMobile,
33
+ _b[styles.rootOpeningDesktop(theme)] = context.isOpened && !isTabletOrMobile,
31
34
  _b[styles.rootTabletAndMobile(theme)] = isTabletOrMobile,
32
35
  _b[styles.rootCollapsedTabletAndMobile()] = isTabletOrMobile && !context.isOpened,
33
36
  _b[styles.rootWithSeparatedMenuShownMobile(theme)] = context.isOpened && context.isMobile && isSeparatedMenuShown,
@@ -2,8 +2,10 @@ import type { SideMenuTheme } from '../../lib/theming/ThemeTypes.js';
2
2
  export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").StylesGetter<{
3
3
  root(t: SideMenuTheme): string;
4
4
  rootCollapsedDesktop(t: SideMenuTheme): string;
5
+ rootOpeningDesktop(t: SideMenuTheme): string;
5
6
  rootTabletAndMobile(t: SideMenuTheme): string;
6
7
  rootCollapsedTabletAndMobile(): string;
7
8
  rootWithSeparatedMenuShownMobile(t: SideMenuTheme): string;
8
9
  fixedRoot(t: SideMenuTheme): string;
10
+ fixedRootTabletAndMobile(t: SideMenuTheme): string;
9
11
  }>;
@@ -1,5 +1,6 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
2
  import { memoizeGetStyles } from '../../lib/theming/ThemeHelpers.js';
3
+ import { compactDesktopMenu } from '../SideMenu/SideMenu.styles.js';
3
4
  export var getStyles = memoizeGetStyles(function (_a) {
4
5
  var css = _a.css;
5
6
  return ({
@@ -9,18 +10,24 @@ export var getStyles = memoizeGetStyles(function (_a) {
9
10
  rootCollapsedDesktop: function (t) {
10
11
  return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n "])), t.sideMenuHeaderPaddingTopCollapsed, t.sideMenuHeaderPaddingBottomCollapsed);
11
12
  },
13
+ rootOpeningDesktop: function (t) {
14
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), compactDesktopMenu(t, "padding-top: ".concat(t.sideMenuHeaderPaddingTopCollapsed, "; padding-bottom: ").concat(t.sideMenuHeaderPaddingBottomCollapsed, ";")));
15
+ },
12
16
  rootTabletAndMobile: function (t) {
13
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding-top: ", ";\n margin-left: ", ";\n "], ["\n padding-top: ", ";\n margin-left: ", ";\n "])), t.sideMenuHeaderPaddingTopTabletAndMobile, t.sideMenuHeaderMarginLeftTabletAndMobile);
17
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding-top: ", ";\n margin-left: ", ";\n "], ["\n padding-top: ", ";\n margin-left: ", ";\n "])), t.sideMenuHeaderPaddingTopTabletAndMobile, t.sideMenuHeaderMarginLeftTabletAndMobile);
14
18
  },
15
19
  rootCollapsedTabletAndMobile: function () {
16
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background: transparent;\n "], ["\n background: transparent;\n "])));
20
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: transparent;\n "], ["\n background: transparent;\n "])));
17
21
  },
18
22
  rootWithSeparatedMenuShownMobile: function (t) {
19
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: ", ";\n z-index: 9000;\n "], ["\n background: ", ";\n z-index: 9000;\n "])), t.sideMenuSeparatedSubMenuBg);
23
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: ", ";\n z-index: 9000;\n "], ["\n background: ", ";\n z-index: 9000;\n "])), t.sideMenuSeparatedSubMenuBg);
20
24
  },
21
25
  fixedRoot: function (t) {
22
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n box-shadow: 0 1px 0 ", ";\n "], ["\n box-shadow: 0 1px 0 ", ";\n "])), t.sideMenuHeaderDividerColor);
26
+ return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: -1px;\n border-top: 1px solid ", ";\n }\n "], ["\n &::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: -1px;\n border-top: 1px solid ", ";\n }\n "])), t.sideMenuHeaderDividerColor);
27
+ },
28
+ fixedRootTabletAndMobile: function (t) {
29
+ return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n &::after {\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n }\n "], ["\n &::after {\n left: calc(", " - ", ");\n right: calc(", " - ", ");\n }\n "])), t.sideMenuMarginX, t.sideMenuHeaderMarginLeftTabletAndMobile, t.sideMenuHeaderMarginLeftTabletAndMobile, t.sideMenuMarginX);
23
30
  },
24
31
  });
25
32
  });
26
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
33
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
@@ -2,7 +2,6 @@ import { __awaiter, __generator } from "tslib";
2
2
  import { IconXRegular20 } from '@skbkontur/icons/IconXRegular20';
3
3
  import { createFailure, createSuccess, isFailure } from '@skbkontur/operation-result';
4
4
  import { Button } from '@skbkontur/react-ui/components/Button/Button';
5
- import { Center } from '@skbkontur/react-ui/components/Center/Center';
6
5
  import { Spinner } from '@skbkontur/react-ui/components/Spinner/Spinner';
7
6
  import { useStyles, useEmotion } from '@skbkontur/react-ui/lib/renderEnvironment';
8
7
  import { ThemeContext } from '@skbkontur/react-ui/lib/theming/ThemeContext';
@@ -11,9 +10,11 @@ import React, { useContext } from 'react';
11
10
  import { SideMenuTheme } from '../../internal/themes/SideMenuTheme.js';
12
11
  import { getSideMenuTheme } from '../../lib/theming/ThemeHelpers.js';
13
12
  import { SideMenuDataTids } from '../../SideMenuDataTids.js';
13
+ import { SideMenuContext } from '../SideMenuContext.js';
14
14
  import { BellWidgetError } from './BellWidgetError.js';
15
15
  import { getCustomStyles, getStyles } from './BellWidgetView.styles.js';
16
16
  import { BELL_SIDE_MENU_DATA_ITEM } from './SideMenuNotifications.js';
17
+ import { getWrapperHeightClass } from './utils/getWrapperHeightClass.js';
17
18
  var getBtnTopPosition = function () {
18
19
  var _a;
19
20
  var bellDropDownItem = document.querySelector("[data-item=\"".concat(BELL_SIDE_MENU_DATA_ITEM, "\"]"));
@@ -22,6 +23,8 @@ var getBtnTopPosition = function () {
22
23
  export var BellWidget = function (props) {
23
24
  var widgetApi = props.widgetApi, onClose = props.onClose, renderErrorButton = props.renderErrorButton, renderErrorMessage = props.renderErrorMessage, onError = props.onError, redirect = props.redirect;
24
25
  var theme = getSideMenuTheme(useContext(ThemeContext));
26
+ var context = useContext(SideMenuContext);
27
+ var isMobile = Boolean(context.isMobile);
25
28
  var styles = useStyles(getStyles);
26
29
  var customStyles = useStyles(getCustomStyles);
27
30
  var cx = useEmotion().cx;
@@ -72,16 +75,20 @@ export var BellWidget = function (props) {
72
75
  var buttonCloseTheme = {
73
76
  btnBorderRadiusMedium: '20px',
74
77
  };
75
- var wrapperHeightClass = hasCustomWrapperHeight
76
- ? customStyles.customHeight(theme.sideMenuNotificationsWrapperHeight)
77
- : customStyles.defaultHeight(btnTopPosition);
78
- return (React.createElement("div", { className: cx(styles.root(), wrapperHeightClass) },
78
+ var wrapperHeightClass = getWrapperHeightClass({
79
+ hasCustomWrapperHeight: hasCustomWrapperHeight,
80
+ theme: theme,
81
+ isMobile: isMobile,
82
+ btnTopPosition: btnTopPosition,
83
+ customStyles: customStyles,
84
+ });
85
+ return (React.createElement("div", { className: cx(styles.root(), isMobile ? styles.rootMobile() : styles.rootDesktop(), wrapperHeightClass) },
79
86
  React.createElement("div", { className: styles.header(), "data-tid": SideMenuDataTids.bellHeader },
80
87
  React.createElement("span", { className: styles.headerText() }, "\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F"),
81
88
  React.createElement(Button, { use: "text", size: "medium", width: 40, icon: React.createElement(IconXRegular20, null), onClick: onClose, theme: buttonCloseTheme, "data-tid": SideMenuDataTids.bellCloseButton, "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F" })),
82
89
  React.createElement(WidgetRenderer, { renderWidget: renderWidget, renderFault: function (_a) {
83
90
  var fault = _a.fault, retryRender = _a.retryRender;
84
91
  return (React.createElement(BellWidgetError, { renderErrorButton: renderErrorButton, error: fault, renderErrorMessage: renderErrorMessage, retryRender: retryRender }));
85
- }, loader: React.createElement(Center, null,
92
+ }, loader: React.createElement("div", { className: styles.centeredContent() },
86
93
  React.createElement(Spinner, { caption: "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043C \u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F..." })) })));
87
94
  };
@@ -1,19 +1,22 @@
1
+ import * as colors from '@skbkontur/colors/tokens-default/light';
1
2
  import { EmptyState } from '@skbkontur/empty-state';
2
3
  import { IconArrowUiAuthLoginRegular64 } from '@skbkontur/icons/IconArrowUiAuthLoginRegular64';
3
4
  import { IconWarningTriangleSolid64 } from '@skbkontur/icons/IconWarningTriangleSolid64';
4
- import { Center } from '@skbkontur/react-ui/components/Center/Center';
5
+ import { useStyles } from '@skbkontur/react-ui/lib/renderEnvironment';
5
6
  import React from 'react';
7
+ import { getStyles } from './BellWidgetView.styles.js';
6
8
  import { getErrorMessages } from './utils/getNotificationsErrorMessages.js';
7
9
  export var BellWidgetError = function (_a) {
8
10
  var renderErrorButton = _a.renderErrorButton, error = _a.error, renderErrorMessage = _a.renderErrorMessage, retryRender = _a.retryRender;
11
+ var styles = useStyles(getStyles);
9
12
  if (renderErrorMessage) {
10
13
  return React.createElement(React.Fragment, null, renderErrorMessage(error, retryRender));
11
14
  }
12
15
  var isNotAuthorizedError = error.type === 'userNotAuthorized';
13
16
  var errorButton = renderErrorButton === null || renderErrorButton === void 0 ? void 0 : renderErrorButton(error, retryRender);
14
17
  var _b = getErrorMessages(isNotAuthorizedError), titleMessage = _b.titleMessage, errorMessage = _b.errorMessage;
15
- var icon = isNotAuthorizedError ? (React.createElement(IconArrowUiAuthLoginRegular64, { color: "#FCB73E" })) : (React.createElement(IconWarningTriangleSolid64, { color: "#FCB73E" }));
16
- return (React.createElement(Center, null,
18
+ var icon = isNotAuthorizedError ? (React.createElement(IconArrowUiAuthLoginRegular64, { color: colors.shapeBoldWarning })) : (React.createElement(IconWarningTriangleSolid64, { color: colors.shapeBoldWarning }));
19
+ return (React.createElement("div", { className: styles.centeredContent() },
17
20
  React.createElement(EmptyState, { use: "status" },
18
21
  React.createElement(EmptyState.Header, { icon: icon }, titleMessage),
19
22
  React.createElement(EmptyState.Body, null, errorMessage),
@@ -1,13 +1,16 @@
1
1
  import { type Emotion } from '../../lib/theming/ThemeHelpers.js';
2
2
  export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").StylesGetter<{
3
3
  root(): string;
4
+ rootMobile(): string;
5
+ rootDesktop(): string;
4
6
  widgetWrapper(): string;
7
+ centeredContent(): string;
5
8
  header(): string;
6
9
  headerText(): string;
7
10
  }>;
8
- interface CustomStyles {
9
- defaultHeight: (offsetTop: number) => string;
10
- customHeight: (value: string) => string;
11
+ export interface CustomStyles {
12
+ defaultHeightDesktop: (offsetTop: number) => string;
13
+ defaultHeightMobile: (mobilePopupHeightOffset: string) => string;
14
+ customHeight: (value?: string) => string;
11
15
  }
12
16
  export declare const getCustomStyles: ({ css }: Emotion) => CustomStyles;
13
- export {};
@@ -4,31 +4,42 @@ export var getStyles = memoizeGetStyles(function (_a) {
4
4
  var css = _a.css;
5
5
  return ({
6
6
  root: function () {
7
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-height: 400px;\n max-height: 784px;\n width: 100%;\n max-width: 100vw;\n\n @media (min-width: 768px) {\n width: 448px;\n }\n "], ["\n display: flex;\n flex-direction: column;\n min-height: 400px;\n max-height: 784px;\n width: 100%;\n max-width: 100vw;\n\n @media (min-width: 768px) {\n width: 448px;\n }\n "])));
7
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-height: 400px;\n max-height: 784px;\n max-width: 100vw;\n "], ["\n display: flex;\n flex-direction: column;\n min-height: 400px;\n max-height: 784px;\n max-width: 100vw;\n "])));
8
+ },
9
+ rootMobile: function () {
10
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n "], ["\n width: 100%;\n "])));
11
+ },
12
+ rootDesktop: function () {
13
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 448px;\n "], ["\n width: 448px;\n "])));
8
14
  },
9
15
  widgetWrapper: function () {
10
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n min-height: 0;\n flex-grow: 1;\n "], ["\n min-height: 0;\n flex-grow: 1;\n "])));
16
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n min-height: 0;\n flex-grow: 1;\n "], ["\n min-height: 0;\n flex-grow: 1;\n "])));
17
+ },
18
+ centeredContent: function () {
19
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n flex: 1;\n min-height: 0;\n overflow: auto;\n align-items: center;\n justify-content: center;\n "], ["\n display: flex;\n flex: 1;\n min-height: 0;\n overflow: auto;\n align-items: center;\n justify-content: center;\n "])));
11
20
  },
12
21
  header: function () {
13
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n padding: 6px 6px 0 20px;\n align-items: center;\n justify-content: space-between;\n "], ["\n display: flex;\n padding: 6px 6px 0 20px;\n align-items: center;\n justify-content: space-between;\n "])));
22
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n padding: 6px 6px 0 20px;\n align-items: center;\n justify-content: space-between;\n "], ["\n display: flex;\n padding: 6px 6px 0 20px;\n align-items: center;\n justify-content: space-between;\n "])));
14
23
  },
15
24
  headerText: function () {
16
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: 18px;\n line-height: 24px;\n font-weight: 700;\n "], ["\n font-size: 18px;\n line-height: 24px;\n font-weight: 700;\n "])));
25
+ return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n font-size: 18px;\n line-height: 24px;\n font-weight: 700;\n "], ["\n font-size: 18px;\n line-height: 24px;\n font-weight: 700;\n "])));
17
26
  },
18
27
  });
19
28
  });
20
29
  export var getCustomStyles = function (_a) {
21
30
  var css = _a.css;
22
31
  return ({
23
- defaultHeight: function (offsetTop) {
24
- if (offsetTop === void 0) { offsetTop = 0; }
32
+ defaultHeightDesktop: function (offsetTop) {
25
33
  var offsetBottom = '20px';
26
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: calc(100vh - ", "px - ", ");\n "], ["\n height: calc(100vh - ", "px - ", ");\n "])), offsetTop, offsetBottom);
34
+ return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n height: calc(100vh - ", "px - ", ");\n "], ["\n height: calc(100vh - ", "px - ", ");\n "])), offsetTop, offsetBottom);
35
+ },
36
+ defaultHeightMobile: function (mobilePopupHeightOffset) {
37
+ return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n height: calc(100vh - (", "));\n max-height: calc(100vh - (", "));\n\n @supports (height: 100dvh) {\n height: calc(100dvh - (", "));\n max-height: calc(100dvh - (", "));\n }\n "], ["\n height: calc(100vh - (", "));\n max-height: calc(100vh - (", "));\n\n @supports (height: 100dvh) {\n height: calc(100dvh - (", "));\n max-height: calc(100dvh - (", "));\n }\n "])), mobilePopupHeightOffset, mobilePopupHeightOffset, mobilePopupHeightOffset, mobilePopupHeightOffset);
27
38
  },
28
39
  customHeight: function (value) {
29
40
  if (value === void 0) { value = ''; }
30
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: ", ";\n "], ["\n height: ", ";\n "])), value);
41
+ return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n height: ", ";\n "], ["\n height: ", ";\n "])), value);
31
42
  },
32
43
  });
33
44
  };
34
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
45
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
@@ -0,0 +1,11 @@
1
+ import type { SideMenuTheme } from '../../../lib/theming/ThemeTypes.js';
2
+ import type { CustomStyles } from '../BellWidgetView.styles.js';
3
+ interface GetWrapperHeightClassParameters {
4
+ hasCustomWrapperHeight: boolean;
5
+ theme: SideMenuTheme;
6
+ isMobile: boolean;
7
+ btnTopPosition: number;
8
+ customStyles: CustomStyles;
9
+ }
10
+ export declare const getWrapperHeightClass: ({ hasCustomWrapperHeight, theme, isMobile, btnTopPosition, customStyles, }: GetWrapperHeightClassParameters) => string;
11
+ export {};
@@ -0,0 +1,10 @@
1
+ export var getWrapperHeightClass = function (_a) {
2
+ var hasCustomWrapperHeight = _a.hasCustomWrapperHeight, theme = _a.theme, isMobile = _a.isMobile, btnTopPosition = _a.btnTopPosition, customStyles = _a.customStyles;
3
+ if (hasCustomWrapperHeight) {
4
+ return customStyles.customHeight(theme.sideMenuNotificationsWrapperHeight);
5
+ }
6
+ if (isMobile) {
7
+ return customStyles.defaultHeightMobile(theme.sideMenuNotificationsMobilePopupHeightOffset);
8
+ }
9
+ return customStyles.defaultHeightDesktop(btnTopPosition);
10
+ };
@@ -16,6 +16,7 @@ var SideMenuSubItemHeaderInner = forwardRef(function (_a, ref) {
16
16
  _b[styles.rootWithoutItemIcons(theme)] = context.isOpened && !context.isSeparatedMenu && !context.hasItemIcons,
17
17
  _b[styles.rootInDropdown()] = !context.isOpened && !context.isSeparatedMenu,
18
18
  _b[styles.rootInSeparatedSubMenu(theme)] = context.isSeparatedMenu,
19
+ _b[styles.rootInSeparatedSubMenuLarge(theme)] = context.isSeparatedMenu && context.size === 'large',
19
20
  _b), className), ref: ref }, rest), children));
20
21
  });
21
22
  SideMenuSubItemHeaderInner.displayName = 'SideMenuSubItemHeader';
@@ -3,5 +3,6 @@ export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").Styl
3
3
  root(t: SideMenuTheme): string;
4
4
  rootWithoutItemIcons(t: SideMenuTheme): string;
5
5
  rootInDropdown(): string;
6
+ rootInSeparatedSubMenuLarge(t: SideMenuTheme): string;
6
7
  rootInSeparatedSubMenu(t: SideMenuTheme): string;
7
8
  }>;
@@ -12,9 +12,12 @@ export var getStyles = memoizeGetStyles(function (_a) {
12
12
  rootInDropdown: function () {
13
13
  return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 12px 8px 4px 8px;\n "], ["\n padding: 12px 8px 4px 8px;\n "])));
14
14
  },
15
+ rootInSeparatedSubMenuLarge: function (t) {
16
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: ", ";\n line-height: ", ";\n "], ["\n font-size: ", ";\n line-height: ", ";\n "])), t.sideMenuSubItemHeaderFontSizeLargeInSeparatedSubMenu, t.sideMenuSubItemHeaderLineHeightLargeInSeparatedSubMenu);
17
+ },
15
18
  rootInSeparatedSubMenu: function (t) {
16
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: ", ";\n line-height: 16px;\n color: ", ";\n "], ["\n padding: ", ";\n line-height: 16px;\n color: ", ";\n "])), t.sideMenuSubItemHeaderPaddingInSeparatedSubMenu, t.sideMenuSubItemHeaderColorInSeparatedSubMenu);
19
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: ", ";\n line-height: 16px;\n color: ", ";\n "], ["\n padding: ", ";\n line-height: 16px;\n color: ", ";\n "])), t.sideMenuSubItemHeaderPaddingInSeparatedSubMenu, t.sideMenuSubItemHeaderColorInSeparatedSubMenu);
17
20
  },
18
21
  });
19
22
  });
20
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
23
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -5,7 +5,7 @@ export interface CommonClickableElementProps extends CommonProps {
5
5
  children?: ReactNode;
6
6
  /** Иконка. */
7
7
  icon?: React.ReactElement;
8
- /** Визуальный маркер. */
8
+ /** Визуальный маркер. Числа больше 99 отображаются как «99+». Строки отображаются как переданы. */
9
9
  marker?: ReactNode;
10
10
  /** Заголовок элемента. */
11
11
  caption?: ReactNode;
@@ -37,6 +37,8 @@ export interface CommonClickableElementProps extends CommonProps {
37
37
  _isAvatar?: boolean;
38
38
  /** @ignore */
39
39
  _isBackButton?: boolean;
40
+ /** @ignore */
41
+ _generatedId?: string;
40
42
  }
41
43
  export interface ClickableElementProps extends CommonClickableElementProps {
42
44
  element: 'a' | 'button' | React.ComponentType<any>;