@atlaskit/tooltip 20.3.2 → 20.4.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/tooltip
2
2
 
3
+ ## 20.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#191801](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/191801)
8
+ [`2896372588f0c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2896372588f0c) -
9
+ [ux] Fix tooltip focusing behavior
10
+
11
+ ## 20.3.3
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 20.3.2
4
18
 
5
19
  ### Patch Changes
@@ -33,7 +33,7 @@ var tooltipZIndex = _constants.layers.tooltip();
33
33
  var analyticsAttributes = {
34
34
  componentName: 'tooltip',
35
35
  packageName: "@atlaskit/tooltip",
36
- packageVersion: "20.3.1"
36
+ packageVersion: "20.3.3"
37
37
  };
38
38
 
39
39
  // Inverts motion direction
@@ -373,12 +373,12 @@ function Tooltip(_ref) {
373
373
  return;
374
374
  }
375
375
  }, []);
376
- var onFocus = (0, _react.useCallback)(function () {
376
+ var onFocus = (0, _react.useCallback)(function (e) {
377
377
  // Check if focus-visible
378
378
  // Prevents tooltips from showing when focus is not visible,
379
379
  // i.e., when focus is moved onto tooltip trigger inside a popup on open
380
380
  try {
381
- if (targetRef.current && !targetRef.current.matches(':focus-visible') && (0, _platformFeatureFlags.fg)('platform-tooltip-focus-visible')) {
381
+ if (!e.target.matches(':focus-visible') && (0, _platformFeatureFlags.fg)('platform-tooltip-focus-visible-new')) {
382
382
  return;
383
383
  }
384
384
  } catch (_) {
@@ -545,5 +545,4 @@ function Tooltip(_ref) {
545
545
  }));
546
546
  })) : null);
547
547
  }
548
- Tooltip.displayName = 'Tooltip';
549
548
  var _default = exports.default = Tooltip;
@@ -20,7 +20,7 @@ const tooltipZIndex = layers.tooltip();
20
20
  const analyticsAttributes = {
21
21
  componentName: 'tooltip',
22
22
  packageName: "@atlaskit/tooltip",
23
- packageVersion: "20.3.1"
23
+ packageVersion: "20.3.3"
24
24
  };
25
25
 
26
26
  // Inverts motion direction
@@ -349,12 +349,12 @@ function Tooltip({
349
349
  return;
350
350
  }
351
351
  }, []);
352
- const onFocus = useCallback(() => {
352
+ const onFocus = useCallback(e => {
353
353
  // Check if focus-visible
354
354
  // Prevents tooltips from showing when focus is not visible,
355
355
  // i.e., when focus is moved onto tooltip trigger inside a popup on open
356
356
  try {
357
- if (targetRef.current && !targetRef.current.matches(':focus-visible') && fg('platform-tooltip-focus-visible')) {
357
+ if (!e.target.matches(':focus-visible') && fg('platform-tooltip-focus-visible-new')) {
358
358
  return;
359
359
  }
360
360
  } catch (_) {
@@ -525,5 +525,4 @@ function Tooltip({
525
525
  }) : content)));
526
526
  })) : null);
527
527
  }
528
- Tooltip.displayName = 'Tooltip';
529
528
  export default Tooltip;
@@ -24,7 +24,7 @@ var tooltipZIndex = layers.tooltip();
24
24
  var analyticsAttributes = {
25
25
  componentName: 'tooltip',
26
26
  packageName: "@atlaskit/tooltip",
27
- packageVersion: "20.3.1"
27
+ packageVersion: "20.3.3"
28
28
  };
29
29
 
30
30
  // Inverts motion direction
@@ -364,12 +364,12 @@ function Tooltip(_ref) {
364
364
  return;
365
365
  }
366
366
  }, []);
367
- var onFocus = useCallback(function () {
367
+ var onFocus = useCallback(function (e) {
368
368
  // Check if focus-visible
369
369
  // Prevents tooltips from showing when focus is not visible,
370
370
  // i.e., when focus is moved onto tooltip trigger inside a popup on open
371
371
  try {
372
- if (targetRef.current && !targetRef.current.matches(':focus-visible') && fg('platform-tooltip-focus-visible')) {
372
+ if (!e.target.matches(':focus-visible') && fg('platform-tooltip-focus-visible-new')) {
373
373
  return;
374
374
  }
375
375
  } catch (_) {
@@ -536,5 +536,4 @@ function Tooltip(_ref) {
536
536
  }));
537
537
  })) : null);
538
538
  }
539
- Tooltip.displayName = 'Tooltip';
540
539
  export default Tooltip;
@@ -6,7 +6,4 @@ import { type TooltipProps } from './types';
6
6
  * A tooltip is a floating, non-actionable label used to explain a user interface element or feature.
7
7
  */
8
8
  declare function Tooltip({ children, position, mousePosition, content, truncate, component: Container, tag: TargetContainer, testId, delay, onShow, onHide, canAppear, hideTooltipOnClick, hideTooltipOnMouseDown, analyticsContext, strategy, ignoreTooltipPointerEvents, isScreenReaderAnnouncementDisabled, }: TooltipProps): React.JSX.Element;
9
- declare namespace Tooltip {
10
- var displayName: string;
11
- }
12
9
  export default Tooltip;
@@ -6,7 +6,4 @@ import { type TooltipProps } from './types';
6
6
  * A tooltip is a floating, non-actionable label used to explain a user interface element or feature.
7
7
  */
8
8
  declare function Tooltip({ children, position, mousePosition, content, truncate, component: Container, tag: TargetContainer, testId, delay, onShow, onHide, canAppear, hideTooltipOnClick, hideTooltipOnMouseDown, analyticsContext, strategy, ignoreTooltipPointerEvents, isScreenReaderAnnouncementDisabled, }: TooltipProps): React.JSX.Element;
9
- declare namespace Tooltip {
10
- var displayName: string;
11
- }
12
9
  export default Tooltip;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tooltip",
3
- "version": "20.3.2",
3
+ "version": "20.4.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/"
@@ -41,14 +41,14 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@atlaskit/analytics-next": "^11.1.0",
44
- "@atlaskit/ds-lib": "^4.0.0",
44
+ "@atlaskit/ds-lib": "^5.0.0",
45
45
  "@atlaskit/layering": "^3.0.0",
46
46
  "@atlaskit/motion": "^5.1.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
48
  "@atlaskit/popper": "^7.1.0",
49
49
  "@atlaskit/portal": "^5.1.0",
50
50
  "@atlaskit/theme": "^19.0.0",
51
- "@atlaskit/tokens": "^5.4.0",
51
+ "@atlaskit/tokens": "^5.6.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@compiled/react": "^0.18.3",
54
54
  "bind-event-listener": "^3.0.0"
@@ -61,13 +61,13 @@
61
61
  "@af/accessibility-testing": "workspace:^",
62
62
  "@af/integration-testing": "workspace:^",
63
63
  "@af/visual-regression": "workspace:^",
64
- "@atlaskit/button": "^23.2.0",
64
+ "@atlaskit/button": "^23.3.0",
65
65
  "@atlaskit/css": "^0.12.0",
66
66
  "@atlaskit/docs": "^11.0.0",
67
- "@atlaskit/icon": "^27.3.0",
67
+ "@atlaskit/icon": "^27.7.0",
68
68
  "@atlaskit/link": "^3.2.0",
69
69
  "@atlaskit/primitives": "^14.10.0",
70
- "@atlaskit/section-message": "^8.2.0",
70
+ "@atlaskit/section-message": "^8.5.0",
71
71
  "@atlassian/ssr-tests": "^0.2.0",
72
72
  "@testing-library/react": "^13.4.0",
73
73
  "react-dom": "^18.2.0",
@@ -100,7 +100,7 @@
100
100
  },
101
101
  "homepage": "https://atlassian.design/components/tooltip/",
102
102
  "platform-feature-flags": {
103
- "platform-tooltip-focus-visible": {
103
+ "platform-tooltip-focus-visible-new": {
104
104
  "type": "boolean"
105
105
  },
106
106
  "platform-component-visual-refresh": {