@snack-uikit/modal 0.9.0 → 0.9.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 +24 -0
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/ModalCustom/ModalCustom.js +1 -1
- package/dist/helperComponents/Body/Body.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 +2 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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.9.2 (2023-12-18)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@snack-uikit/icons@0.19.2](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/icons/CHANGELOG.md)
|
|
10
|
+
* [@snack-uikit/link@0.9.2](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/link/CHANGELOG.md)
|
|
11
|
+
* [@snack-uikit/tooltip@0.10.2](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/tooltip/CHANGELOG.md)
|
|
12
|
+
* [@snack-uikit/truncate-string@0.4.2](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/truncate-string/CHANGELOG.md)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 0.9.1 (2023-12-14)
|
|
19
|
+
|
|
20
|
+
### Only dependencies have been changed
|
|
21
|
+
* [@snack-uikit/icons@0.19.1](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/icons/CHANGELOG.md)
|
|
22
|
+
* [@snack-uikit/link@0.9.1](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/link/CHANGELOG.md)
|
|
23
|
+
* [@snack-uikit/tooltip@0.10.1](https://git.sbercloud.tech/sbercloud-ui/tokens-design-system/snack-uikit/-/blob/master/packages/tooltip/CHANGELOG.md)
|
|
24
|
+
* [@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)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# 0.9.0 (2023-12-14)
|
|
7
31
|
|
|
8
32
|
|
|
@@ -23,5 +23,5 @@ export function Modal(_a) {
|
|
|
23
23
|
const aligns = getAlignProps({ align, size });
|
|
24
24
|
const buttonsSize = getButtonsSize({ align, size });
|
|
25
25
|
const picture = getPicture({ size, picture: pictureProp });
|
|
26
|
-
return (_jsxs(ModalCustom, Object.assign({ open: open, onClose: onClose, size: size, mode: mode, className: className }, rest, { children: [_jsx(ModalCustom.Header, { title: _jsx(TruncateString, { text: title }), titleTooltip: titleTooltip, subtitle: subtitle, picture: picture, align: aligns.header }), Boolean(content) && _jsx(ModalCustom.Body, { content: content, align: aligns.body }), _jsx(ModalCustom.Footer, { actions: _jsxs(_Fragment, { children: [_jsx(ButtonFilled, Object.assign({}, approveButton, { size: buttonsSize, className: styles.footerButton, "data-test-id": TEST_IDS.approveButton })), cancelButton && (_jsx(ButtonOutline, Object.assign({}, cancelButton, { size: buttonsSize, className: styles.footerButton, "data-test-id": TEST_IDS.cancelButton }))), additionalButton && (_jsx(ButtonSimple, Object.assign({}, additionalButton, { size: buttonsSize, className: styles.footerButton, "data-test-id": TEST_IDS.additionalButton })))] }), disclaimer: disclaimer && (_jsxs(_Fragment, { children: [_jsx(Typography.SansBodyS,
|
|
26
|
+
return (_jsxs(ModalCustom, Object.assign({ open: open, onClose: onClose, size: size, mode: mode, className: className }, rest, { children: [_jsx(ModalCustom.Header, { title: _jsx(TruncateString, { text: title }), titleTooltip: titleTooltip, subtitle: subtitle, picture: picture, align: aligns.header }), Boolean(content) && _jsx(ModalCustom.Body, { content: content, align: aligns.body }), _jsx(ModalCustom.Footer, { actions: _jsxs(_Fragment, { children: [_jsx(ButtonFilled, Object.assign({}, approveButton, { size: buttonsSize, className: styles.footerButton, "data-test-id": TEST_IDS.approveButton })), cancelButton && (_jsx(ButtonOutline, Object.assign({}, cancelButton, { size: buttonsSize, className: styles.footerButton, "data-test-id": TEST_IDS.cancelButton }))), additionalButton && (_jsx(ButtonSimple, Object.assign({}, additionalButton, { size: buttonsSize, className: styles.footerButton, "data-test-id": TEST_IDS.additionalButton })))] }), disclaimer: disclaimer && (_jsxs(_Fragment, { children: [_jsx(Typography.SansBodyS, { "data-test-id": TEST_IDS.disclaimerText, children: disclaimer.text }), disclaimer.link && (_jsx(Link, Object.assign({}, disclaimer.link, { size: 's', external: true, "data-test-id": TEST_IDS.disclaimerLink })))] })), align: aligns.footer, className: styles.modalFooter })] })));
|
|
27
27
|
}
|
|
@@ -26,7 +26,7 @@ export function ModalCustom(_a) {
|
|
|
26
26
|
onClose();
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
return (_jsxs(RCModal,
|
|
29
|
+
return (_jsxs(RCModal, { data: Object.assign(Object.assign({}, getDataTestAttributes(rest)), { size }), isOpen: open, onRequestClose: handleClose, appElement: document.body, overlayElement: (_, content) => (_jsx(OverlayElement, { blur: [MODE.Forced, MODE.Aggressive].includes(mode), content: content, onClose: handleClose })), className: cn(styles.modal, className), children: [mode !== MODE.Forced && (_jsx("div", { className: styles.headerElements, children: _jsx(ButtonClose, { onClick: handleCloseButtonClick }) })), children] }));
|
|
30
30
|
}
|
|
31
31
|
(function (ModalCustom) {
|
|
32
32
|
ModalCustom.Header = ModalHeader;
|
|
@@ -17,5 +17,5 @@ import { CONTENT_ALIGN, TEST_IDS } from '../../constants';
|
|
|
17
17
|
import styles from './styles.module.css';
|
|
18
18
|
export function ModalBody(_a) {
|
|
19
19
|
var { content, align = CONTENT_ALIGN.Default, className } = _a, rest = __rest(_a, ["content", "align", "className"]);
|
|
20
|
-
return (_jsx(Scroll, Object.assign({ size: 'm', className: cn(styles.modalBody, className) }, extractSupportProps(rest), { "data-align": align, "data-test-id": TEST_IDS.content
|
|
20
|
+
return (_jsx(Scroll, Object.assign({ size: 'm', className: cn(styles.modalBody, className) }, extractSupportProps(rest), { "data-align": align, "data-test-id": TEST_IDS.content, children: content })));
|
|
21
21
|
}
|
|
@@ -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 modal', "data-test-id": TEST_IDS.closeButton, children: _jsx(CrossSVG, {}) }));
|
|
7
7
|
}
|
|
@@ -16,5 +16,5 @@ import { ALIGN, TEST_IDS } from '../../constants';
|
|
|
16
16
|
import styles from './styles.module.css';
|
|
17
17
|
export function ModalFooter(_a) {
|
|
18
18
|
var { actions, disclaimer, align = ALIGN.Default, className } = _a, rest = __rest(_a, ["actions", "disclaimer", "align", "className"]);
|
|
19
|
-
return (_jsxs("div", Object.assign({ "data-align": align, className: cn(styles.footer, className) }, extractSupportProps(rest), { "data-test-id": TEST_IDS.footer
|
|
19
|
+
return (_jsxs("div", Object.assign({ "data-align": align, className: cn(styles.footer, className) }, extractSupportProps(rest), { "data-test-id": TEST_IDS.footer, children: [_jsx("div", { className: styles.footerActions, children: actions }), disclaimer && (_jsx("div", { className: styles.footerDisclaimer, "data-test-id": TEST_IDS.disclaimer, children: disclaimer }))] })));
|
|
20
20
|
}
|
|
@@ -20,6 +20,6 @@ import { isPictureImage } from '../../utils';
|
|
|
20
20
|
import styles from './styles.module.css';
|
|
21
21
|
export function ModalHeader(_a) {
|
|
22
22
|
var { title, titleTooltip, subtitle, align = CONTENT_ALIGN.Default, picture, className } = _a, rest = __rest(_a, ["title", "titleTooltip", "subtitle", "align", "picture", "className"]);
|
|
23
|
-
return (_jsxs("div", Object.assign({ className: cn(styles.header, className) }, extractSupportProps(rest), { "data-test-id": TEST_IDS.header
|
|
24
|
-
(isPictureImage(picture) ? (_jsx("img", { src: picture.src, alt: picture.alt, className: styles.image, "data-test-id": TEST_IDS.image })) : (_jsx("div",
|
|
23
|
+
return (_jsxs("div", Object.assign({ className: cn(styles.header, className) }, extractSupportProps(rest), { "data-test-id": TEST_IDS.header, children: [picture &&
|
|
24
|
+
(isPictureImage(picture) ? (_jsx("img", { src: picture.src, alt: picture.alt, className: styles.image, "data-test-id": TEST_IDS.image })) : (_jsx("div", { className: styles.icon, "data-test-id": TEST_IDS.icon, children: _jsx(IconPredefined, { icon: picture, size: 'l' }) }))), _jsxs("div", { className: styles.headlineLayout, "data-align": align, 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 }))] })] })));
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Modal",
|
|
7
|
-
"version": "0.9.
|
|
7
|
+
"version": "0.9.2",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@snack-uikit/button": "0.15.0",
|
|
36
36
|
"@snack-uikit/icon-predefined": "0.4.0",
|
|
37
|
-
"@snack-uikit/icons": "0.19.
|
|
38
|
-
"@snack-uikit/link": "0.9.
|
|
37
|
+
"@snack-uikit/icons": "0.19.2",
|
|
38
|
+
"@snack-uikit/link": "0.9.2",
|
|
39
39
|
"@snack-uikit/scroll": "0.5.0",
|
|
40
|
-
"@snack-uikit/tooltip": "0.10.
|
|
41
|
-
"@snack-uikit/truncate-string": "0.4.
|
|
40
|
+
"@snack-uikit/tooltip": "0.10.2",
|
|
41
|
+
"@snack-uikit/truncate-string": "0.4.2",
|
|
42
42
|
"@snack-uikit/typography": "0.6.0",
|
|
43
43
|
"@snack-uikit/utils": "3.2.0",
|
|
44
44
|
"classnames": "2.3.2",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/react-modal": "3.16.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "50ef9bb113ec40897ffb3eeae62539ce82ade899"
|
|
51
51
|
}
|