@versini/ui-menu 6.7.0 → 6.8.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/dist/index.js +18 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-menu v6.
|
|
2
|
+
@versini/ui-menu v6.8.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useUniqueId } from "@versini/ui-hooks/use-unique-id";
|
|
8
8
|
import { cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
9
|
-
import clsx_0
|
|
9
|
+
import clsx_0, { clsx } from "clsx";
|
|
10
10
|
import { IconNext } from "@versini/ui-icons";
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
|
|
16
17
|
const MenuGroupContext = createContext(false);
|
|
17
18
|
/* v8 ignore start - default context values are fallbacks, never used directly */ const MenuRootContext = createContext({
|
|
18
19
|
closeAll: ()=>{}
|
|
@@ -30,6 +31,7 @@ const MenuContentContext = createContext({
|
|
|
30
31
|
}); /* v8 ignore stop */
|
|
31
32
|
|
|
32
33
|
|
|
34
|
+
|
|
33
35
|
function getNextEnabledIndex(items, currentIndex, direction) {
|
|
34
36
|
const count = items.length;
|
|
35
37
|
/* v8 ignore start - empty items edge case */ if (count === 0) {
|
|
@@ -258,6 +260,7 @@ function getLastEnabledIndex(items) {
|
|
|
258
260
|
|
|
259
261
|
|
|
260
262
|
|
|
263
|
+
|
|
261
264
|
const getDisplayName = (element)=>{
|
|
262
265
|
if (typeof element === "string") {
|
|
263
266
|
return element;
|
|
@@ -359,7 +362,7 @@ const getMenuClasses = ({ isSub, noBackdrop = false })=>{
|
|
|
359
362
|
return clsx("bg-surface-light", "rounded-md", "outline-hidden", "p-1", {
|
|
360
363
|
"z-100 plume plume-dark": !isSub,
|
|
361
364
|
"z-60 mx-3": isSub,
|
|
362
|
-
"backdrop
|
|
365
|
+
"av-backdrop-animate": !noBackdrop && !isSub
|
|
363
366
|
});
|
|
364
367
|
};
|
|
365
368
|
|
|
@@ -640,6 +643,8 @@ Menu.displayName = "Menu";
|
|
|
640
643
|
|
|
641
644
|
|
|
642
645
|
|
|
646
|
+
|
|
647
|
+
|
|
643
648
|
const MenuGroup = ({ children, label, className, icon })=>{
|
|
644
649
|
const groupClass = clsx_0("rounded-md", "p-2", "first:mt-0 mt-1", "bg-surface-dark", "text-copy-light", className);
|
|
645
650
|
const labelContainerClass = clsx_0("pt-2 pb-2", "px-3 sm:px-2", "-mx-1 -mt-1", "flex items-center justify-between", "text-xs text-copy-medium uppercase font-bold", "rounded-t-md");
|
|
@@ -673,6 +678,9 @@ MenuGroup.displayName = "MenuGroup";
|
|
|
673
678
|
|
|
674
679
|
|
|
675
680
|
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
|
|
676
684
|
const ITEM_CLASS = getMenuItemClasses({
|
|
677
685
|
isSub: false
|
|
678
686
|
});
|
|
@@ -805,6 +813,8 @@ MenuItem.displayName = "MenuItem";
|
|
|
805
813
|
|
|
806
814
|
|
|
807
815
|
|
|
816
|
+
|
|
817
|
+
|
|
808
818
|
const MenuLabel = ({ className, icon, children, ...props })=>{
|
|
809
819
|
const groupLabelClass = clsx_0(className, "pt-1 pb-2", "text-xs text-copy-medium uppercase font-bold", "border-b border-border-medium", {
|
|
810
820
|
"flex items-center": icon
|
|
@@ -826,6 +836,8 @@ MenuLabel.displayName = "MenuLabel";
|
|
|
826
836
|
|
|
827
837
|
|
|
828
838
|
|
|
839
|
+
|
|
840
|
+
|
|
829
841
|
const MenuSeparator = ({ className, ...props })=>{
|
|
830
842
|
const separatorClass = clsx_0(className, "my-1 border-t border-border-medium");
|
|
831
843
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -845,6 +857,9 @@ MenuSeparator.displayName = "MenuSeparator";
|
|
|
845
857
|
|
|
846
858
|
|
|
847
859
|
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
848
863
|
const SUB_CONTENT_CLASS = getMenuClasses({
|
|
849
864
|
isSub: true
|
|
850
865
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-menu",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.8.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@versini/ui-hooks": "6.1.1",
|
|
45
|
-
"@versini/ui-icons": "4.19.
|
|
45
|
+
"@versini/ui-icons": "4.19.2",
|
|
46
46
|
"clsx": "2.1.1",
|
|
47
47
|
"tailwindcss": "4.2.1"
|
|
48
48
|
},
|
|
49
49
|
"sideEffects": [
|
|
50
50
|
"**/*.css"
|
|
51
51
|
],
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "6b50d466dbc1261a8539f469016ab438e4e8e51c"
|
|
53
53
|
}
|