@nucleux/md3-snackbar 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-snackbar
2
+
3
+ Material 3 snackbar — 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-snackbar @nucleux/tokens
11
+ ```
12
+
13
+ `react` / `react-dom` are peer dependencies.
14
+
15
+ ## Usage
16
+
17
+ ```tsx
18
+ import { Md3Snackbar } from "@nucleux/md3-snackbar";
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,63 @@
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 Md3Snackbar = React__namespace.forwardRef(
30
+ ({ open, message, action, onAction, className, ...props }, ref) => {
31
+ if (!open) return null;
32
+ return /* @__PURE__ */ jsxRuntime.jsxs(
33
+ "div",
34
+ {
35
+ ref,
36
+ role: "status",
37
+ "aria-live": "polite",
38
+ className: utils.cn(
39
+ "flex min-h-12 items-center gap-2 rounded-md-xs bg-md-inverse-surface px-4 py-3 text-sm text-md-inverse-on-surface shadow-md-3",
40
+ className
41
+ ),
42
+ ...props,
43
+ children: [
44
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children: message }),
45
+ action && /* @__PURE__ */ jsxRuntime.jsx(
46
+ "button",
47
+ {
48
+ type: "button",
49
+ onClick: onAction,
50
+ className: "relative -mr-2 shrink-0 overflow-hidden rounded-md-xs px-3 py-1.5 text-sm font-medium text-md-inverse-primary outline-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:content-[''] hover:before:opacity-[0.08] focus-visible:before:opacity-[0.12]",
51
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative", children: action })
52
+ }
53
+ )
54
+ ]
55
+ }
56
+ );
57
+ }
58
+ );
59
+ Md3Snackbar.displayName = "Md3Snackbar";
60
+
61
+ exports.Md3Snackbar = Md3Snackbar;
62
+ //# sourceMappingURL=index.cjs.map
63
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"names":["React","jsxs","cn","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,IAAM,WAAA,GAAoBA,gBAAA,CAAA,UAAA;AAAA,EAC/B,CAAC,EAAE,IAAA,EAAM,OAAA,EAAS,MAAA,EAAQ,UAAU,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AACjE,IAAA,IAAI,CAAC,MAAM,OAAO,IAAA;AAClB,IAAA,uBACEC,eAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,IAAA,EAAK,QAAA;AAAA,QACL,WAAA,EAAU,QAAA;AAAA,QACV,SAAA,EAAWC,QAAA;AAAA,UACT,+HAAA;AAAA,UACA;AAAA,SACF;AAAA,QACC,GAAG,KAAA;AAAA,QAEJ,QAAA,EAAA;AAAA,0BAAAC,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAU,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,UACjC,MAAA,oBACCA,cAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,IAAA,EAAK,QAAA;AAAA,cACL,OAAA,EAAS,QAAA;AAAA,cACT,SAAA,EAAU,4SAAA;AAAA,cAEV,QAAA,kBAAAA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,UAAA,EAAY,QAAA,EAAA,MAAA,EAAO;AAAA;AAAA;AACrC;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;AACA,WAAA,CAAY,WAAA,GAAc,aAAA","file":"index.cjs","sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@nucleux/utils\";\n\nexport interface Md3SnackbarProps extends React.HTMLAttributes<HTMLDivElement> {\n open: boolean;\n message: React.ReactNode;\n /** Optional trailing action label (rendered as a text button). */\n action?: string;\n onAction?: () => void;\n}\n\n/**\n * A Material Design 3 snackbar. Presentational + controlled via `open`; position\n * it with `className` (e.g. fixed bottom-4). Uses the inverse surface roles.\n */\nexport const Md3Snackbar = React.forwardRef<HTMLDivElement, Md3SnackbarProps>(\n ({ open, message, action, onAction, className, ...props }, ref) => {\n if (!open) return null;\n return (\n <div\n ref={ref}\n role=\"status\"\n aria-live=\"polite\"\n className={cn(\n \"flex min-h-12 items-center gap-2 rounded-md-xs bg-md-inverse-surface px-4 py-3 text-sm text-md-inverse-on-surface shadow-md-3\",\n className,\n )}\n {...props}\n >\n <span className=\"flex-1\">{message}</span>\n {action && (\n <button\n type=\"button\"\n onClick={onAction}\n className=\"relative -mr-2 shrink-0 overflow-hidden rounded-md-xs px-3 py-1.5 text-sm font-medium text-md-inverse-primary outline-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:content-[''] hover:before:opacity-[0.08] focus-visible:before:opacity-[0.12]\"\n >\n <span className=\"relative\">{action}</span>\n </button>\n )}\n </div>\n );\n },\n);\nMd3Snackbar.displayName = \"Md3Snackbar\";\n"]}
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+
3
+ interface Md3SnackbarProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ open: boolean;
5
+ message: React.ReactNode;
6
+ /** Optional trailing action label (rendered as a text button). */
7
+ action?: string;
8
+ onAction?: () => void;
9
+ }
10
+ /**
11
+ * A Material Design 3 snackbar. Presentational + controlled via `open`; position
12
+ * it with `className` (e.g. fixed bottom-4). Uses the inverse surface roles.
13
+ */
14
+ declare const Md3Snackbar: React.ForwardRefExoticComponent<Md3SnackbarProps & React.RefAttributes<HTMLDivElement>>;
15
+
16
+ export { Md3Snackbar, type Md3SnackbarProps };
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+
3
+ interface Md3SnackbarProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ open: boolean;
5
+ message: React.ReactNode;
6
+ /** Optional trailing action label (rendered as a text button). */
7
+ action?: string;
8
+ onAction?: () => void;
9
+ }
10
+ /**
11
+ * A Material Design 3 snackbar. Presentational + controlled via `open`; position
12
+ * it with `className` (e.g. fixed bottom-4). Uses the inverse surface roles.
13
+ */
14
+ declare const Md3Snackbar: React.ForwardRefExoticComponent<Md3SnackbarProps & React.RefAttributes<HTMLDivElement>>;
15
+
16
+ export { Md3Snackbar, type Md3SnackbarProps };
package/dist/index.js ADDED
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import * as React from 'react';
3
+ import { cn } from '@nucleux/utils';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ // src/index.tsx
7
+ var Md3Snackbar = React.forwardRef(
8
+ ({ open, message, action, onAction, className, ...props }, ref) => {
9
+ if (!open) return null;
10
+ return /* @__PURE__ */ jsxs(
11
+ "div",
12
+ {
13
+ ref,
14
+ role: "status",
15
+ "aria-live": "polite",
16
+ className: cn(
17
+ "flex min-h-12 items-center gap-2 rounded-md-xs bg-md-inverse-surface px-4 py-3 text-sm text-md-inverse-on-surface shadow-md-3",
18
+ className
19
+ ),
20
+ ...props,
21
+ children: [
22
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: message }),
23
+ action && /* @__PURE__ */ jsx(
24
+ "button",
25
+ {
26
+ type: "button",
27
+ onClick: onAction,
28
+ className: "relative -mr-2 shrink-0 overflow-hidden rounded-md-xs px-3 py-1.5 text-sm font-medium text-md-inverse-primary outline-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:content-[''] hover:before:opacity-[0.08] focus-visible:before:opacity-[0.12]",
29
+ children: /* @__PURE__ */ jsx("span", { className: "relative", children: action })
30
+ }
31
+ )
32
+ ]
33
+ }
34
+ );
35
+ }
36
+ );
37
+ Md3Snackbar.displayName = "Md3Snackbar";
38
+
39
+ export { Md3Snackbar };
40
+ //# sourceMappingURL=index.js.map
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":";;;;;AAeO,IAAM,WAAA,GAAoB,KAAA,CAAA,UAAA;AAAA,EAC/B,CAAC,EAAE,IAAA,EAAM,OAAA,EAAS,MAAA,EAAQ,UAAU,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AACjE,IAAA,IAAI,CAAC,MAAM,OAAO,IAAA;AAClB,IAAA,uBACE,IAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,IAAA,EAAK,QAAA;AAAA,QACL,WAAA,EAAU,QAAA;AAAA,QACV,SAAA,EAAW,EAAA;AAAA,UACT,+HAAA;AAAA,UACA;AAAA,SACF;AAAA,QACC,GAAG,KAAA;AAAA,QAEJ,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAU,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,UACjC,MAAA,oBACC,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,IAAA,EAAK,QAAA;AAAA,cACL,OAAA,EAAS,QAAA;AAAA,cACT,SAAA,EAAU,4SAAA;AAAA,cAEV,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,UAAA,EAAY,QAAA,EAAA,MAAA,EAAO;AAAA;AAAA;AACrC;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;AACA,WAAA,CAAY,WAAA,GAAc,aAAA","file":"index.js","sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@nucleux/utils\";\n\nexport interface Md3SnackbarProps extends React.HTMLAttributes<HTMLDivElement> {\n open: boolean;\n message: React.ReactNode;\n /** Optional trailing action label (rendered as a text button). */\n action?: string;\n onAction?: () => void;\n}\n\n/**\n * A Material Design 3 snackbar. Presentational + controlled via `open`; position\n * it with `className` (e.g. fixed bottom-4). Uses the inverse surface roles.\n */\nexport const Md3Snackbar = React.forwardRef<HTMLDivElement, Md3SnackbarProps>(\n ({ open, message, action, onAction, className, ...props }, ref) => {\n if (!open) return null;\n return (\n <div\n ref={ref}\n role=\"status\"\n aria-live=\"polite\"\n className={cn(\n \"flex min-h-12 items-center gap-2 rounded-md-xs bg-md-inverse-surface px-4 py-3 text-sm text-md-inverse-on-surface shadow-md-3\",\n className,\n )}\n {...props}\n >\n <span className=\"flex-1\">{message}</span>\n {action && (\n <button\n type=\"button\"\n onClick={onAction}\n className=\"relative -mr-2 shrink-0 overflow-hidden rounded-md-xs px-3 py-1.5 text-sm font-medium text-md-inverse-primary outline-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:content-[''] hover:before:opacity-[0.08] focus-visible:before:opacity-[0.12]\"\n >\n <span className=\"relative\">{action}</span>\n </button>\n )}\n </div>\n );\n },\n);\nMd3Snackbar.displayName = \"Md3Snackbar\";\n"]}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@nucleux/md3-snackbar",
3
+ "version": "0.3.0",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "description": "Material 3 snackbar — Nucleux agentic UI for React.",
7
+ "keywords": [
8
+ "nucleux",
9
+ "react",
10
+ "ui",
11
+ "components",
12
+ "agentic",
13
+ "ai",
14
+ "tailwind",
15
+ "md3-snackbar"
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-snackbar"
53
+ },
54
+ "homepage": "https://github.com/intelligaia-open-labs/nucleux#readme",
55
+ "scripts": {
56
+ "build": "tsup"
57
+ }
58
+ }