@atlaskit/inline-message 11.3.1 → 11.4.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 +16 -0
- package/constants/package.json +8 -1
- package/dist/cjs/components/inline-message/index.js +12 -12
- package/dist/cjs/components/message-icon/index.js +5 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/inline-message/index.js +1 -1
- package/dist/es2019/components/message-icon/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/inline-message/index.js +1 -1
- package/dist/esm/components/message-icon/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.0/components/inline-message/index.d.ts +73 -0
- package/dist/types-ts4.0/components/message-icon/index.d.ts +16 -0
- package/dist/types-ts4.0/constants.d.ts +3 -0
- package/dist/types-ts4.0/index.d.ts +1 -0
- package/dist/types-ts4.0/types.d.ts +9 -0
- package/package.json +15 -7
- package/types/package.json +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/inline-message
|
|
2
2
|
|
|
3
|
+
## 11.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
8
|
+
|
|
9
|
+
## 11.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`bcf29b33526`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bcf29b33526) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 11.3.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/constants/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/constants.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/constants.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/constants.d.ts"
|
|
7
|
+
"types": "../dist/types/constants.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/constants.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
@@ -13,7 +13,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
|
|
14
14
|
var _react = require("react");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _react2 = require("@emotion/react");
|
|
17
17
|
|
|
18
18
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
19
19
|
|
|
@@ -32,22 +32,22 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
32
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
33
|
|
|
34
34
|
/** @jsx jsx */
|
|
35
|
-
var buttonContentsStyles = (0,
|
|
35
|
+
var buttonContentsStyles = (0, _react2.css)({
|
|
36
36
|
display: 'flex',
|
|
37
37
|
alignItems: 'center',
|
|
38
38
|
textDecoration: 'none'
|
|
39
39
|
});
|
|
40
|
-
var titleStyles = (0,
|
|
40
|
+
var titleStyles = (0, _react2.css)({
|
|
41
41
|
padding: "0 ".concat(_constants.itemSpacing, "px"),
|
|
42
42
|
fontWeight: 500
|
|
43
43
|
});
|
|
44
|
-
var textStyles = (0,
|
|
44
|
+
var textStyles = (0, _react2.css)({
|
|
45
45
|
padding: "0 ".concat(_constants.itemSpacing, "px"),
|
|
46
46
|
overflow: 'hidden',
|
|
47
47
|
textOverflow: 'ellipsis',
|
|
48
48
|
whiteSpace: 'nowrap'
|
|
49
49
|
});
|
|
50
|
-
var rootStyles = (0,
|
|
50
|
+
var rootStyles = (0, _react2.css)({
|
|
51
51
|
display: 'inline-block',
|
|
52
52
|
maxWidth: '100%',
|
|
53
53
|
'&:focus': {
|
|
@@ -150,7 +150,7 @@ var InlineMessage = function InlineMessage(_ref) {
|
|
|
150
150
|
appearance = type;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
return (0,
|
|
153
|
+
return (0, _react2.jsx)("div", {
|
|
154
154
|
css: rootStyles,
|
|
155
155
|
style: {
|
|
156
156
|
'--icon-accent-color': iconColor({
|
|
@@ -159,25 +159,25 @@ var InlineMessage = function InlineMessage(_ref) {
|
|
|
159
159
|
})
|
|
160
160
|
},
|
|
161
161
|
"data-testid": testId
|
|
162
|
-
}, (0,
|
|
162
|
+
}, (0, _react2.jsx)(_inlineDialog.default, {
|
|
163
163
|
onClose: onCloseDialog,
|
|
164
164
|
content: children,
|
|
165
165
|
isOpen: isOpen,
|
|
166
166
|
placement: placement,
|
|
167
167
|
testId: testId && "".concat(testId, "--inline-dialog")
|
|
168
|
-
}, (0,
|
|
168
|
+
}, (0, _react2.jsx)(_customThemeButton.default, {
|
|
169
169
|
"data-ds--inline-message--button": true,
|
|
170
170
|
appearance: "subtle-link",
|
|
171
171
|
onClick: toggleDialog,
|
|
172
172
|
spacing: "none",
|
|
173
173
|
testId: testId && "".concat(testId, "--button")
|
|
174
|
-
}, (0,
|
|
174
|
+
}, (0, _react2.jsx)("div", {
|
|
175
175
|
css: buttonContentsStyles
|
|
176
|
-
}, (0,
|
|
176
|
+
}, (0, _react2.jsx)(_messageIcon.default, {
|
|
177
177
|
isOpen: isOpen,
|
|
178
178
|
appearance: appearance,
|
|
179
179
|
label: iconLabel
|
|
180
|
-
}), title && (0,
|
|
180
|
+
}), title && (0, _react2.jsx)("span", {
|
|
181
181
|
style: {
|
|
182
182
|
color: titleColor({
|
|
183
183
|
theme: theme
|
|
@@ -185,7 +185,7 @@ var InlineMessage = function InlineMessage(_ref) {
|
|
|
185
185
|
},
|
|
186
186
|
css: titleStyles,
|
|
187
187
|
"data-testid": testId && "".concat(testId, "--title")
|
|
188
|
-
}, title), secondaryText && (0,
|
|
188
|
+
}, title), secondaryText && (0, _react2.jsx)("span", {
|
|
189
189
|
style: {
|
|
190
190
|
color: textColor({
|
|
191
191
|
theme: theme
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _react = require("@emotion/react");
|
|
11
11
|
|
|
12
12
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
13
13
|
|
|
@@ -42,13 +42,13 @@ var iconColor = (0, _components.themed)('appearance', {
|
|
|
42
42
|
dark: "var(--ds-icon-danger, ".concat(colors.R400, ")")
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
var iconWrapperStyles = (0,
|
|
45
|
+
var iconWrapperStyles = (0, _react.css)({
|
|
46
46
|
display: 'flex',
|
|
47
47
|
alignItems: 'center',
|
|
48
48
|
flex: '0 0 auto',
|
|
49
49
|
color: 'var(--icon-color)'
|
|
50
50
|
});
|
|
51
|
-
var iconColorStyles = (0,
|
|
51
|
+
var iconColorStyles = (0, _react.css)({
|
|
52
52
|
color: 'var(--icon-accent-color)'
|
|
53
53
|
});
|
|
54
54
|
/**
|
|
@@ -66,7 +66,7 @@ var SelectedIcon = function SelectedIcon(_ref) {
|
|
|
66
66
|
SelectedIcon = _typesMapping$appeara.icon,
|
|
67
67
|
defaultLabel = _typesMapping$appeara.defaultLabel;
|
|
68
68
|
var theme = (0, _components.useGlobalTheme)();
|
|
69
|
-
return (0,
|
|
69
|
+
return (0, _react.jsx)("span", {
|
|
70
70
|
"data-ds--inline-message--icon": true,
|
|
71
71
|
style: {
|
|
72
72
|
'--icon-color': iconColor({
|
|
@@ -75,7 +75,7 @@ var SelectedIcon = function SelectedIcon(_ref) {
|
|
|
75
75
|
})
|
|
76
76
|
},
|
|
77
77
|
css: [iconWrapperStyles, isOpen && iconColorStyles]
|
|
78
|
-
}, (0,
|
|
78
|
+
}, (0, _react.jsx)(SelectedIcon, {
|
|
79
79
|
testId: "inline-message-icon",
|
|
80
80
|
label: label || defaultLabel,
|
|
81
81
|
size: "medium"
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { useCallback, useState } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
5
5
|
import InlineDialog from '@atlaskit/inline-dialog';
|
|
6
6
|
import * as colors from '@atlaskit/theme/colors';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { css, jsx } from '@emotion/
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import * as colors from '@atlaskit/theme/colors';
|
|
4
4
|
import { themed, useGlobalTheme } from '@atlaskit/theme/components';
|
|
5
5
|
import { typesMapping } from '../../constants';
|
package/dist/es2019/version.json
CHANGED
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { useCallback, useState } from 'react';
|
|
5
|
-
import { css, jsx } from '@emotion/
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
7
7
|
import InlineDialog from '@atlaskit/inline-dialog';
|
|
8
8
|
import * as colors from '@atlaskit/theme/colors';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { css, jsx } from '@emotion/
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import * as colors from '@atlaskit/theme/colors';
|
|
4
4
|
import { themed, useGlobalTheme } from '@atlaskit/theme/components';
|
|
5
5
|
import { typesMapping } from '../../constants';
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC, ReactNode } from 'react';
|
|
3
|
+
import type { IconAppearance, InlineDialogPlacement } from '../../types';
|
|
4
|
+
interface InlineMessageProps {
|
|
5
|
+
/**
|
|
6
|
+
* The elements to be displayed by the inline dialog.
|
|
7
|
+
*/
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* The placement to be passed to the inline dialog. Determines where around
|
|
11
|
+
* the text the dialog is displayed.
|
|
12
|
+
*/
|
|
13
|
+
placement?: InlineDialogPlacement;
|
|
14
|
+
/**
|
|
15
|
+
* Text to display second.
|
|
16
|
+
*/
|
|
17
|
+
secondaryText?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Text to display first, bolded for emphasis.
|
|
20
|
+
*/
|
|
21
|
+
title?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Set the icon to be used before the title. Options are: connectivity,
|
|
24
|
+
* confirmation, info, warning, and error.
|
|
25
|
+
*/
|
|
26
|
+
appearance?: IconAppearance;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-5207 for more information.
|
|
29
|
+
* Instead use the 'appearance' prop.
|
|
30
|
+
* Set the icon to be used before the title.
|
|
31
|
+
*/
|
|
32
|
+
type?: IconAppearance;
|
|
33
|
+
/**
|
|
34
|
+
A unique string that appears as a data attribute, `data-testid`,
|
|
35
|
+
in the rendered code. It is provided to serve as a hook for automated tests.
|
|
36
|
+
|
|
37
|
+
The value of `testId` is attached to the different sub-components in Inline Message:
|
|
38
|
+
- `testId`: the top-level inline message component
|
|
39
|
+
- `testId--inline-dialog`: the content of the message
|
|
40
|
+
- `testId--button`: the button element that opens the dialog on press
|
|
41
|
+
- `testId--title`: the title of the message
|
|
42
|
+
- `testId--text`: the text of the message
|
|
43
|
+
*/
|
|
44
|
+
testId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Text to be used as label for the button icon. Can be used to provide useful information for users with screen readers when there is no title and/or secondaryText
|
|
47
|
+
*/
|
|
48
|
+
iconLabel?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* __Inline message__
|
|
52
|
+
*
|
|
53
|
+
* An inline message lets users know when important information is available or when an action is required.
|
|
54
|
+
*
|
|
55
|
+
* - [Examples](https://atlassian.design/components/inline-message/examples)
|
|
56
|
+
* - [Code](https://atlassian.design/components/inline-message/code)
|
|
57
|
+
* - [Usage](https://atlassian.design/components/inline-message/usage)
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
*
|
|
61
|
+
* ```jsx
|
|
62
|
+
* const Component = () => (
|
|
63
|
+
* <InlineMessage
|
|
64
|
+
* title="Inline Message Title Example"
|
|
65
|
+
* secondaryText="Secondary Text"
|
|
66
|
+
* >
|
|
67
|
+
* <p>Some text that would be inside the open dialog and otherwise hidden.</p>
|
|
68
|
+
* </InlineMessage>
|
|
69
|
+
* );
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
declare const InlineMessage: FC<InlineMessageProps>;
|
|
73
|
+
export default InlineMessage;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { IconAppearance } from '../../types';
|
|
4
|
+
interface MessageIconProps {
|
|
5
|
+
appearance: IconAppearance;
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* __Selected icon__
|
|
11
|
+
*
|
|
12
|
+
* The selected icon is used as the primary interactive element for the dialog.
|
|
13
|
+
* Can be used with or without supporting text.
|
|
14
|
+
*/
|
|
15
|
+
declare const SelectedIcon: FC<MessageIconProps>;
|
|
16
|
+
export default SelectedIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './components/inline-message';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import type { GlyphProps } from '@atlaskit/icon';
|
|
3
|
+
export interface Icon {
|
|
4
|
+
defaultLabel: string;
|
|
5
|
+
icon: ComponentType<GlyphProps>;
|
|
6
|
+
}
|
|
7
|
+
export declare type IconAppearanceMap = Record<IconAppearance, Icon>;
|
|
8
|
+
export declare type IconAppearance = 'connectivity' | 'confirmation' | 'info' | 'warning' | 'error';
|
|
9
|
+
export declare type InlineDialogPlacement = 'auto-start' | 'auto' | 'auto-end' | 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/inline-message",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.4.1",
|
|
4
4
|
"description": "An inline message lets users know when important information is available or when an action is required.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,6 +12,13 @@
|
|
|
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.0 <4.5": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.0/*"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
15
22
|
"sideEffects": false,
|
|
16
23
|
"atlaskit:src": "src/index.tsx",
|
|
17
24
|
"atlassian": {
|
|
@@ -26,26 +33,27 @@
|
|
|
26
33
|
"dependencies": {
|
|
27
34
|
"@atlaskit/button": "^16.3.0",
|
|
28
35
|
"@atlaskit/icon": "^21.10.0",
|
|
29
|
-
"@atlaskit/inline-dialog": "^13.
|
|
30
|
-
"@atlaskit/theme": "^12.
|
|
36
|
+
"@atlaskit/inline-dialog": "^13.4.0",
|
|
37
|
+
"@atlaskit/theme": "^12.2.0",
|
|
31
38
|
"@atlaskit/tokens": "^0.10.0",
|
|
32
39
|
"@babel/runtime": "^7.0.0",
|
|
33
|
-
"@emotion/
|
|
40
|
+
"@emotion/react": "^11.7.1"
|
|
34
41
|
},
|
|
35
42
|
"peerDependencies": {
|
|
36
43
|
"react": "^16.8.0"
|
|
37
44
|
},
|
|
38
45
|
"devDependencies": {
|
|
39
46
|
"@atlaskit/docs": "*",
|
|
40
|
-
"@atlaskit/
|
|
47
|
+
"@atlaskit/ds-lib": "^2.0.1",
|
|
48
|
+
"@atlaskit/section-message": "^6.2.0",
|
|
41
49
|
"@atlaskit/ssr": "*",
|
|
42
50
|
"@atlaskit/visual-regression": "*",
|
|
43
51
|
"@atlaskit/webdriver-runner": "*",
|
|
44
52
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
45
|
-
"@testing-library/react": "^
|
|
53
|
+
"@testing-library/react": "^12.1.5",
|
|
46
54
|
"enzyme": "^3.10.0",
|
|
47
55
|
"react-dom": "^16.8.0",
|
|
48
|
-
"typescript": "4.
|
|
56
|
+
"typescript": "4.5.5"
|
|
49
57
|
},
|
|
50
58
|
"keywords": [
|
|
51
59
|
"atlaskit",
|
package/types/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/types.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/types.d.ts"
|
|
7
|
+
"types": "../dist/types/types.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/types.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|