@fuf-stack/pixels 1.10.2 → 1.11.1
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/Accordion/Accordion.d.cts +512 -74
- package/dist/Accordion/Accordion.d.cts.map +1 -1
- package/dist/Accordion/Accordion.d.ts +512 -74
- package/dist/Accordion/Accordion.d.ts.map +1 -1
- package/dist/Alert/Alert.cjs +18 -6
- package/dist/Alert/Alert.cjs.map +1 -1
- package/dist/Alert/Alert.d.cts +396 -98
- package/dist/Alert/Alert.d.cts.map +1 -1
- package/dist/Alert/Alert.d.ts +396 -98
- package/dist/Alert/Alert.d.ts.map +1 -1
- package/dist/Alert/Alert.js +18 -6
- package/dist/Alert/Alert.js.map +1 -1
- package/dist/Avatar/Avatar.d.cts +734 -45
- package/dist/Avatar/Avatar.d.cts.map +1 -1
- package/dist/Avatar/Avatar.d.ts +734 -45
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Badge/Badge.d.cts +377 -27
- package/dist/Badge/Badge.d.cts.map +1 -1
- package/dist/Badge/Badge.d.ts +377 -27
- package/dist/Badge/Badge.d.ts.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.d.cts +853 -51
- package/dist/Breadcrumb/Breadcrumb.d.cts.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.d.ts +853 -51
- package/dist/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/Button/Button.cjs.map +1 -1
- package/dist/Button/Button.d.cts +3 -215
- package/dist/Button/Button.d.cts.map +1 -1
- package/dist/Button/Button.d.ts +3 -215
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js.map +1 -1
- package/dist/Card/Card.d.cts +734 -45
- package/dist/Card/Card.d.cts.map +1 -1
- package/dist/Card/Card.d.ts +734 -45
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Drawer/Drawer.d.cts +972 -57
- package/dist/Drawer/Drawer.d.cts.map +1 -1
- package/dist/Drawer/Drawer.d.ts +972 -57
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Label/Label.d.cts +418 -173
- package/dist/Label/Label.d.cts.map +1 -1
- package/dist/Label/Label.d.ts +418 -173
- package/dist/Label/Label.d.ts.map +1 -1
- package/dist/Menu/Menu.d.cts +377 -27
- package/dist/Menu/Menu.d.cts.map +1 -1
- package/dist/Menu/Menu.d.ts +377 -27
- package/dist/Menu/Menu.d.ts.map +1 -1
- package/dist/Modal/Modal.cjs +1 -1
- package/dist/Modal/Modal.cjs.map +1 -1
- package/dist/Modal/Modal.d.cts +347 -71
- package/dist/Modal/Modal.d.cts.map +1 -1
- package/dist/Modal/Modal.d.ts +347 -71
- package/dist/Modal/Modal.d.ts.map +1 -1
- package/dist/Modal/Modal.js +2 -2
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/Modal/ModalHost.cjs +40 -0
- package/dist/Modal/ModalHost.cjs.map +1 -0
- package/dist/Modal/ModalHost.d.cts +16 -0
- package/dist/Modal/ModalHost.d.cts.map +1 -0
- package/dist/Modal/ModalHost.d.ts +16 -0
- package/dist/Modal/ModalHost.d.ts.map +1 -0
- package/dist/Modal/ModalHost.js +39 -0
- package/dist/Modal/ModalHost.js.map +1 -0
- package/dist/Modal/index.cjs +4 -0
- package/dist/Modal/index.cjs.map +1 -1
- package/dist/Modal/index.d.cts +3 -1
- package/dist/Modal/index.d.ts +3 -1
- package/dist/Modal/index.js +3 -1
- package/dist/Modal/index.js.map +1 -1
- package/dist/Modal/modalStore.cjs +80 -0
- package/dist/Modal/modalStore.cjs.map +1 -0
- package/dist/Modal/modalStore.d.cts +31 -0
- package/dist/Modal/modalStore.d.cts.map +1 -0
- package/dist/Modal/modalStore.d.ts +31 -0
- package/dist/Modal/modalStore.d.ts.map +1 -0
- package/dist/Modal/modalStore.js +78 -0
- package/dist/Modal/modalStore.js.map +1 -0
- package/dist/Popover/Popover.d.cts +1091 -63
- package/dist/Popover/Popover.d.cts.map +1 -1
- package/dist/Popover/Popover.d.ts +1091 -63
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Progress/Progress.d.cts +321 -85
- package/dist/Progress/Progress.d.cts.map +1 -1
- package/dist/Progress/Progress.d.ts +321 -85
- package/dist/Progress/Progress.d.ts.map +1 -1
- package/dist/ProgressCircular/ProgressCircular.d.cts +507 -186
- package/dist/ProgressCircular/ProgressCircular.d.cts.map +1 -1
- package/dist/ProgressCircular/ProgressCircular.d.ts +507 -186
- package/dist/ProgressCircular/ProgressCircular.d.ts.map +1 -1
- package/dist/SearchInput/SearchInput.d.cts +615 -39
- package/dist/SearchInput/SearchInput.d.cts.map +1 -1
- package/dist/SearchInput/SearchInput.d.ts +615 -39
- package/dist/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/Table/Table.d.cts +514 -96
- package/dist/Table/Table.d.cts.map +1 -1
- package/dist/Table/Table.d.ts +514 -96
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Tabs/Tabs.d.cts +972 -57
- package/dist/Tabs/Tabs.d.cts.map +1 -1
- package/dist/Tabs/Tabs.d.ts +972 -57
- package/dist/Tabs/Tabs.d.ts.map +1 -1
- package/dist/Toast/Toaster.cjs +10 -2
- package/dist/Toast/Toaster.cjs.map +1 -1
- package/dist/Toast/Toaster.d.cts +5 -2
- package/dist/Toast/Toaster.d.cts.map +1 -1
- package/dist/Toast/Toaster.d.ts +5 -2
- package/dist/Toast/Toaster.d.ts.map +1 -1
- package/dist/Toast/Toaster.js +10 -2
- package/dist/Toast/Toaster.js.map +1 -1
- package/dist/Toast/index.cjs +3 -3
- package/dist/Toast/index.cjs.map +1 -1
- package/dist/Toast/index.d.cts +1 -1
- package/dist/Toast/index.d.ts +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/Toast/index.js.map +1 -1
- package/dist/Toast/{Toast.cjs → toast.cjs} +2 -2
- package/dist/Toast/{Toast.cjs.map → toast.cjs.map} +1 -1
- package/dist/Toast/{Toast.d.cts → toast.d.cts} +2 -2
- package/dist/Toast/{Toast.d.cts.map → toast.d.cts.map} +1 -1
- package/dist/Toast/{Toast.d.ts → toast.d.ts} +2 -2
- package/dist/Toast/{Toast.d.ts.map → toast.d.ts.map} +1 -1
- package/dist/Toast/{Toast.js → toast.js} +2 -2
- package/dist/Toast/{Toast.js.map → toast.js.map} +1 -1
- package/dist/Tooltip/Tooltip.d.cts +452 -143
- package/dist/Tooltip/Tooltip.d.cts.map +1 -1
- package/dist/Tooltip/Tooltip.d.ts +452 -143
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/package.json +4 -4
package/dist/Tabs/Tabs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","names":[],"sources":["../../src/Tabs/Tabs.tsx"],"mappings":";;;;cAOa,YAAA,
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","names":[],"sources":["../../src/Tabs/Tabs.tsx"],"mappings":";;;;cAOa,YAAA,IAAY,KAAA;EAAA;;;gbAUvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gbAVuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sbAYsB;EAAA;IAAA;;;kbACC;;;;sbAExC;EAAA;IAAA;;;kbAEiB;;;;sbAQP;EAAA;kbANhB;;;;sbAIK;EAAA;;;;;kbAOoB;;;;sbAgBC;EAAA;IAAA;;;kbAhBmB;;;;sbAIjC;EAAA;IAAA;;;kbAUZ;;;;sbAIA;EAAA;IAAA;;;kbAQA;;;;sbAMA;EAAA;IAAA;;;kbA2DD;;;;sbArDa;EAAA;kbAAA;;;;sbAAA;EAAA;AAAA;;kbAAA;;;;sbAiBF;EAAA;;obAjBE;;;;wbAAA;IAAA;;obAAA;;;;wbAAA;IAAA;;obAAA;;;;wbAAA;IAAA;;obAAA;;;;wbAAA;IAAA;;obAAA;;;;wbAiBF;IAAA;;obAoCX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA7GI,YAAA,GAAe,OAAO,QAAQ,YAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,YAAA;AAAA,KAE/B,KAAA;AAAA,UAEY,QAAA;;EAEf,OAAA,EAAS,SAAA;;EAET,QAAA;;EAEA,GAAA,EAAK,KAAA;;EAEL,KAAA,EAAO,SAAA;;EAEP,MAAA;AAAA;AAAA,UAGe,SAAA,SAAkB,YAAA;;EAEjC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,kBAAA;;EAEA,uBAAA;;EAEA,gBAAA;;EAEA,YAAA;;EAEA,SAAA;;EAEA,iBAAA,IAAqB,GAAA,EAAK,KAAA;;EAE1B,SAAA;;EAEA,MAAA;;EAEA,WAAA,GAAc,KAAA;;EAEd,IAAA;;EAEA,IAAA,EAAM,QAAA;;EAEN,MAAA;;EAEA,OAAA;;EAEA,QAAA;AAAA;;;;cAMI,IAAA;EAAQ,SAAA;EAAA,SAAA;EAAA,kBAAA;EAAA,uBAAA;EAAA,gBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,iBAAA;EAAA,SAAA;EAAA,MAAA;EAAA,WAAA;EAAA,IAAA;EAAA,IAAA;EAAA,MAAA;EAAA,OAAA;EAAA;AAAA,GAiBX,SAAA,iCAAS,GAAA,CAAA,OAAA"}
|
package/dist/Toast/Toaster.cjs
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
2
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
4
|
let sonner = require("sonner");
|
|
4
5
|
//#region src/Toast/Toaster.tsx
|
|
5
|
-
const Toaster = (
|
|
6
|
-
|
|
6
|
+
const Toaster = ({ toastOptions, ...rest }) => {
|
|
7
|
+
const className = (0, _fuf_stack_pixel_utils.cn)("w-[var(--width)]", toastOptions?.className);
|
|
8
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(sonner.Toaster, {
|
|
9
|
+
...rest,
|
|
10
|
+
toastOptions: {
|
|
11
|
+
...toastOptions,
|
|
12
|
+
className
|
|
13
|
+
}
|
|
14
|
+
});
|
|
7
15
|
};
|
|
8
16
|
//#endregion
|
|
9
17
|
exports.default = Toaster;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.cjs","names":["SonnerToaster"],"sources":["../../src/Toast/Toaster.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { Toaster as SonnerToaster } from 'sonner';\n\nexport type ToasterProps = Pick<\n ComponentProps<typeof SonnerToaster>,\n 'visibleToasts' | 'position'\n>;\n\nconst Toaster = (
|
|
1
|
+
{"version":3,"file":"Toaster.cjs","names":["SonnerToaster"],"sources":["../../src/Toast/Toaster.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { Toaster as SonnerToaster } from 'sonner';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nexport type ToasterProps = Pick<\n ComponentProps<typeof SonnerToaster>,\n 'visibleToasts' | 'position' | 'style' | 'className' | 'toastOptions'\n>;\n\nconst Toaster = ({ toastOptions, ...rest }: ToasterProps) => {\n // Force each toast to take the configured Toaster `--width` so that toasts\n // with short content do not shrink and stay centered when the position is\n // `top-center` / `bottom-center`. Sonner only applies `width: var(--width)`\n // to its built-in styled toasts; our toasts use `toast.custom` and would\n // otherwise size to their content.\n const className = cn('w-[var(--width)]', toastOptions?.className);\n return (\n <SonnerToaster {...rest} toastOptions={{ ...toastOptions, className }} />\n );\n};\n\nexport default Toaster;\n"],"mappings":";;;;;AAWA,MAAM,WAAW,EAAE,cAAc,GAAG,WAAyB;CAM3D,MAAM,aAAA,GAAA,uBAAA,IAAe,oBAAoB,cAAc,SAAS;CAChE,OACE,iBAAA,GAAA,kBAAA,KAACA,OAAAA,SAAD;EAAe,GAAI;EAAM,cAAc;GAAE,GAAG;GAAc;EAAU;CAAI,CAAA;AAE5E"}
|
package/dist/Toast/Toaster.d.cts
CHANGED
|
@@ -2,8 +2,11 @@ import { ComponentProps } from "react";
|
|
|
2
2
|
import { Toaster } from "sonner";
|
|
3
3
|
|
|
4
4
|
//#region src/Toast/Toaster.d.ts
|
|
5
|
-
type ToasterProps = Pick<ComponentProps<typeof Toaster>, 'visibleToasts' | 'position'>;
|
|
6
|
-
declare const Toaster$1: (
|
|
5
|
+
type ToasterProps = Pick<ComponentProps<typeof Toaster>, 'visibleToasts' | 'position' | 'style' | 'className' | 'toastOptions'>;
|
|
6
|
+
declare const Toaster$1: ({
|
|
7
|
+
toastOptions,
|
|
8
|
+
...rest
|
|
9
|
+
}: ToasterProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
//#endregion
|
|
8
11
|
export { Toaster$1 as Toaster, ToasterProps };
|
|
9
12
|
//# sourceMappingURL=Toaster.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.d.cts","names":[],"sources":["../../src/Toast/Toaster.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"Toaster.d.cts","names":[],"sources":["../../src/Toast/Toaster.tsx"],"mappings":";;;;KAMY,YAAA,GAAe,IAAA,CACzB,cAAA,QAAsB,OAAA;AAAA,cAIlB,SAAA;EAAW,YAAA;EAAA,GAAA;AAAA,GAA2B,YAAY,iCAAA,GAAA,CAAA,OAAA"}
|
package/dist/Toast/Toaster.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import { ComponentProps } from "react";
|
|
|
2
2
|
import { Toaster } from "sonner";
|
|
3
3
|
|
|
4
4
|
//#region src/Toast/Toaster.d.ts
|
|
5
|
-
type ToasterProps = Pick<ComponentProps<typeof Toaster>, 'visibleToasts' | 'position'>;
|
|
6
|
-
declare const Toaster$1: (
|
|
5
|
+
type ToasterProps = Pick<ComponentProps<typeof Toaster>, 'visibleToasts' | 'position' | 'style' | 'className' | 'toastOptions'>;
|
|
6
|
+
declare const Toaster$1: ({
|
|
7
|
+
toastOptions,
|
|
8
|
+
...rest
|
|
9
|
+
}: ToasterProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
//#endregion
|
|
8
11
|
export { Toaster$1 as Toaster, ToasterProps };
|
|
9
12
|
//# sourceMappingURL=Toaster.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.d.ts","names":[],"sources":["../../src/Toast/Toaster.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"Toaster.d.ts","names":[],"sources":["../../src/Toast/Toaster.tsx"],"mappings":";;;;KAMY,YAAA,GAAe,IAAA,CACzB,cAAA,QAAsB,OAAA;AAAA,cAIlB,SAAA;EAAW,YAAA;EAAA,GAAA;AAAA,GAA2B,YAAY,iCAAA,GAAA,CAAA,OAAA"}
|
package/dist/Toast/Toaster.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
import { cn } from "@fuf-stack/pixel-utils";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { Toaster } from "sonner";
|
|
3
4
|
//#region src/Toast/Toaster.tsx
|
|
4
|
-
const Toaster$1 = (
|
|
5
|
-
|
|
5
|
+
const Toaster$1 = ({ toastOptions, ...rest }) => {
|
|
6
|
+
const className = cn("w-[var(--width)]", toastOptions?.className);
|
|
7
|
+
return /* @__PURE__ */ jsx(Toaster, {
|
|
8
|
+
...rest,
|
|
9
|
+
toastOptions: {
|
|
10
|
+
...toastOptions,
|
|
11
|
+
className
|
|
12
|
+
}
|
|
13
|
+
});
|
|
6
14
|
};
|
|
7
15
|
//#endregion
|
|
8
16
|
export { Toaster$1 as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.js","names":["Toaster","SonnerToaster"],"sources":["../../src/Toast/Toaster.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { Toaster as SonnerToaster } from 'sonner';\n\nexport type ToasterProps = Pick<\n ComponentProps<typeof SonnerToaster>,\n 'visibleToasts' | 'position'\n>;\n\nconst Toaster = (
|
|
1
|
+
{"version":3,"file":"Toaster.js","names":["Toaster","SonnerToaster"],"sources":["../../src/Toast/Toaster.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { Toaster as SonnerToaster } from 'sonner';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nexport type ToasterProps = Pick<\n ComponentProps<typeof SonnerToaster>,\n 'visibleToasts' | 'position' | 'style' | 'className' | 'toastOptions'\n>;\n\nconst Toaster = ({ toastOptions, ...rest }: ToasterProps) => {\n // Force each toast to take the configured Toaster `--width` so that toasts\n // with short content do not shrink and stay centered when the position is\n // `top-center` / `bottom-center`. Sonner only applies `width: var(--width)`\n // to its built-in styled toasts; our toasts use `toast.custom` and would\n // otherwise size to their content.\n const className = cn('w-[var(--width)]', toastOptions?.className);\n return (\n <SonnerToaster {...rest} toastOptions={{ ...toastOptions, className }} />\n );\n};\n\nexport default Toaster;\n"],"mappings":";;;;AAWA,MAAMA,aAAW,EAAE,cAAc,GAAG,WAAyB;CAM3D,MAAM,YAAY,GAAG,oBAAoB,cAAc,SAAS;CAChE,OACE,oBAACC,SAAD;EAAe,GAAI;EAAM,cAAc;GAAE,GAAG;GAAc;EAAU;CAAI,CAAA;AAE5E"}
|
package/dist/Toast/index.cjs
CHANGED
|
@@ -2,13 +2,13 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const
|
|
5
|
+
const require_toast = require("./toast.cjs");
|
|
6
6
|
const require_Toaster = require("./Toaster.cjs");
|
|
7
7
|
//#region src/Toast/index.ts
|
|
8
|
-
var Toast_default =
|
|
8
|
+
var Toast_default = require_toast.default;
|
|
9
9
|
//#endregion
|
|
10
10
|
exports.Toaster = require_Toaster.default;
|
|
11
11
|
exports.default = Toast_default;
|
|
12
|
-
exports.toast =
|
|
12
|
+
exports.toast = require_toast.default;
|
|
13
13
|
|
|
14
14
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Toast/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["toast"],"sources":["../../src/Toast/index.ts"],"sourcesContent":["import toast from './
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["toast"],"sources":["../../src/Toast/index.ts"],"sourcesContent":["import toast from './toast';\nimport Toaster from './Toaster';\n\nexport type { ToastOptions, ToastRenderProps } from './toast';\nexport type { ToasterProps } from './Toaster';\n\nexport { Toaster, toast };\nexport default toast;\n"],"mappings":";;;;;;;AAOA,IAAA,gBAAeA,cAAAA"}
|
package/dist/Toast/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ToastOptions, ToastRenderProps, toast } from "./
|
|
1
|
+
import { ToastOptions, ToastRenderProps, toast } from "./toast.cjs";
|
|
2
2
|
import { Toaster, ToasterProps } from "./Toaster.cjs";
|
|
3
3
|
export { type ToastOptions, type ToastRenderProps, Toaster, type ToasterProps, toast as default, toast };
|
package/dist/Toast/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ToastOptions, ToastRenderProps, toast } from "./
|
|
1
|
+
import { ToastOptions, ToastRenderProps, toast } from "./toast.js";
|
|
2
2
|
import { Toaster, ToasterProps } from "./Toaster.js";
|
|
3
3
|
export { type ToastOptions, type ToastRenderProps, Toaster, type ToasterProps, toast as default, toast };
|
package/dist/Toast/index.js
CHANGED
package/dist/Toast/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/Toast/index.ts"],"sourcesContent":["import toast from './
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/Toast/index.ts"],"sourcesContent":["import toast from './toast';\nimport Toaster from './Toaster';\n\nexport type { ToastOptions, ToastRenderProps } from './toast';\nexport type { ToasterProps } from './Toaster';\n\nexport { Toaster, toast };\nexport default toast;\n"],"mappings":";;;AAOA,IAAA,gBAAe"}
|
|
@@ -2,7 +2,7 @@ require("../_virtual/_rolldown/runtime.cjs");
|
|
|
2
2
|
const require_Alert_index = require("../Alert/index.cjs");
|
|
3
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
4
|
let sonner = require("sonner");
|
|
5
|
-
//#region src/Toast/
|
|
5
|
+
//#region src/Toast/toast.tsx
|
|
6
6
|
const showToast = (message, variant, options) => {
|
|
7
7
|
const { onClose, closable, title, endContent, icon, render, ...rest } = options ?? {};
|
|
8
8
|
const sonnerOptions = {
|
|
@@ -87,4 +87,4 @@ const toast = {
|
|
|
87
87
|
//#endregion
|
|
88
88
|
exports.default = toast;
|
|
89
89
|
|
|
90
|
-
//# sourceMappingURL=
|
|
90
|
+
//# sourceMappingURL=toast.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"toast.cjs","names":["sonnerToast","AlertComponent"],"sources":["../../src/Toast/toast.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport type { ExternalToast } from 'sonner';\nimport type { AlertProps } from '../Alert';\n\nimport { toast as sonnerToast } from 'sonner';\n\nimport AlertComponent from '../Alert';\n\ntype AlertVariant = NonNullable<AlertProps['variant']>;\n\n/** Props passed to a custom render function */\nexport interface ToastRenderProps {\n /** The toast message */\n message: ReactNode;\n /** The color/severity of the toast */\n variant: AlertVariant;\n /** Function to close the toast */\n close: () => void;\n /** Whether the toast can be closed by the user */\n closable?: boolean;\n /** Title displayed above the toast message */\n title?: ReactNode;\n /** Content displayed at the end of the toast */\n endContent?: ReactNode;\n /** Icon displayed at the start of the toast */\n icon?: ReactNode;\n}\n\n/** Options passed to each toast method */\nexport interface ToastOptions {\n /** Title displayed above the toast message */\n title?: ReactNode;\n /** Whether the toast can be closed by the user */\n closable?: boolean;\n /** Duration in milliseconds before the toast auto-closes */\n duration?: number;\n /** Position of the toast on the screen */\n position?: ExternalToast['position'];\n /** Callback fired when the toast auto-closes */\n onAutoClose?: ExternalToast['onAutoClose'];\n /** Callback fired when the toast is closed */\n onClose?: ExternalToast['onDismiss'];\n /** Content displayed at the end of the toast */\n endContent?: ReactNode;\n /** Icon displayed at the start of the toast */\n icon?: ReactNode;\n /** Custom render function to override the default AlertComponent */\n render?: (props: ToastRenderProps) => ReactElement;\n}\n\nconst showToast = (\n message: ReactNode,\n variant: AlertVariant,\n options?: ToastOptions,\n) => {\n // Map custom ToastOptions to Sonner's ExternalToast format:\n // - onClose is mapped to Sonner's onDismiss\n // - closable is handled separately (not a Sonner option)\n // - position defaults to 'top-center'\n const { onClose, closable, title, endContent, icon, render, ...rest } =\n options ?? {};\n const sonnerOptions: ExternalToast = {\n position: 'top-center' as const,\n onDismiss: onClose,\n ...rest,\n };\n return sonnerToast.custom((id) => {\n // Close function passed to custom render or AlertComponent\n const close = () => {\n return sonnerToast.dismiss(id);\n };\n\n // Allow custom rendering via render prop\n if (render) {\n return render({\n message,\n variant,\n close,\n closable,\n title,\n endContent,\n icon,\n });\n }\n\n // Default: render AlertComponent\n return (\n <AlertComponent\n closable={closable}\n endContent={endContent}\n icon={icon}\n onClose={closable ? close : undefined}\n title={title}\n variant={variant}\n >\n {message}\n </AlertComponent>\n );\n }, sonnerOptions);\n};\n\n/** Toast object with convenience methods for different severity levels */\nconst toast = {\n /**\n * Show a default toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n default: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'default', options);\n },\n /**\n * Show an info toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n info: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'info', options);\n },\n /**\n * Show a warning toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n warn: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'warning', {\n duration: 60000,\n closable: true,\n ...options,\n });\n },\n /**\n * Show a success toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n success: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'success', options);\n },\n /**\n * Show an error toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n error: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'danger', {\n duration: 60000,\n closable: true,\n ...options,\n });\n },\n /** Close a toast by its id */\n close: (toastId: string | number) => {\n sonnerToast.dismiss(toastId);\n },\n};\n\nexport default toast;\n"],"mappings":";;;;;AAkDA,MAAM,aACJ,SACA,SACA,YACG;CAKH,MAAM,EAAE,SAAS,UAAU,OAAO,YAAY,MAAM,QAAQ,GAAG,SAC7D,WAAW,CAAC;CACd,MAAM,gBAA+B;EACnC,UAAU;EACV,WAAW;EACX,GAAG;CACL;CACA,OAAOA,OAAAA,MAAY,QAAQ,OAAO;EAEhC,MAAM,cAAc;GAClB,OAAOA,OAAAA,MAAY,QAAQ,EAAE;EAC/B;EAGA,IAAI,QACF,OAAO,OAAO;GACZ;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EAIH,OACE,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,SAAD;GACY;GACE;GACN;GACN,SAAS,WAAW,QAAQ,KAAA;GACrB;GACE;aAER;EACa,CAAA;CAEpB,GAAG,aAAa;AAClB;;AAGA,MAAM,QAAQ;;;;;CAKZ,UAAU,SAAoB,YAA2B;EACvD,OAAO,UAAU,SAAS,WAAW,OAAO;CAC9C;;;;;CAKA,OAAO,SAAoB,YAA2B;EACpD,OAAO,UAAU,SAAS,QAAQ,OAAO;CAC3C;;;;;CAKA,OAAO,SAAoB,YAA2B;EACpD,OAAO,UAAU,SAAS,WAAW;GACnC,UAAU;GACV,UAAU;GACV,GAAG;EACL,CAAC;CACH;;;;;CAKA,UAAU,SAAoB,YAA2B;EACvD,OAAO,UAAU,SAAS,WAAW,OAAO;CAC9C;;;;;CAKA,QAAQ,SAAoB,YAA2B;EACrD,OAAO,UAAU,SAAS,UAAU;GAClC,UAAU;GACV,UAAU;GACV,GAAG;EACL,CAAC;CACH;;CAEA,QAAQ,YAA6B;EACnC,OAAA,MAAY,QAAQ,OAAO;CAC7B;AACF"}
|
|
@@ -2,7 +2,7 @@ import { AlertProps } from "../Alert/Alert.cjs";
|
|
|
2
2
|
import { ReactElement, ReactNode } from "react";
|
|
3
3
|
import { ExternalToast } from "sonner";
|
|
4
4
|
|
|
5
|
-
//#region src/Toast/
|
|
5
|
+
//#region src/Toast/toast.d.ts
|
|
6
6
|
type AlertVariant = NonNullable<AlertProps['variant']>;
|
|
7
7
|
/** Props passed to a custom render function */
|
|
8
8
|
interface ToastRenderProps {
|
|
@@ -73,4 +73,4 @@ declare const toast: {
|
|
|
73
73
|
};
|
|
74
74
|
//#endregion
|
|
75
75
|
export { ToastOptions, ToastRenderProps, toast };
|
|
76
|
-
//# sourceMappingURL=
|
|
76
|
+
//# sourceMappingURL=toast.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"toast.d.cts","names":[],"sources":["../../src/Toast/toast.tsx"],"mappings":";;;;;KAQK,YAAA,GAAe,WAAW,CAAC,UAAA;;UAGf,gBAAA;EAHZ;EAKH,OAAA,EAAS,SAAA;;EAET,OAAA,EAAS,YAAA;EAP+B;EASxC,KAAA;EAN+B;EAQ/B,QAAA;EANS;EAQT,KAAA,GAAQ,SAAA;EAAA;EAER,UAAA,GAAa,SAAA;EAEN;EAAP,IAAA,GAAO,SAAA;AAAA;;UAIQ,YAAA;EAdf;EAgBA,KAAA,GAAQ,SAAA;EAdR;EAgBA,QAAA;EAZA;EAcA,QAAA;EAZA;EAcA,QAAA,GAAW,aAAA;EAZX;EAcA,WAAA,GAAc,aAAA;EAdE;EAgBhB,OAAA,GAAU,aAAA;EAZK;EAcf,UAAA,GAAa,SAAA;;EAEb,IAAA,GAAO,SAAA;EARI;EAUX,MAAA,IAAU,KAAA,EAAO,gBAAA,KAAqB,YAAA;AAAA;;cAuDlC,KAAA;EAvDa;;;;qBA4DE,SAAA,EAAS,OAAA,GAAY,YAAA;EA5EhC;;;;kBAmFQ,SAAA,EAAS,OAAA,GAAY,YAAA;EA3ErC;;;;kBAkFgB,SAAA,EAAS,OAAA,GAAY,YAAA;EA9ExB;;;;qBAyFM,SAAA,EAAS,OAAA,GAAY,YAAA;EArF9B;;;AAAwC;mBA4FjC,SAAA,EAAS,OAAA,GAAY,YAAA,sBAWvC"}
|
|
@@ -2,7 +2,7 @@ import { AlertProps } from "../Alert/Alert.js";
|
|
|
2
2
|
import { ReactElement, ReactNode } from "react";
|
|
3
3
|
import { ExternalToast } from "sonner";
|
|
4
4
|
|
|
5
|
-
//#region src/Toast/
|
|
5
|
+
//#region src/Toast/toast.d.ts
|
|
6
6
|
type AlertVariant = NonNullable<AlertProps['variant']>;
|
|
7
7
|
/** Props passed to a custom render function */
|
|
8
8
|
interface ToastRenderProps {
|
|
@@ -73,4 +73,4 @@ declare const toast$1: {
|
|
|
73
73
|
};
|
|
74
74
|
//#endregion
|
|
75
75
|
export { ToastOptions, ToastRenderProps, toast$1 as toast };
|
|
76
|
-
//# sourceMappingURL=
|
|
76
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"toast.d.ts","names":[],"sources":["../../src/Toast/toast.tsx"],"mappings":";;;;;KAQK,YAAA,GAAe,WAAW,CAAC,UAAA;;UAGf,gBAAA;EAHZ;EAKH,OAAA,EAAS,SAAA;;EAET,OAAA,EAAS,YAAA;EAP+B;EASxC,KAAA;EAN+B;EAQ/B,QAAA;EANS;EAQT,KAAA,GAAQ,SAAA;EAAA;EAER,UAAA,GAAa,SAAA;EAEN;EAAP,IAAA,GAAO,SAAA;AAAA;;UAIQ,YAAA;EAdf;EAgBA,KAAA,GAAQ,SAAA;EAdR;EAgBA,QAAA;EAZA;EAcA,QAAA;EAZA;EAcA,QAAA,GAAW,aAAA;EAZX;EAcA,WAAA,GAAc,aAAA;EAdE;EAgBhB,OAAA,GAAU,aAAA;EAZK;EAcf,UAAA,GAAa,SAAA;;EAEb,IAAA,GAAO,SAAA;EARI;EAUX,MAAA,IAAU,KAAA,EAAO,gBAAA,KAAqB,YAAA;AAAA;;cAuDlC,OAAA;EAvDa;;;;qBA4DE,SAAA,EAAS,OAAA,GAAY,YAAA;EA5EhC;;;;kBAmFQ,SAAA,EAAS,OAAA,GAAY,YAAA;EA3ErC;;;;kBAkFgB,SAAA,EAAS,OAAA,GAAY,YAAA;EA9ExB;;;;qBAyFM,SAAA,EAAS,OAAA,GAAY,YAAA;EArF9B;;;AAAwC;mBA4FjC,SAAA,EAAS,OAAA,GAAY,YAAA,sBAWvC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Alert_default from "../Alert/index.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { toast } from "sonner";
|
|
4
|
-
//#region src/Toast/
|
|
4
|
+
//#region src/Toast/toast.tsx
|
|
5
5
|
const showToast = (message, variant, options) => {
|
|
6
6
|
const { onClose, closable, title, endContent, icon, render, ...rest } = options ?? {};
|
|
7
7
|
const sonnerOptions = {
|
|
@@ -86,4 +86,4 @@ const toast$1 = {
|
|
|
86
86
|
//#endregion
|
|
87
87
|
export { toast$1 as default };
|
|
88
88
|
|
|
89
|
-
//# sourceMappingURL=
|
|
89
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"toast.js","names":["sonnerToast","AlertComponent","toast"],"sources":["../../src/Toast/toast.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport type { ExternalToast } from 'sonner';\nimport type { AlertProps } from '../Alert';\n\nimport { toast as sonnerToast } from 'sonner';\n\nimport AlertComponent from '../Alert';\n\ntype AlertVariant = NonNullable<AlertProps['variant']>;\n\n/** Props passed to a custom render function */\nexport interface ToastRenderProps {\n /** The toast message */\n message: ReactNode;\n /** The color/severity of the toast */\n variant: AlertVariant;\n /** Function to close the toast */\n close: () => void;\n /** Whether the toast can be closed by the user */\n closable?: boolean;\n /** Title displayed above the toast message */\n title?: ReactNode;\n /** Content displayed at the end of the toast */\n endContent?: ReactNode;\n /** Icon displayed at the start of the toast */\n icon?: ReactNode;\n}\n\n/** Options passed to each toast method */\nexport interface ToastOptions {\n /** Title displayed above the toast message */\n title?: ReactNode;\n /** Whether the toast can be closed by the user */\n closable?: boolean;\n /** Duration in milliseconds before the toast auto-closes */\n duration?: number;\n /** Position of the toast on the screen */\n position?: ExternalToast['position'];\n /** Callback fired when the toast auto-closes */\n onAutoClose?: ExternalToast['onAutoClose'];\n /** Callback fired when the toast is closed */\n onClose?: ExternalToast['onDismiss'];\n /** Content displayed at the end of the toast */\n endContent?: ReactNode;\n /** Icon displayed at the start of the toast */\n icon?: ReactNode;\n /** Custom render function to override the default AlertComponent */\n render?: (props: ToastRenderProps) => ReactElement;\n}\n\nconst showToast = (\n message: ReactNode,\n variant: AlertVariant,\n options?: ToastOptions,\n) => {\n // Map custom ToastOptions to Sonner's ExternalToast format:\n // - onClose is mapped to Sonner's onDismiss\n // - closable is handled separately (not a Sonner option)\n // - position defaults to 'top-center'\n const { onClose, closable, title, endContent, icon, render, ...rest } =\n options ?? {};\n const sonnerOptions: ExternalToast = {\n position: 'top-center' as const,\n onDismiss: onClose,\n ...rest,\n };\n return sonnerToast.custom((id) => {\n // Close function passed to custom render or AlertComponent\n const close = () => {\n return sonnerToast.dismiss(id);\n };\n\n // Allow custom rendering via render prop\n if (render) {\n return render({\n message,\n variant,\n close,\n closable,\n title,\n endContent,\n icon,\n });\n }\n\n // Default: render AlertComponent\n return (\n <AlertComponent\n closable={closable}\n endContent={endContent}\n icon={icon}\n onClose={closable ? close : undefined}\n title={title}\n variant={variant}\n >\n {message}\n </AlertComponent>\n );\n }, sonnerOptions);\n};\n\n/** Toast object with convenience methods for different severity levels */\nconst toast = {\n /**\n * Show a default toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n default: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'default', options);\n },\n /**\n * Show an info toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n info: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'info', options);\n },\n /**\n * Show a warning toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n warn: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'warning', {\n duration: 60000,\n closable: true,\n ...options,\n });\n },\n /**\n * Show a success toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n success: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'success', options);\n },\n /**\n * Show an error toast.\n * @returns The toast id which can be passed to `toast.close()`\n */\n error: (message: ReactNode, options?: ToastOptions) => {\n return showToast(message, 'danger', {\n duration: 60000,\n closable: true,\n ...options,\n });\n },\n /** Close a toast by its id */\n close: (toastId: string | number) => {\n sonnerToast.dismiss(toastId);\n },\n};\n\nexport default toast;\n"],"mappings":";;;;AAkDA,MAAM,aACJ,SACA,SACA,YACG;CAKH,MAAM,EAAE,SAAS,UAAU,OAAO,YAAY,MAAM,QAAQ,GAAG,SAC7D,WAAW,CAAC;CACd,MAAM,gBAA+B;EACnC,UAAU;EACV,WAAW;EACX,GAAG;CACL;CACA,OAAOA,MAAY,QAAQ,OAAO;EAEhC,MAAM,cAAc;GAClB,OAAOA,MAAY,QAAQ,EAAE;EAC/B;EAGA,IAAI,QACF,OAAO,OAAO;GACZ;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EAIH,OACE,oBAACC,eAAD;GACY;GACE;GACN;GACN,SAAS,WAAW,QAAQ,KAAA;GACrB;GACE;aAER;EACa,CAAA;CAEpB,GAAG,aAAa;AAClB;;AAGA,MAAMC,UAAQ;;;;;CAKZ,UAAU,SAAoB,YAA2B;EACvD,OAAO,UAAU,SAAS,WAAW,OAAO;CAC9C;;;;;CAKA,OAAO,SAAoB,YAA2B;EACpD,OAAO,UAAU,SAAS,QAAQ,OAAO;CAC3C;;;;;CAKA,OAAO,SAAoB,YAA2B;EACpD,OAAO,UAAU,SAAS,WAAW;GACnC,UAAU;GACV,UAAU;GACV,GAAG;EACL,CAAC;CACH;;;;;CAKA,UAAU,SAAoB,YAA2B;EACvD,OAAO,UAAU,SAAS,WAAW,OAAO;CAC9C;;;;;CAKA,QAAQ,SAAoB,YAA2B;EACrD,OAAO,UAAU,SAAS,UAAU;GAClC,UAAU;GACV,UAAU;GACV,GAAG;EACL,CAAC;CACH;;CAEA,QAAQ,YAA6B;EACnC,MAAY,QAAQ,OAAO;CAC7B;AACF"}
|