@temboplus/frontend-react-core 0.1.3-beta.5 → 0.1.3-beta.7
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/features/notifications/tembo-notify.d.ts +26 -33
- package/dist/features/notifications/tembo-notify.js +84 -57
- package/dist/features/notifications/toast-config.d.ts +1 -1
- package/dist/features/notifications/toast-config.js +20 -18
- package/dist/features/notifications/toast-container.d.ts +1 -1
- package/dist/features/notifications/toast-container.js +33 -36
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/notifications/index.cjs.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/tembo-notify-BAawbRy0.js +2 -0
- package/dist/tembo-notify-BAawbRy0.js.map +1 -0
- package/dist/tembo-notify-BDtExWQg.js +2 -0
- package/dist/tembo-notify-BDtExWQg.js.map +1 -0
- package/package.json +1 -1
- package/dist/tembo-notify-CXNzYLPU.js +0 -2
- package/dist/tembo-notify-CXNzYLPU.js.map +0 -1
- package/dist/tembo-notify-oZJrH2OE.js +0 -2
- package/dist/tembo-notify-oZJrH2OE.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ToastOptions, ToastContent, Id } from 'react-toastify';
|
|
1
|
+
import { ToastOptions, ToastContent, Id, ToastIcon } from 'react-toastify';
|
|
2
2
|
import { TemboColorPalette, TemboUIConstants } from '../../theme/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Message input - can be simple string or object with title and description
|
|
4
|
+
* Message input - can be simple string or object with title and/or description
|
|
5
5
|
*/
|
|
6
6
|
export type NotifyMessage = ToastContent | {
|
|
7
|
-
title
|
|
7
|
+
title?: string;
|
|
8
8
|
description?: string;
|
|
9
9
|
};
|
|
10
|
-
export interface NotifyOptions extends Omit<ToastOptions, 'type'> {
|
|
10
|
+
export interface NotifyOptions extends Omit<ToastOptions, 'type' | 'icon'> {
|
|
11
11
|
/**
|
|
12
12
|
* Unique ID for the toast to prevent duplicates
|
|
13
13
|
* If a toast with this ID exists, it will be updated instead of creating a new one
|
|
@@ -27,45 +27,29 @@ export interface NotifyOptions extends Omit<ToastOptions, 'type'> {
|
|
|
27
27
|
* Callback when notification is closed
|
|
28
28
|
*/
|
|
29
29
|
onClose?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Custom icon to display
|
|
32
|
+
* If provided, will override the default icon
|
|
33
|
+
*/
|
|
34
|
+
icon?: ToastIcon;
|
|
35
|
+
/**
|
|
36
|
+
* Show close button
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
showCloseButton?: boolean;
|
|
30
40
|
}
|
|
31
41
|
/**
|
|
32
42
|
* TemboNotify - Unified notification system
|
|
33
|
-
*
|
|
34
|
-
* Professional, clean notifications inspired by Supabase design system.
|
|
35
|
-
* Wraps react-toastify with consistent styling and behavior.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```typescript
|
|
39
|
-
* // Simple message
|
|
40
|
-
* TemboNotify.success('Payment sent successfully!');
|
|
41
|
-
*
|
|
42
|
-
* // With title and description
|
|
43
|
-
* TemboNotify.error({
|
|
44
|
-
* title: 'Payment Failed',
|
|
45
|
-
* description: 'Insufficient funds in your account'
|
|
46
|
-
* });
|
|
47
|
-
*
|
|
48
|
-
* // With toastId to prevent duplicates
|
|
49
|
-
* TemboNotify.warning('Session expiring soon', {
|
|
50
|
-
* toastId: 'session-warning',
|
|
51
|
-
* duration: 10000
|
|
52
|
-
* });
|
|
53
|
-
*
|
|
54
|
-
* // Update existing toast
|
|
55
|
-
* const id = TemboNotify.loading('Processing...');
|
|
56
|
-
* await processPayment();
|
|
57
|
-
* TemboNotify.update(id, { type: 'success', message: 'Done!' });
|
|
58
|
-
* ```
|
|
59
43
|
*/
|
|
60
44
|
export declare class TemboNotify {
|
|
61
45
|
private static configs;
|
|
62
46
|
/**
|
|
63
47
|
* Initialize TemboNotify with theme tokens
|
|
64
|
-
*
|
|
48
|
+
* (Called automatically by TemboToastContainer)
|
|
65
49
|
*/
|
|
66
50
|
static init(colors: TemboColorPalette, constants: TemboUIConstants): void;
|
|
67
51
|
/**
|
|
68
|
-
* Get current toast configs
|
|
52
|
+
* Get current toast configs if present, otherwise undefined.
|
|
69
53
|
*/
|
|
70
54
|
private static getConfigs;
|
|
71
55
|
/**
|
|
@@ -73,9 +57,17 @@ export declare class TemboNotify {
|
|
|
73
57
|
*/
|
|
74
58
|
private static formatMessage;
|
|
75
59
|
/**
|
|
76
|
-
* Build toast options from config and user options
|
|
60
|
+
* Build toast options from config and user options.
|
|
77
61
|
*/
|
|
78
62
|
private static buildOptions;
|
|
63
|
+
/**
|
|
64
|
+
* Helpers to get per-type base config with fallback
|
|
65
|
+
*/
|
|
66
|
+
private static getSuccessConfig;
|
|
67
|
+
private static getErrorConfig;
|
|
68
|
+
private static getWarningConfig;
|
|
69
|
+
private static getInfoConfig;
|
|
70
|
+
private static getLoadingConfig;
|
|
79
71
|
/**
|
|
80
72
|
* Display a success notification
|
|
81
73
|
*/
|
|
@@ -105,6 +97,7 @@ export declare class TemboNotify {
|
|
|
105
97
|
message?: NotifyMessage;
|
|
106
98
|
autoClose?: number | false;
|
|
107
99
|
render?: ToastContent;
|
|
100
|
+
icon?: ToastIcon;
|
|
108
101
|
}): void;
|
|
109
102
|
/**
|
|
110
103
|
* Dismiss a specific notification by ID
|
|
@@ -1,104 +1,128 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// tembo-notify.tsx
|
|
3
4
|
import { toast } from 'react-toastify';
|
|
4
5
|
import { buildToastConfigs } from './toast-config.js';
|
|
6
|
+
/**
|
|
7
|
+
* Simple base fallback config when TemboNotify.init hasn't been called yet.
|
|
8
|
+
* This keeps notifications working even before theme initialization.
|
|
9
|
+
*/
|
|
10
|
+
const FALLBACK_BASE_CONFIG = {
|
|
11
|
+
position: 'top-right',
|
|
12
|
+
autoClose: 4000,
|
|
13
|
+
hideProgressBar: true,
|
|
14
|
+
closeOnClick: true,
|
|
15
|
+
pauseOnHover: true,
|
|
16
|
+
draggable: true,
|
|
17
|
+
closeButton: false,
|
|
18
|
+
};
|
|
5
19
|
/**
|
|
6
20
|
* TemboNotify - Unified notification system
|
|
7
|
-
*
|
|
8
|
-
* Professional, clean notifications inspired by Supabase design system.
|
|
9
|
-
* Wraps react-toastify with consistent styling and behavior.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* // Simple message
|
|
14
|
-
* TemboNotify.success('Payment sent successfully!');
|
|
15
|
-
*
|
|
16
|
-
* // With title and description
|
|
17
|
-
* TemboNotify.error({
|
|
18
|
-
* title: 'Payment Failed',
|
|
19
|
-
* description: 'Insufficient funds in your account'
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
* // With toastId to prevent duplicates
|
|
23
|
-
* TemboNotify.warning('Session expiring soon', {
|
|
24
|
-
* toastId: 'session-warning',
|
|
25
|
-
* duration: 10000
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* // Update existing toast
|
|
29
|
-
* const id = TemboNotify.loading('Processing...');
|
|
30
|
-
* await processPayment();
|
|
31
|
-
* TemboNotify.update(id, { type: 'success', message: 'Done!' });
|
|
32
|
-
* ```
|
|
33
21
|
*/
|
|
34
22
|
export class TemboNotify {
|
|
35
23
|
/**
|
|
36
24
|
* Initialize TemboNotify with theme tokens
|
|
37
|
-
*
|
|
25
|
+
* (Called automatically by TemboToastContainer)
|
|
38
26
|
*/
|
|
39
27
|
static init(colors, constants) {
|
|
40
28
|
this.configs = buildToastConfigs(colors, constants);
|
|
41
29
|
}
|
|
42
30
|
/**
|
|
43
|
-
* Get current toast configs
|
|
31
|
+
* Get current toast configs if present, otherwise undefined.
|
|
44
32
|
*/
|
|
45
33
|
static getConfigs() {
|
|
46
|
-
if (!this.configs) {
|
|
47
|
-
throw new Error('TemboNotify not initialized. Call TemboNotify.init(colors, constants) before using notifications.');
|
|
48
|
-
}
|
|
49
34
|
return this.configs;
|
|
50
35
|
}
|
|
51
36
|
/**
|
|
52
37
|
* Format message content for display
|
|
53
38
|
*/
|
|
54
39
|
static formatMessage(message) {
|
|
55
|
-
if (message && typeof message === 'object' && 'title' in message) {
|
|
56
|
-
|
|
40
|
+
if (message && typeof message === 'object' && ('title' in message || 'description' in message)) {
|
|
41
|
+
const { title, description } = message;
|
|
42
|
+
// Description only - use font-weight 500
|
|
43
|
+
if (!title && description) {
|
|
44
|
+
return (_jsx("div", { style: { fontWeight: 500, fontSize: 14, lineHeight: 1.5 }, children: description }));
|
|
45
|
+
}
|
|
46
|
+
// Title only - use bold
|
|
47
|
+
if (title && !description) {
|
|
48
|
+
return (_jsx("div", { style: { fontWeight: 600, fontSize: 14, lineHeight: 1.5 }, children: title }));
|
|
49
|
+
}
|
|
50
|
+
// Both title and description
|
|
51
|
+
if (title && description) {
|
|
52
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 4 }, children: [_jsx("div", { style: { fontWeight: 600, fontSize: 14, lineHeight: 1.5 }, children: title }), _jsx("div", { style: { fontSize: 13, lineHeight: 1.5, opacity: 0.85 }, children: description })] }));
|
|
53
|
+
}
|
|
57
54
|
}
|
|
58
55
|
return message;
|
|
59
56
|
}
|
|
60
57
|
/**
|
|
61
|
-
* Build toast options from config and user options
|
|
58
|
+
* Build toast options from config and user options.
|
|
62
59
|
*/
|
|
63
60
|
static buildOptions(baseConfig, options) {
|
|
64
|
-
const _a = options || {}, { duration, toastId, onClick, onClose } = _a, restOptions = __rest(_a, ["duration", "toastId", "onClick", "onClose"]);
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
const _a = options || {}, { duration, toastId, onClick, onClose, icon, showCloseButton = false } = _a, restOptions = __rest(_a, ["duration", "toastId", "onClick", "onClose", "icon", "showCloseButton"]);
|
|
62
|
+
const effectiveBase = baseConfig !== null && baseConfig !== void 0 ? baseConfig : FALLBACK_BASE_CONFIG;
|
|
63
|
+
return Object.assign(Object.assign(Object.assign({}, effectiveBase), restOptions), { toastId, autoClose: duration !== undefined
|
|
64
|
+
? duration || false
|
|
65
|
+
: effectiveBase.autoClose, onClick,
|
|
66
|
+
onClose, icon: icon !== undefined ? icon : effectiveBase.icon, closeButton: showCloseButton });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Helpers to get per-type base config with fallback
|
|
70
|
+
*/
|
|
71
|
+
static getSuccessConfig() {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
const configs = this.getConfigs();
|
|
74
|
+
return (_b = (_a = configs === null || configs === void 0 ? void 0 : configs.successConfig) !== null && _a !== void 0 ? _a : configs === null || configs === void 0 ? void 0 : configs.baseConfig) !== null && _b !== void 0 ? _b : undefined;
|
|
75
|
+
}
|
|
76
|
+
static getErrorConfig() {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
const configs = this.getConfigs();
|
|
79
|
+
return (_b = (_a = configs === null || configs === void 0 ? void 0 : configs.errorConfig) !== null && _a !== void 0 ? _a : configs === null || configs === void 0 ? void 0 : configs.baseConfig) !== null && _b !== void 0 ? _b : undefined;
|
|
80
|
+
}
|
|
81
|
+
static getWarningConfig() {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
const configs = this.getConfigs();
|
|
84
|
+
return (_b = (_a = configs === null || configs === void 0 ? void 0 : configs.warningConfig) !== null && _a !== void 0 ? _a : configs === null || configs === void 0 ? void 0 : configs.baseConfig) !== null && _b !== void 0 ? _b : undefined;
|
|
85
|
+
}
|
|
86
|
+
static getInfoConfig() {
|
|
87
|
+
var _a, _b;
|
|
88
|
+
const configs = this.getConfigs();
|
|
89
|
+
return (_b = (_a = configs === null || configs === void 0 ? void 0 : configs.infoConfig) !== null && _a !== void 0 ? _a : configs === null || configs === void 0 ? void 0 : configs.baseConfig) !== null && _b !== void 0 ? _b : undefined;
|
|
90
|
+
}
|
|
91
|
+
static getLoadingConfig() {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
const configs = this.getConfigs();
|
|
94
|
+
return (_b = (_a = configs === null || configs === void 0 ? void 0 : configs.loadingConfig) !== null && _a !== void 0 ? _a : configs === null || configs === void 0 ? void 0 : configs.baseConfig) !== null && _b !== void 0 ? _b : undefined;
|
|
67
95
|
}
|
|
68
96
|
/**
|
|
69
97
|
* Display a success notification
|
|
70
98
|
*/
|
|
71
99
|
static success(message, options) {
|
|
72
|
-
const configs = this.getConfigs();
|
|
73
100
|
const content = this.formatMessage(message);
|
|
74
|
-
const toastOptions = this.buildOptions(
|
|
101
|
+
const toastOptions = this.buildOptions(this.getSuccessConfig(), options);
|
|
75
102
|
return toast.success(content, toastOptions);
|
|
76
103
|
}
|
|
77
104
|
/**
|
|
78
105
|
* Display an error notification
|
|
79
106
|
*/
|
|
80
107
|
static error(message, options) {
|
|
81
|
-
const configs = this.getConfigs();
|
|
82
108
|
const content = this.formatMessage(message);
|
|
83
|
-
const toastOptions = this.buildOptions(
|
|
109
|
+
const toastOptions = this.buildOptions(this.getErrorConfig(), options);
|
|
84
110
|
return toast.error(content, toastOptions);
|
|
85
111
|
}
|
|
86
112
|
/**
|
|
87
113
|
* Display a warning notification
|
|
88
114
|
*/
|
|
89
115
|
static warning(message, options) {
|
|
90
|
-
const configs = this.getConfigs();
|
|
91
116
|
const content = this.formatMessage(message);
|
|
92
|
-
const toastOptions = this.buildOptions(
|
|
117
|
+
const toastOptions = this.buildOptions(this.getWarningConfig(), options);
|
|
93
118
|
return toast.warning(content, toastOptions);
|
|
94
119
|
}
|
|
95
120
|
/**
|
|
96
121
|
* Display an info notification
|
|
97
122
|
*/
|
|
98
123
|
static info(message, options) {
|
|
99
|
-
const configs = this.getConfigs();
|
|
100
124
|
const content = this.formatMessage(message);
|
|
101
|
-
const toastOptions = this.buildOptions(
|
|
125
|
+
const toastOptions = this.buildOptions(this.getInfoConfig(), options);
|
|
102
126
|
return toast.info(content, toastOptions);
|
|
103
127
|
}
|
|
104
128
|
/**
|
|
@@ -106,29 +130,32 @@ export class TemboNotify {
|
|
|
106
130
|
* Returns an ID that can be used to update/dismiss it
|
|
107
131
|
*/
|
|
108
132
|
static loading(message, options) {
|
|
109
|
-
|
|
133
|
+
var _a;
|
|
110
134
|
const content = this.formatMessage(message);
|
|
111
|
-
const
|
|
112
|
-
|
|
135
|
+
const _b = options || {}, { toastId, onClick, onClose, icon, showCloseButton = false } = _b, restOptions = __rest(_b, ["toastId", "onClick", "onClose", "icon", "showCloseButton"]);
|
|
136
|
+
const baseConfig = (_a = this.getLoadingConfig()) !== null && _a !== void 0 ? _a : FALLBACK_BASE_CONFIG;
|
|
137
|
+
return toast.loading(content, Object.assign(Object.assign(Object.assign({}, baseConfig), restOptions), { toastId,
|
|
113
138
|
onClick,
|
|
114
|
-
onClose }));
|
|
139
|
+
onClose, icon: icon !== undefined ? icon : baseConfig.icon, closeButton: showCloseButton }));
|
|
115
140
|
}
|
|
116
141
|
/**
|
|
117
142
|
* Update an existing notification
|
|
118
143
|
*/
|
|
119
144
|
static update(id, options) {
|
|
120
|
-
var _a;
|
|
145
|
+
var _a, _b;
|
|
121
146
|
const configs = this.getConfigs();
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
147
|
+
const typeConfig = options.type && configs
|
|
148
|
+
? {
|
|
149
|
+
success: configs.successConfig,
|
|
150
|
+
error: configs.errorConfig,
|
|
151
|
+
warning: configs.warningConfig,
|
|
152
|
+
info: configs.infoConfig,
|
|
153
|
+
}[options.type]
|
|
154
|
+
: undefined;
|
|
128
155
|
const content = options.message
|
|
129
156
|
? this.formatMessage(options.message)
|
|
130
157
|
: options.render;
|
|
131
|
-
toast.update(id, Object.assign({ render: content, type: options.type, isLoading: false, autoClose: (_a = options.autoClose) !== null && _a !== void 0 ? _a :
|
|
158
|
+
toast.update(id, Object.assign({ render: content, type: options.type, isLoading: false, autoClose: (_b = (_a = options.autoClose) !== null && _a !== void 0 ? _a : typeConfig === null || typeConfig === void 0 ? void 0 : typeConfig.autoClose) !== null && _b !== void 0 ? _b : FALLBACK_BASE_CONFIG.autoClose, icon: options.icon !== undefined ? options.icon : typeConfig === null || typeConfig === void 0 ? void 0 : typeConfig.icon }, (typeConfig !== null && typeConfig !== void 0 ? typeConfig : {})));
|
|
132
159
|
}
|
|
133
160
|
/**
|
|
134
161
|
* Dismiss a specific notification by ID
|
|
@@ -2,7 +2,7 @@ import { ToastOptions } from 'react-toastify';
|
|
|
2
2
|
import { TemboColorPalette, TemboUIConstants } from '../../theme/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Build toast configurations from theme tokens
|
|
5
|
-
* Professional,
|
|
5
|
+
* Professional, minimal design for fintech platform
|
|
6
6
|
*/
|
|
7
7
|
export declare const buildToastConfigs: (colors: TemboColorPalette, constants: TemboUIConstants) => {
|
|
8
8
|
loadingConfig: ToastOptions<unknown>;
|
|
@@ -2,49 +2,51 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { CheckCircleOutlined, CloseCircleOutlined, ExclamationCircleOutlined, InfoCircleOutlined, LoadingOutlined, } from '@ant-design/icons';
|
|
3
3
|
/**
|
|
4
4
|
* Build toast configurations from theme tokens
|
|
5
|
-
* Professional,
|
|
5
|
+
* Professional, minimal design for fintech platform
|
|
6
6
|
*/
|
|
7
7
|
export const buildToastConfigs = (colors, constants) => {
|
|
8
8
|
/**
|
|
9
|
-
* Common toast configuration -
|
|
9
|
+
* Common toast configuration - Clean, minimal design
|
|
10
10
|
*/
|
|
11
11
|
const baseConfig = {
|
|
12
12
|
position: 'top-right',
|
|
13
13
|
autoClose: 4000,
|
|
14
|
-
hideProgressBar:
|
|
14
|
+
hideProgressBar: true, // No progress bar
|
|
15
15
|
closeOnClick: true,
|
|
16
16
|
pauseOnHover: true,
|
|
17
17
|
draggable: true,
|
|
18
|
+
closeButton: false, // No close button by default
|
|
18
19
|
style: {
|
|
19
20
|
fontFamily: constants.typography.fontFamily,
|
|
20
21
|
fontSize: 14,
|
|
21
22
|
borderRadius: 8,
|
|
22
|
-
padding: '
|
|
23
|
-
boxShadow: '0
|
|
24
|
-
border: '
|
|
25
|
-
minHeight:
|
|
23
|
+
padding: '16px',
|
|
24
|
+
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.08)',
|
|
25
|
+
border: 'none',
|
|
26
|
+
minHeight: 'auto',
|
|
27
|
+
backgroundColor: colors.absolute.white,
|
|
26
28
|
},
|
|
27
29
|
};
|
|
28
30
|
/**
|
|
29
|
-
* Success notification
|
|
31
|
+
* Success notification
|
|
30
32
|
*/
|
|
31
|
-
const successConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(CheckCircleOutlined, { style: { fontSize:
|
|
33
|
+
const successConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(CheckCircleOutlined, { style: { fontSize: 20, color: colors.success.main } }), style: Object.assign(Object.assign({}, baseConfig.style), { backgroundColor: colors.success.bg, color: colors.success.text }) });
|
|
32
34
|
/**
|
|
33
|
-
* Error notification
|
|
35
|
+
* Error notification
|
|
34
36
|
*/
|
|
35
|
-
const errorConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(CloseCircleOutlined, { style: { fontSize:
|
|
37
|
+
const errorConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(CloseCircleOutlined, { style: { fontSize: 20, color: colors.error.main } }), style: Object.assign(Object.assign({}, baseConfig.style), { backgroundColor: colors.error.bg, color: colors.error.text }), autoClose: 6000 });
|
|
36
38
|
/**
|
|
37
|
-
* Warning notification
|
|
39
|
+
* Warning notification
|
|
38
40
|
*/
|
|
39
|
-
const warningConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(ExclamationCircleOutlined, { style: { fontSize:
|
|
41
|
+
const warningConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(ExclamationCircleOutlined, { style: { fontSize: 20, color: colors.warning.main } }), style: Object.assign(Object.assign({}, baseConfig.style), { backgroundColor: colors.warning.bg, color: colors.warning.text }) });
|
|
40
42
|
/**
|
|
41
|
-
* Info notification
|
|
43
|
+
* Info notification
|
|
42
44
|
*/
|
|
43
|
-
const infoConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(InfoCircleOutlined, { style: { fontSize:
|
|
45
|
+
const infoConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(InfoCircleOutlined, { style: { fontSize: 20, color: colors.info.main } }), style: Object.assign(Object.assign({}, baseConfig.style), { backgroundColor: colors.info.bg, color: colors.info.text }) });
|
|
44
46
|
/**
|
|
45
|
-
* Loading notification
|
|
47
|
+
* Loading notification
|
|
46
48
|
*/
|
|
47
|
-
const loadingConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(LoadingOutlined, { style: { fontSize:
|
|
49
|
+
const loadingConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(LoadingOutlined, { style: { fontSize: 20, color: colors.primary.main } }), style: Object.assign(Object.assign({}, baseConfig.style), { backgroundColor: colors.absolute.white, color: colors.text.primary }), autoClose: false, closeButton: false, hideProgressBar: true });
|
|
48
50
|
return {
|
|
49
51
|
loadingConfig,
|
|
50
52
|
infoConfig,
|
|
@@ -52,6 +54,6 @@ export const buildToastConfigs = (colors, constants) => {
|
|
|
52
54
|
errorConfig,
|
|
53
55
|
successConfig,
|
|
54
56
|
baseConfig,
|
|
55
|
-
colors,
|
|
57
|
+
colors,
|
|
56
58
|
};
|
|
57
59
|
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ToastContainerProps as RTToastContainerProps } from 'react-toastify';
|
|
3
3
|
export type TemboToastContainerProps = RTToastContainerProps;
|
|
4
4
|
/**
|
|
5
|
-
* Toast container with
|
|
5
|
+
* Toast container with professional, minimal styling
|
|
6
6
|
* Automatically initializes TemboNotify with current theme
|
|
7
7
|
*/
|
|
8
8
|
declare const TemboToastContainer: React.FC<TemboToastContainerProps>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// toast-container.tsx
|
|
2
3
|
import { useEffect } from 'react';
|
|
3
4
|
import { ToastContainer } from 'react-toastify';
|
|
4
5
|
import { useTemboTheme } from '../../theme/index.js';
|
|
5
6
|
import { TemboNotify } from './tembo-notify.js';
|
|
6
7
|
/**
|
|
7
|
-
* Toast container with
|
|
8
|
+
* Toast container with professional, minimal styling
|
|
8
9
|
* Automatically initializes TemboNotify with current theme
|
|
9
10
|
*/
|
|
10
11
|
const TemboToastContainer = (props) => {
|
|
@@ -14,101 +15,97 @@ const TemboToastContainer = (props) => {
|
|
|
14
15
|
TemboNotify.init(colors, constants);
|
|
15
16
|
}, [colors, constants]);
|
|
16
17
|
return (_jsxs(_Fragment, { children: [_jsx(ToastContainer, Object.assign({}, props)), _jsx("style", { children: `
|
|
17
|
-
/*
|
|
18
|
+
/* Professional, minimal toast styles */
|
|
18
19
|
.Toastify__toast {
|
|
19
20
|
font-family: ${constants.typography.fontFamily};
|
|
20
21
|
line-height: 1.5;
|
|
22
|
+
padding: 16px;
|
|
23
|
+
min-height: auto;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
.Toastify__toast-body {
|
|
24
27
|
padding: 0;
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: 12px;
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
.Toastify__toast-icon {
|
|
28
|
-
width:
|
|
29
|
-
|
|
34
|
+
width: 20px;
|
|
35
|
+
height: 20px;
|
|
36
|
+
margin: 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
flex-shrink: 0;
|
|
30
41
|
}
|
|
31
42
|
|
|
32
43
|
.Toastify__close-button {
|
|
33
|
-
opacity: 0.
|
|
44
|
+
opacity: 0.4;
|
|
34
45
|
transition: opacity 0.2s ease;
|
|
46
|
+
align-self: flex-start;
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
.Toastify__close-button:hover {
|
|
38
|
-
opacity:
|
|
50
|
+
opacity: 0.8;
|
|
39
51
|
}
|
|
40
52
|
|
|
41
|
-
/*
|
|
53
|
+
/* No progress bar */
|
|
42
54
|
.Toastify__progress-bar {
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.toast-progress-success .Toastify__progress-bar {
|
|
47
|
-
background: ${colors.success.main};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.toast-progress-error .Toastify__progress-bar {
|
|
51
|
-
background: ${colors.error.main};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.toast-progress-warning .Toastify__progress-bar {
|
|
55
|
-
background: ${colors.warning.main};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.toast-progress-info .Toastify__progress-bar {
|
|
59
|
-
background: ${colors.info.main};
|
|
55
|
+
display: none;
|
|
60
56
|
}
|
|
61
57
|
|
|
62
58
|
/* Smooth entrance animation */
|
|
63
59
|
@keyframes toastSlideIn {
|
|
64
60
|
from {
|
|
65
|
-
transform:
|
|
61
|
+
transform: translate3d(110%, 0, 0);
|
|
66
62
|
opacity: 0;
|
|
67
63
|
}
|
|
68
64
|
to {
|
|
69
|
-
transform:
|
|
65
|
+
transform: translate3d(0, 0, 0);
|
|
70
66
|
opacity: 1;
|
|
71
67
|
}
|
|
72
68
|
}
|
|
73
69
|
|
|
74
70
|
.Toastify__toast--top-right {
|
|
75
|
-
animation: toastSlideIn 0.
|
|
71
|
+
animation: toastSlideIn 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
|
|
76
72
|
}
|
|
77
73
|
|
|
78
74
|
.Toastify__toast--top-left {
|
|
79
|
-
animation: toastSlideIn 0.
|
|
75
|
+
animation: toastSlideIn 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
|
|
80
76
|
}
|
|
81
77
|
|
|
82
78
|
.Toastify__toast--top-center {
|
|
83
|
-
animation: toastSlideIn 0.
|
|
79
|
+
animation: toastSlideIn 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
/* Smooth exit animation */
|
|
87
83
|
@keyframes toastSlideOut {
|
|
88
84
|
from {
|
|
89
|
-
transform:
|
|
85
|
+
transform: translate3d(0, 0, 0);
|
|
90
86
|
opacity: 1;
|
|
91
87
|
}
|
|
92
88
|
to {
|
|
93
|
-
transform:
|
|
89
|
+
transform: translate3d(110%, 0, 0);
|
|
94
90
|
opacity: 0;
|
|
95
91
|
}
|
|
96
92
|
}
|
|
97
93
|
|
|
98
94
|
.Toastify__toast--top-right.Toastify__toast--removing {
|
|
99
|
-
animation: toastSlideOut 0.
|
|
95
|
+
animation: toastSlideOut 0.25s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;
|
|
100
96
|
}
|
|
101
97
|
|
|
102
98
|
/* Responsive spacing */
|
|
103
99
|
@media only screen and (max-width: 480px) {
|
|
104
100
|
.Toastify__toast-container {
|
|
105
|
-
padding:
|
|
106
|
-
width: 100vw;
|
|
101
|
+
padding: 8px;
|
|
102
|
+
width: calc(100vw - 16px);
|
|
103
|
+
left: 8px;
|
|
104
|
+
right: 8px;
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
.Toastify__toast {
|
|
110
|
-
margin-bottom:
|
|
111
|
-
border-radius: 0;
|
|
108
|
+
margin-bottom: 8px;
|
|
112
109
|
}
|
|
113
110
|
}
|
|
114
111
|
` })] }));
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=require("./theme-provider-RhAw3jw_.js"),t=require("@ebay/nice-modal-react"),
|
|
1
|
+
"use strict";var n=require("./theme-provider-RhAw3jw_.js"),t=require("@ebay/nice-modal-react"),e=require("react"),i=require("react-toastify");require("lodash");var s=require("./tembo-notify-BDtExWQg.js");function o(n){return n&&n.__esModule?n:{default:n}}require("antd"),require("tslib"),require("./InfoCircleOutlined-B7d2aRfV.js"),require("./ZoomOutOutlined-CW-jqBMI.js");var r=o(t);const a=t=>n.jsxRuntimeExports.jsx(r.default.Provider,{children:t.children}),c=t=>{const{colors:o,constants:r}=n.useTemboTheme();return e.useEffect(()=>{s.TemboNotify.init(o,r)},[o,r]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(i.ToastContainer,Object.assign({},t)),n.jsxRuntimeExports.jsx("style",{children:`\n /* Professional, minimal toast styles */\n .Toastify__toast {\n font-family: ${r.typography.fontFamily};\n line-height: 1.5;\n padding: 16px;\n min-height: auto;\n }\n \n .Toastify__toast-body {\n padding: 0;\n display: flex;\n align-items: center;\n gap: 12px;\n }\n \n .Toastify__toast-icon {\n width: 20px;\n height: 20px;\n margin: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n \n .Toastify__close-button {\n opacity: 0.4;\n transition: opacity 0.2s ease;\n align-self: flex-start;\n }\n \n .Toastify__close-button:hover {\n opacity: 0.8;\n }\n \n /* No progress bar */\n .Toastify__progress-bar {\n display: none;\n }\n \n /* Smooth entrance animation */\n @keyframes toastSlideIn {\n from {\n transform: translate3d(110%, 0, 0);\n opacity: 0;\n }\n to {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n }\n }\n \n .Toastify__toast--top-right {\n animation: toastSlideIn 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;\n }\n \n .Toastify__toast--top-left {\n animation: toastSlideIn 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;\n }\n \n .Toastify__toast--top-center {\n animation: toastSlideIn 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;\n }\n \n /* Smooth exit animation */\n @keyframes toastSlideOut {\n from {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n }\n to {\n transform: translate3d(110%, 0, 0);\n opacity: 0;\n }\n }\n \n .Toastify__toast--top-right.Toastify__toast--removing {\n animation: toastSlideOut 0.25s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;\n }\n \n /* Responsive spacing */\n @media only screen and (max-width: 480px) {\n .Toastify__toast-container {\n padding: 8px;\n width: calc(100vw - 16px);\n left: 8px;\n right: 8px;\n }\n \n .Toastify__toast {\n margin-bottom: 8px;\n }\n }\n `})]})};exports.TemboUIProviders=({children:t,colors:e,constants:i,themeOverrides:s})=>n.jsxRuntimeExports.jsx(n.TemboThemeProvider,{colors:e,constants:i,themeOverrides:s,children:n.jsxRuntimeExports.jsxs(a,{children:[t,n.jsxRuntimeExports.jsx(c,{})]})});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/features/dialogs/modal-provider.tsx","../src/features/notifications/toast-container.tsx","../src/providers.tsx"],"sourcesContent":[null,null,null],"names":["TemboModalProvider","props","_jsx","NiceModal","Provider","children","TemboToastContainer","colors","constants","useTemboTheme","useEffect","TemboNotify","init","_jsxs","ToastContainer","typography","fontFamily","
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/features/dialogs/modal-provider.tsx","../src/features/notifications/toast-container.tsx","../src/providers.tsx"],"sourcesContent":[null,null,null],"names":["TemboModalProvider","props","_jsx","NiceModal","Provider","children","TemboToastContainer","colors","constants","useTemboTheme","useEffect","TemboNotify","init","_jsxs","ToastContainer","typography","fontFamily","themeOverrides","TemboThemeProvider"],"mappings":"gYAGA,MAAMA,EAAmDC,GAC9CC,EAAAA,kBAAAA,IAACC,EAAAA,QAAUC,mBAAUH,EAAMI,WCQhCC,EAA2DL,IAC7D,MAAMM,OAAEA,EAAMC,UAAEA,GAAcC,kBAO9B,OAJAC,EAAAA,UAAU,KACNC,cAAYC,KAAKL,EAAQC,IAC1B,CAACD,EAAQC,IAGRK,EAAAA,kBAAAA,6CACIX,EAAAA,kBAAAA,IAACY,EAAAA,gCAAmBb,IACpBC,EAAAA,kBAAAA,IAAA,QAAA,CAAAG,SAAQ,oIAGeG,EAAUO,WAAWC,owGCiBS,EAC7DX,WACAE,SACAC,YACAS,oBAGIf,EAAAA,kBAAAA,IAACgB,qBAAkB,CACfX,OAAQA,EACRC,UAAWA,EACXS,eAAgBA,EAAcZ,SAE9BQ,EAAAA,kBAAAA,KAACb,EAAkB,CAAAK,SAAA,CACdA,EACDH,EAAAA,kBAAAA,IAACI,EAAmB,CAAA"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as n,u as t,T as o}from"./theme-provider-Ca4P0Hcp.js";import
|
|
1
|
+
import{j as n,u as t,T as o}from"./theme-provider-Ca4P0Hcp.js";import i from"@ebay/nice-modal-react";import{useEffect as a}from"react";import{ToastContainer as s}from"react-toastify";import"lodash";import{T as e}from"./tembo-notify-BAawbRy0.js";import"antd";import"tslib";import"./InfoCircleOutlined-DYs90hdV.js";import"./ZoomOutOutlined-Pw8hpWWK.js";const r=t=>n.jsx(i.Provider,{children:t.children}),m=o=>{const{colors:i,constants:r}=t();return a(()=>{e.init(i,r)},[i,r]),n.jsxs(n.Fragment,{children:[n.jsx(s,Object.assign({},o)),n.jsx("style",{children:`\n /* Professional, minimal toast styles */\n .Toastify__toast {\n font-family: ${r.typography.fontFamily};\n line-height: 1.5;\n padding: 16px;\n min-height: auto;\n }\n \n .Toastify__toast-body {\n padding: 0;\n display: flex;\n align-items: center;\n gap: 12px;\n }\n \n .Toastify__toast-icon {\n width: 20px;\n height: 20px;\n margin: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n \n .Toastify__close-button {\n opacity: 0.4;\n transition: opacity 0.2s ease;\n align-self: flex-start;\n }\n \n .Toastify__close-button:hover {\n opacity: 0.8;\n }\n \n /* No progress bar */\n .Toastify__progress-bar {\n display: none;\n }\n \n /* Smooth entrance animation */\n @keyframes toastSlideIn {\n from {\n transform: translate3d(110%, 0, 0);\n opacity: 0;\n }\n to {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n }\n }\n \n .Toastify__toast--top-right {\n animation: toastSlideIn 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;\n }\n \n .Toastify__toast--top-left {\n animation: toastSlideIn 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;\n }\n \n .Toastify__toast--top-center {\n animation: toastSlideIn 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;\n }\n \n /* Smooth exit animation */\n @keyframes toastSlideOut {\n from {\n transform: translate3d(0, 0, 0);\n opacity: 1;\n }\n to {\n transform: translate3d(110%, 0, 0);\n opacity: 0;\n }\n }\n \n .Toastify__toast--top-right.Toastify__toast--removing {\n animation: toastSlideOut 0.25s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;\n }\n \n /* Responsive spacing */\n @media only screen and (max-width: 480px) {\n .Toastify__toast-container {\n padding: 8px;\n width: calc(100vw - 16px);\n left: 8px;\n right: 8px;\n }\n \n .Toastify__toast {\n margin-bottom: 8px;\n }\n }\n `})]})},c=({children:t,colors:i,constants:a,themeOverrides:s})=>n.jsx(o,{colors:i,constants:a,themeOverrides:s,children:n.jsxs(r,{children:[t,n.jsx(m,{})]})});export{c as TemboUIProviders};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/features/dialogs/modal-provider.tsx","../src/features/notifications/toast-container.tsx","../src/providers.tsx"],"sourcesContent":[null,null,null],"names":["TemboModalProvider","props","_jsx","NiceModal","Provider","children","TemboToastContainer","colors","constants","useTemboTheme","useEffect","TemboNotify","init","_jsxs","ToastContainer","typography","fontFamily","
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/features/dialogs/modal-provider.tsx","../src/features/notifications/toast-container.tsx","../src/providers.tsx"],"sourcesContent":[null,null,null],"names":["TemboModalProvider","props","_jsx","NiceModal","Provider","children","TemboToastContainer","colors","constants","useTemboTheme","useEffect","TemboNotify","init","_jsxs","ToastContainer","typography","fontFamily","TemboUIProviders","themeOverrides","TemboThemeProvider"],"mappings":"+VAGA,MAAMA,EAAmDC,GAC9CC,EAAAA,IAACC,EAAUC,mBAAUH,EAAMI,WCQhCC,EAA2DL,IAC7D,MAAMM,OAAEA,EAAMC,UAAEA,GAAcC,IAO9B,OAJAC,EAAU,KACNC,EAAYC,KAAKL,EAAQC,IAC1B,CAACD,EAAQC,IAGRK,EAAAA,2BACIX,EAAAA,IAACY,mBAAmBb,IACpBC,EAAAA,IAAA,QAAA,CAAAG,SAAQ,oIAGeG,EAAUO,WAAWC,2uGCiB3CC,EAAoD,EAC7DZ,WACAE,SACAC,YACAU,oBAGIhB,EAAAA,IAACiB,EAAkB,CACfZ,OAAQA,EACRC,UAAWA,EACXU,eAAgBA,EAAcb,SAE9BQ,EAAAA,KAACb,EAAkB,CAAAK,SAAA,CACdA,EACDH,EAAAA,IAACI,EAAmB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../tembo-notify-
|
|
1
|
+
"use strict";var e=require("../tembo-notify-BDtExWQg.js");require("../theme-provider-RhAw3jw_.js"),require("react"),require("react-toastify"),require("lodash"),require("tslib"),require("../InfoCircleOutlined-B7d2aRfV.js"),require("../ZoomOutOutlined-CW-jqBMI.js"),require("antd"),exports.TemboNotify=e.TemboNotify,exports.buildToastConfigs=e.buildToastConfigs;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{T as TemboNotify,b as buildToastConfigs}from"../tembo-notify-
|
|
1
|
+
export{T as TemboNotify,b as buildToastConfigs}from"../tembo-notify-BAawbRy0.js";import"../theme-provider-Ca4P0Hcp.js";import"react";import"react-toastify";import"lodash";import"tslib";import"../InfoCircleOutlined-DYs90hdV.js";import"../ZoomOutOutlined-Pw8hpWWK.js";import"antd";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__rest as o}from"tslib";import{j as i}from"./theme-provider-Ca4P0Hcp.js";import{toast as s}from"react-toastify";import{b as t,c as n,R as e,a as r}from"./InfoCircleOutlined-DYs90hdV.js";import{b as l}from"./ZoomOutOutlined-Pw8hpWWK.js";const a=(o,s)=>{const a={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1,style:{fontFamily:s.typography.fontFamily,fontSize:14,borderRadius:8,padding:"16px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.08)",border:"none",minHeight:"auto",backgroundColor:o.absolute.white}},c=Object.assign(Object.assign({},a),{icon:i.jsx(t,{style:{fontSize:20,color:o.success.main}}),style:Object.assign(Object.assign({},a.style),{backgroundColor:o.success.bg,color:o.success.text})}),g=Object.assign(Object.assign({},a),{icon:i.jsx(n,{style:{fontSize:20,color:o.error.main}}),style:Object.assign(Object.assign({},a.style),{backgroundColor:o.error.bg,color:o.error.text}),autoClose:6e3}),u=Object.assign(Object.assign({},a),{icon:i.jsx(e,{style:{fontSize:20,color:o.warning.main}}),style:Object.assign(Object.assign({},a.style),{backgroundColor:o.warning.bg,color:o.warning.text})}),d=Object.assign(Object.assign({},a),{icon:i.jsx(r,{style:{fontSize:20,color:o.info.main}}),style:Object.assign(Object.assign({},a.style),{backgroundColor:o.info.bg,color:o.info.text})});return{loadingConfig:Object.assign(Object.assign({},a),{icon:i.jsx(l,{style:{fontSize:20,color:o.primary.main}}),style:Object.assign(Object.assign({},a.style),{backgroundColor:o.absolute.white,color:o.text.primary}),autoClose:!1,closeButton:!1,hideProgressBar:!0}),infoConfig:d,warningConfig:u,errorConfig:g,successConfig:c,baseConfig:a,colors:o}},c={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1};class g{static init(o,i){this.configs=a(o,i)}static getConfigs(){return this.configs}static formatMessage(o){if(o&&"object"==typeof o&&("title"in o||"description"in o)){const{title:s,description:t}=o;if(!s&&t)return i.jsx("div",{style:{fontWeight:500,fontSize:14,lineHeight:1.5},children:t});if(s&&!t)return i.jsx("div",{style:{fontWeight:600,fontSize:14,lineHeight:1.5},children:s});if(s&&t)return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[i.jsx("div",{style:{fontWeight:600,fontSize:14,lineHeight:1.5},children:s}),i.jsx("div",{style:{fontSize:13,lineHeight:1.5,opacity:.85},children:t})]})}return o}static buildOptions(i,s){const t=s||{},{duration:n,toastId:e,onClick:r,onClose:l,icon:a,showCloseButton:g=!1}=t,u=o(t,["duration","toastId","onClick","onClose","icon","showCloseButton"]),d=null!=i?i:c;return Object.assign(Object.assign(Object.assign({},d),u),{toastId:e,autoClose:void 0!==n?n||!1:d.autoClose,onClick:r,onClose:l,icon:void 0!==a?a:d.icon,closeButton:g})}static getSuccessConfig(){var o,i;const s=this.getConfigs();return null!==(i=null!==(o=null==s?void 0:s.successConfig)&&void 0!==o?o:null==s?void 0:s.baseConfig)&&void 0!==i?i:void 0}static getErrorConfig(){var o,i;const s=this.getConfigs();return null!==(i=null!==(o=null==s?void 0:s.errorConfig)&&void 0!==o?o:null==s?void 0:s.baseConfig)&&void 0!==i?i:void 0}static getWarningConfig(){var o,i;const s=this.getConfigs();return null!==(i=null!==(o=null==s?void 0:s.warningConfig)&&void 0!==o?o:null==s?void 0:s.baseConfig)&&void 0!==i?i:void 0}static getInfoConfig(){var o,i;const s=this.getConfigs();return null!==(i=null!==(o=null==s?void 0:s.infoConfig)&&void 0!==o?o:null==s?void 0:s.baseConfig)&&void 0!==i?i:void 0}static getLoadingConfig(){var o,i;const s=this.getConfigs();return null!==(i=null!==(o=null==s?void 0:s.loadingConfig)&&void 0!==o?o:null==s?void 0:s.baseConfig)&&void 0!==i?i:void 0}static success(o,i){const t=this.formatMessage(o),n=this.buildOptions(this.getSuccessConfig(),i);return s.success(t,n)}static error(o,i){const t=this.formatMessage(o),n=this.buildOptions(this.getErrorConfig(),i);return s.error(t,n)}static warning(o,i){const t=this.formatMessage(o),n=this.buildOptions(this.getWarningConfig(),i);return s.warning(t,n)}static info(o,i){const t=this.formatMessage(o),n=this.buildOptions(this.getInfoConfig(),i);return s.info(t,n)}static loading(i,t){var n;const e=this.formatMessage(i),r=t||{},{toastId:l,onClick:a,onClose:g,icon:u,showCloseButton:d=!1}=r,f=o(r,["toastId","onClick","onClose","icon","showCloseButton"]),C=null!==(n=this.getLoadingConfig())&&void 0!==n?n:c;return s.loading(e,Object.assign(Object.assign(Object.assign({},C),f),{toastId:l,onClick:a,onClose:g,icon:void 0!==u?u:C.icon,closeButton:d}))}static update(o,i){var t,n;const e=this.getConfigs(),r=i.type&&e?{success:e.successConfig,error:e.errorConfig,warning:e.warningConfig,info:e.infoConfig}[i.type]:void 0,l=i.message?this.formatMessage(i.message):i.render;s.update(o,Object.assign({render:l,type:i.type,isLoading:!1,autoClose:null!==(n=null!==(t=i.autoClose)&&void 0!==t?t:null==r?void 0:r.autoClose)&&void 0!==n?n:c.autoClose,icon:void 0!==i.icon?i.icon:null==r?void 0:r.icon},null!=r?r:{}))}static dismiss(o){s.dismiss(o)}static dismissAll(){s.dismiss()}static isActive(o){return s.isActive(o)}}g.configs=null;export{g as T,a as b};
|
|
2
|
+
//# sourceMappingURL=tembo-notify-BAawbRy0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tembo-notify-BAawbRy0.js","sources":["../src/features/notifications/toast-config.tsx","../src/features/notifications/tembo-notify.tsx"],"sourcesContent":[null,null],"names":["buildToastConfigs","colors","constants","baseConfig","position","autoClose","hideProgressBar","closeOnClick","pauseOnHover","draggable","closeButton","style","fontFamily","typography","fontSize","borderRadius","padding","boxShadow","border","minHeight","backgroundColor","absolute","white","successConfig","icon","_jsx","CheckCircleOutlined","color","success","main","bg","text","errorConfig","Object","assign","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","info","loadingConfig","LoadingOutlined","primary","FALLBACK_BASE_CONFIG","TemboNotify","init","this","configs","getConfigs","formatMessage","message","title","description","fontWeight","lineHeight","children","_jsxs","display","flexDirection","gap","opacity","buildOptions","options","_a","duration","toastId","onClick","onClose","showCloseButton","restOptions","__rest","effectiveBase","undefined","getSuccessConfig","_b","getErrorConfig","getWarningConfig","getInfoConfig","getLoadingConfig","content","toastOptions","toast","loading","update","id","typeConfig","type","render","isLoading","dismiss","dismissAll","isActive"],"mappings":"yPAgBaA,EAAoB,CAACC,EAA2BC,KAIzD,MAAMC,EAA2B,CAC7BC,SAAU,YACVC,UAAW,IACXC,iBAAiB,EACjBC,cAAc,EACdC,cAAc,EACdC,WAAW,EACXC,aAAa,EACbC,MAAO,CACHC,WAAYV,EAAUW,WAAWD,WACjCE,SAAU,GACVC,aAAc,EACdC,QAAS,OACTC,UAAW,gCACXC,OAAQ,OACRC,UAAW,OACXC,gBAAiBnB,EAAOoB,SAASC,QAOnCC,iCACCpB,GAAU,CACbqB,KAAMC,EAAAA,IAACC,EAAmB,CAACf,MAAO,CAAEG,SAAU,GAAIa,MAAO1B,EAAO2B,QAAQC,QACxElB,qCACOR,EAAWQ,OAAK,CACnBS,gBAAiBnB,EAAO2B,QAAQE,GAChCH,MAAO1B,EAAO2B,QAAQG,SAOxBC,EAAWC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACV/B,GAAU,CACbqB,KAAMC,EAAAA,IAACU,EAAmB,CAACxB,MAAO,CAAEG,SAAU,GAAIa,MAAO1B,EAAOmC,MAAMP,QACtElB,MAAKsB,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACE/B,EAAWQ,OAAK,CACnBS,gBAAiBnB,EAAOmC,MAAMN,GAC9BH,MAAO1B,EAAOmC,MAAML,OAExB1B,UAAW,MAMTgC,iCACClC,GAAU,CACbqB,KAAMC,EAA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EA,EAAO9C,KAAEA,EAAI+C,gBAAEA,GAAkB,GAAKM,EAAKL,EAAWC,EAAAI,EAA1E,CAAA,UAAA,UAAA,UAAA,OAAA,oBAEA1E,EAAoC,QAAvB+D,EAAAjB,KAAKgC,0BAAkB,IAAAf,EAAAA,EAAIpB,EAE9C,OAAOsC,EAAMC,QAAQH,+CACd/E,GACAqE,GAAW,CACdJ,UACAC,UACAC,UACA9C,UAAemD,IAATnD,EAAqBA,EAAOrB,EAAWqB,KAC7Cd,YAAa6D,KAOrB,aAAOe,CAAOC,EAAQtB,WAOlB,MAAMf,EAAUD,KAAKE,aAEfqC,EACFvB,EAAQwB,MAAQvC,EACV,CACItB,QAASsB,EAAQ3B,cACjBa,MAAOc,EAAQlB,YACfO,QAASW,EAAQb,cACjBK,KAAMQ,EAAQV,YAChByB,EAAQwB,WACVd,EAEJO,EAAUjB,EAAQZ,QAClBJ,KAAKG,cAAca,EAAQZ,SAC3BY,EAAQyB,OAEdN,EAAME,OAAOC,iBACTG,OAAQR,EACRO,KAAMxB,EAAQwB,KACdE,WAAW,EACXtF,UAEyB,QADrBwE,EAAiB,QAAjBX,EAAAD,EAAQ5D,iBAAS,IAAA6D,EAAAA,EACjBsB,aAAU,EAAVA,EAAYnF,iBAAS,IAAAwE,EAAAA,EACrB/B,EAAqBzC,UACzBmB,UAAuBmD,IAAjBV,EAAQzC,KAAqByC,EAAQzC,KAAOgE,aAAU,EAAVA,EAAYhE,MAC1DgE,QAAAA,EAAc,CAAA,IAO1B,cAAOI,CAAQL,GACXH,EAAMQ,QAAQL,GAMlB,iBAAOM,GACHT,EAAMQ,UAMV,eAAOE,CAASP,GACZ,OAAOH,EAAMU,SAASP,IA/OXxC,EAAAG,QAA+B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var o=require("tslib"),t=require("./theme-provider-RhAw3jw_.js"),s=require("react-toastify"),i=require("./InfoCircleOutlined-B7d2aRfV.js"),n=require("./ZoomOutOutlined-CW-jqBMI.js");const e=(o,s)=>{const e={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1,style:{fontFamily:s.typography.fontFamily,fontSize:14,borderRadius:8,padding:"16px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.08)",border:"none",minHeight:"auto",backgroundColor:o.absolute.white}},r=Object.assign(Object.assign({},e),{icon:t.jsxRuntimeExports.jsx(i.RefIcon$2,{style:{fontSize:20,color:o.success.main}}),style:Object.assign(Object.assign({},e.style),{backgroundColor:o.success.bg,color:o.success.text})}),l=Object.assign(Object.assign({},e),{icon:t.jsxRuntimeExports.jsx(i.RefIcon$3,{style:{fontSize:20,color:o.error.main}}),style:Object.assign(Object.assign({},e.style),{backgroundColor:o.error.bg,color:o.error.text}),autoClose:6e3}),a=Object.assign(Object.assign({},e),{icon:t.jsxRuntimeExports.jsx(i.RefIcon,{style:{fontSize:20,color:o.warning.main}}),style:Object.assign(Object.assign({},e.style),{backgroundColor:o.warning.bg,color:o.warning.text})}),c=Object.assign(Object.assign({},e),{icon:t.jsxRuntimeExports.jsx(i.RefIcon$1,{style:{fontSize:20,color:o.info.main}}),style:Object.assign(Object.assign({},e.style),{backgroundColor:o.info.bg,color:o.info.text})});return{loadingConfig:Object.assign(Object.assign({},e),{icon:t.jsxRuntimeExports.jsx(n.RefIcon$2,{style:{fontSize:20,color:o.primary.main}}),style:Object.assign(Object.assign({},e.style),{backgroundColor:o.absolute.white,color:o.text.primary}),autoClose:!1,closeButton:!1,hideProgressBar:!0}),infoConfig:c,warningConfig:a,errorConfig:l,successConfig:r,baseConfig:e,colors:o}},r={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1};class l{static init(o,t){this.configs=e(o,t)}static getConfigs(){return this.configs}static formatMessage(o){if(o&&"object"==typeof o&&("title"in o||"description"in o)){const{title:s,description:i}=o;if(!s&&i)return t.jsxRuntimeExports.jsx("div",{style:{fontWeight:500,fontSize:14,lineHeight:1.5},children:i});if(s&&!i)return t.jsxRuntimeExports.jsx("div",{style:{fontWeight:600,fontSize:14,lineHeight:1.5},children:s});if(s&&i)return t.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsxRuntimeExports.jsx("div",{style:{fontWeight:600,fontSize:14,lineHeight:1.5},children:s}),t.jsxRuntimeExports.jsx("div",{style:{fontSize:13,lineHeight:1.5,opacity:.85},children:i})]})}return o}static buildOptions(t,s){const i=s||{},{duration:n,toastId:e,onClick:l,onClose:a,icon:c,showCloseButton:g=!1}=i,u=o.__rest(i,["duration","toastId","onClick","onClose","icon","showCloseButton"]),d=null!=t?t:r;return Object.assign(Object.assign(Object.assign({},d),u),{toastId:e,autoClose:void 0!==n?n||!1:d.autoClose,onClick:l,onClose:a,icon:void 0!==c?c:d.icon,closeButton:g})}static getSuccessConfig(){var o,t;const s=this.getConfigs();return null!==(t=null!==(o=null==s?void 0:s.successConfig)&&void 0!==o?o:null==s?void 0:s.baseConfig)&&void 0!==t?t:void 0}static getErrorConfig(){var o,t;const s=this.getConfigs();return null!==(t=null!==(o=null==s?void 0:s.errorConfig)&&void 0!==o?o:null==s?void 0:s.baseConfig)&&void 0!==t?t:void 0}static getWarningConfig(){var o,t;const s=this.getConfigs();return null!==(t=null!==(o=null==s?void 0:s.warningConfig)&&void 0!==o?o:null==s?void 0:s.baseConfig)&&void 0!==t?t:void 0}static getInfoConfig(){var o,t;const s=this.getConfigs();return null!==(t=null!==(o=null==s?void 0:s.infoConfig)&&void 0!==o?o:null==s?void 0:s.baseConfig)&&void 0!==t?t:void 0}static getLoadingConfig(){var o,t;const s=this.getConfigs();return null!==(t=null!==(o=null==s?void 0:s.loadingConfig)&&void 0!==o?o:null==s?void 0:s.baseConfig)&&void 0!==t?t:void 0}static success(o,t){const i=this.formatMessage(o),n=this.buildOptions(this.getSuccessConfig(),t);return s.toast.success(i,n)}static error(o,t){const i=this.formatMessage(o),n=this.buildOptions(this.getErrorConfig(),t);return s.toast.error(i,n)}static warning(o,t){const i=this.formatMessage(o),n=this.buildOptions(this.getWarningConfig(),t);return s.toast.warning(i,n)}static info(o,t){const i=this.formatMessage(o),n=this.buildOptions(this.getInfoConfig(),t);return s.toast.info(i,n)}static loading(t,i){var n;const e=this.formatMessage(t),l=i||{},{toastId:a,onClick:c,onClose:g,icon:u,showCloseButton:d=!1}=l,f=o.__rest(l,["toastId","onClick","onClose","icon","showCloseButton"]),C=null!==(n=this.getLoadingConfig())&&void 0!==n?n:r;return s.toast.loading(e,Object.assign(Object.assign(Object.assign({},C),f),{toastId:a,onClick:c,onClose:g,icon:void 0!==u?u:C.icon,closeButton:d}))}static update(o,t){var i,n;const e=this.getConfigs(),l=t.type&&e?{success:e.successConfig,error:e.errorConfig,warning:e.warningConfig,info:e.infoConfig}[t.type]:void 0,a=t.message?this.formatMessage(t.message):t.render;s.toast.update(o,Object.assign({render:a,type:t.type,isLoading:!1,autoClose:null!==(n=null!==(i=t.autoClose)&&void 0!==i?i:null==l?void 0:l.autoClose)&&void 0!==n?n:r.autoClose,icon:void 0!==t.icon?t.icon:null==l?void 0:l.icon},null!=l?l:{}))}static dismiss(o){s.toast.dismiss(o)}static dismissAll(){s.toast.dismiss()}static isActive(o){return s.toast.isActive(o)}}l.configs=null,exports.TemboNotify=l,exports.buildToastConfigs=e;
|
|
2
|
+
//# sourceMappingURL=tembo-notify-BDtExWQg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tembo-notify-BDtExWQg.js","sources":["../src/features/notifications/toast-config.tsx","../src/features/notifications/tembo-notify.tsx"],"sourcesContent":[null,null],"names":["buildToastConfigs","colors","constants","baseConfig","position","autoClose","hideProgressBar","closeOnClick","pauseOnHover","draggable","closeButton","style","fontFamily","typography","fontSize","borderRadius","padding","boxShadow","border","minHeight","backgroundColor","absolute","white","successConfig","icon","_jsx","CheckCircleOutlined","color","success","main","bg","text","errorConfig","Object","assign","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","info","loadingConfig","LoadingOutlined","primary","FALLBACK_BASE_CONFIG","TemboNotify","init","this","configs","getConfigs","formatMessage","message","title","description","fontWeight","lineHeight","children","_jsxs","display","flexDirection","gap","opacity","buildOptions","options","_a","duration","toastId","onClick","onClose","showCloseButton","restOptions","__rest","effectiveBase","undefined","getSuccessConfig","_b","getErrorConfig","getWarningConfig","getInfoConfig","getLoadingConfig","content","toastOptions","toast","loading","update","id","typeConfig","type","render","isLoading","dismiss","dismissAll","isActive"],"mappings":"yMAgBaA,EAAoB,CAACC,EAA2BC,KAIzD,MAAMC,EAA2B,CAC7BC,SAAU,YACVC,UAAW,IACXC,iBAAiB,EACjBC,cAAc,EACdC,cAAc,EACdC,WAAW,EACXC,aAAa,EACbC,MAAO,CACHC,WAAYV,EAAUW,WAAWD,WACjCE,SAAU,GACVC,aAAc,EACdC,QAAS,OACTC,UAAW,gCACXC,OAAQ,OACRC,UAAW,OACXC,gBAAiBnB,EAAOoB,SAASC,QAOnCC,iCACCpB,GAAU,CACbqB,KAAMC,EAAAA,kBAAAA,IAACC,EAAAA,UAAmB,CAACf,MAAO,CAAEG,SAAU,GAAIa,MAAO1B,EAAO2B,QAAQC,QACxElB,qCACOR,EAAWQ,OAAK,CACnBS,gBAAiBnB,EAAO2B,QAAQE,GAChCH,MAAO1B,EAAO2B,QAAQG,SAOxBC,EAAWC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACV/B,GAAU,CACbqB,KAAMC,EAAAA,kBAAAA,IAACU,YAAmB,CAACxB,MAAO,CAAEG,SAAU,GAAIa,MAAO1B,EAAOmC,MAAMP,QACtElB,MAAKsB,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACE/B,EAAWQ,OAAK,CACnBS,gBAAiBnB,EAAOmC,MAAMN,GAC9BH,MAAO1B,EAAOmC,MAAML,OAExB1B,UAAW,MAMTgC,iCACClC,GAAU,CACbqB,KAAMC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
|
|
|
1
|
-
"use strict";var s=require("tslib"),o=require("./theme-provider-RhAw3jw_.js"),t=require("react-toastify"),i=require("./InfoCircleOutlined-B7d2aRfV.js"),e=require("./ZoomOutOutlined-CW-jqBMI.js");const r=(s,t)=>{const r={position:"top-right",autoClose:4e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,style:{fontFamily:t.typography.fontFamily,fontSize:14,borderRadius:8,padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid",minHeight:56}},n=Object.assign(Object.assign({},r),{icon:o.jsxRuntimeExports.jsx(i.RefIcon$2,{style:{fontSize:18,color:s.success.main}}),style:Object.assign(Object.assign({},r.style),{backgroundColor:s.surface.main,borderColor:s.success.border,color:s.text.primary}),className:"toast-success",progressClassName:"toast-progress-success"}),a=Object.assign(Object.assign({},r),{icon:o.jsxRuntimeExports.jsx(i.RefIcon$3,{style:{fontSize:18,color:s.error.main}}),style:Object.assign(Object.assign({},r.style),{backgroundColor:s.surface.main,borderColor:s.error.border,color:s.text.primary}),className:"toast-error",progressClassName:"toast-progress-error",autoClose:6e3}),c=Object.assign(Object.assign({},r),{icon:o.jsxRuntimeExports.jsx(i.RefIcon,{style:{fontSize:18,color:s.warning.main}}),style:Object.assign(Object.assign({},r.style),{backgroundColor:s.surface.main,borderColor:s.warning.border,color:s.text.primary}),className:"toast-warning",progressClassName:"toast-progress-warning"}),l=Object.assign(Object.assign({},r),{icon:o.jsxRuntimeExports.jsx(i.RefIcon$1,{style:{fontSize:18,color:s.info.main}}),style:Object.assign(Object.assign({},r.style),{backgroundColor:s.surface.main,borderColor:s.info.border,color:s.text.primary}),className:"toast-info",progressClassName:"toast-progress-info"});return{loadingConfig:Object.assign(Object.assign({},r),{icon:o.jsxRuntimeExports.jsx(e.RefIcon$2,{style:{fontSize:18,color:s.primary.main}}),style:Object.assign(Object.assign({},r.style),{backgroundColor:s.surface.main,borderColor:s.border.main,color:s.text.primary}),className:"toast-loading",autoClose:!1,closeButton:!1,hideProgressBar:!0}),infoConfig:l,warningConfig:c,errorConfig:a,successConfig:n,baseConfig:r,colors:s}};class n{static init(s,o){this.configs=r(s,o)}static getConfigs(){if(!this.configs)throw new Error("TemboNotify not initialized. Call TemboNotify.init(colors, constants) before using notifications.");return this.configs}static formatMessage(s){return s&&"object"==typeof s&&"title"in s?o.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.jsxRuntimeExports.jsx("div",{style:{fontWeight:600,fontSize:14},children:s.title}),s.description&&o.jsxRuntimeExports.jsx("div",{style:{fontSize:13,opacity:.9},children:s.description})]}):s}static buildOptions(o,t){const i=t||{},{duration:e,toastId:r,onClick:n,onClose:a}=i,c=s.__rest(i,["duration","toastId","onClick","onClose"]);return Object.assign(Object.assign(Object.assign({},o),c),{toastId:r,autoClose:void 0!==e?e||!1:o.autoClose,onClick:n,onClose:a})}static success(s,o){const i=this.getConfigs(),e=this.formatMessage(s),r=this.buildOptions(i.successConfig,o);return t.toast.success(e,r)}static error(s,o){const i=this.getConfigs(),e=this.formatMessage(s),r=this.buildOptions(i.errorConfig,o);return t.toast.error(e,r)}static warning(s,o){const i=this.getConfigs(),e=this.formatMessage(s),r=this.buildOptions(i.warningConfig,o);return t.toast.warning(e,r)}static info(s,o){const i=this.getConfigs(),e=this.formatMessage(s),r=this.buildOptions(i.infoConfig,o);return t.toast.info(e,r)}static loading(o,i){const e=this.getConfigs(),r=this.formatMessage(o),n=i||{},{toastId:a,onClick:c,onClose:l}=n,g=s.__rest(n,["toastId","onClick","onClose"]);return t.toast.loading(r,Object.assign(Object.assign(Object.assign({},e.loadingConfig),g),{toastId:a,onClick:c,onClose:l}))}static update(s,o){var i;const e=this.getConfigs(),r=o.type?{success:e.successConfig,error:e.errorConfig,warning:e.warningConfig,info:e.infoConfig}[o.type]:void 0,n=o.message?this.formatMessage(o.message):o.render;t.toast.update(s,Object.assign({render:n,type:o.type,isLoading:!1,autoClose:null!==(i=o.autoClose)&&void 0!==i?i:null==r?void 0:r.autoClose},r))}static dismiss(s){t.toast.dismiss(s)}static dismissAll(){t.toast.dismiss()}static isActive(s){return t.toast.isActive(s)}}n.configs=null,exports.TemboNotify=n,exports.buildToastConfigs=r;
|
|
2
|
-
//# sourceMappingURL=tembo-notify-CXNzYLPU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tembo-notify-CXNzYLPU.js","sources":["../src/features/notifications/toast-config.tsx","../src/features/notifications/tembo-notify.tsx"],"sourcesContent":[null,null],"names":["buildToastConfigs","colors","constants","baseConfig","position","autoClose","hideProgressBar","closeOnClick","pauseOnHover","draggable","style","fontFamily","typography","fontSize","borderRadius","padding","boxShadow","border","minHeight","successConfig","Object","assign","icon","_jsx","CheckCircleOutlined","color","success","main","backgroundColor","surface","borderColor","text","primary","className","progressClassName","errorConfig","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","info","loadingConfig","LoadingOutlined","closeButton","TemboNotify","init","this","configs","getConfigs","Error","formatMessage","message","_jsxs","display","flexDirection","gap","children","fontWeight","title","description","opacity","buildOptions","options","_a","duration","toastId","onClick","onClose","restOptions","__rest","undefined","content","toastOptions","toast","loading","update","id","config","type","render","isLoading","dismiss","dismissAll","isActive"],"mappings":"yMAcaA,EAAoB,CAACC,EAA2BC,KAIzD,MAAMC,EAA2B,CAC7BC,SAAU,YACVC,UAAW,IACXC,iBAAiB,EACjBC,cAAc,EACdC,cAAc,EACdC,WAAW,EACXC,MAAO,CACHC,WAAYT,EAAUU,WAAWD,WACjCE,SAAU,GACVC,aAAc,EACdC,QAAS,YACTC,UAAW,iCACXC,OAAQ,YACRC,UAAW,KAObC,EAAaC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACZlB,GAAU,CACbmB,KAAMC,wBAACC,EAAAA,UAAmB,CAACd,MAAO,CAAEG,SAAU,GAAIY,MAAOxB,EAAOyB,QAAQC,QACxEjB,MAAKU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,CAAOC,EAAQd,SAMlB,MAAMf,EAAUD,KAAKE,aACf6B,EAASf,EAAQgB,KAAO,CAC1BvD,QAASwB,EAAQ/B,cACjBkB,MAAOa,EAAQf,YACfK,QAASU,EAAQZ,cACjBK,KAAMO,EAAQT,YAChBwB,EAAQgB,WAAQR,EAEZC,EAAUT,EAAQX,QAClBL,KAAKI,cAAcY,EAAQX,SAC3BW,EAAQiB,OAEdN,EAAAA,MAAME,OAAOC,EAAE3D,OAAAC,OAAA,CACX6D,OAAQR,EACRO,KAAMhB,EAAQgB,KACdE,WAAW,EACX9E,kBAAW6D,EAAAD,EAAQ5D,yBAAa2E,aAAM,EAANA,EAAQ3E,WACrC2E,IAOX,cAAOI,CAAQL,GACXH,EAAAA,MAAMQ,QAAQL,GAMlB,iBAAOM,GACHT,EAAAA,MAAMQ,UAMV,eAAOE,CAASP,GACZ,OAAOH,EAAAA,MAAMU,SAASP,IA5KXhC,EAAAG,QAA+B"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__rest as s}from"tslib";import{j as o}from"./theme-provider-Ca4P0Hcp.js";import{toast as t}from"react-toastify";import{b as i,c as e,R as r,a as n}from"./InfoCircleOutlined-DYs90hdV.js";import{b as a}from"./ZoomOutOutlined-Pw8hpWWK.js";const c=(s,t)=>{const c={position:"top-right",autoClose:4e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,style:{fontFamily:t.typography.fontFamily,fontSize:14,borderRadius:8,padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid",minHeight:56}},l=Object.assign(Object.assign({},c),{icon:o.jsx(i,{style:{fontSize:18,color:s.success.main}}),style:Object.assign(Object.assign({},c.style),{backgroundColor:s.surface.main,borderColor:s.success.border,color:s.text.primary}),className:"toast-success",progressClassName:"toast-progress-success"}),g=Object.assign(Object.assign({},c),{icon:o.jsx(e,{style:{fontSize:18,color:s.error.main}}),style:Object.assign(Object.assign({},c.style),{backgroundColor:s.surface.main,borderColor:s.error.border,color:s.text.primary}),className:"toast-error",progressClassName:"toast-progress-error",autoClose:6e3}),f=Object.assign(Object.assign({},c),{icon:o.jsx(r,{style:{fontSize:18,color:s.warning.main}}),style:Object.assign(Object.assign({},c.style),{backgroundColor:s.surface.main,borderColor:s.warning.border,color:s.text.primary}),className:"toast-warning",progressClassName:"toast-progress-warning"}),d=Object.assign(Object.assign({},c),{icon:o.jsx(n,{style:{fontSize:18,color:s.info.main}}),style:Object.assign(Object.assign({},c.style),{backgroundColor:s.surface.main,borderColor:s.info.border,color:s.text.primary}),className:"toast-info",progressClassName:"toast-progress-info"});return{loadingConfig:Object.assign(Object.assign({},c),{icon:o.jsx(a,{style:{fontSize:18,color:s.primary.main}}),style:Object.assign(Object.assign({},c.style),{backgroundColor:s.surface.main,borderColor:s.border.main,color:s.text.primary}),className:"toast-loading",autoClose:!1,closeButton:!1,hideProgressBar:!0}),infoConfig:d,warningConfig:f,errorConfig:g,successConfig:l,baseConfig:c,colors:s}};class l{static init(s,o){this.configs=c(s,o)}static getConfigs(){if(!this.configs)throw new Error("TemboNotify not initialized. Call TemboNotify.init(colors, constants) before using notifications.");return this.configs}static formatMessage(s){return s&&"object"==typeof s&&"title"in s?o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.jsx("div",{style:{fontWeight:600,fontSize:14},children:s.title}),s.description&&o.jsx("div",{style:{fontSize:13,opacity:.9},children:s.description})]}):s}static buildOptions(o,t){const i=t||{},{duration:e,toastId:r,onClick:n,onClose:a}=i,c=s(i,["duration","toastId","onClick","onClose"]);return Object.assign(Object.assign(Object.assign({},o),c),{toastId:r,autoClose:void 0!==e?e||!1:o.autoClose,onClick:n,onClose:a})}static success(s,o){const i=this.getConfigs(),e=this.formatMessage(s),r=this.buildOptions(i.successConfig,o);return t.success(e,r)}static error(s,o){const i=this.getConfigs(),e=this.formatMessage(s),r=this.buildOptions(i.errorConfig,o);return t.error(e,r)}static warning(s,o){const i=this.getConfigs(),e=this.formatMessage(s),r=this.buildOptions(i.warningConfig,o);return t.warning(e,r)}static info(s,o){const i=this.getConfigs(),e=this.formatMessage(s),r=this.buildOptions(i.infoConfig,o);return t.info(e,r)}static loading(o,i){const e=this.getConfigs(),r=this.formatMessage(o),n=i||{},{toastId:a,onClick:c,onClose:l}=n,g=s(n,["toastId","onClick","onClose"]);return t.loading(r,Object.assign(Object.assign(Object.assign({},e.loadingConfig),g),{toastId:a,onClick:c,onClose:l}))}static update(s,o){var i;const e=this.getConfigs(),r=o.type?{success:e.successConfig,error:e.errorConfig,warning:e.warningConfig,info:e.infoConfig}[o.type]:void 0,n=o.message?this.formatMessage(o.message):o.render;t.update(s,Object.assign({render:n,type:o.type,isLoading:!1,autoClose:null!==(i=o.autoClose)&&void 0!==i?i:null==r?void 0:r.autoClose},r))}static dismiss(s){t.dismiss(s)}static dismissAll(){t.dismiss()}static isActive(s){return t.isActive(s)}}l.configs=null;export{l as T,c as b};
|
|
2
|
-
//# sourceMappingURL=tembo-notify-oZJrH2OE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tembo-notify-oZJrH2OE.js","sources":["../src/features/notifications/toast-config.tsx","../src/features/notifications/tembo-notify.tsx"],"sourcesContent":[null,null],"names":["buildToastConfigs","colors","constants","baseConfig","position","autoClose","hideProgressBar","closeOnClick","pauseOnHover","draggable","style","fontFamily","typography","fontSize","borderRadius","padding","boxShadow","border","minHeight","successConfig","Object","assign","icon","_jsx","CheckCircleOutlined","color","success","main","backgroundColor","surface","borderColor","text","primary","className","progressClassName","errorConfig","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","info","loadingConfig","LoadingOutlined","closeButton","TemboNotify","init","this","configs","getConfigs","Error","formatMessage","message","_jsxs","display","flexDirection","gap","children","fontWeight","title","description","opacity","buildOptions","options","_a","duration","toastId","onClick","onClose","restOptions","__rest","undefined","content","toastOptions","toast","loading","update","id","config","type","render","isLoading","dism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