@atlaskit/tooltip 17.5.17 → 17.6.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 +12 -0
- package/dist/cjs/Tooltip.js +8 -8
- package/dist/cjs/TooltipContainer.js +8 -8
- package/dist/cjs/TooltipPrimitive.js +4 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/Tooltip.js +2 -2
- package/dist/es2019/TooltipContainer.js +2 -2
- package/dist/es2019/TooltipPrimitive.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/Tooltip.js +2 -2
- package/dist/esm/TooltipContainer.js +2 -2
- package/dist/esm/TooltipPrimitive.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/Tooltip.d.ts +2 -2
- package/dist/types-ts4.0/Tooltip.d.ts +2 -2
- package/package.json +8 -5
- package/report.api.md +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/tooltip
|
|
2
2
|
|
|
3
|
+
## 17.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9827dcb82b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9827dcb82b8) - No-op change to introduce spacing tokens to design system components.
|
|
8
|
+
|
|
9
|
+
## 17.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`15f0ad7aaa3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/15f0ad7aaa3) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
14
|
+
|
|
3
15
|
## 17.5.17
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/Tooltip.js
CHANGED
|
@@ -17,7 +17,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
17
17
|
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _react2 = require("@emotion/react");
|
|
21
21
|
|
|
22
22
|
var _bindEventListener = require("bind-event-listener");
|
|
23
23
|
|
|
@@ -58,7 +58,7 @@ var tooltipZIndex = _constants.layers.tooltip();
|
|
|
58
58
|
var analyticsAttributes = {
|
|
59
59
|
componentName: 'tooltip',
|
|
60
60
|
packageName: "@atlaskit/tooltip",
|
|
61
|
-
packageVersion: "17.
|
|
61
|
+
packageVersion: "17.6.1"
|
|
62
62
|
}; // Inverts motion direction
|
|
63
63
|
|
|
64
64
|
var invertedDirection = {
|
|
@@ -407,11 +407,11 @@ function Tooltip(_ref) {
|
|
|
407
407
|
'aria-describedby': tooltipId,
|
|
408
408
|
'data-testid': testId ? "".concat(testId, "--container") : undefined
|
|
409
409
|
};
|
|
410
|
-
return (0,
|
|
410
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, typeof children === 'function' ? children(tooltipTriggerProps) : (0, _react2.jsx)(CastTargetContainer, (0, _extends2.default)({}, tooltipTriggerProps, {
|
|
411
411
|
role: "presentation"
|
|
412
|
-
}), children), shouldRenderTooltipContainer ? (0,
|
|
412
|
+
}), children), shouldRenderTooltipContainer ? (0, _react2.jsx)(_portal.default, {
|
|
413
413
|
zIndex: tooltipZIndex
|
|
414
|
-
}, (0,
|
|
414
|
+
}, (0, _react2.jsx)(_popper.Popper, {
|
|
415
415
|
placement: tooltipPosition,
|
|
416
416
|
referenceElement: getReferenceElement(),
|
|
417
417
|
strategy: strategy
|
|
@@ -424,9 +424,9 @@ function Tooltip(_ref) {
|
|
|
424
424
|
// E.g. a tooltip's position is on the 'right', it should enter from and exit to the 'left'
|
|
425
425
|
// This gives the effect the tooltip is appearing from the target
|
|
426
426
|
var direction = position === 'mouse' ? undefined : invertedDirection[getDirectionFromPlacement(placement)];
|
|
427
|
-
return (0,
|
|
427
|
+
return (0, _react2.jsx)(_motion.ExitingPersistence, {
|
|
428
428
|
appear: true
|
|
429
|
-
}, shouldRenderTooltipChildren && (0,
|
|
429
|
+
}, shouldRenderTooltipChildren && (0, _react2.jsx)(_motion.FadeIn, {
|
|
430
430
|
distance: "constant",
|
|
431
431
|
entranceDirection: direction,
|
|
432
432
|
exitDirection: direction,
|
|
@@ -435,7 +435,7 @@ function Tooltip(_ref) {
|
|
|
435
435
|
}, function (_ref5) {
|
|
436
436
|
var className = _ref5.className;
|
|
437
437
|
return (// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
438
|
-
(0,
|
|
438
|
+
(0, _react2.jsx)(Container, {
|
|
439
439
|
ref: ref,
|
|
440
440
|
className: "Tooltip ".concat(className),
|
|
441
441
|
style: style,
|
|
@@ -9,7 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
15
|
|
|
@@ -20,10 +20,10 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
20
20
|
var _TooltipPrimitive = _interopRequireDefault(require("./TooltipPrimitive"));
|
|
21
21
|
|
|
22
22
|
/** @jsx jsx */
|
|
23
|
-
var baseStyles = (0,
|
|
23
|
+
var baseStyles = (0, _react2.css)({
|
|
24
24
|
boxSizing: 'border-box',
|
|
25
25
|
maxWidth: '240px',
|
|
26
|
-
padding:
|
|
26
|
+
padding: "var(--ds-scale-025, 2px)".concat(" ", "var(--ds-scale-075, 6px)"),
|
|
27
27
|
top: 0,
|
|
28
28
|
left: 0,
|
|
29
29
|
borderRadius: "".concat((0, _constants.borderRadius)(), "px"),
|
|
@@ -32,17 +32,17 @@ var baseStyles = (0, _core.css)({
|
|
|
32
32
|
overflowWrap: 'break-word',
|
|
33
33
|
wordWrap: 'break-word'
|
|
34
34
|
});
|
|
35
|
-
var truncateStyles = (0,
|
|
35
|
+
var truncateStyles = (0, _react2.css)({
|
|
36
36
|
maxWidth: '420px',
|
|
37
37
|
overflow: 'hidden',
|
|
38
38
|
textOverflow: 'ellipsis',
|
|
39
39
|
whiteSpace: 'nowrap'
|
|
40
40
|
});
|
|
41
|
-
var lightStyles = (0,
|
|
41
|
+
var lightStyles = (0, _react2.css)({
|
|
42
42
|
backgroundColor: "var(--ds-background-neutral-bold, ".concat(_colors.N800, ")"),
|
|
43
43
|
color: "var(--ds-text-inverse, ".concat(_colors.N0, ")")
|
|
44
44
|
});
|
|
45
|
-
var darkStyles = (0,
|
|
45
|
+
var darkStyles = (0, _react2.css)({
|
|
46
46
|
backgroundColor: "var(--ds-background-neutral-bold, ".concat(_colors.DN0, ")"),
|
|
47
47
|
color: "var(--ds-text-inverse, ".concat(_colors.DN600, ")")
|
|
48
48
|
});
|
|
@@ -56,10 +56,10 @@ var TooltipContainer = /*#__PURE__*/(0, _react.forwardRef)(function TooltipConta
|
|
|
56
56
|
onMouseOut = _ref.onMouseOut,
|
|
57
57
|
onMouseOver = _ref.onMouseOver,
|
|
58
58
|
id = _ref.id;
|
|
59
|
-
return (0,
|
|
59
|
+
return (0, _react2.jsx)(_components.default.Consumer, null, function (_ref2) {
|
|
60
60
|
var mode = _ref2.mode;
|
|
61
61
|
return (// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
62
|
-
(0,
|
|
62
|
+
(0, _react2.jsx)(_TooltipPrimitive.default, {
|
|
63
63
|
ref: ref,
|
|
64
64
|
style: style,
|
|
65
65
|
className: className,
|
|
@@ -11,7 +11,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
11
11
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _react2 = require("@emotion/react");
|
|
15
15
|
|
|
16
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
20
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
21
|
|
|
22
22
|
var VAR_PRIMITIVE_ZINDEX = 'tooltipPrimitiveZindex';
|
|
23
|
-
var primitiveStyles = (0,
|
|
23
|
+
var primitiveStyles = (0, _react2.css)({
|
|
24
24
|
zindex: "var(".concat(VAR_PRIMITIVE_ZINDEX, ")"),
|
|
25
25
|
cursor: "default"
|
|
26
26
|
});
|
|
@@ -36,11 +36,11 @@ var TooltipPrimitive = /*#__PURE__*/(0, _react.forwardRef)(function TooltipPrimi
|
|
|
36
36
|
|
|
37
37
|
var styleWithZIndex = _objectSpread(_objectSpread({}, style), {}, (0, _defineProperty2.default)({}, VAR_PRIMITIVE_ZINDEX, _constants.layers.tooltip()));
|
|
38
38
|
|
|
39
|
-
return (0,
|
|
39
|
+
return (0, _react2.jsx)("div", {
|
|
40
40
|
ref: ref,
|
|
41
41
|
style: styleWithZIndex,
|
|
42
42
|
"data-testid": testId ? "".concat(testId, "--wrapper") : undefined
|
|
43
|
-
}, (0,
|
|
43
|
+
}, (0, _react2.jsx)("div", {
|
|
44
44
|
role: "tooltip",
|
|
45
45
|
className: className,
|
|
46
46
|
onMouseOut: onMouseOut,
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/Tooltip.js
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { jsx } from '@emotion/
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
6
6
|
import { bind } from 'bind-event-listener';
|
|
7
7
|
import { usePlatformLeafSyntheticEventHandler } from '@atlaskit/analytics-next';
|
|
8
8
|
import noop from '@atlaskit/ds-lib/noop';
|
|
@@ -20,7 +20,7 @@ const tooltipZIndex = layers.tooltip();
|
|
|
20
20
|
const analyticsAttributes = {
|
|
21
21
|
componentName: 'tooltip',
|
|
22
22
|
packageName: "@atlaskit/tooltip",
|
|
23
|
-
packageVersion: "17.
|
|
23
|
+
packageVersion: "17.6.1"
|
|
24
24
|
}; // Inverts motion direction
|
|
25
25
|
|
|
26
26
|
const invertedDirection = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { DN0, DN600, N0, N800 } from '@atlaskit/theme/colors';
|
|
5
5
|
import GlobalTheme from '@atlaskit/theme/components';
|
|
6
6
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
@@ -8,7 +8,7 @@ import TooltipPrimitive from './TooltipPrimitive';
|
|
|
8
8
|
const baseStyles = css({
|
|
9
9
|
boxSizing: 'border-box',
|
|
10
10
|
maxWidth: '240px',
|
|
11
|
-
padding:
|
|
11
|
+
padding: `${"var(--ds-scale-025, 2px)"} ${"var(--ds-scale-075, 6px)"}`,
|
|
12
12
|
top: 0,
|
|
13
13
|
left: 0,
|
|
14
14
|
borderRadius: `${borderRadius()}px`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { layers } from '@atlaskit/theme/constants';
|
|
5
5
|
const VAR_PRIMITIVE_ZINDEX = 'tooltipPrimitiveZindex';
|
|
6
6
|
const primitiveStyles = css({
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/Tooltip.js
CHANGED
|
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
|
|
9
9
|
/** @jsx jsx */
|
|
10
10
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
11
|
-
import { jsx } from '@emotion/
|
|
11
|
+
import { jsx } from '@emotion/react';
|
|
12
12
|
import { bind } from 'bind-event-listener';
|
|
13
13
|
import { usePlatformLeafSyntheticEventHandler } from '@atlaskit/analytics-next';
|
|
14
14
|
import noop from '@atlaskit/ds-lib/noop';
|
|
@@ -26,7 +26,7 @@ var tooltipZIndex = layers.tooltip();
|
|
|
26
26
|
var analyticsAttributes = {
|
|
27
27
|
componentName: 'tooltip',
|
|
28
28
|
packageName: "@atlaskit/tooltip",
|
|
29
|
-
packageVersion: "17.
|
|
29
|
+
packageVersion: "17.6.1"
|
|
30
30
|
}; // Inverts motion direction
|
|
31
31
|
|
|
32
32
|
var invertedDirection = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { DN0, DN600, N0, N800 } from '@atlaskit/theme/colors';
|
|
5
5
|
import GlobalTheme from '@atlaskit/theme/components';
|
|
6
6
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
@@ -8,7 +8,7 @@ import TooltipPrimitive from './TooltipPrimitive';
|
|
|
8
8
|
var baseStyles = css({
|
|
9
9
|
boxSizing: 'border-box',
|
|
10
10
|
maxWidth: '240px',
|
|
11
|
-
padding:
|
|
11
|
+
padding: "var(--ds-scale-025, 2px)".concat(" ", "var(--ds-scale-075, 6px)"),
|
|
12
12
|
top: 0,
|
|
13
13
|
left: 0,
|
|
14
14
|
borderRadius: "".concat(borderRadius(), "px"),
|
|
@@ -6,7 +6,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
/** @jsx jsx */
|
|
8
8
|
import { forwardRef } from 'react';
|
|
9
|
-
import { css, jsx } from '@emotion/
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { layers } from '@atlaskit/theme/constants';
|
|
11
11
|
var VAR_PRIMITIVE_ZINDEX = 'tooltipPrimitiveZindex';
|
|
12
12
|
var primitiveStyles = css({
|
package/dist/esm/version.json
CHANGED
package/dist/types/Tooltip.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
3
|
import { TooltipProps } from './types';
|
|
4
|
-
declare function Tooltip({ children, position, mousePosition, content, truncate, component: Container, tag: TargetContainer, testId, delay, onShow, onHide, hideTooltipOnClick, hideTooltipOnMouseDown, analyticsContext, strategy, }: TooltipProps): JSX.Element;
|
|
4
|
+
declare function Tooltip({ children, position, mousePosition, content, truncate, component: Container, tag: TargetContainer, testId, delay, onShow, onHide, hideTooltipOnClick, hideTooltipOnMouseDown, analyticsContext, strategy, }: TooltipProps): jsx.JSX.Element;
|
|
5
5
|
declare namespace Tooltip {
|
|
6
6
|
var displayName: string;
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
3
|
import { TooltipProps } from './types';
|
|
4
|
-
declare function Tooltip({ children, position, mousePosition, content, truncate, component: Container, tag: TargetContainer, testId, delay, onShow, onHide, hideTooltipOnClick, hideTooltipOnMouseDown, analyticsContext, strategy, }: TooltipProps): JSX.Element;
|
|
4
|
+
declare function Tooltip({ children, position, mousePosition, content, truncate, component: Container, tag: TargetContainer, testId, delay, onShow, onHide, hideTooltipOnClick, hideTooltipOnMouseDown, analyticsContext, strategy, }: TooltipProps): jsx.JSX.Element;
|
|
5
5
|
declare namespace Tooltip {
|
|
6
6
|
var displayName: string;
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/tooltip",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.6.1",
|
|
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/"
|
|
@@ -15,13 +15,15 @@
|
|
|
15
15
|
"typesVersions": {
|
|
16
16
|
">=4.0 <4.5": {
|
|
17
17
|
"*": [
|
|
18
|
-
"dist/types-ts4.0/*"
|
|
18
|
+
"dist/types-ts4.0/*",
|
|
19
|
+
"dist/types-ts4.0/index.d.ts"
|
|
19
20
|
]
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
23
|
"sideEffects": false,
|
|
23
24
|
"atlaskit:src": "src/index.ts",
|
|
24
25
|
"atlassian": {
|
|
26
|
+
"disableProductCI": true,
|
|
25
27
|
"team": "Design System Team",
|
|
26
28
|
"releaseModel": "scheduled",
|
|
27
29
|
"website": {
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
"@atlaskit/theme": "^12.2.0",
|
|
47
49
|
"@atlaskit/tokens": "^0.10.0",
|
|
48
50
|
"@babel/runtime": "^7.0.0",
|
|
49
|
-
"@emotion/
|
|
51
|
+
"@emotion/react": "^11.7.1",
|
|
50
52
|
"bind-event-listener": "^2.1.1",
|
|
51
53
|
"react-uid": "^2.2.0"
|
|
52
54
|
},
|
|
@@ -57,8 +59,8 @@
|
|
|
57
59
|
"devDependencies": {
|
|
58
60
|
"@atlaskit/button": "^16.3.0",
|
|
59
61
|
"@atlaskit/docs": "*",
|
|
60
|
-
"@atlaskit/icon": "^21.
|
|
61
|
-
"@atlaskit/section-message": "^6.
|
|
62
|
+
"@atlaskit/icon": "^21.11.0",
|
|
63
|
+
"@atlaskit/section-message": "^6.3.0",
|
|
62
64
|
"@atlaskit/ssr": "*",
|
|
63
65
|
"@atlaskit/visual-regression": "*",
|
|
64
66
|
"@atlaskit/webdriver-runner": "*",
|
|
@@ -86,6 +88,7 @@
|
|
|
86
88
|
"dom-events": "use-bind-event-listener",
|
|
87
89
|
"ui-components": "lite-mode",
|
|
88
90
|
"analytics": "analytics-next",
|
|
91
|
+
"design-tokens": "spacing",
|
|
89
92
|
"theming": "tokens",
|
|
90
93
|
"deprecation": "no-deprecated-imports",
|
|
91
94
|
"styling": [
|
package/report.api.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/tooltip"
|
|
1
|
+
## API Report File for "@atlaskit/tooltip".
|
|
2
2
|
|
|
3
|
-
> Do not edit this file.
|
|
3
|
+
> Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
/// <reference types="react" />
|
|
5
|
+
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
6
|
|
|
7
|
+
```ts
|
|
8
8
|
import { ComponentType } from 'react';
|
|
9
9
|
import { CSSProperties } from 'react';
|
|
10
10
|
import { ForwardRefExoticComponent } from 'react';
|
|
11
|
+
import { jsx } from '@emotion/react';
|
|
11
12
|
import { Placement } from '@atlaskit/popper';
|
|
12
13
|
import { ReactNode } from 'react';
|
|
13
14
|
import { RefAttributes } from 'react';
|
|
@@ -33,7 +34,7 @@ declare function Tooltip({
|
|
|
33
34
|
hideTooltipOnMouseDown,
|
|
34
35
|
analyticsContext,
|
|
35
36
|
strategy,
|
|
36
|
-
}: TooltipProps): JSX.Element;
|
|
37
|
+
}: TooltipProps): jsx.JSX.Element;
|
|
37
38
|
|
|
38
39
|
declare namespace Tooltip {
|
|
39
40
|
var displayName: string;
|