@atlaskit/section-message 8.12.15 → 9.0.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 +34 -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/package.json +16 -23
- package/section-message/package.json +1 -8
- package/section-message-action/package.json +1 -8
- package/section-message.docs.tsx +45 -43
- package/types/package.json +1 -8
- package/dist/types-ts4.5/entry-points/section-message-action.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/section-message.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -3
- package/dist/types-ts4.5/internal/appearance-icon.d.ts +0 -10
- package/dist/types-ts4.5/section-message-action.d.ts +0 -12
- package/dist/types-ts4.5/section-message.d.ts +0 -12
- package/dist/types-ts4.5/types.d.ts +0 -84
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @atlaskit/section-message
|
|
2
2
|
|
|
3
|
+
## 9.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
8
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
9
|
+
|
|
10
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
11
|
+
|
|
12
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- "typesVersions": {
|
|
16
|
+
- ">=4.5 <4.9": {
|
|
17
|
+
- "*": [
|
|
18
|
+
- "dist/types-ts4.5/*",
|
|
19
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
20
|
+
- ]
|
|
21
|
+
- }
|
|
22
|
+
- },
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
29
|
+
## 8.13.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- [`36317b7bc1752`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/36317b7bc1752) -
|
|
34
|
+
Add `headingLevel` prop to customize heading element and ensure makers can use proper and
|
|
35
|
+
accessible heading structures.
|
|
36
|
+
|
|
3
37
|
## 8.12.15
|
|
4
38
|
|
|
5
39
|
### 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 {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/section-message",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.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/"
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
-
"typesVersions": {
|
|
16
|
-
">=4.5 <4.9": {
|
|
17
|
-
"*": [
|
|
18
|
-
"dist/types-ts4.5/*",
|
|
19
|
-
"dist/types-ts4.5/index.d.ts"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
15
|
"sideEffects": [
|
|
24
16
|
"**/*.compiled.css"
|
|
25
17
|
],
|
|
@@ -39,14 +31,14 @@
|
|
|
39
31
|
}
|
|
40
32
|
},
|
|
41
33
|
"dependencies": {
|
|
42
|
-
"@atlaskit/button": "^
|
|
43
|
-
"@atlaskit/css": "^0.
|
|
44
|
-
"@atlaskit/heading": "^
|
|
45
|
-
"@atlaskit/icon": "^
|
|
46
|
-
"@atlaskit/link": "^
|
|
47
|
-
"@atlaskit/platform-feature-flags": "^
|
|
48
|
-
"@atlaskit/primitives": "^
|
|
49
|
-
"@atlaskit/tokens": "^
|
|
34
|
+
"@atlaskit/button": "^24.0.0",
|
|
35
|
+
"@atlaskit/css": "^1.0.0",
|
|
36
|
+
"@atlaskit/heading": "^6.0.0",
|
|
37
|
+
"@atlaskit/icon": "^36.0.0",
|
|
38
|
+
"@atlaskit/link": "^4.0.0",
|
|
39
|
+
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
40
|
+
"@atlaskit/primitives": "^20.0.0",
|
|
41
|
+
"@atlaskit/tokens": "^14.0.0",
|
|
50
42
|
"@babel/runtime": "^7.0.0"
|
|
51
43
|
},
|
|
52
44
|
"peerDependencies": {
|
|
@@ -56,17 +48,18 @@
|
|
|
56
48
|
"@af/accessibility-testing": "workspace:^",
|
|
57
49
|
"@af/integration-testing": "workspace:^",
|
|
58
50
|
"@af/visual-regression": "workspace:^",
|
|
59
|
-
"@atlaskit/analytics-next": "^
|
|
60
|
-
"@atlaskit/code": "^
|
|
61
|
-
"@atlaskit/docs": "^
|
|
62
|
-
"@atlaskit/ds-lib": "^
|
|
63
|
-
"@atlaskit/form": "^
|
|
64
|
-
"@atlaskit/range": "^
|
|
51
|
+
"@atlaskit/analytics-next": "^12.0.0",
|
|
52
|
+
"@atlaskit/code": "^18.0.0",
|
|
53
|
+
"@atlaskit/docs": "^12.0.0",
|
|
54
|
+
"@atlaskit/ds-lib": "^8.0.0",
|
|
55
|
+
"@atlaskit/form": "^16.0.0",
|
|
56
|
+
"@atlaskit/range": "^11.0.0",
|
|
65
57
|
"@atlassian/react-compiler-gating": "workspace:^",
|
|
66
58
|
"@atlassian/ssr-tests": "workspace:^",
|
|
67
59
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
68
60
|
"@testing-library/react": "^16.3.0",
|
|
69
61
|
"@testing-library/user-event": "^14.4.3",
|
|
62
|
+
"react": "^18.2.0",
|
|
70
63
|
"react-dom": "^18.2.0"
|
|
71
64
|
},
|
|
72
65
|
"techstack": {
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/section-message.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/section-message.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/section-message.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/section-message-action.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/section-message-action.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/section-message-action.d.ts"
|
|
17
10
|
}
|
package/section-message.docs.tsx
CHANGED
|
@@ -1,50 +1,52 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
|
|
4
4
|
|
|
5
|
-
const documentation:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
description: 'A component for section-level messages.',
|
|
9
|
-
status: 'general-availability',
|
|
10
|
-
import: {
|
|
5
|
+
const documentation: StructuredContentSource = {
|
|
6
|
+
components: [
|
|
7
|
+
{
|
|
11
8
|
name: 'SectionMessage',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'Anatomy: icon+color, title (optional), description, actions (optional)',
|
|
21
|
-
'Use Banner for site-wide; Flag after an event; Inline message for smaller context',
|
|
22
|
-
],
|
|
23
|
-
contentGuidelines: [
|
|
24
|
-
'Title: state the issue or reason',
|
|
25
|
-
'Description: clear, concise, empathetic; use active verbs',
|
|
26
|
-
'Avoid blame—use "we\'re having trouble" not "you\'re having issues"',
|
|
27
|
-
'Provide clear next steps when needed',
|
|
28
|
-
],
|
|
29
|
-
accessibilityGuidelines: [
|
|
30
|
-
'Do not rely on color alone for severity',
|
|
31
|
-
'Avoid dead ends—always indicate how to proceed',
|
|
32
|
-
'Use descriptive link text that describes the destination',
|
|
33
|
-
'Ensure section message content is announced by screen readers',
|
|
34
|
-
'Use appropriate color contrast for text readability',
|
|
35
|
-
'Provide clear, actionable messaging',
|
|
36
|
-
'Consider keyboard navigation for interactive section messages',
|
|
37
|
-
],
|
|
38
|
-
examples: [
|
|
39
|
-
{
|
|
40
|
-
name: 'Section Message',
|
|
41
|
-
description: 'Section Message example',
|
|
42
|
-
source: path.resolve(__dirname, './examples/ai/section-message.tsx'),
|
|
9
|
+
description: 'A component for section-level messages.',
|
|
10
|
+
status: 'general-availability',
|
|
11
|
+
import: {
|
|
12
|
+
name: 'SectionMessage',
|
|
13
|
+
package: '@atlaskit/section-message',
|
|
14
|
+
type: 'default',
|
|
15
|
+
packagePath: path.resolve(__dirname),
|
|
16
|
+
packageJson: require('./package.json'),
|
|
43
17
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
18
|
+
usageGuidelines: [
|
|
19
|
+
'Use for section-level important info that persists until action or resolution',
|
|
20
|
+
'Use when: destructive consequences, action needed to proceed, connectivity or auth issues',
|
|
21
|
+
'Anatomy: icon+color, title (optional), description, actions (optional)',
|
|
22
|
+
'Use Banner for site-wide; Flag after an event; Inline message for smaller context',
|
|
23
|
+
],
|
|
24
|
+
contentGuidelines: [
|
|
25
|
+
'Title: state the issue or reason',
|
|
26
|
+
'Description: clear, concise, empathetic; use active verbs',
|
|
27
|
+
'Avoid blame—use "we\'re having trouble" not "you\'re having issues"',
|
|
28
|
+
'Provide clear next steps when needed',
|
|
29
|
+
],
|
|
30
|
+
accessibilityGuidelines: [
|
|
31
|
+
'Do not rely on color alone for severity',
|
|
32
|
+
'Avoid dead ends—always indicate how to proceed',
|
|
33
|
+
'Use descriptive link text that describes the destination',
|
|
34
|
+
'Ensure section message content is announced by screen readers',
|
|
35
|
+
'Use appropriate color contrast for text readability',
|
|
36
|
+
'Provide clear, actionable messaging',
|
|
37
|
+
'Consider keyboard navigation for interactive section messages',
|
|
38
|
+
],
|
|
39
|
+
examples: [
|
|
40
|
+
{
|
|
41
|
+
name: 'Section Message',
|
|
42
|
+
description: 'Section Message example',
|
|
43
|
+
source: path.resolve(__dirname, './examples/ai/section-message.tsx'),
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
keywords: ['section', 'message', 'alert', 'notification', 'contextual', 'information'],
|
|
47
|
+
categories: ['feedback'],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
49
51
|
|
|
50
52
|
export default documentation;
|
package/types/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
17
10
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { Appearance, SectionMessageProps, SectionMessageActionProps } from '../types';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { type ComponentType } from 'react';
|
|
2
|
-
import type { Appearance, SectionMessageProps } from '../types';
|
|
3
|
-
export declare function getAppearanceIconStyles(appearance: Appearance, icon: SectionMessageProps['icon']): {
|
|
4
|
-
Icon: React.ElementType<any, keyof React.JSX.IntrinsicElements> | (({ primaryColor }: {
|
|
5
|
-
primaryColor: string;
|
|
6
|
-
}) => React.JSX.Element);
|
|
7
|
-
backgroundColor: string;
|
|
8
|
-
primaryIconColor: string;
|
|
9
|
-
LegacyFallbackIcon?: ComponentType<any>;
|
|
10
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { SectionMessageActionProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* __Section message action__
|
|
4
|
-
*
|
|
5
|
-
* A section message action is designed to work with the `action` prop from
|
|
6
|
-
* `SectionMessage`. It renders either a button or a link depending on whether
|
|
7
|
-
* an `onClick` or `href` prop is supplied, with a dot separator in between actions.
|
|
8
|
-
*
|
|
9
|
-
* - [Examples](https://atlassian.design/components/section-message/examples#actions)
|
|
10
|
-
*/
|
|
11
|
-
declare const SectionMessageAction: import('react').NamedExoticComponent<SectionMessageActionProps>;
|
|
12
|
-
export default SectionMessageAction;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { SectionMessageProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* __Section message__
|
|
4
|
-
*
|
|
5
|
-
* A section message is used to alert users to a particular section of the screen.
|
|
6
|
-
*
|
|
7
|
-
* - [Examples](https://atlassian.design/components/section-message/examples)
|
|
8
|
-
* - [Code](https://atlassian.design/components/section-message/code)
|
|
9
|
-
* - [Usage](https://atlassian.design/components/section-message/usage)
|
|
10
|
-
*/
|
|
11
|
-
declare const SectionMessage: React.ForwardRefExoticComponent<React.PropsWithoutRef<SectionMessageProps> & React.RefAttributes<HTMLElement>>;
|
|
12
|
-
export default SectionMessage;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
/**
|
|
4
|
-
* Appearance determines the icon and background color pairing indicating the message type
|
|
5
|
-
*/
|
|
6
|
-
export type Appearance = 'information' | 'warning' | 'error' | 'success' | 'discovery';
|
|
7
|
-
export interface SectionMessageProps {
|
|
8
|
-
/**
|
|
9
|
-
* The appearance styling to use for the section message.
|
|
10
|
-
*/
|
|
11
|
-
appearance?: Appearance;
|
|
12
|
-
/**
|
|
13
|
-
* The main content of the section message. This accepts a react node, although
|
|
14
|
-
* we recommend that this should be a paragraph.
|
|
15
|
-
*/
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* The heading of the section message.
|
|
19
|
-
*/
|
|
20
|
-
title?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Actions for the user to take after reading the section message. Accepts a ReactElement
|
|
23
|
-
* or an array of one or more SectionMessageAction React elements, which are applied as link buttons.
|
|
24
|
-
* Middle dots are automatically added between multiple link buttons, so no elements
|
|
25
|
-
* should be present between multiple actions.
|
|
26
|
-
*
|
|
27
|
-
* In general, avoid using more than two actions.
|
|
28
|
-
*/
|
|
29
|
-
actions?: ReactElement | ReactElement<SectionMessageActionProps>[];
|
|
30
|
-
/**
|
|
31
|
-
* An Icon component to be rendered instead of the default icon for the component.
|
|
32
|
-
* This should only be an `@atlaskit/icon` icon. You can check out [this example](/packages/design-system/section-message/example/custom-icon)
|
|
33
|
-
* to see how to provide this icon.
|
|
34
|
-
*/
|
|
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;
|
|
42
|
-
/**
|
|
43
|
-
* A callback function that is called when the user dismisses the message.
|
|
44
|
-
*/
|
|
45
|
-
onDismiss?: () => void;
|
|
46
|
-
/**
|
|
47
|
-
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
48
|
-
* in the rendered code, serving as a hook for automated tests.
|
|
49
|
-
*/
|
|
50
|
-
testId?: string;
|
|
51
|
-
}
|
|
52
|
-
export interface SectionMessageActionProps {
|
|
53
|
-
/**
|
|
54
|
-
* The text that needs to be displayed for section message action.
|
|
55
|
-
*/
|
|
56
|
-
children: React.ReactNode;
|
|
57
|
-
/**
|
|
58
|
-
* A custom link component. This prop is designed to allow a custom link
|
|
59
|
-
* component to be passed to the rendered link button. The
|
|
60
|
-
* intended use-case is for when a custom router component such as react router
|
|
61
|
-
* is being used within the application.
|
|
62
|
-
*
|
|
63
|
-
* This component will only be used if a href prop is passed.
|
|
64
|
-
*/
|
|
65
|
-
linkComponent?: React.ComponentType<any>;
|
|
66
|
-
/**
|
|
67
|
-
* Click handler which will be attached to the rendered link button. The second argument can be used to
|
|
68
|
-
* track analytics data. See the tutorial in the analytics-next package for details.
|
|
69
|
-
*/
|
|
70
|
-
onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
71
|
-
/**
|
|
72
|
-
* The URL that the rendered link button will point to.
|
|
73
|
-
*/
|
|
74
|
-
href?: string;
|
|
75
|
-
/**
|
|
76
|
-
* The target attribute of the link. This is only used if the href prop is passed.
|
|
77
|
-
*/
|
|
78
|
-
target?: HTMLAnchorElement['target'];
|
|
79
|
-
/**
|
|
80
|
-
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
81
|
-
* in the rendered code, serving as a hook for automated tests.
|
|
82
|
-
*/
|
|
83
|
-
testId?: string;
|
|
84
|
-
}
|