vibe-design-system 2.8.14 → 2.8.18
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
|
@@ -1273,6 +1273,39 @@ function extractFoundations() {
|
|
|
1273
1273
|
if (!typography[key]) typography[key] = val;
|
|
1274
1274
|
}
|
|
1275
1275
|
|
|
1276
|
+
// ── Type Scale: extract --text-* font sizes + line-heights from compiled CSS
|
|
1277
|
+
const textSteps = ["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"];
|
|
1278
|
+
const textSizes = {};
|
|
1279
|
+
const textLineHeights = {};
|
|
1280
|
+
const textSizeRe = new RegExp(`--text-(${textSteps.join("|")})\\s*:\\s*([^;\\n]+);`, "g");
|
|
1281
|
+
const textLhRe = new RegExp(`--text-(${textSteps.join("|")})--line-height\\s*:\\s*([^;\\n]+);`, "g");
|
|
1282
|
+
let tsm;
|
|
1283
|
+
while ((tsm = textSizeRe.exec(css)) !== null) {
|
|
1284
|
+
// Normalize ".75rem" → "0.75rem"
|
|
1285
|
+
const raw = tsm[2].trim();
|
|
1286
|
+
textSizes[tsm[1]] = raw.startsWith(".") ? "0" + raw : raw;
|
|
1287
|
+
}
|
|
1288
|
+
while ((tsm = textLhRe.exec(css)) !== null) {
|
|
1289
|
+
const raw = tsm[2].trim();
|
|
1290
|
+
// Resolve calc(a / b) → rounded ratio string
|
|
1291
|
+
const calcM = raw.match(/calc\(([\d.]+)\s*\/\s*([\d.]+)\)/);
|
|
1292
|
+
if (calcM) {
|
|
1293
|
+
const ratio = parseFloat(calcM[1]) / parseFloat(calcM[2]);
|
|
1294
|
+
textLineHeights[tsm[1]] = (Math.round(ratio * 1000) / 1000) + "";
|
|
1295
|
+
} else {
|
|
1296
|
+
textLineHeights[tsm[1]] = raw;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
const typeScale = textSteps
|
|
1300
|
+
.filter((step) => textSizes[step])
|
|
1301
|
+
.map((step) => {
|
|
1302
|
+
const size = textSizes[step];
|
|
1303
|
+
const pxM = size.match(/^([\d.]+)rem$/);
|
|
1304
|
+
const px = pxM ? Math.round(parseFloat(pxM[1]) * 16) + "px" : null;
|
|
1305
|
+
return { step, size, px, lineHeight: textLineHeights[step] || null };
|
|
1306
|
+
});
|
|
1307
|
+
if (typeScale.length > 0) typography.typeScale = typeScale;
|
|
1308
|
+
|
|
1276
1309
|
// Tailwind v4: extract design tokens from @layer theme { :root { ... } } or bare :root
|
|
1277
1310
|
// Variables: --spacing (base), --radius-*, --shadow-*, --ease-*, --duration-*, --animate-*
|
|
1278
1311
|
const v4ThemeVars = {};
|
|
@@ -1696,6 +1729,9 @@ function extractTokenUsage() {
|
|
|
1696
1729
|
const zIndexCounts = new Map();
|
|
1697
1730
|
const radiusCounts = new Map();
|
|
1698
1731
|
const animateCounts = new Map();
|
|
1732
|
+
const textSizeCounts = new Map();
|
|
1733
|
+
// Per-file tracking: token → Map<componentName, count>
|
|
1734
|
+
const textSizeFiles = new Map();
|
|
1699
1735
|
|
|
1700
1736
|
// Spacing utilities: gap-*, p-*, px-*, py-*, pt-*, pb-*, pl-*, pr-*, m-*, mx-*, my-*, mt-*, mb-*, ml-*, mr-*, space-*, w-*, h-*
|
|
1701
1737
|
const spacingRe = /\b(gap|p|px|py|pt|pb|pl|pr|m|mx|my|mt|mb|ml|mr|space-x|space-y|w|h|size|inset|top|bottom|left|right|min-w|min-h|max-w|max-h)-((?:\d+(\.\d+)?|px|full|screen|auto|fit|max|min|svh|dvh|svw|dvw))\b/g;
|
|
@@ -1707,6 +1743,8 @@ function extractTokenUsage() {
|
|
|
1707
1743
|
const roundedRe = /\brounded(?:-(none|sm|md|lg|xl|2xl|3xl|full|t|r|b|l|tl|tr|br|bl|s|e|ss|se|es|ee|[a-z]+(?:-(?:none|sm|md|lg|xl|2xl|3xl|full))?))?(?!\w)/g;
|
|
1708
1744
|
// Animate utilities: animate-spin, animate-ping, animate-pulse, animate-bounce, animate-none
|
|
1709
1745
|
const animateRe = /\banimate-(spin|ping|pulse|bounce|none|[\w-]+)\b/g;
|
|
1746
|
+
// Text-size utilities: text-xs, text-sm, text-base, text-lg, text-xl, text-2xl, text-3xl...
|
|
1747
|
+
const textSizeUtilRe = /\btext-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)\b/g;
|
|
1710
1748
|
|
|
1711
1749
|
for (const rel of files) {
|
|
1712
1750
|
if (rel.includes("stories")) continue;
|
|
@@ -1755,6 +1793,18 @@ function extractTokenUsage() {
|
|
|
1755
1793
|
const key = `animate-${m[1]}`;
|
|
1756
1794
|
animateCounts.set(key, (animateCounts.get(key) || 0) + 1);
|
|
1757
1795
|
}
|
|
1796
|
+
|
|
1797
|
+
// Text sizes — global count + per-component breakdown
|
|
1798
|
+
const componentName = path.basename(rel).replace(/\.(tsx|jsx|ts|js)$/, "");
|
|
1799
|
+
const textSizeUtilReCopy = new RegExp(textSizeUtilRe.source, "g");
|
|
1800
|
+
while ((m = textSizeUtilReCopy.exec(content)) !== null) {
|
|
1801
|
+
const key = `text-${m[1]}`;
|
|
1802
|
+
textSizeCounts.set(key, (textSizeCounts.get(key) || 0) + 1);
|
|
1803
|
+
// Per-file
|
|
1804
|
+
if (!textSizeFiles.has(key)) textSizeFiles.set(key, new Map());
|
|
1805
|
+
const fm = textSizeFiles.get(key);
|
|
1806
|
+
fm.set(componentName, (fm.get(componentName) || 0) + 1);
|
|
1807
|
+
}
|
|
1758
1808
|
}
|
|
1759
1809
|
|
|
1760
1810
|
const toTop = (map, n) =>
|
|
@@ -1769,6 +1819,15 @@ function extractTokenUsage() {
|
|
|
1769
1819
|
zIndex: toTop(zIndexCounts, 10),
|
|
1770
1820
|
radius: toTop(radiusCounts, 10),
|
|
1771
1821
|
animations: toTop(animateCounts, 8),
|
|
1822
|
+
textSizes: toTop(textSizeCounts, 12).map(({ token, count }) => ({
|
|
1823
|
+
token,
|
|
1824
|
+
count,
|
|
1825
|
+
// Top 5 components that use this text size most
|
|
1826
|
+
topFiles: [...(textSizeFiles.get(token) || new Map()).entries()]
|
|
1827
|
+
.sort((a, b) => b[1] - a[1])
|
|
1828
|
+
.slice(0, 5)
|
|
1829
|
+
.map(([name]) => name),
|
|
1830
|
+
})),
|
|
1772
1831
|
};
|
|
1773
1832
|
}
|
|
1774
1833
|
|
|
@@ -1288,40 +1288,147 @@ function writeFoundationsStories(foundations) {
|
|
|
1288
1288
|
fs.writeFileSync(path.join(foundationsDir, "Colors.stories.tsx"), colorsContent, "utf-8");
|
|
1289
1289
|
console.log("[VDS] Wrote " + path.relative(PROJECT_ROOT, path.join(foundationsDir, "Colors.stories.tsx")));
|
|
1290
1290
|
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
const
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
const
|
|
1300
|
-
[
|
|
1301
|
-
|
|
1302
|
-
"",
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1291
|
+
{
|
|
1292
|
+
const typo = foundations?.typography || {};
|
|
1293
|
+
const typeScale = Array.isArray(typo.typeScale) ? typo.typeScale : [];
|
|
1294
|
+
const usedTextSizes = (foundations?.tokenUsage?.textSizes || []);
|
|
1295
|
+
const usedTextMap = Object.fromEntries(usedTextSizes.map(({ token, count }) => [token, count]));
|
|
1296
|
+
|
|
1297
|
+
// Font families
|
|
1298
|
+
const fontFamilyKeys = ["fontSans", "fontMono", "body", "heading", "tailwindSans", "tailwindMono"];
|
|
1299
|
+
const familyRows = Object.entries(typo)
|
|
1300
|
+
.filter(([k]) => fontFamilyKeys.includes(k) || k.toLowerCase().includes("font") && !k.toLowerCase().includes("weight") && k !== "typeScale" && k !== "fontSize")
|
|
1301
|
+
.map(([k, v]) => {
|
|
1302
|
+
const val = typeof v === "object" && v !== null ? (v.family || v.value || "") : Array.isArray(v) ? v.join(", ") : String(v);
|
|
1303
|
+
return { token: k, value: val };
|
|
1304
|
+
})
|
|
1305
|
+
.filter((r) => r.value);
|
|
1306
|
+
|
|
1307
|
+
// Font weights
|
|
1308
|
+
const weightKeys = ["fontWeightNormal", "fontWeightMedium", "fontWeightSemibold", "fontWeightBold"];
|
|
1309
|
+
const weightRows = weightKeys
|
|
1310
|
+
.filter((k) => typo[k])
|
|
1311
|
+
.map((k) => ({ token: k, value: String(typo[k]) }));
|
|
1312
|
+
|
|
1313
|
+
// Reverse type scale for display (largest first)
|
|
1314
|
+
const scaleDesc = [...typeScale].reverse();
|
|
1315
|
+
|
|
1316
|
+
const sansFamily = typo.fontSans || typo.tailwindSans || typo.body || "system-ui, sans-serif";
|
|
1317
|
+
|
|
1318
|
+
const typoContent = [
|
|
1319
|
+
"import type { Meta, StoryObj } from \"@storybook/react\";",
|
|
1320
|
+
"",
|
|
1321
|
+
"const meta = { title: \"Foundations/Typography\" } satisfies Meta;",
|
|
1322
|
+
"export default meta;",
|
|
1323
|
+
"type Story = StoryObj;",
|
|
1324
|
+
"",
|
|
1325
|
+
`const typeScale: { step: string; size: string; px: string | null; lineHeight: string | null }[] = ${JSON.stringify(scaleDesc)};`,
|
|
1326
|
+
`const usedTextSizes: { token: string; count: number }[] = ${JSON.stringify(usedTextSizes)};`,
|
|
1327
|
+
`const familyRows: { token: string; value: string }[] = ${JSON.stringify(familyRows)};`,
|
|
1328
|
+
`const weightRows: { token: string; value: string }[] = ${JSON.stringify(weightRows)};`,
|
|
1329
|
+
`const sansFamily = ${JSON.stringify(sansFamily)};`,
|
|
1330
|
+
"",
|
|
1331
|
+
"export const Default: Story = {",
|
|
1332
|
+
" render: () => (",
|
|
1333
|
+
" <div style={{ fontFamily: \"system-ui,sans-serif\", padding: 32, maxWidth: 860, color: \"#111\" }}>",
|
|
1334
|
+
" <h2 style={{ fontSize: 20, fontWeight: 700, margin: \"0 0 4px\" }}>Typography</h2>",
|
|
1335
|
+
" <p style={{ fontSize: 13, color: \"#888\", margin: \"0 0 32px\" }}>Type scale, font families, and weights</p>",
|
|
1336
|
+
"",
|
|
1337
|
+
" {/* ── TYPE SCALE ── */}",
|
|
1338
|
+
" <h3 style={{ fontSize: 15, fontWeight: 600, margin: \"0 0 14px\", color: \"#374151\" }}>Type Scale</h3>",
|
|
1339
|
+
" {usedTextSizes.length > 0 && (",
|
|
1340
|
+
" <div style={{ marginBottom: 16 }}>",
|
|
1341
|
+
" <p style={{ fontSize: 12, color: \"#6b7280\", margin: \"0 0 8px\", fontWeight: 500 }}>Most used in this project</p>",
|
|
1342
|
+
" <div style={{ display: \"flex\", flexWrap: \"wrap\", gap: 6 }}>",
|
|
1343
|
+
" {usedTextSizes.map(({ token, count }) => (",
|
|
1344
|
+
" <span key={token} style={{ padding: \"3px 10px\", background: \"#ede9fe\", color: \"#5b21b6\", borderRadius: 20, fontSize: 12, fontWeight: 500 }}>",
|
|
1345
|
+
" {token} <span style={{ opacity: 0.6 }}>×{count}</span>",
|
|
1346
|
+
" </span>",
|
|
1347
|
+
" ))}",
|
|
1348
|
+
" </div>",
|
|
1349
|
+
" </div>",
|
|
1350
|
+
" )}",
|
|
1351
|
+
" {typeScale.length === 0 ? (",
|
|
1352
|
+
" <p style={{ color: \"#999\", fontSize: 13, marginBottom: 32 }}>No type scale detected.</p>",
|
|
1353
|
+
" ) : (",
|
|
1354
|
+
" <div style={{ display: \"flex\", flexDirection: \"column\", gap: 0, marginBottom: 48, border: \"1px solid #e5e7eb\", borderRadius: 10, overflow: \"hidden\" }}>",
|
|
1355
|
+
" {typeScale.map(({ step, size, px, lineHeight }, i) => {",
|
|
1356
|
+
" const usage = usedTextSizes.find(u => u.token === `text-${step}`);",
|
|
1357
|
+
" const usageCount = usage?.count;",
|
|
1358
|
+
" const topFiles = usage?.topFiles || [];",
|
|
1359
|
+
" return (",
|
|
1360
|
+
" <div key={step} style={{ display: \"flex\", flexDirection: \"column\", padding: \"14px 20px\", background: i % 2 === 0 ? \"#fff\" : \"#f9fafb\", borderTop: i === 0 ? \"none\" : \"1px solid #f0f0f0\" }}>",
|
|
1361
|
+
" <div style={{ display: \"flex\", alignItems: \"center\", gap: 20 }}>",
|
|
1362
|
+
" <div style={{ width: 140, flexShrink: 0 }}>",
|
|
1363
|
+
" <div style={{ display: \"flex\", alignItems: \"center\", gap: 8 }}>",
|
|
1364
|
+
" <code style={{ fontSize: 12, fontWeight: 600, color: \"var(--color-primary, #6366f1)\", background: \"color-mix(in srgb, var(--color-primary, #6366f1) 12%, white)\", padding: \"2px 7px\", borderRadius: 4 }}>text-{step}</code>",
|
|
1365
|
+
" {usageCount && <span style={{ fontSize: 11, color: \"#9ca3af\" }}>×{usageCount}</span>}",
|
|
1366
|
+
" </div>",
|
|
1367
|
+
" <div style={{ fontSize: 11, color: \"#9ca3af\", marginTop: 4 }}>",
|
|
1368
|
+
" {size}{px && px !== size ? ` · ${px}` : \"\"}",
|
|
1369
|
+
" {lineHeight ? <span style={{ marginLeft: 8 }}>lh {lineHeight}</span> : null}",
|
|
1370
|
+
" </div>",
|
|
1371
|
+
" </div>",
|
|
1372
|
+
" <div style={{ fontSize: size, fontFamily: sansFamily, color: \"#111\", lineHeight: lineHeight || 1.5, overflow: \"hidden\", whiteSpace: \"nowrap\", textOverflow: \"ellipsis\", flex: 1 }}>",
|
|
1373
|
+
" The quick brown fox jumps over the lazy dog",
|
|
1374
|
+
" </div>",
|
|
1375
|
+
" </div>",
|
|
1376
|
+
" {topFiles.length > 0 && (",
|
|
1377
|
+
" <div style={{ display: \"flex\", flexWrap: \"wrap\", gap: 5, marginTop: 8, paddingLeft: 0 }}>",
|
|
1378
|
+
" {topFiles.map((name: string) => (",
|
|
1379
|
+
" <span key={name} style={{ fontSize: 10, background: \"#f0f9ff\", color: \"#0369a1\", padding: \"2px 8px\", borderRadius: 3, border: \"1px solid #bae6fd\", fontFamily: \"monospace\" }}>",
|
|
1380
|
+
" {name}",
|
|
1381
|
+
" </span>",
|
|
1382
|
+
" ))}",
|
|
1383
|
+
" </div>",
|
|
1384
|
+
" )}",
|
|
1385
|
+
" </div>",
|
|
1386
|
+
" );",
|
|
1387
|
+
" })}",
|
|
1388
|
+
" </div>",
|
|
1389
|
+
" )}",
|
|
1390
|
+
"",
|
|
1391
|
+
" {/* ── FONT FAMILIES ── */}",
|
|
1392
|
+
" {familyRows.length > 0 && (",
|
|
1393
|
+
" <>",
|
|
1394
|
+
" <h3 style={{ fontSize: 15, fontWeight: 600, margin: \"0 0 14px\", color: \"#374151\" }}>Font Families</h3>",
|
|
1395
|
+
" <div style={{ display: \"flex\", flexDirection: \"column\", gap: 16, marginBottom: 40 }}>",
|
|
1396
|
+
" {familyRows.map(({ token, value }) => (",
|
|
1397
|
+
" <div key={token} style={{ padding: \"12px 16px\", background: \"#f8fafc\", borderRadius: 8, border: \"1px solid #e5e7eb\" }}>",
|
|
1398
|
+
" <div style={{ display: \"flex\", gap: 12, alignItems: \"baseline\", marginBottom: 6 }}>",
|
|
1399
|
+
" <span style={{ fontSize: 12, fontWeight: 600, color: \"#374151\", minWidth: 140 }}>{token}</span>",
|
|
1400
|
+
" <code style={{ fontSize: 11, color: \"#9ca3af\", wordBreak: \"break-all\" as any }}>{value.length > 60 ? value.slice(0, 60) + \"…\" : value}</code>",
|
|
1401
|
+
" </div>",
|
|
1402
|
+
" <div style={{ fontFamily: value, fontSize: 18, color: \"#374151\", letterSpacing: \"-0.01em\" }}>",
|
|
1403
|
+
" Aa — The quick brown fox jumps over the lazy dog.",
|
|
1404
|
+
" </div>",
|
|
1405
|
+
" </div>",
|
|
1406
|
+
" ))}",
|
|
1407
|
+
" </div>",
|
|
1408
|
+
" </>",
|
|
1409
|
+
" )}",
|
|
1410
|
+
"",
|
|
1411
|
+
" {/* ── FONT WEIGHTS ── */}",
|
|
1412
|
+
" {weightRows.length > 0 && (",
|
|
1413
|
+
" <>",
|
|
1414
|
+
" <h3 style={{ fontSize: 15, fontWeight: 600, margin: \"0 0 14px\", color: \"#374151\" }}>Font Weights</h3>",
|
|
1415
|
+
" <div style={{ display: \"flex\", flexDirection: \"column\", gap: 10, marginBottom: 40, maxWidth: 560 }}>",
|
|
1416
|
+
" {weightRows.map(({ token, value }) => (",
|
|
1417
|
+
" <div key={token} style={{ display: \"flex\", alignItems: \"baseline\", gap: 16, padding: \"8px 0\", borderBottom: \"1px solid #f0f0f0\" }}>",
|
|
1418
|
+
" <code style={{ width: 64, fontSize: 11, color: \"#9ca3af\", flexShrink: 0 }}>{value}</code>",
|
|
1419
|
+
" <span style={{ fontSize: 11, color: \"#9ca3af\", width: 120, flexShrink: 0 }}>{token}</span>",
|
|
1420
|
+
" <span style={{ fontFamily: sansFamily, fontSize: 17, fontWeight: parseInt(value) || value as any }}>",
|
|
1421
|
+
" The quick brown fox",
|
|
1422
|
+
" </span>",
|
|
1423
|
+
" </div>",
|
|
1424
|
+
" ))}",
|
|
1425
|
+
" </div>",
|
|
1426
|
+
" </>",
|
|
1427
|
+
" )}",
|
|
1428
|
+
" </div>",
|
|
1429
|
+
" ),",
|
|
1430
|
+
"};",
|
|
1431
|
+
].join("\n");
|
|
1325
1432
|
fs.writeFileSync(path.join(foundationsDir, "Typography.stories.tsx"), typoContent, "utf-8");
|
|
1326
1433
|
console.log("[VDS] Wrote " + path.relative(PROJECT_ROOT, path.join(foundationsDir, "Typography.stories.tsx")));
|
|
1327
1434
|
}
|
|
@@ -1511,7 +1618,7 @@ function writeFoundationsStories(foundations) {
|
|
|
1511
1618
|
" {spacingTokens.map(({ token, label, barWidth }) => (",
|
|
1512
1619
|
" <div key={token} style={{ display: \"flex\", alignItems: \"center\", gap: 10, minHeight: 24 }}>",
|
|
1513
1620
|
" <span style={{ width: 40, fontSize: 11, color: \"#9ca3af\", textAlign: \"right\", flexShrink: 0, fontVariantNumeric: \"tabular-nums\" }}>{token}</span>",
|
|
1514
|
-
" <div style={{ width: Math.max(barWidth, 2), height: 16, background: barWidth === 0 ? \"transparent\" : \"
|
|
1621
|
+
" <div style={{ width: Math.max(barWidth, 2), height: 16, background: barWidth === 0 ? \"transparent\" : \"var(--color-primary, #6366f1)\", opacity: barWidth === 0 ? 1 : 0.85, borderRadius: 3, flexShrink: 0, border: barWidth === 0 ? \"1px dashed #555\" : \"none\", boxSizing: \"border-box\" as any }} />",
|
|
1515
1622
|
" <code style={{ fontSize: 11, color: \"#6b7280\" }}>{label}</code>",
|
|
1516
1623
|
" </div>",
|
|
1517
1624
|
" ))}",
|
|
@@ -1576,7 +1683,8 @@ function writeFoundationsStories(foundations) {
|
|
|
1576
1683
|
"shadow-2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
1577
1684
|
};
|
|
1578
1685
|
// If token CSS values available use those; otherwise use defaults keyed by used token names
|
|
1579
|
-
const
|
|
1686
|
+
const hasCustomShadows = shadowRows.length > 0;
|
|
1687
|
+
const shadowDisplayRows = hasCustomShadows
|
|
1580
1688
|
? shadowRows
|
|
1581
1689
|
: usedShadows.map(({ token }) => ({ token, value: shadowDefaults[token] || "" })).filter((r) => r.value);
|
|
1582
1690
|
|
|
@@ -1594,6 +1702,7 @@ function writeFoundationsStories(foundations) {
|
|
|
1594
1702
|
`const usedShadows: { token: string; count: number }[] = ${JSON.stringify(usedShadows)};`,
|
|
1595
1703
|
`const usedZIndex: { token: string; count: number }[] = ${JSON.stringify(usedZIndex)};`,
|
|
1596
1704
|
`const zSemantics: Record<string, string> = ${JSON.stringify(zIndexSemantics)};`,
|
|
1705
|
+
`const hasCustomShadows: boolean = ${hasCustomShadows};`,
|
|
1597
1706
|
"",
|
|
1598
1707
|
"export const Default: Story = {",
|
|
1599
1708
|
" render: () => (",
|
|
@@ -1610,14 +1719,22 @@ function writeFoundationsStories(foundations) {
|
|
|
1610
1719
|
" ))}",
|
|
1611
1720
|
" </div>",
|
|
1612
1721
|
" )}",
|
|
1722
|
+
" {!hasCustomShadows && shadowTokens.length > 0 && (",
|
|
1723
|
+
" <p style={{ fontSize: 12, color: \"#92400e\", background: \"#fef3c7\", border: \"1px solid #fde68a\", borderRadius: 6, padding: \"6px 12px\", marginBottom: 16, display: \"inline-block\" }}>",
|
|
1724
|
+
" ℹ️ Tailwind built-in shadows — this project has no custom <code>--shadow-*</code> CSS vars",
|
|
1725
|
+
" </p>",
|
|
1726
|
+
" )}",
|
|
1613
1727
|
" {shadowTokens.length === 0 ? (",
|
|
1614
1728
|
" <p style={{ color: \"#999\", fontSize: 13, marginBottom: 32 }}>No shadow tokens detected.</p>",
|
|
1615
1729
|
" ) : (",
|
|
1616
|
-
" <div style={{ display: \"flex\", flexWrap: \"wrap\", gap:
|
|
1730
|
+
" <div style={{ display: \"flex\", flexWrap: \"wrap\", gap: 28, marginBottom: 48 }}>",
|
|
1617
1731
|
" {shadowTokens.map(({ token, value }) => (",
|
|
1618
|
-
" <div key={token} style={{ display: \"flex\", flexDirection: \"column\", alignItems: \"center\", gap:
|
|
1619
|
-
" <div style={{ width: 80, height:
|
|
1620
|
-
" <span style={{ fontSize: 12, fontWeight: 600, color: \"#374151\" }}>{token === \"DEFAULT\" ? \"default\" : token}</span>",
|
|
1732
|
+
" <div key={token} style={{ display: \"flex\", flexDirection: \"column\", alignItems: \"center\", gap: 8, maxWidth: 100 }}>",
|
|
1733
|
+
" <div style={{ width: 80, height: 72, background: \"#fff\", borderRadius: 10, boxShadow: value, border: token === \"none\" ? \"1px dashed #ccc\" : \"none\", flexShrink: 0 }} />",
|
|
1734
|
+
" <span style={{ fontSize: 12, fontWeight: 600, color: \"#374151\", textAlign: \"center\" }}>{token === \"DEFAULT\" ? \"default\" : token}</span>",
|
|
1735
|
+
" <code style={{ fontSize: 10, color: \"#9ca3af\", textAlign: \"center\", wordBreak: \"break-all\" as any, lineHeight: 1.4 }}>",
|
|
1736
|
+
" {value.length > 36 ? value.slice(0, 36) + \"…\" : value}",
|
|
1737
|
+
" </code>",
|
|
1621
1738
|
" </div>",
|
|
1622
1739
|
" ))}",
|
|
1623
1740
|
" </div>",
|
|
@@ -1638,7 +1755,7 @@ function writeFoundationsStories(foundations) {
|
|
|
1638
1755
|
" <div style={{ display: \"flex\", flexDirection: \"column\", gap: 6, maxWidth: 380 }}>",
|
|
1639
1756
|
" {zIndexTokens.map(({ token, value, label }) => (",
|
|
1640
1757
|
" <div key={token} style={{ display: \"flex\", alignItems: \"center\", gap: 12, padding: \"8px 14px\", background: \"#fff\", borderRadius: 8, border: \"1px solid #e5e7eb\" }}>",
|
|
1641
|
-
" <span style={{ width: 36, fontSize: 15, fontWeight: 700, color: \"#6366f1\", textAlign: \"right\", flexShrink: 0, fontVariantNumeric: \"tabular-nums\" }}>{value}</span>",
|
|
1758
|
+
" <span style={{ width: 36, fontSize: 15, fontWeight: 700, color: \"var(--color-primary, #6366f1)\", textAlign: \"right\", flexShrink: 0, fontVariantNumeric: \"tabular-nums\" }}>{value}</span>",
|
|
1642
1759
|
" <div>",
|
|
1643
1760
|
" <span style={{ fontSize: 12, fontWeight: 600 }}>{token}</span>",
|
|
1644
1761
|
" {label ? <span style={{ fontSize: 11, color: \"#9ca3af\", marginLeft: 8 }}>{label}</span> : null}",
|
|
@@ -1650,7 +1767,7 @@ function writeFoundationsStories(foundations) {
|
|
|
1650
1767
|
" <div style={{ display: \"flex\", flexDirection: \"column\", gap: 6, maxWidth: 380 }}>",
|
|
1651
1768
|
" {usedZIndex.map(({ token, count }) => (",
|
|
1652
1769
|
" <div key={token} style={{ display: \"flex\", alignItems: \"center\", gap: 12, padding: \"8px 14px\", background: \"#fff\", borderRadius: 8, border: \"1px solid #e5e7eb\" }}>",
|
|
1653
|
-
" <span style={{ width: 36, fontSize: 15, fontWeight: 700, color: \"#6366f1\", textAlign: \"right\", flexShrink: 0 }}>{token.replace('z-','')}</span>",
|
|
1770
|
+
" <span style={{ width: 36, fontSize: 15, fontWeight: 700, color: \"var(--color-primary, #6366f1)\", textAlign: \"right\", flexShrink: 0 }}>{token.replace('z-','')}</span>",
|
|
1654
1771
|
" <div>",
|
|
1655
1772
|
" <span style={{ fontSize: 12, fontWeight: 600 }}>{token}</span>",
|
|
1656
1773
|
" {zSemantics[token] ? <span style={{ fontSize: 11, color: \"#9ca3af\", marginLeft: 8 }}>{zSemantics[token]}</span> : null}",
|
|
@@ -1731,7 +1848,7 @@ function writeFoundationsStories(foundations) {
|
|
|
1731
1848
|
" <div style={{",
|
|
1732
1849
|
" width: isFull ? 64 : 72,",
|
|
1733
1850
|
" height: isFull ? 64 : 56,",
|
|
1734
|
-
" background: \"
|
|
1851
|
+
" background: \"var(--color-primary, #6366f1)\",",
|
|
1735
1852
|
" borderRadius: isFull ? \"50%\" : value === \"0px\" || value === \"0\" ? 0 : value,",
|
|
1736
1853
|
" flexShrink: 0,",
|
|
1737
1854
|
" }} />",
|
|
@@ -1801,7 +1918,7 @@ function writeFoundationsStories(foundations) {
|
|
|
1801
1918
|
" position: \"absolute\",",
|
|
1802
1919
|
" top: 4, left: active ? 172 : 4,",
|
|
1803
1920
|
" width: 44, height: 24,",
|
|
1804
|
-
" background: \"
|
|
1921
|
+
" background: \"var(--color-primary, #6366f1)\",",
|
|
1805
1922
|
" borderRadius: 6,",
|
|
1806
1923
|
" transition: `left ${value} cubic-bezier(0.4,0,0.2,1)`,",
|
|
1807
1924
|
" }} />",
|