@duxweb/dvha-core 0.1.15 → 0.1.17

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,8 +1,257 @@
1
- import type { UseColorModeOptions } from '@vueuse/core';
2
1
  import type { ITheme } from '../types';
3
- export declare function useTheme(options?: UseColorModeOptions): {
2
+ export type ThemeColorType = 'primary' | 'info' | 'success' | 'warning' | 'error' | 'gray';
3
+ export type ThemeColorName = string;
4
+ export type ThemeColorShade = '50' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | '950';
5
+ export type ThemeSceneType = 'default' | 'hover' | 'pressed' | 'focus' | 'disabled';
6
+ export interface ThemeColorSceneConfig {
7
+ default: string;
8
+ hover: string;
9
+ pressed: string;
10
+ focus: string;
11
+ disabled: string;
12
+ }
13
+ export interface ThemeColorSceneGroupConfig {
14
+ default: ThemeColorSceneConfig;
15
+ overrides?: Partial<Record<ThemeColorType, Partial<ThemeColorSceneConfig>>>;
16
+ }
17
+ export interface ThemeColorSemanticConfig {
18
+ text: {
19
+ dimmed: string;
20
+ muted: string;
21
+ toned: string;
22
+ base: string;
23
+ highlighted: string;
24
+ inverted: string;
25
+ };
26
+ bg: {
27
+ base: string;
28
+ muted: string;
29
+ elevated: string;
30
+ accented: string;
31
+ inverted: string;
32
+ };
33
+ border: {
34
+ base: string;
35
+ muted: string;
36
+ accented: string;
37
+ inverted: string;
38
+ };
39
+ }
40
+ export interface ThemeConfig {
41
+ colors: Record<string, Record<string, string>>;
42
+ colorTypes: ThemeColorType[];
43
+ colorShades: ThemeColorShade[];
44
+ colorScenes: {
45
+ light: ThemeColorSceneGroupConfig;
46
+ dark: ThemeColorSceneGroupConfig;
47
+ };
48
+ colorSemantic: {
49
+ light: ThemeColorSemanticConfig;
50
+ dark: ThemeColorSemanticConfig;
51
+ };
52
+ colorBase?: {
53
+ white: string;
54
+ black: string;
55
+ };
56
+ }
57
+ export declare function useTheme(): {
4
58
  toggle: (n?: number) => "light" | "dark" | "auto";
5
59
  mode: import("vue").ShallowRef<"light" | "dark" | "auto">;
6
60
  isDark: import("vue").ComputedRef<boolean>;
7
- theme: import("vue").ComputedRef<ITheme>;
61
+ resources: import("vue").ComputedRef<ITheme>;
62
+ config: {
63
+ readonly colors: {
64
+ readonly [x: string]: {
65
+ readonly [x: string]: string;
66
+ };
67
+ };
68
+ readonly colorTypes: readonly ThemeColorType[];
69
+ readonly colorShades: readonly ThemeColorShade[];
70
+ readonly colorScenes: {
71
+ readonly light: {
72
+ readonly default: {
73
+ readonly default: string;
74
+ readonly hover: string;
75
+ readonly pressed: string;
76
+ readonly focus: string;
77
+ readonly disabled: string;
78
+ };
79
+ readonly overrides?: {
80
+ readonly info?: {
81
+ readonly default?: string | undefined;
82
+ readonly hover?: string | undefined;
83
+ readonly pressed?: string | undefined;
84
+ readonly focus?: string | undefined;
85
+ readonly disabled?: string | undefined;
86
+ } | undefined;
87
+ readonly error?: {
88
+ readonly default?: string | undefined;
89
+ readonly hover?: string | undefined;
90
+ readonly pressed?: string | undefined;
91
+ readonly focus?: string | undefined;
92
+ readonly disabled?: string | undefined;
93
+ } | undefined;
94
+ readonly gray?: {
95
+ readonly default?: string | undefined;
96
+ readonly hover?: string | undefined;
97
+ readonly pressed?: string | undefined;
98
+ readonly focus?: string | undefined;
99
+ readonly disabled?: string | undefined;
100
+ } | undefined;
101
+ readonly primary?: {
102
+ readonly default?: string | undefined;
103
+ readonly hover?: string | undefined;
104
+ readonly pressed?: string | undefined;
105
+ readonly focus?: string | undefined;
106
+ readonly disabled?: string | undefined;
107
+ } | undefined;
108
+ readonly success?: {
109
+ readonly default?: string | undefined;
110
+ readonly hover?: string | undefined;
111
+ readonly pressed?: string | undefined;
112
+ readonly focus?: string | undefined;
113
+ readonly disabled?: string | undefined;
114
+ } | undefined;
115
+ readonly warning?: {
116
+ readonly default?: string | undefined;
117
+ readonly hover?: string | undefined;
118
+ readonly pressed?: string | undefined;
119
+ readonly focus?: string | undefined;
120
+ readonly disabled?: string | undefined;
121
+ } | undefined;
122
+ } | undefined;
123
+ };
124
+ readonly dark: {
125
+ readonly default: {
126
+ readonly default: string;
127
+ readonly hover: string;
128
+ readonly pressed: string;
129
+ readonly focus: string;
130
+ readonly disabled: string;
131
+ };
132
+ readonly overrides?: {
133
+ readonly info?: {
134
+ readonly default?: string | undefined;
135
+ readonly hover?: string | undefined;
136
+ readonly pressed?: string | undefined;
137
+ readonly focus?: string | undefined;
138
+ readonly disabled?: string | undefined;
139
+ } | undefined;
140
+ readonly error?: {
141
+ readonly default?: string | undefined;
142
+ readonly hover?: string | undefined;
143
+ readonly pressed?: string | undefined;
144
+ readonly focus?: string | undefined;
145
+ readonly disabled?: string | undefined;
146
+ } | undefined;
147
+ readonly gray?: {
148
+ readonly default?: string | undefined;
149
+ readonly hover?: string | undefined;
150
+ readonly pressed?: string | undefined;
151
+ readonly focus?: string | undefined;
152
+ readonly disabled?: string | undefined;
153
+ } | undefined;
154
+ readonly primary?: {
155
+ readonly default?: string | undefined;
156
+ readonly hover?: string | undefined;
157
+ readonly pressed?: string | undefined;
158
+ readonly focus?: string | undefined;
159
+ readonly disabled?: string | undefined;
160
+ } | undefined;
161
+ readonly success?: {
162
+ readonly default?: string | undefined;
163
+ readonly hover?: string | undefined;
164
+ readonly pressed?: string | undefined;
165
+ readonly focus?: string | undefined;
166
+ readonly disabled?: string | undefined;
167
+ } | undefined;
168
+ readonly warning?: {
169
+ readonly default?: string | undefined;
170
+ readonly hover?: string | undefined;
171
+ readonly pressed?: string | undefined;
172
+ readonly focus?: string | undefined;
173
+ readonly disabled?: string | undefined;
174
+ } | undefined;
175
+ } | undefined;
176
+ };
177
+ };
178
+ readonly colorSemantic: {
179
+ readonly light: {
180
+ readonly text: {
181
+ readonly dimmed: string;
182
+ readonly muted: string;
183
+ readonly toned: string;
184
+ readonly base: string;
185
+ readonly highlighted: string;
186
+ readonly inverted: string;
187
+ };
188
+ readonly bg: {
189
+ readonly base: string;
190
+ readonly muted: string;
191
+ readonly elevated: string;
192
+ readonly accented: string;
193
+ readonly inverted: string;
194
+ };
195
+ readonly border: {
196
+ readonly base: string;
197
+ readonly muted: string;
198
+ readonly accented: string;
199
+ readonly inverted: string;
200
+ };
201
+ };
202
+ readonly dark: {
203
+ readonly text: {
204
+ readonly dimmed: string;
205
+ readonly muted: string;
206
+ readonly toned: string;
207
+ readonly base: string;
208
+ readonly highlighted: string;
209
+ readonly inverted: string;
210
+ };
211
+ readonly bg: {
212
+ readonly base: string;
213
+ readonly muted: string;
214
+ readonly elevated: string;
215
+ readonly accented: string;
216
+ readonly inverted: string;
217
+ };
218
+ readonly border: {
219
+ readonly base: string;
220
+ readonly muted: string;
221
+ readonly accented: string;
222
+ readonly inverted: string;
223
+ };
224
+ };
225
+ };
226
+ readonly colorBase?: {
227
+ readonly white: string;
228
+ readonly black: string;
229
+ } | undefined;
230
+ };
231
+ colorMapping: Readonly<import("vue").Ref<{
232
+ readonly primary: ThemeColorName;
233
+ readonly info: ThemeColorName;
234
+ readonly success: ThemeColorName;
235
+ readonly warning: ThemeColorName;
236
+ readonly error: ThemeColorName;
237
+ readonly gray: ThemeColorName;
238
+ }, {
239
+ readonly primary: ThemeColorName;
240
+ readonly info: ThemeColorName;
241
+ readonly success: ThemeColorName;
242
+ readonly warning: ThemeColorName;
243
+ readonly error: ThemeColorName;
244
+ readonly gray: ThemeColorName;
245
+ }>>;
246
+ colors: import("vue").ComputedRef<string[]>;
247
+ colorShades: ThemeColorShade[];
248
+ colorTypes: ThemeColorType[];
249
+ colorScenes: ThemeSceneType[];
250
+ cssInit: () => void;
251
+ cssReset: () => void;
252
+ setColor: (type: ThemeColorType, colorName: ThemeColorName) => void;
253
+ setColors: (mappings: Partial<Record<ThemeColorType, ThemeColorName>>) => void;
254
+ getSceneColor: (type: ThemeColorType, scene?: ThemeSceneType) => string;
255
+ getShadeColor: (type: ThemeColorType, shade: ThemeColorShade) => string;
256
+ getSemanticColor: (category: keyof ThemeColorSemanticConfig, key: string) => string;
8
257
  };
@@ -0,0 +1,288 @@
1
+ export declare const themeColor: {
2
+ slate: {
3
+ 50: string;
4
+ 100: string;
5
+ 200: string;
6
+ 300: string;
7
+ 400: string;
8
+ 500: string;
9
+ 600: string;
10
+ 700: string;
11
+ 800: string;
12
+ 900: string;
13
+ 950: string;
14
+ };
15
+ gray: {
16
+ 50: string;
17
+ 100: string;
18
+ 200: string;
19
+ 300: string;
20
+ 400: string;
21
+ 500: string;
22
+ 600: string;
23
+ 700: string;
24
+ 800: string;
25
+ 900: string;
26
+ 950: string;
27
+ };
28
+ zinc: {
29
+ 50: string;
30
+ 100: string;
31
+ 200: string;
32
+ 300: string;
33
+ 400: string;
34
+ 500: string;
35
+ 600: string;
36
+ 700: string;
37
+ 800: string;
38
+ 900: string;
39
+ 950: string;
40
+ };
41
+ neutral: {
42
+ 50: string;
43
+ 100: string;
44
+ 200: string;
45
+ 300: string;
46
+ 400: string;
47
+ 500: string;
48
+ 600: string;
49
+ 700: string;
50
+ 800: string;
51
+ 900: string;
52
+ 950: string;
53
+ };
54
+ stone: {
55
+ 50: string;
56
+ 100: string;
57
+ 200: string;
58
+ 300: string;
59
+ 400: string;
60
+ 500: string;
61
+ 600: string;
62
+ 700: string;
63
+ 800: string;
64
+ 900: string;
65
+ 950: string;
66
+ };
67
+ red: {
68
+ 50: string;
69
+ 100: string;
70
+ 200: string;
71
+ 300: string;
72
+ 400: string;
73
+ 500: string;
74
+ 600: string;
75
+ 700: string;
76
+ 800: string;
77
+ 900: string;
78
+ 950: string;
79
+ };
80
+ orange: {
81
+ 50: string;
82
+ 100: string;
83
+ 200: string;
84
+ 300: string;
85
+ 400: string;
86
+ 500: string;
87
+ 600: string;
88
+ 700: string;
89
+ 800: string;
90
+ 900: string;
91
+ 950: string;
92
+ };
93
+ amber: {
94
+ 50: string;
95
+ 100: string;
96
+ 200: string;
97
+ 300: string;
98
+ 400: string;
99
+ 500: string;
100
+ 600: string;
101
+ 700: string;
102
+ 800: string;
103
+ 900: string;
104
+ 950: string;
105
+ };
106
+ yellow: {
107
+ 50: string;
108
+ 100: string;
109
+ 200: string;
110
+ 300: string;
111
+ 400: string;
112
+ 500: string;
113
+ 600: string;
114
+ 700: string;
115
+ 800: string;
116
+ 900: string;
117
+ 950: string;
118
+ };
119
+ lime: {
120
+ 50: string;
121
+ 100: string;
122
+ 200: string;
123
+ 300: string;
124
+ 400: string;
125
+ 500: string;
126
+ 600: string;
127
+ 700: string;
128
+ 800: string;
129
+ 900: string;
130
+ 950: string;
131
+ };
132
+ green: {
133
+ 50: string;
134
+ 100: string;
135
+ 200: string;
136
+ 300: string;
137
+ 400: string;
138
+ 500: string;
139
+ 600: string;
140
+ 700: string;
141
+ 800: string;
142
+ 900: string;
143
+ 950: string;
144
+ };
145
+ emerald: {
146
+ 50: string;
147
+ 100: string;
148
+ 200: string;
149
+ 300: string;
150
+ 400: string;
151
+ 500: string;
152
+ 600: string;
153
+ 700: string;
154
+ 800: string;
155
+ 900: string;
156
+ 950: string;
157
+ };
158
+ teal: {
159
+ 50: string;
160
+ 100: string;
161
+ 200: string;
162
+ 300: string;
163
+ 400: string;
164
+ 500: string;
165
+ 600: string;
166
+ 700: string;
167
+ 800: string;
168
+ 900: string;
169
+ 950: string;
170
+ };
171
+ cyan: {
172
+ 50: string;
173
+ 100: string;
174
+ 200: string;
175
+ 300: string;
176
+ 400: string;
177
+ 500: string;
178
+ 600: string;
179
+ 700: string;
180
+ 800: string;
181
+ 900: string;
182
+ 950: string;
183
+ };
184
+ sky: {
185
+ 50: string;
186
+ 100: string;
187
+ 200: string;
188
+ 300: string;
189
+ 400: string;
190
+ 500: string;
191
+ 600: string;
192
+ 700: string;
193
+ 800: string;
194
+ 900: string;
195
+ 950: string;
196
+ };
197
+ blue: {
198
+ 50: string;
199
+ 100: string;
200
+ 200: string;
201
+ 300: string;
202
+ 400: string;
203
+ 500: string;
204
+ 600: string;
205
+ 700: string;
206
+ 800: string;
207
+ 900: string;
208
+ 950: string;
209
+ };
210
+ indigo: {
211
+ 50: string;
212
+ 100: string;
213
+ 200: string;
214
+ 300: string;
215
+ 400: string;
216
+ 500: string;
217
+ 600: string;
218
+ 700: string;
219
+ 800: string;
220
+ 900: string;
221
+ 950: string;
222
+ };
223
+ violet: {
224
+ 50: string;
225
+ 100: string;
226
+ 200: string;
227
+ 300: string;
228
+ 400: string;
229
+ 500: string;
230
+ 600: string;
231
+ 700: string;
232
+ 800: string;
233
+ 900: string;
234
+ 950: string;
235
+ };
236
+ purple: {
237
+ 50: string;
238
+ 100: string;
239
+ 200: string;
240
+ 300: string;
241
+ 400: string;
242
+ 500: string;
243
+ 600: string;
244
+ 700: string;
245
+ 800: string;
246
+ 900: string;
247
+ 950: string;
248
+ };
249
+ fuchsia: {
250
+ 50: string;
251
+ 100: string;
252
+ 200: string;
253
+ 300: string;
254
+ 400: string;
255
+ 500: string;
256
+ 600: string;
257
+ 700: string;
258
+ 800: string;
259
+ 900: string;
260
+ 950: string;
261
+ };
262
+ pink: {
263
+ 50: string;
264
+ 100: string;
265
+ 200: string;
266
+ 300: string;
267
+ 400: string;
268
+ 500: string;
269
+ 600: string;
270
+ 700: string;
271
+ 800: string;
272
+ 900: string;
273
+ 950: string;
274
+ };
275
+ rose: {
276
+ 50: string;
277
+ 100: string;
278
+ 200: string;
279
+ 300: string;
280
+ 400: string;
281
+ 500: string;
282
+ 600: string;
283
+ 700: string;
284
+ 800: string;
285
+ 900: string;
286
+ 950: string;
287
+ };
288
+ };
@@ -3,3 +3,4 @@ export * from './route';
3
3
  export * from './tab';
4
4
  export * from './manage';
5
5
  export * from './i18n';
6
+ export * from './theme';
@@ -0,0 +1,104 @@
1
+ import { ThemeColorName, ThemeColorType } from '../hooks';
2
+ import { Ref } from 'vue';
3
+ export interface ThemeState {
4
+ primary: ThemeColorName;
5
+ info: ThemeColorName;
6
+ success: ThemeColorName;
7
+ warning: ThemeColorName;
8
+ error: ThemeColorName;
9
+ gray: ThemeColorName;
10
+ }
11
+ export declare function useThemeStore(manageName?: string): import("pinia").Store<`theme-${string}`, Pick<{
12
+ mode: Ref<"light" | "dark" | "auto", "light" | "dark" | "auto">;
13
+ setMode: (newMode: "light" | "dark" | "auto") => void;
14
+ theme: Ref<{
15
+ primary: ThemeColorName;
16
+ info: ThemeColorName;
17
+ success: ThemeColorName;
18
+ warning: ThemeColorName;
19
+ error: ThemeColorName;
20
+ gray: ThemeColorName;
21
+ }, ThemeState | {
22
+ primary: ThemeColorName;
23
+ info: ThemeColorName;
24
+ success: ThemeColorName;
25
+ warning: ThemeColorName;
26
+ error: ThemeColorName;
27
+ gray: ThemeColorName;
28
+ }>;
29
+ cssInit: Ref<boolean, boolean>;
30
+ setCssInit: () => void;
31
+ setThemeColor: (type: ThemeColorType, colorName: ThemeColorName) => void;
32
+ setThemeColors: (colors: Partial<ThemeState>) => void;
33
+ resetTheme: () => void;
34
+ getTheme: () => {
35
+ primary: ThemeColorName;
36
+ info: ThemeColorName;
37
+ success: ThemeColorName;
38
+ warning: ThemeColorName;
39
+ error: ThemeColorName;
40
+ gray: ThemeColorName;
41
+ };
42
+ }, "theme" | "mode" | "cssInit">, Pick<{
43
+ mode: Ref<"light" | "dark" | "auto", "light" | "dark" | "auto">;
44
+ setMode: (newMode: "light" | "dark" | "auto") => void;
45
+ theme: Ref<{
46
+ primary: ThemeColorName;
47
+ info: ThemeColorName;
48
+ success: ThemeColorName;
49
+ warning: ThemeColorName;
50
+ error: ThemeColorName;
51
+ gray: ThemeColorName;
52
+ }, ThemeState | {
53
+ primary: ThemeColorName;
54
+ info: ThemeColorName;
55
+ success: ThemeColorName;
56
+ warning: ThemeColorName;
57
+ error: ThemeColorName;
58
+ gray: ThemeColorName;
59
+ }>;
60
+ cssInit: Ref<boolean, boolean>;
61
+ setCssInit: () => void;
62
+ setThemeColor: (type: ThemeColorType, colorName: ThemeColorName) => void;
63
+ setThemeColors: (colors: Partial<ThemeState>) => void;
64
+ resetTheme: () => void;
65
+ getTheme: () => {
66
+ primary: ThemeColorName;
67
+ info: ThemeColorName;
68
+ success: ThemeColorName;
69
+ warning: ThemeColorName;
70
+ error: ThemeColorName;
71
+ gray: ThemeColorName;
72
+ };
73
+ }, never>, Pick<{
74
+ mode: Ref<"light" | "dark" | "auto", "light" | "dark" | "auto">;
75
+ setMode: (newMode: "light" | "dark" | "auto") => void;
76
+ theme: Ref<{
77
+ primary: ThemeColorName;
78
+ info: ThemeColorName;
79
+ success: ThemeColorName;
80
+ warning: ThemeColorName;
81
+ error: ThemeColorName;
82
+ gray: ThemeColorName;
83
+ }, ThemeState | {
84
+ primary: ThemeColorName;
85
+ info: ThemeColorName;
86
+ success: ThemeColorName;
87
+ warning: ThemeColorName;
88
+ error: ThemeColorName;
89
+ gray: ThemeColorName;
90
+ }>;
91
+ cssInit: Ref<boolean, boolean>;
92
+ setCssInit: () => void;
93
+ setThemeColor: (type: ThemeColorType, colorName: ThemeColorName) => void;
94
+ setThemeColors: (colors: Partial<ThemeState>) => void;
95
+ resetTheme: () => void;
96
+ getTheme: () => {
97
+ primary: ThemeColorName;
98
+ info: ThemeColorName;
99
+ success: ThemeColorName;
100
+ warning: ThemeColorName;
101
+ error: ThemeColorName;
102
+ gray: ThemeColorName;
103
+ };
104
+ }, "setMode" | "setCssInit" | "setThemeColor" | "setThemeColors" | "resetTheme" | "getTheme">>;
@@ -1,8 +1,10 @@
1
+ import type { ThemeConfig } from '../hooks';
1
2
  export interface IConfigTheme {
2
3
  logo?: string;
3
4
  darkLogo?: string;
4
5
  banner?: string;
5
6
  darkBanner?: string;
7
+ config?: ThemeConfig;
6
8
  }
7
9
  export interface ITheme {
8
10
  logo?: string;
@@ -1 +1,2 @@
1
1
  export * from './tree';
2
+ export * from './theme';