@versini/ui-menu 4.0.11 → 4.0.13

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/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # @versini/ui-menu
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@versini/ui-menu?style=flat-square)](https://www.npmjs.com/package/@versini/ui-menu)
4
+ ![npm package minimized gzipped size](<https://img.shields.io/bundlejs/size/%40versini%2Fui-menu?style=flat-square&label=size%20(gzip)>)
4
5
 
5
6
  > Accessible and flexible React menu components built with TypeScript and TailwindCSS.
6
7
 
@@ -1,167 +1,85 @@
1
- import { jsx as o, Fragment as h, jsxs as p } from "react/jsx-runtime";
2
- import { useListItem as N, useFloatingTree as g, useMergeRefs as v } from "@floating-ui/react";
1
+ import { jsx as s, jsxs as I } from "react/jsx-runtime";
2
+ import { useListItem as k, useFloatingTree as M, useMergeRefs as N } from "@floating-ui/react";
3
+ import { IconCopied as v } from "@versini/ui-icons";
3
4
  import u from "clsx";
4
- import * as I from "react";
5
- import { MenuContext as C } from "./MenuContext.js";
6
- const M = ({
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__ */ o(h, { children: /* @__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.0
38
- © 2025 gizmette.com
39
- */
40
- try {
41
- window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
42
- version: "4.2.0",
43
- buildTime: "05/17/2025 06:18 PM EDT",
44
- homepage: "https://github.com/aversini/ui-components",
45
- license: "MIT"
46
- });
47
- } catch {
48
- }
49
- const S = ({
50
- className: e,
51
- viewBox: t,
52
- title: s,
53
- monotone: l,
54
- ...i
55
- }) => /* @__PURE__ */ p(
56
- M,
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.10.0
78
- © 2025 gizmette.com
79
- */
80
- try {
81
- window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
82
- version: "4.10.0",
83
- buildTime: "05/17/2025 06:18 PM EDT",
84
- homepage: "https://github.com/aversini/ui-components",
85
- license: "MIT"
86
- });
87
- } catch {
88
- }
89
- const V = I.forwardRef(
5
+ import * as f from "react";
6
+ import { MenuContext as y } from "./MenuContext.js";
7
+ const w = f.forwardRef(
90
8
  ({
91
9
  label: e,
92
10
  disabled: t,
93
- icon: s,
94
- raw: l = !1,
11
+ icon: r,
12
+ raw: b = !1,
95
13
  children: i,
96
- ignoreClick: m = !1,
97
- selected: n = !1,
98
- ...r
99
- }, d) => {
100
- let a = "";
101
- const f = I.useContext(C), _ = N({ label: t ? null : e }), b = g(), w = v([_.ref, d]);
102
- if (l && i)
103
- return /* @__PURE__ */ o(
14
+ ignoreClick: a = !1,
15
+ selected: c = !1,
16
+ ...n
17
+ }, p) => {
18
+ let l = "";
19
+ const m = f.useContext(y), x = k({ label: t ? null : e }), d = M(), C = N([x.ref, p]);
20
+ if (b && i)
21
+ return /* @__PURE__ */ s(
104
22
  "div",
105
23
  {
106
24
  role: "menuitem",
107
- ...f.getItemProps({
108
- onClick(c) {
109
- m || (r.onClick?.(c), b?.events.emit("click"));
25
+ ...m.getItemProps({
26
+ onClick(o) {
27
+ a || (n.onClick?.(o), d?.events.emit("click"));
110
28
  }
111
29
  }),
112
30
  children: i
113
31
  }
114
32
  );
115
- s && (a = "pl-2");
116
- const x = u(
33
+ r && (l = "pl-2");
34
+ const g = u(
117
35
  "items-center flex-row",
118
36
  "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",
119
37
  {
120
- "bg-none": !t && !n
38
+ "bg-none": !t && !c
121
39
  }
122
40
  );
123
- return /* @__PURE__ */ p(
41
+ return /* @__PURE__ */ I(
124
42
  "button",
125
43
  {
126
- ...r,
127
- ref: w,
44
+ ...n,
45
+ ref: C,
128
46
  role: "menuitem",
129
- className: x,
47
+ className: g,
130
48
  tabIndex: 0,
131
49
  disabled: t,
132
- ...f.getItemProps({
133
- onClick(c) {
134
- m || (r.onClick?.(c), b?.events.emit("click"));
50
+ ...m.getItemProps({
51
+ onClick(o) {
52
+ a || (n.onClick?.(o), d?.events.emit("click"));
135
53
  },
136
- onFocus(c) {
137
- r.onFocus?.(c), f.setHasFocusInside(!0);
54
+ onFocus(o) {
55
+ n.onFocus?.(o), m.setHasFocusInside(!0);
138
56
  }
139
57
  }),
140
58
  children: [
141
- n && /* @__PURE__ */ o(S, { className: "mr-2", size: "size-4" }),
142
- s,
143
- e && /* @__PURE__ */ o("span", { className: a, children: e })
59
+ c && /* @__PURE__ */ s(v, { className: "mr-2", size: "size-4" }),
60
+ r,
61
+ e && /* @__PURE__ */ s("span", { className: l, children: e })
144
62
  ]
145
63
  }
146
64
  );
147
65
  }
148
66
  );
149
- V.displayName = "MenuItem";
150
- const k = ({ className: e, ...t }) => {
151
- const s = u(e, "my-1 border-t border-border-medium");
152
- return /* @__PURE__ */ o("div", { className: s, ...t });
153
- }, B = ({
67
+ w.displayName = "MenuItem";
68
+ const z = ({ className: e, ...t }) => {
69
+ const r = u(e, "my-1 border-t border-border-medium");
70
+ return /* @__PURE__ */ s("div", { className: r, ...t });
71
+ }, P = ({
154
72
  className: e,
155
73
  ...t
156
74
  }) => {
157
- const s = u(
75
+ const r = u(
158
76
  e,
159
77
  "pt-1 mb-2 text-sm text-copy-dark border-b border-border-medium"
160
78
  );
161
- return /* @__PURE__ */ o("div", { className: s, ...t });
79
+ return /* @__PURE__ */ s("div", { className: r, ...t });
162
80
  };
163
81
  export {
164
- B as MenuGroupLabel,
165
- V as MenuItem,
166
- k as MenuSeparator
82
+ P as MenuGroupLabel,
83
+ w as MenuItem,
84
+ z as MenuSeparator
167
85
  };
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 v4.0.11
4
+ @versini/ui-menu v4.0.13
5
5
  © 2025 gizmette.com
6
6
  */
7
7
  try {
8
8
  window.__VERSINI_UI_MENU__ || (window.__VERSINI_UI_MENU__ = {
9
- version: "4.0.11",
10
- buildTime: "08/23/2025 10:07 AM EDT",
9
+ version: "4.0.13",
10
+ buildTime: "09/01/2025 02:19 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": "4.0.11",
3
+ "version": "4.0.13",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@testing-library/jest-dom": "6.8.0",
45
- "@versini/ui-types": "../ui-types"
45
+ "@versini/ui-types": "5.0.7"
46
46
  },
47
47
  "dependencies": {
48
48
  "@floating-ui/react": "0.27.16",
@@ -54,5 +54,5 @@
54
54
  "sideEffects": [
55
55
  "**/*.css"
56
56
  ],
57
- "gitHead": "a1afd6e4613b1da7abf61d10a72614611521fb39"
57
+ "gitHead": "c577149643ec36cad454587166e62410a77aed38"
58
58
  }