@temboplus/frontend-react-core 0.1.3-beta.3 → 0.1.3-beta.31

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 (80) hide show
  1. package/dist/CloseCircleOutlined-CMilRURi.js +3 -0
  2. package/dist/CloseCircleOutlined-CMilRURi.js.map +1 -0
  3. package/dist/CloseCircleOutlined-CSHx89Jn.js +3 -0
  4. package/dist/CloseCircleOutlined-CSHx89Jn.js.map +1 -0
  5. package/dist/InfoCircleOutlined-DR9DmuN-.js +5 -0
  6. package/dist/InfoCircleOutlined-DR9DmuN-.js.map +1 -0
  7. package/dist/InfoCircleOutlined-Hx86sClq.js +5 -0
  8. package/dist/InfoCircleOutlined-Hx86sClq.js.map +1 -0
  9. package/dist/alerts/index.cjs.js +1 -1
  10. package/dist/alerts/index.cjs.js.map +1 -1
  11. package/dist/alerts/index.js +1 -1
  12. package/dist/alerts/index.js.map +1 -1
  13. package/dist/dialogs/index.cjs.js +3 -1
  14. package/dist/dialogs/index.cjs.js.map +1 -1
  15. package/dist/dialogs/index.js +3 -1
  16. package/dist/dialogs/index.js.map +1 -1
  17. package/dist/features/alerts/alert.js +18 -18
  18. package/dist/features/dialogs/tembo-confirm.js +28 -19
  19. package/dist/features/notifications/tembo-notify.d.ts +32 -105
  20. package/dist/features/notifications/tembo-notify.js +102 -111
  21. package/dist/features/notifications/toast-config.d.ts +4 -6
  22. package/dist/features/notifications/toast-config.js +28 -21
  23. package/dist/features/notifications/toast-container.d.ts +13 -3
  24. package/dist/features/notifications/toast-container.js +80 -9
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.cjs.js.map +1 -1
  27. package/dist/index.esm.js +1 -1
  28. package/dist/index.esm.js.map +1 -1
  29. package/dist/notifications/index.cjs.js +1 -1
  30. package/dist/notifications/index.js +1 -1
  31. package/dist/providers.d.ts +2 -32
  32. package/dist/providers.js +3 -24
  33. package/dist/tembo-notify-C2pwp3tl.js +3 -0
  34. package/dist/tembo-notify-C2pwp3tl.js.map +1 -0
  35. package/dist/tembo-notify-vrLE3jqe.js +3 -0
  36. package/dist/tembo-notify-vrLE3jqe.js.map +1 -0
  37. package/dist/theme/deprecated/theme-provider.d.ts +100 -0
  38. package/dist/theme/deprecated/theme-provider.js +405 -0
  39. package/dist/theme/index.cjs.js +1 -1
  40. package/dist/theme/index.d.ts +3 -2
  41. package/dist/theme/index.js +1 -1
  42. package/dist/theme/theme-config.d.ts +15 -0
  43. package/dist/theme/theme-config.js +735 -0
  44. package/dist/theme/theme-provider.d.ts +11 -81
  45. package/dist/theme/theme-provider.js +20 -392
  46. package/dist/theme/tokens/colors.d.ts +153 -0
  47. package/dist/theme/tokens/colors.js +306 -0
  48. package/dist/theme/tokens/constants.d.ts +136 -0
  49. package/dist/theme/tokens/constants.js +137 -0
  50. package/dist/theme-provider-XqWasApp.js +11 -0
  51. package/dist/theme-provider-XqWasApp.js.map +1 -0
  52. package/dist/theme-provider-c4R_KW4X.js +2 -0
  53. package/dist/theme-provider-c4R_KW4X.js.map +1 -0
  54. package/dist/theme-provider-slJZwhTc.js +11 -0
  55. package/dist/theme-provider-slJZwhTc.js.map +1 -0
  56. package/dist/theme-provider-slTbQLX5.js +2 -0
  57. package/dist/theme-provider-slTbQLX5.js.map +1 -0
  58. package/dist/validation/index.cjs.js.map +1 -1
  59. package/dist/validation/index.js.map +1 -1
  60. package/package.json +22 -21
  61. package/dist/InfoCircleOutlined-B7d2aRfV.js +0 -7
  62. package/dist/InfoCircleOutlined-B7d2aRfV.js.map +0 -1
  63. package/dist/InfoCircleOutlined-DYs90hdV.js +0 -7
  64. package/dist/InfoCircleOutlined-DYs90hdV.js.map +0 -1
  65. package/dist/ZoomOutOutlined-BL6A5RSq.js +0 -2
  66. package/dist/ZoomOutOutlined-BL6A5RSq.js.map +0 -1
  67. package/dist/ZoomOutOutlined-BY_CCwq7.js +0 -2
  68. package/dist/ZoomOutOutlined-BY_CCwq7.js.map +0 -1
  69. package/dist/tembo-notify-B-mUpU8q.js +0 -2
  70. package/dist/tembo-notify-B-mUpU8q.js.map +0 -1
  71. package/dist/tembo-notify-C4_8DSSc.js +0 -2
  72. package/dist/tembo-notify-C4_8DSSc.js.map +0 -1
  73. package/dist/theme-provider-Ca4P0Hcp.js +0 -11
  74. package/dist/theme-provider-Ca4P0Hcp.js.map +0 -1
  75. package/dist/theme-provider-RhAw3jw_.js +0 -11
  76. package/dist/theme-provider-RhAw3jw_.js.map +0 -1
  77. /package/dist/theme/{colors.d.ts → deprecated/colors.d.ts} +0 -0
  78. /package/dist/theme/{colors.js → deprecated/colors.js} +0 -0
  79. /package/dist/theme/{constants.d.ts → deprecated/constants.d.ts} +0 -0
  80. /package/dist/theme/{constants.js → deprecated/constants.js} +0 -0
@@ -1,99 +1,29 @@
1
+ import "./theme-overrides.css";
1
2
  import React from 'react';
2
3
  import type { ThemeConfig } from 'antd';
3
- import { TemboColorPalette, TemboColorOverrides, ThemeMode } from './colors.js';
4
- import { TemboUIConstants, TemboUIConstantsOverrides } from './constants.js';
4
+ import { UIConstants } from './tokens/constants.js';
5
+ import { ColorPalette, ThemeMode } from './tokens/colors.js';
5
6
  /**
6
- * Shape of the theme context exposed via useTemboTheme()
7
+ * Theme context value - now includes constants!
7
8
  */
8
- export interface TemboThemeContextValue {
9
- colors: TemboColorPalette;
10
- constants: TemboUIConstants;
9
+ export interface TemboTheme {
10
+ colors: ColorPalette;
11
+ constants: UIConstants;
11
12
  mode: ThemeMode;
12
13
  }
13
14
  /**
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>
15
+ * Theme provider props
53
16
  */
54
17
  export interface TemboThemeProviderProps {
55
18
  children: React.ReactNode;
56
- /** Theme mode - 'light' or 'dark' */
57
19
  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>;
20
+ antdThemeOverrides?: Partial<ThemeConfig>;
64
21
  }
65
22
  /**
66
23
  * 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
24
  */
74
25
  export declare const TemboThemeProvider: React.FC<TemboThemeProviderProps>;
75
26
  /**
76
- * Hook to access the active Tembo theme
77
- *
78
- * Returns the merged color palette, UI constants, and current theme mode.
79
- * Components should always use this hook instead of importing defaults directly.
80
- *
81
- * @returns Theme context containing colors, constants, and mode
82
- *
83
- * @example
84
- * function MyComponent() {
85
- * const { colors, constants, mode } = useTemboTheme();
86
- *
87
- * return (
88
- * <div style={{
89
- * color: colors.text.primary,
90
- * padding: constants.spacing.md,
91
- * borderRadius: constants.radius.base,
92
- * backgroundColor: colors.neutral.lightest
93
- * }}>
94
- * Current theme: {mode}
95
- * </div>
96
- * );
97
- * }
27
+ * Hook to access theme - now returns constants too!
98
28
  */
99
- export declare const useTemboTheme: () => TemboThemeContextValue;
29
+ export declare const useNewTemboTheme: () => TemboTheme;
@@ -1,404 +1,32 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import "./theme-overrides.css";
2
3
  import React from 'react';
3
4
  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
- */
5
+ import { defaultUIConstants } from './tokens/constants.js';
6
+ import { buildAntDTheme } from './theme-config.js';
7
+ import { buildColorPalette } from './tokens/colors.js';
9
8
  const TemboThemeContext = React.createContext({
10
- colors: buildColorPalette(),
11
- constants: buildUIConstants(),
9
+ colors: buildColorPalette('light'),
10
+ constants: defaultUIConstants,
12
11
  mode: 'light',
13
12
  });
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
13
  /**
361
14
  * 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
15
  */
369
- export const TemboThemeProvider = ({ 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 }) }));
16
+ export const TemboThemeProvider = ({ children, mode = 'light', antdThemeOverrides, }) => {
17
+ const colors = React.useMemo(() => buildColorPalette(mode), [mode]);
18
+ const constants = React.useMemo(() => defaultUIConstants, []);
19
+ const antdTheme = React.useMemo(() => {
20
+ var _a, _b;
21
+ const baseTheme = buildAntDTheme(colors, constants);
22
+ if (!antdThemeOverrides)
23
+ return baseTheme;
24
+ return Object.assign(Object.assign({}, baseTheme), { token: Object.assign(Object.assign({}, baseTheme.token), ((_a = antdThemeOverrides.token) !== null && _a !== void 0 ? _a : {})), components: Object.assign(Object.assign({}, baseTheme.components), ((_b = antdThemeOverrides.components) !== null && _b !== void 0 ? _b : {})) });
25
+ }, [colors, constants, antdThemeOverrides]);
26
+ const contextValue = React.useMemo(() => ({ colors, constants, mode }), [colors, constants, mode]);
27
+ return (_jsx(TemboThemeContext.Provider, { value: contextValue, children: _jsx(ConfigProvider, { theme: antdTheme, children: children }) }));
379
28
  };
380
29
  /**
381
- * Hook to access the active Tembo theme
382
- *
383
- * Returns the merged color palette, UI constants, and current theme mode.
384
- * Components should always use this hook instead of importing defaults directly.
385
- *
386
- * @returns Theme context containing colors, constants, and mode
387
- *
388
- * @example
389
- * function MyComponent() {
390
- * const { colors, constants, mode } = useTemboTheme();
391
- *
392
- * return (
393
- * <div style={{
394
- * color: colors.text.primary,
395
- * padding: constants.spacing.md,
396
- * borderRadius: constants.radius.base,
397
- * backgroundColor: colors.neutral.lightest
398
- * }}>
399
- * Current theme: {mode}
400
- * </div>
401
- * );
402
- * }
30
+ * Hook to access theme - now returns constants too!
403
31
  */
404
- export const useTemboTheme = () => React.useContext(TemboThemeContext);
32
+ export const useNewTemboTheme = () => React.useContext(TemboThemeContext);
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Tembo Design System - Monochrome Foundation with Modern Semantics
3
+ *
4
+ * Philosophy: Pure monochrome with single accent + modern semantic colors
5
+ * - Primary actions: Near-black (light) / Near-white (dark)
6
+ * - All UI elements use neutral scale
7
+ * - Blue accent for links and focus states
8
+ * - Modern, vibrant semantic colors with AAA contrast
9
+ *
10
+ * Semantic color definitions:
11
+ * - main: For icons, borders, full backgrounds, text on subtle backgrounds
12
+ * - subtle: For light/dark background fills
13
+ * - contrast: For icons & text on main backgrounds
14
+ *
15
+ * Secondary color definitions:
16
+ * - subtlest: Barely visible tint (for large background areas)
17
+ * - subtle: Soft but visible tint (for badges, highlights)
18
+ * - main: Strong accent color (for icons, borders, emphasis)
19
+ * - contrast: High contrast (for text on main backgrounds only)
20
+ */
21
+ export type ThemeMode = 'light' | 'dark';
22
+ /**
23
+ * Color scale interface (for semantic colors)
24
+ */
25
+ export interface ColorScale {
26
+ /** Main color - for icons, borders, solid backgrounds, text on subtle */
27
+ main: string;
28
+ /** Subtle background - for alert/badge backgrounds */
29
+ subtle: string;
30
+ /** Contrast color - for text/icons on main backgrounds */
31
+ contrast: string;
32
+ }
33
+ /**
34
+ * Secondary color scale interface (4-step scale)
35
+ */
36
+ export interface SecondaryColorScale {
37
+ /** Subtlest background - barely visible tint, highest luminosity */
38
+ subtlest: string;
39
+ /** Subtle background - soft tint, still very light/dark */
40
+ subtle: string;
41
+ /** Main accent - vibrant color for icons, borders */
42
+ main: string;
43
+ /** Contrast - for text on main backgrounds only */
44
+ contrast: string;
45
+ }
46
+ /**
47
+ * Complete color palette
48
+ */
49
+ export interface ColorPalette {
50
+ mode: ThemeMode;
51
+ /**
52
+ * Monochrome neutral scale - carefully calibrated
53
+ * 10-step scale (0-9) with proper WCAG contrast ratios
54
+ */
55
+ neutral: {
56
+ 0: string;
57
+ 1: string;
58
+ 2: string;
59
+ 3: string;
60
+ 4: string;
61
+ 5: string;
62
+ 6: string;
63
+ 7: string;
64
+ 8: string;
65
+ 9: string;
66
+ };
67
+ absolute: {
68
+ black: string;
69
+ white: string;
70
+ };
71
+ accent: {
72
+ default: string;
73
+ hover: string;
74
+ active: string;
75
+ subtle: string;
76
+ };
77
+ semantic: {
78
+ success: ColorScale;
79
+ error: ColorScale;
80
+ warning: ColorScale;
81
+ info: ColorScale;
82
+ pending: ColorScale;
83
+ };
84
+ /**
85
+ * Secondary colors - for badges, labels, tags, highlights
86
+ * Each with 4-step scale: subtlest, subtle, main, contrast
87
+ * Text colors (primary/secondary/tertiary) work on both subtlest and subtle backgrounds
88
+ */
89
+ secondary: {
90
+ purple: SecondaryColorScale;
91
+ green: SecondaryColorScale;
92
+ blue: SecondaryColorScale;
93
+ orange: SecondaryColorScale;
94
+ };
95
+ surface: {
96
+ /** Main backgrounds */
97
+ page: string;
98
+ /**Elevated surfaces */
99
+ card: string;
100
+ /**Modals, dropdowns */
101
+ overlay: string;
102
+ /**Input fields */
103
+ input: string;
104
+ /** Hover states */
105
+ interactive: string;
106
+ /** Selected states */
107
+ selected: string;
108
+ /** Nested backgrounds */
109
+ nested: string;
110
+ };
111
+ border: {
112
+ subtle: string;
113
+ default: string;
114
+ strong: string;
115
+ };
116
+ text: {
117
+ primary: string;
118
+ secondary: string;
119
+ tertiary: string;
120
+ disabled: string;
121
+ inverse: string;
122
+ input: string;
123
+ };
124
+ action: {
125
+ default: string;
126
+ hover: string;
127
+ disabled: string;
128
+ contrast: string;
129
+ };
130
+ }
131
+ export declare const buildColorPalette: (mode?: ThemeMode) => ColorPalette;
132
+ export declare const lightPalette: ColorPalette;
133
+ export declare const darkPalette: ColorPalette;
134
+ /**
135
+ * Color palette overrides (for custom theming)
136
+ */
137
+ export type ColorOverrides = {
138
+ neutral?: Partial<ColorPalette['neutral']>;
139
+ accent?: Partial<ColorPalette['accent']>;
140
+ semantic?: {
141
+ success?: Partial<ColorScale>;
142
+ error?: Partial<ColorScale>;
143
+ warning?: Partial<ColorScale>;
144
+ info?: Partial<ColorScale>;
145
+ pending?: Partial<ColorScale>;
146
+ };
147
+ secondary?: {
148
+ purple?: Partial<SecondaryColorScale>;
149
+ green?: Partial<SecondaryColorScale>;
150
+ blue?: Partial<SecondaryColorScale>;
151
+ orange?: Partial<SecondaryColorScale>;
152
+ };
153
+ };