@jameskabz/nextcraft-ui 0.8.1 → 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.
|
@@ -27,8 +27,8 @@ __export(craft_toast_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(craft_toast_exports);
|
|
28
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
29
|
var import_cn = require("../utils/cn");
|
|
30
|
-
var import_toast = require("
|
|
31
|
-
var import_toast2 = require("
|
|
30
|
+
var import_toast = require("../lib/toast");
|
|
31
|
+
var import_toast2 = require("../lib/toast");
|
|
32
32
|
const variantClasses = {
|
|
33
33
|
info: "border-[color:rgb(var(--nc-accent-1)/0.4)]",
|
|
34
34
|
success: "border-emerald-400/40",
|
|
@@ -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\";\nimport {\n normalizeVariant,\n removeToast,\n useToaster,\n type CraftToastCustomOptions,\n type CraftToastOptions,\n type CraftToastVariant,\n} from \"
|
|
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"]}
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
normalizeVariant,
|
|
6
6
|
removeToast,
|
|
7
7
|
useToaster
|
|
8
|
-
} from "
|
|
9
|
-
import { useCraftToast, useToaster as useToaster2, toast } from "
|
|
8
|
+
} from "../lib/toast";
|
|
9
|
+
import { useCraftToast, useToaster as useToaster2, toast } from "../lib/toast";
|
|
10
10
|
const variantClasses = {
|
|
11
11
|
info: "border-[color:rgb(var(--nc-accent-1)/0.4)]",
|
|
12
12
|
success: "border-emerald-400/40",
|
|
@@ -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\";\nimport {\n normalizeVariant,\n removeToast,\n useToaster,\n type CraftToastCustomOptions,\n type CraftToastOptions,\n type CraftToastVariant,\n} from \"
|
|
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"]}
|