@atlaskit/menu 2.1.3 → 2.1.4
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 +6 -0
- package/dist/cjs/menu-item/heading-item.js +5 -1
- package/dist/es2019/menu-item/heading-item.js +3 -0
- package/dist/esm/menu-item/heading-item.js +5 -1
- package/dist/types/menu-item/heading-item.d.ts +1 -1
- package/dist/types/types.d.ts +5 -0
- package/dist/types-ts4.5/menu-item/heading-item.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +5 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/menu
|
|
2
2
|
|
|
3
|
+
## 2.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#58913](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58913) [`36796c121e2a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/36796c121e2a) - [ux] This change includes heading role for HeadingItem and new prop `headingLevel` to specify the level of heading to be defined by assistive technologies.
|
|
8
|
+
|
|
3
9
|
## 2.1.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -14,7 +14,7 @@ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
|
14
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
16
|
var _typography = require("@atlaskit/theme/typography");
|
|
17
|
-
var _excluded = ["children", "testId", "id", "cssFn", "className"];
|
|
17
|
+
var _excluded = ["children", "testId", "headingLevel", "id", "cssFn", "className"];
|
|
18
18
|
/** @jsx jsx */
|
|
19
19
|
var itemHeadingContentHeight = _typography.headingSizes.h100.lineHeight;
|
|
20
20
|
var itemHeadingFontSize = _typography.headingSizes.h100.size;
|
|
@@ -39,6 +39,8 @@ var headingStyles = (0, _react2.css)({
|
|
|
39
39
|
var HeadingItem = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
40
40
|
var children = _ref.children,
|
|
41
41
|
testId = _ref.testId,
|
|
42
|
+
_ref$headingLevel = _ref.headingLevel,
|
|
43
|
+
headingLevel = _ref$headingLevel === void 0 ? 2 : _ref$headingLevel,
|
|
42
44
|
id = _ref.id,
|
|
43
45
|
_ref$cssFn = _ref.cssFn,
|
|
44
46
|
cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn,
|
|
@@ -52,6 +54,8 @@ var HeadingItem = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
52
54
|
css: [headingStyles,
|
|
53
55
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
54
56
|
UNSAFE_overrides],
|
|
57
|
+
role: "heading",
|
|
58
|
+
"aria-level": headingLevel,
|
|
55
59
|
"data-testid": testId,
|
|
56
60
|
"data-ds--menu--heading-item": true,
|
|
57
61
|
id: id,
|
|
@@ -30,6 +30,7 @@ const headingStyles = css({
|
|
|
30
30
|
const HeadingItem = /*#__PURE__*/memo(({
|
|
31
31
|
children,
|
|
32
32
|
testId,
|
|
33
|
+
headingLevel = 2,
|
|
33
34
|
id,
|
|
34
35
|
cssFn = noop,
|
|
35
36
|
// Although this isn't defined on props it is available because we've used
|
|
@@ -47,6 +48,8 @@ const HeadingItem = /*#__PURE__*/memo(({
|
|
|
47
48
|
css: [headingStyles,
|
|
48
49
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
49
50
|
UNSAFE_overrides],
|
|
51
|
+
role: "heading",
|
|
52
|
+
"aria-level": headingLevel,
|
|
50
53
|
"data-testid": testId,
|
|
51
54
|
"data-ds--menu--heading-item": true,
|
|
52
55
|
id: id,
|
|
@@ -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 = ["children", "testId", "id", "cssFn", "className"];
|
|
3
|
+
var _excluded = ["children", "testId", "headingLevel", "id", "cssFn", "className"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { memo } from 'react';
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
@@ -32,6 +32,8 @@ var headingStyles = css({
|
|
|
32
32
|
var HeadingItem = /*#__PURE__*/memo(function (_ref) {
|
|
33
33
|
var children = _ref.children,
|
|
34
34
|
testId = _ref.testId,
|
|
35
|
+
_ref$headingLevel = _ref.headingLevel,
|
|
36
|
+
headingLevel = _ref$headingLevel === void 0 ? 2 : _ref$headingLevel,
|
|
35
37
|
id = _ref.id,
|
|
36
38
|
_ref$cssFn = _ref.cssFn,
|
|
37
39
|
cssFn = _ref$cssFn === void 0 ? noop : _ref$cssFn,
|
|
@@ -45,6 +47,8 @@ var HeadingItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
45
47
|
css: [headingStyles,
|
|
46
48
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
47
49
|
UNSAFE_overrides],
|
|
50
|
+
role: "heading",
|
|
51
|
+
"aria-level": headingLevel,
|
|
48
52
|
"data-testid": testId,
|
|
49
53
|
"data-ds--menu--heading-item": true,
|
|
50
54
|
id: id,
|
|
@@ -9,5 +9,5 @@ import type { HeadingItemProps } from '../types';
|
|
|
9
9
|
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/heading-item)
|
|
10
10
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
11
11
|
*/
|
|
12
|
-
declare const HeadingItem: import("react").MemoExoticComponent<({ children, testId, id, cssFn, className: UNSAFE_className, ...rest }: HeadingItemProps) => jsx.JSX.Element>;
|
|
12
|
+
declare const HeadingItem: import("react").MemoExoticComponent<({ children, testId, headingLevel, id, cssFn, className: UNSAFE_className, ...rest }: HeadingItemProps) => jsx.JSX.Element>;
|
|
13
13
|
export default HeadingItem;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -349,6 +349,11 @@ export interface HeadingItemProps {
|
|
|
349
349
|
* serving as a hook for automated tests.
|
|
350
350
|
*/
|
|
351
351
|
testId?: string;
|
|
352
|
+
/**
|
|
353
|
+
* Specifies the heading level in the document structure.
|
|
354
|
+
* If not specified, level 2 will be applied by default.
|
|
355
|
+
*/
|
|
356
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
352
357
|
}
|
|
353
358
|
export interface SkeletonHeadingItemProps {
|
|
354
359
|
/**
|
|
@@ -9,5 +9,5 @@ import type { HeadingItemProps } from '../types';
|
|
|
9
9
|
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/heading-item)
|
|
10
10
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
|
|
11
11
|
*/
|
|
12
|
-
declare const HeadingItem: import("react").MemoExoticComponent<({ children, testId, id, cssFn, className: UNSAFE_className, ...rest }: HeadingItemProps) => jsx.JSX.Element>;
|
|
12
|
+
declare const HeadingItem: import("react").MemoExoticComponent<({ children, testId, headingLevel, id, cssFn, className: UNSAFE_className, ...rest }: HeadingItemProps) => jsx.JSX.Element>;
|
|
13
13
|
export default HeadingItem;
|
|
@@ -349,6 +349,11 @@ export interface HeadingItemProps {
|
|
|
349
349
|
* serving as a hook for automated tests.
|
|
350
350
|
*/
|
|
351
351
|
testId?: string;
|
|
352
|
+
/**
|
|
353
|
+
* Specifies the heading level in the document structure.
|
|
354
|
+
* If not specified, level 2 will be applied by default.
|
|
355
|
+
*/
|
|
356
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
352
357
|
}
|
|
353
358
|
export interface SkeletonHeadingItemProps {
|
|
354
359
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/menu",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "A collection of composable menu components that can be used anywhere.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
46
46
|
"@atlaskit/focus-ring": "^1.3.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
48
|
-
"@atlaskit/primitives": "^1.
|
|
48
|
+
"@atlaskit/primitives": "^1.15.0",
|
|
49
49
|
"@atlaskit/theme": "^12.6.0",
|
|
50
|
-
"@atlaskit/tokens": "^1.
|
|
50
|
+
"@atlaskit/tokens": "^1.30.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"@emotion/react": "^11.7.1"
|
|
53
53
|
},
|