@atlaskit/dropdown-menu 11.7.3 → 11.8.1
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 +16 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/internal/context/selection-store.d.ts +3 -3
- package/dist/types/internal/hooks/use-checkbox-state.d.ts +3 -3
- package/dist/types/internal/hooks/use-radio-state.d.ts +3 -3
- package/dist/types/types.d.ts +8 -8
- package/package.json +28 -20
- package/types/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 11.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
8
|
+
|
|
9
|
+
## 11.8.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 11.7.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type OptionsInGroup = {
|
|
3
3
|
[key: string]: boolean | undefined;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
type SelectionStoreContextProps = {
|
|
6
6
|
setItemState: (group: string, id: string, value: boolean | undefined) => void;
|
|
7
7
|
getItemState: (group: string, id: string) => boolean | undefined;
|
|
8
8
|
setGroupState: (group: string, value: OptionsInGroup) => void;
|
|
@@ -15,7 +15,7 @@ declare type SelectionStoreContextProps = {
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
export declare const SelectionStoreContext: React.Context<SelectionStoreContextProps>;
|
|
18
|
-
|
|
18
|
+
type SelectionStoreProps = {
|
|
19
19
|
children: React.ReactNode;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
type CheckboxStateArgs = {
|
|
2
2
|
id: string;
|
|
3
3
|
isSelected: boolean | undefined;
|
|
4
4
|
defaultSelected: boolean | undefined;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type SetStateCallback = (value: boolean | undefined) => boolean;
|
|
7
|
+
type CheckboxStateValue = [boolean, (newValue: SetStateCallback) => void];
|
|
8
8
|
/**
|
|
9
9
|
* Custom hook to handle checkbox state for dropdown menu.
|
|
10
10
|
* It works in tandem with the selection store context when the
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
type RadioStateArgs = {
|
|
2
2
|
id: string;
|
|
3
3
|
isSelected: boolean | undefined;
|
|
4
4
|
defaultSelected: boolean | undefined;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type SetStateCallback = (value: boolean | undefined) => boolean;
|
|
7
|
+
type RadioStateValue = [boolean, (newValue: SetStateCallback) => void];
|
|
8
8
|
declare function useRadioState({ id, isSelected, defaultSelected, }: RadioStateArgs): RadioStateValue;
|
|
9
9
|
export default useRadioState;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { KeyboardEvent, MouseEvent, ReactElement, ReactNode, Ref } from 'react';
|
|
2
2
|
import type { CustomItemProps, MenuGroupProps, SectionProps } from '@atlaskit/menu/types';
|
|
3
3
|
import type { ContentProps, TriggerProps } from '@atlaskit/popup/types';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
4
|
+
export type FocusableElement = HTMLAnchorElement | HTMLButtonElement;
|
|
5
|
+
export type Action = 'next' | 'prev' | 'first' | 'last';
|
|
6
|
+
export type Placement = 'auto-start' | 'auto' | 'auto-end' | 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
|
|
7
|
+
export type ItemId = string;
|
|
8
|
+
export type GroupId = string;
|
|
9
|
+
export type CachedItem = {
|
|
10
10
|
id: ItemId;
|
|
11
11
|
groupId: GroupId;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type FocusItem = {
|
|
14
14
|
itemId: ItemId;
|
|
15
15
|
itemNode: HTMLElement;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type Behaviors = 'checkbox' | 'radio' | 'menuitemcheckbox' | 'menuitemradio';
|
|
18
18
|
export interface CustomTriggerProps<TriggerElement extends HTMLElement = HTMLElement> extends Omit<TriggerProps, 'ref'> {
|
|
19
19
|
/**
|
|
20
20
|
* Ref that should be applied to the trigger. This is used to calculate the menu position.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.8.1",
|
|
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/"
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
15
23
|
"sideEffects": false,
|
|
16
24
|
"atlaskit:src": "src/index.tsx",
|
|
17
25
|
"atlassian": {
|
|
@@ -23,16 +31,16 @@
|
|
|
23
31
|
}
|
|
24
32
|
},
|
|
25
33
|
"dependencies": {
|
|
26
|
-
"@atlaskit/button": "^16.
|
|
27
|
-
"@atlaskit/codemod-utils": "^4.
|
|
28
|
-
"@atlaskit/ds-lib": "^2.
|
|
29
|
-
"@atlaskit/icon": "^21.
|
|
30
|
-
"@atlaskit/menu": "^1.
|
|
31
|
-
"@atlaskit/popup": "^1.
|
|
32
|
-
"@atlaskit/spinner": "^15.
|
|
33
|
-
"@atlaskit/theme": "^12.
|
|
34
|
-
"@atlaskit/tokens": "^1.
|
|
35
|
-
"@atlaskit/visually-hidden": "^1.
|
|
34
|
+
"@atlaskit/button": "^16.7.0",
|
|
35
|
+
"@atlaskit/codemod-utils": "^4.2.0",
|
|
36
|
+
"@atlaskit/ds-lib": "^2.2.0",
|
|
37
|
+
"@atlaskit/icon": "^21.12.0",
|
|
38
|
+
"@atlaskit/menu": "^1.6.0",
|
|
39
|
+
"@atlaskit/popup": "^1.6.0",
|
|
40
|
+
"@atlaskit/spinner": "^15.5.0",
|
|
41
|
+
"@atlaskit/theme": "^12.5.0",
|
|
42
|
+
"@atlaskit/tokens": "^1.4.0",
|
|
43
|
+
"@atlaskit/visually-hidden": "^1.2.0",
|
|
36
44
|
"@babel/runtime": "^7.0.0",
|
|
37
45
|
"@emotion/react": "^11.7.1",
|
|
38
46
|
"bind-event-listener": "^2.1.1"
|
|
@@ -42,16 +50,16 @@
|
|
|
42
50
|
"react-dom": "^16.8.0"
|
|
43
51
|
},
|
|
44
52
|
"devDependencies": {
|
|
45
|
-
"@atlaskit/avatar": "^21.
|
|
53
|
+
"@atlaskit/avatar": "^21.3.0",
|
|
46
54
|
"@atlaskit/docs": "*",
|
|
47
|
-
"@atlaskit/ds-explorations": "^2.
|
|
48
|
-
"@atlaskit/heading": "^1.
|
|
49
|
-
"@atlaskit/lozenge": "11.
|
|
50
|
-
"@atlaskit/modal-dialog": "^12.
|
|
51
|
-
"@atlaskit/primitives": "^0.
|
|
52
|
-
"@atlaskit/section-message": "^6.
|
|
55
|
+
"@atlaskit/ds-explorations": "^2.1.0",
|
|
56
|
+
"@atlaskit/heading": "^1.3.0",
|
|
57
|
+
"@atlaskit/lozenge": "11.4.1",
|
|
58
|
+
"@atlaskit/modal-dialog": "^12.5.0",
|
|
59
|
+
"@atlaskit/primitives": "^0.9.0",
|
|
60
|
+
"@atlaskit/section-message": "^6.4.0",
|
|
53
61
|
"@atlaskit/ssr": "*",
|
|
54
|
-
"@atlaskit/tooltip": "^17.
|
|
62
|
+
"@atlaskit/tooltip": "^17.8.0",
|
|
55
63
|
"@atlaskit/visual-regression": "*",
|
|
56
64
|
"@atlaskit/webdriver-runner": "*",
|
|
57
65
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -63,7 +71,7 @@
|
|
|
63
71
|
"react-dom": "^16.8.0",
|
|
64
72
|
"storybook-addon-performance": "^0.16.0",
|
|
65
73
|
"tiny-invariant": "^1.2.0",
|
|
66
|
-
"typescript": "4.
|
|
74
|
+
"typescript": "~4.9.5"
|
|
67
75
|
},
|
|
68
76
|
"keywords": [
|
|
69
77
|
"atlaskit",
|