@skbkontur/side-menu 4.0.0-beta.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,52 @@
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
+ # [4.0.0](/compare/@skbkontur/side-menu@3.5.0...@skbkontur/side-menu@4.0.0) (2026-03-31)
7
+
8
+
9
+ ### Features
10
+
11
+ * **SideMenu:** add dark theme, refactor theme variables ([67d9cfd](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/67d9cfd))
12
+ * **SideMenu:** add focus state to Burger ([10f5f29](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/10f5f29))
13
+ * **SideMenu:** hide marker on disabled items ([111614f](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/111614f))
14
+ * **SideMenu:** use Kontur Colors in themes ([7cce950](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/7cce950))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **SideMenu.Item:** change item focus color variable ([772e0ea](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/772e0ea))
20
+ * **SideMenu:** add full-width to nested MenuItems ([53c55e4](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/53c55e4))
21
+ * **SideMenuDropdown:** use correct ref ([410645f](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/410645f))
22
+ * **SideMenu:** remove horizontal scrolling in touchscreen ([5fef1ac](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/5fef1ac))
23
+
24
+
25
+ ### BREAKING CHANGES
26
+
27
+ * type module, esm-only build, exports ([60e9281](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/60e9281))
28
+ * update typescript to 5.9.3 ([8e3a23d](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/8e3a23d))
29
+ * add explicit types ([a95c75d](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/a95c75d))
30
+ * adopt react-ui v6 changes ([6521a68](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/6521a68))
31
+ * adopt react-ui v6 renderEnvironment context ([0c119ec](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/0c119ec))
32
+ * improve typescript usage ([9fdd79c](https://git.skbkontur.ru/ui/ui-parking-2/-/commit/9fdd79c))
33
+
34
+
35
+ # [3.5.0](https://git.skbkontur.ru/ui/ui-parking-2/compare/@skbkontur/side-menu@3.4.8...@skbkontur/side-menu@3.5.0) (2026-03-12)
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * **SideMenu:** add `aria-current="page"` to active menu item ([76a5e37](https://git.skbkontur.ru/ui/ui-parking-2/commits/76a5e3794cf8331d2970cf852354030774827824))
41
+ * **SideMenu:** render RightBorder icon on top of scrollbar ([8ee36f4](https://git.skbkontur.ru/ui/ui-parking-2/commits/8ee36f43b1449d95df3d094baf87654902174d08))
42
+
43
+
44
+ ### Features
45
+
46
+ * **SideMenu:** add redirect prop to SideMenu.Notifications ([521c5ac](https://git.skbkontur.ru/ui/ui-parking-2/commits/521c5acd2714c014642756e6c9010845e3792c6e))
47
+
48
+
49
+
50
+
51
+
6
52
  ## [3.4.9](https://git.skbkontur.ru/ui/ui-parking-2/compare/@skbkontur/side-menu@3.4.8...@skbkontur/side-menu@3.4.9) (2025-12-25)
7
53
 
8
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/side-menu",
3
- "version": "4.0.0-beta.2",
3
+ "version": "4.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -26,17 +26,19 @@
26
26
  },
27
27
  "author": "Kontur",
28
28
  "peerDependencies": {
29
- "@skbkontur/react-ui": ">=5 <7",
30
- "react": ">=16.9 <20",
31
- "react-dom": ">=16.9 <20"
29
+ "@skbkontur/react-ui": ">=5 <=6",
30
+ "react": ">=16.9 <=19",
31
+ "react-dom": ">=16.9 <=19"
32
+ },
33
+ "devDependencies": {
34
+ "@skbkontur/ui-cdn-components": "^1.9.0"
32
35
  },
33
- "devDependencies": {},
34
36
  "dependencies": {
35
- "@skbkontur/bell-widget-npm-loader": "^0.2.3",
36
- "@skbkontur/colors": "^2.1.1",
37
- "@skbkontur/empty-state": "^2.0.0-beta.2",
37
+ "@skbkontur/bell-widget-npm-loader": "^0.3.0",
38
+ "@skbkontur/colors": "^2.1.6",
39
+ "@skbkontur/empty-state": "^2.0.0",
38
40
  "@skbkontur/icons": ">=2 <3",
39
- "@skbkontur/react-ui-addons": "^6.0.0-beta.1",
41
+ "@skbkontur/react-ui-addons": "^6.0.0",
40
42
  "@skbkontur/widget-consumer-react-utils": "^1.6.12",
41
43
  "tslib": "^2.8.0"
42
44
  }
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import type { OperationResult } from '@skbkontur/operation-result';
3
- import type { ImportFaults, WidgetApi, RenderFault, RenderDisposeFault } from '@skbkontur/bell-widget-npm-loader' assert { 'resolution-mode': 'import' };
3
+ import type { ImportFaults, WidgetApi, RenderFault, RenderDisposeFault, Redirect } from '@skbkontur/bell-widget-npm-loader' assert { 'resolution-mode': 'import' };
4
4
  export interface BellWidgetProps {
5
5
  widgetApi: Promise<OperationResult<ImportFaults, WidgetApi>>;
6
6
  onClose(): void;
7
7
  onError?: (error: ImportFaults | RenderFault | RenderDisposeFault) => void;
8
8
  renderErrorButton?: (error: ImportFaults | RenderFault, retryRender: () => void) => React.ReactNode;
9
9
  renderErrorMessage?: (error: ImportFaults | RenderFault, retryRender: () => void) => React.ReactNode;
10
+ redirect?: Redirect | null;
10
11
  }
11
12
  export declare const BellWidget: React.FC<BellWidgetProps>;
@@ -20,7 +20,7 @@ var getBtnTopPosition = function () {
20
20
  return (_a = bellDropDownItem === null || bellDropDownItem === void 0 ? void 0 : bellDropDownItem.offsetTop) !== null && _a !== void 0 ? _a : 0;
21
21
  };
22
22
  export var BellWidget = function (props) {
23
- var widgetApi = props.widgetApi, onClose = props.onClose, renderErrorButton = props.renderErrorButton, renderErrorMessage = props.renderErrorMessage, onError = props.onError;
23
+ var widgetApi = props.widgetApi, onClose = props.onClose, renderErrorButton = props.renderErrorButton, renderErrorMessage = props.renderErrorMessage, onError = props.onError, redirect = props.redirect;
24
24
  var theme = getSideMenuTheme(useContext(ThemeContext));
25
25
  var styles = useStyles(getStyles);
26
26
  var customStyles = useStyles(getCustomStyles);
@@ -35,6 +35,7 @@ export var BellWidget = function (props) {
35
35
  case 1:
36
36
  api = _a.sent();
37
37
  if (isFailure(api)) {
38
+ onError === null || onError === void 0 ? void 0 : onError(api.fault);
38
39
  return [2 /*return*/, createFailure(api.fault)];
39
40
  }
40
41
  wrapper = container.parentElement;
@@ -42,7 +43,7 @@ export var BellWidget = function (props) {
42
43
  wrapper.classList.add(styles.widgetWrapper());
43
44
  }
44
45
  container.style.height = '100%';
45
- return [4 /*yield*/, api.value.render({ container: container })];
46
+ return [4 /*yield*/, api.value.render({ container: container, redirect: redirect })];
46
47
  case 2:
47
48
  renderResult = _a.sent();
48
49
  if (isFailure(renderResult)) {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { OperationResult } from '@skbkontur/operation-result';
3
- import type { ImportFaults, WidgetApi, RenderFault, RenderDisposeFault } from '@skbkontur/bell-widget-npm-loader' assert { 'resolution-mode': 'import' };
3
+ import type { ImportFaults, WidgetApi, RenderFault, RenderDisposeFault, Redirect } from '@skbkontur/bell-widget-npm-loader' assert { 'resolution-mode': 'import' };
4
4
  import type { DropdownMenu } from '@skbkontur/react-ui/components/DropdownMenu';
5
5
  import { type SideMenuDropdownProps } from '../SideMenuDropdown/SideMenuDropdown.js';
6
6
  export interface NotificationApiProps extends Omit<SideMenuDropdownProps, 'icon' | 'marker' | 'subCaption'> {
@@ -23,13 +23,17 @@ export interface NotificationApiProps extends Omit<SideMenuDropdownProps, 'icon'
23
23
  */
24
24
  renderErrorButton?: (error: ImportFaults | RenderFault, retryRender: () => void) => React.ReactNode;
25
25
  /**
26
- * Полностью переопределяет отображение экрана ошибка виджета. retryRender - предоставляет возможность повторить загрузку виджета, работает только при ошибке рендера виджета
26
+ * Полностью переопределяет отображение экрана ошибки виджета. retryRender - предоставляет возможность повторить загрузку виджета, работает только при ошибке рендера виджета
27
27
  */
28
28
  renderErrorMessage?: (error: ImportFaults | RenderFault, retryRender: () => void) => React.ReactNode;
29
29
  /**
30
30
  * Типы ошибок брать из '@skbkontur/bell-widget-npm-loader'
31
31
  */
32
32
  onError?: (error: ImportFaults | RenderFault | RenderDisposeFault) => void;
33
+ /**
34
+ * Используется когда необходимо открыть ссылку в той же вкладке. Подробнее смотреть в документации Колокольчика - https://wiki.skbkontur.ru/pages/viewpage.action?pageId=1040164041
35
+ */
36
+ redirect?: Redirect | null;
33
37
  }
34
38
  export declare const BELL_SIDE_MENU_DATA_ITEM = "bell_side-menu-button";
35
39
  /**
@@ -12,7 +12,7 @@ import { BellWidget } from './BellWidget.js';
12
12
  import { getMarker } from './utils/getMarker.js';
13
13
  export var BELL_SIDE_MENU_DATA_ITEM = 'bell_side-menu-button';
14
14
  var SideMenuNotificationsInner = forwardRef(function (_a, ref) {
15
- var children = _a.children, _b = _a.positions, positions = _b === void 0 ? ['right top'] : _b, widgetApi = _a.widgetApi, count = _a.count, showDivider = _a.showDivider, onClose = _a.onClose, renderErrorButton = _a.renderErrorButton, renderErrorMessage = _a.renderErrorMessage, onError = _a.onError, rest = __rest(_a, ["children", "positions", "widgetApi", "count", "showDivider", "onClose", "renderErrorButton", "renderErrorMessage", "onError"]);
15
+ var children = _a.children, _b = _a.positions, positions = _b === void 0 ? ['right top'] : _b, widgetApi = _a.widgetApi, count = _a.count, showDivider = _a.showDivider, onClose = _a.onClose, renderErrorButton = _a.renderErrorButton, renderErrorMessage = _a.renderErrorMessage, onError = _a.onError, redirect = _a.redirect, rest = __rest(_a, ["children", "positions", "widgetApi", "count", "showDivider", "onClose", "renderErrorButton", "renderErrorMessage", "onError", "redirect"]);
16
16
  var marker = getMarker(count);
17
17
  var currentIcon = marker ? React.createElement(IconNotificationBellAlarmRegular24, null) : React.createElement(IconNotificationBellRegular24, null);
18
18
  var theme = getSideMenuTheme(useContext(ThemeContext));
@@ -33,7 +33,7 @@ var SideMenuNotificationsInner = forwardRef(function (_a, ref) {
33
33
  menuScrollContainerContentWrapperPaddingY: '0px',
34
34
  sideMenuMarkerBg: theme.sideMenuNotificationsMarkerBg,
35
35
  }, theme) },
36
- React.createElement(SideMenuDropdown, __assign({ ref: ref, icon: currentIcon, marker: marker, positions: positions, "data-tid": SideMenuDataTids.bellSideMenuDropdownButton, "data-item": BELL_SIDE_MENU_DATA_ITEM, caption: "\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F", onClose: handleClose }, rest), children !== null && children !== void 0 ? children : (React.createElement(BellWidget, { widgetApi: widgetApi, onClose: function () { return bellDropDownButton === null || bellDropDownButton === void 0 ? void 0 : bellDropDownButton.click(); }, renderErrorButton: renderErrorButton, renderErrorMessage: renderErrorMessage, onError: onError }))),
36
+ React.createElement(SideMenuDropdown, __assign({ ref: ref, icon: currentIcon, marker: marker, positions: positions, "data-tid": SideMenuDataTids.bellSideMenuDropdownButton, "data-item": BELL_SIDE_MENU_DATA_ITEM, caption: "\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F", onClose: handleClose }, rest), children !== null && children !== void 0 ? children : (React.createElement(BellWidget, { widgetApi: widgetApi, onClose: function () { return bellDropDownButton === null || bellDropDownButton === void 0 ? void 0 : bellDropDownButton.click(); }, renderErrorButton: renderErrorButton, renderErrorMessage: renderErrorMessage, onError: onError, redirect: redirect }))),
37
37
  showDivider && React.createElement(SideMenu.Divider, null)));
38
38
  });
39
39
  /**