@temboplus/frontend-react-core 0.1.3-beta.2 → 0.1.3-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CloseCircleOutlined-CMilRURi.js +3 -0
- package/dist/CloseCircleOutlined-CMilRURi.js.map +1 -0
- package/dist/CloseCircleOutlined-CSHx89Jn.js +3 -0
- package/dist/CloseCircleOutlined-CSHx89Jn.js.map +1 -0
- package/dist/InfoCircleOutlined-DR9DmuN-.js +5 -0
- package/dist/InfoCircleOutlined-DR9DmuN-.js.map +1 -0
- package/dist/InfoCircleOutlined-Hx86sClq.js +5 -0
- package/dist/InfoCircleOutlined-Hx86sClq.js.map +1 -0
- package/dist/alerts/index.cjs.js +1 -1
- package/dist/alerts/index.cjs.js.map +1 -1
- package/dist/alerts/index.js +1 -1
- package/dist/alerts/index.js.map +1 -1
- package/dist/dialogs/index.cjs.js +3 -1
- package/dist/dialogs/index.cjs.js.map +1 -1
- package/dist/dialogs/index.js +3 -1
- package/dist/dialogs/index.js.map +1 -1
- package/dist/features/alerts/alert.js +18 -18
- package/dist/features/dialogs/tembo-confirm.js +11 -11
- package/dist/features/notifications/tembo-notify.d.ts +32 -105
- package/dist/features/notifications/tembo-notify.js +102 -111
- package/dist/features/notifications/toast-config.d.ts +4 -6
- package/dist/features/notifications/toast-config.js +28 -21
- package/dist/features/notifications/toast-container.d.ts +13 -3
- package/dist/features/notifications/toast-container.js +80 -9
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/notifications/index.cjs.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/providers.d.ts +2 -32
- package/dist/providers.js +3 -24
- package/dist/tembo-notify-BSIZkV5f.js +3 -0
- package/dist/tembo-notify-BSIZkV5f.js.map +1 -0
- package/dist/tembo-notify-ZYud9J7B.js +3 -0
- package/dist/tembo-notify-ZYud9J7B.js.map +1 -0
- package/dist/theme/{colors.d.ts → deprecated/colors.d.ts} +55 -23
- package/dist/theme/deprecated/colors.js +212 -0
- package/dist/theme/deprecated/theme-provider.d.ts +100 -0
- package/dist/theme/deprecated/theme-provider.js +405 -0
- package/dist/theme/index.cjs.js +1 -1
- package/dist/theme/index.d.ts +3 -2
- package/dist/theme/index.js +1 -1
- package/dist/theme/theme-config.d.ts +15 -0
- package/dist/theme/theme-config.js +735 -0
- package/dist/theme/theme-provider.d.ts +13 -71
- package/dist/theme/theme-provider.js +21 -387
- package/dist/theme/tokens/colors.d.ts +108 -0
- package/dist/theme/tokens/colors.js +236 -0
- package/dist/theme/tokens/constants.d.ts +126 -0
- package/dist/theme/tokens/constants.js +126 -0
- package/dist/theme-provider-CCkR2IcZ.js +11 -0
- package/dist/theme-provider-CCkR2IcZ.js.map +1 -0
- package/dist/theme-provider-CCwq2x0C.js +2 -0
- package/dist/theme-provider-CCwq2x0C.js.map +1 -0
- package/dist/theme-provider-D2HR_D4s.js +11 -0
- package/dist/theme-provider-D2HR_D4s.js.map +1 -0
- package/dist/theme-provider-dbj9jb7X.js +2 -0
- package/dist/theme-provider-dbj9jb7X.js.map +1 -0
- package/dist/validation/index.cjs.js.map +1 -1
- package/dist/validation/index.js.map +1 -1
- package/package.json +17 -18
- package/dist/InfoCircleOutlined-B7d2aRfV.js +0 -7
- package/dist/InfoCircleOutlined-B7d2aRfV.js.map +0 -1
- package/dist/InfoCircleOutlined-DYs90hdV.js +0 -7
- package/dist/InfoCircleOutlined-DYs90hdV.js.map +0 -1
- package/dist/ZoomOutOutlined-BL6A5RSq.js +0 -2
- package/dist/ZoomOutOutlined-BL6A5RSq.js.map +0 -1
- package/dist/ZoomOutOutlined-BY_CCwq7.js +0 -2
- package/dist/ZoomOutOutlined-BY_CCwq7.js.map +0 -1
- package/dist/tembo-notify-C-QGduBt.js +0 -2
- package/dist/tembo-notify-C-QGduBt.js.map +0 -1
- package/dist/tembo-notify-D-uOV3t0.js +0 -2
- package/dist/tembo-notify-D-uOV3t0.js.map +0 -1
- package/dist/theme/colors.js +0 -138
- package/dist/theme-provider-D_oV1J_K.js +0 -11
- package/dist/theme-provider-D_oV1J_K.js.map +0 -1
- package/dist/theme-provider-Dqvy24OD.js +0 -11
- package/dist/theme-provider-Dqvy24OD.js.map +0 -1
- /package/dist/theme/{constants.d.ts → deprecated/constants.d.ts} +0 -0
- /package/dist/theme/{constants.js → deprecated/constants.js} +0 -0
|
@@ -1,87 +1,29 @@
|
|
|
1
|
+
import "./theme-overrides.css";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import type { ThemeConfig } from 'antd';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
4
|
+
import { UIConstants } from './tokens/constants.js';
|
|
5
|
+
import { ColorPalette, ThemeMode } from './tokens/colors.js';
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Theme context value - now includes constants!
|
|
7
8
|
*/
|
|
8
|
-
export interface
|
|
9
|
-
colors:
|
|
10
|
-
constants:
|
|
9
|
+
export interface TemboTheme {
|
|
10
|
+
colors: ColorPalette;
|
|
11
|
+
constants: UIConstants;
|
|
12
|
+
mode: ThemeMode;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* // Basic usage
|
|
17
|
-
* <TemboThemeProvider>
|
|
18
|
-
* <App />
|
|
19
|
-
* </TemboThemeProvider>
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // With color overrides
|
|
23
|
-
* <TemboThemeProvider
|
|
24
|
-
* colors={{
|
|
25
|
-
* primary: { main: '#007bff' },
|
|
26
|
-
* action: { main: '#28a745' }
|
|
27
|
-
* }}
|
|
28
|
-
* >
|
|
29
|
-
* <App />
|
|
30
|
-
* </TemboThemeProvider>
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* // With all customizations
|
|
34
|
-
* <TemboThemeProvider
|
|
35
|
-
* colors={{ primary: { main: '#007bff' } }}
|
|
36
|
-
* constants={{ radius: { base: 8 } }}
|
|
37
|
-
* themeOverrides={{
|
|
38
|
-
* components: {
|
|
39
|
-
* Button: { controlHeight: 40 }
|
|
40
|
-
* }
|
|
41
|
-
* }}
|
|
42
|
-
* >
|
|
43
|
-
* <App />
|
|
44
|
-
* </TemboThemeProvider>
|
|
15
|
+
* Theme provider props
|
|
45
16
|
*/
|
|
46
17
|
export interface TemboThemeProviderProps {
|
|
47
18
|
children: React.ReactNode;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/** UI constants overrides - supports deep partial overrides */
|
|
51
|
-
constants?: TemboUIConstantsOverrides;
|
|
52
|
-
/** Raw Ant Design ThemeConfig overrides for advanced customization */
|
|
53
|
-
themeOverrides?: Partial<ThemeConfig>;
|
|
19
|
+
mode?: ThemeMode;
|
|
20
|
+
antdThemeOverrides?: Partial<ThemeConfig>;
|
|
54
21
|
}
|
|
55
22
|
/**
|
|
56
23
|
* TemboThemeProvider
|
|
57
|
-
*
|
|
58
|
-
* Wraps your application to provide theming through React context and Ant Design's ConfigProvider.
|
|
59
|
-
* Merges default colors/constants with host overrides and configures Ant Design components.
|
|
60
|
-
*
|
|
61
|
-
* All child components can access theme values via the useTemboTheme() hook.
|
|
62
24
|
*/
|
|
63
25
|
export declare const TemboThemeProvider: React.FC<TemboThemeProviderProps>;
|
|
64
26
|
/**
|
|
65
|
-
* Hook to access
|
|
66
|
-
*
|
|
67
|
-
* Returns the merged color palette and UI constants with any host overrides applied.
|
|
68
|
-
* Components should always use this hook instead of importing defaults directly.
|
|
69
|
-
*
|
|
70
|
-
* @returns Theme context containing colors and constants
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* function MyComponent() {
|
|
74
|
-
* const { colors, constants } = useTemboTheme();
|
|
75
|
-
*
|
|
76
|
-
* return (
|
|
77
|
-
* <div style={{
|
|
78
|
-
* color: colors.text.primary,
|
|
79
|
-
* padding: constants.spacing.md,
|
|
80
|
-
* borderRadius: constants.radius.base
|
|
81
|
-
* }}>
|
|
82
|
-
* Themed content
|
|
83
|
-
* </div>
|
|
84
|
-
* );
|
|
85
|
-
* }
|
|
27
|
+
* Hook to access theme - now returns constants too!
|
|
86
28
|
*/
|
|
87
|
-
export declare const
|
|
29
|
+
export declare const useNewTemboTheme: () => TemboTheme;
|
|
@@ -1,398 +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 {
|
|
5
|
-
import {
|
|
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:
|
|
9
|
+
colors: buildColorPalette('light'),
|
|
10
|
+
constants: defaultUIConstants,
|
|
11
|
+
mode: 'light',
|
|
12
12
|
});
|
|
13
|
-
/**
|
|
14
|
-
* Build Ant Design theme configuration from Tembo tokens
|
|
15
|
-
* Maps semantic Tembo color palette and constants to Ant Design's token system
|
|
16
|
-
*
|
|
17
|
-
* @param palette - Complete Tembo color palette
|
|
18
|
-
* @param constants - Complete Tembo UI constants
|
|
19
|
-
* @param overrides - Optional raw Ant Design theme overrides
|
|
20
|
-
* @returns Ant Design ThemeConfig
|
|
21
|
-
*/
|
|
22
|
-
const buildAntDThemeConfig = (palette, constants, overrides) => {
|
|
23
|
-
var _a, _b;
|
|
24
|
-
const baseTokens = {
|
|
25
|
-
// Primary colors
|
|
26
|
-
colorPrimary: palette.primary.main,
|
|
27
|
-
colorPrimaryHover: palette.primary.hover,
|
|
28
|
-
colorPrimaryActive: palette.primary.active,
|
|
29
|
-
colorPrimaryBorder: palette.primary.main,
|
|
30
|
-
// Text colors
|
|
31
|
-
colorText: palette.text.primary,
|
|
32
|
-
colorTextSecondary: palette.text.secondary,
|
|
33
|
-
colorTextTertiary: palette.text.tertiary,
|
|
34
|
-
colorTextQuaternary: palette.text.quaternary,
|
|
35
|
-
colorTextDisabled: palette.text.disabled,
|
|
36
|
-
// Background colors
|
|
37
|
-
colorBgBase: palette.surface.background,
|
|
38
|
-
colorBgContainer: palette.surface.main,
|
|
39
|
-
colorBgElevated: palette.surface.elevated,
|
|
40
|
-
colorBgLayout: palette.surface.background,
|
|
41
|
-
colorBgSpotlight: palette.surface.hover,
|
|
42
|
-
// Border colors
|
|
43
|
-
colorBorder: palette.border.main,
|
|
44
|
-
colorBorderSecondary: palette.border.light,
|
|
45
|
-
colorSplit: palette.border.divider,
|
|
46
|
-
// Success colors
|
|
47
|
-
colorSuccess: palette.success.main,
|
|
48
|
-
colorSuccessBg: palette.success.bg,
|
|
49
|
-
colorSuccessBorder: palette.success.border,
|
|
50
|
-
colorSuccessText: palette.success.text,
|
|
51
|
-
// Error colors
|
|
52
|
-
colorError: palette.error.main,
|
|
53
|
-
colorErrorBg: palette.error.bg,
|
|
54
|
-
colorErrorBorder: palette.error.border,
|
|
55
|
-
colorErrorText: palette.error.text,
|
|
56
|
-
// Warning colors
|
|
57
|
-
colorWarning: palette.warning.main,
|
|
58
|
-
colorWarningBg: palette.warning.bg,
|
|
59
|
-
colorWarningBorder: palette.warning.border,
|
|
60
|
-
colorWarningText: palette.warning.text,
|
|
61
|
-
// Info colors
|
|
62
|
-
colorInfo: palette.info.main,
|
|
63
|
-
colorInfoBg: palette.info.bg,
|
|
64
|
-
colorInfoBorder: palette.info.border,
|
|
65
|
-
colorInfoText: palette.info.text,
|
|
66
|
-
// Link colors
|
|
67
|
-
colorLink: palette.utility.link,
|
|
68
|
-
colorLinkHover: palette.utility.linkHover,
|
|
69
|
-
colorLinkActive: palette.utility.linkActive,
|
|
70
|
-
// Border radius
|
|
71
|
-
borderRadius: constants.radius.base,
|
|
72
|
-
borderRadiusLG: constants.radius.lg,
|
|
73
|
-
borderRadiusSM: constants.radius.sm,
|
|
74
|
-
borderRadiusXS: 6,
|
|
75
|
-
// Shadows
|
|
76
|
-
boxShadow: constants.shadow.base,
|
|
77
|
-
boxShadowSecondary: constants.shadow.card,
|
|
78
|
-
boxShadowTertiary: constants.shadow.elevated,
|
|
79
|
-
// Typography
|
|
80
|
-
fontFamily: constants.typography.fontFamily,
|
|
81
|
-
fontSize: constants.typography.fontSize.base,
|
|
82
|
-
fontSizeHeading1: 38,
|
|
83
|
-
fontSizeHeading2: 30,
|
|
84
|
-
fontSizeHeading3: 24,
|
|
85
|
-
fontSizeHeading4: 20,
|
|
86
|
-
fontSizeHeading5: constants.typography.fontSize.lg,
|
|
87
|
-
fontWeightStrong: constants.typography.fontWeight.medium,
|
|
88
|
-
lineHeight: constants.typography.lineHeight.base,
|
|
89
|
-
lineHeightHeading1: 1.21,
|
|
90
|
-
lineHeightHeading2: 1.27,
|
|
91
|
-
lineHeightHeading3: 1.33,
|
|
92
|
-
lineHeightHeading4: 1.4,
|
|
93
|
-
lineHeightHeading5: 1.5,
|
|
94
|
-
};
|
|
95
|
-
const baseTheme = {
|
|
96
|
-
token: baseTokens,
|
|
97
|
-
components: {
|
|
98
|
-
Button: {
|
|
99
|
-
colorPrimary: palette.components.button.primary.bg,
|
|
100
|
-
colorPrimaryHover: palette.components.button.primary.hover,
|
|
101
|
-
colorPrimaryActive: palette.action.active,
|
|
102
|
-
colorPrimaryBorder: palette.components.button.primary.bg,
|
|
103
|
-
primaryColor: palette.components.button.primary.text,
|
|
104
|
-
colorBorder: palette.components.button.default.border,
|
|
105
|
-
colorBgContainer: palette.components.button.default.bg,
|
|
106
|
-
colorText: palette.components.button.default.text,
|
|
107
|
-
defaultBg: palette.components.button.default.bg,
|
|
108
|
-
defaultBorderColor: palette.components.button.default.border,
|
|
109
|
-
defaultColor: palette.components.button.default.text,
|
|
110
|
-
primaryShadow: 'none',
|
|
111
|
-
defaultShadow: 'none',
|
|
112
|
-
dangerShadow: 'none',
|
|
113
|
-
fontWeight: constants.typography.fontWeight.medium,
|
|
114
|
-
controlHeight: 32,
|
|
115
|
-
paddingContentHorizontal: constants.spacing.lg,
|
|
116
|
-
borderRadius: constants.radius.button,
|
|
117
|
-
borderRadiusLG: constants.radius.button,
|
|
118
|
-
borderRadiusSM: constants.radius.sm + 8,
|
|
119
|
-
},
|
|
120
|
-
Input: {
|
|
121
|
-
colorBgContainer: palette.components.input.bg,
|
|
122
|
-
colorBorder: palette.components.input.border,
|
|
123
|
-
hoverBorderColor: palette.components.input.borderHover,
|
|
124
|
-
activeBorderColor: palette.components.input.borderFocus,
|
|
125
|
-
colorPrimaryHover: palette.components.input.borderFocus,
|
|
126
|
-
colorTextPlaceholder: palette.components.input.placeholder,
|
|
127
|
-
borderRadius: constants.radius.input,
|
|
128
|
-
borderRadiusLG: constants.radius.base,
|
|
129
|
-
borderRadiusSM: constants.radius.sm,
|
|
130
|
-
},
|
|
131
|
-
Select: {
|
|
132
|
-
colorBgContainer: palette.components.input.bg,
|
|
133
|
-
colorBorder: palette.components.input.border,
|
|
134
|
-
colorTextPlaceholder: palette.components.input.placeholder,
|
|
135
|
-
colorPrimaryHover: palette.action.main,
|
|
136
|
-
hoverBorderColor: palette.components.input.borderHover,
|
|
137
|
-
activeBorderColor: palette.components.input.borderFocus,
|
|
138
|
-
optionSelectedBg: palette.action.main,
|
|
139
|
-
optionSelectedColor: palette.action.contrast,
|
|
140
|
-
optionActiveBg: palette.surface.hover,
|
|
141
|
-
colorBgElevated: palette.utility.white,
|
|
142
|
-
controlItemBgHover: palette.surface.hover,
|
|
143
|
-
boxShadowSecondary: constants.shadow.elevated,
|
|
144
|
-
borderRadius: constants.radius.input,
|
|
145
|
-
borderRadiusLG: constants.radius.base,
|
|
146
|
-
borderRadiusSM: constants.radius.sm,
|
|
147
|
-
},
|
|
148
|
-
Checkbox: {
|
|
149
|
-
colorPrimary: palette.action.main,
|
|
150
|
-
colorPrimaryHover: palette.action.hover,
|
|
151
|
-
colorBorder: palette.border.strong,
|
|
152
|
-
borderRadiusSM: 6,
|
|
153
|
-
},
|
|
154
|
-
Radio: {
|
|
155
|
-
colorPrimary: palette.action.main,
|
|
156
|
-
colorPrimaryHover: palette.action.hover,
|
|
157
|
-
colorBorder: palette.border.strong,
|
|
158
|
-
},
|
|
159
|
-
Switch: {
|
|
160
|
-
colorPrimary: palette.action.main,
|
|
161
|
-
colorPrimaryHover: palette.action.hover,
|
|
162
|
-
colorTextQuaternary: palette.text.quaternary,
|
|
163
|
-
},
|
|
164
|
-
Form: {
|
|
165
|
-
labelColor: palette.text.primary,
|
|
166
|
-
labelRequiredMarkColor: palette.error.main,
|
|
167
|
-
labelFontSize: constants.typography.fontSize.base,
|
|
168
|
-
itemMarginBottom: constants.spacing.lg,
|
|
169
|
-
},
|
|
170
|
-
DatePicker: {
|
|
171
|
-
colorBgContainer: palette.components.input.bg,
|
|
172
|
-
colorBorder: palette.components.input.border,
|
|
173
|
-
hoverBorderColor: palette.components.input.borderHover,
|
|
174
|
-
activeBorderColor: palette.components.input.borderFocus,
|
|
175
|
-
colorPrimary: palette.action.main,
|
|
176
|
-
borderRadius: constants.radius.input,
|
|
177
|
-
},
|
|
178
|
-
InputNumber: {
|
|
179
|
-
borderRadius: constants.radius.input,
|
|
180
|
-
},
|
|
181
|
-
Table: {
|
|
182
|
-
colorBgContainer: palette.components.table.bg,
|
|
183
|
-
headerBg: palette.components.table.headerBg,
|
|
184
|
-
headerColor: palette.components.table.headerText,
|
|
185
|
-
borderColor: palette.components.table.border,
|
|
186
|
-
headerSplitColor: palette.components.table.border,
|
|
187
|
-
rowHoverBg: palette.components.table.rowHover,
|
|
188
|
-
rowSelectedBg: palette.action.light,
|
|
189
|
-
rowSelectedHoverBg: palette.action.lighter,
|
|
190
|
-
colorText: palette.text.primary,
|
|
191
|
-
colorTextHeading: palette.text.primary,
|
|
192
|
-
borderRadius: constants.radius.base,
|
|
193
|
-
borderRadiusLG: constants.radius.lg,
|
|
194
|
-
},
|
|
195
|
-
Card: {
|
|
196
|
-
colorBgContainer: palette.surface.main,
|
|
197
|
-
colorBorder: palette.border.main,
|
|
198
|
-
colorBorderSecondary: palette.border.light,
|
|
199
|
-
boxShadowTertiary: constants.shadow.card,
|
|
200
|
-
borderRadius: constants.radius.card,
|
|
201
|
-
borderRadiusLG: constants.radius.lg + 4,
|
|
202
|
-
},
|
|
203
|
-
Statistic: {
|
|
204
|
-
contentFontSize: 24,
|
|
205
|
-
colorTextHeading: palette.text.primary,
|
|
206
|
-
},
|
|
207
|
-
Descriptions: {
|
|
208
|
-
labelBg: palette.surface.hover,
|
|
209
|
-
colorTextSecondary: palette.text.secondary,
|
|
210
|
-
itemPaddingBottom: constants.spacing.md,
|
|
211
|
-
},
|
|
212
|
-
Badge: {
|
|
213
|
-
colorError: palette.error.main,
|
|
214
|
-
colorSuccess: palette.success.main,
|
|
215
|
-
colorInfo: palette.info.main,
|
|
216
|
-
colorInfoBg: palette.info.bg,
|
|
217
|
-
borderRadiusSM: constants.radius.input,
|
|
218
|
-
},
|
|
219
|
-
Tag: {
|
|
220
|
-
colorBorder: palette.border.main,
|
|
221
|
-
defaultBg: palette.surface.hover,
|
|
222
|
-
borderRadiusSM: constants.radius.sm,
|
|
223
|
-
},
|
|
224
|
-
Timeline: {
|
|
225
|
-
dotBg: palette.surface.main,
|
|
226
|
-
tailColor: palette.border.main,
|
|
227
|
-
},
|
|
228
|
-
Alert: {
|
|
229
|
-
colorSuccessBg: palette.success.bg,
|
|
230
|
-
colorSuccessBorder: palette.success.border,
|
|
231
|
-
colorErrorBg: palette.error.bg,
|
|
232
|
-
colorErrorBorder: palette.error.border,
|
|
233
|
-
colorWarningBg: palette.warning.bg,
|
|
234
|
-
colorWarningBorder: palette.warning.border,
|
|
235
|
-
colorInfoBg: palette.info.bg,
|
|
236
|
-
colorInfoBorder: palette.info.border,
|
|
237
|
-
borderRadiusLG: constants.radius.base,
|
|
238
|
-
},
|
|
239
|
-
Modal: {
|
|
240
|
-
contentBg: palette.surface.elevated,
|
|
241
|
-
headerBg: palette.surface.elevated,
|
|
242
|
-
colorBgMask: 'rgba(0, 0, 0, 0.45)',
|
|
243
|
-
borderRadiusLG: constants.radius.lg,
|
|
244
|
-
},
|
|
245
|
-
Drawer: {
|
|
246
|
-
colorBgElevated: palette.surface.elevated,
|
|
247
|
-
colorBgMask: 'rgba(0, 0, 0, 0.45)',
|
|
248
|
-
borderRadiusLG: constants.radius.lg,
|
|
249
|
-
},
|
|
250
|
-
Notification: {
|
|
251
|
-
colorBgElevated: palette.utility.white,
|
|
252
|
-
borderRadiusLG: constants.radius.base,
|
|
253
|
-
},
|
|
254
|
-
Message: {
|
|
255
|
-
contentBg: palette.utility.white,
|
|
256
|
-
borderRadiusLG: constants.radius.base,
|
|
257
|
-
},
|
|
258
|
-
Spin: {
|
|
259
|
-
colorPrimary: palette.primary.main,
|
|
260
|
-
},
|
|
261
|
-
Progress: {
|
|
262
|
-
colorSuccess: palette.success.main,
|
|
263
|
-
colorError: palette.error.main,
|
|
264
|
-
defaultColor: palette.primary.main,
|
|
265
|
-
borderRadius: 100,
|
|
266
|
-
},
|
|
267
|
-
Skeleton: {
|
|
268
|
-
colorFill: palette.neutral[200],
|
|
269
|
-
colorFillContent: palette.neutral[100],
|
|
270
|
-
borderRadiusSM: constants.radius.sm,
|
|
271
|
-
},
|
|
272
|
-
Menu: {
|
|
273
|
-
itemBg: 'transparent',
|
|
274
|
-
itemColor: palette.text.primary,
|
|
275
|
-
itemHoverBg: palette.surface.hover,
|
|
276
|
-
itemSelectedBg: palette.action.lighter,
|
|
277
|
-
itemSelectedColor: palette.action.main,
|
|
278
|
-
itemActiveBg: palette.action.lighter,
|
|
279
|
-
subMenuItemBg: 'transparent',
|
|
280
|
-
darkItemBg: palette.components.sidebar.bg,
|
|
281
|
-
darkSubMenuItemBg: palette.components.sidebar.bg,
|
|
282
|
-
darkItemColor: palette.components.sidebar.text,
|
|
283
|
-
darkItemHoverBg: palette.components.sidebar.hover,
|
|
284
|
-
darkItemSelectedBg: palette.components.sidebar.selected,
|
|
285
|
-
darkItemSelectedColor: palette.primary.contrast,
|
|
286
|
-
borderRadius: constants.radius.input,
|
|
287
|
-
borderRadiusLG: constants.radius.base,
|
|
288
|
-
},
|
|
289
|
-
Breadcrumb: {
|
|
290
|
-
linkColor: palette.utility.link,
|
|
291
|
-
linkHoverColor: palette.utility.linkHover,
|
|
292
|
-
itemColor: palette.text.secondary,
|
|
293
|
-
lastItemColor: palette.text.primary,
|
|
294
|
-
separatorColor: palette.text.tertiary,
|
|
295
|
-
borderRadiusSM: 6,
|
|
296
|
-
},
|
|
297
|
-
Pagination: {
|
|
298
|
-
colorPrimary: palette.primary.main,
|
|
299
|
-
colorPrimaryHover: palette.primary.hover,
|
|
300
|
-
itemActiveBg: palette.primary.main,
|
|
301
|
-
borderRadius: constants.radius.sm,
|
|
302
|
-
},
|
|
303
|
-
Steps: {
|
|
304
|
-
colorPrimary: palette.action.main,
|
|
305
|
-
colorText: palette.text.secondary,
|
|
306
|
-
colorTextDescription: palette.text.tertiary,
|
|
307
|
-
borderRadiusSM: 100,
|
|
308
|
-
},
|
|
309
|
-
Tabs: {
|
|
310
|
-
colorPrimary: palette.action.main,
|
|
311
|
-
colorBorderSecondary: palette.border.main,
|
|
312
|
-
itemColor: palette.text.secondary,
|
|
313
|
-
itemHoverColor: palette.action.hover,
|
|
314
|
-
itemSelectedColor: palette.action.main,
|
|
315
|
-
inkBarColor: palette.action.main,
|
|
316
|
-
borderRadiusSM: constants.radius.sm,
|
|
317
|
-
},
|
|
318
|
-
Layout: {
|
|
319
|
-
colorBgBody: palette.surface.background,
|
|
320
|
-
colorBgHeader: palette.utility.white,
|
|
321
|
-
colorBgTrigger: palette.components.sidebar.bg,
|
|
322
|
-
siderBg: palette.components.sidebar.bg,
|
|
323
|
-
headerBg: palette.utility.white,
|
|
324
|
-
borderRadiusLG: 0,
|
|
325
|
-
},
|
|
326
|
-
Divider: {
|
|
327
|
-
colorSplit: palette.border.divider,
|
|
328
|
-
},
|
|
329
|
-
Typography: {
|
|
330
|
-
colorText: palette.text.primary,
|
|
331
|
-
colorTextSecondary: palette.text.secondary,
|
|
332
|
-
colorTextDescription: palette.text.tertiary,
|
|
333
|
-
},
|
|
334
|
-
Tooltip: {
|
|
335
|
-
colorBgSpotlight: palette.neutral[900],
|
|
336
|
-
colorTextLightSolid: palette.utility.white,
|
|
337
|
-
borderRadius: constants.radius.sm,
|
|
338
|
-
},
|
|
339
|
-
Popover: {
|
|
340
|
-
colorBgElevated: palette.utility.white,
|
|
341
|
-
borderRadiusLG: constants.radius.base,
|
|
342
|
-
},
|
|
343
|
-
Dropdown: {
|
|
344
|
-
boxShadowSecondary: constants.shadow.dropdown,
|
|
345
|
-
},
|
|
346
|
-
Calendar: {
|
|
347
|
-
colorBgContainer: palette.utility.white,
|
|
348
|
-
colorPrimary: palette.action.main,
|
|
349
|
-
borderRadiusLG: constants.radius.base,
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
};
|
|
353
|
-
if (!overrides)
|
|
354
|
-
return baseTheme;
|
|
355
|
-
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 : {})) });
|
|
356
|
-
};
|
|
357
13
|
/**
|
|
358
14
|
* TemboThemeProvider
|
|
359
|
-
*
|
|
360
|
-
* Wraps your application to provide theming through React context and Ant Design's ConfigProvider.
|
|
361
|
-
* Merges default colors/constants with host overrides and configures Ant Design components.
|
|
362
|
-
*
|
|
363
|
-
* All child components can access theme values via the useTemboTheme() hook.
|
|
364
15
|
*/
|
|
365
|
-
export const TemboThemeProvider = ({ children,
|
|
366
|
-
const
|
|
367
|
-
const
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
colors
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
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 }) }));
|
|
374
28
|
};
|
|
375
29
|
/**
|
|
376
|
-
* Hook to access
|
|
377
|
-
*
|
|
378
|
-
* Returns the merged color palette and UI constants with any host overrides applied.
|
|
379
|
-
* Components should always use this hook instead of importing defaults directly.
|
|
380
|
-
*
|
|
381
|
-
* @returns Theme context containing colors and constants
|
|
382
|
-
*
|
|
383
|
-
* @example
|
|
384
|
-
* function MyComponent() {
|
|
385
|
-
* const { colors, constants } = useTemboTheme();
|
|
386
|
-
*
|
|
387
|
-
* return (
|
|
388
|
-
* <div style={{
|
|
389
|
-
* color: colors.text.primary,
|
|
390
|
-
* padding: constants.spacing.md,
|
|
391
|
-
* borderRadius: constants.radius.base
|
|
392
|
-
* }}>
|
|
393
|
-
* Themed content
|
|
394
|
-
* </div>
|
|
395
|
-
* );
|
|
396
|
-
* }
|
|
30
|
+
* Hook to access theme - now returns constants too!
|
|
397
31
|
*/
|
|
398
|
-
export const
|
|
32
|
+
export const useNewTemboTheme = () => React.useContext(TemboThemeContext);
|
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
export type ThemeMode = 'light' | 'dark';
|
|
16
|
+
/**
|
|
17
|
+
* Color scale interface
|
|
18
|
+
*/
|
|
19
|
+
export interface ColorScale {
|
|
20
|
+
/** Main color - for icons, borders, solid backgrounds, text on subtle */
|
|
21
|
+
main: string;
|
|
22
|
+
/** Subtle background - for alert/badge backgrounds */
|
|
23
|
+
subtle: string;
|
|
24
|
+
/** Contrast color - for text/icons on main backgrounds */
|
|
25
|
+
contrast: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Complete color palette
|
|
29
|
+
*/
|
|
30
|
+
export interface ColorPalette {
|
|
31
|
+
mode: ThemeMode;
|
|
32
|
+
/**
|
|
33
|
+
* Monochrome neutral scale - carefully calibrated
|
|
34
|
+
* 10-step scale (0-9) with proper WCAG contrast ratios
|
|
35
|
+
*/
|
|
36
|
+
neutral: {
|
|
37
|
+
0: string;
|
|
38
|
+
1: string;
|
|
39
|
+
2: string;
|
|
40
|
+
3: string;
|
|
41
|
+
4: string;
|
|
42
|
+
5: string;
|
|
43
|
+
6: string;
|
|
44
|
+
7: string;
|
|
45
|
+
8: string;
|
|
46
|
+
9: string;
|
|
47
|
+
};
|
|
48
|
+
absolute: {
|
|
49
|
+
black: string;
|
|
50
|
+
white: string;
|
|
51
|
+
};
|
|
52
|
+
accent: {
|
|
53
|
+
default: string;
|
|
54
|
+
hover: string;
|
|
55
|
+
active: string;
|
|
56
|
+
subtle: string;
|
|
57
|
+
};
|
|
58
|
+
semantic: {
|
|
59
|
+
success: ColorScale;
|
|
60
|
+
error: ColorScale;
|
|
61
|
+
warning: ColorScale;
|
|
62
|
+
info: ColorScale;
|
|
63
|
+
};
|
|
64
|
+
surface: {
|
|
65
|
+
page: string;
|
|
66
|
+
card: string;
|
|
67
|
+
overlay: string;
|
|
68
|
+
input: string;
|
|
69
|
+
interactive: string;
|
|
70
|
+
selected: string;
|
|
71
|
+
nested: string;
|
|
72
|
+
};
|
|
73
|
+
border: {
|
|
74
|
+
subtle: string;
|
|
75
|
+
default: string;
|
|
76
|
+
strong: string;
|
|
77
|
+
};
|
|
78
|
+
text: {
|
|
79
|
+
primary: string;
|
|
80
|
+
secondary: string;
|
|
81
|
+
tertiary: string;
|
|
82
|
+
disabled: string;
|
|
83
|
+
inverse: string;
|
|
84
|
+
input: string;
|
|
85
|
+
};
|
|
86
|
+
action: {
|
|
87
|
+
default: string;
|
|
88
|
+
hover: string;
|
|
89
|
+
disabled: string;
|
|
90
|
+
contrast: string;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export declare const buildColorPalette: (mode?: ThemeMode) => ColorPalette;
|
|
94
|
+
export declare const lightPalette: ColorPalette;
|
|
95
|
+
export declare const darkPalette: ColorPalette;
|
|
96
|
+
/**
|
|
97
|
+
* Color palette overrides (for custom theming)
|
|
98
|
+
*/
|
|
99
|
+
export type ColorOverrides = {
|
|
100
|
+
neutral?: Partial<ColorPalette['neutral']>;
|
|
101
|
+
accent?: Partial<ColorPalette['accent']>;
|
|
102
|
+
semantic?: {
|
|
103
|
+
success?: Partial<ColorScale>;
|
|
104
|
+
error?: Partial<ColorScale>;
|
|
105
|
+
warning?: Partial<ColorScale>;
|
|
106
|
+
info?: Partial<ColorScale>;
|
|
107
|
+
};
|
|
108
|
+
};
|