@atlaskit/navigation-system 2.2.0 → 2.3.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 2.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`34635d754e047`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/34635d754e047) -
8
+ Update the description of the Side nav's onExpand and onCollapse props.
9
+
10
+ ## 2.3.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`40dea92e11501`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/40dea92e11501) -
15
+ `MenuSectionHeading` has been updated to use regular text (`p` element) instead of a heading (`h2`
16
+ element). This change is behind a feature flag.
17
+
18
+ This has been done to resolve accessibility issues with the component. It does not need to be a
19
+ heading semantically.
20
+
3
21
  ## 2.2.0
4
22
 
5
23
  ### Minor Changes
@@ -9,6 +9,7 @@ exports.MenuSectionHeading = void 0;
9
9
  require("./menu-section-heading.compiled.css");
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _runtime = require("@compiled/react/runtime");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _menuSectionContext = require("./menu-section-context");
13
14
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
15
  var styles = {
@@ -23,7 +24,10 @@ var styles = {
23
24
  var MenuSectionHeading = exports.MenuSectionHeading = function MenuSectionHeading(_ref) {
24
25
  var children = _ref.children;
25
26
  var id = (0, _menuSectionContext.useMenuSectionContext)();
26
- return /*#__PURE__*/React.createElement("h2", {
27
+ return (0, _platformFeatureFlags.fg)('platform_dst_nav4_menu_section_heading_a11y') ? /*#__PURE__*/React.createElement("p", {
28
+ id: "".concat(id, "-heading"),
29
+ className: (0, _runtime.ax)([styles.root])
30
+ }, children) : /*#__PURE__*/React.createElement("h2", {
27
31
  id: "".concat(id, "-heading"),
28
32
  className: (0, _runtime.ax)([styles.root])
29
33
  }, children);
@@ -2,6 +2,7 @@
2
2
  import "./menu-section-heading.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { useMenuSectionContext } from './menu-section-context';
6
7
  const styles = {
7
8
  root: "_11c81vhk _1rjcu2gc _syaz131l _bozg12x7"
@@ -16,7 +17,10 @@ export const MenuSectionHeading = ({
16
17
  children
17
18
  }) => {
18
19
  const id = useMenuSectionContext();
19
- return /*#__PURE__*/React.createElement("h2", {
20
+ return fg('platform_dst_nav4_menu_section_heading_a11y') ? /*#__PURE__*/React.createElement("p", {
21
+ id: `${id}-heading`,
22
+ className: ax([styles.root])
23
+ }, children) : /*#__PURE__*/React.createElement("h2", {
20
24
  id: `${id}-heading`,
21
25
  className: ax([styles.root])
22
26
  }, children);
@@ -2,6 +2,7 @@
2
2
  import "./menu-section-heading.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { useMenuSectionContext } from './menu-section-context';
6
7
  var styles = {
7
8
  root: "_11c81vhk _1rjcu2gc _syaz131l _bozg12x7"
@@ -15,7 +16,10 @@ var styles = {
15
16
  export var MenuSectionHeading = function MenuSectionHeading(_ref) {
16
17
  var children = _ref.children;
17
18
  var id = useMenuSectionContext();
18
- return /*#__PURE__*/React.createElement("h2", {
19
+ return fg('platform_dst_nav4_menu_section_heading_a11y') ? /*#__PURE__*/React.createElement("p", {
20
+ id: "".concat(id, "-heading"),
21
+ className: ax([styles.root])
22
+ }, children) : /*#__PURE__*/React.createElement("h2", {
19
23
  id: "".concat(id, "-heading"),
20
24
  className: ax([styles.root])
21
25
  }, children);
@@ -36,10 +36,14 @@ type SideNavProps = CommonSlotProps & {
36
36
  defaultWidth?: number;
37
37
  /**
38
38
  * Called when the side nav is expanded.
39
+ *
40
+ * Note: The trigger parameter is only provided when the `navx-full-height-sidebar` feature flag is enabled.
39
41
  */
40
42
  onExpand?: VisibilityCallback;
41
43
  /**
42
44
  * Called when the side nav is collapsed.
45
+ *
46
+ * Note: The trigger parameter is only provided when the `navx-full-height-sidebar` feature flag is enabled.
43
47
  */
44
48
  onCollapse?: VisibilityCallback;
45
49
  };
@@ -36,10 +36,14 @@ type SideNavProps = CommonSlotProps & {
36
36
  defaultWidth?: number;
37
37
  /**
38
38
  * Called when the side nav is expanded.
39
+ *
40
+ * Note: The trigger parameter is only provided when the `navx-full-height-sidebar` feature flag is enabled.
39
41
  */
40
42
  onExpand?: VisibilityCallback;
41
43
  /**
42
44
  * Called when the side nav is collapsed.
45
+ *
46
+ * Note: The trigger parameter is only provided when the `navx-full-height-sidebar` feature flag is enabled.
43
47
  */
44
48
  onCollapse?: VisibilityCallback;
45
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
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",
@@ -106,7 +106,7 @@
106
106
  "@atlaskit/link": "^3.2.0",
107
107
  "@atlaskit/lozenge": "^13.0.0",
108
108
  "@atlaskit/menu": "^8.3.0",
109
- "@atlaskit/onboarding": "^14.3.0",
109
+ "@atlaskit/onboarding": "^14.4.0",
110
110
  "@atlaskit/page-header": "^12.1.0",
111
111
  "@atlaskit/page-layout": "^4.2.0",
112
112
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
@@ -187,6 +187,9 @@
187
187
  },
188
188
  "navx-full-height-sidebar": {
189
189
  "type": "boolean"
190
+ },
191
+ "platform_dst_nav4_menu_section_heading_a11y": {
192
+ "type": "boolean"
190
193
  }
191
194
  },
192
195
  "homepage": "https://atlassian.design/components/navigation-system"