@atlaskit/navigation-system 1.2.0 → 2.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 CHANGED
@@ -1,5 +1,43 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`ca468a8bbccd9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ca468a8bbccd9) -
8
+ The elemBefore chevron icon button in the link (selectable) variants of
9
+ `ExpandableMenuItemTrigger` is now labelled by the menu item (specifically, its anchor element)
10
+ through the aria-labelledby attribute. This is to provide context on what will be expanded or
11
+ collapsed to screen readers. Assistive technology users will still have the `aria-expanded`
12
+ attribute to determine the expanded state.
13
+
14
+ This change was previously behind a feature flag, which has now been removed.
15
+
16
+ **More details:**
17
+
18
+ Previously, the chevron icon button would be labelled by the hardcoded strings "Expand" or
19
+ "Collapse" - which is not helpful for screen readers.
20
+
21
+ Now, the chevron icon button is labelled by the menu item trigger content (children).
22
+
23
+ For example, for the below expandable menu item trigger:
24
+
25
+ ```tsx
26
+ <ExpandableMenuItemTrigger href="#">Recent</ExpandableMenuItemTrigger>
27
+ ```
28
+
29
+ Previously, the chevron icon button would be a `button` element with the name "Expand" or
30
+ "Collapse", based on the expanded state.
31
+
32
+ Now, the chevron icon button will be a `button` element with the name "Recent".
33
+
34
+ You will likely need to update your tests to account for this change, by using a different
35
+ selector.
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies
40
+
3
41
  ## 1.2.0
4
42
 
5
43
  ### Minor Changes
@@ -14,7 +14,6 @@ var _react = _interopRequireWildcard(require("react"));
14
14
  var _new = require("@atlaskit/button/new");
15
15
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
16
16
  var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
17
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
17
  var _menuItem = require("../menu-item");
19
18
  var _useScrollMenuItemIntoView = require("../use-scroll-menu-item-into-view");
20
19
  var _expandableMenuItemContext = require("./expandable-menu-item-context");
@@ -108,11 +107,11 @@ var ExpandableMenuItemTrigger = exports.ExpandableMenuItemTrigger = /*#__PURE__*
108
107
  // `aria-expanded` attribute to indicate the expanded state of the menu item.
109
108
  // We are not using the `aria-label` attribute here as it is not supported by the `IconButton` component.
110
109
  ,
111
- "aria-labelledby": (0, _platformFeatureFlags.fg)('platform_dst_expandable_menu_item_elembefore_label') ? id : undefined
110
+ "aria-labelledby": id
112
111
  // IconButton requires a label prop, however it will not be used by screen readers as we are setting
113
112
  // `aria-labelledby`, which will be used instead.
114
113
  ,
115
- label: (0, _platformFeatureFlags.fg)('platform_dst_expandable_menu_item_elembefore_label') ? '' : isExpanded ? 'Collapse' : 'Expand',
114
+ label: "",
116
115
  appearance: "subtle",
117
116
  spacing: "compact",
118
117
  onClick: handleIconClick,
@@ -6,7 +6,6 @@ import React, { forwardRef, useCallback, useId, useRef } from 'react';
6
6
  import { IconButton } from '@atlaskit/button/new';
7
7
  import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
8
8
  import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { MenuItemBase, nestedOpenPopupCSSSelector } from '../menu-item';
11
10
  import { useScrollMenuItemIntoView } from '../use-scroll-menu-item-into-view';
12
11
  import { useIsExpanded, useOnExpansionToggle, useSetIsExpanded } from './expandable-menu-item-context';
@@ -99,11 +98,11 @@ export const ExpandableMenuItemTrigger = /*#__PURE__*/forwardRef(({
99
98
  // `aria-expanded` attribute to indicate the expanded state of the menu item.
100
99
  // We are not using the `aria-label` attribute here as it is not supported by the `IconButton` component.
101
100
  ,
102
- "aria-labelledby": fg('platform_dst_expandable_menu_item_elembefore_label') ? id : undefined
101
+ "aria-labelledby": id
103
102
  // IconButton requires a label prop, however it will not be used by screen readers as we are setting
104
103
  // `aria-labelledby`, which will be used instead.
105
104
  ,
106
- label: fg('platform_dst_expandable_menu_item_elembefore_label') ? '' : isExpanded ? 'Collapse' : 'Expand',
105
+ label: "",
107
106
  appearance: "subtle",
108
107
  spacing: "compact",
109
108
  onClick: handleIconClick,
@@ -6,7 +6,6 @@ import React, { forwardRef, useCallback, useId, useRef } from 'react';
6
6
  import { IconButton } from '@atlaskit/button/new';
7
7
  import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
8
8
  import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { MenuItemBase, nestedOpenPopupCSSSelector } from '../menu-item';
11
10
  import { useScrollMenuItemIntoView } from '../use-scroll-menu-item-into-view';
12
11
  import { useIsExpanded, useOnExpansionToggle, useSetIsExpanded } from './expandable-menu-item-context';
@@ -99,11 +98,11 @@ export var ExpandableMenuItemTrigger = /*#__PURE__*/forwardRef(function (_ref2,
99
98
  // `aria-expanded` attribute to indicate the expanded state of the menu item.
100
99
  // We are not using the `aria-label` attribute here as it is not supported by the `IconButton` component.
101
100
  ,
102
- "aria-labelledby": fg('platform_dst_expandable_menu_item_elembefore_label') ? id : undefined
101
+ "aria-labelledby": id
103
102
  // IconButton requires a label prop, however it will not be used by screen readers as we are setting
104
103
  // `aria-labelledby`, which will be used instead.
105
104
  ,
106
- label: fg('platform_dst_expandable_menu_item_elembefore_label') ? '' : isExpanded ? 'Collapse' : 'Expand',
105
+ label: "",
107
106
  appearance: "subtle",
108
107
  spacing: "compact",
109
108
  onClick: handleIconClick,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "description": "The latest navigation system for Atlassian apps.",
5
5
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
6
6
  "author": "Atlassian Pty Ltd",
@@ -120,8 +120,8 @@
120
120
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
121
121
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
122
122
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
123
- "@atlaskit/primitives": "^14.11.0",
124
- "@atlaskit/tokens": "^6.0.0",
123
+ "@atlaskit/primitives": "^14.12.0",
124
+ "@atlaskit/tokens": "^6.1.0",
125
125
  "@atlaskit/tooltip": "^20.4.0",
126
126
  "@atlaskit/visually-hidden": "^3.0.0",
127
127
  "@babel/runtime": "^7.0.0",
@@ -214,9 +214,6 @@
214
214
  "platform_dst_nav4_flyout_use_capture_outside": {
215
215
  "type": "boolean"
216
216
  },
217
- "platform_dst_expandable_menu_item_elembefore_label": {
218
- "type": "boolean"
219
- },
220
217
  "platform_dst_nav4_skip_links_hydration_fix": {
221
218
  "type": "boolean"
222
219
  },