@temboplus/frontend-react-core 0.1.3-beta.2 → 0.1.3-beta.20
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/CloseCircleOutlined-CMilRURi.js +3 -0
- package/dist/CloseCircleOutlined-CMilRURi.js.map +1 -0
- package/dist/CloseCircleOutlined-CSHx89Jn.js +3 -0
- package/dist/CloseCircleOutlined-CSHx89Jn.js.map +1 -0
- package/dist/InfoCircleOutlined-DR9DmuN-.js +5 -0
- package/dist/InfoCircleOutlined-DR9DmuN-.js.map +1 -0
- package/dist/InfoCircleOutlined-Hx86sClq.js +5 -0
- package/dist/InfoCircleOutlined-Hx86sClq.js.map +1 -0
- package/dist/alerts/index.cjs.js +1 -1
- package/dist/alerts/index.cjs.js.map +1 -1
- package/dist/alerts/index.js +1 -1
- package/dist/alerts/index.js.map +1 -1
- package/dist/dialogs/index.cjs.js +3 -1
- package/dist/dialogs/index.cjs.js.map +1 -1
- package/dist/dialogs/index.js +3 -1
- package/dist/dialogs/index.js.map +1 -1
- package/dist/features/alerts/alert.js +18 -18
- package/dist/features/dialogs/tembo-confirm.js +11 -11
- package/dist/features/notifications/tembo-notify.d.ts +32 -105
- package/dist/features/notifications/tembo-notify.js +102 -111
- package/dist/features/notifications/toast-config.d.ts +4 -6
- package/dist/features/notifications/toast-config.js +28 -21
- package/dist/features/notifications/toast-container.d.ts +13 -3
- package/dist/features/notifications/toast-container.js +80 -9
- 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/providers.d.ts +2 -32
- package/dist/providers.js +3 -24
- package/dist/tembo-notify-BSIZkV5f.js +3 -0
- package/dist/tembo-notify-BSIZkV5f.js.map +1 -0
- package/dist/tembo-notify-ZYud9J7B.js +3 -0
- package/dist/tembo-notify-ZYud9J7B.js.map +1 -0
- package/dist/theme/{colors.d.ts → deprecated/colors.d.ts} +55 -23
- package/dist/theme/deprecated/colors.js +212 -0
- package/dist/theme/deprecated/theme-provider.d.ts +100 -0
- package/dist/theme/deprecated/theme-provider.js +405 -0
- package/dist/theme/index.cjs.js +1 -1
- package/dist/theme/index.d.ts +3 -2
- package/dist/theme/index.js +1 -1
- package/dist/theme/theme-config.d.ts +15 -0
- package/dist/theme/theme-config.js +735 -0
- package/dist/theme/theme-provider.d.ts +13 -71
- package/dist/theme/theme-provider.js +21 -387
- package/dist/theme/tokens/colors.d.ts +108 -0
- package/dist/theme/tokens/colors.js +236 -0
- package/dist/theme/tokens/constants.d.ts +126 -0
- package/dist/theme/tokens/constants.js +126 -0
- package/dist/theme-provider-CCkR2IcZ.js +11 -0
- package/dist/theme-provider-CCkR2IcZ.js.map +1 -0
- package/dist/theme-provider-CCwq2x0C.js +2 -0
- package/dist/theme-provider-CCwq2x0C.js.map +1 -0
- package/dist/theme-provider-D2HR_D4s.js +11 -0
- package/dist/theme-provider-D2HR_D4s.js.map +1 -0
- package/dist/theme-provider-dbj9jb7X.js +2 -0
- package/dist/theme-provider-dbj9jb7X.js.map +1 -0
- package/dist/validation/index.cjs.js.map +1 -1
- package/dist/validation/index.js.map +1 -1
- package/package.json +17 -18
- package/dist/InfoCircleOutlined-B7d2aRfV.js +0 -7
- package/dist/InfoCircleOutlined-B7d2aRfV.js.map +0 -1
- package/dist/InfoCircleOutlined-DYs90hdV.js +0 -7
- package/dist/InfoCircleOutlined-DYs90hdV.js.map +0 -1
- package/dist/ZoomOutOutlined-BL6A5RSq.js +0 -2
- package/dist/ZoomOutOutlined-BL6A5RSq.js.map +0 -1
- package/dist/ZoomOutOutlined-BY_CCwq7.js +0 -2
- package/dist/ZoomOutOutlined-BY_CCwq7.js.map +0 -1
- package/dist/tembo-notify-C-QGduBt.js +0 -2
- package/dist/tembo-notify-C-QGduBt.js.map +0 -1
- package/dist/tembo-notify-D-uOV3t0.js +0 -2
- package/dist/tembo-notify-D-uOV3t0.js.map +0 -1
- package/dist/theme/colors.js +0 -138
- 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
- /package/dist/theme/{constants.d.ts → deprecated/constants.d.ts} +0 -0
- /package/dist/theme/{constants.js → deprecated/constants.js} +0 -0
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","
|
|
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","useNewTemboTheme","useEffect","TemboNotify","init","_jsxs","_Fragment","ToastContainer","Object","assign","closeButton","hideProgressBar","typography","fontFamily","mode","antdThemeOverrides","TemboThemeProvider"],"mappings":"gXAGA,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,qBAM9B,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,ovECtCW,EAC/DrB,WACAsB,OACAC,wBAGI1B,EAAAA,kBAAAA,IAAC2B,EAAAA,mBAAkB,CACfF,KAAMA,EACNC,mBAAoBA,WAEpBV,EAAAA,kBAAAA,KAAClB,EAAkB,CAAAK,SAAA,CACdA,EACDH,EAAAA,kBAAAA,IAACI,EAAmB"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as n,u as t,T as o}from"./theme-provider-D2HR_D4s.js";import e from"@ebay/nice-modal-react";import{__rest as i}from"tslib";import{useEffect as s}from"react";import{ToastContainer as r}from"react-toastify";import{T as a}from"./tembo-notify-BSIZkV5f.js";import"antd";import"./InfoCircleOutlined-Hx86sClq.js";import"./CloseCircleOutlined-CSHx89Jn.js";const l=t=>n.jsx(e.Provider,{children:t.children}),m=o=>{var{showCloseButton:e=!1,showProgressBar:l=!1}=o,m=i(o,["showCloseButton","showProgressBar"]);const{colors:d,constants:c}=t();return s(()=>{a.init(d,c)},[d,c]),n.jsxs(n.Fragment,{children:[n.jsx(r,Object.assign({closeButton:e,hideProgressBar:!l},m)),n.jsx("style",{children:`\n .Toastify__toast {\n font-family: ${c.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 `})]})},d=({children:t,mode:e,antdThemeOverrides:i})=>n.jsx(o,{mode:e,antdThemeOverrides:i,children:n.jsxs(l,{children:[t,n.jsx(m,{})]})});export{d 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","
|
|
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","useNewTemboTheme","useEffect","TemboNotify","init","_jsxs","_Fragment","ToastContainer","Object","assign","closeButton","hideProgressBar","typography","fontFamily","TemboUIProviders","mode","antdThemeOverrides","TemboThemeProvider"],"mappings":"qWAGA,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,2tECtC3CC,EAAsD,EAC/DtB,WACAuB,OACAC,wBAGI3B,EAAAA,IAAC4B,EAAkB,CACfF,KAAMA,EACNC,mBAAoBA,WAEpBX,EAAAA,KAAClB,EAAkB,CAAAK,SAAA,CACdA,EACDH,EAAAA,IAACI,EAAmB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../tembo-notify-
|
|
1
|
+
"use strict";var e=require("../tembo-notify-ZYud9J7B.js");require("tslib"),require("../theme-provider-CCkR2IcZ.js"),require("react"),require("react-toastify"),require("../InfoCircleOutlined-DR9DmuN-.js"),require("../CloseCircleOutlined-CMilRURi.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-BSIZkV5f.js";import"tslib";import"../theme-provider-D2HR_D4s.js";import"react";import"react-toastify";import"../InfoCircleOutlined-Hx86sClq.js";import"../CloseCircleOutlined-CSHx89Jn.js";import"antd";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/providers.d.ts
CHANGED
|
@@ -1,37 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TemboThemeProviderProps } from './theme/
|
|
3
|
-
export interface TemboUIProvidersProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
/** Color palette overrides */
|
|
6
|
-
colors?: TemboThemeProviderProps['colors'];
|
|
7
|
-
/** UI constants overrides */
|
|
8
|
-
constants?: TemboThemeProviderProps['constants'];
|
|
9
|
-
/** Raw Ant Design theme overrides */
|
|
10
|
-
themeOverrides?: TemboThemeProviderProps['themeOverrides'];
|
|
11
|
-
}
|
|
2
|
+
import { TemboThemeProviderProps } from './theme/theme-provider.js';
|
|
12
3
|
/**
|
|
13
4
|
* Top-level provider that wires up theme, modal and notifications
|
|
14
5
|
* for all Tembo UI components.
|
|
15
|
-
*
|
|
16
|
-
* Supports theme customization through colors and constants props.
|
|
17
|
-
* TemboToastContainer automatically syncs with theme changes.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```tsx
|
|
21
|
-
* // Basic usage
|
|
22
|
-
* <TemboUIProviders>
|
|
23
|
-
* <App />
|
|
24
|
-
* </TemboUIProviders>
|
|
25
|
-
*
|
|
26
|
-
* // With custom colors
|
|
27
|
-
* <TemboUIProviders
|
|
28
|
-
* colors={{
|
|
29
|
-
* primary: { main: '#007bff' },
|
|
30
|
-
* action: { main: '#28a745' }
|
|
31
|
-
* }}
|
|
32
|
-
* >
|
|
33
|
-
* <App />
|
|
34
|
-
* </TemboUIProviders>
|
|
35
|
-
* ```
|
|
36
6
|
*/
|
|
37
|
-
export declare const TemboUIProviders: React.FC<
|
|
7
|
+
export declare const TemboUIProviders: React.FC<TemboThemeProviderProps>;
|
package/dist/providers.js
CHANGED
|
@@ -1,32 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import TemboModalProvider from './features/dialogs/modal-provider.js';
|
|
3
3
|
import TemboToastContainer from './features/notifications/toast-container.js';
|
|
4
|
-
import { TemboThemeProvider } from './theme/
|
|
4
|
+
import { TemboThemeProvider } from './theme/theme-provider.js';
|
|
5
5
|
/**
|
|
6
6
|
* Top-level provider that wires up theme, modal and notifications
|
|
7
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
8
|
*/
|
|
30
|
-
export const TemboUIProviders = ({ children,
|
|
31
|
-
return (_jsx(TemboThemeProvider, {
|
|
9
|
+
export const TemboUIProviders = ({ children, mode, antdThemeOverrides }) => {
|
|
10
|
+
return (_jsx(TemboThemeProvider, { mode: mode, antdThemeOverrides: antdThemeOverrides, children: _jsxs(TemboModalProvider, { children: [children, _jsx(TemboToastContainer, {})] }) }));
|
|
32
11
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{__rest as s}from"tslib";import{j as t}from"./theme-provider-D2HR_D4s.js";import{toast as o}from"react-toastify";import{I as i,b as n,a as e,R as a}from"./InfoCircleOutlined-Hx86sClq.js";import{R as r}from"./CloseCircleOutlined-CSHx89Jn.js";import*as l from"react";var c={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};function g(){return g=Object.assign?Object.assign.bind():function(s){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(s[i]=o[i])}return s},g.apply(this,arguments)}const d=(s,t)=>l.createElement(i,g({},s,{ref:t,icon:c})),u=l.forwardRef(d);
|
|
2
|
+
/** */"production"!==process.env.NODE_ENV&&(u.displayName="LoadingOutlined");const f=(s,o)=>{const i={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1,style:{fontFamily:o.typography.fontFamily.base,fontSize:14,borderRadius:10,padding:"10px 14px",boxShadow:"0 12px 24px rgba(15, 23, 42, 0.12)",border:"none",minHeight:56,backgroundColor:s.surface.overlay,color:s.text.primary,display:"flex",alignItems:"center",gap:8}},l=Object.assign(Object.assign({},i),{icon:t.jsx(n,{style:{fontSize:18,color:s.semantic.success.main}}),style:Object.assign(Object.assign({},i.style),{backgroundColor:s.semantic.success.subtle,color:s.semantic.success.main}),className:"toast-success"}),c=Object.assign(Object.assign({},i),{icon:t.jsx(r,{style:{fontSize:18,color:s.semantic.error.main}}),style:Object.assign(Object.assign({},i.style),{backgroundColor:s.semantic.error.subtle,color:s.semantic.error.main}),className:"toast-error"}),g=Object.assign(Object.assign({},i),{icon:t.jsx(e,{style:{fontSize:18,color:s.semantic.warning.main}}),style:Object.assign(Object.assign({},i.style),{backgroundColor:s.semantic.warning.subtle,color:s.semantic.warning.main}),className:"toast-warning"}),d=Object.assign(Object.assign({},i),{icon:t.jsx(a,{style:{fontSize:18,color:s.text.primary}}),style:Object.assign(Object.assign({},i.style),{backgroundColor:s.surface.overlay,color:s.text.primary}),className:"toast-info"});return{loadingConfig:Object.assign(Object.assign({},i),{icon:t.jsx(u,{style:{fontSize:18,color:s.neutral[4]}}),style:Object.assign(Object.assign({},i.style),{backgroundColor:s.surface.overlay,color:s.text.primary}),autoClose:!1,closeButton:!1,hideProgressBar:!0,className:"toast-loading"}),infoConfig:d,warningConfig:g,errorConfig:c,successConfig:l,baseConfig:i,colors:s}},C={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1};class b{static init(s,t){this.configs=f(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.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("div",{style:{fontWeight:600,fontSize:14},children:s.title}),t.jsx("div",{style:{fontSize:13,fontWeight:400,opacity:.95},children:s.description})]}):o&&!i?t.jsx("div",{style:{fontWeight:600,fontSize:14},children:s.title}):!o&&i?t.jsx("div",{style:{fontSize:13,fontWeight:500},children:s.description}):""}return s}static buildOptions(t,o){const i=o||{},{duration:n,toastId:e,onClick:a,onClose:r}=i,l=s(i,["duration","toastId","onClick","onClose"]),c=null!=t?t:C;return Object.assign(Object.assign(Object.assign({},c),l),{toastId:e,autoClose:void 0!==n?n||!1:c.autoClose,onClick:a,onClose:r})}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),n=this.buildOptions(this.getSuccessConfig(),t);return o.success(i,n)}static error(s,t){const i=this.formatMessage(s),n=this.buildOptions(this.getErrorConfig(),t);return o.error(i,n)}static warning(s,t){const i=this.formatMessage(s),n=this.buildOptions(this.getWarningConfig(),t);return o.warning(i,n)}static info(s,t){const i=this.formatMessage(s),n=this.buildOptions(this.getInfoConfig(),t);return o.info(i,n)}static loading(t,i){var n;const e=this.formatMessage(t),a=i||{},{toastId:r,onClick:l,onClose:c}=a,g=s(a,["toastId","onClick","onClose"]),d=null!==(n=this.getLoadingConfig())&&void 0!==n?n:C;return o.loading(e,Object.assign(Object.assign(Object.assign({},d),g),{toastId:r,onClick:l,onClose:c}))}static update(s,t){var i,n;const e=this.getConfigs(),a=t.type&&e?{success:e.successConfig,error:e.errorConfig,warning:e.warningConfig,info:e.infoConfig}[t.type]:void 0,r=t.message?this.formatMessage(t.message):t.render;o.update(s,Object.assign({render:r,type:t.type,isLoading:!1,autoClose:null!==(n=null!==(i=t.autoClose)&&void 0!==i?i:null==a?void 0:a.autoClose)&&void 0!==n?n:C.autoClose},null!=a?a:{}))}static dismiss(s){o.dismiss(s)}static dismissAll(){o.dismiss()}static isActive(s){return o.isActive(s)}}b.configs=null;export{b as T,f as b};
|
|
3
|
+
//# sourceMappingURL=tembo-notify-BSIZkV5f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tembo-notify-BSIZkV5f.js","sources":["../node_modules/@ant-design/icons-svg/es/asn/LoadingOutlined.js","../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js","../src/features/notifications/toast-config.tsx","../src/features/notifications/tembo-notify.tsx"],"sourcesContent":["// This icon file is generated automatically.\nvar LoadingOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z\" } }] }, \"name\": \"loading\", \"theme\": \"outlined\" };\nexport default LoadingOutlined;\n","function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nimport * as React from 'react';\nimport LoadingOutlinedSvg from \"@ant-design/icons-svg/es/asn/LoadingOutlined\";\nimport AntdIcon from \"../components/AntdIcon\";\nconst LoadingOutlined = (props, ref) => /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {\n ref: ref,\n icon: LoadingOutlinedSvg\n}));\n\n/** */\nconst RefIcon = /*#__PURE__*/React.forwardRef(LoadingOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'LoadingOutlined';\n}\nexport default RefIcon;",null,null],"names":["LoadingOutlined","icon","tag","attrs","viewBox","focusable","children","d","name","theme","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","props","ref","React","createElement","AntdIcon","LoadingOutlinedSvg","RefIcon","forwardRef","process","env","NODE_ENV","displayName","buildToastConfigs","colors","constants","baseConfig","position","autoClose","hideProgressBar","closeOnClick","pauseOnHover","draggable","closeButton","style","fontFamily","typography","base","fontSize","borderRadius","padding","boxShadow","border","minHeight","backgroundColor","surface","overlay","color","text","primary","display","alignItems","gap","successConfig","_jsx","CheckCircleOutlined","semantic","success","main","subtle","className","errorConfig","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","loadingConfig","neutral","FALLBACK_BASE_CONFIG","TemboNotify","init","configs","getConfigs","formatMessage","message","hasTitle","title","hasDescription","description","_jsxs","flexDirection","fontWeight","opacity","buildOptions","options","_a","duration","toastId","onClick","onClose","restOptions","__rest","effectiveBase","undefined","getSuccessConfig","_b","getErrorConfig","getWarningConfig","getInfoConfig","getLoadingConfig","content","toastOptions","toast","info","loading","update","id","typeConfig","type","render","isLoading","dismiss","dismissAll","isActive"],"mappings":"+QACA,IAAIA,EAAkB,CAAEC,KAAQ,CAAEC,IAAO,MAAOC,MAAS,CAAEC,QAAW,gBAAiBC,UAAa,SAAWC,SAAY,CAAC,CAAEJ,IAAO,OAAQC,MAAS,CAAEI,EAAK,kUAAsUC,KAAQ,UAAWC,MAAS,YCD/f,SAASC,IAAiS,OAApRA,EAAWC,OAAOC,OAASD,OAAOC,OAAOC,OAAS,SAAUC,GAAU,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAAE,IAAIG,EAASF,UAAUD,GAAI,IAAK,IAAII,KAAOD,EAAcP,OAAOS,UAAUC,eAAeC,KAAKJ,EAAQC,KAAQL,EAAOK,GAAOD,EAAOC,GAAU,CAAE,OAAOL,CAAQ,EAAUJ,EAASa,MAAMC,KAAMR,UAAY,CAOlV,MAAMhB,EAAkB,CAACyB,EAAOC,IAAqBC,EAAMC,cAAcC,EAAUnB,EAAS,CAAA,EAAIe,EAAO,CACrGC,IAAKA,EACLzB,KAAM6B,KAIFC,EAAuBJ,EAAMK,WAAWhC;4oBACjB,eAAzBiC,QAAQC,IAAIC,WACdJ,EAAQK,YAAc,yBCJXC,EAAoB,CAC7BC,EACAC,KAKA,MAAMC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3C,CAAA,UAAA,UAAA,YACAxE,EAAoC,QAAvB8D,EAAA9E,KAAK4F,0BAAkB,IAAAd,EAAAA,EAAIjB,EAE9C,OAAOkC,EAAME,QAAQJ,+CACd7E,GACAmE,GAAW,CACdH,UACAC,UACAC,YAER,CAEA,aAAOgB,CAAOC,EAAQtB,WAMlB,MAAMb,EAAUhE,KAAKiE,aAEfmC,EACFvB,EAAQwB,MAAQrC,EACV,CACEjB,QAASiB,EAAQrB,cACjBU,MAAOW,EAAQb,YACfK,QAASQ,EAAQV,cACjB0C,KAAMhC,EAAQP,YAChBoB,EAAQwB,WACRf,EAEJO,EAAUhB,EAAQV,QAClBnE,KAAKkE,cAAcW,EAAQV,SAC3BU,EAAQyB,OAEdP,EAAMG,OAAOC,iBACTG,OAAQT,EACRQ,KAAMxB,EAAQwB,KACdE,WAAW,EACXrF,UAEyB,QADrBsE,EAAiB,QAAjBV,EAAAD,EAAQ3D,iBAAS,IAAA4D,EAAAA,EACjBsB,eAAAA,EAAYlF,iBAAS,IAAAsE,EAAAA,EACrB3B,EAAqB3C,WACrBkF,QAAAA,EAAc,CAAA,GAE1B,CAEA,cAAOI,CAAQL,GACXJ,EAAMS,QAAQL,EAClB,CAEA,iBAAOM,GACHV,EAAMS,SACV,CAEA,eAAOE,CAASP,GACZ,OAAOJ,EAAMW,SAASP,EAC1B,EAxLerC,EAAAE,QAA+B","x_google_ignoreList":[0,1]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";var t=require("tslib"),s=require("./theme-provider-CCkR2IcZ.js"),e=require("react-toastify"),o=require("./InfoCircleOutlined-DR9DmuN-.js"),i=require("./CloseCircleOutlined-CMilRURi.js");function n(t){if(t&&t.__esModule)return t;var s=Object.create(null);return t&&Object.keys(t).forEach(function(e){if("default"!==e){var o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,o.get?o:{enumerable:!0,get:function(){return t[e]}})}}),s.default=t,Object.freeze(s)}var r=n(require("react")),a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};function c(){return c=Object.assign?Object.assign.bind():function(t){for(var s=1;s<arguments.length;s++){var e=arguments[s];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},c.apply(this,arguments)}const l=(t,s)=>r.createElement(o.Icon,c({},t,{ref:s,icon:a})),g=r.forwardRef(l);
|
|
2
|
+
/** */"production"!==process.env.NODE_ENV&&(g.displayName="LoadingOutlined");const u=(t,e)=>{const n={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1,style:{fontFamily:e.typography.fontFamily.base,fontSize:14,borderRadius:10,padding:"10px 14px",boxShadow:"0 12px 24px rgba(15, 23, 42, 0.12)",border:"none",minHeight:56,backgroundColor:t.surface.overlay,color:t.text.primary,display:"flex",alignItems:"center",gap:8}},r=Object.assign(Object.assign({},n),{icon:s.jsxRuntimeExports.jsx(o.RefIcon$2,{style:{fontSize:18,color:t.semantic.success.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:t.semantic.success.subtle,color:t.semantic.success.main}),className:"toast-success"}),a=Object.assign(Object.assign({},n),{icon:s.jsxRuntimeExports.jsx(i.RefIcon,{style:{fontSize:18,color:t.semantic.error.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:t.semantic.error.subtle,color:t.semantic.error.main}),className:"toast-error"}),c=Object.assign(Object.assign({},n),{icon:s.jsxRuntimeExports.jsx(o.RefIcon$1,{style:{fontSize:18,color:t.semantic.warning.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:t.semantic.warning.subtle,color:t.semantic.warning.main}),className:"toast-warning"}),l=Object.assign(Object.assign({},n),{icon:s.jsxRuntimeExports.jsx(o.RefIcon,{style:{fontSize:18,color:t.text.primary}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:t.surface.overlay,color:t.text.primary}),className:"toast-info"});return{loadingConfig:Object.assign(Object.assign({},n),{icon:s.jsxRuntimeExports.jsx(g,{style:{fontSize:18,color:t.neutral[4]}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:t.surface.overlay,color:t.text.primary}),autoClose:!1,closeButton:!1,hideProgressBar:!0,className:"toast-loading"}),infoConfig:l,warningConfig:c,errorConfig:a,successConfig:r,baseConfig:n,colors:t}},d={position:"top-right",autoClose:4e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,closeButton:!1};class f{static init(t,s){this.configs=u(t,s)}static getConfigs(){return this.configs}static formatMessage(t){if(t&&"object"==typeof t&&!("$$typeof"in t)){const e=!!t.title,o=!!t.description;return e&&o?s.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[s.jsxRuntimeExports.jsx("div",{style:{fontWeight:600,fontSize:14},children:t.title}),s.jsxRuntimeExports.jsx("div",{style:{fontSize:13,fontWeight:400,opacity:.95},children:t.description})]}):e&&!o?s.jsxRuntimeExports.jsx("div",{style:{fontWeight:600,fontSize:14},children:t.title}):!e&&o?s.jsxRuntimeExports.jsx("div",{style:{fontSize:13,fontWeight:500},children:t.description}):""}return t}static buildOptions(s,e){const o=e||{},{duration:i,toastId:n,onClick:r,onClose:a}=o,c=t.__rest(o,["duration","toastId","onClick","onClose"]),l=null!=s?s:d;return Object.assign(Object.assign(Object.assign({},l),c),{toastId:n,autoClose:void 0!==i?i||!1:l.autoClose,onClick:r,onClose:a})}static getSuccessConfig(){var t,s;const e=this.getConfigs();return null!==(s=null!==(t=null==e?void 0:e.successConfig)&&void 0!==t?t:null==e?void 0:e.baseConfig)&&void 0!==s?s:void 0}static getErrorConfig(){var t,s;const e=this.getConfigs();return null!==(s=null!==(t=null==e?void 0:e.errorConfig)&&void 0!==t?t:null==e?void 0:e.baseConfig)&&void 0!==s?s:void 0}static getWarningConfig(){var t,s;const e=this.getConfigs();return null!==(s=null!==(t=null==e?void 0:e.warningConfig)&&void 0!==t?t:null==e?void 0:e.baseConfig)&&void 0!==s?s:void 0}static getInfoConfig(){var t,s;const e=this.getConfigs();return null!==(s=null!==(t=null==e?void 0:e.infoConfig)&&void 0!==t?t:null==e?void 0:e.baseConfig)&&void 0!==s?s:void 0}static getLoadingConfig(){var t,s;const e=this.getConfigs();return null!==(s=null!==(t=null==e?void 0:e.loadingConfig)&&void 0!==t?t:null==e?void 0:e.baseConfig)&&void 0!==s?s:void 0}static success(t,s){const o=this.formatMessage(t),i=this.buildOptions(this.getSuccessConfig(),s);return e.toast.success(o,i)}static error(t,s){const o=this.formatMessage(t),i=this.buildOptions(this.getErrorConfig(),s);return e.toast.error(o,i)}static warning(t,s){const o=this.formatMessage(t),i=this.buildOptions(this.getWarningConfig(),s);return e.toast.warning(o,i)}static info(t,s){const o=this.formatMessage(t),i=this.buildOptions(this.getInfoConfig(),s);return e.toast.info(o,i)}static loading(s,o){var i;const n=this.formatMessage(s),r=o||{},{toastId:a,onClick:c,onClose:l}=r,g=t.__rest(r,["toastId","onClick","onClose"]),u=null!==(i=this.getLoadingConfig())&&void 0!==i?i:d;return e.toast.loading(n,Object.assign(Object.assign(Object.assign({},u),g),{toastId:a,onClick:c,onClose:l}))}static update(t,s){var o,i;const n=this.getConfigs(),r=s.type&&n?{success:n.successConfig,error:n.errorConfig,warning:n.warningConfig,info:n.infoConfig}[s.type]:void 0,a=s.message?this.formatMessage(s.message):s.render;e.toast.update(t,Object.assign({render:a,type:s.type,isLoading:!1,autoClose:null!==(i=null!==(o=s.autoClose)&&void 0!==o?o:null==r?void 0:r.autoClose)&&void 0!==i?i:d.autoClose},null!=r?r:{}))}static dismiss(t){e.toast.dismiss(t)}static dismissAll(){e.toast.dismiss()}static isActive(t){return e.toast.isActive(t)}}f.configs=null,exports.TemboNotify=f,exports.buildToastConfigs=u;
|
|
3
|
+
//# sourceMappingURL=tembo-notify-ZYud9J7B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tembo-notify-ZYud9J7B.js","sources":["../node_modules/@ant-design/icons-svg/es/asn/LoadingOutlined.js","../node_modules/@ant-design/icons/es/icons/LoadingOutlined.js","../src/features/notifications/toast-config.tsx","../src/features/notifications/tembo-notify.tsx"],"sourcesContent":["// This icon file is generated automatically.\nvar LoadingOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"0 0 1024 1024\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z\" } }] }, \"name\": \"loading\", \"theme\": \"outlined\" };\nexport default LoadingOutlined;\n","function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nimport * as React from 'react';\nimport LoadingOutlinedSvg from \"@ant-design/icons-svg/es/asn/LoadingOutlined\";\nimport AntdIcon from \"../components/AntdIcon\";\nconst LoadingOutlined = (props, ref) => /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {\n ref: ref,\n icon: LoadingOutlinedSvg\n}));\n\n/** */\nconst RefIcon = /*#__PURE__*/React.forwardRef(LoadingOutlined);\nif (process.env.NODE_ENV !== 'production') {\n RefIcon.displayName = 'LoadingOutlined';\n}\nexport default RefIcon;",null,null],"names":["LoadingOutlined","icon","tag","attrs","viewBox","focusable","children","d","name","theme","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","props","ref","React","createElement","AntdIcon","LoadingOutlinedSvg","RefIcon","forwardRef","process","env","NODE_ENV","displayName","buildToastConfigs","colors","constants","baseConfig","position","autoClose","hideProgressBar","closeOnClick","pauseOnHover","draggable","closeButton","style","fontFamily","typography","base","fontSize","borderRadius","padding","boxShadow","border","minHeight","backgroundColor","surface","overlay","color","text","primary","display","alignItems","gap","successConfig","_jsx","CheckCircleOutlined","semantic","success","main","subtle","className","errorConfig","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","loadingConfig","neutral","FALLBACK_BASE_CONFIG","TemboNotify","init","configs","getConfigs","formatMessage","message","hasTitle","title","hasDescription","description","_jsxs","flexDirection","fontWeight","opacity","buildOptions","options","_a","duration","toastId","onClick","onClose","restOptions","__rest","effectiveBase","undefined","getSuccessConfig","_b","getErrorConfig","getWarningConfig","getInfoConfig","getLoadingConfig","content","toastOptions","toast","info","loading","update","id","typeConfig","type","render","isLoading","dismiss","dismissAll","isActive"],"mappings":"8fACIA,EAAkB,CAAEC,KAAQ,CAAEC,IAAO,MAAOC,MAAS,CAAEC,QAAW,gBAAiBC,UAAa,SAAWC,SAAY,CAAC,CAAEJ,IAAO,OAAQC,MAAS,CAAEI,EAAK,kUAAsUC,KAAQ,UAAWC,MAAS,YCD/f,SAASC,IAAiS,OAApRA,EAAWC,OAAOC,OAASD,OAAOC,OAAOC,OAAS,SAAUC,GAAU,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK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WACrBkF,QAAAA,EAAc,CAAA,GAE1B,CAEA,cAAOI,CAAQL,GACXJ,EAAAA,MAAMS,QAAQL,EAClB,CAEA,iBAAOM,GACHV,EAAAA,MAAMS,SACV,CAEA,eAAOE,CAASP,GACZ,OAAOJ,EAAAA,MAAMW,SAASP,EAC1B,EAxLerC,EAAAE,QAA+B","x_google_ignoreList":[0,1]}
|
|
@@ -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
|
};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { merge } from "lodash";
|
|
2
|
+
/**
|
|
3
|
+
* Base color values for light theme
|
|
4
|
+
* These are the actual color values that get mapped to the palette
|
|
5
|
+
*/
|
|
6
|
+
const lightModeColors = {
|
|
7
|
+
neutral: {
|
|
8
|
+
0: '#ffffff',
|
|
9
|
+
1: '#fafafa',
|
|
10
|
+
2: '#f5f5f5',
|
|
11
|
+
3: '#f0f0f0',
|
|
12
|
+
4: '#e5e5e5',
|
|
13
|
+
5: '#d4d4d4',
|
|
14
|
+
6: '#b3b3b3',
|
|
15
|
+
7: '#999999',
|
|
16
|
+
8: '#666666',
|
|
17
|
+
9: '#1a1a1a',
|
|
18
|
+
10: '#000000',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Base color values for dark theme
|
|
23
|
+
* Inverted neutral scale for dark mode
|
|
24
|
+
*/
|
|
25
|
+
const darkModeColors = {
|
|
26
|
+
neutral: {
|
|
27
|
+
0: '#000000',
|
|
28
|
+
1: '#1a1a1a',
|
|
29
|
+
2: '#666666',
|
|
30
|
+
3: '#999999',
|
|
31
|
+
4: '#b3b3b3',
|
|
32
|
+
5: '#d4d4d4',
|
|
33
|
+
6: '#e5e5e5',
|
|
34
|
+
7: '#f0f0f0',
|
|
35
|
+
8: '#f5f5f5',
|
|
36
|
+
9: '#fafafa',
|
|
37
|
+
10: '#ffffff',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Build default color palette for a given theme mode
|
|
42
|
+
*
|
|
43
|
+
* @param mode - 'light' or 'dark'
|
|
44
|
+
* @returns Complete color palette with theme-aware neutral scale
|
|
45
|
+
*/
|
|
46
|
+
const buildDefaultPalette = (mode) => {
|
|
47
|
+
const modeColors = mode === 'light' ? lightModeColors : darkModeColors;
|
|
48
|
+
return {
|
|
49
|
+
primary: {
|
|
50
|
+
main: '#000000',
|
|
51
|
+
hover: '#1a1a1a',
|
|
52
|
+
active: '#000000',
|
|
53
|
+
light: '#666666',
|
|
54
|
+
lighter: '#999999',
|
|
55
|
+
contrast: '#FFFFFF',
|
|
56
|
+
},
|
|
57
|
+
action: {
|
|
58
|
+
main: '#1a6985',
|
|
59
|
+
hover: '#145268',
|
|
60
|
+
active: '#0f3d4f',
|
|
61
|
+
light: '#e8f2f5',
|
|
62
|
+
lighter: '#f4f9fa',
|
|
63
|
+
disabled: '#a3c9d6',
|
|
64
|
+
contrast: '#FFFFFF',
|
|
65
|
+
},
|
|
66
|
+
absolute: {
|
|
67
|
+
white: '#ffffff',
|
|
68
|
+
black: '#000000',
|
|
69
|
+
},
|
|
70
|
+
neutral: {
|
|
71
|
+
// Numeric scale (theme-aware)
|
|
72
|
+
0: modeColors.neutral[0],
|
|
73
|
+
1: modeColors.neutral[1],
|
|
74
|
+
2: modeColors.neutral[2],
|
|
75
|
+
3: modeColors.neutral[3],
|
|
76
|
+
4: modeColors.neutral[4],
|
|
77
|
+
5: modeColors.neutral[5],
|
|
78
|
+
6: modeColors.neutral[6],
|
|
79
|
+
7: modeColors.neutral[7],
|
|
80
|
+
8: modeColors.neutral[8],
|
|
81
|
+
9: modeColors.neutral[9],
|
|
82
|
+
10: modeColors.neutral[10],
|
|
83
|
+
// Convenient aliases (map to numeric scale)
|
|
84
|
+
brightest: modeColors.neutral[0],
|
|
85
|
+
lightest: modeColors.neutral[1],
|
|
86
|
+
lighter: modeColors.neutral[2],
|
|
87
|
+
light: modeColors.neutral[3],
|
|
88
|
+
medium: modeColors.neutral[5],
|
|
89
|
+
dark: modeColors.neutral[7],
|
|
90
|
+
darker: modeColors.neutral[8],
|
|
91
|
+
darkest: modeColors.neutral[9],
|
|
92
|
+
dimmest: modeColors.neutral[10],
|
|
93
|
+
},
|
|
94
|
+
success: {
|
|
95
|
+
main: '#10b981',
|
|
96
|
+
bg: '#ecfdf5',
|
|
97
|
+
border: '#a7f3d0',
|
|
98
|
+
text: '#047857',
|
|
99
|
+
},
|
|
100
|
+
error: {
|
|
101
|
+
main: '#ef4444',
|
|
102
|
+
bg: '#fef2f2',
|
|
103
|
+
border: '#fecaca',
|
|
104
|
+
text: '#dc2626',
|
|
105
|
+
},
|
|
106
|
+
warning: {
|
|
107
|
+
main: '#f59e0b',
|
|
108
|
+
bg: '#fffbeb',
|
|
109
|
+
border: '#fde68a',
|
|
110
|
+
text: '#d97706',
|
|
111
|
+
},
|
|
112
|
+
info: {
|
|
113
|
+
main: '#1a6985',
|
|
114
|
+
bg: '#e8f2f5',
|
|
115
|
+
border: '#b8d9e6',
|
|
116
|
+
text: '#0f3d4f',
|
|
117
|
+
},
|
|
118
|
+
surface: {
|
|
119
|
+
background: modeColors.neutral[0],
|
|
120
|
+
main: modeColors.neutral[0],
|
|
121
|
+
elevated: modeColors.neutral[0],
|
|
122
|
+
hover: modeColors.neutral[1],
|
|
123
|
+
subtle: modeColors.neutral[1],
|
|
124
|
+
},
|
|
125
|
+
text: {
|
|
126
|
+
primary: modeColors.neutral[10],
|
|
127
|
+
secondary: modeColors.neutral[8],
|
|
128
|
+
tertiary: modeColors.neutral[7],
|
|
129
|
+
quaternary: modeColors.neutral[6],
|
|
130
|
+
disabled: modeColors.neutral[5],
|
|
131
|
+
inverse: modeColors.neutral[0],
|
|
132
|
+
},
|
|
133
|
+
border: {
|
|
134
|
+
main: modeColors.neutral[4],
|
|
135
|
+
light: modeColors.neutral[3],
|
|
136
|
+
strong: modeColors.neutral[5],
|
|
137
|
+
divider: modeColors.neutral[4],
|
|
138
|
+
},
|
|
139
|
+
components: {
|
|
140
|
+
button: {
|
|
141
|
+
primary: {
|
|
142
|
+
bg: '#1a6985',
|
|
143
|
+
hover: '#145268',
|
|
144
|
+
text: '#FFFFFF',
|
|
145
|
+
},
|
|
146
|
+
default: {
|
|
147
|
+
bg: modeColors.neutral[0],
|
|
148
|
+
border: modeColors.neutral[5],
|
|
149
|
+
text: modeColors.neutral[10],
|
|
150
|
+
hover: modeColors.neutral[1],
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
input: {
|
|
154
|
+
bg: modeColors.neutral[0],
|
|
155
|
+
border: modeColors.neutral[5],
|
|
156
|
+
borderHover: modeColors.neutral[7],
|
|
157
|
+
borderFocus: '#1a6985',
|
|
158
|
+
placeholder: modeColors.neutral[7],
|
|
159
|
+
},
|
|
160
|
+
table: {
|
|
161
|
+
bg: modeColors.neutral[0],
|
|
162
|
+
headerBg: modeColors.neutral[1],
|
|
163
|
+
headerText: modeColors.neutral[10],
|
|
164
|
+
border: modeColors.neutral[4],
|
|
165
|
+
rowHover: modeColors.neutral[1],
|
|
166
|
+
},
|
|
167
|
+
sidebar: {
|
|
168
|
+
bg: '#000000',
|
|
169
|
+
hover: 'rgba(255, 255, 255, 0.08)',
|
|
170
|
+
selected: 'rgba(255, 255, 255, 0.12)',
|
|
171
|
+
text: '#FFFFFF',
|
|
172
|
+
textSecondary: 'rgba(255, 255, 255, 0.65)',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
utility: {
|
|
176
|
+
transparent: 'transparent',
|
|
177
|
+
link: '#1a6985',
|
|
178
|
+
linkHover: '#145268',
|
|
179
|
+
linkActive: '#0f3d4f',
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Default color palette for light theme
|
|
185
|
+
*/
|
|
186
|
+
export const defaultColorPalette = buildDefaultPalette('light');
|
|
187
|
+
/**
|
|
188
|
+
* Build a complete color palette by merging overrides with defaults
|
|
189
|
+
* Performs deep merge to allow partial nested overrides
|
|
190
|
+
*
|
|
191
|
+
* @param overrides - Partial color palette overrides
|
|
192
|
+
* @param mode - Theme mode ('light' or 'dark')
|
|
193
|
+
* @returns Complete color palette with overrides applied
|
|
194
|
+
*/
|
|
195
|
+
export const buildColorPalette = (overrides, mode = 'light') => {
|
|
196
|
+
const basePalette = buildDefaultPalette(mode);
|
|
197
|
+
if (!overrides)
|
|
198
|
+
return basePalette;
|
|
199
|
+
const merged = merge({}, basePalette, overrides);
|
|
200
|
+
// After merging, ensure neutral aliases are synced with numeric values
|
|
201
|
+
// This handles cases where overrides might change the numeric scale
|
|
202
|
+
merged.neutral.brightest = merged.neutral[0];
|
|
203
|
+
merged.neutral.lightest = merged.neutral[1];
|
|
204
|
+
merged.neutral.lighter = merged.neutral[2];
|
|
205
|
+
merged.neutral.light = merged.neutral[3];
|
|
206
|
+
merged.neutral.medium = merged.neutral[5];
|
|
207
|
+
merged.neutral.dark = merged.neutral[7];
|
|
208
|
+
merged.neutral.darker = merged.neutral[8];
|
|
209
|
+
merged.neutral.darkest = merged.neutral[9];
|
|
210
|
+
merged.neutral.dimmest = merged.neutral[10];
|
|
211
|
+
return merged;
|
|
212
|
+
};
|