@clickhouse/click-ui 0.0.234-sc-deprecation.2 → 0.0.234-sc-deprecation.3

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.
@@ -1,7 +1,6 @@
1
1
  import { BaseThemeName, ConfigThemeValues } from '../types';
2
2
 
3
- export type ThemeName = "light" | "dark" | "classic" | "system" | "auto";
4
- export type ThemeTransition = "none" | "fade" | "slide" | "scale";
3
+ export type ThemeName = "light" | "dark" | "system";
5
4
  export interface ThemeContextValue {
6
5
  themeName: ThemeName;
7
6
  resolvedTheme: BaseThemeName;
@@ -1,6 +1,6 @@
1
1
  export { default as ClickUIProvider } from './ClickUIProvider';
2
2
  export { ServerClickUIProvider } from './ServerClickUIProvider';
3
3
  export { useCUITheme, useClickUITheme } from './hooks';
4
- export type { ThemeName, ThemeTransition, ThemeContextValue } from './context';
4
+ export type { ThemeName, ThemeContextValue } from './context';
5
5
  export type { ClickUIConfig, ClickUIProviderProps } from './types';
6
6
  export { DEFAULT_CONFIG } from './types';
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { TooltipProviderProps } from '@radix-ui/react-tooltip';
3
3
  import { ToastProviderProps } from '../../components/Toast/Toast';
4
4
  import { ThemeConfig, BaseThemeName } from '../types';
5
- import { ThemeName, ThemeTransition } from './context';
5
+ import { ThemeName } from './context';
6
6
 
7
7
  export interface ClickUIConfig extends ThemeConfig {
8
8
  defaultTheme?: ThemeName;
@@ -11,9 +11,7 @@ export interface ClickUIConfig extends ThemeConfig {
11
11
  toastConfig?: Omit<ToastProviderProps, "children">;
12
12
  enableTransitions?: boolean;
13
13
  transitionDuration?: number;
14
- transitionMode?: ThemeTransition;
15
14
  preloadThemes?: BaseThemeName[];
16
- enableAutoTheme?: boolean;
17
15
  enableMemoization?: boolean;
18
16
  debounceDelay?: number;
19
17
  enableDevTools?: boolean;
@@ -0,0 +1,7 @@
1
+ import { ResolvedThemeName } from '../types';
2
+
3
+ /**
4
+ * Hook that detects and tracks the user's system color scheme preference
5
+ * @returns Current system theme preference ("light" | "dark")
6
+ */
7
+ export declare const useSystemColorSchemePreference: () => ResolvedThemeName;
@@ -1,7 +1,7 @@
1
1
  export type { Theme, ThemeName, ThemeConfig, ThemeContextValue, BaseThemeName, ResolvedThemeName, DeepPartial, NestedJSONObject, ConfigThemeValues, } from './types';
2
2
  export { ClickUIProvider, ServerClickUIProvider } from './ClickUIProvider';
3
3
  export { useCUITheme, useCUITheme as useClickUITheme, } from './ClickUIProvider';
4
- export { getBaseTheme, getBaseThemeAsync, preloadThemes, getSystemTheme, createSystemThemeListener, loadCustomConfig, deepMerge, } from './utils';
4
+ export { getBaseTheme, loadCustomConfig, deepMerge, } from './utils';
5
5
  export { generateCSSVariables, injectThemeStyles } from './utils/css-generator';
6
6
  export { getThemeConfig } from './config';
7
7
  export type { ThemeName as ClickUIThemeName } from './types';
@@ -3,7 +3,7 @@ export type NestedJSONObject = {
3
3
  [key: string]: string | number | NestedJSONObject;
4
4
  };
5
5
  export type { Theme } from './tokens/types';
6
- export type ThemeName = "light" | "dark" | "classic" | "system";
6
+ export type ThemeName = "light" | "dark" | "system";
7
7
  export type ResolvedThemeName = Exclude<ThemeName, "system">;
8
8
  export type BaseThemeName = ResolvedThemeName;
9
9
  export type ConfigThemeValues = Theme | NestedJSONObject;
@@ -1,4 +1,6 @@
1
1
  import { NestedJSONObject, Theme } from '../types';
2
2
 
3
3
  export declare const generateCSSVariables: (obj: Theme | NestedJSONObject) => string;
4
- export declare const injectThemeStyles: (theme: Theme, resolvedTheme: string, isSystem?: boolean, systemLightTheme?: Theme, systemDarkTheme?: Theme) => void;
4
+ export declare const themeToFlatVariables: (theme: Theme) => Record<string, string>;
5
+ export declare const generateLightDarkVariables: (lightTheme: Theme, darkTheme: Theme) => Record<string, string>;
6
+ export declare const injectThemeStyles: (theme: Theme, resolvedTheme: string, isSystem?: boolean, systemLightTheme?: Theme, systemDarkTheme?: Theme, lightTheme?: Theme, darkTheme?: Theme) => void;
@@ -0,0 +1,26 @@
1
+ import { BaseThemeName } from '../types';
2
+
3
+ export type ThemeProp = "light" | "dark";
4
+ /**
5
+ * Get color-scheme value for a theme
6
+ * @returns "light" or "dark"
7
+ */
8
+ export declare function getColorScheme(theme?: ThemeProp | BaseThemeName): "light" | "dark";
9
+ /**
10
+ * Get inline styles for theme application
11
+ * @returns Style object with colorScheme property
12
+ */
13
+ export declare function getThemeStyles(theme?: ThemeProp | BaseThemeName): {
14
+ colorScheme: "light" | "dark";
15
+ };
16
+ /**
17
+ * Theme utility hook for components
18
+ * Resolves theme prop against context theme
19
+ */
20
+ export declare function useThemeUtils(themeProp?: ThemeProp, contextTheme?: BaseThemeName): {
21
+ theme: ThemeProp | BaseThemeName;
22
+ style: {
23
+ colorScheme: "light" | "dark";
24
+ };
25
+ colorScheme: "light" | "dark";
26
+ };
@@ -4,21 +4,5 @@ import { Theme, BaseThemeName, ThemeConfig } from './types';
4
4
  * Get base theme by name (synchronous with fallback)
5
5
  */
6
6
  export declare const getBaseTheme: (themeName: BaseThemeName) => Theme;
7
- /**
8
- * Get base theme by name (async, fully loaded)
9
- */
10
- export declare const getBaseThemeAsync: (themeName: BaseThemeName) => Promise<Theme>;
11
- /**
12
- * Preload all base themes for better performance
13
- */
14
- export declare const preloadThemes: () => Promise<void>;
15
- /**
16
- * Get system theme preference
17
- */
18
- export declare const getSystemTheme: () => BaseThemeName;
19
- /**
20
- * Create system theme listener
21
- */
22
- export declare const createSystemThemeListener: (callback: (theme: BaseThemeName) => void) => () => void;
23
7
  export declare const loadCustomConfig: () => Promise<ThemeConfig | null>;
24
8
  export declare const deepMerge: (target: any, source: any) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickhouse/click-ui",
3
- "version": "0.0.234-sc-deprecation.2",
3
+ "version": "0.0.234-sc-deprecation.3",
4
4
  "description": "Official ClickHouse design system react library",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",