@temboplus/frontend-react-core 0.1.3-beta.1 → 0.1.3-beta.10

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.
Files changed (62) hide show
  1. package/dist/{ZoomOutOutlined-BY_CCwq7.js → ZoomOutOutlined-CW-jqBMI.js} +2 -2
  2. package/dist/{ZoomOutOutlined-BY_CCwq7.js.map → ZoomOutOutlined-CW-jqBMI.js.map} +1 -1
  3. package/dist/{ZoomOutOutlined-BL6A5RSq.js → ZoomOutOutlined-Pw8hpWWK.js} +2 -2
  4. package/dist/{ZoomOutOutlined-BL6A5RSq.js.map → ZoomOutOutlined-Pw8hpWWK.js.map} +1 -1
  5. package/dist/alerts/index.cjs.js +1 -1
  6. package/dist/alerts/index.d.ts +1 -0
  7. package/dist/alerts/index.js +1 -1
  8. package/dist/dialogs/index.cjs.js +1 -1
  9. package/dist/dialogs/index.d.ts +1 -0
  10. package/dist/dialogs/index.js +1 -1
  11. package/dist/features/alerts/alert.js +95 -0
  12. package/dist/features/alerts/index.js +1 -0
  13. package/dist/features/dialogs/index.js +1 -0
  14. package/dist/features/dialogs/modal-provider.js +6 -0
  15. package/dist/features/dialogs/tembo-confirm.js +111 -0
  16. package/dist/features/input-validation/account-name-validator.js +28 -0
  17. package/dist/features/input-validation/account-number-validator.js +65 -0
  18. package/dist/features/input-validation/amount-validator.js +100 -0
  19. package/dist/features/input-validation/index.js +5 -0
  20. package/dist/features/input-validation/phone-number-validator.js +79 -0
  21. package/dist/features/input-validation/swift-code-validator.js +38 -0
  22. package/dist/features/notifications/index.js +3 -0
  23. package/dist/features/notifications/tembo-notify.d.ts +29 -103
  24. package/dist/features/notifications/tembo-notify.js +140 -0
  25. package/dist/features/notifications/toast-config.d.ts +1 -4
  26. package/dist/features/notifications/toast-config.js +60 -0
  27. package/dist/features/notifications/toast-container.d.ts +13 -3
  28. package/dist/features/notifications/toast-container.js +89 -0
  29. package/dist/index.cjs.js +1 -1
  30. package/dist/index.cjs.js.map +1 -1
  31. package/dist/index.esm.js +1 -1
  32. package/dist/index.esm.js.map +1 -1
  33. package/dist/index.js +1 -0
  34. package/dist/notifications/index.cjs.js +1 -1
  35. package/dist/notifications/index.d.ts +1 -0
  36. package/dist/notifications/index.js +1 -1
  37. package/dist/providers.js +32 -0
  38. package/dist/tembo-notify-Bp14qngd.js +2 -0
  39. package/dist/tembo-notify-Bp14qngd.js.map +1 -0
  40. package/dist/tembo-notify-h5Xn66oA.js +2 -0
  41. package/dist/tembo-notify-h5Xn66oA.js.map +1 -0
  42. package/dist/theme/colors.d.ts +55 -23
  43. package/dist/theme/colors.js +212 -0
  44. package/dist/theme/constants.js +82 -0
  45. package/dist/theme/index.cjs.js +1 -1
  46. package/dist/theme/index.js +1 -1
  47. package/dist/theme/theme-provider.d.ts +18 -6
  48. package/dist/theme/theme-provider.js +404 -0
  49. package/dist/theme-provider-Ca4P0Hcp.js +11 -0
  50. package/dist/theme-provider-Ca4P0Hcp.js.map +1 -0
  51. package/dist/theme-provider-RhAw3jw_.js +11 -0
  52. package/dist/theme-provider-RhAw3jw_.js.map +1 -0
  53. package/dist/validation/index.d.ts +1 -0
  54. package/package.json +5 -2
  55. package/dist/tembo-notify-C-QGduBt.js +0 -2
  56. package/dist/tembo-notify-C-QGduBt.js.map +0 -1
  57. package/dist/tembo-notify-D-uOV3t0.js +0 -2
  58. package/dist/tembo-notify-D-uOV3t0.js.map +0 -1
  59. package/dist/theme-provider-D_oV1J_K.js +0 -11
  60. package/dist/theme-provider-D_oV1J_K.js.map +0 -1
  61. package/dist/theme-provider-Dqvy24OD.js +0 -11
  62. package/dist/theme-provider-Dqvy24OD.js.map +0 -1
@@ -1,124 +1,50 @@
1
1
  import { ToastOptions, ToastContent, Id } from 'react-toastify';
2
2
  import { TemboColorPalette, TemboUIConstants } from '../../theme/index.js';
3
- export interface NotifyOptions {
4
- /**
5
- * Duration in milliseconds before auto-closing (default: 4000 for most, 6000 for errors)
6
- * Set to false to prevent auto-close
7
- */
3
+ /**
4
+ * Message input - can be simple string or object with title and description
5
+ */
6
+ export type NotifyMessage = ToastContent | {
7
+ title?: string;
8
+ description?: string;
9
+ };
10
+ export interface NotifyOptions extends Omit<ToastOptions, 'type'> {
11
+ toastId?: Id;
8
12
  duration?: number | false;
9
- /**
10
- * Custom position for the notification
11
- */
12
- position?: ToastOptions['position'];
13
- /**
14
- * Callback when notification is clicked
15
- */
16
13
  onClick?: () => void;
17
- /**
18
- * Callback when notification is closed
19
- */
20
14
  onClose?: () => void;
21
15
  }
22
16
  /**
23
17
  * TemboNotify - Unified notification system
24
- *
25
- * Wraps react-toastify with consistent styling and behavior
26
- * aligned with Tembo's design system.
27
- *
28
- * Note: This class needs to be initialized with theme tokens before use.
29
- * Call TemboNotify.init(colors, constants) in your app setup.
30
- *
31
- * @example
32
- * ```typescript
33
- * // In your app setup (e.g., App.tsx)
34
- * const { colors, constants } = useTemboTheme();
35
- * useEffect(() => {
36
- * TemboNotify.init(colors, constants);
37
- * }, [colors, constants]);
38
- *
39
- * // Then use anywhere in your app
40
- * TemboNotify.success('Payment sent successfully!');
41
- *
42
- * // With options
43
- * TemboNotify.error('Payment failed', {
44
- * duration: 8000,
45
- * onClick: () => console.log('Error clicked')
46
- * });
47
- *
48
- * // Loading with promise
49
- * const loadingId = TemboNotify.loading('Processing payment...');
50
- * await processPayment();
51
- * TemboNotify.success('Payment complete!', { id: loadingId });
52
- *
53
- * // Promise-based
54
- * TemboNotify.promise(
55
- * apiCall(),
56
- * {
57
- * pending: 'Processing...',
58
- * success: 'Done!',
59
- * error: 'Failed!'
60
- * }
61
- * );
62
- * ```
63
18
  */
64
19
  export declare class TemboNotify {
65
20
  private static configs;
66
- /**
67
- * Initialize TemboNotify with theme tokens
68
- * Must be called before using any notification methods
69
- */
70
21
  static init(colors: TemboColorPalette, constants: TemboUIConstants): void;
71
- /**
72
- * Get current toast configs, throws if not initialized
73
- */
74
22
  private static getConfigs;
75
23
  /**
76
- * Display a success notification
77
- */
78
- static success(message: ToastContent, options?: NotifyOptions): Id;
79
- /**
80
- * Display an error notification
81
- */
82
- static error(message: ToastContent, options?: NotifyOptions): Id;
83
- /**
84
- * Display a warning notification
85
- */
86
- static warning(message: ToastContent, options?: NotifyOptions): Id;
87
- /**
88
- * Display an info notification
89
- */
90
- static info(message: ToastContent, options?: NotifyOptions): Id;
91
- /**
92
- * Display a loading notification
93
- * Returns an ID that can be used to update/dismiss it
94
- */
95
- static loading(message: ToastContent, options?: Omit<NotifyOptions, 'duration'>): Id;
96
- /**
97
- * Update an existing notification
98
- */
24
+ * Format message content for display
25
+ * - title only → bold
26
+ * - description only weight 500
27
+ * - title + description → stacked
28
+ */
29
+ private static formatMessage;
30
+ private static buildOptions;
31
+ private static getSuccessConfig;
32
+ private static getErrorConfig;
33
+ private static getWarningConfig;
34
+ private static getInfoConfig;
35
+ private static getLoadingConfig;
36
+ static success(message: NotifyMessage, options?: NotifyOptions): Id;
37
+ static error(message: NotifyMessage, options?: NotifyOptions): Id;
38
+ static warning(message: NotifyMessage, options?: NotifyOptions): Id;
39
+ static info(message: NotifyMessage, options?: NotifyOptions): Id;
40
+ static loading(message: NotifyMessage, options?: Omit<NotifyOptions, 'duration'>): Id;
99
41
  static update(id: Id, options: {
100
42
  type?: 'success' | 'error' | 'warning' | 'info';
101
- message?: ToastContent;
43
+ message?: NotifyMessage;
102
44
  autoClose?: number | false;
45
+ render?: ToastContent;
103
46
  }): void;
104
- /**
105
- * Dismiss a specific notification by ID
106
- */
107
- static dismiss(id: Id): void;
108
- /**
109
- * Dismiss all notifications
110
- */
47
+ static dismiss(id?: Id): void;
111
48
  static dismissAll(): void;
112
- /**
113
- * Check if a notification is active
114
- */
115
49
  static isActive(id: Id): boolean;
116
- /**
117
- * Handle promise-based operations with notifications
118
- */
119
- static promise<T>(promise: Promise<T>, messages: {
120
- pending: ToastContent;
121
- success: ToastContent<T>;
122
- error: ToastContent | ((error: any) => ToastContent);
123
- }, options?: NotifyOptions): Promise<T>;
124
50
  }
@@ -0,0 +1,140 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { toast } from 'react-toastify';
4
+ import { buildToastConfigs } from './toast-config.js';
5
+ /**
6
+ * Simple fallback config when TemboNotify.init hasn't been called yet.
7
+ */
8
+ const FALLBACK_BASE_CONFIG = {
9
+ position: 'top-right',
10
+ autoClose: 4000, // ~4 seconds for everything except loading
11
+ hideProgressBar: true,
12
+ closeOnClick: true,
13
+ pauseOnHover: true,
14
+ draggable: true,
15
+ closeButton: false,
16
+ };
17
+ /**
18
+ * TemboNotify - Unified notification system
19
+ */
20
+ export class TemboNotify {
21
+ static init(colors, constants) {
22
+ this.configs = buildToastConfigs(colors, constants);
23
+ }
24
+ static getConfigs() {
25
+ return this.configs;
26
+ }
27
+ /**
28
+ * Format message content for display
29
+ * - title only → bold
30
+ * - description only → weight 500
31
+ * - title + description → stacked
32
+ */
33
+ static formatMessage(message) {
34
+ if (message && typeof message === 'object' && !('$$typeof' in message)) {
35
+ const hasTitle = !!message.title;
36
+ const hasDescription = !!message.description;
37
+ if (hasTitle && hasDescription) {
38
+ return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsx("div", { style: { fontWeight: 600, fontSize: 14 }, children: message.title }), _jsx("div", { style: { fontSize: 13, fontWeight: 400, opacity: 0.95 }, children: message.description })] }));
39
+ }
40
+ if (hasTitle && !hasDescription) {
41
+ return (_jsx("div", { style: { fontWeight: 600, fontSize: 14 }, children: message.title }));
42
+ }
43
+ if (!hasTitle && hasDescription) {
44
+ return (_jsx("div", { style: { fontSize: 13, fontWeight: 500 }, children: message.description }));
45
+ }
46
+ // Empty object case
47
+ return '';
48
+ }
49
+ return message;
50
+ }
51
+ static buildOptions(baseConfig, options) {
52
+ const _a = options || {}, { duration, toastId, onClick, onClose } = _a, restOptions = __rest(_a, ["duration", "toastId", "onClick", "onClose"]);
53
+ const effectiveBase = baseConfig !== null && baseConfig !== void 0 ? baseConfig : FALLBACK_BASE_CONFIG;
54
+ return Object.assign(Object.assign(Object.assign({}, effectiveBase), restOptions), { // includes custom icon if provided
55
+ toastId, autoClose: duration !== undefined
56
+ ? duration || false
57
+ : effectiveBase.autoClose, onClick,
58
+ onClose });
59
+ }
60
+ static getSuccessConfig() {
61
+ var _a, _b;
62
+ const configs = this.getConfigs();
63
+ 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;
64
+ }
65
+ static getErrorConfig() {
66
+ var _a, _b;
67
+ const configs = this.getConfigs();
68
+ 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;
69
+ }
70
+ static getWarningConfig() {
71
+ var _a, _b;
72
+ const configs = this.getConfigs();
73
+ 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;
74
+ }
75
+ static getInfoConfig() {
76
+ var _a, _b;
77
+ const configs = this.getConfigs();
78
+ 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;
79
+ }
80
+ static getLoadingConfig() {
81
+ var _a, _b;
82
+ const configs = this.getConfigs();
83
+ 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;
84
+ }
85
+ static success(message, options) {
86
+ const content = this.formatMessage(message);
87
+ const toastOptions = this.buildOptions(this.getSuccessConfig(), options);
88
+ return toast.success(content, toastOptions);
89
+ }
90
+ static error(message, options) {
91
+ const content = this.formatMessage(message);
92
+ const toastOptions = this.buildOptions(this.getErrorConfig(), options);
93
+ return toast.error(content, toastOptions);
94
+ }
95
+ static warning(message, options) {
96
+ const content = this.formatMessage(message);
97
+ const toastOptions = this.buildOptions(this.getWarningConfig(), options);
98
+ return toast.warning(content, toastOptions);
99
+ }
100
+ static info(message, options) {
101
+ const content = this.formatMessage(message);
102
+ const toastOptions = this.buildOptions(this.getInfoConfig(), options);
103
+ return toast.info(content, toastOptions);
104
+ }
105
+ static loading(message, options) {
106
+ var _a;
107
+ const content = this.formatMessage(message);
108
+ const _b = options || {}, { toastId, onClick, onClose } = _b, restOptions = __rest(_b, ["toastId", "onClick", "onClose"]);
109
+ const baseConfig = (_a = this.getLoadingConfig()) !== null && _a !== void 0 ? _a : FALLBACK_BASE_CONFIG;
110
+ return toast.loading(content, Object.assign(Object.assign(Object.assign({}, baseConfig), restOptions), { toastId,
111
+ onClick,
112
+ onClose }));
113
+ }
114
+ static update(id, options) {
115
+ var _a, _b;
116
+ const configs = this.getConfigs();
117
+ const typeConfig = options.type && configs
118
+ ? {
119
+ success: configs.successConfig,
120
+ error: configs.errorConfig,
121
+ warning: configs.warningConfig,
122
+ info: configs.infoConfig,
123
+ }[options.type]
124
+ : undefined;
125
+ const content = options.message
126
+ ? this.formatMessage(options.message)
127
+ : options.render;
128
+ 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 }, (typeConfig !== null && typeConfig !== void 0 ? typeConfig : {})));
129
+ }
130
+ static dismiss(id) {
131
+ toast.dismiss(id);
132
+ }
133
+ static dismissAll() {
134
+ toast.dismiss();
135
+ }
136
+ static isActive(id) {
137
+ return toast.isActive(id);
138
+ }
139
+ }
140
+ TemboNotify.configs = null;
@@ -1,9 +1,5 @@
1
1
  import { ToastOptions } from 'react-toastify';
2
2
  import { TemboColorPalette, TemboUIConstants } from '../../theme/index.js';
3
- /**
4
- * Build toast configurations from theme tokens
5
- * This function is called with theme values to generate toast configs
6
- */
7
3
  export declare const buildToastConfigs: (colors: TemboColorPalette, constants: TemboUIConstants) => {
8
4
  loadingConfig: ToastOptions<unknown>;
9
5
  infoConfig: ToastOptions<unknown>;
@@ -11,5 +7,6 @@ export declare const buildToastConfigs: (colors: TemboColorPalette, constants: T
11
7
  errorConfig: ToastOptions<unknown>;
12
8
  successConfig: ToastOptions<unknown>;
13
9
  baseConfig: ToastOptions<unknown>;
10
+ colors: TemboColorPalette;
14
11
  };
15
12
  export type ToastConfigs = ReturnType<typeof buildToastConfigs>;
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CheckCircleOutlined, CloseCircleOutlined, ExclamationCircleOutlined, InfoCircleOutlined, LoadingOutlined, } from '@ant-design/icons';
3
+ export const buildToastConfigs = (colors, constants) => {
4
+ /**
5
+ * Base = WHITE background for everything unless overridden
6
+ */
7
+ const baseConfig = {
8
+ position: 'top-right',
9
+ autoClose: 4000,
10
+ hideProgressBar: true,
11
+ closeOnClick: true,
12
+ pauseOnHover: true,
13
+ draggable: true,
14
+ closeButton: false,
15
+ style: {
16
+ fontFamily: constants.typography.fontFamily,
17
+ fontSize: 14,
18
+ borderRadius: 10,
19
+ padding: '10px 14px',
20
+ boxShadow: '0 12px 24px rgba(15, 23, 42, 0.12)',
21
+ border: 'none',
22
+ minHeight: 56,
23
+ backgroundColor: colors.surface.elevated,
24
+ color: colors.text.primary,
25
+ display: 'flex',
26
+ alignItems: 'center',
27
+ gap: 8,
28
+ },
29
+ };
30
+ /**
31
+ * SUCCESS → success colors
32
+ */
33
+ const successConfig = Object.assign(Object.assign({}, baseConfig), { icon: (_jsx(CheckCircleOutlined, { style: { fontSize: 18, color: colors.success.main } })), style: Object.assign(Object.assign({}, baseConfig.style), { backgroundColor: colors.success.bg, color: colors.success.text }), className: 'toast-success' });
34
+ /**
35
+ * ERROR → error colors
36
+ */
37
+ const errorConfig = Object.assign(Object.assign({}, baseConfig), { icon: (_jsx(CloseCircleOutlined, { style: { fontSize: 18, color: colors.error.main } })), style: Object.assign(Object.assign({}, baseConfig.style), { backgroundColor: colors.error.bg, color: colors.error.text }), className: 'toast-error' });
38
+ /**
39
+ * WARNING → warning colors
40
+ */
41
+ const warningConfig = Object.assign(Object.assign({}, baseConfig), { icon: (_jsx(ExclamationCircleOutlined, { style: { fontSize: 18, color: colors.warning.main } })), style: Object.assign(Object.assign({}, baseConfig.style), { backgroundColor: colors.warning.bg, color: colors.warning.text }), className: 'toast-warning' });
42
+ /**
43
+ * INFO → *white background*, blue accents only
44
+ * (no colored background)
45
+ */
46
+ const infoConfig = Object.assign(Object.assign({}, baseConfig), { icon: (_jsx(InfoCircleOutlined, { style: { fontSize: 18, color: colors.info.main } })), style: Object.assign(Object.assign({}, baseConfig.style), { backgroundColor: colors.surface.elevated, color: colors.text.primary }), className: 'toast-info' });
47
+ /**
48
+ * LOADING (unchanged)
49
+ */
50
+ const loadingConfig = Object.assign(Object.assign({}, baseConfig), { icon: (_jsx(LoadingOutlined, { style: { fontSize: 18, color: colors.primary.main } })), style: Object.assign(Object.assign({}, baseConfig.style), { backgroundColor: colors.surface.elevated, color: colors.text.primary }), autoClose: false, closeButton: false, hideProgressBar: true, className: 'toast-loading' });
51
+ return {
52
+ loadingConfig,
53
+ infoConfig,
54
+ warningConfig,
55
+ errorConfig,
56
+ successConfig,
57
+ baseConfig,
58
+ colors,
59
+ };
60
+ };
@@ -1,9 +1,19 @@
1
1
  import React from 'react';
2
2
  import { ToastContainerProps as RTToastContainerProps } from 'react-toastify';
3
- export type TemboToastContainerProps = RTToastContainerProps;
3
+ export interface TemboToastContainerProps extends Omit<RTToastContainerProps, 'closeButton' | 'hideProgressBar'> {
4
+ /**
5
+ * Show the X close button on each toast
6
+ * @default false
7
+ */
8
+ showCloseButton?: boolean;
9
+ /**
10
+ * Show the progress bar at the bottom of each toast
11
+ * @default false
12
+ */
13
+ showProgressBar?: boolean;
14
+ }
4
15
  /**
5
- * Toast container that automatically initializes TemboNotify with current theme
6
- * Reinitializes when theme changes to respect color/constant overrides
16
+ * Toast container with Tembo styling
7
17
  */
8
18
  declare const TemboToastContainer: React.FC<TemboToastContainerProps>;
9
19
  export default TemboToastContainer;
@@ -0,0 +1,89 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect } from 'react';
4
+ import { ToastContainer, } from 'react-toastify';
5
+ import { useTemboTheme } from '../../theme/index.js';
6
+ import { TemboNotify } from './tembo-notify.js';
7
+ /**
8
+ * Toast container with Tembo styling
9
+ */
10
+ const TemboToastContainer = (_a) => {
11
+ var { showCloseButton = false, showProgressBar = false } = _a, rest = __rest(_a, ["showCloseButton", "showProgressBar"]);
12
+ const { colors, constants } = useTemboTheme();
13
+ useEffect(() => {
14
+ TemboNotify.init(colors, constants);
15
+ }, [colors, constants]);
16
+ return (_jsxs(_Fragment, { children: [_jsx(ToastContainer, Object.assign({ closeButton: showCloseButton, hideProgressBar: !showProgressBar }, rest)), _jsx("style", { children: `
17
+ .Toastify__toast {
18
+ font-family: ${constants.typography.fontFamily};
19
+ line-height: 1.5;
20
+ display: flex;
21
+ align-items: center; /* center icon + content */
22
+ }
23
+
24
+ .Toastify__toast-body {
25
+ padding: 0;
26
+ margin: 0;
27
+ display: flex;
28
+ align-items: flex-start;
29
+ }
30
+
31
+ .Toastify__toast-icon {
32
+ width: 18px;
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ margin-inline-end: 6px; /* tighter spacing */
37
+ }
38
+
39
+ .Toastify__progress-bar {
40
+ display: none;
41
+ }
42
+
43
+ .Toastify__close-button {
44
+ opacity: 0.5;
45
+ transition: opacity 0.2s ease;
46
+ }
47
+
48
+ .Toastify__close-button:hover {
49
+ opacity: 1;
50
+ }
51
+
52
+ /* Force progress bar hidden in case someone enables it unintentionally */
53
+ .Toastify__progress-bar {
54
+ display: none;
55
+ }
56
+
57
+ /* Smooth entrance animation */
58
+ @keyframes toastSlideIn {
59
+ from {
60
+ transform: translateX(110%);
61
+ opacity: 0;
62
+ }
63
+ to {
64
+ transform: translateX(0);
65
+ opacity: 1;
66
+ }
67
+ }
68
+
69
+ .Toastify__toast--top-right {
70
+ animation: toastSlideIn 0.3s ease-out;
71
+ }
72
+
73
+ /* Optional: full-width mobile behaviour */
74
+ @media (max-width: 480px) {
75
+ .Toastify__toast-container--top-right {
76
+ right: 0;
77
+ left: 0;
78
+ padding: 0;
79
+ width: 100vw;
80
+ }
81
+
82
+ .Toastify__toast {
83
+ margin-bottom: 0;
84
+ border-radius: 0;
85
+ }
86
+ }
87
+ ` })] }));
88
+ };
89
+ export default TemboToastContainer;
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("./theme-provider-Dqvy24OD.js"),r=require("@ebay/nice-modal-react"),t=require("react"),s=require("react-toastify");require("lodash");var i=require("./tembo-notify-D-uOV3t0.js");function o(e){return e&&e.__esModule?e:{default:e}}require("antd"),require("./InfoCircleOutlined-B7d2aRfV.js"),require("./ZoomOutOutlined-BY_CCwq7.js");var n=o(r);const u=r=>e.jsxRuntimeExports.jsx(n.default.Provider,{children:r.children}),c=r=>{const{colors:o,constants:n}=e.useTemboTheme();return t.useEffect(()=>{i.TemboNotify.init(o,n)},[o,n]),e.jsxRuntimeExports.jsx(s.ToastContainer,Object.assign({},r))};exports.TemboUIProviders=({children:r,colors:t,constants:s,themeOverrides:i})=>e.jsxRuntimeExports.jsx(e.TemboThemeProvider,{colors:t,constants:s,themeOverrides:i,children:e.jsxRuntimeExports.jsxs(u,{children:[r,e.jsxRuntimeExports.jsx(c,{})]})});
1
+ "use strict";var n=require("./theme-provider-RhAw3jw_.js"),t=require("@ebay/nice-modal-react"),e=require("tslib"),s=require("react"),o=require("react-toastify");require("lodash");var r=require("./tembo-notify-Bp14qngd.js");function i(n){return n&&n.__esModule?n:{default:n}}require("antd"),require("./InfoCircleOutlined-B7d2aRfV.js"),require("./ZoomOutOutlined-CW-jqBMI.js");var a=i(t);const l=t=>n.jsxRuntimeExports.jsx(a.default.Provider,{children:t.children}),c=t=>{var{showCloseButton:i=!1,showProgressBar:a=!1}=t,l=e.__rest(t,["showCloseButton","showProgressBar"]);const{colors:c,constants:d}=n.useTemboTheme();return s.useEffect(()=>{r.TemboNotify.init(c,d)},[c,d]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(o.ToastContainer,Object.assign({closeButton:i,hideProgressBar:!a},l)),n.jsxRuntimeExports.jsx("style",{children:`\n .Toastify__toast {\n font-family: ${d.typography.fontFamily};\n line-height: 1.5;\n display: flex;\n align-items: center; /* center icon + content */\n }\n\n .Toastify__toast-body {\n padding: 0;\n margin: 0;\n display: flex;\n align-items: flex-start;\n }\n\n .Toastify__toast-icon {\n width: 18px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-inline-end: 6px; /* tighter spacing */\n }\n\n .Toastify__progress-bar {\n display: none;\n }\n\n .Toastify__close-button {\n opacity: 0.5;\n transition: opacity 0.2s ease;\n }\n\n .Toastify__close-button:hover {\n opacity: 1;\n }\n\n /* Force progress bar hidden in case someone enables it unintentionally */\n .Toastify__progress-bar {\n display: none;\n }\n\n /* Smooth entrance animation */\n @keyframes toastSlideIn {\n from {\n transform: translateX(110%);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n\n .Toastify__toast--top-right {\n animation: toastSlideIn 0.3s ease-out;\n }\n\n /* Optional: full-width mobile behaviour */\n @media (max-width: 480px) {\n .Toastify__toast-container--top-right {\n right: 0;\n left: 0;\n padding: 0;\n width: 100vw;\n }\n\n .Toastify__toast {\n margin-bottom: 0;\n border-radius: 0;\n }\n }\n `})]})};exports.TemboUIProviders=({children:t,colors:e,constants:s,themeOverrides:o})=>n.jsxRuntimeExports.jsx(n.TemboThemeProvider,{colors:e,constants:s,themeOverrides:o,children:n.jsxRuntimeExports.jsxs(l,{children:[t,n.jsxRuntimeExports.jsx(c,{})]})});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -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","ToastContainer","Object","assign","themeOverrides","TemboThemeProvider","_jsxs"],"mappings":"+WAGA,MAAMA,EAAmDC,GAC9CC,EAAAA,kBAAAA,IAACC,EAAAA,QAAUC,mBAAUH,EAAMI,WCOhCC,EAA2DL,IAC7D,MAAMM,OAAEA,EAAMC,UAAEA,GAAcC,kBAO9B,OAJAC,EAAAA,UAAU,KACNC,cAAYC,KAAKL,EAAQC,IAC1B,CAACD,EAAQC,IAELN,EAAAA,kBAAAA,IAACW,EAAAA,eAAcC,OAAAC,OAAA,CAAA,EAAKd,8BCwBkC,EAC7DI,WACAE,SACAC,YACAQ,oBAGId,EAAAA,kBAAAA,IAACe,qBAAkB,CACfV,OAAQA,EACRC,UAAWA,EACXQ,eAAgBA,EAAcX,SAE9Ba,EAAAA,kBAAAA,KAAClB,EAAkB,CAAAK,SAAA,CACdA,EACDH,EAAAA,kBAAAA,IAACI,EAAmB,CAAA"}
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","_a","showCloseButton","showProgressBar","rest","__rest","colors","constants","useTemboTheme","useEffect","TemboNotify","init","_jsxs","_Fragment","ToastContainer","Object","assign","closeButton","hideProgressBar","typography","fontFamily","themeOverrides","TemboThemeProvider"],"mappings":"kYAGA,MAAMA,EAAmDC,GAC9CC,EAAAA,kBAAAA,IAACC,EAAAA,QAAUC,mBAAUH,EAAMI,WCsBhCC,EAA2DC,IAAA,IAAAC,gBAC7DA,GAAkB,EAAKC,gBACvBA,GAAkB,GAAKF,EACpBG,EAAIC,EAAAA,OAAAJ,EAHsD,CAAA,kBAAA,oBAK7D,MAAMK,OAAEA,EAAMC,UAAEA,GAAcC,kBAM9B,OAJAC,EAAAA,UAAU,KACNC,cAAYC,KAAKL,EAAQC,IAC1B,CAACD,EAAQC,IAGRK,EAAAA,kBAAAA,KAAAC,EAAAA,kBAAAA,SAAA,CAAAd,SAAA,CACIH,EAAAA,kBAAAA,IAACkB,EAAAA,eAAcC,OAAAC,OAAA,CACXC,YAAaf,EACbgB,iBAAkBf,GACdC,IAGRR,EAAAA,kBAAAA,IAAA,QAAA,CAAAG,SAAQ,0EAEeQ,EAAUY,WAAWC,ovECJS,EAC7DrB,WACAO,SACAC,YACAc,oBAGIzB,EAAAA,kBAAAA,IAAC0B,qBAAkB,CACfhB,OAAQA,EACRC,UAAWA,EACXc,eAAgBA,EAActB,SAE9Ba,EAAAA,kBAAAA,KAAClB,EAAkB,CAAAK,SAAA,CACdA,EACDH,EAAAA,kBAAAA,IAACI,EAAmB,CAAA"}
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{j as r,u as o,T as t}from"./theme-provider-D_oV1J_K.js";import s from"@ebay/nice-modal-react";import{useEffect as e}from"react";import{ToastContainer as i}from"react-toastify";import"lodash";import{T as n}from"./tembo-notify-C-QGduBt.js";import"antd";import"./InfoCircleOutlined-DYs90hdV.js";import"./ZoomOutOutlined-BL6A5RSq.js";const m=o=>r.jsx(s.Provider,{children:o.children}),c=t=>{const{colors:s,constants:m}=o();return e(()=>{n.init(s,m)},[s,m]),r.jsx(i,Object.assign({},t))},a=({children:o,colors:s,constants:e,themeOverrides:i})=>r.jsx(t,{colors:s,constants:e,themeOverrides:i,children:r.jsxs(m,{children:[o,r.jsx(c,{})]})});export{a as TemboUIProviders};
1
+ import{j as n,u as t,T as o}from"./theme-provider-Ca4P0Hcp.js";import i from"@ebay/nice-modal-react";import{__rest as s}from"tslib";import{useEffect as e}from"react";import{ToastContainer as r}from"react-toastify";import"lodash";import{T as a}from"./tembo-notify-h5Xn66oA.js";import"antd";import"./InfoCircleOutlined-DYs90hdV.js";import"./ZoomOutOutlined-Pw8hpWWK.js";const l=t=>n.jsx(i.Provider,{children:t.children}),m=o=>{var{showCloseButton:i=!1,showProgressBar:l=!1}=o,m=s(o,["showCloseButton","showProgressBar"]);const{colors:c,constants:d}=t();return e(()=>{a.init(c,d)},[c,d]),n.jsxs(n.Fragment,{children:[n.jsx(r,Object.assign({closeButton:i,hideProgressBar:!l},m)),n.jsx("style",{children:`\n .Toastify__toast {\n font-family: ${d.typography.fontFamily};\n line-height: 1.5;\n display: flex;\n align-items: center; /* center icon + content */\n }\n\n .Toastify__toast-body {\n padding: 0;\n margin: 0;\n display: flex;\n align-items: flex-start;\n }\n\n .Toastify__toast-icon {\n width: 18px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-inline-end: 6px; /* tighter spacing */\n }\n\n .Toastify__progress-bar {\n display: none;\n }\n\n .Toastify__close-button {\n opacity: 0.5;\n transition: opacity 0.2s ease;\n }\n\n .Toastify__close-button:hover {\n opacity: 1;\n }\n\n /* Force progress bar hidden in case someone enables it unintentionally */\n .Toastify__progress-bar {\n display: none;\n }\n\n /* Smooth entrance animation */\n @keyframes toastSlideIn {\n from {\n transform: translateX(110%);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n\n .Toastify__toast--top-right {\n animation: toastSlideIn 0.3s ease-out;\n }\n\n /* Optional: full-width mobile behaviour */\n @media (max-width: 480px) {\n .Toastify__toast-container--top-right {\n right: 0;\n left: 0;\n padding: 0;\n width: 100vw;\n }\n\n .Toastify__toast {\n margin-bottom: 0;\n border-radius: 0;\n }\n }\n `})]})},c=({children:t,colors:i,constants:s,themeOverrides:e})=>n.jsx(o,{colors:i,constants:s,themeOverrides:e,children:n.jsxs(l,{children:[t,n.jsx(m,{})]})});export{c as TemboUIProviders};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -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","ToastContainer","Object","assign","TemboUIProviders","themeOverrides","TemboThemeProvider","_jsxs"],"mappings":"iVAGA,MAAMA,EAAmDC,GAC9CC,EAAAA,IAACC,EAAUC,mBAAUH,EAAMI,WCOhCC,EAA2DL,IAC7D,MAAMM,OAAEA,EAAMC,UAAEA,GAAcC,IAO9B,OAJAC,EAAU,KACNC,EAAYC,KAAKL,EAAQC,IAC1B,CAACD,EAAQC,IAELN,EAAAA,IAACW,EAAcC,OAAAC,OAAA,CAAA,EAAKd,KCwBlBe,EAAoD,EAC7DX,WACAE,SACAC,YACAS,oBAGIf,EAAAA,IAACgB,EAAkB,CACfX,OAAQA,EACRC,UAAWA,EACXS,eAAgBA,EAAcZ,SAE9Bc,EAAAA,KAACnB,EAAkB,CAAAK,SAAA,CACdA,EACDH,EAAAA,IAACI,EAAmB,CAAA"}
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","_a","showCloseButton","showProgressBar","rest","__rest","colors","constants","useTemboTheme","useEffect","TemboNotify","init","_jsxs","_Fragment","ToastContainer","Object","assign","closeButton","hideProgressBar","typography","fontFamily","TemboUIProviders","themeOverrides","TemboThemeProvider"],"mappings":"gXAGA,MAAMA,EAAmDC,GAC9CC,EAAAA,IAACC,EAAUC,mBAAUH,EAAMI,WCsBhCC,EAA2DC,IAAA,IAAAC,gBAC7DA,GAAkB,EAAKC,gBACvBA,GAAkB,GAAKF,EACpBG,EAAIC,EAAAJ,EAHsD,CAAA,kBAAA,oBAK7D,MAAMK,OAAEA,EAAMC,UAAEA,GAAcC,IAM9B,OAJAC,EAAU,KACNC,EAAYC,KAAKL,EAAQC,IAC1B,CAACD,EAAQC,IAGRK,EAAAA,KAAAC,EAAAA,SAAA,CAAAd,SAAA,CACIH,EAAAA,IAACkB,EAAcC,OAAAC,OAAA,CACXC,YAAaf,EACbgB,iBAAkBf,GACdC,IAGRR,EAAAA,IAAA,QAAA,CAAAG,SAAQ,0EAEeQ,EAAUY,WAAWC,2tECJ3CC,EAAoD,EAC7DtB,WACAO,SACAC,YACAe,oBAGI1B,EAAAA,IAAC2B,EAAkB,CACfjB,OAAQA,EACRC,UAAWA,EACXe,eAAgBA,EAAcvB,SAE9Ba,EAAAA,KAAClB,EAAkB,CAAAK,SAAA,CACdA,EACDH,EAAAA,IAACI,EAAmB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./providers.js";
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../tembo-notify-D-uOV3t0.js");require("../theme-provider-Dqvy24OD.js"),require("react"),require("react-toastify"),require("lodash"),require("../InfoCircleOutlined-B7d2aRfV.js"),require("../ZoomOutOutlined-BY_CCwq7.js"),require("antd"),exports.TemboNotify=e.TemboNotify,exports.buildToastConfigs=e.buildToastConfigs;
1
+ "use strict";var e=require("../tembo-notify-Bp14qngd.js");require("tslib"),require("../theme-provider-RhAw3jw_.js"),require("react"),require("react-toastify"),require("lodash"),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
@@ -0,0 +1 @@
1
+ export * from "../features/notifications";
@@ -1,2 +1,2 @@
1
- export{T as TemboNotify,b as buildToastConfigs}from"../tembo-notify-C-QGduBt.js";import"../theme-provider-D_oV1J_K.js";import"react";import"react-toastify";import"lodash";import"../InfoCircleOutlined-DYs90hdV.js";import"../ZoomOutOutlined-BL6A5RSq.js";import"antd";
1
+ export{T as TemboNotify,b as buildToastConfigs}from"../tembo-notify-h5Xn66oA.js";import"tslib";import"../theme-provider-Ca4P0Hcp.js";import"react";import"react-toastify";import"lodash";import"../InfoCircleOutlined-DYs90hdV.js";import"../ZoomOutOutlined-Pw8hpWWK.js";import"antd";
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import TemboModalProvider from './features/dialogs/modal-provider.js';
3
+ import TemboToastContainer from './features/notifications/toast-container.js';
4
+ import { TemboThemeProvider } from './theme/index.js';
5
+ /**
6
+ * Top-level provider that wires up theme, modal and notifications
7
+ * for all Tembo UI components.
8
+ *
9
+ * Supports theme customization through colors and constants props.
10
+ * TemboToastContainer automatically syncs with theme changes.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * // Basic usage
15
+ * <TemboUIProviders>
16
+ * <App />
17
+ * </TemboUIProviders>
18
+ *
19
+ * // With custom colors
20
+ * <TemboUIProviders
21
+ * colors={{
22
+ * primary: { main: '#007bff' },
23
+ * action: { main: '#28a745' }
24
+ * }}
25
+ * >
26
+ * <App />
27
+ * </TemboUIProviders>
28
+ * ```
29
+ */
30
+ export const TemboUIProviders = ({ children, colors, constants, themeOverrides, }) => {
31
+ return (_jsx(TemboThemeProvider, { colors: colors, constants: constants, themeOverrides: themeOverrides, children: _jsxs(TemboModalProvider, { children: [children, _jsx(TemboToastContainer, {})] }) }));
32
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";var s=require("tslib"),t=require("./theme-provider-RhAw3jw_.js"),o=require("react-toastify"),i=require("./InfoCircleOutlined-B7d2aRfV.js"),e=require("./ZoomOutOutlined-CW-jqBMI.js");const n=(s,o)=>{const n={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1,style:{fontFamily:o.typography.fontFamily,fontSize:14,borderRadius:10,padding:"10px 14px",boxShadow:"0 12px 24px rgba(15, 23, 42, 0.12)",border:"none",minHeight:56,backgroundColor:s.surface.elevated,color:s.text.primary,display:"flex",alignItems:"center",gap:8}},r=Object.assign(Object.assign({},n),{icon:t.jsxRuntimeExports.jsx(i.RefIcon$2,{style:{fontSize:18,color:s.success.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:s.success.bg,color:s.success.text}),className:"toast-success"}),a=Object.assign(Object.assign({},n),{icon:t.jsxRuntimeExports.jsx(i.RefIcon$3,{style:{fontSize:18,color:s.error.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:s.error.bg,color:s.error.text}),className:"toast-error"}),l=Object.assign(Object.assign({},n),{icon:t.jsxRuntimeExports.jsx(i.RefIcon,{style:{fontSize:18,color:s.warning.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:s.warning.bg,color:s.warning.text}),className:"toast-warning"}),c=Object.assign(Object.assign({},n),{icon:t.jsxRuntimeExports.jsx(i.RefIcon$1,{style:{fontSize:18,color:s.info.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:s.surface.elevated,color:s.text.primary}),className:"toast-info"});return{loadingConfig:Object.assign(Object.assign({},n),{icon:t.jsxRuntimeExports.jsx(e.RefIcon$2,{style:{fontSize:18,color:s.primary.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:s.surface.elevated,color:s.text.primary}),autoClose:!1,closeButton:!1,hideProgressBar:!0,className:"toast-loading"}),infoConfig:c,warningConfig:l,errorConfig:a,successConfig:r,baseConfig:n,colors:s}},r={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1};class a{static init(s,t){this.configs=n(s,t)}static getConfigs(){return this.configs}static formatMessage(s){if(s&&"object"==typeof s&&!("$$typeof"in s)){const o=!!s.title,i=!!s.description;return o&&i?t.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxRuntimeExports.jsx("div",{style:{fontWeight:600,fontSize:14},children:s.title}),t.jsxRuntimeExports.jsx("div",{style:{fontSize:13,fontWeight:400,opacity:.95},children:s.description})]}):o&&!i?t.jsxRuntimeExports.jsx("div",{style:{fontWeight:600,fontSize:14},children:s.title}):!o&&i?t.jsxRuntimeExports.jsx("div",{style:{fontSize:13,fontWeight:500},children:s.description}):""}return s}static buildOptions(t,o){const i=o||{},{duration:e,toastId:n,onClick:a,onClose:l}=i,c=s.__rest(i,["duration","toastId","onClick","onClose"]),g=null!=t?t:r;return Object.assign(Object.assign(Object.assign({},g),c),{toastId:n,autoClose:void 0!==e?e||!1:g.autoClose,onClick:a,onClose:l})}static getSuccessConfig(){var s,t;const o=this.getConfigs();return null!==(t=null!==(s=null==o?void 0:o.successConfig)&&void 0!==s?s:null==o?void 0:o.baseConfig)&&void 0!==t?t:void 0}static getErrorConfig(){var s,t;const o=this.getConfigs();return null!==(t=null!==(s=null==o?void 0:o.errorConfig)&&void 0!==s?s:null==o?void 0:o.baseConfig)&&void 0!==t?t:void 0}static getWarningConfig(){var s,t;const o=this.getConfigs();return null!==(t=null!==(s=null==o?void 0:o.warningConfig)&&void 0!==s?s:null==o?void 0:o.baseConfig)&&void 0!==t?t:void 0}static getInfoConfig(){var s,t;const o=this.getConfigs();return null!==(t=null!==(s=null==o?void 0:o.infoConfig)&&void 0!==s?s:null==o?void 0:o.baseConfig)&&void 0!==t?t:void 0}static getLoadingConfig(){var s,t;const o=this.getConfigs();return null!==(t=null!==(s=null==o?void 0:o.loadingConfig)&&void 0!==s?s:null==o?void 0:o.baseConfig)&&void 0!==t?t:void 0}static success(s,t){const i=this.formatMessage(s),e=this.buildOptions(this.getSuccessConfig(),t);return o.toast.success(i,e)}static error(s,t){const i=this.formatMessage(s),e=this.buildOptions(this.getErrorConfig(),t);return o.toast.error(i,e)}static warning(s,t){const i=this.formatMessage(s),e=this.buildOptions(this.getWarningConfig(),t);return o.toast.warning(i,e)}static info(s,t){const i=this.formatMessage(s),e=this.buildOptions(this.getInfoConfig(),t);return o.toast.info(i,e)}static loading(t,i){var e;const n=this.formatMessage(t),a=i||{},{toastId:l,onClick:c,onClose:g}=a,u=s.__rest(a,["toastId","onClick","onClose"]),d=null!==(e=this.getLoadingConfig())&&void 0!==e?e:r;return o.toast.loading(n,Object.assign(Object.assign(Object.assign({},d),u),{toastId:l,onClick:c,onClose:g}))}static update(s,t){var i,e;const n=this.getConfigs(),a=t.type&&n?{success:n.successConfig,error:n.errorConfig,warning:n.warningConfig,info:n.infoConfig}[t.type]:void 0,l=t.message?this.formatMessage(t.message):t.render;o.toast.update(s,Object.assign({render:l,type:t.type,isLoading:!1,autoClose:null!==(e=null!==(i=t.autoClose)&&void 0!==i?i:null==a?void 0:a.autoClose)&&void 0!==e?e:r.autoClose},null!=a?a:{}))}static dismiss(s){o.toast.dismiss(s)}static dismissAll(){o.toast.dismiss()}static isActive(s){return o.toast.isActive(s)}}a.configs=null,exports.TemboNotify=a,exports.buildToastConfigs=n;
2
+ //# sourceMappingURL=tembo-notify-Bp14qngd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tembo-notify-Bp14qngd.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","surface","elevated","color","text","primary","display","alignItems","gap","successConfig","Object","assign","icon","_jsx","CheckCircleOutlined","success","main","bg","className","errorConfig","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","info","loadingConfig","LoadingOutlined","FALLBACK_BASE_CONFIG","TemboNotify","init","this","configs","getConfigs","formatMessage","message","hasTitle","title","hasDescription","description","_jsxs","flexDirection","children","fontWeight","opacity","buildOptions","options","_a","duration","toastId","onClick","onClose","restOptions","__rest","effectiveBase","undefined","getSuccessConfig","_b","getErrorConfig","getWarningConfig","getInfoConfig","getLoadingConfig","content","toastOptions","toast","loading","update","id","typeConfig","type","render","isLoading","dismiss","dismissAll","isActive"],"mappings":"yMAUaA,EAAoB,CAC7BC,EACAC,KAKA,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,GACdC,QAAS,YACTC,UAAW,qCACXC,OAAQ,OACRC,UAAW,GACXC,gBAAiBnB,EAAOoB,QAAQC,SAChCC,MAAOtB,EAAOuB,KAAKC,QACnBC,QAAS,OACTC,WAAY,SACZC,IAAK,IAOPC,EAAaC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACZ5B,GAAU,CACb6B,KACIC,EAAAA,kBAAAA,IAACC,YAAmB,CAChBvB,MAAO,CAAEG,SAAU,GAAIS,MAAOtB,EAAOkC,QAAQC,QAGrDzB,MAAKmB,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACE5B,EAAWQ,OAAK,CACnBS,gBAAiBnB,EAAOkC,QAAQE,GAChCd,MAAOtB,EAAOkC,QAAQX,OAE1Bc,UAAW,kBAMTC,EAAWT,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACV5B,GAAU,CACb6B,KACIC,EAAAA,kBAAAA,IAACO,YAAmB,CAChB7B,MAAO,CAAEG,SAAU,GAAIS,MAAOtB,EAAOwC,MAAML,QAGnDzB,MAAKmB,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACE5B,EAAWQ,OAAK,CACnBS,gBAAiBnB,EAAO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{b as i,c as n,R as e,a}from"./InfoCircleOutlined-DYs90hdV.js";import{b as r}from"./ZoomOutOutlined-Pw8hpWWK.js";const l=(s,t)=>{const l={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1,style:{fontFamily:t.typography.fontFamily,fontSize:14,borderRadius:10,padding:"10px 14px",boxShadow:"0 12px 24px rgba(15, 23, 42, 0.12)",border:"none",minHeight:56,backgroundColor:s.surface.elevated,color:s.text.primary,display:"flex",alignItems:"center",gap:8}},c=Object.assign(Object.assign({},l),{icon:o.jsx(i,{style:{fontSize:18,color:s.success.main}}),style:Object.assign(Object.assign({},l.style),{backgroundColor:s.success.bg,color:s.success.text}),className:"toast-success"}),g=Object.assign(Object.assign({},l),{icon:o.jsx(n,{style:{fontSize:18,color:s.error.main}}),style:Object.assign(Object.assign({},l.style),{backgroundColor:s.error.bg,color:s.error.text}),className:"toast-error"}),d=Object.assign(Object.assign({},l),{icon:o.jsx(e,{style:{fontSize:18,color:s.warning.main}}),style:Object.assign(Object.assign({},l.style),{backgroundColor:s.warning.bg,color:s.warning.text}),className:"toast-warning"}),u=Object.assign(Object.assign({},l),{icon:o.jsx(a,{style:{fontSize:18,color:s.info.main}}),style:Object.assign(Object.assign({},l.style),{backgroundColor:s.surface.elevated,color:s.text.primary}),className:"toast-info"});return{loadingConfig:Object.assign(Object.assign({},l),{icon:o.jsx(r,{style:{fontSize:18,color:s.primary.main}}),style:Object.assign(Object.assign({},l.style),{backgroundColor:s.surface.elevated,color:s.text.primary}),autoClose:!1,closeButton:!1,hideProgressBar:!0,className:"toast-loading"}),infoConfig:u,warningConfig:d,errorConfig:g,successConfig:c,baseConfig:l,colors:s}},c={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1};class g{static init(s,o){this.configs=l(s,o)}static getConfigs(){return this.configs}static formatMessage(s){if(s&&"object"==typeof s&&!("$$typeof"in s)){const t=!!s.title,i=!!s.description;return t&&i?o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[o.jsx("div",{style:{fontWeight:600,fontSize:14},children:s.title}),o.jsx("div",{style:{fontSize:13,fontWeight:400,opacity:.95},children:s.description})]}):t&&!i?o.jsx("div",{style:{fontWeight:600,fontSize:14},children:s.title}):!t&&i?o.jsx("div",{style:{fontSize:13,fontWeight:500},children:s.description}):""}return s}static buildOptions(o,t){const i=t||{},{duration:n,toastId:e,onClick:a,onClose:r}=i,l=s(i,["duration","toastId","onClick","onClose"]),g=null!=o?o:c;return Object.assign(Object.assign(Object.assign({},g),l),{toastId:e,autoClose:void 0!==n?n||!1:g.autoClose,onClick:a,onClose:r})}static getSuccessConfig(){var s,o;const t=this.getConfigs();return null!==(o=null!==(s=null==t?void 0:t.successConfig)&&void 0!==s?s:null==t?void 0:t.baseConfig)&&void 0!==o?o:void 0}static getErrorConfig(){var s,o;const t=this.getConfigs();return null!==(o=null!==(s=null==t?void 0:t.errorConfig)&&void 0!==s?s:null==t?void 0:t.baseConfig)&&void 0!==o?o:void 0}static getWarningConfig(){var s,o;const t=this.getConfigs();return null!==(o=null!==(s=null==t?void 0:t.warningConfig)&&void 0!==s?s:null==t?void 0:t.baseConfig)&&void 0!==o?o:void 0}static getInfoConfig(){var s,o;const t=this.getConfigs();return null!==(o=null!==(s=null==t?void 0:t.infoConfig)&&void 0!==s?s:null==t?void 0:t.baseConfig)&&void 0!==o?o:void 0}static getLoadingConfig(){var s,o;const t=this.getConfigs();return null!==(o=null!==(s=null==t?void 0:t.loadingConfig)&&void 0!==s?s:null==t?void 0:t.baseConfig)&&void 0!==o?o:void 0}static success(s,o){const i=this.formatMessage(s),n=this.buildOptions(this.getSuccessConfig(),o);return t.success(i,n)}static error(s,o){const i=this.formatMessage(s),n=this.buildOptions(this.getErrorConfig(),o);return t.error(i,n)}static warning(s,o){const i=this.formatMessage(s),n=this.buildOptions(this.getWarningConfig(),o);return t.warning(i,n)}static info(s,o){const i=this.formatMessage(s),n=this.buildOptions(this.getInfoConfig(),o);return t.info(i,n)}static loading(o,i){var n;const e=this.formatMessage(o),a=i||{},{toastId:r,onClick:l,onClose:g}=a,d=s(a,["toastId","onClick","onClose"]),u=null!==(n=this.getLoadingConfig())&&void 0!==n?n:c;return t.loading(e,Object.assign(Object.assign(Object.assign({},u),d),{toastId:r,onClick:l,onClose:g}))}static update(s,o){var i,n;const e=this.getConfigs(),a=o.type&&e?{success:e.successConfig,error:e.errorConfig,warning:e.warningConfig,info:e.infoConfig}[o.type]:void 0,r=o.message?this.formatMessage(o.message):o.render;t.update(s,Object.assign({render:r,type:o.type,isLoading:!1,autoClose:null!==(n=null!==(i=o.autoClose)&&void 0!==i?i:null==a?void 0:a.autoClose)&&void 0!==n?n:c.autoClose},null!=a?a:{}))}static dismiss(s){t.dismiss(s)}static dismissAll(){t.dismiss()}static isActive(s){return t.isActive(s)}}g.configs=null;export{g as T,l as b};
2
+ //# sourceMappingURL=tembo-notify-h5Xn66oA.js.map