@sproutsocial/seeds-react-menu 1.7.2 → 1.7.6

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 (48) hide show
  1. package/.turbo/turbo-build.log +19 -11
  2. package/BUNDLE_OPTIMIZATION.md +307 -0
  3. package/CHANGELOG.md +45 -0
  4. package/dist/esm/chunk-ROQATIB7.js +357 -0
  5. package/dist/esm/chunk-ROQATIB7.js.map +1 -0
  6. package/dist/esm/index.js +261 -2272
  7. package/dist/esm/index.js.map +1 -1
  8. package/dist/esm/v2/index.js +2000 -0
  9. package/dist/esm/v2/index.js.map +1 -0
  10. package/dist/index.d.mts +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js +297 -1990
  13. package/dist/index.js.map +1 -1
  14. package/dist/v2/index.d.mts +96 -0
  15. package/dist/v2/index.d.ts +96 -0
  16. package/dist/v2/index.js +2191 -0
  17. package/dist/v2/index.js.map +1 -0
  18. package/package.json +30 -14
  19. package/src/MenuItem/styles.tsx +7 -0
  20. package/src/MenuRoot/MenuRoot.tsx +0 -1
  21. package/src/v2/Autocomplete/Autocomplete.stories.tsx +609 -0
  22. package/src/v2/Autocomplete/MultiAutocomplete.tsx +453 -0
  23. package/src/v2/Autocomplete/SingleAutocomplete.tsx +362 -0
  24. package/src/v2/Autocomplete/index.ts +2 -0
  25. package/src/v2/Common-V2/ComboboxContent.tsx +448 -0
  26. package/src/v2/Common-V2/MenuGroup.tsx +60 -0
  27. package/src/v2/Common-V2/MenuGroupTypes.ts +30 -0
  28. package/src/v2/Common-V2/MenuHeading.tsx +83 -0
  29. package/src/v2/Common-V2/MenuItem.tsx +138 -0
  30. package/src/v2/Common-V2/Popout.tsx +102 -0
  31. package/src/v2/Common-V2/PopoutTypes.tsx +92 -0
  32. package/src/v2/Common-V2/SelectToggleButton.tsx +99 -0
  33. package/src/v2/Common-V2/index.ts +11 -0
  34. package/src/v2/Common-V2/props.ts +74 -0
  35. package/src/v2/Common-V2/styles.tsx +41 -0
  36. package/src/v2/Common-V2/types.ts +16 -0
  37. package/src/v2/Common-V2/useHighlightedIndex.ts +62 -0
  38. package/src/v2/Common-V2/utils.ts +238 -0
  39. package/src/v2/SearchableSelect/AutocompleteContent.tsx +325 -0
  40. package/src/v2/SearchableSelect/SearchableMultiSelect.tsx +521 -0
  41. package/src/v2/SearchableSelect/SearchableSelect.tsx +389 -0
  42. package/src/v2/SearchableSelect/index.ts +12 -0
  43. package/src/v2/Select/MultiSelect.tsx +404 -0
  44. package/src/v2/Select/Select.stories.tsx +593 -0
  45. package/src/v2/Select/SingleSelect.tsx +272 -0
  46. package/src/v2/Select/index.ts +2 -0
  47. package/src/v2/index.ts +2 -0
  48. package/tsup.config.ts +14 -5
@@ -0,0 +1,448 @@
1
+ import { useRef, useEffect } from "react";
2
+ import { useVirtualizer } from "@tanstack/react-virtual";
3
+ import type { ReactNode, MouseEvent } from "react";
4
+ import { StyledMenuContent } from "../../MenuContent/styles";
5
+ import { MenuItem } from "./MenuItem";
6
+ import { MenuHeading } from "./MenuHeading";
7
+ import { MenuGroup } from "./MenuGroup";
8
+ import { groupItems, isGroupHeading, isToggleItem } from "./utils";
9
+ import type { DataWithId, GroupedItem, ToggleItem } from "./types";
10
+ import type { InputType } from "../../MenuItem/MenuItemTypes";
11
+
12
+ // These types could use some cleanup
13
+ // The normal, virutalized, and grouped content all have slightly different props
14
+ interface ComboboxContentProps<T extends DataWithId>
15
+ extends React.HTMLAttributes<HTMLDivElement> {
16
+ items: GroupedItem<T>[];
17
+ getMenuProps: any;
18
+ getItemProps: any;
19
+ selectedItems: T[];
20
+ highlightedIndex: number;
21
+ renderItem: (item: T) => ReactNode;
22
+ renderGroupHeading?: (label: string) => string;
23
+ EmptyState?: ReactNode;
24
+ itemToKey: (item: T) => string | number;
25
+ itemToString: (item: T | null) => string;
26
+ inputType: InputType;
27
+ selectHeadings?: boolean;
28
+ onHeadingClick?: (groupLabel: string, allSelected: boolean) => void;
29
+ groupBy?: (item: T) => string;
30
+ allData?: T[];
31
+ selectAllItem?: ToggleItem;
32
+ placeholderItem?: ToggleItem;
33
+ }
34
+
35
+ export const VirtualizedComboboxContent = <T extends DataWithId>({
36
+ items,
37
+ getMenuProps,
38
+ getItemProps,
39
+ selectedItems,
40
+ highlightedIndex,
41
+ renderItem,
42
+ renderGroupHeading,
43
+ EmptyState,
44
+ itemToKey,
45
+ inputType,
46
+ selectHeadings = false,
47
+ onHeadingClick,
48
+ groupBy,
49
+ allData,
50
+ selectAllItem,
51
+ ...rest
52
+ }: ComboboxContentProps<T>) => {
53
+ const containerRef = useRef(null);
54
+
55
+ // Check if there are any actual items (not just headings)
56
+ const hasItems = items.some((item) => !isGroupHeading(item));
57
+
58
+ const rowVirtualizer = useVirtualizer({
59
+ count: items.length,
60
+ getScrollElement: () => containerRef.current,
61
+ estimateSize: (index) => {
62
+ const item = items[index];
63
+ return isGroupHeading(item) ? 30 : 35;
64
+ },
65
+ });
66
+
67
+ useEffect(() => {
68
+ if (
69
+ highlightedIndex !== undefined &&
70
+ highlightedIndex !== null &&
71
+ highlightedIndex >= 0
72
+ ) {
73
+ rowVirtualizer.scrollToIndex(highlightedIndex);
74
+ }
75
+ }, [highlightedIndex, rowVirtualizer]);
76
+
77
+ const virtualItems = rowVirtualizer.getVirtualItems();
78
+
79
+ const menuProps = getMenuProps({ ref: containerRef });
80
+ return (
81
+ <div {...menuProps} {...rest}>
82
+ {!hasItems && EmptyState ? (
83
+ <div style={{ padding: "16px" }}>{EmptyState}</div>
84
+ ) : (
85
+ <StyledMenuContent
86
+ style={{
87
+ height: `${rowVirtualizer.getTotalSize()}px`,
88
+ position: "relative",
89
+ }}
90
+ >
91
+ <div
92
+ style={{
93
+ position: "absolute",
94
+ top: 0,
95
+ left: 0,
96
+ width: "100%",
97
+ transform: `translateY(${virtualItems[0]?.start ?? 0}px)`,
98
+ }}
99
+ >
100
+ {virtualItems.map((virtualItem) => {
101
+ const item = items[virtualItem.index];
102
+
103
+ if (isGroupHeading(item)) {
104
+ // Find all items in this group from the full data array (if groupBy is provided)
105
+ const groupItems =
106
+ groupBy && allData
107
+ ? allData.filter(
108
+ (dataItem) => groupBy(dataItem) === item.label
109
+ )
110
+ : [];
111
+
112
+ // Check if all items in the group are selected
113
+ const allSelected =
114
+ groupItems.length > 0 &&
115
+ groupItems.every((groupItem) =>
116
+ selectedItems.includes(groupItem)
117
+ );
118
+
119
+ const headingItemProps = selectHeadings
120
+ ? getItemProps({ index: virtualItem.index })
121
+ : {};
122
+ const handleHeadingClick = (e: MouseEvent) => {
123
+ // Call Downshift's onClick if it exists
124
+ headingItemProps.onClick?.(e);
125
+ // Then call our custom handler
126
+ if (onHeadingClick) {
127
+ onHeadingClick(item.label, allSelected);
128
+ }
129
+ };
130
+
131
+ return (
132
+ <MenuHeading
133
+ key={virtualItem.key}
134
+ {...headingItemProps}
135
+ $highlighted={highlightedIndex === virtualItem.index}
136
+ label={item.label}
137
+ renderGroupHeading={renderGroupHeading}
138
+ selectable={selectHeadings}
139
+ selected={allSelected}
140
+ id={item.id}
141
+ onClick={selectHeadings ? handleHeadingClick : undefined}
142
+ style={{
143
+ width: "100%",
144
+ }}
145
+ />
146
+ );
147
+ }
148
+
149
+ // Handle ToggleItem separately
150
+ if (isToggleItem(item)) {
151
+ const toggleItem = item as ToggleItem;
152
+ const isItemSelected =
153
+ selectAllItem && toggleItem.id === selectAllItem.id
154
+ ? allData &&
155
+ allData.length > 0 &&
156
+ allData.every((item) => selectedItems.includes(item))
157
+ : false;
158
+ return (
159
+ <MenuItem
160
+ key={virtualItem.key}
161
+ inputType={inputType}
162
+ selected={isItemSelected}
163
+ id={toggleItem.id}
164
+ {...getItemProps({ index: virtualItem.index })}
165
+ style={{
166
+ width: "100%",
167
+ }}
168
+ $highlighted={highlightedIndex === virtualItem.index}
169
+ $active={false}
170
+ >
171
+ {toggleItem.label}
172
+ </MenuItem>
173
+ );
174
+ }
175
+
176
+ const dataItem = item as T;
177
+ const isItemSelected = selectedItems.includes(dataItem);
178
+ return (
179
+ <MenuItem
180
+ key={virtualItem.key}
181
+ inputType={inputType}
182
+ selected={isItemSelected}
183
+ id={itemToKey(dataItem)}
184
+ {...getItemProps({ index: virtualItem.index })}
185
+ style={{
186
+ width: "100%",
187
+ }}
188
+ $highlighted={highlightedIndex === virtualItem.index}
189
+ $active={false}
190
+ >
191
+ {renderItem(dataItem)}
192
+ </MenuItem>
193
+ );
194
+ })}
195
+ </div>
196
+ </StyledMenuContent>
197
+ )}
198
+ </div>
199
+ );
200
+ };
201
+
202
+ export const NormalComboboxContent = <T extends DataWithId>({
203
+ items,
204
+ getMenuProps,
205
+ getItemProps,
206
+ selectedItems,
207
+ highlightedIndex,
208
+ renderItem,
209
+ renderGroupHeading,
210
+ EmptyState,
211
+ itemToKey,
212
+ inputType,
213
+ selectHeadings = false,
214
+ onHeadingClick,
215
+ groupBy,
216
+ allData,
217
+ selectAllItem,
218
+ ...rest
219
+ }: ComboboxContentProps<T>) => {
220
+ // Check if there are any actual items (not just headings)
221
+ const hasItems = items.some((item) => !isGroupHeading(item));
222
+
223
+ const menuProps = getMenuProps();
224
+
225
+ return (
226
+ <div {...menuProps} {...rest}>
227
+ {!hasItems && EmptyState ? (
228
+ <div style={{ padding: "16px" }}>{EmptyState}</div>
229
+ ) : (
230
+ <StyledMenuContent
231
+ style={{
232
+ position: "relative",
233
+ }}
234
+ >
235
+ {items.map((item, index) => {
236
+ if (isGroupHeading(item)) {
237
+ // Find all items in this group from the full data array (if groupBy is provided)
238
+ const groupItems =
239
+ groupBy && allData
240
+ ? allData.filter(
241
+ (dataItem) => groupBy(dataItem) === item.label
242
+ )
243
+ : [];
244
+
245
+ // Check if all items in the group are selected
246
+ const allSelected =
247
+ groupItems.length > 0 &&
248
+ groupItems.every((groupItem) =>
249
+ selectedItems.includes(groupItem)
250
+ );
251
+
252
+ const headingItemProps = selectHeadings
253
+ ? getItemProps({ index })
254
+ : {};
255
+ const handleHeadingClick = (e: MouseEvent) => {
256
+ // Call Downshift's onClick if it exists
257
+ headingItemProps.onClick?.(e);
258
+ // Then call our custom handler
259
+ if (onHeadingClick) {
260
+ onHeadingClick(item.label, allSelected);
261
+ }
262
+ };
263
+
264
+ // This should be renamed MenuHeadingItem, it is always selectable
265
+ return (
266
+ <MenuHeading
267
+ key={index}
268
+ {...headingItemProps}
269
+ $highlighted={highlightedIndex === index}
270
+ label={item.label}
271
+ renderGroupHeading={renderGroupHeading}
272
+ selectable={selectHeadings}
273
+ selected={allSelected}
274
+ id={item.id}
275
+ onClick={selectHeadings ? handleHeadingClick : undefined}
276
+ />
277
+ );
278
+ }
279
+
280
+ // Handle ToggleItem separately
281
+ if (isToggleItem(item)) {
282
+ const toggleItem = item as ToggleItem;
283
+ const isItemSelected =
284
+ selectAllItem && toggleItem.id === selectAllItem.id
285
+ ? allData &&
286
+ allData.length > 0 &&
287
+ allData.every((item) => selectedItems.includes(item))
288
+ : false;
289
+
290
+ return (
291
+ <MenuItem
292
+ key={index}
293
+ {...getItemProps({ index })}
294
+ $highlighted={highlightedIndex === index}
295
+ $active={false}
296
+ inputType={inputType}
297
+ selected={isItemSelected}
298
+ id={toggleItem.id}
299
+ >
300
+ {toggleItem.label}
301
+ </MenuItem>
302
+ );
303
+ }
304
+
305
+ const dataItem = item as T;
306
+ const isItemSelected = selectedItems.includes(dataItem);
307
+ return (
308
+ <MenuItem
309
+ key={index}
310
+ {...getItemProps({ index })}
311
+ $highlighted={highlightedIndex === index}
312
+ $active={false}
313
+ inputType={inputType}
314
+ selected={isItemSelected}
315
+ id={itemToKey(dataItem)}
316
+ >
317
+ {renderItem(dataItem)}
318
+ </MenuItem>
319
+ );
320
+ })}
321
+ </StyledMenuContent>
322
+ )}
323
+ </div>
324
+ );
325
+ };
326
+
327
+ export const GroupedComboboxContent = <T extends DataWithId>({
328
+ items,
329
+ getMenuProps,
330
+ getItemProps,
331
+ highlightedIndex,
332
+ selectedItems,
333
+ renderItem,
334
+ renderGroupHeading,
335
+ EmptyState,
336
+ itemToKey,
337
+ itemToString,
338
+ inputType,
339
+ onHeadingClick,
340
+ groupBy,
341
+ allData,
342
+ selectAllItem,
343
+ placeholderItem,
344
+ ...rest
345
+ }: ComboboxContentProps<T>) => {
346
+ // Check if there are any actual items (not just headings)
347
+ const hasItems = items.some((item) => !isGroupHeading(item));
348
+
349
+ const menuProps = getMenuProps();
350
+
351
+ const groupedItems = groupItems(
352
+ items as T[],
353
+ groupBy as (item: T) => string,
354
+ allData
355
+ );
356
+ // If we have a placeholder item, we need to account for it in the item indexing
357
+ let actualItemIndex = placeholderItem ? 1 : 0;
358
+ return (
359
+ <div {...menuProps} {...rest}>
360
+ {!hasItems && EmptyState ? (
361
+ <div style={{ padding: "16px" }}>{EmptyState}</div>
362
+ ) : (
363
+ <StyledMenuContent style={{ position: "relative" }}>
364
+ {placeholderItem && (
365
+ <MenuItem
366
+ key="placeholder-item"
367
+ {...getItemProps({ index: 0 })}
368
+ $highlighted={highlightedIndex === 0}
369
+ $active={false}
370
+ inputType={inputType}
371
+ selected={selectedItems.length === 0}
372
+ id={placeholderItem.id}
373
+ data-item-index={0}
374
+ >
375
+ {placeholderItem.label}
376
+ </MenuItem>
377
+ )}
378
+ {Array.from(groupedItems.keys()).map((group, groupIndex) => {
379
+ return (
380
+ <MenuGroup
381
+ id={`menu-group-${group}`}
382
+ key={groupIndex}
383
+ title={renderGroupHeading ? renderGroupHeading(group) : group}
384
+ >
385
+ {groupedItems.get(group)?.map((item) => {
386
+ const isItemSelected = selectedItems.includes(item);
387
+ const itemIndex = actualItemIndex;
388
+ actualItemIndex += 1;
389
+ return (
390
+ <MenuItem
391
+ key={itemIndex}
392
+ {...getItemProps({ index: itemIndex })}
393
+ $highlighted={highlightedIndex === itemIndex}
394
+ $active={false}
395
+ inputType={inputType}
396
+ selected={isItemSelected}
397
+ id={itemToKey(item)}
398
+ data-item-index={itemIndex}
399
+ >
400
+ {renderItem(item)}
401
+ </MenuItem>
402
+ );
403
+ })}
404
+ </MenuGroup>
405
+ );
406
+ })}
407
+ </StyledMenuContent>
408
+ )}
409
+ </div>
410
+ );
411
+ };
412
+
413
+ // Combobox content is not rendered until the menu is open
414
+ // The menus should be updated to only add aria-controls to the menu when it is open
415
+ // Otherwise they should override it to undefined
416
+ export const ComboboxContent = <T extends DataWithId>({
417
+ isVirtualized = false,
418
+ groupBy,
419
+ selectHeadings = false,
420
+ ...props
421
+ }: ComboboxContentProps<T> & { isVirtualized?: boolean }) => {
422
+ if (isVirtualized) {
423
+ return (
424
+ <VirtualizedComboboxContent
425
+ groupBy={groupBy}
426
+ selectHeadings={selectHeadings}
427
+ {...props}
428
+ />
429
+ );
430
+ }
431
+ if (groupBy && !selectHeadings) {
432
+ return (
433
+ <GroupedComboboxContent
434
+ groupBy={groupBy}
435
+ selectHeadings={selectHeadings}
436
+ {...props}
437
+ />
438
+ );
439
+ }
440
+
441
+ return (
442
+ <NormalComboboxContent
443
+ selectHeadings={selectHeadings}
444
+ groupBy={groupBy}
445
+ {...props}
446
+ />
447
+ );
448
+ };
@@ -0,0 +1,60 @@
1
+ import React from "react";
2
+ import type { MenuItemProps } from "./MenuItem";
3
+ import type { TypeMenuGroupProps } from "./MenuGroupTypes";
4
+ import { StyledMenuGroup, StyledTitle, StyledMenuGroupUl } from "./styles";
5
+
6
+ /**
7
+ * @link https://seeds.sproutsocial.com/components/seeds-react-menu/#menugroup
8
+ *
9
+ * @description MenuGroup is used to group lists of {@link https://seeds.sproutsocial.com/components/seeds-react-menu/#menuitem MenuItems}.
10
+ *
11
+ * @example
12
+ * <ActionMenu>
13
+ * <MenuContent>
14
+ * <MenuGroup title="Group 1" id="1">
15
+ * <MenuItem>Item 1</MenuItem>
16
+ * </MenuGroup>
17
+ * <MenuGroup title="Group 2" id="2">
18
+ * <MenuItem>Item 2</MenuItem>
19
+ * </MenuGroup>
20
+ * </MenuContent>
21
+ * </ActionMenu>
22
+ *
23
+ * @see {@link https://seeds.sproutsocial.com/components/seeds-react-menu/#menuitem MenuItem}
24
+ * @see {@link https://seeds.sproutsocial.com/components/seeds-react-menu/#menucontent MenuContent}
25
+ */
26
+
27
+ const MenuGroup = ({
28
+ titleAs = "h3",
29
+ children,
30
+ title,
31
+ color,
32
+ id,
33
+ ...rest
34
+ }: TypeMenuGroupProps) => {
35
+ // Generate a unique ID for the title
36
+ const titleId = `menu-group-title-${Math.random().toString(36).slice(2, 11)}`;
37
+
38
+ return (
39
+ <StyledMenuGroup
40
+ role="group"
41
+ id={id}
42
+ aria-labelledby={title ? titleId : undefined}
43
+ // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.
44
+ // @ts-expect-error Copy Pasted from original MenuGroup
45
+ color={color}
46
+ {...rest}
47
+ >
48
+ {title && (
49
+ <StyledTitle role="heading" as={titleAs} id={titleId}>
50
+ {title}
51
+ </StyledTitle>
52
+ )}
53
+ <StyledMenuGroupUl>{children}</StyledMenuGroupUl>
54
+ </StyledMenuGroup>
55
+ );
56
+ };
57
+
58
+ MenuGroup.__MENU_PRIMITIVE_TYPE = "MenuGroup";
59
+
60
+ export { MenuGroup };
@@ -0,0 +1,30 @@
1
+ import type {
2
+ TypeBorderSystemProps,
3
+ TypeColorSystemProps,
4
+ TypeFlexboxSystemProps,
5
+ TypeGridSystemProps,
6
+ TypeLayoutSystemProps,
7
+ TypePositionSystemProps,
8
+ TypeSpaceSystemProps,
9
+ TypeTypographySystemProps,
10
+ } from "@sproutsocial/seeds-react-system-props";
11
+
12
+ export interface TypeMenuGroupStyledProps
13
+ extends TypeBorderSystemProps,
14
+ TypeColorSystemProps,
15
+ TypeFlexboxSystemProps,
16
+ TypeGridSystemProps,
17
+ TypeLayoutSystemProps,
18
+ TypePositionSystemProps,
19
+ TypeSpaceSystemProps,
20
+ TypeTypographySystemProps {}
21
+
22
+ export interface TypeStyledMenuGroupProps extends TypeMenuGroupStyledProps {}
23
+ export interface TypeMenuGroupProps
24
+ extends TypeStyledMenuGroupProps,
25
+ Omit<React.ComponentPropsWithoutRef<"ul">, "color"> {
26
+ id: string;
27
+ title?: string;
28
+ titleAs?: string | React.ComponentType<any>;
29
+ children: React.ReactNode;
30
+ }
@@ -0,0 +1,83 @@
1
+ import type { ReactNode, CSSProperties } from "react";
2
+ import { MenuItem } from "./MenuItem";
3
+ import styled from "styled-components";
4
+ import Box from "@sproutsocial/seeds-react-box";
5
+
6
+ export interface MenuHeadingProps {
7
+ label: string;
8
+ renderGroupHeading?: (label: string) => string;
9
+ virtualizedStyles?: {
10
+ position: "absolute";
11
+ top: number;
12
+ left: number;
13
+ width: string;
14
+ height: string;
15
+ transform: string;
16
+ };
17
+ style?: CSSProperties;
18
+ selectable?: boolean;
19
+ $highlighted?: boolean;
20
+ selected?: boolean;
21
+ id?: string | number;
22
+ onClick?: () => void;
23
+ [key: string]: any; // For spreading getItemProps and other props
24
+ }
25
+
26
+ interface TypeMenuHeaderContainerProps {
27
+ $leftAction?: boolean;
28
+ }
29
+
30
+ export const MenuHeaderContainer = styled(Box)<TypeMenuHeaderContainerProps>`
31
+ border-color: ${({ theme }) => theme.colors.container.border.base};
32
+ border-bottom-width: 1px;
33
+ border-bottom-style: solid;
34
+ font-size: ${({ theme }) => theme.typography[200].fontSize};
35
+ display: flex;
36
+ flex-direction: column;
37
+ padding: ${({ theme }) => theme.space[350]} ${({ theme }) => theme.space[400]};
38
+ `;
39
+
40
+ export const MenuHeading = ({
41
+ label,
42
+ renderGroupHeading,
43
+ style,
44
+ selectable = false,
45
+ $highlighted = false,
46
+ selected = false,
47
+ id,
48
+ onClick,
49
+ ...props
50
+ }: MenuHeadingProps) => {
51
+ const combinedStyle: CSSProperties = {
52
+ fontWeight: "bold",
53
+ ...style,
54
+ };
55
+
56
+ if (selectable) {
57
+ return (
58
+ <MenuItem
59
+ style={combinedStyle}
60
+ $highlighted={$highlighted}
61
+ $active={false}
62
+ inputType="checkbox"
63
+ selected={selected}
64
+ id={id}
65
+ onClick={onClick}
66
+ {...props}
67
+ >
68
+ {renderGroupHeading ? renderGroupHeading(label) : label}
69
+ </MenuItem>
70
+ );
71
+ }
72
+
73
+ return (
74
+ <MenuHeaderContainer
75
+ style={combinedStyle}
76
+ role="option"
77
+ aria-disabled={true}
78
+ aria-selected={false}
79
+ >
80
+ {renderGroupHeading ? renderGroupHeading(label) : label}
81
+ </MenuHeaderContainer>
82
+ );
83
+ };