@sproutsocial/seeds-react-menu 1.3.0 → 1.3.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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +8 -2
- package/dist/esm/index.js +6 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/MenuContent/MenuContent.tsx +2 -1
- package/src/MenuContext.tsx +3 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -46,9 +46,6 @@ ESM Build start
|
|
|
46
46
|
╵ [32m~~~~~~~~~[0m
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
ESM dist/esm/index.js 132.88 KB
|
|
50
|
-
ESM dist/esm/index.js.map 367.00 KB
|
|
51
|
-
ESM ⚡️ Build success in 645ms
|
|
52
49
|
[warn] [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe condition "types" here will never be used as it comes after both "import" and "require"[0m [package.json]
|
|
53
50
|
|
|
54
51
|
../../seeds-design-tokens/seeds-motion/package.json:12:6:
|
|
@@ -87,11 +84,14 @@ ESM ⚡️ Build success in 645ms
|
|
|
87
84
|
╵ [32m~~~~~~~~~[0m
|
|
88
85
|
|
|
89
86
|
|
|
90
|
-
CJS dist/index.js 142.
|
|
91
|
-
CJS dist/index.js.map 368.
|
|
92
|
-
CJS ⚡️ Build success in
|
|
87
|
+
CJS dist/index.js 142.61 KB
|
|
88
|
+
CJS dist/index.js.map 368.34 KB
|
|
89
|
+
CJS ⚡️ Build success in 596ms
|
|
90
|
+
ESM dist/esm/index.js 132.96 KB
|
|
91
|
+
ESM dist/esm/index.js.map 367.06 KB
|
|
92
|
+
ESM ⚡️ Build success in 595ms
|
|
93
93
|
DTS Build start
|
|
94
|
-
DTS ⚡️ Build success in
|
|
95
|
-
DTS dist/index.d.ts 37.
|
|
96
|
-
DTS dist/index.d.mts 37.
|
|
97
|
-
Done in 19.
|
|
94
|
+
DTS ⚡️ Build success in 16013ms
|
|
95
|
+
DTS dist/index.d.ts 37.08 KB
|
|
96
|
+
DTS dist/index.d.mts 37.08 KB
|
|
97
|
+
Done in 19.00s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
# @sproutsocial/seeds-react-menu
|
|
2
2
|
|
|
3
|
+
## 1.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8d18309: MenuContent no longer shows empty state outside of a context provider.
|
|
8
|
+
|
|
3
9
|
## 1.3.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
6
12
|
|
|
7
|
-
-
|
|
13
|
+
- 7fe0b84: This update introduces a `DefaultMenuEmptyState` for filter menus and an `emptyStateElement` prop on `MenuContent` to allow for custom empty states to be passed in to the `seeds-react-menu` package.
|
|
8
14
|
|
|
9
15
|
### Patch Changes
|
|
10
16
|
|
|
11
|
-
-
|
|
17
|
+
- e60ec1d: This update fixes a bug that prevented developers from passing custom popoutProps.
|
|
12
18
|
|
|
13
19
|
## 1.2.3
|
|
14
20
|
|
package/dist/esm/index.js
CHANGED
|
@@ -102,7 +102,8 @@ var defaultMenuContext = {
|
|
|
102
102
|
itemsMap: {},
|
|
103
103
|
isItemSelected: () => false,
|
|
104
104
|
getInputComponentProps: () => ({}),
|
|
105
|
-
hasVisibleItems: false
|
|
105
|
+
hasVisibleItems: false,
|
|
106
|
+
isInitialized: false
|
|
106
107
|
};
|
|
107
108
|
var getSelectedItemIds = (selectedItems) => selectedItems?.reduce(
|
|
108
109
|
(selected, item) => ({ ...selected, [item.id]: true }),
|
|
@@ -196,6 +197,7 @@ var useMenu = ({
|
|
|
196
197
|
contentRef,
|
|
197
198
|
hasVisibleItems,
|
|
198
199
|
autoCloseOnEmpty,
|
|
200
|
+
isInitialized: true,
|
|
199
201
|
...menuProps
|
|
200
202
|
};
|
|
201
203
|
};
|
|
@@ -2341,11 +2343,12 @@ var MenuContent = ({
|
|
|
2341
2343
|
getMenuProps,
|
|
2342
2344
|
isListbox,
|
|
2343
2345
|
hasVisibleItems,
|
|
2344
|
-
autoCloseOnEmpty
|
|
2346
|
+
autoCloseOnEmpty,
|
|
2347
|
+
isInitialized
|
|
2345
2348
|
} = useMenuContentContext();
|
|
2346
2349
|
const toggleButtonProps = getToggleButtonProps?.();
|
|
2347
2350
|
const children = childrenProp || !menuItems || !menuItems.length ? childrenProp : mapMenuItems({ menuItems, MenuItemComponent });
|
|
2348
|
-
if (!hasVisibleItems && !autoCloseOnEmpty) {
|
|
2351
|
+
if (isInitialized && !hasVisibleItems && !autoCloseOnEmpty) {
|
|
2349
2352
|
return emptyStateElement ?? /* @__PURE__ */ jsx7(DefaultMenuEmptyState, {});
|
|
2350
2353
|
}
|
|
2351
2354
|
if (!children) {
|