vibe-design-system 2.8.73 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-design-system",
3
- "version": "2.8.73",
3
+ "version": "2.8.74",
4
4
  "description": "Auto-generate design systems for vibe coding projects",
5
5
  "homepage": "https://vibedesign.tech",
6
6
  "repository": {
@@ -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
- (foundations?.tokenUsage?.animations || [])
3597
- .filter(a => a.token.startsWith("duration-"))
3598
- .map(a => a.token.replace("duration-", ""))
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 from tokenUsage
3602
- const motionChips = (foundations?.tokenUsage?.animations || []).slice(0, 24);
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\";",
@@ -4693,7 +4711,7 @@ function main() {
4693
4711
 
4694
4712
  ensureDir(STORIES_DIR);
4695
4713
  ensureDir(path.join(STORIES_DIR, "foundations"));
4696
- writeFoundationsStories(foundations);
4714
+ writeFoundationsStories(foundations, components);
4697
4715
  writeCursorRules(components, foundations);
4698
4716
  const componentSuggestions = data.componentSuggestions;
4699
4717
  if (componentSuggestions?.length) {