@atlaskit/dropdown-menu 12.11.1 → 12.12.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 +10 -1
- package/README.md +2 -1
- package/__perf__/default.tsx +12 -12
- package/__perf__/dropdown-menu.tsx +165 -195
- package/codemods/11.0.0-lite-mode.tsx +23 -23
- package/codemods/__tests__/11.0.0-lite-mode.test.tsx +7 -7
- package/codemods/__tests__/convert-position.test.tsx +70 -70
- package/codemods/__tests__/convert-triggerType.test.tsx +35 -35
- package/codemods/__tests__/deprecate-items.test.tsx +28 -28
- package/codemods/__tests__/deprecate-onItemActivated.test.tsx +28 -28
- package/codemods/__tests__/deprecate-onPositioned.test.tsx +28 -28
- package/codemods/__tests__/deprecate-shouldFitContainer.tsx +28 -28
- package/codemods/__tests__/rename-imports.tsx +48 -54
- package/codemods/__tests__/replace-position-to-placement.test.tsx +21 -21
- package/codemods/__tests__/replace-shouldAllowMultipleLine.test.tsx +28 -28
- package/codemods/__tests__/update-component-callsites.tsx +18 -20
- package/codemods/migrates/convert-trigger-type.tsx +35 -49
- package/codemods/migrates/deprecate-autoFocus.tsx +3 -11
- package/codemods/migrates/deprecate-boundariesElement.tsx +2 -2
- package/codemods/migrates/deprecate-isCompact.tsx +3 -11
- package/codemods/migrates/deprecate-isHidden.tsx +3 -11
- package/codemods/migrates/deprecate-isMenuFixed.tsx +1 -4
- package/codemods/migrates/deprecate-items.tsx +1 -4
- package/codemods/migrates/deprecate-onItemActivated.tsx +2 -2
- package/codemods/migrates/deprecate-onPositioned.tsx +2 -2
- package/codemods/migrates/deprecate-shouldFitContainer.tsx +2 -2
- package/codemods/migrates/rename-imports.tsx +12 -12
- package/codemods/migrates/replace-position-to-placement.tsx +15 -26
- package/codemods/migrates/replace-shouldAllowMultiline.tsx +21 -35
- package/codemods/migrates/update-component-callsites.tsx +6 -6
- package/codemods/utils/convert-position.tsx +14 -14
- package/codemods/utils/create-rename-import.tsx +32 -37
- package/codemods/utils/create-update-callsite.tsx +25 -28
- package/dist/cjs/dropdown-menu.js +26 -6
- package/dist/cjs/internal/components/group-title.js +4 -0
- package/dist/cjs/internal/components/menu-wrapper.js +2 -0
- package/dist/es2019/dropdown-menu.js +25 -6
- package/dist/es2019/internal/components/group-title.js +3 -0
- package/dist/es2019/internal/components/menu-wrapper.js +2 -0
- package/dist/esm/dropdown-menu.js +26 -6
- package/dist/esm/internal/components/group-title.js +3 -0
- package/dist/esm/internal/components/menu-wrapper.js +2 -0
- package/dist/types/dropdown-menu.d.ts +1 -1
- package/dist/types/internal/hooks/use-radio-state.d.ts +1 -1
- package/dist/types/types.d.ts +19 -3
- package/dist/types-ts4.5/dropdown-menu.d.ts +1 -1
- package/dist/types-ts4.5/internal/hooks/use-radio-state.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +19 -3
- package/package.json +110 -110
- package/report.api.md +141 -145
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/dropdown-menu"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -31,155 +32,154 @@ import type { SectionProps as SectionProps_2 } from '@atlaskit/menu/types';
|
|
|
31
32
|
import type { TriggerProps } from '@atlaskit/popup/types';
|
|
32
33
|
|
|
33
34
|
// @public (undocumented)
|
|
34
|
-
export interface CustomTriggerProps<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
triggerRef: Ref<TriggerElement>;
|
|
35
|
+
export interface CustomTriggerProps<TriggerElement extends HTMLElement = HTMLElement>
|
|
36
|
+
extends Omit<TriggerProps, 'ref'> {
|
|
37
|
+
isSelected?: boolean;
|
|
38
|
+
onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void;
|
|
39
|
+
testId?: string;
|
|
40
|
+
triggerRef: Ref<TriggerElement>;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// @public
|
|
44
44
|
export const DropdownItem: React_2.ForwardRefExoticComponent<
|
|
45
|
-
|
|
45
|
+
DropdownItemProps & React_2.RefAttributes<HTMLElement>
|
|
46
46
|
>;
|
|
47
47
|
|
|
48
48
|
// @public
|
|
49
49
|
export const DropdownItemCheckbox: ({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
children,
|
|
51
|
+
defaultSelected,
|
|
52
|
+
description,
|
|
53
|
+
id,
|
|
54
|
+
isDisabled,
|
|
55
|
+
isSelected,
|
|
56
|
+
onClick: providedOnClick,
|
|
57
|
+
shouldDescriptionWrap,
|
|
58
|
+
shouldTitleWrap,
|
|
59
|
+
testId,
|
|
60
|
+
...rest
|
|
61
61
|
}: DropdownItemCheckboxProps) => JSX.Element;
|
|
62
62
|
|
|
63
63
|
// @public
|
|
64
64
|
export const DropdownItemCheckboxGroup: ({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
children,
|
|
66
|
+
hasSeparator,
|
|
67
|
+
id,
|
|
68
|
+
isList,
|
|
69
|
+
isScrollable,
|
|
70
|
+
overrides,
|
|
71
|
+
testId,
|
|
72
|
+
title,
|
|
73
|
+
...rest
|
|
74
74
|
}: DropdownItemCheckboxGroupProps) => JSX.Element;
|
|
75
75
|
|
|
76
76
|
// @public (undocumented)
|
|
77
77
|
interface DropdownItemCheckboxGroupProps extends SectionProps {
|
|
78
|
-
|
|
78
|
+
id: string;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// @public (undocumented)
|
|
82
82
|
interface DropdownItemCheckboxProps {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
children: React.ReactNode;
|
|
84
|
+
defaultSelected?: boolean;
|
|
85
|
+
description?: JSX.Element | string;
|
|
86
|
+
id: string;
|
|
87
|
+
isDisabled?: boolean;
|
|
88
|
+
isSelected?: boolean;
|
|
89
|
+
onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void;
|
|
90
|
+
shouldDescriptionWrap?: boolean;
|
|
91
|
+
shouldTitleWrap?: boolean;
|
|
92
|
+
testId?: string;
|
|
93
|
+
title?: string;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
export { DropdownItemGroup };
|
|
97
97
|
|
|
98
98
|
// @public (undocumented)
|
|
99
99
|
export interface DropdownItemProps {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
100
|
+
children: React.ReactNode;
|
|
101
|
+
component?: CustomItemProps['component'];
|
|
102
|
+
description?: JSX.Element | string;
|
|
103
|
+
elemAfter?: React.ReactNode;
|
|
104
|
+
elemBefore?: React.ReactNode;
|
|
105
|
+
href?: string;
|
|
106
|
+
isDisabled?: boolean;
|
|
107
|
+
isSelected?: boolean;
|
|
108
|
+
onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void;
|
|
109
|
+
rel?: string;
|
|
110
|
+
shouldDescriptionWrap?: boolean;
|
|
111
|
+
shouldTitleWrap?: boolean;
|
|
112
|
+
target?: string;
|
|
113
|
+
testId?: string;
|
|
114
|
+
title?: string;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// @public
|
|
118
118
|
export const DropdownItemRadio: ({
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
119
|
+
children,
|
|
120
|
+
defaultSelected,
|
|
121
|
+
testId,
|
|
122
|
+
id,
|
|
123
|
+
title,
|
|
124
|
+
description,
|
|
125
|
+
isDisabled,
|
|
126
|
+
isSelected,
|
|
127
|
+
onClick: providedOnClick,
|
|
128
|
+
shouldDescriptionWrap,
|
|
129
|
+
shouldTitleWrap,
|
|
130
|
+
...rest
|
|
131
131
|
}: DropdownItemRadioProps) => JSX.Element;
|
|
132
132
|
|
|
133
133
|
// @public
|
|
134
134
|
export const DropdownItemRadioGroup: ({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
children,
|
|
136
|
+
hasSeparator,
|
|
137
|
+
id,
|
|
138
|
+
isList,
|
|
139
|
+
isScrollable,
|
|
140
|
+
overrides,
|
|
141
|
+
testId,
|
|
142
|
+
title,
|
|
143
|
+
...rest
|
|
144
144
|
}: DropdownItemRadioGroupProps) => JSX.Element;
|
|
145
145
|
|
|
146
146
|
// @public (undocumented)
|
|
147
147
|
interface DropdownItemRadioGroupProps extends SectionProps {
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
// (undocumented)
|
|
149
|
+
id: string;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
// @public (undocumented)
|
|
153
153
|
interface DropdownItemRadioProps {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
154
|
+
children: React.ReactNode;
|
|
155
|
+
defaultSelected?: boolean;
|
|
156
|
+
description?: JSX.Element | string;
|
|
157
|
+
id: string;
|
|
158
|
+
isDisabled?: boolean;
|
|
159
|
+
isSelected?: boolean;
|
|
160
|
+
onClick?: (e: KeyboardEvent_2 | MouseEvent_2) => void;
|
|
161
|
+
shouldDescriptionWrap?: boolean;
|
|
162
|
+
shouldTitleWrap?: boolean;
|
|
163
|
+
testId?: string;
|
|
164
|
+
title?: string;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
// @public
|
|
168
168
|
const DropdownMenu: <T extends HTMLElement = HTMLElement>({
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
169
|
+
autoFocus,
|
|
170
|
+
children,
|
|
171
|
+
defaultOpen,
|
|
172
|
+
isLoading,
|
|
173
|
+
isOpen,
|
|
174
|
+
onOpenChange,
|
|
175
|
+
placement,
|
|
176
|
+
shouldFlip,
|
|
177
|
+
shouldRenderToParent,
|
|
178
|
+
spacing,
|
|
179
|
+
statusLabel,
|
|
180
|
+
testId,
|
|
181
|
+
trigger,
|
|
182
|
+
zIndex,
|
|
183
183
|
}: DropdownMenuProps<T>) => JSX.Element;
|
|
184
184
|
export default DropdownMenu;
|
|
185
185
|
|
|
@@ -187,53 +187,49 @@ export default DropdownMenu;
|
|
|
187
187
|
export interface DropdownMenuGroupProps extends SectionProps_2 {}
|
|
188
188
|
|
|
189
189
|
// @public (undocumented)
|
|
190
|
-
export interface DropdownMenuProps<
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
trigger?:
|
|
207
|
-
| ((triggerButtonProps: CustomTriggerProps<TriggerElement>) => ReactElement)
|
|
208
|
-
| string;
|
|
209
|
-
zIndex?: number;
|
|
190
|
+
export interface DropdownMenuProps<TriggerElement extends HTMLElement = HTMLElement> {
|
|
191
|
+
appearance?: 'default' | 'tall';
|
|
192
|
+
autoFocus?: boolean;
|
|
193
|
+
children?: ReactNode;
|
|
194
|
+
defaultOpen?: boolean;
|
|
195
|
+
isLoading?: boolean;
|
|
196
|
+
isOpen?: boolean;
|
|
197
|
+
onOpenChange?: (args: OnOpenChangeArgs) => void;
|
|
198
|
+
placement?: Placement;
|
|
199
|
+
shouldFlip?: boolean;
|
|
200
|
+
shouldRenderToParent?: boolean;
|
|
201
|
+
spacing?: Extract<MenuGroupProps['spacing'], 'compact' | 'cozy'>;
|
|
202
|
+
statusLabel?: string;
|
|
203
|
+
testId?: string;
|
|
204
|
+
trigger?: ((triggerButtonProps: CustomTriggerProps<TriggerElement>) => ReactElement) | string;
|
|
205
|
+
zIndex?: number;
|
|
210
206
|
}
|
|
211
207
|
|
|
212
208
|
// @public (undocumented)
|
|
213
209
|
export interface OnOpenChangeArgs {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
210
|
+
// (undocumented)
|
|
211
|
+
event: KeyboardEvent_2 | MouseEvent_2;
|
|
212
|
+
// (undocumented)
|
|
213
|
+
isOpen: boolean;
|
|
218
214
|
}
|
|
219
215
|
|
|
220
216
|
// @public (undocumented)
|
|
221
217
|
type Placement =
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
218
|
+
| 'auto'
|
|
219
|
+
| 'auto-end'
|
|
220
|
+
| 'auto-start'
|
|
221
|
+
| 'bottom'
|
|
222
|
+
| 'bottom-end'
|
|
223
|
+
| 'bottom-start'
|
|
224
|
+
| 'left'
|
|
225
|
+
| 'left-end'
|
|
226
|
+
| 'left-start'
|
|
227
|
+
| 'right'
|
|
228
|
+
| 'right-end'
|
|
229
|
+
| 'right-start'
|
|
230
|
+
| 'top'
|
|
231
|
+
| 'top-end'
|
|
232
|
+
| 'top-start';
|
|
237
233
|
|
|
238
234
|
// (No @packageDocumentation comment for this package)
|
|
239
235
|
```
|
|
@@ -246,8 +242,8 @@ type Placement =
|
|
|
246
242
|
|
|
247
243
|
```json
|
|
248
244
|
{
|
|
249
|
-
|
|
250
|
-
|
|
245
|
+
"react": "^16.8.0",
|
|
246
|
+
"react-dom": "^16.8.0"
|
|
251
247
|
}
|
|
252
248
|
```
|
|
253
249
|
|