@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
package/CHANGELOG.md CHANGED
@@ -3,6 +3,38 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## Unreleased
7
+
8
+ ### BREAKING CHANGES
9
+
10
+ * **SideMenu:** numeric `marker` values greater than 99 are displayed as `99+`. Pass a string to display the full count.
11
+
12
+ # [4.1.0](/compare/@skbkontur/side-menu@4.0.10...@skbkontur/side-menu@4.1.0) (2026-11-05)
13
+
14
+
15
+ ### Features
16
+
17
+ * **side-menu:** update @skbkontur/colors to 3.0.0 2c3514a
18
+
19
+
20
+
21
+
22
+
23
+ ## [4.0.10](/compare/@skbkontur/side-menu@4.0.9...@skbkontur/side-menu@4.0.10) (2026-09-16)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **SideMenu:** fit BellWidget error layout on small screens fd17bcd
29
+ * **SideMenu:** fit BellWidget height to MobilePopup on mobile dd8c638
30
+ * **SideMenu:** show deprecation warning on sideMenuProductColor var customization a53a9b9
31
+ * **SideMenu:** use isMobile for BellWidget width 19a4233
32
+ * **SideMenu:** use shapeBoldWarning for BellWidgetError icons ee5f199
33
+
34
+
35
+
36
+
37
+
6
38
  ## [4.0.9](/compare/@skbkontur/side-menu@4.0.8...@skbkontur/side-menu@4.0.9) (2026-07-23)
7
39
 
8
40
 
package/README.md CHANGED
@@ -48,7 +48,7 @@ import { IconAttachLinkRegular24 } from '@skbkontur/icons/IconAttachLinkRegular2
48
48
  <SideMenu.SubItem caption={'Внутренние'} marker/>
49
49
  <SideMenu.SubItem caption={'Черновики'}/>
50
50
  <SideMenu.SubItem caption={'Удаленные'}/>
51
- <SideMenu.SubLink caption={'Cсылка в подменю'} href={'https://www.google.com/search?q=test'} target={'_blank'}/>
51
+ <SideMenu.SubLink caption={'Ссылка в подменю'} href={'https://www.google.com/search?q=test'} target={'_blank'}/>
52
52
  <SideMenu.SubItemHeader>Согласованные</SideMenu.SubItemHeader>
53
53
  <SideMenu.SubItem caption={'Требуют обработки'}/>
54
54
  <SideMenu.SubItem caption={'Обработанные'}/>
@@ -362,7 +362,7 @@ const items = [
362
362
  `sideMenuTabletMediaQuery = '(min-width: 768px)';`
363
363
  `sideMenuMobileMediaQuery = '(min-width: 0px)';`
364
364
 
365
- Для того чтобы пропускать брекпойнты, достаточно указать значение, равное следующему за ним брейкпойнту.
365
+ Для того чтобы пропускать брейкпойнты, достаточно указать значение, равное следующему за ним брейкпойнту.
366
366
  Например, в следующем случае у `SideMenu` не будет адаптива для планшетов:
367
367
 
368
368
  `<SideMenu tabletMediaQuery={'(min-width: 768px)'} narrowDesktopMediaQuery={'(min-width: 768px)'}/>`
@@ -9,25 +9,25 @@ var SideMenuDarkTheme = /** @class */ (function (_super) {
9
9
  }
10
10
  // #region SideMenu
11
11
  SideMenuDarkTheme.sideMenuBg = colors.surfaceLow;
12
- SideMenuDarkTheme.sideMenuBgHover = colors.shapeOtherNeutralFaintSolid;
13
- SideMenuDarkTheme.sideMenuBgPressed = colors.shapeOtherNeutralFaintSolidPressed;
12
+ SideMenuDarkTheme.sideMenuBgHover = colors.shapeFaintNeutralSolid;
13
+ SideMenuDarkTheme.sideMenuBgPressed = colors.shapeFaintNeutralSolidPressed;
14
14
  // #endregion
15
15
  // #region Divider
16
16
  SideMenuDarkTheme.sideMenuDividerBg = colors.lineNeutralFaint;
17
17
  // #endregion
18
18
  // #region Item
19
- SideMenuDarkTheme.sideMenuItemBgHover = colors.shapeOtherBacklessHover;
19
+ SideMenuDarkTheme.sideMenuItemBgHover = colors.shapeOtherBacklessAlphaHover;
20
20
  SideMenuDarkTheme.sideMenuItemBgActive = colors.shapeOtherBase;
21
21
  SideMenuDarkTheme.sideMenuItemBgActivePressed = colors.shapeOtherBasePressed;
22
- SideMenuDarkTheme.sideMenuItemBgPressed = colors.shapeOtherBacklessPressed;
22
+ SideMenuDarkTheme.sideMenuItemBgPressed = colors.shapeOtherBacklessAlphaPressed;
23
23
  SideMenuDarkTheme.sideMenuItemColor = colors.textNeutralHeavy;
24
24
  SideMenuDarkTheme.sideMenuItemColorDisabled = colors.textNeutralFaint;
25
25
  SideMenuDarkTheme.sideMenuItemBoxShadowColorFocus = colors.lineAccentBold;
26
- SideMenuDarkTheme.sideMenuSubItemWithSeparatedSubMenuBgHover = colors.shapeOtherBacklessHover;
26
+ SideMenuDarkTheme.sideMenuSubItemWithSeparatedSubMenuBgHover = colors.shapeOtherBacklessAlphaHover;
27
27
  SideMenuDarkTheme.sideMenuSubItemWithSeparatedSubMenuBgActive = colors.shapeFaintNeutralAlpha;
28
28
  SideMenuDarkTheme.sideMenuSubItemWithSeparatedSubMenuBgActiveHover = colors.shapeFaintNeutralAlphaHover;
29
29
  SideMenuDarkTheme.sideMenuSubItemWithSeparatedSubMenuBgActivePressed = colors.shapeFaintNeutralAlphaPressed;
30
- SideMenuDarkTheme.sideMenuSubItemWithSeparatedSubMenuBgPressed = colors.shapeOtherBacklessPressed;
30
+ SideMenuDarkTheme.sideMenuSubItemWithSeparatedSubMenuBgPressed = colors.shapeOtherBacklessAlphaPressed;
31
31
  // #endregion
32
32
  // #region Icon
33
33
  SideMenuDarkTheme.sideMenuIconSubItemColor = colors.textNeutralSoft;
@@ -36,6 +36,7 @@ var SideMenuDarkTheme = /** @class */ (function (_super) {
36
36
  SideMenuDarkTheme.sideMenuMarkerColor = colors.textOnBrandOriginalHeavy;
37
37
  SideMenuDarkTheme.sideMenuMarkerBg = colors.shapeBoldBrandOriginal;
38
38
  SideMenuDarkTheme.sideMenuMarkerSubItemColor = colors.textNeutralSoft;
39
+ SideMenuDarkTheme.sideMenuSubCaptionColor = colors.textNeutralSoft;
39
40
  // #endregion
40
41
  // #region SeparatedSubMenu
41
42
  SideMenuDarkTheme.sideMenuSeparatedSubMenuBg = colors.surfaceBase;
@@ -26,6 +26,7 @@ export declare class SideMenuTheme extends BasicThemeClassForExtension {
26
26
  static sideMenuDividerMarginX: string;
27
27
  static get sideMenuDividerMarginLeft(): string;
28
28
  static sideMenuDividerSubItemMarginLeft: string;
29
+ static sideMenuDividerMarginLeftInSeparatedSubMenu: string;
29
30
  static sideMenuCaptionMarginLeftWithoutIcons: string;
30
31
  static sideMenuSubItemCaptionMarginLeftWithoutIcons: string;
31
32
  static sideMenuIconSubItemPaddingLeftWithoutIcons: string;
@@ -107,6 +108,12 @@ export declare class SideMenuTheme extends BasicThemeClassForExtension {
107
108
  static sideMenuCaptionFontSize: string;
108
109
  static sideMenuCaptionFontSizeLarge: string;
109
110
  static sideMenuCaptionFontSizeTouchScreen: string;
111
+ static sideMenuSubCaptionFontSize: string;
112
+ static sideMenuSubCaptionLineHeight: string;
113
+ static sideMenuSubCaptionFontSizeLarge: string;
114
+ static sideMenuSubCaptionLineHeightLarge: string;
115
+ static sideMenuSubCaptionMarginTop: string;
116
+ static sideMenuSubCaptionColor: string;
110
117
  static get sideMenuCaptionLineHeight(): string;
111
118
  static get sideMenuCaptionLineHeightLarge(): string;
112
119
  static sideMenuCaptionLineHeightTouchScreen: string;
@@ -145,6 +152,8 @@ export declare class SideMenuTheme extends BasicThemeClassForExtension {
145
152
  static sideMenuSubItemHeaderPadding: string;
146
153
  static sideMenuSubItemHeaderColorInSeparatedSubMenu: string;
147
154
  static sideMenuSubItemHeaderPaddingInSeparatedSubMenu: string;
155
+ static sideMenuSubItemHeaderFontSizeLargeInSeparatedSubMenu: string;
156
+ static sideMenuSubItemHeaderLineHeightLargeInSeparatedSubMenu: string;
148
157
  static sideMenuRightBorderWidth: string;
149
158
  static sideMenuRightBorderIconColor: string;
150
159
  static sideMenuRightBorderIconColorHover: string;
@@ -160,6 +169,13 @@ export declare class SideMenuTheme extends BasicThemeClassForExtension {
160
169
  static sideMenuNotificationsMarkerBg: string;
161
170
  /** от 400px до 784px */
162
171
  static sideMenuNotificationsWrapperHeight: string;
172
+ /**
173
+ * CSS-выражение для вычитания из 100vh на mobile (отступы MobilePopup `@skbkontur/react-ui`).
174
+ *
175
+ * Тема < 6.1: `2 * mobilePopupTopPadding`.
176
+ * Тема ≥ 6.1: `2 * mobilePopupPositionY + 2 * mobilePopupPaddingSmall` (size small).
177
+ */
178
+ static get sideMenuNotificationsMobilePopupHeightOffset(): string;
163
179
  }
164
180
  export declare const REACT_UI_SIDE_MENU_THEME_KEY = "__IS_REACT_UI_SIDE_MENU_THEME__";
165
181
  export declare const markAsSideMenuTheme: <T extends object>(theme: T) => T;
@@ -1,7 +1,7 @@
1
1
  import { __extends } from "tslib";
2
2
  import * as colors from '@skbkontur/colors/tokens-default/light';
3
3
  import { BasicThemeClassForExtension } from '@skbkontur/react-ui/internal/themes/BasicTheme';
4
- import { exposeGetters } from '@skbkontur/react-ui/lib/theming/ThemeHelpers';
4
+ import { exposeGetters, isThemeGTE } from '@skbkontur/react-ui/lib/theming/ThemeHelpers';
5
5
  import warning from 'warning';
6
6
  var SideMenuTheme = /** @class */ (function (_super) {
7
7
  __extends(SideMenuTheme, _super);
@@ -15,7 +15,7 @@ var SideMenuTheme = /** @class */ (function (_super) {
15
15
  return this._sideMenuProductColor;
16
16
  },
17
17
  set: function (value) {
18
- warning('[SideMenuTheme]: sideMenuProductColor is deprecated. Use @skbkontur/colors or theme variable `sideMenuMarkerBg` instead');
18
+ warning(false, '[SideMenuTheme]: sideMenuProductColor is deprecated. Use @skbkontur/colors or theme variable `sideMenuMarkerBg` instead');
19
19
  this._sideMenuProductColor = value;
20
20
  },
21
21
  enumerable: false,
@@ -105,6 +105,27 @@ var SideMenuTheme = /** @class */ (function (_super) {
105
105
  enumerable: false,
106
106
  configurable: true
107
107
  });
108
+ Object.defineProperty(SideMenuTheme, "sideMenuNotificationsMobilePopupHeightOffset", {
109
+ /**
110
+ * CSS-выражение для вычитания из 100vh на mobile (отступы MobilePopup `@skbkontur/react-ui`).
111
+ *
112
+ * Тема < 6.1: `2 * mobilePopupTopPadding`.
113
+ * Тема ≥ 6.1: `2 * mobilePopupPositionY + 2 * mobilePopupPaddingSmall` (size small).
114
+ */
115
+ get: function () {
116
+ var _a, _b;
117
+ if (isThemeGTE(this, '6.1')) {
118
+ var theme = this;
119
+ var positionY = (_a = theme.mobilePopupPositionY) !== null && _a !== void 0 ? _a : '16px';
120
+ var paddingSmall = (_b = theme.mobilePopupPaddingSmall) !== null && _b !== void 0 ? _b : '6px';
121
+ // Внешние скобки обязательны: иначе в `calc(100vh - A + B)` B прибавится, а не вычтется.
122
+ return "((2 * ".concat(positionY, ") + (2 * ").concat(paddingSmall, "))");
123
+ }
124
+ return "(2 * ".concat(this.mobilePopupTopPadding, ")");
125
+ },
126
+ enumerable: false,
127
+ configurable: true
128
+ });
108
129
  // #region SideMenu
109
130
  SideMenuTheme.sideMenuWidth = '232px';
110
131
  SideMenuTheme.sideMenuWidthTouchScreen = '328px';
@@ -114,8 +135,8 @@ var SideMenuTheme = /** @class */ (function (_super) {
114
135
  SideMenuTheme.sideMenuItemsMarginXCollapsed = '16px';
115
136
  SideMenuTheme.sideMenuItemsMarginXCollapsedLarge = '12px';
116
137
  SideMenuTheme.sideMenuBg = colors.surfaceLow;
117
- SideMenuTheme.sideMenuBgHover = colors.shapeOtherNeutralFaintSolid;
118
- SideMenuTheme.sideMenuBgPressed = colors.shapeOtherNeutralFaintSolidPressed;
138
+ SideMenuTheme.sideMenuBgHover = colors.shapeFaintNeutralSolid;
139
+ SideMenuTheme.sideMenuBgPressed = colors.shapeFaintNeutralSolidPressed;
119
140
  SideMenuTheme.sideMenuBoxShadow = "\n 4px 0 12px rgba(0, 0, 0, 0.08),\n 12px 0 32px rgba(0, 0, 0, 0.04),\n 16px 0 40px rgba(0, 0, 0, 0.04)\n ";
120
141
  SideMenuTheme.sideMenuLineHeight = '20px';
121
142
  SideMenuTheme.sideMenuLineHeightLarge = '22px';
@@ -128,6 +149,7 @@ var SideMenuTheme = /** @class */ (function (_super) {
128
149
  // #region Divider
129
150
  SideMenuTheme.sideMenuDividerMarginX = '8px';
130
151
  SideMenuTheme.sideMenuDividerSubItemMarginLeft = '48px';
152
+ SideMenuTheme.sideMenuDividerMarginLeftInSeparatedSubMenu = '12px';
131
153
  SideMenuTheme.sideMenuCaptionMarginLeftWithoutIcons = '20px';
132
154
  SideMenuTheme.sideMenuSubItemCaptionMarginLeftWithoutIcons = '36px';
133
155
  SideMenuTheme.sideMenuIconSubItemPaddingLeftWithoutIcons = '16px';
@@ -167,19 +189,19 @@ var SideMenuTheme = /** @class */ (function (_super) {
167
189
  SideMenuTheme.sideMenuItemBorderRadius = '8px';
168
190
  SideMenuTheme.sideMenuItemBorderRadiusLarge = '10px';
169
191
  SideMenuTheme.sideMenuItemPaddingRight = '12px';
170
- SideMenuTheme.sideMenuItemBgHover = colors.shapeOtherBacklessHover;
192
+ SideMenuTheme.sideMenuItemBgHover = colors.shapeOtherBacklessAlphaHover;
171
193
  SideMenuTheme.sideMenuItemBgActive = colors.shapeOtherBase;
172
194
  SideMenuTheme.sideMenuItemBgActivePressed = colors.shapeOtherBasePressed;
173
- SideMenuTheme.sideMenuItemBgPressed = colors.shapeOtherBacklessPressed;
195
+ SideMenuTheme.sideMenuItemBgPressed = colors.shapeOtherBacklessAlphaPressed;
174
196
  SideMenuTheme.sideMenuItemColor = colors.textNeutralHeavy;
175
197
  SideMenuTheme.sideMenuItemColorDisabled = colors.textNeutralFaint;
176
198
  SideMenuTheme.sideMenuItemBoxShadowColorFocus = colors.lineAccentBold;
177
199
  SideMenuTheme.sideMenuItemNestedPaddingLeft = '16px';
178
- SideMenuTheme.sideMenuSubItemWithSeparatedSubMenuBgHover = colors.shapeOtherBacklessHover;
200
+ SideMenuTheme.sideMenuSubItemWithSeparatedSubMenuBgHover = colors.shapeOtherBacklessAlphaHover;
179
201
  SideMenuTheme.sideMenuSubItemWithSeparatedSubMenuBgActive = colors.shapeFaintNeutralAlpha;
180
202
  SideMenuTheme.sideMenuSubItemWithSeparatedSubMenuBgActiveHover = colors.shapeFaintNeutralAlphaHover;
181
203
  SideMenuTheme.sideMenuSubItemWithSeparatedSubMenuBgActivePressed = colors.shapeFaintNeutralAlphaPressed;
182
- SideMenuTheme.sideMenuSubItemWithSeparatedSubMenuBgPressed = colors.shapeOtherBacklessPressed;
204
+ SideMenuTheme.sideMenuSubItemWithSeparatedSubMenuBgPressed = colors.shapeOtherBacklessAlphaPressed;
183
205
  // #endregion
184
206
  // #region ItemContent
185
207
  SideMenuTheme.sideMenuItemContentPaddingY = '4px';
@@ -218,6 +240,12 @@ var SideMenuTheme = /** @class */ (function (_super) {
218
240
  SideMenuTheme.sideMenuCaptionFontSize = '14px';
219
241
  SideMenuTheme.sideMenuCaptionFontSizeLarge = '16px';
220
242
  SideMenuTheme.sideMenuCaptionFontSizeTouchScreen = '18px';
243
+ SideMenuTheme.sideMenuSubCaptionFontSize = '12px';
244
+ SideMenuTheme.sideMenuSubCaptionLineHeight = '16px';
245
+ SideMenuTheme.sideMenuSubCaptionFontSizeLarge = '14px';
246
+ SideMenuTheme.sideMenuSubCaptionLineHeightLarge = '20px';
247
+ SideMenuTheme.sideMenuSubCaptionMarginTop = '2px';
248
+ SideMenuTheme.sideMenuSubCaptionColor = colors.textNeutralSoft;
221
249
  SideMenuTheme.sideMenuCaptionLineHeightTouchScreen = '24px';
222
250
  SideMenuTheme.sideMenuCaptionMultilinePaddingTop = '4px';
223
251
  SideMenuTheme.sideMenuCaptionMarginRight = '8px';
@@ -260,6 +288,8 @@ var SideMenuTheme = /** @class */ (function (_super) {
260
288
  SideMenuTheme.sideMenuSubItemHeaderPadding = '10px 8px 2px 48px';
261
289
  SideMenuTheme.sideMenuSubItemHeaderColorInSeparatedSubMenu = colors.textNeutralPale;
262
290
  SideMenuTheme.sideMenuSubItemHeaderPaddingInSeparatedSubMenu = '12px 8px 4px 12px';
291
+ SideMenuTheme.sideMenuSubItemHeaderFontSizeLargeInSeparatedSubMenu = '14px';
292
+ SideMenuTheme.sideMenuSubItemHeaderLineHeightLargeInSeparatedSubMenu = '20px';
263
293
  // #endregion
264
294
  // #region RightBorder
265
295
  SideMenuTheme.sideMenuRightBorderWidth = '16px';
@@ -1,6 +1,7 @@
1
1
  import { __values } from "tslib";
2
2
  import { isDarkTheme } from '@skbkontur/react-ui/lib/theming/ThemeHelpers';
3
3
  import { isFunction } from '@skbkontur/react-ui/lib/utils';
4
+ import warning from 'warning';
4
5
  import { SideMenuDarkThemeInternal } from '../../internal/themes/SideMenuDarkTheme.js';
5
6
  import { SideMenuThemeInternal, isSideMenuTheme, markAsSideMenuTheme } from '../../internal/themes/SideMenuTheme.js';
6
7
  import { memo } from '../utils/memo.js';
@@ -19,6 +20,9 @@ export var createSideMenuTheme = function (theme) {
19
20
  if (isSideMenuTheme(theme)) {
20
21
  return theme;
21
22
  }
23
+ if (Object.prototype.hasOwnProperty.call(theme, 'sideMenuProductColor')) {
24
+ warning(false, '[SideMenuTheme]: sideMenuProductColor is deprecated. Use @skbkontur/colors or theme variable `sideMenuMarkerBg` instead');
25
+ }
22
26
  var sideMenuTheme = Object.create(theme, Object.assign(Object.getOwnPropertyDescriptors(SideMenuThemeInternal), isDarkTheme(theme) ? Object.getOwnPropertyDescriptors(SideMenuDarkThemeInternal) : {}));
23
27
  var _loop_1 = function (key) {
24
28
  var descriptor = Object.getOwnPropertyDescriptor(sideMenuTheme, key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/side-menu",
3
- "version": "5.0.0-alpha.4",
3
+ "version": "5.0.0-beta.1",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "author": "Kontur",
@@ -25,16 +25,16 @@
25
25
  "build:lint:attw": "attw --config-path ../../.attw.json ./dist"
26
26
  },
27
27
  "dependencies": {
28
- "@skbkontur/bell-widget-npm-loader": "^0.3.0",
29
- "@skbkontur/colors": "2.1.11-d553b.0",
30
- "@skbkontur/empty-state": "^2.0.2",
31
- "@skbkontur/icons": "^2.0.0",
32
- "@skbkontur/react-ui-addons": "^6.0.6",
28
+ "@skbkontur/bell-widget-npm-loader": "^0.3.22",
29
+ "@skbkontur/colors": "^3.0.0",
30
+ "@skbkontur/empty-state": "^2.1.0",
31
+ "@skbkontur/icons": "^2.1.0",
32
+ "@skbkontur/react-ui-addons": "^6.1.0",
33
33
  "@skbkontur/widget-consumer-react-utils": "^1.6.12",
34
34
  "tslib": "^2.8.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@skbkontur/ui-cdn-components": "^2.1.0"
37
+ "@skbkontur/ui-cdn-components": "^2.1.10"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@skbkontur/react-ui": ">=6 <7",
@@ -102,6 +102,7 @@ interface SubComponents {
102
102
  __KONTUR_REACT_UI__: string;
103
103
  }
104
104
  export declare const transitionDuration = 200;
105
+ export declare const transitionEasing = "cubic-bezier(0.25, 0.25, 0.4, 1)";
105
106
  export declare const burgerTransitionDuration: number;
106
107
  export declare const SideMenu: React.ForwardRefExoticComponent<SideMenuProps & React.RefAttributes<HTMLElement>> & SubComponents;
107
108
  export {};
@@ -33,18 +33,18 @@ import { separatedShown } from '../state/selectors.js';
33
33
  import { ROOT } from '../state/types.js';
34
34
  import { getStyles, getCustomStyles } from './SideMenu.styles.js';
35
35
  export var transitionDuration = 200; //ms
36
+ export var transitionEasing = 'cubic-bezier(0.25, 0.25, 0.4, 1)';
36
37
  export var burgerTransitionDuration = (transitionDuration * 2) / 3;
37
38
  var SideMenuInner = forwardRef(function (_a, ref) {
38
- var _b, _c, _d, _e, _f;
39
- var children = _a.children, activeItem = _a.activeItem, _g = _a.size, size = _g === void 0 ? 'small' : _g, _h = _a.isSeparatedMenu, isSeparatedMenu = _h === void 0 ? false : _h, className = _a.className, _j = _a.disableCollapsing, disableCollapsing = _j === void 0 ? false : _j, desktopMediaQuery = _a.desktopMediaQuery, narrowDesktopMediaQuery = _a.narrowDesktopMediaQuery, tabletMediaQuery = _a.tabletMediaQuery, mobileMediaQuery = _a.mobileMediaQuery, _k = _a.showScrollBar, showScrollBar = _k === void 0 ? 'hover' : _k, isOpen = _a.isOpen, isPinned = _a.isPinned, onActiveItemChange = _a.onActiveItemChange, onOpen = _a.onOpen, onClose = _a.onClose, onPinnedValueChange = _a.onPinnedValueChange, rest = __rest(_a, ["children", "activeItem", "size", "isSeparatedMenu", "className", "disableCollapsing", "desktopMediaQuery", "narrowDesktopMediaQuery", "tabletMediaQuery", "mobileMediaQuery", "showScrollBar", "isOpen", "isPinned", "onActiveItemChange", "onOpen", "onClose", "onPinnedValueChange"]);
39
+ var _b, _c, _d, _e;
40
+ var children = _a.children, activeItem = _a.activeItem, _f = _a.size, size = _f === void 0 ? 'small' : _f, _g = _a.isSeparatedMenu, isSeparatedMenu = _g === void 0 ? false : _g, className = _a.className, _h = _a.disableCollapsing, disableCollapsing = _h === void 0 ? false : _h, desktopMediaQuery = _a.desktopMediaQuery, narrowDesktopMediaQuery = _a.narrowDesktopMediaQuery, tabletMediaQuery = _a.tabletMediaQuery, mobileMediaQuery = _a.mobileMediaQuery, _j = _a.showScrollBar, showScrollBar = _j === void 0 ? 'hover' : _j, isOpen = _a.isOpen, isPinned = _a.isPinned, onActiveItemChange = _a.onActiveItemChange, onOpen = _a.onOpen, onClose = _a.onClose, onPinnedValueChange = _a.onPinnedValueChange, rest = __rest(_a, ["children", "activeItem", "size", "isSeparatedMenu", "className", "disableCollapsing", "desktopMediaQuery", "narrowDesktopMediaQuery", "tabletMediaQuery", "mobileMediaQuery", "showScrollBar", "isOpen", "isPinned", "onActiveItemChange", "onOpen", "onClose", "onPinnedValueChange"]);
40
41
  var transitionTimer = useRef(null);
41
42
  var timerScrollbar = useRef(null);
42
43
  var sideMenuRef = useRef(null);
43
44
  var collapseToggleRef = useRef(null);
44
45
  var contentWrapperRef = useRef(null);
45
46
  var scrollContainerRef = useRef(null);
46
- var childIdCounterRef = useRef(0);
47
- var _l = __read(useState(0), 2), itemIconsCount = _l[0], setItemIconsCount = _l[1];
47
+ var _k = __read(useState(0), 2), itemIconsCount = _k[0], setItemIconsCount = _k[1];
48
48
  var registerItemIcon = useCallback(function () {
49
49
  setItemIconsCount(function (count) { return count + 1; });
50
50
  return function () { return setItemIconsCount(function (count) { return count - 1; }); };
@@ -60,9 +60,9 @@ var SideMenuInner = forwardRef(function (_a, ref) {
60
60
  isNarrowDesktopQuery: narrowDesktopMediaQuery || theme.sideMenuNarrowDesktopMediaQuery,
61
61
  isDesktopQuery: desktopMediaQuery || theme.sideMenuDesktopMediaQuery,
62
62
  };
63
- var _m = useResponsiveLayout({
63
+ var _l = useResponsiveLayout({
64
64
  customMediaQueries: customMediaQueries,
65
- }), isMobileQuery = _m.isMobileQuery, isTabletQuery = _m.isTabletQuery, isNarrowDesktopQuery = _m.isNarrowDesktopQuery, isDesktopQuery = _m.isDesktopQuery;
65
+ }), isMobileQuery = _l.isMobileQuery, isTabletQuery = _l.isTabletQuery, isNarrowDesktopQuery = _l.isNarrowDesktopQuery, isDesktopQuery = _l.isDesktopQuery;
66
66
  var isDesktop = isDesktopQuery;
67
67
  var isNarrowDesktop = isNarrowDesktopQuery && !isDesktopQuery;
68
68
  var isTablet = isTabletQuery && !isNarrowDesktopQuery;
@@ -87,13 +87,13 @@ var SideMenuInner = forwardRef(function (_a, ref) {
87
87
  var initialIsOpen = isPinned !== undefined ? !isPinned : !isNarrowDesktop;
88
88
  // Собственное состояние нужно только без `isOpen`. В управляемом режиме видимое состояние —
89
89
  // всегда проп: так оно не расходится с родителем и совпадает на сервере и на первой отрисовке.
90
- var _o = __read(useState(isDesktop && initialIsOpen), 2), internalIsOpened = _o[0], setInternalIsOpened = _o[1];
90
+ var _m = __read(useState(isDesktop && initialIsOpen), 2), internalIsOpened = _m[0], setInternalIsOpened = _m[1];
91
91
  var isOpened = manual ? !!isOpen : internalIsOpened;
92
- var _p = __read(useState(false), 2), isBeingTransitioned = _p[0], setIsBeingTransitioned = _p[1];
93
- var _q = __read(useState(0), 2), headerHeight = _q[0], setHeaderHeight = _q[1];
94
- var _r = __read(useState(0), 2), footerHeight = _r[0], setFooterHeight = _r[1];
95
- var _s = __read(useState('top'), 2), scrollState = _s[0], setScrollState = _s[1];
96
- var _t = __read(useState(false), 2), hasScrollBar = _t[0], setHasScrollBar = _t[1];
92
+ var _o = __read(useState(false), 2), isBeingTransitioned = _o[0], setIsBeingTransitioned = _o[1];
93
+ var _p = __read(useState(0), 2), headerHeight = _p[0], setHeaderHeight = _p[1];
94
+ var _q = __read(useState(0), 2), footerHeight = _q[0], setFooterHeight = _q[1];
95
+ var _r = __read(useState('top'), 2), scrollState = _r[0], setScrollState = _r[1];
96
+ var _s = __read(useState(false), 2), hasScrollBar = _s[0], setHasScrollBar = _s[1];
97
97
  var isDesktopNarrow = isDesktopViewport && !isOpened;
98
98
  // Кнопка сворачивания не должна требовать наличия футера: если Footer не передан,
99
99
  // SideMenu сам рисует внизу область с поведением футера и слотом для кнопки.
@@ -102,12 +102,12 @@ var SideMenuInner = forwardRef(function (_a, ref) {
102
102
  // Всплывание над контентом — только для планшета/мобайла. На десктопе меню остаётся в потоке;
103
103
  // вложенные пункты на узком десктопе показываются через NarrowAccordionDropdown.
104
104
  var isSideMenuOverContent = isOpened && isTabletOrMobile;
105
- var _u = useSideMenuReducer({
105
+ var _t = useSideMenuReducer({
106
106
  activeItem: activeItem,
107
107
  isSeparatedMenu: isSeparatedMenu,
108
108
  viewport: viewport,
109
109
  isOpened: !!isOpened,
110
- }), machineState = _u.state, machineDispatch = _u.dispatch;
110
+ }), machineState = _t.state, machineDispatch = _t.dispatch;
111
111
  var isSeparatedMenuShown = separatedShown(machineState);
112
112
  // Lift state up: notify the parent only when the machine arrives at a new active id.
113
113
  // `activeItem`/`onActiveItemChange` are read via refs so this effect's sole trigger is
@@ -235,7 +235,7 @@ var SideMenuInner = forwardRef(function (_a, ref) {
235
235
  }
236
236
  transitionTimer.current = setTimeout(function () {
237
237
  setIsBeingTransitioned(false);
238
- }, transitionDuration + 200);
238
+ }, transitionDuration);
239
239
  }
240
240
  };
241
241
  var setIsCollapsedTabletAndMobile = function (isCollapsed) {
@@ -261,11 +261,11 @@ var SideMenuInner = forwardRef(function (_a, ref) {
261
261
  return 'never';
262
262
  };
263
263
  // Анимация задника мобильного меню
264
- var _v = __read(useAnimateOnMount(!!isTabletOrMobile && !!isOpened, burgerTransitionDuration, {
264
+ var _u = __read(useAnimateOnMount(!!isTabletOrMobile && !!isOpened, burgerTransitionDuration, {
265
265
  opacity: LIGHT_THEME.sidePageBackingBgOpacity,
266
266
  }, {
267
267
  opacity: 0,
268
- }), 2), shouldShowBackdrop = _v[0], backdropStyle = _v[1];
268
+ }), 2), shouldShowBackdrop = _u[0], backdropStyle = _u[1];
269
269
  var contextValue = useMemo(function () { return ({
270
270
  isOpened: isOpened,
271
271
  disableCollapsing: disableCollapsing,
@@ -296,7 +296,6 @@ var SideMenuInner = forwardRef(function (_a, ref) {
296
296
  dispatch: machineDispatch,
297
297
  parentItemId: ROOT,
298
298
  currentItemNestingLevel: 0,
299
- childIdCounterRef: childIdCounterRef,
300
299
  }); }, [
301
300
  isOpened,
302
301
  disableCollapsing,
@@ -341,6 +340,8 @@ var SideMenuInner = forwardRef(function (_a, ref) {
341
340
  React.createElement(RenderLayer, { onClickOutside: function () { return setIsCollapsedTabletAndMobile(true); } },
342
341
  React.createElement("aside", __assign({ className: cx(styles.wrapper(), (_c = {}, _c[styles.wrapperWithShadow(theme)] = isSideMenuOverContent, _c), className), "data-tid": SideMenuDataTids.root, ref: mergeRefs(sideMenuRef, ref !== null && ref !== void 0 ? ref : null) }, rest),
343
342
  React.createElement("div", { className: cx(styles.container(theme), (_d = {},
343
+ _d[styles.containerDesktop()] = isDesktopViewport,
344
+ _d[styles.containerDesktopTouchScreen()] = isDesktopViewport && isTouchScreen,
344
345
  _d[styles.containerTouchScreen(theme)] = isTouchScreen,
345
346
  _d[styles.containerCollapsed(theme)] = !isOpened && !isTabletOrMobile,
346
347
  _d[styles.containerCollapsedTabletAndMobile()] = !(isOpened || isBeingTransitioned) && isTabletOrMobile,
@@ -349,22 +350,16 @@ var SideMenuInner = forwardRef(function (_a, ref) {
349
350
  React.createElement(ScrollContainer, { onScrollStateChangeY: function (state) {
350
351
  setScrollState === null || setScrollState === void 0 ? void 0 : setScrollState(state);
351
352
  }, showScrollBar: setScrollBar(), ref: scrollContainerRef },
352
- React.createElement("div", { className: cx(styles.contentClip()) },
353
- React.createElement("div", { className: cx(styles.contentWrapper(theme), (_e = {},
354
- _e[styles.contentWrapperTouchScreen(theme)] = isTouchScreen,
355
- _e[styles.contentWrapperCollapsed()] = !isOpened && !isTabletOrMobile,
356
- _e[styles.contentWrapperCollapsedTabletAndMobile()] = !isOpened && isTabletOrMobile,
357
- _e[styles.contentWrapperOverContent(theme)] = isSideMenuOverContent,
358
- _e[styles.contentWrapperWithSeparatedSubMenuMobile(theme)] = isSeparatedMenuShown && isMobile && (isOpened || isBeingTransitioned),
359
- _e)), ref: contentWrapperRef, style: {
360
- '--side-menu-scroll-margin-top': "".concat(headerHeight, "px"),
361
- '--side-menu-scroll-margin-bottom': "".concat(footerHeight, "px"),
362
- } },
363
- children,
364
- !hasFooter && showCollapseToggle && (React.createElement("span", { ref: collapseToggleRef, className: cx(styles.collapseToggleBottomSlot(theme), styles.itemsContainerCollapsed(theme), (_f = {},
365
- _f[styles.collapseToggleBottomSlotLarge(theme)] = size === 'large',
366
- _f[styles.itemsContainerCollapsedLarge(theme)] = size === 'large',
367
- _f)), "data-tid": SideMenuDataTids.footer }))))))))))));
353
+ React.createElement("div", { className: cx(styles.contentWrapper(theme), (_e = {},
354
+ _e[styles.contentWrapperCollapsedTabletAndMobile()] = !isOpened && isTabletOrMobile,
355
+ _e[styles.contentWrapperOverContent(theme)] = isSideMenuOverContent,
356
+ _e[styles.contentWrapperWithSeparatedSubMenuMobile(theme)] = isSeparatedMenuShown && isMobile && (isOpened || isBeingTransitioned),
357
+ _e)), ref: contentWrapperRef, style: {
358
+ '--side-menu-scroll-margin-top': "".concat(headerHeight, "px"),
359
+ '--side-menu-scroll-margin-bottom': "".concat(footerHeight, "px"),
360
+ } },
361
+ children,
362
+ !hasFooter && showCollapseToggle && React.createElement(SideMenuFooter, null))))))))));
368
363
  });
369
364
  SideMenuInner.displayName = 'SideMenu';
370
365
  var STATIC_PROPS = {
@@ -1,5 +1,6 @@
1
1
  import { type Emotion } from '../../lib/theming/ThemeHelpers.js';
2
2
  import type { SideMenuTheme } from '../../lib/theming/ThemeTypes.js';
3
+ export declare const compactDesktopMenu: (t: SideMenuTheme, declarations: string) => string;
3
4
  export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").StylesGetter<{
4
5
  root(): string;
5
6
  rootCollapsed(t: SideMenuTheme): string;
@@ -13,18 +14,16 @@ export declare const getStyles: import("../../lib/theming/ThemeHelpers.js").Styl
13
14
  wrapperWithShadow(t: SideMenuTheme): string;
14
15
  container(t: SideMenuTheme): string;
15
16
  containerTouchScreen(t: SideMenuTheme): string;
17
+ containerDesktop(): string;
18
+ containerDesktopTouchScreen(): string;
19
+ hideUntilExpanded(t: SideMenuTheme): string;
16
20
  containerCollapsed(t: SideMenuTheme): string;
17
21
  containerCollapsedTabletAndMobile(): string;
18
22
  containerWithSeparatedSubMenuMobile(t: SideMenuTheme): string;
19
- contentClip(): string;
20
23
  contentWrapper(t: SideMenuTheme): string;
21
- contentWrapperTouchScreen(t: SideMenuTheme): string;
22
24
  contentWrapperOverContent(t: SideMenuTheme): string;
23
25
  contentWrapperWithSeparatedSubMenuMobile(t: SideMenuTheme): string;
24
- contentWrapperCollapsed(): string;
25
26
  contentWrapperCollapsedTabletAndMobile(): string;
26
- collapseToggleBottomSlot(t: SideMenuTheme): string;
27
- collapseToggleBottomSlotLarge(t: SideMenuTheme): string;
28
27
  itemsContainerCollapsed(t: SideMenuTheme): string;
29
28
  itemsContainerCollapsedLarge(t: SideMenuTheme): string;
30
29
  list(): string;
@@ -1,11 +1,13 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
2
  import { memoizeGetStyles } from '../../lib/theming/ThemeHelpers.js';
3
- import { burgerTransitionDuration, transitionDuration } from './SideMenu.js';
3
+ import { burgerTransitionDuration, transitionDuration, transitionEasing } from './SideMenu.js';
4
+ // The measured width also covers transitions triggered by a controlled isOpen prop.
5
+ export var compactDesktopMenu = function (t, declarations) { return "\n @container side-menu (width < ".concat(t.sideMenuWidth, ") {\n ").concat(declarations, "\n }\n @container side-menu-touch (width < ").concat(t.sideMenuWidthTouchScreen, ") {\n ").concat(declarations, "\n }\n"); };
4
6
  export var getStyles = memoizeGetStyles(function (_a) {
5
7
  var css = _a.css;
6
8
  return ({
7
9
  root: function () {
8
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n height: 100%;\n flex-shrink: 0;\n transition: width ", "ms ease-out;\n "], ["\n position: relative;\n height: 100%;\n flex-shrink: 0;\n transition: width ", "ms ease-out;\n "])), transitionDuration);
10
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n height: 100%;\n flex-shrink: 0;\n "], ["\n position: relative;\n height: 100%;\n flex-shrink: 0;\n "])));
9
11
  },
10
12
  rootCollapsed: function (t) {
11
13
  return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", ";\n "], ["\n width: ", ";\n "])), t.sideMenuWidthCollapsed);
@@ -35,67 +37,55 @@ export var getStyles = memoizeGetStyles(function (_a) {
35
37
  return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n box-shadow: ", ";\n "], ["\n box-shadow: ", ";\n "])), t.sideMenuBoxShadow);
36
38
  },
37
39
  container: function (t) {
38
- return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n position: relative;\n box-sizing: border-box;\n\n width: ", ";\n height: 100%;\n\n background: ", ";\n transition:\n width ", "ms ease-out,\n left ", "ms ease-out;\n "], ["\n position: relative;\n box-sizing: border-box;\n\n width: ", ";\n height: 100%;\n\n background: ", ";\n transition:\n width ", "ms ease-out,\n left ", "ms ease-out;\n "])), t.sideMenuWidth, t.sideMenuBg, transitionDuration, transitionDuration);
40
+ return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n position: relative;\n box-sizing: border-box;\n\n width: ", ";\n height: 100%;\n\n background: ", ";\n transition: left ", "ms ", ";\n "], ["\n position: relative;\n box-sizing: border-box;\n\n width: ", ";\n height: 100%;\n\n background: ", ";\n transition: left ", "ms ", ";\n "])), t.sideMenuWidth, t.sideMenuBg, transitionDuration, transitionEasing);
39
41
  },
40
42
  containerTouchScreen: function (t) {
41
43
  return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n width: ", ";\n "], ["\n width: ", ";\n "])), t.sideMenuWidthTouchScreen);
42
44
  },
45
+ containerDesktop: function () {
46
+ return css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n container: side-menu / inline-size;\n\n @supports (container-type: inline-size) {\n @media (prefers-reduced-motion: no-preference) {\n transition:\n width ", "ms ", ",\n left ", "ms ", ";\n }\n }\n "], ["\n container: side-menu / inline-size;\n\n @supports (container-type: inline-size) {\n @media (prefers-reduced-motion: no-preference) {\n transition:\n width ", "ms ", ",\n left ", "ms ", ";\n }\n }\n "])), transitionDuration, transitionEasing, transitionDuration, transitionEasing);
47
+ },
48
+ containerDesktopTouchScreen: function () {
49
+ return css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n container-name: side-menu-touch;\n "], ["\n container-name: side-menu-touch;\n "])));
50
+ },
51
+ hideUntilExpanded: function (t) {
52
+ return css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), compactDesktopMenu(t, 'display: none;'));
53
+ },
43
54
  containerCollapsed: function (t) {
44
- return css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n width: ", " !important;\n "], ["\n width: ", " !important;\n "])), t.sideMenuWidthCollapsed);
55
+ return css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n width: ", " !important;\n "], ["\n width: ", " !important;\n "])), t.sideMenuWidthCollapsed);
45
56
  },
46
57
  containerCollapsedTabletAndMobile: function () {
47
- return css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n background: transparent;\n "], ["\n background: transparent;\n "])));
58
+ return css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n background: transparent;\n "], ["\n background: transparent;\n "])));
48
59
  },
49
60
  containerWithSeparatedSubMenuMobile: function (t) {
50
- return css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), t.sideMenuSeparatedSubMenuBg);
51
- },
52
- // Во время анимации ширины содержимое шире контейнера; обрезаем его по горизонтали, чтобы
53
- // ScrollContainer не включал горизонтальную прокрутку (она добавляет отступ снизу и мигает
54
- // разделитель футера). clip, в отличие от hidden, не ломает sticky шапку и футер.
55
- contentClip: function () {
56
- return css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n height: 100%;\n overflow-x: clip;\n "], ["\n height: 100%;\n overflow-x: clip;\n "])));
61
+ return css(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), t.sideMenuSeparatedSubMenuBg);
57
62
  },
58
63
  contentWrapper: function (t) {
59
- return css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n width: ", ";\n min-height: 100%;\n /* \u041D\u0435 \u0434\u0430\u0451\u043C \u0430\u043D\u0438\u043C\u0438\u0440\u0443\u0435\u043C\u043E\u043C\u0443 \u0444\u0443\u0442\u0435\u0440\u0443 \u0441\u043E\u0437\u0434\u0430\u0432\u0430\u0442\u044C \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0443; \u0432 \u043E\u0442\u043B\u0438\u0447\u0438\u0435 \u043E\u0442 hidden, clip \u043D\u0435 \u043B\u043E\u043C\u0430\u0435\u0442 sticky */\n overflow: clip;\n\n background: ", ";\n transition: background 0.08s;\n "], ["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n width: ", ";\n min-height: 100%;\n /* \u041D\u0435 \u0434\u0430\u0451\u043C \u0430\u043D\u0438\u043C\u0438\u0440\u0443\u0435\u043C\u043E\u043C\u0443 \u0444\u0443\u0442\u0435\u0440\u0443 \u0441\u043E\u0437\u0434\u0430\u0432\u0430\u0442\u044C \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0443; \u0432 \u043E\u0442\u043B\u0438\u0447\u0438\u0435 \u043E\u0442 hidden, clip \u043D\u0435 \u043B\u043E\u043C\u0430\u0435\u0442 sticky */\n overflow: clip;\n\n background: ", ";\n transition: background 0.08s;\n "])), t.sideMenuWidth, t.sideMenuBg);
60
- },
61
- contentWrapperTouchScreen: function (t) {
62
- return css(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n width: ", ";\n "], ["\n width: ", ";\n "])), t.sideMenuWidthTouchScreen);
64
+ return css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n width: 100%;\n min-height: 100%;\n\n background: ", ";\n transition: background 0.08s;\n "], ["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n width: 100%;\n min-height: 100%;\n\n background: ", ";\n transition: background 0.08s;\n "])), t.sideMenuBg);
63
65
  },
64
66
  contentWrapperOverContent: function (t) {
65
- return css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), t.sideMenuBgHover);
67
+ return css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), t.sideMenuBgHover);
66
68
  },
67
69
  contentWrapperWithSeparatedSubMenuMobile: function (t) {
68
- return css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n background: ", ";\n transition: background 0s;\n "], ["\n background: ", ";\n transition: background 0s;\n "])), t.sideMenuSeparatedSubMenuBg);
69
- },
70
- contentWrapperCollapsed: function () {
71
- return css(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n width: 100%;\n "], ["\n width: 100%;\n "])));
70
+ return css(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n background: ", ";\n transition: background 0s;\n "], ["\n background: ", ";\n transition: background 0s;\n "])), t.sideMenuSeparatedSubMenuBg);
72
71
  },
73
72
  contentWrapperCollapsedTabletAndMobile: function () {
74
73
  return css(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n background: transparent;\n "], ["\n background: transparent;\n "])));
75
74
  },
76
- // Запасной слот кнопки сворачивания, когда Footer не передан: нижняя область меню
77
- // с поведением футера (растягивается на всю ширину, липнет к низу при прокрутке),
78
- // где кнопка выравнивается по правому краю — как в trailing-ряду футера.
79
- collapseToggleBottomSlot: function (t) {
80
- return css(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n position: sticky;\n bottom: 0;\n display: flex;\n align-items: flex-end;\n flex-shrink: 0;\n margin: 0 ", ";\n padding-bottom: ", ";\n background-color: inherit;\n "], ["\n position: sticky;\n bottom: 0;\n display: flex;\n align-items: flex-end;\n flex-shrink: 0;\n margin: 0 ", ";\n padding-bottom: ", ";\n background-color: inherit;\n "])), t.sideMenuItemsMarginX, t.sideMenuFooterPaddingBottom);
81
- },
82
- collapseToggleBottomSlotLarge: function (t) {
83
- return css(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n padding-bottom: ", ";\n "], ["\n padding-bottom: ", ";\n "])), t.sideMenuFooterPaddingBottomLarge);
84
- },
85
75
  // Горизонтальные отступы контейнеров пунктов (Body, Footer) в свёрнутом меню:
86
76
  // пункт становится квадратным, а иконка остаётся на месте при сворачивании.
87
77
  itemsContainerCollapsed: function (t) {
88
- return css(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n margin-left: ", ";\n margin-right: ", ";\n "], ["\n margin-left: ", ";\n margin-right: ", ";\n "])), t.sideMenuItemsMarginXCollapsed, t.sideMenuItemsMarginXCollapsed);
78
+ return css(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n margin-left: ", ";\n margin-right: ", ";\n "], ["\n margin-left: ", ";\n margin-right: ", ";\n "])), t.sideMenuItemsMarginXCollapsed, t.sideMenuItemsMarginXCollapsed);
89
79
  },
90
80
  itemsContainerCollapsedLarge: function (t) {
91
- return css(templateObject_26 || (templateObject_26 = __makeTemplateObject(["\n margin-left: ", ";\n margin-right: ", ";\n "], ["\n margin-left: ", ";\n margin-right: ", ";\n "])), t.sideMenuItemsMarginXCollapsedLarge, t.sideMenuItemsMarginXCollapsedLarge);
81
+ return css(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n margin-left: ", ";\n margin-right: ", ";\n "], ["\n margin-left: ", ";\n margin-right: ", ";\n "])), t.sideMenuItemsMarginXCollapsedLarge, t.sideMenuItemsMarginXCollapsedLarge);
92
82
  },
93
83
  // Общие стили для подкомпонентов SideMenu
94
84
  list: function () {
95
- return css(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n list-style: none;\n padding: 0;\n margin: 0;\n "], ["\n list-style: none;\n padding: 0;\n margin: 0;\n "])));
85
+ return css(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n list-style: none;\n padding: 0;\n margin: 0;\n "], ["\n list-style: none;\n padding: 0;\n margin: 0;\n "])));
96
86
  },
97
87
  hidden: function () {
98
- return css(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n display: none;\n "], ["\n display: none;\n "])));
88
+ return css(templateObject_26 || (templateObject_26 = __makeTemplateObject(["\n display: none;\n "], ["\n display: none;\n "])));
99
89
  },
100
90
  });
101
91
  });
@@ -103,8 +93,8 @@ export var getCustomStyles = function (_a) {
103
93
  var css = _a.css;
104
94
  return ({
105
95
  rootTabletAndMobile: function (headerHeight) {
106
- return css(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n height: ", "px;\n top: 0;\n transition: height ", "ms ease-out;\n "], ["\n height: ", "px;\n top: 0;\n transition: height ", "ms ease-out;\n "])), headerHeight, burgerTransitionDuration);
96
+ return css(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n height: ", "px;\n top: 0;\n transition: height ", "ms ease-out;\n "], ["\n height: ", "px;\n top: 0;\n transition: height ", "ms ease-out;\n "])), headerHeight, burgerTransitionDuration);
107
97
  },
108
98
  });
109
99
  };
110
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29;
100
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27;