@atlaskit/dropdown-menu 12.10.2 → 12.11.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +1311 -1311
  2. package/codemods/migrates/convert-trigger-type.tsx +2 -2
  3. package/codemods/migrates/replace-position-to-placement.tsx +2 -2
  4. package/codemods/migrates/replace-shouldAllowMultiline.tsx +2 -2
  5. package/codemods/utils/create-rename-import.tsx +2 -2
  6. package/codemods/utils/create-update-callsite.tsx +2 -2
  7. package/dist/cjs/checkbox/dropdown-item-checkbox-group.js +9 -2
  8. package/dist/cjs/dropdown-menu-item-group.js +42 -7
  9. package/dist/cjs/internal/components/group-title.js +42 -0
  10. package/dist/cjs/radio/dropdown-item-radio-group.js +12 -5
  11. package/dist/es2019/checkbox/dropdown-item-checkbox-group.js +9 -2
  12. package/dist/es2019/dropdown-menu-item-group.js +39 -7
  13. package/dist/es2019/internal/components/group-title.js +35 -0
  14. package/dist/es2019/radio/dropdown-item-radio-group.js +11 -4
  15. package/dist/esm/checkbox/dropdown-item-checkbox-group.js +9 -2
  16. package/dist/esm/dropdown-menu-item-group.js +40 -7
  17. package/dist/esm/internal/components/group-title.js +36 -0
  18. package/dist/esm/radio/dropdown-item-radio-group.js +11 -4
  19. package/dist/types/checkbox/dropdown-item-checkbox.d.ts +1 -1
  20. package/dist/types/dropdown-menu-item-group.d.ts +6 -7
  21. package/dist/types/dropdown-menu-item.d.ts +1 -1
  22. package/dist/types/internal/components/context.d.ts +1 -1
  23. package/dist/types/internal/components/focus-manager.d.ts +2 -2
  24. package/dist/types/internal/components/group-title.d.ts +14 -0
  25. package/dist/types/internal/components/menu-wrapper.d.ts +1 -1
  26. package/dist/types/internal/hooks/use-register-item-with-focus-manager.d.ts +1 -1
  27. package/dist/types/internal/utils/handle-focus.d.ts +1 -1
  28. package/dist/types/radio/dropdown-item-radio-group.d.ts +1 -1
  29. package/dist/types/radio/dropdown-item-radio.d.ts +1 -1
  30. package/dist/types/types.d.ts +2 -2
  31. package/dist/types-ts4.5/checkbox/dropdown-item-checkbox.d.ts +1 -1
  32. package/dist/types-ts4.5/dropdown-menu-item-group.d.ts +6 -7
  33. package/dist/types-ts4.5/dropdown-menu-item.d.ts +1 -1
  34. package/dist/types-ts4.5/internal/components/context.d.ts +1 -1
  35. package/dist/types-ts4.5/internal/components/focus-manager.d.ts +2 -2
  36. package/dist/types-ts4.5/internal/components/group-title.d.ts +14 -0
  37. package/dist/types-ts4.5/internal/components/menu-wrapper.d.ts +1 -1
  38. package/dist/types-ts4.5/internal/hooks/use-register-item-with-focus-manager.d.ts +1 -1
  39. package/dist/types-ts4.5/internal/utils/handle-focus.d.ts +1 -1
  40. package/dist/types-ts4.5/radio/dropdown-item-radio-group.d.ts +1 -1
  41. package/dist/types-ts4.5/radio/dropdown-item-radio.d.ts +1 -1
  42. package/dist/types-ts4.5/types.d.ts +2 -2
  43. package/package.json +9 -10
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { DropdownItemRadioProps } from '../types';
2
+ import { type DropdownItemRadioProps } from '../types';
3
3
  /**
4
4
  * __Dropdown item radio__
5
5
  *
@@ -1,4 +1,4 @@
1
- import { KeyboardEvent, MouseEvent, ReactElement, ReactNode, Ref } from 'react';
1
+ import { type KeyboardEvent, type MouseEvent, type ReactElement, type ReactNode, type Ref } from 'react';
2
2
  import type { CustomItemComponentProps, CustomItemProps, MenuGroupProps, SectionProps } from '@atlaskit/menu/types';
3
3
  import type { ContentProps, TriggerProps } from '@atlaskit/popup/types';
4
4
  export type FocusableElement = HTMLAnchorElement | HTMLButtonElement;
@@ -110,7 +110,7 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
110
110
  * Content that triggers the dropdown menu to open and close. Use with
111
111
  * `triggerType` to get a button trigger. To customize the trigger element,
112
112
  * provide a function to this prop. You can find
113
- * [examples for custom triggers](components/dropdown-menu/examples#custom-triggers)
113
+ * [examples for custom triggers](https://atlassian.design/components/dropdown-menu/examples#custom-triggers)
114
114
  * in our documentation.
115
115
  */
116
116
  trigger?: string | ((triggerButtonProps: CustomTriggerProps<TriggerElement>) => ReactElement);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { DropdownItemCheckboxProps } from '../types';
2
+ import { type DropdownItemCheckboxProps } from '../types';
3
3
  /**
4
4
  * __Dropdown item checkbox__
5
5
  *
@@ -1,11 +1,10 @@
1
+ import React from 'react';
2
+ import { type SectionProps } from '@atlaskit/menu';
1
3
  /**
2
- * __Section__
4
+ * __Dropdown item checkbox group__
3
5
  *
4
- * A dropdown item group includes all the actions or items in a dropdown menu.
6
+ * A wrapping element for dropdown menu items.
5
7
  *
6
- * - [Examples](https://atlassian.design/components/dropdown-menu/dropdown-item-group/examples)
7
- * - [Code](https://atlassian.design/components/dropdown-menu/dropdown-item-group/code)
8
- * - [Usage](https://atlassian.design/components/dropdown-menu/dropdown-item-group/usage)
9
8
  */
10
- import Section from '@atlaskit/menu/section';
11
- export default Section;
9
+ declare const DropdownMenuItemGroup: React.ForwardRefExoticComponent<SectionProps & React.RefAttributes<HTMLElement>>;
10
+ export default DropdownMenuItemGroup;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DropdownItemProps } from './types';
2
+ import { type DropdownItemProps } from './types';
3
3
  /**
4
4
  * __Dropdown menu item__
5
5
  *
@@ -1,4 +1,4 @@
1
- import React, { MutableRefObject, PropsWithChildren } from 'react';
1
+ import React, { type MutableRefObject, type PropsWithChildren } from 'react';
2
2
  /**
3
3
  *
4
4
  * @internal
@@ -1,5 +1,5 @@
1
- import React, { FC, ReactNode } from 'react';
2
- import { FocusableElement } from '../../types';
1
+ import React, { type FC, type ReactNode } from 'react';
2
+ import { type FocusableElement } from '../../types';
3
3
  /**
4
4
  *
5
5
  *
@@ -0,0 +1,14 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ /**
4
+ * __Group title__
5
+ *
6
+ * Used to visually represent the title for DropdownMenu groups
7
+ *
8
+ * @internal
9
+ */
10
+ declare const GroupTitle: ({ id, title }: {
11
+ id: string;
12
+ title: string;
13
+ }) => jsx.JSX.Element;
14
+ export default GroupTitle;
@@ -1,5 +1,5 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { MenuWrapperProps } from '../../types';
2
+ import { type MenuWrapperProps } from '../../types';
3
3
  /**
4
4
  *
5
5
  * MenuWrapper wraps all the menu items.
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { FocusableElement } from '../../types';
2
+ import { type FocusableElement } from '../../types';
3
3
  declare function useRegisterItemWithFocusManager(): import("react").RefObject<FocusableElement>;
4
4
  export default useRegisterItemWithFocusManager;
@@ -1,2 +1,2 @@
1
- import { FocusableElement } from '../../types';
1
+ import { type FocusableElement } from '../../types';
2
2
  export default function handleFocus(refs: Array<FocusableElement>, isLayerDisabled: () => boolean, onClose: (e: KeyboardEvent) => void): (e: KeyboardEvent) => void;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { SectionProps } from '@atlaskit/menu';
2
+ import { type SectionProps } from '@atlaskit/menu';
3
3
  interface DropdownItemRadioGroupProps extends SectionProps {
4
4
  id: string;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { DropdownItemRadioProps } from '../types';
2
+ import { type DropdownItemRadioProps } from '../types';
3
3
  /**
4
4
  * __Dropdown item radio__
5
5
  *
@@ -1,4 +1,4 @@
1
- import { KeyboardEvent, MouseEvent, ReactElement, ReactNode, Ref } from 'react';
1
+ import { type KeyboardEvent, type MouseEvent, type ReactElement, type ReactNode, type Ref } from 'react';
2
2
  import type { CustomItemComponentProps, CustomItemProps, MenuGroupProps, SectionProps } from '@atlaskit/menu/types';
3
3
  import type { ContentProps, TriggerProps } from '@atlaskit/popup/types';
4
4
  export type FocusableElement = HTMLAnchorElement | HTMLButtonElement;
@@ -110,7 +110,7 @@ export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElem
110
110
  * Content that triggers the dropdown menu to open and close. Use with
111
111
  * `triggerType` to get a button trigger. To customize the trigger element,
112
112
  * provide a function to this prop. You can find
113
- * [examples for custom triggers](components/dropdown-menu/examples#custom-triggers)
113
+ * [examples for custom triggers](https://atlassian.design/components/dropdown-menu/examples#custom-triggers)
114
114
  * in our documentation.
115
115
  */
116
116
  trigger?: string | ((triggerButtonProps: CustomTriggerProps<TriggerElement>) => ReactElement);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dropdown-menu",
3
- "version": "12.10.2",
3
+ "version": "12.11.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/"
@@ -27,20 +27,21 @@
27
27
  "runReact18": true
28
28
  },
29
29
  "dependencies": {
30
- "@atlaskit/button": "^17.14.0",
30
+ "@atlaskit/button": "^17.17.0",
31
31
  "@atlaskit/codemod-utils": "^4.2.0",
32
32
  "@atlaskit/ds-lib": "^2.3.0",
33
- "@atlaskit/icon": "^22.2.0",
33
+ "@atlaskit/icon": "^22.3.0",
34
34
  "@atlaskit/layering": "^0.3.0",
35
- "@atlaskit/menu": "^2.2.0",
35
+ "@atlaskit/menu": "^2.4.0",
36
36
  "@atlaskit/popup": "^1.17.0",
37
- "@atlaskit/primitives": "^6.1.0",
37
+ "@atlaskit/primitives": "^6.5.0",
38
38
  "@atlaskit/spinner": "^16.1.0",
39
39
  "@atlaskit/theme": "^12.8.0",
40
- "@atlaskit/tokens": "^1.48.0",
40
+ "@atlaskit/tokens": "^1.49.0",
41
41
  "@babel/runtime": "^7.0.0",
42
42
  "@emotion/react": "^11.7.1",
43
- "bind-event-listener": "^3.0.0"
43
+ "bind-event-listener": "^3.0.0",
44
+ "react-uid": "^2.2.0"
44
45
  },
45
46
  "peerDependencies": {
46
47
  "react": "^16.8.0 || ^17.0.0 || ~18.2.0",
@@ -53,7 +54,6 @@
53
54
  "@atlaskit/modal-dialog": "^12.13.0",
54
55
  "@atlaskit/toggle": "^13.1.0",
55
56
  "@atlaskit/visual-regression": "*",
56
- "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
57
57
  "@atlassian/feature-flags-test-utils": "*",
58
58
  "@testing-library/dom": "^8.17.1",
59
59
  "@testing-library/react": "^12.1.5",
@@ -107,6 +107,5 @@
107
107
  ".": "./src/index.tsx",
108
108
  "./types": "./src/types.tsx"
109
109
  },
110
- "homepage": "https://atlassian.design/components/dropdown-menu/",
111
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
110
+ "homepage": "https://atlassian.design/components/dropdown-menu/"
112
111
  }