@atlaskit/tooltip 17.8.10 → 18.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 +6 -0
- package/dist/cjs/Tooltip.js +1 -1
- package/dist/cjs/TooltipContainer.js +14 -24
- package/dist/cjs/TooltipPrimitive.js +5 -2
- package/dist/es2019/Tooltip.js +1 -1
- package/dist/es2019/TooltipContainer.js +7 -16
- package/dist/es2019/TooltipPrimitive.js +5 -2
- package/dist/esm/Tooltip.js +1 -1
- package/dist/esm/TooltipContainer.js +15 -25
- package/dist/esm/TooltipPrimitive.js +5 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/tooltip
|
|
2
2
|
|
|
3
|
+
## 18.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#41881](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41881) [`1de74609c13`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1de74609c13) - Removed all remaining legacy theming logic from the Tag, Toggle and Tooltip components.
|
|
8
|
+
|
|
3
9
|
## 17.8.10
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/Tooltip.js
CHANGED
|
@@ -8,7 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
-
var _components = _interopRequireDefault(require("@atlaskit/theme/components"));
|
|
12
11
|
var _TooltipPrimitive = _interopRequireDefault(require("./TooltipPrimitive"));
|
|
13
12
|
/** @jsx jsx */
|
|
14
13
|
|
|
@@ -22,7 +21,9 @@ var baseStyles = (0, _react2.css)({
|
|
|
22
21
|
fontSize: "var(--ds-font-size-075, 12px)",
|
|
23
22
|
lineHeight: 1.3,
|
|
24
23
|
overflowWrap: 'break-word',
|
|
25
|
-
wordWrap: 'break-word'
|
|
24
|
+
wordWrap: 'break-word',
|
|
25
|
+
backgroundColor: "var(--ds-background-neutral-bold, ".concat(_colors.N800, ")"),
|
|
26
|
+
color: "var(--ds-text-inverse, ".concat(_colors.N0, ")")
|
|
26
27
|
});
|
|
27
28
|
var truncateStyles = (0, _react2.css)({
|
|
28
29
|
maxWidth: '420px',
|
|
@@ -30,14 +31,6 @@ var truncateStyles = (0, _react2.css)({
|
|
|
30
31
|
textOverflow: 'ellipsis',
|
|
31
32
|
whiteSpace: 'nowrap'
|
|
32
33
|
});
|
|
33
|
-
var lightStyles = (0, _react2.css)({
|
|
34
|
-
backgroundColor: "var(--ds-background-neutral-bold, ".concat(_colors.N800, ")"),
|
|
35
|
-
color: "var(--ds-text-inverse, ".concat(_colors.N0, ")")
|
|
36
|
-
});
|
|
37
|
-
var darkStyles = (0, _react2.css)({
|
|
38
|
-
backgroundColor: "var(--ds-background-neutral-bold, ".concat(_colors.DN0, ")"),
|
|
39
|
-
color: "var(--ds-text-inverse, ".concat(_colors.DN600, ")")
|
|
40
|
-
});
|
|
41
34
|
var TooltipContainer = /*#__PURE__*/(0, _react.forwardRef)(function TooltipContainer(_ref, ref) {
|
|
42
35
|
var style = _ref.style,
|
|
43
36
|
className = _ref.className,
|
|
@@ -48,20 +41,17 @@ var TooltipContainer = /*#__PURE__*/(0, _react.forwardRef)(function TooltipConta
|
|
|
48
41
|
onMouseOut = _ref.onMouseOut,
|
|
49
42
|
onMouseOver = _ref.onMouseOver,
|
|
50
43
|
id = _ref.id;
|
|
51
|
-
return (0, _react2.jsx)(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
css: [baseStyles, truncate ? truncateStyles : null, mode === 'light' ? lightStyles : darkStyles]
|
|
63
|
-
}, children);
|
|
64
|
-
});
|
|
44
|
+
return (0, _react2.jsx)(_TooltipPrimitive.default, {
|
|
45
|
+
ref: ref,
|
|
46
|
+
style: style,
|
|
47
|
+
className: className,
|
|
48
|
+
placement: placement,
|
|
49
|
+
testId: testId,
|
|
50
|
+
id: id,
|
|
51
|
+
onMouseOut: onMouseOut,
|
|
52
|
+
onMouseOver: onMouseOver,
|
|
53
|
+
css: [baseStyles, truncate ? truncateStyles : null]
|
|
54
|
+
}, children);
|
|
65
55
|
});
|
|
66
56
|
TooltipContainer.displayName = 'TooltipContainer';
|
|
67
57
|
var _default = exports.default = TooltipContainer;
|
|
@@ -32,9 +32,12 @@ var TooltipPrimitive = /*#__PURE__*/(0, _react.forwardRef)(function TooltipPrimi
|
|
|
32
32
|
"data-testid": testId ? "".concat(testId, "--wrapper") : undefined
|
|
33
33
|
}, (0, _react2.jsx)("div", {
|
|
34
34
|
role: "tooltip",
|
|
35
|
-
className: className
|
|
35
|
+
className: className
|
|
36
|
+
// Because the tooltip should not be focusable, there is no reason to have key events.
|
|
37
|
+
/* eslint-disable jsx-a11y/mouse-events-have-key-events */,
|
|
36
38
|
onMouseOut: onMouseOut,
|
|
37
|
-
onMouseOver: onMouseOver
|
|
39
|
+
onMouseOver: onMouseOver
|
|
40
|
+
/* eslint-enable jsx-a11y/mouse-events-have-key-events */,
|
|
38
41
|
css: primitiveStyles,
|
|
39
42
|
"data-placement": placement,
|
|
40
43
|
"data-testid": testId,
|
package/dist/es2019/Tooltip.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
import GlobalTheme from '@atlaskit/theme/components';
|
|
4
|
+
import { N0, N800 } from '@atlaskit/theme/colors';
|
|
6
5
|
import TooltipPrimitive from './TooltipPrimitive';
|
|
7
6
|
const baseStyles = css({
|
|
8
7
|
boxSizing: 'border-box',
|
|
@@ -14,7 +13,9 @@ const baseStyles = css({
|
|
|
14
13
|
fontSize: "var(--ds-font-size-075, 12px)",
|
|
15
14
|
lineHeight: 1.3,
|
|
16
15
|
overflowWrap: 'break-word',
|
|
17
|
-
wordWrap: 'break-word'
|
|
16
|
+
wordWrap: 'break-word',
|
|
17
|
+
backgroundColor: `var(--ds-background-neutral-bold, ${N800})`,
|
|
18
|
+
color: `var(--ds-text-inverse, ${N0})`
|
|
18
19
|
});
|
|
19
20
|
const truncateStyles = css({
|
|
20
21
|
maxWidth: '420px',
|
|
@@ -22,14 +23,6 @@ const truncateStyles = css({
|
|
|
22
23
|
textOverflow: 'ellipsis',
|
|
23
24
|
whiteSpace: 'nowrap'
|
|
24
25
|
});
|
|
25
|
-
const lightStyles = css({
|
|
26
|
-
backgroundColor: `var(--ds-background-neutral-bold, ${N800})`,
|
|
27
|
-
color: `var(--ds-text-inverse, ${N0})`
|
|
28
|
-
});
|
|
29
|
-
const darkStyles = css({
|
|
30
|
-
backgroundColor: `var(--ds-background-neutral-bold, ${DN0})`,
|
|
31
|
-
color: `var(--ds-text-inverse, ${DN600})`
|
|
32
|
-
});
|
|
33
26
|
const TooltipContainer = /*#__PURE__*/forwardRef(function TooltipContainer({
|
|
34
27
|
style,
|
|
35
28
|
className,
|
|
@@ -41,9 +34,7 @@ const TooltipContainer = /*#__PURE__*/forwardRef(function TooltipContainer({
|
|
|
41
34
|
onMouseOver,
|
|
42
35
|
id
|
|
43
36
|
}, ref) {
|
|
44
|
-
return jsx(
|
|
45
|
-
mode
|
|
46
|
-
}) => jsx(TooltipPrimitive, {
|
|
37
|
+
return jsx(TooltipPrimitive, {
|
|
47
38
|
ref: ref,
|
|
48
39
|
style: style,
|
|
49
40
|
className: className,
|
|
@@ -52,8 +43,8 @@ const TooltipContainer = /*#__PURE__*/forwardRef(function TooltipContainer({
|
|
|
52
43
|
id: id,
|
|
53
44
|
onMouseOut: onMouseOut,
|
|
54
45
|
onMouseOver: onMouseOver,
|
|
55
|
-
css: [baseStyles, truncate ? truncateStyles : null
|
|
56
|
-
}, children)
|
|
46
|
+
css: [baseStyles, truncate ? truncateStyles : null]
|
|
47
|
+
}, children);
|
|
57
48
|
});
|
|
58
49
|
TooltipContainer.displayName = 'TooltipContainer';
|
|
59
50
|
export default TooltipContainer;
|
|
@@ -27,9 +27,12 @@ const TooltipPrimitive = /*#__PURE__*/forwardRef(function TooltipPrimitive({
|
|
|
27
27
|
"data-testid": testId ? `${testId}--wrapper` : undefined
|
|
28
28
|
}, jsx("div", {
|
|
29
29
|
role: "tooltip",
|
|
30
|
-
className: className
|
|
30
|
+
className: className
|
|
31
|
+
// Because the tooltip should not be focusable, there is no reason to have key events.
|
|
32
|
+
/* eslint-disable jsx-a11y/mouse-events-have-key-events */,
|
|
31
33
|
onMouseOut: onMouseOut,
|
|
32
|
-
onMouseOver: onMouseOver
|
|
34
|
+
onMouseOver: onMouseOver
|
|
35
|
+
/* eslint-enable jsx-a11y/mouse-events-have-key-events */,
|
|
33
36
|
css: primitiveStyles,
|
|
34
37
|
"data-placement": placement,
|
|
35
38
|
"data-testid": testId,
|
package/dist/esm/Tooltip.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
import GlobalTheme from '@atlaskit/theme/components';
|
|
4
|
+
import { N0, N800 } from '@atlaskit/theme/colors';
|
|
6
5
|
import TooltipPrimitive from './TooltipPrimitive';
|
|
7
6
|
var baseStyles = css({
|
|
8
7
|
boxSizing: 'border-box',
|
|
@@ -14,7 +13,9 @@ var baseStyles = css({
|
|
|
14
13
|
fontSize: "var(--ds-font-size-075, 12px)",
|
|
15
14
|
lineHeight: 1.3,
|
|
16
15
|
overflowWrap: 'break-word',
|
|
17
|
-
wordWrap: 'break-word'
|
|
16
|
+
wordWrap: 'break-word',
|
|
17
|
+
backgroundColor: "var(--ds-background-neutral-bold, ".concat(N800, ")"),
|
|
18
|
+
color: "var(--ds-text-inverse, ".concat(N0, ")")
|
|
18
19
|
});
|
|
19
20
|
var truncateStyles = css({
|
|
20
21
|
maxWidth: '420px',
|
|
@@ -22,14 +23,6 @@ var truncateStyles = css({
|
|
|
22
23
|
textOverflow: 'ellipsis',
|
|
23
24
|
whiteSpace: 'nowrap'
|
|
24
25
|
});
|
|
25
|
-
var lightStyles = css({
|
|
26
|
-
backgroundColor: "var(--ds-background-neutral-bold, ".concat(N800, ")"),
|
|
27
|
-
color: "var(--ds-text-inverse, ".concat(N0, ")")
|
|
28
|
-
});
|
|
29
|
-
var darkStyles = css({
|
|
30
|
-
backgroundColor: "var(--ds-background-neutral-bold, ".concat(DN0, ")"),
|
|
31
|
-
color: "var(--ds-text-inverse, ".concat(DN600, ")")
|
|
32
|
-
});
|
|
33
26
|
var TooltipContainer = /*#__PURE__*/forwardRef(function TooltipContainer(_ref, ref) {
|
|
34
27
|
var style = _ref.style,
|
|
35
28
|
className = _ref.className,
|
|
@@ -40,20 +33,17 @@ var TooltipContainer = /*#__PURE__*/forwardRef(function TooltipContainer(_ref, r
|
|
|
40
33
|
onMouseOut = _ref.onMouseOut,
|
|
41
34
|
onMouseOver = _ref.onMouseOver,
|
|
42
35
|
id = _ref.id;
|
|
43
|
-
return jsx(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
css: [baseStyles, truncate ? truncateStyles : null, mode === 'light' ? lightStyles : darkStyles]
|
|
55
|
-
}, children);
|
|
56
|
-
});
|
|
36
|
+
return jsx(TooltipPrimitive, {
|
|
37
|
+
ref: ref,
|
|
38
|
+
style: style,
|
|
39
|
+
className: className,
|
|
40
|
+
placement: placement,
|
|
41
|
+
testId: testId,
|
|
42
|
+
id: id,
|
|
43
|
+
onMouseOut: onMouseOut,
|
|
44
|
+
onMouseOver: onMouseOver,
|
|
45
|
+
css: [baseStyles, truncate ? truncateStyles : null]
|
|
46
|
+
}, children);
|
|
57
47
|
});
|
|
58
48
|
TooltipContainer.displayName = 'TooltipContainer';
|
|
59
49
|
export default TooltipContainer;
|
|
@@ -26,9 +26,12 @@ var TooltipPrimitive = /*#__PURE__*/forwardRef(function TooltipPrimitive(_ref, r
|
|
|
26
26
|
"data-testid": testId ? "".concat(testId, "--wrapper") : undefined
|
|
27
27
|
}, jsx("div", {
|
|
28
28
|
role: "tooltip",
|
|
29
|
-
className: className
|
|
29
|
+
className: className
|
|
30
|
+
// Because the tooltip should not be focusable, there is no reason to have key events.
|
|
31
|
+
/* eslint-disable jsx-a11y/mouse-events-have-key-events */,
|
|
30
32
|
onMouseOut: onMouseOut,
|
|
31
|
-
onMouseOver: onMouseOver
|
|
33
|
+
onMouseOver: onMouseOver
|
|
34
|
+
/* eslint-enable jsx-a11y/mouse-events-have-key-events */,
|
|
32
35
|
css: primitiveStyles,
|
|
33
36
|
"data-placement": placement,
|
|
34
37
|
"data-testid": testId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tooltip",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "A tooltip is a floating, non-actionable label used to explain a user interface element or feature.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@af/accessibility-testing": "*",
|
|
63
|
-
"@atlaskit/button": "^16.
|
|
63
|
+
"@atlaskit/button": "^16.16.0",
|
|
64
64
|
"@atlaskit/ssr": "*",
|
|
65
65
|
"@atlaskit/visual-regression": "*",
|
|
66
66
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|