@temboplus/frontend-react-core 0.1.3-beta.1 → 0.1.3-beta.3
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/alerts/index.cjs.js +1 -1
- package/dist/alerts/index.d.ts +1 -0
- package/dist/alerts/index.js +1 -1
- package/dist/dialogs/index.cjs.js +1 -1
- package/dist/dialogs/index.d.ts +1 -0
- package/dist/dialogs/index.js +1 -1
- package/dist/features/alerts/alert.js +95 -0
- package/dist/features/alerts/index.js +1 -0
- package/dist/features/dialogs/index.js +1 -0
- package/dist/features/dialogs/modal-provider.js +6 -0
- package/dist/features/dialogs/tembo-confirm.js +111 -0
- package/dist/features/input-validation/account-name-validator.js +28 -0
- package/dist/features/input-validation/account-number-validator.js +65 -0
- package/dist/features/input-validation/amount-validator.js +100 -0
- package/dist/features/input-validation/index.js +5 -0
- package/dist/features/input-validation/phone-number-validator.js +79 -0
- package/dist/features/input-validation/swift-code-validator.js +38 -0
- package/dist/features/notifications/index.js +3 -0
- package/dist/features/notifications/tembo-notify.js +149 -0
- package/dist/features/notifications/toast-config.js +53 -0
- package/dist/features/notifications/toast-container.js +18 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -0
- package/dist/notifications/index.cjs.js +1 -1
- package/dist/notifications/index.d.ts +1 -0
- package/dist/notifications/index.js +1 -1
- package/dist/providers.js +32 -0
- package/dist/{tembo-notify-C-QGduBt.js → tembo-notify-B-mUpU8q.js} +2 -2
- package/dist/{tembo-notify-C-QGduBt.js.map → tembo-notify-B-mUpU8q.js.map} +1 -1
- package/dist/{tembo-notify-D-uOV3t0.js → tembo-notify-C4_8DSSc.js} +2 -2
- package/dist/{tembo-notify-D-uOV3t0.js.map → tembo-notify-C4_8DSSc.js.map} +1 -1
- package/dist/theme/colors.d.ts +55 -23
- package/dist/theme/colors.js +212 -0
- package/dist/theme/constants.js +82 -0
- package/dist/theme/index.cjs.js +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/theme-provider.d.ts +18 -6
- package/dist/theme/theme-provider.js +404 -0
- package/dist/theme-provider-Ca4P0Hcp.js +11 -0
- package/dist/theme-provider-Ca4P0Hcp.js.map +1 -0
- package/dist/theme-provider-RhAw3jw_.js +11 -0
- package/dist/theme-provider-RhAw3jw_.js.map +1 -0
- package/dist/validation/index.d.ts +1 -0
- package/package.json +5 -2
- package/dist/theme-provider-D_oV1J_K.js +0 -11
- package/dist/theme-provider-D_oV1J_K.js.map +0 -1
- package/dist/theme-provider-Dqvy24OD.js +0 -11
- package/dist/theme-provider-Dqvy24OD.js.map +0 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { toast } from 'react-toastify';
|
|
2
|
+
import { buildToastConfigs } from './toast-config.js';
|
|
3
|
+
/**
|
|
4
|
+
* TemboNotify - Unified notification system
|
|
5
|
+
*
|
|
6
|
+
* Wraps react-toastify with consistent styling and behavior
|
|
7
|
+
* aligned with Tembo's design system.
|
|
8
|
+
*
|
|
9
|
+
* Note: This class needs to be initialized with theme tokens before use.
|
|
10
|
+
* Call TemboNotify.init(colors, constants) in your app setup.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // In your app setup (e.g., App.tsx)
|
|
15
|
+
* const { colors, constants } = useTemboTheme();
|
|
16
|
+
* useEffect(() => {
|
|
17
|
+
* TemboNotify.init(colors, constants);
|
|
18
|
+
* }, [colors, constants]);
|
|
19
|
+
*
|
|
20
|
+
* // Then use anywhere in your app
|
|
21
|
+
* TemboNotify.success('Payment sent successfully!');
|
|
22
|
+
*
|
|
23
|
+
* // With options
|
|
24
|
+
* TemboNotify.error('Payment failed', {
|
|
25
|
+
* duration: 8000,
|
|
26
|
+
* onClick: () => console.log('Error clicked')
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* // Loading with promise
|
|
30
|
+
* const loadingId = TemboNotify.loading('Processing payment...');
|
|
31
|
+
* await processPayment();
|
|
32
|
+
* TemboNotify.success('Payment complete!', { id: loadingId });
|
|
33
|
+
*
|
|
34
|
+
* // Promise-based
|
|
35
|
+
* TemboNotify.promise(
|
|
36
|
+
* apiCall(),
|
|
37
|
+
* {
|
|
38
|
+
* pending: 'Processing...',
|
|
39
|
+
* success: 'Done!',
|
|
40
|
+
* error: 'Failed!'
|
|
41
|
+
* }
|
|
42
|
+
* );
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export class TemboNotify {
|
|
46
|
+
/**
|
|
47
|
+
* Initialize TemboNotify with theme tokens
|
|
48
|
+
* Must be called before using any notification methods
|
|
49
|
+
*/
|
|
50
|
+
static init(colors, constants) {
|
|
51
|
+
this.configs = buildToastConfigs(colors, constants);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get current toast configs, throws if not initialized
|
|
55
|
+
*/
|
|
56
|
+
static getConfigs() {
|
|
57
|
+
if (!this.configs) {
|
|
58
|
+
throw new Error('TemboNotify not initialized. Call TemboNotify.init(colors, constants) before using notifications.');
|
|
59
|
+
}
|
|
60
|
+
return this.configs;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Display a success notification
|
|
64
|
+
*/
|
|
65
|
+
static success(message, options) {
|
|
66
|
+
var _a;
|
|
67
|
+
const configs = this.getConfigs();
|
|
68
|
+
return toast.success(message, Object.assign(Object.assign({}, configs.successConfig), { autoClose: (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : configs.successConfig.autoClose, position: options === null || options === void 0 ? void 0 : options.position, onClick: options === null || options === void 0 ? void 0 : options.onClick, onClose: options === null || options === void 0 ? void 0 : options.onClose }));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Display an error notification
|
|
72
|
+
*/
|
|
73
|
+
static error(message, options) {
|
|
74
|
+
var _a;
|
|
75
|
+
const configs = this.getConfigs();
|
|
76
|
+
return toast.error(message, Object.assign(Object.assign({}, configs.errorConfig), { autoClose: (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : configs.errorConfig.autoClose, position: options === null || options === void 0 ? void 0 : options.position, onClick: options === null || options === void 0 ? void 0 : options.onClick, onClose: options === null || options === void 0 ? void 0 : options.onClose }));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Display a warning notification
|
|
80
|
+
*/
|
|
81
|
+
static warning(message, options) {
|
|
82
|
+
var _a;
|
|
83
|
+
const configs = this.getConfigs();
|
|
84
|
+
return toast.warning(message, Object.assign(Object.assign({}, configs.warningConfig), { autoClose: (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : configs.warningConfig.autoClose, position: options === null || options === void 0 ? void 0 : options.position, onClick: options === null || options === void 0 ? void 0 : options.onClick, onClose: options === null || options === void 0 ? void 0 : options.onClose }));
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Display an info notification
|
|
88
|
+
*/
|
|
89
|
+
static info(message, options) {
|
|
90
|
+
var _a;
|
|
91
|
+
const configs = this.getConfigs();
|
|
92
|
+
return toast.info(message, Object.assign(Object.assign({}, configs.infoConfig), { autoClose: (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : configs.infoConfig.autoClose, position: options === null || options === void 0 ? void 0 : options.position, onClick: options === null || options === void 0 ? void 0 : options.onClick, onClose: options === null || options === void 0 ? void 0 : options.onClose }));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Display a loading notification
|
|
96
|
+
* Returns an ID that can be used to update/dismiss it
|
|
97
|
+
*/
|
|
98
|
+
static loading(message, options) {
|
|
99
|
+
const configs = this.getConfigs();
|
|
100
|
+
return toast.loading(message, Object.assign(Object.assign({}, configs.loadingConfig), { position: options === null || options === void 0 ? void 0 : options.position, onClick: options === null || options === void 0 ? void 0 : options.onClick, onClose: options === null || options === void 0 ? void 0 : options.onClose }));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Update an existing notification
|
|
104
|
+
*/
|
|
105
|
+
static update(id, options) {
|
|
106
|
+
var _a;
|
|
107
|
+
const configs = this.getConfigs();
|
|
108
|
+
const config = options.type ? {
|
|
109
|
+
success: configs.successConfig,
|
|
110
|
+
error: configs.errorConfig,
|
|
111
|
+
warning: configs.warningConfig,
|
|
112
|
+
info: configs.infoConfig,
|
|
113
|
+
}[options.type] : undefined;
|
|
114
|
+
toast.update(id, Object.assign({ render: options.message, type: options.type, isLoading: false, autoClose: (_a = options.autoClose) !== null && _a !== void 0 ? _a : config === null || config === void 0 ? void 0 : config.autoClose }, config));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Dismiss a specific notification by ID
|
|
118
|
+
*/
|
|
119
|
+
static dismiss(id) {
|
|
120
|
+
toast.dismiss(id);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Dismiss all notifications
|
|
124
|
+
*/
|
|
125
|
+
static dismissAll() {
|
|
126
|
+
toast.dismiss();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Check if a notification is active
|
|
130
|
+
*/
|
|
131
|
+
static isActive(id) {
|
|
132
|
+
return toast.isActive(id);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Handle promise-based operations with notifications
|
|
136
|
+
*/
|
|
137
|
+
static promise(promise, messages, options) {
|
|
138
|
+
var _a, _b;
|
|
139
|
+
const configs = this.getConfigs();
|
|
140
|
+
return toast.promise(promise, {
|
|
141
|
+
pending: Object.assign({ render: messages.pending }, configs.loadingConfig),
|
|
142
|
+
success: Object.assign(Object.assign({ render: messages.success }, configs.successConfig), { autoClose: (_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : configs.successConfig.autoClose }),
|
|
143
|
+
error: Object.assign(Object.assign({ render: messages.error }, configs.errorConfig), { autoClose: (_b = options === null || options === void 0 ? void 0 : options.duration) !== null && _b !== void 0 ? _b : configs.errorConfig.autoClose }),
|
|
144
|
+
}, {
|
|
145
|
+
position: options === null || options === void 0 ? void 0 : options.position,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
TemboNotify.configs = null;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CheckCircleOutlined, CloseCircleOutlined, ExclamationCircleOutlined, InfoCircleOutlined, } from '@ant-design/icons';
|
|
3
|
+
/**
|
|
4
|
+
* Build toast configurations from theme tokens
|
|
5
|
+
* This function is called with theme values to generate toast configs
|
|
6
|
+
*/
|
|
7
|
+
export const buildToastConfigs = (colors, constants) => {
|
|
8
|
+
/**
|
|
9
|
+
* Common toast configuration aligned with Tembo theme
|
|
10
|
+
*/
|
|
11
|
+
const baseConfig = {
|
|
12
|
+
position: 'top-right',
|
|
13
|
+
autoClose: 4000,
|
|
14
|
+
hideProgressBar: false,
|
|
15
|
+
closeOnClick: true,
|
|
16
|
+
pauseOnHover: true,
|
|
17
|
+
draggable: true,
|
|
18
|
+
progress: undefined,
|
|
19
|
+
style: {
|
|
20
|
+
fontFamily: constants.typography.fontFamily,
|
|
21
|
+
fontSize: constants.typography.fontSize.base,
|
|
22
|
+
borderRadius: constants.radius.base,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Success notification configuration
|
|
27
|
+
*/
|
|
28
|
+
const successConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(CheckCircleOutlined, { style: { fontSize: 20, color: colors.success.main } }), style: Object.assign(Object.assign({}, baseConfig.style), { border: `1px solid ${colors.success.border}` }) });
|
|
29
|
+
/**
|
|
30
|
+
* Error notification configuration
|
|
31
|
+
*/
|
|
32
|
+
const errorConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(CloseCircleOutlined, { style: { fontSize: 20, color: colors.error.main } }), style: Object.assign(Object.assign({}, baseConfig.style), { border: `1px solid ${colors.error.border}` }), autoClose: 6000 });
|
|
33
|
+
/**
|
|
34
|
+
* Warning notification configuration
|
|
35
|
+
*/
|
|
36
|
+
const warningConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(ExclamationCircleOutlined, { style: { fontSize: 20, color: colors.warning.main } }), style: Object.assign(Object.assign({}, baseConfig.style), { border: `1px solid ${colors.warning.border}` }) });
|
|
37
|
+
/**
|
|
38
|
+
* Info notification configuration
|
|
39
|
+
*/
|
|
40
|
+
const infoConfig = Object.assign(Object.assign({}, baseConfig), { icon: _jsx(InfoCircleOutlined, { style: { fontSize: 20, color: colors.info.main } }), style: Object.assign(Object.assign({}, baseConfig.style), { border: `1px solid ${colors.info.border}` }) });
|
|
41
|
+
/**
|
|
42
|
+
* Loading notification configuration
|
|
43
|
+
*/
|
|
44
|
+
const loadingConfig = Object.assign(Object.assign({}, baseConfig), { autoClose: false, closeButton: false });
|
|
45
|
+
return {
|
|
46
|
+
loadingConfig,
|
|
47
|
+
infoConfig,
|
|
48
|
+
warningConfig,
|
|
49
|
+
errorConfig,
|
|
50
|
+
successConfig,
|
|
51
|
+
baseConfig,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { ToastContainer } from 'react-toastify';
|
|
4
|
+
import { useTemboTheme } from '../../theme/index.js';
|
|
5
|
+
import { TemboNotify } from './tembo-notify.js';
|
|
6
|
+
/**
|
|
7
|
+
* Toast container that automatically initializes TemboNotify with current theme
|
|
8
|
+
* Reinitializes when theme changes to respect color/constant overrides
|
|
9
|
+
*/
|
|
10
|
+
const TemboToastContainer = (props) => {
|
|
11
|
+
const { colors, constants } = useTemboTheme();
|
|
12
|
+
// Initialize/update TemboNotify whenever theme changes
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
TemboNotify.init(colors, constants);
|
|
15
|
+
}, [colors, constants]);
|
|
16
|
+
return _jsx(ToastContainer, Object.assign({}, props));
|
|
17
|
+
};
|
|
18
|
+
export default TemboToastContainer;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./theme-provider-
|
|
1
|
+
"use strict";var e=require("./theme-provider-RhAw3jw_.js"),r=require("@ebay/nice-modal-react"),t=require("react"),s=require("react-toastify");require("lodash");var i=require("./tembo-notify-C4_8DSSc.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,{})]})});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as r,u as o,T as t}from"./theme-provider-
|
|
1
|
+
import{j as r,u as o,T as t}from"./theme-provider-Ca4P0Hcp.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-B-mUpU8q.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};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
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-
|
|
1
|
+
"use strict";var e=require("../tembo-notify-C4_8DSSc.js");require("../theme-provider-RhAw3jw_.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;
|
|
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-
|
|
1
|
+
export{T as TemboNotify,b as buildToastConfigs}from"../tembo-notify-B-mUpU8q.js";import"../theme-provider-Ca4P0Hcp.js";import"react";import"react-toastify";import"lodash";import"../InfoCircleOutlined-DYs90hdV.js";import"../ZoomOutOutlined-BL6A5RSq.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
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{toast as o}from"react-toastify";import{j as s}from"./theme-provider-
|
|
2
|
-
//# sourceMappingURL=tembo-notify-
|
|
1
|
+
import{toast as o}from"react-toastify";import{j as s}from"./theme-provider-Ca4P0Hcp.js";import{b as i,c as n,R as t,a as e}from"./InfoCircleOutlined-DYs90hdV.js";import"./ZoomOutOutlined-BL6A5RSq.js";const l=(o,l)=>{const r={position:"top-right",autoClose:4e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,style:{fontFamily:l.typography.fontFamily,fontSize:l.typography.fontSize.base,borderRadius:l.radius.base}},a=Object.assign(Object.assign({},r),{icon:s.jsx(i,{style:{fontSize:20,color:o.success.main}}),style:Object.assign(Object.assign({},r.style),{border:`1px solid ${o.success.border}`})}),c=Object.assign(Object.assign({},r),{icon:s.jsx(n,{style:{fontSize:20,color:o.error.main}}),style:Object.assign(Object.assign({},r.style),{border:`1px solid ${o.error.border}`}),autoClose:6e3}),g=Object.assign(Object.assign({},r),{icon:s.jsx(t,{style:{fontSize:20,color:o.warning.main}}),style:Object.assign(Object.assign({},r.style),{border:`1px solid ${o.warning.border}`})}),u=Object.assign(Object.assign({},r),{icon:s.jsx(e,{style:{fontSize:20,color:o.info.main}}),style:Object.assign(Object.assign({},r.style),{border:`1px solid ${o.info.border}`})});return{loadingConfig:Object.assign(Object.assign({},r),{autoClose:!1,closeButton:!1}),infoConfig:u,warningConfig:g,errorConfig:c,successConfig:a,baseConfig:r}};class r{static init(o,s){this.configs=l(o,s)}static getConfigs(){if(!this.configs)throw new Error("TemboNotify not initialized. Call TemboNotify.init(colors, constants) before using notifications.");return this.configs}static success(s,i){var n;const t=this.getConfigs();return o.success(s,Object.assign(Object.assign({},t.successConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.successConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static error(s,i){var n;const t=this.getConfigs();return o.error(s,Object.assign(Object.assign({},t.errorConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.errorConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static warning(s,i){var n;const t=this.getConfigs();return o.warning(s,Object.assign(Object.assign({},t.warningConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.warningConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static info(s,i){var n;const t=this.getConfigs();return o.info(s,Object.assign(Object.assign({},t.infoConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.infoConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static loading(s,i){const n=this.getConfigs();return o.loading(s,Object.assign(Object.assign({},n.loadingConfig),{position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static update(s,i){var n;const t=this.getConfigs(),e=i.type?{success:t.successConfig,error:t.errorConfig,warning:t.warningConfig,info:t.infoConfig}[i.type]:void 0;o.update(s,Object.assign({render:i.message,type:i.type,isLoading:!1,autoClose:null!==(n=i.autoClose)&&void 0!==n?n:null==e?void 0:e.autoClose},e))}static dismiss(s){o.dismiss(s)}static dismissAll(){o.dismiss()}static isActive(s){return o.isActive(s)}static promise(s,i,n){var t,e;const l=this.getConfigs();return o.promise(s,{pending:Object.assign({render:i.pending},l.loadingConfig),success:Object.assign(Object.assign({render:i.success},l.successConfig),{autoClose:null!==(t=null==n?void 0:n.duration)&&void 0!==t?t:l.successConfig.autoClose}),error:Object.assign(Object.assign({render:i.error},l.errorConfig),{autoClose:null!==(e=null==n?void 0:n.duration)&&void 0!==e?e:l.errorConfig.autoClose})},{position:null==n?void 0:n.position})}}r.configs=null;export{r as T,l as b};
|
|
2
|
+
//# sourceMappingURL=tembo-notify-B-mUpU8q.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tembo-notify-
|
|
1
|
+
{"version":3,"file":"tembo-notify-B-mUpU8q.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","progress","undefined","style","fontFamily","typography","fontSize","base","borderRadius","radius","successConfig","Object","assign","icon","_jsx","CheckCircleOutlined","color","success","main","border","errorConfig","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","info","loadingConfig","closeButton","TemboNotify","init","this","configs","getConfigs","Error","message","options","toast","_a","duration","onClick","onClose","loading","update","id","config","type","render","isLoading","dismiss","dismissAll","isActive","promise","messages","pending","_b"],"mappings":"8MAaaA,EAAoB,CAACC,EAA2BC,KAIzD,MAAMC,EAA2B,CAC7BC,SAAU,YACVC,UAAW,IACXC,iBAAiB,EACjBC,cAAc,EACdC,cAAc,EACdC,WAAW,EACXC,cAAUC,EACVC,MAAO,CACHC,WAAY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dtB,EAAQL,eAEfZ,QAAON,OAAAC,OAAAD,OAAAC,OAAA,CACHqC,OAAQM,EAAStC,SACbiB,EAAQxB,eAAqB,CACjCd,UAA4B,QAAjB4C,EAAAF,aAAO,EAAPA,EAASG,gBAAQ,IAAAD,EAAAA,EAAIN,EAAQxB,cAAcd,YAE1D0B,MAAKX,OAAAC,OAAAD,OAAAC,OAAA,CACDqC,OAAQM,EAASjC,OACdY,EAAQd,aAAW,CACtBxB,UAA4B,QAAjB6D,EAAAnB,aAAO,EAAPA,EAASG,gBAAQ,IAAAgB,EAAAA,EAAIvB,EAAQd,YAAYxB,aAG5D,CACID,SAAU2C,aAAO,EAAPA,EAAS3C,YA1KhBoC,EAAAG,QAA+B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var o=require("react-toastify"),s=require("./theme-provider-
|
|
2
|
-
//# sourceMappingURL=tembo-notify-
|
|
1
|
+
"use strict";var o=require("react-toastify"),s=require("./theme-provider-RhAw3jw_.js"),i=require("./InfoCircleOutlined-B7d2aRfV.js");require("./ZoomOutOutlined-BY_CCwq7.js");const n=(o,n)=>{const t={position:"top-right",autoClose:4e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,style:{fontFamily:n.typography.fontFamily,fontSize:n.typography.fontSize.base,borderRadius:n.radius.base}},e=Object.assign(Object.assign({},t),{icon:s.jsxRuntimeExports.jsx(i.RefIcon$2,{style:{fontSize:20,color:o.success.main}}),style:Object.assign(Object.assign({},t.style),{border:`1px solid ${o.success.border}`})}),r=Object.assign(Object.assign({},t),{icon:s.jsxRuntimeExports.jsx(i.RefIcon$3,{style:{fontSize:20,color:o.error.main}}),style:Object.assign(Object.assign({},t.style),{border:`1px solid ${o.error.border}`}),autoClose:6e3}),l=Object.assign(Object.assign({},t),{icon:s.jsxRuntimeExports.jsx(i.RefIcon,{style:{fontSize:20,color:o.warning.main}}),style:Object.assign(Object.assign({},t.style),{border:`1px solid ${o.warning.border}`})}),a=Object.assign(Object.assign({},t),{icon:s.jsxRuntimeExports.jsx(i.RefIcon$1,{style:{fontSize:20,color:o.info.main}}),style:Object.assign(Object.assign({},t.style),{border:`1px solid ${o.info.border}`})});return{loadingConfig:Object.assign(Object.assign({},t),{autoClose:!1,closeButton:!1}),infoConfig:a,warningConfig:l,errorConfig:r,successConfig:e,baseConfig:t}};class t{static init(o,s){this.configs=n(o,s)}static getConfigs(){if(!this.configs)throw new Error("TemboNotify not initialized. Call TemboNotify.init(colors, constants) before using notifications.");return this.configs}static success(s,i){var n;const t=this.getConfigs();return o.toast.success(s,Object.assign(Object.assign({},t.successConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.successConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static error(s,i){var n;const t=this.getConfigs();return o.toast.error(s,Object.assign(Object.assign({},t.errorConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.errorConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static warning(s,i){var n;const t=this.getConfigs();return o.toast.warning(s,Object.assign(Object.assign({},t.warningConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.warningConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static info(s,i){var n;const t=this.getConfigs();return o.toast.info(s,Object.assign(Object.assign({},t.infoConfig),{autoClose:null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:t.infoConfig.autoClose,position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static loading(s,i){const n=this.getConfigs();return o.toast.loading(s,Object.assign(Object.assign({},n.loadingConfig),{position:null==i?void 0:i.position,onClick:null==i?void 0:i.onClick,onClose:null==i?void 0:i.onClose}))}static update(s,i){var n;const t=this.getConfigs(),e=i.type?{success:t.successConfig,error:t.errorConfig,warning:t.warningConfig,info:t.infoConfig}[i.type]:void 0;o.toast.update(s,Object.assign({render:i.message,type:i.type,isLoading:!1,autoClose:null!==(n=i.autoClose)&&void 0!==n?n:null==e?void 0:e.autoClose},e))}static dismiss(s){o.toast.dismiss(s)}static dismissAll(){o.toast.dismiss()}static isActive(s){return o.toast.isActive(s)}static promise(s,i,n){var t,e;const r=this.getConfigs();return o.toast.promise(s,{pending:Object.assign({render:i.pending},r.loadingConfig),success:Object.assign(Object.assign({render:i.success},r.successConfig),{autoClose:null!==(t=null==n?void 0:n.duration)&&void 0!==t?t:r.successConfig.autoClose}),error:Object.assign(Object.assign({render:i.error},r.errorConfig),{autoClose:null!==(e=null==n?void 0:n.duration)&&void 0!==e?e:r.errorConfig.autoClose})},{position:null==n?void 0:n.position})}}t.configs=null,exports.TemboNotify=t,exports.buildToastConfigs=n;
|
|
2
|
+
//# sourceMappingURL=tembo-notify-C4_8DSSc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tembo-notify-
|
|
1
|
+
{"version":3,"file":"tembo-notify-C4_8DSSc.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","progress","undefined","style","fontFamily","typography","fontSize","base","borderRadius","radius","successConfig","Object","assign","icon","_jsx","CheckCircleOutlined","color","success","main","border","errorConfig","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","info","loadingConfig","closeButton","TemboNotify","init","this","configs","getConfigs","Error","message","options","toast","_a","duration","onClick","onClose","loading","update","id","config","type","render","isLoading","dismiss","dismissAll","isActive","promise","messages","pending","_b"],"mappings":"oLAaaA,EAAoB,CAACC,EAA2BC,KAIzD,MAAMC,EAA2B,CAC7BC,SAAU,YACVC,UAAW,IACXC,iBAAiB,EACjBC,cA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,cAAOQ,CACHA,EACAC,EAKAjB,WAEA,MAAMJ,EAAUD,KAAKE,aACrB,OAAOI,EAAAA,MAAMe,QACTA,EACA,CACIE,QAAO7C,OAAAC,OAAA,CACHqC,OAAQM,EAASC,SACdtB,EAAQL,eAEfZ,QAAON,OAAAC,OAAAD,OAAAC,OAAA,CACHqC,OAAQM,EAAStC,SACbiB,EAAQxB,eAAqB,CACjCd,UAA4B,QAAjB4C,EAAAF,aAAO,EAAPA,EAASG,gBAAQ,IAAAD,EAAAA,EAAIN,EAAQxB,cAAcd,YAE1D0B,MAAKX,OAAAC,OAAAD,OAAAC,OAAA,CACDqC,OAAQM,EAASjC,OACdY,EAAQd,aAAW,CACtBxB,UAA4B,QAAjB6D,EAAAnB,aAAO,EAAPA,EAASG,gBAAQ,IAAAgB,EAAAA,EAAIvB,EAAQd,YAAYxB,aAG5D,CACID,SAAU2C,aAAO,EAAPA,EAAS3C,YA1KhBoC,EAAAG,QAA+B"}
|
package/dist/theme/colors.d.ts
CHANGED
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* - Seed tokens (primary, action) → Map tokens (surfaces, components) → Alias tokens (text, borders)
|
|
6
6
|
* - Named by purpose, not by specific color values
|
|
7
7
|
* - Supports theming through consistent semantic structure
|
|
8
|
+
* - Theme-aware: neutral scale adapts to light/dark mode
|
|
8
9
|
*
|
|
9
10
|
* @example
|
|
10
11
|
* // Usage in components
|
|
11
12
|
* const { colors } = useTemboTheme();
|
|
12
|
-
* style={{ color: colors.text.primary, backgroundColor: colors.
|
|
13
|
+
* style={{ color: colors.text.primary, backgroundColor: colors.neutral.lightest }}
|
|
13
14
|
*/
|
|
14
15
|
export interface TemboColorPalette {
|
|
15
16
|
/**
|
|
@@ -48,25 +49,54 @@ export interface TemboColorPalette {
|
|
|
48
49
|
contrast: string;
|
|
49
50
|
};
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
+
* Absolute colors
|
|
53
|
+
* Never change regardless of theme mode - use for logos, illustrations, or specific design requirements
|
|
54
|
+
*/
|
|
55
|
+
absolute: {
|
|
56
|
+
/** Pure white - always #ffffff */
|
|
57
|
+
white: string;
|
|
58
|
+
/** Pure black - always #000000 */
|
|
59
|
+
black: string;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Neutral color scale (0-10)
|
|
63
|
+
* Theme-aware: entire scale inverts in dark mode
|
|
52
64
|
* Foundation for backgrounds, borders, and subtle UI elements
|
|
53
|
-
*
|
|
65
|
+
* 0 = brightest in current theme, 10 = dimmest in current theme
|
|
54
66
|
*/
|
|
55
67
|
neutral: {
|
|
56
|
-
/**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
|
|
68
|
+
/** Brightest tone in current theme (white in light, black in dark) */
|
|
69
|
+
0: string;
|
|
70
|
+
1: string;
|
|
71
|
+
2: string;
|
|
72
|
+
3: string;
|
|
73
|
+
4: string;
|
|
74
|
+
/** Middle gray - typically stays similar across themes */
|
|
75
|
+
5: string;
|
|
76
|
+
6: string;
|
|
77
|
+
7: string;
|
|
78
|
+
8: string;
|
|
79
|
+
9: string;
|
|
80
|
+
/** Dimmest tone in current theme (black in light, white in dark) */
|
|
81
|
+
10: string;
|
|
82
|
+
/** Brightest tone (maps to 0) */
|
|
83
|
+
brightest: string;
|
|
84
|
+
/** Near-brightest tone (maps to 1) */
|
|
85
|
+
lightest: string;
|
|
86
|
+
/** Very light tone (maps to 2) */
|
|
87
|
+
lighter: string;
|
|
88
|
+
/** Light tone (maps to 3) */
|
|
89
|
+
light: string;
|
|
90
|
+
/** Middle tone (maps to 5) */
|
|
91
|
+
medium: string;
|
|
92
|
+
/** Dark tone (maps to 7) */
|
|
93
|
+
dark: string;
|
|
94
|
+
/** Very dark tone (maps to 8) */
|
|
95
|
+
darker: string;
|
|
96
|
+
/** Near-dimmest tone (maps to 9) */
|
|
97
|
+
darkest: string;
|
|
98
|
+
/** Dimmest tone (maps to 10) */
|
|
99
|
+
dimmest: string;
|
|
70
100
|
};
|
|
71
101
|
/**
|
|
72
102
|
* Success colors
|
|
@@ -210,11 +240,9 @@ export interface TemboColorPalette {
|
|
|
210
240
|
};
|
|
211
241
|
/**
|
|
212
242
|
* Utility colors
|
|
213
|
-
*
|
|
243
|
+
* Special purpose color values
|
|
214
244
|
*/
|
|
215
245
|
utility: {
|
|
216
|
-
white: string;
|
|
217
|
-
black: string;
|
|
218
246
|
transparent: string;
|
|
219
247
|
/** Link color (often aliases action.main) */
|
|
220
248
|
link: string;
|
|
@@ -228,8 +256,11 @@ export interface TemboColorPalette {
|
|
|
228
256
|
*/
|
|
229
257
|
export type TemboColorOverrides = DeepPartial<TemboColorPalette>;
|
|
230
258
|
/**
|
|
231
|
-
*
|
|
232
|
-
|
|
259
|
+
* Theme mode
|
|
260
|
+
*/
|
|
261
|
+
export type ThemeMode = 'light' | 'dark';
|
|
262
|
+
/**
|
|
263
|
+
* Default color palette for light theme
|
|
233
264
|
*/
|
|
234
265
|
export declare const defaultColorPalette: TemboColorPalette;
|
|
235
266
|
/**
|
|
@@ -237,9 +268,10 @@ export declare const defaultColorPalette: TemboColorPalette;
|
|
|
237
268
|
* Performs deep merge to allow partial nested overrides
|
|
238
269
|
*
|
|
239
270
|
* @param overrides - Partial color palette overrides
|
|
271
|
+
* @param mode - Theme mode ('light' or 'dark')
|
|
240
272
|
* @returns Complete color palette with overrides applied
|
|
241
273
|
*/
|
|
242
|
-
export declare const buildColorPalette: (overrides?: TemboColorOverrides) => TemboColorPalette;
|
|
274
|
+
export declare const buildColorPalette: (overrides?: TemboColorOverrides, mode?: ThemeMode) => TemboColorPalette;
|
|
243
275
|
type DeepPartial<T> = {
|
|
244
276
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
245
277
|
};
|