@acuteinfo/common-base 1.2.84 → 1.2.86

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 (52) hide show
  1. package/dist/components/common/arrayField/style.d.ts +1 -1
  2. package/dist/components/common/universal-color-picker/UniversalColorPicker.d.ts +4 -0
  3. package/dist/components/common/universal-color-picker/UniversalColorPicker.types.d.ts +8 -0
  4. package/dist/components/common/universal-color-picker/hooks/useLocalPickerState.d.ts +4 -0
  5. package/dist/components/common/universal-color-picker/index.d.ts +3 -0
  6. package/dist/components/dataTable/columnVisibility.d.ts +1 -2
  7. package/dist/components/dataTable/styledComponents/slider.d.ts +1 -1
  8. package/dist/components/dataTable/tableFilterComponent.d.ts +1 -2
  9. package/dist/components/derived/index.d.ts +1 -0
  10. package/dist/components/derived/refreshIconButton/index.d.ts +2 -0
  11. package/dist/components/derived/refreshIconButton/refreshIconButton.d.ts +9 -0
  12. package/dist/components/styledComponent/button/button.d.ts +1 -0
  13. package/dist/components/styledComponent/input/input.d.ts +1 -1
  14. package/dist/components/styledComponent/inputLabel/inputLabel.d.ts +1 -1
  15. package/dist/components/styledComponent/tab/tab.d.ts +1 -1
  16. package/dist/components/styledComponent/tabs/tabs.d.ts +1 -1
  17. package/dist/components/styledComponent/textfield/textField.d.ts +1 -3
  18. package/dist/components/styledComponent/tooltip/htmlTooltip.d.ts +1 -1
  19. package/dist/components/styledComponent/tooltip/tooltip.d.ts +1 -1
  20. package/dist/index.d.ts +2 -0
  21. package/dist/index.js +15 -15
  22. package/dist/index.js.map +1 -1
  23. package/dist/theme/components/ThemeToggleButton.d.ts +9 -0
  24. package/dist/theme/examples/ThemeUsageExample.d.ts +3 -0
  25. package/dist/theme/generateTheme/buildPalette.d.ts +137 -0
  26. package/dist/theme/generateTheme/componentOverrides/appBar.d.ts +14 -0
  27. package/dist/theme/generateTheme/componentOverrides/button.d.ts +4 -0
  28. package/dist/theme/generateTheme/componentOverrides/cssBaseline.d.ts +10 -0
  29. package/dist/theme/generateTheme/componentOverrides/index.d.ts +4 -0
  30. package/dist/theme/generateTheme/componentOverrides/input.d.ts +3 -0
  31. package/dist/theme/generateTheme/componentOverrides/navigation.d.ts +3 -0
  32. package/dist/theme/generateTheme/componentOverrides/surfaces.d.ts +4 -0
  33. package/dist/theme/generateTheme/componentOverrides/tabs.d.ts +3 -0
  34. package/dist/theme/generateTheme/index.d.ts +8 -0
  35. package/dist/theme/generateTheme/resolveColors.d.ts +30 -0
  36. package/dist/theme/generateTheme/types.d.ts +18 -0
  37. package/dist/theme/generators/borderGenerator.d.ts +13 -0
  38. package/dist/theme/generators/gradientGenerator.d.ts +14 -0
  39. package/dist/theme/generators/neutralPaletteGenerator.d.ts +12 -0
  40. package/dist/theme/generators/radiusGenerator.d.ts +12 -0
  41. package/dist/theme/generators/semanticGenerator.d.ts +22 -0
  42. package/dist/theme/generators/shadowGenerator.d.ts +19 -0
  43. package/dist/theme/generators/spacingGenerator.d.ts +23 -0
  44. package/dist/theme/index.d.ts +17 -0
  45. package/dist/theme/legacy/syncLegacyVars.d.ts +2 -0
  46. package/dist/theme/presets/presets.d.ts +10 -0
  47. package/dist/theme/providers/BaseThemeProvider.d.ts +18 -0
  48. package/dist/theme/types/ThemeConfig.d.ts +12 -0
  49. package/dist/theme/types/themeExtensions.d.ts +227 -0
  50. package/dist/theme/utils/accessibility.d.ts +49 -0
  51. package/dist/theme/utils/colorUtils.d.ts +70 -0
  52. package/package.json +2 -2
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { IconButtonProps } from "@mui/material/IconButton";
3
+ export interface ThemeToggleButtonProps extends Omit<IconButtonProps, "onClick"> {
4
+ tooltipTitle?: string;
5
+ }
6
+ /**
7
+ * MUI IconButton component demonstrating light/dark color mode toggling.
8
+ */
9
+ export declare const ThemeToggleButton: React.FC<ThemeToggleButtonProps>;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ export declare const ThemeUsageExample: React.FC;
3
+ export default ThemeUsageExample;
@@ -0,0 +1,137 @@
1
+ import { ResolvedColors } from "./resolveColors";
2
+ import { GeneratedTokens } from "./types";
3
+ export declare const buildPalette: (colors: ResolvedColors, tokens: GeneratedTokens) => {
4
+ mode: "dark" | "light";
5
+ primary: {
6
+ lighter: string;
7
+ light: string;
8
+ main: string;
9
+ dark: string;
10
+ darker: string;
11
+ contrastText: string;
12
+ };
13
+ secondary: {
14
+ lighter: string;
15
+ light: string;
16
+ main: string;
17
+ dark: string;
18
+ darker: string;
19
+ contrastText: string;
20
+ };
21
+ background: {
22
+ default: string;
23
+ paper: string;
24
+ };
25
+ error: {
26
+ lighter: string;
27
+ light: string;
28
+ main: string;
29
+ dark: string;
30
+ darker: string;
31
+ contrastText: string;
32
+ };
33
+ warning: {
34
+ lighter: string;
35
+ light: string;
36
+ main: string;
37
+ dark: string;
38
+ darker: string;
39
+ contrastText: string;
40
+ };
41
+ info: {
42
+ lighter: string;
43
+ light: string;
44
+ main: string;
45
+ dark: string;
46
+ darker: string;
47
+ contrastText: string;
48
+ };
49
+ success: {
50
+ lighter: string;
51
+ light: string;
52
+ main: string;
53
+ dark: string;
54
+ darker: string;
55
+ contrastText: string;
56
+ };
57
+ text: {
58
+ primary: string;
59
+ secondary: string;
60
+ disabled: string;
61
+ };
62
+ divider: string;
63
+ action: {
64
+ hover: string;
65
+ selected: string;
66
+ focus: string;
67
+ disabled: string;
68
+ disabledBackground: string;
69
+ };
70
+ surface: {
71
+ page: string;
72
+ card: string;
73
+ elevated: string;
74
+ sidebar: string;
75
+ header: string;
76
+ footer: string;
77
+ input: string;
78
+ tabs: string;
79
+ };
80
+ border: import("..").ThemeBorderTokens;
81
+ state: {
82
+ hover: string;
83
+ selected: string;
84
+ focus: string;
85
+ pressed: string;
86
+ };
87
+ greyPalette: {
88
+ 50: string;
89
+ 100: string;
90
+ 200: string;
91
+ 300: string;
92
+ 400: string;
93
+ 500: string;
94
+ 600: string;
95
+ 700: string;
96
+ 800: string;
97
+ 900: string;
98
+ };
99
+ shadow: {
100
+ input: string;
101
+ card: string;
102
+ popover: string;
103
+ dialog: string;
104
+ paper: string;
105
+ alert: string;
106
+ default: string;
107
+ tooltip: string;
108
+ button: string;
109
+ table: string;
110
+ form: string;
111
+ box: string;
112
+ grid: string;
113
+ stack: string;
114
+ container: string;
115
+ stepper: string;
116
+ tabs: string;
117
+ };
118
+ radius: {
119
+ xs: string;
120
+ sm: string;
121
+ md: string;
122
+ lg: string;
123
+ xl: string;
124
+ pill: string;
125
+ dialog: string;
126
+ card: string;
127
+ button: string;
128
+ input: string;
129
+ };
130
+ gradient: import("..").ThemeGradients;
131
+ space: import("..").ThemeSpacingTokens;
132
+ transition: {
133
+ fast: string;
134
+ normal: string;
135
+ slow: string;
136
+ };
137
+ };
@@ -0,0 +1,14 @@
1
+ import { ThemeOptions } from "@mui/material/styles";
2
+ import { ResolvedColors } from "../resolveColors";
3
+ import { GeneratedTokens } from "../types";
4
+ /**
5
+ * AppBar overrides.
6
+ *
7
+ * Default background: `gradient.primaryToSecondary` (brand gradient).
8
+ * Text color: Dynamically computed `appBarTextColor` (WCAG-safe contrast against the gradient).
9
+ * Consumers can override via `sx={{ background }}` or `sx={{ color }}` props.
10
+ *
11
+ * `backgroundImage: "none"` is NOT set here because the AppBar intentionally
12
+ * uses a gradient as its background-image.
13
+ */
14
+ export declare const getAppBarOverrides: (colors: ResolvedColors, tokens: GeneratedTokens) => ThemeOptions["components"];
@@ -0,0 +1,4 @@
1
+ import { ThemeOptions } from "@mui/material/styles";
2
+ import { ResolvedColors } from "../resolveColors";
3
+ import { GeneratedTokens } from "../types";
4
+ export declare const getButtonOverrides: (colors: ResolvedColors, tokens: GeneratedTokens) => ThemeOptions["components"];
@@ -0,0 +1,10 @@
1
+ import { ThemeOptions } from "@mui/material/styles";
2
+ import { GeneratedTokens } from "../types";
3
+ /**
4
+ * MuiCssBaseline override.
5
+ *
6
+ * Note: MUI's <CssBaseline /> automatically applies palette.background.default
7
+ * to the <body> background and palette.text.primary to root text nodes.
8
+ * This override only adds the smooth transition for theme switching.
9
+ */
10
+ export declare const getCssBaselineOverrides: (tokens: GeneratedTokens) => ThemeOptions["components"];
@@ -0,0 +1,4 @@
1
+ import { ThemeOptions } from "@mui/material/styles";
2
+ import { ResolvedColors } from "../resolveColors";
3
+ import { GeneratedTokens } from "../types";
4
+ export declare const buildComponentOverrides: (colors: ResolvedColors, tokens: GeneratedTokens) => ThemeOptions["components"];
@@ -0,0 +1,3 @@
1
+ import { ThemeOptions } from "@mui/material/styles";
2
+ import { GeneratedTokens } from "../types";
3
+ export declare const getInputOverrides: (tokens: GeneratedTokens) => ThemeOptions["components"];
@@ -0,0 +1,3 @@
1
+ import { ThemeOptions } from "@mui/material/styles";
2
+ import { GeneratedTokens } from "../types";
3
+ export declare const getNavigationOverrides: (tokens: GeneratedTokens) => ThemeOptions["components"];
@@ -0,0 +1,4 @@
1
+ import { ThemeOptions } from "@mui/material/styles";
2
+ import { ResolvedColors } from "../resolveColors";
3
+ import { GeneratedTokens } from "../types";
4
+ export declare const getSurfaceOverrides: (colors: ResolvedColors, tokens: GeneratedTokens) => ThemeOptions["components"];
@@ -0,0 +1,3 @@
1
+ import { ThemeOptions } from "@mui/material/styles";
2
+ import { GeneratedTokens } from "../types";
3
+ export declare const getTabsOverrides: (tokens: GeneratedTokens) => ThemeOptions["components"];
@@ -0,0 +1,8 @@
1
+ import { ThemeOptions } from "@mui/material/styles";
2
+ import { ThemeConfig } from "../types/ThemeConfig";
3
+ export { resolveColors } from "./resolveColors";
4
+ export type { ResolvedColors } from "./resolveColors";
5
+ export { buildPalette } from "./buildPalette";
6
+ export { buildComponentOverrides } from "./componentOverrides";
7
+ export type { GeneratedTokens } from "./types";
8
+ export declare const generateTheme: (config: ThemeConfig, skipSyncVars?: boolean) => ThemeOptions;
@@ -0,0 +1,30 @@
1
+ import { ThemeConfig } from "../types/ThemeConfig";
2
+ export interface ResolvedColors {
3
+ mode: "light" | "dark";
4
+ isDark: boolean;
5
+ /** Raw validated user hex — preserved for gradients, borders, legacy sync */
6
+ baseColor: string;
7
+ /** Raw validated user secondary hex */
8
+ secondaryColor: string;
9
+ /** Mode-adapted primary for palette.primary.main */
10
+ adaptedPrimary: string;
11
+ /** Mode-adapted secondary for palette.secondary.main */
12
+ adaptedSecondary: string;
13
+ /** Mode-adapted status colors */
14
+ adaptedSuccess: string;
15
+ adaptedError: string;
16
+ adaptedWarning: string;
17
+ adaptedInfo: string;
18
+ /** Raw validated status colors */
19
+ successColor: string;
20
+ errorColor: string;
21
+ warningColor: string;
22
+ infoColor: string;
23
+ /** Resolved background/paper/text */
24
+ resolvedBg: string;
25
+ resolvedText: string;
26
+ resolvedPaper: string;
27
+ defaultTextSecondary: string;
28
+ rawText?: string;
29
+ }
30
+ export declare const resolveColors: (config: ThemeConfig) => ResolvedColors;
@@ -0,0 +1,18 @@
1
+ import { generateNeutralPalette } from "../generators/neutralPaletteGenerator";
2
+ import { generateSurfaces, generateBorders, generateStates, generateTransitions } from "../generators/semanticGenerator";
3
+ import { generateShadows } from "../generators/shadowGenerator";
4
+ import { generateRadius } from "../generators/radiusGenerator";
5
+ import { generateGradients } from "../generators/gradientGenerator";
6
+ import { generateSpacing } from "../generators/spacingGenerator";
7
+ export interface GeneratedTokens {
8
+ greyPalette: ReturnType<typeof generateNeutralPalette>;
9
+ surface: ReturnType<typeof generateSurfaces>;
10
+ border: ReturnType<typeof generateBorders>;
11
+ state: ReturnType<typeof generateStates>;
12
+ shadow: ReturnType<typeof generateShadows>;
13
+ radius: ReturnType<typeof generateRadius>;
14
+ gradient: ReturnType<typeof generateGradients>;
15
+ space: ReturnType<typeof generateSpacing>;
16
+ transition: ReturnType<typeof generateTransitions>;
17
+ appBarTextColor: string;
18
+ }
@@ -0,0 +1,13 @@
1
+ export interface ThemeBorderTokens {
2
+ subtle: string;
3
+ default: string;
4
+ strong: string;
5
+ primary: string;
6
+ secondary: string;
7
+ disabled: string;
8
+ error: string;
9
+ success: string;
10
+ warning: string;
11
+ info: string;
12
+ }
13
+ export declare const generateBorders: (greyPalette: Record<number, string>, isDark: boolean, primaryColor?: string, secondaryColor?: string, errorColor?: string, successColor?: string, warningColor?: string, infoColor?: string) => ThemeBorderTokens;
@@ -0,0 +1,14 @@
1
+ export interface ThemeGradients {
2
+ primary: string;
3
+ secondary: string;
4
+ primaryToSecondary: string;
5
+ subtle: string;
6
+ glow: string;
7
+ button: string;
8
+ buttonHover: string;
9
+ success: string;
10
+ error: string;
11
+ warning: string;
12
+ info: string;
13
+ }
14
+ export declare const generateGradients: (primaryHex: string, secondaryHex: string, isDark: boolean, successHex?: string, errorHex?: string, warningHex?: string, infoHex?: string) => ThemeGradients;
@@ -0,0 +1,12 @@
1
+ export declare const generateNeutralPalette: (baseBg: string, isDark: boolean) => {
2
+ 50: string;
3
+ 100: string;
4
+ 200: string;
5
+ 300: string;
6
+ 400: string;
7
+ 500: string;
8
+ 600: string;
9
+ 700: string;
10
+ 800: string;
11
+ 900: string;
12
+ };
@@ -0,0 +1,12 @@
1
+ export declare const generateRadius: () => {
2
+ xs: string;
3
+ sm: string;
4
+ md: string;
5
+ lg: string;
6
+ xl: string;
7
+ pill: string;
8
+ dialog: string;
9
+ card: string;
10
+ button: string;
11
+ input: string;
12
+ };
@@ -0,0 +1,22 @@
1
+ export declare const generateSurfaces: (resolvedBg: string, resolvedPaper: string, isDark: boolean) => {
2
+ page: string;
3
+ card: string;
4
+ elevated: string;
5
+ sidebar: string;
6
+ header: string;
7
+ footer: string;
8
+ input: string;
9
+ tabs: string;
10
+ };
11
+ export { generateBorders } from "./borderGenerator";
12
+ export declare const generateStates: (isDark: boolean) => {
13
+ hover: string;
14
+ selected: string;
15
+ focus: string;
16
+ pressed: string;
17
+ };
18
+ export declare const generateTransitions: () => {
19
+ fast: string;
20
+ normal: string;
21
+ slow: string;
22
+ };
@@ -0,0 +1,19 @@
1
+ export declare const generateShadows: (isDark: boolean) => {
2
+ input: string;
3
+ card: string;
4
+ popover: string;
5
+ dialog: string;
6
+ paper: string;
7
+ alert: string;
8
+ default: string;
9
+ tooltip: string;
10
+ button: string;
11
+ table: string;
12
+ form: string;
13
+ box: string;
14
+ grid: string;
15
+ stack: string;
16
+ container: string;
17
+ stepper: string;
18
+ tabs: string;
19
+ };
@@ -0,0 +1,23 @@
1
+ export interface ThemeSpacingTokens {
2
+ none: string;
3
+ hairline: string;
4
+ xxs: string;
5
+ xs: string;
6
+ sm: string;
7
+ md: string;
8
+ lg: string;
9
+ xl: string;
10
+ xxl: string;
11
+ xxxl: string;
12
+ huge: string;
13
+ appbar: string;
14
+ card: string;
15
+ container: string;
16
+ section: string;
17
+ compact: string;
18
+ relaxed: string;
19
+ gridDensity: string;
20
+ cellPaddingHorizontal: string;
21
+ resizerWidth: string;
22
+ }
23
+ export declare const generateSpacing: () => ThemeSpacingTokens;
@@ -0,0 +1,17 @@
1
+ export * from "./types/ThemeConfig";
2
+ export * from "./types/themeExtensions";
3
+ export * from "./utils/colorUtils";
4
+ export * from "./utils/accessibility";
5
+ export * from "./generators/neutralPaletteGenerator";
6
+ export * from "./generators/semanticGenerator";
7
+ export * from "./generators/shadowGenerator";
8
+ export * from "./generators/radiusGenerator";
9
+ export * from "./generators/gradientGenerator";
10
+ export * from "./generators/spacingGenerator";
11
+ export * from "./generators/borderGenerator";
12
+ export * from "./generateTheme";
13
+ export * from "./presets/presets";
14
+ export * from "./legacy/syncLegacyVars";
15
+ export * from "./providers/BaseThemeProvider";
16
+ export * from "./components/ThemeToggleButton";
17
+ export * from "./examples/ThemeUsageExample";
@@ -0,0 +1,2 @@
1
+ import { PaletteMode } from "@mui/material";
2
+ export declare const syncLegacyVars: (primaryHex: string, secondaryHex: string, mode: PaletteMode, presetId?: string, resolvedBg?: string) => void;
@@ -0,0 +1,10 @@
1
+ export interface ThemePreset {
2
+ id: string;
3
+ name: string;
4
+ primary: string;
5
+ secondary: string;
6
+ background: string;
7
+ text?: string;
8
+ cssVars?: Record<string, string>;
9
+ }
10
+ export declare const THEME_PRESETS: Record<string, ThemePreset>;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { PaletteMode } from "@mui/material";
3
+ import { ThemeConfig } from "../types/ThemeConfig";
4
+ interface BaseThemeType {
5
+ themed: string;
6
+ themeConfig: ThemeConfig;
7
+ setTheme: (presetId: string) => void;
8
+ themeObj: any;
9
+ mode: PaletteMode;
10
+ setThemeMode: (mode: PaletteMode) => void;
11
+ applyTheme: (config: ThemeConfig) => void;
12
+ }
13
+ export declare const BaseThemeProvider: ({ children, onFetchInitialTheme, }: {
14
+ children: React.ReactNode;
15
+ onFetchInitialTheme?: (() => Promise<ThemeConfig | null>) | undefined;
16
+ }) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const useBaseTheme: () => BaseThemeType;
18
+ export {};
@@ -0,0 +1,12 @@
1
+ export interface ThemeConfig {
2
+ mode: "light" | "dark";
3
+ primary: string;
4
+ secondary: string;
5
+ background: string;
6
+ text: string;
7
+ success: string;
8
+ error: string;
9
+ warning: string;
10
+ info: string;
11
+ presetId?: string;
12
+ }