@snack-uikit/drawer 0.6.0 → 0.6.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.
- package/CHANGELOG.md +11 -0
- package/dist/components/Drawer/Drawer.js +1 -1
- package/dist/components/DrawerCustom/DrawerCustom.js +1 -1
- package/dist/helperComponents/ButtonClose/ButtonClose.js +1 -1
- package/dist/helperComponents/Footer/Footer.js +1 -1
- package/dist/helperComponents/Header/Header.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.6.1 (2023-12-14)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@snack-uikit/icons@0.19.1](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/icons/CHANGELOG.md)
|
|
10
|
+
* [@snack-uikit/tooltip@0.10.1](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/tooltip/CHANGELOG.md)
|
|
11
|
+
* [@snack-uikit/truncate-string@0.4.1](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/truncate-string/CHANGELOG.md)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 0.6.0 (2023-12-14)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -18,5 +18,5 @@ import { DrawerCustom } from '../DrawerCustom';
|
|
|
18
18
|
export function Drawer(_a) {
|
|
19
19
|
var { title, titleTooltip, subtitle, image, content, approveButton, cancelButton, additionalButton, nestedDrawer } = _a, rest = __rest(_a, ["title", "titleTooltip", "subtitle", "image", "content", "approveButton", "cancelButton", "additionalButton", "nestedDrawer"]);
|
|
20
20
|
const needFooter = Boolean(approveButton) || Boolean(cancelButton) || Boolean(additionalButton);
|
|
21
|
-
return (_jsxs(DrawerCustom, Object.assign({}, rest, { push: Boolean(nestedDrawer) && { distance: NESTED_DRAWER_PUSH_DISTANCE }
|
|
21
|
+
return (_jsxs(DrawerCustom, Object.assign({}, rest, { push: Boolean(nestedDrawer) && { distance: NESTED_DRAWER_PUSH_DISTANCE }, children: [_jsx(DrawerCustom.Header, { title: _jsx(TruncateString, { text: title }), titleTooltip: titleTooltip, subtitle: subtitle, image: image, "data-test-id": TEST_IDS.header }), _jsx(DrawerCustom.Body, { content: content, "data-test-id": TEST_IDS.content }), needFooter && (_jsx(DrawerCustom.Footer, { "data-test-id": TEST_IDS.footer, actions: _jsxs(_Fragment, { children: [approveButton && _jsx(ButtonFilled, Object.assign({}, approveButton, { size: 'm', "data-test-id": TEST_IDS.approveButton })), cancelButton && _jsx(ButtonOutline, Object.assign({}, cancelButton, { size: 'm', "data-test-id": TEST_IDS.cancelButton })), additionalButton && (_jsx(ButtonSimple, Object.assign({}, additionalButton, { size: 'm', "data-test-id": TEST_IDS.additionalButton })))] }) })), nestedDrawer] })));
|
|
22
22
|
}
|
|
@@ -22,7 +22,7 @@ function DrawerCustomComponent(_a) {
|
|
|
22
22
|
var { open, mode = MODE.Regular, position = POSITION.Right, onClose, rootClassName, className, size = SIZE.S, push, container, children, nestedDrawer } = _a, rest = __rest(_a, ["open", "mode", "position", "onClose", "rootClassName", "className", "size", "push", "container", "children", "nestedDrawer"]);
|
|
23
23
|
const isRegular = mode === MODE.Regular;
|
|
24
24
|
const isPredefinedSize = typeof size === 'string' && SIZE_AS_VALUES.includes(size);
|
|
25
|
-
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",
|
|
25
|
+
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] })));
|
|
26
26
|
}
|
|
27
27
|
/** Компонент-конструктор */
|
|
28
28
|
export const DrawerCustom = DrawerCustomComponent;
|
|
@@ -3,5 +3,5 @@ import { CrossSVG } from '@snack-uikit/icons';
|
|
|
3
3
|
import { TEST_IDS } from '../../constants';
|
|
4
4
|
import styles from './styles.module.css';
|
|
5
5
|
export function ButtonClose({ onClick }) {
|
|
6
|
-
return (_jsx("button",
|
|
6
|
+
return (_jsx("button", { className: styles.buttonClose, onClick: onClick, "aria-label": 'close drawer', "data-test-id": TEST_IDS.closeButton, children: _jsx(CrossSVG, {}) }));
|
|
7
7
|
}
|
|
@@ -17,5 +17,5 @@ import styles from './styles.module.css';
|
|
|
17
17
|
/** Вспомогательный компонент для добавления "футера" в DrawerCustom */
|
|
18
18
|
export function DrawerFooter(_a) {
|
|
19
19
|
var { actions, className } = _a, rest = __rest(_a, ["actions", "className"]);
|
|
20
|
-
return (_jsx("div", Object.assign({ className: cn(styles.footer, className) }, extractSupportProps(rest), { children: _jsx("div",
|
|
20
|
+
return (_jsx("div", Object.assign({ className: cn(styles.footer, className) }, extractSupportProps(rest), { children: _jsx("div", { className: styles.footerActions, "data-test-id": TEST_IDS.footerActions, children: actions }) })));
|
|
21
21
|
}
|
|
@@ -19,5 +19,5 @@ import styles from './styles.module.css';
|
|
|
19
19
|
/** Вспомогательный компонент для добавления "шапки" в DrawerCustom */
|
|
20
20
|
export function DrawerHeader(_a) {
|
|
21
21
|
var { title, titleTooltip, subtitle, image, className } = _a, rest = __rest(_a, ["title", "titleTooltip", "subtitle", "image", "className"]);
|
|
22
|
-
return (_jsxs("div", Object.assign({ className: cn(styles.drawerHeader, className) }, extractSupportProps(rest), { children: [image && _jsx("img", { src: image.src, alt: image.alt, className: styles.image, "data-test-id": TEST_IDS.image }), _jsxs("div",
|
|
22
|
+
return (_jsxs("div", Object.assign({ className: cn(styles.drawerHeader, className) }, extractSupportProps(rest), { children: [image && _jsx("img", { src: image.src, alt: image.alt, className: styles.image, "data-test-id": TEST_IDS.image }), _jsxs("div", { className: styles.headlineLayout, children: [_jsxs("div", { className: styles.headline, children: [_jsx(Typography.SansHeadlineS, { className: styles.title, "data-test-id": TEST_IDS.title, children: title }), titleTooltip && _jsx(QuestionTooltip, { tip: titleTooltip, size: 's', "data-test-id": TEST_IDS.tooltip })] }), subtitle && (_jsx(Typography.SansBodyM, { className: styles.subtitle, "data-test-id": TEST_IDS.subtitle, children: subtitle }))] })] })));
|
|
23
23
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Drawer",
|
|
7
|
-
"version": "0.6.
|
|
7
|
+
"version": "0.6.1",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"scripts": {},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@snack-uikit/button": "0.15.0",
|
|
36
|
-
"@snack-uikit/icons": "0.19.
|
|
36
|
+
"@snack-uikit/icons": "0.19.1",
|
|
37
37
|
"@snack-uikit/scroll": "0.5.0",
|
|
38
|
-
"@snack-uikit/tooltip": "0.10.
|
|
39
|
-
"@snack-uikit/truncate-string": "0.4.
|
|
38
|
+
"@snack-uikit/tooltip": "0.10.1",
|
|
39
|
+
"@snack-uikit/truncate-string": "0.4.1",
|
|
40
40
|
"@snack-uikit/typography": "0.6.0",
|
|
41
41
|
"@snack-uikit/utils": "3.2.0",
|
|
42
42
|
"classnames": "2.3.2",
|
|
43
43
|
"rc-drawer": "6.4.1"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "62f43bf0cbfd611d0b746117400f67096b1790f6"
|
|
46
46
|
}
|