@sproutsocial/seeds-react-menu 0.5.0 → 1.0.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 (104) hide show
  1. package/.turbo/turbo-build.log +10 -10
  2. package/CHANGELOG.md +72 -0
  3. package/dist/esm/index.js +1529 -440
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/index.d.mts +275 -92
  6. package/dist/index.d.ts +275 -92
  7. package/dist/index.js +1558 -444
  8. package/dist/index.js.map +1 -1
  9. package/package.json +15 -12
  10. package/src/ActionMenu/ActionMenu.stories.tsx +422 -0
  11. package/src/ActionMenu/ActionMenu.tsx +24 -27
  12. package/src/ActionMenu/ActionMenuTypes.ts +8 -7
  13. package/src/ActionMenu/__tests__/ActionMenu.test.tsx +17 -8
  14. package/src/ActionMenu/__tests__/ActionMenu.typetest.tsx +8 -8
  15. package/src/Autocomplete/Autocomplete.stories.tsx +38 -3
  16. package/src/Autocomplete/Autocomplete.tsx +15 -80
  17. package/src/Autocomplete/AutocompleteInput.tsx +18 -27
  18. package/src/Autocomplete/AutocompleteTokenInput.tsx +50 -0
  19. package/src/Autocomplete/AutocompleteTypes.ts +25 -12
  20. package/src/Autocomplete/MultiAutocomplete.tsx +188 -0
  21. package/src/Autocomplete/SingleAutocomplete.tsx +74 -0
  22. package/src/Autocomplete/__tests__/Autocomplete.test.tsx +207 -3
  23. package/src/Autocomplete/__tests__/Autocomplete.typetest.tsx +90 -8
  24. package/src/MenuContent/MenuContent.stories.tsx +164 -0
  25. package/src/MenuContent/MenuContent.tsx +28 -12
  26. package/src/MenuContent/MenuContentTypes.ts +6 -4
  27. package/src/MenuContent/__tests__/MenuContent.typetest.tsx +8 -8
  28. package/src/MenuContext.tsx +192 -37
  29. package/src/MenuFooter/MenuFooter.stories.tsx +202 -0
  30. package/src/MenuFooter/__tests__/MenuFooter.test.tsx +16 -11
  31. package/src/MenuFooter/styles.tsx +1 -1
  32. package/src/MenuGroup/MenuGroup.feature +16 -16
  33. package/src/MenuGroup/MenuGroup.stories.tsx +248 -0
  34. package/src/MenuGroup/MenuGroup.tsx +12 -7
  35. package/src/MenuGroup/MenuGroupTypes.ts +6 -2
  36. package/src/MenuGroup/__tests__/MenuGroup.test.tsx +6 -6
  37. package/src/MenuGroup/__tests__/MenuGroup.typetest.tsx +7 -7
  38. package/src/MenuGroup/styles.tsx +4 -2
  39. package/src/MenuHeader/MenuHeader.stories.tsx +276 -0
  40. package/src/MenuHeader/MenuHeader.tsx +12 -7
  41. package/src/MenuHeader/__tests__/MenuHeader.test.tsx +23 -13
  42. package/src/MenuHeader/styles.tsx +22 -14
  43. package/src/MenuItem/MenuItem.stories.tsx +507 -0
  44. package/src/MenuItem/MenuItem.tsx +23 -9
  45. package/src/MenuItem/MenuItemTypes.ts +9 -4
  46. package/src/MenuItem/__tests__/MenuItem.test.tsx +6 -6
  47. package/src/MenuItem/styles.tsx +23 -5
  48. package/src/MenuItem/useOptionProps.tsx +11 -9
  49. package/src/MenuLabel.tsx +2 -2
  50. package/src/MenuRoot/MenuRoot.tsx +52 -24
  51. package/src/MenuRoot/__tests__/MenuRoot.test.tsx +59 -32
  52. package/src/MenuSearchInput/MenuSearchInput.tsx +85 -0
  53. package/src/MenuSearchInput/__tests__/MenuSearchInput.test.tsx +157 -0
  54. package/src/MenuSearchInput/__tests__/MenuSearchInput.typetest.tsx +31 -0
  55. package/src/MenuSearchInput/index.ts +1 -0
  56. package/src/MenuSearchTokenInput/MenuSearchTokenInput.tsx +108 -0
  57. package/src/MenuSearchTokenInput/__tests__/MenuSearchTokenInput.test.tsx +247 -0
  58. package/src/MenuSearchTokenInput/__tests__/MenuSearchTokenInput.typetest.tsx +33 -0
  59. package/src/MenuSearchTokenInput/index.ts +1 -0
  60. package/src/MenuToggleButton/MenuToggleButton.stories.tsx +72 -0
  61. package/src/{MenuToggleButton.tsx → MenuToggleButton/MenuToggleButton.tsx} +6 -5
  62. package/src/MenuToggleButton/index.ts +1 -0
  63. package/src/MenuTokenInput.tsx +104 -0
  64. package/src/MultiSelectMenu/MultiSelectMenu.stories.tsx +222 -0
  65. package/src/MultiSelectMenu/MultiSelectMenu.tsx +38 -68
  66. package/src/MultiSelectMenu/MultiSelectMenuTypes.ts +8 -6
  67. package/src/MultiSelectMenu/__tests__/MultiSelectMenu.test.tsx +46 -17
  68. package/src/MultiSelectMenu/__tests__/MultiSelectMenu.typetest.tsx +6 -6
  69. package/src/NestedMenu/NestedMenu.feature +109 -0
  70. package/src/NestedMenu/NestedMenu.stories.tsx +157 -0
  71. package/src/NestedMenu/NestedMenu.tsx +102 -0
  72. package/src/NestedMenu/NestedMenuContent.tsx +75 -0
  73. package/src/NestedMenu/NestedMenuContext.tsx +56 -0
  74. package/src/NestedMenu/NestedMenuHeader.tsx +25 -0
  75. package/src/NestedMenu/NestedMenuItem.tsx +41 -0
  76. package/src/NestedMenu/NestedMenuTypes.ts +47 -0
  77. package/src/NestedMenu/__tests__/NestedMenu.test.tsx +31 -0
  78. package/src/NestedMenu/__tests__/NestedMenu.typetest.tsx +134 -0
  79. package/src/NestedMenu/index.ts +5 -0
  80. package/src/SingleSelectMenu/SingleSelectMenu.stories.tsx +233 -0
  81. package/src/SingleSelectMenu/SingleSelectMenu.tsx +23 -26
  82. package/src/SingleSelectMenu/SingleSelectMenuTypes.ts +7 -5
  83. package/src/SingleSelectMenu/__tests__/SingleSelectMenu.typetest.tsx +6 -6
  84. package/src/SubmenuItem/SubmenuItem.feature +82 -0
  85. package/src/SubmenuItem/SubmenuItem.stories.tsx +163 -0
  86. package/src/SubmenuItem/SubmenuItem.tsx +258 -0
  87. package/src/SubmenuItem/SubmenuItemTypes.ts +24 -0
  88. package/src/SubmenuItem/__tests__/SubmenuItem.test.tsx +3 -0
  89. package/src/SubmenuItem/__tests__/SubmenuItem.typetest.tsx +112 -0
  90. package/src/SubmenuItem/index.ts +2 -0
  91. package/src/hooks/useDownshiftDefaults.tsx +117 -0
  92. package/src/hooks/useItemFiltering.tsx +68 -0
  93. package/src/hooks/useMenuChildren.tsx +205 -131
  94. package/src/index.ts +6 -0
  95. package/src/menuTestingUtils.tsx +21 -10
  96. package/src/reducers/nestedMenuStateReducer.tsx +23 -0
  97. package/src/reducers/useComboboxStateReducer.tsx +26 -8
  98. package/src/reducers/useSelectStateReducer.tsx +24 -6
  99. package/src/storybookUtilities/menu-storybook-components.tsx +5 -3
  100. package/src/types.ts +38 -30
  101. package/src/utils/downshiftDefaults.ts +9 -0
  102. package/src/utils/getMultiSelectOverrides.ts +21 -0
  103. package/src/utils/reduceReducers.ts +19 -0
  104. package/src/utils/itemToString.ts +0 -5
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as downshift from 'downshift';
3
- import { UseComboboxProps, UseSelectProps, UseMultipleSelectionProps, UseComboboxReturnValue, UseSelectReturnValue, UseMultipleSelectionReturnValue, GetItemPropsOptions, UseComboboxGetInputPropsOptions } from 'downshift';
2
+ import { UseComboboxProps, UseSelectProps, UseMultipleSelectionProps, UseComboboxReturnValue, UseSelectReturnValue, UseMultipleSelectionReturnValue, UseComboboxGetInputPropsOptions, GetItemPropsOptions } from 'downshift';
4
3
  import { TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps, TypeStyledComponentsCommonProps } from '@sproutsocial/seeds-react-system-props';
5
4
  import * as React$1 from 'react';
6
5
  import React__default, { ReactNode } from 'react';
7
6
  import { TypePopoutProps } from '@sproutsocial/seeds-react-popout';
7
+ import { TypeTokenInputProps, TypeTokenSpec } from '@sproutsocial/seeds-react-token-input';
8
8
  import * as styled_components from 'styled-components';
9
9
  import { HTMLMotionProps } from 'motion/react';
10
10
  import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
@@ -25,13 +25,13 @@ type TypeMenuItemRoles = (typeof MENU_ITEM_ROLES)[keyof typeof MENU_ITEM_ROLES];
25
25
 
26
26
  interface TypeMenuGroupStyledProps extends TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps {
27
27
  }
28
- interface TypeBaseMenuGroupProps extends TypeMenuGroupStyledProps, Omit<React.ComponentPropsWithoutRef<"ul">, "color"> {
28
+ interface TypeMenuGroupBaseProps extends TypeMenuGroupStyledProps, Omit<React.ComponentPropsWithoutRef<"ul">, "color"> {
29
29
  id: string;
30
30
  isSingleSelect?: boolean;
31
31
  title?: string;
32
32
  titleAs?: string | React.ComponentType<any>;
33
33
  }
34
- type TypeMenuGroupProps = TypeBaseMenuGroupProps & TypeChildrenOrItems;
34
+ type TypeMenuGroupProps<I extends TypeMenuItemProps = TypeMenuItemProps> = TypeMenuGroupBaseProps & TypeChildrenOrItems<I>;
35
35
 
36
36
  /**
37
37
  * @link https://seeds.sproutsocial.com/components/menu-group/
@@ -52,35 +52,45 @@ type TypeMenuGroupProps = TypeBaseMenuGroupProps & TypeChildrenOrItems;
52
52
  *
53
53
  * @see {@link https://seeds.sproutsocial.com/components/menu-item/ | MenuItem}
54
54
  */
55
- declare const MenuGroup: ({ titleAs, children: childrenProp, title, color, isSingleSelect, id, items, MenuItemComponent, ...rest }: TypeMenuGroupProps) => react_jsx_runtime.JSX.Element | null;
55
+ declare const MenuGroup: {
56
+ <I extends TypeMenuItemProps = TypeMenuItemProps>({ titleAs, children: childrenProp, title, color, isSingleSelect, id, menuItems, MenuItemComponent, ...rest }: TypeMenuGroupProps<I>): react_jsx_runtime.JSX.Element | null;
57
+ __MENU_PRIMITIVE_TYPE: string;
58
+ };
56
59
 
57
- declare const StyledMenuGroup: styled_components.StyledComponent<"li", styled_components.DefaultTheme, TypeMenuGroupProps, never>;
60
+ declare const StyledMenuGroup: styled_components.StyledComponent<"li", styled_components.DefaultTheme, TypeMenuGroupBaseProps, never>;
58
61
  declare const StyledTitle: styled_components.StyledComponent<React$1.FC<_sproutsocial_seeds_react_text.TypeTextProps>, styled_components.DefaultTheme, {}, never>;
59
62
  declare const StyledMenuGroupUl: styled_components.StyledComponent<"ul", styled_components.DefaultTheme, {}, never>;
60
63
 
61
- interface TypeDownshiftComboboxProps extends Partial<UseComboboxProps<TypeDefaultItemProps>> {
64
+ interface TypeDownshiftComboboxProps extends Partial<UseComboboxProps<TypeInternalItemProps>> {
62
65
  }
63
- interface TypeDownshiftSelectProps extends Partial<UseSelectProps<TypeDefaultItemProps>> {
66
+ interface TypeDownshiftSelectProps extends Partial<UseSelectProps<TypeInternalItemProps>> {
64
67
  }
65
- interface TypeDownshiftMultiSelectProps extends Partial<Omit<UseMultipleSelectionProps<TypeDefaultItemProps>, "stateReducer" | "onStateChange" | "getA11yStatusMessage">> {
66
- getA11yMultiStatusMessage?: UseMultipleSelectionProps<TypeDefaultItemProps>["getA11yStatusMessage"];
67
- onMultiSelectStateChange?: UseMultipleSelectionProps<TypeDefaultItemProps>["onStateChange"];
68
- multiSelectStateReducer?: UseMultipleSelectionProps<TypeDefaultItemProps>["stateReducer"];
68
+ interface TypeDownshiftMultiSelectProps extends Partial<Omit<UseMultipleSelectionProps<TypeInternalItemProps>, "stateReducer" | "onStateChange" | "getA11yStatusMessage">> {
69
+ getA11yMultiStatusMessage?: UseMultipleSelectionProps<TypeInternalItemProps>["getA11yStatusMessage"];
70
+ onMultiSelectStateChange?: UseMultipleSelectionProps<TypeInternalItemProps>["onStateChange"];
71
+ multiSelectStateReducer?: UseMultipleSelectionProps<TypeInternalItemProps>["stateReducer"];
69
72
  }
70
- interface TypeDownshiftComboboxReturnValue extends Partial<UseComboboxReturnValue<TypeDefaultItemProps>> {
73
+ interface TypeDownshiftComboboxReturnValue extends Partial<UseComboboxReturnValue<TypeInternalItemProps>> {
71
74
  }
72
- interface TypeDownshiftSelectReturnValue extends Partial<UseSelectReturnValue<TypeDefaultItemProps>> {
75
+ interface TypeDownshiftSelectReturnValue extends Partial<UseSelectReturnValue<TypeInternalItemProps>> {
73
76
  }
74
- interface TypeDownshiftMultiSelectReturnValue extends Partial<UseMultipleSelectionReturnValue<TypeDefaultItemProps>> {
77
+ interface TypeDownshiftMultiSelectReturnValue extends Partial<UseMultipleSelectionReturnValue<TypeInternalItemProps>> {
75
78
  }
76
79
  type TypeDonwshiftSharedReturnValue = "getLabelProps" | "getToggleButtonProps" | "getMenuProps";
77
80
  type TypeDonwshiftSharedProps = "onHighlightedIndexChange" | "onIsOpenChange" | "onSelectedItemChange" | "onStateChange" | "stateReducer";
78
- interface TypeMenuContextProps extends Omit<TypeDownshiftComboboxReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftComboboxProps, TypeDonwshiftSharedProps>, Omit<TypeDownshiftSelectReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftSelectProps, TypeDonwshiftSharedProps>, TypeDownshiftMultiSelectReturnValue, TypeDownshiftMultiSelectProps {
79
- items: TypeDefaultItemProps[];
81
+ interface TypeMenuContextBaseProps {
80
82
  itemsMap?: {
81
- [key: string]: TypeDefaultItemProps;
83
+ [key: string]: TypeInternalItemProps;
82
84
  };
83
85
  isListbox?: boolean;
86
+ hiddenItemsMap?: Record<string, boolean>;
87
+ hiddenItemsCount?: number;
88
+ setHiddenItemsMap?: React__default.Dispatch<React__default.SetStateAction<Record<string, boolean>>>;
89
+ subMenuId?: string;
90
+ setSubMenuId?: (id: string) => void;
91
+ contentRef?: React__default.RefObject<HTMLUListElement>;
92
+ }
93
+ interface TypeAllDownshiftProps extends Omit<TypeDownshiftComboboxReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftComboboxProps, TypeDonwshiftSharedProps>, Omit<TypeDownshiftSelectReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftSelectProps, TypeDonwshiftSharedProps>, TypeDownshiftMultiSelectReturnValue, TypeDownshiftMultiSelectProps {
84
94
  onHighlightedIndexChange?: TypeDownshiftComboboxProps["onHighlightedIndexChange"] | TypeDownshiftSelectProps["onHighlightedIndexChange"];
85
95
  onIsOpenChange?: TypeDownshiftComboboxProps["onIsOpenChange"] | TypeDownshiftSelectProps["onIsOpenChange"];
86
96
  onSelectedItemChange?: TypeDownshiftComboboxProps["onSelectedItemChange"] | TypeDownshiftSelectProps["onSelectedItemChange"];
@@ -90,73 +100,116 @@ interface TypeMenuContextProps extends Omit<TypeDownshiftComboboxReturnValue, Ty
90
100
  getToggleButtonProps?: TypeDownshiftComboboxReturnValue["getToggleButtonProps"] | TypeDownshiftSelectReturnValue["getToggleButtonProps"];
91
101
  getMenuProps?: TypeDownshiftComboboxReturnValue["getMenuProps"] | TypeDownshiftSelectReturnValue["getMenuProps"];
92
102
  }
103
+ interface TypeMenuContextProps extends TypeAllDownshiftProps, TypeMenuContextBaseProps {
104
+ items: TypeInternalItemProps[];
105
+ itemsMap?: {
106
+ [key: string]: TypeInternalItemProps;
107
+ };
108
+ selectedItemIds?: {
109
+ [key: string]: boolean;
110
+ };
111
+ isListbox?: boolean;
112
+ }
93
113
  interface TypeMenuContext extends TypeMenuContextProps {
94
114
  itemsMap: {
95
- [key: string]: TypeDefaultItemProps;
115
+ [key: string]: TypeInternalItemProps;
96
116
  };
117
+ isItemSelected: (id: string) => boolean;
118
+ getInputComponentProps: (props: Pick<TypeTokenInputProps, "inputProps"> & Parameters<Required<TypeMenuContextProps>["getInputProps"]>[0]) => Omit<TypeDownshiftMergedInputProps<TypeTokenInputProps>, "onClick">;
97
119
  }
98
120
  interface TypeMenuProviderProps {
99
121
  children: TypeNotEmptyChildren;
100
- menuProps: Partial<TypeMenuContextProps>;
122
+ menuContext: TypeMenuContext;
123
+ }
124
+ interface TypeMenuToggleContext extends TypeMenuContext {
125
+ ref?: (arg0: React__default.ElementRef<any> | HTMLElement) => void;
126
+ toggle?: () => void;
127
+ show?: () => void;
128
+ hide?: () => void;
129
+ ariaProps?: Record<string, any>;
101
130
  }
131
+ interface TypeMenuToggleProviderProps extends TypeMenuProviderProps {
132
+ menuContext: TypeMenuToggleContext;
133
+ }
134
+ /**
135
+ * Object for Initializing the Menu Context
136
+ */
137
+ declare const defaultMenuContext: TypeMenuContext;
138
+ declare const getSelectedItemIds: <T extends TypeMenuContextProps["selectedItems"] | undefined, R = T extends undefined ? undefined : Record<string, boolean>>(selectedItems?: T) => R;
139
+ declare const checkIfItemSelected: ({ id, selectedItem, selectedItemIds, }: {
140
+ id: string;
141
+ selectedItem?: TypeInternalItemProps | null;
142
+ selectedItemIds?: TypeMenuContextProps["selectedItemIds"];
143
+ }) => boolean;
102
144
  /**
103
145
  * Hook for initializing Menu context
104
146
  */
105
- declare const useMenu: ({ items, isListbox, isOpen, itemsMap: itemsMapFromProps, ...rest }?: Partial<TypeMenuContextProps>) => TypeMenuContext;
147
+ declare const useMenu: ({ items, isListbox, isOpen, itemsMap: itemsMapFromProps, selectedItemIds: selectedItemIdsFromProps, selectedItem, selectedItems, getInputProps, contentRef: contentRefFromProps, ...rest }?: Partial<TypeMenuContextProps>) => TypeMenuContext;
148
+ /**
149
+ * MenuToggleContext factory, sets the type and the initial object
150
+ * @description Context for the Menu Toggle
151
+ */
152
+ declare const MenuToggleContext: React__default.Context<TypeMenuToggleContext>;
153
+ /**
154
+ * MenuToggleProvider Component sets the context values into the provider
155
+ * @description Context Provider for the Menu Toggle
156
+ */
157
+ declare const MenuToggleProvider: ({ children, menuContext, }: TypeMenuToggleProviderProps) => react_jsx_runtime.JSX.Element;
158
+ /**
159
+ * Utility hook for consuming MenuToggleContext
160
+ */
161
+ declare const useMenuToggleContext: () => TypeMenuToggleContext;
106
162
  /**
107
- * MenuContext factory, sets the type and the initial object
163
+ * MenuContentContext factory, sets the type and the initial object
164
+ * @description Context for the Menu Content
108
165
  */
109
- declare const MenuContext: React__default.Context<TypeMenuContext>;
166
+ declare const MenuContentContext: React__default.Context<TypeMenuContext>;
110
167
  /**
111
- * Provider Component sets the context values into the provider
168
+ * MenuContentProvider Component sets the context values into the provider
169
+ * @description Context Provider for the Menu Content
112
170
  */
113
- declare const MenuProvider: ({ children, menuProps, }: TypeMenuProviderProps) => react_jsx_runtime.JSX.Element;
171
+ declare const MenuContentProvider: ({ children, menuContext, }: TypeMenuProviderProps) => react_jsx_runtime.JSX.Element;
114
172
  /**
115
- * Utility hook for consuming MenuContext
173
+ * Utility hook for consuming MenuContentContext
116
174
  */
117
- declare const useMenuContext: () => TypeMenuContext;
175
+ declare const useMenuContentContext: () => TypeMenuContext;
118
176
 
119
177
  interface TypeMenuRootOwnProps {
120
178
  menuToggleElement: React__default.ReactElement<any>;
121
179
  popoutProps?: Partial<Omit<TypePopoutProps, "isOpen" | "setIsOpen" | "content" | "children">>;
122
180
  width?: TypePopoutProps["width"];
123
181
  }
124
- interface TypeMenuRootProps extends Partial<TypeMenuProviderProps["menuProps"]>, Pick<TypeMenuProviderProps, "children">, TypeMenuRootOwnProps {
182
+ interface TypeMenuRootProps extends Partial<TypeMenuContextProps>, Pick<TypeMenuProviderProps, "children">, TypeMenuRootOwnProps {
125
183
  }
126
184
  /**
127
185
  * @link https://seeds.sproutsocial.com/components/menu-root/
128
186
  *
129
187
  * @description MenuRoot is a utility component used to handle {@link https://github.com/sproutsocial/seeds/blob/dev/seeds-react/seeds-react-menu/src/MenuContext.tsx | MenuContext}. This component should rarely, if ever, be used directly unless building a custom menu type.
130
188
  */
131
- declare const MenuRoot: ({ children, menuToggleElement, popoutProps: { focusLockProps, ...popoutProps }, width, ...contextProps }: TypeMenuRootProps) => react_jsx_runtime.JSX.Element;
189
+ declare const MenuRoot: ({ children, menuToggleElement, popoutProps: { placement, focusLockProps, ...popoutProps }, width, ...contextProps }: TypeMenuRootProps) => react_jsx_runtime.JSX.Element;
132
190
 
133
- interface TypeDefaultItemProps {
191
+ interface TypeInternalItemProps<Item = TypeMenuItemProps> {
134
192
  id: string;
135
193
  index: number;
136
194
  disabled?: boolean;
137
- hidden?: boolean;
138
- menuItemProps?: TypeMenuItemProps;
139
- menuGroupProps?: TypeMenuGroupProps;
195
+ menuItemProps?: Item;
196
+ menuGroupProps?: TypeMenuGroupBaseProps;
140
197
  }
141
- type TypeBaseChildrenOrItems = {
198
+ type TypeChildrenOrItems<I extends TypeMenuItemProps = TypeMenuItemProps> = {
142
199
  /** Allows menu items to be passed in as children. Cannot be used with the items prop.*/
143
- children?: TypeMenuRootProps["children"];
144
- /** Allows menu items to be passed in as objects. Cannot be used with the children prop.*/
145
- items?: TypeMenuItemProps[];
146
- /** Allows a custom MenuItem component to be used when rendering using the items prop.*/
147
- MenuItemComponent?: React.ComponentType<TypeMenuItemProps>;
148
- };
149
- type TypePropsWithChildren = {
150
200
  children: TypeMenuRootProps["children"];
151
- items?: never;
201
+ menuItems?: never;
152
202
  MenuItemComponent?: never;
153
- };
154
- type TypePropsWithItems = {
203
+ } | {
155
204
  children?: never;
156
- items: TypeMenuItemProps[];
205
+ /** Allows menu items to be passed in as objects. Cannot be used with the children prop.*/
206
+ menuItems: I[];
207
+ /** Allows a custom MenuItem component to be used when rendering using the items prop.*/
208
+ MenuItemComponent?: React.ComponentType<I>;
157
209
  };
158
- type TypeChildrenOrItems = TypeBaseChildrenOrItems & (TypePropsWithChildren | TypePropsWithItems);
159
210
  type TypeNotEmptyChildren = React.ReactChild | React.ReactFragment | React.ReactPortal;
211
+ type TypeInputEventListeners = "onKeyDown" | "onChange" | "onInput" | "onBlur" | "onClick" | "refKey";
212
+ type TypeDownshiftMergedInputProps<B> = Pick<UseComboboxGetInputPropsOptions, TypeInputEventListeners> & Omit<Partial<B>, TypeInputEventListeners>;
160
213
 
161
214
  interface TypeMenuItemStyledProps extends TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps {
162
215
  }
@@ -167,24 +220,31 @@ declare const INPUT_TYPES: {
167
220
  readonly ICON: "icon";
168
221
  };
169
222
  type InputType = (typeof INPUT_TYPES)[keyof typeof INPUT_TYPES];
170
- interface TypeMenuItemProps extends TypeMenuItemStyledProps, Omit<GetItemPropsOptions<TypeDefaultItemProps>, "as" | "item" | keyof TypeMenuItemStyledProps | keyof TypeDefaultItemProps>, Omit<TypeDefaultItemProps, "index"> {
223
+ interface TypeMenuItemProps extends TypeMenuItemStyledProps, Omit<GetItemPropsOptions<TypeInternalItemProps>, "as" | "item" | "ref" | keyof TypeMenuItemStyledProps | keyof TypeInternalItemProps>, Omit<TypeInternalItemProps, "index"> {
171
224
  children: React.ReactNode;
172
225
  disabled?: boolean;
173
226
  role?: TypeMenuItemRoles;
227
+ innerRef?: React.Ref<any>;
174
228
  $highlighted?: boolean;
175
229
  active?: boolean;
176
230
  inputType?: InputType;
177
231
  inputLabelId?: string;
178
232
  }
179
233
 
180
- declare const MenuItem: ({ id, children, onClick, onKeyDown, disabled, ref, href, color, ...props }: TypeMenuItemProps) => react_jsx_runtime.JSX.Element;
234
+ declare const MenuItem: {
235
+ ({ id, children, onClick, onKeyDown, disabled, active, innerRef, href, color, ...props }: TypeMenuItemProps): react_jsx_runtime.JSX.Element;
236
+ __MENU_PRIMITIVE_TYPE: string;
237
+ };
181
238
 
182
239
  declare const MenuItemContainer: styled_components.StyledComponent<"li", styled_components.DefaultTheme, {}, never>;
183
- declare const StyledMenuItem: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {
240
+ declare const StyledMenuItem: styled_components.StyledComponent<"button", styled_components.DefaultTheme, {
184
241
  $highlighted: boolean;
242
+ $active?: boolean;
185
243
  }, never>;
186
244
  declare const MenuItemRow: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
187
245
  declare const MenuItemAction: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
246
+ declare const MenuItemActionLeft: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
247
+ declare const MenuItemActionRight: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
188
248
  declare const MenuItemText: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
189
249
 
190
250
  interface TypeMenuHeaderProps extends Omit<React$1.ComponentPropsWithoutRef<"div">, "color">, TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypeSpaceSystemProps, TypePositionSystemProps {
@@ -202,9 +262,9 @@ interface TypeMenuHeaderProps extends Omit<React$1.ComponentPropsWithoutRef<"div
202
262
  */
203
263
  declare const MenuHeader: ({ children, title, leftAction, rightAction, ...rest }: TypeMenuHeaderProps) => react_jsx_runtime.JSX.Element;
204
264
 
205
- interface TypeMenuContentBaseProps extends HTMLMotionProps<"ul"> {
206
- }
207
- type TypeMenuContentProps = TypeMenuContentBaseProps & TypeChildrenOrItems;
265
+ type TypeMenuContentProps<I extends TypeMenuItemProps = TypeMenuItemProps> = Omit<HTMLMotionProps<"ul">, "children"> & {
266
+ innerRef?: React.Ref<HTMLUListElement>;
267
+ } & TypeChildrenOrItems<I>;
208
268
 
209
269
  /**
210
270
  * @link https://seeds.sproutsocial.com/components/menu-content/
@@ -228,7 +288,10 @@ type TypeMenuContentProps = TypeMenuContentBaseProps & TypeChildrenOrItems;
228
288
  * @see {@link https://seeds.sproutsocial.com/components/menu-item/ | MenuItem}
229
289
  * @see {@link https://seeds.sproutsocial.com/components/menu-group/ | MenuGroup}
230
290
  */
231
- declare const MenuContent: ({ id, children: childrenProp, items, MenuItemComponent, ...rest }: TypeMenuContentProps) => react_jsx_runtime.JSX.Element | null;
291
+ declare const MenuContent: {
292
+ <I extends TypeMenuItemProps = TypeMenuItemProps>({ id, children: childrenProp, menuItems, MenuItemComponent, onKeyDown, innerRef, ...rest }: TypeMenuContentProps<I>): react_jsx_runtime.JSX.Element | null;
293
+ __MENU_PRIMITIVE_TYPE: string;
294
+ };
232
295
 
233
296
  /**
234
297
  * @link https://seeds.sproutsocial.com/components/menu-footer/
@@ -246,10 +309,46 @@ interface TypeMenuToggleButtonProps extends Partial<TypeButtonProps> {
246
309
  }
247
310
  declare const MenuToggleButton: ({ children, ...rest }: TypeMenuToggleButtonProps) => react_jsx_runtime.JSX.Element;
248
311
 
249
- type TypeInvalidMenuProps = "initialSelectedItem" | "defaultSelectedItem" | "selectedItem" | "items";
312
+ type TypeGetIsItemVisibleFn = (item: TypeMenuContext["items"][number], inputValue: string) => boolean;
313
+
314
+ interface TypeMenuSearchInputProps extends TypeInputProps {
315
+ getIsItemVisible?: TypeGetIsItemVisibleFn;
316
+ }
317
+ /**
318
+ * <input
319
+ * aria-activedescendant=""
320
+ * aria-autocomplete="list"
321
+ * aria-controls="downshift-:r1:-menu"
322
+ * aria-expanded="true"
323
+ * />
324
+ */
325
+ /**
326
+ * @link https://seeds.sproutsocial.com/components/menu-header/
327
+ *
328
+ * @description MenuSearchInput is search input that can be added to the MenuHeader to filter the items.
329
+ */
330
+ declare const MenuSearchInput: ({ getIsItemVisible, inputProps, ...restInputProps }: TypeMenuSearchInputProps) => react_jsx_runtime.JSX.Element;
331
+
332
+ interface TypeMenuTokenInputProps extends TypeTokenInputProps {
333
+ getTokenProps?: (itemId: TypeInternalItemProps["id"]) => Partial<TypeTokenSpec>;
334
+ MenuContext?: typeof MenuToggleContext | typeof MenuContentContext;
335
+ }
336
+ declare const MenuTokenInput: ({ inputProps, getTokenProps, onKeyDown, MenuContext, ...tokenInputProps }: TypeMenuTokenInputProps) => react_jsx_runtime.JSX.Element;
337
+
338
+ interface TypeMenuSearchTokenInputProps extends TypeMenuTokenInputProps {
339
+ getIsItemVisible?: TypeGetIsItemVisibleFn;
340
+ }
341
+ /**
342
+ * @link https://seeds.sproutsocial.com/components/menu-search-token-input/
343
+ *
344
+ * @description MenuSearchTokenInput is search token input that can be added to the MenuHeader to filter the items.
345
+ */
346
+ declare const MenuSearchTokenInput: ({ getIsItemVisible, getTokenProps, onChange, inputProps: { value: inputPropsValue, ...inputProps }, value, ...tokenInputProps }: TypeMenuSearchTokenInputProps) => react_jsx_runtime.JSX.Element;
347
+
348
+ type TypeInvalidMenuProps = "initialSelectedItem" | "defaultSelectedItem" | "selectedItem";
250
349
  interface TypeActionMenuBaseProps extends TypeMenuRootOwnProps, Omit<TypeDownshiftSelectProps, TypeInvalidMenuProps> {
251
350
  }
252
- type TypeActionMenuProps = TypeActionMenuBaseProps & TypeChildrenOrItems;
351
+ type TypeActionMenuProps<I extends TypeMenuItemProps = TypeMenuItemProps> = TypeActionMenuBaseProps & TypeChildrenOrItems<I>;
253
352
 
254
353
  /**
255
354
  * @link https://seeds.sproutsocial.com/components/action-menu/
@@ -260,11 +359,11 @@ type TypeActionMenuProps = TypeActionMenuBaseProps & TypeChildrenOrItems;
260
359
  * @see {@link https://github.com/sproutsocial/seeds/tree/dev/seeds-react/seeds-react-menu/src/SingleSelectMenu | SingleSelectMenu}
261
360
  * @see {@link https://github.com/sproutsocial/seeds/tree/dev/seeds-react/seeds-react-menu/src/MultiSelectMenu | MultiSelectMenu}
262
361
  */
263
- declare const ActionMenu: ({ children: childrenProp, items, MenuItemComponent, stateReducer: externalStateReducer, ...useSelectProps }: TypeActionMenuProps) => react_jsx_runtime.JSX.Element;
362
+ declare const ActionMenu: <I extends TypeMenuItemProps = TypeMenuItemProps>({ children: childrenProp, menuItems, MenuItemComponent, stateReducer: externalStateReducer, ...useSelectProps }: TypeActionMenuProps<I>) => react_jsx_runtime.JSX.Element;
264
363
 
265
- interface TypeSingleSelectMenuBaseProps extends TypeMenuRootOwnProps, Omit<TypeDownshiftSelectProps, "items"> {
364
+ interface TypeSingleSelectMenuBaseProps extends TypeMenuRootOwnProps, TypeDownshiftSelectProps {
266
365
  }
267
- type TypeSingleSelectMenuProps = TypeSingleSelectMenuBaseProps & TypeChildrenOrItems;
366
+ type TypeSingleSelectMenuProps<I extends TypeMenuItemProps = TypeMenuItemProps> = TypeSingleSelectMenuBaseProps & TypeChildrenOrItems<I>;
268
367
 
269
368
  /**
270
369
  * @link https://seeds.sproutsocial.com/components/singleselect-menu/
@@ -274,11 +373,11 @@ type TypeSingleSelectMenuProps = TypeSingleSelectMenuBaseProps & TypeChildrenOrI
274
373
  * **To trigger actions from a menu:**
275
374
  * @see {@link https://github.com/sproutsocial/seeds/tree/dev/seeds-react/seeds-react-menu/src/ActionMenu | ActionMenu}
276
375
  */
277
- declare const SingleSelectMenu: ({ children: childrenProp, stateReducer: externalStateReducer, items, MenuItemComponent, ...useSelectProps }: TypeSingleSelectMenuProps) => react_jsx_runtime.JSX.Element;
376
+ declare const SingleSelectMenu: <I extends TypeMenuItemProps = TypeMenuItemProps>({ children: childrenProp, stateReducer: externalStateReducer, menuItems, MenuItemComponent, ...useSelectProps }: TypeSingleSelectMenuProps<I>) => react_jsx_runtime.JSX.Element;
278
377
 
279
- interface TypeMultiSelectMenuBaseProps extends TypeMenuRootOwnProps, Omit<TypeDownshiftSelectProps, "items">, Omit<TypeDownshiftMultiSelectProps, "items"> {
378
+ interface TypeMultiSelectMenuBaseProps extends TypeMenuRootOwnProps, TypeDownshiftSelectProps, TypeDownshiftMultiSelectProps {
280
379
  }
281
- type TypeMultiSelectMenuProps = TypeMultiSelectMenuBaseProps & TypeChildrenOrItems;
380
+ type TypeMultiSelectMenuProps<I extends TypeMenuItemProps = TypeMenuItemProps> = TypeMultiSelectMenuBaseProps & TypeChildrenOrItems<I>;
282
381
 
283
382
  /**
284
383
  * @link https://seeds.sproutsocial.com/components/multiselect-menu/
@@ -287,56 +386,140 @@ type TypeMultiSelectMenuProps = TypeMultiSelectMenuBaseProps & TypeChildrenOrIte
287
386
  *
288
387
  * @see {@link https://seeds.sproutsocial.com/components/menu-group/ | MenuGroup}
289
388
  */
290
- declare const MultiSelectMenu: ({ children: childrenProp, items, MenuItemComponent, stateReducer: externalStateReducer, getA11yMultiStatusMessage, onMultiSelectStateChange, multiSelectStateReducer, ...useSelectProps }: TypeMultiSelectMenuProps) => react_jsx_runtime.JSX.Element;
389
+ declare const MultiSelectMenu: <I extends TypeMenuItemProps = TypeMenuItemProps>({ children: childrenProp, menuItems, MenuItemComponent, onSelectedItemChange: externalOnSelectedItemChange, stateReducer: externalStateReducer, getA11yMultiStatusMessage, onMultiSelectStateChange, multiSelectStateReducer, ...useSelectProps }: TypeMultiSelectMenuProps<I>) => react_jsx_runtime.JSX.Element;
291
390
 
292
- interface TypeAutocompleteBaseProps extends TypeMenuRootOwnProps, Omit<TypeDownshiftComboboxProps, "items"> {
293
- getIsItemVisible?: (item: TypeMenuContext["items"][number], inputValue: string) => boolean;
391
+ type TypeSubmenuValidMenuComponentProps<I extends TypeMenuItemProps> = TypeChildrenOrItems<I> & (TypeActionMenuProps<I> | TypeSingleSelectMenuProps<I> | TypeMultiSelectMenuProps<I>);
392
+ interface TypeSubmenuItemProps<I extends TypeMenuItemProps, P extends TypeSubmenuValidMenuComponentProps<I>> extends TypeMenuItemProps {
393
+ isOpen?: boolean;
394
+ onToggleSubmenu?: (isOpen: boolean) => void;
395
+ MenuComponent: React.ComponentType<P>;
396
+ menuProps: Omit<P, "menuToggleElement">;
294
397
  }
295
- type TypeAutocompleteProps = TypeAutocompleteBaseProps & TypeChildrenOrItems;
398
+
399
+ declare const SubmenuItem: {
400
+ <I extends TypeMenuItemProps, P extends TypeSubmenuValidMenuComponentProps<I>>({ MenuComponent, menuProps: { children: menuChildren, menuItems, MenuItemComponent, popoutProps: { popperProps, ...popoutProps }, onStateChange, ...menuProps }, id, children, ...rest }: TypeSubmenuItemProps<I, P>): react_jsx_runtime.JSX.Element;
401
+ __MENU_PRIMITIVE_TYPE: string;
402
+ };
403
+
404
+ type TypeSingleAutocompleteProps<I extends TypeMenuItemProps = TypeMenuItemProps> = TypeMenuRootOwnProps & TypeChildrenOrItems<I> & TypeDownshiftComboboxProps & {
405
+ getIsItemVisible?: TypeGetIsItemVisibleFn;
406
+ };
407
+ type TypeMultiAutocompleteProps<I extends TypeMenuItemProps = TypeMenuItemProps> = TypeSingleAutocompleteProps<I> & TypeDownshiftMultiSelectProps & {
408
+ showSelectedItemsInDropdown?: boolean;
409
+ };
410
+ type TypeAutocompleteProps<I extends TypeMenuItemProps = TypeMenuItemProps> = (TypeSingleAutocompleteProps<I> & {
411
+ multiSelect?: false;
412
+ }) | (TypeMultiAutocompleteProps<I> & {
413
+ multiSelect: true;
414
+ });
296
415
 
297
416
  /**
298
- * @link https://seeds.sproutsocial.com/components/multiselect-menu/
417
+ * @link https://seeds.sproutsocial.com/components/autocomplete/
299
418
  *
300
- * @description A Autocomplete allows multiple {@link https://github.com/sproutsocial/seeds/tree/dev/seeds-react/seeds-react-menu/src/MenuItem | MenuItems} to be selected from a list or groups of lists.
419
+ * @description A Autocomplete allows selecting a {@link https://github.com/sproutsocial/seeds/tree/dev/seeds-react/seeds-react-menu/src/MenuItem | MenuItems} to be selected from a list or groups of lists to populate an input.
301
420
  *
302
- * @see {@link https://seeds.sproutsocial.com/components/menu-group/ | MenuGroup}
303
421
  */
304
- declare const Autocomplete: ({ children: childrenProp, stateReducer: externalStateReducer, items: itemsProp, MenuItemComponent, itemToString, getIsItemVisible, ...useComboboxProps }: TypeAutocompleteProps) => react_jsx_runtime.JSX.Element;
422
+ declare const Autocomplete: <I extends TypeMenuItemProps = TypeMenuItemProps>({ multiSelect, ...rest }: TypeAutocompleteProps<I>) => react_jsx_runtime.JSX.Element;
305
423
 
306
- type TypeInputEventListeners = "onKeyDown" | "onChange" | "onInput" | "onBlur" | "onClick" | "refKey";
307
- interface TypeAutocompleteInputProps extends Pick<UseComboboxGetInputPropsOptions, TypeInputEventListeners>, Omit<Partial<TypeInputProps>, TypeInputEventListeners> {
424
+ interface TypeAutocompleteInputProps extends TypeDownshiftMergedInputProps<TypeInputProps> {
308
425
  }
309
426
  declare const AutocompleteInput: ({ onKeyDown, onChange, onInput, onBlur, onClick, inputProps, ...rest }: TypeAutocompleteInputProps) => react_jsx_runtime.JSX.Element;
310
427
 
311
- interface TypeUseMenuChildrenProps {
312
- children?: ReactNode;
313
- items?: TypeMenuItemProps[];
314
- MenuItemComponent?: React__default.ComponentType<TypeMenuItemProps>;
428
+ interface TypeNestedMenuMapProps<P, I extends TypeMenuItemProps = TypeNestedMenuItemProps> {
429
+ MenuComponent: React.ComponentType<P>;
430
+ menuProps: Omit<P, "menuToggleElement"> & TypeChildrenOrItems<I>;
431
+ /** Defaults to NestedMenuHeader if not provided.
432
+ * This header can be suppressed by passing null.*/
433
+ MenuHeaderComponent?: React.ComponentType<TypeMenuHeaderProps> | null;
434
+ menuHeaderProps?: Partial<TypeMenuHeaderProps>;
435
+ }
436
+ interface TypeNestedMenuHeaderProps extends TypeMenuHeaderProps {
437
+ /** Localized label for the back arrow in this child menu.
438
+ * Overrides the default label passed to NestedMenu. */
439
+ backArrowLabel?: string;
440
+ }
441
+ interface TypeNestedMenuItemProps extends TypeMenuItemProps {
442
+ childMenuId?: string;
443
+ }
444
+ interface TypeNestedMenuProps<I extends TypeMenuItemProps = TypeNestedMenuItemProps> {
445
+ initialMenuId: string;
446
+ menuToggleElement: TypeMenuRootProps["menuToggleElement"];
447
+ onBackButtonClick?: (menuId: string) => void;
448
+ /** Sets the default localized label for the back arrow in all child menus.
449
+ * This label can be overridden by including backArrowLabel in a menu's menuHeaderProps. */
450
+ backArrowLabel?: string;
451
+ /** An object of the menus and child menus to be displayed, keyed by id.*/
452
+ menus: {
453
+ [id: string]: TypeNestedMenuMapProps<TypeActionMenuProps<I>, I> | TypeNestedMenuMapProps<TypeSingleSelectMenuProps<I>, I> | TypeNestedMenuMapProps<TypeMultiSelectMenuProps<I>, I>;
454
+ };
455
+ }
456
+
457
+ declare const NestedMenu: <I extends TypeMenuItemProps = TypeNestedMenuItemProps>({ initialMenuId, menus, onBackButtonClick, backArrowLabel, menuToggleElement, }: TypeNestedMenuProps<I>) => react_jsx_runtime.JSX.Element;
458
+
459
+ declare const NestedMenuItem: {
460
+ ({ children, childMenuId, onClick: onClickProp, ...rest }: TypeNestedMenuItemProps): react_jsx_runtime.JSX.Element;
461
+ __MENU_PRIMITIVE_TYPE: string;
462
+ };
463
+
464
+ declare const NestedMenuHeader: ({ backArrowLabel, ...props }: TypeNestedMenuHeaderProps) => react_jsx_runtime.JSX.Element;
465
+
466
+ declare const NestedMenuContent: {
467
+ <I extends TypeMenuItemProps = TypeNestedMenuItemProps>({ innerRef: innerRefProp, onKeyDown: onKeyDownProp, children, menuItems, MenuItemComponent, ...props }: TypeMenuContentProps<I>): react_jsx_runtime.JSX.Element;
468
+ __MENU_PRIMITIVE_TYPE: string;
469
+ };
470
+
471
+ interface TypeNestedMenuContext {
472
+ selectedMenuPath: string[];
473
+ setSelectedMenuId?: (id: string) => void;
474
+ setSelectedMenuPath?: (path: string[]) => void;
475
+ goBack?: () => void;
315
476
  }
316
- interface TypeMapMenuItemsProps {
317
- items: TypeMenuItemProps[];
318
- MenuItemComponent: React__default.ComponentType<TypeMenuItemProps>;
477
+ interface TypeNestedMenuProviderProps extends TypeNestedMenuContext {
478
+ children: TypeNotEmptyChildren;
319
479
  }
320
- type TypeItemElement = React__default.ReactElement<TypeMenuItemProps>;
321
- type TypeMenuGroupElement = React__default.ReactElement<TypeMenuGroupProps>;
322
- type TypeMenuContentElement = React__default.ReactElement<TypeMenuContentProps>;
480
+ /**
481
+ * NestedMenuContext factory, sets the type and the initial object
482
+ */
483
+ declare const NestedMenuContext: React__default.Context<TypeNestedMenuContext>;
484
+ /**
485
+ * Provider Component sets the context values in the provider
486
+ */
487
+ declare const NestedMenuProvider: ({ children, ...nestedMenuProps }: TypeNestedMenuProviderProps) => react_jsx_runtime.JSX.Element;
488
+ /**
489
+ * Utility hook for consuming NestedMenuContext
490
+ */
491
+ declare const useNestedMenuContext: () => TypeNestedMenuContext;
492
+
493
+ interface TypeMapMenuItemsProps<I extends TypeMenuItemProps = TypeMenuItemProps> {
494
+ menuItems: I[];
495
+ MenuItemComponent?: React__default.ComponentType<I>;
496
+ }
497
+ type TypeItemElement<I extends TypeMenuItemProps = TypeMenuItemProps> = React__default.ReactElement<TypeMenuItemProps | TypeSubmenuItemProps<I, TypeSubmenuValidMenuComponentProps<I>>>;
498
+ type TypeMenuGroupElement<I extends TypeMenuItemProps = TypeMenuItemProps> = React__default.ReactElement<TypeMenuGroupProps<I>>;
499
+ type TypeMenuContentElement<I extends TypeMenuItemProps = TypeMenuItemProps> = React__default.ReactElement<TypeMenuContentProps<I>>;
323
500
  interface TypeMenuChildren {
324
501
  type: "item" | "group" | "content";
325
- element: React__default.ReactElement<TypeMenuGroupProps> | React__default.ReactElement<TypeMenuItemProps> | React__default.ReactElement<TypeMenuContentProps>;
502
+ element: TypeItemElement | TypeMenuGroupElement | TypeMenuContentElement;
326
503
  }
327
- declare const mapMenuItems: ({ items, MenuItemComponent, }: TypeMapMenuItemsProps) => react_jsx_runtime.JSX.Element;
328
- declare const useMenuChildren: ({ children: childrenProp, items, MenuItemComponent, }: TypeUseMenuChildrenProps) => {
329
- allMenuItems: TypeDefaultItemProps[];
504
+ declare const mapMenuItems: <I extends TypeMenuItemProps = TypeMenuItemProps>({ menuItems, MenuItemComponent, }: TypeMapMenuItemsProps<I>) => react_jsx_runtime.JSX.Element;
505
+ type TypeUseMenuChildrenProps<I extends TypeMenuItemProps = TypeMenuItemProps> = {
506
+ children?: TypeMenuRootProps["children"];
507
+ menuItems?: I[];
508
+ MenuItemComponent?: React__default.ComponentType<I>;
509
+ };
510
+ declare const getChildrenFromMenuItems: <I extends TypeMenuItemProps = TypeMenuItemProps>({ menuItems, MenuItemComponent, }: {
511
+ menuItems: I[];
512
+ MenuItemComponent?: React__default.ComponentType<I>;
513
+ }) => react_jsx_runtime.JSX.Element;
514
+ declare const useMenuChildren: <I extends TypeMenuItemProps = TypeMenuItemProps>({ children: childrenProp, menuItems, MenuItemComponent, }: TypeUseMenuChildrenProps<I>) => {
515
+ allMenuItems: TypeInternalItemProps<TypeMenuItemProps>[];
330
516
  menuItemsMap: {
331
- [key: string]: TypeDefaultItemProps;
517
+ [key: string]: TypeInternalItemProps<TypeMenuItemProps>;
332
518
  };
333
519
  children: TypeNotEmptyChildren;
334
520
  };
335
521
 
336
- declare const useSelectStateReducer: Required<UseSelectProps<TypeDefaultItemProps>>["stateReducer"];
337
- declare const defaultUseSelectProps: {
338
- stateReducer: (state: downshift.UseSelectState<TypeDefaultItemProps>, actionAndChanges: downshift.UseSelectStateChangeOptions<TypeDefaultItemProps>) => Partial<downshift.UseSelectState<TypeDefaultItemProps>>;
339
- isItemDisabled: (item: any) => boolean;
340
- };
522
+ declare const useSelectStateReducer: Required<UseSelectProps<TypeInternalItemProps>>["stateReducer"];
523
+ declare const useSelectStateReducerForMulti: Required<UseSelectProps<TypeInternalItemProps>>["stateReducer"];
341
524
 
342
- export { ActionMenu, Autocomplete, AutocompleteInput, INPUT_TYPES, type InputType, MenuContent, MenuContext, MenuFooter, MenuGroup, MenuHeader, MenuItem, MenuItemAction, MenuItemContainer, MenuItemRow, MenuItemText, MenuLabel, MenuProvider, MenuRoot, MenuToggleButton, MultiSelectMenu, SingleSelectMenu, StyledMenuGroup, StyledMenuGroupUl, StyledMenuItem, StyledTitle, type TypeActionMenuProps, type TypeAutocompleteInputProps, type TypeAutocompleteProps, type TypeChildrenOrItems, type TypeDefaultItemProps, type TypeDownshiftComboboxProps, type TypeDownshiftComboboxReturnValue, type TypeDownshiftMultiSelectProps, type TypeDownshiftMultiSelectReturnValue, type TypeDownshiftSelectProps, type TypeDownshiftSelectReturnValue, type TypeItemElement, type TypeMapMenuItemsProps, type TypeMenuChildren, type TypeMenuContentElement, type TypeMenuContentProps, type TypeMenuContext, type TypeMenuContextProps, type TypeMenuGroupElement, type TypeMenuGroupProps, type TypeMenuGroupStyledProps, type TypeMenuHeaderProps, type TypeMenuItemProps, type TypeMenuItemStyledProps, type TypeMenuProviderProps, type TypeMenuRootOwnProps, type TypeMenuRootProps, type TypeMenuToggleButtonProps, type TypeMultiSelectMenuProps, type TypeNotEmptyChildren, type TypeSingleSelectMenuProps, type TypeUseMenuChildrenProps, defaultUseSelectProps, mapMenuItems, useMenu, useMenuChildren, useMenuContext, useSelectStateReducer };
525
+ export { ActionMenu, Autocomplete, AutocompleteInput, INPUT_TYPES, type InputType, MenuContent, MenuContentContext, MenuContentProvider, MenuFooter, MenuGroup, MenuHeader, MenuItem, MenuItemAction, MenuItemActionLeft, MenuItemActionRight, MenuItemContainer, MenuItemRow, MenuItemText, MenuLabel, MenuRoot, MenuSearchInput, MenuSearchTokenInput, MenuToggleButton, MenuToggleContext, MenuToggleProvider, MenuTokenInput, MultiSelectMenu, NestedMenu, NestedMenuContent, NestedMenuContext, NestedMenuHeader, NestedMenuItem, NestedMenuProvider, SingleSelectMenu, StyledMenuGroup, StyledMenuGroupUl, StyledMenuItem, StyledTitle, SubmenuItem, type TypeActionMenuBaseProps, type TypeActionMenuProps, type TypeAutocompleteInputProps, type TypeAutocompleteProps, type TypeChildrenOrItems, type TypeDownshiftComboboxProps, type TypeDownshiftComboboxReturnValue, type TypeDownshiftMergedInputProps, type TypeDownshiftMultiSelectProps, type TypeDownshiftMultiSelectReturnValue, type TypeDownshiftSelectProps, type TypeDownshiftSelectReturnValue, type TypeInternalItemProps, type TypeItemElement, type TypeMapMenuItemsProps, type TypeMenuChildren, type TypeMenuContentElement, type TypeMenuContentProps, type TypeMenuContext, type TypeMenuContextBaseProps, type TypeMenuContextProps, type TypeMenuGroupBaseProps, type TypeMenuGroupElement, type TypeMenuGroupProps, type TypeMenuGroupStyledProps, type TypeMenuHeaderProps, type TypeMenuItemProps, type TypeMenuItemStyledProps, type TypeMenuProviderProps, type TypeMenuRootOwnProps, type TypeMenuRootProps, type TypeMenuSearchInputProps, type TypeMenuSearchTokenInputProps, type TypeMenuToggleButtonProps, type TypeMenuToggleContext, type TypeMenuToggleProviderProps, type TypeMenuTokenInputProps, type TypeMultiAutocompleteProps, type TypeMultiSelectMenuBaseProps, type TypeMultiSelectMenuProps, type TypeNestedMenuContext, type TypeNestedMenuHeaderProps, type TypeNestedMenuItemProps, type TypeNestedMenuMapProps, type TypeNestedMenuProps, type TypeNestedMenuProviderProps, type TypeNotEmptyChildren, type TypeSingleAutocompleteProps, type TypeSingleSelectMenuBaseProps, type TypeSingleSelectMenuProps, type TypeSubmenuItemProps, type TypeSubmenuValidMenuComponentProps, checkIfItemSelected, defaultMenuContext, getChildrenFromMenuItems, getSelectedItemIds, mapMenuItems, useMenu, useMenuChildren, useMenuContentContext, useMenuToggleContext, useNestedMenuContext, useSelectStateReducer, useSelectStateReducerForMulti };