@synerise/ds-alert 0.7.48 → 0.7.49
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,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.7.49](https://github.com/Synerise/synerise-design/compare/@synerise/ds-alert@0.7.48...@synerise/ds-alert@0.7.49) (2023-11-09)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **SectionMessage:** [TC-1304] click handling when closing section message ([5ccd4af](https://github.com/Synerise/synerise-design/commit/5ccd4afd4c65f7afa33b69857400ebf9b53a90c5))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
6
17
|
## [0.7.48](https://github.com/Synerise/synerise-design/compare/@synerise/ds-alert@0.7.47...@synerise/ds-alert@0.7.48) (2023-10-30)
|
7
18
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-alert
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import * as React from 'react';
|
2
1
|
import { Props } from './SectionMessage.types';
|
3
|
-
declare const SectionMessage:
|
2
|
+
declare const SectionMessage: ({ icon, type, message, description, showMoreLabel, onShowMore, onClose, newClient, moreButtons, withEmphasis, withLink, unorderedList, color, withClose, customColor, customColorIcon, customIcon, textButton, }: Props) => JSX.Element;
|
4
3
|
export default SectionMessage;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import React, { useMemo } from 'react';
|
2
2
|
import Icon, { CloseM, WarningFillM, UserAddM, Check3M, HelpFillM, UserUpM, UpdateDataM, NotificationsReceiveM } from '@synerise/ds-icon';
|
3
3
|
import Button from '@synerise/ds-button';
|
4
4
|
import * as S from './SectionMessage.styles';
|
@@ -20,6 +20,7 @@ var SectionMessage = function SectionMessage(_ref) {
|
|
20
20
|
description = _ref.description,
|
21
21
|
showMoreLabel = _ref.showMoreLabel,
|
22
22
|
onShowMore = _ref.onShowMore,
|
23
|
+
onClose = _ref.onClose,
|
23
24
|
newClient = _ref.newClient,
|
24
25
|
moreButtons = _ref.moreButtons,
|
25
26
|
withEmphasis = _ref.withEmphasis,
|
@@ -31,18 +32,23 @@ var SectionMessage = function SectionMessage(_ref) {
|
|
31
32
|
customColorIcon = _ref.customColorIcon,
|
32
33
|
customIcon = _ref.customIcon,
|
33
34
|
textButton = _ref.textButton;
|
34
|
-
var renderMessage =
|
35
|
+
var renderMessage = useMemo(function () {
|
35
36
|
return /*#__PURE__*/React.createElement(S.AlertContent, {
|
36
37
|
withLink: withLink
|
37
38
|
}, message && /*#__PURE__*/React.createElement(S.AlertMessage, null, message), /*#__PURE__*/React.createElement(S.Text, null, description && /*#__PURE__*/React.createElement(S.AlertDescription, null, description), withLink && /*#__PURE__*/React.createElement(S.LinkWrapper, null, withLink), withEmphasis && !withLink && /*#__PURE__*/React.createElement(S.EmphasisWrapper, null, withEmphasis)), onShowMore && showMoreLabel && /*#__PURE__*/React.createElement(S.AlertShowMore, {
|
38
39
|
onClick: onShowMore
|
39
40
|
}, showMoreLabel), moreButtons, unorderedList && !moreButtons && unorderedList);
|
40
41
|
}, [message, description, showMoreLabel, onShowMore, moreButtons, withEmphasis, withLink, unorderedList]);
|
41
|
-
var renderIcon =
|
42
|
+
var renderIcon = useMemo(function () {
|
42
43
|
if (icon) return icon;
|
43
44
|
if (ICONS[type]) return ICONS[type];
|
44
45
|
return DEFAULT_ICON;
|
45
46
|
}, [icon, type]);
|
47
|
+
|
48
|
+
var handleClose = function handleClose() {
|
49
|
+
onClose && onClose();
|
50
|
+
};
|
51
|
+
|
46
52
|
return /*#__PURE__*/React.createElement(S.Container, {
|
47
53
|
color: color,
|
48
54
|
customColor: customColor
|
@@ -56,7 +62,9 @@ var SectionMessage = function SectionMessage(_ref) {
|
|
56
62
|
mode: "icon-label"
|
57
63
|
}, /*#__PURE__*/React.createElement(Icon, {
|
58
64
|
component: /*#__PURE__*/React.createElement(UserAddM, null)
|
59
|
-
}), textButton), withClose && /*#__PURE__*/React.createElement(S.IconCloseWrapper,
|
65
|
+
}), textButton), withClose && /*#__PURE__*/React.createElement(S.IconCloseWrapper, {
|
66
|
+
onClick: handleClose
|
67
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
60
68
|
component: /*#__PURE__*/React.createElement(CloseM, null)
|
61
69
|
})))));
|
62
70
|
};
|
@@ -14,6 +14,7 @@ export interface Props extends Omit<AlertProps, 'type' | 'message'> {
|
|
14
14
|
mode?: ModeType;
|
15
15
|
showMoreLabel?: React.ReactNode;
|
16
16
|
onShowMore?: () => void;
|
17
|
+
onClose?: () => void;
|
17
18
|
newClient?: boolean | React.ReactNode;
|
18
19
|
moreButtons?: boolean | React.ReactNode;
|
19
20
|
withEmphasis?: React.ReactNode;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@synerise/ds-alert",
|
3
|
-
"version": "0.7.
|
3
|
+
"version": "0.7.49",
|
4
4
|
"description": "Alert UI Component for the Synerise Design System",
|
5
5
|
"license": "ISC",
|
6
6
|
"repository": "Synerise/synerise-design",
|
@@ -51,5 +51,5 @@
|
|
51
51
|
"@testing-library/jest-dom": "5.1.1",
|
52
52
|
"@testing-library/react": "10.0.1"
|
53
53
|
},
|
54
|
-
"gitHead": "
|
54
|
+
"gitHead": "88f117b388bae43df3daf3be6ca725ff0355e54b"
|
55
55
|
}
|