@atlaskit/section-message 8.5.2 → 8.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
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/section-message
|
|
2
2
|
|
|
3
|
+
## 8.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 8.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`98ff1fe25f14a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/98ff1fe25f14a) -
|
|
14
|
+
Introduces the `onDismiss` callback function for usage with the `isDismissible` prop.
|
|
15
|
+
|
|
3
16
|
## 8.5.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -52,14 +52,16 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function SectionMessage
|
|
|
52
52
|
title = _ref.title,
|
|
53
53
|
icon = _ref.icon,
|
|
54
54
|
isDismissible = _ref.isDismissible,
|
|
55
|
+
onDismiss = _ref.onDismiss,
|
|
55
56
|
testId = _ref.testId;
|
|
56
57
|
var _useState = (0, _react.useState)(false),
|
|
57
58
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
58
59
|
dismissed = _useState2[0],
|
|
59
60
|
setDismissed = _useState2[1];
|
|
60
61
|
var handleDismiss = (0, _react.useCallback)(function () {
|
|
62
|
+
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
61
63
|
setDismissed(true);
|
|
62
|
-
}, []);
|
|
64
|
+
}, [onDismiss]);
|
|
63
65
|
var _getAppearanceIconSty = (0, _appearanceIcon.getAppearanceIconStyles)(appearance, icon),
|
|
64
66
|
primaryColor = _getAppearanceIconSty.primaryIconColor,
|
|
65
67
|
secondaryColor = _getAppearanceIconSty.backgroundColor,
|
|
@@ -41,12 +41,14 @@ const SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage({
|
|
|
41
41
|
title,
|
|
42
42
|
icon,
|
|
43
43
|
isDismissible,
|
|
44
|
+
onDismiss,
|
|
44
45
|
testId
|
|
45
46
|
}, ref) {
|
|
46
47
|
const [dismissed, setDismissed] = useState(false);
|
|
47
48
|
const handleDismiss = useCallback(() => {
|
|
49
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
48
50
|
setDismissed(true);
|
|
49
|
-
}, []);
|
|
51
|
+
}, [onDismiss]);
|
|
50
52
|
const {
|
|
51
53
|
primaryIconColor: primaryColor,
|
|
52
54
|
backgroundColor: secondaryColor,
|
|
@@ -43,14 +43,16 @@ var SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(_ref, ref)
|
|
|
43
43
|
title = _ref.title,
|
|
44
44
|
icon = _ref.icon,
|
|
45
45
|
isDismissible = _ref.isDismissible,
|
|
46
|
+
onDismiss = _ref.onDismiss,
|
|
46
47
|
testId = _ref.testId;
|
|
47
48
|
var _useState = useState(false),
|
|
48
49
|
_useState2 = _slicedToArray(_useState, 2),
|
|
49
50
|
dismissed = _useState2[0],
|
|
50
51
|
setDismissed = _useState2[1];
|
|
51
52
|
var handleDismiss = useCallback(function () {
|
|
53
|
+
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
52
54
|
setDismissed(true);
|
|
53
|
-
}, []);
|
|
55
|
+
}, [onDismiss]);
|
|
54
56
|
var _getAppearanceIconSty = getAppearanceIconStyles(appearance, icon),
|
|
55
57
|
primaryColor = _getAppearanceIconSty.primaryIconColor,
|
|
56
58
|
secondaryColor = _getAppearanceIconSty.backgroundColor,
|
package/dist/types/types.d.ts
CHANGED
|
@@ -39,6 +39,10 @@ export interface SectionMessageProps {
|
|
|
39
39
|
* It does not handle persistence of the dismissed state across page reloads or remounts.
|
|
40
40
|
*/
|
|
41
41
|
isDismissible?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* A callback function that is called when the user dismisses the message.
|
|
44
|
+
*/
|
|
45
|
+
onDismiss?: () => void;
|
|
42
46
|
/**
|
|
43
47
|
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
44
48
|
* in the rendered code, serving as a hook for automated tests.
|
|
@@ -39,6 +39,10 @@ export interface SectionMessageProps {
|
|
|
39
39
|
* It does not handle persistence of the dismissed state across page reloads or remounts.
|
|
40
40
|
*/
|
|
41
41
|
isDismissible?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* A callback function that is called when the user dismisses the message.
|
|
44
|
+
*/
|
|
45
|
+
onDismiss?: () => void;
|
|
42
46
|
/**
|
|
43
47
|
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
44
48
|
* in the rendered code, serving as a hook for automated tests.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/section-message",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.1",
|
|
4
4
|
"description": "A section message is used to alert users to a particular section of the screen.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
43
43
|
"@atlaskit/css": "^0.12.0",
|
|
44
44
|
"@atlaskit/heading": "^5.2.0",
|
|
45
|
-
"@atlaskit/icon": "^28.
|
|
45
|
+
"@atlaskit/icon": "^28.1.0",
|
|
46
46
|
"@atlaskit/link": "^3.2.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
|
-
"@atlaskit/primitives": "^14.
|
|
49
|
-
"@atlaskit/theme": "^
|
|
50
|
-
"@atlaskit/tokens": "^6.
|
|
48
|
+
"@atlaskit/primitives": "^14.12.0",
|
|
49
|
+
"@atlaskit/theme": "^20.0.0",
|
|
50
|
+
"@atlaskit/tokens": "^6.1.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"@atlaskit/code": "^17.2.0",
|
|
62
62
|
"@atlaskit/docs": "^11.0.0",
|
|
63
63
|
"@atlaskit/ds-lib": "^5.0.0",
|
|
64
|
-
"@atlaskit/form": "^12.
|
|
64
|
+
"@atlaskit/form": "^12.2.0",
|
|
65
65
|
"@atlaskit/range": "^9.2.0",
|
|
66
66
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
67
|
-
"@atlassian/ssr-tests": "^0.
|
|
67
|
+
"@atlassian/ssr-tests": "^0.3.0",
|
|
68
68
|
"@testing-library/react": "^13.4.0",
|
|
69
69
|
"@testing-library/user-event": "^14.4.3",
|
|
70
70
|
"react-dom": "^18.2.0"
|