@jameskabz/nextcraft-ui 0.8.0 → 0.8.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.
- package/dist/components/craft-toast.cjs +40 -56
- package/dist/components/craft-toast.cjs.map +1 -1
- package/dist/components/craft-toast.d.cts +3 -23
- package/dist/components/craft-toast.d.ts +3 -23
- package/dist/components/craft-toast.js +41 -45
- package/dist/components/craft-toast.js.map +1 -1
- package/dist/craft-toast-BcscwgO3.d.ts +56 -0
- package/dist/craft-toast-C7rMmROV.d.cts +56 -0
- package/dist/index.cjs +8 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
7
|
var __export = (target, all) => {
|
|
10
8
|
for (var name in all)
|
|
@@ -18,81 +16,67 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
20
|
var craft_toast_exports = {};
|
|
31
21
|
__export(craft_toast_exports, {
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
CraftToaster: () => CraftToaster,
|
|
23
|
+
toast: () => import_toast2.toast,
|
|
24
|
+
useCraftToast: () => import_toast2.useCraftToast,
|
|
25
|
+
useToaster: () => import_toast2.useToaster
|
|
34
26
|
});
|
|
35
27
|
module.exports = __toCommonJS(craft_toast_exports);
|
|
36
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
-
var React = __toESM(require("react"), 1);
|
|
38
29
|
var import_cn = require("../utils/cn");
|
|
30
|
+
var import_toast = require("../lib/toast");
|
|
31
|
+
var import_toast2 = require("../lib/toast");
|
|
39
32
|
const variantClasses = {
|
|
40
33
|
info: "border-[color:rgb(var(--nc-accent-1)/0.4)]",
|
|
41
34
|
success: "border-emerald-400/40",
|
|
42
35
|
warning: "border-amber-400/40",
|
|
43
36
|
error: "border-rose-400/40"
|
|
44
37
|
};
|
|
45
|
-
function
|
|
46
|
-
const
|
|
47
|
-
const push = React.useCallback((toast) => {
|
|
48
|
-
const id = `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
49
|
-
setToasts((prev) => [...prev, { ...toast, id }]);
|
|
50
|
-
return id;
|
|
51
|
-
}, []);
|
|
52
|
-
const remove = React.useCallback((id) => {
|
|
53
|
-
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
54
|
-
}, []);
|
|
55
|
-
return { toasts, push, remove };
|
|
56
|
-
}
|
|
57
|
-
function CraftToastHost({ toasts, onDismiss, tone }) {
|
|
38
|
+
function CraftToaster({ tone, className }) {
|
|
39
|
+
const toasts = (0, import_toast.useToaster)();
|
|
58
40
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
41
|
"div",
|
|
60
42
|
{
|
|
61
|
-
className:
|
|
43
|
+
className: (0, import_cn.cn)(
|
|
44
|
+
"fixed right-6 top-6 z-50 flex w-full max-w-sm flex-col gap-3",
|
|
45
|
+
className
|
|
46
|
+
),
|
|
62
47
|
"data-nc-theme": tone,
|
|
63
|
-
children: toasts.map((
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
),
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
toast.id
|
|
88
|
-
);
|
|
89
|
-
})
|
|
48
|
+
children: toasts.map((toast2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: (0, import_cn.cn)(
|
|
52
|
+
"rounded-2xl border bg-[rgb(var(--nc-surface)/0.12)] p-4 text-[rgb(var(--nc-fg))] shadow-[0_15px_35px_rgba(0,0,0,0.35)] backdrop-blur-xl",
|
|
53
|
+
variantClasses[(0, import_toast.normalizeVariant)(toast2.variant)]
|
|
54
|
+
),
|
|
55
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "min-w-0 flex-1", children: toast2.custom ? toast2.custom : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
57
|
+
toast2.title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: toast2.title }),
|
|
58
|
+
toast2.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-[rgb(var(--nc-fg-muted))]", children: toast2.description })
|
|
59
|
+
] }) }),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
"button",
|
|
62
|
+
{
|
|
63
|
+
className: "text-[rgb(var(--nc-fg-soft))] hover:text-[rgb(var(--nc-fg))]",
|
|
64
|
+
onClick: () => (0, import_toast.removeToast)(toast2.id),
|
|
65
|
+
children: "\u2715"
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] })
|
|
69
|
+
},
|
|
70
|
+
toast2.id
|
|
71
|
+
))
|
|
90
72
|
}
|
|
91
73
|
);
|
|
92
74
|
}
|
|
93
75
|
// Annotate the CommonJS export names for ESM import in node:
|
|
94
76
|
0 && (module.exports = {
|
|
95
|
-
|
|
96
|
-
|
|
77
|
+
CraftToaster,
|
|
78
|
+
toast,
|
|
79
|
+
useCraftToast,
|
|
80
|
+
useToaster
|
|
97
81
|
});
|
|
98
82
|
//# sourceMappingURL=craft-toast.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/craft-toast.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-toast.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\nimport {\n normalizeVariant,\n removeToast,\n useToaster,\n type CraftToastCustomOptions,\n type CraftToastOptions,\n type CraftToastVariant,\n} from \"../lib/toast\";\n\nexport { useCraftToast, useToaster, toast } from \"../lib/toast\";\nexport type { CraftToastOptions, CraftToastCustomOptions, CraftToastVariant };\n\nconst variantClasses: Record<Exclude<CraftToastVariant, \"danger\">, string> = {\n info: \"border-[color:rgb(var(--nc-accent-1)/0.4)]\",\n success: \"border-emerald-400/40\",\n warning: \"border-amber-400/40\",\n error: \"border-rose-400/40\",\n};\n\nexport type CraftToasterProps = {\n tone?: ThemeName;\n className?: string;\n};\n\nexport function CraftToaster({ tone, className }: CraftToasterProps) {\n const toasts = useToaster();\n\n return (\n <div\n className={cn(\n \"fixed right-6 top-6 z-50 flex w-full max-w-sm flex-col gap-3\",\n className\n )}\n data-nc-theme={tone}\n >\n {toasts.map((toast) => (\n <div\n key={toast.id}\n className={cn(\n \"rounded-2xl border bg-[rgb(var(--nc-surface)/0.12)] p-4 text-[rgb(var(--nc-fg))] shadow-[0_15px_35px_rgba(0,0,0,0.35)] backdrop-blur-xl\",\n variantClasses[normalizeVariant(toast.variant)]\n )}\n >\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"min-w-0 flex-1\">\n {toast.custom ? (\n toast.custom\n ) : (\n <>\n {toast.title && <p className=\"text-sm font-semibold\">{toast.title}</p>}\n {toast.description && (\n <p className=\"text-xs text-[rgb(var(--nc-fg-muted))]\">\n {toast.description}\n </p>\n )}\n </>\n )}\n </div>\n <button\n className=\"text-[rgb(var(--nc-fg-soft))] hover:text-[rgb(var(--nc-fg))]\"\n onClick={() => removeToast(toast.id)}\n >\n ✕\n </button>\n </div>\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsDgB;AAlDhB,gBAAmB;AAEnB,mBAOO;AAEP,IAAAA,gBAAiD;AAGjD,MAAM,iBAAuE;AAAA,EAC3E,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT;AAOO,SAAS,aAAa,EAAE,MAAM,UAAU,GAAsB;AACnE,QAAM,aAAS,yBAAW;AAE1B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA,iBAAe;AAAA,MAEd,iBAAO,IAAI,CAACC,WACX;AAAA,QAAC;AAAA;AAAA,UAEC,eAAW;AAAA,YACT;AAAA,YACA,mBAAe,+BAAiBA,OAAM,OAAO,CAAC;AAAA,UAChD;AAAA,UAEA,uDAAC,SAAI,WAAU,0CACb;AAAA,wDAAC,SAAI,WAAU,kBACZ,UAAAA,OAAM,SACLA,OAAM,SAEN,4EACG;AAAA,cAAAA,OAAM,SAAS,4CAAC,OAAE,WAAU,yBAAyB,UAAAA,OAAM,OAAM;AAAA,cACjEA,OAAM,eACL,4CAAC,OAAE,WAAU,0CACV,UAAAA,OAAM,aACT;AAAA,eAEJ,GAEJ;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAU;AAAA,gBACV,SAAS,UAAM,0BAAYA,OAAM,EAAE;AAAA,gBACpC;AAAA;AAAA,YAED;AAAA,aACF;AAAA;AAAA,QA3BKA,OAAM;AAAA,MA4Bb,CACD;AAAA;AAAA,EACH;AAEJ;","names":["import_toast","toast"]}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import 'react/jsx-runtime';
|
|
2
|
+
import '../theme/theme-context.cjs';
|
|
3
|
+
export { a as CraftToastCustomOptions, b as CraftToastOptions, c as CraftToastVariant, d as CraftToaster, e as CraftToasterProps, t as toast, u as useCraftToast, f as useToaster } from '../craft-toast-C7rMmROV.cjs';
|
|
3
4
|
import 'react';
|
|
4
|
-
|
|
5
|
-
type CraftToastVariant = "info" | "success" | "warning" | "error";
|
|
6
|
-
type CraftToast = {
|
|
7
|
-
id: string;
|
|
8
|
-
title: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
variant?: CraftToastVariant;
|
|
11
|
-
};
|
|
12
|
-
declare function useCraftToast(): {
|
|
13
|
-
toasts: CraftToast[];
|
|
14
|
-
push: (toast: Omit<CraftToast, "id">) => string;
|
|
15
|
-
remove: (id: string) => void;
|
|
16
|
-
};
|
|
17
|
-
type CraftToastHostProps = {
|
|
18
|
-
toasts: CraftToast[];
|
|
19
|
-
onDismiss: (id: string) => void;
|
|
20
|
-
tone?: ThemeName;
|
|
21
|
-
};
|
|
22
|
-
declare function CraftToastHost({ toasts, onDismiss, tone }: CraftToastHostProps): react_jsx_runtime.JSX.Element;
|
|
23
|
-
|
|
24
|
-
export { type CraftToast, CraftToastHost, type CraftToastHostProps, type CraftToastVariant, useCraftToast };
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import 'react/jsx-runtime';
|
|
2
|
+
import '../theme/theme-context.js';
|
|
3
|
+
export { a as CraftToastCustomOptions, b as CraftToastOptions, c as CraftToastVariant, d as CraftToaster, e as CraftToasterProps, t as toast, u as useCraftToast, f as useToaster } from '../craft-toast-BcscwgO3.js';
|
|
3
4
|
import 'react';
|
|
4
|
-
|
|
5
|
-
type CraftToastVariant = "info" | "success" | "warning" | "error";
|
|
6
|
-
type CraftToast = {
|
|
7
|
-
id: string;
|
|
8
|
-
title: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
variant?: CraftToastVariant;
|
|
11
|
-
};
|
|
12
|
-
declare function useCraftToast(): {
|
|
13
|
-
toasts: CraftToast[];
|
|
14
|
-
push: (toast: Omit<CraftToast, "id">) => string;
|
|
15
|
-
remove: (id: string) => void;
|
|
16
|
-
};
|
|
17
|
-
type CraftToastHostProps = {
|
|
18
|
-
toasts: CraftToast[];
|
|
19
|
-
onDismiss: (id: string) => void;
|
|
20
|
-
tone?: ThemeName;
|
|
21
|
-
};
|
|
22
|
-
declare function CraftToastHost({ toasts, onDismiss, tone }: CraftToastHostProps): react_jsx_runtime.JSX.Element;
|
|
23
|
-
|
|
24
|
-
export { type CraftToast, CraftToastHost, type CraftToastHostProps, type CraftToastVariant, useCraftToast };
|
|
@@ -1,63 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { cn } from "../utils/cn";
|
|
4
|
+
import {
|
|
5
|
+
normalizeVariant,
|
|
6
|
+
removeToast,
|
|
7
|
+
useToaster
|
|
8
|
+
} from "../lib/toast";
|
|
9
|
+
import { useCraftToast, useToaster as useToaster2, toast } from "../lib/toast";
|
|
5
10
|
const variantClasses = {
|
|
6
11
|
info: "border-[color:rgb(var(--nc-accent-1)/0.4)]",
|
|
7
12
|
success: "border-emerald-400/40",
|
|
8
13
|
warning: "border-amber-400/40",
|
|
9
14
|
error: "border-rose-400/40"
|
|
10
15
|
};
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
const push = React.useCallback((toast) => {
|
|
14
|
-
const id = `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
15
|
-
setToasts((prev) => [...prev, { ...toast, id }]);
|
|
16
|
-
return id;
|
|
17
|
-
}, []);
|
|
18
|
-
const remove = React.useCallback((id) => {
|
|
19
|
-
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
20
|
-
}, []);
|
|
21
|
-
return { toasts, push, remove };
|
|
22
|
-
}
|
|
23
|
-
function CraftToastHost({ toasts, onDismiss, tone }) {
|
|
16
|
+
function CraftToaster({ tone, className }) {
|
|
17
|
+
const toasts = useToaster();
|
|
24
18
|
return /* @__PURE__ */ jsx(
|
|
25
19
|
"div",
|
|
26
20
|
{
|
|
27
|
-
className:
|
|
21
|
+
className: cn(
|
|
22
|
+
"fixed right-6 top-6 z-50 flex w-full max-w-sm flex-col gap-3",
|
|
23
|
+
className
|
|
24
|
+
),
|
|
28
25
|
"data-nc-theme": tone,
|
|
29
|
-
children: toasts.map((
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
toast.id
|
|
54
|
-
);
|
|
55
|
-
})
|
|
26
|
+
children: toasts.map((toast2) => /* @__PURE__ */ jsx(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: cn(
|
|
30
|
+
"rounded-2xl border bg-[rgb(var(--nc-surface)/0.12)] p-4 text-[rgb(var(--nc-fg))] shadow-[0_15px_35px_rgba(0,0,0,0.35)] backdrop-blur-xl",
|
|
31
|
+
variantClasses[normalizeVariant(toast2.variant)]
|
|
32
|
+
),
|
|
33
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
34
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: toast2.custom ? toast2.custom : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
35
|
+
toast2.title && /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: toast2.title }),
|
|
36
|
+
toast2.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-[rgb(var(--nc-fg-muted))]", children: toast2.description })
|
|
37
|
+
] }) }),
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
className: "text-[rgb(var(--nc-fg-soft))] hover:text-[rgb(var(--nc-fg))]",
|
|
42
|
+
onClick: () => removeToast(toast2.id),
|
|
43
|
+
children: "\u2715"
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] })
|
|
47
|
+
},
|
|
48
|
+
toast2.id
|
|
49
|
+
))
|
|
56
50
|
}
|
|
57
51
|
);
|
|
58
52
|
}
|
|
59
53
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
CraftToaster,
|
|
55
|
+
toast,
|
|
56
|
+
useCraftToast,
|
|
57
|
+
useToaster2 as useToaster
|
|
62
58
|
};
|
|
63
59
|
//# sourceMappingURL=craft-toast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/craft-toast.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-toast.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\nimport {\n normalizeVariant,\n removeToast,\n useToaster,\n type CraftToastCustomOptions,\n type CraftToastOptions,\n type CraftToastVariant,\n} from \"../lib/toast\";\n\nexport { useCraftToast, useToaster, toast } from \"../lib/toast\";\nexport type { CraftToastOptions, CraftToastCustomOptions, CraftToastVariant };\n\nconst variantClasses: Record<Exclude<CraftToastVariant, \"danger\">, string> = {\n info: \"border-[color:rgb(var(--nc-accent-1)/0.4)]\",\n success: \"border-emerald-400/40\",\n warning: \"border-amber-400/40\",\n error: \"border-rose-400/40\",\n};\n\nexport type CraftToasterProps = {\n tone?: ThemeName;\n className?: string;\n};\n\nexport function CraftToaster({ tone, className }: CraftToasterProps) {\n const toasts = useToaster();\n\n return (\n <div\n className={cn(\n \"fixed right-6 top-6 z-50 flex w-full max-w-sm flex-col gap-3\",\n className\n )}\n data-nc-theme={tone}\n >\n {toasts.map((toast) => (\n <div\n key={toast.id}\n className={cn(\n \"rounded-2xl border bg-[rgb(var(--nc-surface)/0.12)] p-4 text-[rgb(var(--nc-fg))] shadow-[0_15px_35px_rgba(0,0,0,0.35)] backdrop-blur-xl\",\n variantClasses[normalizeVariant(toast.variant)]\n )}\n >\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"min-w-0 flex-1\">\n {toast.custom ? (\n toast.custom\n ) : (\n <>\n {toast.title && <p className=\"text-sm font-semibold\">{toast.title}</p>}\n {toast.description && (\n <p className=\"text-xs text-[rgb(var(--nc-fg-muted))]\">\n {toast.description}\n </p>\n )}\n </>\n )}\n </div>\n <button\n className=\"text-[rgb(var(--nc-fg-soft))] hover:text-[rgb(var(--nc-fg))]\"\n onClick={() => removeToast(toast.id)}\n >\n ✕\n </button>\n </div>\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";AAsDgB,mBACkB,KADlB;AAlDhB,SAAS,UAAU;AAEnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,eAAe,cAAAA,aAAY,aAAa;AAGjD,MAAM,iBAAuE;AAAA,EAC3E,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT;AAOO,SAAS,aAAa,EAAE,MAAM,UAAU,GAAsB;AACnE,QAAM,SAAS,WAAW;AAE1B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA,iBAAe;AAAA,MAEd,iBAAO,IAAI,CAACC,WACX;AAAA,QAAC;AAAA;AAAA,UAEC,WAAW;AAAA,YACT;AAAA,YACA,eAAe,iBAAiBA,OAAM,OAAO,CAAC;AAAA,UAChD;AAAA,UAEA,+BAAC,SAAI,WAAU,0CACb;AAAA,gCAAC,SAAI,WAAU,kBACZ,UAAAA,OAAM,SACLA,OAAM,SAEN,iCACG;AAAA,cAAAA,OAAM,SAAS,oBAAC,OAAE,WAAU,yBAAyB,UAAAA,OAAM,OAAM;AAAA,cACjEA,OAAM,eACL,oBAAC,OAAE,WAAU,0CACV,UAAAA,OAAM,aACT;AAAA,eAEJ,GAEJ;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAU;AAAA,gBACV,SAAS,MAAM,YAAYA,OAAM,EAAE;AAAA,gBACpC;AAAA;AAAA,YAED;AAAA,aACF;AAAA;AAAA,QA3BKA,OAAM;AAAA,MA4Bb,CACD;AAAA;AAAA,EACH;AAEJ;","names":["useToaster","toast"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ThemeName } from './theme/theme-context.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
type CraftToastVariant = "info" | "success" | "warning" | "error" | "danger";
|
|
6
|
+
type CraftToast = {
|
|
7
|
+
id: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
variant?: CraftToastVariant;
|
|
11
|
+
duration?: number;
|
|
12
|
+
custom?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
type CraftToastOptions = {
|
|
15
|
+
description?: string;
|
|
16
|
+
variant?: CraftToastVariant;
|
|
17
|
+
duration?: number;
|
|
18
|
+
};
|
|
19
|
+
type CraftToastCustomOptions = {
|
|
20
|
+
duration?: number;
|
|
21
|
+
};
|
|
22
|
+
declare function useToaster(): CraftToast[];
|
|
23
|
+
declare function useCraftToast(): {
|
|
24
|
+
toast: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
25
|
+
success: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
26
|
+
warning: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
27
|
+
info: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
28
|
+
error: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
29
|
+
danger: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
30
|
+
dismiss: (id: string) => void;
|
|
31
|
+
dismissAll: () => void;
|
|
32
|
+
};
|
|
33
|
+
declare const toast: ((message: React.ReactNode, options?: CraftToastOptions) => string) & {
|
|
34
|
+
success: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
35
|
+
error: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
36
|
+
warning: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
37
|
+
info: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
38
|
+
custom: (component: React.ReactNode, options?: CraftToastCustomOptions) => string;
|
|
39
|
+
dismiss: (id: string) => void;
|
|
40
|
+
dismissAll: () => void;
|
|
41
|
+
promise: <T>(promise: Promise<T>, options?: {
|
|
42
|
+
loading?: React.ReactNode;
|
|
43
|
+
success?: ((value: T) => React.ReactNode) | React.ReactNode;
|
|
44
|
+
error?: ((error: unknown) => React.ReactNode) | React.ReactNode;
|
|
45
|
+
description?: string;
|
|
46
|
+
duration?: number;
|
|
47
|
+
}) => Promise<T>;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
type CraftToasterProps = {
|
|
51
|
+
tone?: ThemeName;
|
|
52
|
+
className?: string;
|
|
53
|
+
};
|
|
54
|
+
declare function CraftToaster({ tone, className }: CraftToasterProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
export { type CraftToast as C, type CraftToastCustomOptions as a, type CraftToastOptions as b, type CraftToastVariant as c, CraftToaster as d, type CraftToasterProps as e, useToaster as f, toast as t, useCraftToast as u };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ThemeName } from './theme/theme-context.cjs';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
type CraftToastVariant = "info" | "success" | "warning" | "error" | "danger";
|
|
6
|
+
type CraftToast = {
|
|
7
|
+
id: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
variant?: CraftToastVariant;
|
|
11
|
+
duration?: number;
|
|
12
|
+
custom?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
type CraftToastOptions = {
|
|
15
|
+
description?: string;
|
|
16
|
+
variant?: CraftToastVariant;
|
|
17
|
+
duration?: number;
|
|
18
|
+
};
|
|
19
|
+
type CraftToastCustomOptions = {
|
|
20
|
+
duration?: number;
|
|
21
|
+
};
|
|
22
|
+
declare function useToaster(): CraftToast[];
|
|
23
|
+
declare function useCraftToast(): {
|
|
24
|
+
toast: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
25
|
+
success: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
26
|
+
warning: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
27
|
+
info: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
28
|
+
error: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
29
|
+
danger: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
30
|
+
dismiss: (id: string) => void;
|
|
31
|
+
dismissAll: () => void;
|
|
32
|
+
};
|
|
33
|
+
declare const toast: ((message: React.ReactNode, options?: CraftToastOptions) => string) & {
|
|
34
|
+
success: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
35
|
+
error: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
36
|
+
warning: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
37
|
+
info: (message: React.ReactNode, options?: CraftToastOptions) => string;
|
|
38
|
+
custom: (component: React.ReactNode, options?: CraftToastCustomOptions) => string;
|
|
39
|
+
dismiss: (id: string) => void;
|
|
40
|
+
dismissAll: () => void;
|
|
41
|
+
promise: <T>(promise: Promise<T>, options?: {
|
|
42
|
+
loading?: React.ReactNode;
|
|
43
|
+
success?: ((value: T) => React.ReactNode) | React.ReactNode;
|
|
44
|
+
error?: ((error: unknown) => React.ReactNode) | React.ReactNode;
|
|
45
|
+
description?: string;
|
|
46
|
+
duration?: number;
|
|
47
|
+
}) => Promise<T>;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
type CraftToasterProps = {
|
|
51
|
+
tone?: ThemeName;
|
|
52
|
+
className?: string;
|
|
53
|
+
};
|
|
54
|
+
declare function CraftToaster({ tone, className }: CraftToasterProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
export { type CraftToast as C, type CraftToastCustomOptions as a, type CraftToastOptions as b, type CraftToastVariant as c, CraftToaster as d, type CraftToasterProps as e, useToaster as f, toast as t, useCraftToast as u };
|
package/dist/index.cjs
CHANGED
|
@@ -62,7 +62,7 @@ __export(index_exports, {
|
|
|
62
62
|
CraftTableToolbar: () => import_craft_table_toolbar.CraftTableToolbar,
|
|
63
63
|
CraftTabs: () => import_craft_tabs.CraftTabs,
|
|
64
64
|
CraftTextarea: () => import_craft_textarea.CraftTextarea,
|
|
65
|
-
|
|
65
|
+
CraftToaster: () => import_craft_toast.CraftToaster,
|
|
66
66
|
CraftTooltip: () => import_craft_tooltip.CraftTooltip,
|
|
67
67
|
GlassCard: () => import_glass_card.GlassCard,
|
|
68
68
|
Grid: () => import_grid.Grid,
|
|
@@ -72,8 +72,10 @@ __export(index_exports, {
|
|
|
72
72
|
ThemeSwitcher: () => import_theme_switcher.ThemeSwitcher,
|
|
73
73
|
TopNav: () => import_top_nav.TopNav,
|
|
74
74
|
layoutConfigSchema: () => import_layout_config.layoutConfigSchema,
|
|
75
|
+
toast: () => import_craft_toast.toast,
|
|
75
76
|
useCraftToast: () => import_craft_toast.useCraftToast,
|
|
76
|
-
useTheme: () => import_theme_context.useTheme
|
|
77
|
+
useTheme: () => import_theme_context.useTheme,
|
|
78
|
+
useToaster: () => import_craft_toast.useToaster
|
|
77
79
|
});
|
|
78
80
|
module.exports = __toCommonJS(index_exports);
|
|
79
81
|
var import_craft_button = require("./components/craft-button");
|
|
@@ -175,7 +177,7 @@ var import_theme_context = require("./theme/theme-context");
|
|
|
175
177
|
CraftTableToolbar,
|
|
176
178
|
CraftTabs,
|
|
177
179
|
CraftTextarea,
|
|
178
|
-
|
|
180
|
+
CraftToaster,
|
|
179
181
|
CraftTooltip,
|
|
180
182
|
GlassCard,
|
|
181
183
|
Grid,
|
|
@@ -185,7 +187,9 @@ var import_theme_context = require("./theme/theme-context");
|
|
|
185
187
|
ThemeSwitcher,
|
|
186
188
|
TopNav,
|
|
187
189
|
layoutConfigSchema,
|
|
190
|
+
toast,
|
|
188
191
|
useCraftToast,
|
|
189
|
-
useTheme
|
|
192
|
+
useTheme,
|
|
193
|
+
useToaster
|
|
190
194
|
});
|
|
191
195
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { CraftButton } from \"./components/craft-button\";\nexport type { CraftButtonProps } from \"./components/craft-button\";\n\nexport { GlassCard } from \"./components/glass-card\";\nexport type { GlassCardProps } from \"./components/glass-card\";\n\nexport { CraftInput } from \"./components/craft-input\";\nexport type { CraftInputProps } from \"./components/craft-input\";\n\nexport { CraftTextarea } from \"./components/craft-textarea\";\nexport type { CraftTextareaProps } from \"./components/craft-textarea\";\n\nexport { CraftSelect } from \"./components/craft-select\";\nexport type { CraftSelectProps } from \"./components/craft-select\";\n\nexport { CraftCheckbox } from \"./components/craft-checkbox\";\nexport type { CraftCheckboxProps } from \"./components/craft-checkbox\";\n\nexport { CraftSwitch } from \"./components/craft-switch\";\nexport type { CraftSwitchProps } from \"./components/craft-switch\";\n\nexport { CraftBadge } from \"./components/craft-badge\";\nexport type { CraftBadgeProps } from \"./components/craft-badge\";\n\nexport { CraftAlert } from \"./components/craft-alert\";\nexport type { CraftAlertProps } from \"./components/craft-alert\";\n\nexport { CraftErrorState } from \"./components/craft-error-state\";\nexport type { CraftErrorStateProps } from \"./components/craft-error-state\";\n\nexport { CraftLoadingState } from \"./components/craft-loading-state\";\nexport type { CraftLoadingStateProps } from \"./components/craft-loading-state\";\n\nexport { CraftCard } from \"./components/craft-card\";\nexport type { CraftCardProps } from \"./components/craft-card\";\n\nexport { CraftModal } from \"./components/craft-modal\";\nexport type { CraftModalProps } from \"./components/craft-modal\";\n\nexport { CraftDrawer } from \"./components/craft-drawer\";\nexport type { CraftDrawerProps } from \"./components/craft-drawer\";\n\nexport { CraftTabs } from \"./components/craft-tabs\";\nexport type { CraftTabsProps } from \"./components/craft-tabs\";\n\nexport { CraftTooltip } from \"./components/craft-tooltip\";\nexport type { CraftTooltipProps } from \"./components/craft-tooltip\";\n\nexport {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { CraftButton } from \"./components/craft-button\";\nexport type { CraftButtonProps } from \"./components/craft-button\";\n\nexport { GlassCard } from \"./components/glass-card\";\nexport type { GlassCardProps } from \"./components/glass-card\";\n\nexport { CraftInput } from \"./components/craft-input\";\nexport type { CraftInputProps } from \"./components/craft-input\";\n\nexport { CraftTextarea } from \"./components/craft-textarea\";\nexport type { CraftTextareaProps } from \"./components/craft-textarea\";\n\nexport { CraftSelect } from \"./components/craft-select\";\nexport type { CraftSelectProps } from \"./components/craft-select\";\n\nexport { CraftCheckbox } from \"./components/craft-checkbox\";\nexport type { CraftCheckboxProps } from \"./components/craft-checkbox\";\n\nexport { CraftSwitch } from \"./components/craft-switch\";\nexport type { CraftSwitchProps } from \"./components/craft-switch\";\n\nexport { CraftBadge } from \"./components/craft-badge\";\nexport type { CraftBadgeProps } from \"./components/craft-badge\";\n\nexport { CraftAlert } from \"./components/craft-alert\";\nexport type { CraftAlertProps } from \"./components/craft-alert\";\n\nexport { CraftErrorState } from \"./components/craft-error-state\";\nexport type { CraftErrorStateProps } from \"./components/craft-error-state\";\n\nexport { CraftLoadingState } from \"./components/craft-loading-state\";\nexport type { CraftLoadingStateProps } from \"./components/craft-loading-state\";\n\nexport { CraftCard } from \"./components/craft-card\";\nexport type { CraftCardProps } from \"./components/craft-card\";\n\nexport { CraftModal } from \"./components/craft-modal\";\nexport type { CraftModalProps } from \"./components/craft-modal\";\n\nexport { CraftDrawer } from \"./components/craft-drawer\";\nexport type { CraftDrawerProps } from \"./components/craft-drawer\";\n\nexport { CraftTabs } from \"./components/craft-tabs\";\nexport type { CraftTabsProps } from \"./components/craft-tabs\";\n\nexport { CraftTooltip } from \"./components/craft-tooltip\";\nexport type { CraftTooltipProps } from \"./components/craft-tooltip\";\n\nexport { CraftToaster, useCraftToast, useToaster, toast } from \"./components/craft-toast\";\nexport type {\n CraftToasterProps,\n CraftToastVariant,\n CraftToastOptions,\n CraftToastCustomOptions,\n} from \"./components/craft-toast\";\nexport type { CraftToast } from \"./lib/toast\";\n\nexport { CraftSkeleton } from \"./components/craft-skeleton\";\nexport type { CraftSkeletonProps } from \"./components/craft-skeleton\";\n\nexport { CraftEmptyState } from \"./components/craft-empty-state\";\nexport type { CraftEmptyStateProps } from \"./components/craft-empty-state\";\n\nexport { CraftPopover } from \"./components/craft-popover\";\nexport type { CraftPopoverProps } from \"./components/craft-popover\";\n\nexport { CraftDropdownMenu } from \"./components/craft-dropdown-menu\";\nexport type { CraftDropdownMenuProps, CraftDropdownItem } from \"./components/craft-dropdown-menu\";\n\nexport { CraftCommandPalette } from \"./components/craft-command-palette\";\nexport type { CraftCommandPaletteProps, CraftCommandItem } from \"./components/craft-command-palette\";\n\nexport { CraftLink } from \"./components/craft-link\";\nexport type { CraftLinkProps } from \"./components/craft-link\";\n\nexport { CraftStatCard } from \"./components/craft-stat-card\";\nexport type { CraftStatCardProps } from \"./components/craft-stat-card\";\n\nexport { CraftDatePicker } from \"./components/craft-date-picker\";\nexport type { CraftDatePickerProps } from \"./components/craft-date-picker\";\n\nexport { CraftIcon, CraftIconProvider } from \"./components/craft-icon\";\nexport type {\n CraftIconProps,\n CraftIconProviderProps,\n CraftIconRegistry,\n} from \"./components/craft-icon\";\n\nexport { CraftNumberInput } from \"./components/craft-number-input\";\nexport type { CraftNumberInputProps } from \"./components/craft-number-input\";\n\nexport { CraftCurrencyInput } from \"./components/craft-currency-input\";\nexport type { CraftCurrencyInputProps } from \"./components/craft-currency-input\";\n\nexport { CraftForm } from \"./components/craft-form\";\nexport type { CraftFormProps } from \"./components/craft-form\";\n\nexport { CraftFormModal } from \"./components/craft-form-modal\";\nexport type { CraftFormModalProps, CraftFormModalField } from \"./components/craft-form-modal\";\n\nexport { CraftFormField } from \"./components/craft-form-field\";\nexport type { CraftFormFieldProps, CraftFormFieldOption, CraftFormFieldType } from \"./components/craft-form-field\";\n\n\nexport { CraftConfirmDialog } from \"./components/craft-confirm-dialog\";\nexport type { CraftConfirmDialogProps } from \"./components/craft-confirm-dialog\";\n\nexport { CraftCreateEditDrawer } from \"./components/craft-create-edit-drawer\";\nexport type { CraftCreateEditDrawerProps } from \"./components/craft-create-edit-drawer\";\n\nexport { CraftFilterBar } from \"./components/craft-filter-bar\";\nexport type { CraftFilterBarProps } from \"./components/craft-filter-bar\";\n\nexport { CraftTableToolbar } from \"./components/craft-table-toolbar\";\nexport type { CraftTableToolbarProps } from \"./components/craft-table-toolbar\";\n\nexport { CraftDataTableFilters } from \"./components/craft-data-table-filters\";\nexport type {\n CraftDataTableFiltersProps,\n CraftDataTableFilterSelect,\n CraftDataTableFilterSelectOption,\n CraftDataTableFilterDate,\n} from \"./components/craft-data-table-filters\";\n\nexport { CraftDataTable } from \"./components/craft-data-table\";\nexport type {\n CraftDataTableProps,\n CraftDataTableColumn,\n CraftDataTableSort,\n CraftDataTableAction,\n} from \"./components/craft-data-table\";\nexport { CraftDataTableHeader } from \"./components/craft-data-table-header\";\nexport type { CraftDataTableHeaderProps } from \"./components/craft-data-table-header\";\nexport { CraftDataTablePagination } from \"./components/craft-data-table-pagination\";\nexport type { CraftDataTablePaginationProps } from \"./components/craft-data-table-pagination\";\nexport { CraftLoader } from \"./components/craft-loader\";\nexport type { CraftLoaderProps } from \"./components/craft-loader\";\n\nexport { CraftPagination } from \"./components/craft-pagination\";\nexport type { CraftPaginationProps } from \"./components/craft-pagination\";\n\nexport { AppShell } from \"./components/layout/app-shell\";\nexport type { AppShellProps } from \"./components/layout/app-shell\";\n\nexport { AppTemplate } from \"./components/layout/app-template\";\nexport type { AppTemplateProps } from \"./components/layout/app-template\";\n\nexport type {\n LayoutConfig,\n LayoutSidebarItem,\n LayoutBreadcrumbItem,\n LayoutIconName,\n} from \"./components/layout/layout-config\";\nexport { layoutConfigSchema } from \"./components/layout/layout-config\";\n\nexport { Sidebar } from \"./components/layout/sidebar\";\nexport type { SidebarProps, SidebarItem } from \"./components/layout/sidebar\";\n\nexport { TopNav } from \"./components/layout/top-nav\";\nexport type { TopNavProps } from \"./components/layout/top-nav\";\n\nexport { PageHeader } from \"./components/layout/page-header\";\nexport type { PageHeaderProps } from \"./components/layout/page-header\";\n\nexport { Breadcrumbs } from \"./components/layout/breadcrumbs\";\nexport type { BreadcrumbsProps, BreadcrumbItem } from \"./components/layout/breadcrumbs\";\n\nexport { AuthLayout } from \"./components/layout/auth-layout\";\nexport type { AuthLayoutProps } from \"./components/layout/auth-layout\";\n\nexport { Container } from \"./components/layout/container\";\nexport type { ContainerProps } from \"./components/layout/container\";\n\nexport { Grid } from \"./components/layout/grid\";\nexport type { GridProps } from \"./components/layout/grid\";\n\nexport { ThemeSwitcher } from \"./components/theme-switcher\";\nexport type { ThemeSwitcherProps } from \"./components/theme-switcher\";\n\nexport { ThemeProvider, useTheme } from \"./theme/theme-context\";\nexport type { ThemeName, ThemeMode } from \"./theme/theme-context\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B;AAG5B,wBAA0B;AAG1B,yBAA2B;AAG3B,4BAA8B;AAG9B,0BAA4B;AAG5B,4BAA8B;AAG9B,0BAA4B;AAG5B,yBAA2B;AAG3B,yBAA2B;AAG3B,+BAAgC;AAGhC,iCAAkC;AAGlC,wBAA0B;AAG1B,yBAA2B;AAG3B,0BAA4B;AAG5B,wBAA0B;AAG1B,2BAA6B;AAG7B,yBAA+D;AAS/D,4BAA8B;AAG9B,+BAAgC;AAGhC,2BAA6B;AAG7B,iCAAkC;AAGlC,mCAAoC;AAGpC,wBAA0B;AAG1B,6BAA8B;AAG9B,+BAAgC;AAGhC,wBAA6C;AAO7C,gCAAiC;AAGjC,kCAAmC;AAGnC,wBAA0B;AAG1B,8BAA+B;AAG/B,8BAA+B;AAI/B,kCAAmC;AAGnC,sCAAsC;AAGtC,8BAA+B;AAG/B,iCAAkC;AAGlC,sCAAsC;AAQtC,8BAA+B;AAO/B,qCAAqC;AAErC,yCAAyC;AAEzC,0BAA4B;AAG5B,8BAAgC;AAGhC,uBAAyB;AAGzB,0BAA4B;AAS5B,2BAAmC;AAEnC,qBAAwB;AAGxB,qBAAuB;AAGvB,yBAA2B;AAG3B,yBAA4B;AAG5B,yBAA2B;AAG3B,uBAA0B;AAG1B,kBAAqB;AAGrB,4BAA8B;AAG9B,2BAAwC;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -14,7 +14,7 @@ export { CraftModal, CraftModalProps } from './components/craft-modal.cjs';
|
|
|
14
14
|
export { CraftDrawer, CraftDrawerProps } from './components/craft-drawer.cjs';
|
|
15
15
|
export { CraftTabs, CraftTabsProps } from './components/craft-tabs.cjs';
|
|
16
16
|
export { CraftTooltip, CraftTooltipProps } from './components/craft-tooltip.cjs';
|
|
17
|
-
export { CraftToast,
|
|
17
|
+
export { C as CraftToast, a as CraftToastCustomOptions, b as CraftToastOptions, c as CraftToastVariant, d as CraftToaster, e as CraftToasterProps, t as toast, u as useCraftToast, f as useToaster } from './craft-toast-C7rMmROV.cjs';
|
|
18
18
|
export { CraftSkeleton, CraftSkeletonProps } from './components/craft-skeleton.cjs';
|
|
19
19
|
export { CraftEmptyState, CraftEmptyStateProps } from './components/craft-empty-state.cjs';
|
|
20
20
|
export { CraftPopover, CraftPopoverProps } from './components/craft-popover.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { CraftModal, CraftModalProps } from './components/craft-modal.js';
|
|
|
14
14
|
export { CraftDrawer, CraftDrawerProps } from './components/craft-drawer.js';
|
|
15
15
|
export { CraftTabs, CraftTabsProps } from './components/craft-tabs.js';
|
|
16
16
|
export { CraftTooltip, CraftTooltipProps } from './components/craft-tooltip.js';
|
|
17
|
-
export { CraftToast,
|
|
17
|
+
export { C as CraftToast, a as CraftToastCustomOptions, b as CraftToastOptions, c as CraftToastVariant, d as CraftToaster, e as CraftToasterProps, t as toast, u as useCraftToast, f as useToaster } from './craft-toast-BcscwgO3.js';
|
|
18
18
|
export { CraftSkeleton, CraftSkeletonProps } from './components/craft-skeleton.js';
|
|
19
19
|
export { CraftEmptyState, CraftEmptyStateProps } from './components/craft-empty-state.js';
|
|
20
20
|
export { CraftPopover, CraftPopoverProps } from './components/craft-popover.js';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { CraftModal } from "./components/craft-modal";
|
|
|
14
14
|
import { CraftDrawer } from "./components/craft-drawer";
|
|
15
15
|
import { CraftTabs } from "./components/craft-tabs";
|
|
16
16
|
import { CraftTooltip } from "./components/craft-tooltip";
|
|
17
|
-
import {
|
|
17
|
+
import { CraftToaster, useCraftToast, useToaster, toast } from "./components/craft-toast";
|
|
18
18
|
import { CraftSkeleton } from "./components/craft-skeleton";
|
|
19
19
|
import { CraftEmptyState } from "./components/craft-empty-state";
|
|
20
20
|
import { CraftPopover } from "./components/craft-popover";
|
|
@@ -96,7 +96,7 @@ export {
|
|
|
96
96
|
CraftTableToolbar,
|
|
97
97
|
CraftTabs,
|
|
98
98
|
CraftTextarea,
|
|
99
|
-
|
|
99
|
+
CraftToaster,
|
|
100
100
|
CraftTooltip,
|
|
101
101
|
GlassCard,
|
|
102
102
|
Grid,
|
|
@@ -106,7 +106,9 @@ export {
|
|
|
106
106
|
ThemeSwitcher,
|
|
107
107
|
TopNav,
|
|
108
108
|
layoutConfigSchema,
|
|
109
|
+
toast,
|
|
109
110
|
useCraftToast,
|
|
110
|
-
useTheme
|
|
111
|
+
useTheme,
|
|
112
|
+
useToaster
|
|
111
113
|
};
|
|
112
114
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { CraftButton } from \"./components/craft-button\";\nexport type { CraftButtonProps } from \"./components/craft-button\";\n\nexport { GlassCard } from \"./components/glass-card\";\nexport type { GlassCardProps } from \"./components/glass-card\";\n\nexport { CraftInput } from \"./components/craft-input\";\nexport type { CraftInputProps } from \"./components/craft-input\";\n\nexport { CraftTextarea } from \"./components/craft-textarea\";\nexport type { CraftTextareaProps } from \"./components/craft-textarea\";\n\nexport { CraftSelect } from \"./components/craft-select\";\nexport type { CraftSelectProps } from \"./components/craft-select\";\n\nexport { CraftCheckbox } from \"./components/craft-checkbox\";\nexport type { CraftCheckboxProps } from \"./components/craft-checkbox\";\n\nexport { CraftSwitch } from \"./components/craft-switch\";\nexport type { CraftSwitchProps } from \"./components/craft-switch\";\n\nexport { CraftBadge } from \"./components/craft-badge\";\nexport type { CraftBadgeProps } from \"./components/craft-badge\";\n\nexport { CraftAlert } from \"./components/craft-alert\";\nexport type { CraftAlertProps } from \"./components/craft-alert\";\n\nexport { CraftErrorState } from \"./components/craft-error-state\";\nexport type { CraftErrorStateProps } from \"./components/craft-error-state\";\n\nexport { CraftLoadingState } from \"./components/craft-loading-state\";\nexport type { CraftLoadingStateProps } from \"./components/craft-loading-state\";\n\nexport { CraftCard } from \"./components/craft-card\";\nexport type { CraftCardProps } from \"./components/craft-card\";\n\nexport { CraftModal } from \"./components/craft-modal\";\nexport type { CraftModalProps } from \"./components/craft-modal\";\n\nexport { CraftDrawer } from \"./components/craft-drawer\";\nexport type { CraftDrawerProps } from \"./components/craft-drawer\";\n\nexport { CraftTabs } from \"./components/craft-tabs\";\nexport type { CraftTabsProps } from \"./components/craft-tabs\";\n\nexport { CraftTooltip } from \"./components/craft-tooltip\";\nexport type { CraftTooltipProps } from \"./components/craft-tooltip\";\n\nexport {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { CraftButton } from \"./components/craft-button\";\nexport type { CraftButtonProps } from \"./components/craft-button\";\n\nexport { GlassCard } from \"./components/glass-card\";\nexport type { GlassCardProps } from \"./components/glass-card\";\n\nexport { CraftInput } from \"./components/craft-input\";\nexport type { CraftInputProps } from \"./components/craft-input\";\n\nexport { CraftTextarea } from \"./components/craft-textarea\";\nexport type { CraftTextareaProps } from \"./components/craft-textarea\";\n\nexport { CraftSelect } from \"./components/craft-select\";\nexport type { CraftSelectProps } from \"./components/craft-select\";\n\nexport { CraftCheckbox } from \"./components/craft-checkbox\";\nexport type { CraftCheckboxProps } from \"./components/craft-checkbox\";\n\nexport { CraftSwitch } from \"./components/craft-switch\";\nexport type { CraftSwitchProps } from \"./components/craft-switch\";\n\nexport { CraftBadge } from \"./components/craft-badge\";\nexport type { CraftBadgeProps } from \"./components/craft-badge\";\n\nexport { CraftAlert } from \"./components/craft-alert\";\nexport type { CraftAlertProps } from \"./components/craft-alert\";\n\nexport { CraftErrorState } from \"./components/craft-error-state\";\nexport type { CraftErrorStateProps } from \"./components/craft-error-state\";\n\nexport { CraftLoadingState } from \"./components/craft-loading-state\";\nexport type { CraftLoadingStateProps } from \"./components/craft-loading-state\";\n\nexport { CraftCard } from \"./components/craft-card\";\nexport type { CraftCardProps } from \"./components/craft-card\";\n\nexport { CraftModal } from \"./components/craft-modal\";\nexport type { CraftModalProps } from \"./components/craft-modal\";\n\nexport { CraftDrawer } from \"./components/craft-drawer\";\nexport type { CraftDrawerProps } from \"./components/craft-drawer\";\n\nexport { CraftTabs } from \"./components/craft-tabs\";\nexport type { CraftTabsProps } from \"./components/craft-tabs\";\n\nexport { CraftTooltip } from \"./components/craft-tooltip\";\nexport type { CraftTooltipProps } from \"./components/craft-tooltip\";\n\nexport { CraftToaster, useCraftToast, useToaster, toast } from \"./components/craft-toast\";\nexport type {\n CraftToasterProps,\n CraftToastVariant,\n CraftToastOptions,\n CraftToastCustomOptions,\n} from \"./components/craft-toast\";\nexport type { CraftToast } from \"./lib/toast\";\n\nexport { CraftSkeleton } from \"./components/craft-skeleton\";\nexport type { CraftSkeletonProps } from \"./components/craft-skeleton\";\n\nexport { CraftEmptyState } from \"./components/craft-empty-state\";\nexport type { CraftEmptyStateProps } from \"./components/craft-empty-state\";\n\nexport { CraftPopover } from \"./components/craft-popover\";\nexport type { CraftPopoverProps } from \"./components/craft-popover\";\n\nexport { CraftDropdownMenu } from \"./components/craft-dropdown-menu\";\nexport type { CraftDropdownMenuProps, CraftDropdownItem } from \"./components/craft-dropdown-menu\";\n\nexport { CraftCommandPalette } from \"./components/craft-command-palette\";\nexport type { CraftCommandPaletteProps, CraftCommandItem } from \"./components/craft-command-palette\";\n\nexport { CraftLink } from \"./components/craft-link\";\nexport type { CraftLinkProps } from \"./components/craft-link\";\n\nexport { CraftStatCard } from \"./components/craft-stat-card\";\nexport type { CraftStatCardProps } from \"./components/craft-stat-card\";\n\nexport { CraftDatePicker } from \"./components/craft-date-picker\";\nexport type { CraftDatePickerProps } from \"./components/craft-date-picker\";\n\nexport { CraftIcon, CraftIconProvider } from \"./components/craft-icon\";\nexport type {\n CraftIconProps,\n CraftIconProviderProps,\n CraftIconRegistry,\n} from \"./components/craft-icon\";\n\nexport { CraftNumberInput } from \"./components/craft-number-input\";\nexport type { CraftNumberInputProps } from \"./components/craft-number-input\";\n\nexport { CraftCurrencyInput } from \"./components/craft-currency-input\";\nexport type { CraftCurrencyInputProps } from \"./components/craft-currency-input\";\n\nexport { CraftForm } from \"./components/craft-form\";\nexport type { CraftFormProps } from \"./components/craft-form\";\n\nexport { CraftFormModal } from \"./components/craft-form-modal\";\nexport type { CraftFormModalProps, CraftFormModalField } from \"./components/craft-form-modal\";\n\nexport { CraftFormField } from \"./components/craft-form-field\";\nexport type { CraftFormFieldProps, CraftFormFieldOption, CraftFormFieldType } from \"./components/craft-form-field\";\n\n\nexport { CraftConfirmDialog } from \"./components/craft-confirm-dialog\";\nexport type { CraftConfirmDialogProps } from \"./components/craft-confirm-dialog\";\n\nexport { CraftCreateEditDrawer } from \"./components/craft-create-edit-drawer\";\nexport type { CraftCreateEditDrawerProps } from \"./components/craft-create-edit-drawer\";\n\nexport { CraftFilterBar } from \"./components/craft-filter-bar\";\nexport type { CraftFilterBarProps } from \"./components/craft-filter-bar\";\n\nexport { CraftTableToolbar } from \"./components/craft-table-toolbar\";\nexport type { CraftTableToolbarProps } from \"./components/craft-table-toolbar\";\n\nexport { CraftDataTableFilters } from \"./components/craft-data-table-filters\";\nexport type {\n CraftDataTableFiltersProps,\n CraftDataTableFilterSelect,\n CraftDataTableFilterSelectOption,\n CraftDataTableFilterDate,\n} from \"./components/craft-data-table-filters\";\n\nexport { CraftDataTable } from \"./components/craft-data-table\";\nexport type {\n CraftDataTableProps,\n CraftDataTableColumn,\n CraftDataTableSort,\n CraftDataTableAction,\n} from \"./components/craft-data-table\";\nexport { CraftDataTableHeader } from \"./components/craft-data-table-header\";\nexport type { CraftDataTableHeaderProps } from \"./components/craft-data-table-header\";\nexport { CraftDataTablePagination } from \"./components/craft-data-table-pagination\";\nexport type { CraftDataTablePaginationProps } from \"./components/craft-data-table-pagination\";\nexport { CraftLoader } from \"./components/craft-loader\";\nexport type { CraftLoaderProps } from \"./components/craft-loader\";\n\nexport { CraftPagination } from \"./components/craft-pagination\";\nexport type { CraftPaginationProps } from \"./components/craft-pagination\";\n\nexport { AppShell } from \"./components/layout/app-shell\";\nexport type { AppShellProps } from \"./components/layout/app-shell\";\n\nexport { AppTemplate } from \"./components/layout/app-template\";\nexport type { AppTemplateProps } from \"./components/layout/app-template\";\n\nexport type {\n LayoutConfig,\n LayoutSidebarItem,\n LayoutBreadcrumbItem,\n LayoutIconName,\n} from \"./components/layout/layout-config\";\nexport { layoutConfigSchema } from \"./components/layout/layout-config\";\n\nexport { Sidebar } from \"./components/layout/sidebar\";\nexport type { SidebarProps, SidebarItem } from \"./components/layout/sidebar\";\n\nexport { TopNav } from \"./components/layout/top-nav\";\nexport type { TopNavProps } from \"./components/layout/top-nav\";\n\nexport { PageHeader } from \"./components/layout/page-header\";\nexport type { PageHeaderProps } from \"./components/layout/page-header\";\n\nexport { Breadcrumbs } from \"./components/layout/breadcrumbs\";\nexport type { BreadcrumbsProps, BreadcrumbItem } from \"./components/layout/breadcrumbs\";\n\nexport { AuthLayout } from \"./components/layout/auth-layout\";\nexport type { AuthLayoutProps } from \"./components/layout/auth-layout\";\n\nexport { Container } from \"./components/layout/container\";\nexport type { ContainerProps } from \"./components/layout/container\";\n\nexport { Grid } from \"./components/layout/grid\";\nexport type { GridProps } from \"./components/layout/grid\";\n\nexport { ThemeSwitcher } from \"./components/theme-switcher\";\nexport type { ThemeSwitcherProps } from \"./components/theme-switcher\";\n\nexport { ThemeProvider, useTheme } from \"./theme/theme-context\";\nexport type { ThemeName, ThemeMode } from \"./theme/theme-context\";\n"],"mappings":"AAAA,SAAS,mBAAmB;AAG5B,SAAS,iBAAiB;AAG1B,SAAS,kBAAkB;AAG3B,SAAS,qBAAqB;AAG9B,SAAS,mBAAmB;AAG5B,SAAS,qBAAqB;AAG9B,SAAS,mBAAmB;AAG5B,SAAS,kBAAkB;AAG3B,SAAS,kBAAkB;AAG3B,SAAS,uBAAuB;AAGhC,SAAS,yBAAyB;AAGlC,SAAS,iBAAiB;AAG1B,SAAS,kBAAkB;AAG3B,SAAS,mBAAmB;AAG5B,SAAS,iBAAiB;AAG1B,SAAS,oBAAoB;AAG7B,SAAS,cAAc,eAAe,YAAY,aAAa;AAS/D,SAAS,qBAAqB;AAG9B,SAAS,uBAAuB;AAGhC,SAAS,oBAAoB;AAG7B,SAAS,yBAAyB;AAGlC,SAAS,2BAA2B;AAGpC,SAAS,iBAAiB;AAG1B,SAAS,qBAAqB;AAG9B,SAAS,uBAAuB;AAGhC,SAAS,WAAW,yBAAyB;AAO7C,SAAS,wBAAwB;AAGjC,SAAS,0BAA0B;AAGnC,SAAS,iBAAiB;AAG1B,SAAS,sBAAsB;AAG/B,SAAS,sBAAsB;AAI/B,SAAS,0BAA0B;AAGnC,SAAS,6BAA6B;AAGtC,SAAS,sBAAsB;AAG/B,SAAS,yBAAyB;AAGlC,SAAS,6BAA6B;AAQtC,SAAS,sBAAsB;AAO/B,SAAS,4BAA4B;AAErC,SAAS,gCAAgC;AAEzC,SAAS,mBAAmB;AAG5B,SAAS,uBAAuB;AAGhC,SAAS,gBAAgB;AAGzB,SAAS,mBAAmB;AAS5B,SAAS,0BAA0B;AAEnC,SAAS,eAAe;AAGxB,SAAS,cAAc;AAGvB,SAAS,kBAAkB;AAG3B,SAAS,mBAAmB;AAG5B,SAAS,kBAAkB;AAG3B,SAAS,iBAAiB;AAG1B,SAAS,YAAY;AAGrB,SAAS,qBAAqB;AAG9B,SAAS,eAAe,gBAAgB;","names":[]}
|