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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/{ZoomOutOutlined-BY_CCwq7.js → ZoomOutOutlined-CW-jqBMI.js} +2 -2
  2. package/dist/{ZoomOutOutlined-BY_CCwq7.js.map → ZoomOutOutlined-CW-jqBMI.js.map} +1 -1
  3. package/dist/{ZoomOutOutlined-BL6A5RSq.js → ZoomOutOutlined-Pw8hpWWK.js} +2 -2
  4. package/dist/{ZoomOutOutlined-BL6A5RSq.js.map → ZoomOutOutlined-Pw8hpWWK.js.map} +1 -1
  5. package/dist/alerts/index.cjs.js +1 -1
  6. package/dist/alerts/index.d.ts +1 -0
  7. package/dist/alerts/index.js +1 -1
  8. package/dist/dialogs/index.cjs.js +1 -1
  9. package/dist/dialogs/index.d.ts +1 -0
  10. package/dist/dialogs/index.js +1 -1
  11. package/dist/features/alerts/alert.js +95 -0
  12. package/dist/features/alerts/index.js +1 -0
  13. package/dist/features/dialogs/index.js +1 -0
  14. package/dist/features/dialogs/modal-provider.js +6 -0
  15. package/dist/features/dialogs/tembo-confirm.js +111 -0
  16. package/dist/features/input-validation/account-name-validator.js +28 -0
  17. package/dist/features/input-validation/account-number-validator.js +65 -0
  18. package/dist/features/input-validation/amount-validator.js +100 -0
  19. package/dist/features/input-validation/index.js +5 -0
  20. package/dist/features/input-validation/phone-number-validator.js +79 -0
  21. package/dist/features/input-validation/swift-code-validator.js +38 -0
  22. package/dist/features/notifications/index.js +3 -0
  23. package/dist/features/notifications/tembo-notify.d.ts +29 -103
  24. package/dist/features/notifications/tembo-notify.js +140 -0
  25. package/dist/features/notifications/toast-config.d.ts +1 -4
  26. package/dist/features/notifications/toast-config.js +60 -0
  27. package/dist/features/notifications/toast-container.d.ts +13 -3
  28. package/dist/features/notifications/toast-container.js +89 -0
  29. package/dist/index.cjs.js +1 -1
  30. package/dist/index.cjs.js.map +1 -1
  31. package/dist/index.esm.js +1 -1
  32. package/dist/index.esm.js.map +1 -1
  33. package/dist/index.js +1 -0
  34. package/dist/notifications/index.cjs.js +1 -1
  35. package/dist/notifications/index.d.ts +1 -0
  36. package/dist/notifications/index.js +1 -1
  37. package/dist/providers.js +32 -0
  38. package/dist/tembo-notify-Bp14qngd.js +2 -0
  39. package/dist/tembo-notify-Bp14qngd.js.map +1 -0
  40. package/dist/tembo-notify-h5Xn66oA.js +2 -0
  41. package/dist/tembo-notify-h5Xn66oA.js.map +1 -0
  42. package/dist/theme/colors.d.ts +55 -23
  43. package/dist/theme/colors.js +212 -0
  44. package/dist/theme/constants.js +82 -0
  45. package/dist/theme/index.cjs.js +1 -1
  46. package/dist/theme/index.js +1 -1
  47. package/dist/theme/theme-provider.d.ts +18 -6
  48. package/dist/theme/theme-provider.js +404 -0
  49. package/dist/theme-provider-Ca4P0Hcp.js +11 -0
  50. package/dist/theme-provider-Ca4P0Hcp.js.map +1 -0
  51. package/dist/theme-provider-RhAw3jw_.js +11 -0
  52. package/dist/theme-provider-RhAw3jw_.js.map +1 -0
  53. package/dist/validation/index.d.ts +1 -0
  54. package/package.json +5 -2
  55. package/dist/tembo-notify-C-QGduBt.js +0 -2
  56. package/dist/tembo-notify-C-QGduBt.js.map +0 -1
  57. package/dist/tembo-notify-D-uOV3t0.js +0 -2
  58. package/dist/tembo-notify-D-uOV3t0.js.map +0 -1
  59. package/dist/theme-provider-D_oV1J_K.js +0 -11
  60. package/dist/theme-provider-D_oV1J_K.js.map +0 -1
  61. package/dist/theme-provider-Dqvy24OD.js +0 -11
  62. package/dist/theme-provider-Dqvy24OD.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tembo-notify-h5Xn66oA.js","sources":["../src/features/notifications/toast-config.tsx","../src/features/notifications/tembo-notify.tsx"],"sourcesContent":[null,null],"names":["buildToastConfigs","colors","constants","baseConfig","position","autoClose","hideProgressBar","closeOnClick","pauseOnHover","draggable","closeButton","style","fontFamily","typography","fontSize","borderRadius","padding","boxShadow","border","minHeight","backgroundColor","surface","elevated","color","text","primary","display","alignItems","gap","successConfig","Object","assign","icon","_jsx","CheckCircleOutlined","success","main","bg","className","errorConfig","CloseCircleOutlined","error","warningConfig","ExclamationCircleOutlined","warning","infoConfig","InfoCircleOutlined","info","loadingConfig","LoadingOutlined","FALLBACK_BASE_CONFIG","TemboNotify","init","this","configs","getConfigs","formatMessage","message","hasTitle","title","hasDescription","description","_jsxs","flexDirection","children","fontWeight","opacity","buildOptions","options","_a","duration","toastId","onClick","onClose","restOptions","__rest","effectiveBase","undefined","getSuccessConfig","_b","getErrorConfig","getWarningConfig","getInfoConfig","getLoadingConfig","content","toastOptions","toast","loading","update","id","typeConfig","type","render","isLoading","dismiss","dismissAll","isActive"],"mappings":"oPAUaA,EAAoB,CAC7BC,EACAC,KAKA,MAAMC,EAA2B,CAC7BC,SAAU,YACVC,UAAW,IACXC,iBAAiB,EACjBC,cAAc,EACdC,cAAc,EACdC,WAAW,EACXC,aAAa,EACbC,MAAO,CACHC,WAAYV,EAAUW,WAAWD,WACjCE,SAAU,GACVC,aAAc,GACdC,QAAS,YACTC,UAAW,qCACXC,OAAQ,OACRC,UAAW,GACXC,gBAAiBnB,EAAOoB,QAAQC,SAChCC,MAAOtB,EAAOuB,KAAKC,QACnBC,QAAS,OACTC,WAAY,SACZC,IAAK,IAOPC,EAAaC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACZ5B,GAAU,CACb6B,KACIC,EAAAA,IAACC,EAAmB,CAChBvB,MAAO,CAAEG,SAAU,GAAIS,MAAOtB,EAAOkC,QAAQC,QAGrDzB,MAAKmB,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACE5B,EAAWQ,OAAK,CACnBS,gBAAiBnB,EAAOkC,QAAQE,GAChCd,MAAOtB,EAAOkC,QAAQX,OAE1Bc,UAAW,kBAMTC,EAAWT,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACV5B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+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.surface.main }}
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
- * Neutral color scale
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
- * Numbered 50-950 where 50 is lightest and 950 is darkest
65
+ * 0 = brightest in current theme, 10 = dimmest in current theme
54
66
  */
55
67
  neutral: {
56
- /** Near white - for subtle backgrounds */
57
- 50: string;
58
- 100: string;
59
- 200: string;
60
- 300: string;
61
- 400: string;
62
- /** Mid-point gray - useful for borders and dividers */
63
- 500: string;
64
- 600: string;
65
- 700: string;
66
- 800: string;
67
- 900: string;
68
- /** Near black - for dark backgrounds or text */
69
- 950: string;
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
- * Absolute color values for special cases
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
- * Default Tembo color palette
232
- * Light theme with professional, accessible colors
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
+ };
@@ -0,0 +1,82 @@
1
+ import { merge } from 'lodash';
2
+ /**
3
+ * Default UI constants
4
+ * Professional, accessible defaults suitable for most applications
5
+ */
6
+ export const defaultUIConstants = {
7
+ typography: {
8
+ fontFamily: "Avenir, MarkPro, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
9
+ fontSize: {
10
+ xs: 12,
11
+ sm: 13,
12
+ base: 14,
13
+ lg: 16,
14
+ xl: 18,
15
+ },
16
+ fontWeight: {
17
+ normal: 400,
18
+ medium: 500,
19
+ semibold: 600,
20
+ bold: 700,
21
+ },
22
+ lineHeight: {
23
+ tight: 1.25,
24
+ base: 1.5715,
25
+ relaxed: 1.75,
26
+ },
27
+ },
28
+ spacing: {
29
+ xs: 4,
30
+ sm: 8,
31
+ md: 12,
32
+ lg: 16,
33
+ xl: 24,
34
+ '2xl': 32,
35
+ '3xl': 48,
36
+ },
37
+ radius: {
38
+ none: 0,
39
+ sm: 8,
40
+ base: 12,
41
+ md: 14,
42
+ lg: 16,
43
+ xl: 20,
44
+ full: 9999,
45
+ button: 24,
46
+ input: 10,
47
+ card: 16,
48
+ },
49
+ shadow: {
50
+ sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
51
+ base: '0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08)',
52
+ md: '0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08)',
53
+ lg: '0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08)',
54
+ xl: '0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08)',
55
+ card: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
56
+ elevated: '0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08)',
57
+ dropdown: '0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08)',
58
+ },
59
+ zIndex: {
60
+ dropdown: 1000,
61
+ modal: 1050,
62
+ popover: 1060,
63
+ tooltip: 1070,
64
+ notification: 1080,
65
+ },
66
+ transition: {
67
+ fast: '150ms cubic-bezier(0.4, 0, 0.2, 1)',
68
+ base: '200ms cubic-bezier(0.4, 0, 0.2, 1)',
69
+ slow: '300ms cubic-bezier(0.4, 0, 0.2, 1)',
70
+ },
71
+ };
72
+ /**
73
+ * Build complete UI constants by merging overrides with defaults
74
+ *
75
+ * @param overrides - Partial UI constants overrides
76
+ * @returns Complete UI constants with overrides applied
77
+ */
78
+ export const buildUIConstants = (overrides) => {
79
+ if (!overrides)
80
+ return defaultUIConstants;
81
+ return merge(defaultUIConstants, overrides);
82
+ };
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../theme-provider-Dqvy24OD.js");require("react"),require("antd"),require("lodash"),exports.TemboThemeProvider=e.TemboThemeProvider,exports.buildColorPalette=e.buildColorPalette,exports.buildUIConstants=e.buildUIConstants,exports.defaultColorPalette=e.defaultColorPalette,exports.defaultUIConstants=e.defaultUIConstants,exports.useTemboTheme=e.useTemboTheme;
1
+ "use strict";var e=require("../theme-provider-RhAw3jw_.js");require("react"),require("antd"),require("lodash"),exports.TemboThemeProvider=e.TemboThemeProvider,exports.buildColorPalette=e.buildColorPalette,exports.buildUIConstants=e.buildUIConstants,exports.defaultColorPalette=e.defaultColorPalette,exports.defaultUIConstants=e.defaultUIConstants,exports.useTemboTheme=e.useTemboTheme;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -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-D_oV1J_K.js";import"react";import"antd";import"lodash";
1
+ export{T as TemboThemeProvider,b as buildColorPalette,c as buildUIConstants,d as defaultColorPalette,a as defaultUIConstants,u as useTemboTheme}from"../theme-provider-Ca4P0Hcp.js";import"react";import"antd";import"lodash";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { ThemeConfig } from 'antd';
3
- import { TemboColorPalette, TemboColorOverrides } from './colors.js';
3
+ import { TemboColorPalette, TemboColorOverrides, ThemeMode } from './colors.js';
4
4
  import { TemboUIConstants, TemboUIConstantsOverrides } from './constants.js';
5
5
  /**
6
6
  * Shape of the theme context exposed via useTemboTheme()
@@ -8,6 +8,7 @@ import { TemboUIConstants, TemboUIConstantsOverrides } from './constants.js';
8
8
  export interface TemboThemeContextValue {
9
9
  colors: TemboColorPalette;
10
10
  constants: TemboUIConstants;
11
+ mode: ThemeMode;
11
12
  }
12
13
  /**
13
14
  * Props for TemboThemeProvider
@@ -19,6 +20,12 @@ export interface TemboThemeContextValue {
19
20
  * </TemboThemeProvider>
20
21
  *
21
22
  * @example
23
+ * // With dark mode
24
+ * <TemboThemeProvider mode="dark">
25
+ * <App />
26
+ * </TemboThemeProvider>
27
+ *
28
+ * @example
22
29
  * // With color overrides
23
30
  * <TemboThemeProvider
24
31
  * colors={{
@@ -32,6 +39,7 @@ export interface TemboThemeContextValue {
32
39
  * @example
33
40
  * // With all customizations
34
41
  * <TemboThemeProvider
42
+ * mode="dark"
35
43
  * colors={{ primary: { main: '#007bff' } }}
36
44
  * constants={{ radius: { base: 8 } }}
37
45
  * themeOverrides={{
@@ -45,6 +53,8 @@ export interface TemboThemeContextValue {
45
53
  */
46
54
  export interface TemboThemeProviderProps {
47
55
  children: React.ReactNode;
56
+ /** Theme mode - 'light' or 'dark' */
57
+ mode?: ThemeMode;
48
58
  /** Color palette overrides - supports deep partial overrides */
49
59
  colors?: TemboColorOverrides;
50
60
  /** UI constants overrides - supports deep partial overrides */
@@ -57,6 +67,7 @@ export interface TemboThemeProviderProps {
57
67
  *
58
68
  * Wraps your application to provide theming through React context and Ant Design's ConfigProvider.
59
69
  * Merges default colors/constants with host overrides and configures Ant Design components.
70
+ * Supports light and dark mode through the mode prop.
60
71
  *
61
72
  * All child components can access theme values via the useTemboTheme() hook.
62
73
  */
@@ -64,22 +75,23 @@ export declare const TemboThemeProvider: React.FC<TemboThemeProviderProps>;
64
75
  /**
65
76
  * Hook to access the active Tembo theme
66
77
  *
67
- * Returns the merged color palette and UI constants with any host overrides applied.
78
+ * Returns the merged color palette, UI constants, and current theme mode.
68
79
  * Components should always use this hook instead of importing defaults directly.
69
80
  *
70
- * @returns Theme context containing colors and constants
81
+ * @returns Theme context containing colors, constants, and mode
71
82
  *
72
83
  * @example
73
84
  * function MyComponent() {
74
- * const { colors, constants } = useTemboTheme();
85
+ * const { colors, constants, mode } = useTemboTheme();
75
86
  *
76
87
  * return (
77
88
  * <div style={{
78
89
  * color: colors.text.primary,
79
90
  * padding: constants.spacing.md,
80
- * borderRadius: constants.radius.base
91
+ * borderRadius: constants.radius.base,
92
+ * backgroundColor: colors.neutral.lightest
81
93
  * }}>
82
- * Themed content
94
+ * Current theme: {mode}
83
95
  * </div>
84
96
  * );
85
97
  * }