@sproutsocial/seeds-react-menu 1.5.1 → 1.6.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.
@@ -8,90 +8,14 @@ CLI Target: es2022
8
8
  CLI Cleaning output folder
9
9
  CJS Build start
10
10
  ESM Build start
11
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
12
-
13
- ../../seeds-design-tokens/seeds-motion/package.json:12:6:
14
-  12 │ "types": "./dist/seeds-motion.d.ts"
15
- ╵ ~~~~~~~
16
-
17
- The "import" condition comes earlier and will be used for all "import" statements:
18
-
19
- ../../seeds-design-tokens/seeds-motion/package.json:10:6:
20
-  10 │ "import": "./dist/seeds-motion.esm.js",
21
- ╵ ~~~~~~~~
22
-
23
- The "require" condition comes earlier and will be used for all "require" calls:
24
-
25
- ../../seeds-design-tokens/seeds-motion/package.json:11:6:
26
-  11 │ "require": "./dist/seeds-motion.js",
27
- ╵ ~~~~~~~~~
28
-
29
-
30
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
31
-
32
- ../../seeds-design-tokens/seeds-motion/package.json:17:6:
33
-  17 │ "types": "./dist/seeds-motion-unitless.d.ts"
34
- ╵ ~~~~~~~
35
-
36
- The "import" condition comes earlier and will be used for all "import" statements:
37
-
38
- ../../seeds-design-tokens/seeds-motion/package.json:15:6:
39
-  15 │ "import": "./dist/seeds-motion-unitless.esm.js",
40
- ╵ ~~~~~~~~
41
-
42
- The "require" condition comes earlier and will be used for all "require" calls:
43
-
44
- ../../seeds-design-tokens/seeds-motion/package.json:16:6:
45
-  16 │ "require": "./dist/seeds-motion-unitless.js",
46
- ╵ ~~~~~~~~~
47
-
48
-
49
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
50
-
51
- ../../seeds-design-tokens/seeds-motion/package.json:12:6:
52
-  12 │ "types": "./dist/seeds-motion.d.ts"
53
- ╵ ~~~~~~~
54
-
55
- The "import" condition comes earlier and will be used for all "import" statements:
56
-
57
- ../../seeds-design-tokens/seeds-motion/package.json:10:6:
58
-  10 │ "import": "./dist/seeds-motion.esm.js",
59
- ╵ ~~~~~~~~
60
-
61
- The "require" condition comes earlier and will be used for all "require" calls:
62
-
63
- ../../seeds-design-tokens/seeds-motion/package.json:11:6:
64
-  11 │ "require": "./dist/seeds-motion.js",
65
- ╵ ~~~~~~~~~
66
-
67
-
68
- [warn] ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
69
-
70
- ../../seeds-design-tokens/seeds-motion/package.json:17:6:
71
-  17 │ "types": "./dist/seeds-motion-unitless.d.ts"
72
- ╵ ~~~~~~~
73
-
74
- The "import" condition comes earlier and will be used for all "import" statements:
75
-
76
- ../../seeds-design-tokens/seeds-motion/package.json:15:6:
77
-  15 │ "import": "./dist/seeds-motion-unitless.esm.js",
78
- ╵ ~~~~~~~~
79
-
80
- The "require" condition comes earlier and will be used for all "require" calls:
81
-
82
- ../../seeds-design-tokens/seeds-motion/package.json:16:6:
83
-  16 │ "require": "./dist/seeds-motion-unitless.js",
84
- ╵ ~~~~~~~~~
85
-
86
-
87
- CJS dist/index.js 143.93 KB
88
- CJS dist/index.js.map 371.38 KB
89
- CJS ⚡️ Build success in 626ms
90
- ESM dist/esm/index.js 134.17 KB
91
- ESM dist/esm/index.js.map 370.11 KB
92
- ESM ⚡️ Build success in 628ms
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
93
17
  DTS Build start
94
- DTS ⚡️ Build success in 15609ms
95
- DTS dist/index.d.ts 38.55 KB
96
- DTS dist/index.d.mts 38.55 KB
97
- Done in 18.46s.
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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @sproutsocial/seeds-react-menu
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 74bb102: Export the DefaultMenuEmptyState for external use
8
+
9
+ ## 1.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - a1ce7c5: [DS-3609] Fix the infinite rerender in the NestedMenu related to dynamic Popout positioning
14
+ - Updated dependencies [a1ce7c5]
15
+ - @sproutsocial/seeds-react-popout@2.4.2
16
+
3
17
  ## 1.5.1
4
18
 
5
19
  ### Patch Changes
package/dist/esm/index.js CHANGED
@@ -2307,16 +2307,18 @@ import { useCallback } from "react";
2307
2307
 
2308
2308
  // src/MenuContent/DefaultMenuEmptyState.tsx
2309
2309
  import styled4 from "styled-components";
2310
+ import { Box as Box2 } from "@sproutsocial/seeds-react-box";
2310
2311
  import { jsx as jsx6 } from "react/jsx-runtime";
2311
- var StyledEmptyState = styled4.div`
2312
+ var StyledEmptyState = styled4(Box2)`
2312
2313
  padding: ${({ theme: theme2 }) => theme2.space[350]};
2313
2314
  text-align: center;
2314
2315
  font-size: ${({ theme: theme2 }) => theme2.typography[200].fontSize};
2315
2316
  `;
2316
2317
  var DefaultMenuEmptyState = ({
2317
- children
2318
+ children = "No items found",
2319
+ ...props
2318
2320
  }) => {
2319
- return /* @__PURE__ */ jsx6(StyledEmptyState, { children: children || "No results found." });
2321
+ return /* @__PURE__ */ jsx6(StyledEmptyState, { ...props, children });
2320
2322
  };
2321
2323
 
2322
2324
  // src/MenuContent/MenuContent.tsx
@@ -2381,8 +2383,8 @@ import "react";
2381
2383
 
2382
2384
  // src/MenuFooter/styles.tsx
2383
2385
  import styled5 from "styled-components";
2384
- import { Box as Box2 } from "@sproutsocial/seeds-react-box";
2385
- var StyledMenuFooterBox = styled5(Box2)`
2386
+ import { Box as Box3 } from "@sproutsocial/seeds-react-box";
2387
+ var StyledMenuFooterBox = styled5(Box3)`
2386
2388
  padding: ${({ theme: theme2 }) => theme2.space[350]} ${({ theme: theme2 }) => theme2.space[400]};
2387
2389
  border-top: 1px solid ${(p) => p.theme.colors.container.border.base};
2388
2390
  `;
@@ -3052,7 +3054,7 @@ var MenuSearchTokenInput = ({
3052
3054
  // src/SubmenuItem/SubmenuItem.tsx
3053
3055
  import React13 from "react";
3054
3056
  import { Icon as Icon2 } from "@sproutsocial/seeds-react-icon";
3055
- import { Box as Box3 } from "@sproutsocial/seeds-react-box";
3057
+ import { Box as Box4 } from "@sproutsocial/seeds-react-box";
3056
3058
  import { mergeRefs as mergeRefs2 } from "@sproutsocial/seeds-react-utilities";
3057
3059
  import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
3058
3060
  var SubmenuItemTrigger = ({
@@ -3080,7 +3082,7 @@ var SubmenuItemTrigger = ({
3080
3082
  { suppressRefError: true }
3081
3083
  ),
3082
3084
  id,
3083
- children: /* @__PURE__ */ jsxs4(Box3, { display: "flex", justifyContent: "space-between", children: [
3085
+ children: /* @__PURE__ */ jsxs4(Box4, { display: "flex", justifyContent: "space-between", children: [
3084
3086
  children,
3085
3087
  /* @__PURE__ */ jsx17(MenuItemActionRight, { children: /* @__PURE__ */ jsx17(Icon2, { name: "chevron-right-outline" }) })
3086
3088
  ] })
@@ -4000,7 +4002,7 @@ var AutocompleteSelect = (props) => {
4000
4002
  };
4001
4003
 
4002
4004
  // src/NestedMenu/NestedMenu.tsx
4003
- import { useId, useEffect as useEffect4, useState } from "react";
4005
+ import { useId, useEffect as useEffect4, useState, useRef as useRef2 } from "react";
4004
4006
  import { AnimatePresence as AnimatePresence2, motion as motion3 } from "motion/react";
4005
4007
  import { useSelect as useSelect6 } from "downshift";
4006
4008
 
@@ -4072,7 +4074,7 @@ import { mergeRefs as mergeRefs3 } from "@sproutsocial/seeds-react-utilities";
4072
4074
 
4073
4075
  // src/NestedMenu/NestedMenuItem.tsx
4074
4076
  import { Icon as Icon5 } from "@sproutsocial/seeds-react-icon";
4075
- import { Box as Box4 } from "@sproutsocial/seeds-react-box";
4077
+ import { Box as Box5 } from "@sproutsocial/seeds-react-box";
4076
4078
  import { jsx as jsx29, jsxs as jsxs6 } from "react/jsx-runtime";
4077
4079
  var NestedMenuItem = ({
4078
4080
  children,
@@ -4089,7 +4091,7 @@ var NestedMenuItem = ({
4089
4091
  }
4090
4092
  }
4091
4093
  } : {};
4092
- return /* @__PURE__ */ jsx29(MenuItem, { ...onClickProps, ...rest, children: /* @__PURE__ */ jsxs6(Box4, { display: "flex", justifyContent: "space-between", children: [
4094
+ return /* @__PURE__ */ jsx29(MenuItem, { ...onClickProps, ...rest, children: /* @__PURE__ */ jsxs6(Box5, { display: "flex", justifyContent: "space-between", children: [
4093
4095
  children,
4094
4096
  childMenuId && /* @__PURE__ */ jsx29(MenuItemActionRight, { children: /* @__PURE__ */ jsx29(Icon5, { name: "arrow-right-outline" }) })
4095
4097
  ] }) });
@@ -4302,7 +4304,7 @@ var NestedMenu = ({
4302
4304
  const [activeMenuContext, setActiveMenuContext] = useState(defaultMenuContext);
4303
4305
  const [currentMenuId, setCurrentMenuId] = useState(initialMenuId);
4304
4306
  const [isAdding, setIsAdding] = useState(false);
4305
- const [popoutUpdateRef, setPopoutUpdateRef] = useState();
4307
+ const popoutUpdateRef = useRef2();
4306
4308
  const setSelectedMenuId = (id) => {
4307
4309
  setIsAdding(true);
4308
4310
  setSelectedMenuPath((currentPath) => [...currentPath, id]);
@@ -4311,7 +4313,6 @@ var NestedMenu = ({
4311
4313
  if (selectedMenuPath.length > 0) {
4312
4314
  const newMenuId = selectedMenuPath[selectedMenuPath.length - 1];
4313
4315
  setCurrentMenuId(newMenuId);
4314
- popoutUpdateRef?.();
4315
4316
  }
4316
4317
  }, [selectedMenuPath.join("-")]);
4317
4318
  const resetSelectedMenuPath = () => {
@@ -4433,6 +4434,9 @@ var NestedMenu = ({
4433
4434
  ),
4434
4435
  ...restMenuProps
4435
4436
  };
4437
+ useEffect4(() => {
4438
+ popoutUpdateRef.current?.();
4439
+ }, [nestedMenuProps.children]);
4436
4440
  return /* @__PURE__ */ jsx34(
4437
4441
  NestedMenuProvider,
4438
4442
  {
@@ -4466,7 +4470,7 @@ var NestedMenu = ({
4466
4470
  menuToggleElement,
4467
4471
  width: width2,
4468
4472
  scheduleUpdateRef: (callback) => {
4469
- setPopoutUpdateRef(callback);
4473
+ popoutUpdateRef.current = callback;
4470
4474
  externalPopoutUpdateRef?.(callback);
4471
4475
  },
4472
4476
  ...restPopoutProps
@@ -4482,6 +4486,7 @@ export {
4482
4486
  AutocompleteSelect,
4483
4487
  AutocompleteTokenInput,
4484
4488
  CustomPopoutContent,
4489
+ DefaultMenuEmptyState,
4485
4490
  INPUT_TYPES,
4486
4491
  ListboxToggleButton,
4487
4492
  MenuContent,