Socket
Socket
Sign inDemoInstall

@chakra-ui/menu

Package Overview
Dependencies
Maintainers
2
Versions
556
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/menu - npm Package Compare versions

Comparing version 0.0.0-dev-20230718132637 to 0.0.0-dev-20230822131635

dist/chunk-4CNGLKYX.mjs

27

dist/index.js

@@ -274,6 +274,9 @@ 'use client'

const timeoutIds = (0, import_react2.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react2.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react2.useCallback)(() => {

@@ -295,3 +298,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -558,3 +561,3 @@ const rafId = (0, import_react2.useRef)(null);

var _a;
(_a = ref.current) == null ? void 0 : _a.focus();
(_a = ref.current) == null ? void 0 : _a.focus({ preventScroll: true });
rafId.current = null;

@@ -565,2 +568,7 @@ });

}
return () => {
if (rafId.current) {
cancelAnimationFrame(rafId.current);
}
};
}, [isFocused, trulyDisabled, menuRef, isOpen]);

@@ -658,9 +666,2 @@ const clickableProps = (0, import_clickable.useClickable)({

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react2.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -667,0 +668,0 @@ // src/menu.tsx

@@ -169,6 +169,9 @@ 'use client'

const timeoutIds = (0, import_react.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react.useCallback)(() => {

@@ -190,3 +193,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -255,9 +258,2 @@ const rafId = (0, import_react.useRef)(null);

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -264,0 +260,0 @@ // src/menu.tsx

@@ -168,6 +168,9 @@ 'use client'

const timeoutIds = (0, import_react.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react.useCallback)(() => {

@@ -189,3 +192,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -222,9 +225,2 @@ const rafId = (0, import_react.useRef)(null);

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -231,0 +227,0 @@ // src/menu.tsx

@@ -169,6 +169,9 @@ 'use client'

const timeoutIds = (0, import_react.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react.useCallback)(() => {

@@ -190,3 +193,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -223,9 +226,2 @@ const rafId = (0, import_react.useRef)(null);

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -232,0 +228,0 @@ // src/menu.tsx

@@ -169,6 +169,9 @@ 'use client'

const timeoutIds = (0, import_react.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react.useCallback)(() => {

@@ -190,3 +193,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -223,9 +226,2 @@ const rafId = (0, import_react.useRef)(null);

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -232,0 +228,0 @@ // src/menu.tsx

@@ -170,6 +170,9 @@ 'use client'

const timeoutIds = (0, import_react.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react.useCallback)(() => {

@@ -191,3 +194,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -224,9 +227,2 @@ const rafId = (0, import_react.useRef)(null);

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -233,0 +229,0 @@ // src/menu.tsx

@@ -166,6 +166,9 @@ 'use client'

const timeoutIds = (0, import_react.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react.useCallback)(() => {

@@ -187,3 +190,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -309,3 +312,3 @@ const rafId = (0, import_react.useRef)(null);

var _a;
(_a = ref.current) == null ? void 0 : _a.focus();
(_a = ref.current) == null ? void 0 : _a.focus({ preventScroll: true });
rafId.current = null;

@@ -316,2 +319,7 @@ });

}
return () => {
if (rafId.current) {
cancelAnimationFrame(rafId.current);
}
};
}, [isFocused, trulyDisabled, menuRef, isOpen]);

@@ -356,9 +364,2 @@ const clickableProps = (0, import_clickable.useClickable)({

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -365,0 +366,0 @@ // src/styled-menu-item.tsx

@@ -176,6 +176,9 @@ 'use client'

const timeoutIds = (0, import_react.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react.useCallback)(() => {

@@ -197,3 +200,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -319,3 +322,3 @@ const rafId = (0, import_react.useRef)(null);

var _a;
(_a = ref.current) == null ? void 0 : _a.focus();
(_a = ref.current) == null ? void 0 : _a.focus({ preventScroll: true });
rafId.current = null;

@@ -326,2 +329,7 @@ });

}
return () => {
if (rafId.current) {
cancelAnimationFrame(rafId.current);
}
};
}, [isFocused, trulyDisabled, menuRef, isOpen]);

@@ -357,9 +365,2 @@ const clickableProps = (0, import_clickable.useClickable)({

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -366,0 +367,0 @@ // src/menu.tsx

@@ -249,6 +249,9 @@ 'use client'

const timeoutIds = (0, import_react2.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react2.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react2.useCallback)(() => {

@@ -270,3 +273,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -426,9 +429,2 @@ const rafId = (0, import_react2.useRef)(null);

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react2.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -435,0 +431,0 @@ // src/menu.tsx

@@ -172,6 +172,9 @@ 'use client'

const timeoutIds = (0, import_react.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react.useCallback)(() => {

@@ -193,3 +196,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -275,9 +278,2 @@ const rafId = (0, import_react.useRef)(null);

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -284,0 +280,0 @@ // src/menu.tsx

@@ -166,6 +166,9 @@ 'use client'

const timeoutIds = (0, import_react.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react.useCallback)(() => {

@@ -187,3 +190,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -220,9 +223,2 @@ const rafId = (0, import_react.useRef)(null);

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -229,0 +225,0 @@ // src/menu.tsx

@@ -169,6 +169,9 @@ 'use client'

const timeoutIds = (0, import_react.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react.useCallback)(() => {

@@ -190,3 +193,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -223,9 +226,2 @@ const rafId = (0, import_react.useRef)(null);

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}

@@ -232,0 +228,0 @@ // src/menu.tsx

@@ -255,6 +255,9 @@ 'use client'

const timeoutIds = (0, import_react2.useRef)(/* @__PURE__ */ new Set([]));
useUnmountEffect(() => {
timeoutIds.current.forEach((id2) => clearTimeout(id2));
timeoutIds.current.clear();
});
(0, import_react2.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id2) => clearTimeout(id2));
ids.clear();
};
}, []);
const openAndFocusFirstItem = (0, import_react2.useCallback)(() => {

@@ -276,3 +279,3 @@ onOpen();

const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node;
node == null ? void 0 : node.focus();
node == null ? void 0 : node.focus({ preventScroll: true });
}, [isOpen, focusedIndex, descendants]);

@@ -539,3 +542,3 @@ const rafId = (0, import_react2.useRef)(null);

var _a;
(_a = ref.current) == null ? void 0 : _a.focus();
(_a = ref.current) == null ? void 0 : _a.focus({ preventScroll: true });
rafId.current = null;

@@ -546,2 +549,7 @@ });

}
return () => {
if (rafId.current) {
cancelAnimationFrame(rafId.current);
}
};
}, [isFocused, trulyDisabled, menuRef, isOpen]);

@@ -639,9 +647,2 @@ const clickableProps = (0, import_clickable.useClickable)({

}
function useUnmountEffect(fn, deps = []) {
return (0, import_react2.useEffect)(
() => () => fn(),
// eslint-disable-next-line react-hooks/exhaustive-deps
deps
);
}
// Annotate the CommonJS export names for ESM import in node:

@@ -648,0 +649,0 @@ 0 && (module.exports = {

{
"name": "@chakra-ui/menu",
"version": "0.0.0-dev-20230718132637",
"version": "0.0.0-dev-20230822131635",
"description": "A React component to render accessible menus",

@@ -35,33 +35,33 @@ "keywords": [

"dependencies": {
"@chakra-ui/clickable": "0.0.0-dev-20230718132637",
"@chakra-ui/descendant": "0.0.0-dev-20230718132637",
"@chakra-ui/popper": "0.0.0-dev-20230718132637",
"@chakra-ui/clickable": "2.1.0",
"@chakra-ui/descendant": "3.1.0",
"@chakra-ui/popper": "3.1.0",
"@chakra-ui/lazy-utils": "2.0.5",
"@chakra-ui/transition": "0.0.0-dev-20230718132637",
"@chakra-ui/react-context": "0.0.0-dev-20230718132637",
"@chakra-ui/transition": "2.1.0",
"@chakra-ui/react-context": "2.1.0",
"@chakra-ui/react-children-utils": "2.0.6",
"@chakra-ui/react-use-animation-state": "0.0.0-dev-20230718132637",
"@chakra-ui/react-use-disclosure": "0.0.0-dev-20230718132637",
"@chakra-ui/react-use-focus-effect": "0.0.0-dev-20230718132637",
"@chakra-ui/react-use-merge-refs": "0.0.0-dev-20230718132637",
"@chakra-ui/react-use-controllable-state": "0.0.0-dev-20230718132637",
"@chakra-ui/react-use-outside-click": "0.0.0-dev-20230718132637",
"@chakra-ui/react-use-update-effect": "0.0.0-dev-20230718132637",
"@chakra-ui/react-use-animation-state": "2.1.0",
"@chakra-ui/react-use-disclosure": "2.1.0",
"@chakra-ui/react-use-focus-effect": "2.1.0",
"@chakra-ui/react-use-merge-refs": "2.1.0",
"@chakra-ui/react-use-controllable-state": "2.1.0",
"@chakra-ui/react-use-outside-click": "2.2.0",
"@chakra-ui/react-use-update-effect": "2.1.0",
"@chakra-ui/shared-utils": "2.0.5"
},
"devDependencies": {
"react-icons": "^4.2.0",
"framer-motion": "^10.12.16",
"react": "^18.0.0",
"react-icons": "^4.10.1",
"framer-motion": "^10.16.1",
"react": "^18.2.0",
"clean-package": "2.2.0",
"@chakra-ui/system": "0.0.0-dev-20230718132637",
"@chakra-ui/image": "0.0.0-dev-20230718132637",
"@chakra-ui/modal": "0.0.0-dev-20230718132637",
"@chakra-ui/provider": "0.0.0-dev-20230718132637",
"@chakra-ui/portal": "0.0.0-dev-20230718132637",
"@chakra-ui/theme": "0.0.0-dev-20230718132637",
"@chakra-ui/button": "0.0.0-dev-20230718132637"
"@chakra-ui/system": "0.0.0-dev-20230822131635",
"@chakra-ui/image": "2.1.0",
"@chakra-ui/modal": "0.0.0-dev-20230822131635",
"@chakra-ui/provider": "0.0.0-dev-20230822131635",
"@chakra-ui/portal": "2.1.0",
"@chakra-ui/theme": "0.0.0-dev-20230822131635",
"@chakra-ui/button": "2.1.0"
},
"peerDependencies": {
"@chakra-ui/system": "0.0.0-dev-20230718132637",
"@chakra-ui/system": "0.0.0-dev-20230822131635",
"framer-motion": ">=4.0.0",

@@ -68,0 +68,0 @@ "react": ">=18"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc