@sproutsocial/seeds-react-menu 1.6.0 → 1.6.2

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.
@@ -8,14 +8,14 @@ CLI Target: es2022
8
8
  CLI Cleaning output folder
9
9
  CJS Build start
10
10
  ESM Build start
11
- CJS dist/index.js 144.18 KB
12
- CJS dist/index.js.map 371.82 KB
13
- CJS ⚡️ Build success in 508ms
14
- ESM dist/esm/index.js 134.33 KB
15
- ESM dist/esm/index.js.map 370.55 KB
16
- ESM ⚡️ Build success in 509ms
11
+ CJS dist/index.js 144.34 KB
12
+ CJS dist/index.js.map 372.00 KB
13
+ CJS ⚡️ Build success in 526ms
14
+ ESM dist/esm/index.js 134.45 KB
15
+ ESM dist/esm/index.js.map 370.73 KB
16
+ ESM ⚡️ Build success in 532ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 14218ms
19
- DTS dist/index.d.ts 38.87 KB
20
- DTS dist/index.d.mts 38.87 KB
21
- Done in 16.75s.
18
+ DTS ⚡️ Build success in 16093ms
19
+ DTS dist/index.d.ts 39.03 KB
20
+ DTS dist/index.d.mts 39.03 KB
21
+ Done in 18.50s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @sproutsocial/seeds-react-menu
2
2
 
3
+ ## 1.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0b3224b: Allow autocomplete components to display empty state
8
+ - Updated dependencies [f55c7f4]
9
+ - @sproutsocial/seeds-react-token-input@1.4.1
10
+
11
+ ## 1.6.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 70e4ee7: [DS-3753] Fix handling of conditional items in menu groups
16
+
3
17
  ## 1.6.0
4
18
 
5
19
  ### Minor Changes
package/dist/esm/index.js CHANGED
@@ -2139,10 +2139,11 @@ var walkAllChildren = (children, callback) => {
2139
2139
  if (element === null || element === void 0) return;
2140
2140
  callback(element, parents2);
2141
2141
  const newParents = [...parents2, element];
2142
- const children2 = element.props?.children;
2143
- React4.Children.toArray(children2).forEach((child) => {
2144
- walk(child, newParents);
2145
- });
2142
+ if (React4.isValidElement(element) && element.props?.children) {
2143
+ React4.Children.toArray(element.props.children).forEach((child) => {
2144
+ walk(child, newParents);
2145
+ });
2146
+ }
2146
2147
  };
2147
2148
  const parents = [];
2148
2149
  React4.Children.toArray(children).forEach((child) => {
@@ -2186,21 +2187,20 @@ var addItemsFromGroup = ({
2186
2187
  });
2187
2188
  });
2188
2189
  } else if (menuGroup.props.children) {
2189
- let children = menuGroup.props.children;
2190
- if (!Array.isArray(children)) {
2191
- children = [children];
2192
- }
2190
+ const children = React4.Children.toArray(menuGroup.props.children);
2193
2191
  children.forEach((menuItem) => {
2194
- addMenuItem({
2195
- itemProps: {
2196
- id: menuItem.props.id,
2197
- disabled: menuItem.props.disabled,
2198
- menuItemProps: menuItem.props,
2199
- menuGroupProps: menuGroup.props
2200
- },
2201
- allMenuItems,
2202
- menuItemsMap
2203
- });
2192
+ if (React4.isValidElement(menuItem)) {
2193
+ addMenuItem({
2194
+ itemProps: {
2195
+ id: menuItem.props.id,
2196
+ disabled: menuItem.props.disabled,
2197
+ menuItemProps: menuItem.props,
2198
+ menuGroupProps: menuGroup.props
2199
+ },
2200
+ allMenuItems,
2201
+ menuItemsMap
2202
+ });
2203
+ }
2204
2204
  });
2205
2205
  }
2206
2206
  };
@@ -3693,6 +3693,7 @@ var SingleAutocomplete = ({
3693
3693
  MenuItemComponent,
3694
3694
  itemToString: itemToString2 = itemToString,
3695
3695
  getIsItemVisible,
3696
+ autoCloseOnEmpty = true,
3696
3697
  ...useComboboxProps
3697
3698
  }) => {
3698
3699
  const { allMenuItems, children } = useMenuChildren({
@@ -3726,6 +3727,7 @@ var SingleAutocomplete = ({
3726
3727
  {
3727
3728
  ...{
3728
3729
  isListbox: true,
3730
+ autoCloseOnEmpty,
3729
3731
  items: allMenuItems,
3730
3732
  itemToString: itemToString2,
3731
3733
  ...useComboboxProps,
@@ -3736,7 +3738,6 @@ var SingleAutocomplete = ({
3736
3738
  focusOnContent: false,
3737
3739
  ...userPopoutProps
3738
3740
  },
3739
- autoCloseOnEmpty: true,
3740
3741
  children
3741
3742
  }
3742
3743
  );
@@ -3762,6 +3763,7 @@ var MultiAutocomplete = ({
3762
3763
  getA11yMultiStatusMessage,
3763
3764
  onMultiSelectStateChange,
3764
3765
  multiSelectStateReducer,
3766
+ autoCloseOnEmpty = true,
3765
3767
  ...useComboboxProps
3766
3768
  }) => {
3767
3769
  const { allMenuItems, children } = useMenuChildren({
@@ -3864,6 +3866,7 @@ var MultiAutocomplete = ({
3864
3866
  {
3865
3867
  ...{
3866
3868
  isListbox: true,
3869
+ autoCloseOnEmpty,
3867
3870
  items: allMenuItems,
3868
3871
  itemToString: itemToString2,
3869
3872
  initialSelectedItems,
@@ -3881,7 +3884,6 @@ var MultiAutocomplete = ({
3881
3884
  focusOnContent: false,
3882
3885
  ...userPopoutProps
3883
3886
  },
3884
- autoCloseOnEmpty: true,
3885
3887
  children
3886
3888
  }
3887
3889
  );