@atlaskit/section-message 8.12.14 → 8.13.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 +14 -0
- package/dist/cjs/section-message.js +3 -1
- package/dist/es2019/section-message.js +2 -1
- package/dist/esm/section-message.js +3 -1
- package/dist/types/types.d.ts +16 -1
- package/dist/types-ts4.5/types.d.ts +16 -1
- package/package.json +5 -5
- package/offerings.json +0 -35
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/section-message
|
|
2
2
|
|
|
3
|
+
## 8.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`36317b7bc1752`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/36317b7bc1752) -
|
|
8
|
+
Add `headingLevel` prop to customize heading element and ensure makers can use proper and
|
|
9
|
+
accessible heading structures.
|
|
10
|
+
|
|
11
|
+
## 8.12.15
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 8.12.14
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -51,6 +51,8 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function SectionMessage
|
|
|
51
51
|
appearance = _ref$appearance === void 0 ? 'information' : _ref$appearance,
|
|
52
52
|
actions = _ref.actions,
|
|
53
53
|
title = _ref.title,
|
|
54
|
+
_ref$headingLevel = _ref.headingLevel,
|
|
55
|
+
headingLevel = _ref$headingLevel === void 0 ? 'h2' : _ref$headingLevel,
|
|
54
56
|
icon = _ref.icon,
|
|
55
57
|
isDismissible = _ref.isDismissible,
|
|
56
58
|
onDismiss = _ref.onDismiss,
|
|
@@ -91,7 +93,7 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function SectionMessage
|
|
|
91
93
|
testId: testId && "".concat(testId, "--content"),
|
|
92
94
|
xcss: sectionMessageStyles.contentContainer
|
|
93
95
|
}, !!title && /*#__PURE__*/React.createElement(_heading.default, {
|
|
94
|
-
as:
|
|
96
|
+
as: headingLevel,
|
|
95
97
|
size: "small"
|
|
96
98
|
}, title), /*#__PURE__*/React.createElement("div", {
|
|
97
99
|
className: (0, _runtime.ax)([sectionMessageStyles.content])
|
|
@@ -40,6 +40,7 @@ const SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage({
|
|
|
40
40
|
appearance = 'information',
|
|
41
41
|
actions,
|
|
42
42
|
title,
|
|
43
|
+
headingLevel = 'h2',
|
|
43
44
|
icon,
|
|
44
45
|
isDismissible,
|
|
45
46
|
onDismiss,
|
|
@@ -79,7 +80,7 @@ const SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage({
|
|
|
79
80
|
testId: testId && `${testId}--content`,
|
|
80
81
|
xcss: sectionMessageStyles.contentContainer
|
|
81
82
|
}, !!title && /*#__PURE__*/React.createElement(Heading, {
|
|
82
|
-
as:
|
|
83
|
+
as: headingLevel,
|
|
83
84
|
size: "small"
|
|
84
85
|
}, title), /*#__PURE__*/React.createElement("div", {
|
|
85
86
|
className: ax([sectionMessageStyles.content])
|
|
@@ -42,6 +42,8 @@ var SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(_ref, ref)
|
|
|
42
42
|
appearance = _ref$appearance === void 0 ? 'information' : _ref$appearance,
|
|
43
43
|
actions = _ref.actions,
|
|
44
44
|
title = _ref.title,
|
|
45
|
+
_ref$headingLevel = _ref.headingLevel,
|
|
46
|
+
headingLevel = _ref$headingLevel === void 0 ? 'h2' : _ref$headingLevel,
|
|
45
47
|
icon = _ref.icon,
|
|
46
48
|
isDismissible = _ref.isDismissible,
|
|
47
49
|
onDismiss = _ref.onDismiss,
|
|
@@ -82,7 +84,7 @@ var SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(_ref, ref)
|
|
|
82
84
|
testId: testId && "".concat(testId, "--content"),
|
|
83
85
|
xcss: sectionMessageStyles.contentContainer
|
|
84
86
|
}, !!title && /*#__PURE__*/React.createElement(Heading, {
|
|
85
|
-
as:
|
|
87
|
+
as: headingLevel,
|
|
86
88
|
size: "small"
|
|
87
89
|
}, title), /*#__PURE__*/React.createElement("div", {
|
|
88
90
|
className: ax([sectionMessageStyles.content])
|
package/dist/types/types.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
4
4
|
* Appearance determines the icon and background color pairing indicating the message type
|
|
5
5
|
*/
|
|
6
6
|
export type Appearance = 'information' | 'warning' | 'error' | 'success' | 'discovery';
|
|
7
|
-
|
|
7
|
+
type HeadingElements = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
8
|
+
interface BaseSectionMessageProps {
|
|
8
9
|
/**
|
|
9
10
|
* The appearance styling to use for the section message.
|
|
10
11
|
*/
|
|
@@ -14,6 +15,11 @@ export interface SectionMessageProps {
|
|
|
14
15
|
* we recommend that this should be a paragraph.
|
|
15
16
|
*/
|
|
16
17
|
children: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Allows the section message's `title` to be rendered as the specified HTML
|
|
20
|
+
* heading element. The default heading element is `h2`.
|
|
21
|
+
*/
|
|
22
|
+
headingLevel?: HeadingElements;
|
|
17
23
|
/**
|
|
18
24
|
* The heading of the section message.
|
|
19
25
|
*/
|
|
@@ -49,6 +55,14 @@ export interface SectionMessageProps {
|
|
|
49
55
|
*/
|
|
50
56
|
testId?: string;
|
|
51
57
|
}
|
|
58
|
+
type ConditionalSectionMessageProps = {
|
|
59
|
+
headingLevel?: HeadingElements;
|
|
60
|
+
title: string;
|
|
61
|
+
} | {
|
|
62
|
+
headingLevel?: never;
|
|
63
|
+
title?: never;
|
|
64
|
+
};
|
|
65
|
+
export type SectionMessageProps = BaseSectionMessageProps & ConditionalSectionMessageProps;
|
|
52
66
|
export interface SectionMessageActionProps {
|
|
53
67
|
/**
|
|
54
68
|
* The text that needs to be displayed for section message action.
|
|
@@ -82,3 +96,4 @@ export interface SectionMessageActionProps {
|
|
|
82
96
|
*/
|
|
83
97
|
testId?: string;
|
|
84
98
|
}
|
|
99
|
+
export {};
|
|
@@ -4,7 +4,8 @@ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
4
4
|
* Appearance determines the icon and background color pairing indicating the message type
|
|
5
5
|
*/
|
|
6
6
|
export type Appearance = 'information' | 'warning' | 'error' | 'success' | 'discovery';
|
|
7
|
-
|
|
7
|
+
type HeadingElements = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
8
|
+
interface BaseSectionMessageProps {
|
|
8
9
|
/**
|
|
9
10
|
* The appearance styling to use for the section message.
|
|
10
11
|
*/
|
|
@@ -14,6 +15,11 @@ export interface SectionMessageProps {
|
|
|
14
15
|
* we recommend that this should be a paragraph.
|
|
15
16
|
*/
|
|
16
17
|
children: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Allows the section message's `title` to be rendered as the specified HTML
|
|
20
|
+
* heading element. The default heading element is `h2`.
|
|
21
|
+
*/
|
|
22
|
+
headingLevel?: HeadingElements;
|
|
17
23
|
/**
|
|
18
24
|
* The heading of the section message.
|
|
19
25
|
*/
|
|
@@ -49,6 +55,14 @@ export interface SectionMessageProps {
|
|
|
49
55
|
*/
|
|
50
56
|
testId?: string;
|
|
51
57
|
}
|
|
58
|
+
type ConditionalSectionMessageProps = {
|
|
59
|
+
headingLevel?: HeadingElements;
|
|
60
|
+
title: string;
|
|
61
|
+
} | {
|
|
62
|
+
headingLevel?: never;
|
|
63
|
+
title?: never;
|
|
64
|
+
};
|
|
65
|
+
export type SectionMessageProps = BaseSectionMessageProps & ConditionalSectionMessageProps;
|
|
52
66
|
export interface SectionMessageActionProps {
|
|
53
67
|
/**
|
|
54
68
|
* The text that needs to be displayed for section message action.
|
|
@@ -82,3 +96,4 @@ export interface SectionMessageActionProps {
|
|
|
82
96
|
*/
|
|
83
97
|
testId?: string;
|
|
84
98
|
}
|
|
99
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/section-message",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.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/"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/button": "^23.11.0",
|
|
43
43
|
"@atlaskit/css": "^0.19.0",
|
|
44
44
|
"@atlaskit/heading": "^5.4.0",
|
|
45
|
-
"@atlaskit/icon": "^
|
|
45
|
+
"@atlaskit/icon": "^35.0.0",
|
|
46
46
|
"@atlaskit/link": "^3.4.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/primitives": "^19.0.0",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"@af/integration-testing": "workspace:^",
|
|
58
58
|
"@af/visual-regression": "workspace:^",
|
|
59
59
|
"@atlaskit/analytics-next": "^11.2.0",
|
|
60
|
-
"@atlaskit/code": "^17.
|
|
61
|
-
"@atlaskit/docs": "^11.
|
|
60
|
+
"@atlaskit/code": "^17.5.0",
|
|
61
|
+
"@atlaskit/docs": "^11.8.0",
|
|
62
62
|
"@atlaskit/ds-lib": "^7.0.0",
|
|
63
63
|
"@atlaskit/form": "^15.5.0",
|
|
64
|
-
"@atlaskit/range": "^10.
|
|
64
|
+
"@atlaskit/range": "^10.1.0",
|
|
65
65
|
"@atlassian/react-compiler-gating": "workspace:^",
|
|
66
66
|
"@atlassian/ssr-tests": "workspace:^",
|
|
67
67
|
"@atlassian/structured-docs-types": "workspace:^",
|
package/offerings.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"name": "SectionMessage",
|
|
4
|
-
"package": "@atlaskit/section-message",
|
|
5
|
-
"import": {
|
|
6
|
-
"name": "SectionMessage",
|
|
7
|
-
"package": "@atlaskit/section-message",
|
|
8
|
-
"type": "default"
|
|
9
|
-
},
|
|
10
|
-
"keywords": ["section", "message", "alert", "notification", "contextual", "information"],
|
|
11
|
-
"categories": ["feedback"],
|
|
12
|
-
"shortDescription": "A component for section-level messages.",
|
|
13
|
-
"status": "general-availability",
|
|
14
|
-
"accessibilityGuidelines": [
|
|
15
|
-
"Ensure section message content is announced by screen readers",
|
|
16
|
-
"Use appropriate color contrast for text readability",
|
|
17
|
-
"Provide clear, actionable messaging",
|
|
18
|
-
"Consider keyboard navigation for interactive section messages"
|
|
19
|
-
],
|
|
20
|
-
"usageGuidelines": [
|
|
21
|
-
"Use for contextual information within sections",
|
|
22
|
-
"Choose appropriate appearance variants for message type",
|
|
23
|
-
"Keep messaging concise and actionable",
|
|
24
|
-
"Position section messages near relevant content",
|
|
25
|
-
"Consider dismissibility for non-critical messages"
|
|
26
|
-
],
|
|
27
|
-
"contentGuidelines": [
|
|
28
|
-
"Write clear, concise messages",
|
|
29
|
-
"Use action-oriented language when appropriate",
|
|
30
|
-
"Ensure messages are relevant to the current context",
|
|
31
|
-
"Provide clear next steps when needed"
|
|
32
|
-
],
|
|
33
|
-
"examples": ["./examples/ai/section-message.tsx"]
|
|
34
|
-
}
|
|
35
|
-
]
|