@versini/ui-menu 5.1.0 → 5.1.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.
|
@@ -37,20 +37,20 @@ const d = ({
|
|
|
37
37
|
try {
|
|
38
38
|
window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
|
|
39
39
|
version: "4.2.2",
|
|
40
|
-
buildTime: "10/
|
|
40
|
+
buildTime: "10/20/2025 07:37 PM EDT",
|
|
41
41
|
homepage: "https://github.com/aversini/ui-components",
|
|
42
42
|
license: "MIT"
|
|
43
43
|
});
|
|
44
44
|
} catch {
|
|
45
45
|
}
|
|
46
46
|
/*!
|
|
47
|
-
@versini/ui-icons v4.
|
|
47
|
+
@versini/ui-icons v4.14.0
|
|
48
48
|
© 2025 gizmette.com
|
|
49
49
|
*/
|
|
50
50
|
try {
|
|
51
51
|
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
52
|
-
version: "4.
|
|
53
|
-
buildTime: "10/
|
|
52
|
+
version: "4.14.0",
|
|
53
|
+
buildTime: "10/20/2025 07:37 PM EDT",
|
|
54
54
|
homepage: "https://github.com/aversini/ui-components",
|
|
55
55
|
license: "MIT"
|
|
56
56
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as b, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useFloatingTree as se, useFloatingNodeId as ie, useFloatingParentNodeId as W, useListItem as re, useFloating as ae, autoUpdate as le, offset as de, flip as ue, shift as ce, useHover as fe, safePolygon as me, useClick as pe, useRole as he, useDismiss as ve, useListNavigation as ge, useTypeahead as we, useInteractions as ye, useMergeRefs as be, FloatingNode as D, FloatingList as S, FloatingPortal as _, FloatingFocusManager as K, FloatingTree as xe } from "@floating-ui/react";
|
|
3
|
-
import { I as Ie } from "../../chunks/index.
|
|
3
|
+
import { I as Ie } from "../../chunks/index.CQwwH0hY.js";
|
|
4
4
|
import Fe from "clsx";
|
|
5
5
|
import Ne, { forwardRef as q, useState as y, useRef as U, useContext as Me, useEffect as P } from "react";
|
|
6
6
|
import { MenuContext as R } from "./MenuContext.js";
|
|
@@ -128,8 +128,13 @@ const Ee = ({
|
|
|
128
128
|
} : {};
|
|
129
129
|
if (c && !e) {
|
|
130
130
|
const s = Fe(
|
|
131
|
-
"items-center flex-row justify-between",
|
|
132
|
-
"
|
|
131
|
+
"flex items-center flex-row justify-between",
|
|
132
|
+
"w-full",
|
|
133
|
+
"m-0 first:mt-0 mt-2 sm:mt-1 px-2 py-1",
|
|
134
|
+
"rounded-md border border-transparent",
|
|
135
|
+
"text-left text-base",
|
|
136
|
+
"outline-hidden focus:border focus:border-border-medium focus:bg-surface-lighter focus:underline",
|
|
137
|
+
"disabled:cursor-not-allowed disabled:text-copy-medium",
|
|
133
138
|
{
|
|
134
139
|
"bg-surface-lighter": o && !C
|
|
135
140
|
}
|
|
@@ -181,7 +186,7 @@ const Ee = ({
|
|
|
181
186
|
"div",
|
|
182
187
|
{
|
|
183
188
|
ref: E.setFloating,
|
|
184
|
-
className: "rounded-md bg-surface-light shadow-sm shadow-border-dark outline-hidden p-
|
|
189
|
+
className: "rounded-md bg-surface-light shadow-sm shadow-border-dark outline-hidden p-3 sm:p-2",
|
|
185
190
|
style: H,
|
|
186
191
|
...j(),
|
|
187
192
|
children: n
|
|
@@ -233,7 +238,7 @@ const Ee = ({
|
|
|
233
238
|
"div",
|
|
234
239
|
{
|
|
235
240
|
ref: E.setFloating,
|
|
236
|
-
className: "rounded-md bg-surface-light shadow-sm shadow-border-dark outline-hidden p-
|
|
241
|
+
className: "rounded-md bg-surface-light shadow-sm shadow-border-dark outline-hidden p-3 sm:p-2",
|
|
237
242
|
style: H,
|
|
238
243
|
...j(),
|
|
239
244
|
children: n
|
|
@@ -1,88 +1,87 @@
|
|
|
1
|
-
import { jsxs as x, jsx as
|
|
2
|
-
import { useListItem as
|
|
3
|
-
import { I as b } from "../../chunks/index.
|
|
1
|
+
import { jsxs as x, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useListItem as C, useFloatingTree as M, useMergeRefs as g } from "@floating-ui/react";
|
|
3
|
+
import { I as b } from "../../chunks/index.CQwwH0hY.js";
|
|
4
4
|
import l from "clsx";
|
|
5
5
|
import * as p from "react";
|
|
6
|
-
import { MenuContext as
|
|
7
|
-
const
|
|
6
|
+
import { MenuContext as h } from "./MenuContext.js";
|
|
7
|
+
const z = ({
|
|
8
8
|
className: e,
|
|
9
9
|
viewBox: t,
|
|
10
|
-
title:
|
|
11
|
-
monotone:
|
|
10
|
+
title: o,
|
|
11
|
+
monotone: a,
|
|
12
12
|
...r
|
|
13
13
|
}) => /* @__PURE__ */ x(
|
|
14
14
|
b,
|
|
15
15
|
{
|
|
16
|
-
defaultViewBox: "0 0
|
|
16
|
+
defaultViewBox: "0 0 512 512",
|
|
17
17
|
size: "size-5",
|
|
18
18
|
viewBox: t,
|
|
19
19
|
className: e,
|
|
20
|
-
title:
|
|
20
|
+
title: o || "Selected",
|
|
21
21
|
...r,
|
|
22
22
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ s(
|
|
24
24
|
"path",
|
|
25
25
|
{
|
|
26
|
-
d: "M0
|
|
26
|
+
d: "M0 256a256 256 0 1 0 512 0 256 256 0 1 0-512 0m352 0a96 96 0 1 1-192 0 96 96 0 1 1 192 0",
|
|
27
27
|
opacity: ".4"
|
|
28
28
|
}
|
|
29
29
|
),
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ s("path", { d: "M256 160a96 96 0 1 0 0 192 96 96 0 1 0 0-192" })
|
|
31
31
|
]
|
|
32
32
|
}
|
|
33
|
-
),
|
|
33
|
+
), I = ({
|
|
34
34
|
className: e,
|
|
35
35
|
viewBox: t,
|
|
36
|
-
title:
|
|
37
|
-
monotone:
|
|
36
|
+
title: o,
|
|
37
|
+
monotone: a,
|
|
38
38
|
...r
|
|
39
|
-
}) => /* @__PURE__ */
|
|
39
|
+
}) => /* @__PURE__ */ s(
|
|
40
40
|
b,
|
|
41
41
|
{
|
|
42
|
-
defaultViewBox: "0 0
|
|
42
|
+
defaultViewBox: "0 0 512 512",
|
|
43
43
|
size: "size-5",
|
|
44
44
|
viewBox: t,
|
|
45
45
|
className: e,
|
|
46
|
-
title:
|
|
46
|
+
title: o || "UnSelected",
|
|
47
47
|
...r,
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
-
"path",
|
|
50
|
-
{
|
|
51
|
-
d: "M0 96c0-35.3 28.7-64 64-64h320c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64z",
|
|
52
|
-
opacity: ".4"
|
|
53
|
-
}
|
|
54
|
-
)
|
|
48
|
+
children: /* @__PURE__ */ s("path", { d: "M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512", opacity: ".4" })
|
|
55
49
|
}
|
|
56
|
-
),
|
|
50
|
+
), k = p.forwardRef(
|
|
57
51
|
({
|
|
58
52
|
label: e,
|
|
59
53
|
disabled: t,
|
|
60
|
-
icon:
|
|
61
|
-
raw:
|
|
54
|
+
icon: o,
|
|
55
|
+
raw: a = !1,
|
|
62
56
|
children: r,
|
|
63
57
|
ignoreClick: u = !1,
|
|
64
58
|
selected: i,
|
|
65
|
-
...
|
|
66
|
-
},
|
|
59
|
+
...n
|
|
60
|
+
}, N) => {
|
|
67
61
|
let d = "";
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
return /* @__PURE__ */
|
|
62
|
+
const c = p.useContext(h), w = C({ label: t ? null : e }), f = M(), v = g([w.ref, N]);
|
|
63
|
+
if (a && r)
|
|
64
|
+
return /* @__PURE__ */ s(
|
|
71
65
|
"div",
|
|
72
66
|
{
|
|
73
67
|
role: "menuitem",
|
|
74
|
-
...
|
|
75
|
-
onClick(
|
|
76
|
-
u || (
|
|
68
|
+
...c.getItemProps({
|
|
69
|
+
onClick(m) {
|
|
70
|
+
u || (n.onClick?.(m), f?.events.emit("click"));
|
|
77
71
|
}
|
|
78
72
|
}),
|
|
79
73
|
children: r
|
|
80
74
|
}
|
|
81
75
|
);
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
"
|
|
85
|
-
"
|
|
76
|
+
o && (d = "pl-2");
|
|
77
|
+
const y = l(
|
|
78
|
+
"flex flex-row items-center",
|
|
79
|
+
"w-full",
|
|
80
|
+
"m-0 first:mt-0 mt-2 sm:mt-1 px-2 py-1",
|
|
81
|
+
"rounded-md border border-transparent",
|
|
82
|
+
"text-left text-base",
|
|
83
|
+
"outline-hidden focus:border focus:border-border-medium focus:bg-surface-lighter focus:underline",
|
|
84
|
+
"disabled:cursor-not-allowed disabled:text-copy-medium",
|
|
86
85
|
{
|
|
87
86
|
"bg-none": !t && !i
|
|
88
87
|
}
|
|
@@ -90,46 +89,48 @@ const g = ({
|
|
|
90
89
|
return /* @__PURE__ */ x(
|
|
91
90
|
"button",
|
|
92
91
|
{
|
|
93
|
-
...
|
|
92
|
+
...n,
|
|
94
93
|
ref: v,
|
|
95
94
|
role: "menuitem",
|
|
96
|
-
className:
|
|
95
|
+
className: y,
|
|
97
96
|
tabIndex: 0,
|
|
98
97
|
disabled: t,
|
|
99
|
-
...
|
|
100
|
-
onClick(
|
|
101
|
-
u || (
|
|
98
|
+
...c.getItemProps({
|
|
99
|
+
onClick(m) {
|
|
100
|
+
u || (n.onClick?.(m), f?.events.emit("click"));
|
|
102
101
|
},
|
|
103
|
-
onFocus(
|
|
104
|
-
|
|
102
|
+
onFocus(m) {
|
|
103
|
+
n.onFocus?.(m), c.setHasFocusInside(!0);
|
|
105
104
|
}
|
|
106
105
|
}),
|
|
107
106
|
children: [
|
|
108
|
-
i === !0 && /* @__PURE__ */
|
|
109
|
-
i === !1 && /* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
e && /* @__PURE__ */
|
|
107
|
+
i === !0 && /* @__PURE__ */ s(z, { className: "text-copy-success mr-2", size: "size-4" }),
|
|
108
|
+
i === !1 && /* @__PURE__ */ s(I, { className: "text-copy-medium mr-2", size: "size-4" }),
|
|
109
|
+
o,
|
|
110
|
+
e && /* @__PURE__ */ s("span", { className: d, children: e })
|
|
112
111
|
]
|
|
113
112
|
}
|
|
114
113
|
);
|
|
115
114
|
}
|
|
116
115
|
);
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
return /* @__PURE__ */
|
|
121
|
-
},
|
|
116
|
+
k.displayName = "MenuItem";
|
|
117
|
+
const j = ({ className: e, ...t }) => {
|
|
118
|
+
const o = l(e, "my-1 border-t border-border-medium");
|
|
119
|
+
return /* @__PURE__ */ s("div", { className: o, ...t });
|
|
120
|
+
}, P = ({
|
|
122
121
|
className: e,
|
|
123
122
|
...t
|
|
124
123
|
}) => {
|
|
125
|
-
const
|
|
124
|
+
const o = l(
|
|
126
125
|
e,
|
|
127
|
-
"pt-1 mb-2
|
|
126
|
+
"pt-1 mb-2",
|
|
127
|
+
"text-sm text-copy-dark font-bold",
|
|
128
|
+
"border-b border-border-medium"
|
|
128
129
|
);
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
+
return /* @__PURE__ */ s("div", { className: o, ...t });
|
|
130
131
|
};
|
|
131
132
|
export {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
P as MenuGroupLabel,
|
|
134
|
+
k as MenuItem,
|
|
135
|
+
j as MenuSeparator
|
|
135
136
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Menu as _ } from "./components/Menu/Menu.js";
|
|
2
2
|
import { MenuGroupLabel as n, MenuItem as t, MenuSeparator as u } from "./components/Menu/MenuItem.js";
|
|
3
3
|
/*!
|
|
4
|
-
@versini/ui-menu v5.1.
|
|
4
|
+
@versini/ui-menu v5.1.2
|
|
5
5
|
© 2025 gizmette.com
|
|
6
6
|
*/
|
|
7
7
|
try {
|
|
8
8
|
window.__VERSINI_UI_MENU__ || (window.__VERSINI_UI_MENU__ = {
|
|
9
|
-
version: "5.1.
|
|
10
|
-
buildTime: "10/
|
|
9
|
+
version: "5.1.2",
|
|
10
|
+
buildTime: "10/20/2025 07:55 PM EDT",
|
|
11
11
|
homepage: "https://github.com/aversini/ui-components",
|
|
12
12
|
license: "MIT"
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-menu",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@floating-ui/react": "0.27.16",
|
|
45
45
|
"@tailwindcss/typography": "0.5.19",
|
|
46
|
-
"@versini/ui-icons": "4.
|
|
46
|
+
"@versini/ui-icons": "4.14.0",
|
|
47
47
|
"clsx": "2.1.1",
|
|
48
|
-
"tailwindcss": "4.1.
|
|
48
|
+
"tailwindcss": "4.1.15"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": [
|
|
51
51
|
"**/*.css"
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "83222981436f0aa6a5885586df15430f32c23e43"
|
|
54
54
|
}
|