@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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to the stan-design theme package will be documented in this file.
4
4
 
5
- ## [0.2.49] - 2025-10-07
5
+ ## [0.2.51] - 2025-10-08
6
6
 
7
7
  ### Added
8
8
  - Initial release of stan-design theme package
@@ -1 +1 @@
1
- {"version":3,"file":"theme-css-generator.d.ts","sourceRoot":"","sources":["../../src/plugins/theme-css-generator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAIlC,MAAM,CAAC,OAAO,UAAU,iBAAiB,IAAI,MAAM,CA0WlD"}
1
+ {"version":3,"file":"theme-css-generator.d.ts","sourceRoot":"","sources":["../../src/plugins/theme-css-generator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAIlC,MAAM,CAAC,OAAO,UAAU,iBAAiB,IAAI,MAAM,CAuTlD"}
@@ -148,10 +148,7 @@ export default function themeCSSGenerator() {
148
148
  // Use custom dark mode colors if defined
149
149
  css += generateDarkModeColors(themeObj.modes.dark.colors);
150
150
  }
151
- else {
152
- // Generate automatic dark mode by adapting colors
153
- css += generateDarkModeVariables(themeObj);
154
- }
151
+ // Note: All themes should define modes.dark.colors for proper dark mode support
155
152
  css += '}\n';
156
153
  return css;
157
154
  };
@@ -174,64 +171,6 @@ export default function themeCSSGenerator() {
174
171
  });
175
172
  return css;
176
173
  };
177
- // Generate dark mode variables by adapting light mode colors
178
- const generateDarkModeVariables = (themeObj) => {
179
- // Create a dark variant of the theme by adapting colors
180
- const darkTheme = adaptThemeForDarkMode(themeObj);
181
- // Generate CSS variables only for the properties that exist in the dark theme
182
- let css = '';
183
- if (darkTheme.colors) {
184
- // Generate CSS variables for colors
185
- Object.entries(darkTheme.colors).forEach(([colorKey, colorValue]) => {
186
- if (typeof colorValue === 'object' && colorValue !== null) {
187
- // Handle nested color objects (like surface, text, etc.)
188
- Object.entries(colorValue).forEach(([subKey, subValue]) => {
189
- if (typeof subValue === 'string' || typeof subValue === 'number') {
190
- css += ` --cs-colors-${colorKey}-${subKey}: ${subValue};\n`;
191
- }
192
- });
193
- }
194
- else if (typeof colorValue === 'string' || typeof colorValue === 'number') {
195
- // Handle direct color values
196
- css += ` --cs-colors-${colorKey}: ${colorValue};\n`;
197
- }
198
- });
199
- }
200
- // Add some basic dark mode variables for testing
201
- css += ` --cs-colors-surface-background: #0f172a;\n`;
202
- css += ` --cs-colors-surface-surface: #1e293b;\n`;
203
- css += ` --cs-colors-surface-border: #334155;\n`;
204
- css += ` --cs-colors-surface-divider: #475569;\n`;
205
- css += ` --cs-colors-text-primary: #f8fafc;\n`;
206
- css += ` --cs-colors-text-secondary: #cbd5e1;\n`;
207
- css += ` --cs-colors-text-muted: #94a3b8;\n`;
208
- return css;
209
- };
210
- // Adapt theme for dark mode
211
- const adaptThemeForDarkMode = (_themeObj) => {
212
- // This would implement your dark mode color adaptation logic
213
- // You can use the existing ColorManager or implement custom logic
214
- return {
215
- colors: {
216
- surface: {
217
- background: '#0f172a', // Dark background
218
- surface: '#1e293b', // Dark surface
219
- border: '#334155', // Dark border
220
- divider: '#475569' // Dark divider
221
- },
222
- text: {
223
- primary: '#f8fafc', // Light text
224
- secondary: '#cbd5e1', // Muted text
225
- muted: '#94a3b8', // Muted text
226
- inverse: '#0f172a', // Dark text for light backgrounds
227
- onPrimary: '#0f172a', // Text on primary color
228
- onSecondary: '#0f172a', // Text on secondary color
229
- onSurface: '#f8fafc' // Text on surface
230
- }
231
- // ... other color adaptations
232
- } // Type assertion to bypass strict typing for now
233
- };
234
- };
235
174
  // Generate CSS for all themes using structured approach
236
175
  const generateAllThemesCSS = () => {
237
176
  try {
@@ -241,23 +180,34 @@ export default function themeCSSGenerator() {
241
180
  mkdirSync(themesDir, { recursive: true });
242
181
  }
243
182
  let indexCSS = '/* Theme Index - Import all themes */\n';
244
- let defaultThemeCSS = '/* Default Theme Variables (Coach-Stan) */\n';
245
183
  // Use defaultThemes instead of hardcoded themeFiles
246
184
  for (const [themeKey, themeObj] of Object.entries(defaultThemes)) {
247
185
  try {
248
186
  // Generate CSS for this specific theme
249
187
  const themeCSS = generateSingleThemeCSS(themeObj.meta.name, themeObj);
250
- // Write individual theme file
251
- const themeFileName = `${themeKey}.css`;
252
- const themeOutputPath = resolve(themesDir, themeFileName);
253
- writeFileSync(themeOutputPath, themeCSS, 'utf-8');
254
- console.log(`✅ Generated dual-mode CSS for theme: ${themeObj.meta.name} -> ${themeFileName}`);
255
- // Add import to index file
256
- indexCSS += `@import './${themeFileName}.js';\n`;
257
- // Set stan-design theme as default
258
- if (themeKey === 'stan-design') {
259
- defaultThemeCSS += themeCSS;
188
+ // Write individual theme file (skip default theme file generation)
189
+ if (themeKey !== 'default') {
190
+ const themeFileName = `${themeKey}.css`;
191
+ const themeOutputPath = resolve(themesDir, themeFileName);
192
+ writeFileSync(themeOutputPath, themeCSS, 'utf-8');
193
+ console.log(`✅ Generated dual-mode CSS for theme: ${themeObj.meta.name} -> ${themeFileName}`);
194
+ // Add import to index file
195
+ indexCSS += `/* @import './${themeFileName}.js'; */\n`;
196
+ }
197
+ else {
198
+ // Create empty default.css file with comment
199
+ const themeFileName = `${themeKey}.css`;
200
+ const themeOutputPath = resolve(themesDir, themeFileName);
201
+ const emptyDefaultCSS = `/* Default theme CSS generation disabled - variables available via inheritance in other themes */\n`;
202
+ writeFileSync(themeOutputPath, emptyDefaultCSS, 'utf-8');
203
+ console.log(`✅ Created empty default.css file (theme variables available via inheritance)`);
204
+ // Comment out import in index
205
+ indexCSS += `/* @import './${themeFileName}.js'; */\n`;
260
206
  }
207
+ // Set stan-design theme as default for backward compatibility file (disabled)
208
+ // if (themeKey === 'stan-design') {
209
+ // defaultThemeCSS += themeCSS
210
+ // }
261
211
  }
262
212
  catch (error) {
263
213
  console.error(`❌ Error processing ${themeKey}:`, error);
@@ -266,9 +216,10 @@ export default function themeCSSGenerator() {
266
216
  // Write theme index file
267
217
  const indexPath = resolve(config.root, 'src/styles/themes/index.css');
268
218
  writeFileSync(indexPath, indexCSS, 'utf-8');
269
- // Write default theme file (for backward compatibility)
219
+ // Write empty default theme file (for backward compatibility)
270
220
  const defaultPath = resolve(config.root, 'src/styles/generated-theme-variables.css');
271
- writeFileSync(defaultPath, defaultThemeCSS, 'utf-8');
221
+ const emptyDefaultCSS = `/* Generated theme variables file disabled - theme variables available via individual theme files */\n`;
222
+ writeFileSync(defaultPath, emptyDefaultCSS, 'utf-8');
272
223
  console.log('✅ Theme CSS Generator: Generated all dual-mode theme files successfully');
273
224
  }
274
225
  catch (error) {
@@ -148,10 +148,7 @@ export default function themeCSSGenerator() {
148
148
  // Use custom dark mode colors if defined
149
149
  css += generateDarkModeColors(themeObj.modes.dark.colors);
150
150
  }
151
- else {
152
- // Generate automatic dark mode by adapting colors
153
- css += generateDarkModeVariables(themeObj);
154
- }
151
+ // Note: All themes should define modes.dark.colors for proper dark mode support
155
152
  css += '}\n';
156
153
  return css;
157
154
  };
@@ -174,64 +171,6 @@ export default function themeCSSGenerator() {
174
171
  });
175
172
  return css;
176
173
  };
177
- // Generate dark mode variables by adapting light mode colors
178
- const generateDarkModeVariables = (themeObj) => {
179
- // Create a dark variant of the theme by adapting colors
180
- const darkTheme = adaptThemeForDarkMode(themeObj);
181
- // Generate CSS variables only for the properties that exist in the dark theme
182
- let css = '';
183
- if (darkTheme.colors) {
184
- // Generate CSS variables for colors
185
- Object.entries(darkTheme.colors).forEach(([colorKey, colorValue]) => {
186
- if (typeof colorValue === 'object' && colorValue !== null) {
187
- // Handle nested color objects (like surface, text, etc.)
188
- Object.entries(colorValue).forEach(([subKey, subValue]) => {
189
- if (typeof subValue === 'string' || typeof subValue === 'number') {
190
- css += ` --cs-colors-${colorKey}-${subKey}: ${subValue};\n`;
191
- }
192
- });
193
- }
194
- else if (typeof colorValue === 'string' || typeof colorValue === 'number') {
195
- // Handle direct color values
196
- css += ` --cs-colors-${colorKey}: ${colorValue};\n`;
197
- }
198
- });
199
- }
200
- // Add some basic dark mode variables for testing
201
- css += ` --cs-colors-surface-background: #0f172a;\n`;
202
- css += ` --cs-colors-surface-surface: #1e293b;\n`;
203
- css += ` --cs-colors-surface-border: #334155;\n`;
204
- css += ` --cs-colors-surface-divider: #475569;\n`;
205
- css += ` --cs-colors-text-primary: #f8fafc;\n`;
206
- css += ` --cs-colors-text-secondary: #cbd5e1;\n`;
207
- css += ` --cs-colors-text-muted: #94a3b8;\n`;
208
- return css;
209
- };
210
- // Adapt theme for dark mode
211
- const adaptThemeForDarkMode = (_themeObj) => {
212
- // This would implement your dark mode color adaptation logic
213
- // You can use the existing ColorManager or implement custom logic
214
- return {
215
- colors: {
216
- surface: {
217
- background: '#0f172a', // Dark background
218
- surface: '#1e293b', // Dark surface
219
- border: '#334155', // Dark border
220
- divider: '#475569' // Dark divider
221
- },
222
- text: {
223
- primary: '#f8fafc', // Light text
224
- secondary: '#cbd5e1', // Muted text
225
- muted: '#94a3b8', // Muted text
226
- inverse: '#0f172a', // Dark text for light backgrounds
227
- onPrimary: '#0f172a', // Text on primary color
228
- onSecondary: '#0f172a', // Text on secondary color
229
- onSurface: '#f8fafc' // Text on surface
230
- }
231
- // ... other color adaptations
232
- } // Type assertion to bypass strict typing for now
233
- };
234
- };
235
174
  // Generate CSS for all themes using structured approach
236
175
  const generateAllThemesCSS = () => {
237
176
  try {
@@ -241,23 +180,34 @@ export default function themeCSSGenerator() {
241
180
  mkdirSync(themesDir, { recursive: true });
242
181
  }
243
182
  let indexCSS = '/* Theme Index - Import all themes */\n';
244
- let defaultThemeCSS = '/* Default Theme Variables (Coach-Stan) */\n';
245
183
  // Use defaultThemes instead of hardcoded themeFiles
246
184
  for (const [themeKey, themeObj] of Object.entries(defaultThemes)) {
247
185
  try {
248
186
  // Generate CSS for this specific theme
249
187
  const themeCSS = generateSingleThemeCSS(themeObj.meta.name, themeObj);
250
- // Write individual theme file
251
- const themeFileName = `${themeKey}.css`;
252
- const themeOutputPath = resolve(themesDir, themeFileName);
253
- writeFileSync(themeOutputPath, themeCSS, 'utf-8');
254
- console.log(`✅ Generated dual-mode CSS for theme: ${themeObj.meta.name} -> ${themeFileName}`);
255
- // Add import to index file
256
- indexCSS += `@import './${themeFileName}.js';\n`;
257
- // Set stan-design theme as default
258
- if (themeKey === 'stan-design') {
259
- defaultThemeCSS += themeCSS;
188
+ // Write individual theme file (skip default theme file generation)
189
+ if (themeKey !== 'default') {
190
+ const themeFileName = `${themeKey}.css`;
191
+ const themeOutputPath = resolve(themesDir, themeFileName);
192
+ writeFileSync(themeOutputPath, themeCSS, 'utf-8');
193
+ console.log(`✅ Generated dual-mode CSS for theme: ${themeObj.meta.name} -> ${themeFileName}`);
194
+ // Add import to index file
195
+ indexCSS += `/* @import './${themeFileName}.js'; */\n`;
196
+ }
197
+ else {
198
+ // Create empty default.css file with comment
199
+ const themeFileName = `${themeKey}.css`;
200
+ const themeOutputPath = resolve(themesDir, themeFileName);
201
+ const emptyDefaultCSS = `/* Default theme CSS generation disabled - variables available via inheritance in other themes */\n`;
202
+ writeFileSync(themeOutputPath, emptyDefaultCSS, 'utf-8');
203
+ console.log(`✅ Created empty default.css file (theme variables available via inheritance)`);
204
+ // Comment out import in index
205
+ indexCSS += `/* @import './${themeFileName}.js'; */\n`;
260
206
  }
207
+ // Set stan-design theme as default for backward compatibility file (disabled)
208
+ // if (themeKey === 'stan-design') {
209
+ // defaultThemeCSS += themeCSS
210
+ // }
261
211
  }
262
212
  catch (error) {
263
213
  console.error(`❌ Error processing ${themeKey}:`, error);
@@ -266,9 +216,10 @@ export default function themeCSSGenerator() {
266
216
  // Write theme index file
267
217
  const indexPath = resolve(config.root, 'src/styles/themes/index.css');
268
218
  writeFileSync(indexPath, indexCSS, 'utf-8');
269
- // Write default theme file (for backward compatibility)
219
+ // Write empty default theme file (for backward compatibility)
270
220
  const defaultPath = resolve(config.root, 'src/styles/generated-theme-variables.css');
271
- writeFileSync(defaultPath, defaultThemeCSS, 'utf-8');
221
+ const emptyDefaultCSS = `/* Generated theme variables file disabled - theme variables available via individual theme files */\n`;
222
+ writeFileSync(defaultPath, emptyDefaultCSS, 'utf-8');
272
223
  console.log('✅ Theme CSS Generator: Generated all dual-mode theme files successfully');
273
224
  }
274
225
  catch (error) {