@sproutsocial/seeds-react-menu 0.2.2 → 0.2.3

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/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as downshift from 'downshift';
3
- import { GetItemPropsOptions, UseSelectProps, UseMultipleSelectionProps, UseSelectReturnValue, UseMultipleSelectionReturnValue } from 'downshift';
3
+ import { GetItemPropsOptions, UseComboboxProps, UseSelectProps, UseMultipleSelectionProps, UseComboboxReturnValue, UseSelectReturnValue, UseMultipleSelectionReturnValue } from 'downshift';
4
4
  import { TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps, TypeStyledComponentsCommonProps } from '@sproutsocial/seeds-react-system-props';
5
5
  import * as styled_components from 'styled-components';
6
6
  import * as React$1 from 'react';
@@ -144,14 +144,34 @@ declare const StyledMenuGroup: styled_components.StyledComponent<"li", styled_co
144
144
  declare const StyledTitle: styled_components.StyledComponent<React$1.FC<_sproutsocial_seeds_react_text.TypeTextProps>, styled_components.DefaultTheme, {}, never>;
145
145
  declare const StyledMenuGroupUl: styled_components.StyledComponent<"ul", styled_components.DefaultTheme, {}, never>;
146
146
 
147
- interface TypeDownshiftMultiSelectProps extends Partial<UseSelectProps<TypeDefaultItemProps>>, Partial<Omit<UseMultipleSelectionProps<TypeDefaultItemProps>, "stateReducer" | "onStateChange" | "getA11yStatusMessage">> {
147
+ interface TypeDownshiftComboboxProps extends Partial<UseComboboxProps<TypeDefaultItemProps>> {
148
+ }
149
+ interface TypeDownshiftSelectProps extends Partial<UseSelectProps<TypeDefaultItemProps>> {
150
+ }
151
+ interface TypeDownshiftMultiSelectProps extends Partial<Omit<UseMultipleSelectionProps<TypeDefaultItemProps>, "stateReducer" | "onStateChange" | "getA11yStatusMessage">> {
148
152
  getA11yMultiStatusMessage?: UseMultipleSelectionProps<TypeDefaultItemProps>["getA11yStatusMessage"];
149
153
  onMultiSelectStateChange?: UseMultipleSelectionProps<TypeDefaultItemProps>["onStateChange"];
150
154
  multiSelectStateReducer?: UseMultipleSelectionProps<TypeDefaultItemProps>["stateReducer"];
151
155
  }
152
- interface TypeMenuContextProps extends Partial<UseSelectReturnValue<TypeDefaultItemProps>>, Partial<UseMultipleSelectionReturnValue<TypeDefaultItemProps>>, TypeDownshiftMultiSelectProps {
156
+ interface TypeDownshiftComboboxReturnValue extends Partial<UseComboboxReturnValue<TypeDefaultItemProps>> {
157
+ }
158
+ interface TypeDownshiftSelectReturnValue extends Partial<UseSelectReturnValue<TypeDefaultItemProps>> {
159
+ }
160
+ interface TypeDownshiftMultiSelectReturnValue extends Partial<UseMultipleSelectionReturnValue<TypeDefaultItemProps>> {
161
+ }
162
+ type TypeDonwshiftSharedReturnValue = "getLabelProps" | "getToggleButtonProps" | "getMenuProps";
163
+ type TypeDonwshiftSharedProps = "onHighlightedIndexChange" | "onIsOpenChange" | "onSelectedItemChange" | "onStateChange" | "stateReducer";
164
+ interface TypeMenuContextProps extends Omit<TypeDownshiftComboboxReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftComboboxProps, TypeDonwshiftSharedProps>, Omit<TypeDownshiftSelectReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftSelectProps, TypeDonwshiftSharedProps>, TypeDownshiftMultiSelectReturnValue, TypeDownshiftMultiSelectProps {
153
165
  items: TypeDefaultItemProps[];
154
166
  isListbox?: boolean;
167
+ onHighlightedIndexChange?: TypeDownshiftComboboxProps["onHighlightedIndexChange"] | TypeDownshiftSelectProps["onHighlightedIndexChange"];
168
+ onIsOpenChange?: TypeDownshiftComboboxProps["onIsOpenChange"] | TypeDownshiftSelectProps["onIsOpenChange"];
169
+ onSelectedItemChange?: TypeDownshiftComboboxProps["onSelectedItemChange"] | TypeDownshiftSelectProps["onSelectedItemChange"];
170
+ onStateChange?: TypeDownshiftComboboxProps["onStateChange"] | TypeDownshiftSelectProps["onStateChange"];
171
+ stateReducer?: TypeDownshiftComboboxProps["stateReducer"] | TypeDownshiftSelectProps["stateReducer"];
172
+ getLabelProps?: TypeDownshiftComboboxReturnValue["getLabelProps"] | TypeDownshiftSelectReturnValue["getLabelProps"];
173
+ getToggleButtonProps?: TypeDownshiftComboboxReturnValue["getToggleButtonProps"] | TypeDownshiftSelectReturnValue["getToggleButtonProps"];
174
+ getMenuProps?: TypeDownshiftComboboxReturnValue["getMenuProps"] | TypeDownshiftSelectReturnValue["getMenuProps"];
155
175
  }
156
176
  interface TypeMenuContext extends TypeMenuContextProps {
157
177
  itemsMap: {
@@ -200,9 +220,10 @@ interface TypeMenuToggleButtonProps extends Partial<TypeButtonProps> {
200
220
  declare const MenuToggleButton: ({ children, ...rest }: TypeMenuToggleButtonProps) => react_jsx_runtime.JSX.Element;
201
221
 
202
222
  type TypeInvalidMenuProps = "initialSelectedItem" | "defaultSelectedItem" | "selectedItem";
203
- interface TypeActionMenuProps extends TypeMenuRootOwnProps, Partial<Omit<UseSelectProps<TypeDefaultItemProps>, TypeInvalidMenuProps>> {
223
+ interface TypeActionMenuProps extends TypeMenuRootOwnProps, Omit<TypeDownshiftSelectProps, TypeInvalidMenuProps> {
204
224
  children: TypeMenuRootProps["children"];
205
225
  }
226
+
206
227
  /**
207
228
  * @link https://seeds.sproutsocial.com/components/action-menu/
208
229
  *
@@ -214,7 +235,7 @@ interface TypeActionMenuProps extends TypeMenuRootOwnProps, Partial<Omit<UseSele
214
235
  */
215
236
  declare const ActionMenu: ({ children, stateReducer: externalStateReducer, ...useSelectProps }: TypeActionMenuProps) => react_jsx_runtime.JSX.Element;
216
237
 
217
- interface TypeSingleSelectMenuProps extends TypeMenuRootOwnProps, Partial<UseSelectProps<TypeDefaultItemProps>> {
238
+ interface TypeSingleSelectMenuProps extends TypeMenuRootOwnProps, TypeDownshiftSelectProps {
218
239
  children: TypeMenuRootProps["children"];
219
240
  }
220
241
 
@@ -228,7 +249,7 @@ interface TypeSingleSelectMenuProps extends TypeMenuRootOwnProps, Partial<UseSel
228
249
  */
229
250
  declare const SingleSelectMenu: ({ children, stateReducer: externalStateReducer, ...useSelectProps }: TypeSingleSelectMenuProps) => react_jsx_runtime.JSX.Element;
230
251
 
231
- interface TypeMultiSelectMenuProps extends TypeMenuRootOwnProps, TypeDownshiftMultiSelectProps {
252
+ interface TypeMultiSelectMenuProps extends TypeMenuRootOwnProps, TypeDownshiftSelectProps, TypeDownshiftMultiSelectProps {
232
253
  children: TypeMenuRootProps["children"];
233
254
  }
234
255
 
@@ -261,4 +282,4 @@ declare const defaultUseSelectProps: {
261
282
  isItemDisabled: (item: any) => boolean;
262
283
  };
263
284
 
264
- export { ActionMenu, 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 TypeDefaultItemProps, type TypeDownshiftMultiSelectProps, type TypeItemElements, type TypeMenuContentProps, type TypeMenuContext, type TypeMenuContextProps, type TypeMenuGroupProps, type TypeMenuGroupStyledProps, type TypeMenuHeaderProps, type TypeMenuItemProps, type TypeMenuItemStyledProps, type TypeMenuProviderProps, type TypeMenuRootOwnProps, type TypeMenuRootProps, type TypeMenuToggleButtonProps, type TypeNotEmptyChildren, type TypeSingleSelectMenuProps, type TypeUseItemsFromChildrenProps, defaultUseSelectProps, useItemsFromChildren, useMenu, useMenuContext, useSelectStateReducer };
285
+ export { ActionMenu, 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 TypeDefaultItemProps, type TypeDownshiftComboboxProps, type TypeDownshiftComboboxReturnValue, type TypeDownshiftMultiSelectProps, type TypeDownshiftMultiSelectReturnValue, type TypeDownshiftSelectProps, type TypeDownshiftSelectReturnValue, type TypeItemElements, type TypeMenuContentProps, type TypeMenuContext, type TypeMenuContextProps, 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 TypeUseItemsFromChildrenProps, defaultUseSelectProps, useItemsFromChildren, useMenu, useMenuContext, useSelectStateReducer };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as downshift from 'downshift';
3
- import { GetItemPropsOptions, UseSelectProps, UseMultipleSelectionProps, UseSelectReturnValue, UseMultipleSelectionReturnValue } from 'downshift';
3
+ import { GetItemPropsOptions, UseComboboxProps, UseSelectProps, UseMultipleSelectionProps, UseComboboxReturnValue, UseSelectReturnValue, UseMultipleSelectionReturnValue } from 'downshift';
4
4
  import { TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps, TypeStyledComponentsCommonProps } from '@sproutsocial/seeds-react-system-props';
5
5
  import * as styled_components from 'styled-components';
6
6
  import * as React$1 from 'react';
@@ -144,14 +144,34 @@ declare const StyledMenuGroup: styled_components.StyledComponent<"li", styled_co
144
144
  declare const StyledTitle: styled_components.StyledComponent<React$1.FC<_sproutsocial_seeds_react_text.TypeTextProps>, styled_components.DefaultTheme, {}, never>;
145
145
  declare const StyledMenuGroupUl: styled_components.StyledComponent<"ul", styled_components.DefaultTheme, {}, never>;
146
146
 
147
- interface TypeDownshiftMultiSelectProps extends Partial<UseSelectProps<TypeDefaultItemProps>>, Partial<Omit<UseMultipleSelectionProps<TypeDefaultItemProps>, "stateReducer" | "onStateChange" | "getA11yStatusMessage">> {
147
+ interface TypeDownshiftComboboxProps extends Partial<UseComboboxProps<TypeDefaultItemProps>> {
148
+ }
149
+ interface TypeDownshiftSelectProps extends Partial<UseSelectProps<TypeDefaultItemProps>> {
150
+ }
151
+ interface TypeDownshiftMultiSelectProps extends Partial<Omit<UseMultipleSelectionProps<TypeDefaultItemProps>, "stateReducer" | "onStateChange" | "getA11yStatusMessage">> {
148
152
  getA11yMultiStatusMessage?: UseMultipleSelectionProps<TypeDefaultItemProps>["getA11yStatusMessage"];
149
153
  onMultiSelectStateChange?: UseMultipleSelectionProps<TypeDefaultItemProps>["onStateChange"];
150
154
  multiSelectStateReducer?: UseMultipleSelectionProps<TypeDefaultItemProps>["stateReducer"];
151
155
  }
152
- interface TypeMenuContextProps extends Partial<UseSelectReturnValue<TypeDefaultItemProps>>, Partial<UseMultipleSelectionReturnValue<TypeDefaultItemProps>>, TypeDownshiftMultiSelectProps {
156
+ interface TypeDownshiftComboboxReturnValue extends Partial<UseComboboxReturnValue<TypeDefaultItemProps>> {
157
+ }
158
+ interface TypeDownshiftSelectReturnValue extends Partial<UseSelectReturnValue<TypeDefaultItemProps>> {
159
+ }
160
+ interface TypeDownshiftMultiSelectReturnValue extends Partial<UseMultipleSelectionReturnValue<TypeDefaultItemProps>> {
161
+ }
162
+ type TypeDonwshiftSharedReturnValue = "getLabelProps" | "getToggleButtonProps" | "getMenuProps";
163
+ type TypeDonwshiftSharedProps = "onHighlightedIndexChange" | "onIsOpenChange" | "onSelectedItemChange" | "onStateChange" | "stateReducer";
164
+ interface TypeMenuContextProps extends Omit<TypeDownshiftComboboxReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftComboboxProps, TypeDonwshiftSharedProps>, Omit<TypeDownshiftSelectReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftSelectProps, TypeDonwshiftSharedProps>, TypeDownshiftMultiSelectReturnValue, TypeDownshiftMultiSelectProps {
153
165
  items: TypeDefaultItemProps[];
154
166
  isListbox?: boolean;
167
+ onHighlightedIndexChange?: TypeDownshiftComboboxProps["onHighlightedIndexChange"] | TypeDownshiftSelectProps["onHighlightedIndexChange"];
168
+ onIsOpenChange?: TypeDownshiftComboboxProps["onIsOpenChange"] | TypeDownshiftSelectProps["onIsOpenChange"];
169
+ onSelectedItemChange?: TypeDownshiftComboboxProps["onSelectedItemChange"] | TypeDownshiftSelectProps["onSelectedItemChange"];
170
+ onStateChange?: TypeDownshiftComboboxProps["onStateChange"] | TypeDownshiftSelectProps["onStateChange"];
171
+ stateReducer?: TypeDownshiftComboboxProps["stateReducer"] | TypeDownshiftSelectProps["stateReducer"];
172
+ getLabelProps?: TypeDownshiftComboboxReturnValue["getLabelProps"] | TypeDownshiftSelectReturnValue["getLabelProps"];
173
+ getToggleButtonProps?: TypeDownshiftComboboxReturnValue["getToggleButtonProps"] | TypeDownshiftSelectReturnValue["getToggleButtonProps"];
174
+ getMenuProps?: TypeDownshiftComboboxReturnValue["getMenuProps"] | TypeDownshiftSelectReturnValue["getMenuProps"];
155
175
  }
156
176
  interface TypeMenuContext extends TypeMenuContextProps {
157
177
  itemsMap: {
@@ -200,9 +220,10 @@ interface TypeMenuToggleButtonProps extends Partial<TypeButtonProps> {
200
220
  declare const MenuToggleButton: ({ children, ...rest }: TypeMenuToggleButtonProps) => react_jsx_runtime.JSX.Element;
201
221
 
202
222
  type TypeInvalidMenuProps = "initialSelectedItem" | "defaultSelectedItem" | "selectedItem";
203
- interface TypeActionMenuProps extends TypeMenuRootOwnProps, Partial<Omit<UseSelectProps<TypeDefaultItemProps>, TypeInvalidMenuProps>> {
223
+ interface TypeActionMenuProps extends TypeMenuRootOwnProps, Omit<TypeDownshiftSelectProps, TypeInvalidMenuProps> {
204
224
  children: TypeMenuRootProps["children"];
205
225
  }
226
+
206
227
  /**
207
228
  * @link https://seeds.sproutsocial.com/components/action-menu/
208
229
  *
@@ -214,7 +235,7 @@ interface TypeActionMenuProps extends TypeMenuRootOwnProps, Partial<Omit<UseSele
214
235
  */
215
236
  declare const ActionMenu: ({ children, stateReducer: externalStateReducer, ...useSelectProps }: TypeActionMenuProps) => react_jsx_runtime.JSX.Element;
216
237
 
217
- interface TypeSingleSelectMenuProps extends TypeMenuRootOwnProps, Partial<UseSelectProps<TypeDefaultItemProps>> {
238
+ interface TypeSingleSelectMenuProps extends TypeMenuRootOwnProps, TypeDownshiftSelectProps {
218
239
  children: TypeMenuRootProps["children"];
219
240
  }
220
241
 
@@ -228,7 +249,7 @@ interface TypeSingleSelectMenuProps extends TypeMenuRootOwnProps, Partial<UseSel
228
249
  */
229
250
  declare const SingleSelectMenu: ({ children, stateReducer: externalStateReducer, ...useSelectProps }: TypeSingleSelectMenuProps) => react_jsx_runtime.JSX.Element;
230
251
 
231
- interface TypeMultiSelectMenuProps extends TypeMenuRootOwnProps, TypeDownshiftMultiSelectProps {
252
+ interface TypeMultiSelectMenuProps extends TypeMenuRootOwnProps, TypeDownshiftSelectProps, TypeDownshiftMultiSelectProps {
232
253
  children: TypeMenuRootProps["children"];
233
254
  }
234
255
 
@@ -261,4 +282,4 @@ declare const defaultUseSelectProps: {
261
282
  isItemDisabled: (item: any) => boolean;
262
283
  };
263
284
 
264
- export { ActionMenu, 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 TypeDefaultItemProps, type TypeDownshiftMultiSelectProps, type TypeItemElements, type TypeMenuContentProps, type TypeMenuContext, type TypeMenuContextProps, type TypeMenuGroupProps, type TypeMenuGroupStyledProps, type TypeMenuHeaderProps, type TypeMenuItemProps, type TypeMenuItemStyledProps, type TypeMenuProviderProps, type TypeMenuRootOwnProps, type TypeMenuRootProps, type TypeMenuToggleButtonProps, type TypeNotEmptyChildren, type TypeSingleSelectMenuProps, type TypeUseItemsFromChildrenProps, defaultUseSelectProps, useItemsFromChildren, useMenu, useMenuContext, useSelectStateReducer };
285
+ export { ActionMenu, 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 TypeDefaultItemProps, type TypeDownshiftComboboxProps, type TypeDownshiftComboboxReturnValue, type TypeDownshiftMultiSelectProps, type TypeDownshiftMultiSelectReturnValue, type TypeDownshiftSelectProps, type TypeDownshiftSelectReturnValue, type TypeItemElements, type TypeMenuContentProps, type TypeMenuContext, type TypeMenuContextProps, 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 TypeUseItemsFromChildrenProps, defaultUseSelectProps, useItemsFromChildren, useMenu, useMenuContext, useSelectStateReducer };
package/dist/index.js CHANGED
@@ -2066,7 +2066,7 @@ var MenuContent = ({
2066
2066
  autoFocus: true,
2067
2067
  id,
2068
2068
  tabIndex: 0,
2069
- onKeyDown: getToggleButtonProps?.().onKeyDown,
2069
+ onKeyDown: getToggleButtonProps?.()["onKeyDown"] || void 0,
2070
2070
  "aria-activedescendant": getToggleButtonProps?.()["aria-activedescendant"],
2071
2071
  ...getMenuProps?.(
2072
2072
  {