@samline/notify 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +121 -150
- package/dist/browser-notify.js +69 -0
- package/dist/cc-2Yt7NqMX.mjs +21 -0
- package/dist/cc-B6peeNak.mjs +33 -0
- package/dist/cc-BWuAzFJ6.js +12 -0
- package/dist/cc-CaBHsjUt.js +34 -0
- package/dist/cc-DGff5sSY.js +21 -0
- package/dist/cc-he3fHS3P.mjs +12 -0
- package/dist/notify.d.mts +44 -0
- package/dist/notify.d.mts.map +1 -0
- package/dist/notify.d.ts +44 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +90 -0
- package/dist/notify.mjs +87 -0
- package/dist/react-notify-12s-7LOZlSBi.js +1068 -0
- package/dist/react-notify-12s-BjWbwTu8.mjs +1066 -0
- package/dist/react.d.mts +66 -0
- package/dist/react.d.mts.map +1 -0
- package/dist/react.d.ts +66 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +18 -0
- package/dist/react.mjs +10 -0
- package/dist/styles.css +477 -63
- package/dist/svelte.d.mts +45 -0
- package/dist/svelte.d.mts.map +1 -0
- package/dist/svelte.d.ts +45 -0
- package/dist/svelte.d.ts.map +1 -0
- package/dist/svelte.js +168 -0
- package/dist/svelte.mjs +165 -0
- package/dist/vue.d.mts +103 -0
- package/dist/vue.d.mts.map +1 -0
- package/dist/vue.d.ts +103 -0
- package/dist/vue.d.ts.map +1 -0
- package/dist/vue.js +2099 -0
- package/dist/vue.mjs +2096 -0
- package/package.json +95 -57
- package/dist/index.cjs.js +0 -1171
- package/dist/index.esm.js +0 -1164
- package/dist/notify.umd.js +0 -1177
- package/docs/browser.md +0 -99
- package/docs/react.md +0 -275
- package/docs/svelte.md +0 -267
- package/docs/vanilla.md +0 -256
- package/docs/vue.md +0 -301
- package/rollup.config.mjs +0 -56
- package/samline-notify-0.1.9.tgz +0 -0
package/dist/react.d.mts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type NotifyState = "success" | "loading" | "error" | "warning" | "info" | "action";
|
|
5
|
+
interface NotifyStyles {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
badge?: string;
|
|
9
|
+
button?: string;
|
|
10
|
+
}
|
|
11
|
+
interface NotifyButton {
|
|
12
|
+
title: string;
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare const NOTIFY_POSITIONS: readonly ["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"];
|
|
16
|
+
type NotifyPosition = (typeof NOTIFY_POSITIONS)[number];
|
|
17
|
+
interface NotifyOptions {
|
|
18
|
+
title?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
type?: NotifyState;
|
|
21
|
+
position?: NotifyPosition;
|
|
22
|
+
duration?: number | null;
|
|
23
|
+
icon?: any;
|
|
24
|
+
styles?: NotifyStyles;
|
|
25
|
+
fill?: string;
|
|
26
|
+
roundness?: number;
|
|
27
|
+
autopilot?: boolean | {
|
|
28
|
+
expand?: number;
|
|
29
|
+
collapse?: number;
|
|
30
|
+
};
|
|
31
|
+
button?: NotifyButton;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type NotifyOffsetValue = number | string;
|
|
35
|
+
type NotifyOffsetConfig = Partial<Record<"top" | "right" | "bottom" | "left", NotifyOffsetValue>>;
|
|
36
|
+
interface NotifyToasterProps {
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
position?: NotifyPosition;
|
|
39
|
+
offset?: NotifyOffsetValue | NotifyOffsetConfig;
|
|
40
|
+
options?: Partial<NotifyOptions>;
|
|
41
|
+
theme?: "light" | "dark" | "system";
|
|
42
|
+
}
|
|
43
|
+
interface NotifyPromiseOptions<T = unknown> {
|
|
44
|
+
loading: NotifyOptions;
|
|
45
|
+
success: NotifyOptions | ((data: T) => NotifyOptions);
|
|
46
|
+
error: NotifyOptions | ((err: unknown) => NotifyOptions);
|
|
47
|
+
action?: NotifyOptions | ((data: T) => NotifyOptions);
|
|
48
|
+
position?: NotifyPosition;
|
|
49
|
+
}
|
|
50
|
+
declare const notify: {
|
|
51
|
+
show: (opts: NotifyOptions) => string;
|
|
52
|
+
success: (opts: NotifyOptions) => string;
|
|
53
|
+
error: (opts: NotifyOptions) => string;
|
|
54
|
+
warning: (opts: NotifyOptions) => string;
|
|
55
|
+
info: (opts: NotifyOptions) => string;
|
|
56
|
+
action: (opts: NotifyOptions) => string;
|
|
57
|
+
promise: <T>(promise: Promise<T> | (() => Promise<T>), opts: NotifyPromiseOptions<T>) => Promise<T>;
|
|
58
|
+
dismiss: (id: string) => void;
|
|
59
|
+
clear: (position?: NotifyPosition) => void;
|
|
60
|
+
};
|
|
61
|
+
declare function showNotifyToast(options: NotifyOptions): string;
|
|
62
|
+
declare function Toaster({ children, position, offset, options, theme, }: NotifyToasterProps): react_jsx_runtime.JSX.Element;
|
|
63
|
+
|
|
64
|
+
export { Toaster, notify, showNotifyToast };
|
|
65
|
+
export type { NotifyButton, NotifyOptions, NotifyPosition, NotifyState, NotifyStyles };
|
|
66
|
+
//# sourceMappingURL=react.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.mts","sources":["../src/types.ts","../src/toast.tsx"],"mappings":";;;AAAA,KAAK,WAAW;AAChB,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA,cAAc,gBAAgB;AAC9B,KAAK,cAAc,WAAW,gBAAgB;AAC9C,UAAU,aAAa;AACvB;AACA;AACA,WAAW,WAAW;AACtB,eAAe,cAAc;AAC7B;AACA;AACA,aAAa,YAAY;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,YAAY;AACzB;;ACzBA,KAAK,iBAAiB;AACtB,KAAK,kBAAkB,GAAG,OAAO,CAAC,MAAM,sCAAsC,iBAAiB;AAC/F,UAAU,kBAAkB;AAC5B,eAAe,SAAS;AACxB,eAAe,cAAc;AAC7B,aAAa,iBAAiB,GAAG,kBAAkB;AACnD,cAAc,OAAO,CAAC,aAAa;AACnC;AACA;AACA,UAAU,oBAAoB;AAC9B,aAAa,aAAa;AAC1B,aAAa,aAAa,iBAAiB,aAAa;AACxD,WAAW,aAAa,sBAAsB,aAAa;AAC3D,aAAa,aAAa,iBAAiB,aAAa;AACxD,eAAe,cAAc;AAC7B;AACA,cAAc,MAAM;AACpB,iBAAiB,aAAa;AAC9B,oBAAoB,aAAa;AACjC,kBAAkB,aAAa;AAC/B,oBAAoB,aAAa;AACjC,iBAAiB,aAAa;AAC9B,mBAAmB,aAAa;AAChC,0BAA0B,OAAO,aAAa,OAAO,YAAY,oBAAoB,QAAQ,OAAO;AACpG;AACA,uBAAuB,cAAc;AACrC;AACA,iBAAiB,eAAe,UAAU,aAAa;AACvD,iBAAiB,OAAO,kDAAkD,kBAAkB,GAAG,iBAAiB,CAAC,GAAG,CAAC,OAAO;;;;","names":[]}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type NotifyState = "success" | "loading" | "error" | "warning" | "info" | "action";
|
|
5
|
+
interface NotifyStyles {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
badge?: string;
|
|
9
|
+
button?: string;
|
|
10
|
+
}
|
|
11
|
+
interface NotifyButton {
|
|
12
|
+
title: string;
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare const NOTIFY_POSITIONS: readonly ["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"];
|
|
16
|
+
type NotifyPosition = (typeof NOTIFY_POSITIONS)[number];
|
|
17
|
+
interface NotifyOptions {
|
|
18
|
+
title?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
type?: NotifyState;
|
|
21
|
+
position?: NotifyPosition;
|
|
22
|
+
duration?: number | null;
|
|
23
|
+
icon?: any;
|
|
24
|
+
styles?: NotifyStyles;
|
|
25
|
+
fill?: string;
|
|
26
|
+
roundness?: number;
|
|
27
|
+
autopilot?: boolean | {
|
|
28
|
+
expand?: number;
|
|
29
|
+
collapse?: number;
|
|
30
|
+
};
|
|
31
|
+
button?: NotifyButton;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type NotifyOffsetValue = number | string;
|
|
35
|
+
type NotifyOffsetConfig = Partial<Record<"top" | "right" | "bottom" | "left", NotifyOffsetValue>>;
|
|
36
|
+
interface NotifyToasterProps {
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
position?: NotifyPosition;
|
|
39
|
+
offset?: NotifyOffsetValue | NotifyOffsetConfig;
|
|
40
|
+
options?: Partial<NotifyOptions>;
|
|
41
|
+
theme?: "light" | "dark" | "system";
|
|
42
|
+
}
|
|
43
|
+
interface NotifyPromiseOptions<T = unknown> {
|
|
44
|
+
loading: NotifyOptions;
|
|
45
|
+
success: NotifyOptions | ((data: T) => NotifyOptions);
|
|
46
|
+
error: NotifyOptions | ((err: unknown) => NotifyOptions);
|
|
47
|
+
action?: NotifyOptions | ((data: T) => NotifyOptions);
|
|
48
|
+
position?: NotifyPosition;
|
|
49
|
+
}
|
|
50
|
+
declare const notify: {
|
|
51
|
+
show: (opts: NotifyOptions) => string;
|
|
52
|
+
success: (opts: NotifyOptions) => string;
|
|
53
|
+
error: (opts: NotifyOptions) => string;
|
|
54
|
+
warning: (opts: NotifyOptions) => string;
|
|
55
|
+
info: (opts: NotifyOptions) => string;
|
|
56
|
+
action: (opts: NotifyOptions) => string;
|
|
57
|
+
promise: <T>(promise: Promise<T> | (() => Promise<T>), opts: NotifyPromiseOptions<T>) => Promise<T>;
|
|
58
|
+
dismiss: (id: string) => void;
|
|
59
|
+
clear: (position?: NotifyPosition) => void;
|
|
60
|
+
};
|
|
61
|
+
declare function showNotifyToast(options: NotifyOptions): string;
|
|
62
|
+
declare function Toaster({ children, position, offset, options, theme, }: NotifyToasterProps): react_jsx_runtime.JSX.Element;
|
|
63
|
+
|
|
64
|
+
export { Toaster, notify, showNotifyToast };
|
|
65
|
+
export type { NotifyButton, NotifyOptions, NotifyPosition, NotifyState, NotifyStyles };
|
|
66
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sources":["../src/types.ts","../src/toast.tsx"],"mappings":";;;AAAA,KAAK,WAAW;AAChB,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA,cAAc,gBAAgB;AAC9B,KAAK,cAAc,WAAW,gBAAgB;AAC9C,UAAU,aAAa;AACvB;AACA;AACA,WAAW,WAAW;AACtB,eAAe,cAAc;AAC7B;AACA;AACA,aAAa,YAAY;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,YAAY;AACzB;;ACzBA,KAAK,iBAAiB;AACtB,KAAK,kBAAkB,GAAG,OAAO,CAAC,MAAM,sCAAsC,iBAAiB;AAC/F,UAAU,kBAAkB;AAC5B,eAAe,SAAS;AACxB,eAAe,cAAc;AAC7B,aAAa,iBAAiB,GAAG,kBAAkB;AACnD,cAAc,OAAO,CAAC,aAAa;AACnC;AACA;AACA,UAAU,oBAAoB;AAC9B,aAAa,aAAa;AAC1B,aAAa,aAAa,iBAAiB,aAAa;AACxD,WAAW,aAAa,sBAAsB,aAAa;AAC3D,aAAa,aAAa,iBAAiB,aAAa;AACxD,eAAe,cAAc;AAC7B;AACA,cAAc,MAAM;AACpB,iBAAiB,aAAa;AAC9B,oBAAoB,aAAa;AACjC,kBAAkB,aAAa;AAC/B,oBAAoB,aAAa;AACjC,iBAAiB,aAAa;AAC9B,mBAAmB,aAAa;AAChC,0BAA0B,OAAO,aAAa,OAAO,YAAY,oBAAoB,QAAQ,OAAO;AACpG;AACA,uBAAuB,cAAc;AACrC;AACA,iBAAiB,eAAe,UAAU,aAAa;AACvD,iBAAiB,OAAO,kDAAkD,kBAAkB,GAAG,iBAAiB,CAAC,GAAG,CAAC,OAAO;;;;","names":[]}
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function __insertCSS(code) {
|
|
2
|
+
if (!code || typeof document == 'undefined') return
|
|
3
|
+
let head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
let style = document.createElement('style')
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
head.appendChild(style)
|
|
7
|
+
;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var reactNotify12s = require('./react-notify-12s-7LOZlSBi.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.Toaster = reactNotify12s.Toaster;
|
|
17
|
+
exports.notify = reactNotify12s.notify;
|
|
18
|
+
exports.showNotifyToast = reactNotify12s.showNotifyToast;
|
package/dist/react.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function __insertCSS(code) {
|
|
2
|
+
if (!code || typeof document == 'undefined') return
|
|
3
|
+
let head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
let style = document.createElement('style')
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
head.appendChild(style)
|
|
7
|
+
;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { T as Toaster, n as notify, s as showNotifyToast } from './react-notify-12s-BjWbwTu8.mjs';
|