@canonical/react-components 4.0.1 → 4.1.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.
@@ -41,10 +41,14 @@ export type Props<L = SideNavigationLinkDefaultElement> = PropsWithSpread<{
41
41
  * Classes to apply to the nav element.
42
42
  */
43
43
  navClassName?: string;
44
+ /**
45
+ * Aria label to apply to the nav element.
46
+ */
47
+ ariaLabel?: string;
44
48
  }, HTMLProps<HTMLDivElement>>;
45
49
  /**
46
50
  * This is a [React](https://reactjs.org/) component for side navigation, used
47
51
  * in the [Vanilla](https://vanillaframework.io/docs/) layouts.
48
52
  */
49
- declare const SideNavigation: <L = SideNavigationLinkDefaultElement>({ children, className, dark, hasIcons, items, linkComponent, listClassName, navClassName, ...props }: Props<L>) => React.JSX.Element;
53
+ declare const SideNavigation: <L = SideNavigationLinkDefaultElement>({ children, className, dark, hasIcons, items, linkComponent, listClassName, navClassName, ariaLabel, ...props }: Props<L>) => React.JSX.Element;
50
54
  export default SideNavigation;
@@ -9,7 +9,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
9
9
  var _SideNavigationItem = _interopRequireDefault(require("./SideNavigationItem"));
10
10
  var _utils = require("../../utils");
11
11
  const _excluded = ["items"],
12
- _excluded2 = ["children", "className", "dark", "hasIcons", "items", "linkComponent", "listClassName", "navClassName"];
12
+ _excluded2 = ["children", "className", "dark", "hasIcons", "items", "linkComponent", "listClassName", "navClassName", "ariaLabel"];
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
15
15
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
@@ -81,7 +81,8 @@ const SideNavigation = _ref2 => {
81
81
  items,
82
82
  linkComponent,
83
83
  listClassName,
84
- navClassName
84
+ navClassName,
85
+ ariaLabel
85
86
  } = _ref2,
86
87
  props = _objectWithoutProperties(_ref2, _excluded2);
87
88
  return /*#__PURE__*/_react.default.createElement("div", _extends({
@@ -90,6 +91,7 @@ const SideNavigation = _ref2 => {
90
91
  "is-dark": dark
91
92
  })
92
93
  }, props), /*#__PURE__*/_react.default.createElement("nav", {
94
+ "aria-label": ariaLabel,
93
95
  className: navClassName
94
96
  }, children !== null && children !== void 0 ? children : generateItems(items, listClassName, linkComponent, dark)));
95
97
  };
@@ -41,10 +41,14 @@ export type Props<L = SideNavigationLinkDefaultElement> = PropsWithSpread<{
41
41
  * Classes to apply to the nav element.
42
42
  */
43
43
  navClassName?: string;
44
+ /**
45
+ * Aria label to apply to the nav element.
46
+ */
47
+ ariaLabel?: string;
44
48
  }, HTMLProps<HTMLDivElement>>;
45
49
  /**
46
50
  * This is a [React](https://reactjs.org/) component for side navigation, used
47
51
  * in the [Vanilla](https://vanillaframework.io/docs/) layouts.
48
52
  */
49
- declare const SideNavigation: <L = SideNavigationLinkDefaultElement>({ children, className, dark, hasIcons, items, linkComponent, listClassName, navClassName, ...props }: Props<L>) => React.JSX.Element;
53
+ declare const SideNavigation: <L = SideNavigationLinkDefaultElement>({ children, className, dark, hasIcons, items, linkComponent, listClassName, navClassName, ariaLabel, ...props }: Props<L>) => React.JSX.Element;
50
54
  export default SideNavigation;
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["items"],
2
- _excluded2 = ["children", "className", "dark", "hasIcons", "items", "linkComponent", "listClassName", "navClassName"];
2
+ _excluded2 = ["children", "className", "dark", "hasIcons", "items", "linkComponent", "listClassName", "navClassName", "ariaLabel"];
3
3
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
4
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
5
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
@@ -74,7 +74,8 @@ var SideNavigation = _ref2 => {
74
74
  items,
75
75
  linkComponent,
76
76
  listClassName,
77
- navClassName
77
+ navClassName,
78
+ ariaLabel
78
79
  } = _ref2,
79
80
  props = _objectWithoutProperties(_ref2, _excluded2);
80
81
  return /*#__PURE__*/React.createElement("div", _extends({
@@ -83,6 +84,7 @@ var SideNavigation = _ref2 => {
83
84
  "is-dark": dark
84
85
  })
85
86
  }, props), /*#__PURE__*/React.createElement("nav", {
87
+ "aria-label": ariaLabel,
86
88
  className: navClassName
87
89
  }, children !== null && children !== void 0 ? children : generateItems(items, listClassName, linkComponent, dark)));
88
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-components",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": {