@atlaskit/atlassian-navigation 5.0.2 → 5.0.3

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,13 @@
1
1
  # @atlaskit/atlassian-navigation
2
2
 
3
+ ## 5.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#127213](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/127213)
8
+ [`73f69318be2bc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73f69318be2bc) -
9
+ Added isScreenReaderAnnouncementDisabled for iconButton tooltip to avoid duplicate announcements.
10
+
3
11
  ## 5.0.2
4
12
 
5
13
  ### Patch Changes
@@ -70,7 +70,8 @@ var Help = exports.Help = /*#__PURE__*/(0, _react.forwardRef)(function (props, r
70
70
  ref: ref,
71
71
  target: target,
72
72
  testId: testId,
73
- tooltip: tooltip
73
+ tooltip: tooltip,
74
+ isTooltipAnnouncementDisabled: true
74
75
  // These are all explicit, leaving it in just in case
75
76
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
76
77
  }, rest));
@@ -13,7 +13,7 @@ var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom
13
13
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
14
14
  var _theme = require("../../theme");
15
15
  var _styles = require("./styles");
16
- var _excluded = ["icon", "label", "testId", "tooltip", "component", "href", "id", "isDisabled", "isSelected", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "theme"];
16
+ var _excluded = ["icon", "label", "testId", "tooltip", "component", "href", "id", "isDisabled", "isSelected", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "theme", "isTooltipAnnouncementDisabled"];
17
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
19
  /**
@@ -44,6 +44,8 @@ var IconButton = exports.IconButton = /*#__PURE__*/(0, _react.forwardRef)(functi
44
44
  onMouseUp = props.onMouseUp,
45
45
  target = props.target,
46
46
  theme = props.theme,
47
+ _props$isTooltipAnnou = props.isTooltipAnnouncementDisabled,
48
+ isTooltipAnnouncementDisabled = _props$isTooltipAnnou === void 0 ? false : _props$isTooltipAnnou,
47
49
  rest = (0, _objectWithoutProperties2.default)(props, _excluded);
48
50
  var themeFromContext = (0, _theme.useTheme)();
49
51
  var button = /*#__PURE__*/_react.default.createElement(_customThemeButton.default, (0, _extends2.default)({
@@ -74,7 +76,8 @@ var IconButton = exports.IconButton = /*#__PURE__*/(0, _react.forwardRef)(functi
74
76
  if (tooltip) {
75
77
  return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
76
78
  content: tooltip,
77
- hideTooltipOnClick: true
79
+ hideTooltipOnClick: true,
80
+ isScreenReaderAnnouncementDisabled: isTooltipAnnouncementDisabled
78
81
  }, button);
79
82
  }
80
83
  return button;
@@ -72,7 +72,8 @@ var Notifications = exports.Notifications = /*#__PURE__*/(0, _react.forwardRef)(
72
72
  ref: ref,
73
73
  target: target,
74
74
  testId: testId,
75
- tooltip: tooltip
75
+ tooltip: tooltip,
76
+ isTooltipAnnouncementDisabled: true
76
77
  // These are all explicit, leaving it in just in case
77
78
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
78
79
  }, rest)));
@@ -66,7 +66,8 @@ var Profile = exports.Profile = /*#__PURE__*/(0, _react.forwardRef)(function (pr
66
66
  // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
67
67
  ,
68
68
  theme: theme,
69
- tooltip: tooltip
69
+ tooltip: tooltip,
70
+ isTooltipAnnouncementDisabled: true
70
71
  // These are mostly explicit, leaving it in just in case
71
72
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
72
73
  }, rest)));
@@ -64,6 +64,7 @@ var Settings = exports.Settings = /*#__PURE__*/(0, _react.forwardRef)(function (
64
64
  ref: ref,
65
65
  target: target,
66
66
  testId: testId,
67
- tooltip: tooltip
67
+ tooltip: tooltip,
68
+ isTooltipAnnouncementDisabled: true
68
69
  }, rest)));
69
70
  });
@@ -63,7 +63,8 @@ export const Help = /*#__PURE__*/forwardRef((props, ref) => {
63
63
  ref: ref,
64
64
  target: target,
65
65
  testId: testId,
66
- tooltip: tooltip
66
+ tooltip: tooltip,
67
+ isTooltipAnnouncementDisabled: true
67
68
  // These are all explicit, leaving it in just in case
68
69
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
69
70
  }, rest));
@@ -33,6 +33,7 @@ export const IconButton = /*#__PURE__*/forwardRef((props, ref) => {
33
33
  onMouseUp,
34
34
  target,
35
35
  theme,
36
+ isTooltipAnnouncementDisabled = false,
36
37
  ...rest
37
38
  } = props;
38
39
  const themeFromContext = useTheme();
@@ -64,7 +65,8 @@ export const IconButton = /*#__PURE__*/forwardRef((props, ref) => {
64
65
  if (tooltip) {
65
66
  return /*#__PURE__*/React.createElement(Tooltip, {
66
67
  content: tooltip,
67
- hideTooltipOnClick: true
68
+ hideTooltipOnClick: true,
69
+ isScreenReaderAnnouncementDisabled: isTooltipAnnouncementDisabled
68
70
  }, button);
69
71
  }
70
72
  return button;
@@ -62,7 +62,8 @@ export const Notifications = /*#__PURE__*/forwardRef((props, ref) => {
62
62
  ref: ref,
63
63
  target: target,
64
64
  testId: testId,
65
- tooltip: tooltip
65
+ tooltip: tooltip,
66
+ isTooltipAnnouncementDisabled: true
66
67
  // These are all explicit, leaving it in just in case
67
68
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
68
69
  }, rest)));
@@ -56,7 +56,8 @@ export const Profile = /*#__PURE__*/forwardRef((props, ref) => {
56
56
  // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
57
57
  ,
58
58
  theme: theme,
59
- tooltip: tooltip
59
+ tooltip: tooltip,
60
+ isTooltipAnnouncementDisabled: true
60
61
  // These are mostly explicit, leaving it in just in case
61
62
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
62
63
  }, rest)));
@@ -54,6 +54,7 @@ export const Settings = /*#__PURE__*/forwardRef((props, ref) => {
54
54
  ref: ref,
55
55
  target: target,
56
56
  testId: testId,
57
- tooltip: tooltip
57
+ tooltip: tooltip,
58
+ isTooltipAnnouncementDisabled: true
58
59
  }, rest)));
59
60
  });
@@ -60,7 +60,8 @@ export var Help = /*#__PURE__*/forwardRef(function (props, ref) {
60
60
  ref: ref,
61
61
  target: target,
62
62
  testId: testId,
63
- tooltip: tooltip
63
+ tooltip: tooltip,
64
+ isTooltipAnnouncementDisabled: true
64
65
  // These are all explicit, leaving it in just in case
65
66
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
66
67
  }, rest));
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["icon", "label", "testId", "tooltip", "component", "href", "id", "isDisabled", "isSelected", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "theme"];
3
+ var _excluded = ["icon", "label", "testId", "tooltip", "component", "href", "id", "isDisabled", "isSelected", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "theme", "isTooltipAnnouncementDisabled"];
4
4
  import React, { forwardRef } from 'react';
5
5
  import Button from '@atlaskit/button/custom-theme-button';
6
6
  import Tooltip from '@atlaskit/tooltip';
@@ -34,6 +34,8 @@ export var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
34
34
  onMouseUp = props.onMouseUp,
35
35
  target = props.target,
36
36
  theme = props.theme,
37
+ _props$isTooltipAnnou = props.isTooltipAnnouncementDisabled,
38
+ isTooltipAnnouncementDisabled = _props$isTooltipAnnou === void 0 ? false : _props$isTooltipAnnou,
37
39
  rest = _objectWithoutProperties(props, _excluded);
38
40
  var themeFromContext = useTheme();
39
41
  var button = /*#__PURE__*/React.createElement(Button, _extends({
@@ -64,7 +66,8 @@ export var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
64
66
  if (tooltip) {
65
67
  return /*#__PURE__*/React.createElement(Tooltip, {
66
68
  content: tooltip,
67
- hideTooltipOnClick: true
69
+ hideTooltipOnClick: true,
70
+ isScreenReaderAnnouncementDisabled: isTooltipAnnouncementDisabled
68
71
  }, button);
69
72
  }
70
73
  return button;
@@ -62,7 +62,8 @@ export var Notifications = /*#__PURE__*/forwardRef(function (props, ref) {
62
62
  ref: ref,
63
63
  target: target,
64
64
  testId: testId,
65
- tooltip: tooltip
65
+ tooltip: tooltip,
66
+ isTooltipAnnouncementDisabled: true
66
67
  // These are all explicit, leaving it in just in case
67
68
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
68
69
  }, rest)));
@@ -56,7 +56,8 @@ export var Profile = /*#__PURE__*/forwardRef(function (props, ref) {
56
56
  // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
57
57
  ,
58
58
  theme: theme,
59
- tooltip: tooltip
59
+ tooltip: tooltip,
60
+ isTooltipAnnouncementDisabled: true
60
61
  // These are mostly explicit, leaving it in just in case
61
62
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
62
63
  }, rest)));
@@ -54,6 +54,7 @@ export var Settings = /*#__PURE__*/forwardRef(function (props, ref) {
54
54
  ref: ref,
55
55
  target: target,
56
56
  testId: testId,
57
- tooltip: tooltip
57
+ tooltip: tooltip,
58
+ isTooltipAnnouncementDisabled: true
58
59
  }, rest)));
59
60
  });
@@ -11,4 +11,5 @@ import React from 'react';
11
11
  export declare const IconButton: React.ForwardRefExoticComponent<import("./types").BaseIconButtonProps & {
12
12
  icon: React.ReactChild | undefined;
13
13
  theme?: ((current: (props: import("@atlaskit/button/custom-theme-button").ThemeProps) => import("@atlaskit/button/custom-theme-button").ThemeTokens, props: import("@atlaskit/button/custom-theme-button").ThemeProps) => import("@atlaskit/button/custom-theme-button").ThemeTokens) | undefined;
14
+ isTooltipAnnouncementDisabled?: boolean | undefined;
14
15
  } & React.RefAttributes<HTMLElement>>;
@@ -9,6 +9,10 @@ export type IconButtonProps = BaseIconButtonProps & {
9
9
  * Theme for the icon button.
10
10
  */
11
11
  theme?: CustomThemeButtonProps['theme'];
12
+ /**
13
+ * Controls tooltip announcement
14
+ */
15
+ isTooltipAnnouncementDisabled?: boolean;
12
16
  };
13
17
  /**
14
18
  * We aren't inheriting the types from button here because it blows up ERT.
@@ -12,6 +12,7 @@ import { type ProfileProps } from './types';
12
12
  export declare const Profile: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
13
13
  icon: React.ReactChild | undefined;
14
14
  theme?: ((current: (props: import("@atlaskit/button").ThemeProps) => import("@atlaskit/button").ThemeTokens, props: import("@atlaskit/button").ThemeProps) => import("@atlaskit/button").ThemeTokens) | undefined;
15
+ isTooltipAnnouncementDisabled?: boolean | undefined;
15
16
  } & React.RefAttributes<HTMLElement>>;
16
17
  declare const _default: (props: ProfileProps) => void;
17
18
  export default _default;
@@ -11,4 +11,5 @@ import React from 'react';
11
11
  export declare const IconButton: React.ForwardRefExoticComponent<import("./types").BaseIconButtonProps & {
12
12
  icon: React.ReactChild | undefined;
13
13
  theme?: ((current: (props: import("@atlaskit/button/custom-theme-button").ThemeProps) => import("@atlaskit/button/custom-theme-button").ThemeTokens, props: import("@atlaskit/button/custom-theme-button").ThemeProps) => import("@atlaskit/button/custom-theme-button").ThemeTokens) | undefined;
14
+ isTooltipAnnouncementDisabled?: boolean | undefined;
14
15
  } & React.RefAttributes<HTMLElement>>;
@@ -9,6 +9,10 @@ export type IconButtonProps = BaseIconButtonProps & {
9
9
  * Theme for the icon button.
10
10
  */
11
11
  theme?: CustomThemeButtonProps['theme'];
12
+ /**
13
+ * Controls tooltip announcement
14
+ */
15
+ isTooltipAnnouncementDisabled?: boolean;
12
16
  };
13
17
  /**
14
18
  * We aren't inheriting the types from button here because it blows up ERT.
@@ -12,6 +12,7 @@ import { type ProfileProps } from './types';
12
12
  export declare const Profile: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
13
13
  icon: React.ReactChild | undefined;
14
14
  theme?: ((current: (props: import("@atlaskit/button").ThemeProps) => import("@atlaskit/button").ThemeTokens, props: import("@atlaskit/button").ThemeProps) => import("@atlaskit/button").ThemeTokens) | undefined;
15
+ isTooltipAnnouncementDisabled?: boolean | undefined;
15
16
  } & React.RefAttributes<HTMLElement>>;
16
17
  declare const _default: (props: ProfileProps) => void;
17
18
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "5.0.2",
3
+ "version": "5.0.3",
4
4
  "description": "A horizontal navigation component for Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -52,9 +52,9 @@
52
52
  "@atlaskit/logo": "^16.0.0",
53
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
54
54
  "@atlaskit/popup": "^2.0.0",
55
- "@atlaskit/primitives": "^14.1.0",
55
+ "@atlaskit/primitives": "^14.2.0",
56
56
  "@atlaskit/theme": "^18.0.0",
57
- "@atlaskit/tokens": "^4.4.0",
57
+ "@atlaskit/tokens": "^4.5.0",
58
58
  "@atlaskit/tooltip": "^20.0.0",
59
59
  "@atlaskit/width-detector": "^5.0.0",
60
60
  "@babel/runtime": "^7.0.0",
@@ -80,14 +80,15 @@
80
80
  "@atlaskit/menu": "^3.1.0",
81
81
  "@atlaskit/notification-indicator": "^10.0.0",
82
82
  "@atlaskit/notification-log-client": "^6.2.0",
83
- "@atlaskit/section-message": "^8.1.0",
83
+ "@atlaskit/section-message": "^8.2.0",
84
84
  "@atlaskit/spinner": "^18.0.0",
85
85
  "@atlaskit/textfield": "^8.0.0",
86
86
  "@atlaskit/visual-regression": "^0.10.0",
87
- "@atlassian/switcher": "^35.8.0",
87
+ "@atlassian/switcher": "^35.11.0",
88
88
  "@atlassian/switcher-test-utils": "^4.1.0",
89
89
  "@testing-library/react": "^13.4.0",
90
90
  "@testing-library/react-hooks": "^8.0.1",
91
+ "@testing-library/user-event": "^14.4.3",
91
92
  "jest-emotion": "^10.0.32",
92
93
  "react": "^18.2.0",
93
94
  "react-dom": "^18.2.0",