@atlaskit/dropdown-menu 12.26.1 → 12.26.3

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 (49) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/types/checkbox/dropdown-item-checkbox-group.d.ts +2 -2
  3. package/dist/types/checkbox/dropdown-item-checkbox.d.ts +2 -2
  4. package/dist/types/dropdown-menu.d.ts +2 -2
  5. package/dist/types/internal/components/checkbox-icon.d.ts +2 -2
  6. package/dist/types/internal/components/group-title.d.ts +2 -2
  7. package/dist/types/internal/components/radio-icon.d.ts +2 -2
  8. package/dist/types/internal/context/selection-store.d.ts +1 -1
  9. package/dist/types/radio/dropdown-item-radio-group.d.ts +1 -1
  10. package/dist/types/radio/dropdown-item-radio.d.ts +2 -2
  11. package/dist/types-ts4.5/checkbox/dropdown-item-checkbox-group.d.ts +2 -2
  12. package/dist/types-ts4.5/checkbox/dropdown-item-checkbox.d.ts +2 -2
  13. package/dist/types-ts4.5/dropdown-menu.d.ts +2 -2
  14. package/dist/types-ts4.5/internal/components/checkbox-icon.d.ts +2 -2
  15. package/dist/types-ts4.5/internal/components/group-title.d.ts +2 -2
  16. package/dist/types-ts4.5/internal/components/radio-icon.d.ts +2 -2
  17. package/dist/types-ts4.5/internal/context/selection-store.d.ts +1 -1
  18. package/dist/types-ts4.5/radio/dropdown-item-radio-group.d.ts +1 -1
  19. package/dist/types-ts4.5/radio/dropdown-item-radio.d.ts +2 -2
  20. package/package.json +5 -6
  21. package/codemods/11.0.0-lite-mode.tsx +0 -51
  22. package/codemods/__tests__/11.0.0-lite-mode.test.tsx +0 -68
  23. package/codemods/__tests__/convert-position.test.tsx +0 -88
  24. package/codemods/__tests__/convert-triggerType.test.tsx +0 -183
  25. package/codemods/__tests__/deprecate-items.test.tsx +0 -108
  26. package/codemods/__tests__/deprecate-onItemActivated.test.tsx +0 -108
  27. package/codemods/__tests__/deprecate-onPositioned.test.tsx +0 -108
  28. package/codemods/__tests__/deprecate-shouldFitContainer.tsx +0 -108
  29. package/codemods/__tests__/rename-imports.tsx +0 -130
  30. package/codemods/__tests__/replace-position-to-placement.test.tsx +0 -84
  31. package/codemods/__tests__/replace-shouldAllowMultipleLine.test.tsx +0 -122
  32. package/codemods/__tests__/update-component-callsites.tsx +0 -64
  33. package/codemods/migrates/convert-trigger-type.tsx +0 -52
  34. package/codemods/migrates/deprecate-autoFocus.tsx +0 -10
  35. package/codemods/migrates/deprecate-boundariesElement.tsx +0 -9
  36. package/codemods/migrates/deprecate-isCompact.tsx +0 -10
  37. package/codemods/migrates/deprecate-isHidden.tsx +0 -10
  38. package/codemods/migrates/deprecate-isMenuFixed.tsx +0 -6
  39. package/codemods/migrates/deprecate-items.tsx +0 -6
  40. package/codemods/migrates/deprecate-onItemActivated.tsx +0 -9
  41. package/codemods/migrates/deprecate-onPositioned.tsx +0 -9
  42. package/codemods/migrates/deprecate-shouldFitContainer.tsx +0 -9
  43. package/codemods/migrates/rename-imports.tsx +0 -22
  44. package/codemods/migrates/replace-position-to-placement.tsx +0 -27
  45. package/codemods/migrates/replace-shouldAllowMultiline.tsx +0 -33
  46. package/codemods/migrates/update-component-callsites.tsx +0 -13
  47. package/codemods/utils/convert-position.tsx +0 -24
  48. package/codemods/utils/create-rename-import.tsx +0 -39
  49. package/codemods/utils/create-update-callsite.tsx +0 -31
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/dropdown-menu
2
2
 
3
+ ## 12.26.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#114433](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114433)
8
+ [`cf11baeb9088e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cf11baeb9088e) -
9
+ Remove old codemods and update dependencies.
10
+
11
+ ## 12.26.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 12.26.1
4
18
 
5
19
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { SectionProps } from '@atlaskit/menu';
3
3
  interface DropdownItemCheckboxGroupProps extends SectionProps {
4
4
  /**
@@ -12,5 +12,5 @@ interface DropdownItemCheckboxGroupProps extends SectionProps {
12
12
  * A wrapping element for dropdown menu checkbox items.
13
13
  *
14
14
  */
15
- declare const DropdownItemCheckboxGroup: ({ children, hasSeparator, id, isList, isScrollable, overrides, testId, title, ...rest }: DropdownItemCheckboxGroupProps) => JSX.Element;
15
+ declare const DropdownItemCheckboxGroup: ({ children, hasSeparator, id, isList, isScrollable, overrides, testId, title, ...rest }: DropdownItemCheckboxGroupProps) => React.JSX.Element;
16
16
  export default DropdownItemCheckboxGroup;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { type DropdownItemCheckboxProps } from '../types';
3
3
  /**
4
4
  * __Dropdown item checkbox__
@@ -9,5 +9,5 @@ import { type DropdownItemCheckboxProps } from '../types';
9
9
  * - [Code](https://atlassian.design/components/dropdown-menu/dropdown-item-checkbox/code)
10
10
  * - [Usage](https://atlassian.design/components/dropdown-menu/dropdown-item-checkbox/usage)
11
11
  */
12
- declare const DropdownItemCheckbox: ({ children, defaultSelected, description, id, isDisabled, isSelected, onClick: providedOnClick, shouldDescriptionWrap, shouldTitleWrap, testId, interactionName, ...rest }: DropdownItemCheckboxProps) => JSX.Element;
12
+ declare const DropdownItemCheckbox: ({ children, defaultSelected, description, id, isDisabled, isSelected, onClick: providedOnClick, shouldDescriptionWrap, shouldTitleWrap, testId, interactionName, ...rest }: DropdownItemCheckboxProps) => React.JSX.Element;
13
13
  export default DropdownItemCheckbox;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { DropdownMenuProps } from './types';
3
3
  /**
4
4
  * __Dropdown menu__
@@ -9,5 +9,5 @@ import type { DropdownMenuProps } from './types';
9
9
  * - [Code](https://atlassian.design/components/dropdown-menu/code)
10
10
  * - [Usage](https://atlassian.design/components/dropdown-menu/usage)
11
11
  */
12
- declare const DropdownMenu: <T extends HTMLElement = any>({ autoFocus, children, defaultOpen, isLoading, isOpen, onOpenChange, placement, shouldFitContainer, shouldFlip, shouldRenderToParent, returnFocusRef, spacing, statusLabel, testId, trigger, zIndex, label, interactionName, strategy, }: DropdownMenuProps<T>) => JSX.Element;
12
+ declare const DropdownMenu: <T extends HTMLElement = any>({ autoFocus, children, defaultOpen, isLoading, isOpen, onOpenChange, placement, shouldFitContainer, shouldFlip, shouldRenderToParent, returnFocusRef, spacing, statusLabel, testId, trigger, zIndex, label, interactionName, strategy, }: DropdownMenuProps<T>) => React.JSX.Element;
13
13
  export default DropdownMenu;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  /**
3
3
  * __Checkbox icon__
4
4
  *
@@ -8,5 +8,5 @@
8
8
  */
9
9
  declare const CheckboxIcon: ({ checked }: {
10
10
  checked: boolean;
11
- }) => JSX.Element;
11
+ }) => React.JSX.Element;
12
12
  export default CheckboxIcon;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  /**
3
3
  * __Group title__
4
4
  *
@@ -9,5 +9,5 @@
9
9
  declare const GroupTitle: ({ id, title }: {
10
10
  id: string;
11
11
  title: string;
12
- }) => JSX.Element;
12
+ }) => React.JSX.Element;
13
13
  export default GroupTitle;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  /**
3
3
  * __Radio icon__
4
4
  *
@@ -8,5 +8,5 @@
8
8
  */
9
9
  declare const RadioIcon: ({ checked }: {
10
10
  checked: boolean;
11
- }) => JSX.Element;
11
+ }) => React.JSX.Element;
12
12
  export default RadioIcon;
@@ -23,5 +23,5 @@ type SelectionStoreProps = {
23
23
  * It handles the uncontrolled story for dropdown menu when the menu
24
24
  * items can be mounted/unmounted depending if the menu is open or closed.
25
25
  */
26
- declare const SelectionStore: (props: SelectionStoreProps) => JSX.Element;
26
+ declare const SelectionStore: (props: SelectionStoreProps) => React.JSX.Element;
27
27
  export default SelectionStore;
@@ -21,5 +21,5 @@ export declare const RadioGroupContext: React.Context<RadioGroupContextProps>;
21
21
  * across mount and unmounts.
22
22
  *
23
23
  */
24
- declare const DropdownItemRadioGroup: ({ children, hasSeparator, id, isList, isScrollable, overrides, testId, title, ...rest }: DropdownItemRadioGroupProps) => JSX.Element;
24
+ declare const DropdownItemRadioGroup: ({ children, hasSeparator, id, isList, isScrollable, overrides, testId, title, ...rest }: DropdownItemRadioGroupProps) => React.JSX.Element;
25
25
  export default DropdownItemRadioGroup;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { type DropdownItemRadioProps } from '../types';
3
3
  /**
4
4
  * __Dropdown item radio__
@@ -9,5 +9,5 @@ import { type DropdownItemRadioProps } from '../types';
9
9
  * - [Code](https://atlassian.design/components/dropdown-menu/dropdown-item-radio/code)
10
10
  * - [Usage](https://atlassian.design/components/dropdown-menu/dropdown-item-radio/usage)
11
11
  */
12
- declare const DropdownItemRadio: ({ children, defaultSelected, testId, id, title, description, isDisabled, isSelected, onClick: providedOnClick, shouldDescriptionWrap, shouldTitleWrap, interactionName, ...rest }: DropdownItemRadioProps) => JSX.Element;
12
+ declare const DropdownItemRadio: ({ children, defaultSelected, testId, id, title, description, isDisabled, isSelected, onClick: providedOnClick, shouldDescriptionWrap, shouldTitleWrap, interactionName, ...rest }: DropdownItemRadioProps) => React.JSX.Element;
13
13
  export default DropdownItemRadio;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { SectionProps } from '@atlaskit/menu';
3
3
  interface DropdownItemCheckboxGroupProps extends SectionProps {
4
4
  /**
@@ -12,5 +12,5 @@ interface DropdownItemCheckboxGroupProps extends SectionProps {
12
12
  * A wrapping element for dropdown menu checkbox items.
13
13
  *
14
14
  */
15
- declare const DropdownItemCheckboxGroup: ({ children, hasSeparator, id, isList, isScrollable, overrides, testId, title, ...rest }: DropdownItemCheckboxGroupProps) => JSX.Element;
15
+ declare const DropdownItemCheckboxGroup: ({ children, hasSeparator, id, isList, isScrollable, overrides, testId, title, ...rest }: DropdownItemCheckboxGroupProps) => React.JSX.Element;
16
16
  export default DropdownItemCheckboxGroup;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { type DropdownItemCheckboxProps } from '../types';
3
3
  /**
4
4
  * __Dropdown item checkbox__
@@ -9,5 +9,5 @@ import { type DropdownItemCheckboxProps } from '../types';
9
9
  * - [Code](https://atlassian.design/components/dropdown-menu/dropdown-item-checkbox/code)
10
10
  * - [Usage](https://atlassian.design/components/dropdown-menu/dropdown-item-checkbox/usage)
11
11
  */
12
- declare const DropdownItemCheckbox: ({ children, defaultSelected, description, id, isDisabled, isSelected, onClick: providedOnClick, shouldDescriptionWrap, shouldTitleWrap, testId, interactionName, ...rest }: DropdownItemCheckboxProps) => JSX.Element;
12
+ declare const DropdownItemCheckbox: ({ children, defaultSelected, description, id, isDisabled, isSelected, onClick: providedOnClick, shouldDescriptionWrap, shouldTitleWrap, testId, interactionName, ...rest }: DropdownItemCheckboxProps) => React.JSX.Element;
13
13
  export default DropdownItemCheckbox;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { DropdownMenuProps } from './types';
3
3
  /**
4
4
  * __Dropdown menu__
@@ -9,5 +9,5 @@ import type { DropdownMenuProps } from './types';
9
9
  * - [Code](https://atlassian.design/components/dropdown-menu/code)
10
10
  * - [Usage](https://atlassian.design/components/dropdown-menu/usage)
11
11
  */
12
- declare const DropdownMenu: <T extends HTMLElement = any>({ autoFocus, children, defaultOpen, isLoading, isOpen, onOpenChange, placement, shouldFitContainer, shouldFlip, shouldRenderToParent, returnFocusRef, spacing, statusLabel, testId, trigger, zIndex, label, interactionName, strategy, }: DropdownMenuProps<T>) => JSX.Element;
12
+ declare const DropdownMenu: <T extends HTMLElement = any>({ autoFocus, children, defaultOpen, isLoading, isOpen, onOpenChange, placement, shouldFitContainer, shouldFlip, shouldRenderToParent, returnFocusRef, spacing, statusLabel, testId, trigger, zIndex, label, interactionName, strategy, }: DropdownMenuProps<T>) => React.JSX.Element;
13
13
  export default DropdownMenu;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  /**
3
3
  * __Checkbox icon__
4
4
  *
@@ -8,5 +8,5 @@
8
8
  */
9
9
  declare const CheckboxIcon: ({ checked }: {
10
10
  checked: boolean;
11
- }) => JSX.Element;
11
+ }) => React.JSX.Element;
12
12
  export default CheckboxIcon;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  /**
3
3
  * __Group title__
4
4
  *
@@ -9,5 +9,5 @@
9
9
  declare const GroupTitle: ({ id, title }: {
10
10
  id: string;
11
11
  title: string;
12
- }) => JSX.Element;
12
+ }) => React.JSX.Element;
13
13
  export default GroupTitle;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  /**
3
3
  * __Radio icon__
4
4
  *
@@ -8,5 +8,5 @@
8
8
  */
9
9
  declare const RadioIcon: ({ checked }: {
10
10
  checked: boolean;
11
- }) => JSX.Element;
11
+ }) => React.JSX.Element;
12
12
  export default RadioIcon;
@@ -23,5 +23,5 @@ type SelectionStoreProps = {
23
23
  * It handles the uncontrolled story for dropdown menu when the menu
24
24
  * items can be mounted/unmounted depending if the menu is open or closed.
25
25
  */
26
- declare const SelectionStore: (props: SelectionStoreProps) => JSX.Element;
26
+ declare const SelectionStore: (props: SelectionStoreProps) => React.JSX.Element;
27
27
  export default SelectionStore;
@@ -21,5 +21,5 @@ export declare const RadioGroupContext: React.Context<RadioGroupContextProps>;
21
21
  * across mount and unmounts.
22
22
  *
23
23
  */
24
- declare const DropdownItemRadioGroup: ({ children, hasSeparator, id, isList, isScrollable, overrides, testId, title, ...rest }: DropdownItemRadioGroupProps) => JSX.Element;
24
+ declare const DropdownItemRadioGroup: ({ children, hasSeparator, id, isList, isScrollable, overrides, testId, title, ...rest }: DropdownItemRadioGroupProps) => React.JSX.Element;
25
25
  export default DropdownItemRadioGroup;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { type DropdownItemRadioProps } from '../types';
3
3
  /**
4
4
  * __Dropdown item radio__
@@ -9,5 +9,5 @@ import { type DropdownItemRadioProps } from '../types';
9
9
  * - [Code](https://atlassian.design/components/dropdown-menu/dropdown-item-radio/code)
10
10
  * - [Usage](https://atlassian.design/components/dropdown-menu/dropdown-item-radio/usage)
11
11
  */
12
- declare const DropdownItemRadio: ({ children, defaultSelected, testId, id, title, description, isDisabled, isSelected, onClick: providedOnClick, shouldDescriptionWrap, shouldTitleWrap, interactionName, ...rest }: DropdownItemRadioProps) => JSX.Element;
12
+ declare const DropdownItemRadio: ({ children, defaultSelected, testId, id, title, description, isDisabled, isSelected, onClick: providedOnClick, shouldDescriptionWrap, shouldTitleWrap, interactionName, ...rest }: DropdownItemRadioProps) => React.JSX.Element;
13
13
  export default DropdownItemRadio;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dropdown-menu",
3
- "version": "12.26.1",
3
+ "version": "12.26.3",
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/"
@@ -25,17 +25,17 @@
25
25
  "runReact18": true
26
26
  },
27
27
  "dependencies": {
28
- "@atlaskit/button": "^20.4.0",
28
+ "@atlaskit/button": "^20.5.0",
29
29
  "@atlaskit/codemod-utils": "^4.2.0",
30
30
  "@atlaskit/ds-lib": "^3.5.0",
31
- "@atlaskit/icon": "^23.6.0",
31
+ "@atlaskit/icon": "^23.9.0",
32
32
  "@atlaskit/layering": "^1.1.0",
33
33
  "@atlaskit/menu": "^2.14.0",
34
34
  "@atlaskit/platform-feature-flags": "^1.0.0",
35
35
  "@atlaskit/popup": "^1.31.0",
36
- "@atlaskit/primitives": "^13.4.0",
36
+ "@atlaskit/primitives": "^13.5.0",
37
37
  "@atlaskit/spinner": "^17.1.0",
38
- "@atlaskit/theme": "^14.1.0",
38
+ "@atlaskit/theme": "^15.0.0",
39
39
  "@atlaskit/tokens": "^3.3.0",
40
40
  "@babel/runtime": "^7.0.0",
41
41
  "@emotion/react": "^11.7.1",
@@ -66,7 +66,6 @@
66
66
  "@testing-library/react": "^13.4.0",
67
67
  "@testing-library/react-hooks": "^8.0.1",
68
68
  "jest-in-case": "^1.0.2",
69
- "jscodeshift": "^0.13.0",
70
69
  "raf-stub": "^2.0.1",
71
70
  "react-dom": "^18.2.0",
72
71
  "typescript": "~5.4.2"
@@ -1,51 +0,0 @@
1
- import { createTransformer } from '@atlaskit/codemod-utils';
2
-
3
- import convertTriggerType from './migrates/convert-trigger-type';
4
- import deprecateAutoFocus from './migrates/deprecate-autoFocus';
5
- import deprecateboundariesElement from './migrates/deprecate-boundariesElement';
6
- import deprecateIsCompact from './migrates/deprecate-isCompact';
7
- import deprecateIsHidden from './migrates/deprecate-isHidden';
8
- import deprecateIsMenuFixed from './migrates/deprecate-isMenuFixed';
9
- import deprecateItems from './migrates/deprecate-items';
10
- import deprecateOnItemActivated from './migrates/deprecate-onItemActivated';
11
- import deprecateOnPositioned from './migrates/deprecate-onPositioned';
12
- import deprecateShouldFitContainer from './migrates/deprecate-shouldFitContainer';
13
- import {
14
- renameDropdownItemGroupCheckbox,
15
- renameDropdownItemGroupRadio,
16
- renameDropdownMenuStateless,
17
- } from './migrates/rename-imports';
18
- import updatePositionValue from './migrates/replace-position-to-placement';
19
- import replaceShouldAllowMultiline from './migrates/replace-shouldAllowMultiline';
20
- import {
21
- updateDropdownItemGroupCheckboxCallsite,
22
- updateDropdownItemGroupRadioCallsite,
23
- } from './migrates/update-component-callsites';
24
-
25
- const transformer = createTransformer([
26
- deprecateItems,
27
- deprecateOnItemActivated,
28
- deprecateOnPositioned,
29
- deprecateShouldFitContainer,
30
- deprecateboundariesElement,
31
- deprecateIsMenuFixed,
32
-
33
- // props on *Items
34
- ...deprecateAutoFocus(),
35
- ...deprecateIsCompact(),
36
- ...deprecateIsHidden(),
37
-
38
- replaceShouldAllowMultiline,
39
- updatePositionValue,
40
-
41
- renameDropdownItemGroupCheckbox,
42
- renameDropdownItemGroupRadio,
43
- renameDropdownMenuStateless,
44
-
45
- updateDropdownItemGroupCheckboxCallsite,
46
- updateDropdownItemGroupRadioCallsite,
47
-
48
- convertTriggerType,
49
- ]);
50
-
51
- export default transformer;
@@ -1,68 +0,0 @@
1
- // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
2
- jest.autoMockOff();
3
-
4
- import transformer from '../11.0.0-lite-mode';
5
-
6
- const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
7
-
8
- describe('apply all needed codemods for version 11.0.0 major bump', () => {
9
- defineInlineTest(
10
- { default: transformer, parser: 'tsx' },
11
- {},
12
- `
13
- import React from "react";
14
- import DropdownMenu, {
15
- DropdownItemGroupCheckbox as MyComponent, DropdownItemCheckbox, DropdownItem, DropdownItemRadio,
16
- } from "@atlaskit/dropdown-menu";
17
-
18
- export default () => (
19
- <DropdownMenu
20
- trigger="Click to open"
21
- triggerType="button"
22
- items={[]}
23
- onItemActivated={() => {}}
24
- onPositioned={() => {}}
25
- position="bottom left"
26
- shouldFitContainer={false}
27
- boundariesElement={document.body}
28
- isMenuFixed
29
- shouldAllowMultiline>
30
- <DropdownItem
31
- isHidden
32
- autoFocus
33
- isCompact
34
- >Cut</DropdownItem>
35
- <DropdownItemCheckbox
36
- isHidden
37
- autoFocus
38
- isCompact
39
- >Copy</DropdownItemCheckbox>
40
- <DropdownItemRadio
41
- isHidden
42
- autoFocus
43
- isCompact
44
- >Paste</DropdownItemRadio>
45
- </DropdownMenu>
46
- );
47
- `,
48
- `
49
- import React from "react";
50
- import DropdownMenu, {
51
- DropdownItemCheckboxGroup as MyComponent, DropdownItemCheckbox, DropdownItem, DropdownItemRadio,
52
- } from "@atlaskit/dropdown-menu";
53
-
54
- export default () => (
55
- <DropdownMenu
56
- trigger="Click to open"
57
- placement="bottom-start"
58
- shouldTitleWrap
59
- shouldDescriptionWrap>
60
- <DropdownItem>Cut</DropdownItem>
61
- <DropdownItemCheckbox>Copy</DropdownItemCheckbox>
62
- <DropdownItemRadio>Paste</DropdownItemRadio>
63
- </DropdownMenu>
64
- );
65
- `,
66
- 'should not change anything when items is not used ',
67
- );
68
- });
@@ -1,88 +0,0 @@
1
- import convertPosition from '../utils/convert-position';
2
-
3
- describe('convert old position notation', () => {
4
- describe('edge cases', () => {
5
- it('fallback to bottom-start', () => {
6
- const position = convertPosition('unknown');
7
- expect(position).toBe('bottom-start');
8
- });
9
-
10
- it('fallback to bottom-start', () => {
11
- const position = convertPosition();
12
- expect(position).toBe('bottom-start');
13
- });
14
-
15
- it('trim', () => {
16
- const position = convertPosition(' top left ');
17
- expect(position).toBe('top-start');
18
- });
19
- });
20
-
21
- describe('convert top', () => {
22
- it('convert top left', () => {
23
- const position = convertPosition('top left');
24
- expect(position).toBe('top-start');
25
- });
26
-
27
- it('convert top center', () => {
28
- const position = convertPosition('top center');
29
- expect(position).toBe('top');
30
- });
31
-
32
- it('convert top right', () => {
33
- const position = convertPosition('top right');
34
- expect(position).toBe('top-end');
35
- });
36
- });
37
-
38
- describe('convert right', () => {
39
- it('convert right top', () => {
40
- const position = convertPosition('right top');
41
- expect(position).toBe('right-start');
42
- });
43
-
44
- it('convert right middle', () => {
45
- const position = convertPosition('right middle');
46
- expect(position).toBe('right');
47
- });
48
-
49
- it('convert right bottom', () => {
50
- const position = convertPosition('right bottom');
51
- expect(position).toBe('right-end');
52
- });
53
- });
54
-
55
- describe('convert bottom', () => {
56
- it('convert bottom left', () => {
57
- const position = convertPosition('bottom left');
58
- expect(position).toBe('bottom-start');
59
- });
60
-
61
- it('convert bottom center', () => {
62
- const position = convertPosition('bottom center');
63
- expect(position).toBe('bottom');
64
- });
65
-
66
- it('convert bottom right', () => {
67
- const position = convertPosition('bottom right');
68
- expect(position).toBe('bottom-end');
69
- });
70
- });
71
-
72
- describe('convert left', () => {
73
- it('convert left top', () => {
74
- const position = convertPosition('left top');
75
- expect(position).toBe('left-start');
76
- });
77
-
78
- it('convert left middle', () => {
79
- const position = convertPosition('left middle');
80
- expect(position).toBe('left');
81
- });
82
-
83
- it('convert left bottom', () => {
84
- const position = convertPosition('left bottom');
85
- expect(position).toBe('left-end');
86
- });
87
- });
88
- });