@atlaskit/menu 2.1.2 → 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 CHANGED
@@ -1,5 +1,17 @@
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
+
9
+ ## 2.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#58188](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58188) [`e15a2a9480ee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e15a2a9480ee) - update deprecation guidance for PopupMenuGroup
14
+
3
15
  ## 2.1.2
4
16
 
5
17
  ### 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,
@@ -12,7 +12,7 @@ var _menuGroup = _interopRequireDefault(require("./menu-group"));
12
12
  var _excluded = ["maxWidth", "minWidth"];
13
13
  /** @jsx jsx */
14
14
  /**
15
- * @deprecated
15
+ * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
16
16
  */
17
17
  var PopupMenuGroup = function PopupMenuGroup(_ref) {
18
18
  var _ref$maxWidth = _ref.maxWidth,
@@ -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,
@@ -4,7 +4,7 @@ import { jsx } from '@emotion/react';
4
4
  import MenuGroup from './menu-group';
5
5
 
6
6
  /**
7
- * @deprecated
7
+ * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
8
8
  */
9
9
  const PopupMenuGroup = ({
10
10
  maxWidth = 800,
@@ -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,
@@ -6,7 +6,7 @@ import { jsx } from '@emotion/react';
6
6
  import MenuGroup from './menu-group';
7
7
 
8
8
  /**
9
- * @deprecated
9
+ * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
10
10
  */
11
11
  var PopupMenuGroup = function PopupMenuGroup(_ref) {
12
12
  var _ref$maxWidth = _ref.maxWidth,
@@ -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;
@@ -2,7 +2,7 @@
2
2
  import { jsx } from '@emotion/react';
3
3
  import type { MenuGroupProps } from '../types';
4
4
  /**
5
- * @deprecated
5
+ * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
6
6
  */
7
7
  declare const PopupMenuGroup: ({ maxWidth, minWidth, ...rest }: MenuGroupProps) => jsx.JSX.Element;
8
8
  export default PopupMenuGroup;
@@ -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;
@@ -2,7 +2,7 @@
2
2
  import { jsx } from '@emotion/react';
3
3
  import type { MenuGroupProps } from '../types';
4
4
  /**
5
- * @deprecated
5
+ * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
6
6
  */
7
7
  declare const PopupMenuGroup: ({ maxWidth, minWidth, ...rest }: MenuGroupProps) => jsx.JSX.Element;
8
8
  export default PopupMenuGroup;
@@ -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.2",
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/"
@@ -22,6 +22,22 @@
22
22
  "releaseModel": "continuous",
23
23
  "website": {
24
24
  "name": "Menu",
25
+ "subPages": [
26
+ {
27
+ "title": "Popup menu group",
28
+ "id": "popup-menu-group",
29
+ "status": {
30
+ "type": "deprecated",
31
+ "description": "PopupMenuGroup has been deprecated. We recommend using the MenuGroup component instead.",
32
+ "actions": [
33
+ {
34
+ "text": "View MenuGroup documentation",
35
+ "href": "https://atlassian.design/components/menu/menu-group/examples"
36
+ }
37
+ ]
38
+ }
39
+ }
40
+ ],
25
41
  "category": "Components"
26
42
  }
27
43
  },
@@ -29,9 +45,9 @@
29
45
  "@atlaskit/ds-lib": "^2.2.0",
30
46
  "@atlaskit/focus-ring": "^1.3.0",
31
47
  "@atlaskit/platform-feature-flags": "^0.2.0",
32
- "@atlaskit/primitives": "^1.9.0",
48
+ "@atlaskit/primitives": "^1.15.0",
33
49
  "@atlaskit/theme": "^12.6.0",
34
- "@atlaskit/tokens": "^1.28.0",
50
+ "@atlaskit/tokens": "^1.30.0",
35
51
  "@babel/runtime": "^7.0.0",
36
52
  "@emotion/react": "^11.7.1"
37
53
  },
@@ -114,4 +130,4 @@
114
130
  },
115
131
  "homepage": "https://atlassian.design/components/menu/",
116
132
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
117
- }
133
+ }
@@ -1,222 +0,0 @@
1
- ## API Report File for "@atlaskit/menu"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- /// <reference types="react" />
8
-
9
- import { ComponentType } from 'react';
10
- import { Context } from 'react';
11
- import { CSSObject } from '@emotion/react';
12
- import { ForwardRefExoticComponent } from 'react';
13
- import { jsx } from '@emotion/react';
14
- import { MemoExoticComponent } from 'react';
15
- import { ReactNode } from 'react';
16
- import { Ref } from 'react';
17
- import { RefAttributes } from 'react';
18
-
19
- // @public (undocumented)
20
- export interface BaseItemProps {
21
- children?: React.ReactNode;
22
- // @deprecated
23
- cssFn?: CSSFn;
24
- description?: JSX.Element | string;
25
- iconAfter?: React.ReactNode;
26
- iconBefore?: React.ReactNode;
27
- isDisabled?: boolean;
28
- isSelected?: boolean;
29
- onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void;
30
- onMouseDown?: React.MouseEventHandler;
31
- // @deprecated
32
- overrides?: Overrides;
33
- shouldDescriptionWrap?: boolean;
34
- shouldTitleWrap?: boolean;
35
- testId?: string;
36
- }
37
-
38
- // @public
39
- export const ButtonItem: MemoExoticComponent<ForwardRefExoticComponent<ButtonItemProps & RefAttributes<HTMLElement>>>;
40
-
41
- // @public (undocumented)
42
- export interface ButtonItemProps extends BaseItemProps {
43
- id?: string;
44
- role?: string;
45
- }
46
-
47
- // @public @deprecated
48
- export interface CSSFn<TState = ItemState extends void ? void : ItemState> {
49
- // (undocumented)
50
- (currentState: TState): CSSObject | CSSObject[];
51
- }
52
-
53
- // @public
54
- export const CustomItem: CustomItemTypeGenericHackProps;
55
-
56
- // @public (undocumented)
57
- export interface CustomItemComponentProps {
58
- 'data-testid'?: string;
59
- children: React.ReactNode;
60
- className: string;
61
- disabled?: boolean;
62
- draggable: boolean;
63
- onClick?: (event: React.MouseEvent<HTMLElement>) => void;
64
- onDragStart?: (event: React.DragEvent) => void;
65
- onMouseDown?: (event: React.MouseEvent<HTMLElement>) => void;
66
- ref?: Ref<any>;
67
- tabIndex?: number;
68
- }
69
-
70
- // @public (undocumented)
71
- export interface CustomItemProps<TCustomComponentProps = CustomItemComponentProps> extends BaseItemProps {
72
- component?: React.ComponentType<TCustomComponentProps>;
73
- }
74
-
75
- // @public (undocumented)
76
- interface CustomItemTypeGenericHackProps {
77
- // (undocumented)
78
- <TComponentProps>(props: CustomItemProps<TComponentProps> & {
79
- ref?: any;
80
- } & Omit<TComponentProps, keyof CustomItemComponentProps>): JSX.Element | null;
81
- }
82
-
83
- // @public (undocumented)
84
- export type Dimension = number | string;
85
-
86
- // @public
87
- export const HeadingItem: MemoExoticComponent<({ children, testId, id, cssFn, className: UNSAFE_className, ...rest }: HeadingItemProps) => jsx.JSX.Element>;
88
-
89
- // @public (undocumented)
90
- export interface HeadingItemProps {
91
- children: React.ReactNode;
92
- // @deprecated
93
- cssFn?: StatelessCSSFn;
94
- id?: string;
95
- testId?: string;
96
- }
97
-
98
- // @public (undocumented)
99
- export type ItemState = {
100
- isSelected: boolean;
101
- isDisabled: boolean;
102
- };
103
-
104
- // @public
105
- export const LinkItem: MemoExoticComponent<ForwardRefExoticComponent<LinkItemProps & RefAttributes<HTMLElement>>>;
106
-
107
- // @public (undocumented)
108
- export interface LinkItemProps extends BaseItemProps {
109
- href?: string;
110
- rel?: string;
111
- role?: string;
112
- target?: string;
113
- }
114
-
115
- // @public
116
- export const MenuGroup: ({ isLoading, maxWidth, minWidth, minHeight, maxHeight, testId, role, spacing, className: UNSAFE_className, ...rest }: MenuGroupProps) => jsx.JSX.Element;
117
-
118
- // @public (undocumented)
119
- export interface MenuGroupProps extends MenuGroupSizing {
120
- children: React.ReactNode;
121
- isLoading?: boolean;
122
- onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void;
123
- role?: string;
124
- spacing?: SpacingMode;
125
- testId?: string;
126
- }
127
-
128
- // @public (undocumented)
129
- export interface MenuGroupSizing {
130
- maxHeight?: Dimension;
131
- maxWidth?: Dimension;
132
- minHeight?: Dimension;
133
- minWidth?: Dimension;
134
- }
135
-
136
- // @public @deprecated (undocumented)
137
- export interface Overrides {
138
- // (undocumented)
139
- Title?: TitleOverrides;
140
- }
141
-
142
- // @public @deprecated (undocumented)
143
- export const PopupMenuGroup: ({ maxWidth, minWidth, ...rest }: MenuGroupProps) => jsx.JSX.Element;
144
-
145
- // @public (undocumented)
146
- export interface RenderFunction<TProps = {}> {
147
- // (undocumented)
148
- (Component: ComponentType | string, props: TProps): React.ReactNode;
149
- }
150
-
151
- // @public
152
- export const Section: ForwardRefExoticComponent<SectionProps & RefAttributes<HTMLElement>>;
153
-
154
- // @public (undocumented)
155
- interface SectionProps {
156
- children: React.ReactNode;
157
- hasSeparator?: boolean;
158
- id?: string;
159
- isList?: boolean;
160
- isScrollable?: boolean;
161
- // @deprecated (undocumented)
162
- overrides?: {
163
- HeadingItem?: {
164
- cssFn?: StatelessCSSFn;
165
- };
166
- };
167
- testId?: string;
168
- title?: string;
169
- }
170
- export { SectionProps as SectionBaseProps }
171
- export { SectionProps }
172
-
173
- // @internal
174
- export const SELECTION_STYLE_CONTEXT_DO_NOT_USE: Context<"border" | "none" | "notch">;
175
-
176
- // @public
177
- export const SkeletonHeadingItem: ({ isShimmering, testId, width, cssFn, }: SkeletonHeadingItemProps) => jsx.JSX.Element;
178
-
179
- // @public (undocumented)
180
- export interface SkeletonHeadingItemProps {
181
- // @deprecated
182
- cssFn?: StatelessCSSFn;
183
- isShimmering?: boolean;
184
- testId?: string;
185
- width?: Dimension;
186
- }
187
-
188
- // @public
189
- export const SkeletonItem: ({ hasAvatar, hasIcon, isShimmering, testId, width, cssFn, }: SkeletonItemProps) => jsx.JSX.Element;
190
-
191
- // @public (undocumented)
192
- export interface SkeletonItemProps {
193
- cssFn?: StatelessCSSFn;
194
- hasAvatar?: boolean;
195
- hasIcon?: boolean;
196
- isShimmering?: boolean;
197
- testId?: string;
198
- width?: Dimension;
199
- }
200
-
201
- // @internal
202
- export const SpacingContext: Context<SpacingMode>;
203
-
204
- // @public (undocumented)
205
- type SpacingMode = 'compact' | 'cozy';
206
-
207
- // @public @deprecated (undocumented)
208
- export type StatelessCSSFn = CSSFn<void>;
209
-
210
- // @public @deprecated (undocumented)
211
- export interface TitleOverrides {
212
- // (undocumented)
213
- render?: RenderFunction<{
214
- className?: string;
215
- children: ReactNode;
216
- 'data-item-title': boolean;
217
- }>;
218
- }
219
-
220
- // (No @packageDocumentation comment for this package)
221
-
222
- ```