@clickhouse/click-ui 0.0.245-beta.0 → 0.0.245-fix-theme-test.0

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.
@@ -4,10 +4,10 @@ declare const useColorStyle: (defaultTheme?: CodeThemeType) => {
4
4
  display: string;
5
5
  overflowX: string;
6
6
  padding: string;
7
- color: "#ffffff" | "#282828";
8
- background: "#f6f7fa" | "#282828";
9
- borderRadius: "0.25rem";
10
- font: "500 0.875rem/1.7 \"Inconsolata\", Consolas, \"SFMono Regular\", monospace";
7
+ color: string;
8
+ background: string;
9
+ borderRadius: string;
10
+ font: string;
11
11
  };
12
12
  "hljs-comment": {
13
13
  color: string;
@@ -17,131 +17,131 @@ declare module "styled-components" {
17
17
  declare const useCUITheme: () => {
18
18
  breakpoint: {
19
19
  readonly sizes: {
20
- readonly sm: "640px";
21
- readonly md: "768px";
22
- readonly lg: "1024px";
23
- readonly xl: "1280px";
24
- readonly "2xl": "1536px";
20
+ readonly sm: string;
21
+ readonly md: string;
22
+ readonly lg: string;
23
+ readonly xl: string;
24
+ readonly "2xl": string;
25
25
  };
26
26
  };
27
27
  global: {
28
28
  readonly color: {
29
29
  readonly gradients: {
30
- readonly yellowToBlack: "linear-gradient(132deg, #faff69 8%, #292929 30%)";
31
- readonly whiteToBlack: "linear-gradient(132deg, #ffffff 8%, #292929 30%)";
30
+ readonly yellowToBlack: string;
31
+ readonly whiteToBlack: string;
32
32
  };
33
33
  readonly background: {
34
- readonly default: "#ffffff";
35
- readonly muted: "#f6f7fa";
36
- readonly sidebar: "#ffffff";
37
- readonly split: "#f6f7fa";
38
- readonly muted_a: "lch(49.809 30.506 276.77 / 0.06)";
34
+ readonly default: string;
35
+ readonly muted: string;
36
+ readonly sidebar: string;
37
+ readonly split: string;
38
+ readonly muted_a: string;
39
39
  };
40
40
  readonly stroke: {
41
- readonly default: "#e6e7e9";
42
- readonly muted: "#e6e7e9";
43
- readonly intense: "#b3b6bd";
44
- readonly split: "#e6e7e9";
41
+ readonly default: string;
42
+ readonly muted: string;
43
+ readonly intense: string;
44
+ readonly split: string;
45
45
  };
46
46
  readonly accent: {
47
- readonly default: "#151515";
47
+ readonly default: string;
48
48
  };
49
49
  readonly text: {
50
- readonly default: "#161517";
51
- readonly muted: "#696e79";
52
- readonly disabled: "#a0a0a0";
50
+ readonly default: string;
51
+ readonly muted: string;
52
+ readonly disabled: string;
53
53
  readonly link: {
54
- readonly default: "#437eef";
55
- readonly hover: "#104ec6";
54
+ readonly default: string;
55
+ readonly hover: string;
56
56
  };
57
57
  };
58
58
  readonly outline: {
59
- readonly default: "#437eef";
59
+ readonly default: string;
60
60
  };
61
61
  readonly shadow: {
62
- readonly default: "lch(6.7738 0 none / 0.15)";
62
+ readonly default: string;
63
63
  };
64
64
  readonly feedback: {
65
65
  readonly info: {
66
- readonly background: "#e7effd";
67
- readonly foreground: "#437eef";
66
+ readonly background: string;
67
+ readonly foreground: string;
68
68
  };
69
69
  readonly success: {
70
- readonly background: "#e5ffe8";
71
- readonly foreground: "#008a0b";
70
+ readonly background: string;
71
+ readonly foreground: string;
72
72
  };
73
73
  readonly warning: {
74
- readonly background: "#ffe2d1";
75
- readonly foreground: "#a33c00";
74
+ readonly background: string;
75
+ readonly foreground: string;
76
76
  };
77
77
  readonly danger: {
78
- readonly background: "#ffdddd";
79
- readonly foreground: "#c10000";
78
+ readonly background: string;
79
+ readonly foreground: string;
80
80
  };
81
81
  readonly neutral: {
82
- readonly background: "#f6f7fa";
83
- readonly foreground: "#53575f";
84
- readonly stroke: "#e6e7e9";
82
+ readonly background: string;
83
+ readonly foreground: string;
84
+ readonly stroke: string;
85
85
  };
86
86
  };
87
87
  readonly chart: {
88
88
  readonly default: {
89
- readonly blue: "#437eef";
90
- readonly orange: "#ff7729";
91
- readonly green: "#00e513";
92
- readonly fuchsia: "#fb32c9";
93
- readonly yellow: "#eef400";
94
- readonly violet: "#bb33ff";
95
- readonly babyblue: "#00cbeb";
96
- readonly red: "#ff2323";
97
- readonly danger: "#ff2323";
98
- readonly teal: "#089b83";
99
- readonly sunrise: "#ffc300";
100
- readonly slate: "#9a9ea7";
89
+ readonly blue: string;
90
+ readonly orange: string;
91
+ readonly green: string;
92
+ readonly fuchsia: string;
93
+ readonly yellow: string;
94
+ readonly violet: string;
95
+ readonly babyblue: string;
96
+ readonly red: string;
97
+ readonly danger: string;
98
+ readonly teal: string;
99
+ readonly sunrise: string;
100
+ readonly slate: string;
101
101
  };
102
102
  readonly bars: {
103
- readonly blue: "#437eef";
104
- readonly orange: "#ff7729";
105
- readonly green: "#00e513";
106
- readonly fuchsia: "#fb32c9";
107
- readonly yellow: "#eef400";
108
- readonly violet: "#bb33ff";
109
- readonly babyblue: "#00cbeb";
110
- readonly red: "#ff2323";
111
- readonly teal: "#089b83";
112
- readonly sunrise: "#ffc300";
113
- readonly slate: "#9a9ea7";
103
+ readonly blue: string;
104
+ readonly orange: string;
105
+ readonly green: string;
106
+ readonly fuchsia: string;
107
+ readonly yellow: string;
108
+ readonly violet: string;
109
+ readonly babyblue: string;
110
+ readonly red: string;
111
+ readonly teal: string;
112
+ readonly sunrise: string;
113
+ readonly slate: string;
114
114
  };
115
115
  readonly label: {
116
- readonly default: "#161517";
117
- readonly deselected: "lch(6.9377 1.4387 305.43 / 0.3)";
116
+ readonly default: string;
117
+ readonly deselected: string;
118
118
  };
119
119
  };
120
120
  readonly iconButton: {
121
121
  readonly badge: {
122
- readonly foreground: "#437eef";
123
- readonly background: "#e7effd";
122
+ readonly foreground: string;
123
+ readonly background: string;
124
124
  };
125
125
  };
126
126
  readonly icon: {
127
- readonly background: "linear-gradient(132deg, #FFFFFF 8%, #292929 30%);";
127
+ readonly background: string;
128
128
  };
129
129
  };
130
130
  };
131
- name: "light";
131
+ name: string;
132
132
  sizes: {
133
- readonly "0": "0";
134
- readonly "1": "1px";
135
- readonly "2": "0.25rem";
136
- readonly "3": "0.5rem";
137
- readonly "4": "0.75rem";
138
- readonly "5": "1rem";
139
- readonly "6": "1.25rem";
140
- readonly "7": "1.5rem";
141
- readonly "8": "1.75rem";
142
- readonly "9": "2rem";
143
- readonly "10": "2.5rem";
144
- readonly "11": "4rem";
133
+ readonly "0": string;
134
+ readonly "1": string;
135
+ readonly "2": string;
136
+ readonly "3": string;
137
+ readonly "4": string;
138
+ readonly "5": string;
139
+ readonly "6": string;
140
+ readonly "7": string;
141
+ readonly "8": string;
142
+ readonly "9": string;
143
+ readonly "10": string;
144
+ readonly "11": string;
145
145
  };
146
146
  };
147
147
  export { useCUITheme };
@@ -5,17 +5,26 @@
5
5
  export type Prettify<T> = {
6
6
  [K in keyof T]: T[K] extends object ? Prettify<T[K]> : T[K];
7
7
  } & {};
8
+ /**
9
+ * WidenLiteral - Converts literal types to their base types
10
+ * - string literals → string
11
+ * - number literals → number
12
+ * - boolean literals → boolean
13
+ * - preserves other types as-is
14
+ */
15
+ type WidenLiteral<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T;
8
16
  /**
9
17
  * GetTypes - Extracts TypeScript types from JSON token values
10
18
  * Recursively traverses the token object and infers proper types
11
19
  * Handles arrays and nested objects correctly
20
+ * Widens literal types to their base types (string, number, boolean)
12
21
  */
13
22
  export type GetTypes<T> = Prettify<T extends (infer U)[] ? {
14
- [I in keyof T]: U extends object ? GetTypes<U> : U;
23
+ [I in keyof T]: U extends object ? GetTypes<U> : WidenLiteral<U>;
15
24
  } : T extends object ? {
16
25
  [K in keyof T]: T[K] extends (infer U)[] ? {
17
- [I in keyof T[K]]: U extends object ? GetTypes<U> : U;
18
- } : T[K] extends object ? GetTypes<T[K]> : T[K];
19
- } : T>;
26
+ [I in keyof T[K]]: U extends object ? GetTypes<U> : WidenLiteral<U>;
27
+ } : T[K] extends object ? GetTypes<T[K]> : WidenLiteral<T[K]>;
28
+ } : WidenLiteral<T>>;
20
29
  export type { CUIThemeType as Theme } from '../index';
21
30
  export type { ThemeName, PublicTheme } from '../index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickhouse/click-ui",
3
- "version": "0.0.245-beta.0",
3
+ "version": "0.0.245-fix-theme-test.0",
4
4
  "description": "Official ClickHouse design system react library",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",