@atlaskit/section-message 8.3.0 → 8.5.0
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 +18 -0
- package/dist/cjs/section-message-action.compiled.css +2 -0
- package/dist/cjs/section-message-action.js +30 -11
- package/dist/cjs/section-message.compiled.css +9 -0
- package/dist/cjs/section-message.js +52 -31
- package/dist/es2019/section-message-action.compiled.css +2 -0
- package/dist/es2019/section-message-action.js +26 -7
- package/dist/es2019/section-message.compiled.css +9 -0
- package/dist/es2019/section-message.js +43 -26
- package/dist/esm/section-message-action.compiled.css +2 -0
- package/dist/esm/section-message-action.js +26 -7
- package/dist/esm/section-message.compiled.css +9 -0
- package/dist/esm/section-message.js +47 -26
- package/dist/types/section-message-action.d.ts +2 -2
- package/dist/types/section-message.d.ts +2 -2
- package/dist/types/types.d.ts +10 -0
- package/dist/types-ts4.5/section-message-action.d.ts +2 -2
- package/dist/types-ts4.5/section-message.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +10 -0
- package/package.json +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/section-message
|
|
2
2
|
|
|
3
|
+
## 8.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#191290](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/191290)
|
|
8
|
+
[`65bf86ed3a096`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/65bf86ed3a096) -
|
|
9
|
+
Adds new prop `isDismissible` that allows messages to be dismissed and removed from the page.
|
|
10
|
+
|
|
11
|
+
## 8.4.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#189812](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/189812)
|
|
16
|
+
[`1a7ddaeaf04ce`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1a7ddaeaf04ce) -
|
|
17
|
+
[ux] We are testing a change behind a feature flag. Section message action link styles will
|
|
18
|
+
reflect and utilize `@atlaskit/link`, being regular font weight and also now support `target`
|
|
19
|
+
attributes. If this fix is successful it will be available in a later release.
|
|
20
|
+
|
|
3
21
|
## 8.3.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
3
|
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
4
|
+
._bfhk1j28{background-color:transparent}
|
|
4
5
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
5
6
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
6
7
|
._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
8
|
+
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
7
9
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
8
10
|
._syaz14q2{color:var(--ds-link,#0c66e4)}
|
|
9
11
|
._u5f3ze3t{padding-right:var(--ds-space-0,0)}._1053w7te:visited{color:var(--ds-link-visited,#5e4db2)}
|
|
@@ -8,18 +8,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
});
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
require("./section-message-action.compiled.css");
|
|
11
|
-
var _runtime = require("@compiled/react/runtime");
|
|
12
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
13
14
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
14
15
|
var _css = require("@atlaskit/css");
|
|
16
|
+
var _link = _interopRequireDefault(require("@atlaskit/link"));
|
|
15
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
|
-
var
|
|
20
|
+
var stylesOld = {
|
|
19
21
|
common: "_11c82smr _syaz14q2 _k48p1wq8 _30l314q2 _9h8h16c2",
|
|
20
22
|
anchor: "_1053w7te _9oik1r31 _1bnx8stv _jf4cnqa1 _n0fxw7te _1vhvg3x0",
|
|
21
23
|
pressable: "_bfhksm61 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _9oik1r31 _1bnx8stv _jf4cnqa1"
|
|
22
24
|
};
|
|
25
|
+
var styles = {
|
|
26
|
+
common: "_11c82smr",
|
|
27
|
+
anchor: "_k48pi7a9",
|
|
28
|
+
pressable: "_syaz14q2 _k48p1wq8 _bfhk1j28 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _9oik1r31 _1bnx8stv _jf4cnqa1 _30l314q2 _9h8h16c2"
|
|
29
|
+
};
|
|
23
30
|
|
|
24
31
|
/**
|
|
25
32
|
* __Section message action__
|
|
@@ -35,35 +42,47 @@ var SectionMessageAction = /*#__PURE__*/(0, _react.memo)(function SectionMessage
|
|
|
35
42
|
onClick = _ref.onClick,
|
|
36
43
|
href = _ref.href,
|
|
37
44
|
testId = _ref.testId,
|
|
38
|
-
linkComponent = _ref.linkComponent
|
|
45
|
+
linkComponent = _ref.linkComponent,
|
|
46
|
+
target = _ref.target;
|
|
39
47
|
if (!linkComponent && (0, _platformFeatureFlags.fg)('platform_section_message_action_migration')) {
|
|
40
48
|
if (href) {
|
|
41
|
-
|
|
49
|
+
if ((0, _platformFeatureFlags.fg)('platform_dst_section_message_actions_as_link')) {
|
|
50
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
51
|
+
className: (0, _runtime.ax)([styles.common, styles.anchor])
|
|
52
|
+
}, /*#__PURE__*/React.createElement(_link.default, {
|
|
53
|
+
testId: testId,
|
|
54
|
+
onClick: onClick,
|
|
55
|
+
href: href,
|
|
56
|
+
target: target
|
|
57
|
+
}, children));
|
|
58
|
+
}
|
|
59
|
+
return /*#__PURE__*/React.createElement(_compiled.Anchor, {
|
|
42
60
|
testId: testId,
|
|
43
61
|
onClick: onClick,
|
|
44
62
|
href: href,
|
|
45
|
-
xcss: (0, _css.cx)(
|
|
63
|
+
xcss: (0, _css.cx)(stylesOld.common, stylesOld.anchor)
|
|
46
64
|
}, children);
|
|
47
65
|
}
|
|
48
66
|
if (onClick) {
|
|
49
|
-
return /*#__PURE__*/
|
|
67
|
+
return /*#__PURE__*/React.createElement(_compiled.Pressable, {
|
|
50
68
|
testId: testId,
|
|
51
69
|
onClick: onClick,
|
|
52
|
-
xcss: (0, _css.cx)(styles.common, styles.pressable)
|
|
70
|
+
xcss: (0, _css.cx)((0, _platformFeatureFlags.fg)('platform_dst_section_message_actions_as_link') ? styles.common : stylesOld.common, (0, _platformFeatureFlags.fg)('platform_dst_section_message_actions_as_link') ? styles.pressable : stylesOld.pressable)
|
|
53
71
|
}, children);
|
|
54
72
|
}
|
|
55
|
-
return /*#__PURE__*/
|
|
73
|
+
return /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
56
74
|
as: "span",
|
|
57
|
-
testId: testId
|
|
75
|
+
testId: testId,
|
|
76
|
+
xcss: (0, _platformFeatureFlags.fg)('platform_dst_section_message_actions_as_link') && styles.common
|
|
58
77
|
}, children);
|
|
59
78
|
}
|
|
60
|
-
return onClick || href ? /*#__PURE__*/
|
|
79
|
+
return onClick || href ? /*#__PURE__*/React.createElement(_standardButton.default, {
|
|
61
80
|
testId: testId,
|
|
62
81
|
appearance: "link",
|
|
63
82
|
spacing: "none",
|
|
64
83
|
onClick: onClick,
|
|
65
84
|
href: href,
|
|
66
85
|
component: href ? linkComponent : undefined
|
|
67
|
-
}, children) : /*#__PURE__*/
|
|
86
|
+
}, children) : /*#__PURE__*/React.createElement(_react.Fragment, null, children);
|
|
68
87
|
});
|
|
69
88
|
var _default = exports.default = SectionMessageAction;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
2
|
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
3
|
+
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
3
4
|
._1mou1i6y{margin-block:var(--ds-space-negative-025,-2px)}
|
|
5
|
+
._1rjcpxbi{padding-block:var(--ds-space-200,1pc)}
|
|
6
|
+
._16jlkb7n{flex-grow:1}
|
|
7
|
+
._19pk1i6y{margin-top:var(--ds-space-negative-025,-2px)}
|
|
4
8
|
._1e0c1txw{display:flex}
|
|
5
9
|
._1nmz1hna{word-break:break-word}
|
|
10
|
+
._bfhk1gly{background-color:var(--ds-background-danger,#ffeceb)}
|
|
11
|
+
._bfhk1nvp{background-color:var(--ds-background-discovery,#f3f0ff)}
|
|
12
|
+
._bfhk1tzq{background-color:var(--ds-background-warning,#fff7d6)}
|
|
13
|
+
._bfhk33gi{background-color:var(--ds-background-information,#e9f2ff)}
|
|
14
|
+
._bfhkmv6i{background-color:var(--ds-background-success,#dcfff1)}
|
|
6
15
|
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
@@ -8,18 +8,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
});
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
require("./section-message.compiled.css");
|
|
11
|
-
var _runtime = require("@compiled/react/runtime");
|
|
12
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
+
var _new = require("@atlaskit/button/new");
|
|
13
16
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
17
|
+
var _cross = _interopRequireDefault(require("@atlaskit/icon/core/migration/cross"));
|
|
14
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
16
20
|
var _appearanceIcon = require("./internal/appearance-icon");
|
|
17
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
22
|
var sectionMessageStyles = {
|
|
19
|
-
container: "_2rkoglpi _1nmz1hna",
|
|
20
|
-
|
|
23
|
+
container: "_2rkoglpi _1rjcpxbi _18zrpxbi _1nmz1hna",
|
|
24
|
+
iconContainer: "_1mou1i6y _1e0c1txw",
|
|
25
|
+
contentContainer: "_16jlkb7n",
|
|
21
26
|
content: "_11c82smr _syaz1fxt",
|
|
22
|
-
actionsContainer: "_11c82smr"
|
|
27
|
+
actionsContainer: "_11c82smr",
|
|
28
|
+
dismissButtonContainer: "_19pk1i6y"
|
|
29
|
+
};
|
|
30
|
+
var appearanceStyles = {
|
|
31
|
+
information: "_bfhk33gi",
|
|
32
|
+
warning: "_bfhk1tzq",
|
|
33
|
+
error: "_bfhk1gly",
|
|
34
|
+
success: "_bfhkmv6i",
|
|
35
|
+
discovery: "_bfhk1nvp"
|
|
23
36
|
};
|
|
24
37
|
|
|
25
38
|
/**
|
|
@@ -38,26 +51,31 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function SectionMessage
|
|
|
38
51
|
actions = _ref.actions,
|
|
39
52
|
title = _ref.title,
|
|
40
53
|
icon = _ref.icon,
|
|
54
|
+
isDismissible = _ref.isDismissible,
|
|
41
55
|
testId = _ref.testId;
|
|
56
|
+
var _useState = (0, _react.useState)(false),
|
|
57
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
58
|
+
dismissed = _useState2[0],
|
|
59
|
+
setDismissed = _useState2[1];
|
|
60
|
+
var handleDismiss = (0, _react.useCallback)(function () {
|
|
61
|
+
setDismissed(true);
|
|
62
|
+
}, []);
|
|
42
63
|
var _getAppearanceIconSty = (0, _appearanceIcon.getAppearanceIconStyles)(appearance, icon),
|
|
43
64
|
primaryColor = _getAppearanceIconSty.primaryIconColor,
|
|
44
65
|
secondaryColor = _getAppearanceIconSty.backgroundColor,
|
|
45
66
|
Icon = _getAppearanceIconSty.Icon;
|
|
46
|
-
var actionElements = actions && actions.type === _react.
|
|
47
|
-
var actionsArray = _react.
|
|
48
|
-
return /*#__PURE__*/
|
|
49
|
-
|
|
50
|
-
backgroundColor: appearanceMap[appearance],
|
|
51
|
-
padding: "space.200",
|
|
52
|
-
testId: testId,
|
|
67
|
+
var actionElements = actions && actions.type === _react.Fragment ? actions.props.children : actions;
|
|
68
|
+
var actionsArray = _react.Children.toArray(actionElements);
|
|
69
|
+
return isDismissible && dismissed ? null : /*#__PURE__*/React.createElement("section", {
|
|
70
|
+
"data-testid": testId,
|
|
53
71
|
ref: ref,
|
|
54
|
-
|
|
55
|
-
}, /*#__PURE__*/
|
|
72
|
+
className: (0, _runtime.ax)([sectionMessageStyles.container, appearanceStyles[appearance]])
|
|
73
|
+
}, /*#__PURE__*/React.createElement(_compiled.Inline, {
|
|
56
74
|
space: "space.200",
|
|
57
75
|
alignBlock: "stretch"
|
|
58
|
-
}, /*#__PURE__*/
|
|
59
|
-
|
|
60
|
-
}, /*#__PURE__*/
|
|
76
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: (0, _runtime.ax)([sectionMessageStyles.iconContainer])
|
|
78
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
61
79
|
size: "medium",
|
|
62
80
|
primaryColor: primaryColor,
|
|
63
81
|
secondaryColor: secondaryColor
|
|
@@ -66,15 +84,16 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function SectionMessage
|
|
|
66
84
|
LEGACY_size: "medium",
|
|
67
85
|
color: primaryColor,
|
|
68
86
|
spacing: "spacious"
|
|
69
|
-
})), /*#__PURE__*/
|
|
87
|
+
})), /*#__PURE__*/React.createElement(_compiled.Stack, {
|
|
70
88
|
space: "space.100",
|
|
71
|
-
testId: testId && "".concat(testId, "--content")
|
|
72
|
-
|
|
89
|
+
testId: testId && "".concat(testId, "--content"),
|
|
90
|
+
xcss: sectionMessageStyles.contentContainer
|
|
91
|
+
}, !!title && /*#__PURE__*/React.createElement(_heading.default, {
|
|
73
92
|
as: "h2",
|
|
74
93
|
size: "small"
|
|
75
|
-
}, title), /*#__PURE__*/
|
|
76
|
-
|
|
77
|
-
}, children), actionsArray.length > 0 && /*#__PURE__*/
|
|
94
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: (0, _runtime.ax)([sectionMessageStyles.content])
|
|
96
|
+
}, children), actionsArray.length > 0 && /*#__PURE__*/React.createElement(_compiled.Inline, {
|
|
78
97
|
shouldWrap: true,
|
|
79
98
|
testId: testId && "".concat(testId, "--actions"),
|
|
80
99
|
separator: "\xB7",
|
|
@@ -88,19 +107,21 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function SectionMessage
|
|
|
88
107
|
return (
|
|
89
108
|
/*#__PURE__*/
|
|
90
109
|
// Only use a listitem role if more than one action is present
|
|
91
|
-
|
|
110
|
+
React.createElement(_compiled.Inline, {
|
|
92
111
|
role: actionsArray.length > 1 ? 'listitem' : undefined,
|
|
93
112
|
key: id
|
|
94
113
|
}, action)
|
|
95
114
|
);
|
|
96
|
-
})))
|
|
115
|
+
}))), isDismissible && /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: (0, _runtime.ax)([sectionMessageStyles.dismissButtonContainer])
|
|
117
|
+
}, /*#__PURE__*/React.createElement(_new.IconButton, {
|
|
118
|
+
testId: testId && "".concat(testId, "--dismiss-button"),
|
|
119
|
+
label: "Dismiss",
|
|
120
|
+
icon: _cross.default,
|
|
121
|
+
appearance: "subtle",
|
|
122
|
+
onClick: handleDismiss,
|
|
123
|
+
spacing: "compact"
|
|
124
|
+
}))));
|
|
97
125
|
});
|
|
98
|
-
var appearanceMap = {
|
|
99
|
-
information: 'color.background.information',
|
|
100
|
-
warning: 'color.background.warning',
|
|
101
|
-
error: 'color.background.danger',
|
|
102
|
-
success: 'color.background.success',
|
|
103
|
-
discovery: 'color.background.discovery'
|
|
104
|
-
};
|
|
105
126
|
SectionMessage.displayName = 'SectionMessage';
|
|
106
127
|
var _default = exports.default = SectionMessage;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
3
|
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
4
|
+
._bfhk1j28{background-color:transparent}
|
|
4
5
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
5
6
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
6
7
|
._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
8
|
+
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
7
9
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
8
10
|
._syaz14q2{color:var(--ds-link,#0c66e4)}
|
|
9
11
|
._u5f3ze3t{padding-right:var(--ds-space-0,0)}._1053w7te:visited{color:var(--ds-link-visited,#5e4db2)}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
/* section-message-action.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./section-message-action.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import
|
|
5
|
+
import { Fragment, memo } from 'react';
|
|
5
6
|
import Button from '@atlaskit/button/standard-button';
|
|
6
7
|
import { cx } from '@atlaskit/css';
|
|
8
|
+
import Link from '@atlaskit/link';
|
|
7
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
10
|
import { Anchor, Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
9
|
-
const
|
|
11
|
+
const stylesOld = {
|
|
10
12
|
common: "_11c82smr _syaz14q2 _k48p1wq8 _30l314q2 _9h8h16c2",
|
|
11
13
|
anchor: "_1053w7te _9oik1r31 _1bnx8stv _jf4cnqa1 _n0fxw7te _1vhvg3x0",
|
|
12
14
|
pressable: "_bfhksm61 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _9oik1r31 _1bnx8stv _jf4cnqa1"
|
|
13
15
|
};
|
|
16
|
+
const styles = {
|
|
17
|
+
common: "_11c82smr",
|
|
18
|
+
anchor: "_k48pi7a9",
|
|
19
|
+
pressable: "_syaz14q2 _k48p1wq8 _bfhk1j28 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _9oik1r31 _1bnx8stv _jf4cnqa1 _30l314q2 _9h8h16c2"
|
|
20
|
+
};
|
|
14
21
|
|
|
15
22
|
/**
|
|
16
23
|
* __Section message action__
|
|
@@ -26,27 +33,39 @@ const SectionMessageAction = /*#__PURE__*/memo(function SectionMessageAction({
|
|
|
26
33
|
onClick,
|
|
27
34
|
href,
|
|
28
35
|
testId,
|
|
29
|
-
linkComponent
|
|
36
|
+
linkComponent,
|
|
37
|
+
target
|
|
30
38
|
}) {
|
|
31
39
|
if (!linkComponent && fg('platform_section_message_action_migration')) {
|
|
32
40
|
if (href) {
|
|
41
|
+
if (fg('platform_dst_section_message_actions_as_link')) {
|
|
42
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: ax([styles.common, styles.anchor])
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
45
|
+
testId: testId,
|
|
46
|
+
onClick: onClick,
|
|
47
|
+
href: href,
|
|
48
|
+
target: target
|
|
49
|
+
}, children));
|
|
50
|
+
}
|
|
33
51
|
return /*#__PURE__*/React.createElement(Anchor, {
|
|
34
52
|
testId: testId,
|
|
35
53
|
onClick: onClick,
|
|
36
54
|
href: href,
|
|
37
|
-
xcss: cx(
|
|
55
|
+
xcss: cx(stylesOld.common, stylesOld.anchor)
|
|
38
56
|
}, children);
|
|
39
57
|
}
|
|
40
58
|
if (onClick) {
|
|
41
59
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
42
60
|
testId: testId,
|
|
43
61
|
onClick: onClick,
|
|
44
|
-
xcss: cx(styles.common, styles.pressable)
|
|
62
|
+
xcss: cx(fg('platform_dst_section_message_actions_as_link') ? styles.common : stylesOld.common, fg('platform_dst_section_message_actions_as_link') ? styles.pressable : stylesOld.pressable)
|
|
45
63
|
}, children);
|
|
46
64
|
}
|
|
47
65
|
return /*#__PURE__*/React.createElement(Box, {
|
|
48
66
|
as: "span",
|
|
49
|
-
testId: testId
|
|
67
|
+
testId: testId,
|
|
68
|
+
xcss: fg('platform_dst_section_message_actions_as_link') && styles.common
|
|
50
69
|
}, children);
|
|
51
70
|
}
|
|
52
71
|
return onClick || href ? /*#__PURE__*/React.createElement(Button, {
|
|
@@ -56,6 +75,6 @@ const SectionMessageAction = /*#__PURE__*/memo(function SectionMessageAction({
|
|
|
56
75
|
onClick: onClick,
|
|
57
76
|
href: href,
|
|
58
77
|
component: href ? linkComponent : undefined
|
|
59
|
-
}, children) : /*#__PURE__*/React.createElement(
|
|
78
|
+
}, children) : /*#__PURE__*/React.createElement(Fragment, null, children);
|
|
60
79
|
});
|
|
61
80
|
export default SectionMessageAction;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
2
|
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
3
|
+
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
3
4
|
._1mou1i6y{margin-block:var(--ds-space-negative-025,-2px)}
|
|
5
|
+
._1rjcpxbi{padding-block:var(--ds-space-200,1pc)}
|
|
6
|
+
._16jlkb7n{flex-grow:1}
|
|
7
|
+
._19pk1i6y{margin-top:var(--ds-space-negative-025,-2px)}
|
|
4
8
|
._1e0c1txw{display:flex}
|
|
5
9
|
._1nmz1hna{word-break:break-word}
|
|
10
|
+
._bfhk1gly{background-color:var(--ds-background-danger,#ffeceb)}
|
|
11
|
+
._bfhk1nvp{background-color:var(--ds-background-discovery,#f3f0ff)}
|
|
12
|
+
._bfhk1tzq{background-color:var(--ds-background-warning,#fff7d6)}
|
|
13
|
+
._bfhk33gi{background-color:var(--ds-background-information,#e9f2ff)}
|
|
14
|
+
._bfhkmv6i{background-color:var(--ds-background-success,#dcfff1)}
|
|
6
15
|
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
/* section-message.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./section-message.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import
|
|
5
|
+
import { Children, forwardRef, Fragment, useCallback, useState } from 'react';
|
|
6
|
+
import { IconButton } from '@atlaskit/button/new';
|
|
5
7
|
import Heading from '@atlaskit/heading';
|
|
8
|
+
import CrossIcon from '@atlaskit/icon/core/migration/cross';
|
|
6
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import {
|
|
10
|
+
import { Inline, Stack } from '@atlaskit/primitives/compiled';
|
|
8
11
|
import { getAppearanceIconStyles } from './internal/appearance-icon';
|
|
9
12
|
const sectionMessageStyles = {
|
|
10
|
-
container: "_2rkoglpi _1nmz1hna",
|
|
11
|
-
|
|
13
|
+
container: "_2rkoglpi _1rjcpxbi _18zrpxbi _1nmz1hna",
|
|
14
|
+
iconContainer: "_1mou1i6y _1e0c1txw",
|
|
15
|
+
contentContainer: "_16jlkb7n",
|
|
12
16
|
content: "_11c82smr _syaz1fxt",
|
|
13
|
-
actionsContainer: "_11c82smr"
|
|
17
|
+
actionsContainer: "_11c82smr",
|
|
18
|
+
dismissButtonContainer: "_19pk1i6y"
|
|
19
|
+
};
|
|
20
|
+
const appearanceStyles = {
|
|
21
|
+
information: "_bfhk33gi",
|
|
22
|
+
warning: "_bfhk1tzq",
|
|
23
|
+
error: "_bfhk1gly",
|
|
24
|
+
success: "_bfhkmv6i",
|
|
25
|
+
discovery: "_bfhk1nvp"
|
|
14
26
|
};
|
|
15
27
|
|
|
16
28
|
/**
|
|
@@ -28,27 +40,29 @@ const SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage({
|
|
|
28
40
|
actions,
|
|
29
41
|
title,
|
|
30
42
|
icon,
|
|
43
|
+
isDismissible,
|
|
31
44
|
testId
|
|
32
45
|
}, ref) {
|
|
46
|
+
const [dismissed, setDismissed] = useState(false);
|
|
47
|
+
const handleDismiss = useCallback(() => {
|
|
48
|
+
setDismissed(true);
|
|
49
|
+
}, []);
|
|
33
50
|
const {
|
|
34
51
|
primaryIconColor: primaryColor,
|
|
35
52
|
backgroundColor: secondaryColor,
|
|
36
53
|
Icon
|
|
37
54
|
} = getAppearanceIconStyles(appearance, icon);
|
|
38
|
-
const actionElements = actions && actions.type ===
|
|
39
|
-
const actionsArray =
|
|
40
|
-
return /*#__PURE__*/React.createElement(
|
|
41
|
-
|
|
42
|
-
backgroundColor: appearanceMap[appearance],
|
|
43
|
-
padding: "space.200",
|
|
44
|
-
testId: testId,
|
|
55
|
+
const actionElements = actions && actions.type === Fragment ? actions.props.children : actions;
|
|
56
|
+
const actionsArray = Children.toArray(actionElements);
|
|
57
|
+
return isDismissible && dismissed ? null : /*#__PURE__*/React.createElement("section", {
|
|
58
|
+
"data-testid": testId,
|
|
45
59
|
ref: ref,
|
|
46
|
-
|
|
60
|
+
className: ax([sectionMessageStyles.container, appearanceStyles[appearance]])
|
|
47
61
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
48
62
|
space: "space.200",
|
|
49
63
|
alignBlock: "stretch"
|
|
50
|
-
}, /*#__PURE__*/React.createElement(
|
|
51
|
-
|
|
64
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: ax([sectionMessageStyles.iconContainer])
|
|
52
66
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
53
67
|
size: "medium",
|
|
54
68
|
primaryColor: primaryColor,
|
|
@@ -60,12 +74,13 @@ const SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage({
|
|
|
60
74
|
spacing: "spacious"
|
|
61
75
|
})), /*#__PURE__*/React.createElement(Stack, {
|
|
62
76
|
space: "space.100",
|
|
63
|
-
testId: testId && `${testId}--content
|
|
77
|
+
testId: testId && `${testId}--content`,
|
|
78
|
+
xcss: sectionMessageStyles.contentContainer
|
|
64
79
|
}, !!title && /*#__PURE__*/React.createElement(Heading, {
|
|
65
80
|
as: "h2",
|
|
66
81
|
size: "small"
|
|
67
|
-
}, title), /*#__PURE__*/React.createElement(
|
|
68
|
-
|
|
82
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: ax([sectionMessageStyles.content])
|
|
69
84
|
}, children), actionsArray.length > 0 && /*#__PURE__*/React.createElement(Inline, {
|
|
70
85
|
shouldWrap: true,
|
|
71
86
|
testId: testId && `${testId}--actions`,
|
|
@@ -82,14 +97,16 @@ const SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage({
|
|
|
82
97
|
React.createElement(Inline, {
|
|
83
98
|
role: actionsArray.length > 1 ? 'listitem' : undefined,
|
|
84
99
|
key: id
|
|
85
|
-
}, action))))
|
|
100
|
+
}, action)))), isDismissible && /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: ax([sectionMessageStyles.dismissButtonContainer])
|
|
102
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
103
|
+
testId: testId && `${testId}--dismiss-button`,
|
|
104
|
+
label: "Dismiss",
|
|
105
|
+
icon: CrossIcon,
|
|
106
|
+
appearance: "subtle",
|
|
107
|
+
onClick: handleDismiss,
|
|
108
|
+
spacing: "compact"
|
|
109
|
+
}))));
|
|
86
110
|
});
|
|
87
|
-
const appearanceMap = {
|
|
88
|
-
information: 'color.background.information',
|
|
89
|
-
warning: 'color.background.warning',
|
|
90
|
-
error: 'color.background.danger',
|
|
91
|
-
success: 'color.background.success',
|
|
92
|
-
discovery: 'color.background.discovery'
|
|
93
|
-
};
|
|
94
111
|
SectionMessage.displayName = 'SectionMessage';
|
|
95
112
|
export default SectionMessage;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
3
|
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
4
|
+
._bfhk1j28{background-color:transparent}
|
|
4
5
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
5
6
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
6
7
|
._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
8
|
+
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
7
9
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
8
10
|
._syaz14q2{color:var(--ds-link,#0c66e4)}
|
|
9
11
|
._u5f3ze3t{padding-right:var(--ds-space-0,0)}._1053w7te:visited{color:var(--ds-link-visited,#5e4db2)}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
/* section-message-action.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./section-message-action.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import
|
|
5
|
+
import { Fragment, memo } from 'react';
|
|
5
6
|
import Button from '@atlaskit/button/standard-button';
|
|
6
7
|
import { cx } from '@atlaskit/css';
|
|
8
|
+
import Link from '@atlaskit/link';
|
|
7
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
10
|
import { Anchor, Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
9
|
-
var
|
|
11
|
+
var stylesOld = {
|
|
10
12
|
common: "_11c82smr _syaz14q2 _k48p1wq8 _30l314q2 _9h8h16c2",
|
|
11
13
|
anchor: "_1053w7te _9oik1r31 _1bnx8stv _jf4cnqa1 _n0fxw7te _1vhvg3x0",
|
|
12
14
|
pressable: "_bfhksm61 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _9oik1r31 _1bnx8stv _jf4cnqa1"
|
|
13
15
|
};
|
|
16
|
+
var styles = {
|
|
17
|
+
common: "_11c82smr",
|
|
18
|
+
anchor: "_k48pi7a9",
|
|
19
|
+
pressable: "_syaz14q2 _k48p1wq8 _bfhk1j28 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _9oik1r31 _1bnx8stv _jf4cnqa1 _30l314q2 _9h8h16c2"
|
|
20
|
+
};
|
|
14
21
|
|
|
15
22
|
/**
|
|
16
23
|
* __Section message action__
|
|
@@ -26,26 +33,38 @@ var SectionMessageAction = /*#__PURE__*/memo(function SectionMessageAction(_ref)
|
|
|
26
33
|
onClick = _ref.onClick,
|
|
27
34
|
href = _ref.href,
|
|
28
35
|
testId = _ref.testId,
|
|
29
|
-
linkComponent = _ref.linkComponent
|
|
36
|
+
linkComponent = _ref.linkComponent,
|
|
37
|
+
target = _ref.target;
|
|
30
38
|
if (!linkComponent && fg('platform_section_message_action_migration')) {
|
|
31
39
|
if (href) {
|
|
40
|
+
if (fg('platform_dst_section_message_actions_as_link')) {
|
|
41
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
42
|
+
className: ax([styles.common, styles.anchor])
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
44
|
+
testId: testId,
|
|
45
|
+
onClick: onClick,
|
|
46
|
+
href: href,
|
|
47
|
+
target: target
|
|
48
|
+
}, children));
|
|
49
|
+
}
|
|
32
50
|
return /*#__PURE__*/React.createElement(Anchor, {
|
|
33
51
|
testId: testId,
|
|
34
52
|
onClick: onClick,
|
|
35
53
|
href: href,
|
|
36
|
-
xcss: cx(
|
|
54
|
+
xcss: cx(stylesOld.common, stylesOld.anchor)
|
|
37
55
|
}, children);
|
|
38
56
|
}
|
|
39
57
|
if (onClick) {
|
|
40
58
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
41
59
|
testId: testId,
|
|
42
60
|
onClick: onClick,
|
|
43
|
-
xcss: cx(styles.common, styles.pressable)
|
|
61
|
+
xcss: cx(fg('platform_dst_section_message_actions_as_link') ? styles.common : stylesOld.common, fg('platform_dst_section_message_actions_as_link') ? styles.pressable : stylesOld.pressable)
|
|
44
62
|
}, children);
|
|
45
63
|
}
|
|
46
64
|
return /*#__PURE__*/React.createElement(Box, {
|
|
47
65
|
as: "span",
|
|
48
|
-
testId: testId
|
|
66
|
+
testId: testId,
|
|
67
|
+
xcss: fg('platform_dst_section_message_actions_as_link') && styles.common
|
|
49
68
|
}, children);
|
|
50
69
|
}
|
|
51
70
|
return onClick || href ? /*#__PURE__*/React.createElement(Button, {
|
|
@@ -55,6 +74,6 @@ var SectionMessageAction = /*#__PURE__*/memo(function SectionMessageAction(_ref)
|
|
|
55
74
|
onClick: onClick,
|
|
56
75
|
href: href,
|
|
57
76
|
component: href ? linkComponent : undefined
|
|
58
|
-
}, children) : /*#__PURE__*/React.createElement(
|
|
77
|
+
}, children) : /*#__PURE__*/React.createElement(Fragment, null, children);
|
|
59
78
|
});
|
|
60
79
|
export default SectionMessageAction;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
2
|
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
3
|
+
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
3
4
|
._1mou1i6y{margin-block:var(--ds-space-negative-025,-2px)}
|
|
5
|
+
._1rjcpxbi{padding-block:var(--ds-space-200,1pc)}
|
|
6
|
+
._16jlkb7n{flex-grow:1}
|
|
7
|
+
._19pk1i6y{margin-top:var(--ds-space-negative-025,-2px)}
|
|
4
8
|
._1e0c1txw{display:flex}
|
|
5
9
|
._1nmz1hna{word-break:break-word}
|
|
10
|
+
._bfhk1gly{background-color:var(--ds-background-danger,#ffeceb)}
|
|
11
|
+
._bfhk1nvp{background-color:var(--ds-background-discovery,#f3f0ff)}
|
|
12
|
+
._bfhk1tzq{background-color:var(--ds-background-warning,#fff7d6)}
|
|
13
|
+
._bfhk33gi{background-color:var(--ds-background-information,#e9f2ff)}
|
|
14
|
+
._bfhkmv6i{background-color:var(--ds-background-success,#dcfff1)}
|
|
6
15
|
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
/* section-message.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import "./section-message.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
3
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import
|
|
6
|
+
import { Children, forwardRef, Fragment, useCallback, useState } from 'react';
|
|
7
|
+
import { IconButton } from '@atlaskit/button/new';
|
|
5
8
|
import Heading from '@atlaskit/heading';
|
|
9
|
+
import CrossIcon from '@atlaskit/icon/core/migration/cross';
|
|
6
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import {
|
|
11
|
+
import { Inline, Stack } from '@atlaskit/primitives/compiled';
|
|
8
12
|
import { getAppearanceIconStyles } from './internal/appearance-icon';
|
|
9
13
|
var sectionMessageStyles = {
|
|
10
|
-
container: "_2rkoglpi _1nmz1hna",
|
|
11
|
-
|
|
14
|
+
container: "_2rkoglpi _1rjcpxbi _18zrpxbi _1nmz1hna",
|
|
15
|
+
iconContainer: "_1mou1i6y _1e0c1txw",
|
|
16
|
+
contentContainer: "_16jlkb7n",
|
|
12
17
|
content: "_11c82smr _syaz1fxt",
|
|
13
|
-
actionsContainer: "_11c82smr"
|
|
18
|
+
actionsContainer: "_11c82smr",
|
|
19
|
+
dismissButtonContainer: "_19pk1i6y"
|
|
20
|
+
};
|
|
21
|
+
var appearanceStyles = {
|
|
22
|
+
information: "_bfhk33gi",
|
|
23
|
+
warning: "_bfhk1tzq",
|
|
24
|
+
error: "_bfhk1gly",
|
|
25
|
+
success: "_bfhkmv6i",
|
|
26
|
+
discovery: "_bfhk1nvp"
|
|
14
27
|
};
|
|
15
28
|
|
|
16
29
|
/**
|
|
@@ -29,25 +42,30 @@ var SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(_ref, ref)
|
|
|
29
42
|
actions = _ref.actions,
|
|
30
43
|
title = _ref.title,
|
|
31
44
|
icon = _ref.icon,
|
|
45
|
+
isDismissible = _ref.isDismissible,
|
|
32
46
|
testId = _ref.testId;
|
|
47
|
+
var _useState = useState(false),
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
dismissed = _useState2[0],
|
|
50
|
+
setDismissed = _useState2[1];
|
|
51
|
+
var handleDismiss = useCallback(function () {
|
|
52
|
+
setDismissed(true);
|
|
53
|
+
}, []);
|
|
33
54
|
var _getAppearanceIconSty = getAppearanceIconStyles(appearance, icon),
|
|
34
55
|
primaryColor = _getAppearanceIconSty.primaryIconColor,
|
|
35
56
|
secondaryColor = _getAppearanceIconSty.backgroundColor,
|
|
36
57
|
Icon = _getAppearanceIconSty.Icon;
|
|
37
|
-
var actionElements = actions && actions.type ===
|
|
38
|
-
var actionsArray =
|
|
39
|
-
return /*#__PURE__*/React.createElement(
|
|
40
|
-
|
|
41
|
-
backgroundColor: appearanceMap[appearance],
|
|
42
|
-
padding: "space.200",
|
|
43
|
-
testId: testId,
|
|
58
|
+
var actionElements = actions && actions.type === Fragment ? actions.props.children : actions;
|
|
59
|
+
var actionsArray = Children.toArray(actionElements);
|
|
60
|
+
return isDismissible && dismissed ? null : /*#__PURE__*/React.createElement("section", {
|
|
61
|
+
"data-testid": testId,
|
|
44
62
|
ref: ref,
|
|
45
|
-
|
|
63
|
+
className: ax([sectionMessageStyles.container, appearanceStyles[appearance]])
|
|
46
64
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
47
65
|
space: "space.200",
|
|
48
66
|
alignBlock: "stretch"
|
|
49
|
-
}, /*#__PURE__*/React.createElement(
|
|
50
|
-
|
|
67
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: ax([sectionMessageStyles.iconContainer])
|
|
51
69
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
52
70
|
size: "medium",
|
|
53
71
|
primaryColor: primaryColor,
|
|
@@ -59,12 +77,13 @@ var SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(_ref, ref)
|
|
|
59
77
|
spacing: "spacious"
|
|
60
78
|
})), /*#__PURE__*/React.createElement(Stack, {
|
|
61
79
|
space: "space.100",
|
|
62
|
-
testId: testId && "".concat(testId, "--content")
|
|
80
|
+
testId: testId && "".concat(testId, "--content"),
|
|
81
|
+
xcss: sectionMessageStyles.contentContainer
|
|
63
82
|
}, !!title && /*#__PURE__*/React.createElement(Heading, {
|
|
64
83
|
as: "h2",
|
|
65
84
|
size: "small"
|
|
66
|
-
}, title), /*#__PURE__*/React.createElement(
|
|
67
|
-
|
|
85
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: ax([sectionMessageStyles.content])
|
|
68
87
|
}, children), actionsArray.length > 0 && /*#__PURE__*/React.createElement(Inline, {
|
|
69
88
|
shouldWrap: true,
|
|
70
89
|
testId: testId && "".concat(testId, "--actions"),
|
|
@@ -84,14 +103,16 @@ var SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(_ref, ref)
|
|
|
84
103
|
key: id
|
|
85
104
|
}, action)
|
|
86
105
|
);
|
|
87
|
-
})))
|
|
106
|
+
}))), isDismissible && /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
className: ax([sectionMessageStyles.dismissButtonContainer])
|
|
108
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
109
|
+
testId: testId && "".concat(testId, "--dismiss-button"),
|
|
110
|
+
label: "Dismiss",
|
|
111
|
+
icon: CrossIcon,
|
|
112
|
+
appearance: "subtle",
|
|
113
|
+
onClick: handleDismiss,
|
|
114
|
+
spacing: "compact"
|
|
115
|
+
}))));
|
|
88
116
|
});
|
|
89
|
-
var appearanceMap = {
|
|
90
|
-
information: 'color.background.information',
|
|
91
|
-
warning: 'color.background.warning',
|
|
92
|
-
error: 'color.background.danger',
|
|
93
|
-
success: 'color.background.success',
|
|
94
|
-
discovery: 'color.background.discovery'
|
|
95
|
-
};
|
|
96
117
|
SectionMessage.displayName = 'SectionMessage';
|
|
97
118
|
export default SectionMessage;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { SectionMessageActionProps } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* __Section message action__
|
|
@@ -9,5 +9,5 @@ import type { SectionMessageActionProps } from './types';
|
|
|
9
9
|
*
|
|
10
10
|
* - [Examples](https://atlassian.design/components/section-message/examples#actions)
|
|
11
11
|
*/
|
|
12
|
-
declare const SectionMessageAction:
|
|
12
|
+
declare const SectionMessageAction: import("react").NamedExoticComponent<SectionMessageActionProps>;
|
|
13
13
|
export default SectionMessageAction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { SectionMessageProps } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* __Section message__
|
|
@@ -9,5 +9,5 @@ import type { SectionMessageProps } from './types';
|
|
|
9
9
|
* - [Code](https://atlassian.design/components/section-message/code)
|
|
10
10
|
* - [Usage](https://atlassian.design/components/section-message/usage)
|
|
11
11
|
*/
|
|
12
|
-
declare const SectionMessage:
|
|
12
|
+
declare const SectionMessage: import("react").ForwardRefExoticComponent<SectionMessageProps & import("react").RefAttributes<HTMLElement>>;
|
|
13
13
|
export default SectionMessage;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -33,6 +33,12 @@ export interface SectionMessageProps {
|
|
|
33
33
|
* to see how to provide this icon.
|
|
34
34
|
*/
|
|
35
35
|
icon?: React.ElementType;
|
|
36
|
+
/**
|
|
37
|
+
* Displays a dismiss button, that allows the user to dismiss the message.
|
|
38
|
+
* It will be removed from the DOM immediately and will not be re-rendered.
|
|
39
|
+
* It does not handle persistence of the dismissed state across page reloads or remounts.
|
|
40
|
+
*/
|
|
41
|
+
isDismissible?: boolean;
|
|
36
42
|
/**
|
|
37
43
|
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
38
44
|
* in the rendered code, serving as a hook for automated tests.
|
|
@@ -62,6 +68,10 @@ export interface SectionMessageActionProps {
|
|
|
62
68
|
* The URL that the rendered link button will point to.
|
|
63
69
|
*/
|
|
64
70
|
href?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The target attribute of the link. This is only used if the href prop is passed.
|
|
73
|
+
*/
|
|
74
|
+
target?: HTMLAnchorElement['target'];
|
|
65
75
|
/**
|
|
66
76
|
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
67
77
|
* in the rendered code, serving as a hook for automated tests.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { SectionMessageActionProps } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* __Section message action__
|
|
@@ -9,5 +9,5 @@ import type { SectionMessageActionProps } from './types';
|
|
|
9
9
|
*
|
|
10
10
|
* - [Examples](https://atlassian.design/components/section-message/examples#actions)
|
|
11
11
|
*/
|
|
12
|
-
declare const SectionMessageAction:
|
|
12
|
+
declare const SectionMessageAction: import("react").NamedExoticComponent<SectionMessageActionProps>;
|
|
13
13
|
export default SectionMessageAction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { SectionMessageProps } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* __Section message__
|
|
@@ -9,5 +9,5 @@ import type { SectionMessageProps } from './types';
|
|
|
9
9
|
* - [Code](https://atlassian.design/components/section-message/code)
|
|
10
10
|
* - [Usage](https://atlassian.design/components/section-message/usage)
|
|
11
11
|
*/
|
|
12
|
-
declare const SectionMessage:
|
|
12
|
+
declare const SectionMessage: import("react").ForwardRefExoticComponent<SectionMessageProps & import("react").RefAttributes<HTMLElement>>;
|
|
13
13
|
export default SectionMessage;
|
|
@@ -33,6 +33,12 @@ export interface SectionMessageProps {
|
|
|
33
33
|
* to see how to provide this icon.
|
|
34
34
|
*/
|
|
35
35
|
icon?: React.ElementType;
|
|
36
|
+
/**
|
|
37
|
+
* Displays a dismiss button, that allows the user to dismiss the message.
|
|
38
|
+
* It will be removed from the DOM immediately and will not be re-rendered.
|
|
39
|
+
* It does not handle persistence of the dismissed state across page reloads or remounts.
|
|
40
|
+
*/
|
|
41
|
+
isDismissible?: boolean;
|
|
36
42
|
/**
|
|
37
43
|
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
38
44
|
* in the rendered code, serving as a hook for automated tests.
|
|
@@ -62,6 +68,10 @@ export interface SectionMessageActionProps {
|
|
|
62
68
|
* The URL that the rendered link button will point to.
|
|
63
69
|
*/
|
|
64
70
|
href?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The target attribute of the link. This is only used if the href prop is passed.
|
|
73
|
+
*/
|
|
74
|
+
target?: HTMLAnchorElement['target'];
|
|
65
75
|
/**
|
|
66
76
|
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
67
77
|
* 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.5.0",
|
|
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/"
|
|
@@ -38,11 +38,12 @@
|
|
|
38
38
|
".": "./src/index.tsx"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@atlaskit/button": "^23.
|
|
41
|
+
"@atlaskit/button": "^23.3.0",
|
|
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": "^27.
|
|
45
|
+
"@atlaskit/icon": "^27.7.0",
|
|
46
|
+
"@atlaskit/link": "^3.2.0",
|
|
46
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
48
|
"@atlaskit/primitives": "^14.10.0",
|
|
48
49
|
"@atlaskit/theme": "^19.0.0",
|
|
@@ -59,13 +60,13 @@
|
|
|
59
60
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
60
61
|
"@atlaskit/code": "^17.2.0",
|
|
61
62
|
"@atlaskit/docs": "^11.0.0",
|
|
62
|
-
"@atlaskit/ds-lib": "^
|
|
63
|
+
"@atlaskit/ds-lib": "^5.0.0",
|
|
63
64
|
"@atlaskit/form": "^12.0.0",
|
|
64
|
-
"@atlaskit/link": "^3.2.0",
|
|
65
65
|
"@atlaskit/range": "^9.1.0",
|
|
66
66
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
67
67
|
"@atlassian/ssr-tests": "^0.2.0",
|
|
68
68
|
"@testing-library/react": "^13.4.0",
|
|
69
|
+
"@testing-library/user-event": "^14.4.3",
|
|
69
70
|
"react-dom": "^18.2.0",
|
|
70
71
|
"typescript": "~5.4.2"
|
|
71
72
|
},
|
|
@@ -96,6 +97,9 @@
|
|
|
96
97
|
"platform_section_message_action_migration": {
|
|
97
98
|
"type": "boolean"
|
|
98
99
|
},
|
|
100
|
+
"platform_dst_section_message_actions_as_link": {
|
|
101
|
+
"type": "boolean"
|
|
102
|
+
},
|
|
99
103
|
"platform_ads_explicit_font_styles": {
|
|
100
104
|
"type": "boolean"
|
|
101
105
|
},
|