@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.46 → 0.2.47
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 +16 -3
- package/dist/plugins/theme-css-generator.js +16 -3
- package/dist/styles.css +2 -4
- package/dist/themes/base-themes.d.ts +13 -8
- package/dist/themes/base-themes.d.ts.map +1 -1
- package/dist/themes/base-themes.esm.js +20 -13
- package/dist/themes/base-themes.js +20 -13
- package/dist/themes/examples/dark-theme.d.ts +4 -4
- package/dist/themes/examples/dark-theme.d.ts.map +1 -1
- package/dist/themes/examples/dark-theme.esm.js +4 -4
- package/dist/themes/examples/dark-theme.js +4 -4
- package/dist/themes/examples/minimal-theme.d.ts +1 -1
- package/dist/themes/examples/minimal-theme.d.ts.map +1 -1
- package/dist/themes/examples/minimal-theme.esm.js +2 -2
- package/dist/themes/examples/minimal-theme.js +2 -2
- package/dist/themes/index.d.ts +2 -1
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/index.esm.js +5 -3
- package/dist/themes/index.js +5 -3
- package/package.json +1 -1
- package/src/plugins/theme-css-generator.ts +22 -7
- package/src/themes/base-themes.ts +22 -13
- package/src/themes/examples/dark-theme.ts +4 -4
- package/src/themes/examples/minimal-theme.ts +2 -2
- package/src/themes/index.ts +8 -7
- package/dist/themes/themes/harvey.d.ts +0 -7
- package/dist/themes/themes/harvey.d.ts.map +0 -1
- package/dist/themes/themes/harvey.esm.js +0 -676
- package/dist/themes/themes/harvey.js +0 -676
- package/src/themes/themes/harvey.ts +0 -679
package/CHANGELOG.md
CHANGED
|
@@ -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,
|
|
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"}
|
|
@@ -83,14 +83,27 @@ export default function themeCSSGenerator() {
|
|
|
83
83
|
css += '\n';
|
|
84
84
|
return css;
|
|
85
85
|
};
|
|
86
|
+
// Helper function to check if font is Google font
|
|
87
|
+
const isFontGoogleFont = (themeObj, fontKey) => {
|
|
88
|
+
const fonts = themeObj.fonts;
|
|
89
|
+
return fonts?.[fontKey]?.source?.type === 'google';
|
|
90
|
+
};
|
|
86
91
|
// Recursively generate CSS variables from theme object
|
|
87
|
-
const generateCSSVariables = (obj, path = []) => {
|
|
92
|
+
const generateCSSVariables = (obj, path = [], rootTheme) => {
|
|
88
93
|
let css = '';
|
|
89
94
|
if (typeof obj !== 'object' || obj === null) {
|
|
90
95
|
return css;
|
|
91
96
|
}
|
|
92
97
|
Object.entries(obj).forEach(([key, value]) => {
|
|
93
98
|
const currentPath = [...path, key];
|
|
99
|
+
// Skip font file paths for Google fonts
|
|
100
|
+
if (path.length >= 3 && path[0] === 'fonts' && path[2] === 'source' && key === 'files') {
|
|
101
|
+
const fontKey = path[1];
|
|
102
|
+
if (rootTheme && isFontGoogleFont(rootTheme, fontKey)) {
|
|
103
|
+
// Skip generating CSS variables for Google font files
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
94
107
|
if (typeof value === 'string' || typeof value === 'number') {
|
|
95
108
|
// Generate CSS variable for primitive values
|
|
96
109
|
const cssVarName = createCSSVarName(currentPath);
|
|
@@ -103,7 +116,7 @@ export default function themeCSSGenerator() {
|
|
|
103
116
|
}
|
|
104
117
|
else if (typeof value === 'object' && value !== null) {
|
|
105
118
|
// Recursively process nested objects
|
|
106
|
-
css += generateCSSVariables(value, currentPath);
|
|
119
|
+
css += generateCSSVariables(value, currentPath, rootTheme);
|
|
107
120
|
}
|
|
108
121
|
});
|
|
109
122
|
return css;
|
|
@@ -126,7 +139,7 @@ export default function themeCSSGenerator() {
|
|
|
126
139
|
// NEW: Generate breakpoint variables first
|
|
127
140
|
css += generateBreakpointVariables(breakpoints);
|
|
128
141
|
// Generate all other CSS variables
|
|
129
|
-
css += generateCSSVariables(themeObj);
|
|
142
|
+
css += generateCSSVariables(themeObj, [], themeObj);
|
|
130
143
|
css += '}\n\n';
|
|
131
144
|
// Generate dark mode variables
|
|
132
145
|
css += `.dark {\n`;
|
|
@@ -83,14 +83,27 @@ export default function themeCSSGenerator() {
|
|
|
83
83
|
css += '\n';
|
|
84
84
|
return css;
|
|
85
85
|
};
|
|
86
|
+
// Helper function to check if font is Google font
|
|
87
|
+
const isFontGoogleFont = (themeObj, fontKey) => {
|
|
88
|
+
const fonts = themeObj.fonts;
|
|
89
|
+
return fonts?.[fontKey]?.source?.type === 'google';
|
|
90
|
+
};
|
|
86
91
|
// Recursively generate CSS variables from theme object
|
|
87
|
-
const generateCSSVariables = (obj, path = []) => {
|
|
92
|
+
const generateCSSVariables = (obj, path = [], rootTheme) => {
|
|
88
93
|
let css = '';
|
|
89
94
|
if (typeof obj !== 'object' || obj === null) {
|
|
90
95
|
return css;
|
|
91
96
|
}
|
|
92
97
|
Object.entries(obj).forEach(([key, value]) => {
|
|
93
98
|
const currentPath = [...path, key];
|
|
99
|
+
// Skip font file paths for Google fonts
|
|
100
|
+
if (path.length >= 3 && path[0] === 'fonts' && path[2] === 'source' && key === 'files') {
|
|
101
|
+
const fontKey = path[1];
|
|
102
|
+
if (rootTheme && isFontGoogleFont(rootTheme, fontKey)) {
|
|
103
|
+
// Skip generating CSS variables for Google font files
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
94
107
|
if (typeof value === 'string' || typeof value === 'number') {
|
|
95
108
|
// Generate CSS variable for primitive values
|
|
96
109
|
const cssVarName = createCSSVarName(currentPath);
|
|
@@ -103,7 +116,7 @@ export default function themeCSSGenerator() {
|
|
|
103
116
|
}
|
|
104
117
|
else if (typeof value === 'object' && value !== null) {
|
|
105
118
|
// Recursively process nested objects
|
|
106
|
-
css += generateCSSVariables(value, currentPath);
|
|
119
|
+
css += generateCSSVariables(value, currentPath, rootTheme);
|
|
107
120
|
}
|
|
108
121
|
});
|
|
109
122
|
return css;
|
|
@@ -126,7 +139,7 @@ export default function themeCSSGenerator() {
|
|
|
126
139
|
// NEW: Generate breakpoint variables first
|
|
127
140
|
css += generateBreakpointVariables(breakpoints);
|
|
128
141
|
// Generate all other CSS variables
|
|
129
|
-
css += generateCSSVariables(themeObj);
|
|
142
|
+
css += generateCSSVariables(themeObj, [], themeObj);
|
|
130
143
|
css += '}\n\n';
|
|
131
144
|
// Generate dark mode variables
|
|
132
145
|
css += `.dark {\n`;
|