@sproutsocial/seeds-react-menu 1.6.0 → 1.6.1

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
@@ -280,7 +280,7 @@ type TypeChildrenOrItems<I extends TypeMenuItemProps = TypeMenuItemProps> = Type
280
280
  menuItems: I[];
281
281
  MenuItemComponent?: React.ComponentType<I>;
282
282
  });
283
- type TypeNotEmptyChildren = React.ReactChild | React.ReactFragment | React.ReactPortal;
283
+ type TypeNotEmptyChildren = Exclude<React.ReactNode, null | undefined>;
284
284
  type TypeInputEventListeners = "onKeyDown" | "onChange" | "onInput" | "onBlur" | "onClick" | "refKey";
285
285
  type TypeDownshiftMergedInputProps<B> = Pick<UseComboboxGetInputPropsOptions, TypeInputEventListeners> & Omit<Partial<B>, TypeInputEventListeners>;
286
286
 
@@ -662,7 +662,7 @@ declare const useMenuChildren: <I extends TypeMenuItemProps = TypeMenuItemProps>
662
662
  menuItemsMap: {
663
663
  [key: string]: TypeInternalItemProps<TypeMenuItemProps>;
664
664
  };
665
- children: TypeNotEmptyChildren;
665
+ children: string | number | true | React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | React__default.ReactPortal;
666
666
  };
667
667
 
668
668
  declare const useSelectStateReducer: Required<UseSelectProps<TypeInternalItemProps>>["stateReducer"];
package/dist/index.d.ts CHANGED
@@ -280,7 +280,7 @@ type TypeChildrenOrItems<I extends TypeMenuItemProps = TypeMenuItemProps> = Type
280
280
  menuItems: I[];
281
281
  MenuItemComponent?: React.ComponentType<I>;
282
282
  });
283
- type TypeNotEmptyChildren = React.ReactChild | React.ReactFragment | React.ReactPortal;
283
+ type TypeNotEmptyChildren = Exclude<React.ReactNode, null | undefined>;
284
284
  type TypeInputEventListeners = "onKeyDown" | "onChange" | "onInput" | "onBlur" | "onClick" | "refKey";
285
285
  type TypeDownshiftMergedInputProps<B> = Pick<UseComboboxGetInputPropsOptions, TypeInputEventListeners> & Omit<Partial<B>, TypeInputEventListeners>;
286
286
 
@@ -662,7 +662,7 @@ declare const useMenuChildren: <I extends TypeMenuItemProps = TypeMenuItemProps>
662
662
  menuItemsMap: {
663
663
  [key: string]: TypeInternalItemProps<TypeMenuItemProps>;
664
664
  };
665
- children: TypeNotEmptyChildren;
665
+ children: string | number | true | React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | React__default.ReactPortal;
666
666
  };
667
667
 
668
668
  declare const useSelectStateReducer: Required<UseSelectProps<TypeInternalItemProps>>["stateReducer"];
package/dist/index.js CHANGED
@@ -2203,10 +2203,11 @@ var walkAllChildren = (children, callback) => {
2203
2203
  if (element === null || element === void 0) return;
2204
2204
  callback(element, parents2);
2205
2205
  const newParents = [...parents2, element];
2206
- const children2 = element.props?.children;
2207
- import_react4.default.Children.toArray(children2).forEach((child) => {
2208
- walk(child, newParents);
2209
- });
2206
+ if (import_react4.default.isValidElement(element) && element.props?.children) {
2207
+ import_react4.default.Children.toArray(element.props.children).forEach((child) => {
2208
+ walk(child, newParents);
2209
+ });
2210
+ }
2210
2211
  };
2211
2212
  const parents = [];
2212
2213
  import_react4.default.Children.toArray(children).forEach((child) => {
@@ -2250,21 +2251,20 @@ var addItemsFromGroup = ({
2250
2251
  });
2251
2252
  });
2252
2253
  } else if (menuGroup.props.children) {
2253
- let children = menuGroup.props.children;
2254
- if (!Array.isArray(children)) {
2255
- children = [children];
2256
- }
2254
+ const children = import_react4.default.Children.toArray(menuGroup.props.children);
2257
2255
  children.forEach((menuItem) => {
2258
- addMenuItem({
2259
- itemProps: {
2260
- id: menuItem.props.id,
2261
- disabled: menuItem.props.disabled,
2262
- menuItemProps: menuItem.props,
2263
- menuGroupProps: menuGroup.props
2264
- },
2265
- allMenuItems,
2266
- menuItemsMap
2267
- });
2256
+ if (import_react4.default.isValidElement(menuItem)) {
2257
+ addMenuItem({
2258
+ itemProps: {
2259
+ id: menuItem.props.id,
2260
+ disabled: menuItem.props.disabled,
2261
+ menuItemProps: menuItem.props,
2262
+ menuGroupProps: menuGroup.props
2263
+ },
2264
+ allMenuItems,
2265
+ menuItemsMap
2266
+ });
2267
+ }
2268
2268
  });
2269
2269
  }
2270
2270
  };