@sproutsocial/seeds-react-menu 0.2.1 → 0.2.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.
package/.eslintrc.js CHANGED
@@ -1,8 +1,4 @@
1
1
  module.exports = {
2
- root: true,
3
- extends: ["eslint-config-seeds/react"],
4
- parserOptions: {
5
- tsconfigRootDir: __dirname,
6
- project: "./tsconfig.json", // Reference the new TypeScript config
7
- },
2
+ root: "",
3
+ extends: ["eslint-config-seeds/racine"],
8
4
  };
@@ -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 85.28 KB
12
- CJS dist/index.js.map 253.29 KB
13
- CJS ⚡️ Build success in 188ms
14
- ESM dist/esm/index.js 80.67 KB
15
- ESM dist/esm/index.js.map 252.44 KB
16
- ESM ⚡️ Build success in 210ms
11
+ ESM dist/esm/index.js 80.43 KB
12
+ ESM dist/esm/index.js.map 251.90 KB
13
+ ESM ⚡️ Build success in 486ms
14
+ CJS dist/index.js 85.03 KB
15
+ CJS dist/index.js.map 252.76 KB
16
+ CJS ⚡️ Build success in 495ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 3812ms
19
- DTS dist/index.d.ts 13.45 KB
20
- DTS dist/index.d.mts 13.45 KB
21
- Done in 4.69s.
18
+ DTS ⚡️ Build success in 11030ms
19
+ DTS dist/index.d.ts 13.55 KB
20
+ DTS dist/index.d.mts 13.55 KB
21
+ Done in 13.63s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @sproutsocial/seeds-react-menu
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 6db5ede: Restores MenuItem CSS transitions
8
+ - Fixes a bug where MenuItem was not animating as expected
9
+
3
10
  ## 0.2.1
4
11
 
5
12
  ### Patch Changes
package/dist/esm/index.js CHANGED
@@ -98,7 +98,11 @@ var require_object_assign = __commonJS({
98
98
  import { useContext as useContext3 } from "react";
99
99
 
100
100
  // src/MenuContext.tsx
101
- import { createContext, useMemo, useContext } from "react";
101
+ import {
102
+ createContext,
103
+ useMemo,
104
+ useContext
105
+ } from "react";
102
106
  import { jsx } from "react/jsx-runtime";
103
107
  var defaultMenuContext = {
104
108
  items: [],
@@ -1705,7 +1709,6 @@ var MenuItemContainer = styled.li`
1705
1709
  list-style-type: none;
1706
1710
  margin-left: ${({ theme: theme2 }) => theme2.space[300]};
1707
1711
  margin-right: ${({ theme: theme2 }) => theme2.space[300]};
1708
- transition: all ${({ theme: theme2 }) => theme2.duration["fast"]};
1709
1712
 
1710
1713
  &:first-child {
1711
1714
  margin-top: ${({ theme: theme2 }) => theme2.space[300]};
@@ -1730,6 +1733,7 @@ var StyledMenuItem = styled.div`
1730
1733
  padding: ${({ theme: theme2 }) => theme2.space[300]};
1731
1734
  outline: 0;
1732
1735
  ${({ theme: theme2 }) => theme2.typography[200]};
1736
+ transition: all ${({ theme: theme2 }) => theme2.duration["fast"]};
1733
1737
 
1734
1738
  /* Highlighted */
1735
1739
  ${({ $highlighted }) => $highlighted && highlightedStyles}
@@ -1860,7 +1864,6 @@ var useOptionProps = ({
1860
1864
  const { selectedItem, selectedItems, isListbox } = useContext2(MenuContext);
1861
1865
  const selected = useMemo2(
1862
1866
  () => selectedItem?.id === id || !!selectedItems?.find((item) => item?.id === id),
1863
- // eslint-disable-next-line react-hooks/exhaustive-deps
1864
1867
  [selectedItem, selectedItems]
1865
1868
  );
1866
1869
  const label = inputLabelId || `menu-item-child-${id}`;
@@ -1890,12 +1893,9 @@ var MenuItem = ({
1890
1893
  children,
1891
1894
  onClick,
1892
1895
  onKeyDown,
1893
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1894
1896
  disabled: disabled2 = false,
1895
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1896
1897
  ref,
1897
1898
  href,
1898
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1899
1899
  color: color2,
1900
1900
  ...props
1901
1901
  }) => {
@@ -2270,6 +2270,7 @@ var MenuRoot = ({
2270
2270
  return /* @__PURE__ */ jsx9(MenuProvider, { ...contextProps, children: /* @__PURE__ */ jsx9(
2271
2271
  Popout,
2272
2272
  {
2273
+ menuPopout: true,
2273
2274
  isOpen: !!isOpen,
2274
2275
  setIsOpen,
2275
2276
  content: /* @__PURE__ */ jsx9(CustomPopoutContent, { width: width2, children }),
@@ -2364,13 +2365,12 @@ var useItemsFromChildren = ({
2364
2365
  const allMenuItemElements = getAllMenuItems(children);
2365
2366
  const menuItemsMap2 = {};
2366
2367
  const allMenuItems2 = allMenuItemElements.map(
2367
- ({ element, parents }, index) => {
2368
+ ({ element }, index) => {
2368
2369
  const item = {
2369
2370
  id: element.props.id,
2370
2371
  disabled: element.props.disabled,
2371
2372
  index,
2372
- element,
2373
- parents
2373
+ menuItemProps: element.props
2374
2374
  };
2375
2375
  menuItemsMap2[`${item.id}`] = item;
2376
2376
  return item;
@@ -2415,11 +2415,11 @@ var handleStateChange = (changes, currentSelectedItem) => {
2415
2415
  const selectedItem = changes.selectedItem || currentSelectedItem;
2416
2416
  if (!selectedItem)
2417
2417
  return;
2418
- if (selectedItem.element?.props?.disabled) {
2418
+ if (selectedItem.disabled) {
2419
2419
  return;
2420
2420
  }
2421
2421
  const isEnterKeyDown = changes.type === useSelect2.stateChangeTypes.ToggleButtonKeyDownEnter;
2422
- const selectedItemProps = selectedItem.element?.props;
2422
+ const selectedItemProps = selectedItem.menuItemProps;
2423
2423
  if (selectedItemProps?.onClick) {
2424
2424
  const syntheticKeyboardEvent = new KeyboardEvent("keydown", {
2425
2425
  key: isEnterKeyDown ? "Enter" : " ",