@temboplus/frontend-react-core 0.1.3-beta.1 → 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.d.ts +1 -0
- 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.d.ts +1 -0
- package/dist/dialogs/index.js +3 -1
- package/dist/dialogs/index.js.map +1 -1
- package/dist/features/alerts/alert.js +95 -0
- package/dist/features/alerts/index.js +1 -0
- package/dist/features/dialogs/index.js +1 -0
- package/dist/features/dialogs/modal-provider.js +6 -0
- package/dist/features/dialogs/tembo-confirm.js +111 -0
- package/dist/features/input-validation/account-name-validator.js +28 -0
- package/dist/features/input-validation/account-number-validator.js +65 -0
- package/dist/features/input-validation/amount-validator.js +100 -0
- package/dist/features/input-validation/index.js +5 -0
- package/dist/features/input-validation/phone-number-validator.js +79 -0
- package/dist/features/input-validation/swift-code-validator.js +38 -0
- package/dist/features/notifications/index.js +3 -0
- package/dist/features/notifications/tembo-notify.d.ts +29 -103
- package/dist/features/notifications/tembo-notify.js +140 -0
- package/dist/features/notifications/toast-config.d.ts +1 -4
- package/dist/features/notifications/toast-config.js +60 -0
- package/dist/features/notifications/toast-container.d.ts +13 -3
- package/dist/features/notifications/toast-container.js +89 -0
- 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/index.js +1 -0
- package/dist/notifications/index.cjs.js +1 -1
- package/dist/notifications/index.d.ts +1 -0
- package/dist/notifications/index.js +1 -1
- package/dist/providers.d.ts +2 -11
- package/dist/providers.js +32 -0
- 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/{colors.d.ts → deprecated/colors.d.ts} +55 -23
- package/dist/theme/deprecated/colors.js +212 -0
- package/dist/theme/deprecated/constants.js +82 -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 +64 -55
- package/dist/theme/theme-provider.js +100 -0
- 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.d.ts +1 -0
- package/dist/validation/index.js.map +1 -1
- package/package.json +19 -17
- 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-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
|
@@ -1,87 +1,96 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type
|
|
3
|
-
import {
|
|
4
|
-
import { TemboUIConstants, TemboUIConstantsOverrides } from './constants.js';
|
|
2
|
+
import { type ThemeConfig } from 'antd';
|
|
3
|
+
import { ColorPalette, ThemeMode } from './tokens/color.js';
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
5
|
+
* Theme context value
|
|
7
6
|
*/
|
|
8
|
-
export interface
|
|
9
|
-
colors:
|
|
10
|
-
|
|
7
|
+
export interface TemboTheme {
|
|
8
|
+
colors: ColorPalette;
|
|
9
|
+
mode: ThemeMode;
|
|
11
10
|
}
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
12
|
+
* Theme provider props
|
|
13
|
+
*/
|
|
14
|
+
export interface TemboThemeProviderProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/** Theme mode - 'light' or 'dark' */
|
|
17
|
+
mode?: ThemeMode;
|
|
18
|
+
/** Raw Ant Design theme overrides (advanced usage) */
|
|
19
|
+
antdThemeOverrides?: Partial<ThemeConfig>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* TemboThemeProvider
|
|
23
|
+
*
|
|
24
|
+
* Wraps your application with monochrome-first theming system.
|
|
25
|
+
* Supports seamless light/dark mode switching.
|
|
14
26
|
*
|
|
15
27
|
* @example
|
|
28
|
+
* ```tsx
|
|
16
29
|
* // Basic usage
|
|
17
30
|
* <TemboThemeProvider>
|
|
18
31
|
* <App />
|
|
19
32
|
* </TemboThemeProvider>
|
|
20
33
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* <TemboThemeProvider
|
|
24
|
-
* colors={{
|
|
25
|
-
* primary: { main: '#007bff' },
|
|
26
|
-
* action: { main: '#28a745' }
|
|
27
|
-
* }}
|
|
28
|
-
* >
|
|
34
|
+
* // Dark mode
|
|
35
|
+
* <TemboThemeProvider mode="dark">
|
|
29
36
|
* <App />
|
|
30
37
|
* </TemboThemeProvider>
|
|
31
38
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
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>
|
|
45
|
-
*/
|
|
46
|
-
export interface TemboThemeProviderProps {
|
|
47
|
-
children: React.ReactNode;
|
|
48
|
-
/** Color palette overrides - supports deep partial overrides */
|
|
49
|
-
colors?: TemboColorOverrides;
|
|
50
|
-
/** UI constants overrides - supports deep partial overrides */
|
|
51
|
-
constants?: TemboUIConstantsOverrides;
|
|
52
|
-
/** Raw Ant Design ThemeConfig overrides for advanced customization */
|
|
53
|
-
themeOverrides?: Partial<ThemeConfig>;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* 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.
|
|
39
|
+
* // With state management for toggling
|
|
40
|
+
* const [mode, setMode] = useState<ThemeMode>('light');
|
|
60
41
|
*
|
|
61
|
-
*
|
|
42
|
+
* <TemboThemeProvider mode={mode}>
|
|
43
|
+
* <App onToggleTheme={() => setMode(m => m === 'light' ? 'dark' : 'light')} />
|
|
44
|
+
* </TemboThemeProvider>
|
|
45
|
+
* ```
|
|
62
46
|
*/
|
|
63
47
|
export declare const TemboThemeProvider: React.FC<TemboThemeProviderProps>;
|
|
64
48
|
/**
|
|
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.
|
|
49
|
+
* Hook to access current theme
|
|
69
50
|
*
|
|
70
|
-
*
|
|
51
|
+
* Returns the active color palette and theme mode.
|
|
52
|
+
* Use this in components that need direct access to theme tokens.
|
|
71
53
|
*
|
|
72
54
|
* @example
|
|
55
|
+
* ```tsx
|
|
73
56
|
* function MyComponent() {
|
|
74
|
-
* const { colors,
|
|
57
|
+
* const { colors, mode } = useTemboTheme();
|
|
75
58
|
*
|
|
76
59
|
* return (
|
|
77
60
|
* <div style={{
|
|
78
61
|
* color: colors.text.primary,
|
|
79
|
-
*
|
|
80
|
-
*
|
|
62
|
+
* backgroundColor: colors.surface.card,
|
|
63
|
+
* padding: spacing[4],
|
|
64
|
+
* }}>
|
|
65
|
+
* Current theme: {mode}
|
|
66
|
+
* </div>
|
|
67
|
+
* );
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* // Using secondary colors for data visualization
|
|
74
|
+
* function ProductCard({ type }: { type: string }) {
|
|
75
|
+
* const { colors } = useTemboTheme();
|
|
76
|
+
*
|
|
77
|
+
* const colorMap = {
|
|
78
|
+
* savings: colors.secondary.blue,
|
|
79
|
+
* investment: colors.secondary.purple,
|
|
80
|
+
* credit: colors.secondary.pink,
|
|
81
|
+
* };
|
|
82
|
+
*
|
|
83
|
+
* const color = colorMap[type] || colors.secondary.blue;
|
|
84
|
+
*
|
|
85
|
+
* return (
|
|
86
|
+
* <div style={{
|
|
87
|
+
* borderLeft: `4px solid ${color.main}`,
|
|
88
|
+
* backgroundColor: color.subtle,
|
|
81
89
|
* }}>
|
|
82
|
-
*
|
|
90
|
+
* Product content
|
|
83
91
|
* </div>
|
|
84
92
|
* );
|
|
85
93
|
* }
|
|
94
|
+
* ```
|
|
86
95
|
*/
|
|
87
|
-
export declare const
|
|
96
|
+
export declare const useNewTemboTheme: () => TemboTheme;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ConfigProvider } from 'antd';
|
|
4
|
+
import { buildAntDTheme } from './theme-config.js';
|
|
5
|
+
import { buildColorPalette } from './tokens/color.js';
|
|
6
|
+
const TemboThemeContext = React.createContext({
|
|
7
|
+
colors: buildColorPalette('light'),
|
|
8
|
+
mode: 'light',
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* TemboThemeProvider
|
|
12
|
+
*
|
|
13
|
+
* Wraps your application with monochrome-first theming system.
|
|
14
|
+
* Supports seamless light/dark mode switching.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* // Basic usage
|
|
19
|
+
* <TemboThemeProvider>
|
|
20
|
+
* <App />
|
|
21
|
+
* </TemboThemeProvider>
|
|
22
|
+
*
|
|
23
|
+
* // Dark mode
|
|
24
|
+
* <TemboThemeProvider mode="dark">
|
|
25
|
+
* <App />
|
|
26
|
+
* </TemboThemeProvider>
|
|
27
|
+
*
|
|
28
|
+
* // With state management for toggling
|
|
29
|
+
* const [mode, setMode] = useState<ThemeMode>('light');
|
|
30
|
+
*
|
|
31
|
+
* <TemboThemeProvider mode={mode}>
|
|
32
|
+
* <App onToggleTheme={() => setMode(m => m === 'light' ? 'dark' : 'light')} />
|
|
33
|
+
* </TemboThemeProvider>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export const TemboThemeProvider = ({ children, mode = 'light', antdThemeOverrides, }) => {
|
|
37
|
+
// Build color palette for current mode
|
|
38
|
+
const colors = React.useMemo(() => buildColorPalette(mode), [mode]);
|
|
39
|
+
// Build Ant Design theme configuration
|
|
40
|
+
const antdTheme = React.useMemo(() => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const baseTheme = buildAntDTheme(colors);
|
|
43
|
+
if (!antdThemeOverrides)
|
|
44
|
+
return baseTheme;
|
|
45
|
+
// Deep merge overrides
|
|
46
|
+
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 : {})) });
|
|
47
|
+
}, [colors, antdThemeOverrides]);
|
|
48
|
+
// Build context value
|
|
49
|
+
const contextValue = React.useMemo(() => ({ colors, mode }), [colors, mode]);
|
|
50
|
+
return (_jsx(TemboThemeContext.Provider, { value: contextValue, children: _jsx(ConfigProvider, { theme: antdTheme, children: children }) }));
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Hook to access current theme
|
|
54
|
+
*
|
|
55
|
+
* Returns the active color palette and theme mode.
|
|
56
|
+
* Use this in components that need direct access to theme tokens.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* function MyComponent() {
|
|
61
|
+
* const { colors, mode } = useTemboTheme();
|
|
62
|
+
*
|
|
63
|
+
* return (
|
|
64
|
+
* <div style={{
|
|
65
|
+
* color: colors.text.primary,
|
|
66
|
+
* backgroundColor: colors.surface.card,
|
|
67
|
+
* padding: spacing[4],
|
|
68
|
+
* }}>
|
|
69
|
+
* Current theme: {mode}
|
|
70
|
+
* </div>
|
|
71
|
+
* );
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* // Using secondary colors for data visualization
|
|
78
|
+
* function ProductCard({ type }: { type: string }) {
|
|
79
|
+
* const { colors } = useTemboTheme();
|
|
80
|
+
*
|
|
81
|
+
* const colorMap = {
|
|
82
|
+
* savings: colors.secondary.blue,
|
|
83
|
+
* investment: colors.secondary.purple,
|
|
84
|
+
* credit: colors.secondary.pink,
|
|
85
|
+
* };
|
|
86
|
+
*
|
|
87
|
+
* const color = colorMap[type] || colors.secondary.blue;
|
|
88
|
+
*
|
|
89
|
+
* return (
|
|
90
|
+
* <div style={{
|
|
91
|
+
* borderLeft: `4px solid ${color.main}`,
|
|
92
|
+
* backgroundColor: color.subtle,
|
|
93
|
+
* }}>
|
|
94
|
+
* Product content
|
|
95
|
+
* </div>
|
|
96
|
+
* );
|
|
97
|
+
* }
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export const useNewTemboTheme = () => React.useContext(TemboThemeContext);
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tembo Design System - Color Tokens
|
|
3
|
+
*
|
|
4
|
+
* Monochrome-first design system with purposeful color usage.
|
|
5
|
+
*
|
|
6
|
+
* Philosophy:
|
|
7
|
+
* - Monochrome foundation (4 neutral tones)
|
|
8
|
+
* - Color used purposefully (semantic feedback, categories, data viz)
|
|
9
|
+
* - Standard blue for links (web conventions)
|
|
10
|
+
* - Theme-aware: entire system adapts to light/dark mode
|
|
11
|
+
*
|
|
12
|
+
* Inspired by: Wise, Linear, Apple HIG
|
|
13
|
+
*/
|
|
14
|
+
export type ThemeMode = 'light' | 'dark';
|
|
15
|
+
/**
|
|
16
|
+
* Color scale interface
|
|
17
|
+
* Used for semantic and secondary colors
|
|
18
|
+
*/
|
|
19
|
+
export interface ColorScale {
|
|
20
|
+
/** Main color - primary usage */
|
|
21
|
+
main: string;
|
|
22
|
+
/** Subtle background variant */
|
|
23
|
+
subtle: string;
|
|
24
|
+
/** Text color that contrasts with main */
|
|
25
|
+
contrast: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Complete color palette
|
|
29
|
+
*/
|
|
30
|
+
export interface ColorPalette {
|
|
31
|
+
mode: ThemeMode;
|
|
32
|
+
/**
|
|
33
|
+
* Monochrome foundation - 4 neutral tones
|
|
34
|
+
* Theme-aware: inverts in dark mode
|
|
35
|
+
*
|
|
36
|
+
* 1 = Brightest (backgrounds)
|
|
37
|
+
* 2 = Subtle (hover states, dividers)
|
|
38
|
+
* 3 = Medium (borders, disabled text)
|
|
39
|
+
* 4 = Darkest (text, primary elements)
|
|
40
|
+
*/
|
|
41
|
+
neutral: {
|
|
42
|
+
1: string;
|
|
43
|
+
2: string;
|
|
44
|
+
3: string;
|
|
45
|
+
4: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Absolute colors - never change
|
|
49
|
+
*/
|
|
50
|
+
absolute: {
|
|
51
|
+
black: string;
|
|
52
|
+
white: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Links - standard web colors
|
|
56
|
+
* Same in both themes (chosen for universal contrast)
|
|
57
|
+
*/
|
|
58
|
+
link: {
|
|
59
|
+
/** Default link color - standard blue */
|
|
60
|
+
default: string;
|
|
61
|
+
/** Hover state */
|
|
62
|
+
hover: string;
|
|
63
|
+
/** Visited link color */
|
|
64
|
+
visited: string;
|
|
65
|
+
/** Active/pressed state */
|
|
66
|
+
active: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Semantic colors - purpose-driven feedback
|
|
70
|
+
* Theme-aware: adapts for optimal contrast
|
|
71
|
+
*/
|
|
72
|
+
semantic: {
|
|
73
|
+
success: ColorScale;
|
|
74
|
+
error: ColorScale;
|
|
75
|
+
warning: ColorScale;
|
|
76
|
+
info: ColorScale;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Secondary colors - for categories and data visualization
|
|
80
|
+
* Main color works in both themes, subtle backgrounds adapt
|
|
81
|
+
*/
|
|
82
|
+
secondary: {
|
|
83
|
+
blue: ColorScale;
|
|
84
|
+
purple: ColorScale;
|
|
85
|
+
pink: ColorScale;
|
|
86
|
+
amber: ColorScale;
|
|
87
|
+
emerald: ColorScale;
|
|
88
|
+
orange: ColorScale;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Surface hierarchy - derived from neutral scale
|
|
92
|
+
* Convenience tokens for common surfaces
|
|
93
|
+
*/
|
|
94
|
+
surface: {
|
|
95
|
+
/** Main page background */
|
|
96
|
+
page: string;
|
|
97
|
+
/** Cards, panels, elevated content */
|
|
98
|
+
card: string;
|
|
99
|
+
/** Modals, popovers, dropdowns */
|
|
100
|
+
overlay: string;
|
|
101
|
+
/** Hover state for interactive surfaces */
|
|
102
|
+
interactive: string;
|
|
103
|
+
/** Selected state backgrounds */
|
|
104
|
+
selected: string;
|
|
105
|
+
/** Nested/subtle backgrounds */
|
|
106
|
+
nested: string;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Border colors - derived from neutral scale
|
|
110
|
+
*/
|
|
111
|
+
border: {
|
|
112
|
+
/** Subtle borders - dividers, separators */
|
|
113
|
+
subtle: string;
|
|
114
|
+
/** Default borders - form inputs, cards */
|
|
115
|
+
default: string;
|
|
116
|
+
/** Strong borders - emphasis, focus alternative */
|
|
117
|
+
strong: string;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Text colors - derived from neutral scale
|
|
121
|
+
*/
|
|
122
|
+
text: {
|
|
123
|
+
/** Primary text - headlines, body copy */
|
|
124
|
+
primary: string;
|
|
125
|
+
/** Secondary text - labels, supporting info */
|
|
126
|
+
secondary: string;
|
|
127
|
+
/** Tertiary text - captions, helper text */
|
|
128
|
+
tertiary: string;
|
|
129
|
+
/** Disabled state */
|
|
130
|
+
disabled: string;
|
|
131
|
+
/** Text on dark backgrounds */
|
|
132
|
+
inverse: string;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Build color palette for given theme mode
|
|
137
|
+
*/
|
|
138
|
+
export declare const buildColorPalette: (mode?: ThemeMode) => ColorPalette;
|
|
139
|
+
/**
|
|
140
|
+
* Default light mode palette
|
|
141
|
+
*/
|
|
142
|
+
export declare const lightPalette: ColorPalette;
|
|
143
|
+
/**
|
|
144
|
+
* Default dark mode palette
|
|
145
|
+
*/
|
|
146
|
+
export declare const darkPalette: ColorPalette;
|
|
147
|
+
/**
|
|
148
|
+
* Color palette overrides (for custom theming)
|
|
149
|
+
* Allows partial overrides while maintaining type safety
|
|
150
|
+
*/
|
|
151
|
+
export type ColorOverrides = {
|
|
152
|
+
neutral?: Partial<ColorPalette['neutral']>;
|
|
153
|
+
link?: Partial<ColorPalette['link']>;
|
|
154
|
+
semantic?: {
|
|
155
|
+
success?: Partial<ColorScale>;
|
|
156
|
+
error?: Partial<ColorScale>;
|
|
157
|
+
warning?: Partial<ColorScale>;
|
|
158
|
+
info?: Partial<ColorScale>;
|
|
159
|
+
};
|
|
160
|
+
secondary?: {
|
|
161
|
+
blue?: Partial<ColorScale>;
|
|
162
|
+
purple?: Partial<ColorScale>;
|
|
163
|
+
pink?: Partial<ColorScale>;
|
|
164
|
+
amber?: Partial<ColorScale>;
|
|
165
|
+
emerald?: Partial<ColorScale>;
|
|
166
|
+
orange?: Partial<ColorScale>;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tembo Design System - Color Tokens
|
|
3
|
+
*
|
|
4
|
+
* Monochrome-first design system with purposeful color usage.
|
|
5
|
+
*
|
|
6
|
+
* Philosophy:
|
|
7
|
+
* - Monochrome foundation (4 neutral tones)
|
|
8
|
+
* - Color used purposefully (semantic feedback, categories, data viz)
|
|
9
|
+
* - Standard blue for links (web conventions)
|
|
10
|
+
* - Theme-aware: entire system adapts to light/dark mode
|
|
11
|
+
*
|
|
12
|
+
* Inspired by: Wise, Linear, Apple HIG
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Build light mode colors
|
|
16
|
+
*/
|
|
17
|
+
const buildLightModeColors = () => ({
|
|
18
|
+
mode: 'light',
|
|
19
|
+
neutral: {
|
|
20
|
+
1: '#FFFFFF', // Pure white - cards, inputs
|
|
21
|
+
2: '#F7F8F9', // Light gray - page backgrounds, hover
|
|
22
|
+
3: '#E1E4E8', // Medium gray - borders
|
|
23
|
+
4: '#2E3338', // Dark gray - text, primary elements
|
|
24
|
+
},
|
|
25
|
+
absolute: {
|
|
26
|
+
black: '#000000',
|
|
27
|
+
white: '#FFFFFF',
|
|
28
|
+
},
|
|
29
|
+
link: {
|
|
30
|
+
default: '#2563EB', // Standard web blue
|
|
31
|
+
hover: '#1D4ED8', // Darker blue
|
|
32
|
+
visited: '#7C3AED', // Purple (standard)
|
|
33
|
+
active: '#1E40AF', // Even darker blue
|
|
34
|
+
},
|
|
35
|
+
semantic: {
|
|
36
|
+
success: {
|
|
37
|
+
main: '#059669', // Dark green (readable on white)
|
|
38
|
+
subtle: '#ECFDF5', // Very light green
|
|
39
|
+
contrast: '#FFFFFF', // White text on main
|
|
40
|
+
},
|
|
41
|
+
error: {
|
|
42
|
+
main: '#DC2626', // Dark red
|
|
43
|
+
subtle: '#FEF2F2', // Very light red
|
|
44
|
+
contrast: '#FFFFFF',
|
|
45
|
+
},
|
|
46
|
+
warning: {
|
|
47
|
+
main: '#D97706', // Dark amber
|
|
48
|
+
subtle: '#FFFBEB', // Very light yellow
|
|
49
|
+
contrast: '#FFFFFF',
|
|
50
|
+
},
|
|
51
|
+
info: {
|
|
52
|
+
main: '#2563EB', // Blue (matches link color)
|
|
53
|
+
subtle: '#EFF6FF', // Very light blue
|
|
54
|
+
contrast: '#FFFFFF',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
secondary: {
|
|
58
|
+
blue: {
|
|
59
|
+
main: '#3B82F6', // Bright blue
|
|
60
|
+
subtle: '#EFF6FF',
|
|
61
|
+
contrast: '#FFFFFF',
|
|
62
|
+
},
|
|
63
|
+
purple: {
|
|
64
|
+
main: '#A855F7', // Bright purple
|
|
65
|
+
subtle: '#FAF5FF',
|
|
66
|
+
contrast: '#FFFFFF',
|
|
67
|
+
},
|
|
68
|
+
pink: {
|
|
69
|
+
main: '#EC4899', // Bright pink
|
|
70
|
+
subtle: '#FDF2F8',
|
|
71
|
+
contrast: '#FFFFFF',
|
|
72
|
+
},
|
|
73
|
+
amber: {
|
|
74
|
+
main: '#F59E0B', // Bright amber
|
|
75
|
+
subtle: '#FFFBEB',
|
|
76
|
+
contrast: '#FFFFFF',
|
|
77
|
+
},
|
|
78
|
+
emerald: {
|
|
79
|
+
main: '#10B981', // Bright emerald
|
|
80
|
+
subtle: '#ECFDF5',
|
|
81
|
+
contrast: '#FFFFFF',
|
|
82
|
+
},
|
|
83
|
+
orange: {
|
|
84
|
+
main: '#F97316', // Bright orange
|
|
85
|
+
subtle: '#FFF7ED',
|
|
86
|
+
contrast: '#FFFFFF',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
// Derived surface tokens
|
|
90
|
+
surface: {
|
|
91
|
+
page: '#F7F8F9', // neutral[2]
|
|
92
|
+
card: '#FFFFFF', // neutral[1]
|
|
93
|
+
overlay: '#FFFFFF', // neutral[1]
|
|
94
|
+
interactive: '#F0F2F5', // Between neutral[1] and neutral[2]
|
|
95
|
+
selected: '#F7F8F9', // neutral[2]
|
|
96
|
+
nested: '#FAFBFC', // Between neutral[1] and neutral[2]
|
|
97
|
+
},
|
|
98
|
+
// Derived border tokens
|
|
99
|
+
border: {
|
|
100
|
+
subtle: '#F0F2F5', // Lighter than neutral[3]
|
|
101
|
+
default: '#E1E4E8', // neutral[3]
|
|
102
|
+
strong: '#C4CCD4', // Between neutral[3] and neutral[4]
|
|
103
|
+
},
|
|
104
|
+
// Derived text tokens
|
|
105
|
+
text: {
|
|
106
|
+
primary: '#2E3338', // neutral[4]
|
|
107
|
+
secondary: '#5E6C7A', // ~70% opacity of neutral[4]
|
|
108
|
+
tertiary: '#8A96A3', // ~50% opacity of neutral[4]
|
|
109
|
+
disabled: '#C4CCD4', // ~30% opacity of neutral[4]
|
|
110
|
+
inverse: '#FFFFFF', // neutral[1]
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Build dark mode colors
|
|
115
|
+
*/
|
|
116
|
+
const buildDarkModeColors = () => ({
|
|
117
|
+
mode: 'dark',
|
|
118
|
+
neutral: {
|
|
119
|
+
1: '#1A1D21', // Dark background
|
|
120
|
+
2: '#2E3338', // Slightly lighter
|
|
121
|
+
3: '#4A5158', // Medium gray
|
|
122
|
+
4: '#F7F8F9', // Light text
|
|
123
|
+
},
|
|
124
|
+
absolute: {
|
|
125
|
+
black: '#000000',
|
|
126
|
+
white: '#FFFFFF',
|
|
127
|
+
},
|
|
128
|
+
link: {
|
|
129
|
+
default: '#3B82F6', // Brighter blue for dark bg
|
|
130
|
+
hover: '#60A5FA', // Even brighter
|
|
131
|
+
visited: '#A78BFA', // Purple
|
|
132
|
+
active: '#2563EB', // Standard blue
|
|
133
|
+
},
|
|
134
|
+
semantic: {
|
|
135
|
+
success: {
|
|
136
|
+
main: '#34D399', // Bright green (readable on dark)
|
|
137
|
+
subtle: '#064E3B', // Dark green background
|
|
138
|
+
contrast: '#000000', // Black text on bright
|
|
139
|
+
},
|
|
140
|
+
error: {
|
|
141
|
+
main: '#F87171', // Bright red
|
|
142
|
+
subtle: '#7F1D1D', // Dark red background
|
|
143
|
+
contrast: '#000000',
|
|
144
|
+
},
|
|
145
|
+
warning: {
|
|
146
|
+
main: '#FBBF24', // Bright amber
|
|
147
|
+
subtle: '#78350F', // Dark amber background
|
|
148
|
+
contrast: '#000000',
|
|
149
|
+
},
|
|
150
|
+
info: {
|
|
151
|
+
main: '#3B82F6', // Bright blue
|
|
152
|
+
subtle: '#1E3A8A', // Dark blue background
|
|
153
|
+
contrast: '#FFFFFF',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
secondary: {
|
|
157
|
+
blue: {
|
|
158
|
+
main: '#3B82F6', // Same bright blue
|
|
159
|
+
subtle: '#1E3A8A', // Dark blue background
|
|
160
|
+
contrast: '#FFFFFF',
|
|
161
|
+
},
|
|
162
|
+
purple: {
|
|
163
|
+
main: '#A855F7', // Same bright purple
|
|
164
|
+
subtle: '#581C87', // Dark purple background
|
|
165
|
+
contrast: '#FFFFFF',
|
|
166
|
+
},
|
|
167
|
+
pink: {
|
|
168
|
+
main: '#EC4899', // Same bright pink
|
|
169
|
+
subtle: '#831843', // Dark pink background
|
|
170
|
+
contrast: '#FFFFFF',
|
|
171
|
+
},
|
|
172
|
+
amber: {
|
|
173
|
+
main: '#F59E0B', // Same bright amber
|
|
174
|
+
subtle: '#78350F', // Dark amber background
|
|
175
|
+
contrast: '#FFFFFF',
|
|
176
|
+
},
|
|
177
|
+
emerald: {
|
|
178
|
+
main: '#10B981', // Same bright emerald
|
|
179
|
+
subtle: '#064E3B', // Dark emerald background
|
|
180
|
+
contrast: '#FFFFFF',
|
|
181
|
+
},
|
|
182
|
+
orange: {
|
|
183
|
+
main: '#F97316', // Same bright orange
|
|
184
|
+
subtle: '#7C2D12', // Dark orange background
|
|
185
|
+
contrast: '#FFFFFF',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
// Derived surface tokens
|
|
189
|
+
surface: {
|
|
190
|
+
page: '#1A1D21', // neutral[1]
|
|
191
|
+
card: '#2E3338', // neutral[2]
|
|
192
|
+
overlay: '#2E3338', // neutral[2]
|
|
193
|
+
interactive: '#3A3F45', // Between neutral[2] and neutral[3]
|
|
194
|
+
selected: '#2E3338', // neutral[2]
|
|
195
|
+
nested: '#242729', // Between neutral[1] and neutral[2]
|
|
196
|
+
},
|
|
197
|
+
// Derived border tokens
|
|
198
|
+
border: {
|
|
199
|
+
subtle: '#3A3F45', // Lighter than neutral[3]
|
|
200
|
+
default: '#4A5158', // neutral[3]
|
|
201
|
+
strong: '#5E6C7A', // Between neutral[3] and neutral[4]
|
|
202
|
+
},
|
|
203
|
+
// Derived text tokens
|
|
204
|
+
text: {
|
|
205
|
+
primary: '#F7F8F9', // neutral[4]
|
|
206
|
+
secondary: '#B4BCC5', // ~75% opacity
|
|
207
|
+
tertiary: '#8A96A3', // ~55% opacity
|
|
208
|
+
disabled: '#5E6C7A', // ~35% opacity
|
|
209
|
+
inverse: '#1A1D21', // neutral[1]
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
/**
|
|
213
|
+
* Build color palette for given theme mode
|
|
214
|
+
*/
|
|
215
|
+
export const buildColorPalette = (mode = 'light') => {
|
|
216
|
+
return mode === 'light' ? buildLightModeColors() : buildDarkModeColors();
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Default light mode palette
|
|
220
|
+
*/
|
|
221
|
+
export const lightPalette = buildLightModeColors();
|
|
222
|
+
/**
|
|
223
|
+
* Default dark mode palette
|
|
224
|
+
*/
|
|
225
|
+
export const darkPalette = buildDarkModeColors();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Border radius system
|
|
3
|
+
* Consistent 8px base (Wise standard)
|
|
4
|
+
*/
|
|
5
|
+
export interface RadiusScale {
|
|
6
|
+
none: number;
|
|
7
|
+
sm: number;
|
|
8
|
+
base: number;
|
|
9
|
+
md: number;
|
|
10
|
+
lg: number;
|
|
11
|
+
xl: number;
|
|
12
|
+
full: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const radius: RadiusScale;
|
|
15
|
+
/**
|
|
16
|
+
* Component-specific radius
|
|
17
|
+
*/
|
|
18
|
+
export interface ComponentRadius {
|
|
19
|
+
button: number;
|
|
20
|
+
input: number;
|
|
21
|
+
card: number;
|
|
22
|
+
modal: number;
|
|
23
|
+
avatar: number;
|
|
24
|
+
badge: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const componentRadius: ComponentRadius;
|