@atlaskit/dropdown-menu 11.10.4 → 11.10.6

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/dropdown-menu
2
2
 
3
+ ## 11.10.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2e2ebbe71fc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e2ebbe71fc) - Fix keyboard arrow controls for dropdown item custom component.
8
+
9
+ ## 11.10.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`4ae083a7e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ae083a7e66) - Use `@af/accessibility-testing` for default jest-axe config and jest-axe import in accessibility testing.
14
+
3
15
  ## 11.10.4
4
16
 
5
17
  ### Patch Changes
@@ -42,6 +42,7 @@ var DropdownMenuItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
42
42
  component: component,
43
43
  iconBefore: elemBefore,
44
44
  iconAfter: elemAfter,
45
+ ref: (0, _mergeRefs.default)([ref, itemRef]),
45
46
  shouldTitleWrap: shouldTitleWrap,
46
47
  shouldDescriptionWrap: shouldDescriptionWrap
47
48
  }, rest), children);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dropdown-menu",
3
- "version": "11.10.4",
3
+ "version": "11.10.6",
4
4
  "sideEffects": false
5
5
  }
@@ -30,6 +30,7 @@ const DropdownMenuItem = /*#__PURE__*/forwardRef((props, ref) => {
30
30
  component: component,
31
31
  iconBefore: elemBefore,
32
32
  iconAfter: elemAfter,
33
+ ref: mergeRefs([ref, itemRef]),
33
34
  shouldTitleWrap: shouldTitleWrap,
34
35
  shouldDescriptionWrap: shouldDescriptionWrap
35
36
  }, rest), children);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dropdown-menu",
3
- "version": "11.10.4",
3
+ "version": "11.10.6",
4
4
  "sideEffects": false
5
5
  }
@@ -32,6 +32,7 @@ var DropdownMenuItem = /*#__PURE__*/forwardRef(function (props, ref) {
32
32
  component: component,
33
33
  iconBefore: elemBefore,
34
34
  iconAfter: elemAfter,
35
+ ref: mergeRefs([ref, itemRef]),
35
36
  shouldTitleWrap: shouldTitleWrap,
36
37
  shouldDescriptionWrap: shouldDescriptionWrap
37
38
  }, rest), children);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dropdown-menu",
3
- "version": "11.10.4",
3
+ "version": "11.10.6",
4
4
  "sideEffects": false
5
5
  }
@@ -134,6 +134,7 @@ export interface DropdownItemProps {
134
134
  children: React.ReactNode;
135
135
  /**
136
136
  * Custom component to render as an item.
137
+ * Should be wrapped in `forwardRef` to avoid accessibility issues when controlling keyboard focus.
137
138
  */
138
139
  component?: CustomItemProps['component'];
139
140
  /**
@@ -134,6 +134,7 @@ export interface DropdownItemProps {
134
134
  children: React.ReactNode;
135
135
  /**
136
136
  * Custom component to render as an item.
137
+ * Should be wrapped in `forwardRef` to avoid accessibility issues when controlling keyboard focus.
137
138
  */
138
139
  component?: CustomItemProps['component'];
139
140
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dropdown-menu",
3
- "version": "11.10.4",
3
+ "version": "11.10.6",
4
4
  "description": "A dropdown menu displays a list of actions or options to a user.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/primitives": "^1.0.0",
42
42
  "@atlaskit/spinner": "^15.5.0",
43
43
  "@atlaskit/theme": "^12.5.0",
44
- "@atlaskit/tokens": "^1.11.0",
44
+ "@atlaskit/tokens": "^1.12.0",
45
45
  "@atlaskit/visually-hidden": "^1.2.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "@emotion/react": "^11.7.1",
@@ -52,6 +52,7 @@
52
52
  "react-dom": "^16.8.0"
53
53
  },
54
54
  "devDependencies": {
55
+ "@af/accessibility-testing": "*",
55
56
  "@atlaskit/visual-regression": "*",
56
57
  "@atlaskit/webdriver-runner": "*",
57
58
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -59,7 +60,6 @@
59
60
  "@testing-library/dom": "^8.17.1",
60
61
  "@testing-library/react": "^12.1.5",
61
62
  "@testing-library/react-hooks": "^8.0.1",
62
- "jest-axe": "^4.0.0",
63
63
  "jscodeshift": "^0.13.0",
64
64
  "raf-stub": "^2.0.1",
65
65
  "react-dom": "^16.8.0",
@@ -109,4 +109,4 @@
109
109
  },
110
110
  "homepage": "https://atlassian.design/components/dropdown-menu/",
111
111
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
112
- }
112
+ }
@@ -1,146 +0,0 @@
1
- ## API Report File for "@atlaskit/dropdown-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 type { CustomItemProps } from '@atlaskit/menu/types';
10
- import { default as DropdownItemGroup } from '@atlaskit/menu/section';
11
- import { KeyboardEvent as KeyboardEvent_2 } from 'react';
12
- import type { MenuGroupProps } from '@atlaskit/menu/types';
13
- import { MouseEvent as MouseEvent_2 } from 'react';
14
- import { default as React_2 } from 'react';
15
- import { ReactElement } from 'react';
16
- import { ReactNode } from 'react';
17
- import { Ref } from 'react';
18
- import type { SectionProps } from '@atlaskit/menu';
19
- import type { SectionProps as SectionProps_2 } from '@atlaskit/menu/types';
20
- import type { TriggerProps } from '@atlaskit/popup/types';
21
-
22
- // @public (undocumented)
23
- export interface CustomTriggerProps<TriggerElement extends HTMLElement = HTMLElement> extends Omit<TriggerProps, 'ref'> {
24
- isSelected?: boolean;
25
- onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void;
26
- testId?: string;
27
- triggerRef: Ref<TriggerElement>;
28
- }
29
-
30
- // @public
31
- export const DropdownItem: React_2.ForwardRefExoticComponent<DropdownItemProps & React_2.RefAttributes<HTMLElement>>;
32
-
33
- // @public
34
- export const DropdownItemCheckbox: (props: DropdownItemCheckboxProps) => JSX.Element;
35
-
36
- // @public
37
- export const DropdownItemCheckboxGroup: (props: DropdownItemCheckboxGroupProps) => JSX.Element;
38
-
39
- // @public (undocumented)
40
- interface DropdownItemCheckboxGroupProps extends SectionProps {
41
- id: string;
42
- }
43
-
44
- // @public (undocumented)
45
- interface DropdownItemCheckboxProps {
46
- children: React.ReactNode;
47
- defaultSelected?: boolean;
48
- description?: JSX.Element | string;
49
- id: string;
50
- isDisabled?: boolean;
51
- isSelected?: boolean;
52
- onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void;
53
- shouldDescriptionWrap?: boolean;
54
- shouldTitleWrap?: boolean;
55
- testId?: string;
56
- title?: string;
57
- }
58
-
59
- export { DropdownItemGroup }
60
-
61
- // @public (undocumented)
62
- export interface DropdownItemProps {
63
- children: React.ReactNode;
64
- component?: CustomItemProps['component'];
65
- description?: JSX.Element | string;
66
- elemAfter?: React.ReactNode;
67
- elemBefore?: React.ReactNode;
68
- href?: string;
69
- isDisabled?: boolean;
70
- isSelected?: boolean;
71
- onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void;
72
- rel?: string;
73
- shouldDescriptionWrap?: boolean;
74
- shouldTitleWrap?: boolean;
75
- target?: string;
76
- testId?: string;
77
- title?: string;
78
- }
79
-
80
- // @public
81
- export const DropdownItemRadio: (props: DropdownItemRadioProps) => JSX.Element;
82
-
83
- // @public
84
- export const DropdownItemRadioGroup: (props: DropdownItemRadioGroupProps) => JSX.Element;
85
-
86
- // @public (undocumented)
87
- interface DropdownItemRadioGroupProps extends SectionProps {
88
- // (undocumented)
89
- id: string;
90
- }
91
-
92
- // @public (undocumented)
93
- interface DropdownItemRadioProps {
94
- children: React.ReactNode;
95
- defaultSelected?: boolean;
96
- description?: JSX.Element | string;
97
- id: string;
98
- isDisabled?: boolean;
99
- isSelected?: boolean;
100
- onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void;
101
- shouldDescriptionWrap?: boolean;
102
- shouldTitleWrap?: boolean;
103
- testId?: string;
104
- title?: string;
105
- }
106
-
107
- // @public
108
- const DropdownMenu: <T extends HTMLElement = HTMLElement>(props: DropdownMenuProps<T>) => JSX.Element;
109
- export default DropdownMenu;
110
-
111
- // @public (undocumented)
112
- export interface DropdownMenuGroupProps extends SectionProps_2 {
113
- }
114
-
115
- // @public (undocumented)
116
- export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElement> {
117
- appearance?: 'default' | 'tall';
118
- autoFocus?: boolean;
119
- children?: ReactNode;
120
- defaultOpen?: boolean;
121
- isLoading?: boolean;
122
- isOpen?: boolean;
123
- onOpenChange?: (args: OnOpenChangeArgs) => void;
124
- placement?: Placement;
125
- shouldFlip?: boolean;
126
- spacing?: Extract<MenuGroupProps['spacing'], 'compact' | 'cozy'>;
127
- statusLabel?: string;
128
- testId?: string;
129
- trigger?: ((triggerButtonProps: CustomTriggerProps<TriggerElement>) => ReactElement) | string;
130
- zIndex?: number;
131
- }
132
-
133
- // @public (undocumented)
134
- export interface OnOpenChangeArgs {
135
- // (undocumented)
136
- event: KeyboardEvent_2 | MouseEvent_2;
137
- // (undocumented)
138
- isOpen: boolean;
139
- }
140
-
141
- // @public (undocumented)
142
- type Placement = 'auto' | 'auto-end' | 'auto-start' | 'bottom' | 'bottom-end' | 'bottom-start' | 'left' | 'left-end' | 'left-start' | 'right' | 'right-end' | 'right-start' | 'top' | 'top-end' | 'top-start';
143
-
144
- // (No @packageDocumentation comment for this package)
145
-
146
- ```