xertica-ui 1.2.0 → 1.2.1
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.
- package/bin/cli.ts +14 -3
- package/bin/generate-tokens.ts +230 -0
- package/dist/cli.js +227 -0
- package/package.json +1 -1
package/bin/cli.ts
CHANGED
|
@@ -8,6 +8,7 @@ import path from 'path';
|
|
|
8
8
|
import { fileURLToPath } from 'url';
|
|
9
9
|
import { execa } from 'execa';
|
|
10
10
|
import { colorThemes } from '../contexts/theme-data';
|
|
11
|
+
import { generateTokensCss } from './generate-tokens';
|
|
11
12
|
|
|
12
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
14
|
const __dirname = path.dirname(__filename);
|
|
@@ -194,18 +195,28 @@ export default function App() {
|
|
|
194
195
|
|
|
195
196
|
// --- Apply Selected Theme ---
|
|
196
197
|
if (response.theme) {
|
|
198
|
+
// 1. Update React Context
|
|
197
199
|
const contextPath = path.join(targetDir, 'contexts', 'BrandColorsContext.tsx');
|
|
198
200
|
if (await fs.pathExists(contextPath)) {
|
|
199
201
|
let content = await fs.readFile(contextPath, 'utf8');
|
|
200
|
-
// Replace default theme
|
|
201
|
-
// Need to match the line: return saved || 'xertica-original';
|
|
202
|
-
// We can use regex to be safe
|
|
203
202
|
content = content.replace(
|
|
204
203
|
/return saved \|\| 'xertica-original';/,
|
|
205
204
|
`return saved || '${response.theme}';`
|
|
206
205
|
);
|
|
207
206
|
await fs.writeFile(contextPath, content);
|
|
208
207
|
}
|
|
208
|
+
|
|
209
|
+
// 2. Update styles/xertica/tokens.css
|
|
210
|
+
const tokensPath = path.join(targetDir, 'styles', 'xertica', 'tokens.css');
|
|
211
|
+
const selectedTheme = colorThemes.find(t => t.id === response.theme);
|
|
212
|
+
|
|
213
|
+
if (selectedTheme) {
|
|
214
|
+
// Ensure the directory exists (it should, from copy)
|
|
215
|
+
await fs.ensureDir(path.dirname(tokensPath));
|
|
216
|
+
|
|
217
|
+
const newTokensCss = generateTokensCss(selectedTheme);
|
|
218
|
+
await fs.writeFile(tokensPath, newTokensCss);
|
|
219
|
+
}
|
|
209
220
|
}
|
|
210
221
|
|
|
211
222
|
spinner.succeed('Project initialized successfully!');
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { ColorTheme } from '../contexts/theme-data';
|
|
2
|
+
|
|
3
|
+
// Helper to convert hex to rgb values (e.g. "255, 255, 255")
|
|
4
|
+
// Accepts #RRGGBB or #RGB
|
|
5
|
+
const hexToRgbString = (hex: string): string => {
|
|
6
|
+
// Remove #
|
|
7
|
+
hex = hex.replace(/^#/, '');
|
|
8
|
+
|
|
9
|
+
// Parse
|
|
10
|
+
let r = 0, g = 0, b = 0;
|
|
11
|
+
|
|
12
|
+
if (hex.length === 3) {
|
|
13
|
+
r = parseInt(hex[0] + hex[0], 16);
|
|
14
|
+
g = parseInt(hex[1] + hex[1], 16);
|
|
15
|
+
b = parseInt(hex[2] + hex[2], 16);
|
|
16
|
+
} else if (hex.length === 6) {
|
|
17
|
+
r = parseInt(hex.substring(0, 2), 16);
|
|
18
|
+
g = parseInt(hex.substring(2, 4), 16);
|
|
19
|
+
b = parseInt(hex.substring(4, 6), 16);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return `${r}, ${g}, ${b}`;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const rgba = (hex: string, alpha: number = 1): string => {
|
|
26
|
+
return `rgba(${hexToRgbString(hex)}, ${alpha})`;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const generateTokensCss = (theme: ColorTheme): string => {
|
|
30
|
+
const { colors } = theme;
|
|
31
|
+
|
|
32
|
+
return `/* ============================================
|
|
33
|
+
🎨 TOKENS / VARIABLES (Generated by CLI)
|
|
34
|
+
============================================ */
|
|
35
|
+
|
|
36
|
+
:root,
|
|
37
|
+
:root[data-theme="default"] {
|
|
38
|
+
/* Brand Tokens - Source of Truth */
|
|
39
|
+
--xertica-primary: ${rgba(colors.primary)};
|
|
40
|
+
--xertica-dark: ${rgba(colors.sidebarDark)}; /* Approximating generic dark from sidebar dark if needed, or keeping static? */
|
|
41
|
+
|
|
42
|
+
/* Semantic Colors */
|
|
43
|
+
--background: rgba(255, 255, 255, 1);
|
|
44
|
+
--foreground: rgba(9, 9, 11, 1);
|
|
45
|
+
|
|
46
|
+
--card: rgba(255, 255, 255, 1);
|
|
47
|
+
--card-foreground: rgba(9, 9, 11, 1);
|
|
48
|
+
|
|
49
|
+
--popover: rgba(255, 255, 255, 1);
|
|
50
|
+
--popover-foreground: rgba(9, 9, 11, 1);
|
|
51
|
+
|
|
52
|
+
--primary: var(--xertica-primary);
|
|
53
|
+
--primary-foreground: ${rgba(colors.primaryForeground)};
|
|
54
|
+
--primary-light: ${rgba(colors.primary, 0.15)};
|
|
55
|
+
--primary-light-foreground: ${rgba(colors.primary)};
|
|
56
|
+
|
|
57
|
+
--secondary: rgba(244, 244, 245, 1);
|
|
58
|
+
--secondary-foreground: rgba(24, 24, 27, 1);
|
|
59
|
+
|
|
60
|
+
--muted: rgba(244, 244, 245, 1);
|
|
61
|
+
--muted-foreground: rgba(113, 113, 122, 1);
|
|
62
|
+
|
|
63
|
+
--accent: rgba(244, 244, 245, 1);
|
|
64
|
+
--accent-foreground: rgba(24, 24, 27, 1);
|
|
65
|
+
|
|
66
|
+
--destructive: rgba(239, 68, 68, 1);
|
|
67
|
+
--destructive-foreground: rgba(250, 250, 250, 1);
|
|
68
|
+
|
|
69
|
+
--border: rgba(228, 228, 231, 1);
|
|
70
|
+
--input: rgba(244, 244, 245, 0.5);
|
|
71
|
+
--input-background: rgba(244, 244, 245, 0.5);
|
|
72
|
+
--ring: ${rgba(colors.primary, 0.5)}; /* Adjusted to match brand somewhat */
|
|
73
|
+
|
|
74
|
+
/* Sidebar */
|
|
75
|
+
--sidebar: ${rgba(colors.sidebarLight)};
|
|
76
|
+
--sidebar-foreground: ${colors.sidebarLight.toLowerCase() === '#ffffff' ? 'rgba(15, 23, 42, 1)' : 'rgba(250, 250, 250, 1)'};
|
|
77
|
+
--sidebar-primary: ${colors.sidebarLight.toLowerCase() === '#ffffff' ? rgba(colors.primary) : 'rgba(255, 255, 255, 1)'};
|
|
78
|
+
--sidebar-primary-foreground: ${colors.sidebarLight.toLowerCase() === '#ffffff' ? rgba(colors.primaryForeground) : rgba(colors.primary)}; /* Actually if sidebar is dark, primary item usually white? */
|
|
79
|
+
/* Replicating logic from Context roughly or sticking to safe defaults */
|
|
80
|
+
/* Context Logic:
|
|
81
|
+
if !isSidebarLight:
|
|
82
|
+
primary: #FFFFFF
|
|
83
|
+
primaryFg: primary
|
|
84
|
+
*/
|
|
85
|
+
--sidebar-accent: ${rgba(colors.sidebarLight.toLowerCase() === '#ffffff' ? colors.primary : '#FFFFFF', 0.1)};
|
|
86
|
+
--sidebar-accent-foreground: ${colors.sidebarLight.toLowerCase() === '#ffffff' ? rgba(colors.primary) : '#FFFFFF'};
|
|
87
|
+
--sidebar-border: rgba(255, 255, 255, 0.1);
|
|
88
|
+
--sidebar-ring: ${rgba(colors.primary, 0.5)};
|
|
89
|
+
|
|
90
|
+
/* Charts */
|
|
91
|
+
--chart-1: ${rgba(colors.chart1)};
|
|
92
|
+
--chart-2: ${rgba(colors.chart2)};
|
|
93
|
+
--chart-3: ${rgba(colors.chart3)};
|
|
94
|
+
--chart-4: ${rgba(colors.chart4)};
|
|
95
|
+
--chart-5: ${rgba(colors.chart5)};
|
|
96
|
+
|
|
97
|
+
/* Gradients */
|
|
98
|
+
--gradient-diagonal: linear-gradient(135deg, ${colors.gradientStart} 0%, ${colors.gradientEnd} 100%);
|
|
99
|
+
|
|
100
|
+
/* Spacing & Radius */
|
|
101
|
+
--radius: 6px;
|
|
102
|
+
--radius-button: 12px;
|
|
103
|
+
--radius-card: 12px;
|
|
104
|
+
|
|
105
|
+
--elevation-sm: 0px 0px 48px 0px rgba(0, 0, 0, 0.1);
|
|
106
|
+
|
|
107
|
+
/* Typography */
|
|
108
|
+
--font-size: 16px;
|
|
109
|
+
--text-h1: 2rem;
|
|
110
|
+
--text-h2: 1.75rem;
|
|
111
|
+
--text-h3: 1.5rem;
|
|
112
|
+
--text-h4: 1.25rem;
|
|
113
|
+
--text-base: 1rem;
|
|
114
|
+
--text-p: 0.875rem;
|
|
115
|
+
--text-label: 0.875rem;
|
|
116
|
+
--text-small: 0.875rem;
|
|
117
|
+
--text-xs: 0.75rem;
|
|
118
|
+
--text-muted: 0.875rem;
|
|
119
|
+
--text-stats: 2.25rem;
|
|
120
|
+
--text-table-head: 1.25rem;
|
|
121
|
+
|
|
122
|
+
--font-weight-regular: 400;
|
|
123
|
+
--font-weight-medium: 500;
|
|
124
|
+
--font-weight-semibold: 600;
|
|
125
|
+
--font-weight-bold: 700;
|
|
126
|
+
--font-weight-extrabold: 800;
|
|
127
|
+
|
|
128
|
+
--spacing-1: 0.25rem;
|
|
129
|
+
--spacing-2: 0.5rem;
|
|
130
|
+
--spacing-3: 0.75rem;
|
|
131
|
+
--spacing-4: 1rem;
|
|
132
|
+
--spacing-5: 1.25rem;
|
|
133
|
+
--spacing-6: 1.5rem;
|
|
134
|
+
--spacing-8: 2rem;
|
|
135
|
+
|
|
136
|
+
/* Calendar */
|
|
137
|
+
--cell-size: 2.5rem;
|
|
138
|
+
--cell-radius: var(--radius);
|
|
139
|
+
--calendar-caption-size: 15px;
|
|
140
|
+
--calendar-weekday-size: 12px;
|
|
141
|
+
--calendar-day-size: 14px;
|
|
142
|
+
|
|
143
|
+
/* Toast - Success */
|
|
144
|
+
--toast-success-bg: rgba(220, 252, 231, 1);
|
|
145
|
+
--toast-success-border: rgba(5, 150, 105, 1);
|
|
146
|
+
--toast-success-icon: rgba(5, 150, 105, 1);
|
|
147
|
+
/* Toast - Warning */
|
|
148
|
+
--toast-warning-bg: rgba(254, 243, 199, 1);
|
|
149
|
+
--toast-warning-border: rgba(245, 158, 11, 1);
|
|
150
|
+
--toast-warning-icon: rgba(245, 158, 11, 1);
|
|
151
|
+
/* Toast - Info */
|
|
152
|
+
--toast-info-bg: rgba(219, 234, 254, 1);
|
|
153
|
+
--toast-info-border: rgba(37, 99, 235, 1);
|
|
154
|
+
--toast-info-icon: rgba(37, 99, 235, 1);
|
|
155
|
+
/* Toast - Error */
|
|
156
|
+
--toast-error-bg: rgba(254, 226, 226, 1);
|
|
157
|
+
--toast-error-border: rgba(239, 68, 68, 1);
|
|
158
|
+
--toast-error-icon: rgba(239, 68, 68, 1);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:root[data-mode="dark"],
|
|
162
|
+
.dark {
|
|
163
|
+
/* Brand Tokens */
|
|
164
|
+
--xertica-primary: ${rgba(colors.primaryDarkMode)};
|
|
165
|
+
|
|
166
|
+
/* Semantic Colors */
|
|
167
|
+
--background: rgba(5, 5, 5, 1);
|
|
168
|
+
--foreground: rgba(250, 250, 250, 1);
|
|
169
|
+
|
|
170
|
+
--card: rgba(20, 20, 22, 1);
|
|
171
|
+
--card-foreground: rgba(250, 250, 250, 1);
|
|
172
|
+
|
|
173
|
+
--popover: rgba(20, 20, 22, 1);
|
|
174
|
+
--popover-foreground: rgba(250, 250, 250, 1);
|
|
175
|
+
|
|
176
|
+
--primary-foreground: ${rgba(colors.primaryForegroundDark)};
|
|
177
|
+
--primary-light: ${rgba(colors.primaryDarkMode, 0.15)};
|
|
178
|
+
--primary-light-foreground: ${rgba(colors.primaryDarkMode)};
|
|
179
|
+
|
|
180
|
+
--secondary: rgba(39, 39, 42, 1);
|
|
181
|
+
--secondary-foreground: rgba(250, 250, 250, 1);
|
|
182
|
+
|
|
183
|
+
--muted: rgba(39, 39, 42, 1);
|
|
184
|
+
--muted-foreground: rgba(161, 161, 170, 1);
|
|
185
|
+
|
|
186
|
+
--accent: rgba(39, 39, 42, 1);
|
|
187
|
+
--accent-foreground: rgba(250, 250, 250, 1);
|
|
188
|
+
|
|
189
|
+
--destructive: rgba(239, 68, 68, 1);
|
|
190
|
+
--destructive-foreground: rgba(250, 250, 250, 1);
|
|
191
|
+
|
|
192
|
+
--border: rgba(63, 63, 70, 1);
|
|
193
|
+
--input: rgba(39, 39, 42, 0.5);
|
|
194
|
+
--input-background: rgba(39, 39, 42, 0.5);
|
|
195
|
+
--ring: ${rgba(colors.primaryDarkMode, 0.5)};
|
|
196
|
+
|
|
197
|
+
--elevation-sm: 0px 0px 48px 0px rgba(0, 0, 0, 0.3);
|
|
198
|
+
|
|
199
|
+
/* Sidebar */
|
|
200
|
+
--sidebar: ${rgba(colors.sidebarDark)};
|
|
201
|
+
--sidebar-foreground: rgba(250, 250, 250, 1);
|
|
202
|
+
--sidebar-primary: rgba(255, 255, 255, 1);
|
|
203
|
+
--sidebar-primary-foreground: ${rgba(colors.primary)}; /* Often primary brand color on dark background */
|
|
204
|
+
--sidebar-accent: rgba(63, 63, 70, 1);
|
|
205
|
+
--sidebar-accent-foreground: rgba(250, 250, 250, 1);
|
|
206
|
+
--sidebar-border: rgba(65, 61, 107, 1); /* Keeping subtle border */
|
|
207
|
+
--sidebar-ring: ${rgba(colors.primaryDarkMode, 0.5)};
|
|
208
|
+
|
|
209
|
+
/* Gradients */
|
|
210
|
+
--gradient-diagonal: linear-gradient(135deg, ${colors.gradientStartDark} 0%, ${colors.gradientEndDark} 100%);
|
|
211
|
+
|
|
212
|
+
/* Toast - Success */
|
|
213
|
+
--toast-success-bg: rgba(6, 78, 59, 1);
|
|
214
|
+
--toast-success-border: rgba(34, 197, 94, 1);
|
|
215
|
+
--toast-success-icon: rgba(34, 197, 94, 1);
|
|
216
|
+
/* Toast - Warning */
|
|
217
|
+
--toast-warning-bg: rgba(113, 63, 18, 1);
|
|
218
|
+
--toast-warning-border: rgba(251, 191, 36, 1);
|
|
219
|
+
--toast-warning-icon: rgba(251, 191, 36, 1);
|
|
220
|
+
/* Toast - Info */
|
|
221
|
+
--toast-info-bg: rgba(30, 58, 138, 1);
|
|
222
|
+
--toast-info-border: rgba(96, 165, 250, 1);
|
|
223
|
+
--toast-info-icon: rgba(96, 165, 250, 1);
|
|
224
|
+
/* Toast - Error */
|
|
225
|
+
--toast-error-bg: rgba(127, 29, 29, 1);
|
|
226
|
+
--toast-error-border: rgba(248, 113, 113, 1);
|
|
227
|
+
--toast-error-icon: rgba(248, 113, 113, 1);
|
|
228
|
+
}
|
|
229
|
+
`;
|
|
230
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -280,6 +280,226 @@ var colorThemes = [
|
|
|
280
280
|
}
|
|
281
281
|
];
|
|
282
282
|
|
|
283
|
+
// bin/generate-tokens.ts
|
|
284
|
+
var hexToRgbString = (hex) => {
|
|
285
|
+
hex = hex.replace(/^#/, "");
|
|
286
|
+
let r = 0, g = 0, b = 0;
|
|
287
|
+
if (hex.length === 3) {
|
|
288
|
+
r = parseInt(hex[0] + hex[0], 16);
|
|
289
|
+
g = parseInt(hex[1] + hex[1], 16);
|
|
290
|
+
b = parseInt(hex[2] + hex[2], 16);
|
|
291
|
+
} else if (hex.length === 6) {
|
|
292
|
+
r = parseInt(hex.substring(0, 2), 16);
|
|
293
|
+
g = parseInt(hex.substring(2, 4), 16);
|
|
294
|
+
b = parseInt(hex.substring(4, 6), 16);
|
|
295
|
+
}
|
|
296
|
+
return `${r}, ${g}, ${b}`;
|
|
297
|
+
};
|
|
298
|
+
var rgba = (hex, alpha = 1) => {
|
|
299
|
+
return `rgba(${hexToRgbString(hex)}, ${alpha})`;
|
|
300
|
+
};
|
|
301
|
+
var generateTokensCss = (theme) => {
|
|
302
|
+
const { colors } = theme;
|
|
303
|
+
return `/* ============================================
|
|
304
|
+
\u{1F3A8} TOKENS / VARIABLES (Generated by CLI)
|
|
305
|
+
============================================ */
|
|
306
|
+
|
|
307
|
+
:root,
|
|
308
|
+
:root[data-theme="default"] {
|
|
309
|
+
/* Brand Tokens - Source of Truth */
|
|
310
|
+
--xertica-primary: ${rgba(colors.primary)};
|
|
311
|
+
--xertica-dark: ${rgba(colors.sidebarDark)}; /* Approximating generic dark from sidebar dark if needed, or keeping static? */
|
|
312
|
+
|
|
313
|
+
/* Semantic Colors */
|
|
314
|
+
--background: rgba(255, 255, 255, 1);
|
|
315
|
+
--foreground: rgba(9, 9, 11, 1);
|
|
316
|
+
|
|
317
|
+
--card: rgba(255, 255, 255, 1);
|
|
318
|
+
--card-foreground: rgba(9, 9, 11, 1);
|
|
319
|
+
|
|
320
|
+
--popover: rgba(255, 255, 255, 1);
|
|
321
|
+
--popover-foreground: rgba(9, 9, 11, 1);
|
|
322
|
+
|
|
323
|
+
--primary: var(--xertica-primary);
|
|
324
|
+
--primary-foreground: ${rgba(colors.primaryForeground)};
|
|
325
|
+
--primary-light: ${rgba(colors.primary, 0.15)};
|
|
326
|
+
--primary-light-foreground: ${rgba(colors.primary)};
|
|
327
|
+
|
|
328
|
+
--secondary: rgba(244, 244, 245, 1);
|
|
329
|
+
--secondary-foreground: rgba(24, 24, 27, 1);
|
|
330
|
+
|
|
331
|
+
--muted: rgba(244, 244, 245, 1);
|
|
332
|
+
--muted-foreground: rgba(113, 113, 122, 1);
|
|
333
|
+
|
|
334
|
+
--accent: rgba(244, 244, 245, 1);
|
|
335
|
+
--accent-foreground: rgba(24, 24, 27, 1);
|
|
336
|
+
|
|
337
|
+
--destructive: rgba(239, 68, 68, 1);
|
|
338
|
+
--destructive-foreground: rgba(250, 250, 250, 1);
|
|
339
|
+
|
|
340
|
+
--border: rgba(228, 228, 231, 1);
|
|
341
|
+
--input: rgba(244, 244, 245, 0.5);
|
|
342
|
+
--input-background: rgba(244, 244, 245, 0.5);
|
|
343
|
+
--ring: ${rgba(colors.primary, 0.5)}; /* Adjusted to match brand somewhat */
|
|
344
|
+
|
|
345
|
+
/* Sidebar */
|
|
346
|
+
--sidebar: ${rgba(colors.sidebarLight)};
|
|
347
|
+
--sidebar-foreground: ${colors.sidebarLight.toLowerCase() === "#ffffff" ? "rgba(15, 23, 42, 1)" : "rgba(250, 250, 250, 1)"};
|
|
348
|
+
--sidebar-primary: ${colors.sidebarLight.toLowerCase() === "#ffffff" ? rgba(colors.primary) : "rgba(255, 255, 255, 1)"};
|
|
349
|
+
--sidebar-primary-foreground: ${colors.sidebarLight.toLowerCase() === "#ffffff" ? rgba(colors.primaryForeground) : rgba(colors.primary)}; /* Actually if sidebar is dark, primary item usually white? */
|
|
350
|
+
/* Replicating logic from Context roughly or sticking to safe defaults */
|
|
351
|
+
/* Context Logic:
|
|
352
|
+
if !isSidebarLight:
|
|
353
|
+
primary: #FFFFFF
|
|
354
|
+
primaryFg: primary
|
|
355
|
+
*/
|
|
356
|
+
--sidebar-accent: ${rgba(colors.sidebarLight.toLowerCase() === "#ffffff" ? colors.primary : "#FFFFFF", 0.1)};
|
|
357
|
+
--sidebar-accent-foreground: ${colors.sidebarLight.toLowerCase() === "#ffffff" ? rgba(colors.primary) : "#FFFFFF"};
|
|
358
|
+
--sidebar-border: rgba(255, 255, 255, 0.1);
|
|
359
|
+
--sidebar-ring: ${rgba(colors.primary, 0.5)};
|
|
360
|
+
|
|
361
|
+
/* Charts */
|
|
362
|
+
--chart-1: ${rgba(colors.chart1)};
|
|
363
|
+
--chart-2: ${rgba(colors.chart2)};
|
|
364
|
+
--chart-3: ${rgba(colors.chart3)};
|
|
365
|
+
--chart-4: ${rgba(colors.chart4)};
|
|
366
|
+
--chart-5: ${rgba(colors.chart5)};
|
|
367
|
+
|
|
368
|
+
/* Gradients */
|
|
369
|
+
--gradient-diagonal: linear-gradient(135deg, ${colors.gradientStart} 0%, ${colors.gradientEnd} 100%);
|
|
370
|
+
|
|
371
|
+
/* Spacing & Radius */
|
|
372
|
+
--radius: 6px;
|
|
373
|
+
--radius-button: 12px;
|
|
374
|
+
--radius-card: 12px;
|
|
375
|
+
|
|
376
|
+
--elevation-sm: 0px 0px 48px 0px rgba(0, 0, 0, 0.1);
|
|
377
|
+
|
|
378
|
+
/* Typography */
|
|
379
|
+
--font-size: 16px;
|
|
380
|
+
--text-h1: 2rem;
|
|
381
|
+
--text-h2: 1.75rem;
|
|
382
|
+
--text-h3: 1.5rem;
|
|
383
|
+
--text-h4: 1.25rem;
|
|
384
|
+
--text-base: 1rem;
|
|
385
|
+
--text-p: 0.875rem;
|
|
386
|
+
--text-label: 0.875rem;
|
|
387
|
+
--text-small: 0.875rem;
|
|
388
|
+
--text-xs: 0.75rem;
|
|
389
|
+
--text-muted: 0.875rem;
|
|
390
|
+
--text-stats: 2.25rem;
|
|
391
|
+
--text-table-head: 1.25rem;
|
|
392
|
+
|
|
393
|
+
--font-weight-regular: 400;
|
|
394
|
+
--font-weight-medium: 500;
|
|
395
|
+
--font-weight-semibold: 600;
|
|
396
|
+
--font-weight-bold: 700;
|
|
397
|
+
--font-weight-extrabold: 800;
|
|
398
|
+
|
|
399
|
+
--spacing-1: 0.25rem;
|
|
400
|
+
--spacing-2: 0.5rem;
|
|
401
|
+
--spacing-3: 0.75rem;
|
|
402
|
+
--spacing-4: 1rem;
|
|
403
|
+
--spacing-5: 1.25rem;
|
|
404
|
+
--spacing-6: 1.5rem;
|
|
405
|
+
--spacing-8: 2rem;
|
|
406
|
+
|
|
407
|
+
/* Calendar */
|
|
408
|
+
--cell-size: 2.5rem;
|
|
409
|
+
--cell-radius: var(--radius);
|
|
410
|
+
--calendar-caption-size: 15px;
|
|
411
|
+
--calendar-weekday-size: 12px;
|
|
412
|
+
--calendar-day-size: 14px;
|
|
413
|
+
|
|
414
|
+
/* Toast - Success */
|
|
415
|
+
--toast-success-bg: rgba(220, 252, 231, 1);
|
|
416
|
+
--toast-success-border: rgba(5, 150, 105, 1);
|
|
417
|
+
--toast-success-icon: rgba(5, 150, 105, 1);
|
|
418
|
+
/* Toast - Warning */
|
|
419
|
+
--toast-warning-bg: rgba(254, 243, 199, 1);
|
|
420
|
+
--toast-warning-border: rgba(245, 158, 11, 1);
|
|
421
|
+
--toast-warning-icon: rgba(245, 158, 11, 1);
|
|
422
|
+
/* Toast - Info */
|
|
423
|
+
--toast-info-bg: rgba(219, 234, 254, 1);
|
|
424
|
+
--toast-info-border: rgba(37, 99, 235, 1);
|
|
425
|
+
--toast-info-icon: rgba(37, 99, 235, 1);
|
|
426
|
+
/* Toast - Error */
|
|
427
|
+
--toast-error-bg: rgba(254, 226, 226, 1);
|
|
428
|
+
--toast-error-border: rgba(239, 68, 68, 1);
|
|
429
|
+
--toast-error-icon: rgba(239, 68, 68, 1);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
:root[data-mode="dark"],
|
|
433
|
+
.dark {
|
|
434
|
+
/* Brand Tokens */
|
|
435
|
+
--xertica-primary: ${rgba(colors.primaryDarkMode)};
|
|
436
|
+
|
|
437
|
+
/* Semantic Colors */
|
|
438
|
+
--background: rgba(5, 5, 5, 1);
|
|
439
|
+
--foreground: rgba(250, 250, 250, 1);
|
|
440
|
+
|
|
441
|
+
--card: rgba(20, 20, 22, 1);
|
|
442
|
+
--card-foreground: rgba(250, 250, 250, 1);
|
|
443
|
+
|
|
444
|
+
--popover: rgba(20, 20, 22, 1);
|
|
445
|
+
--popover-foreground: rgba(250, 250, 250, 1);
|
|
446
|
+
|
|
447
|
+
--primary-foreground: ${rgba(colors.primaryForegroundDark)};
|
|
448
|
+
--primary-light: ${rgba(colors.primaryDarkMode, 0.15)};
|
|
449
|
+
--primary-light-foreground: ${rgba(colors.primaryDarkMode)};
|
|
450
|
+
|
|
451
|
+
--secondary: rgba(39, 39, 42, 1);
|
|
452
|
+
--secondary-foreground: rgba(250, 250, 250, 1);
|
|
453
|
+
|
|
454
|
+
--muted: rgba(39, 39, 42, 1);
|
|
455
|
+
--muted-foreground: rgba(161, 161, 170, 1);
|
|
456
|
+
|
|
457
|
+
--accent: rgba(39, 39, 42, 1);
|
|
458
|
+
--accent-foreground: rgba(250, 250, 250, 1);
|
|
459
|
+
|
|
460
|
+
--destructive: rgba(239, 68, 68, 1);
|
|
461
|
+
--destructive-foreground: rgba(250, 250, 250, 1);
|
|
462
|
+
|
|
463
|
+
--border: rgba(63, 63, 70, 1);
|
|
464
|
+
--input: rgba(39, 39, 42, 0.5);
|
|
465
|
+
--input-background: rgba(39, 39, 42, 0.5);
|
|
466
|
+
--ring: ${rgba(colors.primaryDarkMode, 0.5)};
|
|
467
|
+
|
|
468
|
+
--elevation-sm: 0px 0px 48px 0px rgba(0, 0, 0, 0.3);
|
|
469
|
+
|
|
470
|
+
/* Sidebar */
|
|
471
|
+
--sidebar: ${rgba(colors.sidebarDark)};
|
|
472
|
+
--sidebar-foreground: rgba(250, 250, 250, 1);
|
|
473
|
+
--sidebar-primary: rgba(255, 255, 255, 1);
|
|
474
|
+
--sidebar-primary-foreground: ${rgba(colors.primary)}; /* Often primary brand color on dark background */
|
|
475
|
+
--sidebar-accent: rgba(63, 63, 70, 1);
|
|
476
|
+
--sidebar-accent-foreground: rgba(250, 250, 250, 1);
|
|
477
|
+
--sidebar-border: rgba(65, 61, 107, 1); /* Keeping subtle border */
|
|
478
|
+
--sidebar-ring: ${rgba(colors.primaryDarkMode, 0.5)};
|
|
479
|
+
|
|
480
|
+
/* Gradients */
|
|
481
|
+
--gradient-diagonal: linear-gradient(135deg, ${colors.gradientStartDark} 0%, ${colors.gradientEndDark} 100%);
|
|
482
|
+
|
|
483
|
+
/* Toast - Success */
|
|
484
|
+
--toast-success-bg: rgba(6, 78, 59, 1);
|
|
485
|
+
--toast-success-border: rgba(34, 197, 94, 1);
|
|
486
|
+
--toast-success-icon: rgba(34, 197, 94, 1);
|
|
487
|
+
/* Toast - Warning */
|
|
488
|
+
--toast-warning-bg: rgba(113, 63, 18, 1);
|
|
489
|
+
--toast-warning-border: rgba(251, 191, 36, 1);
|
|
490
|
+
--toast-warning-icon: rgba(251, 191, 36, 1);
|
|
491
|
+
/* Toast - Info */
|
|
492
|
+
--toast-info-bg: rgba(30, 58, 138, 1);
|
|
493
|
+
--toast-info-border: rgba(96, 165, 250, 1);
|
|
494
|
+
--toast-info-icon: rgba(96, 165, 250, 1);
|
|
495
|
+
/* Toast - Error */
|
|
496
|
+
--toast-error-bg: rgba(127, 29, 29, 1);
|
|
497
|
+
--toast-error-border: rgba(248, 113, 113, 1);
|
|
498
|
+
--toast-error-icon: rgba(248, 113, 113, 1);
|
|
499
|
+
}
|
|
500
|
+
`;
|
|
501
|
+
};
|
|
502
|
+
|
|
283
503
|
// bin/cli.ts
|
|
284
504
|
var __filename = fileURLToPath(import.meta.url);
|
|
285
505
|
var __dirname = path.dirname(__filename);
|
|
@@ -435,6 +655,13 @@ export default function App() {
|
|
|
435
655
|
);
|
|
436
656
|
await fs.writeFile(contextPath, content);
|
|
437
657
|
}
|
|
658
|
+
const tokensPath = path.join(targetDir, "styles", "xertica", "tokens.css");
|
|
659
|
+
const selectedTheme = colorThemes.find((t) => t.id === response.theme);
|
|
660
|
+
if (selectedTheme) {
|
|
661
|
+
await fs.ensureDir(path.dirname(tokensPath));
|
|
662
|
+
const newTokensCss = generateTokensCss(selectedTheme);
|
|
663
|
+
await fs.writeFile(tokensPath, newTokensCss);
|
|
664
|
+
}
|
|
438
665
|
}
|
|
439
666
|
spinner.succeed("Project initialized successfully!");
|
|
440
667
|
if (response.install) {
|