@atlaskit/dropdown-menu 12.1.10 → 12.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/dropdown-menu
2
2
 
3
+ ## 12.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#70040](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70040) [`d18ec4d7ce20`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d18ec4d7ce20) - [ux] Tidy up of the `platform.design-system-team.icon-button-spacing-fix_o1zc5` Platform Feature Flag which applies a small adjustment to icon spacing for buttons using `iconBefore` and `iconAfter` props. Small visual adjustment is to be expected — keep this in mind when reviewing any VR tests breaking. The spacing around the icons will be reduced.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 12.2.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#69888](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69888) [`e710d215f768`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e710d215f768) - Add label prop to render aria-label on dropdown menu trigger.
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 12.1.10
4
24
 
5
25
  ### Patch Changes
@@ -64,13 +64,11 @@ var getFallbackPlacements = function getFallbackPlacements(placement) {
64
64
  };
65
65
 
66
66
  /**
67
- * __Dropdown menu__
68
- *
69
67
  * A dropdown menu displays a list of actions or options to a user.
70
68
  *
71
69
  * - [Examples](https://atlassian.design/components/dropdown-menu/examples)
72
70
  * - [Code](https://atlassian.design/components/dropdown-menu/code)
73
- * - [Usage](https://atlassian.design/components/dropdown-menu/usage)
71
+ * - [Usage](https://atlassian.design/components/dropdown-menu/usage).
74
72
  */
75
73
  var DropdownMenu = function DropdownMenu(_ref) {
76
74
  var _ref$autoFocus = _ref.autoFocus,
@@ -94,7 +92,8 @@ var DropdownMenu = function DropdownMenu(_ref) {
94
92
  testId = _ref.testId,
95
93
  _trigger = _ref.trigger,
96
94
  _ref$zIndex = _ref.zIndex,
97
- zIndex = _ref$zIndex === void 0 ? _constants.layers.modal() : _ref$zIndex;
95
+ zIndex = _ref$zIndex === void 0 ? _constants.layers.modal() : _ref$zIndex,
96
+ label = _ref.label;
98
97
  var _useControlledState = (0, _useControlled.default)(isOpen, function () {
99
98
  return defaultOpen;
100
99
  }),
@@ -226,7 +225,8 @@ var DropdownMenu = function DropdownMenu(_ref) {
226
225
  label: ""
227
226
  }),
228
227
  onClick: handleTriggerClicked,
229
- testId: testId && "".concat(testId, "--trigger")
228
+ testId: testId && "".concat(testId, "--trigger"),
229
+ "aria-label": label
230
230
  }), _trigger);
231
231
  },
232
232
  content: function content(_ref3) {
@@ -49,13 +49,11 @@ const getFallbackPlacements = placement => {
49
49
  };
50
50
 
51
51
  /**
52
- * __Dropdown menu__
53
- *
54
52
  * A dropdown menu displays a list of actions or options to a user.
55
53
  *
56
54
  * - [Examples](https://atlassian.design/components/dropdown-menu/examples)
57
55
  * - [Code](https://atlassian.design/components/dropdown-menu/code)
58
- * - [Usage](https://atlassian.design/components/dropdown-menu/usage)
56
+ * - [Usage](https://atlassian.design/components/dropdown-menu/usage).
59
57
  */
60
58
  const DropdownMenu = ({
61
59
  autoFocus = false,
@@ -71,7 +69,8 @@ const DropdownMenu = ({
71
69
  statusLabel,
72
70
  testId,
73
71
  trigger,
74
- zIndex = layers.modal()
72
+ zIndex = layers.modal(),
73
+ label
75
74
  }) => {
76
75
  const [isLocalOpen, setLocalIsOpen] = useControlledState(isOpen, () => defaultOpen);
77
76
  const [isTriggeredUsingKeyboard, setTriggeredUsingKeyboard] = useState(false);
@@ -200,7 +199,8 @@ const DropdownMenu = ({
200
199
  label: ""
201
200
  }),
202
201
  onClick: handleTriggerClicked,
203
- testId: testId && `${testId}--trigger`
202
+ testId: testId && `${testId}--trigger`,
203
+ "aria-label": label
204
204
  }), trigger);
205
205
  },
206
206
  content: ({
@@ -55,13 +55,11 @@ var getFallbackPlacements = function getFallbackPlacements(placement) {
55
55
  };
56
56
 
57
57
  /**
58
- * __Dropdown menu__
59
- *
60
58
  * A dropdown menu displays a list of actions or options to a user.
61
59
  *
62
60
  * - [Examples](https://atlassian.design/components/dropdown-menu/examples)
63
61
  * - [Code](https://atlassian.design/components/dropdown-menu/code)
64
- * - [Usage](https://atlassian.design/components/dropdown-menu/usage)
62
+ * - [Usage](https://atlassian.design/components/dropdown-menu/usage).
65
63
  */
66
64
  var DropdownMenu = function DropdownMenu(_ref) {
67
65
  var _ref$autoFocus = _ref.autoFocus,
@@ -85,7 +83,8 @@ var DropdownMenu = function DropdownMenu(_ref) {
85
83
  testId = _ref.testId,
86
84
  _trigger = _ref.trigger,
87
85
  _ref$zIndex = _ref.zIndex,
88
- zIndex = _ref$zIndex === void 0 ? layers.modal() : _ref$zIndex;
86
+ zIndex = _ref$zIndex === void 0 ? layers.modal() : _ref$zIndex,
87
+ label = _ref.label;
89
88
  var _useControlledState = useControlledState(isOpen, function () {
90
89
  return defaultOpen;
91
90
  }),
@@ -217,7 +216,8 @@ var DropdownMenu = function DropdownMenu(_ref) {
217
216
  label: ""
218
217
  }),
219
218
  onClick: handleTriggerClicked,
220
- testId: testId && "".concat(testId, "--trigger")
219
+ testId: testId && "".concat(testId, "--trigger"),
220
+ "aria-label": label
221
221
  }), _trigger);
222
222
  },
223
223
  content: function content(_ref3) {
@@ -3,13 +3,11 @@ import type { DropdownMenuProps } from './types';
3
3
  export declare const KEY_SPACE = " ";
4
4
  export declare const KEY_ENTER = "Enter";
5
5
  /**
6
- * __Dropdown menu__
7
- *
8
6
  * A dropdown menu displays a list of actions or options to a user.
9
7
  *
10
8
  * - [Examples](https://atlassian.design/components/dropdown-menu/examples)
11
9
  * - [Code](https://atlassian.design/components/dropdown-menu/code)
12
- * - [Usage](https://atlassian.design/components/dropdown-menu/usage)
10
+ * - [Usage](https://atlassian.design/components/dropdown-menu/usage).
13
11
  */
14
- declare const DropdownMenu: <T extends HTMLElement = HTMLElement>({ autoFocus, children, defaultOpen, isLoading, isOpen, onOpenChange, placement, shouldFlip, shouldRenderToParent, spacing, statusLabel, testId, trigger, zIndex, }: DropdownMenuProps<T>) => JSX.Element;
12
+ declare const DropdownMenu: <T extends HTMLElement = HTMLElement>({ autoFocus, children, defaultOpen, isLoading, isOpen, onOpenChange, placement, shouldFlip, shouldRenderToParent, spacing, statusLabel, testId, trigger, zIndex, label, }: DropdownMenuProps<T>) => JSX.Element;
15
13
  export default DropdownMenu;
@@ -72,7 +72,7 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
72
72
  */
73
73
  children?: ReactNode;
74
74
  /**
75
- * If true, a Spinner is rendered instead of the items
75
+ * If true, a Spinner is rendered instead of the items.
76
76
  */
77
77
  isLoading?: boolean;
78
78
  /**
@@ -135,6 +135,10 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
135
135
  * Defaults to `layers.modal()` from `@atlaskit/theme` which is 510.
136
136
  */
137
137
  zIndex?: number;
138
+ /**
139
+ * Provide an accessible label via aria-label, used by assistive technologies.
140
+ */
141
+ label?: string;
138
142
  }
139
143
  export interface DropdownItemProps {
140
144
  /**
@@ -241,7 +245,7 @@ export interface DropdownItemCheckboxProps {
241
245
  */
242
246
  defaultSelected?: boolean;
243
247
  /**
244
- * Unique id of a checkbox
248
+ * Unique id of a checkbox.
245
249
  */
246
250
  id: string;
247
251
  /**
@@ -290,7 +294,7 @@ export interface DropdownItemRadioProps {
290
294
  */
291
295
  defaultSelected?: boolean;
292
296
  /**
293
- * Unique id of a checkbox
297
+ * Unique id of a checkbox.
294
298
  */
295
299
  id: string;
296
300
  /**
@@ -3,13 +3,11 @@ import type { DropdownMenuProps } from './types';
3
3
  export declare const KEY_SPACE = " ";
4
4
  export declare const KEY_ENTER = "Enter";
5
5
  /**
6
- * __Dropdown menu__
7
- *
8
6
  * A dropdown menu displays a list of actions or options to a user.
9
7
  *
10
8
  * - [Examples](https://atlassian.design/components/dropdown-menu/examples)
11
9
  * - [Code](https://atlassian.design/components/dropdown-menu/code)
12
- * - [Usage](https://atlassian.design/components/dropdown-menu/usage)
10
+ * - [Usage](https://atlassian.design/components/dropdown-menu/usage).
13
11
  */
14
- declare const DropdownMenu: <T extends HTMLElement = HTMLElement>({ autoFocus, children, defaultOpen, isLoading, isOpen, onOpenChange, placement, shouldFlip, shouldRenderToParent, spacing, statusLabel, testId, trigger, zIndex, }: DropdownMenuProps<T>) => JSX.Element;
12
+ declare const DropdownMenu: <T extends HTMLElement = HTMLElement>({ autoFocus, children, defaultOpen, isLoading, isOpen, onOpenChange, placement, shouldFlip, shouldRenderToParent, spacing, statusLabel, testId, trigger, zIndex, label, }: DropdownMenuProps<T>) => JSX.Element;
15
13
  export default DropdownMenu;
@@ -72,7 +72,7 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
72
72
  */
73
73
  children?: ReactNode;
74
74
  /**
75
- * If true, a Spinner is rendered instead of the items
75
+ * If true, a Spinner is rendered instead of the items.
76
76
  */
77
77
  isLoading?: boolean;
78
78
  /**
@@ -135,6 +135,10 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
135
135
  * Defaults to `layers.modal()` from `@atlaskit/theme` which is 510.
136
136
  */
137
137
  zIndex?: number;
138
+ /**
139
+ * Provide an accessible label via aria-label, used by assistive technologies.
140
+ */
141
+ label?: string;
138
142
  }
139
143
  export interface DropdownItemProps {
140
144
  /**
@@ -241,7 +245,7 @@ export interface DropdownItemCheckboxProps {
241
245
  */
242
246
  defaultSelected?: boolean;
243
247
  /**
244
- * Unique id of a checkbox
248
+ * Unique id of a checkbox.
245
249
  */
246
250
  id: string;
247
251
  /**
@@ -290,7 +294,7 @@ export interface DropdownItemRadioProps {
290
294
  */
291
295
  defaultSelected?: boolean;
292
296
  /**
293
- * Unique id of a checkbox
297
+ * Unique id of a checkbox.
294
298
  */
295
299
  id: string;
296
300
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dropdown-menu",
3
- "version": "12.1.10",
3
+ "version": "12.3.0",
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/"
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "@atlaskit/button": "^17.0.0",
29
+ "@atlaskit/button": "^17.3.0",
30
30
  "@atlaskit/codemod-utils": "^4.2.0",
31
31
  "@atlaskit/ds-lib": "^2.2.0",
32
32
  "@atlaskit/icon": "^22.0.0",
@@ -34,10 +34,10 @@
34
34
  "@atlaskit/menu": "^2.1.0",
35
35
  "@atlaskit/platform-feature-flags": "^0.2.2",
36
36
  "@atlaskit/popup": "^1.11.0",
37
- "@atlaskit/primitives": "^1.15.0",
37
+ "@atlaskit/primitives": "^2.0.0",
38
38
  "@atlaskit/spinner": "^16.0.0",
39
39
  "@atlaskit/theme": "^12.6.0",
40
- "@atlaskit/tokens": "^1.30.0",
40
+ "@atlaskit/tokens": "^1.35.0",
41
41
  "@babel/runtime": "^7.0.0",
42
42
  "@emotion/react": "^11.7.1",
43
43
  "bind-event-listener": "^2.1.1"
@@ -51,7 +51,6 @@
51
51
  "@af/integration-testing": "*",
52
52
  "@af/visual-regression": "*",
53
53
  "@atlaskit/visual-regression": "*",
54
- "@atlaskit/webdriver-runner": "*",
55
54
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
56
55
  "@atlassian/feature-flags-test-utils": "*",
57
56
  "@testing-library/dom": "^8.17.1",
@@ -109,10 +108,6 @@
109
108
  "platform.design-system-team.border-checkbox_nyoiu": {
110
109
  "type": "boolean"
111
110
  },
112
- "platform.design-system-team.icon-button-spacing-fix_o1zc5": {
113
- "type": "boolean",
114
- "referenceOnly": "true"
115
- },
116
111
  "platform.design-system-team.layering_popup_1cnzt": {
117
112
  "type": "boolean"
118
113
  }