@nucleux/md3-menu 0.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nucleux
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @nucleux/md3-menu
2
+
3
+ Material 3 menu surface — Nucleux agentic UI for React.
4
+
5
+ Part of **[Nucleux](https://github.com/intelligaia-open-labs/nucleux)** — agentic UI components for React. Install a single component, or the full kit via [`@nucleux/react`](https://www.npmjs.com/package/@nucleux/react).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pnpm add @nucleux/md3-menu @nucleux/tokens
11
+ ```
12
+
13
+ `react` / `react-dom` are peer dependencies.
14
+
15
+ ## Usage
16
+
17
+ ```tsx
18
+ import { Md3Menu } from "@nucleux/md3-menu";
19
+ ```
20
+
21
+ Requires the theme once in your app: `import "@nucleux/tokens/styles.css";`
22
+ and the Tailwind preset from `@nucleux/tokens/preset`.
23
+
24
+ ## License
25
+
26
+ MIT © Nucleux
package/dist/index.cjs ADDED
@@ -0,0 +1,77 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var React = require('react');
5
+ var utils = require('@nucleux/utils');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
+
28
+ // src/index.tsx
29
+ var Md3Menu = React__namespace.forwardRef(
30
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
31
+ "div",
32
+ {
33
+ ref,
34
+ role: "menu",
35
+ className: utils.cn(
36
+ "min-w-[12rem] rounded-md-xs bg-md-surface-container py-2 text-md-on-surface shadow-md-2",
37
+ className
38
+ ),
39
+ ...props
40
+ }
41
+ )
42
+ );
43
+ Md3Menu.displayName = "Md3Menu";
44
+ var Md3MenuItem = React__namespace.forwardRef(
45
+ ({ icon, trailing, className, children, type = "button", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
46
+ "button",
47
+ {
48
+ ref,
49
+ type,
50
+ role: "menuitem",
51
+ className: utils.cn(
52
+ "relative flex h-12 w-full items-center gap-3 overflow-hidden px-3 text-left text-sm text-md-on-surface outline-none [&_svg]:size-6",
53
+ "before:absolute before:inset-0 before:bg-md-on-surface before:opacity-0 before:transition-opacity before:content-['']",
54
+ "hover:before:opacity-[0.08] focus-visible:before:opacity-[0.12]",
55
+ "disabled:pointer-events-none disabled:opacity-[0.38]",
56
+ className
57
+ ),
58
+ ...props,
59
+ children: [
60
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative shrink-0 text-md-on-surface-variant", children: icon }),
61
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative flex-1 truncate", children }),
62
+ trailing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative shrink-0 text-md-on-surface-variant", children: trailing })
63
+ ]
64
+ }
65
+ )
66
+ );
67
+ Md3MenuItem.displayName = "Md3MenuItem";
68
+ var Md3MenuDivider = React__namespace.forwardRef(
69
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, role: "separator", className: utils.cn("my-2 h-px bg-md-surface-variant", className), ...props })
70
+ );
71
+ Md3MenuDivider.displayName = "Md3MenuDivider";
72
+
73
+ exports.Md3Menu = Md3Menu;
74
+ exports.Md3MenuDivider = Md3MenuDivider;
75
+ exports.Md3MenuItem = Md3MenuItem;
76
+ //# sourceMappingURL=index.cjs.map
77
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"names":["React","jsx","cn","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAAM,OAAA,GAAgBA,gBAAA,CAAA,UAAA;AAAA,EAC3B,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACxBC,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,IAAA,EAAK,MAAA;AAAA,MACL,SAAA,EAAWC,QAAA;AAAA,QACT,yFAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA;AAGV;AACA,OAAA,CAAQ,WAAA,GAAc,SAAA;AASf,IAAM,WAAA,GAAoBF,gBAAA,CAAA,UAAA;AAAA,EAC/B,CAAC,EAAE,IAAA,EAAM,QAAA,EAAU,SAAA,EAAW,QAAA,EAAU,IAAA,GAAO,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,qBACnEG,eAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA,EAAK,UAAA;AAAA,MACL,SAAA,EAAWD,QAAA;AAAA,QACT,oIAAA;AAAA,QACA,uHAAA;AAAA,QACA,iEAAA;AAAA,QACA,sDAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,IAAA,oBAAQD,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,8CAAA,EAAgD,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,wBAC9EA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,0BAAA,EAA4B,QAAA,EAAS,CAAA;AAAA,QACpD,QAAA,oBAAYA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,gDAAgD,QAAA,EAAA,QAAA,EAAS;AAAA;AAAA;AAAA;AAG5F;AACA,WAAA,CAAY,WAAA,GAAc,aAAA;AAEnB,IAAM,cAAA,GAAuBD,gBAAA,CAAA,UAAA;AAAA,EAClC,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,wBACxBC,cAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAU,IAAA,EAAK,aAAY,SAAA,EAAWC,QAAA,CAAG,mCAAmC,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO;AAE5G;AACA,cAAA,CAAe,WAAA,GAAc,gBAAA","file":"index.cjs","sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@nucleux/utils\";\n\n/**\n * A Material Design 3 menu surface (presentational — pair with your own trigger\n * and positioning). Compose with Md3MenuItem and Md3MenuDivider.\n */\nexport const Md3Menu = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n role=\"menu\"\n className={cn(\n \"min-w-[12rem] rounded-md-xs bg-md-surface-container py-2 text-md-on-surface shadow-md-2\",\n className,\n )}\n {...props}\n />\n ),\n);\nMd3Menu.displayName = \"Md3Menu\";\n\nexport interface Md3MenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n icon?: React.ReactNode;\n /** Trailing content — a shortcut hint or submenu marker. */\n trailing?: React.ReactNode;\n}\n\n/** A selectable row inside a {@link Md3Menu}. */\nexport const Md3MenuItem = React.forwardRef<HTMLButtonElement, Md3MenuItemProps>(\n ({ icon, trailing, className, children, type = \"button\", ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n role=\"menuitem\"\n className={cn(\n \"relative flex h-12 w-full items-center gap-3 overflow-hidden px-3 text-left text-sm text-md-on-surface outline-none [&_svg]:size-6\",\n \"before:absolute before:inset-0 before:bg-md-on-surface before:opacity-0 before:transition-opacity before:content-['']\",\n \"hover:before:opacity-[0.08] focus-visible:before:opacity-[0.12]\",\n \"disabled:pointer-events-none disabled:opacity-[0.38]\",\n className,\n )}\n {...props}\n >\n {icon && <span className=\"relative shrink-0 text-md-on-surface-variant\">{icon}</span>}\n <span className=\"relative flex-1 truncate\">{children}</span>\n {trailing && <span className=\"relative shrink-0 text-md-on-surface-variant\">{trailing}</span>}\n </button>\n ),\n);\nMd3MenuItem.displayName = \"Md3MenuItem\";\n\nexport const Md3MenuDivider = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} role=\"separator\" className={cn(\"my-2 h-px bg-md-surface-variant\", className)} {...props} />\n ),\n);\nMd3MenuDivider.displayName = \"Md3MenuDivider\";\n"]}
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * A Material Design 3 menu surface (presentational — pair with your own trigger
5
+ * and positioning). Compose with Md3MenuItem and Md3MenuDivider.
6
+ */
7
+ declare const Md3Menu: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
8
+ interface Md3MenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
9
+ icon?: React.ReactNode;
10
+ /** Trailing content — a shortcut hint or submenu marker. */
11
+ trailing?: React.ReactNode;
12
+ }
13
+ /** A selectable row inside a {@link Md3Menu}. */
14
+ declare const Md3MenuItem: React.ForwardRefExoticComponent<Md3MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
15
+ declare const Md3MenuDivider: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
16
+
17
+ export { Md3Menu, Md3MenuDivider, Md3MenuItem, type Md3MenuItemProps };
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * A Material Design 3 menu surface (presentational — pair with your own trigger
5
+ * and positioning). Compose with Md3MenuItem and Md3MenuDivider.
6
+ */
7
+ declare const Md3Menu: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
8
+ interface Md3MenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
9
+ icon?: React.ReactNode;
10
+ /** Trailing content — a shortcut hint or submenu marker. */
11
+ trailing?: React.ReactNode;
12
+ }
13
+ /** A selectable row inside a {@link Md3Menu}. */
14
+ declare const Md3MenuItem: React.ForwardRefExoticComponent<Md3MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
15
+ declare const Md3MenuDivider: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
16
+
17
+ export { Md3Menu, Md3MenuDivider, Md3MenuItem, type Md3MenuItemProps };
package/dist/index.js ADDED
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import * as React from 'react';
3
+ import { cn } from '@nucleux/utils';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+
6
+ // src/index.tsx
7
+ var Md3Menu = React.forwardRef(
8
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
9
+ "div",
10
+ {
11
+ ref,
12
+ role: "menu",
13
+ className: cn(
14
+ "min-w-[12rem] rounded-md-xs bg-md-surface-container py-2 text-md-on-surface shadow-md-2",
15
+ className
16
+ ),
17
+ ...props
18
+ }
19
+ )
20
+ );
21
+ Md3Menu.displayName = "Md3Menu";
22
+ var Md3MenuItem = React.forwardRef(
23
+ ({ icon, trailing, className, children, type = "button", ...props }, ref) => /* @__PURE__ */ jsxs(
24
+ "button",
25
+ {
26
+ ref,
27
+ type,
28
+ role: "menuitem",
29
+ className: cn(
30
+ "relative flex h-12 w-full items-center gap-3 overflow-hidden px-3 text-left text-sm text-md-on-surface outline-none [&_svg]:size-6",
31
+ "before:absolute before:inset-0 before:bg-md-on-surface before:opacity-0 before:transition-opacity before:content-['']",
32
+ "hover:before:opacity-[0.08] focus-visible:before:opacity-[0.12]",
33
+ "disabled:pointer-events-none disabled:opacity-[0.38]",
34
+ className
35
+ ),
36
+ ...props,
37
+ children: [
38
+ icon && /* @__PURE__ */ jsx("span", { className: "relative shrink-0 text-md-on-surface-variant", children: icon }),
39
+ /* @__PURE__ */ jsx("span", { className: "relative flex-1 truncate", children }),
40
+ trailing && /* @__PURE__ */ jsx("span", { className: "relative shrink-0 text-md-on-surface-variant", children: trailing })
41
+ ]
42
+ }
43
+ )
44
+ );
45
+ Md3MenuItem.displayName = "Md3MenuItem";
46
+ var Md3MenuDivider = React.forwardRef(
47
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "separator", className: cn("my-2 h-px bg-md-surface-variant", className), ...props })
48
+ );
49
+ Md3MenuDivider.displayName = "Md3MenuDivider";
50
+
51
+ export { Md3Menu, Md3MenuDivider, Md3MenuItem };
52
+ //# sourceMappingURL=index.js.map
53
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":";;;;;AAOO,IAAM,OAAA,GAA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AAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAU,IAAA,EAAK,aAAY,SAAA,EAAW,EAAA,CAAG,mCAAmC,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO;AAE5G;AACA,cAAA,CAAe,WAAA,GAAc,gBAAA","file":"index.js","sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@nucleux/utils\";\n\n/**\n * A Material Design 3 menu surface (presentational — pair with your own trigger\n * and positioning). Compose with Md3MenuItem and Md3MenuDivider.\n */\nexport const Md3Menu = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n role=\"menu\"\n className={cn(\n \"min-w-[12rem] rounded-md-xs bg-md-surface-container py-2 text-md-on-surface shadow-md-2\",\n className,\n )}\n {...props}\n />\n ),\n);\nMd3Menu.displayName = \"Md3Menu\";\n\nexport interface Md3MenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n icon?: React.ReactNode;\n /** Trailing content — a shortcut hint or submenu marker. */\n trailing?: React.ReactNode;\n}\n\n/** A selectable row inside a {@link Md3Menu}. */\nexport const Md3MenuItem = React.forwardRef<HTMLButtonElement, Md3MenuItemProps>(\n ({ icon, trailing, className, children, type = \"button\", ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n role=\"menuitem\"\n className={cn(\n \"relative flex h-12 w-full items-center gap-3 overflow-hidden px-3 text-left text-sm text-md-on-surface outline-none [&_svg]:size-6\",\n \"before:absolute before:inset-0 before:bg-md-on-surface before:opacity-0 before:transition-opacity before:content-['']\",\n \"hover:before:opacity-[0.08] focus-visible:before:opacity-[0.12]\",\n \"disabled:pointer-events-none disabled:opacity-[0.38]\",\n className,\n )}\n {...props}\n >\n {icon && <span className=\"relative shrink-0 text-md-on-surface-variant\">{icon}</span>}\n <span className=\"relative flex-1 truncate\">{children}</span>\n {trailing && <span className=\"relative shrink-0 text-md-on-surface-variant\">{trailing}</span>}\n </button>\n ),\n);\nMd3MenuItem.displayName = \"Md3MenuItem\";\n\nexport const Md3MenuDivider = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} role=\"separator\" className={cn(\"my-2 h-px bg-md-surface-variant\", className)} {...props} />\n ),\n);\nMd3MenuDivider.displayName = \"Md3MenuDivider\";\n"]}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@nucleux/md3-menu",
3
+ "version": "0.3.0",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "description": "Material 3 menu surface — Nucleux agentic UI for React.",
7
+ "keywords": [
8
+ "nucleux",
9
+ "react",
10
+ "ui",
11
+ "components",
12
+ "agentic",
13
+ "ai",
14
+ "tailwind",
15
+ "md3-menu"
16
+ ],
17
+ "main": "./dist/index.cjs",
18
+ "module": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js",
24
+ "require": "./dist/index.cjs"
25
+ }
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "README.md"
30
+ ],
31
+ "peerDependencies": {
32
+ "react": ">=18",
33
+ "react-dom": ">=18"
34
+ },
35
+ "dependencies": {
36
+ "@nucleux/utils": "0.3.0"
37
+ },
38
+ "devDependencies": {
39
+ "tsup": "^8.3.5",
40
+ "typescript": "^5.7.2",
41
+ "@types/react": "^18.3.18",
42
+ "react": "^18.3.1",
43
+ "lucide-react": "^0.469.0"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "license": "MIT",
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "git+https://github.com/intelligaia-open-labs/nucleux.git",
52
+ "directory": "packages/md3-menu"
53
+ },
54
+ "homepage": "https://github.com/intelligaia-open-labs/nucleux#readme",
55
+ "scripts": {
56
+ "build": "tsup"
57
+ }
58
+ }