@atlaskit/menu 2.1.12 → 2.1.13

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,11 @@
1
1
  # @atlaskit/menu
2
2
 
3
+ ## 2.1.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [#94316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94316) [`35fd5ed8e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35fd5ed8e1d7) - Upgrading internal dependency `bind-event-listener` to `@^3.0.0`
8
+
3
9
  ## 2.1.12
4
10
 
5
11
  ### Patch Changes
@@ -23,39 +23,39 @@ export interface Overrides {
23
23
  export type Dimension = string | number;
24
24
  export interface MenuGroupSizing {
25
25
  /**
26
- * Useful to constrain the menu group minimum height to a specific value.
26
+ * Use this to constrain the menu group's minimum height to a specific value.
27
27
  */
28
28
  minHeight?: Dimension;
29
29
  /**
30
- * Useful to constrain the menu groups height to a specific value.
31
- * Needs to be set when wanting to have scrollable sections.
30
+ * Use this to constrain the menu group's height to a specific value.
31
+ * This must be set if you want to have scrollable sections.
32
32
  */
33
33
  maxHeight?: Dimension;
34
34
  /**
35
- * Useful to constrain the menu group minimum width to a specific value.
35
+ * Use this to constrain the menu group's minimum width to a specific value.
36
36
  */
37
37
  minWidth?: Dimension;
38
38
  /**
39
- * Useful to constrain the menu group width to a specific value.
39
+ * Use this to constrain the menu group's maximum width to a specific value.
40
40
  */
41
41
  maxWidth?: Dimension;
42
42
  }
43
43
  export interface MenuGroupProps extends MenuGroupSizing {
44
44
  /**
45
- * Children of the menu group,
46
- * should generally be `Section` components.
45
+ * Children of the menu group.
46
+ * This should generally be `Section` components.
47
47
  */
48
48
  children: React.ReactNode;
49
49
  /**
50
- * Used for telling assistive technologies that the menu group is loading.
50
+ * Used this to tell assistive technologies that the menu group is loading.
51
51
  */
52
52
  isLoading?: boolean;
53
53
  /**
54
- * Configure the density of the MenuGroup content.
54
+ * Configure the density of the menu group content.
55
55
  */
56
56
  spacing?: SpacingMode;
57
57
  /**
58
- * Used to override the accessibility role for the element.
58
+ * Use this to override the accessibility role for the element.
59
59
  */
60
60
  role?: string;
61
61
  /**
@@ -78,17 +78,17 @@ export interface SectionProps {
78
78
  id?: string;
79
79
  /**
80
80
  * Enables scrolling within the section.
81
- * Make sure to set `maxHeight` on the parent `MenuGroup` component else it will not work.
81
+ * This won't work unless `maxHeight` is set on the parent `MenuGroup` component.
82
82
  */
83
83
  isScrollable?: boolean;
84
84
  /**
85
- * Will render a border at the top of the section.
85
+ * Use this to render a border at the top of the section.
86
86
  */
87
87
  hasSeparator?: boolean;
88
88
  /**
89
- * Children of the section,
90
- * should generally be `Item` or `Heading` components,
91
- * but can also be [`EmptyState`](https://atlaskit.atlassian.com/packages/design-system/empty-state)s when wanting to render errors.
89
+ * Children of the section.
90
+ * This should generally be `Item` or `Heading` components,
91
+ * but can also be [`EmptyState`](https://atlaskit.atlassian.com/packages/design-system/empty-state)s if you want to render errors.
92
92
  */
93
93
  children: React.ReactNode;
94
94
  /**
@@ -110,12 +110,12 @@ export interface SectionProps {
110
110
  };
111
111
  };
112
112
  /**
113
- * The text passed into the internal HeadingItem. If a title is not provided,
114
- * the HeadingItem will not be rendered, and this component acts as a regular Section.
113
+ * The text passed into the internal `HeadingItem`. If a title isn't provided,
114
+ * the `HeadingItem` won't be rendered, and this component will act as a regular `Section`.
115
115
  */
116
116
  title?: string;
117
117
  /**
118
- * Adds `<ul>` and `<li>` tags around the items for better semantic markup in a list of items.
118
+ * If your menu contains a list, use this to add `<ul>` and `<li>` tags around the items. This is essential for offering better, accessible semantic markup in a list of items.
119
119
  */
120
120
  isList?: boolean;
121
121
  }
@@ -149,29 +149,29 @@ export interface MenuItemProps {
149
149
  cssFn?: CSSFn;
150
150
  /**
151
151
  * Element to render before the item text.
152
- * Generally should be an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
152
+ * Usually this is an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
153
153
  */
154
154
  iconBefore?: React.ReactNode;
155
155
  /**
156
156
  * Element to render after the item text.
157
- * Generally should be an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
157
+ * Usually this is an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
158
158
  */
159
159
  iconAfter?: React.ReactNode;
160
160
  /**
161
- * Event that is triggered when the element is clicked.
161
+ * Event that's triggered when the element is clicked.
162
162
  */
163
163
  onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
164
164
  /**
165
- * Event that is triggered when the element has been pressed.
165
+ * Event that's triggered when the element has been pressed.
166
166
  */
167
167
  onMouseDown?: React.MouseEventHandler;
168
168
  /**
169
169
  * Description of the item.
170
- * This will render smaller text below the primary text of the item as well as slightly increasing the height of the item.
170
+ * This will render smaller text below the primary text of the item, and slightly increase the height of the item.
171
171
  */
172
172
  description?: string | JSX.Element;
173
173
  /**
174
- * Makes the element appear disabled as well as removing interactivity.
174
+ * Makes the element appear disabled as well as removing interactivity. Avoid disabling menu items wherever possible as this isn’t accessible or usable.
175
175
  */
176
176
  isDisabled?: boolean;
177
177
  /**
@@ -195,11 +195,11 @@ export interface MenuItemProps {
195
195
  */
196
196
  overrides?: Overrides;
197
197
  /**
198
- * When `true` the title of the item will wrap multiple lines if it's long enough.
198
+ * When `true`, the title of the item will wrap multiple lines if it's long enough.
199
199
  */
200
200
  shouldTitleWrap?: boolean;
201
201
  /**
202
- * When `true` the description of the item will wrap multiple lines if it's long enough.
202
+ * When `true`, the description of the item will wrap multiple lines if it's long enough.
203
203
  */
204
204
  shouldDescriptionWrap?: boolean;
205
205
  }
@@ -209,7 +209,7 @@ export interface ButtonItemProps extends MenuItemProps {
209
209
  */
210
210
  id?: string;
211
211
  /**
212
- * Used to override the accessibility role for the element.
212
+ * Use this to override the accessibility role for the element.
213
213
  */
214
214
  role?: string;
215
215
  }
@@ -229,7 +229,7 @@ export interface LinkItemProps extends MenuItemProps {
229
229
  */
230
230
  rel?: string;
231
231
  /**
232
- * Used to override the accessibility role for the element.
232
+ * Use this to override the accessibility role for the element.
233
233
  */
234
234
  role?: string;
235
235
  }
@@ -239,25 +239,25 @@ export interface CustomItemComponentProps {
239
239
  */
240
240
  children: React.ReactNode;
241
241
  /**
242
- * Class to apply to the root container of the custom component,
243
- * ensure this has been applied so the consistent item styling is applied.
242
+ * Class to apply to the root container of the custom component.
243
+ * Ensure this has been applied so the item styling is consistent.
244
244
  */
245
245
  className: string;
246
246
  /**
247
- * Test id that is passed through to the custom component.
247
+ * Test ID that's passed through to the custom component.
248
248
  */
249
249
  'data-testid'?: string;
250
250
  /**
251
- * Event handler that is passed through to the custom component.
251
+ * Event handler that's passed through to the custom component.
252
252
  */
253
253
  onClick?: (event: React.MouseEvent<HTMLElement>) => void;
254
254
  /**
255
- * Event handler that is passed through to the custom component.
255
+ * Event handler that's passed through to the custom component.
256
256
  */
257
257
  onMouseDown?: (event: React.MouseEvent<HTMLElement>) => void;
258
258
  /**
259
- * Event handler that is passed through to the custom component.
260
- * Used to disable the element from being draggable.
259
+ * Event handler that's passed through to the custom component.
260
+ * Use this to disable the element from being draggable.
261
261
  */
262
262
  onDragStart?: (event: React.DragEvent) => void;
263
263
  /**
@@ -266,15 +266,15 @@ export interface CustomItemComponentProps {
266
266
  draggable: boolean;
267
267
  /**
268
268
  * React ref for the raw DOM element,
269
- * make sure to place this on the outer most DOM element.
269
+ * make sure to place this on the outermost DOM element.
270
270
  */
271
271
  ref?: Ref<any>;
272
272
  /**
273
- * Makes the element appear disabled as well as removing interactivity.
273
+ * If the tab is selected, the tab index is `0` and is focusable. Otherwise it is `-1` and is not focusable.
274
274
  */
275
275
  tabIndex?: number;
276
276
  /**
277
- * Disabled attribute.
277
+ * Makes the element appear disabled as well as removing interactivity. Avoid disabling menu items wherever possible as this isn’t accessible or usable.
278
278
  */
279
279
  disabled?: boolean;
280
280
  }
@@ -296,7 +296,7 @@ export interface CustomItemProps<TCustomComponentProps = CustomItemComponentProp
296
296
  export interface SkeletonItemProps {
297
297
  /**
298
298
  * Renders a skeleton circle in the `iconBefore` location.
299
- * Takes priority over `hasIcon.
299
+ * Takes priority over `hasIcon`.
300
300
  */
301
301
  hasAvatar?: boolean;
302
302
  /**
@@ -306,7 +306,7 @@ export interface SkeletonItemProps {
306
306
  /**
307
307
  *
308
308
  * Width of the skeleton item.
309
- * Generally you don't need to specify this as it has a staggered width based on `:nth-child` by default.
309
+ * You usually don't need to specify this, as it has a staggered width based on `:nth-child` by default.
310
310
  */
311
311
  width?: Dimension;
312
312
  /**
@@ -340,7 +340,7 @@ export interface HeadingItemProps {
340
340
  children: React.ReactNode;
341
341
  /**
342
342
  * A unique identifier that can be referenced in the `labelledby` prop of a
343
- * section to allow screen readers to announce the name of groups.
343
+ * section to allow assistive technology to announce the name of groups.
344
344
  */
345
345
  id?: string;
346
346
  /**
@@ -351,7 +351,7 @@ export interface HeadingItemProps {
351
351
  testId?: string;
352
352
  /**
353
353
  * Specifies the heading level in the document structure.
354
- * If not specified, level 2 will be applied by default.
354
+ * If not specified, the default is `h2`.
355
355
  */
356
356
  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
357
357
  }
@@ -359,7 +359,7 @@ export interface SkeletonHeadingItemProps {
359
359
  /**
360
360
  *
361
361
  * Width of the skeleton heading item.
362
- * Generally you don't need to specify this as it has a staggered width based on `:nth-child` by default.
362
+ * You usually don't need to specify this, as it has a staggered width based on `:nth-child` by default.
363
363
  */
364
364
  width?: Dimension;
365
365
  /**
@@ -23,39 +23,39 @@ export interface Overrides {
23
23
  export type Dimension = string | number;
24
24
  export interface MenuGroupSizing {
25
25
  /**
26
- * Useful to constrain the menu group minimum height to a specific value.
26
+ * Use this to constrain the menu group's minimum height to a specific value.
27
27
  */
28
28
  minHeight?: Dimension;
29
29
  /**
30
- * Useful to constrain the menu groups height to a specific value.
31
- * Needs to be set when wanting to have scrollable sections.
30
+ * Use this to constrain the menu group's height to a specific value.
31
+ * This must be set if you want to have scrollable sections.
32
32
  */
33
33
  maxHeight?: Dimension;
34
34
  /**
35
- * Useful to constrain the menu group minimum width to a specific value.
35
+ * Use this to constrain the menu group's minimum width to a specific value.
36
36
  */
37
37
  minWidth?: Dimension;
38
38
  /**
39
- * Useful to constrain the menu group width to a specific value.
39
+ * Use this to constrain the menu group's maximum width to a specific value.
40
40
  */
41
41
  maxWidth?: Dimension;
42
42
  }
43
43
  export interface MenuGroupProps extends MenuGroupSizing {
44
44
  /**
45
- * Children of the menu group,
46
- * should generally be `Section` components.
45
+ * Children of the menu group.
46
+ * This should generally be `Section` components.
47
47
  */
48
48
  children: React.ReactNode;
49
49
  /**
50
- * Used for telling assistive technologies that the menu group is loading.
50
+ * Used this to tell assistive technologies that the menu group is loading.
51
51
  */
52
52
  isLoading?: boolean;
53
53
  /**
54
- * Configure the density of the MenuGroup content.
54
+ * Configure the density of the menu group content.
55
55
  */
56
56
  spacing?: SpacingMode;
57
57
  /**
58
- * Used to override the accessibility role for the element.
58
+ * Use this to override the accessibility role for the element.
59
59
  */
60
60
  role?: string;
61
61
  /**
@@ -78,17 +78,17 @@ export interface SectionProps {
78
78
  id?: string;
79
79
  /**
80
80
  * Enables scrolling within the section.
81
- * Make sure to set `maxHeight` on the parent `MenuGroup` component else it will not work.
81
+ * This won't work unless `maxHeight` is set on the parent `MenuGroup` component.
82
82
  */
83
83
  isScrollable?: boolean;
84
84
  /**
85
- * Will render a border at the top of the section.
85
+ * Use this to render a border at the top of the section.
86
86
  */
87
87
  hasSeparator?: boolean;
88
88
  /**
89
- * Children of the section,
90
- * should generally be `Item` or `Heading` components,
91
- * but can also be [`EmptyState`](https://atlaskit.atlassian.com/packages/design-system/empty-state)s when wanting to render errors.
89
+ * Children of the section.
90
+ * This should generally be `Item` or `Heading` components,
91
+ * but can also be [`EmptyState`](https://atlaskit.atlassian.com/packages/design-system/empty-state)s if you want to render errors.
92
92
  */
93
93
  children: React.ReactNode;
94
94
  /**
@@ -110,12 +110,12 @@ export interface SectionProps {
110
110
  };
111
111
  };
112
112
  /**
113
- * The text passed into the internal HeadingItem. If a title is not provided,
114
- * the HeadingItem will not be rendered, and this component acts as a regular Section.
113
+ * The text passed into the internal `HeadingItem`. If a title isn't provided,
114
+ * the `HeadingItem` won't be rendered, and this component will act as a regular `Section`.
115
115
  */
116
116
  title?: string;
117
117
  /**
118
- * Adds `<ul>` and `<li>` tags around the items for better semantic markup in a list of items.
118
+ * If your menu contains a list, use this to add `<ul>` and `<li>` tags around the items. This is essential for offering better, accessible semantic markup in a list of items.
119
119
  */
120
120
  isList?: boolean;
121
121
  }
@@ -149,29 +149,29 @@ export interface MenuItemProps {
149
149
  cssFn?: CSSFn;
150
150
  /**
151
151
  * Element to render before the item text.
152
- * Generally should be an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
152
+ * Usually this is an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
153
153
  */
154
154
  iconBefore?: React.ReactNode;
155
155
  /**
156
156
  * Element to render after the item text.
157
- * Generally should be an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
157
+ * Usually this is an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
158
158
  */
159
159
  iconAfter?: React.ReactNode;
160
160
  /**
161
- * Event that is triggered when the element is clicked.
161
+ * Event that's triggered when the element is clicked.
162
162
  */
163
163
  onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
164
164
  /**
165
- * Event that is triggered when the element has been pressed.
165
+ * Event that's triggered when the element has been pressed.
166
166
  */
167
167
  onMouseDown?: React.MouseEventHandler;
168
168
  /**
169
169
  * Description of the item.
170
- * This will render smaller text below the primary text of the item as well as slightly increasing the height of the item.
170
+ * This will render smaller text below the primary text of the item, and slightly increase the height of the item.
171
171
  */
172
172
  description?: string | JSX.Element;
173
173
  /**
174
- * Makes the element appear disabled as well as removing interactivity.
174
+ * Makes the element appear disabled as well as removing interactivity. Avoid disabling menu items wherever possible as this isn’t accessible or usable.
175
175
  */
176
176
  isDisabled?: boolean;
177
177
  /**
@@ -195,11 +195,11 @@ export interface MenuItemProps {
195
195
  */
196
196
  overrides?: Overrides;
197
197
  /**
198
- * When `true` the title of the item will wrap multiple lines if it's long enough.
198
+ * When `true`, the title of the item will wrap multiple lines if it's long enough.
199
199
  */
200
200
  shouldTitleWrap?: boolean;
201
201
  /**
202
- * When `true` the description of the item will wrap multiple lines if it's long enough.
202
+ * When `true`, the description of the item will wrap multiple lines if it's long enough.
203
203
  */
204
204
  shouldDescriptionWrap?: boolean;
205
205
  }
@@ -209,7 +209,7 @@ export interface ButtonItemProps extends MenuItemProps {
209
209
  */
210
210
  id?: string;
211
211
  /**
212
- * Used to override the accessibility role for the element.
212
+ * Use this to override the accessibility role for the element.
213
213
  */
214
214
  role?: string;
215
215
  }
@@ -229,7 +229,7 @@ export interface LinkItemProps extends MenuItemProps {
229
229
  */
230
230
  rel?: string;
231
231
  /**
232
- * Used to override the accessibility role for the element.
232
+ * Use this to override the accessibility role for the element.
233
233
  */
234
234
  role?: string;
235
235
  }
@@ -239,25 +239,25 @@ export interface CustomItemComponentProps {
239
239
  */
240
240
  children: React.ReactNode;
241
241
  /**
242
- * Class to apply to the root container of the custom component,
243
- * ensure this has been applied so the consistent item styling is applied.
242
+ * Class to apply to the root container of the custom component.
243
+ * Ensure this has been applied so the item styling is consistent.
244
244
  */
245
245
  className: string;
246
246
  /**
247
- * Test id that is passed through to the custom component.
247
+ * Test ID that's passed through to the custom component.
248
248
  */
249
249
  'data-testid'?: string;
250
250
  /**
251
- * Event handler that is passed through to the custom component.
251
+ * Event handler that's passed through to the custom component.
252
252
  */
253
253
  onClick?: (event: React.MouseEvent<HTMLElement>) => void;
254
254
  /**
255
- * Event handler that is passed through to the custom component.
255
+ * Event handler that's passed through to the custom component.
256
256
  */
257
257
  onMouseDown?: (event: React.MouseEvent<HTMLElement>) => void;
258
258
  /**
259
- * Event handler that is passed through to the custom component.
260
- * Used to disable the element from being draggable.
259
+ * Event handler that's passed through to the custom component.
260
+ * Use this to disable the element from being draggable.
261
261
  */
262
262
  onDragStart?: (event: React.DragEvent) => void;
263
263
  /**
@@ -266,15 +266,15 @@ export interface CustomItemComponentProps {
266
266
  draggable: boolean;
267
267
  /**
268
268
  * React ref for the raw DOM element,
269
- * make sure to place this on the outer most DOM element.
269
+ * make sure to place this on the outermost DOM element.
270
270
  */
271
271
  ref?: Ref<any>;
272
272
  /**
273
- * Makes the element appear disabled as well as removing interactivity.
273
+ * If the tab is selected, the tab index is `0` and is focusable. Otherwise it is `-1` and is not focusable.
274
274
  */
275
275
  tabIndex?: number;
276
276
  /**
277
- * Disabled attribute.
277
+ * Makes the element appear disabled as well as removing interactivity. Avoid disabling menu items wherever possible as this isn’t accessible or usable.
278
278
  */
279
279
  disabled?: boolean;
280
280
  }
@@ -296,7 +296,7 @@ export interface CustomItemProps<TCustomComponentProps = CustomItemComponentProp
296
296
  export interface SkeletonItemProps {
297
297
  /**
298
298
  * Renders a skeleton circle in the `iconBefore` location.
299
- * Takes priority over `hasIcon.
299
+ * Takes priority over `hasIcon`.
300
300
  */
301
301
  hasAvatar?: boolean;
302
302
  /**
@@ -306,7 +306,7 @@ export interface SkeletonItemProps {
306
306
  /**
307
307
  *
308
308
  * Width of the skeleton item.
309
- * Generally you don't need to specify this as it has a staggered width based on `:nth-child` by default.
309
+ * You usually don't need to specify this, as it has a staggered width based on `:nth-child` by default.
310
310
  */
311
311
  width?: Dimension;
312
312
  /**
@@ -340,7 +340,7 @@ export interface HeadingItemProps {
340
340
  children: React.ReactNode;
341
341
  /**
342
342
  * A unique identifier that can be referenced in the `labelledby` prop of a
343
- * section to allow screen readers to announce the name of groups.
343
+ * section to allow assistive technology to announce the name of groups.
344
344
  */
345
345
  id?: string;
346
346
  /**
@@ -351,7 +351,7 @@ export interface HeadingItemProps {
351
351
  testId?: string;
352
352
  /**
353
353
  * Specifies the heading level in the document structure.
354
- * If not specified, level 2 will be applied by default.
354
+ * If not specified, the default is `h2`.
355
355
  */
356
356
  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
357
357
  }
@@ -359,7 +359,7 @@ export interface SkeletonHeadingItemProps {
359
359
  /**
360
360
  *
361
361
  * Width of the skeleton heading item.
362
- * Generally you don't need to specify this as it has a staggered width based on `:nth-child` by default.
362
+ * You usually don't need to specify this, as it has a staggered width based on `:nth-child` by default.
363
363
  */
364
364
  width?: Dimension;
365
365
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "2.1.12",
4
- "description": "A collection of composable menu components that can be used anywhere.",
3
+ "version": "2.1.13",
4
+ "description": "A list of options to help users navigate, or perform actions.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
7
7
  },
@@ -42,10 +42,10 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@atlaskit/ds-lib": "^2.2.0",
45
+ "@atlaskit/ds-lib": "^2.3.0",
46
46
  "@atlaskit/focus-ring": "^1.3.0",
47
47
  "@atlaskit/platform-feature-flags": "^0.2.0",
48
- "@atlaskit/primitives": "^5.5.0",
48
+ "@atlaskit/primitives": "^5.6.0",
49
49
  "@atlaskit/theme": "^12.7.0",
50
50
  "@atlaskit/tokens": "^1.43.0",
51
51
  "@babel/runtime": "^7.0.0",
@@ -67,7 +67,7 @@
67
67
  "@testing-library/react": "^12.1.5",
68
68
  "@types/react-router-dom": "^4.3.1",
69
69
  "ast-types": "^0.13.3",
70
- "bind-event-listener": "^2.1.1",
70
+ "bind-event-listener": "^3.0.0",
71
71
  "jscodeshift": "^0.13.0",
72
72
  "react-router-dom": "^4.2.2",
73
73
  "storybook-addon-performance": "^0.16.0",