pika-shared 1.4.11 → 1.5.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.
@@ -0,0 +1,95 @@
1
+ import { SemanticColorVariable } from './theme-types.mjs';
2
+
3
+ /**
4
+ * Theme Schema Versioning System
5
+ *
6
+ * This module tracks changes to the theme variable system over time.
7
+ * When new CSS variables are added to Pika's theme system, a new schema version
8
+ * is created so users can be notified and optionally update their theme configs.
9
+ *
10
+ * Usage:
11
+ * - `pika theme check` - Shows what's new since your schema version
12
+ * - `pika theme update` - Adds new variables with suggested defaults
13
+ *
14
+ * @since 0.16.0
15
+ */
16
+
17
+ /**
18
+ * The current theme schema version.
19
+ * Increment this when adding new theme variables.
20
+ */
21
+ declare const CURRENT_THEME_SCHEMA_VERSION = 1;
22
+ /**
23
+ * Represents a change in a theme schema version
24
+ */
25
+ interface ThemeSchemaChange {
26
+ /** Version number (must be sequential) */
27
+ version: number;
28
+ /** Release date in ISO format */
29
+ date: string;
30
+ /** Brief description of changes */
31
+ description: string;
32
+ /** New CSS variables added in this version */
33
+ addedVariables: {
34
+ /** Variable name without -- prefix */
35
+ name: string;
36
+ /** Category for organization */
37
+ category: ThemeVariableCategory;
38
+ /** Description of what this variable controls */
39
+ description: string;
40
+ /** Suggested default value (oklch format preferred) */
41
+ defaultLight: string;
42
+ /** Suggested dark mode value */
43
+ defaultDark?: string;
44
+ /** What UI elements are affected */
45
+ affectedElements: string[];
46
+ }[];
47
+ /** Variables that were deprecated */
48
+ deprecatedVariables?: {
49
+ name: string;
50
+ replacement?: string;
51
+ reason: string;
52
+ }[];
53
+ }
54
+ /**
55
+ * Categories for organizing theme variables
56
+ */
57
+ type ThemeVariableCategory = 'core' | 'surface' | 'text' | 'border' | 'status' | 'sidebar' | 'chart' | 'brand';
58
+ /**
59
+ * Complete documentation of a theme variable
60
+ */
61
+ interface ThemeVariableDoc {
62
+ name: SemanticColorVariable | string;
63
+ category: ThemeVariableCategory;
64
+ description: string;
65
+ defaultLight: string;
66
+ defaultDark: string;
67
+ affectedElements: string[];
68
+ introduced: number;
69
+ }
70
+ /**
71
+ * Schema changelog - documents all changes to the theme system
72
+ */
73
+ declare const THEME_SCHEMA_CHANGELOG: ThemeSchemaChange[];
74
+ /**
75
+ * Get all theme variables introduced up to a specific version
76
+ */
77
+ declare function getVariablesForVersion(version: number): ThemeVariableDoc[];
78
+ /**
79
+ * Get variables added between two schema versions
80
+ */
81
+ declare function getNewVariablesSince(fromVersion: number): ThemeSchemaChange[];
82
+ /**
83
+ * Check if a theme config is up to date
84
+ */
85
+ declare function isThemeSchemaUpToDate(schemaVersion: number | undefined): boolean;
86
+ /**
87
+ * Get all variables organized by category
88
+ */
89
+ declare function getVariablesByCategory(): Record<ThemeVariableCategory, ThemeVariableDoc[]>;
90
+ /**
91
+ * Generate a theme config snippet with defaults for new variables
92
+ */
93
+ declare function generateThemeSnippetForNewVariables(fromVersion: number, mode?: 'light' | 'dark'): string;
94
+
95
+ export { CURRENT_THEME_SCHEMA_VERSION, THEME_SCHEMA_CHANGELOG, type ThemeSchemaChange, type ThemeVariableCategory, type ThemeVariableDoc, generateThemeSnippetForNewVariables, getNewVariablesSince, getVariablesByCategory, getVariablesForVersion, isThemeSchemaUpToDate };
@@ -0,0 +1,95 @@
1
+ import { SemanticColorVariable } from './theme-types.js';
2
+
3
+ /**
4
+ * Theme Schema Versioning System
5
+ *
6
+ * This module tracks changes to the theme variable system over time.
7
+ * When new CSS variables are added to Pika's theme system, a new schema version
8
+ * is created so users can be notified and optionally update their theme configs.
9
+ *
10
+ * Usage:
11
+ * - `pika theme check` - Shows what's new since your schema version
12
+ * - `pika theme update` - Adds new variables with suggested defaults
13
+ *
14
+ * @since 0.16.0
15
+ */
16
+
17
+ /**
18
+ * The current theme schema version.
19
+ * Increment this when adding new theme variables.
20
+ */
21
+ declare const CURRENT_THEME_SCHEMA_VERSION = 1;
22
+ /**
23
+ * Represents a change in a theme schema version
24
+ */
25
+ interface ThemeSchemaChange {
26
+ /** Version number (must be sequential) */
27
+ version: number;
28
+ /** Release date in ISO format */
29
+ date: string;
30
+ /** Brief description of changes */
31
+ description: string;
32
+ /** New CSS variables added in this version */
33
+ addedVariables: {
34
+ /** Variable name without -- prefix */
35
+ name: string;
36
+ /** Category for organization */
37
+ category: ThemeVariableCategory;
38
+ /** Description of what this variable controls */
39
+ description: string;
40
+ /** Suggested default value (oklch format preferred) */
41
+ defaultLight: string;
42
+ /** Suggested dark mode value */
43
+ defaultDark?: string;
44
+ /** What UI elements are affected */
45
+ affectedElements: string[];
46
+ }[];
47
+ /** Variables that were deprecated */
48
+ deprecatedVariables?: {
49
+ name: string;
50
+ replacement?: string;
51
+ reason: string;
52
+ }[];
53
+ }
54
+ /**
55
+ * Categories for organizing theme variables
56
+ */
57
+ type ThemeVariableCategory = 'core' | 'surface' | 'text' | 'border' | 'status' | 'sidebar' | 'chart' | 'brand';
58
+ /**
59
+ * Complete documentation of a theme variable
60
+ */
61
+ interface ThemeVariableDoc {
62
+ name: SemanticColorVariable | string;
63
+ category: ThemeVariableCategory;
64
+ description: string;
65
+ defaultLight: string;
66
+ defaultDark: string;
67
+ affectedElements: string[];
68
+ introduced: number;
69
+ }
70
+ /**
71
+ * Schema changelog - documents all changes to the theme system
72
+ */
73
+ declare const THEME_SCHEMA_CHANGELOG: ThemeSchemaChange[];
74
+ /**
75
+ * Get all theme variables introduced up to a specific version
76
+ */
77
+ declare function getVariablesForVersion(version: number): ThemeVariableDoc[];
78
+ /**
79
+ * Get variables added between two schema versions
80
+ */
81
+ declare function getNewVariablesSince(fromVersion: number): ThemeSchemaChange[];
82
+ /**
83
+ * Check if a theme config is up to date
84
+ */
85
+ declare function isThemeSchemaUpToDate(schemaVersion: number | undefined): boolean;
86
+ /**
87
+ * Get all variables organized by category
88
+ */
89
+ declare function getVariablesByCategory(): Record<ThemeVariableCategory, ThemeVariableDoc[]>;
90
+ /**
91
+ * Generate a theme config snippet with defaults for new variables
92
+ */
93
+ declare function generateThemeSnippetForNewVariables(fromVersion: number, mode?: 'light' | 'dark'): string;
94
+
95
+ export { CURRENT_THEME_SCHEMA_VERSION, THEME_SCHEMA_CHANGELOG, type ThemeSchemaChange, type ThemeVariableCategory, type ThemeVariableDoc, generateThemeSnippetForNewVariables, getNewVariablesSince, getVariablesByCategory, getVariablesForVersion, isThemeSchemaUpToDate };
@@ -0,0 +1,485 @@
1
+ 'use strict';
2
+
3
+ // src/types/chatbot/theme-schema.ts
4
+ var CURRENT_THEME_SCHEMA_VERSION = 1;
5
+ var THEME_SCHEMA_CHANGELOG = [
6
+ {
7
+ version: 1,
8
+ date: "2026-01-19",
9
+ description: "Initial theme schema with core shadcn variables and Pika extensions",
10
+ addedVariables: [
11
+ // Core Colors
12
+ {
13
+ name: "primary",
14
+ category: "core",
15
+ description: "Primary brand color for buttons, links, and key actions",
16
+ defaultLight: "oklch(0.514 0.146 255.748)",
17
+ defaultDark: "oklch(0.984 0.004 248.227)",
18
+ affectedElements: ["Buttons (primary)", "Links", "Active states", "Focus rings", "Checkboxes", "Radio buttons"]
19
+ },
20
+ {
21
+ name: "primary-foreground",
22
+ category: "core",
23
+ description: "Text/icon color on primary backgrounds",
24
+ defaultLight: "oklch(0.984 0.004 248.227)",
25
+ defaultDark: "oklch(0.208 0.04 265.731)",
26
+ affectedElements: ["Text on primary buttons", "Icons on primary backgrounds"]
27
+ },
28
+ {
29
+ name: "secondary",
30
+ category: "core",
31
+ description: "Secondary actions and less prominent elements",
32
+ defaultLight: "oklch(0.968 0.007 248.084)",
33
+ defaultDark: "oklch(0.28 0.037 259.981)",
34
+ affectedElements: ["Secondary buttons", "Badges", "Tags"]
35
+ },
36
+ {
37
+ name: "secondary-foreground",
38
+ category: "core",
39
+ description: "Text on secondary backgrounds",
40
+ defaultLight: "oklch(0.514 0.146 255.748)",
41
+ defaultDark: "oklch(0.984 0.004 248.227)",
42
+ affectedElements: ["Text on secondary buttons"]
43
+ },
44
+ {
45
+ name: "destructive",
46
+ category: "core",
47
+ description: "Destructive/danger actions like delete buttons",
48
+ defaultLight: "oklch(0.577 0.215 27.311)",
49
+ defaultDark: "oklch(0.396 0.133 25.712)",
50
+ affectedElements: ["Delete buttons", "Error buttons", "Destructive actions"]
51
+ },
52
+ {
53
+ name: "destructive-foreground",
54
+ category: "core",
55
+ description: "Text on destructive backgrounds",
56
+ defaultLight: "oklch(0.984 0.004 248.227)",
57
+ defaultDark: "oklch(0.984 0.004 248.227)",
58
+ affectedElements: ["Text on delete buttons"]
59
+ },
60
+ // Surface Colors
61
+ {
62
+ name: "background",
63
+ category: "surface",
64
+ description: "Main page background",
65
+ defaultLight: "oklch(1 0 263.283)",
66
+ defaultDark: "oklch(0.137 0.036 258.532)",
67
+ affectedElements: ["Page background", "App background"]
68
+ },
69
+ {
70
+ name: "foreground",
71
+ category: "surface",
72
+ description: "Default text color on backgrounds",
73
+ defaultLight: "oklch(0.501 0 263.283)",
74
+ defaultDark: "oklch(0.984 0.004 248.227)",
75
+ affectedElements: ["Body text", "Headings", "Default text"]
76
+ },
77
+ {
78
+ name: "card",
79
+ category: "surface",
80
+ description: "Card and elevated surface backgrounds",
81
+ defaultLight: "oklch(1 0 263.283)",
82
+ defaultDark: "oklch(0.137 0.036 258.532)",
83
+ affectedElements: ["Cards", "Dialogs", "Elevated surfaces", "Dropdowns"]
84
+ },
85
+ {
86
+ name: "card-foreground",
87
+ category: "surface",
88
+ description: "Text on card backgrounds",
89
+ defaultLight: "oklch(0.137 0.036 258.532)",
90
+ defaultDark: "oklch(0.984 0.004 248.227)",
91
+ affectedElements: ["Card text", "Dialog text"]
92
+ },
93
+ {
94
+ name: "popover",
95
+ category: "surface",
96
+ description: "Popover and tooltip backgrounds",
97
+ defaultLight: "oklch(1 0 263.283)",
98
+ defaultDark: "oklch(0.137 0.036 258.532)",
99
+ affectedElements: ["Popovers", "Tooltips", "Dropdown menus"]
100
+ },
101
+ {
102
+ name: "popover-foreground",
103
+ category: "surface",
104
+ description: "Text in popovers",
105
+ defaultLight: "oklch(0.137 0.036 258.532)",
106
+ defaultDark: "oklch(0.984 0.004 248.227)",
107
+ affectedElements: ["Popover text", "Tooltip text"]
108
+ },
109
+ {
110
+ name: "muted",
111
+ category: "surface",
112
+ description: "Muted/subtle backgrounds",
113
+ defaultLight: "oklch(0.968 0.007 248.084)",
114
+ defaultDark: "oklch(0.28 0.037 259.981)",
115
+ affectedElements: ["Disabled states", "Tab backgrounds", "Code blocks"]
116
+ },
117
+ {
118
+ name: "muted-foreground",
119
+ category: "surface",
120
+ description: "Muted/secondary text",
121
+ defaultLight: "oklch(0.555 0.041 257.452)",
122
+ defaultDark: "oklch(0.711 0.035 256.803)",
123
+ affectedElements: ["Placeholder text", "Help text", "Secondary labels"]
124
+ },
125
+ {
126
+ name: "accent",
127
+ category: "surface",
128
+ description: "Accent backgrounds for highlights",
129
+ defaultLight: "oklch(0.968 0.007 248.084)",
130
+ defaultDark: "oklch(0.28 0.037 259.981)",
131
+ affectedElements: ["Hover states", "Selected rows", "Accent highlights"]
132
+ },
133
+ {
134
+ name: "accent-foreground",
135
+ category: "surface",
136
+ description: "Text on accent backgrounds",
137
+ defaultLight: "oklch(0.514 0.146 255.748)",
138
+ defaultDark: "oklch(0.984 0.004 248.227)",
139
+ affectedElements: ["Text on highlighted items"]
140
+ },
141
+ // Border & Input
142
+ {
143
+ name: "border",
144
+ category: "border",
145
+ description: "Default border color",
146
+ defaultLight: "oklch(0.929 0.013 255.585)",
147
+ defaultDark: "oklch(0.28 0.037 259.981)",
148
+ affectedElements: ["Card borders", "Table borders", "Dividers"]
149
+ },
150
+ {
151
+ name: "input",
152
+ category: "border",
153
+ description: "Input field borders",
154
+ defaultLight: "oklch(0.929 0.013 255.585)",
155
+ defaultDark: "oklch(0.28 0.037 259.981)",
156
+ affectedElements: ["Text inputs", "Textareas", "Select inputs"]
157
+ },
158
+ {
159
+ name: "ring",
160
+ category: "border",
161
+ description: "Focus ring color",
162
+ defaultLight: "oklch(0.514 0.146 255.748)",
163
+ defaultDark: "oklch(0.625 0.05 253.665)",
164
+ affectedElements: ["Focus outlines", "Keyboard navigation indicators"]
165
+ },
166
+ // Status Colors (Pika Extensions)
167
+ {
168
+ name: "success",
169
+ category: "status",
170
+ description: "Success state color",
171
+ defaultLight: "oklch(0.55 0.16 142)",
172
+ defaultDark: "oklch(0.65 0.18 142)",
173
+ affectedElements: ["Success messages", "Checkmarks", "Completed states"]
174
+ },
175
+ {
176
+ name: "success-foreground",
177
+ category: "status",
178
+ description: "Text on success backgrounds",
179
+ defaultLight: "oklch(0.985 0 0)",
180
+ defaultDark: "oklch(0.15 0.02 142)",
181
+ affectedElements: ["Text on success badges"]
182
+ },
183
+ {
184
+ name: "success-bg",
185
+ category: "status",
186
+ description: "Success background for badges/alerts",
187
+ defaultLight: "oklch(0.95 0.05 142)",
188
+ defaultDark: "oklch(0.25 0.08 142)",
189
+ affectedElements: ["Success alerts", "Success badges background"]
190
+ },
191
+ {
192
+ name: "warning",
193
+ category: "status",
194
+ description: "Warning state color",
195
+ defaultLight: "oklch(0.75 0.15 75)",
196
+ defaultDark: "oklch(0.70 0.15 75)",
197
+ affectedElements: ["Warning messages", "Caution indicators"]
198
+ },
199
+ {
200
+ name: "warning-foreground",
201
+ category: "status",
202
+ description: "Text on warning backgrounds",
203
+ defaultLight: "oklch(0.20 0.02 45)",
204
+ defaultDark: "oklch(0.15 0.02 75)",
205
+ affectedElements: ["Text on warning badges"]
206
+ },
207
+ {
208
+ name: "warning-bg",
209
+ category: "status",
210
+ description: "Warning background for badges/alerts",
211
+ defaultLight: "oklch(0.95 0.05 75)",
212
+ defaultDark: "oklch(0.25 0.08 75)",
213
+ affectedElements: ["Warning alerts", "Warning badges background"]
214
+ },
215
+ {
216
+ name: "info",
217
+ category: "status",
218
+ description: "Informational state color",
219
+ defaultLight: "oklch(0.55 0.15 250)",
220
+ defaultDark: "oklch(0.60 0.16 250)",
221
+ affectedElements: ["Info messages", "Help indicators"]
222
+ },
223
+ {
224
+ name: "info-foreground",
225
+ category: "status",
226
+ description: "Text on info backgrounds",
227
+ defaultLight: "oklch(0.985 0 0)",
228
+ defaultDark: "oklch(0.15 0.02 250)",
229
+ affectedElements: ["Text on info badges"]
230
+ },
231
+ {
232
+ name: "info-bg",
233
+ category: "status",
234
+ description: "Info background for badges/alerts",
235
+ defaultLight: "oklch(0.93 0.05 250)",
236
+ defaultDark: "oklch(0.25 0.08 250)",
237
+ affectedElements: ["Info alerts", "Info badges background"]
238
+ },
239
+ {
240
+ name: "ai",
241
+ category: "status",
242
+ description: "AI/assistant-specific color",
243
+ defaultLight: "oklch(0.55 0.2 280)",
244
+ defaultDark: "oklch(0.60 0.22 280)",
245
+ affectedElements: ["AI status indicators", "Assistant messages", "Processing states"]
246
+ },
247
+ {
248
+ name: "ai-foreground",
249
+ category: "status",
250
+ description: "Text on AI backgrounds",
251
+ defaultLight: "oklch(0.985 0 0)",
252
+ defaultDark: "oklch(0.15 0.02 280)",
253
+ affectedElements: ["Text on AI badges"]
254
+ },
255
+ {
256
+ name: "ai-bg",
257
+ category: "status",
258
+ description: "AI background for badges/indicators",
259
+ defaultLight: "oklch(0.93 0.05 280)",
260
+ defaultDark: "oklch(0.25 0.08 280)",
261
+ affectedElements: ["AI status backgrounds", "Processing indicators"]
262
+ },
263
+ {
264
+ name: "danger-bg",
265
+ category: "status",
266
+ description: "Danger/error background for alerts",
267
+ defaultLight: "oklch(0.95 0.08 25)",
268
+ defaultDark: "oklch(0.25 0.10 25)",
269
+ affectedElements: ["Error alerts", "Danger badges background"]
270
+ },
271
+ // Sidebar (for apps with sidebars)
272
+ {
273
+ name: "sidebar-background",
274
+ category: "sidebar",
275
+ description: "Sidebar background color",
276
+ defaultLight: "oklch(0.985 0 263.283)",
277
+ defaultDark: "oklch(0.21 0.006 285.819)",
278
+ affectedElements: ["Navigation sidebar background"]
279
+ },
280
+ {
281
+ name: "sidebar-foreground",
282
+ category: "sidebar",
283
+ description: "Text in sidebar",
284
+ defaultLight: "oklch(0.37 0.012 285.746)",
285
+ defaultDark: "oklch(0.968 0.001 285.04)",
286
+ affectedElements: ["Sidebar navigation text"]
287
+ },
288
+ {
289
+ name: "sidebar-primary",
290
+ category: "sidebar",
291
+ description: "Primary/selected items in sidebar",
292
+ defaultLight: "oklch(0.21 0.006 285.819)",
293
+ defaultDark: "oklch(0.488 0.217 264.393)",
294
+ affectedElements: ["Active sidebar items"]
295
+ },
296
+ {
297
+ name: "sidebar-primary-foreground",
298
+ category: "sidebar",
299
+ description: "Text on selected sidebar items",
300
+ defaultLight: "oklch(0.985 0 263.283)",
301
+ defaultDark: "oklch(1 0 263.283)",
302
+ affectedElements: ["Active sidebar item text"]
303
+ },
304
+ {
305
+ name: "sidebar-accent",
306
+ category: "sidebar",
307
+ description: "Hover state in sidebar",
308
+ defaultLight: "oklch(0.968 0.001 285.04)",
309
+ defaultDark: "oklch(0.274 0.005 285.941)",
310
+ affectedElements: ["Sidebar item hover background"]
311
+ },
312
+ {
313
+ name: "sidebar-accent-foreground",
314
+ category: "sidebar",
315
+ description: "Text on hovered sidebar items",
316
+ defaultLight: "oklch(0.21 0.006 285.819)",
317
+ defaultDark: "oklch(0.968 0.001 285.04)",
318
+ affectedElements: ["Sidebar item hover text"]
319
+ },
320
+ {
321
+ name: "sidebar-border",
322
+ category: "sidebar",
323
+ description: "Sidebar border color",
324
+ defaultLight: "oklch(0.873 0.115 95.71)",
325
+ defaultDark: "oklch(0.712 0.141 92.714)",
326
+ affectedElements: ["Sidebar dividers", "Sidebar edge border"]
327
+ },
328
+ {
329
+ name: "sidebar-ring",
330
+ category: "sidebar",
331
+ description: "Focus ring in sidebar",
332
+ defaultLight: "oklch(0.623 0.188 259.803)",
333
+ defaultDark: "oklch(0.623 0.188 259.803)",
334
+ affectedElements: ["Sidebar focus indicators"]
335
+ },
336
+ // Chart colors
337
+ {
338
+ name: "chart-1",
339
+ category: "chart",
340
+ description: "First color in chart series",
341
+ defaultLight: "oklch(0.646 0.222 41.116)",
342
+ defaultDark: "oklch(0.488 0.243 264.376)",
343
+ affectedElements: ["Chart series 1", "Primary data visualization"]
344
+ },
345
+ {
346
+ name: "chart-2",
347
+ category: "chart",
348
+ description: "Second color in chart series",
349
+ defaultLight: "oklch(0.6 0.118 184.704)",
350
+ defaultDark: "oklch(0.696 0.17 162.48)",
351
+ affectedElements: ["Chart series 2"]
352
+ },
353
+ {
354
+ name: "chart-3",
355
+ category: "chart",
356
+ description: "Third color in chart series",
357
+ defaultLight: "oklch(0.398 0.07 227.392)",
358
+ defaultDark: "oklch(0.769 0.188 70.08)",
359
+ affectedElements: ["Chart series 3"]
360
+ },
361
+ {
362
+ name: "chart-4",
363
+ category: "chart",
364
+ description: "Fourth color in chart series",
365
+ defaultLight: "oklch(0.828 0.189 84.429)",
366
+ defaultDark: "oklch(0.627 0.265 303.9)",
367
+ affectedElements: ["Chart series 4"]
368
+ },
369
+ {
370
+ name: "chart-5",
371
+ category: "chart",
372
+ description: "Fifth color in chart series",
373
+ defaultLight: "oklch(0.769 0.188 70.08)",
374
+ defaultDark: "oklch(0.645 0.246 16.439)",
375
+ affectedElements: ["Chart series 5"]
376
+ },
377
+ // Header/branding
378
+ {
379
+ name: "chat-app-icon",
380
+ category: "brand",
381
+ description: "Color of the AI icon in the chat app header",
382
+ defaultLight: "oklch(0.555 0.041 257.452)",
383
+ defaultDark: "oklch(0.711 0.035 256.803)",
384
+ affectedElements: ["Chat app header icon", "AI sparkle icon"]
385
+ },
386
+ {
387
+ name: "chat-app-header-icon-height",
388
+ category: "brand",
389
+ description: "Height of custom header icon (width scales automatically)",
390
+ defaultLight: "32px",
391
+ defaultDark: "32px",
392
+ affectedElements: ["Custom header icon in chat app title bar"]
393
+ },
394
+ {
395
+ name: "chat-app-header-icon-gap",
396
+ category: "brand",
397
+ description: "Space between custom header icon and chat app title",
398
+ defaultLight: "4px",
399
+ defaultDark: "4px",
400
+ affectedElements: ["Gap between header icon and title"]
401
+ }
402
+ ]
403
+ }
404
+ // Future versions will be added here:
405
+ // {
406
+ // version: 2,
407
+ // date: '202X-XX-XX',
408
+ // description: 'Added new variables...',
409
+ // addedVariables: [...]
410
+ // }
411
+ ];
412
+ function getVariablesForVersion(version) {
413
+ const variables = [];
414
+ for (const change of THEME_SCHEMA_CHANGELOG) {
415
+ if (change.version <= version) {
416
+ for (const v of change.addedVariables) {
417
+ variables.push({
418
+ name: v.name,
419
+ category: v.category,
420
+ description: v.description,
421
+ defaultLight: v.defaultLight,
422
+ defaultDark: v.defaultDark || v.defaultLight,
423
+ affectedElements: v.affectedElements,
424
+ introduced: change.version
425
+ });
426
+ }
427
+ }
428
+ }
429
+ return variables;
430
+ }
431
+ function getNewVariablesSince(fromVersion) {
432
+ return THEME_SCHEMA_CHANGELOG.filter((change) => change.version > fromVersion);
433
+ }
434
+ function isThemeSchemaUpToDate(schemaVersion) {
435
+ return (schemaVersion || 1) >= CURRENT_THEME_SCHEMA_VERSION;
436
+ }
437
+ function getVariablesByCategory() {
438
+ const allVars = getVariablesForVersion(CURRENT_THEME_SCHEMA_VERSION);
439
+ const byCategory = {
440
+ core: [],
441
+ surface: [],
442
+ text: [],
443
+ border: [],
444
+ status: [],
445
+ sidebar: [],
446
+ chart: [],
447
+ brand: []
448
+ };
449
+ for (const v of allVars) {
450
+ byCategory[v.category].push(v);
451
+ }
452
+ return byCategory;
453
+ }
454
+ function generateThemeSnippetForNewVariables(fromVersion, mode = "light") {
455
+ const newChanges = getNewVariablesSince(fromVersion);
456
+ if (newChanges.length === 0) {
457
+ return "// Your theme is up to date!";
458
+ }
459
+ let snippet = `// New variables added since schema version ${fromVersion}:
460
+ `;
461
+ snippet += `// Add these to your cssVariables.${mode} object if you want to customize them:
462
+
463
+ `;
464
+ for (const change of newChanges) {
465
+ snippet += `// Version ${change.version} (${change.date}): ${change.description}
466
+ `;
467
+ for (const v of change.addedVariables) {
468
+ const value = mode === "dark" && v.defaultDark ? v.defaultDark : v.defaultLight;
469
+ snippet += `'${v.name}': '${value}', // ${v.description}
470
+ `;
471
+ }
472
+ snippet += "\n";
473
+ }
474
+ return snippet;
475
+ }
476
+
477
+ exports.CURRENT_THEME_SCHEMA_VERSION = CURRENT_THEME_SCHEMA_VERSION;
478
+ exports.THEME_SCHEMA_CHANGELOG = THEME_SCHEMA_CHANGELOG;
479
+ exports.generateThemeSnippetForNewVariables = generateThemeSnippetForNewVariables;
480
+ exports.getNewVariablesSince = getNewVariablesSince;
481
+ exports.getVariablesByCategory = getVariablesByCategory;
482
+ exports.getVariablesForVersion = getVariablesForVersion;
483
+ exports.isThemeSchemaUpToDate = isThemeSchemaUpToDate;
484
+ //# sourceMappingURL=theme-schema.js.map
485
+ //# sourceMappingURL=theme-schema.js.map