@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.
Files changed (50) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/README.md +2 -1
  3. package/__perf__/default.tsx +12 -12
  4. package/__perf__/dropdown-menu.tsx +165 -195
  5. package/codemods/11.0.0-lite-mode.tsx +23 -23
  6. package/codemods/__tests__/11.0.0-lite-mode.test.tsx +7 -7
  7. package/codemods/__tests__/convert-position.test.tsx +70 -70
  8. package/codemods/__tests__/convert-triggerType.test.tsx +35 -35
  9. package/codemods/__tests__/deprecate-items.test.tsx +28 -28
  10. package/codemods/__tests__/deprecate-onItemActivated.test.tsx +28 -28
  11. package/codemods/__tests__/deprecate-onPositioned.test.tsx +28 -28
  12. package/codemods/__tests__/deprecate-shouldFitContainer.tsx +28 -28
  13. package/codemods/__tests__/rename-imports.tsx +48 -54
  14. package/codemods/__tests__/replace-position-to-placement.test.tsx +21 -21
  15. package/codemods/__tests__/replace-shouldAllowMultipleLine.test.tsx +28 -28
  16. package/codemods/__tests__/update-component-callsites.tsx +18 -20
  17. package/codemods/migrates/convert-trigger-type.tsx +35 -49
  18. package/codemods/migrates/deprecate-autoFocus.tsx +3 -11
  19. package/codemods/migrates/deprecate-boundariesElement.tsx +2 -2
  20. package/codemods/migrates/deprecate-isCompact.tsx +3 -11
  21. package/codemods/migrates/deprecate-isHidden.tsx +3 -11
  22. package/codemods/migrates/deprecate-isMenuFixed.tsx +1 -4
  23. package/codemods/migrates/deprecate-items.tsx +1 -4
  24. package/codemods/migrates/deprecate-onItemActivated.tsx +2 -2
  25. package/codemods/migrates/deprecate-onPositioned.tsx +2 -2
  26. package/codemods/migrates/deprecate-shouldFitContainer.tsx +2 -2
  27. package/codemods/migrates/rename-imports.tsx +12 -12
  28. package/codemods/migrates/replace-position-to-placement.tsx +15 -26
  29. package/codemods/migrates/replace-shouldAllowMultiline.tsx +21 -35
  30. package/codemods/migrates/update-component-callsites.tsx +6 -6
  31. package/codemods/utils/convert-position.tsx +14 -14
  32. package/codemods/utils/create-rename-import.tsx +32 -37
  33. package/codemods/utils/create-update-callsite.tsx +25 -28
  34. package/dist/cjs/dropdown-menu.js +26 -6
  35. package/dist/cjs/internal/components/group-title.js +4 -0
  36. package/dist/cjs/internal/components/menu-wrapper.js +2 -0
  37. package/dist/es2019/dropdown-menu.js +25 -6
  38. package/dist/es2019/internal/components/group-title.js +3 -0
  39. package/dist/es2019/internal/components/menu-wrapper.js +2 -0
  40. package/dist/esm/dropdown-menu.js +26 -6
  41. package/dist/esm/internal/components/group-title.js +3 -0
  42. package/dist/esm/internal/components/menu-wrapper.js +2 -0
  43. package/dist/types/dropdown-menu.d.ts +1 -1
  44. package/dist/types/internal/hooks/use-radio-state.d.ts +1 -1
  45. package/dist/types/types.d.ts +19 -3
  46. package/dist/types-ts4.5/dropdown-menu.d.ts +1 -1
  47. package/dist/types-ts4.5/internal/hooks/use-radio-state.d.ts +1 -1
  48. package/dist/types-ts4.5/types.d.ts +19 -3
  49. package/package.json +110 -110
  50. 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 [API Extractor](https://api-extractor.com/).
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
- 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>;
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
- DropdownItemProps & React_2.RefAttributes<HTMLElement>
45
+ DropdownItemProps & React_2.RefAttributes<HTMLElement>
46
46
  >;
47
47
 
48
48
  // @public
49
49
  export const DropdownItemCheckbox: ({
50
- children,
51
- defaultSelected,
52
- description,
53
- id,
54
- isDisabled,
55
- isSelected,
56
- onClick: providedOnClick,
57
- shouldDescriptionWrap,
58
- shouldTitleWrap,
59
- testId,
60
- ...rest
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
- children,
66
- hasSeparator,
67
- id,
68
- isList,
69
- isScrollable,
70
- overrides,
71
- testId,
72
- title,
73
- ...rest
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
- id: string;
78
+ id: string;
79
79
  }
80
80
 
81
81
  // @public (undocumented)
82
82
  interface DropdownItemCheckboxProps {
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;
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
- 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;
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
- children,
120
- defaultSelected,
121
- testId,
122
- id,
123
- title,
124
- description,
125
- isDisabled,
126
- isSelected,
127
- onClick: providedOnClick,
128
- shouldDescriptionWrap,
129
- shouldTitleWrap,
130
- ...rest
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
- children,
136
- hasSeparator,
137
- id,
138
- isList,
139
- isScrollable,
140
- overrides,
141
- testId,
142
- title,
143
- ...rest
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
- // (undocumented)
149
- id: string;
148
+ // (undocumented)
149
+ id: string;
150
150
  }
151
151
 
152
152
  // @public (undocumented)
153
153
  interface DropdownItemRadioProps {
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;
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
- 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,
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
- TriggerElement extends HTMLElement = HTMLElement,
192
- > {
193
- appearance?: 'default' | 'tall';
194
- autoFocus?: boolean;
195
- children?: ReactNode;
196
- defaultOpen?: boolean;
197
- isLoading?: boolean;
198
- isOpen?: boolean;
199
- onOpenChange?: (args: OnOpenChangeArgs) => void;
200
- placement?: Placement;
201
- shouldFlip?: boolean;
202
- shouldRenderToParent?: boolean;
203
- spacing?: Extract<MenuGroupProps['spacing'], 'compact' | 'cozy'>;
204
- statusLabel?: string;
205
- testId?: string;
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
- // (undocumented)
215
- event: KeyboardEvent_2 | MouseEvent_2;
216
- // (undocumented)
217
- isOpen: boolean;
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
- | 'auto'
223
- | 'auto-end'
224
- | 'auto-start'
225
- | 'bottom'
226
- | 'bottom-end'
227
- | 'bottom-start'
228
- | 'left'
229
- | 'left-end'
230
- | 'left-start'
231
- | 'right'
232
- | 'right-end'
233
- | 'right-start'
234
- | 'top'
235
- | 'top-end'
236
- | 'top-start';
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
- "react": "^16.8.0",
250
- "react-dom": "^16.8.0"
245
+ "react": "^16.8.0",
246
+ "react-dom": "^16.8.0"
251
247
  }
252
248
  ```
253
249