vibe-design-system 2.8.72 → 2.8.74
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
|
@@ -2415,7 +2415,7 @@ function scanGridSystemFallback() {
|
|
|
2415
2415
|
return { breakpoints, gridCols, gaps, maxWidths, containerCount };
|
|
2416
2416
|
}
|
|
2417
2417
|
|
|
2418
|
-
function writeFoundationsStories(foundations) {
|
|
2418
|
+
function writeFoundationsStories(foundations, components) {
|
|
2419
2419
|
const foundationsDir = path.join(STORIES_DIR, "foundations");
|
|
2420
2420
|
ensureDir(foundationsDir);
|
|
2421
2421
|
|
|
@@ -3591,15 +3591,33 @@ function writeFoundationsStories(foundations) {
|
|
|
3591
3591
|
const effectiveEasings = easingRows.length > 0 ? easingRows.slice(0, 4) : TAILWIND_DEFAULT_EASINGS;
|
|
3592
3592
|
const hasCustomDurations = durationRows.length > 0;
|
|
3593
3593
|
|
|
3594
|
+
// ── Scan comp.tokens[] for all motion utilities (project-specific) ─────────
|
|
3595
|
+
// This captures transition-*, duration-*, animate-*, ease-*, delay-* from every component
|
|
3596
|
+
const motionPattern = /^(transition|duration|animate|ease|delay)-/;
|
|
3597
|
+
const compMotionCounts = {};
|
|
3598
|
+
for (const comp of (components || [])) {
|
|
3599
|
+
for (const tok of (comp.tokens || [])) {
|
|
3600
|
+
if (motionPattern.test(tok)) {
|
|
3601
|
+
compMotionCounts[tok] = (compMotionCounts[tok] || 0) + 1;
|
|
3602
|
+
}
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
// Merge with tokenUsage.animations (captures animate-* from page-level scans too)
|
|
3606
|
+
for (const a of (foundations?.tokenUsage?.animations || [])) {
|
|
3607
|
+
compMotionCounts[a.token] = (compMotionCounts[a.token] || 0) + a.count;
|
|
3608
|
+
}
|
|
3594
3609
|
// Which duration tokens are actually used in the project?
|
|
3595
3610
|
const usedDurationKeys = new Set(
|
|
3596
|
-
(
|
|
3597
|
-
.filter(
|
|
3598
|
-
.map(
|
|
3611
|
+
Object.keys(compMotionCounts)
|
|
3612
|
+
.filter(t => t.startsWith("duration-"))
|
|
3613
|
+
.map(t => t.replace("duration-", ""))
|
|
3599
3614
|
);
|
|
3600
3615
|
|
|
3601
|
-
// All motion-related token chips
|
|
3602
|
-
const motionChips =
|
|
3616
|
+
// All motion-related token chips sorted by usage count
|
|
3617
|
+
const motionChips = Object.entries(compMotionCounts)
|
|
3618
|
+
.sort((a, b) => b[1] - a[1])
|
|
3619
|
+
.slice(0, 24)
|
|
3620
|
+
.map(([token, count]) => ({ token, count }));
|
|
3603
3621
|
|
|
3604
3622
|
const motionContent = [
|
|
3605
3623
|
"import React from \"react\";",
|
|
@@ -3918,7 +3936,7 @@ function buildInventoryPreviewHtml(compName, category, colorSwatches, tokens) {
|
|
|
3918
3936
|
if (/^(tabs|tab)$/.test(n)) {
|
|
3919
3937
|
return wrap(`<div style="width:85%;box-sizing:border-box"><div style="display:flex;background:${bg};border-radius:${rad}px;padding:3px;gap:2px"><div style="flex:1;background:${bg === "#f3f4f6" ? "#fff" : hex2(bg)};border-radius:${Math.max(rad-2,2)}px;padding:4px 0;font-size:10px;font-weight:600;color:${txt};text-align:center">Tab 1</div><div style="flex:1;padding:4px 0;font-size:10px;color:${txt};opacity:0.5;text-align:center">Tab 2</div><div style="flex:1;padding:4px 0;font-size:10px;color:${txt};opacity:0.5;text-align:center">Tab 3</div></div></div>`);
|
|
3920
3938
|
}
|
|
3921
|
-
if (/^(table|datatable)$/.test(n) || category === "Text and Data Display") {
|
|
3939
|
+
if (/^(table|datatable)$/.test(n) || (category === "Text and Data Display" && !/chart|sparkline/.test(n))) {
|
|
3922
3940
|
return wrap(`<div style="border:1px solid ${brd};border-radius:${rad}px;overflow:hidden;width:85%;box-sizing:border-box"><div style="display:flex;background:${hex2(bg)};border-bottom:1px solid ${brd};padding:4px 8px;gap:8px">${[1,1,1].map(()=>`<div style="flex:1;height:5px;background:${txt};opacity:0.3;border-radius:1px"></div>`).join("")}</div><div style="display:flex;background:${bg};padding:4px 8px;gap:8px">${[1,1,1].map(()=>`<div style="flex:1;height:5px;background:${txt};opacity:0.15;border-radius:1px"></div>`).join("")}</div><div style="display:flex;background:${bg};padding:4px 8px;gap:8px;opacity:0.7">${[1,1,1].map(()=>`<div style="flex:1;height:5px;background:${txt};opacity:0.15;border-radius:1px"></div>`).join("")}</div></div>`);
|
|
3923
3941
|
}
|
|
3924
3942
|
if (/^(sidebar|appsidebar)$/.test(n)) {
|
|
@@ -4189,11 +4207,17 @@ function writeComponentInventoryStory(components, foundations) {
|
|
|
4189
4207
|
});
|
|
4190
4208
|
|
|
4191
4209
|
// ── PREVIEWS map: only shadcn UI primitives (safe to render with no props) ──
|
|
4192
|
-
|
|
4210
|
+
// Components that need context providers or have no visible closed state — use shape HTML
|
|
4211
|
+
const PREVIEW_CONTEXT_SKIP = new Set(['toast', 'toaster', 'sonner', 'usetoast', 'alertdialog', 'hovercard']);
|
|
4212
|
+
// Container/text components that need children to be visible (renders text inside)
|
|
4213
|
+
const TEXT_CHILD_NAMES = new Set(['button','badge','toggle','label','link','chip','tag','pill','card','alert','marketstatscard']);
|
|
4193
4214
|
const previewEntries = components
|
|
4194
4215
|
.filter(comp => {
|
|
4195
4216
|
const info = importInfoMap[comp.name];
|
|
4196
|
-
|
|
4217
|
+
if (!info || info.skip || !info.isShadcn) return false;
|
|
4218
|
+
// Skip components that require context providers (Toast, Toaster, Sonner)
|
|
4219
|
+
if (PREVIEW_CONTEXT_SKIP.has(info.identifier.toLowerCase())) return false;
|
|
4220
|
+
return true;
|
|
4197
4221
|
})
|
|
4198
4222
|
.map(comp => {
|
|
4199
4223
|
const { identifier } = importInfoMap[comp.name];
|
|
@@ -4687,7 +4711,7 @@ function main() {
|
|
|
4687
4711
|
|
|
4688
4712
|
ensureDir(STORIES_DIR);
|
|
4689
4713
|
ensureDir(path.join(STORIES_DIR, "foundations"));
|
|
4690
|
-
writeFoundationsStories(foundations);
|
|
4714
|
+
writeFoundationsStories(foundations, components);
|
|
4691
4715
|
writeCursorRules(components, foundations);
|
|
4692
4716
|
const componentSuggestions = data.componentSuggestions;
|
|
4693
4717
|
if (componentSuggestions?.length) {
|