vibe-design-system 2.8.75 → 2.8.76
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/package.json
CHANGED
|
@@ -1397,9 +1397,14 @@ function extractFoundations() {
|
|
|
1397
1397
|
if (cssChunks.length > 0) {
|
|
1398
1398
|
const css = cssChunks.join("\n");
|
|
1399
1399
|
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1400
|
+
// Collect ALL :root blocks (a file may have multiple, e.g. a small one early
|
|
1401
|
+
// and the main one inside @layer base { :root { } })
|
|
1402
|
+
const rootBlocks = [];
|
|
1403
|
+
const rootGlobalRe = /:root\s*\{([\s\S]*?)\}/g;
|
|
1404
|
+
let rootM;
|
|
1405
|
+
while ((rootM = rootGlobalRe.exec(css)) !== null) { rootBlocks.push(rootM[1]); }
|
|
1406
|
+
if (rootBlocks.length > 0) {
|
|
1407
|
+
const rootVars = parseCssVarBlock(rootBlocks.join("\n"));
|
|
1403
1408
|
for (const [name, value] of Object.entries(rootVars)) {
|
|
1404
1409
|
if (/\d+\s+\d+%/.test(value) || /\d+%/.test(value)) {
|
|
1405
1410
|
const hsl = `hsl(${value})`;
|
|
@@ -2182,9 +2182,11 @@ function buildStoryFileContent(comp) {
|
|
|
2182
2182
|
const resolvedColors = colorRaw.map(token => {
|
|
2183
2183
|
const m = token.match(/^(?:bg|text|border|ring|from|to|fill|stroke)-(.+)$/);
|
|
2184
2184
|
const key = m ? m[1] : null;
|
|
2185
|
-
|
|
2185
|
+
// Strip opacity modifier (e.g. "muted/20" → "muted") as a fallback
|
|
2186
|
+
const baseKey = key ? key.replace(/\/[\d.]+$/, "") : null;
|
|
2187
|
+
const entry = key ? (foundColors[key] || (baseKey !== key ? foundColors[baseKey] : null)) : null;
|
|
2186
2188
|
const hex = entry?.hex && /^#[0-9a-fA-F]{3,8}$/.test(entry.hex) ? entry.hex : null;
|
|
2187
|
-
return { token, hex, label: key };
|
|
2189
|
+
return { token, hex, label: baseKey || key };
|
|
2188
2190
|
});
|
|
2189
2191
|
|
|
2190
2192
|
const hasContent = resolvedColors.length > 0 || spacingRaw.length > 0 || typographyRaw.length > 0 || radiusRaw.length > 0 || animRaw.length > 0;
|