@versini/ui-menu 4.0.13 → 5.0.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.
- package/dist/components/Menu/MenuItem.js +126 -44
- package/dist/index.js +3 -3
- package/package.json +6 -6
|
@@ -1,85 +1,167 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useListItem as
|
|
3
|
-
import { IconCopied as v } from "@versini/ui-icons";
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useListItem as h, useFloatingTree as N, useMergeRefs as g } from "@floating-ui/react";
|
|
4
3
|
import u from "clsx";
|
|
5
|
-
import * as
|
|
6
|
-
import { MenuContext as
|
|
7
|
-
const
|
|
4
|
+
import * as I from "react";
|
|
5
|
+
import { MenuContext as v } from "./MenuContext.js";
|
|
6
|
+
const C = ({
|
|
7
|
+
children: e,
|
|
8
|
+
fill: t,
|
|
9
|
+
viewBox: s,
|
|
10
|
+
className: l,
|
|
11
|
+
defaultViewBox: i,
|
|
12
|
+
size: m,
|
|
13
|
+
title: n,
|
|
14
|
+
semantic: r = !1,
|
|
15
|
+
...d
|
|
16
|
+
}) => {
|
|
17
|
+
const a = u(m, l);
|
|
18
|
+
return /* @__PURE__ */ p(
|
|
19
|
+
"svg",
|
|
20
|
+
{
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
className: a,
|
|
23
|
+
viewBox: s || i,
|
|
24
|
+
fill: t || "currentColor",
|
|
25
|
+
role: "img",
|
|
26
|
+
"aria-hidden": !r,
|
|
27
|
+
focusable: !1,
|
|
28
|
+
...d,
|
|
29
|
+
children: [
|
|
30
|
+
n && r && /* @__PURE__ */ o("title", { children: n }),
|
|
31
|
+
e
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
/*!
|
|
37
|
+
@versini/ui-svgicon v4.2.1
|
|
38
|
+
© 2025 gizmette.com
|
|
39
|
+
*/
|
|
40
|
+
try {
|
|
41
|
+
window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
|
|
42
|
+
version: "4.2.1",
|
|
43
|
+
buildTime: "08/27/2025 08:27 AM EDT",
|
|
44
|
+
homepage: "https://github.com/aversini/ui-components",
|
|
45
|
+
license: "MIT"
|
|
46
|
+
});
|
|
47
|
+
} catch {
|
|
48
|
+
}
|
|
49
|
+
const M = ({
|
|
50
|
+
className: e,
|
|
51
|
+
viewBox: t,
|
|
52
|
+
title: s,
|
|
53
|
+
monotone: l,
|
|
54
|
+
...i
|
|
55
|
+
}) => /* @__PURE__ */ p(
|
|
56
|
+
C,
|
|
57
|
+
{
|
|
58
|
+
defaultViewBox: "0 0 448 512",
|
|
59
|
+
size: "size-5",
|
|
60
|
+
viewBox: t,
|
|
61
|
+
className: e,
|
|
62
|
+
title: s || "Copied",
|
|
63
|
+
...i,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ o(
|
|
66
|
+
"path",
|
|
67
|
+
{
|
|
68
|
+
d: "M0 96v320c0 35.3 28.7 64 64 64h320c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96m104 160c0-6.1 2.3-12.3 7-17 9.4-9.4 24.6-9.4 33.9 0l47 47 111-111c4.7-4.7 10.8-7 17-7s12.3 2.3 17 7c2.3 2.3 4.1 5 5.3 7.9.6 1.5 1 2.9 1.3 4.4.2 1.1.3 2.2.3 2.2.1 1.2.1 1.2.1 2.5-.1 1.5-.1 1.9-.1 2.3-.1.7-.2 1.5-.3 2.2-.3 1.5-.7 3-1.3 4.4-1.2 2.9-2.9 5.6-5.3 7.9l-128 128c-4.7 4.7-10.8 7-17 7s-12.3-2.3-17-7l-64-64c-4.7-4.7-7-10.8-7-17z",
|
|
69
|
+
opacity: ".4"
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ o("path", { d: "M337 175c9.4 9.4 9.4 24.6 0 33.9L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0z" })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
/*!
|
|
77
|
+
@versini/ui-icons v4.11.0
|
|
78
|
+
© 2025 gizmette.com
|
|
79
|
+
*/
|
|
80
|
+
try {
|
|
81
|
+
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
82
|
+
version: "4.11.0",
|
|
83
|
+
buildTime: "08/27/2025 08:28 AM EDT",
|
|
84
|
+
homepage: "https://github.com/aversini/ui-components",
|
|
85
|
+
license: "MIT"
|
|
86
|
+
});
|
|
87
|
+
} catch {
|
|
88
|
+
}
|
|
89
|
+
const S = I.forwardRef(
|
|
8
90
|
({
|
|
9
91
|
label: e,
|
|
10
92
|
disabled: t,
|
|
11
|
-
icon:
|
|
12
|
-
raw:
|
|
93
|
+
icon: s,
|
|
94
|
+
raw: l = !1,
|
|
13
95
|
children: i,
|
|
14
|
-
ignoreClick:
|
|
15
|
-
selected:
|
|
16
|
-
...
|
|
17
|
-
},
|
|
18
|
-
let
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
return /* @__PURE__ */
|
|
96
|
+
ignoreClick: m = !1,
|
|
97
|
+
selected: n = !1,
|
|
98
|
+
...r
|
|
99
|
+
}, d) => {
|
|
100
|
+
let a = "";
|
|
101
|
+
const f = I.useContext(v), _ = h({ label: t ? null : e }), b = N(), w = g([_.ref, d]);
|
|
102
|
+
if (l && i)
|
|
103
|
+
return /* @__PURE__ */ o(
|
|
22
104
|
"div",
|
|
23
105
|
{
|
|
24
106
|
role: "menuitem",
|
|
25
|
-
...
|
|
26
|
-
onClick(
|
|
27
|
-
|
|
107
|
+
...f.getItemProps({
|
|
108
|
+
onClick(c) {
|
|
109
|
+
m || (r.onClick?.(c), b?.events.emit("click"));
|
|
28
110
|
}
|
|
29
111
|
}),
|
|
30
112
|
children: i
|
|
31
113
|
}
|
|
32
114
|
);
|
|
33
|
-
|
|
34
|
-
const
|
|
115
|
+
s && (a = "pl-2");
|
|
116
|
+
const x = u(
|
|
35
117
|
"items-center flex-row",
|
|
36
118
|
"m-0 first:mt-0 mt-2 sm:mt-1 px-2 py-1 flex w-full rounded-md border border-transparent text-left text-base outline-hidden focus:border focus:border-border-medium focus:bg-surface-lighter focus:underline disabled:cursor-not-allowed disabled:text-copy-medium",
|
|
37
119
|
{
|
|
38
|
-
"bg-none": !t && !
|
|
120
|
+
"bg-none": !t && !n
|
|
39
121
|
}
|
|
40
122
|
);
|
|
41
|
-
return /* @__PURE__ */
|
|
123
|
+
return /* @__PURE__ */ p(
|
|
42
124
|
"button",
|
|
43
125
|
{
|
|
44
|
-
...
|
|
45
|
-
ref:
|
|
126
|
+
...r,
|
|
127
|
+
ref: w,
|
|
46
128
|
role: "menuitem",
|
|
47
|
-
className:
|
|
129
|
+
className: x,
|
|
48
130
|
tabIndex: 0,
|
|
49
131
|
disabled: t,
|
|
50
|
-
...
|
|
51
|
-
onClick(
|
|
52
|
-
|
|
132
|
+
...f.getItemProps({
|
|
133
|
+
onClick(c) {
|
|
134
|
+
m || (r.onClick?.(c), b?.events.emit("click"));
|
|
53
135
|
},
|
|
54
|
-
onFocus(
|
|
55
|
-
|
|
136
|
+
onFocus(c) {
|
|
137
|
+
r.onFocus?.(c), f.setHasFocusInside(!0);
|
|
56
138
|
}
|
|
57
139
|
}),
|
|
58
140
|
children: [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
e && /* @__PURE__ */
|
|
141
|
+
n && /* @__PURE__ */ o(M, { className: "mr-2", size: "size-4" }),
|
|
142
|
+
s,
|
|
143
|
+
e && /* @__PURE__ */ o("span", { className: a, children: e })
|
|
62
144
|
]
|
|
63
145
|
}
|
|
64
146
|
);
|
|
65
147
|
}
|
|
66
148
|
);
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
},
|
|
149
|
+
S.displayName = "MenuItem";
|
|
150
|
+
const T = ({ className: e, ...t }) => {
|
|
151
|
+
const s = u(e, "my-1 border-t border-border-medium");
|
|
152
|
+
return /* @__PURE__ */ o("div", { className: s, ...t });
|
|
153
|
+
}, k = ({
|
|
72
154
|
className: e,
|
|
73
155
|
...t
|
|
74
156
|
}) => {
|
|
75
|
-
const
|
|
157
|
+
const s = u(
|
|
76
158
|
e,
|
|
77
159
|
"pt-1 mb-2 text-sm text-copy-dark border-b border-border-medium"
|
|
78
160
|
);
|
|
79
|
-
return /* @__PURE__ */
|
|
161
|
+
return /* @__PURE__ */ o("div", { className: s, ...t });
|
|
80
162
|
};
|
|
81
163
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
164
|
+
k as MenuGroupLabel,
|
|
165
|
+
S as MenuItem,
|
|
166
|
+
T as MenuSeparator
|
|
85
167
|
};
|
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
|
|
4
|
+
@versini/ui-menu v5.0.0
|
|
5
5
|
© 2025 gizmette.com
|
|
6
6
|
*/
|
|
7
7
|
try {
|
|
8
8
|
window.__VERSINI_UI_MENU__ || (window.__VERSINI_UI_MENU__ = {
|
|
9
|
-
version: "
|
|
10
|
-
buildTime: "09/01/2025
|
|
9
|
+
version: "5.0.0",
|
|
10
|
+
buildTime: "09/01/2025 03:18 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": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
"test": "vitest run"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"react": "^
|
|
41
|
-
"react-dom": "^
|
|
40
|
+
"react": "^19.0.0",
|
|
41
|
+
"react-dom": "^19.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@testing-library/jest-dom": "6.8.0",
|
|
45
|
-
"@versini/ui-types": "
|
|
45
|
+
"@versini/ui-types": "6.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@floating-ui/react": "0.27.16",
|
|
49
49
|
"@tailwindcss/typography": "0.5.16",
|
|
50
|
-
"@versini/ui-icons": "4.
|
|
50
|
+
"@versini/ui-icons": "4.11.0",
|
|
51
51
|
"clsx": "2.1.1",
|
|
52
52
|
"tailwindcss": "4.1.12"
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": [
|
|
55
55
|
"**/*.css"
|
|
56
56
|
],
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "70a47e9e30172dbb7b36306773fe9511e437fba6"
|
|
58
58
|
}
|