vibe-design-system 2.5.31 → 2.5.32
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
|
@@ -67,10 +67,12 @@ VDS, **tek komutla** projenizin design system'ını Storybook'ta stilleriyle eş
|
|
|
67
67
|
|
|
68
68
|
Kullanıcının her projede ayrı ayrı provider eklemesi, manuel story düzeltmesi veya birden fazla komut çalıştırması gerekmez. Nadir kalan hatalar (belirli bir component'ın özel context'i) story dosyasında args/mock ile giderilir.
|
|
69
69
|
|
|
70
|
+
**"Failed to fetch dynamically imported module"** genelde o story veya component dosyasındaki hatalı/eksik import'tan kaynaklanır; ilgili .stories.tsx veya component'ı kontrol edin veya o component'ı VDS skip listesine ekleyin.
|
|
71
|
+
|
|
70
72
|
## Layout
|
|
71
73
|
|
|
72
74
|
- `vds-core/scan.mjs` — Projeyi tarar (src/components, CSS, Tailwind). `vds-output.json` ve `public/vds-output.json` yazar.
|
|
73
|
-
- `vds-core/story-generator.mjs` — `vds-output.json`'dan story'leri üretir; varsayılan args
|
|
75
|
+
- `vds-core/story-generator.mjs` — `vds-output.json`'dan story'leri üretir; varsayılan args: filters/dateRange, sayı, tarih, modal/drawer için isOpen/open: true, onClose/onSave vb. no-op, circle/user/nav/allocation mock objeleri (visibility, path hatalarını önler).
|
|
74
76
|
- `vds-core/setup-storybook-providers.mjs` — Hook ve react-dnd kullanımını tespit eder, `.storybook/preview` decorator'larına provider ekler.
|
|
75
77
|
- `vds-core/VdsPreview.tsx` — İsteğe bağlı; `/vds-preview` ile dashboard canlı component önizlemesi yapar.
|
|
76
78
|
- Dashboard UI `/vds-output.json` okur; Foundations + Component Library gösterir.
|
|
@@ -613,6 +613,10 @@ function buildDefaultArgsForRequiredProps(props, usageFromPages = null, componen
|
|
|
613
613
|
return JSON.stringify("Example");
|
|
614
614
|
};
|
|
615
615
|
|
|
616
|
+
const HANDLER_PROPS = new Set(["onClose", "onOpenChange", "onSave", "onDelete", "onBudgetCreated", "onTaskCreated", "onOpenChange"]);
|
|
617
|
+
const OPEN_PROPS = new Set(["isOpen", "open"]);
|
|
618
|
+
const isFunctionType = (t) => /=>\s*void|\(\s*\)\s*=>|function\s*\(/.test(t) || /^\([^)]*\)\s*=>\s*void/.test(t);
|
|
619
|
+
|
|
616
620
|
if (Array.isArray(props) && props.length > 0) {
|
|
617
621
|
for (const p of props) {
|
|
618
622
|
const type = String(p.type || "").trim();
|
|
@@ -626,6 +630,26 @@ function buildDefaultArgsForRequiredProps(props, usageFromPages = null, componen
|
|
|
626
630
|
added.add(name);
|
|
627
631
|
continue;
|
|
628
632
|
}
|
|
633
|
+
if (OPEN_PROPS.has(name)) {
|
|
634
|
+
argLines.push(` ${name}: true,`);
|
|
635
|
+
added.add(name);
|
|
636
|
+
continue;
|
|
637
|
+
}
|
|
638
|
+
if (HANDLER_PROPS.has(name) && isFunctionType(type)) {
|
|
639
|
+
argLines.push(` ${name}: () => {},`);
|
|
640
|
+
added.add(name);
|
|
641
|
+
continue;
|
|
642
|
+
}
|
|
643
|
+
if (name === "allocation" && (/object|union|Allocation/.test(type) || !type)) {
|
|
644
|
+
argLines.push(` ${name}: { id: "1", resourceId: "1", budget: 0, used: 0 },`);
|
|
645
|
+
added.add(name);
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
if (name === "user" && (/object|any|User/.test(type) || !type)) {
|
|
649
|
+
argLines.push(` ${name}: { id: "1", name: "User", email: "user@example.com" },`);
|
|
650
|
+
added.add(name);
|
|
651
|
+
continue;
|
|
652
|
+
}
|
|
629
653
|
if (!required) continue;
|
|
630
654
|
if (/LucideIcon|lucide-react/.test(type)) {
|
|
631
655
|
const iconName = LUCIDE_ICON_DEFAULT;
|
|
@@ -670,6 +694,27 @@ function buildDefaultArgsForRequiredProps(props, usageFromPages = null, componen
|
|
|
670
694
|
} else if (/number/.test(type) || NUMBER_LIKE_OPTIONAL.has(name)) {
|
|
671
695
|
argLines.push(` ${name}: ${name === "visibility" ? "1" : "0"},`);
|
|
672
696
|
added.add(name);
|
|
697
|
+
} else if (OPEN_PROPS.has(name)) {
|
|
698
|
+
argLines.push(` ${name}: true,`);
|
|
699
|
+
added.add(name);
|
|
700
|
+
} else if (HANDLER_PROPS.has(name)) {
|
|
701
|
+
argLines.push(` ${name}: () => {},`);
|
|
702
|
+
added.add(name);
|
|
703
|
+
} else if (name === "circle" || /Circle\b/.test(type)) {
|
|
704
|
+
argLines.push(` ${name}: { id: "1", name: "Example", visibility: 1 },`);
|
|
705
|
+
added.add(name);
|
|
706
|
+
} else if (name === "item" || name === "navItem" || /NavItem|Nav.*Item/.test(type)) {
|
|
707
|
+
argLines.push(` ${name}: { path: "/", label: "Example", id: "1" },`);
|
|
708
|
+
added.add(name);
|
|
709
|
+
} else if (name === "allocation") {
|
|
710
|
+
argLines.push(` ${name}: { id: "1", resourceId: "1", budget: 0, used: 0 },`);
|
|
711
|
+
added.add(name);
|
|
712
|
+
} else if (name === "user") {
|
|
713
|
+
argLines.push(` ${name}: { id: "1", name: "User", email: "user@example.com" },`);
|
|
714
|
+
added.add(name);
|
|
715
|
+
} else if (name === "defaultProjectId") {
|
|
716
|
+
argLines.push(` ${name}: "1",`);
|
|
717
|
+
added.add(name);
|
|
673
718
|
}
|
|
674
719
|
}
|
|
675
720
|
}
|