@temboplus/frontend-react-core 0.1.3-beta.0 → 0.1.3-beta.2

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 (86) hide show
  1. package/dist/InfoCircleOutlined-B7d2aRfV.js +7 -0
  2. package/dist/InfoCircleOutlined-B7d2aRfV.js.map +1 -0
  3. package/dist/InfoCircleOutlined-DYs90hdV.js +7 -0
  4. package/dist/InfoCircleOutlined-DYs90hdV.js.map +1 -0
  5. package/dist/ZoomOutOutlined-BL6A5RSq.js +2 -0
  6. package/dist/ZoomOutOutlined-BL6A5RSq.js.map +1 -0
  7. package/dist/ZoomOutOutlined-BY_CCwq7.js +2 -0
  8. package/dist/ZoomOutOutlined-BY_CCwq7.js.map +1 -0
  9. package/dist/alerts/index.cjs.js +2 -0
  10. package/dist/alerts/index.cjs.js.map +1 -0
  11. package/dist/alerts/index.d.ts +1 -0
  12. package/dist/alerts/index.js +2 -0
  13. package/dist/alerts/index.js.map +1 -0
  14. package/dist/dialogs/index.cjs.js +2 -0
  15. package/dist/dialogs/index.cjs.js.map +1 -0
  16. package/dist/dialogs/index.d.ts +1 -0
  17. package/dist/dialogs/index.js +2 -0
  18. package/dist/dialogs/index.js.map +1 -0
  19. package/dist/features/alerts/alert.d.ts +12 -0
  20. package/dist/features/alerts/alert.js +95 -0
  21. package/dist/features/alerts/index.d.ts +1 -0
  22. package/dist/features/alerts/index.js +1 -0
  23. package/dist/features/dialogs/index.d.ts +1 -0
  24. package/dist/features/dialogs/index.js +1 -0
  25. package/dist/features/dialogs/modal-provider.d.ts +3 -0
  26. package/dist/features/dialogs/modal-provider.js +6 -0
  27. package/dist/features/dialogs/tembo-confirm.d.ts +63 -0
  28. package/dist/features/dialogs/tembo-confirm.js +111 -0
  29. package/dist/features/input-validation/account-name-validator.d.ts +13 -0
  30. package/dist/features/input-validation/account-name-validator.js +28 -0
  31. package/dist/features/input-validation/account-number-validator.d.ts +13 -0
  32. package/dist/features/input-validation/account-number-validator.js +65 -0
  33. package/dist/{antd-validators.d.ts → features/input-validation/amount-validator.d.ts} +1 -62
  34. package/dist/features/input-validation/amount-validator.js +100 -0
  35. package/dist/features/input-validation/index.d.ts +5 -0
  36. package/dist/features/input-validation/index.js +5 -0
  37. package/dist/features/input-validation/phone-number-validator.d.ts +25 -0
  38. package/dist/features/input-validation/phone-number-validator.js +79 -0
  39. package/dist/features/input-validation/swift-code-validator.d.ts +13 -0
  40. package/dist/features/input-validation/swift-code-validator.js +38 -0
  41. package/dist/features/notifications/index.d.ts +3 -0
  42. package/dist/features/notifications/index.js +3 -0
  43. package/dist/features/notifications/tembo-notify.d.ts +124 -0
  44. package/dist/features/notifications/tembo-notify.js +149 -0
  45. package/dist/features/notifications/toast-config.d.ts +15 -0
  46. package/dist/features/notifications/toast-config.js +53 -0
  47. package/dist/features/notifications/toast-container.d.ts +9 -0
  48. package/dist/features/notifications/toast-container.js +18 -0
  49. package/dist/index.cjs.js +1 -1
  50. package/dist/index.cjs.js.map +1 -1
  51. package/dist/index.d.ts +1 -1
  52. package/dist/index.esm.js +1 -1
  53. package/dist/index.esm.js.map +1 -1
  54. package/dist/index.js +1 -0
  55. package/dist/notifications/index.cjs.js +2 -0
  56. package/dist/notifications/index.cjs.js.map +1 -0
  57. package/dist/notifications/index.d.ts +1 -0
  58. package/dist/notifications/index.js +2 -0
  59. package/dist/notifications/index.js.map +1 -0
  60. package/dist/providers.d.ts +37 -0
  61. package/dist/providers.js +32 -0
  62. package/dist/tembo-notify-C-QGduBt.js +2 -0
  63. package/dist/tembo-notify-C-QGduBt.js.map +1 -0
  64. package/dist/tembo-notify-D-uOV3t0.js +2 -0
  65. package/dist/tembo-notify-D-uOV3t0.js.map +1 -0
  66. package/dist/theme/colors.d.ts +246 -0
  67. package/dist/theme/colors.js +138 -0
  68. package/dist/theme/constants.d.ts +143 -0
  69. package/dist/theme/constants.js +82 -0
  70. package/dist/theme/index.cjs.js +2 -0
  71. package/dist/theme/index.cjs.js.map +1 -0
  72. package/dist/theme/index.d.ts +3 -0
  73. package/dist/theme/index.js +2 -0
  74. package/dist/theme/index.js.map +1 -0
  75. package/dist/theme/theme-provider.d.ts +87 -0
  76. package/dist/theme/theme-provider.js +398 -0
  77. package/dist/theme-provider-D_oV1J_K.js +11 -0
  78. package/dist/theme-provider-D_oV1J_K.js.map +1 -0
  79. package/dist/theme-provider-Dqvy24OD.js +11 -0
  80. package/dist/theme-provider-Dqvy24OD.js.map +1 -0
  81. package/dist/validation/index.cjs.js +2 -0
  82. package/dist/validation/index.cjs.js.map +1 -0
  83. package/dist/validation/index.d.ts +1 -0
  84. package/dist/validation/index.js +2 -0
  85. package/dist/validation/index.js.map +1 -0
  86. package/package.json +31 -7
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Tembo UI Constants
3
+ *
4
+ * Non-color design tokens for typography, spacing, sizing, shadows, and animations.
5
+ * Separated from colors for better organization and independent theming.
6
+ *
7
+ * @example
8
+ * const { constants } = useTemboTheme();
9
+ * style={{ borderRadius: constants.radius.base, padding: constants.spacing.md }}
10
+ */
11
+ export interface TemboUIConstants {
12
+ /**
13
+ * Typography tokens
14
+ * Font families, sizes, weights, and line heights
15
+ */
16
+ typography: {
17
+ /** Primary font stack used throughout the application */
18
+ fontFamily: string;
19
+ /** Font size scale - use 'base' (14px) for body text */
20
+ fontSize: {
21
+ xs: number;
22
+ sm: number;
23
+ /** Default body text size (14px) */
24
+ base: number;
25
+ lg: number;
26
+ xl: number;
27
+ };
28
+ fontWeight: {
29
+ normal: number;
30
+ medium: number;
31
+ semibold: number;
32
+ bold: number;
33
+ };
34
+ lineHeight: {
35
+ /** Tight line height for headings */
36
+ tight: number;
37
+ /** Default line height for body text */
38
+ base: number;
39
+ /** Relaxed line height for large text blocks */
40
+ relaxed: number;
41
+ };
42
+ };
43
+ /**
44
+ * Spacing scale
45
+ * Consistent spacing values for margins, padding, and gaps
46
+ * Based on 4px grid system
47
+ */
48
+ spacing: {
49
+ xs: number;
50
+ sm: number;
51
+ md: number;
52
+ lg: number;
53
+ xl: number;
54
+ '2xl': number;
55
+ '3xl': number;
56
+ };
57
+ /**
58
+ * Border radius tokens
59
+ * Consistent corner rounding across components
60
+ */
61
+ radius: {
62
+ none: number;
63
+ sm: number;
64
+ /** Default border radius (12px) */
65
+ base: number;
66
+ md: number;
67
+ lg: number;
68
+ xl: number;
69
+ /** Fully rounded (pill shape) */
70
+ full: number;
71
+ /** Button-specific radius for pill-shaped buttons */
72
+ button: number;
73
+ /** Input field radius */
74
+ input: number;
75
+ /** Card radius */
76
+ card: number;
77
+ };
78
+ /**
79
+ * Box shadow tokens
80
+ * Elevation and depth through shadows
81
+ */
82
+ shadow: {
83
+ /** Subtle shadow for slight elevation */
84
+ sm: string;
85
+ /** Default shadow for cards and containers */
86
+ base: string;
87
+ /** Medium shadow for elevated content */
88
+ md: string;
89
+ /** Large shadow for modals and important elements */
90
+ lg: string;
91
+ /** Extra large shadow for maximum elevation */
92
+ xl: string;
93
+ /** Semantic: Card shadow (typically subtle) */
94
+ card: string;
95
+ /** Semantic: Elevated content like popovers */
96
+ elevated: string;
97
+ /** Semantic: Dropdown menus */
98
+ dropdown: string;
99
+ };
100
+ /**
101
+ * Z-index layers
102
+ * Stacking order for overlays and floating elements
103
+ */
104
+ zIndex: {
105
+ dropdown: number;
106
+ modal: number;
107
+ popover: number;
108
+ tooltip: number;
109
+ notification: number;
110
+ };
111
+ /**
112
+ * Transition timing
113
+ * Animation durations for consistent motion
114
+ */
115
+ transition: {
116
+ /** Quick interactions (150ms) */
117
+ fast: string;
118
+ /** Default transitions (200ms) */
119
+ base: string;
120
+ /** Slower, more deliberate animations (300ms) */
121
+ slow: string;
122
+ };
123
+ }
124
+ /**
125
+ * Partial UI constants overrides
126
+ */
127
+ export type TemboUIConstantsOverrides = DeepPartial<TemboUIConstants>;
128
+ /**
129
+ * Default UI constants
130
+ * Professional, accessible defaults suitable for most applications
131
+ */
132
+ export declare const defaultUIConstants: TemboUIConstants;
133
+ /**
134
+ * Build complete UI constants by merging overrides with defaults
135
+ *
136
+ * @param overrides - Partial UI constants overrides
137
+ * @returns Complete UI constants with overrides applied
138
+ */
139
+ export declare const buildUIConstants: (overrides?: TemboUIConstantsOverrides) => TemboUIConstants;
140
+ type DeepPartial<T> = {
141
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
142
+ };
143
+ export {};
@@ -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
+ };
@@ -0,0 +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;
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from "./colors.js";
2
+ export * from "./constants.js";
3
+ export * from "./theme-provider.js";
@@ -0,0 +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";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,87 @@
1
+ import React from 'react';
2
+ import type { ThemeConfig } from 'antd';
3
+ import { TemboColorPalette, TemboColorOverrides } from './colors.js';
4
+ import { TemboUIConstants, TemboUIConstantsOverrides } from './constants.js';
5
+ /**
6
+ * Shape of the theme context exposed via useTemboTheme()
7
+ */
8
+ export interface TemboThemeContextValue {
9
+ colors: TemboColorPalette;
10
+ constants: TemboUIConstants;
11
+ }
12
+ /**
13
+ * Props for TemboThemeProvider
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>
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.
60
+ *
61
+ * All child components can access theme values via the useTemboTheme() hook.
62
+ */
63
+ export declare const TemboThemeProvider: React.FC<TemboThemeProviderProps>;
64
+ /**
65
+ * Hook to access the active Tembo theme
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
+ * }
86
+ */
87
+ export declare const useTemboTheme: () => TemboThemeContextValue;