@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.49 → 0.2.51
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/CHANGELOG.md +1 -1
- package/dist/plugins/theme-css-generator.d.ts.map +1 -1
- package/dist/plugins/theme-css-generator.esm.js +26 -75
- package/dist/plugins/theme-css-generator.js +26 -75
- package/dist/styles.css +18765 -21490
- package/package.json +1 -1
- package/src/index.css +1 -1
- package/src/plugins/theme-css-generator.ts +30 -81
- package/src/styles/base/index.css +1 -1
- package/src/styles/base/variables.css +1 -1
- package/src/styles/components/base/button.css +7 -1
- package/src/styles/generated-theme-variables.css +1 -573
- package/src/styles/base/generated-theme-variables.css +0 -573
package/package.json
CHANGED
package/src/index.css
CHANGED
|
@@ -176,10 +176,8 @@ export default function themeCSSGenerator(): Plugin {
|
|
|
176
176
|
if (themeObj.modes?.dark?.colors && Object.keys(themeObj.modes.dark.colors).length > 0) {
|
|
177
177
|
// Use custom dark mode colors if defined
|
|
178
178
|
css += generateDarkModeColors(themeObj.modes.dark.colors)
|
|
179
|
-
} else {
|
|
180
|
-
// Generate automatic dark mode by adapting colors
|
|
181
|
-
css += generateDarkModeVariables(themeObj)
|
|
182
179
|
}
|
|
180
|
+
// Note: All themes should define modes.dark.colors for proper dark mode support
|
|
183
181
|
|
|
184
182
|
css += '}\n'
|
|
185
183
|
return css
|
|
@@ -206,68 +204,6 @@ export default function themeCSSGenerator(): Plugin {
|
|
|
206
204
|
return css
|
|
207
205
|
}
|
|
208
206
|
|
|
209
|
-
// Generate dark mode variables by adapting light mode colors
|
|
210
|
-
const generateDarkModeVariables = (themeObj: MultiThemeConfig): string => {
|
|
211
|
-
// Create a dark variant of the theme by adapting colors
|
|
212
|
-
const darkTheme = adaptThemeForDarkMode(themeObj)
|
|
213
|
-
|
|
214
|
-
// Generate CSS variables only for the properties that exist in the dark theme
|
|
215
|
-
let css = ''
|
|
216
|
-
|
|
217
|
-
if (darkTheme.colors) {
|
|
218
|
-
// Generate CSS variables for colors
|
|
219
|
-
Object.entries(darkTheme.colors).forEach(([colorKey, colorValue]) => {
|
|
220
|
-
if (typeof colorValue === 'object' && colorValue !== null) {
|
|
221
|
-
// Handle nested color objects (like surface, text, etc.)
|
|
222
|
-
Object.entries(colorValue).forEach(([subKey, subValue]) => {
|
|
223
|
-
if (typeof subValue === 'string' || typeof subValue === 'number') {
|
|
224
|
-
css += ` --cs-colors-${colorKey}-${subKey}: ${subValue};\n`
|
|
225
|
-
}
|
|
226
|
-
})
|
|
227
|
-
} else if (typeof colorValue === 'string' || typeof colorValue === 'number') {
|
|
228
|
-
// Handle direct color values
|
|
229
|
-
css += ` --cs-colors-${colorKey}: ${colorValue};\n`
|
|
230
|
-
}
|
|
231
|
-
})
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// Add some basic dark mode variables for testing
|
|
235
|
-
css += ` --cs-colors-surface-background: #0f172a;\n`
|
|
236
|
-
css += ` --cs-colors-surface-surface: #1e293b;\n`
|
|
237
|
-
css += ` --cs-colors-surface-border: #334155;\n`
|
|
238
|
-
css += ` --cs-colors-surface-divider: #475569;\n`
|
|
239
|
-
css += ` --cs-colors-text-primary: #f8fafc;\n`
|
|
240
|
-
css += ` --cs-colors-text-secondary: #cbd5e1;\n`
|
|
241
|
-
css += ` --cs-colors-text-muted: #94a3b8;\n`
|
|
242
|
-
|
|
243
|
-
return css
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// Adapt theme for dark mode
|
|
247
|
-
const adaptThemeForDarkMode = (_themeObj: MultiThemeConfig): Partial<MultiThemeConfig> => {
|
|
248
|
-
// This would implement your dark mode color adaptation logic
|
|
249
|
-
// You can use the existing ColorManager or implement custom logic
|
|
250
|
-
return {
|
|
251
|
-
colors: {
|
|
252
|
-
surface: {
|
|
253
|
-
background: '#0f172a', // Dark background
|
|
254
|
-
surface: '#1e293b', // Dark surface
|
|
255
|
-
border: '#334155', // Dark border
|
|
256
|
-
divider: '#475569' // Dark divider
|
|
257
|
-
},
|
|
258
|
-
text: {
|
|
259
|
-
primary: '#f8fafc', // Light text
|
|
260
|
-
secondary: '#cbd5e1', // Muted text
|
|
261
|
-
muted: '#94a3b8', // Muted text
|
|
262
|
-
inverse: '#0f172a', // Dark text for light backgrounds
|
|
263
|
-
onPrimary: '#0f172a', // Text on primary color
|
|
264
|
-
onSecondary: '#0f172a', // Text on secondary color
|
|
265
|
-
onSurface: '#f8fafc' // Text on surface
|
|
266
|
-
}
|
|
267
|
-
// ... other color adaptations
|
|
268
|
-
} as any // Type assertion to bypass strict typing for now
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
207
|
|
|
272
208
|
// Generate CSS for all themes using structured approach
|
|
273
209
|
const generateAllThemesCSS = () => {
|
|
@@ -279,29 +215,41 @@ export default function themeCSSGenerator(): Plugin {
|
|
|
279
215
|
}
|
|
280
216
|
|
|
281
217
|
let indexCSS = '/* Theme Index - Import all themes */\n'
|
|
282
|
-
let defaultThemeCSS = '/* Default Theme Variables (Coach-Stan) */\n'
|
|
283
218
|
|
|
284
219
|
// Use defaultThemes instead of hardcoded themeFiles
|
|
285
220
|
for (const [themeKey, themeObj] of Object.entries(defaultThemes)) {
|
|
286
221
|
try {
|
|
287
222
|
// Generate CSS for this specific theme
|
|
288
223
|
const themeCSS = generateSingleThemeCSS(themeObj.meta.name, themeObj)
|
|
289
|
-
|
|
290
|
-
// Write individual theme file
|
|
291
|
-
const themeFileName = `${themeKey}.css`
|
|
292
|
-
const themeOutputPath = resolve(themesDir, themeFileName)
|
|
293
|
-
writeFileSync(themeOutputPath, themeCSS, 'utf-8')
|
|
294
|
-
|
|
295
|
-
console.log(`✅ Generated dual-mode CSS for theme: ${themeObj.meta.name} -> ${themeFileName}`)
|
|
296
224
|
|
|
297
|
-
//
|
|
298
|
-
|
|
225
|
+
// Write individual theme file (skip default theme file generation)
|
|
226
|
+
if (themeKey !== 'default') {
|
|
227
|
+
const themeFileName = `${themeKey}.css`
|
|
228
|
+
const themeOutputPath = resolve(themesDir, themeFileName)
|
|
229
|
+
writeFileSync(themeOutputPath, themeCSS, 'utf-8')
|
|
299
230
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
231
|
+
console.log(`✅ Generated dual-mode CSS for theme: ${themeObj.meta.name} -> ${themeFileName}`)
|
|
232
|
+
|
|
233
|
+
// Add import to index file
|
|
234
|
+
indexCSS += `/* @import './${themeFileName}.js'; */\n`
|
|
235
|
+
} else {
|
|
236
|
+
// Create empty default.css file with comment
|
|
237
|
+
const themeFileName = `${themeKey}.css`
|
|
238
|
+
const themeOutputPath = resolve(themesDir, themeFileName)
|
|
239
|
+
const emptyDefaultCSS = `/* Default theme CSS generation disabled - variables available via inheritance in other themes */\n`
|
|
240
|
+
writeFileSync(themeOutputPath, emptyDefaultCSS, 'utf-8')
|
|
241
|
+
|
|
242
|
+
console.log(`✅ Created empty default.css file (theme variables available via inheritance)`)
|
|
243
|
+
|
|
244
|
+
// Comment out import in index
|
|
245
|
+
indexCSS += `/* @import './${themeFileName}.js'; */\n`
|
|
303
246
|
}
|
|
304
|
-
|
|
247
|
+
|
|
248
|
+
// Set stan-design theme as default for backward compatibility file (disabled)
|
|
249
|
+
// if (themeKey === 'stan-design') {
|
|
250
|
+
// defaultThemeCSS += themeCSS
|
|
251
|
+
// }
|
|
252
|
+
|
|
305
253
|
} catch (error) {
|
|
306
254
|
console.error(`❌ Error processing ${themeKey}:`, error)
|
|
307
255
|
}
|
|
@@ -311,9 +259,10 @@ export default function themeCSSGenerator(): Plugin {
|
|
|
311
259
|
const indexPath = resolve(config.root, 'src/styles/themes/index.css')
|
|
312
260
|
writeFileSync(indexPath, indexCSS, 'utf-8')
|
|
313
261
|
|
|
314
|
-
// Write default theme file (for backward compatibility)
|
|
262
|
+
// Write empty default theme file (for backward compatibility)
|
|
315
263
|
const defaultPath = resolve(config.root, 'src/styles/generated-theme-variables.css')
|
|
316
|
-
|
|
264
|
+
const emptyDefaultCSS = `/* Generated theme variables file disabled - theme variables available via individual theme files */\n`
|
|
265
|
+
writeFileSync(defaultPath, emptyDefaultCSS, 'utf-8')
|
|
317
266
|
|
|
318
267
|
console.log('✅ Theme CSS Generator: Generated all dual-mode theme files successfully')
|
|
319
268
|
|
|
@@ -529,7 +529,13 @@
|
|
|
529
529
|
border-color: var(--cs-modes-dark-colors-border);
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
-
|
|
532
|
+
.dark .button--variant-ghost {
|
|
533
|
+
background-color: transparent;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.dark .button--variant-ghost:hover {
|
|
537
|
+
background-color: var(--cs-modes-dark-colors-interactive-hover);
|
|
538
|
+
}
|
|
533
539
|
|
|
534
540
|
.dark .button--variant-destructive {
|
|
535
541
|
background-color: var(--cs-modes-dark-colors-semantic-error);
|