@venix-sistemas/jade 1.1.0 → 1.2.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.
Files changed (55) hide show
  1. package/README.md +339 -222
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +25 -11
  4. package/dist/runtime/components/VenixThemeSwitcher.d.vue.ts +1 -1
  5. package/dist/runtime/components/VenixThemeSwitcher.vue +242 -99
  6. package/dist/runtime/components/VenixThemeSwitcher.vue.d.ts +1 -1
  7. package/dist/runtime/composables/useThemeColors.d.ts +6 -0
  8. package/dist/runtime/composables/useThemeColors.js +24 -9
  9. package/dist/runtime/composables/useThemeCookies.d.ts +9 -2
  10. package/dist/runtime/composables/useThemeCookies.js +24 -6
  11. package/dist/runtime/composables/useThemeLocale.d.ts +5 -0
  12. package/dist/runtime/composables/useThemeLocale.js +2 -2
  13. package/dist/runtime/composables/useThemeSeasonal.d.ts +2 -2
  14. package/dist/runtime/composables/useThemeSeasonal.js +1 -1
  15. package/dist/runtime/composables/useVenixTheme.d.ts +20 -0
  16. package/dist/runtime/composables/useVenixTheme.js +168 -108
  17. package/dist/runtime/nitro/theme-init.js +8 -5
  18. package/dist/runtime/plugins/theme-init.server.js +7 -12
  19. package/dist/runtime/plugins/vuetify-theme.js +8 -11
  20. package/dist/runtime/scripts/theme-init.d.ts +23 -10
  21. package/dist/runtime/scripts/theme-init.js +42 -88
  22. package/dist/shared/constants.d.ts +18 -3
  23. package/dist/shared/constants.js +6 -1
  24. package/dist/shared/css/cursor.js +9 -2
  25. package/dist/shared/css/index.d.ts +1 -7
  26. package/dist/shared/css/index.js +5 -5
  27. package/dist/shared/css/transition.d.ts +1 -1
  28. package/dist/shared/theme.json +302 -192
  29. package/dist/shared/types/color-options.d.ts +26 -2
  30. package/dist/shared/types/colors.d.ts +64 -12
  31. package/dist/shared/types/index.d.ts +1 -1
  32. package/dist/shared/types/runtime-config.d.ts +4 -2
  33. package/dist/shared/utils/icon-refs.d.ts +7 -3
  34. package/dist/shared/utils/icon.d.ts +4 -2
  35. package/dist/shared/utils/icon.js +6 -2
  36. package/dist/shared/utils/index.d.ts +5 -4
  37. package/dist/shared/utils/index.js +12 -6
  38. package/dist/shared/utils/inline-script.d.ts +6 -0
  39. package/dist/shared/utils/inline-script.js +3 -0
  40. package/dist/shared/utils/load.d.ts +0 -1
  41. package/dist/shared/utils/load.js +5 -12
  42. package/dist/shared/utils/merge-themes.d.ts +39 -9
  43. package/dist/shared/utils/merge-themes.js +101 -5
  44. package/dist/shared/utils/normalize.d.ts +0 -11
  45. package/dist/shared/utils/normalize.js +0 -12
  46. package/dist/shared/utils/theme-config.d.ts +13 -4
  47. package/dist/shared/utils/theme-config.js +28 -15
  48. package/dist/shared/utils/theme-resolve.d.ts +15 -23
  49. package/dist/shared/utils/theme-resolve.js +18 -67
  50. package/dist/shared/utils/theme-resolver.d.ts +46 -0
  51. package/dist/shared/utils/theme-resolver.js +139 -0
  52. package/package.json +13 -10
  53. package/README-default.md +0 -84
  54. package/dist/runtime/plugin.d.ts +0 -2
  55. package/dist/runtime/plugin.js +0 -3
@@ -1,193 +1,303 @@
1
- {
2
- "name": "default",
3
- "typography": {
4
- "enabled": true,
5
- "defaultFonts": "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
6
- "fontSize": "16px",
7
- "customFonts": [
8
- {
9
- "name": "Iceberg",
10
- "preload": true,
11
- "sources": {
12
- "woff2": "/fonts/Iceberg/Iceberg-Regular.woff2"
13
- },
14
- "weight": "normal",
15
- "style": "normal"
16
- }
17
- ]
18
- },
19
- "customScrollbar": {
20
- "enabled": true,
21
- "width": "auto",
22
- "borderRadius": "8px",
23
- "borderWidth": "3px",
24
- "colors": {
25
- "thumb": "primary",
26
- "thumbHover": "secondary",
27
- "track": "background2",
28
- "border": "background3"
29
- }
30
- },
31
- "customCursor": {
32
- "enabled": false,
33
- "cursors": {
34
- "default": {
35
- "path": "/images/ui/cursor/cursor.png",
36
- "hotspot": "0 0"
37
- },
38
- "pointer": {
39
- "path": "/images/ui/cursor/cursor-hand.png",
40
- "hotspot": "0 0"
41
- },
42
- "text": {
43
- "path": "/images/ui/cursor/cursor-text.png",
44
- "hotspot": "12 12"
45
- }
46
- },
47
- "_comment": "default | pointer | text"
48
- },
49
- "colors": {
50
- "enabled": true,
51
- "defaults": true,
52
- "defaultColor": "dark",
53
- "themes": {
54
- "system": {
55
- "translations": {
56
- "pt-BR": "Automático",
57
- "en-US": "Automatic"
58
- },
59
- "icon": {
60
- "emote": "🎨",
61
- "css": "line-md:light-dark",
62
- "svg": "line-md:light-dark-loop"
63
- }
64
- },
65
- "dark": {
66
- "dark": true,
67
- "primary": "#FF6B6B",
68
- "secondary": "#FFB96A",
69
- "accent": "#82B1FF",
70
- "error": "#FF5252",
71
- "info": "#2196F3",
72
- "success": "#4CAF50",
73
- "warning": "#FCCF3D",
74
- "background": "#0C0C0C",
75
- "background2": "#191919",
76
- "background3": "#282828",
77
- "translations": {
78
- "pt-BR": "Escuro",
79
- "en-US": "Dark"
80
- },
81
- "icon": {
82
- "emote": "🌙",
83
- "css": "mdi:moon-and-stars",
84
- "svg": "line-md:moon-filled-loop"
85
- }
86
- },
87
- "light": {
88
- "dark": false,
89
- "primary": "#FF0000",
90
- "secondary": "#FF8800",
91
- "accent": "#82B1FF",
92
- "error": "#FF5252",
93
- "info": "#2196F3",
94
- "success": "#4CAF50",
95
- "warning": "#FCCF3D",
96
- "background": "#FAFAFA",
97
- "background2": "#F0F0F0",
98
- "background3": "#E6E6E6",
99
- "translations": {
100
- "pt-BR": "Claro",
101
- "en-US": "Light"
102
- },
103
- "icon": {
104
- "emote": "☀️",
105
- "css": "mdi:white-balance-sunny",
106
- "svg": "line-md:sunny-filled-loop"
107
- }
108
- },
109
- "carnaval": {
110
- "dark": true,
111
- "seasonal": true,
112
- "dateRange": {
113
- "start": "easter-65",
114
- "end": "easter-46"
115
- },
116
- "primary": "#FF1493",
117
- "secondary": "#FFD000",
118
- "accent": "#00D4AA",
119
- "error": "#FF0000",
120
- "info": "#00BFFF",
121
- "success": "#32CD32",
122
- "warning": "#FF8C00",
123
- "background": "#1A001A",
124
- "background2": "#2D002D",
125
- "background3": "#400040",
126
- "translations": {
127
- "pt-BR": "Carnaval",
128
- "en-US": "Carnival"
129
- },
130
- "icon": {
131
- "emote": "🎭",
132
- "css": "mdi:emoticon-excited-outline",
133
- "svg": "line-md:emoji-grin"
134
- }
135
- },
136
- "natal": {
137
- "dark": true,
138
- "seasonal": true,
139
- "dateRange": {
140
- "start": "12-01",
141
- "end": "12-26"
142
- },
143
- "primary": "#CA2A2A",
144
- "secondary": "#3BA340",
145
- "accent": "#FFD54F",
146
- "error": "#FF1744",
147
- "info": "#2979FF",
148
- "success": "#00E676",
149
- "warning": "#FFAB00",
150
- "background": "#0F0F0F",
151
- "background2": "#191919",
152
- "background3": "#282828",
153
- "translations": {
154
- "pt-BR": "Natal",
155
- "en-US": "Christmas"
156
- },
157
- "icon": {
158
- "emote": "🎄",
159
- "css": "mdi:pine-tree-variant",
160
- "svg": "line-md:star-filled"
161
- }
162
- },
163
- "halloween": {
164
- "dark": true,
165
- "seasonal": true,
166
- "dateRange": {
167
- "start": "10-01",
168
- "end": "10-31"
169
- },
170
- "primary": "#FF6F00",
171
- "secondary": "#A42BF0",
172
- "accent": "#76FF03",
173
- "error": "#FF0000",
174
- "info": "#4A90D9",
175
- "success": "#32CD32",
176
- "warning": "#FF8C00",
177
- "background": "#0D0D0D",
178
- "background2": "#1A0A00",
179
- "background3": "#2B1500",
180
- "translations": {
181
- "pt-BR": "Dia das Bruxas",
182
- "en-US": "Halloween"
183
- },
184
- "icon": {
185
- "emote": "🎃",
186
- "css": "mdi:halloween",
187
- "svg": "line-md:emoji-frown"
188
- }
189
- }
190
- }
191
- },
192
- "_comment": "Use 'node app/utils/generate-theme-css.cjs' to generate CSS"
1
+ {
2
+ "name": "default",
3
+ "typography": {
4
+ "enabled": true,
5
+ "defaultFonts": "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
6
+ "fontSize": "16px",
7
+ "customFonts": [
8
+ {
9
+ "name": "Iceberg",
10
+ "preload": true,
11
+ "sources": {
12
+ "woff2": "/fonts/Iceberg/Iceberg-Regular.woff2"
13
+ },
14
+ "weight": "normal",
15
+ "style": "normal"
16
+ }
17
+ ]
18
+ },
19
+ "customScrollbar": {
20
+ "enabled": true,
21
+ "width": "auto",
22
+ "borderRadius": "8px",
23
+ "borderWidth": "3px",
24
+ "colors": {
25
+ "thumb": "primary",
26
+ "thumbHover": "secondary",
27
+ "track": "background2",
28
+ "border": "background3"
29
+ }
30
+ },
31
+ "customCursor": {
32
+ "enabled": false,
33
+ "cursors": {
34
+ "default": {
35
+ "path": "/images/ui/cursor/cursor.png",
36
+ "hotspot": "4 0"
37
+ },
38
+ "pointer": {
39
+ "path": "/images/ui/cursor/cursor-hand.png",
40
+ "hotspot": "8 0"
41
+ },
42
+ "text": {
43
+ "path": "/images/ui/cursor/cursor-text.png",
44
+ "hotspot": "12 12"
45
+ }
46
+ },
47
+ "_comment": "default | pointer | text"
48
+ },
49
+ "colors": {
50
+ "enabled": true,
51
+ "defaults": true,
52
+ "defaultColor": "dark",
53
+ "modes": {
54
+ "system": {
55
+ "translations": {
56
+ "pt-BR": "Automático",
57
+ "en-US": "Automatic"
58
+ },
59
+ "icon": {
60
+ "emote": "🌓",
61
+ "css": "mdi:theme-light-dark",
62
+ "svg": "line-md:light-dark-loop"
63
+ }
64
+ },
65
+ "light": {
66
+ "translations": {
67
+ "pt-BR": "Claro",
68
+ "en-US": "Light"
69
+ },
70
+ "icon": {
71
+ "emote": "☀️",
72
+ "css": "mdi:white-balance-sunny",
73
+ "svg": "line-md:sunny-filled-loop"
74
+ }
75
+ },
76
+ "dark": {
77
+ "translations": {
78
+ "pt-BR": "Escuro",
79
+ "en-US": "Dark"
80
+ },
81
+ "icon": {
82
+ "emote": "🌙",
83
+ "css": "mdi:moon-and-stars",
84
+ "svg": "line-md:moon-filled-loop"
85
+ }
86
+ }
87
+ },
88
+ "themes": {
89
+ "system": {
90
+ "translations": {
91
+ "pt-BR": "Automático",
92
+ "en-US": "Automatic"
93
+ },
94
+ "icon": {
95
+ "emote": "📅",
96
+ "css": "mdi:calendar-star",
97
+ "svg": "line-md:calendar"
98
+ }
99
+ },
100
+ "venix": {
101
+ "translations": {
102
+ "pt-BR": "Venix Sistemas",
103
+ "en-US": "Venix Sistemas"
104
+ },
105
+ "icon": {
106
+ "emote": "💎",
107
+ "css": "mdi:diamond-stone",
108
+ "svg": "line-md:paint-drop-half-filled-twotone"
109
+ },
110
+ "dark": {
111
+ "id": "dark",
112
+ "primary": "#FF6B6B",
113
+ "secondary": "#FFB96A",
114
+ "accent": "#82B1FF",
115
+ "error": "#FF5252",
116
+ "info": "#2196F3",
117
+ "success": "#4CAF50",
118
+ "warning": "#FCCF3D",
119
+ "background": "#0C0C0C",
120
+ "background2": "#191919",
121
+ "background3": "#282828"
122
+ },
123
+ "light": {
124
+ "id": "light",
125
+ "primary": "#FF0000",
126
+ "secondary": "#FF8800",
127
+ "accent": "#82B1FF",
128
+ "error": "#FF5252",
129
+ "info": "#2196F3",
130
+ "success": "#4CAF50",
131
+ "warning": "#FCCF3D",
132
+ "background": "#FAFAFA",
133
+ "background2": "#F0F0F0",
134
+ "background3": "#E6E6E6"
135
+ }
136
+ },
137
+ "carnaval": {
138
+ "seasonal": true,
139
+ "dateRange": {
140
+ "start": "easter-65",
141
+ "end": "easter-46"
142
+ },
143
+ "translations": {
144
+ "pt-BR": "Carnaval",
145
+ "en-US": "Carnival"
146
+ },
147
+ "icon": {
148
+ "emote": "🎭",
149
+ "css": "mdi:emoticon-excited-outline",
150
+ "svg": "line-md:emoji-grin"
151
+ },
152
+ "dark": {
153
+ "id": "carnaval",
154
+ "primary": "#FF5CA8",
155
+ "secondary": "#FFD54A",
156
+ "accent": "#3DD9B8",
157
+ "error": "#FF5252",
158
+ "info": "#4FC3F7",
159
+ "success": "#66D17A",
160
+ "warning": "#FFA54C",
161
+ "background": "#170A16",
162
+ "background2": "#210F20",
163
+ "background3": "#2E152B"
164
+ },
165
+ "light": {
166
+ "primary": "#C2186F",
167
+ "secondary": "#A16207",
168
+ "accent": "#0F9E86",
169
+ "error": "#E53935",
170
+ "info": "#0277BD",
171
+ "success": "#2E8B4E",
172
+ "warning": "#E65100",
173
+ "background": "#FFF7FB",
174
+ "background2": "#FCEAF3",
175
+ "background3": "#F6D8E8"
176
+ }
177
+ },
178
+ "pascoa": {
179
+ "seasonal": true,
180
+ "dateRange": {
181
+ "start": "easter-7",
182
+ "end": "easter+1"
183
+ },
184
+ "translations": {
185
+ "pt-BR": "Páscoa",
186
+ "en-US": "Easter"
187
+ },
188
+ "icon": {
189
+ "emote": "🐰",
190
+ "css": "mdi:egg-easter",
191
+ "svg": "line-md:heart-filled"
192
+ },
193
+ "dark": {
194
+ "primary": "#FF6FB0",
195
+ "secondary": "#B085F5",
196
+ "accent": "#4DD0C4",
197
+ "error": "#FF5252",
198
+ "info": "#42A5F5",
199
+ "success": "#66BB6A",
200
+ "warning": "#FFCA28",
201
+ "background": "#1B1225",
202
+ "background2": "#251A33",
203
+ "background3": "#301F40"
204
+ },
205
+ "light": {
206
+ "primary": "#C2185B",
207
+ "secondary": "#7B4FC4",
208
+ "accent": "#26A69A",
209
+ "error": "#E53935",
210
+ "info": "#1E88E5",
211
+ "success": "#43A047",
212
+ "warning": "#FFB300",
213
+ "background": "#FFFDF5",
214
+ "background2": "#FFF3E0",
215
+ "background3": "#FDE2ED"
216
+ }
217
+ },
218
+ "natal": {
219
+ "seasonal": true,
220
+ "dateRange": {
221
+ "start": "12-01",
222
+ "end": "12-26"
223
+ },
224
+ "translations": {
225
+ "pt-BR": "Natal",
226
+ "en-US": "Christmas"
227
+ },
228
+ "icon": {
229
+ "emote": "🎄",
230
+ "css": "mdi:pine-tree-variant",
231
+ "svg": "line-md:star-filled"
232
+ },
233
+ "dark": {
234
+ "id": "natal",
235
+ "primary": "#FF6B6B",
236
+ "secondary": "#6FCF7F",
237
+ "accent": "#FFD54F",
238
+ "error": "#FF6161",
239
+ "info": "#64B5F6",
240
+ "success": "#66D49A",
241
+ "warning": "#FFB74D",
242
+ "background": "#0B1611",
243
+ "background2": "#10201A",
244
+ "background3": "#172C23"
245
+ },
246
+ "light": {
247
+ "primary": "#C62828",
248
+ "secondary": "#2E7D32",
249
+ "accent": "#B8860B",
250
+ "error": "#D32F2F",
251
+ "info": "#1976D2",
252
+ "success": "#2E7D4F",
253
+ "warning": "#EF6C00",
254
+ "background": "#FBFAF5",
255
+ "background2": "#F0F5EE",
256
+ "background3": "#E1EBE0"
257
+ }
258
+ },
259
+ "halloween": {
260
+ "seasonal": true,
261
+ "dateRange": {
262
+ "start": "10-01",
263
+ "end": "10-31"
264
+ },
265
+ "translations": {
266
+ "pt-BR": "Dia das Bruxas",
267
+ "en-US": "Halloween"
268
+ },
269
+ "icon": {
270
+ "emote": "🎃",
271
+ "css": "mdi:halloween",
272
+ "svg": "line-md:emoji-frown"
273
+ },
274
+ "dark": {
275
+ "id": "halloween",
276
+ "primary": "#FF8A3D",
277
+ "secondary": "#B98AF0",
278
+ "accent": "#A5D65A",
279
+ "error": "#FF6161",
280
+ "info": "#64A8E8",
281
+ "success": "#66BB6A",
282
+ "warning": "#FFCA28",
283
+ "background": "#16100C",
284
+ "background2": "#1F1711",
285
+ "background3": "#2B1F17"
286
+ },
287
+ "light": {
288
+ "primary": "#C2410C",
289
+ "secondary": "#6A3FB5",
290
+ "accent": "#5B8A1E",
291
+ "error": "#D32F2F",
292
+ "info": "#1E6FB8",
293
+ "success": "#388E3C",
294
+ "warning": "#E09B00",
295
+ "background": "#FFF8F0",
296
+ "background2": "#FBEBDD",
297
+ "background3": "#F3DCC8"
298
+ }
299
+ }
300
+ }
301
+ },
302
+ "_comment": "Use 'node app/utils/generate-theme-css.cjs' to generate CSS"
193
303
  }
@@ -1,9 +1,19 @@
1
- import type { ThemeColors } from './colors.js';
1
+ import type { ThemeEntry } from './colors.js';
2
2
  export interface ColorOptions {
3
3
  enabled: boolean;
4
4
  apply: boolean;
5
+ /**
6
+ * Initial choice for new visitors: a theme name (mode follows the OS), a
7
+ * variant id like `'dark'` (that theme in that mode) or `'system'` (both
8
+ * automatic). Default: `'dark'`.
9
+ */
5
10
  defaultColor: string;
6
- themes: Record<string, Partial<ThemeColors>>;
11
+ /**
12
+ * Override or add themes. Use the grouped format
13
+ * (`{ translations, icon, light: {...}, dark: {...} }`); the flat format
14
+ * (`{ dark: true, primary, ... }`) still works but is deprecated.
15
+ */
16
+ themes: Record<string, Partial<ThemeEntry>>;
7
17
  /**
8
18
  * Preferred variant for each theme's icon when `icon` is an object
9
19
  * (`ThemeIconFormats`). Default: `'svg'`. Falls back to `'emote'` when the
@@ -11,4 +21,18 @@ export interface ColorOptions {
11
21
  * (legacy format).
12
22
  */
13
23
  iconFormat: 'emote' | 'css' | 'svg';
24
+ /**
25
+ * Only save the theme cookies (`venix-theme-preference`, `venix-theme-mode`,
26
+ * `venix-theme-resolved`) and the locale cookie after functional-cookie
27
+ * consent is recorded (see `persistence.grant()`).
28
+ * Default: `true`. Set `false` for apps without a consent banner (e.g. an
29
+ * internal tool) so the chosen theme always survives a reload.
30
+ */
31
+ requireConsent: boolean;
32
+ /**
33
+ * Seasonal themes (Carnival, Easter, Halloween, Christmas and any custom
34
+ * one with `seasonal: true`). Default: `true`. With `false` they're
35
+ * removed entirely: not listed in pickers and never applied by date.
36
+ */
37
+ seasonal: boolean;
14
38
  }
@@ -9,18 +9,12 @@ export interface ThemeIconFormats {
9
9
  /** Iconify icon name (e.g. 'line-md:sunny-filled-loop'), animated (@nuxt/icon in SVG mode). */
10
10
  svg?: string;
11
11
  }
12
- export interface ThemeColors {
13
- dark?: boolean;
14
- seasonal?: boolean;
15
- /**
16
- * Inclusive range, wrapping across year-end when `end` < `start`. Each bound
17
- * is a fixed `MM-DD` date or a movable one relative to Easter Sunday
18
- * (`easter`, `easter-47`, `easter+1`).
19
- */
20
- dateRange?: {
21
- start: string;
22
- end: string;
23
- };
12
+ /** Light or dark — the two variants every theme can have. */
13
+ export type ThemeMode = 'light' | 'dark';
14
+ /** The user's mode choice: a fixed mode, or `'system'` to follow the OS. */
15
+ export type ThemeModePreference = ThemeMode | 'system';
16
+ /** The color slots of a theme variant — each becomes a `--color-<name>` CSS variable. */
17
+ export interface ThemePalette {
24
18
  primary?: string;
25
19
  secondary?: string;
26
20
  accent?: string;
@@ -31,13 +25,71 @@ export interface ThemeColors {
31
25
  background?: string;
32
26
  background2?: string;
33
27
  background3?: string;
28
+ }
29
+ /** One light/dark variant of a theme (`ThemeDefinition.light` / `.dark`). */
30
+ export interface ThemeVariant extends ThemePalette {
31
+ /**
32
+ * The value applied to `<html data-theme>` (and class) and used as the
33
+ * Vuetify theme name. Default: `<theme>-<mode>` (e.g. `carnaval-light`).
34
+ */
35
+ id?: string;
36
+ }
37
+ /** What a theme is called, how it's drawn and when it's active — shared by both variants. */
38
+ export interface ThemeMeta {
39
+ seasonal?: boolean;
40
+ /**
41
+ * Inclusive range, wrapping across year-end when `end` < `start`. Each bound
42
+ * is a fixed `MM-DD` date or a movable one relative to Easter Sunday
43
+ * (`easter`, `easter-47`, `easter+1`).
44
+ */
45
+ dateRange?: {
46
+ start: string;
47
+ end: string;
48
+ };
34
49
  translations?: ThemeTranslations;
35
50
  /** A plain emoji ('🎨') or an object with per-format variants — see `ThemeIconFormats`. */
36
51
  icon?: string | ThemeIconFormats;
37
52
  }
53
+ /**
54
+ * A theme in the grouped format: shared metadata plus a `light` and/or a
55
+ * `dark` variant. The user picks the theme and the mode independently; the
56
+ * applied colors are the variant matching the mode.
57
+ */
58
+ export interface ThemeDefinition extends ThemeMeta {
59
+ light?: ThemeVariant;
60
+ dark?: ThemeVariant;
61
+ }
62
+ /**
63
+ * A single concrete set of colors, flagged light or dark. This is how
64
+ * resolved variants are stored (`ColorsConfig.themes`), and also the legacy
65
+ * flat config format — deprecated in `color.themes` in favor of
66
+ * `ThemeDefinition`.
67
+ */
68
+ export interface ThemeColors extends ThemeMeta, ThemePalette {
69
+ dark?: boolean;
70
+ }
71
+ /** An entry of `color.themes`: the grouped format, or the deprecated flat one. */
72
+ export type ThemeEntry = ThemeDefinition | ThemeColors;
73
+ /** A selectable theme after resolution: its metadata and the ids of its variants. */
74
+ export interface ResolvedThemeGroup extends ThemeMeta {
75
+ variants: Partial<Record<ThemeMode, string>>;
76
+ /** Added by the project in `color.themes`, not shipped with the module. */
77
+ custom?: boolean;
78
+ }
79
+ /** Label and icon of a mode option (`'system'`, `'light'`, `'dark'`). */
80
+ export interface ThemeModeLabel {
81
+ translations?: ThemeTranslations;
82
+ icon?: string | ThemeIconFormats;
83
+ }
38
84
  export interface ColorsConfig {
39
85
  enabled: boolean;
40
86
  defaults: boolean;
87
+ /** Initial choice for new visitors: a theme name, a variant id (`'dark'`) or `'system'`. */
41
88
  defaultColor: string;
89
+ /** Every concrete color variant, by id — what `data-theme` receives. */
42
90
  themes: Record<string, ThemeColors>;
91
+ /** The selectable themes (plus the `'system'` placeholder), each pointing at its variants. */
92
+ groups: Record<string, ResolvedThemeGroup>;
93
+ /** Labels and icons for the mode picker. */
94
+ modes: Record<string, ThemeModeLabel>;
43
95
  }
@@ -2,7 +2,7 @@ import './runtime-config.js';
2
2
  export type { FontConfig, TypographyConfig } from './typography.js';
3
3
  export type { ScrollbarConfig } from './scrollbar.js';
4
4
  export type { CursorConfig } from './cursor.js';
5
- export type { ThemeColors, ThemeTranslations, ColorsConfig, ThemeIconFormats } from './colors.js';
5
+ export type { ThemeColors, ThemeTranslations, ColorsConfig, ThemeIconFormats, ThemeMode, ThemeModePreference, ThemePalette, ThemeVariant, ThemeMeta, ThemeDefinition, ThemeEntry, ResolvedThemeGroup, ThemeModeLabel, } from './colors.js';
6
6
  export type { ThemeConfig } from './theme.js';
7
7
  export type { TranslationConfig } from './translation.js';
8
8
  export type { ColorOptions } from './color-options.js';