@temboplus/frontend-react-core 0.1.3-beta.10 → 0.1.3-beta.11
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/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 -11
- package/dist/providers.js +3 -3
- package/dist/tembo-notify-Bh92g5d-.js +3 -0
- package/dist/tembo-notify-Bh92g5d-.js.map +1 -0
- package/dist/tembo-notify-D_LOB3jW.js +3 -0
- package/dist/tembo-notify-D_LOB3jW.js.map +1 -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 +6 -0
- package/dist/theme/theme-config.js +762 -0
- package/dist/theme/theme-provider.d.ts +60 -63
- package/dist/theme/theme-provider.js +73 -377
- package/dist/theme/tokens/color.d.ts +168 -0
- package/dist/theme/tokens/color.js +225 -0
- package/dist/theme/tokens/radius.d.ts +26 -0
- package/dist/theme/tokens/radius.js +17 -0
- package/dist/theme/tokens/shadow.d.ts +27 -0
- package/dist/theme/tokens/shadow.js +23 -0
- package/dist/theme/tokens/spacing.d.ts +47 -0
- package/dist/theme/tokens/spacing.js +32 -0
- package/dist/theme/tokens/typography.d.ts +43 -0
- package/dist/theme/tokens/typography.js +33 -0
- package/dist/theme-provider-C31WJ-NK.js +11 -0
- package/dist/theme-provider-C31WJ-NK.js.map +1 -0
- package/dist/theme-provider-DH1PzDC8.js +11 -0
- package/dist/theme-provider-DH1PzDC8.js.map +1 -0
- package/dist/validation/index.cjs.js.map +1 -1
- package/dist/validation/index.js.map +1 -1
- package/package.json +15 -16
- 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-CW-jqBMI.js +0 -2
- package/dist/ZoomOutOutlined-CW-jqBMI.js.map +0 -1
- package/dist/ZoomOutOutlined-Pw8hpWWK.js +0 -2
- package/dist/ZoomOutOutlined-Pw8hpWWK.js.map +0 -1
- package/dist/tembo-notify-Bp14qngd.js +0 -2
- package/dist/tembo-notify-Bp14qngd.js.map +0 -1
- package/dist/tembo-notify-h5Xn66oA.js +0 -2
- package/dist/tembo-notify-h5Xn66oA.js.map +0 -1
- package/dist/theme-provider-Ca4P0Hcp.js +0 -11
- package/dist/theme-provider-Ca4P0Hcp.js.map +0 -1
- package/dist/theme-provider-RhAw3jw_.js +0 -11
- package/dist/theme-provider-RhAw3jw_.js.map +0 -1
- /package/dist/theme/{colors.d.ts → deprecated/colors.d.ts} +0 -0
- /package/dist/theme/{colors.js → deprecated/colors.js} +0 -0
- /package/dist/theme/{constants.d.ts → deprecated/constants.d.ts} +0 -0
- /package/dist/theme/{constants.js → deprecated/constants.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tembo-notify-Bh92g5d-.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","fontSize","borderRadius","padding","boxShadow","border","minHeight","backgroundColor","surface","elevated","color","text","primary","display","alignItems","gap","successConfig","_jsx","CheckCircleOutlined","success","main","bg","className","errorConfig","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","info","loadingConfig","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","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,OAAO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ider-C31WJ-NK.js"),o=require("react-toastify"),e=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(o){if("default"!==o){var e=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(s,o,e.get?e:{enumerable:!0,get:function(){return t[o]}})}}),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 o=arguments[s];for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e])}return t},c.apply(this,arguments)}const l=(t,s)=>r.createElement(e.Icon,c({},t,{ref:s,icon:a})),g=r.forwardRef(l);
|
|
2
|
+
/** */"production"!==process.env.NODE_ENV&&(g.displayName="LoadingOutlined");const u=(t,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:t.surface.elevated,color:t.text.primary,display:"flex",alignItems:"center",gap:8}},r=Object.assign(Object.assign({},n),{icon:s.jsxRuntimeExports.jsx(e.RefIcon$2,{style:{fontSize:18,color:t.success.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:t.success.bg,color:t.success.text}),className:"toast-success"}),a=Object.assign(Object.assign({},n),{icon:s.jsxRuntimeExports.jsx(i.RefIcon,{style:{fontSize:18,color:t.error.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:t.error.bg,color:t.error.text}),className:"toast-error"}),c=Object.assign(Object.assign({},n),{icon:s.jsxRuntimeExports.jsx(e.RefIcon$1,{style:{fontSize:18,color:t.warning.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:t.warning.bg,color:t.warning.text}),className:"toast-warning"}),l=Object.assign(Object.assign({},n),{icon:s.jsxRuntimeExports.jsx(e.RefIcon,{style:{fontSize:18,color:t.info.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:t.surface.elevated,color:t.text.primary}),className:"toast-info"});return{loadingConfig:Object.assign(Object.assign({},n),{icon:s.jsxRuntimeExports.jsx(g,{style:{fontSize:18,color:t.primary.main}}),style:Object.assign(Object.assign({},n.style),{backgroundColor:t.surface.elevated,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 o=!!t.title,e=!!t.description;return o&&e?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})]}):o&&!e?s.jsxRuntimeExports.jsx("div",{style:{fontWeight:600,fontSize:14},children:t.title}):!o&&e?s.jsxRuntimeExports.jsx("div",{style:{fontSize:13,fontWeight:500},children:t.description}):""}return t}static buildOptions(s,o){const e=o||{},{duration:i,toastId:n,onClick:r,onClose:a}=e,c=t.__rest(e,["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 o=this.getConfigs();return null!==(s=null!==(t=null==o?void 0:o.successConfig)&&void 0!==t?t:null==o?void 0:o.baseConfig)&&void 0!==s?s:void 0}static getErrorConfig(){var t,s;const o=this.getConfigs();return null!==(s=null!==(t=null==o?void 0:o.errorConfig)&&void 0!==t?t:null==o?void 0:o.baseConfig)&&void 0!==s?s:void 0}static getWarningConfig(){var t,s;const o=this.getConfigs();return null!==(s=null!==(t=null==o?void 0:o.warningConfig)&&void 0!==t?t:null==o?void 0:o.baseConfig)&&void 0!==s?s:void 0}static getInfoConfig(){var t,s;const o=this.getConfigs();return null!==(s=null!==(t=null==o?void 0:o.infoConfig)&&void 0!==t?t:null==o?void 0:o.baseConfig)&&void 0!==s?s:void 0}static getLoadingConfig(){var t,s;const o=this.getConfigs();return null!==(s=null!==(t=null==o?void 0:o.loadingConfig)&&void 0!==t?t:null==o?void 0:o.baseConfig)&&void 0!==s?s:void 0}static success(t,s){const e=this.formatMessage(t),i=this.buildOptions(this.getSuccessConfig(),s);return o.toast.success(e,i)}static error(t,s){const e=this.formatMessage(t),i=this.buildOptions(this.getErrorConfig(),s);return o.toast.error(e,i)}static warning(t,s){const e=this.formatMessage(t),i=this.buildOptions(this.getWarningConfig(),s);return o.toast.warning(e,i)}static info(t,s){const e=this.formatMessage(t),i=this.buildOptions(this.getInfoConfig(),s);return o.toast.info(e,i)}static loading(s,e){var i;const n=this.formatMessage(s),r=e||{},{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 o.toast.loading(n,Object.assign(Object.assign(Object.assign({},u),g),{toastId:a,onClick:c,onClose:l}))}static update(t,s){var e,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;o.toast.update(t,Object.assign({render:a,type:s.type,isLoading:!1,autoClose:null!==(i=null!==(e=s.autoClose)&&void 0!==e?e:null==r?void 0:r.autoClose)&&void 0!==i?i:d.autoClose},null!=r?r:{}))}static dismiss(t){o.toast.dismiss(t)}static dismissAll(){o.toast.dismiss()}static isActive(t){return o.toast.isActive(t)}}f.configs=null,exports.TemboNotify=f,exports.buildToastConfigs=u;
|
|
3
|
+
//# sourceMappingURL=tembo-notify-D_LOB3jW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tembo-notify-D_LOB3jW.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","fontSize","borderRadius","padding","boxShadow","border","minHeight","backgroundColor","surface","elevated","color","text","primary","display","alignItems","gap","successConfig","_jsx","CheckCircleOutlined","success","main","bg","className","errorConfig","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","info","loadingConfig","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","loading","update","id","typeConfig","type","render","isLoading","dismiss","dismissAll","isActive"],"mappings":"8fACIA,EAAkB,CAAEC,KAAQ,CAAEC,IAAO,MAAOC,MAAS,CAAEC,QAAW,gBAAiBC,UAAa,SAAWC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QR,EACRO,KAAMvB,EAAQuB,KACdE,WAAW,EACXlF,UAEyB,QADrBoE,EAAiB,QAAjBV,EAAAD,EAAQzD,iBAAS,IAAA0D,EAAAA,EACjBqB,eAAAA,EAAY/E,iBAAS,IAAAoE,EAAAA,EACrB3B,EAAqBzC,WACrB+E,QAAAA,EAAc,CAAA,GAE1B,CAEA,cAAOI,CAAQL,GACXH,EAAAA,MAAMQ,QAAQL,EAClB,CAEA,iBAAOM,GACHT,EAAAA,MAAMQ,SACV,CAEA,eAAOE,CAASP,GACZ,OAAOH,EAAAA,MAAMU,SAASP,EAC1B,EAxLepC,EAAAE,QAA+B","x_google_ignoreList":[0,1]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ThemeConfig } from 'antd';
|
|
3
|
+
import { TemboColorPalette, TemboColorOverrides, ThemeMode } from './colors.js';
|
|
4
|
+
import { TemboUIConstants, TemboUIConstantsOverrides } from './constants.js';
|
|
5
|
+
/**
|
|
6
|
+
* Shape of the theme context exposed via useTemboTheme()
|
|
7
|
+
*/
|
|
8
|
+
export interface LegacyTemboThemeContextValue {
|
|
9
|
+
colors: TemboColorPalette;
|
|
10
|
+
constants: TemboUIConstants;
|
|
11
|
+
mode: ThemeMode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Props for TemboThemeProvider
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Basic usage
|
|
18
|
+
* <TemboThemeProvider>
|
|
19
|
+
* <App />
|
|
20
|
+
* </TemboThemeProvider>
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // With dark mode
|
|
24
|
+
* <TemboThemeProvider mode="dark">
|
|
25
|
+
* <App />
|
|
26
|
+
* </TemboThemeProvider>
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // With color overrides
|
|
30
|
+
* <TemboThemeProvider
|
|
31
|
+
* colors={{
|
|
32
|
+
* primary: { main: '#007bff' },
|
|
33
|
+
* action: { main: '#28a745' }
|
|
34
|
+
* }}
|
|
35
|
+
* >
|
|
36
|
+
* <App />
|
|
37
|
+
* </TemboThemeProvider>
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // With all customizations
|
|
41
|
+
* <TemboThemeProvider
|
|
42
|
+
* mode="dark"
|
|
43
|
+
* colors={{ primary: { main: '#007bff' } }}
|
|
44
|
+
* constants={{ radius: { base: 8 } }}
|
|
45
|
+
* themeOverrides={{
|
|
46
|
+
* components: {
|
|
47
|
+
* Button: { controlHeight: 40 }
|
|
48
|
+
* }
|
|
49
|
+
* }}
|
|
50
|
+
* >
|
|
51
|
+
* <App />
|
|
52
|
+
* </TemboThemeProvider>
|
|
53
|
+
*/
|
|
54
|
+
export interface LegacyTemboThemeProviderProps {
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
/** Theme mode - 'light' or 'dark' */
|
|
57
|
+
mode?: ThemeMode;
|
|
58
|
+
/** Color palette overrides - supports deep partial overrides */
|
|
59
|
+
colors?: TemboColorOverrides;
|
|
60
|
+
/** UI constants overrides - supports deep partial overrides */
|
|
61
|
+
constants?: TemboUIConstantsOverrides;
|
|
62
|
+
/** Raw Ant Design ThemeConfig overrides for advanced customization */
|
|
63
|
+
themeOverrides?: Partial<ThemeConfig>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* TemboThemeProvider
|
|
67
|
+
*
|
|
68
|
+
* Wraps your application to provide theming through React context and Ant Design's ConfigProvider.
|
|
69
|
+
* Merges default colors/constants with host overrides and configures Ant Design components.
|
|
70
|
+
* Supports light and dark mode through the mode prop.
|
|
71
|
+
*
|
|
72
|
+
* All child components can access theme values via the useTemboTheme() hook.
|
|
73
|
+
*/
|
|
74
|
+
export declare const LegacyTemboThemeProvider: React.FC<LegacyTemboThemeProviderProps>;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated
|
|
77
|
+
* Hook to access the active Tembo theme
|
|
78
|
+
*
|
|
79
|
+
* Returns the merged color palette, UI constants, and current theme mode.
|
|
80
|
+
* Components should always use this hook instead of importing defaults directly.
|
|
81
|
+
*
|
|
82
|
+
* @returns Theme context containing colors, constants, and mode
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* function MyComponent() {
|
|
86
|
+
* const { colors, constants, mode } = useTemboTheme();
|
|
87
|
+
*
|
|
88
|
+
* return (
|
|
89
|
+
* <div style={{
|
|
90
|
+
* color: colors.text.primary,
|
|
91
|
+
* padding: constants.spacing.md,
|
|
92
|
+
* borderRadius: constants.radius.base,
|
|
93
|
+
* backgroundColor: colors.neutral.lightest
|
|
94
|
+
* }}>
|
|
95
|
+
* Current theme: {mode}
|
|
96
|
+
* </div>
|
|
97
|
+
* );
|
|
98
|
+
* }
|
|
99
|
+
*/
|
|
100
|
+
export declare const useTemboTheme: () => LegacyTemboThemeContextValue;
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ConfigProvider } from 'antd';
|
|
4
|
+
import { buildColorPalette, } from './colors.js';
|
|
5
|
+
import { buildUIConstants, } from './constants.js';
|
|
6
|
+
/**
|
|
7
|
+
* Internal React context carrying the active Tembo theme
|
|
8
|
+
*/
|
|
9
|
+
const TemboThemeContext = React.createContext({
|
|
10
|
+
colors: buildColorPalette(),
|
|
11
|
+
constants: buildUIConstants(),
|
|
12
|
+
mode: 'light',
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Build Ant Design theme configuration from Tembo tokens
|
|
16
|
+
* Maps semantic Tembo color palette and constants to Ant Design's token system
|
|
17
|
+
*
|
|
18
|
+
* @param palette - Complete Tembo color palette
|
|
19
|
+
* @param constants - Complete Tembo UI constants
|
|
20
|
+
* @param mode - Theme mode
|
|
21
|
+
* @param overrides - Optional raw Ant Design theme overrides
|
|
22
|
+
* @returns Ant Design ThemeConfig
|
|
23
|
+
*/
|
|
24
|
+
const buildAntDThemeConfig = (palette, constants, mode, overrides) => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
const baseTokens = {
|
|
27
|
+
// Primary colors
|
|
28
|
+
colorPrimary: palette.primary.main,
|
|
29
|
+
colorPrimaryHover: palette.primary.hover,
|
|
30
|
+
colorPrimaryActive: palette.primary.active,
|
|
31
|
+
colorPrimaryBorder: palette.primary.main,
|
|
32
|
+
// Text colors
|
|
33
|
+
colorText: palette.text.primary,
|
|
34
|
+
colorTextSecondary: palette.text.secondary,
|
|
35
|
+
colorTextTertiary: palette.text.tertiary,
|
|
36
|
+
colorTextQuaternary: palette.text.quaternary,
|
|
37
|
+
colorTextDisabled: palette.text.disabled,
|
|
38
|
+
// Background colors
|
|
39
|
+
colorBgBase: palette.surface.background,
|
|
40
|
+
colorBgContainer: palette.surface.main,
|
|
41
|
+
colorBgElevated: palette.surface.elevated,
|
|
42
|
+
colorBgLayout: palette.surface.background,
|
|
43
|
+
colorBgSpotlight: palette.surface.hover,
|
|
44
|
+
// Border colors
|
|
45
|
+
colorBorder: palette.border.main,
|
|
46
|
+
colorBorderSecondary: palette.border.light,
|
|
47
|
+
colorSplit: palette.border.divider,
|
|
48
|
+
// Success colors
|
|
49
|
+
colorSuccess: palette.success.main,
|
|
50
|
+
colorSuccessBg: palette.success.bg,
|
|
51
|
+
colorSuccessBorder: palette.success.border,
|
|
52
|
+
colorSuccessText: palette.success.text,
|
|
53
|
+
// Error colors
|
|
54
|
+
colorError: palette.error.main,
|
|
55
|
+
colorErrorBg: palette.error.bg,
|
|
56
|
+
colorErrorBorder: palette.error.border,
|
|
57
|
+
colorErrorText: palette.error.text,
|
|
58
|
+
// Warning colors
|
|
59
|
+
colorWarning: palette.warning.main,
|
|
60
|
+
colorWarningBg: palette.warning.bg,
|
|
61
|
+
colorWarningBorder: palette.warning.border,
|
|
62
|
+
colorWarningText: palette.warning.text,
|
|
63
|
+
// Info colors
|
|
64
|
+
colorInfo: palette.info.main,
|
|
65
|
+
colorInfoBg: palette.info.bg,
|
|
66
|
+
colorInfoBorder: palette.info.border,
|
|
67
|
+
colorInfoText: palette.info.text,
|
|
68
|
+
// Link colors
|
|
69
|
+
colorLink: palette.utility.link,
|
|
70
|
+
colorLinkHover: palette.utility.linkHover,
|
|
71
|
+
colorLinkActive: palette.utility.linkActive,
|
|
72
|
+
// Border radius
|
|
73
|
+
borderRadius: constants.radius.base,
|
|
74
|
+
borderRadiusLG: constants.radius.lg,
|
|
75
|
+
borderRadiusSM: constants.radius.sm,
|
|
76
|
+
borderRadiusXS: 6,
|
|
77
|
+
// Shadows
|
|
78
|
+
boxShadow: constants.shadow.base,
|
|
79
|
+
boxShadowSecondary: constants.shadow.card,
|
|
80
|
+
boxShadowTertiary: constants.shadow.elevated,
|
|
81
|
+
// Typography
|
|
82
|
+
fontFamily: constants.typography.fontFamily,
|
|
83
|
+
fontSize: constants.typography.fontSize.base,
|
|
84
|
+
fontSizeHeading1: 38,
|
|
85
|
+
fontSizeHeading2: 30,
|
|
86
|
+
fontSizeHeading3: 24,
|
|
87
|
+
fontSizeHeading4: 20,
|
|
88
|
+
fontSizeHeading5: constants.typography.fontSize.lg,
|
|
89
|
+
fontWeightStrong: constants.typography.fontWeight.medium,
|
|
90
|
+
lineHeight: constants.typography.lineHeight.base,
|
|
91
|
+
lineHeightHeading1: 1.21,
|
|
92
|
+
lineHeightHeading2: 1.27,
|
|
93
|
+
lineHeightHeading3: 1.33,
|
|
94
|
+
lineHeightHeading4: 1.4,
|
|
95
|
+
lineHeightHeading5: 1.5,
|
|
96
|
+
};
|
|
97
|
+
const baseTheme = {
|
|
98
|
+
token: baseTokens,
|
|
99
|
+
// algorithm: mode === 'dark' ? 'dark' : undefined,
|
|
100
|
+
components: {
|
|
101
|
+
Button: {
|
|
102
|
+
colorPrimary: palette.components.button.primary.bg,
|
|
103
|
+
colorPrimaryHover: palette.components.button.primary.hover,
|
|
104
|
+
colorPrimaryActive: palette.action.active,
|
|
105
|
+
colorPrimaryBorder: palette.components.button.primary.bg,
|
|
106
|
+
primaryColor: palette.components.button.primary.text,
|
|
107
|
+
colorBorder: palette.components.button.default.border,
|
|
108
|
+
colorBgContainer: palette.components.button.default.bg,
|
|
109
|
+
colorText: palette.components.button.default.text,
|
|
110
|
+
defaultBg: palette.components.button.default.bg,
|
|
111
|
+
defaultBorderColor: palette.components.button.default.border,
|
|
112
|
+
defaultColor: palette.components.button.default.text,
|
|
113
|
+
primaryShadow: 'none',
|
|
114
|
+
defaultShadow: 'none',
|
|
115
|
+
dangerShadow: 'none',
|
|
116
|
+
fontWeight: constants.typography.fontWeight.medium,
|
|
117
|
+
controlHeight: 32,
|
|
118
|
+
paddingContentHorizontal: constants.spacing.lg,
|
|
119
|
+
borderRadius: constants.radius.button,
|
|
120
|
+
borderRadiusLG: constants.radius.button,
|
|
121
|
+
borderRadiusSM: constants.radius.sm + 8,
|
|
122
|
+
},
|
|
123
|
+
Input: {
|
|
124
|
+
colorBgContainer: palette.components.input.bg,
|
|
125
|
+
colorBorder: palette.components.input.border,
|
|
126
|
+
hoverBorderColor: palette.components.input.borderHover,
|
|
127
|
+
activeBorderColor: palette.components.input.borderFocus,
|
|
128
|
+
colorPrimaryHover: palette.components.input.borderFocus,
|
|
129
|
+
colorTextPlaceholder: palette.components.input.placeholder,
|
|
130
|
+
borderRadius: constants.radius.input,
|
|
131
|
+
borderRadiusLG: constants.radius.base,
|
|
132
|
+
borderRadiusSM: constants.radius.sm,
|
|
133
|
+
},
|
|
134
|
+
Select: {
|
|
135
|
+
colorBgContainer: palette.components.input.bg,
|
|
136
|
+
colorBorder: palette.components.input.border,
|
|
137
|
+
colorTextPlaceholder: palette.components.input.placeholder,
|
|
138
|
+
colorPrimaryHover: palette.action.main,
|
|
139
|
+
hoverBorderColor: palette.components.input.borderHover,
|
|
140
|
+
activeBorderColor: palette.components.input.borderFocus,
|
|
141
|
+
optionSelectedBg: palette.action.main,
|
|
142
|
+
optionSelectedColor: palette.action.contrast,
|
|
143
|
+
optionActiveBg: palette.surface.hover,
|
|
144
|
+
colorBgElevated: palette.neutral.brightest,
|
|
145
|
+
controlItemBgHover: palette.surface.hover,
|
|
146
|
+
boxShadowSecondary: constants.shadow.elevated,
|
|
147
|
+
borderRadius: constants.radius.input,
|
|
148
|
+
borderRadiusLG: constants.radius.base,
|
|
149
|
+
borderRadiusSM: constants.radius.sm,
|
|
150
|
+
},
|
|
151
|
+
Checkbox: {
|
|
152
|
+
colorPrimary: palette.action.main,
|
|
153
|
+
colorPrimaryHover: palette.action.hover,
|
|
154
|
+
colorBorder: palette.border.strong,
|
|
155
|
+
borderRadiusSM: 6,
|
|
156
|
+
},
|
|
157
|
+
Radio: {
|
|
158
|
+
colorPrimary: palette.action.main,
|
|
159
|
+
colorPrimaryHover: palette.action.hover,
|
|
160
|
+
colorBorder: palette.border.strong,
|
|
161
|
+
},
|
|
162
|
+
Switch: {
|
|
163
|
+
colorPrimary: palette.action.main,
|
|
164
|
+
colorPrimaryHover: palette.action.hover,
|
|
165
|
+
colorTextQuaternary: palette.text.quaternary,
|
|
166
|
+
},
|
|
167
|
+
Form: {
|
|
168
|
+
labelColor: palette.text.primary,
|
|
169
|
+
labelRequiredMarkColor: palette.error.main,
|
|
170
|
+
labelFontSize: constants.typography.fontSize.base,
|
|
171
|
+
itemMarginBottom: constants.spacing.lg,
|
|
172
|
+
},
|
|
173
|
+
DatePicker: {
|
|
174
|
+
colorBgContainer: palette.components.input.bg,
|
|
175
|
+
colorBorder: palette.components.input.border,
|
|
176
|
+
hoverBorderColor: palette.components.input.borderHover,
|
|
177
|
+
activeBorderColor: palette.components.input.borderFocus,
|
|
178
|
+
colorPrimary: palette.action.main,
|
|
179
|
+
borderRadius: constants.radius.input,
|
|
180
|
+
},
|
|
181
|
+
InputNumber: {
|
|
182
|
+
borderRadius: constants.radius.input,
|
|
183
|
+
},
|
|
184
|
+
Table: {
|
|
185
|
+
colorBgContainer: palette.components.table.bg,
|
|
186
|
+
headerBg: palette.components.table.headerBg,
|
|
187
|
+
headerColor: palette.components.table.headerText,
|
|
188
|
+
borderColor: palette.components.table.border,
|
|
189
|
+
headerSplitColor: palette.components.table.border,
|
|
190
|
+
rowHoverBg: palette.components.table.rowHover,
|
|
191
|
+
rowSelectedBg: palette.action.light,
|
|
192
|
+
rowSelectedHoverBg: palette.action.lighter,
|
|
193
|
+
colorText: palette.text.primary,
|
|
194
|
+
colorTextHeading: palette.text.primary,
|
|
195
|
+
borderRadius: constants.radius.base,
|
|
196
|
+
borderRadiusLG: constants.radius.lg,
|
|
197
|
+
},
|
|
198
|
+
Card: {
|
|
199
|
+
colorBgContainer: palette.surface.main,
|
|
200
|
+
colorBorder: palette.border.main,
|
|
201
|
+
colorBorderSecondary: palette.border.light,
|
|
202
|
+
boxShadowTertiary: constants.shadow.card,
|
|
203
|
+
borderRadius: constants.radius.card,
|
|
204
|
+
borderRadiusLG: constants.radius.lg + 4,
|
|
205
|
+
},
|
|
206
|
+
Statistic: {
|
|
207
|
+
contentFontSize: 24,
|
|
208
|
+
colorTextHeading: palette.text.primary,
|
|
209
|
+
},
|
|
210
|
+
Descriptions: {
|
|
211
|
+
labelBg: palette.surface.hover,
|
|
212
|
+
colorTextSecondary: palette.text.secondary,
|
|
213
|
+
itemPaddingBottom: constants.spacing.md,
|
|
214
|
+
},
|
|
215
|
+
Badge: {
|
|
216
|
+
colorError: palette.error.main,
|
|
217
|
+
colorSuccess: palette.success.main,
|
|
218
|
+
colorInfo: palette.info.main,
|
|
219
|
+
colorInfoBg: palette.info.bg,
|
|
220
|
+
borderRadiusSM: constants.radius.input,
|
|
221
|
+
},
|
|
222
|
+
Tag: {
|
|
223
|
+
colorBorder: palette.border.main,
|
|
224
|
+
defaultBg: palette.surface.hover,
|
|
225
|
+
borderRadiusSM: constants.radius.sm,
|
|
226
|
+
},
|
|
227
|
+
Timeline: {
|
|
228
|
+
dotBg: palette.surface.main,
|
|
229
|
+
tailColor: palette.border.main,
|
|
230
|
+
},
|
|
231
|
+
Alert: {
|
|
232
|
+
colorSuccessBg: palette.success.bg,
|
|
233
|
+
colorSuccessBorder: palette.success.border,
|
|
234
|
+
colorErrorBg: palette.error.bg,
|
|
235
|
+
colorErrorBorder: palette.error.border,
|
|
236
|
+
colorWarningBg: palette.warning.bg,
|
|
237
|
+
colorWarningBorder: palette.warning.border,
|
|
238
|
+
colorInfoBg: palette.info.bg,
|
|
239
|
+
colorInfoBorder: palette.info.border,
|
|
240
|
+
borderRadiusLG: constants.radius.base,
|
|
241
|
+
},
|
|
242
|
+
Modal: {
|
|
243
|
+
contentBg: palette.surface.elevated,
|
|
244
|
+
headerBg: palette.surface.elevated,
|
|
245
|
+
colorBgMask: 'rgba(0, 0, 0, 0.45)',
|
|
246
|
+
borderRadiusLG: constants.radius.lg,
|
|
247
|
+
},
|
|
248
|
+
Drawer: {
|
|
249
|
+
colorBgElevated: palette.surface.elevated,
|
|
250
|
+
colorBgMask: 'rgba(0, 0, 0, 0.45)',
|
|
251
|
+
borderRadiusLG: constants.radius.lg,
|
|
252
|
+
},
|
|
253
|
+
Notification: {
|
|
254
|
+
colorBgElevated: palette.neutral.brightest,
|
|
255
|
+
borderRadiusLG: constants.radius.base,
|
|
256
|
+
},
|
|
257
|
+
Message: {
|
|
258
|
+
contentBg: palette.neutral.brightest,
|
|
259
|
+
borderRadiusLG: constants.radius.base,
|
|
260
|
+
},
|
|
261
|
+
Spin: {
|
|
262
|
+
colorPrimary: palette.primary.main,
|
|
263
|
+
},
|
|
264
|
+
Progress: {
|
|
265
|
+
colorSuccess: palette.success.main,
|
|
266
|
+
colorError: palette.error.main,
|
|
267
|
+
defaultColor: palette.primary.main,
|
|
268
|
+
borderRadius: 100,
|
|
269
|
+
},
|
|
270
|
+
Skeleton: {
|
|
271
|
+
colorFill: palette.neutral[2],
|
|
272
|
+
colorFillContent: palette.neutral[1],
|
|
273
|
+
borderRadiusSM: constants.radius.sm,
|
|
274
|
+
},
|
|
275
|
+
Menu: {
|
|
276
|
+
itemBg: 'transparent',
|
|
277
|
+
itemColor: palette.text.primary,
|
|
278
|
+
itemHoverBg: palette.surface.hover,
|
|
279
|
+
itemSelectedBg: palette.action.lighter,
|
|
280
|
+
itemSelectedColor: palette.action.main,
|
|
281
|
+
itemActiveBg: palette.action.lighter,
|
|
282
|
+
subMenuItemBg: 'transparent',
|
|
283
|
+
darkItemBg: palette.components.sidebar.bg,
|
|
284
|
+
darkSubMenuItemBg: palette.components.sidebar.bg,
|
|
285
|
+
darkItemColor: palette.components.sidebar.text,
|
|
286
|
+
darkItemHoverBg: palette.components.sidebar.hover,
|
|
287
|
+
darkItemSelectedBg: palette.components.sidebar.selected,
|
|
288
|
+
darkItemSelectedColor: palette.primary.contrast,
|
|
289
|
+
borderRadius: constants.radius.input,
|
|
290
|
+
borderRadiusLG: constants.radius.base,
|
|
291
|
+
},
|
|
292
|
+
Breadcrumb: {
|
|
293
|
+
linkColor: palette.utility.link,
|
|
294
|
+
linkHoverColor: palette.utility.linkHover,
|
|
295
|
+
itemColor: palette.text.secondary,
|
|
296
|
+
lastItemColor: palette.text.primary,
|
|
297
|
+
separatorColor: palette.text.tertiary,
|
|
298
|
+
borderRadiusSM: 6,
|
|
299
|
+
},
|
|
300
|
+
Pagination: {
|
|
301
|
+
colorPrimary: palette.primary.main,
|
|
302
|
+
colorPrimaryHover: palette.primary.hover,
|
|
303
|
+
itemActiveBg: palette.primary.main,
|
|
304
|
+
borderRadius: constants.radius.sm,
|
|
305
|
+
},
|
|
306
|
+
Steps: {
|
|
307
|
+
colorPrimary: palette.action.main,
|
|
308
|
+
colorText: palette.text.secondary,
|
|
309
|
+
colorTextDescription: palette.text.tertiary,
|
|
310
|
+
borderRadiusSM: 100,
|
|
311
|
+
},
|
|
312
|
+
Tabs: {
|
|
313
|
+
colorPrimary: palette.action.main,
|
|
314
|
+
colorBorderSecondary: palette.border.main,
|
|
315
|
+
itemColor: palette.text.secondary,
|
|
316
|
+
itemHoverColor: palette.action.hover,
|
|
317
|
+
itemSelectedColor: palette.action.main,
|
|
318
|
+
inkBarColor: palette.action.main,
|
|
319
|
+
borderRadiusSM: constants.radius.sm,
|
|
320
|
+
},
|
|
321
|
+
Layout: {
|
|
322
|
+
colorBgBody: palette.surface.background,
|
|
323
|
+
colorBgHeader: palette.neutral.brightest,
|
|
324
|
+
colorBgTrigger: palette.components.sidebar.bg,
|
|
325
|
+
siderBg: palette.components.sidebar.bg,
|
|
326
|
+
headerBg: palette.neutral.brightest,
|
|
327
|
+
borderRadiusLG: 0,
|
|
328
|
+
},
|
|
329
|
+
Divider: {
|
|
330
|
+
colorSplit: palette.border.divider,
|
|
331
|
+
},
|
|
332
|
+
Typography: {
|
|
333
|
+
colorText: palette.text.primary,
|
|
334
|
+
colorTextSecondary: palette.text.secondary,
|
|
335
|
+
colorTextDescription: palette.text.tertiary,
|
|
336
|
+
},
|
|
337
|
+
Tooltip: {
|
|
338
|
+
colorBgSpotlight: palette.neutral.darkest,
|
|
339
|
+
colorTextLightSolid: palette.neutral.brightest,
|
|
340
|
+
borderRadius: constants.radius.sm,
|
|
341
|
+
},
|
|
342
|
+
Popover: {
|
|
343
|
+
colorBgElevated: palette.neutral.brightest,
|
|
344
|
+
borderRadiusLG: constants.radius.base,
|
|
345
|
+
},
|
|
346
|
+
Dropdown: {
|
|
347
|
+
boxShadowSecondary: constants.shadow.dropdown,
|
|
348
|
+
},
|
|
349
|
+
Calendar: {
|
|
350
|
+
colorBgContainer: palette.neutral.brightest,
|
|
351
|
+
colorPrimary: palette.action.main,
|
|
352
|
+
borderRadiusLG: constants.radius.base,
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
if (!overrides)
|
|
357
|
+
return baseTheme;
|
|
358
|
+
return Object.assign(Object.assign({}, baseTheme), { token: Object.assign(Object.assign({}, baseTheme.token), ((_a = overrides.token) !== null && _a !== void 0 ? _a : {})), components: Object.assign(Object.assign({}, baseTheme.components), ((_b = overrides.components) !== null && _b !== void 0 ? _b : {})) });
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* TemboThemeProvider
|
|
362
|
+
*
|
|
363
|
+
* Wraps your application to provide theming through React context and Ant Design's ConfigProvider.
|
|
364
|
+
* Merges default colors/constants with host overrides and configures Ant Design components.
|
|
365
|
+
* Supports light and dark mode through the mode prop.
|
|
366
|
+
*
|
|
367
|
+
* All child components can access theme values via the useTemboTheme() hook.
|
|
368
|
+
*/
|
|
369
|
+
export const LegacyTemboThemeProvider = ({ children, mode = 'light', colors, constants, themeOverrides, }) => {
|
|
370
|
+
const palette = React.useMemo(() => buildColorPalette(colors, mode), [colors, mode]);
|
|
371
|
+
const uiConstants = React.useMemo(() => buildUIConstants(constants), [constants]);
|
|
372
|
+
const theme = React.useMemo(() => buildAntDThemeConfig(palette, uiConstants, mode, themeOverrides), [palette, uiConstants, mode, themeOverrides]);
|
|
373
|
+
const contextValue = React.useMemo(() => ({
|
|
374
|
+
colors: palette,
|
|
375
|
+
constants: uiConstants,
|
|
376
|
+
mode,
|
|
377
|
+
}), [palette, uiConstants, mode]);
|
|
378
|
+
return (_jsx(TemboThemeContext.Provider, { value: contextValue, children: _jsx(ConfigProvider, { theme: theme, children: children }) }));
|
|
379
|
+
};
|
|
380
|
+
/**
|
|
381
|
+
* @deprecated
|
|
382
|
+
* Hook to access the active Tembo theme
|
|
383
|
+
*
|
|
384
|
+
* Returns the merged color palette, UI constants, and current theme mode.
|
|
385
|
+
* Components should always use this hook instead of importing defaults directly.
|
|
386
|
+
*
|
|
387
|
+
* @returns Theme context containing colors, constants, and mode
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* function MyComponent() {
|
|
391
|
+
* const { colors, constants, mode } = useTemboTheme();
|
|
392
|
+
*
|
|
393
|
+
* return (
|
|
394
|
+
* <div style={{
|
|
395
|
+
* color: colors.text.primary,
|
|
396
|
+
* padding: constants.spacing.md,
|
|
397
|
+
* borderRadius: constants.radius.base,
|
|
398
|
+
* backgroundColor: colors.neutral.lightest
|
|
399
|
+
* }}>
|
|
400
|
+
* Current theme: {mode}
|
|
401
|
+
* </div>
|
|
402
|
+
* );
|
|
403
|
+
* }
|
|
404
|
+
*/
|
|
405
|
+
export const useTemboTheme = () => React.useContext(TemboThemeContext);
|
package/dist/theme/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../theme-provider-
|
|
1
|
+
"use strict";var e=require("../theme-provider-C31WJ-NK.js");require("react"),require("antd"),require("lodash"),exports.LegacyTemboThemeProvider=e.LegacyTemboThemeProvider,exports.TemboThemeProvider=e.TemboThemeProvider,exports.buildColorPalette=e.buildColorPalette,exports.buildUIConstants=e.buildUIConstants,exports.defaultColorPalette=e.defaultColorPalette,exports.defaultUIConstants=e.defaultUIConstants,exports.useNewTemboTheme=e.useNewTemboTheme,exports.useTemboTheme=e.useTemboTheme;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/theme/index.d.ts
CHANGED
package/dist/theme/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{T as TemboThemeProvider,b as buildColorPalette,c as buildUIConstants,d as defaultColorPalette,a as defaultUIConstants,u as useTemboTheme}from"../theme-provider-
|
|
1
|
+
export{L as LegacyTemboThemeProvider,T as TemboThemeProvider,b as buildColorPalette,c as buildUIConstants,d as defaultColorPalette,a as defaultUIConstants,e as useNewTemboTheme,u as useTemboTheme}from"../theme-provider-DH1PzDC8.js";import"react";import"antd";import"lodash";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|