@snack-uikit/drawer 0.12.1-preview-09106514.0 → 0.12.2

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,26 @@
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
+ ## 0.12.2 (2025-07-10)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@snack-uikit/icons@0.27.2](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/icons/CHANGELOG.md)
10
+ * [@snack-uikit/tooltip@0.18.1](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/tooltip/CHANGELOG.md)
11
+ * [@snack-uikit/truncate-string@0.6.24](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/truncate-string/CHANGELOG.md)
12
+
13
+
14
+
15
+
16
+
17
+ ## 0.12.1 (2025-07-10)
18
+
19
+ ### Only dependencies have been changed
20
+ * [@snack-uikit/button@0.19.13](https://github.com/cloud-ru-tech/snack-uikit/blob/master/packages/button/CHANGELOG.md)
21
+
22
+
23
+
24
+
25
+
6
26
  # 0.12.0 (2025-07-07)
7
27
 
8
28
 
@@ -44,9 +44,7 @@ function DrawerCustom(_a) {
44
44
  rest = __rest(_a, ["open", "mode", "position", "onClose", "rootClassName", "className", "size", "push", "container", "children", "nestedDrawer", "closeOnPopstate"]);
45
45
  const isRegular = mode === constants_1.MODE.Regular;
46
46
  const isPredefinedSize = typeof size === 'string' && constants_1.SIZE_AS_VALUES.includes(size);
47
- (0, utils_1.useModalOpenState)(open, onClose, {
48
- closeOnPopstate
49
- });
47
+ (0, utils_1.usePopstateSubscription)(() => open && onClose(), Boolean(closeOnPopstate));
50
48
  return (0, jsx_runtime_1.jsxs)(rc_drawer_1.default, Object.assign({
51
49
  mask: isRegular,
52
50
  maskClosable: isRegular,
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import 'rc-drawer/assets/index.css';
14
14
  import cn from 'classnames';
15
15
  import RcDrawer from 'rc-drawer';
16
- import { extractSupportProps, useModalOpenState } from '@snack-uikit/utils';
16
+ import { extractSupportProps, usePopstateSubscription } from '@snack-uikit/utils';
17
17
  import { MODE, POSITION, SIZE, SIZE_AS_VALUES } from '../../constants';
18
18
  import { ButtonClose, DrawerBody, DrawerFooter, DrawerHeader, } from '../../helperComponents';
19
19
  import { motionProps } from './constants';
@@ -22,7 +22,7 @@ export function DrawerCustom(_a) {
22
22
  var { open, mode = MODE.Regular, position = POSITION.Right, onClose, rootClassName, className, size = SIZE.S, push, container, children, nestedDrawer, closeOnPopstate } = _a, rest = __rest(_a, ["open", "mode", "position", "onClose", "rootClassName", "className", "size", "push", "container", "children", "nestedDrawer", "closeOnPopstate"]);
23
23
  const isRegular = mode === MODE.Regular;
24
24
  const isPredefinedSize = typeof size === 'string' && SIZE_AS_VALUES.includes(size);
25
- useModalOpenState(open, onClose, { closeOnPopstate });
25
+ usePopstateSubscription(() => open && onClose(), Boolean(closeOnPopstate));
26
26
  return (_jsxs(RcDrawer, Object.assign({ mask: isRegular, maskClosable: isRegular, maskClassName: styles.mask, keyboard: isRegular, width: isPredefinedSize ? 'null' : size, open: open, placement: position, destroyOnClose: true, push: push, onClose: onClose, getContainer: container, className: cn(styles.drawer, className), rootClassName: cn(styles.drawerRoot, rootClassName) }, extractSupportProps(rest), { "data-content-wrapper": true, "data-size": isPredefinedSize ? size : undefined, "data-mode": mode }, motionProps, { children: [_jsx("div", { className: styles.headerElements, children: _jsx(ButtonClose, { onClick: onClose }) }), children, nestedDrawer] })));
27
27
  }
28
28
  (function (DrawerCustom) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Drawer",
7
- "version": "0.12.1-preview-09106514.0",
7
+ "version": "0.12.2",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -36,15 +36,15 @@
36
36
  "license": "Apache-2.0",
37
37
  "scripts": {},
38
38
  "dependencies": {
39
- "@snack-uikit/button": "0.19.13-preview-09106514.0",
40
- "@snack-uikit/icons": "0.27.2-preview-09106514.0",
41
- "@snack-uikit/scroll": "0.10.3-preview-09106514.0",
42
- "@snack-uikit/tooltip": "0.18.1-preview-09106514.0",
43
- "@snack-uikit/truncate-string": "0.6.24-preview-09106514.0",
44
- "@snack-uikit/typography": "0.8.9-preview-09106514.0",
45
- "@snack-uikit/utils": "3.9.1-preview-09106514.0",
39
+ "@snack-uikit/button": "0.19.13",
40
+ "@snack-uikit/icons": "0.27.2",
41
+ "@snack-uikit/scroll": "0.10.2",
42
+ "@snack-uikit/tooltip": "0.18.1",
43
+ "@snack-uikit/truncate-string": "0.6.24",
44
+ "@snack-uikit/typography": "0.8.8",
45
+ "@snack-uikit/utils": "3.9.0",
46
46
  "classnames": "2.5.1",
47
47
  "rc-drawer": "6.4.1"
48
48
  },
49
- "gitHead": "46d1e0103764bd1f5a509559a0c3f169d66151f7"
49
+ "gitHead": "293270ac61bb2fb3ae324a2261b93f0a918dd5d1"
50
50
  }
@@ -4,7 +4,7 @@ import cn from 'classnames';
4
4
  import RcDrawer, { DrawerProps as RcDrawerProps } from 'rc-drawer';
5
5
  import { PropsWithChildren, ReactElement } from 'react';
6
6
 
7
- import { extractSupportProps, useModalOpenState, WithSupportProps } from '@snack-uikit/utils';
7
+ import { extractSupportProps, usePopstateSubscription, WithSupportProps } from '@snack-uikit/utils';
8
8
 
9
9
  import { MODE, POSITION, SIZE, SIZE_AS_VALUES } from '../../constants';
10
10
  import {
@@ -65,7 +65,7 @@ export function DrawerCustom({
65
65
  const isRegular = mode === MODE.Regular;
66
66
  const isPredefinedSize = typeof size === 'string' && SIZE_AS_VALUES.includes(size);
67
67
 
68
- useModalOpenState(open, onClose, { closeOnPopstate });
68
+ usePopstateSubscription(() => open && onClose(), Boolean(closeOnPopstate));
69
69
 
70
70
  return (
71
71
  <RcDrawer